From: support Date: Tue, 10 Jan 2023 10:16:06 +0000 (+0000) Subject: Built motion from commit ae138b72.|2.6.28 X-Git-Url: http://repos.xcallymotion.com/base//%22?a=commitdiff_plain;h=8d15eb5ea9762578218a151897e13ec5fddf3abb;p=motion2.git Built motion from commit ae138b72.|2.6.28 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9c9ab65..17dee92 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-09T09:16:07.732Z", + "time": "2023-01-10T10:07:17.295Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f175204..813bb80 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-09T09:16:07.732Z", + "time": "2023-01-10T10:07:17.295Z", "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 a8504b2..0b88d18 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 _0x0943=['exports','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize'];(function(_0x1599ae,_0x50ac2b){var _0x5c97cc=function(_0x4e0c3b){while(--_0x4e0c3b){_0x1599ae['push'](_0x1599ae['shift']());}};_0x5c97cc(++_0x50ac2b);}(_0x0943,0x164));var _0x3094=function(_0x346994,_0x53f2d9){_0x346994=_0x346994-0x0;var _0x6f32a4=_0x0943[_0x346994];return _0x6f32a4;};'use strict';var Sequelize=require(_0x3094('0x0'));module[_0x3094('0x1')]={'name':{'type':Sequelize[_0x3094('0x2')],'get':function(_0x121927){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x3094('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3094('0x4'),_0x3094('0x5'),_0x3094('0x6'),_0x3094('0x7'),'urlForward','browser',_0x3094('0x8'),_0x3094('0x9')]],'msg':_0x3094('0xa')}},'comment':_0x3094('0xa')},'data1':{'type':Sequelize[_0x3094('0x3')](0x1000),'comment':_0x3094('0xb')},'data2':{'type':Sequelize[_0x3094('0x3')](0x1000),'comment':_0x3094('0xc')},'data3':{'type':Sequelize[_0x3094('0x3')](0x1000),'comment':_0x3094('0xd')},'data4':{'type':Sequelize[_0x3094('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x3094('0x3')](0x1000),'comments':_0x3094('0xe')},'data6':{'type':Sequelize[_0x3094('0x3')],'comments':_0x3094('0xf')},'data7':{'type':Sequelize[_0x3094('0x10')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x683f=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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','action','integration','motionbar','jscripty','urlForward','bot','script'];(function(_0x16bfeb,_0x20684f){var _0x4da8a7=function(_0x34e70d){while(--_0x34e70d){_0x16bfeb['push'](_0x16bfeb['shift']());}};_0x4da8a7(++_0x20684f);}(_0x683f,0x18e));var _0xf683=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x683f[_0x35a274];return _0x40d905;};'use strict';var Sequelize=require(_0xf683('0x0'));module[_0xf683('0x1')]={'name':{'type':Sequelize[_0xf683('0x2')],'get':function(_0x448e3f){return this['getDataValue'](_0xf683('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xf683('0x4'),_0xf683('0x5'),_0xf683('0x6'),_0xf683('0x7'),'browser',_0xf683('0x8'),_0xf683('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xf683('0xa')},'data1':{'type':Sequelize[_0xf683('0xb')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0xf683('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xf683('0xb')](0x1000),'comment':_0xf683('0xc')},'data4':{'type':Sequelize[_0xf683('0xb')](0x1000),'comments':_0xf683('0xd')},'data5':{'type':Sequelize[_0xf683('0xb')](0x1000),'comments':_0xf683('0xe')},'data6':{'type':Sequelize[_0xf683('0xb')],'comments':_0xf683('0xf')},'data7':{'type':Sequelize[_0xf683('0x10')],'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 7785991..b144405 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 _0xbda5=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','send','body','params','catch','destroy','Action','find','rimraf','fast-json-patch','moment'];(function(_0x39b7d8,_0xa44989){var _0x42d6dd=function(_0x2922ab){while(--_0x2922ab){_0x39b7d8['push'](_0x39b7d8['shift']());}};_0x42d6dd(++_0xa44989);}(_0xbda5,0x7e));var _0x5bda=function(_0x3ebbe3,_0x5d7624){_0x3ebbe3=_0x3ebbe3-0x0;var _0x5b407b=_0xbda5[_0x3ebbe3];return _0x5b407b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bda('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bda('0x1'));var rp=require('request-promise');var moment=require(_0x5bda('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5bda('0x3'));var util=require(_0x5bda('0x4'));var path=require('path');var sox=require(_0x5bda('0x5'));var csv=require(_0x5bda('0x6'));var ejs=require(_0x5bda('0x7'));var fs=require('fs');var fs_extra=require(_0x5bda('0x8'));var _=require(_0x5bda('0x9'));var squel=require('squel');var crypto=require(_0x5bda('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5bda('0x6'));var querystring=require('querystring');var Papa=require(_0x5bda('0xb'));var Redis=require(_0x5bda('0xc'));var authService=require(_0x5bda('0xd'));var qs=require(_0x5bda('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bda('0xf'));var logger=require(_0x5bda('0x10'))(_0x5bda('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5bda('0x12'));var db=require(_0x5bda('0x13'))['db'];function respondWithStatusCode(_0x595ab4,_0x59f097){_0x59f097=_0x59f097||0xcc;return function(_0xfe475e){if(_0xfe475e){return _0x595ab4[_0x5bda('0x14')](_0x59f097);}return _0x595ab4[_0x5bda('0x15')](_0x59f097)[_0x5bda('0x16')]();};}function respondWithResult(_0x443ae9,_0x1d51f9){_0x1d51f9=_0x1d51f9||0xc8;return function(_0x4c4ec5){if(_0x4c4ec5){return _0x443ae9[_0x5bda('0x15')](_0x1d51f9)[_0x5bda('0x17')](_0x4c4ec5);}};}function respondWithFilteredResult(_0x3baecd,_0x38bd63){return function(_0x49642f){if(_0x49642f){var _0x2a1402=typeof _0x38bd63[_0x5bda('0x18')]===_0x5bda('0x19')&&typeof _0x38bd63[_0x5bda('0x1a')]===_0x5bda('0x19');var _0x4dd1b7=_0x49642f[_0x5bda('0x1b')];var _0x892463=_0x2a1402?0x0:_0x38bd63[_0x5bda('0x18')];var _0x11dca7=_0x2a1402?_0x49642f[_0x5bda('0x1b')]:_0x38bd63[_0x5bda('0x18')]+_0x38bd63[_0x5bda('0x1a')];var _0x484b9d;if(_0x11dca7>=_0x4dd1b7){_0x11dca7=_0x4dd1b7;_0x484b9d=0xc8;}else{_0x484b9d=0xce;}_0x3baecd[_0x5bda('0x15')](_0x484b9d);return _0x3baecd['set'](_0x5bda('0x1c'),_0x892463+'-'+_0x11dca7+'/'+_0x4dd1b7)['json'](_0x49642f);}return null;};}function patchUpdates(_0x467cee){return function(_0x1d3648){try{jsonpatch[_0x5bda('0x1d')](_0x1d3648,_0x467cee,!![]);}catch(_0x30ebb1){return BPromise[_0x5bda('0x1e')](_0x30ebb1);}return _0x1d3648[_0x5bda('0x1f')]();};}function saveUpdates(_0x253c81,_0x5d5695){return function(_0x934e43){if(_0x934e43){return _0x934e43[_0x5bda('0x20')](_0x253c81)[_0x5bda('0x21')](function(_0x30ec6f){return _0x30ec6f;});}return null;};}function removeEntity(_0x290987,_0x20a584){return function(_0x4a878e){if(_0x4a878e){return _0x4a878e['destroy']()[_0x5bda('0x21')](function(){_0x290987['status'](0xcc)[_0x5bda('0x16')]();});}};}function handleEntityNotFound(_0x57754c,_0x346221){return function(_0x49722c){if(!_0x49722c){_0x57754c[_0x5bda('0x14')](0x194);}return _0x49722c;};}function handleError(_0x494ee0,_0x373f11){_0x373f11=_0x373f11||0x1f4;return function(_0x1acf52){logger[_0x5bda('0x22')](_0x1acf52[_0x5bda('0x23')]);if(_0x1acf52['name']){delete _0x1acf52['name'];}_0x494ee0['status'](_0x373f11)[_0x5bda('0x24')](_0x1acf52);};}exports['update']=function(_0x21b610,_0x2fac0d){if(_0x21b610[_0x5bda('0x25')]['id']){delete _0x21b610[_0x5bda('0x25')]['id'];}return db['Action']['find']({'where':{'id':_0x21b610[_0x5bda('0x26')]['id']}})[_0x5bda('0x21')](handleEntityNotFound(_0x2fac0d,null))['then'](saveUpdates(_0x21b610[_0x5bda('0x25')],null))[_0x5bda('0x21')](respondWithResult(_0x2fac0d,null))[_0x5bda('0x27')](handleError(_0x2fac0d,null));};exports[_0x5bda('0x28')]=function(_0x1bdd16,_0x2e25be){return db[_0x5bda('0x29')][_0x5bda('0x2a')]({'where':{'id':_0x1bdd16['params']['id']}})[_0x5bda('0x21')](handleEntityNotFound(_0x2e25be,null))[_0x5bda('0x21')](removeEntity(_0x2e25be,null))[_0x5bda('0x27')](handleError(_0x2e25be,null));}; \ No newline at end of file +var _0x7203=['update','then','destroy','stack','name','send','body','Action','params','catch','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7203,0x138));var _0x3720=function(_0x3ff0f0,_0x5523bf){_0x3ff0f0=_0x3ff0f0-0x0;var _0x5dc82a=_0x7203[_0x3ff0f0];return _0x5dc82a;};'use strict';var emlformat=require(_0x3720('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3720('0x1'));var jsonpatch=require(_0x3720('0x2'));var rp=require(_0x3720('0x3'));var moment=require('moment');var BPromise=require(_0x3720('0x4'));var Mustache=require(_0x3720('0x5'));var util=require(_0x3720('0x6'));var path=require(_0x3720('0x7'));var sox=require('sox');var csv=require(_0x3720('0x8'));var ejs=require(_0x3720('0x9'));var fs=require('fs');var fs_extra=require(_0x3720('0xa'));var _=require(_0x3720('0xb'));var squel=require('squel');var crypto=require(_0x3720('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3720('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3720('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3720('0xe'));var as=require(_0x3720('0xf'));var hardwareService=require(_0x3720('0x10'));var logger=require(_0x3720('0x11'))(_0x3720('0x12'));var utils=require(_0x3720('0x13'));var config=require(_0x3720('0x14'));var licenseUtil=require(_0x3720('0x15'));var db=require(_0x3720('0x16'))['db'];function respondWithStatusCode(_0x19aa3c,_0x4c7b08){_0x4c7b08=_0x4c7b08||0xcc;return function(_0x39b77d){if(_0x39b77d){return _0x19aa3c[_0x3720('0x17')](_0x4c7b08);}return _0x19aa3c[_0x3720('0x18')](_0x4c7b08)[_0x3720('0x19')]();};}function respondWithResult(_0x52b449,_0xd0578f){_0xd0578f=_0xd0578f||0xc8;return function(_0x595240){if(_0x595240){return _0x52b449[_0x3720('0x18')](_0xd0578f)[_0x3720('0x1a')](_0x595240);}};}function respondWithFilteredResult(_0x29d369,_0x13d164){return function(_0x598663){if(_0x598663){var _0x5b1ff0=typeof _0x13d164[_0x3720('0x1b')]===_0x3720('0x1c')&&typeof _0x13d164[_0x3720('0x1d')]===_0x3720('0x1c');var _0x214d85=_0x598663['count'];var _0x41de72=_0x5b1ff0?0x0:_0x13d164[_0x3720('0x1b')];var _0x29efb9=_0x5b1ff0?_0x598663['count']:_0x13d164['offset']+_0x13d164[_0x3720('0x1d')];var _0x3f4082;if(_0x29efb9>=_0x214d85){_0x29efb9=_0x214d85;_0x3f4082=0xc8;}else{_0x3f4082=0xce;}_0x29d369[_0x3720('0x18')](_0x3f4082);return _0x29d369[_0x3720('0x1e')](_0x3720('0x1f'),_0x41de72+'-'+_0x29efb9+'/'+_0x214d85)['json'](_0x598663);}return null;};}function patchUpdates(_0x1448a1){return function(_0xee4d71){try{jsonpatch['apply'](_0xee4d71,_0x1448a1,!![]);}catch(_0x117c61){return BPromise['reject'](_0x117c61);}return _0xee4d71['save']();};}function saveUpdates(_0x2422e4,_0x4bf8ce){return function(_0x3c06b1){if(_0x3c06b1){return _0x3c06b1[_0x3720('0x20')](_0x2422e4)[_0x3720('0x21')](function(_0x539472){return _0x539472;});}return null;};}function removeEntity(_0x443e6,_0x57ebb7){return function(_0xcb6ea9){if(_0xcb6ea9){return _0xcb6ea9[_0x3720('0x22')]()[_0x3720('0x21')](function(){_0x443e6['status'](0xcc)[_0x3720('0x19')]();});}};}function handleEntityNotFound(_0x33aed3,_0x122fd6){return function(_0x81af04){if(!_0x81af04){_0x33aed3[_0x3720('0x17')](0x194);}return _0x81af04;};}function handleError(_0x16fb7b,_0x275516){_0x275516=_0x275516||0x1f4;return function(_0x2eade4){logger['error'](_0x2eade4[_0x3720('0x23')]);if(_0x2eade4['name']){delete _0x2eade4[_0x3720('0x24')];}_0x16fb7b['status'](_0x275516)[_0x3720('0x25')](_0x2eade4);};}exports[_0x3720('0x20')]=function(_0xb7f253,_0x4b52af){if(_0xb7f253[_0x3720('0x26')]['id']){delete _0xb7f253[_0x3720('0x26')]['id'];}return db[_0x3720('0x27')]['find']({'where':{'id':_0xb7f253[_0x3720('0x28')]['id']}})[_0x3720('0x21')](handleEntityNotFound(_0x4b52af,null))[_0x3720('0x21')](saveUpdates(_0xb7f253['body'],null))[_0x3720('0x21')](respondWithResult(_0x4b52af,null))[_0x3720('0x29')](handleError(_0x4b52af,null));};exports['destroy']=function(_0x5e62e4,_0x5f25f7){return db[_0x3720('0x27')][_0x3720('0x2a')]({'where':{'id':_0x5e62e4[_0x3720('0x28')]['id']}})[_0x3720('0x21')](handleEntityNotFound(_0x5f25f7,null))[_0x3720('0x21')](removeEntity(_0x5f25f7,null))['catch'](handleError(_0x5f25f7,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index a981892..4f649a4 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 _0x6349=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x276525,_0x31e9ca){var _0x95ef1c=function(_0x5a4fd2){while(--_0x5a4fd2){_0x276525['push'](_0x276525['shift']());}};_0x95ef1c(++_0x31e9ca);}(_0x6349,0x193));var _0x9634=function(_0x5ab14c,_0x2926a1){_0x5ab14c=_0x5ab14c-0x0;var _0x546147=_0x6349[_0x5ab14c];return _0x546147;};'use strict';var _=require(_0x9634('0x0'));var util=require(_0x9634('0x1'));var logger=require(_0x9634('0x2'))(_0x9634('0x3'));var moment=require(_0x9634('0x4'));var BPromise=require('bluebird');var rp=require(_0x9634('0x5'));var fs=require('fs');var path=require(_0x9634('0x6'));var rimraf=require('rimraf');var config=require(_0x9634('0x7'));var attributes=require(_0x9634('0x8'));module[_0x9634('0x9')]=function(_0x335483,_0x2f5992){return _0x335483[_0x9634('0xa')](_0x9634('0xb'),attributes,{'tableName':_0x9634('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6d1=['./action.attributes','exports','define','../../config/logger','api','rimraf'];(function(_0x38949c,_0x311001){var _0x33466a=function(_0xfebbee){while(--_0xfebbee){_0x38949c['push'](_0x38949c['shift']());}};_0x33466a(++_0x311001);}(_0xa6d1,0x19b));var _0x1a6d=function(_0x5b1241,_0x4f5155){_0x5b1241=_0x5b1241-0x0;var _0x1b4e2d=_0xa6d1[_0x5b1241];return _0x1b4e2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a6d('0x0'))(_0x1a6d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a6d('0x2'));var config=require('../../config/environment');var attributes=require(_0x1a6d('0x3'));module[_0x1a6d('0x4')]=function(_0x3778a9,_0x199227){return _0x3778a9[_0x1a6d('0x5')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 85f8ee5..792f54d 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +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(_0xbcb94f,_0x54fe63){var _0x14a1b8=function(_0x96af90){while(--_0x96af90){_0xbcb94f['push'](_0xbcb94f['shift']());}};_0x14a1b8(++_0x54fe63);}(_0x8ef6,0xf2));var _0x68ef=function(_0x54f61d,_0x28baf4){_0x54f61d=_0x54f61d-0x0;var _0x4bb3e9=_0x8ef6[_0x54f61d];return _0x4bb3e9;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3fa24ed..4f9d9a2 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 _0x7119=['update','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated'];(function(_0x84e373,_0x5473c7){var _0x4fdc83=function(_0x372954){while(--_0x372954){_0x84e373['push'](_0x84e373['shift']());}};_0x4fdc83(++_0x5473c7);}(_0x7119,0xb6));var _0x9711=function(_0x23c02b,_0x411b4d){_0x23c02b=_0x23c02b-0x0;var _0x25efc5=_0x7119[_0x23c02b];return _0x25efc5;};'use strict';var multer=require(_0x9711('0x0'));var util=require(_0x9711('0x1'));var path=require(_0x9711('0x2'));var timeout=require('connect-timeout');var express=require(_0x9711('0x3'));var router=express['Router']();var fs_extra=require(_0x9711('0x4'));var auth=require(_0x9711('0x5'));var interaction=require(_0x9711('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x9711('0x7')](_0x9711('0x8'),auth[_0x9711('0x9')](),controller[_0x9711('0xa')]);router['delete']('/:id',auth[_0x9711('0x9')](),controller[_0x9711('0xb')]);module['exports']=router; \ No newline at end of file +var _0x7f75=['./action.controller','put','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x278ccc,_0x4619e9){var _0x283f73=function(_0x5655e1){while(--_0x5655e1){_0x278ccc['push'](_0x278ccc['shift']());}};_0x283f73(++_0x4619e9);}(_0x7f75,0x96));var _0x57f7=function(_0x186e77,_0x408518){_0x186e77=_0x186e77-0x0;var _0x590425=_0x7f75[_0x186e77];return _0x590425;};'use strict';var multer=require(_0x57f7('0x0'));var util=require('util');var path=require(_0x57f7('0x1'));var timeout=require('connect-timeout');var express=require(_0x57f7('0x2'));var router=express[_0x57f7('0x3')]();var fs_extra=require(_0x57f7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x57f7('0x5'));var config=require('../../config/environment');var controller=require(_0x57f7('0x6'));router[_0x57f7('0x7')](_0x57f7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x57f7('0x9')](_0x57f7('0x8'),auth['isAuthenticated'](),controller[_0x57f7('0xa')]);module[_0x57f7('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index a12977b..5c1f204 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 _0x8958=['TEXT','exports'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x8958,0x93));var _0x8895=function(_0x185173,_0x46b778){_0x185173=_0x185173-0x0;var _0x4db624=_0x8958[_0x185173];return _0x4db624;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4df2ff,_0x3cb8ca){_0x4df2ff=_0x4df2ff-0x0;var _0x3b4d97=_0x8ef6[_0x4df2ff];return _0x3b4d97;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6d1c409..8722803 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 _0x165e=['value','from','metric','function','parentKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','replace','format','groupBy','order','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)'];(function(_0x2c9d30,_0xb7653e){var _0x2ca878=function(_0x2923ef){while(--_0x2923ef){_0x2c9d30['push'](_0x2c9d30['shift']());}};_0x2ca878(++_0xb7653e);}(_0x165e,0x16e));var _0xe165=function(_0x4983f4,_0x107731){_0x4983f4=_0x4983f4-0x0;var _0xbac14f=_0x165e[_0x4983f4];return _0xbac14f;};'use strict';var emlformat=require(_0xe165('0x0'));var rimraf=require(_0xe165('0x1'));var zipdir=require(_0xe165('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe165('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe165('0x4'));var util=require('util');var path=require(_0xe165('0x5'));var sox=require(_0xe165('0x6'));var csv=require(_0xe165('0x7'));var ejs=require(_0xe165('0x8'));var fs=require('fs');var fs_extra=require(_0xe165('0x9'));var _=require(_0xe165('0xa'));var squel=require(_0xe165('0xb'));var crypto=require(_0xe165('0xc'));var jsforce=require(_0xe165('0xd'));var deskjs=require(_0xe165('0xe'));var toCsv=require(_0xe165('0x7'));var querystring=require(_0xe165('0xf'));var Papa=require(_0xe165('0x10'));var Redis=require(_0xe165('0x11'));var authService=require(_0xe165('0x12'));var qs=require(_0xe165('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe165('0x14'))(_0xe165('0x15'));var utils=require('../../config/utils');var config=require(_0xe165('0x16'));var licenseUtil=require(_0xe165('0x17'));var db=require(_0xe165('0x18'))['db'];var dbH=require(_0xe165('0x18'))[_0xe165('0x19')];function respondWithStatusCode(_0x5eb04c,_0xc70627){_0xc70627=_0xc70627||0xcc;return function(_0x4aa057){if(_0x4aa057){return _0x5eb04c[_0xe165('0x1a')](_0xc70627);}return _0x5eb04c[_0xe165('0x1b')](_0xc70627)[_0xe165('0x1c')]();};}function respondWithResult(_0x30483f,_0x4b9fd0){_0x4b9fd0=_0x4b9fd0||0xc8;return function(_0x4f6838){if(_0x4f6838){return _0x30483f[_0xe165('0x1b')](_0x4b9fd0)[_0xe165('0x1d')](_0x4f6838);}};}function respondWithFilteredResult(_0x1dbce0,_0x486f22){return function(_0x242679){if(_0x242679){var _0x357304=typeof _0x486f22[_0xe165('0x1e')]===_0xe165('0x1f')&&typeof _0x486f22[_0xe165('0x20')]===_0xe165('0x1f');var _0x29168e=_0x242679[_0xe165('0x21')];var _0x18ce3a=_0x357304?0x0:_0x486f22[_0xe165('0x1e')];var _0x536402=_0x357304?_0x242679[_0xe165('0x21')]:_0x486f22['offset']+_0x486f22[_0xe165('0x20')];var _0x2b719f;if(_0x536402>=_0x29168e){_0x536402=_0x29168e;_0x2b719f=0xc8;}else{_0x2b719f=0xce;}_0x1dbce0[_0xe165('0x1b')](_0x2b719f);return _0x1dbce0['set']('Content-Range',_0x18ce3a+'-'+_0x536402+'/'+_0x29168e)[_0xe165('0x1d')](_0x242679);}return null;};}function patchUpdates(_0x33bf81){return function(_0x28bc4c){try{jsonpatch[_0xe165('0x22')](_0x28bc4c,_0x33bf81,!![]);}catch(_0xb479e0){return BPromise[_0xe165('0x23')](_0xb479e0);}return _0x28bc4c[_0xe165('0x24')]();};}function saveUpdates(_0x4186a0,_0xd0e7fd){return function(_0x4a0f6f){if(_0x4a0f6f){return _0x4a0f6f[_0xe165('0x25')](_0x4186a0)[_0xe165('0x26')](function(_0x4cc7f3){return _0x4cc7f3;});}return null;};}function removeEntity(_0xf97a3e,_0x2dc845){return function(_0x36a416){if(_0x36a416){return _0x36a416[_0xe165('0x27')]()[_0xe165('0x26')](function(){var _0xf66d74=_0x36a416[_0xe165('0x28')]({'plain':!![]});var _0x3f1983=_0xe165('0x29');return db[_0xe165('0x2a')]['destroy']({'where':{'type':_0x3f1983,'resourceId':_0xf66d74['id']}})[_0xe165('0x26')](function(){return _0x36a416;});})[_0xe165('0x26')](function(){_0xf97a3e[_0xe165('0x1b')](0xcc)[_0xe165('0x1c')]();});}};}function handleEntityNotFound(_0x40c279,_0x422d16){return function(_0x24a35e){if(!_0x24a35e){_0x40c279[_0xe165('0x1a')](0x194);}return _0x24a35e;};}function handleError(_0x45f7a5,_0x188731){_0x188731=_0x188731||0x1f4;return function(_0x23262e){logger[_0xe165('0x2b')](_0x23262e[_0xe165('0x2c')]);if(_0x23262e[_0xe165('0x2d')]){delete _0x23262e[_0xe165('0x2d')];}_0x45f7a5[_0xe165('0x1b')](_0x188731)[_0xe165('0x2e')](_0x23262e);};}exports[_0xe165('0x2f')]=function(_0x285d54,_0x21d203){var _0x3e6bb4={},_0x29bd68={},_0x234c48={'count':0x0,'rows':[]};var _0x439a28=_[_0xe165('0x30')](db[_0xe165('0x31')][_0xe165('0x32')],function(_0x382dfe){return{'name':_0x382dfe[_0xe165('0x33')],'type':_0x382dfe[_0xe165('0x34')][_0xe165('0x35')]};});_0x29bd68[_0xe165('0x36')]=_[_0xe165('0x30')](_0x439a28,_0xe165('0x2d'));_0x29bd68[_0xe165('0x37')]=_[_0xe165('0x38')](_0x285d54[_0xe165('0x37')]);_0x29bd68[_0xe165('0x39')]=_['intersection'](_0x29bd68[_0xe165('0x36')],_0x29bd68[_0xe165('0x37')]);_0x3e6bb4['attributes']=_[_0xe165('0x3a')](_0x29bd68['model'],qs[_0xe165('0x3b')](_0x285d54['query']['fields']));_0x3e6bb4[_0xe165('0x3c')]=_0x3e6bb4[_0xe165('0x3c')][_0xe165('0x3d')]?_0x3e6bb4[_0xe165('0x3c')]:_0x29bd68['model'];if(!_0x285d54[_0xe165('0x37')][_0xe165('0x3e')](_0xe165('0x3f'))){_0x3e6bb4[_0xe165('0x20')]=qs[_0xe165('0x20')](_0x285d54[_0xe165('0x37')][_0xe165('0x20')]);_0x3e6bb4[_0xe165('0x1e')]=qs['offset'](_0x285d54[_0xe165('0x37')][_0xe165('0x1e')]);}_0x3e6bb4['order']=qs[_0xe165('0x40')](_0x285d54[_0xe165('0x37')][_0xe165('0x40')]);_0x3e6bb4[_0xe165('0x41')]=qs[_0xe165('0x39')](_[_0xe165('0x42')](_0x285d54[_0xe165('0x37')],_0x29bd68[_0xe165('0x39')]),_0x439a28);if(_0x285d54[_0xe165('0x37')][_0xe165('0x43')]){_0x3e6bb4[_0xe165('0x41')]=_['merge'](_0x3e6bb4[_0xe165('0x41')],{'$or':_[_0xe165('0x30')](_0x439a28,function(_0x4755ad){if(_0x4755ad[_0xe165('0x34')]!==_0xe165('0x44')){var _0x44076e={};_0x44076e[_0x4755ad[_0xe165('0x2d')]]={'$like':'%'+_0x285d54[_0xe165('0x37')][_0xe165('0x43')]+'%'};return _0x44076e;}})});}_0x3e6bb4=_[_0xe165('0x45')]({},_0x3e6bb4,_0x285d54[_0xe165('0x46')]);var _0x13f29a={'where':_0x3e6bb4[_0xe165('0x41')]};return db[_0xe165('0x31')][_0xe165('0x21')](_0x13f29a)[_0xe165('0x26')](function(_0x310c83){_0x234c48[_0xe165('0x21')]=_0x310c83;if(_0x285d54[_0xe165('0x37')][_0xe165('0x47')]){_0x3e6bb4[_0xe165('0x48')]=[{'all':!![]}];}return db[_0xe165('0x31')][_0xe165('0x49')](_0x3e6bb4);})[_0xe165('0x26')](function(_0x9caf7f){_0x234c48[_0xe165('0x4a')]=_0x9caf7f;return _0x234c48;})['then'](respondWithFilteredResult(_0x21d203,_0x3e6bb4))[_0xe165('0x4b')](handleError(_0x21d203,null));};exports['show']=function(_0x1aefd7,_0x3d5715){var _0x24e8dd={'raw':![],'where':{'id':_0x1aefd7['params']['id']}},_0x49f18d={};_0x49f18d['model']=_[_0xe165('0x38')](db[_0xe165('0x31')]['rawAttributes']);_0x49f18d[_0xe165('0x37')]=_[_0xe165('0x38')](_0x1aefd7[_0xe165('0x37')]);_0x49f18d[_0xe165('0x39')]=_[_0xe165('0x3a')](_0x49f18d[_0xe165('0x36')],_0x49f18d[_0xe165('0x37')]);_0x24e8dd[_0xe165('0x3c')]=_[_0xe165('0x3a')](_0x49f18d[_0xe165('0x36')],qs[_0xe165('0x3b')](_0x1aefd7['query'][_0xe165('0x3b')]));_0x24e8dd[_0xe165('0x3c')]=_0x24e8dd[_0xe165('0x3c')][_0xe165('0x3d')]?_0x24e8dd['attributes']:_0x49f18d['model'];if(_0x1aefd7[_0xe165('0x37')][_0xe165('0x47')]){_0x24e8dd['include']=[{'all':!![]}];}_0x24e8dd=_['merge']({},_0x24e8dd,_0x1aefd7['options']);return db[_0xe165('0x31')][_0xe165('0x4c')](_0x24e8dd)[_0xe165('0x26')](handleEntityNotFound(_0x3d5715,null))[_0xe165('0x26')](respondWithResult(_0x3d5715,null))[_0xe165('0x4b')](handleError(_0x3d5715,null));};exports[_0xe165('0x4d')]=function(_0x5cd6b0,_0x1d6457){return db['AnalyticCustomReport']['create'](_0x5cd6b0['body'],{})['then'](function(_0x31d7be){var _0x1f1003=_0x5cd6b0['user'][_0xe165('0x28')]({'plain':!![]});if(!_0x1f1003)throw new Error(_0xe165('0x4e'));if(_0x1f1003[_0xe165('0x4f')]===_0xe165('0x50')){var _0x21b8f8=_0x31d7be[_0xe165('0x28')]({'plain':!![]});var _0x3ab7c8=_0xe165('0x51');return db[_0xe165('0x52')][_0xe165('0x4c')]({'where':{'name':_0x3ab7c8,'userProfileId':_0x1f1003['userProfileId']},'raw':!![]})[_0xe165('0x26')](function(_0x59a3a5){if(_0x59a3a5&&_0x59a3a5[_0xe165('0x53')]===0x0){return db[_0xe165('0x2a')][_0xe165('0x4d')]({'name':_0x21b8f8['name'],'resourceId':_0x21b8f8['id'],'type':_0xe165('0x29'),'sectionId':_0x59a3a5['id']},{})[_0xe165('0x26')](function(){return _0x31d7be;});}else{return _0x31d7be;}})[_0xe165('0x4b')](function(_0x579d0a){logger[_0xe165('0x2b')](_0xe165('0x54'),_0x579d0a);throw _0x579d0a;});}return _0x31d7be;})[_0xe165('0x26')](respondWithResult(_0x1d6457,0xc9))[_0xe165('0x4b')](handleError(_0x1d6457,null));};exports[_0xe165('0x25')]=function(_0x5199c0,_0x4a2f03){if(_0x5199c0[_0xe165('0x55')]['id']){delete _0x5199c0[_0xe165('0x55')]['id'];}return db[_0xe165('0x31')]['find']({'where':{'id':_0x5199c0[_0xe165('0x56')]['id']}})[_0xe165('0x26')](handleEntityNotFound(_0x4a2f03,null))[_0xe165('0x26')](saveUpdates(_0x5199c0[_0xe165('0x55')],null))['then'](respondWithResult(_0x4a2f03,null))[_0xe165('0x4b')](handleError(_0x4a2f03,null));};exports[_0xe165('0x27')]=function(_0x2198c8,_0x34c5e2){return db[_0xe165('0x31')][_0xe165('0x4c')]({'where':{'id':_0x2198c8[_0xe165('0x56')]['id']}})[_0xe165('0x26')](handleEntityNotFound(_0x34c5e2,null))[_0xe165('0x26')](removeEntity(_0x34c5e2,null))[_0xe165('0x4b')](handleError(_0x34c5e2,null));};exports['preview']=function(_0x48b603,_0x42b9e1){var _0x220e89=0xa;var _0x2624c2=[_0xe165('0x57'),_0xe165('0x58'),_0xe165('0x59'),_0xe165('0x5a')];var _0x16b79a={'SUM':_0xe165('0x5b'),'COUNT':_0xe165('0x5c'),'COUNT DISTINCT':_0xe165('0x5d'),'MAX':_0xe165('0x5e'),'MIN':_0xe165('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe165('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x49dee8={'SEC_TO_TIME':_0xe165('0x61'),'DATE':_0xe165('0x62'),'HOUR':_0xe165('0x63'),'ROUND':_0xe165('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xf074d1=function(_0x1eb45f){return!_[_0xe165('0x65')]([_0xe165('0x66'),_0xe165('0x67'),_0xe165('0x68'),_0xe165('0x69')],_0x1eb45f);};var _0x48a966=function(_0x12c016){if(!_0x12c016||!_0x12c016[_0xe165('0x6a')][_0xe165('0x3d')]){return'';}for(var _0x1794e8='(',_0x5a2ee4=0x0;_0x5a2ee4<_0x12c016[_0xe165('0x6a')][_0xe165('0x3d')];_0x5a2ee4+=0x1){_0x5a2ee4>0x0&&(_0x1794e8+='\x20'+_0x12c016['operator']+'\x20');_0x1794e8+=_0x12c016[_0xe165('0x6a')][_0x5a2ee4][_0xe165('0x6b')]?_0x48a966(_0x12c016[_0xe165('0x6a')][_0x5a2ee4]['group']):_0x12c016['rules'][_0x5a2ee4][_0xe165('0x6c')]+'\x20'+_0x12c016['rules'][_0x5a2ee4][_0xe165('0x6d')]+(_0xf074d1(_0x12c016['rules'][_0x5a2ee4][_0xe165('0x6d')])?'\x20'+_0x12c016[_0xe165('0x6a')][_0x5a2ee4]['value']:'');}return _0x1794e8+')';};var _0x2eb422={'where':{'id':_0x48b603['params']['id']}},_0x895c98,_0x28524c,_0xe12c0,_0x191f81,_0x43eb82;_0x2eb422=_[_0xe165('0x45')]({},_0x2eb422,_0x48b603['options']);return db[_0xe165('0x31')][_0xe165('0x4c')](_0x2eb422)[_0xe165('0x26')](function(_0x2ffc38){if(_0x2ffc38){_0x895c98=_0x2ffc38;return _0x2ffc38[_0xe165('0x6e')]();}return null;})[_0xe165('0x26')](function(_0x640004){if(_0x640004){if(!_0x640004[_0xe165('0x3d')]){throw new db[(_0xe165('0x6f'))][(_0xe165('0x70'))](_0xe165('0x71'),0x193);}_0x28524c=_0x640004;return db[_0xe165('0x72')][_0xe165('0x49')]({'raw':!![]});}return null;})[_0xe165('0x26')](function(_0x45acb8){if(_0x45acb8){_0xe12c0=_[_0xe165('0x73')](_0x45acb8,'id');var _0x5cf776;var _0x5a3a45=squel[_0xe165('0x74')]();_0x5a3a45['from'](_0x895c98['table']);for(var _0x3fbef6=0x0;_0x3fbef6<_0x28524c[_0xe165('0x3d')];_0x3fbef6+=0x1){_0x5cf776=_0x28524c[_0x3fbef6][_0xe165('0x75')]?_0xe12c0[_0x28524c[_0x3fbef6]['MetricId']]['metric']:_0x28524c[_0x3fbef6][_0xe165('0x6c')];_0x5cf776=_0x28524c[_0x3fbef6]['function']?_[_0xe165('0x76')](_0x16b79a[_0x28524c[_0x3fbef6]['function']],'%s',_0x5cf776):_0x5cf776;_0x5cf776=_0x28524c[_0x3fbef6]['format']?_[_0xe165('0x76')](_0x49dee8[_0x28524c[_0x3fbef6][_0xe165('0x77')]],'%s',_0x5cf776):_0x5cf776;if(_0x28524c[_0x3fbef6][_0xe165('0x78')]){_0x5a3a45[_0xe165('0x6b')](_0x5cf776);}_0x28524c[_0x3fbef6]['orderBy']&&_0x5a3a45[_0xe165('0x79')](_0x5cf776,_0x28524c[_0x3fbef6][_0xe165('0x7a')]===_0xe165('0x7b')?![]:!![]);_0x5a3a45[_0xe165('0x6c')](_0x5cf776,_0x28524c[_0x3fbef6][_0xe165('0x7c')]||_0x5cf776);}if(_0x895c98['joins']){_0x895c98[_0xe165('0x7d')]=JSON[_0xe165('0x7e')](_0x895c98['joins']);for(var _0x4af8e0=0x0;_0x4af8e0<_0x895c98[_0xe165('0x7d')][_0xe165('0x3d')];_0x4af8e0+=0x1){if(_0x895c98[_0xe165('0x7d')][_0x4af8e0][_0xe165('0x34')]&&_[_0xe165('0x65')](_0x2624c2,_0x895c98[_0xe165('0x7d')][_0x4af8e0][_0xe165('0x34')])&&_0x895c98[_0xe165('0x7d')][_0x4af8e0]['parentKey']&&_0x895c98[_0xe165('0x7d')][_0x4af8e0][_0xe165('0x7f')]&&_0x895c98[_0xe165('0x7d')][_0x4af8e0]['foreignKey']){_0x5a3a45[_0x895c98[_0xe165('0x7d')][_0x4af8e0][_0xe165('0x34')]](_0x895c98[_0xe165('0x7d')][_0x4af8e0][_0xe165('0x7f')],null,util[_0xe165('0x77')](_0xe165('0x80'),_0x895c98[_0xe165('0x81')],_0x895c98[_0xe165('0x7d')][_0x4af8e0]['parentKey'],_0x895c98[_0xe165('0x7d')][_0x4af8e0][_0xe165('0x7f')],_0x895c98[_0xe165('0x7d')][_0x4af8e0][_0xe165('0x82')]));}}}if(_0x895c98[_0xe165('0x83')]){_0x895c98[_0xe165('0x83')]=JSON[_0xe165('0x7e')](_0x895c98['conditions']);_0x5a3a45['where'](_0x48a966(_0x895c98['conditions'][_0xe165('0x6b')]));}_0x43eb82=_0x5a3a45[_0xe165('0x84')]();_0x5a3a45[_0xe165('0x20')](_0x220e89);_0x5a3a45[_0xe165('0x1e')](0x0);logger[_0xe165('0x85')](_0xe165('0x86'),_0x5a3a45[_0xe165('0x87')]());return dbH[_0xe165('0x88')][_0xe165('0x37')](_0x5a3a45[_0xe165('0x87')](),{'type':dbH[_0xe165('0x88')]['QueryTypes'][_0xe165('0x89')]});}})['then'](respondWithResult(_0x42b9e1,null))['catch'](handleError(_0x42b9e1,null));};function runReport(_0xcd41df,_0x24fefc,_0xc9b099){var _0x316cb3=_0x24fefc[_0xe165('0x2d')];var _0x533a6c=0xa;var _0x225817=[_0xe165('0x57'),_0xe165('0x58'),_0xe165('0x59'),_0xe165('0x5a')];var _0x2ac88c={'SUM':_0xe165('0x5b'),'COUNT':_0xe165('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe165('0x5e'),'MIN':_0xe165('0x5f'),'AVG':_0xe165('0x8a'),'GROUP_CONCAT':_0xe165('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe165('0x8b')};var _0x4df60e={'SEC_TO_TIME':_0xe165('0x61'),'DATE':_0xe165('0x62'),'HOUR':'HOUR(%s)','ROUND':_0xe165('0x64'),'UNIX_TIMESTAMP':_0xe165('0x8c')};var _0xe34925=function(_0x479cec){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe165('0x68'),_0xe165('0x69')],_0x479cec);};var _0x5d665f=function(_0x369415){if(!_0x369415||!_0x369415[_0xe165('0x6a')][_0xe165('0x3d')]){return'';}for(var _0x46ed1d='(',_0xfb5239=0x0;_0xfb5239<_0x369415[_0xe165('0x6a')][_0xe165('0x3d')];_0xfb5239+=0x1){_0xfb5239>0x0&&(_0x46ed1d+='\x20'+_0x369415['operator']+'\x20');_0x46ed1d+=_0x369415[_0xe165('0x6a')][_0xfb5239][_0xe165('0x6b')]?_0x5d665f(_0x369415[_0xe165('0x6a')][_0xfb5239][_0xe165('0x6b')]):_0x369415['rules'][_0xfb5239]['field']+'\x20'+_0x369415[_0xe165('0x6a')][_0xfb5239][_0xe165('0x6d')]+(_0xe34925(_0x369415['rules'][_0xfb5239][_0xe165('0x6d')])?'\x20'+_0x369415['rules'][_0xfb5239][_0xe165('0x8d')]:'');}return _0x46ed1d+')';};var _0x23f30d={'where':{'id':_0xcd41df['id']}},_0x5584b5,_0x2f4458,_0x22ae5f,_0xa9b59b,_0x14bf5f;_0x23f30d=_[_0xe165('0x45')]({},_0x23f30d,_0xc9b099);return db[_0xe165('0x31')][_0xe165('0x4c')](_0x23f30d)[_0xe165('0x26')](function(_0x899140){if(_0x899140){_0x5584b5=_0x899140;return _0x899140[_0xe165('0x6e')]();}return null;})[_0xe165('0x26')](function(_0x7526b){if(_0x7526b){if(!_0x7526b[_0xe165('0x3d')]){throw new db[(_0xe165('0x6f'))][(_0xe165('0x70'))](_0xe165('0x71'),0x193);}_0x2f4458=_0x7526b;return db[_0xe165('0x72')]['findAll']({'raw':!![]});}return null;})[_0xe165('0x26')](function(_0x4d1862){if(_0x4d1862){_0x22ae5f=_['keyBy'](_0x4d1862,'id');var _0xe26f82;var _0x133ecb=squel[_0xe165('0x74')]();_0x133ecb[_0xe165('0x8e')](_0x5584b5[_0xe165('0x81')]);for(var _0x2c4001=0x0;_0x2c4001<_0x2f4458[_0xe165('0x3d')];_0x2c4001+=0x1){_0xe26f82=_0x2f4458[_0x2c4001]['MetricId']?_0x22ae5f[_0x2f4458[_0x2c4001][_0xe165('0x75')]][_0xe165('0x8f')]:_0x2f4458[_0x2c4001][_0xe165('0x6c')];_0xe26f82=_0x2f4458[_0x2c4001][_0xe165('0x90')]?_[_0xe165('0x76')](_0x2ac88c[_0x2f4458[_0x2c4001]['function']],'%s',_0xe26f82):_0xe26f82;_0xe26f82=_0x2f4458[_0x2c4001][_0xe165('0x77')]?_[_0xe165('0x76')](_0x4df60e[_0x2f4458[_0x2c4001][_0xe165('0x77')]],'%s',_0xe26f82):_0xe26f82;if(_0x2f4458[_0x2c4001][_0xe165('0x78')]){_0x133ecb['group'](_0xe26f82);}_0x2f4458[_0x2c4001][_0xe165('0x7a')]&&_0x133ecb[_0xe165('0x79')](_0xe26f82,_0x2f4458[_0x2c4001][_0xe165('0x7a')]===_0xe165('0x7b')?![]:!![]);_0x133ecb[_0xe165('0x6c')](_0xe26f82,_0x2f4458[_0x2c4001][_0xe165('0x7c')]||_0xe26f82);}if(_0x5584b5[_0xe165('0x7d')]){_0x5584b5['joins']=JSON[_0xe165('0x7e')](_0x5584b5[_0xe165('0x7d')]);for(var _0x31bb22=0x0;_0x31bb22<_0x5584b5['joins']['length'];_0x31bb22+=0x1){if(_0x5584b5[_0xe165('0x7d')][_0x31bb22]['type']&&_[_0xe165('0x65')](_0x225817,_0x5584b5[_0xe165('0x7d')][_0x31bb22][_0xe165('0x34')])&&_0x5584b5[_0xe165('0x7d')][_0x31bb22][_0xe165('0x91')]&&_0x5584b5[_0xe165('0x7d')][_0x31bb22]['foreignTable']&&_0x5584b5[_0xe165('0x7d')][_0x31bb22][_0xe165('0x82')]){_0x133ecb[_0x5584b5['joins'][_0x31bb22]['type']](_0x5584b5[_0xe165('0x7d')][_0x31bb22][_0xe165('0x7f')],null,util[_0xe165('0x77')](_0xe165('0x80'),_0x5584b5[_0xe165('0x81')],_0x5584b5[_0xe165('0x7d')][_0x31bb22][_0xe165('0x91')],_0x5584b5['joins'][_0x31bb22]['foreignTable'],_0x5584b5[_0xe165('0x7d')][_0x31bb22][_0xe165('0x82')]));}}}if(_0x5584b5[_0xe165('0x83')]){_0x5584b5[_0xe165('0x83')]=JSON[_0xe165('0x7e')](_0x5584b5[_0xe165('0x83')]);_0x133ecb['where'](_0x5d665f(_0x5584b5[_0xe165('0x83')]['group']));}_0x14bf5f=_0x133ecb[_0xe165('0x84')]();_0x133ecb[_0xe165('0x20')](_0x533a6c);_0x133ecb[_0xe165('0x1e')](0x0);return;}})[_0xe165('0x26')](function(){if(_0x24fefc[_0xe165('0x92')]==='web'){return null;}var _0x3a9481=_[_0xe165('0x45')](_0x24fefc,{'name':_0x24fefc[_0xe165('0x93')]||_0x24fefc[_0xe165('0x2d')]||_0x5584b5[_0xe165('0x2d')],'basename':_0x316cb3,'savename':util['format'](_0xe165('0x94'),_0x24fefc[_0xe165('0x2d')]||_0x5584b5['name'],require(_0xe165('0x95'))[_0xe165('0x96')](0x4),_0x24fefc[_0xe165('0x92')]||_0xe165('0x97')),'reportId':_0x5584b5['id'],'reportType':_0xe165('0x98')});return db[_0xe165('0x99')][_0xe165('0x4d')](_0x3a9481,{'raw':!![]});})['then'](function(_0x5c696a){if(_0x5584b5['table']===_0xe165('0x9a')){_0x14bf5f['where'](_0x5584b5['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24fefc[_0xe165('0x9b')],_0x24fefc['endDate']);}else{_0x14bf5f['where'](_0x5584b5[_0xe165('0x81')]+_0xe165('0x9c'),_0x24fefc[_0xe165('0x9b')],_0x24fefc[_0xe165('0x9d')]);}if(_0x5c696a){logger[_0xe165('0x9e')](_0xe165('0x9f'),_0x14bf5f[_0xe165('0x87')]());require(_0xe165('0xa0'))[_0xe165('0xa1')](path[_0xe165('0x57')](__dirname,'../../components/export/',_0x5c696a[_0xe165('0x92')]),[_0x5c696a['id'],_0x14bf5f['toString'](),path[_0xe165('0x57')](__dirname,_0xe165('0xa2'),_0x5c696a[_0xe165('0xa3')]),_0x316cb3]);return _0x5c696a;}else{var _0x355b17=squel[_0xe165('0x74')]();_0x355b17[_0xe165('0x8e')]('('+_0x14bf5f['toString']()+')',_0xe165('0xa4'));_0x355b17[_0xe165('0x6c')](_0xe165('0xa5'),_0xe165('0x21'));_0x14bf5f[_0xe165('0x20')](_0x24fefc[_0xe165('0x20')]||_0x533a6c);_0x14bf5f[_0xe165('0x1e')](_0x24fefc[_0xe165('0x1e')]||0x0);return dbH[_0xe165('0x88')]['query'](_0x355b17['toString'](),{'type':dbH[_0xe165('0x88')][_0xe165('0xa6')][_0xe165('0x89')]})[_0xe165('0x26')](function(_0x471fe6){if(!_0x471fe6['length']){_0xa9b59b=0x0;}else{_0xa9b59b=_0x471fe6[0x0][_0xe165('0x21')]||0x0;}return dbH[_0xe165('0x88')][_0xe165('0x37')](_0x14bf5f['toString'](),{'type':dbH[_0xe165('0x88')][_0xe165('0xa6')]['SELECT']});})[_0xe165('0x26')](function(_0x5bb026){return{'rows':_0x5bb026||[],'count':_0xa9b59b};});}});}exports[_0xe165('0xa7')]=function(_0x579c89,_0x116421){return runReport(_0x579c89[_0xe165('0x56')],_0x579c89[_0xe165('0x37')],_0x579c89[_0xe165('0x46')])['then'](respondWithResult(_0x116421,null))[_0xe165('0x4b')](handleError(_0x116421,null));};exports[_0xe165('0xa8')]=runReport;exports[_0xe165('0x37')]=function(_0x198ddd,_0x4b3369){var _0x44c323=0xa;var _0x23b349=[_0xe165('0x57'),_0xe165('0x58'),_0xe165('0x59'),_0xe165('0x5a')];var _0x45534d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe165('0x5d'),'MAX':'MAX(%s)','MIN':_0xe165('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe165('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe165('0x8b')};var _0x3f9d68={'SEC_TO_TIME':_0xe165('0x61'),'DATE':_0xe165('0x62'),'HOUR':'HOUR(%s)','ROUND':_0xe165('0x64'),'UNIX_TIMESTAMP':_0xe165('0x8c')};var _0x48e956=function(_0x3ee5bf){return!_[_0xe165('0x65')]([_0xe165('0x66'),'IS\x20NOT\x20NULL',_0xe165('0x68'),_0xe165('0x69')],_0x3ee5bf);};var _0x49e105=function(_0x3e0f55){if(!_0x3e0f55||!_0x3e0f55[_0xe165('0x6a')][_0xe165('0x3d')]){return'';}for(var _0x5627a0='(',_0x56507d=0x0;_0x56507d<_0x3e0f55[_0xe165('0x6a')][_0xe165('0x3d')];_0x56507d+=0x1){_0x56507d>0x0&&(_0x5627a0+='\x20'+_0x3e0f55['operator']+'\x20');_0x5627a0+=_0x3e0f55[_0xe165('0x6a')][_0x56507d]['group']?_0x49e105(_0x3e0f55[_0xe165('0x6a')][_0x56507d][_0xe165('0x6b')]):_0x3e0f55[_0xe165('0x6a')][_0x56507d][_0xe165('0x6c')]+'\x20'+_0x3e0f55[_0xe165('0x6a')][_0x56507d][_0xe165('0x6d')]+(_0x48e956(_0x3e0f55[_0xe165('0x6a')][_0x56507d][_0xe165('0x6d')])?'\x20'+_0x3e0f55[_0xe165('0x6a')][_0x56507d][_0xe165('0x8d')]:'');}return _0x5627a0+')';};var _0x5925ab={'where':{'id':_0x198ddd['params']['id']}},_0x38bb7d,_0x21dd9d,_0x575905,_0x5afb21,_0x984e9e;_0x5925ab=_[_0xe165('0x45')]({},_0x5925ab,_0x198ddd[_0xe165('0x46')]);return db[_0xe165('0x31')][_0xe165('0x4c')](_0x5925ab)[_0xe165('0x26')](function(_0x5865b6){if(_0x5865b6){_0x38bb7d=_0x5865b6;return _0x5865b6[_0xe165('0x6e')]();}return null;})['then'](function(_0x3fb01b){if(_0x3fb01b){if(!_0x3fb01b['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xe165('0x71'),0x193);}_0x21dd9d=_0x3fb01b;return db[_0xe165('0x72')][_0xe165('0x49')]({'raw':!![]});}return null;})[_0xe165('0x26')](function(_0xd77e77){if(_0xd77e77){_0x575905=_['keyBy'](_0xd77e77,'id');var _0xfd4431;var _0x51edbb=squel[_0xe165('0x74')]();_0x51edbb[_0xe165('0x8e')](_0x38bb7d[_0xe165('0x81')]);for(var _0x2e56bf=0x0;_0x2e56bf<_0x21dd9d['length'];_0x2e56bf+=0x1){_0xfd4431=_0x21dd9d[_0x2e56bf]['MetricId']?_0x575905[_0x21dd9d[_0x2e56bf][_0xe165('0x75')]]['metric']:_0x21dd9d[_0x2e56bf][_0xe165('0x6c')];_0xfd4431=_0x21dd9d[_0x2e56bf][_0xe165('0x90')]?_[_0xe165('0x76')](_0x45534d[_0x21dd9d[_0x2e56bf][_0xe165('0x90')]],'%s',_0xfd4431):_0xfd4431;_0xfd4431=_0x21dd9d[_0x2e56bf][_0xe165('0x77')]?_[_0xe165('0x76')](_0x3f9d68[_0x21dd9d[_0x2e56bf][_0xe165('0x77')]],'%s',_0xfd4431):_0xfd4431;if(_0x21dd9d[_0x2e56bf][_0xe165('0x78')]){_0x51edbb['group'](_0xfd4431);}_0x21dd9d[_0x2e56bf][_0xe165('0x7a')]&&_0x51edbb['order'](_0xfd4431,_0x21dd9d[_0x2e56bf]['orderBy']==='DESC'?![]:!![]);_0x51edbb[_0xe165('0x6c')](_0xfd4431,_0x21dd9d[_0x2e56bf][_0xe165('0x7c')]||_0xfd4431);}if(_0x38bb7d[_0xe165('0x7d')]){_0x38bb7d['joins']=JSON[_0xe165('0x7e')](_0x38bb7d[_0xe165('0x7d')]);for(var _0x85e0aa=0x0;_0x85e0aa<_0x38bb7d['joins']['length'];_0x85e0aa+=0x1){if(_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x34')]&&_['includes'](_0x23b349,_0x38bb7d['joins'][_0x85e0aa][_0xe165('0x34')])&&_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x91')]&&_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x7f')]&&_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x82')]){_0x51edbb[_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x34')]](_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x7f')],null,util[_0xe165('0x77')](_0xe165('0x80'),_0x38bb7d[_0xe165('0x81')],_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x91')],_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x7f')],_0x38bb7d[_0xe165('0x7d')][_0x85e0aa][_0xe165('0x82')]));}}}if(_0x38bb7d[_0xe165('0x83')]){_0x38bb7d[_0xe165('0x83')]=JSON[_0xe165('0x7e')](_0x38bb7d[_0xe165('0x83')]);_0x51edbb[_0xe165('0x41')](_0x49e105(_0x38bb7d[_0xe165('0x83')]['group']));}_0x984e9e=_0x51edbb['clone']();_0x51edbb[_0xe165('0x20')](_0x44c323);_0x51edbb['offset'](0x0);logger['debug'](_0xe165('0x86'),_0x51edbb[_0xe165('0x87')]());return dbH[_0xe165('0x88')]['query'](_0x51edbb[_0xe165('0x87')](),{'type':dbH['sequelize'][_0xe165('0xa6')]['SELECT']});}})[_0xe165('0x26')](function(){return{'sql':_0x984e9e[_0xe165('0x87')]()};})['then'](respondWithResult(_0x4b3369,null))['catch'](handleError(_0x4b3369,null));}; \ No newline at end of file +var _0x1280=['to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','status','end','json','limit','undefined','count','offset','Content-Range','apply','destroy','then','get','CustomReports','error','stack','send','map','rawAttributes','fieldName','type','key','name','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','AnalyticCustomReport','includeAll','include','findAll','rows','keys','length','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','DATE(%s)','HOUR(%s)','AnalyticMetric','table','output','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../files/reports','countTable','run','runReport','COUNT(%s)','IS\x20NOT\x20EMPTY','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1280,0x98));var _0x0128=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0x1280[_0x3eb713];return _0x1d7128;};'use strict';var emlformat=require(_0x0128('0x0'));var rimraf=require(_0x0128('0x1'));var zipdir=require(_0x0128('0x2'));var jsonpatch=require(_0x0128('0x3'));var rp=require('request-promise');var moment=require(_0x0128('0x4'));var BPromise=require(_0x0128('0x5'));var Mustache=require('mustache');var util=require(_0x0128('0x6'));var path=require(_0x0128('0x7'));var sox=require(_0x0128('0x8'));var csv=require(_0x0128('0x9'));var ejs=require(_0x0128('0xa'));var fs=require('fs');var fs_extra=require(_0x0128('0xb'));var _=require('lodash');var squel=require(_0x0128('0xc'));var crypto=require(_0x0128('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0128('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0128('0xf'));var Redis=require(_0x0128('0x10'));var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0128('0x13'));var logger=require(_0x0128('0x14'))(_0x0128('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0128('0x16'));var db=require(_0x0128('0x17'))['db'];var dbH=require(_0x0128('0x17'))[_0x0128('0x18')];function respondWithStatusCode(_0x3c5f18,_0x3b8a00){_0x3b8a00=_0x3b8a00||0xcc;return function(_0x4b79f3){if(_0x4b79f3){return _0x3c5f18['sendStatus'](_0x3b8a00);}return _0x3c5f18[_0x0128('0x19')](_0x3b8a00)[_0x0128('0x1a')]();};}function respondWithResult(_0x4b8eeb,_0x14fcb5){_0x14fcb5=_0x14fcb5||0xc8;return function(_0x437211){if(_0x437211){return _0x4b8eeb['status'](_0x14fcb5)[_0x0128('0x1b')](_0x437211);}};}function respondWithFilteredResult(_0x59f69e,_0x9412f5){return function(_0x2db78a){if(_0x2db78a){var _0x902e87=typeof _0x9412f5['offset']==='undefined'&&typeof _0x9412f5[_0x0128('0x1c')]===_0x0128('0x1d');var _0x1e23ba=_0x2db78a[_0x0128('0x1e')];var _0x42ff6e=_0x902e87?0x0:_0x9412f5[_0x0128('0x1f')];var _0x5d8a6f=_0x902e87?_0x2db78a['count']:_0x9412f5[_0x0128('0x1f')]+_0x9412f5[_0x0128('0x1c')];var _0x475b71;if(_0x5d8a6f>=_0x1e23ba){_0x5d8a6f=_0x1e23ba;_0x475b71=0xc8;}else{_0x475b71=0xce;}_0x59f69e[_0x0128('0x19')](_0x475b71);return _0x59f69e['set'](_0x0128('0x20'),_0x42ff6e+'-'+_0x5d8a6f+'/'+_0x1e23ba)[_0x0128('0x1b')](_0x2db78a);}return null;};}function patchUpdates(_0x5ecc67){return function(_0x565609){try{jsonpatch[_0x0128('0x21')](_0x565609,_0x5ecc67,!![]);}catch(_0x4f3042){return BPromise['reject'](_0x4f3042);}return _0x565609['save']();};}function saveUpdates(_0x27b256,_0x3aa4ae){return function(_0x1c6e63){if(_0x1c6e63){return _0x1c6e63['update'](_0x27b256)['then'](function(_0x335b43){return _0x335b43;});}return null;};}function removeEntity(_0x30f49f,_0x489764){return function(_0x55940e){if(_0x55940e){return _0x55940e[_0x0128('0x22')]()[_0x0128('0x23')](function(){var _0x1ead70=_0x55940e[_0x0128('0x24')]({'plain':!![]});var _0x4b989c=_0x0128('0x25');return db['UserProfileResource'][_0x0128('0x22')]({'where':{'type':_0x4b989c,'resourceId':_0x1ead70['id']}})['then'](function(){return _0x55940e;});})['then'](function(){_0x30f49f[_0x0128('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33ecb1,_0x4bffb3){return function(_0x5b71da){if(!_0x5b71da){_0x33ecb1['sendStatus'](0x194);}return _0x5b71da;};}function handleError(_0x59b3d1,_0x2aa33e){_0x2aa33e=_0x2aa33e||0x1f4;return function(_0x1a4284){logger[_0x0128('0x26')](_0x1a4284[_0x0128('0x27')]);if(_0x1a4284['name']){delete _0x1a4284['name'];}_0x59b3d1['status'](_0x2aa33e)[_0x0128('0x28')](_0x1a4284);};}exports['index']=function(_0x32a649,_0x46b8bc){var _0x2b8584={},_0x562c3b={},_0x3616dc={'count':0x0,'rows':[]};var _0x56daad=_[_0x0128('0x29')](db['AnalyticCustomReport'][_0x0128('0x2a')],function(_0x385a39){return{'name':_0x385a39[_0x0128('0x2b')],'type':_0x385a39[_0x0128('0x2c')][_0x0128('0x2d')]};});_0x562c3b['model']=_['map'](_0x56daad,_0x0128('0x2e'));_0x562c3b[_0x0128('0x2f')]=_['keys'](_0x32a649[_0x0128('0x2f')]);_0x562c3b['filters']=_[_0x0128('0x30')](_0x562c3b[_0x0128('0x31')],_0x562c3b['query']);_0x2b8584[_0x0128('0x32')]=_[_0x0128('0x30')](_0x562c3b[_0x0128('0x31')],qs[_0x0128('0x33')](_0x32a649[_0x0128('0x2f')][_0x0128('0x33')]));_0x2b8584[_0x0128('0x32')]=_0x2b8584[_0x0128('0x32')]['length']?_0x2b8584[_0x0128('0x32')]:_0x562c3b[_0x0128('0x31')];if(!_0x32a649[_0x0128('0x2f')][_0x0128('0x34')](_0x0128('0x35'))){_0x2b8584[_0x0128('0x1c')]=qs[_0x0128('0x1c')](_0x32a649[_0x0128('0x2f')][_0x0128('0x1c')]);_0x2b8584[_0x0128('0x1f')]=qs[_0x0128('0x1f')](_0x32a649['query'][_0x0128('0x1f')]);}_0x2b8584[_0x0128('0x36')]=qs[_0x0128('0x37')](_0x32a649['query']['sort']);_0x2b8584[_0x0128('0x38')]=qs[_0x0128('0x39')](_[_0x0128('0x3a')](_0x32a649['query'],_0x562c3b['filters']),_0x56daad);if(_0x32a649[_0x0128('0x2f')][_0x0128('0x3b')]){_0x2b8584[_0x0128('0x38')]=_[_0x0128('0x3c')](_0x2b8584[_0x0128('0x38')],{'$or':_[_0x0128('0x29')](_0x56daad,function(_0x1692f2){if(_0x1692f2[_0x0128('0x2c')]!=='VIRTUAL'){var _0x5ba663={};_0x5ba663[_0x1692f2[_0x0128('0x2e')]]={'$like':'%'+_0x32a649['query'][_0x0128('0x3b')]+'%'};return _0x5ba663;}})});}_0x2b8584=_[_0x0128('0x3c')]({},_0x2b8584,_0x32a649['options']);var _0x3f5713={'where':_0x2b8584[_0x0128('0x38')]};return db[_0x0128('0x3d')][_0x0128('0x1e')](_0x3f5713)[_0x0128('0x23')](function(_0x248393){_0x3616dc[_0x0128('0x1e')]=_0x248393;if(_0x32a649[_0x0128('0x2f')][_0x0128('0x3e')]){_0x2b8584[_0x0128('0x3f')]=[{'all':!![]}];}return db[_0x0128('0x3d')][_0x0128('0x40')](_0x2b8584);})[_0x0128('0x23')](function(_0x58269b){_0x3616dc[_0x0128('0x41')]=_0x58269b;return _0x3616dc;})[_0x0128('0x23')](respondWithFilteredResult(_0x46b8bc,_0x2b8584))['catch'](handleError(_0x46b8bc,null));};exports['show']=function(_0x37fce0,_0x39aafd){var _0x59915e={'raw':![],'where':{'id':_0x37fce0['params']['id']}},_0x544aa2={};_0x544aa2['model']=_[_0x0128('0x42')](db['AnalyticCustomReport'][_0x0128('0x2a')]);_0x544aa2[_0x0128('0x2f')]=_[_0x0128('0x42')](_0x37fce0[_0x0128('0x2f')]);_0x544aa2[_0x0128('0x39')]=_['intersection'](_0x544aa2['model'],_0x544aa2[_0x0128('0x2f')]);_0x59915e[_0x0128('0x32')]=_[_0x0128('0x30')](_0x544aa2[_0x0128('0x31')],qs[_0x0128('0x33')](_0x37fce0['query'][_0x0128('0x33')]));_0x59915e[_0x0128('0x32')]=_0x59915e[_0x0128('0x32')][_0x0128('0x43')]?_0x59915e['attributes']:_0x544aa2[_0x0128('0x31')];if(_0x37fce0[_0x0128('0x2f')][_0x0128('0x3e')]){_0x59915e[_0x0128('0x3f')]=[{'all':!![]}];}_0x59915e=_['merge']({},_0x59915e,_0x37fce0[_0x0128('0x44')]);return db[_0x0128('0x3d')][_0x0128('0x45')](_0x59915e)[_0x0128('0x23')](handleEntityNotFound(_0x39aafd,null))[_0x0128('0x23')](respondWithResult(_0x39aafd,null))[_0x0128('0x46')](handleError(_0x39aafd,null));};exports[_0x0128('0x47')]=function(_0x37976a,_0x20ee32){return db[_0x0128('0x3d')][_0x0128('0x47')](_0x37976a[_0x0128('0x48')],{})[_0x0128('0x23')](function(_0x40e347){var _0x57e357=_0x37976a[_0x0128('0x49')][_0x0128('0x24')]({'plain':!![]});if(!_0x57e357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57e357[_0x0128('0x4a')]===_0x0128('0x49')){var _0x532ece=_0x40e347[_0x0128('0x24')]({'plain':!![]});var _0x38a8e2=_0x0128('0x4b');return db['UserProfileSection'][_0x0128('0x45')]({'where':{'name':_0x38a8e2,'userProfileId':_0x57e357[_0x0128('0x4c')]},'raw':!![]})[_0x0128('0x23')](function(_0x507bf2){if(_0x507bf2&&_0x507bf2[_0x0128('0x4d')]===0x0){return db[_0x0128('0x4e')][_0x0128('0x47')]({'name':_0x532ece[_0x0128('0x2e')],'resourceId':_0x532ece['id'],'type':'CustomReports','sectionId':_0x507bf2['id']},{})[_0x0128('0x23')](function(){return _0x40e347;});}else{return _0x40e347;}})[_0x0128('0x46')](function(_0x555a5d){logger['error'](_0x0128('0x4f'),_0x555a5d);throw _0x555a5d;});}return _0x40e347;})['then'](respondWithResult(_0x20ee32,0xc9))[_0x0128('0x46')](handleError(_0x20ee32,null));};exports[_0x0128('0x50')]=function(_0x4f763f,_0x5d7593){if(_0x4f763f['body']['id']){delete _0x4f763f['body']['id'];}return db[_0x0128('0x3d')][_0x0128('0x45')]({'where':{'id':_0x4f763f[_0x0128('0x51')]['id']}})[_0x0128('0x23')](handleEntityNotFound(_0x5d7593,null))[_0x0128('0x23')](saveUpdates(_0x4f763f[_0x0128('0x48')],null))[_0x0128('0x23')](respondWithResult(_0x5d7593,null))[_0x0128('0x46')](handleError(_0x5d7593,null));};exports[_0x0128('0x22')]=function(_0x50f975,_0x372af5){return db[_0x0128('0x3d')][_0x0128('0x45')]({'where':{'id':_0x50f975['params']['id']}})['then'](handleEntityNotFound(_0x372af5,null))[_0x0128('0x23')](removeEntity(_0x372af5,null))[_0x0128('0x46')](handleError(_0x372af5,null));};exports[_0x0128('0x52')]=function(_0x581d52,_0x42efe5){var _0x4aa56a=0xa;var _0x7eb326=[_0x0128('0x53'),_0x0128('0x54'),_0x0128('0x55'),_0x0128('0x56')];var _0x3eeecd={'SUM':_0x0128('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0128('0x58'),'MIN':_0x0128('0x59'),'AVG':_0x0128('0x5a'),'GROUP_CONCAT':_0x0128('0x5b'),'GROUP_CONCAT ASC':_0x0128('0x5c'),'GROUP_CONCAT DESC':_0x0128('0x5d')};var _0x4b594b={'SEC_TO_TIME':_0x0128('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x0128('0x5f'),'UNIX_TIMESTAMP':_0x0128('0x60')};var _0x2b69d3=function(_0x17a2b0){return!_['includes']([_0x0128('0x61'),_0x0128('0x62'),_0x0128('0x63'),'IS\x20NOT\x20EMPTY'],_0x17a2b0);};var _0x5cba5e=function(_0x56b5d6){if(!_0x56b5d6||!_0x56b5d6['rules']['length']){return'';}for(var _0x4d4dd5='(',_0x3e04a8=0x0;_0x3e04a8<_0x56b5d6['rules'][_0x0128('0x43')];_0x3e04a8+=0x1){_0x3e04a8>0x0&&(_0x4d4dd5+='\x20'+_0x56b5d6[_0x0128('0x64')]+'\x20');_0x4d4dd5+=_0x56b5d6[_0x0128('0x65')][_0x3e04a8][_0x0128('0x66')]?_0x5cba5e(_0x56b5d6[_0x0128('0x65')][_0x3e04a8][_0x0128('0x66')]):_0x56b5d6[_0x0128('0x65')][_0x3e04a8]['field']+'\x20'+_0x56b5d6[_0x0128('0x65')][_0x3e04a8][_0x0128('0x67')]+(_0x2b69d3(_0x56b5d6['rules'][_0x3e04a8]['condition'])?'\x20'+_0x56b5d6[_0x0128('0x65')][_0x3e04a8]['value']:'');}return _0x4d4dd5+')';};var _0x451841={'where':{'id':_0x581d52[_0x0128('0x51')]['id']}},_0x4a5088,_0x1cb691,_0x486032,_0x3a3180,_0x14892d;_0x451841=_[_0x0128('0x3c')]({},_0x451841,_0x581d52[_0x0128('0x44')]);return db['AnalyticCustomReport'][_0x0128('0x45')](_0x451841)[_0x0128('0x23')](function(_0x353048){if(_0x353048){_0x4a5088=_0x353048;return _0x353048[_0x0128('0x68')]();}return null;})[_0x0128('0x23')](function(_0x304e14){if(_0x304e14){if(!_0x304e14[_0x0128('0x43')]){throw new db[(_0x0128('0x69'))][(_0x0128('0x6a'))](_0x0128('0x6b'),0x193);}_0x1cb691=_0x304e14;return db['AnalyticMetric'][_0x0128('0x40')]({'raw':!![]});}return null;})['then'](function(_0x104f70){if(_0x104f70){_0x486032=_[_0x0128('0x6c')](_0x104f70,'id');var _0x18eb9a;var _0xab8c68=squel[_0x0128('0x6d')]();_0xab8c68[_0x0128('0x6e')](_0x4a5088['table']);for(var _0x1b502e=0x0;_0x1b502e<_0x1cb691[_0x0128('0x43')];_0x1b502e+=0x1){_0x18eb9a=_0x1cb691[_0x1b502e]['MetricId']?_0x486032[_0x1cb691[_0x1b502e][_0x0128('0x6f')]][_0x0128('0x70')]:_0x1cb691[_0x1b502e][_0x0128('0x71')];_0x18eb9a=_0x1cb691[_0x1b502e][_0x0128('0x72')]?_[_0x0128('0x73')](_0x3eeecd[_0x1cb691[_0x1b502e][_0x0128('0x72')]],'%s',_0x18eb9a):_0x18eb9a;_0x18eb9a=_0x1cb691[_0x1b502e][_0x0128('0x74')]?_[_0x0128('0x73')](_0x4b594b[_0x1cb691[_0x1b502e][_0x0128('0x74')]],'%s',_0x18eb9a):_0x18eb9a;if(_0x1cb691[_0x1b502e][_0x0128('0x75')]){_0xab8c68[_0x0128('0x66')](_0x18eb9a);}_0x1cb691[_0x1b502e][_0x0128('0x76')]&&_0xab8c68['order'](_0x18eb9a,_0x1cb691[_0x1b502e][_0x0128('0x76')]===_0x0128('0x77')?![]:!![]);_0xab8c68[_0x0128('0x71')](_0x18eb9a,_0x1cb691[_0x1b502e][_0x0128('0x78')]||_0x18eb9a);}if(_0x4a5088[_0x0128('0x79')]){_0x4a5088['joins']=JSON[_0x0128('0x7a')](_0x4a5088[_0x0128('0x79')]);for(var _0x378f94=0x0;_0x378f94<_0x4a5088[_0x0128('0x79')]['length'];_0x378f94+=0x1){if(_0x4a5088[_0x0128('0x79')][_0x378f94][_0x0128('0x2c')]&&_[_0x0128('0x7b')](_0x7eb326,_0x4a5088['joins'][_0x378f94]['type'])&&_0x4a5088['joins'][_0x378f94][_0x0128('0x7c')]&&_0x4a5088[_0x0128('0x79')][_0x378f94][_0x0128('0x7d')]&&_0x4a5088[_0x0128('0x79')][_0x378f94][_0x0128('0x7e')]){_0xab8c68[_0x4a5088['joins'][_0x378f94][_0x0128('0x2c')]](_0x4a5088[_0x0128('0x79')][_0x378f94]['foreignTable'],null,util[_0x0128('0x74')](_0x0128('0x7f'),_0x4a5088['table'],_0x4a5088['joins'][_0x378f94][_0x0128('0x7c')],_0x4a5088[_0x0128('0x79')][_0x378f94][_0x0128('0x7d')],_0x4a5088[_0x0128('0x79')][_0x378f94][_0x0128('0x7e')]));}}}if(_0x4a5088[_0x0128('0x80')]){_0x4a5088[_0x0128('0x80')]=JSON[_0x0128('0x7a')](_0x4a5088[_0x0128('0x80')]);_0xab8c68['where'](_0x5cba5e(_0x4a5088['conditions'][_0x0128('0x66')]));}_0x14892d=_0xab8c68[_0x0128('0x81')]();_0xab8c68[_0x0128('0x1c')](_0x4aa56a);_0xab8c68[_0x0128('0x1f')](0x0);logger[_0x0128('0x82')](_0x0128('0x83'),_0xab8c68[_0x0128('0x84')]());return dbH[_0x0128('0x85')][_0x0128('0x2f')](_0xab8c68['toString'](),{'type':dbH[_0x0128('0x85')][_0x0128('0x86')][_0x0128('0x87')]});}})[_0x0128('0x23')](respondWithResult(_0x42efe5,null))['catch'](handleError(_0x42efe5,null));};function runReport(_0x59a5ac,_0x5a3ffa,_0x3a1d09){var _0xaff55b=_0x5a3ffa[_0x0128('0x2e')];var _0x37f074=0xa;var _0xf1f5ee=['join',_0x0128('0x54'),_0x0128('0x55'),_0x0128('0x56')];var _0x41f215={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0128('0x88'),'MAX':_0x0128('0x58'),'MIN':_0x0128('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0128('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x42ac40={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0128('0x89'),'HOUR':_0x0128('0x8a'),'ROUND':_0x0128('0x5f'),'UNIX_TIMESTAMP':_0x0128('0x60')};var _0x4beef1=function(_0x554213){return!_[_0x0128('0x7b')]([_0x0128('0x61'),_0x0128('0x62'),_0x0128('0x63'),'IS\x20NOT\x20EMPTY'],_0x554213);};var _0x288cac=function(_0x1bfb6c){if(!_0x1bfb6c||!_0x1bfb6c['rules'][_0x0128('0x43')]){return'';}for(var _0x540a24='(',_0x1f0bae=0x0;_0x1f0bae<_0x1bfb6c[_0x0128('0x65')][_0x0128('0x43')];_0x1f0bae+=0x1){_0x1f0bae>0x0&&(_0x540a24+='\x20'+_0x1bfb6c[_0x0128('0x64')]+'\x20');_0x540a24+=_0x1bfb6c[_0x0128('0x65')][_0x1f0bae][_0x0128('0x66')]?_0x288cac(_0x1bfb6c[_0x0128('0x65')][_0x1f0bae][_0x0128('0x66')]):_0x1bfb6c[_0x0128('0x65')][_0x1f0bae][_0x0128('0x71')]+'\x20'+_0x1bfb6c[_0x0128('0x65')][_0x1f0bae][_0x0128('0x67')]+(_0x4beef1(_0x1bfb6c[_0x0128('0x65')][_0x1f0bae]['condition'])?'\x20'+_0x1bfb6c[_0x0128('0x65')][_0x1f0bae]['value']:'');}return _0x540a24+')';};var _0x2e9c5f={'where':{'id':_0x59a5ac['id']}},_0xd22a97,_0x5b960a,_0x115c0e,_0x5f850f,_0x9a1dc4;_0x2e9c5f=_[_0x0128('0x3c')]({},_0x2e9c5f,_0x3a1d09);return db[_0x0128('0x3d')][_0x0128('0x45')](_0x2e9c5f)['then'](function(_0x2161b1){if(_0x2161b1){_0xd22a97=_0x2161b1;return _0x2161b1[_0x0128('0x68')]();}return null;})['then'](function(_0x5c4668){if(_0x5c4668){if(!_0x5c4668[_0x0128('0x43')]){throw new db[(_0x0128('0x69'))][(_0x0128('0x6a'))](_0x0128('0x6b'),0x193);}_0x5b960a=_0x5c4668;return db[_0x0128('0x8b')][_0x0128('0x40')]({'raw':!![]});}return null;})[_0x0128('0x23')](function(_0x195506){if(_0x195506){_0x115c0e=_[_0x0128('0x6c')](_0x195506,'id');var _0x56b2ee;var _0x48588f=squel['select']();_0x48588f[_0x0128('0x6e')](_0xd22a97[_0x0128('0x8c')]);for(var _0x4d4ed1=0x0;_0x4d4ed1<_0x5b960a[_0x0128('0x43')];_0x4d4ed1+=0x1){_0x56b2ee=_0x5b960a[_0x4d4ed1]['MetricId']?_0x115c0e[_0x5b960a[_0x4d4ed1][_0x0128('0x6f')]][_0x0128('0x70')]:_0x5b960a[_0x4d4ed1][_0x0128('0x71')];_0x56b2ee=_0x5b960a[_0x4d4ed1][_0x0128('0x72')]?_[_0x0128('0x73')](_0x41f215[_0x5b960a[_0x4d4ed1][_0x0128('0x72')]],'%s',_0x56b2ee):_0x56b2ee;_0x56b2ee=_0x5b960a[_0x4d4ed1]['format']?_[_0x0128('0x73')](_0x42ac40[_0x5b960a[_0x4d4ed1]['format']],'%s',_0x56b2ee):_0x56b2ee;if(_0x5b960a[_0x4d4ed1][_0x0128('0x75')]){_0x48588f[_0x0128('0x66')](_0x56b2ee);}_0x5b960a[_0x4d4ed1]['orderBy']&&_0x48588f['order'](_0x56b2ee,_0x5b960a[_0x4d4ed1][_0x0128('0x76')]===_0x0128('0x77')?![]:!![]);_0x48588f[_0x0128('0x71')](_0x56b2ee,_0x5b960a[_0x4d4ed1][_0x0128('0x78')]||_0x56b2ee);}if(_0xd22a97['joins']){_0xd22a97[_0x0128('0x79')]=JSON[_0x0128('0x7a')](_0xd22a97[_0x0128('0x79')]);for(var _0x29d535=0x0;_0x29d535<_0xd22a97[_0x0128('0x79')][_0x0128('0x43')];_0x29d535+=0x1){if(_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x2c')]&&_['includes'](_0xf1f5ee,_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x2c')])&&_0xd22a97['joins'][_0x29d535][_0x0128('0x7c')]&&_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x7d')]&&_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x7e')]){_0x48588f[_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x2c')]](_0xd22a97['joins'][_0x29d535][_0x0128('0x7d')],null,util[_0x0128('0x74')](_0x0128('0x7f'),_0xd22a97[_0x0128('0x8c')],_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x7c')],_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x7d')],_0xd22a97[_0x0128('0x79')][_0x29d535][_0x0128('0x7e')]));}}}if(_0xd22a97['conditions']){_0xd22a97[_0x0128('0x80')]=JSON['parse'](_0xd22a97[_0x0128('0x80')]);_0x48588f[_0x0128('0x38')](_0x288cac(_0xd22a97[_0x0128('0x80')][_0x0128('0x66')]));}_0x9a1dc4=_0x48588f[_0x0128('0x81')]();_0x48588f['limit'](_0x37f074);_0x48588f[_0x0128('0x1f')](0x0);return;}})[_0x0128('0x23')](function(){if(_0x5a3ffa[_0x0128('0x8d')]==='web'){return null;}var _0x3b51e3=_[_0x0128('0x3c')](_0x5a3ffa,{'name':_0x5a3ffa['fullPath']||_0x5a3ffa[_0x0128('0x2e')]||_0xd22a97[_0x0128('0x2e')],'basename':_0xaff55b,'savename':util[_0x0128('0x74')](_0x0128('0x8e'),_0x5a3ffa[_0x0128('0x2e')]||_0xd22a97[_0x0128('0x2e')],require('randomstring')['generate'](0x4),_0x5a3ffa[_0x0128('0x8d')]||_0x0128('0x8f')),'reportId':_0xd22a97['id'],'reportType':_0x0128('0x90')});return db[_0x0128('0x91')][_0x0128('0x47')](_0x3b51e3,{'raw':!![]});})['then'](function(_0x3193a2){if(_0xd22a97[_0x0128('0x8c')]===_0x0128('0x92')){_0x9a1dc4['where'](_0xd22a97['table']+_0x0128('0x93'),_0x5a3ffa[_0x0128('0x94')],_0x5a3ffa['endDate']);}else{_0x9a1dc4['where'](_0xd22a97[_0x0128('0x8c')]+_0x0128('0x95'),_0x5a3ffa[_0x0128('0x94')],_0x5a3ffa[_0x0128('0x96')]);}if(_0x3193a2){logger['info'](_0x0128('0x97'),_0x9a1dc4['toString']());require(_0x0128('0x98'))[_0x0128('0x99')](path[_0x0128('0x53')](__dirname,'../../components/export/',_0x3193a2['output']),[_0x3193a2['id'],_0x9a1dc4[_0x0128('0x84')](),path[_0x0128('0x53')](__dirname,_0x0128('0x9a'),_0x3193a2['savename']),_0xaff55b]);return _0x3193a2;}else{var _0x997e3d=squel['select']();_0x997e3d['from']('('+_0x9a1dc4[_0x0128('0x84')]()+')',_0x0128('0x9b'));_0x997e3d[_0x0128('0x71')]('COUNT(*)','count');_0x9a1dc4['limit'](_0x5a3ffa['limit']||_0x37f074);_0x9a1dc4['offset'](_0x5a3ffa[_0x0128('0x1f')]||0x0);return dbH[_0x0128('0x85')][_0x0128('0x2f')](_0x997e3d[_0x0128('0x84')](),{'type':dbH[_0x0128('0x85')][_0x0128('0x86')][_0x0128('0x87')]})['then'](function(_0x249e0b){if(!_0x249e0b[_0x0128('0x43')]){_0x5f850f=0x0;}else{_0x5f850f=_0x249e0b[0x0][_0x0128('0x1e')]||0x0;}return dbH['sequelize'][_0x0128('0x2f')](_0x9a1dc4[_0x0128('0x84')](),{'type':dbH['sequelize'][_0x0128('0x86')]['SELECT']});})[_0x0128('0x23')](function(_0x49fe03){return{'rows':_0x49fe03||[],'count':_0x5f850f};});}});}exports[_0x0128('0x9c')]=function(_0x2acc39,_0x406708){return runReport(_0x2acc39[_0x0128('0x51')],_0x2acc39[_0x0128('0x2f')],_0x2acc39[_0x0128('0x44')])['then'](respondWithResult(_0x406708,null))[_0x0128('0x46')](handleError(_0x406708,null));};exports[_0x0128('0x9d')]=runReport;exports[_0x0128('0x2f')]=function(_0x3c2d02,_0x218229){var _0x1978bc=0xa;var _0x100153=['join','left_join','right_join','cross_join'];var _0x44bdad={'SUM':'SUM(%s)','COUNT':_0x0128('0x9e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x0128('0x5a'),'GROUP_CONCAT':_0x0128('0x5b'),'GROUP_CONCAT ASC':_0x0128('0x5c'),'GROUP_CONCAT DESC':_0x0128('0x5d')};var _0x12ee2f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0128('0x89'),'HOUR':_0x0128('0x8a'),'ROUND':_0x0128('0x5f'),'UNIX_TIMESTAMP':_0x0128('0x60')};var _0x36d169=function(_0x5817cc){return!_[_0x0128('0x7b')]([_0x0128('0x61'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x0128('0x9f')],_0x5817cc);};var _0x1e2ef2=function(_0xd6dab){if(!_0xd6dab||!_0xd6dab[_0x0128('0x65')][_0x0128('0x43')]){return'';}for(var _0x990c8f='(',_0x289918=0x0;_0x289918<_0xd6dab[_0x0128('0x65')][_0x0128('0x43')];_0x289918+=0x1){_0x289918>0x0&&(_0x990c8f+='\x20'+_0xd6dab[_0x0128('0x64')]+'\x20');_0x990c8f+=_0xd6dab[_0x0128('0x65')][_0x289918][_0x0128('0x66')]?_0x1e2ef2(_0xd6dab[_0x0128('0x65')][_0x289918]['group']):_0xd6dab[_0x0128('0x65')][_0x289918][_0x0128('0x71')]+'\x20'+_0xd6dab[_0x0128('0x65')][_0x289918][_0x0128('0x67')]+(_0x36d169(_0xd6dab[_0x0128('0x65')][_0x289918]['condition'])?'\x20'+_0xd6dab[_0x0128('0x65')][_0x289918][_0x0128('0xa0')]:'');}return _0x990c8f+')';};var _0x5ecd6f={'where':{'id':_0x3c2d02[_0x0128('0x51')]['id']}},_0x45628a,_0x16e08f,_0x1da562,_0x2efbab,_0x1ec73;_0x5ecd6f=_[_0x0128('0x3c')]({},_0x5ecd6f,_0x3c2d02['options']);return db['AnalyticCustomReport']['find'](_0x5ecd6f)[_0x0128('0x23')](function(_0x4d29fb){if(_0x4d29fb){_0x45628a=_0x4d29fb;return _0x4d29fb['getFields']();}return null;})[_0x0128('0x23')](function(_0x465044){if(_0x465044){if(!_0x465044[_0x0128('0x43')]){throw new db[(_0x0128('0x69'))]['ValidationErrorItem'](_0x0128('0x6b'),0x193);}_0x16e08f=_0x465044;return db[_0x0128('0x8b')][_0x0128('0x40')]({'raw':!![]});}return null;})['then'](function(_0x23ca5c){if(_0x23ca5c){_0x1da562=_[_0x0128('0x6c')](_0x23ca5c,'id');var _0x40d044;var _0x108298=squel[_0x0128('0x6d')]();_0x108298[_0x0128('0x6e')](_0x45628a[_0x0128('0x8c')]);for(var _0x4161c3=0x0;_0x4161c3<_0x16e08f['length'];_0x4161c3+=0x1){_0x40d044=_0x16e08f[_0x4161c3]['MetricId']?_0x1da562[_0x16e08f[_0x4161c3]['MetricId']][_0x0128('0x70')]:_0x16e08f[_0x4161c3][_0x0128('0x71')];_0x40d044=_0x16e08f[_0x4161c3][_0x0128('0x72')]?_[_0x0128('0x73')](_0x44bdad[_0x16e08f[_0x4161c3][_0x0128('0x72')]],'%s',_0x40d044):_0x40d044;_0x40d044=_0x16e08f[_0x4161c3][_0x0128('0x74')]?_['replace'](_0x12ee2f[_0x16e08f[_0x4161c3][_0x0128('0x74')]],'%s',_0x40d044):_0x40d044;if(_0x16e08f[_0x4161c3]['groupBy']){_0x108298[_0x0128('0x66')](_0x40d044);}_0x16e08f[_0x4161c3][_0x0128('0x76')]&&_0x108298['order'](_0x40d044,_0x16e08f[_0x4161c3][_0x0128('0x76')]===_0x0128('0x77')?![]:!![]);_0x108298[_0x0128('0x71')](_0x40d044,_0x16e08f[_0x4161c3][_0x0128('0x78')]||_0x40d044);}if(_0x45628a['joins']){_0x45628a[_0x0128('0x79')]=JSON[_0x0128('0x7a')](_0x45628a[_0x0128('0x79')]);for(var _0x23f290=0x0;_0x23f290<_0x45628a[_0x0128('0x79')][_0x0128('0x43')];_0x23f290+=0x1){if(_0x45628a[_0x0128('0x79')][_0x23f290]['type']&&_['includes'](_0x100153,_0x45628a['joins'][_0x23f290]['type'])&&_0x45628a[_0x0128('0x79')][_0x23f290]['parentKey']&&_0x45628a[_0x0128('0x79')][_0x23f290][_0x0128('0x7d')]&&_0x45628a[_0x0128('0x79')][_0x23f290]['foreignKey']){_0x108298[_0x45628a[_0x0128('0x79')][_0x23f290][_0x0128('0x2c')]](_0x45628a['joins'][_0x23f290][_0x0128('0x7d')],null,util[_0x0128('0x74')]('%s.%s\x20=\x20%s.%s',_0x45628a[_0x0128('0x8c')],_0x45628a['joins'][_0x23f290][_0x0128('0x7c')],_0x45628a[_0x0128('0x79')][_0x23f290][_0x0128('0x7d')],_0x45628a[_0x0128('0x79')][_0x23f290][_0x0128('0x7e')]));}}}if(_0x45628a[_0x0128('0x80')]){_0x45628a[_0x0128('0x80')]=JSON[_0x0128('0x7a')](_0x45628a[_0x0128('0x80')]);_0x108298[_0x0128('0x38')](_0x1e2ef2(_0x45628a[_0x0128('0x80')][_0x0128('0x66')]));}_0x1ec73=_0x108298[_0x0128('0x81')]();_0x108298[_0x0128('0x1c')](_0x1978bc);_0x108298[_0x0128('0x1f')](0x0);logger[_0x0128('0x82')](_0x0128('0x83'),_0x108298[_0x0128('0x84')]());return dbH['sequelize'][_0x0128('0x2f')](_0x108298['toString'](),{'type':dbH[_0x0128('0x85')][_0x0128('0x86')]['SELECT']});}})[_0x0128('0x23')](function(){return{'sql':_0x1ec73[_0x0128('0x84')]()};})['then'](respondWithResult(_0x218229,null))[_0x0128('0x46')](handleError(_0x218229,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index b915bfb..6955124 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 _0xcecb=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5d0b2d,_0x2d9f5f){var _0x11a64c=function(_0x2cbb0f){while(--_0x2cbb0f){_0x5d0b2d['push'](_0x5d0b2d['shift']());}};_0x11a64c(++_0x2d9f5f);}(_0xcecb,0x132));var _0xbcec=function(_0x353c07,_0x3b8507){_0x353c07=_0x353c07-0x0;var _0x470b00=_0xcecb[_0x353c07];return _0x470b00;};'use strict';var _=require(_0xbcec('0x0'));var util=require(_0xbcec('0x1'));var logger=require(_0xbcec('0x2'))(_0xbcec('0x3'));var moment=require(_0xbcec('0x4'));var BPromise=require('bluebird');var rp=require(_0xbcec('0x5'));var fs=require('fs');var path=require(_0xbcec('0x6'));var rimraf=require(_0xbcec('0x7'));var config=require('../../config/environment');var attributes=require(_0xbcec('0x8'));module[_0xbcec('0x9')]=function(_0x4a8308,_0x2398e6){return _0x4a8308[_0xbcec('0xa')](_0xbcec('0xb'),attributes,{'tableName':_0xbcec('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb147=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20fc8c,_0x1c5379){var _0x3b1899=function(_0x151093){while(--_0x151093){_0x20fc8c['push'](_0x20fc8c['shift']());}};_0x3b1899(++_0x1c5379);}(_0xb147,0x116));var _0x7b14=function(_0x3f0d76,_0x378fed){_0x3f0d76=_0x3f0d76-0x0;var _0x12c12e=_0xb147[_0x3f0d76];return _0x12c12e;};'use strict';var _=require(_0x7b14('0x0'));var util=require(_0x7b14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7b14('0x2'));var BPromise=require(_0x7b14('0x3'));var rp=require(_0x7b14('0x4'));var fs=require('fs');var path=require(_0x7b14('0x5'));var rimraf=require(_0x7b14('0x6'));var config=require(_0x7b14('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x2336be,_0x42479d){return _0x2336be[_0x7b14('0x8')](_0x7b14('0x9'),attributes,{'tableName':_0x7b14('0xa'),'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 afad0f5..470efff 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 _0x0e6e=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0x26a9bd,_0x11a04a){var _0x3b86e4=function(_0x158624){while(--_0x158624){_0x26a9bd['push'](_0x26a9bd['shift']());}};_0x3b86e4(++_0x11a04a);}(_0x0e6e,0x1e2));var _0xe0e6=function(_0x21ce53,_0xcb0cb0){_0x21ce53=_0x21ce53-0x0;var _0x4ef0e0=_0x0e6e[_0x21ce53];return _0x4ef0e0;};'use strict';var _=require(_0xe0e6('0x0'));var util=require(_0xe0e6('0x1'));var moment=require(_0xe0e6('0x2'));var BPromise=require(_0xe0e6('0x3'));var rs=require(_0xe0e6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe0e6('0x5'));var logger=require('../../config/logger')(_0xe0e6('0x6'));var config=require(_0xe0e6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe0e6('0x8')][_0xe0e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45a98c,_0x2697a2,_0x732030){return new BPromise(function(_0x176061,_0x4ba8fb){return client[_0xe0e6('0xa')](_0x45a98c,_0x732030)['then'](function(_0x4fd1b3){logger[_0xe0e6('0xb')](_0xe0e6('0xc'),_0x2697a2,_0xe0e6('0xd'));logger['debug'](_0xe0e6('0xe'),_0x2697a2,_0xe0e6('0xd'),JSON['stringify'](_0x4fd1b3));if(_0x4fd1b3[_0xe0e6('0xf')]){if(_0x4fd1b3['error']['code']===0x1f4){logger[_0xe0e6('0xf')](_0xe0e6('0xc'),_0x2697a2,_0x4fd1b3[_0xe0e6('0xf')][_0xe0e6('0x10')]);return _0x4ba8fb(_0x4fd1b3['error']['message']);}logger[_0xe0e6('0xf')](_0xe0e6('0xc'),_0x2697a2,_0x4fd1b3['error'][_0xe0e6('0x10')]);return _0x176061(_0x4fd1b3[_0xe0e6('0xf')][_0xe0e6('0x10')]);}else{logger[_0xe0e6('0xb')](_0xe0e6('0xc'),_0x2697a2,_0xe0e6('0xd'));_0x176061(_0x4fd1b3[_0xe0e6('0x11')][_0xe0e6('0x10')]);}})[_0xe0e6('0x12')](function(_0x53f088){logger[_0xe0e6('0xf')](_0xe0e6('0xc'),_0x2697a2,_0x53f088);_0x4ba8fb(_0x53f088);});});} \ No newline at end of file +var _0x6200=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info'];(function(_0x493e5e,_0x2b7505){var _0x321e0b=function(_0x38d039){while(--_0x38d039){_0x493e5e['push'](_0x493e5e['shift']());}};_0x321e0b(++_0x2b7505);}(_0x6200,0x178));var _0x0620=function(_0x245d86,_0x341d4f){_0x245d86=_0x245d86-0x0;var _0x1511d6=_0x6200[_0x245d86];return _0x1511d6;};'use strict';var _=require(_0x0620('0x0'));var util=require(_0x0620('0x1'));var moment=require(_0x0620('0x2'));var BPromise=require(_0x0620('0x3'));var rs=require(_0x0620('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0620('0x5'))['db'];var utils=require(_0x0620('0x6'));var logger=require(_0x0620('0x7'))('rpc');var config=require(_0x0620('0x8'));var jayson=require(_0x0620('0x9'));var client=jayson[_0x0620('0xa')][_0x0620('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x175dcf,_0x3867a5,_0x595b80){return new BPromise(function(_0x40171f,_0x1bc460){return client['request'](_0x175dcf,_0x595b80)['then'](function(_0x3db312){logger['info'](_0x0620('0xc'),_0x3867a5,'request\x20sent');logger[_0x0620('0xd')](_0x0620('0xe'),_0x3867a5,_0x0620('0xf'),JSON['stringify'](_0x3db312));if(_0x3db312['error']){if(_0x3db312['error'][_0x0620('0x10')]===0x1f4){logger[_0x0620('0x11')](_0x0620('0xc'),_0x3867a5,_0x3db312[_0x0620('0x11')]['message']);return _0x1bc460(_0x3db312[_0x0620('0x11')]['message']);}logger[_0x0620('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3867a5,_0x3db312[_0x0620('0x11')][_0x0620('0x12')]);return _0x40171f(_0x3db312[_0x0620('0x11')][_0x0620('0x12')]);}else{logger[_0x0620('0x13')](_0x0620('0xc'),_0x3867a5,_0x0620('0xf'));_0x40171f(_0x3db312[_0x0620('0x14')][_0x0620('0x12')]);}})[_0x0620('0x15')](function(_0x5a108e){logger['error'](_0x0620('0xc'),_0x3867a5,_0x5a108e);_0x1bc460(_0x5a108e);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index eb685db..041ddf0 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 _0x0c64=['connect-timeout','Router','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','query','create','/:id','update','delete','destroy','util','path'];(function(_0x5b0b44,_0x54f7f1){var _0x46f8f9=function(_0x30a5d6){while(--_0x30a5d6){_0x5b0b44['push'](_0x5b0b44['shift']());}};_0x46f8f9(++_0x54f7f1);}(_0x0c64,0x152));var _0x40c6=function(_0xf8a530,_0x122806){_0xf8a530=_0xf8a530-0x0;var _0x39a77a=_0x0c64[_0xf8a530];return _0x39a77a;};'use strict';var multer=require('multer');var util=require(_0x40c6('0x0'));var path=require(_0x40c6('0x1'));var timeout=require(_0x40c6('0x2'));var express=require('express');var router=express[_0x40c6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x40c6('0x4'));var config=require('../../config/environment');var controller=require(_0x40c6('0x5'));router[_0x40c6('0x6')]('/',auth[_0x40c6('0x7')](),controller[_0x40c6('0x8')]);router[_0x40c6('0x6')]('/:id',auth[_0x40c6('0x7')](),controller[_0x40c6('0x9')]);router['get'](_0x40c6('0xa'),auth[_0x40c6('0x7')](),controller[_0x40c6('0xb')]);router[_0x40c6('0x6')](_0x40c6('0xc'),auth[_0x40c6('0x7')](),controller[_0x40c6('0xd')]);router[_0x40c6('0x6')]('/:id/query',auth[_0x40c6('0x7')](),controller[_0x40c6('0xe')]);router['post']('/',auth[_0x40c6('0x7')](),controller[_0x40c6('0xf')]);router['put'](_0x40c6('0x10'),auth[_0x40c6('0x7')](),controller[_0x40c6('0x11')]);router[_0x40c6('0x12')](_0x40c6('0x10'),auth[_0x40c6('0x7')](),controller[_0x40c6('0x13')]);module['exports']=router; \ No newline at end of file +var _0x79cd=['/:id','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x24163b,_0x50b658){var _0x5840d1=function(_0x208200){while(--_0x208200){_0x24163b['push'](_0x24163b['shift']());}};_0x5840d1(++_0x50b658);}(_0x79cd,0x11f));var _0xd79c=function(_0x4cf794,_0x182a8a){_0x4cf794=_0x4cf794-0x0;var _0x289096=_0x79cd[_0x4cf794];return _0x289096;};'use strict';var multer=require(_0xd79c('0x0'));var util=require(_0xd79c('0x1'));var path=require(_0xd79c('0x2'));var timeout=require(_0xd79c('0x3'));var express=require(_0xd79c('0x4'));var router=express[_0xd79c('0x5')]();var fs_extra=require(_0xd79c('0x6'));var auth=require(_0xd79c('0x7'));var interaction=require(_0xd79c('0x8'));var config=require(_0xd79c('0x9'));var controller=require(_0xd79c('0xa'));router[_0xd79c('0xb')]('/',auth[_0xd79c('0xc')](),controller['index']);router['get'](_0xd79c('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0xd79c('0xe')]);router[_0xd79c('0xb')](_0xd79c('0xf'),auth[_0xd79c('0xc')](),controller[_0xd79c('0x10')]);router[_0xd79c('0xb')](_0xd79c('0x11'),auth[_0xd79c('0xc')](),controller[_0xd79c('0x12')]);router[_0xd79c('0x13')]('/',auth[_0xd79c('0xc')](),controller[_0xd79c('0x14')]);router['put'](_0xd79c('0xd'),auth[_0xd79c('0xc')](),controller[_0xd79c('0x15')]);router[_0xd79c('0x16')](_0xd79c('0xd'),auth[_0xd79c('0xc')](),controller[_0xd79c('0x17')]);module[_0xd79c('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0ee2804..b4ed04c 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x2ad7b5,_0x515aa5){var _0x1d8317=function(_0x3f6398){while(--_0x3f6398){_0x2ad7b5['push'](_0x2ad7b5['shift']());}};_0x1d8317(++_0x515aa5);}(_0x98a8,0x12c));var _0x898a=function(_0x3bd3a3,_0x4185cb){_0x3bd3a3=_0x3bd3a3-0x0;var _0x28cb10=_0x98a8[_0x3bd3a3];return _0x28cb10;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7c09=['exports','STRING','TEXT'];(function(_0x833d5f,_0x2d47b3){var _0x9ea801=function(_0x1d3e48){while(--_0x1d3e48){_0x833d5f['push'](_0x833d5f['shift']());}};_0x9ea801(++_0x2d47b3);}(_0x7c09,0x102));var _0x97c0=function(_0x5e94e7,_0x4f3eb2){_0x5e94e7=_0x5e94e7-0x0;var _0x208ced=_0x7c09[_0x5e94e7];return _0x208ced;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 307eb11..11046fb 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x3b3cc8,_0x69f6c){var _0x151679=function(_0x4a2193){while(--_0x4a2193){_0x3b3cc8['push'](_0x3b3cc8['shift']());}};_0x151679(++_0x69f6c);}(_0x5fc3,0xa8));var _0x35fc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x5fc3[_0xdc37a1];return _0x99b4fe;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x21f607,_0x57683d){var _0x3226d7=function(_0x152d74){while(--_0x152d74){_0x21f607['push'](_0x21f607['shift']());}};_0x3226d7(++_0x57683d);}(_0x1967,0x173));var _0x7196=function(_0x350c49,_0xb8436f){_0x350c49=_0x350c49-0x0;var _0x43ac1f=_0x1967[_0x350c49];return _0x43ac1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 6e2da4f..d0ad76b 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 _0x26f3=['define','AnalyticDefaultReport','analytics_default_reports','bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x4cc3f5,_0x6c4d0c){var _0x1434d7=function(_0xdd6da3){while(--_0xdd6da3){_0x4cc3f5['push'](_0x4cc3f5['shift']());}};_0x1434d7(++_0x6c4d0c);}(_0x26f3,0x123));var _0x326f=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x26f3[_0x5bff0];return _0x3ead2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x326f('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x326f('0x1'));var rimraf=require('rimraf');var config=require(_0x326f('0x2'));var attributes=require(_0x326f('0x3'));module[_0x326f('0x4')]=function(_0x4bbf44,_0x3d913e){return _0x4bbf44[_0x326f('0x5')](_0x326f('0x6'),attributes,{'tableName':_0x326f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x159b=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports'];(function(_0x1a3d07,_0x105a71){var _0xd0058a=function(_0x213e53){while(--_0x213e53){_0x1a3d07['push'](_0x1a3d07['shift']());}};_0xd0058a(++_0x105a71);}(_0x159b,0x138));var _0xb159=function(_0x35030,_0x4478d1){_0x35030=_0x35030-0x0;var _0x1af59b=_0x159b[_0x35030];return _0x1af59b;};'use strict';var _=require('lodash');var util=require(_0xb159('0x0'));var logger=require(_0xb159('0x1'))(_0xb159('0x2'));var moment=require(_0xb159('0x3'));var BPromise=require('bluebird');var rp=require(_0xb159('0x4'));var fs=require('fs');var path=require(_0xb159('0x5'));var rimraf=require(_0xb159('0x6'));var config=require(_0xb159('0x7'));var attributes=require(_0xb159('0x8'));module[_0xb159('0x9')]=function(_0x4fd580,_0xc3dab2){return _0x4fd580[_0xb159('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0xb159('0xb'),'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 4d87a7f..6b6666a 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 _0x34aa=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x4d3ffe,_0x21ac54){var _0x51d380=function(_0xcc8465){while(--_0xcc8465){_0x4d3ffe['push'](_0x4d3ffe['shift']());}};_0x51d380(++_0x21ac54);}(_0x34aa,0x1ba));var _0xa34a=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0x34aa[_0x4f6d08];return _0x53a9c6;};'use strict';var _=require(_0xa34a('0x0'));var util=require(_0xa34a('0x1'));var moment=require(_0xa34a('0x2'));var BPromise=require(_0xa34a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa34a('0x4'));var db=require(_0xa34a('0x5'))['db'];var utils=require(_0xa34a('0x6'));var logger=require(_0xa34a('0x7'))(_0xa34a('0x8'));var config=require('../../config/environment');var jayson=require(_0xa34a('0x9'));var client=jayson[_0xa34a('0xa')][_0xa34a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41dd9b,_0x203f4f,_0x5c8320){return new BPromise(function(_0x4d8d42,_0x140b15){return client['request'](_0x41dd9b,_0x5c8320)[_0xa34a('0xc')](function(_0xb33dc){logger['info'](_0xa34a('0xd'),_0x203f4f,_0xa34a('0xe'));logger[_0xa34a('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x203f4f,_0xa34a('0xe'),JSON[_0xa34a('0x10')](_0xb33dc));if(_0xb33dc['error']){if(_0xb33dc[_0xa34a('0x11')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x203f4f,_0xb33dc['error'][_0xa34a('0x12')]);return _0x140b15(_0xb33dc['error'][_0xa34a('0x12')]);}logger['error'](_0xa34a('0xd'),_0x203f4f,_0xb33dc[_0xa34a('0x11')][_0xa34a('0x12')]);return _0x4d8d42(_0xb33dc[_0xa34a('0x11')][_0xa34a('0x12')]);}else{logger[_0xa34a('0x13')](_0xa34a('0xd'),_0x203f4f,_0xa34a('0xe'));_0x4d8d42(_0xb33dc[_0xa34a('0x14')]['message']);}})[_0xa34a('0x15')](function(_0x372497){logger[_0xa34a('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x203f4f,_0x372497);_0x140b15(_0x372497);});});} \ No newline at end of file +var _0x6add=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x6add,0x191));var _0xd6ad=function(_0x3ba03c,_0x17833b){_0x3ba03c=_0x3ba03c-0x0;var _0x5f29ff=_0x6add[_0x3ba03c];return _0x5f29ff;};'use strict';var _=require('lodash');var util=require(_0xd6ad('0x0'));var moment=require(_0xd6ad('0x1'));var BPromise=require(_0xd6ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6ad('0x3'));var db=require(_0xd6ad('0x4'))['db'];var utils=require(_0xd6ad('0x5'));var logger=require(_0xd6ad('0x6'))(_0xd6ad('0x7'));var config=require(_0xd6ad('0x8'));var jayson=require(_0xd6ad('0x9'));var client=jayson[_0xd6ad('0xa')][_0xd6ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f872a,_0x4436a6,_0x44a26){return new BPromise(function(_0x4e69b9,_0x4bb05c){return client['request'](_0x1f872a,_0x44a26)[_0xd6ad('0xc')](function(_0x27b5ea){logger[_0xd6ad('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4436a6,_0xd6ad('0xe'));logger[_0xd6ad('0xf')](_0xd6ad('0x10'),_0x4436a6,_0xd6ad('0xe'),JSON[_0xd6ad('0x11')](_0x27b5ea));if(_0x27b5ea[_0xd6ad('0x12')]){if(_0x27b5ea['error'][_0xd6ad('0x13')]===0x1f4){logger[_0xd6ad('0x12')](_0xd6ad('0x14'),_0x4436a6,_0x27b5ea[_0xd6ad('0x12')]['message']);return _0x4bb05c(_0x27b5ea[_0xd6ad('0x12')]['message']);}logger[_0xd6ad('0x12')](_0xd6ad('0x14'),_0x4436a6,_0x27b5ea[_0xd6ad('0x12')][_0xd6ad('0x15')]);return _0x4e69b9(_0x27b5ea[_0xd6ad('0x12')][_0xd6ad('0x15')]);}else{logger[_0xd6ad('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4436a6,_0xd6ad('0xe'));_0x4e69b9(_0x27b5ea[_0xd6ad('0x16')][_0xd6ad('0x15')]);}})[_0xd6ad('0x17')](function(_0xa66e3b){logger[_0xd6ad('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4436a6,_0xa66e3b);_0x4bb05c(_0xa66e3b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 543fa0f..85980c1 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 _0x1d7c=['create','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query','query','post'];(function(_0x31baa2,_0x2e6997){var _0x31349e=function(_0x4b6d03){while(--_0x4b6d03){_0x31baa2['push'](_0x31baa2['shift']());}};_0x31349e(++_0x2e6997);}(_0x1d7c,0xdd));var _0xc1d7=function(_0x62396d,_0x1ad1ba){_0x62396d=_0x62396d-0x0;var _0x49db3e=_0x1d7c[_0x62396d];return _0x49db3e;};'use strict';var multer=require(_0xc1d7('0x0'));var util=require(_0xc1d7('0x1'));var path=require('path');var timeout=require(_0xc1d7('0x2'));var express=require('express');var router=express[_0xc1d7('0x3')]();var fs_extra=require(_0xc1d7('0x4'));var auth=require(_0xc1d7('0x5'));var interaction=require(_0xc1d7('0x6'));var config=require(_0xc1d7('0x7'));var controller=require(_0xc1d7('0x8'));router[_0xc1d7('0x9')]('/',auth[_0xc1d7('0xa')](),controller[_0xc1d7('0xb')]);router[_0xc1d7('0x9')](_0xc1d7('0xc'),auth[_0xc1d7('0xa')](),controller['show']);router[_0xc1d7('0x9')](_0xc1d7('0xd'),auth[_0xc1d7('0xa')](),controller[_0xc1d7('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0xc1d7('0xf')]);router[_0xc1d7('0x9')](_0xc1d7('0x10'),auth[_0xc1d7('0xa')](),controller[_0xc1d7('0x11')]);router[_0xc1d7('0x12')]('/',auth[_0xc1d7('0xa')](),controller[_0xc1d7('0x13')]);router[_0xc1d7('0x14')](_0xc1d7('0xc'),auth['isAuthenticated'](),controller[_0xc1d7('0x15')]);router[_0xc1d7('0x16')](_0xc1d7('0xc'),auth['isAuthenticated'](),controller[_0xc1d7('0x17')]);module['exports']=router; \ No newline at end of file +var _0xbc3e=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','delete','destroy','util','path'];(function(_0x3a6def,_0x333000){var _0x53494c=function(_0x4b391e){while(--_0x4b391e){_0x3a6def['push'](_0x3a6def['shift']());}};_0x53494c(++_0x333000);}(_0xbc3e,0xd6));var _0xebc3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbc3e[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require(_0xebc3('0x0'));var path=require(_0xebc3('0x1'));var timeout=require(_0xebc3('0x2'));var express=require(_0xebc3('0x3'));var router=express[_0xebc3('0x4')]();var fs_extra=require(_0xebc3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xebc3('0x6'));var config=require(_0xebc3('0x7'));var controller=require(_0xebc3('0x8'));router[_0xebc3('0x9')]('/',auth[_0xebc3('0xa')](),controller[_0xebc3('0xb')]);router[_0xebc3('0x9')](_0xebc3('0xc'),auth[_0xebc3('0xa')](),controller[_0xebc3('0xd')]);router[_0xebc3('0x9')](_0xebc3('0xe'),auth[_0xebc3('0xa')](),controller[_0xebc3('0xf')]);router[_0xebc3('0x9')](_0xebc3('0x10'),auth[_0xebc3('0xa')](),controller[_0xebc3('0x11')]);router[_0xebc3('0x9')](_0xebc3('0x12'),auth[_0xebc3('0xa')](),controller[_0xebc3('0x13')]);router['post']('/',auth[_0xebc3('0xa')](),controller[_0xebc3('0x14')]);router[_0xebc3('0x15')](_0xebc3('0xc'),auth[_0xebc3('0xa')](),controller['update']);router[_0xebc3('0x16')](_0xebc3('0xc'),auth['isAuthenticated'](),controller[_0xebc3('0x17')]);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 808ca4e..584418a 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 _0x5829=['manual','UNSIGNED','exports','ENUM','csv','pdf','xlsx','STRING','DATE'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5829,0xa4));var _0x9582=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x5829[_0xda464c];return _0x19e222;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9582('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x9582('0x1')](_0x9582('0x2'),_0x9582('0x3'),_0x9582('0x4')),'allowNull':![],'defaultValue':_0x9582('0x2')},'savename':{'type':Sequelize[_0x9582('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9582('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x9582('0x5')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x9582('0x1')](_0x9582('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x9582('0x8')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2f8c=['DATE','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','xlsx','csv'];(function(_0x5ad1bb,_0x477c32){var _0x2a82e6=function(_0x265c49){while(--_0x265c49){_0x5ad1bb['push'](_0x5ad1bb['shift']());}};_0x2a82e6(++_0x477c32);}(_0x2f8c,0x102));var _0xc2f8=function(_0x464f39,_0x99e6fd){_0x464f39=_0x464f39-0x0;var _0x2226c4=_0x2f8c[_0x464f39];return _0x2226c4;};'use strict';var Sequelize=require(_0xc2f8('0x0'));var moment=require(_0xc2f8('0x1'));module[_0xc2f8('0x2')]={'name':{'type':Sequelize[_0xc2f8('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xc2f8('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xc2f8('0x4')),'allowNull':![],'defaultValue':_0xc2f8('0x5')},'savename':{'type':Sequelize[_0xc2f8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xc2f8('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc2f8('0x7')},'type':{'type':Sequelize[_0xc2f8('0x8')](_0xc2f8('0x9'),_0xc2f8('0xa')),'allowNull':![],'defaultValue':_0xc2f8('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc2f8('0xb')]},'reportType':{'type':Sequelize[_0xc2f8('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7723972..905192d 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 _0x971f=['keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','AnalyticExtractedReport','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','sendStatus','format','%s.%s','basename','output','toLowerCase','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','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','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','error','name','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5ab5c8,_0x4362ac){var _0x3f86f5=function(_0x42637e){while(--_0x42637e){_0x5ab5c8['push'](_0x5ab5c8['shift']());}};_0x3f86f5(++_0x4362ac);}(_0x971f,0xee));var _0xf971=function(_0x736383,_0x25b9d0){_0x736383=_0x736383-0x0;var _0x422082=_0x971f[_0x736383];return _0x422082;};'use strict';var emlformat=require(_0xf971('0x0'));var rimraf=require(_0xf971('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf971('0x2'));var moment=require(_0xf971('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf971('0x4'));var util=require(_0xf971('0x5'));var path=require(_0xf971('0x6'));var sox=require(_0xf971('0x7'));var csv=require(_0xf971('0x8'));var ejs=require(_0xf971('0x9'));var fs=require('fs');var fs_extra=require(_0xf971('0xa'));var _=require('lodash');var squel=require(_0xf971('0xb'));var crypto=require(_0xf971('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf971('0xd'));var toCsv=require(_0xf971('0x8'));var querystring=require(_0xf971('0xe'));var Papa=require(_0xf971('0xf'));var Redis=require(_0xf971('0x10'));var authService=require(_0xf971('0x11'));var qs=require(_0xf971('0x12'));var as=require(_0xf971('0x13'));var hardwareService=require(_0xf971('0x14'));var logger=require(_0xf971('0x15'))(_0xf971('0x16'));var utils=require('../../config/utils');var config=require(_0xf971('0x17'));var licenseUtil=require(_0xf971('0x18'));var db=require(_0xf971('0x19'))['db'];function respondWithStatusCode(_0x15cd47,_0x43c853){_0x43c853=_0x43c853||0xcc;return function(_0x403cb5){if(_0x403cb5){return _0x15cd47['sendStatus'](_0x43c853);}return _0x15cd47[_0xf971('0x1a')](_0x43c853)[_0xf971('0x1b')]();};}function respondWithResult(_0x2a8c56,_0x35a8c3){_0x35a8c3=_0x35a8c3||0xc8;return function(_0x17a02e){if(_0x17a02e){return _0x2a8c56[_0xf971('0x1a')](_0x35a8c3)[_0xf971('0x1c')](_0x17a02e);}};}function respondWithFilteredResult(_0x57c72d,_0x2035c4){return function(_0x476d5c){if(_0x476d5c){var _0x5b8d63=typeof _0x2035c4[_0xf971('0x1d')]==='undefined'&&typeof _0x2035c4['limit']===_0xf971('0x1e');var _0xb10bbf=_0x476d5c[_0xf971('0x1f')];var _0xfbda82=_0x5b8d63?0x0:_0x2035c4[_0xf971('0x1d')];var _0x3b2458=_0x5b8d63?_0x476d5c[_0xf971('0x1f')]:_0x2035c4[_0xf971('0x1d')]+_0x2035c4[_0xf971('0x20')];var _0x4c7b9a;if(_0x3b2458>=_0xb10bbf){_0x3b2458=_0xb10bbf;_0x4c7b9a=0xc8;}else{_0x4c7b9a=0xce;}_0x57c72d['status'](_0x4c7b9a);return _0x57c72d[_0xf971('0x21')]('Content-Range',_0xfbda82+'-'+_0x3b2458+'/'+_0xb10bbf)[_0xf971('0x1c')](_0x476d5c);}return null;};}function patchUpdates(_0x169c07){return function(_0x217720){try{jsonpatch[_0xf971('0x22')](_0x217720,_0x169c07,!![]);}catch(_0x3c4021){return BPromise['reject'](_0x3c4021);}return _0x217720[_0xf971('0x23')]();};}function saveUpdates(_0x4c3d23,_0x303226){return function(_0x3f4168){if(_0x3f4168){return _0x3f4168['update'](_0x4c3d23)[_0xf971('0x24')](function(_0x2428fe){return _0x2428fe;});}return null;};}function removeEntity(_0x3f1f92,_0x2a8ffa){return function(_0x5d7c2b){if(_0x5d7c2b){return _0x5d7c2b[_0xf971('0x25')]()[_0xf971('0x24')](function(){var _0x3fa235=_0x5d7c2b[_0xf971('0x26')]({'plain':!![]});var _0x1d67e5=_0xf971('0x27');return db[_0xf971('0x28')]['destroy']({'where':{'type':_0x1d67e5,'resourceId':_0x3fa235['id']}})[_0xf971('0x24')](function(){return _0x5d7c2b;});})['then'](function(){_0x3f1f92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x189d01,_0x203bb6){return function(_0x3a9416){if(!_0x3a9416){_0x189d01['sendStatus'](0x194);}return _0x3a9416;};}function handleError(_0x1ba76a,_0x4f6081){_0x4f6081=_0x4f6081||0x1f4;return function(_0x302ff4){logger[_0xf971('0x29')](_0x302ff4['stack']);if(_0x302ff4[_0xf971('0x2a')]){delete _0x302ff4[_0xf971('0x2a')];}_0x1ba76a['status'](_0x4f6081)['send'](_0x302ff4);};}exports['index']=function(_0x2d31a4,_0x1d1824){var _0x2bd51a={},_0x5b2f77={},_0x20d3f9={'count':0x0,'rows':[]};var _0x51cf79=_[_0xf971('0x2b')](db['AnalyticExtractedReport'][_0xf971('0x2c')],function(_0x56e16c){return{'name':_0x56e16c[_0xf971('0x2d')],'type':_0x56e16c[_0xf971('0x2e')][_0xf971('0x2f')]};});_0x5b2f77[_0xf971('0x30')]=_['map'](_0x51cf79,_0xf971('0x2a'));_0x5b2f77[_0xf971('0x31')]=_[_0xf971('0x32')](_0x2d31a4[_0xf971('0x31')]);_0x5b2f77[_0xf971('0x33')]=_[_0xf971('0x34')](_0x5b2f77[_0xf971('0x30')],_0x5b2f77[_0xf971('0x31')]);_0x2bd51a['attributes']=_[_0xf971('0x34')](_0x5b2f77[_0xf971('0x30')],qs[_0xf971('0x35')](_0x2d31a4[_0xf971('0x31')]['fields']));_0x2bd51a[_0xf971('0x36')]=_0x2bd51a['attributes'][_0xf971('0x37')]?_0x2bd51a[_0xf971('0x36')]:_0x5b2f77[_0xf971('0x30')];if(!_0x2d31a4['query']['hasOwnProperty'](_0xf971('0x38'))){_0x2bd51a[_0xf971('0x20')]=qs[_0xf971('0x20')](_0x2d31a4[_0xf971('0x31')][_0xf971('0x20')]);_0x2bd51a[_0xf971('0x1d')]=qs[_0xf971('0x1d')](_0x2d31a4[_0xf971('0x31')][_0xf971('0x1d')]);}_0x2bd51a[_0xf971('0x39')]=qs['sort'](_0x2d31a4[_0xf971('0x31')][_0xf971('0x3a')]);_0x2bd51a['where']=qs[_0xf971('0x33')](_['pick'](_0x2d31a4[_0xf971('0x31')],_0x5b2f77['filters']),_0x51cf79);if(_0x2d31a4[_0xf971('0x31')]['filter']){_0x2bd51a[_0xf971('0x3b')]=_[_0xf971('0x3c')](_0x2bd51a[_0xf971('0x3b')],{'$or':_[_0xf971('0x2b')](_0x51cf79,function(_0x3eb055){if(_0x3eb055[_0xf971('0x2e')]!==_0xf971('0x3d')){var _0x2f508c={};_0x2f508c[_0x3eb055[_0xf971('0x2a')]]={'$like':'%'+_0x2d31a4[_0xf971('0x31')][_0xf971('0x3e')]+'%'};return _0x2f508c;}})});}_0x2bd51a=_[_0xf971('0x3c')]({},_0x2bd51a,_0x2d31a4[_0xf971('0x3f')]);var _0x57113a={'where':_0x2bd51a[_0xf971('0x3b')]};return db[_0xf971('0x40')][_0xf971('0x1f')](_0x57113a)[_0xf971('0x24')](function(_0x1c3417){_0x20d3f9[_0xf971('0x1f')]=_0x1c3417;if(_0x2d31a4[_0xf971('0x31')]['includeAll']){_0x2bd51a[_0xf971('0x41')]=[{'all':!![]}];}return db[_0xf971('0x40')][_0xf971('0x42')](_0x2bd51a);})['then'](function(_0x2c55e8){_0x20d3f9[_0xf971('0x43')]=_0x2c55e8;return _0x20d3f9;})[_0xf971('0x24')](respondWithFilteredResult(_0x1d1824,_0x2bd51a))[_0xf971('0x44')](handleError(_0x1d1824,null));};exports['show']=function(_0x3fae7e,_0x591a30){var _0x2fa32b={'raw':!![],'where':{'id':_0x3fae7e[_0xf971('0x45')]['id']}},_0x47471e={};_0x47471e[_0xf971('0x30')]=_[_0xf971('0x32')](db[_0xf971('0x40')]['rawAttributes']);_0x47471e[_0xf971('0x31')]=_[_0xf971('0x32')](_0x3fae7e[_0xf971('0x31')]);_0x47471e[_0xf971('0x33')]=_[_0xf971('0x34')](_0x47471e['model'],_0x47471e[_0xf971('0x31')]);_0x2fa32b['attributes']=_[_0xf971('0x34')](_0x47471e[_0xf971('0x30')],qs[_0xf971('0x35')](_0x3fae7e[_0xf971('0x31')][_0xf971('0x35')]));_0x2fa32b[_0xf971('0x36')]=_0x2fa32b[_0xf971('0x36')][_0xf971('0x37')]?_0x2fa32b[_0xf971('0x36')]:_0x47471e[_0xf971('0x30')];if(_0x3fae7e[_0xf971('0x31')]['includeAll']){_0x2fa32b[_0xf971('0x41')]=[{'all':!![]}];}_0x2fa32b=_['merge']({},_0x2fa32b,_0x3fae7e[_0xf971('0x3f')]);return db[_0xf971('0x40')][_0xf971('0x46')](_0x2fa32b)[_0xf971('0x24')](handleEntityNotFound(_0x591a30,null))['then'](respondWithResult(_0x591a30,null))[_0xf971('0x44')](handleError(_0x591a30,null));};exports[_0xf971('0x47')]=function(_0x4fb813,_0xc7d554){return db[_0xf971('0x40')][_0xf971('0x47')](_0x4fb813['body'],{})[_0xf971('0x24')](function(_0x36f582){var _0x11ba48=_0x4fb813[_0xf971('0x48')][_0xf971('0x26')]({'plain':!![]});if(!_0x11ba48)throw new Error(_0xf971('0x49'));if(_0x11ba48[_0xf971('0x4a')]==='user'){var _0x4c0eba=_0x36f582[_0xf971('0x26')]({'plain':!![]});var _0x2daf14=_0xf971('0x27');return db[_0xf971('0x4b')][_0xf971('0x46')]({'where':{'name':_0x2daf14,'userProfileId':_0x11ba48[_0xf971('0x4c')]},'raw':!![]})['then'](function(_0x405b7a){if(_0x405b7a&&_0x405b7a[_0xf971('0x4d')]===0x0){return db[_0xf971('0x28')][_0xf971('0x47')]({'name':_0x4c0eba['name'],'resourceId':_0x4c0eba['id'],'type':_0x405b7a[_0xf971('0x2a')],'sectionId':_0x405b7a['id']},{})[_0xf971('0x24')](function(){return _0x36f582;});}else{return _0x36f582;}})[_0xf971('0x44')](function(_0x241eda){logger[_0xf971('0x29')](_0xf971('0x4e'),_0x241eda);throw _0x241eda;});}return _0x36f582;})['then'](respondWithResult(_0xc7d554,0xc9))['catch'](handleError(_0xc7d554,null));};exports[_0xf971('0x4f')]=function(_0x14940c,_0x37e0a3){if(_0x14940c[_0xf971('0x50')]['id']){delete _0x14940c[_0xf971('0x50')]['id'];}return db[_0xf971('0x40')][_0xf971('0x46')]({'where':{'id':_0x14940c['params']['id']}})[_0xf971('0x24')](handleEntityNotFound(_0x37e0a3,null))[_0xf971('0x24')](saveUpdates(_0x14940c[_0xf971('0x50')],null))[_0xf971('0x24')](respondWithResult(_0x37e0a3,null))[_0xf971('0x44')](handleError(_0x37e0a3,null));};exports['destroy']=function(_0x303fb1,_0x2dffac){return db[_0xf971('0x40')][_0xf971('0x46')]({'where':{'id':_0x303fb1[_0xf971('0x45')]['id']}})[_0xf971('0x24')](handleEntityNotFound(_0x2dffac,null))['then'](removeEntity(_0x2dffac,null))[_0xf971('0x44')](handleError(_0x2dffac,null));};exports[_0xf971('0x51')]=function(_0x15bcf3,_0x3daebc,_0x3d1e0d){return db[_0xf971('0x40')][_0xf971('0x46')]({'where':{'id':_0x15bcf3[_0xf971('0x45')]['id']},'attributes':[_0xf971('0x2a'),'basename',_0xf971('0x52'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x3daebc,null))['then'](function(_0x9f1e6d){if(_0x9f1e6d){if(!fs[_0xf971('0x53')](path[_0xf971('0x54')](config[_0xf971('0x55')],_0xf971('0x56'),_0x9f1e6d['savename']))){throw new db[(_0xf971('0x57'))][(_0xf971('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x15bcf3['query'][_0xf971('0x59')]){return _0x3daebc[_0xf971('0x5a')](0xc8);}return _0x3daebc['download'](path[_0xf971('0x54')](config[_0xf971('0x55')],'server/files/reports',_0x9f1e6d[_0xf971('0x52')]),util[_0xf971('0x5b')](_0xf971('0x5c'),_0x9f1e6d[_0xf971('0x5d')]||_0x9f1e6d['name'],_0x9f1e6d[_0xf971('0x5e')][_0xf971('0x5f')]()));}})[_0xf971('0x44')](handleError(_0x3daebc,null));}; \ No newline at end of file +var _0xe858=['body','download','basename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','fields','nolimit','order','sort','where','filters','merge','type','VIRTUAL','options','AnalyticExtractedReport','count','includeAll','findAll','catch','show','params','keys','attributes','length','include','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x403f88,_0x4aa611){var _0x2c304a=function(_0x369242){while(--_0x369242){_0x403f88['push'](_0x403f88['shift']());}};_0x2c304a(++_0x4aa611);}(_0xe858,0x72));var _0x8e85=function(_0x50a1f6,_0x238fd8){_0x50a1f6=_0x50a1f6-0x0;var _0x84f8d4=_0xe858[_0x50a1f6];return _0x84f8d4;};'use strict';var emlformat=require(_0x8e85('0x0'));var rimraf=require(_0x8e85('0x1'));var zipdir=require(_0x8e85('0x2'));var jsonpatch=require(_0x8e85('0x3'));var rp=require(_0x8e85('0x4'));var moment=require(_0x8e85('0x5'));var BPromise=require(_0x8e85('0x6'));var Mustache=require('mustache');var util=require(_0x8e85('0x7'));var path=require('path');var sox=require(_0x8e85('0x8'));var csv=require(_0x8e85('0x9'));var ejs=require(_0x8e85('0xa'));var fs=require('fs');var fs_extra=require(_0x8e85('0xb'));var _=require(_0x8e85('0xc'));var squel=require(_0x8e85('0xd'));var crypto=require(_0x8e85('0xe'));var jsforce=require(_0x8e85('0xf'));var deskjs=require(_0x8e85('0x10'));var toCsv=require(_0x8e85('0x9'));var querystring=require(_0x8e85('0x11'));var Papa=require('papaparse');var Redis=require(_0x8e85('0x12'));var authService=require(_0x8e85('0x13'));var qs=require(_0x8e85('0x14'));var as=require(_0x8e85('0x15'));var hardwareService=require(_0x8e85('0x16'));var logger=require(_0x8e85('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x8e85('0x18'));var licenseUtil=require(_0x8e85('0x19'));var db=require(_0x8e85('0x1a'))['db'];function respondWithStatusCode(_0xa09df6,_0x2abd49){_0x2abd49=_0x2abd49||0xcc;return function(_0x22595c){if(_0x22595c){return _0xa09df6[_0x8e85('0x1b')](_0x2abd49);}return _0xa09df6[_0x8e85('0x1c')](_0x2abd49)[_0x8e85('0x1d')]();};}function respondWithResult(_0x826fd,_0x3d7448){_0x3d7448=_0x3d7448||0xc8;return function(_0x2ee93e){if(_0x2ee93e){return _0x826fd[_0x8e85('0x1c')](_0x3d7448)[_0x8e85('0x1e')](_0x2ee93e);}};}function respondWithFilteredResult(_0x4e30df,_0x503843){return function(_0x5b215e){if(_0x5b215e){var _0x36e249=typeof _0x503843[_0x8e85('0x1f')]===_0x8e85('0x20')&&typeof _0x503843['limit']==='undefined';var _0x21f883=_0x5b215e['count'];var _0x40196d=_0x36e249?0x0:_0x503843['offset'];var _0x25d965=_0x36e249?_0x5b215e['count']:_0x503843['offset']+_0x503843[_0x8e85('0x21')];var _0x212e3c;if(_0x25d965>=_0x21f883){_0x25d965=_0x21f883;_0x212e3c=0xc8;}else{_0x212e3c=0xce;}_0x4e30df[_0x8e85('0x1c')](_0x212e3c);return _0x4e30df[_0x8e85('0x22')](_0x8e85('0x23'),_0x40196d+'-'+_0x25d965+'/'+_0x21f883)[_0x8e85('0x1e')](_0x5b215e);}return null;};}function patchUpdates(_0x21f07c){return function(_0x5a4b21){try{jsonpatch['apply'](_0x5a4b21,_0x21f07c,!![]);}catch(_0x2feebe){return BPromise['reject'](_0x2feebe);}return _0x5a4b21[_0x8e85('0x24')]();};}function saveUpdates(_0x1ab7c5,_0xbb1c2b){return function(_0x170d7d){if(_0x170d7d){return _0x170d7d[_0x8e85('0x25')](_0x1ab7c5)[_0x8e85('0x26')](function(_0x131167){return _0x131167;});}return null;};}function removeEntity(_0x6889,_0x342e01){return function(_0x15a875){if(_0x15a875){return _0x15a875[_0x8e85('0x27')]()[_0x8e85('0x26')](function(){var _0x36e524=_0x15a875[_0x8e85('0x28')]({'plain':!![]});var _0x343069=_0x8e85('0x29');return db[_0x8e85('0x2a')][_0x8e85('0x27')]({'where':{'type':_0x343069,'resourceId':_0x36e524['id']}})[_0x8e85('0x26')](function(){return _0x15a875;});})[_0x8e85('0x26')](function(){_0x6889[_0x8e85('0x1c')](0xcc)[_0x8e85('0x1d')]();});}};}function handleEntityNotFound(_0x33ed78,_0x15a158){return function(_0x45be6f){if(!_0x45be6f){_0x33ed78[_0x8e85('0x1b')](0x194);}return _0x45be6f;};}function handleError(_0x586bff,_0xc2be64){_0xc2be64=_0xc2be64||0x1f4;return function(_0x564bcb){logger[_0x8e85('0x2b')](_0x564bcb[_0x8e85('0x2c')]);if(_0x564bcb[_0x8e85('0x2d')]){delete _0x564bcb['name'];}_0x586bff['status'](_0xc2be64)[_0x8e85('0x2e')](_0x564bcb);};}exports[_0x8e85('0x2f')]=function(_0x2e47db,_0x5b89d3){var _0x83c2a4={},_0x325942={},_0x36162f={'count':0x0,'rows':[]};var _0xf45d=_[_0x8e85('0x30')](db['AnalyticExtractedReport'][_0x8e85('0x31')],function(_0x5bfe3b){return{'name':_0x5bfe3b[_0x8e85('0x32')],'type':_0x5bfe3b['type'][_0x8e85('0x33')]};});_0x325942[_0x8e85('0x34')]=_[_0x8e85('0x30')](_0xf45d,_0x8e85('0x2d'));_0x325942[_0x8e85('0x35')]=_['keys'](_0x2e47db[_0x8e85('0x35')]);_0x325942['filters']=_[_0x8e85('0x36')](_0x325942['model'],_0x325942[_0x8e85('0x35')]);_0x83c2a4['attributes']=_[_0x8e85('0x36')](_0x325942[_0x8e85('0x34')],qs[_0x8e85('0x37')](_0x2e47db['query'][_0x8e85('0x37')]));_0x83c2a4['attributes']=_0x83c2a4['attributes']['length']?_0x83c2a4['attributes']:_0x325942['model'];if(!_0x2e47db[_0x8e85('0x35')]['hasOwnProperty'](_0x8e85('0x38'))){_0x83c2a4[_0x8e85('0x21')]=qs[_0x8e85('0x21')](_0x2e47db[_0x8e85('0x35')][_0x8e85('0x21')]);_0x83c2a4[_0x8e85('0x1f')]=qs[_0x8e85('0x1f')](_0x2e47db[_0x8e85('0x35')][_0x8e85('0x1f')]);}_0x83c2a4[_0x8e85('0x39')]=qs['sort'](_0x2e47db['query'][_0x8e85('0x3a')]);_0x83c2a4[_0x8e85('0x3b')]=qs[_0x8e85('0x3c')](_['pick'](_0x2e47db[_0x8e85('0x35')],_0x325942['filters']),_0xf45d);if(_0x2e47db[_0x8e85('0x35')]['filter']){_0x83c2a4['where']=_[_0x8e85('0x3d')](_0x83c2a4[_0x8e85('0x3b')],{'$or':_[_0x8e85('0x30')](_0xf45d,function(_0x1c5b81){if(_0x1c5b81[_0x8e85('0x3e')]!==_0x8e85('0x3f')){var _0x5469f5={};_0x5469f5[_0x1c5b81[_0x8e85('0x2d')]]={'$like':'%'+_0x2e47db[_0x8e85('0x35')]['filter']+'%'};return _0x5469f5;}})});}_0x83c2a4=_['merge']({},_0x83c2a4,_0x2e47db[_0x8e85('0x40')]);var _0x60c431={'where':_0x83c2a4[_0x8e85('0x3b')]};return db[_0x8e85('0x41')][_0x8e85('0x42')](_0x60c431)['then'](function(_0x4f0537){_0x36162f[_0x8e85('0x42')]=_0x4f0537;if(_0x2e47db[_0x8e85('0x35')][_0x8e85('0x43')]){_0x83c2a4['include']=[{'all':!![]}];}return db[_0x8e85('0x41')][_0x8e85('0x44')](_0x83c2a4);})['then'](function(_0x2cd72a){_0x36162f['rows']=_0x2cd72a;return _0x36162f;})[_0x8e85('0x26')](respondWithFilteredResult(_0x5b89d3,_0x83c2a4))[_0x8e85('0x45')](handleError(_0x5b89d3,null));};exports[_0x8e85('0x46')]=function(_0x3b1334,_0x2fbc3e){var _0x65e302={'raw':!![],'where':{'id':_0x3b1334[_0x8e85('0x47')]['id']}},_0xd8ba8c={};_0xd8ba8c[_0x8e85('0x34')]=_[_0x8e85('0x48')](db['AnalyticExtractedReport'][_0x8e85('0x31')]);_0xd8ba8c[_0x8e85('0x35')]=_[_0x8e85('0x48')](_0x3b1334['query']);_0xd8ba8c['filters']=_[_0x8e85('0x36')](_0xd8ba8c[_0x8e85('0x34')],_0xd8ba8c[_0x8e85('0x35')]);_0x65e302['attributes']=_[_0x8e85('0x36')](_0xd8ba8c[_0x8e85('0x34')],qs[_0x8e85('0x37')](_0x3b1334[_0x8e85('0x35')]['fields']));_0x65e302[_0x8e85('0x49')]=_0x65e302[_0x8e85('0x49')][_0x8e85('0x4a')]?_0x65e302[_0x8e85('0x49')]:_0xd8ba8c[_0x8e85('0x34')];if(_0x3b1334[_0x8e85('0x35')][_0x8e85('0x43')]){_0x65e302[_0x8e85('0x4b')]=[{'all':!![]}];}_0x65e302=_['merge']({},_0x65e302,_0x3b1334[_0x8e85('0x40')]);return db[_0x8e85('0x41')]['find'](_0x65e302)[_0x8e85('0x26')](handleEntityNotFound(_0x2fbc3e,null))['then'](respondWithResult(_0x2fbc3e,null))[_0x8e85('0x45')](handleError(_0x2fbc3e,null));};exports[_0x8e85('0x4c')]=function(_0x53d6fd,_0x16cb56){return db[_0x8e85('0x41')][_0x8e85('0x4c')](_0x53d6fd['body'],{})[_0x8e85('0x26')](function(_0xf5c1e9){var _0x112889=_0x53d6fd[_0x8e85('0x4d')][_0x8e85('0x28')]({'plain':!![]});if(!_0x112889)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x112889[_0x8e85('0x4e')]===_0x8e85('0x4d')){var _0x43897d=_0xf5c1e9[_0x8e85('0x28')]({'plain':!![]});var _0x3ddfd7=_0x8e85('0x29');return db[_0x8e85('0x4f')][_0x8e85('0x50')]({'where':{'name':_0x3ddfd7,'userProfileId':_0x112889[_0x8e85('0x51')]},'raw':!![]})[_0x8e85('0x26')](function(_0x2ea724){if(_0x2ea724&&_0x2ea724[_0x8e85('0x52')]===0x0){return db[_0x8e85('0x2a')][_0x8e85('0x4c')]({'name':_0x43897d[_0x8e85('0x2d')],'resourceId':_0x43897d['id'],'type':_0x2ea724[_0x8e85('0x2d')],'sectionId':_0x2ea724['id']},{})[_0x8e85('0x26')](function(){return _0xf5c1e9;});}else{return _0xf5c1e9;}})[_0x8e85('0x45')](function(_0x8c2bf5){logger[_0x8e85('0x2b')](_0x8e85('0x53'),_0x8c2bf5);throw _0x8c2bf5;});}return _0xf5c1e9;})[_0x8e85('0x26')](respondWithResult(_0x16cb56,0xc9))['catch'](handleError(_0x16cb56,null));};exports[_0x8e85('0x25')]=function(_0x3007a8,_0x4b93a5){if(_0x3007a8[_0x8e85('0x54')]['id']){delete _0x3007a8['body']['id'];}return db[_0x8e85('0x41')]['find']({'where':{'id':_0x3007a8[_0x8e85('0x47')]['id']}})[_0x8e85('0x26')](handleEntityNotFound(_0x4b93a5,null))[_0x8e85('0x26')](saveUpdates(_0x3007a8[_0x8e85('0x54')],null))[_0x8e85('0x26')](respondWithResult(_0x4b93a5,null))[_0x8e85('0x45')](handleError(_0x4b93a5,null));};exports['destroy']=function(_0x587fb1,_0x834eae){return db[_0x8e85('0x41')][_0x8e85('0x50')]({'where':{'id':_0x587fb1[_0x8e85('0x47')]['id']}})[_0x8e85('0x26')](handleEntityNotFound(_0x834eae,null))[_0x8e85('0x26')](removeEntity(_0x834eae,null))[_0x8e85('0x45')](handleError(_0x834eae,null));};exports[_0x8e85('0x55')]=function(_0x1dcbe,_0x1f6768,_0x47c224){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1dcbe['params']['id']},'attributes':[_0x8e85('0x2d'),_0x8e85('0x56'),'savename',_0x8e85('0x57')],'raw':!![]})[_0x8e85('0x26')](handleEntityNotFound(_0x1f6768,null))[_0x8e85('0x26')](function(_0xe47fca){if(_0xe47fca){if(!fs[_0x8e85('0x58')](path[_0x8e85('0x59')](config[_0x8e85('0x5a')],_0x8e85('0x5b'),_0xe47fca['savename']))){throw new db[(_0x8e85('0x5c'))]['ValidationError'](_0x8e85('0x5d'));}if(_0x1dcbe[_0x8e85('0x35')][_0x8e85('0x5e')]){return _0x1f6768[_0x8e85('0x1b')](0xc8);}return _0x1f6768[_0x8e85('0x55')](path['join'](config[_0x8e85('0x5a')],_0x8e85('0x5b'),_0xe47fca[_0x8e85('0x5f')]),util[_0x8e85('0x60')](_0x8e85('0x61'),_0xe47fca[_0x8e85('0x56')]||_0xe47fca['name'],_0xe47fca['output'][_0x8e85('0x62')]()));}})['catch'](handleError(_0x1f6768,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 698f6e9..06427e6 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 _0x3c05=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x55ac9c,_0xec384d){var _0x3f516d=function(_0x23852a){while(--_0x23852a){_0x55ac9c['push'](_0x55ac9c['shift']());}};_0x3f516d(++_0xec384d);}(_0x3c05,0xe6));var _0x53c0=function(_0x2912eb,_0x11b3e8){_0x2912eb=_0x2912eb-0x0;var _0xbd71bf=_0x3c05[_0x2912eb];return _0xbd71bf;};'use strict';var _=require(_0x53c0('0x0'));var util=require(_0x53c0('0x1'));var logger=require(_0x53c0('0x2'))(_0x53c0('0x3'));var moment=require('moment');var BPromise=require(_0x53c0('0x4'));var rp=require(_0x53c0('0x5'));var fs=require('fs');var path=require(_0x53c0('0x6'));var rimraf=require(_0x53c0('0x7'));var config=require(_0x53c0('0x8'));var attributes=require(_0x53c0('0x9'));module[_0x53c0('0xa')]=function(_0x27b643,_0x25dc3d){return _0x27b643[_0x53c0('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x53c0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe360=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xe360,0x155));var _0x0e36=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0xe360[_0x1646fa];return _0x5a47a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0e36('0x0'))(_0x0e36('0x1'));var moment=require(_0x0e36('0x2'));var BPromise=require(_0x0e36('0x3'));var rp=require(_0x0e36('0x4'));var fs=require('fs');var path=require(_0x0e36('0x5'));var rimraf=require(_0x0e36('0x6'));var config=require(_0x0e36('0x7'));var attributes=require(_0x0e36('0x8'));module['exports']=function(_0x261736,_0x4257d0){return _0x261736[_0x0e36('0x9')](_0x0e36('0xa'),attributes,{'tableName':_0x0e36('0xb'),'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 62657ec..a046009 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 _0x9137=['request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x44d1b4,_0x5f4433){var _0x212a56=function(_0xe2002c){while(--_0xe2002c){_0x44d1b4['push'](_0x44d1b4['shift']());}};_0x212a56(++_0x5f4433);}(_0x9137,0x7b));var _0x7913=function(_0x3294fa,_0x5e7bf9){_0x3294fa=_0x3294fa-0x0;var _0x426279=_0x9137[_0x3294fa];return _0x426279;};'use strict';var _=require(_0x7913('0x0'));var util=require(_0x7913('0x1'));var moment=require(_0x7913('0x2'));var BPromise=require(_0x7913('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7913('0x4'));var db=require(_0x7913('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7913('0x6'))(_0x7913('0x7'));var config=require('../../config/environment');var jayson=require(_0x7913('0x8'));var client=jayson[_0x7913('0x9')][_0x7913('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e99c,_0x1226f2,_0x37f46b){return new BPromise(function(_0x479929,_0x38abbe){return client[_0x7913('0xb')](_0x45e99c,_0x37f46b)[_0x7913('0xc')](function(_0x52b5ef){logger[_0x7913('0xd')](_0x7913('0xe'),_0x1226f2,_0x7913('0xf'));logger['debug'](_0x7913('0x10'),_0x1226f2,'request\x20sent',JSON[_0x7913('0x11')](_0x52b5ef));if(_0x52b5ef['error']){if(_0x52b5ef[_0x7913('0x12')][_0x7913('0x13')]===0x1f4){logger['error'](_0x7913('0xe'),_0x1226f2,_0x52b5ef[_0x7913('0x12')][_0x7913('0x14')]);return _0x38abbe(_0x52b5ef[_0x7913('0x12')][_0x7913('0x14')]);}logger[_0x7913('0x12')](_0x7913('0xe'),_0x1226f2,_0x52b5ef[_0x7913('0x12')][_0x7913('0x14')]);return _0x479929(_0x52b5ef[_0x7913('0x12')][_0x7913('0x14')]);}else{logger[_0x7913('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1226f2,_0x7913('0xf'));_0x479929(_0x52b5ef[_0x7913('0x15')][_0x7913('0x14')]);}})[_0x7913('0x16')](function(_0x1ef8ca){logger[_0x7913('0x12')](_0x7913('0xe'),_0x1226f2,_0x1ef8ca);_0x38abbe(_0x1ef8ca);});});} \ No newline at end of file +var _0x5194=['client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2e5e0f,_0xce82e7){var _0x11bbda=function(_0x51974f){while(--_0x51974f){_0x2e5e0f['push'](_0x2e5e0f['shift']());}};_0x11bbda(++_0xce82e7);}(_0x5194,0x173));var _0x4519=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5194[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4519('0x0'));var BPromise=require(_0x4519('0x1'));var rs=require(_0x4519('0x2'));var fs=require('fs');var Redis=require(_0x4519('0x3'));var db=require(_0x4519('0x4'))['db'];var utils=require(_0x4519('0x5'));var logger=require(_0x4519('0x6'))(_0x4519('0x7'));var config=require(_0x4519('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4519('0x9')][_0x4519('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6de583,_0x2d41df,_0x4e4537){return new BPromise(function(_0x554121,_0x5eb1c4){return client[_0x4519('0xb')](_0x6de583,_0x4e4537)[_0x4519('0xc')](function(_0xd57979){logger['info'](_0x4519('0xd'),_0x2d41df,_0x4519('0xe'));logger[_0x4519('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2d41df,_0x4519('0xe'),JSON['stringify'](_0xd57979));if(_0xd57979['error']){if(_0xd57979['error'][_0x4519('0x10')]===0x1f4){logger[_0x4519('0x11')](_0x4519('0xd'),_0x2d41df,_0xd57979[_0x4519('0x11')][_0x4519('0x12')]);return _0x5eb1c4(_0xd57979['error']['message']);}logger[_0x4519('0x11')](_0x4519('0xd'),_0x2d41df,_0xd57979[_0x4519('0x11')][_0x4519('0x12')]);return _0x554121(_0xd57979['error'][_0x4519('0x12')]);}else{logger['info'](_0x4519('0xd'),_0x2d41df,_0x4519('0xe'));_0x554121(_0xd57979['result'][_0x4519('0x12')]);}})[_0x4519('0x13')](function(_0x19b0c1){logger['error'](_0x4519('0xd'),_0x2d41df,_0x19b0c1);_0x5eb1c4(_0x19b0c1);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c12a95c..6268732 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 _0x3185=['show','/:id/download','create','put','/:id','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0xeaa0,_0xc4ada3){var _0x2614f3=function(_0x3c49a5){while(--_0x3c49a5){_0xeaa0['push'](_0xeaa0['shift']());}};_0x2614f3(++_0xc4ada3);}(_0x3185,0x193));var _0x5318=function(_0x36fcd6,_0x4578cd){_0x36fcd6=_0x36fcd6-0x0;var _0x12828c=_0x3185[_0x36fcd6];return _0x12828c;};'use strict';var multer=require('multer');var util=require(_0x5318('0x0'));var path=require(_0x5318('0x1'));var timeout=require(_0x5318('0x2'));var express=require(_0x5318('0x3'));var router=express['Router']();var fs_extra=require(_0x5318('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5318('0x5'));var config=require(_0x5318('0x6'));var controller=require(_0x5318('0x7'));router[_0x5318('0x8')]('/',auth[_0x5318('0x9')](),controller[_0x5318('0xa')]);router[_0x5318('0x8')]('/:id',auth[_0x5318('0x9')](),controller[_0x5318('0xb')]);router[_0x5318('0x8')](_0x5318('0xc'),auth[_0x5318('0x9')](),controller['download']);router['post']('/',auth[_0x5318('0x9')](),controller[_0x5318('0xd')]);router[_0x5318('0xe')](_0x5318('0xf'),auth[_0x5318('0x9')](),controller[_0x5318('0x10')]);router['delete']('/:id',auth[_0x5318('0x9')](),controller[_0x5318('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0a11=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0a11,0xcc));var _0x10a1=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0x0a11[_0x606fe8];return _0x28b517;};'use strict';var multer=require(_0x10a1('0x0'));var util=require(_0x10a1('0x1'));var path=require(_0x10a1('0x2'));var timeout=require(_0x10a1('0x3'));var express=require(_0x10a1('0x4'));var router=express[_0x10a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x10a1('0x6'));var interaction=require(_0x10a1('0x7'));var config=require(_0x10a1('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x10a1('0x9')]('/',auth[_0x10a1('0xa')](),controller[_0x10a1('0xb')]);router[_0x10a1('0x9')](_0x10a1('0xc'),auth['isAuthenticated'](),controller[_0x10a1('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x10a1('0xe')]);router[_0x10a1('0xf')]('/',auth[_0x10a1('0xa')](),controller[_0x10a1('0x10')]);router[_0x10a1('0x11')](_0x10a1('0xc'),auth[_0x10a1('0xa')](),controller[_0x10a1('0x12')]);router[_0x10a1('0x13')](_0x10a1('0xc'),auth['isAuthenticated'](),controller[_0x10a1('0x14')]);module[_0x10a1('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e62ffa8..0d8bd00 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 _0x29ea=['STRING','BOOLEAN','sequelize','exports'];(function(_0x508beb,_0xf961b0){var _0x23e2c4=function(_0x586af5){while(--_0x586af5){_0x508beb['push'](_0x508beb['shift']());}};_0x23e2c4(++_0xf961b0);}(_0x29ea,0xae));var _0xa29e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x29ea[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa29e('0x0'));module[_0xa29e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa29e('0x2')]},'format':{'type':Sequelize[_0xa29e('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xa29e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe571=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x563b4f,_0x35a0f8){var _0x265629=function(_0x1124dc){while(--_0x1124dc){_0x563b4f['push'](_0x563b4f['shift']());}};_0x265629(++_0x35a0f8);}(_0xe571,0xae));var _0x1e57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe571[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1e57('0x0'));module[_0x1e57('0x1')]={'field':{'type':Sequelize[_0x1e57('0x2')]},'alias':{'type':Sequelize[_0x1e57('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1e57('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1e57('0x3')]},'custom':{'type':Sequelize[_0x1e57('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index ef6475d..a2aa785 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 _0x5e89=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','include','findAll','rows','catch','show','length','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x365790,_0x3cfa52){var _0x400a33=function(_0x3531c5){while(--_0x3531c5){_0x365790['push'](_0x365790['shift']());}};_0x400a33(++_0x3cfa52);}(_0x5e89,0x113));var _0x95e8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5e89[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x95e8('0x0'));var rimraf=require(_0x95e8('0x1'));var zipdir=require(_0x95e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95e8('0x3'));var Mustache=require(_0x95e8('0x4'));var util=require(_0x95e8('0x5'));var path=require(_0x95e8('0x6'));var sox=require(_0x95e8('0x7'));var csv=require(_0x95e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95e8('0x9'));var squel=require(_0x95e8('0xa'));var crypto=require('crypto');var jsforce=require(_0x95e8('0xb'));var deskjs=require(_0x95e8('0xc'));var toCsv=require(_0x95e8('0x8'));var querystring=require(_0x95e8('0xd'));var Papa=require(_0x95e8('0xe'));var Redis=require(_0x95e8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x95e8('0x10'));var as=require(_0x95e8('0x11'));var hardwareService=require(_0x95e8('0x12'));var logger=require(_0x95e8('0x13'))(_0x95e8('0x14'));var utils=require(_0x95e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3703ed,_0x1024f2){_0x1024f2=_0x1024f2||0xcc;return function(_0x240a3c){if(_0x240a3c){return _0x3703ed['sendStatus'](_0x1024f2);}return _0x3703ed[_0x95e8('0x16')](_0x1024f2)[_0x95e8('0x17')]();};}function respondWithResult(_0x5829cd,_0x3d21f8){_0x3d21f8=_0x3d21f8||0xc8;return function(_0x4a3e8f){if(_0x4a3e8f){return _0x5829cd[_0x95e8('0x16')](_0x3d21f8)[_0x95e8('0x18')](_0x4a3e8f);}};}function respondWithFilteredResult(_0xaccd57,_0x357a60){return function(_0x57ac0f){if(_0x57ac0f){var _0x431872=typeof _0x357a60[_0x95e8('0x19')]===_0x95e8('0x1a')&&typeof _0x357a60[_0x95e8('0x1b')]===_0x95e8('0x1a');var _0x2edce2=_0x57ac0f[_0x95e8('0x1c')];var _0x558330=_0x431872?0x0:_0x357a60[_0x95e8('0x19')];var _0x46cfda=_0x431872?_0x57ac0f[_0x95e8('0x1c')]:_0x357a60['offset']+_0x357a60[_0x95e8('0x1b')];var _0x20a699;if(_0x46cfda>=_0x2edce2){_0x46cfda=_0x2edce2;_0x20a699=0xc8;}else{_0x20a699=0xce;}_0xaccd57[_0x95e8('0x16')](_0x20a699);return _0xaccd57['set'](_0x95e8('0x1d'),_0x558330+'-'+_0x46cfda+'/'+_0x2edce2)[_0x95e8('0x18')](_0x57ac0f);}return null;};}function patchUpdates(_0x1cfba2){return function(_0x12a0ea){try{jsonpatch[_0x95e8('0x1e')](_0x12a0ea,_0x1cfba2,!![]);}catch(_0xdec84c){return BPromise[_0x95e8('0x1f')](_0xdec84c);}return _0x12a0ea[_0x95e8('0x20')]();};}function saveUpdates(_0x36a573,_0x39bcf5){return function(_0x10598f){if(_0x10598f){return _0x10598f[_0x95e8('0x21')](_0x36a573)[_0x95e8('0x22')](function(_0x51241f){return _0x51241f;});}return null;};}function removeEntity(_0xe3b003,_0x5d06ab){return function(_0x2d113a){if(_0x2d113a){return _0x2d113a[_0x95e8('0x23')]()[_0x95e8('0x22')](function(){_0xe3b003[_0x95e8('0x16')](0xcc)[_0x95e8('0x17')]();});}};}function handleEntityNotFound(_0x243331,_0x369946){return function(_0x318a2e){if(!_0x318a2e){_0x243331[_0x95e8('0x24')](0x194);}return _0x318a2e;};}function handleError(_0x11e5b5,_0x5bc3d5){_0x5bc3d5=_0x5bc3d5||0x1f4;return function(_0x88f5b0){logger[_0x95e8('0x25')](_0x88f5b0['stack']);if(_0x88f5b0[_0x95e8('0x26')]){delete _0x88f5b0[_0x95e8('0x26')];}_0x11e5b5[_0x95e8('0x16')](_0x5bc3d5)[_0x95e8('0x27')](_0x88f5b0);};}exports[_0x95e8('0x28')]=function(_0x7b9f8a,_0x2dd607){var _0x4ae989={},_0x590245={},_0x5408f9={'count':0x0,'rows':[]};var _0x3a6411=_['map'](db['AnalyticFieldReport'][_0x95e8('0x29')],function(_0x166898){return{'name':_0x166898[_0x95e8('0x2a')],'type':_0x166898[_0x95e8('0x2b')][_0x95e8('0x2c')]};});_0x590245[_0x95e8('0x2d')]=_[_0x95e8('0x2e')](_0x3a6411,_0x95e8('0x26'));_0x590245[_0x95e8('0x2f')]=_[_0x95e8('0x30')](_0x7b9f8a['query']);_0x590245[_0x95e8('0x31')]=_[_0x95e8('0x32')](_0x590245['model'],_0x590245[_0x95e8('0x2f')]);_0x4ae989[_0x95e8('0x33')]=_[_0x95e8('0x32')](_0x590245[_0x95e8('0x2d')],qs[_0x95e8('0x34')](_0x7b9f8a['query']['fields']));_0x4ae989['attributes']=_0x4ae989['attributes']['length']?_0x4ae989[_0x95e8('0x33')]:_0x590245[_0x95e8('0x2d')];if(!_0x7b9f8a[_0x95e8('0x2f')][_0x95e8('0x35')](_0x95e8('0x36'))){_0x4ae989[_0x95e8('0x1b')]=qs[_0x95e8('0x1b')](_0x7b9f8a[_0x95e8('0x2f')][_0x95e8('0x1b')]);_0x4ae989[_0x95e8('0x19')]=qs['offset'](_0x7b9f8a[_0x95e8('0x2f')]['offset']);}_0x4ae989['order']=qs[_0x95e8('0x37')](_0x7b9f8a['query'][_0x95e8('0x37')]);_0x4ae989[_0x95e8('0x38')]=qs['filters'](_[_0x95e8('0x39')](_0x7b9f8a[_0x95e8('0x2f')],_0x590245[_0x95e8('0x31')]),_0x3a6411);if(_0x7b9f8a[_0x95e8('0x2f')][_0x95e8('0x3a')]){_0x4ae989[_0x95e8('0x38')]=_[_0x95e8('0x3b')](_0x4ae989[_0x95e8('0x38')],{'$or':_[_0x95e8('0x2e')](_0x3a6411,function(_0x4cfd32){if(_0x4cfd32[_0x95e8('0x2b')]!==_0x95e8('0x3c')){var _0x39748c={};_0x39748c[_0x4cfd32[_0x95e8('0x26')]]={'$like':'%'+_0x7b9f8a[_0x95e8('0x2f')][_0x95e8('0x3a')]+'%'};return _0x39748c;}})});}_0x4ae989=_[_0x95e8('0x3b')]({},_0x4ae989,_0x7b9f8a[_0x95e8('0x3d')]);var _0x56a7f2={'where':_0x4ae989[_0x95e8('0x38')]};return db[_0x95e8('0x3e')][_0x95e8('0x1c')](_0x56a7f2)[_0x95e8('0x22')](function(_0x5a8ae2){_0x5408f9['count']=_0x5a8ae2;if(_0x7b9f8a[_0x95e8('0x2f')]['includeAll']){_0x4ae989[_0x95e8('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x95e8('0x40')](_0x4ae989);})[_0x95e8('0x22')](function(_0x4498b6){_0x5408f9[_0x95e8('0x41')]=_0x4498b6;return _0x5408f9;})[_0x95e8('0x22')](respondWithFilteredResult(_0x2dd607,_0x4ae989))[_0x95e8('0x42')](handleError(_0x2dd607,null));};exports[_0x95e8('0x43')]=function(_0x102673,_0x97657c){var _0x142c3c={'raw':![],'where':{'id':_0x102673['params']['id']}},_0x5b39b9={};_0x5b39b9[_0x95e8('0x2d')]=_[_0x95e8('0x30')](db[_0x95e8('0x3e')][_0x95e8('0x29')]);_0x5b39b9[_0x95e8('0x2f')]=_[_0x95e8('0x30')](_0x102673['query']);_0x5b39b9['filters']=_[_0x95e8('0x32')](_0x5b39b9[_0x95e8('0x2d')],_0x5b39b9[_0x95e8('0x2f')]);_0x142c3c[_0x95e8('0x33')]=_[_0x95e8('0x32')](_0x5b39b9['model'],qs['fields'](_0x102673[_0x95e8('0x2f')][_0x95e8('0x34')]));_0x142c3c[_0x95e8('0x33')]=_0x142c3c[_0x95e8('0x33')][_0x95e8('0x44')]?_0x142c3c[_0x95e8('0x33')]:_0x5b39b9[_0x95e8('0x2d')];if(_0x102673['query']['includeAll']){_0x142c3c[_0x95e8('0x3f')]=[{'all':!![]}];}_0x142c3c=_['merge']({},_0x142c3c,_0x102673[_0x95e8('0x3d')]);return db[_0x95e8('0x3e')][_0x95e8('0x45')](_0x142c3c)[_0x95e8('0x22')](handleEntityNotFound(_0x97657c,null))[_0x95e8('0x22')](respondWithResult(_0x97657c,null))[_0x95e8('0x42')](handleError(_0x97657c,null));};exports[_0x95e8('0x46')]=function(_0x4281fb,_0x17c3cc){return db[_0x95e8('0x3e')][_0x95e8('0x46')](_0x4281fb[_0x95e8('0x47')],{})[_0x95e8('0x22')](respondWithResult(_0x17c3cc,0xc9))[_0x95e8('0x42')](handleError(_0x17c3cc,null));};exports[_0x95e8('0x48')]=function(_0x1993bb,_0x20d8d8){return db[_0x95e8('0x3e')]['bulkCreate'](_0x1993bb[_0x95e8('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20d8d8,0xc9))[_0x95e8('0x42')](handleError(_0x20d8d8,null));};exports[_0x95e8('0x21')]=function(_0x216cf1,_0x279319){if(_0x216cf1['body']['id']){delete _0x216cf1['body']['id'];}return db[_0x95e8('0x3e')][_0x95e8('0x45')]({'where':{'id':_0x216cf1[_0x95e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x279319,null))[_0x95e8('0x22')](saveUpdates(_0x216cf1[_0x95e8('0x47')],null))['then'](respondWithResult(_0x279319,null))[_0x95e8('0x42')](handleError(_0x279319,null));};exports[_0x95e8('0x23')]=function(_0x54fc23,_0x249dd6){return db[_0x95e8('0x3e')][_0x95e8('0x45')]({'where':{'id':_0x54fc23[_0x95e8('0x49')]['id']}})[_0x95e8('0x22')](handleEntityNotFound(_0x249dd6,null))[_0x95e8('0x22')](removeEntity(_0x249dd6,null))['catch'](handleError(_0x249dd6,null));};exports[_0x95e8('0x4a')]=function(_0x4ea291,_0xe929d){return db[_0x95e8('0x3e')][_0x95e8('0x23')]({'where':{'id':_0x4ea291['query'][_0x95e8('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x95e8('0x22')](respondWithResult(_0xe929d,0xcc))[_0x95e8('0x42')](handleError(_0xe929d,null));};exports[_0x95e8('0x4c')]=function(_0x2cf178,_0x188ba6,_0x4613b2){return db[_0x95e8('0x4d')][_0x95e8('0x4e')]({'where':{'id':_0x2cf178[_0x95e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x188ba6,null))[_0x95e8('0x22')](function(_0x4839cf){if(_0x4839cf){return db[_0x95e8('0x4f')][_0x95e8('0x50')](function(_0x2378fa){return db[_0x95e8('0x3e')][_0x95e8('0x23')]({'where':{'CustomReportId':_0x2cf178[_0x95e8('0x49')]['id']},'transaction':_0x2378fa})[_0x95e8('0x22')](function(_0x17a9d8){var _0x4f8f6f=_[_0x95e8('0x2e')](_0x2cf178[_0x95e8('0x47')],function(_0x276c74){delete _0x276c74['id'];_0x276c74['CustomReportId']=_0x2cf178['params']['id'];return _0x276c74;});return db['AnalyticFieldReport'][_0x95e8('0x48')](_0x4f8f6f,{'transaction':_0x2378fa});});})['then'](function(){return db[_0x95e8('0x3e')][_0x95e8('0x40')]({'where':{'CustomReportId':_0x2cf178[_0x95e8('0x49')]['id']}});});}})['then'](respondWithResult(_0x188ba6,null))[_0x95e8('0x42')](handleError(_0x188ba6,null));}; \ No newline at end of file +var _0x15ff=['length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','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','count','limit','apply','reject','save','update','then','destroy','error','stack','send','index','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields'];(function(_0x45e6f4,_0x5c0ebd){var _0x5e975b=function(_0x60fa5){while(--_0x60fa5){_0x45e6f4['push'](_0x45e6f4['shift']());}};_0x5e975b(++_0x5c0ebd);}(_0x15ff,0x74));var _0xf15f=function(_0x56fd06,_0x54835c){_0x56fd06=_0x56fd06-0x0;var _0x9fde0a=_0x15ff[_0x56fd06];return _0x9fde0a;};'use strict';var emlformat=require(_0xf15f('0x0'));var rimraf=require(_0xf15f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf15f('0x2'));var rp=require('request-promise');var moment=require(_0xf15f('0x3'));var BPromise=require(_0xf15f('0x4'));var Mustache=require(_0xf15f('0x5'));var util=require(_0xf15f('0x6'));var path=require(_0xf15f('0x7'));var sox=require(_0xf15f('0x8'));var csv=require('to-csv');var ejs=require(_0xf15f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf15f('0xa'));var squel=require(_0xf15f('0xb'));var crypto=require(_0xf15f('0xc'));var jsforce=require(_0xf15f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf15f('0xe'));var querystring=require(_0xf15f('0xf'));var Papa=require(_0xf15f('0x10'));var Redis=require('ioredis');var authService=require(_0xf15f('0x11'));var qs=require(_0xf15f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf15f('0x13'));var logger=require(_0xf15f('0x14'))(_0xf15f('0x15'));var utils=require(_0xf15f('0x16'));var config=require(_0xf15f('0x17'));var licenseUtil=require(_0xf15f('0x18'));var db=require(_0xf15f('0x19'))['db'];function respondWithStatusCode(_0x379ae3,_0x36303f){_0x36303f=_0x36303f||0xcc;return function(_0x35767b){if(_0x35767b){return _0x379ae3[_0xf15f('0x1a')](_0x36303f);}return _0x379ae3[_0xf15f('0x1b')](_0x36303f)[_0xf15f('0x1c')]();};}function respondWithResult(_0x273c5d,_0x15d65e){_0x15d65e=_0x15d65e||0xc8;return function(_0x1b57e8){if(_0x1b57e8){return _0x273c5d[_0xf15f('0x1b')](_0x15d65e)[_0xf15f('0x1d')](_0x1b57e8);}};}function respondWithFilteredResult(_0x37cb43,_0x5331ff){return function(_0x5f4479){if(_0x5f4479){var _0x34dd78=typeof _0x5331ff[_0xf15f('0x1e')]==='undefined'&&typeof _0x5331ff['limit']===_0xf15f('0x1f');var _0x54c173=_0x5f4479[_0xf15f('0x20')];var _0x48bb65=_0x34dd78?0x0:_0x5331ff[_0xf15f('0x1e')];var _0x45f5c8=_0x34dd78?_0x5f4479[_0xf15f('0x20')]:_0x5331ff[_0xf15f('0x1e')]+_0x5331ff[_0xf15f('0x21')];var _0xda3331;if(_0x45f5c8>=_0x54c173){_0x45f5c8=_0x54c173;_0xda3331=0xc8;}else{_0xda3331=0xce;}_0x37cb43[_0xf15f('0x1b')](_0xda3331);return _0x37cb43['set']('Content-Range',_0x48bb65+'-'+_0x45f5c8+'/'+_0x54c173)[_0xf15f('0x1d')](_0x5f4479);}return null;};}function patchUpdates(_0x1f3edb){return function(_0x65f04f){try{jsonpatch[_0xf15f('0x22')](_0x65f04f,_0x1f3edb,!![]);}catch(_0x1c4ab9){return BPromise[_0xf15f('0x23')](_0x1c4ab9);}return _0x65f04f[_0xf15f('0x24')]();};}function saveUpdates(_0x488647,_0x2d707b){return function(_0x41ec0d){if(_0x41ec0d){return _0x41ec0d[_0xf15f('0x25')](_0x488647)[_0xf15f('0x26')](function(_0x50be2a){return _0x50be2a;});}return null;};}function removeEntity(_0x5c6b41,_0x2c168){return function(_0x5090dc){if(_0x5090dc){return _0x5090dc[_0xf15f('0x27')]()[_0xf15f('0x26')](function(){_0x5c6b41[_0xf15f('0x1b')](0xcc)[_0xf15f('0x1c')]();});}};}function handleEntityNotFound(_0xe060d0,_0x506cd6){return function(_0x5201b6){if(!_0x5201b6){_0xe060d0['sendStatus'](0x194);}return _0x5201b6;};}function handleError(_0x55df22,_0x1644ce){_0x1644ce=_0x1644ce||0x1f4;return function(_0x34021d){logger[_0xf15f('0x28')](_0x34021d[_0xf15f('0x29')]);if(_0x34021d['name']){delete _0x34021d['name'];}_0x55df22[_0xf15f('0x1b')](_0x1644ce)[_0xf15f('0x2a')](_0x34021d);};}exports[_0xf15f('0x2b')]=function(_0x1b7dd6,_0x1bd85d){var _0x20b41b={},_0x3bd730={},_0x347ce4={'count':0x0,'rows':[]};var _0x400039=_['map'](db['AnalyticFieldReport'][_0xf15f('0x2c')],function(_0x56aa1f){return{'name':_0x56aa1f[_0xf15f('0x2d')],'type':_0x56aa1f['type'][_0xf15f('0x2e')]};});_0x3bd730[_0xf15f('0x2f')]=_[_0xf15f('0x30')](_0x400039,_0xf15f('0x31'));_0x3bd730[_0xf15f('0x32')]=_[_0xf15f('0x33')](_0x1b7dd6[_0xf15f('0x32')]);_0x3bd730[_0xf15f('0x34')]=_[_0xf15f('0x35')](_0x3bd730[_0xf15f('0x2f')],_0x3bd730[_0xf15f('0x32')]);_0x20b41b[_0xf15f('0x36')]=_['intersection'](_0x3bd730['model'],qs[_0xf15f('0x37')](_0x1b7dd6[_0xf15f('0x32')][_0xf15f('0x37')]));_0x20b41b['attributes']=_0x20b41b[_0xf15f('0x36')][_0xf15f('0x38')]?_0x20b41b[_0xf15f('0x36')]:_0x3bd730[_0xf15f('0x2f')];if(!_0x1b7dd6[_0xf15f('0x32')][_0xf15f('0x39')](_0xf15f('0x3a'))){_0x20b41b[_0xf15f('0x21')]=qs[_0xf15f('0x21')](_0x1b7dd6[_0xf15f('0x32')][_0xf15f('0x21')]);_0x20b41b[_0xf15f('0x1e')]=qs[_0xf15f('0x1e')](_0x1b7dd6[_0xf15f('0x32')][_0xf15f('0x1e')]);}_0x20b41b[_0xf15f('0x3b')]=qs[_0xf15f('0x3c')](_0x1b7dd6[_0xf15f('0x32')]['sort']);_0x20b41b['where']=qs['filters'](_[_0xf15f('0x3d')](_0x1b7dd6[_0xf15f('0x32')],_0x3bd730['filters']),_0x400039);if(_0x1b7dd6[_0xf15f('0x32')]['filter']){_0x20b41b[_0xf15f('0x3e')]=_[_0xf15f('0x3f')](_0x20b41b[_0xf15f('0x3e')],{'$or':_[_0xf15f('0x30')](_0x400039,function(_0x14a10d){if(_0x14a10d[_0xf15f('0x40')]!==_0xf15f('0x41')){var _0x1b3d2d={};_0x1b3d2d[_0x14a10d[_0xf15f('0x31')]]={'$like':'%'+_0x1b7dd6[_0xf15f('0x32')][_0xf15f('0x42')]+'%'};return _0x1b3d2d;}})});}_0x20b41b=_[_0xf15f('0x3f')]({},_0x20b41b,_0x1b7dd6[_0xf15f('0x43')]);var _0x27ed10={'where':_0x20b41b[_0xf15f('0x3e')]};return db[_0xf15f('0x44')][_0xf15f('0x20')](_0x27ed10)['then'](function(_0x3cd6cc){_0x347ce4[_0xf15f('0x20')]=_0x3cd6cc;if(_0x1b7dd6[_0xf15f('0x32')][_0xf15f('0x45')]){_0x20b41b[_0xf15f('0x46')]=[{'all':!![]}];}return db[_0xf15f('0x44')][_0xf15f('0x47')](_0x20b41b);})[_0xf15f('0x26')](function(_0x2d8743){_0x347ce4[_0xf15f('0x48')]=_0x2d8743;return _0x347ce4;})[_0xf15f('0x26')](respondWithFilteredResult(_0x1bd85d,_0x20b41b))[_0xf15f('0x49')](handleError(_0x1bd85d,null));};exports[_0xf15f('0x4a')]=function(_0x3d8deb,_0x524da3){var _0x32e6d8={'raw':![],'where':{'id':_0x3d8deb[_0xf15f('0x4b')]['id']}},_0x4c3c6c={};_0x4c3c6c[_0xf15f('0x2f')]=_[_0xf15f('0x33')](db[_0xf15f('0x44')][_0xf15f('0x2c')]);_0x4c3c6c['query']=_['keys'](_0x3d8deb['query']);_0x4c3c6c[_0xf15f('0x34')]=_['intersection'](_0x4c3c6c[_0xf15f('0x2f')],_0x4c3c6c[_0xf15f('0x32')]);_0x32e6d8['attributes']=_[_0xf15f('0x35')](_0x4c3c6c[_0xf15f('0x2f')],qs[_0xf15f('0x37')](_0x3d8deb[_0xf15f('0x32')][_0xf15f('0x37')]));_0x32e6d8[_0xf15f('0x36')]=_0x32e6d8[_0xf15f('0x36')]['length']?_0x32e6d8[_0xf15f('0x36')]:_0x4c3c6c[_0xf15f('0x2f')];if(_0x3d8deb['query'][_0xf15f('0x45')]){_0x32e6d8['include']=[{'all':!![]}];}_0x32e6d8=_['merge']({},_0x32e6d8,_0x3d8deb[_0xf15f('0x43')]);return db['AnalyticFieldReport']['find'](_0x32e6d8)[_0xf15f('0x26')](handleEntityNotFound(_0x524da3,null))[_0xf15f('0x26')](respondWithResult(_0x524da3,null))[_0xf15f('0x49')](handleError(_0x524da3,null));};exports[_0xf15f('0x4c')]=function(_0x4b3850,_0x301d8a){return db[_0xf15f('0x44')]['create'](_0x4b3850[_0xf15f('0x4d')],{})['then'](respondWithResult(_0x301d8a,0xc9))[_0xf15f('0x49')](handleError(_0x301d8a,null));};exports[_0xf15f('0x4e')]=function(_0x2150bf,_0x684d95){return db[_0xf15f('0x44')][_0xf15f('0x4e')](_0x2150bf[_0xf15f('0x4d')],{'raw':![],'individualHooks':!![]})[_0xf15f('0x26')](respondWithResult(_0x684d95,0xc9))[_0xf15f('0x49')](handleError(_0x684d95,null));};exports[_0xf15f('0x25')]=function(_0x44bc1c,_0x1b993e){if(_0x44bc1c[_0xf15f('0x4d')]['id']){delete _0x44bc1c[_0xf15f('0x4d')]['id'];}return db[_0xf15f('0x44')]['find']({'where':{'id':_0x44bc1c['params']['id']}})['then'](handleEntityNotFound(_0x1b993e,null))[_0xf15f('0x26')](saveUpdates(_0x44bc1c[_0xf15f('0x4d')],null))[_0xf15f('0x26')](respondWithResult(_0x1b993e,null))[_0xf15f('0x49')](handleError(_0x1b993e,null));};exports[_0xf15f('0x27')]=function(_0x516c54,_0x3446a3){return db['AnalyticFieldReport'][_0xf15f('0x4f')]({'where':{'id':_0x516c54['params']['id']}})['then'](handleEntityNotFound(_0x3446a3,null))[_0xf15f('0x26')](removeEntity(_0x3446a3,null))['catch'](handleError(_0x3446a3,null));};exports[_0xf15f('0x50')]=function(_0x5d8ddb,_0x4d3447){return db['AnalyticFieldReport'][_0xf15f('0x27')]({'where':{'id':_0x5d8ddb[_0xf15f('0x32')][_0xf15f('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xf15f('0x26')](respondWithResult(_0x4d3447,0xcc))['catch'](handleError(_0x4d3447,null));};exports[_0xf15f('0x52')]=function(_0x41c999,_0x14ff58,_0x2adf3c){return db[_0xf15f('0x53')]['findOne']({'where':{'id':_0x41c999[_0xf15f('0x4b')]['id']}})[_0xf15f('0x26')](handleEntityNotFound(_0x14ff58,null))['then'](function(_0x24b504){if(_0x24b504){return db[_0xf15f('0x54')]['transaction'](function(_0x7bbc25){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x41c999[_0xf15f('0x4b')]['id']},'transaction':_0x7bbc25})[_0xf15f('0x26')](function(_0xc32d72){var _0x5dc7d0=_['map'](_0x41c999['body'],function(_0x2a13ee){delete _0x2a13ee['id'];_0x2a13ee[_0xf15f('0x55')]=_0x41c999[_0xf15f('0x4b')]['id'];return _0x2a13ee;});return db[_0xf15f('0x44')]['bulkCreate'](_0x5dc7d0,{'transaction':_0x7bbc25});});})[_0xf15f('0x26')](function(){return db[_0xf15f('0x44')][_0xf15f('0x47')]({'where':{'CustomReportId':_0x41c999[_0xf15f('0x4b')]['id']}});});}})[_0xf15f('0x26')](respondWithResult(_0x14ff58,null))['catch'](handleError(_0x14ff58,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 00f56c8..29e22e6 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 _0x3690=['exports','define','AnalyticFieldReport','lodash','../../config/logger','bluebird','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x508660,_0x4aa022){var _0x4a4e69=function(_0x4c83c6){while(--_0x4c83c6){_0x508660['push'](_0x508660['shift']());}};_0x4a4e69(++_0x4aa022);}(_0x3690,0x1e0));var _0x0369=function(_0x49fc94,_0x213a96){_0x49fc94=_0x49fc94-0x0;var _0x18af4d=_0x3690[_0x49fc94];return _0x18af4d;};'use strict';var _=require(_0x0369('0x0'));var util=require('util');var logger=require(_0x0369('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0369('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0369('0x3'));var rimraf=require('rimraf');var config=require(_0x0369('0x4'));var attributes=require(_0x0369('0x5'));module[_0x0369('0x6')]=function(_0x14da76,_0x1129ae){return _0x14da76[_0x0369('0x7')](_0x0369('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaed4=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x462c06,_0x55cc75){var _0xa347cd=function(_0x1bb939){while(--_0x1bb939){_0x462c06['push'](_0x462c06['shift']());}};_0xa347cd(++_0x55cc75);}(_0xaed4,0x173));var _0x4aed=function(_0x36ceb0,_0x400094){_0x36ceb0=_0x36ceb0-0x0;var _0x36498a=_0xaed4[_0x36ceb0];return _0x36498a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4aed('0x0'))(_0x4aed('0x1'));var moment=require(_0x4aed('0x2'));var BPromise=require(_0x4aed('0x3'));var rp=require(_0x4aed('0x4'));var fs=require('fs');var path=require(_0x4aed('0x5'));var rimraf=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var attributes=require(_0x4aed('0x8'));module[_0x4aed('0x9')]=function(_0x55e5ec,_0x290817){return _0x55e5ec[_0x4aed('0xa')](_0x4aed('0xb'),attributes,{'tableName':_0x4aed('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 f0b1bb3..577e4e0 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 _0x1be1=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info'];(function(_0x4bc116,_0x3c2c04){var _0x2731f0=function(_0x31dd22){while(--_0x31dd22){_0x4bc116['push'](_0x4bc116['shift']());}};_0x2731f0(++_0x3c2c04);}(_0x1be1,0x11a));var _0x11be=function(_0x265564,_0x5293eb){_0x265564=_0x265564-0x0;var _0xef6ac2=_0x1be1[_0x265564];return _0xef6ac2;};'use strict';var _=require(_0x11be('0x0'));var util=require(_0x11be('0x1'));var moment=require(_0x11be('0x2'));var BPromise=require('bluebird');var rs=require(_0x11be('0x3'));var fs=require('fs');var Redis=require(_0x11be('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x11be('0x5'));var logger=require(_0x11be('0x6'))('rpc');var config=require(_0x11be('0x7'));var jayson=require(_0x11be('0x8'));var client=jayson[_0x11be('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1200a5,_0x409f0f,_0x1c192f){return new BPromise(function(_0x2aafdd,_0x303e60){return client[_0x11be('0xa')](_0x1200a5,_0x1c192f)['then'](function(_0x255b1c){logger[_0x11be('0xb')](_0x11be('0xc'),_0x409f0f,_0x11be('0xd'));logger[_0x11be('0xe')](_0x11be('0xf'),_0x409f0f,_0x11be('0xd'),JSON[_0x11be('0x10')](_0x255b1c));if(_0x255b1c[_0x11be('0x11')]){if(_0x255b1c[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger['error'](_0x11be('0xc'),_0x409f0f,_0x255b1c[_0x11be('0x11')][_0x11be('0x13')]);return _0x303e60(_0x255b1c['error']['message']);}logger[_0x11be('0x11')](_0x11be('0xc'),_0x409f0f,_0x255b1c[_0x11be('0x11')]['message']);return _0x2aafdd(_0x255b1c[_0x11be('0x11')][_0x11be('0x13')]);}else{logger[_0x11be('0xb')](_0x11be('0xc'),_0x409f0f,_0x11be('0xd'));_0x2aafdd(_0x255b1c['result'][_0x11be('0x13')]);}})[_0x11be('0x14')](function(_0x3bea50){logger[_0x11be('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x409f0f,_0x3bea50);_0x303e60(_0x3bea50);});});} \ No newline at end of file +var _0x483e=['jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4a4768,_0x592e18){var _0x42d417=function(_0x21def4){while(--_0x21def4){_0x4a4768['push'](_0x4a4768['shift']());}};_0x42d417(++_0x592e18);}(_0x483e,0x14e));var _0xe483=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x483e[_0x67f95e];return _0x538f5a;};'use strict';var _=require(_0xe483('0x0'));var util=require('util');var moment=require(_0xe483('0x1'));var BPromise=require(_0xe483('0x2'));var rs=require(_0xe483('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe483('0x4'))['db'];var utils=require(_0xe483('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe483('0x6'));var client=jayson[_0xe483('0x7')][_0xe483('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52b9e3,_0x347a55,_0x376827){return new BPromise(function(_0x58d8e7,_0x55bcc1){return client[_0xe483('0x9')](_0x52b9e3,_0x376827)[_0xe483('0xa')](function(_0xe8763f){logger[_0xe483('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x347a55,'request\x20sent');logger['debug'](_0xe483('0xc'),_0x347a55,_0xe483('0xd'),JSON[_0xe483('0xe')](_0xe8763f));if(_0xe8763f[_0xe483('0xf')]){if(_0xe8763f['error'][_0xe483('0x10')]===0x1f4){logger[_0xe483('0xf')](_0xe483('0x11'),_0x347a55,_0xe8763f['error'][_0xe483('0x12')]);return _0x55bcc1(_0xe8763f['error'][_0xe483('0x12')]);}logger[_0xe483('0xf')](_0xe483('0x11'),_0x347a55,_0xe8763f[_0xe483('0xf')][_0xe483('0x12')]);return _0x58d8e7(_0xe8763f[_0xe483('0xf')][_0xe483('0x12')]);}else{logger['info'](_0xe483('0x11'),_0x347a55,_0xe483('0xd'));_0x58d8e7(_0xe8763f['result'][_0xe483('0x12')]);}})[_0xe483('0x13')](function(_0x37e38a){logger[_0xe483('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x347a55,_0x37e38a);_0x55bcc1(_0x37e38a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 8560f1d..ae37364 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(_0x3f9a53,_0x5e0b66){var _0x13f645=function(_0x25bbe6){while(--_0x25bbe6){_0x3f9a53['push'](_0x3f9a53['shift']());}};_0x13f645(++_0x5e0b66);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x580303,_0x54c923){var _0x1edb7d=function(_0xeb883f){while(--_0xeb883f){_0x580303['push'](_0x580303['shift']());}};_0x1edb7d(++_0x54c923);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 72bcdff..d689580 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 _0x41bb=['TEXT','STRING','sequelize','exports','name'];(function(_0xdf0ce8,_0x358d9c){var _0x506038=function(_0x40a29f){while(--_0x40a29f){_0xdf0ce8['push'](_0xdf0ce8['shift']());}};_0x506038(++_0x358d9c);}(_0x41bb,0xc5));var _0xb41b=function(_0x4fdc8e,_0x558215){_0x4fdc8e=_0x4fdc8e-0x0;var _0x3f4533=_0x41bb[_0x4fdc8e];return _0x3f4533;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb41b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xb41b('0x3')]},'description':{'type':Sequelize[_0xb41b('0x4')]}}; \ No newline at end of file +var _0x58a7=['name','TEXT','sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x58a7,0xf7));var _0x758a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x58a7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x758a('0x0'));module[_0x758a('0x1')]={'name':{'type':Sequelize[_0x758a('0x2')],'allowNull':![],'unique':_0x758a('0x3')},'table':{'type':Sequelize[_0x758a('0x2')]},'metric':{'type':Sequelize[_0x758a('0x4')]},'description':{'type':Sequelize[_0x758a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 6346a41..5bfa15f 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x43a621,_0x242ad0){var _0x39661d=function(_0x59feb1){while(--_0x59feb1){_0x43a621['push'](_0x43a621['shift']());}};_0x39661d(++_0x242ad0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));}; \ No newline at end of file +var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x16360c,_0x37c098){var _0x17dd2d=function(_0x32b306){while(--_0x32b306){_0x16360c['push'](_0x16360c['shift']());}};_0x17dd2d(++_0x37c098);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x271429,_0x25a7cc){_0x271429=_0x271429-0x0;var _0x1426b6=_0x9c5a[_0x271429];return _0x1426b6;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 79b19bc..2a4d9b2 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 _0xb0df=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticMetric'];(function(_0x4bb57b,_0x227cff){var _0x28bd82=function(_0x426fa1){while(--_0x426fa1){_0x4bb57b['push'](_0x4bb57b['shift']());}};_0x28bd82(++_0x227cff);}(_0xb0df,0x85));var _0xfb0d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xb0df[_0x102e37];return _0x35a07c;};'use strict';var _=require('lodash');var util=require(_0xfb0d('0x0'));var logger=require(_0xfb0d('0x1'))(_0xfb0d('0x2'));var moment=require(_0xfb0d('0x3'));var BPromise=require(_0xfb0d('0x4'));var rp=require(_0xfb0d('0x5'));var fs=require('fs');var path=require(_0xfb0d('0x6'));var rimraf=require(_0xfb0d('0x7'));var config=require(_0xfb0d('0x8'));var attributes=require('./analyticMetric.attributes');module[_0xfb0d('0x9')]=function(_0x12458c,_0x58e4c0){return _0x12458c['define'](_0xfb0d('0xa'),attributes,{'tableName':_0xfb0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6822=['path','rimraf','./analyticMetric.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x54dd2f,_0x5a62c7){var _0x3a5483=function(_0x4b011d){while(--_0x4b011d){_0x54dd2f['push'](_0x54dd2f['shift']());}};_0x3a5483(++_0x5a62c7);}(_0x6822,0xca));var _0x2682=function(_0x2dc119,_0x54a53d){_0x2dc119=_0x2dc119-0x0;var _0x55ce4f=_0x6822[_0x2dc119];return _0x55ce4f;};'use strict';var _=require(_0x2682('0x0'));var util=require(_0x2682('0x1'));var logger=require(_0x2682('0x2'))(_0x2682('0x3'));var moment=require(_0x2682('0x4'));var BPromise=require(_0x2682('0x5'));var rp=require(_0x2682('0x6'));var fs=require('fs');var path=require(_0x2682('0x7'));var rimraf=require(_0x2682('0x8'));var config=require('../../config/environment');var attributes=require(_0x2682('0x9'));module['exports']=function(_0x30fcd9,_0x39d4f7){return _0x30fcd9[_0x2682('0xa')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 16dd8ad..80a4510 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 _0x0279=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x0279,0x1c6));var _0x9027=function(_0xffa654,_0x4c734){_0xffa654=_0xffa654-0x0;var _0x5dd847=_0x0279[_0xffa654];return _0x5dd847;};'use strict';var _=require(_0x9027('0x0'));var util=require(_0x9027('0x1'));var moment=require(_0x9027('0x2'));var BPromise=require(_0x9027('0x3'));var rs=require(_0x9027('0x4'));var fs=require('fs');var Redis=require(_0x9027('0x5'));var db=require(_0x9027('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9027('0x7'))(_0x9027('0x8'));var config=require('../../config/environment');var jayson=require(_0x9027('0x9'));var client=jayson[_0x9027('0xa')][_0x9027('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x283cd9,_0xd8ab45,_0x24605a){return new BPromise(function(_0x33aee0,_0x22e4b4){return client[_0x9027('0xc')](_0x283cd9,_0x24605a)[_0x9027('0xd')](function(_0x589204){logger[_0x9027('0xe')](_0x9027('0xf'),_0xd8ab45,_0x9027('0x10'));logger[_0x9027('0x11')](_0x9027('0x12'),_0xd8ab45,_0x9027('0x10'),JSON['stringify'](_0x589204));if(_0x589204[_0x9027('0x13')]){if(_0x589204[_0x9027('0x13')][_0x9027('0x14')]===0x1f4){logger[_0x9027('0x13')](_0x9027('0xf'),_0xd8ab45,_0x589204[_0x9027('0x13')][_0x9027('0x15')]);return _0x22e4b4(_0x589204[_0x9027('0x13')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0xd8ab45,_0x589204[_0x9027('0x13')][_0x9027('0x15')]);return _0x33aee0(_0x589204[_0x9027('0x13')][_0x9027('0x15')]);}else{logger['info'](_0x9027('0xf'),_0xd8ab45,_0x9027('0x10'));_0x33aee0(_0x589204['result'][_0x9027('0x15')]);}})[_0x9027('0x16')](function(_0x43879a){logger[_0x9027('0x13')](_0x9027('0xf'),_0xd8ab45,_0x43879a);_0x22e4b4(_0x43879a);});});} \ No newline at end of file +var _0x4205=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','lodash','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4205,0x15d));var _0x5420=function(_0x2d5c00,_0x41f173){_0x2d5c00=_0x2d5c00-0x0;var _0x1e8c4e=_0x4205[_0x2d5c00];return _0x1e8c4e;};'use strict';var _=require(_0x5420('0x0'));var util=require(_0x5420('0x1'));var moment=require(_0x5420('0x2'));var BPromise=require(_0x5420('0x3'));var rs=require(_0x5420('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5420('0x5'))['db'];var utils=require(_0x5420('0x6'));var logger=require(_0x5420('0x7'))('rpc');var config=require(_0x5420('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5420('0x9')][_0x5420('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d29ba,_0x150908,_0x1bc905){return new BPromise(function(_0x4ca433,_0x51009f){return client[_0x5420('0xb')](_0x4d29ba,_0x1bc905)[_0x5420('0xc')](function(_0xdd0cac){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x150908,_0x5420('0xd'));logger[_0x5420('0xe')](_0x5420('0xf'),_0x150908,_0x5420('0xd'),JSON[_0x5420('0x10')](_0xdd0cac));if(_0xdd0cac[_0x5420('0x11')]){if(_0xdd0cac[_0x5420('0x11')][_0x5420('0x12')]===0x1f4){logger['error'](_0x5420('0x13'),_0x150908,_0xdd0cac[_0x5420('0x11')][_0x5420('0x14')]);return _0x51009f(_0xdd0cac[_0x5420('0x11')][_0x5420('0x14')]);}logger['error'](_0x5420('0x13'),_0x150908,_0xdd0cac[_0x5420('0x11')][_0x5420('0x14')]);return _0x4ca433(_0xdd0cac[_0x5420('0x11')]['message']);}else{logger[_0x5420('0x15')]('AnalyticMetric,\x20%s,\x20%s',_0x150908,_0x5420('0xd'));_0x4ca433(_0xdd0cac['result'][_0x5420('0x14')]);}})['catch'](function(_0x37c918){logger['error'](_0x5420('0x13'),_0x150908,_0x37c918);_0x51009f(_0x37c918);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 248052c..45e8b81 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 _0xd9c8=['post','isAuthenticated','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xd9c8[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var path=require('path');var timeout=require(_0x8d9c('0x2'));var express=require(_0x8d9c('0x3'));var router=express[_0x8d9c('0x4')]();var fs_extra=require(_0x8d9c('0x5'));var auth=require(_0x8d9c('0x6'));var interaction=require(_0x8d9c('0x7'));var config=require(_0x8d9c('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8d9c('0x9')]);router[_0x8d9c('0xa')](_0x8d9c('0xb'),auth['isAuthenticated'](),controller[_0x8d9c('0xc')]);router[_0x8d9c('0xd')]('/',auth[_0x8d9c('0xe')](),controller[_0x8d9c('0xf')]);router[_0x8d9c('0x10')](_0x8d9c('0xb'),auth[_0x8d9c('0xe')](),controller[_0x8d9c('0x11')]);router['delete'](_0x8d9c('0xb'),auth['isAuthenticated'](),controller[_0x8d9c('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe93b=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0x250641,_0xc06eea){var _0x86c8a8=function(_0x28c4bf){while(--_0x28c4bf){_0x250641['push'](_0x250641['shift']());}};_0x86c8a8(++_0xc06eea);}(_0xe93b,0x1c2));var _0xbe93=function(_0x3290e6,_0xceafbc){_0x3290e6=_0x3290e6-0x0;var _0x4e8f7f=_0xe93b[_0x3290e6];return _0x4e8f7f;};'use strict';var multer=require('multer');var util=require(_0xbe93('0x0'));var path=require(_0xbe93('0x1'));var timeout=require(_0xbe93('0x2'));var express=require('express');var router=express[_0xbe93('0x3')]();var fs_extra=require(_0xbe93('0x4'));var auth=require(_0xbe93('0x5'));var interaction=require(_0xbe93('0x6'));var config=require(_0xbe93('0x7'));var controller=require(_0xbe93('0x8'));router[_0xbe93('0x9')]('/',auth[_0xbe93('0xa')](),controller['index']);router[_0xbe93('0x9')](_0xbe93('0xb'),auth[_0xbe93('0xa')](),controller[_0xbe93('0xc')]);router[_0xbe93('0xd')]('/',auth[_0xbe93('0xa')](),controller[_0xbe93('0xe')]);router[_0xbe93('0xf')](_0xbe93('0xb'),auth['isAuthenticated'](),controller[_0xbe93('0x10')]);router[_0xbe93('0x11')](_0xbe93('0xb'),auth[_0xbe93('0xa')](),controller[_0xbe93('0x12')]);module[_0xbe93('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0dbc0c8..db04f0a 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 _0x48c0=['TEXT','exports'];(function(_0x22431e,_0x5af0a3){var _0xd978e9=function(_0x2bbdd7){while(--_0x2bbdd7){_0x22431e['push'](_0x22431e['shift']());}};_0xd978e9(++_0x5af0a3);}(_0x48c0,0x109));var _0x048c=function(_0x59e534,_0x57dd2d){_0x59e534=_0x59e534-0x0;var _0x135363=_0x48c0[_0x59e534];return _0x135363;};'use strict';var Sequelize=require('sequelize');module[_0x048c('0x0')]={'tree':{'type':Sequelize[_0x048c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xbdb8=['sequelize','exports'];(function(_0x2b0b4c,_0x385f66){var _0x1c0e1a=function(_0x46c69f){while(--_0x46c69f){_0x2b0b4c['push'](_0x2b0b4c['shift']());}};_0x1c0e1a(++_0x385f66);}(_0xbdb8,0xe2));var _0x8bdb=function(_0x41b29e,_0x34b288){_0x41b29e=_0x41b29e-0x0;var _0xacd517=_0xbdb8[_0x41b29e];return _0xacd517;};'use strict';var Sequelize=require(_0x8bdb('0x0'));module[_0x8bdb('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index f8c0573..c4da01e 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 _0x6542=['params','keys','length','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x585e0c,_0xc8dfbf){var _0x657bf9=function(_0x2e8159){while(--_0x2e8159){_0x585e0c['push'](_0x585e0c['shift']());}};_0x657bf9(++_0xc8dfbf);}(_0x6542,0x16e));var _0x2654=function(_0x5b7651,_0x119a5c){_0x5b7651=_0x5b7651-0x0;var _0x2d53ce=_0x6542[_0x5b7651];return _0x2d53ce;};'use strict';var emlformat=require(_0x2654('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2654('0x1'));var jsonpatch=require(_0x2654('0x2'));var rp=require('request-promise');var moment=require(_0x2654('0x3'));var BPromise=require(_0x2654('0x4'));var Mustache=require(_0x2654('0x5'));var util=require(_0x2654('0x6'));var path=require('path');var sox=require(_0x2654('0x7'));var csv=require(_0x2654('0x8'));var ejs=require(_0x2654('0x9'));var fs=require('fs');var fs_extra=require(_0x2654('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2654('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2654('0xc'));var toCsv=require(_0x2654('0x8'));var querystring=require('querystring');var Papa=require(_0x2654('0xd'));var Redis=require('ioredis');var authService=require(_0x2654('0xe'));var qs=require(_0x2654('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2654('0x10'));var logger=require('../../config/logger')(_0x2654('0x11'));var utils=require(_0x2654('0x12'));var config=require(_0x2654('0x13'));var licenseUtil=require(_0x2654('0x14'));var db=require(_0x2654('0x15'))['db'];function respondWithStatusCode(_0x312554,_0x40abb7){_0x40abb7=_0x40abb7||0xcc;return function(_0x237929){if(_0x237929){return _0x312554['sendStatus'](_0x40abb7);}return _0x312554[_0x2654('0x16')](_0x40abb7)[_0x2654('0x17')]();};}function respondWithResult(_0x2ebc61,_0x6b6222){_0x6b6222=_0x6b6222||0xc8;return function(_0x4bc696){if(_0x4bc696){return _0x2ebc61[_0x2654('0x16')](_0x6b6222)['json'](_0x4bc696);}};}function respondWithFilteredResult(_0x5919d2,_0xa16f2c){return function(_0x59b1c7){if(_0x59b1c7){var _0x48470f=typeof _0xa16f2c[_0x2654('0x18')]===_0x2654('0x19')&&typeof _0xa16f2c[_0x2654('0x1a')]==='undefined';var _0x3823a5=_0x59b1c7['count'];var _0x4919ed=_0x48470f?0x0:_0xa16f2c[_0x2654('0x18')];var _0x65cddb=_0x48470f?_0x59b1c7[_0x2654('0x1b')]:_0xa16f2c[_0x2654('0x18')]+_0xa16f2c[_0x2654('0x1a')];var _0x4437dc;if(_0x65cddb>=_0x3823a5){_0x65cddb=_0x3823a5;_0x4437dc=0xc8;}else{_0x4437dc=0xce;}_0x5919d2[_0x2654('0x16')](_0x4437dc);return _0x5919d2['set']('Content-Range',_0x4919ed+'-'+_0x65cddb+'/'+_0x3823a5)[_0x2654('0x1c')](_0x59b1c7);}return null;};}function patchUpdates(_0x4d67dd){return function(_0x41406f){try{jsonpatch['apply'](_0x41406f,_0x4d67dd,!![]);}catch(_0x4acdb0){return BPromise[_0x2654('0x1d')](_0x4acdb0);}return _0x41406f[_0x2654('0x1e')]();};}function saveUpdates(_0x18389a,_0x236678){return function(_0x987a99){if(_0x987a99){return _0x987a99[_0x2654('0x1f')](_0x18389a)[_0x2654('0x20')](function(_0x165010){return _0x165010;});}return null;};}function removeEntity(_0x512c15,_0x3e9123){return function(_0x480c6d){if(_0x480c6d){return _0x480c6d[_0x2654('0x21')]()[_0x2654('0x20')](function(){_0x512c15[_0x2654('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a61f6,_0x18855d){return function(_0x568ff0){if(!_0x568ff0){_0x4a61f6[_0x2654('0x22')](0x194);}return _0x568ff0;};}function handleError(_0x53d498,_0x58b533){_0x58b533=_0x58b533||0x1f4;return function(_0x194ae4){logger[_0x2654('0x23')](_0x194ae4[_0x2654('0x24')]);if(_0x194ae4[_0x2654('0x25')]){delete _0x194ae4[_0x2654('0x25')];}_0x53d498[_0x2654('0x16')](_0x58b533)[_0x2654('0x26')](_0x194ae4);};}exports[_0x2654('0x27')]=function(_0x2ac118,_0x5e10b0){var _0x3c710e={},_0x2808ab={},_0x43d341={'count':0x0,'rows':[]};var _0x5a9caa=_[_0x2654('0x28')](db[_0x2654('0x29')][_0x2654('0x2a')],function(_0x2ff7c7){return{'name':_0x2ff7c7[_0x2654('0x2b')],'type':_0x2ff7c7[_0x2654('0x2c')][_0x2654('0x2d')]};});_0x2808ab[_0x2654('0x2e')]=_[_0x2654('0x28')](_0x5a9caa,_0x2654('0x25'));_0x2808ab[_0x2654('0x2f')]=_['keys'](_0x2ac118[_0x2654('0x2f')]);_0x2808ab[_0x2654('0x30')]=_[_0x2654('0x31')](_0x2808ab['model'],_0x2808ab[_0x2654('0x2f')]);_0x3c710e[_0x2654('0x32')]=_[_0x2654('0x31')](_0x2808ab[_0x2654('0x2e')],qs['fields'](_0x2ac118[_0x2654('0x2f')][_0x2654('0x33')]));_0x3c710e[_0x2654('0x32')]=_0x3c710e[_0x2654('0x32')]['length']?_0x3c710e['attributes']:_0x2808ab[_0x2654('0x2e')];if(!_0x2ac118['query'][_0x2654('0x34')](_0x2654('0x35'))){_0x3c710e[_0x2654('0x1a')]=qs[_0x2654('0x1a')](_0x2ac118[_0x2654('0x2f')]['limit']);_0x3c710e[_0x2654('0x18')]=qs[_0x2654('0x18')](_0x2ac118['query']['offset']);}_0x3c710e[_0x2654('0x36')]=qs[_0x2654('0x37')](_0x2ac118['query'][_0x2654('0x37')]);_0x3c710e[_0x2654('0x38')]=qs[_0x2654('0x30')](_[_0x2654('0x39')](_0x2ac118['query'],_0x2808ab[_0x2654('0x30')]),_0x5a9caa);if(_0x2ac118[_0x2654('0x2f')][_0x2654('0x3a')]){_0x3c710e[_0x2654('0x38')]=_['merge'](_0x3c710e[_0x2654('0x38')],{'$or':_[_0x2654('0x28')](_0x5a9caa,function(_0xbb8947){if(_0xbb8947[_0x2654('0x2c')]!==_0x2654('0x3b')){var _0x1d9c9b={};_0x1d9c9b[_0xbb8947[_0x2654('0x25')]]={'$like':'%'+_0x2ac118[_0x2654('0x2f')]['filter']+'%'};return _0x1d9c9b;}})});}_0x3c710e=_['merge']({},_0x3c710e,_0x2ac118[_0x2654('0x3c')]);var _0x41dce3={'where':_0x3c710e['where']};return db[_0x2654('0x29')][_0x2654('0x1b')](_0x41dce3)[_0x2654('0x20')](function(_0x465534){_0x43d341[_0x2654('0x1b')]=_0x465534;if(_0x2ac118[_0x2654('0x2f')][_0x2654('0x3d')]){_0x3c710e[_0x2654('0x3e')]=[{'all':!![]}];}return db[_0x2654('0x29')]['findAll'](_0x3c710e);})['then'](function(_0x1e71f5){_0x43d341[_0x2654('0x3f')]=_0x1e71f5;return _0x43d341;})[_0x2654('0x20')](respondWithFilteredResult(_0x5e10b0,_0x3c710e))[_0x2654('0x40')](handleError(_0x5e10b0,null));};exports[_0x2654('0x41')]=function(_0x267533,_0x33f0d8){var _0x1e7088={'raw':!![],'where':{'id':_0x267533[_0x2654('0x42')]['id']}},_0x5d23da={};_0x5d23da['model']=_[_0x2654('0x43')](db[_0x2654('0x29')][_0x2654('0x2a')]);_0x5d23da[_0x2654('0x2f')]=_[_0x2654('0x43')](_0x267533[_0x2654('0x2f')]);_0x5d23da['filters']=_['intersection'](_0x5d23da[_0x2654('0x2e')],_0x5d23da['query']);_0x1e7088[_0x2654('0x32')]=_['intersection'](_0x5d23da[_0x2654('0x2e')],qs[_0x2654('0x33')](_0x267533[_0x2654('0x2f')][_0x2654('0x33')]));_0x1e7088[_0x2654('0x32')]=_0x1e7088[_0x2654('0x32')][_0x2654('0x44')]?_0x1e7088[_0x2654('0x32')]:_0x5d23da['model'];if(_0x267533[_0x2654('0x2f')][_0x2654('0x3d')]){_0x1e7088[_0x2654('0x3e')]=[{'all':!![]}];}_0x1e7088=_['merge']({},_0x1e7088,_0x267533[_0x2654('0x3c')]);return db[_0x2654('0x29')][_0x2654('0x45')](_0x1e7088)[_0x2654('0x20')](handleEntityNotFound(_0x33f0d8,null))[_0x2654('0x20')](respondWithResult(_0x33f0d8,null))['catch'](handleError(_0x33f0d8,null));};exports[_0x2654('0x46')]=function(_0x149e12,_0x2f0369){return db[_0x2654('0x29')][_0x2654('0x46')](_0x149e12[_0x2654('0x47')],{})['then'](respondWithResult(_0x2f0369,0xc9))[_0x2654('0x40')](handleError(_0x2f0369,null));};exports[_0x2654('0x1f')]=function(_0x2208cb,_0x4ea6cf){if(_0x2208cb[_0x2654('0x47')]['id']){delete _0x2208cb[_0x2654('0x47')]['id'];}return db['AnalyticTreeReport'][_0x2654('0x45')]({'where':{'id':_0x2208cb[_0x2654('0x42')]['id']}})[_0x2654('0x20')](handleEntityNotFound(_0x4ea6cf,null))[_0x2654('0x20')](saveUpdates(_0x2208cb[_0x2654('0x47')],null))[_0x2654('0x20')](respondWithResult(_0x4ea6cf,null))[_0x2654('0x40')](handleError(_0x4ea6cf,null));};exports[_0x2654('0x21')]=function(_0x3ff57b,_0x531e16){return db['AnalyticTreeReport'][_0x2654('0x45')]({'where':{'id':_0x3ff57b['params']['id']}})[_0x2654('0x20')](handleEntityNotFound(_0x531e16,null))['then'](removeEntity(_0x531e16,null))['catch'](handleError(_0x531e16,null));}; \ No newline at end of file +var _0x0991=['send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','find','create','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name'];(function(_0x54a911,_0x394179){var _0x381526=function(_0x514ed5){while(--_0x514ed5){_0x54a911['push'](_0x54a911['shift']());}};_0x381526(++_0x394179);}(_0x0991,0xb8));var _0x1099=function(_0x4bf100,_0x3d9fcf){_0x4bf100=_0x4bf100-0x0;var _0x2a3aaf=_0x0991[_0x4bf100];return _0x2a3aaf;};'use strict';var emlformat=require(_0x1099('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1099('0x1'));var rp=require(_0x1099('0x2'));var moment=require(_0x1099('0x3'));var BPromise=require(_0x1099('0x4'));var Mustache=require(_0x1099('0x5'));var util=require(_0x1099('0x6'));var path=require('path');var sox=require(_0x1099('0x7'));var csv=require(_0x1099('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1099('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1099('0xa'));var jsforce=require(_0x1099('0xb'));var deskjs=require(_0x1099('0xc'));var toCsv=require(_0x1099('0x8'));var querystring=require(_0x1099('0xd'));var Papa=require('papaparse');var Redis=require(_0x1099('0xe'));var authService=require(_0x1099('0xf'));var qs=require(_0x1099('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1099('0x11'));var logger=require(_0x1099('0x12'))('api');var utils=require(_0x1099('0x13'));var config=require(_0x1099('0x14'));var licenseUtil=require(_0x1099('0x15'));var db=require(_0x1099('0x16'))['db'];function respondWithStatusCode(_0x49cb83,_0x34804a){_0x34804a=_0x34804a||0xcc;return function(_0x32e30c){if(_0x32e30c){return _0x49cb83[_0x1099('0x17')](_0x34804a);}return _0x49cb83[_0x1099('0x18')](_0x34804a)[_0x1099('0x19')]();};}function respondWithResult(_0x205e68,_0x5cca6c){_0x5cca6c=_0x5cca6c||0xc8;return function(_0x3ca79c){if(_0x3ca79c){return _0x205e68[_0x1099('0x18')](_0x5cca6c)[_0x1099('0x1a')](_0x3ca79c);}};}function respondWithFilteredResult(_0x111f92,_0x6dc43a){return function(_0x248977){if(_0x248977){var _0x3cd306=typeof _0x6dc43a[_0x1099('0x1b')]==='undefined'&&typeof _0x6dc43a[_0x1099('0x1c')]===_0x1099('0x1d');var _0x3d4c3a=_0x248977[_0x1099('0x1e')];var _0x41a3d7=_0x3cd306?0x0:_0x6dc43a[_0x1099('0x1b')];var _0x34d524=_0x3cd306?_0x248977[_0x1099('0x1e')]:_0x6dc43a[_0x1099('0x1b')]+_0x6dc43a[_0x1099('0x1c')];var _0x2205fd;if(_0x34d524>=_0x3d4c3a){_0x34d524=_0x3d4c3a;_0x2205fd=0xc8;}else{_0x2205fd=0xce;}_0x111f92[_0x1099('0x18')](_0x2205fd);return _0x111f92[_0x1099('0x1f')](_0x1099('0x20'),_0x41a3d7+'-'+_0x34d524+'/'+_0x3d4c3a)['json'](_0x248977);}return null;};}function patchUpdates(_0x2934e7){return function(_0x287f1f){try{jsonpatch[_0x1099('0x21')](_0x287f1f,_0x2934e7,!![]);}catch(_0x387732){return BPromise[_0x1099('0x22')](_0x387732);}return _0x287f1f[_0x1099('0x23')]();};}function saveUpdates(_0xa4b26c,_0x333676){return function(_0x24e89a){if(_0x24e89a){return _0x24e89a['update'](_0xa4b26c)[_0x1099('0x24')](function(_0x16ae52){return _0x16ae52;});}return null;};}function removeEntity(_0x22ce5f,_0x4619e1){return function(_0x454e78){if(_0x454e78){return _0x454e78[_0x1099('0x25')]()[_0x1099('0x24')](function(){_0x22ce5f[_0x1099('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a6e25,_0x5e73f6){return function(_0x3796ba){if(!_0x3796ba){_0x4a6e25[_0x1099('0x17')](0x194);}return _0x3796ba;};}function handleError(_0x419cb0,_0x1e396e){_0x1e396e=_0x1e396e||0x1f4;return function(_0x1a3eab){logger[_0x1099('0x26')](_0x1a3eab[_0x1099('0x27')]);if(_0x1a3eab[_0x1099('0x28')]){delete _0x1a3eab[_0x1099('0x28')];}_0x419cb0[_0x1099('0x18')](_0x1e396e)[_0x1099('0x29')](_0x1a3eab);};}exports[_0x1099('0x2a')]=function(_0x46b94e,_0x5a45ae){var _0x2c912a={},_0x5dd32c={},_0x218404={'count':0x0,'rows':[]};var _0x583fe6=_[_0x1099('0x2b')](db[_0x1099('0x2c')][_0x1099('0x2d')],function(_0x36f587){return{'name':_0x36f587[_0x1099('0x2e')],'type':_0x36f587[_0x1099('0x2f')][_0x1099('0x30')]};});_0x5dd32c[_0x1099('0x31')]=_[_0x1099('0x2b')](_0x583fe6,'name');_0x5dd32c[_0x1099('0x32')]=_[_0x1099('0x33')](_0x46b94e[_0x1099('0x32')]);_0x5dd32c[_0x1099('0x34')]=_[_0x1099('0x35')](_0x5dd32c[_0x1099('0x31')],_0x5dd32c[_0x1099('0x32')]);_0x2c912a['attributes']=_[_0x1099('0x35')](_0x5dd32c[_0x1099('0x31')],qs[_0x1099('0x36')](_0x46b94e[_0x1099('0x32')][_0x1099('0x36')]));_0x2c912a[_0x1099('0x37')]=_0x2c912a[_0x1099('0x37')][_0x1099('0x38')]?_0x2c912a['attributes']:_0x5dd32c[_0x1099('0x31')];if(!_0x46b94e[_0x1099('0x32')][_0x1099('0x39')](_0x1099('0x3a'))){_0x2c912a['limit']=qs[_0x1099('0x1c')](_0x46b94e['query']['limit']);_0x2c912a[_0x1099('0x1b')]=qs[_0x1099('0x1b')](_0x46b94e[_0x1099('0x32')][_0x1099('0x1b')]);}_0x2c912a[_0x1099('0x3b')]=qs[_0x1099('0x3c')](_0x46b94e[_0x1099('0x32')][_0x1099('0x3c')]);_0x2c912a[_0x1099('0x3d')]=qs[_0x1099('0x34')](_['pick'](_0x46b94e['query'],_0x5dd32c[_0x1099('0x34')]),_0x583fe6);if(_0x46b94e[_0x1099('0x32')]['filter']){_0x2c912a['where']=_['merge'](_0x2c912a['where'],{'$or':_[_0x1099('0x2b')](_0x583fe6,function(_0x24ceff){if(_0x24ceff[_0x1099('0x2f')]!==_0x1099('0x3e')){var _0x22e76c={};_0x22e76c[_0x24ceff[_0x1099('0x28')]]={'$like':'%'+_0x46b94e[_0x1099('0x32')][_0x1099('0x3f')]+'%'};return _0x22e76c;}})});}_0x2c912a=_[_0x1099('0x40')]({},_0x2c912a,_0x46b94e[_0x1099('0x41')]);var _0x17b67d={'where':_0x2c912a[_0x1099('0x3d')]};return db[_0x1099('0x2c')]['count'](_0x17b67d)[_0x1099('0x24')](function(_0x383428){_0x218404[_0x1099('0x1e')]=_0x383428;if(_0x46b94e[_0x1099('0x32')]['includeAll']){_0x2c912a[_0x1099('0x42')]=[{'all':!![]}];}return db[_0x1099('0x2c')][_0x1099('0x43')](_0x2c912a);})[_0x1099('0x24')](function(_0x39d8e1){_0x218404[_0x1099('0x44')]=_0x39d8e1;return _0x218404;})['then'](respondWithFilteredResult(_0x5a45ae,_0x2c912a))[_0x1099('0x45')](handleError(_0x5a45ae,null));};exports[_0x1099('0x46')]=function(_0x3f302f,_0x952a49){var _0x11b89f={'raw':!![],'where':{'id':_0x3f302f['params']['id']}},_0x5e03af={};_0x5e03af[_0x1099('0x31')]=_['keys'](db[_0x1099('0x2c')][_0x1099('0x2d')]);_0x5e03af[_0x1099('0x32')]=_[_0x1099('0x33')](_0x3f302f[_0x1099('0x32')]);_0x5e03af[_0x1099('0x34')]=_['intersection'](_0x5e03af[_0x1099('0x31')],_0x5e03af[_0x1099('0x32')]);_0x11b89f[_0x1099('0x37')]=_['intersection'](_0x5e03af['model'],qs[_0x1099('0x36')](_0x3f302f['query'][_0x1099('0x36')]));_0x11b89f[_0x1099('0x37')]=_0x11b89f[_0x1099('0x37')][_0x1099('0x38')]?_0x11b89f[_0x1099('0x37')]:_0x5e03af['model'];if(_0x3f302f['query']['includeAll']){_0x11b89f['include']=[{'all':!![]}];}_0x11b89f=_['merge']({},_0x11b89f,_0x3f302f[_0x1099('0x41')]);return db[_0x1099('0x2c')][_0x1099('0x47')](_0x11b89f)[_0x1099('0x24')](handleEntityNotFound(_0x952a49,null))[_0x1099('0x24')](respondWithResult(_0x952a49,null))[_0x1099('0x45')](handleError(_0x952a49,null));};exports[_0x1099('0x48')]=function(_0x5386d3,_0x554236){return db[_0x1099('0x2c')][_0x1099('0x48')](_0x5386d3[_0x1099('0x49')],{})[_0x1099('0x24')](respondWithResult(_0x554236,0xc9))[_0x1099('0x45')](handleError(_0x554236,null));};exports['update']=function(_0x351a33,_0x5d6bf0){if(_0x351a33[_0x1099('0x49')]['id']){delete _0x351a33[_0x1099('0x49')]['id'];}return db[_0x1099('0x2c')][_0x1099('0x47')]({'where':{'id':_0x351a33[_0x1099('0x4a')]['id']}})[_0x1099('0x24')](handleEntityNotFound(_0x5d6bf0,null))[_0x1099('0x24')](saveUpdates(_0x351a33[_0x1099('0x49')],null))[_0x1099('0x24')](respondWithResult(_0x5d6bf0,null))[_0x1099('0x45')](handleError(_0x5d6bf0,null));};exports[_0x1099('0x25')]=function(_0x4f516f,_0x2e65f5){return db['AnalyticTreeReport']['find']({'where':{'id':_0x4f516f['params']['id']}})[_0x1099('0x24')](handleEntityNotFound(_0x2e65f5,null))[_0x1099('0x24')](removeEntity(_0x2e65f5,null))['catch'](handleError(_0x2e65f5,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 8454e6a..2188a49 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 _0xfe41=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','util'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xfe41,0x128));var _0x1fe4=function(_0xd77cf5,_0x4dc1cb){_0xd77cf5=_0xd77cf5-0x0;var _0x470948=_0xfe41[_0xd77cf5];return _0x470948;};'use strict';var _=require('lodash');var util=require(_0x1fe4('0x0'));var logger=require(_0x1fe4('0x1'))(_0x1fe4('0x2'));var moment=require(_0x1fe4('0x3'));var BPromise=require(_0x1fe4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1fe4('0x5'));var config=require(_0x1fe4('0x6'));var attributes=require(_0x1fe4('0x7'));module[_0x1fe4('0x8')]=function(_0x4095da,_0x21d372){return _0x4095da[_0x1fe4('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x1fe4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c18=['AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x2c18,0x182));var _0x82c1=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x2c18[_0x52ea08];return _0x28d546;};'use strict';var _=require(_0x82c1('0x0'));var util=require('util');var logger=require(_0x82c1('0x1'))(_0x82c1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82c1('0x3'));var fs=require('fs');var path=require(_0x82c1('0x4'));var rimraf=require(_0x82c1('0x5'));var config=require(_0x82c1('0x6'));var attributes=require(_0x82c1('0x7'));module[_0x82c1('0x8')]=function(_0x444dcb,_0x49ec3d){return _0x444dcb[_0x82c1('0x9')](_0x82c1('0xa'),attributes,{'tableName':_0x82c1('0xb'),'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 2d096be..c5618c2 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5f2f2e,_0x40b244){var _0x47ffb1=function(_0x4bc6ba){while(--_0x4bc6ba){_0x5f2f2e['push'](_0x5f2f2e['shift']());}};_0x47ffb1(++_0x40b244);}(_0x1261,0x144));var _0x1126=function(_0xf852,_0x4ddd76){_0xf852=_0xf852-0x0;var _0x5b2550=_0x1261[_0xf852];return _0x5b2550;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _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(_0x2d46f0,_0x24696c){var _0x5afa28=function(_0x20f482){while(--_0x20f482){_0x2d46f0['push'](_0x2d46f0['shift']());}};_0x5afa28(++_0x24696c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'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 7ed1a72..b54f8db 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 _0x111b=['delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0xaf1761,_0x573fee){var _0x203d32=function(_0x3bbecc){while(--_0x3bbecc){_0xaf1761['push'](_0xaf1761['shift']());}};_0x203d32(++_0x573fee);}(_0x111b,0x1bc));var _0xb111=function(_0x200dcf,_0x280d3b){_0x200dcf=_0x200dcf-0x0;var _0x4523cd=_0x111b[_0x200dcf];return _0x4523cd;};'use strict';var multer=require('multer');var util=require(_0xb111('0x0'));var path=require('path');var timeout=require(_0xb111('0x1'));var express=require('express');var router=express[_0xb111('0x2')]();var fs_extra=require(_0xb111('0x3'));var auth=require(_0xb111('0x4'));var interaction=require(_0xb111('0x5'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xb111('0x6')]('/',auth[_0xb111('0x7')](),controller[_0xb111('0x8')]);router['get']('/:id',auth[_0xb111('0x7')](),controller[_0xb111('0x9')]);router[_0xb111('0xa')]('/',auth[_0xb111('0x7')](),controller[_0xb111('0xb')]);router[_0xb111('0xc')](_0xb111('0xd'),auth[_0xb111('0x7')](),controller[_0xb111('0xe')]);router[_0xb111('0xf')](_0xb111('0xd'),auth[_0xb111('0x7')](),controller[_0xb111('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3d1f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','util','path'];(function(_0x5afd0c,_0xc78bfe){var _0x13f95f=function(_0x3b91bf){while(--_0x3b91bf){_0x5afd0c['push'](_0x5afd0c['shift']());}};_0x13f95f(++_0xc78bfe);}(_0x3d1f,0x12f));var _0xf3d1=function(_0x410484,_0x57244a){_0x410484=_0x410484-0x0;var _0x3c8009=_0x3d1f[_0x410484];return _0x3c8009;};'use strict';var multer=require(_0xf3d1('0x0'));var util=require(_0xf3d1('0x1'));var path=require(_0xf3d1('0x2'));var timeout=require(_0xf3d1('0x3'));var express=require(_0xf3d1('0x4'));var router=express[_0xf3d1('0x5')]();var fs_extra=require(_0xf3d1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf3d1('0x7'));var config=require(_0xf3d1('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xf3d1('0x9')](),controller[_0xf3d1('0xa')]);router['get'](_0xf3d1('0xb'),auth[_0xf3d1('0x9')](),controller['show']);router['post']('/',auth[_0xf3d1('0x9')](),controller[_0xf3d1('0xc')]);router['put'](_0xf3d1('0xb'),auth['isAuthenticated'](),controller[_0xf3d1('0xd')]);router[_0xf3d1('0xe')]('/:id',auth[_0xf3d1('0x9')](),controller[_0xf3d1('0xf')]);module[_0xf3d1('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 6a3a30f..f1f77c9 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 _0xaa19=['STRING','sequelize','exports'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xaa19,0x79));var _0x9aa1=function(_0x2e7399,_0x189e00){_0x2e7399=_0x2e7399-0x0;var _0x580440=_0xaa19[_0x2e7399];return _0x580440;};'use strict';var Sequelize=require(_0x9aa1('0x0'));module[_0x9aa1('0x1')]={'name':{'type':Sequelize[_0x9aa1('0x2')]},'basename':{'type':Sequelize[_0x9aa1('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0531=['sequelize','exports','STRING'];(function(_0x513f73,_0x58b64b){var _0x5a375f=function(_0x41cd0b){while(--_0x41cd0b){_0x513f73['push'](_0x513f73['shift']());}};_0x5a375f(++_0x58b64b);}(_0x0531,0xde));var _0x1053=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x0531[_0x2af29a];return _0x5ef02f;};'use strict';var Sequelize=require(_0x1053('0x0'));module[_0x1053('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1053('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 212a365..8e38e85 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 _0xad60=['intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','get','omit','createdAt','updatedAt','body','create','originalname','filename','file','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','offset','undefined','limit','count','status','set','json','save','update','then','destroy','end','error','stack','name','send','index','Attachment','rawAttributes','fieldName','model','map','query','keys','filters'];(function(_0x4f4bfd,_0x3dd420){var _0x19135b=function(_0x36f96e){while(--_0x36f96e){_0x4f4bfd['push'](_0x4f4bfd['shift']());}};_0x19135b(++_0x3dd420);}(_0xad60,0x1dc));var _0x0ad6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xad60[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x0ad6('0x0'));var rimraf=require(_0x0ad6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0ad6('0x2'));var moment=require(_0x0ad6('0x3'));var BPromise=require(_0x0ad6('0x4'));var Mustache=require(_0x0ad6('0x5'));var util=require(_0x0ad6('0x6'));var path=require(_0x0ad6('0x7'));var sox=require(_0x0ad6('0x8'));var csv=require(_0x0ad6('0x9'));var ejs=require(_0x0ad6('0xa'));var fs=require('fs');var fs_extra=require(_0x0ad6('0xb'));var _=require(_0x0ad6('0xc'));var squel=require(_0x0ad6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ad6('0xe'));var toCsv=require(_0x0ad6('0x9'));var querystring=require(_0x0ad6('0xf'));var Papa=require('papaparse');var Redis=require(_0x0ad6('0x10'));var authService=require(_0x0ad6('0x11'));var qs=require(_0x0ad6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ad6('0x13'));var logger=require(_0x0ad6('0x14'))(_0x0ad6('0x15'));var utils=require(_0x0ad6('0x16'));var config=require(_0x0ad6('0x17'));var licenseUtil=require(_0x0ad6('0x18'));var db=require(_0x0ad6('0x19'))['db'];function respondWithStatusCode(_0x4ed7ce,_0x2dcc3e){_0x2dcc3e=_0x2dcc3e||0xcc;return function(_0x3db553){if(_0x3db553){return _0x4ed7ce[_0x0ad6('0x1a')](_0x2dcc3e);}return _0x4ed7ce['status'](_0x2dcc3e)['end']();};}function respondWithResult(_0x228a19,_0x45b9ae){_0x45b9ae=_0x45b9ae||0xc8;return function(_0x4fb5b2){if(_0x4fb5b2){return _0x228a19['status'](_0x45b9ae)['json'](_0x4fb5b2);}};}function respondWithFilteredResult(_0x250b1f,_0x11695a){return function(_0x4dc501){if(_0x4dc501){var _0x2dec53=typeof _0x11695a[_0x0ad6('0x1b')]===_0x0ad6('0x1c')&&typeof _0x11695a[_0x0ad6('0x1d')]===_0x0ad6('0x1c');var _0x3f9da3=_0x4dc501[_0x0ad6('0x1e')];var _0x20b007=_0x2dec53?0x0:_0x11695a[_0x0ad6('0x1b')];var _0x2ac1a9=_0x2dec53?_0x4dc501[_0x0ad6('0x1e')]:_0x11695a[_0x0ad6('0x1b')]+_0x11695a['limit'];var _0x147ce3;if(_0x2ac1a9>=_0x3f9da3){_0x2ac1a9=_0x3f9da3;_0x147ce3=0xc8;}else{_0x147ce3=0xce;}_0x250b1f[_0x0ad6('0x1f')](_0x147ce3);return _0x250b1f[_0x0ad6('0x20')]('Content-Range',_0x20b007+'-'+_0x2ac1a9+'/'+_0x3f9da3)[_0x0ad6('0x21')](_0x4dc501);}return null;};}function patchUpdates(_0x31a65f){return function(_0x3fdc12){try{jsonpatch['apply'](_0x3fdc12,_0x31a65f,!![]);}catch(_0x5104cb){return BPromise['reject'](_0x5104cb);}return _0x3fdc12[_0x0ad6('0x22')]();};}function saveUpdates(_0x3001fe,_0x427a10){return function(_0x303244){if(_0x303244){return _0x303244[_0x0ad6('0x23')](_0x3001fe)[_0x0ad6('0x24')](function(_0x489f35){return _0x489f35;});}return null;};}function removeEntity(_0x60affe,_0x25ca6d){return function(_0x58d1a3){if(_0x58d1a3){return _0x58d1a3[_0x0ad6('0x25')]()[_0x0ad6('0x24')](function(){_0x60affe[_0x0ad6('0x1f')](0xcc)[_0x0ad6('0x26')]();});}};}function handleEntityNotFound(_0x5d6307,_0x39279c){return function(_0x20864e){if(!_0x20864e){_0x5d6307[_0x0ad6('0x1a')](0x194);}return _0x20864e;};}function handleError(_0x282299,_0x4e3fd7){_0x4e3fd7=_0x4e3fd7||0x1f4;return function(_0x213d71){logger[_0x0ad6('0x27')](_0x213d71[_0x0ad6('0x28')]);if(_0x213d71['name']){delete _0x213d71[_0x0ad6('0x29')];}_0x282299[_0x0ad6('0x1f')](_0x4e3fd7)[_0x0ad6('0x2a')](_0x213d71);};}exports[_0x0ad6('0x2b')]=function(_0x5b36b8,_0x19f651){var _0x343e26={},_0x5db88d={},_0x57a5d9={'count':0x0,'rows':[]};var _0x3f96d2=_['map'](db[_0x0ad6('0x2c')][_0x0ad6('0x2d')],function(_0x11a9f1){return{'name':_0x11a9f1[_0x0ad6('0x2e')],'type':_0x11a9f1['type']['key']};});_0x5db88d[_0x0ad6('0x2f')]=_[_0x0ad6('0x30')](_0x3f96d2,'name');_0x5db88d[_0x0ad6('0x31')]=_[_0x0ad6('0x32')](_0x5b36b8[_0x0ad6('0x31')]);_0x5db88d[_0x0ad6('0x33')]=_[_0x0ad6('0x34')](_0x5db88d[_0x0ad6('0x2f')],_0x5db88d[_0x0ad6('0x31')]);_0x343e26[_0x0ad6('0x35')]=_[_0x0ad6('0x34')](_0x5db88d[_0x0ad6('0x2f')],qs[_0x0ad6('0x36')](_0x5b36b8[_0x0ad6('0x31')][_0x0ad6('0x36')]));_0x343e26[_0x0ad6('0x35')]=_0x343e26[_0x0ad6('0x35')]['length']?_0x343e26[_0x0ad6('0x35')]:_0x5db88d[_0x0ad6('0x2f')];if(!_0x5b36b8[_0x0ad6('0x31')][_0x0ad6('0x37')]('nolimit')){_0x343e26[_0x0ad6('0x1d')]=qs[_0x0ad6('0x1d')](_0x5b36b8[_0x0ad6('0x31')][_0x0ad6('0x1d')]);_0x343e26[_0x0ad6('0x1b')]=qs[_0x0ad6('0x1b')](_0x5b36b8[_0x0ad6('0x31')][_0x0ad6('0x1b')]);}_0x343e26[_0x0ad6('0x38')]=qs[_0x0ad6('0x39')](_0x5b36b8[_0x0ad6('0x31')]['sort']);_0x343e26[_0x0ad6('0x3a')]=qs[_0x0ad6('0x33')](_['pick'](_0x5b36b8[_0x0ad6('0x31')],_0x5db88d[_0x0ad6('0x33')]),_0x3f96d2);if(_0x5b36b8[_0x0ad6('0x31')][_0x0ad6('0x3b')]){_0x343e26[_0x0ad6('0x3a')]=_[_0x0ad6('0x3c')](_0x343e26['where'],{'$or':_[_0x0ad6('0x30')](_0x3f96d2,function(_0x2cbebc){if(_0x2cbebc[_0x0ad6('0x3d')]!==_0x0ad6('0x3e')){var _0x2830bc={};_0x2830bc[_0x2cbebc[_0x0ad6('0x29')]]={'$like':'%'+_0x5b36b8['query'][_0x0ad6('0x3b')]+'%'};return _0x2830bc;}})});}_0x343e26=_[_0x0ad6('0x3c')]({},_0x343e26,_0x5b36b8[_0x0ad6('0x3f')]);var _0x1e454e={'where':_0x343e26['where']};return db[_0x0ad6('0x2c')][_0x0ad6('0x1e')](_0x1e454e)['then'](function(_0x8811bd){_0x57a5d9[_0x0ad6('0x1e')]=_0x8811bd;if(_0x5b36b8[_0x0ad6('0x31')][_0x0ad6('0x40')]){_0x343e26[_0x0ad6('0x41')]=[{'all':!![]}];}return db[_0x0ad6('0x2c')]['findAll'](_0x343e26);})[_0x0ad6('0x24')](function(_0x154c86){_0x57a5d9[_0x0ad6('0x42')]=_0x154c86;return _0x57a5d9;})[_0x0ad6('0x24')](respondWithFilteredResult(_0x19f651,_0x343e26))[_0x0ad6('0x43')](handleError(_0x19f651,null));};exports['show']=function(_0x5ac51a,_0x3e0418){var _0x123171={'raw':!![],'where':{'id':_0x5ac51a[_0x0ad6('0x44')]['id']}},_0x5048e0={};_0x5048e0[_0x0ad6('0x2f')]=_[_0x0ad6('0x32')](db[_0x0ad6('0x2c')][_0x0ad6('0x2d')]);_0x5048e0[_0x0ad6('0x31')]=_[_0x0ad6('0x32')](_0x5ac51a[_0x0ad6('0x31')]);_0x5048e0[_0x0ad6('0x33')]=_['intersection'](_0x5048e0[_0x0ad6('0x2f')],_0x5048e0[_0x0ad6('0x31')]);_0x123171[_0x0ad6('0x35')]=_[_0x0ad6('0x34')](_0x5048e0[_0x0ad6('0x2f')],qs[_0x0ad6('0x36')](_0x5ac51a[_0x0ad6('0x31')][_0x0ad6('0x36')]));_0x123171[_0x0ad6('0x35')]=_0x123171['attributes'][_0x0ad6('0x45')]?_0x123171[_0x0ad6('0x35')]:_0x5048e0[_0x0ad6('0x2f')];if(_0x5ac51a[_0x0ad6('0x31')]['includeAll']){_0x123171[_0x0ad6('0x41')]=[{'all':!![]}];}_0x123171=_[_0x0ad6('0x3c')]({},_0x123171,_0x5ac51a['options']);return db[_0x0ad6('0x2c')][_0x0ad6('0x46')](_0x123171)[_0x0ad6('0x24')](handleEntityNotFound(_0x3e0418,null))['then'](respondWithResult(_0x3e0418,null))[_0x0ad6('0x43')](handleError(_0x3e0418,null));};exports['clone']=function(_0x43de6b,_0x51e765){var _0x2dcb41={'where':{'id':_0x43de6b['params']['id']}},_0x56e85a={};_0x56e85a[_0x0ad6('0x2f')]=_['keys'](db[_0x0ad6('0x2c')][_0x0ad6('0x2d')]);_0x2dcb41[_0x0ad6('0x35')]=_[_0x0ad6('0x34')](_0x56e85a['model'],qs[_0x0ad6('0x36')](_0x43de6b['query'][_0x0ad6('0x36')]));_0x2dcb41['attributes']=_0x2dcb41[_0x0ad6('0x35')][_0x0ad6('0x45')]?_0x2dcb41[_0x0ad6('0x35')]:_0x56e85a[_0x0ad6('0x2f')];if(_0x43de6b[_0x0ad6('0x31')]['includeAll']){_0x2dcb41['include']=[{'all':!![]}];}_0x2dcb41=_[_0x0ad6('0x3c')]({},_0x2dcb41,_0x43de6b[_0x0ad6('0x3f')]);return db[_0x0ad6('0x2c')][_0x0ad6('0x46')](_0x2dcb41)['then'](handleEntityNotFound(_0x51e765,null))[_0x0ad6('0x24')](function(_0x186b89){if(_0x186b89){var _0xe4cf00=_0x186b89[_0x0ad6('0x47')]({'plain':!![]});_0xe4cf00=qs[_0x0ad6('0x48')](_0xe4cf00,['id',_0x0ad6('0x49'),_0x0ad6('0x4a')]);_0x43de6b[_0x0ad6('0x4b')]=_[_0x0ad6('0x48')](_0x43de6b['body'],['id',_0x0ad6('0x49'),_0x0ad6('0x4a')]);return db[_0x0ad6('0x2c')][_0x0ad6('0x4c')](_[_0x0ad6('0x3c')](_0xe4cf00,_0x43de6b['body']),{'include':_0x43de6b[_0x0ad6('0x31')][_0x0ad6('0x40')]?[{'all':!![]}]:undefined});}})[_0x0ad6('0x24')](respondWithResult(_0x51e765,0xc9))['catch'](handleError(_0x51e765,null));};exports[_0x0ad6('0x23')]=function(_0x83927,_0x5a3c89){if(_0x83927[_0x0ad6('0x4b')]['id']){delete _0x83927[_0x0ad6('0x4b')]['id'];}return db['Attachment'][_0x0ad6('0x46')]({'where':{'id':_0x83927[_0x0ad6('0x44')]['id']}})[_0x0ad6('0x24')](handleEntityNotFound(_0x5a3c89,null))[_0x0ad6('0x24')](saveUpdates(_0x83927['body'],null))[_0x0ad6('0x24')](respondWithResult(_0x5a3c89,null))[_0x0ad6('0x43')](handleError(_0x5a3c89,null));};exports[_0x0ad6('0x25')]=function(_0x90c692,_0xb2eabb){return db[_0x0ad6('0x2c')][_0x0ad6('0x46')]({'where':{'id':_0x90c692[_0x0ad6('0x44')]['id']}})[_0x0ad6('0x24')](handleEntityNotFound(_0xb2eabb,null))[_0x0ad6('0x24')](removeEntity(_0xb2eabb,null))[_0x0ad6('0x43')](handleError(_0xb2eabb,null));};exports['create']=function(_0xd15e8e,_0x28e445,_0x2ee2d7){_0xd15e8e[_0x0ad6('0x4b')][_0x0ad6('0x29')]=_0xd15e8e['file'][_0x0ad6('0x4d')];_0xd15e8e[_0x0ad6('0x4b')]['basename']=_0xd15e8e['file'][_0x0ad6('0x4e')];_0xd15e8e[_0x0ad6('0x4b')][_0x0ad6('0x3d')]=_0xd15e8e[_0x0ad6('0x4f')][_0x0ad6('0x50')];return db['Attachment']['create'](_0xd15e8e[_0x0ad6('0x4b')])['then'](respondWithResult(_0x28e445,0xc9))[_0x0ad6('0x43')](handleError(_0x28e445,null));};exports[_0x0ad6('0x51')]=function(_0x5850ca,_0x2398ad,_0x23a342){return db[_0x0ad6('0x2c')][_0x0ad6('0x52')]({'where':{'id':_0x5850ca[_0x0ad6('0x44')]['id']},'raw':!![]})[_0x0ad6('0x24')](handleEntityNotFound(_0x2398ad,null))[_0x0ad6('0x24')](function(_0x47c2b6){if(_0x47c2b6){var _0x4f9b65=_0x47c2b6['ChatOfflineMessageId']!==null;var _0x133b9c=path[_0x0ad6('0x53')](config[_0x0ad6('0x54')],_0x0ad6('0x55'));if(_0x4f9b65){_0x133b9c=path['join'](_0x133b9c,_0x0ad6('0x56'));}var _0x106e03=path[_0x0ad6('0x53')](_0x133b9c,_0x47c2b6[_0x0ad6('0x57')]);return _0x2398ad[_0x0ad6('0x51')](_0x106e03);}})[_0x0ad6('0x43')](handleError(_0x2398ad,null));}; \ No newline at end of file +var _0x2a66=['createdAt','body','updatedAt','create','update','file','originalname','basename','filename','mimetype','findOne','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','include','Attachment','findAll','rows','catch','show','params','rawAttributes','includeAll','find','clone','get','omit'];(function(_0x35325f,_0x5d615e){var _0x247af9=function(_0x6102e4){while(--_0x6102e4){_0x35325f['push'](_0x35325f['shift']());}};_0x247af9(++_0x5d615e);}(_0x2a66,0x6b));var _0x62a6=function(_0x2f379a,_0x53382d){_0x2f379a=_0x2f379a-0x0;var _0x305249=_0x2a66[_0x2f379a];return _0x305249;};'use strict';var emlformat=require(_0x62a6('0x0'));var rimraf=require(_0x62a6('0x1'));var zipdir=require(_0x62a6('0x2'));var jsonpatch=require(_0x62a6('0x3'));var rp=require(_0x62a6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62a6('0x5'));var util=require(_0x62a6('0x6'));var path=require(_0x62a6('0x7'));var sox=require(_0x62a6('0x8'));var csv=require(_0x62a6('0x9'));var ejs=require(_0x62a6('0xa'));var fs=require('fs');var fs_extra=require(_0x62a6('0xb'));var _=require(_0x62a6('0xc'));var squel=require(_0x62a6('0xd'));var crypto=require('crypto');var jsforce=require(_0x62a6('0xe'));var deskjs=require(_0x62a6('0xf'));var toCsv=require(_0x62a6('0x9'));var querystring=require(_0x62a6('0x10'));var Papa=require('papaparse');var Redis=require(_0x62a6('0x11'));var authService=require(_0x62a6('0x12'));var qs=require(_0x62a6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x62a6('0x14'))('api');var utils=require(_0x62a6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x62a6('0x16'));var db=require(_0x62a6('0x17'))['db'];function respondWithStatusCode(_0x1dc0dd,_0x451d9f){_0x451d9f=_0x451d9f||0xcc;return function(_0x1daa11){if(_0x1daa11){return _0x1dc0dd[_0x62a6('0x18')](_0x451d9f);}return _0x1dc0dd['status'](_0x451d9f)[_0x62a6('0x19')]();};}function respondWithResult(_0x52da7e,_0xfcd68){_0xfcd68=_0xfcd68||0xc8;return function(_0x1dbb3a){if(_0x1dbb3a){return _0x52da7e[_0x62a6('0x1a')](_0xfcd68)[_0x62a6('0x1b')](_0x1dbb3a);}};}function respondWithFilteredResult(_0x22a048,_0xb7f9ec){return function(_0x506916){if(_0x506916){var _0x5d6d1b=typeof _0xb7f9ec[_0x62a6('0x1c')]===_0x62a6('0x1d')&&typeof _0xb7f9ec[_0x62a6('0x1e')]===_0x62a6('0x1d');var _0x84c071=_0x506916[_0x62a6('0x1f')];var _0x1713d8=_0x5d6d1b?0x0:_0xb7f9ec[_0x62a6('0x1c')];var _0x56eb3f=_0x5d6d1b?_0x506916[_0x62a6('0x1f')]:_0xb7f9ec[_0x62a6('0x1c')]+_0xb7f9ec[_0x62a6('0x1e')];var _0x20ca36;if(_0x56eb3f>=_0x84c071){_0x56eb3f=_0x84c071;_0x20ca36=0xc8;}else{_0x20ca36=0xce;}_0x22a048['status'](_0x20ca36);return _0x22a048['set'](_0x62a6('0x20'),_0x1713d8+'-'+_0x56eb3f+'/'+_0x84c071)['json'](_0x506916);}return null;};}function patchUpdates(_0x56c964){return function(_0x1bd539){try{jsonpatch[_0x62a6('0x21')](_0x1bd539,_0x56c964,!![]);}catch(_0x2273e4){return BPromise[_0x62a6('0x22')](_0x2273e4);}return _0x1bd539[_0x62a6('0x23')]();};}function saveUpdates(_0x338b2f,_0x548b32){return function(_0x1619ef){if(_0x1619ef){return _0x1619ef['update'](_0x338b2f)[_0x62a6('0x24')](function(_0x479883){return _0x479883;});}return null;};}function removeEntity(_0x5c976c,_0x1c88a9){return function(_0xefcb34){if(_0xefcb34){return _0xefcb34[_0x62a6('0x25')]()[_0x62a6('0x24')](function(){_0x5c976c[_0x62a6('0x1a')](0xcc)[_0x62a6('0x19')]();});}};}function handleEntityNotFound(_0x472bdd,_0x61fd4c){return function(_0x1d5302){if(!_0x1d5302){_0x472bdd[_0x62a6('0x18')](0x194);}return _0x1d5302;};}function handleError(_0x5b643b,_0x5de642){_0x5de642=_0x5de642||0x1f4;return function(_0x550730){logger[_0x62a6('0x26')](_0x550730[_0x62a6('0x27')]);if(_0x550730[_0x62a6('0x28')]){delete _0x550730[_0x62a6('0x28')];}_0x5b643b[_0x62a6('0x1a')](_0x5de642)['send'](_0x550730);};}exports[_0x62a6('0x29')]=function(_0x2ffa13,_0x29db48){var _0x109a25={},_0x5e7ded={},_0x4a5a55={'count':0x0,'rows':[]};var _0xf2e959=_['map'](db['Attachment']['rawAttributes'],function(_0x2fea59){return{'name':_0x2fea59[_0x62a6('0x2a')],'type':_0x2fea59[_0x62a6('0x2b')][_0x62a6('0x2c')]};});_0x5e7ded[_0x62a6('0x2d')]=_[_0x62a6('0x2e')](_0xf2e959,_0x62a6('0x28'));_0x5e7ded[_0x62a6('0x2f')]=_[_0x62a6('0x30')](_0x2ffa13[_0x62a6('0x2f')]);_0x5e7ded['filters']=_[_0x62a6('0x31')](_0x5e7ded[_0x62a6('0x2d')],_0x5e7ded[_0x62a6('0x2f')]);_0x109a25[_0x62a6('0x32')]=_[_0x62a6('0x31')](_0x5e7ded[_0x62a6('0x2d')],qs[_0x62a6('0x33')](_0x2ffa13['query']['fields']));_0x109a25[_0x62a6('0x32')]=_0x109a25[_0x62a6('0x32')][_0x62a6('0x34')]?_0x109a25[_0x62a6('0x32')]:_0x5e7ded[_0x62a6('0x2d')];if(!_0x2ffa13['query'][_0x62a6('0x35')]('nolimit')){_0x109a25[_0x62a6('0x1e')]=qs[_0x62a6('0x1e')](_0x2ffa13[_0x62a6('0x2f')][_0x62a6('0x1e')]);_0x109a25[_0x62a6('0x1c')]=qs[_0x62a6('0x1c')](_0x2ffa13['query'][_0x62a6('0x1c')]);}_0x109a25[_0x62a6('0x36')]=qs['sort'](_0x2ffa13[_0x62a6('0x2f')][_0x62a6('0x37')]);_0x109a25['where']=qs[_0x62a6('0x38')](_[_0x62a6('0x39')](_0x2ffa13[_0x62a6('0x2f')],_0x5e7ded[_0x62a6('0x38')]),_0xf2e959);if(_0x2ffa13[_0x62a6('0x2f')][_0x62a6('0x3a')]){_0x109a25[_0x62a6('0x3b')]=_[_0x62a6('0x3c')](_0x109a25['where'],{'$or':_[_0x62a6('0x2e')](_0xf2e959,function(_0x1d619d){if(_0x1d619d['type']!=='VIRTUAL'){var _0x31ee4f={};_0x31ee4f[_0x1d619d[_0x62a6('0x28')]]={'$like':'%'+_0x2ffa13[_0x62a6('0x2f')][_0x62a6('0x3a')]+'%'};return _0x31ee4f;}})});}_0x109a25=_[_0x62a6('0x3c')]({},_0x109a25,_0x2ffa13[_0x62a6('0x3d')]);var _0x21c10e={'where':_0x109a25[_0x62a6('0x3b')]};return db['Attachment'][_0x62a6('0x1f')](_0x21c10e)[_0x62a6('0x24')](function(_0x4cc49e){_0x4a5a55[_0x62a6('0x1f')]=_0x4cc49e;if(_0x2ffa13[_0x62a6('0x2f')]['includeAll']){_0x109a25[_0x62a6('0x3e')]=[{'all':!![]}];}return db[_0x62a6('0x3f')][_0x62a6('0x40')](_0x109a25);})[_0x62a6('0x24')](function(_0x3c001d){_0x4a5a55[_0x62a6('0x41')]=_0x3c001d;return _0x4a5a55;})['then'](respondWithFilteredResult(_0x29db48,_0x109a25))[_0x62a6('0x42')](handleError(_0x29db48,null));};exports[_0x62a6('0x43')]=function(_0x5b0092,_0x48c80d){var _0x5ec600={'raw':!![],'where':{'id':_0x5b0092[_0x62a6('0x44')]['id']}},_0x166b81={};_0x166b81['model']=_[_0x62a6('0x30')](db[_0x62a6('0x3f')][_0x62a6('0x45')]);_0x166b81['query']=_['keys'](_0x5b0092[_0x62a6('0x2f')]);_0x166b81['filters']=_[_0x62a6('0x31')](_0x166b81[_0x62a6('0x2d')],_0x166b81[_0x62a6('0x2f')]);_0x5ec600['attributes']=_[_0x62a6('0x31')](_0x166b81[_0x62a6('0x2d')],qs[_0x62a6('0x33')](_0x5b0092['query'][_0x62a6('0x33')]));_0x5ec600[_0x62a6('0x32')]=_0x5ec600['attributes'][_0x62a6('0x34')]?_0x5ec600['attributes']:_0x166b81[_0x62a6('0x2d')];if(_0x5b0092[_0x62a6('0x2f')][_0x62a6('0x46')]){_0x5ec600[_0x62a6('0x3e')]=[{'all':!![]}];}_0x5ec600=_[_0x62a6('0x3c')]({},_0x5ec600,_0x5b0092[_0x62a6('0x3d')]);return db[_0x62a6('0x3f')][_0x62a6('0x47')](_0x5ec600)[_0x62a6('0x24')](handleEntityNotFound(_0x48c80d,null))[_0x62a6('0x24')](respondWithResult(_0x48c80d,null))[_0x62a6('0x42')](handleError(_0x48c80d,null));};exports[_0x62a6('0x48')]=function(_0x10cc00,_0x296c2e){var _0x47d516={'where':{'id':_0x10cc00[_0x62a6('0x44')]['id']}},_0x4912a5={};_0x4912a5[_0x62a6('0x2d')]=_[_0x62a6('0x30')](db[_0x62a6('0x3f')][_0x62a6('0x45')]);_0x47d516['attributes']=_['intersection'](_0x4912a5['model'],qs[_0x62a6('0x33')](_0x10cc00[_0x62a6('0x2f')][_0x62a6('0x33')]));_0x47d516[_0x62a6('0x32')]=_0x47d516[_0x62a6('0x32')][_0x62a6('0x34')]?_0x47d516[_0x62a6('0x32')]:_0x4912a5['model'];if(_0x10cc00[_0x62a6('0x2f')][_0x62a6('0x46')]){_0x47d516[_0x62a6('0x3e')]=[{'all':!![]}];}_0x47d516=_[_0x62a6('0x3c')]({},_0x47d516,_0x10cc00['options']);return db[_0x62a6('0x3f')]['find'](_0x47d516)[_0x62a6('0x24')](handleEntityNotFound(_0x296c2e,null))[_0x62a6('0x24')](function(_0x459c78){if(_0x459c78){var _0xea84b1=_0x459c78[_0x62a6('0x49')]({'plain':!![]});_0xea84b1=qs[_0x62a6('0x4a')](_0xea84b1,['id',_0x62a6('0x4b'),'updatedAt']);_0x10cc00[_0x62a6('0x4c')]=_[_0x62a6('0x4a')](_0x10cc00['body'],['id','createdAt',_0x62a6('0x4d')]);return db[_0x62a6('0x3f')][_0x62a6('0x4e')](_['merge'](_0xea84b1,_0x10cc00[_0x62a6('0x4c')]),{'include':_0x10cc00[_0x62a6('0x2f')][_0x62a6('0x46')]?[{'all':!![]}]:undefined});}})[_0x62a6('0x24')](respondWithResult(_0x296c2e,0xc9))[_0x62a6('0x42')](handleError(_0x296c2e,null));};exports[_0x62a6('0x4f')]=function(_0x17bb5e,_0x5ee428){if(_0x17bb5e[_0x62a6('0x4c')]['id']){delete _0x17bb5e[_0x62a6('0x4c')]['id'];}return db[_0x62a6('0x3f')]['find']({'where':{'id':_0x17bb5e['params']['id']}})[_0x62a6('0x24')](handleEntityNotFound(_0x5ee428,null))[_0x62a6('0x24')](saveUpdates(_0x17bb5e[_0x62a6('0x4c')],null))['then'](respondWithResult(_0x5ee428,null))[_0x62a6('0x42')](handleError(_0x5ee428,null));};exports[_0x62a6('0x25')]=function(_0x50013d,_0x4ece75){return db[_0x62a6('0x3f')]['find']({'where':{'id':_0x50013d[_0x62a6('0x44')]['id']}})[_0x62a6('0x24')](handleEntityNotFound(_0x4ece75,null))[_0x62a6('0x24')](removeEntity(_0x4ece75,null))[_0x62a6('0x42')](handleError(_0x4ece75,null));};exports[_0x62a6('0x4e')]=function(_0x1a40b2,_0x946224,_0x27dde4){_0x1a40b2['body'][_0x62a6('0x28')]=_0x1a40b2[_0x62a6('0x50')][_0x62a6('0x51')];_0x1a40b2['body'][_0x62a6('0x52')]=_0x1a40b2['file'][_0x62a6('0x53')];_0x1a40b2[_0x62a6('0x4c')][_0x62a6('0x2b')]=_0x1a40b2[_0x62a6('0x50')][_0x62a6('0x54')];return db[_0x62a6('0x3f')]['create'](_0x1a40b2[_0x62a6('0x4c')])[_0x62a6('0x24')](respondWithResult(_0x946224,0xc9))['catch'](handleError(_0x946224,null));};exports['download']=function(_0x5b5ee3,_0x492baf,_0x40dbc9){return db['Attachment'][_0x62a6('0x55')]({'where':{'id':_0x5b5ee3[_0x62a6('0x44')]['id']},'raw':!![]})[_0x62a6('0x24')](handleEntityNotFound(_0x492baf,null))[_0x62a6('0x24')](function(_0x37a993){if(_0x37a993){var _0x4e2730=_0x37a993['ChatOfflineMessageId']!==null;var _0x36242c=path[_0x62a6('0x56')](config[_0x62a6('0x57')],_0x62a6('0x58'));if(_0x4e2730){_0x36242c=path[_0x62a6('0x56')](_0x36242c,_0x62a6('0x59'));}var _0x3cf54f=path['join'](_0x36242c,_0x37a993['basename']);return _0x492baf[_0x62a6('0x5a')](_0x3cf54f);}})[_0x62a6('0x42')](handleError(_0x492baf,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 8aa87c4..d586a61 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 _0xdc41=['path','rimraf','exports','define','attachments','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xb3fa90,_0x196467){var _0x48b024=function(_0x222e41){while(--_0x222e41){_0xb3fa90['push'](_0xb3fa90['shift']());}};_0x48b024(++_0x196467);}(_0xdc41,0xc0));var _0x1dc4=function(_0x15b266,_0x24b83e){_0x15b266=_0x15b266-0x0;var _0x254f69=_0xdc41[_0x15b266];return _0x254f69;};'use strict';var _=require(_0x1dc4('0x0'));var util=require(_0x1dc4('0x1'));var logger=require(_0x1dc4('0x2'))(_0x1dc4('0x3'));var moment=require(_0x1dc4('0x4'));var BPromise=require('bluebird');var rp=require(_0x1dc4('0x5'));var fs=require('fs');var path=require(_0x1dc4('0x6'));var rimraf=require(_0x1dc4('0x7'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x1dc4('0x8')]=function(_0x5c1ecb,_0x1cd710){return _0x5c1ecb[_0x1dc4('0x9')]('Attachment',attributes,{'tableName':_0x1dc4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x266a=['path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api','bluebird'];(function(_0x222a0f,_0x1b97cd){var _0x126665=function(_0x56c1ec){while(--_0x56c1ec){_0x222a0f['push'](_0x222a0f['shift']());}};_0x126665(++_0x1b97cd);}(_0x266a,0x10f));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require(_0xa266('0x1'));var logger=require(_0xa266('0x2'))(_0xa266('0x3'));var moment=require('moment');var BPromise=require(_0xa266('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa266('0x5'));var rimraf=require(_0xa266('0x6'));var config=require(_0xa266('0x7'));var attributes=require(_0xa266('0x8'));module[_0xa266('0x9')]=function(_0x4c5b6f,_0x2e33d0){return _0x4c5b6f[_0xa266('0xa')]('Attachment',attributes,{'tableName':_0xa266('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index e4ab556..a1e6b2d 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 _0x515d=['result','catch','CreateAttachment','Attachment','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20f586,_0x1b6415){var _0x42b88d=function(_0x383066){while(--_0x383066){_0x20f586['push'](_0x20f586['shift']());}};_0x42b88d(++_0x1b6415);}(_0x515d,0x104));var _0xd515=function(_0x5ad127,_0x47f978){_0x5ad127=_0x5ad127-0x0;var _0x25ef58=_0x515d[_0x5ad127];return _0x25ef58;};'use strict';var _=require('lodash');var util=require(_0xd515('0x0'));var moment=require(_0xd515('0x1'));var BPromise=require(_0xd515('0x2'));var rs=require(_0xd515('0x3'));var fs=require('fs');var Redis=require(_0xd515('0x4'));var db=require(_0xd515('0x5'))['db'];var utils=require(_0xd515('0x6'));var logger=require(_0xd515('0x7'))('rpc');var config=require(_0xd515('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd515('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1130fc,_0x43d633,_0x26a25d){return new BPromise(function(_0x2ec6e2,_0x55a0da){return client[_0xd515('0xa')](_0x1130fc,_0x26a25d)[_0xd515('0xb')](function(_0x138086){logger[_0xd515('0xc')](_0xd515('0xd'),_0x43d633,_0xd515('0xe'));logger['debug'](_0xd515('0xf'),_0x43d633,_0xd515('0xe'),JSON[_0xd515('0x10')](_0x138086));if(_0x138086[_0xd515('0x11')]){if(_0x138086['error'][_0xd515('0x12')]===0x1f4){logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x138086[_0xd515('0x11')][_0xd515('0x13')]);return _0x55a0da(_0x138086[_0xd515('0x11')][_0xd515('0x13')]);}logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x138086[_0xd515('0x11')][_0xd515('0x13')]);return _0x2ec6e2(_0x138086[_0xd515('0x11')][_0xd515('0x13')]);}else{logger['info'](_0xd515('0xd'),_0x43d633,_0xd515('0xe'));_0x2ec6e2(_0x138086[_0xd515('0x14')][_0xd515('0x13')]);}})[_0xd515('0x15')](function(_0x33dbb6){logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x33dbb6);_0x55a0da(_0x33dbb6);});});}exports[_0xd515('0x16')]=function(_0x564c4e){var _0x4ae5b7=this;return new Promise(function(_0x43bb12,_0x2b0173){return db[_0xd515('0x17')][_0xd515('0x18')](_0x564c4e[_0xd515('0x19')],{'raw':_0x564c4e[_0xd515('0x1a')]?_0x564c4e[_0xd515('0x1a')][_0xd515('0x1b')]===undefined?!![]:![]:!![]})[_0xd515('0xb')](function(_0x5c7fef){logger[_0xd515('0xc')](_0xd515('0x16'),_0x564c4e);logger['debug'](_0xd515('0x16'),_0x564c4e,JSON[_0xd515('0x10')](_0x5c7fef));_0x43bb12(_0x5c7fef);})[_0xd515('0x15')](function(_0x4e9d06){logger[_0xd515('0x11')](_0xd515('0x16'),_0x4e9d06[_0xd515('0x13')],_0x564c4e);_0x2b0173(_0x4ae5b7[_0xd515('0x11')](0x1f4,_0x4e9d06['message']));});});}; \ No newline at end of file +var _0x25a3=['result','catch','Attachment','create','body','options','raw','then','CreateAttachment','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3c6064,_0x4af185){var _0x3d520b=function(_0x3ed263){while(--_0x3ed263){_0x3c6064['push'](_0x3c6064['shift']());}};_0x3d520b(++_0x4af185);}(_0x25a3,0x121));var _0x325a=function(_0x1fed61,_0x169500){_0x1fed61=_0x1fed61-0x0;var _0x57a050=_0x25a3[_0x1fed61];return _0x57a050;};'use strict';var _=require(_0x325a('0x0'));var util=require(_0x325a('0x1'));var moment=require(_0x325a('0x2'));var BPromise=require('bluebird');var rs=require(_0x325a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x325a('0x4'))['db'];var utils=require(_0x325a('0x5'));var logger=require(_0x325a('0x6'))('rpc');var config=require(_0x325a('0x7'));var jayson=require(_0x325a('0x8'));var client=jayson[_0x325a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533867,_0x3bb82f,_0x209f5e){return new BPromise(function(_0x43bd79,_0x33f09a){return client['request'](_0x533867,_0x209f5e)['then'](function(_0x37e954){logger[_0x325a('0xa')](_0x325a('0xb'),_0x3bb82f,_0x325a('0xc'));logger[_0x325a('0xd')](_0x325a('0xe'),_0x3bb82f,'request\x20sent',JSON[_0x325a('0xf')](_0x37e954));if(_0x37e954[_0x325a('0x10')]){if(_0x37e954['error'][_0x325a('0x11')]===0x1f4){logger[_0x325a('0x10')](_0x325a('0xb'),_0x3bb82f,_0x37e954[_0x325a('0x10')]['message']);return _0x33f09a(_0x37e954['error'][_0x325a('0x12')]);}logger['error'](_0x325a('0xb'),_0x3bb82f,_0x37e954[_0x325a('0x10')][_0x325a('0x12')]);return _0x43bd79(_0x37e954[_0x325a('0x10')][_0x325a('0x12')]);}else{logger[_0x325a('0xa')](_0x325a('0xb'),_0x3bb82f,_0x325a('0xc'));_0x43bd79(_0x37e954[_0x325a('0x13')][_0x325a('0x12')]);}})[_0x325a('0x14')](function(_0x21315f){logger[_0x325a('0x10')](_0x325a('0xb'),_0x3bb82f,_0x21315f);_0x33f09a(_0x21315f);});});}exports['CreateAttachment']=function(_0x4cba7){var _0x4fbd50=this;return new Promise(function(_0x4a1f9f,_0x34c4c8){return db[_0x325a('0x15')][_0x325a('0x16')](_0x4cba7[_0x325a('0x17')],{'raw':_0x4cba7[_0x325a('0x18')]?_0x4cba7[_0x325a('0x18')][_0x325a('0x19')]===undefined?!![]:![]:!![]})[_0x325a('0x1a')](function(_0x347f2d){logger[_0x325a('0xa')](_0x325a('0x1b'),_0x4cba7);logger[_0x325a('0xd')]('CreateAttachment',_0x4cba7,JSON[_0x325a('0xf')](_0x347f2d));_0x4a1f9f(_0x347f2d);})[_0x325a('0x14')](function(_0x18e29f){logger[_0x325a('0x10')](_0x325a('0x1b'),_0x18e29f[_0x325a('0x12')],_0x4cba7);_0x34c4c8(_0x4fbd50['error'](0x1f4,_0x18e29f[_0x325a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index c505a4f..90d9775 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x0b0e,0x187));var _0xe0b0=function(_0x919bbb,_0x55ef48){_0x919bbb=_0x919bbb-0x0;var _0x40971a=_0x0b0e[_0x919bbb];return _0x40971a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x368ede,_0x1dc90b){var _0x1fa498=function(_0x12b27c){while(--_0x12b27c){_0x368ede['push'](_0x368ede['shift']());}};_0x1fa498(++_0x1dc90b);}(_0xadb5,0xad));var _0x5adb=function(_0x3336e7,_0x1dbd64){_0x3336e7=_0x3336e7-0x0;var _0x1f6a92=_0xadb5[_0x3336e7];return _0x1f6a92;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 3ab4745..5070a9c 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 _0x8a01=['../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','then','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x3da6ae,_0x13fdf4){var _0x1aa8df=function(_0xaac51){while(--_0xaac51){_0x3da6ae['push'](_0x3da6ae['shift']());}};_0x1aa8df(++_0x13fdf4);}(_0x8a01,0x198));var _0x18a0=function(_0x5c6180,_0x12ef5b){_0x5c6180=_0x5c6180-0x0;var _0x1abdba=_0x8a01[_0x5c6180];return _0x1abdba;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x18a0('0x0'))[_0x18a0('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x18a0('0x2'));var BPromise=require(_0x18a0('0x3'));var util=require('util');var db=require(_0x18a0('0x4'))['db'];var authService=require(_0x18a0('0x5'));var utils=require(_0x18a0('0x6'));var config=require(_0x18a0('0x7'));var logger=require(_0x18a0('0x8'))(_0x18a0('0x9'));function isActiveDirectoryConfigured(_0x32e3c1){var _0x295266=![];if(typeof _0x32e3c1[_0x18a0('0xa')]!==_0x18a0('0xb')){_0x295266=_0x32e3c1[_0x18a0('0xa')]['baseDN']&&_0x32e3c1[_0x18a0('0xa')][_0x18a0('0xc')]&&_0x32e3c1[_0x18a0('0xa')][_0x18a0('0xd')];}return _0x295266;}function adAuthenticate(_0x47f043,_0x5f4daa,_0x16849f){return new BPromise(function(_0x331fea,_0x5579c8){try{var _0xa05d42=new ActiveDirectory(_0x47f043);_0xa05d42[_0x18a0('0xe')](_0x5f4daa,_0x16849f,function(_0x20202f,_0x21b100){if(_0x20202f){logger[_0x18a0('0xf')](_0x18a0('0x10'),_0x5f4daa,util[_0x18a0('0x11')](_0x20202f,{'showHidden':![],'depth':null}));_0x5579c8(_0x18a0('0x12'));}else if(!_0x21b100){logger[_0x18a0('0xf')](_0x18a0('0x13'),_0x5f4daa);_0x5579c8(_0x18a0('0x12'));}else{_0x331fea(_0x21b100);}});}catch(_0x541ce0){_0x5579c8(_0x541ce0);}});}function ActiveDirectoryAuthenticate(_0x31ebc6,_0x1f28a2,_0x437fd5,_0x490c71){var _0x4325d5,_0x9f3984;if(!isActiveDirectoryConfigured(config)){logger[_0x18a0('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1f28a2);return _0x490c71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x18a0('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x18a0('0x15'),_0x18a0('0x16')],'raw':!![]})['then'](function(_0x41e869){_0x4325d5=_0x41e869;if(!_0x4325d5[_0x18a0('0x15')]){logger[_0x18a0('0xf')](_0x18a0('0x17'),_0x1f28a2);throw new Error(_0x18a0('0x12'));}return _0x31ebc6[_0x18a0('0x18')]({'attributes':['id',_0x18a0('0x19'),_0x18a0('0x1a'),_0x18a0('0x1b'),_0x18a0('0x1c'),_0x18a0('0x1d'),_0x18a0('0x1e'),_0x18a0('0x1f'),_0x18a0('0x20')],'where':{'name':_0x1f28a2,'role':{'$or':[_0x18a0('0x21'),_0x18a0('0x22'),_0x18a0('0x23')]},'adSsoEnabled':!![]}});})[_0x18a0('0x24')](function(_0x4e96a2){if(!_0x4e96a2||_0x4e96a2&&_0x4e96a2[_0x18a0('0x19')]!==_0x1f28a2){throw new Error(_0x18a0('0x12'));}_0x9f3984=_0x4e96a2;var _0x2498e8=_0x9f3984[_0x18a0('0x19')]+'@'+config[_0x18a0('0xa')]['domain'];return adAuthenticate(config[_0x18a0('0xa')],_0x2498e8,_0x437fd5);})[_0x18a0('0x24')](function(_0x1781b6){if(_0x9f3984[_0x18a0('0x1d')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4325d5[_0x18a0('0x16')]>0x0){if(_0x9f3984[_0x18a0('0x1e')]){if(moment(_0x9f3984[_0x18a0('0x1f')])[_0x18a0('0x25')](_0x4325d5[_0x18a0('0x16')],_0x18a0('0x26'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x18a0('0x27')](_0x9f3984,0x0,![],null)[_0x18a0('0x24')](function(){return utils['getLicense'](_0x9f3984);})[_0x18a0('0x24')](function(){return _0x490c71(null,_0x9f3984);});}else{return utils[_0x18a0('0x28')](_0x9f3984)[_0x18a0('0x24')](function(){return _0x490c71(null,_0x9f3984);});}}else{return utils[_0x18a0('0x28')](_0x9f3984)[_0x18a0('0x24')](function(){return _0x490c71(null,_0x9f3984);});}})[_0x18a0('0x29')](function(_0x53f944){return _0x490c71(null,![],_0x53f944);});}function handleError(_0x13f8e9,_0x2f78e6,_0x5f41bb){return _0x13f8e9[_0x18a0('0x2a')](_0x2f78e6||0x1f4)[_0x18a0('0x2b')]({'message':_0x5f41bb?_0x5f41bb[_0x18a0('0x2c')]||_0x5f41bb:''});}exports[_0x18a0('0x2d')]=function(_0x1085c4,_0x34cadd,_0x5432a9){passport['authenticate']('ad-login',function(_0x1ba2e7,_0x4ee272,_0x1a8806){var _0x33530c=_0x1ba2e7||_0x1a8806;if(_0x33530c){return handleError(_0x34cadd,0x191,_0x33530c);}if(!_0x4ee272){return handleError(_0x34cadd,0x194,{'message':_0x18a0('0x2e')});}else{var _0x454772={'payload':{'id':_0x4ee272['id'],'role':_0x4ee272['role']},'options':{'expiresIn':0x15180}};return authService[_0x18a0('0x2f')](_0x454772)[_0x18a0('0x24')](function(_0x3b4d93){_0x34cadd[_0x18a0('0x30')]({'id':_0x4ee272['id'],'token':_0x3b4d93,'statusCall':'','isAlreadyLogged':_0x4ee272[_0x18a0('0x20')]});});}})(_0x1085c4,_0x34cadd,_0x5432a9);};passport[_0x18a0('0x31')](_0x18a0('0x32'),new LocalStrategy({'usernameField':_0x18a0('0x19'),'passwordField':_0x18a0('0x1a')},function(_0x13bc1d,_0x3d8503,_0x3059b1){return ActiveDirectoryAuthenticate(db[_0x18a0('0x33')],_0x13bc1d,_0x3d8503,_0x3059b1);})); \ No newline at end of file +var _0x051e=['passport','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','baseDN','activedirectory','url','domain','authenticate','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','minutes','then','getLicense','status','send','login','ad-login','signToken','User'];(function(_0x58c3a7,_0x1e0d71){var _0xafb522=function(_0x3c0472){while(--_0x3c0472){_0x58c3a7['push'](_0x58c3a7['shift']());}};_0xafb522(++_0x1e0d71);}(_0x051e,0xb8));var _0xe051=function(_0x5998f8,_0x2f8e15){_0x5998f8=_0x5998f8-0x0;var _0x1adb98=_0x051e[_0x5998f8];return _0x1adb98;};'use strict';var passport=require(_0xe051('0x0'));var LocalStrategy=require('passport-local')[_0xe051('0x1')];var moment=require(_0xe051('0x2'));var ActiveDirectory=require(_0xe051('0x3'));var BPromise=require(_0xe051('0x4'));var util=require(_0xe051('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xe051('0x6'));var utils=require(_0xe051('0x7'));var config=require(_0xe051('0x8'));var logger=require(_0xe051('0x9'))(_0xe051('0xa'));function isActiveDirectoryConfigured(_0x3389e0){var _0x5a0b5e=![];if(typeof _0x3389e0['activedirectory']!=='undefined'){_0x5a0b5e=_0x3389e0['activedirectory'][_0xe051('0xb')]&&_0x3389e0[_0xe051('0xc')][_0xe051('0xd')]&&_0x3389e0['activedirectory'][_0xe051('0xe')];}return _0x5a0b5e;}function adAuthenticate(_0x5ebed8,_0x17bc49,_0x3f9295){return new BPromise(function(_0x26acd3,_0x4a7d64){try{var _0x2c1837=new ActiveDirectory(_0x5ebed8);_0x2c1837[_0xe051('0xf')](_0x17bc49,_0x3f9295,function(_0xd0483f,_0x412d8e){if(_0xd0483f){logger[_0xe051('0x10')](_0xe051('0x11'),_0x17bc49,util['inspect'](_0xd0483f,{'showHidden':![],'depth':null}));_0x4a7d64(_0xe051('0x12'));}else if(!_0x412d8e){logger[_0xe051('0x10')](_0xe051('0x13'),_0x17bc49);_0x4a7d64('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x26acd3(_0x412d8e);}});}catch(_0x170653){_0x4a7d64(_0x170653);}});}function ActiveDirectoryAuthenticate(_0x51b71d,_0x79fd59,_0x1f7ec3,_0x122dd7){var _0x22c68b,_0xba50f4;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xe051('0x14'),_0x79fd59);return _0x122dd7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xe051('0x15')][_0xe051('0x16')]({'where':{'id':0x1},'attributes':[_0xe051('0x17'),_0xe051('0x18')],'raw':!![]})['then'](function(_0x3a2486){_0x22c68b=_0x3a2486;if(!_0x22c68b[_0xe051('0x17')]){logger['error'](_0xe051('0x19'),_0x79fd59);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x51b71d[_0xe051('0x16')]({'attributes':['id',_0xe051('0x1a'),_0xe051('0x1b'),_0xe051('0x1c'),_0xe051('0x1d'),_0xe051('0x1e'),_0xe051('0x1f'),_0xe051('0x20'),_0xe051('0x21')],'where':{'name':_0x79fd59,'role':{'$or':[_0xe051('0x22'),_0xe051('0x23'),_0xe051('0x24')]},'adSsoEnabled':!![]}});})['then'](function(_0x3244e5){if(!_0x3244e5||_0x3244e5&&_0x3244e5[_0xe051('0x1a')]!==_0x79fd59){throw new Error(_0xe051('0x12'));}_0xba50f4=_0x3244e5;var _0x27eab8=_0xba50f4[_0xe051('0x1a')]+'@'+config[_0xe051('0xc')][_0xe051('0xe')];return adAuthenticate(config[_0xe051('0xc')],_0x27eab8,_0x1f7ec3);})['then'](function(_0x108c4b){if(_0xba50f4[_0xe051('0x1e')]){throw new Error(_0xe051('0x12'));}if(_0x22c68b['blockDuration']>0x0){if(_0xba50f4['blocked']){if(moment(_0xba50f4['blockedAt'])['add'](_0x22c68b[_0xe051('0x18')],_0xe051('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0xba50f4,0x0,![],null)[_0xe051('0x26')](function(){return utils['getLicense'](_0xba50f4);})['then'](function(){return _0x122dd7(null,_0xba50f4);});}else{return utils[_0xe051('0x27')](_0xba50f4)[_0xe051('0x26')](function(){return _0x122dd7(null,_0xba50f4);});}}else{return utils['getLicense'](_0xba50f4)[_0xe051('0x26')](function(){return _0x122dd7(null,_0xba50f4);});}})['catch'](function(_0x1b9fc8){return _0x122dd7(null,![],_0x1b9fc8);});}function handleError(_0x5cf726,_0x54ddc9,_0x2337cc){return _0x5cf726[_0xe051('0x28')](_0x54ddc9||0x1f4)[_0xe051('0x29')]({'message':_0x2337cc?_0x2337cc['message']||_0x2337cc:''});}exports[_0xe051('0x2a')]=function(_0x185eb0,_0x52fb40,_0x42f1a0){passport[_0xe051('0xf')](_0xe051('0x2b'),function(_0x1bf2cf,_0x5dfbeb,_0x7ae8f2){var _0x133c38=_0x1bf2cf||_0x7ae8f2;if(_0x133c38){return handleError(_0x52fb40,0x191,_0x133c38);}if(!_0x5dfbeb){return handleError(_0x52fb40,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x492cc3={'payload':{'id':_0x5dfbeb['id'],'role':_0x5dfbeb[_0xe051('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0xe051('0x2c')](_0x492cc3)['then'](function(_0x5aa550){_0x52fb40['json']({'id':_0x5dfbeb['id'],'token':_0x5aa550,'statusCall':'','isAlreadyLogged':_0x5dfbeb[_0xe051('0x21')]});});}})(_0x185eb0,_0x52fb40,_0x42f1a0);};passport['use'](_0xe051('0x2b'),new LocalStrategy({'usernameField':_0xe051('0x1a'),'passwordField':'password'},function(_0x14e52a,_0x301bbd,_0x255726){return ActiveDirectoryAuthenticate(db[_0xe051('0x2d')],_0x14e52a,_0x301bbd,_0x255726);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 8915341..20a9480 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 _0x206f=['Router','login','exports','express'];(function(_0x520d6d,_0x20ed47){var _0x17bd7b=function(_0x304c1a){while(--_0x304c1a){_0x520d6d['push'](_0x520d6d['shift']());}};_0x17bd7b(++_0x20ed47);}(_0x206f,0x12f));var _0xf206=function(_0x14b8e0,_0x1f2235){_0x14b8e0=_0x14b8e0-0x0;var _0x5be547=_0x206f[_0x14b8e0];return _0x5be547;};'use strict';var express=require(_0xf206('0x0'));var router=express[_0xf206('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xf206('0x2')]);module[_0xf206('0x3')]=router; \ No newline at end of file +var _0x7ac1=['login','Router','./authActiveDirectory.controller','post'];(function(_0x8d81c6,_0x268107){var _0x1e13fb=function(_0x2102fa){while(--_0x2102fa){_0x8d81c6['push'](_0x8d81c6['shift']());}};_0x1e13fb(++_0x268107);}(_0x7ac1,0x1e1));var _0x17ac=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7ac1[_0xa464c9];return _0x3d73c4;};'use strict';var express=require('express');var router=express[_0x17ac('0x0')]();var controller=require(_0x17ac('0x1'));router[_0x17ac('0x2')]('/',controller[_0x17ac('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ce7273d..37c495e 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(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x7a54,0x106));var _0x47a5=function(_0x1f3baf,_0x182847){_0x1f3baf=_0x1f3baf-0x0;var _0x4c3bf1=_0x7a54[_0x1f3baf];return _0x4c3bf1;};'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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xdff215,_0x51203d){var _0x51b48e=function(_0x42df88){while(--_0x42df88){_0xdff215['push'](_0xdff215['shift']());}};_0x51b48e(++_0x51203d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 80ed1de..6ccb530 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 _0xe5af=['express','passport','Router','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x5675e9,_0xcc8780){var _0x1607e9=function(_0x64cc5){while(--_0x64cc5){_0x5675e9['push'](_0x5675e9['shift']());}};_0x1607e9(++_0xcc8780);}(_0xe5af,0x136));var _0xfe5a=function(_0xaa72b3,_0xbd6780){_0xaa72b3=_0xaa72b3-0x0;var _0x3f7bf3=_0xe5af[_0xaa72b3];return _0x3f7bf3;};'use strict';var express=require(_0xfe5a('0x0'));var passport=require(_0xfe5a('0x1'));var router=express[_0xfe5a('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xfe5a('0x3'));var authService=require('../../components/auth/service');router[_0xfe5a('0x4')]('/',controller[_0xfe5a('0x5')]);router[_0xfe5a('0x4')](_0xfe5a('0x6'),controller[_0xfe5a('0x7')],authService[_0xfe5a('0x8')],userController[_0xfe5a('0x5')],authService[_0xfe5a('0x9')]);module['exports']=router; \ No newline at end of file +var _0xdd06=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','../user/user.controller.js'];(function(_0x350561,_0x4d3be3){var _0x54bfa9=function(_0x2e786d){while(--_0x2e786d){_0x350561['push'](_0x350561['shift']());}};_0x54bfa9(++_0x4d3be3);}(_0xdd06,0x1d6));var _0x6dd0=function(_0x15d178,_0x533561){_0x15d178=_0x15d178-0x0;var _0xc73785=_0xdd06[_0x15d178];return _0xc73785;};'use strict';var express=require(_0x6dd0('0x0'));var passport=require('passport');var router=express[_0x6dd0('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x6dd0('0x2'));var authService=require(_0x6dd0('0x3'));router[_0x6dd0('0x4')]('/',controller[_0x6dd0('0x5')]);router[_0x6dd0('0x4')](_0x6dd0('0x6'),controller[_0x6dd0('0x7')],authService[_0x6dd0('0x8')],userController[_0x6dd0('0x5')],authService[_0x6dd0('0x9')]);module[_0x6dd0('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 93279a3..c150559 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 _0x19b7=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','loginAttempts','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','clearBlockUser','add','minutes','catch','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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'];(function(_0x1acc79,_0x538d3f){var _0x109fd1=function(_0x20e457){while(--_0x20e457){_0x1acc79['push'](_0x1acc79['shift']());}};_0x109fd1(++_0x538d3f);}(_0x19b7,0x1bd));var _0x719b=function(_0x2c2540,_0x3516ad){_0x2c2540=_0x2c2540-0x0;var _0x324c80=_0x19b7[_0x2c2540];return _0x324c80;};'use strict';var util=require(_0x719b('0x0'));var passport=require('passport');var LocalStrategy=require(_0x719b('0x1'))[_0x719b('0x2')];var jayson=require(_0x719b('0x3'));var _=require(_0x719b('0x4'));var rs=require(_0x719b('0x5'));var moment=require(_0x719b('0x6'));var db=require(_0x719b('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x719b('0x8'));var client=jayson[_0x719b('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x36a0f3,_0x29a068,_0x4cd45c,_0xdb9cb0){var _0x3929f2,_0x177c84;return db[_0x719b('0xa')][_0x719b('0xb')]({'where':{'id':0x1},'attributes':[_0x719b('0xc'),_0x719b('0xd')],'raw':!![]})[_0x719b('0xe')](function(_0x33d091){_0x3929f2=_0x33d091;return _0x36a0f3[_0x719b('0xb')]({'attributes':['id',_0x719b('0xf'),_0x719b('0x10'),_0x719b('0x11'),_0x719b('0x12'),_0x719b('0x13'),'blocked','blockedAt',_0x719b('0x14')],'where':{'name':_0x29a068,'role':{'$or':['admin',_0x719b('0x15'),'agent']}}});})['then'](function(_0x4c3578){if(!_0x4c3578||_0x4c3578&&_0x4c3578[_0x719b('0xf')]!==_0x29a068){throw new Error(_0x719b('0x16'));}else{_0x177c84=_0x4c3578;return _0x177c84;}})['then'](function(){_0x177c84[_0x719b('0x17')](_0x4cd45c,function(_0x51bc79,_0x37b725){var _0x21a3af=_0x177c84[_0x719b('0x14')]+0x1;if(_0x51bc79){return _0xdb9cb0(_0x51bc79);}else if(!_0x37b725){if(_0x177c84['disabled']){return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}else if(_0x3929f2[_0x719b('0xc')]>0x0){if(_0x177c84[_0x719b('0x18')]){if(_0x3929f2[_0x719b('0xd')]>0x0){if(moment(_0x177c84[_0x719b('0x19')])['add'](_0x3929f2[_0x719b('0xd')],'minutes')>moment()){return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}else{return utils[_0x719b('0x1a')](_0x177c84,_0x21a3af,![],null)[_0x719b('0xe')](function(){return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});});}}else{return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}}else{if(_0x21a3af>=_0x3929f2[_0x719b('0xc')]){return utils[_0x719b('0x1a')](_0x177c84,0x0,!![],moment())[_0x719b('0xe')](function(){return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});});}else{return utils[_0x719b('0x1a')](_0x177c84,_0x21a3af,![],null)[_0x719b('0xe')](function(){return _0xdb9cb0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}}else{if(_0x177c84[_0x719b('0x13')]){return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}else if(_0x3929f2[_0x719b('0xc')]>0x0){if(_0x177c84[_0x719b('0x18')]){if(_0x3929f2[_0x719b('0xd')]>0x0){if(moment(_0x177c84[_0x719b('0x19')])[_0x719b('0x1b')](_0x3929f2[_0x719b('0xd')],_0x719b('0x1c'))>moment()){return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}else{return utils['clearBlockUser'](_0x177c84,0x0,![],null)['then'](function(){return utils['getLicense'](_0x177c84);})[_0x719b('0xe')](function(){return _0xdb9cb0(null,_0x177c84);});}}else{return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}}else{return utils[_0x719b('0x1a')](_0x177c84,0x0,![],null)[_0x719b('0xe')](function(){return utils['getLicense'](_0x177c84);})[_0x719b('0xe')](function(){return _0xdb9cb0(null,_0x177c84);})[_0x719b('0x1d')](function(_0x4c1125){return _0xdb9cb0(null,![],_0x4c1125);});}}else{if(_0x177c84[_0x719b('0x18')]){return _0xdb9cb0(null,![],{'message':_0x719b('0x16')});}else{return utils['getLicense'](_0x177c84)[_0x719b('0xe')](function(){return _0xdb9cb0(null,_0x177c84);});}}}});})['catch'](function(_0x38d898){return _0xdb9cb0(null,![],_0x38d898);});}function sendServiceMail(_0x2a562a){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id','name',_0x719b('0x1e')],'include':[{'model':db[_0x719b('0x1f')],'as':_0x719b('0x20'),'include':[{'model':db[_0x719b('0x21')],'as':'CloudProvider'}]}]})[_0x719b('0xe')](function(_0x37ed6f){if(!_0x37ed6f){throw new Error(_0x719b('0x22'));}var _0xeb12e8=_0x37ed6f['getSmtpOptions']();var _0x716c01={'account':_0xeb12e8,'message':_[_0x719b('0x23')]({'from':util[_0x719b('0x24')](_0x719b('0x25'),_0x37ed6f[_0x719b('0xf')],_0x37ed6f['email']||_0x37ed6f[_0x719b('0x20')]['user'])},_0x2a562a)};return client[_0x719b('0x26')](_0x719b('0x27'),_0x716c01);})[_0x719b('0xe')](function(_0x5813b1){if(_0x5813b1['error']){throw new Error(util['format'](_0x719b('0x28'),_0x5813b1[_0x719b('0x29')][_0x719b('0x2a')]||JSON[_0x719b('0x2b')](_0x5813b1['error'])));}return!![];});}function handleError(_0x3ec369,_0x3c16a9,_0x55193e){return _0x3ec369['status'](_0x3c16a9||0x1f4)['send']({'message':_0x55193e?_0x55193e[_0x719b('0x2a')]||_0x55193e:''});}exports[_0x719b('0x2c')]=function(_0x292845,_0xc6aba6,_0x25179b){passport[_0x719b('0x17')](_0x719b('0x2d'),function(_0x2b54f5,_0x161c4e,_0x37740d){var _0x250e08=_0x2b54f5||_0x37740d;if(_0x250e08){return handleError(_0xc6aba6,0x191,_0x250e08);}if(!_0x161c4e){return handleError(_0xc6aba6,0x194,{'message':_0x719b('0x2e')});}else{var _0x4a6281={'payload':{'id':_0x161c4e['id'],'role':_0x161c4e[_0x719b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x719b('0x2f')](_0x4a6281)[_0x719b('0xe')](function(_0x5577e1){_0xc6aba6[_0x719b('0x30')]({'id':_0x161c4e['id'],'token':_0x5577e1,'statusCall':'','isAlreadyLogged':_0x161c4e[_0x719b('0x31')]});});}})(_0x292845,_0xc6aba6,_0x25179b);};exports[_0x719b('0x32')]=function(_0x4e93ea,_0x4b167b){if(!_0x4e93ea[_0x719b('0x33')][_0x719b('0x1e')]){return handleError(_0x4b167b,0x1f4,{'message':_0x719b('0x34')});}var _0x3d6cd2=rs[_0x719b('0x35')]();_0x4e93ea['body']['email']=_0x4e93ea[_0x719b('0x33')][_0x719b('0x1e')][_0x719b('0x36')]()[_0x719b('0x37')]();var _0xa65577;return db[_0x719b('0xa')][_0x719b('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x719b('0xe')](function(_0x4cec07){_0xa65577=_0x4cec07;return db[_0x719b('0x38')][_0x719b('0x39')]({'where':{'email':_0x4e93ea[_0x719b('0x33')]['email']}});})['then'](function(_0x13218d){if(!_0x13218d){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x13218d[_0x719b('0x13')]){throw new Error(_0x719b('0x3a'));}if(_0x13218d[_0x719b('0x18')]){if(moment(_0x13218d[_0x719b('0x19')])['add'](_0xa65577[_0x719b('0xd')],_0x719b('0x1c'))>moment()){throw new Error(_0x719b('0x3b'));}else{_0x13218d[_0x719b('0x18')]=![];_0x13218d[_0x719b('0x19')]=null;}}_0x13218d['resetPasswordToken']=_0x3d6cd2;_0x13218d[_0x719b('0x3c')]=Date[_0x719b('0x3d')]()+0x36ee80;return _0x13218d[_0x719b('0x3e')]();})[_0x719b('0xe')](function(){return sendServiceMail({'to':_0x4e93ea[_0x719b('0x33')][_0x719b('0x1e')],'subject':_0x719b('0x3f'),'text':_0x719b('0x40')+_0x719b('0x41')+_0x719b('0x42')+_0x4e93ea[_0x719b('0x43')]['host']+_0x719b('0x44')+_0x3d6cd2+'\x0a\x0a'+_0x719b('0x45')});})[_0x719b('0xe')](function(){_0x4b167b[_0x719b('0x46')](0xc8)[_0x719b('0x47')]({'message':_0x719b('0x48')});})[_0x719b('0x1d')](function(_0x5d92da){return handleError(_0x4b167b,0x1f4,_0x5d92da);});};exports['reset']=function(_0x3a3548,_0x50e449){return db[_0x719b('0x38')][_0x719b('0x39')]({'where':{'resetPasswordToken':_0x3a3548[_0x719b('0x49')][_0x719b('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x719b('0x3d')]()}}})[_0x719b('0xe')](function(_0x56d132){if(!_0x56d132){throw new Error(_0x719b('0x4b'));}return db[_0x719b('0xa')][_0x719b('0xb')]({'attributes':['id',_0x719b('0x4c'),'enforcePasswordHistory',_0x719b('0x4d')]})['then'](function(_0x25d56c){if(_0x25d56c[_0x719b('0x4c')])authService[_0x719b('0x4e')](_0x3a3548[_0x719b('0x33')]['password']);if(!_0x25d56c[_0x719b('0x4f')]||!_0x56d132[_0x719b('0x50')])return _0x56d132;authService[_0x719b('0x51')](_0x3a3548[_0x719b('0x33')][_0x719b('0x10')],_0x56d132[_0x719b('0x50')],_0x25d56c[_0x719b('0x4d')]);return _0x56d132;})[_0x719b('0xe')](function(){_0x56d132[_0x719b('0x10')]=_0x3a3548[_0x719b('0x33')]['password'];_0x56d132[_0x719b('0x52')]=null;_0x56d132['resetPasswordExpires']=null;return _0x56d132[_0x719b('0x3e')]();});})['then'](function(){_0x50e449[_0x719b('0x46')](0xc8)[_0x719b('0x47')]({'message':_0x719b('0x53')});})[_0x719b('0x1d')](function(_0x2017e9){return handleError(_0x50e449,0x1f4,_0x2017e9);});};passport[_0x719b('0x54')](_0x719b('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0x719b('0x10')},function(_0x3d547a,_0x9b5da2,_0xcfbc3b){return localAuthenticate(db[_0x719b('0x38')],_0x3d547a,_0x9b5da2,_0xcfbc3b);})); \ No newline at end of file +var _0xfcac=['resetPasswordExpires','now','save','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','Password\x20reset!','util','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','then','password','role','disabled','blockedAt','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','blockDuration','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xfcac,0x1a9));var _0xcfca=function(_0xabcfad,_0x505b4a){_0xabcfad=_0xabcfad-0x0;var _0x3b10fe=_0xfcac[_0xabcfad];return _0x3b10fe;};'use strict';var util=require(_0xcfca('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xcfca('0x1')];var jayson=require(_0xcfca('0x2'));var _=require(_0xcfca('0x3'));var rs=require('randomstring');var moment=require(_0xcfca('0x4'));var db=require(_0xcfca('0x5'))['db'];var authService=require(_0xcfca('0x6'));var utils=require(_0xcfca('0x7'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x3d39e2,_0x3a9cbe,_0x21248d,_0x3cd819){var _0xd13474,_0x370071;return db[_0xcfca('0x8')][_0xcfca('0x9')]({'where':{'id':0x1},'attributes':[_0xcfca('0xa'),'blockDuration'],'raw':!![]})[_0xcfca('0xb')](function(_0x26c0fa){_0xd13474=_0x26c0fa;return _0x3d39e2[_0xcfca('0x9')]({'attributes':['id','name',_0xcfca('0xc'),'salt',_0xcfca('0xd'),_0xcfca('0xe'),'blocked',_0xcfca('0xf'),_0xcfca('0x10')],'where':{'name':_0x3a9cbe,'role':{'$or':[_0xcfca('0x11'),_0xcfca('0x12'),'agent']}}});})['then'](function(_0xf19ef6){if(!_0xf19ef6||_0xf19ef6&&_0xf19ef6[_0xcfca('0x13')]!==_0x3a9cbe){throw new Error(_0xcfca('0x14'));}else{_0x370071=_0xf19ef6;return _0x370071;}})[_0xcfca('0xb')](function(){_0x370071['authenticate'](_0x21248d,function(_0x5bb56d,_0x8fe3aa){var _0x643026=_0x370071[_0xcfca('0x10')]+0x1;if(_0x5bb56d){return _0x3cd819(_0x5bb56d);}else if(!_0x8fe3aa){if(_0x370071[_0xcfca('0xe')]){return _0x3cd819(null,![],{'message':_0xcfca('0x14')});}else if(_0xd13474[_0xcfca('0xa')]>0x0){if(_0x370071[_0xcfca('0x15')]){if(_0xd13474['blockDuration']>0x0){if(moment(_0x370071[_0xcfca('0xf')])[_0xcfca('0x16')](_0xd13474[_0xcfca('0x17')],_0xcfca('0x18'))>moment()){return _0x3cd819(null,![],{'message':_0xcfca('0x14')});}else{return utils[_0xcfca('0x19')](_0x370071,_0x643026,![],null)[_0xcfca('0xb')](function(){return _0x3cd819(null,![],{'message':_0xcfca('0x14')});});}}else{return _0x3cd819(null,![],{'message':_0xcfca('0x14')});}}else{if(_0x643026>=_0xd13474['allowedLoginAttempts']){return utils['clearBlockUser'](_0x370071,0x0,!![],moment())[_0xcfca('0xb')](function(){return _0x3cd819(null,![],{'message':_0xcfca('0x14')});});}else{return utils['clearBlockUser'](_0x370071,_0x643026,![],null)[_0xcfca('0xb')](function(){return _0x3cd819(null,![],{'message':_0xcfca('0x14')});});}}}else{return _0x3cd819(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x370071['disabled']){return _0x3cd819(null,![],{'message':_0xcfca('0x14')});}else if(_0xd13474[_0xcfca('0xa')]>0x0){if(_0x370071[_0xcfca('0x15')]){if(_0xd13474[_0xcfca('0x17')]>0x0){if(moment(_0x370071[_0xcfca('0xf')])[_0xcfca('0x16')](_0xd13474[_0xcfca('0x17')],'minutes')>moment()){return _0x3cd819(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xcfca('0x19')](_0x370071,0x0,![],null)[_0xcfca('0xb')](function(){return utils['getLicense'](_0x370071);})[_0xcfca('0xb')](function(){return _0x3cd819(null,_0x370071);});}}else{return _0x3cd819(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x370071,0x0,![],null)[_0xcfca('0xb')](function(){return utils[_0xcfca('0x1a')](_0x370071);})[_0xcfca('0xb')](function(){return _0x3cd819(null,_0x370071);})[_0xcfca('0x1b')](function(_0x1b6a93){return _0x3cd819(null,![],_0x1b6a93);});}}else{if(_0x370071['blocked']){return _0x3cd819(null,![],{'message':_0xcfca('0x14')});}else{return utils['getLicense'](_0x370071)['then'](function(){return _0x3cd819(null,_0x370071);});}}}});})[_0xcfca('0x1b')](function(_0x56e13d){return _0x3cd819(null,![],_0x56e13d);});}function sendServiceMail(_0x1a2980){return db[_0xcfca('0x1c')][_0xcfca('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xcfca('0x13'),_0xcfca('0x1e')],'include':[{'model':db[_0xcfca('0x1f')],'as':'Smtp','include':[{'model':db[_0xcfca('0x20')],'as':_0xcfca('0x20')}]}]})['then'](function(_0x574e4e){if(!_0x574e4e){throw new Error(_0xcfca('0x21'));}var _0x141651=_0x574e4e[_0xcfca('0x22')]();var _0x2e189f={'account':_0x141651,'message':_['merge']({'from':util['format'](_0xcfca('0x23'),_0x574e4e[_0xcfca('0x13')],_0x574e4e[_0xcfca('0x1e')]||_0x574e4e[_0xcfca('0x24')][_0xcfca('0x12')])},_0x1a2980)};return client[_0xcfca('0x25')](_0xcfca('0x26'),_0x2e189f);})['then'](function(_0xb5cd00){if(_0xb5cd00[_0xcfca('0x27')]){throw new Error(util[_0xcfca('0x28')](_0xcfca('0x29'),_0xb5cd00[_0xcfca('0x27')][_0xcfca('0x2a')]||JSON['stringify'](_0xb5cd00[_0xcfca('0x27')])));}return!![];});}function handleError(_0x36255c,_0x4a7423,_0x286093){return _0x36255c[_0xcfca('0x2b')](_0x4a7423||0x1f4)[_0xcfca('0x2c')]({'message':_0x286093?_0x286093[_0xcfca('0x2a')]||_0x286093:''});}exports['login']=function(_0x300931,_0x4763df,_0x2741fb){passport[_0xcfca('0x2d')](_0xcfca('0x2e'),function(_0x290c7a,_0x198845,_0x49a974){var _0xe166a7=_0x290c7a||_0x49a974;if(_0xe166a7){return handleError(_0x4763df,0x191,_0xe166a7);}if(!_0x198845){return handleError(_0x4763df,0x194,{'message':_0xcfca('0x2f')});}else{var _0x40b76d={'payload':{'id':_0x198845['id'],'role':_0x198845[_0xcfca('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xcfca('0x30')](_0x40b76d)[_0xcfca('0xb')](function(_0x5a5826){_0x4763df[_0xcfca('0x31')]({'id':_0x198845['id'],'token':_0x5a5826,'statusCall':'','isAlreadyLogged':_0x198845[_0xcfca('0x32')]});});}})(_0x300931,_0x4763df,_0x2741fb);};exports[_0xcfca('0x33')]=function(_0x44f18a,_0x5b307a){if(!_0x44f18a[_0xcfca('0x34')][_0xcfca('0x1e')]){return handleError(_0x5b307a,0x1f4,{'message':_0xcfca('0x35')});}var _0x58fe99=rs[_0xcfca('0x36')]();_0x44f18a[_0xcfca('0x34')]['email']=_0x44f18a[_0xcfca('0x34')][_0xcfca('0x1e')]['trim']()[_0xcfca('0x37')]();var _0x2fb195;return db[_0xcfca('0x8')][_0xcfca('0x9')]({'where':{'id':0x1},'attributes':[_0xcfca('0xa'),'blockDuration'],'raw':!![]})['then'](function(_0x270376){_0x2fb195=_0x270376;return db[_0xcfca('0x38')][_0xcfca('0x1d')]({'where':{'email':_0x44f18a[_0xcfca('0x34')][_0xcfca('0x1e')]}});})[_0xcfca('0xb')](function(_0x5b606c){if(!_0x5b606c){throw new Error(_0xcfca('0x39'));}if(_0x5b606c['disabled']){throw new Error(_0xcfca('0x3a'));}if(_0x5b606c[_0xcfca('0x15')]){if(moment(_0x5b606c[_0xcfca('0xf')])[_0xcfca('0x16')](_0x2fb195[_0xcfca('0x17')],'minutes')>moment()){throw new Error(_0xcfca('0x3b'));}else{_0x5b606c[_0xcfca('0x15')]=![];_0x5b606c[_0xcfca('0xf')]=null;}}_0x5b606c[_0xcfca('0x3c')]=_0x58fe99;_0x5b606c[_0xcfca('0x3d')]=Date[_0xcfca('0x3e')]()+0x36ee80;return _0x5b606c[_0xcfca('0x3f')]();})[_0xcfca('0xb')](function(){return sendServiceMail({'to':_0x44f18a[_0xcfca('0x34')][_0xcfca('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xcfca('0x40')+_0xcfca('0x41')+_0xcfca('0x42')+_0x44f18a[_0xcfca('0x43')][_0xcfca('0x44')]+_0xcfca('0x45')+_0x58fe99+'\x0a\x0a'+_0xcfca('0x46')});})['then'](function(){_0x5b307a[_0xcfca('0x2b')](0xc8)[_0xcfca('0x2c')]({'message':_0xcfca('0x47')});})[_0xcfca('0x1b')](function(_0x3fd343){return handleError(_0x5b307a,0x1f4,_0x3fd343);});};exports['reset']=function(_0x5473ff,_0x2834f9){return db[_0xcfca('0x38')][_0xcfca('0x1d')]({'where':{'resetPasswordToken':_0x5473ff['params'][_0xcfca('0x48')],'resetPasswordExpires':{'$gt':Date[_0xcfca('0x3e')]()}}})[_0xcfca('0xb')](function(_0x48f264){if(!_0x48f264){throw new Error(_0xcfca('0x49'));}return db['Setting'][_0xcfca('0x9')]({'attributes':['id',_0xcfca('0x4a'),_0xcfca('0x4b'),_0xcfca('0x4c')]})[_0xcfca('0xb')](function(_0x4ef821){if(_0x4ef821[_0xcfca('0x4a')])authService[_0xcfca('0x4d')](_0x5473ff[_0xcfca('0x34')][_0xcfca('0xc')]);if(!_0x4ef821[_0xcfca('0x4b')]||!_0x48f264['previousPasswords'])return _0x48f264;authService[_0xcfca('0x4e')](_0x5473ff[_0xcfca('0x34')]['password'],_0x48f264[_0xcfca('0x4f')],_0x4ef821[_0xcfca('0x4c')]);return _0x48f264;})[_0xcfca('0xb')](function(){_0x48f264[_0xcfca('0xc')]=_0x5473ff[_0xcfca('0x34')][_0xcfca('0xc')];_0x48f264['resetPasswordToken']=null;_0x48f264[_0xcfca('0x3d')]=null;return _0x48f264[_0xcfca('0x3f')]();});})[_0xcfca('0xb')](function(){_0x2834f9[_0xcfca('0x2b')](0xc8)['send']({'message':_0xcfca('0x50')});})[_0xcfca('0x1b')](function(_0x1b5263){return handleError(_0x2834f9,0x1f4,_0x1b5263);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0xcfca('0x13'),'passwordField':_0xcfca('0xc')},function(_0x5d1783,_0x46d25b,_0x3a2995){return localAuthenticate(db['User'],_0x5d1783,_0x46d25b,_0x3a2995);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 0853547..2df96a4 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 _0xecb9=['/forgot','/reset/:token','reset','exports','express','Router','post'];(function(_0x101e80,_0x289d7e){var _0x396d40=function(_0x2f4ef0){while(--_0x2f4ef0){_0x101e80['push'](_0x101e80['shift']());}};_0x396d40(++_0x289d7e);}(_0xecb9,0xf2));var _0x9ecb=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xecb9[_0x79b649];return _0x1af9b1;};'use strict';var express=require(_0x9ecb('0x0'));var router=express[_0x9ecb('0x1')]();var controller=require('./authLocal.controller');router[_0x9ecb('0x2')]('/',controller['login']);router['post'](_0x9ecb('0x3'),controller['forgot']);router['post'](_0x9ecb('0x4'),controller[_0x9ecb('0x5')]);module[_0x9ecb('0x6')]=router; \ No newline at end of file +var _0x5384=['express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x2190ff,_0x7e0a09){var _0x1dacaa=function(_0x4002ff){while(--_0x4002ff){_0x2190ff['push'](_0x2190ff['shift']());}};_0x1dacaa(++_0x7e0a09);}(_0x5384,0x1d4));var _0x4538=function(_0x2e2c1b,_0x94deaf){_0x2e2c1b=_0x2e2c1b-0x0;var _0x43a4f2=_0x5384[_0x2e2c1b];return _0x43a4f2;};'use strict';var express=require(_0x4538('0x0'));var router=express['Router']();var controller=require(_0x4538('0x1'));router[_0x4538('0x2')]('/',controller[_0x4538('0x3')]);router['post'](_0x4538('0x4'),controller[_0x4538('0x5')]);router[_0x4538('0x2')](_0x4538('0x6'),controller[_0x4538('0x7')]);module[_0x4538('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index d7a957f..53addfa 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 _0x34cb=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x42d15,_0x4835a8){var _0xbb558f=function(_0x47b6a3){while(--_0x47b6a3){_0x42d15['push'](_0x42d15['shift']());}};_0xbb558f(++_0x4835a8);}(_0x34cb,0xce));var _0xb34c=function(_0x4ad264,_0x5922cd){_0x4ad264=_0x4ad264-0x0;var _0x1599e9=_0x34cb[_0x4ad264];return _0x1599e9;};'use strict';var Sequelize=require(_0xb34c('0x0'));module[_0xb34c('0x1')]={'name':{'type':Sequelize[_0xb34c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb34c('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xb34c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb34c('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x6730=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x3c941e,_0x108fdb){var _0x5a4711=function(_0x2c7d83){while(--_0x2c7d83){_0x3c941e['push'](_0x3c941e['shift']());}};_0x5a4711(++_0x108fdb);}(_0x6730,0x10b));var _0x0673=function(_0x1d0aee,_0x2c4454){_0x1d0aee=_0x1d0aee-0x0;var _0x34ee2c=_0x6730[_0x1d0aee];return _0x34ee2c;};'use strict';var Sequelize=require(_0x0673('0x0'));module[_0x0673('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x0673('0x2')]},'description':{'type':Sequelize[_0x0673('0x2')]},'status':{'type':Sequelize[_0x0673('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0673('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 ce41288..ff681a1 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 _0x4019=['Automation','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','merge','where','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','destroy','addConditions','Condition','ids','omit','getConditions','findOne','order','pick','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','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','undefined','limit','count','offset','Content-Range','reject','save','then','error','stack','name','send','index'];(function(_0x289a76,_0xd5b36b){var _0x57dc3f=function(_0x34a347){while(--_0x34a347){_0x289a76['push'](_0x289a76['shift']());}};_0x57dc3f(++_0xd5b36b);}(_0x4019,0x138));var _0x9401=function(_0x358451,_0xad8e01){_0x358451=_0x358451-0x0;var _0x553a25=_0x4019[_0x358451];return _0x553a25;};'use strict';var emlformat=require(_0x9401('0x0'));var rimraf=require(_0x9401('0x1'));var zipdir=require(_0x9401('0x2'));var jsonpatch=require(_0x9401('0x3'));var rp=require('request-promise');var moment=require(_0x9401('0x4'));var BPromise=require(_0x9401('0x5'));var Mustache=require('mustache');var util=require(_0x9401('0x6'));var path=require(_0x9401('0x7'));var sox=require(_0x9401('0x8'));var csv=require('to-csv');var ejs=require(_0x9401('0x9'));var fs=require('fs');var fs_extra=require(_0x9401('0xa'));var _=require('lodash');var squel=require(_0x9401('0xb'));var crypto=require(_0x9401('0xc'));var jsforce=require(_0x9401('0xd'));var deskjs=require(_0x9401('0xe'));var toCsv=require(_0x9401('0xf'));var querystring=require(_0x9401('0x10'));var Papa=require(_0x9401('0x11'));var Redis=require('ioredis');var authService=require(_0x9401('0x12'));var qs=require(_0x9401('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9401('0x14'));var logger=require(_0x9401('0x15'))(_0x9401('0x16'));var utils=require(_0x9401('0x17'));var config=require(_0x9401('0x18'));var licenseUtil=require(_0x9401('0x19'));var db=require(_0x9401('0x1a'))['db'];function respondWithStatusCode(_0x1320c0,_0x4a0695){_0x4a0695=_0x4a0695||0xcc;return function(_0x1c142d){if(_0x1c142d){return _0x1320c0[_0x9401('0x1b')](_0x4a0695);}return _0x1320c0[_0x9401('0x1c')](_0x4a0695)[_0x9401('0x1d')]();};}function respondWithResult(_0x2faac3,_0x567415){_0x567415=_0x567415||0xc8;return function(_0x540016){if(_0x540016){return _0x2faac3[_0x9401('0x1c')](_0x567415)[_0x9401('0x1e')](_0x540016);}};}function respondWithFilteredResult(_0x5ddbc0,_0x269fae){return function(_0x4dedbd){if(_0x4dedbd){var _0x4af7b1=typeof _0x269fae['offset']===_0x9401('0x1f')&&typeof _0x269fae[_0x9401('0x20')]===_0x9401('0x1f');var _0x3793eb=_0x4dedbd[_0x9401('0x21')];var _0x4e371c=_0x4af7b1?0x0:_0x269fae[_0x9401('0x22')];var _0x19c920=_0x4af7b1?_0x4dedbd[_0x9401('0x21')]:_0x269fae['offset']+_0x269fae['limit'];var _0x20ae31;if(_0x19c920>=_0x3793eb){_0x19c920=_0x3793eb;_0x20ae31=0xc8;}else{_0x20ae31=0xce;}_0x5ddbc0[_0x9401('0x1c')](_0x20ae31);return _0x5ddbc0['set'](_0x9401('0x23'),_0x4e371c+'-'+_0x19c920+'/'+_0x3793eb)[_0x9401('0x1e')](_0x4dedbd);}return null;};}function patchUpdates(_0xdd1420){return function(_0x3a4ce3){try{jsonpatch['apply'](_0x3a4ce3,_0xdd1420,!![]);}catch(_0x36cc68){return BPromise[_0x9401('0x24')](_0x36cc68);}return _0x3a4ce3[_0x9401('0x25')]();};}function saveUpdates(_0x53d476,_0x2f8d4a){return function(_0x4c0736){if(_0x4c0736){return _0x4c0736['update'](_0x53d476)[_0x9401('0x26')](function(_0x118944){return _0x118944;});}return null;};}function removeEntity(_0x40b16c,_0x283532){return function(_0x4b16d0){if(_0x4b16d0){return _0x4b16d0['destroy']()[_0x9401('0x26')](function(){_0x40b16c[_0x9401('0x1c')](0xcc)[_0x9401('0x1d')]();});}};}function handleEntityNotFound(_0x45af14,_0xeba5ae){return function(_0x4d2750){if(!_0x4d2750){_0x45af14[_0x9401('0x1b')](0x194);}return _0x4d2750;};}function handleError(_0xba5eb5,_0x586215){_0x586215=_0x586215||0x1f4;return function(_0x32a803){logger[_0x9401('0x27')](_0x32a803[_0x9401('0x28')]);if(_0x32a803[_0x9401('0x29')]){delete _0x32a803[_0x9401('0x29')];}_0xba5eb5[_0x9401('0x1c')](_0x586215)[_0x9401('0x2a')](_0x32a803);};}exports[_0x9401('0x2b')]=function(_0x5423e7,_0x577ffc){var _0x39626e={},_0x4ae30b={},_0x2a4a9d={'count':0x0,'rows':[]};var _0x1a306f=_['map'](db[_0x9401('0x2c')]['rawAttributes'],function(_0x16bed5){return{'name':_0x16bed5[_0x9401('0x2d')],'type':_0x16bed5[_0x9401('0x2e')][_0x9401('0x2f')]};});_0x4ae30b[_0x9401('0x30')]=_['map'](_0x1a306f,_0x9401('0x29'));_0x4ae30b[_0x9401('0x31')]=_[_0x9401('0x32')](_0x5423e7[_0x9401('0x31')]);_0x4ae30b['filters']=_[_0x9401('0x33')](_0x4ae30b[_0x9401('0x30')],_0x4ae30b[_0x9401('0x31')]);_0x39626e[_0x9401('0x34')]=_[_0x9401('0x33')](_0x4ae30b[_0x9401('0x30')],qs[_0x9401('0x35')](_0x5423e7[_0x9401('0x31')]['fields']));_0x39626e['attributes']=_0x39626e[_0x9401('0x34')][_0x9401('0x36')]?_0x39626e['attributes']:_0x4ae30b['model'];if(!_0x5423e7[_0x9401('0x31')][_0x9401('0x37')](_0x9401('0x38'))){_0x39626e[_0x9401('0x20')]=qs[_0x9401('0x20')](_0x5423e7[_0x9401('0x31')][_0x9401('0x20')]);_0x39626e[_0x9401('0x22')]=qs[_0x9401('0x22')](_0x5423e7[_0x9401('0x31')][_0x9401('0x22')]);}_0x39626e['order']=qs[_0x9401('0x39')](_0x5423e7[_0x9401('0x31')][_0x9401('0x39')]);_0x39626e['where']=qs[_0x9401('0x3a')](_['pick'](_0x5423e7[_0x9401('0x31')],_0x4ae30b['filters']),_0x1a306f);if(_0x5423e7['query'][_0x9401('0x3b')]){_0x39626e['where']=_[_0x9401('0x3c')](_0x39626e[_0x9401('0x3d')],{'$or':_[_0x9401('0x3e')](_0x1a306f,function(_0x1c0af9){if(_0x1c0af9[_0x9401('0x2e')]!==_0x9401('0x3f')){var _0x486b27={};_0x486b27[_0x1c0af9[_0x9401('0x29')]]={'$like':'%'+_0x5423e7[_0x9401('0x31')]['filter']+'%'};return _0x486b27;}})});}_0x39626e=_[_0x9401('0x3c')]({},_0x39626e,_0x5423e7[_0x9401('0x40')]);var _0x242ff9={'where':_0x39626e[_0x9401('0x3d')]};return db[_0x9401('0x2c')][_0x9401('0x21')](_0x242ff9)['then'](function(_0x51de19){_0x2a4a9d[_0x9401('0x21')]=_0x51de19;if(_0x5423e7[_0x9401('0x31')]['includeAll']){_0x39626e[_0x9401('0x41')]=[{'all':!![]}];}return db[_0x9401('0x2c')][_0x9401('0x42')](_0x39626e);})['then'](function(_0x5c8324){_0x2a4a9d[_0x9401('0x43')]=_0x5c8324;return _0x2a4a9d;})['then'](respondWithFilteredResult(_0x577ffc,_0x39626e))[_0x9401('0x44')](handleError(_0x577ffc,null));};exports[_0x9401('0x45')]=function(_0x34181a,_0x497340){var _0x423cd9={'raw':![],'where':{'id':_0x34181a[_0x9401('0x46')]['id']}},_0x4c7526={};_0x4c7526['model']=_[_0x9401('0x32')](db['Automation'][_0x9401('0x47')]);_0x4c7526[_0x9401('0x31')]=_[_0x9401('0x32')](_0x34181a['query']);_0x4c7526[_0x9401('0x3a')]=_[_0x9401('0x33')](_0x4c7526['model'],_0x4c7526['query']);_0x423cd9[_0x9401('0x34')]=_[_0x9401('0x33')](_0x4c7526[_0x9401('0x30')],qs[_0x9401('0x35')](_0x34181a[_0x9401('0x31')][_0x9401('0x35')]));_0x423cd9['attributes']=_0x423cd9[_0x9401('0x34')][_0x9401('0x36')]?_0x423cd9['attributes']:_0x4c7526[_0x9401('0x30')];if(_0x34181a[_0x9401('0x31')][_0x9401('0x48')]){_0x423cd9['include']=[{'all':!![]}];}_0x423cd9=_['merge']({},_0x423cd9,_0x34181a[_0x9401('0x40')]);return db[_0x9401('0x2c')][_0x9401('0x49')](_0x423cd9)['then'](handleEntityNotFound(_0x497340,null))[_0x9401('0x26')](respondWithResult(_0x497340,null))[_0x9401('0x44')](handleError(_0x497340,null));};exports['create']=function(_0x41c4da,_0x507a71){return db[_0x9401('0x2c')][_0x9401('0x4a')](_0x41c4da[_0x9401('0x4b')],{})[_0x9401('0x26')](respondWithResult(_0x507a71,0xc9))['catch'](handleError(_0x507a71,null));};exports[_0x9401('0x4c')]=function(_0x20fa42,_0x59ccaf){if(_0x20fa42[_0x9401('0x4b')]['id']){delete _0x20fa42[_0x9401('0x4b')]['id'];}return db[_0x9401('0x2c')]['find']({'where':{'id':_0x20fa42[_0x9401('0x46')]['id']}})[_0x9401('0x26')](handleEntityNotFound(_0x59ccaf,null))[_0x9401('0x26')](saveUpdates(_0x20fa42[_0x9401('0x4b')],null))[_0x9401('0x26')](respondWithResult(_0x59ccaf,null))[_0x9401('0x44')](handleError(_0x59ccaf,null));};exports[_0x9401('0x4d')]=function(_0x2f9899,_0x4f3563){return db[_0x9401('0x2c')][_0x9401('0x49')]({'where':{'id':_0x2f9899[_0x9401('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f3563,null))[_0x9401('0x26')](removeEntity(_0x4f3563,null))[_0x9401('0x44')](handleError(_0x4f3563,null));};exports[_0x9401('0x4e')]=function(_0x5218d1,_0x278002,_0x54ffb2){return db[_0x9401('0x4f')][_0x9401('0x49')]({'where':{'id':_0x5218d1[_0x9401('0x46')]['id']}})[_0x9401('0x26')](handleEntityNotFound(_0x278002,null))[_0x9401('0x26')](function(_0x288a45){if(_0x288a45){return _0x288a45['addConditions'](_0x5218d1['body'][_0x9401('0x50')],_[_0x9401('0x51')](_0x5218d1[_0x9401('0x4b')],[_0x9401('0x50'),'id'])||{});}})['then'](respondWithResult(_0x278002,null))[_0x9401('0x44')](handleError(_0x278002,null));};exports[_0x9401('0x52')]=function(_0x2de688,_0x205b38,_0x17be99){var _0x3fec5f={};var _0x938528={};var _0x2bcf1f;var _0x3f974b;return db[_0x9401('0x2c')][_0x9401('0x53')]({'where':{'id':_0x2de688[_0x9401('0x46')]['id']}})[_0x9401('0x26')](handleEntityNotFound(_0x205b38,null))['then'](function(_0x35a72f){if(_0x35a72f){_0x2bcf1f=_0x35a72f;_0x938528['model']=_[_0x9401('0x32')](db[_0x9401('0x4f')]['rawAttributes']);_0x938528[_0x9401('0x31')]=_[_0x9401('0x32')](_0x2de688[_0x9401('0x31')]);_0x938528[_0x9401('0x3a')]=_[_0x9401('0x33')](_0x938528[_0x9401('0x30')],_0x938528[_0x9401('0x31')]);_0x3fec5f['attributes']=_['intersection'](_0x938528['model'],qs['fields'](_0x2de688[_0x9401('0x31')]['fields']));_0x3fec5f['attributes']=_0x3fec5f['attributes'][_0x9401('0x36')]?_0x3fec5f[_0x9401('0x34')]:_0x938528[_0x9401('0x30')];_0x3fec5f[_0x9401('0x54')]=qs[_0x9401('0x39')](_0x2de688[_0x9401('0x31')][_0x9401('0x39')]);_0x3fec5f[_0x9401('0x3d')]=qs[_0x9401('0x3a')](_[_0x9401('0x55')](_0x2de688['query'],_0x938528[_0x9401('0x3a')]));if(_0x2de688[_0x9401('0x31')][_0x9401('0x3b')]){_0x3fec5f[_0x9401('0x3d')]=_[_0x9401('0x3c')](_0x3fec5f[_0x9401('0x3d')],{'$or':_[_0x9401('0x3e')](_0x3fec5f['attributes'],function(_0x234a59){var _0x2f9e66={};_0x2f9e66[_0x234a59]={'$like':'%'+_0x2de688[_0x9401('0x31')][_0x9401('0x3b')]+'%'};return _0x2f9e66;})});}_0x3fec5f=_[_0x9401('0x3c')]({},_0x3fec5f,_0x2de688[_0x9401('0x40')]);return _0x2bcf1f[_0x9401('0x52')](_0x3fec5f);}})[_0x9401('0x26')](function(_0x51882d){if(_0x51882d){_0x3f974b=_0x51882d[_0x9401('0x36')];if(!_0x2de688[_0x9401('0x31')][_0x9401('0x37')]('nolimit')){_0x3fec5f[_0x9401('0x20')]=qs[_0x9401('0x20')](_0x2de688[_0x9401('0x31')]['limit']);_0x3fec5f['offset']=qs[_0x9401('0x22')](_0x2de688[_0x9401('0x31')][_0x9401('0x22')]);}return _0x2bcf1f['getConditions'](_0x3fec5f);}})[_0x9401('0x26')](function(_0x595e95){if(_0x595e95){return _0x595e95?{'count':_0x3f974b,'rows':_0x595e95}:null;}})['then'](respondWithResult(_0x205b38,null))[_0x9401('0x44')](handleError(_0x205b38,null));};exports[_0x9401('0x56')]=function(_0x114020,_0x5d95d7,_0x567de6){return db['Action'][_0x9401('0x49')]({'where':{'id':_0x114020[_0x9401('0x46')]['id']}})[_0x9401('0x26')](handleEntityNotFound(_0x5d95d7,null))[_0x9401('0x26')](function(_0x4f9b11){if(_0x4f9b11){return _0x4f9b11[_0x9401('0x56')](_0x114020[_0x9401('0x4b')]['ids'],_[_0x9401('0x51')](_0x114020['body'],[_0x9401('0x50'),'id'])||{});}})[_0x9401('0x26')](respondWithResult(_0x5d95d7,null))[_0x9401('0x44')](handleError(_0x5d95d7,null));};exports[_0x9401('0x57')]=function(_0x27e2cf,_0x435eb1,_0x4f1f8d){var _0x27f976={};var _0x2a1635={};var _0x4d177f;var _0x2e99cf;return db[_0x9401('0x2c')][_0x9401('0x53')]({'where':{'id':_0x27e2cf['params']['id']}})[_0x9401('0x26')](handleEntityNotFound(_0x435eb1,null))[_0x9401('0x26')](function(_0x4e62da){if(_0x4e62da){_0x4d177f=_0x4e62da;_0x2a1635[_0x9401('0x30')]=_[_0x9401('0x32')](db[_0x9401('0x58')][_0x9401('0x47')]);_0x2a1635[_0x9401('0x31')]=_[_0x9401('0x32')](_0x27e2cf['query']);_0x2a1635[_0x9401('0x3a')]=_['intersection'](_0x2a1635[_0x9401('0x30')],_0x2a1635[_0x9401('0x31')]);_0x27f976[_0x9401('0x34')]=_[_0x9401('0x33')](_0x2a1635[_0x9401('0x30')],qs[_0x9401('0x35')](_0x27e2cf['query']['fields']));_0x27f976[_0x9401('0x34')]=_0x27f976['attributes'][_0x9401('0x36')]?_0x27f976[_0x9401('0x34')]:_0x2a1635['model'];_0x27f976[_0x9401('0x54')]=qs['sort'](_0x27e2cf['query']['sort']);_0x27f976[_0x9401('0x3d')]=qs['filters'](_[_0x9401('0x55')](_0x27e2cf[_0x9401('0x31')],_0x2a1635[_0x9401('0x3a')]));if(_0x27e2cf[_0x9401('0x31')]['filter']){_0x27f976[_0x9401('0x3d')]=_[_0x9401('0x3c')](_0x27f976[_0x9401('0x3d')],{'$or':_[_0x9401('0x3e')](_0x27f976[_0x9401('0x34')],function(_0x3924b3){var _0x579156={};_0x579156[_0x3924b3]={'$like':'%'+_0x27e2cf['query']['filter']+'%'};return _0x579156;})});}_0x27f976=_[_0x9401('0x3c')]({},_0x27f976,_0x27e2cf['options']);return _0x4d177f[_0x9401('0x57')](_0x27f976);}})[_0x9401('0x26')](function(_0xd82ff9){if(_0xd82ff9){_0x2e99cf=_0xd82ff9[_0x9401('0x36')];if(!_0x27e2cf[_0x9401('0x31')][_0x9401('0x37')](_0x9401('0x38'))){_0x27f976['limit']=qs[_0x9401('0x20')](_0x27e2cf[_0x9401('0x31')][_0x9401('0x20')]);_0x27f976[_0x9401('0x22')]=qs[_0x9401('0x22')](_0x27e2cf[_0x9401('0x31')]['offset']);}return _0x4d177f[_0x9401('0x57')](_0x27f976);}})[_0x9401('0x26')](function(_0x5ae02e){if(_0x5ae02e){return _0x5ae02e?{'count':_0x2e99cf,'rows':_0x5ae02e}:null;}})[_0x9401('0x26')](respondWithResult(_0x435eb1,null))[_0x9401('0x44')](handleError(_0x435eb1,null));}; \ No newline at end of file +var _0x5e7a=['squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','then','error','stack','name','send','index','Automation','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','keys','include','options','find','create','body','params','addConditions','Condition','ids','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash'];(function(_0xa4392a,_0x2df99b){var _0x1032ab=function(_0x28f350){while(--_0x28f350){_0xa4392a['push'](_0xa4392a['shift']());}};_0x1032ab(++_0x2df99b);}(_0x5e7a,0x96));var _0xa5e7=function(_0x7b9e83,_0x5e1e5f){_0x7b9e83=_0x7b9e83-0x0;var _0x376a92=_0x5e7a[_0x7b9e83];return _0x376a92;};'use strict';var emlformat=require(_0xa5e7('0x0'));var rimraf=require(_0xa5e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5e7('0x2'));var rp=require(_0xa5e7('0x3'));var moment=require('moment');var BPromise=require(_0xa5e7('0x4'));var Mustache=require('mustache');var util=require(_0xa5e7('0x5'));var path=require(_0xa5e7('0x6'));var sox=require(_0xa5e7('0x7'));var csv=require('to-csv');var ejs=require(_0xa5e7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5e7('0x9'));var squel=require(_0xa5e7('0xa'));var crypto=require(_0xa5e7('0xb'));var jsforce=require(_0xa5e7('0xc'));var deskjs=require(_0xa5e7('0xd'));var toCsv=require(_0xa5e7('0xe'));var querystring=require('querystring');var Papa=require(_0xa5e7('0xf'));var Redis=require(_0xa5e7('0x10'));var authService=require(_0xa5e7('0x11'));var qs=require(_0xa5e7('0x12'));var as=require(_0xa5e7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5e7('0x14'))(_0xa5e7('0x15'));var utils=require(_0xa5e7('0x16'));var config=require(_0xa5e7('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x377378,_0x23b5b8){_0x23b5b8=_0x23b5b8||0xcc;return function(_0x5162a9){if(_0x5162a9){return _0x377378[_0xa5e7('0x18')](_0x23b5b8);}return _0x377378[_0xa5e7('0x19')](_0x23b5b8)['end']();};}function respondWithResult(_0x57f567,_0xeaf07f){_0xeaf07f=_0xeaf07f||0xc8;return function(_0x57fc94){if(_0x57fc94){return _0x57f567[_0xa5e7('0x19')](_0xeaf07f)[_0xa5e7('0x1a')](_0x57fc94);}};}function respondWithFilteredResult(_0x39ee5a,_0x39f0ef){return function(_0x825dea){if(_0x825dea){var _0x463372=typeof _0x39f0ef[_0xa5e7('0x1b')]===_0xa5e7('0x1c')&&typeof _0x39f0ef[_0xa5e7('0x1d')]===_0xa5e7('0x1c');var _0xf794b0=_0x825dea[_0xa5e7('0x1e')];var _0x2b012d=_0x463372?0x0:_0x39f0ef[_0xa5e7('0x1b')];var _0x5bc4eb=_0x463372?_0x825dea['count']:_0x39f0ef['offset']+_0x39f0ef[_0xa5e7('0x1d')];var _0x1f6ba2;if(_0x5bc4eb>=_0xf794b0){_0x5bc4eb=_0xf794b0;_0x1f6ba2=0xc8;}else{_0x1f6ba2=0xce;}_0x39ee5a[_0xa5e7('0x19')](_0x1f6ba2);return _0x39ee5a[_0xa5e7('0x1f')]('Content-Range',_0x2b012d+'-'+_0x5bc4eb+'/'+_0xf794b0)[_0xa5e7('0x1a')](_0x825dea);}return null;};}function patchUpdates(_0x9e7d4c){return function(_0x2a10f7){try{jsonpatch['apply'](_0x2a10f7,_0x9e7d4c,!![]);}catch(_0x520e9b){return BPromise[_0xa5e7('0x20')](_0x520e9b);}return _0x2a10f7['save']();};}function saveUpdates(_0x1c52e2,_0x123788){return function(_0x1af859){if(_0x1af859){return _0x1af859[_0xa5e7('0x21')](_0x1c52e2)[_0xa5e7('0x22')](function(_0x2ee6d1){return _0x2ee6d1;});}return null;};}function removeEntity(_0x5ab225,_0x2304bd){return function(_0x2ee1a6){if(_0x2ee1a6){return _0x2ee1a6['destroy']()[_0xa5e7('0x22')](function(){_0x5ab225['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x398b19,_0x1a1990){return function(_0x33abe9){if(!_0x33abe9){_0x398b19[_0xa5e7('0x18')](0x194);}return _0x33abe9;};}function handleError(_0x185643,_0x44b682){_0x44b682=_0x44b682||0x1f4;return function(_0x35c766){logger[_0xa5e7('0x23')](_0x35c766[_0xa5e7('0x24')]);if(_0x35c766['name']){delete _0x35c766[_0xa5e7('0x25')];}_0x185643['status'](_0x44b682)[_0xa5e7('0x26')](_0x35c766);};}exports[_0xa5e7('0x27')]=function(_0x443604,_0x1ba04c){var _0xca314e={},_0x18b14a={},_0x180ac4={'count':0x0,'rows':[]};var _0x534ce4=_['map'](db[_0xa5e7('0x28')][_0xa5e7('0x29')],function(_0x36fe8b){return{'name':_0x36fe8b['fieldName'],'type':_0x36fe8b[_0xa5e7('0x2a')][_0xa5e7('0x2b')]};});_0x18b14a[_0xa5e7('0x2c')]=_[_0xa5e7('0x2d')](_0x534ce4,'name');_0x18b14a[_0xa5e7('0x2e')]=_['keys'](_0x443604[_0xa5e7('0x2e')]);_0x18b14a[_0xa5e7('0x2f')]=_[_0xa5e7('0x30')](_0x18b14a[_0xa5e7('0x2c')],_0x18b14a['query']);_0xca314e[_0xa5e7('0x31')]=_[_0xa5e7('0x30')](_0x18b14a['model'],qs[_0xa5e7('0x32')](_0x443604[_0xa5e7('0x2e')][_0xa5e7('0x32')]));_0xca314e['attributes']=_0xca314e[_0xa5e7('0x31')][_0xa5e7('0x33')]?_0xca314e[_0xa5e7('0x31')]:_0x18b14a[_0xa5e7('0x2c')];if(!_0x443604[_0xa5e7('0x2e')]['hasOwnProperty'](_0xa5e7('0x34'))){_0xca314e['limit']=qs[_0xa5e7('0x1d')](_0x443604['query'][_0xa5e7('0x1d')]);_0xca314e[_0xa5e7('0x1b')]=qs[_0xa5e7('0x1b')](_0x443604[_0xa5e7('0x2e')][_0xa5e7('0x1b')]);}_0xca314e[_0xa5e7('0x35')]=qs[_0xa5e7('0x36')](_0x443604[_0xa5e7('0x2e')][_0xa5e7('0x36')]);_0xca314e[_0xa5e7('0x37')]=qs[_0xa5e7('0x2f')](_[_0xa5e7('0x38')](_0x443604[_0xa5e7('0x2e')],_0x18b14a[_0xa5e7('0x2f')]),_0x534ce4);if(_0x443604[_0xa5e7('0x2e')][_0xa5e7('0x39')]){_0xca314e[_0xa5e7('0x37')]=_[_0xa5e7('0x3a')](_0xca314e[_0xa5e7('0x37')],{'$or':_[_0xa5e7('0x2d')](_0x534ce4,function(_0x37479d){if(_0x37479d[_0xa5e7('0x2a')]!==_0xa5e7('0x3b')){var _0x3f961f={};_0x3f961f[_0x37479d[_0xa5e7('0x25')]]={'$like':'%'+_0x443604[_0xa5e7('0x2e')][_0xa5e7('0x39')]+'%'};return _0x3f961f;}})});}_0xca314e=_['merge']({},_0xca314e,_0x443604['options']);var _0x4d5614={'where':_0xca314e[_0xa5e7('0x37')]};return db[_0xa5e7('0x28')][_0xa5e7('0x1e')](_0x4d5614)[_0xa5e7('0x22')](function(_0x240c29){_0x180ac4[_0xa5e7('0x1e')]=_0x240c29;if(_0x443604[_0xa5e7('0x2e')][_0xa5e7('0x3c')]){_0xca314e['include']=[{'all':!![]}];}return db[_0xa5e7('0x28')][_0xa5e7('0x3d')](_0xca314e);})[_0xa5e7('0x22')](function(_0x2dd393){_0x180ac4['rows']=_0x2dd393;return _0x180ac4;})[_0xa5e7('0x22')](respondWithFilteredResult(_0x1ba04c,_0xca314e))[_0xa5e7('0x3e')](handleError(_0x1ba04c,null));};exports[_0xa5e7('0x3f')]=function(_0x5bd47e,_0x18bc74){var _0x3c88b7={'raw':![],'where':{'id':_0x5bd47e['params']['id']}},_0x5ccc12={};_0x5ccc12[_0xa5e7('0x2c')]=_[_0xa5e7('0x40')](db[_0xa5e7('0x28')]['rawAttributes']);_0x5ccc12[_0xa5e7('0x2e')]=_[_0xa5e7('0x40')](_0x5bd47e['query']);_0x5ccc12[_0xa5e7('0x2f')]=_[_0xa5e7('0x30')](_0x5ccc12['model'],_0x5ccc12['query']);_0x3c88b7['attributes']=_['intersection'](_0x5ccc12[_0xa5e7('0x2c')],qs[_0xa5e7('0x32')](_0x5bd47e[_0xa5e7('0x2e')][_0xa5e7('0x32')]));_0x3c88b7[_0xa5e7('0x31')]=_0x3c88b7[_0xa5e7('0x31')][_0xa5e7('0x33')]?_0x3c88b7[_0xa5e7('0x31')]:_0x5ccc12[_0xa5e7('0x2c')];if(_0x5bd47e[_0xa5e7('0x2e')][_0xa5e7('0x3c')]){_0x3c88b7[_0xa5e7('0x41')]=[{'all':!![]}];}_0x3c88b7=_[_0xa5e7('0x3a')]({},_0x3c88b7,_0x5bd47e[_0xa5e7('0x42')]);return db[_0xa5e7('0x28')][_0xa5e7('0x43')](_0x3c88b7)[_0xa5e7('0x22')](handleEntityNotFound(_0x18bc74,null))[_0xa5e7('0x22')](respondWithResult(_0x18bc74,null))[_0xa5e7('0x3e')](handleError(_0x18bc74,null));};exports[_0xa5e7('0x44')]=function(_0x525713,_0x527e53){return db[_0xa5e7('0x28')][_0xa5e7('0x44')](_0x525713[_0xa5e7('0x45')],{})[_0xa5e7('0x22')](respondWithResult(_0x527e53,0xc9))[_0xa5e7('0x3e')](handleError(_0x527e53,null));};exports['update']=function(_0x12be36,_0x16bfbf){if(_0x12be36[_0xa5e7('0x45')]['id']){delete _0x12be36['body']['id'];}return db[_0xa5e7('0x28')][_0xa5e7('0x43')]({'where':{'id':_0x12be36[_0xa5e7('0x46')]['id']}})['then'](handleEntityNotFound(_0x16bfbf,null))['then'](saveUpdates(_0x12be36[_0xa5e7('0x45')],null))['then'](respondWithResult(_0x16bfbf,null))[_0xa5e7('0x3e')](handleError(_0x16bfbf,null));};exports['destroy']=function(_0x22e512,_0x1c31d2){return db[_0xa5e7('0x28')]['find']({'where':{'id':_0x22e512[_0xa5e7('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c31d2,null))[_0xa5e7('0x22')](removeEntity(_0x1c31d2,null))[_0xa5e7('0x3e')](handleError(_0x1c31d2,null));};exports[_0xa5e7('0x47')]=function(_0x18686a,_0x79c67b,_0x172f41){return db[_0xa5e7('0x48')]['find']({'where':{'id':_0x18686a[_0xa5e7('0x46')]['id']}})[_0xa5e7('0x22')](handleEntityNotFound(_0x79c67b,null))[_0xa5e7('0x22')](function(_0x36188d){if(_0x36188d){return _0x36188d['addConditions'](_0x18686a['body'][_0xa5e7('0x49')],_['omit'](_0x18686a['body'],[_0xa5e7('0x49'),'id'])||{});}})['then'](respondWithResult(_0x79c67b,null))[_0xa5e7('0x3e')](handleError(_0x79c67b,null));};exports[_0xa5e7('0x4a')]=function(_0x328f84,_0x4c25f7,_0x37206f){var _0x36993c={};var _0x487f20={};var _0x1bff9e;var _0x10db75;return db[_0xa5e7('0x28')][_0xa5e7('0x4b')]({'where':{'id':_0x328f84['params']['id']}})[_0xa5e7('0x22')](handleEntityNotFound(_0x4c25f7,null))[_0xa5e7('0x22')](function(_0x4d3732){if(_0x4d3732){_0x1bff9e=_0x4d3732;_0x487f20[_0xa5e7('0x2c')]=_[_0xa5e7('0x40')](db['Condition']['rawAttributes']);_0x487f20[_0xa5e7('0x2e')]=_[_0xa5e7('0x40')](_0x328f84[_0xa5e7('0x2e')]);_0x487f20[_0xa5e7('0x2f')]=_[_0xa5e7('0x30')](_0x487f20[_0xa5e7('0x2c')],_0x487f20[_0xa5e7('0x2e')]);_0x36993c[_0xa5e7('0x31')]=_['intersection'](_0x487f20[_0xa5e7('0x2c')],qs[_0xa5e7('0x32')](_0x328f84[_0xa5e7('0x2e')][_0xa5e7('0x32')]));_0x36993c[_0xa5e7('0x31')]=_0x36993c['attributes'][_0xa5e7('0x33')]?_0x36993c[_0xa5e7('0x31')]:_0x487f20[_0xa5e7('0x2c')];_0x36993c[_0xa5e7('0x35')]=qs['sort'](_0x328f84[_0xa5e7('0x2e')][_0xa5e7('0x36')]);_0x36993c['where']=qs['filters'](_['pick'](_0x328f84[_0xa5e7('0x2e')],_0x487f20[_0xa5e7('0x2f')]));if(_0x328f84[_0xa5e7('0x2e')][_0xa5e7('0x39')]){_0x36993c[_0xa5e7('0x37')]=_[_0xa5e7('0x3a')](_0x36993c[_0xa5e7('0x37')],{'$or':_[_0xa5e7('0x2d')](_0x36993c[_0xa5e7('0x31')],function(_0x560654){var _0x4027af={};_0x4027af[_0x560654]={'$like':'%'+_0x328f84[_0xa5e7('0x2e')]['filter']+'%'};return _0x4027af;})});}_0x36993c=_[_0xa5e7('0x3a')]({},_0x36993c,_0x328f84['options']);return _0x1bff9e[_0xa5e7('0x4a')](_0x36993c);}})[_0xa5e7('0x22')](function(_0x33276a){if(_0x33276a){_0x10db75=_0x33276a[_0xa5e7('0x33')];if(!_0x328f84[_0xa5e7('0x2e')][_0xa5e7('0x4c')](_0xa5e7('0x34'))){_0x36993c[_0xa5e7('0x1d')]=qs[_0xa5e7('0x1d')](_0x328f84['query']['limit']);_0x36993c[_0xa5e7('0x1b')]=qs[_0xa5e7('0x1b')](_0x328f84[_0xa5e7('0x2e')][_0xa5e7('0x1b')]);}return _0x1bff9e[_0xa5e7('0x4a')](_0x36993c);}})[_0xa5e7('0x22')](function(_0x7dd788){if(_0x7dd788){return _0x7dd788?{'count':_0x10db75,'rows':_0x7dd788}:null;}})['then'](respondWithResult(_0x4c25f7,null))['catch'](handleError(_0x4c25f7,null));};exports[_0xa5e7('0x4d')]=function(_0x36333f,_0x3a1485,_0x43d5e4){return db[_0xa5e7('0x4e')]['find']({'where':{'id':_0x36333f[_0xa5e7('0x46')]['id']}})[_0xa5e7('0x22')](handleEntityNotFound(_0x3a1485,null))[_0xa5e7('0x22')](function(_0x5ebef5){if(_0x5ebef5){return _0x5ebef5[_0xa5e7('0x4d')](_0x36333f['body'][_0xa5e7('0x49')],_['omit'](_0x36333f[_0xa5e7('0x45')],[_0xa5e7('0x49'),'id'])||{});}})[_0xa5e7('0x22')](respondWithResult(_0x3a1485,null))['catch'](handleError(_0x3a1485,null));};exports[_0xa5e7('0x4f')]=function(_0x4033ac,_0x3a4043,_0x3364be){var _0x19ad5d={};var _0x25440f={};var _0x1e0375;var _0x442ffc;return db[_0xa5e7('0x28')][_0xa5e7('0x4b')]({'where':{'id':_0x4033ac[_0xa5e7('0x46')]['id']}})[_0xa5e7('0x22')](handleEntityNotFound(_0x3a4043,null))['then'](function(_0x22805a){if(_0x22805a){_0x1e0375=_0x22805a;_0x25440f[_0xa5e7('0x2c')]=_[_0xa5e7('0x40')](db[_0xa5e7('0x4e')][_0xa5e7('0x29')]);_0x25440f['query']=_[_0xa5e7('0x40')](_0x4033ac[_0xa5e7('0x2e')]);_0x25440f[_0xa5e7('0x2f')]=_[_0xa5e7('0x30')](_0x25440f['model'],_0x25440f[_0xa5e7('0x2e')]);_0x19ad5d['attributes']=_[_0xa5e7('0x30')](_0x25440f[_0xa5e7('0x2c')],qs['fields'](_0x4033ac[_0xa5e7('0x2e')][_0xa5e7('0x32')]));_0x19ad5d['attributes']=_0x19ad5d['attributes'][_0xa5e7('0x33')]?_0x19ad5d[_0xa5e7('0x31')]:_0x25440f[_0xa5e7('0x2c')];_0x19ad5d[_0xa5e7('0x35')]=qs[_0xa5e7('0x36')](_0x4033ac[_0xa5e7('0x2e')][_0xa5e7('0x36')]);_0x19ad5d[_0xa5e7('0x37')]=qs['filters'](_[_0xa5e7('0x38')](_0x4033ac['query'],_0x25440f[_0xa5e7('0x2f')]));if(_0x4033ac[_0xa5e7('0x2e')][_0xa5e7('0x39')]){_0x19ad5d[_0xa5e7('0x37')]=_[_0xa5e7('0x3a')](_0x19ad5d[_0xa5e7('0x37')],{'$or':_[_0xa5e7('0x2d')](_0x19ad5d[_0xa5e7('0x31')],function(_0x10802d){var _0x11bab1={};_0x11bab1[_0x10802d]={'$like':'%'+_0x4033ac[_0xa5e7('0x2e')][_0xa5e7('0x39')]+'%'};return _0x11bab1;})});}_0x19ad5d=_[_0xa5e7('0x3a')]({},_0x19ad5d,_0x4033ac['options']);return _0x1e0375[_0xa5e7('0x4f')](_0x19ad5d);}})[_0xa5e7('0x22')](function(_0xbd79ca){if(_0xbd79ca){_0x442ffc=_0xbd79ca[_0xa5e7('0x33')];if(!_0x4033ac['query'][_0xa5e7('0x4c')]('nolimit')){_0x19ad5d['limit']=qs[_0xa5e7('0x1d')](_0x4033ac[_0xa5e7('0x2e')][_0xa5e7('0x1d')]);_0x19ad5d['offset']=qs[_0xa5e7('0x1b')](_0x4033ac[_0xa5e7('0x2e')][_0xa5e7('0x1b')]);}return _0x1e0375[_0xa5e7('0x4f')](_0x19ad5d);}})['then'](function(_0x6d655f){if(_0x6d655f){return _0x6d655f?{'count':_0x442ffc,'rows':_0x6d655f}:null;}})[_0xa5e7('0x22')](respondWithResult(_0x3a4043,null))['catch'](handleError(_0x3a4043,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 9c4b6ea..3140eda 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 _0xcb55=['tools_automations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xcb55,0x1ae));var _0x5cb5=function(_0x338de4,_0x11cfa3){_0x338de4=_0x338de4-0x0;var _0x3c5391=_0xcb55[_0x338de4];return _0x3c5391;};'use strict';var _=require('lodash');var util=require(_0x5cb5('0x0'));var logger=require(_0x5cb5('0x1'))(_0x5cb5('0x2'));var moment=require(_0x5cb5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5cb5('0x4'));var fs=require('fs');var path=require(_0x5cb5('0x5'));var rimraf=require(_0x5cb5('0x6'));var config=require(_0x5cb5('0x7'));var attributes=require(_0x5cb5('0x8'));module[_0x5cb5('0x9')]=function(_0x432764,_0xda57c9){return _0x432764[_0x5cb5('0xa')](_0x5cb5('0xb'),attributes,{'tableName':_0x5cb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ca4=['Automation','tools_automations','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0xc270de,_0x589127){var _0x3f9868=function(_0x2ae065){while(--_0x2ae065){_0xc270de['push'](_0xc270de['shift']());}};_0x3f9868(++_0x589127);}(_0x9ca4,0xde));var _0x49ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ca4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x49ca('0x0'));var logger=require(_0x49ca('0x1'))('api');var moment=require(_0x49ca('0x2'));var BPromise=require(_0x49ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x49ca('0x4'));var config=require(_0x49ca('0x5'));var attributes=require(_0x49ca('0x6'));module[_0x49ca('0x7')]=function(_0x51721b,_0xdf1140){return _0x51721b[_0x49ca('0x8')](_0x49ca('0x9'),attributes,{'tableName':_0x49ca('0xa'),'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 64da6d8..84fa2d9 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 _0xd824=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xd824,0xc2));var _0x4d82=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd824[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('Automation,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});} \ No newline at end of file +var _0xa064=['stringify','error','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x249206,_0x4526fb){var _0xa1c48c=function(_0x3ae129){while(--_0x3ae129){_0x249206['push'](_0x249206['shift']());}};_0xa1c48c(++_0x4526fb);}(_0xa064,0x192));var _0x4a06=function(_0x3dc089,_0x5ccb0d){_0x3dc089=_0x3dc089-0x0;var _0x34d9d3=_0xa064[_0x3dc089];return _0x34d9d3;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('Automation,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2bf0967..ca4c645 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 _0xdeee=['get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','post','addActions','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x1b3fc1,_0x12ddb3){var _0x5ba8bb=function(_0x2f66dd){while(--_0x2f66dd){_0x1b3fc1['push'](_0x1b3fc1['shift']());}};_0x5ba8bb(++_0x12ddb3);}(_0xdeee,0x10a));var _0xedee=function(_0x5a25ed,_0x401f55){_0x5a25ed=_0x5a25ed-0x0;var _0x4b0954=_0xdeee[_0x5a25ed];return _0x4b0954;};'use strict';var multer=require('multer');var util=require(_0xedee('0x0'));var path=require(_0xedee('0x1'));var timeout=require(_0xedee('0x2'));var express=require(_0xedee('0x3'));var router=express[_0xedee('0x4')]();var fs_extra=require(_0xedee('0x5'));var auth=require(_0xedee('0x6'));var interaction=require(_0xedee('0x7'));var config=require(_0xedee('0x8'));var controller=require(_0xedee('0x9'));router[_0xedee('0xa')]('/',auth[_0xedee('0xb')](),controller[_0xedee('0xc')]);router[_0xedee('0xa')](_0xedee('0xd'),auth[_0xedee('0xb')](),controller[_0xedee('0xe')]);router['get'](_0xedee('0xf'),auth[_0xedee('0xb')](),controller['getConditions']);router[_0xedee('0xa')](_0xedee('0x10'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0xedee('0xb')](),controller['create']);router[_0xedee('0x11')](_0xedee('0xf'),auth[_0xedee('0xb')](),controller['addConditions']);router[_0xedee('0x11')](_0xedee('0x10'),auth[_0xedee('0xb')](),controller[_0xedee('0x12')]);router[_0xedee('0x13')]('/:id',auth[_0xedee('0xb')](),controller[_0xedee('0x14')]);router[_0xedee('0x15')]('/:id',auth[_0xedee('0xb')](),controller['destroy']);module[_0xedee('0x16')]=router; \ No newline at end of file +var _0xd1b3=['/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions'];(function(_0x450b00,_0x1cc659){var _0x219b54=function(_0x46fd91){while(--_0x46fd91){_0x450b00['push'](_0x450b00['shift']());}};_0x219b54(++_0x1cc659);}(_0xd1b3,0xec));var _0x3d1b=function(_0x203c83,_0x3441aa){_0x203c83=_0x203c83-0x0;var _0x127ee4=_0xd1b3[_0x203c83];return _0x127ee4;};'use strict';var multer=require(_0x3d1b('0x0'));var util=require(_0x3d1b('0x1'));var path=require(_0x3d1b('0x2'));var timeout=require(_0x3d1b('0x3'));var express=require(_0x3d1b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3d1b('0x5'));var config=require(_0x3d1b('0x6'));var controller=require(_0x3d1b('0x7'));router[_0x3d1b('0x8')]('/',auth[_0x3d1b('0x9')](),controller[_0x3d1b('0xa')]);router[_0x3d1b('0x8')](_0x3d1b('0xb'),auth[_0x3d1b('0x9')](),controller[_0x3d1b('0xc')]);router[_0x3d1b('0x8')]('/:id/conditions',auth[_0x3d1b('0x9')](),controller[_0x3d1b('0xd')]);router[_0x3d1b('0x8')](_0x3d1b('0xe'),auth[_0x3d1b('0x9')](),controller[_0x3d1b('0xf')]);router[_0x3d1b('0x10')]('/',auth[_0x3d1b('0x9')](),controller[_0x3d1b('0x11')]);router[_0x3d1b('0x10')](_0x3d1b('0x12'),auth['isAuthenticated'](),controller[_0x3d1b('0x13')]);router[_0x3d1b('0x10')](_0x3d1b('0xe'),auth[_0x3d1b('0x9')](),controller[_0x3d1b('0x14')]);router['put'](_0x3d1b('0xb'),auth['isAuthenticated'](),controller[_0x3d1b('0x15')]);router[_0x3d1b('0x16')]('/:id',auth[_0x3d1b('0x9')](),controller[_0x3d1b('0x17')]);module[_0x3d1b('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 65ce927..3f52752 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 _0x9f31=['Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','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)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN'];(function(_0x565b4c,_0x8cee7d){var _0x4bbe33=function(_0x14d003){while(--_0x14d003){_0x565b4c['push'](_0x565b4c['shift']());}};_0x4bbe33(++_0x8cee7d);}(_0x9f31,0x8d));var _0x19f3=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x9f31[_0x3efe87];return _0x56a4cc;};'use strict';var Sequelize=require(_0x19f3('0x0'));module[_0x19f3('0x1')]={'name':{'type':Sequelize[_0x19f3('0x2')],'unique':_0x19f3('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x19f3('0x4')](_0x19f3('0x5')),'allowNull':![],'defaultValue':_0x19f3('0x5')},'description':{'type':Sequelize[_0x19f3('0x2')]},'active':{'type':Sequelize[_0x19f3('0x6')],'defaultValue':0x0,'comment':_0x19f3('0x7')},'limitCalls':{'type':Sequelize[_0x19f3('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x19f3('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x19f3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x19f3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x19f3('0x8')](0x3)[_0x19f3('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x19f3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x19f3('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19f3('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x19f3('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19f3('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x19f3('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19f3('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x19f3('0x8')](0x3)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x19f3('0x11')},'dialTimezone':{'type':Sequelize[_0x19f3('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x19f3('0x2')],'defaultValue':_0x19f3('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x19f3('0x4')](_0x19f3('0x13'),_0x19f3('0x14'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x19f3('0x15')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x19f3('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x19f3('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x19f3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x19f3('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x19f3('0x8')](0x9)[_0x19f3('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x19f3('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x19f3('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x19f3('0x8')](0x9)[_0x19f3('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x19f3('0x8')](0x9)[_0x19f3('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x19f3('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x19f3('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x19f3('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x19f3('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x19f3('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x19f3('0x4')](_0x19f3('0x1d'),'ASC'),'defaultValue':_0x19f3('0x1d')},'dialPrefix':{'type':Sequelize[_0x19f3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x19f3('0x8')](0x3)[_0x19f3('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x19f3('0x1e')},'dialCutDigit':{'type':Sequelize[_0x19f3('0x8')](0x3)[_0x19f3('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x19f3('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x19f3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x19f3('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x19f3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19f3('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x19f3('0x8')](0x3)[_0x19f3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19f3('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x19f3('0x8')](0x3)[_0x19f3('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x19f3('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x19f3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x19f3('0x8')](0x5)[_0x19f3('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19f3('0x24')}}; \ No newline at end of file +var _0xca50=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x4e5cc,_0x4a79cd){var _0x252a7d=function(_0x1ca859){while(--_0x1ca859){_0x4e5cc['push'](_0x4e5cc['shift']());}};_0x252a7d(++_0x4a79cd);}(_0xca50,0xaf));var _0x0ca5=function(_0x55b1c3,_0x24c819){_0x55b1c3=_0x55b1c3-0x0;var _0x5f519d=_0xca50[_0x55b1c3];return _0x5f519d;};'use strict';var Sequelize=require(_0x0ca5('0x0'));module[_0x0ca5('0x1')]={'name':{'type':Sequelize[_0x0ca5('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0ca5('0x3')),'allowNull':![],'defaultValue':_0x0ca5('0x3')},'description':{'type':Sequelize[_0x0ca5('0x2')]},'active':{'type':Sequelize[_0x0ca5('0x4')],'defaultValue':0x0,'comment':_0x0ca5('0x5')},'limitCalls':{'type':Sequelize[_0x0ca5('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0ca5('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0ca5('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0ca5('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0ca5('0x6')](0x3)[_0x0ca5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0ca5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0ca5('0x6')](0x5)[_0x0ca5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0ca5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ca5('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0ca5('0x6')](0x3)[_0x0ca5('0x8')],'defaultValue':0x3,'comment':_0x0ca5('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0ca5('0x6')](0x5)[_0x0ca5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ca5('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0ca5('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0ca5('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0ca5('0x2')],'defaultValue':_0x0ca5('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0ca5('0x11'),'never',_0x0ca5('0x12')),'defaultValue':_0x0ca5('0x11')},'dialAMDActive':{'type':Sequelize[_0x0ca5('0x4')],'defaultValue':0x0,'comment':_0x0ca5('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0ca5('0x6')](0x9)[_0x0ca5('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0ca5('0x6')](0x9)[_0x0ca5('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0ca5('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0ca5('0x6')](0x9)[_0x0ca5('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0ca5('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0ca5('0x6')](0x9)[_0x0ca5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0ca5('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0ca5('0x6')](0x9)[_0x0ca5('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0ca5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0ca5('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0ca5('0x6')](0x9)[_0x0ca5('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0ca5('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0ca5('0x6')](0x5)[_0x0ca5('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0ca5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0ca5('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0ca5('0x1a')](_0x0ca5('0x1b'),_0x0ca5('0x1c')),'defaultValue':_0x0ca5('0x1b')},'dialPrefix':{'type':Sequelize[_0x0ca5('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0ca5('0x6')](0x3)[_0x0ca5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0ca5('0x1d')},'dialCutDigit':{'type':Sequelize[_0x0ca5('0x6')](0x3)[_0x0ca5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0ca5('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0ca5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0ca5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ca5('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0ca5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0ca5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ca5('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0ca5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0ca5('0x6')](0x5)[_0x0ca5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ca5('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x0ca5('0x6')](0x3)[_0x0ca5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ca5('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0ca5('0x6')](0x3)[_0x0ca5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0ca5('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0ca5('0x28')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 81f958f..690eecb 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 _0xf24b=['field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','into','fromQuery','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','h.id','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','autoAssociation','update','getHoppers','findOne','CmHopper','order','CampaignId','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','select'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xf24b,0xad));var _0xbf24=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0xf24b[_0x503cd5];return _0x1fdf1e;};'use strict';var emlformat=require(_0xbf24('0x0'));var rimraf=require(_0xbf24('0x1'));var zipdir=require(_0xbf24('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf24('0x3'));var moment=require('moment');var BPromise=require(_0xbf24('0x4'));var Mustache=require(_0xbf24('0x5'));var util=require('util');var path=require(_0xbf24('0x6'));var sox=require(_0xbf24('0x7'));var csv=require(_0xbf24('0x8'));var ejs=require(_0xbf24('0x9'));var fs=require('fs');var fs_extra=require(_0xbf24('0xa'));var _=require('lodash');var squel=require(_0xbf24('0xb'));var crypto=require(_0xbf24('0xc'));var jsforce=require(_0xbf24('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbf24('0xe'));var Papa=require(_0xbf24('0xf'));var Redis=require(_0xbf24('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbf24('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf24('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbf24('0x13'));var config=require(_0xbf24('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf24('0x15'))['db'];function respondWithStatusCode(_0x582416,_0x3d5e1a){_0x3d5e1a=_0x3d5e1a||0xcc;return function(_0x131e4e){if(_0x131e4e){return _0x582416[_0xbf24('0x16')](_0x3d5e1a);}return _0x582416[_0xbf24('0x17')](_0x3d5e1a)['end']();};}function respondWithResult(_0x427955,_0xe8167d){_0xe8167d=_0xe8167d||0xc8;return function(_0x48b88a){if(_0x48b88a){return _0x427955['status'](_0xe8167d)[_0xbf24('0x18')](_0x48b88a);}};}function respondWithFilteredResult(_0x3bbe79,_0x57a64f){return function(_0x1c47f2){if(_0x1c47f2){var _0xadde70=typeof _0x57a64f[_0xbf24('0x19')]==='undefined'&&typeof _0x57a64f[_0xbf24('0x1a')]==='undefined';var _0x49bea9=_0x1c47f2[_0xbf24('0x1b')];var _0x1897fe=_0xadde70?0x0:_0x57a64f[_0xbf24('0x19')];var _0x4907b9=_0xadde70?_0x1c47f2[_0xbf24('0x1b')]:_0x57a64f[_0xbf24('0x19')]+_0x57a64f[_0xbf24('0x1a')];var _0x3ffac2;if(_0x4907b9>=_0x49bea9){_0x4907b9=_0x49bea9;_0x3ffac2=0xc8;}else{_0x3ffac2=0xce;}_0x3bbe79['status'](_0x3ffac2);return _0x3bbe79[_0xbf24('0x1c')](_0xbf24('0x1d'),_0x1897fe+'-'+_0x4907b9+'/'+_0x49bea9)['json'](_0x1c47f2);}return null;};}function patchUpdates(_0x4c849a){return function(_0xb8d31d){try{jsonpatch['apply'](_0xb8d31d,_0x4c849a,!![]);}catch(_0x451bbd){return BPromise[_0xbf24('0x1e')](_0x451bbd);}return _0xb8d31d['save']();};}function saveUpdates(_0x28cf58,_0x147032){return function(_0x23622a){if(_0x23622a){return _0x23622a['update'](_0x28cf58)[_0xbf24('0x1f')](function(_0x28a6bb){return _0x28a6bb;});}return null;};}function removeEntity(_0x1c5020,_0x375291){return function(_0x292646){if(_0x292646){return _0x292646[_0xbf24('0x20')]()[_0xbf24('0x1f')](function(){var _0x482e18=_0x292646['get']({'plain':!![]});var _0x38d51c=_0xbf24('0x21');return db[_0xbf24('0x22')][_0xbf24('0x20')]({'where':{'type':_0x38d51c,'resourceId':_0x482e18['id']}})[_0xbf24('0x1f')](function(){return _0x292646;});})[_0xbf24('0x1f')](function(){_0x1c5020[_0xbf24('0x17')](0xcc)[_0xbf24('0x23')]();});}};}function handleEntityNotFound(_0x47645c,_0x14c84e){return function(_0x278428){if(!_0x278428){_0x47645c[_0xbf24('0x16')](0x194);}return _0x278428;};}function handleError(_0x3bbf8a,_0x238e35){_0x238e35=_0x238e35||0x1f4;return function(_0x235985){logger[_0xbf24('0x24')](_0x235985[_0xbf24('0x25')]);if(_0x235985[_0xbf24('0x26')]){delete _0x235985[_0xbf24('0x26')];}_0x3bbf8a['status'](_0x238e35)[_0xbf24('0x27')](_0x235985);};}exports[_0xbf24('0x28')]=function(_0x17dd94,_0x58eafa){var _0x8c12fc={},_0x412dc4={},_0x5449e8={'count':0x0,'rows':[]};var _0x59e8a6=_[_0xbf24('0x29')](db[_0xbf24('0x2a')]['rawAttributes'],function(_0x2ad3a0){return{'name':_0x2ad3a0[_0xbf24('0x2b')],'type':_0x2ad3a0['type'][_0xbf24('0x2c')]};});_0x412dc4['model']=_['map'](_0x59e8a6,_0xbf24('0x26'));_0x412dc4[_0xbf24('0x2d')]=_[_0xbf24('0x2e')](_0x17dd94[_0xbf24('0x2d')]);_0x412dc4[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x412dc4['model'],_0x412dc4[_0xbf24('0x2d')]);_0x8c12fc[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x412dc4[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x17dd94['query'][_0xbf24('0x33')]));_0x8c12fc[_0xbf24('0x31')]=_0x8c12fc[_0xbf24('0x31')][_0xbf24('0x34')]?_0x8c12fc[_0xbf24('0x31')]:_0x412dc4[_0xbf24('0x32')];if(!_0x17dd94['query'][_0xbf24('0x35')]('nolimit')){_0x8c12fc['limit']=qs[_0xbf24('0x1a')](_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x1a')]);_0x8c12fc[_0xbf24('0x19')]=qs[_0xbf24('0x19')](_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x19')]);}_0x8c12fc['order']=qs[_0xbf24('0x36')](_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x36')]);_0x8c12fc[_0xbf24('0x37')]=qs['filters'](_[_0xbf24('0x38')](_0x17dd94[_0xbf24('0x2d')],_0x412dc4[_0xbf24('0x2f')]),_0x59e8a6);if(_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x39')]){_0x8c12fc[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x8c12fc[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x59e8a6,function(_0x1f46f6){if(_0x1f46f6[_0xbf24('0x3b')]!==_0xbf24('0x3c')){var _0x3792f5={};_0x3792f5[_0x1f46f6['name']]={'$like':'%'+_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x3792f5;}})});}_0x8c12fc=_[_0xbf24('0x3a')]({},_0x8c12fc,_0x17dd94[_0xbf24('0x3d')]);var _0x3d2a7e={'where':_0x8c12fc['where']};return db[_0xbf24('0x2a')][_0xbf24('0x1b')](_0x3d2a7e)[_0xbf24('0x1f')](function(_0x154b6c){_0x5449e8['count']=_0x154b6c;if(_0x17dd94[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x8c12fc[_0xbf24('0x3f')]=[{'all':!![]}];}return db[_0xbf24('0x2a')][_0xbf24('0x40')](_0x8c12fc);})[_0xbf24('0x1f')](function(_0x5d0fc0){_0x5449e8[_0xbf24('0x41')]=_0x5d0fc0;return _0x5449e8;})[_0xbf24('0x1f')](respondWithFilteredResult(_0x58eafa,_0x8c12fc))[_0xbf24('0x42')](handleError(_0x58eafa,null));};exports[_0xbf24('0x43')]=function(_0x5abda5,_0x1b81b4){var _0x60f9a8={'raw':![],'where':{'id':_0x5abda5['params']['id']}},_0x10b0b5={};_0x10b0b5[_0xbf24('0x32')]=_[_0xbf24('0x2e')](db[_0xbf24('0x2a')][_0xbf24('0x44')]);_0x10b0b5[_0xbf24('0x2d')]=_[_0xbf24('0x2e')](_0x5abda5[_0xbf24('0x2d')]);_0x10b0b5[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x10b0b5[_0xbf24('0x32')],_0x10b0b5[_0xbf24('0x2d')]);_0x60f9a8[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x10b0b5[_0xbf24('0x32')],qs['fields'](_0x5abda5['query'][_0xbf24('0x33')]));_0x60f9a8[_0xbf24('0x31')]=_0x60f9a8[_0xbf24('0x31')][_0xbf24('0x34')]?_0x60f9a8[_0xbf24('0x31')]:_0x10b0b5[_0xbf24('0x32')];if(_0x5abda5[_0xbf24('0x2d')]['includeAll']){_0x60f9a8['include']=[{'all':!![]}];}_0x60f9a8=_[_0xbf24('0x3a')]({},_0x60f9a8,_0x5abda5['options']);return db[_0xbf24('0x2a')]['find'](_0x60f9a8)['then'](handleEntityNotFound(_0x1b81b4,null))[_0xbf24('0x1f')](respondWithResult(_0x1b81b4,null))['catch'](handleError(_0x1b81b4,null));};exports[_0xbf24('0x45')]=function(_0x2796c2,_0x5aed65){return db[_0xbf24('0x2a')][_0xbf24('0x45')](_0x2796c2[_0xbf24('0x46')],{})[_0xbf24('0x1f')](function(_0x201fa0){var _0x4904aa=_0x2796c2[_0xbf24('0x47')][_0xbf24('0x48')]({'plain':!![]});if(!_0x4904aa)throw new Error(_0xbf24('0x49'));if(_0x4904aa[_0xbf24('0x4a')]===_0xbf24('0x47')){var _0x367c4e=_0x201fa0['get']({'plain':!![]});var _0x2d89df=_0xbf24('0x21');return db[_0xbf24('0x4b')][_0xbf24('0x4c')]({'where':{'name':_0x2d89df,'userProfileId':_0x4904aa[_0xbf24('0x4d')]},'raw':!![]})['then'](function(_0x393cff){if(_0x393cff&&_0x393cff['autoAssociation']===0x0){return db[_0xbf24('0x22')][_0xbf24('0x45')]({'name':_0x367c4e[_0xbf24('0x26')],'resourceId':_0x367c4e['id'],'type':_0x393cff[_0xbf24('0x26')],'sectionId':_0x393cff['id']},{})['then'](function(){return _0x201fa0;});}else{return _0x201fa0;}})[_0xbf24('0x42')](function(_0x258277){logger[_0xbf24('0x24')](_0xbf24('0x4e'),_0x258277);throw _0x258277;});}return _0x201fa0;})[_0xbf24('0x1f')](respondWithResult(_0x5aed65,0xc9))[_0xbf24('0x42')](handleError(_0x5aed65,null));};exports[_0xbf24('0x4f')]=function(_0x1c9f7f,_0x142329){var _0x407f2a={'where':{'id':_0x1c9f7f[_0xbf24('0x50')]['id']}},_0x58ecca={};_0x58ecca['model']=_[_0xbf24('0x2e')](db[_0xbf24('0x2a')][_0xbf24('0x44')]);_0x407f2a[_0xbf24('0x31')]=_['intersection'](_0x58ecca[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x1c9f7f['query']['fields']));_0x407f2a[_0xbf24('0x31')]=_0x407f2a[_0xbf24('0x31')][_0xbf24('0x34')]?_0x407f2a[_0xbf24('0x31')]:_0x58ecca[_0xbf24('0x32')];if(_0x1c9f7f['query'][_0xbf24('0x3e')]){_0x407f2a[_0xbf24('0x3f')]=[{'all':!![]}];}_0x407f2a=_['merge']({},_0x407f2a,_0x1c9f7f[_0xbf24('0x3d')]);return db[_0xbf24('0x2a')][_0xbf24('0x4c')](_0x407f2a)['then'](handleEntityNotFound(_0x142329,null))['then'](function(_0x4452a6){if(_0x4452a6){var _0x122483=_0x4452a6[_0xbf24('0x48')]({'plain':!![]});_0x122483=qs[_0xbf24('0x51')](_0x122483,['id',_0xbf24('0x52'),_0xbf24('0x53')]);_0x1c9f7f[_0xbf24('0x46')]=_[_0xbf24('0x51')](_0x1c9f7f['body'],['id',_0xbf24('0x52'),_0xbf24('0x53')]);return db[_0xbf24('0x2a')][_0xbf24('0x45')](_[_0xbf24('0x3a')](_0x122483,_0x1c9f7f[_0xbf24('0x46')]),{'include':_0x1c9f7f[_0xbf24('0x2d')][_0xbf24('0x3e')]?[{'all':!![]}]:undefined})[_0xbf24('0x1f')](function(_0x2d999b){var _0x2cfaae=_0x1c9f7f[_0xbf24('0x47')][_0xbf24('0x48')]({'plain':!![]});if(!_0x2cfaae)throw new Error(_0xbf24('0x49'));if(_0x2cfaae['role']==='user'){var _0x22032f=_0x2d999b['get']({'plain':!![]});var _0xddcc8=_0xbf24('0x21');return db[_0xbf24('0x4b')][_0xbf24('0x4c')]({'where':{'name':_0xddcc8,'userProfileId':_0x2cfaae[_0xbf24('0x4d')]},'raw':!![]})[_0xbf24('0x1f')](function(_0x4fa253){if(_0x4fa253&&_0x4fa253[_0xbf24('0x54')]===0x0){return db['UserProfileResource'][_0xbf24('0x45')]({'name':_0x22032f['name'],'resourceId':_0x22032f['id'],'type':_0x4fa253[_0xbf24('0x26')],'sectionId':_0x4fa253['id']},{})['then'](function(){return _0x2d999b;});}else{return _0x2d999b;}})[_0xbf24('0x42')](function(_0x67cc1e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x67cc1e);throw _0x67cc1e;});}return _0x2d999b;});}})['then'](respondWithResult(_0x142329,0xc9))[_0xbf24('0x42')](handleError(_0x142329,null));};exports[_0xbf24('0x55')]=function(_0x4eb40a,_0x5013c1){if(_0x4eb40a[_0xbf24('0x46')]['id']){delete _0x4eb40a[_0xbf24('0x46')]['id'];}return db[_0xbf24('0x2a')][_0xbf24('0x4c')]({'where':{'id':_0x4eb40a['params']['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x5013c1,null))[_0xbf24('0x1f')](saveUpdates(_0x4eb40a[_0xbf24('0x46')],null))[_0xbf24('0x1f')](respondWithResult(_0x5013c1,null))[_0xbf24('0x42')](handleError(_0x5013c1,null));};exports['destroy']=function(_0x5257ff,_0x3218c4){return db[_0xbf24('0x2a')][_0xbf24('0x4c')]({'where':{'id':_0x5257ff[_0xbf24('0x50')]['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x3218c4,null))[_0xbf24('0x1f')](removeEntity(_0x3218c4,null))[_0xbf24('0x42')](handleError(_0x3218c4,null));};exports[_0xbf24('0x56')]=function(_0x57693f,_0x44e85f,_0x3fb973){var _0x17c4ea={'raw':!![],'where':{}};var _0x57a146={};var _0x327e85={'count':0x0,'rows':[]};return db['Campaign'][_0xbf24('0x57')]({'where':{'id':_0x57693f[_0xbf24('0x50')]['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x44e85f,null))['then'](function(_0x5c6f6f){if(_0x5c6f6f){_0x57a146[_0xbf24('0x32')]=_[_0xbf24('0x2e')](db[_0xbf24('0x58')][_0xbf24('0x44')]);_0x57a146['query']=_['keys'](_0x57693f[_0xbf24('0x2d')]);_0x57a146[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x57a146[_0xbf24('0x32')],_0x57a146[_0xbf24('0x2d')]);_0x17c4ea['attributes']=_['intersection'](_0x57a146[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x57693f[_0xbf24('0x2d')]['fields']));_0x17c4ea[_0xbf24('0x31')]=_0x17c4ea[_0xbf24('0x31')][_0xbf24('0x34')]?_0x17c4ea['attributes']:_0x57a146[_0xbf24('0x32')];if(!_0x57693f['query'][_0xbf24('0x35')]('nolimit')){_0x17c4ea['limit']=qs[_0xbf24('0x1a')](_0x57693f[_0xbf24('0x2d')][_0xbf24('0x1a')]);_0x17c4ea[_0xbf24('0x19')]=qs[_0xbf24('0x19')](_0x57693f['query'][_0xbf24('0x19')]);}_0x17c4ea[_0xbf24('0x59')]=qs[_0xbf24('0x36')](_0x57693f[_0xbf24('0x2d')][_0xbf24('0x36')]);_0x17c4ea[_0xbf24('0x37')]=qs[_0xbf24('0x2f')](_['pick'](_0x57693f[_0xbf24('0x2d')],_0x57a146['filters']));_0x17c4ea[_0xbf24('0x37')][_0xbf24('0x5a')]=_0x5c6f6f['id'];if(_0x57693f[_0xbf24('0x2d')]['filter']){_0x17c4ea[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x17c4ea[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x17c4ea[_0xbf24('0x31')],function(_0x1d4db1){var _0x27ac03={};_0x27ac03[_0x1d4db1]={'$like':'%'+_0x57693f[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x27ac03;})});}_0x17c4ea=_['merge']({},_0x17c4ea,_0x57693f['options']);return db['CmHopper']['count']({'where':_0x17c4ea[_0xbf24('0x37')]})[_0xbf24('0x1f')](function(_0x2fbee5){_0x327e85[_0xbf24('0x1b')]=_0x2fbee5;if(_0x57693f[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x17c4ea['include']=[{'all':!![]}];}return db[_0xbf24('0x58')][_0xbf24('0x40')](_0x17c4ea);})[_0xbf24('0x1f')](function(_0x4602e4){_0x327e85['rows']=_0x4602e4;return _0x327e85;});}})['then'](respondWithFilteredResult(_0x44e85f,_0x17c4ea))[_0xbf24('0x42')](handleError(_0x44e85f,null));};exports['getHopperHistories']=function(_0x3bacb4,_0x345612,_0x5e7723){var _0x137ceb={'raw':!![],'where':{}};var _0x238262={};var _0x5031ae={'count':0x0,'rows':[]};return db[_0xbf24('0x2a')]['findOne']({'where':{'id':_0x3bacb4['params']['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x345612,null))['then'](function(_0x186339){if(_0x186339){_0x238262[_0xbf24('0x32')]=_['keys'](db[_0xbf24('0x5b')]['rawAttributes']);_0x238262['query']=_[_0xbf24('0x2e')](_0x3bacb4[_0xbf24('0x2d')]);_0x238262[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x238262[_0xbf24('0x32')],_0x238262[_0xbf24('0x2d')]);_0x137ceb[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x238262[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x3bacb4[_0xbf24('0x2d')]['fields']));_0x137ceb[_0xbf24('0x31')]=_0x137ceb[_0xbf24('0x31')][_0xbf24('0x34')]?_0x137ceb[_0xbf24('0x31')]:_0x238262[_0xbf24('0x32')];if(!_0x3bacb4[_0xbf24('0x2d')]['hasOwnProperty'](_0xbf24('0x5c'))){_0x137ceb[_0xbf24('0x1a')]=qs[_0xbf24('0x1a')](_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x1a')]);_0x137ceb[_0xbf24('0x19')]=qs[_0xbf24('0x19')](_0x3bacb4[_0xbf24('0x2d')]['offset']);}_0x137ceb[_0xbf24('0x59')]=qs['sort'](_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x36')]);_0x137ceb[_0xbf24('0x37')]=qs[_0xbf24('0x2f')](_['pick'](_0x3bacb4[_0xbf24('0x2d')],_0x238262[_0xbf24('0x2f')]));_0x137ceb['where'][_0xbf24('0x5a')]=_0x186339['id'];if(_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x39')]){_0x137ceb[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x137ceb[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x137ceb[_0xbf24('0x31')],function(_0x486049){var _0x1aa8ec={};_0x1aa8ec[_0x486049]={'$like':'%'+_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x1aa8ec;})});}_0x137ceb=_[_0xbf24('0x3a')]({},_0x137ceb,_0x3bacb4[_0xbf24('0x3d')]);return db[_0xbf24('0x5b')]['count']({'where':_0x137ceb[_0xbf24('0x37')]})[_0xbf24('0x1f')](function(_0xcb622e){_0x5031ae['count']=_0xcb622e;if(_0x3bacb4[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x137ceb[_0xbf24('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xbf24('0x40')](_0x137ceb);})[_0xbf24('0x1f')](function(_0x55b801){_0x5031ae['rows']=_0x55b801;return _0x5031ae;});}})[_0xbf24('0x1f')](respondWithFilteredResult(_0x345612,_0x137ceb))[_0xbf24('0x42')](handleError(_0x345612,null));};exports[_0xbf24('0x5d')]=function(_0x4f36ca,_0xfd5fe8,_0x33c125){var _0x409d59={'raw':!![],'where':{}};var _0x2d72c2={};var _0x25046b={'count':0x0,'rows':[]};return db['Campaign'][_0xbf24('0x57')]({'where':{'id':_0x4f36ca[_0xbf24('0x50')]['id']}})['then'](handleEntityNotFound(_0xfd5fe8,null))[_0xbf24('0x1f')](function(_0x4ce297){if(_0x4ce297){_0x2d72c2[_0xbf24('0x32')]=_[_0xbf24('0x2e')](db[_0xbf24('0x5e')][_0xbf24('0x44')]);_0x2d72c2[_0xbf24('0x2d')]=_[_0xbf24('0x2e')](_0x4f36ca[_0xbf24('0x2d')]);_0x2d72c2[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x2d72c2[_0xbf24('0x32')],_0x2d72c2[_0xbf24('0x2d')]);_0x409d59['attributes']=_[_0xbf24('0x30')](_0x2d72c2[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x4f36ca[_0xbf24('0x2d')][_0xbf24('0x33')]));_0x409d59['attributes']=_0x409d59[_0xbf24('0x31')][_0xbf24('0x34')]?_0x409d59['attributes']:_0x2d72c2[_0xbf24('0x32')];if(!_0x4f36ca[_0xbf24('0x2d')]['hasOwnProperty'](_0xbf24('0x5c'))){_0x409d59[_0xbf24('0x1a')]=qs[_0xbf24('0x1a')](_0x4f36ca['query'][_0xbf24('0x1a')]);_0x409d59['offset']=qs[_0xbf24('0x19')](_0x4f36ca['query']['offset']);}_0x409d59[_0xbf24('0x59')]=qs[_0xbf24('0x36')](_0x4f36ca[_0xbf24('0x2d')]['sort']);_0x409d59[_0xbf24('0x37')]=qs[_0xbf24('0x2f')](_[_0xbf24('0x38')](_0x4f36ca[_0xbf24('0x2d')],_0x2d72c2[_0xbf24('0x2f')]));_0x409d59[_0xbf24('0x37')][_0xbf24('0x5a')]=_0x4ce297['id'];if(_0x4f36ca[_0xbf24('0x2d')]['filter']){_0x409d59['where']=_[_0xbf24('0x3a')](_0x409d59[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x409d59['attributes'],function(_0x58a974){var _0x20385a={};_0x20385a[_0x58a974]={'$like':'%'+_0x4f36ca[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x20385a;})});}_0x409d59=_[_0xbf24('0x3a')]({},_0x409d59,_0x4f36ca[_0xbf24('0x3d')]);return db[_0xbf24('0x5e')][_0xbf24('0x1b')]({'where':_0x409d59['where']})[_0xbf24('0x1f')](function(_0x48b64d){_0x25046b[_0xbf24('0x1b')]=_0x48b64d;if(_0x4f36ca[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x409d59[_0xbf24('0x3f')]=[{'all':!![]}];}return db[_0xbf24('0x5e')][_0xbf24('0x40')](_0x409d59);})['then'](function(_0x57e886){_0x25046b[_0xbf24('0x41')]=_0x57e886;return _0x25046b;});}})['then'](respondWithFilteredResult(_0xfd5fe8,_0x409d59))['catch'](handleError(_0xfd5fe8,null));};exports[_0xbf24('0x5f')]=function(_0x2b5f76,_0x79d5db,_0x4cb533){var _0x4f078b={'raw':!![],'where':{}};var _0x1d4468={};var _0x58f498={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2b5f76['params']['id']}})['then'](handleEntityNotFound(_0x79d5db,null))[_0xbf24('0x1f')](function(_0x1ec92b){if(_0x1ec92b){_0x1d4468['model']=_[_0xbf24('0x2e')](db[_0xbf24('0x60')]['rawAttributes']);_0x1d4468['query']=_[_0xbf24('0x2e')](_0x2b5f76[_0xbf24('0x2d')]);_0x1d4468[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x1d4468[_0xbf24('0x32')],_0x1d4468['query']);_0x4f078b[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x1d4468[_0xbf24('0x32')],qs[_0xbf24('0x33')](_0x2b5f76[_0xbf24('0x2d')][_0xbf24('0x33')]));_0x4f078b[_0xbf24('0x31')]=_0x4f078b[_0xbf24('0x31')][_0xbf24('0x34')]?_0x4f078b[_0xbf24('0x31')]:_0x1d4468[_0xbf24('0x32')];if(!_0x2b5f76[_0xbf24('0x2d')][_0xbf24('0x35')]('nolimit')){_0x4f078b['limit']=qs[_0xbf24('0x1a')](_0x2b5f76[_0xbf24('0x2d')][_0xbf24('0x1a')]);_0x4f078b['offset']=qs[_0xbf24('0x19')](_0x2b5f76[_0xbf24('0x2d')][_0xbf24('0x19')]);}_0x4f078b['order']=qs['sort'](_0x2b5f76['query'][_0xbf24('0x36')]);_0x4f078b[_0xbf24('0x37')]=qs['filters'](_[_0xbf24('0x38')](_0x2b5f76[_0xbf24('0x2d')],_0x1d4468['filters']));_0x4f078b['where']['CampaignId']=_0x1ec92b['id'];if(_0x2b5f76[_0xbf24('0x2d')][_0xbf24('0x39')]){_0x4f078b['where']=_['merge'](_0x4f078b[_0xbf24('0x37')],{'$or':_['map'](_0x4f078b[_0xbf24('0x31')],function(_0x11a590){var _0x3c9e4e={};_0x3c9e4e[_0x11a590]={'$like':'%'+_0x2b5f76[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x3c9e4e;})});}_0x4f078b=_[_0xbf24('0x3a')]({},_0x4f078b,_0x2b5f76[_0xbf24('0x3d')]);return db[_0xbf24('0x60')][_0xbf24('0x1b')]({'where':_0x4f078b[_0xbf24('0x37')]})['then'](function(_0x409377){_0x58f498['count']=_0x409377;if(_0x2b5f76[_0xbf24('0x2d')][_0xbf24('0x3e')]){_0x4f078b[_0xbf24('0x3f')]=[{'all':!![]}];}return db[_0xbf24('0x60')]['findAll'](_0x4f078b);})[_0xbf24('0x1f')](function(_0x3ae5fc){_0x58f498[_0xbf24('0x41')]=_0x3ae5fc;return _0x58f498;});}})[_0xbf24('0x1f')](respondWithFilteredResult(_0x79d5db,_0x4f078b))[_0xbf24('0x42')](handleError(_0x79d5db,null));};exports['getLists']=function(_0x4989ed,_0x159fdf,_0x253a43){var _0x1f1cfc={};var _0x1436cb={};var _0x5a9347;var _0xb0341e;return db[_0xbf24('0x2a')][_0xbf24('0x57')]({'where':{'id':_0x4989ed[_0xbf24('0x50')]['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x159fdf,null))[_0xbf24('0x1f')](function(_0xfcc95c){if(_0xfcc95c){_0x5a9347=_0xfcc95c;_0x1436cb['model']=_[_0xbf24('0x2e')](db[_0xbf24('0x61')][_0xbf24('0x44')]);_0x1436cb[_0xbf24('0x2d')]=_[_0xbf24('0x2e')](_0x4989ed[_0xbf24('0x2d')]);_0x1436cb[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x1436cb[_0xbf24('0x32')],_0x1436cb[_0xbf24('0x2d')]);_0x1f1cfc[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x1436cb[_0xbf24('0x32')],qs['fields'](_0x4989ed[_0xbf24('0x2d')][_0xbf24('0x33')]));_0x1f1cfc[_0xbf24('0x31')]=_0x1f1cfc[_0xbf24('0x31')]['length']?_0x1f1cfc[_0xbf24('0x31')]:_0x1436cb['model'];_0x1f1cfc['order']=qs[_0xbf24('0x36')](_0x4989ed[_0xbf24('0x2d')][_0xbf24('0x36')]);_0x1f1cfc['where']=qs[_0xbf24('0x2f')](_['pick'](_0x4989ed['query'],_0x1436cb['filters']));if(_0x4989ed[_0xbf24('0x2d')][_0xbf24('0x39')]){_0x1f1cfc[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x1f1cfc[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x1f1cfc['attributes'],function(_0x4b6d11){var _0x5041f5={};_0x5041f5[_0x4b6d11]={'$like':'%'+_0x4989ed[_0xbf24('0x2d')][_0xbf24('0x39')]+'%'};return _0x5041f5;})});}_0x1f1cfc=_[_0xbf24('0x3a')]({},_0x1f1cfc,_0x4989ed[_0xbf24('0x3d')]);return _0x5a9347['getLists'](_0x1f1cfc);}})['then'](function(_0x2e3399){if(_0x2e3399){_0xb0341e=_0x2e3399[_0xbf24('0x34')];if(!_0x4989ed[_0xbf24('0x2d')][_0xbf24('0x35')](_0xbf24('0x5c'))){_0x1f1cfc[_0xbf24('0x1a')]=qs[_0xbf24('0x1a')](_0x4989ed['query'][_0xbf24('0x1a')]);_0x1f1cfc['offset']=qs['offset'](_0x4989ed['query'][_0xbf24('0x19')]);}return _0x5a9347[_0xbf24('0x62')](_0x1f1cfc);}})[_0xbf24('0x1f')](function(_0x231527){if(_0x231527){return _0x231527?{'count':_0xb0341e,'rows':_0x231527}:null;}})[_0xbf24('0x1f')](respondWithResult(_0x159fdf,null))[_0xbf24('0x42')](handleError(_0x159fdf,null));};exports[_0xbf24('0x63')]=function(_0x27e873,_0x29d444,_0x239865){var _0x1939f5,_0x5ceb71;var _0x3fb0fa=[];var _0x187914=moment()[_0xbf24('0x64')](_0xbf24('0x65'));return db['Campaign']['find']({'where':{'id':_0x27e873[_0xbf24('0x50')]['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x29d444,null))[_0xbf24('0x1f')](function(_0x1c5173){if(_0x1c5173){_0x5ceb71=_0x1c5173;return _0x1c5173['addLists'](_0x27e873[_0xbf24('0x46')]['ids'],_[_0xbf24('0x51')](_0x27e873['body'],['ids','id'])||{});}return null;})[_0xbf24('0x66')](function(_0x428756){var _0x179c84;var _0x41ed3f;_0x1939f5=_0x428756||[];var _0x278b9a=[];if(_0x428756){for(var _0x584637=0x0;_0x584637<_0x428756['length'];_0x584637+=0x1){var _0x381fbd=_0x428756[_0x584637][_0xbf24('0x48')]({'plain':!![]});_0x5ceb71[_0xbf24('0x67')]=_0x27e873[_0xbf24('0x46')]['dialCheckDuplicateType']?_0x27e873[_0xbf24('0x46')]['dialCheckDuplicateType']:_0x5ceb71['dialCheckDuplicateType'];switch(_0x5ceb71[_0xbf24('0x67')]){case'always':_0x179c84=squel[_0xbf24('0x68')]()['into'](_0xbf24('0x69'))['fromQuery']([_0xbf24('0x6a'),_0xbf24('0x6b'),_0xbf24('0x6c'),_0xbf24('0x6d'),'CampaignId',_0xbf24('0x52'),_0xbf24('0x53')],squel[_0xbf24('0x6e')]()[_0xbf24('0x6f')](_0xbf24('0x6a'),_0xbf24('0x6a'))[_0xbf24('0x6f')](_0xbf24('0x70'),'scheduledAt')[_0xbf24('0x6f')]('id','ContactId')[_0xbf24('0x6f')](_0x381fbd[_0xbf24('0x71')][_0xbf24('0x72')](),'ListId')[_0xbf24('0x6f')](_0x27e873['params']['id'][_0xbf24('0x72')](),'CampaignId')[_0xbf24('0x6f')]('\x27'+_0x187914+'\x27',_0xbf24('0x52'))[_0xbf24('0x6f')]('\x27'+_0x187914+'\x27','updatedAt')[_0xbf24('0x73')](_0xbf24('0x74'))['where'](_0xbf24('0x75'))['where']('ListId\x20=\x20?',_0x381fbd[_0xbf24('0x71')][_0xbf24('0x72')]())[_0xbf24('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0xbf24('0x37')](_0xbf24('0x76'),squel[_0xbf24('0x6e')]()[_0xbf24('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0xbf24('0x73')](_0xbf24('0x77'))[_0xbf24('0x37')](_0xbf24('0x78'),_0x27e873[_0xbf24('0x50')]['id'][_0xbf24('0x72')]()))[_0xbf24('0x37')](_0xbf24('0x76'),squel[_0xbf24('0x6e')]()[_0xbf24('0x6f')]('COALESCE(phone,\x27\x27)')[_0xbf24('0x73')](_0xbf24('0x69'))[_0xbf24('0x37')]('CampaignId\x20=\x20?',_0x27e873[_0xbf24('0x50')]['id'][_0xbf24('0x72')]())))['toString']();break;case'onlyIfOpen':_0x179c84=squel[_0xbf24('0x68')]()[_0xbf24('0x79')](_0xbf24('0x69'))[_0xbf24('0x7a')]([_0xbf24('0x6a'),_0xbf24('0x6b'),_0xbf24('0x6c'),_0xbf24('0x6d'),'CampaignId','createdAt',_0xbf24('0x53')],squel[_0xbf24('0x6e')]()[_0xbf24('0x6f')](_0xbf24('0x6a'),_0xbf24('0x6a'))[_0xbf24('0x6f')](_0xbf24('0x70'),_0xbf24('0x6b'))['field']('id',_0xbf24('0x6c'))[_0xbf24('0x6f')](_0x381fbd[_0xbf24('0x71')][_0xbf24('0x72')](),_0xbf24('0x6d'))['field'](_0x27e873['params']['id']['toString'](),_0xbf24('0x5a'))['field']('\x27'+_0x187914+'\x27',_0xbf24('0x52'))[_0xbf24('0x6f')]('\x27'+_0x187914+'\x27',_0xbf24('0x53'))[_0xbf24('0x73')](_0xbf24('0x74'))[_0xbf24('0x37')](_0xbf24('0x75'))[_0xbf24('0x37')](_0xbf24('0x7b'),_0x381fbd[_0xbf24('0x71')][_0xbf24('0x72')]())[_0xbf24('0x37')](_0xbf24('0x7c'))[_0xbf24('0x37')](_0xbf24('0x76'),squel['select']()[_0xbf24('0x6f')](_0xbf24('0x7d'))['from'](_0xbf24('0x69'))[_0xbf24('0x37')](_0xbf24('0x78'),_0x27e873[_0xbf24('0x50')]['id'][_0xbf24('0x72')]())))[_0xbf24('0x72')]();break;default:_0x179c84=squel[_0xbf24('0x68')]()[_0xbf24('0x79')]('cm_hopper')[_0xbf24('0x7a')]([_0xbf24('0x6a'),_0xbf24('0x6b'),_0xbf24('0x6c'),_0xbf24('0x6d'),_0xbf24('0x5a'),_0xbf24('0x52'),'updatedAt'],squel[_0xbf24('0x6e')]()[_0xbf24('0x6f')](_0xbf24('0x6a'),'phone')['field']('NOW()',_0xbf24('0x6b'))[_0xbf24('0x6f')]('id',_0xbf24('0x6c'))[_0xbf24('0x6f')](_0x381fbd[_0xbf24('0x71')]['toString'](),'ListId')[_0xbf24('0x6f')](_0x27e873['params']['id'][_0xbf24('0x72')](),'CampaignId')[_0xbf24('0x6f')]('\x27'+_0x187914+'\x27',_0xbf24('0x52'))[_0xbf24('0x6f')]('\x27'+_0x187914+'\x27',_0xbf24('0x53'))['from'](_0xbf24('0x74'))['where'](_0xbf24('0x75'))['where'](_0xbf24('0x7b'),_0x381fbd['CmListId'][_0xbf24('0x72')]())[_0xbf24('0x37')](_0xbf24('0x7c')))[_0xbf24('0x72')]();}_0x41ed3f=squel[_0xbf24('0x68')]()[_0xbf24('0x79')]('cm_hopper_additional_phones')['fromQuery']([_0xbf24('0x7e'),_0xbf24('0x6b'),_0xbf24('0x6a'),_0xbf24('0x7f'),_0xbf24('0x52'),_0xbf24('0x53')],squel[_0xbf24('0x6e')]()['field'](_0xbf24('0x80'),'id')[_0xbf24('0x6f')](_0xbf24('0x70'),_0xbf24('0x6b'))['field']('ci.item',_0xbf24('0x6a'))[_0xbf24('0x6f')]('ci.OrderBY','OrderBy')[_0xbf24('0x6f')]('\x27'+_0x187914+'\x27','createdAt')['field']('\x27'+_0x187914+'\x27',_0xbf24('0x53'))['from'](_0xbf24('0x81'),'ci')[_0xbf24('0x82')]('cm_hopper','h',_0xbf24('0x83'))[_0xbf24('0x37')](_0xbf24('0x84'),_0x381fbd['CmListId']['toString']())[_0xbf24('0x37')]('h.CampaignId=?',_0x27e873[_0xbf24('0x50')]['id']['toString']())['where'](_0xbf24('0x85'),_0x187914))[_0xbf24('0x72')]();_0x278b9a['push'](db['sequelize'][_0xbf24('0x2d')](_0x179c84));_0x3fb0fa[_0xbf24('0x86')](db[_0xbf24('0x87')][_0xbf24('0x2d')](_0x41ed3f));}return BPromise[_0xbf24('0x88')](_0x278b9a);}})[_0xbf24('0x1f')](function(){return BPromise[_0xbf24('0x88')](_0x3fb0fa);})[_0xbf24('0x1f')](function(){return _0x1939f5;})[_0xbf24('0x1f')](respondWithResult(_0x29d444,null))['catch'](handleError(_0x29d444,null));};exports['removeLists']=function(_0x4d6faa,_0x4127c1,_0x381a55){return db[_0xbf24('0x2a')]['find']({'where':{'id':_0x4d6faa['params']['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x4127c1,null))[_0xbf24('0x1f')](function(_0x2b5fdd){if(_0x2b5fdd){return _0x2b5fdd[_0xbf24('0x89')](_0x4d6faa[_0xbf24('0x2d')][_0xbf24('0x8a')]);}})['then'](function(_0x34c47b){if(_0x34c47b){return db['CmHopper'][_0xbf24('0x20')]({'where':{'ListId':_0x4d6faa['query'][_0xbf24('0x8a')],'CampaignId':_0x4d6faa['params']['id']}})[_0xbf24('0x1f')](function(){return _0x34c47b;});}})[_0xbf24('0x1f')](respondWithStatusCode(_0x4127c1,null))[_0xbf24('0x42')](handleError(_0x4127c1,null));};exports[_0xbf24('0x8b')]=function(_0x2acf86,_0x31e39b,_0x21866f){var _0x1a99b7={};var _0x3ec7c7={};var _0x52e55a;var _0x1f10a6;return db[_0xbf24('0x2a')][_0xbf24('0x57')]({'where':{'id':_0x2acf86[_0xbf24('0x50')]['id']}})['then'](handleEntityNotFound(_0x31e39b,null))[_0xbf24('0x1f')](function(_0x222644){if(_0x222644){_0x52e55a=_0x222644;_0x3ec7c7[_0xbf24('0x32')]=_['keys'](db[_0xbf24('0x61')][_0xbf24('0x44')]);_0x3ec7c7[_0xbf24('0x2d')]=_['keys'](_0x2acf86[_0xbf24('0x2d')]);_0x3ec7c7[_0xbf24('0x2f')]=_[_0xbf24('0x30')](_0x3ec7c7[_0xbf24('0x32')],_0x3ec7c7[_0xbf24('0x2d')]);_0x1a99b7[_0xbf24('0x31')]=_[_0xbf24('0x30')](_0x3ec7c7['model'],qs[_0xbf24('0x33')](_0x2acf86[_0xbf24('0x2d')][_0xbf24('0x33')]));_0x1a99b7[_0xbf24('0x31')]=_0x1a99b7[_0xbf24('0x31')][_0xbf24('0x34')]?_0x1a99b7[_0xbf24('0x31')]:_0x3ec7c7['model'];_0x1a99b7['order']=qs[_0xbf24('0x36')](_0x2acf86[_0xbf24('0x2d')]['sort']);_0x1a99b7[_0xbf24('0x37')]=qs[_0xbf24('0x2f')](_[_0xbf24('0x38')](_0x2acf86[_0xbf24('0x2d')],_0x3ec7c7[_0xbf24('0x2f')]));if(_0x2acf86['query']['filter']){_0x1a99b7[_0xbf24('0x37')]=_[_0xbf24('0x3a')](_0x1a99b7[_0xbf24('0x37')],{'$or':_[_0xbf24('0x29')](_0x1a99b7['attributes'],function(_0x4e4c6d){var _0x7e4233={};_0x7e4233[_0x4e4c6d]={'$like':'%'+_0x2acf86['query'][_0xbf24('0x39')]+'%'};return _0x7e4233;})});}_0x1a99b7=_[_0xbf24('0x3a')]({},_0x1a99b7,_0x2acf86['options']);return _0x52e55a[_0xbf24('0x8b')](_0x1a99b7);}})[_0xbf24('0x1f')](function(_0x2cbcc1){if(_0x2cbcc1){_0x1f10a6=_0x2cbcc1[_0xbf24('0x34')];if(!_0x2acf86[_0xbf24('0x2d')][_0xbf24('0x35')](_0xbf24('0x5c'))){_0x1a99b7[_0xbf24('0x1a')]=qs[_0xbf24('0x1a')](_0x2acf86['query'][_0xbf24('0x1a')]);_0x1a99b7[_0xbf24('0x19')]=qs[_0xbf24('0x19')](_0x2acf86[_0xbf24('0x2d')]['offset']);}return _0x52e55a['getBlackLists'](_0x1a99b7);}})[_0xbf24('0x1f')](function(_0xe70887){if(_0xe70887){return _0xe70887?{'count':_0x1f10a6,'rows':_0xe70887}:null;}})[_0xbf24('0x1f')](respondWithResult(_0x31e39b,null))[_0xbf24('0x42')](handleError(_0x31e39b,null));};exports['addBlackLists']=function(_0x21c796,_0x11dc9b,_0x114cf8){var _0x13a7db,_0x168ba4;var _0x2d8c46=[];var _0x5971b8=moment()[_0xbf24('0x64')](_0xbf24('0x65'));return db[_0xbf24('0x2a')]['find']({'where':{'id':_0x21c796['params']['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x11dc9b,null))[_0xbf24('0x1f')](function(_0x1e42a7){if(_0x1e42a7){_0x168ba4=_0x1e42a7;return _0x1e42a7[_0xbf24('0x8c')](_0x21c796[_0xbf24('0x46')][_0xbf24('0x8a')],_[_0xbf24('0x51')](_0x21c796[_0xbf24('0x46')],[_0xbf24('0x8a'),'id'])||{});}return null;})['spread'](function(_0x3fe2df){var _0x421737;var _0x151ddb;_0x13a7db=_0x3fe2df||[];var _0x9acf8f=[];if(_0x3fe2df){for(var _0x479f7e=0x0;_0x479f7e<_0x3fe2df['length'];_0x479f7e+=0x1){var _0x2b26a5=_0x3fe2df[_0x479f7e][_0xbf24('0x48')]({'plain':!![]});_0x421737=squel['insert']()[_0xbf24('0x79')](_0xbf24('0x8d'))['fromQuery']([_0xbf24('0x6a'),_0xbf24('0x6c'),'ListId',_0xbf24('0x5a'),_0xbf24('0x52'),'updatedAt'],squel[_0xbf24('0x6e')]()[_0xbf24('0x6f')](_0xbf24('0x6a'),'phone')[_0xbf24('0x6f')]('id',_0xbf24('0x6c'))[_0xbf24('0x6f')](_0x2b26a5['CmListId'][_0xbf24('0x72')](),_0xbf24('0x6d'))[_0xbf24('0x6f')](_0x21c796[_0xbf24('0x50')]['id'][_0xbf24('0x72')](),_0xbf24('0x5a'))[_0xbf24('0x6f')](_0xbf24('0x70'),_0xbf24('0x52'))['field']('NOW()',_0xbf24('0x53'))['from']('cm_contacts')[_0xbf24('0x37')](_0xbf24('0x75'))[_0xbf24('0x37')]('ListId\x20=\x20?',_0x2b26a5[_0xbf24('0x71')][_0xbf24('0x72')]())[_0xbf24('0x37')](_0xbf24('0x7c')))['toString']();_0x9acf8f[_0xbf24('0x86')](db['sequelize'][_0xbf24('0x2d')](_0x421737));}return BPromise[_0xbf24('0x88')](_0x9acf8f);}})['then'](function(){return _0x13a7db;})['then'](respondWithResult(_0x11dc9b,null))[_0xbf24('0x42')](handleError(_0x11dc9b,null));};exports['removeBlackLists']=function(_0x1a484b,_0x306751,_0x38adf4){return db['Campaign'][_0xbf24('0x4c')]({'where':{'id':_0x1a484b['params']['id']}})[_0xbf24('0x1f')](handleEntityNotFound(_0x306751,null))[_0xbf24('0x1f')](function(_0xde51a3){if(_0xde51a3){return _0xde51a3['removeBlackLists'](_0x1a484b[_0xbf24('0x2d')][_0xbf24('0x8a')]);}})[_0xbf24('0x1f')](function(_0x11cf84){if(_0x11cf84){return db['CmHopperBlack'][_0xbf24('0x20')]({'where':{'ListId':_0x1a484b[_0xbf24('0x2d')][_0xbf24('0x8a')],'CampaignId':_0x1a484b[_0xbf24('0x50')]['id']}})[_0xbf24('0x1f')](function(){return _0x11cf84;});}})[_0xbf24('0x1f')](respondWithStatusCode(_0x306751,null))[_0xbf24('0x42')](handleError(_0x306751,null));}; \ No newline at end of file +var _0x76d2=['Campaign','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','destroy','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','eml-format','rimraf','zip-dir','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','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map'];(function(_0x115e5b,_0x503d9f){var _0x468051=function(_0xa176af){while(--_0xa176af){_0x115e5b['push'](_0x115e5b['shift']());}};_0x468051(++_0x503d9f);}(_0x76d2,0xf8));var _0x276d=function(_0x15c07d,_0x12ad4c){_0x15c07d=_0x15c07d-0x0;var _0x159156=_0x76d2[_0x15c07d];return _0x159156;};'use strict';var emlformat=require(_0x276d('0x0'));var rimraf=require(_0x276d('0x1'));var zipdir=require(_0x276d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x276d('0x3'));var moment=require(_0x276d('0x4'));var BPromise=require(_0x276d('0x5'));var Mustache=require(_0x276d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x276d('0x7'));var csv=require(_0x276d('0x8'));var ejs=require(_0x276d('0x9'));var fs=require('fs');var fs_extra=require(_0x276d('0xa'));var _=require(_0x276d('0xb'));var squel=require(_0x276d('0xc'));var crypto=require(_0x276d('0xd'));var jsforce=require(_0x276d('0xe'));var deskjs=require(_0x276d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x276d('0x10'));var Redis=require(_0x276d('0x11'));var authService=require(_0x276d('0x12'));var qs=require(_0x276d('0x13'));var as=require(_0x276d('0x14'));var hardwareService=require(_0x276d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x276d('0x16'));var config=require(_0x276d('0x17'));var licenseUtil=require(_0x276d('0x18'));var db=require(_0x276d('0x19'))['db'];function respondWithStatusCode(_0x2e107c,_0x2e4374){_0x2e4374=_0x2e4374||0xcc;return function(_0x4b9f5f){if(_0x4b9f5f){return _0x2e107c['sendStatus'](_0x2e4374);}return _0x2e107c[_0x276d('0x1a')](_0x2e4374)[_0x276d('0x1b')]();};}function respondWithResult(_0x3bdd13,_0x377540){_0x377540=_0x377540||0xc8;return function(_0x3166a2){if(_0x3166a2){return _0x3bdd13[_0x276d('0x1a')](_0x377540)[_0x276d('0x1c')](_0x3166a2);}};}function respondWithFilteredResult(_0x2c309f,_0x5b23b7){return function(_0x2165c6){if(_0x2165c6){var _0x43efeb=typeof _0x5b23b7['offset']==='undefined'&&typeof _0x5b23b7[_0x276d('0x1d')]===_0x276d('0x1e');var _0x4d9859=_0x2165c6[_0x276d('0x1f')];var _0x5d96cb=_0x43efeb?0x0:_0x5b23b7['offset'];var _0xb75b36=_0x43efeb?_0x2165c6['count']:_0x5b23b7[_0x276d('0x20')]+_0x5b23b7[_0x276d('0x1d')];var _0x42d335;if(_0xb75b36>=_0x4d9859){_0xb75b36=_0x4d9859;_0x42d335=0xc8;}else{_0x42d335=0xce;}_0x2c309f[_0x276d('0x1a')](_0x42d335);return _0x2c309f['set'](_0x276d('0x21'),_0x5d96cb+'-'+_0xb75b36+'/'+_0x4d9859)[_0x276d('0x1c')](_0x2165c6);}return null;};}function patchUpdates(_0x54565b){return function(_0x5e8fee){try{jsonpatch[_0x276d('0x22')](_0x5e8fee,_0x54565b,!![]);}catch(_0xead902){return BPromise['reject'](_0xead902);}return _0x5e8fee[_0x276d('0x23')]();};}function saveUpdates(_0x1f3545,_0x57d4b7){return function(_0x284160){if(_0x284160){return _0x284160['update'](_0x1f3545)[_0x276d('0x24')](function(_0x152195){return _0x152195;});}return null;};}function removeEntity(_0x5f0561,_0x476671){return function(_0x3edb3b){if(_0x3edb3b){return _0x3edb3b['destroy']()['then'](function(){var _0x991d5d=_0x3edb3b[_0x276d('0x25')]({'plain':!![]});var _0x121e75=_0x276d('0x26');return db[_0x276d('0x27')]['destroy']({'where':{'type':_0x121e75,'resourceId':_0x991d5d['id']}})[_0x276d('0x24')](function(){return _0x3edb3b;});})['then'](function(){_0x5f0561[_0x276d('0x1a')](0xcc)[_0x276d('0x1b')]();});}};}function handleEntityNotFound(_0x54c37c,_0xaa77c7){return function(_0x596248){if(!_0x596248){_0x54c37c['sendStatus'](0x194);}return _0x596248;};}function handleError(_0x5dec41,_0x235509){_0x235509=_0x235509||0x1f4;return function(_0x3226f5){logger[_0x276d('0x28')](_0x3226f5[_0x276d('0x29')]);if(_0x3226f5['name']){delete _0x3226f5[_0x276d('0x2a')];}_0x5dec41[_0x276d('0x1a')](_0x235509)[_0x276d('0x2b')](_0x3226f5);};}exports[_0x276d('0x2c')]=function(_0x29755c,_0x251135){var _0x1102f7={},_0x4b9966={},_0x168406={'count':0x0,'rows':[]};var _0x3fb13b=_[_0x276d('0x2d')](db[_0x276d('0x2e')][_0x276d('0x2f')],function(_0x335372){return{'name':_0x335372[_0x276d('0x30')],'type':_0x335372['type'][_0x276d('0x31')]};});_0x4b9966[_0x276d('0x32')]=_[_0x276d('0x2d')](_0x3fb13b,_0x276d('0x2a'));_0x4b9966['query']=_[_0x276d('0x33')](_0x29755c['query']);_0x4b9966[_0x276d('0x34')]=_[_0x276d('0x35')](_0x4b9966[_0x276d('0x32')],_0x4b9966[_0x276d('0x36')]);_0x1102f7[_0x276d('0x37')]=_[_0x276d('0x35')](_0x4b9966[_0x276d('0x32')],qs[_0x276d('0x38')](_0x29755c['query']['fields']));_0x1102f7[_0x276d('0x37')]=_0x1102f7['attributes'][_0x276d('0x39')]?_0x1102f7[_0x276d('0x37')]:_0x4b9966[_0x276d('0x32')];if(!_0x29755c[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x1102f7[_0x276d('0x1d')]=qs['limit'](_0x29755c['query'][_0x276d('0x1d')]);_0x1102f7[_0x276d('0x20')]=qs['offset'](_0x29755c['query'][_0x276d('0x20')]);}_0x1102f7[_0x276d('0x3c')]=qs['sort'](_0x29755c[_0x276d('0x36')][_0x276d('0x3d')]);_0x1102f7[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x29755c[_0x276d('0x36')],_0x4b9966['filters']),_0x3fb13b);if(_0x29755c[_0x276d('0x36')][_0x276d('0x40')]){_0x1102f7['where']=_['merge'](_0x1102f7['where'],{'$or':_[_0x276d('0x2d')](_0x3fb13b,function(_0x4b9c99){if(_0x4b9c99['type']!=='VIRTUAL'){var _0x1390fa={};_0x1390fa[_0x4b9c99[_0x276d('0x2a')]]={'$like':'%'+_0x29755c[_0x276d('0x36')][_0x276d('0x40')]+'%'};return _0x1390fa;}})});}_0x1102f7=_[_0x276d('0x41')]({},_0x1102f7,_0x29755c[_0x276d('0x42')]);var _0xb5c0c7={'where':_0x1102f7[_0x276d('0x3e')]};return db[_0x276d('0x2e')][_0x276d('0x1f')](_0xb5c0c7)[_0x276d('0x24')](function(_0x117f0f){_0x168406[_0x276d('0x1f')]=_0x117f0f;if(_0x29755c[_0x276d('0x36')]['includeAll']){_0x1102f7[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x2e')][_0x276d('0x44')](_0x1102f7);})[_0x276d('0x24')](function(_0x8ef582){_0x168406[_0x276d('0x45')]=_0x8ef582;return _0x168406;})[_0x276d('0x24')](respondWithFilteredResult(_0x251135,_0x1102f7))[_0x276d('0x46')](handleError(_0x251135,null));};exports[_0x276d('0x47')]=function(_0x5d780e,_0x32513e){var _0x3173a4={'raw':![],'where':{'id':_0x5d780e[_0x276d('0x48')]['id']}},_0x318402={};_0x318402['model']=_[_0x276d('0x33')](db[_0x276d('0x2e')][_0x276d('0x2f')]);_0x318402[_0x276d('0x36')]=_[_0x276d('0x33')](_0x5d780e[_0x276d('0x36')]);_0x318402['filters']=_[_0x276d('0x35')](_0x318402['model'],_0x318402[_0x276d('0x36')]);_0x3173a4[_0x276d('0x37')]=_['intersection'](_0x318402[_0x276d('0x32')],qs[_0x276d('0x38')](_0x5d780e['query'][_0x276d('0x38')]));_0x3173a4[_0x276d('0x37')]=_0x3173a4['attributes'][_0x276d('0x39')]?_0x3173a4[_0x276d('0x37')]:_0x318402[_0x276d('0x32')];if(_0x5d780e[_0x276d('0x36')][_0x276d('0x49')]){_0x3173a4['include']=[{'all':!![]}];}_0x3173a4=_[_0x276d('0x41')]({},_0x3173a4,_0x5d780e[_0x276d('0x42')]);return db[_0x276d('0x2e')]['find'](_0x3173a4)[_0x276d('0x24')](handleEntityNotFound(_0x32513e,null))[_0x276d('0x24')](respondWithResult(_0x32513e,null))[_0x276d('0x46')](handleError(_0x32513e,null));};exports['create']=function(_0x28659a,_0x1642d7){return db[_0x276d('0x2e')][_0x276d('0x4a')](_0x28659a['body'],{})['then'](function(_0x44f825){var _0x27ed2a=_0x28659a[_0x276d('0x4b')][_0x276d('0x25')]({'plain':!![]});if(!_0x27ed2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27ed2a[_0x276d('0x4c')]==='user'){var _0x5d07e1=_0x44f825['get']({'plain':!![]});var _0x525c45=_0x276d('0x26');return db[_0x276d('0x4d')][_0x276d('0x4e')]({'where':{'name':_0x525c45,'userProfileId':_0x27ed2a['userProfileId']},'raw':!![]})['then'](function(_0x50b77e){if(_0x50b77e&&_0x50b77e[_0x276d('0x4f')]===0x0){return db[_0x276d('0x27')][_0x276d('0x4a')]({'name':_0x5d07e1[_0x276d('0x2a')],'resourceId':_0x5d07e1['id'],'type':_0x50b77e['name'],'sectionId':_0x50b77e['id']},{})['then'](function(){return _0x44f825;});}else{return _0x44f825;}})['catch'](function(_0x21d079){logger[_0x276d('0x28')](_0x276d('0x50'),_0x21d079);throw _0x21d079;});}return _0x44f825;})[_0x276d('0x24')](respondWithResult(_0x1642d7,0xc9))['catch'](handleError(_0x1642d7,null));};exports[_0x276d('0x51')]=function(_0x2be3ef,_0x3298d1){var _0x3702e5={'where':{'id':_0x2be3ef[_0x276d('0x48')]['id']}},_0x2d2373={};_0x2d2373[_0x276d('0x32')]=_[_0x276d('0x33')](db['Campaign']['rawAttributes']);_0x3702e5[_0x276d('0x37')]=_['intersection'](_0x2d2373[_0x276d('0x32')],qs[_0x276d('0x38')](_0x2be3ef[_0x276d('0x36')][_0x276d('0x38')]));_0x3702e5[_0x276d('0x37')]=_0x3702e5['attributes'][_0x276d('0x39')]?_0x3702e5[_0x276d('0x37')]:_0x2d2373[_0x276d('0x32')];if(_0x2be3ef[_0x276d('0x36')][_0x276d('0x49')]){_0x3702e5['include']=[{'all':!![]}];}_0x3702e5=_[_0x276d('0x41')]({},_0x3702e5,_0x2be3ef[_0x276d('0x42')]);return db['Campaign'][_0x276d('0x4e')](_0x3702e5)[_0x276d('0x24')](handleEntityNotFound(_0x3298d1,null))['then'](function(_0x347f21){if(_0x347f21){var _0x22cf48=_0x347f21[_0x276d('0x25')]({'plain':!![]});_0x22cf48=qs[_0x276d('0x52')](_0x22cf48,['id',_0x276d('0x53'),_0x276d('0x54')]);_0x2be3ef[_0x276d('0x55')]=_[_0x276d('0x52')](_0x2be3ef[_0x276d('0x55')],['id',_0x276d('0x53'),_0x276d('0x54')]);return db[_0x276d('0x2e')][_0x276d('0x4a')](_['merge'](_0x22cf48,_0x2be3ef[_0x276d('0x55')]),{'include':_0x2be3ef[_0x276d('0x36')][_0x276d('0x49')]?[{'all':!![]}]:undefined})[_0x276d('0x24')](function(_0x4876f4){var _0x51d8f2=_0x2be3ef['user'][_0x276d('0x25')]({'plain':!![]});if(!_0x51d8f2)throw new Error(_0x276d('0x56'));if(_0x51d8f2[_0x276d('0x4c')]===_0x276d('0x4b')){var _0x48001f=_0x4876f4[_0x276d('0x25')]({'plain':!![]});var _0x3fd2f5=_0x276d('0x26');return db[_0x276d('0x4d')][_0x276d('0x4e')]({'where':{'name':_0x3fd2f5,'userProfileId':_0x51d8f2[_0x276d('0x57')]},'raw':!![]})[_0x276d('0x24')](function(_0x357a8c){if(_0x357a8c&&_0x357a8c[_0x276d('0x4f')]===0x0){return db[_0x276d('0x27')][_0x276d('0x4a')]({'name':_0x48001f[_0x276d('0x2a')],'resourceId':_0x48001f['id'],'type':_0x357a8c[_0x276d('0x2a')],'sectionId':_0x357a8c['id']},{})[_0x276d('0x24')](function(){return _0x4876f4;});}else{return _0x4876f4;}})['catch'](function(_0x3653ab){logger[_0x276d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3653ab);throw _0x3653ab;});}return _0x4876f4;});}})[_0x276d('0x24')](respondWithResult(_0x3298d1,0xc9))[_0x276d('0x46')](handleError(_0x3298d1,null));};exports[_0x276d('0x58')]=function(_0x5db132,_0xc5446b){if(_0x5db132[_0x276d('0x55')]['id']){delete _0x5db132[_0x276d('0x55')]['id'];}return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x5db132[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0xc5446b,null))[_0x276d('0x24')](saveUpdates(_0x5db132['body'],null))[_0x276d('0x24')](respondWithResult(_0xc5446b,null))['catch'](handleError(_0xc5446b,null));};exports['destroy']=function(_0x1dcdce,_0x2dd008){return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x1dcdce['params']['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x2dd008,null))[_0x276d('0x24')](removeEntity(_0x2dd008,null))[_0x276d('0x46')](handleError(_0x2dd008,null));};exports[_0x276d('0x59')]=function(_0x3e314a,_0x62fa2a,_0x156fac){var _0x2763bc={'raw':!![],'where':{}};var _0x3d2220={};var _0x196257={'count':0x0,'rows':[]};return db[_0x276d('0x2e')]['findOne']({'where':{'id':_0x3e314a[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x62fa2a,null))[_0x276d('0x24')](function(_0x34d77c){if(_0x34d77c){_0x3d2220[_0x276d('0x32')]=_[_0x276d('0x33')](db[_0x276d('0x5a')][_0x276d('0x2f')]);_0x3d2220[_0x276d('0x36')]=_['keys'](_0x3e314a[_0x276d('0x36')]);_0x3d2220[_0x276d('0x34')]=_[_0x276d('0x35')](_0x3d2220[_0x276d('0x32')],_0x3d2220[_0x276d('0x36')]);_0x2763bc[_0x276d('0x37')]=_['intersection'](_0x3d2220[_0x276d('0x32')],qs[_0x276d('0x38')](_0x3e314a[_0x276d('0x36')][_0x276d('0x38')]));_0x2763bc[_0x276d('0x37')]=_0x2763bc['attributes'][_0x276d('0x39')]?_0x2763bc['attributes']:_0x3d2220['model'];if(!_0x3e314a[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x2763bc[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x3e314a[_0x276d('0x36')][_0x276d('0x1d')]);_0x2763bc[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x3e314a[_0x276d('0x36')][_0x276d('0x20')]);}_0x2763bc[_0x276d('0x3c')]=qs[_0x276d('0x3d')](_0x3e314a['query'][_0x276d('0x3d')]);_0x2763bc[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x3e314a[_0x276d('0x36')],_0x3d2220[_0x276d('0x34')]));_0x2763bc[_0x276d('0x3e')][_0x276d('0x5b')]=_0x34d77c['id'];if(_0x3e314a['query']['filter']){_0x2763bc[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x2763bc[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x2763bc[_0x276d('0x37')],function(_0x49ca7a){var _0x5265e8={};_0x5265e8[_0x49ca7a]={'$like':'%'+_0x3e314a[_0x276d('0x36')]['filter']+'%'};return _0x5265e8;})});}_0x2763bc=_[_0x276d('0x41')]({},_0x2763bc,_0x3e314a[_0x276d('0x42')]);return db[_0x276d('0x5a')]['count']({'where':_0x2763bc[_0x276d('0x3e')]})['then'](function(_0x2bfb5d){_0x196257['count']=_0x2bfb5d;if(_0x3e314a['query']['includeAll']){_0x2763bc[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x5a')][_0x276d('0x44')](_0x2763bc);})[_0x276d('0x24')](function(_0x1a1957){_0x196257[_0x276d('0x45')]=_0x1a1957;return _0x196257;});}})[_0x276d('0x24')](respondWithFilteredResult(_0x62fa2a,_0x2763bc))[_0x276d('0x46')](handleError(_0x62fa2a,null));};exports[_0x276d('0x5c')]=function(_0x5a1524,_0x35252d,_0x5c839b){var _0x2ae16a={'raw':!![],'where':{}};var _0xc8ebb6={};var _0x326752={'count':0x0,'rows':[]};return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x5a1524['params']['id']}})['then'](handleEntityNotFound(_0x35252d,null))[_0x276d('0x24')](function(_0x56e6d8){if(_0x56e6d8){_0xc8ebb6[_0x276d('0x32')]=_[_0x276d('0x33')](db[_0x276d('0x5e')][_0x276d('0x2f')]);_0xc8ebb6['query']=_['keys'](_0x5a1524[_0x276d('0x36')]);_0xc8ebb6['filters']=_[_0x276d('0x35')](_0xc8ebb6[_0x276d('0x32')],_0xc8ebb6['query']);_0x2ae16a[_0x276d('0x37')]=_['intersection'](_0xc8ebb6['model'],qs[_0x276d('0x38')](_0x5a1524['query'][_0x276d('0x38')]));_0x2ae16a[_0x276d('0x37')]=_0x2ae16a['attributes'][_0x276d('0x39')]?_0x2ae16a[_0x276d('0x37')]:_0xc8ebb6['model'];if(!_0x5a1524[_0x276d('0x36')]['hasOwnProperty'](_0x276d('0x3b'))){_0x2ae16a[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x5a1524[_0x276d('0x36')][_0x276d('0x1d')]);_0x2ae16a['offset']=qs['offset'](_0x5a1524[_0x276d('0x36')][_0x276d('0x20')]);}_0x2ae16a[_0x276d('0x3c')]=qs[_0x276d('0x3d')](_0x5a1524[_0x276d('0x36')][_0x276d('0x3d')]);_0x2ae16a[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x5a1524[_0x276d('0x36')],_0xc8ebb6[_0x276d('0x34')]));_0x2ae16a[_0x276d('0x3e')]['CampaignId']=_0x56e6d8['id'];if(_0x5a1524['query'][_0x276d('0x40')]){_0x2ae16a[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x2ae16a['where'],{'$or':_['map'](_0x2ae16a[_0x276d('0x37')],function(_0x3ae14d){var _0x577857={};_0x577857[_0x3ae14d]={'$like':'%'+_0x5a1524[_0x276d('0x36')]['filter']+'%'};return _0x577857;})});}_0x2ae16a=_[_0x276d('0x41')]({},_0x2ae16a,_0x5a1524[_0x276d('0x42')]);return db['CmHopperHistory'][_0x276d('0x1f')]({'where':_0x2ae16a[_0x276d('0x3e')]})[_0x276d('0x24')](function(_0x2a4acf){_0x326752[_0x276d('0x1f')]=_0x2a4acf;if(_0x5a1524[_0x276d('0x36')][_0x276d('0x49')]){_0x2ae16a[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x5e')][_0x276d('0x44')](_0x2ae16a);})[_0x276d('0x24')](function(_0x43ec7f){_0x326752[_0x276d('0x45')]=_0x43ec7f;return _0x326752;});}})[_0x276d('0x24')](respondWithFilteredResult(_0x35252d,_0x2ae16a))[_0x276d('0x46')](handleError(_0x35252d,null));};exports[_0x276d('0x5f')]=function(_0x4b611d,_0xd47cb2,_0x582207){var _0x337a31={'raw':!![],'where':{}};var _0xd4729d={};var _0x32e162={'count':0x0,'rows':[]};return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x4b611d['params']['id']}})['then'](handleEntityNotFound(_0xd47cb2,null))['then'](function(_0x320c50){if(_0x320c50){_0xd4729d['model']=_[_0x276d('0x33')](db[_0x276d('0x60')][_0x276d('0x2f')]);_0xd4729d[_0x276d('0x36')]=_[_0x276d('0x33')](_0x4b611d[_0x276d('0x36')]);_0xd4729d['filters']=_[_0x276d('0x35')](_0xd4729d[_0x276d('0x32')],_0xd4729d[_0x276d('0x36')]);_0x337a31[_0x276d('0x37')]=_[_0x276d('0x35')](_0xd4729d['model'],qs[_0x276d('0x38')](_0x4b611d[_0x276d('0x36')]['fields']));_0x337a31[_0x276d('0x37')]=_0x337a31[_0x276d('0x37')][_0x276d('0x39')]?_0x337a31[_0x276d('0x37')]:_0xd4729d[_0x276d('0x32')];if(!_0x4b611d[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x337a31[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x4b611d['query']['limit']);_0x337a31[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x4b611d[_0x276d('0x36')]['offset']);}_0x337a31['order']=qs[_0x276d('0x3d')](_0x4b611d[_0x276d('0x36')][_0x276d('0x3d')]);_0x337a31[_0x276d('0x3e')]=qs[_0x276d('0x34')](_['pick'](_0x4b611d['query'],_0xd4729d['filters']));_0x337a31['where'][_0x276d('0x5b')]=_0x320c50['id'];if(_0x4b611d[_0x276d('0x36')]['filter']){_0x337a31[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x337a31[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x337a31[_0x276d('0x37')],function(_0x13a594){var _0x2d48f7={};_0x2d48f7[_0x13a594]={'$like':'%'+_0x4b611d['query'][_0x276d('0x40')]+'%'};return _0x2d48f7;})});}_0x337a31=_[_0x276d('0x41')]({},_0x337a31,_0x4b611d['options']);return db[_0x276d('0x60')][_0x276d('0x1f')]({'where':_0x337a31[_0x276d('0x3e')]})[_0x276d('0x24')](function(_0x2926de){_0x32e162['count']=_0x2926de;if(_0x4b611d[_0x276d('0x36')]['includeAll']){_0x337a31[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x60')][_0x276d('0x44')](_0x337a31);})['then'](function(_0x56f273){_0x32e162[_0x276d('0x45')]=_0x56f273;return _0x32e162;});}})[_0x276d('0x24')](respondWithFilteredResult(_0xd47cb2,_0x337a31))[_0x276d('0x46')](handleError(_0xd47cb2,null));};exports[_0x276d('0x61')]=function(_0x344608,_0x585eba,_0x5d261b){var _0x58ecdc={'raw':!![],'where':{}};var _0x2ac194={};var _0x5823ff={'count':0x0,'rows':[]};return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x344608['params']['id']}})['then'](handleEntityNotFound(_0x585eba,null))['then'](function(_0x11c1a5){if(_0x11c1a5){_0x2ac194[_0x276d('0x32')]=_['keys'](db[_0x276d('0x62')][_0x276d('0x2f')]);_0x2ac194[_0x276d('0x36')]=_[_0x276d('0x33')](_0x344608[_0x276d('0x36')]);_0x2ac194[_0x276d('0x34')]=_[_0x276d('0x35')](_0x2ac194[_0x276d('0x32')],_0x2ac194[_0x276d('0x36')]);_0x58ecdc[_0x276d('0x37')]=_[_0x276d('0x35')](_0x2ac194[_0x276d('0x32')],qs[_0x276d('0x38')](_0x344608[_0x276d('0x36')]['fields']));_0x58ecdc[_0x276d('0x37')]=_0x58ecdc[_0x276d('0x37')][_0x276d('0x39')]?_0x58ecdc[_0x276d('0x37')]:_0x2ac194[_0x276d('0x32')];if(!_0x344608[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x58ecdc['limit']=qs['limit'](_0x344608[_0x276d('0x36')][_0x276d('0x1d')]);_0x58ecdc[_0x276d('0x20')]=qs['offset'](_0x344608[_0x276d('0x36')]['offset']);}_0x58ecdc[_0x276d('0x3c')]=qs[_0x276d('0x3d')](_0x344608[_0x276d('0x36')]['sort']);_0x58ecdc[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x344608[_0x276d('0x36')],_0x2ac194[_0x276d('0x34')]));_0x58ecdc[_0x276d('0x3e')][_0x276d('0x5b')]=_0x11c1a5['id'];if(_0x344608['query'][_0x276d('0x40')]){_0x58ecdc[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x58ecdc[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x58ecdc[_0x276d('0x37')],function(_0x3e8a71){var _0x1e44df={};_0x1e44df[_0x3e8a71]={'$like':'%'+_0x344608[_0x276d('0x36')][_0x276d('0x40')]+'%'};return _0x1e44df;})});}_0x58ecdc=_[_0x276d('0x41')]({},_0x58ecdc,_0x344608[_0x276d('0x42')]);return db[_0x276d('0x62')]['count']({'where':_0x58ecdc['where']})[_0x276d('0x24')](function(_0x463c7a){_0x5823ff['count']=_0x463c7a;if(_0x344608['query'][_0x276d('0x49')]){_0x58ecdc['include']=[{'all':!![]}];}return db[_0x276d('0x62')][_0x276d('0x44')](_0x58ecdc);})[_0x276d('0x24')](function(_0x5cd43a){_0x5823ff[_0x276d('0x45')]=_0x5cd43a;return _0x5823ff;});}})[_0x276d('0x24')](respondWithFilteredResult(_0x585eba,_0x58ecdc))[_0x276d('0x46')](handleError(_0x585eba,null));};exports[_0x276d('0x63')]=function(_0x25d497,_0x2b630b,_0x3ed51e){var _0x46b542={};var _0xd70176={};var _0x42437a;var _0x472ab9;return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x25d497[_0x276d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b630b,null))[_0x276d('0x24')](function(_0x1466fc){if(_0x1466fc){_0x42437a=_0x1466fc;_0xd70176[_0x276d('0x32')]=_[_0x276d('0x33')](db[_0x276d('0x64')][_0x276d('0x2f')]);_0xd70176[_0x276d('0x36')]=_[_0x276d('0x33')](_0x25d497[_0x276d('0x36')]);_0xd70176[_0x276d('0x34')]=_['intersection'](_0xd70176['model'],_0xd70176[_0x276d('0x36')]);_0x46b542['attributes']=_[_0x276d('0x35')](_0xd70176[_0x276d('0x32')],qs['fields'](_0x25d497[_0x276d('0x36')]['fields']));_0x46b542[_0x276d('0x37')]=_0x46b542[_0x276d('0x37')][_0x276d('0x39')]?_0x46b542['attributes']:_0xd70176[_0x276d('0x32')];_0x46b542[_0x276d('0x3c')]=qs['sort'](_0x25d497['query']['sort']);_0x46b542[_0x276d('0x3e')]=qs['filters'](_[_0x276d('0x3f')](_0x25d497['query'],_0xd70176['filters']));if(_0x25d497['query']['filter']){_0x46b542[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x46b542[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x46b542[_0x276d('0x37')],function(_0x2a112a){var _0xa76923={};_0xa76923[_0x2a112a]={'$like':'%'+_0x25d497[_0x276d('0x36')]['filter']+'%'};return _0xa76923;})});}_0x46b542=_['merge']({},_0x46b542,_0x25d497[_0x276d('0x42')]);return _0x42437a[_0x276d('0x63')](_0x46b542);}})['then'](function(_0x194abc){if(_0x194abc){_0x472ab9=_0x194abc[_0x276d('0x39')];if(!_0x25d497[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x46b542['limit']=qs[_0x276d('0x1d')](_0x25d497['query'][_0x276d('0x1d')]);_0x46b542[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x25d497[_0x276d('0x36')][_0x276d('0x20')]);}return _0x42437a[_0x276d('0x63')](_0x46b542);}})[_0x276d('0x24')](function(_0x48cdcf){if(_0x48cdcf){return _0x48cdcf?{'count':_0x472ab9,'rows':_0x48cdcf}:null;}})[_0x276d('0x24')](respondWithResult(_0x2b630b,null))['catch'](handleError(_0x2b630b,null));};exports[_0x276d('0x65')]=function(_0x2e74fe,_0x2f5c86,_0x182fc0){var _0x3d3935,_0x1c49a9;var _0x5157cd=[];var _0x18326f=moment()[_0x276d('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x276d('0x2e')]['find']({'where':{'id':_0x2e74fe[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x2f5c86,null))['then'](function(_0x497088){if(_0x497088){_0x1c49a9=_0x497088;return _0x497088['addLists'](_0x2e74fe[_0x276d('0x55')][_0x276d('0x67')],_['omit'](_0x2e74fe[_0x276d('0x55')],[_0x276d('0x67'),'id'])||{});}return null;})['spread'](function(_0x3f8add){var _0x1eaed3;var _0xfdbcc9;_0x3d3935=_0x3f8add||[];var _0x47ee70=[];if(_0x3f8add){for(var _0x5c3f62=0x0;_0x5c3f62<_0x3f8add['length'];_0x5c3f62+=0x1){var _0x2c4bd3=_0x3f8add[_0x5c3f62][_0x276d('0x25')]({'plain':!![]});_0x1c49a9[_0x276d('0x68')]=_0x2e74fe[_0x276d('0x55')][_0x276d('0x68')]?_0x2e74fe[_0x276d('0x55')][_0x276d('0x68')]:_0x1c49a9[_0x276d('0x68')];switch(_0x1c49a9[_0x276d('0x68')]){case _0x276d('0x69'):_0x1eaed3=squel[_0x276d('0x6a')]()[_0x276d('0x6b')]('cm_hopper')[_0x276d('0x6c')]([_0x276d('0x6d'),'scheduledAt',_0x276d('0x6e'),_0x276d('0x6f'),'CampaignId',_0x276d('0x53'),_0x276d('0x54')],squel[_0x276d('0x70')]()[_0x276d('0x71')](_0x276d('0x6d'),_0x276d('0x6d'))[_0x276d('0x71')](_0x276d('0x72'),'scheduledAt')[_0x276d('0x71')]('id',_0x276d('0x6e'))['field'](_0x2c4bd3[_0x276d('0x73')]['toString'](),_0x276d('0x6f'))[_0x276d('0x71')](_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')](),'CampaignId')[_0x276d('0x71')]('\x27'+_0x18326f+'\x27',_0x276d('0x53'))['field']('\x27'+_0x18326f+'\x27',_0x276d('0x54'))['from'](_0x276d('0x75'))[_0x276d('0x3e')](_0x276d('0x76'))[_0x276d('0x3e')](_0x276d('0x77'),_0x2c4bd3[_0x276d('0x73')][_0x276d('0x74')]())[_0x276d('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x276d('0x78'),squel['select']()[_0x276d('0x71')](_0x276d('0x79'))[_0x276d('0x7a')](_0x276d('0x7b'))[_0x276d('0x3e')](_0x276d('0x7c'),_0x2e74fe['params']['id'][_0x276d('0x74')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x276d('0x70')]()['field'](_0x276d('0x7d'))['from']('cm_hopper')[_0x276d('0x3e')](_0x276d('0x7c'),_0x2e74fe['params']['id'][_0x276d('0x74')]())))[_0x276d('0x74')]();break;case _0x276d('0x7e'):_0x1eaed3=squel[_0x276d('0x6a')]()[_0x276d('0x6b')]('cm_hopper')['fromQuery']([_0x276d('0x6d'),_0x276d('0x7f'),_0x276d('0x6e'),_0x276d('0x6f'),'CampaignId',_0x276d('0x53'),_0x276d('0x54')],squel['select']()['field'](_0x276d('0x6d'),'phone')[_0x276d('0x71')](_0x276d('0x72'),_0x276d('0x7f'))[_0x276d('0x71')]('id',_0x276d('0x6e'))[_0x276d('0x71')](_0x2c4bd3['CmListId'][_0x276d('0x74')](),_0x276d('0x6f'))[_0x276d('0x71')](_0x2e74fe['params']['id'][_0x276d('0x74')](),'CampaignId')['field']('\x27'+_0x18326f+'\x27',_0x276d('0x53'))['field']('\x27'+_0x18326f+'\x27',_0x276d('0x54'))[_0x276d('0x7a')](_0x276d('0x75'))[_0x276d('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0x276d('0x77'),_0x2c4bd3[_0x276d('0x73')]['toString']())[_0x276d('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x276d('0x70')]()['field'](_0x276d('0x7d'))[_0x276d('0x7a')]('cm_hopper')[_0x276d('0x3e')](_0x276d('0x7c'),_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')]())))[_0x276d('0x74')]();break;default:_0x1eaed3=squel[_0x276d('0x6a')]()['into'](_0x276d('0x80'))[_0x276d('0x6c')](['phone','scheduledAt',_0x276d('0x6e'),_0x276d('0x6f'),_0x276d('0x5b'),_0x276d('0x53'),_0x276d('0x54')],squel[_0x276d('0x70')]()[_0x276d('0x71')]('phone',_0x276d('0x6d'))[_0x276d('0x71')](_0x276d('0x72'),_0x276d('0x7f'))['field']('id','ContactId')[_0x276d('0x71')](_0x2c4bd3['CmListId'][_0x276d('0x74')](),_0x276d('0x6f'))[_0x276d('0x71')](_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')](),_0x276d('0x5b'))[_0x276d('0x71')]('\x27'+_0x18326f+'\x27',_0x276d('0x53'))[_0x276d('0x71')]('\x27'+_0x18326f+'\x27','updatedAt')[_0x276d('0x7a')](_0x276d('0x75'))[_0x276d('0x3e')](_0x276d('0x76'))[_0x276d('0x3e')](_0x276d('0x77'),_0x2c4bd3[_0x276d('0x73')][_0x276d('0x74')]())[_0x276d('0x3e')](_0x276d('0x81')))['toString']();}_0xfdbcc9=squel[_0x276d('0x6a')]()[_0x276d('0x6b')](_0x276d('0x82'))[_0x276d('0x6c')](['cmHopperId','scheduledAt','phone',_0x276d('0x83'),_0x276d('0x53'),_0x276d('0x54')],squel[_0x276d('0x70')]()[_0x276d('0x71')]('h.id','id')[_0x276d('0x71')]('NOW()',_0x276d('0x7f'))['field'](_0x276d('0x84'),'phone')['field'](_0x276d('0x85'),_0x276d('0x83'))[_0x276d('0x71')]('\x27'+_0x18326f+'\x27','createdAt')[_0x276d('0x71')]('\x27'+_0x18326f+'\x27',_0x276d('0x54'))[_0x276d('0x7a')]('cm_contact_has_items','ci')[_0x276d('0x86')](_0x276d('0x80'),'h',_0x276d('0x87'))['where']('h.ListId\x20=\x20?',_0x2c4bd3[_0x276d('0x73')][_0x276d('0x74')]())['where']('h.CampaignId=?',_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')]())[_0x276d('0x3e')](_0x276d('0x88'),_0x18326f))[_0x276d('0x74')]();_0x47ee70[_0x276d('0x89')](db[_0x276d('0x8a')]['query'](_0x1eaed3));_0x5157cd[_0x276d('0x89')](db['sequelize'][_0x276d('0x36')](_0xfdbcc9));}return BPromise[_0x276d('0x8b')](_0x47ee70);}})[_0x276d('0x24')](function(){return BPromise[_0x276d('0x8b')](_0x5157cd);})[_0x276d('0x24')](function(){return _0x3d3935;})[_0x276d('0x24')](respondWithResult(_0x2f5c86,null))[_0x276d('0x46')](handleError(_0x2f5c86,null));};exports[_0x276d('0x8c')]=function(_0x4bce23,_0x1694f6,_0x420116){return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x4bce23[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x1694f6,null))[_0x276d('0x24')](function(_0x418b5d){if(_0x418b5d){return _0x418b5d[_0x276d('0x8c')](_0x4bce23[_0x276d('0x36')][_0x276d('0x67')]);}})[_0x276d('0x24')](function(_0x155ef3){if(_0x155ef3){return db[_0x276d('0x5a')][_0x276d('0x8d')]({'where':{'ListId':_0x4bce23[_0x276d('0x36')][_0x276d('0x67')],'CampaignId':_0x4bce23[_0x276d('0x48')]['id']}})[_0x276d('0x24')](function(){return _0x155ef3;});}})[_0x276d('0x24')](respondWithStatusCode(_0x1694f6,null))[_0x276d('0x46')](handleError(_0x1694f6,null));};exports['getBlackLists']=function(_0x2d78b7,_0x24ceb3,_0x386b55){var _0x4b3db8={};var _0x2d649c={};var _0x1163f8;var _0x49553f;return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x2d78b7['params']['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x24ceb3,null))[_0x276d('0x24')](function(_0x39ce5c){if(_0x39ce5c){_0x1163f8=_0x39ce5c;_0x2d649c['model']=_[_0x276d('0x33')](db[_0x276d('0x64')][_0x276d('0x2f')]);_0x2d649c[_0x276d('0x36')]=_[_0x276d('0x33')](_0x2d78b7['query']);_0x2d649c[_0x276d('0x34')]=_[_0x276d('0x35')](_0x2d649c[_0x276d('0x32')],_0x2d649c[_0x276d('0x36')]);_0x4b3db8[_0x276d('0x37')]=_[_0x276d('0x35')](_0x2d649c[_0x276d('0x32')],qs[_0x276d('0x38')](_0x2d78b7[_0x276d('0x36')][_0x276d('0x38')]));_0x4b3db8[_0x276d('0x37')]=_0x4b3db8[_0x276d('0x37')][_0x276d('0x39')]?_0x4b3db8['attributes']:_0x2d649c[_0x276d('0x32')];_0x4b3db8['order']=qs[_0x276d('0x3d')](_0x2d78b7[_0x276d('0x36')][_0x276d('0x3d')]);_0x4b3db8['where']=qs[_0x276d('0x34')](_['pick'](_0x2d78b7['query'],_0x2d649c[_0x276d('0x34')]));if(_0x2d78b7['query'][_0x276d('0x40')]){_0x4b3db8[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x4b3db8[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x4b3db8[_0x276d('0x37')],function(_0xfe7ec7){var _0x3689da={};_0x3689da[_0xfe7ec7]={'$like':'%'+_0x2d78b7[_0x276d('0x36')][_0x276d('0x40')]+'%'};return _0x3689da;})});}_0x4b3db8=_[_0x276d('0x41')]({},_0x4b3db8,_0x2d78b7[_0x276d('0x42')]);return _0x1163f8[_0x276d('0x8e')](_0x4b3db8);}})[_0x276d('0x24')](function(_0x133139){if(_0x133139){_0x49553f=_0x133139[_0x276d('0x39')];if(!_0x2d78b7[_0x276d('0x36')]['hasOwnProperty'](_0x276d('0x3b'))){_0x4b3db8[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x2d78b7[_0x276d('0x36')][_0x276d('0x1d')]);_0x4b3db8[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x2d78b7[_0x276d('0x36')]['offset']);}return _0x1163f8['getBlackLists'](_0x4b3db8);}})[_0x276d('0x24')](function(_0xac7aff){if(_0xac7aff){return _0xac7aff?{'count':_0x49553f,'rows':_0xac7aff}:null;}})[_0x276d('0x24')](respondWithResult(_0x24ceb3,null))['catch'](handleError(_0x24ceb3,null));};exports[_0x276d('0x8f')]=function(_0x5c6eda,_0x1dd8dd,_0x3e4df2){var _0x505ba4,_0x41e08c;var _0x1d2081=[];var _0x540bdc=moment()[_0x276d('0x66')](_0x276d('0x90'));return db[_0x276d('0x2e')]['find']({'where':{'id':_0x5c6eda[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x1dd8dd,null))[_0x276d('0x24')](function(_0x546134){if(_0x546134){_0x41e08c=_0x546134;return _0x546134[_0x276d('0x8f')](_0x5c6eda['body'][_0x276d('0x67')],_[_0x276d('0x52')](_0x5c6eda[_0x276d('0x55')],['ids','id'])||{});}return null;})[_0x276d('0x91')](function(_0x3dd699){var _0x1d64b3;var _0x35944c;_0x505ba4=_0x3dd699||[];var _0xed2e5f=[];if(_0x3dd699){for(var _0x4b0354=0x0;_0x4b0354<_0x3dd699['length'];_0x4b0354+=0x1){var _0x5e5df1=_0x3dd699[_0x4b0354][_0x276d('0x25')]({'plain':!![]});_0x1d64b3=squel[_0x276d('0x6a')]()['into'](_0x276d('0x92'))[_0x276d('0x6c')]([_0x276d('0x6d'),_0x276d('0x6e'),'ListId',_0x276d('0x5b'),_0x276d('0x53'),'updatedAt'],squel[_0x276d('0x70')]()[_0x276d('0x71')]('phone',_0x276d('0x6d'))[_0x276d('0x71')]('id',_0x276d('0x6e'))[_0x276d('0x71')](_0x5e5df1['CmListId'][_0x276d('0x74')](),_0x276d('0x6f'))['field'](_0x5c6eda['params']['id'][_0x276d('0x74')](),_0x276d('0x5b'))['field']('NOW()','createdAt')[_0x276d('0x71')](_0x276d('0x72'),_0x276d('0x54'))[_0x276d('0x7a')](_0x276d('0x75'))[_0x276d('0x3e')]('deletedAt\x20IS\x20NULL')[_0x276d('0x3e')](_0x276d('0x77'),_0x5e5df1['CmListId']['toString']())[_0x276d('0x3e')](_0x276d('0x81')))[_0x276d('0x74')]();_0xed2e5f[_0x276d('0x89')](db[_0x276d('0x8a')]['query'](_0x1d64b3));}return BPromise[_0x276d('0x8b')](_0xed2e5f);}})['then'](function(){return _0x505ba4;})[_0x276d('0x24')](respondWithResult(_0x1dd8dd,null))[_0x276d('0x46')](handleError(_0x1dd8dd,null));};exports['removeBlackLists']=function(_0x394524,_0x245298,_0x42a6f6){return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x394524[_0x276d('0x48')]['id']}})['then'](handleEntityNotFound(_0x245298,null))['then'](function(_0x46cd07){if(_0x46cd07){return _0x46cd07['removeBlackLists'](_0x394524[_0x276d('0x36')][_0x276d('0x67')]);}})[_0x276d('0x24')](function(_0x186ce0){if(_0x186ce0){return db[_0x276d('0x62')][_0x276d('0x8d')]({'where':{'ListId':_0x394524['query'][_0x276d('0x67')],'CampaignId':_0x394524[_0x276d('0x48')]['id']}})[_0x276d('0x24')](function(){return _0x186ce0;});}})['then'](respondWithStatusCode(_0x245298,null))[_0x276d('0x46')](handleError(_0x245298,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 9dbcb18..099d824 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(_0x148316,_0x6c9dc){var _0xdbe95d=function(_0x138a9f){while(--_0x138a9f){_0x148316['push'](_0x148316['shift']());}};_0xdbe95d(++_0x6c9dc);}(_0x7a54,0x106));var _0x47a5=function(_0x264c86,_0x4e2802){_0x264c86=_0x264c86-0x0;var _0x4bb9f3=_0x7a54[_0x264c86];return _0x4bb9f3;};'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(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index c42cd48..a72e158 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 _0x7b05=['Campaign','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCampaign','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch'];(function(_0x46c608,_0x3f1a60){var _0x515e44=function(_0x346499){while(--_0x346499){_0x46c608['push'](_0x46c608['shift']());}};_0x515e44(++_0x3f1a60);}(_0x7b05,0x91));var _0x57b0=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0x7b05[_0x421e36];return _0x20b3e3;};'use strict';var _=require(_0x57b0('0x0'));var util=require(_0x57b0('0x1'));var moment=require(_0x57b0('0x2'));var BPromise=require(_0x57b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57b0('0x5'));var logger=require(_0x57b0('0x6'))(_0x57b0('0x7'));var config=require(_0x57b0('0x8'));var jayson=require(_0x57b0('0x9'));var client=jayson['client'][_0x57b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d8aae,_0x2f67ae,_0x289bea){return new BPromise(function(_0x4c970f,_0x59e88a){return client['request'](_0x4d8aae,_0x289bea)['then'](function(_0x13988a){logger[_0x57b0('0xb')]('Campaign,\x20%s,\x20%s',_0x2f67ae,'request\x20sent');logger['debug'](_0x57b0('0xc'),_0x2f67ae,_0x57b0('0xd'),JSON[_0x57b0('0xe')](_0x13988a));if(_0x13988a[_0x57b0('0xf')]){if(_0x13988a[_0x57b0('0xf')][_0x57b0('0x10')]===0x1f4){logger['error'](_0x57b0('0x11'),_0x2f67ae,_0x13988a[_0x57b0('0xf')][_0x57b0('0x12')]);return _0x59e88a(_0x13988a['error']['message']);}logger[_0x57b0('0xf')](_0x57b0('0x11'),_0x2f67ae,_0x13988a[_0x57b0('0xf')][_0x57b0('0x12')]);return _0x4c970f(_0x13988a['error'][_0x57b0('0x12')]);}else{logger['info'](_0x57b0('0x11'),_0x2f67ae,_0x57b0('0xd'));_0x4c970f(_0x13988a['result'][_0x57b0('0x12')]);}})[_0x57b0('0x13')](function(_0x8bb929){logger[_0x57b0('0xf')](_0x57b0('0x11'),_0x2f67ae,_0x8bb929);_0x59e88a(_0x8bb929);});});}exports['GetCampaign']=function(_0x37bd5d){var _0x4ac304=this;return new Promise(function(_0x592b2d,_0x1f18a7){return db[_0x57b0('0x14')][_0x57b0('0x15')]({'raw':_0x37bd5d[_0x57b0('0x16')]?_0x37bd5d[_0x57b0('0x16')][_0x57b0('0x17')]===undefined?!![]:![]:!![],'where':_0x37bd5d['options']?_0x37bd5d[_0x57b0('0x16')][_0x57b0('0x18')]||null:null,'attributes':_0x37bd5d[_0x57b0('0x16')]?_0x37bd5d['options'][_0x57b0('0x19')]||null:null,'limit':_0x37bd5d[_0x57b0('0x16')]?_0x37bd5d[_0x57b0('0x16')][_0x57b0('0x1a')]||null:null,'include':_0x37bd5d[_0x57b0('0x16')]?_0x37bd5d[_0x57b0('0x16')][_0x57b0('0x1b')]?_[_0x57b0('0x1c')](_0x37bd5d[_0x57b0('0x16')]['include'],function(_0x55b870){return{'model':db[_0x55b870[_0x57b0('0x1d')]],'as':_0x55b870['as'],'attributes':_0x55b870['attributes'],'include':_0x55b870[_0x57b0('0x1b')]?_[_0x57b0('0x1c')](_0x55b870[_0x57b0('0x1b')],function(_0x38e3a0){return{'model':db[_0x38e3a0[_0x57b0('0x1d')]],'as':_0x38e3a0['as'],'attributes':_0x38e3a0[_0x57b0('0x19')],'include':_0x38e3a0[_0x57b0('0x1b')]?_[_0x57b0('0x1c')](_0x38e3a0[_0x57b0('0x1b')],function(_0x109678){return{'model':db[_0x109678[_0x57b0('0x1d')]],'as':_0x109678['as'],'attributes':_0x109678[_0x57b0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x57b0('0x1e')](function(_0x508288){logger[_0x57b0('0xb')](_0x57b0('0x1f'),_0x37bd5d);logger[_0x57b0('0x20')](_0x57b0('0x1f'),_0x37bd5d,JSON['stringify'](_0x508288));_0x592b2d(_0x508288);})['catch'](function(_0x325e39){logger[_0x57b0('0xf')](_0x57b0('0x1f'),_0x325e39['message'],_0x37bd5d);_0x1f18a7(_0x4ac304['error'](0x1f4,_0x325e39[_0x57b0('0x12')]));});});}; \ No newline at end of file +var _0x142c=['message','info','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x666f3c,_0x5d442e){var _0x3a4823=function(_0x16530c){while(--_0x16530c){_0x666f3c['push'](_0x666f3c['shift']());}};_0x3a4823(++_0x5d442e);}(_0x142c,0x86));var _0xc142=function(_0x320d12,_0x4c0ae8){_0x320d12=_0x320d12-0x0;var _0x9b4c7c=_0x142c[_0x320d12];return _0x9b4c7c;};'use strict';var _=require(_0xc142('0x0'));var util=require('util');var moment=require(_0xc142('0x1'));var BPromise=require(_0xc142('0x2'));var rs=require(_0xc142('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc142('0x4'))['db'];var utils=require(_0xc142('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc142('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc142('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6796,_0x43226a,_0x30bf01){return new BPromise(function(_0x4ba28e,_0x5c9b91){return client[_0xc142('0x8')](_0x2d6796,_0x30bf01)[_0xc142('0x9')](function(_0x590002){logger['info'](_0xc142('0xa'),_0x43226a,_0xc142('0xb'));logger['debug'](_0xc142('0xc'),_0x43226a,'request\x20sent',JSON[_0xc142('0xd')](_0x590002));if(_0x590002['error']){if(_0x590002[_0xc142('0xe')][_0xc142('0xf')]===0x1f4){logger[_0xc142('0xe')](_0xc142('0xa'),_0x43226a,_0x590002['error'][_0xc142('0x10')]);return _0x5c9b91(_0x590002[_0xc142('0xe')]['message']);}logger[_0xc142('0xe')]('Campaign,\x20%s,\x20%s',_0x43226a,_0x590002[_0xc142('0xe')]['message']);return _0x4ba28e(_0x590002['error'][_0xc142('0x10')]);}else{logger[_0xc142('0x11')](_0xc142('0xa'),_0x43226a,_0xc142('0xb'));_0x4ba28e(_0x590002['result'][_0xc142('0x10')]);}})[_0xc142('0x12')](function(_0x260844){logger[_0xc142('0xe')](_0xc142('0xa'),_0x43226a,_0x260844);_0x5c9b91(_0x260844);});});}exports[_0xc142('0x13')]=function(_0x59e6c0){var _0x2d55c5=this;return new Promise(function(_0x18fcee,_0x20ead4){return db[_0xc142('0x14')][_0xc142('0x15')]({'raw':_0x59e6c0[_0xc142('0x16')]?_0x59e6c0[_0xc142('0x16')][_0xc142('0x17')]===undefined?!![]:![]:!![],'where':_0x59e6c0[_0xc142('0x16')]?_0x59e6c0[_0xc142('0x16')][_0xc142('0x18')]||null:null,'attributes':_0x59e6c0['options']?_0x59e6c0['options'][_0xc142('0x19')]||null:null,'limit':_0x59e6c0['options']?_0x59e6c0[_0xc142('0x16')][_0xc142('0x1a')]||null:null,'include':_0x59e6c0[_0xc142('0x16')]?_0x59e6c0[_0xc142('0x16')][_0xc142('0x1b')]?_[_0xc142('0x1c')](_0x59e6c0[_0xc142('0x16')][_0xc142('0x1b')],function(_0x4fae76){return{'model':db[_0x4fae76[_0xc142('0x1d')]],'as':_0x4fae76['as'],'attributes':_0x4fae76[_0xc142('0x19')],'include':_0x4fae76[_0xc142('0x1b')]?_[_0xc142('0x1c')](_0x4fae76[_0xc142('0x1b')],function(_0x553a0c){return{'model':db[_0x553a0c[_0xc142('0x1d')]],'as':_0x553a0c['as'],'attributes':_0x553a0c[_0xc142('0x19')],'include':_0x553a0c['include']?_[_0xc142('0x1c')](_0x553a0c[_0xc142('0x1b')],function(_0x4e49ab){return{'model':db[_0x4e49ab['model']],'as':_0x4e49ab['as'],'attributes':_0x4e49ab[_0xc142('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc142('0x9')](function(_0x88d193){logger['info'](_0xc142('0x13'),_0x59e6c0);logger['debug'](_0xc142('0x13'),_0x59e6c0,JSON[_0xc142('0xd')](_0x88d193));_0x18fcee(_0x88d193);})['catch'](function(_0x472372){logger[_0xc142('0xe')](_0xc142('0x13'),_0x472372[_0xc142('0x10')],_0x59e6c0);_0x20ead4(_0x2d55c5[_0xc142('0xe')](0x1f4,_0x472372['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index a952660..aac6ed5 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 _0x81ea=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','/:id/lists','removeLists','/:id/blacklists','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81ea,0x1e7));var _0xa81e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81ea[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xa81e('0x0'));var util=require(_0xa81e('0x1'));var path=require(_0xa81e('0x2'));var timeout=require(_0xa81e('0x3'));var express=require(_0xa81e('0x4'));var router=express[_0xa81e('0x5')]();var fs_extra=require(_0xa81e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa81e('0x7'));var config=require('../../config/environment');var controller=require(_0xa81e('0x8'));router[_0xa81e('0x9')]('/',auth[_0xa81e('0xa')](),controller[_0xa81e('0xb')]);router['get'](_0xa81e('0xc'),auth[_0xa81e('0xa')](),controller['show']);router['get'](_0xa81e('0xd'),auth[_0xa81e('0xa')](),controller[_0xa81e('0xe')]);router[_0xa81e('0x9')](_0xa81e('0xf'),auth['isAuthenticated'](),controller[_0xa81e('0x10')]);router[_0xa81e('0x9')]('/:id/hopper_finals',auth[_0xa81e('0xa')](),controller[_0xa81e('0x11')]);router[_0xa81e('0x9')](_0xa81e('0x12'),auth['isAuthenticated'](),controller[_0xa81e('0x13')]);router[_0xa81e('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0xa81e('0x14')]);router['get']('/:id/blacklists',auth[_0xa81e('0xa')](),controller[_0xa81e('0x15')]);router[_0xa81e('0x16')]('/',auth[_0xa81e('0xa')](),controller[_0xa81e('0x17')]);router[_0xa81e('0x16')](_0xa81e('0x18'),auth[_0xa81e('0xa')](),controller[_0xa81e('0x19')]);router[_0xa81e('0x16')]('/:id/lists',auth[_0xa81e('0xa')](),controller[_0xa81e('0x1a')]);router[_0xa81e('0x16')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xa81e('0x1b')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa81e('0x1c')]);router[_0xa81e('0x1d')](_0xa81e('0xc'),auth[_0xa81e('0xa')](),controller[_0xa81e('0x1e')]);router[_0xa81e('0x1d')](_0xa81e('0x1f'),auth[_0xa81e('0xa')](),controller[_0xa81e('0x20')]);router['delete'](_0xa81e('0x21'),auth[_0xa81e('0xa')](),controller['removeBlackLists']);module[_0xa81e('0x22')]=router; \ No newline at end of file +var _0xaa81=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','update','delete','destroy','/:id/lists','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0x596850,_0x57bf08){var _0x110dfb=function(_0x2ce63e){while(--_0x2ce63e){_0x596850['push'](_0x596850['shift']());}};_0x110dfb(++_0x57bf08);}(_0xaa81,0x136));var _0x1aa8=function(_0x4e3d8b,_0x4cd1ee){_0x4e3d8b=_0x4e3d8b-0x0;var _0x1c563f=_0xaa81[_0x4e3d8b];return _0x1c563f;};'use strict';var multer=require('multer');var util=require(_0x1aa8('0x0'));var path=require(_0x1aa8('0x1'));var timeout=require(_0x1aa8('0x2'));var express=require(_0x1aa8('0x3'));var router=express[_0x1aa8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1aa8('0x5'));var interaction=require(_0x1aa8('0x6'));var config=require(_0x1aa8('0x7'));var controller=require(_0x1aa8('0x8'));router[_0x1aa8('0x9')]('/',auth[_0x1aa8('0xa')](),controller[_0x1aa8('0xb')]);router[_0x1aa8('0x9')](_0x1aa8('0xc'),auth[_0x1aa8('0xa')](),controller[_0x1aa8('0xd')]);router[_0x1aa8('0x9')](_0x1aa8('0xe'),auth['isAuthenticated'](),controller[_0x1aa8('0xf')]);router[_0x1aa8('0x9')]('/:id/hopper_histories',auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x10')]);router['get']('/:id/hopper_finals',auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x11')]);router[_0x1aa8('0x9')](_0x1aa8('0x12'),auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x13')]);router[_0x1aa8('0x9')]('/:id/lists',auth[_0x1aa8('0xa')](),controller['getLists']);router['get'](_0x1aa8('0x14'),auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x15')]);router[_0x1aa8('0x16')]('/',auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x17')]);router['post'](_0x1aa8('0x18'),auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x19')]);router[_0x1aa8('0x16')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x1aa8('0x16')]('/:id/blacklists',auth[_0x1aa8('0xa')](),controller['addBlackLists']);router['put'](_0x1aa8('0xc'),auth['isAuthenticated'](),controller[_0x1aa8('0x1a')]);router[_0x1aa8('0x1b')](_0x1aa8('0xc'),auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x1c')]);router[_0x1aa8('0x1b')](_0x1aa8('0x1d'),auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x1e')]);router[_0x1aa8('0x1b')]('/:id/blacklists',auth[_0x1aa8('0xa')](),controller[_0x1aa8('0x1f')]);module[_0x1aa8('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index a42cf13..f7f5d36 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 _0xde86=['VIRTUAL','getDataValue','exports','TEXT','medium','STRING'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xde86,0x12e));var _0x6de8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde86[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6de8('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6de8('0x1')],'length':_0x6de8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6de8('0x3')]},'name':{'type':Sequelize[_0x6de8('0x4')],'get':function(){return this[_0x6de8('0x5')]('key');}}}; \ No newline at end of file +var _0xa2ed=['getDataValue','sequelize','exports','STRING','TEXT','medium','VIRTUAL'];(function(_0x8e1a06,_0x2035f9){var _0x169a32=function(_0x503061){while(--_0x503061){_0x8e1a06['push'](_0x8e1a06['shift']());}};_0x169a32(++_0x2035f9);}(_0xa2ed,0x15f));var _0xda2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2ed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xda2e('0x0'));module[_0xda2e('0x1')]={'key':{'type':Sequelize[_0xda2e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xda2e('0x3')],'length':_0xda2e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xda2e('0x2')]},'name':{'type':Sequelize[_0xda2e('0x5')],'get':function(){return this[_0xda2e('0x6')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index be947bd..3001e8a 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 _0xbce4=['length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','fields','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','bluebird','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','send','index','map','CannedAnswer','rawAttributes','key','model','query','keys','filters','intersection','attributes'];(function(_0x4e5000,_0x465702){var _0x5b7b18=function(_0x545b8c){while(--_0x545b8c){_0x4e5000['push'](_0x4e5000['shift']());}};_0x5b7b18(++_0x465702);}(_0xbce4,0x10c));var _0x4bce=function(_0x1a1bbb,_0x5ce297){_0x1a1bbb=_0x1a1bbb-0x0;var _0x1b96a4=_0xbce4[_0x1a1bbb];return _0x1b96a4;};'use strict';var emlformat=require(_0x4bce('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4bce('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4bce('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4bce('0x3'));var csv=require(_0x4bce('0x4'));var ejs=require(_0x4bce('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bce('0x6'));var squel=require('squel');var crypto=require(_0x4bce('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x4bce('0x8'));var toCsv=require(_0x4bce('0x4'));var querystring=require(_0x4bce('0x9'));var Papa=require(_0x4bce('0xa'));var Redis=require(_0x4bce('0xb'));var authService=require(_0x4bce('0xc'));var qs=require(_0x4bce('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4bce('0xe'));var logger=require(_0x4bce('0xf'))(_0x4bce('0x10'));var utils=require('../../config/utils');var config=require(_0x4bce('0x11'));var licenseUtil=require(_0x4bce('0x12'));var db=require(_0x4bce('0x13'))['db'];function respondWithStatusCode(_0x17c29b,_0x4f4a3b){_0x4f4a3b=_0x4f4a3b||0xcc;return function(_0x20d220){if(_0x20d220){return _0x17c29b['sendStatus'](_0x4f4a3b);}return _0x17c29b[_0x4bce('0x14')](_0x4f4a3b)[_0x4bce('0x15')]();};}function respondWithResult(_0x5eccb1,_0x52b61e){_0x52b61e=_0x52b61e||0xc8;return function(_0x2d6612){if(_0x2d6612){return _0x5eccb1['status'](_0x52b61e)['json'](_0x2d6612);}};}function respondWithFilteredResult(_0x205805,_0x1a2f3c){return function(_0xc73fb0){if(_0xc73fb0){var _0xe90e08=typeof _0x1a2f3c[_0x4bce('0x16')]===_0x4bce('0x17')&&typeof _0x1a2f3c[_0x4bce('0x18')]===_0x4bce('0x17');var _0x446f06=_0xc73fb0[_0x4bce('0x19')];var _0x57210f=_0xe90e08?0x0:_0x1a2f3c[_0x4bce('0x16')];var _0x42dfa3=_0xe90e08?_0xc73fb0[_0x4bce('0x19')]:_0x1a2f3c[_0x4bce('0x16')]+_0x1a2f3c[_0x4bce('0x18')];var _0x38eb8b;if(_0x42dfa3>=_0x446f06){_0x42dfa3=_0x446f06;_0x38eb8b=0xc8;}else{_0x38eb8b=0xce;}_0x205805['status'](_0x38eb8b);return _0x205805['set']('Content-Range',_0x57210f+'-'+_0x42dfa3+'/'+_0x446f06)[_0x4bce('0x1a')](_0xc73fb0);}return null;};}function patchUpdates(_0x481bfa){return function(_0x2e7f68){try{jsonpatch['apply'](_0x2e7f68,_0x481bfa,!![]);}catch(_0x5a65c8){return BPromise['reject'](_0x5a65c8);}return _0x2e7f68['save']();};}function saveUpdates(_0x3e17fe,_0x4361bc){return function(_0x3bd6fc){if(_0x3bd6fc){return _0x3bd6fc[_0x4bce('0x1b')](_0x3e17fe)[_0x4bce('0x1c')](function(_0x5bd12e){return _0x5bd12e;});}return null;};}function removeEntity(_0x5d1725,_0x16aa8a){return function(_0x4ac7bd){if(_0x4ac7bd){return _0x4ac7bd[_0x4bce('0x1d')]()[_0x4bce('0x1c')](function(){var _0x67e6c7=_0x4ac7bd[_0x4bce('0x1e')]({'plain':!![]});var _0x89743a=_0x4bce('0x1f');return db[_0x4bce('0x20')][_0x4bce('0x1d')]({'where':{'type':_0x89743a,'resourceId':_0x67e6c7['id']}})[_0x4bce('0x1c')](function(){return _0x4ac7bd;});})[_0x4bce('0x1c')](function(){_0x5d1725[_0x4bce('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2da,_0x3181f5){return function(_0x5d9527){if(!_0x5d9527){_0x5a2da[_0x4bce('0x21')](0x194);}return _0x5d9527;};}function handleError(_0x49d700,_0x1d1456){_0x1d1456=_0x1d1456||0x1f4;return function(_0x2da471){logger['error'](_0x2da471[_0x4bce('0x22')]);if(_0x2da471[_0x4bce('0x23')]){delete _0x2da471[_0x4bce('0x23')];}_0x49d700['status'](_0x1d1456)[_0x4bce('0x24')](_0x2da471);};}exports[_0x4bce('0x25')]=function(_0x3154a1,_0x580387){var _0x5cb792={},_0x496789={},_0x1226ef={'count':0x0,'rows':[]};var _0x2bf248=_[_0x4bce('0x26')](db[_0x4bce('0x27')][_0x4bce('0x28')],function(_0x2a61b6){return{'name':_0x2a61b6['fieldName'],'type':_0x2a61b6['type'][_0x4bce('0x29')]};});_0x496789[_0x4bce('0x2a')]=_['map'](_0x2bf248,_0x4bce('0x23'));_0x496789[_0x4bce('0x2b')]=_[_0x4bce('0x2c')](_0x3154a1['query']);_0x496789[_0x4bce('0x2d')]=_[_0x4bce('0x2e')](_0x496789[_0x4bce('0x2a')],_0x496789['query']);_0x5cb792[_0x4bce('0x2f')]=_[_0x4bce('0x2e')](_0x496789['model'],qs['fields'](_0x3154a1[_0x4bce('0x2b')]['fields']));_0x5cb792[_0x4bce('0x2f')]=_0x5cb792[_0x4bce('0x2f')][_0x4bce('0x30')]?_0x5cb792[_0x4bce('0x2f')]:_0x496789['model'];if(!_0x3154a1[_0x4bce('0x2b')][_0x4bce('0x31')](_0x4bce('0x32'))){_0x5cb792['limit']=qs[_0x4bce('0x18')](_0x3154a1['query'][_0x4bce('0x18')]);_0x5cb792[_0x4bce('0x16')]=qs[_0x4bce('0x16')](_0x3154a1[_0x4bce('0x2b')][_0x4bce('0x16')]);}_0x5cb792[_0x4bce('0x33')]=qs['sort'](_0x3154a1['query']['sort']);_0x5cb792[_0x4bce('0x34')]=qs[_0x4bce('0x2d')](_[_0x4bce('0x35')](_0x3154a1[_0x4bce('0x2b')],_0x496789['filters']),_0x2bf248);if(_0x3154a1[_0x4bce('0x2b')][_0x4bce('0x36')]){_0x5cb792['where']=_[_0x4bce('0x37')](_0x5cb792[_0x4bce('0x34')],{'$or':[{'key':{'$like':'%'+_0x3154a1[_0x4bce('0x2b')]['filter']+'%'}},{'value':{'$like':'%'+_0x3154a1['query'][_0x4bce('0x36')]+'%'}}]});}_0x5cb792=_['merge']({},_0x5cb792,_0x3154a1[_0x4bce('0x38')]);var _0x49f5f6={'where':_0x5cb792[_0x4bce('0x34')]};return db[_0x4bce('0x27')][_0x4bce('0x19')](_0x49f5f6)[_0x4bce('0x1c')](function(_0x35633c){_0x1226ef['count']=_0x35633c;if(_0x3154a1['query'][_0x4bce('0x39')]){_0x5cb792[_0x4bce('0x3a')]=[{'all':!![]}];}return db[_0x4bce('0x27')][_0x4bce('0x3b')](_0x5cb792);})[_0x4bce('0x1c')](function(_0x39cb2a){_0x1226ef['rows']=_0x39cb2a;return _0x1226ef;})[_0x4bce('0x1c')](respondWithFilteredResult(_0x580387,_0x5cb792))[_0x4bce('0x3c')](handleError(_0x580387,null));};exports['show']=function(_0x25b6bd,_0x2a2d02){var _0x40bd0d={'raw':!![],'where':{'id':_0x25b6bd[_0x4bce('0x3d')]['id']}},_0x5ac706={};_0x5ac706[_0x4bce('0x2a')]=_[_0x4bce('0x2c')](db['CannedAnswer']['rawAttributes']);_0x5ac706[_0x4bce('0x2b')]=_['keys'](_0x25b6bd[_0x4bce('0x2b')]);_0x5ac706[_0x4bce('0x2d')]=_[_0x4bce('0x2e')](_0x5ac706[_0x4bce('0x2a')],_0x5ac706['query']);_0x40bd0d['attributes']=_[_0x4bce('0x2e')](_0x5ac706['model'],qs[_0x4bce('0x3e')](_0x25b6bd[_0x4bce('0x2b')]['fields']));_0x40bd0d[_0x4bce('0x2f')]=_0x40bd0d['attributes'][_0x4bce('0x30')]?_0x40bd0d[_0x4bce('0x2f')]:_0x5ac706['model'];if(_0x25b6bd[_0x4bce('0x2b')][_0x4bce('0x39')]){_0x40bd0d[_0x4bce('0x3a')]=[{'all':!![]}];}_0x40bd0d=_[_0x4bce('0x37')]({},_0x40bd0d,_0x25b6bd[_0x4bce('0x38')]);return db[_0x4bce('0x27')]['find'](_0x40bd0d)[_0x4bce('0x1c')](handleEntityNotFound(_0x2a2d02,null))[_0x4bce('0x1c')](respondWithResult(_0x2a2d02,null))[_0x4bce('0x3c')](handleError(_0x2a2d02,null));};exports['update']=function(_0x2896af,_0x502859){if(_0x2896af[_0x4bce('0x3f')]['id']){delete _0x2896af[_0x4bce('0x3f')]['id'];}return db[_0x4bce('0x27')][_0x4bce('0x40')]({'where':{'id':_0x2896af[_0x4bce('0x3d')]['id']}})['then'](handleEntityNotFound(_0x502859,null))[_0x4bce('0x1c')](saveUpdates(_0x2896af[_0x4bce('0x3f')],null))[_0x4bce('0x1c')](respondWithResult(_0x502859,null))[_0x4bce('0x3c')](handleError(_0x502859,null));};exports['destroy']=function(_0x4ef35b,_0x95715d){return db[_0x4bce('0x27')]['find']({'where':{'id':_0x4ef35b['params']['id']}})['then'](handleEntityNotFound(_0x95715d,null))[_0x4bce('0x1c')](removeEntity(_0x95715d,null))[_0x4bce('0x3c')](handleError(_0x95715d,null));};exports[_0x4bce('0x41')]=function(_0x412cda,_0x48f06e){var _0x2a067d={'key':_0x412cda['body'][_0x4bce('0x29')]};if(_0x412cda[_0x4bce('0x3f')]['MailAccountId']){_0x2a067d[_0x4bce('0x42')]=_0x412cda[_0x4bce('0x3f')][_0x4bce('0x42')];}else if(_0x412cda[_0x4bce('0x3f')][_0x4bce('0x43')]){_0x2a067d[_0x4bce('0x43')]=_0x412cda['body'][_0x4bce('0x43')];}else if(_0x412cda[_0x4bce('0x3f')][_0x4bce('0x44')]){_0x2a067d[_0x4bce('0x44')]=_0x412cda[_0x4bce('0x3f')][_0x4bce('0x44')];}else if(_0x412cda[_0x4bce('0x3f')][_0x4bce('0x45')]){_0x2a067d[_0x4bce('0x45')]=_0x412cda[_0x4bce('0x3f')][_0x4bce('0x45')];}return db[_0x4bce('0x27')][_0x4bce('0x40')]({'where':_0x2a067d})[_0x4bce('0x1c')](function(_0x3f0737){if(_0x3f0737){throw new db[(_0x4bce('0x46'))]['ValidationError'](_0x4bce('0x47'));}return db[_0x4bce('0x27')][_0x4bce('0x41')](_0x412cda[_0x4bce('0x3f')]);})['then'](function(_0x18f6ff){var _0x2743bb=_0x412cda[_0x4bce('0x48')][_0x4bce('0x1e')]({'plain':!![]});if(!_0x2743bb)throw new Error(_0x4bce('0x49'));if(_0x2743bb[_0x4bce('0x4a')]===_0x4bce('0x48')){var _0x3d3093=_0x18f6ff['get']({'plain':!![]});return db[_0x4bce('0x4b')][_0x4bce('0x40')]({'where':{'name':_0x4bce('0x1f'),'userProfileId':_0x2743bb['userProfileId']},'raw':!![]})['then'](function(_0x4781f0){if(_0x4781f0&&_0x4781f0[_0x4bce('0x4c')]===0x0){return db[_0x4bce('0x20')][_0x4bce('0x41')]({'name':_0x3d3093['name'],'resourceId':_0x3d3093['id'],'type':_0x4781f0['name'],'sectionId':_0x4781f0['id']},{})['then'](function(){return _0x18f6ff;});}else{return _0x18f6ff;}})['catch'](function(_0x9ed8f6){logger[_0x4bce('0x4d')](_0x4bce('0x4e'),_0x9ed8f6);throw _0x9ed8f6;});}return _0x18f6ff;})['then'](respondWithResult(_0x48f06e,0xc9))[_0x4bce('0x3c')](handleError(_0x48f06e,null));}; \ No newline at end of file +var _0xa4db=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','find','catch','update','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','get','UserProfileResource','destroy','error','name','send','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x170ae0,_0x2e66ad){var _0x28bfd5=function(_0x326e37){while(--_0x326e37){_0x170ae0['push'](_0x170ae0['shift']());}};_0x28bfd5(++_0x2e66ad);}(_0xa4db,0x12e));var _0xba4d=function(_0x5a1552,_0x8b26d1){_0x5a1552=_0x5a1552-0x0;var _0x2a6de3=_0xa4db[_0x5a1552];return _0x2a6de3;};'use strict';var emlformat=require(_0xba4d('0x0'));var rimraf=require(_0xba4d('0x1'));var zipdir=require(_0xba4d('0x2'));var jsonpatch=require(_0xba4d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba4d('0x4'));var Mustache=require(_0xba4d('0x5'));var util=require(_0xba4d('0x6'));var path=require('path');var sox=require(_0xba4d('0x7'));var csv=require(_0xba4d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba4d('0x9'));var _=require(_0xba4d('0xa'));var squel=require('squel');var crypto=require(_0xba4d('0xb'));var jsforce=require(_0xba4d('0xc'));var deskjs=require(_0xba4d('0xd'));var toCsv=require(_0xba4d('0x8'));var querystring=require(_0xba4d('0xe'));var Papa=require(_0xba4d('0xf'));var Redis=require('ioredis');var authService=require(_0xba4d('0x10'));var qs=require(_0xba4d('0x11'));var as=require(_0xba4d('0x12'));var hardwareService=require(_0xba4d('0x13'));var logger=require(_0xba4d('0x14'))(_0xba4d('0x15'));var utils=require(_0xba4d('0x16'));var config=require(_0xba4d('0x17'));var licenseUtil=require(_0xba4d('0x18'));var db=require(_0xba4d('0x19'))['db'];function respondWithStatusCode(_0x53f3ec,_0x22ace5){_0x22ace5=_0x22ace5||0xcc;return function(_0x75aae3){if(_0x75aae3){return _0x53f3ec[_0xba4d('0x1a')](_0x22ace5);}return _0x53f3ec[_0xba4d('0x1b')](_0x22ace5)[_0xba4d('0x1c')]();};}function respondWithResult(_0x4c072b,_0x27fbb7){_0x27fbb7=_0x27fbb7||0xc8;return function(_0x1dbbf3){if(_0x1dbbf3){return _0x4c072b[_0xba4d('0x1b')](_0x27fbb7)[_0xba4d('0x1d')](_0x1dbbf3);}};}function respondWithFilteredResult(_0xe96aa6,_0x456101){return function(_0x4e03c4){if(_0x4e03c4){var _0x415a0c=typeof _0x456101['offset']===_0xba4d('0x1e')&&typeof _0x456101[_0xba4d('0x1f')]===_0xba4d('0x1e');var _0x4bee67=_0x4e03c4['count'];var _0x399cd6=_0x415a0c?0x0:_0x456101[_0xba4d('0x20')];var _0x1cf230=_0x415a0c?_0x4e03c4[_0xba4d('0x21')]:_0x456101[_0xba4d('0x20')]+_0x456101['limit'];var _0x260fb2;if(_0x1cf230>=_0x4bee67){_0x1cf230=_0x4bee67;_0x260fb2=0xc8;}else{_0x260fb2=0xce;}_0xe96aa6['status'](_0x260fb2);return _0xe96aa6[_0xba4d('0x22')](_0xba4d('0x23'),_0x399cd6+'-'+_0x1cf230+'/'+_0x4bee67)['json'](_0x4e03c4);}return null;};}function patchUpdates(_0x3e9519){return function(_0x5abfdf){try{jsonpatch['apply'](_0x5abfdf,_0x3e9519,!![]);}catch(_0x2b704e){return BPromise[_0xba4d('0x24')](_0x2b704e);}return _0x5abfdf[_0xba4d('0x25')]();};}function saveUpdates(_0x53595a,_0x822dae){return function(_0x109ce7){if(_0x109ce7){return _0x109ce7['update'](_0x53595a)['then'](function(_0x1bbada){return _0x1bbada;});}return null;};}function removeEntity(_0x7e002,_0x3ed74d){return function(_0x4b276b){if(_0x4b276b){return _0x4b276b['destroy']()[_0xba4d('0x26')](function(){var _0x36983b=_0x4b276b[_0xba4d('0x27')]({'plain':!![]});var _0x4e4400='CannedAnswers';return db[_0xba4d('0x28')][_0xba4d('0x29')]({'where':{'type':_0x4e4400,'resourceId':_0x36983b['id']}})['then'](function(){return _0x4b276b;});})[_0xba4d('0x26')](function(){_0x7e002[_0xba4d('0x1b')](0xcc)[_0xba4d('0x1c')]();});}};}function handleEntityNotFound(_0x32b3c4,_0x750bbb){return function(_0x43031a){if(!_0x43031a){_0x32b3c4['sendStatus'](0x194);}return _0x43031a;};}function handleError(_0x877fa9,_0x599e6d){_0x599e6d=_0x599e6d||0x1f4;return function(_0x107dbd){logger[_0xba4d('0x2a')](_0x107dbd['stack']);if(_0x107dbd[_0xba4d('0x2b')]){delete _0x107dbd[_0xba4d('0x2b')];}_0x877fa9[_0xba4d('0x1b')](_0x599e6d)[_0xba4d('0x2c')](_0x107dbd);};}exports['index']=function(_0x5a86c1,_0x588a79){var _0x3e59ed={},_0x491535={},_0x276e5c={'count':0x0,'rows':[]};var _0x537c63=_[_0xba4d('0x2d')](db[_0xba4d('0x2e')][_0xba4d('0x2f')],function(_0x116183){return{'name':_0x116183['fieldName'],'type':_0x116183[_0xba4d('0x30')][_0xba4d('0x31')]};});_0x491535[_0xba4d('0x32')]=_[_0xba4d('0x2d')](_0x537c63,'name');_0x491535[_0xba4d('0x33')]=_[_0xba4d('0x34')](_0x5a86c1[_0xba4d('0x33')]);_0x491535[_0xba4d('0x35')]=_[_0xba4d('0x36')](_0x491535['model'],_0x491535[_0xba4d('0x33')]);_0x3e59ed[_0xba4d('0x37')]=_[_0xba4d('0x36')](_0x491535[_0xba4d('0x32')],qs['fields'](_0x5a86c1[_0xba4d('0x33')][_0xba4d('0x38')]));_0x3e59ed[_0xba4d('0x37')]=_0x3e59ed[_0xba4d('0x37')][_0xba4d('0x39')]?_0x3e59ed[_0xba4d('0x37')]:_0x491535['model'];if(!_0x5a86c1['query'][_0xba4d('0x3a')](_0xba4d('0x3b'))){_0x3e59ed['limit']=qs[_0xba4d('0x1f')](_0x5a86c1[_0xba4d('0x33')]['limit']);_0x3e59ed[_0xba4d('0x20')]=qs[_0xba4d('0x20')](_0x5a86c1[_0xba4d('0x33')][_0xba4d('0x20')]);}_0x3e59ed[_0xba4d('0x3c')]=qs[_0xba4d('0x3d')](_0x5a86c1[_0xba4d('0x33')][_0xba4d('0x3d')]);_0x3e59ed[_0xba4d('0x3e')]=qs[_0xba4d('0x35')](_[_0xba4d('0x3f')](_0x5a86c1[_0xba4d('0x33')],_0x491535[_0xba4d('0x35')]),_0x537c63);if(_0x5a86c1['query'][_0xba4d('0x40')]){_0x3e59ed['where']=_[_0xba4d('0x41')](_0x3e59ed[_0xba4d('0x3e')],{'$or':[{'key':{'$like':'%'+_0x5a86c1[_0xba4d('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x5a86c1[_0xba4d('0x33')][_0xba4d('0x40')]+'%'}}]});}_0x3e59ed=_[_0xba4d('0x41')]({},_0x3e59ed,_0x5a86c1['options']);var _0xb2808d={'where':_0x3e59ed[_0xba4d('0x3e')]};return db[_0xba4d('0x2e')][_0xba4d('0x21')](_0xb2808d)['then'](function(_0x3aaed6){_0x276e5c[_0xba4d('0x21')]=_0x3aaed6;if(_0x5a86c1[_0xba4d('0x33')][_0xba4d('0x42')]){_0x3e59ed[_0xba4d('0x43')]=[{'all':!![]}];}return db[_0xba4d('0x2e')][_0xba4d('0x44')](_0x3e59ed);})[_0xba4d('0x26')](function(_0x17af53){_0x276e5c[_0xba4d('0x45')]=_0x17af53;return _0x276e5c;})['then'](respondWithFilteredResult(_0x588a79,_0x3e59ed))['catch'](handleError(_0x588a79,null));};exports['show']=function(_0x8fa85f,_0x3a801c){var _0x1dadfd={'raw':!![],'where':{'id':_0x8fa85f[_0xba4d('0x46')]['id']}},_0xc0485={};_0xc0485[_0xba4d('0x32')]=_[_0xba4d('0x34')](db[_0xba4d('0x2e')][_0xba4d('0x2f')]);_0xc0485[_0xba4d('0x33')]=_['keys'](_0x8fa85f[_0xba4d('0x33')]);_0xc0485[_0xba4d('0x35')]=_[_0xba4d('0x36')](_0xc0485['model'],_0xc0485['query']);_0x1dadfd[_0xba4d('0x37')]=_['intersection'](_0xc0485[_0xba4d('0x32')],qs[_0xba4d('0x38')](_0x8fa85f[_0xba4d('0x33')][_0xba4d('0x38')]));_0x1dadfd[_0xba4d('0x37')]=_0x1dadfd[_0xba4d('0x37')][_0xba4d('0x39')]?_0x1dadfd[_0xba4d('0x37')]:_0xc0485[_0xba4d('0x32')];if(_0x8fa85f[_0xba4d('0x33')][_0xba4d('0x42')]){_0x1dadfd['include']=[{'all':!![]}];}_0x1dadfd=_[_0xba4d('0x41')]({},_0x1dadfd,_0x8fa85f['options']);return db[_0xba4d('0x2e')][_0xba4d('0x47')](_0x1dadfd)[_0xba4d('0x26')](handleEntityNotFound(_0x3a801c,null))[_0xba4d('0x26')](respondWithResult(_0x3a801c,null))[_0xba4d('0x48')](handleError(_0x3a801c,null));};exports[_0xba4d('0x49')]=function(_0x120ea6,_0x3b7802){if(_0x120ea6[_0xba4d('0x4a')]['id']){delete _0x120ea6[_0xba4d('0x4a')]['id'];}return db[_0xba4d('0x2e')]['find']({'where':{'id':_0x120ea6[_0xba4d('0x46')]['id']}})[_0xba4d('0x26')](handleEntityNotFound(_0x3b7802,null))[_0xba4d('0x26')](saveUpdates(_0x120ea6['body'],null))[_0xba4d('0x26')](respondWithResult(_0x3b7802,null))[_0xba4d('0x48')](handleError(_0x3b7802,null));};exports[_0xba4d('0x29')]=function(_0x4bf6c6,_0x1b1f8d){return db[_0xba4d('0x2e')]['find']({'where':{'id':_0x4bf6c6[_0xba4d('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b1f8d,null))[_0xba4d('0x26')](removeEntity(_0x1b1f8d,null))[_0xba4d('0x48')](handleError(_0x1b1f8d,null));};exports['create']=function(_0x12dc05,_0x4e6d4c){var _0x4be4c4={'key':_0x12dc05[_0xba4d('0x4a')][_0xba4d('0x31')]};if(_0x12dc05['body']['MailAccountId']){_0x4be4c4[_0xba4d('0x4b')]=_0x12dc05[_0xba4d('0x4a')]['MailAccountId'];}else if(_0x12dc05['body'][_0xba4d('0x4c')]){_0x4be4c4[_0xba4d('0x4c')]=_0x12dc05[_0xba4d('0x4a')][_0xba4d('0x4c')];}else if(_0x12dc05[_0xba4d('0x4a')][_0xba4d('0x4d')]){_0x4be4c4['OpenchannelAccountId']=_0x12dc05[_0xba4d('0x4a')][_0xba4d('0x4d')];}else if(_0x12dc05[_0xba4d('0x4a')][_0xba4d('0x4e')]){_0x4be4c4[_0xba4d('0x4e')]=_0x12dc05[_0xba4d('0x4a')][_0xba4d('0x4e')];}return db[_0xba4d('0x2e')][_0xba4d('0x47')]({'where':_0x4be4c4})['then'](function(_0x2eb1ad){if(_0x2eb1ad){throw new db[(_0xba4d('0x4f'))][(_0xba4d('0x50'))](_0xba4d('0x51'));}return db['CannedAnswer'][_0xba4d('0x52')](_0x12dc05[_0xba4d('0x4a')]);})['then'](function(_0xe60650){var _0x210ad5=_0x12dc05[_0xba4d('0x53')][_0xba4d('0x27')]({'plain':!![]});if(!_0x210ad5)throw new Error(_0xba4d('0x54'));if(_0x210ad5[_0xba4d('0x55')]===_0xba4d('0x53')){var _0x33fb16=_0xe60650[_0xba4d('0x27')]({'plain':!![]});return db[_0xba4d('0x56')][_0xba4d('0x47')]({'where':{'name':_0xba4d('0x57'),'userProfileId':_0x210ad5[_0xba4d('0x58')]},'raw':!![]})['then'](function(_0x17dc46){if(_0x17dc46&&_0x17dc46['autoAssociation']===0x0){return db[_0xba4d('0x28')][_0xba4d('0x52')]({'name':_0x33fb16[_0xba4d('0x2b')],'resourceId':_0x33fb16['id'],'type':_0x17dc46[_0xba4d('0x2b')],'sectionId':_0x17dc46['id']},{})[_0xba4d('0x26')](function(){return _0xe60650;});}else{return _0xe60650;}})[_0xba4d('0x48')](function(_0x478974){logger[_0xba4d('0x2a')](_0xba4d('0x59'),_0x478974);throw _0x478974;});}return _0xe60650;})['then'](respondWithResult(_0x4e6d4c,0xc9))[_0xba4d('0x48')](handleError(_0x4e6d4c,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 84c46b4..a6a4d0e 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 _0x502a=['CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define'];(function(_0x1d83db,_0x89d115){var _0x2dc1d1=function(_0x13fdc3){while(--_0x13fdc3){_0x1d83db['push'](_0x1d83db['shift']());}};_0x2dc1d1(++_0x89d115);}(_0x502a,0x1df));var _0xa502=function(_0x62f353,_0x43a051){_0x62f353=_0x62f353-0x0;var _0x2bf471=_0x502a[_0x62f353];return _0x2bf471;};'use strict';var _=require('lodash');var util=require(_0xa502('0x0'));var logger=require(_0xa502('0x1'))(_0xa502('0x2'));var moment=require(_0xa502('0x3'));var BPromise=require(_0xa502('0x4'));var rp=require(_0xa502('0x5'));var fs=require('fs');var path=require(_0xa502('0x6'));var rimraf=require(_0xa502('0x7'));var config=require(_0xa502('0x8'));var attributes=require(_0xa502('0x9'));module['exports']=function(_0x3f6081,_0x2c4a08){return _0x3f6081[_0xa502('0xa')](_0xa502('0xb'),attributes,{'tableName':_0xa502('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa502('0xd')});}; \ No newline at end of file +var _0xba10=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xba10,0x70));var _0x0ba1=function(_0x11ed89,_0x5930df){_0x11ed89=_0x11ed89-0x0;var _0xef0497=_0xba10[_0x11ed89];return _0xef0497;};'use strict';var _=require(_0x0ba1('0x0'));var util=require(_0x0ba1('0x1'));var logger=require(_0x0ba1('0x2'))(_0x0ba1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ba1('0x4'));var fs=require('fs');var path=require(_0x0ba1('0x5'));var rimraf=require(_0x0ba1('0x6'));var config=require(_0x0ba1('0x7'));var attributes=require(_0x0ba1('0x8'));module[_0x0ba1('0x9')]=function(_0x482081,_0x1e71f7){return _0x482081[_0x0ba1('0xa')](_0x0ba1('0xb'),attributes,{'tableName':_0x0ba1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ba1('0xd'),'collate':_0x0ba1('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index ab69676..2933cbd 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(_0x2cba46,_0x3f6081){var _0x4510e8=function(_0x15dba2){while(--_0x15dba2){_0x2cba46['push'](_0x2cba46['shift']());}};_0x4510e8(++_0x3f6081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x34e935,_0x146bf2){var _0x515d56=function(_0x173010){while(--_0x173010){_0x34e935['push'](_0x34e935['shift']());}};_0x515d56(++_0x146bf2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 5272e82..b63bccc 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 _0xb78d=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','show','post','isAuthenticated','put','update'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xb78d,0xc1));var _0xdb78=function(_0x26015d,_0x59d315){_0x26015d=_0x26015d-0x0;var _0x2d9d53=_0xb78d[_0x26015d];return _0x2d9d53;};'use strict';var multer=require('multer');var util=require(_0xdb78('0x0'));var path=require(_0xdb78('0x1'));var timeout=require(_0xdb78('0x2'));var express=require(_0xdb78('0x3'));var router=express['Router']();var fs_extra=require(_0xdb78('0x4'));var auth=require(_0xdb78('0x5'));var interaction=require(_0xdb78('0x6'));var config=require(_0xdb78('0x7'));var controller=require(_0xdb78('0x8'));router[_0xdb78('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdb78('0xa'),auth['isAuthenticated'](),controller[_0xdb78('0xb')]);router[_0xdb78('0xc')]('/',auth[_0xdb78('0xd')](),controller['create']);router[_0xdb78('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xdb78('0xf')]);router[_0xdb78('0x10')](_0xdb78('0xa'),auth[_0xdb78('0xd')](),controller[_0xdb78('0x11')]);module[_0xdb78('0x12')]=router; \ No newline at end of file +var _0xc807=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','get','/:id','show','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x13403b,_0x431a8c){var _0x23c821=function(_0x554f6){while(--_0x554f6){_0x13403b['push'](_0x13403b['shift']());}};_0x23c821(++_0x431a8c);}(_0xc807,0x1a9));var _0x7c80=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xc807[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x7c80('0x0'));var util=require(_0x7c80('0x1'));var path=require(_0x7c80('0x2'));var timeout=require(_0x7c80('0x3'));var express=require(_0x7c80('0x4'));var router=express[_0x7c80('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7c80('0x6'));var interaction=require(_0x7c80('0x7'));var config=require(_0x7c80('0x8'));var controller=require(_0x7c80('0x9'));router['get']('/',auth[_0x7c80('0xa')](),controller['index']);router[_0x7c80('0xb')](_0x7c80('0xc'),auth[_0x7c80('0xa')](),controller[_0x7c80('0xd')]);router['post']('/',auth[_0x7c80('0xa')](),controller[_0x7c80('0xe')]);router['put']('/:id',auth[_0x7c80('0xa')](),controller[_0x7c80('0xf')]);router[_0x7c80('0x10')](_0x7c80('0xc'),auth[_0x7c80('0xa')](),controller[_0x7c80('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b06aa62..202e82f 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 _0x0412=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x5bae0d,_0x26a41b){var _0x177496=function(_0x27dd4e){while(--_0x27dd4e){_0x5bae0d['push'](_0x5bae0d['shift']());}};_0x177496(++_0x26a41b);}(_0x0412,0xad));var _0x2041=function(_0xf1a7ba,_0x5d3e98){_0xf1a7ba=_0xf1a7ba-0x0;var _0x2e70e8=_0x0412[_0xf1a7ba];return _0x2e70e8;};'use strict';var Sequelize=require(_0x2041('0x0'));module[_0x2041('0x1')]={'calldate':{'type':Sequelize[_0x2041('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x2041('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x2041('0x3')]},'dcontext':{'type':Sequelize[_0x2041('0x3')]},'channel':{'type':Sequelize[_0x2041('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x2041('0x3')]},'lastdata':{'type':Sequelize[_0x2041('0x3')]},'duration':{'type':Sequelize[_0x2041('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2041('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2041('0x3')]},'amaflags':{'type':Sequelize[_0x2041('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x2041('0x3')]},'uniqueid':{'type':Sequelize[_0x2041('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x2041('0x3')]},'peeraccount':{'type':Sequelize[_0x2041('0x3')]},'type':{'type':Sequelize[_0x2041('0x3')]},'tag':{'type':Sequelize[_0x2041('0x3')]}}; \ No newline at end of file +var _0x2179=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0xed1a03,_0xf86ecf){var _0x38f61e=function(_0x1e443b){while(--_0x1e443b){_0xed1a03['push'](_0xed1a03['shift']());}};_0x38f61e(++_0xf86ecf);}(_0x2179,0xc0));var _0x9217=function(_0x50408f,_0x92ffac){_0x50408f=_0x50408f-0x0;var _0xb02957=_0x2179[_0x50408f];return _0xb02957;};'use strict';var Sequelize=require(_0x9217('0x0'));module[_0x9217('0x1')]={'calldate':{'type':Sequelize[_0x9217('0x2')],'allowNull':![],'defaultValue':_0x9217('0x3')},'clid':{'type':Sequelize[_0x9217('0x4')]},'src':{'type':Sequelize[_0x9217('0x4')]},'dst':{'type':Sequelize[_0x9217('0x4')]},'dcontext':{'type':Sequelize[_0x9217('0x4')]},'channel':{'type':Sequelize[_0x9217('0x4')]},'dstchannel':{'type':Sequelize[_0x9217('0x4')]},'lastapp':{'type':Sequelize[_0x9217('0x4')]},'lastdata':{'type':Sequelize[_0x9217('0x4')]},'duration':{'type':Sequelize[_0x9217('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9217('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9217('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9217('0x4')]},'userfield':{'type':Sequelize[_0x9217('0x4')]},'uniqueid':{'type':Sequelize[_0x9217('0x4')]},'linkedid':{'type':Sequelize[_0x9217('0x4')]},'sequence':{'type':Sequelize[_0x9217('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x9217('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 10578be..94d7bb8 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 _0x56e6=['keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','Cdr','rawAttributes','fieldName','model','map','name'];(function(_0x5e1f8f,_0x3bfb30){var _0xda8ef3=function(_0x1173f0){while(--_0x1173f0){_0x5e1f8f['push'](_0x5e1f8f['shift']());}};_0xda8ef3(++_0x3bfb30);}(_0x56e6,0x6b));var _0x656e=function(_0x5b401b,_0x4144c5){_0x5b401b=_0x5b401b-0x0;var _0x10b378=_0x56e6[_0x5b401b];return _0x10b378;};'use strict';var emlformat=require(_0x656e('0x0'));var rimraf=require(_0x656e('0x1'));var zipdir=require(_0x656e('0x2'));var jsonpatch=require(_0x656e('0x3'));var rp=require(_0x656e('0x4'));var moment=require(_0x656e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x656e('0x6'));var util=require(_0x656e('0x7'));var path=require(_0x656e('0x8'));var sox=require(_0x656e('0x9'));var csv=require(_0x656e('0xa'));var ejs=require(_0x656e('0xb'));var fs=require('fs');var fs_extra=require(_0x656e('0xc'));var _=require('lodash');var squel=require(_0x656e('0xd'));var crypto=require(_0x656e('0xe'));var jsforce=require(_0x656e('0xf'));var deskjs=require(_0x656e('0x10'));var toCsv=require(_0x656e('0xa'));var querystring=require(_0x656e('0x11'));var Papa=require(_0x656e('0x12'));var Redis=require(_0x656e('0x13'));var authService=require(_0x656e('0x14'));var qs=require(_0x656e('0x15'));var as=require(_0x656e('0x16'));var hardwareService=require(_0x656e('0x17'));var logger=require(_0x656e('0x18'))(_0x656e('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x656e('0x1a'));var db=require(_0x656e('0x1b'))['db'];function respondWithStatusCode(_0x3cb3c8,_0x460aad){_0x460aad=_0x460aad||0xcc;return function(_0x581525){if(_0x581525){return _0x3cb3c8['sendStatus'](_0x460aad);}return _0x3cb3c8[_0x656e('0x1c')](_0x460aad)[_0x656e('0x1d')]();};}function respondWithResult(_0x53699e,_0x230249){_0x230249=_0x230249||0xc8;return function(_0x5059d9){if(_0x5059d9){return _0x53699e[_0x656e('0x1c')](_0x230249)[_0x656e('0x1e')](_0x5059d9);}};}function respondWithFilteredResult(_0x2a52f7,_0x1f839f){return function(_0x5a1fc3){if(_0x5a1fc3){var _0x3ab51b=typeof _0x1f839f[_0x656e('0x1f')]===_0x656e('0x20')&&typeof _0x1f839f[_0x656e('0x21')]===_0x656e('0x20');var _0x4fd12e=_0x5a1fc3['count'];var _0x526b83=_0x3ab51b?0x0:_0x1f839f[_0x656e('0x1f')];var _0x1b0fdd=_0x3ab51b?_0x5a1fc3['count']:_0x1f839f[_0x656e('0x1f')]+_0x1f839f['limit'];var _0x495f60;if(_0x1b0fdd>=_0x4fd12e){_0x1b0fdd=_0x4fd12e;_0x495f60=0xc8;}else{_0x495f60=0xce;}_0x2a52f7['status'](_0x495f60);return _0x2a52f7[_0x656e('0x22')](_0x656e('0x23'),_0x526b83+'-'+_0x1b0fdd+'/'+_0x4fd12e)[_0x656e('0x1e')](_0x5a1fc3);}return null;};}function patchUpdates(_0x141587){return function(_0x5532ee){try{jsonpatch[_0x656e('0x24')](_0x5532ee,_0x141587,!![]);}catch(_0x543338){return BPromise[_0x656e('0x25')](_0x543338);}return _0x5532ee['save']();};}function saveUpdates(_0x159e42,_0x1acca5){return function(_0x19ab77){if(_0x19ab77){return _0x19ab77[_0x656e('0x26')](_0x159e42)[_0x656e('0x27')](function(_0x38ea02){return _0x38ea02;});}return null;};}function removeEntity(_0x382a5f,_0x57ac6c){return function(_0x44551b){if(_0x44551b){return _0x44551b[_0x656e('0x28')]()['then'](function(){_0x382a5f['status'](0xcc)[_0x656e('0x1d')]();});}};}function handleEntityNotFound(_0x517021,_0x33fb09){return function(_0x5b492e){if(!_0x5b492e){_0x517021['sendStatus'](0x194);}return _0x5b492e;};}function handleError(_0xa834a5,_0x4e2a80){_0x4e2a80=_0x4e2a80||0x1f4;return function(_0x26870d){logger[_0x656e('0x29')](_0x26870d[_0x656e('0x2a')]);if(_0x26870d['name']){delete _0x26870d['name'];}_0xa834a5[_0x656e('0x1c')](_0x4e2a80)[_0x656e('0x2b')](_0x26870d);};}exports[_0x656e('0x2c')]=function(_0x469acf,_0xc2a01){var _0x264e88={},_0xfece84={},_0x58181e={'count':0x0,'rows':[]};var _0x84d034=_['map'](db[_0x656e('0x2d')][_0x656e('0x2e')],function(_0x58cf11){return{'name':_0x58cf11[_0x656e('0x2f')],'type':_0x58cf11['type']['key']};});_0xfece84[_0x656e('0x30')]=_[_0x656e('0x31')](_0x84d034,_0x656e('0x32'));_0xfece84['query']=_[_0x656e('0x33')](_0x469acf['query']);_0xfece84[_0x656e('0x34')]=_[_0x656e('0x35')](_0xfece84['model'],_0xfece84[_0x656e('0x36')]);_0x264e88['attributes']=_['intersection'](_0xfece84[_0x656e('0x30')],qs['fields'](_0x469acf[_0x656e('0x36')][_0x656e('0x37')]));_0x264e88[_0x656e('0x38')]=_0x264e88[_0x656e('0x38')]['length']?_0x264e88['attributes']:_0xfece84[_0x656e('0x30')];if(!_0x469acf['query'][_0x656e('0x39')](_0x656e('0x3a'))){_0x264e88[_0x656e('0x21')]=qs[_0x656e('0x21')](_0x469acf[_0x656e('0x36')][_0x656e('0x21')]);_0x264e88['offset']=qs['offset'](_0x469acf['query']['offset']);}_0x264e88['order']=qs[_0x656e('0x3b')](_0x469acf['query']['sort']);_0x264e88[_0x656e('0x3c')]=qs[_0x656e('0x34')](_[_0x656e('0x3d')](_0x469acf[_0x656e('0x36')],_0xfece84[_0x656e('0x34')]),_0x84d034);if(_0x469acf[_0x656e('0x36')][_0x656e('0x3e')]){_0x264e88[_0x656e('0x3c')]=_[_0x656e('0x3f')](_0x264e88[_0x656e('0x3c')],{'$or':_[_0x656e('0x31')](_0x84d034,function(_0x46306a){if(_0x46306a[_0x656e('0x40')]!=='VIRTUAL'){var _0x3c1a70={};_0x3c1a70[_0x46306a['name']]={'$like':'%'+_0x469acf['query'][_0x656e('0x3e')]+'%'};return _0x3c1a70;}})});}_0x264e88=_[_0x656e('0x3f')]({},_0x264e88,_0x469acf[_0x656e('0x41')]);var _0x5cd5e9={'where':_0x264e88['where']};return db['Cdr'][_0x656e('0x42')](_0x5cd5e9)[_0x656e('0x27')](function(_0x3e6266){_0x58181e[_0x656e('0x42')]=_0x3e6266;if(_0x469acf[_0x656e('0x36')][_0x656e('0x43')]){_0x264e88[_0x656e('0x44')]=[{'all':!![]}];}return db[_0x656e('0x2d')][_0x656e('0x45')](_0x264e88);})[_0x656e('0x27')](function(_0x3f81fa){_0x58181e[_0x656e('0x46')]=_0x3f81fa;return _0x58181e;})[_0x656e('0x27')](respondWithFilteredResult(_0xc2a01,_0x264e88))['catch'](handleError(_0xc2a01,null));};exports[_0x656e('0x47')]=function(_0x562482,_0x21af67){var _0x3f3d5e={'raw':!![],'where':{'id':_0x562482[_0x656e('0x48')]['id']}},_0x4045c4={};_0x4045c4[_0x656e('0x30')]=_[_0x656e('0x33')](db[_0x656e('0x2d')][_0x656e('0x2e')]);_0x4045c4[_0x656e('0x36')]=_[_0x656e('0x33')](_0x562482['query']);_0x4045c4[_0x656e('0x34')]=_[_0x656e('0x35')](_0x4045c4[_0x656e('0x30')],_0x4045c4['query']);_0x3f3d5e['attributes']=_[_0x656e('0x35')](_0x4045c4[_0x656e('0x30')],qs[_0x656e('0x37')](_0x562482[_0x656e('0x36')]['fields']));_0x3f3d5e[_0x656e('0x38')]=_0x3f3d5e[_0x656e('0x38')][_0x656e('0x49')]?_0x3f3d5e[_0x656e('0x38')]:_0x4045c4[_0x656e('0x30')];if(_0x562482['query'][_0x656e('0x43')]){_0x3f3d5e[_0x656e('0x44')]=[{'all':!![]}];}_0x3f3d5e=_[_0x656e('0x3f')]({},_0x3f3d5e,_0x562482[_0x656e('0x41')]);return db[_0x656e('0x2d')][_0x656e('0x4a')](_0x3f3d5e)['then'](handleEntityNotFound(_0x21af67,null))[_0x656e('0x27')](respondWithResult(_0x21af67,null))[_0x656e('0x4b')](handleError(_0x21af67,null));};exports[_0x656e('0x4c')]=function(_0x904b8a,_0x5dbcfb){return db['Cdr'][_0x656e('0x4c')](_0x904b8a['body'],{})['then'](respondWithResult(_0x5dbcfb,0xc9))['catch'](handleError(_0x5dbcfb,null));};exports[_0x656e('0x26')]=function(_0x2c648e,_0x59cb0f){if(_0x2c648e['body']['id']){delete _0x2c648e['body']['id'];}return db['Cdr'][_0x656e('0x4a')]({'where':{'id':_0x2c648e[_0x656e('0x48')]['id']}})['then'](handleEntityNotFound(_0x59cb0f,null))[_0x656e('0x27')](saveUpdates(_0x2c648e[_0x656e('0x4d')],null))[_0x656e('0x27')](respondWithResult(_0x59cb0f,null))[_0x656e('0x4b')](handleError(_0x59cb0f,null));};exports[_0x656e('0x28')]=function(_0x3e8d90,_0x2dac52){return db[_0x656e('0x2d')][_0x656e('0x4a')]({'where':{'id':_0x3e8d90[_0x656e('0x48')]['id']}})[_0x656e('0x27')](handleEntityNotFound(_0x2dac52,null))['then'](removeEntity(_0x2dac52,null))['catch'](handleError(_0x2dac52,null));};exports['describe']=function(_0x47e622,_0x464881){return db[_0x656e('0x2d')][_0x656e('0x4e')]()['then'](respondWithResult(_0x464881,null))['catch'](handleError(_0x464881,null));}; \ No newline at end of file +var _0x8ce1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','send','index','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x8ce1,0x183));var _0x18ce=function(_0x2f1b8c,_0x3f63f1){_0x2f1b8c=_0x2f1b8c-0x0;var _0x158768=_0x8ce1[_0x2f1b8c];return _0x158768;};'use strict';var emlformat=require(_0x18ce('0x0'));var rimraf=require(_0x18ce('0x1'));var zipdir=require(_0x18ce('0x2'));var jsonpatch=require(_0x18ce('0x3'));var rp=require(_0x18ce('0x4'));var moment=require(_0x18ce('0x5'));var BPromise=require(_0x18ce('0x6'));var Mustache=require(_0x18ce('0x7'));var util=require(_0x18ce('0x8'));var path=require(_0x18ce('0x9'));var sox=require(_0x18ce('0xa'));var csv=require(_0x18ce('0xb'));var ejs=require(_0x18ce('0xc'));var fs=require('fs');var fs_extra=require(_0x18ce('0xd'));var _=require(_0x18ce('0xe'));var squel=require(_0x18ce('0xf'));var crypto=require('crypto');var jsforce=require(_0x18ce('0x10'));var deskjs=require(_0x18ce('0x11'));var toCsv=require(_0x18ce('0xb'));var querystring=require(_0x18ce('0x12'));var Papa=require('papaparse');var Redis=require(_0x18ce('0x13'));var authService=require(_0x18ce('0x14'));var qs=require(_0x18ce('0x15'));var as=require(_0x18ce('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18ce('0x17'));var utils=require(_0x18ce('0x18'));var config=require(_0x18ce('0x19'));var licenseUtil=require(_0x18ce('0x1a'));var db=require(_0x18ce('0x1b'))['db'];function respondWithStatusCode(_0x5e8c23,_0xbd514b){_0xbd514b=_0xbd514b||0xcc;return function(_0x402ba4){if(_0x402ba4){return _0x5e8c23[_0x18ce('0x1c')](_0xbd514b);}return _0x5e8c23[_0x18ce('0x1d')](_0xbd514b)[_0x18ce('0x1e')]();};}function respondWithResult(_0x5daf04,_0x176797){_0x176797=_0x176797||0xc8;return function(_0xdd4626){if(_0xdd4626){return _0x5daf04[_0x18ce('0x1d')](_0x176797)[_0x18ce('0x1f')](_0xdd4626);}};}function respondWithFilteredResult(_0x46e346,_0x36b5da){return function(_0x17460e){if(_0x17460e){var _0x4a934f=typeof _0x36b5da[_0x18ce('0x20')]===_0x18ce('0x21')&&typeof _0x36b5da[_0x18ce('0x22')]===_0x18ce('0x21');var _0x1edc10=_0x17460e[_0x18ce('0x23')];var _0x482458=_0x4a934f?0x0:_0x36b5da[_0x18ce('0x20')];var _0x29c691=_0x4a934f?_0x17460e[_0x18ce('0x23')]:_0x36b5da['offset']+_0x36b5da[_0x18ce('0x22')];var _0x2fa3d4;if(_0x29c691>=_0x1edc10){_0x29c691=_0x1edc10;_0x2fa3d4=0xc8;}else{_0x2fa3d4=0xce;}_0x46e346[_0x18ce('0x1d')](_0x2fa3d4);return _0x46e346['set'](_0x18ce('0x24'),_0x482458+'-'+_0x29c691+'/'+_0x1edc10)[_0x18ce('0x1f')](_0x17460e);}return null;};}function patchUpdates(_0x5d22cd){return function(_0x29c1ab){try{jsonpatch[_0x18ce('0x25')](_0x29c1ab,_0x5d22cd,!![]);}catch(_0x16802e){return BPromise[_0x18ce('0x26')](_0x16802e);}return _0x29c1ab[_0x18ce('0x27')]();};}function saveUpdates(_0xd41f29,_0x35abf9){return function(_0x545459){if(_0x545459){return _0x545459[_0x18ce('0x28')](_0xd41f29)['then'](function(_0x482c90){return _0x482c90;});}return null;};}function removeEntity(_0x5d2299,_0x32e910){return function(_0x576ecc){if(_0x576ecc){return _0x576ecc[_0x18ce('0x29')]()[_0x18ce('0x2a')](function(){_0x5d2299[_0x18ce('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53abbd,_0x55e17c){return function(_0x317812){if(!_0x317812){_0x53abbd[_0x18ce('0x1c')](0x194);}return _0x317812;};}function handleError(_0x12dbd2,_0x461113){_0x461113=_0x461113||0x1f4;return function(_0x62b2bd){logger[_0x18ce('0x2b')](_0x62b2bd['stack']);if(_0x62b2bd['name']){delete _0x62b2bd['name'];}_0x12dbd2[_0x18ce('0x1d')](_0x461113)[_0x18ce('0x2c')](_0x62b2bd);};}exports[_0x18ce('0x2d')]=function(_0x5f3ec2,_0x1a87f6){var _0xf2683f={},_0x1988e4={},_0x5ef96c={'count':0x0,'rows':[]};var _0x56d296=_['map'](db[_0x18ce('0x2e')][_0x18ce('0x2f')],function(_0x5c2d96){return{'name':_0x5c2d96['fieldName'],'type':_0x5c2d96[_0x18ce('0x30')][_0x18ce('0x31')]};});_0x1988e4[_0x18ce('0x32')]=_['map'](_0x56d296,'name');_0x1988e4[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x5f3ec2[_0x18ce('0x33')]);_0x1988e4[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x1988e4[_0x18ce('0x32')],_0x1988e4[_0x18ce('0x33')]);_0xf2683f[_0x18ce('0x37')]=_['intersection'](_0x1988e4['model'],qs[_0x18ce('0x38')](_0x5f3ec2[_0x18ce('0x33')]['fields']));_0xf2683f[_0x18ce('0x37')]=_0xf2683f['attributes'][_0x18ce('0x39')]?_0xf2683f['attributes']:_0x1988e4[_0x18ce('0x32')];if(!_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3a')]('nolimit')){_0xf2683f['limit']=qs[_0x18ce('0x22')](_0x5f3ec2[_0x18ce('0x33')]['limit']);_0xf2683f['offset']=qs[_0x18ce('0x20')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x20')]);}_0xf2683f[_0x18ce('0x3b')]=qs[_0x18ce('0x3c')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3c')]);_0xf2683f[_0x18ce('0x3d')]=qs[_0x18ce('0x35')](_[_0x18ce('0x3e')](_0x5f3ec2[_0x18ce('0x33')],_0x1988e4[_0x18ce('0x35')]),_0x56d296);if(_0x5f3ec2[_0x18ce('0x33')]['filter']){_0xf2683f[_0x18ce('0x3d')]=_[_0x18ce('0x3f')](_0xf2683f[_0x18ce('0x3d')],{'$or':_[_0x18ce('0x40')](_0x56d296,function(_0x1e67dd){if(_0x1e67dd[_0x18ce('0x30')]!==_0x18ce('0x41')){var _0x27c55a={};_0x27c55a[_0x1e67dd[_0x18ce('0x42')]]={'$like':'%'+_0x5f3ec2[_0x18ce('0x33')]['filter']+'%'};return _0x27c55a;}})});}_0xf2683f=_['merge']({},_0xf2683f,_0x5f3ec2[_0x18ce('0x43')]);var _0x23486c={'where':_0xf2683f[_0x18ce('0x3d')]};return db[_0x18ce('0x2e')][_0x18ce('0x23')](_0x23486c)[_0x18ce('0x2a')](function(_0x2eba88){_0x5ef96c['count']=_0x2eba88;if(_0x5f3ec2['query'][_0x18ce('0x44')]){_0xf2683f[_0x18ce('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x18ce('0x46')](_0xf2683f);})[_0x18ce('0x2a')](function(_0x2941ce){_0x5ef96c[_0x18ce('0x47')]=_0x2941ce;return _0x5ef96c;})[_0x18ce('0x2a')](respondWithFilteredResult(_0x1a87f6,_0xf2683f))[_0x18ce('0x48')](handleError(_0x1a87f6,null));};exports[_0x18ce('0x49')]=function(_0x2a96a7,_0x33b409){var _0x1d6d5f={'raw':!![],'where':{'id':_0x2a96a7[_0x18ce('0x4a')]['id']}},_0x3885e6={};_0x3885e6['model']=_[_0x18ce('0x34')](db[_0x18ce('0x2e')][_0x18ce('0x2f')]);_0x3885e6[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x2a96a7[_0x18ce('0x33')]);_0x3885e6[_0x18ce('0x35')]=_['intersection'](_0x3885e6['model'],_0x3885e6[_0x18ce('0x33')]);_0x1d6d5f[_0x18ce('0x37')]=_[_0x18ce('0x36')](_0x3885e6[_0x18ce('0x32')],qs['fields'](_0x2a96a7[_0x18ce('0x33')][_0x18ce('0x38')]));_0x1d6d5f[_0x18ce('0x37')]=_0x1d6d5f['attributes']['length']?_0x1d6d5f[_0x18ce('0x37')]:_0x3885e6[_0x18ce('0x32')];if(_0x2a96a7['query'][_0x18ce('0x44')]){_0x1d6d5f[_0x18ce('0x45')]=[{'all':!![]}];}_0x1d6d5f=_[_0x18ce('0x3f')]({},_0x1d6d5f,_0x2a96a7[_0x18ce('0x43')]);return db[_0x18ce('0x2e')][_0x18ce('0x4b')](_0x1d6d5f)[_0x18ce('0x2a')](handleEntityNotFound(_0x33b409,null))['then'](respondWithResult(_0x33b409,null))[_0x18ce('0x48')](handleError(_0x33b409,null));};exports[_0x18ce('0x4c')]=function(_0x476c6a,_0x1e445d){return db[_0x18ce('0x2e')][_0x18ce('0x4c')](_0x476c6a[_0x18ce('0x4d')],{})[_0x18ce('0x2a')](respondWithResult(_0x1e445d,0xc9))[_0x18ce('0x48')](handleError(_0x1e445d,null));};exports[_0x18ce('0x28')]=function(_0x1211d0,_0x3f9960){if(_0x1211d0[_0x18ce('0x4d')]['id']){delete _0x1211d0[_0x18ce('0x4d')]['id'];}return db['Cdr'][_0x18ce('0x4b')]({'where':{'id':_0x1211d0[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f9960,null))[_0x18ce('0x2a')](saveUpdates(_0x1211d0['body'],null))[_0x18ce('0x2a')](respondWithResult(_0x3f9960,null))['catch'](handleError(_0x3f9960,null));};exports[_0x18ce('0x29')]=function(_0x188f57,_0x3d5b1b){return db[_0x18ce('0x2e')]['find']({'where':{'id':_0x188f57[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d5b1b,null))['then'](removeEntity(_0x3d5b1b,null))[_0x18ce('0x48')](handleError(_0x3d5b1b,null));};exports[_0x18ce('0x4e')]=function(_0x8aa4a7,_0x5f164a){return db['Cdr'][_0x18ce('0x4e')]()[_0x18ce('0x2a')](respondWithResult(_0x5f164a,null))[_0x18ce('0x48')](handleError(_0x5f164a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 3e0f3b4..458064b 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(_0x4ec24d,_0x259f01){var _0x3f2d4b=function(_0x51ae26){while(--_0x51ae26){_0x4ec24d['push'](_0x4ec24d['shift']());}};_0x3f2d4b(++_0x259f01);}(_0x7a54,0x106));var _0x47a5=function(_0x5d3b38,_0x2c86a6){_0x5d3b38=_0x5d3b38-0x0;var _0x12bda8=_0x7a54[_0x5d3b38];return _0x12bda8;};'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(_0x81ffa8,_0x5315ae){var _0x391605=function(_0x2a5638){while(--_0x2a5638){_0x81ffa8['push'](_0x81ffa8['shift']());}};_0x391605(++_0x5315ae);}(_0x7a54,0x106));var _0x47a5=function(_0xe8b65f,_0x2369a8){_0xe8b65f=_0xe8b65f-0x0;var _0x1143de=_0x7a54[_0xe8b65f];return _0x1143de;};'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 898d1a2..78dcffe 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 _0x2397=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3783da,_0x60e36f){var _0x29382e=function(_0x557dca){while(--_0x557dca){_0x3783da['push'](_0x3783da['shift']());}};_0x29382e(++_0x60e36f);}(_0x2397,0x1ec));var _0x7239=function(_0x2a1bcb,_0xc210b5){_0x2a1bcb=_0x2a1bcb-0x0;var _0x32e84e=_0x2397[_0x2a1bcb];return _0x32e84e;};'use strict';var _=require(_0x7239('0x0'));var util=require(_0x7239('0x1'));var moment=require(_0x7239('0x2'));var BPromise=require('bluebird');var rs=require(_0x7239('0x3'));var fs=require('fs');var Redis=require(_0x7239('0x4'));var db=require(_0x7239('0x5'))['db'];var utils=require(_0x7239('0x6'));var logger=require('../../config/logger')(_0x7239('0x7'));var config=require(_0x7239('0x8'));var jayson=require(_0x7239('0x9'));var client=jayson[_0x7239('0xa')][_0x7239('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b146b,_0x1c710f,_0xc9c4b7){return new BPromise(function(_0x55bed0,_0x49fe0e){return client['request'](_0x3b146b,_0xc9c4b7)[_0x7239('0xc')](function(_0xd0828d){logger[_0x7239('0xd')](_0x7239('0xe'),_0x1c710f,_0x7239('0xf'));logger[_0x7239('0x10')](_0x7239('0x11'),_0x1c710f,_0x7239('0xf'),JSON['stringify'](_0xd0828d));if(_0xd0828d[_0x7239('0x12')]){if(_0xd0828d[_0x7239('0x12')][_0x7239('0x13')]===0x1f4){logger[_0x7239('0x12')]('Cdr,\x20%s,\x20%s',_0x1c710f,_0xd0828d[_0x7239('0x12')][_0x7239('0x14')]);return _0x49fe0e(_0xd0828d[_0x7239('0x12')][_0x7239('0x14')]);}logger[_0x7239('0x12')](_0x7239('0xe'),_0x1c710f,_0xd0828d[_0x7239('0x12')]['message']);return _0x55bed0(_0xd0828d['error'][_0x7239('0x14')]);}else{logger['info'](_0x7239('0xe'),_0x1c710f,'request\x20sent');_0x55bed0(_0xd0828d[_0x7239('0x15')][_0x7239('0x14')]);}})[_0x7239('0x16')](function(_0x49c127){logger['error'](_0x7239('0xe'),_0x1c710f,_0x49c127);_0x49fe0e(_0x49c127);});});} \ No newline at end of file +var _0x48ce=['http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a1f26,_0x4fc0d7){var _0x4613b9=function(_0x17bc3b){while(--_0x17bc3b){_0x3a1f26['push'](_0x3a1f26['shift']());}};_0x4613b9(++_0x4fc0d7);}(_0x48ce,0xb4));var _0xe48c=function(_0x16c6e9,_0x5aecfc){_0x16c6e9=_0x16c6e9-0x0;var _0x53439f=_0x48ce[_0x16c6e9];return _0x53439f;};'use strict';var _=require(_0xe48c('0x0'));var util=require(_0xe48c('0x1'));var moment=require(_0xe48c('0x2'));var BPromise=require(_0xe48c('0x3'));var rs=require(_0xe48c('0x4'));var fs=require('fs');var Redis=require(_0xe48c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe48c('0x6'));var logger=require(_0xe48c('0x7'))(_0xe48c('0x8'));var config=require(_0xe48c('0x9'));var jayson=require(_0xe48c('0xa'));var client=jayson[_0xe48c('0xb')][_0xe48c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40d464,_0x5b97c7,_0x120e3e){return new BPromise(function(_0x3f397e,_0x44ce83){return client['request'](_0x40d464,_0x120e3e)[_0xe48c('0xd')](function(_0x90f8a0){logger[_0xe48c('0xe')](_0xe48c('0xf'),_0x5b97c7,_0xe48c('0x10'));logger[_0xe48c('0x11')](_0xe48c('0x12'),_0x5b97c7,_0xe48c('0x10'),JSON[_0xe48c('0x13')](_0x90f8a0));if(_0x90f8a0[_0xe48c('0x14')]){if(_0x90f8a0[_0xe48c('0x14')][_0xe48c('0x15')]===0x1f4){logger[_0xe48c('0x14')](_0xe48c('0xf'),_0x5b97c7,_0x90f8a0['error']['message']);return _0x44ce83(_0x90f8a0[_0xe48c('0x14')][_0xe48c('0x16')]);}logger[_0xe48c('0x14')](_0xe48c('0xf'),_0x5b97c7,_0x90f8a0['error'][_0xe48c('0x16')]);return _0x3f397e(_0x90f8a0[_0xe48c('0x14')][_0xe48c('0x16')]);}else{logger[_0xe48c('0xe')](_0xe48c('0xf'),_0x5b97c7,'request\x20sent');_0x3f397e(_0x90f8a0[_0xe48c('0x17')]['message']);}})['catch'](function(_0xfa9dd0){logger[_0xe48c('0x14')]('Cdr,\x20%s,\x20%s',_0x5b97c7,_0xfa9dd0);_0x44ce83(_0xfa9dd0);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 4829f49..b8bb8de 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(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 02cf4cb..2ea397d 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 _0x4f7c=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f7c,0x185));var _0xc4f7=function(_0x157af5,_0x23bd1f){_0x157af5=_0x157af5-0x0;var _0x5d5d58=_0x4f7c[_0x157af5];return _0x5d5d58;};'use strict';var Sequelize=require('sequelize');module[_0xc4f7('0x0')]={'priority':{'type':Sequelize[_0xc4f7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc4f7('0x2')],'allowNull':![],'defaultValue':_0xc4f7('0x3')},'appdata':{'type':Sequelize[_0xc4f7('0x4')]()},'description':{'type':Sequelize[_0xc4f7('0x2')]},'interval':{'type':Sequelize[_0xc4f7('0x2')],'defaultValue':_0xc4f7('0x5')}}; \ No newline at end of file +var _0xcb6a=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x3733eb,_0x2d9450){var _0x4c80e3=function(_0x365bce){while(--_0x365bce){_0x3733eb['push'](_0x3733eb['shift']());}};_0x4c80e3(++_0x2d9450);}(_0xcb6a,0x19e));var _0xacb6=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xcb6a[_0x38537f];return _0x141e23;};'use strict';var Sequelize=require(_0xacb6('0x0'));module[_0xacb6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xacb6('0x2')],'allowNull':![],'defaultValue':_0xacb6('0x3')},'appdata':{'type':Sequelize[_0xacb6('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xacb6('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 9e3a2a3..c81dffb 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 _0x7229=['zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','params','keys','ChatApplication','query','filters','intersection','model','fields','attributes','length','include','merge','options','find','catch','body','eml-format','rimraf'];(function(_0x55bd12,_0x4dbbb9){var _0x5990f4=function(_0xa59be5){while(--_0xa59be5){_0x55bd12['push'](_0x55bd12['shift']());}};_0x5990f4(++_0x4dbbb9);}(_0x7229,0x76));var _0x9722=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7229[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x9722('0x0'));var rimraf=require(_0x9722('0x1'));var zipdir=require(_0x9722('0x2'));var jsonpatch=require(_0x9722('0x3'));var rp=require(_0x9722('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9722('0x5'));var util=require(_0x9722('0x6'));var path=require(_0x9722('0x7'));var sox=require(_0x9722('0x8'));var csv=require(_0x9722('0x9'));var ejs=require(_0x9722('0xa'));var fs=require('fs');var fs_extra=require(_0x9722('0xb'));var _=require('lodash');var squel=require(_0x9722('0xc'));var crypto=require('crypto');var jsforce=require(_0x9722('0xd'));var deskjs=require(_0x9722('0xe'));var toCsv=require(_0x9722('0x9'));var querystring=require(_0x9722('0xf'));var Papa=require(_0x9722('0x10'));var Redis=require(_0x9722('0x11'));var authService=require(_0x9722('0x12'));var qs=require(_0x9722('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9722('0x14'))(_0x9722('0x15'));var utils=require(_0x9722('0x16'));var config=require(_0x9722('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9722('0x18'))['db'];function respondWithStatusCode(_0x32fd25,_0x11942f){_0x11942f=_0x11942f||0xcc;return function(_0x124bfc){if(_0x124bfc){return _0x32fd25['sendStatus'](_0x11942f);}return _0x32fd25[_0x9722('0x19')](_0x11942f)[_0x9722('0x1a')]();};}function respondWithResult(_0x256348,_0x248bdf){_0x248bdf=_0x248bdf||0xc8;return function(_0x2f1c3b){if(_0x2f1c3b){return _0x256348['status'](_0x248bdf)[_0x9722('0x1b')](_0x2f1c3b);}};}function respondWithFilteredResult(_0x203db5,_0x2f2f96){return function(_0x482ad4){if(_0x482ad4){var _0xc802f7=typeof _0x2f2f96[_0x9722('0x1c')]==='undefined'&&typeof _0x2f2f96[_0x9722('0x1d')]===_0x9722('0x1e');var _0x38e179=_0x482ad4['count'];var _0x43b3fa=_0xc802f7?0x0:_0x2f2f96[_0x9722('0x1c')];var _0x38112a=_0xc802f7?_0x482ad4[_0x9722('0x1f')]:_0x2f2f96[_0x9722('0x1c')]+_0x2f2f96[_0x9722('0x1d')];var _0x2481f5;if(_0x38112a>=_0x38e179){_0x38112a=_0x38e179;_0x2481f5=0xc8;}else{_0x2481f5=0xce;}_0x203db5[_0x9722('0x19')](_0x2481f5);return _0x203db5[_0x9722('0x20')](_0x9722('0x21'),_0x43b3fa+'-'+_0x38112a+'/'+_0x38e179)[_0x9722('0x1b')](_0x482ad4);}return null;};}function patchUpdates(_0x23e9d0){return function(_0x451ce8){try{jsonpatch[_0x9722('0x22')](_0x451ce8,_0x23e9d0,!![]);}catch(_0x3b094d){return BPromise[_0x9722('0x23')](_0x3b094d);}return _0x451ce8['save']();};}function saveUpdates(_0x22a3e2,_0x3ab4d4){return function(_0x3abf4b){if(_0x3abf4b){return _0x3abf4b[_0x9722('0x24')](_0x22a3e2)[_0x9722('0x25')](function(_0x392d59){return _0x392d59;});}return null;};}function removeEntity(_0x4aeea7,_0x73c303){return function(_0x1aff40){if(_0x1aff40){return _0x1aff40[_0x9722('0x26')]()[_0x9722('0x25')](function(){_0x4aeea7[_0x9722('0x19')](0xcc)[_0x9722('0x1a')]();});}};}function handleEntityNotFound(_0x3b3ce9,_0x1f2ad8){return function(_0x4aab4e){if(!_0x4aab4e){_0x3b3ce9[_0x9722('0x27')](0x194);}return _0x4aab4e;};}function handleError(_0x5bf6f2,_0x141c7d){_0x141c7d=_0x141c7d||0x1f4;return function(_0x19a7b6){logger[_0x9722('0x28')](_0x19a7b6[_0x9722('0x29')]);if(_0x19a7b6[_0x9722('0x2a')]){delete _0x19a7b6[_0x9722('0x2a')];}_0x5bf6f2[_0x9722('0x19')](_0x141c7d)[_0x9722('0x2b')](_0x19a7b6);};}exports['show']=function(_0x19ffa8,_0x4805be){var _0x568ddc={'raw':!![],'where':{'id':_0x19ffa8[_0x9722('0x2c')]['id']}},_0x18fa43={};_0x18fa43['model']=_[_0x9722('0x2d')](db[_0x9722('0x2e')]['rawAttributes']);_0x18fa43['query']=_[_0x9722('0x2d')](_0x19ffa8[_0x9722('0x2f')]);_0x18fa43[_0x9722('0x30')]=_[_0x9722('0x31')](_0x18fa43[_0x9722('0x32')],_0x18fa43[_0x9722('0x2f')]);_0x568ddc['attributes']=_[_0x9722('0x31')](_0x18fa43[_0x9722('0x32')],qs[_0x9722('0x33')](_0x19ffa8[_0x9722('0x2f')]['fields']));_0x568ddc[_0x9722('0x34')]=_0x568ddc[_0x9722('0x34')][_0x9722('0x35')]?_0x568ddc['attributes']:_0x18fa43['model'];if(_0x19ffa8[_0x9722('0x2f')]['includeAll']){_0x568ddc[_0x9722('0x36')]=[{'all':!![]}];}_0x568ddc=_[_0x9722('0x37')]({},_0x568ddc,_0x19ffa8[_0x9722('0x38')]);return db[_0x9722('0x2e')][_0x9722('0x39')](_0x568ddc)[_0x9722('0x25')](handleEntityNotFound(_0x4805be,null))[_0x9722('0x25')](respondWithResult(_0x4805be,null))[_0x9722('0x3a')](handleError(_0x4805be,null));};exports[_0x9722('0x24')]=function(_0x463dd8,_0x427244){if(_0x463dd8[_0x9722('0x3b')]['id']){delete _0x463dd8['body']['id'];}return db['ChatApplication'][_0x9722('0x39')]({'where':{'id':_0x463dd8[_0x9722('0x2c')]['id']}})[_0x9722('0x25')](handleEntityNotFound(_0x427244,null))[_0x9722('0x25')](saveUpdates(_0x463dd8[_0x9722('0x3b')],null))[_0x9722('0x25')](respondWithResult(_0x427244,null))[_0x9722('0x3a')](handleError(_0x427244,null));};exports[_0x9722('0x26')]=function(_0x519368,_0x44b9f4){return db['ChatApplication']['find']({'where':{'id':_0x519368[_0x9722('0x2c')]['id']}})[_0x9722('0x25')](handleEntityNotFound(_0x44b9f4,null))[_0x9722('0x25')](removeEntity(_0x44b9f4,null))['catch'](handleError(_0x44b9f4,null));}; \ No newline at end of file +var _0x25a3=['util','sox','to-csv','ejs','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','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes','intersection','fields','length','includeAll','include','options','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x25a3,0x121));var _0x325a=function(_0x9e43d3,_0x1f6a1b){_0x9e43d3=_0x9e43d3-0x0;var _0x5e46d3=_0x25a3[_0x9e43d3];return _0x5e46d3;};'use strict';var emlformat=require(_0x325a('0x0'));var rimraf=require(_0x325a('0x1'));var zipdir=require(_0x325a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x325a('0x3'));var moment=require('moment');var BPromise=require(_0x325a('0x4'));var Mustache=require(_0x325a('0x5'));var util=require(_0x325a('0x6'));var path=require('path');var sox=require(_0x325a('0x7'));var csv=require(_0x325a('0x8'));var ejs=require(_0x325a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x325a('0xa'));var crypto=require(_0x325a('0xb'));var jsforce=require(_0x325a('0xc'));var deskjs=require(_0x325a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x325a('0xe'));var Redis=require(_0x325a('0xf'));var authService=require(_0x325a('0x10'));var qs=require(_0x325a('0x11'));var as=require(_0x325a('0x12'));var hardwareService=require(_0x325a('0x13'));var logger=require('../../config/logger')(_0x325a('0x14'));var utils=require(_0x325a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x325a('0x16'));var db=require(_0x325a('0x17'))['db'];function respondWithStatusCode(_0x2a8750,_0x3e90fe){_0x3e90fe=_0x3e90fe||0xcc;return function(_0x4e3b88){if(_0x4e3b88){return _0x2a8750['sendStatus'](_0x3e90fe);}return _0x2a8750[_0x325a('0x18')](_0x3e90fe)['end']();};}function respondWithResult(_0x3d12d5,_0xa8dc3a){_0xa8dc3a=_0xa8dc3a||0xc8;return function(_0x3db556){if(_0x3db556){return _0x3d12d5[_0x325a('0x18')](_0xa8dc3a)[_0x325a('0x19')](_0x3db556);}};}function respondWithFilteredResult(_0x3d198c,_0x1d7efc){return function(_0x4412ba){if(_0x4412ba){var _0x1fd4ec=typeof _0x1d7efc[_0x325a('0x1a')]===_0x325a('0x1b')&&typeof _0x1d7efc[_0x325a('0x1c')]===_0x325a('0x1b');var _0x1dcafe=_0x4412ba['count'];var _0x4cba7=_0x1fd4ec?0x0:_0x1d7efc[_0x325a('0x1a')];var _0x4a1f9f=_0x1fd4ec?_0x4412ba[_0x325a('0x1d')]:_0x1d7efc[_0x325a('0x1a')]+_0x1d7efc[_0x325a('0x1c')];var _0x297599;if(_0x4a1f9f>=_0x1dcafe){_0x4a1f9f=_0x1dcafe;_0x297599=0xc8;}else{_0x297599=0xce;}_0x3d198c[_0x325a('0x18')](_0x297599);return _0x3d198c[_0x325a('0x1e')](_0x325a('0x1f'),_0x4cba7+'-'+_0x4a1f9f+'/'+_0x1dcafe)[_0x325a('0x19')](_0x4412ba);}return null;};}function patchUpdates(_0x347f2d){return function(_0x1d76b7){try{jsonpatch[_0x325a('0x20')](_0x1d76b7,_0x347f2d,!![]);}catch(_0x11f0cb){return BPromise['reject'](_0x11f0cb);}return _0x1d76b7[_0x325a('0x21')]();};}function saveUpdates(_0x32a2f5,_0x18e29f){return function(_0x192e83){if(_0x192e83){return _0x192e83[_0x325a('0x22')](_0x32a2f5)[_0x325a('0x23')](function(_0x4c21bf){return _0x4c21bf;});}return null;};}function removeEntity(_0x36b2ac,_0x4c403d){return function(_0x15b5a6){if(_0x15b5a6){return _0x15b5a6[_0x325a('0x24')]()[_0x325a('0x23')](function(){_0x36b2ac[_0x325a('0x18')](0xcc)[_0x325a('0x25')]();});}};}function handleEntityNotFound(_0x4b3d65,_0x29543e){return function(_0x4b4155){if(!_0x4b4155){_0x4b3d65[_0x325a('0x26')](0x194);}return _0x4b4155;};}function handleError(_0x26c001,_0x41d0d2){_0x41d0d2=_0x41d0d2||0x1f4;return function(_0x5ad31d){logger[_0x325a('0x27')](_0x5ad31d[_0x325a('0x28')]);if(_0x5ad31d[_0x325a('0x29')]){delete _0x5ad31d[_0x325a('0x29')];}_0x26c001[_0x325a('0x18')](_0x41d0d2)[_0x325a('0x2a')](_0x5ad31d);};}exports[_0x325a('0x2b')]=function(_0x49d93b,_0x44468d){var _0x5cdfd1={'raw':!![],'where':{'id':_0x49d93b[_0x325a('0x2c')]['id']}},_0x201e01={};_0x201e01[_0x325a('0x2d')]=_[_0x325a('0x2e')](db[_0x325a('0x2f')]['rawAttributes']);_0x201e01[_0x325a('0x30')]=_['keys'](_0x49d93b[_0x325a('0x30')]);_0x201e01[_0x325a('0x31')]=_['intersection'](_0x201e01[_0x325a('0x2d')],_0x201e01[_0x325a('0x30')]);_0x5cdfd1[_0x325a('0x32')]=_[_0x325a('0x33')](_0x201e01['model'],qs[_0x325a('0x34')](_0x49d93b[_0x325a('0x30')][_0x325a('0x34')]));_0x5cdfd1[_0x325a('0x32')]=_0x5cdfd1['attributes'][_0x325a('0x35')]?_0x5cdfd1[_0x325a('0x32')]:_0x201e01[_0x325a('0x2d')];if(_0x49d93b[_0x325a('0x30')][_0x325a('0x36')]){_0x5cdfd1[_0x325a('0x37')]=[{'all':!![]}];}_0x5cdfd1=_['merge']({},_0x5cdfd1,_0x49d93b[_0x325a('0x38')]);return db[_0x325a('0x2f')]['find'](_0x5cdfd1)[_0x325a('0x23')](handleEntityNotFound(_0x44468d,null))[_0x325a('0x23')](respondWithResult(_0x44468d,null))['catch'](handleError(_0x44468d,null));};exports[_0x325a('0x22')]=function(_0x54d32a,_0x2dd1de){if(_0x54d32a[_0x325a('0x39')]['id']){delete _0x54d32a[_0x325a('0x39')]['id'];}return db[_0x325a('0x2f')]['find']({'where':{'id':_0x54d32a[_0x325a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2dd1de,null))[_0x325a('0x23')](saveUpdates(_0x54d32a['body'],null))['then'](respondWithResult(_0x2dd1de,null))[_0x325a('0x3a')](handleError(_0x2dd1de,null));};exports[_0x325a('0x24')]=function(_0x37f206,_0x50b80c){return db[_0x325a('0x2f')]['find']({'where':{'id':_0x37f206[_0x325a('0x2c')]['id']}})[_0x325a('0x23')](handleEntityNotFound(_0x50b80c,null))[_0x325a('0x23')](removeEntity(_0x50b80c,null))[_0x325a('0x3a')](handleError(_0x50b80c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 3e098ad..5406a1f 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 _0xe1bc=['../../config/environment','./chatApplication.attributes','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1da9a7,_0x1c3c70){var _0x3c3219=function(_0x32fb7f){while(--_0x32fb7f){_0x1da9a7['push'](_0x1da9a7['shift']());}};_0x3c3219(++_0x1c3c70);}(_0xe1bc,0xf4));var _0xce1b=function(_0x5e36e8,_0x5e3fb2){_0x5e36e8=_0x5e36e8-0x0;var _0x3f787a=_0xe1bc[_0x5e36e8];return _0x3f787a;};'use strict';var _=require('lodash');var util=require(_0xce1b('0x0'));var logger=require(_0xce1b('0x1'))(_0xce1b('0x2'));var moment=require(_0xce1b('0x3'));var BPromise=require(_0xce1b('0x4'));var rp=require(_0xce1b('0x5'));var fs=require('fs');var path=require(_0xce1b('0x6'));var rimraf=require(_0xce1b('0x7'));var config=require(_0xce1b('0x8'));var attributes=require(_0xce1b('0x9'));module[_0xce1b('0xa')]=function(_0x2700a0,_0x286300){return _0x2700a0['define']('ChatApplication',attributes,{'tableName':_0xce1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce1b('0xc'),'collate':_0xce1b('0xd')});}; \ No newline at end of file +var _0x3868=['lodash','../../config/logger','api','request-promise','path','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci'];(function(_0xb05c71,_0x5891c7){var _0x4132b4=function(_0x5ca6f9){while(--_0x5ca6f9){_0xb05c71['push'](_0xb05c71['shift']());}};_0x4132b4(++_0x5891c7);}(_0x3868,0x1ad));var _0x8386=function(_0x686dfa,_0x38aca5){_0x686dfa=_0x686dfa-0x0;var _0x2190c1=_0x3868[_0x686dfa];return _0x2190c1;};'use strict';var _=require(_0x8386('0x0'));var util=require('util');var logger=require(_0x8386('0x1'))(_0x8386('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8386('0x3'));var fs=require('fs');var path=require(_0x8386('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8386('0x5'));module[_0x8386('0x6')]=function(_0x53357b,_0x5af64c){return _0x53357b[_0x8386('0x7')](_0x8386('0x8'),attributes,{'tableName':_0x8386('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8386('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 6e2294a..49bb5e9 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 _0x8269=['info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x8269,0x74));var _0x9826=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x8269[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x9826('0x0'));var util=require(_0x9826('0x1'));var moment=require('moment');var BPromise=require(_0x9826('0x2'));var rs=require(_0x9826('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9826('0x4'))['db'];var utils=require(_0x9826('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9826('0x6'));var jayson=require(_0x9826('0x7'));var client=jayson[_0x9826('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51e00d,_0x4d1237,_0x228f59){return new BPromise(function(_0x270661,_0x3ee2b4){return client[_0x9826('0x9')](_0x51e00d,_0x228f59)['then'](function(_0x5cabc1){logger[_0x9826('0xa')](_0x9826('0xb'),_0x4d1237,'request\x20sent');logger[_0x9826('0xc')](_0x9826('0xd'),_0x4d1237,_0x9826('0xe'),JSON['stringify'](_0x5cabc1));if(_0x5cabc1[_0x9826('0xf')]){if(_0x5cabc1['error']['code']===0x1f4){logger['error'](_0x9826('0xb'),_0x4d1237,_0x5cabc1[_0x9826('0xf')]['message']);return _0x3ee2b4(_0x5cabc1[_0x9826('0xf')][_0x9826('0x10')]);}logger[_0x9826('0xf')](_0x9826('0xb'),_0x4d1237,_0x5cabc1['error'][_0x9826('0x10')]);return _0x270661(_0x5cabc1[_0x9826('0xf')][_0x9826('0x10')]);}else{logger[_0x9826('0xa')](_0x9826('0xb'),_0x4d1237,_0x9826('0xe'));_0x270661(_0x5cabc1['result'][_0x9826('0x10')]);}})[_0x9826('0x11')](function(_0x58eb83){logger[_0x9826('0xf')](_0x9826('0xb'),_0x4d1237,_0x58eb83);_0x3ee2b4(_0x58eb83);});});} \ No newline at end of file +var _0xf6f0=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x520871,_0x3234ec){var _0x3966d4=function(_0x255796){while(--_0x255796){_0x520871['push'](_0x520871['shift']());}};_0x3966d4(++_0x3234ec);}(_0xf6f0,0xdd));var _0x0f6f=function(_0x582d37,_0xc34a90){_0x582d37=_0x582d37-0x0;var _0x4aa6b6=_0xf6f0[_0x582d37];return _0x4aa6b6;};'use strict';var _=require('lodash');var util=require(_0x0f6f('0x0'));var moment=require('moment');var BPromise=require(_0x0f6f('0x1'));var rs=require(_0x0f6f('0x2'));var fs=require('fs');var Redis=require(_0x0f6f('0x3'));var db=require(_0x0f6f('0x4'))['db'];var utils=require(_0x0f6f('0x5'));var logger=require(_0x0f6f('0x6'))(_0x0f6f('0x7'));var config=require(_0x0f6f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0f6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33da23,_0x1bb1e2,_0x247412){return new BPromise(function(_0x3298c1,_0x52eff3){return client[_0x0f6f('0xa')](_0x33da23,_0x247412)[_0x0f6f('0xb')](function(_0xc1537f){logger[_0x0f6f('0xc')](_0x0f6f('0xd'),_0x1bb1e2,_0x0f6f('0xe'));logger['debug'](_0x0f6f('0xf'),_0x1bb1e2,_0x0f6f('0xe'),JSON[_0x0f6f('0x10')](_0xc1537f));if(_0xc1537f[_0x0f6f('0x11')]){if(_0xc1537f['error'][_0x0f6f('0x12')]===0x1f4){logger[_0x0f6f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x1bb1e2,_0xc1537f[_0x0f6f('0x11')][_0x0f6f('0x13')]);return _0x52eff3(_0xc1537f['error'][_0x0f6f('0x13')]);}logger[_0x0f6f('0x11')](_0x0f6f('0xd'),_0x1bb1e2,_0xc1537f[_0x0f6f('0x11')][_0x0f6f('0x13')]);return _0x3298c1(_0xc1537f[_0x0f6f('0x11')]['message']);}else{logger[_0x0f6f('0xc')](_0x0f6f('0xd'),_0x1bb1e2,_0x0f6f('0xe'));_0x3298c1(_0xc1537f['result'][_0x0f6f('0x13')]);}})[_0x0f6f('0x14')](function(_0x2c8cab){logger[_0x0f6f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x1bb1e2,_0x2c8cab);_0x52eff3(_0x2c8cab);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e636cf3..4478ddf 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 _0x7a30=['get','/:id','isAuthenticated','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x7a30,0xf4));var _0x07a3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7a30[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x07a3('0x0'));var timeout=require(_0x07a3('0x1'));var express=require(_0x07a3('0x2'));var router=express[_0x07a3('0x3')]();var fs_extra=require(_0x07a3('0x4'));var auth=require(_0x07a3('0x5'));var interaction=require(_0x07a3('0x6'));var config=require(_0x07a3('0x7'));var controller=require('./chatApplication.controller');router[_0x07a3('0x8')](_0x07a3('0x9'),auth[_0x07a3('0xa')](),controller['show']);router[_0x07a3('0xb')](_0x07a3('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x07a3('0xc')](_0x07a3('0x9'),auth[_0x07a3('0xa')](),controller['destroy']);module[_0x07a3('0xd')]=router; \ No newline at end of file +var _0x9a73=['get','show','put','/:id','isAuthenticated','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','./chatApplication.controller'];(function(_0x28068a,_0x5bf598){var _0x73c877=function(_0x3ce275){while(--_0x3ce275){_0x28068a['push'](_0x28068a['shift']());}};_0x73c877(++_0x5bf598);}(_0x9a73,0x104));var _0x39a7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9a73[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x39a7('0x0'));var util=require('util');var path=require(_0x39a7('0x1'));var timeout=require('connect-timeout');var express=require(_0x39a7('0x2'));var router=express['Router']();var fs_extra=require(_0x39a7('0x3'));var auth=require(_0x39a7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x39a7('0x5'));router[_0x39a7('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x39a7('0x7')]);router[_0x39a7('0x8')](_0x39a7('0x9'),auth[_0x39a7('0xa')](),controller['update']);router[_0x39a7('0xb')]('/:id',auth[_0x39a7('0xa')](),controller[_0x39a7('0xc')]);module[_0x39a7('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 1d52bca..fee7a05 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 _0xcf98=['exports','STRING','BOOLEAN'];(function(_0x3db5a3,_0x55994c){var _0x1afffe=function(_0x4b491c){while(--_0x4b491c){_0x3db5a3['push'](_0x3db5a3['shift']());}};_0x1afffe(++_0x55994c);}(_0xcf98,0x8d));var _0x8cf9=function(_0x5b27a2,_0x1a8a03){_0x5b27a2=_0x5b27a2-0x0;var _0x5f2689=_0xcf98[_0x5b27a2];return _0x5f2689;};'use strict';var Sequelize=require('sequelize');module[_0x8cf9('0x0')]={'name':{'type':Sequelize[_0x8cf9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8cf9('0x1')]},'write':{'type':Sequelize[_0x8cf9('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xab47=['BOOLEAN','STRING'];(function(_0x2fd116,_0x1a4969){var _0x3433c7=function(_0x5b3d70){while(--_0x5b3d70){_0x2fd116['push'](_0x2fd116['shift']());}};_0x3433c7(++_0x1a4969);}(_0xab47,0xb1));var _0x7ab4=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xab47[_0x7b173];return _0x1c598c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7ab4('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x7ab4('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 7dc7f65..ac80b23 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 _0x3f64=['User','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ChatGroup','fieldName','type','key','model','intersection','attributes','fields','query','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','options','find','create','body','describe','getUnread','ChatInternalMessage','addMembers','omit','getMembers','findOne','keys'];(function(_0x3371e0,_0x8b967a){var _0x5537e3=function(_0x459cdf){while(--_0x459cdf){_0x3371e0['push'](_0x3371e0['shift']());}};_0x5537e3(++_0x8b967a);}(_0x3f64,0x127));var _0x43f6=function(_0x7b775f,_0x712e81){_0x7b775f=_0x7b775f-0x0;var _0x5b30e2=_0x3f64[_0x7b775f];return _0x5b30e2;};'use strict';var emlformat=require(_0x43f6('0x0'));var rimraf=require(_0x43f6('0x1'));var zipdir=require(_0x43f6('0x2'));var jsonpatch=require(_0x43f6('0x3'));var rp=require(_0x43f6('0x4'));var moment=require(_0x43f6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x43f6('0x6'));var util=require(_0x43f6('0x7'));var path=require(_0x43f6('0x8'));var sox=require(_0x43f6('0x9'));var csv=require(_0x43f6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43f6('0xb'));var _=require(_0x43f6('0xc'));var squel=require(_0x43f6('0xd'));var crypto=require(_0x43f6('0xe'));var jsforce=require(_0x43f6('0xf'));var deskjs=require(_0x43f6('0x10'));var toCsv=require(_0x43f6('0xa'));var querystring=require(_0x43f6('0x11'));var Papa=require('papaparse');var Redis=require(_0x43f6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x43f6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x43f6('0x14'));var utils=require('../../config/utils');var config=require(_0x43f6('0x15'));var licenseUtil=require(_0x43f6('0x16'));var db=require(_0x43f6('0x17'))['db'];config[_0x43f6('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x43f6('0x19'))(new Redis(config[_0x43f6('0x18')]));require(_0x43f6('0x1a'))[_0x43f6('0x1b')](socket);function respondWithStatusCode(_0xde7390,_0x170895){_0x170895=_0x170895||0xcc;return function(_0x542596){if(_0x542596){return _0xde7390[_0x43f6('0x1c')](_0x170895);}return _0xde7390['status'](_0x170895)[_0x43f6('0x1d')]();};}function respondWithResult(_0x4a6f0a,_0x5d6f01){_0x5d6f01=_0x5d6f01||0xc8;return function(_0x2288d6){if(_0x2288d6){return _0x4a6f0a[_0x43f6('0x1e')](_0x5d6f01)[_0x43f6('0x1f')](_0x2288d6);}};}function respondWithFilteredResult(_0x593c31,_0x1976e7){return function(_0x4ab67f){if(_0x4ab67f){var _0x104102=typeof _0x1976e7[_0x43f6('0x20')]===_0x43f6('0x21')&&typeof _0x1976e7[_0x43f6('0x22')]===_0x43f6('0x21');var _0x1db6fc=_0x4ab67f[_0x43f6('0x23')];var _0x27161e=_0x104102?0x0:_0x1976e7[_0x43f6('0x20')];var _0x43cde2=_0x104102?_0x4ab67f[_0x43f6('0x23')]:_0x1976e7[_0x43f6('0x20')]+_0x1976e7[_0x43f6('0x22')];var _0x62cf7d;if(_0x43cde2>=_0x1db6fc){_0x43cde2=_0x1db6fc;_0x62cf7d=0xc8;}else{_0x62cf7d=0xce;}_0x593c31[_0x43f6('0x1e')](_0x62cf7d);return _0x593c31['set'](_0x43f6('0x24'),_0x27161e+'-'+_0x43cde2+'/'+_0x1db6fc)[_0x43f6('0x1f')](_0x4ab67f);}return null;};}function patchUpdates(_0x58bb52){return function(_0x2f78a0){try{jsonpatch[_0x43f6('0x25')](_0x2f78a0,_0x58bb52,!![]);}catch(_0x513565){return BPromise[_0x43f6('0x26')](_0x513565);}return _0x2f78a0[_0x43f6('0x27')]();};}function saveUpdates(_0x8d07f9,_0x1b302f){return function(_0x5973a8){if(_0x5973a8){return _0x5973a8[_0x43f6('0x28')](_0x8d07f9)[_0x43f6('0x29')](function(_0x15a4f3){return _0x15a4f3;});}return null;};}function removeEntity(_0x866b30,_0x7e05f9){return function(_0x4a57ea){if(_0x4a57ea){return _0x4a57ea[_0x43f6('0x2a')]()[_0x43f6('0x29')](function(){_0x866b30[_0x43f6('0x1e')](0xcc)[_0x43f6('0x1d')]();});}};}function handleEntityNotFound(_0x3c455f,_0x1f8aea){return function(_0x1e1d75){if(!_0x1e1d75){_0x3c455f[_0x43f6('0x1c')](0x194);}return _0x1e1d75;};}function handleError(_0x55a278,_0x56c915){_0x56c915=_0x56c915||0x1f4;return function(_0x2b1b89){logger[_0x43f6('0x2b')](_0x2b1b89[_0x43f6('0x2c')]);if(_0x2b1b89['name']){delete _0x2b1b89[_0x43f6('0x2d')];}_0x55a278[_0x43f6('0x1e')](_0x56c915)['send'](_0x2b1b89);};}exports['index']=function(_0x5ab0a8,_0x22c431){var _0x2c49de={},_0x3d4128={},_0x418c5b={'count':0x0,'rows':[]};var _0x8e5d3d=_[_0x43f6('0x2e')](db[_0x43f6('0x2f')]['rawAttributes'],function(_0x529aed){return{'name':_0x529aed[_0x43f6('0x30')],'type':_0x529aed[_0x43f6('0x31')][_0x43f6('0x32')]};});_0x3d4128[_0x43f6('0x33')]=_['map'](_0x8e5d3d,_0x43f6('0x2d'));_0x3d4128['query']=_['keys'](_0x5ab0a8['query']);_0x3d4128['filters']=_[_0x43f6('0x34')](_0x3d4128[_0x43f6('0x33')],_0x3d4128['query']);_0x2c49de[_0x43f6('0x35')]=_['intersection'](_0x3d4128['model'],qs[_0x43f6('0x36')](_0x5ab0a8[_0x43f6('0x37')][_0x43f6('0x36')]));_0x2c49de[_0x43f6('0x35')]=_0x2c49de[_0x43f6('0x35')]['length']?_0x2c49de['attributes']:_0x3d4128[_0x43f6('0x33')];if(!_0x5ab0a8[_0x43f6('0x37')]['hasOwnProperty'](_0x43f6('0x38'))){_0x2c49de['limit']=qs[_0x43f6('0x22')](_0x5ab0a8[_0x43f6('0x37')][_0x43f6('0x22')]);_0x2c49de[_0x43f6('0x20')]=qs[_0x43f6('0x20')](_0x5ab0a8['query'][_0x43f6('0x20')]);}_0x2c49de[_0x43f6('0x39')]=qs['sort'](_0x5ab0a8['query'][_0x43f6('0x3a')]);_0x2c49de[_0x43f6('0x3b')]=qs[_0x43f6('0x3c')](_['pick'](_0x5ab0a8[_0x43f6('0x37')],_0x3d4128['filters']),_0x8e5d3d);if(_0x5ab0a8[_0x43f6('0x37')][_0x43f6('0x3d')]){_0x2c49de[_0x43f6('0x3b')]=_[_0x43f6('0x3e')](_0x2c49de[_0x43f6('0x3b')],{'$or':_[_0x43f6('0x2e')](_0x8e5d3d,function(_0x5bc986){if(_0x5bc986[_0x43f6('0x31')]!==_0x43f6('0x3f')){var _0x26d91e={};_0x26d91e[_0x5bc986[_0x43f6('0x2d')]]={'$like':'%'+_0x5ab0a8['query'][_0x43f6('0x3d')]+'%'};return _0x26d91e;}})});}_0x2c49de=_[_0x43f6('0x3e')]({},_0x2c49de,_0x5ab0a8['options']);var _0x535cda={'where':_0x2c49de[_0x43f6('0x3b')]};return db[_0x43f6('0x2f')][_0x43f6('0x23')](_0x535cda)[_0x43f6('0x29')](function(_0x44d2ed){_0x418c5b[_0x43f6('0x23')]=_0x44d2ed;if(_0x5ab0a8[_0x43f6('0x37')]['includeAll']){_0x2c49de[_0x43f6('0x40')]=[{'all':!![]}];}return db[_0x43f6('0x2f')][_0x43f6('0x41')](_0x2c49de);})[_0x43f6('0x29')](function(_0x2e4e90){_0x418c5b[_0x43f6('0x42')]=_0x2e4e90;return _0x418c5b;})['then'](respondWithFilteredResult(_0x22c431,_0x2c49de))[_0x43f6('0x43')](handleError(_0x22c431,null));};exports[_0x43f6('0x44')]=function(_0x568494,_0xe3adf){var _0x1e091b={'raw':!![],'where':{'id':_0x568494[_0x43f6('0x45')]['id']}},_0x469ecf={};_0x469ecf[_0x43f6('0x33')]=_['keys'](db[_0x43f6('0x2f')][_0x43f6('0x46')]);_0x469ecf[_0x43f6('0x37')]=_['keys'](_0x568494[_0x43f6('0x37')]);_0x469ecf[_0x43f6('0x3c')]=_[_0x43f6('0x34')](_0x469ecf[_0x43f6('0x33')],_0x469ecf[_0x43f6('0x37')]);_0x1e091b[_0x43f6('0x35')]=_[_0x43f6('0x34')](_0x469ecf[_0x43f6('0x33')],qs[_0x43f6('0x36')](_0x568494[_0x43f6('0x37')][_0x43f6('0x36')]));_0x1e091b[_0x43f6('0x35')]=_0x1e091b[_0x43f6('0x35')][_0x43f6('0x47')]?_0x1e091b[_0x43f6('0x35')]:_0x469ecf[_0x43f6('0x33')];if(_0x568494['query'][_0x43f6('0x48')]){_0x1e091b[_0x43f6('0x40')]=[{'all':!![]}];}_0x1e091b=_[_0x43f6('0x3e')]({},_0x1e091b,_0x568494[_0x43f6('0x49')]);return db['ChatGroup'][_0x43f6('0x4a')](_0x1e091b)[_0x43f6('0x29')](handleEntityNotFound(_0xe3adf,null))[_0x43f6('0x29')](respondWithResult(_0xe3adf,null))[_0x43f6('0x43')](handleError(_0xe3adf,null));};exports[_0x43f6('0x4b')]=function(_0x355172,_0x358816){return db[_0x43f6('0x2f')][_0x43f6('0x4b')](_0x355172[_0x43f6('0x4c')],{})['then'](respondWithResult(_0x358816,0xc9))[_0x43f6('0x43')](handleError(_0x358816,null));};exports[_0x43f6('0x28')]=function(_0x4293c1,_0x33a93f){if(_0x4293c1['body']['id']){delete _0x4293c1['body']['id'];}return db[_0x43f6('0x2f')][_0x43f6('0x4a')]({'where':{'id':_0x4293c1[_0x43f6('0x45')]['id']}})[_0x43f6('0x29')](handleEntityNotFound(_0x33a93f,null))[_0x43f6('0x29')](saveUpdates(_0x4293c1[_0x43f6('0x4c')],null))[_0x43f6('0x29')](respondWithResult(_0x33a93f,null))['catch'](handleError(_0x33a93f,null));};exports[_0x43f6('0x2a')]=function(_0x5dc702,_0x8f8771){return db['ChatGroup'][_0x43f6('0x4a')]({'where':{'id':_0x5dc702[_0x43f6('0x45')]['id']}})[_0x43f6('0x29')](handleEntityNotFound(_0x8f8771,null))[_0x43f6('0x29')](removeEntity(_0x8f8771,null))[_0x43f6('0x43')](handleError(_0x8f8771,null));};exports[_0x43f6('0x4d')]=function(_0x1f8451,_0x42ce75){return db['ChatGroup'][_0x43f6('0x4d')]()[_0x43f6('0x29')](respondWithResult(_0x42ce75,null))[_0x43f6('0x43')](handleError(_0x42ce75,null));};exports[_0x43f6('0x4e')]=function(_0x50173e,_0x193600,_0x44eeae){return db[_0x43f6('0x4f')][_0x43f6('0x23')]({'where':{'ChatGroupId':_0x50173e['params']['id'],'ToId':_0x50173e['user']['id'],'read':![]}})[_0x43f6('0x29')](function(_0x191549){return{'id':_['toInteger'](_0x50173e[_0x43f6('0x45')]['id']),'count':_0x191549};})[_0x43f6('0x29')](respondWithResult(_0x193600,null))[_0x43f6('0x43')](handleError(_0x193600,null));};exports[_0x43f6('0x50')]=function(_0x56ead7,_0x3f0aca,_0x3af47e){return db['ChatGroup'][_0x43f6('0x4a')]({'where':{'id':_0x56ead7[_0x43f6('0x45')]['id']}})[_0x43f6('0x29')](handleEntityNotFound(_0x3f0aca,null))[_0x43f6('0x29')](function(_0x4f9ec3){if(_0x4f9ec3){return _0x4f9ec3[_0x43f6('0x50')](_0x56ead7['body']['ids'],_[_0x43f6('0x51')](_0x56ead7[_0x43f6('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x3f0aca,null))[_0x43f6('0x43')](handleError(_0x3f0aca,null));};exports[_0x43f6('0x52')]=function(_0x394652,_0x18790f,_0x236aad){var _0x2dee63={};var _0x56d09f={};var _0x4512d6;var _0x188a5d;return db[_0x43f6('0x2f')][_0x43f6('0x53')]({'where':{'id':_0x394652[_0x43f6('0x45')]['id']}})[_0x43f6('0x29')](handleEntityNotFound(_0x18790f,null))[_0x43f6('0x29')](function(_0x2b87cf){if(_0x2b87cf){_0x4512d6=_0x2b87cf;_0x56d09f['model']=_[_0x43f6('0x54')](db[_0x43f6('0x55')]['rawAttributes']);_0x56d09f[_0x43f6('0x37')]=_[_0x43f6('0x54')](_0x394652['query']);_0x56d09f[_0x43f6('0x3c')]=_[_0x43f6('0x34')](_0x56d09f[_0x43f6('0x33')],_0x56d09f[_0x43f6('0x37')]);_0x2dee63['attributes']=_[_0x43f6('0x34')](_0x56d09f[_0x43f6('0x33')],qs[_0x43f6('0x36')](_0x394652[_0x43f6('0x37')][_0x43f6('0x36')]));_0x2dee63['attributes']=_0x2dee63[_0x43f6('0x35')][_0x43f6('0x47')]?_0x2dee63[_0x43f6('0x35')]:_0x56d09f[_0x43f6('0x33')];_0x2dee63[_0x43f6('0x39')]=qs[_0x43f6('0x3a')](_0x394652[_0x43f6('0x37')][_0x43f6('0x3a')]);_0x2dee63[_0x43f6('0x3b')]=qs['filters'](_[_0x43f6('0x56')](_0x394652[_0x43f6('0x37')],_0x56d09f['filters']));if(_0x394652['query'][_0x43f6('0x3d')]){_0x2dee63[_0x43f6('0x3b')]=_[_0x43f6('0x3e')](_0x2dee63[_0x43f6('0x3b')],{'$or':_['map'](_0x2dee63['attributes'],function(_0x45c4eb){var _0x4ce51b={};_0x4ce51b[_0x45c4eb]={'$like':'%'+_0x394652['query'][_0x43f6('0x3d')]+'%'};return _0x4ce51b;})});}_0x2dee63=_[_0x43f6('0x3e')]({},_0x2dee63,_0x394652[_0x43f6('0x49')]);return _0x4512d6[_0x43f6('0x52')](_0x2dee63);}})['then'](function(_0x50b022){if(_0x50b022){_0x188a5d=_0x50b022[_0x43f6('0x47')];if(!_0x394652[_0x43f6('0x37')][_0x43f6('0x57')](_0x43f6('0x38'))){_0x2dee63[_0x43f6('0x22')]=qs[_0x43f6('0x22')](_0x394652['query'][_0x43f6('0x22')]);_0x2dee63[_0x43f6('0x20')]=qs[_0x43f6('0x20')](_0x394652[_0x43f6('0x37')]['offset']);}return _0x4512d6['getMembers'](_0x2dee63);}})['then'](function(_0x34cc84){if(_0x34cc84){return _0x34cc84?{'count':_0x188a5d,'rows':_0x34cc84}:null;}})[_0x43f6('0x29')](respondWithResult(_0x18790f,null))[_0x43f6('0x43')](handleError(_0x18790f,null));};exports['removeMembers']=function(_0x5b94ad,_0x2b82b8,_0x3e5236){return db['ChatGroup'][_0x43f6('0x4a')]({'where':{'id':_0x5b94ad['params']['id']}})[_0x43f6('0x29')](handleEntityNotFound(_0x2b82b8,null))[_0x43f6('0x29')](function(_0x582af6){if(_0x582af6){return _0x582af6[_0x43f6('0x58')](_0x5b94ad['query']['ids']);}})[_0x43f6('0x29')](respondWithStatusCode(_0x2b82b8,null))[_0x43f6('0x43')](handleError(_0x2b82b8,null));};exports[_0x43f6('0x59')]=function(_0x405b98,_0x59b1fd,_0x36598f){if(_0x405b98[_0x43f6('0x4c')]['id']){delete _0x405b98[_0x43f6('0x4c')]['id'];}return db[_0x43f6('0x2f')]['find']({'where':{'id':_0x405b98['params']['id']}})[_0x43f6('0x29')](handleEntityNotFound(_0x59b1fd,null))[_0x43f6('0x29')](function(_0x9fbaf8){if(_0x9fbaf8){_0x405b98[_0x43f6('0x4c')][_0x43f6('0x5a')]=_0x9fbaf8['id'];return db['ChatInternalMessage'][_0x43f6('0x4b')](_0x405b98[_0x43f6('0x4c')]);}})[_0x43f6('0x29')](respondWithResult(_0x59b1fd,null))[_0x43f6('0x43')](handleError(_0x59b1fd,null));};exports['getMessages']=function(_0x291d76,_0x454d84,_0x3f03fc){var _0x4343a8={};var _0x1d2643={};var _0x17be82;var _0x6e70fc;return db[_0x43f6('0x2f')][_0x43f6('0x53')]({'where':{'id':_0x291d76['params']['id']}})['then'](handleEntityNotFound(_0x454d84,null))[_0x43f6('0x29')](function(_0x1671d9){if(_0x1671d9){_0x17be82=_0x1671d9;_0x1d2643[_0x43f6('0x33')]=_[_0x43f6('0x54')](db[_0x43f6('0x4f')][_0x43f6('0x46')]);_0x1d2643[_0x43f6('0x37')]=_['keys'](_0x291d76[_0x43f6('0x37')]);_0x1d2643[_0x43f6('0x3c')]=_[_0x43f6('0x34')](_0x1d2643[_0x43f6('0x33')],_0x1d2643['query']);_0x4343a8[_0x43f6('0x35')]=_[_0x43f6('0x34')](_0x1d2643[_0x43f6('0x33')],qs[_0x43f6('0x36')](_0x291d76[_0x43f6('0x37')][_0x43f6('0x36')]));_0x4343a8[_0x43f6('0x35')]=_0x4343a8['attributes'][_0x43f6('0x47')]?_0x4343a8[_0x43f6('0x35')]:_0x1d2643[_0x43f6('0x33')];_0x4343a8[_0x43f6('0x39')]=qs[_0x43f6('0x3a')](_0x291d76['query']['sort']);_0x4343a8[_0x43f6('0x3b')]=qs[_0x43f6('0x3c')](_[_0x43f6('0x56')](_0x291d76[_0x43f6('0x37')],_0x1d2643['filters']));if(_0x291d76[_0x43f6('0x37')][_0x43f6('0x3d')]){_0x4343a8[_0x43f6('0x3b')]=_[_0x43f6('0x3e')](_0x4343a8[_0x43f6('0x3b')],{'$or':_[_0x43f6('0x2e')](_0x4343a8['attributes'],function(_0x252357){var _0x1cbeed={};_0x1cbeed[_0x252357]={'$like':'%'+_0x291d76['query']['filter']+'%'};return _0x1cbeed;})});}if(_0x291d76[_0x43f6('0x37')]['$gte']){var _0x5f2581=_0x291d76[_0x43f6('0x37')]['$gte'][_0x43f6('0x5b')](',');var _0x1d63fe={};_0x1d63fe[_0x5f2581[0x0]]={'$gte':moment(_0x5f2581[0x1])[_0x43f6('0x5c')](_0x43f6('0x5d'))};_0x4343a8[_0x43f6('0x3b')]=_[_0x43f6('0x3e')](_0x4343a8[_0x43f6('0x3b')],_0x1d63fe);}_0x4343a8=_[_0x43f6('0x3e')]({},_0x4343a8,_0x291d76[_0x43f6('0x49')]);return _0x17be82['getMessages'](_0x4343a8);}})[_0x43f6('0x29')](function(_0x5e433e){if(_0x5e433e){_0x6e70fc=_0x5e433e['length'];if(!_0x291d76[_0x43f6('0x37')][_0x43f6('0x57')](_0x43f6('0x38'))){_0x4343a8[_0x43f6('0x22')]=qs['limit'](_0x291d76[_0x43f6('0x37')][_0x43f6('0x22')]);_0x4343a8[_0x43f6('0x20')]=qs['offset'](_0x291d76[_0x43f6('0x37')][_0x43f6('0x20')]);}return _0x17be82[_0x43f6('0x5e')](_0x4343a8);}})[_0x43f6('0x29')](function(_0x3e53f9){if(_0x3e53f9){return _0x3e53f9?{'count':_0x6e70fc,'rows':_0x3e53f9}:null;}})[_0x43f6('0x29')](respondWithResult(_0x454d84,null))[_0x43f6('0x43')](handleError(_0x454d84,null));}; \ No newline at end of file +var _0x664c=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','attributes','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','findOne','removeMembers','addMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra'];(function(_0x53af50,_0x53e3f6){var _0x4629b2=function(_0x40f99a){while(--_0x40f99a){_0x53af50['push'](_0x53af50['shift']());}};_0x4629b2(++_0x53e3f6);}(_0x664c,0x178));var _0xc664=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x664c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc664('0x0'));var rimraf=require(_0xc664('0x1'));var zipdir=require(_0xc664('0x2'));var jsonpatch=require(_0xc664('0x3'));var rp=require(_0xc664('0x4'));var moment=require(_0xc664('0x5'));var BPromise=require(_0xc664('0x6'));var Mustache=require(_0xc664('0x7'));var util=require(_0xc664('0x8'));var path=require('path');var sox=require(_0xc664('0x9'));var csv=require('to-csv');var ejs=require(_0xc664('0xa'));var fs=require('fs');var fs_extra=require(_0xc664('0xb'));var _=require(_0xc664('0xc'));var squel=require(_0xc664('0xd'));var crypto=require(_0xc664('0xe'));var jsforce=require(_0xc664('0xf'));var deskjs=require(_0xc664('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc664('0x11'));var Papa=require(_0xc664('0x12'));var Redis=require(_0xc664('0x13'));var authService=require(_0xc664('0x14'));var qs=require(_0xc664('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc664('0x16'))(_0xc664('0x17'));var utils=require(_0xc664('0x18'));var config=require(_0xc664('0x19'));var licenseUtil=require(_0xc664('0x1a'));var db=require(_0xc664('0x1b'))['db'];config[_0xc664('0x1c')]=_[_0xc664('0x1d')](config[_0xc664('0x1c')],{'host':_0xc664('0x1e'),'port':0x18eb});var socket=require(_0xc664('0x1f'))(new Redis(config['redis']));require(_0xc664('0x20'))['register'](socket);function respondWithStatusCode(_0x45aa22,_0x329221){_0x329221=_0x329221||0xcc;return function(_0xa20683){if(_0xa20683){return _0x45aa22['sendStatus'](_0x329221);}return _0x45aa22['status'](_0x329221)[_0xc664('0x21')]();};}function respondWithResult(_0x41369c,_0x12e049){_0x12e049=_0x12e049||0xc8;return function(_0x332032){if(_0x332032){return _0x41369c['status'](_0x12e049)[_0xc664('0x22')](_0x332032);}};}function respondWithFilteredResult(_0x3baeef,_0x4edb38){return function(_0x2d28cf){if(_0x2d28cf){var _0x3a65a7=typeof _0x4edb38[_0xc664('0x23')]===_0xc664('0x24')&&typeof _0x4edb38[_0xc664('0x25')]===_0xc664('0x24');var _0x28145e=_0x2d28cf['count'];var _0x35a31a=_0x3a65a7?0x0:_0x4edb38[_0xc664('0x23')];var _0x21227e=_0x3a65a7?_0x2d28cf[_0xc664('0x26')]:_0x4edb38['offset']+_0x4edb38[_0xc664('0x25')];var _0x4538d9;if(_0x21227e>=_0x28145e){_0x21227e=_0x28145e;_0x4538d9=0xc8;}else{_0x4538d9=0xce;}_0x3baeef[_0xc664('0x27')](_0x4538d9);return _0x3baeef[_0xc664('0x28')]('Content-Range',_0x35a31a+'-'+_0x21227e+'/'+_0x28145e)[_0xc664('0x22')](_0x2d28cf);}return null;};}function patchUpdates(_0x5a4c12){return function(_0x7937c4){try{jsonpatch[_0xc664('0x29')](_0x7937c4,_0x5a4c12,!![]);}catch(_0x25c480){return BPromise[_0xc664('0x2a')](_0x25c480);}return _0x7937c4[_0xc664('0x2b')]();};}function saveUpdates(_0x482e36,_0x3e64e2){return function(_0x33788b){if(_0x33788b){return _0x33788b[_0xc664('0x2c')](_0x482e36)[_0xc664('0x2d')](function(_0x42cc2a){return _0x42cc2a;});}return null;};}function removeEntity(_0x351840,_0x478563){return function(_0x504980){if(_0x504980){return _0x504980[_0xc664('0x2e')]()[_0xc664('0x2d')](function(){_0x351840[_0xc664('0x27')](0xcc)[_0xc664('0x21')]();});}};}function handleEntityNotFound(_0x2dd705,_0x357382){return function(_0x864595){if(!_0x864595){_0x2dd705['sendStatus'](0x194);}return _0x864595;};}function handleError(_0x54cba7,_0x2876a3){_0x2876a3=_0x2876a3||0x1f4;return function(_0x45e783){logger['error'](_0x45e783[_0xc664('0x2f')]);if(_0x45e783[_0xc664('0x30')]){delete _0x45e783[_0xc664('0x30')];}_0x54cba7[_0xc664('0x27')](_0x2876a3)['send'](_0x45e783);};}exports[_0xc664('0x31')]=function(_0x507a8f,_0x40c20b){var _0x12f424={},_0x178923={},_0x32788c={'count':0x0,'rows':[]};var _0x16b86c=_[_0xc664('0x32')](db[_0xc664('0x33')][_0xc664('0x34')],function(_0x1f2586){return{'name':_0x1f2586[_0xc664('0x35')],'type':_0x1f2586[_0xc664('0x36')][_0xc664('0x37')]};});_0x178923[_0xc664('0x38')]=_[_0xc664('0x32')](_0x16b86c,'name');_0x178923[_0xc664('0x39')]=_[_0xc664('0x3a')](_0x507a8f[_0xc664('0x39')]);_0x178923[_0xc664('0x3b')]=_[_0xc664('0x3c')](_0x178923['model'],_0x178923[_0xc664('0x39')]);_0x12f424['attributes']=_[_0xc664('0x3c')](_0x178923[_0xc664('0x38')],qs[_0xc664('0x3d')](_0x507a8f[_0xc664('0x39')][_0xc664('0x3d')]));_0x12f424['attributes']=_0x12f424['attributes'][_0xc664('0x3e')]?_0x12f424['attributes']:_0x178923[_0xc664('0x38')];if(!_0x507a8f[_0xc664('0x39')][_0xc664('0x3f')](_0xc664('0x40'))){_0x12f424[_0xc664('0x25')]=qs[_0xc664('0x25')](_0x507a8f['query']['limit']);_0x12f424[_0xc664('0x23')]=qs[_0xc664('0x23')](_0x507a8f['query'][_0xc664('0x23')]);}_0x12f424[_0xc664('0x41')]=qs[_0xc664('0x42')](_0x507a8f[_0xc664('0x39')][_0xc664('0x42')]);_0x12f424['where']=qs['filters'](_['pick'](_0x507a8f['query'],_0x178923[_0xc664('0x3b')]),_0x16b86c);if(_0x507a8f[_0xc664('0x39')][_0xc664('0x43')]){_0x12f424['where']=_[_0xc664('0x44')](_0x12f424[_0xc664('0x45')],{'$or':_[_0xc664('0x32')](_0x16b86c,function(_0x139780){if(_0x139780[_0xc664('0x36')]!==_0xc664('0x46')){var _0xe48f81={};_0xe48f81[_0x139780[_0xc664('0x30')]]={'$like':'%'+_0x507a8f[_0xc664('0x39')][_0xc664('0x43')]+'%'};return _0xe48f81;}})});}_0x12f424=_[_0xc664('0x44')]({},_0x12f424,_0x507a8f[_0xc664('0x47')]);var _0x438a23={'where':_0x12f424[_0xc664('0x45')]};return db[_0xc664('0x33')][_0xc664('0x26')](_0x438a23)['then'](function(_0x36e1a4){_0x32788c[_0xc664('0x26')]=_0x36e1a4;if(_0x507a8f[_0xc664('0x39')][_0xc664('0x48')]){_0x12f424[_0xc664('0x49')]=[{'all':!![]}];}return db['ChatGroup'][_0xc664('0x4a')](_0x12f424);})[_0xc664('0x2d')](function(_0xc597f){_0x32788c['rows']=_0xc597f;return _0x32788c;})[_0xc664('0x2d')](respondWithFilteredResult(_0x40c20b,_0x12f424))[_0xc664('0x4b')](handleError(_0x40c20b,null));};exports[_0xc664('0x4c')]=function(_0x16a919,_0xdd7e16){var _0x543ac9={'raw':!![],'where':{'id':_0x16a919[_0xc664('0x4d')]['id']}},_0x303f8f={};_0x303f8f[_0xc664('0x38')]=_[_0xc664('0x3a')](db[_0xc664('0x33')]['rawAttributes']);_0x303f8f[_0xc664('0x39')]=_[_0xc664('0x3a')](_0x16a919[_0xc664('0x39')]);_0x303f8f[_0xc664('0x3b')]=_[_0xc664('0x3c')](_0x303f8f[_0xc664('0x38')],_0x303f8f[_0xc664('0x39')]);_0x543ac9['attributes']=_[_0xc664('0x3c')](_0x303f8f['model'],qs[_0xc664('0x3d')](_0x16a919[_0xc664('0x39')][_0xc664('0x3d')]));_0x543ac9[_0xc664('0x4e')]=_0x543ac9[_0xc664('0x4e')][_0xc664('0x3e')]?_0x543ac9[_0xc664('0x4e')]:_0x303f8f[_0xc664('0x38')];if(_0x16a919['query']['includeAll']){_0x543ac9[_0xc664('0x49')]=[{'all':!![]}];}_0x543ac9=_[_0xc664('0x44')]({},_0x543ac9,_0x16a919[_0xc664('0x47')]);return db[_0xc664('0x33')][_0xc664('0x4f')](_0x543ac9)['then'](handleEntityNotFound(_0xdd7e16,null))['then'](respondWithResult(_0xdd7e16,null))[_0xc664('0x4b')](handleError(_0xdd7e16,null));};exports[_0xc664('0x50')]=function(_0x501237,_0x2bfa2e){return db[_0xc664('0x33')][_0xc664('0x50')](_0x501237[_0xc664('0x51')],{})[_0xc664('0x2d')](respondWithResult(_0x2bfa2e,0xc9))[_0xc664('0x4b')](handleError(_0x2bfa2e,null));};exports[_0xc664('0x2c')]=function(_0x4caaf6,_0x1753bf){if(_0x4caaf6['body']['id']){delete _0x4caaf6[_0xc664('0x51')]['id'];}return db[_0xc664('0x33')][_0xc664('0x4f')]({'where':{'id':_0x4caaf6[_0xc664('0x4d')]['id']}})[_0xc664('0x2d')](handleEntityNotFound(_0x1753bf,null))[_0xc664('0x2d')](saveUpdates(_0x4caaf6['body'],null))[_0xc664('0x2d')](respondWithResult(_0x1753bf,null))['catch'](handleError(_0x1753bf,null));};exports[_0xc664('0x2e')]=function(_0x1bf32d,_0x1ea7df){return db['ChatGroup']['find']({'where':{'id':_0x1bf32d[_0xc664('0x4d')]['id']}})[_0xc664('0x2d')](handleEntityNotFound(_0x1ea7df,null))[_0xc664('0x2d')](removeEntity(_0x1ea7df,null))['catch'](handleError(_0x1ea7df,null));};exports[_0xc664('0x52')]=function(_0x5c4b50,_0x3a11b5){return db[_0xc664('0x33')][_0xc664('0x52')]()[_0xc664('0x2d')](respondWithResult(_0x3a11b5,null))[_0xc664('0x4b')](handleError(_0x3a11b5,null));};exports[_0xc664('0x53')]=function(_0x1fba1b,_0x17b94d,_0xeac1b){return db[_0xc664('0x54')][_0xc664('0x26')]({'where':{'ChatGroupId':_0x1fba1b[_0xc664('0x4d')]['id'],'ToId':_0x1fba1b['user']['id'],'read':![]}})['then'](function(_0x38963f){return{'id':_[_0xc664('0x55')](_0x1fba1b[_0xc664('0x4d')]['id']),'count':_0x38963f};})['then'](respondWithResult(_0x17b94d,null))[_0xc664('0x4b')](handleError(_0x17b94d,null));};exports[_0xc664('0x56')]=function(_0x3d7677,_0x3d1dfd,_0x28b11a){return db[_0xc664('0x33')][_0xc664('0x4f')]({'where':{'id':_0x3d7677['params']['id']}})[_0xc664('0x2d')](handleEntityNotFound(_0x3d1dfd,null))['then'](function(_0x2aa12e){if(_0x2aa12e){return _0x2aa12e[_0xc664('0x56')](_0x3d7677[_0xc664('0x51')]['ids'],_[_0xc664('0x57')](_0x3d7677['body'],[_0xc664('0x58'),'id'])||{});}})['then'](respondWithResult(_0x3d1dfd,null))['catch'](handleError(_0x3d1dfd,null));};exports[_0xc664('0x59')]=function(_0x259653,_0x17f3a4,_0x9f2b62){var _0x5991ed={};var _0x4e1ca3={};var _0x5dc62c;var _0x47d07;return db[_0xc664('0x33')][_0xc664('0x5a')]({'where':{'id':_0x259653[_0xc664('0x4d')]['id']}})[_0xc664('0x2d')](handleEntityNotFound(_0x17f3a4,null))[_0xc664('0x2d')](function(_0x4a7481){if(_0x4a7481){_0x5dc62c=_0x4a7481;_0x4e1ca3[_0xc664('0x38')]=_[_0xc664('0x3a')](db['User'][_0xc664('0x34')]);_0x4e1ca3['query']=_[_0xc664('0x3a')](_0x259653['query']);_0x4e1ca3[_0xc664('0x3b')]=_[_0xc664('0x3c')](_0x4e1ca3[_0xc664('0x38')],_0x4e1ca3[_0xc664('0x39')]);_0x5991ed[_0xc664('0x4e')]=_[_0xc664('0x3c')](_0x4e1ca3[_0xc664('0x38')],qs['fields'](_0x259653['query'][_0xc664('0x3d')]));_0x5991ed['attributes']=_0x5991ed['attributes'][_0xc664('0x3e')]?_0x5991ed['attributes']:_0x4e1ca3['model'];_0x5991ed[_0xc664('0x41')]=qs['sort'](_0x259653[_0xc664('0x39')][_0xc664('0x42')]);_0x5991ed[_0xc664('0x45')]=qs[_0xc664('0x3b')](_['pick'](_0x259653[_0xc664('0x39')],_0x4e1ca3[_0xc664('0x3b')]));if(_0x259653[_0xc664('0x39')][_0xc664('0x43')]){_0x5991ed[_0xc664('0x45')]=_[_0xc664('0x44')](_0x5991ed['where'],{'$or':_[_0xc664('0x32')](_0x5991ed[_0xc664('0x4e')],function(_0x4ac3f1){var _0x568ea7={};_0x568ea7[_0x4ac3f1]={'$like':'%'+_0x259653[_0xc664('0x39')][_0xc664('0x43')]+'%'};return _0x568ea7;})});}_0x5991ed=_[_0xc664('0x44')]({},_0x5991ed,_0x259653['options']);return _0x5dc62c['getMembers'](_0x5991ed);}})[_0xc664('0x2d')](function(_0x3136ee){if(_0x3136ee){_0x47d07=_0x3136ee[_0xc664('0x3e')];if(!_0x259653[_0xc664('0x39')][_0xc664('0x3f')](_0xc664('0x40'))){_0x5991ed[_0xc664('0x25')]=qs['limit'](_0x259653[_0xc664('0x39')]['limit']);_0x5991ed[_0xc664('0x23')]=qs[_0xc664('0x23')](_0x259653[_0xc664('0x39')][_0xc664('0x23')]);}return _0x5dc62c[_0xc664('0x59')](_0x5991ed);}})['then'](function(_0x4aba10){if(_0x4aba10){return _0x4aba10?{'count':_0x47d07,'rows':_0x4aba10}:null;}})[_0xc664('0x2d')](respondWithResult(_0x17f3a4,null))['catch'](handleError(_0x17f3a4,null));};exports[_0xc664('0x5b')]=function(_0x37fd47,_0x39e313,_0x426742){return db['ChatGroup'][_0xc664('0x4f')]({'where':{'id':_0x37fd47[_0xc664('0x4d')]['id']}})[_0xc664('0x2d')](handleEntityNotFound(_0x39e313,null))[_0xc664('0x2d')](function(_0x55ca2f){if(_0x55ca2f){return _0x55ca2f[_0xc664('0x5b')](_0x37fd47['query'][_0xc664('0x58')]);}})[_0xc664('0x2d')](respondWithStatusCode(_0x39e313,null))[_0xc664('0x4b')](handleError(_0x39e313,null));};exports[_0xc664('0x5c')]=function(_0x415fb0,_0x176f3d,_0x3c16d3){if(_0x415fb0[_0xc664('0x51')]['id']){delete _0x415fb0[_0xc664('0x51')]['id'];}return db[_0xc664('0x33')][_0xc664('0x4f')]({'where':{'id':_0x415fb0['params']['id']}})[_0xc664('0x2d')](handleEntityNotFound(_0x176f3d,null))[_0xc664('0x2d')](function(_0x2ddda0){if(_0x2ddda0){_0x415fb0[_0xc664('0x51')]['ChatGroupId']=_0x2ddda0['id'];return db[_0xc664('0x54')][_0xc664('0x50')](_0x415fb0['body']);}})[_0xc664('0x2d')](respondWithResult(_0x176f3d,null))[_0xc664('0x4b')](handleError(_0x176f3d,null));};exports[_0xc664('0x5d')]=function(_0x162e05,_0x2ae08a,_0x2afa04){var _0x5c2f0d={};var _0x1fe0d0={};var _0x2a4aaf;var _0x47ff14;return db['ChatGroup']['findOne']({'where':{'id':_0x162e05[_0xc664('0x4d')]['id']}})[_0xc664('0x2d')](handleEntityNotFound(_0x2ae08a,null))['then'](function(_0x22d329){if(_0x22d329){_0x2a4aaf=_0x22d329;_0x1fe0d0[_0xc664('0x38')]=_[_0xc664('0x3a')](db[_0xc664('0x54')]['rawAttributes']);_0x1fe0d0[_0xc664('0x39')]=_[_0xc664('0x3a')](_0x162e05[_0xc664('0x39')]);_0x1fe0d0[_0xc664('0x3b')]=_[_0xc664('0x3c')](_0x1fe0d0[_0xc664('0x38')],_0x1fe0d0[_0xc664('0x39')]);_0x5c2f0d['attributes']=_[_0xc664('0x3c')](_0x1fe0d0[_0xc664('0x38')],qs[_0xc664('0x3d')](_0x162e05[_0xc664('0x39')]['fields']));_0x5c2f0d[_0xc664('0x4e')]=_0x5c2f0d[_0xc664('0x4e')][_0xc664('0x3e')]?_0x5c2f0d[_0xc664('0x4e')]:_0x1fe0d0[_0xc664('0x38')];_0x5c2f0d[_0xc664('0x41')]=qs['sort'](_0x162e05[_0xc664('0x39')][_0xc664('0x42')]);_0x5c2f0d[_0xc664('0x45')]=qs[_0xc664('0x3b')](_['pick'](_0x162e05[_0xc664('0x39')],_0x1fe0d0[_0xc664('0x3b')]));if(_0x162e05['query'][_0xc664('0x43')]){_0x5c2f0d[_0xc664('0x45')]=_[_0xc664('0x44')](_0x5c2f0d[_0xc664('0x45')],{'$or':_[_0xc664('0x32')](_0x5c2f0d[_0xc664('0x4e')],function(_0xc9492c){var _0x2c960e={};_0x2c960e[_0xc9492c]={'$like':'%'+_0x162e05[_0xc664('0x39')]['filter']+'%'};return _0x2c960e;})});}if(_0x162e05[_0xc664('0x39')][_0xc664('0x5e')]){var _0x1fdb66=_0x162e05[_0xc664('0x39')][_0xc664('0x5e')][_0xc664('0x5f')](',');var _0x321d43={};_0x321d43[_0x1fdb66[0x0]]={'$gte':moment(_0x1fdb66[0x1])['format'](_0xc664('0x60'))};_0x5c2f0d[_0xc664('0x45')]=_[_0xc664('0x44')](_0x5c2f0d['where'],_0x321d43);}_0x5c2f0d=_[_0xc664('0x44')]({},_0x5c2f0d,_0x162e05[_0xc664('0x47')]);return _0x2a4aaf[_0xc664('0x5d')](_0x5c2f0d);}})[_0xc664('0x2d')](function(_0xdc7735){if(_0xdc7735){_0x47ff14=_0xdc7735[_0xc664('0x3e')];if(!_0x162e05['query']['hasOwnProperty']('nolimit')){_0x5c2f0d[_0xc664('0x25')]=qs[_0xc664('0x25')](_0x162e05[_0xc664('0x39')][_0xc664('0x25')]);_0x5c2f0d[_0xc664('0x23')]=qs[_0xc664('0x23')](_0x162e05['query'][_0xc664('0x23')]);}return _0x2a4aaf['getMessages'](_0x5c2f0d);}})[_0xc664('0x2d')](function(_0x1194bb){if(_0x1194bb){return _0x1194bb?{'count':_0x47ff14,'rows':_0x1194bb}:null;}})[_0xc664('0x2d')](respondWithResult(_0x2ae08a,null))[_0xc664('0x4b')](handleError(_0x2ae08a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ba76f86..b91abb2 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 _0x6d4b=['hook','exports','events','../../mysqldb','ChatGroup','save','update','emit','hasOwnProperty'];(function(_0x676452,_0x515240){var _0x2a8187=function(_0x512142){while(--_0x512142){_0x676452['push'](_0x676452['shift']());}};_0x2a8187(++_0x515240);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x5f25d6,_0x356a88){_0x5f25d6=_0x5f25d6-0x0;var _0x26f9b0=_0x6d4b[_0x5f25d6];return _0x26f9b0;};'use strict';var EventEmitter=require(_0xb6d4('0x0'));var ChatGroup=require(_0xb6d4('0x1'))['db'][_0xb6d4('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6d4('0x3'),'afterUpdate':_0xb6d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d5332){return function(_0xe3f0b3,_0x13bcce,_0x2710b2){ChatGroupEvents[_0xb6d4('0x5')](_0x4d5332+':'+_0xe3f0b3['id'],_0xe3f0b3);ChatGroupEvents[_0xb6d4('0x5')](_0x4d5332,_0xe3f0b3);_0x2710b2(null);};}for(var e in events){if(events[_0xb6d4('0x6')](e)){var event=events[e];ChatGroup[_0xb6d4('0x7')](e,emitEvent(event));}}module[_0xb6d4('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x631c=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x563e09,_0x1741e4){var _0x116a37=function(_0x368122){while(--_0x368122){_0x563e09['push'](_0x563e09['shift']());}};_0x116a37(++_0x1741e4);}(_0x631c,0x1b6));var _0xc631=function(_0x2d5d61,_0x41b810){_0x2d5d61=_0x2d5d61-0x0;var _0x425531=_0x631c[_0x2d5d61];return _0x425531;};'use strict';var EventEmitter=require(_0xc631('0x0'));var ChatGroup=require(_0xc631('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc631('0x2')](0x0);var events={'afterCreate':_0xc631('0x3'),'afterUpdate':'update','afterDestroy':_0xc631('0x4')};function emitEvent(_0x854d5b){return function(_0x128401,_0x4e8b9f,_0x17dc11){ChatGroupEvents[_0xc631('0x5')](_0x854d5b+':'+_0x128401['id'],_0x128401);ChatGroupEvents['emit'](_0x854d5b,_0x128401);_0x17dc11(null);};}for(var e in events){if(events[_0xc631('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xc631('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0de9211..3450a70 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 _0x1e18=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash'];(function(_0x9543d2,_0x29960d){var _0x4077cf=function(_0x1385a7){while(--_0x1385a7){_0x9543d2['push'](_0x9543d2['shift']());}};_0x4077cf(++_0x29960d);}(_0x1e18,0x6f));var _0x81e1=function(_0x535780,_0x5d5d47){_0x535780=_0x535780-0x0;var _0x1a03fb=_0x1e18[_0x535780];return _0x1a03fb;};'use strict';var _=require(_0x81e1('0x0'));var util=require(_0x81e1('0x1'));var logger=require(_0x81e1('0x2'))(_0x81e1('0x3'));var moment=require(_0x81e1('0x4'));var BPromise=require(_0x81e1('0x5'));var rp=require(_0x81e1('0x6'));var fs=require('fs');var path=require(_0x81e1('0x7'));var rimraf=require(_0x81e1('0x8'));var config=require(_0x81e1('0x9'));var attributes=require(_0x81e1('0xa'));module[_0x81e1('0xb')]=function(_0x10db91,_0x2b638b){return _0x10db91['define'](_0x81e1('0xc'),attributes,{'tableName':_0x81e1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf8c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0xbf8c,0x138));var _0xcbf8=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xbf8c[_0x9729d7];return _0x3c4ac6;};'use strict';var _=require(_0xcbf8('0x0'));var util=require(_0xcbf8('0x1'));var logger=require(_0xcbf8('0x2'))(_0xcbf8('0x3'));var moment=require(_0xcbf8('0x4'));var BPromise=require(_0xcbf8('0x5'));var rp=require(_0xcbf8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbf8('0x7'));var attributes=require(_0xcbf8('0x8'));module[_0xcbf8('0x9')]=function(_0x11bf73,_0x28ea3e){return _0x11bf73[_0xcbf8('0xa')](_0xcbf8('0xb'),attributes,{'tableName':_0xcbf8('0xc'),'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 fc345a2..c9b1f8d 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 _0xbe52=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xbe52,0x164));var _0x2be5=function(_0x21474c,_0xc87d10){_0x21474c=_0x21474c-0x0;var _0x2ef0b3=_0xbe52[_0x21474c];return _0x2ef0b3;};'use strict';var _=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var moment=require(_0x2be5('0x2'));var BPromise=require(_0x2be5('0x3'));var rs=require(_0x2be5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2be5('0x5'))['db'];var utils=require(_0x2be5('0x6'));var logger=require(_0x2be5('0x7'))(_0x2be5('0x8'));var config=require(_0x2be5('0x9'));var jayson=require(_0x2be5('0xa'));var client=jayson[_0x2be5('0xb')][_0x2be5('0xc')]({'port':0x232a});config[_0x2be5('0xd')]=_[_0x2be5('0xe')](config[_0x2be5('0xd')],{'host':_0x2be5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2be5('0xd')]));require(_0x2be5('0x10'))[_0x2be5('0x11')](socket);function respondWithRpcPromise(_0x4ae600,_0x3f2b8f,_0x51515f){return new BPromise(function(_0x4c71ad,_0x3d4219){return client[_0x2be5('0x12')](_0x4ae600,_0x51515f)[_0x2be5('0x13')](function(_0xcb0182){logger['info'](_0x2be5('0x14'),_0x3f2b8f,_0x2be5('0x15'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3f2b8f,_0x2be5('0x15'),JSON[_0x2be5('0x16')](_0xcb0182));if(_0xcb0182['error']){if(_0xcb0182[_0x2be5('0x17')][_0x2be5('0x18')]===0x1f4){logger[_0x2be5('0x17')](_0x2be5('0x14'),_0x3f2b8f,_0xcb0182[_0x2be5('0x17')][_0x2be5('0x19')]);return _0x3d4219(_0xcb0182['error']['message']);}logger[_0x2be5('0x17')]('ChatGroup,\x20%s,\x20%s',_0x3f2b8f,_0xcb0182[_0x2be5('0x17')]['message']);return _0x4c71ad(_0xcb0182[_0x2be5('0x17')][_0x2be5('0x19')]);}else{logger[_0x2be5('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x3f2b8f,_0x2be5('0x15'));_0x4c71ad(_0xcb0182[_0x2be5('0x1b')]['message']);}})[_0x2be5('0x1c')](function(_0x434f30){logger[_0x2be5('0x17')](_0x2be5('0x14'),_0x3f2b8f,_0x434f30);_0x3d4219(_0x434f30);});});} \ No newline at end of file +var _0xd51f=['error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5bb855,_0x5279be){var _0x238828=function(_0x4f74c9){while(--_0x4f74c9){_0x5bb855['push'](_0x5bb855['shift']());}};_0x238828(++_0x5279be);}(_0xd51f,0xf0));var _0xfd51=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd51f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var moment=require('moment');var BPromise=require(_0xfd51('0x2'));var rs=require(_0xfd51('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd51('0x4'))['db'];var utils=require(_0xfd51('0x5'));var logger=require('../../config/logger')(_0xfd51('0x6'));var config=require(_0xfd51('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfd51('0x8')][_0xfd51('0x9')]({'port':0x232a});config['redis']=_[_0xfd51('0xa')](config[_0xfd51('0xb')],{'host':_0xfd51('0xc'),'port':0x18eb});var socket=require(_0xfd51('0xd'))(new Redis(config[_0xfd51('0xb')]));require('./chatGroup.socket')[_0xfd51('0xe')](socket);function respondWithRpcPromise(_0x444385,_0x2878c6,_0x5cc2a8){return new BPromise(function(_0x19d70e,_0x5a6fcc){return client['request'](_0x444385,_0x5cc2a8)[_0xfd51('0xf')](function(_0xfc313b){logger[_0xfd51('0x10')]('ChatGroup,\x20%s,\x20%s',_0x2878c6,'request\x20sent');logger['debug'](_0xfd51('0x11'),_0x2878c6,_0xfd51('0x12'),JSON[_0xfd51('0x13')](_0xfc313b));if(_0xfc313b[_0xfd51('0x14')]){if(_0xfc313b[_0xfd51('0x14')][_0xfd51('0x15')]===0x1f4){logger[_0xfd51('0x14')]('ChatGroup,\x20%s,\x20%s',_0x2878c6,_0xfc313b[_0xfd51('0x14')][_0xfd51('0x16')]);return _0x5a6fcc(_0xfc313b[_0xfd51('0x14')][_0xfd51('0x16')]);}logger[_0xfd51('0x14')](_0xfd51('0x17'),_0x2878c6,_0xfc313b[_0xfd51('0x14')][_0xfd51('0x16')]);return _0x19d70e(_0xfc313b['error'][_0xfd51('0x16')]);}else{logger['info'](_0xfd51('0x17'),_0x2878c6,_0xfd51('0x12'));_0x19d70e(_0xfc313b[_0xfd51('0x18')][_0xfd51('0x16')]);}})[_0xfd51('0x19')](function(_0x22b2d0){logger[_0xfd51('0x14')](_0xfd51('0x17'),_0x2878c6,_0x22b2d0);_0x5a6fcc(_0x22b2d0);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b2efa74..877ed08 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 _0xb171=['save','update','register','length','./chatGroup.events'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb171,0x103));var _0x1b17=function(_0x10d9fe,_0x287730){_0x10d9fe=_0x10d9fe-0x0;var _0x53bf9d=_0xb171[_0x10d9fe];return _0x53bf9d;};'use strict';var ChatGroupEvents=require(_0x1b17('0x0'));var events=[_0x1b17('0x1'),'remove',_0x1b17('0x2')];function createListener(_0x51b10e,_0x539943){return function(_0x573ab2){_0x539943['emit'](_0x51b10e,_0x573ab2);};}function removeListener(_0x550717,_0x350512){return function(){ChatGroupEvents['removeListener'](_0x550717,_0x350512);};}exports[_0x1b17('0x3')]=function(_0x39bdaa){for(var _0x5072b4=0x0,_0x30de89=events[_0x1b17('0x4')];_0x5072b4<_0x30de89;_0x5072b4++){var _0x12d193=events[_0x5072b4];var _0x581adb=createListener('chatGroup:'+_0x12d193,_0x39bdaa);ChatGroupEvents['on'](_0x12d193,_0x581adb);}}; \ No newline at end of file +var _0xc9bc=['save','emit','removeListener','length'];(function(_0x1b8a6c,_0x4c2a5f){var _0x13ec3b=function(_0x53e579){while(--_0x53e579){_0x1b8a6c['push'](_0x1b8a6c['shift']());}};_0x13ec3b(++_0x4c2a5f);}(_0xc9bc,0xe4));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xcc9b('0x0'),'remove','update'];function createListener(_0x49ab71,_0x1f4bba){return function(_0x4f1149){_0x1f4bba[_0xcc9b('0x1')](_0x49ab71,_0x4f1149);};}function removeListener(_0x1ef706,_0x8a649c){return function(){ChatGroupEvents[_0xcc9b('0x2')](_0x1ef706,_0x8a649c);};}exports['register']=function(_0x2094e3){for(var _0x27cb0a=0x0,_0x28d4cd=events[_0xcc9b('0x3')];_0x27cb0a<_0x28d4cd;_0x27cb0a++){var _0x38242f=events[_0x27cb0a];var _0x5669f2=createListener('chatGroup:'+_0x38242f,_0x2094e3);ChatGroupEvents['on'](_0x38242f,_0x5669f2);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 56fea86..383f41f 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 _0x21c5=['getMessages','post','create','addMembers','put','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0xb17f5d,_0x21f32d){var _0x2a361e=function(_0x2af8b1){while(--_0x2af8b1){_0xb17f5d['push'](_0xb17f5d['shift']());}};_0x2a361e(++_0x21f32d);}(_0x21c5,0x6c));var _0x521c=function(_0x3b508c,_0x5a220f){_0x3b508c=_0x3b508c-0x0;var _0x4f5267=_0x21c5[_0x3b508c];return _0x4f5267;};'use strict';var multer=require(_0x521c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x521c('0x1'));var express=require('express');var router=express[_0x521c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x521c('0x3'));var config=require(_0x521c('0x4'));var controller=require(_0x521c('0x5'));router[_0x521c('0x6')]('/',auth[_0x521c('0x7')](),controller['index']);router['get'](_0x521c('0x8'),auth[_0x521c('0x7')](),controller[_0x521c('0x9')]);router[_0x521c('0x6')](_0x521c('0xa'),auth[_0x521c('0x7')](),controller[_0x521c('0xb')]);router[_0x521c('0x6')](_0x521c('0xc'),auth[_0x521c('0x7')](),controller[_0x521c('0xd')]);router[_0x521c('0x6')](_0x521c('0xe'),auth[_0x521c('0x7')](),controller[_0x521c('0xf')]);router[_0x521c('0x6')](_0x521c('0x10'),auth[_0x521c('0x7')](),controller[_0x521c('0x11')]);router[_0x521c('0x12')]('/',auth[_0x521c('0x7')](),controller[_0x521c('0x13')]);router[_0x521c('0x12')](_0x521c('0xe'),auth['isAuthenticated'](),controller[_0x521c('0x14')]);router['post']('/:id/messages',auth[_0x521c('0x7')](),controller['addMessage']);router[_0x521c('0x15')](_0x521c('0xa'),auth[_0x521c('0x7')](),controller['update']);router[_0x521c('0x16')](_0x521c('0xa'),auth[_0x521c('0x7')](),controller[_0x521c('0x17')]);router[_0x521c('0x16')](_0x521c('0xe'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x521c('0x18')]=router; \ No newline at end of file +var _0x6629=['create','/:id/members','addMembers','addMessage','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','/:id','get','getUnread','getMembers','/:id/messages','getMessages','post'];(function(_0x5af6f0,_0x5a031b){var _0x5e1016=function(_0x413d55){while(--_0x413d55){_0x5af6f0['push'](_0x5af6f0['shift']());}};_0x5e1016(++_0x5a031b);}(_0x6629,0x13c));var _0x9662=function(_0xd4963d,_0x78bf48){_0xd4963d=_0xd4963d-0x0;var _0x3246b0=_0x6629[_0xd4963d];return _0x3246b0;};'use strict';var multer=require(_0x9662('0x0'));var util=require(_0x9662('0x1'));var path=require('path');var timeout=require(_0x9662('0x2'));var express=require('express');var router=express[_0x9662('0x3')]();var fs_extra=require(_0x9662('0x4'));var auth=require(_0x9662('0x5'));var interaction=require(_0x9662('0x6'));var config=require(_0x9662('0x7'));var controller=require(_0x9662('0x8'));router['get']('/',auth[_0x9662('0x9')](),controller[_0x9662('0xa')]);router['get'](_0x9662('0xb'),auth[_0x9662('0x9')](),controller[_0x9662('0xc')]);router['get'](_0x9662('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9662('0xe')]('/:id/unread',auth['isAuthenticated'](),controller[_0x9662('0xf')]);router[_0x9662('0xe')]('/:id/members',auth[_0x9662('0x9')](),controller[_0x9662('0x10')]);router['get'](_0x9662('0x11'),auth['isAuthenticated'](),controller[_0x9662('0x12')]);router[_0x9662('0x13')]('/',auth[_0x9662('0x9')](),controller[_0x9662('0x14')]);router[_0x9662('0x13')](_0x9662('0x15'),auth['isAuthenticated'](),controller[_0x9662('0x16')]);router[_0x9662('0x13')](_0x9662('0x11'),auth['isAuthenticated'](),controller[_0x9662('0x17')]);router[_0x9662('0x18')](_0x9662('0xd'),auth[_0x9662('0x9')](),controller['update']);router[_0x9662('0x19')](_0x9662('0xd'),auth['isAuthenticated'](),controller[_0x9662('0x1a')]);router[_0x9662('0x19')](_0x9662('0x15'),auth[_0x9662('0x9')](),controller['removeMembers']);module[_0x9662('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 46e2182..f16eef6 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 _0xe15d=['star','thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM'];(function(_0x200ae0,_0x42c9dc){var _0x4298a4=function(_0x1a78b9){while(--_0x1a78b9){_0x200ae0['push'](_0x200ae0['shift']());}};_0x4298a4(++_0x42c9dc);}(_0xe15d,0x80));var _0xde15=function(_0x374c6b,_0x46a383){_0x374c6b=_0x374c6b-0x0;var _0x425334=_0xe15d[_0x374c6b];return _0x425334;};'use strict';var Sequelize=require(_0xde15('0x0'));module['exports']={'closed':{'type':Sequelize[_0xde15('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xde15('0x2')]},'ratingType':{'type':Sequelize[_0xde15('0x3')](_0xde15('0x4'),_0xde15('0x5')),'defaultValue':_0xde15('0x4')},'ratingMessage':{'type':Sequelize[_0xde15('0x6')]},'pathTranscript':{'type':Sequelize[_0xde15('0x6')]},'mailTranscript':{'type':Sequelize[_0xde15('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xde15('0x8')]},'disposition':{'type':Sequelize[_0xde15('0x7')]},'secondDisposition':{'type':Sequelize[_0xde15('0x7')]},'thirdDisposition':{'type':Sequelize[_0xde15('0x7')]},'note':{'type':Sequelize[_0xde15('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xde15('0x7')]},'osName':{'type':Sequelize[_0xde15('0x7')]},'osVersion':{'type':Sequelize[_0xde15('0x7')]},'deviceModel':{'type':Sequelize[_0xde15('0x7')]},'deviceVendor':{'type':Sequelize[_0xde15('0x7')]},'deviceType':{'type':Sequelize[_0xde15('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xde15('0x7')]},'formData':{'type':Sequelize['TEXT'](_0xde15('0x9'))},'read1stAt':{'type':Sequelize[_0xde15('0x8')]},'lastMsgAt':{'type':Sequelize[_0xde15('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xde15('0x3')]('in',_0xde15('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xde15('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xde15('0x2')]}}; \ No newline at end of file +var _0x375a=['star','STRING','TEXT','long','DATE','out','sequelize','BOOLEAN','INTEGER','ENUM','thumb'];(function(_0x56b1aa,_0x526389){var _0x9489ab=function(_0x896e5c){while(--_0x896e5c){_0x56b1aa['push'](_0x56b1aa['shift']());}};_0x9489ab(++_0x526389);}(_0x375a,0x95));var _0xa375=function(_0x4d833b,_0x282fc3){_0x4d833b=_0x4d833b-0x0;var _0x207499=_0x375a[_0x4d833b];return _0x207499;};'use strict';var Sequelize=require(_0xa375('0x0'));module['exports']={'closed':{'type':Sequelize[_0xa375('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa375('0x2')]},'ratingType':{'type':Sequelize[_0xa375('0x3')]('star',_0xa375('0x4')),'defaultValue':_0xa375('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa375('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa375('0x6')]},'thirdDisposition':{'type':Sequelize[_0xa375('0x6')]},'note':{'type':Sequelize[_0xa375('0x6')]},'browserName':{'type':Sequelize[_0xa375('0x6')]},'browserVersion':{'type':Sequelize[_0xa375('0x6')]},'osName':{'type':Sequelize[_0xa375('0x6')]},'osVersion':{'type':Sequelize[_0xa375('0x6')]},'deviceModel':{'type':Sequelize[_0xa375('0x6')]},'deviceVendor':{'type':Sequelize[_0xa375('0x6')]},'deviceType':{'type':Sequelize[_0xa375('0x6')]},'referer':{'type':Sequelize[_0xa375('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa375('0x7')](_0xa375('0x8'))},'read1stAt':{'type':Sequelize[_0xa375('0x9')]},'lastMsgAt':{'type':Sequelize[_0xa375('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xa375('0x3')]('in',_0xa375('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa375('0x6')]},'customerPort':{'type':Sequelize[_0xa375('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xa375('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xa375('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xa375('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f4816df..35f26ce 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 _0x0c7f=['originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','Messages','agentAlias','System','Visitor','ContactId','agentIdentifier','UserId','%s%d','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','order','sort','where','filter','merge','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','pick','addTags','setTags','spread','Tag','color','emit','removeTags','toString','server','files','attachments','push','firstName','lastName','createdAt','direction','read','get','mkdirSync','Chat','Account','Owner','N.A.','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','value','renderFile','views','.pdf','createPdfFromHTML','unlinkSync','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','update','stack','name','send','body','contact','agent','interaction','account','index','map','rawAttributes','type','getOptions','query','user','show','params','model','keys','ChatInteraction','intersection','fields','attributes','length','includeAll','include','find','create','destroy','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','fullname','email','POST','isNull','vidaooNote','parse','metadata','Sequelize','ValidationError','out','ChatMessage','CmContact','Contact','abandon','entity\x20not\x20found','closed','disposition','attachmentUpload','file'];(function(_0x3a544a,_0x73a217){var _0x342f1e=function(_0x519dce){while(--_0x519dce){_0x3a544a['push'](_0x3a544a['shift']());}};_0x342f1e(++_0x73a217);}(_0x0c7f,0x1d7));var _0xf0c7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0c7f[_0x501510];return _0x1e6ee5;};'use strict';var rimraf=require(_0xf0c7('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require(_0xf0c7('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf0c7('0x2'));var path=require(_0xf0c7('0x3'));var ejs=require(_0xf0c7('0x4'));var fs=require('fs');var _=require(_0xf0c7('0x5'));var Redis=require(_0xf0c7('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xf0c7('0x7'));var logger=require(_0xf0c7('0x8'))('api');var config=require(_0xf0c7('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xf0c7('0xa')],{'host':_0xf0c7('0xb'),'port':0x18eb});var socket=require(_0xf0c7('0xc'))(new Redis(config[_0xf0c7('0xa')]));require(_0xf0c7('0xd'))[_0xf0c7('0xe')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf0c7('0xf')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xde3408,_0x9c66d2,_0x56d84c,_0xc19179){return new BPromise(function(_0x386bbe,_0x3ad92b){var _0x44a58e=_0xc19179||client;return _0x44a58e['request'](_0xde3408,_0x56d84c)[_0xf0c7('0x10')](function(_0x5522cd){logger[_0xf0c7('0x11')](_0xf0c7('0x12'),_0x9c66d2,_0xf0c7('0x13'));logger['debug'](_0xf0c7('0x14'),_0x9c66d2,_0xf0c7('0x13'),JSON[_0xf0c7('0x15')](_0x5522cd));if(_0x5522cd[_0xf0c7('0x16')]){if(_0x5522cd[_0xf0c7('0x16')]['code']===0x1f4){logger['error'](_0xf0c7('0x12'),_0x9c66d2,_0x5522cd[_0xf0c7('0x16')]['message']);return _0x3ad92b(_0x5522cd['error'][_0xf0c7('0x17')]);}logger[_0xf0c7('0x16')](_0xf0c7('0x12'),_0x9c66d2,_0x5522cd['error'][_0xf0c7('0x17')]);return _0x386bbe(_0x5522cd[_0xf0c7('0x16')][_0xf0c7('0x17')]);}else{logger[_0xf0c7('0x11')](_0xf0c7('0x12'),_0x9c66d2,_0xf0c7('0x13'));_0x386bbe(_0x5522cd[_0xf0c7('0x18')][_0xf0c7('0x17')]);}})[_0xf0c7('0x19')](function(_0x57312b){logger[_0xf0c7('0x16')](_0xf0c7('0x12'),_0x9c66d2,_0x57312b);_0x3ad92b(_0x57312b);});});}function respondWithStatusCode(_0x515828,_0x3050ba){_0x3050ba=_0x3050ba||0xcc;return function(_0x45eb0b){if(_0x45eb0b){return _0x515828[_0xf0c7('0x1a')](_0x3050ba);}return _0x515828[_0xf0c7('0x1b')](_0x3050ba)[_0xf0c7('0x1c')]();};}function respondWithResult(_0x19926c,_0x320825){_0x320825=_0x320825||0xc8;return function(_0x5232a8){if(_0x5232a8){return _0x19926c[_0xf0c7('0x1b')](_0x320825)['json'](_0x5232a8);}};}function respondWithFilteredResult(_0x1bce8d,_0x413ed0){return function(_0x20e558){if(_0x20e558){var _0x596888=typeof _0x413ed0[_0xf0c7('0x1d')]===_0xf0c7('0x1e')&&typeof _0x413ed0['limit']===_0xf0c7('0x1e');var _0xbbdfe2=_0x20e558['count'];var _0x20ca87=_0x596888?0x0:_0x413ed0[_0xf0c7('0x1d')];var _0x24cd35=_0x596888?_0x20e558[_0xf0c7('0x1f')]:_0x413ed0[_0xf0c7('0x1d')]+_0x413ed0[_0xf0c7('0x20')];var _0x356493;if(_0x24cd35>=_0xbbdfe2){_0x24cd35=_0xbbdfe2;_0x356493=0xc8;}else{_0x356493=0xce;}_0x1bce8d[_0xf0c7('0x1b')](_0x356493);return _0x1bce8d['set'](_0xf0c7('0x21'),_0x20ca87+'-'+_0x24cd35+'/'+_0xbbdfe2)['json'](_0x20e558);}return null;};}function saveUpdates(_0x101c4a){return function(_0xd21430){if(_0xd21430){return _0xd21430[_0xf0c7('0x22')](_0x101c4a)[_0xf0c7('0x10')](function(_0x1f6817){return _0x1f6817;});}return null;};}function removeEntity(_0x39702e){return function(_0x2f6a47){if(_0x2f6a47){return _0x2f6a47['destroy']()[_0xf0c7('0x10')](function(){_0x39702e[_0xf0c7('0x1b')](0xcc)[_0xf0c7('0x1c')]();});}};}function handleEntityNotFound(_0x2016cc){return function(_0x413b51){if(!_0x413b51){_0x2016cc[_0xf0c7('0x1a')](0x194);}return _0x413b51;};}function handleError(_0x43d9e5,_0x9ddc45){_0x9ddc45=_0x9ddc45||0x1f4;return function(_0x2686c8){logger[_0xf0c7('0x16')](_0x2686c8[_0xf0c7('0x23')]);if(_0x2686c8[_0xf0c7('0x24')]){delete _0x2686c8[_0xf0c7('0x24')];}_0x43d9e5[_0xf0c7('0x1b')](_0x9ddc45)[_0xf0c7('0x25')](_0x2686c8);};}function getMustacheRender(_0x50f3ad,_0x37ff5c){return Mustache['render'](_0x50f3ad,_['merge'](_0x37ff5c[_0xf0c7('0x26')],{'contact':_0x37ff5c[_0xf0c7('0x27')],'message':_0x37ff5c[_0xf0c7('0x17')],'agent':_0x37ff5c[_0xf0c7('0x28')],'interaction':_0x37ff5c[_0xf0c7('0x29')],'account':_0x37ff5c[_0xf0c7('0x2a')]}))||'';}exports[_0xf0c7('0x2b')]=function(_0x537694,_0x50e9dc){var _0x10cad4={};var _0x51169a=_[_0xf0c7('0x2c')](db['ChatInteraction'][_0xf0c7('0x2d')],function(_0x4884c8){return{'name':_0x4884c8['fieldName'],'type':_0x4884c8[_0xf0c7('0x2e')]['key']};});_0x10cad4=qs[_0xf0c7('0x2f')](_0x51169a,_0x537694);return interaction['findAll']('chat',_0x537694[_0xf0c7('0x30')],_0x537694[_0xf0c7('0x31')],_0x10cad4,_0x51169a)['then'](respondWithFilteredResult(_0x50e9dc,_0x10cad4))[_0xf0c7('0x19')](handleError(_0x50e9dc,null));};exports[_0xf0c7('0x32')]=function(_0x450717,_0x4062b2){var _0x3a828f={'raw':![],'where':{'id':_0x450717[_0xf0c7('0x33')]['id']}},_0x4f2628={};_0x4f2628[_0xf0c7('0x34')]=_[_0xf0c7('0x35')](db[_0xf0c7('0x36')][_0xf0c7('0x2d')]);_0x4f2628[_0xf0c7('0x30')]=_[_0xf0c7('0x35')](_0x450717['query']);_0x4f2628['filters']=_[_0xf0c7('0x37')](_0x4f2628[_0xf0c7('0x34')],_0x4f2628[_0xf0c7('0x30')]);_0x3a828f['attributes']=_['intersection'](_0x4f2628[_0xf0c7('0x34')],qs[_0xf0c7('0x38')](_0x450717[_0xf0c7('0x30')]['fields']));_0x3a828f[_0xf0c7('0x39')]=_0x3a828f['attributes'][_0xf0c7('0x3a')]?_0x3a828f[_0xf0c7('0x39')]:_0x4f2628[_0xf0c7('0x34')];if(_0x450717[_0xf0c7('0x30')][_0xf0c7('0x3b')]){_0x3a828f[_0xf0c7('0x3c')]=[{'all':!![]}];}_0x3a828f=_['merge']({},_0x3a828f,_0x450717['options']);return db['ChatInteraction'][_0xf0c7('0x3d')](_0x3a828f)['then'](handleEntityNotFound(_0x4062b2,null))[_0xf0c7('0x10')](respondWithResult(_0x4062b2,null))[_0xf0c7('0x19')](handleError(_0x4062b2,null));};exports[_0xf0c7('0x3e')]=function(_0x407f67,_0x408533){return db[_0xf0c7('0x36')][_0xf0c7('0x3e')](_0x407f67['body'],{})[_0xf0c7('0x10')](respondWithResult(_0x408533,0xc9))[_0xf0c7('0x19')](handleError(_0x408533,null));};exports[_0xf0c7('0x22')]=function(_0x37c83d,_0x5bfc77){if(_0x37c83d[_0xf0c7('0x26')]['id']){delete _0x37c83d[_0xf0c7('0x26')]['id'];}return db[_0xf0c7('0x36')][_0xf0c7('0x3d')]({'where':{'id':_0x37c83d[_0xf0c7('0x33')]['id']}})[_0xf0c7('0x10')](handleEntityNotFound(_0x5bfc77,null))['then'](saveUpdates(_0x37c83d[_0xf0c7('0x26')],null))[_0xf0c7('0x10')](respondWithResult(_0x5bfc77,null))[_0xf0c7('0x19')](handleError(_0x5bfc77,null));};exports[_0xf0c7('0x3f')]=function(_0x3bd56,_0x5cb478){return db[_0xf0c7('0x36')][_0xf0c7('0x3d')]({'where':{'id':_0x3bd56[_0xf0c7('0x33')]['id']}})[_0xf0c7('0x10')](handleEntityNotFound(_0x5cb478,null))[_0xf0c7('0x10')](removeEntity(_0x5cb478,null))['catch'](handleError(_0x5cb478,null));};exports['describe']=function(_0x165ba5,_0xd4a39d){return db[_0xf0c7('0x36')]['describe']()['then'](respondWithResult(_0xd4a39d,null))['catch'](handleError(_0xd4a39d,null));};exports['createVidaooSession']=function(_0x4ba44b,_0x14f4bd){var _0x43f8f8=_0x4ba44b[_0xf0c7('0x33')]['id'];var _0x41b4fd;var _0x5adec7;var _0x5b9fe2;return db['ChatInteraction'][_0xf0c7('0x40')]({'where':{'id':_0x43f8f8}})[_0xf0c7('0x10')](function(_0x53858d){_0x41b4fd=_0x53858d;return db[_0xf0c7('0x41')][_0xf0c7('0x40')]({'where':{'id':_0x53858d[_0xf0c7('0x42')]},'attributes':['id',_0xf0c7('0x43'),'vidaooEscalation',_0xf0c7('0x44'),'vidaooNote',_0xf0c7('0x45')],'raw':!![]});})['then'](function(_0xecff54){if(_0xecff54&&_0xecff54['vidaooApiKey']&&_0xecff54[_0xf0c7('0x46')]){_0x5adec7=_0xecff54;var _0x4592f2={'interaction':{'id':_0x43f8f8},'agent':{'id':_0x4ba44b[_0xf0c7('0x31')]['id'],'name':_0x4ba44b[_0xf0c7('0x31')][_0xf0c7('0x24')],'fullname':_0x4ba44b['user'][_0xf0c7('0x47')],'email':_0x4ba44b[_0xf0c7('0x31')][_0xf0c7('0x48')]},'contact':_0x4ba44b[_0xf0c7('0x26')][_0xf0c7('0x27')],'account':_0x4ba44b[_0xf0c7('0x26')][_0xf0c7('0x2a')]};var _0x36fa5c={'rejectUnauthorized':![],'method':_0xf0c7('0x49'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0xecff54[_0xf0c7('0x43')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4ba44b[_0xf0c7('0x31')][_0xf0c7('0x48')]],'buttons':null,'topic':_0x5adec7[_0xf0c7('0x44')],'note':_[_0xf0c7('0x4a')](_0x5adec7[_0xf0c7('0x4b')])?null:getMustacheRender(_0x5adec7[_0xf0c7('0x4b')],_0x4592f2),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xf0c7('0x4a')](_0x5adec7[_0xf0c7('0x45')])){var _0xed7017=getMustacheRender(_0x5adec7[_0xf0c7('0x45')],_0x4592f2);var _0x4a8ba9=JSON[_0xf0c7('0x4c')](_0xed7017);_0x36fa5c['body'][_0xf0c7('0x4d')]=_0x4a8ba9;}}catch(_0x575100){throw new db[(_0xf0c7('0x4e'))][(_0xf0c7('0x4f'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x36fa5c);}else{throw new db[(_0xf0c7('0x4e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0xf0c7('0x10')](function(_0x1e5103){_0x5b9fe2=_0x1e5103;if(_0x5b9fe2['id']){var _0x4e5f2e={'body':_0x5b9fe2['join_url'],'ChatWebsiteId':_0x5adec7['id'],'ChatInteractionId':_0x41b4fd['id'],'direction':_0xf0c7('0x50'),'UserId':_0x4ba44b[_0xf0c7('0x31')]['id']};return db[_0xf0c7('0x51')][_0xf0c7('0x3e')](_0x4e5f2e,{});}else{throw new db[(_0xf0c7('0x4e'))][(_0xf0c7('0x4f'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xf0c7('0x10')](function(){return _0x41b4fd['updateAttributes']({'vidaooSessionId':_0x5b9fe2['id']});})['then'](respondWithResult(_0x14f4bd,null))[_0xf0c7('0x19')](handleError(_0x14f4bd,null));};exports['customUpdate']=function(_0x4202a9,_0x535556){if(_0x4202a9[_0xf0c7('0x26')]['id']){delete _0x4202a9[_0xf0c7('0x26')]['id'];}return db[_0xf0c7('0x36')]['find']({'where':{'id':_0x4202a9[_0xf0c7('0x33')]['id']},'include':[{'model':db[_0xf0c7('0x52')],'as':_0xf0c7('0x53')}]})[_0xf0c7('0x10')](handleEntityNotFound(_0x535556,null))[_0xf0c7('0x10')](saveUpdates(_0x4202a9[_0xf0c7('0x26')],null))[_0xf0c7('0x10')](respondWithResult(_0x535556,null))[_0xf0c7('0x19')](handleError(_0x535556,null));};exports[_0xf0c7('0x54')]=function(_0x315d84,_0x21cf34){if(_0x315d84[_0xf0c7('0x26')]['id']){delete _0x315d84[_0xf0c7('0x26')]['id'];}return db[_0xf0c7('0x36')][_0xf0c7('0x3d')]({'where':{'id':_0x315d84[_0xf0c7('0x33')]['id']}})['then'](function(_0x6902e0){if(!_0x6902e0){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf0c7('0x54'),0x194,_0xf0c7('0x55'));_0x21cf34[_0xf0c7('0x1a')](0x194);}else{if(_0x6902e0['UserId']){throw new db[(_0xf0c7('0x4e'))][(_0xf0c7('0x4f'))]('Interaction\x20already\x20assigned');}}return _0x6902e0;})['then'](function(_0x48f39c){if(_0x48f39c){return _0x48f39c[_0xf0c7('0x22')]({'closed':_0x315d84[_0xf0c7('0x26')][_0xf0c7('0x56')],'disposition':_0x315d84[_0xf0c7('0x26')][_0xf0c7('0x57')]})[_0xf0c7('0x10')](function(_0xe28d9d){return _0xe28d9d;});}})[_0xf0c7('0x10')](function(){return respondWithRpcPromise('AbandonInteraction',_0xf0c7('0x54'),_0x315d84[_0xf0c7('0x26')],client9004);})['then'](respondWithResult(_0x21cf34,null))[_0xf0c7('0x19')](handleError(_0x21cf34,null));};exports[_0xf0c7('0x58')]=function(_0x6aba31,_0x3af1e4){_0x6aba31[_0xf0c7('0x26')][_0xf0c7('0x24')]=_0x6aba31[_0xf0c7('0x59')][_0xf0c7('0x5a')];_0x6aba31[_0xf0c7('0x26')][_0xf0c7('0x5b')]=_0x6aba31[_0xf0c7('0x59')][_0xf0c7('0x5c')];_0x6aba31[_0xf0c7('0x26')][_0xf0c7('0x2e')]=_0x6aba31[_0xf0c7('0x59')][_0xf0c7('0x5d')];return db[_0xf0c7('0x5e')]['create'](_0x6aba31[_0xf0c7('0x26')])[_0xf0c7('0x10')](respondWithResult(_0x3af1e4,0xc9))[_0xf0c7('0x19')](handleError(_0x3af1e4,null));};exports[_0xf0c7('0x5f')]=function(_0x71642c,_0x272601){return db[_0xf0c7('0x36')][_0xf0c7('0x40')]({'where':{'id':_0x71642c[_0xf0c7('0x33')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x272601,null))[_0xf0c7('0x10')](function(_0x59d783){if(_0x59d783){if(_0x59d783['closed']){return _0x272601[_0xf0c7('0x1b')](0x193)[_0xf0c7('0x60')]({'status':0x193,'message':_0xf0c7('0x61')});}return db['Attachment'][_0xf0c7('0x40')]({'where':{'id':_0x71642c[_0xf0c7('0x30')][_0xf0c7('0x62')]},'raw':!![]})[_0xf0c7('0x10')](handleEntityNotFound(_0x272601,null));}})[_0xf0c7('0x10')](function(_0x2acbd9){if(_0x2acbd9){var _0x4f8dfd=_0x2acbd9['ChatOfflineMessageId']!==null;var _0x4b1eeb=path[_0xf0c7('0x63')](config[_0xf0c7('0x64')],'server/files/attachments/');if(_0x4f8dfd){_0x4b1eeb=path[_0xf0c7('0x63')](_0x4b1eeb,_0xf0c7('0x65'));}var _0x22d1d7=path[_0xf0c7('0x63')](_0x4b1eeb,_0x2acbd9['basename']);return _0x272601[_0xf0c7('0x66')](_0x22d1d7);}})[_0xf0c7('0x19')](handleError(_0x272601,null));};exports[_0xf0c7('0x67')]=function(_0x561ecf,_0x4e3dcc){var _0x28e6b6=null;var _0x4ea7ec=null;var _0x3a3877=null;if(_0x561ecf[_0xf0c7('0x26')]['id']){delete _0x561ecf['body']['id'];}if(_0x561ecf[_0xf0c7('0x26')][_0xf0c7('0x68')]){_0x3a3877=path[_0xf0c7('0x63')](config[_0xf0c7('0x64')],_0xf0c7('0x69'),util[_0xf0c7('0x6a')](_0xf0c7('0x6b'),Date[_0xf0c7('0x6c')]()));_0x561ecf['body'][_0xf0c7('0x6d')]=_0x3a3877;}return db[_0xf0c7('0x36')]['find']({'where':{'id':_0x561ecf[_0xf0c7('0x33')]['id']},'include':[{'model':db[_0xf0c7('0x51')],'as':'Messages','include':[{'model':db[_0xf0c7('0x6e')],'as':'User'}]}]})[_0xf0c7('0x10')](handleEntityNotFound(_0x4e3dcc,null))['then'](saveUpdates(_0x561ecf[_0xf0c7('0x26')],null))['then'](function(_0x3908ae){if(_0x3908ae){_0x28e6b6=_0x3908ae;return db[_0xf0c7('0x41')][_0xf0c7('0x3d')]({'where':{'id':_0x28e6b6[_0xf0c7('0x42')]}});}})[_0xf0c7('0x10')](function(_0x1434a8){if(_0x1434a8){_0x4ea7ec=_0x1434a8;return db['CmContact'][_0xf0c7('0x3d')]({'where':{'id':_0x28e6b6['ContactId']}});}})[_0xf0c7('0x10')](function(_0x598890){if(_0x598890){if(_0x3a3877){var _0xa4c5a5=null;for(var _0x251803=0x1;_0x251803<_0x28e6b6[_0xf0c7('0x6f')][_0xf0c7('0x3a')];++_0x251803){_0xa4c5a5=_0x28e6b6[_0xf0c7('0x6f')][_0x251803];var _0x5c5bc2=_0xa4c5a5['UserId']?util[_0xf0c7('0x6a')]('%s%d',_0x4ea7ec[_0xf0c7('0x70')],_0xa4c5a5['UserId']):_0xf0c7('0x71');var _0x57cb28=_0x561ecf[_0xf0c7('0x26')]['customer']||util['format']('%s%d',_0xf0c7('0x72'),_0xa4c5a5[_0xf0c7('0x73')]);switch(_0x4ea7ec[_0xf0c7('0x74')]){case'website_alias':_0x5c5bc2=_0xa4c5a5[_0xf0c7('0x75')]?util[_0xf0c7('0x6a')](_0xf0c7('0x76'),_0x4ea7ec['agentAlias'],_0xa4c5a5['UserId']):_0xf0c7('0x71');break;case _0xf0c7('0x77'):_0x5c5bc2=_0xa4c5a5[_0xf0c7('0x75')]?_0xa4c5a5[_0xf0c7('0x6e')][_0xf0c7('0x78')]||_0xa4c5a5['User'][_0xf0c7('0x47')]:'System';break;case _0xf0c7('0x79'):_0x5c5bc2=_0xa4c5a5[_0xf0c7('0x75')]?_0xa4c5a5[_0xf0c7('0x6e')][_0xf0c7('0x47')]:_0xf0c7('0x71');break;default:_0x5c5bc2=_0xa4c5a5[_0xf0c7('0x75')]?util['format'](_0xf0c7('0x76'),_0x4ea7ec[_0xf0c7('0x70')],_0xa4c5a5['UserId']):_0xf0c7('0x71');}var _0x17f3ac=util[_0xf0c7('0x6a')](_0xf0c7('0x7a'),moment(_0xa4c5a5['createdAt'])[_0xf0c7('0x6a')]('MM/DD/YYYY\x20HH:mm:ss'),_0xa4c5a5['direction']==='in'?_0x57cb28:_0x5c5bc2,_0xa4c5a5[_0xf0c7('0x26')]);if(!_0xa4c5a5[_0xf0c7('0x7b')]){fs[_0xf0c7('0x7c')](_0x3a3877,_0x17f3ac);}}return db[_0xf0c7('0x7d')][_0xf0c7('0x40')]({'where':{'service':!![]},'include':[{'model':db[_0xf0c7('0x7e')],'as':_0xf0c7('0x7f'),'raw':!![],'include':[{'model':db[_0xf0c7('0x80')],'as':_0xf0c7('0x80'),'raw':!![]}]}]});}}})[_0xf0c7('0x10')](function(_0x39e83d){if(!_0x39e83d||!_0x39e83d[_0xf0c7('0x7f')]||!_0x561ecf[_0xf0c7('0x26')])return _0x28e6b6;var _0x394890=_0x39e83d[_0xf0c7('0x81')]();return respondWithRpcPromise(_0xf0c7('0x82'),_0xf0c7('0x83'),{'account':_0x394890,'message':{'from':util['format'](_0xf0c7('0x84'),_0x39e83d['name'],_0x39e83d[_0xf0c7('0x48')]||_0x39e83d[_0xf0c7('0x7f')][_0xf0c7('0x31')]),'to':_0x561ecf[_0xf0c7('0x26')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format'](_0xf0c7('0x85'),_0x561ecf[_0xf0c7('0x26')][_0xf0c7('0x68')]),'attachments':[{'path':_0x3a3877}]}})[_0xf0c7('0x10')](function(){return _0x28e6b6;})[_0xf0c7('0x19')](function(_0x2483b9){logger['error'](_0x2483b9);});})[_0xf0c7('0x10')](respondWithStatusCode(_0x4e3dcc,0xc8))[_0xf0c7('0x19')](handleError(_0x4e3dcc,null));};exports[_0xf0c7('0x86')]=function(_0x154572,_0x17df4a){return db['ChatMessage'][_0xf0c7('0x3d')]({'where':{'id':_0x154572[_0xf0c7('0x33')]['id']}})[_0xf0c7('0x10')](handleEntityNotFound(_0x17df4a,null))[_0xf0c7('0x10')](function(_0x355015){if(_0x355015){return _0x355015[_0xf0c7('0x86')](_0x154572[_0xf0c7('0x26')][_0xf0c7('0x87')],_[_0xf0c7('0x88')](_0x154572['body'],[_0xf0c7('0x87'),'id'])||{});}})['then'](respondWithResult(_0x17df4a,null))[_0xf0c7('0x19')](handleError(_0x17df4a,null));};exports[_0xf0c7('0x89')]=function(_0x310b4f,_0xac801b){var _0x354279={'raw':![],'where':{}};var _0x26b2f8={};var _0x1217e7={'count':0x0,'rows':[]};return db[_0xf0c7('0x36')]['findOne']({'where':{'id':_0x310b4f[_0xf0c7('0x33')]['id']}})[_0xf0c7('0x10')](handleEntityNotFound(_0xac801b,null))[_0xf0c7('0x10')](function(_0x3e376e){if(_0x3e376e){_0x26b2f8['model']=_[_0xf0c7('0x35')](db[_0xf0c7('0x51')][_0xf0c7('0x2d')]);_0x26b2f8['query']=_[_0xf0c7('0x35')](_0x310b4f[_0xf0c7('0x30')]);_0x26b2f8[_0xf0c7('0x8a')]=_['intersection'](_0x26b2f8['model'],_0x26b2f8[_0xf0c7('0x30')]);_0x354279[_0xf0c7('0x39')]=_[_0xf0c7('0x37')](_0x26b2f8['model'],qs[_0xf0c7('0x38')](_0x310b4f[_0xf0c7('0x30')][_0xf0c7('0x38')]));_0x354279['attributes']=_0x354279['attributes']['length']?_0x354279[_0xf0c7('0x39')]:_0x26b2f8[_0xf0c7('0x34')];if(!_0x310b4f[_0xf0c7('0x30')][_0xf0c7('0x8b')]('nolimit')){_0x354279[_0xf0c7('0x20')]=qs[_0xf0c7('0x20')](_0x310b4f[_0xf0c7('0x30')][_0xf0c7('0x20')]);_0x354279[_0xf0c7('0x1d')]=qs['offset'](_0x310b4f[_0xf0c7('0x30')][_0xf0c7('0x1d')]);}_0x354279[_0xf0c7('0x8c')]=qs[_0xf0c7('0x8d')](_0x310b4f['query']['sort']);_0x354279[_0xf0c7('0x8e')]=qs[_0xf0c7('0x8a')](_['pick'](_0x310b4f[_0xf0c7('0x30')],_0x26b2f8[_0xf0c7('0x8a')]));_0x354279[_0xf0c7('0x8e')]['ChatInteractionId']=_0x3e376e['id'];if(_0x310b4f[_0xf0c7('0x30')][_0xf0c7('0x8f')]){_0x354279['where']=_[_0xf0c7('0x90')](_0x354279[_0xf0c7('0x8e')],{'$or':_[_0xf0c7('0x2c')](_0x354279['attributes'],function(_0x4e4e35){var _0x4e7805={};_0x4e7805[_0x4e4e35]={'$like':'%'+_0x310b4f['query'][_0xf0c7('0x8f')]+'%'};return _0x4e7805;})});}if(_0x310b4f[_0xf0c7('0x30')]['$gte']){var _0x26e020=_0x310b4f[_0xf0c7('0x30')]['$gte']['split'](',');var _0x26b7ef={};_0x26b7ef[_0x26e020[0x0]]={'$gte':moment(_0x26e020[0x1])['format'](_0xf0c7('0x91'))};_0x354279[_0xf0c7('0x8e')]=_[_0xf0c7('0x90')](_0x354279[_0xf0c7('0x8e')],_0x26b7ef);}_0x354279=_['merge']({},_0x354279,_0x310b4f[_0xf0c7('0x92')]);return db[_0xf0c7('0x51')][_0xf0c7('0x1f')]({'where':_0x354279['where']})[_0xf0c7('0x10')](function(_0x33753f){_0x1217e7['count']=_0x33753f;if(_0x310b4f[_0xf0c7('0x30')][_0xf0c7('0x3b')]){_0x354279['include']=[{'all':!![]}];}return db[_0xf0c7('0x51')][_0xf0c7('0x93')](_0x354279);})[_0xf0c7('0x10')](function(_0x299c49){_0x1217e7['rows']=_0x299c49;return _0x1217e7;});}})[_0xf0c7('0x10')](respondWithFilteredResult(_0xac801b,_0x354279))[_0xf0c7('0x19')](handleError(_0xac801b,null));};exports[_0xf0c7('0x94')]=function(_0x2c8444,_0x58a1fd){var _0x7a0971={'where':{}},_0x5a899f={},_0xae072f={'count':0x0,'rows':[]};return db[_0xf0c7('0x36')][_0xf0c7('0x40')]({'where':{'id':_0x2c8444[_0xf0c7('0x33')]['id']}})['then'](handleEntityNotFound(_0x58a1fd,null))['then'](function(_0x31731a){if(_0x31731a){_0x5a899f[_0xf0c7('0x34')]=_[_0xf0c7('0x35')](db[_0xf0c7('0x51')][_0xf0c7('0x2d')]);_0x5a899f[_0xf0c7('0x30')]=_[_0xf0c7('0x35')](_0x2c8444['query']);_0x5a899f[_0xf0c7('0x8a')]=_[_0xf0c7('0x37')](_0x5a899f[_0xf0c7('0x34')],_0x5a899f[_0xf0c7('0x30')]);_0x7a0971[_0xf0c7('0x39')]=_['intersection'](_0x5a899f['model'],qs[_0xf0c7('0x38')](_0x2c8444['query'][_0xf0c7('0x38')]));_0x7a0971['attributes']=_0x7a0971[_0xf0c7('0x39')]['length']?_0x7a0971[_0xf0c7('0x39')]:_0x5a899f['model'];if(!_0x2c8444['query'][_0xf0c7('0x8b')]('nolimit')){_0x7a0971[_0xf0c7('0x20')]=qs[_0xf0c7('0x20')](_0x2c8444['query'][_0xf0c7('0x20')]);_0x7a0971['offset']=qs[_0xf0c7('0x1d')](_0x2c8444[_0xf0c7('0x30')]['offset']);}_0x7a0971[_0xf0c7('0x8c')]=qs[_0xf0c7('0x8d')](_0x2c8444[_0xf0c7('0x30')][_0xf0c7('0x8d')]);_0x7a0971['where']=qs[_0xf0c7('0x8a')](_[_0xf0c7('0x95')](_0x2c8444[_0xf0c7('0x30')],_0x5a899f[_0xf0c7('0x8a')]));_0x7a0971[_0xf0c7('0x8e')]['ChatInteractionId']=_0x31731a['id'];if(_0x2c8444[_0xf0c7('0x30')][_0xf0c7('0x8f')]){_0x7a0971['where']=_[_0xf0c7('0x90')](_0x7a0971[_0xf0c7('0x8e')],{'$or':_[_0xf0c7('0x2c')](_0x7a0971[_0xf0c7('0x39')],function(_0x20e917){var _0x59f3b9={};_0x59f3b9[_0x20e917]={'$like':'%'+_0x2c8444[_0xf0c7('0x30')][_0xf0c7('0x8f')]+'%'};return _0x59f3b9;})});}_0x7a0971[_0xf0c7('0x8e')]['secret']=![];if(_0x2c8444[_0xf0c7('0x30')]['id']){_0x7a0971[_0xf0c7('0x8e')]['id']={'$gt':_0x2c8444[_0xf0c7('0x30')]['id']};}_0x7a0971=_[_0xf0c7('0x90')]({},_0x7a0971,_0x2c8444[_0xf0c7('0x92')]);return db['ChatMessage'][_0xf0c7('0x1f')]({'where':_0x7a0971[_0xf0c7('0x8e')]})['then'](function(_0x58c071){_0xae072f[_0xf0c7('0x1f')]=_0x58c071;_0x7a0971[_0xf0c7('0x3c')]=[];if(_0x2c8444[_0xf0c7('0x30')]['includeAgent']){_0x7a0971[_0xf0c7('0x3c')]['push']({'model':db[_0xf0c7('0x6e')],'as':_0xf0c7('0x6e'),'attributes':['id',_0xf0c7('0x47'),_0xf0c7('0x78')]});}if(_0x2c8444[_0xf0c7('0x30')][_0xf0c7('0x3b')]){_0x7a0971[_0xf0c7('0x3c')]=[{'all':!![]}];}return db[_0xf0c7('0x51')][_0xf0c7('0x93')](_0x7a0971);})['then'](function(_0x148ba2){_0xae072f['rows']=_0x148ba2;return _0xae072f;});}})[_0xf0c7('0x10')](respondWithFilteredResult(_0x58a1fd,_0x7a0971))[_0xf0c7('0x19')](handleError(_0x58a1fd,null));};exports[_0xf0c7('0x96')]=function(_0x152301,_0x3c1a3e){return db[_0xf0c7('0x36')][_0xf0c7('0x3d')]({'where':{'id':_0x152301[_0xf0c7('0x33')]['id']}})[_0xf0c7('0x10')](handleEntityNotFound(_0x3c1a3e,null))[_0xf0c7('0x10')](function(_0x37f12b){if(_0x37f12b){return _0x37f12b[_0xf0c7('0x97')](_0x152301[_0xf0c7('0x26')][_0xf0c7('0x87')],_[_0xf0c7('0x88')](_0x152301[_0xf0c7('0x26')],[_0xf0c7('0x87'),'id'])||{})[_0xf0c7('0x98')](function(){return db[_0xf0c7('0x99')][_0xf0c7('0x93')]({'attributes':['id',_0xf0c7('0x24'),_0xf0c7('0x9a')],'where':{'id':_0x152301['body']['ids']}});})[_0xf0c7('0x10')](function(_0x4259ad){socket[_0xf0c7('0x9b')]('chatInteractionTags:save',{'id':Number(_0x152301[_0xf0c7('0x33')]['id']),'tags':_0x4259ad||[]});return{'id':Number(_0x152301[_0xf0c7('0x33')]['id']),'tags':_0x4259ad||[]};});}})[_0xf0c7('0x10')](respondWithResult(_0x3c1a3e,null))[_0xf0c7('0x19')](handleError(_0x3c1a3e,null));};exports['removeTags']=function(_0x468914,_0xf1bf45){return db[_0xf0c7('0x36')][_0xf0c7('0x3d')]({'where':{'id':_0x468914[_0xf0c7('0x33')]['id']}})['then'](handleEntityNotFound(_0xf1bf45,null))['then'](function(_0x297780){if(_0x297780){return _0x297780[_0xf0c7('0x9c')](_0x468914[_0xf0c7('0x30')][_0xf0c7('0x87')]);}})[_0xf0c7('0x10')](respondWithStatusCode(_0xf1bf45,null))[_0xf0c7('0x19')](handleError(_0xf1bf45,null));};exports[_0xf0c7('0x66')]=function(_0xfac3c6,_0x113517){var _0x17ca43=moment()['unix']()[_0xf0c7('0x9d')]();var _0x4cbb1e=path[_0xf0c7('0x63')](config['root'],_0xf0c7('0x9e'),_0xf0c7('0x9f'),'tmp');var _0x5a54d6=path[_0xf0c7('0x63')](config['root'],'server','files',_0xf0c7('0xa0'));var _0x2c4699=path['join'](_0x4cbb1e,_0x17ca43);var _0x440c1b=util['format']('transcript-%d-%s.zip',_0xfac3c6[_0xf0c7('0x33')]['id'],_0x17ca43);var _0x2c9260=path[_0xf0c7('0x63')](_0x4cbb1e,_0x440c1b);var _0x1413df=[];_0x1413df[_0xf0c7('0xa1')]({'model':db[_0xf0c7('0x6e')],'as':_0xf0c7('0x6e'),'attributes':['id',_0xf0c7('0x47')],'raw':!![]});_0x1413df['push']({'model':db[_0xf0c7('0x52')],'as':_0xf0c7('0x53'),'attributes':['id',_0xf0c7('0xa2'),_0xf0c7('0xa3')],'raw':!![]});if(_0xfac3c6[_0xf0c7('0x30')][_0xf0c7('0xa0')]){_0x1413df[_0xf0c7('0xa1')]({'model':db['Attachment'],'as':_0xf0c7('0x5e'),'raw':!![]});}var _0x2c8e33=[{'model':db[_0xf0c7('0x51')],'as':_0xf0c7('0x6f'),'attributes':['id',_0xf0c7('0x26'),_0xf0c7('0xa4'),_0xf0c7('0xa5'),_0xf0c7('0x7b'),_0xf0c7('0xa6')],'include':_0x1413df}];_0x2c8e33[_0xf0c7('0xa1')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xf0c7('0x24')]});_0x2c8e33[_0xf0c7('0xa1')]({'model':db[_0xf0c7('0x6e')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction']['find']({'where':{'id':_0xfac3c6[_0xf0c7('0x33')]['id']},'include':_0x2c8e33})['then'](handleEntityNotFound(_0x113517,null))[_0xf0c7('0x10')](function(_0x31645a){if(_0x31645a){var _0x47b7c8=_0x31645a[_0xf0c7('0xa7')]({'plain':!![]});fs[_0xf0c7('0xa8')](_0x2c4699);var _0x4d11c0={'channel':_0xf0c7('0xa9'),'account':_0x47b7c8[_0xf0c7('0xaa')]['name'],'agent':_0x47b7c8['Owner']?_0x47b7c8[_0xf0c7('0xab')][_0xf0c7('0x47')]:_0xf0c7('0xac'),'createdAt':moment(_0x47b7c8[_0xf0c7('0xa4')])['format'](_0xf0c7('0x91'))[_0xf0c7('0x9d')](),'closedAt':_0x47b7c8[_0xf0c7('0x56')]?moment(_0x47b7c8['closedAt'])[_0xf0c7('0x6a')](_0xf0c7('0x91'))[_0xf0c7('0x9d')]():'','disposition':_0x47b7c8[_0xf0c7('0x57')],'chatInfo':{'browser':_0x47b7c8['browserName'],'os':_0x47b7c8[_0xf0c7('0xad')],'referer':_0x47b7c8[_0xf0c7('0xae')],'customerIp':_0x47b7c8[_0xf0c7('0xaf')],'customerPort':_0x47b7c8[_0xf0c7('0xb0')]?_0x47b7c8[_0xf0c7('0xb0')]:'N.A.'},'messages':_(_0x47b7c8['Messages'])[_0xf0c7('0xb1')]()[_0xf0c7('0x8f')]({'secret':![]})[_0xf0c7('0x2c')](function(_0x424cf2){if(_0x424cf2['Attachment']){var _0x38573e=path['join'](_0x5a54d6,_0x424cf2['Attachment'][_0xf0c7('0x5b')]);if(fs[_0xf0c7('0xb2')](_0x38573e)){fs[_0xf0c7('0xb3')](_0x38573e)[_0xf0c7('0xb4')](fs['createWriteStream'](path[_0xf0c7('0x63')](_0x2c4699,_0x424cf2[_0xf0c7('0x5e')][_0xf0c7('0x5b')])));}}return{'date':moment(_0x424cf2['createdAt'])['format'](_0xf0c7('0x91'))[_0xf0c7('0x9d')](),'sender':_0x424cf2[_0xf0c7('0xa5')]==='out'?_0x424cf2['User']?_0x424cf2['User'][_0xf0c7('0x47')]:_0xf0c7('0x71'):_0x424cf2[_0xf0c7('0x53')][_0xf0c7('0xa2')]+(_0x424cf2[_0xf0c7('0x53')][_0xf0c7('0xa3')]?'\x20'+_0x424cf2[_0xf0c7('0x53')][_0xf0c7('0xa3')]:''),'body':_0x424cf2[_0xf0c7('0x5e')]?_0x424cf2[_0xf0c7('0x5e')][_0xf0c7('0x5b')]:_0x424cf2[_0xf0c7('0x26')],'direction':_0x424cf2[_0xf0c7('0xa5')]==='out'?'A':'C','secret':_0x424cf2['secret'],'read':_0x424cf2['read'],'attachment':_0x424cf2[_0xf0c7('0x5e')]};})[_0xf0c7('0xb5')]()};return ejs[_0xf0c7('0xb6')](path['join'](config[_0xf0c7('0x64')],'server',_0xf0c7('0xb7'),'downloadInteraction.ejs'),{'interaction':_0x4d11c0})[_0xf0c7('0x10')](function(_0x5f0dd1){var _0x54e7b0=path['join'](_0x2c4699,'transcript-'+_0x47b7c8['id']+'-'+_0x17ca43+_0xf0c7('0xb8'));var _0x5863f2={'path':_0x54e7b0,'channel':_0xf0c7('0xa9'),'interactionId':_0x47b7c8['id']};return pdf[_0xf0c7('0xb9')](_0x5f0dd1,_0x5863f2);})[_0xf0c7('0x10')](function(){return new Promise(function(_0x1c5b7a,_0x515f97){zipdir(_0x2c4699,{'saveTo':_0x2c9260},function(_0x14989e,_0x4a9e7c){if(_0x14989e)return _0x515f97(_0x14989e);return _0x1c5b7a(_0x4a9e7c);});})[_0xf0c7('0x10')](function(){return new BPromise(function(_0x217bca,_0x402d9c){rimraf(_0x2c4699,function(_0x3e036b){if(_0x3e036b)_0x402d9c(_0x3e036b);return _0x217bca();});});})['then'](function(){return _0x113517[_0xf0c7('0x66')](_0x2c9260,_0x440c1b,function(_0x3d277c){if(_0x3d277c){logger[_0xf0c7('0x16')]('err',_0x3d277c);}else{fs[_0xf0c7('0xba')](_0x2c9260);}});});});}else{return _0x113517[_0xf0c7('0x1a')](0xc8);}})[_0xf0c7('0x19')](handleError(_0x113517,null));}; \ No newline at end of file +var _0xb14a=['defaults','localhost','./chatInteraction.socket','register','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','then','destroy','end','stack','name','send','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','include','find','create','update','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooEscalation','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','vidaooTopic','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','attachmentUpload','file','basename','filename','type','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','User','agentAlias','customer','format','%s%d','Visitor','ContactId','agentIdentifier','website_alias','System','alias','fullname','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','split','options','includeAll','rows','getMyMessages','pick','includeAgent','push','setTags','spread','Tag','color','removeTags','toString','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0xd5e0c0,_0x9cd318){var _0x30b3de=function(_0xbf717c){while(--_0xbf717c){_0xd5e0c0['push'](_0xd5e0c0['shift']());}};_0x30b3de(++_0x9cd318);}(_0xb14a,0x197));var _0xab14=function(_0x1f3c66,_0x2df6dc){_0x1f3c66=_0x1f3c66-0x0;var _0x26c49e=_0xb14a[_0x1f3c66];return _0x26c49e;};'use strict';var rimraf=require(_0xab14('0x0'));var zipdir=require(_0xab14('0x1'));var rp=require('request-promise');var moment=require(_0xab14('0x2'));var BPromise=require(_0xab14('0x3'));var Mustache=require(_0xab14('0x4'));var util=require(_0xab14('0x5'));var path=require(_0xab14('0x6'));var ejs=require(_0xab14('0x7'));var fs=require('fs');var _=require(_0xab14('0x8'));var Redis=require(_0xab14('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0xab14('0xa'));var pdf=require(_0xab14('0xb'));var logger=require(_0xab14('0xc'))(_0xab14('0xd'));var config=require(_0xab14('0xe'));var db=require(_0xab14('0xf'))['db'];config[_0xab14('0x10')]=_[_0xab14('0x11')](config[_0xab14('0x10')],{'host':_0xab14('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab14('0x10')]));require(_0xab14('0x13'))[_0xab14('0x14')](socket);var jayson=require('jayson/promise');var client=jayson[_0xab14('0x15')]['http']({'port':0x232b});var client9004=jayson[_0xab14('0x15')][_0xab14('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x38bb0e,_0xbcd762,_0x23aa0d,_0x2cdcae){return new BPromise(function(_0x422f63,_0x1e944f){var _0x35c7b2=_0x2cdcae||client;return _0x35c7b2[_0xab14('0x17')](_0x38bb0e,_0x23aa0d)['then'](function(_0x32174b){logger['info'](_0xab14('0x18'),_0xbcd762,_0xab14('0x19'));logger[_0xab14('0x1a')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xbcd762,_0xab14('0x19'),JSON[_0xab14('0x1b')](_0x32174b));if(_0x32174b[_0xab14('0x1c')]){if(_0x32174b[_0xab14('0x1c')][_0xab14('0x1d')]===0x1f4){logger[_0xab14('0x1c')](_0xab14('0x18'),_0xbcd762,_0x32174b[_0xab14('0x1c')]['message']);return _0x1e944f(_0x32174b['error'][_0xab14('0x1e')]);}logger[_0xab14('0x1c')](_0xab14('0x18'),_0xbcd762,_0x32174b[_0xab14('0x1c')]['message']);return _0x422f63(_0x32174b[_0xab14('0x1c')][_0xab14('0x1e')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0xbcd762,_0xab14('0x19'));_0x422f63(_0x32174b[_0xab14('0x1f')][_0xab14('0x1e')]);}})[_0xab14('0x20')](function(_0x5a652f){logger['error'](_0xab14('0x18'),_0xbcd762,_0x5a652f);_0x1e944f(_0x5a652f);});});}function respondWithStatusCode(_0x552c69,_0x67a806){_0x67a806=_0x67a806||0xcc;return function(_0x2ca02c){if(_0x2ca02c){return _0x552c69[_0xab14('0x21')](_0x67a806);}return _0x552c69[_0xab14('0x22')](_0x67a806)['end']();};}function respondWithResult(_0x267ede,_0x5aa19e){_0x5aa19e=_0x5aa19e||0xc8;return function(_0x3d22e3){if(_0x3d22e3){return _0x267ede[_0xab14('0x22')](_0x5aa19e)['json'](_0x3d22e3);}};}function respondWithFilteredResult(_0x312b9f,_0x5af8de){return function(_0x3e73f5){if(_0x3e73f5){var _0x4d351e=typeof _0x5af8de[_0xab14('0x23')]===_0xab14('0x24')&&typeof _0x5af8de[_0xab14('0x25')]===_0xab14('0x24');var _0x6be9d5=_0x3e73f5[_0xab14('0x26')];var _0x3801ae=_0x4d351e?0x0:_0x5af8de[_0xab14('0x23')];var _0x27f3f0=_0x4d351e?_0x3e73f5[_0xab14('0x26')]:_0x5af8de[_0xab14('0x23')]+_0x5af8de['limit'];var _0x1356ee;if(_0x27f3f0>=_0x6be9d5){_0x27f3f0=_0x6be9d5;_0x1356ee=0xc8;}else{_0x1356ee=0xce;}_0x312b9f['status'](_0x1356ee);return _0x312b9f['set'](_0xab14('0x27'),_0x3801ae+'-'+_0x27f3f0+'/'+_0x6be9d5)[_0xab14('0x28')](_0x3e73f5);}return null;};}function saveUpdates(_0x3ffe65){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40['update'](_0x3ffe65)[_0xab14('0x29')](function(_0x3fa6ad){return _0x3fa6ad;});}return null;};}function removeEntity(_0x4166d3){return function(_0x571b2c){if(_0x571b2c){return _0x571b2c[_0xab14('0x2a')]()[_0xab14('0x29')](function(){_0x4166d3[_0xab14('0x22')](0xcc)[_0xab14('0x2b')]();});}};}function handleEntityNotFound(_0x5b0742){return function(_0x14dd26){if(!_0x14dd26){_0x5b0742[_0xab14('0x21')](0x194);}return _0x14dd26;};}function handleError(_0x7d05c,_0x28b18e){_0x28b18e=_0x28b18e||0x1f4;return function(_0x51bd9a){logger[_0xab14('0x1c')](_0x51bd9a[_0xab14('0x2c')]);if(_0x51bd9a[_0xab14('0x2d')]){delete _0x51bd9a[_0xab14('0x2d')];}_0x7d05c['status'](_0x28b18e)[_0xab14('0x2e')](_0x51bd9a);};}function getMustacheRender(_0x3d80a1,_0x2ff1e7){return Mustache[_0xab14('0x2f')](_0x3d80a1,_[_0xab14('0x30')](_0x2ff1e7[_0xab14('0x31')],{'contact':_0x2ff1e7[_0xab14('0x32')],'message':_0x2ff1e7[_0xab14('0x1e')],'agent':_0x2ff1e7[_0xab14('0x33')],'interaction':_0x2ff1e7[_0xab14('0x34')],'account':_0x2ff1e7[_0xab14('0x35')]}))||'';}exports['index']=function(_0x3a293d,_0x5b340c){var _0x5be832={};var _0x3a099e=_[_0xab14('0x36')](db[_0xab14('0x37')][_0xab14('0x38')],function(_0x573e95){return{'name':_0x573e95['fieldName'],'type':_0x573e95['type'][_0xab14('0x39')]};});_0x5be832=qs[_0xab14('0x3a')](_0x3a099e,_0x3a293d);return interaction[_0xab14('0x3b')](_0xab14('0x3c'),_0x3a293d[_0xab14('0x3d')],_0x3a293d[_0xab14('0x3e')],_0x5be832,_0x3a099e)[_0xab14('0x29')](respondWithFilteredResult(_0x5b340c,_0x5be832))[_0xab14('0x20')](handleError(_0x5b340c,null));};exports[_0xab14('0x3f')]=function(_0x1caa91,_0x2354be){var _0xb2a99f={'raw':![],'where':{'id':_0x1caa91[_0xab14('0x40')]['id']}},_0xd878d6={};_0xd878d6[_0xab14('0x41')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0xd878d6['query']=_[_0xab14('0x42')](_0x1caa91[_0xab14('0x3d')]);_0xd878d6[_0xab14('0x43')]=_[_0xab14('0x44')](_0xd878d6[_0xab14('0x41')],_0xd878d6[_0xab14('0x3d')]);_0xb2a99f[_0xab14('0x45')]=_['intersection'](_0xd878d6['model'],qs['fields'](_0x1caa91[_0xab14('0x3d')][_0xab14('0x46')]));_0xb2a99f[_0xab14('0x45')]=_0xb2a99f[_0xab14('0x45')][_0xab14('0x47')]?_0xb2a99f[_0xab14('0x45')]:_0xd878d6[_0xab14('0x41')];if(_0x1caa91[_0xab14('0x3d')]['includeAll']){_0xb2a99f[_0xab14('0x48')]=[{'all':!![]}];}_0xb2a99f=_['merge']({},_0xb2a99f,_0x1caa91['options']);return db['ChatInteraction'][_0xab14('0x49')](_0xb2a99f)[_0xab14('0x29')](handleEntityNotFound(_0x2354be,null))[_0xab14('0x29')](respondWithResult(_0x2354be,null))[_0xab14('0x20')](handleError(_0x2354be,null));};exports[_0xab14('0x4a')]=function(_0x423dd6,_0x2958af){return db['ChatInteraction'][_0xab14('0x4a')](_0x423dd6[_0xab14('0x31')],{})['then'](respondWithResult(_0x2958af,0xc9))[_0xab14('0x20')](handleError(_0x2958af,null));};exports[_0xab14('0x4b')]=function(_0x236da3,_0x413964){if(_0x236da3[_0xab14('0x31')]['id']){delete _0x236da3[_0xab14('0x31')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x236da3[_0xab14('0x40')]['id']}})[_0xab14('0x29')](handleEntityNotFound(_0x413964,null))['then'](saveUpdates(_0x236da3[_0xab14('0x31')],null))[_0xab14('0x29')](respondWithResult(_0x413964,null))[_0xab14('0x20')](handleError(_0x413964,null));};exports['destroy']=function(_0x3e653a,_0x4ee84b){return db['ChatInteraction']['find']({'where':{'id':_0x3e653a[_0xab14('0x40')]['id']}})[_0xab14('0x29')](handleEntityNotFound(_0x4ee84b,null))['then'](removeEntity(_0x4ee84b,null))[_0xab14('0x20')](handleError(_0x4ee84b,null));};exports[_0xab14('0x4c')]=function(_0x1c7a4b,_0x2edcd0){return db['ChatInteraction'][_0xab14('0x4c')]()[_0xab14('0x29')](respondWithResult(_0x2edcd0,null))[_0xab14('0x20')](handleError(_0x2edcd0,null));};exports[_0xab14('0x4d')]=function(_0x43b4c3,_0x50d94c){var _0x4e75bf=_0x43b4c3['params']['id'];var _0x50f658;var _0x33513b;var _0x383d13;return db['ChatInteraction']['findOne']({'where':{'id':_0x4e75bf}})[_0xab14('0x29')](function(_0x19580c){_0x50f658=_0x19580c;return db[_0xab14('0x4e')][_0xab14('0x4f')]({'where':{'id':_0x19580c[_0xab14('0x50')]},'attributes':['id','vidaooApiKey',_0xab14('0x51'),'vidaooTopic',_0xab14('0x52'),_0xab14('0x53')],'raw':!![]});})['then'](function(_0x17c8a4){if(_0x17c8a4&&_0x17c8a4['vidaooApiKey']&&_0x17c8a4[_0xab14('0x51')]){_0x33513b=_0x17c8a4;var _0x12c2e4={'interaction':{'id':_0x4e75bf},'agent':{'id':_0x43b4c3[_0xab14('0x3e')]['id'],'name':_0x43b4c3[_0xab14('0x3e')][_0xab14('0x2d')],'fullname':_0x43b4c3['user']['fullname'],'email':_0x43b4c3['user'][_0xab14('0x54')]},'contact':_0x43b4c3['body'][_0xab14('0x32')],'account':_0x43b4c3['body'][_0xab14('0x35')]};var _0x5a9788={'rejectUnauthorized':![],'method':_0xab14('0x55'),'url':_0xab14('0x56'),'headers':{'X-APIKEY':_0x17c8a4[_0xab14('0x57')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x43b4c3[_0xab14('0x3e')][_0xab14('0x54')]],'buttons':null,'topic':_0x33513b[_0xab14('0x58')],'note':_[_0xab14('0x59')](_0x33513b[_0xab14('0x52')])?null:getMustacheRender(_0x33513b['vidaooNote'],_0x12c2e4),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xab14('0x59')](_0x33513b[_0xab14('0x53')])){var _0x6f25a6=getMustacheRender(_0x33513b[_0xab14('0x53')],_0x12c2e4);var _0x305eb8=JSON['parse'](_0x6f25a6);_0x5a9788['body'][_0xab14('0x5a')]=_0x305eb8;}}catch(_0x504730){throw new db[(_0xab14('0x5b'))][(_0xab14('0x5c'))](_0xab14('0x5d'));}return rp(_0x5a9788);}else{throw new db[(_0xab14('0x5b'))][(_0xab14('0x5c'))](_0xab14('0x5e'));}})[_0xab14('0x29')](function(_0x23622e){_0x383d13=_0x23622e;if(_0x383d13['id']){var _0x8d3784={'body':_0x383d13[_0xab14('0x5f')],'ChatWebsiteId':_0x33513b['id'],'ChatInteractionId':_0x50f658['id'],'direction':_0xab14('0x60'),'UserId':_0x43b4c3['user']['id']};return db[_0xab14('0x61')][_0xab14('0x4a')](_0x8d3784,{});}else{throw new db['Sequelize'][(_0xab14('0x5c'))](_0xab14('0x62'));}})[_0xab14('0x29')](function(){return _0x50f658[_0xab14('0x63')]({'vidaooSessionId':_0x383d13['id']});})[_0xab14('0x29')](respondWithResult(_0x50d94c,null))['catch'](handleError(_0x50d94c,null));};exports[_0xab14('0x64')]=function(_0x2abfa0,_0x41b6e5){if(_0x2abfa0[_0xab14('0x31')]['id']){delete _0x2abfa0[_0xab14('0x31')]['id'];}return db['ChatInteraction'][_0xab14('0x49')]({'where':{'id':_0x2abfa0[_0xab14('0x40')]['id']},'include':[{'model':db[_0xab14('0x65')],'as':_0xab14('0x66')}]})[_0xab14('0x29')](handleEntityNotFound(_0x41b6e5,null))[_0xab14('0x29')](saveUpdates(_0x2abfa0[_0xab14('0x31')],null))[_0xab14('0x29')](respondWithResult(_0x41b6e5,null))[_0xab14('0x20')](handleError(_0x41b6e5,null));};exports[_0xab14('0x67')]=function(_0x4cbf86,_0x4a39f3){if(_0x4cbf86[_0xab14('0x31')]['id']){delete _0x4cbf86['body']['id'];}return db[_0xab14('0x37')]['find']({'where':{'id':_0x4cbf86[_0xab14('0x40')]['id']}})['then'](function(_0x2c1554){if(!_0x2c1554){logger[_0xab14('0x1c')](_0xab14('0x68'),_0xab14('0x67'),0x194,_0xab14('0x69'));_0x4a39f3[_0xab14('0x21')](0x194);}else{if(_0x2c1554[_0xab14('0x6a')]){throw new db[(_0xab14('0x5b'))][(_0xab14('0x5c'))](_0xab14('0x6b'));}}return _0x2c1554;})['then'](function(_0x153ebe){if(_0x153ebe){return _0x153ebe[_0xab14('0x4b')]({'closed':_0x4cbf86[_0xab14('0x31')]['closed'],'disposition':_0x4cbf86['body']['disposition']})[_0xab14('0x29')](function(_0x4166a3){return _0x4166a3;});}})[_0xab14('0x29')](function(){return respondWithRpcPromise('AbandonInteraction',_0xab14('0x67'),_0x4cbf86[_0xab14('0x31')],client9004);})[_0xab14('0x29')](respondWithResult(_0x4a39f3,null))[_0xab14('0x20')](handleError(_0x4a39f3,null));};exports[_0xab14('0x6c')]=function(_0x2dccb3,_0x5df2e5){_0x2dccb3['body'][_0xab14('0x2d')]=_0x2dccb3[_0xab14('0x6d')]['originalname'];_0x2dccb3[_0xab14('0x31')][_0xab14('0x6e')]=_0x2dccb3[_0xab14('0x6d')][_0xab14('0x6f')];_0x2dccb3[_0xab14('0x31')][_0xab14('0x70')]=_0x2dccb3[_0xab14('0x6d')][_0xab14('0x71')];return db[_0xab14('0x72')][_0xab14('0x4a')](_0x2dccb3[_0xab14('0x31')])[_0xab14('0x29')](respondWithResult(_0x5df2e5,0xc9))[_0xab14('0x20')](handleError(_0x5df2e5,null));};exports[_0xab14('0x73')]=function(_0x39c8c6,_0x48364b){return db[_0xab14('0x37')][_0xab14('0x4f')]({'where':{'id':_0x39c8c6[_0xab14('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x48364b,null))[_0xab14('0x29')](function(_0x4b8af6){if(_0x4b8af6){if(_0x4b8af6[_0xab14('0x74')]){return _0x48364b[_0xab14('0x22')](0x193)[_0xab14('0x28')]({'status':0x193,'message':_0xab14('0x75')});}return db[_0xab14('0x72')][_0xab14('0x4f')]({'where':{'id':_0x39c8c6[_0xab14('0x3d')][_0xab14('0x76')]},'raw':!![]})[_0xab14('0x29')](handleEntityNotFound(_0x48364b,null));}})[_0xab14('0x29')](function(_0x43da62){if(_0x43da62){var _0xdd8093=_0x43da62[_0xab14('0x77')]!==null;var _0x2545f1=path[_0xab14('0x78')](config[_0xab14('0x79')],'server/files/attachments/');if(_0xdd8093){_0x2545f1=path[_0xab14('0x78')](_0x2545f1,_0xab14('0x7a'));}var _0x304aff=path[_0xab14('0x78')](_0x2545f1,_0x43da62[_0xab14('0x6e')]);return _0x48364b[_0xab14('0x7b')](_0x304aff);}})['catch'](handleError(_0x48364b,null));};exports[_0xab14('0x7c')]=function(_0x48b6ae,_0x402ee6){var _0x34a869=null;var _0x30dd4d=null;var _0x1b1054=null;if(_0x48b6ae[_0xab14('0x31')]['id']){delete _0x48b6ae[_0xab14('0x31')]['id'];}if(_0x48b6ae[_0xab14('0x31')]['mailTranscript']){_0x1b1054=path[_0xab14('0x78')](config['root'],_0xab14('0x7d'),util['format'](_0xab14('0x7e'),Date['now']()));_0x48b6ae[_0xab14('0x31')][_0xab14('0x7f')]=_0x1b1054;}return db[_0xab14('0x37')]['find']({'where':{'id':_0x48b6ae[_0xab14('0x40')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xab14('0x80'),'include':[{'model':db[_0xab14('0x81')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x402ee6,null))[_0xab14('0x29')](saveUpdates(_0x48b6ae[_0xab14('0x31')],null))['then'](function(_0x47894c){if(_0x47894c){_0x34a869=_0x47894c;return db[_0xab14('0x4e')]['find']({'where':{'id':_0x34a869[_0xab14('0x50')]}});}})[_0xab14('0x29')](function(_0x1ef34f){if(_0x1ef34f){_0x30dd4d=_0x1ef34f;return db[_0xab14('0x65')][_0xab14('0x49')]({'where':{'id':_0x34a869['ContactId']}});}})[_0xab14('0x29')](function(_0x235603){if(_0x235603){if(_0x1b1054){var _0x486b19=null;for(var _0x5d01ba=0x1;_0x5d01ba<_0x34a869[_0xab14('0x80')][_0xab14('0x47')];++_0x5d01ba){_0x486b19=_0x34a869['Messages'][_0x5d01ba];var _0x1660ca=_0x486b19[_0xab14('0x6a')]?util['format']('%s%d',_0x30dd4d[_0xab14('0x82')],_0x486b19['UserId']):'System';var _0x5ccd29=_0x48b6ae['body'][_0xab14('0x83')]||util[_0xab14('0x84')](_0xab14('0x85'),_0xab14('0x86'),_0x486b19[_0xab14('0x87')]);switch(_0x30dd4d[_0xab14('0x88')]){case _0xab14('0x89'):_0x1660ca=_0x486b19[_0xab14('0x6a')]?util['format']('%s%d',_0x30dd4d[_0xab14('0x82')],_0x486b19[_0xab14('0x6a')]):_0xab14('0x8a');break;case'agent_alias':_0x1660ca=_0x486b19[_0xab14('0x6a')]?_0x486b19[_0xab14('0x81')][_0xab14('0x8b')]||_0x486b19[_0xab14('0x81')][_0xab14('0x8c')]:_0xab14('0x8a');break;case _0xab14('0x8d'):_0x1660ca=_0x486b19[_0xab14('0x6a')]?_0x486b19['User'][_0xab14('0x8c')]:_0xab14('0x8a');break;default:_0x1660ca=_0x486b19['UserId']?util['format'](_0xab14('0x85'),_0x30dd4d[_0xab14('0x82')],_0x486b19['UserId']):_0xab14('0x8a');}var _0xf7b7b3=util[_0xab14('0x84')]('[%s]\x20%s:\x20%s\x0a',moment(_0x486b19[_0xab14('0x8e')])[_0xab14('0x84')](_0xab14('0x8f')),_0x486b19[_0xab14('0x90')]==='in'?_0x5ccd29:_0x1660ca,_0x486b19['body']);if(!_0x486b19[_0xab14('0x91')]){fs[_0xab14('0x92')](_0x1b1054,_0xf7b7b3);}}return db['MailAccount'][_0xab14('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0xab14('0x93')],'as':_0xab14('0x94'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xab14('0x95'),'raw':!![]}]}]});}}})[_0xab14('0x29')](function(_0x3f720b){if(!_0x3f720b||!_0x3f720b[_0xab14('0x94')]||!_0x48b6ae[_0xab14('0x31')])return _0x34a869;var _0x460f0d=_0x3f720b[_0xab14('0x96')]();return respondWithRpcPromise('SendMail',_0xab14('0x97'),{'account':_0x460f0d,'message':{'from':util[_0xab14('0x84')](_0xab14('0x98'),_0x3f720b['name'],_0x3f720b[_0xab14('0x54')]||_0x3f720b[_0xab14('0x94')][_0xab14('0x3e')]),'to':_0x48b6ae[_0xab14('0x31')][_0xab14('0x99')],'subject':_0xab14('0x9a'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48b6ae['body'][_0xab14('0x99')]),'attachments':[{'path':_0x1b1054}]}})[_0xab14('0x29')](function(){return _0x34a869;})['catch'](function(_0x42a3e2){logger[_0xab14('0x1c')](_0x42a3e2);});})[_0xab14('0x29')](respondWithStatusCode(_0x402ee6,0xc8))[_0xab14('0x20')](handleError(_0x402ee6,null));};exports[_0xab14('0x9b')]=function(_0x6d5fb5,_0x4aace8){return db[_0xab14('0x61')]['find']({'where':{'id':_0x6d5fb5[_0xab14('0x40')]['id']}})[_0xab14('0x29')](handleEntityNotFound(_0x4aace8,null))[_0xab14('0x29')](function(_0x216992){if(_0x216992){return _0x216992[_0xab14('0x9b')](_0x6d5fb5['body'][_0xab14('0x9c')],_[_0xab14('0x9d')](_0x6d5fb5[_0xab14('0x31')],[_0xab14('0x9c'),'id'])||{});}})[_0xab14('0x29')](respondWithResult(_0x4aace8,null))[_0xab14('0x20')](handleError(_0x4aace8,null));};exports[_0xab14('0x9e')]=function(_0x2ef79c,_0x9a3f60){var _0x4c698f={'raw':![],'where':{}};var _0x196ba7={};var _0x2a9bc9={'count':0x0,'rows':[]};return db[_0xab14('0x37')]['findOne']({'where':{'id':_0x2ef79c[_0xab14('0x40')]['id']}})[_0xab14('0x29')](handleEntityNotFound(_0x9a3f60,null))['then'](function(_0xb801e3){if(_0xb801e3){_0x196ba7[_0xab14('0x41')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x196ba7['query']=_[_0xab14('0x42')](_0x2ef79c[_0xab14('0x3d')]);_0x196ba7[_0xab14('0x43')]=_[_0xab14('0x44')](_0x196ba7[_0xab14('0x41')],_0x196ba7[_0xab14('0x3d')]);_0x4c698f[_0xab14('0x45')]=_[_0xab14('0x44')](_0x196ba7[_0xab14('0x41')],qs[_0xab14('0x46')](_0x2ef79c[_0xab14('0x3d')][_0xab14('0x46')]));_0x4c698f[_0xab14('0x45')]=_0x4c698f[_0xab14('0x45')][_0xab14('0x47')]?_0x4c698f[_0xab14('0x45')]:_0x196ba7[_0xab14('0x41')];if(!_0x2ef79c[_0xab14('0x3d')][_0xab14('0x9f')](_0xab14('0xa0'))){_0x4c698f[_0xab14('0x25')]=qs[_0xab14('0x25')](_0x2ef79c['query']['limit']);_0x4c698f[_0xab14('0x23')]=qs['offset'](_0x2ef79c['query']['offset']);}_0x4c698f[_0xab14('0xa1')]=qs[_0xab14('0xa2')](_0x2ef79c[_0xab14('0x3d')][_0xab14('0xa2')]);_0x4c698f[_0xab14('0xa3')]=qs['filters'](_['pick'](_0x2ef79c[_0xab14('0x3d')],_0x196ba7['filters']));_0x4c698f[_0xab14('0xa3')][_0xab14('0xa4')]=_0xb801e3['id'];if(_0x2ef79c[_0xab14('0x3d')][_0xab14('0xa5')]){_0x4c698f[_0xab14('0xa3')]=_[_0xab14('0x30')](_0x4c698f[_0xab14('0xa3')],{'$or':_[_0xab14('0x36')](_0x4c698f[_0xab14('0x45')],function(_0x108139){var _0x88bfc8={};_0x88bfc8[_0x108139]={'$like':'%'+_0x2ef79c['query'][_0xab14('0xa5')]+'%'};return _0x88bfc8;})});}if(_0x2ef79c[_0xab14('0x3d')][_0xab14('0xa6')]){var _0xa48162=_0x2ef79c[_0xab14('0x3d')]['$gte'][_0xab14('0xa7')](',');var _0x13d414={};_0x13d414[_0xa48162[0x0]]={'$gte':moment(_0xa48162[0x1])[_0xab14('0x84')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4c698f[_0xab14('0xa3')]=_[_0xab14('0x30')](_0x4c698f['where'],_0x13d414);}_0x4c698f=_[_0xab14('0x30')]({},_0x4c698f,_0x2ef79c[_0xab14('0xa8')]);return db[_0xab14('0x61')][_0xab14('0x26')]({'where':_0x4c698f[_0xab14('0xa3')]})[_0xab14('0x29')](function(_0x591450){_0x2a9bc9[_0xab14('0x26')]=_0x591450;if(_0x2ef79c[_0xab14('0x3d')][_0xab14('0xa9')]){_0x4c698f[_0xab14('0x48')]=[{'all':!![]}];}return db[_0xab14('0x61')][_0xab14('0x3b')](_0x4c698f);})[_0xab14('0x29')](function(_0x2f74e4){_0x2a9bc9[_0xab14('0xaa')]=_0x2f74e4;return _0x2a9bc9;});}})[_0xab14('0x29')](respondWithFilteredResult(_0x9a3f60,_0x4c698f))['catch'](handleError(_0x9a3f60,null));};exports[_0xab14('0xab')]=function(_0x36a56b,_0x4c3f7b){var _0x1728fe={'where':{}},_0x44d323={},_0xfb0535={'count':0x0,'rows':[]};return db[_0xab14('0x37')][_0xab14('0x4f')]({'where':{'id':_0x36a56b['params']['id']}})[_0xab14('0x29')](handleEntityNotFound(_0x4c3f7b,null))[_0xab14('0x29')](function(_0x4970ab){if(_0x4970ab){_0x44d323[_0xab14('0x41')]=_[_0xab14('0x42')](db[_0xab14('0x61')][_0xab14('0x38')]);_0x44d323['query']=_[_0xab14('0x42')](_0x36a56b[_0xab14('0x3d')]);_0x44d323[_0xab14('0x43')]=_[_0xab14('0x44')](_0x44d323[_0xab14('0x41')],_0x44d323[_0xab14('0x3d')]);_0x1728fe[_0xab14('0x45')]=_[_0xab14('0x44')](_0x44d323[_0xab14('0x41')],qs[_0xab14('0x46')](_0x36a56b[_0xab14('0x3d')][_0xab14('0x46')]));_0x1728fe[_0xab14('0x45')]=_0x1728fe[_0xab14('0x45')][_0xab14('0x47')]?_0x1728fe['attributes']:_0x44d323[_0xab14('0x41')];if(!_0x36a56b[_0xab14('0x3d')][_0xab14('0x9f')](_0xab14('0xa0'))){_0x1728fe[_0xab14('0x25')]=qs[_0xab14('0x25')](_0x36a56b[_0xab14('0x3d')][_0xab14('0x25')]);_0x1728fe[_0xab14('0x23')]=qs[_0xab14('0x23')](_0x36a56b[_0xab14('0x3d')]['offset']);}_0x1728fe[_0xab14('0xa1')]=qs['sort'](_0x36a56b[_0xab14('0x3d')]['sort']);_0x1728fe[_0xab14('0xa3')]=qs[_0xab14('0x43')](_[_0xab14('0xac')](_0x36a56b[_0xab14('0x3d')],_0x44d323[_0xab14('0x43')]));_0x1728fe[_0xab14('0xa3')][_0xab14('0xa4')]=_0x4970ab['id'];if(_0x36a56b[_0xab14('0x3d')]['filter']){_0x1728fe[_0xab14('0xa3')]=_[_0xab14('0x30')](_0x1728fe['where'],{'$or':_[_0xab14('0x36')](_0x1728fe[_0xab14('0x45')],function(_0x128240){var _0x498474={};_0x498474[_0x128240]={'$like':'%'+_0x36a56b[_0xab14('0x3d')][_0xab14('0xa5')]+'%'};return _0x498474;})});}_0x1728fe[_0xab14('0xa3')][_0xab14('0x91')]=![];if(_0x36a56b['query']['id']){_0x1728fe['where']['id']={'$gt':_0x36a56b['query']['id']};}_0x1728fe=_['merge']({},_0x1728fe,_0x36a56b[_0xab14('0xa8')]);return db[_0xab14('0x61')][_0xab14('0x26')]({'where':_0x1728fe[_0xab14('0xa3')]})[_0xab14('0x29')](function(_0x3d22fa){_0xfb0535[_0xab14('0x26')]=_0x3d22fa;_0x1728fe[_0xab14('0x48')]=[];if(_0x36a56b[_0xab14('0x3d')][_0xab14('0xad')]){_0x1728fe[_0xab14('0x48')][_0xab14('0xae')]({'model':db[_0xab14('0x81')],'as':_0xab14('0x81'),'attributes':['id',_0xab14('0x8c'),_0xab14('0x8b')]});}if(_0x36a56b[_0xab14('0x3d')]['includeAll']){_0x1728fe[_0xab14('0x48')]=[{'all':!![]}];}return db[_0xab14('0x61')][_0xab14('0x3b')](_0x1728fe);})[_0xab14('0x29')](function(_0x4e3d32){_0xfb0535[_0xab14('0xaa')]=_0x4e3d32;return _0xfb0535;});}})[_0xab14('0x29')](respondWithFilteredResult(_0x4c3f7b,_0x1728fe))[_0xab14('0x20')](handleError(_0x4c3f7b,null));};exports['addTags']=function(_0x2396cd,_0x1d4d8c){return db[_0xab14('0x37')][_0xab14('0x49')]({'where':{'id':_0x2396cd[_0xab14('0x40')]['id']}})[_0xab14('0x29')](handleEntityNotFound(_0x1d4d8c,null))[_0xab14('0x29')](function(_0x3b45b3){if(_0x3b45b3){return _0x3b45b3[_0xab14('0xaf')](_0x2396cd[_0xab14('0x31')]['ids'],_[_0xab14('0x9d')](_0x2396cd[_0xab14('0x31')],[_0xab14('0x9c'),'id'])||{})[_0xab14('0xb0')](function(){return db[_0xab14('0xb1')]['findAll']({'attributes':['id','name',_0xab14('0xb2')],'where':{'id':_0x2396cd['body'][_0xab14('0x9c')]}});})[_0xab14('0x29')](function(_0x1a05a6){socket['emit']('chatInteractionTags:save',{'id':Number(_0x2396cd['params']['id']),'tags':_0x1a05a6||[]});return{'id':Number(_0x2396cd[_0xab14('0x40')]['id']),'tags':_0x1a05a6||[]};});}})[_0xab14('0x29')](respondWithResult(_0x1d4d8c,null))['catch'](handleError(_0x1d4d8c,null));};exports[_0xab14('0xb3')]=function(_0x2c4645,_0x26f230){return db[_0xab14('0x37')][_0xab14('0x49')]({'where':{'id':_0x2c4645['params']['id']}})[_0xab14('0x29')](handleEntityNotFound(_0x26f230,null))['then'](function(_0xc0044e){if(_0xc0044e){return _0xc0044e[_0xab14('0xb3')](_0x2c4645[_0xab14('0x3d')][_0xab14('0x9c')]);}})['then'](respondWithStatusCode(_0x26f230,null))['catch'](handleError(_0x26f230,null));};exports[_0xab14('0x7b')]=function(_0x421bfa,_0x1d7dba){var _0x488aca=moment()['unix']()[_0xab14('0xb4')]();var _0x1b2e1d=path[_0xab14('0x78')](config['root'],_0xab14('0xb5'),_0xab14('0xb6'),_0xab14('0xb7'));var _0x4a1e28=path[_0xab14('0x78')](config[_0xab14('0x79')],'server',_0xab14('0xb6'),'attachments');var _0x3e3346=path[_0xab14('0x78')](_0x1b2e1d,_0x488aca);var _0x31f05b=util[_0xab14('0x84')](_0xab14('0xb8'),_0x421bfa[_0xab14('0x40')]['id'],_0x488aca);var _0x2fb24e=path[_0xab14('0x78')](_0x1b2e1d,_0x31f05b);var _0x22a912=[];_0x22a912['push']({'model':db['User'],'as':'User','attributes':['id',_0xab14('0x8c')],'raw':!![]});_0x22a912[_0xab14('0xae')]({'model':db[_0xab14('0x65')],'as':'Contact','attributes':['id',_0xab14('0xb9'),_0xab14('0xba')],'raw':!![]});if(_0x421bfa[_0xab14('0x3d')]['attachments']){_0x22a912['push']({'model':db[_0xab14('0x72')],'as':'Attachment','raw':!![]});}var _0x32a377=[{'model':db[_0xab14('0x61')],'as':'Messages','attributes':['id',_0xab14('0x31'),_0xab14('0x8e'),_0xab14('0x90'),'secret','read'],'include':_0x22a912}];_0x32a377[_0xab14('0xae')]({'model':db[_0xab14('0x4e')],'as':_0xab14('0xbb'),'attributes':['id','name']});_0x32a377[_0xab14('0xae')]({'model':db[_0xab14('0x81')],'as':_0xab14('0xbc'),'attributes':['id',_0xab14('0x8c')]});return db[_0xab14('0x37')][_0xab14('0x49')]({'where':{'id':_0x421bfa[_0xab14('0x40')]['id']},'include':_0x32a377})[_0xab14('0x29')](handleEntityNotFound(_0x1d7dba,null))[_0xab14('0x29')](function(_0x4ed102){if(_0x4ed102){var _0x38494f=_0x4ed102[_0xab14('0xbd')]({'plain':!![]});fs['mkdirSync'](_0x3e3346);var _0x189eaf={'channel':_0xab14('0xbe'),'account':_0x38494f[_0xab14('0xbb')][_0xab14('0x2d')],'agent':_0x38494f[_0xab14('0xbc')]?_0x38494f[_0xab14('0xbc')][_0xab14('0x8c')]:_0xab14('0xbf'),'createdAt':moment(_0x38494f[_0xab14('0x8e')])[_0xab14('0x84')](_0xab14('0xc0'))['toString'](),'closedAt':_0x38494f[_0xab14('0x74')]?moment(_0x38494f[_0xab14('0xc1')])[_0xab14('0x84')](_0xab14('0xc0'))[_0xab14('0xb4')]():'','disposition':_0x38494f['disposition'],'chatInfo':{'browser':_0x38494f[_0xab14('0xc2')],'os':_0x38494f[_0xab14('0xc3')],'referer':_0x38494f[_0xab14('0xc4')],'customerIp':_0x38494f['customerIp'],'customerPort':_0x38494f['customerPort']?_0x38494f[_0xab14('0xc5')]:_0xab14('0xbf')},'messages':_(_0x38494f['Messages'])[_0xab14('0xc6')]()[_0xab14('0xa5')]({'secret':![]})[_0xab14('0x36')](function(_0x5d41b0){if(_0x5d41b0['Attachment']){var _0x54e5c7=path['join'](_0x4a1e28,_0x5d41b0[_0xab14('0x72')][_0xab14('0x6e')]);if(fs[_0xab14('0xc7')](_0x54e5c7)){fs[_0xab14('0xc8')](_0x54e5c7)['pipe'](fs[_0xab14('0xc9')](path[_0xab14('0x78')](_0x3e3346,_0x5d41b0[_0xab14('0x72')]['basename'])));}}return{'date':moment(_0x5d41b0[_0xab14('0x8e')])[_0xab14('0x84')](_0xab14('0xc0'))['toString'](),'sender':_0x5d41b0[_0xab14('0x90')]===_0xab14('0x60')?_0x5d41b0['User']?_0x5d41b0['User'][_0xab14('0x8c')]:'System':_0x5d41b0[_0xab14('0x66')][_0xab14('0xb9')]+(_0x5d41b0[_0xab14('0x66')][_0xab14('0xba')]?'\x20'+_0x5d41b0[_0xab14('0x66')]['lastName']:''),'body':_0x5d41b0[_0xab14('0x72')]?_0x5d41b0[_0xab14('0x72')][_0xab14('0x6e')]:_0x5d41b0[_0xab14('0x31')],'direction':_0x5d41b0[_0xab14('0x90')]==='out'?'A':'C','secret':_0x5d41b0[_0xab14('0x91')],'read':_0x5d41b0[_0xab14('0xca')],'attachment':_0x5d41b0['Attachment']};})[_0xab14('0xcb')]()};return ejs[_0xab14('0xcc')](path[_0xab14('0x78')](config[_0xab14('0x79')],_0xab14('0xb5'),_0xab14('0xcd'),_0xab14('0xce')),{'interaction':_0x189eaf})['then'](function(_0x44f488){var _0xeaadaf=path['join'](_0x3e3346,_0xab14('0xcf')+_0x38494f['id']+'-'+_0x488aca+_0xab14('0xd0'));var _0xd5c989={'path':_0xeaadaf,'channel':_0xab14('0xbe'),'interactionId':_0x38494f['id']};return pdf[_0xab14('0xd1')](_0x44f488,_0xd5c989);})[_0xab14('0x29')](function(){return new Promise(function(_0x18e6bb,_0x17cecc){zipdir(_0x3e3346,{'saveTo':_0x2fb24e},function(_0x28d3d8,_0x592180){if(_0x28d3d8)return _0x17cecc(_0x28d3d8);return _0x18e6bb(_0x592180);});})[_0xab14('0x29')](function(){return new BPromise(function(_0x51ace5,_0x171620){rimraf(_0x3e3346,function(_0x6a9bc8){if(_0x6a9bc8)_0x171620(_0x6a9bc8);return _0x51ace5();});});})[_0xab14('0x29')](function(){return _0x1d7dba[_0xab14('0x7b')](_0x2fb24e,_0x31f05b,function(_0x4b28d8){if(_0x4b28d8){logger[_0xab14('0x1c')](_0xab14('0xd2'),_0x4b28d8);}else{fs[_0xab14('0xd3')](_0x2fb24e);}});});});}else{return _0x1d7dba[_0xab14('0x21')](0xc8);}})['catch'](handleError(_0x1d7dba,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 54aef77..01938bd 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 _0x7b22=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b22,0xde));var _0x27b2=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x7b22[_0x515283];return _0x38f836;};'use strict';var EventEmitter=require(_0x27b2('0x0'));var ChatInteraction=require(_0x27b2('0x1'))['db'][_0x27b2('0x2')];var ChatMessage=require(_0x27b2('0x1'))['db'][_0x27b2('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x27b2('0x4')](0x0);var events={'afterCreate':_0x27b2('0x5'),'afterUpdate':_0x27b2('0x6'),'afterDestroy':_0x27b2('0x7')};function emitEvent(_0x41c8cc){return function(_0x354326,_0x508dd0,_0x5c49a2){_0x354326[_0x27b2('0x8')]({'attributes':['id'],'raw':!![]})[_0x27b2('0x9')](function(_0x208c8d){_0x354326[_0x27b2('0xa')](_0x27b2('0xb'),_0x208c8d[_0x27b2('0xc')](function(_0x1d2da0){return{'id':_0x1d2da0['id']};}));return ChatMessage[_0x27b2('0xd')]({'where':{'ChatInteractionId':_0x354326['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x429613){_0x354326[_0x27b2('0xa')](_0x27b2('0xe'),_0x429613[_0x27b2('0xf')]);ChatInteractionEvents[_0x27b2('0x10')](_0x41c8cc+':'+_0x354326['id'],_0x354326);ChatInteractionEvents[_0x27b2('0x10')](_0x41c8cc,_0x354326);_0x5c49a2(null);})[_0x27b2('0x11')](_0x5c49a2(null));};}for(var e in events){if(events[_0x27b2('0x12')](e)){var event=events[e];ChatInteraction[_0x27b2('0x13')](e,emitEvent(event));}}module[_0x27b2('0x14')]=ChatInteractionEvents; \ No newline at end of file +var _0xf32e=['remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update'];(function(_0xb6d6e4,_0x53b48c){var _0xf76614=function(_0x1d10a6){while(--_0x1d10a6){_0xb6d6e4['push'](_0xb6d6e4['shift']());}};_0xf76614(++_0x53b48c);}(_0xf32e,0x93));var _0xef32=function(_0x1b6557,_0x411984){_0x1b6557=_0x1b6557-0x0;var _0x1ddb5f=_0xf32e[_0x1b6557];return _0x1ddb5f;};'use strict';var EventEmitter=require(_0xef32('0x0'));var ChatInteraction=require(_0xef32('0x1'))['db'][_0xef32('0x2')];var ChatMessage=require(_0xef32('0x1'))['db'][_0xef32('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef32('0x4'),'afterUpdate':_0xef32('0x5'),'afterDestroy':_0xef32('0x6')};function emitEvent(_0x524140){return function(_0x186ea0,_0x5653d2,_0x5009ae){_0x186ea0[_0xef32('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x285c52){_0x186ea0[_0xef32('0x8')](_0xef32('0x9'),_0x285c52[_0xef32('0xa')](function(_0xe304b1){return{'id':_0xe304b1['id']};}));return ChatMessage[_0xef32('0xb')]({'where':{'ChatInteractionId':_0x186ea0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xef32('0xc')](function(_0x2c4f5b){_0x186ea0[_0xef32('0x8')](_0xef32('0xd'),_0x2c4f5b[_0xef32('0xe')]);ChatInteractionEvents[_0xef32('0xf')](_0x524140+':'+_0x186ea0['id'],_0x186ea0);ChatInteractionEvents[_0xef32('0xf')](_0x524140,_0x186ea0);_0x5009ae(null);})['catch'](_0x5009ae(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xef32('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 998543d..9cde1fd 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 _0x1876=['changed','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x3287e1,_0x229d40){var _0x15916f=function(_0x13f898){while(--_0x13f898){_0x3287e1['push'](_0x3287e1['shift']());}};_0x15916f(++_0x229d40);}(_0x1876,0x124));var _0x6187=function(_0xf8cb65,_0x474b75){_0xf8cb65=_0xf8cb65-0x0;var _0x41614f=_0x1876[_0xf8cb65];return _0x41614f;};'use strict';var _=require(_0x6187('0x0'));var util=require(_0x6187('0x1'));var logger=require(_0x6187('0x2'))(_0x6187('0x3'));var moment=require(_0x6187('0x4'));var BPromise=require(_0x6187('0x5'));var rp=require(_0x6187('0x6'));var fs=require('fs');var path=require(_0x6187('0x7'));var rimraf=require(_0x6187('0x8'));var config=require(_0x6187('0x9'));var attributes=require(_0x6187('0xa'));module[_0x6187('0xb')]=function(_0x53c4a9,_0x12d674){return _0x53c4a9[_0x6187('0xc')](_0x6187('0xd'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d577d,_0x3b0709,_0x28bc0b){if(_0x3d577d[_0x6187('0xe')]('closed')){_0x3d577d['closedAt']=moment()[_0x6187('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x28bc0b(null,_0x3d577d);}},'charset':_0x6187('0x10'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x369d=['./chatInteraction.attributes','define','chat_interactions','changed','closed','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x369d,0x1ba));var _0xd369=function(_0x5de154,_0x5d1c77){_0x5de154=_0x5de154-0x0;var _0x1a8650=_0x369d[_0x5de154];return _0x1a8650;};'use strict';var _=require(_0xd369('0x0'));var util=require(_0xd369('0x1'));var logger=require(_0xd369('0x2'))(_0xd369('0x3'));var moment=require(_0xd369('0x4'));var BPromise=require(_0xd369('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd369('0x6'));module['exports']=function(_0xdff293,_0x2c5352){return _0xdff293[_0xd369('0x7')]('ChatInteraction',attributes,{'tableName':_0xd369('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2466f5,_0x1a051c,_0x4fd718){if(_0x2466f5[_0xd369('0x9')](_0xd369('0xa'))){_0x2466f5[_0xd369('0xb')]=moment()[_0xd369('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4fd718(null,_0x2466f5);}},'charset':_0xd369('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 2b4def9..5843b08 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 _0xeddb=['UpdateChatInteraction','ChatInteraction','update','raw','options','attributes','limit','debug','AddTagsToChatInteraction','find','where','body','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x216b9b,_0x1bf025){var _0x51ba89=function(_0x5bab61){while(--_0x5bab61){_0x216b9b['push'](_0x216b9b['shift']());}};_0x51ba89(++_0x1bf025);}(_0xeddb,0x1bd));var _0xbedd=function(_0x436b6e,_0x30ccab){_0x436b6e=_0x436b6e-0x0;var _0x3fe68d=_0xeddb[_0x436b6e];return _0x3fe68d;};'use strict';var _=require(_0xbedd('0x0'));var util=require('util');var moment=require(_0xbedd('0x1'));var BPromise=require(_0xbedd('0x2'));var rs=require(_0xbedd('0x3'));var fs=require('fs');var Redis=require(_0xbedd('0x4'));var db=require(_0xbedd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbedd('0x6'))(_0xbedd('0x7'));var config=require(_0xbedd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbedd('0x9')]({'port':0x232a});config[_0xbedd('0xa')]=_[_0xbedd('0xb')](config[_0xbedd('0xa')],{'host':_0xbedd('0xc'),'port':0x18eb});var socket=require(_0xbedd('0xd'))(new Redis(config[_0xbedd('0xa')]));require(_0xbedd('0xe'))[_0xbedd('0xf')](socket);function respondWithRpcPromise(_0x24f2ec,_0x5b77a2,_0x10597d){return new BPromise(function(_0x73f325,_0x2f7302){return client[_0xbedd('0x10')](_0x24f2ec,_0x10597d)[_0xbedd('0x11')](function(_0x251a5d){logger[_0xbedd('0x12')](_0xbedd('0x13'),_0x5b77a2,_0xbedd('0x14'));logger['debug'](_0xbedd('0x15'),_0x5b77a2,_0xbedd('0x14'),JSON[_0xbedd('0x16')](_0x251a5d));if(_0x251a5d['error']){if(_0x251a5d[_0xbedd('0x17')][_0xbedd('0x18')]===0x1f4){logger[_0xbedd('0x17')](_0xbedd('0x13'),_0x5b77a2,_0x251a5d[_0xbedd('0x17')]['message']);return _0x2f7302(_0x251a5d['error'][_0xbedd('0x19')]);}logger[_0xbedd('0x17')](_0xbedd('0x13'),_0x5b77a2,_0x251a5d['error'][_0xbedd('0x19')]);return _0x73f325(_0x251a5d[_0xbedd('0x17')]['message']);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5b77a2,'request\x20sent');_0x73f325(_0x251a5d[_0xbedd('0x1a')][_0xbedd('0x19')]);}})[_0xbedd('0x1b')](function(_0x2db524){logger['error'](_0xbedd('0x13'),_0x5b77a2,_0x2db524);_0x2f7302(_0x2db524);});});}exports[_0xbedd('0x1c')]=function(_0x1dbc5e){var _0x166a57=this;return new Promise(function(_0x1ba579,_0x4671fe){return db[_0xbedd('0x1d')][_0xbedd('0x1e')](_0x1dbc5e['body'],{'raw':_0x1dbc5e['options']?_0x1dbc5e['options'][_0xbedd('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dbc5e['options']?_0x1dbc5e[_0xbedd('0x20')]['where']||null:null,'attributes':_0x1dbc5e['options']?_0x1dbc5e[_0xbedd('0x20')][_0xbedd('0x21')]||null:null,'limit':_0x1dbc5e['options']?_0x1dbc5e[_0xbedd('0x20')][_0xbedd('0x22')]||null:null})[_0xbedd('0x11')](function(_0x426081){logger[_0xbedd('0x12')](_0xbedd('0x1c'),_0x1dbc5e);logger[_0xbedd('0x23')](_0xbedd('0x1c'),_0x1dbc5e,JSON['stringify'](_0x426081));_0x1ba579(_0x426081);})[_0xbedd('0x1b')](function(_0x3a7ee3){logger[_0xbedd('0x17')](_0xbedd('0x1c'),_0x3a7ee3['message'],_0x1dbc5e);_0x4671fe(_0x166a57[_0xbedd('0x17')](0x1f4,_0x3a7ee3[_0xbedd('0x19')]));});});};exports[_0xbedd('0x24')]=function(_0x3b9b07){return new Promise(function(_0x5c98e5,_0x4db286){return db[_0xbedd('0x1d')][_0xbedd('0x25')]({'where':_0x3b9b07[_0xbedd('0x20')]?_0x3b9b07[_0xbedd('0x20')][_0xbedd('0x26')]||null:null})[_0xbedd('0x11')](function(_0x531a41){if(_0x531a41){return _0x531a41['addTags'](_0x3b9b07[_0xbedd('0x27')][_0xbedd('0x28')],_[_0xbedd('0x29')](_0x3b9b07[_0xbedd('0x27')],[_0xbedd('0x28'),'id'])||{});}})['spread'](function(_0x578d97){logger[_0xbedd('0x12')]('AddTags',_0x3b9b07);logger[_0xbedd('0x23')]('AddTags',_0x3b9b07,JSON[_0xbedd('0x16')](_0x578d97));_0x5c98e5(_0x578d97);})['catch'](function(_0x5a2edb){logger[_0xbedd('0x17')](_0xbedd('0x2a'),_0x5a2edb[_0xbedd('0x19')],_0x3b9b07);_0x4db286(_this[_0xbedd('0x17')](0x1f4,_0x5a2edb['message']));});});}; \ No newline at end of file +var _0x1b21=['UpdateChatInteraction','AddTagsToChatInteraction','where','addTags','ids','AddTags','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatInteraction','body','options','raw','limit'];(function(_0x3ff28a,_0x2d4ab5){var _0x417b81=function(_0x2615fc){while(--_0x2615fc){_0x3ff28a['push'](_0x3ff28a['shift']());}};_0x417b81(++_0x2d4ab5);}(_0x1b21,0x15c));var _0x11b2=function(_0x15558a,_0x52f6e7){_0x15558a=_0x15558a-0x0;var _0x205ba5=_0x1b21[_0x15558a];return _0x205ba5;};'use strict';var _=require(_0x11b2('0x0'));var util=require(_0x11b2('0x1'));var moment=require(_0x11b2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11b2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x11b2('0x4'))(_0x11b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x11b2('0x6'));var client=jayson[_0x11b2('0x7')][_0x11b2('0x8')]({'port':0x232a});config[_0x11b2('0x9')]=_[_0x11b2('0xa')](config[_0x11b2('0x9')],{'host':_0x11b2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x11b2('0x9')]));require(_0x11b2('0xc'))[_0x11b2('0xd')](socket);function respondWithRpcPromise(_0x4e546e,_0x2d1498,_0x3aea2e){return new BPromise(function(_0x3cc85d,_0x34d9fc){return client[_0x11b2('0xe')](_0x4e546e,_0x3aea2e)[_0x11b2('0xf')](function(_0x417020){logger[_0x11b2('0x10')](_0x11b2('0x11'),_0x2d1498,'request\x20sent');logger[_0x11b2('0x12')](_0x11b2('0x13'),_0x2d1498,_0x11b2('0x14'),JSON[_0x11b2('0x15')](_0x417020));if(_0x417020[_0x11b2('0x16')]){if(_0x417020[_0x11b2('0x16')][_0x11b2('0x17')]===0x1f4){logger['error'](_0x11b2('0x11'),_0x2d1498,_0x417020['error'][_0x11b2('0x18')]);return _0x34d9fc(_0x417020['error'][_0x11b2('0x18')]);}logger[_0x11b2('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2d1498,_0x417020['error']['message']);return _0x3cc85d(_0x417020[_0x11b2('0x16')][_0x11b2('0x18')]);}else{logger['info'](_0x11b2('0x11'),_0x2d1498,_0x11b2('0x14'));_0x3cc85d(_0x417020[_0x11b2('0x19')]['message']);}})[_0x11b2('0x1a')](function(_0x37cedf){logger[_0x11b2('0x16')](_0x11b2('0x11'),_0x2d1498,_0x37cedf);_0x34d9fc(_0x37cedf);});});}exports['UpdateChatInteraction']=function(_0x596942){var _0x45577e=this;return new Promise(function(_0x2d85ec,_0x5d587c){return db[_0x11b2('0x1b')]['update'](_0x596942[_0x11b2('0x1c')],{'raw':_0x596942[_0x11b2('0x1d')]?_0x596942['options'][_0x11b2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596942[_0x11b2('0x1d')]?_0x596942['options']['where']||null:null,'attributes':_0x596942[_0x11b2('0x1d')]?_0x596942[_0x11b2('0x1d')]['attributes']||null:null,'limit':_0x596942[_0x11b2('0x1d')]?_0x596942[_0x11b2('0x1d')][_0x11b2('0x1f')]||null:null})['then'](function(_0x68c730){logger[_0x11b2('0x10')](_0x11b2('0x20'),_0x596942);logger[_0x11b2('0x12')](_0x11b2('0x20'),_0x596942,JSON[_0x11b2('0x15')](_0x68c730));_0x2d85ec(_0x68c730);})[_0x11b2('0x1a')](function(_0x1eb862){logger['error']('UpdateChatInteraction',_0x1eb862[_0x11b2('0x18')],_0x596942);_0x5d587c(_0x45577e[_0x11b2('0x16')](0x1f4,_0x1eb862[_0x11b2('0x18')]));});});};exports[_0x11b2('0x21')]=function(_0x491559){return new Promise(function(_0x1f21f5,_0x5048c3){return db[_0x11b2('0x1b')]['find']({'where':_0x491559[_0x11b2('0x1d')]?_0x491559[_0x11b2('0x1d')][_0x11b2('0x22')]||null:null})[_0x11b2('0xf')](function(_0xb9113a){if(_0xb9113a){return _0xb9113a[_0x11b2('0x23')](_0x491559['body'][_0x11b2('0x24')],_['omit'](_0x491559[_0x11b2('0x1c')],[_0x11b2('0x24'),'id'])||{});}})['spread'](function(_0x24c333){logger[_0x11b2('0x10')](_0x11b2('0x25'),_0x491559);logger[_0x11b2('0x12')]('AddTags',_0x491559,JSON[_0x11b2('0x15')](_0x24c333));_0x1f21f5(_0x24c333);})[_0x11b2('0x1a')](function(_0x1566ee){logger['error'](_0x11b2('0x25'),_0x1566ee['message'],_0x491559);_0x5048c3(_this[_0x11b2('0x16')](0x1f4,_0x1566ee[_0x11b2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0fab0f2..dccd43d 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 _0x3702=['removeListener','register','./chatInteraction.events','update','emit'];(function(_0x1d1a24,_0x5b5710){var _0xe4f12d=function(_0x572477){while(--_0x572477){_0x1d1a24['push'](_0x1d1a24['shift']());}};_0xe4f12d(++_0x5b5710);}(_0x3702,0xf7));var _0x2370=function(_0x13f0d8,_0xd2fb78){_0x13f0d8=_0x13f0d8-0x0;var _0x4a2ea8=_0x3702[_0x13f0d8];return _0x4a2ea8;};'use strict';var ChatInteractionEvents=require(_0x2370('0x0'));var events=['save','remove',_0x2370('0x1')];function createListener(_0x210dff,_0x37fc60){return function(_0x59820e){_0x37fc60[_0x2370('0x2')](_0x210dff,_0x59820e);};}function removeListener(_0x52e728,_0xa8c155){return function(){ChatInteractionEvents[_0x2370('0x3')](_0x52e728,_0xa8c155);};}exports[_0x2370('0x4')]=function(_0xcc0f63){for(var _0x1fa355=0x0,_0x4cd7ad=events['length'];_0x1fa355<_0x4cd7ad;_0x1fa355++){var _0x528004=events[_0x1fa355];var _0x1a3001=createListener('chatInteraction:'+_0x528004,_0xcc0f63);ChatInteractionEvents['on'](_0x528004,_0x1a3001);}}; \ No newline at end of file +var _0xefa9=['length','save','remove','update','register'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0xefa9,0x92));var _0x9efa=function(_0x44e2ab,_0x2bc919){_0x44e2ab=_0x44e2ab-0x0;var _0x1c42e1=_0xefa9[_0x44e2ab];return _0x1c42e1;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x9efa('0x0'),_0x9efa('0x1'),_0x9efa('0x2')];function createListener(_0xe9121c,_0x2f65a6){return function(_0x3d192d){_0x2f65a6['emit'](_0xe9121c,_0x3d192d);};}function removeListener(_0x4a1585,_0x5a0f60){return function(){ChatInteractionEvents['removeListener'](_0x4a1585,_0x5a0f60);};}exports[_0x9efa('0x3')]=function(_0x234160){for(var _0x153145=0x0,_0x43bc43=events[_0x9efa('0x4')];_0x153145<_0x43bc43;_0x153145++){var _0x29b698=events[_0x153145];var _0xfaeab1=createListener('chatInteraction:'+_0x29b698,_0x234160);ChatInteractionEvents['on'](_0x29b698,_0xfaeab1);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4658341..017a6ad 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 _0xc864=['removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','post','/:id/vidaoo','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','abandon','/:id/close','delete','chatinteraction:destroy','destroy'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc864,0x134));var _0x4c86=function(_0x1e466c,_0x33d02b){_0x1e466c=_0x1e466c-0x0;var _0x3e17c3=_0xc864[_0x1e466c];return _0x3e17c3;};'use strict';var multer=require(_0x4c86('0x0'));var util=require(_0x4c86('0x1'));var path=require(_0x4c86('0x2'));var timeout=require(_0x4c86('0x3'));var express=require(_0x4c86('0x4'));var router=express[_0x4c86('0x5')]();var fs_extra=require(_0x4c86('0x6'));var auth=require(_0x4c86('0x7'));var interaction=require(_0x4c86('0x8'));var config=require('../../config/environment');var controller=require(_0x4c86('0x9'));router[_0x4c86('0xa')]('/',auth[_0x4c86('0xb')](),controller[_0x4c86('0xc')]);router[_0x4c86('0xa')](_0x4c86('0xd'),auth[_0x4c86('0xb')](),controller[_0x4c86('0xe')]);router[_0x4c86('0xa')](_0x4c86('0xf'),auth[_0x4c86('0x10')](),controller[_0x4c86('0x11')]);router[_0x4c86('0xa')](_0x4c86('0x12'),auth[_0x4c86('0x10')](),controller[_0x4c86('0x13')]);router[_0x4c86('0xa')](_0x4c86('0x14'),auth[_0x4c86('0xb')](),controller['getMessages']);router['get']('/:id/my_messages',auth[_0x4c86('0x10')](),controller[_0x4c86('0x15')]);router[_0x4c86('0xa')]('/:id/download',auth[_0x4c86('0xb')](),controller[_0x4c86('0x16')]);router[_0x4c86('0x17')]('/',auth[_0x4c86('0xb')](),controller['create']);router[_0x4c86('0x17')](_0x4c86('0x18'),auth[_0x4c86('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x593203,_0x31ef37,_0x20bcdc){_0x20bcdc(null,path[_0x4c86('0x19')](config[_0x4c86('0x1a')],_0x4c86('0x1b')));},'filename':function(_0x23791f,_0x3d8e88,_0x52a819){_0x52a819(null,util[_0x4c86('0x1c')](_0x4c86('0x1d'),Date[_0x4c86('0x1e')](),_0x3d8e88[_0x4c86('0x1f')][_0x4c86('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4c86('0x17')](_0x4c86('0x21'),upload[_0x4c86('0x22')](_0x4c86('0x23')),controller[_0x4c86('0x24')]);router[_0x4c86('0x17')](_0x4c86('0x14'),auth[_0x4c86('0x10')](),controller['addMessage']);router[_0x4c86('0x17')]('/:id/tags',auth[_0x4c86('0xb')](),interaction[_0x4c86('0x25')](_0x4c86('0x26'),_0x4c86('0x27')),controller[_0x4c86('0x28')]);router[_0x4c86('0x29')](_0x4c86('0xf'),auth[_0x4c86('0xb')](),interaction[_0x4c86('0x25')]('chat',_0x4c86('0x2a')),controller['update']);router[_0x4c86('0x29')](_0x4c86('0x2b'),controller['customUpdate']);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x4c86('0x2c')]);router[_0x4c86('0x29')](_0x4c86('0x2d'),controller['close']);router[_0x4c86('0x2e')](_0x4c86('0xf'),auth[_0x4c86('0xb')](),interaction[_0x4c86('0x25')](_0x4c86('0x26'),_0x4c86('0x2f')),controller[_0x4c86('0x30')]);router[_0x4c86('0x2e')]('/:id/tags',auth[_0x4c86('0xb')](),controller[_0x4c86('0x31')]);module[_0x4c86('0x32')]=router; \ No newline at end of file +var _0xb125=['removeTags','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy'];(function(_0x371fdd,_0x546ace){var _0x1bbc92=function(_0x11dbd1){while(--_0x11dbd1){_0x371fdd['push'](_0x371fdd['shift']());}};_0x1bbc92(++_0x546ace);}(_0xb125,0x9b));var _0x5b12=function(_0x178bba,_0x1f7e29){_0x178bba=_0x178bba-0x0;var _0x610ebc=_0xb125[_0x178bba];return _0x610ebc;};'use strict';var multer=require(_0x5b12('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5b12('0x1'));var express=require(_0x5b12('0x2'));var router=express[_0x5b12('0x3')]();var fs_extra=require(_0x5b12('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5b12('0x5'));var config=require('../../config/environment');var controller=require(_0x5b12('0x6'));router['get']('/',auth[_0x5b12('0x7')](),controller[_0x5b12('0x8')]);router['get'](_0x5b12('0x9'),auth[_0x5b12('0x7')](),controller[_0x5b12('0xa')]);router[_0x5b12('0xb')](_0x5b12('0xc'),auth[_0x5b12('0xd')](),controller[_0x5b12('0xe')]);router[_0x5b12('0xb')]('/:id/attachment_download',auth[_0x5b12('0xd')](),controller[_0x5b12('0xf')]);router['get'](_0x5b12('0x10'),auth[_0x5b12('0x7')](),controller[_0x5b12('0x11')]);router[_0x5b12('0xb')](_0x5b12('0x12'),auth[_0x5b12('0xd')](),controller['getMyMessages']);router['get'](_0x5b12('0x13'),auth[_0x5b12('0x7')](),controller[_0x5b12('0x14')]);router[_0x5b12('0x15')]('/',auth[_0x5b12('0x7')](),controller[_0x5b12('0x16')]);router[_0x5b12('0x15')]('/:id/vidaoo',auth[_0x5b12('0x7')](),controller[_0x5b12('0x17')]);var upload=multer({'storage':multer[_0x5b12('0x18')]({'destination':function(_0x596f0f,_0x2c066e,_0x3a0b2e){_0x3a0b2e(null,path[_0x5b12('0x19')](config[_0x5b12('0x1a')],_0x5b12('0x1b')));},'filename':function(_0x8f0910,_0x566488,_0x3caa18){_0x3caa18(null,util[_0x5b12('0x1c')](_0x5b12('0x1d'),Date[_0x5b12('0x1e')](),_0x566488[_0x5b12('0x1f')][_0x5b12('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x5b12('0x21'),upload[_0x5b12('0x22')](_0x5b12('0x23')),controller['attachmentUpload']);router[_0x5b12('0x15')](_0x5b12('0x10'),auth[_0x5b12('0xd')](),controller['addMessage']);router[_0x5b12('0x15')](_0x5b12('0x24'),auth[_0x5b12('0x7')](),interaction[_0x5b12('0x25')](_0x5b12('0x26'),_0x5b12('0x27')),controller[_0x5b12('0x28')]);router[_0x5b12('0x29')](_0x5b12('0xc'),auth[_0x5b12('0x7')](),interaction['tracked'](_0x5b12('0x26'),_0x5b12('0x2a')),controller['update']);router[_0x5b12('0x29')](_0x5b12('0x2b'),controller['customUpdate']);router['put'](_0x5b12('0x2c'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x5b12('0x29')](_0x5b12('0x2d'),controller['close']);router[_0x5b12('0x2e')](_0x5b12('0xc'),auth[_0x5b12('0x7')](),interaction['tracked'](_0x5b12('0x26'),_0x5b12('0x2f')),controller[_0x5b12('0x30')]);router[_0x5b12('0x2e')]('/:id/tags',auth[_0x5b12('0x7')](),controller[_0x5b12('0x31')]);module[_0x5b12('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 6e23465..8ae372c 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 _0x1173=['BOOLEAN','sequelize','TEXT','medium'];(function(_0x48d0f3,_0x5a89d2){var _0x263da8=function(_0x44146b){while(--_0x44146b){_0x48d0f3['push'](_0x48d0f3['shift']());}};_0x263da8(++_0x5a89d2);}(_0x1173,0x1b5));var _0x3117=function(_0x51a85c,_0x2660a3){_0x51a85c=_0x51a85c-0x0;var _0x55001f=_0x1173[_0x51a85c];return _0x55001f;};'use strict';var Sequelize=require(_0x3117('0x0'));module['exports']={'body':{'type':Sequelize[_0x3117('0x1')](_0x3117('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3117('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1368=['medium','BOOLEAN','exports','TEXT'];(function(_0x222550,_0x3c0a0c){var _0x58ac61=function(_0x4f7201){while(--_0x4f7201){_0x222550['push'](_0x222550['shift']());}};_0x58ac61(++_0x3c0a0c);}(_0x1368,0x116));var _0x8136=function(_0x206a3b,_0x11b371){_0x206a3b=_0x206a3b-0x0;var _0x46e0ab=_0x1368[_0x206a3b];return _0x46e0ab;};'use strict';var Sequelize=require('sequelize');module[_0x8136('0x0')]={'body':{'type':Sequelize[_0x8136('0x1')](_0x8136('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8136('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 812b30d..de017bf 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 _0x5a4c=['Agents','userProfileId','UserProfileResource','isEmpty','push','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','ChatInternalMessage','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','getUsers','agent','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xe2189d,_0x227a84){var _0x3cebfb=function(_0x3733d4){while(--_0x3733d4){_0xe2189d['push'](_0xe2189d['shift']());}};_0x3cebfb(++_0x227a84);}(_0x5a4c,0xdb));var _0xc5a4=function(_0x561391,_0x548d0c){_0x561391=_0x561391-0x0;var _0x1cfafb=_0x5a4c[_0x561391];return _0x1cfafb;};'use strict';var emlformat=require(_0xc5a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc5a4('0x1'));var jsonpatch=require(_0xc5a4('0x2'));var rp=require(_0xc5a4('0x3'));var moment=require('moment');var BPromise=require(_0xc5a4('0x4'));var Mustache=require('mustache');var util=require(_0xc5a4('0x5'));var path=require(_0xc5a4('0x6'));var sox=require(_0xc5a4('0x7'));var csv=require('to-csv');var ejs=require(_0xc5a4('0x8'));var fs=require('fs');var fs_extra=require(_0xc5a4('0x9'));var _=require(_0xc5a4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5a4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc5a4('0xc'));var querystring=require(_0xc5a4('0xd'));var Papa=require(_0xc5a4('0xe'));var Redis=require(_0xc5a4('0xf'));var authService=require(_0xc5a4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc5a4('0x11'));var hardwareService=require(_0xc5a4('0x12'));var logger=require(_0xc5a4('0x13'))(_0xc5a4('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc5a4('0x15'))['db'];config[_0xc5a4('0x16')]=_[_0xc5a4('0x17')](config[_0xc5a4('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5a4('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x2a88aa,_0x2655f3){_0x2655f3=_0x2655f3||0xcc;return function(_0x2393f3){if(_0x2393f3){return _0x2a88aa['sendStatus'](_0x2655f3);}return _0x2a88aa['status'](_0x2655f3)[_0xc5a4('0x19')]();};}function respondWithResult(_0x1bc942,_0x23efba){_0x23efba=_0x23efba||0xc8;return function(_0x21a963){if(_0x21a963){return _0x1bc942[_0xc5a4('0x1a')](_0x23efba)[_0xc5a4('0x1b')](_0x21a963);}};}function respondWithFilteredResult(_0x419113,_0x245743){return function(_0x25aa2c){if(_0x25aa2c){var _0x5f44a5=typeof _0x245743[_0xc5a4('0x1c')]===_0xc5a4('0x1d')&&typeof _0x245743['limit']===_0xc5a4('0x1d');var _0x188eb7=_0x25aa2c['count'];var _0xaeb72b=_0x5f44a5?0x0:_0x245743[_0xc5a4('0x1c')];var _0xc14a8c=_0x5f44a5?_0x25aa2c['count']:_0x245743[_0xc5a4('0x1c')]+_0x245743[_0xc5a4('0x1e')];var _0xe1a8e0;if(_0xc14a8c>=_0x188eb7){_0xc14a8c=_0x188eb7;_0xe1a8e0=0xc8;}else{_0xe1a8e0=0xce;}_0x419113['status'](_0xe1a8e0);return _0x419113[_0xc5a4('0x1f')](_0xc5a4('0x20'),_0xaeb72b+'-'+_0xc14a8c+'/'+_0x188eb7)[_0xc5a4('0x1b')](_0x25aa2c);}return null;};}function patchUpdates(_0x277a82){return function(_0x249e99){try{jsonpatch[_0xc5a4('0x21')](_0x249e99,_0x277a82,!![]);}catch(_0x5421be){return BPromise[_0xc5a4('0x22')](_0x5421be);}return _0x249e99[_0xc5a4('0x23')]();};}function saveUpdates(_0x3d3e2b,_0x162d9c){return function(_0x253992){if(_0x253992){return _0x253992['update'](_0x3d3e2b)[_0xc5a4('0x24')](function(_0x4f2a95){return _0x4f2a95;});}return null;};}function removeEntity(_0x7add19,_0x416d3e){return function(_0x31c31c){if(_0x31c31c){return _0x31c31c[_0xc5a4('0x25')]()[_0xc5a4('0x24')](function(){_0x7add19[_0xc5a4('0x1a')](0xcc)[_0xc5a4('0x19')]();});}};}function handleEntityNotFound(_0x55e3c7,_0x573bcf){return function(_0x28fc46){if(!_0x28fc46){_0x55e3c7[_0xc5a4('0x26')](0x194);}return _0x28fc46;};}function handleError(_0x38bc79,_0x1b09f9){_0x1b09f9=_0x1b09f9||0x1f4;return function(_0xb93919){logger[_0xc5a4('0x27')](_0xb93919[_0xc5a4('0x28')]);if(_0xb93919[_0xc5a4('0x29')]){delete _0xb93919[_0xc5a4('0x29')];}_0x38bc79['status'](_0x1b09f9)['send'](_0xb93919);};}exports[_0xc5a4('0x2a')]=function(_0x3f4c71,_0xcee77){var _0x80b9ab={},_0x17d292={},_0x1ed44b={'count':0x0,'rows':[]};var _0x2d963e=_[_0xc5a4('0x2b')](db[_0xc5a4('0x2c')]['rawAttributes'],function(_0x1de1c4){return{'name':_0x1de1c4['fieldName'],'type':_0x1de1c4[_0xc5a4('0x2d')][_0xc5a4('0x2e')]};});_0x17d292['model']=_[_0xc5a4('0x2b')](_0x2d963e,_0xc5a4('0x29'));_0x17d292[_0xc5a4('0x2f')]=_[_0xc5a4('0x30')](_0x3f4c71[_0xc5a4('0x2f')]);_0x17d292['filters']=_[_0xc5a4('0x31')](_0x17d292['model'],_0x17d292[_0xc5a4('0x2f')]);_0x80b9ab[_0xc5a4('0x32')]=_['intersection'](_0x17d292['model'],qs[_0xc5a4('0x33')](_0x3f4c71[_0xc5a4('0x2f')][_0xc5a4('0x33')]));_0x80b9ab[_0xc5a4('0x32')]=_0x80b9ab[_0xc5a4('0x32')][_0xc5a4('0x34')]?_0x80b9ab[_0xc5a4('0x32')]:_0x17d292[_0xc5a4('0x35')];if(!_0x3f4c71['query'][_0xc5a4('0x36')](_0xc5a4('0x37'))){_0x80b9ab[_0xc5a4('0x1e')]=qs['limit'](_0x3f4c71[_0xc5a4('0x2f')][_0xc5a4('0x1e')]);_0x80b9ab['offset']=qs['offset'](_0x3f4c71[_0xc5a4('0x2f')][_0xc5a4('0x1c')]);}_0x80b9ab[_0xc5a4('0x38')]=qs['sort'](_0x3f4c71[_0xc5a4('0x2f')]['sort']);_0x80b9ab['where']=qs[_0xc5a4('0x39')](_[_0xc5a4('0x3a')](_0x3f4c71[_0xc5a4('0x2f')],_0x17d292[_0xc5a4('0x39')]),_0x2d963e);if(_0x3f4c71['query'][_0xc5a4('0x3b')]){_0x80b9ab[_0xc5a4('0x3c')]=_[_0xc5a4('0x3d')](_0x80b9ab[_0xc5a4('0x3c')],{'$or':_[_0xc5a4('0x2b')](_0x2d963e,function(_0xa8f2df){if(_0xa8f2df[_0xc5a4('0x2d')]!==_0xc5a4('0x3e')){var _0x43049f={};_0x43049f[_0xa8f2df[_0xc5a4('0x29')]]={'$like':'%'+_0x3f4c71[_0xc5a4('0x2f')][_0xc5a4('0x3b')]+'%'};return _0x43049f;}})});}_0x80b9ab=_['merge']({},_0x80b9ab,_0x3f4c71[_0xc5a4('0x3f')]);var _0x1c5a04={'where':_0x80b9ab['where']};return db['ChatInternalMessage'][_0xc5a4('0x40')](_0x1c5a04)[_0xc5a4('0x24')](function(_0x22f7bc){_0x1ed44b[_0xc5a4('0x40')]=_0x22f7bc;if(_0x3f4c71[_0xc5a4('0x2f')][_0xc5a4('0x41')]){_0x80b9ab[_0xc5a4('0x42')]=[{'all':!![]}];}return db[_0xc5a4('0x2c')][_0xc5a4('0x43')](_0x80b9ab);})[_0xc5a4('0x24')](function(_0x64b449){_0x1ed44b['rows']=_0x64b449;return _0x1ed44b;})[_0xc5a4('0x24')](respondWithFilteredResult(_0xcee77,_0x80b9ab))[_0xc5a4('0x44')](handleError(_0xcee77,null));};exports[_0xc5a4('0x45')]=function(_0x560a43,_0x49ba75){var _0x40f6cb={'raw':!![],'where':{'id':_0x560a43[_0xc5a4('0x46')]['id']}},_0x2d1278={};_0x2d1278['model']=_['keys'](db[_0xc5a4('0x2c')]['rawAttributes']);_0x2d1278[_0xc5a4('0x2f')]=_[_0xc5a4('0x30')](_0x560a43['query']);_0x2d1278['filters']=_[_0xc5a4('0x31')](_0x2d1278['model'],_0x2d1278[_0xc5a4('0x2f')]);_0x40f6cb[_0xc5a4('0x32')]=_['intersection'](_0x2d1278[_0xc5a4('0x35')],qs[_0xc5a4('0x33')](_0x560a43[_0xc5a4('0x2f')][_0xc5a4('0x33')]));_0x40f6cb[_0xc5a4('0x32')]=_0x40f6cb[_0xc5a4('0x32')][_0xc5a4('0x34')]?_0x40f6cb[_0xc5a4('0x32')]:_0x2d1278[_0xc5a4('0x35')];if(_0x560a43['query'][_0xc5a4('0x41')]){_0x40f6cb[_0xc5a4('0x42')]=[{'all':!![]}];}_0x40f6cb=_[_0xc5a4('0x3d')]({},_0x40f6cb,_0x560a43[_0xc5a4('0x3f')]);return db['ChatInternalMessage'][_0xc5a4('0x47')](_0x40f6cb)[_0xc5a4('0x24')](handleEntityNotFound(_0x49ba75,null))[_0xc5a4('0x24')](respondWithResult(_0x49ba75,null))[_0xc5a4('0x44')](handleError(_0x49ba75,null));};exports['create']=function(_0x4f983e,_0x3ae643){return db['ChatInternalMessage'][_0xc5a4('0x48')](_0x4f983e[_0xc5a4('0x49')],{})[_0xc5a4('0x24')](respondWithResult(_0x3ae643,0xc9))[_0xc5a4('0x44')](handleError(_0x3ae643,null));};exports['update']=function(_0x112027,_0x2fa9ae){if(_0x112027[_0xc5a4('0x49')]['id']){delete _0x112027[_0xc5a4('0x49')]['id'];}return db[_0xc5a4('0x2c')][_0xc5a4('0x47')]({'where':{'id':_0x112027[_0xc5a4('0x46')]['id']}})['then'](handleEntityNotFound(_0x2fa9ae,null))[_0xc5a4('0x24')](saveUpdates(_0x112027['body'],null))[_0xc5a4('0x24')](respondWithResult(_0x2fa9ae,null))[_0xc5a4('0x44')](handleError(_0x2fa9ae,null));};exports[_0xc5a4('0x25')]=function(_0x3f4f90,_0x3af2a8){return db[_0xc5a4('0x2c')][_0xc5a4('0x47')]({'where':{'id':_0x3f4f90[_0xc5a4('0x46')]['id']}})['then'](handleEntityNotFound(_0x3af2a8,null))['then'](removeEntity(_0x3af2a8,null))[_0xc5a4('0x44')](handleError(_0x3af2a8,null));};exports[_0xc5a4('0x4a')]=function(_0x188e9f,_0x551e96){return db['ChatInternalMessage'][_0xc5a4('0x4a')]()[_0xc5a4('0x24')](respondWithResult(_0x551e96,null))[_0xc5a4('0x44')](handleError(_0x551e96,null));};function wrapUser(_0x5a6120){return function(_0x3406af){var _0x3fb610=_0x5a6120['get']({'plain':!![]});_0x3fb610[_0xc5a4('0x4b')]=[];if(_0x3406af){_0x3fb610[_0xc5a4('0x4c')]=_0x3406af[_0xc5a4('0x4d')];_0x3fb610[_0xc5a4('0x4e')]=_0x3406af;}else{_0x3fb610[_0xc5a4('0x4c')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3fb610[_0xc5a4('0x4e')]={};}return _0x3fb610;};}exports[_0xc5a4('0x4f')]=function(_0x5f29dd,_0x5ef31a,_0x3e2306){var _0x53f31e=[];return db['User'][_0xc5a4('0x43')]({'where':{'role':[_0xc5a4('0x50'),'admin',_0xc5a4('0x51')]},'attributes':['id',_0xc5a4('0x52'),_0xc5a4('0x29'),_0xc5a4('0x53'),_0xc5a4('0x54'),_0xc5a4('0x55'),_0xc5a4('0x56'),_0xc5a4('0x57'),_0xc5a4('0x58'),_0xc5a4('0x59')],'order':qs[_0xc5a4('0x5a')](_0xc5a4('0x5b')),'include':[{'model':db[_0xc5a4('0x5c')],'as':_0xc5a4('0x5d'),'attributes':['id','name',_0xc5a4('0x2d')],'through':{'attributes':[]}}]})[_0xc5a4('0x24')](function(_0xc59b7e){if(_0xc59b7e){var _0x395762=_0x5f29dd[_0xc5a4('0x51')][_0xc5a4('0x5e')]({'plain':!![]});if(!_0x395762)throw new Error(_0xc5a4('0x5f'));if(_0x395762['role']===_0xc5a4('0x51')){return db['UserProfileSection'][_0xc5a4('0x47')]({'where':{'name':_0xc5a4('0x60'),'userProfileId':_0x395762[_0xc5a4('0x61')]},'raw':!![]})['then'](function(_0x5e7b6c){if(_0x5e7b6c){if(_0x5e7b6c['autoAssociation']===0x0){return db[_0xc5a4('0x62')][_0xc5a4('0x43')]({'where':{'sectionId':_0x5e7b6c['id']},'raw':!![]})[_0xc5a4('0x24')](function(_0x15d729){var _0x374bf5=[];if(_[_0xc5a4('0x63')](_0x15d729)){_0x374bf5=_['filter'](_0xc59b7e,function(_0x3f21a9){if(_0x3f21a9[_0xc5a4('0x53')]!==_0xc5a4('0x50')){return _0x3f21a9;}});return _0x374bf5;}else{for(var _0x36a520=0x0;_0x36a520<_0xc59b7e[_0xc5a4('0x34')];_0x36a520++){var _0x484e76=_0xc59b7e[_0x36a520];if(_0x484e76[_0xc5a4('0x53')]===_0xc5a4('0x50')){var _0x2cac29=_[_0xc5a4('0x47')](_0x15d729,function(_0x41266b){return _0x41266b['resourceId']===_0x484e76['id'];});if(_0x2cac29)_0x374bf5[_0xc5a4('0x64')](_0x484e76);}else{_0x374bf5['push'](_0x484e76);}}return _0x374bf5;}});}else{return _0xc59b7e;}}else{var _0x409c2f=_[_0xc5a4('0x3b')](_0xc59b7e,function(_0x5d3882){if(_0x5d3882[_0xc5a4('0x53')]!==_0xc5a4('0x50')){return _0x5d3882;}});return _0x409c2f;}});}else{return _0xc59b7e;}}})[_0xc5a4('0x24')](function(_0x144062){var _0x1c0722=[];if(_0x144062){_0x53f31e=_0x144062;for(var _0x496c98=0x0;_0x496c98<_0x144062['length'];_0x496c98+=0x1){_0x53f31e[_0x496c98][_0xc5a4('0x4b')]=[];_0x1c0722[_0xc5a4('0x64')](db[_0xc5a4('0x2c')][_0xc5a4('0x47')]({'where':{'FromId':[_0x5f29dd[_0xc5a4('0x51')]['id'],_0x144062[_0x496c98]['id']],'ToId':[_0x5f29dd['user']['id'],_0x144062[_0x496c98]['id']],'ChatGroupId':null},'attributes':['id',_0xc5a4('0x4d'),_0xc5a4('0x65'),_0xc5a4('0x66'),_0xc5a4('0x67'),_0xc5a4('0x49')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc5a4('0x24')](wrapUser(_0x144062[_0x496c98])));}return BPromise[_0xc5a4('0x68')](_0x1c0722);}return[];})[_0xc5a4('0x24')](function(_0x2d9085){return{'rows':_0x2d9085,'count':_0x2d9085[_0xc5a4('0x34')]};})[_0xc5a4('0x24')](respondWithResult(_0x5ef31a,null))[_0xc5a4('0x44')](handleError(_0x5ef31a,null));}; \ No newline at end of file +var _0x988a=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','rows','catch','show','keys','length','include','options','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','getUsers','User','findAll','agent','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x583130,_0x523059){var _0x5ab161=function(_0x4b340e){while(--_0x4b340e){_0x583130['push'](_0x583130['shift']());}};_0x5ab161(++_0x523059);}(_0x988a,0x12d));var _0xa988=function(_0x7744bf,_0x2f2270){_0x7744bf=_0x7744bf-0x0;var _0x1a34ac=_0x988a[_0x7744bf];return _0x1a34ac;};'use strict';var emlformat=require(_0xa988('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa988('0x1'));var jsonpatch=require(_0xa988('0x2'));var rp=require(_0xa988('0x3'));var moment=require(_0xa988('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa988('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa988('0x6'));var ejs=require(_0xa988('0x7'));var fs=require('fs');var fs_extra=require(_0xa988('0x8'));var _=require('lodash');var squel=require(_0xa988('0x9'));var crypto=require('crypto');var jsforce=require(_0xa988('0xa'));var deskjs=require(_0xa988('0xb'));var toCsv=require(_0xa988('0x6'));var querystring=require('querystring');var Papa=require(_0xa988('0xc'));var Redis=require(_0xa988('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa988('0xe'));var as=require(_0xa988('0xf'));var hardwareService=require(_0xa988('0x10'));var logger=require(_0xa988('0x11'))(_0xa988('0x12'));var utils=require(_0xa988('0x13'));var config=require(_0xa988('0x14'));var licenseUtil=require(_0xa988('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa988('0x16')](config[_0xa988('0x17')],{'host':_0xa988('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa988('0x17')]));require(_0xa988('0x19'))[_0xa988('0x1a')](socket);function respondWithStatusCode(_0x5178f8,_0x34fef4){_0x34fef4=_0x34fef4||0xcc;return function(_0x16547a){if(_0x16547a){return _0x5178f8[_0xa988('0x1b')](_0x34fef4);}return _0x5178f8['status'](_0x34fef4)[_0xa988('0x1c')]();};}function respondWithResult(_0x8bb3e7,_0x35a9ec){_0x35a9ec=_0x35a9ec||0xc8;return function(_0xe21025){if(_0xe21025){return _0x8bb3e7[_0xa988('0x1d')](_0x35a9ec)['json'](_0xe21025);}};}function respondWithFilteredResult(_0x2b68a2,_0x5f0509){return function(_0x4b07d8){if(_0x4b07d8){var _0x33b2aa=typeof _0x5f0509[_0xa988('0x1e')]===_0xa988('0x1f')&&typeof _0x5f0509[_0xa988('0x20')]===_0xa988('0x1f');var _0x405117=_0x4b07d8[_0xa988('0x21')];var _0x2afbfb=_0x33b2aa?0x0:_0x5f0509[_0xa988('0x1e')];var _0x82bae5=_0x33b2aa?_0x4b07d8[_0xa988('0x21')]:_0x5f0509[_0xa988('0x1e')]+_0x5f0509[_0xa988('0x20')];var _0x1db980;if(_0x82bae5>=_0x405117){_0x82bae5=_0x405117;_0x1db980=0xc8;}else{_0x1db980=0xce;}_0x2b68a2[_0xa988('0x1d')](_0x1db980);return _0x2b68a2[_0xa988('0x22')](_0xa988('0x23'),_0x2afbfb+'-'+_0x82bae5+'/'+_0x405117)[_0xa988('0x24')](_0x4b07d8);}return null;};}function patchUpdates(_0x2afa59){return function(_0x3bc249){try{jsonpatch[_0xa988('0x25')](_0x3bc249,_0x2afa59,!![]);}catch(_0x11e5a6){return BPromise[_0xa988('0x26')](_0x11e5a6);}return _0x3bc249[_0xa988('0x27')]();};}function saveUpdates(_0x14aed4,_0x180cd4){return function(_0x4e6377){if(_0x4e6377){return _0x4e6377[_0xa988('0x28')](_0x14aed4)['then'](function(_0x4dc8ab){return _0x4dc8ab;});}return null;};}function removeEntity(_0x29b271,_0x331d12){return function(_0x3fdbd8){if(_0x3fdbd8){return _0x3fdbd8[_0xa988('0x29')]()[_0xa988('0x2a')](function(){_0x29b271['status'](0xcc)[_0xa988('0x1c')]();});}};}function handleEntityNotFound(_0x271d4c,_0x41c9dc){return function(_0x419f6f){if(!_0x419f6f){_0x271d4c[_0xa988('0x1b')](0x194);}return _0x419f6f;};}function handleError(_0x2da918,_0x42957a){_0x42957a=_0x42957a||0x1f4;return function(_0x879528){logger[_0xa988('0x2b')](_0x879528[_0xa988('0x2c')]);if(_0x879528[_0xa988('0x2d')]){delete _0x879528[_0xa988('0x2d')];}_0x2da918[_0xa988('0x1d')](_0x42957a)[_0xa988('0x2e')](_0x879528);};}exports['index']=function(_0x5c1af3,_0xd56c23){var _0x1cb08b={},_0x3c8cf6={},_0x4b0de3={'count':0x0,'rows':[]};var _0x5069ed=_[_0xa988('0x2f')](db[_0xa988('0x30')][_0xa988('0x31')],function(_0x5b3b7d){return{'name':_0x5b3b7d['fieldName'],'type':_0x5b3b7d[_0xa988('0x32')]['key']};});_0x3c8cf6['model']=_[_0xa988('0x2f')](_0x5069ed,_0xa988('0x2d'));_0x3c8cf6[_0xa988('0x33')]=_['keys'](_0x5c1af3['query']);_0x3c8cf6[_0xa988('0x34')]=_[_0xa988('0x35')](_0x3c8cf6[_0xa988('0x36')],_0x3c8cf6[_0xa988('0x33')]);_0x1cb08b[_0xa988('0x37')]=_[_0xa988('0x35')](_0x3c8cf6['model'],qs[_0xa988('0x38')](_0x5c1af3['query'][_0xa988('0x38')]));_0x1cb08b[_0xa988('0x37')]=_0x1cb08b[_0xa988('0x37')]['length']?_0x1cb08b['attributes']:_0x3c8cf6[_0xa988('0x36')];if(!_0x5c1af3['query'][_0xa988('0x39')](_0xa988('0x3a'))){_0x1cb08b[_0xa988('0x20')]=qs[_0xa988('0x20')](_0x5c1af3['query'][_0xa988('0x20')]);_0x1cb08b[_0xa988('0x1e')]=qs[_0xa988('0x1e')](_0x5c1af3['query']['offset']);}_0x1cb08b[_0xa988('0x3b')]=qs[_0xa988('0x3c')](_0x5c1af3[_0xa988('0x33')]['sort']);_0x1cb08b[_0xa988('0x3d')]=qs['filters'](_['pick'](_0x5c1af3[_0xa988('0x33')],_0x3c8cf6[_0xa988('0x34')]),_0x5069ed);if(_0x5c1af3['query'][_0xa988('0x3e')]){_0x1cb08b[_0xa988('0x3d')]=_[_0xa988('0x3f')](_0x1cb08b[_0xa988('0x3d')],{'$or':_['map'](_0x5069ed,function(_0x457a18){if(_0x457a18[_0xa988('0x32')]!=='VIRTUAL'){var _0xcde034={};_0xcde034[_0x457a18[_0xa988('0x2d')]]={'$like':'%'+_0x5c1af3[_0xa988('0x33')]['filter']+'%'};return _0xcde034;}})});}_0x1cb08b=_['merge']({},_0x1cb08b,_0x5c1af3['options']);var _0x186cdf={'where':_0x1cb08b[_0xa988('0x3d')]};return db[_0xa988('0x30')][_0xa988('0x21')](_0x186cdf)[_0xa988('0x2a')](function(_0xf43f17){_0x4b0de3[_0xa988('0x21')]=_0xf43f17;if(_0x5c1af3['query'][_0xa988('0x40')]){_0x1cb08b['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x1cb08b);})[_0xa988('0x2a')](function(_0x5b3fd9){_0x4b0de3[_0xa988('0x41')]=_0x5b3fd9;return _0x4b0de3;})['then'](respondWithFilteredResult(_0xd56c23,_0x1cb08b))[_0xa988('0x42')](handleError(_0xd56c23,null));};exports[_0xa988('0x43')]=function(_0x55c4bd,_0x4e155c){var _0xf0150c={'raw':!![],'where':{'id':_0x55c4bd['params']['id']}},_0x433a73={};_0x433a73['model']=_[_0xa988('0x44')](db[_0xa988('0x30')][_0xa988('0x31')]);_0x433a73[_0xa988('0x33')]=_[_0xa988('0x44')](_0x55c4bd[_0xa988('0x33')]);_0x433a73[_0xa988('0x34')]=_[_0xa988('0x35')](_0x433a73['model'],_0x433a73['query']);_0xf0150c[_0xa988('0x37')]=_[_0xa988('0x35')](_0x433a73[_0xa988('0x36')],qs[_0xa988('0x38')](_0x55c4bd[_0xa988('0x33')]['fields']));_0xf0150c[_0xa988('0x37')]=_0xf0150c[_0xa988('0x37')][_0xa988('0x45')]?_0xf0150c[_0xa988('0x37')]:_0x433a73[_0xa988('0x36')];if(_0x55c4bd[_0xa988('0x33')][_0xa988('0x40')]){_0xf0150c[_0xa988('0x46')]=[{'all':!![]}];}_0xf0150c=_[_0xa988('0x3f')]({},_0xf0150c,_0x55c4bd[_0xa988('0x47')]);return db[_0xa988('0x30')][_0xa988('0x48')](_0xf0150c)['then'](handleEntityNotFound(_0x4e155c,null))['then'](respondWithResult(_0x4e155c,null))[_0xa988('0x42')](handleError(_0x4e155c,null));};exports[_0xa988('0x49')]=function(_0x3bf684,_0x1ed8a8){return db['ChatInternalMessage'][_0xa988('0x49')](_0x3bf684[_0xa988('0x4a')],{})[_0xa988('0x2a')](respondWithResult(_0x1ed8a8,0xc9))['catch'](handleError(_0x1ed8a8,null));};exports[_0xa988('0x28')]=function(_0x442c3c,_0x25b77e){if(_0x442c3c[_0xa988('0x4a')]['id']){delete _0x442c3c[_0xa988('0x4a')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x442c3c[_0xa988('0x4b')]['id']}})[_0xa988('0x2a')](handleEntityNotFound(_0x25b77e,null))[_0xa988('0x2a')](saveUpdates(_0x442c3c[_0xa988('0x4a')],null))[_0xa988('0x2a')](respondWithResult(_0x25b77e,null))[_0xa988('0x42')](handleError(_0x25b77e,null));};exports[_0xa988('0x29')]=function(_0xbe7995,_0x42d06e){return db[_0xa988('0x30')][_0xa988('0x48')]({'where':{'id':_0xbe7995[_0xa988('0x4b')]['id']}})[_0xa988('0x2a')](handleEntityNotFound(_0x42d06e,null))[_0xa988('0x2a')](removeEntity(_0x42d06e,null))['catch'](handleError(_0x42d06e,null));};exports[_0xa988('0x4c')]=function(_0x43d697,_0x3898a9){return db[_0xa988('0x30')]['describe']()[_0xa988('0x2a')](respondWithResult(_0x3898a9,null))[_0xa988('0x42')](handleError(_0x3898a9,null));};function wrapUser(_0x579a5c){return function(_0x3b9674){var _0x4c465a=_0x579a5c[_0xa988('0x4d')]({'plain':!![]});_0x4c465a['messages']=[];if(_0x3b9674){_0x4c465a[_0xa988('0x4e')]=_0x3b9674[_0xa988('0x4f')];_0x4c465a[_0xa988('0x50')]=_0x3b9674;}else{_0x4c465a[_0xa988('0x4e')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c465a['lastMessage']={};}return _0x4c465a;};}exports[_0xa988('0x51')]=function(_0x7b6961,_0x14c3c2,_0x419c80){var _0x4f8266=[];return db[_0xa988('0x52')][_0xa988('0x53')]({'where':{'role':[_0xa988('0x54'),'admin',_0xa988('0x55')]},'attributes':['id',_0xa988('0x56'),'name',_0xa988('0x57'),_0xa988('0x58'),_0xa988('0x59'),_0xa988('0x5a'),'lastLoginAt',_0xa988('0x5b'),_0xa988('0x5c')],'order':qs['sort']('-online'),'include':[{'model':db[_0xa988('0x5d')],'as':_0xa988('0x5e'),'attributes':['id',_0xa988('0x2d'),_0xa988('0x32')],'through':{'attributes':[]}}]})[_0xa988('0x2a')](function(_0x2fc0cf){if(_0x2fc0cf){var _0xff68bb=_0x7b6961[_0xa988('0x55')]['get']({'plain':!![]});if(!_0xff68bb)throw new Error(_0xa988('0x5f'));if(_0xff68bb['role']===_0xa988('0x55')){return db[_0xa988('0x60')]['find']({'where':{'name':'Agents','userProfileId':_0xff68bb[_0xa988('0x61')]},'raw':!![]})[_0xa988('0x2a')](function(_0x575bdb){if(_0x575bdb){if(_0x575bdb[_0xa988('0x62')]===0x0){return db[_0xa988('0x63')][_0xa988('0x53')]({'where':{'sectionId':_0x575bdb['id']},'raw':!![]})['then'](function(_0x5e1232){var _0x11e9b3=[];if(_[_0xa988('0x64')](_0x5e1232)){_0x11e9b3=_[_0xa988('0x3e')](_0x2fc0cf,function(_0x45659c){if(_0x45659c['role']!=='agent'){return _0x45659c;}});return _0x11e9b3;}else{for(var _0x332d64=0x0;_0x332d64<_0x2fc0cf[_0xa988('0x45')];_0x332d64++){var _0x55e04d=_0x2fc0cf[_0x332d64];if(_0x55e04d[_0xa988('0x57')]===_0xa988('0x54')){var _0x658b0b=_[_0xa988('0x48')](_0x5e1232,function(_0x2823c0){return _0x2823c0['resourceId']===_0x55e04d['id'];});if(_0x658b0b)_0x11e9b3['push'](_0x55e04d);}else{_0x11e9b3['push'](_0x55e04d);}}return _0x11e9b3;}});}else{return _0x2fc0cf;}}else{var _0x499f53=_[_0xa988('0x3e')](_0x2fc0cf,function(_0x37cb86){if(_0x37cb86['role']!==_0xa988('0x54')){return _0x37cb86;}});return _0x499f53;}});}else{return _0x2fc0cf;}}})[_0xa988('0x2a')](function(_0x2df4b2){var _0x637b76=[];if(_0x2df4b2){_0x4f8266=_0x2df4b2;for(var _0x35e3c0=0x0;_0x35e3c0<_0x2df4b2[_0xa988('0x45')];_0x35e3c0+=0x1){_0x4f8266[_0x35e3c0]['messages']=[];_0x637b76[_0xa988('0x65')](db[_0xa988('0x30')]['find']({'where':{'FromId':[_0x7b6961['user']['id'],_0x2df4b2[_0x35e3c0]['id']],'ToId':[_0x7b6961[_0xa988('0x55')]['id'],_0x2df4b2[_0x35e3c0]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa988('0x66'),_0xa988('0x67'),_0xa988('0x68'),_0xa988('0x4a')],'order':qs[_0xa988('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2df4b2[_0x35e3c0])));}return BPromise[_0xa988('0x69')](_0x637b76);}return[];})[_0xa988('0x2a')](function(_0x285d83){return{'rows':_0x285d83,'count':_0x285d83[_0xa988('0x45')]};})[_0xa988('0x2a')](respondWithResult(_0x14c3c2,null))[_0xa988('0x42')](handleError(_0x14c3c2,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 6ede6f2..85be7fc 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 _0x6f24=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x36fcfc,_0x2b2b5d){var _0x308648=function(_0x3d8ce3){while(--_0x3d8ce3){_0x36fcfc['push'](_0x36fcfc['shift']());}};_0x308648(++_0x2b2b5d);}(_0x6f24,0x76));var _0x46f2=function(_0x4a0f16,_0x21ba18){_0x4a0f16=_0x4a0f16-0x0;var _0x45d653=_0x6f24[_0x4a0f16];return _0x45d653;};'use strict';var EventEmitter=require(_0x46f2('0x0'));var ChatInternalMessage=require(_0x46f2('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x46f2('0x2')](0x0);var events={'afterCreate':_0x46f2('0x3'),'afterUpdate':_0x46f2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2969e4){return function(_0x5d4655,_0x5da2a8,_0x37b138){ChatInternalMessageEvents[_0x46f2('0x5')](_0x2969e4+':'+_0x5d4655['id'],_0x5d4655);ChatInternalMessageEvents[_0x46f2('0x5')](_0x2969e4,_0x5d4655);_0x37b138(null);};}for(var e in events){if(events[_0x46f2('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x46f2('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x7462=['events','../../mysqldb','save','emit','hasOwnProperty','hook','exports'];(function(_0x7218f3,_0x1c4bc9){var _0x42067d=function(_0x59fd64){while(--_0x59fd64){_0x7218f3['push'](_0x7218f3['shift']());}};_0x42067d(++_0x1c4bc9);}(_0x7462,0x165));var _0x2746=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x7462[_0x5471ec];return _0x121d4c;};'use strict';var EventEmitter=require(_0x2746('0x0'));var ChatInternalMessage=require(_0x2746('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2746('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a2c7f){return function(_0x2274b7,_0x57c788,_0x2afbbd){ChatInternalMessageEvents[_0x2746('0x3')](_0x3a2c7f+':'+_0x2274b7['id'],_0x2274b7);ChatInternalMessageEvents[_0x2746('0x3')](_0x3a2c7f,_0x2274b7);_0x2afbbd(null);};}for(var e in events){if(events[_0x2746('0x4')](e)){var event=events[e];ChatInternalMessage[_0x2746('0x5')](e,emitEvent(event));}}module[_0x2746('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c58fead..c7a40ea 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 _0xd3fd=['rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xd3fd,0xca));var _0xdd3f=function(_0x4d41f3,_0x3e9c2b){_0x4d41f3=_0x4d41f3-0x0;var _0x260903=_0xd3fd[_0x4d41f3];return _0x260903;};'use strict';var _=require(_0xdd3f('0x0'));var util=require(_0xdd3f('0x1'));var logger=require(_0xdd3f('0x2'))(_0xdd3f('0x3'));var moment=require(_0xdd3f('0x4'));var BPromise=require(_0xdd3f('0x5'));var rp=require(_0xdd3f('0x6'));var fs=require('fs');var path=require(_0xdd3f('0x7'));var rimraf=require(_0xdd3f('0x8'));var config=require(_0xdd3f('0x9'));var attributes=require(_0xdd3f('0xa'));module['exports']=function(_0x52f3da,_0x24b361){return _0x52f3da['define'](_0xdd3f('0xb'),attributes,{'tableName':_0xdd3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd3f('0xd'),'collate':_0xdd3f('0xe')});}; \ No newline at end of file +var _0xcf48=['util','../../config/logger','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x46f2d3,_0x3eb573){var _0x4cd17f=function(_0x2f5543){while(--_0x2f5543){_0x46f2d3['push'](_0x46f2d3['shift']());}};_0x4cd17f(++_0x3eb573);}(_0xcf48,0x129));var _0x8cf4=function(_0x1ff22d,_0x325116){_0x1ff22d=_0x1ff22d-0x0;var _0x2b58fa=_0xcf48[_0x1ff22d];return _0x2b58fa;};'use strict';var _=require('lodash');var util=require(_0x8cf4('0x0'));var logger=require(_0x8cf4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8cf4('0x2'));var rp=require(_0x8cf4('0x3'));var fs=require('fs');var path=require(_0x8cf4('0x4'));var rimraf=require(_0x8cf4('0x5'));var config=require('../../config/environment');var attributes=require(_0x8cf4('0x6'));module[_0x8cf4('0x7')]=function(_0x553ca4,_0x2424e4){return _0x553ca4['define']('ChatInternalMessage',attributes,{'tableName':_0x8cf4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8cf4('0x9'),'collate':_0x8cf4('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a21f6d8..541de4d 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 _0x4720=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x4720,0x164));var _0x0472=function(_0xe1269d,_0x57b7c3){_0xe1269d=_0xe1269d-0x0;var _0x261ca1=_0x4720[_0xe1269d];return _0x261ca1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0472('0x0'));var BPromise=require(_0x0472('0x1'));var rs=require(_0x0472('0x2'));var fs=require('fs');var Redis=require(_0x0472('0x3'));var db=require(_0x0472('0x4'))['db'];var utils=require(_0x0472('0x5'));var logger=require(_0x0472('0x6'))(_0x0472('0x7'));var config=require(_0x0472('0x8'));var jayson=require(_0x0472('0x9'));var client=jayson[_0x0472('0xa')][_0x0472('0xb')]({'port':0x232a});config[_0x0472('0xc')]=_[_0x0472('0xd')](config['redis'],{'host':_0x0472('0xe'),'port':0x18eb});var socket=require(_0x0472('0xf'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x0472('0x10')](socket);function respondWithRpcPromise(_0x39bf68,_0x53482d,_0x52f589){return new BPromise(function(_0x4188e9,_0x30c621){return client['request'](_0x39bf68,_0x52f589)['then'](function(_0x416622){logger[_0x0472('0x11')](_0x0472('0x12'),_0x53482d,_0x0472('0x13'));logger[_0x0472('0x14')](_0x0472('0x15'),_0x53482d,_0x0472('0x13'),JSON['stringify'](_0x416622));if(_0x416622[_0x0472('0x16')]){if(_0x416622[_0x0472('0x16')][_0x0472('0x17')]===0x1f4){logger[_0x0472('0x16')](_0x0472('0x12'),_0x53482d,_0x416622[_0x0472('0x16')]['message']);return _0x30c621(_0x416622['error'][_0x0472('0x18')]);}logger[_0x0472('0x16')](_0x0472('0x12'),_0x53482d,_0x416622[_0x0472('0x16')][_0x0472('0x18')]);return _0x4188e9(_0x416622[_0x0472('0x16')][_0x0472('0x18')]);}else{logger[_0x0472('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x53482d,_0x0472('0x13'));_0x4188e9(_0x416622['result']['message']);}})['catch'](function(_0x32dda0){logger[_0x0472('0x16')](_0x0472('0x12'),_0x53482d,_0x32dda0);_0x30c621(_0x32dda0);});});} \ No newline at end of file +var _0x44f6=['stringify','error','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x57e97d,_0x1e293f){var _0x449c77=function(_0x1b44bf){while(--_0x1b44bf){_0x57e97d['push'](_0x57e97d['shift']());}};_0x449c77(++_0x1e293f);}(_0x44f6,0xa4));var _0x644f=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0x44f6[_0xe6e78c];return _0x2a09c8;};'use strict';var _=require(_0x644f('0x0'));var util=require(_0x644f('0x1'));var moment=require(_0x644f('0x2'));var BPromise=require(_0x644f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x644f('0x4'))['db'];var utils=require(_0x644f('0x5'));var logger=require(_0x644f('0x6'))(_0x644f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x644f('0x8')][_0x644f('0x9')]({'port':0x232a});config[_0x644f('0xa')]=_[_0x644f('0xb')](config[_0x644f('0xa')],{'host':_0x644f('0xc'),'port':0x18eb});var socket=require(_0x644f('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x18eee9,_0x12210d,_0x1b7bc9){return new BPromise(function(_0x485c0a,_0x486476){return client[_0x644f('0xe')](_0x18eee9,_0x1b7bc9)[_0x644f('0xf')](function(_0x2e8c6b){logger[_0x644f('0x10')](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));logger['debug'](_0x644f('0x13'),_0x12210d,_0x644f('0x12'),JSON[_0x644f('0x14')](_0x2e8c6b));if(_0x2e8c6b[_0x644f('0x15')]){if(_0x2e8c6b[_0x644f('0x15')]['code']===0x1f4){logger['error'](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x486476(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);return _0x485c0a(_0x2e8c6b[_0x644f('0x15')][_0x644f('0x16')]);}else{logger['info'](_0x644f('0x11'),_0x12210d,_0x644f('0x12'));_0x485c0a(_0x2e8c6b['result'][_0x644f('0x16')]);}})['catch'](function(_0x15a0a2){logger[_0x644f('0x15')](_0x644f('0x11'),_0x12210d,_0x15a0a2);_0x486476(_0x15a0a2);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 024258b..9c406ae 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 _0x236e=['update','emit','register','chatInternalMessage:','remove'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x236e,0x1ad));var _0xe236=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x236e[_0x1facfa];return _0x9ec701;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xe236('0x0'),_0xe236('0x1')];function createListener(_0x592ced,_0x237b66){return function(_0x1d4d32){_0x237b66[_0xe236('0x2')](_0x592ced,_0x1d4d32);};}function removeListener(_0xc3693a,_0x51881c){return function(){ChatInternalMessageEvents['removeListener'](_0xc3693a,_0x51881c);};}exports[_0xe236('0x3')]=function(_0x566019){for(var _0x359449=0x0,_0x19598b=events['length'];_0x359449<_0x19598b;_0x359449++){var _0x1b02f0=events[_0x359449];var _0xd72f3=createListener(_0xe236('0x4')+_0x1b02f0,_0x566019);ChatInternalMessageEvents['on'](_0x1b02f0,_0xd72f3);}}; \ No newline at end of file +var _0xea18=['chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register','length'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0xea18,0x1ba));var _0x8ea1=function(_0x4e6acf,_0x124c8a){_0x4e6acf=_0x4e6acf-0x0;var _0x260a7c=_0xea18[_0x4e6acf];return _0x260a7c;};'use strict';var ChatInternalMessageEvents=require(_0x8ea1('0x0'));var events=[_0x8ea1('0x1'),'remove','update'];function createListener(_0x4d6932,_0x383524){return function(_0x1eb674){_0x383524[_0x8ea1('0x2')](_0x4d6932,_0x1eb674);};}function removeListener(_0x2fbfd4,_0x24e3f1){return function(){ChatInternalMessageEvents[_0x8ea1('0x3')](_0x2fbfd4,_0x24e3f1);};}exports[_0x8ea1('0x4')]=function(_0x31b9b3){for(var _0x897ad0=0x0,_0x55db19=events[_0x8ea1('0x5')];_0x897ad0<_0x55db19;_0x897ad0++){var _0x311ab5=events[_0x897ad0];var _0x59327a=createListener(_0x8ea1('0x6')+_0x311ab5,_0x31b9b3);ChatInternalMessageEvents['on'](_0x311ab5,_0x59327a);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f4653f4..b7fc04c 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 _0x2d6a=['../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','post','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2bf903,_0x30b955){var _0x2d6fa1=function(_0x1c5b1d){while(--_0x1c5b1d){_0x2bf903['push'](_0x2bf903['shift']());}};_0x2d6fa1(++_0x30b955);}(_0x2d6a,0x87));var _0xa2d6=function(_0x25478a,_0x1e554e){_0x25478a=_0x25478a-0x0;var _0x17f547=_0x2d6a[_0x25478a];return _0x17f547;};'use strict';var multer=require(_0xa2d6('0x0'));var util=require('util');var path=require(_0xa2d6('0x1'));var timeout=require(_0xa2d6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa2d6('0x3'));var auth=require(_0xa2d6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa2d6('0x5'));var controller=require(_0xa2d6('0x6'));router[_0xa2d6('0x7')]('/',auth[_0xa2d6('0x8')](),controller[_0xa2d6('0x9')]);router[_0xa2d6('0x7')](_0xa2d6('0xa'),auth[_0xa2d6('0x8')](),controller[_0xa2d6('0xb')]);router['get'](_0xa2d6('0xc'),auth[_0xa2d6('0x8')](),controller['getUsers']);router[_0xa2d6('0x7')](_0xa2d6('0xd'),auth[_0xa2d6('0x8')](),controller['show']);router[_0xa2d6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa2d6('0xf')](_0xa2d6('0xd'),controller[_0xa2d6('0x10')]);router[_0xa2d6('0x11')]('/:id',auth[_0xa2d6('0x8')](),controller[_0xa2d6('0x12')]);module[_0xa2d6('0x13')]=router; \ No newline at end of file +var _0x5ee1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ee1,0xfd));var _0x15ee=function(_0x1ba792,_0x1db740){_0x1ba792=_0x1ba792-0x0;var _0x1a0ce4=_0x5ee1[_0x1ba792];return _0x1a0ce4;};'use strict';var multer=require(_0x15ee('0x0'));var util=require(_0x15ee('0x1'));var path=require(_0x15ee('0x2'));var timeout=require(_0x15ee('0x3'));var express=require(_0x15ee('0x4'));var router=express[_0x15ee('0x5')]();var fs_extra=require(_0x15ee('0x6'));var auth=require(_0x15ee('0x7'));var interaction=require(_0x15ee('0x8'));var config=require(_0x15ee('0x9'));var controller=require(_0x15ee('0xa'));router[_0x15ee('0xb')]('/',auth[_0x15ee('0xc')](),controller['index']);router[_0x15ee('0xb')](_0x15ee('0xd'),auth[_0x15ee('0xc')](),controller[_0x15ee('0xe')]);router['get'](_0x15ee('0xf'),auth['isAuthenticated'](),controller[_0x15ee('0x10')]);router[_0x15ee('0xb')](_0x15ee('0x11'),auth[_0x15ee('0xc')](),controller[_0x15ee('0x12')]);router[_0x15ee('0x13')]('/',auth[_0x15ee('0xc')](),controller['create']);router[_0x15ee('0x14')](_0x15ee('0x11'),controller[_0x15ee('0x15')]);router['delete'](_0x15ee('0x11'),auth[_0x15ee('0xc')](),controller['destroy']);module[_0x15ee('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 8b5344a..7ac0113 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 _0xcae2=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x49774a,_0x2f1c6b){var _0x4589b3=function(_0x2a7da7){while(--_0x2a7da7){_0x49774a['push'](_0x49774a['shift']());}};_0x4589b3(++_0x2f1c6b);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2cae('0x0'));module[_0x2cae('0x1')]={'body':{'type':Sequelize[_0x2cae('0x2')](_0x2cae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2cae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2cae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2cae('0x5')]('in','out'),'defaultValue':_0x2cae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2cae('0x7')]},'providerName':{'type':Sequelize[_0x2cae('0x8')]},'providerResponse':{'type':Sequelize[_0x2cae('0x2')]}}; \ No newline at end of file +var _0x3ee7=['ENUM','out','DATE','STRING','TEXT','exports','BOOLEAN'];(function(_0x379d55,_0x33b6d4){var _0x202a13=function(_0x4017e1){while(--_0x4017e1){_0x379d55['push'](_0x379d55['shift']());}};_0x202a13(++_0x33b6d4);}(_0x3ee7,0x98));var _0x73ee=function(_0x50dba9,_0x2fe5f7){_0x50dba9=_0x50dba9-0x0;var _0x37a156=_0x3ee7[_0x50dba9];return _0x37a156;};'use strict';var Sequelize=require('sequelize');module[_0x73ee('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x73ee('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x73ee('0x2')]('in',_0x73ee('0x3')),'defaultValue':_0x73ee('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x73ee('0x4')]},'providerName':{'type':Sequelize[_0x73ee('0x5')]},'providerResponse':{'type':Sequelize[_0x73ee('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index fcbad2a..5576ca6 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 _0x1d95=['User','fullname','interface','rejectmessage','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','name','send','map','ChatMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','include','options','create','body','find','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','isNil','read1stAt','interaction','get','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage'];(function(_0xfec4f2,_0x27b2aa){var _0x4ee052=function(_0x195ba5){while(--_0x195ba5){_0xfec4f2['push'](_0xfec4f2['shift']());}};_0x4ee052(++_0x27b2aa);}(_0x1d95,0x108));var _0x51d9=function(_0x568d0d,_0x36cbb4){_0x568d0d=_0x568d0d-0x0;var _0x5b2035=_0x1d95[_0x568d0d];return _0x5b2035;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x51d9('0x0'));var rp=require('request-promise');var moment=require(_0x51d9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x51d9('0x2'));var util=require(_0x51d9('0x3'));var path=require(_0x51d9('0x4'));var sox=require(_0x51d9('0x5'));var csv=require(_0x51d9('0x6'));var ejs=require(_0x51d9('0x7'));var fs=require('fs');var fs_extra=require(_0x51d9('0x8'));var _=require('lodash');var squel=require(_0x51d9('0x9'));var crypto=require(_0x51d9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x51d9('0xb'));var toCsv=require(_0x51d9('0x6'));var querystring=require(_0x51d9('0xc'));var Papa=require(_0x51d9('0xd'));var Redis=require(_0x51d9('0xe'));var authService=require(_0x51d9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x51d9('0x10'));var hardwareService=require(_0x51d9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x51d9('0x12'));var config=require(_0x51d9('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x51d9('0x14')]=_[_0x51d9('0x15')](config[_0x51d9('0x14')],{'host':_0x51d9('0x16'),'port':0x18eb});var socket=require(_0x51d9('0x17'))(new Redis(config[_0x51d9('0x14')]));require(_0x51d9('0x18'))[_0x51d9('0x19')](socket);var jayson=require(_0x51d9('0x1a'));var client=jayson[_0x51d9('0x1b')][_0x51d9('0x1c')]({'port':0x232c});var client9002=jayson[_0x51d9('0x1b')][_0x51d9('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x510caa,_0x35a369,_0x5a544c,_0x36e4f9){return new BPromise(function(_0x4b4d76,_0x589f7c){var _0x11a0cf=_0x36e4f9||client;return _0x11a0cf['request'](_0x510caa,_0x5a544c)[_0x51d9('0x1d')](function(_0x2c400f){logger[_0x51d9('0x1e')](_0x51d9('0x1f'),_0x35a369,_0x51d9('0x20'));logger[_0x51d9('0x21')](_0x51d9('0x22'),_0x35a369,_0x51d9('0x20'),JSON[_0x51d9('0x23')](_0x2c400f));if(_0x2c400f[_0x51d9('0x24')]){if(_0x2c400f[_0x51d9('0x24')]['code']===0x1f4){logger[_0x51d9('0x24')](_0x51d9('0x1f'),_0x35a369,_0x2c400f[_0x51d9('0x24')][_0x51d9('0x25')]);return _0x589f7c(_0x2c400f['error']['message']);}logger[_0x51d9('0x24')](_0x51d9('0x1f'),_0x35a369,_0x2c400f[_0x51d9('0x24')][_0x51d9('0x25')]);return _0x4b4d76(_0x2c400f[_0x51d9('0x24')][_0x51d9('0x25')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x35a369,_0x51d9('0x20'));_0x4b4d76(_0x2c400f['result'][_0x51d9('0x25')]);}})[_0x51d9('0x26')](function(_0xc846b){logger[_0x51d9('0x24')](_0x51d9('0x1f'),_0x35a369,_0xc846b);_0x589f7c(_0xc846b);});});}function respondWithStatusCode(_0x453def,_0x1a9c57){_0x1a9c57=_0x1a9c57||0xcc;return function(_0x55c0c6){if(_0x55c0c6){return _0x453def[_0x51d9('0x27')](_0x1a9c57);}return _0x453def[_0x51d9('0x28')](_0x1a9c57)['end']();};}function respondWithResult(_0x50cfd1,_0x222485){_0x222485=_0x222485||0xc8;return function(_0x3328a6){if(_0x3328a6){return _0x50cfd1[_0x51d9('0x28')](_0x222485)['json'](_0x3328a6);}};}function respondWithFilteredResult(_0xfb3eb,_0x198fde){return function(_0x1d4931){if(_0x1d4931){var _0x186e9f=typeof _0x198fde['offset']===_0x51d9('0x29')&&typeof _0x198fde[_0x51d9('0x2a')]===_0x51d9('0x29');var _0x405229=_0x1d4931[_0x51d9('0x2b')];var _0x32d990=_0x186e9f?0x0:_0x198fde['offset'];var _0x3db30b=_0x186e9f?_0x1d4931[_0x51d9('0x2b')]:_0x198fde['offset']+_0x198fde['limit'];var _0x25cf3f;if(_0x3db30b>=_0x405229){_0x3db30b=_0x405229;_0x25cf3f=0xc8;}else{_0x25cf3f=0xce;}_0xfb3eb['status'](_0x25cf3f);return _0xfb3eb[_0x51d9('0x2c')](_0x51d9('0x2d'),_0x32d990+'-'+_0x3db30b+'/'+_0x405229)[_0x51d9('0x2e')](_0x1d4931);}return null;};}function patchUpdates(_0x571a87){return function(_0x294008){try{jsonpatch[_0x51d9('0x2f')](_0x294008,_0x571a87,!![]);}catch(_0x57b8c6){return BPromise[_0x51d9('0x30')](_0x57b8c6);}return _0x294008[_0x51d9('0x31')]();};}function saveUpdates(_0x2d36e4,_0x4bd671){return function(_0x3235fc){if(_0x3235fc){return _0x3235fc[_0x51d9('0x32')](_0x2d36e4)[_0x51d9('0x1d')](function(_0x4412dc){return _0x4412dc;});}return null;};}function removeEntity(_0x4f5fac,_0x3b74d9){return function(_0x4d6db8){if(_0x4d6db8){return _0x4d6db8[_0x51d9('0x33')]()[_0x51d9('0x1d')](function(){_0x4f5fac['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a59b,_0x3280bb){return function(_0x29cd2c){if(!_0x29cd2c){_0x20a59b[_0x51d9('0x27')](0x194);}return _0x29cd2c;};}function handleError(_0x35dceb,_0x4f3e5e){_0x4f3e5e=_0x4f3e5e||0x1f4;return function(_0x4ec583){logger[_0x51d9('0x24')](_0x4ec583['stack']);if(_0x4ec583[_0x51d9('0x34')]){delete _0x4ec583[_0x51d9('0x34')];}_0x35dceb[_0x51d9('0x28')](_0x4f3e5e)[_0x51d9('0x35')](_0x4ec583);};}exports['index']=function(_0x580603,_0x6b3ce2){var _0x1b7324={},_0x40bf74={},_0x28fee5={'count':0x0,'rows':[]};var _0x3526e7=_[_0x51d9('0x36')](db[_0x51d9('0x37')][_0x51d9('0x38')],function(_0x128beb){return{'name':_0x128beb['fieldName'],'type':_0x128beb[_0x51d9('0x39')][_0x51d9('0x3a')]};});_0x40bf74[_0x51d9('0x3b')]=_[_0x51d9('0x36')](_0x3526e7,_0x51d9('0x34'));_0x40bf74['query']=_['keys'](_0x580603[_0x51d9('0x3c')]);_0x40bf74[_0x51d9('0x3d')]=_[_0x51d9('0x3e')](_0x40bf74[_0x51d9('0x3b')],_0x40bf74[_0x51d9('0x3c')]);_0x1b7324[_0x51d9('0x3f')]=_[_0x51d9('0x3e')](_0x40bf74[_0x51d9('0x3b')],qs[_0x51d9('0x40')](_0x580603[_0x51d9('0x3c')][_0x51d9('0x40')]));_0x1b7324[_0x51d9('0x3f')]=_0x1b7324[_0x51d9('0x3f')][_0x51d9('0x41')]?_0x1b7324[_0x51d9('0x3f')]:_0x40bf74[_0x51d9('0x3b')];if(!_0x580603[_0x51d9('0x3c')][_0x51d9('0x42')](_0x51d9('0x43'))){_0x1b7324[_0x51d9('0x2a')]=qs[_0x51d9('0x2a')](_0x580603[_0x51d9('0x3c')][_0x51d9('0x2a')]);_0x1b7324[_0x51d9('0x44')]=qs[_0x51d9('0x44')](_0x580603[_0x51d9('0x3c')][_0x51d9('0x44')]);}_0x1b7324[_0x51d9('0x45')]=qs['sort'](_0x580603['query'][_0x51d9('0x46')]);_0x1b7324[_0x51d9('0x47')]=qs[_0x51d9('0x3d')](_['pick'](_0x580603[_0x51d9('0x3c')],_0x40bf74[_0x51d9('0x3d')]),_0x3526e7);if(_0x580603['query'][_0x51d9('0x48')]){_0x1b7324[_0x51d9('0x47')]=_[_0x51d9('0x49')](_0x1b7324['where'],{'$or':_[_0x51d9('0x36')](_0x3526e7,function(_0x357956){if(_0x357956[_0x51d9('0x39')]!==_0x51d9('0x4a')){var _0x8b4f25={};_0x8b4f25[_0x357956[_0x51d9('0x34')]]={'$like':'%'+_0x580603[_0x51d9('0x3c')][_0x51d9('0x48')]+'%'};return _0x8b4f25;}})});}_0x1b7324=_[_0x51d9('0x49')]({},_0x1b7324,_0x580603['options']);var _0x2c0028={'where':_0x1b7324[_0x51d9('0x47')]};return db[_0x51d9('0x37')][_0x51d9('0x2b')](_0x2c0028)[_0x51d9('0x1d')](function(_0x3e072a){_0x28fee5[_0x51d9('0x2b')]=_0x3e072a;if(_0x580603[_0x51d9('0x3c')][_0x51d9('0x4b')]){_0x1b7324['include']=[{'all':!![]}];}return db['ChatMessage'][_0x51d9('0x4c')](_0x1b7324);})[_0x51d9('0x1d')](function(_0x5d7448){_0x28fee5[_0x51d9('0x4d')]=_0x5d7448;return _0x28fee5;})['then'](respondWithFilteredResult(_0x6b3ce2,_0x1b7324))[_0x51d9('0x26')](handleError(_0x6b3ce2,null));};exports[_0x51d9('0x4e')]=function(_0x1bd38a,_0x10fb70){var _0x578c27={'raw':!![],'where':{'id':_0x1bd38a[_0x51d9('0x4f')]['id']}},_0x1b6d00={};_0x1b6d00[_0x51d9('0x3b')]=_['keys'](db[_0x51d9('0x37')][_0x51d9('0x38')]);_0x1b6d00['query']=_[_0x51d9('0x50')](_0x1bd38a[_0x51d9('0x3c')]);_0x1b6d00['filters']=_['intersection'](_0x1b6d00[_0x51d9('0x3b')],_0x1b6d00[_0x51d9('0x3c')]);_0x578c27[_0x51d9('0x3f')]=_[_0x51d9('0x3e')](_0x1b6d00['model'],qs[_0x51d9('0x40')](_0x1bd38a[_0x51d9('0x3c')][_0x51d9('0x40')]));_0x578c27[_0x51d9('0x3f')]=_0x578c27[_0x51d9('0x3f')]['length']?_0x578c27[_0x51d9('0x3f')]:_0x1b6d00['model'];if(_0x1bd38a[_0x51d9('0x3c')][_0x51d9('0x4b')]){_0x578c27[_0x51d9('0x51')]=[{'all':!![]}];}_0x578c27=_[_0x51d9('0x49')]({},_0x578c27,_0x1bd38a[_0x51d9('0x52')]);return db[_0x51d9('0x37')]['find'](_0x578c27)[_0x51d9('0x1d')](handleEntityNotFound(_0x10fb70,null))[_0x51d9('0x1d')](respondWithResult(_0x10fb70,null))[_0x51d9('0x26')](handleError(_0x10fb70,null));};exports[_0x51d9('0x53')]=function(_0x106b24,_0x5934b0){return db[_0x51d9('0x37')][_0x51d9('0x53')](_0x106b24['body'],{})['then'](respondWithResult(_0x5934b0,0xc9))['catch'](handleError(_0x5934b0,null));};exports[_0x51d9('0x32')]=function(_0x223540,_0x355879){if(_0x223540[_0x51d9('0x54')]['id']){delete _0x223540['body']['id'];}return db['ChatMessage'][_0x51d9('0x55')]({'where':{'id':_0x223540[_0x51d9('0x4f')]['id']}})[_0x51d9('0x1d')](handleEntityNotFound(_0x355879,null))[_0x51d9('0x1d')](saveUpdates(_0x223540[_0x51d9('0x54')],null))[_0x51d9('0x1d')](respondWithResult(_0x355879,null))[_0x51d9('0x26')](handleError(_0x355879,null));};exports[_0x51d9('0x33')]=function(_0x3fca2e,_0x2dbd5f){return db['ChatMessage'][_0x51d9('0x55')]({'where':{'id':_0x3fca2e[_0x51d9('0x4f')]['id']}})[_0x51d9('0x1d')](handleEntityNotFound(_0x2dbd5f,null))[_0x51d9('0x1d')](removeEntity(_0x2dbd5f,null))['catch'](handleError(_0x2dbd5f,null));};exports[_0x51d9('0x56')]=function(_0x4ac70d,_0x456bc9){return db[_0x51d9('0x37')][_0x51d9('0x56')]()[_0x51d9('0x1d')](respondWithResult(_0x456bc9,null))[_0x51d9('0x26')](handleError(_0x456bc9,null));};var interaction_log=require('../../config/logger')(_0x51d9('0x57'));exports['accept']=function(_0x24f999,_0x4101b0,_0xe08985){var _0x84ac03={'agent':{},'channel':_0x51d9('0x58')};if(_0x24f999[_0x51d9('0x54')]['id']){delete _0x24f999['body']['id'];}_0x24f999[_0x51d9('0x54')][_0x51d9('0x59')]=!![];_0x24f999[_0x51d9('0x54')][_0x51d9('0x5a')]=moment()[_0x51d9('0x5b')](_0x51d9('0x5c'));_0x24f999[_0x51d9('0x54')]['UserId']=_0x24f999[_0x51d9('0x54')][_0x51d9('0x5d')]||_0x24f999[_0x51d9('0x5e')]['id'];_0x84ac03[_0x51d9('0x5f')]['id']=_0x24f999[_0x51d9('0x54')][_0x51d9('0x5d')];return db[_0x51d9('0x37')]['find']({'where':{'id':_0x24f999['params']['id'],'UserId':null}})[_0x51d9('0x1d')](handleEntityNotFound(_0x4101b0,null))[_0x51d9('0x1d')](saveUpdates(_0x24f999[_0x51d9('0x54')],null))['then'](function(_0x209cc8){if(_0x209cc8){_0x84ac03['message']=_0x209cc8['get']({'plain':!![]});return db[_0x51d9('0x60')][_0x51d9('0x55')]({'where':{'id':_0x209cc8['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4101b0,null))[_0x51d9('0x1d')](function(_0x2d066f){if(_0x2d066f){return _0x2d066f[_0x51d9('0x32')]({'UserId':_0x24f999[_0x51d9('0x54')][_0x51d9('0x5d')],'read1stAt':_[_0x51d9('0x61')](_0x2d066f[_0x51d9('0x62')])?moment()[_0x51d9('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x51d9('0x1d')](function(_0xc43fb7){if(_0xc43fb7){_0x84ac03[_0x51d9('0x63')]=_0xc43fb7[_0x51d9('0x64')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x24f999[_0x51d9('0x5e')]['id'],_0x24f999[_0x51d9('0x5e')][_0x51d9('0x34')],_0x24f999[_0x51d9('0x5e')]['role'],_0x84ac03['interaction']['id'],_0x24f999[_0x51d9('0x54')]?JSON[_0x51d9('0x23')](_0x24f999[_0x51d9('0x54')]):_0x51d9('0x65'));return respondWithRpcPromise(_0x51d9('0x66'),_0x51d9('0x67'),_0x84ac03);}return null;})[_0x51d9('0x1d')](function(_0x4694d0){var _0xd4e5f4=_0x51d9('0x68')+_0x4694d0[_0x51d9('0x25')][_0x51d9('0x69')];return db[_0x51d9('0x6a')][_0x51d9('0x3c')](_0xd4e5f4,{'type':db[_0x51d9('0x6b')][_0x51d9('0x6c')]['SELECT'],'raw':!![]})[_0x51d9('0x1d')](function(_0xdad625){return _0xdad625;});})[_0x51d9('0x1d')](function(_0x5c144f){if(_0x5c144f){_0x84ac03[_0x51d9('0x25')][_0x51d9('0x6d')]=_0x5c144f[0x0];if(!_0x24f999['body'][_0x51d9('0x5d')])return;return db['User'][_0x51d9('0x55')]({'where':{'id':_0x24f999[_0x51d9('0x54')][_0x51d9('0x5d')],'role':_0x51d9('0x5f')},'attributes':['id','name','fullname',_0x51d9('0x6e'),_0x51d9('0x6f')],'raw':!![]});}return null;})[_0x51d9('0x1d')](function(_0x522eac){if(!_0x522eac)return null;_0x84ac03[_0x51d9('0x25')][_0x51d9('0x5f')]=_0x522eac;return _0x84ac03;})[_0x51d9('0x1d')](function(_0x9e2e2f){if(_0x9e2e2f){if(_0x24f999[_0x51d9('0x54')][_0x51d9('0x70')]){_0x84ac03['message']['interface']=util[_0x51d9('0x5b')](_0x51d9('0x71'),_0x24f999[_0x51d9('0x5e')][_0x51d9('0x34')]);_0x84ac03[_0x51d9('0x25')][_0x51d9('0x72')]=_0x84ac03[_0x51d9('0x72')];_0x84ac03['message'][_0x51d9('0x73')]=_0x84ac03[_0x51d9('0x72')];_0x84ac03['message'][_0x51d9('0x74')]='accept';return respondWithRpcPromise(_0x51d9('0x75'),_0x51d9('0x75'),{'event':_0x51d9('0x76'),'message':_['merge'](_0x84ac03['message'],JSON[_0x51d9('0x77')](_0x84ac03[_0x51d9('0x63')][_0x51d9('0x78')]))},client9002)[_0x51d9('0x1d')](function(){return _0x84ac03;});}return _0x84ac03;}return null;})[_0x51d9('0x1d')](respondWithResult(_0x4101b0,null))[_0x51d9('0x26')](handleError(_0x4101b0,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x51d9('0x30')]=function(_0x1a2642,_0x7fd066,_0x4a56bc){var _0x3b21d2={'agent':{},'channel':_0x51d9('0x58')};if(_0x1a2642['body']['id']){delete _0x1a2642['body']['id'];}_0x1a2642[_0x51d9('0x54')][_0x51d9('0x5d')]=_0x1a2642[_0x51d9('0x54')]['UserId']||_0x1a2642['user']['id'];_0x3b21d2[_0x51d9('0x5f')]['id']=_0x1a2642[_0x51d9('0x54')]['UserId'];return db['ChatMessage'][_0x51d9('0x55')]({'where':{'id':_0x1a2642[_0x51d9('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7fd066,null))[_0x51d9('0x1d')](function(_0x5263cf){if(_0x5263cf){_0x3b21d2[_0x51d9('0x25')]=_0x5263cf[_0x51d9('0x64')]({'plain':!![]});return db[_0x51d9('0x60')][_0x51d9('0x55')]({'where':{'id':_0x5263cf[_0x51d9('0x79')]}});}return null;})['then'](handleEntityNotFound(_0x7fd066,null))[_0x51d9('0x1d')](function(_0x1a8da4){if(_0x1a8da4){_0x3b21d2[_0x51d9('0x63')]=_0x1a8da4[_0x51d9('0x64')]({'plain':!![]});interaction_log[_0x51d9('0x1e')](_0x51d9('0x7a'),_0x1a2642[_0x51d9('0x5e')]['id'],_0x1a2642[_0x51d9('0x5e')][_0x51d9('0x34')],_0x1a2642['user'][_0x51d9('0x7b')],_0x3b21d2[_0x51d9('0x63')]['id'],_0x1a2642['body']?JSON[_0x51d9('0x23')](_0x1a2642[_0x51d9('0x54')]):_0x51d9('0x65'));return respondWithRpcPromise(_0x51d9('0x7c'),_0x51d9('0x7d'),_0x3b21d2);}return null;})[_0x51d9('0x1d')](function(_0x4d5b99){var _0x1a098f=_0x51d9('0x68')+_0x4d5b99[_0x51d9('0x25')][_0x51d9('0x69')];return db[_0x51d9('0x6a')]['query'](_0x1a098f,{'type':db['Sequelize'][_0x51d9('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0xb744e4){return _0xb744e4;});})['then'](function(_0x5b6150){if(_0x5b6150){_0x3b21d2[_0x51d9('0x25')][_0x51d9('0x6d')]=_0x5b6150[0x0];if(!_0x1a2642[_0x51d9('0x54')][_0x51d9('0x5d')])return;return db[_0x51d9('0x7e')][_0x51d9('0x55')]({'where':{'id':_0x1a2642[_0x51d9('0x54')][_0x51d9('0x5d')],'role':_0x51d9('0x5f')},'attributes':['id',_0x51d9('0x34'),_0x51d9('0x7f'),'email',_0x51d9('0x6f')],'raw':!![]});}return null;})[_0x51d9('0x1d')](function(_0x5760d6){if(!_0x5760d6)return null;_0x3b21d2[_0x51d9('0x25')][_0x51d9('0x5f')]=_0x5760d6;return _0x3b21d2;})['then'](function(_0x195b4f){if(_0x195b4f){_0x195b4f[_0x51d9('0x25')][_0x51d9('0x80')]=util[_0x51d9('0x5b')]('SIP/%s',_0x1a2642['user'][_0x51d9('0x34')]);_0x195b4f['message'][_0x51d9('0x72')]=_0x3b21d2[_0x51d9('0x72')];_0x195b4f[_0x51d9('0x25')][_0x51d9('0x73')]=_0x3b21d2[_0x51d9('0x72')];_0x195b4f[_0x51d9('0x25')][_0x51d9('0x74')]='reject';respondWithRpcPromise('EventManager',_0x51d9('0x75'),{'event':_0x51d9('0x81'),'message':_[_0x51d9('0x49')](_0x3b21d2[_0x51d9('0x25')],JSON[_0x51d9('0x77')](_0x3b21d2[_0x51d9('0x63')][_0x51d9('0x78')]))},client9002);return _0x3b21d2;}return null;})['then'](respondWithResult(_0x7fd066,null))[_0x51d9('0x26')](handleError(_0x7fd066,null));}; \ No newline at end of file +var _0xea18=['socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','stack','map','ChatMessage','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','catch','show','params','rawAttributes','keys','include','find','create','body','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','sequelize','QueryTypes','rejectmessage','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0xea18,0x1de));var _0x8ea1=function(_0x1019df,_0x4dcb7){_0x1019df=_0x1019df-0x0;var _0x248a58=_0xea18[_0x1019df];return _0x248a58;};'use strict';var emlformat=require(_0x8ea1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8ea1('0x1'));var rp=require(_0x8ea1('0x2'));var moment=require(_0x8ea1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8ea1('0x4'));var util=require(_0x8ea1('0x5'));var path=require(_0x8ea1('0x6'));var sox=require('sox');var csv=require(_0x8ea1('0x7'));var ejs=require(_0x8ea1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8ea1('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ea1('0xa'));var Papa=require(_0x8ea1('0xb'));var Redis=require('ioredis');var authService=require(_0x8ea1('0xc'));var qs=require(_0x8ea1('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ea1('0xe'));var logger=require(_0x8ea1('0xf'))(_0x8ea1('0x10'));var utils=require(_0x8ea1('0x11'));var config=require(_0x8ea1('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ea1('0x13'))['db'];config['redis']=_[_0x8ea1('0x14')](config[_0x8ea1('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ea1('0x16'))(new Redis(config['redis']));require(_0x8ea1('0x17'))['register'](socket);var jayson=require(_0x8ea1('0x18'));var client=jayson[_0x8ea1('0x19')][_0x8ea1('0x1a')]({'port':0x232c});var client9002=jayson[_0x8ea1('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bc55a,_0x50f8a2,_0x2f93a1,_0x14ae3a){return new BPromise(function(_0x56c621,_0x28671e){var _0xb19d4b=_0x14ae3a||client;return _0xb19d4b[_0x8ea1('0x1b')](_0x5bc55a,_0x2f93a1)[_0x8ea1('0x1c')](function(_0x121ad4){logger[_0x8ea1('0x1d')](_0x8ea1('0x1e'),_0x50f8a2,_0x8ea1('0x1f'));logger[_0x8ea1('0x20')](_0x8ea1('0x21'),_0x50f8a2,_0x8ea1('0x1f'),JSON[_0x8ea1('0x22')](_0x121ad4));if(_0x121ad4[_0x8ea1('0x23')]){if(_0x121ad4[_0x8ea1('0x23')][_0x8ea1('0x24')]===0x1f4){logger['error'](_0x8ea1('0x1e'),_0x50f8a2,_0x121ad4[_0x8ea1('0x23')]['message']);return _0x28671e(_0x121ad4['error'][_0x8ea1('0x25')]);}logger[_0x8ea1('0x23')](_0x8ea1('0x1e'),_0x50f8a2,_0x121ad4[_0x8ea1('0x23')][_0x8ea1('0x25')]);return _0x56c621(_0x121ad4['error'][_0x8ea1('0x25')]);}else{logger[_0x8ea1('0x1d')](_0x8ea1('0x1e'),_0x50f8a2,_0x8ea1('0x1f'));_0x56c621(_0x121ad4['result'][_0x8ea1('0x25')]);}})['catch'](function(_0x321457){logger[_0x8ea1('0x23')](_0x8ea1('0x1e'),_0x50f8a2,_0x321457);_0x28671e(_0x321457);});});}function respondWithStatusCode(_0x213d28,_0x37ec1d){_0x37ec1d=_0x37ec1d||0xcc;return function(_0x2d504e){if(_0x2d504e){return _0x213d28[_0x8ea1('0x26')](_0x37ec1d);}return _0x213d28[_0x8ea1('0x27')](_0x37ec1d)[_0x8ea1('0x28')]();};}function respondWithResult(_0x10ff47,_0xc7c34a){_0xc7c34a=_0xc7c34a||0xc8;return function(_0x723904){if(_0x723904){return _0x10ff47[_0x8ea1('0x27')](_0xc7c34a)[_0x8ea1('0x29')](_0x723904);}};}function respondWithFilteredResult(_0x287b2b,_0x42080e){return function(_0x23414d){if(_0x23414d){var _0x1f00b2=typeof _0x42080e[_0x8ea1('0x2a')]==='undefined'&&typeof _0x42080e[_0x8ea1('0x2b')]===_0x8ea1('0x2c');var _0x5ea817=_0x23414d[_0x8ea1('0x2d')];var _0x17d5f4=_0x1f00b2?0x0:_0x42080e[_0x8ea1('0x2a')];var _0x1dbcfa=_0x1f00b2?_0x23414d['count']:_0x42080e[_0x8ea1('0x2a')]+_0x42080e[_0x8ea1('0x2b')];var _0x326472;if(_0x1dbcfa>=_0x5ea817){_0x1dbcfa=_0x5ea817;_0x326472=0xc8;}else{_0x326472=0xce;}_0x287b2b[_0x8ea1('0x27')](_0x326472);return _0x287b2b['set'](_0x8ea1('0x2e'),_0x17d5f4+'-'+_0x1dbcfa+'/'+_0x5ea817)[_0x8ea1('0x29')](_0x23414d);}return null;};}function patchUpdates(_0x71bf62){return function(_0x401174){try{jsonpatch[_0x8ea1('0x2f')](_0x401174,_0x71bf62,!![]);}catch(_0x8237f2){return BPromise[_0x8ea1('0x30')](_0x8237f2);}return _0x401174['save']();};}function saveUpdates(_0x538385,_0x4e25a0){return function(_0x2a0e7d){if(_0x2a0e7d){return _0x2a0e7d[_0x8ea1('0x31')](_0x538385)[_0x8ea1('0x1c')](function(_0x2e8214){return _0x2e8214;});}return null;};}function removeEntity(_0x51563b,_0x1b3558){return function(_0xf5188a){if(_0xf5188a){return _0xf5188a[_0x8ea1('0x32')]()[_0x8ea1('0x1c')](function(){_0x51563b[_0x8ea1('0x27')](0xcc)[_0x8ea1('0x28')]();});}};}function handleEntityNotFound(_0x3d70d2,_0x1f0508){return function(_0x3abfca){if(!_0x3abfca){_0x3d70d2[_0x8ea1('0x26')](0x194);}return _0x3abfca;};}function handleError(_0x15a791,_0xa81626){_0xa81626=_0xa81626||0x1f4;return function(_0x21f07e){logger[_0x8ea1('0x23')](_0x21f07e[_0x8ea1('0x33')]);if(_0x21f07e['name']){delete _0x21f07e['name'];}_0x15a791[_0x8ea1('0x27')](_0xa81626)['send'](_0x21f07e);};}exports['index']=function(_0x5462e2,_0x5419c6){var _0x3e0da2={},_0x57530b={},_0x57380c={'count':0x0,'rows':[]};var _0xa68c27=_[_0x8ea1('0x34')](db[_0x8ea1('0x35')]['rawAttributes'],function(_0x125515){return{'name':_0x125515['fieldName'],'type':_0x125515[_0x8ea1('0x36')][_0x8ea1('0x37')]};});_0x57530b[_0x8ea1('0x38')]=_[_0x8ea1('0x34')](_0xa68c27,_0x8ea1('0x39'));_0x57530b[_0x8ea1('0x3a')]=_['keys'](_0x5462e2['query']);_0x57530b[_0x8ea1('0x3b')]=_[_0x8ea1('0x3c')](_0x57530b[_0x8ea1('0x38')],_0x57530b['query']);_0x3e0da2[_0x8ea1('0x3d')]=_['intersection'](_0x57530b[_0x8ea1('0x38')],qs[_0x8ea1('0x3e')](_0x5462e2[_0x8ea1('0x3a')]['fields']));_0x3e0da2[_0x8ea1('0x3d')]=_0x3e0da2[_0x8ea1('0x3d')][_0x8ea1('0x3f')]?_0x3e0da2[_0x8ea1('0x3d')]:_0x57530b[_0x8ea1('0x38')];if(!_0x5462e2['query']['hasOwnProperty'](_0x8ea1('0x40'))){_0x3e0da2[_0x8ea1('0x2b')]=qs[_0x8ea1('0x2b')](_0x5462e2['query'][_0x8ea1('0x2b')]);_0x3e0da2[_0x8ea1('0x2a')]=qs[_0x8ea1('0x2a')](_0x5462e2[_0x8ea1('0x3a')][_0x8ea1('0x2a')]);}_0x3e0da2['order']=qs[_0x8ea1('0x41')](_0x5462e2[_0x8ea1('0x3a')][_0x8ea1('0x41')]);_0x3e0da2['where']=qs['filters'](_[_0x8ea1('0x42')](_0x5462e2[_0x8ea1('0x3a')],_0x57530b[_0x8ea1('0x3b')]),_0xa68c27);if(_0x5462e2[_0x8ea1('0x3a')][_0x8ea1('0x43')]){_0x3e0da2['where']=_[_0x8ea1('0x44')](_0x3e0da2[_0x8ea1('0x45')],{'$or':_[_0x8ea1('0x34')](_0xa68c27,function(_0x102d26){if(_0x102d26[_0x8ea1('0x36')]!==_0x8ea1('0x46')){var _0x5096fb={};_0x5096fb[_0x102d26[_0x8ea1('0x39')]]={'$like':'%'+_0x5462e2['query'][_0x8ea1('0x43')]+'%'};return _0x5096fb;}})});}_0x3e0da2=_[_0x8ea1('0x44')]({},_0x3e0da2,_0x5462e2[_0x8ea1('0x47')]);var _0x388d3c={'where':_0x3e0da2['where']};return db[_0x8ea1('0x35')][_0x8ea1('0x2d')](_0x388d3c)[_0x8ea1('0x1c')](function(_0x2758c8){_0x57380c['count']=_0x2758c8;if(_0x5462e2[_0x8ea1('0x3a')][_0x8ea1('0x48')]){_0x3e0da2['include']=[{'all':!![]}];}return db[_0x8ea1('0x35')]['findAll'](_0x3e0da2);})[_0x8ea1('0x1c')](function(_0x181e8c){_0x57380c['rows']=_0x181e8c;return _0x57380c;})[_0x8ea1('0x1c')](respondWithFilteredResult(_0x5419c6,_0x3e0da2))[_0x8ea1('0x49')](handleError(_0x5419c6,null));};exports[_0x8ea1('0x4a')]=function(_0x77fe9a,_0x2f0624){var _0x50c1d9={'raw':!![],'where':{'id':_0x77fe9a[_0x8ea1('0x4b')]['id']}},_0x44d5b5={};_0x44d5b5[_0x8ea1('0x38')]=_['keys'](db[_0x8ea1('0x35')][_0x8ea1('0x4c')]);_0x44d5b5[_0x8ea1('0x3a')]=_[_0x8ea1('0x4d')](_0x77fe9a[_0x8ea1('0x3a')]);_0x44d5b5[_0x8ea1('0x3b')]=_[_0x8ea1('0x3c')](_0x44d5b5[_0x8ea1('0x38')],_0x44d5b5[_0x8ea1('0x3a')]);_0x50c1d9[_0x8ea1('0x3d')]=_[_0x8ea1('0x3c')](_0x44d5b5['model'],qs[_0x8ea1('0x3e')](_0x77fe9a[_0x8ea1('0x3a')][_0x8ea1('0x3e')]));_0x50c1d9['attributes']=_0x50c1d9['attributes'][_0x8ea1('0x3f')]?_0x50c1d9[_0x8ea1('0x3d')]:_0x44d5b5[_0x8ea1('0x38')];if(_0x77fe9a['query'][_0x8ea1('0x48')]){_0x50c1d9[_0x8ea1('0x4e')]=[{'all':!![]}];}_0x50c1d9=_[_0x8ea1('0x44')]({},_0x50c1d9,_0x77fe9a[_0x8ea1('0x47')]);return db[_0x8ea1('0x35')][_0x8ea1('0x4f')](_0x50c1d9)[_0x8ea1('0x1c')](handleEntityNotFound(_0x2f0624,null))[_0x8ea1('0x1c')](respondWithResult(_0x2f0624,null))['catch'](handleError(_0x2f0624,null));};exports[_0x8ea1('0x50')]=function(_0x4ebde1,_0x38648d){return db[_0x8ea1('0x35')][_0x8ea1('0x50')](_0x4ebde1[_0x8ea1('0x51')],{})[_0x8ea1('0x1c')](respondWithResult(_0x38648d,0xc9))['catch'](handleError(_0x38648d,null));};exports[_0x8ea1('0x31')]=function(_0x26aa25,_0x357099){if(_0x26aa25[_0x8ea1('0x51')]['id']){delete _0x26aa25[_0x8ea1('0x51')]['id'];}return db[_0x8ea1('0x35')][_0x8ea1('0x4f')]({'where':{'id':_0x26aa25[_0x8ea1('0x4b')]['id']}})[_0x8ea1('0x1c')](handleEntityNotFound(_0x357099,null))[_0x8ea1('0x1c')](saveUpdates(_0x26aa25['body'],null))['then'](respondWithResult(_0x357099,null))[_0x8ea1('0x49')](handleError(_0x357099,null));};exports[_0x8ea1('0x32')]=function(_0x1552e1,_0x49c773){return db[_0x8ea1('0x35')][_0x8ea1('0x4f')]({'where':{'id':_0x1552e1[_0x8ea1('0x4b')]['id']}})[_0x8ea1('0x1c')](handleEntityNotFound(_0x49c773,null))[_0x8ea1('0x1c')](removeEntity(_0x49c773,null))['catch'](handleError(_0x49c773,null));};exports[_0x8ea1('0x52')]=function(_0x4d53a7,_0x93859){return db['ChatMessage'][_0x8ea1('0x52')]()[_0x8ea1('0x1c')](respondWithResult(_0x93859,null))[_0x8ea1('0x49')](handleError(_0x93859,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x8ea1('0x53')]=function(_0x365ffe,_0x1f838c,_0x3a359b){var _0x5d835d={'agent':{},'channel':_0x8ea1('0x54')};if(_0x365ffe['body']['id']){delete _0x365ffe[_0x8ea1('0x51')]['id'];}_0x365ffe[_0x8ea1('0x51')][_0x8ea1('0x55')]=!![];_0x365ffe['body'][_0x8ea1('0x56')]=moment()[_0x8ea1('0x57')](_0x8ea1('0x58'));_0x365ffe[_0x8ea1('0x51')]['UserId']=_0x365ffe[_0x8ea1('0x51')][_0x8ea1('0x59')]||_0x365ffe[_0x8ea1('0x5a')]['id'];_0x5d835d[_0x8ea1('0x5b')]['id']=_0x365ffe[_0x8ea1('0x51')]['UserId'];return db['ChatMessage'][_0x8ea1('0x4f')]({'where':{'id':_0x365ffe['params']['id'],'UserId':null}})[_0x8ea1('0x1c')](handleEntityNotFound(_0x1f838c,null))[_0x8ea1('0x1c')](saveUpdates(_0x365ffe[_0x8ea1('0x51')],null))[_0x8ea1('0x1c')](function(_0x3d6741){if(_0x3d6741){_0x5d835d[_0x8ea1('0x25')]=_0x3d6741[_0x8ea1('0x5c')]({'plain':!![]});return db[_0x8ea1('0x5d')][_0x8ea1('0x4f')]({'where':{'id':_0x3d6741[_0x8ea1('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x1f838c,null))[_0x8ea1('0x1c')](function(_0xcd01fc){if(_0xcd01fc){return _0xcd01fc[_0x8ea1('0x31')]({'UserId':_0x365ffe['body'][_0x8ea1('0x59')],'read1stAt':_['isNil'](_0xcd01fc['read1stAt'])?moment()[_0x8ea1('0x57')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2eeb33){if(_0x2eeb33){_0x5d835d[_0x8ea1('0x5f')]=_0x2eeb33['get']({'plain':!![]});interaction_log['info'](_0x8ea1('0x60'),_0x365ffe['user']['id'],_0x365ffe['user'][_0x8ea1('0x39')],_0x365ffe[_0x8ea1('0x5a')][_0x8ea1('0x61')],_0x5d835d[_0x8ea1('0x5f')]['id'],_0x365ffe['body']?JSON[_0x8ea1('0x22')](_0x365ffe[_0x8ea1('0x51')]):_0x8ea1('0x62'));return respondWithRpcPromise(_0x8ea1('0x63'),_0x8ea1('0x64'),_0x5d835d);}return null;})[_0x8ea1('0x1c')](function(_0xf62502){var _0x10ffa5=_0x8ea1('0x65')+_0xf62502['message'][_0x8ea1('0x66')];return db['sequelize']['query'](_0x10ffa5,{'type':db[_0x8ea1('0x67')]['QueryTypes'][_0x8ea1('0x68')],'raw':!![]})[_0x8ea1('0x1c')](function(_0x55f5b7){return _0x55f5b7;});})['then'](function(_0x27e876){if(_0x27e876){_0x5d835d[_0x8ea1('0x25')][_0x8ea1('0x69')]=_0x27e876[0x0];if(!_0x365ffe['body'][_0x8ea1('0x59')])return;return db[_0x8ea1('0x6a')][_0x8ea1('0x4f')]({'where':{'id':_0x365ffe[_0x8ea1('0x51')]['UserId'],'role':_0x8ea1('0x5b')},'attributes':['id',_0x8ea1('0x39'),_0x8ea1('0x6b'),_0x8ea1('0x6c'),_0x8ea1('0x6d')],'raw':!![]});}return null;})[_0x8ea1('0x1c')](function(_0x4eea11){if(!_0x4eea11)return null;_0x5d835d[_0x8ea1('0x25')][_0x8ea1('0x5b')]=_0x4eea11;return _0x5d835d;})[_0x8ea1('0x1c')](function(_0x291a8){if(_0x291a8){if(_0x365ffe[_0x8ea1('0x51')][_0x8ea1('0x6e')]){_0x5d835d[_0x8ea1('0x25')][_0x8ea1('0x6f')]=util['format'](_0x8ea1('0x70'),_0x365ffe['user'][_0x8ea1('0x39')]);_0x5d835d[_0x8ea1('0x25')][_0x8ea1('0x71')]=_0x5d835d[_0x8ea1('0x71')];_0x5d835d['message'][_0x8ea1('0x72')]=_0x5d835d[_0x8ea1('0x71')];_0x5d835d['message'][_0x8ea1('0x73')]=_0x8ea1('0x53');return respondWithRpcPromise(_0x8ea1('0x74'),_0x8ea1('0x74'),{'event':_0x8ea1('0x75'),'message':_[_0x8ea1('0x44')](_0x5d835d[_0x8ea1('0x25')],JSON[_0x8ea1('0x76')](_0x5d835d[_0x8ea1('0x5f')][_0x8ea1('0x77')]))},client9002)[_0x8ea1('0x1c')](function(){return _0x5d835d;});}return _0x5d835d;}return null;})[_0x8ea1('0x1c')](respondWithResult(_0x1f838c,null))[_0x8ea1('0x49')](handleError(_0x1f838c,null));};var interaction_log=require(_0x8ea1('0xf'))(_0x8ea1('0x78'));exports[_0x8ea1('0x30')]=function(_0x4cf677,_0x3ea1e5,_0x3d65dc){var _0x21bf66={'agent':{},'channel':_0x8ea1('0x54')};if(_0x4cf677['body']['id']){delete _0x4cf677[_0x8ea1('0x51')]['id'];}_0x4cf677[_0x8ea1('0x51')][_0x8ea1('0x59')]=_0x4cf677[_0x8ea1('0x51')]['UserId']||_0x4cf677[_0x8ea1('0x5a')]['id'];_0x21bf66['agent']['id']=_0x4cf677[_0x8ea1('0x51')][_0x8ea1('0x59')];return db['ChatMessage']['find']({'where':{'id':_0x4cf677[_0x8ea1('0x4b')]['id'],'UserId':null}})[_0x8ea1('0x1c')](handleEntityNotFound(_0x3ea1e5,null))[_0x8ea1('0x1c')](function(_0x23f98c){if(_0x23f98c){_0x21bf66[_0x8ea1('0x25')]=_0x23f98c['get']({'plain':!![]});return db[_0x8ea1('0x5d')][_0x8ea1('0x4f')]({'where':{'id':_0x23f98c[_0x8ea1('0x5e')]}});}return null;})[_0x8ea1('0x1c')](handleEntityNotFound(_0x3ea1e5,null))[_0x8ea1('0x1c')](function(_0x1a5ffc){if(_0x1a5ffc){_0x21bf66[_0x8ea1('0x5f')]=_0x1a5ffc[_0x8ea1('0x5c')]({'plain':!![]});interaction_log[_0x8ea1('0x1d')](_0x8ea1('0x79'),_0x4cf677[_0x8ea1('0x5a')]['id'],_0x4cf677[_0x8ea1('0x5a')]['name'],_0x4cf677[_0x8ea1('0x5a')][_0x8ea1('0x61')],_0x21bf66[_0x8ea1('0x5f')]['id'],_0x4cf677[_0x8ea1('0x51')]?JSON[_0x8ea1('0x22')](_0x4cf677['body']):_0x8ea1('0x62'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x21bf66);}return null;})[_0x8ea1('0x1c')](function(_0x137096){var _0x56c501=_0x8ea1('0x65')+_0x137096[_0x8ea1('0x25')]['ContactId'];return db[_0x8ea1('0x7a')][_0x8ea1('0x3a')](_0x56c501,{'type':db[_0x8ea1('0x67')][_0x8ea1('0x7b')]['SELECT'],'raw':!![]})[_0x8ea1('0x1c')](function(_0x1fe60d){return _0x1fe60d;});})[_0x8ea1('0x1c')](function(_0x350e48){if(_0x350e48){_0x21bf66[_0x8ea1('0x25')][_0x8ea1('0x69')]=_0x350e48[0x0];if(!_0x4cf677[_0x8ea1('0x51')][_0x8ea1('0x59')])return;return db[_0x8ea1('0x6a')][_0x8ea1('0x4f')]({'where':{'id':_0x4cf677[_0x8ea1('0x51')][_0x8ea1('0x59')],'role':_0x8ea1('0x5b')},'attributes':['id','name',_0x8ea1('0x6b'),'email','internal'],'raw':!![]});}return null;})[_0x8ea1('0x1c')](function(_0x15a31d){if(!_0x15a31d)return null;_0x21bf66[_0x8ea1('0x25')][_0x8ea1('0x5b')]=_0x15a31d;return _0x21bf66;})[_0x8ea1('0x1c')](function(_0x304e75){if(_0x304e75){_0x304e75[_0x8ea1('0x25')][_0x8ea1('0x6f')]=util['format']('SIP/%s',_0x4cf677['user']['name']);_0x304e75[_0x8ea1('0x25')]['channel']=_0x21bf66['channel'];_0x304e75[_0x8ea1('0x25')]['motionChannel']=_0x21bf66[_0x8ea1('0x71')];_0x304e75[_0x8ea1('0x25')][_0x8ea1('0x73')]=_0x8ea1('0x30');respondWithRpcPromise(_0x8ea1('0x74'),'EventManager',{'event':_0x8ea1('0x7c'),'message':_[_0x8ea1('0x44')](_0x21bf66['message'],JSON[_0x8ea1('0x76')](_0x21bf66[_0x8ea1('0x5f')][_0x8ea1('0x77')]))},client9002);return _0x21bf66;}return null;})[_0x8ea1('0x1c')](respondWithResult(_0x3ea1e5,null))[_0x8ea1('0x49')](handleError(_0x3ea1e5,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 2404295..e3830c0 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 _0x5e09=['events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3a4e7,_0x1a341c){var _0x46d66c=function(_0x241db4){while(--_0x241db4){_0x3a4e7['push'](_0x3a4e7['shift']());}};_0x46d66c(++_0x1a341c);}(_0x5e09,0x96));var _0x95e0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5e09[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x95e0('0x0'));var ChatMessage=require(_0x95e0('0x1'))['db'][_0x95e0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x95e0('0x3')](0x0);var events={'afterCreate':_0x95e0('0x4'),'afterUpdate':'update','afterDestroy':_0x95e0('0x5')};function emitEvent(_0xdc9d2d){return function(_0x540df3,_0x5d8c2d,_0x108aae){ChatMessageEvents[_0x95e0('0x6')](_0xdc9d2d+':'+_0x540df3['id'],_0x540df3);ChatMessageEvents[_0x95e0('0x6')](_0xdc9d2d,_0x540df3);_0x108aae(null);};}for(var e in events){if(events[_0x95e0('0x7')](e)){var event=events[e];ChatMessage[_0x95e0('0x8')](e,emitEvent(event));}}module[_0x95e0('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0xa3cf=['../../mysqldb','ChatMessage','setMaxListeners','emit','hook','exports'];(function(_0x4ce611,_0x2bd68f){var _0x9e7299=function(_0x50e524){while(--_0x50e524){_0x4ce611['push'](_0x4ce611['shift']());}};_0x9e7299(++_0x2bd68f);}(_0xa3cf,0x150));var _0xfa3c=function(_0x4ceadb,_0x4acb5c){_0x4ceadb=_0x4ceadb-0x0;var _0x280bb2=_0xa3cf[_0x4ceadb];return _0x280bb2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xfa3c('0x0'))['db'][_0xfa3c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xfa3c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x211e66){return function(_0x11cb5d,_0xd12b3a,_0x5456cf){ChatMessageEvents[_0xfa3c('0x3')](_0x211e66+':'+_0x11cb5d['id'],_0x11cb5d);ChatMessageEvents[_0xfa3c('0x3')](_0x211e66,_0x11cb5d);_0x5456cf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xfa3c('0x4')](e,emitEvent(event));}}module[_0xfa3c('0x5')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 36a880a..d43238a 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 _0x6a08=['catch','error','utf8mb4','utf8mb4_unicode_ci','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','update','createdAt'];(function(_0x1049cb,_0x2ef378){var _0x274d05=function(_0x205649){while(--_0x205649){_0x1049cb['push'](_0x1049cb['shift']());}};_0x274d05(++_0x2ef378);}(_0x6a08,0xfe));var _0x86a0=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x6a08[_0x35a274];return _0x40d905;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x86a0('0x0'));var moment=require('moment');var BPromise=require(_0x86a0('0x1'));var rp=require(_0x86a0('0x2'));var fs=require('fs');var path=require(_0x86a0('0x3'));var rimraf=require('rimraf');var config=require(_0x86a0('0x4'));var attributes=require(_0x86a0('0x5'));module[_0x86a0('0x6')]=function(_0x59d740,_0x549c2b){return _0x59d740['define'](_0x86a0('0x7'),attributes,{'tableName':_0x86a0('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x86a0('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fa003,_0x318e1b,_0x21f13f){var _0x9b51c1=_0x59d740['models'];var _0x404949=_0x1fa003[_0x86a0('0xa')]({'plain':!![]});if(_0x404949[_0x86a0('0xb')][_0x86a0('0xc')]()==='in'||_0x404949[_0x86a0('0xb')][_0x86a0('0xc')]()===_0x86a0('0xd')&&!_0x404949[_0x86a0('0xe')]&&!_[_0x86a0('0xf')](_0x404949[_0x86a0('0x10')])){_0x9b51c1[_0x86a0('0x11')]['findOne']({'where':{'id':_0x404949[_0x86a0('0x12')]}})['then'](function(_0x3c8c10){if(_0x3c8c10){_0x3c8c10[_0x86a0('0x13')]({'lastMsgAt':_0x404949[_0x86a0('0x14')],'lastMsgDirection':_0x404949[_0x86a0('0xb')]['toLowerCase']()});}})[_0x86a0('0x15')](function(_0x303a35){console[_0x86a0('0x16')](_0x303a35);});}_0x21f13f();}},'charset':_0x86a0('0x17'),'collate':_0x86a0('0x18')});}; \ No newline at end of file +var _0x3d9e=['UserId','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x382c89,_0xca765e){var _0x302c19=function(_0x35b3f2){while(--_0x35b3f2){_0x382c89['push'](_0x382c89['shift']());}};_0x302c19(++_0xca765e);}(_0x3d9e,0x181));var _0xe3d9=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x3d9e[_0x2f6541];return _0x4d76d8;};'use strict';var _=require('lodash');var util=require(_0xe3d9('0x0'));var logger=require(_0xe3d9('0x1'))(_0xe3d9('0x2'));var moment=require(_0xe3d9('0x3'));var BPromise=require(_0xe3d9('0x4'));var rp=require(_0xe3d9('0x5'));var fs=require('fs');var path=require(_0xe3d9('0x6'));var rimraf=require(_0xe3d9('0x7'));var config=require(_0xe3d9('0x8'));var attributes=require('./chatMessage.attributes');module[_0xe3d9('0x9')]=function(_0xfa896e,_0x178be9){return _0xfa896e['define']('ChatMessage',attributes,{'tableName':_0xe3d9('0xa'),'paranoid':![],'indexes':[{'name':_0xe3d9('0xb'),'fields':[_0xe3d9('0xc')],'type':_0xe3d9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3615cb,_0x4da71e,_0x173415){var _0x55f612=_0xfa896e[_0xe3d9('0xe')];var _0x85104d=_0x3615cb[_0xe3d9('0xf')]({'plain':!![]});if(_0x85104d[_0xe3d9('0x10')][_0xe3d9('0x11')]()==='in'||_0x85104d['direction'][_0xe3d9('0x11')]()===_0xe3d9('0x12')&&!_0x85104d[_0xe3d9('0x13')]&&!_[_0xe3d9('0x14')](_0x85104d[_0xe3d9('0x15')])){_0x55f612['ChatInteraction']['findOne']({'where':{'id':_0x85104d[_0xe3d9('0x16')]}})['then'](function(_0x7a827){if(_0x7a827){_0x7a827[_0xe3d9('0x17')]({'lastMsgAt':_0x85104d[_0xe3d9('0x18')],'lastMsgDirection':_0x85104d[_0xe3d9('0x10')][_0xe3d9('0x11')]()});}})[_0xe3d9('0x19')](function(_0x3d2860){console[_0xe3d9('0x1a')](_0x3d2860);});}_0x173415();}},'charset':_0xe3d9('0x1b'),'collate':_0xe3d9('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index d4ad5ad..a681c49 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 _0x77ed=['message','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatMessage.socket','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s'];(function(_0x3f619d,_0x4762c5){var _0x1eb364=function(_0x407268){while(--_0x407268){_0x3f619d['push'](_0x3f619d['shift']());}};_0x1eb364(++_0x4762c5);}(_0x77ed,0x152));var _0xd77e=function(_0x542a40,_0x17dc8f){_0x542a40=_0x542a40-0x0;var _0x2258cd=_0x77ed[_0x542a40];return _0x2258cd;};'use strict';var _=require(_0xd77e('0x0'));var util=require(_0xd77e('0x1'));var moment=require('moment');var BPromise=require(_0xd77e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd77e('0x3'));var db=require(_0xd77e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd77e('0x5'))(_0xd77e('0x6'));var config=require(_0xd77e('0x7'));var jayson=require(_0xd77e('0x8'));var client=jayson[_0xd77e('0x9')][_0xd77e('0xa')]({'port':0x232a});config['redis']=_[_0xd77e('0xb')](config['redis'],{'host':_0xd77e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd77e('0xd')]));require(_0xd77e('0xe'))[_0xd77e('0xf')](socket);function respondWithRpcPromise(_0x2c8cd0,_0x48131e,_0x21e9b0){return new BPromise(function(_0x1aacdb,_0x4f66d0){return client[_0xd77e('0x10')](_0x2c8cd0,_0x21e9b0)[_0xd77e('0x11')](function(_0x54319f){logger[_0xd77e('0x12')]('ChatMessage,\x20%s,\x20%s',_0x48131e,_0xd77e('0x13'));logger['debug'](_0xd77e('0x14'),_0x48131e,_0xd77e('0x13'),JSON[_0xd77e('0x15')](_0x54319f));if(_0x54319f['error']){if(_0x54319f[_0xd77e('0x16')][_0xd77e('0x17')]===0x1f4){logger['error'](_0xd77e('0x18'),_0x48131e,_0x54319f[_0xd77e('0x16')][_0xd77e('0x19')]);return _0x4f66d0(_0x54319f[_0xd77e('0x16')]['message']);}logger[_0xd77e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x48131e,_0x54319f[_0xd77e('0x16')][_0xd77e('0x19')]);return _0x1aacdb(_0x54319f[_0xd77e('0x16')][_0xd77e('0x19')]);}else{logger[_0xd77e('0x12')](_0xd77e('0x18'),_0x48131e,'request\x20sent');_0x1aacdb(_0x54319f['result'][_0xd77e('0x19')]);}})['catch'](function(_0x3f3ea3){logger[_0xd77e('0x16')](_0xd77e('0x18'),_0x48131e,_0x3f3ea3);_0x4f66d0(_0x3f3ea3);});});}exports[_0xd77e('0x1a')]=function(_0x3c6d8f){var _0x57c9ff=this;return new Promise(function(_0x1d38d7,_0x5b3bb8){return db[_0xd77e('0x1b')][_0xd77e('0x1c')](_0x3c6d8f[_0xd77e('0x1d')],{'raw':_0x3c6d8f[_0xd77e('0x1e')]?_0x3c6d8f[_0xd77e('0x1e')][_0xd77e('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x14f187){logger['info']('CreateChatMessage',_0x3c6d8f);logger['debug'](_0xd77e('0x1a'),_0x3c6d8f,JSON[_0xd77e('0x15')](_0x14f187));_0x1d38d7(_0x14f187);})[_0xd77e('0x20')](function(_0x347700){logger[_0xd77e('0x16')](_0xd77e('0x1a'),_0x347700[_0xd77e('0x19')],_0x3c6d8f);_0x5b3bb8(_0x57c9ff['error'](0x1f4,_0x347700[_0xd77e('0x19')]));});});}; \ No newline at end of file +var _0x5186=['socket.io-emitter','redis','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults','localhost'];(function(_0x262fb1,_0x54d50d){var _0x39c238=function(_0x32fa66){while(--_0x32fa66){_0x262fb1['push'](_0x262fb1['shift']());}};_0x39c238(++_0x54d50d);}(_0x5186,0x180));var _0x6518=function(_0x3dd6b0,_0x5222f1){_0x3dd6b0=_0x3dd6b0-0x0;var _0x51e3be=_0x5186[_0x3dd6b0];return _0x51e3be;};'use strict';var _=require(_0x6518('0x0'));var util=require(_0x6518('0x1'));var moment=require(_0x6518('0x2'));var BPromise=require(_0x6518('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6518('0x4'));var db=require(_0x6518('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6518('0x6'));var config=require('../../config/environment');var jayson=require(_0x6518('0x7'));var client=jayson[_0x6518('0x8')][_0x6518('0x9')]({'port':0x232a});config['redis']=_[_0x6518('0xa')](config['redis'],{'host':_0x6518('0xb'),'port':0x18eb});var socket=require(_0x6518('0xc'))(new Redis(config[_0x6518('0xd')]));require(_0x6518('0xe'))['register'](socket);function respondWithRpcPromise(_0x3414ff,_0x3b2e34,_0x2ba042){return new BPromise(function(_0x3e42dd,_0x3ea3d7){return client[_0x6518('0xf')](_0x3414ff,_0x2ba042)[_0x6518('0x10')](function(_0xaa4c87){logger[_0x6518('0x11')](_0x6518('0x12'),_0x3b2e34,_0x6518('0x13'));logger['debug'](_0x6518('0x14'),_0x3b2e34,_0x6518('0x13'),JSON[_0x6518('0x15')](_0xaa4c87));if(_0xaa4c87['error']){if(_0xaa4c87['error'][_0x6518('0x16')]===0x1f4){logger[_0x6518('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3b2e34,_0xaa4c87[_0x6518('0x17')][_0x6518('0x18')]);return _0x3ea3d7(_0xaa4c87['error'][_0x6518('0x18')]);}logger[_0x6518('0x17')](_0x6518('0x12'),_0x3b2e34,_0xaa4c87['error']['message']);return _0x3e42dd(_0xaa4c87[_0x6518('0x17')][_0x6518('0x18')]);}else{logger[_0x6518('0x11')](_0x6518('0x12'),_0x3b2e34,_0x6518('0x13'));_0x3e42dd(_0xaa4c87['result'][_0x6518('0x18')]);}})[_0x6518('0x19')](function(_0x53f49a){logger[_0x6518('0x17')](_0x6518('0x12'),_0x3b2e34,_0x53f49a);_0x3ea3d7(_0x53f49a);});});}exports[_0x6518('0x1a')]=function(_0x29302e){var _0x486a0f=this;return new Promise(function(_0x2fa8a9,_0x5785ff){return db[_0x6518('0x1b')][_0x6518('0x1c')](_0x29302e[_0x6518('0x1d')],{'raw':_0x29302e['options']?_0x29302e[_0x6518('0x1e')][_0x6518('0x1f')]===undefined?!![]:![]:!![]})[_0x6518('0x10')](function(_0x28f27a){logger[_0x6518('0x11')](_0x6518('0x1a'),_0x29302e);logger[_0x6518('0x20')](_0x6518('0x1a'),_0x29302e,JSON['stringify'](_0x28f27a));_0x2fa8a9(_0x28f27a);})[_0x6518('0x19')](function(_0x3cb488){logger[_0x6518('0x17')](_0x6518('0x1a'),_0x3cb488[_0x6518('0x18')],_0x29302e);_0x5785ff(_0x486a0f[_0x6518('0x17')](0x1f4,_0x3cb488['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2daa9b1..9a6768e 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 _0x2494=['update','emit','removeListener','chatMessage:','./chatMessage.events','remove'];(function(_0x2e5a27,_0x463951){var _0xbe7578=function(_0x215eb5){while(--_0x215eb5){_0x2e5a27['push'](_0x2e5a27['shift']());}};_0xbe7578(++_0x463951);}(_0x2494,0x82));var _0x4249=function(_0x1200ea,_0x5e7f0f){_0x1200ea=_0x1200ea-0x0;var _0x1da059=_0x2494[_0x1200ea];return _0x1da059;};'use strict';var ChatMessageEvents=require(_0x4249('0x0'));var events=['save',_0x4249('0x1'),_0x4249('0x2')];function createListener(_0x3cdee4,_0x3f9dc6){return function(_0x161e6b){_0x3f9dc6[_0x4249('0x3')](_0x3cdee4,_0x161e6b);};}function removeListener(_0x5decbd,_0x4fdc12){return function(){ChatMessageEvents[_0x4249('0x4')](_0x5decbd,_0x4fdc12);};}exports['register']=function(_0x3c2d8d){for(var _0x1d4ca8=0x0,_0xed716a=events['length'];_0x1d4ca8<_0xed716a;_0x1d4ca8++){var _0x326336=events[_0x1d4ca8];var _0x2b7934=createListener(_0x4249('0x5')+_0x326336,_0x3c2d8d);ChatMessageEvents['on'](_0x326336,_0x2b7934);}}; \ No newline at end of file +var _0xff2a=['removeListener','length','chatMessage:','save','remove','emit'];(function(_0x46f88c,_0x5e7855){var _0x146849=function(_0x2afbbc){while(--_0x2afbbc){_0x46f88c['push'](_0x46f88c['shift']());}};_0x146849(++_0x5e7855);}(_0xff2a,0x93));var _0xaff2=function(_0x53e787,_0x4298e6){_0x53e787=_0x53e787-0x0;var _0x2781a0=_0xff2a[_0x53e787];return _0x2781a0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xaff2('0x0'),_0xaff2('0x1'),'update'];function createListener(_0x1c7cc9,_0x25db80){return function(_0x5bb7dd){_0x25db80[_0xaff2('0x2')](_0x1c7cc9,_0x5bb7dd);};}function removeListener(_0x5c7c1c,_0x1cf624){return function(){ChatMessageEvents[_0xaff2('0x3')](_0x5c7c1c,_0x1cf624);};}exports['register']=function(_0x70cadf){for(var _0x8313e5=0x0,_0x2e4f44=events[_0xaff2('0x4')];_0x8313e5<_0x2e4f44;_0x8313e5++){var _0x33229b=events[_0x8313e5];var _0x1125e=createListener(_0xaff2('0x5')+_0x33229b,_0x70cadf);ChatMessageEvents['on'](_0x33229b,_0x1125e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 47d7899..1567f5a 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 _0xa3e2=['get','isAuthenticated','index','/describe','describe','/:id','show','chat','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0xa3e2,0x1dc));var _0x2a3e=function(_0x4ddfe1,_0x35939d){_0x4ddfe1=_0x4ddfe1-0x0;var _0x4aaf51=_0xa3e2[_0x4ddfe1];return _0x4aaf51;};'use strict';var multer=require(_0x2a3e('0x0'));var util=require(_0x2a3e('0x1'));var path=require(_0x2a3e('0x2'));var timeout=require(_0x2a3e('0x3'));var express=require(_0x2a3e('0x4'));var router=express[_0x2a3e('0x5')]();var fs_extra=require(_0x2a3e('0x6'));var auth=require(_0x2a3e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2a3e('0x8'));var controller=require(_0x2a3e('0x9'));router[_0x2a3e('0xa')]('/',auth[_0x2a3e('0xb')](),controller[_0x2a3e('0xc')]);router[_0x2a3e('0xa')](_0x2a3e('0xd'),auth[_0x2a3e('0xb')](),controller[_0x2a3e('0xe')]);router[_0x2a3e('0xa')](_0x2a3e('0xf'),auth['isAuthenticated'](),controller[_0x2a3e('0x10')]);router['post']('/',auth[_0x2a3e('0xb')](),interaction['tracked'](_0x2a3e('0x11'),'chatmessage:create'),controller[_0x2a3e('0x12')]);router[_0x2a3e('0x13')](_0x2a3e('0xf'),controller[_0x2a3e('0x14')]);router['put'](_0x2a3e('0x15'),auth[_0x2a3e('0xb')](),controller[_0x2a3e('0x16')]);router[_0x2a3e('0x13')](_0x2a3e('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x2a3e('0x18')](_0x2a3e('0xf'),auth[_0x2a3e('0xb')](),controller[_0x2a3e('0x19')]);module[_0x2a3e('0x1a')]=router; \ No newline at end of file +var _0x549e=['create','update','put','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked'];(function(_0x92ae86,_0x26822a){var _0x8fbc48=function(_0xc3e55){while(--_0xc3e55){_0x92ae86['push'](_0x92ae86['shift']());}};_0x8fbc48(++_0x26822a);}(_0x549e,0x11b));var _0xe549=function(_0x277446,_0xbef1a4){_0x277446=_0x277446-0x0;var _0x3486ed=_0x549e[_0x277446];return _0x3486ed;};'use strict';var multer=require(_0xe549('0x0'));var util=require(_0xe549('0x1'));var path=require(_0xe549('0x2'));var timeout=require(_0xe549('0x3'));var express=require(_0xe549('0x4'));var router=express['Router']();var fs_extra=require(_0xe549('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe549('0x6'));var config=require(_0xe549('0x7'));var controller=require(_0xe549('0x8'));router[_0xe549('0x9')]('/',auth[_0xe549('0xa')](),controller[_0xe549('0xb')]);router['get'](_0xe549('0xc'),auth[_0xe549('0xa')](),controller[_0xe549('0xd')]);router[_0xe549('0x9')](_0xe549('0xe'),auth[_0xe549('0xa')](),controller[_0xe549('0xf')]);router['post']('/',auth[_0xe549('0xa')](),interaction[_0xe549('0x10')]('chat','chatmessage:create'),controller[_0xe549('0x11')]);router['put'](_0xe549('0xe'),controller[_0xe549('0x12')]);router[_0xe549('0x13')](_0xe549('0x14'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth[_0xe549('0xa')](),controller[_0xe549('0x15')]);router[_0xe549('0x16')](_0xe549('0xe'),auth[_0xe549('0xa')](),controller[_0xe549('0x17')]);module[_0xe549('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 84bbbb2..b66f3e9 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x29e6ed,_0x2e3937){var _0x116191=function(_0x4f86c1){while(--_0x4f86c1){_0x29e6ed['push'](_0x29e6ed['shift']());}};_0x116191(++_0x2e3937);}(_0xdb28,0x106));var _0x8db2=function(_0x241d38,_0x33974d){_0x241d38=_0x241d38-0x0;var _0x1c5689=_0xdb28[_0x241d38];return _0x1c5689;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1b7ea6,_0x195a62){_0x1b7ea6=_0x1b7ea6-0x0;var _0x4fcea6=_0x0b0e[_0x1b7ea6];return _0x4fcea6;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 342f992..1be9ec2 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x7a54,0x106));var _0x47a5=function(_0x39b9f6,_0x20daf3){_0x39b9f6=_0x39b9f6-0x0;var _0x47dca5=_0x7a54[_0x39b9f6];return _0x47dca5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3be445,_0x128238){var _0x3164be=function(_0x2befa8){while(--_0x2befa8){_0x3be445['push'](_0x3be445['shift']());}};_0x3164be(++_0x128238);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 8748908..7e5ae79 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 _0xe567=['ChatOfflineMessage','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4f9b5b,_0x338f8f){var _0x5d171a=function(_0x52b25f){while(--_0x52b25f){_0x4f9b5b['push'](_0x4f9b5b['shift']());}};_0x5d171a(++_0x338f8f);}(_0xe567,0xa6));var _0x7e56=function(_0x2253fa,_0x4babea){_0x2253fa=_0x2253fa-0x0;var _0x1751b9=_0xe567[_0x2253fa];return _0x1751b9;};'use strict';var EventEmitter=require(_0x7e56('0x0'));var ChatOfflineMessage=require(_0x7e56('0x1'))['db'][_0x7e56('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7e56('0x3')};function emitEvent(_0x488e20){return function(_0x27ebcc,_0x5d0ca0,_0x1fb3e5){ChatOfflineMessageEvents[_0x7e56('0x4')](_0x488e20+':'+_0x27ebcc['id'],_0x27ebcc);ChatOfflineMessageEvents[_0x7e56('0x4')](_0x488e20,_0x27ebcc);_0x1fb3e5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x7e56('0x5')](e,emitEvent(event));}}module[_0x7e56('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xc180=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5941b7,_0x499160){var _0x2ae4df=function(_0x17a9d5){while(--_0x17a9d5){_0x5941b7['push'](_0x5941b7['shift']());}};_0x2ae4df(++_0x499160);}(_0xc180,0x15e));var _0x0c18=function(_0x19eb97,_0x51577a){_0x19eb97=_0x19eb97-0x0;var _0x4e9cb1=_0xc180[_0x19eb97];return _0x4e9cb1;};'use strict';var EventEmitter=require(_0x0c18('0x0'));var ChatOfflineMessage=require(_0x0c18('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0c18('0x2'),'afterUpdate':_0x0c18('0x3'),'afterDestroy':_0x0c18('0x4')};function emitEvent(_0x3a3555){return function(_0x1f1e41,_0x548a9f,_0x395055){ChatOfflineMessageEvents[_0x0c18('0x5')](_0x3a3555+':'+_0x1f1e41['id'],_0x1f1e41);ChatOfflineMessageEvents[_0x0c18('0x5')](_0x3a3555,_0x1f1e41);_0x395055(null);};}for(var e in events){if(events[_0x0c18('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x0c18('0x7')](e,emitEvent(event));}}module[_0x0c18('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7b7121f..b6fdc97 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 _0x7865=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x7d92b9,_0x59c183){var _0x23c542=function(_0x1bde1e){while(--_0x1bde1e){_0x7d92b9['push'](_0x7d92b9['shift']());}};_0x23c542(++_0x59c183);}(_0x7865,0x125));var _0x5786=function(_0x3aaec4,_0x1374a2){_0x3aaec4=_0x3aaec4-0x0;var _0x10fe8d=_0x7865[_0x3aaec4];return _0x10fe8d;};'use strict';var attributes=require(_0x5786('0x0'));module[_0x5786('0x1')]=function(_0xe84d6c){return _0xe84d6c[_0x5786('0x2')](_0x5786('0x3'),attributes,{'tableName':_0x5786('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5786('0x5'),'collate':_0x5786('0x6')});}; \ No newline at end of file +var _0xc2d6=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','define'];(function(_0x64e24d,_0x1bfab5){var _0x2f8b96=function(_0xce26e1){while(--_0xce26e1){_0x64e24d['push'](_0x64e24d['shift']());}};_0x2f8b96(++_0x1bfab5);}(_0xc2d6,0x1cf));var _0x6c2d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xc2d6[_0xefd519];return _0x4bb882;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x4798ec){return _0x4798ec[_0x6c2d('0x0')]('ChatOfflineMessage',attributes,{'tableName':_0x6c2d('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c2d('0x2'),'collate':_0x6c2d('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 2f94ec2..ebc2050 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 _0xa34e=['ioredis','../../config/environment','jayson/promise','client','http','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring'];(function(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0xa34e,0x19e));var _0xea34=function(_0xfc36d8,_0x233b0b){_0xfc36d8=_0xfc36d8-0x0;var _0x234f42=_0xa34e[_0xfc36d8];return _0x234f42;};'use strict';var _=require(_0xea34('0x0'));var util=require(_0xea34('0x1'));var moment=require('moment');var BPromise=require(_0xea34('0x2'));var rs=require(_0xea34('0x3'));var fs=require('fs');var Redis=require(_0xea34('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xea34('0x5'));var jayson=require(_0xea34('0x6'));var client=jayson[_0xea34('0x7')][_0xea34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34ee77,_0x3e10af,_0xdcdb59){return new BPromise(function(_0x54d3ee,_0x1d0e1a){return client['request'](_0x34ee77,_0xdcdb59)[_0xea34('0x9')](function(_0x415328){logger[_0xea34('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3e10af,'request\x20sent');logger[_0xea34('0xb')](_0xea34('0xc'),_0x3e10af,_0xea34('0xd'),JSON[_0xea34('0xe')](_0x415328));if(_0x415328['error']){if(_0x415328[_0xea34('0xf')]['code']===0x1f4){logger['error'](_0xea34('0x10'),_0x3e10af,_0x415328[_0xea34('0xf')][_0xea34('0x11')]);return _0x1d0e1a(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}logger[_0xea34('0xf')](_0xea34('0x10'),_0x3e10af,_0x415328['error'][_0xea34('0x11')]);return _0x54d3ee(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}else{logger['info'](_0xea34('0x10'),_0x3e10af,_0xea34('0xd'));_0x54d3ee(_0x415328['result'][_0xea34('0x11')]);}})[_0xea34('0x12')](function(_0x2b1380){logger['error'](_0xea34('0x10'),_0x3e10af,_0x2b1380);_0x1d0e1a(_0x2b1380);});});} \ No newline at end of file +var _0x3525=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x2132c0,_0xbc40a8){var _0x364b5b=function(_0x8ba567){while(--_0x8ba567){_0x2132c0['push'](_0x2132c0['shift']());}};_0x364b5b(++_0xbc40a8);}(_0x3525,0x143));var _0x5352=function(_0x1e76fd,_0x25167d){_0x1e76fd=_0x1e76fd-0x0;var _0x2e7572=_0x3525[_0x1e76fd];return _0x2e7572;};'use strict';var _=require(_0x5352('0x0'));var util=require(_0x5352('0x1'));var moment=require(_0x5352('0x2'));var BPromise=require(_0x5352('0x3'));var rs=require(_0x5352('0x4'));var fs=require('fs');var Redis=require(_0x5352('0x5'));var db=require(_0x5352('0x6'))['db'];var utils=require(_0x5352('0x7'));var logger=require('../../config/logger')(_0x5352('0x8'));var config=require(_0x5352('0x9'));var jayson=require(_0x5352('0xa'));var client=jayson[_0x5352('0xb')][_0x5352('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a6f6f,_0x5b1065,_0x11cbbc){return new BPromise(function(_0x9d74dc,_0x4bd764){return client[_0x5352('0xd')](_0x3a6f6f,_0x11cbbc)[_0x5352('0xe')](function(_0x4f6fb2){logger[_0x5352('0xf')](_0x5352('0x10'),_0x5b1065,_0x5352('0x11'));logger[_0x5352('0x12')](_0x5352('0x13'),_0x5b1065,_0x5352('0x11'),JSON['stringify'](_0x4f6fb2));if(_0x4f6fb2[_0x5352('0x14')]){if(_0x4f6fb2[_0x5352('0x14')][_0x5352('0x15')]===0x1f4){logger[_0x5352('0x14')](_0x5352('0x10'),_0x5b1065,_0x4f6fb2['error']['message']);return _0x4bd764(_0x4f6fb2[_0x5352('0x14')][_0x5352('0x16')]);}logger[_0x5352('0x14')](_0x5352('0x10'),_0x5b1065,_0x4f6fb2['error'][_0x5352('0x16')]);return _0x9d74dc(_0x4f6fb2['error'][_0x5352('0x16')]);}else{logger[_0x5352('0xf')](_0x5352('0x10'),_0x5b1065,_0x5352('0x11'));_0x9d74dc(_0x4f6fb2[_0x5352('0x17')][_0x5352('0x16')]);}})[_0x5352('0x18')](function(_0xd14043){logger[_0x5352('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5b1065,_0xd14043);_0x4bd764(_0xd14043);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index c920e39..18d0567 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 _0x476f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','fs-extra'];(function(_0x27411e,_0x5b5ce9){var _0x318104=function(_0x32a6f9){while(--_0x32a6f9){_0x27411e['push'](_0x27411e['shift']());}};_0x318104(++_0x5b5ce9);}(_0x476f,0xa8));var _0xf476=function(_0x8ac933,_0x27ede1){_0x8ac933=_0x8ac933-0x0;var _0x5053c6=_0x476f[_0x8ac933];return _0x5053c6;};'use strict';var multer=require(_0xf476('0x0'));var util=require(_0xf476('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf476('0x2'));var auth=require(_0xf476('0x3'));var interaction=require(_0xf476('0x4'));var config=require(_0xf476('0x5'));var controller=require(_0xf476('0x6'));router[_0xf476('0x7')]('/',auth[_0xf476('0x8')](),controller[_0xf476('0x9')]);router[_0xf476('0x7')]('/describe',auth[_0xf476('0x8')](),controller[_0xf476('0xa')]);router['get'](_0xf476('0xb'),auth[_0xf476('0x8')](),controller[_0xf476('0xc')]);router[_0xf476('0xd')]('/',auth[_0xf476('0x8')](),controller['create']);router[_0xf476('0xe')](_0xf476('0xb'),auth[_0xf476('0x8')](),controller[_0xf476('0xf')]);router[_0xf476('0x10')](_0xf476('0xb'),auth[_0xf476('0x8')](),controller[_0xf476('0x11')]);module[_0xf476('0x12')]=router; \ No newline at end of file +var _0xd700=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x305792,_0x491a61){var _0x394535=function(_0x32230a){while(--_0x32230a){_0x305792['push'](_0x305792['shift']());}};_0x394535(++_0x491a61);}(_0xd700,0x1b5));var _0x0d70=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xd700[_0xe0b81f];return _0x290e5e;};'use strict';var multer=require(_0x0d70('0x0'));var util=require(_0x0d70('0x1'));var path=require(_0x0d70('0x2'));var timeout=require(_0x0d70('0x3'));var express=require(_0x0d70('0x4'));var router=express[_0x0d70('0x5')]();var fs_extra=require(_0x0d70('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0d70('0x7'));var config=require(_0x0d70('0x8'));var controller=require(_0x0d70('0x9'));router[_0x0d70('0xa')]('/',auth[_0x0d70('0xb')](),controller[_0x0d70('0xc')]);router[_0x0d70('0xa')](_0x0d70('0xd'),auth[_0x0d70('0xb')](),controller[_0x0d70('0xe')]);router[_0x0d70('0xa')](_0x0d70('0xf'),auth[_0x0d70('0xb')](),controller[_0x0d70('0x10')]);router[_0x0d70('0x11')]('/',auth[_0x0d70('0xb')](),controller['create']);router[_0x0d70('0x12')](_0x0d70('0xf'),auth[_0x0d70('0xb')](),controller[_0x0d70('0x13')]);router[_0x0d70('0x14')](_0x0d70('0xf'),auth[_0x0d70('0xb')](),controller[_0x0d70('0x15')]);module[_0x0d70('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a46f105..92b64d3 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 _0x6a94=['ENUM','mouseOver','timeout','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a94,0xbc));var _0x46a9=function(_0x3d5e90,_0x2786b4){_0x3d5e90=_0x3d5e90-0x0;var _0x4f4de6=_0x6a94[_0x3d5e90];return _0x4f4de6;};'use strict';var Sequelize=require('sequelize');module[_0x46a9('0x0')]={'name':{'type':Sequelize[_0x46a9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x46a9('0x2')](_0x46a9('0x3'),_0x46a9('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe88f=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x511282,_0x57a251){var _0x26a59a=function(_0xc13ec4){while(--_0xc13ec4){_0x511282['push'](_0x511282['shift']());}};_0x26a59a(++_0x57a251);}(_0xe88f,0x8c));var _0xfe88=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0xe88f[_0x3825a8];return _0xabc9bc;};'use strict';var Sequelize=require(_0xfe88('0x0'));module[_0xfe88('0x1')]={'name':{'type':Sequelize[_0xfe88('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfe88('0x3')](_0xfe88('0x4'),_0xfe88('0x5')),'defaultValue':_0xfe88('0x4')},'selector':{'type':Sequelize[_0xfe88('0x2')]},'timeout':{'type':Sequelize[_0xfe88('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 9aa6526..5f97a7f 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 _0x5c91=['status','offset','undefined','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','length','merge','options','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0x5c91,0x1e9));var _0x15c9=function(_0x632b63,_0x44ff9c){_0x632b63=_0x632b63-0x0;var _0x212574=_0x5c91[_0x632b63];return _0x212574;};'use strict';var emlformat=require(_0x15c9('0x0'));var rimraf=require(_0x15c9('0x1'));var zipdir=require(_0x15c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15c9('0x3'));var moment=require(_0x15c9('0x4'));var BPromise=require(_0x15c9('0x5'));var Mustache=require(_0x15c9('0x6'));var util=require(_0x15c9('0x7'));var path=require(_0x15c9('0x8'));var sox=require('sox');var csv=require(_0x15c9('0x9'));var ejs=require(_0x15c9('0xa'));var fs=require('fs');var fs_extra=require(_0x15c9('0xb'));var _=require(_0x15c9('0xc'));var squel=require(_0x15c9('0xd'));var crypto=require('crypto');var jsforce=require(_0x15c9('0xe'));var deskjs=require(_0x15c9('0xf'));var toCsv=require(_0x15c9('0x9'));var querystring=require('querystring');var Papa=require(_0x15c9('0x10'));var Redis=require(_0x15c9('0x11'));var authService=require(_0x15c9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15c9('0x13'));var logger=require(_0x15c9('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x15c9('0x15'));var db=require(_0x15c9('0x16'))['db'];function respondWithStatusCode(_0x5d205d,_0x20062a){_0x20062a=_0x20062a||0xcc;return function(_0x28a6fa){if(_0x28a6fa){return _0x5d205d[_0x15c9('0x17')](_0x20062a);}return _0x5d205d['status'](_0x20062a)['end']();};}function respondWithResult(_0x9e4403,_0xd71ac0){_0xd71ac0=_0xd71ac0||0xc8;return function(_0x51812c){if(_0x51812c){return _0x9e4403[_0x15c9('0x18')](_0xd71ac0)['json'](_0x51812c);}};}function respondWithFilteredResult(_0x3b768e,_0x15ce03){return function(_0x1705a8){if(_0x1705a8){var _0x20c60b=typeof _0x15ce03[_0x15c9('0x19')]===_0x15c9('0x1a')&&typeof _0x15ce03['limit']===_0x15c9('0x1a');var _0x41cdaa=_0x1705a8[_0x15c9('0x1b')];var _0x449f20=_0x20c60b?0x0:_0x15ce03[_0x15c9('0x19')];var _0x2d36e5=_0x20c60b?_0x1705a8[_0x15c9('0x1b')]:_0x15ce03[_0x15c9('0x19')]+_0x15ce03['limit'];var _0x37fa30;if(_0x2d36e5>=_0x41cdaa){_0x2d36e5=_0x41cdaa;_0x37fa30=0xc8;}else{_0x37fa30=0xce;}_0x3b768e[_0x15c9('0x18')](_0x37fa30);return _0x3b768e[_0x15c9('0x1c')](_0x15c9('0x1d'),_0x449f20+'-'+_0x2d36e5+'/'+_0x41cdaa)[_0x15c9('0x1e')](_0x1705a8);}return null;};}function patchUpdates(_0x4539c0){return function(_0x4a48fb){try{jsonpatch['apply'](_0x4a48fb,_0x4539c0,!![]);}catch(_0x5429d){return BPromise[_0x15c9('0x1f')](_0x5429d);}return _0x4a48fb[_0x15c9('0x20')]();};}function saveUpdates(_0x191b9a,_0xd0bf39){return function(_0xa8253c){if(_0xa8253c){return _0xa8253c[_0x15c9('0x21')](_0x191b9a)[_0x15c9('0x22')](function(_0x216b24){return _0x216b24;});}return null;};}function removeEntity(_0x45411c,_0x499ae2){return function(_0xe60cfb){if(_0xe60cfb){return _0xe60cfb['destroy']()[_0x15c9('0x22')](function(){_0x45411c[_0x15c9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229ae9,_0x180608){return function(_0x117f99){if(!_0x117f99){_0x229ae9['sendStatus'](0x194);}return _0x117f99;};}function handleError(_0x58cbd2,_0x846e32){_0x846e32=_0x846e32||0x1f4;return function(_0x3f372b){logger[_0x15c9('0x23')](_0x3f372b[_0x15c9('0x24')]);if(_0x3f372b['name']){delete _0x3f372b[_0x15c9('0x25')];}_0x58cbd2[_0x15c9('0x18')](_0x846e32)[_0x15c9('0x26')](_0x3f372b);};}exports[_0x15c9('0x27')]=function(_0x1ccc4b,_0x200d26){var _0x181d81={'raw':!![],'where':{'id':_0x1ccc4b['params']['id']}},_0x86fd2e={};_0x86fd2e[_0x15c9('0x28')]=_[_0x15c9('0x29')](db[_0x15c9('0x2a')][_0x15c9('0x2b')]);_0x86fd2e[_0x15c9('0x2c')]=_[_0x15c9('0x29')](_0x1ccc4b[_0x15c9('0x2c')]);_0x86fd2e[_0x15c9('0x2d')]=_[_0x15c9('0x2e')](_0x86fd2e[_0x15c9('0x28')],_0x86fd2e[_0x15c9('0x2c')]);_0x181d81[_0x15c9('0x2f')]=_['intersection'](_0x86fd2e[_0x15c9('0x28')],qs['fields'](_0x1ccc4b[_0x15c9('0x2c')]['fields']));_0x181d81[_0x15c9('0x2f')]=_0x181d81[_0x15c9('0x2f')][_0x15c9('0x30')]?_0x181d81['attributes']:_0x86fd2e[_0x15c9('0x28')];if(_0x1ccc4b[_0x15c9('0x2c')]['includeAll']){_0x181d81['include']=[{'all':!![]}];}_0x181d81=_[_0x15c9('0x31')]({},_0x181d81,_0x1ccc4b[_0x15c9('0x32')]);return db['ChatProactiveAction'][_0x15c9('0x33')](_0x181d81)[_0x15c9('0x22')](handleEntityNotFound(_0x200d26,null))[_0x15c9('0x22')](respondWithResult(_0x200d26,null))[_0x15c9('0x34')](handleError(_0x200d26,null));};exports[_0x15c9('0x35')]=function(_0x155a5a,_0x55433a){return db[_0x15c9('0x2a')]['create'](_0x155a5a[_0x15c9('0x36')],{})[_0x15c9('0x22')](respondWithResult(_0x55433a,0xc9))['catch'](handleError(_0x55433a,null));};exports[_0x15c9('0x21')]=function(_0x12bb57,_0x58e57e){if(_0x12bb57[_0x15c9('0x36')]['id']){delete _0x12bb57[_0x15c9('0x36')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x12bb57[_0x15c9('0x37')]['id']}})[_0x15c9('0x22')](handleEntityNotFound(_0x58e57e,null))['then'](saveUpdates(_0x12bb57['body'],null))['then'](respondWithResult(_0x58e57e,null))[_0x15c9('0x34')](handleError(_0x58e57e,null));};exports[_0x15c9('0x38')]=function(_0x49b5c5,_0x5bd601){return db['ChatProactiveAction'][_0x15c9('0x33')]({'where':{'id':_0x49b5c5[_0x15c9('0x37')]['id']}})[_0x15c9('0x22')](handleEntityNotFound(_0x5bd601,null))['then'](removeEntity(_0x5bd601,null))['catch'](handleError(_0x5bd601,null));}; \ No newline at end of file +var _0x3981=['send','show','ChatProactiveAction','rawAttributes','query','filters','attributes','model','fields','length','include','merge','options','find','catch','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','stack'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0x3981,0x144));var _0x1398=function(_0x8c9834,_0x3056c4){_0x8c9834=_0x8c9834-0x0;var _0x522e08=_0x3981[_0x8c9834];return _0x522e08;};'use strict';var emlformat=require(_0x1398('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1398('0x1'));var jsonpatch=require(_0x1398('0x2'));var rp=require(_0x1398('0x3'));var moment=require(_0x1398('0x4'));var BPromise=require(_0x1398('0x5'));var Mustache=require(_0x1398('0x6'));var util=require(_0x1398('0x7'));var path=require(_0x1398('0x8'));var sox=require(_0x1398('0x9'));var csv=require(_0x1398('0xa'));var ejs=require(_0x1398('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1398('0xc'));var squel=require(_0x1398('0xd'));var crypto=require(_0x1398('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1398('0xf'));var toCsv=require(_0x1398('0xa'));var querystring=require(_0x1398('0x10'));var Papa=require(_0x1398('0x11'));var Redis=require(_0x1398('0x12'));var authService=require(_0x1398('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1398('0x14'));var hardwareService=require(_0x1398('0x15'));var logger=require(_0x1398('0x16'))(_0x1398('0x17'));var utils=require(_0x1398('0x18'));var config=require(_0x1398('0x19'));var licenseUtil=require(_0x1398('0x1a'));var db=require(_0x1398('0x1b'))['db'];function respondWithStatusCode(_0x4460a6,_0x31b5bf){_0x31b5bf=_0x31b5bf||0xcc;return function(_0x5f37ac){if(_0x5f37ac){return _0x4460a6[_0x1398('0x1c')](_0x31b5bf);}return _0x4460a6[_0x1398('0x1d')](_0x31b5bf)[_0x1398('0x1e')]();};}function respondWithResult(_0xa9ef49,_0x49424a){_0x49424a=_0x49424a||0xc8;return function(_0x4d8a1a){if(_0x4d8a1a){return _0xa9ef49['status'](_0x49424a)[_0x1398('0x1f')](_0x4d8a1a);}};}function respondWithFilteredResult(_0x5cd5aa,_0x51ad37){return function(_0x514216){if(_0x514216){var _0x2afbd6=typeof _0x51ad37['offset']===_0x1398('0x20')&&typeof _0x51ad37[_0x1398('0x21')]===_0x1398('0x20');var _0x382319=_0x514216[_0x1398('0x22')];var _0x579fd2=_0x2afbd6?0x0:_0x51ad37[_0x1398('0x23')];var _0x5531bc=_0x2afbd6?_0x514216['count']:_0x51ad37[_0x1398('0x23')]+_0x51ad37['limit'];var _0x57fce1;if(_0x5531bc>=_0x382319){_0x5531bc=_0x382319;_0x57fce1=0xc8;}else{_0x57fce1=0xce;}_0x5cd5aa[_0x1398('0x1d')](_0x57fce1);return _0x5cd5aa[_0x1398('0x24')]('Content-Range',_0x579fd2+'-'+_0x5531bc+'/'+_0x382319)[_0x1398('0x1f')](_0x514216);}return null;};}function patchUpdates(_0x146357){return function(_0x268fc5){try{jsonpatch[_0x1398('0x25')](_0x268fc5,_0x146357,!![]);}catch(_0xcd19c1){return BPromise[_0x1398('0x26')](_0xcd19c1);}return _0x268fc5['save']();};}function saveUpdates(_0x5c1d68,_0x58e886){return function(_0x5dcedc){if(_0x5dcedc){return _0x5dcedc[_0x1398('0x27')](_0x5c1d68)[_0x1398('0x28')](function(_0x5029d4){return _0x5029d4;});}return null;};}function removeEntity(_0x3e4cfa,_0x929d8a){return function(_0x45b78a){if(_0x45b78a){return _0x45b78a['destroy']()[_0x1398('0x28')](function(){_0x3e4cfa[_0x1398('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb54964,_0x340d90){return function(_0x41c42c){if(!_0x41c42c){_0xb54964[_0x1398('0x1c')](0x194);}return _0x41c42c;};}function handleError(_0x50d3cf,_0x5edfdd){_0x5edfdd=_0x5edfdd||0x1f4;return function(_0x2b73e7){logger['error'](_0x2b73e7[_0x1398('0x29')]);if(_0x2b73e7['name']){delete _0x2b73e7['name'];}_0x50d3cf['status'](_0x5edfdd)[_0x1398('0x2a')](_0x2b73e7);};}exports[_0x1398('0x2b')]=function(_0x76bd5,_0x2c8d2b){var _0x24965c={'raw':!![],'where':{'id':_0x76bd5['params']['id']}},_0x2fd175={};_0x2fd175['model']=_['keys'](db[_0x1398('0x2c')][_0x1398('0x2d')]);_0x2fd175[_0x1398('0x2e')]=_['keys'](_0x76bd5[_0x1398('0x2e')]);_0x2fd175[_0x1398('0x2f')]=_['intersection'](_0x2fd175['model'],_0x2fd175['query']);_0x24965c[_0x1398('0x30')]=_['intersection'](_0x2fd175[_0x1398('0x31')],qs[_0x1398('0x32')](_0x76bd5[_0x1398('0x2e')][_0x1398('0x32')]));_0x24965c[_0x1398('0x30')]=_0x24965c['attributes'][_0x1398('0x33')]?_0x24965c[_0x1398('0x30')]:_0x2fd175['model'];if(_0x76bd5[_0x1398('0x2e')]['includeAll']){_0x24965c[_0x1398('0x34')]=[{'all':!![]}];}_0x24965c=_[_0x1398('0x35')]({},_0x24965c,_0x76bd5[_0x1398('0x36')]);return db[_0x1398('0x2c')][_0x1398('0x37')](_0x24965c)['then'](handleEntityNotFound(_0x2c8d2b,null))['then'](respondWithResult(_0x2c8d2b,null))[_0x1398('0x38')](handleError(_0x2c8d2b,null));};exports[_0x1398('0x39')]=function(_0x511276,_0x4b9cfa){return db['ChatProactiveAction'][_0x1398('0x39')](_0x511276['body'],{})[_0x1398('0x28')](respondWithResult(_0x4b9cfa,0xc9))['catch'](handleError(_0x4b9cfa,null));};exports[_0x1398('0x27')]=function(_0x5b4a65,_0xab4136){if(_0x5b4a65[_0x1398('0x3a')]['id']){delete _0x5b4a65[_0x1398('0x3a')]['id'];}return db[_0x1398('0x2c')][_0x1398('0x37')]({'where':{'id':_0x5b4a65[_0x1398('0x3b')]['id']}})[_0x1398('0x28')](handleEntityNotFound(_0xab4136,null))[_0x1398('0x28')](saveUpdates(_0x5b4a65[_0x1398('0x3a')],null))[_0x1398('0x28')](respondWithResult(_0xab4136,null))[_0x1398('0x38')](handleError(_0xab4136,null));};exports[_0x1398('0x3c')]=function(_0x59caea,_0x20ec32){return db[_0x1398('0x2c')][_0x1398('0x37')]({'where':{'id':_0x59caea['params']['id']}})[_0x1398('0x28')](handleEntityNotFound(_0x20ec32,null))['then'](removeEntity(_0x20ec32,null))[_0x1398('0x38')](handleError(_0x20ec32,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 274cc1d..e3a059c 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 _0x496c=['path','rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','../../config/logger','api','moment','request-promise'];(function(_0x48c4ef,_0x319d44){var _0x435715=function(_0x925d50){while(--_0x925d50){_0x48c4ef['push'](_0x48c4ef['shift']());}};_0x435715(++_0x319d44);}(_0x496c,0xc4));var _0xc496=function(_0x3a05ea,_0xe50204){_0x3a05ea=_0x3a05ea-0x0;var _0x5b529e=_0x496c[_0x3a05ea];return _0x5b529e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc496('0x0'))(_0xc496('0x1'));var moment=require(_0xc496('0x2'));var BPromise=require('bluebird');var rp=require(_0xc496('0x3'));var fs=require('fs');var path=require(_0xc496('0x4'));var rimraf=require(_0xc496('0x5'));var config=require('../../config/environment');var attributes=require(_0xc496('0x6'));module[_0xc496('0x7')]=function(_0x4a0a8f,_0x410f40){return _0x4a0a8f[_0xc496('0x8')]('ChatProactiveAction',attributes,{'tableName':_0xc496('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x643c=['path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','moment','request-promise'];(function(_0x51dd2c,_0x2a2345){var _0x41c678=function(_0xa14c31){while(--_0xa14c31){_0x51dd2c['push'](_0x51dd2c['shift']());}};_0x41c678(++_0x2a2345);}(_0x643c,0x8b));var _0xc643=function(_0x35027c,_0x4af623){_0x35027c=_0x35027c-0x0;var _0x4bba7d=_0x643c[_0x35027c];return _0x4bba7d;};'use strict';var _=require('lodash');var util=require(_0xc643('0x0'));var logger=require(_0xc643('0x1'))('api');var moment=require(_0xc643('0x2'));var BPromise=require('bluebird');var rp=require(_0xc643('0x3'));var fs=require('fs');var path=require(_0xc643('0x4'));var rimraf=require('rimraf');var config=require(_0xc643('0x5'));var attributes=require(_0xc643('0x6'));module[_0xc643('0x7')]=function(_0x37656c,_0x646755){return _0x37656c[_0xc643('0x8')](_0xc643('0x9'),attributes,{'tableName':_0xc643('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 7c05086..969a509 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 _0x1ba1=['error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5b9893,_0x59ade8){var _0x28cf17=function(_0x1eaad8){while(--_0x1eaad8){_0x5b9893['push'](_0x5b9893['shift']());}};_0x28cf17(++_0x59ade8);}(_0x1ba1,0x12b));var _0x11ba=function(_0x4e136c,_0x1572c2){_0x4e136c=_0x4e136c-0x0;var _0x472f43=_0x1ba1[_0x4e136c];return _0x472f43;};'use strict';var _=require(_0x11ba('0x0'));var util=require(_0x11ba('0x1'));var moment=require('moment');var BPromise=require(_0x11ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11ba('0x3'))['db'];var utils=require(_0x11ba('0x4'));var logger=require(_0x11ba('0x5'))(_0x11ba('0x6'));var config=require(_0x11ba('0x7'));var jayson=require(_0x11ba('0x8'));var client=jayson[_0x11ba('0x9')][_0x11ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x561d29,_0x138c4f,_0x25a9eb){return new BPromise(function(_0x12bbda,_0x1b30da){return client['request'](_0x561d29,_0x25a9eb)[_0x11ba('0xb')](function(_0x83a2be){logger['info'](_0x11ba('0xc'),_0x138c4f,'request\x20sent');logger[_0x11ba('0xd')](_0x11ba('0xe'),_0x138c4f,_0x11ba('0xf'),JSON['stringify'](_0x83a2be));if(_0x83a2be[_0x11ba('0x10')]){if(_0x83a2be[_0x11ba('0x10')][_0x11ba('0x11')]===0x1f4){logger['error'](_0x11ba('0xc'),_0x138c4f,_0x83a2be[_0x11ba('0x10')][_0x11ba('0x12')]);return _0x1b30da(_0x83a2be[_0x11ba('0x10')]['message']);}logger['error'](_0x11ba('0xc'),_0x138c4f,_0x83a2be[_0x11ba('0x10')][_0x11ba('0x12')]);return _0x12bbda(_0x83a2be[_0x11ba('0x10')]['message']);}else{logger['info'](_0x11ba('0xc'),_0x138c4f,'request\x20sent');_0x12bbda(_0x83a2be[_0x11ba('0x13')][_0x11ba('0x12')]);}})[_0x11ba('0x14')](function(_0x2d196a){logger[_0x11ba('0x10')](_0x11ba('0xc'),_0x138c4f,_0x2d196a);_0x1b30da(_0x2d196a);});});} \ No newline at end of file +var _0x886b=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x3ce25d,_0x5d873a){var _0x3fa872=function(_0x149cf3){while(--_0x149cf3){_0x3ce25d['push'](_0x3ce25d['shift']());}};_0x3fa872(++_0x5d873a);}(_0x886b,0x1ca));var _0xb886=function(_0x2b54d9,_0x5e4a14){_0x2b54d9=_0x2b54d9-0x0;var _0x47f39b=_0x886b[_0x2b54d9];return _0x47f39b;};'use strict';var _=require(_0xb886('0x0'));var util=require(_0xb886('0x1'));var moment=require(_0xb886('0x2'));var BPromise=require(_0xb886('0x3'));var rs=require(_0xb886('0x4'));var fs=require('fs');var Redis=require(_0xb886('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb886('0x6'));var logger=require('../../config/logger')(_0xb886('0x7'));var config=require(_0xb886('0x8'));var jayson=require(_0xb886('0x9'));var client=jayson[_0xb886('0xa')][_0xb886('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100662,_0x136a70,_0x5651dc){return new BPromise(function(_0x163a90,_0x9f2714){return client[_0xb886('0xc')](_0x100662,_0x5651dc)['then'](function(_0x3f747a){logger[_0xb886('0xd')](_0xb886('0xe'),_0x136a70,_0xb886('0xf'));logger[_0xb886('0x10')](_0xb886('0x11'),_0x136a70,_0xb886('0xf'),JSON[_0xb886('0x12')](_0x3f747a));if(_0x3f747a[_0xb886('0x13')]){if(_0x3f747a['error'][_0xb886('0x14')]===0x1f4){logger[_0xb886('0x13')](_0xb886('0xe'),_0x136a70,_0x3f747a[_0xb886('0x13')]['message']);return _0x9f2714(_0x3f747a[_0xb886('0x13')][_0xb886('0x15')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x136a70,_0x3f747a[_0xb886('0x13')][_0xb886('0x15')]);return _0x163a90(_0x3f747a[_0xb886('0x13')][_0xb886('0x15')]);}else{logger[_0xb886('0xd')](_0xb886('0xe'),_0x136a70,_0xb886('0xf'));_0x163a90(_0x3f747a['result']['message']);}})[_0xb886('0x16')](function(_0x52f7e6){logger[_0xb886('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x136a70,_0x52f7e6);_0x9f2714(_0x52f7e6);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 44df15e..c2af729 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 _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x5251f0,_0xc08e2d){var _0x31ff23=function(_0x3f0419){while(--_0x3f0419){_0x5251f0['push'](_0x5251f0['shift']());}};_0x31ff23(++_0xc08e2d);}(_0x4819,0xcd));var _0x9481=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x4819[_0x2543d6];return _0x55213c;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router; \ No newline at end of file +var _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x51c3f7,_0x2bb9d1){var _0x89b734=function(_0x120eb6){while(--_0x120eb6){_0x51c3f7['push'](_0x51c3f7['shift']());}};_0x89b734(++_0x2bb9d1);}(_0xeec6,0x1c2));var _0x6eec=function(_0xe0c564,_0x2ff569){_0xe0c564=_0xe0c564-0x0;var _0x32e0f6=_0xeec6[_0xe0c564];return _0x32e0f6;};'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'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 8d8771a..107c395 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 _0x655d=['rrmemory','sequelize','exports','STRING','name'];(function(_0x32f225,_0x49a4a8){var _0x1d7c70=function(_0x25cc8e){while(--_0x25cc8e){_0x32f225['push'](_0x32f225['shift']());}};_0x1d7c70(++_0x49a4a8);}(_0x655d,0x1a5));var _0xd655=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x655d[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xd655('0x0'));module[_0xd655('0x1')]={'name':{'type':Sequelize[_0xd655('0x2')],'unique':_0xd655('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd655('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd655('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x8dec=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x8dec,0x13a));var _0xc8de=function(_0x517fc3,_0x384d51){_0x517fc3=_0x517fc3-0x0;var _0xc4a05c=_0x8dec[_0x517fc3];return _0xc4a05c;};'use strict';var Sequelize=require(_0xc8de('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8de('0x1')],'unique':_0xc8de('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc8de('0x1')]},'timeout':{'type':Sequelize[_0xc8de('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc8de('0x4')](_0xc8de('0x5'),'beepall',_0xc8de('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 6ffc2ac..ca2f5b0 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 _0x1a02=['UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','pick','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','./chatQueue.socket','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','ChatQueues','status','stack','name','send','index','map','ChatQueue','rawAttributes','key','getOptions','where','findAll','catch','params','model','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','keys','hasOwnProperty','nolimit','order','sort','ChatQueueId','filter','merge'];(function(_0x37fc2e,_0x2324a4){var _0x2c23e1=function(_0x13aa57){while(--_0x13aa57){_0x37fc2e['push'](_0x37fc2e['shift']());}};_0x2c23e1(++_0x2324a4);}(_0x1a02,0xab));var _0x21a0=function(_0x3c1e1d,_0x31537a){_0x3c1e1d=_0x3c1e1d-0x0;var _0x35a670=_0x1a02[_0x3c1e1d];return _0x35a670;};'use strict';var BPromise=require(_0x21a0('0x0'));var util=require(_0x21a0('0x1'));var _=require(_0x21a0('0x2'));var squel=require(_0x21a0('0x3'));var Redis=require(_0x21a0('0x4'));var qs=require(_0x21a0('0x5'));var logger=require(_0x21a0('0x6'))('api');var config=require(_0x21a0('0x7'));var db=require('../../mysqldb')['db'];config[_0x21a0('0x8')]=_[_0x21a0('0x9')](config[_0x21a0('0x8')],{'host':_0x21a0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21a0('0x8')]));require(_0x21a0('0xb'))['register'](socket);function respondWithStatusCode(_0x5adce1,_0x2abb26){_0x2abb26=_0x2abb26||0xcc;return function(_0x5252bc){if(_0x5252bc){return _0x5adce1[_0x21a0('0xc')](_0x2abb26);}return _0x5adce1['status'](_0x2abb26)[_0x21a0('0xd')]();};}function respondWithResult(_0x11102c,_0x13fd36){_0x13fd36=_0x13fd36||0xc8;return function(_0x1325bb){if(_0x1325bb){return _0x11102c['status'](_0x13fd36)[_0x21a0('0xe')](_0x1325bb);}};}function respondWithFilteredResult(_0x33b1b0,_0x4e7e84){return function(_0x4249ba){if(_0x4249ba){var _0x2c4363=typeof _0x4e7e84[_0x21a0('0xf')]===_0x21a0('0x10')&&typeof _0x4e7e84[_0x21a0('0x11')]===_0x21a0('0x10');var _0xd115eb=_0x4249ba[_0x21a0('0x12')];var _0x237fc9=_0x2c4363?0x0:_0x4e7e84[_0x21a0('0xf')];var _0x46faee=_0x2c4363?_0x4249ba['count']:_0x4e7e84[_0x21a0('0xf')]+_0x4e7e84['limit'];var _0x1e7f20;if(_0x46faee>=_0xd115eb){_0x46faee=_0xd115eb;_0x1e7f20=0xc8;}else{_0x1e7f20=0xce;}_0x33b1b0['status'](_0x1e7f20);return _0x33b1b0[_0x21a0('0x13')](_0x21a0('0x14'),_0x237fc9+'-'+_0x46faee+'/'+_0xd115eb)[_0x21a0('0xe')](_0x4249ba);}return null;};}function saveUpdates(_0x3da6bf){return function(_0x221625){if(_0x221625){return _0x221625['update'](_0x3da6bf)['then'](function(_0x35fcca){return _0x35fcca;});}return null;};}function removeEntity(_0x38712f){return function(_0x50a5dd){if(_0x50a5dd){return _0x50a5dd[_0x21a0('0x15')]()[_0x21a0('0x16')](function(){var _0x24a800=_0x50a5dd[_0x21a0('0x17')]({'plain':!![]});var _0x1e0847=_0x21a0('0x18');return db['UserProfileResource'][_0x21a0('0x15')]({'where':{'type':_0x1e0847,'resourceId':_0x24a800['id']}})[_0x21a0('0x16')](function(){return _0x50a5dd;});})[_0x21a0('0x16')](function(){_0x38712f[_0x21a0('0x19')](0xcc)[_0x21a0('0xd')]();});}};}function handleEntityNotFound(_0x59ed91){return function(_0x33cc51){if(!_0x33cc51){_0x59ed91[_0x21a0('0xc')](0x194);}return _0x33cc51;};}function handleError(_0x4c75f9,_0x1f2b4e){_0x1f2b4e=_0x1f2b4e||0x1f4;return function(_0x59ece2){logger['error'](_0x59ece2[_0x21a0('0x1a')]);if(_0x59ece2[_0x21a0('0x1b')]){delete _0x59ece2[_0x21a0('0x1b')];}_0x4c75f9[_0x21a0('0x19')](_0x1f2b4e)[_0x21a0('0x1c')](_0x59ece2);};}exports[_0x21a0('0x1d')]=function(_0x28b282,_0x4e720d){var _0x365093={};var _0x1eff3d={'count':0x0,'rows':[]};var _0x1fef09=_[_0x21a0('0x1e')](db[_0x21a0('0x1f')][_0x21a0('0x20')],function(_0x2ceee5){return{'name':_0x2ceee5['fieldName'],'type':_0x2ceee5['type'][_0x21a0('0x21')]};});_0x365093=qs[_0x21a0('0x22')](_0x1fef09,_0x28b282);var _0x4fbc46={'where':_0x365093[_0x21a0('0x23')]};return db[_0x21a0('0x1f')][_0x21a0('0x12')](_0x4fbc46)[_0x21a0('0x16')](function(_0x3e212f){_0x1eff3d[_0x21a0('0x12')]=_0x3e212f;_0x365093['include']=qs['include'](_0x28b282['query']);return db['ChatQueue'][_0x21a0('0x24')](_0x365093);})[_0x21a0('0x16')](function(_0x27b411){_0x1eff3d['rows']=_0x27b411;return _0x1eff3d;})[_0x21a0('0x16')](respondWithFilteredResult(_0x4e720d,_0x365093))[_0x21a0('0x25')](handleError(_0x4e720d,null));};exports['show']=function(_0x13d2fc,_0x976fda){var _0x2d13a5={'raw':!![],'where':{'id':_0x13d2fc[_0x21a0('0x26')]['id']}},_0x44acc9={};_0x44acc9[_0x21a0('0x27')]=_['keys'](db['ChatQueue'][_0x21a0('0x20')]);_0x44acc9['query']=_['keys'](_0x13d2fc[_0x21a0('0x28')]);_0x44acc9[_0x21a0('0x29')]=_[_0x21a0('0x2a')](_0x44acc9[_0x21a0('0x27')],_0x44acc9[_0x21a0('0x28')]);_0x2d13a5[_0x21a0('0x2b')]=_['intersection'](_0x44acc9[_0x21a0('0x27')],qs['fields'](_0x13d2fc[_0x21a0('0x28')][_0x21a0('0x2c')]));_0x2d13a5[_0x21a0('0x2b')]=_0x2d13a5[_0x21a0('0x2b')][_0x21a0('0x2d')]?_0x2d13a5[_0x21a0('0x2b')]:_0x44acc9['model'];if(_0x13d2fc[_0x21a0('0x28')][_0x21a0('0x2e')]){_0x2d13a5[_0x21a0('0x2f')]=[{'all':!![]}];}_0x2d13a5=_['merge']({},_0x2d13a5,_0x13d2fc[_0x21a0('0x30')]);return db[_0x21a0('0x1f')][_0x21a0('0x31')](_0x2d13a5)[_0x21a0('0x16')](handleEntityNotFound(_0x976fda,null))[_0x21a0('0x16')](respondWithResult(_0x976fda,null))[_0x21a0('0x25')](handleError(_0x976fda,null));};exports[_0x21a0('0x32')]=function(_0x92325e,_0x3bbcf8){return db[_0x21a0('0x1f')]['create'](_0x92325e[_0x21a0('0x33')],{})[_0x21a0('0x16')](function(_0x40b2f1){var _0x550f1a=_0x92325e['user'][_0x21a0('0x17')]({'plain':!![]});if(!_0x550f1a)throw new Error(_0x21a0('0x34'));if(_0x550f1a[_0x21a0('0x35')]===_0x21a0('0x36')){var _0x5e362d=_0x40b2f1[_0x21a0('0x17')]({'plain':!![]});var _0x5050af=_0x21a0('0x18');return db[_0x21a0('0x37')][_0x21a0('0x31')]({'where':{'name':_0x5050af,'userProfileId':_0x550f1a['userProfileId']},'raw':!![]})[_0x21a0('0x16')](function(_0xb283e6){if(_0xb283e6&&_0xb283e6[_0x21a0('0x38')]===0x0){return db[_0x21a0('0x39')][_0x21a0('0x32')]({'name':_0x5e362d[_0x21a0('0x1b')],'resourceId':_0x5e362d['id'],'type':_0xb283e6[_0x21a0('0x1b')],'sectionId':_0xb283e6['id']},{})[_0x21a0('0x16')](function(){return _0x40b2f1;});}else{return _0x40b2f1;}})[_0x21a0('0x25')](function(_0x401747){logger[_0x21a0('0x3a')](_0x21a0('0x3b'),_0x401747);throw _0x401747;});}return _0x40b2f1;})['then'](respondWithResult(_0x3bbcf8,0xc9))[_0x21a0('0x25')](handleError(_0x3bbcf8,null));};exports[_0x21a0('0x3c')]=function(_0x6b5452,_0xc86112){if(_0x6b5452[_0x21a0('0x33')]['id']){delete _0x6b5452[_0x21a0('0x33')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x6b5452[_0x21a0('0x26')]['id']}})[_0x21a0('0x16')](handleEntityNotFound(_0xc86112,null))[_0x21a0('0x16')](saveUpdates(_0x6b5452['body'],null))['then'](respondWithResult(_0xc86112,null))[_0x21a0('0x25')](handleError(_0xc86112,null));};exports[_0x21a0('0x15')]=function(_0x3216a8,_0x4063f4){return db[_0x21a0('0x1f')]['find']({'where':{'id':_0x3216a8[_0x21a0('0x26')]['id']}})[_0x21a0('0x16')](handleEntityNotFound(_0x4063f4,null))[_0x21a0('0x16')](removeEntity(_0x4063f4,null))['catch'](handleError(_0x4063f4,null));};exports[_0x21a0('0x3d')]=function(_0x39e921,_0x39c75a){return db[_0x21a0('0x1f')][_0x21a0('0x3d')]()['then'](respondWithResult(_0x39c75a,null))['catch'](handleError(_0x39c75a,null));};exports['getMembers']=function(_0x165c00,_0x1beec8){var _0x1c0b81={'raw':!![],'where':{}},_0x75aaf5={},_0x2ed9d0;return db[_0x21a0('0x1f')][_0x21a0('0x3e')]({'where':{'id':_0x165c00[_0x21a0('0x26')]['id']}})[_0x21a0('0x16')](handleEntityNotFound(_0x1beec8,null))[_0x21a0('0x16')](function(_0x3858df){if(_0x3858df){_0x2ed9d0=_0x3858df['get']({'plain':!![]});_0x75aaf5[_0x21a0('0x27')]=_[_0x21a0('0x3f')](db['UserChatQueue'][_0x21a0('0x20')]);_0x75aaf5[_0x21a0('0x28')]=_[_0x21a0('0x3f')](_0x165c00[_0x21a0('0x28')]);_0x75aaf5[_0x21a0('0x29')]=_[_0x21a0('0x2a')](_0x75aaf5[_0x21a0('0x27')],_0x75aaf5[_0x21a0('0x28')]);_0x1c0b81['attributes']=_[_0x21a0('0x2a')](_0x75aaf5['model'],qs[_0x21a0('0x2c')](_0x165c00[_0x21a0('0x28')][_0x21a0('0x2c')]));_0x1c0b81['attributes']=_0x1c0b81[_0x21a0('0x2b')][_0x21a0('0x2d')]?_0x1c0b81[_0x21a0('0x2b')]:_0x75aaf5[_0x21a0('0x27')];if(!_0x165c00[_0x21a0('0x28')][_0x21a0('0x40')](_0x21a0('0x41'))){_0x1c0b81['limit']=qs['limit'](_0x165c00[_0x21a0('0x28')]['limit']);_0x1c0b81[_0x21a0('0xf')]=qs[_0x21a0('0xf')](_0x165c00[_0x21a0('0x28')]['offset']);}_0x1c0b81[_0x21a0('0x42')]=qs[_0x21a0('0x43')](_0x165c00['query'][_0x21a0('0x43')]);_0x1c0b81[_0x21a0('0x23')]=qs['filters'](_['pick'](_0x165c00[_0x21a0('0x28')],_0x75aaf5[_0x21a0('0x29')]));_0x1c0b81[_0x21a0('0x23')][_0x21a0('0x44')]=_0x3858df['id'];if(_0x165c00[_0x21a0('0x28')][_0x21a0('0x45')]){_0x1c0b81[_0x21a0('0x23')]=_[_0x21a0('0x46')](_0x1c0b81[_0x21a0('0x23')],{'$or':_[_0x21a0('0x1e')](_0x1c0b81['attributes'],function(_0x2797ff){var _0x5a94c9={};_0x5a94c9[_0x2797ff]={'$like':'%'+_0x165c00[_0x21a0('0x28')][_0x21a0('0x45')]+'%'};return _0x5a94c9;})});}_0x1c0b81=_[_0x21a0('0x46')]({},_0x1c0b81,_0x165c00[_0x21a0('0x30')]);return db[_0x21a0('0x47')][_0x21a0('0x24')](_0x1c0b81);}})[_0x21a0('0x16')](function(_0x2daab6){if(_0x2daab6){return db[_0x21a0('0x48')]['findAndCountAll']({'where':{'id':_[_0x21a0('0x1e')](_0x2daab6,_0x21a0('0x49')),'role':_0x21a0('0x4a')},'attributes':['id',_0x21a0('0x1b'),_0x21a0('0x4b'),_0x21a0('0x4c'),_0x21a0('0x4d')]});}})['then'](function(_0x4d98a9){if(_0x4d98a9){return{'count':_0x4d98a9[_0x21a0('0x12')],'rows':_['map'](_0x4d98a9['rows'],function(_0x5d5f83){return{'membername':_0x5d5f83[_0x21a0('0x1b')],'UserId':_0x5d5f83['id'],'queue_name':_0x2ed9d0['name'],'ChatQueueId':_0x2ed9d0['id'],'interface':util[_0x21a0('0x4e')]('%s/%s',_0x21a0('0x4f'),_0x5d5f83[_0x21a0('0x1b')]),'penalty':0x0,'paused':_0x5d5f83[_0x21a0('0x4b')],'createdAt':_0x5d5f83[_0x21a0('0x4d')],'updatedAt':_0x5d5f83[_0x21a0('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1beec8,_0x1c0b81))[_0x21a0('0x25')](handleError(_0x1beec8,null));};exports[_0x21a0('0x50')]=function(_0x454336,_0x3c631a){var _0x2b5d17={};var _0x4166b8={};var _0x5521b3;var _0x2b6291;return db[_0x21a0('0x1f')]['findOne']({'where':{'id':_0x454336['params']['id']}})[_0x21a0('0x16')](handleEntityNotFound(_0x3c631a,null))[_0x21a0('0x16')](function(_0x1bdbcb){if(_0x1bdbcb){_0x5521b3=_0x1bdbcb;_0x4166b8[_0x21a0('0x27')]=_['keys'](db[_0x21a0('0x51')][_0x21a0('0x20')]);_0x4166b8[_0x21a0('0x28')]=_[_0x21a0('0x3f')](_0x454336[_0x21a0('0x28')]);_0x4166b8[_0x21a0('0x29')]=_[_0x21a0('0x2a')](_0x4166b8[_0x21a0('0x27')],_0x4166b8[_0x21a0('0x28')]);_0x2b5d17[_0x21a0('0x2b')]=_['intersection'](_0x4166b8[_0x21a0('0x27')],qs[_0x21a0('0x2c')](_0x454336[_0x21a0('0x28')]['fields']));_0x2b5d17['attributes']=_0x2b5d17[_0x21a0('0x2b')]['length']?_0x2b5d17[_0x21a0('0x2b')]:_0x4166b8[_0x21a0('0x27')];_0x2b5d17[_0x21a0('0x42')]=qs[_0x21a0('0x43')](_0x454336[_0x21a0('0x28')]['sort']);_0x2b5d17[_0x21a0('0x23')]=qs['filters'](_['pick'](_0x454336['query'],_0x4166b8[_0x21a0('0x29')]));if(_0x454336[_0x21a0('0x28')][_0x21a0('0x45')]){_0x2b5d17[_0x21a0('0x23')]=_['merge'](_0x2b5d17[_0x21a0('0x23')],{'$or':_[_0x21a0('0x1e')](_0x2b5d17[_0x21a0('0x2b')],function(_0x106a2c){var _0x28f446={};_0x28f446[_0x106a2c]={'$like':'%'+_0x454336[_0x21a0('0x28')][_0x21a0('0x45')]+'%'};return _0x28f446;})});}_0x2b5d17=_[_0x21a0('0x46')]({},_0x2b5d17,_0x454336[_0x21a0('0x30')]);return _0x5521b3[_0x21a0('0x50')](_0x2b5d17);}})[_0x21a0('0x16')](function(_0x4a10ba){if(_0x4a10ba){_0x2b6291=_0x4a10ba[_0x21a0('0x2d')];if(!_0x454336[_0x21a0('0x28')][_0x21a0('0x40')](_0x21a0('0x41'))){_0x2b5d17[_0x21a0('0x11')]=qs[_0x21a0('0x11')](_0x454336['query'][_0x21a0('0x11')]);_0x2b5d17['offset']=qs[_0x21a0('0xf')](_0x454336[_0x21a0('0x28')][_0x21a0('0xf')]);}return _0x5521b3['getTeams'](_0x2b5d17);}})[_0x21a0('0x16')](function(_0x4a79d5){if(_0x4a79d5){return _0x4a79d5?{'count':_0x2b6291,'rows':_0x4a79d5}:null;}})[_0x21a0('0x16')](respondWithResult(_0x3c631a,null))[_0x21a0('0x25')](handleError(_0x3c631a,null));};exports['addTeams']=function(_0x28719a,_0x1cfe1b){var _0x7b69c6=_0x28719a['body'][_0x21a0('0x52')];return db[_0x21a0('0x51')][_0x21a0('0x24')]({'where':{'id':_0x7b69c6},'attributes':['id'],'include':[{'model':db[_0x21a0('0x48')],'as':'Agents','attributes':['id',_0x21a0('0x1b'),_0x21a0('0x53'),_0x21a0('0x54'),_0x21a0('0x55')],'raw':!![]}]})[_0x21a0('0x16')](function(_0x1851bd){if(_0x1851bd){var _0x261210=_[_0x21a0('0x56')](_0x1851bd,function(_0x1023ff){var _0x22d1c3=_0x1023ff[_0x21a0('0x17')]({'plain':!![]});return _0x22d1c3[_0x21a0('0x57')];});return db[_0x21a0('0x1f')]['find']({'where':{'id':_0x28719a[_0x21a0('0x26')]['id']}})[_0x21a0('0x16')](function(_0x5475fd){return db[_0x21a0('0x58')][_0x21a0('0x59')](function(_0xed7ba7){return _0x5475fd[_0x21a0('0x5a')](_0x7b69c6,{'transaction':_0xed7ba7})[_0x21a0('0x16')](function(){return BPromise[_0x21a0('0x5b')](_0x261210,function(_0x4cc8c8){return db[_0x21a0('0x47')]['findOrCreate']({'where':{'UserId':_0x4cc8c8['id'],'ChatQueueId':_0x28719a[_0x21a0('0x26')]['id']},'transaction':_0xed7ba7});});})[_0x21a0('0x16')](function(){_0x261210[_0x21a0('0x5c')](function(_0x48b12a){socket[_0x21a0('0x5d')](_0x21a0('0x5e'),{'UserId':_0x48b12a['id'],'ChatQueueId':_0x5475fd['id']});});});});});}})[_0x21a0('0x16')](respondWithStatusCode(_0x1cfe1b,null))[_0x21a0('0x25')](handleError(_0x1cfe1b,null));};exports[_0x21a0('0x5f')]=function(_0x40d6eb,_0x42cd30){return db[_0x21a0('0x51')]['findAll']({'where':{'id':_0x40d6eb['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x21a0('0x48')],'as':_0x21a0('0x57'),'attributes':['id'],'raw':!![]}]})[_0x21a0('0x16')](handleEntityNotFound(_0x42cd30,null))[_0x21a0('0x16')](function(_0x3b7afd){var _0x4de5bd=_[_0x21a0('0x1e')](_0x3b7afd,'id');var _0x157a1d=[];var _0x78babf=[];var _0x4525a7=squel[_0x21a0('0x60')]();_0x4525a7[_0x21a0('0x61')](_0x21a0('0x62'))[_0x21a0('0x63')](_0x21a0('0x64'),'tq')[_0x21a0('0x65')](_0x21a0('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x21a0('0x23')]('ChatQueueId\x20=\x20?',_0x40d6eb[_0x21a0('0x26')]['id']);for(var _0x11fd0e=0x0;_0x11fd0e<_0x3b7afd[_0x21a0('0x2d')];_0x11fd0e+=0x1){let _0x415d08=_0x3b7afd[_0x11fd0e];for(var _0x398480=0x0;_0x398480<_0x415d08[_0x21a0('0x57')][_0x21a0('0x2d')];_0x398480+=0x1){let _0x5a259b=_0x415d08[_0x21a0('0x57')][_0x398480];var _0x3864b5=_0x4525a7[_0x21a0('0x67')]();_0x3864b5[_0x21a0('0x23')](_0x21a0('0x68'),_0x5a259b['id']);_0x78babf[_0x21a0('0x69')](db['sequelize'][_0x21a0('0x28')](_0x3864b5[_0x21a0('0x6a')](),{'type':db[_0x21a0('0x58')][_0x21a0('0x6b')]['SELECT']})['then'](function(_0x1e0484){if(_0x1e0484[_0x21a0('0x2d')]===0x1){return _0x5a259b['id'];}else{var _0x310698=_[_0x21a0('0x6c')](_[_0x21a0('0x1e')](_0x1e0484,_0x21a0('0x6d')),function(_0x2fe80a){return _[_0x21a0('0x6e')](_0x4de5bd,_0x2fe80a);});if(_0x310698){return _0x5a259b['id'];}}}));}}return BPromise[_0x21a0('0x6f')](_0x78babf)[_0x21a0('0x16')](function(_0x315e3b){_0x157a1d=_(_0x157a1d)[_0x21a0('0x70')](_0x315e3b)[_0x21a0('0x71')]()[_0x21a0('0x72')]();return db[_0x21a0('0x1f')][_0x21a0('0x31')]({'where':{'id':_0x40d6eb[_0x21a0('0x26')]['id']}})[_0x21a0('0x16')](function(_0x3353cb){return db[_0x21a0('0x58')][_0x21a0('0x59')](function(_0x202092){return _0x3353cb[_0x21a0('0x5f')](_0x40d6eb[_0x21a0('0x28')][_0x21a0('0x52')],{'transaction':_0x202092})[_0x21a0('0x16')](function(){if(!_['isEmpty'](_0x157a1d)){return _0x3353cb[_0x21a0('0x73')](_0x157a1d,{'transaction':_0x202092});}})[_0x21a0('0x16')](function(){_0x157a1d['forEach'](function(_0x3f8ce9){socket[_0x21a0('0x5d')](_0x21a0('0x74'),{'UserId':_0x3f8ce9,'ChatQueueId':_0x3353cb['id']});});});});});});})['then'](respondWithStatusCode(_0x42cd30,null))['catch'](handleError(_0x42cd30,null));};exports[_0x21a0('0x75')]=function(_0x481948,_0x276d83){return db['ChatQueue']['find']({'where':{'id':_0x481948['params']['id']}})[_0x21a0('0x16')](handleEntityNotFound(_0x276d83,null))[_0x21a0('0x16')](function(_0x575dc2){if(_0x575dc2){return _0x575dc2[_0x21a0('0x75')](_0x481948[_0x21a0('0x33')]['ids'],_[_0x21a0('0x76')](_0x481948['body'],['ids','id'])||{})[_0x21a0('0x77')](function(_0x5aaf7e){for(var _0xae32b3=0x0;_0xae32b3<_0x481948[_0x21a0('0x33')][_0x21a0('0x52')]['length'];_0xae32b3+=0x1){socket[_0x21a0('0x5d')]('userChatQueue:save',{'UserId':Number(_0x481948[_0x21a0('0x33')][_0x21a0('0x52')][_0xae32b3]),'ChatQueueId':Number(_0x481948['params']['id'])});}return _0x5aaf7e;});}})[_0x21a0('0x16')](respondWithResult(_0x276d83,null))[_0x21a0('0x25')](handleError(_0x276d83,null));};exports[_0x21a0('0x73')]=function(_0x317faa,_0x1a0e78){return db['ChatQueue']['find']({'where':{'id':_0x317faa[_0x21a0('0x26')]['id']}})['then'](handleEntityNotFound(_0x1a0e78,null))[_0x21a0('0x16')](function(_0x16aca1){if(_0x16aca1){return _0x16aca1[_0x21a0('0x73')](_0x317faa[_0x21a0('0x28')][_0x21a0('0x52')])[_0x21a0('0x16')](function(){if(_['isArray'](_0x317faa[_0x21a0('0x28')][_0x21a0('0x52')])){for(var _0x515034=0x0;_0x515034<_0x317faa[_0x21a0('0x28')][_0x21a0('0x52')][_0x21a0('0x2d')];_0x515034+=0x1){socket[_0x21a0('0x5d')]('userChatQueue:remove',{'UserId':Number(_0x317faa[_0x21a0('0x28')][_0x21a0('0x52')][_0x515034]),'ChatQueueId':Number(_0x317faa[_0x21a0('0x26')]['id'])});}}else{socket[_0x21a0('0x5d')]('userChatQueue:remove',{'UserId':Number(_0x317faa[_0x21a0('0x28')][_0x21a0('0x52')]),'ChatQueueId':Number(_0x317faa[_0x21a0('0x26')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a0e78,null))['catch'](handleError(_0x1a0e78,null));};exports['getAgents']=function(_0x3d741d,_0x17281e){var _0x4fdf20={};var _0x3f496a={};var _0x30b493;var _0x326a9d;return db[_0x21a0('0x1f')][_0x21a0('0x3e')]({'where':{'id':_0x3d741d[_0x21a0('0x26')]['id']}})['then'](handleEntityNotFound(_0x17281e,null))[_0x21a0('0x16')](function(_0x1f5ed0){if(_0x1f5ed0){_0x30b493=_0x1f5ed0;_0x3f496a[_0x21a0('0x27')]=_['keys'](db['User'][_0x21a0('0x20')]);_0x3f496a[_0x21a0('0x28')]=_[_0x21a0('0x3f')](_0x3d741d[_0x21a0('0x28')]);_0x3f496a[_0x21a0('0x29')]=_[_0x21a0('0x2a')](_0x3f496a[_0x21a0('0x27')],_0x3f496a['query']);_0x4fdf20[_0x21a0('0x2b')]=_[_0x21a0('0x2a')](_0x3f496a['model'],qs[_0x21a0('0x2c')](_0x3d741d[_0x21a0('0x28')][_0x21a0('0x2c')]));_0x4fdf20[_0x21a0('0x2b')]=_0x4fdf20[_0x21a0('0x2b')][_0x21a0('0x2d')]?_0x4fdf20[_0x21a0('0x2b')]:_0x3f496a[_0x21a0('0x27')];_0x4fdf20[_0x21a0('0x42')]=qs[_0x21a0('0x43')](_0x3d741d[_0x21a0('0x28')]['sort']);_0x4fdf20[_0x21a0('0x23')]=qs[_0x21a0('0x29')](_[_0x21a0('0x78')](_0x3d741d[_0x21a0('0x28')],_0x3f496a[_0x21a0('0x29')]));if(_0x3d741d['query']['filter']){_0x4fdf20['where']=_[_0x21a0('0x46')](_0x4fdf20[_0x21a0('0x23')],{'$or':_['map'](_0x4fdf20[_0x21a0('0x2b')],function(_0xba732c){var _0x34a7b2={};_0x34a7b2[_0xba732c]={'$like':'%'+_0x3d741d[_0x21a0('0x28')]['filter']+'%'};return _0x34a7b2;})});}_0x4fdf20=_['merge']({},_0x4fdf20,_0x3d741d[_0x21a0('0x30')]);return _0x30b493['getAgents'](_0x4fdf20);}})[_0x21a0('0x16')](function(_0x86a8db){if(_0x86a8db){_0x326a9d=_0x86a8db['length'];if(!_0x3d741d['query'][_0x21a0('0x40')](_0x21a0('0x41'))){_0x4fdf20[_0x21a0('0x11')]=qs[_0x21a0('0x11')](_0x3d741d['query']['limit']);_0x4fdf20[_0x21a0('0xf')]=qs[_0x21a0('0xf')](_0x3d741d['query'][_0x21a0('0xf')]);}return _0x30b493['getAgents'](_0x4fdf20);}})[_0x21a0('0x16')](function(_0x30b008){if(_0x30b008){return _0x30b008?{'count':_0x326a9d,'rows':_0x30b008}:null;}})[_0x21a0('0x16')](respondWithResult(_0x17281e,null))[_0x21a0('0x25')](handleError(_0x17281e,null));}; \ No newline at end of file +var _0x6af3=['localhost','socket.io-emitter','./chatQueue.socket','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','UserProfileResource','status','error','name','send','index','map','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','catch','show','params','keys','model','attributes','intersection','fields','options','find','create','user','get','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','filters','length','nolimit','sort','pick','filter','merge','User','findAndCountAll','UserId','agent','chatPause','createdAt','rows','format','%s/%s','updatedAt','getTeams','Team','order','hasOwnProperty','addTeams','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userChatQueue:save','ids','field','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','value','isEmpty','userChatQueue:remove','addAgents','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','redis'];(function(_0x4c8213,_0x1bda8e){var _0x2af582=function(_0x581e84){while(--_0x581e84){_0x4c8213['push'](_0x4c8213['shift']());}};_0x2af582(++_0x1bda8e);}(_0x6af3,0x14f));var _0x36af=function(_0x25dc3c,_0x17c816){_0x25dc3c=_0x25dc3c-0x0;var _0x1382e3=_0x6af3[_0x25dc3c];return _0x1382e3;};'use strict';var BPromise=require(_0x36af('0x0'));var util=require(_0x36af('0x1'));var _=require(_0x36af('0x2'));var squel=require(_0x36af('0x3'));var Redis=require('ioredis');var qs=require(_0x36af('0x4'));var logger=require(_0x36af('0x5'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x36af('0x6')]=_['defaults'](config['redis'],{'host':_0x36af('0x7'),'port':0x18eb});var socket=require(_0x36af('0x8'))(new Redis(config[_0x36af('0x6')]));require(_0x36af('0x9'))['register'](socket);function respondWithStatusCode(_0x344763,_0x16dd01){_0x16dd01=_0x16dd01||0xcc;return function(_0x590acb){if(_0x590acb){return _0x344763[_0x36af('0xa')](_0x16dd01);}return _0x344763['status'](_0x16dd01)[_0x36af('0xb')]();};}function respondWithResult(_0x4395af,_0x2afc41){_0x2afc41=_0x2afc41||0xc8;return function(_0x1bd821){if(_0x1bd821){return _0x4395af['status'](_0x2afc41)[_0x36af('0xc')](_0x1bd821);}};}function respondWithFilteredResult(_0x2e97f9,_0x23c5d7){return function(_0x282636){if(_0x282636){var _0x5359c7=typeof _0x23c5d7[_0x36af('0xd')]===_0x36af('0xe')&&typeof _0x23c5d7[_0x36af('0xf')]==='undefined';var _0xf759ad=_0x282636[_0x36af('0x10')];var _0x4558bb=_0x5359c7?0x0:_0x23c5d7[_0x36af('0xd')];var _0x54b8e8=_0x5359c7?_0x282636[_0x36af('0x10')]:_0x23c5d7[_0x36af('0xd')]+_0x23c5d7[_0x36af('0xf')];var _0x11395d;if(_0x54b8e8>=_0xf759ad){_0x54b8e8=_0xf759ad;_0x11395d=0xc8;}else{_0x11395d=0xce;}_0x2e97f9['status'](_0x11395d);return _0x2e97f9[_0x36af('0x11')](_0x36af('0x12'),_0x4558bb+'-'+_0x54b8e8+'/'+_0xf759ad)[_0x36af('0xc')](_0x282636);}return null;};}function saveUpdates(_0x319bb9){return function(_0x1aa42e){if(_0x1aa42e){return _0x1aa42e['update'](_0x319bb9)[_0x36af('0x13')](function(_0x27d00f){return _0x27d00f;});}return null;};}function removeEntity(_0x2b8b83){return function(_0x258b93){if(_0x258b93){return _0x258b93[_0x36af('0x14')]()[_0x36af('0x13')](function(){var _0x41caf2=_0x258b93['get']({'plain':!![]});var _0x6f0cd='ChatQueues';return db[_0x36af('0x15')][_0x36af('0x14')]({'where':{'type':_0x6f0cd,'resourceId':_0x41caf2['id']}})[_0x36af('0x13')](function(){return _0x258b93;});})[_0x36af('0x13')](function(){_0x2b8b83[_0x36af('0x16')](0xcc)[_0x36af('0xb')]();});}};}function handleEntityNotFound(_0x58933a){return function(_0x34a961){if(!_0x34a961){_0x58933a[_0x36af('0xa')](0x194);}return _0x34a961;};}function handleError(_0x36d729,_0x1b3793){_0x1b3793=_0x1b3793||0x1f4;return function(_0x43c268){logger[_0x36af('0x17')](_0x43c268['stack']);if(_0x43c268['name']){delete _0x43c268[_0x36af('0x18')];}_0x36d729[_0x36af('0x16')](_0x1b3793)[_0x36af('0x19')](_0x43c268);};}exports[_0x36af('0x1a')]=function(_0x5bc534,_0x15729b){var _0x10d8c3={};var _0x52651b={'count':0x0,'rows':[]};var _0x2d269f=_[_0x36af('0x1b')](db['ChatQueue']['rawAttributes'],function(_0x2f3842){return{'name':_0x2f3842[_0x36af('0x1c')],'type':_0x2f3842[_0x36af('0x1d')][_0x36af('0x1e')]};});_0x10d8c3=qs[_0x36af('0x1f')](_0x2d269f,_0x5bc534);var _0x1d77f9={'where':_0x10d8c3[_0x36af('0x20')]};return db[_0x36af('0x21')][_0x36af('0x10')](_0x1d77f9)['then'](function(_0x35927d){_0x52651b[_0x36af('0x10')]=_0x35927d;_0x10d8c3[_0x36af('0x22')]=qs[_0x36af('0x22')](_0x5bc534[_0x36af('0x23')]);return db[_0x36af('0x21')][_0x36af('0x24')](_0x10d8c3);})[_0x36af('0x13')](function(_0x1664a6){_0x52651b['rows']=_0x1664a6;return _0x52651b;})[_0x36af('0x13')](respondWithFilteredResult(_0x15729b,_0x10d8c3))[_0x36af('0x25')](handleError(_0x15729b,null));};exports[_0x36af('0x26')]=function(_0x1dd8e4,_0x98672c){var _0xf3da7f={'raw':!![],'where':{'id':_0x1dd8e4[_0x36af('0x27')]['id']}},_0x3373f9={};_0x3373f9['model']=_[_0x36af('0x28')](db['ChatQueue']['rawAttributes']);_0x3373f9['query']=_[_0x36af('0x28')](_0x1dd8e4[_0x36af('0x23')]);_0x3373f9['filters']=_['intersection'](_0x3373f9[_0x36af('0x29')],_0x3373f9[_0x36af('0x23')]);_0xf3da7f[_0x36af('0x2a')]=_[_0x36af('0x2b')](_0x3373f9[_0x36af('0x29')],qs[_0x36af('0x2c')](_0x1dd8e4[_0x36af('0x23')][_0x36af('0x2c')]));_0xf3da7f[_0x36af('0x2a')]=_0xf3da7f[_0x36af('0x2a')]['length']?_0xf3da7f[_0x36af('0x2a')]:_0x3373f9[_0x36af('0x29')];if(_0x1dd8e4[_0x36af('0x23')]['includeAll']){_0xf3da7f['include']=[{'all':!![]}];}_0xf3da7f=_['merge']({},_0xf3da7f,_0x1dd8e4[_0x36af('0x2d')]);return db[_0x36af('0x21')][_0x36af('0x2e')](_0xf3da7f)[_0x36af('0x13')](handleEntityNotFound(_0x98672c,null))[_0x36af('0x13')](respondWithResult(_0x98672c,null))[_0x36af('0x25')](handleError(_0x98672c,null));};exports[_0x36af('0x2f')]=function(_0x19208a,_0x204015){return db[_0x36af('0x21')]['create'](_0x19208a['body'],{})[_0x36af('0x13')](function(_0x181d21){var _0x2de4b4=_0x19208a[_0x36af('0x30')][_0x36af('0x31')]({'plain':!![]});if(!_0x2de4b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2de4b4[_0x36af('0x32')]===_0x36af('0x30')){var _0x24e459=_0x181d21[_0x36af('0x31')]({'plain':!![]});var _0x355770=_0x36af('0x33');return db[_0x36af('0x34')][_0x36af('0x2e')]({'where':{'name':_0x355770,'userProfileId':_0x2de4b4[_0x36af('0x35')]},'raw':!![]})[_0x36af('0x13')](function(_0x2fa240){if(_0x2fa240&&_0x2fa240[_0x36af('0x36')]===0x0){return db[_0x36af('0x15')][_0x36af('0x2f')]({'name':_0x24e459[_0x36af('0x18')],'resourceId':_0x24e459['id'],'type':_0x2fa240[_0x36af('0x18')],'sectionId':_0x2fa240['id']},{})[_0x36af('0x13')](function(){return _0x181d21;});}else{return _0x181d21;}})[_0x36af('0x25')](function(_0x3d1e36){logger[_0x36af('0x17')](_0x36af('0x37'),_0x3d1e36);throw _0x3d1e36;});}return _0x181d21;})['then'](respondWithResult(_0x204015,0xc9))[_0x36af('0x25')](handleError(_0x204015,null));};exports['update']=function(_0x5dc6c5,_0x5114a6){if(_0x5dc6c5['body']['id']){delete _0x5dc6c5[_0x36af('0x38')]['id'];}return db[_0x36af('0x21')][_0x36af('0x2e')]({'where':{'id':_0x5dc6c5['params']['id']}})[_0x36af('0x13')](handleEntityNotFound(_0x5114a6,null))[_0x36af('0x13')](saveUpdates(_0x5dc6c5[_0x36af('0x38')],null))[_0x36af('0x13')](respondWithResult(_0x5114a6,null))[_0x36af('0x25')](handleError(_0x5114a6,null));};exports[_0x36af('0x14')]=function(_0x46b001,_0x2d69c7){return db['ChatQueue']['find']({'where':{'id':_0x46b001['params']['id']}})[_0x36af('0x13')](handleEntityNotFound(_0x2d69c7,null))[_0x36af('0x13')](removeEntity(_0x2d69c7,null))[_0x36af('0x25')](handleError(_0x2d69c7,null));};exports[_0x36af('0x39')]=function(_0x1255c6,_0x3b74cb){return db[_0x36af('0x21')][_0x36af('0x39')]()['then'](respondWithResult(_0x3b74cb,null))['catch'](handleError(_0x3b74cb,null));};exports[_0x36af('0x3a')]=function(_0x367c11,_0x362d71){var _0x46ba96={'raw':!![],'where':{}},_0x45ad70={},_0x24c491;return db[_0x36af('0x21')][_0x36af('0x3b')]({'where':{'id':_0x367c11['params']['id']}})[_0x36af('0x13')](handleEntityNotFound(_0x362d71,null))[_0x36af('0x13')](function(_0x300ddd){if(_0x300ddd){_0x24c491=_0x300ddd['get']({'plain':!![]});_0x45ad70['model']=_['keys'](db[_0x36af('0x3c')]['rawAttributes']);_0x45ad70[_0x36af('0x23')]=_[_0x36af('0x28')](_0x367c11[_0x36af('0x23')]);_0x45ad70[_0x36af('0x3d')]=_[_0x36af('0x2b')](_0x45ad70[_0x36af('0x29')],_0x45ad70['query']);_0x46ba96[_0x36af('0x2a')]=_['intersection'](_0x45ad70[_0x36af('0x29')],qs[_0x36af('0x2c')](_0x367c11[_0x36af('0x23')][_0x36af('0x2c')]));_0x46ba96[_0x36af('0x2a')]=_0x46ba96[_0x36af('0x2a')][_0x36af('0x3e')]?_0x46ba96[_0x36af('0x2a')]:_0x45ad70[_0x36af('0x29')];if(!_0x367c11[_0x36af('0x23')]['hasOwnProperty'](_0x36af('0x3f'))){_0x46ba96[_0x36af('0xf')]=qs[_0x36af('0xf')](_0x367c11[_0x36af('0x23')]['limit']);_0x46ba96[_0x36af('0xd')]=qs['offset'](_0x367c11[_0x36af('0x23')]['offset']);}_0x46ba96['order']=qs[_0x36af('0x40')](_0x367c11[_0x36af('0x23')][_0x36af('0x40')]);_0x46ba96[_0x36af('0x20')]=qs['filters'](_[_0x36af('0x41')](_0x367c11[_0x36af('0x23')],_0x45ad70['filters']));_0x46ba96[_0x36af('0x20')]['ChatQueueId']=_0x300ddd['id'];if(_0x367c11[_0x36af('0x23')][_0x36af('0x42')]){_0x46ba96[_0x36af('0x20')]=_[_0x36af('0x43')](_0x46ba96['where'],{'$or':_[_0x36af('0x1b')](_0x46ba96[_0x36af('0x2a')],function(_0x266f46){var _0xb59d9f={};_0xb59d9f[_0x266f46]={'$like':'%'+_0x367c11['query']['filter']+'%'};return _0xb59d9f;})});}_0x46ba96=_['merge']({},_0x46ba96,_0x367c11[_0x36af('0x2d')]);return db[_0x36af('0x3c')][_0x36af('0x24')](_0x46ba96);}})[_0x36af('0x13')](function(_0x190721){if(_0x190721){return db[_0x36af('0x44')][_0x36af('0x45')]({'where':{'id':_[_0x36af('0x1b')](_0x190721,_0x36af('0x46')),'role':_0x36af('0x47')},'attributes':['id','name',_0x36af('0x48'),'updatedAt',_0x36af('0x49')]});}})[_0x36af('0x13')](function(_0xd19836){if(_0xd19836){return{'count':_0xd19836[_0x36af('0x10')],'rows':_[_0x36af('0x1b')](_0xd19836[_0x36af('0x4a')],function(_0x3a0b31){return{'membername':_0x3a0b31['name'],'UserId':_0x3a0b31['id'],'queue_name':_0x24c491[_0x36af('0x18')],'ChatQueueId':_0x24c491['id'],'interface':util[_0x36af('0x4b')](_0x36af('0x4c'),'SIP',_0x3a0b31['name']),'penalty':0x0,'paused':_0x3a0b31['chatPause'],'createdAt':_0x3a0b31['createdAt'],'updatedAt':_0x3a0b31[_0x36af('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x36af('0x13')](respondWithFilteredResult(_0x362d71,_0x46ba96))[_0x36af('0x25')](handleError(_0x362d71,null));};exports[_0x36af('0x4e')]=function(_0x5eb893,_0xc56f12){var _0x1170fb={};var _0x11c9e1={};var _0x3ea612;var _0x31c3cf;return db[_0x36af('0x21')][_0x36af('0x3b')]({'where':{'id':_0x5eb893[_0x36af('0x27')]['id']}})[_0x36af('0x13')](handleEntityNotFound(_0xc56f12,null))['then'](function(_0x27b04e){if(_0x27b04e){_0x3ea612=_0x27b04e;_0x11c9e1[_0x36af('0x29')]=_[_0x36af('0x28')](db[_0x36af('0x4f')]['rawAttributes']);_0x11c9e1['query']=_['keys'](_0x5eb893[_0x36af('0x23')]);_0x11c9e1[_0x36af('0x3d')]=_[_0x36af('0x2b')](_0x11c9e1[_0x36af('0x29')],_0x11c9e1[_0x36af('0x23')]);_0x1170fb['attributes']=_[_0x36af('0x2b')](_0x11c9e1[_0x36af('0x29')],qs['fields'](_0x5eb893[_0x36af('0x23')][_0x36af('0x2c')]));_0x1170fb[_0x36af('0x2a')]=_0x1170fb[_0x36af('0x2a')][_0x36af('0x3e')]?_0x1170fb['attributes']:_0x11c9e1[_0x36af('0x29')];_0x1170fb[_0x36af('0x50')]=qs[_0x36af('0x40')](_0x5eb893['query'][_0x36af('0x40')]);_0x1170fb[_0x36af('0x20')]=qs[_0x36af('0x3d')](_[_0x36af('0x41')](_0x5eb893[_0x36af('0x23')],_0x11c9e1['filters']));if(_0x5eb893[_0x36af('0x23')][_0x36af('0x42')]){_0x1170fb[_0x36af('0x20')]=_[_0x36af('0x43')](_0x1170fb['where'],{'$or':_[_0x36af('0x1b')](_0x1170fb[_0x36af('0x2a')],function(_0x225c83){var _0x877a94={};_0x877a94[_0x225c83]={'$like':'%'+_0x5eb893['query'][_0x36af('0x42')]+'%'};return _0x877a94;})});}_0x1170fb=_[_0x36af('0x43')]({},_0x1170fb,_0x5eb893[_0x36af('0x2d')]);return _0x3ea612[_0x36af('0x4e')](_0x1170fb);}})[_0x36af('0x13')](function(_0x3f2956){if(_0x3f2956){_0x31c3cf=_0x3f2956['length'];if(!_0x5eb893['query'][_0x36af('0x51')](_0x36af('0x3f'))){_0x1170fb[_0x36af('0xf')]=qs[_0x36af('0xf')](_0x5eb893[_0x36af('0x23')]['limit']);_0x1170fb[_0x36af('0xd')]=qs[_0x36af('0xd')](_0x5eb893[_0x36af('0x23')][_0x36af('0xd')]);}return _0x3ea612[_0x36af('0x4e')](_0x1170fb);}})[_0x36af('0x13')](function(_0x4deff9){if(_0x4deff9){return _0x4deff9?{'count':_0x31c3cf,'rows':_0x4deff9}:null;}})[_0x36af('0x13')](respondWithResult(_0xc56f12,null))[_0x36af('0x25')](handleError(_0xc56f12,null));};exports[_0x36af('0x52')]=function(_0x30f6d3,_0x3af9b5){var _0x253a98=_0x30f6d3[_0x36af('0x38')]['ids'];return db[_0x36af('0x4f')]['findAll']({'where':{'id':_0x253a98},'attributes':['id'],'include':[{'model':db[_0x36af('0x44')],'as':'Agents','attributes':['id',_0x36af('0x18'),'online',_0x36af('0x53'),_0x36af('0x54')],'raw':!![]}]})['then'](function(_0xea0c5){if(_0xea0c5){var _0xac38fa=_[_0x36af('0x55')](_0xea0c5,function(_0x4932a0){var _0x1cd098=_0x4932a0['get']({'plain':!![]});return _0x1cd098[_0x36af('0x56')];});return db['ChatQueue'][_0x36af('0x2e')]({'where':{'id':_0x30f6d3[_0x36af('0x27')]['id']}})['then'](function(_0x73884b){return db[_0x36af('0x57')][_0x36af('0x58')](function(_0xa60538){return _0x73884b['addTeams'](_0x253a98,{'transaction':_0xa60538})['then'](function(){return BPromise[_0x36af('0x59')](_0xac38fa,function(_0x35e5cc){return db[_0x36af('0x3c')]['findOrCreate']({'where':{'UserId':_0x35e5cc['id'],'ChatQueueId':_0x30f6d3[_0x36af('0x27')]['id']},'transaction':_0xa60538});});})['then'](function(){_0xac38fa[_0x36af('0x5a')](function(_0x288704){socket[_0x36af('0x5b')](_0x36af('0x5c'),{'UserId':_0x288704['id'],'ChatQueueId':_0x73884b['id']});});});});});}})[_0x36af('0x13')](respondWithStatusCode(_0x3af9b5,null))[_0x36af('0x25')](handleError(_0x3af9b5,null));};exports['removeTeams']=function(_0x59dff0,_0x2f9650){return db[_0x36af('0x4f')][_0x36af('0x24')]({'where':{'id':_0x59dff0['query'][_0x36af('0x5d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x36af('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f9650,null))[_0x36af('0x13')](function(_0x578a9e){var _0x3c7ed5=_[_0x36af('0x1b')](_0x578a9e,'id');var _0x98004c=[];var _0x220511=[];var _0x1eb353=squel['select']();_0x1eb353[_0x36af('0x5e')](_0x36af('0x5f'))['from'](_0x36af('0x60'),'tq')[_0x36af('0x61')]('user_has_teams','ut',_0x36af('0x62'))[_0x36af('0x20')](_0x36af('0x63'),_0x59dff0[_0x36af('0x27')]['id']);for(var _0x3e85a1=0x0;_0x3e85a1<_0x578a9e[_0x36af('0x3e')];_0x3e85a1+=0x1){let _0x112681=_0x578a9e[_0x3e85a1];for(var _0x21a223=0x0;_0x21a223<_0x112681['Agents'][_0x36af('0x3e')];_0x21a223+=0x1){let _0x1ce2db=_0x112681['Agents'][_0x21a223];var _0xba51c6=_0x1eb353['clone']();_0xba51c6[_0x36af('0x20')](_0x36af('0x64'),_0x1ce2db['id']);_0x220511[_0x36af('0x65')](db[_0x36af('0x57')]['query'](_0xba51c6['toString'](),{'type':db[_0x36af('0x57')][_0x36af('0x66')]['SELECT']})[_0x36af('0x13')](function(_0x31f602){if(_0x31f602[_0x36af('0x3e')]===0x1){return _0x1ce2db['id'];}else{var _0x2933b4=_[_0x36af('0x67')](_[_0x36af('0x1b')](_0x31f602,_0x36af('0x68')),function(_0x4def36){return _[_0x36af('0x69')](_0x3c7ed5,_0x4def36);});if(_0x2933b4){return _0x1ce2db['id'];}}}));}}return BPromise[_0x36af('0x6a')](_0x220511)[_0x36af('0x13')](function(_0x3dfedb){_0x98004c=_(_0x98004c)['union'](_0x3dfedb)['compact']()[_0x36af('0x6b')]();return db['ChatQueue']['find']({'where':{'id':_0x59dff0[_0x36af('0x27')]['id']}})[_0x36af('0x13')](function(_0x451f4f){return db['sequelize'][_0x36af('0x58')](function(_0x1b1135){return _0x451f4f['removeTeams'](_0x59dff0['query'][_0x36af('0x5d')],{'transaction':_0x1b1135})[_0x36af('0x13')](function(){if(!_[_0x36af('0x6c')](_0x98004c)){return _0x451f4f['removeAgents'](_0x98004c,{'transaction':_0x1b1135});}})[_0x36af('0x13')](function(){_0x98004c[_0x36af('0x5a')](function(_0x25fd3e){socket[_0x36af('0x5b')](_0x36af('0x6d'),{'UserId':_0x25fd3e,'ChatQueueId':_0x451f4f['id']});});});});});});})[_0x36af('0x13')](respondWithStatusCode(_0x2f9650,null))[_0x36af('0x25')](handleError(_0x2f9650,null));};exports[_0x36af('0x6e')]=function(_0x482375,_0x416e33){return db[_0x36af('0x21')][_0x36af('0x2e')]({'where':{'id':_0x482375['params']['id']}})['then'](handleEntityNotFound(_0x416e33,null))[_0x36af('0x13')](function(_0x4af425){if(_0x4af425){return _0x4af425[_0x36af('0x6e')](_0x482375[_0x36af('0x38')]['ids'],_['omit'](_0x482375[_0x36af('0x38')],[_0x36af('0x5d'),'id'])||{})['spread'](function(_0x3f960e){for(var _0x25757c=0x0;_0x25757c<_0x482375[_0x36af('0x38')][_0x36af('0x5d')][_0x36af('0x3e')];_0x25757c+=0x1){socket[_0x36af('0x5b')]('userChatQueue:save',{'UserId':Number(_0x482375['body'][_0x36af('0x5d')][_0x25757c]),'ChatQueueId':Number(_0x482375[_0x36af('0x27')]['id'])});}return _0x3f960e;});}})[_0x36af('0x13')](respondWithResult(_0x416e33,null))[_0x36af('0x25')](handleError(_0x416e33,null));};exports[_0x36af('0x6f')]=function(_0x117030,_0x47174d){return db[_0x36af('0x21')][_0x36af('0x2e')]({'where':{'id':_0x117030[_0x36af('0x27')]['id']}})[_0x36af('0x13')](handleEntityNotFound(_0x47174d,null))['then'](function(_0x161337){if(_0x161337){return _0x161337['removeAgents'](_0x117030['query'][_0x36af('0x5d')])[_0x36af('0x13')](function(){if(_[_0x36af('0x70')](_0x117030[_0x36af('0x23')][_0x36af('0x5d')])){for(var _0x153a7e=0x0;_0x153a7e<_0x117030[_0x36af('0x23')][_0x36af('0x5d')][_0x36af('0x3e')];_0x153a7e+=0x1){socket[_0x36af('0x5b')](_0x36af('0x6d'),{'UserId':Number(_0x117030[_0x36af('0x23')][_0x36af('0x5d')][_0x153a7e]),'ChatQueueId':Number(_0x117030[_0x36af('0x27')]['id'])});}}else{socket['emit'](_0x36af('0x6d'),{'UserId':Number(_0x117030[_0x36af('0x23')][_0x36af('0x5d')]),'ChatQueueId':Number(_0x117030[_0x36af('0x27')]['id'])});}});}})[_0x36af('0x13')](respondWithStatusCode(_0x47174d,null))[_0x36af('0x25')](handleError(_0x47174d,null));};exports[_0x36af('0x71')]=function(_0x342765,_0x4586da){var _0x3c1759={};var _0x190bd4={};var _0x341738;var _0xf54a5e;return db['ChatQueue'][_0x36af('0x3b')]({'where':{'id':_0x342765[_0x36af('0x27')]['id']}})['then'](handleEntityNotFound(_0x4586da,null))['then'](function(_0x53ec34){if(_0x53ec34){_0x341738=_0x53ec34;_0x190bd4[_0x36af('0x29')]=_['keys'](db[_0x36af('0x44')]['rawAttributes']);_0x190bd4[_0x36af('0x23')]=_['keys'](_0x342765[_0x36af('0x23')]);_0x190bd4[_0x36af('0x3d')]=_['intersection'](_0x190bd4[_0x36af('0x29')],_0x190bd4[_0x36af('0x23')]);_0x3c1759[_0x36af('0x2a')]=_[_0x36af('0x2b')](_0x190bd4[_0x36af('0x29')],qs[_0x36af('0x2c')](_0x342765[_0x36af('0x23')][_0x36af('0x2c')]));_0x3c1759[_0x36af('0x2a')]=_0x3c1759[_0x36af('0x2a')][_0x36af('0x3e')]?_0x3c1759[_0x36af('0x2a')]:_0x190bd4[_0x36af('0x29')];_0x3c1759['order']=qs[_0x36af('0x40')](_0x342765['query'][_0x36af('0x40')]);_0x3c1759[_0x36af('0x20')]=qs[_0x36af('0x3d')](_[_0x36af('0x41')](_0x342765[_0x36af('0x23')],_0x190bd4[_0x36af('0x3d')]));if(_0x342765[_0x36af('0x23')][_0x36af('0x42')]){_0x3c1759['where']=_[_0x36af('0x43')](_0x3c1759[_0x36af('0x20')],{'$or':_['map'](_0x3c1759[_0x36af('0x2a')],function(_0x176f20){var _0x1592cc={};_0x1592cc[_0x176f20]={'$like':'%'+_0x342765[_0x36af('0x23')][_0x36af('0x42')]+'%'};return _0x1592cc;})});}_0x3c1759=_[_0x36af('0x43')]({},_0x3c1759,_0x342765[_0x36af('0x2d')]);return _0x341738[_0x36af('0x71')](_0x3c1759);}})[_0x36af('0x13')](function(_0x2d7f9d){if(_0x2d7f9d){_0xf54a5e=_0x2d7f9d[_0x36af('0x3e')];if(!_0x342765[_0x36af('0x23')]['hasOwnProperty'](_0x36af('0x3f'))){_0x3c1759[_0x36af('0xf')]=qs[_0x36af('0xf')](_0x342765[_0x36af('0x23')][_0x36af('0xf')]);_0x3c1759[_0x36af('0xd')]=qs[_0x36af('0xd')](_0x342765[_0x36af('0x23')][_0x36af('0xd')]);}return _0x341738['getAgents'](_0x3c1759);}})[_0x36af('0x13')](function(_0x104267){if(_0x104267){return _0x104267?{'count':_0xf54a5e,'rows':_0x104267}:null;}})['then'](respondWithResult(_0x4586da,null))['catch'](handleError(_0x4586da,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index c48524f..d2a6d2e 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 _0xe94a=['emit','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xe94a,0x1b7));var _0xae94=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0xe94a[_0x1c2f29];return _0x258465;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xae94('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xae94('0x1')](0x0);var events={'afterCreate':_0xae94('0x2'),'afterUpdate':_0xae94('0x3'),'afterDestroy':_0xae94('0x4')};function emitEvent(_0x1f7eae){return function(_0x1912eb,_0x4dd52a,_0x44f40e){ChatQueueEvents[_0xae94('0x5')](_0x1f7eae+':'+_0x1912eb['id'],_0x1912eb);ChatQueueEvents[_0xae94('0x5')](_0x1f7eae,_0x1912eb);_0x44f40e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x2991=['events','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x16970b,_0x19b654){var _0x2aff7f=function(_0x241df3){while(--_0x241df3){_0x16970b['push'](_0x16970b['shift']());}};_0x2aff7f(++_0x19b654);}(_0x2991,0x132));var _0x1299=function(_0x414ddf,_0x14586c){_0x414ddf=_0x414ddf-0x0;var _0x2e6951=_0x2991[_0x414ddf];return _0x2e6951;};'use strict';var EventEmitter=require(_0x1299('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x1299('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1299('0x2'),'afterUpdate':_0x1299('0x3'),'afterDestroy':_0x1299('0x4')};function emitEvent(_0x50bb12){return function(_0x2e360b,_0x48ac72,_0xefd74a){ChatQueueEvents[_0x1299('0x5')](_0x50bb12+':'+_0x2e360b['id'],_0x2e360b);ChatQueueEvents['emit'](_0x50bb12,_0x2e360b);_0xefd74a(null);};}for(var e in events){if(events[_0x1299('0x6')](e)){var event=events[e];ChatQueue[_0x1299('0x7')](e,emitEvent(event));}}module[_0x1299('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 813f846..43645fc 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 _0xc9f8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','lodash','util','../../config/logger','api'];(function(_0x4146bf,_0x25c865){var _0x5d189a=function(_0x179884){while(--_0x179884){_0x4146bf['push'](_0x4146bf['shift']());}};_0x5d189a(++_0x25c865);}(_0xc9f8,0x158));var _0x8c9f=function(_0x48a6d4,_0x3ce767){_0x48a6d4=_0x48a6d4-0x0;var _0x4fa9ba=_0xc9f8[_0x48a6d4];return _0x4fa9ba;};'use strict';var _=require(_0x8c9f('0x0'));var util=require(_0x8c9f('0x1'));var logger=require(_0x8c9f('0x2'))(_0x8c9f('0x3'));var moment=require(_0x8c9f('0x4'));var BPromise=require(_0x8c9f('0x5'));var rp=require(_0x8c9f('0x6'));var fs=require('fs');var path=require(_0x8c9f('0x7'));var rimraf=require(_0x8c9f('0x8'));var config=require(_0x8c9f('0x9'));var attributes=require(_0x8c9f('0xa'));module['exports']=function(_0x5ef3ea,_0x566cc6){return _0x5ef3ea[_0x8c9f('0xb')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5da4=['../../config/logger','api','moment','bluebird','path','../../config/environment','ChatQueue','chat_queues','util'];(function(_0x146fd9,_0x2188c9){var _0x469fb1=function(_0x26f4e4){while(--_0x26f4e4){_0x146fd9['push'](_0x146fd9['shift']());}};_0x469fb1(++_0x2188c9);}(_0x5da4,0x15e));var _0x45da=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x5da4[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require(_0x45da('0x0'));var logger=require(_0x45da('0x1'))(_0x45da('0x2'));var moment=require(_0x45da('0x3'));var BPromise=require(_0x45da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x45da('0x5'));var rimraf=require('rimraf');var config=require(_0x45da('0x6'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x1687dc,_0x718fe3){return _0x1687dc['define'](_0x45da('0x7'),attributes,{'tableName':_0x45da('0x8'),'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 fbdc7d3..dd61ebe 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 _0x2572=['catch','GetChatQueue','findAll','options','where','attributes','limit','include','model','map','debug','ShowChatQueue','ChatQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result'];(function(_0x23a673,_0x31e4bc){var _0x2213b7=function(_0x3c5dcc){while(--_0x3c5dcc){_0x23a673['push'](_0x23a673['shift']());}};_0x2213b7(++_0x31e4bc);}(_0x2572,0x110));var _0x2257=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x2572[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x2257('0x0'));var util=require(_0x2257('0x1'));var moment=require(_0x2257('0x2'));var BPromise=require(_0x2257('0x3'));var rs=require(_0x2257('0x4'));var fs=require('fs');var Redis=require(_0x2257('0x5'));var db=require(_0x2257('0x6'))['db'];var utils=require(_0x2257('0x7'));var logger=require(_0x2257('0x8'))('rpc');var config=require(_0x2257('0x9'));var jayson=require(_0x2257('0xa'));var client=jayson[_0x2257('0xb')][_0x2257('0xc')]({'port':0x232a});config[_0x2257('0xd')]=_[_0x2257('0xe')](config[_0x2257('0xd')],{'host':_0x2257('0xf'),'port':0x18eb});var socket=require(_0x2257('0x10'))(new Redis(config['redis']));require(_0x2257('0x11'))[_0x2257('0x12')](socket);function respondWithRpcPromise(_0x585a28,_0x36a281,_0x8f65b3){return new BPromise(function(_0x2d22d0,_0x4bab94){return client[_0x2257('0x13')](_0x585a28,_0x8f65b3)[_0x2257('0x14')](function(_0xe89b3a){logger[_0x2257('0x15')]('ChatQueue,\x20%s,\x20%s',_0x36a281,_0x2257('0x16'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x36a281,_0x2257('0x16'),JSON[_0x2257('0x17')](_0xe89b3a));if(_0xe89b3a[_0x2257('0x18')]){if(_0xe89b3a[_0x2257('0x18')][_0x2257('0x19')]===0x1f4){logger[_0x2257('0x18')](_0x2257('0x1a'),_0x36a281,_0xe89b3a['error']['message']);return _0x4bab94(_0xe89b3a[_0x2257('0x18')][_0x2257('0x1b')]);}logger[_0x2257('0x18')](_0x2257('0x1a'),_0x36a281,_0xe89b3a['error']['message']);return _0x2d22d0(_0xe89b3a[_0x2257('0x18')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x36a281,_0x2257('0x16'));_0x2d22d0(_0xe89b3a[_0x2257('0x1c')][_0x2257('0x1b')]);}})[_0x2257('0x1d')](function(_0x119136){logger[_0x2257('0x18')](_0x2257('0x1a'),_0x36a281,_0x119136);_0x4bab94(_0x119136);});});}exports[_0x2257('0x1e')]=function(_0x2c580f){var _0x14ec4d=this;return new Promise(function(_0x11eb88,_0x263108){return db['ChatQueue'][_0x2257('0x1f')]({'raw':_0x2c580f[_0x2257('0x20')]?_0x2c580f['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c580f[_0x2257('0x20')]?_0x2c580f['options'][_0x2257('0x21')]||null:null,'attributes':_0x2c580f[_0x2257('0x20')]?_0x2c580f[_0x2257('0x20')][_0x2257('0x22')]||null:null,'limit':_0x2c580f[_0x2257('0x20')]?_0x2c580f[_0x2257('0x20')][_0x2257('0x23')]||null:null,'include':_0x2c580f[_0x2257('0x20')]?_0x2c580f[_0x2257('0x20')][_0x2257('0x24')]?_['map'](_0x2c580f[_0x2257('0x20')][_0x2257('0x24')],function(_0x58e30d){return{'model':db[_0x58e30d[_0x2257('0x25')]],'as':_0x58e30d['as'],'attributes':_0x58e30d[_0x2257('0x22')],'include':_0x58e30d['include']?_[_0x2257('0x26')](_0x58e30d[_0x2257('0x24')],function(_0x4bdc02){return{'model':db[_0x4bdc02[_0x2257('0x25')]],'as':_0x4bdc02['as'],'attributes':_0x4bdc02[_0x2257('0x22')],'include':_0x4bdc02[_0x2257('0x24')]?_[_0x2257('0x26')](_0x4bdc02['include'],function(_0x8b9b1b){return{'model':db[_0x8b9b1b[_0x2257('0x25')]],'as':_0x8b9b1b['as'],'attributes':_0x8b9b1b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2257('0x14')](function(_0x1c19c6){logger[_0x2257('0x15')](_0x2257('0x1e'),_0x2c580f);logger[_0x2257('0x27')](_0x2257('0x1e'),_0x2c580f,JSON[_0x2257('0x17')](_0x1c19c6));_0x11eb88(_0x1c19c6);})[_0x2257('0x1d')](function(_0x320ead){logger['error'](_0x2257('0x1e'),_0x320ead[_0x2257('0x1b')],_0x2c580f);_0x263108(_0x14ec4d['error'](0x1f4,_0x320ead['message']));});});};exports[_0x2257('0x28')]=function(_0xf791e3){var _0x44e073=this;return new Promise(function(_0x51a98b,_0x3e54ae){return db[_0x2257('0x29')]['find']({'raw':_0xf791e3[_0x2257('0x20')]?_0xf791e3[_0x2257('0x20')][_0x2257('0x2a')]===undefined?!![]:![]:!![],'where':_0xf791e3[_0x2257('0x20')]?_0xf791e3['options'][_0x2257('0x21')]||null:null,'attributes':_0xf791e3['options']?_0xf791e3['options'][_0x2257('0x22')]||null:null,'include':_0xf791e3[_0x2257('0x20')]?_0xf791e3[_0x2257('0x20')][_0x2257('0x24')]?_[_0x2257('0x26')](_0xf791e3[_0x2257('0x20')][_0x2257('0x24')],function(_0x283d55){return{'model':db[_0x283d55[_0x2257('0x25')]],'as':_0x283d55['as'],'attributes':_0x283d55[_0x2257('0x22')],'include':_0x283d55[_0x2257('0x24')]?_[_0x2257('0x26')](_0x283d55[_0x2257('0x24')],function(_0x13d623){return{'model':db[_0x13d623['model']],'as':_0x13d623['as'],'attributes':_0x13d623[_0x2257('0x22')],'include':_0x13d623[_0x2257('0x24')]?_[_0x2257('0x26')](_0x13d623[_0x2257('0x24')],function(_0x24edea){return{'model':db[_0x24edea['model']],'as':_0x24edea['as'],'attributes':_0x24edea[_0x2257('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2257('0x14')](function(_0x3e3a45){logger[_0x2257('0x15')](_0x2257('0x28'),_0xf791e3);logger[_0x2257('0x27')](_0x2257('0x28'),_0xf791e3,JSON[_0x2257('0x17')](_0x3e3a45));_0x51a98b(_0x3e3a45);})[_0x2257('0x1d')](function(_0x19bd2b){logger[_0x2257('0x18')](_0x2257('0x28'),_0x19bd2b[_0x2257('0x1b')],_0xf791e3);_0x3e54ae(_0x44e073['error'](0x1f4,_0x19bd2b[_0x2257('0x1b')]));});});}; \ No newline at end of file +var _0x06ef=['catch','GetChatQueue','ChatQueue','options','where','attributes','limit','map','include','model','debug','stringify','ShowChatQueue','find','raw','moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','socket.io-emitter','redis','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x422975,_0x57b9da){var _0x461d1c=function(_0x1fbaab){while(--_0x1fbaab){_0x422975['push'](_0x422975['shift']());}};_0x461d1c(++_0x57b9da);}(_0x06ef,0x185));var _0xf06e=function(_0x465c59,_0x1d6706){_0x465c59=_0x465c59-0x0;var _0x5b4314=_0x06ef[_0x465c59];return _0x5b4314;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf06e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf06e('0x1'));var logger=require(_0xf06e('0x2'))(_0xf06e('0x3'));var config=require('../../config/environment');var jayson=require(_0xf06e('0x4'));var client=jayson[_0xf06e('0x5')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf06e('0x6'))(new Redis(config[_0xf06e('0x7')]));require(_0xf06e('0x8'))[_0xf06e('0x9')](socket);function respondWithRpcPromise(_0xbb0e3c,_0x5e594e,_0x1fe49b){return new BPromise(function(_0x3a33c1,_0x4e3591){return client[_0xf06e('0xa')](_0xbb0e3c,_0x1fe49b)[_0xf06e('0xb')](function(_0x454d77){logger[_0xf06e('0xc')](_0xf06e('0xd'),_0x5e594e,_0xf06e('0xe'));logger['debug'](_0xf06e('0xf'),_0x5e594e,_0xf06e('0xe'),JSON['stringify'](_0x454d77));if(_0x454d77[_0xf06e('0x10')]){if(_0x454d77[_0xf06e('0x10')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5e594e,_0x454d77[_0xf06e('0x10')][_0xf06e('0x11')]);return _0x4e3591(_0x454d77[_0xf06e('0x10')]['message']);}logger[_0xf06e('0x10')](_0xf06e('0xd'),_0x5e594e,_0x454d77[_0xf06e('0x10')][_0xf06e('0x11')]);return _0x3a33c1(_0x454d77[_0xf06e('0x10')][_0xf06e('0x11')]);}else{logger[_0xf06e('0xc')]('ChatQueue,\x20%s,\x20%s',_0x5e594e,_0xf06e('0xe'));_0x3a33c1(_0x454d77[_0xf06e('0x12')][_0xf06e('0x11')]);}})[_0xf06e('0x13')](function(_0x5c1a80){logger['error'](_0xf06e('0xd'),_0x5e594e,_0x5c1a80);_0x4e3591(_0x5c1a80);});});}exports[_0xf06e('0x14')]=function(_0x5d66f9){var _0x5710f1=this;return new Promise(function(_0x5fcefb,_0x211590){return db[_0xf06e('0x15')]['findAll']({'raw':_0x5d66f9[_0xf06e('0x16')]?_0x5d66f9[_0xf06e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5d66f9[_0xf06e('0x16')]?_0x5d66f9[_0xf06e('0x16')][_0xf06e('0x17')]||null:null,'attributes':_0x5d66f9['options']?_0x5d66f9[_0xf06e('0x16')][_0xf06e('0x18')]||null:null,'limit':_0x5d66f9[_0xf06e('0x16')]?_0x5d66f9[_0xf06e('0x16')][_0xf06e('0x19')]||null:null,'include':_0x5d66f9['options']?_0x5d66f9[_0xf06e('0x16')]['include']?_[_0xf06e('0x1a')](_0x5d66f9[_0xf06e('0x16')][_0xf06e('0x1b')],function(_0x322f4c){return{'model':db[_0x322f4c[_0xf06e('0x1c')]],'as':_0x322f4c['as'],'attributes':_0x322f4c[_0xf06e('0x18')],'include':_0x322f4c['include']?_[_0xf06e('0x1a')](_0x322f4c[_0xf06e('0x1b')],function(_0x873aa5){return{'model':db[_0x873aa5[_0xf06e('0x1c')]],'as':_0x873aa5['as'],'attributes':_0x873aa5[_0xf06e('0x18')],'include':_0x873aa5['include']?_[_0xf06e('0x1a')](_0x873aa5[_0xf06e('0x1b')],function(_0x126aa9){return{'model':db[_0x126aa9[_0xf06e('0x1c')]],'as':_0x126aa9['as'],'attributes':_0x126aa9[_0xf06e('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf06e('0xb')](function(_0x4b5185){logger[_0xf06e('0xc')](_0xf06e('0x14'),_0x5d66f9);logger[_0xf06e('0x1d')]('GetChatQueue',_0x5d66f9,JSON[_0xf06e('0x1e')](_0x4b5185));_0x5fcefb(_0x4b5185);})[_0xf06e('0x13')](function(_0xb1fa81){logger[_0xf06e('0x10')](_0xf06e('0x14'),_0xb1fa81[_0xf06e('0x11')],_0x5d66f9);_0x211590(_0x5710f1[_0xf06e('0x10')](0x1f4,_0xb1fa81[_0xf06e('0x11')]));});});};exports[_0xf06e('0x1f')]=function(_0x51a105){var _0x5206b7=this;return new Promise(function(_0x43f22a,_0x4fb3e9){return db['ChatQueue'][_0xf06e('0x20')]({'raw':_0x51a105[_0xf06e('0x16')]?_0x51a105[_0xf06e('0x16')][_0xf06e('0x21')]===undefined?!![]:![]:!![],'where':_0x51a105[_0xf06e('0x16')]?_0x51a105[_0xf06e('0x16')]['where']||null:null,'attributes':_0x51a105[_0xf06e('0x16')]?_0x51a105[_0xf06e('0x16')][_0xf06e('0x18')]||null:null,'include':_0x51a105['options']?_0x51a105[_0xf06e('0x16')][_0xf06e('0x1b')]?_[_0xf06e('0x1a')](_0x51a105[_0xf06e('0x16')][_0xf06e('0x1b')],function(_0x380a8a){return{'model':db[_0x380a8a[_0xf06e('0x1c')]],'as':_0x380a8a['as'],'attributes':_0x380a8a['attributes'],'include':_0x380a8a['include']?_[_0xf06e('0x1a')](_0x380a8a['include'],function(_0x276ed8){return{'model':db[_0x276ed8['model']],'as':_0x276ed8['as'],'attributes':_0x276ed8[_0xf06e('0x18')],'include':_0x276ed8['include']?_[_0xf06e('0x1a')](_0x276ed8[_0xf06e('0x1b')],function(_0x13b50b){return{'model':db[_0x13b50b[_0xf06e('0x1c')]],'as':_0x13b50b['as'],'attributes':_0x13b50b[_0xf06e('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf06e('0xb')](function(_0x523f90){logger[_0xf06e('0xc')](_0xf06e('0x1f'),_0x51a105);logger[_0xf06e('0x1d')](_0xf06e('0x1f'),_0x51a105,JSON[_0xf06e('0x1e')](_0x523f90));_0x43f22a(_0x523f90);})[_0xf06e('0x13')](function(_0x25d9ad){logger[_0xf06e('0x10')](_0xf06e('0x1f'),_0x25d9ad[_0xf06e('0x11')],_0x51a105);_0x4fb3e9(_0x5206b7[_0xf06e('0x10')](0x1f4,_0x25d9ad['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 5e85c95..5859607 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 _0xb332=['emit','register','./chatQueue.events','remove','update'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xb332,0xd9));var _0x2b33=function(_0x2a7c2a,_0x37cc9e){_0x2a7c2a=_0x2a7c2a-0x0;var _0x195732=_0xb332[_0x2a7c2a];return _0x195732;};'use strict';var ChatQueueEvents=require(_0x2b33('0x0'));var events=['save',_0x2b33('0x1'),_0x2b33('0x2')];function createListener(_0x5ee720,_0xf8c6a7){return function(_0x548a70){_0xf8c6a7[_0x2b33('0x3')](_0x5ee720,_0x548a70);};}function removeListener(_0x4c6634,_0x34b111){return function(){ChatQueueEvents['removeListener'](_0x4c6634,_0x34b111);};}exports[_0x2b33('0x4')]=function(_0x22d66){for(var _0x478214=0x0,_0x461d44=events['length'];_0x478214<_0x461d44;_0x478214++){var _0x5ccf2d=events[_0x478214];var _0x4302b7=createListener('chatQueue:'+_0x5ccf2d,_0x22d66);ChatQueueEvents['on'](_0x5ccf2d,_0x4302b7);}}; \ No newline at end of file +var _0x0e85=['update','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x4d5c30,_0x594f37){var _0x5b7f8b=function(_0x4196aa){while(--_0x4196aa){_0x4d5c30['push'](_0x4d5c30['shift']());}};_0x5b7f8b(++_0x594f37);}(_0x0e85,0x7c));var _0x50e8=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x0e85[_0x24f31b];return _0x488401;};'use strict';var ChatQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatQueueEvents['on'](_0x108edc,_0x42665e);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 8b52890..e3e71b7 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x30a411,_0x4d5e23){var _0x484a9e=function(_0x143265){while(--_0x143265){_0x30a411['push'](_0x30a411['shift']());}};_0x484a9e(++_0x4d5e23);}(_0x008c,0x188));var _0xc008=function(_0x5421a4,_0x362d8b){_0x5421a4=_0x5421a4-0x0;var _0x16b546=_0x008c[_0x5421a4];return _0x16b546;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x5fc3[_0x43a5c7];return _0x3b12a2;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 5f36556..326d52e 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 _0x5af4=['STRING','DATE','moment','sequelize','exports'];(function(_0xfa15d9,_0x497666){var _0x47f9ac=function(_0x3cacf4){while(--_0x3cacf4){_0xfa15d9['push'](_0xfa15d9['shift']());}};_0x47f9ac(++_0x497666);}(_0x5af4,0xd9));var _0x45af=function(_0x5df15c,_0xb6ab29){_0x5df15c=_0x5df15c-0x0;var _0x199158=_0x5af4[_0x5df15c];return _0x199158;};'use strict';var moment=require(_0x45af('0x0'));var Sequelize=require(_0x45af('0x1'));module[_0x45af('0x2')]={'uniqueid':{'type':Sequelize[_0x45af('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x45af('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x45af('0x4')]},'acceptAt':{'type':Sequelize[_0x45af('0x4')]},'exitAt':{'type':Sequelize[_0x45af('0x4')]},'reason':{'type':Sequelize[_0x45af('0x3')]}}; \ No newline at end of file +var _0x27d0=['moment','sequelize','STRING','DATE'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x27d0,0x84));var _0x027d=function(_0x49a890,_0x4a88e9){_0x49a890=_0x49a890-0x0;var _0x13b168=_0x27d0[_0x49a890];return _0x13b168;};'use strict';var moment=require(_0x027d('0x0'));var Sequelize=require(_0x027d('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x027d('0x2')]},'joinAt':{'type':Sequelize[_0x027d('0x3')]},'leaveAt':{'type':Sequelize[_0x027d('0x3')]},'acceptAt':{'type':Sequelize[_0x027d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index a447072..e9ab908 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 _0x9541=['nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','show','params','length','include','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x9541,0xb3));var _0x1954=function(_0x2a8c77,_0x397f97){_0x2a8c77=_0x2a8c77-0x0;var _0x2c2071=_0x9541[_0x2a8c77];return _0x2c2071;};'use strict';var emlformat=require(_0x1954('0x0'));var rimraf=require(_0x1954('0x1'));var zipdir=require(_0x1954('0x2'));var jsonpatch=require(_0x1954('0x3'));var rp=require(_0x1954('0x4'));var moment=require(_0x1954('0x5'));var BPromise=require(_0x1954('0x6'));var Mustache=require(_0x1954('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1954('0x8'));var csv=require(_0x1954('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1954('0xa'));var _=require(_0x1954('0xb'));var squel=require(_0x1954('0xc'));var crypto=require(_0x1954('0xd'));var jsforce=require(_0x1954('0xe'));var deskjs=require(_0x1954('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1954('0x10'));var Papa=require(_0x1954('0x11'));var Redis=require(_0x1954('0x12'));var authService=require(_0x1954('0x13'));var qs=require(_0x1954('0x14'));var as=require(_0x1954('0x15'));var hardwareService=require(_0x1954('0x16'));var logger=require(_0x1954('0x17'))('api');var utils=require(_0x1954('0x18'));var config=require(_0x1954('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1954('0x1a'))['db'];function respondWithStatusCode(_0x5e8400,_0x289155){_0x289155=_0x289155||0xcc;return function(_0x4dc96b){if(_0x4dc96b){return _0x5e8400['sendStatus'](_0x289155);}return _0x5e8400['status'](_0x289155)[_0x1954('0x1b')]();};}function respondWithResult(_0x1b33cb,_0x96906a){_0x96906a=_0x96906a||0xc8;return function(_0x520dc7){if(_0x520dc7){return _0x1b33cb[_0x1954('0x1c')](_0x96906a)['json'](_0x520dc7);}};}function respondWithFilteredResult(_0x5daee1,_0xaeb0e3){return function(_0xf43d28){if(_0xf43d28){var _0x36565c=typeof _0xaeb0e3[_0x1954('0x1d')]===_0x1954('0x1e')&&typeof _0xaeb0e3[_0x1954('0x1f')]===_0x1954('0x1e');var _0x46b400=_0xf43d28[_0x1954('0x20')];var _0xb9c2cd=_0x36565c?0x0:_0xaeb0e3[_0x1954('0x1d')];var _0x3da757=_0x36565c?_0xf43d28[_0x1954('0x20')]:_0xaeb0e3[_0x1954('0x1d')]+_0xaeb0e3[_0x1954('0x1f')];var _0x4503d7;if(_0x3da757>=_0x46b400){_0x3da757=_0x46b400;_0x4503d7=0xc8;}else{_0x4503d7=0xce;}_0x5daee1[_0x1954('0x1c')](_0x4503d7);return _0x5daee1[_0x1954('0x21')](_0x1954('0x22'),_0xb9c2cd+'-'+_0x3da757+'/'+_0x46b400)[_0x1954('0x23')](_0xf43d28);}return null;};}function patchUpdates(_0x5e20b8){return function(_0x2105d5){try{jsonpatch[_0x1954('0x24')](_0x2105d5,_0x5e20b8,!![]);}catch(_0x3a84c0){return BPromise[_0x1954('0x25')](_0x3a84c0);}return _0x2105d5[_0x1954('0x26')]();};}function saveUpdates(_0x5e549f,_0x61107d){return function(_0x15dd0b){if(_0x15dd0b){return _0x15dd0b[_0x1954('0x27')](_0x5e549f)[_0x1954('0x28')](function(_0x6d8a2){return _0x6d8a2;});}return null;};}function removeEntity(_0x5a7256,_0x4d1b25){return function(_0x18a883){if(_0x18a883){return _0x18a883[_0x1954('0x29')]()[_0x1954('0x28')](function(){_0x5a7256[_0x1954('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f395,_0x26484f){return function(_0x27dc66){if(!_0x27dc66){_0x21f395[_0x1954('0x2a')](0x194);}return _0x27dc66;};}function handleError(_0x3f06de,_0x1bfa18){_0x1bfa18=_0x1bfa18||0x1f4;return function(_0x46fdc1){logger['error'](_0x46fdc1[_0x1954('0x2b')]);if(_0x46fdc1[_0x1954('0x2c')]){delete _0x46fdc1['name'];}_0x3f06de[_0x1954('0x1c')](_0x1bfa18)[_0x1954('0x2d')](_0x46fdc1);};}exports[_0x1954('0x2e')]=function(_0x3a488b,_0x1d8f32){var _0x251386={},_0x41b143={},_0x41c850={'count':0x0,'rows':[]};var _0xde7055=_[_0x1954('0x2f')](db[_0x1954('0x30')][_0x1954('0x31')],function(_0x40da25){return{'name':_0x40da25[_0x1954('0x32')],'type':_0x40da25[_0x1954('0x33')][_0x1954('0x34')]};});_0x41b143[_0x1954('0x35')]=_[_0x1954('0x2f')](_0xde7055,_0x1954('0x2c'));_0x41b143[_0x1954('0x36')]=_[_0x1954('0x37')](_0x3a488b[_0x1954('0x36')]);_0x41b143[_0x1954('0x38')]=_[_0x1954('0x39')](_0x41b143['model'],_0x41b143['query']);_0x251386[_0x1954('0x3a')]=_['intersection'](_0x41b143[_0x1954('0x35')],qs[_0x1954('0x3b')](_0x3a488b['query'][_0x1954('0x3b')]));_0x251386[_0x1954('0x3a')]=_0x251386['attributes']['length']?_0x251386[_0x1954('0x3a')]:_0x41b143[_0x1954('0x35')];if(!_0x3a488b[_0x1954('0x36')][_0x1954('0x3c')](_0x1954('0x3d'))){_0x251386[_0x1954('0x1f')]=qs[_0x1954('0x1f')](_0x3a488b['query']['limit']);_0x251386[_0x1954('0x1d')]=qs[_0x1954('0x1d')](_0x3a488b[_0x1954('0x36')][_0x1954('0x1d')]);}_0x251386[_0x1954('0x3e')]=qs[_0x1954('0x3f')](_0x3a488b['query'][_0x1954('0x3f')]);_0x251386[_0x1954('0x40')]=qs['filters'](_[_0x1954('0x41')](_0x3a488b[_0x1954('0x36')],_0x41b143['filters']),_0xde7055);if(_0x3a488b['query'][_0x1954('0x42')]){_0x251386[_0x1954('0x40')]=_['merge'](_0x251386[_0x1954('0x40')],{'$or':_[_0x1954('0x2f')](_0xde7055,function(_0x13725c){if(_0x13725c[_0x1954('0x33')]!=='VIRTUAL'){var _0x339b28={};_0x339b28[_0x13725c['name']]={'$like':'%'+_0x3a488b[_0x1954('0x36')][_0x1954('0x42')]+'%'};return _0x339b28;}})});}_0x251386=_[_0x1954('0x43')]({},_0x251386,_0x3a488b['options']);var _0x1c2f3={'where':_0x251386[_0x1954('0x40')]};return db[_0x1954('0x30')][_0x1954('0x20')](_0x1c2f3)[_0x1954('0x28')](function(_0x517492){_0x41c850[_0x1954('0x20')]=_0x517492;if(_0x3a488b['query'][_0x1954('0x44')]){_0x251386['include']=[{'all':!![]}];}return db[_0x1954('0x30')][_0x1954('0x45')](_0x251386);})[_0x1954('0x28')](function(_0x4334f9){_0x41c850['rows']=_0x4334f9;return _0x41c850;})[_0x1954('0x28')](respondWithFilteredResult(_0x1d8f32,_0x251386))['catch'](handleError(_0x1d8f32,null));};exports[_0x1954('0x46')]=function(_0x1435d6,_0x59c4cb){var _0x1dede8={'raw':!![],'where':{'id':_0x1435d6[_0x1954('0x47')]['id']}},_0x45f70e={};_0x45f70e[_0x1954('0x35')]=_[_0x1954('0x37')](db[_0x1954('0x30')][_0x1954('0x31')]);_0x45f70e[_0x1954('0x36')]=_[_0x1954('0x37')](_0x1435d6['query']);_0x45f70e['filters']=_['intersection'](_0x45f70e[_0x1954('0x35')],_0x45f70e['query']);_0x1dede8[_0x1954('0x3a')]=_[_0x1954('0x39')](_0x45f70e[_0x1954('0x35')],qs[_0x1954('0x3b')](_0x1435d6[_0x1954('0x36')][_0x1954('0x3b')]));_0x1dede8[_0x1954('0x3a')]=_0x1dede8[_0x1954('0x3a')][_0x1954('0x48')]?_0x1dede8['attributes']:_0x45f70e['model'];if(_0x1435d6[_0x1954('0x36')]['includeAll']){_0x1dede8[_0x1954('0x49')]=[{'all':!![]}];}_0x1dede8=_['merge']({},_0x1dede8,_0x1435d6[_0x1954('0x4a')]);return db[_0x1954('0x30')][_0x1954('0x4b')](_0x1dede8)[_0x1954('0x28')](handleEntityNotFound(_0x59c4cb,null))[_0x1954('0x28')](respondWithResult(_0x59c4cb,null))[_0x1954('0x4c')](handleError(_0x59c4cb,null));};exports[_0x1954('0x4d')]=function(_0x15ff45,_0x15295e){return db[_0x1954('0x30')]['create'](_0x15ff45[_0x1954('0x4e')],{})[_0x1954('0x28')](respondWithResult(_0x15295e,0xc9))[_0x1954('0x4c')](handleError(_0x15295e,null));};exports[_0x1954('0x27')]=function(_0x510b62,_0x1cd2dd){if(_0x510b62[_0x1954('0x4e')]['id']){delete _0x510b62['body']['id'];}return db[_0x1954('0x30')]['find']({'where':{'id':_0x510b62[_0x1954('0x47')]['id']}})[_0x1954('0x28')](handleEntityNotFound(_0x1cd2dd,null))[_0x1954('0x28')](saveUpdates(_0x510b62[_0x1954('0x4e')],null))[_0x1954('0x28')](respondWithResult(_0x1cd2dd,null))[_0x1954('0x4c')](handleError(_0x1cd2dd,null));};exports[_0x1954('0x29')]=function(_0x49003e,_0x1b4557){return db['ChatQueueReport'][_0x1954('0x4b')]({'where':{'id':_0x49003e[_0x1954('0x47')]['id']}})[_0x1954('0x28')](handleEntityNotFound(_0x1b4557,null))['then'](removeEntity(_0x1b4557,null))[_0x1954('0x4c')](handleError(_0x1b4557,null));};exports[_0x1954('0x4f')]=function(_0x37eec3,_0x359692){return db[_0x1954('0x30')]['describe']()[_0x1954('0x28')](respondWithResult(_0x359692,null))[_0x1954('0x4c')](handleError(_0x359692,null));}; \ No newline at end of file +var _0xa3fe=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe'];(function(_0x1efdd9,_0x48abbe){var _0x2aa04c=function(_0x23974e){while(--_0x23974e){_0x1efdd9['push'](_0x1efdd9['shift']());}};_0x2aa04c(++_0x48abbe);}(_0xa3fe,0xd8));var _0xea3f=function(_0x3a0ad9,_0x106f96){_0x3a0ad9=_0x3a0ad9-0x0;var _0x37ce43=_0xa3fe[_0x3a0ad9];return _0x37ce43;};'use strict';var emlformat=require(_0xea3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea3f('0x1'));var jsonpatch=require(_0xea3f('0x2'));var rp=require('request-promise');var moment=require(_0xea3f('0x3'));var BPromise=require(_0xea3f('0x4'));var Mustache=require(_0xea3f('0x5'));var util=require('util');var path=require(_0xea3f('0x6'));var sox=require('sox');var csv=require(_0xea3f('0x7'));var ejs=require(_0xea3f('0x8'));var fs=require('fs');var fs_extra=require(_0xea3f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xea3f('0xa'));var jsforce=require(_0xea3f('0xb'));var deskjs=require(_0xea3f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea3f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea3f('0xe'));var as=require(_0xea3f('0xf'));var hardwareService=require(_0xea3f('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xea3f('0x11'));var licenseUtil=require(_0xea3f('0x12'));var db=require(_0xea3f('0x13'))['db'];function respondWithStatusCode(_0x363046,_0x4a36da){_0x4a36da=_0x4a36da||0xcc;return function(_0x5afd23){if(_0x5afd23){return _0x363046['sendStatus'](_0x4a36da);}return _0x363046[_0xea3f('0x14')](_0x4a36da)[_0xea3f('0x15')]();};}function respondWithResult(_0x5b246b,_0x260985){_0x260985=_0x260985||0xc8;return function(_0x393dac){if(_0x393dac){return _0x5b246b['status'](_0x260985)[_0xea3f('0x16')](_0x393dac);}};}function respondWithFilteredResult(_0x307409,_0x153f0e){return function(_0x4becc3){if(_0x4becc3){var _0x32c2f=typeof _0x153f0e[_0xea3f('0x17')]===_0xea3f('0x18')&&typeof _0x153f0e[_0xea3f('0x19')]===_0xea3f('0x18');var _0x403fd2=_0x4becc3[_0xea3f('0x1a')];var _0x31b8ca=_0x32c2f?0x0:_0x153f0e[_0xea3f('0x17')];var _0x116d13=_0x32c2f?_0x4becc3[_0xea3f('0x1a')]:_0x153f0e[_0xea3f('0x17')]+_0x153f0e[_0xea3f('0x19')];var _0x35153d;if(_0x116d13>=_0x403fd2){_0x116d13=_0x403fd2;_0x35153d=0xc8;}else{_0x35153d=0xce;}_0x307409['status'](_0x35153d);return _0x307409[_0xea3f('0x1b')](_0xea3f('0x1c'),_0x31b8ca+'-'+_0x116d13+'/'+_0x403fd2)[_0xea3f('0x16')](_0x4becc3);}return null;};}function patchUpdates(_0xe50958){return function(_0x11f66c){try{jsonpatch['apply'](_0x11f66c,_0xe50958,!![]);}catch(_0x4af6e4){return BPromise[_0xea3f('0x1d')](_0x4af6e4);}return _0x11f66c[_0xea3f('0x1e')]();};}function saveUpdates(_0x4c6d50,_0x284f3b){return function(_0x1cc3c8){if(_0x1cc3c8){return _0x1cc3c8[_0xea3f('0x1f')](_0x4c6d50)[_0xea3f('0x20')](function(_0x5f452b){return _0x5f452b;});}return null;};}function removeEntity(_0x5bd381,_0x5c2eb0){return function(_0x2f8bdc){if(_0x2f8bdc){return _0x2f8bdc[_0xea3f('0x21')]()[_0xea3f('0x20')](function(){_0x5bd381[_0xea3f('0x14')](0xcc)[_0xea3f('0x15')]();});}};}function handleEntityNotFound(_0x11df76,_0x3f07d5){return function(_0x55a32d){if(!_0x55a32d){_0x11df76[_0xea3f('0x22')](0x194);}return _0x55a32d;};}function handleError(_0x4a111b,_0x29de3c){_0x29de3c=_0x29de3c||0x1f4;return function(_0x22cd02){logger[_0xea3f('0x23')](_0x22cd02[_0xea3f('0x24')]);if(_0x22cd02[_0xea3f('0x25')]){delete _0x22cd02['name'];}_0x4a111b[_0xea3f('0x14')](_0x29de3c)['send'](_0x22cd02);};}exports[_0xea3f('0x26')]=function(_0x9413e5,_0x20e014){var _0x4cd4e9={},_0x437070={},_0x10c397={'count':0x0,'rows':[]};var _0x59ec90=_[_0xea3f('0x27')](db[_0xea3f('0x28')][_0xea3f('0x29')],function(_0x391828){return{'name':_0x391828[_0xea3f('0x2a')],'type':_0x391828[_0xea3f('0x2b')][_0xea3f('0x2c')]};});_0x437070[_0xea3f('0x2d')]=_[_0xea3f('0x27')](_0x59ec90,_0xea3f('0x25'));_0x437070[_0xea3f('0x2e')]=_[_0xea3f('0x2f')](_0x9413e5[_0xea3f('0x2e')]);_0x437070[_0xea3f('0x30')]=_[_0xea3f('0x31')](_0x437070[_0xea3f('0x2d')],_0x437070[_0xea3f('0x2e')]);_0x4cd4e9[_0xea3f('0x32')]=_[_0xea3f('0x31')](_0x437070['model'],qs[_0xea3f('0x33')](_0x9413e5[_0xea3f('0x2e')][_0xea3f('0x33')]));_0x4cd4e9[_0xea3f('0x32')]=_0x4cd4e9[_0xea3f('0x32')][_0xea3f('0x34')]?_0x4cd4e9[_0xea3f('0x32')]:_0x437070[_0xea3f('0x2d')];if(!_0x9413e5[_0xea3f('0x2e')]['hasOwnProperty'](_0xea3f('0x35'))){_0x4cd4e9[_0xea3f('0x19')]=qs[_0xea3f('0x19')](_0x9413e5[_0xea3f('0x2e')][_0xea3f('0x19')]);_0x4cd4e9['offset']=qs['offset'](_0x9413e5[_0xea3f('0x2e')]['offset']);}_0x4cd4e9[_0xea3f('0x36')]=qs[_0xea3f('0x37')](_0x9413e5[_0xea3f('0x2e')][_0xea3f('0x37')]);_0x4cd4e9[_0xea3f('0x38')]=qs[_0xea3f('0x30')](_['pick'](_0x9413e5[_0xea3f('0x2e')],_0x437070['filters']),_0x59ec90);if(_0x9413e5['query'][_0xea3f('0x39')]){_0x4cd4e9[_0xea3f('0x38')]=_[_0xea3f('0x3a')](_0x4cd4e9[_0xea3f('0x38')],{'$or':_[_0xea3f('0x27')](_0x59ec90,function(_0x352402){if(_0x352402[_0xea3f('0x2b')]!==_0xea3f('0x3b')){var _0x365033={};_0x365033[_0x352402[_0xea3f('0x25')]]={'$like':'%'+_0x9413e5[_0xea3f('0x2e')][_0xea3f('0x39')]+'%'};return _0x365033;}})});}_0x4cd4e9=_[_0xea3f('0x3a')]({},_0x4cd4e9,_0x9413e5['options']);var _0xb7d4e5={'where':_0x4cd4e9['where']};return db[_0xea3f('0x28')][_0xea3f('0x1a')](_0xb7d4e5)[_0xea3f('0x20')](function(_0xea73b8){_0x10c397[_0xea3f('0x1a')]=_0xea73b8;if(_0x9413e5['query'][_0xea3f('0x3c')]){_0x4cd4e9['include']=[{'all':!![]}];}return db[_0xea3f('0x28')][_0xea3f('0x3d')](_0x4cd4e9);})[_0xea3f('0x20')](function(_0x26b06a){_0x10c397[_0xea3f('0x3e')]=_0x26b06a;return _0x10c397;})[_0xea3f('0x20')](respondWithFilteredResult(_0x20e014,_0x4cd4e9))[_0xea3f('0x3f')](handleError(_0x20e014,null));};exports[_0xea3f('0x40')]=function(_0x2a61e4,_0x2c018c){var _0x411e4a={'raw':!![],'where':{'id':_0x2a61e4[_0xea3f('0x41')]['id']}},_0x410250={};_0x410250[_0xea3f('0x2d')]=_[_0xea3f('0x2f')](db['ChatQueueReport'][_0xea3f('0x29')]);_0x410250['query']=_[_0xea3f('0x2f')](_0x2a61e4['query']);_0x410250[_0xea3f('0x30')]=_[_0xea3f('0x31')](_0x410250['model'],_0x410250[_0xea3f('0x2e')]);_0x411e4a[_0xea3f('0x32')]=_['intersection'](_0x410250[_0xea3f('0x2d')],qs[_0xea3f('0x33')](_0x2a61e4[_0xea3f('0x2e')]['fields']));_0x411e4a[_0xea3f('0x32')]=_0x411e4a[_0xea3f('0x32')][_0xea3f('0x34')]?_0x411e4a[_0xea3f('0x32')]:_0x410250[_0xea3f('0x2d')];if(_0x2a61e4[_0xea3f('0x2e')][_0xea3f('0x3c')]){_0x411e4a[_0xea3f('0x42')]=[{'all':!![]}];}_0x411e4a=_[_0xea3f('0x3a')]({},_0x411e4a,_0x2a61e4[_0xea3f('0x43')]);return db[_0xea3f('0x28')][_0xea3f('0x44')](_0x411e4a)[_0xea3f('0x20')](handleEntityNotFound(_0x2c018c,null))[_0xea3f('0x20')](respondWithResult(_0x2c018c,null))['catch'](handleError(_0x2c018c,null));};exports['create']=function(_0x7f50cd,_0x521d33){return db[_0xea3f('0x28')][_0xea3f('0x45')](_0x7f50cd['body'],{})['then'](respondWithResult(_0x521d33,0xc9))['catch'](handleError(_0x521d33,null));};exports['update']=function(_0xcad7cb,_0x302fc0){if(_0xcad7cb[_0xea3f('0x46')]['id']){delete _0xcad7cb[_0xea3f('0x46')]['id'];}return db[_0xea3f('0x28')][_0xea3f('0x44')]({'where':{'id':_0xcad7cb['params']['id']}})[_0xea3f('0x20')](handleEntityNotFound(_0x302fc0,null))['then'](saveUpdates(_0xcad7cb[_0xea3f('0x46')],null))[_0xea3f('0x20')](respondWithResult(_0x302fc0,null))['catch'](handleError(_0x302fc0,null));};exports[_0xea3f('0x21')]=function(_0x3d261c,_0x5b0ca1){return db[_0xea3f('0x28')][_0xea3f('0x44')]({'where':{'id':_0x3d261c[_0xea3f('0x41')]['id']}})[_0xea3f('0x20')](handleEntityNotFound(_0x5b0ca1,null))[_0xea3f('0x20')](removeEntity(_0x5b0ca1,null))[_0xea3f('0x3f')](handleError(_0x5b0ca1,null));};exports[_0xea3f('0x47')]=function(_0x180620,_0x40ae4b){return db[_0xea3f('0x28')][_0xea3f('0x47')]()[_0xea3f('0x20')](respondWithResult(_0x40ae4b,null))[_0xea3f('0x3f')](handleError(_0x40ae4b,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 610a827..835e75f 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0xe36749,_0x2a45c8){var _0x5d86b7=function(_0x1219e5){while(--_0x1219e5){_0xe36749['push'](_0xe36749['shift']());}};_0x5d86b7(++_0x2a45c8);}(_0xe706,0xa3));var _0x6e70=function(_0x4ac8ef,_0x5c2c6e){_0x4ac8ef=_0x4ac8ef-0x0;var _0x3a9239=_0xe706[_0x4ac8ef];return _0x3a9239;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2ea20d,_0x5e8e3c){var _0x3ba66a=function(_0x164ca6){while(--_0x164ca6){_0x2ea20d['push'](_0x2ea20d['shift']());}};_0x3ba66a(++_0x5e8e3c);}(_0xb10b,0x12a));var _0xbb10=function(_0x17eec6,_0x54a955){_0x17eec6=_0x17eec6-0x0;var _0x1e4d32=_0xb10b[_0x17eec6];return _0x1e4d32;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index be4379c..b970d1f 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 _0x1ae7=['UpdateChatQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','request\x20sent','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','update','where','attributes','limit'];(function(_0x4d1d93,_0x2450a7){var _0x20d058=function(_0x459f6f){while(--_0x459f6f){_0x4d1d93['push'](_0x4d1d93['shift']());}};_0x20d058(++_0x2450a7);}(_0x1ae7,0x85));var _0x71ae=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x1ae7[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x71ae('0x0'));var util=require(_0x71ae('0x1'));var moment=require('moment');var BPromise=require(_0x71ae('0x2'));var rs=require(_0x71ae('0x3'));var fs=require('fs');var Redis=require(_0x71ae('0x4'));var db=require(_0x71ae('0x5'))['db'];var utils=require(_0x71ae('0x6'));var logger=require(_0x71ae('0x7'))(_0x71ae('0x8'));var config=require(_0x71ae('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x71ae('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302887,_0xb41206,_0x123255){return new BPromise(function(_0x346a56,_0x506f12){return client['request'](_0x302887,_0x123255)['then'](function(_0x32794e){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0xb41206,'request\x20sent');logger[_0x71ae('0xb')](_0x71ae('0xc'),_0xb41206,'request\x20sent',JSON[_0x71ae('0xd')](_0x32794e));if(_0x32794e['error']){if(_0x32794e[_0x71ae('0xe')][_0x71ae('0xf')]===0x1f4){logger[_0x71ae('0xe')](_0x71ae('0x10'),_0xb41206,_0x32794e[_0x71ae('0xe')][_0x71ae('0x11')]);return _0x506f12(_0x32794e[_0x71ae('0xe')][_0x71ae('0x11')]);}logger['error'](_0x71ae('0x10'),_0xb41206,_0x32794e[_0x71ae('0xe')]['message']);return _0x346a56(_0x32794e[_0x71ae('0xe')][_0x71ae('0x11')]);}else{logger[_0x71ae('0x12')](_0x71ae('0x10'),_0xb41206,_0x71ae('0x13'));_0x346a56(_0x32794e['result'][_0x71ae('0x11')]);}})[_0x71ae('0x14')](function(_0x316f35){logger[_0x71ae('0xe')](_0x71ae('0x10'),_0xb41206,_0x316f35);_0x506f12(_0x316f35);});});}exports[_0x71ae('0x15')]=function(_0x5aa53b){var _0x20613f=this;return new Promise(function(_0x9f3f2a,_0x38adbc){return db[_0x71ae('0x16')][_0x71ae('0x17')](_0x5aa53b[_0x71ae('0x18')],{'raw':_0x5aa53b[_0x71ae('0x19')]?_0x5aa53b['options'][_0x71ae('0x1a')]===undefined?!![]:![]:!![]})[_0x71ae('0x1b')](function(_0x45dcb5){logger[_0x71ae('0x12')](_0x71ae('0x15'),_0x5aa53b);logger[_0x71ae('0xb')](_0x71ae('0x15'),_0x5aa53b,JSON[_0x71ae('0xd')](_0x45dcb5));_0x9f3f2a(_0x45dcb5);})[_0x71ae('0x14')](function(_0x551c12){logger[_0x71ae('0xe')](_0x71ae('0x15'),_0x551c12['message'],_0x5aa53b);_0x38adbc(_0x20613f[_0x71ae('0xe')](0x1f4,_0x551c12[_0x71ae('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x294613){var _0x3cfdeb=this;return new Promise(function(_0x50a172,_0x148b62){return db['ChatQueueReport'][_0x71ae('0x1c')](_0x294613[_0x71ae('0x18')],{'raw':_0x294613[_0x71ae('0x19')]?_0x294613[_0x71ae('0x19')][_0x71ae('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x294613[_0x71ae('0x19')]?_0x294613[_0x71ae('0x19')][_0x71ae('0x1d')]||null:null,'attributes':_0x294613[_0x71ae('0x19')]?_0x294613['options'][_0x71ae('0x1e')]||null:null,'limit':_0x294613[_0x71ae('0x19')]?_0x294613[_0x71ae('0x19')][_0x71ae('0x1f')]||null:null})[_0x71ae('0x1b')](function(_0x25cab5){logger[_0x71ae('0x12')](_0x71ae('0x20'),_0x294613);logger['debug'](_0x71ae('0x20'),_0x294613,JSON[_0x71ae('0xd')](_0x25cab5));_0x50a172(_0x25cab5);})['catch'](function(_0x27b896){logger['error'](_0x71ae('0x20'),_0x27b896[_0x71ae('0x11')],_0x294613);_0x148b62(_0x3cfdeb[_0x71ae('0xe')](0x1f4,_0x27b896[_0x71ae('0x11')]));});});}; \ No newline at end of file +var _0xfd46=['request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','body','options','UpdateChatQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x2b469e,_0x587bc0){var _0x433ed2=function(_0xf3386e){while(--_0xf3386e){_0x2b469e['push'](_0x2b469e['shift']());}};_0x433ed2(++_0x587bc0);}(_0xfd46,0x176));var _0x6fd4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfd46[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x6fd4('0x0'));var util=require('util');var moment=require(_0x6fd4('0x1'));var BPromise=require(_0x6fd4('0x2'));var rs=require(_0x6fd4('0x3'));var fs=require('fs');var Redis=require(_0x6fd4('0x4'));var db=require(_0x6fd4('0x5'))['db'];var utils=require(_0x6fd4('0x6'));var logger=require(_0x6fd4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6fd4('0x8')][_0x6fd4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ae977,_0x51cb27,_0x3a9b0c){return new BPromise(function(_0x5f3c84,_0x114bf1){return client[_0x6fd4('0xa')](_0x2ae977,_0x3a9b0c)[_0x6fd4('0xb')](function(_0x5d61b1){logger[_0x6fd4('0xc')](_0x6fd4('0xd'),_0x51cb27,_0x6fd4('0xe'));logger[_0x6fd4('0xf')](_0x6fd4('0x10'),_0x51cb27,'request\x20sent',JSON[_0x6fd4('0x11')](_0x5d61b1));if(_0x5d61b1[_0x6fd4('0x12')]){if(_0x5d61b1['error'][_0x6fd4('0x13')]===0x1f4){logger[_0x6fd4('0x12')](_0x6fd4('0xd'),_0x51cb27,_0x5d61b1[_0x6fd4('0x12')][_0x6fd4('0x14')]);return _0x114bf1(_0x5d61b1[_0x6fd4('0x12')][_0x6fd4('0x14')]);}logger[_0x6fd4('0x12')](_0x6fd4('0xd'),_0x51cb27,_0x5d61b1[_0x6fd4('0x12')][_0x6fd4('0x14')]);return _0x5f3c84(_0x5d61b1['error']['message']);}else{logger[_0x6fd4('0xc')](_0x6fd4('0xd'),_0x51cb27,_0x6fd4('0xe'));_0x5f3c84(_0x5d61b1[_0x6fd4('0x15')][_0x6fd4('0x14')]);}})[_0x6fd4('0x16')](function(_0x18a868){logger[_0x6fd4('0x12')](_0x6fd4('0xd'),_0x51cb27,_0x18a868);_0x114bf1(_0x18a868);});});}exports[_0x6fd4('0x17')]=function(_0x4d77d3){var _0x2d9484=this;return new Promise(function(_0x2c956c,_0x4832bc){return db['ChatQueueReport']['create'](_0x4d77d3[_0x6fd4('0x18')],{'raw':_0x4d77d3[_0x6fd4('0x19')]?_0x4d77d3[_0x6fd4('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3d2afc){logger['info'](_0x6fd4('0x17'),_0x4d77d3);logger['debug'](_0x6fd4('0x17'),_0x4d77d3,JSON['stringify'](_0x3d2afc));_0x2c956c(_0x3d2afc);})[_0x6fd4('0x16')](function(_0x202410){logger[_0x6fd4('0x12')](_0x6fd4('0x17'),_0x202410[_0x6fd4('0x14')],_0x4d77d3);_0x4832bc(_0x2d9484['error'](0x1f4,_0x202410['message']));});});};exports[_0x6fd4('0x1a')]=function(_0x5b91f9){var _0x590d73=this;return new Promise(function(_0x53dfe0,_0x40c7a3){return db['ChatQueueReport'][_0x6fd4('0x1b')](_0x5b91f9[_0x6fd4('0x18')],{'raw':_0x5b91f9[_0x6fd4('0x19')]?_0x5b91f9[_0x6fd4('0x19')][_0x6fd4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b91f9[_0x6fd4('0x19')]?_0x5b91f9[_0x6fd4('0x19')][_0x6fd4('0x1d')]||null:null,'attributes':_0x5b91f9[_0x6fd4('0x19')]?_0x5b91f9[_0x6fd4('0x19')][_0x6fd4('0x1e')]||null:null,'limit':_0x5b91f9[_0x6fd4('0x19')]?_0x5b91f9['options'][_0x6fd4('0x1f')]||null:null})['then'](function(_0x26fb48){logger[_0x6fd4('0xc')]('UpdateChatQueueReport',_0x5b91f9);logger[_0x6fd4('0xf')](_0x6fd4('0x1a'),_0x5b91f9,JSON[_0x6fd4('0x11')](_0x26fb48));_0x53dfe0(_0x26fb48);})[_0x6fd4('0x16')](function(_0x3cf724){logger['error'](_0x6fd4('0x1a'),_0x3cf724['message'],_0x5b91f9);_0x40c7a3(_0x590d73['error'](0x1f4,_0x3cf724[_0x6fd4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5d1b57c..49f8e4a 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 _0xf29d=['/:id','post','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x48b5d2,_0x105b3f){var _0x49bb6a=function(_0x134a75){while(--_0x134a75){_0x48b5d2['push'](_0x48b5d2['shift']());}};_0x49bb6a(++_0x105b3f);}(_0xf29d,0x1bc));var _0xdf29=function(_0x3e23c1,_0xb0c332){_0x3e23c1=_0x3e23c1-0x0;var _0x393fea=_0xf29d[_0x3e23c1];return _0x393fea;};'use strict';var multer=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var path=require(_0xdf29('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf29('0x3'));var router=express['Router']();var fs_extra=require(_0xdf29('0x4'));var auth=require(_0xdf29('0x5'));var interaction=require(_0xdf29('0x6'));var config=require(_0xdf29('0x7'));var controller=require(_0xdf29('0x8'));router[_0xdf29('0x9')]('/',auth[_0xdf29('0xa')](),controller['index']);router[_0xdf29('0x9')](_0xdf29('0xb'),auth[_0xdf29('0xa')](),controller['describe']);router[_0xdf29('0x9')](_0xdf29('0xc'),auth[_0xdf29('0xa')](),controller['show']);router[_0xdf29('0xd')]('/',auth[_0xdf29('0xa')](),controller[_0xdf29('0xe')]);router[_0xdf29('0xf')](_0xdf29('0xc'),auth[_0xdf29('0xa')](),controller[_0xdf29('0x10')]);router[_0xdf29('0x11')](_0xdf29('0xc'),auth[_0xdf29('0xa')](),controller[_0xdf29('0x12')]);module['exports']=router; \ No newline at end of file +var _0x63b0=['describe','/:id','show','post','create','put','delete','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x40a90d,_0x5a8c17){var _0x2957f8=function(_0x2053b5){while(--_0x2053b5){_0x40a90d['push'](_0x40a90d['shift']());}};_0x2957f8(++_0x5a8c17);}(_0x63b0,0x7f));var _0x063b=function(_0x12a408,_0x2ff898){_0x12a408=_0x12a408-0x0;var _0xe04c9d=_0x63b0[_0x12a408];return _0xe04c9d;};'use strict';var multer=require('multer');var util=require(_0x063b('0x0'));var path=require(_0x063b('0x1'));var timeout=require('connect-timeout');var express=require(_0x063b('0x2'));var router=express['Router']();var fs_extra=require(_0x063b('0x3'));var auth=require(_0x063b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x063b('0x5'));var controller=require(_0x063b('0x6'));router[_0x063b('0x7')]('/',auth[_0x063b('0x8')](),controller['index']);router[_0x063b('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x063b('0x9')]);router['get'](_0x063b('0xa'),auth[_0x063b('0x8')](),controller[_0x063b('0xb')]);router[_0x063b('0xc')]('/',auth['isAuthenticated'](),controller[_0x063b('0xd')]);router[_0x063b('0xe')](_0x063b('0xa'),auth[_0x063b('0x8')](),controller['update']);router[_0x063b('0xf')]('/:id',auth[_0x063b('0x8')](),controller['destroy']);module[_0x063b('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d6b4c4f..dd57afd 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x40cc74,_0x37e2ce){var _0x50610e=function(_0x3a0f22){while(--_0x3a0f22){_0x40cc74['push'](_0x40cc74['shift']());}};_0x50610e(++_0x37e2ce);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x2d5cb7,_0x4535b0){var _0x374ce6=function(_0x3f7fec){while(--_0x3f7fec){_0x2d5cb7['push'](_0x2d5cb7['shift']());}};_0x374ce6(++_0x4535b0);}(_0xe706,0xa3));var _0x6e70=function(_0x519de3,_0xe7c04e){_0x519de3=_0x519de3-0x0;var _0x3e21d9=_0xe706[_0x519de3];return _0x3e21d9;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 409cc70..d56ba62 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 _0x4141=['findAll','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick','filter','where','VIRTUAL','merge','options','include'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x4141,0x136));var _0x1414=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4141[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x1414('0x0'));var rimraf=require(_0x1414('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1414('0x2'));var rp=require(_0x1414('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1414('0x4'));var util=require(_0x1414('0x5'));var path=require(_0x1414('0x6'));var sox=require(_0x1414('0x7'));var csv=require('to-csv');var ejs=require(_0x1414('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1414('0x9'));var squel=require(_0x1414('0xa'));var crypto=require(_0x1414('0xb'));var jsforce=require(_0x1414('0xc'));var deskjs=require(_0x1414('0xd'));var toCsv=require(_0x1414('0xe'));var querystring=require(_0x1414('0xf'));var Papa=require('papaparse');var Redis=require(_0x1414('0x10'));var authService=require(_0x1414('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1414('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1414('0x13'))(_0x1414('0x14'));var utils=require(_0x1414('0x15'));var config=require(_0x1414('0x16'));var licenseUtil=require(_0x1414('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22b82d,_0x240326){_0x240326=_0x240326||0xcc;return function(_0x4db8cb){if(_0x4db8cb){return _0x22b82d[_0x1414('0x18')](_0x240326);}return _0x22b82d[_0x1414('0x19')](_0x240326)['end']();};}function respondWithResult(_0xb0e5d7,_0x2917b2){_0x2917b2=_0x2917b2||0xc8;return function(_0x2f741e){if(_0x2f741e){return _0xb0e5d7[_0x1414('0x19')](_0x2917b2)['json'](_0x2f741e);}};}function respondWithFilteredResult(_0x11962d,_0x579543){return function(_0x247bb3){if(_0x247bb3){var _0x4158f4=typeof _0x579543['offset']===_0x1414('0x1a')&&typeof _0x579543['limit']==='undefined';var _0x2ce149=_0x247bb3['count'];var _0x12bfa4=_0x4158f4?0x0:_0x579543[_0x1414('0x1b')];var _0x47b6a7=_0x4158f4?_0x247bb3[_0x1414('0x1c')]:_0x579543['offset']+_0x579543[_0x1414('0x1d')];var _0x24488c;if(_0x47b6a7>=_0x2ce149){_0x47b6a7=_0x2ce149;_0x24488c=0xc8;}else{_0x24488c=0xce;}_0x11962d[_0x1414('0x19')](_0x24488c);return _0x11962d[_0x1414('0x1e')](_0x1414('0x1f'),_0x12bfa4+'-'+_0x47b6a7+'/'+_0x2ce149)[_0x1414('0x20')](_0x247bb3);}return null;};}function patchUpdates(_0x575fc7){return function(_0x12d63b){try{jsonpatch[_0x1414('0x21')](_0x12d63b,_0x575fc7,!![]);}catch(_0x2dfdaf){return BPromise[_0x1414('0x22')](_0x2dfdaf);}return _0x12d63b[_0x1414('0x23')]();};}function saveUpdates(_0x512118,_0x599234){return function(_0x314734){if(_0x314734){return _0x314734[_0x1414('0x24')](_0x512118)['then'](function(_0x3cec92){return _0x3cec92;});}return null;};}function removeEntity(_0x5668d2,_0x50e22f){return function(_0x1a2757){if(_0x1a2757){return _0x1a2757[_0x1414('0x25')]()[_0x1414('0x26')](function(){_0x5668d2[_0x1414('0x19')](0xcc)[_0x1414('0x27')]();});}};}function handleEntityNotFound(_0x27a072,_0x1fe11f){return function(_0x23bf5f){if(!_0x23bf5f){_0x27a072['sendStatus'](0x194);}return _0x23bf5f;};}function handleError(_0x81028e,_0x46dc51){_0x46dc51=_0x46dc51||0x1f4;return function(_0x54300c){logger['error'](_0x54300c[_0x1414('0x28')]);if(_0x54300c[_0x1414('0x29')]){delete _0x54300c[_0x1414('0x29')];}_0x81028e[_0x1414('0x19')](_0x46dc51)['send'](_0x54300c);};}exports[_0x1414('0x2a')]=function(_0x1c1594,_0x1c18f6){var _0x1e1f42={},_0x19813a={},_0x5c59c9={'count':0x0,'rows':[]};var _0x4ca591=_[_0x1414('0x2b')](db[_0x1414('0x2c')][_0x1414('0x2d')],function(_0x2261c9){return{'name':_0x2261c9[_0x1414('0x2e')],'type':_0x2261c9[_0x1414('0x2f')]['key']};});_0x19813a[_0x1414('0x30')]=_[_0x1414('0x2b')](_0x4ca591,_0x1414('0x29'));_0x19813a['query']=_[_0x1414('0x31')](_0x1c1594[_0x1414('0x32')]);_0x19813a[_0x1414('0x33')]=_['intersection'](_0x19813a['model'],_0x19813a[_0x1414('0x32')]);_0x1e1f42['attributes']=_[_0x1414('0x34')](_0x19813a[_0x1414('0x30')],qs[_0x1414('0x35')](_0x1c1594[_0x1414('0x32')][_0x1414('0x35')]));_0x1e1f42['attributes']=_0x1e1f42[_0x1414('0x36')][_0x1414('0x37')]?_0x1e1f42[_0x1414('0x36')]:_0x19813a['model'];if(!_0x1c1594['query']['hasOwnProperty']('nolimit')){_0x1e1f42[_0x1414('0x1d')]=qs['limit'](_0x1c1594['query'][_0x1414('0x1d')]);_0x1e1f42['offset']=qs[_0x1414('0x1b')](_0x1c1594['query'][_0x1414('0x1b')]);}_0x1e1f42[_0x1414('0x38')]=qs['sort'](_0x1c1594['query'][_0x1414('0x39')]);_0x1e1f42['where']=qs[_0x1414('0x33')](_[_0x1414('0x3a')](_0x1c1594['query'],_0x19813a[_0x1414('0x33')]),_0x4ca591);if(_0x1c1594[_0x1414('0x32')][_0x1414('0x3b')]){_0x1e1f42[_0x1414('0x3c')]=_['merge'](_0x1e1f42[_0x1414('0x3c')],{'$or':_[_0x1414('0x2b')](_0x4ca591,function(_0x1b5e73){if(_0x1b5e73[_0x1414('0x2f')]!==_0x1414('0x3d')){var _0xee5e97={};_0xee5e97[_0x1b5e73[_0x1414('0x29')]]={'$like':'%'+_0x1c1594[_0x1414('0x32')][_0x1414('0x3b')]+'%'};return _0xee5e97;}})});}_0x1e1f42=_[_0x1414('0x3e')]({},_0x1e1f42,_0x1c1594[_0x1414('0x3f')]);var _0x5eabe9={'where':_0x1e1f42['where']};return db[_0x1414('0x2c')][_0x1414('0x1c')](_0x5eabe9)[_0x1414('0x26')](function(_0x182e5d){_0x5c59c9[_0x1414('0x1c')]=_0x182e5d;if(_0x1c1594['query']['includeAll']){_0x1e1f42[_0x1414('0x40')]=[{'all':!![]}];}return db[_0x1414('0x2c')][_0x1414('0x41')](_0x1e1f42);})['then'](function(_0x12efc8){_0x5c59c9[_0x1414('0x42')]=_0x12efc8;return _0x5c59c9;})[_0x1414('0x26')](respondWithFilteredResult(_0x1c18f6,_0x1e1f42))[_0x1414('0x43')](handleError(_0x1c18f6,null));};exports[_0x1414('0x44')]=function(_0x1dc10f,_0x48a5b9){var _0x57f3df={'raw':!![],'where':{'id':_0x1dc10f[_0x1414('0x45')]['id']}},_0x5dd64c={};_0x5dd64c['model']=_[_0x1414('0x31')](db[_0x1414('0x2c')][_0x1414('0x2d')]);_0x5dd64c[_0x1414('0x32')]=_['keys'](_0x1dc10f[_0x1414('0x32')]);_0x5dd64c[_0x1414('0x33')]=_[_0x1414('0x34')](_0x5dd64c[_0x1414('0x30')],_0x5dd64c[_0x1414('0x32')]);_0x57f3df[_0x1414('0x36')]=_[_0x1414('0x34')](_0x5dd64c['model'],qs[_0x1414('0x35')](_0x1dc10f[_0x1414('0x32')][_0x1414('0x35')]));_0x57f3df['attributes']=_0x57f3df[_0x1414('0x36')][_0x1414('0x37')]?_0x57f3df['attributes']:_0x5dd64c[_0x1414('0x30')];if(_0x1dc10f[_0x1414('0x32')][_0x1414('0x46')]){_0x57f3df[_0x1414('0x40')]=[{'all':!![]}];}_0x57f3df=_[_0x1414('0x3e')]({},_0x57f3df,_0x1dc10f['options']);return db[_0x1414('0x2c')]['find'](_0x57f3df)[_0x1414('0x26')](handleEntityNotFound(_0x48a5b9,null))[_0x1414('0x26')](respondWithResult(_0x48a5b9,null))[_0x1414('0x43')](handleError(_0x48a5b9,null));};exports[_0x1414('0x47')]=function(_0x487cf5,_0x1fdf9f){return db['ChatTransferReport'][_0x1414('0x47')](_0x487cf5[_0x1414('0x48')],{})[_0x1414('0x26')](respondWithResult(_0x1fdf9f,0xc9))[_0x1414('0x43')](handleError(_0x1fdf9f,null));};exports[_0x1414('0x24')]=function(_0x532eaf,_0x2cadd7){if(_0x532eaf[_0x1414('0x48')]['id']){delete _0x532eaf[_0x1414('0x48')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x532eaf['params']['id']}})[_0x1414('0x26')](handleEntityNotFound(_0x2cadd7,null))[_0x1414('0x26')](saveUpdates(_0x532eaf['body'],null))[_0x1414('0x26')](respondWithResult(_0x2cadd7,null))[_0x1414('0x43')](handleError(_0x2cadd7,null));};exports[_0x1414('0x25')]=function(_0x3dce75,_0x287380){return db[_0x1414('0x2c')][_0x1414('0x49')]({'where':{'id':_0x3dce75[_0x1414('0x45')]['id']}})[_0x1414('0x26')](handleEntityNotFound(_0x287380,null))['then'](removeEntity(_0x287380,null))['catch'](handleError(_0x287380,null));};exports[_0x1414('0x4a')]=function(_0x3bfaef,_0x265e46){return db[_0x1414('0x2c')]['describe']()['then'](respondWithResult(_0x265e46,null))[_0x1414('0x43')](handleError(_0x265e46,null));}; \ No newline at end of file +var _0x824c=['pick','filter','merge','options','include','findAll','catch','show','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where'];(function(_0x444e61,_0x39bf0f){var _0x4a16bd=function(_0x40a619){while(--_0x40a619){_0x444e61['push'](_0x444e61['shift']());}};_0x4a16bd(++_0x39bf0f);}(_0x824c,0xe3));var _0xc824=function(_0x14b0b3,_0x52eb72){_0x14b0b3=_0x14b0b3-0x0;var _0x33c5ca=_0x824c[_0x14b0b3];return _0x33c5ca;};'use strict';var emlformat=require(_0xc824('0x0'));var rimraf=require(_0xc824('0x1'));var zipdir=require(_0xc824('0x2'));var jsonpatch=require(_0xc824('0x3'));var rp=require(_0xc824('0x4'));var moment=require(_0xc824('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc824('0x6'));var sox=require(_0xc824('0x7'));var csv=require(_0xc824('0x8'));var ejs=require(_0xc824('0x9'));var fs=require('fs');var fs_extra=require(_0xc824('0xa'));var _=require(_0xc824('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc824('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc824('0x8'));var querystring=require('querystring');var Papa=require(_0xc824('0xd'));var Redis=require(_0xc824('0xe'));var authService=require(_0xc824('0xf'));var qs=require(_0xc824('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc824('0x11'))(_0xc824('0x12'));var utils=require(_0xc824('0x13'));var config=require(_0xc824('0x14'));var licenseUtil=require(_0xc824('0x15'));var db=require(_0xc824('0x16'))['db'];function respondWithStatusCode(_0x4d4e0c,_0x1e9f48){_0x1e9f48=_0x1e9f48||0xcc;return function(_0x42c07e){if(_0x42c07e){return _0x4d4e0c[_0xc824('0x17')](_0x1e9f48);}return _0x4d4e0c[_0xc824('0x18')](_0x1e9f48)[_0xc824('0x19')]();};}function respondWithResult(_0xc58201,_0xebd9e8){_0xebd9e8=_0xebd9e8||0xc8;return function(_0xa1f645){if(_0xa1f645){return _0xc58201[_0xc824('0x18')](_0xebd9e8)['json'](_0xa1f645);}};}function respondWithFilteredResult(_0xee2755,_0x497a95){return function(_0x2cdfa5){if(_0x2cdfa5){var _0x1412c2=typeof _0x497a95['offset']==='undefined'&&typeof _0x497a95['limit']===_0xc824('0x1a');var _0x2d2925=_0x2cdfa5['count'];var _0x168037=_0x1412c2?0x0:_0x497a95[_0xc824('0x1b')];var _0xae790b=_0x1412c2?_0x2cdfa5[_0xc824('0x1c')]:_0x497a95['offset']+_0x497a95[_0xc824('0x1d')];var _0x3b08af;if(_0xae790b>=_0x2d2925){_0xae790b=_0x2d2925;_0x3b08af=0xc8;}else{_0x3b08af=0xce;}_0xee2755[_0xc824('0x18')](_0x3b08af);return _0xee2755['set'](_0xc824('0x1e'),_0x168037+'-'+_0xae790b+'/'+_0x2d2925)[_0xc824('0x1f')](_0x2cdfa5);}return null;};}function patchUpdates(_0xd11a26){return function(_0x16691a){try{jsonpatch[_0xc824('0x20')](_0x16691a,_0xd11a26,!![]);}catch(_0x15f8a3){return BPromise[_0xc824('0x21')](_0x15f8a3);}return _0x16691a[_0xc824('0x22')]();};}function saveUpdates(_0x1910e3,_0xeccd8a){return function(_0x358418){if(_0x358418){return _0x358418['update'](_0x1910e3)[_0xc824('0x23')](function(_0x4e4f){return _0x4e4f;});}return null;};}function removeEntity(_0x2ec259,_0x579bd4){return function(_0x31eda0){if(_0x31eda0){return _0x31eda0[_0xc824('0x24')]()[_0xc824('0x23')](function(){_0x2ec259['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f31dc,_0x490b8f){return function(_0x2e6309){if(!_0x2e6309){_0x5f31dc[_0xc824('0x17')](0x194);}return _0x2e6309;};}function handleError(_0xd3405,_0x5a10a0){_0x5a10a0=_0x5a10a0||0x1f4;return function(_0x2b1789){logger['error'](_0x2b1789[_0xc824('0x25')]);if(_0x2b1789['name']){delete _0x2b1789[_0xc824('0x26')];}_0xd3405[_0xc824('0x18')](_0x5a10a0)['send'](_0x2b1789);};}exports[_0xc824('0x27')]=function(_0x6e8085,_0x2de3b7){var _0x409eb7={},_0x54c1dc={},_0x3a8f92={'count':0x0,'rows':[]};var _0x5d90ed=_[_0xc824('0x28')](db[_0xc824('0x29')][_0xc824('0x2a')],function(_0x5baf0e){return{'name':_0x5baf0e[_0xc824('0x2b')],'type':_0x5baf0e[_0xc824('0x2c')]['key']};});_0x54c1dc['model']=_[_0xc824('0x28')](_0x5d90ed,'name');_0x54c1dc['query']=_[_0xc824('0x2d')](_0x6e8085['query']);_0x54c1dc[_0xc824('0x2e')]=_[_0xc824('0x2f')](_0x54c1dc[_0xc824('0x30')],_0x54c1dc['query']);_0x409eb7[_0xc824('0x31')]=_[_0xc824('0x2f')](_0x54c1dc[_0xc824('0x30')],qs[_0xc824('0x32')](_0x6e8085[_0xc824('0x33')][_0xc824('0x32')]));_0x409eb7[_0xc824('0x31')]=_0x409eb7[_0xc824('0x31')][_0xc824('0x34')]?_0x409eb7['attributes']:_0x54c1dc[_0xc824('0x30')];if(!_0x6e8085['query'][_0xc824('0x35')](_0xc824('0x36'))){_0x409eb7[_0xc824('0x1d')]=qs['limit'](_0x6e8085[_0xc824('0x33')][_0xc824('0x1d')]);_0x409eb7[_0xc824('0x1b')]=qs['offset'](_0x6e8085['query'][_0xc824('0x1b')]);}_0x409eb7['order']=qs[_0xc824('0x37')](_0x6e8085[_0xc824('0x33')][_0xc824('0x37')]);_0x409eb7[_0xc824('0x38')]=qs[_0xc824('0x2e')](_[_0xc824('0x39')](_0x6e8085[_0xc824('0x33')],_0x54c1dc[_0xc824('0x2e')]),_0x5d90ed);if(_0x6e8085[_0xc824('0x33')][_0xc824('0x3a')]){_0x409eb7[_0xc824('0x38')]=_[_0xc824('0x3b')](_0x409eb7[_0xc824('0x38')],{'$or':_[_0xc824('0x28')](_0x5d90ed,function(_0x4bbdf3){if(_0x4bbdf3[_0xc824('0x2c')]!=='VIRTUAL'){var _0x333430={};_0x333430[_0x4bbdf3['name']]={'$like':'%'+_0x6e8085[_0xc824('0x33')]['filter']+'%'};return _0x333430;}})});}_0x409eb7=_['merge']({},_0x409eb7,_0x6e8085[_0xc824('0x3c')]);var _0x530a9c={'where':_0x409eb7[_0xc824('0x38')]};return db[_0xc824('0x29')][_0xc824('0x1c')](_0x530a9c)[_0xc824('0x23')](function(_0x12c00d){_0x3a8f92[_0xc824('0x1c')]=_0x12c00d;if(_0x6e8085['query']['includeAll']){_0x409eb7[_0xc824('0x3d')]=[{'all':!![]}];}return db[_0xc824('0x29')][_0xc824('0x3e')](_0x409eb7);})[_0xc824('0x23')](function(_0x2a6127){_0x3a8f92['rows']=_0x2a6127;return _0x3a8f92;})['then'](respondWithFilteredResult(_0x2de3b7,_0x409eb7))[_0xc824('0x3f')](handleError(_0x2de3b7,null));};exports[_0xc824('0x40')]=function(_0x5f5d19,_0x24c472){var _0x323589={'raw':!![],'where':{'id':_0x5f5d19['params']['id']}},_0x1ffdec={};_0x1ffdec[_0xc824('0x30')]=_[_0xc824('0x2d')](db[_0xc824('0x29')][_0xc824('0x2a')]);_0x1ffdec['query']=_[_0xc824('0x2d')](_0x5f5d19[_0xc824('0x33')]);_0x1ffdec[_0xc824('0x2e')]=_[_0xc824('0x2f')](_0x1ffdec[_0xc824('0x30')],_0x1ffdec[_0xc824('0x33')]);_0x323589[_0xc824('0x31')]=_[_0xc824('0x2f')](_0x1ffdec[_0xc824('0x30')],qs[_0xc824('0x32')](_0x5f5d19[_0xc824('0x33')][_0xc824('0x32')]));_0x323589['attributes']=_0x323589[_0xc824('0x31')][_0xc824('0x34')]?_0x323589[_0xc824('0x31')]:_0x1ffdec[_0xc824('0x30')];if(_0x5f5d19[_0xc824('0x33')]['includeAll']){_0x323589[_0xc824('0x3d')]=[{'all':!![]}];}_0x323589=_[_0xc824('0x3b')]({},_0x323589,_0x5f5d19[_0xc824('0x3c')]);return db[_0xc824('0x29')][_0xc824('0x41')](_0x323589)['then'](handleEntityNotFound(_0x24c472,null))['then'](respondWithResult(_0x24c472,null))[_0xc824('0x3f')](handleError(_0x24c472,null));};exports[_0xc824('0x42')]=function(_0x4121c0,_0x18a42a){return db[_0xc824('0x29')][_0xc824('0x42')](_0x4121c0[_0xc824('0x43')],{})['then'](respondWithResult(_0x18a42a,0xc9))['catch'](handleError(_0x18a42a,null));};exports[_0xc824('0x44')]=function(_0x3fea47,_0x449767){if(_0x3fea47[_0xc824('0x43')]['id']){delete _0x3fea47['body']['id'];}return db[_0xc824('0x29')]['find']({'where':{'id':_0x3fea47[_0xc824('0x45')]['id']}})[_0xc824('0x23')](handleEntityNotFound(_0x449767,null))[_0xc824('0x23')](saveUpdates(_0x3fea47[_0xc824('0x43')],null))[_0xc824('0x23')](respondWithResult(_0x449767,null))[_0xc824('0x3f')](handleError(_0x449767,null));};exports['destroy']=function(_0xa070e0,_0x242ca4){return db[_0xc824('0x29')]['find']({'where':{'id':_0xa070e0[_0xc824('0x45')]['id']}})[_0xc824('0x23')](handleEntityNotFound(_0x242ca4,null))[_0xc824('0x23')](removeEntity(_0x242ca4,null))['catch'](handleError(_0x242ca4,null));};exports[_0xc824('0x46')]=function(_0x4c7407,_0x5ed571){return db[_0xc824('0x29')]['describe']()[_0xc824('0x23')](respondWithResult(_0x5ed571,null))['catch'](handleError(_0x5ed571,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 275797c..6845fc5 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 _0xe6e1=['bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','../../config/logger','api','moment'];(function(_0x2f3b21,_0x3fd8ac){var _0x3352f2=function(_0x22cf27){while(--_0x22cf27){_0x2f3b21['push'](_0x2f3b21['shift']());}};_0x3352f2(++_0x3fd8ac);}(_0xe6e1,0x19f));var _0x1e6e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe6e1[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e6e('0x0'))(_0x1e6e('0x1'));var moment=require(_0x1e6e('0x2'));var BPromise=require(_0x1e6e('0x3'));var rp=require(_0x1e6e('0x4'));var fs=require('fs');var path=require(_0x1e6e('0x5'));var rimraf=require('rimraf');var config=require(_0x1e6e('0x6'));var attributes=require(_0x1e6e('0x7'));module[_0x1e6e('0x8')]=function(_0x6597d0,_0x1fbbb1){return _0x6597d0['define'](_0x1e6e('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1e6e('0xa'),'fields':[_0x1e6e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2ad=['request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','moment'];(function(_0x123e2a,_0x3602ee){var _0x47e48e=function(_0x441cee){while(--_0x441cee){_0x123e2a['push'](_0x123e2a['shift']());}};_0x47e48e(++_0x3602ee);}(_0xe2ad,0xa8));var _0xde2a=function(_0x469b61,_0x1d1835){_0x469b61=_0x469b61-0x0;var _0x249df4=_0xe2ad[_0x469b61];return _0x249df4;};'use strict';var _=require('lodash');var util=require(_0xde2a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xde2a('0x1'));var BPromise=require('bluebird');var rp=require(_0xde2a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xde2a('0x3'));var attributes=require(_0xde2a('0x4'));module[_0xde2a('0x5')]=function(_0xe84219,_0x579dbd){return _0xe84219[_0xde2a('0x6')](_0xde2a('0x7'),attributes,{'tableName':_0xde2a('0x8'),'paranoid':![],'indexes':[{'name':_0xde2a('0x9'),'fields':[_0xde2a('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 5e666c7..93ba8a7 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 _0xc76a=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4d6010,_0x2051c7){var _0x2c6bb3=function(_0x53a423){while(--_0x53a423){_0x4d6010['push'](_0x4d6010['shift']());}};_0x2c6bb3(++_0x2051c7);}(_0xc76a,0x1d2));var _0xac76=function(_0x171db8,_0x36cd34){_0x171db8=_0x171db8-0x0;var _0x287c40=_0xc76a[_0x171db8];return _0x287c40;};'use strict';var _=require('lodash');var util=require(_0xac76('0x0'));var moment=require(_0xac76('0x1'));var BPromise=require('bluebird');var rs=require(_0xac76('0x2'));var fs=require('fs');var Redis=require(_0xac76('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac76('0x4'))(_0xac76('0x5'));var config=require(_0xac76('0x6'));var jayson=require(_0xac76('0x7'));var client=jayson[_0xac76('0x8')][_0xac76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4270a6,_0x35fa58,_0x109e4f){return new BPromise(function(_0x5e5695,_0x32f3c8){return client[_0xac76('0xa')](_0x4270a6,_0x109e4f)[_0xac76('0xb')](function(_0x34ecab){logger[_0xac76('0xc')](_0xac76('0xd'),_0x35fa58,_0xac76('0xe'));logger[_0xac76('0xf')](_0xac76('0x10'),_0x35fa58,_0xac76('0xe'),JSON[_0xac76('0x11')](_0x34ecab));if(_0x34ecab['error']){if(_0x34ecab[_0xac76('0x12')][_0xac76('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x35fa58,_0x34ecab[_0xac76('0x12')][_0xac76('0x14')]);return _0x32f3c8(_0x34ecab['error'][_0xac76('0x14')]);}logger[_0xac76('0x12')](_0xac76('0xd'),_0x35fa58,_0x34ecab[_0xac76('0x12')][_0xac76('0x14')]);return _0x5e5695(_0x34ecab[_0xac76('0x12')][_0xac76('0x14')]);}else{logger[_0xac76('0xc')](_0xac76('0xd'),_0x35fa58,_0xac76('0xe'));_0x5e5695(_0x34ecab[_0xac76('0x15')][_0xac76('0x14')]);}})[_0xac76('0x16')](function(_0x18a54a){logger['error'](_0xac76('0xd'),_0x35fa58,_0x18a54a);_0x32f3c8(_0x18a54a);});});} \ No newline at end of file +var _0x92a5=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x92a5,0x1e4));var _0x592a=function(_0x438d40,_0x54e013){_0x438d40=_0x438d40-0x0;var _0x5fe6fd=_0x92a5[_0x438d40];return _0x5fe6fd;};'use strict';var _=require(_0x592a('0x0'));var util=require(_0x592a('0x1'));var moment=require(_0x592a('0x2'));var BPromise=require('bluebird');var rs=require(_0x592a('0x3'));var fs=require('fs');var Redis=require(_0x592a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x592a('0x5'));var logger=require(_0x592a('0x6'))(_0x592a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x592a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dae48,_0x594a2c,_0x4f22b6){return new BPromise(function(_0x4f2e74,_0x319be1){return client[_0x592a('0x9')](_0x3dae48,_0x4f22b6)[_0x592a('0xa')](function(_0x526dbe){logger[_0x592a('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x594a2c,'request\x20sent');logger[_0x592a('0xc')](_0x592a('0xd'),_0x594a2c,_0x592a('0xe'),JSON[_0x592a('0xf')](_0x526dbe));if(_0x526dbe[_0x592a('0x10')]){if(_0x526dbe['error'][_0x592a('0x11')]===0x1f4){logger['error'](_0x592a('0x12'),_0x594a2c,_0x526dbe['error'][_0x592a('0x13')]);return _0x319be1(_0x526dbe[_0x592a('0x10')][_0x592a('0x13')]);}logger[_0x592a('0x10')](_0x592a('0x12'),_0x594a2c,_0x526dbe[_0x592a('0x10')][_0x592a('0x13')]);return _0x4f2e74(_0x526dbe[_0x592a('0x10')][_0x592a('0x13')]);}else{logger[_0x592a('0xb')](_0x592a('0x12'),_0x594a2c,_0x592a('0xe'));_0x4f2e74(_0x526dbe[_0x592a('0x14')]['message']);}})[_0x592a('0x15')](function(_0x5613bd){logger['error'](_0x592a('0x12'),_0x594a2c,_0x5613bd);_0x319be1(_0x5613bd);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6b61dfc..29d3df0 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 _0x14a6=['create','put','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x14a6,0x1be));var _0x614a=function(_0x2b7567,_0x412715){_0x2b7567=_0x2b7567-0x0;var _0x2522dc=_0x14a6[_0x2b7567];return _0x2522dc;};'use strict';var multer=require(_0x614a('0x0'));var util=require(_0x614a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x614a('0x2'));var router=express[_0x614a('0x3')]();var fs_extra=require(_0x614a('0x4'));var auth=require(_0x614a('0x5'));var interaction=require(_0x614a('0x6'));var config=require(_0x614a('0x7'));var controller=require(_0x614a('0x8'));router[_0x614a('0x9')]('/',auth[_0x614a('0xa')](),controller[_0x614a('0xb')]);router[_0x614a('0x9')](_0x614a('0xc'),auth['isAuthenticated'](),controller[_0x614a('0xd')]);router[_0x614a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x614a('0xe')]);router[_0x614a('0xf')]('/',auth[_0x614a('0xa')](),controller[_0x614a('0x10')]);router[_0x614a('0x11')](_0x614a('0x12'),auth[_0x614a('0xa')](),controller['update']);router['delete'](_0x614a('0x12'),auth[_0x614a('0xa')](),controller[_0x614a('0x13')]);module[_0x614a('0x14')]=router; \ No newline at end of file +var _0x43f9=['express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','multer','util','path'];(function(_0x362225,_0x5c85b6){var _0x3c9871=function(_0x314643){while(--_0x314643){_0x362225['push'](_0x362225['shift']());}};_0x3c9871(++_0x5c85b6);}(_0x43f9,0x179));var _0x943f=function(_0x1678b5,_0x304b75){_0x1678b5=_0x1678b5-0x0;var _0x4d2630=_0x43f9[_0x1678b5];return _0x4d2630;};'use strict';var multer=require(_0x943f('0x0'));var util=require(_0x943f('0x1'));var path=require(_0x943f('0x2'));var timeout=require('connect-timeout');var express=require(_0x943f('0x3'));var router=express[_0x943f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x943f('0x5'));var interaction=require(_0x943f('0x6'));var config=require('../../config/environment');var controller=require(_0x943f('0x7'));router[_0x943f('0x8')]('/',auth[_0x943f('0x9')](),controller[_0x943f('0xa')]);router[_0x943f('0x8')](_0x943f('0xb'),auth[_0x943f('0x9')](),controller['describe']);router[_0x943f('0x8')](_0x943f('0xc'),auth[_0x943f('0x9')](),controller[_0x943f('0xd')]);router[_0x943f('0xe')]('/',auth[_0x943f('0x9')](),controller[_0x943f('0xf')]);router[_0x943f('0x10')](_0x943f('0xc'),auth[_0x943f('0x9')](),controller['update']);router[_0x943f('0x11')]('/:id',auth[_0x943f('0x9')](),controller[_0x943f('0x12')]);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 4ba2bb3..4e25c4a 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 _0x85dd=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','star','stringify','onlineForm','parse','getDataValue','textarea','Comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x11b5ab,_0x1d9034){var _0x4a9143=function(_0x8f5bd6){while(--_0x8f5bd6){_0x11b5ab['push'](_0x11b5ab['shift']());}};_0x4a9143(++_0x1d9034);}(_0x85dd,0x9b));var _0xd85d=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x85dd[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xd85d('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xd85d('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd85d('0x1')]},'mapKey':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0x2')},'key':{'type':Sequelize[_0xd85d('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0x3')},'customerAlias':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd85d('0x1')],'allowNull':![],'defaultValue':_0xd85d('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd85d('0x1')],'allowNull':![],'defaultValue':_0xd85d('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd85d('0x1')],'allowNull':![],'defaultValue':_0xd85d('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd85d('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd85d('0x1')]},'animation':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd85d('0x8')](_0xd85d('0x9'),_0xd85d('0xa')),'defaultValue':_0xd85d('0x9')},'header_online':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0xb')},'start_chat_button':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0xc')},'offline_chat_button':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0xd')},'header_offline':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0xe')},'download_transcript':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd85d('0x10')]},'closingQuestion':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x12')},'noteTitle':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x13')},'closingMessage':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x14')},'closingMessageButton':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x15')},'ratingType':{'type':Sequelize[_0xd85d('0x8')]('star',_0xd85d('0x16')),'defaultValue':_0xd85d('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xd85d('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd85d('0x10')],'defaultValue':function(){return JSON[_0xd85d('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xd85d('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xd85d('0x2'),'type':_0xd85d('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xd85d('0x19'))?JSON[_0xd85d('0x1a')](this[_0xd85d('0x1b')](_0xd85d('0x19'))):{};},'set':function(_0x240a77){return this['setDataValue'](_0xd85d('0x19'),JSON['stringify'](_0x240a77));}},'offlineForm':{'type':Sequelize[_0xd85d('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xd85d('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xd85d('0x2'),'type':_0xd85d('0x2')},'variable':null},{'type':_0xd85d('0x1c'),'config':{'placeholder':_0xd85d('0x1d')},'props':{'title':_0xd85d('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd85d('0x1e'))?JSON[_0xd85d('0x1a')](this[_0xd85d('0x1b')](_0xd85d('0x1e'))):{};},'set':function(_0xd69eef){return this[_0xd85d('0x1f')](_0xd85d('0x1e'),JSON['stringify'](_0xd69eef));}},'token':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd85d('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x20')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0x21')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0x22')},'offlineMessageBody':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x23')},'skipUnmanaged':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':_0xd85d('0x24')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd85d('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd85d('0x1')]},'notificationTemplate':{'type':Sequelize[_0xd85d('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd85d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0x25')},'verticalAlignment':{'type':Sequelize[_0xd85d('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xd85d('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd85d('0x1')],'allowNull':![],'defaultValue':_0xd85d('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd85d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd85d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd85d('0x28')},'systemAvatar':{'type':Sequelize[_0xd85d('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd85d('0x6')],'comment':_0xd85d('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![],'comment':_0xd85d('0x2a'),'set':function(_0x3b980e){if(!_0x3b980e)this[_0xd85d('0x1f')](_0xd85d('0x2b'),null);this[_0xd85d('0x1f')](_0xd85d('0x2c'),_0x3b980e);}},'vidaooEscalation':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd85d('0x1')]},'vidaooTopic':{'type':Sequelize[_0xd85d('0x1')],'allowNull':![],'defaultValue':_0xd85d('0x2d')},'vidaooNote':{'type':Sequelize[_0xd85d('0x1')],'defaultValue':function(){return _0xd85d('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd85d('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd85d('0x10')]}}; \ No newline at end of file +var _0x4b36=['We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Skip','star','stringify','input','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x4b59e2,_0x59a4c9){var _0x23546a=function(_0xcea80f){while(--_0xcea80f){_0x4b59e2['push'](_0x4b59e2['shift']());}};_0x23546a(++_0x59a4c9);}(_0x4b36,0x14b));var _0x64b3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x4b36[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x64b3('0x0'));var rs=require('randomstring');module[_0x64b3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![],'unique':_0x64b3('0x3')},'description':{'type':Sequelize[_0x64b3('0x2')]},'mapKey':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x4')},'mapKeyOffline':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x4')},'key':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![],'defaultValue':_0x64b3('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![],'defaultValue':_0x64b3('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![],'defaultValue':_0x64b3('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x64b3('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x64b3('0x2')]},'animation':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x64b3('0xa')]('rounded','squared'),'defaultValue':_0x64b3('0xb')},'header_online':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0xc')},'start_chat_button':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x64b3('0xd')},'header_offline':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x64b3('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x64b3('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x64b3('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x64b3('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x12')},'placeholderMessage':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x13')},'closingMessage':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x64b3('0xd')},'skipMessageButton':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x64b3('0x15'),'thumb'),'defaultValue':_0x64b3('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x64b3('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x64b3('0xf')],'defaultValue':function(){return JSON[_0x64b3('0x16')]({'items':[{'type':_0x64b3('0x17'),'variable':null,'config':{'placeholder':_0x64b3('0x18'),'type':'text','required':!![]},'props':{'title':_0x64b3('0x18'),'helpText':''}},{'type':_0x64b3('0x17'),'props':{'title':_0x64b3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x64b3('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x64b3('0x19'))?JSON[_0x64b3('0x1a')](this[_0x64b3('0x1b')]('onlineForm')):{};},'set':function(_0xafd0fe){return this[_0x64b3('0x1c')](_0x64b3('0x19'),JSON[_0x64b3('0x16')](_0xafd0fe));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x64b3('0x16')]({'items':[{'type':'input','props':{'title':_0x64b3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x64b3('0x4'),'type':'email'},'variable':null},{'type':_0x64b3('0x1d'),'config':{'placeholder':_0x64b3('0x1e')},'props':{'title':_0x64b3('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x64b3('0x1b')](_0x64b3('0x1f'))?JSON[_0x64b3('0x1a')](this[_0x64b3('0x1b')](_0x64b3('0x1f'))):{};},'set':function(_0x58b0c0){return this[_0x64b3('0x1c')](_0x64b3('0x1f'),JSON[_0x64b3('0x16')](_0x58b0c0));}},'token':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':function(){return rs[_0x64b3('0x20')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x64b3('0x2')]},'forwardOffline':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x64b3('0x2')]},'waitingTitle':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x21')},'waitingMessage':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x23')},'offlineMessageBody':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x64b3('0x24')},'skipUnmanaged':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x14')},'sendUnmanaged':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x64b3('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x64b3('0x2')]},'notificationTemplate':{'type':Sequelize[_0x64b3('0xf')],'defaultValue':function(){return _0x64b3('0x25');}},'notificationSound':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x64b3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x64b3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x27')},'verticalAlignment':{'type':Sequelize[_0x64b3('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x28')},'messagesAlignment':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':_0x64b3('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x64b3('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x64b3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x64b3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x64b3('0x2a')},'systemAvatar':{'type':Sequelize[_0x64b3('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x64b3('0x8')],'comment':_0x64b3('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![],'comment':_0x64b3('0x2c'),'set':function(_0x34881e){if(!_0x34881e)this[_0x64b3('0x1c')](_0x64b3('0x2d'),null);this['setDataValue'](_0x64b3('0x2e'),_0x34881e);}},'vidaooEscalation':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x64b3('0x2')]},'vidaooTopic':{'type':Sequelize[_0x64b3('0x2')],'allowNull':![],'defaultValue':_0x64b3('0x2f')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x64b3('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x64b3('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x64b3('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x64b3('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 00fb6db..4673546 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 _0xa07b=['startRouting','EventManager','files','Sequelize','ValidationError','difference','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','SendMail','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','interval','getProactiveActions','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','replace','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','virtual','alignment','textColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','html-to-text','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','defaults','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','end','json','offset','limit','undefined','count','status','set','Content-Range','update','destroy','get','UserProfileResource','sendStatus','name','send','user-agent-parser','setUA','user-agent','getResult','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','type','Pause','mandatoryDispositionPause','map','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatWebsite','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','testWildcardValidity','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','describe','getDispositions','Disposition','ChatWebsiteId','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','agentAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','customerIp','CmContact','No\x20available\x20attributes','createdAt','includes','updatedAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','priority','asc','account','list','contact','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','UserId','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa07b,0x66));var _0xba07=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa07b[_0x46e363];return _0x3fb059;};'use strict';var Mustache=require('mustache');var util=require(_0xba07('0x0'));var path=require(_0xba07('0x1'));var ejs=require(_0xba07('0x2'));var fs=require('fs');var fs_extra=require(_0xba07('0x3'));var _=require(_0xba07('0x4'));var querystring=require(_0xba07('0x5'));var htmlToText=require(_0xba07('0x6'));var Redis=require('ioredis');var jayson=require(_0xba07('0x7'));var qs=require(_0xba07('0x8'));var logger=require(_0xba07('0x9'))('api');var config=require(_0xba07('0xa'));var APIBadRequestError=require(_0xba07('0xb'))[_0xba07('0xc')];var APINotFoundError=require(_0xba07('0xb'))[_0xba07('0xd')];var APIOutOfIntervalError=require(_0xba07('0xb'))[_0xba07('0xe')];var APIHandleError=require(_0xba07('0xb'))[_0xba07('0xf')];var APIConflictError=require(_0xba07('0xb'))[_0xba07('0x10')];var wildcardUtils=require(_0xba07('0x11'));var URL=require('url')[_0xba07('0x12')];var db=require(_0xba07('0x13'))['db'];config[_0xba07('0x14')]=_[_0xba07('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba07('0x14')]));require('./chatWebsite.socket')['register'](socket);var client=jayson['client'][_0xba07('0x16')]({'port':0x232c});var client9002=jayson[_0xba07('0x17')]['http']({'port':0x232a});var client9003=jayson['client'][_0xba07('0x16')]({'port':0x232b});var client9001=jayson[_0xba07('0x17')][_0xba07('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x433823,_0x31d575,_0x1ec5fa,_0x5f468d){return new Promise(function(_0x25df36,_0xf60a43){var _0x17fb4b=_0x5f468d||client;return _0x17fb4b[_0xba07('0x18')](_0x433823,_0x1ec5fa)[_0xba07('0x19')](function(_0x44328a){logger[_0xba07('0x1a')](_0xba07('0x1b'),_0x31d575,_0xba07('0x1c'));logger[_0xba07('0x1d')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x31d575,_0xba07('0x1c'),JSON[_0xba07('0x1e')](_0x44328a));if(_0x44328a[_0xba07('0x1f')]){if(_0x44328a[_0xba07('0x1f')][_0xba07('0x20')]===0x1f4){logger[_0xba07('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x31d575,_0x44328a[_0xba07('0x1f')][_0xba07('0x21')]);return _0xf60a43(_0x44328a[_0xba07('0x1f')][_0xba07('0x21')]);}logger[_0xba07('0x1f')](_0xba07('0x1b'),_0x31d575,_0x44328a[_0xba07('0x1f')][_0xba07('0x21')]);return _0x25df36(_0x44328a[_0xba07('0x1f')][_0xba07('0x21')]);}else{logger[_0xba07('0x1a')](_0xba07('0x1b'),_0x31d575,'request\x20sent');_0x25df36(_0x44328a[_0xba07('0x22')]['message']);}})['catch'](function(_0x28e244){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x31d575,_0x28e244);_0xf60a43(_0x28e244);});});}function respondWithStatusCode(_0x3c47f2,_0x512ef1){_0x512ef1=_0x512ef1||0xcc;return function(_0x4c7a10){if(_0x4c7a10){return _0x3c47f2['sendStatus'](_0x512ef1);}return _0x3c47f2['status'](_0x512ef1)[_0xba07('0x23')]();};}function respondWithResult(_0x48e3d2,_0x433846){_0x433846=_0x433846||0xc8;return function(_0x1a69b3){if(_0x1a69b3){return _0x48e3d2['status'](_0x433846)[_0xba07('0x24')](_0x1a69b3);}};}function respondWithFilteredResult(_0x4e60be,_0x2be0bd){return function(_0x20c35f){if(_0x20c35f){var _0x444cf0=typeof _0x2be0bd[_0xba07('0x25')]==='undefined'&&typeof _0x2be0bd[_0xba07('0x26')]===_0xba07('0x27');var _0x323ef1=_0x20c35f[_0xba07('0x28')];var _0x3ba085=_0x444cf0?0x0:_0x2be0bd[_0xba07('0x25')];var _0x3ee23a=_0x444cf0?_0x20c35f[_0xba07('0x28')]:_0x2be0bd[_0xba07('0x25')]+_0x2be0bd[_0xba07('0x26')];var _0x2a8589;if(_0x3ee23a>=_0x323ef1){_0x3ee23a=_0x323ef1;_0x2a8589=0xc8;}else{_0x2a8589=0xce;}_0x4e60be[_0xba07('0x29')](_0x2a8589);return _0x4e60be[_0xba07('0x2a')](_0xba07('0x2b'),_0x3ba085+'-'+_0x3ee23a+'/'+_0x323ef1)[_0xba07('0x24')](_0x20c35f);}return null;};}function saveUpdates(_0x3f61a9){return function(_0x46ea5f){if(_0x46ea5f){return _0x46ea5f[_0xba07('0x2c')](_0x3f61a9)[_0xba07('0x19')](function(_0x24ef73){return _0x24ef73;});}return null;};}function removeEntity(_0x26e1a7){return function(_0x5c419f){if(_0x5c419f){return _0x5c419f[_0xba07('0x2d')]()[_0xba07('0x19')](function(){var _0x1a4c3b=_0x5c419f[_0xba07('0x2e')]({'plain':!![]});var _0x11b8db='ChatWebsites';return db[_0xba07('0x2f')][_0xba07('0x2d')]({'where':{'type':_0x11b8db,'resourceId':_0x1a4c3b['id']}})[_0xba07('0x19')](function(){return _0x5c419f;});})[_0xba07('0x19')](function(){_0x26e1a7[_0xba07('0x29')](0xcc)[_0xba07('0x23')]();});}};}function handleEntityNotFound(_0x1a4971){return function(_0x39bbb4){if(!_0x39bbb4){_0x1a4971[_0xba07('0x30')](0x194);}return _0x39bbb4;};}function handleError(_0x39a369,_0x222794){_0x222794=_0x222794||0x1f4;return function(_0x1a5948){logger['error'](_0x1a5948['stack']);if(_0x1a5948[_0xba07('0x31')]){delete _0x1a5948[_0xba07('0x31')];}_0x39a369[_0xba07('0x29')](_0x222794)[_0xba07('0x32')](_0x1a5948);};}function createInteractionObject(_0x99ad04,_0x521bce,_0x3fabe1,_0x162cea){var _0x325086=require(_0xba07('0x33'));var _0xf3d83c=new _0x325086();var _0x55a55b=_0xf3d83c[_0xba07('0x34')](_0x3fabe1[_0xba07('0x35')])[_0xba07('0x36')]();var _0x2376c8=_0x521bce['customerIp'];if(_0x3fabe1['cf-connecting-ip']){_0x2376c8=_0x3fabe1['cf-connecting-ip'];}else if(_0x3fabe1[_0xba07('0x37')]){_0x2376c8=_['first'](_0x3fabe1[_0xba07('0x37')]['split'](','));}return{'ContactId':_0x162cea['id'],'ChatWebsiteId':_0x99ad04,'from':(_0x162cea['firstName']||'')+'\x20'+(_0x162cea[_0xba07('0x38')]||''),'customerIp':_0x2376c8,'customerPort':_0x3fabe1[_0xba07('0x39')]?_0x3fabe1[_0xba07('0x39')]:null,'referer':_0x521bce[_0xba07('0x3a')],'browserName':_0x55a55b[_0xba07('0x3b')][_0xba07('0x31')]&&_0x55a55b[_0xba07('0x3b')][_0xba07('0x3c')]?util[_0xba07('0x3d')]('%s\x20%s',_0x55a55b['browser'][_0xba07('0x31')],_0x55a55b[_0xba07('0x3b')]['version']):'unknown','browserVersion':_0x55a55b[_0xba07('0x3b')][_0xba07('0x3c')]||_0xba07('0x3e'),'osName':util[_0xba07('0x3d')](_0xba07('0x3f'),_0x55a55b['os'][_0xba07('0x31')],_0x55a55b['os']['version']),'osVersion':_0x55a55b['os']['version'],'deviceModel':_0x55a55b[_0xba07('0x40')]['model']&&_0x55a55b[_0xba07('0x40')][_0xba07('0x41')]?util[_0xba07('0x3d')](_0xba07('0x42'),_0x55a55b[_0xba07('0x40')]['model'],_0x55a55b[_0xba07('0x40')][_0xba07('0x41')],_0x55a55b[_0xba07('0x40')][_0xba07('0x43')]):null,'deviceVendor':_0x55a55b[_0xba07('0x40')][_0xba07('0x41')],'deviceType':_0x55a55b[_0xba07('0x40')][_0xba07('0x43')],'formData':JSON['stringify'](_0x521bce)};}exports['index']=function(_0x1822a7,_0x60ff1e){var _0x5f47fb={'include':[{'model':db[_0xba07('0x44')],'as':_0xba07('0x45')}]},_0x28895c={},_0x3fa51e={'count':0x0,'rows':[]};var _0x46ad09=_[_0xba07('0x46')](db['ChatWebsite']['rawAttributes'],function(_0x5e7ea0){return{'name':_0x5e7ea0[_0xba07('0x47')],'type':_0x5e7ea0[_0xba07('0x43')]['key']};});_0x28895c['model']=_[_0xba07('0x46')](_0x46ad09,_0xba07('0x31'));_0x28895c[_0xba07('0x48')]=_[_0xba07('0x49')](_0x1822a7['query']);_0x28895c[_0xba07('0x4a')]=_[_0xba07('0x4b')](_0x28895c[_0xba07('0x4c')],_0x28895c[_0xba07('0x48')]);_0x5f47fb['attributes']=_[_0xba07('0x4b')](_0x28895c[_0xba07('0x4c')],qs[_0xba07('0x4d')](_0x1822a7[_0xba07('0x48')][_0xba07('0x4d')]));_0x5f47fb[_0xba07('0x4e')]=_0x5f47fb[_0xba07('0x4e')][_0xba07('0x4f')]?_0x5f47fb['attributes']:_0x28895c['model'];if(!_0x1822a7[_0xba07('0x48')][_0xba07('0x50')](_0xba07('0x51'))){_0x5f47fb['limit']=qs[_0xba07('0x26')](_0x1822a7['query'][_0xba07('0x26')]);_0x5f47fb[_0xba07('0x25')]=qs[_0xba07('0x25')](_0x1822a7[_0xba07('0x48')][_0xba07('0x25')]);}_0x5f47fb[_0xba07('0x52')]=qs[_0xba07('0x53')](_0x1822a7[_0xba07('0x48')][_0xba07('0x53')]);_0x5f47fb['where']=qs['filters'](_[_0xba07('0x54')](_0x1822a7[_0xba07('0x48')],_0x28895c['filters']),_0x46ad09);if(_0x1822a7[_0xba07('0x48')][_0xba07('0x55')]){_0x5f47fb[_0xba07('0x56')]=_[_0xba07('0x57')](_0x5f47fb[_0xba07('0x56')],{'$or':_['map'](_0x46ad09,function(_0x52037e){if(_0x52037e[_0xba07('0x43')]!==_0xba07('0x58')){var _0x4dbe7a={};_0x4dbe7a[_0x52037e[_0xba07('0x31')]]={'$like':'%'+_0x1822a7[_0xba07('0x48')][_0xba07('0x55')]+'%'};return _0x4dbe7a;}})});}_0x5f47fb=_[_0xba07('0x57')]({},_0x5f47fb,_0x1822a7[_0xba07('0x59')]);var _0x599d1d={'where':_0x5f47fb[_0xba07('0x56')]};return db[_0xba07('0x5a')]['count'](_0x599d1d)[_0xba07('0x19')](function(_0x5cc3cc){_0x3fa51e['count']=_0x5cc3cc;if(_0x1822a7[_0xba07('0x48')]['includeAll']){_0x5f47fb[_0xba07('0x5b')]=[{'all':!![]}];}return db[_0xba07('0x5a')][_0xba07('0x5c')](_0x5f47fb);})[_0xba07('0x19')](function(_0x219364){_0x3fa51e[_0xba07('0x5d')]=_0x219364;return _0x3fa51e;})[_0xba07('0x19')](respondWithFilteredResult(_0x60ff1e,_0x5f47fb))[_0xba07('0x5e')](handleError(_0x60ff1e,null));};exports[_0xba07('0x5f')]=function(_0x170ca9,_0x35f097){var _0x1381d7={'raw':![],'where':{'id':_0x170ca9[_0xba07('0x60')]['id']},'include':[{'model':db[_0xba07('0x44')],'as':_0xba07('0x45')}]},_0x5e03b5={};_0x5e03b5[_0xba07('0x4c')]=_[_0xba07('0x49')](db[_0xba07('0x5a')][_0xba07('0x61')]);_0x5e03b5[_0xba07('0x48')]=_[_0xba07('0x49')](_0x170ca9[_0xba07('0x48')]);_0x5e03b5[_0xba07('0x4a')]=_['intersection'](_0x5e03b5[_0xba07('0x4c')],_0x5e03b5['query']);_0x1381d7[_0xba07('0x4e')]=_['intersection'](_0x5e03b5[_0xba07('0x4c')],qs[_0xba07('0x4d')](_0x170ca9[_0xba07('0x48')][_0xba07('0x4d')]));_0x1381d7['attributes']=_0x1381d7[_0xba07('0x4e')]['length']?_0x1381d7[_0xba07('0x4e')]:_0x5e03b5[_0xba07('0x4c')];if(_0x170ca9[_0xba07('0x48')][_0xba07('0x62')]){_0x1381d7[_0xba07('0x5b')]=[{'all':!![]}];}_0x1381d7=_['merge']({},_0x1381d7,_0x170ca9[_0xba07('0x59')]);return db[_0xba07('0x5a')][_0xba07('0x63')](_0x1381d7)['then'](handleEntityNotFound(_0x35f097,null))[_0xba07('0x19')](respondWithResult(_0x35f097,null))['catch'](handleError(_0x35f097,null));};exports[_0xba07('0x64')]=function(_0x333860,_0x5ce78e){if(!wildcardUtils[_0xba07('0x65')](_0x333860[_0xba07('0x66')][_0xba07('0x67')])){return handleError(_0x5ce78e,null)(new APIBadRequestError('\x22'+_0x333860['body'][_0xba07('0x67')]+_0xba07('0x68')));}return db[_0xba07('0x5a')][_0xba07('0x64')](_0x333860[_0xba07('0x66')],{})[_0xba07('0x19')](function(_0x1d787a){var _0x2e7f93=_0x333860[_0xba07('0x69')][_0xba07('0x2e')]({'plain':!![]});if(!_0x2e7f93)throw new Error(_0xba07('0x6a'));if(_0x2e7f93[_0xba07('0x6b')]===_0xba07('0x69')){var _0x48a02b=_0x1d787a[_0xba07('0x2e')]({'plain':!![]});var _0x35ed85=_0xba07('0x6c');return db[_0xba07('0x6d')][_0xba07('0x63')]({'where':{'name':_0x35ed85,'userProfileId':_0x2e7f93[_0xba07('0x6e')]},'raw':!![]})['then'](function(_0x3dd823){if(_0x3dd823&&_0x3dd823[_0xba07('0x6f')]===0x0){return db['UserProfileResource'][_0xba07('0x64')]({'name':_0x48a02b['name'],'resourceId':_0x48a02b['id'],'type':_0x3dd823['name'],'sectionId':_0x3dd823['id']},{})[_0xba07('0x19')](function(){return _0x1d787a;});}else{return _0x1d787a;}})[_0xba07('0x5e')](function(_0x3479a9){logger[_0xba07('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3479a9);throw _0x3479a9;});}return _0x1d787a;})[_0xba07('0x19')](respondWithResult(_0x5ce78e,0xc9))[_0xba07('0x5e')](handleError(_0x5ce78e,null));};exports[_0xba07('0x2c')]=function(_0x2fe2bd,_0x521381){if(!wildcardUtils[_0xba07('0x65')](_0x2fe2bd[_0xba07('0x66')][_0xba07('0x67')])){return handleError(_0x521381,null)(new APIBadRequestError('\x22'+_0x2fe2bd[_0xba07('0x66')]['address']+_0xba07('0x68')));}if(_0x2fe2bd[_0xba07('0x66')]['id']){delete _0x2fe2bd[_0xba07('0x66')]['id'];}return db[_0xba07('0x5a')][_0xba07('0x63')]({'where':{'id':_0x2fe2bd['params']['id']},'include':[{'model':db[_0xba07('0x44')],'as':_0xba07('0x45')}]})[_0xba07('0x19')](handleEntityNotFound(_0x521381,null))[_0xba07('0x19')](saveUpdates(_0x2fe2bd[_0xba07('0x66')],null))[_0xba07('0x19')](respondWithResult(_0x521381,null))[_0xba07('0x5e')](handleError(_0x521381,null));};exports[_0xba07('0x2d')]=function(_0xa94c70,_0x122aad){return db[_0xba07('0x5a')][_0xba07('0x63')]({'where':{'id':_0xa94c70[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x122aad,null))['then'](removeEntity(_0x122aad,null))[_0xba07('0x5e')](handleError(_0x122aad,null));};exports[_0xba07('0x70')]=function(_0x3eca33,_0x247bd4){return db[_0xba07('0x5a')]['describe']()[_0xba07('0x19')](respondWithResult(_0x247bd4,null))[_0xba07('0x5e')](handleError(_0x247bd4,null));};exports['addDisposition']=function(_0x2f2386,_0x49f124){if(_0x2f2386[_0xba07('0x66')]['id']){delete _0x2f2386[_0xba07('0x66')]['id'];}return db[_0xba07('0x5a')][_0xba07('0x63')]({'where':{'id':_0x2f2386[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x49f124,null))['then'](function(_0x276573){if(_0x276573){_0x2f2386[_0xba07('0x66')]['ChatWebsiteId']=_0x276573['id'];return db['Disposition'][_0xba07('0x64')](_0x2f2386[_0xba07('0x66')]);}})['then'](respondWithResult(_0x49f124,null))[_0xba07('0x5e')](handleError(_0x49f124,null));};exports[_0xba07('0x71')]=function(_0x43867a,_0x16f915){var _0x37d47f={'raw':![],'where':{}};var _0x299fa9={};var _0x21467c={'count':0x0,'rows':[]};return db[_0xba07('0x5a')]['findOne']({'where':{'id':_0x43867a[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x16f915,null))['then'](function(_0x5af732){if(_0x5af732){_0x299fa9[_0xba07('0x4c')]=_[_0xba07('0x49')](db[_0xba07('0x72')]['rawAttributes']);_0x299fa9[_0xba07('0x48')]=_[_0xba07('0x49')](_0x43867a['query']);_0x299fa9['filters']=_[_0xba07('0x4b')](_0x299fa9['model'],_0x299fa9[_0xba07('0x48')]);_0x37d47f['attributes']=_[_0xba07('0x4b')](_0x299fa9[_0xba07('0x4c')],qs[_0xba07('0x4d')](_0x43867a[_0xba07('0x48')]['fields']));_0x37d47f['attributes']=_0x37d47f[_0xba07('0x4e')][_0xba07('0x4f')]?_0x37d47f[_0xba07('0x4e')]:_0x299fa9[_0xba07('0x4c')];if(!_0x43867a[_0xba07('0x48')][_0xba07('0x50')](_0xba07('0x51'))){_0x37d47f[_0xba07('0x26')]=qs[_0xba07('0x26')](_0x43867a[_0xba07('0x48')][_0xba07('0x26')]);_0x37d47f[_0xba07('0x25')]=qs[_0xba07('0x25')](_0x43867a['query'][_0xba07('0x25')]);}_0x37d47f['order']=qs[_0xba07('0x53')](_0x43867a[_0xba07('0x48')][_0xba07('0x53')]);_0x37d47f['where']=qs[_0xba07('0x4a')](_[_0xba07('0x54')](_0x43867a[_0xba07('0x48')],_0x299fa9['filters']));_0x37d47f[_0xba07('0x56')][_0xba07('0x73')]=_0x5af732['id'];if(_0x43867a[_0xba07('0x48')][_0xba07('0x55')]){_0x37d47f[_0xba07('0x56')]=_['merge'](_0x37d47f[_0xba07('0x56')],{'$or':_['map'](_0x37d47f[_0xba07('0x4e')],function(_0x4f8c0b){var _0x40159f={};_0x40159f[_0x4f8c0b]={'$like':'%'+_0x43867a[_0xba07('0x48')]['filter']+'%'};return _0x40159f;})});}_0x37d47f=_['merge']({},_0x37d47f,_0x43867a['options']);return db['Disposition'][_0xba07('0x28')]({'where':_0x37d47f[_0xba07('0x56')]})[_0xba07('0x19')](function(_0x3306ee){_0x21467c[_0xba07('0x28')]=_0x3306ee;if(_0x43867a[_0xba07('0x48')]['includeAll']){_0x37d47f[_0xba07('0x5b')]=[{'all':!![]}];}return db[_0xba07('0x72')][_0xba07('0x5c')](_0x37d47f);})[_0xba07('0x19')](function(_0x1c0240){_0x21467c[_0xba07('0x5d')]=_0x1c0240;return _0x21467c;});}})['then'](respondWithFilteredResult(_0x16f915,_0x37d47f))[_0xba07('0x5e')](handleError(_0x16f915,null));};exports['removeDispositions']=function(_0x4d2084,_0x473a40){return db['ChatWebsite'][_0xba07('0x63')]({'where':{'id':_0x4d2084['params']['id']}})['then'](handleEntityNotFound(_0x473a40,null))[_0xba07('0x19')](function(_0x261c75){if(_0x261c75){return _0x261c75[_0xba07('0x74')](_0x4d2084['query']['ids']);}})['then'](respondWithStatusCode(_0x473a40,null))[_0xba07('0x5e')](handleError(_0x473a40,null));};exports[_0xba07('0x75')]=function(_0x7df164,_0x24a355){if(_0x7df164[_0xba07('0x66')]['id']){delete _0x7df164[_0xba07('0x66')]['id'];}return db[_0xba07('0x5a')]['find']({'where':{'id':_0x7df164[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x24a355,null))[_0xba07('0x19')](function(_0x582c1d){if(_0x582c1d){_0x7df164[_0xba07('0x66')][_0xba07('0x73')]=_0x582c1d['id'];return db['CannedAnswer'][_0xba07('0x64')](_0x7df164[_0xba07('0x66')]);}})[_0xba07('0x19')](respondWithResult(_0x24a355,null))['catch'](handleError(_0x24a355,null));};exports[_0xba07('0x76')]=function(_0xa0604d,_0x45b2bf){var _0x3ef3cf={'raw':![],'where':{}};var _0x232b80={};var _0x3d5fef={'count':0x0,'rows':[]};return db[_0xba07('0x5a')][_0xba07('0x77')]({'where':{'id':_0xa0604d[_0xba07('0x60')]['id']}})['then'](handleEntityNotFound(_0x45b2bf,null))[_0xba07('0x19')](function(_0x332a44){if(_0x332a44){_0x232b80[_0xba07('0x4c')]=_[_0xba07('0x49')](db[_0xba07('0x78')][_0xba07('0x61')]);_0x232b80[_0xba07('0x48')]=_[_0xba07('0x49')](_0xa0604d[_0xba07('0x48')]);_0x232b80[_0xba07('0x4a')]=_[_0xba07('0x4b')](_0x232b80[_0xba07('0x4c')],_0x232b80[_0xba07('0x48')]);_0x3ef3cf['attributes']=_['intersection'](_0x232b80[_0xba07('0x4c')],qs['fields'](_0xa0604d['query'][_0xba07('0x4d')]));_0x3ef3cf['attributes']=_0x3ef3cf[_0xba07('0x4e')][_0xba07('0x4f')]?_0x3ef3cf[_0xba07('0x4e')]:_0x232b80[_0xba07('0x4c')];if(!_0xa0604d[_0xba07('0x48')][_0xba07('0x50')]('nolimit')){_0x3ef3cf[_0xba07('0x26')]=qs[_0xba07('0x26')](_0xa0604d[_0xba07('0x48')][_0xba07('0x26')]);_0x3ef3cf[_0xba07('0x25')]=qs[_0xba07('0x25')](_0xa0604d[_0xba07('0x48')][_0xba07('0x25')]);}_0x3ef3cf[_0xba07('0x52')]=qs[_0xba07('0x53')](_0xa0604d[_0xba07('0x48')]['sort']);_0x3ef3cf['where']=qs['filters'](_[_0xba07('0x54')](_0xa0604d['query'],_0x232b80[_0xba07('0x4a')]));_0x3ef3cf[_0xba07('0x56')][_0xba07('0x73')]=_0x332a44['id'];if(_0xa0604d[_0xba07('0x48')]['filter']){_0x3ef3cf[_0xba07('0x56')]=_[_0xba07('0x57')](_0x3ef3cf[_0xba07('0x56')],{'$or':_[_0xba07('0x46')](_0x3ef3cf['attributes'],function(_0x12f0ef){var _0xbb5498={};_0xbb5498[_0x12f0ef]={'$like':'%'+_0xa0604d[_0xba07('0x48')]['filter']+'%'};return _0xbb5498;})});}_0x3ef3cf=_['merge']({},_0x3ef3cf,_0xa0604d['options']);return db[_0xba07('0x78')][_0xba07('0x28')]({'where':_0x3ef3cf['where']})[_0xba07('0x19')](function(_0x5c1140){_0x3d5fef['count']=_0x5c1140;if(_0xa0604d[_0xba07('0x48')][_0xba07('0x62')]){_0x3ef3cf[_0xba07('0x5b')]=[{'all':!![]}];}return db[_0xba07('0x78')][_0xba07('0x5c')](_0x3ef3cf);})[_0xba07('0x19')](function(_0xba7c06){_0x3d5fef[_0xba07('0x5d')]=_0xba7c06;return _0x3d5fef;});}})[_0xba07('0x19')](respondWithFilteredResult(_0x45b2bf,_0x3ef3cf))[_0xba07('0x5e')](handleError(_0x45b2bf,null));};exports[_0xba07('0x79')]=function(_0x3aa0b0,_0x264a0b){return db[_0xba07('0x5a')]['find']({'where':{'id':_0x3aa0b0[_0xba07('0x60')]['id']}})['then'](handleEntityNotFound(_0x264a0b,null))['then'](function(_0x511319){if(_0x511319){return _0x511319['removeAnswers'](_0x3aa0b0[_0xba07('0x48')][_0xba07('0x7a')]);}})[_0xba07('0x19')](respondWithStatusCode(_0x264a0b,null))[_0xba07('0x5e')](handleError(_0x264a0b,null));};exports['addLogo']=function(_0x15a3d3,_0x410d05){_0x15a3d3[_0xba07('0x66')][_0xba07('0x7b')]=_0x15a3d3[_0xba07('0x7c')][_0xba07('0x7d')];return db['ChatWebsite'][_0xba07('0x63')]({'where':{'id':_0x15a3d3[_0xba07('0x60')]['id']}})['then'](handleEntityNotFound(_0x410d05,null))[_0xba07('0x19')](saveUpdates(_0x15a3d3['body'],null))[_0xba07('0x19')](respondWithResult(_0x410d05,null))['catch'](handleError(_0x410d05,null));};exports[_0xba07('0x7e')]=function(_0x52c60f,_0x348d68){_0x52c60f['body']['agentAvatar']=_0x52c60f[_0xba07('0x7c')][_0xba07('0x7d')];return db[_0xba07('0x5a')][_0xba07('0x63')]({'where':{'id':_0x52c60f[_0xba07('0x60')]['id']}})['then'](handleEntityNotFound(_0x348d68,null))[_0xba07('0x19')](saveUpdates(_0x52c60f[_0xba07('0x66')],null))['then'](respondWithResult(_0x348d68,null))[_0xba07('0x5e')](handleError(_0x348d68,null));};exports[_0xba07('0x7f')]=function(_0x2b6988,_0x2996ce){_0x2b6988['body']['customerAvatar']=_0x2b6988[_0xba07('0x7c')][_0xba07('0x7d')];return db['ChatWebsite'][_0xba07('0x63')]({'where':{'id':_0x2b6988[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x2996ce,null))[_0xba07('0x19')](saveUpdates(_0x2b6988[_0xba07('0x66')],null))[_0xba07('0x19')](respondWithResult(_0x2996ce,null))['catch'](handleError(_0x2996ce,null));};exports[_0xba07('0x80')]=function(_0x21cb78,_0x4d185b){_0x21cb78[_0xba07('0x66')][_0xba07('0x81')]=_0x21cb78['file'][_0xba07('0x7d')];return db[_0xba07('0x5a')][_0xba07('0x63')]({'where':{'id':_0x21cb78[_0xba07('0x60')]['id']}})['then'](handleEntityNotFound(_0x4d185b,null))[_0xba07('0x19')](saveUpdates(_0x21cb78['body'],null))[_0xba07('0x19')](respondWithResult(_0x4d185b,null))[_0xba07('0x5e')](handleError(_0x4d185b,null));};exports[_0xba07('0x82')]=function(_0x109e6a,_0x32afc2){var _0x108d04=path[_0xba07('0x83')](config[_0xba07('0x84')],'server/files/images/logos/default_logo.svg');var _0x41acd5={'where':{'id':_0x109e6a[_0xba07('0x60')]['id']},'attributes':['id',_0xba07('0x7b')],'raw':!![]};var _0x54f2ef=![];return require(_0xba07('0x85'))[_0xba07('0x86')]()['then'](function(_0x394c24){if(_0x394c24){_0x54f2ef=_0x394c24['custom'];}})[_0xba07('0x19')](function(){return db['ChatWebsite']['find'](_0x41acd5);})[_0xba07('0x19')](handleEntityNotFound(_0x32afc2,null))['then'](function(_0x312fe0){if(_0x312fe0){if(!_[_0xba07('0x87')](_0x312fe0[_0xba07('0x7b')])){if(fs[_0xba07('0x88')](path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0x89'),_0x312fe0[_0xba07('0x7b')]))&&_0x54f2ef){_0x108d04=path[_0xba07('0x83')](config[_0xba07('0x84')],'server/files/images/logos/',_0x312fe0[_0xba07('0x7b')]);}}return _0x32afc2[_0xba07('0x8a')](_0x108d04);}})['catch'](handleError(_0x32afc2,null));};exports['getAvatar']=function(_0x427c3c,_0x1276b2){var _0x379ebc=path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0x8b'));var _0x4208c9={'where':{'id':_0x427c3c[_0xba07('0x60')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xba07('0x5a')][_0xba07('0x63')](_0x4208c9)['then'](handleEntityNotFound(_0x1276b2,null))[_0xba07('0x19')](function(_0xf6340d){if(_0xf6340d){if(!_[_0xba07('0x87')](_0xf6340d['agentAvatar'])){if(fs[_0xba07('0x88')](path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0x8c'),_0xf6340d[_0xba07('0x8d')]))){_0x379ebc=path[_0xba07('0x83')](config['root'],_0xba07('0x8c'),_0xf6340d['agentAvatar']);}}return _0x1276b2[_0xba07('0x8a')](_0x379ebc);}})['catch'](handleError(_0x1276b2,null));};exports['getCustomerAvatar']=function(_0x4fb2dd,_0x12ad9a){var _0x534ec5=path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0x8e'));var _0x3de025={'where':{'id':_0x4fb2dd['params']['id']},'attributes':['id',_0xba07('0x8f'),_0xba07('0x90')],'raw':!![]};return db[_0xba07('0x5a')][_0xba07('0x63')](_0x3de025)['then'](handleEntityNotFound(_0x12ad9a,null))[_0xba07('0x19')](function(_0xe76f94){if(_0xe76f94){if(!_[_0xba07('0x87')](_0xe76f94[_0xba07('0x8f')])){if(fs[_0xba07('0x88')](path[_0xba07('0x83')](config['root'],_0xba07('0x8c'),_0xe76f94[_0xba07('0x8f')]))&&_0xe76f94[_0xba07('0x90')]){_0x534ec5=path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0x8c'),_0xe76f94[_0xba07('0x8f')]);}}return _0x12ad9a['download'](_0x534ec5);}})[_0xba07('0x5e')](handleError(_0x12ad9a,null));};exports['getSystemAvatar']=function(_0x2e9edc,_0x21cc76){var _0x11ccba=path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0x91'));var _0x11d6e7={'where':{'id':_0x2e9edc['params']['id']},'attributes':['id',_0xba07('0x81')],'raw':!![]};return db[_0xba07('0x5a')][_0xba07('0x63')](_0x11d6e7)[_0xba07('0x19')](handleEntityNotFound(_0x21cc76,null))[_0xba07('0x19')](function(_0x18124c){if(_0x18124c){if(!_[_0xba07('0x87')](_0x18124c[_0xba07('0x81')])){if(fs[_0xba07('0x88')](path[_0xba07('0x83')](config[_0xba07('0x84')],'server/files/images/avatars/',_0x18124c['systemAvatar']))){_0x11ccba=path[_0xba07('0x83')](config['root'],_0xba07('0x8c'),_0x18124c[_0xba07('0x81')]);}}return _0x21cc76[_0xba07('0x8a')](_0x11ccba);}})[_0xba07('0x5e')](handleError(_0x21cc76,null));};function checkWebsiteInterval(_0x876e94){var _0xa07d17=_0x876e94[_0xba07('0x92')];if(!_0xa07d17){return Promise[_0xba07('0x93')](_0x876e94);}var _0x4aadd0=_0x876e94[_0xba07('0x94')]||undefined;return _0xa07d17[_0xba07('0x95')](_0x4aadd0)[_0xba07('0x19')](function(_0x296d45){if(!_0x296d45){throw new APIOutOfIntervalError();}return _0x876e94;});}exports[_0xba07('0x96')]=function(_0x280eb7,_0x5e2010){var _0x4cdb66={'body':_0x280eb7['body'],'channel':_0xba07('0x97')};var _0x5da63e=[];var _0x4c344a=[];var _0x945390={};var _0x96805c=![];if(_0x280eb7[_0xba07('0x66')]['id']){delete _0x280eb7[_0xba07('0x66')]['id'];}if(_[_0xba07('0x87')](_0x280eb7[_0xba07('0x66')]['from'])){throw new APIBadRequestError(_0xba07('0x98'));}if(_[_0xba07('0x87')](_0x280eb7[_0xba07('0x66')][_0xba07('0x99')])){throw new APIBadRequestError(_0xba07('0x9a'));}if(_[_0xba07('0x9b')](_0x280eb7[_0xba07('0x66')][_0xba07('0x66')])){throw new APIBadRequestError(_0xba07('0x9c'));}var _0x5e6df4=_0x280eb7[_0xba07('0x66')][_0xba07('0x9d')]&&_0x280eb7[_0xba07('0x66')][_0xba07('0x3a')];return db[_0xba07('0x9e')]['describe']()[_0xba07('0x19')](function(_0xc0921f){if(!_0xc0921f){throw new Error(_0xba07('0x9f'));}_0x5da63e=Object[_0xba07('0x49')](_0xc0921f)['filter'](function(_0x18c91b){return![_0xba07('0xa0'),'updatedAt'][_0xba07('0xa1')](_0x18c91b);});_0x4c344a=Object[_0xba07('0x49')](_0xc0921f)['filter'](function(_0x53a29d){return![_0xba07('0xa0'),_0xba07('0xa2'),_0xba07('0xa3'),_0xba07('0xa4')][_0xba07('0xa1')](_0x53a29d);});if(!_['includes'](_0x4c344a,_0x280eb7[_0xba07('0x66')][_0xba07('0x99')])){throw new APIBadRequestError(_0xba07('0xa5')+_0x4c344a[_0xba07('0x83')](',\x20'));}_0x945390[_0x280eb7['body'][_0xba07('0x99')]]=_0x280eb7[_0xba07('0x66')][_0xba07('0xa6')];})[_0xba07('0x19')](function(){return db[_0xba07('0x5a')][_0xba07('0x63')]({'where':{'id':_0x280eb7['params']['id']},'include':[{'model':db[_0xba07('0xa7')],'as':_0xba07('0xa8'),'include':[{'model':db[_0xba07('0x9e')],'as':_0xba07('0xa9'),'where':_0x945390,'limit':0x1,'order':[[_0xba07('0xa2'),_0xba07('0xaa')]]}]},{'model':db[_0xba07('0xab')],'as':_0xba07('0xac')},{'model':db[_0xba07('0x92')],'as':_0xba07('0x92'),'include':[{'model':db['Interval'],'as':_0xba07('0xad'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xba07('0x19')](function(_0x553058){if(!_0x553058){throw new APINotFoundError(util['format'](_0xba07('0xae'),_0x280eb7[_0xba07('0x60')]['id']));}if(_0x5e6df4){return checkWebsiteInterval(_0x553058);}return _0x553058;})[_0xba07('0x19')](function(_0x5bb8f0){_0x4cdb66['account']=_0x5bb8f0;_0x4cdb66[_0xba07('0xaf')]=_[_0xba07('0xb0')](_0x5bb8f0[_0xba07('0xac')],[_0xba07('0xb1')],[_0xba07('0xb2')]);if(_0x4cdb66[_0xba07('0xb3')][_0xba07('0xac')]){delete _0x4cdb66[_0xba07('0xb3')]['Applications'];}_0x4cdb66[_0xba07('0xb4')]=_0x5bb8f0[_0xba07('0xa8')]||{'id':_0x5bb8f0['ListId']};if(_0x4cdb66[_0xba07('0xb4')]&&_0x4cdb66['list'][_0xba07('0xa9')]['length']){return _0x4cdb66[_0xba07('0xb4')]['Contacts'][0x0];}var _0x7f57fb=_[_0xba07('0x15')](_0x280eb7[_0xba07('0x66')],{'firstName':_0x280eb7[_0xba07('0x66')][_0xba07('0xa6')],'ListId':_0x5bb8f0[_0xba07('0xa4')]});_0x7f57fb[_0x280eb7[_0xba07('0x66')]['mapKey']]=_0x280eb7[_0xba07('0x66')][_0xba07('0xa6')];return db['CmContact'][_0xba07('0x64')](_0x7f57fb,{'fields':_0x5da63e,'raw':!![]});})[_0xba07('0x19')](function(_0x3b2174){_0x4cdb66[_0xba07('0xb5')]=_0x3b2174;var _0x1245b5=createInteractionObject(_0x280eb7[_0xba07('0x60')]['id'],_0x280eb7['body'],_0x280eb7[_0xba07('0xb6')],_0x3b2174);var _0x5d994={'ChatWebsiteId':_0x280eb7[_0xba07('0x60')]['id']};if(_0x280eb7[_0xba07('0x66')]['threadId']){_0x5d994[_0xba07('0xb7')]=_0x280eb7[_0xba07('0x66')][_0xba07('0xb7')];_0x5d994['closed']=![];return db[_0xba07('0xb8')][_0xba07('0x63')]({'where':_0x5d994})[_0xba07('0x19')](function(_0x438f8d){var _0x307f98=_0x280eb7[_0xba07('0x66')][_0xba07('0x9d')]&&_0x280eb7[_0xba07('0x66')][_0xba07('0x3a')];if(_0x438f8d){_0x96805c=!![];return _0x438f8d;}else if(!_0x307f98&&_0x438f8d&&_0x438f8d[_0xba07('0xb9')]){throw new APIConflictError(_0xba07('0xba'));}_0x1245b5[_0xba07('0xb7')]=_0x280eb7[_0xba07('0x66')][_0xba07('0xb7')];_0x1245b5[_0xba07('0xbb')]=_0x280eb7[_0xba07('0x66')][_0xba07('0xbb')];return db['ChatInteraction'][_0xba07('0x64')](_0x1245b5);});}_0x5d994[_0xba07('0xbc')]=_0x3b2174['id'];if(_0x280eb7[_0xba07('0x66')]['interaction']&&_0x280eb7[_0xba07('0x66')]['interaction']['id']){_0x5d994['id']=_0x280eb7['body'][_0xba07('0xbd')]['id'];return db['ChatInteraction'][_0xba07('0x63')]({'where':_0x5d994})['then'](function(_0x58294d){var _0x402694=_0x280eb7[_0xba07('0x66')][_0xba07('0x9d')]&&_0x280eb7[_0xba07('0x66')][_0xba07('0x3a')];if(!_0x402694&&_0x58294d&&_0x58294d[_0xba07('0xb9')]){throw new APIConflictError(_0xba07('0xba'));}else if(_0x58294d){_0x96805c=!![];return _0x58294d;}else{return db[_0xba07('0xb8')][_0xba07('0x64')](_0x1245b5);}});}return db[_0xba07('0xb8')]['create'](_0x1245b5);})[_0xba07('0x19')](function(_0x4a8da1){if(!_0x96805c){return _0x4a8da1;}var _0xb15eb8={'from':(_0x4cdb66[_0xba07('0xb5')][_0xba07('0xbe')]||'')+'\x20'+(_0x4cdb66[_0xba07('0xb5')][_0xba07('0x38')]||'')};if(_0x280eb7['body'][_0xba07('0xb7')]&&_0x280eb7[_0xba07('0x66')]['messageId']&&_0x280eb7[_0xba07('0x66')][_0xba07('0xb7')]!=_0x280eb7['body'][_0xba07('0xbf')]){_0xb15eb8[_0xba07('0xb7')]=_0x280eb7['body'][_0xba07('0xbf')];}return _0x4a8da1[_0xba07('0x2c')](_0xb15eb8);})['then'](function(_0x24e163){_0x4cdb66[_0xba07('0xbd')]=_0x24e163['get']({'plain':!![]});_0x4cdb66[_0xba07('0xbd')][_0xba07('0xc0')]=!_0x96805c;if(_0x4cdb66[_0xba07('0xbd')][_0xba07('0xc0')]){if(_0x4cdb66[_0xba07('0xb3')][_0xba07('0xc1')]){_0x4cdb66['applications'][_0xba07('0xc2')]({'id':0x0,'priority':_0x4cdb66[_0xba07('0xaf')][_0xba07('0x4f')]+0x1,'app':_0xba07('0xc3'),'appdata':'unmanaged','interval':_0xba07('0xc4')});}}return db[_0xba07('0xc5')][_0xba07('0x64')]({'body':_0x280eb7['body']['body'],'ChatWebsiteId':_0x280eb7[_0xba07('0x60')]['id'],'ChatInteractionId':_0x24e163['id'],'direction':'in','ContactId':_0x4cdb66[_0xba07('0xb5')]['id'],'AttachmentId':_0x280eb7[_0xba07('0x66')]['AttachmentId']});})[_0xba07('0x19')](function(_0x2518da){_0x4cdb66[_0xba07('0x21')]=_0x2518da;if(!_0x4cdb66['interaction'][_0xba07('0xc6')]){return;}return db['User']['find']({'attributes':['id',_0xba07('0x31')],'where':{'id':_0x4cdb66[_0xba07('0xbd')][_0xba07('0xc6')]}});})[_0xba07('0x19')](function(_0x2572aa){if(_0x2572aa){_0x4cdb66[_0xba07('0xaf')]['unshift']({'id':0x0,'priority':0x0,'app':_0xba07('0xc7'),'appdata':_0x2572aa['name']+','+(_0x4cdb66[_0xba07('0xb3')][_0xba07('0xc8')]||0xa),'interval':_0xba07('0xc4')});_0x4cdb66[_0xba07('0xc9')]=!![];}if(!_0x4cdb66[_0xba07('0xbd')][_0xba07('0xca')]){return;}return db[_0xba07('0xcb')][_0xba07('0x63')]({'attributes':['id',_0xba07('0x31')],'where':{'id':_0x4cdb66[_0xba07('0xbd')][_0xba07('0xca')]}});})[_0xba07('0x19')](function(_0x17505c){if(_0x17505c){_0x4cdb66[_0xba07('0xaf')][_0xba07('0xcc')]({'id':0x0,'priority':0x1,'app':_0xba07('0xcd'),'appdata':_0x17505c['name']+','+(_0x4cdb66['account'][_0xba07('0xce')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xba07('0xcf'),_0xba07('0xd0'),_0x4cdb66);})[_0xba07('0x19')](function(_0x382e56){respondWithRpcPromise('EventManager',_0xba07('0xd1'),{'event':_0xba07('0x96'),'message':_0x382e56},client9002);return _0x382e56;})[_0xba07('0x19')](respondWithResult(_0x5e2010,null))[_0xba07('0x5e')](APIHandleError(_0x5e2010));};exports['offline']=function(_0x2e7098,_0x5e7672){var _0x160a1c,_0x556e8d,_0x3059b2;var _0x1cbc88=[];var _0x237e9b={};var _0x16492c=_0x2e7098[_0xba07('0xd2')]||[];var _0x38e906=[];var _0xf3cbd8;return db[_0xba07('0x9e')]['describe']()['then'](function(_0x114ae2){if(!_0x114ae2){throw new db[(_0xba07('0xd3'))][(_0xba07('0xd4'))]('no\x20available\x20attributes');}_0x1cbc88=_[_0xba07('0xd5')](_[_0xba07('0x49')](_0x114ae2),['createdAt',_0xba07('0xa2'),_0xba07('0xa3'),_0xba07('0xa4')]);if(_0x2e7098[_0xba07('0x66')]['id']){delete _0x2e7098['body']['id'];}if(_[_0xba07('0x87')](_0x2e7098[_0xba07('0x66')][_0xba07('0xa6')])){throw _0x5e7672[_0xba07('0x29')](0x1f4)['send'](new db[(_0xba07('0xd3'))][(_0xba07('0xd4'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x2e7098[_0xba07('0x66')]['body'])||_0x2e7098[_0xba07('0x66')]['body']===''){throw _0x5e7672[_0xba07('0x29')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xba07('0xd6')));}if(_[_0xba07('0x87')](_0x2e7098[_0xba07('0x66')][_0xba07('0xd7')])){throw _0x5e7672[_0xba07('0x29')](0x1f4)[_0xba07('0x32')](new db[(_0xba07('0xd3'))][(_0xba07('0xd4'))](_0xba07('0xd8')+_0x1cbc88));}if(!_[_0xba07('0xa1')](_0x1cbc88,_0x2e7098[_0xba07('0x66')][_0xba07('0xd7')])){throw _0x5e7672[_0xba07('0x29')](0x1f4)[_0xba07('0x32')](new db['Sequelize'][(_0xba07('0xd4'))](_0xba07('0xd9')+_0x1cbc88));}_0x237e9b[_0x2e7098[_0xba07('0x66')][_0xba07('0xd7')]]=_0x2e7098[_0xba07('0x66')][_0xba07('0xa6')];})[_0xba07('0x19')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x2e7098[_0xba07('0x60')]['id']},'include':[{'model':db[_0xba07('0xa7')],'as':_0xba07('0xa8')},{'model':db[_0xba07('0xda')],'as':'MailAccount'}]});})[_0xba07('0x19')](handleEntityNotFound(_0x5e7672,null))['then'](function(_0x1a86fa){if(_0x1a86fa&&_0x1a86fa[_0xba07('0xa8')]){_0x556e8d=_0x1a86fa;var _0x230d4d=_[_0xba07('0x15')](_0x2e7098[_0xba07('0x66')],{'firstName':_0x2e7098['body'][_0xba07('0xa6')],'phone':_0x2e7098[_0xba07('0x66')]['from'],'ListId':_0x1a86fa[_0xba07('0xa4')]});_0x230d4d[_0x2e7098['body'][_0xba07('0xd7')]]=_0x2e7098[_0xba07('0x66')]['from'];return db[_0xba07('0x9e')][_0xba07('0xdb')]({'where':_0x237e9b,'defaults':_0x230d4d});}})[_0xba07('0xdc')](function(_0x4eec6f){if(_0x4eec6f){_0x3059b2=_0x4eec6f;var _0x27835d=fs[_0xba07('0xdd')](path['join'](config[_0xba07('0x84')],_0xba07('0xde')),_0xba07('0xdf'));var _0x12048a=ejs[_0xba07('0xe0')](_0x27835d,{'body':_[_0xba07('0xe1')](_0x2e7098[_0xba07('0x66')]['body']),'bodyTitle':_0x556e8d[_0xba07('0xe2')]});return db[_0xba07('0xe3')][_0xba07('0x64')]({'body':_0x12048a,'plainBody':htmlToText[_0xba07('0xe4')](_0x12048a),'ContactId':_0x4eec6f['id'],'ChatWebsiteId':_0x556e8d['id']});}})[_0xba07('0x19')](function(_0x314d78){_0xf3cbd8=_0x314d78;if(_0x16492c[_0xba07('0x4f')]){var _0x11bac4=_0x16492c[_0xba07('0x46')](function(_0x44e55d){return{'name':_0x44e55d[_0xba07('0xe5')],'basename':_0x44e55d['filename'],'type':_0x44e55d[_0xba07('0xe6')],'ChatOfflineMessageId':_0x314d78['id']};});_0x38e906=_0x11bac4[_0xba07('0x46')](_0x2dde93=>{var _0x5946ec={'filename':_0x2dde93[_0xba07('0x31')],'path':path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0xe7'),'files',_0xba07('0xe8'),_0xba07('0xe9'),_0x2dde93[_0xba07('0xea')])};return _0x5946ec;});if(!_0x556e8d['openNewInteraction']){return db[_0xba07('0xeb')][_0xba07('0xec')](function(_0x1c61d2){return db[_0xba07('0xed')]['bulkCreate'](_0x11bac4,{'transaction':_0x1c61d2});});}}})['then'](function(){if(_0xf3cbd8){_0x160a1c=_0xf3cbd8;return db[_0xba07('0xda')][_0xba07('0x77')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xba07('0xee')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xba07('0x19')](function(_0x49547b){if(_0x49547b&&_0x49547b[_0xba07('0xef')]&&_0x556e8d[_0xba07('0xf0')]&&_0x556e8d[_0xba07('0xf1')]){var _0x292a9a=_0x49547b['getSmtpOptions']();return respondWithRpcPromise(_0xba07('0xf2'),'sendMail',{'account':_0x292a9a,'message':{'from':util[_0xba07('0x3d')]('\x22%s\x22\x20<%s>',_0x49547b[_0xba07('0x31')],_0x49547b[_0xba07('0xf3')]||_0x49547b[_0xba07('0xef')][_0xba07('0x69')]),'to':_0x556e8d[_0xba07('0xf1')],'subject':_0x556e8d['offlineMessageSubject'],'html':_0x160a1c[_0xba07('0x66')],'attachments':_0x38e906}},client9003)[_0xba07('0x19')](function(){return _0x160a1c;})[_0xba07('0x5e')](function(_0x5f1c8e){logger[_0xba07('0x1f')](_0x5f1c8e);});}})['then'](function(){if(_0x556e8d&&_0x556e8d['openNewInteraction']&&_0x556e8d['MailAccountId']){var _0x44bca6=[];if(_0x16492c[_0xba07('0x4f')]){_0x44bca6=_0x16492c['map'](function(_0x4b5abf){return{'name':_0x4b5abf[_0xba07('0xe5')],'basename':_0x4b5abf[_0xba07('0x7d')],'type':_0x4b5abf[_0xba07('0xe6')],'ChatOfflineMessageId':_0xf3cbd8['id']};});}var _0x5d790a;if(!_[_0xba07('0x87')](_0x556e8d[_0xba07('0xf4')])){var _0x275303=_[_0xba07('0x46')](_0x2e7098[_0xba07('0x66')],function(_0x576056){return _0x576056;});var _0x35035e=_[_0xba07('0xf5')](_0x275303)[0x0];var _0x347cdf=_[_0xba07('0xf6')](_0x35035e,function(_0xc0871c){return _0xc0871c;});_0x5d790a=_0x347cdf[0x1][_0x556e8d['subjectOffline']];}var _0x407074={'from':_0x3059b2['email'],'firstName':_0x3059b2['firstName'],'lastName':_0x3059b2['lastName'],'mapKey':_0xba07('0xf3'),'message':{'from':_0x3059b2[_0xba07('0xf3')],'to':_0x556e8d['MailAccount'][_0xba07('0xf3')],'cc':'','subject':_['isNil'](_0x5d790a)?_0x556e8d[_0xba07('0xf7')]:_0x5d790a,'messageId':'','sentAt':new Date(),'attach':_0x44bca6['length'],'attachments':_0x44bca6,'originChannel':'Chat','ChatWebsiteId':_0x556e8d['id'],'ChatOfflineMessageId':_0x160a1c['id'],'originTo':_0x556e8d['MailAccount'][_0xba07('0xf3')]},'body':_0x160a1c[_0xba07('0x66')]};var _0x865b32={'account':{'id':_0x556e8d[_0xba07('0xf8')]},'body':_0x407074,'log':_0xba07('0xf9')};return respondWithRpcPromise(_0xba07('0xf9'),_0xba07('0xfa'),_0x865b32,client9001)[_0xba07('0x19')](function(){return _0x160a1c;})['catch'](function(_0x4c0824){logger[_0xba07('0x1f')](_0x4c0824);});}return;})[_0xba07('0x19')](function(){if(_0x160a1c){return _0x160a1c;}})[_0xba07('0x19')](respondWithResult(_0x5e7672,null))['catch'](function(){for(var _0x2645ea of _0x16492c){var _0x1bc8a9=path[_0xba07('0x83')](config[_0xba07('0x84')],'server',_0xba07('0xd2'),'attachments',_0xba07('0xe9'),_0x2645ea['filename']);fs_extra[_0xba07('0xfb')](_0x1bc8a9)['catch'](function(_0x5340c0){logger[_0xba07('0x1f')]('Could\x20not\x20remove\x20attachment\x20file',_0x1bc8a9,_0x5340c0);});}});};exports[_0xba07('0xfc')]=function(_0x567752,_0x404858){return db[_0xba07('0xb8')][_0xba07('0x63')]({'where':{'id':_0x567752['params']['id']}})['then'](handleEntityNotFound(_0x404858,null))['then'](function(_0x3fd17c){if(_0x3fd17c){return _0x3fd17c[_0xba07('0xfc')](_0x567752[_0xba07('0x66')]['ids'],_[_0xba07('0xfd')](_0x567752['body'],[_0xba07('0x7a'),'id'])||{});}})[_0xba07('0x19')](respondWithResult(_0x404858,null))['catch'](handleError(_0x404858,null));};exports[_0xba07('0xfe')]=function(_0x52f6be,_0x5d5874){var _0x319705={'raw':![],'where':{}};var _0x264028={};var _0x4e2dfd={'count':0x0,'rows':[]};return db[_0xba07('0x5a')][_0xba07('0x77')]({'where':{'id':_0x52f6be[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x5d5874,null))[_0xba07('0x19')](function(_0x40596f){if(_0x40596f){_0x264028[_0xba07('0x4c')]=_[_0xba07('0x49')](db[_0xba07('0xb8')][_0xba07('0x61')]);_0x264028[_0xba07('0x48')]=_['keys'](_0x52f6be[_0xba07('0x48')]);_0x264028['filters']=_['intersection'](_0x264028[_0xba07('0x4c')],_0x264028[_0xba07('0x48')]);_0x319705[_0xba07('0x4e')]=_[_0xba07('0x4b')](_0x264028['model'],qs[_0xba07('0x4d')](_0x52f6be['query'][_0xba07('0x4d')]));_0x319705['attributes']=_0x319705['attributes']['length']?_0x319705[_0xba07('0x4e')]:_0x264028[_0xba07('0x4c')];if(!_0x52f6be['query'][_0xba07('0x50')]('nolimit')){_0x319705[_0xba07('0x26')]=qs[_0xba07('0x26')](_0x52f6be[_0xba07('0x48')][_0xba07('0x26')]);_0x319705['offset']=qs[_0xba07('0x25')](_0x52f6be['query'][_0xba07('0x25')]);}_0x319705['order']=qs[_0xba07('0x53')](_0x52f6be[_0xba07('0x48')][_0xba07('0x53')]);_0x319705['where']=qs[_0xba07('0x4a')](_[_0xba07('0x54')](_0x52f6be[_0xba07('0x48')],_0x264028[_0xba07('0x4a')]));_0x319705['where'][_0xba07('0x73')]=_0x40596f['id'];if(_0x52f6be[_0xba07('0x48')][_0xba07('0x55')]){_0x319705[_0xba07('0x56')]=_[_0xba07('0x57')](_0x319705[_0xba07('0x56')],{'$or':_[_0xba07('0x46')](_0x319705[_0xba07('0x4e')],function(_0x23df61){var _0xbad9bf={};_0xbad9bf[_0x23df61]={'$like':'%'+_0x52f6be['query'][_0xba07('0x55')]+'%'};return _0xbad9bf;})});}_0x319705=_[_0xba07('0x57')]({},_0x319705,_0x52f6be[_0xba07('0x59')]);return db[_0xba07('0xb8')]['count']({'where':_0x319705[_0xba07('0x56')]})[_0xba07('0x19')](function(_0x1fc52e){_0x4e2dfd[_0xba07('0x28')]=_0x1fc52e;if(_0x52f6be[_0xba07('0x48')][_0xba07('0x62')]){_0x319705[_0xba07('0x5b')]=[{'model':db[_0xba07('0x9e')],'as':'Contact','required':![]},{'model':db[_0xba07('0xff')],'as':_0xba07('0x100'),'attributes':[_0xba07('0x31'),_0xba07('0x101'),_0xba07('0x102')],'required':![]},{'model':db[_0xba07('0x103')],'as':_0xba07('0x104'),'attributes':['id',_0xba07('0x31'),_0xba07('0x105')],'where':_0x52f6be[_0xba07('0x48')][_0xba07('0x106')]?{'id':_0x52f6be[_0xba07('0x48')][_0xba07('0x106')]}:undefined,'required':_0x52f6be[_0xba07('0x48')][_0xba07('0x106')]?!![]:![]}];}return db[_0xba07('0xb8')][_0xba07('0x5c')](_0x319705);})[_0xba07('0x19')](function(_0x16886c){_0x4e2dfd[_0xba07('0x5d')]=_0x16886c;return _0x4e2dfd;});}})[_0xba07('0x19')](respondWithFilteredResult(_0x5d5874,_0x319705))[_0xba07('0x5e')](handleError(_0x5d5874,null));};exports[_0xba07('0x107')]=function(_0x5cdddf,_0x1909f5){var _0x33221c=0x0;var _0x11d1f3=0x0;var _0x105485=![];var _0x38098d;var _0x27698c;return db[_0xba07('0x5a')][_0xba07('0x63')]({'where':{'id':_0x5cdddf[_0xba07('0x60')]['id']},'include':[{'model':db[_0xba07('0x92')],'as':_0xba07('0x92'),'include':[{'model':db[_0xba07('0x92')],'as':_0xba07('0xad'),'attributes':['id',_0xba07('0x108')]}]}]})[_0xba07('0x19')](handleEntityNotFound(_0x1909f5,null))[_0xba07('0x19')](function(_0x8ea735){if(_0x8ea735){_0x38098d=_0x8ea735;return _0x8ea735[_0xba07('0x109')]({'raw':!![]});}})[_0xba07('0x19')](function(_0x3668f5){if(_0x38098d){if(_0x3668f5){_0x27698c=_0x3668f5;}}return require(_0xba07('0x85'))[_0xba07('0x86')]();})[_0xba07('0x19')](function(_0x2a749f){if(_0x2a749f){_0x11d1f3=_0x2a749f['virtual'];_0x105485=_0x2a749f[_0xba07('0x10a')];}})[_0xba07('0x19')](function(){return db[_0xba07('0xb8')][_0xba07('0x28')]({'where':{'closed':![]}});})['then'](function(_0x499aa4){_0x33221c=_0x499aa4;if(_0x11d1f3&&_0x499aa4>_0x11d1f3){return db[_0xba07('0x10b')]['findOne']({'where':{'id':0x1}})[_0xba07('0x19')](function(_0x3a7628){if(_0x3a7628){_0x3a7628[_0xba07('0x10c')](_0xba07('0x10d'));}});}})[_0xba07('0x19')](function(){var _0x14f34f=_0x38098d['Interval'];var _0x1b3e66=_0x38098d[_0xba07('0x94')]||undefined;return _0x14f34f?_0x14f34f[_0xba07('0x95')](_0x1b3e66):!![];})[_0xba07('0x19')](function(_0x276e84){var _0x21541b=fs[_0xba07('0xdd')](path[_0xba07('0x83')](config[_0xba07('0x84')],_0xba07('0x10e')),'utf8');var _0x7cc80b=_0xba07('0x10f');var _0x2e46dc=![];try{const _0x23875d=new URL(_0x38098d[_0xba07('0x67')]);_0x38098d['address']=_0x23875d[_0xba07('0x110')];}catch(_0x469799){}var _0x224091;if(_0x5cdddf[_0xba07('0xb6')][_0xba07('0x3a')]){_0x5cdddf[_0xba07('0xb6')][_0xba07('0x3a')]=_0x5cdddf['headers'][_0xba07('0x3a')][_0xba07('0x111')](/\/$/,'');_0x224091=wildcardUtils[_0xba07('0x112')](_0x38098d[_0xba07('0x67')],_0x5cdddf[_0xba07('0xb6')]['referer']);}else{_0x5cdddf[_0xba07('0xb6')][_0xba07('0x3a')]=_0x38098d['address'];_0x224091=!![];}var _0x25576e={'chatVersion':_0x7cc80b,'chatWebsiteAddressOrigin':_0x224091?_0x5cdddf[_0xba07('0xb6')]['referer']:_0x38098d[_0xba07('0x67')],'remote':_0x38098d[_0xba07('0x113')],'query':querystring[_0xba07('0x1e')](_[_0xba07('0x57')](_0x38098d['get']({'plain':!![]}),{'customerIp':_0x5cdddf[_0xba07('0xb6')]['x-forwarded-for']||_0x5cdddf['headers'][_0xba07('0x114')]||_0x5cdddf[_0xba07('0x115')][_0xba07('0x116')]||_0x5cdddf['ip'],'referer':_0x5cdddf[_0xba07('0xb6')][_0xba07('0x3a')],'openedInteractions':_0x33221c,'maxInteractions':_0x11d1f3,'virtual':_0x105485[_0xba07('0x117')],'online':_0x276e84,'custom':_0x105485,'address':_0x224091?_0x5cdddf[_0xba07('0xb6')]['referer']:null}))['replace'](/'/g,'\x5c\x27')};_0x1909f5[_0xba07('0x32')](ejs[_0xba07('0xe0')](Mustache[_0xba07('0xe0')](_0x21541b,_0x25576e),{'proactiveActions':_0x27698c,'alignment':_0x38098d[_0xba07('0x118')],'verticalAlignment':_0x38098d['verticalAlignment'],'div_color':_0x38098d[_0xba07('0x105')],'labelText':_0x38098d['labelText'],'text_color':_0x38098d[_0xba07('0x119')],'text_button_color':_0x38098d['textButtonColor'],'button_color':_0x38098d['color_button'],'background_color':_0x38098d[_0xba07('0x11a')],'hideWhenOffline':_0x38098d['hideWhenOffline'],'intervalId':_0x38098d[_0xba07('0x11b')],'isDevelopment':_0x2e46dc,'chatVersion':_0x7cc80b}));})[_0xba07('0x5e')](handleError(_0x1909f5,null));};exports[_0xba07('0x11c')]=function(_0x5394c1,_0x7f3bcd){var _0x165091=_0x5394c1[_0xba07('0x60')]['id'];var _0x2e4354=_0x5394c1['body'];var _0x2fe188=0xc8;var _0x45ccbc=null;return db[_0xba07('0xeb')][_0xba07('0xec')]({'isolationLevel':db[_0xba07('0xeb')][_0xba07('0x11d')][_0xba07('0x11e')][_0xba07('0x11f')]},function(_0xd8a460){return db[_0xba07('0x5a')][_0xba07('0x77')]({'where':{'id':_0x165091},'transaction':_0xd8a460})[_0xba07('0x19')](function(_0x3c3071){if(_0x3c3071){return db[_0xba07('0xab')][_0xba07('0x2d')]({'where':{'ChatWebsiteId':_0x165091},'transaction':_0xd8a460})[_0xba07('0x19')](function(){var _0x1ec2ae=_[_0xba07('0x46')](_0x2e4354,function(_0x466e0e){_0x466e0e[_0xba07('0x73')]=_0x165091;return _0x466e0e;});return db[_0xba07('0xab')][_0xba07('0x120')](_0x1ec2ae,{'transaction':_0xd8a460});});}else{_0x2fe188=0x194;_0x45ccbc=[];}});})[_0xba07('0x19')](function(){if(_0x2fe188!==0x194){return db['ChatApplication'][_0xba07('0x121')]({'where':{'ChatWebsiteId':_0x165091},'order':_0xba07('0xb1')})[_0xba07('0x19')](function(_0x48501f){_0x45ccbc=_0x48501f;});}})['catch'](function(_0x24c539){_0x2fe188=0x1f4;logger[_0xba07('0x1f')](_0x24c539[_0xba07('0x122')]);if(_0x24c539['name']){delete _0x24c539[_0xba07('0x31')];}_0x45ccbc=_0x24c539;})[_0xba07('0x123')](function(){if(_0x45ccbc===null){_0x7f3bcd['sendStatus'](_0x2fe188);}else{if(_0x2fe188===0x1f4){_0x7f3bcd[_0xba07('0x29')](_0x2fe188)[_0xba07('0x32')](_0x45ccbc);}else{_0x7f3bcd[_0xba07('0x29')](_0x2fe188)['json'](_0x45ccbc);}}});};exports[_0xba07('0x124')]=function(_0x34057b,_0x2d7f0d){var _0x1179ea={};var _0x494c39={};var _0x5cc231;var _0x5082a9;return db['ChatWebsite'][_0xba07('0x77')]({'where':{'id':_0x34057b['params']['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x2d7f0d,null))[_0xba07('0x19')](function(_0x413508){if(_0x413508){_0x5cc231=_0x413508;_0x494c39[_0xba07('0x4c')]=_[_0xba07('0x49')](db[_0xba07('0xab')][_0xba07('0x61')]);_0x494c39['query']=_[_0xba07('0x49')](_0x34057b[_0xba07('0x48')]);_0x494c39['filters']=_[_0xba07('0x4b')](_0x494c39[_0xba07('0x4c')],_0x494c39[_0xba07('0x48')]);_0x1179ea['attributes']=_['intersection'](_0x494c39['model'],qs[_0xba07('0x4d')](_0x34057b[_0xba07('0x48')][_0xba07('0x4d')]));_0x1179ea['attributes']=_0x1179ea['attributes'][_0xba07('0x4f')]?_0x1179ea[_0xba07('0x4e')]:_0x494c39[_0xba07('0x4c')];_0x1179ea['order']=qs[_0xba07('0x53')](_0x34057b[_0xba07('0x48')][_0xba07('0x53')]);_0x1179ea['where']=qs[_0xba07('0x4a')](_['pick'](_0x34057b[_0xba07('0x48')],_0x494c39[_0xba07('0x4a')]));if(_0x34057b['query'][_0xba07('0x55')]){_0x1179ea[_0xba07('0x56')]=_[_0xba07('0x57')](_0x1179ea[_0xba07('0x56')],{'$or':_[_0xba07('0x46')](_0x1179ea[_0xba07('0x4e')],function(_0x26481f){var _0x207c53={};_0x207c53[_0x26481f]={'$like':'%'+_0x34057b['query'][_0xba07('0x55')]+'%'};return _0x207c53;})});}_0x1179ea=_[_0xba07('0x57')]({},_0x1179ea,_0x34057b[_0xba07('0x59')]);return _0x5cc231['getApplications'](_0x1179ea);}})[_0xba07('0x19')](function(_0x2bdd2c){if(_0x2bdd2c){_0x5082a9=_0x2bdd2c['length'];if(!_0x34057b[_0xba07('0x48')][_0xba07('0x50')]('nolimit')){_0x1179ea[_0xba07('0x26')]=qs[_0xba07('0x26')](_0x34057b[_0xba07('0x48')][_0xba07('0x26')]);_0x1179ea[_0xba07('0x25')]=qs[_0xba07('0x25')](_0x34057b[_0xba07('0x48')][_0xba07('0x25')]);}return _0x5cc231[_0xba07('0x124')](_0x1179ea);}})[_0xba07('0x19')](function(_0x5aaadd){if(_0x5aaadd){return _0x5aaadd?{'count':_0x5082a9,'rows':_0x5aaadd}:null;}})[_0xba07('0x19')](respondWithResult(_0x2d7f0d,null))[_0xba07('0x5e')](handleError(_0x2d7f0d,null));};exports['addProactiveActions']=function(_0x7ced8a,_0x4afddb){return db[_0xba07('0x125')][_0xba07('0x63')]({'where':{'id':_0x7ced8a[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x4afddb,null))[_0xba07('0x19')](function(_0x25cac7){if(_0x25cac7){return _0x25cac7[_0xba07('0x126')](_0x7ced8a['body'][_0xba07('0x7a')],_[_0xba07('0xfd')](_0x7ced8a[_0xba07('0x66')],['ids','id'])||{});}})[_0xba07('0x19')](respondWithResult(_0x4afddb,null))['catch'](handleError(_0x4afddb,null));};exports[_0xba07('0x109')]=function(_0x28ec50,_0x2760cb){var _0x2312ce={};var _0x1f76fc={};var _0x256e13;var _0x4d7a84;return db[_0xba07('0x5a')]['findOne']({'where':{'id':_0x28ec50[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x2760cb,null))['then'](function(_0x4f0f13){if(_0x4f0f13){_0x256e13=_0x4f0f13;_0x1f76fc[_0xba07('0x4c')]=_[_0xba07('0x49')](db[_0xba07('0x127')][_0xba07('0x61')]);_0x1f76fc['query']=_[_0xba07('0x49')](_0x28ec50[_0xba07('0x48')]);_0x1f76fc[_0xba07('0x4a')]=_['intersection'](_0x1f76fc['model'],_0x1f76fc['query']);_0x2312ce[_0xba07('0x4e')]=_['intersection'](_0x1f76fc[_0xba07('0x4c')],qs['fields'](_0x28ec50[_0xba07('0x48')][_0xba07('0x4d')]));_0x2312ce[_0xba07('0x4e')]=_0x2312ce[_0xba07('0x4e')][_0xba07('0x4f')]?_0x2312ce[_0xba07('0x4e')]:_0x1f76fc[_0xba07('0x4c')];_0x2312ce[_0xba07('0x52')]=qs[_0xba07('0x53')](_0x28ec50['query'][_0xba07('0x53')]);_0x2312ce['where']=qs[_0xba07('0x4a')](_[_0xba07('0x54')](_0x28ec50[_0xba07('0x48')],_0x1f76fc[_0xba07('0x4a')]));if(_0x28ec50[_0xba07('0x48')]['filter']){_0x2312ce[_0xba07('0x56')]=_['merge'](_0x2312ce[_0xba07('0x56')],{'$or':_[_0xba07('0x46')](_0x2312ce[_0xba07('0x4e')],function(_0x56f8aa){var _0x1c9c09={};_0x1c9c09[_0x56f8aa]={'$like':'%'+_0x28ec50['query'][_0xba07('0x55')]+'%'};return _0x1c9c09;})});}_0x2312ce=_[_0xba07('0x57')]({},_0x2312ce,_0x28ec50['options']);return _0x256e13[_0xba07('0x109')](_0x2312ce);}})[_0xba07('0x19')](function(_0x13a48e){if(_0x13a48e){_0x4d7a84=_0x13a48e[_0xba07('0x4f')];if(!_0x28ec50['query'][_0xba07('0x50')](_0xba07('0x51'))){_0x2312ce[_0xba07('0x26')]=qs[_0xba07('0x26')](_0x28ec50[_0xba07('0x48')][_0xba07('0x26')]);_0x2312ce[_0xba07('0x25')]=qs[_0xba07('0x25')](_0x28ec50['query'][_0xba07('0x25')]);}return _0x256e13[_0xba07('0x109')](_0x2312ce);}})[_0xba07('0x19')](function(_0x2acce6){if(_0x2acce6){return _0x2acce6?{'count':_0x4d7a84,'rows':_0x2acce6}:null;}})['then'](respondWithResult(_0x2760cb,null))[_0xba07('0x5e')](handleError(_0x2760cb,null));};exports[_0xba07('0x128')]=function(_0x1464e2,_0x40b008){var _0x23c12b=_0x1464e2[_0xba07('0x48')]['online']==='false'?_0xba07('0x129'):'onlineForm';return db[_0xba07('0x5a')][_0xba07('0x63')]({'attributes':['id',_0x23c12b],'where':{'id':_0x1464e2['params']['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x40b008,null))[_0xba07('0x19')](function(_0x4e0bea){if(_0x4e0bea){var _0x2edb0c=_0x4e0bea[_0x23c12b];var _0x560865=_0x2edb0c&&_0x2edb0c[_0xba07('0x12a')]?_0x2edb0c['items']:[];_0x40b008[_0xba07('0x32')]({'fromKey':_[_0xba07('0x87')](_0x2edb0c[_0xba07('0x12b')])?undefined:_0x2edb0c[_0xba07('0x12b')],'count':_0x560865[_0xba07('0x4f')],'rows':_0x560865});}})[_0xba07('0x5e')](handleError(_0x40b008,null));};exports[_0xba07('0x12c')]=function(_0x3b670e,_0x5668bb){var _0xbb4061={'raw':![],'where':{}};var _0x41b971={};var _0x37f1ba={'count':0x0,'rows':[]};return db[_0xba07('0x5a')]['findOne']({'where':{'id':_0x3b670e[_0xba07('0x60')]['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x5668bb,null))[_0xba07('0x19')](function(_0x479ede){if(_0x479ede){_0x41b971[_0xba07('0x4c')]=_[_0xba07('0x49')](db['ChatOfflineMessage'][_0xba07('0x61')]);_0x41b971[_0xba07('0x48')]=_[_0xba07('0x49')](_0x3b670e[_0xba07('0x48')]);_0x41b971[_0xba07('0x4a')]=_[_0xba07('0x4b')](_0x41b971[_0xba07('0x4c')],_0x41b971[_0xba07('0x48')]);_0xbb4061[_0xba07('0x4e')]=_['intersection'](_0x41b971['model'],qs['fields'](_0x3b670e['query'][_0xba07('0x4d')]));_0xbb4061[_0xba07('0x4e')]=_0xbb4061[_0xba07('0x4e')][_0xba07('0x4f')]?_0xbb4061['attributes']:_0x41b971['model'];if(!_0x3b670e[_0xba07('0x48')][_0xba07('0x50')]('nolimit')){_0xbb4061['limit']=qs[_0xba07('0x26')](_0x3b670e['query']['limit']);_0xbb4061[_0xba07('0x25')]=qs['offset'](_0x3b670e[_0xba07('0x48')]['offset']);}_0xbb4061[_0xba07('0x52')]=qs[_0xba07('0x53')](_0x3b670e['query'][_0xba07('0x53')]);_0xbb4061[_0xba07('0x56')]=qs[_0xba07('0x4a')](_[_0xba07('0x54')](_0x3b670e[_0xba07('0x48')],_0x41b971[_0xba07('0x4a')]));_0xbb4061['where'][_0xba07('0x73')]=_0x479ede['id'];if(_0x3b670e[_0xba07('0x48')][_0xba07('0x55')]){_0xbb4061['where']=_['merge'](_0xbb4061[_0xba07('0x56')],{'$or':_['map'](_0xbb4061['attributes'],function(_0x364f7d){var _0x8faa04={};_0x8faa04[_0x364f7d]={'$like':'%'+_0x3b670e[_0xba07('0x48')][_0xba07('0x55')]+'%'};return _0x8faa04;})});}_0xbb4061=_['merge']({},_0xbb4061,_0x3b670e['options']);return db[_0xba07('0xe3')]['count']({'where':_0xbb4061['where']})[_0xba07('0x19')](function(_0x461170){_0x37f1ba[_0xba07('0x28')]=_0x461170;if(_0x3b670e[_0xba07('0x48')][_0xba07('0x62')]){_0xbb4061['include']=[{'all':!![]}];}else{_0xbb4061[_0xba07('0x5b')]=[{'model':db[_0xba07('0x9e')],'as':_0xba07('0x12d'),'required':![]},{'model':db['Attachment'],'as':_0xba07('0x12e'),'required':![]}];}return db[_0xba07('0xe3')][_0xba07('0x5c')](_0xbb4061);})[_0xba07('0x19')](function(_0xefad7f){_0x37f1ba[_0xba07('0x5d')]=_0xefad7f;return _0x37f1ba;});}})['then'](respondWithFilteredResult(_0x5668bb,_0xbb4061))[_0xba07('0x5e')](handleError(_0x5668bb,null));};exports['addAgents']=function(_0x38c36e,_0x3b5fed){return db['ChatWebsite']['find']({'where':{'id':_0x38c36e['params']['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x3b5fed,null))[_0xba07('0x19')](function(_0x2fb9e2){if(_0x2fb9e2){return _0x2fb9e2[_0xba07('0x12f')](_0x38c36e[_0xba07('0x66')][_0xba07('0x7a')],_[_0xba07('0xfd')](_0x38c36e[_0xba07('0x66')],['ids','id'])||{})[_0xba07('0xdc')](function(_0x58fa37){for(var _0x529d68=0x0;_0x529d68<_0x38c36e[_0xba07('0x66')][_0xba07('0x7a')][_0xba07('0x4f')];_0x529d68+=0x1){socket['emit'](_0xba07('0x130'),{'UserId':Number(_0x38c36e[_0xba07('0x66')]['ids'][_0x529d68]),'ChatWebsiteId':Number(_0x38c36e['params']['id'])});}return _0x58fa37;});}})[_0xba07('0x19')](respondWithResult(_0x3b5fed,null))[_0xba07('0x5e')](handleError(_0x3b5fed,null));};exports[_0xba07('0x131')]=function(_0x261247,_0x146b9b){return db['ChatWebsite'][_0xba07('0x63')]({'where':{'id':_0x261247['params']['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x146b9b,null))[_0xba07('0x19')](function(_0x30b0e2){if(_0x30b0e2){return _0x30b0e2[_0xba07('0x131')](_0x261247[_0xba07('0x48')][_0xba07('0x7a')])[_0xba07('0x19')](function(){if(_[_0xba07('0x132')](_0x261247[_0xba07('0x48')]['ids'])){for(var _0x2a912c=0x0;_0x2a912c<_0x261247[_0xba07('0x48')][_0xba07('0x7a')]['length'];_0x2a912c+=0x1){socket[_0xba07('0x133')](_0xba07('0x134'),{'UserId':Number(_0x261247['query'][_0xba07('0x7a')][_0x2a912c]),'ChatWebsiteId':Number(_0x261247['params']['id'])});}}else{socket[_0xba07('0x133')](_0xba07('0x134'),{'UserId':Number(_0x261247[_0xba07('0x48')]['ids']),'ChatWebsiteId':Number(_0x261247['params']['id'])});}});}})['then'](respondWithStatusCode(_0x146b9b,null))[_0xba07('0x5e')](handleError(_0x146b9b,null));};exports[_0xba07('0x135')]=function(_0x2af89a,_0x2e7122){var _0x31a44c={};var _0x2aca40={};var _0x5c5000;var _0x4f9219;return db[_0xba07('0x5a')]['findOne']({'where':{'id':_0x2af89a['params']['id']}})[_0xba07('0x19')](handleEntityNotFound(_0x2e7122,null))[_0xba07('0x19')](function(_0x1f0c3e){if(_0x1f0c3e){_0x5c5000=_0x1f0c3e;_0x2aca40[_0xba07('0x4c')]=_['keys'](db[_0xba07('0xff')]['rawAttributes']);_0x2aca40[_0xba07('0x48')]=_[_0xba07('0x49')](_0x2af89a[_0xba07('0x48')]);_0x2aca40[_0xba07('0x4a')]=_[_0xba07('0x4b')](_0x2aca40['model'],_0x2aca40[_0xba07('0x48')]);_0x31a44c['attributes']=_[_0xba07('0x4b')](_0x2aca40[_0xba07('0x4c')],qs[_0xba07('0x4d')](_0x2af89a['query']['fields']));_0x31a44c[_0xba07('0x4e')]=_0x31a44c[_0xba07('0x4e')][_0xba07('0x4f')]?_0x31a44c['attributes']:_0x2aca40[_0xba07('0x4c')];_0x31a44c['order']=qs[_0xba07('0x53')](_0x2af89a[_0xba07('0x48')]['sort']);_0x31a44c[_0xba07('0x56')]=qs[_0xba07('0x4a')](_[_0xba07('0x54')](_0x2af89a['query'],_0x2aca40[_0xba07('0x4a')]));if(_0x2af89a[_0xba07('0x48')][_0xba07('0x55')]){_0x31a44c[_0xba07('0x56')]=_[_0xba07('0x57')](_0x31a44c['where'],{'$or':_[_0xba07('0x46')](_0x31a44c['attributes'],function(_0x3ea5f2){var _0x2ad34b={};_0x2ad34b[_0x3ea5f2]={'$like':'%'+_0x2af89a[_0xba07('0x48')]['filter']+'%'};return _0x2ad34b;})});}_0x31a44c=_['merge']({},_0x31a44c,_0x2af89a[_0xba07('0x59')]);return _0x5c5000['getAgents'](_0x31a44c);}})[_0xba07('0x19')](function(_0x56e83e){if(_0x56e83e){_0x4f9219=_0x56e83e['length'];if(!_0x2af89a[_0xba07('0x48')]['hasOwnProperty'](_0xba07('0x51'))){_0x31a44c['limit']=qs[_0xba07('0x26')](_0x2af89a[_0xba07('0x48')][_0xba07('0x26')]);_0x31a44c[_0xba07('0x25')]=qs[_0xba07('0x25')](_0x2af89a['query'][_0xba07('0x25')]);}return _0x5c5000[_0xba07('0x135')](_0x31a44c);}})[_0xba07('0x19')](function(_0x7ef306){if(_0x7ef306){return _0x7ef306?{'count':_0x4f9219,'rows':_0x7ef306}:null;}})[_0xba07('0x19')](respondWithResult(_0x2e7122,null))['catch'](handleError(_0x2e7122,null));}; \ No newline at end of file +var _0x800f=['Disposition','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','addAvatar','agentAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','getCustomerAvatar','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','from','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','CmContact','contact','threadId','closed','ChatInteraction','externalUrl','ContactId','interaction','Writing\x20on\x20closed\x20interaction','messageId','created','autoclose','push','unmanaged','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','offline','files','Sequelize','ValidationError','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','firstName','Chat','NotifyMailAccount','addInteraction','omit','getInteractions','findOne','includeAll','Owner','fullname','internal','Tag','Tags','tag','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','3.9.0','origin','headers','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','color','labelText','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','json','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../errors/api','APIBadRequestError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','http','client','request','then','info','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','status','end','offset','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','sendStatus','stack','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','format','%s\x20%s','name','unknown','device','model','vendor','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','intersection','find','create','testWildcardValidity','body','address','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','describe','addDisposition','ChatWebsiteId'];(function(_0x3360d5,_0x212ac0){var _0x51ebce=function(_0xdefe5d){while(--_0xdefe5d){_0x3360d5['push'](_0x3360d5['shift']());}};_0x51ebce(++_0x212ac0);}(_0x800f,0xbe));var _0xf800=function(_0x22f331,_0x4e8aed){_0x22f331=_0x22f331-0x0;var _0x374774=_0x800f[_0x22f331];return _0x374774;};'use strict';var Mustache=require(_0xf800('0x0'));var util=require(_0xf800('0x1'));var path=require(_0xf800('0x2'));var ejs=require(_0xf800('0x3'));var fs=require('fs');var fs_extra=require(_0xf800('0x4'));var _=require(_0xf800('0x5'));var querystring=require(_0xf800('0x6'));var htmlToText=require(_0xf800('0x7'));var Redis=require(_0xf800('0x8'));var jayson=require(_0xf800('0x9'));var qs=require(_0xf800('0xa'));var logger=require(_0xf800('0xb'))('api');var config=require('../../config/environment');var APIBadRequestError=require(_0xf800('0xc'))[_0xf800('0xd')];var APINotFoundError=require(_0xf800('0xc'))['APINotFoundError'];var APIOutOfIntervalError=require(_0xf800('0xc'))[_0xf800('0xe')];var APIHandleError=require(_0xf800('0xc'))[_0xf800('0xf')];var APIConflictError=require(_0xf800('0xc'))['APIConflictError'];var wildcardUtils=require(_0xf800('0x10'));var URL=require(_0xf800('0x11'))[_0xf800('0x12')];var db=require(_0xf800('0x13'))['db'];config['redis']=_[_0xf800('0x14')](config[_0xf800('0x15')],{'host':_0xf800('0x16'),'port':0x18eb});var socket=require(_0xf800('0x17'))(new Redis(config[_0xf800('0x15')]));require('./chatWebsite.socket')['register'](socket);var client=jayson['client'][_0xf800('0x18')]({'port':0x232c});var client9002=jayson[_0xf800('0x19')]['http']({'port':0x232a});var client9003=jayson[_0xf800('0x19')]['http']({'port':0x232b});var client9001=jayson[_0xf800('0x19')][_0xf800('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x51c4e5,_0x4d46dc,_0x473810,_0x16583a){return new Promise(function(_0x5adf1f,_0x109f26){var _0x47a8e4=_0x16583a||client;return _0x47a8e4[_0xf800('0x1a')](_0x51c4e5,_0x473810)[_0xf800('0x1b')](function(_0x5ba795){logger[_0xf800('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x4d46dc,_0xf800('0x1d'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4d46dc,_0xf800('0x1d'),JSON[_0xf800('0x1e')](_0x5ba795));if(_0x5ba795[_0xf800('0x1f')]){if(_0x5ba795[_0xf800('0x1f')][_0xf800('0x20')]===0x1f4){logger[_0xf800('0x1f')](_0xf800('0x21'),_0x4d46dc,_0x5ba795['error']['message']);return _0x109f26(_0x5ba795[_0xf800('0x1f')][_0xf800('0x22')]);}logger['error'](_0xf800('0x21'),_0x4d46dc,_0x5ba795[_0xf800('0x1f')][_0xf800('0x22')]);return _0x5adf1f(_0x5ba795[_0xf800('0x1f')][_0xf800('0x22')]);}else{logger[_0xf800('0x1c')](_0xf800('0x21'),_0x4d46dc,'request\x20sent');_0x5adf1f(_0x5ba795['result'][_0xf800('0x22')]);}})[_0xf800('0x23')](function(_0x2130f1){logger['error'](_0xf800('0x21'),_0x4d46dc,_0x2130f1);_0x109f26(_0x2130f1);});});}function respondWithStatusCode(_0x1e710,_0x56fbf2){_0x56fbf2=_0x56fbf2||0xcc;return function(_0x3eb397){if(_0x3eb397){return _0x1e710['sendStatus'](_0x56fbf2);}return _0x1e710[_0xf800('0x24')](_0x56fbf2)[_0xf800('0x25')]();};}function respondWithResult(_0x5dc60a,_0x8f5333){_0x8f5333=_0x8f5333||0xc8;return function(_0x12ebe6){if(_0x12ebe6){return _0x5dc60a[_0xf800('0x24')](_0x8f5333)['json'](_0x12ebe6);}};}function respondWithFilteredResult(_0x3f276e,_0x5c9daa){return function(_0x2bd036){if(_0x2bd036){var _0x2552e6=typeof _0x5c9daa[_0xf800('0x26')]==='undefined'&&typeof _0x5c9daa[_0xf800('0x27')]==='undefined';var _0xd0c95e=_0x2bd036['count'];var _0x236956=_0x2552e6?0x0:_0x5c9daa[_0xf800('0x26')];var _0x1bc27f=_0x2552e6?_0x2bd036[_0xf800('0x28')]:_0x5c9daa['offset']+_0x5c9daa[_0xf800('0x27')];var _0x2265ae;if(_0x1bc27f>=_0xd0c95e){_0x1bc27f=_0xd0c95e;_0x2265ae=0xc8;}else{_0x2265ae=0xce;}_0x3f276e[_0xf800('0x24')](_0x2265ae);return _0x3f276e[_0xf800('0x29')](_0xf800('0x2a'),_0x236956+'-'+_0x1bc27f+'/'+_0xd0c95e)['json'](_0x2bd036);}return null;};}function saveUpdates(_0x1fd9d1){return function(_0xc363db){if(_0xc363db){return _0xc363db[_0xf800('0x2b')](_0x1fd9d1)[_0xf800('0x1b')](function(_0x5ee718){return _0x5ee718;});}return null;};}function removeEntity(_0x5bdea7){return function(_0x174dd5){if(_0x174dd5){return _0x174dd5[_0xf800('0x2c')]()[_0xf800('0x1b')](function(){var _0x4685a1=_0x174dd5[_0xf800('0x2d')]({'plain':!![]});var _0x2e94f8=_0xf800('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e94f8,'resourceId':_0x4685a1['id']}})[_0xf800('0x1b')](function(){return _0x174dd5;});})[_0xf800('0x1b')](function(){_0x5bdea7[_0xf800('0x24')](0xcc)[_0xf800('0x25')]();});}};}function handleEntityNotFound(_0xb2fe71){return function(_0x1ab4ec){if(!_0x1ab4ec){_0xb2fe71[_0xf800('0x2f')](0x194);}return _0x1ab4ec;};}function handleError(_0xa4a3b2,_0x3eecd0){_0x3eecd0=_0x3eecd0||0x1f4;return function(_0x27f5ad){logger[_0xf800('0x1f')](_0x27f5ad[_0xf800('0x30')]);if(_0x27f5ad['name']){delete _0x27f5ad['name'];}_0xa4a3b2[_0xf800('0x24')](_0x3eecd0)[_0xf800('0x31')](_0x27f5ad);};}function createInteractionObject(_0x87d90e,_0x2fc47c,_0x4f8f9c,_0x21ad2c){var _0x5da614=require(_0xf800('0x32'));var _0x491772=new _0x5da614();var _0x3dd4c4=_0x491772['setUA'](_0x4f8f9c[_0xf800('0x33')])[_0xf800('0x34')]();var _0x54a251=_0x2fc47c[_0xf800('0x35')];if(_0x4f8f9c[_0xf800('0x36')]){_0x54a251=_0x4f8f9c[_0xf800('0x36')];}else if(_0x4f8f9c[_0xf800('0x37')]){_0x54a251=_[_0xf800('0x38')](_0x4f8f9c[_0xf800('0x37')][_0xf800('0x39')](','));}return{'ContactId':_0x21ad2c['id'],'ChatWebsiteId':_0x87d90e,'from':(_0x21ad2c['firstName']||'')+'\x20'+(_0x21ad2c[_0xf800('0x3a')]||''),'customerIp':_0x54a251,'customerPort':_0x4f8f9c[_0xf800('0x3b')]?_0x4f8f9c[_0xf800('0x3b')]:null,'referer':_0x2fc47c['referer'],'browserName':_0x3dd4c4[_0xf800('0x3c')]['name']&&_0x3dd4c4[_0xf800('0x3c')][_0xf800('0x3d')]?util[_0xf800('0x3e')](_0xf800('0x3f'),_0x3dd4c4[_0xf800('0x3c')][_0xf800('0x40')],_0x3dd4c4[_0xf800('0x3c')][_0xf800('0x3d')]):_0xf800('0x41'),'browserVersion':_0x3dd4c4[_0xf800('0x3c')][_0xf800('0x3d')]||_0xf800('0x41'),'osName':util['format']('%s\x20%s',_0x3dd4c4['os'][_0xf800('0x40')],_0x3dd4c4['os'][_0xf800('0x3d')]),'osVersion':_0x3dd4c4['os'][_0xf800('0x3d')],'deviceModel':_0x3dd4c4[_0xf800('0x42')][_0xf800('0x43')]&&_0x3dd4c4[_0xf800('0x42')][_0xf800('0x44')]?util['format']('%s\x20%s\x20%s',_0x3dd4c4[_0xf800('0x42')][_0xf800('0x43')],_0x3dd4c4[_0xf800('0x42')]['vendor'],_0x3dd4c4['device'][_0xf800('0x45')]):null,'deviceVendor':_0x3dd4c4[_0xf800('0x42')]['vendor'],'deviceType':_0x3dd4c4[_0xf800('0x42')][_0xf800('0x45')],'formData':JSON[_0xf800('0x1e')](_0x2fc47c)};}exports[_0xf800('0x46')]=function(_0x546dcc,_0x3f8c49){var _0x13b6b3={'include':[{'model':db[_0xf800('0x47')],'as':_0xf800('0x48')}]},_0x1cf6ed={},_0xfe29ea={'count':0x0,'rows':[]};var _0x24e41a=_[_0xf800('0x49')](db[_0xf800('0x4a')][_0xf800('0x4b')],function(_0x29a7ff){return{'name':_0x29a7ff[_0xf800('0x4c')],'type':_0x29a7ff[_0xf800('0x45')][_0xf800('0x4d')]};});_0x1cf6ed[_0xf800('0x43')]=_[_0xf800('0x49')](_0x24e41a,_0xf800('0x40'));_0x1cf6ed[_0xf800('0x4e')]=_[_0xf800('0x4f')](_0x546dcc[_0xf800('0x4e')]);_0x1cf6ed[_0xf800('0x50')]=_['intersection'](_0x1cf6ed[_0xf800('0x43')],_0x1cf6ed[_0xf800('0x4e')]);_0x13b6b3['attributes']=_['intersection'](_0x1cf6ed['model'],qs[_0xf800('0x51')](_0x546dcc[_0xf800('0x4e')][_0xf800('0x51')]));_0x13b6b3[_0xf800('0x52')]=_0x13b6b3[_0xf800('0x52')][_0xf800('0x53')]?_0x13b6b3[_0xf800('0x52')]:_0x1cf6ed[_0xf800('0x43')];if(!_0x546dcc[_0xf800('0x4e')][_0xf800('0x54')]('nolimit')){_0x13b6b3[_0xf800('0x27')]=qs[_0xf800('0x27')](_0x546dcc[_0xf800('0x4e')][_0xf800('0x27')]);_0x13b6b3[_0xf800('0x26')]=qs[_0xf800('0x26')](_0x546dcc[_0xf800('0x4e')][_0xf800('0x26')]);}_0x13b6b3[_0xf800('0x55')]=qs[_0xf800('0x56')](_0x546dcc['query'][_0xf800('0x56')]);_0x13b6b3[_0xf800('0x57')]=qs['filters'](_[_0xf800('0x58')](_0x546dcc[_0xf800('0x4e')],_0x1cf6ed[_0xf800('0x50')]),_0x24e41a);if(_0x546dcc[_0xf800('0x4e')][_0xf800('0x59')]){_0x13b6b3[_0xf800('0x57')]=_[_0xf800('0x5a')](_0x13b6b3[_0xf800('0x57')],{'$or':_[_0xf800('0x49')](_0x24e41a,function(_0x5122a2){if(_0x5122a2[_0xf800('0x45')]!==_0xf800('0x5b')){var _0x36e246={};_0x36e246[_0x5122a2[_0xf800('0x40')]]={'$like':'%'+_0x546dcc['query'][_0xf800('0x59')]+'%'};return _0x36e246;}})});}_0x13b6b3=_['merge']({},_0x13b6b3,_0x546dcc[_0xf800('0x5c')]);var _0x43beaa={'where':_0x13b6b3[_0xf800('0x57')]};return db[_0xf800('0x4a')][_0xf800('0x28')](_0x43beaa)[_0xf800('0x1b')](function(_0x3180b9){_0xfe29ea[_0xf800('0x28')]=_0x3180b9;if(_0x546dcc[_0xf800('0x4e')]['includeAll']){_0x13b6b3[_0xf800('0x5d')]=[{'all':!![]}];}return db['ChatWebsite'][_0xf800('0x5e')](_0x13b6b3);})[_0xf800('0x1b')](function(_0x1ab4c4){_0xfe29ea[_0xf800('0x5f')]=_0x1ab4c4;return _0xfe29ea;})[_0xf800('0x1b')](respondWithFilteredResult(_0x3f8c49,_0x13b6b3))[_0xf800('0x23')](handleError(_0x3f8c49,null));};exports[_0xf800('0x60')]=function(_0xdeaacb,_0x299f0a){var _0x2186f2={'raw':![],'where':{'id':_0xdeaacb[_0xf800('0x61')]['id']},'include':[{'model':db[_0xf800('0x47')],'as':'mandatoryDispositionPause'}]},_0x152bbf={};_0x152bbf[_0xf800('0x43')]=_[_0xf800('0x4f')](db[_0xf800('0x4a')][_0xf800('0x4b')]);_0x152bbf['query']=_[_0xf800('0x4f')](_0xdeaacb['query']);_0x152bbf['filters']=_[_0xf800('0x62')](_0x152bbf['model'],_0x152bbf[_0xf800('0x4e')]);_0x2186f2[_0xf800('0x52')]=_['intersection'](_0x152bbf['model'],qs[_0xf800('0x51')](_0xdeaacb[_0xf800('0x4e')][_0xf800('0x51')]));_0x2186f2[_0xf800('0x52')]=_0x2186f2['attributes'][_0xf800('0x53')]?_0x2186f2['attributes']:_0x152bbf[_0xf800('0x43')];if(_0xdeaacb[_0xf800('0x4e')]['includeAll']){_0x2186f2['include']=[{'all':!![]}];}_0x2186f2=_[_0xf800('0x5a')]({},_0x2186f2,_0xdeaacb[_0xf800('0x5c')]);return db[_0xf800('0x4a')][_0xf800('0x63')](_0x2186f2)[_0xf800('0x1b')](handleEntityNotFound(_0x299f0a,null))[_0xf800('0x1b')](respondWithResult(_0x299f0a,null))[_0xf800('0x23')](handleError(_0x299f0a,null));};exports[_0xf800('0x64')]=function(_0x1e48db,_0x21dd75){if(!wildcardUtils[_0xf800('0x65')](_0x1e48db[_0xf800('0x66')][_0xf800('0x67')])){return handleError(_0x21dd75,null)(new APIBadRequestError('\x22'+_0x1e48db[_0xf800('0x66')]['address']+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}return db[_0xf800('0x4a')]['create'](_0x1e48db[_0xf800('0x66')],{})['then'](function(_0x319823){var _0x2d67e1=_0x1e48db[_0xf800('0x68')][_0xf800('0x2d')]({'plain':!![]});if(!_0x2d67e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d67e1[_0xf800('0x69')]===_0xf800('0x68')){var _0x113203=_0x319823[_0xf800('0x2d')]({'plain':!![]});var _0xbff70d=_0xf800('0x2e');return db[_0xf800('0x6a')][_0xf800('0x63')]({'where':{'name':_0xbff70d,'userProfileId':_0x2d67e1[_0xf800('0x6b')]},'raw':!![]})[_0xf800('0x1b')](function(_0x3f8f78){if(_0x3f8f78&&_0x3f8f78[_0xf800('0x6c')]===0x0){return db[_0xf800('0x6d')][_0xf800('0x64')]({'name':_0x113203['name'],'resourceId':_0x113203['id'],'type':_0x3f8f78['name'],'sectionId':_0x3f8f78['id']},{})['then'](function(){return _0x319823;});}else{return _0x319823;}})[_0xf800('0x23')](function(_0x502a1b){logger[_0xf800('0x1f')](_0xf800('0x6e'),_0x502a1b);throw _0x502a1b;});}return _0x319823;})['then'](respondWithResult(_0x21dd75,0xc9))['catch'](handleError(_0x21dd75,null));};exports[_0xf800('0x2b')]=function(_0x3d35ec,_0xfab04d){if(!wildcardUtils[_0xf800('0x65')](_0x3d35ec[_0xf800('0x66')]['address'])){return handleError(_0xfab04d,null)(new APIBadRequestError('\x22'+_0x3d35ec[_0xf800('0x66')][_0xf800('0x67')]+_0xf800('0x6f')));}if(_0x3d35ec[_0xf800('0x66')]['id']){delete _0x3d35ec[_0xf800('0x66')]['id'];}return db[_0xf800('0x4a')][_0xf800('0x63')]({'where':{'id':_0x3d35ec[_0xf800('0x61')]['id']},'include':[{'model':db[_0xf800('0x47')],'as':_0xf800('0x48')}]})[_0xf800('0x1b')](handleEntityNotFound(_0xfab04d,null))[_0xf800('0x1b')](saveUpdates(_0x3d35ec[_0xf800('0x66')],null))[_0xf800('0x1b')](respondWithResult(_0xfab04d,null))[_0xf800('0x23')](handleError(_0xfab04d,null));};exports['destroy']=function(_0x1f7529,_0x39d69c){return db[_0xf800('0x4a')]['find']({'where':{'id':_0x1f7529[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x39d69c,null))[_0xf800('0x1b')](removeEntity(_0x39d69c,null))[_0xf800('0x23')](handleError(_0x39d69c,null));};exports[_0xf800('0x70')]=function(_0x2b62c0,_0x521cc2){return db['ChatWebsite'][_0xf800('0x70')]()[_0xf800('0x1b')](respondWithResult(_0x521cc2,null))[_0xf800('0x23')](handleError(_0x521cc2,null));};exports[_0xf800('0x71')]=function(_0x4c4588,_0x59edc9){if(_0x4c4588['body']['id']){delete _0x4c4588[_0xf800('0x66')]['id'];}return db[_0xf800('0x4a')]['find']({'where':{'id':_0x4c4588[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x59edc9,null))[_0xf800('0x1b')](function(_0x13c031){if(_0x13c031){_0x4c4588[_0xf800('0x66')][_0xf800('0x72')]=_0x13c031['id'];return db[_0xf800('0x73')][_0xf800('0x64')](_0x4c4588['body']);}})[_0xf800('0x1b')](respondWithResult(_0x59edc9,null))['catch'](handleError(_0x59edc9,null));};exports['getDispositions']=function(_0x53732c,_0x373976){var _0x2af1c0={'raw':![],'where':{}};var _0x1b6d76={};var _0x5acaa6={'count':0x0,'rows':[]};return db[_0xf800('0x4a')]['findOne']({'where':{'id':_0x53732c[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x373976,null))[_0xf800('0x1b')](function(_0x40e39e){if(_0x40e39e){_0x1b6d76[_0xf800('0x43')]=_[_0xf800('0x4f')](db['Disposition']['rawAttributes']);_0x1b6d76[_0xf800('0x4e')]=_[_0xf800('0x4f')](_0x53732c[_0xf800('0x4e')]);_0x1b6d76['filters']=_[_0xf800('0x62')](_0x1b6d76['model'],_0x1b6d76[_0xf800('0x4e')]);_0x2af1c0['attributes']=_[_0xf800('0x62')](_0x1b6d76['model'],qs[_0xf800('0x51')](_0x53732c['query']['fields']));_0x2af1c0[_0xf800('0x52')]=_0x2af1c0['attributes'][_0xf800('0x53')]?_0x2af1c0[_0xf800('0x52')]:_0x1b6d76[_0xf800('0x43')];if(!_0x53732c[_0xf800('0x4e')][_0xf800('0x54')](_0xf800('0x74'))){_0x2af1c0[_0xf800('0x27')]=qs[_0xf800('0x27')](_0x53732c['query']['limit']);_0x2af1c0[_0xf800('0x26')]=qs[_0xf800('0x26')](_0x53732c['query'][_0xf800('0x26')]);}_0x2af1c0[_0xf800('0x55')]=qs[_0xf800('0x56')](_0x53732c[_0xf800('0x4e')][_0xf800('0x56')]);_0x2af1c0[_0xf800('0x57')]=qs[_0xf800('0x50')](_['pick'](_0x53732c[_0xf800('0x4e')],_0x1b6d76['filters']));_0x2af1c0[_0xf800('0x57')][_0xf800('0x72')]=_0x40e39e['id'];if(_0x53732c[_0xf800('0x4e')]['filter']){_0x2af1c0[_0xf800('0x57')]=_[_0xf800('0x5a')](_0x2af1c0[_0xf800('0x57')],{'$or':_[_0xf800('0x49')](_0x2af1c0[_0xf800('0x52')],function(_0x185d59){var _0x5aeb0d={};_0x5aeb0d[_0x185d59]={'$like':'%'+_0x53732c[_0xf800('0x4e')][_0xf800('0x59')]+'%'};return _0x5aeb0d;})});}_0x2af1c0=_['merge']({},_0x2af1c0,_0x53732c[_0xf800('0x5c')]);return db[_0xf800('0x73')][_0xf800('0x28')]({'where':_0x2af1c0[_0xf800('0x57')]})[_0xf800('0x1b')](function(_0x19a035){_0x5acaa6[_0xf800('0x28')]=_0x19a035;if(_0x53732c[_0xf800('0x4e')]['includeAll']){_0x2af1c0[_0xf800('0x5d')]=[{'all':!![]}];}return db[_0xf800('0x73')][_0xf800('0x5e')](_0x2af1c0);})[_0xf800('0x1b')](function(_0x5c63e3){_0x5acaa6[_0xf800('0x5f')]=_0x5c63e3;return _0x5acaa6;});}})[_0xf800('0x1b')](respondWithFilteredResult(_0x373976,_0x2af1c0))[_0xf800('0x23')](handleError(_0x373976,null));};exports[_0xf800('0x75')]=function(_0x4a0139,_0x164817){return db[_0xf800('0x4a')]['find']({'where':{'id':_0x4a0139[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x164817,null))[_0xf800('0x1b')](function(_0x3f8336){if(_0x3f8336){return _0x3f8336['removeDispositions'](_0x4a0139[_0xf800('0x4e')][_0xf800('0x76')]);}})[_0xf800('0x1b')](respondWithStatusCode(_0x164817,null))['catch'](handleError(_0x164817,null));};exports[_0xf800('0x77')]=function(_0x3ee151,_0x221f72){if(_0x3ee151['body']['id']){delete _0x3ee151[_0xf800('0x66')]['id'];}return db[_0xf800('0x4a')]['find']({'where':{'id':_0x3ee151[_0xf800('0x61')]['id']}})['then'](handleEntityNotFound(_0x221f72,null))['then'](function(_0x37872a){if(_0x37872a){_0x3ee151[_0xf800('0x66')][_0xf800('0x72')]=_0x37872a['id'];return db[_0xf800('0x78')][_0xf800('0x64')](_0x3ee151[_0xf800('0x66')]);}})[_0xf800('0x1b')](respondWithResult(_0x221f72,null))['catch'](handleError(_0x221f72,null));};exports[_0xf800('0x79')]=function(_0x2731cb,_0x34920e){var _0x3ffbcf={'raw':![],'where':{}};var _0x2674aa={};var _0x513de7={'count':0x0,'rows':[]};return db[_0xf800('0x4a')]['findOne']({'where':{'id':_0x2731cb['params']['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x34920e,null))[_0xf800('0x1b')](function(_0x121e17){if(_0x121e17){_0x2674aa[_0xf800('0x43')]=_['keys'](db[_0xf800('0x78')][_0xf800('0x4b')]);_0x2674aa[_0xf800('0x4e')]=_['keys'](_0x2731cb['query']);_0x2674aa[_0xf800('0x50')]=_[_0xf800('0x62')](_0x2674aa[_0xf800('0x43')],_0x2674aa[_0xf800('0x4e')]);_0x3ffbcf[_0xf800('0x52')]=_[_0xf800('0x62')](_0x2674aa[_0xf800('0x43')],qs['fields'](_0x2731cb[_0xf800('0x4e')]['fields']));_0x3ffbcf[_0xf800('0x52')]=_0x3ffbcf['attributes']['length']?_0x3ffbcf[_0xf800('0x52')]:_0x2674aa[_0xf800('0x43')];if(!_0x2731cb[_0xf800('0x4e')][_0xf800('0x54')](_0xf800('0x74'))){_0x3ffbcf[_0xf800('0x27')]=qs[_0xf800('0x27')](_0x2731cb[_0xf800('0x4e')]['limit']);_0x3ffbcf[_0xf800('0x26')]=qs[_0xf800('0x26')](_0x2731cb['query'][_0xf800('0x26')]);}_0x3ffbcf['order']=qs[_0xf800('0x56')](_0x2731cb[_0xf800('0x4e')][_0xf800('0x56')]);_0x3ffbcf['where']=qs[_0xf800('0x50')](_['pick'](_0x2731cb[_0xf800('0x4e')],_0x2674aa['filters']));_0x3ffbcf[_0xf800('0x57')][_0xf800('0x72')]=_0x121e17['id'];if(_0x2731cb[_0xf800('0x4e')][_0xf800('0x59')]){_0x3ffbcf[_0xf800('0x57')]=_[_0xf800('0x5a')](_0x3ffbcf[_0xf800('0x57')],{'$or':_[_0xf800('0x49')](_0x3ffbcf[_0xf800('0x52')],function(_0x21440b){var _0x314b7b={};_0x314b7b[_0x21440b]={'$like':'%'+_0x2731cb['query'][_0xf800('0x59')]+'%'};return _0x314b7b;})});}_0x3ffbcf=_[_0xf800('0x5a')]({},_0x3ffbcf,_0x2731cb[_0xf800('0x5c')]);return db[_0xf800('0x78')][_0xf800('0x28')]({'where':_0x3ffbcf['where']})[_0xf800('0x1b')](function(_0x21cac2){_0x513de7[_0xf800('0x28')]=_0x21cac2;if(_0x2731cb[_0xf800('0x4e')]['includeAll']){_0x3ffbcf[_0xf800('0x5d')]=[{'all':!![]}];}return db[_0xf800('0x78')][_0xf800('0x5e')](_0x3ffbcf);})[_0xf800('0x1b')](function(_0x3ed734){_0x513de7['rows']=_0x3ed734;return _0x513de7;});}})['then'](respondWithFilteredResult(_0x34920e,_0x3ffbcf))[_0xf800('0x23')](handleError(_0x34920e,null));};exports[_0xf800('0x7a')]=function(_0x3a2296,_0x496cce){return db[_0xf800('0x4a')]['find']({'where':{'id':_0x3a2296[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x496cce,null))[_0xf800('0x1b')](function(_0x7336fe){if(_0x7336fe){return _0x7336fe[_0xf800('0x7a')](_0x3a2296[_0xf800('0x4e')][_0xf800('0x76')]);}})[_0xf800('0x1b')](respondWithStatusCode(_0x496cce,null))['catch'](handleError(_0x496cce,null));};exports[_0xf800('0x7b')]=function(_0x29ff98,_0xa990cd){_0x29ff98['body']['sitepic']=_0x29ff98[_0xf800('0x7c')]['filename'];return db[_0xf800('0x4a')][_0xf800('0x63')]({'where':{'id':_0x29ff98[_0xf800('0x61')]['id']}})['then'](handleEntityNotFound(_0xa990cd,null))[_0xf800('0x1b')](saveUpdates(_0x29ff98[_0xf800('0x66')],null))['then'](respondWithResult(_0xa990cd,null))['catch'](handleError(_0xa990cd,null));};exports[_0xf800('0x7d')]=function(_0x2e2f3d,_0x5610e2){_0x2e2f3d[_0xf800('0x66')][_0xf800('0x7e')]=_0x2e2f3d[_0xf800('0x7c')]['filename'];return db[_0xf800('0x4a')][_0xf800('0x63')]({'where':{'id':_0x2e2f3d[_0xf800('0x61')]['id']}})['then'](handleEntityNotFound(_0x5610e2,null))['then'](saveUpdates(_0x2e2f3d['body'],null))[_0xf800('0x1b')](respondWithResult(_0x5610e2,null))[_0xf800('0x23')](handleError(_0x5610e2,null));};exports['addCustomerAvatar']=function(_0x39d26a,_0x39709b){_0x39d26a[_0xf800('0x66')][_0xf800('0x7f')]=_0x39d26a[_0xf800('0x7c')][_0xf800('0x80')];return db[_0xf800('0x4a')][_0xf800('0x63')]({'where':{'id':_0x39d26a[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x39709b,null))[_0xf800('0x1b')](saveUpdates(_0x39d26a[_0xf800('0x66')],null))[_0xf800('0x1b')](respondWithResult(_0x39709b,null))['catch'](handleError(_0x39709b,null));};exports[_0xf800('0x81')]=function(_0x519d95,_0x194b2c){_0x519d95[_0xf800('0x66')][_0xf800('0x82')]=_0x519d95[_0xf800('0x7c')][_0xf800('0x80')];return db[_0xf800('0x4a')][_0xf800('0x63')]({'where':{'id':_0x519d95['params']['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x194b2c,null))[_0xf800('0x1b')](saveUpdates(_0x519d95[_0xf800('0x66')],null))[_0xf800('0x1b')](respondWithResult(_0x194b2c,null))[_0xf800('0x23')](handleError(_0x194b2c,null));};exports[_0xf800('0x83')]=function(_0x3cf8b6,_0x50a37b){var _0x1ccacc=path[_0xf800('0x84')](config[_0xf800('0x85')],_0xf800('0x86'));var _0x5a2073={'where':{'id':_0x3cf8b6[_0xf800('0x61')]['id']},'attributes':['id',_0xf800('0x87')],'raw':!![]};var _0x28a2db=![];return require(_0xf800('0x88'))['getLicense']()[_0xf800('0x1b')](function(_0x398858){if(_0x398858){_0x28a2db=_0x398858[_0xf800('0x89')];}})[_0xf800('0x1b')](function(){return db[_0xf800('0x4a')][_0xf800('0x63')](_0x5a2073);})['then'](handleEntityNotFound(_0x50a37b,null))[_0xf800('0x1b')](function(_0x49d2cd){if(_0x49d2cd){if(!_[_0xf800('0x8a')](_0x49d2cd[_0xf800('0x87')])){if(fs[_0xf800('0x8b')](path[_0xf800('0x84')](config[_0xf800('0x85')],_0xf800('0x8c'),_0x49d2cd[_0xf800('0x87')]))&&_0x28a2db){_0x1ccacc=path[_0xf800('0x84')](config[_0xf800('0x85')],'server/files/images/logos/',_0x49d2cd['sitepic']);}}return _0x50a37b[_0xf800('0x8d')](_0x1ccacc);}})[_0xf800('0x23')](handleError(_0x50a37b,null));};exports[_0xf800('0x8e')]=function(_0x4756c7,_0x104731){var _0x32ed09=path[_0xf800('0x84')](config[_0xf800('0x85')],_0xf800('0x8f'));var _0xf5efc1={'where':{'id':_0x4756c7[_0xf800('0x61')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xf800('0x63')](_0xf5efc1)[_0xf800('0x1b')](handleEntityNotFound(_0x104731,null))[_0xf800('0x1b')](function(_0x1e39f0){if(_0x1e39f0){if(!_[_0xf800('0x8a')](_0x1e39f0['agentAvatar'])){if(fs[_0xf800('0x8b')](path[_0xf800('0x84')](config['root'],'server/files/images/avatars/',_0x1e39f0[_0xf800('0x7e')]))){_0x32ed09=path[_0xf800('0x84')](config['root'],'server/files/images/avatars/',_0x1e39f0[_0xf800('0x7e')]);}}return _0x104731[_0xf800('0x8d')](_0x32ed09);}})['catch'](handleError(_0x104731,null));};exports[_0xf800('0x90')]=function(_0xb27940,_0x272100){var _0x57b57a=path[_0xf800('0x84')](config[_0xf800('0x85')],'server/files/images/avatars/customer_avatar.png');var _0x10350a={'where':{'id':_0xb27940[_0xf800('0x61')]['id']},'attributes':['id',_0xf800('0x7f'),'showCustomerAvatar'],'raw':!![]};return db[_0xf800('0x4a')][_0xf800('0x63')](_0x10350a)[_0xf800('0x1b')](handleEntityNotFound(_0x272100,null))[_0xf800('0x1b')](function(_0x2b4f03){if(_0x2b4f03){if(!_[_0xf800('0x8a')](_0x2b4f03[_0xf800('0x7f')])){if(fs['existsSync'](path[_0xf800('0x84')](config['root'],_0xf800('0x91'),_0x2b4f03['customerAvatar']))&&_0x2b4f03[_0xf800('0x92')]){_0x57b57a=path[_0xf800('0x84')](config['root'],'server/files/images/avatars/',_0x2b4f03['customerAvatar']);}}return _0x272100[_0xf800('0x8d')](_0x57b57a);}})[_0xf800('0x23')](handleError(_0x272100,null));};exports[_0xf800('0x93')]=function(_0x2eb447,_0x4a3f8b){var _0x44fa7d=path[_0xf800('0x84')](config[_0xf800('0x85')],_0xf800('0x94'));var _0x388c8a={'where':{'id':_0x2eb447[_0xf800('0x61')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xf800('0x63')](_0x388c8a)[_0xf800('0x1b')](handleEntityNotFound(_0x4a3f8b,null))['then'](function(_0xee95){if(_0xee95){if(!_[_0xf800('0x8a')](_0xee95[_0xf800('0x82')])){if(fs[_0xf800('0x8b')](path[_0xf800('0x84')](config[_0xf800('0x85')],_0xf800('0x91'),_0xee95['systemAvatar']))){_0x44fa7d=path[_0xf800('0x84')](config[_0xf800('0x85')],'server/files/images/avatars/',_0xee95['systemAvatar']);}}return _0x4a3f8b[_0xf800('0x8d')](_0x44fa7d);}})[_0xf800('0x23')](handleError(_0x4a3f8b,null));};function checkWebsiteInterval(_0x18cc2f){var _0x53d9f8=_0x18cc2f[_0xf800('0x95')];if(!_0x53d9f8){return Promise[_0xf800('0x96')](_0x18cc2f);}var _0x53d9a0=_0x18cc2f[_0xf800('0x97')]||undefined;return _0x53d9f8[_0xf800('0x98')](_0x53d9a0)[_0xf800('0x1b')](function(_0x2216e1){if(!_0x2216e1){throw new APIOutOfIntervalError();}return _0x18cc2f;});}exports[_0xf800('0x99')]=function(_0x1c8d90,_0x1610ae){var _0x2d625c={'body':_0x1c8d90[_0xf800('0x66')],'channel':_0xf800('0x9a')};var _0x3654e0=[];var _0x5b9821=[];var _0x3e8619={};var _0x42e204=![];if(_0x1c8d90[_0xf800('0x66')]['id']){delete _0x1c8d90[_0xf800('0x66')]['id'];}if(_[_0xf800('0x8a')](_0x1c8d90[_0xf800('0x66')][_0xf800('0x9b')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xf800('0x8a')](_0x1c8d90[_0xf800('0x66')][_0xf800('0x9c')])){throw new APIBadRequestError(_0xf800('0x9d'));}if(_[_0xf800('0x9e')](_0x1c8d90[_0xf800('0x66')][_0xf800('0x66')])){throw new APIBadRequestError(_0xf800('0x9f'));}var _0x28aaab=_0x1c8d90['body'][_0xf800('0x35')]&&_0x1c8d90[_0xf800('0x66')][_0xf800('0xa0')];return db['CmContact'][_0xf800('0x70')]()[_0xf800('0x1b')](function(_0x27ad2e){if(!_0x27ad2e){throw new Error(_0xf800('0xa1'));}_0x3654e0=Object[_0xf800('0x4f')](_0x27ad2e)['filter'](function(_0x195c6a){return![_0xf800('0xa2'),_0xf800('0xa3')]['includes'](_0x195c6a);});_0x5b9821=Object[_0xf800('0x4f')](_0x27ad2e)[_0xf800('0x59')](function(_0x12af4c){return!['createdAt','updatedAt',_0xf800('0xa4'),_0xf800('0xa5')][_0xf800('0xa6')](_0x12af4c);});if(!_[_0xf800('0xa6')](_0x5b9821,_0x1c8d90[_0xf800('0x66')][_0xf800('0x9c')])){throw new APIBadRequestError(_0xf800('0xa7')+_0x5b9821[_0xf800('0x84')](',\x20'));}_0x3e8619[_0x1c8d90[_0xf800('0x66')][_0xf800('0x9c')]]=_0x1c8d90[_0xf800('0x66')][_0xf800('0x9b')];})[_0xf800('0x1b')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1c8d90['params']['id']},'include':[{'model':db[_0xf800('0xa8')],'as':_0xf800('0xa9'),'include':[{'model':db['CmContact'],'as':_0xf800('0xaa'),'where':_0x3e8619,'limit':0x1,'order':[[_0xf800('0xa3'),_0xf800('0xab')]]}]},{'model':db[_0xf800('0xac')],'as':_0xf800('0xad')},{'model':db[_0xf800('0x95')],'as':'Interval','include':[{'model':db[_0xf800('0x95')],'as':_0xf800('0xae'),'attributes':['id',_0xf800('0xaf')],'raw':!![]}]}]});})[_0xf800('0x1b')](function(_0x824020){if(!_0x824020){throw new APINotFoundError(util[_0xf800('0x3e')](_0xf800('0xb0'),_0x1c8d90[_0xf800('0x61')]['id']));}if(_0x28aaab){return checkWebsiteInterval(_0x824020);}return _0x824020;})[_0xf800('0x1b')](function(_0x210070){_0x2d625c[_0xf800('0xb1')]=_0x210070;_0x2d625c[_0xf800('0xb2')]=_[_0xf800('0xb3')](_0x210070[_0xf800('0xad')],[_0xf800('0xb4')],[_0xf800('0xb5')]);if(_0x2d625c[_0xf800('0xb1')]['Applications']){delete _0x2d625c[_0xf800('0xb1')][_0xf800('0xad')];}_0x2d625c[_0xf800('0xb6')]=_0x210070[_0xf800('0xa9')]||{'id':_0x210070[_0xf800('0xa5')]};if(_0x2d625c[_0xf800('0xb6')]&&_0x2d625c['list'][_0xf800('0xaa')][_0xf800('0x53')]){return _0x2d625c[_0xf800('0xb6')][_0xf800('0xaa')][0x0];}var _0x431712=_[_0xf800('0x14')](_0x1c8d90[_0xf800('0x66')],{'firstName':_0x1c8d90[_0xf800('0x66')][_0xf800('0x9b')],'ListId':_0x210070[_0xf800('0xa5')]});_0x431712[_0x1c8d90[_0xf800('0x66')][_0xf800('0x9c')]]=_0x1c8d90[_0xf800('0x66')][_0xf800('0x9b')];return db[_0xf800('0xb7')][_0xf800('0x64')](_0x431712,{'fields':_0x3654e0,'raw':!![]});})[_0xf800('0x1b')](function(_0x2a1c11){_0x2d625c[_0xf800('0xb8')]=_0x2a1c11;var _0x46f539=createInteractionObject(_0x1c8d90[_0xf800('0x61')]['id'],_0x1c8d90[_0xf800('0x66')],_0x1c8d90['headers'],_0x2a1c11);var _0x415aa1={'ChatWebsiteId':_0x1c8d90[_0xf800('0x61')]['id']};if(_0x1c8d90[_0xf800('0x66')]['threadId']){_0x415aa1[_0xf800('0xb9')]=_0x1c8d90[_0xf800('0x66')]['threadId'];_0x415aa1[_0xf800('0xba')]=![];return db[_0xf800('0xbb')][_0xf800('0x63')]({'where':_0x415aa1})[_0xf800('0x1b')](function(_0x1ac6cc){var _0x2e96c1=_0x1c8d90[_0xf800('0x66')][_0xf800('0x35')]&&_0x1c8d90['body'][_0xf800('0xa0')];if(_0x1ac6cc){_0x42e204=!![];return _0x1ac6cc;}else if(!_0x2e96c1&&_0x1ac6cc&&_0x1ac6cc[_0xf800('0xba')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x46f539[_0xf800('0xb9')]=_0x1c8d90[_0xf800('0x66')][_0xf800('0xb9')];_0x46f539[_0xf800('0xbc')]=_0x1c8d90[_0xf800('0x66')]['externalUrl'];return db[_0xf800('0xbb')]['create'](_0x46f539);});}_0x415aa1[_0xf800('0xbd')]=_0x2a1c11['id'];if(_0x1c8d90[_0xf800('0x66')][_0xf800('0xbe')]&&_0x1c8d90[_0xf800('0x66')][_0xf800('0xbe')]['id']){_0x415aa1['id']=_0x1c8d90[_0xf800('0x66')][_0xf800('0xbe')]['id'];return db[_0xf800('0xbb')][_0xf800('0x63')]({'where':_0x415aa1})[_0xf800('0x1b')](function(_0x37356d){var _0x2c5ec7=_0x1c8d90[_0xf800('0x66')][_0xf800('0x35')]&&_0x1c8d90[_0xf800('0x66')]['referer'];if(!_0x2c5ec7&&_0x37356d&&_0x37356d[_0xf800('0xba')]){throw new APIConflictError(_0xf800('0xbf'));}else if(_0x37356d){_0x42e204=!![];return _0x37356d;}else{return db[_0xf800('0xbb')][_0xf800('0x64')](_0x46f539);}});}return db[_0xf800('0xbb')][_0xf800('0x64')](_0x46f539);})['then'](function(_0x17bdf4){if(!_0x42e204){return _0x17bdf4;}var _0x5b0adb={'from':(_0x2d625c[_0xf800('0xb8')]['firstName']||'')+'\x20'+(_0x2d625c[_0xf800('0xb8')]['lastName']||'')};if(_0x1c8d90[_0xf800('0x66')][_0xf800('0xb9')]&&_0x1c8d90['body']['messageId']&&_0x1c8d90[_0xf800('0x66')][_0xf800('0xb9')]!=_0x1c8d90['body'][_0xf800('0xc0')]){_0x5b0adb[_0xf800('0xb9')]=_0x1c8d90[_0xf800('0x66')]['messageId'];}return _0x17bdf4[_0xf800('0x2b')](_0x5b0adb);})[_0xf800('0x1b')](function(_0x177f73){_0x2d625c[_0xf800('0xbe')]=_0x177f73[_0xf800('0x2d')]({'plain':!![]});_0x2d625c[_0xf800('0xbe')]['created']=!_0x42e204;if(_0x2d625c[_0xf800('0xbe')][_0xf800('0xc1')]){if(_0x2d625c[_0xf800('0xb1')][_0xf800('0xc2')]){_0x2d625c['applications'][_0xf800('0xc3')]({'id':0x0,'priority':_0x2d625c[_0xf800('0xb2')]['length']+0x1,'app':'close','appdata':_0xf800('0xc4'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xf800('0x64')]({'body':_0x1c8d90[_0xf800('0x66')][_0xf800('0x66')],'ChatWebsiteId':_0x1c8d90[_0xf800('0x61')]['id'],'ChatInteractionId':_0x177f73['id'],'direction':'in','ContactId':_0x2d625c['contact']['id'],'AttachmentId':_0x1c8d90['body'][_0xf800('0xc5')]});})[_0xf800('0x1b')](function(_0x3b2bf9){_0x2d625c['message']=_0x3b2bf9;if(!_0x2d625c['interaction'][_0xf800('0xc6')]){return;}return db[_0xf800('0xc7')][_0xf800('0x63')]({'attributes':['id',_0xf800('0x40')],'where':{'id':_0x2d625c[_0xf800('0xbe')][_0xf800('0xc6')]}});})['then'](function(_0x416745){if(_0x416745){_0x2d625c['applications'][_0xf800('0xc8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x416745[_0xf800('0x40')]+','+(_0x2d625c[_0xf800('0xb1')][_0xf800('0xc9')]||0xa),'interval':_0xf800('0xca')});_0x2d625c['forcedOwnership']=!![];}if(!_0x2d625c[_0xf800('0xbe')][_0xf800('0xcb')]){return;}return db[_0xf800('0xcc')][_0xf800('0x63')]({'attributes':['id',_0xf800('0x40')],'where':{'id':_0x2d625c[_0xf800('0xbe')][_0xf800('0xcb')]}});})['then'](function(_0x56c231){if(_0x56c231){_0x2d625c['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0xf800('0xcd'),'appdata':_0x56c231[_0xf800('0x40')]+','+(_0x2d625c[_0xf800('0xb1')][_0xf800('0xce')]||0x12c),'interval':_0xf800('0xca')});}return respondWithRpcPromise(_0xf800('0xcf'),'startRouting',_0x2d625c);})['then'](function(_0xd0533e){respondWithRpcPromise(_0xf800('0xd0'),_0xf800('0xd0'),{'event':_0xf800('0x99'),'message':_0xd0533e},client9002);return _0xd0533e;})[_0xf800('0x1b')](respondWithResult(_0x1610ae,null))[_0xf800('0x23')](APIHandleError(_0x1610ae));};exports[_0xf800('0xd1')]=function(_0x40a26d,_0x47c5ad){var _0x42128a,_0x4b291b,_0x52be5e;var _0x42eb6f=[];var _0x23440e={};var _0x2ac84=_0x40a26d[_0xf800('0xd2')]||[];var _0x169cde=[];var _0x542f35;return db[_0xf800('0xb7')][_0xf800('0x70')]()[_0xf800('0x1b')](function(_0x33adc3){if(!_0x33adc3){throw new db[(_0xf800('0xd3'))][(_0xf800('0xd4'))]('no\x20available\x20attributes');}_0x42eb6f=_[_0xf800('0xd5')](_[_0xf800('0x4f')](_0x33adc3),['createdAt',_0xf800('0xa3'),_0xf800('0xa4'),_0xf800('0xa5')]);if(_0x40a26d[_0xf800('0x66')]['id']){delete _0x40a26d[_0xf800('0x66')]['id'];}if(_[_0xf800('0x8a')](_0x40a26d[_0xf800('0x66')][_0xf800('0x9b')])){throw _0x47c5ad[_0xf800('0x24')](0x1f4)[_0xf800('0x31')](new db[(_0xf800('0xd3'))][(_0xf800('0xd4'))](_0xf800('0xd6')));}if(_[_0xf800('0x8a')](_0x40a26d[_0xf800('0x66')][_0xf800('0x66')])||_0x40a26d[_0xf800('0x66')]['body']===''){throw _0x47c5ad[_0xf800('0x24')](0x1f4)['send'](new db[(_0xf800('0xd3'))][(_0xf800('0xd4'))](_0xf800('0xd7')));}if(_[_0xf800('0x8a')](_0x40a26d[_0xf800('0x66')][_0xf800('0xd8')])){throw _0x47c5ad[_0xf800('0x24')](0x1f4)[_0xf800('0x31')](new db[(_0xf800('0xd3'))]['ValidationError'](_0xf800('0xd9')+_0x42eb6f));}if(!_[_0xf800('0xa6')](_0x42eb6f,_0x40a26d[_0xf800('0x66')][_0xf800('0xd8')])){throw _0x47c5ad['status'](0x1f4)[_0xf800('0x31')](new db[(_0xf800('0xd3'))][(_0xf800('0xd4'))](_0xf800('0xda')+_0x42eb6f));}_0x23440e[_0x40a26d['body'][_0xf800('0xd8')]]=_0x40a26d[_0xf800('0x66')]['from'];})[_0xf800('0x1b')](function(){return db[_0xf800('0x4a')][_0xf800('0x63')]({'where':{'id':_0x40a26d['params']['id']},'include':[{'model':db[_0xf800('0xa8')],'as':'List'},{'model':db[_0xf800('0xdb')],'as':_0xf800('0xdb')}]});})[_0xf800('0x1b')](handleEntityNotFound(_0x47c5ad,null))[_0xf800('0x1b')](function(_0x450734){if(_0x450734&&_0x450734[_0xf800('0xa9')]){_0x4b291b=_0x450734;var _0xb5e441=_[_0xf800('0x14')](_0x40a26d[_0xf800('0x66')],{'firstName':_0x40a26d[_0xf800('0x66')]['from'],'phone':_0x40a26d['body']['from'],'ListId':_0x450734['ListId']});_0xb5e441[_0x40a26d[_0xf800('0x66')]['mapKeyOffline']]=_0x40a26d[_0xf800('0x66')][_0xf800('0x9b')];return db[_0xf800('0xb7')]['findOrCreate']({'where':_0x23440e,'defaults':_0xb5e441});}})[_0xf800('0xdc')](function(_0x1942df){if(_0x1942df){_0x52be5e=_0x1942df;var _0x20b162=fs[_0xf800('0xdd')](path['join'](config[_0xf800('0x85')],_0xf800('0xde')),_0xf800('0xdf'));var _0x36e9fe=ejs[_0xf800('0xe0')](_0x20b162,{'body':_[_0xf800('0xe1')](_0x40a26d[_0xf800('0x66')][_0xf800('0x66')]),'bodyTitle':_0x4b291b[_0xf800('0xe2')]});return db['ChatOfflineMessage'][_0xf800('0x64')]({'body':_0x36e9fe,'plainBody':htmlToText['fromString'](_0x36e9fe),'ContactId':_0x1942df['id'],'ChatWebsiteId':_0x4b291b['id']});}})['then'](function(_0x174c9f){_0x542f35=_0x174c9f;if(_0x2ac84[_0xf800('0x53')]){var _0x2c2c5b=_0x2ac84[_0xf800('0x49')](function(_0x260a86){return{'name':_0x260a86[_0xf800('0xe3')],'basename':_0x260a86[_0xf800('0x80')],'type':_0x260a86[_0xf800('0xe4')],'ChatOfflineMessageId':_0x174c9f['id']};});_0x169cde=_0x2c2c5b[_0xf800('0x49')](_0x29afe4=>{var _0x3be96d={'filename':_0x29afe4['name'],'path':path['join'](config[_0xf800('0x85')],_0xf800('0xe5'),_0xf800('0xd2'),_0xf800('0xe6'),_0xf800('0xe7'),_0x29afe4['basename'])};return _0x3be96d;});if(!_0x4b291b[_0xf800('0xe8')]){return db[_0xf800('0xe9')][_0xf800('0xea')](function(_0x5b40d6){return db[_0xf800('0xeb')]['bulkCreate'](_0x2c2c5b,{'transaction':_0x5b40d6});});}}})[_0xf800('0x1b')](function(){if(_0x542f35){_0x42128a=_0x542f35;return db[_0xf800('0xdb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf800('0xec')],'as':_0xf800('0xed'),'raw':!![],'include':[{'model':db[_0xf800('0xee')],'as':_0xf800('0xee'),'raw':!![]}]}]});}})['then'](function(_0x319818){if(_0x319818&&_0x319818[_0xf800('0xed')]&&_0x4b291b[_0xf800('0xef')]&&_0x4b291b[_0xf800('0xf0')]){var _0x3674d7=_0x319818['getSmtpOptions']();return respondWithRpcPromise(_0xf800('0xf1'),_0xf800('0xf2'),{'account':_0x3674d7,'message':{'from':util['format'](_0xf800('0xf3'),_0x319818[_0xf800('0x40')],_0x319818[_0xf800('0xf4')]||_0x319818[_0xf800('0xed')][_0xf800('0x68')]),'to':_0x4b291b['forwardOfflineAddress'],'subject':_0x4b291b[_0xf800('0xf5')],'html':_0x42128a['body'],'attachments':_0x169cde}},client9003)[_0xf800('0x1b')](function(){return _0x42128a;})[_0xf800('0x23')](function(_0x7b61ee){logger['error'](_0x7b61ee);});}})[_0xf800('0x1b')](function(){if(_0x4b291b&&_0x4b291b[_0xf800('0xe8')]&&_0x4b291b[_0xf800('0xf6')]){var _0x498280=[];if(_0x2ac84[_0xf800('0x53')]){_0x498280=_0x2ac84['map'](function(_0x1f2eb5){return{'name':_0x1f2eb5[_0xf800('0xe3')],'basename':_0x1f2eb5[_0xf800('0x80')],'type':_0x1f2eb5[_0xf800('0xe4')],'ChatOfflineMessageId':_0x542f35['id']};});}var _0x5e1baa;if(!_[_0xf800('0x8a')](_0x4b291b[_0xf800('0xf7')])){var _0x2ed683=_['map'](_0x40a26d['body'],function(_0x1da259){return _0x1da259;});var _0x5d555e=_['toPairsIn'](_0x2ed683)[0x0];var _0x4ae75b=_['mapValues'](_0x5d555e,function(_0x165960){return _0x165960;});_0x5e1baa=_0x4ae75b[0x1][_0x4b291b['subjectOffline']];}var _0x560269={'from':_0x52be5e[_0xf800('0xf4')],'firstName':_0x52be5e[_0xf800('0xf8')],'lastName':_0x52be5e[_0xf800('0x3a')],'mapKey':_0xf800('0xf4'),'message':{'from':_0x52be5e[_0xf800('0xf4')],'to':_0x4b291b[_0xf800('0xdb')][_0xf800('0xf4')],'cc':'','subject':_[_0xf800('0x8a')](_0x5e1baa)?_0x4b291b[_0xf800('0xf5')]:_0x5e1baa,'messageId':'','sentAt':new Date(),'attach':_0x498280['length'],'attachments':_0x498280,'originChannel':_0xf800('0xf9'),'ChatWebsiteId':_0x4b291b['id'],'ChatOfflineMessageId':_0x42128a['id'],'originTo':_0x4b291b[_0xf800('0xdb')]['email']},'body':_0x42128a[_0xf800('0x66')]};var _0x1cb5f2={'account':{'id':_0x4b291b['MailAccountId']},'body':_0x560269,'log':_0xf800('0xfa')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x1cb5f2,client9001)[_0xf800('0x1b')](function(){return _0x42128a;})[_0xf800('0x23')](function(_0x8848f){logger['error'](_0x8848f);});}return;})[_0xf800('0x1b')](function(){if(_0x42128a){return _0x42128a;}})['then'](respondWithResult(_0x47c5ad,null))[_0xf800('0x23')](function(){for(var _0x228655 of _0x2ac84){var _0x36ab26=path['join'](config[_0xf800('0x85')],'server',_0xf800('0xd2'),_0xf800('0xe6'),_0xf800('0xe7'),_0x228655['filename']);fs_extra['remove'](_0x36ab26)['catch'](function(_0x5250d3){logger[_0xf800('0x1f')]('Could\x20not\x20remove\x20attachment\x20file',_0x36ab26,_0x5250d3);});}});};exports[_0xf800('0xfb')]=function(_0x582588,_0x48a4c8){return db[_0xf800('0xbb')][_0xf800('0x63')]({'where':{'id':_0x582588[_0xf800('0x61')]['id']}})['then'](handleEntityNotFound(_0x48a4c8,null))[_0xf800('0x1b')](function(_0x4ccf5c){if(_0x4ccf5c){return _0x4ccf5c[_0xf800('0xfb')](_0x582588[_0xf800('0x66')][_0xf800('0x76')],_[_0xf800('0xfc')](_0x582588['body'],[_0xf800('0x76'),'id'])||{});}})[_0xf800('0x1b')](respondWithResult(_0x48a4c8,null))[_0xf800('0x23')](handleError(_0x48a4c8,null));};exports[_0xf800('0xfd')]=function(_0x13d1ef,_0x5a8ca8){var _0x1f6392={'raw':![],'where':{}};var _0x256222={};var _0x137d05={'count':0x0,'rows':[]};return db[_0xf800('0x4a')][_0xf800('0xfe')]({'where':{'id':_0x13d1ef[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x5a8ca8,null))[_0xf800('0x1b')](function(_0x2f7238){if(_0x2f7238){_0x256222[_0xf800('0x43')]=_[_0xf800('0x4f')](db[_0xf800('0xbb')]['rawAttributes']);_0x256222[_0xf800('0x4e')]=_['keys'](_0x13d1ef[_0xf800('0x4e')]);_0x256222[_0xf800('0x50')]=_[_0xf800('0x62')](_0x256222[_0xf800('0x43')],_0x256222[_0xf800('0x4e')]);_0x1f6392[_0xf800('0x52')]=_[_0xf800('0x62')](_0x256222[_0xf800('0x43')],qs['fields'](_0x13d1ef[_0xf800('0x4e')][_0xf800('0x51')]));_0x1f6392['attributes']=_0x1f6392[_0xf800('0x52')]['length']?_0x1f6392[_0xf800('0x52')]:_0x256222[_0xf800('0x43')];if(!_0x13d1ef[_0xf800('0x4e')][_0xf800('0x54')](_0xf800('0x74'))){_0x1f6392[_0xf800('0x27')]=qs[_0xf800('0x27')](_0x13d1ef[_0xf800('0x4e')][_0xf800('0x27')]);_0x1f6392[_0xf800('0x26')]=qs[_0xf800('0x26')](_0x13d1ef[_0xf800('0x4e')][_0xf800('0x26')]);}_0x1f6392[_0xf800('0x55')]=qs[_0xf800('0x56')](_0x13d1ef[_0xf800('0x4e')][_0xf800('0x56')]);_0x1f6392[_0xf800('0x57')]=qs[_0xf800('0x50')](_[_0xf800('0x58')](_0x13d1ef[_0xf800('0x4e')],_0x256222[_0xf800('0x50')]));_0x1f6392[_0xf800('0x57')][_0xf800('0x72')]=_0x2f7238['id'];if(_0x13d1ef[_0xf800('0x4e')][_0xf800('0x59')]){_0x1f6392['where']=_[_0xf800('0x5a')](_0x1f6392[_0xf800('0x57')],{'$or':_[_0xf800('0x49')](_0x1f6392[_0xf800('0x52')],function(_0x3f3113){var _0x10bbae={};_0x10bbae[_0x3f3113]={'$like':'%'+_0x13d1ef['query'][_0xf800('0x59')]+'%'};return _0x10bbae;})});}_0x1f6392=_[_0xf800('0x5a')]({},_0x1f6392,_0x13d1ef['options']);return db['ChatInteraction'][_0xf800('0x28')]({'where':_0x1f6392[_0xf800('0x57')]})[_0xf800('0x1b')](function(_0x671703){_0x137d05[_0xf800('0x28')]=_0x671703;if(_0x13d1ef[_0xf800('0x4e')][_0xf800('0xff')]){_0x1f6392['include']=[{'model':db[_0xf800('0xb7')],'as':'Contact','required':![]},{'model':db[_0xf800('0xc7')],'as':_0xf800('0x100'),'attributes':[_0xf800('0x40'),_0xf800('0x101'),_0xf800('0x102')],'required':![]},{'model':db[_0xf800('0x103')],'as':_0xf800('0x104'),'attributes':['id',_0xf800('0x40'),'color'],'where':_0x13d1ef['query'][_0xf800('0x105')]?{'id':_0x13d1ef[_0xf800('0x4e')]['tag']}:undefined,'required':_0x13d1ef[_0xf800('0x4e')][_0xf800('0x105')]?!![]:![]}];}return db['ChatInteraction'][_0xf800('0x5e')](_0x1f6392);})[_0xf800('0x1b')](function(_0x3ccee7){_0x137d05[_0xf800('0x5f')]=_0x3ccee7;return _0x137d05;});}})[_0xf800('0x1b')](respondWithFilteredResult(_0x5a8ca8,_0x1f6392))[_0xf800('0x23')](handleError(_0x5a8ca8,null));};exports['getSnippet']=function(_0x1a3f8c,_0x3b651c){var _0x425a1d=0x0;var _0x2c68bb=0x0;var _0x1da823=![];var _0x4fac39;var _0x202b8f;return db['ChatWebsite'][_0xf800('0x63')]({'where':{'id':_0x1a3f8c['params']['id']},'include':[{'model':db[_0xf800('0x95')],'as':_0xf800('0x95'),'include':[{'model':db[_0xf800('0x95')],'as':_0xf800('0xae'),'attributes':['id',_0xf800('0xaf')]}]}]})[_0xf800('0x1b')](handleEntityNotFound(_0x3b651c,null))[_0xf800('0x1b')](function(_0x57952a){if(_0x57952a){_0x4fac39=_0x57952a;return _0x57952a[_0xf800('0x106')]({'raw':!![]});}})[_0xf800('0x1b')](function(_0x4fbc35){if(_0x4fac39){if(_0x4fbc35){_0x202b8f=_0x4fbc35;}}return require('../../config/license/util')[_0xf800('0x107')]();})[_0xf800('0x1b')](function(_0x23447c){if(_0x23447c){_0x2c68bb=_0x23447c[_0xf800('0x108')];_0x1da823=_0x23447c[_0xf800('0x89')];}})['then'](function(){return db['ChatInteraction'][_0xf800('0x28')]({'where':{'closed':![]}});})['then'](function(_0x40b977){_0x425a1d=_0x40b977;if(_0x2c68bb&&_0x40b977>_0x2c68bb){return db[_0xf800('0x109')]['findOne']({'where':{'id':0x1}})[_0xf800('0x1b')](function(_0x5d4b74){if(_0x5d4b74){_0x5d4b74['increment'](_0xf800('0x10a'));}});}})[_0xf800('0x1b')](function(){var _0x1052d1=_0x4fac39['Interval'];var _0x182a6f=_0x4fac39[_0xf800('0x97')]||undefined;return _0x1052d1?_0x1052d1[_0xf800('0x98')](_0x182a6f):!![];})['then'](function(_0x4a306e){var _0x5bba57=fs[_0xf800('0xdd')](path[_0xf800('0x84')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x31cb4d=_0xf800('0x10b');var _0x3a1c48=![];try{const _0x2b4c4c=new URL(_0x4fac39[_0xf800('0x67')]);_0x4fac39[_0xf800('0x67')]=_0x2b4c4c[_0xf800('0x10c')];}catch(_0x1d285d){}var _0x4f2803;if(_0x1a3f8c[_0xf800('0x10d')][_0xf800('0xa0')]){_0x1a3f8c[_0xf800('0x10d')][_0xf800('0xa0')]=_0x1a3f8c[_0xf800('0x10d')][_0xf800('0xa0')]['replace'](/\/$/,'');_0x4f2803=wildcardUtils['testWebsiteWithWildcard'](_0x4fac39[_0xf800('0x67')],_0x1a3f8c[_0xf800('0x10d')][_0xf800('0xa0')]);}else{_0x1a3f8c[_0xf800('0x10d')][_0xf800('0xa0')]=_0x4fac39['address'];_0x4f2803=!![];}var _0xb80c79={'chatVersion':_0x31cb4d,'chatWebsiteAddressOrigin':_0x4f2803?_0x1a3f8c[_0xf800('0x10d')]['referer']:_0x4fac39[_0xf800('0x67')],'remote':_0x4fac39['remote'],'query':querystring[_0xf800('0x1e')](_[_0xf800('0x5a')](_0x4fac39['get']({'plain':!![]}),{'customerIp':_0x1a3f8c[_0xf800('0x10d')][_0xf800('0x37')]||_0x1a3f8c[_0xf800('0x10d')][_0xf800('0x10e')]||_0x1a3f8c['connection'][_0xf800('0x10f')]||_0x1a3f8c['ip'],'referer':_0x1a3f8c[_0xf800('0x10d')][_0xf800('0xa0')],'openedInteractions':_0x425a1d,'maxInteractions':_0x2c68bb,'virtual':_0x1da823[_0xf800('0x108')],'online':_0x4a306e,'custom':_0x1da823,'address':_0x4f2803?_0x1a3f8c[_0xf800('0x10d')][_0xf800('0xa0')]:null}))[_0xf800('0x110')](/'/g,'\x5c\x27')};_0x3b651c[_0xf800('0x31')](ejs[_0xf800('0xe0')](Mustache[_0xf800('0xe0')](_0x5bba57,_0xb80c79),{'proactiveActions':_0x202b8f,'alignment':_0x4fac39[_0xf800('0x111')],'verticalAlignment':_0x4fac39[_0xf800('0x112')],'div_color':_0x4fac39[_0xf800('0x113')],'labelText':_0x4fac39[_0xf800('0x114')],'text_color':_0x4fac39['textColor'],'text_button_color':_0x4fac39[_0xf800('0x115')],'button_color':_0x4fac39[_0xf800('0x116')],'background_color':_0x4fac39[_0xf800('0x117')],'hideWhenOffline':_0x4fac39['hideWhenOffline'],'intervalId':_0x4fac39[_0xf800('0x118')],'isDevelopment':_0x3a1c48,'chatVersion':_0x31cb4d}));})[_0xf800('0x23')](handleError(_0x3b651c,null));};exports[_0xf800('0x119')]=function(_0x49154c,_0x38ca3b){var _0x3ab053=_0x49154c[_0xf800('0x61')]['id'];var _0x1a3a39=_0x49154c[_0xf800('0x66')];var _0x10fc60=0xc8;var _0x4194c5=null;return db[_0xf800('0xe9')][_0xf800('0xea')]({'isolationLevel':db[_0xf800('0xe9')][_0xf800('0x11a')][_0xf800('0x11b')][_0xf800('0x11c')]},function(_0x4245c1){return db[_0xf800('0x4a')]['findOne']({'where':{'id':_0x3ab053},'transaction':_0x4245c1})[_0xf800('0x1b')](function(_0x7e2442){if(_0x7e2442){return db[_0xf800('0xac')]['destroy']({'where':{'ChatWebsiteId':_0x3ab053},'transaction':_0x4245c1})[_0xf800('0x1b')](function(){var _0x2652bb=_[_0xf800('0x49')](_0x1a3a39,function(_0x2261d4){_0x2261d4[_0xf800('0x72')]=_0x3ab053;return _0x2261d4;});return db[_0xf800('0xac')]['bulkCreate'](_0x2652bb,{'transaction':_0x4245c1});});}else{_0x10fc60=0x194;_0x4194c5=[];}});})[_0xf800('0x1b')](function(){if(_0x10fc60!==0x194){return db['ChatApplication'][_0xf800('0x11d')]({'where':{'ChatWebsiteId':_0x3ab053},'order':_0xf800('0xb4')})['then'](function(_0x281c8c){_0x4194c5=_0x281c8c;});}})[_0xf800('0x23')](function(_0x362c76){_0x10fc60=0x1f4;logger[_0xf800('0x1f')](_0x362c76['stack']);if(_0x362c76[_0xf800('0x40')]){delete _0x362c76['name'];}_0x4194c5=_0x362c76;})['finally'](function(){if(_0x4194c5===null){_0x38ca3b[_0xf800('0x2f')](_0x10fc60);}else{if(_0x10fc60===0x1f4){_0x38ca3b[_0xf800('0x24')](_0x10fc60)[_0xf800('0x31')](_0x4194c5);}else{_0x38ca3b[_0xf800('0x24')](_0x10fc60)[_0xf800('0x11e')](_0x4194c5);}}});};exports[_0xf800('0x11f')]=function(_0x154aca,_0x4a470b){var _0xc342dd={};var _0x528296={};var _0x34636a;var _0x411d83;return db[_0xf800('0x4a')]['findOne']({'where':{'id':_0x154aca[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x4a470b,null))[_0xf800('0x1b')](function(_0x542f44){if(_0x542f44){_0x34636a=_0x542f44;_0x528296[_0xf800('0x43')]=_[_0xf800('0x4f')](db[_0xf800('0xac')][_0xf800('0x4b')]);_0x528296[_0xf800('0x4e')]=_['keys'](_0x154aca[_0xf800('0x4e')]);_0x528296[_0xf800('0x50')]=_[_0xf800('0x62')](_0x528296[_0xf800('0x43')],_0x528296[_0xf800('0x4e')]);_0xc342dd[_0xf800('0x52')]=_[_0xf800('0x62')](_0x528296[_0xf800('0x43')],qs[_0xf800('0x51')](_0x154aca[_0xf800('0x4e')][_0xf800('0x51')]));_0xc342dd['attributes']=_0xc342dd[_0xf800('0x52')][_0xf800('0x53')]?_0xc342dd[_0xf800('0x52')]:_0x528296[_0xf800('0x43')];_0xc342dd[_0xf800('0x55')]=qs[_0xf800('0x56')](_0x154aca[_0xf800('0x4e')]['sort']);_0xc342dd['where']=qs['filters'](_[_0xf800('0x58')](_0x154aca['query'],_0x528296[_0xf800('0x50')]));if(_0x154aca[_0xf800('0x4e')][_0xf800('0x59')]){_0xc342dd[_0xf800('0x57')]=_[_0xf800('0x5a')](_0xc342dd[_0xf800('0x57')],{'$or':_[_0xf800('0x49')](_0xc342dd[_0xf800('0x52')],function(_0x422e80){var _0x2e1b4e={};_0x2e1b4e[_0x422e80]={'$like':'%'+_0x154aca[_0xf800('0x4e')][_0xf800('0x59')]+'%'};return _0x2e1b4e;})});}_0xc342dd=_[_0xf800('0x5a')]({},_0xc342dd,_0x154aca[_0xf800('0x5c')]);return _0x34636a['getApplications'](_0xc342dd);}})['then'](function(_0xd51d18){if(_0xd51d18){_0x411d83=_0xd51d18['length'];if(!_0x154aca['query'][_0xf800('0x54')](_0xf800('0x74'))){_0xc342dd['limit']=qs[_0xf800('0x27')](_0x154aca[_0xf800('0x4e')]['limit']);_0xc342dd[_0xf800('0x26')]=qs[_0xf800('0x26')](_0x154aca[_0xf800('0x4e')][_0xf800('0x26')]);}return _0x34636a[_0xf800('0x11f')](_0xc342dd);}})[_0xf800('0x1b')](function(_0x7640dd){if(_0x7640dd){return _0x7640dd?{'count':_0x411d83,'rows':_0x7640dd}:null;}})['then'](respondWithResult(_0x4a470b,null))[_0xf800('0x23')](handleError(_0x4a470b,null));};exports[_0xf800('0x120')]=function(_0x4b94a5,_0x459651){return db[_0xf800('0x121')]['find']({'where':{'id':_0x4b94a5[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x459651,null))[_0xf800('0x1b')](function(_0x4fa589){if(_0x4fa589){return _0x4fa589[_0xf800('0x120')](_0x4b94a5[_0xf800('0x66')][_0xf800('0x76')],_[_0xf800('0xfc')](_0x4b94a5[_0xf800('0x66')],[_0xf800('0x76'),'id'])||{});}})['then'](respondWithResult(_0x459651,null))[_0xf800('0x23')](handleError(_0x459651,null));};exports[_0xf800('0x106')]=function(_0x2ca122,_0x50fa73){var _0x34e1e7={};var _0x5c01ad={};var _0x48de78;var _0x306c2b;return db[_0xf800('0x4a')][_0xf800('0xfe')]({'where':{'id':_0x2ca122[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x50fa73,null))[_0xf800('0x1b')](function(_0x5cf89){if(_0x5cf89){_0x48de78=_0x5cf89;_0x5c01ad[_0xf800('0x43')]=_[_0xf800('0x4f')](db[_0xf800('0x122')][_0xf800('0x4b')]);_0x5c01ad['query']=_['keys'](_0x2ca122[_0xf800('0x4e')]);_0x5c01ad[_0xf800('0x50')]=_[_0xf800('0x62')](_0x5c01ad[_0xf800('0x43')],_0x5c01ad[_0xf800('0x4e')]);_0x34e1e7['attributes']=_['intersection'](_0x5c01ad[_0xf800('0x43')],qs['fields'](_0x2ca122[_0xf800('0x4e')][_0xf800('0x51')]));_0x34e1e7['attributes']=_0x34e1e7[_0xf800('0x52')]['length']?_0x34e1e7[_0xf800('0x52')]:_0x5c01ad['model'];_0x34e1e7[_0xf800('0x55')]=qs[_0xf800('0x56')](_0x2ca122['query'][_0xf800('0x56')]);_0x34e1e7[_0xf800('0x57')]=qs['filters'](_[_0xf800('0x58')](_0x2ca122[_0xf800('0x4e')],_0x5c01ad[_0xf800('0x50')]));if(_0x2ca122[_0xf800('0x4e')][_0xf800('0x59')]){_0x34e1e7[_0xf800('0x57')]=_[_0xf800('0x5a')](_0x34e1e7['where'],{'$or':_[_0xf800('0x49')](_0x34e1e7[_0xf800('0x52')],function(_0x319f0a){var _0x4b98b4={};_0x4b98b4[_0x319f0a]={'$like':'%'+_0x2ca122[_0xf800('0x4e')]['filter']+'%'};return _0x4b98b4;})});}_0x34e1e7=_[_0xf800('0x5a')]({},_0x34e1e7,_0x2ca122[_0xf800('0x5c')]);return _0x48de78[_0xf800('0x106')](_0x34e1e7);}})[_0xf800('0x1b')](function(_0x6cd133){if(_0x6cd133){_0x306c2b=_0x6cd133[_0xf800('0x53')];if(!_0x2ca122[_0xf800('0x4e')]['hasOwnProperty'](_0xf800('0x74'))){_0x34e1e7[_0xf800('0x27')]=qs[_0xf800('0x27')](_0x2ca122['query']['limit']);_0x34e1e7[_0xf800('0x26')]=qs[_0xf800('0x26')](_0x2ca122[_0xf800('0x4e')][_0xf800('0x26')]);}return _0x48de78['getProactiveActions'](_0x34e1e7);}})[_0xf800('0x1b')](function(_0xe6d0d6){if(_0xe6d0d6){return _0xe6d0d6?{'count':_0x306c2b,'rows':_0xe6d0d6}:null;}})[_0xf800('0x1b')](respondWithResult(_0x50fa73,null))[_0xf800('0x23')](handleError(_0x50fa73,null));};exports['getFields']=function(_0x39214f,_0x3dbd38){var _0x1254c0=_0x39214f[_0xf800('0x4e')][_0xf800('0x123')]===_0xf800('0x124')?'offlineForm':_0xf800('0x125');return db['ChatWebsite'][_0xf800('0x63')]({'attributes':['id',_0x1254c0],'where':{'id':_0x39214f[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x3dbd38,null))[_0xf800('0x1b')](function(_0x2ccdc3){if(_0x2ccdc3){var _0x18b4da=_0x2ccdc3[_0x1254c0];var _0x186acd=_0x18b4da&&_0x18b4da['items']?_0x18b4da[_0xf800('0x126')]:[];_0x3dbd38[_0xf800('0x31')]({'fromKey':_['isNil'](_0x18b4da['fromKey'])?undefined:_0x18b4da[_0xf800('0x127')],'count':_0x186acd[_0xf800('0x53')],'rows':_0x186acd});}})[_0xf800('0x23')](handleError(_0x3dbd38,null));};exports[_0xf800('0x128')]=function(_0x469def,_0x117ed0){var _0x13cace={'raw':![],'where':{}};var _0x23124d={};var _0x377160={'count':0x0,'rows':[]};return db[_0xf800('0x4a')][_0xf800('0xfe')]({'where':{'id':_0x469def[_0xf800('0x61')]['id']}})['then'](handleEntityNotFound(_0x117ed0,null))[_0xf800('0x1b')](function(_0x5503e9){if(_0x5503e9){_0x23124d[_0xf800('0x43')]=_[_0xf800('0x4f')](db[_0xf800('0x129')][_0xf800('0x4b')]);_0x23124d[_0xf800('0x4e')]=_[_0xf800('0x4f')](_0x469def[_0xf800('0x4e')]);_0x23124d[_0xf800('0x50')]=_[_0xf800('0x62')](_0x23124d[_0xf800('0x43')],_0x23124d[_0xf800('0x4e')]);_0x13cace['attributes']=_[_0xf800('0x62')](_0x23124d[_0xf800('0x43')],qs['fields'](_0x469def[_0xf800('0x4e')][_0xf800('0x51')]));_0x13cace[_0xf800('0x52')]=_0x13cace[_0xf800('0x52')][_0xf800('0x53')]?_0x13cace[_0xf800('0x52')]:_0x23124d[_0xf800('0x43')];if(!_0x469def[_0xf800('0x4e')][_0xf800('0x54')](_0xf800('0x74'))){_0x13cace[_0xf800('0x27')]=qs[_0xf800('0x27')](_0x469def[_0xf800('0x4e')]['limit']);_0x13cace[_0xf800('0x26')]=qs[_0xf800('0x26')](_0x469def[_0xf800('0x4e')][_0xf800('0x26')]);}_0x13cace['order']=qs[_0xf800('0x56')](_0x469def[_0xf800('0x4e')][_0xf800('0x56')]);_0x13cace[_0xf800('0x57')]=qs[_0xf800('0x50')](_[_0xf800('0x58')](_0x469def[_0xf800('0x4e')],_0x23124d[_0xf800('0x50')]));_0x13cace[_0xf800('0x57')][_0xf800('0x72')]=_0x5503e9['id'];if(_0x469def[_0xf800('0x4e')][_0xf800('0x59')]){_0x13cace['where']=_[_0xf800('0x5a')](_0x13cace['where'],{'$or':_[_0xf800('0x49')](_0x13cace[_0xf800('0x52')],function(_0x20abe5){var _0x49e52c={};_0x49e52c[_0x20abe5]={'$like':'%'+_0x469def[_0xf800('0x4e')]['filter']+'%'};return _0x49e52c;})});}_0x13cace=_[_0xf800('0x5a')]({},_0x13cace,_0x469def[_0xf800('0x5c')]);return db['ChatOfflineMessage'][_0xf800('0x28')]({'where':_0x13cace['where']})['then'](function(_0x1d86bf){_0x377160[_0xf800('0x28')]=_0x1d86bf;if(_0x469def[_0xf800('0x4e')][_0xf800('0xff')]){_0x13cace[_0xf800('0x5d')]=[{'all':!![]}];}else{_0x13cace[_0xf800('0x5d')]=[{'model':db[_0xf800('0xb7')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xf800('0x129')]['findAll'](_0x13cace);})[_0xf800('0x1b')](function(_0x4ea6c5){_0x377160[_0xf800('0x5f')]=_0x4ea6c5;return _0x377160;});}})[_0xf800('0x1b')](respondWithFilteredResult(_0x117ed0,_0x13cace))['catch'](handleError(_0x117ed0,null));};exports[_0xf800('0x12a')]=function(_0x533226,_0x4499da){return db[_0xf800('0x4a')]['find']({'where':{'id':_0x533226['params']['id']}})['then'](handleEntityNotFound(_0x4499da,null))[_0xf800('0x1b')](function(_0x13c891){if(_0x13c891){return _0x13c891['addAgents'](_0x533226[_0xf800('0x66')][_0xf800('0x76')],_['omit'](_0x533226[_0xf800('0x66')],['ids','id'])||{})[_0xf800('0xdc')](function(_0x24a24c){for(var _0x2cb1e5=0x0;_0x2cb1e5<_0x533226['body'][_0xf800('0x76')][_0xf800('0x53')];_0x2cb1e5+=0x1){socket['emit'](_0xf800('0x12b'),{'UserId':Number(_0x533226[_0xf800('0x66')][_0xf800('0x76')][_0x2cb1e5]),'ChatWebsiteId':Number(_0x533226[_0xf800('0x61')]['id'])});}return _0x24a24c;});}})[_0xf800('0x1b')](respondWithResult(_0x4499da,null))[_0xf800('0x23')](handleError(_0x4499da,null));};exports[_0xf800('0x12c')]=function(_0x4678d8,_0x14099f){return db[_0xf800('0x4a')][_0xf800('0x63')]({'where':{'id':_0x4678d8[_0xf800('0x61')]['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x14099f,null))[_0xf800('0x1b')](function(_0x5496e7){if(_0x5496e7){return _0x5496e7[_0xf800('0x12c')](_0x4678d8[_0xf800('0x4e')][_0xf800('0x76')])['then'](function(){if(_[_0xf800('0x12d')](_0x4678d8[_0xf800('0x4e')][_0xf800('0x76')])){for(var _0x21fb14=0x0;_0x21fb14<_0x4678d8[_0xf800('0x4e')][_0xf800('0x76')][_0xf800('0x53')];_0x21fb14+=0x1){socket['emit'](_0xf800('0x12e'),{'UserId':Number(_0x4678d8['query'][_0xf800('0x76')][_0x21fb14]),'ChatWebsiteId':Number(_0x4678d8[_0xf800('0x61')]['id'])});}}else{socket[_0xf800('0x12f')](_0xf800('0x12e'),{'UserId':Number(_0x4678d8[_0xf800('0x4e')][_0xf800('0x76')]),'ChatWebsiteId':Number(_0x4678d8[_0xf800('0x61')]['id'])});}});}})[_0xf800('0x1b')](respondWithStatusCode(_0x14099f,null))[_0xf800('0x23')](handleError(_0x14099f,null));};exports[_0xf800('0x130')]=function(_0x12a36a,_0x2efd73){var _0x5ae7e0={};var _0xf4fa43={};var _0x2961be;var _0x3607ee;return db[_0xf800('0x4a')][_0xf800('0xfe')]({'where':{'id':_0x12a36a['params']['id']}})[_0xf800('0x1b')](handleEntityNotFound(_0x2efd73,null))[_0xf800('0x1b')](function(_0x3dc9a9){if(_0x3dc9a9){_0x2961be=_0x3dc9a9;_0xf4fa43['model']=_[_0xf800('0x4f')](db[_0xf800('0xc7')][_0xf800('0x4b')]);_0xf4fa43[_0xf800('0x4e')]=_[_0xf800('0x4f')](_0x12a36a[_0xf800('0x4e')]);_0xf4fa43['filters']=_[_0xf800('0x62')](_0xf4fa43['model'],_0xf4fa43[_0xf800('0x4e')]);_0x5ae7e0['attributes']=_['intersection'](_0xf4fa43[_0xf800('0x43')],qs[_0xf800('0x51')](_0x12a36a[_0xf800('0x4e')][_0xf800('0x51')]));_0x5ae7e0['attributes']=_0x5ae7e0['attributes'][_0xf800('0x53')]?_0x5ae7e0[_0xf800('0x52')]:_0xf4fa43[_0xf800('0x43')];_0x5ae7e0[_0xf800('0x55')]=qs[_0xf800('0x56')](_0x12a36a[_0xf800('0x4e')][_0xf800('0x56')]);_0x5ae7e0['where']=qs['filters'](_['pick'](_0x12a36a[_0xf800('0x4e')],_0xf4fa43[_0xf800('0x50')]));if(_0x12a36a[_0xf800('0x4e')][_0xf800('0x59')]){_0x5ae7e0['where']=_[_0xf800('0x5a')](_0x5ae7e0[_0xf800('0x57')],{'$or':_[_0xf800('0x49')](_0x5ae7e0[_0xf800('0x52')],function(_0x32b500){var _0xbb7b31={};_0xbb7b31[_0x32b500]={'$like':'%'+_0x12a36a['query'][_0xf800('0x59')]+'%'};return _0xbb7b31;})});}_0x5ae7e0=_[_0xf800('0x5a')]({},_0x5ae7e0,_0x12a36a['options']);return _0x2961be[_0xf800('0x130')](_0x5ae7e0);}})[_0xf800('0x1b')](function(_0x24aa23){if(_0x24aa23){_0x3607ee=_0x24aa23[_0xf800('0x53')];if(!_0x12a36a[_0xf800('0x4e')][_0xf800('0x54')](_0xf800('0x74'))){_0x5ae7e0[_0xf800('0x27')]=qs['limit'](_0x12a36a['query'][_0xf800('0x27')]);_0x5ae7e0['offset']=qs[_0xf800('0x26')](_0x12a36a[_0xf800('0x4e')]['offset']);}return _0x2961be[_0xf800('0x130')](_0x5ae7e0);}})[_0xf800('0x1b')](function(_0x5ceecb){if(_0x5ceecb){return _0x5ceecb?{'count':_0x3607ee,'rows':_0x5ceecb}:null;}})[_0xf800('0x1b')](respondWithResult(_0x2efd73,null))['catch'](handleError(_0x2efd73,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index f47de31..9a054d4 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 _0xe3c5=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x20936e,_0x4d5283){var _0x50a212=function(_0x467a9a){while(--_0x467a9a){_0x20936e['push'](_0x20936e['shift']());}};_0x50a212(++_0x4d5283);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x1ec8f9,_0x22f5e7){_0x1ec8f9=_0x1ec8f9-0x0;var _0x17cd3d=_0xe3c5[_0x1ec8f9];return _0x17cd3d;};'use strict';var EventEmitter=require(_0x5e3c('0x0'));var ChatWebsite=require(_0x5e3c('0x1'))['db'][_0x5e3c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5e3c('0x3')](0x0);var events={'afterCreate':_0x5e3c('0x4'),'afterUpdate':_0x5e3c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x46e129){return function(_0x2ef6cd,_0x361936,_0x2a7d7a){ChatWebsiteEvents[_0x5e3c('0x6')](_0x46e129+':'+_0x2ef6cd['id'],_0x2ef6cd);ChatWebsiteEvents[_0x5e3c('0x6')](_0x46e129,_0x2ef6cd);_0x2a7d7a(null);};}for(var e in events){if(events[_0x5e3c('0x7')](e)){var event=events[e];ChatWebsite[_0x5e3c('0x8')](e,emitEvent(event));}}module[_0x5e3c('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xc9b7=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x4ffafb,_0x20171a){var _0x4ab472=function(_0x1afc75){while(--_0x1afc75){_0x4ffafb['push'](_0x4ffafb['shift']());}};_0x4ab472(++_0x20171a);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x3cc90b,_0x1b69d9){_0x3cc90b=_0x3cc90b-0x0;var _0x34051b=_0xc9b7[_0x3cc90b];return _0x34051b;};'use strict';var EventEmitter=require(_0x7c9b('0x0'));var ChatWebsite=require(_0x7c9b('0x1'))['db'][_0x7c9b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7c9b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c9b('0x4'),'afterDestroy':_0x7c9b('0x5')};function emitEvent(_0x56f327){return function(_0x474486,_0x365dd6,_0x1fb942){ChatWebsiteEvents[_0x7c9b('0x6')](_0x56f327+':'+_0x474486['id'],_0x474486);ChatWebsiteEvents[_0x7c9b('0x6')](_0x56f327,_0x474486);_0x1fb942(null);};}for(var e in events){if(events[_0x7c9b('0x7')](e)){var event=events[e];ChatWebsite[_0x7c9b('0x8')](e,emitEvent(event));}}module[_0x7c9b('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 764fc55..e2fe637 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 _0x0142=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4cc95a,_0x15c4c7){var _0x4abee3=function(_0x5e9e49){while(--_0x5e9e49){_0x4cc95a['push'](_0x4cc95a['shift']());}};_0x4abee3(++_0x15c4c7);}(_0x0142,0x10d));var _0x2014=function(_0x372b5a,_0x5d3393){_0x372b5a=_0x372b5a-0x0;var _0x43ac01=_0x0142[_0x372b5a];return _0x43ac01;};'use strict';var _=require(_0x2014('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2014('0x1'));var moment=require('moment');var BPromise=require(_0x2014('0x2'));var rp=require(_0x2014('0x3'));var fs=require('fs');var path=require(_0x2014('0x4'));var rimraf=require(_0x2014('0x5'));var config=require(_0x2014('0x6'));var attributes=require(_0x2014('0x7'));module[_0x2014('0x8')]=function(_0x363051,_0x197022){return _0x363051[_0x2014('0x9')](_0x2014('0xa'),attributes,{'tableName':_0x2014('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9708=['define','ChatWebsite','chat_websites','lodash','util','api','bluebird','path','../../config/environment','./chatWebsite.attributes'];(function(_0x408adb,_0x1c32f1){var _0x2fca01=function(_0xf46442){while(--_0xf46442){_0x408adb['push'](_0x408adb['shift']());}};_0x2fca01(++_0x1c32f1);}(_0x9708,0x1b1));var _0x8970=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x9708[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0x8970('0x0'));var util=require(_0x8970('0x1'));var logger=require('../../config/logger')(_0x8970('0x2'));var moment=require('moment');var BPromise=require(_0x8970('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8970('0x4'));var rimraf=require('rimraf');var config=require(_0x8970('0x5'));var attributes=require(_0x8970('0x6'));module['exports']=function(_0x49a369,_0x51f57c){return _0x49a369[_0x8970('0x7')](_0x8970('0x8'),attributes,{'tableName':_0x8970('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 0217b3b..de0b5e1 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 _0x4ce1=['result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xdd3f9a,_0x4d9fbc){var _0x4186f3=function(_0x10f696){while(--_0x10f696){_0xdd3f9a['push'](_0xdd3f9a['shift']());}};_0x4186f3(++_0x4d9fbc);}(_0x4ce1,0xfb));var _0x14ce=function(_0xb60612,_0x1333bf){_0xb60612=_0xb60612-0x0;var _0x382e53=_0x4ce1[_0xb60612];return _0x382e53;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x14ce('0x0'));var BPromise=require('bluebird');var rs=require(_0x14ce('0x1'));var fs=require('fs');var Redis=require(_0x14ce('0x2'));var db=require(_0x14ce('0x3'))['db'];var utils=require(_0x14ce('0x4'));var logger=require(_0x14ce('0x5'))(_0x14ce('0x6'));var config=require(_0x14ce('0x7'));var jayson=require(_0x14ce('0x8'));var client=jayson[_0x14ce('0x9')][_0x14ce('0xa')]({'port':0x232a});config[_0x14ce('0xb')]=_['defaults'](config[_0x14ce('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x14ce('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x14ce('0xd')](socket);function respondWithRpcPromise(_0x54bce0,_0x35e14f,_0x52425a){return new BPromise(function(_0x537b61,_0xe269e4){return client[_0x14ce('0xe')](_0x54bce0,_0x52425a)['then'](function(_0x17f754){logger[_0x14ce('0xf')](_0x14ce('0x10'),_0x35e14f,_0x14ce('0x11'));logger[_0x14ce('0x12')](_0x14ce('0x13'),_0x35e14f,_0x14ce('0x11'),JSON[_0x14ce('0x14')](_0x17f754));if(_0x17f754[_0x14ce('0x15')]){if(_0x17f754[_0x14ce('0x15')][_0x14ce('0x16')]===0x1f4){logger[_0x14ce('0x15')](_0x14ce('0x10'),_0x35e14f,_0x17f754['error'][_0x14ce('0x17')]);return _0xe269e4(_0x17f754['error'][_0x14ce('0x17')]);}logger[_0x14ce('0x15')](_0x14ce('0x10'),_0x35e14f,_0x17f754[_0x14ce('0x15')][_0x14ce('0x17')]);return _0x537b61(_0x17f754[_0x14ce('0x15')][_0x14ce('0x17')]);}else{logger[_0x14ce('0xf')](_0x14ce('0x10'),_0x35e14f,_0x14ce('0x11'));_0x537b61(_0x17f754[_0x14ce('0x18')][_0x14ce('0x17')]);}})['catch'](function(_0x32009b){logger['error'](_0x14ce('0x10'),_0x35e14f,_0x32009b);_0xe269e4(_0x32009b);});});} \ No newline at end of file +var _0xc26e=['../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0xc26e,0x19c));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec26('0x0'));var util=require('util');var moment=require(_0xec26('0x1'));var BPromise=require('bluebird');var rs=require(_0xec26('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec26('0x3'))['db'];var utils=require(_0xec26('0x4'));var logger=require('../../config/logger')(_0xec26('0x5'));var config=require(_0xec26('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xec26('0x7')][_0xec26('0x8')]({'port':0x232a});config[_0xec26('0x9')]=_[_0xec26('0xa')](config[_0xec26('0x9')],{'host':_0xec26('0xb'),'port':0x18eb});var socket=require(_0xec26('0xc'))(new Redis(config[_0xec26('0x9')]));require(_0xec26('0xd'))['register'](socket);function respondWithRpcPromise(_0x4bf35e,_0x30857e,_0x300113){return new BPromise(function(_0x171e7d,_0x5cefea){return client[_0xec26('0xe')](_0x4bf35e,_0x300113)[_0xec26('0xf')](function(_0x1e6375){logger[_0xec26('0x10')](_0xec26('0x11'),_0x30857e,_0xec26('0x12'));logger[_0xec26('0x13')](_0xec26('0x14'),_0x30857e,_0xec26('0x12'),JSON[_0xec26('0x15')](_0x1e6375));if(_0x1e6375[_0xec26('0x16')]){if(_0x1e6375[_0xec26('0x16')][_0xec26('0x17')]===0x1f4){logger[_0xec26('0x16')](_0xec26('0x11'),_0x30857e,_0x1e6375['error'][_0xec26('0x18')]);return _0x5cefea(_0x1e6375['error'][_0xec26('0x18')]);}logger[_0xec26('0x16')](_0xec26('0x11'),_0x30857e,_0x1e6375[_0xec26('0x16')]['message']);return _0x171e7d(_0x1e6375[_0xec26('0x16')][_0xec26('0x18')]);}else{logger[_0xec26('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x30857e,_0xec26('0x12'));_0x171e7d(_0x1e6375['result']['message']);}})[_0xec26('0x19')](function(_0x1f1a91){logger[_0xec26('0x16')](_0xec26('0x11'),_0x30857e,_0x1f1a91);_0x5cefea(_0x1f1a91);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index bfd062d..2eefc86 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 _0x3b3b=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x4486ee,_0x85b039){var _0x2713cb=function(_0x2b67f0){while(--_0x2b67f0){_0x4486ee['push'](_0x4486ee['shift']());}};_0x2713cb(++_0x85b039);}(_0x3b3b,0x1b8));var _0xb3b3=function(_0x7d2daa,_0x5e7cf2){_0x7d2daa=_0x7d2daa-0x0;var _0x56d6b9=_0x3b3b[_0x7d2daa];return _0x56d6b9;};'use strict';var ChatWebsiteEvents=require(_0xb3b3('0x0'));var events=[_0xb3b3('0x1'),_0xb3b3('0x2'),_0xb3b3('0x3')];function createListener(_0x5aa400,_0x554995){return function(_0x4ea696){_0x554995[_0xb3b3('0x4')](_0x5aa400,_0x4ea696);};}function removeListener(_0x16c08b,_0x54842c){return function(){ChatWebsiteEvents[_0xb3b3('0x5')](_0x16c08b,_0x54842c);};}exports[_0xb3b3('0x6')]=function(_0x926f17){for(var _0x1de7bf=0x0,_0x578728=events[_0xb3b3('0x7')];_0x1de7bf<_0x578728;_0x1de7bf++){var _0x1d5a03=events[_0x1de7bf];var _0x1f6f04=createListener(_0xb3b3('0x8')+_0x1d5a03,_0x926f17);ChatWebsiteEvents['on'](_0x1d5a03,_0x1f6f04);}}; \ No newline at end of file +var _0xd0e1=['update','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0xd0e1,0x140));var _0x1d0e=function(_0x86839d,_0x52f9d6){_0x86839d=_0x86839d-0x0;var _0x12b631=_0xd0e1[_0x86839d];return _0x12b631;};'use strict';var ChatWebsiteEvents=require(_0x1d0e('0x0'));var events=[_0x1d0e('0x1'),'remove',_0x1d0e('0x2')];function createListener(_0x43012b,_0x5160f7){return function(_0x43bcfd){_0x5160f7['emit'](_0x43012b,_0x43bcfd);};}function removeListener(_0x3f00c5,_0x110a97){return function(){ChatWebsiteEvents[_0x1d0e('0x3')](_0x3f00c5,_0x110a97);};}exports[_0x1d0e('0x4')]=function(_0x3fa82e){for(var _0x42e3da=0x0,_0x3dbd39=events[_0x1d0e('0x5')];_0x42e3da<_0x3dbd39;_0x42e3da++){var _0x5645ff=events[_0x42e3da];var _0x51d363=createListener(_0x1d0e('0x6')+_0x5645ff,_0x3fa82e);ChatWebsiteEvents['on'](_0x5645ff,_0x51d363);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index e8615e0..2e61a76 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x894f=['../../../utils/misc','escapeRegExp','url','URL','replace','localhost','([\x5cw]+)','test','exports'];(function(_0x41e631,_0x3bb17f){var _0xbdc446=function(_0x3957b7){while(--_0x3957b7){_0x41e631['push'](_0x41e631['shift']());}};_0xbdc446(++_0x3bb17f);}(_0x894f,0x14d));var _0xf894=function(_0x24bb1d,_0x26de59){_0x24bb1d=_0x24bb1d-0x0;var _0x51c71a=_0x894f[_0x24bb1d];return _0x51c71a;};var escapeRegExp=require(_0xf894('0x0'))[_0xf894('0x1')];var URL=require(_0xf894('0x2'))[_0xf894('0x3')];function testWildcardValidity(_0x4d2b83){let _0x4e1a16=!![];try{new URL(_0x4d2b83[_0xf894('0x4')]('*',_0xf894('0x5')));}catch(_0x4b6a61){_0x4e1a16=![];}return _0x4e1a16&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x4d2b83);}function testWebsiteWithWildcard(_0x1e9f6e,_0x3b9629){let _0x4e2af3;const _0x5814d3=escapeRegExp(_0x1e9f6e)[_0xf894('0x4')]('\x5c*',_0xf894('0x6'));try{new URL(_0x1e9f6e['replace']('\x5c*',_0xf894('0x5')));_0x4e2af3=new RegExp(_0x5814d3)[_0xf894('0x7')](_0x3b9629);}catch(_0x152170){_0x4e2af3=![];}return _0x4e2af3;}module[_0xf894('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x222f=['replace','localhost','test','exports','../../../utils/misc','escapeRegExp','url','URL'];(function(_0x39deb4,_0x17f79e){var _0x4fbf7b=function(_0x43ad63){while(--_0x43ad63){_0x39deb4['push'](_0x39deb4['shift']());}};_0x4fbf7b(++_0x17f79e);}(_0x222f,0x1a4));var _0xf222=function(_0x11ad65,_0x352d3c){_0x11ad65=_0x11ad65-0x0;var _0x35590c=_0x222f[_0x11ad65];return _0x35590c;};var escapeRegExp=require(_0xf222('0x0'))[_0xf222('0x1')];var URL=require(_0xf222('0x2'))[_0xf222('0x3')];function testWildcardValidity(_0x4d09ec){let _0x4b4237=!![];try{new URL(_0x4d09ec[_0xf222('0x4')]('*',_0xf222('0x5')));}catch(_0x307791){_0x4b4237=![];}return _0x4b4237&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xf222('0x6')](_0x4d09ec);}function testWebsiteWithWildcard(_0x59a619,_0x3a2751){let _0x54a758;const _0x112e6d=escapeRegExp(_0x59a619)[_0xf222('0x4')]('\x5c*','([\x5cw]+)');try{new URL(_0x59a619[_0xf222('0x4')]('\x5c*',_0xf222('0x5')));_0x54a758=new RegExp(_0x112e6d)['test'](_0x3a2751);}catch(_0x31c027){_0x54a758=![];}return _0x54a758;}module[_0xf222('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index d2f0481..5ceaef2 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 _0x0da4=['/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','/:id/dispositions','join','root','server/files/images/logos/','%s-%s','now','/:id/logo','single','file','addLogo','format','originalname','addAvatar','diskStorage','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','/:id/offline','any','addInteraction','addApplications','addAgents','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatWebsite.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar'];(function(_0x47037a,_0x13bcfc){var _0x5de589=function(_0x132d1d){while(--_0x132d1d){_0x47037a['push'](_0x47037a['shift']());}};_0x5de589(++_0x13bcfc);}(_0x0da4,0x68));var _0x40da=function(_0x2450aa,_0x4d4544){_0x2450aa=_0x2450aa-0x0;var _0x156b5c=_0x0da4[_0x2450aa];return _0x156b5c;};'use strict';var multer=require(_0x40da('0x0'));var util=require(_0x40da('0x1'));var path=require(_0x40da('0x2'));var timeout=require(_0x40da('0x3'));var express=require(_0x40da('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x40da('0x5'));var controller=require(_0x40da('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x40da('0x7')]);router[_0x40da('0x8')](_0x40da('0x9'),auth[_0x40da('0xa')](),controller[_0x40da('0xb')]);router['get'](_0x40da('0xc'),auth[_0x40da('0xa')](),controller[_0x40da('0xd')]);router['get']('/:id/dispositions',auth[_0x40da('0xa')](),controller[_0x40da('0xe')]);router['get'](_0x40da('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x40da('0x8')]('/:id/logo',controller[_0x40da('0x10')]);router[_0x40da('0x8')](_0x40da('0x11'),controller[_0x40da('0x12')]);router[_0x40da('0x8')](_0x40da('0x13'),controller[_0x40da('0x14')]);router[_0x40da('0x8')](_0x40da('0x15'),controller['getSystemAvatar']);router[_0x40da('0x8')]('/:id/interactions',auth[_0x40da('0xa')](),controller['getInteractions']);router['get'](_0x40da('0x16'),controller[_0x40da('0x17')]);router[_0x40da('0x8')](_0x40da('0x18'),auth[_0x40da('0xa')](),controller[_0x40da('0x19')]);router[_0x40da('0x8')](_0x40da('0x1a'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x40da('0x1b'),controller[_0x40da('0x1c')]);router[_0x40da('0x8')](_0x40da('0x1d'),auth[_0x40da('0xa')](),controller[_0x40da('0x1e')]);router[_0x40da('0x8')](_0x40da('0x1f'),auth[_0x40da('0xa')](),controller['getAgents']);router[_0x40da('0x20')]('/',auth['isAuthenticated'](),controller['create']);router[_0x40da('0x20')](_0x40da('0x21'),auth[_0x40da('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x40da('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x541bcb,_0x190f30,_0x4e2d87){_0x4e2d87(null,path[_0x40da('0x22')](config[_0x40da('0x23')],_0x40da('0x24')));},'filename':function(_0x4b6d98,_0x57bfc8,_0x565511){_0x565511(null,util['format'](_0x40da('0x25'),Date[_0x40da('0x26')](),_0x57bfc8['originalname']));}})});router[_0x40da('0x20')](_0x40da('0x27'),upload[_0x40da('0x28')](_0x40da('0x29')),controller[_0x40da('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5adfb9,_0x10ecfd,_0x5179f6){_0x5179f6(null,path[_0x40da('0x22')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2f62d7,_0x51a182,_0x40160d){_0x40160d(null,util[_0x40da('0x2b')](_0x40da('0x25'),Date[_0x40da('0x26')](),_0x51a182[_0x40da('0x2c')]));}})});router[_0x40da('0x20')](_0x40da('0x11'),upload[_0x40da('0x28')](_0x40da('0x29')),controller[_0x40da('0x2d')]);var upload=multer({'storage':multer[_0x40da('0x2e')]({'destination':function(_0x44672a,_0x2e820b,_0x29bc4a){_0x29bc4a(null,path[_0x40da('0x22')](config[_0x40da('0x23')],_0x40da('0x2f')));},'filename':function(_0x495d1b,_0x372d31,_0x5f9065){_0x5f9065(null,util['format']('%s-%s',Date[_0x40da('0x26')](),_0x372d31[_0x40da('0x2c')]));}})});router[_0x40da('0x20')](_0x40da('0x13'),upload['single'](_0x40da('0x29')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1653a5,_0x4cde83,_0x2a2eb1){_0x2a2eb1(null,path[_0x40da('0x22')](config[_0x40da('0x23')],_0x40da('0x2f')));},'filename':function(_0x389caf,_0xae2cca,_0x2b8f31){_0x2b8f31(null,util[_0x40da('0x2b')]('%s-%s',Date[_0x40da('0x26')](),_0xae2cca[_0x40da('0x2c')]));}})});router[_0x40da('0x20')]('/:id/system_avatar',upload[_0x40da('0x28')](_0x40da('0x29')),controller[_0x40da('0x30')]);router[_0x40da('0x20')](_0x40da('0x31'),controller[_0x40da('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x40da('0x2e')]({'destination':function(_0x28b8a0,_0x51b67a,_0xfd84e){const _0x5688d4=path[_0x40da('0x22')](config[_0x40da('0x23')],_0x40da('0x33'),'attachments',_0x40da('0x34'));fs_extra['ensureDir'](_0x5688d4,function(){_0xfd84e(null,_0x5688d4);});},'filename':function(_0x596b41,_0x4fa68c,_0xdd749c){const _0xa8fafc=_0x4fa68c[_0x40da('0x2c')][_0x40da('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x178a13=path['extname'](_0xa8fafc);const _0x586092=Date[_0x40da('0x26')]()+'-'+_0xa8fafc[_0x40da('0x35')](_0x178a13,'')+_0x178a13;_0xdd749c(null,_0x586092);}})});router['post'](_0x40da('0x36'),offlineUploadMulter[_0x40da('0x37')](),controller['offline']);router[_0x40da('0x20')]('/:id/interactions',auth[_0x40da('0xa')](),controller[_0x40da('0x38')]);router[_0x40da('0x20')](_0x40da('0x18'),auth[_0x40da('0xa')](),controller[_0x40da('0x39')]);router[_0x40da('0x20')](_0x40da('0x1a'),auth[_0x40da('0xa')](),controller['addProactiveActions']);router[_0x40da('0x20')](_0x40da('0x1f'),auth[_0x40da('0xa')](),controller[_0x40da('0x3a')]);router['put'](_0x40da('0xc'),auth[_0x40da('0xa')](),controller['update']);router[_0x40da('0x3b')](_0x40da('0xc'),auth['isAuthenticated'](),controller[_0x40da('0x3c')]);router['delete'](_0x40da('0x21'),auth[_0x40da('0xa')](),controller['removeDispositions']);router[_0x40da('0x3b')](_0x40da('0xf'),auth[_0x40da('0xa')](),controller[_0x40da('0x3d')]);router['delete'](_0x40da('0x1f'),auth[_0x40da('0xa')](),controller['removeAgents']);module[_0x40da('0x3e')]=router; \ No newline at end of file +var _0xf83c=['server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','delete','destroy','/:id/dispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','show','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','post','create','addDisposition','addAnswer','root','now','originalname','addLogo','diskStorage','server/files/images/avatars/','format','%s-%s','file','addAvatar','/:id/customer_avatar','single','join','/:id/system_avatar','notify'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0xf83c,0x11e));var _0xcf83=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0xf83c[_0x5c72ee];return _0x231876;};'use strict';var multer=require(_0xcf83('0x0'));var util=require(_0xcf83('0x1'));var path=require(_0xcf83('0x2'));var timeout=require(_0xcf83('0x3'));var express=require(_0xcf83('0x4'));var router=express[_0xcf83('0x5')]();var fs_extra=require(_0xcf83('0x6'));var auth=require(_0xcf83('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcf83('0x8'));var controller=require(_0xcf83('0x9'));router[_0xcf83('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcf83('0xa')](_0xcf83('0xb'),auth[_0xcf83('0xc')](),controller['describe']);router[_0xcf83('0xa')]('/:id',auth[_0xcf83('0xc')](),controller[_0xcf83('0xd')]);router[_0xcf83('0xa')]('/:id/dispositions',auth[_0xcf83('0xc')](),controller['getDispositions']);router[_0xcf83('0xa')](_0xcf83('0xe'),auth[_0xcf83('0xc')](),controller[_0xcf83('0xf')]);router[_0xcf83('0xa')]('/:id/logo',controller[_0xcf83('0x10')]);router[_0xcf83('0xa')](_0xcf83('0x11'),controller['getAvatar']);router[_0xcf83('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xcf83('0xa')]('/:id/system_avatar',controller[_0xcf83('0x12')]);router[_0xcf83('0xa')](_0xcf83('0x13'),auth['isAuthenticated'](),controller[_0xcf83('0x14')]);router[_0xcf83('0xa')](_0xcf83('0x15'),controller[_0xcf83('0x16')]);router[_0xcf83('0xa')](_0xcf83('0x17'),auth[_0xcf83('0xc')](),controller[_0xcf83('0x18')]);router[_0xcf83('0xa')](_0xcf83('0x19'),auth[_0xcf83('0xc')](),controller[_0xcf83('0x1a')]);router[_0xcf83('0xa')](_0xcf83('0x1b'),controller[_0xcf83('0x1c')]);router[_0xcf83('0xa')]('/:id/offline_messages',auth[_0xcf83('0xc')](),controller[_0xcf83('0x1d')]);router['get']('/:id/users',auth[_0xcf83('0xc')](),controller['getAgents']);router[_0xcf83('0x1e')]('/',auth[_0xcf83('0xc')](),controller[_0xcf83('0x1f')]);router['post']('/:id/dispositions',auth[_0xcf83('0xc')](),controller[_0xcf83('0x20')]);router[_0xcf83('0x1e')](_0xcf83('0xe'),auth[_0xcf83('0xc')](),controller[_0xcf83('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5558da,_0x422c0a,_0x5bbcc7){_0x5bbcc7(null,path['join'](config[_0xcf83('0x22')],'server/files/images/logos/'));},'filename':function(_0x22365f,_0x58e859,_0x1a49e0){_0x1a49e0(null,util['format']('%s-%s',Date[_0xcf83('0x23')](),_0x58e859[_0xcf83('0x24')]));}})});router['post']('/:id/logo',upload['single']('file'),controller[_0xcf83('0x25')]);var upload=multer({'storage':multer[_0xcf83('0x26')]({'destination':function(_0x5524c0,_0x87d612,_0x6e9225){_0x6e9225(null,path['join'](config[_0xcf83('0x22')],_0xcf83('0x27')));},'filename':function(_0x5bac9c,_0x3eda82,_0x46311e){_0x46311e(null,util[_0xcf83('0x28')](_0xcf83('0x29'),Date[_0xcf83('0x23')](),_0x3eda82[_0xcf83('0x24')]));}})});router[_0xcf83('0x1e')](_0xcf83('0x11'),upload['single'](_0xcf83('0x2a')),controller[_0xcf83('0x2b')]);var upload=multer({'storage':multer[_0xcf83('0x26')]({'destination':function(_0x3b74ac,_0x382811,_0x15b3ab){_0x15b3ab(null,path['join'](config[_0xcf83('0x22')],_0xcf83('0x27')));},'filename':function(_0x507ba7,_0x4b536a,_0xd01209){_0xd01209(null,util[_0xcf83('0x28')](_0xcf83('0x29'),Date['now'](),_0x4b536a['originalname']));}})});router[_0xcf83('0x1e')](_0xcf83('0x2c'),upload[_0xcf83('0x2d')](_0xcf83('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xcf83('0x26')]({'destination':function(_0x26fd9c,_0xa14616,_0x499626){_0x499626(null,path[_0xcf83('0x2e')](config[_0xcf83('0x22')],_0xcf83('0x27')));},'filename':function(_0x77c030,_0x1dc37c,_0x1f838c){_0x1f838c(null,util[_0xcf83('0x28')]('%s-%s',Date[_0xcf83('0x23')](),_0x1dc37c[_0xcf83('0x24')]));}})});router['post'](_0xcf83('0x2f'),upload[_0xcf83('0x2d')](_0xcf83('0x2a')),controller['addSystemAvatar']);router[_0xcf83('0x1e')]('/:id/notify',controller[_0xcf83('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x43b5ca,_0x534f09,_0x196ea4){const _0x44e045=path[_0xcf83('0x2e')](config['root'],_0xcf83('0x31'),_0xcf83('0x32'),'offline-chat');fs_extra[_0xcf83('0x33')](_0x44e045,function(){_0x196ea4(null,_0x44e045);});},'filename':function(_0x5407e0,_0x2fc7fa,_0x55d8ec){const _0x2b79c1=_0x2fc7fa[_0xcf83('0x24')][_0xcf83('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x7159e0=path[_0xcf83('0x35')](_0x2b79c1);const _0x96c6a8=Date['now']()+'-'+_0x2b79c1[_0xcf83('0x34')](_0x7159e0,'')+_0x7159e0;_0x55d8ec(null,_0x96c6a8);}})});router[_0xcf83('0x1e')](_0xcf83('0x36'),offlineUploadMulter[_0xcf83('0x37')](),controller[_0xcf83('0x38')]);router[_0xcf83('0x1e')](_0xcf83('0x13'),auth[_0xcf83('0xc')](),controller[_0xcf83('0x39')]);router[_0xcf83('0x1e')]('/:id/applications',auth[_0xcf83('0xc')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0xcf83('0xc')](),controller[_0xcf83('0x3a')]);router[_0xcf83('0x1e')](_0xcf83('0x3b'),auth[_0xcf83('0xc')](),controller[_0xcf83('0x3c')]);router[_0xcf83('0x3d')]('/:id',auth[_0xcf83('0xc')](),controller['update']);router[_0xcf83('0x3e')]('/:id',auth[_0xcf83('0xc')](),controller[_0xcf83('0x3f')]);router['delete'](_0xcf83('0x40'),auth[_0xcf83('0xc')](),controller['removeDispositions']);router[_0xcf83('0x3e')](_0xcf83('0xe'),auth[_0xcf83('0xc')](),controller[_0xcf83('0x41')]);router[_0xcf83('0x3e')](_0xcf83('0x3b'),auth[_0xcf83('0xc')](),controller[_0xcf83('0x42')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 60b784f..37faa89 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 _0x1e6c=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x197767,_0x400276){_0x197767=_0x197767-0x0;var _0x5422c6=_0x1e6c[_0x197767];return _0x5422c6;};var beaverLogger=require(_0xc1e6('0x0'));var express=require('express');var auth=require(_0xc1e6('0x1'));var config=require(_0xc1e6('0x2'));var router=express[_0xc1e6('0x3')]();var isProduction=config[_0xc1e6('0x4')]===_0xc1e6('0x5')||![];function clientSideLogs(_0x5e24f7,_0x579250,_0x477d95){var _0x345fac=_0x5e24f7[_0xc1e6('0x6')][_0xc1e6('0x7')](_0xc1e6('0x8'));if(!_0x345fac){throw new Error(_0xc1e6('0x9'));}return beaverLogger[_0xc1e6('0xa')]({'uri':'/client-logs','logger':_0x345fac,'enableCors':!isProduction})(_0x5e24f7,_0x579250,_0x477d95);}router[_0xc1e6('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0xc1e6('0xc')]=router; \ No newline at end of file +var _0x6738=['express','../config/environment','Router','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','beaver-logger/server'];(function(_0x43bb22,_0x127f6b){var _0xd2adef=function(_0x44f446){while(--_0x44f446){_0x43bb22['push'](_0x43bb22['shift']());}};_0xd2adef(++_0x127f6b);}(_0x6738,0x103));var _0x8673=function(_0x2dd3d8,_0x2a49b5){_0x2dd3d8=_0x2dd3d8-0x0;var _0x5ebf99=_0x6738[_0x2dd3d8];return _0x5ebf99;};var beaverLogger=require(_0x8673('0x0'));var express=require(_0x8673('0x1'));var auth=require('../components/auth/service');var config=require(_0x8673('0x2'));var router=express[_0x8673('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x2b1bfb,_0x72a71d,_0x51faaf){var _0x48f133=_0x2b1bfb[_0x8673('0x4')][_0x8673('0x5')]('client-side-logger');if(!_0x48f133){throw new Error(_0x8673('0x6'));}return beaverLogger[_0x8673('0x7')]({'uri':'/client-logs','logger':_0x48f133,'enableCors':!isProduction})(_0x2b1bfb,_0x72a71d,_0x51faaf);}router[_0x8673('0x8')](auth[_0x8673('0x9')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index d50f6e0..5c6ac7a 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 _0x9fb5=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9fb5,0x92));var _0x59fb=function(_0x451d84,_0x29b5d2){_0x451d84=_0x451d84-0x0;var _0x7426e1=_0x9fb5[_0x451d84];return _0x7426e1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x59fb('0x0'),_0x59fb('0x1')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x59fb('0x2')](_0x59fb('0x3'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x59fb('0x4')},'data2':{'type':Sequelize[_0x59fb('0x5')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x59fb('0x6')},'data4':{'type':Sequelize[_0x59fb('0x5')],'comment':_0x59fb('0x7')},'data5':{'type':Sequelize[_0x59fb('0x8')],'comment':_0x59fb('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x59fb('0xa')}}; \ No newline at end of file +var _0x237b=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x237b,0x112));var _0xb237=function(_0x3ee898,_0x277d5c){_0x3ee898=_0x3ee898-0x0;var _0xaf93e=_0x237b[_0x3ee898];return _0xaf93e;};'use strict';var Sequelize=require(_0xb237('0x0'));module[_0xb237('0x1')]={'name':{'type':Sequelize[_0xb237('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb237('0x3')](_0xb237('0x4'),_0xb237('0x5'),_0xb237('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xb237('0x7'),_0xb237('0x8'))},'data1':{'type':Sequelize[_0xb237('0x2')],'comment':_0xb237('0x9')},'data2':{'type':Sequelize[_0xb237('0x2')],'comment':_0xb237('0xa')},'data3':{'type':Sequelize[_0xb237('0x2')],'comment':_0xb237('0xb')},'data4':{'type':Sequelize[_0xb237('0x2')],'comment':_0xb237('0xc')},'data5':{'type':Sequelize['TEXT'],'comment':_0xb237('0xd')},'data6':{'type':Sequelize[_0xb237('0xe')],'comment':_0xb237('0xf')},'data7':{'type':Sequelize[_0xb237('0xe')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 0549499..6db6621 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 _0x6f3f=['offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','keys','length','merge','find','service','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','oauth2MicrosoftAuthorize','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status'];(function(_0x276468,_0x132360){var _0xbb0e08=function(_0x272c09){while(--_0x272c09){_0x276468['push'](_0x276468['shift']());}};_0xbb0e08(++_0x132360);}(_0x6f3f,0x1e7));var _0xf6f3=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x6f3f[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xf6f3('0x0'));var Redis=require(_0xf6f3('0x1'));var qs=require(_0xf6f3('0x2'));var encryptor=require(_0xf6f3('0x3'));var config=require(_0xf6f3('0x4'));var logger=require('../../config/logger')(_0xf6f3('0x5'));var db=require(_0xf6f3('0x6'))['db'];var oauth=require(_0xf6f3('0x7'));config[_0xf6f3('0x8')]=_[_0xf6f3('0x9')](config[_0xf6f3('0x8')],{'host':_0xf6f3('0xa'),'port':0x18eb});var socket=require(_0xf6f3('0xb'))(new Redis(config[_0xf6f3('0x8')]));var redis=new Redis(config[_0xf6f3('0x8')]);function respondWithStatusCode(_0x3acd85,_0x3f92cb){_0x3f92cb=_0x3f92cb||0xcc;return function(_0x709433){if(_0x709433){return _0x3acd85['sendStatus'](_0x3f92cb);}return _0x3acd85['status'](_0x3f92cb)['end']();};}function respondWithResult(_0x1446b2,_0x49dd43){_0x49dd43=_0x49dd43||0xc8;return function(_0x2e5e30){if(_0x2e5e30){return _0x1446b2[_0xf6f3('0xc')](_0x49dd43)['json'](_0x2e5e30);}};}function respondWithFilteredResult(_0x582da1,_0x57cd5b){return function(_0x3e649e){if(_0x3e649e){var _0x3d4741=typeof _0x57cd5b[_0xf6f3('0xd')]===_0xf6f3('0xe')&&typeof _0x57cd5b[_0xf6f3('0xf')]===_0xf6f3('0xe');var _0x3324fb=_0x3e649e[_0xf6f3('0x10')];var _0x338139=_0x3d4741?0x0:_0x57cd5b[_0xf6f3('0xd')];var _0x1c0b17=_0x3d4741?_0x3e649e['count']:_0x57cd5b['offset']+_0x57cd5b['limit'];var _0x35b6a6;if(_0x1c0b17>=_0x3324fb){_0x1c0b17=_0x3324fb;_0x35b6a6=0xc8;}else{_0x35b6a6=0xce;}_0x582da1[_0xf6f3('0xc')](_0x35b6a6);return _0x582da1[_0xf6f3('0x11')](_0xf6f3('0x12'),_0x338139+'-'+_0x1c0b17+'/'+_0x3324fb)['json'](_0x3e649e);}return null;};}function saveUpdates(_0x1aaa06){return function(_0x2947f7){if(_0x2947f7){return _0x2947f7[_0xf6f3('0x13')](_0x1aaa06)[_0xf6f3('0x14')](function(_0x1f22e8){return _0x1f22e8;});}return null;};}function removeEntity(_0x5e2336){return function(_0x22f1d8){if(_0x22f1d8){return _0x22f1d8[_0xf6f3('0x15')]()['then'](function(){_0x5e2336[_0xf6f3('0xc')](0xcc)[_0xf6f3('0x16')]();});}};}function handleEntityNotFound(_0x27f5ab){return function(_0x2b521b){if(!_0x2b521b){_0x27f5ab['sendStatus'](0x194);}return _0x2b521b;};}function handleError(_0x549f9f,_0x5089cc){_0x5089cc=_0x5089cc||0x1f4;return function(_0x19d616){logger[_0xf6f3('0x17')](_0x19d616[_0xf6f3('0x18')]);if(_0x19d616[_0xf6f3('0x19')]){delete _0x19d616[_0xf6f3('0x19')];}_0x549f9f[_0xf6f3('0xc')](_0x5089cc)[_0xf6f3('0x1a')](_0x19d616);};}function maskClientSecret(_0x372eec){return _[_0xf6f3('0x1b')](_0x372eec[_0xf6f3('0x1c')](0x0,0x3),0x14,'*');}exports[_0xf6f3('0x1d')]=function(_0x32df6d,_0x90276e){var _0x3eb368={},_0x16d66c={},_0x10b220={'count':0x0,'rows':[]};var _0x23ee98=_[_0xf6f3('0x1e')](db[_0xf6f3('0x1f')][_0xf6f3('0x20')],function(_0x321f8d){return{'name':_0x321f8d[_0xf6f3('0x21')],'type':_0x321f8d['type']['key']};});_0x16d66c[_0xf6f3('0x22')]=_['map'](_0x23ee98,_0xf6f3('0x19'));_0x16d66c[_0xf6f3('0x23')]=_['keys'](_0x32df6d['query']);_0x16d66c[_0xf6f3('0x24')]=_['intersection'](_0x16d66c['model'],_0x16d66c[_0xf6f3('0x23')]);_0x3eb368[_0xf6f3('0x25')]=_[_0xf6f3('0x26')](_0x16d66c['model'],qs['fields'](_0x32df6d['query'][_0xf6f3('0x27')]));_0x3eb368[_0xf6f3('0x25')]=_0x3eb368['attributes']['length']?_0x3eb368[_0xf6f3('0x25')]:_0x16d66c[_0xf6f3('0x22')];if(!_0x32df6d[_0xf6f3('0x23')][_0xf6f3('0x28')](_0xf6f3('0x29'))){_0x3eb368[_0xf6f3('0xf')]=qs[_0xf6f3('0xf')](_0x32df6d[_0xf6f3('0x23')][_0xf6f3('0xf')]);_0x3eb368[_0xf6f3('0xd')]=qs['offset'](_0x32df6d['query'][_0xf6f3('0xd')]);}_0x3eb368['order']=qs[_0xf6f3('0x2a')](_0x32df6d[_0xf6f3('0x23')][_0xf6f3('0x2a')]);_0x3eb368[_0xf6f3('0x2b')]=qs[_0xf6f3('0x24')](_[_0xf6f3('0x2c')](_0x32df6d[_0xf6f3('0x23')],_0x16d66c[_0xf6f3('0x24')]),_0x23ee98);if(_0x32df6d[_0xf6f3('0x23')]['filter']){_0x3eb368['where']=_['merge'](_0x3eb368[_0xf6f3('0x2b')],{'$or':_['map'](_0x23ee98,function(_0x4bfedf){if(_0x4bfedf[_0xf6f3('0x2d')]!==_0xf6f3('0x2e')){var _0xaa4c7e={};_0xaa4c7e[_0x4bfedf[_0xf6f3('0x19')]]={'$like':'%'+_0x32df6d[_0xf6f3('0x23')][_0xf6f3('0x2f')]+'%'};return _0xaa4c7e;}})});}_0x3eb368=_['merge']({},_0x3eb368,_0x32df6d[_0xf6f3('0x30')]);var _0x17c0d7={'where':_0x3eb368[_0xf6f3('0x2b')]};return db['CloudProvider'][_0xf6f3('0x10')](_0x17c0d7)['then'](function(_0x5eb1b9){_0x10b220['count']=_0x5eb1b9;if(_0x32df6d[_0xf6f3('0x23')][_0xf6f3('0x31')]){_0x3eb368[_0xf6f3('0x32')]=[{'all':!![]}];}return db[_0xf6f3('0x1f')][_0xf6f3('0x33')](_0x3eb368);})[_0xf6f3('0x14')](function(_0x427851){_0x10b220[_0xf6f3('0x34')]=_[_0xf6f3('0x1e')](_0x427851,function(_0x13d0e8){if(_0x13d0e8['service']===_0xf6f3('0x35')){var _0x421ea4=encryptor[_0xf6f3('0x36')](_0x13d0e8['data3']);_0x13d0e8[_0xf6f3('0x37')]=maskClientSecret(_0x421ea4);}return _0x13d0e8;});return _0x10b220;})[_0xf6f3('0x14')](respondWithFilteredResult(_0x90276e,_0x3eb368))[_0xf6f3('0x38')](handleError(_0x90276e,null));};exports[_0xf6f3('0x39')]=function(_0x3903be,_0x1216f1){var _0x51bc3f={'raw':!![],'where':{'id':_0x3903be[_0xf6f3('0x3a')]['id']}},_0x1ce376={};_0x1ce376[_0xf6f3('0x22')]=_[_0xf6f3('0x3b')](db[_0xf6f3('0x1f')][_0xf6f3('0x20')]);_0x1ce376[_0xf6f3('0x23')]=_[_0xf6f3('0x3b')](_0x3903be[_0xf6f3('0x23')]);_0x1ce376['filters']=_[_0xf6f3('0x26')](_0x1ce376[_0xf6f3('0x22')],_0x1ce376['query']);_0x51bc3f[_0xf6f3('0x25')]=_['intersection'](_0x1ce376[_0xf6f3('0x22')],qs['fields'](_0x3903be[_0xf6f3('0x23')][_0xf6f3('0x27')]));_0x51bc3f[_0xf6f3('0x25')]=_0x51bc3f[_0xf6f3('0x25')][_0xf6f3('0x3c')]?_0x51bc3f[_0xf6f3('0x25')]:_0x1ce376[_0xf6f3('0x22')];if(_0x3903be[_0xf6f3('0x23')][_0xf6f3('0x31')]){_0x51bc3f[_0xf6f3('0x32')]=[{'all':!![]}];}_0x51bc3f=_[_0xf6f3('0x3d')]({},_0x51bc3f,_0x3903be['options']);return db[_0xf6f3('0x1f')][_0xf6f3('0x3e')](_0x51bc3f)[_0xf6f3('0x14')](handleEntityNotFound(_0x1216f1,null))[_0xf6f3('0x14')](function(_0x40cfd5){if(_0x40cfd5[_0xf6f3('0x3f')]===_0xf6f3('0x35')){var _0x194c44=encryptor['decryptString'](_0x40cfd5[_0xf6f3('0x37')]);_0x40cfd5[_0xf6f3('0x37')]=maskClientSecret(_0x194c44);}return _0x40cfd5;})[_0xf6f3('0x14')](respondWithResult(_0x1216f1,null))[_0xf6f3('0x38')](handleError(_0x1216f1,null));};exports['create']=function(_0x4a869b,_0x1fd5be){if(!_0x4a869b['body'][_0xf6f3('0x19')])throw new Error(_0xf6f3('0x40'));if(!_0x4a869b[_0xf6f3('0x41')]['service'])throw new Error(_0xf6f3('0x42'));var _0x4262b1=db[_0xf6f3('0x1f')]['rawAttributes'][_0xf6f3('0x3f')]['values'];if(!_0x4262b1[_0xf6f3('0x43')](_0x4a869b[_0xf6f3('0x41')][_0xf6f3('0x3f')]))throw new Error(_0xf6f3('0x44')+_0x4262b1[_0xf6f3('0x45')](',\x20'));if(_0x4a869b[_0xf6f3('0x41')][_0xf6f3('0x3f')]===_0xf6f3('0x35')&&_0x4a869b[_0xf6f3('0x41')][_0xf6f3('0x37')]){_0x4a869b[_0xf6f3('0x41')][_0xf6f3('0x37')]=encryptor[_0xf6f3('0x46')](_0x4a869b[_0xf6f3('0x41')][_0xf6f3('0x37')]);}return db[_0xf6f3('0x1f')][_0xf6f3('0x47')](_0x4a869b['body'],{})[_0xf6f3('0x14')](respondWithResult(_0x1fd5be,0xc9))['catch'](handleError(_0x1fd5be,null));};exports[_0xf6f3('0x13')]=function(_0x2b4235,_0x2fabd0){if(_0x2b4235['body']['id']){delete _0x2b4235[_0xf6f3('0x41')]['id'];}return db[_0xf6f3('0x1f')][_0xf6f3('0x3e')]({'where':{'id':_0x2b4235[_0xf6f3('0x3a')]['id']}})[_0xf6f3('0x14')](handleEntityNotFound(_0x2fabd0,null))[_0xf6f3('0x14')](function(_0x4d45d6){if(_0x4d45d6[_0xf6f3('0x3f')]===_0xf6f3('0x35')&&_0x2b4235[_0xf6f3('0x41')]['data3']){_0x2b4235[_0xf6f3('0x41')][_0xf6f3('0x37')]=encryptor[_0xf6f3('0x46')](_0x2b4235['body'][_0xf6f3('0x37')]);}return _0x4d45d6;})[_0xf6f3('0x14')](saveUpdates(_0x2b4235[_0xf6f3('0x41')],null))[_0xf6f3('0x14')](respondWithResult(_0x2fabd0,null))[_0xf6f3('0x38')](handleError(_0x2fabd0,null));};exports[_0xf6f3('0x15')]=function(_0x37580e,_0x1cef3b){return db[_0xf6f3('0x1f')][_0xf6f3('0x3e')]({'where':{'id':_0x37580e[_0xf6f3('0x3a')]['id']}})[_0xf6f3('0x14')](handleEntityNotFound(_0x1cef3b,null))[_0xf6f3('0x14')](removeEntity(_0x1cef3b,null))['catch'](handleError(_0x1cef3b,null));};exports[_0xf6f3('0x48')]=function(_0x5411b2,_0x3b79b3){return db[_0xf6f3('0x1f')]['findOne']({'where':{'id':_0x5411b2[_0xf6f3('0x3a')]['id']},'raw':!![]})['then'](function(_0x328943){if(!_0x328943)return _0x3b79b3[_0xf6f3('0x49')](0x194);return{'url':oauth[_0xf6f3('0x4a')](_0x328943,_0x5411b2['user']['id'])};})[_0xf6f3('0x14')](respondWithResult(_0x3b79b3,null))[_0xf6f3('0x38')](handleError(_0x3b79b3,null));};exports[_0xf6f3('0x4b')]=function(_0x400a21,_0x4d313f){var _0x5484bd=_0x400a21[_0xf6f3('0x41')];var _0x391f5c;var _0x524c99;if(_0x5484bd[_0xf6f3('0x17')])throw _0x5484bd;redis[_0xf6f3('0x4c')](_0x5484bd[_0xf6f3('0x4d')])['then'](function(_0x31827c){if(!_0x31827c)throw new Error(_0xf6f3('0x4e'));_0x391f5c=JSON[_0xf6f3('0x4f')](_0x31827c);var _0x11a529=Buffer[_0xf6f3('0x50')](_0x5484bd['state'],_0xf6f3('0x51'))[_0xf6f3('0x52')](_0xf6f3('0x53'));_0x524c99=JSON['parse'](_0x11a529);if(!oauth['isValidIdToken'](_0x5484bd['id_token'],_0x391f5c[_0xf6f3('0x54')]))throw new Error(_0xf6f3('0x55'));redis[_0xf6f3('0x56')](_0x5484bd[_0xf6f3('0x4d')]);return oauth[_0xf6f3('0x57')](_0x5484bd[_0xf6f3('0x58')],_0x391f5c);})[_0xf6f3('0x14')](function(_0x1f40ea){_0x391f5c[_0xf6f3('0x59')]=_0x1f40ea['access_token'];_0x391f5c[_0xf6f3('0x5a')]=_0x1f40ea[_0xf6f3('0x5b')];return db['CloudProvider'][_0xf6f3('0x13')]({'data5':_0x391f5c[_0xf6f3('0x59')],'data6':_0x391f5c[_0xf6f3('0x5a')]},{'where':{'id':_0x391f5c['id']}});})[_0xf6f3('0x14')](function(){oauth[_0xf6f3('0x5c')](_0x391f5c);socket[_0xf6f3('0x5d')](_0xf6f3('0x5e'),{'id':_0x524c99['id']});return;})[_0xf6f3('0x14')](respondWithStatusCode(_0x4d313f,null))[_0xf6f3('0x38')](function(_0x4a2764){if(_0x524c99){socket['emit'](_0xf6f3('0x5f'),{'id':_0x524c99['id']});}if(!_0x391f5c){logger['error'](_0xf6f3('0x60'),_0x4a2764);return _0x4d313f[_0xf6f3('0xc')](0x1f4)[_0xf6f3('0x1a')](_0x4a2764[_0xf6f3('0x61')]);}logger['error'](_0xf6f3('0x62'),_0x391f5c['id'],JSON[_0xf6f3('0x63')](_0x4a2764));});}; \ No newline at end of file +var _0xe6f7=['Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','find','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','end','status','json','offset','undefined','limit','count','Content-Range','update','then','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes'];(function(_0xbad322,_0x3e6b0b){var _0x2101cb=function(_0x1c3c3b){while(--_0x1c3c3b){_0xbad322['push'](_0xbad322['shift']());}};_0x2101cb(++_0x3e6b0b);}(_0xe6f7,0xd5));var _0x7e6f=function(_0x1a014b,_0x48acae){_0x1a014b=_0x1a014b-0x0;var _0x462258=_0xe6f7[_0x1a014b];return _0x462258;};'use strict';var _=require('lodash');var Redis=require(_0x7e6f('0x0'));var qs=require(_0x7e6f('0x1'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x7e6f('0x2'));var db=require(_0x7e6f('0x3'))['db'];var oauth=require(_0x7e6f('0x4'));config[_0x7e6f('0x5')]=_[_0x7e6f('0x6')](config[_0x7e6f('0x5')],{'host':_0x7e6f('0x7'),'port':0x18eb});var socket=require(_0x7e6f('0x8'))(new Redis(config[_0x7e6f('0x5')]));var redis=new Redis(config[_0x7e6f('0x5')]);function respondWithStatusCode(_0x53e13b,_0x344247){_0x344247=_0x344247||0xcc;return function(_0x31c847){if(_0x31c847){return _0x53e13b['sendStatus'](_0x344247);}return _0x53e13b['status'](_0x344247)[_0x7e6f('0x9')]();};}function respondWithResult(_0x2d75e3,_0x2e187d){_0x2e187d=_0x2e187d||0xc8;return function(_0x27f816){if(_0x27f816){return _0x2d75e3[_0x7e6f('0xa')](_0x2e187d)[_0x7e6f('0xb')](_0x27f816);}};}function respondWithFilteredResult(_0x1c2e4e,_0x213052){return function(_0x1d57db){if(_0x1d57db){var _0x1b460b=typeof _0x213052[_0x7e6f('0xc')]===_0x7e6f('0xd')&&typeof _0x213052[_0x7e6f('0xe')]===_0x7e6f('0xd');var _0x18f280=_0x1d57db[_0x7e6f('0xf')];var _0x580c3d=_0x1b460b?0x0:_0x213052['offset'];var _0x3e42c2=_0x1b460b?_0x1d57db[_0x7e6f('0xf')]:_0x213052[_0x7e6f('0xc')]+_0x213052[_0x7e6f('0xe')];var _0x13ffac;if(_0x3e42c2>=_0x18f280){_0x3e42c2=_0x18f280;_0x13ffac=0xc8;}else{_0x13ffac=0xce;}_0x1c2e4e[_0x7e6f('0xa')](_0x13ffac);return _0x1c2e4e['set'](_0x7e6f('0x10'),_0x580c3d+'-'+_0x3e42c2+'/'+_0x18f280)[_0x7e6f('0xb')](_0x1d57db);}return null;};}function saveUpdates(_0xcebdd7){return function(_0x19dff2){if(_0x19dff2){return _0x19dff2[_0x7e6f('0x11')](_0xcebdd7)[_0x7e6f('0x12')](function(_0x13f37f){return _0x13f37f;});}return null;};}function removeEntity(_0x33e32a){return function(_0x1e817d){if(_0x1e817d){return _0x1e817d['destroy']()[_0x7e6f('0x12')](function(){_0x33e32a[_0x7e6f('0xa')](0xcc)[_0x7e6f('0x9')]();});}};}function handleEntityNotFound(_0x55156f){return function(_0x478532){if(!_0x478532){_0x55156f['sendStatus'](0x194);}return _0x478532;};}function handleError(_0x5a6417,_0x5bd7e3){_0x5bd7e3=_0x5bd7e3||0x1f4;return function(_0x1d67c1){logger[_0x7e6f('0x13')](_0x1d67c1[_0x7e6f('0x14')]);if(_0x1d67c1[_0x7e6f('0x15')]){delete _0x1d67c1['name'];}_0x5a6417[_0x7e6f('0xa')](_0x5bd7e3)[_0x7e6f('0x16')](_0x1d67c1);};}function maskClientSecret(_0x2a2f82){return _[_0x7e6f('0x17')](_0x2a2f82['slice'](0x0,0x3),0x14,'*');}exports[_0x7e6f('0x18')]=function(_0x2955ad,_0x2dc4c9){var _0x22e322={},_0x1c71a4={},_0x57b706={'count':0x0,'rows':[]};var _0x569a9b=_[_0x7e6f('0x19')](db[_0x7e6f('0x1a')][_0x7e6f('0x1b')],function(_0x524d11){return{'name':_0x524d11[_0x7e6f('0x1c')],'type':_0x524d11[_0x7e6f('0x1d')][_0x7e6f('0x1e')]};});_0x1c71a4[_0x7e6f('0x1f')]=_[_0x7e6f('0x19')](_0x569a9b,'name');_0x1c71a4[_0x7e6f('0x20')]=_[_0x7e6f('0x21')](_0x2955ad['query']);_0x1c71a4[_0x7e6f('0x22')]=_[_0x7e6f('0x23')](_0x1c71a4[_0x7e6f('0x1f')],_0x1c71a4[_0x7e6f('0x20')]);_0x22e322['attributes']=_[_0x7e6f('0x23')](_0x1c71a4[_0x7e6f('0x1f')],qs['fields'](_0x2955ad[_0x7e6f('0x20')][_0x7e6f('0x24')]));_0x22e322[_0x7e6f('0x25')]=_0x22e322[_0x7e6f('0x25')][_0x7e6f('0x26')]?_0x22e322[_0x7e6f('0x25')]:_0x1c71a4['model'];if(!_0x2955ad[_0x7e6f('0x20')][_0x7e6f('0x27')](_0x7e6f('0x28'))){_0x22e322[_0x7e6f('0xe')]=qs['limit'](_0x2955ad[_0x7e6f('0x20')]['limit']);_0x22e322[_0x7e6f('0xc')]=qs[_0x7e6f('0xc')](_0x2955ad['query'][_0x7e6f('0xc')]);}_0x22e322['order']=qs[_0x7e6f('0x29')](_0x2955ad[_0x7e6f('0x20')][_0x7e6f('0x29')]);_0x22e322[_0x7e6f('0x2a')]=qs[_0x7e6f('0x22')](_[_0x7e6f('0x2b')](_0x2955ad[_0x7e6f('0x20')],_0x1c71a4[_0x7e6f('0x22')]),_0x569a9b);if(_0x2955ad[_0x7e6f('0x20')]['filter']){_0x22e322[_0x7e6f('0x2a')]=_[_0x7e6f('0x2c')](_0x22e322[_0x7e6f('0x2a')],{'$or':_['map'](_0x569a9b,function(_0x49b0ca){if(_0x49b0ca[_0x7e6f('0x1d')]!==_0x7e6f('0x2d')){var _0x388ec6={};_0x388ec6[_0x49b0ca[_0x7e6f('0x15')]]={'$like':'%'+_0x2955ad[_0x7e6f('0x20')][_0x7e6f('0x2e')]+'%'};return _0x388ec6;}})});}_0x22e322=_[_0x7e6f('0x2c')]({},_0x22e322,_0x2955ad[_0x7e6f('0x2f')]);var _0x40df55={'where':_0x22e322[_0x7e6f('0x2a')]};return db['CloudProvider'][_0x7e6f('0xf')](_0x40df55)[_0x7e6f('0x12')](function(_0x1aa844){_0x57b706[_0x7e6f('0xf')]=_0x1aa844;if(_0x2955ad['query'][_0x7e6f('0x30')]){_0x22e322[_0x7e6f('0x31')]=[{'all':!![]}];}return db[_0x7e6f('0x1a')][_0x7e6f('0x32')](_0x22e322);})[_0x7e6f('0x12')](function(_0x26226d){_0x57b706[_0x7e6f('0x33')]=_[_0x7e6f('0x19')](_0x26226d,function(_0x6cfec4){if(_0x6cfec4[_0x7e6f('0x34')]===_0x7e6f('0x35')){var _0x3e22ee=encryptor['decryptString'](_0x6cfec4[_0x7e6f('0x36')]);_0x6cfec4['data3']=maskClientSecret(_0x3e22ee);}return _0x6cfec4;});return _0x57b706;})[_0x7e6f('0x12')](respondWithFilteredResult(_0x2dc4c9,_0x22e322))[_0x7e6f('0x37')](handleError(_0x2dc4c9,null));};exports[_0x7e6f('0x38')]=function(_0x53028a,_0x390a39){var _0xe06e0e={'raw':!![],'where':{'id':_0x53028a[_0x7e6f('0x39')]['id']}},_0x1be4f3={};_0x1be4f3[_0x7e6f('0x1f')]=_[_0x7e6f('0x21')](db[_0x7e6f('0x1a')][_0x7e6f('0x1b')]);_0x1be4f3['query']=_[_0x7e6f('0x21')](_0x53028a[_0x7e6f('0x20')]);_0x1be4f3[_0x7e6f('0x22')]=_[_0x7e6f('0x23')](_0x1be4f3[_0x7e6f('0x1f')],_0x1be4f3['query']);_0xe06e0e[_0x7e6f('0x25')]=_[_0x7e6f('0x23')](_0x1be4f3[_0x7e6f('0x1f')],qs[_0x7e6f('0x24')](_0x53028a[_0x7e6f('0x20')][_0x7e6f('0x24')]));_0xe06e0e['attributes']=_0xe06e0e[_0x7e6f('0x25')][_0x7e6f('0x26')]?_0xe06e0e[_0x7e6f('0x25')]:_0x1be4f3[_0x7e6f('0x1f')];if(_0x53028a[_0x7e6f('0x20')][_0x7e6f('0x30')]){_0xe06e0e[_0x7e6f('0x31')]=[{'all':!![]}];}_0xe06e0e=_[_0x7e6f('0x2c')]({},_0xe06e0e,_0x53028a['options']);return db['CloudProvider']['find'](_0xe06e0e)[_0x7e6f('0x12')](handleEntityNotFound(_0x390a39,null))[_0x7e6f('0x12')](function(_0x46ec4e){if(_0x46ec4e[_0x7e6f('0x34')]===_0x7e6f('0x35')){var _0x1cdcea=encryptor['decryptString'](_0x46ec4e[_0x7e6f('0x36')]);_0x46ec4e[_0x7e6f('0x36')]=maskClientSecret(_0x1cdcea);}return _0x46ec4e;})[_0x7e6f('0x12')](respondWithResult(_0x390a39,null))[_0x7e6f('0x37')](handleError(_0x390a39,null));};exports[_0x7e6f('0x3a')]=function(_0x2d2649,_0xb32c93){if(!_0x2d2649[_0x7e6f('0x3b')][_0x7e6f('0x15')])throw new Error(_0x7e6f('0x3c'));if(!_0x2d2649[_0x7e6f('0x3b')][_0x7e6f('0x34')])throw new Error(_0x7e6f('0x3d'));var _0x500036=db[_0x7e6f('0x1a')][_0x7e6f('0x1b')][_0x7e6f('0x34')]['values'];if(!_0x500036[_0x7e6f('0x3e')](_0x2d2649[_0x7e6f('0x3b')][_0x7e6f('0x34')]))throw new Error(_0x7e6f('0x3f')+_0x500036['join'](',\x20'));if(_0x2d2649[_0x7e6f('0x3b')]['service']===_0x7e6f('0x35')&&_0x2d2649[_0x7e6f('0x3b')]['data3']){_0x2d2649[_0x7e6f('0x3b')][_0x7e6f('0x36')]=encryptor['encryptString'](_0x2d2649['body'][_0x7e6f('0x36')]);}return db[_0x7e6f('0x1a')][_0x7e6f('0x3a')](_0x2d2649[_0x7e6f('0x3b')],{})[_0x7e6f('0x12')](respondWithResult(_0xb32c93,0xc9))[_0x7e6f('0x37')](handleError(_0xb32c93,null));};exports['update']=function(_0x2fbfaa,_0x5da4f5){if(_0x2fbfaa[_0x7e6f('0x3b')]['id']){delete _0x2fbfaa[_0x7e6f('0x3b')]['id'];}return db['CloudProvider'][_0x7e6f('0x40')]({'where':{'id':_0x2fbfaa[_0x7e6f('0x39')]['id']}})[_0x7e6f('0x12')](handleEntityNotFound(_0x5da4f5,null))[_0x7e6f('0x12')](function(_0x536463){if(_0x536463[_0x7e6f('0x34')]==='MicrosoftAzure'&&_0x2fbfaa[_0x7e6f('0x3b')][_0x7e6f('0x36')]){_0x2fbfaa[_0x7e6f('0x3b')][_0x7e6f('0x36')]=encryptor[_0x7e6f('0x41')](_0x2fbfaa[_0x7e6f('0x3b')][_0x7e6f('0x36')]);}return _0x536463;})[_0x7e6f('0x12')](saveUpdates(_0x2fbfaa['body'],null))[_0x7e6f('0x12')](respondWithResult(_0x5da4f5,null))[_0x7e6f('0x37')](handleError(_0x5da4f5,null));};exports[_0x7e6f('0x42')]=function(_0x584aac,_0x1841f8){return db[_0x7e6f('0x1a')][_0x7e6f('0x40')]({'where':{'id':_0x584aac['params']['id']}})[_0x7e6f('0x12')](handleEntityNotFound(_0x1841f8,null))['then'](removeEntity(_0x1841f8,null))[_0x7e6f('0x37')](handleError(_0x1841f8,null));};exports[_0x7e6f('0x43')]=function(_0xf9e351,_0x13839b){return db[_0x7e6f('0x1a')][_0x7e6f('0x44')]({'where':{'id':_0xf9e351['params']['id']},'raw':!![]})[_0x7e6f('0x12')](function(_0x12aeda){if(!_0x12aeda)return _0x13839b[_0x7e6f('0x45')](0x194);return{'url':oauth[_0x7e6f('0x46')](_0x12aeda,_0xf9e351[_0x7e6f('0x47')]['id'])};})['then'](respondWithResult(_0x13839b,null))[_0x7e6f('0x37')](handleError(_0x13839b,null));};exports[_0x7e6f('0x48')]=function(_0x4d0a6a,_0x3e37ea){var _0x51f96b=_0x4d0a6a[_0x7e6f('0x3b')];var _0x5d37d7;var _0x24549f;if(_0x51f96b[_0x7e6f('0x13')])throw _0x51f96b;redis[_0x7e6f('0x49')](_0x51f96b[_0x7e6f('0x4a')])[_0x7e6f('0x12')](function(_0x3de669){if(!_0x3de669)throw new Error(_0x7e6f('0x4b'));_0x5d37d7=JSON[_0x7e6f('0x4c')](_0x3de669);var _0x2cfad4=Buffer['from'](_0x51f96b[_0x7e6f('0x4a')],_0x7e6f('0x4d'))[_0x7e6f('0x4e')](_0x7e6f('0x4f'));_0x24549f=JSON[_0x7e6f('0x4c')](_0x2cfad4);if(!oauth[_0x7e6f('0x50')](_0x51f96b[_0x7e6f('0x51')],_0x5d37d7[_0x7e6f('0x52')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x51f96b[_0x7e6f('0x4a')]);return oauth[_0x7e6f('0x53')](_0x51f96b[_0x7e6f('0x54')],_0x5d37d7);})[_0x7e6f('0x12')](function(_0x27a5e5){_0x5d37d7[_0x7e6f('0x55')]=_0x27a5e5[_0x7e6f('0x56')];_0x5d37d7['data6']=_0x27a5e5['refresh_token'];return db[_0x7e6f('0x1a')][_0x7e6f('0x11')]({'data5':_0x5d37d7[_0x7e6f('0x55')],'data6':_0x5d37d7['data6']},{'where':{'id':_0x5d37d7['id']}});})[_0x7e6f('0x12')](function(){oauth['startRefreshInterval'](_0x5d37d7);socket[_0x7e6f('0x57')](_0x7e6f('0x58'),{'id':_0x24549f['id']});return;})[_0x7e6f('0x12')](respondWithStatusCode(_0x3e37ea,null))[_0x7e6f('0x37')](function(_0x1263c3){if(_0x24549f){socket[_0x7e6f('0x57')](_0x7e6f('0x59'),{'id':_0x24549f['id']});}if(!_0x5d37d7){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x1263c3);return _0x3e37ea[_0x7e6f('0xa')](0x1f4)[_0x7e6f('0x16')](_0x1263c3['message']);}logger[_0x7e6f('0x13')](_0x7e6f('0x5a'),_0x5d37d7['id'],JSON[_0x7e6f('0x5b')](_0x1263c3));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 17370c4..20b502e 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 _0x063d=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','util','../../config/logger','api','moment'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x063d,0x75));var _0xd063=function(_0x28a05b,_0x1eb9ea){_0x28a05b=_0x28a05b-0x0;var _0x4bed26=_0x063d[_0x28a05b];return _0x4bed26;};'use strict';var _=require('lodash');var util=require(_0xd063('0x0'));var logger=require(_0xd063('0x1'))(_0xd063('0x2'));var moment=require(_0xd063('0x3'));var BPromise=require(_0xd063('0x4'));var rp=require(_0xd063('0x5'));var fs=require('fs');var path=require(_0xd063('0x6'));var rimraf=require(_0xd063('0x7'));var config=require(_0xd063('0x8'));var attributes=require(_0xd063('0x9'));module['exports']=function(_0x56a23d,_0x5ca9ce){return _0x56a23d[_0xd063('0xa')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe725=['CloudProvider','lodash','util','api','moment','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0xe725,0x109));var _0x5e72=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe725[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5e72('0x0'));var util=require(_0x5e72('0x1'));var logger=require('../../config/logger')(_0x5e72('0x2'));var moment=require(_0x5e72('0x3'));var BPromise=require('bluebird');var rp=require(_0x5e72('0x4'));var fs=require('fs');var path=require(_0x5e72('0x5'));var rimraf=require('rimraf');var config=require(_0x5e72('0x6'));var attributes=require(_0x5e72('0x7'));module[_0x5e72('0x8')]=function(_0x13b5aa,_0x2a4726){return _0x13b5aa[_0x5e72('0x9')](_0x5e72('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 422f304..241a310 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 _0xcb1a=['value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','bind','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','type','Dynamics365','push','join','Outlook365','/.default','replace','{TENANT_ID}','data2','code','id_token','stringify','base64','randomBytes','toString','data1','response_type','data4','response_mode','form_post','scope','nonce','prompt','login','map','key'];(function(_0x51bb0d,_0x28577e){var _0x2dfcd0=function(_0x9fb1c5){while(--_0x9fb1c5){_0x51bb0d['push'](_0x51bb0d['shift']());}};_0x2dfcd0(++_0x28577e);}(_0xcb1a,0x1b4));var _0xacb1=function(_0xed2b2,_0x1ff3f2){_0xed2b2=_0xed2b2-0x0;var _0x144c7a=_0xcb1a[_0xed2b2];return _0x144c7a;};'use strict';var _=require(_0xacb1('0x0'));var crypto=require(_0xacb1('0x1'));var jwt=require(_0xacb1('0x2'));var moment=require(_0xacb1('0x3'));var Redis=require(_0xacb1('0x4'));var rp=require(_0xacb1('0x5'));var util=require(_0xacb1('0x6'));var encryptor=require(_0xacb1('0x7'));var config=require(_0xacb1('0x8'));var logger=require(_0xacb1('0x9'))(_0xacb1('0xa'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xacb1('0xb'))['db'];config[_0xacb1('0xc')]=_[_0xacb1('0xd')](config[_0xacb1('0xc')],{'host':_0xacb1('0xe'),'port':0x18eb});var redis=new Redis(config[_0xacb1('0xc')]);var MICROSOFT_AUTH_URL=_0xacb1('0xf');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xacb1('0x10'),_0xacb1('0x11'),_0xacb1('0x12'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xacb1('0x13'),_0xacb1('0x14')],'Dynamics365':[_0xacb1('0x15'),_0xacb1('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xacb1('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0xacb1('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x242127){var _0x32d335=_['map'](AZURE_AUTH_SCOPES[_0x242127[_0xacb1('0x18')]]);if(_0x242127[_0xacb1('0x18')]===_0xacb1('0x19'))_0x32d335[_0xacb1('0x1a')](_0x242127['data7']+'/.default');return _0x32d335[_0xacb1('0x1b')]('\x20');}function getAccessTokenScope(_0x3db9e4){if(_0x3db9e4[_0xacb1('0x18')]===_0xacb1('0x1c'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3db9e4[_0xacb1('0x18')]===_0xacb1('0x19'))return _0x3db9e4['data7']+_0xacb1('0x1d');}function generateMicrosoftAuthorizationUrl(_0x14ed6d,_0x52d757){var _0x14c548=MICROSOFT_AUTH_URL[_0xacb1('0x1e')](_0xacb1('0x1f'),_0x14ed6d[_0xacb1('0x20')]);var _0x347ad0=[_0xacb1('0x21'),_0xacb1('0x22')];var _0x5dd4fe=Buffer['from'](JSON[_0xacb1('0x23')]({'id':_0x52d757}))['toString'](_0xacb1('0x24'));var _0x12274f=crypto[_0xacb1('0x25')](0x10)[_0xacb1('0x26')]('hex');var _0x468cc8=getAuthorizationScopes(_0x14ed6d);var _0x242c9a=[{'key':'client_id','value':_0x14ed6d[_0xacb1('0x27')]},{'key':_0xacb1('0x28'),'value':encodeURIComponent(_0x347ad0[_0xacb1('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x14ed6d[_0xacb1('0x29')]},{'key':_0xacb1('0x2a'),'value':_0xacb1('0x2b')},{'key':_0xacb1('0x2c'),'value':encodeURIComponent(_0x468cc8)},{'key':'state','value':_0x5dd4fe},{'key':_0xacb1('0x2d'),'value':_0x12274f},{'key':_0xacb1('0x2e'),'value':_0xacb1('0x2f')}];var _0xcdce6d=_0x14c548+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xacb1('0x30')](_0x242c9a,function(_0x172106){return _0x172106[_0xacb1('0x31')]+'='+_0x172106[_0xacb1('0x32')];})['join']('&');_0x14ed6d[_0xacb1('0x33')]={'issuer':_0x14c548['replace'](_0xacb1('0x34'),''),'audience':_0x14ed6d['data1'],'state':_0x5dd4fe,'nonce':_0x12274f};redis[_0xacb1('0x35')](_0x5dd4fe,JSON[_0xacb1('0x23')](_0x14ed6d));return _0xcdce6d;}function isValidIdToken(_0x35e20a,_0x45cba3){try{var _0x15f004=jwt[_0xacb1('0x36')](_0x35e20a,{'complete':!![]});var _0x39a8e2=_0x15f004[_0xacb1('0x37')];if(_0x39a8e2[_0xacb1('0x38')]!==_0x45cba3[_0xacb1('0x39')])return![];if(_0x39a8e2['aud']!==_0x45cba3[_0xacb1('0x3a')])return![];if(_0x39a8e2[_0xacb1('0x2d')]!==_0x45cba3['nonce'])return![];if(moment()[_0xacb1('0x3b')](moment[_0xacb1('0x3c')](_0x39a8e2['exp'])))return![];return!![];}catch(_0x1a71fe){throw _0x1a71fe;}}function refreshOauth2MicrosoftAccessToken(_0x3a8f41){return Promise[_0xacb1('0x3d')]()[_0xacb1('0x3e')](function(){if(_0x3a8f41[_0xacb1('0x3f')])return _0x3a8f41;return db[_0xacb1('0x40')][_0xacb1('0x41')]({'where':{'id':_0x3a8f41['id']},'raw':!![]});})[_0xacb1('0x3e')](function(_0x12cc94){var _0x380e35={'grant_type':_0xacb1('0x42'),'refresh_token':_0x12cc94[_0xacb1('0x43')],'scope':getAccessTokenScope(_0x12cc94),'redirect_uri':_0x12cc94[_0xacb1('0x29')],'client_id':_0x12cc94[_0xacb1('0x27')],'client_secret':encryptor[_0xacb1('0x44')](_0x12cc94['data3'])};var _0x367d85={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xacb1('0x1e')](_0xacb1('0x1f'),_0x12cc94[_0xacb1('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x380e35,'json':!![]};return rp(_0x367d85);})['then'](function(_0x230b6){_0x3a8f41[_0xacb1('0x45')]=_0x230b6[_0xacb1('0x46')];_0x3a8f41[_0xacb1('0x43')]=_0x230b6[_0xacb1('0x42')];return db[_0xacb1('0x40')]['update']({'data5':_0x3a8f41[_0xacb1('0x45')],'data6':_0x3a8f41[_0xacb1('0x43')]},{'where':{'id':_0x3a8f41['id']}});})[_0xacb1('0x3e')](function(){return _0x3a8f41;})[_0xacb1('0x47')](function(_0x5515b2){logger[_0xacb1('0x48')](_0xacb1('0x49'),_0x3a8f41['id'],_0x5515b2);});}function getOauth2MicrosoftAccessToken(_0xaa9145,_0x579b40){var _0x450440={'grant_type':'authorization_code','code':_0xaa9145,'scope':getAccessTokenScope(_0x579b40),'redirect_uri':_0x579b40[_0xacb1('0x29')],'client_id':_0x579b40[_0xacb1('0x27')],'client_secret':encryptor[_0xacb1('0x44')](_0x579b40[_0xacb1('0x3f')])};var _0x196c77={'method':_0xacb1('0x4a'),'uri':MICROSOFT_AUTH_URL[_0xacb1('0x1e')](_0xacb1('0x1f'),_0x579b40[_0xacb1('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x450440,'json':!![]};return rp(_0x196c77);}function startRefreshInterval(_0xca6ad8){var _0x58b741=schedule['intervals'];if(_0x58b741[_0xca6ad8['id']])clearInterval(_0x58b741[_0xca6ad8['id']]);_0x58b741[_0xca6ad8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xacb1('0x4b')](this,{'id':_0xca6ad8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xacb1('0x4c')]=_0x58b741;}function startAllRefreshIntervals(){return db[_0xacb1('0x40')][_0xacb1('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xacb1('0x3e')](function(_0x2d1ec0){var _0x2b7c6a=_0x2d1ec0['map'](function(_0x35875b){return refreshOauth2MicrosoftAccessToken(_0x35875b)['then'](function(_0x5e0505){startRefreshInterval(_0x5e0505);});});return Promise[_0xacb1('0x4e')](_0x2b7c6a);})[_0xacb1('0x47')](function(_0x1f5590){var _0x5d04c9=_0x1f5590?util[_0xacb1('0x4f')](_0x1f5590,{'showHidden':![],'depth':null}):'';logger[_0xacb1('0x48')](_0xacb1('0x50'),_0x5d04c9);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1b58=['exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','map','type','Dynamics365','push','data7','/.default','Outlook365','{TENANT_ID}','data2','code','stringify','base64','randomBytes','toString','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','prompt','login','key','value','replace','set','decode','payload','issuer','audience','nonce','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s'];(function(_0xe54f75,_0x55f6b3){var _0x2953e6=function(_0x2b62ca){while(--_0x2b62ca){_0xe54f75['push'](_0xe54f75['shift']());}};_0x2953e6(++_0x55f6b3);}(_0x1b58,0x9b));var _0x81b5=function(_0x24ede2,_0x21e9a4){_0x24ede2=_0x24ede2-0x0;var _0x51ec40=_0x1b58[_0x24ede2];return _0x51ec40;};'use strict';var _=require(_0x81b5('0x0'));var crypto=require(_0x81b5('0x1'));var jwt=require(_0x81b5('0x2'));var moment=require(_0x81b5('0x3'));var Redis=require('ioredis');var rp=require(_0x81b5('0x4'));var util=require(_0x81b5('0x5'));var encryptor=require(_0x81b5('0x6'));var config=require(_0x81b5('0x7'));var logger=require(_0x81b5('0x8'))(_0x81b5('0x9'));var schedule=require(_0x81b5('0xa'));var db=require(_0x81b5('0xb'))['db'];config[_0x81b5('0xc')]=_[_0x81b5('0xd')](config['redis'],{'host':_0x81b5('0xe'),'port':0x18eb});var redis=new Redis(config[_0x81b5('0xc')]);var MICROSOFT_AUTH_URL=_0x81b5('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x81b5('0x10'),_0x81b5('0x11'),'email','offline_access',_0x81b5('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x81b5('0x13')],'Dynamics365':[_0x81b5('0x10'),_0x81b5('0x14')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x81b5('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x47593c){var _0x3e4526=_[_0x81b5('0x16')](AZURE_AUTH_SCOPES[_0x47593c[_0x81b5('0x17')]]);if(_0x47593c[_0x81b5('0x17')]===_0x81b5('0x18'))_0x3e4526[_0x81b5('0x19')](_0x47593c[_0x81b5('0x1a')]+_0x81b5('0x1b'));return _0x3e4526['join']('\x20');}function getAccessTokenScope(_0x2f082c){if(_0x2f082c[_0x81b5('0x17')]===_0x81b5('0x1c'))return _0x81b5('0x12');if(_0x2f082c[_0x81b5('0x17')]===_0x81b5('0x18'))return _0x2f082c['data7']+_0x81b5('0x1b');}function generateMicrosoftAuthorizationUrl(_0x492497,_0x5e74be){var _0x5b3b16=MICROSOFT_AUTH_URL['replace'](_0x81b5('0x1d'),_0x492497[_0x81b5('0x1e')]);var _0x4eb3fc=[_0x81b5('0x1f'),'id_token'];var _0x18b53a=Buffer['from'](JSON[_0x81b5('0x20')]({'id':_0x5e74be}))['toString'](_0x81b5('0x21'));var _0x2ec858=crypto[_0x81b5('0x22')](0x10)[_0x81b5('0x23')]('hex');var _0xbc794d=getAuthorizationScopes(_0x492497);var _0x3f17d6=[{'key':'client_id','value':_0x492497[_0x81b5('0x24')]},{'key':_0x81b5('0x25'),'value':encodeURIComponent(_0x4eb3fc[_0x81b5('0x26')]('\x20'))},{'key':_0x81b5('0x27'),'value':_0x492497[_0x81b5('0x28')]},{'key':_0x81b5('0x29'),'value':_0x81b5('0x2a')},{'key':_0x81b5('0x2b'),'value':encodeURIComponent(_0xbc794d)},{'key':_0x81b5('0x2c'),'value':_0x18b53a},{'key':'nonce','value':_0x2ec858},{'key':_0x81b5('0x2d'),'value':_0x81b5('0x2e')}];var _0x2b4b7d=_0x5b3b16+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x81b5('0x16')](_0x3f17d6,function(_0x583d0b){return _0x583d0b[_0x81b5('0x2f')]+'='+_0x583d0b[_0x81b5('0x30')];})[_0x81b5('0x26')]('&');_0x492497['oauth2Claims']={'issuer':_0x5b3b16[_0x81b5('0x31')]('oauth2/',''),'audience':_0x492497['data1'],'state':_0x18b53a,'nonce':_0x2ec858};redis[_0x81b5('0x32')](_0x18b53a,JSON[_0x81b5('0x20')](_0x492497));return _0x2b4b7d;}function isValidIdToken(_0x1a5728,_0x55e714){try{var _0x3314c6=jwt[_0x81b5('0x33')](_0x1a5728,{'complete':!![]});var _0x2fad91=_0x3314c6[_0x81b5('0x34')];if(_0x2fad91['iss']!==_0x55e714[_0x81b5('0x35')])return![];if(_0x2fad91['aud']!==_0x55e714[_0x81b5('0x36')])return![];if(_0x2fad91['nonce']!==_0x55e714[_0x81b5('0x37')])return![];if(moment()['isAfter'](moment[_0x81b5('0x38')](_0x2fad91['exp'])))return![];return!![];}catch(_0x3c5285){throw _0x3c5285;}}function refreshOauth2MicrosoftAccessToken(_0x4700a2){return Promise[_0x81b5('0x39')]()[_0x81b5('0x3a')](function(){if(_0x4700a2[_0x81b5('0x3b')])return _0x4700a2;return db[_0x81b5('0x3c')][_0x81b5('0x3d')]({'where':{'id':_0x4700a2['id']},'raw':!![]});})[_0x81b5('0x3a')](function(_0x4b5442){var _0x2cdce6={'grant_type':_0x81b5('0x3e'),'refresh_token':_0x4b5442[_0x81b5('0x3f')],'scope':getAccessTokenScope(_0x4b5442),'redirect_uri':_0x4b5442[_0x81b5('0x28')],'client_id':_0x4b5442[_0x81b5('0x24')],'client_secret':encryptor[_0x81b5('0x40')](_0x4b5442[_0x81b5('0x3b')])};var _0x5923e1={'method':_0x81b5('0x41'),'uri':MICROSOFT_AUTH_URL[_0x81b5('0x31')](_0x81b5('0x1d'),_0x4b5442[_0x81b5('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cdce6,'json':!![]};return rp(_0x5923e1);})[_0x81b5('0x3a')](function(_0x502f19){_0x4700a2[_0x81b5('0x42')]=_0x502f19['access_token'];_0x4700a2[_0x81b5('0x3f')]=_0x502f19[_0x81b5('0x3e')];return db[_0x81b5('0x3c')]['update']({'data5':_0x4700a2['data5'],'data6':_0x4700a2[_0x81b5('0x3f')]},{'where':{'id':_0x4700a2['id']}});})['then'](function(){return _0x4700a2;})['catch'](function(_0x3c29b3){logger['error'](_0x81b5('0x43'),_0x4700a2['id'],_0x3c29b3);});}function getOauth2MicrosoftAccessToken(_0x47bb87,_0x267199){var _0x3ce1ad={'grant_type':_0x81b5('0x44'),'code':_0x47bb87,'scope':getAccessTokenScope(_0x267199),'redirect_uri':_0x267199[_0x81b5('0x28')],'client_id':_0x267199[_0x81b5('0x24')],'client_secret':encryptor[_0x81b5('0x40')](_0x267199['data3'])};var _0x3081d1={'method':_0x81b5('0x41'),'uri':MICROSOFT_AUTH_URL[_0x81b5('0x31')](_0x81b5('0x1d'),_0x267199[_0x81b5('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ce1ad,'json':!![]};return rp(_0x3081d1);}function startRefreshInterval(_0x36bf01){var _0x30c4e8=schedule[_0x81b5('0x45')];if(_0x30c4e8[_0x36bf01['id']])clearInterval(_0x30c4e8[_0x36bf01['id']]);_0x30c4e8[_0x36bf01['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x81b5('0x46')](this,{'id':_0x36bf01['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x81b5('0x45')]=_0x30c4e8;}function startAllRefreshIntervals(){return db[_0x81b5('0x3c')][_0x81b5('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xc590fa){var _0x45d1e2=_0xc590fa[_0x81b5('0x16')](function(_0x306645){return refreshOauth2MicrosoftAccessToken(_0x306645)[_0x81b5('0x3a')](function(_0x4c440e){startRefreshInterval(_0x4c440e);});});return Promise['all'](_0x45d1e2);})[_0x81b5('0x48')](function(_0x1ccd5e){var _0x2cef1e=_0x1ccd5e?util[_0x81b5('0x49')](_0x1ccd5e,{'showHidden':![],'depth':null}):'';logger[_0x81b5('0x4a')](_0x81b5('0x4b'),_0x2cef1e);});}module[_0x81b5('0x4c')]={'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 55c4e0e..aa2504f 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 _0x02a7=['CloudProvider,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x02a7,0x1a6));var _0x702a=function(_0x8cde48,_0x277a3a){_0x8cde48=_0x8cde48-0x0;var _0x55cf91=_0x02a7[_0x8cde48];return _0x55cf91;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('CloudProvider,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('CloudProvider,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});} \ No newline at end of file +var _0x7880=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x2d1fe6,_0x34d8d5){var _0x454ad7=function(_0x432567){while(--_0x432567){_0x2d1fe6['push'](_0x2d1fe6['shift']());}};_0x454ad7(++_0x34d8d5);}(_0x7880,0x10f));var _0x0788=function(_0x4a26e7,_0x232272){_0x4a26e7=_0x4a26e7-0x0;var _0x13c81b=_0x7880[_0x4a26e7];return _0x13c81b;};'use strict';var _=require(_0x0788('0x0'));var util=require('util');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('../../config/logger')(_0x0788('0x6'));var config=require('../../config/environment');var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ece1c,_0x14cfa5,_0x450b71){return new BPromise(function(_0x5366c7,_0x1662a2){return client[_0x0788('0xa')](_0x5ece1c,_0x450b71)[_0x0788('0xb')](function(_0x95ebe3){logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x14cfa5,_0x0788('0xe'),JSON[_0x0788('0x11')](_0x95ebe3));if(_0x95ebe3['error']){if(_0x95ebe3[_0x0788('0x12')]['code']===0x1f4){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x95ebe3[_0x0788('0x12')][_0x0788('0x13')]);return _0x1662a2(_0x95ebe3[_0x0788('0x12')]['message']);}logger[_0x0788('0x12')]('CloudProvider,\x20%s,\x20%s',_0x14cfa5,_0x95ebe3[_0x0788('0x12')]['message']);return _0x5366c7(_0x95ebe3['error'][_0x0788('0x13')]);}else{logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,'request\x20sent');_0x5366c7(_0x95ebe3[_0x0788('0x14')][_0x0788('0x13')]);}})['catch'](function(_0x334f58){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x334f58);_0x1662a2(_0x334f58);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f5534d3..58389c9 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x495733,_0x414149){var _0xd5c7b5=function(_0x41e8ce){while(--_0x41e8ce){_0x495733['push'](_0x495733['shift']());}};_0xd5c7b5(++_0x414149);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x1a22df,_0x2d30b7){var _0x3ff5a6=function(_0x4f17f8){while(--_0x4f17f8){_0x1a22df['push'](_0x1a22df['shift']());}};_0x3ff5a6(++_0x2d30b7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 755624c..db0816f 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 _0x8649=['STRING','name'];(function(_0x373b3e,_0x347ac7){var _0xa4ce3=function(_0x5ab1ac){while(--_0x5ab1ac){_0x373b3e['push'](_0x373b3e['shift']());}};_0xa4ce3(++_0x347ac7);}(_0x8649,0x7a));var _0x9864=function(_0x3de942,_0x493302){_0x3de942=_0x3de942-0x0;var _0xd60570=_0x8649[_0x3de942];return _0xd60570;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9864('0x0')],'unique':_0x9864('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9864('0x0')]},'companyId':{'type':Sequelize[_0x9864('0x0')]},'website':{'type':Sequelize[_0x9864('0x0')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9864('0x0')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x9864('0x0')]},'postalCode':{'type':Sequelize[_0x9864('0x0')]},'city':{'type':Sequelize[_0x9864('0x0')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9864('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9864('0x0')]},'sStreet':{'type':Sequelize[_0x9864('0x0')]},'sPostalCode':{'type':Sequelize[_0x9864('0x0')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9864('0x0')]}}; \ No newline at end of file +var _0x2159=['exports','STRING','name','sequelize'];(function(_0x56d8e1,_0x35a5d0){var _0x111567=function(_0x318669){while(--_0x318669){_0x56d8e1['push'](_0x56d8e1['shift']());}};_0x111567(++_0x35a5d0);}(_0x2159,0x17f));var _0x9215=function(_0x17f7d8,_0x549112){_0x17f7d8=_0x17f7d8-0x0;var _0x2c5198=_0x2159[_0x17f7d8];return _0x2c5198;};'use strict';var Sequelize=require(_0x9215('0x0'));module[_0x9215('0x1')]={'name':{'type':Sequelize[_0x9215('0x2')],'unique':_0x9215('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x9215('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9215('0x2')]},'fax':{'type':Sequelize[_0x9215('0x2')]},'type':{'type':Sequelize[_0x9215('0x2')]},'street':{'type':Sequelize[_0x9215('0x2')]},'postalCode':{'type':Sequelize[_0x9215('0x2')]},'city':{'type':Sequelize[_0x9215('0x2')]},'country':{'type':Sequelize[_0x9215('0x2')]},'email':{'type':Sequelize[_0x9215('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x9215('0x2')]},'sPostalCode':{'type':Sequelize[_0x9215('0x2')]},'sCity':{'type':Sequelize[_0x9215('0x2')]},'sCountry':{'type':Sequelize[_0x9215('0x2')]},'description':{'type':Sequelize[_0x9215('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 695368e..2f85c2e 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 _0x5dfd=['model','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','CmCompany','include','rows','catch','params','rawAttributes','length','find','create','body','user','Companies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','sort','map','getContacts','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','describe','query','keys','filters'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x5dfd,0x7b));var _0xd5df=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x5dfd[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0xd5df('0x0'));var rimraf=require(_0xd5df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd5df('0x2'));var rp=require(_0xd5df('0x3'));var moment=require(_0xd5df('0x4'));var BPromise=require(_0xd5df('0x5'));var Mustache=require('mustache');var util=require(_0xd5df('0x6'));var path=require(_0xd5df('0x7'));var sox=require(_0xd5df('0x8'));var csv=require(_0xd5df('0x9'));var ejs=require(_0xd5df('0xa'));var fs=require('fs');var fs_extra=require(_0xd5df('0xb'));var _=require(_0xd5df('0xc'));var squel=require(_0xd5df('0xd'));var crypto=require(_0xd5df('0xe'));var jsforce=require(_0xd5df('0xf'));var deskjs=require(_0xd5df('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd5df('0x11'));var Papa=require(_0xd5df('0x12'));var Redis=require(_0xd5df('0x13'));var authService=require(_0xd5df('0x14'));var qs=require(_0xd5df('0x15'));var as=require(_0xd5df('0x16'));var hardwareService=require(_0xd5df('0x17'));var logger=require(_0xd5df('0x18'))(_0xd5df('0x19'));var utils=require(_0xd5df('0x1a'));var config=require(_0xd5df('0x1b'));var licenseUtil=require(_0xd5df('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27c381,_0x536e92){_0x536e92=_0x536e92||0xcc;return function(_0x4320af){if(_0x4320af){return _0x27c381[_0xd5df('0x1d')](_0x536e92);}return _0x27c381['status'](_0x536e92)[_0xd5df('0x1e')]();};}function respondWithResult(_0x22da43,_0x1ccf28){_0x1ccf28=_0x1ccf28||0xc8;return function(_0x5b3a21){if(_0x5b3a21){return _0x22da43['status'](_0x1ccf28)[_0xd5df('0x1f')](_0x5b3a21);}};}function respondWithFilteredResult(_0xe88894,_0x5192d2){return function(_0x21f58e){if(_0x21f58e){var _0x1f9213=typeof _0x5192d2[_0xd5df('0x20')]==='undefined'&&typeof _0x5192d2[_0xd5df('0x21')]===_0xd5df('0x22');var _0x1dfb06=_0x21f58e[_0xd5df('0x23')];var _0x34fd6c=_0x1f9213?0x0:_0x5192d2[_0xd5df('0x20')];var _0x1e67dc=_0x1f9213?_0x21f58e['count']:_0x5192d2[_0xd5df('0x20')]+_0x5192d2[_0xd5df('0x21')];var _0x54b07a;if(_0x1e67dc>=_0x1dfb06){_0x1e67dc=_0x1dfb06;_0x54b07a=0xc8;}else{_0x54b07a=0xce;}_0xe88894[_0xd5df('0x24')](_0x54b07a);return _0xe88894[_0xd5df('0x25')](_0xd5df('0x26'),_0x34fd6c+'-'+_0x1e67dc+'/'+_0x1dfb06)[_0xd5df('0x1f')](_0x21f58e);}return null;};}function patchUpdates(_0x19d14a){return function(_0x2eefce){try{jsonpatch['apply'](_0x2eefce,_0x19d14a,!![]);}catch(_0x1ee0c8){return BPromise[_0xd5df('0x27')](_0x1ee0c8);}return _0x2eefce[_0xd5df('0x28')]();};}function saveUpdates(_0x3c3da7,_0x225e0b){return function(_0x5ea0cc){if(_0x5ea0cc){return _0x5ea0cc[_0xd5df('0x29')](_0x3c3da7)[_0xd5df('0x2a')](function(_0x205581){return _0x205581;});}return null;};}function removeEntity(_0x3a1bef,_0x4e3c36){return function(_0x444f2c){if(_0x444f2c){return _0x444f2c[_0xd5df('0x2b')]()['then'](function(){var _0x33c163=_0x444f2c[_0xd5df('0x2c')]({'plain':!![]});var _0x2c8a1a='Companies';return db[_0xd5df('0x2d')][_0xd5df('0x2b')]({'where':{'type':_0x2c8a1a,'resourceId':_0x33c163['id']}})['then'](function(){return _0x444f2c;});})[_0xd5df('0x2a')](function(){_0x3a1bef[_0xd5df('0x24')](0xcc)[_0xd5df('0x1e')]();});}};}function handleEntityNotFound(_0x2872ad,_0x217a18){return function(_0x5606b0){if(!_0x5606b0){_0x2872ad[_0xd5df('0x1d')](0x194);}return _0x5606b0;};}function handleError(_0x906046,_0x52b58d){_0x52b58d=_0x52b58d||0x1f4;return function(_0x239dba){logger[_0xd5df('0x2e')](_0x239dba['stack']);if(_0x239dba['name']){delete _0x239dba[_0xd5df('0x2f')];}_0x906046[_0xd5df('0x24')](_0x52b58d)['send'](_0x239dba);};}exports[_0xd5df('0x30')]=function(_0x86a562,_0x2b7b11){var _0x49bd17={},_0x4e9b97={},_0x17cdb5={'count':0x0,'rows':[]};return db['CmCompany'][_0xd5df('0x31')]()[_0xd5df('0x2a')](function(_0xf55c4){_0x4e9b97['model']=_['keys'](_0xf55c4);_0x4e9b97[_0xd5df('0x32')]=_[_0xd5df('0x33')](_0x86a562['query']);_0x4e9b97[_0xd5df('0x34')]=_['intersection'](_0x4e9b97[_0xd5df('0x35')],_0x4e9b97[_0xd5df('0x32')]);_0x49bd17['attributes']=_[_0xd5df('0x36')](_0x4e9b97[_0xd5df('0x35')],qs[_0xd5df('0x37')](_0x86a562[_0xd5df('0x32')][_0xd5df('0x37')]));_0x49bd17['attributes']=_0x49bd17[_0xd5df('0x38')]['length']?_0x49bd17[_0xd5df('0x38')]:_0x4e9b97['model'];if(!_0x86a562[_0xd5df('0x32')][_0xd5df('0x39')](_0xd5df('0x3a'))){_0x49bd17[_0xd5df('0x21')]=qs['limit'](_0x86a562['query'][_0xd5df('0x21')]);_0x49bd17[_0xd5df('0x20')]=qs[_0xd5df('0x20')](_0x86a562['query'][_0xd5df('0x20')]);}_0x49bd17[_0xd5df('0x3b')]=qs['sort'](_0x86a562['query']['sort']);_0x49bd17[_0xd5df('0x3c')]=qs[_0xd5df('0x34')](_[_0xd5df('0x3d')](_0x86a562[_0xd5df('0x32')],_0x4e9b97[_0xd5df('0x34')]),_0xf55c4);if(_0x86a562['query'][_0xd5df('0x3e')]){_0x49bd17['where']=_['merge'](_0x49bd17[_0xd5df('0x3c')],{'$or':_['map'](_0x49bd17[_0xd5df('0x38')],function(_0x6a4fb5){var _0x129e9c={};_0x129e9c[_0x6a4fb5]={'$like':'%'+_0x86a562[_0xd5df('0x32')][_0xd5df('0x3e')]+'%'};return _0x129e9c;})});}_0x49bd17=_[_0xd5df('0x3f')]({},_0x49bd17,_0x86a562[_0xd5df('0x40')]);var _0x1e8617={'where':_0x49bd17[_0xd5df('0x3c')]};return db[_0xd5df('0x41')][_0xd5df('0x23')](_0x1e8617)[_0xd5df('0x2a')](function(_0x12efe){_0x17cdb5[_0xd5df('0x23')]=_0x12efe;if(_0x86a562['query']['includeAll']){_0x49bd17[_0xd5df('0x42')]=[{'all':!![]}];}return db[_0xd5df('0x41')]['findAll'](_0x49bd17);})[_0xd5df('0x2a')](function(_0x2e4289){_0x17cdb5[_0xd5df('0x43')]=_0x2e4289;return _0x17cdb5;})[_0xd5df('0x2a')](respondWithFilteredResult(_0x2b7b11,_0x49bd17))[_0xd5df('0x44')](handleError(_0x2b7b11,null));})[_0xd5df('0x44')](handleError(_0x2b7b11,null));};exports['show']=function(_0x2b0852,_0x403568){var _0x2fc14e={'raw':![],'where':{'id':_0x2b0852[_0xd5df('0x45')]['id']}},_0x527b4d={};_0x527b4d[_0xd5df('0x35')]=_['keys'](db[_0xd5df('0x41')][_0xd5df('0x46')]);_0x527b4d[_0xd5df('0x32')]=_[_0xd5df('0x33')](_0x2b0852[_0xd5df('0x32')]);_0x527b4d[_0xd5df('0x34')]=_['intersection'](_0x527b4d[_0xd5df('0x35')],_0x527b4d[_0xd5df('0x32')]);_0x2fc14e[_0xd5df('0x38')]=_[_0xd5df('0x36')](_0x527b4d['model'],qs[_0xd5df('0x37')](_0x2b0852[_0xd5df('0x32')]['fields']));_0x2fc14e[_0xd5df('0x38')]=_0x2fc14e[_0xd5df('0x38')][_0xd5df('0x47')]?_0x2fc14e[_0xd5df('0x38')]:_0x527b4d[_0xd5df('0x35')];if(_0x2b0852['query']['includeAll']){_0x2fc14e[_0xd5df('0x42')]=[{'all':!![]}];}_0x2fc14e=_[_0xd5df('0x3f')]({},_0x2fc14e,_0x2b0852[_0xd5df('0x40')]);return db['CmCompany'][_0xd5df('0x48')](_0x2fc14e)[_0xd5df('0x2a')](handleEntityNotFound(_0x403568,null))[_0xd5df('0x2a')](respondWithResult(_0x403568,null))[_0xd5df('0x44')](handleError(_0x403568,null));};exports[_0xd5df('0x49')]=function(_0x240f60,_0x5beded){return db[_0xd5df('0x41')][_0xd5df('0x49')](_0x240f60[_0xd5df('0x4a')],{})[_0xd5df('0x2a')](function(_0xd97c98){var _0x193e4b=_0x240f60[_0xd5df('0x4b')][_0xd5df('0x2c')]({'plain':!![]});if(!_0x193e4b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x193e4b['role']===_0xd5df('0x4b')){var _0x5d5b60=_0xd97c98['get']({'plain':!![]});var _0x3d702a=_0xd5df('0x4c');return db['UserProfileSection'][_0xd5df('0x48')]({'where':{'name':_0x3d702a,'userProfileId':_0x193e4b[_0xd5df('0x4d')]},'raw':!![]})[_0xd5df('0x2a')](function(_0x4e58b1){if(_0x4e58b1&&_0x4e58b1[_0xd5df('0x4e')]===0x0){return db[_0xd5df('0x2d')][_0xd5df('0x49')]({'name':_0x5d5b60[_0xd5df('0x2f')],'resourceId':_0x5d5b60['id'],'type':_0x4e58b1['name'],'sectionId':_0x4e58b1['id']},{})['then'](function(){return _0xd97c98;});}else{return _0xd97c98;}})[_0xd5df('0x44')](function(_0x4ae468){logger[_0xd5df('0x2e')](_0xd5df('0x4f'),_0x4ae468);throw _0x4ae468;});}return _0xd97c98;})[_0xd5df('0x2a')](respondWithResult(_0x5beded,0xc9))[_0xd5df('0x44')](handleError(_0x5beded,null));};exports[_0xd5df('0x29')]=function(_0x35f316,_0x156320){if(_0x35f316[_0xd5df('0x4a')]['id']){delete _0x35f316[_0xd5df('0x4a')]['id'];}return db[_0xd5df('0x41')]['find']({'where':{'id':_0x35f316[_0xd5df('0x45')]['id']}})[_0xd5df('0x2a')](handleEntityNotFound(_0x156320,null))['then'](saveUpdates(_0x35f316[_0xd5df('0x4a')],null))[_0xd5df('0x2a')](respondWithResult(_0x156320,null))[_0xd5df('0x44')](handleError(_0x156320,null));};exports[_0xd5df('0x2b')]=function(_0x4db19f,_0x4504ba){return db[_0xd5df('0x41')][_0xd5df('0x48')]({'where':{'id':_0x4db19f['params']['id']}})[_0xd5df('0x2a')](handleEntityNotFound(_0x4504ba,null))[_0xd5df('0x2a')](removeEntity(_0x4504ba,null))[_0xd5df('0x44')](handleError(_0x4504ba,null));};exports[_0xd5df('0x31')]=function(_0x28f236,_0x2198e0){return db[_0xd5df('0x41')][_0xd5df('0x31')]()[_0xd5df('0x2a')](respondWithResult(_0x2198e0,null))['catch'](handleError(_0x2198e0,null));};exports[_0xd5df('0x50')]=function(_0x2de4f5,_0x5988ec,_0x3c0eca){return db[_0xd5df('0x51')]['find']({'where':{'id':_0x2de4f5['params']['id']}})['then'](handleEntityNotFound(_0x5988ec,null))[_0xd5df('0x2a')](function(_0x269604){if(_0x269604){return _0x269604[_0xd5df('0x50')](_0x2de4f5[_0xd5df('0x4a')][_0xd5df('0x52')],_[_0xd5df('0x53')](_0x2de4f5[_0xd5df('0x4a')],[_0xd5df('0x52'),'id'])||{});}})[_0xd5df('0x2a')](respondWithResult(_0x5988ec,null))[_0xd5df('0x44')](handleError(_0x5988ec,null));};exports['getContacts']=function(_0x4b08cc,_0x24867e,_0x1e7288){var _0xdb08e1={};var _0x5b41b6={};var _0x3cd5f0;var _0x36e351;return db['CmCompany'][_0xd5df('0x54')]({'where':{'id':_0x4b08cc[_0xd5df('0x45')]['id']}})['then'](handleEntityNotFound(_0x24867e,null))[_0xd5df('0x2a')](function(_0x3f9b10){if(_0x3f9b10){_0x3cd5f0=_0x3f9b10;_0x5b41b6[_0xd5df('0x35')]=_['keys'](db[_0xd5df('0x51')]['rawAttributes']);_0x5b41b6[_0xd5df('0x32')]=_['keys'](_0x4b08cc[_0xd5df('0x32')]);_0x5b41b6[_0xd5df('0x34')]=_['intersection'](_0x5b41b6['model'],_0x5b41b6[_0xd5df('0x32')]);_0xdb08e1[_0xd5df('0x38')]=_[_0xd5df('0x36')](_0x5b41b6[_0xd5df('0x35')],qs['fields'](_0x4b08cc[_0xd5df('0x32')][_0xd5df('0x37')]));_0xdb08e1['attributes']=_0xdb08e1[_0xd5df('0x38')][_0xd5df('0x47')]?_0xdb08e1['attributes']:_0x5b41b6[_0xd5df('0x35')];_0xdb08e1['order']=qs[_0xd5df('0x55')](_0x4b08cc[_0xd5df('0x32')]['sort']);_0xdb08e1[_0xd5df('0x3c')]=qs['filters'](_[_0xd5df('0x3d')](_0x4b08cc['query'],_0x5b41b6[_0xd5df('0x34')]));if(_0x4b08cc[_0xd5df('0x32')][_0xd5df('0x3e')]){_0xdb08e1[_0xd5df('0x3c')]=_[_0xd5df('0x3f')](_0xdb08e1[_0xd5df('0x3c')],{'$or':_[_0xd5df('0x56')](_0xdb08e1[_0xd5df('0x38')],function(_0x1c2401){var _0x194e87={};_0x194e87[_0x1c2401]={'$like':'%'+_0x4b08cc[_0xd5df('0x32')][_0xd5df('0x3e')]+'%'};return _0x194e87;})});}_0xdb08e1=_['merge']({},_0xdb08e1,_0x4b08cc[_0xd5df('0x40')]);return _0x3cd5f0[_0xd5df('0x57')](_0xdb08e1);}})['then'](function(_0x5b1482){if(_0x5b1482){_0x36e351=_0x5b1482[_0xd5df('0x47')];if(!_0x4b08cc['query'][_0xd5df('0x39')](_0xd5df('0x3a'))){_0xdb08e1[_0xd5df('0x21')]=qs[_0xd5df('0x21')](_0x4b08cc[_0xd5df('0x32')][_0xd5df('0x21')]);_0xdb08e1[_0xd5df('0x20')]=qs[_0xd5df('0x20')](_0x4b08cc[_0xd5df('0x32')][_0xd5df('0x20')]);}return _0x3cd5f0[_0xd5df('0x57')](_0xdb08e1);}})[_0xd5df('0x2a')](function(_0x38a660){if(_0x38a660){return _0x38a660?{'count':_0x36e351,'rows':_0x38a660}:null;}})[_0xd5df('0x2a')](respondWithResult(_0x24867e,null))[_0xd5df('0x44')](handleError(_0x24867e,null));}; \ No newline at end of file +var _0x7f85=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','destroy','Companies','UserProfileResource','then','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','where','filters','pick','merge','findAll','catch','show','rawAttributes','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','CmContact','ids','omit','getContacts','order','sort','filter','options','rimraf','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis'];(function(_0x5e9b49,_0x4cf97d){var _0x3b8bac=function(_0x2a5a1e){while(--_0x2a5a1e){_0x5e9b49['push'](_0x5e9b49['shift']());}};_0x3b8bac(++_0x4cf97d);}(_0x7f85,0x188));var _0x57f8=function(_0x5c225c,_0x5b0b1f){_0x5c225c=_0x5c225c-0x0;var _0x1668e7=_0x7f85[_0x5c225c];return _0x1668e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57f8('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(_0x57f8('0x1'));var util=require(_0x57f8('0x2'));var path=require(_0x57f8('0x3'));var sox=require(_0x57f8('0x4'));var csv=require(_0x57f8('0x5'));var ejs=require(_0x57f8('0x6'));var fs=require('fs');var fs_extra=require(_0x57f8('0x7'));var _=require(_0x57f8('0x8'));var squel=require('squel');var crypto=require(_0x57f8('0x9'));var jsforce=require(_0x57f8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x57f8('0x5'));var querystring=require('querystring');var Papa=require(_0x57f8('0xb'));var Redis=require(_0x57f8('0xc'));var authService=require(_0x57f8('0xd'));var qs=require(_0x57f8('0xe'));var as=require(_0x57f8('0xf'));var hardwareService=require(_0x57f8('0x10'));var logger=require(_0x57f8('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x57f8('0x12'));var licenseUtil=require(_0x57f8('0x13'));var db=require(_0x57f8('0x14'))['db'];function respondWithStatusCode(_0x4867ee,_0x2ea63e){_0x2ea63e=_0x2ea63e||0xcc;return function(_0x3833d7){if(_0x3833d7){return _0x4867ee[_0x57f8('0x15')](_0x2ea63e);}return _0x4867ee['status'](_0x2ea63e)[_0x57f8('0x16')]();};}function respondWithResult(_0x58181a,_0x508f7d){_0x508f7d=_0x508f7d||0xc8;return function(_0x9d0917){if(_0x9d0917){return _0x58181a[_0x57f8('0x17')](_0x508f7d)[_0x57f8('0x18')](_0x9d0917);}};}function respondWithFilteredResult(_0x4e9c1d,_0x2fd9be){return function(_0x16d552){if(_0x16d552){var _0x321065=typeof _0x2fd9be[_0x57f8('0x19')]===_0x57f8('0x1a')&&typeof _0x2fd9be['limit']===_0x57f8('0x1a');var _0x525966=_0x16d552['count'];var _0x4a3c40=_0x321065?0x0:_0x2fd9be[_0x57f8('0x19')];var _0x53fb49=_0x321065?_0x16d552[_0x57f8('0x1b')]:_0x2fd9be[_0x57f8('0x19')]+_0x2fd9be[_0x57f8('0x1c')];var _0x2f53f4;if(_0x53fb49>=_0x525966){_0x53fb49=_0x525966;_0x2f53f4=0xc8;}else{_0x2f53f4=0xce;}_0x4e9c1d[_0x57f8('0x17')](_0x2f53f4);return _0x4e9c1d['set'](_0x57f8('0x1d'),_0x4a3c40+'-'+_0x53fb49+'/'+_0x525966)[_0x57f8('0x18')](_0x16d552);}return null;};}function patchUpdates(_0x1e9796){return function(_0x229ac0){try{jsonpatch['apply'](_0x229ac0,_0x1e9796,!![]);}catch(_0x26632c){return BPromise[_0x57f8('0x1e')](_0x26632c);}return _0x229ac0['save']();};}function saveUpdates(_0x4d6e1e,_0x5348ee){return function(_0x101f74){if(_0x101f74){return _0x101f74['update'](_0x4d6e1e)['then'](function(_0x5f34a5){return _0x5f34a5;});}return null;};}function removeEntity(_0x4bf1f8,_0x39132b){return function(_0x6ca6a1){if(_0x6ca6a1){return _0x6ca6a1[_0x57f8('0x1f')]()['then'](function(){var _0x4b02a1=_0x6ca6a1['get']({'plain':!![]});var _0x414a24=_0x57f8('0x20');return db[_0x57f8('0x21')][_0x57f8('0x1f')]({'where':{'type':_0x414a24,'resourceId':_0x4b02a1['id']}})[_0x57f8('0x22')](function(){return _0x6ca6a1;});})[_0x57f8('0x22')](function(){_0x4bf1f8[_0x57f8('0x17')](0xcc)[_0x57f8('0x16')]();});}};}function handleEntityNotFound(_0x599e69,_0x40b2ca){return function(_0x1b44ba){if(!_0x1b44ba){_0x599e69[_0x57f8('0x15')](0x194);}return _0x1b44ba;};}function handleError(_0x565943,_0x2fbe35){_0x2fbe35=_0x2fbe35||0x1f4;return function(_0x1aed4f){logger[_0x57f8('0x23')](_0x1aed4f[_0x57f8('0x24')]);if(_0x1aed4f[_0x57f8('0x25')]){delete _0x1aed4f['name'];}_0x565943[_0x57f8('0x17')](_0x2fbe35)[_0x57f8('0x26')](_0x1aed4f);};}exports[_0x57f8('0x27')]=function(_0x2dbd5c,_0x5d8d5f){var _0x154f41={},_0x20460d={},_0xf58f76={'count':0x0,'rows':[]};return db[_0x57f8('0x28')][_0x57f8('0x29')]()[_0x57f8('0x22')](function(_0x4fe127){_0x20460d[_0x57f8('0x2a')]=_[_0x57f8('0x2b')](_0x4fe127);_0x20460d[_0x57f8('0x2c')]=_[_0x57f8('0x2b')](_0x2dbd5c[_0x57f8('0x2c')]);_0x20460d['filters']=_[_0x57f8('0x2d')](_0x20460d['model'],_0x20460d[_0x57f8('0x2c')]);_0x154f41[_0x57f8('0x2e')]=_[_0x57f8('0x2d')](_0x20460d['model'],qs['fields'](_0x2dbd5c[_0x57f8('0x2c')][_0x57f8('0x2f')]));_0x154f41[_0x57f8('0x2e')]=_0x154f41['attributes']['length']?_0x154f41[_0x57f8('0x2e')]:_0x20460d[_0x57f8('0x2a')];if(!_0x2dbd5c[_0x57f8('0x2c')][_0x57f8('0x30')](_0x57f8('0x31'))){_0x154f41['limit']=qs[_0x57f8('0x1c')](_0x2dbd5c[_0x57f8('0x2c')][_0x57f8('0x1c')]);_0x154f41['offset']=qs[_0x57f8('0x19')](_0x2dbd5c[_0x57f8('0x2c')][_0x57f8('0x19')]);}_0x154f41['order']=qs['sort'](_0x2dbd5c['query']['sort']);_0x154f41[_0x57f8('0x32')]=qs[_0x57f8('0x33')](_[_0x57f8('0x34')](_0x2dbd5c[_0x57f8('0x2c')],_0x20460d['filters']),_0x4fe127);if(_0x2dbd5c[_0x57f8('0x2c')]['filter']){_0x154f41[_0x57f8('0x32')]=_[_0x57f8('0x35')](_0x154f41[_0x57f8('0x32')],{'$or':_['map'](_0x154f41['attributes'],function(_0x14d729){var _0x4f7c52={};_0x4f7c52[_0x14d729]={'$like':'%'+_0x2dbd5c[_0x57f8('0x2c')]['filter']+'%'};return _0x4f7c52;})});}_0x154f41=_[_0x57f8('0x35')]({},_0x154f41,_0x2dbd5c['options']);var _0x808066={'where':_0x154f41['where']};return db[_0x57f8('0x28')][_0x57f8('0x1b')](_0x808066)[_0x57f8('0x22')](function(_0x2b7b17){_0xf58f76[_0x57f8('0x1b')]=_0x2b7b17;if(_0x2dbd5c['query']['includeAll']){_0x154f41['include']=[{'all':!![]}];}return db[_0x57f8('0x28')][_0x57f8('0x36')](_0x154f41);})[_0x57f8('0x22')](function(_0x4fce1c){_0xf58f76['rows']=_0x4fce1c;return _0xf58f76;})[_0x57f8('0x22')](respondWithFilteredResult(_0x5d8d5f,_0x154f41))[_0x57f8('0x37')](handleError(_0x5d8d5f,null));})[_0x57f8('0x37')](handleError(_0x5d8d5f,null));};exports[_0x57f8('0x38')]=function(_0x26b8d0,_0x2f7c06){var _0xa44ca={'raw':![],'where':{'id':_0x26b8d0['params']['id']}},_0x184549={};_0x184549[_0x57f8('0x2a')]=_[_0x57f8('0x2b')](db[_0x57f8('0x28')][_0x57f8('0x39')]);_0x184549['query']=_[_0x57f8('0x2b')](_0x26b8d0[_0x57f8('0x2c')]);_0x184549[_0x57f8('0x33')]=_[_0x57f8('0x2d')](_0x184549[_0x57f8('0x2a')],_0x184549[_0x57f8('0x2c')]);_0xa44ca[_0x57f8('0x2e')]=_[_0x57f8('0x2d')](_0x184549[_0x57f8('0x2a')],qs[_0x57f8('0x2f')](_0x26b8d0['query'][_0x57f8('0x2f')]));_0xa44ca[_0x57f8('0x2e')]=_0xa44ca[_0x57f8('0x2e')][_0x57f8('0x3a')]?_0xa44ca['attributes']:_0x184549['model'];if(_0x26b8d0[_0x57f8('0x2c')]['includeAll']){_0xa44ca[_0x57f8('0x3b')]=[{'all':!![]}];}_0xa44ca=_['merge']({},_0xa44ca,_0x26b8d0['options']);return db[_0x57f8('0x28')][_0x57f8('0x3c')](_0xa44ca)['then'](handleEntityNotFound(_0x2f7c06,null))[_0x57f8('0x22')](respondWithResult(_0x2f7c06,null))[_0x57f8('0x37')](handleError(_0x2f7c06,null));};exports[_0x57f8('0x3d')]=function(_0x1c58e5,_0xde3f40){return db[_0x57f8('0x28')]['create'](_0x1c58e5[_0x57f8('0x3e')],{})[_0x57f8('0x22')](function(_0x265725){var _0x565691=_0x1c58e5[_0x57f8('0x3f')][_0x57f8('0x40')]({'plain':!![]});if(!_0x565691)throw new Error(_0x57f8('0x41'));if(_0x565691['role']===_0x57f8('0x3f')){var _0x49595e=_0x265725['get']({'plain':!![]});var _0x4a890e=_0x57f8('0x20');return db[_0x57f8('0x42')][_0x57f8('0x3c')]({'where':{'name':_0x4a890e,'userProfileId':_0x565691[_0x57f8('0x43')]},'raw':!![]})[_0x57f8('0x22')](function(_0x3f7f2f){if(_0x3f7f2f&&_0x3f7f2f[_0x57f8('0x44')]===0x0){return db[_0x57f8('0x21')][_0x57f8('0x3d')]({'name':_0x49595e[_0x57f8('0x25')],'resourceId':_0x49595e['id'],'type':_0x3f7f2f[_0x57f8('0x25')],'sectionId':_0x3f7f2f['id']},{})[_0x57f8('0x22')](function(){return _0x265725;});}else{return _0x265725;}})[_0x57f8('0x37')](function(_0x2254cf){logger[_0x57f8('0x23')](_0x57f8('0x45'),_0x2254cf);throw _0x2254cf;});}return _0x265725;})[_0x57f8('0x22')](respondWithResult(_0xde3f40,0xc9))['catch'](handleError(_0xde3f40,null));};exports[_0x57f8('0x46')]=function(_0x1e40cd,_0x3af694){if(_0x1e40cd[_0x57f8('0x3e')]['id']){delete _0x1e40cd['body']['id'];}return db[_0x57f8('0x28')][_0x57f8('0x3c')]({'where':{'id':_0x1e40cd['params']['id']}})[_0x57f8('0x22')](handleEntityNotFound(_0x3af694,null))[_0x57f8('0x22')](saveUpdates(_0x1e40cd[_0x57f8('0x3e')],null))[_0x57f8('0x22')](respondWithResult(_0x3af694,null))[_0x57f8('0x37')](handleError(_0x3af694,null));};exports[_0x57f8('0x1f')]=function(_0x4ce3f6,_0xacfa07){return db[_0x57f8('0x28')][_0x57f8('0x3c')]({'where':{'id':_0x4ce3f6[_0x57f8('0x47')]['id']}})[_0x57f8('0x22')](handleEntityNotFound(_0xacfa07,null))[_0x57f8('0x22')](removeEntity(_0xacfa07,null))['catch'](handleError(_0xacfa07,null));};exports[_0x57f8('0x29')]=function(_0x153685,_0x5769b6){return db[_0x57f8('0x28')][_0x57f8('0x29')]()['then'](respondWithResult(_0x5769b6,null))[_0x57f8('0x37')](handleError(_0x5769b6,null));};exports[_0x57f8('0x48')]=function(_0x59db52,_0x1437b8,_0xd9b68a){return db[_0x57f8('0x49')][_0x57f8('0x3c')]({'where':{'id':_0x59db52['params']['id']}})[_0x57f8('0x22')](handleEntityNotFound(_0x1437b8,null))[_0x57f8('0x22')](function(_0x20f8f0){if(_0x20f8f0){return _0x20f8f0['addContacts'](_0x59db52['body'][_0x57f8('0x4a')],_[_0x57f8('0x4b')](_0x59db52[_0x57f8('0x3e')],[_0x57f8('0x4a'),'id'])||{});}})[_0x57f8('0x22')](respondWithResult(_0x1437b8,null))[_0x57f8('0x37')](handleError(_0x1437b8,null));};exports[_0x57f8('0x4c')]=function(_0x15e5ff,_0x193071,_0x5362e2){var _0x48c94f={};var _0x15f9ec={};var _0x28767c;var _0x22cb1f;return db[_0x57f8('0x28')]['findOne']({'where':{'id':_0x15e5ff['params']['id']}})['then'](handleEntityNotFound(_0x193071,null))[_0x57f8('0x22')](function(_0x204370){if(_0x204370){_0x28767c=_0x204370;_0x15f9ec['model']=_[_0x57f8('0x2b')](db[_0x57f8('0x49')]['rawAttributes']);_0x15f9ec['query']=_['keys'](_0x15e5ff[_0x57f8('0x2c')]);_0x15f9ec[_0x57f8('0x33')]=_[_0x57f8('0x2d')](_0x15f9ec[_0x57f8('0x2a')],_0x15f9ec[_0x57f8('0x2c')]);_0x48c94f[_0x57f8('0x2e')]=_[_0x57f8('0x2d')](_0x15f9ec[_0x57f8('0x2a')],qs[_0x57f8('0x2f')](_0x15e5ff[_0x57f8('0x2c')]['fields']));_0x48c94f[_0x57f8('0x2e')]=_0x48c94f[_0x57f8('0x2e')]['length']?_0x48c94f['attributes']:_0x15f9ec['model'];_0x48c94f[_0x57f8('0x4d')]=qs[_0x57f8('0x4e')](_0x15e5ff[_0x57f8('0x2c')][_0x57f8('0x4e')]);_0x48c94f[_0x57f8('0x32')]=qs[_0x57f8('0x33')](_[_0x57f8('0x34')](_0x15e5ff[_0x57f8('0x2c')],_0x15f9ec[_0x57f8('0x33')]));if(_0x15e5ff[_0x57f8('0x2c')][_0x57f8('0x4f')]){_0x48c94f[_0x57f8('0x32')]=_[_0x57f8('0x35')](_0x48c94f['where'],{'$or':_['map'](_0x48c94f[_0x57f8('0x2e')],function(_0x2e46ee){var _0x2fc4de={};_0x2fc4de[_0x2e46ee]={'$like':'%'+_0x15e5ff[_0x57f8('0x2c')][_0x57f8('0x4f')]+'%'};return _0x2fc4de;})});}_0x48c94f=_['merge']({},_0x48c94f,_0x15e5ff[_0x57f8('0x50')]);return _0x28767c[_0x57f8('0x4c')](_0x48c94f);}})[_0x57f8('0x22')](function(_0x20f1c4){if(_0x20f1c4){_0x22cb1f=_0x20f1c4[_0x57f8('0x3a')];if(!_0x15e5ff[_0x57f8('0x2c')][_0x57f8('0x30')]('nolimit')){_0x48c94f[_0x57f8('0x1c')]=qs[_0x57f8('0x1c')](_0x15e5ff[_0x57f8('0x2c')]['limit']);_0x48c94f[_0x57f8('0x19')]=qs[_0x57f8('0x19')](_0x15e5ff[_0x57f8('0x2c')][_0x57f8('0x19')]);}return _0x28767c[_0x57f8('0x4c')](_0x48c94f);}})[_0x57f8('0x22')](function(_0xf2eec9){if(_0xf2eec9){return _0xf2eec9?{'count':_0x22cb1f,'rows':_0xf2eec9}:null;}})[_0x57f8('0x22')](respondWithResult(_0x193071,null))[_0x57f8('0x37')](handleError(_0x193071,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 10ef079..7573ed2 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 _0x6c9a=['exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','request-promise','../../config/environment','./cmCompany.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6c9a,0xb8));var _0xa6c9=function(_0xfd1fb7,_0x497714){_0xfd1fb7=_0xfd1fb7-0x0;var _0xdca930=_0x6c9a[_0xfd1fb7];return _0xdca930;};'use strict';var _=require(_0xa6c9('0x0'));var util=require('util');var logger=require(_0xa6c9('0x1'))(_0xa6c9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa6c9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa6c9('0x4'));var attributes=require(_0xa6c9('0x5'));module[_0xa6c9('0x6')]=function(_0x1e8411,_0x256c4e){return _0x1e8411[_0xa6c9('0x7')](_0xa6c9('0x8'),attributes,{'tableName':_0xa6c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0015=['lodash','moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','CmCompany'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0x0015,0x85));var _0x5001=function(_0x29868a,_0x5c63c6){_0x29868a=_0x29868a-0x0;var _0x3b6a6b=_0x0015[_0x29868a];return _0x3b6a6b;};'use strict';var _=require(_0x5001('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5001('0x1'));var BPromise=require(_0x5001('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5001('0x3'));var config=require(_0x5001('0x4'));var attributes=require(_0x5001('0x5'));module['exports']=function(_0x5be126,_0x367064){return _0x5be126['define'](_0x5001('0x6'),attributes,{'tableName':'cm_companies','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 4105469..846ad51 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 _0xc038=['then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0xc038,0x1c3));var _0x8c03=function(_0x49c801,_0xb1fcba){_0x49c801=_0x49c801-0x0;var _0x2fe6b4=_0xc038[_0x49c801];return _0x2fe6b4;};'use strict';var _=require(_0x8c03('0x0'));var util=require('util');var moment=require(_0x8c03('0x1'));var BPromise=require(_0x8c03('0x2'));var rs=require(_0x8c03('0x3'));var fs=require('fs');var Redis=require(_0x8c03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c03('0x5'));var logger=require(_0x8c03('0x6'))(_0x8c03('0x7'));var config=require(_0x8c03('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8c03('0x9')][_0x8c03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a79b2,_0xaad227,_0x46d167){return new BPromise(function(_0x4fca3e,_0x498b1f){return client['request'](_0x4a79b2,_0x46d167)[_0x8c03('0xb')](function(_0x33b353){logger['info'](_0x8c03('0xc'),_0xaad227,_0x8c03('0xd'));logger[_0x8c03('0xe')](_0x8c03('0xf'),_0xaad227,_0x8c03('0xd'),JSON['stringify'](_0x33b353));if(_0x33b353[_0x8c03('0x10')]){if(_0x33b353[_0x8c03('0x10')]['code']===0x1f4){logger[_0x8c03('0x10')](_0x8c03('0xc'),_0xaad227,_0x33b353['error'][_0x8c03('0x11')]);return _0x498b1f(_0x33b353[_0x8c03('0x10')]['message']);}logger[_0x8c03('0x10')](_0x8c03('0xc'),_0xaad227,_0x33b353[_0x8c03('0x10')]['message']);return _0x4fca3e(_0x33b353[_0x8c03('0x10')]['message']);}else{logger[_0x8c03('0x12')](_0x8c03('0xc'),_0xaad227,_0x8c03('0xd'));_0x4fca3e(_0x33b353[_0x8c03('0x13')][_0x8c03('0x11')]);}})[_0x8c03('0x14')](function(_0x194e44){logger['error']('CmCompany,\x20%s,\x20%s',_0xaad227,_0x194e44);_0x498b1f(_0x194e44);});});} \ No newline at end of file +var _0xf57c=['info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xf57c,0x16b));var _0xcf57=function(_0x1bd7ca,_0x501ec8){_0x1bd7ca=_0x1bd7ca-0x0;var _0x9c182=_0xf57c[_0x1bd7ca];return _0x9c182;};'use strict';var _=require('lodash');var util=require(_0xcf57('0x0'));var moment=require(_0xcf57('0x1'));var BPromise=require(_0xcf57('0x2'));var rs=require(_0xcf57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf57('0x4'))['db'];var utils=require(_0xcf57('0x5'));var logger=require(_0xcf57('0x6'))('rpc');var config=require(_0xcf57('0x7'));var jayson=require(_0xcf57('0x8'));var client=jayson[_0xcf57('0x9')][_0xcf57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c546f,_0x13c93b,_0x5c3b3e){return new BPromise(function(_0x53316c,_0x517331){return client['request'](_0x4c546f,_0x5c3b3e)['then'](function(_0x23c399){logger[_0xcf57('0xb')]('CmCompany,\x20%s,\x20%s',_0x13c93b,'request\x20sent');logger[_0xcf57('0xc')](_0xcf57('0xd'),_0x13c93b,_0xcf57('0xe'),JSON[_0xcf57('0xf')](_0x23c399));if(_0x23c399[_0xcf57('0x10')]){if(_0x23c399[_0xcf57('0x10')][_0xcf57('0x11')]===0x1f4){logger[_0xcf57('0x10')](_0xcf57('0x12'),_0x13c93b,_0x23c399['error'][_0xcf57('0x13')]);return _0x517331(_0x23c399['error'][_0xcf57('0x13')]);}logger['error'](_0xcf57('0x12'),_0x13c93b,_0x23c399['error'][_0xcf57('0x13')]);return _0x53316c(_0x23c399[_0xcf57('0x10')]['message']);}else{logger['info'](_0xcf57('0x12'),_0x13c93b,_0xcf57('0xe'));_0x53316c(_0x23c399[_0xcf57('0x14')][_0xcf57('0x13')]);}})[_0xcf57('0x15')](function(_0x85e4c){logger[_0xcf57('0x10')]('CmCompany,\x20%s,\x20%s',_0x13c93b,_0x85e4c);_0x517331(_0x85e4c);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index cdebc7f..0651994 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 _0xca44=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','post','create','put'];(function(_0x991bb7,_0x53be1b){var _0x4313b4=function(_0x565fa8){while(--_0x565fa8){_0x991bb7['push'](_0x991bb7['shift']());}};_0x4313b4(++_0x53be1b);}(_0xca44,0xff));var _0x4ca4=function(_0x5addfe,_0x4e5d4a){_0x5addfe=_0x5addfe-0x0;var _0xcb5690=_0xca44[_0x5addfe];return _0xcb5690;};'use strict';var multer=require('multer');var util=require(_0x4ca4('0x0'));var path=require(_0x4ca4('0x1'));var timeout=require(_0x4ca4('0x2'));var express=require(_0x4ca4('0x3'));var router=express[_0x4ca4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ca4('0x5'));var interaction=require(_0x4ca4('0x6'));var config=require('../../config/environment');var controller=require(_0x4ca4('0x7'));router[_0x4ca4('0x8')]('/',auth[_0x4ca4('0x9')](),controller[_0x4ca4('0xa')]);router[_0x4ca4('0x8')]('/describe',auth[_0x4ca4('0x9')](),controller[_0x4ca4('0xb')]);router[_0x4ca4('0x8')](_0x4ca4('0xc'),auth[_0x4ca4('0x9')](),controller[_0x4ca4('0xd')]);router[_0x4ca4('0x8')](_0x4ca4('0xe'),auth[_0x4ca4('0x9')](),controller['getContacts']);router[_0x4ca4('0xf')]('/',auth[_0x4ca4('0x9')](),controller[_0x4ca4('0x10')]);router[_0x4ca4('0xf')](_0x4ca4('0xe'),auth[_0x4ca4('0x9')](),controller['addContacts']);router[_0x4ca4('0x11')](_0x4ca4('0xc'),auth['isAuthenticated'](),controller[_0x4ca4('0x12')]);router[_0x4ca4('0x13')](_0x4ca4('0xc'),auth[_0x4ca4('0x9')](),controller[_0x4ca4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd1b2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','create','post','addContacts','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x890c0e,_0x245cb6){var _0x63e763=function(_0x172e3a){while(--_0x172e3a){_0x890c0e['push'](_0x890c0e['shift']());}};_0x63e763(++_0x245cb6);}(_0xd1b2,0x1db));var _0x2d1b=function(_0x6ce989,_0x673d65){_0x6ce989=_0x6ce989-0x0;var _0x17550=_0xd1b2[_0x6ce989];return _0x17550;};'use strict';var multer=require(_0x2d1b('0x0'));var util=require(_0x2d1b('0x1'));var path=require(_0x2d1b('0x2'));var timeout=require(_0x2d1b('0x3'));var express=require(_0x2d1b('0x4'));var router=express[_0x2d1b('0x5')]();var fs_extra=require(_0x2d1b('0x6'));var auth=require(_0x2d1b('0x7'));var interaction=require(_0x2d1b('0x8'));var config=require(_0x2d1b('0x9'));var controller=require('./cmCompany.controller');router[_0x2d1b('0xa')]('/',auth['isAuthenticated'](),controller[_0x2d1b('0xb')]);router['get'](_0x2d1b('0xc'),auth[_0x2d1b('0xd')](),controller[_0x2d1b('0xe')]);router['get'](_0x2d1b('0xf'),auth[_0x2d1b('0xd')](),controller[_0x2d1b('0x10')]);router[_0x2d1b('0xa')](_0x2d1b('0x11'),auth[_0x2d1b('0xd')](),controller['getContacts']);router['post']('/',auth[_0x2d1b('0xd')](),controller[_0x2d1b('0x12')]);router[_0x2d1b('0x13')](_0x2d1b('0x11'),auth[_0x2d1b('0xd')](),controller[_0x2d1b('0x14')]);router[_0x2d1b('0x15')]('/:id',auth[_0x2d1b('0xd')](),controller[_0x2d1b('0x16')]);router['delete']('/:id',auth[_0x2d1b('0xd')](),controller[_0x2d1b('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index e6a4fc2..c705219 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 _0xe3d0=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x1777e4,_0x38b4f8){var _0x21ecac=function(_0x5f453c){while(--_0x5f453c){_0x1777e4['push'](_0x1777e4['shift']());}};_0x21ecac(++_0x38b4f8);}(_0xe3d0,0x1c5));var _0x0e3d=function(_0x1f6187,_0x474274){_0x1f6187=_0x1f6187-0x0;var _0x2fd1ed=_0xe3d0[_0x1f6187];return _0x2fd1ed;};'use strict';var _=require(_0x0e3d('0x0'));var Sequelize=require(_0x0e3d('0x1'));module[_0x0e3d('0x2')]={'firstName':{'type':Sequelize[_0x0e3d('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0e3d('0x3')]},'street':{'type':Sequelize[_0x0e3d('0x3')]},'postalCode':{'type':Sequelize[_0x0e3d('0x3')]},'city':{'type':Sequelize[_0x0e3d('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x0e3d('0x3')]},'description':{'type':Sequelize[_0x0e3d('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0e3d('0x3')]},'fax':{'type':Sequelize[_0x0e3d('0x3')]},'email':{'type':Sequelize[_0x0e3d('0x3')]},'url':{'type':Sequelize[_0x0e3d('0x3')]},'facebook':{'type':Sequelize[_0x0e3d('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x0e3d('0x3')]},'teams':{'type':Sequelize[_0x0e3d('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x0e3d('0x3')]},'wechat':{'type':Sequelize[_0x0e3d('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x0e3d('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x0e3d('0x3')]},'priority':{'type':Sequelize[_0x0e3d('0x5')](0x2)[_0x0e3d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0e3d('0x7')],'defaultValue':Sequelize[_0x0e3d('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x0e3d('0x5')]}}; \ No newline at end of file +var _0xef0f=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0xef0f,0xd7));var _0xfef0=function(_0x42a63f,_0x59b73f){_0x42a63f=_0x42a63f-0x0;var _0x495a79=_0xef0f[_0x42a63f];return _0x495a79;};'use strict';var _=require(_0xfef0('0x0'));var Sequelize=require(_0xfef0('0x1'));module[_0xfef0('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xfef0('0x3')]},'street':{'type':Sequelize[_0xfef0('0x3')]},'postalCode':{'type':Sequelize[_0xfef0('0x3')]},'city':{'type':Sequelize[_0xfef0('0x3')]},'country':{'type':Sequelize[_0xfef0('0x3')]},'dateOfBirth':{'type':Sequelize[_0xfef0('0x3')]},'description':{'type':Sequelize[_0xfef0('0x4')]},'phone':{'type':Sequelize[_0xfef0('0x3')]},'mobile':{'type':Sequelize[_0xfef0('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xfef0('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xfef0('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xfef0('0x3')]},'line':{'type':Sequelize[_0xfef0('0x3')]},'wechat':{'type':Sequelize[_0xfef0('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xfef0('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xfef0('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xfef0('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfef0('0x7')],'defaultValue':Sequelize[_0xfef0('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'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 5a4100f..e1439a7 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 _0x1288=['chmodSync','0777','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','createReadStream','path','meta','import','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','exit','error\x20child\x20process','importUpdates','fork','../../components/import/cm/csvUpdates','message','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','fax','voice','resolve','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','callerid','starttime','duration','note','userSecondDisposition','UserId','User','createdAt','startCase','Website','Account','disposition','secondDisposition','thirdDisposition','key','Owner','fullname','DESC','browserName','customerIp','customerPort','ratingMessage','ratingType','ratingValue','subject','substatus','openchannel','externalUrl','threadId','findAndCountAll','sortBy','reverse','value','slice','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','stack','name','describe','getOptions','user','CmContact','find','params','catch','length','keys','startsWith','cf_','displayName','query','analytics','CmCustomField','findAll','columnName','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','merge','body','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','timezones','utcOffset','additionalPhones','duplicates','$or','ListId','findOrCreate','spread','hasOwnProperty','push','contact','all','show','Tag','Tags','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','where','$and','isNil','omit','map','format','cf_%d','dialTimezone','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','CmHopper','getTags','findOne','model','filters','attributes','intersection','fields','order','sort','filter','options','nolimit','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','item_types','items','description','ItemTypeId','PHONE','CmHopperAdditionalPhone','item','ItemType.OrderBy','`ItemType`.OrderBy','duplicateAdditionalPhones','CmContactId','bulkCreate','toContactId','hopperId','getHoppers','rawAttributes','ContactId','include','rows','pick','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename'];(function(_0x222d55,_0x34454b){var _0x40399c=function(_0x3cc3f2){while(--_0x3cc3f2){_0x222d55['push'](_0x222d55['shift']());}};_0x40399c(++_0x34454b);}(_0x1288,0x143));var _0x8128=function(_0x5200c4,_0x4d59a6){_0x5200c4=_0x5200c4-0x0;var _0x36cb24=_0x1288[_0x5200c4];return _0x36cb24;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x8128('0x0'));var squel=require(_0x8128('0x1'));var Papa=require(_0x8128('0x2'));var Redis=require(_0x8128('0x3'));var contacts=require(_0x8128('0x4'));var qs=require(_0x8128('0x5'));var logger=require(_0x8128('0x6'))(_0x8128('0x7'));var config=require('../../config/environment');var shared=require(_0x8128('0x8'));var db=require(_0x8128('0x9'))['db'];config['redis']=_['defaults'](config[_0x8128('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8128('0xb'))(new Redis(config[_0x8128('0xa')]));require(_0x8128('0xc'))[_0x8128('0xd')](socket);function respondWithResult(_0x507053,_0x3df2bc){_0x3df2bc=_0x3df2bc||0xc8;return function(_0x19c3ab){if(_0x19c3ab){return _0x507053[_0x8128('0xe')](_0x3df2bc)['json'](_0x19c3ab);}};}function respondWithFilteredResult(_0x281427,_0x43b40d){return function(_0xa455f6){if(_0xa455f6){var _0x4e8b07=typeof _0x43b40d[_0x8128('0xf')]===_0x8128('0x10')&&typeof _0x43b40d[_0x8128('0x11')]===_0x8128('0x10');var _0x9bc9ed=_0xa455f6['count'];var _0x3ad970=_0x4e8b07?0x0:_0x43b40d[_0x8128('0xf')];var _0x1d4d6c=_0x4e8b07?_0xa455f6[_0x8128('0x12')]:_0x43b40d[_0x8128('0xf')]+_0x43b40d[_0x8128('0x11')];var _0x2b9482;if(_0x1d4d6c>=_0x9bc9ed){_0x1d4d6c=_0x9bc9ed;_0x2b9482=0xc8;}else{_0x2b9482=0xce;}_0x281427[_0x8128('0xe')](_0x2b9482);return _0x281427[_0x8128('0x13')](_0x8128('0x14'),_0x3ad970+'-'+_0x1d4d6c+'/'+_0x9bc9ed)[_0x8128('0x15')](_0xa455f6);}return null;};}function saveUpdates(_0x874925){return function(_0x313755){if(_0x313755){return _0x313755[_0x8128('0x16')](_0x874925)[_0x8128('0x17')](function(_0x3a5cfd){return _0x3a5cfd;});}return null;};}function removeEntity(_0x1107e7){return function(_0x4291f8){if(_0x4291f8){return _0x4291f8[_0x8128('0x18')]()['then'](function(){_0x1107e7[_0x8128('0xe')](0xcc)[_0x8128('0x19')]();});}};}function handleEntityNotFound(_0x32a903){return function(_0x481b70){if(!_0x481b70){_0x32a903['sendStatus'](0x194);}return _0x481b70;};}function handleError(_0x137c69,_0x519922){_0x519922=_0x519922||0x1f4;return function(_0x511f96){logger['error'](_0x511f96[_0x8128('0x1a')]);if(_0x511f96[_0x8128('0x1b')]){delete _0x511f96[_0x8128('0x1b')];}_0x137c69['status'](_0x519922)['send'](_0x511f96);};}exports['index']=function(_0x30e2f7,_0x399948){var _0x1ebb8c={};return contacts[_0x8128('0x1c')]()[_0x8128('0x17')](function(_0x3f2188){_0x1ebb8c=qs[_0x8128('0x1d')](_0x3f2188,_0x30e2f7);return contacts['findAll'](_0x30e2f7['query'],_0x30e2f7[_0x8128('0x1e')],_0x1ebb8c,_0x3f2188);})[_0x8128('0x17')](respondWithFilteredResult(_0x399948,_0x1ebb8c))['catch'](handleError(_0x399948,null));};exports[_0x8128('0x18')]=function(_0x5d10aa,_0x324772){return db[_0x8128('0x1f')][_0x8128('0x20')]({'where':{'id':_0x5d10aa[_0x8128('0x21')]['id']}})[_0x8128('0x17')](handleEntityNotFound(_0x324772,null))[_0x8128('0x17')](removeEntity(_0x324772,null))[_0x8128('0x22')](handleError(_0x324772,null));};exports[_0x8128('0x1c')]=function(_0x4a86c2,_0x3f40c5){return db[_0x8128('0x1f')][_0x8128('0x1c')]()[_0x8128('0x17')](function(_0x4c1266){delete _0x4c1266['tags'];for(var _0x5df155=0x0;_0x5df1550x0){return new Promise(function(_0xdf6b5e){var _0x2c34e9=[];for(var _0xa0e377=0x0;_0xa0e377<_0x1b8510[_0x8128('0x23')];_0xa0e377++){_0x2c34e9[_0x8128('0x5f')](insertAdditionalPhones(_0x1b8510[_0xa0e377][_0x8128('0x60')],_0x1b8510[_0xa0e377][_0x8128('0x58')]));}Promise[_0x8128('0x61')](_0x2c34e9)[_0x8128('0x17')](function(){_0xdf6b5e(0x1);});})[_0x8128('0x17')](function(){return{'success':_0x4b3b5f,'failure':_0x241426,'duplicates':_0x3b2e45};});}else{return{'success':_0x4b3b5f,'failure':_0x241426,'duplicates':_0x3b2e45};}}})[_0x8128('0x17')](respondWithResult(_0x46f9d3,0xc9))['catch'](handleError(_0x46f9d3,null));};exports[_0x8128('0x62')]=function(_0x286dc5,_0x247ea6){var _0x511d06;return db['CmContact'][_0x8128('0x1c')]()[_0x8128('0x17')](function(_0x3b2c71){return db[_0x8128('0x1f')][_0x8128('0x20')]({'where':{'id':_0x286dc5[_0x8128('0x21')]['id']},'include':[{'model':db[_0x8128('0x63')],'as':_0x8128('0x64'),'attributes':['id','name',_0x8128('0x65')],'required':_0x286dc5[_0x8128('0x28')][_0x8128('0x66')]?!![]:![]},{'model':db[_0x8128('0x48')],'as':_0x8128('0x67'),'where':{'CmContactId':_0x286dc5[_0x8128('0x21')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x8128('0x68')}]}],'order':[db[_0x8128('0x69')][_0x8128('0x6a')](_0x8128('0x6b'))],'attributes':_[_0x8128('0x24')](_0x3b2c71)});})['then'](function(_0xe20234){if(!_['isNil'](_0xe20234)){_0x511d06=_0xe20234['get']({'plain':!![]});var _0x1e38cd={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xe20234&&_0xe20234[_0x8128('0x5b')]){if(_0xe20234['ListId']){_0x1e38cd[_0x8128('0x6c')][_0x8128('0x6d')]['push']({'ListId':{'$ne':_0xe20234[_0x8128('0x5b')]}});}}return db[_0x8128('0x2a')][_0x8128('0x2b')](_0x1e38cd);}})[_0x8128('0x17')](function(_0x3e3077){if(!_[_0x8128('0x6e')](_0x3e3077)){return _[_0x8128('0x6f')](_0x511d06,_[_0x8128('0x70')](_0x3e3077,function(_0x1b2258){return util[_0x8128('0x71')](_0x8128('0x72'),_0x1b2258['id']);}));}})[_0x8128('0x17')](handleEntityNotFound(_0x247ea6,null))[_0x8128('0x17')](respondWithResult(_0x247ea6,null))[_0x8128('0x22')](handleError(_0x247ea6,null));};exports['update']=function(_0x1cbaa2,_0x29f03e){var _0x141783;if(_0x1cbaa2[_0x8128('0x33')]['id']){delete _0x1cbaa2[_0x8128('0x33')]['id'];}if(!_[_0x8128('0x6e')](_0x1cbaa2['body'][_0x8128('0x73')])){var _0x5e7712=_0x1cbaa2[_0x8128('0x33')][_0x8128('0x73')];if(!_[_0x8128('0x6e')](shared[_0x8128('0x56')][_0x5e7712]))_0x1cbaa2['body']['utcOffset']=shared[_0x8128('0x56')][_0x5e7712]['utcOffset'];}return db['CmContact']['find']({'where':{'id':_0x1cbaa2[_0x8128('0x21')]['id']}})['then'](handleEntityNotFound(_0x29f03e,null))[_0x8128('0x17')](saveUpdates(_0x1cbaa2[_0x8128('0x33')],null))['then'](function(_0x2cc131){_0x141783=_0x2cc131;var _0xeeb788={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2cc131&&_0x2cc131['ListId']){if(_0x2cc131[_0x8128('0x5b')]){_0xeeb788[_0x8128('0x6c')]['$and'][_0x8128('0x5f')]({'ListId':{'$ne':_0x2cc131[_0x8128('0x5b')]}});}}return db[_0x8128('0x2a')][_0x8128('0x2b')](_0xeeb788);})[_0x8128('0x17')](function(_0x2a7ec8){if(_0x2a7ec8){return _[_0x8128('0x6f')](_['pickBy'](_0x1cbaa2[_0x8128('0x33')],function(_0x2b5d6f,_0x4e106a){return _['startsWith'](_0x4e106a,'cf_');}),_['map'](_0x2a7ec8,function(_0x4c0f2e){return util['format']('cf_%d',_0x4c0f2e['id']);}));}})['then'](function(_0x1eedbd){if(_0x1eedbd&&!_['isEmpty'](_0x1eedbd)){var _0x2fb501=squel['update']()[_0x8128('0x74')](_0x8128('0x75'))[_0x8128('0x76')](_0x1eedbd)['where'](_0x8128('0x77'),_0x1cbaa2['params']['id'])[_0x8128('0x78')]();return db['sequelize']['query'](_0x2fb501[_0x8128('0x79')],{'replacements':_0x2fb501[_0x8128('0x2f')]});}})['then'](function(){if(_0x1cbaa2[_0x8128('0x33')][_0x8128('0x7a')]&&_0x141783){return db[_0x8128('0x7b')][_0x8128('0x16')]({'phone':_0x1cbaa2[_0x8128('0x33')][_0x8128('0x7a')],'OrderBy':0x0},{'where':{'ContactId':_0x141783['id']}});}})[_0x8128('0x17')](function(){return _0x141783;})[_0x8128('0x17')](respondWithResult(_0x29f03e,null))[_0x8128('0x22')](handleError(_0x29f03e,null));};exports[_0x8128('0x7c')]=function(_0x540d60,_0x5324bd){var _0x38a6c3={};var _0x56d183={};var _0x1d3f79;var _0x37f29b;return db['CmContact'][_0x8128('0x7d')]({'where':{'id':_0x540d60[_0x8128('0x21')]['id']}})[_0x8128('0x17')](handleEntityNotFound(_0x5324bd,null))[_0x8128('0x17')](function(_0x3df235){if(_0x3df235){_0x1d3f79=_0x3df235;_0x56d183[_0x8128('0x7e')]=_['keys'](db[_0x8128('0x63')]['rawAttributes']);_0x56d183[_0x8128('0x28')]=_['keys'](_0x540d60[_0x8128('0x28')]);_0x56d183[_0x8128('0x7f')]=_['intersection'](_0x56d183['model'],_0x56d183[_0x8128('0x28')]);_0x38a6c3[_0x8128('0x80')]=_[_0x8128('0x81')](_0x56d183['model'],qs['fields'](_0x540d60[_0x8128('0x28')][_0x8128('0x82')]));_0x38a6c3[_0x8128('0x80')]=_0x38a6c3[_0x8128('0x80')][_0x8128('0x23')]?_0x38a6c3[_0x8128('0x80')]:_0x56d183[_0x8128('0x7e')];_0x38a6c3[_0x8128('0x83')]=qs[_0x8128('0x84')](_0x540d60['query'][_0x8128('0x84')]);_0x38a6c3[_0x8128('0x6c')]=qs[_0x8128('0x7f')](_['pick'](_0x540d60[_0x8128('0x28')],_0x56d183[_0x8128('0x7f')]));if(_0x540d60[_0x8128('0x28')][_0x8128('0x85')]){_0x38a6c3[_0x8128('0x6c')]=_[_0x8128('0x32')](_0x38a6c3[_0x8128('0x6c')],{'$or':_[_0x8128('0x70')](_0x38a6c3['attributes'],function(_0x1a8c45){var _0x4acf09={};_0x4acf09[_0x1a8c45]={'$like':'%'+_0x540d60[_0x8128('0x28')][_0x8128('0x85')]+'%'};return _0x4acf09;})});}_0x38a6c3=_[_0x8128('0x32')]({},_0x38a6c3,_0x540d60[_0x8128('0x86')]);return _0x1d3f79[_0x8128('0x7c')](_0x38a6c3);}})[_0x8128('0x17')](function(_0x15f0a8){if(_0x15f0a8){_0x37f29b=_0x15f0a8[_0x8128('0x23')];if(!_0x540d60['query']['hasOwnProperty'](_0x8128('0x87'))){_0x38a6c3['limit']=qs[_0x8128('0x11')](_0x540d60[_0x8128('0x28')][_0x8128('0x11')]);_0x38a6c3[_0x8128('0xf')]=qs['offset'](_0x540d60['query'][_0x8128('0xf')]);}return _0x1d3f79[_0x8128('0x7c')](_0x38a6c3);}})['then'](function(_0x2e7f5d){if(_0x2e7f5d){return _0x2e7f5d?{'count':_0x37f29b,'rows':_0x2e7f5d}:null;}})[_0x8128('0x17')](respondWithResult(_0x5324bd,null))['catch'](handleError(_0x5324bd,null));};exports[_0x8128('0x88')]=function(_0x82c69d,_0x411c79){if(_0x82c69d[_0x8128('0x33')]['id']){delete _0x82c69d['body']['id'];}return db[_0x8128('0x1f')][_0x8128('0x7d')]({'where':{'id':_0x82c69d[_0x8128('0x21')]['id']}})[_0x8128('0x17')](handleEntityNotFound(_0x411c79,null))['then'](function(_0x9be4a3){if(_0x9be4a3){return _0x9be4a3[_0x8128('0x88')](_0x82c69d['body'][_0x8128('0x89')]||[]);}return null;})[_0x8128('0x17')](respondWithResult(_0x411c79,null))[_0x8128('0x22')](handleError(_0x411c79,null));};exports[_0x8128('0x8a')]=function(_0x295f31,_0x3c5798){var _0x10b234=[];_0x10b234[_0x8128('0x5f')](addAdditionalPhones(_0x295f31['body']));Promise[_0x8128('0x61')](_0x10b234)[_0x8128('0x17')](function(){_0x10b234=[];_0x10b234[_0x8128('0x5f')](deleteCmHopperPhones(_0x295f31[_0x8128('0x33')]['id']));_0x10b234[_0x8128('0x5f')](addCmHopperPhones(_0x295f31[_0x8128('0x33')]['id']));Promise[_0x8128('0x61')](_0x10b234)[_0x8128('0x17')](function(){return[0x1];})[_0x8128('0x17')](respondWithResult(_0x3c5798,null));});};function addAdditionalPhones(_0x306d68){var _0x22694d;return new Promise(function(_0x5d3b8b){return db[_0x8128('0x48')]['destroy']({'where':{'CmContactId':_0x306d68['id']}})[_0x8128('0x17')](function(){db[_0x8128('0x8b')]['findAll']({'raw':!![],'attributes':['id',_0x8128('0x8c')]})[_0x8128('0x17')](function(_0x38f87f){var _0x2affe7=[];for(var _0x4b0415=0x0;_0x4b0415<_0x306d68['items'][_0x8128('0x23')];_0x4b0415++){var _0x46de79=_0x306d68[_0x8128('0x8d')]?_[_0x8128('0x6e')](_0x306d68[_0x8128('0x8d')][_0x4b0415])?'':_0x306d68[_0x8128('0x8d')][_0x4b0415]:_0x306d68[_0x8128('0x8e')][_0x4b0415]['ItemTypeId']?_0x306d68[_0x8128('0x8e')][_0x4b0415]['ItemTypeId']:'';var _0x37b992=_[_0x8128('0x6e')](_0x306d68['items'][_0x4b0415][_0x8128('0x8f')])?'':_0x306d68['items'][_0x4b0415][_0x8128('0x8f')];var _0x4d329d=_0x46de79+':'+_0x306d68[_0x8128('0x8e')][_0x4b0415][_0x8128('0x7a')]+'§'+_0x37b992;if(_[_0x8128('0x6e')](_0x22694d))_0x22694d=_0x4d329d;else _0x22694d+=';'+_0x4d329d;var _0x4af98f=null;var _0x11c2d=null;if(_0x306d68[_0x8128('0x8d')]){if(!_['isNil'](_0x306d68[_0x8128('0x8d')][_0x4b0415])){_0x11c2d=_[_0x8128('0x20')](_0x38f87f,function(_0x1c5b0b){return _0x1c5b0b['id']===_0x306d68['item_types'][_0x4b0415];});if(!_[_0x8128('0x6e')](_0x11c2d)){_0x4af98f=_0x11c2d[_0x8128('0x8c')];}}}else{if(!_[_0x8128('0x6e')](_0x306d68[_0x8128('0x8e')][_0x4b0415])){_0x11c2d=_['find'](_0x38f87f,function(_0x229aea){return _0x229aea['id']===_0x306d68[_0x8128('0x8e')][_0x4b0415][_0x8128('0x90')];});if(!_[_0x8128('0x6e')](_0x11c2d)){_0x4af98f=_0x4b0415;}}}if(_[_0x8128('0x6e')](_0x4af98f)){_0x4af98f=0x64;}_0x2affe7['push'](addAdditionalPhone(_0x306d68['id'],_0x306d68[_0x8128('0x8e')][_0x4b0415][_0x8128('0x7a')],_0x306d68[_0x8128('0x8d')]?_[_0x8128('0x6e')](_0x306d68[_0x8128('0x8d')][_0x4b0415])?null:_0x306d68[_0x8128('0x8d')][_0x4b0415]:_0x306d68['items'][_0x4b0415][_0x8128('0x90')]?_0x306d68[_0x8128('0x8e')][_0x4b0415]['ItemTypeId']:null,_0x4af98f,_0x37b992));}Promise[_0x8128('0x61')](_0x2affe7)['then'](function(){db[_0x8128('0x1f')]['update']({'AdditionalPhones':_0x22694d},{'where':{'id':_0x306d68['id']}})[_0x8128('0x17')](function(){_0x5d3b8b(0x1);});});});});});}function addAdditionalPhone(_0x3d0987,_0x50da5c,_0x469692,_0x34bb9e,_0x3a4992){return db[_0x8128('0x48')][_0x8128('0x20')]({'where':{'CmContactId':_0x3d0987,'item':_0x50da5c}})['then'](function(_0x15c32a){if(_0x15c32a)logger[_0x8128('0x30')]('contact\x20phone\x20exists',_0x15c32a);else{db[_0x8128('0x48')][_0x8128('0x3d')]({'CmContactId':_0x3d0987,'item':_0x50da5c,'ItemTypeId':_0x469692,'OrderBy':_0x34bb9e,'ItemClass':_0x8128('0x91'),'description':_0x3a4992});}});}function deleteCmHopperPhones(_0x197288){return new Promise(function(_0x30b359){return db[_0x8128('0x7b')][_0x8128('0x2b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x197288}})['then'](function(_0x5b4fc1){db[_0x8128('0x92')][_0x8128('0x18')]({'where':{'CmHopperId':{'$in':_[_0x8128('0x70')](_0x5b4fc1,'id')}}});})['then'](function(){_0x30b359(0x1);});});}function addCmHopperPhones(_0x503fe0){return new Promise(function(_0x1091df){return db[_0x8128('0x7b')][_0x8128('0x2b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x503fe0}})[_0x8128('0x17')](function(_0x29907c){var _0x1d7460=[];_[_0x8128('0x70')](_0x29907c,function(_0x462342){_0x1d7460[_0x8128('0x5f')](createCmHopperPhone(_0x503fe0,_0x462342['id']));});Promise['all'](_0x1d7460)[_0x8128('0x17')](function(){_0x1091df(0x1);});});});}function createCmHopperPhone(_0x34d7a5,_0x2e7357){return new Promise(function(_0x2a4f39){db[_0x8128('0x48')][_0x8128('0x2b')]({'raw':!![],'attributes':[_0x8128('0x93'),_0x8128('0x8c')],'where':{'CmContactId':_0x34d7a5,'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'attributes':[_0x8128('0x8c')],'as':_0x8128('0x68')}],'order':[_0x8128('0x8c'),db[_0x8128('0x69')][_0x8128('0x6a')]('`ItemType`.OrderBy')]})[_0x8128('0x17')](function(_0x38b1fd){var _0x1aee2e=0x1;var _0x5c2d05=_[_0x8128('0x70')](_0x38b1fd,function(_0x3df6bd){_0x3df6bd['CmHopperId']=_0x2e7357;_0x3df6bd[_0x8128('0x7a')]=_0x3df6bd[_0x8128('0x93')];_0x3df6bd['OrderBy']=_0x1aee2e;delete _0x3df6bd[_0x8128('0x94')];_0x1aee2e=_0x1aee2e+0x1;return _0x3df6bd;});return db[_0x8128('0x92')]['bulkCreate'](_0x5c2d05,{});})[_0x8128('0x17')](function(){_0x2a4f39(0x1);});});}function insertAdditionalPhones(_0x294a93,_0x3b0e0f){return new Promise(function(_0x11f055){var _0x1eee49=[];for(var _0x37d30f=0x0;_0x37d30f<_0x3b0e0f[_0x8128('0x23')];_0x37d30f++){var _0x14d7c4=_0x3b0e0f[_0x37d30f];_0x1eee49[_0x8128('0x5f')](parseContactItemType(_0x14d7c4));}Promise[_0x8128('0x61')](_0x1eee49)[_0x8128('0x17')](function(){var _0x2fad33={'id':_0x294a93['id'],'items':_0x3b0e0f};return addAdditionalPhones(_0x2fad33)[_0x8128('0x17')](function(){return addCmHopperPhones(_0x294a93['id']);});})[_0x8128('0x17')](function(){_0x11f055(_0x294a93);});});}function parseContactItemType(_0x4b6273){return new Promise(function(_0x12c2f4){if(_0x4b6273[_0x8128('0x5e')](_0x8128('0x90'))){_0x12c2f4(_0x4b6273);}else{return db[_0x8128('0x8b')][_0x8128('0x20')]({'where':{'name':_0x4b6273[_0x8128('0x68')]}})['then'](function(_0x5c2d34){if(_[_0x8128('0x6e')](_0x5c2d34))_0x4b6273['ItemTypeId']=null;else _0x4b6273['ItemTypeId']=_0x5c2d34['id'];_0x12c2f4(_0x4b6273);});}});}exports['getAdditionalPhones']=function(_0x11d68d,_0x59d460){return db[_0x8128('0x48')][_0x8128('0x2b')]({'raw':!![],'where':{'CmContactId':_0x11d68d['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[[_0x8128('0x8c')],[db['sequelize']['literal'](_0x8128('0x95'))]]})[_0x8128('0x17')](function(_0x1f3c1a){return _0x1f3c1a;})['then'](respondWithResult(_0x59d460,null))['catch'](handleError(_0x59d460,null));};exports[_0x8128('0x96')]=function(_0x10259e,_0x18a91e){return db[_0x8128('0x48')]['findAll']({'raw':!![],'where':{'CmContactId':_0x10259e[_0x8128('0x33')]['fromContactId']}})[_0x8128('0x17')](function(_0x3079cf){var _0x9896d1=_[_0x8128('0x70')](_0x3079cf,function(_0xae7f36){_0xae7f36[_0x8128('0x97')]=_0x10259e[_0x8128('0x33')]['toContactId'];return _0xae7f36;});return db[_0x8128('0x48')][_0x8128('0x98')](_0x9896d1,{});})[_0x8128('0x17')](function(){return addCmHopperPhones(_0x10259e[_0x8128('0x33')][_0x8128('0x99')]);})[_0x8128('0x17')](function(){return['ok'];})[_0x8128('0x17')](respondWithResult(_0x18a91e,null))[_0x8128('0x22')](handleError(_0x18a91e,null));};exports['rescheduleAdditionalPhones']=function(_0x1e576b,_0x451505){var _0x1bb708=[];_0x1bb708[_0x8128('0x5f')](createCmHopperPhone(_0x1e576b[_0x8128('0x33')]['id'],_0x1e576b[_0x8128('0x33')][_0x8128('0x9a')]));Promise[_0x8128('0x61')](_0x1bb708)['then'](function(){return[0x1];})['then'](respondWithResult(_0x451505,null));};exports[_0x8128('0x9b')]=function(_0x360f37,_0x1588e4){var _0x2ca5c3={'raw':![],'where':{}};var _0x2ec6bd={};var _0x1632f5={'count':0x0,'rows':[]};return db[_0x8128('0x1f')]['findOne']({'where':{'id':_0x360f37[_0x8128('0x21')]['id']}})[_0x8128('0x17')](handleEntityNotFound(_0x1588e4,null))['then'](function(_0x3a7c20){if(_0x3a7c20){_0x2ec6bd[_0x8128('0x7e')]=_[_0x8128('0x24')](db[_0x8128('0x7b')][_0x8128('0x9c')]);_0x2ec6bd[_0x8128('0x28')]=_[_0x8128('0x24')](_0x360f37[_0x8128('0x28')]);_0x2ec6bd[_0x8128('0x7f')]=_[_0x8128('0x81')](_0x2ec6bd[_0x8128('0x7e')],_0x2ec6bd['query']);_0x2ca5c3['attributes']=_[_0x8128('0x81')](_0x2ec6bd[_0x8128('0x7e')],qs['fields'](_0x360f37[_0x8128('0x28')][_0x8128('0x82')]));_0x2ca5c3['attributes']=_0x2ca5c3['attributes'][_0x8128('0x23')]?_0x2ca5c3[_0x8128('0x80')]:_0x2ec6bd['model'];if(!_0x360f37['query'][_0x8128('0x5e')](_0x8128('0x87'))){_0x2ca5c3[_0x8128('0x11')]=qs[_0x8128('0x11')](_0x360f37['query'][_0x8128('0x11')]);_0x2ca5c3[_0x8128('0xf')]=qs[_0x8128('0xf')](_0x360f37[_0x8128('0x28')][_0x8128('0xf')]);}_0x2ca5c3[_0x8128('0x83')]=qs[_0x8128('0x84')](_0x360f37[_0x8128('0x28')][_0x8128('0x84')]);_0x2ca5c3['where']=qs[_0x8128('0x7f')](_['pick'](_0x360f37[_0x8128('0x28')],_0x2ec6bd[_0x8128('0x7f')]));_0x2ca5c3[_0x8128('0x6c')][_0x8128('0x9d')]=_0x3a7c20['id'];if(_0x360f37[_0x8128('0x28')]['filter']){_0x2ca5c3[_0x8128('0x6c')]=_[_0x8128('0x32')](_0x2ca5c3[_0x8128('0x6c')],{'$or':_[_0x8128('0x70')](_0x2ca5c3[_0x8128('0x80')],function(_0xba5909){var _0x19ba22={};_0x19ba22[_0xba5909]={'$like':'%'+_0x360f37['query']['filter']+'%'};return _0x19ba22;})});}_0x2ca5c3=_[_0x8128('0x32')]({},_0x2ca5c3,_0x360f37[_0x8128('0x86')]);return db['CmHopper'][_0x8128('0x12')]({'where':_0x2ca5c3[_0x8128('0x6c')]})[_0x8128('0x17')](function(_0x3ff690){_0x1632f5['count']=_0x3ff690;if(_0x360f37[_0x8128('0x28')]['includeAll']){_0x2ca5c3[_0x8128('0x9e')]=[{'all':!![]}];}return db[_0x8128('0x7b')][_0x8128('0x2b')](_0x2ca5c3);})[_0x8128('0x17')](function(_0x225f54){_0x1632f5[_0x8128('0x9f')]=_0x225f54;return _0x1632f5;});}})[_0x8128('0x17')](respondWithFilteredResult(_0x1588e4,_0x2ca5c3))[_0x8128('0x22')](handleError(_0x1588e4,null));};exports['getHopperHistories']=function(_0x2b0bba,_0x251f09){var _0x31fe90={'raw':!![],'where':{}};var _0x2c2ca0={};var _0x58a882={'count':0x0,'rows':[]};return db[_0x8128('0x1f')][_0x8128('0x7d')]({'where':{'id':_0x2b0bba[_0x8128('0x21')]['id']}})[_0x8128('0x17')](handleEntityNotFound(_0x251f09,null))['then'](function(_0x2683c9){if(_0x2683c9){_0x2c2ca0[_0x8128('0x7e')]=_[_0x8128('0x24')](db[_0x8128('0x4a')]['rawAttributes']);_0x2c2ca0[_0x8128('0x28')]=_[_0x8128('0x24')](_0x2b0bba['query']);_0x2c2ca0[_0x8128('0x7f')]=_['intersection'](_0x2c2ca0[_0x8128('0x7e')],_0x2c2ca0[_0x8128('0x28')]);_0x31fe90[_0x8128('0x80')]=_[_0x8128('0x81')](_0x2c2ca0[_0x8128('0x7e')],qs[_0x8128('0x82')](_0x2b0bba[_0x8128('0x28')][_0x8128('0x82')]));_0x31fe90[_0x8128('0x80')]=_0x31fe90['attributes']['length']?_0x31fe90[_0x8128('0x80')]:_0x2c2ca0['model'];if(!_0x2b0bba[_0x8128('0x28')]['hasOwnProperty']('nolimit')){_0x31fe90[_0x8128('0x11')]=qs[_0x8128('0x11')](_0x2b0bba['query']['limit']);_0x31fe90[_0x8128('0xf')]=qs[_0x8128('0xf')](_0x2b0bba[_0x8128('0x28')][_0x8128('0xf')]);}_0x31fe90[_0x8128('0x83')]=qs[_0x8128('0x84')](_0x2b0bba[_0x8128('0x28')]['sort']);_0x31fe90['where']=qs['filters'](_[_0x8128('0xa0')](_0x2b0bba[_0x8128('0x28')],_0x2c2ca0[_0x8128('0x7f')]));_0x31fe90[_0x8128('0x6c')]['ContactId']=_0x2683c9['id'];if(_0x2b0bba['query'][_0x8128('0x85')]){_0x31fe90[_0x8128('0x6c')]=_[_0x8128('0x32')](_0x31fe90[_0x8128('0x6c')],{'$or':_[_0x8128('0x70')](_0x31fe90[_0x8128('0x80')],function(_0x321c72){var _0x336191={};_0x336191[_0x321c72]={'$like':'%'+_0x2b0bba['query'][_0x8128('0x85')]+'%'};return _0x336191;})});}_0x31fe90=_['merge']({},_0x31fe90,_0x2b0bba[_0x8128('0x86')]);return db[_0x8128('0x4a')][_0x8128('0x12')]({'where':_0x31fe90[_0x8128('0x6c')]})[_0x8128('0x17')](function(_0x2cdb7e){_0x58a882[_0x8128('0x12')]=_0x2cdb7e;if(_0x2b0bba[_0x8128('0x28')][_0x8128('0xa1')]){_0x31fe90[_0x8128('0x9e')]=[{'all':!![]}];}return db[_0x8128('0x4a')][_0x8128('0x2b')](_0x31fe90);})[_0x8128('0x17')](function(_0x11696f){_0x58a882[_0x8128('0x9f')]=_0x11696f;return _0x58a882;});}})[_0x8128('0x17')](respondWithFilteredResult(_0x251f09,_0x31fe90))[_0x8128('0x22')](handleError(_0x251f09,null));};exports[_0x8128('0xa2')]=function(_0x2dc10a,_0x9dd806){var _0x2c6251={'raw':!![],'where':{}};var _0x35999d={};var _0x38cf14={'count':0x0,'rows':[]};return db['CmContact'][_0x8128('0x7d')]({'where':{'id':_0x2dc10a[_0x8128('0x21')]['id']}})[_0x8128('0x17')](handleEntityNotFound(_0x9dd806,null))['then'](function(_0x373678){if(_0x373678){_0x35999d[_0x8128('0x7e')]=_[_0x8128('0x24')](db[_0x8128('0x49')]['rawAttributes']);_0x35999d[_0x8128('0x28')]=_[_0x8128('0x24')](_0x2dc10a[_0x8128('0x28')]);_0x35999d[_0x8128('0x7f')]=_['intersection'](_0x35999d[_0x8128('0x7e')],_0x35999d[_0x8128('0x28')]);_0x2c6251[_0x8128('0x80')]=_[_0x8128('0x81')](_0x35999d[_0x8128('0x7e')],qs[_0x8128('0x82')](_0x2dc10a['query'][_0x8128('0x82')]));_0x2c6251[_0x8128('0x80')]=_0x2c6251[_0x8128('0x80')][_0x8128('0x23')]?_0x2c6251[_0x8128('0x80')]:_0x35999d[_0x8128('0x7e')];if(!_0x2dc10a['query'][_0x8128('0x5e')]('nolimit')){_0x2c6251[_0x8128('0x11')]=qs['limit'](_0x2dc10a[_0x8128('0x28')]['limit']);_0x2c6251[_0x8128('0xf')]=qs['offset'](_0x2dc10a[_0x8128('0x28')][_0x8128('0xf')]);}_0x2c6251[_0x8128('0x83')]=qs[_0x8128('0x84')](_0x2dc10a[_0x8128('0x28')]['sort']);_0x2c6251['where']=qs[_0x8128('0x7f')](_[_0x8128('0xa0')](_0x2dc10a['query'],_0x35999d[_0x8128('0x7f')]));_0x2c6251[_0x8128('0x6c')][_0x8128('0x9d')]=_0x373678['id'];if(_0x2dc10a['query'][_0x8128('0x85')]){_0x2c6251[_0x8128('0x6c')]=_[_0x8128('0x32')](_0x2c6251[_0x8128('0x6c')],{'$or':_[_0x8128('0x70')](_0x2c6251[_0x8128('0x80')],function(_0x43f7e8){var _0x53e914={};_0x53e914[_0x43f7e8]={'$like':'%'+_0x2dc10a['query']['filter']+'%'};return _0x53e914;})});}_0x2c6251=_[_0x8128('0x32')]({},_0x2c6251,_0x2dc10a[_0x8128('0x86')]);return db['CmHopperFinal']['count']({'where':_0x2c6251[_0x8128('0x6c')]})[_0x8128('0x17')](function(_0x4c77b9){_0x38cf14[_0x8128('0x12')]=_0x4c77b9;if(_0x2dc10a['query'][_0x8128('0xa1')]){_0x2c6251[_0x8128('0x9e')]=[{'all':!![]}];}return db[_0x8128('0x49')]['findAll'](_0x2c6251);})[_0x8128('0x17')](function(_0x46f2e2){_0x38cf14[_0x8128('0x9f')]=_0x46f2e2;return _0x38cf14;});}})[_0x8128('0x17')](respondWithFilteredResult(_0x9dd806,_0x2c6251))['catch'](handleError(_0x9dd806,null));};exports[_0x8128('0xa3')]=function(_0x326195,_0x5befa6){var _0x48e662={'raw':!![],'where':{}};var _0x4f31a4={};var _0x30a3d7={'count':0x0,'rows':[]};return db[_0x8128('0x1f')]['findOne']({'where':{'id':_0x326195[_0x8128('0x21')]['id']}})[_0x8128('0x17')](handleEntityNotFound(_0x5befa6,null))[_0x8128('0x17')](function(_0x48fb7d){if(_0x48fb7d){_0x4f31a4[_0x8128('0x7e')]=_['keys'](db[_0x8128('0x52')][_0x8128('0x9c')]);_0x4f31a4[_0x8128('0x28')]=_['keys'](_0x326195[_0x8128('0x28')]);_0x4f31a4[_0x8128('0x7f')]=_['intersection'](_0x4f31a4[_0x8128('0x7e')],_0x4f31a4[_0x8128('0x28')]);_0x48e662[_0x8128('0x80')]=_[_0x8128('0x81')](_0x4f31a4[_0x8128('0x7e')],qs[_0x8128('0x82')](_0x326195[_0x8128('0x28')][_0x8128('0x82')]));_0x48e662[_0x8128('0x80')]=_0x48e662[_0x8128('0x80')]['length']?_0x48e662[_0x8128('0x80')]:_0x4f31a4[_0x8128('0x7e')];if(!_0x326195[_0x8128('0x28')][_0x8128('0x5e')]('nolimit')){_0x48e662[_0x8128('0x11')]=qs['limit'](_0x326195[_0x8128('0x28')][_0x8128('0x11')]);_0x48e662[_0x8128('0xf')]=qs['offset'](_0x326195[_0x8128('0x28')][_0x8128('0xf')]);}_0x48e662[_0x8128('0x83')]=qs['sort'](_0x326195[_0x8128('0x28')][_0x8128('0x84')]);_0x48e662[_0x8128('0x6c')]=qs[_0x8128('0x7f')](_['pick'](_0x326195[_0x8128('0x28')],_0x4f31a4['filters']));_0x48e662[_0x8128('0x6c')][_0x8128('0x9d')]=_0x48fb7d['id'];if(_0x326195[_0x8128('0x28')][_0x8128('0x85')]){_0x48e662[_0x8128('0x6c')]=_[_0x8128('0x32')](_0x48e662[_0x8128('0x6c')],{'$or':_[_0x8128('0x70')](_0x48e662[_0x8128('0x80')],function(_0x73435d){var _0x5ed6be={};_0x5ed6be[_0x73435d]={'$like':'%'+_0x326195[_0x8128('0x28')][_0x8128('0x85')]+'%'};return _0x5ed6be;})});}_0x48e662=_[_0x8128('0x32')]({},_0x48e662,_0x326195['options']);return db['JscriptySessionReport'][_0x8128('0x12')]({'where':_0x48e662[_0x8128('0x6c')]})[_0x8128('0x17')](function(_0x93a773){_0x30a3d7[_0x8128('0x12')]=_0x93a773;if(_0x326195[_0x8128('0x28')][_0x8128('0xa1')]){_0x48e662['include']=[{'all':!![]}];}return db[_0x8128('0x52')][_0x8128('0x2b')](_0x48e662);})[_0x8128('0x17')](function(_0x29b145){_0x30a3d7[_0x8128('0x9f')]=_0x29b145;return _0x30a3d7;});}})[_0x8128('0x17')](respondWithFilteredResult(_0x5befa6,_0x48e662))[_0x8128('0x22')](handleError(_0x5befa6,null));};exports[_0x8128('0xa4')]=function(_0x2c812d,_0x20025a){try{if(!_0x2c812d[_0x8128('0x33')]['ListId']){throw new Error(_0x8128('0xa5'));}if(!_0x2c812d['body'][_0x8128('0xa6')]){throw new Error(_0x8128('0xa7'));}if(!_0x2c812d['body'][_0x8128('0xa8')]){throw new Error(_0x8128('0xa9'));}if(!_0x2c812d[_0x8128('0x33')][_0x8128('0xaa')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x36b452=_0x2c812d[_0x8128('0x33')][_0x8128('0xa6')]['split'](',');var _0x265901=_0x2c812d[_0x8128('0x33')][_0x8128('0xa8')]['split'](',');if(!_0x36b452['length']||!_0x265901[_0x8128('0x23')]||_0x36b452['length']!==_0x265901[_0x8128('0x23')]){throw new Error(_0x8128('0xab'));}_0x2c812d[_0x8128('0x33')]['fields']=_[_0x8128('0xac')](_0x36b452,_0x265901);if(!_0x2c812d[_0x8128('0x33')][_0x8128('0x82')][_0x8128('0x7a')]){throw new Error(_0x8128('0xad'));}if(!_0x2c812d[_0x8128('0x33')]['fields'][_0x8128('0xae')]){throw new Error(_0x8128('0xaf'));}var _0x2e8062=path[_0x8128('0x38')](config[_0x8128('0xb0')],'server/files/tmp',_0x2c812d[_0x8128('0xb1')][_0x8128('0xb2')]);fs[_0x8128('0xb3')](_0x2e8062,parseInt(_0x8128('0xb4'),0x8));var _0x50f77a=require(_0x8128('0xb5'))['fork'](path[_0x8128('0x38')](__dirname,_0x8128('0xb6')),[_0x2e8062,_0x2c812d[_0x8128('0x33')][_0x8128('0xa6')],_0x2c812d[_0x8128('0x33')][_0x8128('0xa8')],_0x2c812d[_0x8128('0x33')][_0x8128('0x5b')],_0x2c812d[_0x8128('0x33')]['CompanyId'],_0x2c812d[_0x8128('0x33')]['duplicates'],_0x2c812d['body'][_0x8128('0xaa')]]);return _0x20025a[_0x8128('0xe')](0xc8)[_0x8128('0x15')]({'message':_0x8128('0xb7'),'pid':_0x50f77a[_0x8128('0xb8')]});}catch(_0x559fa4){return _0x20025a[_0x8128('0xe')](0x1f4)[_0x8128('0xb9')](_0x559fa4);}};exports['upload']=function(_0x58a504,_0x4aaa12){var _0x161659=fs[_0x8128('0xba')](_0x58a504[_0x8128('0xb1')][_0x8128('0xbb')]);Papa['parse'](_0x161659,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x433cde){return _0x4aaa12[_0x8128('0xe')](0xc8)['json']({'file':_0x58a504[_0x8128('0xb1')],'fields':_0x433cde[_0x8128('0xbc')][_0x8128('0x82')]});}});};exports[_0x8128('0xbd')]=function(_0x3d2d7f,_0x1e4514){return db['User'][_0x8128('0x2b')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8128('0xbe')}})[_0x8128('0x17')](function(_0x31d343){var _0x35620d=![];if(!_0x3d2d7f[_0x8128('0x33')]['ListId']){throw new Error(_0x8128('0xa5'));}if(!_0x3d2d7f[_0x8128('0x33')][_0x8128('0xbf')][_0x8128('0x7a')]){throw new Error(_0x8128('0xad'));}if(!_0x3d2d7f[_0x8128('0x33')][_0x8128('0xbf')][_0x8128('0xae')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x3d2d7f['body'][_0x8128('0xaa')]){throw new Error(_0x8128('0xc0'));}var _0x2618a7=require('child_process')['fork'](path[_0x8128('0x38')](__dirname,_0x8128('0xc1')),[_0x3d2d7f[_0x8128('0x21')]['id'],JSON[_0x8128('0xc2')](_0x3d2d7f[_0x8128('0x33')]),JSON[_0x8128('0xc2')](_0x31d343)]);_0x2618a7['on']('message',function(){_0x35620d=!![];return _0x1e4514[_0x8128('0xe')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x2618a7['pid']});});_0x2618a7['on'](_0x8128('0xc3'),function(_0x4d1e61){if(_0x4d1e61&&!_0x35620d){return _0x1e4514[_0x8128('0xe')](0x1f4)[_0x8128('0x15')]({'message':_0x8128('0xc4'),'pid':_0x2618a7['pid']});}});})[_0x8128('0x22')](handleError(_0x1e4514,null));};exports[_0x8128('0xc5')]=function(_0x87de72,_0x4c852d){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x8128('0xbe')}})[_0x8128('0x17')](function(_0x29ac06){var _0x4016fc=![];if(!_0x87de72[_0x8128('0x33')]['ListId']){throw new Error(_0x8128('0xa5'));}if(!_0x87de72['body'][_0x8128('0xbf')][_0x8128('0x7a')]){throw new Error(_0x8128('0xad'));}if(!_0x87de72[_0x8128('0x33')]['binding'][_0x8128('0xae')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x87de72[_0x8128('0x33')][_0x8128('0xaa')]){throw new Error(_0x8128('0xc0'));}var _0x143af4=require('child_process')[_0x8128('0xc6')](path[_0x8128('0x38')](__dirname,_0x8128('0xc7')),[_0x87de72[_0x8128('0x21')]['id'],JSON[_0x8128('0xc2')](_0x87de72[_0x8128('0x33')]),JSON[_0x8128('0xc2')](_0x29ac06)]);_0x143af4['on'](_0x8128('0xc8'),function(){_0x4016fc=!![];return _0x4c852d[_0x8128('0xe')](0xc8)[_0x8128('0x15')]({'message':_0x8128('0xc9'),'pid':_0x143af4['pid']});});_0x143af4['on'](_0x8128('0xc3'),function(_0xc97b9){if(_0xc97b9&&!_0x4016fc){return _0x4c852d[_0x8128('0xe')](0x1f4)[_0x8128('0x15')]({'message':'error\x20child\x20process','pid':_0x143af4['pid']});}});})[_0x8128('0x22')](handleError(_0x4c852d,null));};exports[_0x8128('0xca')]=function(_0x30328d,_0x2f5db5){var _0x298778=[_0x8128('0xcb'),_0x8128('0xcc'),_0x8128('0xcd'),'openchannel',_0x8128('0xce'),'whatsapp',_0x8128('0xcf')];var _0x45138a={'offset':0x0,'order':qs[_0x8128('0x84')]('-createdAt')},_0x5e080b={'count':0x0,'rows':[]};Promise[_0x8128('0xd0')]()[_0x8128('0x17')](function(){if(_0x30328d[_0x8128('0x28')][_0x8128('0xd1')]){if(!_[_0x8128('0xd2')](_0x298778,_0x30328d[_0x8128('0x28')][_0x8128('0xd1')][_0x8128('0xd3')]())){throw new Error('Invalid\x20channel');}_0x298778=[_0x30328d['query']['channel'][_0x8128('0xd3')]()];}if(_0x30328d[_0x8128('0x28')][_0x8128('0xd4')]){try{var _0xd19217=JSON['parse'](_0x30328d[_0x8128('0x28')]['range']);if(!moment(_0xd19217[_0x8128('0x3a')])[_0x8128('0xd5')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0xd19217['to'])[_0x8128('0xd5')]()){throw new Error(_0x8128('0xd6'));}}catch(_0x4d5ec5){throw new Error(_0x8128('0xd7'));}}if(!_0x30328d[_0x8128('0x28')][_0x8128('0x5e')](_0x8128('0x87'))){_0x45138a[_0x8128('0x11')]=qs['limit'](_0x30328d[_0x8128('0x28')][_0x8128('0x11')]||0xa);_0x45138a[_0x8128('0xf')]=qs[_0x8128('0xf')](_0x30328d[_0x8128('0x28')][_0x8128('0xf')]);}var _0x432897=_0x298778[_0x8128('0x70')](function(_0x3ee4e3){if(_0x3ee4e3===_0x8128('0xcf')){var _0x3d8ac6={'attributes':['id',_0x8128('0xd8'),'type','source','destination',_0x8128('0xd9'),_0x8128('0xda'),'endtime',_0x8128('0xdb'),_0x8128('0xdc'),'createdAt','userDisposition',_0x8128('0xdd'),'userThirdDisposition',_0x8128('0xde')],'where':{'ContactId':_0x30328d['params']['id']},'include':[{'model':db['User'],'as':_0x8128('0xdf'),'attributes':['id',_0x8128('0x1b'),'fullname',_0x8128('0x2d')]}],'order':[[_0x8128('0xe0'),'DESC']]};if(_0x30328d[_0x8128('0x28')][_0x8128('0xd4')]){_0x3d8ac6['where'][_0x8128('0xe0')]={'$gte':_0xd19217[_0x8128('0x3a')],'$lte':_0xd19217['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x3d8ac6)[_0x8128('0x17')](function(_0x4293fa){_0x5e080b[_0x8128('0x12')]+=_0x4293fa[_0x8128('0x12')];return _[_0x8128('0x70')](_0x4293fa[_0x8128('0x9f')],function(_0x10f7b4){var _0x3849ce=_0x10f7b4['get']({'plain':!![]});_0x3849ce[_0x8128('0xd1')]=_0x3ee4e3;if(_0x3849ce[_0x8128('0xdf')]){_0x3849ce[_0x8128('0xdf')]={'id':_0x3849ce['User']['id'],'name':_0x3849ce[_0x8128('0xdf')]['name'],'fullname':_0x3849ce[_0x8128('0xdf')]['fullname'],'alias':_0x3849ce[_0x8128('0xdf')]['alias']};}return _0x3849ce;});});}else{var _0x3dd836=_[_0x8128('0xe1')](_0x3ee4e3)+(_0x3ee4e3===_0x8128('0xcc')?_0x8128('0xe2'):_0x8128('0xe3'));var _0x2073d4={'attributes':['id','closed','closedAt','createdAt',_0x8128('0xdc'),_0x8128('0xe4'),_0x8128('0xe5'),_0x8128('0xe6'),_0x8128('0xde'),_0x3dd836+'Id'],'where':{'ContactId':_0x30328d[_0x8128('0x21')]['id']},'include':[{'model':db[_0x3dd836],'as':_0x8128('0xe3'),'attributes':['id',_0x8128('0x1b'),_0x8128('0xe7')]},{'model':db['User'],'as':_0x8128('0xe8'),'attributes':['id',_0x8128('0x1b'),_0x8128('0xe9')]},{'model':db[_0x8128('0x63')],'as':_0x8128('0x64'),'attributes':['id',_0x8128('0x1b'),_0x8128('0x65')],'through':{'attributes':[]}}],'order':[['createdAt',_0x8128('0xea')]]};if(_0x30328d['query'][_0x8128('0xd4')]){_0x2073d4[_0x8128('0x6c')][_0x8128('0xe0')]={'$gte':_0xd19217[_0x8128('0x3a')],'$lte':_0xd19217['to']};}switch(_0x3ee4e3){case _0x8128('0xcc'):_0x2073d4['attributes'][_0x8128('0x5f')](_0x8128('0xeb'),_0x8128('0xec'),_0x8128('0xed'),'deviceModel','osName',_0x8128('0xee'),_0x8128('0xef'),_0x8128('0xf0'),'referer');break;case _0x8128('0xcb'):_0x2073d4['attributes'][_0x8128('0x5f')](_0x8128('0xf1'),_0x8128('0xf2'));break;case _0x8128('0xf3'):_0x2073d4['attributes']['push'](_0x8128('0xf4'),_0x8128('0xf5'));break;}return db[_[_0x8128('0xe1')](_0x3ee4e3)+'Interaction'][_0x8128('0xf6')](_0x2073d4)[_0x8128('0x17')](function(_0x348317){_0x5e080b['count']+=_0x348317[_0x8128('0x12')];return _[_0x8128('0x70')](_0x348317['rows'],function(_0x42652a){var _0x329462=_0x42652a[_0x8128('0x34')]({'plain':!![]});_0x329462['channel']=_0x3ee4e3;if(_0x329462['Owner']){_0x329462[_0x8128('0xe8')]={'id':_0x329462[_0x8128('0xe8')]['id'],'name':_0x329462['Owner']['name'],'fullname':_0x329462[_0x8128('0xe8')][_0x8128('0xe9')]};}return _0x329462;});});}});return Promise[_0x8128('0x61')](_0x432897);})[_0x8128('0x17')](function(_0x196fa3){return _(_0x196fa3)['flatten']()[_0x8128('0xf7')](_0x8128('0xe0'))[_0x8128('0xf8')]()[_0x8128('0xf9')]();})[_0x8128('0x17')](function(_0x8d4cb0){_0x5e080b['rows']=_0x45138a['limit']?_0x8d4cb0[_0x8128('0xfa')](_0x45138a['offset'],_0x45138a[_0x8128('0xf')]+_0x45138a[_0x8128('0x11')]):_0x8d4cb0;return _0x5e080b;})[_0x8128('0x17')](respondWithFilteredResult(_0x2f5db5,_0x45138a))[_0x8128('0x22')](handleError(_0x2f5db5,null));}; \ No newline at end of file +var _0x3304=['chmodSync','0777','CompanyId','File\x20uploaded\x20correctly!','pid','parse','meta','import','agent','binding','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','No\x20phone\x20column\x20specified','../../components/import/cm/csvUpdates','getJourney','mail','chat','openchannel','fax','whatsapp','voice','resolve','channel','includes','toLowerCase','range','isValid','source','destination','callerid','starttime','endtime','duration','note','userThirdDisposition','UserId','createdAt','DESC','VoiceCallReport','findAndCountAll','fullname','startCase','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Tags','browserName','customerIp','customerPort','osName','ratingType','ratingValue','subject','substatus','threadId','Interaction','Owner','flatten','reverse','value','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','defaults','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','error','stack','name','send','index','then','getOptions','query','catch','CmContact','find','params','describe','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','findAll','length','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','additionalPhones','duplicates','$or','ListId','findOrCreate','spread','push','contact','all','show','Tag','color','tag','Phones','Phones.OrderBy','where','$and','omit','map','format','cf_%d','utcOffset','pickBy','table','setFields','id\x20=\x20?','toParam','text','phone','findOne','model','rawAttributes','filters','attributes','fields','sort','pick','options','getTags','nolimit','setTags','ids','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','literal','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','bulkCreate','sequelize','duplicateAdditionalPhones','toContactId','hopperId','getHoppers','intersection','order','ContactId','filter','rows','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','root','file','filename'];(function(_0x5dc6e8,_0x1ed7cc){var _0x2cb306=function(_0xae157e){while(--_0xae157e){_0x5dc6e8['push'](_0x5dc6e8['shift']());}};_0x2cb306(++_0x1ed7cc);}(_0x3304,0x143));var _0x4330=function(_0x320cdc,_0x356339){_0x320cdc=_0x320cdc-0x0;var _0xc6d765=_0x3304[_0x320cdc];return _0xc6d765;};'use strict';var moment=require(_0x4330('0x0'));var BPromise=require(_0x4330('0x1'));var util=require(_0x4330('0x2'));var path=require(_0x4330('0x3'));var fs=require('fs');var _=require(_0x4330('0x4'));var squel=require(_0x4330('0x5'));var Papa=require(_0x4330('0x6'));var Redis=require(_0x4330('0x7'));var contacts=require(_0x4330('0x8'));var qs=require(_0x4330('0x9'));var logger=require(_0x4330('0xa'))(_0x4330('0xb'));var config=require('../../config/environment');var shared=require(_0x4330('0xc'));var db=require(_0x4330('0xd'))['db'];config[_0x4330('0xe')]=_[_0x4330('0xf')](config[_0x4330('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4330('0x10'))[_0x4330('0x11')](socket);function respondWithResult(_0x73142a,_0x262485){_0x262485=_0x262485||0xc8;return function(_0x2f0d93){if(_0x2f0d93){return _0x73142a[_0x4330('0x12')](_0x262485)[_0x4330('0x13')](_0x2f0d93);}};}function respondWithFilteredResult(_0x2ae6d8,_0x2f9013){return function(_0x57cdb3){if(_0x57cdb3){var _0x33300b=typeof _0x2f9013[_0x4330('0x14')]===_0x4330('0x15')&&typeof _0x2f9013[_0x4330('0x16')]===_0x4330('0x15');var _0x1d233c=_0x57cdb3[_0x4330('0x17')];var _0x367bd5=_0x33300b?0x0:_0x2f9013[_0x4330('0x14')];var _0x151a7d=_0x33300b?_0x57cdb3['count']:_0x2f9013[_0x4330('0x14')]+_0x2f9013[_0x4330('0x16')];var _0x2d87f6;if(_0x151a7d>=_0x1d233c){_0x151a7d=_0x1d233c;_0x2d87f6=0xc8;}else{_0x2d87f6=0xce;}_0x2ae6d8[_0x4330('0x12')](_0x2d87f6);return _0x2ae6d8[_0x4330('0x18')](_0x4330('0x19'),_0x367bd5+'-'+_0x151a7d+'/'+_0x1d233c)[_0x4330('0x13')](_0x57cdb3);}return null;};}function saveUpdates(_0x82e88b){return function(_0x5f403a){if(_0x5f403a){return _0x5f403a[_0x4330('0x1a')](_0x82e88b)['then'](function(_0x28ac93){return _0x28ac93;});}return null;};}function removeEntity(_0xc2bde){return function(_0x52ad17){if(_0x52ad17){return _0x52ad17[_0x4330('0x1b')]()['then'](function(){_0xc2bde[_0x4330('0x12')](0xcc)[_0x4330('0x1c')]();});}};}function handleEntityNotFound(_0xe20872){return function(_0x57f816){if(!_0x57f816){_0xe20872['sendStatus'](0x194);}return _0x57f816;};}function handleError(_0x41959e,_0x1cfb4a){_0x1cfb4a=_0x1cfb4a||0x1f4;return function(_0x13c41b){logger[_0x4330('0x1d')](_0x13c41b[_0x4330('0x1e')]);if(_0x13c41b[_0x4330('0x1f')]){delete _0x13c41b['name'];}_0x41959e[_0x4330('0x12')](_0x1cfb4a)[_0x4330('0x20')](_0x13c41b);};}exports[_0x4330('0x21')]=function(_0x3fc959,_0x1ef49b){var _0x4ed7bc={};return contacts['describe']()[_0x4330('0x22')](function(_0xc4df78){_0x4ed7bc=qs[_0x4330('0x23')](_0xc4df78,_0x3fc959);return contacts['findAll'](_0x3fc959[_0x4330('0x24')],_0x3fc959['user'],_0x4ed7bc,_0xc4df78);})[_0x4330('0x22')](respondWithFilteredResult(_0x1ef49b,_0x4ed7bc))[_0x4330('0x25')](handleError(_0x1ef49b,null));};exports[_0x4330('0x1b')]=function(_0x2e9618,_0x4704eb){return db[_0x4330('0x26')][_0x4330('0x27')]({'where':{'id':_0x2e9618[_0x4330('0x28')]['id']}})[_0x4330('0x22')](handleEntityNotFound(_0x4704eb,null))[_0x4330('0x22')](removeEntity(_0x4704eb,null))[_0x4330('0x25')](handleError(_0x4704eb,null));};exports[_0x4330('0x29')]=function(_0x57ba07,_0x30c9a4){return db[_0x4330('0x26')][_0x4330('0x29')]()['then'](function(_0x79a495){delete _0x79a495[_0x4330('0x2a')];for(var _0x19cc0e=0x0;_0x19cc0e0x0){return new Promise(function(_0x27ba53){var _0x3ed0c8=[];for(var _0x42d710=0x0;_0x42d710<_0x317ac8[_0x4330('0x32')];_0x42d710++){_0x3ed0c8[_0x4330('0x62')](insertAdditionalPhones(_0x317ac8[_0x42d710][_0x4330('0x63')],_0x317ac8[_0x42d710]['additionalPhones']));}Promise[_0x4330('0x64')](_0x3ed0c8)[_0x4330('0x22')](function(){_0x27ba53(0x1);});})['then'](function(){return{'success':_0x9b3ecd,'failure':_0x397cef,'duplicates':_0x38f37c};});}else{return{'success':_0x9b3ecd,'failure':_0x397cef,'duplicates':_0x38f37c};}}})[_0x4330('0x22')](respondWithResult(_0x77d34,0xc9))[_0x4330('0x25')](handleError(_0x77d34,null));};exports[_0x4330('0x65')]=function(_0x517998,_0xd046a7){var _0x5cc192;return db['CmContact'][_0x4330('0x29')]()['then'](function(_0x27142e){return db[_0x4330('0x26')][_0x4330('0x27')]({'where':{'id':_0x517998[_0x4330('0x28')]['id']},'include':[{'model':db[_0x4330('0x66')],'as':'Tags','attributes':['id',_0x4330('0x1f'),_0x4330('0x67')],'required':_0x517998[_0x4330('0x24')][_0x4330('0x68')]?!![]:![]},{'model':db[_0x4330('0x4e')],'as':_0x4330('0x69'),'where':{'CmContactId':_0x517998['params']['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':'ItemType'}]}],'order':[db['sequelize']['literal'](_0x4330('0x6a'))],'attributes':_[_0x4330('0x2b')](_0x27142e)});})[_0x4330('0x22')](function(_0x59baa5){if(!_[_0x4330('0x59')](_0x59baa5)){_0x5cc192=_0x59baa5[_0x4330('0x3d')]({'plain':!![]});var _0x46a2bb={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x59baa5&&_0x59baa5[_0x4330('0x5f')]){if(_0x59baa5[_0x4330('0x5f')]){_0x46a2bb[_0x4330('0x6b')][_0x4330('0x6c')][_0x4330('0x62')]({'ListId':{'$ne':_0x59baa5['ListId']}});}}return db[_0x4330('0x30')]['findAll'](_0x46a2bb);}})[_0x4330('0x22')](function(_0x1ddc8a){if(!_[_0x4330('0x59')](_0x1ddc8a)){return _[_0x4330('0x6d')](_0x5cc192,_[_0x4330('0x6e')](_0x1ddc8a,function(_0x4e68a4){return util[_0x4330('0x6f')](_0x4330('0x70'),_0x4e68a4['id']);}));}})[_0x4330('0x22')](handleEntityNotFound(_0xd046a7,null))[_0x4330('0x22')](respondWithResult(_0xd046a7,null))[_0x4330('0x25')](handleError(_0xd046a7,null));};exports[_0x4330('0x1a')]=function(_0x31de2e,_0x2ba413){var _0x1236f9;if(_0x31de2e[_0x4330('0x3b')]['id']){delete _0x31de2e['body']['id'];}if(!_[_0x4330('0x59')](_0x31de2e[_0x4330('0x3b')][_0x4330('0x5a')])){var _0x3ac750=_0x31de2e['body'][_0x4330('0x5a')];if(!_[_0x4330('0x59')](shared[_0x4330('0x5b')][_0x3ac750]))_0x31de2e[_0x4330('0x3b')][_0x4330('0x71')]=shared[_0x4330('0x5b')][_0x3ac750]['utcOffset'];}return db[_0x4330('0x26')][_0x4330('0x27')]({'where':{'id':_0x31de2e[_0x4330('0x28')]['id']}})[_0x4330('0x22')](handleEntityNotFound(_0x2ba413,null))['then'](saveUpdates(_0x31de2e[_0x4330('0x3b')],null))['then'](function(_0x47f587){_0x1236f9=_0x47f587;var _0x32fc9a={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x47f587&&_0x47f587[_0x4330('0x5f')]){if(_0x47f587['ListId']){_0x32fc9a[_0x4330('0x6b')][_0x4330('0x6c')]['push']({'ListId':{'$ne':_0x47f587[_0x4330('0x5f')]}});}}return db[_0x4330('0x30')][_0x4330('0x31')](_0x32fc9a);})[_0x4330('0x22')](function(_0x458c2e){if(_0x458c2e){return _[_0x4330('0x6d')](_[_0x4330('0x72')](_0x31de2e[_0x4330('0x3b')],function(_0x17a37a,_0x355b58){return _['startsWith'](_0x355b58,'cf_');}),_['map'](_0x458c2e,function(_0x5c6951){return util[_0x4330('0x6f')]('cf_%d',_0x5c6951['id']);}));}})[_0x4330('0x22')](function(_0x3860a5){if(_0x3860a5&&!_['isEmpty'](_0x3860a5)){var _0x136dc3=squel[_0x4330('0x1a')]()[_0x4330('0x73')]('cm_contacts')[_0x4330('0x74')](_0x3860a5)[_0x4330('0x6b')](_0x4330('0x75'),_0x31de2e[_0x4330('0x28')]['id'])[_0x4330('0x76')]();return db['sequelize'][_0x4330('0x24')](_0x136dc3[_0x4330('0x77')],{'replacements':_0x136dc3[_0x4330('0x35')]});}})[_0x4330('0x22')](function(){if(_0x31de2e[_0x4330('0x3b')]['phone']&&_0x1236f9){return db[_0x4330('0x42')][_0x4330('0x1a')]({'phone':_0x31de2e['body'][_0x4330('0x78')],'OrderBy':0x0},{'where':{'ContactId':_0x1236f9['id']}});}})['then'](function(){return _0x1236f9;})['then'](respondWithResult(_0x2ba413,null))[_0x4330('0x25')](handleError(_0x2ba413,null));};exports['getTags']=function(_0x1554c3,_0x2ae3f8){var _0x2cf3a7={};var _0x4eaa84={};var _0x1dae6f;var _0x4f9ae9;return db[_0x4330('0x26')][_0x4330('0x79')]({'where':{'id':_0x1554c3[_0x4330('0x28')]['id']}})[_0x4330('0x22')](handleEntityNotFound(_0x2ae3f8,null))[_0x4330('0x22')](function(_0x5f57c6){if(_0x5f57c6){_0x1dae6f=_0x5f57c6;_0x4eaa84[_0x4330('0x7a')]=_[_0x4330('0x2b')](db[_0x4330('0x66')][_0x4330('0x7b')]);_0x4eaa84[_0x4330('0x24')]=_[_0x4330('0x2b')](_0x1554c3[_0x4330('0x24')]);_0x4eaa84[_0x4330('0x7c')]=_['intersection'](_0x4eaa84[_0x4330('0x7a')],_0x4eaa84[_0x4330('0x24')]);_0x2cf3a7[_0x4330('0x7d')]=_['intersection'](_0x4eaa84['model'],qs[_0x4330('0x7e')](_0x1554c3[_0x4330('0x24')]['fields']));_0x2cf3a7['attributes']=_0x2cf3a7['attributes']['length']?_0x2cf3a7['attributes']:_0x4eaa84[_0x4330('0x7a')];_0x2cf3a7['order']=qs['sort'](_0x1554c3[_0x4330('0x24')][_0x4330('0x7f')]);_0x2cf3a7[_0x4330('0x6b')]=qs[_0x4330('0x7c')](_[_0x4330('0x80')](_0x1554c3[_0x4330('0x24')],_0x4eaa84[_0x4330('0x7c')]));if(_0x1554c3[_0x4330('0x24')]['filter']){_0x2cf3a7[_0x4330('0x6b')]=_[_0x4330('0x3a')](_0x2cf3a7[_0x4330('0x6b')],{'$or':_[_0x4330('0x6e')](_0x2cf3a7[_0x4330('0x7d')],function(_0x3977df){var _0x422dda={};_0x422dda[_0x3977df]={'$like':'%'+_0x1554c3[_0x4330('0x24')]['filter']+'%'};return _0x422dda;})});}_0x2cf3a7=_[_0x4330('0x3a')]({},_0x2cf3a7,_0x1554c3[_0x4330('0x81')]);return _0x1dae6f[_0x4330('0x82')](_0x2cf3a7);}})[_0x4330('0x22')](function(_0x4e4038){if(_0x4e4038){_0x4f9ae9=_0x4e4038[_0x4330('0x32')];if(!_0x1554c3[_0x4330('0x24')][_0x4330('0x39')](_0x4330('0x83'))){_0x2cf3a7['limit']=qs[_0x4330('0x16')](_0x1554c3['query'][_0x4330('0x16')]);_0x2cf3a7['offset']=qs['offset'](_0x1554c3[_0x4330('0x24')]['offset']);}return _0x1dae6f[_0x4330('0x82')](_0x2cf3a7);}})[_0x4330('0x22')](function(_0x30ee61){if(_0x30ee61){return _0x30ee61?{'count':_0x4f9ae9,'rows':_0x30ee61}:null;}})[_0x4330('0x22')](respondWithResult(_0x2ae3f8,null))['catch'](handleError(_0x2ae3f8,null));};exports[_0x4330('0x84')]=function(_0x41122a,_0x5d72e2){if(_0x41122a[_0x4330('0x3b')]['id']){delete _0x41122a['body']['id'];}return db[_0x4330('0x26')]['findOne']({'where':{'id':_0x41122a[_0x4330('0x28')]['id']}})[_0x4330('0x22')](handleEntityNotFound(_0x5d72e2,null))[_0x4330('0x22')](function(_0x288a61){if(_0x288a61){return _0x288a61[_0x4330('0x84')](_0x41122a[_0x4330('0x3b')][_0x4330('0x85')]||[]);}return null;})[_0x4330('0x22')](respondWithResult(_0x5d72e2,null))[_0x4330('0x25')](handleError(_0x5d72e2,null));};exports['setAdditionalPhones']=function(_0x28e330,_0x5a976a){var _0xe52e01=[];_0xe52e01[_0x4330('0x62')](addAdditionalPhones(_0x28e330[_0x4330('0x3b')]));Promise['all'](_0xe52e01)['then'](function(){_0xe52e01=[];_0xe52e01[_0x4330('0x62')](deleteCmHopperPhones(_0x28e330['body']['id']));_0xe52e01[_0x4330('0x62')](addCmHopperPhones(_0x28e330[_0x4330('0x3b')]['id']));Promise[_0x4330('0x64')](_0xe52e01)['then'](function(){return[0x1];})[_0x4330('0x22')](respondWithResult(_0x5a976a,null));});};function addAdditionalPhones(_0x154286){var _0x56a37f;return new Promise(function(_0x54a7b2){return db['CmContactHasItem'][_0x4330('0x1b')]({'where':{'CmContactId':_0x154286['id']}})[_0x4330('0x22')](function(){db[_0x4330('0x86')][_0x4330('0x31')]({'raw':!![],'attributes':['id',_0x4330('0x87')]})[_0x4330('0x22')](function(_0x3084bd){var _0x184498=[];for(var _0x5646ec=0x0;_0x5646ec<_0x154286[_0x4330('0x88')]['length'];_0x5646ec++){var _0x3f59f7=_0x154286[_0x4330('0x89')]?_[_0x4330('0x59')](_0x154286['item_types'][_0x5646ec])?'':_0x154286[_0x4330('0x89')][_0x5646ec]:_0x154286[_0x4330('0x88')][_0x5646ec][_0x4330('0x8a')]?_0x154286['items'][_0x5646ec][_0x4330('0x8a')]:'';var _0x42eee9=_[_0x4330('0x59')](_0x154286['items'][_0x5646ec][_0x4330('0x8b')])?'':_0x154286[_0x4330('0x88')][_0x5646ec][_0x4330('0x8b')];var _0x5b37f5=_0x3f59f7+':'+_0x154286[_0x4330('0x88')][_0x5646ec][_0x4330('0x78')]+'§'+_0x42eee9;if(_[_0x4330('0x59')](_0x56a37f))_0x56a37f=_0x5b37f5;else _0x56a37f+=';'+_0x5b37f5;var _0x41c907=null;var _0x3a5bc2=null;if(_0x154286['item_types']){if(!_[_0x4330('0x59')](_0x154286[_0x4330('0x89')][_0x5646ec])){_0x3a5bc2=_[_0x4330('0x27')](_0x3084bd,function(_0x4c180f){return _0x4c180f['id']===_0x154286[_0x4330('0x89')][_0x5646ec];});if(!_[_0x4330('0x59')](_0x3a5bc2)){_0x41c907=_0x3a5bc2[_0x4330('0x87')];}}}else{if(!_[_0x4330('0x59')](_0x154286['items'][_0x5646ec])){_0x3a5bc2=_[_0x4330('0x27')](_0x3084bd,function(_0x3bbfc9){return _0x3bbfc9['id']===_0x154286['items'][_0x5646ec][_0x4330('0x8a')];});if(!_[_0x4330('0x59')](_0x3a5bc2)){_0x41c907=_0x5646ec;}}}if(_[_0x4330('0x59')](_0x41c907)){_0x41c907=0x64;}_0x184498['push'](addAdditionalPhone(_0x154286['id'],_0x154286[_0x4330('0x88')][_0x5646ec][_0x4330('0x78')],_0x154286[_0x4330('0x89')]?_[_0x4330('0x59')](_0x154286['item_types'][_0x5646ec])?null:_0x154286['item_types'][_0x5646ec]:_0x154286['items'][_0x5646ec][_0x4330('0x8a')]?_0x154286['items'][_0x5646ec][_0x4330('0x8a')]:null,_0x41c907,_0x42eee9));}Promise[_0x4330('0x64')](_0x184498)[_0x4330('0x22')](function(){db[_0x4330('0x26')][_0x4330('0x1a')]({'AdditionalPhones':_0x56a37f},{'where':{'id':_0x154286['id']}})[_0x4330('0x22')](function(){_0x54a7b2(0x1);});});});});});}function addAdditionalPhone(_0x4de287,_0x2c1085,_0x39c2e7,_0x5de527,_0x5603f6){return db[_0x4330('0x4e')][_0x4330('0x27')]({'where':{'CmContactId':_0x4de287,'item':_0x2c1085}})[_0x4330('0x22')](function(_0x18095b){if(_0x18095b)logger[_0x4330('0x36')](_0x4330('0x8c'),_0x18095b);else{db['CmContactHasItem']['create']({'CmContactId':_0x4de287,'item':_0x2c1085,'ItemTypeId':_0x39c2e7,'OrderBy':_0x5de527,'ItemClass':_0x4330('0x8d'),'description':_0x5603f6});}});}function deleteCmHopperPhones(_0x50b3b8){return new Promise(function(_0x3813ab){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x50b3b8}})[_0x4330('0x22')](function(_0x42ed81){db[_0x4330('0x8e')][_0x4330('0x1b')]({'where':{'CmHopperId':{'$in':_[_0x4330('0x6e')](_0x42ed81,'id')}}});})[_0x4330('0x22')](function(){_0x3813ab(0x1);});});}function addCmHopperPhones(_0x4f3393){return new Promise(function(_0x1d0cc2){return db[_0x4330('0x42')][_0x4330('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4f3393}})[_0x4330('0x22')](function(_0x2e9599){var _0x5c2976=[];_[_0x4330('0x6e')](_0x2e9599,function(_0x559e87){_0x5c2976[_0x4330('0x62')](createCmHopperPhone(_0x4f3393,_0x559e87['id']));});Promise[_0x4330('0x64')](_0x5c2976)[_0x4330('0x22')](function(){_0x1d0cc2(0x1);});});});}function createCmHopperPhone(_0x1efc6e,_0x103004){return new Promise(function(_0x57bfff){db[_0x4330('0x4e')][_0x4330('0x31')]({'raw':!![],'attributes':[_0x4330('0x8f'),_0x4330('0x87')],'where':{'CmContactId':_0x1efc6e,'ItemClass':_0x4330('0x8d')},'include':[{'model':db['ContactItemType'],'attributes':[_0x4330('0x87')],'as':_0x4330('0x90')}],'order':[_0x4330('0x87'),db['sequelize'][_0x4330('0x91')](_0x4330('0x92'))]})['then'](function(_0x227439){var _0x143ef3=0x1;var _0x416b12=_[_0x4330('0x6e')](_0x227439,function(_0x579dd8){_0x579dd8[_0x4330('0x93')]=_0x103004;_0x579dd8[_0x4330('0x78')]=_0x579dd8[_0x4330('0x8f')];_0x579dd8['OrderBy']=_0x143ef3;delete _0x579dd8[_0x4330('0x94')];_0x143ef3=_0x143ef3+0x1;return _0x579dd8;});return db[_0x4330('0x8e')][_0x4330('0x95')](_0x416b12,{});})[_0x4330('0x22')](function(){_0x57bfff(0x1);});});}function insertAdditionalPhones(_0xdd1437,_0x1ce7d4){return new Promise(function(_0x3c76fe){var _0x16a23a=[];for(var _0x27bc14=0x0;_0x27bc14<_0x1ce7d4[_0x4330('0x32')];_0x27bc14++){var _0x2798e2=_0x1ce7d4[_0x27bc14];_0x16a23a[_0x4330('0x62')](parseContactItemType(_0x2798e2));}Promise['all'](_0x16a23a)['then'](function(){var _0x2ad2d7={'id':_0xdd1437['id'],'items':_0x1ce7d4};return addAdditionalPhones(_0x2ad2d7)[_0x4330('0x22')](function(){return addCmHopperPhones(_0xdd1437['id']);});})[_0x4330('0x22')](function(){_0x3c76fe(_0xdd1437);});});}function parseContactItemType(_0x43198e){return new Promise(function(_0xdd9e58){if(_0x43198e[_0x4330('0x39')](_0x4330('0x8a'))){_0xdd9e58(_0x43198e);}else{return db[_0x4330('0x86')][_0x4330('0x27')]({'where':{'name':_0x43198e[_0x4330('0x90')]}})['then'](function(_0x37372e){if(_[_0x4330('0x59')](_0x37372e))_0x43198e[_0x4330('0x8a')]=null;else _0x43198e['ItemTypeId']=_0x37372e['id'];_0xdd9e58(_0x43198e);});}});}exports['getAdditionalPhones']=function(_0x2d2c4b,_0x29cfe6){return db[_0x4330('0x4e')][_0x4330('0x31')]({'raw':!![],'where':{'CmContactId':_0x2d2c4b[_0x4330('0x28')]['id'],'ItemClass':_0x4330('0x8d')},'include':[{'model':db[_0x4330('0x86')],'as':_0x4330('0x90')}],'order':[[_0x4330('0x87')],[db[_0x4330('0x96')][_0x4330('0x91')](_0x4330('0x92'))]]})[_0x4330('0x22')](function(_0x431319){return _0x431319;})['then'](respondWithResult(_0x29cfe6,null))[_0x4330('0x25')](handleError(_0x29cfe6,null));};exports[_0x4330('0x97')]=function(_0x125d93,_0x50902d){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x125d93[_0x4330('0x3b')]['fromContactId']}})['then'](function(_0x3ac591){var _0x280655=_[_0x4330('0x6e')](_0x3ac591,function(_0x939940){_0x939940['CmContactId']=_0x125d93[_0x4330('0x3b')]['toContactId'];return _0x939940;});return db[_0x4330('0x4e')]['bulkCreate'](_0x280655,{});})[_0x4330('0x22')](function(){return addCmHopperPhones(_0x125d93[_0x4330('0x3b')][_0x4330('0x98')]);})[_0x4330('0x22')](function(){return['ok'];})[_0x4330('0x22')](respondWithResult(_0x50902d,null))[_0x4330('0x25')](handleError(_0x50902d,null));};exports['rescheduleAdditionalPhones']=function(_0x11bd20,_0x548737){var _0x2d619a=[];_0x2d619a[_0x4330('0x62')](createCmHopperPhone(_0x11bd20['body']['id'],_0x11bd20[_0x4330('0x3b')][_0x4330('0x99')]));Promise[_0x4330('0x64')](_0x2d619a)[_0x4330('0x22')](function(){return[0x1];})['then'](respondWithResult(_0x548737,null));};exports[_0x4330('0x9a')]=function(_0xd54853,_0x5b560d){var _0x5a6a9a={'raw':![],'where':{}};var _0x272f98={};var _0x55accf={'count':0x0,'rows':[]};return db['CmContact'][_0x4330('0x79')]({'where':{'id':_0xd54853[_0x4330('0x28')]['id']}})[_0x4330('0x22')](handleEntityNotFound(_0x5b560d,null))['then'](function(_0x351132){if(_0x351132){_0x272f98[_0x4330('0x7a')]=_['keys'](db[_0x4330('0x42')]['rawAttributes']);_0x272f98[_0x4330('0x24')]=_[_0x4330('0x2b')](_0xd54853[_0x4330('0x24')]);_0x272f98['filters']=_[_0x4330('0x9b')](_0x272f98['model'],_0x272f98[_0x4330('0x24')]);_0x5a6a9a[_0x4330('0x7d')]=_['intersection'](_0x272f98[_0x4330('0x7a')],qs[_0x4330('0x7e')](_0xd54853[_0x4330('0x24')]['fields']));_0x5a6a9a[_0x4330('0x7d')]=_0x5a6a9a['attributes'][_0x4330('0x32')]?_0x5a6a9a['attributes']:_0x272f98[_0x4330('0x7a')];if(!_0xd54853['query'][_0x4330('0x39')](_0x4330('0x83'))){_0x5a6a9a[_0x4330('0x16')]=qs[_0x4330('0x16')](_0xd54853[_0x4330('0x24')][_0x4330('0x16')]);_0x5a6a9a['offset']=qs[_0x4330('0x14')](_0xd54853['query']['offset']);}_0x5a6a9a[_0x4330('0x9c')]=qs[_0x4330('0x7f')](_0xd54853['query']['sort']);_0x5a6a9a[_0x4330('0x6b')]=qs[_0x4330('0x7c')](_[_0x4330('0x80')](_0xd54853['query'],_0x272f98[_0x4330('0x7c')]));_0x5a6a9a['where'][_0x4330('0x9d')]=_0x351132['id'];if(_0xd54853[_0x4330('0x24')]['filter']){_0x5a6a9a[_0x4330('0x6b')]=_[_0x4330('0x3a')](_0x5a6a9a['where'],{'$or':_[_0x4330('0x6e')](_0x5a6a9a[_0x4330('0x7d')],function(_0x30b9a6){var _0x16f7bb={};_0x16f7bb[_0x30b9a6]={'$like':'%'+_0xd54853[_0x4330('0x24')][_0x4330('0x9e')]+'%'};return _0x16f7bb;})});}_0x5a6a9a=_[_0x4330('0x3a')]({},_0x5a6a9a,_0xd54853['options']);return db['CmHopper']['count']({'where':_0x5a6a9a[_0x4330('0x6b')]})['then'](function(_0x4d408a){_0x55accf[_0x4330('0x17')]=_0x4d408a;if(_0xd54853[_0x4330('0x24')]['includeAll']){_0x5a6a9a['include']=[{'all':!![]}];}return db['CmHopper'][_0x4330('0x31')](_0x5a6a9a);})[_0x4330('0x22')](function(_0x2a78e3){_0x55accf[_0x4330('0x9f')]=_0x2a78e3;return _0x55accf;});}})['then'](respondWithFilteredResult(_0x5b560d,_0x5a6a9a))['catch'](handleError(_0x5b560d,null));};exports['getHopperHistories']=function(_0x51e12c,_0x22bdcb){var _0x39145e={'raw':!![],'where':{}};var _0x5c5a07={};var _0x371701={'count':0x0,'rows':[]};return db[_0x4330('0x26')][_0x4330('0x79')]({'where':{'id':_0x51e12c[_0x4330('0x28')]['id']}})['then'](handleEntityNotFound(_0x22bdcb,null))[_0x4330('0x22')](function(_0x2eafd8){if(_0x2eafd8){_0x5c5a07['model']=_[_0x4330('0x2b')](db['CmHopperHistory'][_0x4330('0x7b')]);_0x5c5a07['query']=_[_0x4330('0x2b')](_0x51e12c[_0x4330('0x24')]);_0x5c5a07[_0x4330('0x7c')]=_[_0x4330('0x9b')](_0x5c5a07[_0x4330('0x7a')],_0x5c5a07[_0x4330('0x24')]);_0x39145e[_0x4330('0x7d')]=_[_0x4330('0x9b')](_0x5c5a07[_0x4330('0x7a')],qs[_0x4330('0x7e')](_0x51e12c[_0x4330('0x24')][_0x4330('0x7e')]));_0x39145e[_0x4330('0x7d')]=_0x39145e[_0x4330('0x7d')][_0x4330('0x32')]?_0x39145e[_0x4330('0x7d')]:_0x5c5a07[_0x4330('0x7a')];if(!_0x51e12c[_0x4330('0x24')][_0x4330('0x39')](_0x4330('0x83'))){_0x39145e[_0x4330('0x16')]=qs[_0x4330('0x16')](_0x51e12c[_0x4330('0x24')][_0x4330('0x16')]);_0x39145e[_0x4330('0x14')]=qs[_0x4330('0x14')](_0x51e12c[_0x4330('0x24')][_0x4330('0x14')]);}_0x39145e['order']=qs[_0x4330('0x7f')](_0x51e12c['query']['sort']);_0x39145e[_0x4330('0x6b')]=qs[_0x4330('0x7c')](_[_0x4330('0x80')](_0x51e12c[_0x4330('0x24')],_0x5c5a07[_0x4330('0x7c')]));_0x39145e[_0x4330('0x6b')]['ContactId']=_0x2eafd8['id'];if(_0x51e12c['query']['filter']){_0x39145e['where']=_[_0x4330('0x3a')](_0x39145e['where'],{'$or':_['map'](_0x39145e[_0x4330('0x7d')],function(_0x3578bc){var _0x47b11f={};_0x47b11f[_0x3578bc]={'$like':'%'+_0x51e12c[_0x4330('0x24')][_0x4330('0x9e')]+'%'};return _0x47b11f;})});}_0x39145e=_[_0x4330('0x3a')]({},_0x39145e,_0x51e12c[_0x4330('0x81')]);return db['CmHopperHistory'][_0x4330('0x17')]({'where':_0x39145e['where']})['then'](function(_0x5f8baa){_0x371701['count']=_0x5f8baa;if(_0x51e12c[_0x4330('0x24')][_0x4330('0xa0')]){_0x39145e[_0x4330('0xa1')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4330('0x31')](_0x39145e);})['then'](function(_0xc31972){_0x371701['rows']=_0xc31972;return _0x371701;});}})[_0x4330('0x22')](respondWithFilteredResult(_0x22bdcb,_0x39145e))[_0x4330('0x25')](handleError(_0x22bdcb,null));};exports[_0x4330('0xa2')]=function(_0x5bb88c,_0x6ab8b9){var _0x34391d={'raw':!![],'where':{}};var _0xa8f5b={};var _0x2e7c97={'count':0x0,'rows':[]};return db[_0x4330('0x26')][_0x4330('0x79')]({'where':{'id':_0x5bb88c['params']['id']}})[_0x4330('0x22')](handleEntityNotFound(_0x6ab8b9,null))['then'](function(_0x580d9b){if(_0x580d9b){_0xa8f5b[_0x4330('0x7a')]=_[_0x4330('0x2b')](db['CmHopperFinal']['rawAttributes']);_0xa8f5b[_0x4330('0x24')]=_[_0x4330('0x2b')](_0x5bb88c['query']);_0xa8f5b[_0x4330('0x7c')]=_[_0x4330('0x9b')](_0xa8f5b[_0x4330('0x7a')],_0xa8f5b[_0x4330('0x24')]);_0x34391d[_0x4330('0x7d')]=_[_0x4330('0x9b')](_0xa8f5b[_0x4330('0x7a')],qs['fields'](_0x5bb88c[_0x4330('0x24')][_0x4330('0x7e')]));_0x34391d[_0x4330('0x7d')]=_0x34391d[_0x4330('0x7d')]['length']?_0x34391d[_0x4330('0x7d')]:_0xa8f5b[_0x4330('0x7a')];if(!_0x5bb88c[_0x4330('0x24')][_0x4330('0x39')](_0x4330('0x83'))){_0x34391d[_0x4330('0x16')]=qs[_0x4330('0x16')](_0x5bb88c[_0x4330('0x24')]['limit']);_0x34391d[_0x4330('0x14')]=qs[_0x4330('0x14')](_0x5bb88c[_0x4330('0x24')]['offset']);}_0x34391d['order']=qs['sort'](_0x5bb88c['query'][_0x4330('0x7f')]);_0x34391d[_0x4330('0x6b')]=qs[_0x4330('0x7c')](_[_0x4330('0x80')](_0x5bb88c[_0x4330('0x24')],_0xa8f5b[_0x4330('0x7c')]));_0x34391d[_0x4330('0x6b')][_0x4330('0x9d')]=_0x580d9b['id'];if(_0x5bb88c[_0x4330('0x24')][_0x4330('0x9e')]){_0x34391d[_0x4330('0x6b')]=_[_0x4330('0x3a')](_0x34391d[_0x4330('0x6b')],{'$or':_[_0x4330('0x6e')](_0x34391d[_0x4330('0x7d')],function(_0x136a41){var _0x285c67={};_0x285c67[_0x136a41]={'$like':'%'+_0x5bb88c[_0x4330('0x24')][_0x4330('0x9e')]+'%'};return _0x285c67;})});}_0x34391d=_[_0x4330('0x3a')]({},_0x34391d,_0x5bb88c[_0x4330('0x81')]);return db[_0x4330('0x4f')][_0x4330('0x17')]({'where':_0x34391d['where']})['then'](function(_0x3b1c95){_0x2e7c97[_0x4330('0x17')]=_0x3b1c95;if(_0x5bb88c[_0x4330('0x24')][_0x4330('0xa0')]){_0x34391d[_0x4330('0xa1')]=[{'all':!![]}];}return db[_0x4330('0x4f')][_0x4330('0x31')](_0x34391d);})['then'](function(_0x1ac4b6){_0x2e7c97[_0x4330('0x9f')]=_0x1ac4b6;return _0x2e7c97;});}})['then'](respondWithFilteredResult(_0x6ab8b9,_0x34391d))[_0x4330('0x25')](handleError(_0x6ab8b9,null));};exports[_0x4330('0xa3')]=function(_0x95c089,_0x1c73f2){var _0x438497={'raw':!![],'where':{}};var _0x111e6e={};var _0x383120={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x95c089[_0x4330('0x28')]['id']}})[_0x4330('0x22')](handleEntityNotFound(_0x1c73f2,null))[_0x4330('0x22')](function(_0x1fe7c9){if(_0x1fe7c9){_0x111e6e['model']=_[_0x4330('0x2b')](db[_0x4330('0x55')][_0x4330('0x7b')]);_0x111e6e['query']=_[_0x4330('0x2b')](_0x95c089[_0x4330('0x24')]);_0x111e6e['filters']=_['intersection'](_0x111e6e['model'],_0x111e6e[_0x4330('0x24')]);_0x438497[_0x4330('0x7d')]=_[_0x4330('0x9b')](_0x111e6e[_0x4330('0x7a')],qs[_0x4330('0x7e')](_0x95c089[_0x4330('0x24')][_0x4330('0x7e')]));_0x438497[_0x4330('0x7d')]=_0x438497[_0x4330('0x7d')][_0x4330('0x32')]?_0x438497['attributes']:_0x111e6e[_0x4330('0x7a')];if(!_0x95c089['query']['hasOwnProperty']('nolimit')){_0x438497['limit']=qs['limit'](_0x95c089[_0x4330('0x24')]['limit']);_0x438497['offset']=qs[_0x4330('0x14')](_0x95c089[_0x4330('0x24')][_0x4330('0x14')]);}_0x438497[_0x4330('0x9c')]=qs['sort'](_0x95c089['query'][_0x4330('0x7f')]);_0x438497['where']=qs[_0x4330('0x7c')](_[_0x4330('0x80')](_0x95c089['query'],_0x111e6e['filters']));_0x438497[_0x4330('0x6b')]['ContactId']=_0x1fe7c9['id'];if(_0x95c089[_0x4330('0x24')][_0x4330('0x9e')]){_0x438497[_0x4330('0x6b')]=_['merge'](_0x438497[_0x4330('0x6b')],{'$or':_[_0x4330('0x6e')](_0x438497['attributes'],function(_0x27f758){var _0x42e67e={};_0x42e67e[_0x27f758]={'$like':'%'+_0x95c089[_0x4330('0x24')]['filter']+'%'};return _0x42e67e;})});}_0x438497=_['merge']({},_0x438497,_0x95c089['options']);return db['JscriptySessionReport'][_0x4330('0x17')]({'where':_0x438497['where']})['then'](function(_0x357494){_0x383120['count']=_0x357494;if(_0x95c089[_0x4330('0x24')][_0x4330('0xa0')]){_0x438497[_0x4330('0xa1')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4330('0x31')](_0x438497);})[_0x4330('0x22')](function(_0x4f65fe){_0x383120[_0x4330('0x9f')]=_0x4f65fe;return _0x383120;});}})[_0x4330('0x22')](respondWithFilteredResult(_0x1c73f2,_0x438497))[_0x4330('0x25')](handleError(_0x1c73f2,null));};exports[_0x4330('0xa4')]=function(_0x37e512,_0x442234){try{if(!_0x37e512[_0x4330('0x3b')][_0x4330('0x5f')]){throw new Error(_0x4330('0xa5'));}if(!_0x37e512[_0x4330('0x3b')][_0x4330('0xa6')]){throw new Error(_0x4330('0xa7'));}if(!_0x37e512[_0x4330('0x3b')]['binding_values']){throw new Error(_0x4330('0xa8'));}if(!_0x37e512['body'][_0x4330('0xa9')]){throw new Error(_0x4330('0xaa'));}var _0x594f93=_0x37e512[_0x4330('0x3b')][_0x4330('0xa6')][_0x4330('0xab')](',');var _0x39ae17=_0x37e512[_0x4330('0x3b')][_0x4330('0xac')][_0x4330('0xab')](',');if(!_0x594f93[_0x4330('0x32')]||!_0x39ae17[_0x4330('0x32')]||_0x594f93[_0x4330('0x32')]!==_0x39ae17['length']){throw new Error(_0x4330('0xad'));}_0x37e512[_0x4330('0x3b')][_0x4330('0x7e')]=_['zipObject'](_0x594f93,_0x39ae17);if(!_0x37e512[_0x4330('0x3b')][_0x4330('0x7e')][_0x4330('0x78')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x37e512[_0x4330('0x3b')][_0x4330('0x7e')][_0x4330('0xae')]){throw new Error(_0x4330('0xaf'));}var _0x5cfe9a=path[_0x4330('0x40')](config[_0x4330('0xb0')],'server/files/tmp',_0x37e512[_0x4330('0xb1')][_0x4330('0xb2')]);fs[_0x4330('0xb3')](_0x5cfe9a,parseInt(_0x4330('0xb4'),0x8));var _0x233802=require('child_process')['fork'](path['join'](__dirname,'../../components/import/cm/csv'),[_0x5cfe9a,_0x37e512[_0x4330('0x3b')]['binding_keys'],_0x37e512[_0x4330('0x3b')][_0x4330('0xac')],_0x37e512[_0x4330('0x3b')][_0x4330('0x5f')],_0x37e512[_0x4330('0x3b')][_0x4330('0xb5')],_0x37e512[_0x4330('0x3b')][_0x4330('0x5d')],_0x37e512[_0x4330('0x3b')]['socket_timestamp']]);return _0x442234[_0x4330('0x12')](0xc8)['json']({'message':_0x4330('0xb6'),'pid':_0x233802[_0x4330('0xb7')]});}catch(_0x491c1d){return _0x442234[_0x4330('0x12')](0x1f4)['send'](_0x491c1d);}};exports['upload']=function(_0x18c8f6,_0x564acf){var _0x4fe3eb=fs['createReadStream'](_0x18c8f6[_0x4330('0xb1')]['path']);Papa[_0x4330('0xb8')](_0x4fe3eb,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x32d494){return _0x564acf[_0x4330('0x12')](0xc8)[_0x4330('0x13')]({'file':_0x18c8f6[_0x4330('0xb1')],'fields':_0x32d494[_0x4330('0xb9')]['fields']});}});};exports[_0x4330('0xba')]=function(_0x1214ea,_0x197746){return db['User'][_0x4330('0x31')]({'raw':!![],'attributes':['id'],'where':{'role':_0x4330('0xbb')}})[_0x4330('0x22')](function(_0xf17ff7){var _0x1662a8=![];if(!_0x1214ea['body'][_0x4330('0x5f')]){throw new Error(_0x4330('0xa5'));}if(!_0x1214ea[_0x4330('0x3b')][_0x4330('0xbc')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1214ea[_0x4330('0x3b')][_0x4330('0xbc')][_0x4330('0xae')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1214ea[_0x4330('0x3b')][_0x4330('0xa9')]){throw new Error(_0x4330('0xaa'));}var _0x3bc56c=require(_0x4330('0xbd'))['fork'](path[_0x4330('0x40')](__dirname,_0x4330('0xbe')),[_0x1214ea[_0x4330('0x28')]['id'],JSON[_0x4330('0xbf')](_0x1214ea['body']),JSON[_0x4330('0xbf')](_0xf17ff7)]);_0x3bc56c['on'](_0x4330('0xc0'),function(){_0x1662a8=!![];return _0x197746[_0x4330('0x12')](0xc8)[_0x4330('0x13')]({'message':_0x4330('0xc1'),'pid':_0x3bc56c[_0x4330('0xb7')]});});_0x3bc56c['on'](_0x4330('0xc2'),function(_0x5d47a4){if(_0x5d47a4&&!_0x1662a8){return _0x197746[_0x4330('0x12')](0x1f4)[_0x4330('0x13')]({'message':_0x4330('0xc3'),'pid':_0x3bc56c[_0x4330('0xb7')]});}});})[_0x4330('0x25')](handleError(_0x197746,null));};exports[_0x4330('0xc4')]=function(_0x40c72b,_0x1fedf0){return db[_0x4330('0xc5')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})['then'](function(_0x3b98f1){var _0x2f4c36=![];if(!_0x40c72b[_0x4330('0x3b')][_0x4330('0x5f')]){throw new Error(_0x4330('0xa5'));}if(!_0x40c72b[_0x4330('0x3b')]['binding'][_0x4330('0x78')]){throw new Error(_0x4330('0xc6'));}if(!_0x40c72b[_0x4330('0x3b')]['binding']['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x40c72b['body'][_0x4330('0xa9')]){throw new Error(_0x4330('0xaa'));}var _0x1d54a7=require(_0x4330('0xbd'))['fork'](path[_0x4330('0x40')](__dirname,_0x4330('0xc7')),[_0x40c72b[_0x4330('0x28')]['id'],JSON[_0x4330('0xbf')](_0x40c72b[_0x4330('0x3b')]),JSON[_0x4330('0xbf')](_0x3b98f1)]);_0x1d54a7['on'](_0x4330('0xc0'),function(){_0x2f4c36=!![];return _0x1fedf0['status'](0xc8)[_0x4330('0x13')]({'message':_0x4330('0xc1'),'pid':_0x1d54a7[_0x4330('0xb7')]});});_0x1d54a7['on']('exit',function(_0x2718ab){if(_0x2718ab&&!_0x2f4c36){return _0x1fedf0[_0x4330('0x12')](0x1f4)['json']({'message':_0x4330('0xc3'),'pid':_0x1d54a7['pid']});}});})[_0x4330('0x25')](handleError(_0x1fedf0,null));};exports[_0x4330('0xc8')]=function(_0x54bfc5,_0x4ee8ae){var _0x3a4b65=[_0x4330('0xc9'),_0x4330('0xca'),'sms',_0x4330('0xcb'),_0x4330('0xcc'),_0x4330('0xcd'),_0x4330('0xce')];var _0x57057a={'offset':0x0,'order':qs['sort']('-createdAt')},_0x48b4e0={'count':0x0,'rows':[]};Promise[_0x4330('0xcf')]()[_0x4330('0x22')](function(){if(_0x54bfc5[_0x4330('0x24')][_0x4330('0xd0')]){if(!_[_0x4330('0xd1')](_0x3a4b65,_0x54bfc5[_0x4330('0x24')][_0x4330('0xd0')][_0x4330('0xd2')]())){throw new Error('Invalid\x20channel');}_0x3a4b65=[_0x54bfc5[_0x4330('0x24')][_0x4330('0xd0')][_0x4330('0xd2')]()];}if(_0x54bfc5[_0x4330('0x24')][_0x4330('0xd3')]){try{var _0xc265f1=JSON[_0x4330('0xb8')](_0x54bfc5[_0x4330('0x24')][_0x4330('0xd3')]);if(!moment(_0xc265f1[_0x4330('0x3c')])[_0x4330('0xd4')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0xc265f1['to'])[_0x4330('0xd4')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x4f817b){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x54bfc5['query']['hasOwnProperty'](_0x4330('0x83'))){_0x57057a[_0x4330('0x16')]=qs[_0x4330('0x16')](_0x54bfc5[_0x4330('0x24')][_0x4330('0x16')]||0xa);_0x57057a[_0x4330('0x14')]=qs['offset'](_0x54bfc5[_0x4330('0x24')]['offset']);}var _0x2e85ec=_0x3a4b65['map'](function(_0x4f60c6){if(_0x4f60c6===_0x4330('0xce')){var _0x4473ed={'attributes':['id','uniqueid','type',_0x4330('0xd5'),_0x4330('0xd6'),_0x4330('0xd7'),_0x4330('0xd8'),_0x4330('0xd9'),_0x4330('0xda'),_0x4330('0xdb'),'createdAt','userDisposition','userSecondDisposition',_0x4330('0xdc'),_0x4330('0xdd')],'where':{'ContactId':_0x54bfc5['params']['id']},'include':[{'model':db[_0x4330('0xc5')],'as':_0x4330('0xc5'),'attributes':['id','name','fullname',_0x4330('0x33')]}],'order':[[_0x4330('0xde'),_0x4330('0xdf')]]};if(_0x54bfc5['query'][_0x4330('0xd3')]){_0x4473ed['where'][_0x4330('0xde')]={'$gte':_0xc265f1[_0x4330('0x3c')],'$lte':_0xc265f1['to']};}return db[_0x4330('0xe0')][_0x4330('0xe1')](_0x4473ed)[_0x4330('0x22')](function(_0x8ae284){_0x48b4e0[_0x4330('0x17')]+=_0x8ae284['count'];return _[_0x4330('0x6e')](_0x8ae284[_0x4330('0x9f')],function(_0x526408){var _0x4eb975=_0x526408[_0x4330('0x3d')]({'plain':!![]});_0x4eb975[_0x4330('0xd0')]=_0x4f60c6;if(_0x4eb975[_0x4330('0xc5')]){_0x4eb975['User']={'id':_0x4eb975[_0x4330('0xc5')]['id'],'name':_0x4eb975[_0x4330('0xc5')]['name'],'fullname':_0x4eb975[_0x4330('0xc5')][_0x4330('0xe2')],'alias':_0x4eb975[_0x4330('0xc5')][_0x4330('0x33')]};}return _0x4eb975;});});}else{var _0x1b6b22=_[_0x4330('0xe3')](_0x4f60c6)+(_0x4f60c6===_0x4330('0xca')?'Website':_0x4330('0xe4'));var _0x18add8={'attributes':['id',_0x4330('0xe5'),_0x4330('0xe6'),_0x4330('0xde'),'note',_0x4330('0xe7'),_0x4330('0xe8'),_0x4330('0xe9'),_0x4330('0xdd'),_0x1b6b22+'Id'],'where':{'ContactId':_0x54bfc5[_0x4330('0x28')]['id']},'include':[{'model':db[_0x1b6b22],'as':'Account','attributes':['id',_0x4330('0x1f'),_0x4330('0xea')]},{'model':db['User'],'as':'Owner','attributes':['id',_0x4330('0x1f'),_0x4330('0xe2')]},{'model':db[_0x4330('0x66')],'as':_0x4330('0xeb'),'attributes':['id',_0x4330('0x1f'),_0x4330('0x67')],'through':{'attributes':[]}}],'order':[[_0x4330('0xde'),_0x4330('0xdf')]]};if(_0x54bfc5[_0x4330('0x24')][_0x4330('0xd3')]){_0x18add8[_0x4330('0x6b')]['createdAt']={'$gte':_0xc265f1[_0x4330('0x3c')],'$lte':_0xc265f1['to']};}switch(_0x4f60c6){case'chat':_0x18add8[_0x4330('0x7d')][_0x4330('0x62')](_0x4330('0xec'),_0x4330('0xed'),_0x4330('0xee'),'deviceModel',_0x4330('0xef'),'ratingMessage',_0x4330('0xf0'),_0x4330('0xf1'),'referer');break;case _0x4330('0xc9'):_0x18add8[_0x4330('0x7d')]['push'](_0x4330('0xf2'),_0x4330('0xf3'));break;case _0x4330('0xcb'):_0x18add8[_0x4330('0x7d')][_0x4330('0x62')]('externalUrl',_0x4330('0xf4'));break;}return db[_['startCase'](_0x4f60c6)+_0x4330('0xf5')][_0x4330('0xe1')](_0x18add8)['then'](function(_0x4e5b4d){_0x48b4e0['count']+=_0x4e5b4d[_0x4330('0x17')];return _[_0x4330('0x6e')](_0x4e5b4d['rows'],function(_0x5ba9e0){var _0x5aa9c7=_0x5ba9e0['get']({'plain':!![]});_0x5aa9c7['channel']=_0x4f60c6;if(_0x5aa9c7[_0x4330('0xf6')]){_0x5aa9c7['Owner']={'id':_0x5aa9c7[_0x4330('0xf6')]['id'],'name':_0x5aa9c7['Owner'][_0x4330('0x1f')],'fullname':_0x5aa9c7[_0x4330('0xf6')][_0x4330('0xe2')]};}return _0x5aa9c7;});});}});return Promise[_0x4330('0x64')](_0x2e85ec);})[_0x4330('0x22')](function(_0x1cd6bf){return _(_0x1cd6bf)[_0x4330('0xf7')]()['sortBy']('createdAt')[_0x4330('0xf8')]()[_0x4330('0xf9')]();})[_0x4330('0x22')](function(_0x4bfd01){_0x48b4e0[_0x4330('0x9f')]=_0x57057a[_0x4330('0x16')]?_0x4bfd01[_0x4330('0xfa')](_0x57057a[_0x4330('0x14')],_0x57057a[_0x4330('0x14')]+_0x57057a[_0x4330('0x16')]):_0x4bfd01;return _0x48b4e0;})[_0x4330('0x22')](respondWithFilteredResult(_0x4ee8ae,_0x57057a))['catch'](handleError(_0x4ee8ae,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 9d877b5..d672c28 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 _0x00c2=['CmContact','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x222b85,_0x1cb57a){var _0xc7b061=function(_0x57dbdf){while(--_0x57dbdf){_0x222b85['push'](_0x222b85['shift']());}};_0xc7b061(++_0x1cb57a);}(_0x00c2,0x8a));var _0x200c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00c2[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x200c('0x0'));var CmContact=require(_0x200c('0x1'))['db'][_0x200c('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x200c('0x3')](0x0);var events={'afterCreate':_0x200c('0x4'),'afterUpdate':_0x200c('0x5'),'afterDestroy':_0x200c('0x6')};function emitEvent(_0x3ea9dd){return function(_0x471c10,_0x138c74,_0x2fe9d6){CmContactEvents[_0x200c('0x7')](_0x3ea9dd+':'+_0x471c10['id'],_0x471c10);CmContactEvents[_0x200c('0x7')](_0x3ea9dd,_0x471c10);_0x2fe9d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x200c('0x8')](e,emitEvent(event));}}module[_0x200c('0x9')]=CmContactEvents; \ No newline at end of file +var _0x6558=['remove','emit','hook','events','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x3ecbd4,_0x29c8ea){var _0x266209=function(_0x394cee){while(--_0x394cee){_0x3ecbd4['push'](_0x3ecbd4['shift']());}};_0x266209(++_0x29c8ea);}(_0x6558,0xd2));var _0x8655=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x6558[_0x368bba];return _0x409f8f;};'use strict';var EventEmitter=require(_0x8655('0x0'));var CmContact=require(_0x8655('0x1'))['db'][_0x8655('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8655('0x3')](0x0);var events={'afterCreate':_0x8655('0x4'),'afterUpdate':_0x8655('0x5'),'afterDestroy':_0x8655('0x6')};function emitEvent(_0x567be5){return function(_0x2e80c3,_0x54ba60,_0x505cd4){CmContactEvents[_0x8655('0x7')](_0x567be5+':'+_0x2e80c3['id'],_0x2e80c3);CmContactEvents['emit'](_0x567be5,_0x2e80c3);_0x505cd4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x8655('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index f922e32..39dd068 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 _0xd8d5=['destroy','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','util','../../config/logger','api','moment','path','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','error','afterCreate','inspect','scheduledat','format','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','YYYY-MM-DD\x20HH:mm:ss','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','\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','create','cmContact','Campaign','minutes','outbound','dialCheckDuplicateType','CmList','Lists','length','get','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','findAll','message','List\x20not\x20found','isEmpty'];(function(_0x36fc82,_0xfc0b1e){var _0x160fbf=function(_0x57fcff){while(--_0x57fcff){_0x36fc82['push'](_0x36fc82['shift']());}};_0x160fbf(++_0xfc0b1e);}(_0xd8d5,0x11e));var _0x5d8d=function(_0x3e4c37,_0x4678c4){_0x3e4c37=_0x3e4c37-0x0;var _0x51feb7=_0xd8d5[_0x3e4c37];return _0x51feb7;};'use strict';var _=require('lodash');var util=require(_0x5d8d('0x0'));var logger=require(_0x5d8d('0x1'))(_0x5d8d('0x2'));var moment=require(_0x5d8d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d8d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require(_0x5d8d('0x5'));var attributes=require(_0x5d8d('0x6'));module[_0x5d8d('0x7')]=function(_0xf0f494,_0x3bd0ea){return _0xf0f494[_0x5d8d('0x8')](_0x5d8d('0x9'),attributes,{'tableName':_0x5d8d('0xa'),'paranoid':!![],'indexes':[{'name':_0x5d8d('0xb'),'fields':[_0x5d8d('0xb')]},{'name':'fti_cm_contacts','fields':[_0x5d8d('0xc'),_0x5d8d('0xd'),_0x5d8d('0xb'),_0x5d8d('0xe'),_0x5d8d('0xf'),_0x5d8d('0x10')],'type':_0x5d8d('0x11')}],'timestamps':!![],'charset':_0x5d8d('0x12'),'collate':_0x5d8d('0x13'),'hooks':{'afterCreate':function(_0x39dcb6,_0x3f8cbc,_0x55ede7){var _0x1b464a=_0xf0f494['models'];var _0x2baacf=_0x39dcb6['get']({'plain':!![]});function _0x3910e2(){return function(_0x459ea6){logger[_0x5d8d('0x14')]('cmContact',_0x5d8d('0x15'),util[_0x5d8d('0x16')](_0x459ea6,{'showHidden':![],'depth':null}));};}function _0x321fac(_0x3dae80,_0x5c8a0d){var _0x192726=_0x5c8a0d['scheduledat']?_0x5c8a0d[_0x5d8d('0x17')]:moment()[_0x5d8d('0x18')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x21df88,_0x52c4a3){if(_[_0x5d8d('0x19')](_0x5c8a0d[_0x5d8d('0x1a')])){_0x21df88({'ret':_0x192726});}else{_0x1b464a[_0x5d8d('0x1b')][_0x5d8d('0x1c')]({'where':{'id':_0x3dae80['id']}})[_0x5d8d('0x1d')](function(_0x44f7c8){if(!_[_0x5d8d('0x19')](_0x44f7c8)){var _0x4ce083=_0x44f7c8[_0x5d8d('0x1a')];if(!_[_0x5d8d('0x19')](_0x4ce083)){var _0x20e449=shared['timezones'];var _0x56d65b=_0x20e449[_0x4ce083];var _0x31e656=_0x20e449[_0x5c8a0d[_0x5d8d('0x1a')]];if(!_[_0x5d8d('0x19')](_0x56d65b)&&!_[_0x5d8d('0x19')](_0x31e656)){var _0x4c8221=_0x56d65b[_0x5d8d('0x1e')]-_0x31e656[_0x5d8d('0x1e')];_0x192726=_0x5c8a0d[_0x5d8d('0x17')]?_0x5c8a0d[_0x5d8d('0x17')]:moment();var _0x24de47=moment(_0x192726)[_0x5d8d('0x1f')](_0x4c8221,'minutes');_0x21df88({'ret':_0x24de47[_0x5d8d('0x18')](_0x5d8d('0x20'))});}else _0x21df88({'ret':_0x192726});}else _0x21df88({'ret':_0x192726});}else{_0x21df88({'ret':_0x192726});}});}});return 0xa;}var _0x8a50ac=function(_0x84c128){return new BPromise(function(_0x4b4e09,_0xec41ba){_0x321fac(_0x84c128,_0x2baacf)[_0x5d8d('0x1d')](function(_0x3341de){_0x2baacf[_0x5d8d('0x17')]=_0x3341de[_0x5d8d('0x21')];_0x1b464a[_0x5d8d('0x22')]['findOne']({'where':{'phone':_0x2baacf['phone'],'VoiceQueueId':_0x84c128['id']}})[_0x5d8d('0x1d')](function(_0x2b03d7){if(!_[_0x5d8d('0x19')](_0x2b03d7)){throw new Error(_0x5d8d('0x23')+_0x2baacf[_0x5d8d('0xb')]+_0x5d8d('0x24')+_0x84c128['id']);}return _0x1b464a['CmHopper']['create']({'phone':_0x2baacf['phone'],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf[_0x5d8d('0x25')],'priority':_0x2baacf[_0x5d8d('0x26')]?_0x2baacf[_0x5d8d('0x26')]:0x2,'scheduledat':_0x2baacf[_0x5d8d('0x17')]?_0x2baacf[_0x5d8d('0x17')]:moment()['format'](_0x5d8d('0x20')),'callback':_0x2baacf['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2baacf[_0x5d8d('0x27')]?_0x2baacf[_0x5d8d('0x27')]:undefined,'callbackat':_0x2baacf[_0x5d8d('0x27')]?moment()[_0x5d8d('0x18')](_0x5d8d('0x20')):undefined,'VoiceQueueId':_0x84c128['id']});})[_0x5d8d('0x28')](function(_0x403cf2){_0xec41ba(_0x403cf2);});});});};var _0x43e366=function(_0x251fbb){return new BPromise(function(_0xba90da,_0x244641){_0x321fac(_0x251fbb,_0x2baacf)[_0x5d8d('0x1d')](function(_0x4cf468){_0x2baacf[_0x5d8d('0x17')]=_0x4cf468['ret'];_0x1b464a[_0x5d8d('0x22')][_0x5d8d('0x1c')]({'where':{'phone':_0x2baacf[_0x5d8d('0xb')],'VoiceQueueId':_0x251fbb['id']}})[_0x5d8d('0x1d')](function(_0x3d3968){if(!_[_0x5d8d('0x19')](_0x3d3968)){throw new Error(_0x5d8d('0x23')+_0x2baacf[_0x5d8d('0xb')]+_0x5d8d('0x29')+_0x251fbb['id']);}return _0x1b464a[_0x5d8d('0x2a')][_0x5d8d('0x1c')]({'where':{'calleridnum':_0x2baacf['phone'],'VoiceQueueId':_0x251fbb['id']}});})[_0x5d8d('0x1d')](function(_0x4fcd04){if(!_['isNil'](_0x4fcd04)){throw new Error(_0x5d8d('0x2b')+_0x2baacf[_0x5d8d('0xb')]+_0x5d8d('0x2c')+_0x251fbb['id']);}return _0x1b464a[_0x5d8d('0x22')][_0x5d8d('0x2d')]({'phone':_0x2baacf[_0x5d8d('0xb')],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf['ListId'],'priority':_0x2baacf[_0x5d8d('0x26')]?_0x2baacf[_0x5d8d('0x26')]:0x2,'scheduledat':_0x2baacf[_0x5d8d('0x17')]?_0x2baacf[_0x5d8d('0x17')]:moment()[_0x5d8d('0x18')](_0x5d8d('0x20')),'callback':_0x2baacf[_0x5d8d('0x27')]?!![]:![],'callbackuniqueid':_0x2baacf[_0x5d8d('0x27')]?_0x2baacf[_0x5d8d('0x27')]:undefined,'callbackat':_0x2baacf[_0x5d8d('0x27')]?moment()['format'](_0x5d8d('0x20')):undefined,'VoiceQueueId':_0x251fbb['id']});})[_0x5d8d('0x28')](function(_0x4af260){_0x244641(_0x4af260);});});});};function _0xb59e28(){return function(_0x3e457d){logger[_0x5d8d('0x14')](_0x5d8d('0x2e'),_0x5d8d('0x15'),util[_0x5d8d('0x16')](_0x3e457d,{'showHidden':![],'depth':null}));};}function _0x30adec(_0x5b37a6,_0x55abcd){var _0x93e8c3=_0x55abcd[_0x5d8d('0x17')]?_0x55abcd[_0x5d8d('0x17')]:moment()[_0x5d8d('0x18')](_0x5d8d('0x20'));return new BPromise(function(_0x2a27e6,_0xe89315){if(_['isNil'](_0x55abcd[_0x5d8d('0x1a')])){_0x2a27e6({'ret':_0x93e8c3});}else{_0x1b464a[_0x5d8d('0x2f')][_0x5d8d('0x1c')]({'where':{'id':_0x5b37a6['id']}})[_0x5d8d('0x1d')](function(_0x59f7d7){if(!_['isNil'](_0x59f7d7)){var _0x2a0375=_0x59f7d7[_0x5d8d('0x1a')];if(!_[_0x5d8d('0x19')](_0x2a0375)){var _0xcf5766=shared['timezones'];var _0x3d6ad9=_0xcf5766[_0x2a0375];var _0xe95a06=_0xcf5766[_0x55abcd[_0x5d8d('0x1a')]];if(!_[_0x5d8d('0x19')](_0x3d6ad9)&&!_[_0x5d8d('0x19')](_0xe95a06)){var _0x4ca229=_0x3d6ad9[_0x5d8d('0x1e')]-_0xe95a06[_0x5d8d('0x1e')];_0x93e8c3=_0x55abcd[_0x5d8d('0x17')]?_0x55abcd[_0x5d8d('0x17')]:moment();var _0x51012b=moment(_0x93e8c3)[_0x5d8d('0x1f')](_0x4ca229,_0x5d8d('0x30'));_0x2a27e6({'ret':_0x51012b['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2a27e6({'ret':_0x93e8c3});}else _0x2a27e6({'ret':_0x93e8c3});}else{_0x2a27e6({'ret':_0x93e8c3});}});}});return 0xa;}var _0xd40546=function(_0x1cb729){return new BPromise(function(_0x31072a,_0x2f581c){_0x30adec(_0x1cb729,_0x2baacf)[_0x5d8d('0x1d')](function(_0x5d19cf){_0x2baacf[_0x5d8d('0x17')]=_0x5d19cf[_0x5d8d('0x21')];_0x1b464a['CmHopper'][_0x5d8d('0x1c')]({'where':{'phone':_0x2baacf['phone'],'CampaignId':_0x1cb729['id']}})[_0x5d8d('0x1d')](function(_0x2a4a5f){if(!_[_0x5d8d('0x19')](_0x2a4a5f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2baacf[_0x5d8d('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1cb729['id']);}return _0x1b464a['CmHopper'][_0x5d8d('0x2d')]({'phone':_0x2baacf[_0x5d8d('0xb')],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf['ListId'],'priority':_0x2baacf['priority']?_0x2baacf[_0x5d8d('0x26')]:0x2,'scheduledat':_0x2baacf['scheduledat']?_0x2baacf[_0x5d8d('0x17')]:moment()[_0x5d8d('0x18')](_0x5d8d('0x20')),'callback':_0x2baacf[_0x5d8d('0x27')]?!![]:![],'callbackuniqueid':_0x2baacf[_0x5d8d('0x27')]?_0x2baacf[_0x5d8d('0x27')]:undefined,'callbackat':_0x2baacf['callbackUniqueid']?moment()[_0x5d8d('0x18')](_0x5d8d('0x20')):undefined,'CampaignId':_0x1cb729['id']});})[_0x5d8d('0x28')](function(_0x3c12fe){_0x2f581c(_0x3c12fe);});});});};var _0x436286=function(_0x4763e8){return new BPromise(function(_0x4e70fd,_0x41a9ba){_0x30adec(_0x4763e8,_0x2baacf)['then'](function(_0x1c6962){_0x2baacf[_0x5d8d('0x17')]=_0x1c6962[_0x5d8d('0x21')];_0x1b464a['CmHopper'][_0x5d8d('0x1c')]({'where':{'phone':_0x2baacf['phone'],'CampaignId':_0x4763e8['id']}})['then'](function(_0x52778f){if(!_[_0x5d8d('0x19')](_0x52778f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2baacf[_0x5d8d('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4763e8['id']);}return _0x1b464a['CmHopperFinal'][_0x5d8d('0x1c')]({'where':{'calleridnum':_0x2baacf[_0x5d8d('0xb')],'CampaignId':_0x4763e8['id']}});})[_0x5d8d('0x1d')](function(_0x4a8bf3){if(!_[_0x5d8d('0x19')](_0x4a8bf3)){throw new Error(_0x5d8d('0x2b')+_0x2baacf[_0x5d8d('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x4763e8['id']);}return _0x1b464a[_0x5d8d('0x22')][_0x5d8d('0x2d')]({'phone':_0x2baacf[_0x5d8d('0xb')],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf[_0x5d8d('0x25')],'priority':_0x2baacf[_0x5d8d('0x26')]?_0x2baacf['priority']:0x2,'scheduledat':_0x2baacf[_0x5d8d('0x17')]?_0x2baacf['scheduledat']:moment()[_0x5d8d('0x18')](_0x5d8d('0x20')),'callback':_0x2baacf[_0x5d8d('0x27')]?!![]:![],'callbackuniqueid':_0x2baacf[_0x5d8d('0x27')]?_0x2baacf[_0x5d8d('0x27')]:undefined,'callbackat':_0x2baacf[_0x5d8d('0x27')]?moment()[_0x5d8d('0x18')](_0x5d8d('0x20')):undefined,'CampaignId':_0x4763e8['id']});})[_0x5d8d('0x28')](function(_0x1d99ba){_0x41a9ba(_0x1d99ba);});});});};if(_0x2baacf['ListId']){_0x1b464a[_0x5d8d('0x1b')]['findAll']({'where':{'type':_0x5d8d('0x31')},'attributes':['id',_0x5d8d('0x32'),'dialTimezone'],'include':[{'model':_0x1b464a[_0x5d8d('0x33')],'as':_0x5d8d('0x34'),'where':{'id':_0x2baacf['ListId']}}]})[_0x5d8d('0x1d')](function(_0x1b0c5f){if(_0x1b0c5f){var _0x2c597a=[];for(var _0x3d98cb=0x0,_0x5e82de;_0x3d98cb<_0x1b0c5f[_0x5d8d('0x35')];_0x3d98cb+=0x1){_0x5e82de=_0x1b0c5f[_0x3d98cb][_0x5d8d('0x36')]({'plain':!![]});switch(_0x5e82de[_0x5d8d('0x32')]){case _0x5d8d('0x37'):_0x43e366(_0x5e82de)[_0x5d8d('0x28')](_0x3910e2());break;case _0x5d8d('0x38'):_0x8a50ac(_0x5e82de)[_0x5d8d('0x28')](_0x3910e2());break;default:_0x30adec(_0x5e82de,_0x2baacf)['then'](function(_0x24baca){_0x2baacf['scheduledat']=_0x24baca[_0x5d8d('0x21')];_0x1b464a['CmHopper'][_0x5d8d('0x2d')]({'phone':_0x2baacf['phone'],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf[_0x5d8d('0x25')],'scheduledat':_0x2baacf['scheduledat']?_0x2baacf['scheduledat']:moment()[_0x5d8d('0x18')](_0x5d8d('0x20')),'priority':_0x2baacf[_0x5d8d('0x26')]?_0x2baacf['priority']:0x2,'callback':_0x2baacf[_0x5d8d('0x27')]?!![]:![],'callbackuniqueid':_0x2baacf[_0x5d8d('0x27')]?_0x2baacf['callbackUniqueid']:undefined,'callbackat':_0x2baacf[_0x5d8d('0x27')]?moment()[_0x5d8d('0x18')](_0x5d8d('0x20')):undefined,'VoiceQueueId':_0x5e82de['id']})[_0x5d8d('0x28')](_0x3910e2());});}}}})[_0x5d8d('0x1d')](function(){return _0x1b464a[_0x5d8d('0x1b')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x1b464a[_0x5d8d('0x33')],'as':_0x5d8d('0x39'),'where':{'id':_0x2baacf[_0x5d8d('0x25')]}}]})[_0x5d8d('0x1d')](function(_0x159253){if(_0x159253){var _0xcca00e=[];for(var _0x402a9f=0x0,_0x1bdfce;_0x402a9f<_0x159253['length'];_0x402a9f+=0x1){_0x1bdfce=_0x159253[_0x402a9f][_0x5d8d('0x36')]({'plain':!![]});_0x1b464a[_0x5d8d('0x3a')][_0x5d8d('0x2d')]({'phone':_0x2baacf['phone'],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf[_0x5d8d('0x25')],'VoiceQueueId':_0x1bdfce['id']})[_0x5d8d('0x28')](function(_0x292540){logger[_0x5d8d('0x14')](_0x5d8d('0x3b'),_0x5d8d('0x15'),_0x292540['message']);});}}});})[_0x5d8d('0x1d')](function(){return _0x1b464a[_0x5d8d('0x2f')][_0x5d8d('0x3c')]({'attributes':['id',_0x5d8d('0x32'),_0x5d8d('0x1a')],'include':[{'model':_0x1b464a[_0x5d8d('0x33')],'as':_0x5d8d('0x34'),'where':{'id':_0x2baacf[_0x5d8d('0x25')]}}]})[_0x5d8d('0x1d')](function(_0x5c16d6){if(_0x5c16d6){var _0x3a4ebc=[];for(var _0x30d152=0x0,_0x2fdc87;_0x30d152<_0x5c16d6[_0x5d8d('0x35')];_0x30d152+=0x1){_0x2fdc87=_0x5c16d6[_0x30d152][_0x5d8d('0x36')]({'plain':!![]});switch(_0x2fdc87[_0x5d8d('0x32')]){case _0x5d8d('0x37'):_0x436286(_0x2fdc87)[_0x5d8d('0x28')](_0xb59e28());break;case _0x5d8d('0x38'):_0xd40546(_0x2fdc87)[_0x5d8d('0x28')](_0xb59e28());break;default:_0x1b464a[_0x5d8d('0x22')][_0x5d8d('0x2d')]({'phone':_0x2baacf[_0x5d8d('0xb')],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf['ListId'],'scheduledat':_0x2baacf[_0x5d8d('0x17')]?_0x2baacf[_0x5d8d('0x17')]:moment()[_0x5d8d('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2baacf[_0x5d8d('0x26')]?_0x2baacf[_0x5d8d('0x26')]:0x2,'callback':_0x2baacf[_0x5d8d('0x27')]?!![]:![],'callbackuniqueid':_0x2baacf[_0x5d8d('0x27')]?_0x2baacf[_0x5d8d('0x27')]:undefined,'callbackat':_0x2baacf[_0x5d8d('0x27')]?moment()[_0x5d8d('0x18')](_0x5d8d('0x20')):undefined,'CampaignId':_0x2fdc87['id']})[_0x5d8d('0x28')](_0xb59e28());}}}});})[_0x5d8d('0x1d')](function(){return _0x1b464a[_0x5d8d('0x2f')]['findAll']({'attributes':['id'],'include':[{'model':_0x1b464a[_0x5d8d('0x33')],'as':'BlackLists','where':{'id':_0x2baacf[_0x5d8d('0x25')]}}]})['then'](function(_0x40969c){if(_0x40969c){var _0x190a32=[];for(var _0x38d708=0x0,_0x6324ca;_0x38d708<_0x40969c[_0x5d8d('0x35')];_0x38d708+=0x1){_0x6324ca=_0x40969c[_0x38d708]['get']({'plain':!![]});_0x1b464a['CmHopperBlack'][_0x5d8d('0x2d')]({'phone':_0x2baacf[_0x5d8d('0xb')],'ContactId':_0x2baacf['id'],'ListId':_0x2baacf[_0x5d8d('0x25')],'CampaignId':_0x6324ca['id']})['catch'](function(_0x36a8c0){logger['error'](_0x5d8d('0x3b'),_0x5d8d('0x15'),_0x36a8c0[_0x5d8d('0x3d')]);});}}});})[_0x5d8d('0x1d')](function(){_0x55ede7();})[_0x5d8d('0x28')](function(_0x426196){logger['error']('cmContact,\x20%s,\x20%s',_0x5d8d('0x15'),_0x426196[_0x5d8d('0x3d')]);_0x55ede7(_0x426196);});}else{_0x55ede7(new Error(_0x5d8d('0x3e')));}},'afterDestroy':function(_0x581f58,_0x13a3a0,_0x53696c){var _0x2fdd53=_0xf0f494['models'];var _0x53fad6=_0x581f58[_0x5d8d('0x36')]({'plain':!![]});return _0x2fdd53[_0x5d8d('0x22')][_0x5d8d('0x3c')]({'raw':!![],'where':{'ListId':_0x53fad6[_0x5d8d('0x25')],'ContactId':_0x53fad6['id']}})['then'](function(_0x3ffded){if(!_[_0x5d8d('0x3f')](_0x3ffded)){var _0x4640d4=[];for(var _0x3778b3=0x0;_0x3778b3<_0x3ffded['length'];_0x3778b3+=0x1){var _0x3dcaf4=_0x2fdd53[_0x5d8d('0x22')][_0x5d8d('0x40')]({'where':{'ListId':_0x3ffded[_0x3778b3][_0x5d8d('0x25')],'ContactId':_0x3ffded[_0x3778b3]['ContactId'],'VoiceQueueId':_0x3ffded[_0x3778b3][_0x5d8d('0x41')],'CampaignId':_0x3ffded[_0x3778b3][_0x5d8d('0x42')]}});_0x4640d4['push'](_0x3dcaf4);}return BPromise[_0x5d8d('0x43')](_0x4640d4);}})[_0x5d8d('0x1d')](function(_0x58aa5e){logger[_0x5d8d('0x44')](_0x5d8d('0x45'),util[_0x5d8d('0x16')](_0x58aa5e,{'showHidden':![],'depth':null}));_0x53696c();})[_0x5d8d('0x28')](function(_0x1315c8){logger['error']('[CmContact][afterDestroy][Error]',util[_0x5d8d('0x16')](_0x1315c8,{'showHidden':![],'depth':null}));_0x53696c(_0x1315c8);});}}});}; \ No newline at end of file +var _0x14c7=['destroy','VoiceQueueId','push','all','api','moment','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','fti_cm_contacts','phone','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','cmContact','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','then','dialTimezone','utcOffset','add','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','format','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','error','afterCreate','inspect','Campaign','timezones','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','catch','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','get','always','onlyIfOpen','BlackLists','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty'];(function(_0x31a33a,_0x437ed2){var _0x54881f=function(_0x14b55e){while(--_0x14b55e){_0x31a33a['push'](_0x31a33a['shift']());}};_0x54881f(++_0x437ed2);}(_0x14c7,0x18a));var _0x714c=function(_0x1f5861,_0x3fbdf6){_0x1f5861=_0x1f5861-0x0;var _0x222162=_0x14c7[_0x1f5861];return _0x222162;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x714c('0x0'));var moment=require(_0x714c('0x1'));var BPromise=require('bluebird');var rp=require(_0x714c('0x2'));var fs=require('fs');var path=require(_0x714c('0x3'));var rimraf=require('rimraf');var config=require(_0x714c('0x4'));var shared=require(_0x714c('0x5'));var attributes=require(_0x714c('0x6'));module[_0x714c('0x7')]=function(_0x1aeb06,_0x380360){return _0x1aeb06[_0x714c('0x8')]('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x714c('0x9'),'fields':['firstName','lastName',_0x714c('0xa'),_0x714c('0xb'),_0x714c('0xc'),'email'],'type':_0x714c('0xd')}],'timestamps':!![],'charset':_0x714c('0xe'),'collate':_0x714c('0xf'),'hooks':{'afterCreate':function(_0x477ccf,_0x489e4f,_0x4614ec){var _0x30464f=_0x1aeb06[_0x714c('0x10')];var _0x5b3eae=_0x477ccf['get']({'plain':!![]});function _0x409948(){return function(_0x1f9536){logger['error'](_0x714c('0x11'),'afterCreate',util['inspect'](_0x1f9536,{'showHidden':![],'depth':null}));};}function _0xfe192a(_0xb95476,_0x583c2d){var _0x3705ea=_0x583c2d[_0x714c('0x12')]?_0x583c2d[_0x714c('0x12')]:moment()['format'](_0x714c('0x13'));return new BPromise(function(_0x5d45ed,_0x27f70f){if(_[_0x714c('0x14')](_0x583c2d['dialTimezone'])){_0x5d45ed({'ret':_0x3705ea});}else{_0x30464f['VoiceQueue']['findOne']({'where':{'id':_0xb95476['id']}})[_0x714c('0x15')](function(_0x1a8a41){if(!_[_0x714c('0x14')](_0x1a8a41)){var _0x100717=_0x1a8a41[_0x714c('0x16')];if(!_[_0x714c('0x14')](_0x100717)){var _0x2fe2fa=shared['timezones'];var _0x25f66b=_0x2fe2fa[_0x100717];var _0x6472a7=_0x2fe2fa[_0x583c2d['dialTimezone']];if(!_['isNil'](_0x25f66b)&&!_['isNil'](_0x6472a7)){var _0x4c006a=_0x25f66b[_0x714c('0x17')]-_0x6472a7[_0x714c('0x17')];_0x3705ea=_0x583c2d[_0x714c('0x12')]?_0x583c2d[_0x714c('0x12')]:moment();var _0x15eeff=moment(_0x3705ea)[_0x714c('0x18')](_0x4c006a,'minutes');_0x5d45ed({'ret':_0x15eeff['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x5d45ed({'ret':_0x3705ea});}else _0x5d45ed({'ret':_0x3705ea});}else{_0x5d45ed({'ret':_0x3705ea});}});}});return 0xa;}var _0x38264e=function(_0x41303f){return new BPromise(function(_0x24bc26,_0x5e3d5e){_0xfe192a(_0x41303f,_0x5b3eae)[_0x714c('0x15')](function(_0x516a8f){_0x5b3eae['scheduledat']=_0x516a8f[_0x714c('0x19')];_0x30464f['CmHopper'][_0x714c('0x1a')]({'where':{'phone':_0x5b3eae[_0x714c('0xa')],'VoiceQueueId':_0x41303f['id']}})[_0x714c('0x15')](function(_0x57a16c){if(!_[_0x714c('0x14')](_0x57a16c)){throw new Error(_0x714c('0x1b')+_0x5b3eae['phone']+_0x714c('0x1c')+_0x41303f['id']);}return _0x30464f[_0x714c('0x1d')][_0x714c('0x1e')]({'phone':_0x5b3eae[_0x714c('0xa')],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae[_0x714c('0x1f')],'priority':_0x5b3eae[_0x714c('0x20')]?_0x5b3eae[_0x714c('0x20')]:0x2,'scheduledat':_0x5b3eae[_0x714c('0x12')]?_0x5b3eae[_0x714c('0x12')]:moment()[_0x714c('0x21')](_0x714c('0x13')),'callback':_0x5b3eae[_0x714c('0x22')]?!![]:![],'callbackuniqueid':_0x5b3eae['callbackUniqueid']?_0x5b3eae[_0x714c('0x22')]:undefined,'callbackat':_0x5b3eae[_0x714c('0x22')]?moment()[_0x714c('0x21')](_0x714c('0x13')):undefined,'VoiceQueueId':_0x41303f['id']});})['catch'](function(_0xe01f5a){_0x5e3d5e(_0xe01f5a);});});});};var _0xabeb41=function(_0x26d814){return new BPromise(function(_0x325587,_0x345ca2){_0xfe192a(_0x26d814,_0x5b3eae)[_0x714c('0x15')](function(_0x589987){_0x5b3eae[_0x714c('0x12')]=_0x589987[_0x714c('0x19')];_0x30464f[_0x714c('0x1d')][_0x714c('0x1a')]({'where':{'phone':_0x5b3eae['phone'],'VoiceQueueId':_0x26d814['id']}})[_0x714c('0x15')](function(_0x29ef24){if(!_[_0x714c('0x14')](_0x29ef24)){throw new Error(_0x714c('0x1b')+_0x5b3eae['phone']+_0x714c('0x23')+_0x26d814['id']);}return _0x30464f[_0x714c('0x24')][_0x714c('0x1a')]({'where':{'calleridnum':_0x5b3eae[_0x714c('0xa')],'VoiceQueueId':_0x26d814['id']}});})[_0x714c('0x15')](function(_0x2093e1){if(!_['isNil'](_0x2093e1)){throw new Error(_0x714c('0x25')+_0x5b3eae[_0x714c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x26d814['id']);}return _0x30464f[_0x714c('0x1d')]['create']({'phone':_0x5b3eae['phone'],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae[_0x714c('0x1f')],'priority':_0x5b3eae[_0x714c('0x20')]?_0x5b3eae[_0x714c('0x20')]:0x2,'scheduledat':_0x5b3eae['scheduledat']?_0x5b3eae[_0x714c('0x12')]:moment()[_0x714c('0x21')](_0x714c('0x13')),'callback':_0x5b3eae[_0x714c('0x22')]?!![]:![],'callbackuniqueid':_0x5b3eae[_0x714c('0x22')]?_0x5b3eae[_0x714c('0x22')]:undefined,'callbackat':_0x5b3eae[_0x714c('0x22')]?moment()[_0x714c('0x21')](_0x714c('0x13')):undefined,'VoiceQueueId':_0x26d814['id']});})['catch'](function(_0x40dfb1){_0x345ca2(_0x40dfb1);});});});};function _0x4bf6c1(){return function(_0x2d9db4){logger[_0x714c('0x26')](_0x714c('0x11'),_0x714c('0x27'),util[_0x714c('0x28')](_0x2d9db4,{'showHidden':![],'depth':null}));};}function _0xbfa1c7(_0xb7a447,_0x5ca9db){var _0x3d4b9d=_0x5ca9db['scheduledat']?_0x5ca9db['scheduledat']:moment()[_0x714c('0x21')](_0x714c('0x13'));return new BPromise(function(_0x3e81f8,_0xd2d6e6){if(_[_0x714c('0x14')](_0x5ca9db[_0x714c('0x16')])){_0x3e81f8({'ret':_0x3d4b9d});}else{_0x30464f[_0x714c('0x29')][_0x714c('0x1a')]({'where':{'id':_0xb7a447['id']}})[_0x714c('0x15')](function(_0x14b4e3){if(!_[_0x714c('0x14')](_0x14b4e3)){var _0x323c50=_0x14b4e3[_0x714c('0x16')];if(!_[_0x714c('0x14')](_0x323c50)){var _0x2c333f=shared[_0x714c('0x2a')];var _0x46018e=_0x2c333f[_0x323c50];var _0x42f558=_0x2c333f[_0x5ca9db[_0x714c('0x16')]];if(!_['isNil'](_0x46018e)&&!_[_0x714c('0x14')](_0x42f558)){var _0x5a6884=_0x46018e[_0x714c('0x17')]-_0x42f558[_0x714c('0x17')];_0x3d4b9d=_0x5ca9db[_0x714c('0x12')]?_0x5ca9db['scheduledat']:moment();var _0x4d2774=moment(_0x3d4b9d)[_0x714c('0x18')](_0x5a6884,_0x714c('0x2b'));_0x3e81f8({'ret':_0x4d2774[_0x714c('0x21')](_0x714c('0x13'))});}else _0x3e81f8({'ret':_0x3d4b9d});}else _0x3e81f8({'ret':_0x3d4b9d});}else{_0x3e81f8({'ret':_0x3d4b9d});}});}});return 0xa;}var _0x3ac09b=function(_0x396d43){return new BPromise(function(_0x39c947,_0xa1b206){_0xbfa1c7(_0x396d43,_0x5b3eae)[_0x714c('0x15')](function(_0x4886bc){_0x5b3eae[_0x714c('0x12')]=_0x4886bc[_0x714c('0x19')];_0x30464f[_0x714c('0x1d')]['findOne']({'where':{'phone':_0x5b3eae[_0x714c('0xa')],'CampaignId':_0x396d43['id']}})['then'](function(_0x214a47){if(!_['isNil'](_0x214a47)){throw new Error(_0x714c('0x1b')+_0x5b3eae[_0x714c('0xa')]+_0x714c('0x2c')+_0x396d43['id']);}return _0x30464f[_0x714c('0x1d')][_0x714c('0x1e')]({'phone':_0x5b3eae[_0x714c('0xa')],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae['ListId'],'priority':_0x5b3eae[_0x714c('0x20')]?_0x5b3eae[_0x714c('0x20')]:0x2,'scheduledat':_0x5b3eae[_0x714c('0x12')]?_0x5b3eae[_0x714c('0x12')]:moment()[_0x714c('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5b3eae[_0x714c('0x22')]?!![]:![],'callbackuniqueid':_0x5b3eae[_0x714c('0x22')]?_0x5b3eae[_0x714c('0x22')]:undefined,'callbackat':_0x5b3eae[_0x714c('0x22')]?moment()[_0x714c('0x21')](_0x714c('0x13')):undefined,'CampaignId':_0x396d43['id']});})[_0x714c('0x2d')](function(_0x1cbdd8){_0xa1b206(_0x1cbdd8);});});});};var _0x23a52a=function(_0x3f09b7){return new BPromise(function(_0x5d9778,_0x11c672){_0xbfa1c7(_0x3f09b7,_0x5b3eae)[_0x714c('0x15')](function(_0x36f546){_0x5b3eae[_0x714c('0x12')]=_0x36f546[_0x714c('0x19')];_0x30464f[_0x714c('0x1d')][_0x714c('0x1a')]({'where':{'phone':_0x5b3eae['phone'],'CampaignId':_0x3f09b7['id']}})[_0x714c('0x15')](function(_0x183aca){if(!_[_0x714c('0x14')](_0x183aca)){throw new Error(_0x714c('0x1b')+_0x5b3eae['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3f09b7['id']);}return _0x30464f[_0x714c('0x24')][_0x714c('0x1a')]({'where':{'calleridnum':_0x5b3eae[_0x714c('0xa')],'CampaignId':_0x3f09b7['id']}});})[_0x714c('0x15')](function(_0x228a23){if(!_[_0x714c('0x14')](_0x228a23)){throw new Error(_0x714c('0x25')+_0x5b3eae['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x3f09b7['id']);}return _0x30464f['CmHopper'][_0x714c('0x1e')]({'phone':_0x5b3eae[_0x714c('0xa')],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae[_0x714c('0x1f')],'priority':_0x5b3eae['priority']?_0x5b3eae[_0x714c('0x20')]:0x2,'scheduledat':_0x5b3eae[_0x714c('0x12')]?_0x5b3eae[_0x714c('0x12')]:moment()[_0x714c('0x21')](_0x714c('0x13')),'callback':_0x5b3eae[_0x714c('0x22')]?!![]:![],'callbackuniqueid':_0x5b3eae[_0x714c('0x22')]?_0x5b3eae[_0x714c('0x22')]:undefined,'callbackat':_0x5b3eae[_0x714c('0x22')]?moment()[_0x714c('0x21')](_0x714c('0x13')):undefined,'CampaignId':_0x3f09b7['id']});})[_0x714c('0x2d')](function(_0x544b03){_0x11c672(_0x544b03);});});});};if(_0x5b3eae[_0x714c('0x1f')]){_0x30464f['VoiceQueue'][_0x714c('0x2e')]({'where':{'type':_0x714c('0x2f')},'attributes':['id',_0x714c('0x30'),'dialTimezone'],'include':[{'model':_0x30464f[_0x714c('0x31')],'as':_0x714c('0x32'),'where':{'id':_0x5b3eae[_0x714c('0x1f')]}}]})['then'](function(_0x5aeb49){if(_0x5aeb49){var _0x835f43=[];for(var _0x1ec39e=0x0,_0x160a37;_0x1ec39e<_0x5aeb49[_0x714c('0x33')];_0x1ec39e+=0x1){_0x160a37=_0x5aeb49[_0x1ec39e][_0x714c('0x34')]({'plain':!![]});switch(_0x160a37[_0x714c('0x30')]){case _0x714c('0x35'):_0xabeb41(_0x160a37)[_0x714c('0x2d')](_0x409948());break;case _0x714c('0x36'):_0x38264e(_0x160a37)[_0x714c('0x2d')](_0x409948());break;default:_0xbfa1c7(_0x160a37,_0x5b3eae)[_0x714c('0x15')](function(_0xf5d3b4){_0x5b3eae[_0x714c('0x12')]=_0xf5d3b4[_0x714c('0x19')];_0x30464f['CmHopper'][_0x714c('0x1e')]({'phone':_0x5b3eae['phone'],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae[_0x714c('0x1f')],'scheduledat':_0x5b3eae[_0x714c('0x12')]?_0x5b3eae['scheduledat']:moment()[_0x714c('0x21')](_0x714c('0x13')),'priority':_0x5b3eae[_0x714c('0x20')]?_0x5b3eae[_0x714c('0x20')]:0x2,'callback':_0x5b3eae[_0x714c('0x22')]?!![]:![],'callbackuniqueid':_0x5b3eae[_0x714c('0x22')]?_0x5b3eae[_0x714c('0x22')]:undefined,'callbackat':_0x5b3eae[_0x714c('0x22')]?moment()['format'](_0x714c('0x13')):undefined,'VoiceQueueId':_0x160a37['id']})[_0x714c('0x2d')](_0x409948());});}}}})[_0x714c('0x15')](function(){return _0x30464f['VoiceQueue'][_0x714c('0x2e')]({'where':{'type':_0x714c('0x2f')},'attributes':['id'],'include':[{'model':_0x30464f['CmList'],'as':_0x714c('0x37'),'where':{'id':_0x5b3eae['ListId']}}]})[_0x714c('0x15')](function(_0x1559b4){if(_0x1559b4){var _0x158dee=[];for(var _0x5f3988=0x0,_0x1c55df;_0x5f3988<_0x1559b4[_0x714c('0x33')];_0x5f3988+=0x1){_0x1c55df=_0x1559b4[_0x5f3988][_0x714c('0x34')]({'plain':!![]});_0x30464f[_0x714c('0x38')][_0x714c('0x1e')]({'phone':_0x5b3eae[_0x714c('0xa')],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae['ListId'],'VoiceQueueId':_0x1c55df['id']})['catch'](function(_0x21288c){logger[_0x714c('0x26')]('cmContact,\x20%s,\x20%s',_0x714c('0x27'),_0x21288c[_0x714c('0x39')]);});}}});})[_0x714c('0x15')](function(){return _0x30464f[_0x714c('0x29')][_0x714c('0x2e')]({'attributes':['id','dialCheckDuplicateType',_0x714c('0x16')],'include':[{'model':_0x30464f['CmList'],'as':'Lists','where':{'id':_0x5b3eae[_0x714c('0x1f')]}}]})['then'](function(_0x288870){if(_0x288870){var _0x5e3b5e=[];for(var _0x56517f=0x0,_0x595e5b;_0x56517f<_0x288870[_0x714c('0x33')];_0x56517f+=0x1){_0x595e5b=_0x288870[_0x56517f][_0x714c('0x34')]({'plain':!![]});switch(_0x595e5b[_0x714c('0x30')]){case _0x714c('0x35'):_0x23a52a(_0x595e5b)[_0x714c('0x2d')](_0x4bf6c1());break;case'onlyIfOpen':_0x3ac09b(_0x595e5b)[_0x714c('0x2d')](_0x4bf6c1());break;default:_0x30464f[_0x714c('0x1d')][_0x714c('0x1e')]({'phone':_0x5b3eae[_0x714c('0xa')],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae['ListId'],'scheduledat':_0x5b3eae[_0x714c('0x12')]?_0x5b3eae['scheduledat']:moment()[_0x714c('0x21')](_0x714c('0x13')),'priority':_0x5b3eae['priority']?_0x5b3eae[_0x714c('0x20')]:0x2,'callback':_0x5b3eae['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5b3eae[_0x714c('0x22')]?_0x5b3eae[_0x714c('0x22')]:undefined,'callbackat':_0x5b3eae[_0x714c('0x22')]?moment()[_0x714c('0x21')](_0x714c('0x13')):undefined,'CampaignId':_0x595e5b['id']})['catch'](_0x4bf6c1());}}}});})[_0x714c('0x15')](function(){return _0x30464f[_0x714c('0x29')][_0x714c('0x2e')]({'attributes':['id'],'include':[{'model':_0x30464f[_0x714c('0x31')],'as':_0x714c('0x37'),'where':{'id':_0x5b3eae[_0x714c('0x1f')]}}]})[_0x714c('0x15')](function(_0x350a74){if(_0x350a74){var _0x11785f=[];for(var _0x525f73=0x0,_0x4833bf;_0x525f73<_0x350a74['length'];_0x525f73+=0x1){_0x4833bf=_0x350a74[_0x525f73][_0x714c('0x34')]({'plain':!![]});_0x30464f[_0x714c('0x38')][_0x714c('0x1e')]({'phone':_0x5b3eae[_0x714c('0xa')],'ContactId':_0x5b3eae['id'],'ListId':_0x5b3eae['ListId'],'CampaignId':_0x4833bf['id']})['catch'](function(_0x1df228){logger[_0x714c('0x26')](_0x714c('0x3a'),_0x714c('0x27'),_0x1df228[_0x714c('0x39')]);});}}});})[_0x714c('0x15')](function(){_0x4614ec();})[_0x714c('0x2d')](function(_0x21526f){logger[_0x714c('0x26')](_0x714c('0x3a'),_0x714c('0x27'),_0x21526f[_0x714c('0x39')]);_0x4614ec(_0x21526f);});}else{_0x4614ec(new Error(_0x714c('0x3b')));}},'afterDestroy':function(_0x973171,_0x4e31c7,_0x356857){var _0x4aad2c=_0x1aeb06[_0x714c('0x10')];var _0x572e67=_0x973171['get']({'plain':!![]});return _0x4aad2c[_0x714c('0x1d')]['findAll']({'raw':!![],'where':{'ListId':_0x572e67['ListId'],'ContactId':_0x572e67['id']}})[_0x714c('0x15')](function(_0xb119cd){if(!_[_0x714c('0x3c')](_0xb119cd)){var _0x5853ae=[];for(var _0x19b252=0x0;_0x19b252<_0xb119cd[_0x714c('0x33')];_0x19b252+=0x1){var _0x3b0faf=_0x4aad2c['CmHopper'][_0x714c('0x3d')]({'where':{'ListId':_0xb119cd[_0x19b252]['ListId'],'ContactId':_0xb119cd[_0x19b252]['ContactId'],'VoiceQueueId':_0xb119cd[_0x19b252][_0x714c('0x3e')],'CampaignId':_0xb119cd[_0x19b252]['CampaignId']}});_0x5853ae[_0x714c('0x3f')](_0x3b0faf);}return BPromise[_0x714c('0x40')](_0x5853ae);}})['then'](function(_0x166906){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0x714c('0x28')](_0x166906,{'showHidden':![],'depth':null}));_0x356857();})[_0x714c('0x2d')](function(_0x4af718){logger[_0x714c('0x26')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x4af718,{'showHidden':![],'depth':null}));_0x356857(_0x4af718);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index c8ab40c..17d0fd3 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 _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});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 respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\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(_0x22694d,_0x4ff16f){var _0x27deb4=function(_0x122bce){while(--_0x122bce){_0x22694d['push'](_0x22694d['shift']());}};_0x27deb4(++_0x4ff16f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 6f814f9..4b5fa5f 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 _0xf4dd=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x5bdc10,_0x134fc3){_0x5bdc10=_0x5bdc10-0x0;var _0x22bf72=_0xf4dd[_0x5bdc10];return _0x22bf72;};'use strict';var Sequelize=require(_0xdf4d('0x0'));module[_0xdf4d('0x1')]={'CmContactId':{'type':Sequelize[_0xdf4d('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xdf4d('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xdf4d('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xdf4d('0x3')],'defaultValue':_0xdf4d('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xdf4d('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x38c3=['INTEGER','PHONE','sequelize','exports','STRING'];(function(_0x1b619b,_0x3fc625){var _0x3f7f24=function(_0x59ecec){while(--_0x59ecec){_0x1b619b['push'](_0x1b619b['shift']());}};_0x3f7f24(++_0x3fc625);}(_0x38c3,0x13d));var _0x338c=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0x38c3[_0x3396cd];return _0x2d6b4a;};'use strict';var Sequelize=require(_0x338c('0x0'));module[_0x338c('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x338c('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x338c('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x338c('0x2')],'defaultValue':_0x338c('0x4')},'OrderBy':{'type':Sequelize[_0x338c('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x338c('0x2')],'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 2a3cf92..f3ef93e 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 _0x3ac3=['set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x58df23,_0x3e9eb9){var _0x2fcd18=function(_0x5f4e06){while(--_0x5f4e06){_0x58df23['push'](_0x58df23['shift']());}};_0x2fcd18(++_0x3e9eb9);}(_0x3ac3,0x1c7));var _0x33ac=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x3ac3[_0x38eb23];return _0x48506a;};'use strict';var emlformat=require(_0x33ac('0x0'));var rimraf=require(_0x33ac('0x1'));var zipdir=require(_0x33ac('0x2'));var jsonpatch=require(_0x33ac('0x3'));var rp=require('request-promise');var moment=require(_0x33ac('0x4'));var BPromise=require(_0x33ac('0x5'));var Mustache=require('mustache');var util=require(_0x33ac('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x33ac('0x7'));var ejs=require(_0x33ac('0x8'));var fs=require('fs');var fs_extra=require(_0x33ac('0x9'));var _=require(_0x33ac('0xa'));var squel=require('squel');var crypto=require(_0x33ac('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x33ac('0xc'));var toCsv=require(_0x33ac('0x7'));var querystring=require(_0x33ac('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x33ac('0xe'));var qs=require(_0x33ac('0xf'));var as=require(_0x33ac('0x10'));var hardwareService=require(_0x33ac('0x11'));var logger=require(_0x33ac('0x12'))(_0x33ac('0x13'));var utils=require(_0x33ac('0x14'));var config=require(_0x33ac('0x15'));var licenseUtil=require(_0x33ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e3d7a,_0x3c2493){_0x3c2493=_0x3c2493||0xcc;return function(_0x372d2e){if(_0x372d2e){return _0x2e3d7a[_0x33ac('0x17')](_0x3c2493);}return _0x2e3d7a[_0x33ac('0x18')](_0x3c2493)[_0x33ac('0x19')]();};}function respondWithResult(_0x16185d,_0x604cf1){_0x604cf1=_0x604cf1||0xc8;return function(_0x12c220){if(_0x12c220){return _0x16185d[_0x33ac('0x18')](_0x604cf1)[_0x33ac('0x1a')](_0x12c220);}};}function respondWithFilteredResult(_0x305a4a,_0x1c43ec){return function(_0x53c538){if(_0x53c538){var _0xd750b0=typeof _0x1c43ec[_0x33ac('0x1b')]===_0x33ac('0x1c')&&typeof _0x1c43ec['limit']===_0x33ac('0x1c');var _0x3c2ad9=_0x53c538[_0x33ac('0x1d')];var _0x305105=_0xd750b0?0x0:_0x1c43ec[_0x33ac('0x1b')];var _0x515021=_0xd750b0?_0x53c538[_0x33ac('0x1d')]:_0x1c43ec[_0x33ac('0x1b')]+_0x1c43ec[_0x33ac('0x1e')];var _0x1de204;if(_0x515021>=_0x3c2ad9){_0x515021=_0x3c2ad9;_0x1de204=0xc8;}else{_0x1de204=0xce;}_0x305a4a[_0x33ac('0x18')](_0x1de204);return _0x305a4a[_0x33ac('0x1f')](_0x33ac('0x20'),_0x305105+'-'+_0x515021+'/'+_0x3c2ad9)[_0x33ac('0x1a')](_0x53c538);}return null;};}function patchUpdates(_0x13cb5e){return function(_0x489f42){try{jsonpatch[_0x33ac('0x21')](_0x489f42,_0x13cb5e,!![]);}catch(_0x189ec9){return BPromise[_0x33ac('0x22')](_0x189ec9);}return _0x489f42[_0x33ac('0x23')]();};}function saveUpdates(_0x31da90,_0x4bc156){return function(_0x1ce3dd){if(_0x1ce3dd){return _0x1ce3dd[_0x33ac('0x24')](_0x31da90)[_0x33ac('0x25')](function(_0x334f8e){return _0x334f8e;});}return null;};}function removeEntity(_0x2ed09c,_0x4fd7b1){return function(_0x37d1aa){if(_0x37d1aa){return _0x37d1aa[_0x33ac('0x26')]()[_0x33ac('0x25')](function(){var _0x7bdbac=_0x37d1aa[_0x33ac('0x27')]({'plain':!![]});var _0x4c6fcc='CmContactHasItems';return db[_0x33ac('0x28')][_0x33ac('0x26')]({'where':{'type':_0x4c6fcc,'resourceId':_0x7bdbac['id']}})[_0x33ac('0x25')](function(){return _0x37d1aa;});})['then'](function(){_0x2ed09c[_0x33ac('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a55a9,_0x286331){return function(_0x4e928a){if(!_0x4e928a){_0x2a55a9[_0x33ac('0x17')](0x194);}return _0x4e928a;};}function handleError(_0x2a9e0a,_0xfa35af){_0xfa35af=_0xfa35af||0x1f4;return function(_0x1360be){logger['error'](_0x1360be[_0x33ac('0x29')]);if(_0x1360be[_0x33ac('0x2a')]){delete _0x1360be['name'];}_0x2a9e0a[_0x33ac('0x18')](_0xfa35af)[_0x33ac('0x2b')](_0x1360be);};}exports['index']=function(_0x1745d5,_0x555609){var _0x4e46d5={},_0xec3d62={},_0x2d3839={'count':0x0,'rows':[]};var _0x101f6e=_[_0x33ac('0x2c')](db[_0x33ac('0x2d')][_0x33ac('0x2e')],function(_0x42a7df){return{'name':_0x42a7df[_0x33ac('0x2f')],'type':_0x42a7df[_0x33ac('0x30')][_0x33ac('0x31')]};});_0xec3d62[_0x33ac('0x32')]=_[_0x33ac('0x2c')](_0x101f6e,'name');_0xec3d62['query']=_[_0x33ac('0x33')](_0x1745d5[_0x33ac('0x34')]);_0xec3d62[_0x33ac('0x35')]=_[_0x33ac('0x36')](_0xec3d62['model'],_0xec3d62[_0x33ac('0x34')]);_0x4e46d5[_0x33ac('0x37')]=_[_0x33ac('0x36')](_0xec3d62[_0x33ac('0x32')],qs[_0x33ac('0x38')](_0x1745d5[_0x33ac('0x34')][_0x33ac('0x38')]));_0x4e46d5[_0x33ac('0x37')]=_0x4e46d5[_0x33ac('0x37')]['length']?_0x4e46d5[_0x33ac('0x37')]:_0xec3d62[_0x33ac('0x32')];if(!_0x1745d5[_0x33ac('0x34')][_0x33ac('0x39')]('nolimit')){_0x4e46d5[_0x33ac('0x1e')]=qs[_0x33ac('0x1e')](_0x1745d5[_0x33ac('0x34')]['limit']);_0x4e46d5[_0x33ac('0x1b')]=qs[_0x33ac('0x1b')](_0x1745d5[_0x33ac('0x34')]['offset']);}_0x4e46d5[_0x33ac('0x3a')]=qs['sort'](_0x1745d5[_0x33ac('0x34')]['sort']);_0x4e46d5[_0x33ac('0x3b')]=qs[_0x33ac('0x35')](_[_0x33ac('0x3c')](_0x1745d5[_0x33ac('0x34')],_0xec3d62[_0x33ac('0x35')]),_0x101f6e);if(_0x1745d5[_0x33ac('0x34')][_0x33ac('0x3d')]){_0x4e46d5['where']=_[_0x33ac('0x3e')](_0x4e46d5[_0x33ac('0x3b')],{'$or':_['map'](_0x101f6e,function(_0x11716f){if(_0x11716f[_0x33ac('0x30')]!==_0x33ac('0x3f')){var _0x86858c={};_0x86858c[_0x11716f['name']]={'$like':'%'+_0x1745d5[_0x33ac('0x34')]['filter']+'%'};return _0x86858c;}})});}_0x4e46d5=_['merge']({},_0x4e46d5,_0x1745d5[_0x33ac('0x40')]);var _0xd7ad17={'where':_0x4e46d5['where']};return db[_0x33ac('0x2d')][_0x33ac('0x1d')](_0xd7ad17)['then'](function(_0x173422){_0x2d3839[_0x33ac('0x1d')]=_0x173422;if(_0x1745d5[_0x33ac('0x34')][_0x33ac('0x41')]){_0x4e46d5[_0x33ac('0x42')]=[{'all':!![]}];}return db[_0x33ac('0x2d')]['findAll'](_0x4e46d5);})['then'](function(_0x4d635b){_0x2d3839[_0x33ac('0x43')]=_0x4d635b;return _0x2d3839;})[_0x33ac('0x25')](respondWithFilteredResult(_0x555609,_0x4e46d5))['catch'](handleError(_0x555609,null));};exports[_0x33ac('0x44')]=function(_0x35e64b,_0x316417){var _0x10a511={'raw':!![],'where':{'id':_0x35e64b[_0x33ac('0x45')]['id']}},_0x322e33={};_0x322e33[_0x33ac('0x32')]=_[_0x33ac('0x33')](db[_0x33ac('0x2d')][_0x33ac('0x2e')]);_0x322e33[_0x33ac('0x34')]=_[_0x33ac('0x33')](_0x35e64b[_0x33ac('0x34')]);_0x322e33['filters']=_['intersection'](_0x322e33[_0x33ac('0x32')],_0x322e33['query']);_0x10a511[_0x33ac('0x37')]=_[_0x33ac('0x36')](_0x322e33[_0x33ac('0x32')],qs['fields'](_0x35e64b[_0x33ac('0x34')][_0x33ac('0x38')]));_0x10a511[_0x33ac('0x37')]=_0x10a511[_0x33ac('0x37')]['length']?_0x10a511[_0x33ac('0x37')]:_0x322e33['model'];if(_0x35e64b[_0x33ac('0x34')][_0x33ac('0x41')]){_0x10a511[_0x33ac('0x42')]=[{'all':!![]}];}_0x10a511=_['merge']({},_0x10a511,_0x35e64b[_0x33ac('0x40')]);return db[_0x33ac('0x2d')][_0x33ac('0x46')](_0x10a511)[_0x33ac('0x25')](handleEntityNotFound(_0x316417,null))[_0x33ac('0x25')](respondWithResult(_0x316417,null))[_0x33ac('0x47')](handleError(_0x316417,null));};exports['create']=function(_0x1ced32,_0x460742){return db['CmContactHasItem']['create'](_0x1ced32[_0x33ac('0x48')],{})[_0x33ac('0x25')](function(_0x23cad1){var _0x5ef6ff=_0x1ced32[_0x33ac('0x49')][_0x33ac('0x27')]({'plain':!![]});if(!_0x5ef6ff)throw new Error(_0x33ac('0x4a'));if(_0x5ef6ff[_0x33ac('0x4b')]===_0x33ac('0x49')){var _0x5bf2ae=_0x23cad1[_0x33ac('0x27')]({'plain':!![]});var _0x551553=_0x33ac('0x4c');return db[_0x33ac('0x4d')][_0x33ac('0x46')]({'where':{'name':_0x551553,'userProfileId':_0x5ef6ff['userProfileId']},'raw':!![]})['then'](function(_0x510fd9){if(_0x510fd9&&_0x510fd9[_0x33ac('0x4e')]===0x0){return db[_0x33ac('0x28')]['create']({'name':_0x5bf2ae[_0x33ac('0x2a')],'resourceId':_0x5bf2ae['id'],'type':_0x510fd9[_0x33ac('0x2a')],'sectionId':_0x510fd9['id']},{})[_0x33ac('0x25')](function(){return _0x23cad1;});}else{return _0x23cad1;}})[_0x33ac('0x47')](function(_0x2b9f90){logger[_0x33ac('0x4f')](_0x33ac('0x50'),_0x2b9f90);throw _0x2b9f90;});}return _0x23cad1;})['then'](respondWithResult(_0x460742,0xc9))[_0x33ac('0x47')](handleError(_0x460742,null));};exports[_0x33ac('0x24')]=function(_0x4d632b,_0x592110){if(_0x4d632b[_0x33ac('0x48')]['id']){delete _0x4d632b[_0x33ac('0x48')]['id'];}return db[_0x33ac('0x2d')]['find']({'where':{'id':_0x4d632b[_0x33ac('0x45')]['id']}})[_0x33ac('0x25')](handleEntityNotFound(_0x592110,null))[_0x33ac('0x25')](saveUpdates(_0x4d632b[_0x33ac('0x48')],null))[_0x33ac('0x25')](respondWithResult(_0x592110,null))[_0x33ac('0x47')](handleError(_0x592110,null));};exports[_0x33ac('0x26')]=function(_0x153860,_0x5ee83c){return db[_0x33ac('0x2d')][_0x33ac('0x46')]({'where':{'id':_0x153860[_0x33ac('0x45')]['id']}})[_0x33ac('0x25')](handleEntityNotFound(_0x5ee83c,null))[_0x33ac('0x25')](removeEntity(_0x5ee83c,null))[_0x33ac('0x47')](handleError(_0x5ee83c,null));}; \ No newline at end of file +var _0xd728=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','CmContactHasItem','rows','show','params','rawAttributes','find','create'];(function(_0x89bb32,_0x2b2a2c){var _0x5acf8a=function(_0x32214e){while(--_0x32214e){_0x89bb32['push'](_0x89bb32['shift']());}};_0x5acf8a(++_0x2b2a2c);}(_0xd728,0x15b));var _0x8d72=function(_0x2bf3de,_0x5b5c16){_0x2bf3de=_0x2bf3de-0x0;var _0x133dc4=_0xd728[_0x2bf3de];return _0x133dc4;};'use strict';var emlformat=require(_0x8d72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d72('0x2'));var moment=require(_0x8d72('0x3'));var BPromise=require(_0x8d72('0x4'));var Mustache=require(_0x8d72('0x5'));var util=require('util');var path=require(_0x8d72('0x6'));var sox=require(_0x8d72('0x7'));var csv=require('to-csv');var ejs=require(_0x8d72('0x8'));var fs=require('fs');var fs_extra=require(_0x8d72('0x9'));var _=require(_0x8d72('0xa'));var squel=require(_0x8d72('0xb'));var crypto=require(_0x8d72('0xc'));var jsforce=require(_0x8d72('0xd'));var deskjs=require(_0x8d72('0xe'));var toCsv=require(_0x8d72('0xf'));var querystring=require(_0x8d72('0x10'));var Papa=require(_0x8d72('0x11'));var Redis=require(_0x8d72('0x12'));var authService=require(_0x8d72('0x13'));var qs=require(_0x8d72('0x14'));var as=require(_0x8d72('0x15'));var hardwareService=require(_0x8d72('0x16'));var logger=require(_0x8d72('0x17'))(_0x8d72('0x18'));var utils=require('../../config/utils');var config=require(_0x8d72('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d72('0x1a'))['db'];function respondWithStatusCode(_0x3b617e,_0x4ab273){_0x4ab273=_0x4ab273||0xcc;return function(_0x5da623){if(_0x5da623){return _0x3b617e[_0x8d72('0x1b')](_0x4ab273);}return _0x3b617e[_0x8d72('0x1c')](_0x4ab273)[_0x8d72('0x1d')]();};}function respondWithResult(_0x584c78,_0x5c4b35){_0x5c4b35=_0x5c4b35||0xc8;return function(_0xd914c8){if(_0xd914c8){return _0x584c78[_0x8d72('0x1c')](_0x5c4b35)['json'](_0xd914c8);}};}function respondWithFilteredResult(_0x3687df,_0x28e11d){return function(_0x21412b){if(_0x21412b){var _0x3f174e=typeof _0x28e11d['offset']===_0x8d72('0x1e')&&typeof _0x28e11d['limit']===_0x8d72('0x1e');var _0x379c92=_0x21412b[_0x8d72('0x1f')];var _0x5a155b=_0x3f174e?0x0:_0x28e11d[_0x8d72('0x20')];var _0x51019c=_0x3f174e?_0x21412b[_0x8d72('0x1f')]:_0x28e11d['offset']+_0x28e11d[_0x8d72('0x21')];var _0x262d08;if(_0x51019c>=_0x379c92){_0x51019c=_0x379c92;_0x262d08=0xc8;}else{_0x262d08=0xce;}_0x3687df[_0x8d72('0x1c')](_0x262d08);return _0x3687df[_0x8d72('0x22')](_0x8d72('0x23'),_0x5a155b+'-'+_0x51019c+'/'+_0x379c92)['json'](_0x21412b);}return null;};}function patchUpdates(_0x4b3abf){return function(_0x551f8b){try{jsonpatch[_0x8d72('0x24')](_0x551f8b,_0x4b3abf,!![]);}catch(_0x2e3183){return BPromise[_0x8d72('0x25')](_0x2e3183);}return _0x551f8b[_0x8d72('0x26')]();};}function saveUpdates(_0x195fd1,_0x167c1d){return function(_0x39ce84){if(_0x39ce84){return _0x39ce84[_0x8d72('0x27')](_0x195fd1)['then'](function(_0x139222){return _0x139222;});}return null;};}function removeEntity(_0x17cb48,_0x1a8d1c){return function(_0x47382a){if(_0x47382a){return _0x47382a['destroy']()[_0x8d72('0x28')](function(){var _0x58d2f8=_0x47382a[_0x8d72('0x29')]({'plain':!![]});var _0x5b3bc6=_0x8d72('0x2a');return db[_0x8d72('0x2b')][_0x8d72('0x2c')]({'where':{'type':_0x5b3bc6,'resourceId':_0x58d2f8['id']}})[_0x8d72('0x28')](function(){return _0x47382a;});})[_0x8d72('0x28')](function(){_0x17cb48[_0x8d72('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bd376,_0x31af0b){return function(_0x3bd357){if(!_0x3bd357){_0x3bd376['sendStatus'](0x194);}return _0x3bd357;};}function handleError(_0x31bf7f,_0x5a5982){_0x5a5982=_0x5a5982||0x1f4;return function(_0x5260ed){logger[_0x8d72('0x2d')](_0x5260ed[_0x8d72('0x2e')]);if(_0x5260ed[_0x8d72('0x2f')]){delete _0x5260ed[_0x8d72('0x2f')];}_0x31bf7f[_0x8d72('0x1c')](_0x5a5982)['send'](_0x5260ed);};}exports[_0x8d72('0x30')]=function(_0x9f30fb,_0x4a16ec){var _0x8bbd3e={},_0x52fbc6={},_0x6686ab={'count':0x0,'rows':[]};var _0xc78a24=_[_0x8d72('0x31')](db['CmContactHasItem']['rawAttributes'],function(_0x536794){return{'name':_0x536794[_0x8d72('0x32')],'type':_0x536794[_0x8d72('0x33')][_0x8d72('0x34')]};});_0x52fbc6[_0x8d72('0x35')]=_['map'](_0xc78a24,_0x8d72('0x2f'));_0x52fbc6[_0x8d72('0x36')]=_[_0x8d72('0x37')](_0x9f30fb[_0x8d72('0x36')]);_0x52fbc6[_0x8d72('0x38')]=_['intersection'](_0x52fbc6['model'],_0x52fbc6['query']);_0x8bbd3e[_0x8d72('0x39')]=_[_0x8d72('0x3a')](_0x52fbc6[_0x8d72('0x35')],qs[_0x8d72('0x3b')](_0x9f30fb[_0x8d72('0x36')][_0x8d72('0x3b')]));_0x8bbd3e[_0x8d72('0x39')]=_0x8bbd3e[_0x8d72('0x39')][_0x8d72('0x3c')]?_0x8bbd3e[_0x8d72('0x39')]:_0x52fbc6['model'];if(!_0x9f30fb[_0x8d72('0x36')][_0x8d72('0x3d')]('nolimit')){_0x8bbd3e[_0x8d72('0x21')]=qs['limit'](_0x9f30fb[_0x8d72('0x36')][_0x8d72('0x21')]);_0x8bbd3e[_0x8d72('0x20')]=qs[_0x8d72('0x20')](_0x9f30fb['query']['offset']);}_0x8bbd3e['order']=qs[_0x8d72('0x3e')](_0x9f30fb[_0x8d72('0x36')]['sort']);_0x8bbd3e[_0x8d72('0x3f')]=qs[_0x8d72('0x38')](_[_0x8d72('0x40')](_0x9f30fb[_0x8d72('0x36')],_0x52fbc6[_0x8d72('0x38')]),_0xc78a24);if(_0x9f30fb['query'][_0x8d72('0x41')]){_0x8bbd3e[_0x8d72('0x3f')]=_['merge'](_0x8bbd3e[_0x8d72('0x3f')],{'$or':_[_0x8d72('0x31')](_0xc78a24,function(_0x338ffa){if(_0x338ffa[_0x8d72('0x33')]!==_0x8d72('0x42')){var _0x28cb21={};_0x28cb21[_0x338ffa[_0x8d72('0x2f')]]={'$like':'%'+_0x9f30fb[_0x8d72('0x36')]['filter']+'%'};return _0x28cb21;}})});}_0x8bbd3e=_[_0x8d72('0x43')]({},_0x8bbd3e,_0x9f30fb[_0x8d72('0x44')]);var _0x15d5f6={'where':_0x8bbd3e[_0x8d72('0x3f')]};return db['CmContactHasItem'][_0x8d72('0x1f')](_0x15d5f6)['then'](function(_0x15d121){_0x6686ab['count']=_0x15d121;if(_0x9f30fb[_0x8d72('0x36')][_0x8d72('0x45')]){_0x8bbd3e[_0x8d72('0x46')]=[{'all':!![]}];}return db[_0x8d72('0x47')]['findAll'](_0x8bbd3e);})[_0x8d72('0x28')](function(_0x4118f7){_0x6686ab[_0x8d72('0x48')]=_0x4118f7;return _0x6686ab;})[_0x8d72('0x28')](respondWithFilteredResult(_0x4a16ec,_0x8bbd3e))['catch'](handleError(_0x4a16ec,null));};exports[_0x8d72('0x49')]=function(_0x4e834c,_0x23f17d){var _0x5148b7={'raw':!![],'where':{'id':_0x4e834c[_0x8d72('0x4a')]['id']}},_0x56f510={};_0x56f510[_0x8d72('0x35')]=_['keys'](db[_0x8d72('0x47')][_0x8d72('0x4b')]);_0x56f510['query']=_[_0x8d72('0x37')](_0x4e834c[_0x8d72('0x36')]);_0x56f510[_0x8d72('0x38')]=_[_0x8d72('0x3a')](_0x56f510[_0x8d72('0x35')],_0x56f510[_0x8d72('0x36')]);_0x5148b7[_0x8d72('0x39')]=_['intersection'](_0x56f510['model'],qs[_0x8d72('0x3b')](_0x4e834c['query'][_0x8d72('0x3b')]));_0x5148b7[_0x8d72('0x39')]=_0x5148b7['attributes']['length']?_0x5148b7['attributes']:_0x56f510[_0x8d72('0x35')];if(_0x4e834c['query'][_0x8d72('0x45')]){_0x5148b7[_0x8d72('0x46')]=[{'all':!![]}];}_0x5148b7=_[_0x8d72('0x43')]({},_0x5148b7,_0x4e834c[_0x8d72('0x44')]);return db[_0x8d72('0x47')][_0x8d72('0x4c')](_0x5148b7)[_0x8d72('0x28')](handleEntityNotFound(_0x23f17d,null))[_0x8d72('0x28')](respondWithResult(_0x23f17d,null))['catch'](handleError(_0x23f17d,null));};exports[_0x8d72('0x4d')]=function(_0x385560,_0x72b6ad){return db[_0x8d72('0x47')][_0x8d72('0x4d')](_0x385560['body'],{})[_0x8d72('0x28')](function(_0x2484f8){var _0x352a0e=_0x385560[_0x8d72('0x4e')]['get']({'plain':!![]});if(!_0x352a0e)throw new Error(_0x8d72('0x4f'));if(_0x352a0e['role']===_0x8d72('0x4e')){var _0x17463a=_0x2484f8[_0x8d72('0x29')]({'plain':!![]});var _0x3c891d=_0x8d72('0x2a');return db[_0x8d72('0x50')][_0x8d72('0x4c')]({'where':{'name':_0x3c891d,'userProfileId':_0x352a0e[_0x8d72('0x51')]},'raw':!![]})['then'](function(_0x45c59c){if(_0x45c59c&&_0x45c59c[_0x8d72('0x52')]===0x0){return db[_0x8d72('0x2b')][_0x8d72('0x4d')]({'name':_0x17463a['name'],'resourceId':_0x17463a['id'],'type':_0x45c59c['name'],'sectionId':_0x45c59c['id']},{})[_0x8d72('0x28')](function(){return _0x2484f8;});}else{return _0x2484f8;}})[_0x8d72('0x53')](function(_0x2e73b8){logger[_0x8d72('0x2d')](_0x8d72('0x54'),_0x2e73b8);throw _0x2e73b8;});}return _0x2484f8;})[_0x8d72('0x28')](respondWithResult(_0x72b6ad,0xc9))[_0x8d72('0x53')](handleError(_0x72b6ad,null));};exports[_0x8d72('0x27')]=function(_0x510cb1,_0x2c12b7){if(_0x510cb1['body']['id']){delete _0x510cb1['body']['id'];}return db[_0x8d72('0x47')]['find']({'where':{'id':_0x510cb1[_0x8d72('0x4a')]['id']}})[_0x8d72('0x28')](handleEntityNotFound(_0x2c12b7,null))[_0x8d72('0x28')](saveUpdates(_0x510cb1['body'],null))[_0x8d72('0x28')](respondWithResult(_0x2c12b7,null))['catch'](handleError(_0x2c12b7,null));};exports['destroy']=function(_0x82f49e,_0x4c8162){return db[_0x8d72('0x47')][_0x8d72('0x4c')]({'where':{'id':_0x82f49e['params']['id']}})['then'](handleEntityNotFound(_0x4c8162,null))[_0x8d72('0x28')](removeEntity(_0x4c8162,null))[_0x8d72('0x53')](handleError(_0x4c8162,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index e645c11..ac8ab10 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 _0x5dea=['request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','lodash','util','moment'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x5dea,0x1ab));var _0xa5de=function(_0x1483bd,_0x32adde){_0x1483bd=_0x1483bd-0x0;var _0x166c75=_0x5dea[_0x1483bd];return _0x166c75;};'use strict';var _=require(_0xa5de('0x0'));var util=require(_0xa5de('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa5de('0x2'));var BPromise=require('bluebird');var rp=require(_0xa5de('0x3'));var fs=require('fs');var path=require(_0xa5de('0x4'));var rimraf=require('rimraf');var config=require(_0xa5de('0x5'));var attributes=require(_0xa5de('0x6'));module[_0xa5de('0x7')]=function(_0x4f2eca,_0x356247){return _0x4f2eca[_0xa5de('0x8')](_0xa5de('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a31=['bluebird','request-promise','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment'];(function(_0x520f08,_0x469f5b){var _0x4651ac=function(_0x14d451){while(--_0x14d451){_0x520f08['push'](_0x520f08['shift']());}};_0x4651ac(++_0x469f5b);}(_0x9a31,0x181));var _0x19a3=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x9a31[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x19a3('0x0'));var util=require(_0x19a3('0x1'));var logger=require(_0x19a3('0x2'))(_0x19a3('0x3'));var moment=require(_0x19a3('0x4'));var BPromise=require(_0x19a3('0x5'));var rp=require(_0x19a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19a3('0x7'));var attributes=require(_0x19a3('0x8'));module[_0x19a3('0x9')]=function(_0x9e6a03,_0x1f2929){return _0x9e6a03[_0x19a3('0xa')](_0x19a3('0xb'),attributes,{'tableName':_0x19a3('0xc'),'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 e5db3e0..cda097e 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 _0x8997=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x317183,_0x2afceb){var _0x585933=function(_0x23e84e){while(--_0x23e84e){_0x317183['push'](_0x317183['shift']());}};_0x585933(++_0x2afceb);}(_0x8997,0xd0));var _0x7899=function(_0x456867,_0x84adb7){_0x456867=_0x456867-0x0;var _0x3524b7=_0x8997[_0x456867];return _0x3524b7;};'use strict';var _=require('lodash');var util=require(_0x7899('0x0'));var moment=require(_0x7899('0x1'));var BPromise=require(_0x7899('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7899('0x3'))['db'];var utils=require(_0x7899('0x4'));var logger=require(_0x7899('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7899('0x6'));var client=jayson['client'][_0x7899('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3112a8,_0x1fbec8,_0x20357c){return new BPromise(function(_0x5df781,_0x59b81b){return client[_0x7899('0x8')](_0x3112a8,_0x20357c)['then'](function(_0x1f83d2){logger[_0x7899('0x9')](_0x7899('0xa'),_0x1fbec8,_0x7899('0xb'));logger[_0x7899('0xc')](_0x7899('0xd'),_0x1fbec8,'request\x20sent',JSON[_0x7899('0xe')](_0x1f83d2));if(_0x1f83d2['error']){if(_0x1f83d2[_0x7899('0xf')][_0x7899('0x10')]===0x1f4){logger[_0x7899('0xf')](_0x7899('0xa'),_0x1fbec8,_0x1f83d2[_0x7899('0xf')][_0x7899('0x11')]);return _0x59b81b(_0x1f83d2['error'][_0x7899('0x11')]);}logger[_0x7899('0xf')](_0x7899('0xa'),_0x1fbec8,_0x1f83d2[_0x7899('0xf')][_0x7899('0x11')]);return _0x5df781(_0x1f83d2[_0x7899('0xf')][_0x7899('0x11')]);}else{logger[_0x7899('0x9')](_0x7899('0xa'),_0x1fbec8,'request\x20sent');_0x5df781(_0x1f83d2['result'][_0x7899('0x11')]);}})[_0x7899('0x12')](function(_0x184363){logger[_0x7899('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x1fbec8,_0x184363);_0x59b81b(_0x184363);});});} \ No newline at end of file +var _0x5645=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird'];(function(_0x5db8d7,_0x370648){var _0x231930=function(_0xba47b4){while(--_0xba47b4){_0x5db8d7['push'](_0x5db8d7['shift']());}};_0x231930(++_0x370648);}(_0x5645,0x105));var _0x5564=function(_0x1d10cd,_0x29c342){_0x1d10cd=_0x1d10cd-0x0;var _0x536baa=_0x5645[_0x1d10cd];return _0x536baa;};'use strict';var _=require('lodash');var util=require(_0x5564('0x0'));var moment=require(_0x5564('0x1'));var BPromise=require(_0x5564('0x2'));var rs=require(_0x5564('0x3'));var fs=require('fs');var Redis=require(_0x5564('0x4'));var db=require(_0x5564('0x5'))['db'];var utils=require(_0x5564('0x6'));var logger=require(_0x5564('0x7'))(_0x5564('0x8'));var config=require(_0x5564('0x9'));var jayson=require(_0x5564('0xa'));var client=jayson[_0x5564('0xb')][_0x5564('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2aafb7,_0x69cdcc,_0x179977){return new BPromise(function(_0x18c124,_0x1bed67){return client[_0x5564('0xd')](_0x2aafb7,_0x179977)[_0x5564('0xe')](function(_0x5c058e){logger[_0x5564('0xf')](_0x5564('0x10'),_0x69cdcc,'request\x20sent');logger['debug'](_0x5564('0x11'),_0x69cdcc,_0x5564('0x12'),JSON['stringify'](_0x5c058e));if(_0x5c058e['error']){if(_0x5c058e[_0x5564('0x13')][_0x5564('0x14')]===0x1f4){logger[_0x5564('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x69cdcc,_0x5c058e['error'][_0x5564('0x15')]);return _0x1bed67(_0x5c058e[_0x5564('0x13')][_0x5564('0x15')]);}logger[_0x5564('0x13')](_0x5564('0x10'),_0x69cdcc,_0x5c058e['error'][_0x5564('0x15')]);return _0x18c124(_0x5c058e[_0x5564('0x13')][_0x5564('0x15')]);}else{logger[_0x5564('0xf')](_0x5564('0x10'),_0x69cdcc,'request\x20sent');_0x18c124(_0x5c058e[_0x5564('0x16')]['message']);}})[_0x5564('0x17')](function(_0x4d5192){logger[_0x5564('0x13')](_0x5564('0x10'),_0x69cdcc,_0x4d5192);_0x1bed67(_0x4d5192);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 9e45717..fc455cf 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 _0xd7ab=['fs-extra','./cmContactHasItem.controller','index','get','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x309d17,_0x1dadfe){var _0x4a9de1=function(_0x51c245){while(--_0x51c245){_0x309d17['push'](_0x309d17['shift']());}};_0x4a9de1(++_0x1dadfe);}(_0xd7ab,0x14e));var _0xbd7a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd7ab[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xbd7a('0x0'));var util=require(_0xbd7a('0x1'));var path=require(_0xbd7a('0x2'));var timeout=require(_0xbd7a('0x3'));var express=require(_0xbd7a('0x4'));var router=express[_0xbd7a('0x5')]();var fs_extra=require(_0xbd7a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbd7a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbd7a('0x8')]);router[_0xbd7a('0x9')](_0xbd7a('0xa'),auth['isAuthenticated'](),controller[_0xbd7a('0xb')]);router[_0xbd7a('0xc')]('/',auth['isAuthenticated'](),controller[_0xbd7a('0xd')]);router['put'](_0xbd7a('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbd7a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xbd7a('0xf')]);module[_0xbd7a('0x10')]=router; \ No newline at end of file +var _0xe537=['../../components/interaction/service','./cmContactHasItem.controller','isAuthenticated','get','show','post','create','/:id','update','delete','destroy','util','connect-timeout','fs-extra'];(function(_0x45505a,_0x59368a){var _0x36a1f6=function(_0x2f4542){while(--_0x2f4542){_0x45505a['push'](_0x45505a['shift']());}};_0x36a1f6(++_0x59368a);}(_0xe537,0x13f));var _0x7e53=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0xe537[_0xbc346f];return _0x9f9260;};'use strict';var multer=require('multer');var util=require(_0x7e53('0x0'));var path=require('path');var timeout=require(_0x7e53('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7e53('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7e53('0x3'));var config=require('../../config/environment');var controller=require(_0x7e53('0x4'));router['get']('/',auth[_0x7e53('0x5')](),controller['index']);router[_0x7e53('0x6')]('/:id',auth[_0x7e53('0x5')](),controller[_0x7e53('0x7')]);router[_0x7e53('0x8')]('/',auth[_0x7e53('0x5')](),controller[_0x7e53('0x9')]);router['put'](_0x7e53('0xa'),auth['isAuthenticated'](),controller[_0x7e53('0xb')]);router[_0x7e53('0xc')](_0x7e53('0xa'),auth[_0x7e53('0x5')](),controller[_0x7e53('0xd')]);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 3d1dfca..082f54f 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 _0xcc01=['setDataValue','alias','name','STRING','long','type','parse','values','stringify','BOOLEAN','ENUM','voice','lodash','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc01,0x6e));var _0x1cc0=function(_0x3e2bb7,_0x2b4f07){_0x3e2bb7=_0x3e2bb7-0x0;var _0x4b1aee=_0xcc01[_0x3e2bb7];return _0x4b1aee;};'use strict';var Sequelize=require('sequelize');var _=require(_0x1cc0('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x53ee72){return this[_0x1cc0('0x1')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3265dc){this[_0x1cc0('0x2')](_0x1cc0('0x3'),_0x3265dc?_0x3265dc:this[_0x1cc0('0x1')](_0x1cc0('0x4')));}},'type':{'type':Sequelize[_0x1cc0('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x1cc0('0x6')),'get':function(){if(this[_0x1cc0('0x1')](_0x1cc0('0x7'))==='select'){return JSON[_0x1cc0('0x8')](this[_0x1cc0('0x1')]('values'));}else{return this[_0x1cc0('0x1')](_0x1cc0('0x9'));}},'set':function(_0x77b809){if(Array['isArray'](_0x77b809)){this[_0x1cc0('0x2')](_0x1cc0('0x9'),JSON[_0x1cc0('0xa')](_0x77b809));}else{this['setDataValue'](_0x1cc0('0x9'),_0x77b809);}}},'required':{'type':Sequelize[_0x1cc0('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1cc0('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1cc0('0xc')](_0x1cc0('0xd'))}}; \ No newline at end of file +var _0x4567=['getDataValue','alias','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','VIRTUAL'];(function(_0x2b80f6,_0x2410a2){var _0x27fecd=function(_0x2848d9){while(--_0x2848d9){_0x2b80f6['push'](_0x2b80f6['shift']());}};_0x27fecd(++_0x2410a2);}(_0x4567,0x152));var _0x7456=function(_0x25c43f,_0x4b687b){_0x25c43f=_0x25c43f-0x0;var _0x27fecd=_0x4567[_0x25c43f];return _0x27fecd;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7456('0x0'));module['exports']={'name':{'type':Sequelize[_0x7456('0x1')],'get':function(_0x1d4ce5){return this[_0x7456('0x2')](_0x7456('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3db43d){this[_0x7456('0x4')](_0x7456('0x3'),_0x3db43d?_0x3db43d:this['getDataValue'](_0x7456('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x7456('0x6')](_0x7456('0x7')),'get':function(){if(this[_0x7456('0x2')](_0x7456('0x8'))===_0x7456('0x9')){return JSON[_0x7456('0xa')](this[_0x7456('0x2')](_0x7456('0xb')));}else{return this[_0x7456('0x2')](_0x7456('0xb'));}},'set':function(_0x51cf83){if(Array[_0x7456('0xc')](_0x51cf83)){this['setDataValue'](_0x7456('0xb'),JSON[_0x7456('0xd')](_0x51cf83));}else{this[_0x7456('0x4')](_0x7456('0xb'),_0x51cf83);}}},'required':{'type':Sequelize[_0x7456('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7456('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7456('0xf')](_0x7456('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 128b514..fc685ec 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 _0x6dc7=['reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','sort','where','pick','merge','type','VIRTUAL','findAll','rows','catch','show','includeAll','include','options','find','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','cm_contacts','cf_%d','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set'];(function(_0x569723,_0x28934d){var _0x437329=function(_0x51c9a7){while(--_0x51c9a7){_0x569723['push'](_0x569723['shift']());}};_0x437329(++_0x28934d);}(_0x6dc7,0x177));var _0x76dc=function(_0x49b098,_0x467730){_0x49b098=_0x49b098-0x0;var _0xf6dce6=_0x6dc7[_0x49b098];return _0xf6dce6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76dc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76dc('0x1'));var rp=require('request-promise');var moment=require(_0x76dc('0x2'));var BPromise=require(_0x76dc('0x3'));var Mustache=require(_0x76dc('0x4'));var util=require(_0x76dc('0x5'));var path=require('path');var sox=require(_0x76dc('0x6'));var csv=require(_0x76dc('0x7'));var ejs=require(_0x76dc('0x8'));var fs=require('fs');var fs_extra=require(_0x76dc('0x9'));var _=require(_0x76dc('0xa'));var squel=require(_0x76dc('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x76dc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x76dc('0xd'));var Papa=require(_0x76dc('0xe'));var Redis=require(_0x76dc('0xf'));var authService=require(_0x76dc('0x10'));var qs=require(_0x76dc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76dc('0x12'));var logger=require(_0x76dc('0x13'))('api');var utils=require(_0x76dc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x76dc('0x15'));var db=require(_0x76dc('0x16'))['db'];function respondWithStatusCode(_0x20da5c,_0x418a74){_0x418a74=_0x418a74||0xcc;return function(_0x3656bb){if(_0x3656bb){return _0x20da5c['sendStatus'](_0x418a74);}return _0x20da5c[_0x76dc('0x17')](_0x418a74)[_0x76dc('0x18')]();};}function respondWithResult(_0x2f8b39,_0x3f775a){_0x3f775a=_0x3f775a||0xc8;return function(_0x2de984){if(_0x2de984){return _0x2f8b39[_0x76dc('0x17')](_0x3f775a)['json'](_0x2de984);}};}function respondWithFilteredResult(_0x29f261,_0x1b851b){return function(_0x2fca1f){if(_0x2fca1f){var _0x281588=typeof _0x1b851b[_0x76dc('0x19')]===_0x76dc('0x1a')&&typeof _0x1b851b[_0x76dc('0x1b')]===_0x76dc('0x1a');var _0x22170c=_0x2fca1f[_0x76dc('0x1c')];var _0x335062=_0x281588?0x0:_0x1b851b[_0x76dc('0x19')];var _0x455d03=_0x281588?_0x2fca1f[_0x76dc('0x1c')]:_0x1b851b[_0x76dc('0x19')]+_0x1b851b[_0x76dc('0x1b')];var _0x153f45;if(_0x455d03>=_0x22170c){_0x455d03=_0x22170c;_0x153f45=0xc8;}else{_0x153f45=0xce;}_0x29f261[_0x76dc('0x17')](_0x153f45);return _0x29f261[_0x76dc('0x1d')]('Content-Range',_0x335062+'-'+_0x455d03+'/'+_0x22170c)['json'](_0x2fca1f);}return null;};}function patchUpdates(_0x5ad272){return function(_0x46b9fd){try{jsonpatch['apply'](_0x46b9fd,_0x5ad272,!![]);}catch(_0x2302db){return BPromise[_0x76dc('0x1e')](_0x2302db);}return _0x46b9fd[_0x76dc('0x1f')]();};}function saveUpdates(_0x140427,_0x1da387){return function(_0x24dfb3){if(_0x24dfb3){return _0x24dfb3[_0x76dc('0x20')](_0x140427)[_0x76dc('0x21')](function(_0x211bd7){return _0x211bd7;});}return null;};}function removeEntity(_0x35b6a2,_0x435b43){return function(_0x57c014){if(_0x57c014){return _0x57c014[_0x76dc('0x22')]()['then'](function(){_0x35b6a2['status'](0xcc)[_0x76dc('0x18')]();});}};}function handleEntityNotFound(_0x4f6a48,_0x244f0b){return function(_0x1eb602){if(!_0x1eb602){_0x4f6a48[_0x76dc('0x23')](0x194);}return _0x1eb602;};}function handleError(_0x2028f6,_0x13187f){_0x13187f=_0x13187f||0x1f4;return function(_0x2bb67f){logger[_0x76dc('0x24')](_0x2bb67f[_0x76dc('0x25')]);if(_0x2bb67f[_0x76dc('0x26')]){delete _0x2bb67f[_0x76dc('0x26')];}_0x2028f6[_0x76dc('0x17')](_0x13187f)[_0x76dc('0x27')](_0x2bb67f);};}exports[_0x76dc('0x28')]=function(_0x48c12a,_0x37d654){var _0x267c85={},_0x2d189c={},_0x2b18fe={'count':0x0,'rows':[]};var _0x2e3d70=_[_0x76dc('0x29')](db[_0x76dc('0x2a')][_0x76dc('0x2b')],function(_0x1ee4ac){return{'name':_0x1ee4ac[_0x76dc('0x2c')],'type':_0x1ee4ac['type'][_0x76dc('0x2d')]};});_0x2d189c[_0x76dc('0x2e')]=_['differenceBy'](_[_0x76dc('0x29')](_0x2e3d70,_0x76dc('0x26')),[_0x76dc('0x26')]);_0x2d189c['query']=_[_0x76dc('0x2f')](_0x48c12a[_0x76dc('0x30')]);_0x2d189c[_0x76dc('0x31')]=_[_0x76dc('0x32')](_0x2d189c['model'],_0x2d189c[_0x76dc('0x30')]);_0x267c85['attributes']=_[_0x76dc('0x32')](_0x2d189c['model'],qs[_0x76dc('0x33')](_0x48c12a[_0x76dc('0x30')][_0x76dc('0x33')]));_0x267c85[_0x76dc('0x34')]=_0x267c85[_0x76dc('0x34')]['length']?_0x267c85['attributes']:_0x2d189c[_0x76dc('0x2e')];if(!_0x48c12a['query']['hasOwnProperty']('nolimit')){_0x267c85[_0x76dc('0x1b')]=qs[_0x76dc('0x1b')](_0x48c12a[_0x76dc('0x30')]['limit']);_0x267c85[_0x76dc('0x19')]=qs['offset'](_0x48c12a[_0x76dc('0x30')][_0x76dc('0x19')]);}_0x267c85['order']=qs['sort'](_0x48c12a[_0x76dc('0x30')][_0x76dc('0x35')]);_0x267c85[_0x76dc('0x36')]=qs[_0x76dc('0x31')](_[_0x76dc('0x37')](_0x48c12a[_0x76dc('0x30')],_0x2d189c['filters']),_0x2e3d70);if(_0x48c12a[_0x76dc('0x30')]['filter']){_0x267c85['where']=_[_0x76dc('0x38')](_0x267c85[_0x76dc('0x36')],{'$or':_[_0x76dc('0x29')](_0x2e3d70,function(_0x3fbfe8){if(_0x3fbfe8[_0x76dc('0x39')]!==_0x76dc('0x3a')){var _0x1ba966={};_0x1ba966[_0x3fbfe8['name']]={'$like':'%'+_0x48c12a[_0x76dc('0x30')]['filter']+'%'};return _0x1ba966;}})});}_0x267c85=_['merge']({},_0x267c85,_0x48c12a['options']);var _0x3ecb44={'where':_0x267c85[_0x76dc('0x36')]};return db[_0x76dc('0x2a')][_0x76dc('0x1c')](_0x3ecb44)['then'](function(_0x48ae34){_0x2b18fe[_0x76dc('0x1c')]=_0x48ae34;if(_0x48c12a[_0x76dc('0x30')]['includeAll']){_0x267c85['include']=[{'all':!![]}];}return db[_0x76dc('0x2a')][_0x76dc('0x3b')](_0x267c85);})[_0x76dc('0x21')](function(_0x7ac242){_0x2b18fe[_0x76dc('0x3c')]=_0x7ac242;return _0x2b18fe;})[_0x76dc('0x21')](respondWithFilteredResult(_0x37d654,_0x267c85))[_0x76dc('0x3d')](handleError(_0x37d654,null));};exports[_0x76dc('0x3e')]=function(_0x3dcb1a,_0x2ab644){var _0x8e0b27={'raw':!![],'where':{'id':_0x3dcb1a['params']['id']}},_0x3261dd={};_0x3261dd[_0x76dc('0x2e')]=_[_0x76dc('0x2f')](db['CmCustomField']['rawAttributes']);_0x3261dd['query']=_[_0x76dc('0x2f')](_0x3dcb1a[_0x76dc('0x30')]);_0x3261dd[_0x76dc('0x31')]=_[_0x76dc('0x32')](_0x3261dd['model'],_0x3261dd['query']);_0x8e0b27[_0x76dc('0x34')]=_[_0x76dc('0x32')](_0x3261dd[_0x76dc('0x2e')],qs['fields'](_0x3dcb1a[_0x76dc('0x30')][_0x76dc('0x33')]));_0x8e0b27[_0x76dc('0x34')]=_0x8e0b27['attributes']['length']?_0x8e0b27['attributes']:_0x3261dd['model'];if(_0x3dcb1a[_0x76dc('0x30')][_0x76dc('0x3f')]){_0x8e0b27[_0x76dc('0x40')]=[{'all':!![]}];}_0x8e0b27=_[_0x76dc('0x38')]({},_0x8e0b27,_0x3dcb1a[_0x76dc('0x41')]);return db['CmCustomField'][_0x76dc('0x42')](_0x8e0b27)['then'](handleEntityNotFound(_0x2ab644,null))['then'](respondWithResult(_0x2ab644,null))[_0x76dc('0x3d')](handleError(_0x2ab644,null));};exports['update']=function(_0x5d4cb3,_0xd4e7b3){if(_0x5d4cb3[_0x76dc('0x43')]['id']){delete _0x5d4cb3[_0x76dc('0x43')]['id'];}return db['CmCustomField'][_0x76dc('0x42')]({'where':{'id':_0x5d4cb3[_0x76dc('0x44')]['id']}})[_0x76dc('0x21')](handleEntityNotFound(_0xd4e7b3,null))[_0x76dc('0x21')](saveUpdates(_0x5d4cb3['body'],null))[_0x76dc('0x21')](respondWithResult(_0xd4e7b3,null))['catch'](handleError(_0xd4e7b3,null));};exports[_0x76dc('0x22')]=function(_0x556ef5,_0x25c9d9){return db[_0x76dc('0x2a')]['find']({'where':{'id':_0x556ef5['params']['id']}})[_0x76dc('0x21')](handleEntityNotFound(_0x25c9d9,null))[_0x76dc('0x21')](removeEntity(_0x25c9d9,null))[_0x76dc('0x3d')](handleError(_0x25c9d9,null));};exports[_0x76dc('0x45')]=function(_0x1a00dc,_0x3264ce){var _0x3fd7a2;return db[_0x76dc('0x46')][_0x76dc('0x47')](function(_0x3e7a1b){return db[_0x76dc('0x2a')][_0x76dc('0x45')](_0x1a00dc[_0x76dc('0x43')],{'transaction':_0x3e7a1b})[_0x76dc('0x21')](function(_0x200229){_0x3fd7a2=_0x200229;var _0x4a494f={'type':db[_0x76dc('0x48')][_0x76dc('0x49')],'transaction':_0x3e7a1b};switch(_0x1a00dc[_0x76dc('0x43')]['type']){case _0x76dc('0x4a'):_0x4a494f[_0x76dc('0x39')]=db[_0x76dc('0x48')][_0x76dc('0x49')];break;case _0x76dc('0x4b'):_0x4a494f[_0x76dc('0x39')]=db['Sequelize'][_0x76dc('0x4c')];break;case'switch':_0x4a494f[_0x76dc('0x39')]=db['Sequelize']['BOOLEAN'];_0x4a494f[_0x76dc('0x4d')]=![];break;default:}return db[_0x76dc('0x46')][_0x76dc('0x4e')]['addColumn'](_0x76dc('0x4f'),util['format'](_0x76dc('0x50'),_0x3fd7a2['id']),_0x4a494f);})[_0x76dc('0x21')](function(){return _0x3fd7a2;});})['then'](respondWithResult(_0x3264ce,0xc9))[_0x76dc('0x3d')](handleError(_0x3264ce,null));}; \ No newline at end of file +var _0x93b8=['format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','sendStatus','name','send','map','CmCustomField','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','destroy','find','transaction','Sequelize','TEXT','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts'];(function(_0x7bcc3e,_0x164e76){var _0x2b6dc8=function(_0x411c20){while(--_0x411c20){_0x7bcc3e['push'](_0x7bcc3e['shift']());}};_0x2b6dc8(++_0x164e76);}(_0x93b8,0xa8));var _0x893b=function(_0x20fbe7,_0x37da5b){_0x20fbe7=_0x20fbe7-0x0;var _0x5f535c=_0x93b8[_0x20fbe7];return _0x5f535c;};'use strict';var emlformat=require(_0x893b('0x0'));var rimraf=require(_0x893b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x893b('0x2'));var rp=require(_0x893b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x893b('0x4'));var util=require(_0x893b('0x5'));var path=require('path');var sox=require(_0x893b('0x6'));var csv=require(_0x893b('0x7'));var ejs=require(_0x893b('0x8'));var fs=require('fs');var fs_extra=require(_0x893b('0x9'));var _=require(_0x893b('0xa'));var squel=require(_0x893b('0xb'));var crypto=require(_0x893b('0xc'));var jsforce=require(_0x893b('0xd'));var deskjs=require(_0x893b('0xe'));var toCsv=require(_0x893b('0x7'));var querystring=require(_0x893b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x893b('0x10'));var qs=require(_0x893b('0x11'));var as=require(_0x893b('0x12'));var hardwareService=require(_0x893b('0x13'));var logger=require(_0x893b('0x14'))(_0x893b('0x15'));var utils=require('../../config/utils');var config=require(_0x893b('0x16'));var licenseUtil=require(_0x893b('0x17'));var db=require(_0x893b('0x18'))['db'];function respondWithStatusCode(_0x2ec39d,_0x26064){_0x26064=_0x26064||0xcc;return function(_0x5173fe){if(_0x5173fe){return _0x2ec39d['sendStatus'](_0x26064);}return _0x2ec39d[_0x893b('0x19')](_0x26064)['end']();};}function respondWithResult(_0x5df872,_0x31b8d1){_0x31b8d1=_0x31b8d1||0xc8;return function(_0x30cbb4){if(_0x30cbb4){return _0x5df872[_0x893b('0x19')](_0x31b8d1)[_0x893b('0x1a')](_0x30cbb4);}};}function respondWithFilteredResult(_0x5b36ea,_0x2d0585){return function(_0x4b2b89){if(_0x4b2b89){var _0x26cd70=typeof _0x2d0585['offset']===_0x893b('0x1b')&&typeof _0x2d0585[_0x893b('0x1c')]===_0x893b('0x1b');var _0xdf3ce9=_0x4b2b89[_0x893b('0x1d')];var _0x40881c=_0x26cd70?0x0:_0x2d0585[_0x893b('0x1e')];var _0x20446f=_0x26cd70?_0x4b2b89['count']:_0x2d0585[_0x893b('0x1e')]+_0x2d0585[_0x893b('0x1c')];var _0x3918ba;if(_0x20446f>=_0xdf3ce9){_0x20446f=_0xdf3ce9;_0x3918ba=0xc8;}else{_0x3918ba=0xce;}_0x5b36ea[_0x893b('0x19')](_0x3918ba);return _0x5b36ea['set'](_0x893b('0x1f'),_0x40881c+'-'+_0x20446f+'/'+_0xdf3ce9)['json'](_0x4b2b89);}return null;};}function patchUpdates(_0x5dead7){return function(_0x4a948a){try{jsonpatch[_0x893b('0x20')](_0x4a948a,_0x5dead7,!![]);}catch(_0x5a9c02){return BPromise[_0x893b('0x21')](_0x5a9c02);}return _0x4a948a['save']();};}function saveUpdates(_0x332de5,_0x2f8850){return function(_0x473ca1){if(_0x473ca1){return _0x473ca1[_0x893b('0x22')](_0x332de5)[_0x893b('0x23')](function(_0x4e9ea9){return _0x4e9ea9;});}return null;};}function removeEntity(_0x5e2b16,_0x5783ac){return function(_0x96af1){if(_0x96af1){return _0x96af1['destroy']()[_0x893b('0x23')](function(){_0x5e2b16[_0x893b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa997,_0xaf8538){return function(_0x264b55){if(!_0x264b55){_0x5aa997[_0x893b('0x24')](0x194);}return _0x264b55;};}function handleError(_0x521c68,_0x4d41ad){_0x4d41ad=_0x4d41ad||0x1f4;return function(_0x47d6aa){logger['error'](_0x47d6aa['stack']);if(_0x47d6aa['name']){delete _0x47d6aa[_0x893b('0x25')];}_0x521c68[_0x893b('0x19')](_0x4d41ad)[_0x893b('0x26')](_0x47d6aa);};}exports['index']=function(_0x4fd2a9,_0x1c67c5){var _0x1a4b75={},_0x1fd0fc={},_0x310b61={'count':0x0,'rows':[]};var _0x218465=_[_0x893b('0x27')](db[_0x893b('0x28')][_0x893b('0x29')],function(_0x3c2482){return{'name':_0x3c2482[_0x893b('0x2a')],'type':_0x3c2482['type']['key']};});_0x1fd0fc[_0x893b('0x2b')]=_['differenceBy'](_[_0x893b('0x27')](_0x218465,'name'),[_0x893b('0x25')]);_0x1fd0fc[_0x893b('0x2c')]=_[_0x893b('0x2d')](_0x4fd2a9[_0x893b('0x2c')]);_0x1fd0fc[_0x893b('0x2e')]=_['intersection'](_0x1fd0fc['model'],_0x1fd0fc['query']);_0x1a4b75[_0x893b('0x2f')]=_[_0x893b('0x30')](_0x1fd0fc[_0x893b('0x2b')],qs[_0x893b('0x31')](_0x4fd2a9['query']['fields']));_0x1a4b75['attributes']=_0x1a4b75[_0x893b('0x2f')][_0x893b('0x32')]?_0x1a4b75[_0x893b('0x2f')]:_0x1fd0fc[_0x893b('0x2b')];if(!_0x4fd2a9[_0x893b('0x2c')][_0x893b('0x33')](_0x893b('0x34'))){_0x1a4b75['limit']=qs[_0x893b('0x1c')](_0x4fd2a9['query'][_0x893b('0x1c')]);_0x1a4b75[_0x893b('0x1e')]=qs[_0x893b('0x1e')](_0x4fd2a9[_0x893b('0x2c')][_0x893b('0x1e')]);}_0x1a4b75['order']=qs[_0x893b('0x35')](_0x4fd2a9[_0x893b('0x2c')][_0x893b('0x35')]);_0x1a4b75[_0x893b('0x36')]=qs[_0x893b('0x2e')](_[_0x893b('0x37')](_0x4fd2a9['query'],_0x1fd0fc['filters']),_0x218465);if(_0x4fd2a9[_0x893b('0x2c')][_0x893b('0x38')]){_0x1a4b75[_0x893b('0x36')]=_[_0x893b('0x39')](_0x1a4b75[_0x893b('0x36')],{'$or':_['map'](_0x218465,function(_0x52d653){if(_0x52d653[_0x893b('0x3a')]!==_0x893b('0x3b')){var _0x454f55={};_0x454f55[_0x52d653[_0x893b('0x25')]]={'$like':'%'+_0x4fd2a9[_0x893b('0x2c')][_0x893b('0x38')]+'%'};return _0x454f55;}})});}_0x1a4b75=_['merge']({},_0x1a4b75,_0x4fd2a9[_0x893b('0x3c')]);var _0x4ac71e={'where':_0x1a4b75[_0x893b('0x36')]};return db[_0x893b('0x28')][_0x893b('0x1d')](_0x4ac71e)[_0x893b('0x23')](function(_0x3c939a){_0x310b61[_0x893b('0x1d')]=_0x3c939a;if(_0x4fd2a9[_0x893b('0x2c')][_0x893b('0x3d')]){_0x1a4b75[_0x893b('0x3e')]=[{'all':!![]}];}return db[_0x893b('0x28')][_0x893b('0x3f')](_0x1a4b75);})[_0x893b('0x23')](function(_0xeb0d94){_0x310b61[_0x893b('0x40')]=_0xeb0d94;return _0x310b61;})[_0x893b('0x23')](respondWithFilteredResult(_0x1c67c5,_0x1a4b75))[_0x893b('0x41')](handleError(_0x1c67c5,null));};exports[_0x893b('0x42')]=function(_0x264a7e,_0x3e8201){var _0x181dbb={'raw':!![],'where':{'id':_0x264a7e[_0x893b('0x43')]['id']}},_0x451ec9={};_0x451ec9[_0x893b('0x2b')]=_['keys'](db[_0x893b('0x28')][_0x893b('0x29')]);_0x451ec9['query']=_[_0x893b('0x2d')](_0x264a7e['query']);_0x451ec9[_0x893b('0x2e')]=_[_0x893b('0x30')](_0x451ec9[_0x893b('0x2b')],_0x451ec9[_0x893b('0x2c')]);_0x181dbb['attributes']=_[_0x893b('0x30')](_0x451ec9[_0x893b('0x2b')],qs[_0x893b('0x31')](_0x264a7e['query']['fields']));_0x181dbb[_0x893b('0x2f')]=_0x181dbb[_0x893b('0x2f')]['length']?_0x181dbb[_0x893b('0x2f')]:_0x451ec9[_0x893b('0x2b')];if(_0x264a7e[_0x893b('0x2c')][_0x893b('0x3d')]){_0x181dbb[_0x893b('0x3e')]=[{'all':!![]}];}_0x181dbb=_[_0x893b('0x39')]({},_0x181dbb,_0x264a7e[_0x893b('0x3c')]);return db[_0x893b('0x28')]['find'](_0x181dbb)['then'](handleEntityNotFound(_0x3e8201,null))[_0x893b('0x23')](respondWithResult(_0x3e8201,null))[_0x893b('0x41')](handleError(_0x3e8201,null));};exports[_0x893b('0x22')]=function(_0x44e53f,_0x25f301){if(_0x44e53f['body']['id']){delete _0x44e53f[_0x893b('0x44')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x44e53f[_0x893b('0x43')]['id']}})['then'](handleEntityNotFound(_0x25f301,null))[_0x893b('0x23')](saveUpdates(_0x44e53f['body'],null))[_0x893b('0x23')](respondWithResult(_0x25f301,null))['catch'](handleError(_0x25f301,null));};exports[_0x893b('0x45')]=function(_0x5e2322,_0x29ee2e){return db[_0x893b('0x28')][_0x893b('0x46')]({'where':{'id':_0x5e2322['params']['id']}})['then'](handleEntityNotFound(_0x29ee2e,null))[_0x893b('0x23')](removeEntity(_0x29ee2e,null))[_0x893b('0x41')](handleError(_0x29ee2e,null));};exports['create']=function(_0x5311d3,_0x54c41b){var _0x55775c;return db['sequelize'][_0x893b('0x47')](function(_0x49e95e){return db[_0x893b('0x28')]['create'](_0x5311d3[_0x893b('0x44')],{'transaction':_0x49e95e})[_0x893b('0x23')](function(_0x23893c){_0x55775c=_0x23893c;var _0x35b118={'type':db[_0x893b('0x48')][_0x893b('0x49')],'transaction':_0x49e95e};switch(_0x5311d3[_0x893b('0x44')][_0x893b('0x3a')]){case'text':_0x35b118[_0x893b('0x3a')]=db[_0x893b('0x48')][_0x893b('0x49')];break;case'number':_0x35b118[_0x893b('0x3a')]=db[_0x893b('0x48')][_0x893b('0x4a')];break;case'switch':_0x35b118[_0x893b('0x3a')]=db[_0x893b('0x48')][_0x893b('0x4b')];_0x35b118[_0x893b('0x4c')]=![];break;default:}return db[_0x893b('0x4d')][_0x893b('0x4e')][_0x893b('0x4f')](_0x893b('0x50'),util[_0x893b('0x51')](_0x893b('0x52'),_0x55775c['id']),_0x35b118);})[_0x893b('0x23')](function(){return _0x55775c;});})[_0x893b('0x23')](respondWithResult(_0x54c41b,0xc9))[_0x893b('0x41')](handleError(_0x54c41b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 650d946..3e194d7 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 _0x3b2c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','cm_custom_fields'];(function(_0x1cb4a5,_0x113546){var _0x46f12a=function(_0x56aadb){while(--_0x56aadb){_0x1cb4a5['push'](_0x1cb4a5['shift']());}};_0x46f12a(++_0x113546);}(_0x3b2c,0x160));var _0xc3b2=function(_0x1e9d08,_0x1027a7){_0x1e9d08=_0x1e9d08-0x0;var _0x1f53cb=_0x3b2c[_0x1e9d08];return _0x1f53cb;};'use strict';var _=require(_0xc3b2('0x0'));var util=require(_0xc3b2('0x1'));var logger=require(_0xc3b2('0x2'))(_0xc3b2('0x3'));var moment=require(_0xc3b2('0x4'));var BPromise=require(_0xc3b2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3b2('0x6'));var rimraf=require(_0xc3b2('0x7'));var config=require(_0xc3b2('0x8'));var attributes=require('./cmCustomField.attributes');module[_0xc3b2('0x9')]=function(_0x374264,_0x14ffa2){return _0x374264['define']('CmCustomField',attributes,{'tableName':_0xc3b2('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8be=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','../../config/logger'];(function(_0x263992,_0x1b4090){var _0x379836=function(_0x4a8db4){while(--_0x4a8db4){_0x263992['push'](_0x263992['shift']());}};_0x379836(++_0x1b4090);}(_0xb8be,0x1ab));var _0xeb8b=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0xb8be[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0xeb8b('0x0'));var util=require('util');var logger=require(_0xeb8b('0x1'))(_0xeb8b('0x2'));var moment=require(_0xeb8b('0x3'));var BPromise=require(_0xeb8b('0x4'));var rp=require(_0xeb8b('0x5'));var fs=require('fs');var path=require(_0xeb8b('0x6'));var rimraf=require(_0xeb8b('0x7'));var config=require(_0xeb8b('0x8'));var attributes=require(_0xeb8b('0x9'));module[_0xeb8b('0xa')]=function(_0x5c8071,_0x570ecc){return _0x5c8071['define'](_0xeb8b('0xb'),attributes,{'tableName':_0xeb8b('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 146dd37..54e93f1 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 _0xba49=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xba49,0x1b4));var _0x9ba4=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xba49[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x9ba4('0x0'));var util=require(_0x9ba4('0x1'));var moment=require('moment');var BPromise=require(_0x9ba4('0x2'));var rs=require(_0x9ba4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ba4('0x4'))['db'];var utils=require(_0x9ba4('0x5'));var logger=require(_0x9ba4('0x6'))(_0x9ba4('0x7'));var config=require(_0x9ba4('0x8'));var jayson=require(_0x9ba4('0x9'));var client=jayson['client'][_0x9ba4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x301721,_0x3753d6,_0x190bd5){return new BPromise(function(_0x1e169f,_0x5ca402){return client[_0x9ba4('0xb')](_0x301721,_0x190bd5)[_0x9ba4('0xc')](function(_0x1d7f8d){logger[_0x9ba4('0xd')](_0x9ba4('0xe'),_0x3753d6,_0x9ba4('0xf'));logger[_0x9ba4('0x10')](_0x9ba4('0x11'),_0x3753d6,_0x9ba4('0xf'),JSON[_0x9ba4('0x12')](_0x1d7f8d));if(_0x1d7f8d[_0x9ba4('0x13')]){if(_0x1d7f8d[_0x9ba4('0x13')]['code']===0x1f4){logger[_0x9ba4('0x13')]('CmCustomField,\x20%s,\x20%s',_0x3753d6,_0x1d7f8d[_0x9ba4('0x13')][_0x9ba4('0x14')]);return _0x5ca402(_0x1d7f8d[_0x9ba4('0x13')][_0x9ba4('0x14')]);}logger[_0x9ba4('0x13')](_0x9ba4('0xe'),_0x3753d6,_0x1d7f8d[_0x9ba4('0x13')][_0x9ba4('0x14')]);return _0x1e169f(_0x1d7f8d['error'][_0x9ba4('0x14')]);}else{logger[_0x9ba4('0xd')](_0x9ba4('0xe'),_0x3753d6,_0x9ba4('0xf'));_0x1e169f(_0x1d7f8d[_0x9ba4('0x15')][_0x9ba4('0x14')]);}})[_0x9ba4('0x16')](function(_0x2339d1){logger[_0x9ba4('0x13')](_0x9ba4('0xe'),_0x3753d6,_0x2339d1);_0x5ca402(_0x2339d1);});});} \ No newline at end of file +var _0xba55=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x33e7cd,_0x5a81c8){var _0x8f2027=function(_0x2ac27c){while(--_0x2ac27c){_0x33e7cd['push'](_0x33e7cd['shift']());}};_0x8f2027(++_0x5a81c8);}(_0xba55,0x1f3));var _0x5ba5=function(_0xe1a7a0,_0x1cf62c){_0xe1a7a0=_0xe1a7a0-0x0;var _0x575a86=_0xba55[_0xe1a7a0];return _0x575a86;};'use strict';var _=require(_0x5ba5('0x0'));var util=require(_0x5ba5('0x1'));var moment=require(_0x5ba5('0x2'));var BPromise=require(_0x5ba5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ba5('0x4'));var db=require(_0x5ba5('0x5'))['db'];var utils=require(_0x5ba5('0x6'));var logger=require(_0x5ba5('0x7'))(_0x5ba5('0x8'));var config=require(_0x5ba5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5ba5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5bea,_0x166aec,_0x401282){return new BPromise(function(_0x29b210,_0x2744e8){return client[_0x5ba5('0xb')](_0x2d5bea,_0x401282)[_0x5ba5('0xc')](function(_0x384989){logger['info'](_0x5ba5('0xd'),_0x166aec,_0x5ba5('0xe'));logger['debug'](_0x5ba5('0xf'),_0x166aec,'request\x20sent',JSON[_0x5ba5('0x10')](_0x384989));if(_0x384989[_0x5ba5('0x11')]){if(_0x384989[_0x5ba5('0x11')][_0x5ba5('0x12')]===0x1f4){logger[_0x5ba5('0x11')](_0x5ba5('0xd'),_0x166aec,_0x384989[_0x5ba5('0x11')][_0x5ba5('0x13')]);return _0x2744e8(_0x384989[_0x5ba5('0x11')][_0x5ba5('0x13')]);}logger[_0x5ba5('0x11')](_0x5ba5('0xd'),_0x166aec,_0x384989[_0x5ba5('0x11')][_0x5ba5('0x13')]);return _0x29b210(_0x384989[_0x5ba5('0x11')]['message']);}else{logger['info'](_0x5ba5('0xd'),_0x166aec,'request\x20sent');_0x29b210(_0x384989['result']['message']);}})[_0x5ba5('0x14')](function(_0x51cbf2){logger[_0x5ba5('0x11')](_0x5ba5('0xd'),_0x166aec,_0x51cbf2);_0x2744e8(_0x51cbf2);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 304c1ed..d7586ea 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 _0x229a=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','put','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x19f432,_0x32ce04){var _0x1f03de=function(_0x5d3965){while(--_0x5d3965){_0x19f432['push'](_0x19f432['shift']());}};_0x1f03de(++_0x32ce04);}(_0x229a,0x1ea));var _0xa229=function(_0xbcb223,_0x492296){_0xbcb223=_0xbcb223-0x0;var _0x4845ae=_0x229a[_0xbcb223];return _0x4845ae;};'use strict';var multer=require(_0xa229('0x0'));var util=require(_0xa229('0x1'));var path=require(_0xa229('0x2'));var timeout=require(_0xa229('0x3'));var express=require(_0xa229('0x4'));var router=express[_0xa229('0x5')]();var fs_extra=require(_0xa229('0x6'));var auth=require(_0xa229('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa229('0x8'));var controller=require('./cmCustomField.controller');router[_0xa229('0x9')]('/',auth[_0xa229('0xa')](),controller[_0xa229('0xb')]);router[_0xa229('0x9')]('/:id',auth[_0xa229('0xa')](),controller[_0xa229('0xc')]);router[_0xa229('0xd')]('/',auth[_0xa229('0xa')](),controller['create']);router[_0xa229('0xe')]('/:id',auth[_0xa229('0xa')](),controller[_0xa229('0xf')]);router[_0xa229('0x10')](_0xa229('0x11'),auth[_0xa229('0xa')](),controller['destroy']);module[_0xa229('0x12')]=router; \ No newline at end of file +var _0x5024=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','create','put','update','/:id','destroy','exports'];(function(_0x2ded05,_0x5ec1e6){var _0x57b50b=function(_0x5d0a3c){while(--_0x5d0a3c){_0x2ded05['push'](_0x2ded05['shift']());}};_0x57b50b(++_0x5ec1e6);}(_0x5024,0xf7));var _0x4502=function(_0x16cb32,_0x29cd49){_0x16cb32=_0x16cb32-0x0;var _0x19b452=_0x5024[_0x16cb32];return _0x19b452;};'use strict';var multer=require(_0x4502('0x0'));var util=require(_0x4502('0x1'));var path=require(_0x4502('0x2'));var timeout=require(_0x4502('0x3'));var express=require('express');var router=express[_0x4502('0x4')]();var fs_extra=require(_0x4502('0x5'));var auth=require(_0x4502('0x6'));var interaction=require(_0x4502('0x7'));var config=require(_0x4502('0x8'));var controller=require(_0x4502('0x9'));router[_0x4502('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4502('0xa')]('/:id',auth[_0x4502('0xb')](),controller[_0x4502('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4502('0xd')]);router[_0x4502('0xe')]('/:id',auth[_0x4502('0xb')](),controller[_0x4502('0xf')]);router['delete'](_0x4502('0x10'),auth[_0x4502('0xb')](),controller[_0x4502('0x11')]);module[_0x4502('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 22e83d8..26ea9c0 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 _0xdd9f=['BOOLEAN','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','DATE','UNSIGNED','contactListQueue','exports'];(function(_0x3697eb,_0x375d7a){var _0x5719ea=function(_0x4ae3ba){while(--_0x4ae3ba){_0x3697eb['push'](_0x3697eb['shift']());}};_0x5719ea(++_0x375d7a);}(_0xdd9f,0x7f));var _0xfdd9=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xdd9f[_0x68ee8b];return _0x5148f7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xfdd9('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xfdd9('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xfdd9('0x2'))},'countbusyretry':{'type':Sequelize[_0xfdd9('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfdd9('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xfdd9('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfdd9('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfdd9('0x5')]},'priority':{'type':Sequelize[_0xfdd9('0x3')](0x2)[_0xfdd9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xfdd9('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xfdd9('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xfdd9('0x3')],'unique':_0xfdd9('0x7')},'UserId':{'type':Sequelize[_0xfdd9('0x3')]},'VoiceQueueId':{'type':Sequelize[_0xfdd9('0x3')],'unique':_0xfdd9('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfdd9('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfdd9('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfdd9('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xfdd9('0x3')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xfdd9('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xea53=['INTEGER','BOOLEAN','UNSIGNED','contactListQueue','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1a63da,_0x4cc79b){var _0x376fc3=function(_0x203783){while(--_0x203783){_0x1a63da['push'](_0x1a63da['shift']());}};_0x376fc3(++_0x4cc79b);}(_0xea53,0x15a));var _0x3ea5=function(_0x5c7faf,_0x2aa47a){_0x5c7faf=_0x5c7faf-0x0;var _0x102c2a=_0xea53[_0x5c7faf];return _0x102c2a;};'use strict';var moment=require('moment');var Sequelize=require(_0x3ea5('0x0'));module[_0x3ea5('0x1')]={'phone':{'type':Sequelize[_0x3ea5('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3ea5('0x3')],'defaultValue':moment()['format'](_0x3ea5('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3ea5('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3ea5('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3ea5('0x3')]},'priority':{'type':Sequelize[_0x3ea5('0x5')](0x2)[_0x3ea5('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3ea5('0x5')],'unique':_0x3ea5('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x3ea5('0x5')],'unique':_0x3ea5('0x8')},'CampaignId':{'type':Sequelize[_0x3ea5('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x3ea5('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3ea5('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3ea5('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3ea5('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x3ea5('0x3')],'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 4c35e4b..8342271 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 _0x5089=['YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','lastName','isNil','calleridname','firstName','CmHopperFinal','CmHopperAdditionalPhone','destroy','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getPreviewRecall','Queue','getOpenContacts','isNumber','entity\x20not\x20found','sendStatus','getTimezones','push','moment','lodash','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','limit','undefined','count','set','update','then','error','stack','name','status','send','index','map','type','model','query','keys','filters','concat','$and','$or','$lt','$eq','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','CmHopper','includeAll','findAll','rows','catch','params','rawAttributes','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','state','campaign','user','UserId','deleted','deletedat','format'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x5089,0x1bb));var _0x9508=function(_0x463697,_0xccfdc4){_0x463697=_0x463697-0x0;var _0x33cfe1=_0x5089[_0x463697];return _0x33cfe1;};'use strict';var moment=require(_0x9508('0x0'));var _=require(_0x9508('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x9508('0x2'))(_0x9508('0x3'));var shared=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];function respondWithResult(_0x172549,_0x59d3ee){_0x59d3ee=_0x59d3ee||0xc8;return function(_0x86540d){if(_0x86540d){return _0x172549['status'](_0x59d3ee)[_0x9508('0x6')](_0x86540d);}};}function respondWithFilteredResult(_0x4538dd,_0x257318){return function(_0x4ab3c6){if(_0x4ab3c6){var _0x1dc04c=typeof _0x257318[_0x9508('0x7')]==='undefined'&&typeof _0x257318[_0x9508('0x8')]===_0x9508('0x9');var _0x4f6720=_0x4ab3c6[_0x9508('0xa')];var _0x5c9dc9=_0x1dc04c?0x0:_0x257318[_0x9508('0x7')];var _0x26cc8a=_0x1dc04c?_0x4ab3c6[_0x9508('0xa')]:_0x257318[_0x9508('0x7')]+_0x257318[_0x9508('0x8')];var _0x317f6e;if(_0x26cc8a>=_0x4f6720){_0x26cc8a=_0x4f6720;_0x317f6e=0xc8;}else{_0x317f6e=0xce;}_0x4538dd['status'](_0x317f6e);return _0x4538dd[_0x9508('0xb')]('Content-Range',_0x5c9dc9+'-'+_0x26cc8a+'/'+_0x4f6720)[_0x9508('0x6')](_0x4ab3c6);}return null;};}function saveUpdates(_0x396896,_0x554c90){return function(_0x11dc7f){if(_0x11dc7f){return _0x11dc7f[_0x9508('0xc')](_0x396896)[_0x9508('0xd')](function(_0x4701de){return _0x4701de;});}return null;};}function handleEntityNotFound(_0x51ef92,_0x440709){return function(_0x21b2d1){if(!_0x21b2d1){_0x51ef92['sendStatus'](0x194);}return _0x21b2d1;};}function handleError(_0x2a281d,_0x539746){_0x539746=_0x539746||0x1f4;return function(_0x25d4d6){logger[_0x9508('0xe')](_0x25d4d6[_0x9508('0xf')]);if(_0x25d4d6[_0x9508('0x10')]){delete _0x25d4d6[_0x9508('0x10')];}_0x2a281d[_0x9508('0x11')](_0x539746)[_0x9508('0x12')](_0x25d4d6);};}exports[_0x9508('0x13')]=function(_0x5a303c,_0x22ba9c){var _0x378749={},_0xfcc29d={},_0x1ba7e6={'count':0x0,'rows':[]};var _0x23c30e=_[_0x9508('0x14')](db['CmHopper']['rawAttributes'],function(_0x17e43c){return{'name':_0x17e43c['fieldName'],'type':_0x17e43c[_0x9508('0x15')]['key']};});_0xfcc29d[_0x9508('0x16')]=_[_0x9508('0x14')](_0x23c30e,_0x9508('0x10'));_0xfcc29d[_0x9508('0x17')]=_[_0x9508('0x18')](_0x5a303c[_0x9508('0x17')]);_0xfcc29d[_0x9508('0x19')]=_['intersection'](_0xfcc29d['model'],_0xfcc29d[_0x9508('0x17')]);_0xfcc29d[_0x9508('0x19')]=_[_0x9508('0x1a')](_0xfcc29d[_0x9508('0x19')],[_0x9508('0x1b'),_0x9508('0x1c'),'$gt','$gte',_0x9508('0x1d'),'$lte','$ne',_0x9508('0x1e'),'$not','$between',_0x9508('0x1f'),_0x9508('0x20'),'$notIn',_0x9508('0x21'),_0x9508('0x22'),_0x9508('0x23'),_0x9508('0x24'),_0x9508('0x21'),_0x9508('0x25'),_0x9508('0x26'),_0x9508('0x27'),_0x9508('0x28')]);_0x378749[_0x9508('0x29')]=_[_0x9508('0x2a')](_0xfcc29d['model'],qs[_0x9508('0x2b')](_0x5a303c[_0x9508('0x17')][_0x9508('0x2b')]));_0x378749['attributes']=_0x378749[_0x9508('0x29')][_0x9508('0x2c')]?_0x378749['attributes']:_0xfcc29d[_0x9508('0x16')];if(!_0x5a303c[_0x9508('0x17')]['hasOwnProperty'](_0x9508('0x2d'))){_0x378749[_0x9508('0x8')]=qs[_0x9508('0x8')](_0x5a303c[_0x9508('0x17')]['limit']);_0x378749['offset']=qs[_0x9508('0x7')](_0x5a303c[_0x9508('0x17')][_0x9508('0x7')]);}_0x378749['order']=qs['sort'](_0x5a303c[_0x9508('0x17')][_0x9508('0x2e')]);_0x378749[_0x9508('0x2f')]=qs[_0x9508('0x19')](_[_0x9508('0x30')](_0x5a303c[_0x9508('0x17')],_0xfcc29d[_0x9508('0x19')]),_0x23c30e);if(_0x5a303c[_0x9508('0x17')][_0x9508('0x31')]){_0x378749[_0x9508('0x2f')]=_['merge'](_0x378749[_0x9508('0x2f')],{'$or':_[_0x9508('0x14')](_0x23c30e,function(_0x5d7098){if(_0x5d7098[_0x9508('0x15')]!==_0x9508('0x32')){var _0x3f69b1={};_0x3f69b1[_0x5d7098[_0x9508('0x10')]]={'$like':'%'+_0x5a303c[_0x9508('0x17')][_0x9508('0x31')]+'%'};return _0x3f69b1;}})});}_0x378749=_[_0x9508('0x33')]({},_0x378749,_0x5a303c[_0x9508('0x34')]);var _0xfb6676={'where':_0x378749[_0x9508('0x2f')]};return db[_0x9508('0x35')]['count'](_0xfb6676)[_0x9508('0xd')](function(_0x5b690e){_0x1ba7e6[_0x9508('0xa')]=_0x5b690e;if(_0x5a303c[_0x9508('0x17')][_0x9508('0x36')]){_0x378749['include']=[{'all':!![]}];}return db['CmHopper'][_0x9508('0x37')](_0x378749);})[_0x9508('0xd')](function(_0x1277b1){_0x1ba7e6[_0x9508('0x38')]=_0x1277b1;return _0x1ba7e6;})['then'](respondWithFilteredResult(_0x22ba9c,_0x378749))[_0x9508('0x39')](handleError(_0x22ba9c,null));};exports['show']=function(_0x37b8a2,_0x174e83){var _0x5205f8={'raw':!![],'where':{'id':_0x37b8a2[_0x9508('0x3a')]['id']}},_0x33e412={};_0x33e412['model']=_[_0x9508('0x18')](db[_0x9508('0x35')][_0x9508('0x3b')]);_0x33e412[_0x9508('0x17')]=_['keys'](_0x37b8a2['query']);_0x33e412[_0x9508('0x19')]=_['intersection'](_0x33e412[_0x9508('0x16')],_0x33e412[_0x9508('0x17')]);_0x5205f8[_0x9508('0x29')]=_[_0x9508('0x2a')](_0x33e412['model'],qs['fields'](_0x37b8a2['query'][_0x9508('0x2b')]));_0x5205f8['attributes']=_0x5205f8[_0x9508('0x29')]['length']?_0x5205f8[_0x9508('0x29')]:_0x33e412[_0x9508('0x16')];if(_0x37b8a2[_0x9508('0x17')][_0x9508('0x36')]){_0x5205f8['include']=[{'all':!![]}];}_0x5205f8=_[_0x9508('0x33')]({},_0x5205f8,_0x37b8a2[_0x9508('0x34')]);return db[_0x9508('0x35')]['find'](_0x5205f8)[_0x9508('0xd')](handleEntityNotFound(_0x174e83,null))[_0x9508('0xd')](respondWithResult(_0x174e83,null))['catch'](handleError(_0x174e83,null));};exports[_0x9508('0x3c')]=function(_0x50a4ba,_0xd6d570){return db['CmHopper']['create'](_0x50a4ba[_0x9508('0x3d')],{})[_0x9508('0xd')](respondWithResult(_0xd6d570,0xc9))[_0x9508('0x39')](handleError(_0xd6d570,null));};exports[_0x9508('0xc')]=function(_0xf17d3a,_0x169daf){if(_0xf17d3a['body']['id']){delete _0xf17d3a[_0x9508('0x3d')]['id'];}return db[_0x9508('0x35')][_0x9508('0x3e')]({'where':{'id':_0xf17d3a['params']['id']}})[_0x9508('0xd')](handleEntityNotFound(_0x169daf,null))[_0x9508('0xd')](saveUpdates(_0xf17d3a[_0x9508('0x3d')],null))[_0x9508('0xd')](respondWithResult(_0x169daf,null))['catch'](handleError(_0x169daf,null));};exports[_0x9508('0x3f')]=function(_0x552d10,_0x155928){return db[_0x9508('0x35')]['describe']()[_0x9508('0xd')](respondWithResult(_0x155928,null))[_0x9508('0x39')](handleError(_0x155928,null));};exports['destroy']=function(_0x61eb2c,_0x22306e){var _0x5125c9;var _0x39215b=_0x61eb2c['params']['id'];return db[_0x9508('0x35')]['find']({'where':{'id':_0x61eb2c[_0x9508('0x3a')]['id']}})['then'](handleEntityNotFound(_0x22306e,null))['then'](function(_0x55a158){if(_0x55a158){return _0x55a158['destroy']()[_0x9508('0xd')](function(_0x13cedc){return _0x13cedc;});}})[_0x9508('0xd')](function(_0x2eead6){_0x5125c9=_0x2eead6;if(_0x2eead6){if(_0x2eead6[_0x9508('0x40')]||_0x2eead6[_0x9508('0x41')]){return db[_0x2eead6[_0x9508('0x40')]?_0x9508('0x42'):_0x9508('0x43')]['find']({'where':{'id':_0x2eead6[_0x9508('0x40')]?_0x2eead6[_0x9508('0x40')]:_0x2eead6[_0x9508('0x41')]},'attributes':['id',_0x9508('0x10')],'raw':!![]});}}})[_0x9508('0xd')](function(_0x539f5c){var _0x5c0467={};if(_0x539f5c){_[_0x9508('0x33')](_0x5c0467,_['omit'](_0x5125c9[_0x9508('0x44')],[_0x9508('0x45'),'updatedAt','id']));_0x5c0467[_0x9508('0x46')]=0x15;_0x5c0467['statedesc']='deleted';_0x5c0467[_0x9508('0x47')]=_0x539f5c[_0x9508('0x10')];_0x5c0467['membername']=_0x61eb2c[_0x9508('0x48')][_0x9508('0x10')];_0x5c0467[_0x9508('0x49')]=_0x61eb2c[_0x9508('0x48')]['id'];_0x5c0467[_0x9508('0x4a')]=!![];_0x5c0467[_0x9508('0x4b')]=moment()[_0x9508('0x4c')](_0x9508('0x4d'));_0x5c0467[_0x9508('0x4e')]=_0x5125c9[_0x9508('0x4f')];_0x5c0467[_0x9508('0x50')]=_0x5125c9[_0x9508('0x40')]?_0x9508('0x51'):_0x9508('0x52');return db['CmContact'][_0x9508('0x3e')]({'where':{'id':_0x5c0467[_0x9508('0x53')]},'attributes':['firstName',_0x9508('0x54')]})['then'](function(_0x53d35a){if(!_[_0x9508('0x55')](_0x22306e)&&!_[_0x9508('0x55')](_0x53d35a['firstName'])){_0x5c0467[_0x9508('0x56')]=_0x53d35a[_0x9508('0x57')];if(!_['isNil'](_0x53d35a[_0x9508('0x54')])){_0x5c0467[_0x9508('0x56')]+='\x20'+_0x53d35a[_0x9508('0x54')];}}})['finally'](function(){return db[_0x9508('0x58')][_0x9508('0x3c')](_0x5c0467);});}})[_0x9508('0xd')](function(_0x692368){return db[_0x9508('0x59')][_0x9508('0x5a')]({'where':{'CmHopperId':_0x39215b}});})['then'](function(){return _0x22306e[_0x9508('0x11')](0xcc)[_0x9508('0x5b')]();})[_0x9508('0x39')](handleError(_0x22306e,null));};exports[_0x9508('0x5c')]=function(_0x5bab99,_0x2ff0bb){var _0x5e2dab=[];return db[_0x9508('0x5d')][_0x9508('0x3f')]()['then'](function(_0x308fb0){_0x5e2dab=_[_0x9508('0x18')](_0x308fb0);return _0x5bab99['user'][_0x9508('0x5e')]({'where':{'type':_0x9508('0x5f'),'dialActive':!![],'dialMethod':_0x9508('0x60')},'attributes':['id',_0x9508('0x61'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x9508('0xd')](function(_0x3b028a){if(_0x3b028a&&_0x3b028a[_0x9508('0x2c')]){return db[_0x9508('0x62')][_0x9508('0x63')](function(_0x9a59f7){var _0x67371f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9508('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x9508('0x14')](_0x3b028a,'id')},'$or':[{'UserId':null},{'UserId':_0x5bab99[_0x9508('0x48')]['id']}]};var _0x44b61a={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3b028a)['filter']([_0x9508('0x64'),0x0])['map']('id')[_0x9508('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x5bab99['user']['id']}]};var _0x53e277={'$or':[_0x67371f,_0x44b61a]};var _0x54f0f3=[];if(_0x5bab99[_0x9508('0x3d')][_0x9508('0x66')]&&_0x5bab99[_0x9508('0x3d')]['direction']===_0x9508('0x67')){if(!_[_0x9508('0x68')](_0x5bab99[_0x9508('0x3d')][_0x9508('0x69')])){_0x53e277['id']={'$in':_0x5bab99[_0x9508('0x3d')]['hopperIds']};}_0x54f0f3=[['priority',_0x9508('0x6a')],[_0x9508('0x6b'),_0x3b028a[0x0][_0x9508('0x61')]===_0x9508('0x6a')?_0x9508('0x6c'):_0x9508('0x6a')],db[_0x9508('0x62')][_0x9508('0x6d')](_0x9508('0x6e')),['id',_0x9508('0x6c')]];}else{if(!_[_0x9508('0x68')](_0x5bab99[_0x9508('0x3d')]['hopperIds'])){_0x53e277['id']={'$notIn':_0x5bab99['body'][_0x9508('0x69')]};}_0x54f0f3=[['priority',_0x9508('0x6c')],['scheduledAt',_0x3b028a[0x0]['dialOrderByScheduledAt']],db[_0x9508('0x62')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x9508('0x6a')]];}return db[_0x9508('0x35')][_0x9508('0x6f')]({'attributes':['id',_0x9508('0x70'),_0x9508('0x4f'),_0x9508('0x71')],'where':_0x53e277,'order':_0x54f0f3,'transaction':_0x9a59f7,'lock':_0x9a59f7[_0x9508('0x72')][_0x9508('0x73')],'include':[{'model':db[_0x9508('0x5d')],'as':_0x9508('0x74'),'attributes':_0x5e2dab,'include':[{'model':db[_0x9508('0x75')],'as':_0x9508('0x76'),'attributes':['id',_0x9508('0x10')]}]},{'model':db[_0x9508('0x77')],'as':_0x9508('0x78'),'attributes':['id','name']},{'model':db[_0x9508('0x42')],'as':'Queue','attributes':['id',_0x9508('0x10'),_0x9508('0x79')]}]})[_0x9508('0xd')](function(_0x42dfdb){if(_0x42dfdb){return _0x42dfdb[_0x9508('0xc')]({'UserId':_0x5bab99[_0x9508('0x48')]['id']},{'transaction':_0x9a59f7});}});});}})[_0x9508('0xd')](handleEntityNotFound(_0x2ff0bb,null))[_0x9508('0xd')](respondWithResult(_0x2ff0bb,null))[_0x9508('0x39')](handleError(_0x2ff0bb,null));};exports[_0x9508('0x7a')]=function(_0x2f292b,_0x470f52,_0x5d0d94){var _0x2db0af=[];var _0x2020bd=_0x2f292b[_0x9508('0x3a')]['id'];var _0x4bddc1=_0x2f292b['user']['id'];return db[_0x9508('0x5d')][_0x9508('0x3f')]()[_0x9508('0xd')](function(_0x27be4b){_0x2db0af=_[_0x9508('0x18')](_0x27be4b);return db[_0x9508('0x62')][_0x9508('0x63')](function(_0x5aa6da){const _0x2bf12b={'id':_0x2020bd};return db['CmHopper']['findOne']({'attributes':['id',_0x9508('0x70'),'recallme'],'where':_0x2bf12b,'transaction':_0x5aa6da,'lock':_0x5aa6da[_0x9508('0x72')][_0x9508('0x73')],'include':[{'model':db['CmContact'],'as':_0x9508('0x74'),'attributes':_0x2db0af,'include':[{'model':db['CmCompany'],'as':_0x9508('0x76'),'attributes':['id','name']}]},{'model':db[_0x9508('0x77')],'as':_0x9508('0x78'),'attributes':['id',_0x9508('0x10')]},{'model':db[_0x9508('0x42')],'as':_0x9508('0x7b'),'attributes':['id',_0x9508('0x10'),_0x9508('0x79')]}]})[_0x9508('0xd')](function(_0x12892f){if(_0x12892f){return _0x12892f[_0x9508('0xc')]({'UserId':_0x4bddc1},{'transaction':_0x5aa6da});}});});})['then'](handleEntityNotFound(_0x470f52,null))[_0x9508('0xd')](respondWithResult(_0x470f52,null))[_0x9508('0x39')](handleError(_0x470f52,null));};exports[_0x9508('0x7c')]=function(_0x175c74,_0xf094d1){return _0x175c74[_0x9508('0x48')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x9508('0x60')},'attributes':['id'],'raw':!![]})[_0x9508('0xd')](function(_0x1ad750){if(_0x1ad750&&_0x1ad750['length']){return db['CmHopper'][_0x9508('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9508('0x4d'))},'VoiceQueueId':{'$in':_[_0x9508('0x14')](_0x1ad750,'id')},'$or':[{'UserId':null},{'UserId':_0x175c74[_0x9508('0x48')]['id']}]}});}return 0x0;})['then'](function(_0x3809c3){if(!_[_0x9508('0x55')](_0x3809c3)&&_[_0x9508('0x7d')](_0x3809c3)){return _0xf094d1[_0x9508('0x11')](0xc8)[_0x9508('0x6')]({'contacts':_0x3809c3});}else{logger[_0x9508('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x9508('0x7e'));_0xf094d1[_0x9508('0x7f')](0x194);}})['catch'](handleError(_0xf094d1,null));};exports[_0x9508('0x80')]=function(_0xa88073,_0xdf4171){var _0x4959a6=shared['timezones'];var _0x2b84f4=[];_['map'](_0x4959a6,function(_0x22015f){_0x2b84f4[_0x9508('0x81')]({'id':_0x22015f[_0x9508('0x10')],'name':_0x22015f[_0x9508('0x10')],'utcOffset':_0x22015f['utcOffset']});});return _0xdf4171[_0x9508('0x11')](0xc8)[_0x9508('0x6')]({'tz':_0x2b84f4});};exports['getTimezone']=function(_0x25b463,_0x146d98){var _0xa89fca=shared['timezones'];var _0x130c4a={};if(!_['isNil'](_0xa89fca[_0x25b463[_0x9508('0x3d')]['id']]))_0x130c4a=_0xa89fca[_0x25b463[_0x9508('0x3d')]['id']];return _0x146d98[_0x9508('0x11')](0xc8)[_0x9508('0x6')](_0x130c4a);}; \ No newline at end of file +var _0x23f4=['VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','findOne','recallme','LOCK','Contact','CmCompany','Queue','dialActive','getPreviewRecall','transaction','scheduledat','UPDATE','Company','CmList','List','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','api','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notILike','$overlap','$any','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filter','where'];(function(_0x2e5965,_0x4609d){var _0x2d8537=function(_0x1da752){while(--_0x1da752){_0x2e5965['push'](_0x2e5965['shift']());}};_0x2d8537(++_0x4609d);}(_0x23f4,0x1ee));var _0x423f=function(_0x6ac718,_0x335ac0){_0x6ac718=_0x6ac718-0x0;var _0x3def08=_0x23f4[_0x6ac718];return _0x3def08;};'use strict';var moment=require('moment');var _=require(_0x423f('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x423f('0x1'));var shared=require(_0x423f('0x2'));var db=require(_0x423f('0x3'))['db'];function respondWithResult(_0x3503a0,_0x1ab106){_0x1ab106=_0x1ab106||0xc8;return function(_0x129dba){if(_0x129dba){return _0x3503a0[_0x423f('0x4')](_0x1ab106)[_0x423f('0x5')](_0x129dba);}};}function respondWithFilteredResult(_0x34a2d9,_0x51066b){return function(_0x260eae){if(_0x260eae){var _0x47716d=typeof _0x51066b['offset']===_0x423f('0x6')&&typeof _0x51066b[_0x423f('0x7')]===_0x423f('0x6');var _0x50301a=_0x260eae['count'];var _0x4b8a90=_0x47716d?0x0:_0x51066b[_0x423f('0x8')];var _0x481c41=_0x47716d?_0x260eae[_0x423f('0x9')]:_0x51066b[_0x423f('0x8')]+_0x51066b[_0x423f('0x7')];var _0x162c83;if(_0x481c41>=_0x50301a){_0x481c41=_0x50301a;_0x162c83=0xc8;}else{_0x162c83=0xce;}_0x34a2d9['status'](_0x162c83);return _0x34a2d9[_0x423f('0xa')](_0x423f('0xb'),_0x4b8a90+'-'+_0x481c41+'/'+_0x50301a)[_0x423f('0x5')](_0x260eae);}return null;};}function saveUpdates(_0x3d4027,_0x216360){return function(_0x5275b0){if(_0x5275b0){return _0x5275b0[_0x423f('0xc')](_0x3d4027)[_0x423f('0xd')](function(_0x2ebc8c){return _0x2ebc8c;});}return null;};}function handleEntityNotFound(_0x1c894f,_0x44e1d5){return function(_0x3b531d){if(!_0x3b531d){_0x1c894f[_0x423f('0xe')](0x194);}return _0x3b531d;};}function handleError(_0x21d804,_0x252e6c){_0x252e6c=_0x252e6c||0x1f4;return function(_0x235c86){logger[_0x423f('0xf')](_0x235c86[_0x423f('0x10')]);if(_0x235c86[_0x423f('0x11')]){delete _0x235c86[_0x423f('0x11')];}_0x21d804[_0x423f('0x4')](_0x252e6c)[_0x423f('0x12')](_0x235c86);};}exports[_0x423f('0x13')]=function(_0x34e968,_0x26b6d1){var _0x5424e6={},_0x99435f={},_0x569fd0={'count':0x0,'rows':[]};var _0x504d8b=_[_0x423f('0x14')](db['CmHopper'][_0x423f('0x15')],function(_0xd7b80e){return{'name':_0xd7b80e['fieldName'],'type':_0xd7b80e[_0x423f('0x16')][_0x423f('0x17')]};});_0x99435f['model']=_[_0x423f('0x14')](_0x504d8b,_0x423f('0x11'));_0x99435f['query']=_[_0x423f('0x18')](_0x34e968[_0x423f('0x19')]);_0x99435f['filters']=_[_0x423f('0x1a')](_0x99435f['model'],_0x99435f[_0x423f('0x19')]);_0x99435f[_0x423f('0x1b')]=_[_0x423f('0x1c')](_0x99435f[_0x423f('0x1b')],[_0x423f('0x1d'),_0x423f('0x1e'),_0x423f('0x1f'),_0x423f('0x20'),_0x423f('0x21'),_0x423f('0x22'),_0x423f('0x23'),_0x423f('0x24'),_0x423f('0x25'),_0x423f('0x26'),'$notBetween',_0x423f('0x27'),_0x423f('0x28'),_0x423f('0x29'),'$notLike','$iLike',_0x423f('0x2a'),_0x423f('0x29'),_0x423f('0x2b'),'$contains','$contained',_0x423f('0x2c')]);_0x5424e6[_0x423f('0x2d')]=_['intersection'](_0x99435f[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x34e968[_0x423f('0x19')][_0x423f('0x2f')]));_0x5424e6['attributes']=_0x5424e6[_0x423f('0x2d')][_0x423f('0x30')]?_0x5424e6[_0x423f('0x2d')]:_0x99435f[_0x423f('0x2e')];if(!_0x34e968['query'][_0x423f('0x31')](_0x423f('0x32'))){_0x5424e6[_0x423f('0x7')]=qs[_0x423f('0x7')](_0x34e968[_0x423f('0x19')][_0x423f('0x7')]);_0x5424e6[_0x423f('0x8')]=qs[_0x423f('0x8')](_0x34e968[_0x423f('0x19')][_0x423f('0x8')]);}_0x5424e6['order']=qs[_0x423f('0x33')](_0x34e968[_0x423f('0x19')][_0x423f('0x33')]);_0x5424e6['where']=qs[_0x423f('0x1b')](_['pick'](_0x34e968[_0x423f('0x19')],_0x99435f[_0x423f('0x1b')]),_0x504d8b);if(_0x34e968[_0x423f('0x19')][_0x423f('0x34')]){_0x5424e6[_0x423f('0x35')]=_['merge'](_0x5424e6['where'],{'$or':_[_0x423f('0x14')](_0x504d8b,function(_0x5a2225){if(_0x5a2225[_0x423f('0x16')]!==_0x423f('0x36')){var _0x3e4c9f={};_0x3e4c9f[_0x5a2225[_0x423f('0x11')]]={'$like':'%'+_0x34e968[_0x423f('0x19')][_0x423f('0x34')]+'%'};return _0x3e4c9f;}})});}_0x5424e6=_[_0x423f('0x37')]({},_0x5424e6,_0x34e968[_0x423f('0x38')]);var _0x3aeb17={'where':_0x5424e6[_0x423f('0x35')]};return db[_0x423f('0x39')]['count'](_0x3aeb17)['then'](function(_0x382f91){_0x569fd0[_0x423f('0x9')]=_0x382f91;if(_0x34e968[_0x423f('0x19')][_0x423f('0x3a')]){_0x5424e6[_0x423f('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x423f('0x3c')](_0x5424e6);})[_0x423f('0xd')](function(_0x2e6d28){_0x569fd0[_0x423f('0x3d')]=_0x2e6d28;return _0x569fd0;})[_0x423f('0xd')](respondWithFilteredResult(_0x26b6d1,_0x5424e6))[_0x423f('0x3e')](handleError(_0x26b6d1,null));};exports[_0x423f('0x3f')]=function(_0x1d280f,_0x3464e3){var _0x40571a={'raw':!![],'where':{'id':_0x1d280f['params']['id']}},_0x4fb566={};_0x4fb566[_0x423f('0x2e')]=_[_0x423f('0x18')](db[_0x423f('0x39')][_0x423f('0x15')]);_0x4fb566[_0x423f('0x19')]=_[_0x423f('0x18')](_0x1d280f['query']);_0x4fb566[_0x423f('0x1b')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],_0x4fb566[_0x423f('0x19')]);_0x40571a[_0x423f('0x2d')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x1d280f['query'][_0x423f('0x2f')]));_0x40571a[_0x423f('0x2d')]=_0x40571a[_0x423f('0x2d')][_0x423f('0x30')]?_0x40571a[_0x423f('0x2d')]:_0x4fb566[_0x423f('0x2e')];if(_0x1d280f[_0x423f('0x19')][_0x423f('0x3a')]){_0x40571a[_0x423f('0x3b')]=[{'all':!![]}];}_0x40571a=_['merge']({},_0x40571a,_0x1d280f[_0x423f('0x38')]);return db['CmHopper'][_0x423f('0x40')](_0x40571a)[_0x423f('0xd')](handleEntityNotFound(_0x3464e3,null))[_0x423f('0xd')](respondWithResult(_0x3464e3,null))[_0x423f('0x3e')](handleError(_0x3464e3,null));};exports[_0x423f('0x41')]=function(_0x3ad48c,_0x3087e4){return db[_0x423f('0x39')][_0x423f('0x41')](_0x3ad48c[_0x423f('0x42')],{})[_0x423f('0xd')](respondWithResult(_0x3087e4,0xc9))[_0x423f('0x3e')](handleError(_0x3087e4,null));};exports[_0x423f('0xc')]=function(_0x350e11,_0xa7708c){if(_0x350e11[_0x423f('0x42')]['id']){delete _0x350e11[_0x423f('0x42')]['id'];}return db[_0x423f('0x39')][_0x423f('0x40')]({'where':{'id':_0x350e11[_0x423f('0x43')]['id']}})['then'](handleEntityNotFound(_0xa7708c,null))[_0x423f('0xd')](saveUpdates(_0x350e11['body'],null))[_0x423f('0xd')](respondWithResult(_0xa7708c,null))[_0x423f('0x3e')](handleError(_0xa7708c,null));};exports[_0x423f('0x44')]=function(_0x37035a,_0x57f5d6){return db[_0x423f('0x39')][_0x423f('0x44')]()[_0x423f('0xd')](respondWithResult(_0x57f5d6,null))[_0x423f('0x3e')](handleError(_0x57f5d6,null));};exports[_0x423f('0x45')]=function(_0x31b88e,_0x2dcbec){var _0x489894;var _0x1e2b9f=_0x31b88e[_0x423f('0x43')]['id'];return db['CmHopper'][_0x423f('0x40')]({'where':{'id':_0x31b88e['params']['id']}})[_0x423f('0xd')](handleEntityNotFound(_0x2dcbec,null))['then'](function(_0x56e907){if(_0x56e907){return _0x56e907[_0x423f('0x45')]()[_0x423f('0xd')](function(_0x1668d4){return _0x1668d4;});}})[_0x423f('0xd')](function(_0x545476){_0x489894=_0x545476;if(_0x545476){if(_0x545476[_0x423f('0x46')]||_0x545476['CampaignId']){return db[_0x545476[_0x423f('0x46')]?_0x423f('0x47'):_0x423f('0x48')][_0x423f('0x40')]({'where':{'id':_0x545476[_0x423f('0x46')]?_0x545476[_0x423f('0x46')]:_0x545476[_0x423f('0x49')]},'attributes':['id',_0x423f('0x11')],'raw':!![]});}}})[_0x423f('0xd')](function(_0x4e3003){var _0x104fd9={};if(_0x4e3003){_[_0x423f('0x37')](_0x104fd9,_['omit'](_0x489894[_0x423f('0x4a')],['createdAt',_0x423f('0x4b'),'id']));_0x104fd9[_0x423f('0x4c')]=0x15;_0x104fd9[_0x423f('0x4d')]=_0x423f('0x4e');_0x104fd9[_0x423f('0x4f')]=_0x4e3003[_0x423f('0x11')];_0x104fd9['membername']=_0x31b88e['user'][_0x423f('0x11')];_0x104fd9[_0x423f('0x50')]=_0x31b88e[_0x423f('0x51')]['id'];_0x104fd9[_0x423f('0x4e')]=!![];_0x104fd9[_0x423f('0x52')]=moment()[_0x423f('0x53')](_0x423f('0x54'));_0x104fd9[_0x423f('0x55')]=_0x489894[_0x423f('0x56')];_0x104fd9['campaigntype']=_0x489894[_0x423f('0x46')]?_0x423f('0x57'):'ivr';return db[_0x423f('0x58')]['find']({'where':{'id':_0x104fd9[_0x423f('0x59')]},'attributes':[_0x423f('0x5a'),_0x423f('0x5b')]})['then'](function(_0x5c39e4){if(!_[_0x423f('0x5c')](_0x2dcbec)&&!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5a')])){_0x104fd9['calleridname']=_0x5c39e4[_0x423f('0x5a')];if(!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5b')])){_0x104fd9[_0x423f('0x5d')]+='\x20'+_0x5c39e4[_0x423f('0x5b')];}}})[_0x423f('0x5e')](function(){return db[_0x423f('0x5f')]['create'](_0x104fd9);});}})[_0x423f('0xd')](function(_0x588483){return db[_0x423f('0x60')][_0x423f('0x45')]({'where':{'CmHopperId':_0x1e2b9f}});})[_0x423f('0xd')](function(){return _0x2dcbec[_0x423f('0x4')](0xcc)['end']();})[_0x423f('0x3e')](handleError(_0x2dcbec,null));};exports[_0x423f('0x61')]=function(_0x4c33c7,_0x5ae8a9){var _0xfe89a9=[];return db[_0x423f('0x58')]['describe']()[_0x423f('0xd')](function(_0x1897ff){_0xfe89a9=_['keys'](_0x1897ff);return _0x4c33c7['user']['getVoiceQueues']({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':_0x423f('0x63')},'attributes':['id',_0x423f('0x64'),_0x423f('0x65')],'raw':!![]});})['then'](function(_0x4fa0ef){if(_0x4fa0ef&&_0x4fa0ef[_0x423f('0x30')]){return db[_0x423f('0x66')]['transaction'](function(_0x43b569){var _0x13ed0b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_[_0x423f('0x14')](_0x4fa0ef,'id')},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x116605={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4fa0ef)['filter']([_0x423f('0x65'),0x0])[_0x423f('0x14')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x223e8c={'$or':[_0x13ed0b,_0x116605]};var _0x3e5d47=[];if(_0x4c33c7['body'][_0x423f('0x67')]&&_0x4c33c7[_0x423f('0x42')][_0x423f('0x67')]===_0x423f('0x68')){if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')])){_0x223e8c['id']={'$in':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[['priority',_0x423f('0x6b')],[_0x423f('0x6c'),_0x4fa0ef[0x0][_0x423f('0x64')]===_0x423f('0x6b')?'DESC':_0x423f('0x6b')],db[_0x423f('0x66')][_0x423f('0x6d')](_0x423f('0x6e')),['id',_0x423f('0x6f')]];}else{if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')]['hopperIds'])){_0x223e8c['id']={'$notIn':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[[_0x423f('0x70'),_0x423f('0x6f')],['scheduledAt',_0x4fa0ef[0x0][_0x423f('0x64')]],db[_0x423f('0x66')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x423f('0x6b')]];}return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id','scheduledat',_0x423f('0x56'),_0x423f('0x72')],'where':_0x223e8c,'order':_0x3e5d47,'transaction':_0x43b569,'lock':_0x43b569[_0x423f('0x73')]['UPDATE'],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0xfe89a9,'include':[{'model':db[_0x423f('0x75')],'as':'Company','attributes':['id',_0x423f('0x11')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':_0x423f('0x76'),'attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})['then'](function(_0x29e60c){if(_0x29e60c){return _0x29e60c[_0x423f('0xc')]({'UserId':_0x4c33c7[_0x423f('0x51')]['id']},{'transaction':_0x43b569});}});});}})[_0x423f('0xd')](handleEntityNotFound(_0x5ae8a9,null))[_0x423f('0xd')](respondWithResult(_0x5ae8a9,null))[_0x423f('0x3e')](handleError(_0x5ae8a9,null));};exports[_0x423f('0x78')]=function(_0x5b9577,_0x4e1e04,_0xd9409e){var _0x320528=[];var _0xe76487=_0x5b9577[_0x423f('0x43')]['id'];var _0x3cffc3=_0x5b9577['user']['id'];return db[_0x423f('0x58')][_0x423f('0x44')]()[_0x423f('0xd')](function(_0x358ab3){_0x320528=_[_0x423f('0x18')](_0x358ab3);return db[_0x423f('0x66')][_0x423f('0x79')](function(_0x1db383){const _0x20bd00={'id':_0xe76487};return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id',_0x423f('0x7a'),_0x423f('0x72')],'where':_0x20bd00,'transaction':_0x1db383,'lock':_0x1db383['LOCK'][_0x423f('0x7b')],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0x320528,'include':[{'model':db[_0x423f('0x75')],'as':_0x423f('0x7c'),'attributes':['id','name']}]},{'model':db[_0x423f('0x7d')],'as':_0x423f('0x7e'),'attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':'Queue','attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})[_0x423f('0xd')](function(_0x3832b6){if(_0x3832b6){return _0x3832b6[_0x423f('0xc')]({'UserId':_0x3cffc3},{'transaction':_0x1db383});}});});})[_0x423f('0xd')](handleEntityNotFound(_0x4e1e04,null))[_0x423f('0xd')](respondWithResult(_0x4e1e04,null))[_0x423f('0x3e')](handleError(_0x4e1e04,null));};exports[_0x423f('0x7f')]=function(_0x22f2af,_0x3c78c7){return _0x22f2af[_0x423f('0x51')][_0x423f('0x80')]({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x423f('0xd')](function(_0x5333b7){if(_0x5333b7&&_0x5333b7['length']){return db[_0x423f('0x39')][_0x423f('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_['map'](_0x5333b7,'id')},'$or':[{'UserId':null},{'UserId':_0x22f2af[_0x423f('0x51')]['id']}]}});}return 0x0;})['then'](function(_0xf18525){if(!_[_0x423f('0x5c')](_0xf18525)&&_[_0x423f('0x81')](_0xf18525)){return _0x3c78c7[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'contacts':_0xf18525});}else{logger['error'](_0x423f('0x82'),'getOpenContacts',0x194,_0x423f('0x83'));_0x3c78c7['sendStatus'](0x194);}})[_0x423f('0x3e')](handleError(_0x3c78c7,null));};exports[_0x423f('0x84')]=function(_0x1990ec,_0x5697e8){var _0xbcf529=shared[_0x423f('0x85')];var _0x3ecfd5=[];_[_0x423f('0x14')](_0xbcf529,function(_0x5baf51){_0x3ecfd5[_0x423f('0x86')]({'id':_0x5baf51[_0x423f('0x11')],'name':_0x5baf51['name'],'utcOffset':_0x5baf51[_0x423f('0x87')]});});return _0x5697e8[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'tz':_0x3ecfd5});};exports[_0x423f('0x88')]=function(_0x36241e,_0x2bb2ba){var _0x140db1=shared[_0x423f('0x85')];var _0x2ede33={};if(!_[_0x423f('0x5c')](_0x140db1[_0x36241e['body']['id']]))_0x2ede33=_0x140db1[_0x36241e['body']['id']];return _0x2bb2ba[_0x423f('0x4')](0xc8)['json'](_0x2ede33);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index fd2bc87..cc183e8 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 _0x5496=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x4071b5,_0x5de4d8){var _0x278260=function(_0x3b0903){while(--_0x3b0903){_0x4071b5['push'](_0x4071b5['shift']());}};_0x278260(++_0x5de4d8);}(_0x5496,0x175));var _0x6549=function(_0x12110d,_0x29b892){_0x12110d=_0x12110d-0x0;var _0x458a5e=_0x5496[_0x12110d];return _0x458a5e;};'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'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('CmHopper',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'phone','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['moment','bluebird','path','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x53ec,0x192));var _0xc53e=function(_0x18c8b5,_0x2a15d3){_0x18c8b5=_0x18c8b5-0x0;var _0x358984=_0x53ec[_0x18c8b5];return _0x358984;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]},{'name':_0xc53e('0xc'),'fields':[_0xc53e('0xc')]},{'name':_0xc53e('0xd'),'fields':[_0xc53e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index d82e9b9..12b2de9 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 _0x5d70=['describe','sequelize','findAll','order','keys','name','voicePause','UserId','push','update','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','transaction','LOCK','GetContactRecallMe','GetCmHopperPreview','Contact','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','User','Agent','List','NOW()','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','options','where','limit','include','map','model','attributes','debug','stringify','message','error','ShowCmHopper','CmHopper','find','raw','then','info','catch','CreateCmHopper','create','body','UpdateCmHopper','active','DestroyCmHopper','destroy','GetContactDialer','CmContact'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5d70,0xc4));var _0x05d7=function(_0x4983a0,_0x4678dc){_0x4983a0=_0x4983a0-0x0;var _0x2cc0f9=_0x5d70[_0x4983a0];return _0x2cc0f9;};'use strict';var _=require(_0x05d7('0x0'));var util=require(_0x05d7('0x1'));var moment=require(_0x05d7('0x2'));var BPromise=require(_0x05d7('0x3'));var db=require(_0x05d7('0x4'))['db'];var logger=require(_0x05d7('0x5'))(_0x05d7('0x6'));exports[_0x05d7('0x7')]=function(_0x3ba8f1){var _0x45dac1=this;return new Promise(function(_0x5527b2,_0x793489){return db['CmHopper']['findAll']({'raw':_0x3ba8f1[_0x05d7('0x8')]?_0x3ba8f1[_0x05d7('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3ba8f1[_0x05d7('0x8')]?_0x3ba8f1[_0x05d7('0x8')][_0x05d7('0x9')]||null:null,'attributes':_0x3ba8f1[_0x05d7('0x8')]?_0x3ba8f1[_0x05d7('0x8')]['attributes']||null:null,'limit':_0x3ba8f1[_0x05d7('0x8')]?_0x3ba8f1[_0x05d7('0x8')][_0x05d7('0xa')]||null:null,'include':_0x3ba8f1['options']?_0x3ba8f1[_0x05d7('0x8')][_0x05d7('0xb')]?_[_0x05d7('0xc')](_0x3ba8f1[_0x05d7('0x8')][_0x05d7('0xb')],function(_0x2d9a62){return{'model':db[_0x2d9a62[_0x05d7('0xd')]],'as':_0x2d9a62['as'],'attributes':_0x2d9a62[_0x05d7('0xe')],'include':_0x2d9a62[_0x05d7('0xb')]?_[_0x05d7('0xc')](_0x2d9a62[_0x05d7('0xb')],function(_0x24d9e0){return{'model':db[_0x24d9e0[_0x05d7('0xd')]],'as':_0x24d9e0['as'],'attributes':_0x24d9e0['attributes'],'include':_0x24d9e0[_0x05d7('0xb')]?_['map'](_0x24d9e0['include'],function(_0x54785e){return{'model':db[_0x54785e[_0x05d7('0xd')]],'as':_0x54785e['as'],'attributes':_0x54785e[_0x05d7('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xca7e3e){logger['info'](_0x05d7('0x7'),_0x3ba8f1);logger[_0x05d7('0xf')](_0x05d7('0x7'),_0x3ba8f1,JSON[_0x05d7('0x10')](_0xca7e3e));_0x5527b2(_0xca7e3e);})['catch'](function(_0x3acb32){logger['error'](_0x05d7('0x7'),_0x3acb32[_0x05d7('0x11')],_0x3ba8f1);_0x793489(_0x45dac1[_0x05d7('0x12')](0x1f4,_0x3acb32[_0x05d7('0x11')]));});});};exports[_0x05d7('0x13')]=function(_0x1b0e64){var _0x5f134f=this;return new Promise(function(_0x462d0f,_0x45a064){return db[_0x05d7('0x14')][_0x05d7('0x15')]({'raw':_0x1b0e64[_0x05d7('0x8')]?_0x1b0e64['options'][_0x05d7('0x16')]===undefined?!![]:![]:!![],'where':_0x1b0e64[_0x05d7('0x8')]?_0x1b0e64['options'][_0x05d7('0x9')]||null:null,'attributes':_0x1b0e64[_0x05d7('0x8')]?_0x1b0e64[_0x05d7('0x8')][_0x05d7('0xe')]||null:null,'include':_0x1b0e64['options']?_0x1b0e64[_0x05d7('0x8')]['include']?_[_0x05d7('0xc')](_0x1b0e64[_0x05d7('0x8')]['include'],function(_0x2f9d50){return{'model':db[_0x2f9d50[_0x05d7('0xd')]],'as':_0x2f9d50['as'],'attributes':_0x2f9d50[_0x05d7('0xe')],'include':_0x2f9d50[_0x05d7('0xb')]?_[_0x05d7('0xc')](_0x2f9d50[_0x05d7('0xb')],function(_0xee1029){return{'model':db[_0xee1029[_0x05d7('0xd')]],'as':_0xee1029['as'],'attributes':_0xee1029[_0x05d7('0xe')],'include':_0xee1029['include']?_[_0x05d7('0xc')](_0xee1029[_0x05d7('0xb')],function(_0x53530b){return{'model':db[_0x53530b[_0x05d7('0xd')]],'as':_0x53530b['as'],'attributes':_0x53530b[_0x05d7('0xe')]};}):[]};}):[]};}):[]:[]})[_0x05d7('0x17')](function(_0x123d16){logger[_0x05d7('0x18')](_0x05d7('0x13'),_0x1b0e64);logger[_0x05d7('0xf')]('ShowCmHopper',_0x1b0e64,JSON[_0x05d7('0x10')](_0x123d16));_0x462d0f(_0x123d16);})[_0x05d7('0x19')](function(_0x1fe2b9){logger['error'](_0x05d7('0x13'),_0x1fe2b9[_0x05d7('0x11')],_0x1b0e64);_0x45a064(_0x5f134f[_0x05d7('0x12')](0x1f4,_0x1fe2b9[_0x05d7('0x11')]));});});};exports[_0x05d7('0x1a')]=function(_0x3be042){var _0x99c3e1=this;return new Promise(function(_0x30ba84,_0xf5ef8a){return db[_0x05d7('0x14')][_0x05d7('0x1b')](_0x3be042[_0x05d7('0x1c')],{'raw':_0x3be042['options']?_0x3be042[_0x05d7('0x8')][_0x05d7('0x16')]===undefined?!![]:![]:!![]})[_0x05d7('0x17')](function(_0x12e6e3){logger[_0x05d7('0x18')](_0x05d7('0x1a'),_0x3be042);logger['debug'](_0x05d7('0x1a'),_0x3be042,JSON[_0x05d7('0x10')](_0x12e6e3));_0x30ba84(_0x12e6e3);})[_0x05d7('0x19')](function(_0x5003e0){logger[_0x05d7('0x12')](_0x05d7('0x1a'),_0x5003e0[_0x05d7('0x11')],_0x3be042);_0xf5ef8a(_0x99c3e1[_0x05d7('0x12')](0x1f4,_0x5003e0['message']));});});};exports['UpdateCmHopper']=function(_0x3dff8d){var _0x271113=this;return new Promise(function(_0x17c661,_0x113911){return db[_0x05d7('0x14')]['update'](_0x3dff8d[_0x05d7('0x1c')],{'raw':_0x3dff8d[_0x05d7('0x8')]?_0x3dff8d['options'][_0x05d7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dff8d[_0x05d7('0x8')]?_0x3dff8d[_0x05d7('0x8')][_0x05d7('0x9')]||null:null,'attributes':_0x3dff8d[_0x05d7('0x8')]?_0x3dff8d[_0x05d7('0x8')][_0x05d7('0xe')]||null:null,'limit':_0x3dff8d[_0x05d7('0x8')]?_0x3dff8d[_0x05d7('0x8')][_0x05d7('0xa')]||null:null})[_0x05d7('0x17')](function(_0x1e50cc){logger[_0x05d7('0x18')](_0x05d7('0x1d'),_0x3dff8d);logger[_0x05d7('0x18')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x05d7('0x10')](_0x3dff8d['options']['where']),_0x3dff8d[_0x05d7('0x1c')][_0x05d7('0x1e')]);logger[_0x05d7('0xf')](_0x05d7('0x1d'),_0x3dff8d,JSON[_0x05d7('0x10')](_0x1e50cc));_0x17c661(_0x1e50cc);})['catch'](function(_0x19aa7a){logger[_0x05d7('0x12')](_0x05d7('0x1d'),_0x19aa7a[_0x05d7('0x11')],_0x3dff8d);_0x113911(_0x271113['error'](0x1f4,_0x19aa7a['message']));});});};exports[_0x05d7('0x1f')]=function(_0x1da969){var _0x1ccf17=this;return new Promise(function(_0x2b34e4,_0x5263ad){return db[_0x05d7('0x14')][_0x05d7('0x20')]({'where':_0x1da969[_0x05d7('0x8')]?_0x1da969[_0x05d7('0x8')][_0x05d7('0x9')]||null:null})['then'](function(_0x3b7da2){logger[_0x05d7('0x18')]('DestroyCmHopper',_0x1da969);logger[_0x05d7('0xf')]('DestroyCmHopper',_0x1da969,JSON[_0x05d7('0x10')](_0x3b7da2));_0x2b34e4(_0x3b7da2);})[_0x05d7('0x19')](function(_0x494105){logger[_0x05d7('0x12')]('DestroyCmHopper',_0x494105[_0x05d7('0x11')],_0x1da969);_0x5263ad(_0x1ccf17[_0x05d7('0x12')](0x1f4,_0x494105[_0x05d7('0x11')]));});});};exports[_0x05d7('0x21')]=function(_0xa5a54d){var _0x55c364=this;return new Promise(function(_0x2a36ee,_0x286876){return db[_0x05d7('0x22')][_0x05d7('0x23')]()[_0x05d7('0x17')](function(_0x4bc962){return db[_0x05d7('0x24')]['transaction'](function(_0x1814f3){return db[_0x05d7('0x14')][_0x05d7('0x25')]({'where':_0xa5a54d[_0x05d7('0x8')]?_0xa5a54d[_0x05d7('0x8')][_0x05d7('0x9')]||null:null,'attributes':_0xa5a54d[_0x05d7('0x8')]?_0xa5a54d['options'][_0x05d7('0xe')]||null:null,'limit':_0xa5a54d[_0x05d7('0x8')]?_0xa5a54d[_0x05d7('0x8')][_0x05d7('0xa')]||null:null,'order':_0xa5a54d[_0x05d7('0x8')]?_0xa5a54d[_0x05d7('0x8')][_0x05d7('0x26')]||null:null,'transaction':_0x1814f3,'lock':_0x1814f3['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x05d7('0x27')](_0x4bc962)},{'model':db['User'],'as':'Agent','attributes':['id',_0x05d7('0x28'),_0x05d7('0x29')]}]})['then'](function(_0x1de358){var _0x42be5b=[];var _0x650906=[];for(var _0x268a0d=0x0;_0x268a0d<_0x1de358['length'];_0x268a0d+=0x1){var _0x7890b7=_0x1de358[_0x268a0d][_0x05d7('0x2a')];if(_0x7890b7===null){_0x42be5b[_0x05d7('0x2b')](_0x1de358[_0x268a0d][_0x05d7('0x2c')](_0xa5a54d[_0x05d7('0x1c')],{'transaction':_0x1814f3}));}else if(!_0x650906[_0x05d7('0x2d')](_0x7890b7)){_0x650906['push'](_0x7890b7);_0x42be5b[_0x05d7('0x2b')](_0x1de358[_0x268a0d]['update'](_0xa5a54d[_0x05d7('0x1c')],{'transaction':_0x1814f3}));}}return BPromise[_0x05d7('0x2e')](_0x42be5b);});})['then'](function(_0x456017){logger['info'](_0x05d7('0x21'),_0xa5a54d);if(_0x456017[_0x05d7('0x2f')]>0x0){logger[_0x05d7('0x18')](_0x05d7('0x30'),_0x456017[0x0]['dataValues']['id'],_0x456017[0x0]['dataValues']['ContactId'],_0x456017[0x0][_0x05d7('0x31')]['active']);}logger['debug'](_0x05d7('0x21'),_0xa5a54d,JSON[_0x05d7('0x10')](_0x456017));_0x2a36ee(_0x456017);})['catch'](function(_0x2898d8){logger[_0x05d7('0x12')](_0x05d7('0x21'),_0x2898d8['message'],_0xa5a54d);_0x286876(_0x55c364[_0x05d7('0x12')](0x1f4,_0x2898d8[_0x05d7('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x579f9b){var _0x5bf669=this;return new Promise(function(_0x4ac9e9,_0x11fcba){return db[_0x05d7('0x24')]['transaction'](function(_0x3f42fa){return db['CmHopperFinal'][_0x05d7('0x1b')](_0x579f9b[_0x05d7('0x1c')],{'raw':_0x579f9b[_0x05d7('0x8')]?_0x579f9b[_0x05d7('0x8')][_0x05d7('0x16')]===undefined?!![]:![]:!![],'transaction':_0x3f42fa})[_0x05d7('0x17')](function(){logger[_0x05d7('0x18')](_0x05d7('0x32'),JSON[_0x05d7('0x10')](_0x579f9b[_0x05d7('0x8')]['where']),_0x579f9b[_0x05d7('0x8')][_0x05d7('0x9')][_0x05d7('0x1e')]);return db[_0x05d7('0x14')]['destroy']({'where':_0x579f9b[_0x05d7('0x8')]?_0x579f9b[_0x05d7('0x8')][_0x05d7('0x9')]||null:null,'transaction':_0x3f42fa});});})[_0x05d7('0x17')](function(_0x4dc884){logger[_0x05d7('0x18')](_0x05d7('0x33'),_0x579f9b);logger[_0x05d7('0xf')]('MoveContactManagedDialer',_0x579f9b,JSON[_0x05d7('0x10')](_0x4dc884));_0x4ac9e9(_0x4dc884);})['catch'](function(_0x1c4c99){logger[_0x05d7('0x12')](_0x05d7('0x33'),_0x1c4c99[_0x05d7('0x11')],_0x579f9b);_0x11fcba(_0x5bf669[_0x05d7('0x12')](0x1f4,_0x1c4c99[_0x05d7('0x11')]));});});};exports[_0x05d7('0x34')]=function(_0x5b89aa){var _0x441130=this;return new Promise(function(_0x1368d8,_0x247a73){return db[_0x05d7('0x14')]['findAll']({'raw':_0x5b89aa[_0x05d7('0x8')]?_0x5b89aa[_0x05d7('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5b89aa[_0x05d7('0x8')]?_0x5b89aa['options'][_0x05d7('0x9')]||null:null,'attributes':[[db[_0x05d7('0x24')]['fn'](_0x05d7('0x35'),db['sequelize']['fn']('IF',db[_0x05d7('0x24')][_0x05d7('0x36')](_0x05d7('0x37')+util['format']('\x22%s\x22',moment()['format'](_0x05d7('0x38')))+_0x05d7('0x39')))),_0x05d7('0x3a')]]})['then'](function(_0x4b96a9){logger[_0x05d7('0x18')](_0x05d7('0x34'),_0x5b89aa);logger[_0x05d7('0xf')]('CountReScheduled',_0x5b89aa,JSON[_0x05d7('0x10')](_0x4b96a9));_0x1368d8(_0x4b96a9);})[_0x05d7('0x19')](function(_0xc9d372){logger[_0x05d7('0x12')]('CountReScheduled',_0xc9d372['message'],_0x5b89aa);_0x247a73(_0x441130[_0x05d7('0x12')](0x1f4,_0xc9d372['message']));});});};exports['GetContactRecallMe']=function(_0x27269c){var _0x1b4b9b=this;return new Promise(function(_0x2e189e,_0x3478e5){return db[_0x05d7('0x22')]['describe']()[_0x05d7('0x17')](function(){return db[_0x05d7('0x24')][_0x05d7('0x3b')](function(_0x39a1de){return db[_0x05d7('0x14')]['findAll']({'where':_0x27269c[_0x05d7('0x8')]?_0x27269c['options'][_0x05d7('0x9')]||null:null,'attributes':_0x27269c['options']?_0x27269c[_0x05d7('0x8')]['attributes']||null:null,'limit':0x1,'order':_0x27269c[_0x05d7('0x8')]?_0x27269c[_0x05d7('0x8')][_0x05d7('0x26')]||null:null,'group':db[_0x05d7('0x14')][_0x05d7('0x2a')],'transaction':_0x39a1de,'lock':_0x39a1de[_0x05d7('0x3c')]['UPDATE'],'include':_0x27269c[_0x05d7('0x8')]?_0x27269c[_0x05d7('0x8')][_0x05d7('0xb')]?_['map'](_0x27269c[_0x05d7('0x8')][_0x05d7('0xb')],function(_0x2976c4){return{'model':db[_0x2976c4['model']],'as':_0x2976c4['as'],'attributes':_0x2976c4[_0x05d7('0xe')],'include':_0x2976c4[_0x05d7('0xb')]?_['map'](_0x2976c4[_0x05d7('0xb')],function(_0x26cb9e){return{'model':db[_0x26cb9e[_0x05d7('0xd')]],'as':_0x26cb9e['as'],'attributes':_0x26cb9e[_0x05d7('0xe')],'include':_0x26cb9e[_0x05d7('0xb')]?_[_0x05d7('0xc')](_0x26cb9e[_0x05d7('0xb')],function(_0x47510c){return{'model':db[_0x47510c[_0x05d7('0xd')]],'as':_0x47510c['as'],'attributes':_0x47510c[_0x05d7('0xe')]};}):[]};}):[]};}):[]:[]})[_0x05d7('0x17')](function(_0xe6ef23){var _0x3b02f8=[];for(var _0x7795f8=0x0;_0x7795f8<_0xe6ef23['length'];_0x7795f8+=0x1){_0x3b02f8[_0x05d7('0x2b')](_0xe6ef23[_0x7795f8][_0x05d7('0x2c')](_0x27269c['body'],{'transaction':_0x39a1de}));}return BPromise[_0x05d7('0x2e')](_0x3b02f8);});})[_0x05d7('0x17')](function(_0x543e76){logger[_0x05d7('0x18')](_0x05d7('0x3d'),_0x27269c);logger[_0x05d7('0xf')]('GetContactRecallMe',_0x27269c,JSON[_0x05d7('0x10')](_0x543e76));_0x2e189e(_0x543e76);})['catch'](function(_0x400e32){logger['error'](_0x05d7('0x3d'),_0x400e32[_0x05d7('0x11')],_0x27269c);_0x3478e5(_0x1b4b9b[_0x05d7('0x12')](0x1f4,_0x400e32[_0x05d7('0x11')]));});});});};exports[_0x05d7('0x3e')]=function(_0x1cc8df){var _0x53b279=this;return new Promise(function(_0x391ea2,_0x1ab042){db[_0x05d7('0x22')][_0x05d7('0x23')]()['then'](function(_0xe55561){return db['CmHopper'][_0x05d7('0x25')]({'raw':_0x1cc8df[_0x05d7('0x8')]?_0x1cc8df[_0x05d7('0x8')][_0x05d7('0x16')]===undefined?!![]:![]:!![],'where':_0x1cc8df['options']?_0x1cc8df['options'][_0x05d7('0x9')]||null:null,'attributes':_0x1cc8df[_0x05d7('0x8')]?_0x1cc8df[_0x05d7('0x8')][_0x05d7('0xe')]||null:null,'limit':_0x1cc8df['options']?_0x1cc8df['options'][_0x05d7('0xa')]||null:null,'include':_0x1cc8df[_0x05d7('0x8')]?_0x1cc8df[_0x05d7('0x8')]['include']?_[_0x05d7('0xc')](_0x1cc8df[_0x05d7('0x8')][_0x05d7('0xb')],function(_0x46c417){return{'model':db[_0x46c417[_0x05d7('0xd')]],'as':_0x46c417['as'],'attributes':_0x46c417['as']===_0x05d7('0x3f')?_[_0x05d7('0x27')](_0xe55561):_0x46c417[_0x05d7('0xe')],'include':_0x46c417[_0x05d7('0xb')]?_[_0x05d7('0xc')](_0x46c417[_0x05d7('0xb')],function(_0x496313){return{'model':db[_0x496313[_0x05d7('0xd')]],'as':_0x496313['as'],'attributes':_0x496313[_0x05d7('0xe')],'include':_0x496313[_0x05d7('0xb')]?_['map'](_0x496313[_0x05d7('0xb')],function(_0x25e347){return{'model':db[_0x25e347[_0x05d7('0xd')]],'as':_0x25e347['as'],'attributes':_0x25e347[_0x05d7('0xe')]};}):[]};}):[]};}):[]:[]})[_0x05d7('0x17')](function(_0x383830){logger[_0x05d7('0x18')](_0x05d7('0x7'),_0x1cc8df);logger[_0x05d7('0xf')](_0x05d7('0x7'),_0x1cc8df,JSON['stringify'](_0x383830));_0x391ea2(_0x383830);})['catch'](function(_0x961c8e){logger[_0x05d7('0x12')](_0x05d7('0x7'),_0x961c8e['message'],_0x1cc8df);_0x1ab042(_0x53b279['error'](0x1f4,_0x961c8e[_0x05d7('0x11')]));});});});};exports['GetContactByPhone']=function(_0x7c32e7){var _0x305ca3=this;return new Promise(function(_0x1dda0c,_0x1e8625){return db[_0x05d7('0x22')][_0x05d7('0x40')]({'raw':!![],'where':{'phone':_0x7c32e7[_0x05d7('0x8')]['where'][_0x05d7('0x41')]},'attributes':['id','dialTimezone'],'order':[['id',_0x05d7('0x42')]]})[_0x05d7('0x17')](function(_0x2df758){logger[_0x05d7('0x18')](_0x05d7('0x43'),_0x7c32e7);logger[_0x05d7('0xf')](_0x05d7('0x43'),_0x7c32e7,JSON['stringify'](_0x2df758));_0x1dda0c(_0x2df758);})[_0x05d7('0x19')](function(_0x553eb4){logger[_0x05d7('0x12')](_0x05d7('0x43'),_0x553eb4[_0x05d7('0x11')],_0x7c32e7);_0x1e8625(_0x305ca3[_0x05d7('0x12')](0x1f4,_0x553eb4[_0x05d7('0x11')]));});});};exports[_0x05d7('0x44')]=function(_0x12f473){var _0x130c2=this;return new Promise(function(_0x18d6e9,_0x470fcd){return db[_0x05d7('0x24')][_0x05d7('0x3b')](function(_0x12ee04){var _0x18871d=_0x12f473[_0x05d7('0x8')]&&_0x12f473[_0x05d7('0x8')]['where']?_0x12f473[_0x05d7('0x8')][_0x05d7('0x9')]:{};return db[_0x05d7('0x14')]['update'](_0x12f473[_0x05d7('0x1c')],{'where':_0x18871d,'transaction':_0x12ee04})['then'](function(_0x1fb626){logger['info'](_0x05d7('0x44'),_0x12f473);logger[_0x05d7('0xf')]('ResetActiveCalls',_0x12f473,JSON['stringify'](_0x1fb626));_0x18d6e9(_0x1fb626);})['catch'](function(_0x4db82a){logger[_0x05d7('0x12')](_0x05d7('0x44'),_0x4db82a['message'],_0x12f473);_0x470fcd(_0x130c2[_0x05d7('0x12')](0x1f4,_0x4db82a[_0x05d7('0x11')]));});});});};exports[_0x05d7('0x45')]=function(_0xcbee08){var _0x370cb7=this;var _0x2a7702=_0xcbee08['body'][_0x05d7('0x9')][_0x05d7('0x46')];var _0x38c7d7=_0xcbee08['body'][_0x05d7('0x9')][_0x05d7('0x47')];var _0x3f3307=_0xcbee08[_0x05d7('0x1c')]['where'][_0x05d7('0x48')];return new Promise(function(_0xce562f,_0x4ab209){return db[_0x05d7('0x14')][_0x05d7('0x25')]({'where':{'voiceQueueId':{'$in':_0x2a7702},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x05d7('0x24')][_0x05d7('0x36')]('NOW()\x20+\x20INTERVAL\x20'+_0x38c7d7+'\x20MINUTE'),'$gt':db[_0x05d7('0x24')][_0x05d7('0x36')]('NOW()')}},'UserId':{'$in':_0x3f3307}},'include':[{'model':db[_0x05d7('0x22')],'as':'Contact'},{'model':db[_0x05d7('0x49')],'as':_0x05d7('0x4a'),'attributes':['id',_0x05d7('0x28'),_0x05d7('0x29')]},{'model':db['CmList'],'as':_0x05d7('0x4b')}]})[_0x05d7('0x17')](function(_0x1960ad){if(_0x1960ad[_0x05d7('0x2f')]>0x0){return db[_0x05d7('0x24')][_0x05d7('0x3b')](function(_0x3d5638){return db[_0x05d7('0x14')][_0x05d7('0x2c')]({'recallmeNotifiedDate':db[_0x05d7('0x24')]['literal'](_0x05d7('0x4c'))},{'where':{'id':{'$in':_['map'](_0x1960ad,'id')}},'transaction':_0x3d5638})[_0x05d7('0x17')](function(){_0xce562f(_0x1960ad);})[_0x05d7('0x19')](function(_0x3e3d1f){logger[_0x05d7('0x12')](_0x05d7('0x45'),_0x3e3d1f[_0x05d7('0x11')],_0xcbee08);_0x4ab209(_0x370cb7[_0x05d7('0x12')](0x1f4,_0x3e3d1f[_0x05d7('0x11')]));});})[_0x05d7('0x19')](function(_0xe2f55e){logger[_0x05d7('0x12')]('CmHopperHandlePreviewRecallNotifications',_0xe2f55e[_0x05d7('0x11')],_0xcbee08);_0x4ab209(_0x370cb7['error'](0x1f4,_0xe2f55e[_0x05d7('0x11')]));});}else{_0xce562f(_0x1960ad);}});});}; \ No newline at end of file +var _0xa72a=['order','LOCK','keys','User','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','create','CountReScheduled','findAll','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','Contact','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','moment','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','options','where','attributes','limit','map','include','model','then','info','debug','catch','message','error','find','raw','ShowCmHopper','CreateCmHopper','body','stringify','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x419fb7,_0x568091){var _0x34dd57=function(_0x2f3f20){while(--_0x2f3f20){_0x419fb7['push'](_0x419fb7['shift']());}};_0x34dd57(++_0x568091);}(_0xa72a,0xc8));var _0xaa72=function(_0x221a9f,_0x2a5e1c){_0x221a9f=_0x221a9f-0x0;var _0x5976c7=_0xa72a[_0x221a9f];return _0x5976c7;};'use strict';var _=require(_0xaa72('0x0'));var util=require('util');var moment=require(_0xaa72('0x1'));var BPromise=require(_0xaa72('0x2'));var db=require(_0xaa72('0x3'))['db'];var logger=require('../../config/logger')(_0xaa72('0x4'));exports[_0xaa72('0x5')]=function(_0xaa14c0){var _0x4d9bd6=this;return new Promise(function(_0x50133e,_0x8b8b1b){return db[_0xaa72('0x6')]['findAll']({'raw':_0xaa14c0['options']?_0xaa14c0[_0xaa72('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0xaa14c0[_0xaa72('0x7')]?_0xaa14c0[_0xaa72('0x7')][_0xaa72('0x8')]||null:null,'attributes':_0xaa14c0['options']?_0xaa14c0[_0xaa72('0x7')][_0xaa72('0x9')]||null:null,'limit':_0xaa14c0[_0xaa72('0x7')]?_0xaa14c0[_0xaa72('0x7')][_0xaa72('0xa')]||null:null,'include':_0xaa14c0[_0xaa72('0x7')]?_0xaa14c0[_0xaa72('0x7')]['include']?_[_0xaa72('0xb')](_0xaa14c0['options'][_0xaa72('0xc')],function(_0x4d8613){return{'model':db[_0x4d8613[_0xaa72('0xd')]],'as':_0x4d8613['as'],'attributes':_0x4d8613[_0xaa72('0x9')],'include':_0x4d8613[_0xaa72('0xc')]?_[_0xaa72('0xb')](_0x4d8613['include'],function(_0x3fa878){return{'model':db[_0x3fa878[_0xaa72('0xd')]],'as':_0x3fa878['as'],'attributes':_0x3fa878[_0xaa72('0x9')],'include':_0x3fa878[_0xaa72('0xc')]?_[_0xaa72('0xb')](_0x3fa878['include'],function(_0x3aa9ee){return{'model':db[_0x3aa9ee[_0xaa72('0xd')]],'as':_0x3aa9ee['as'],'attributes':_0x3aa9ee[_0xaa72('0x9')]};}):[]};}):[]};}):[]:[]})[_0xaa72('0xe')](function(_0x3d78a2){logger[_0xaa72('0xf')]('GetCmHopper',_0xaa14c0);logger[_0xaa72('0x10')](_0xaa72('0x5'),_0xaa14c0,JSON['stringify'](_0x3d78a2));_0x50133e(_0x3d78a2);})[_0xaa72('0x11')](function(_0x56af80){logger['error'](_0xaa72('0x5'),_0x56af80[_0xaa72('0x12')],_0xaa14c0);_0x8b8b1b(_0x4d9bd6[_0xaa72('0x13')](0x1f4,_0x56af80[_0xaa72('0x12')]));});});};exports['ShowCmHopper']=function(_0x4ac74c){var _0x3b80e5=this;return new Promise(function(_0x2fc82e,_0x425725){return db['CmHopper'][_0xaa72('0x14')]({'raw':_0x4ac74c[_0xaa72('0x7')]?_0x4ac74c[_0xaa72('0x7')][_0xaa72('0x15')]===undefined?!![]:![]:!![],'where':_0x4ac74c['options']?_0x4ac74c['options'][_0xaa72('0x8')]||null:null,'attributes':_0x4ac74c[_0xaa72('0x7')]?_0x4ac74c['options']['attributes']||null:null,'include':_0x4ac74c[_0xaa72('0x7')]?_0x4ac74c['options'][_0xaa72('0xc')]?_['map'](_0x4ac74c[_0xaa72('0x7')][_0xaa72('0xc')],function(_0x10f9be){return{'model':db[_0x10f9be[_0xaa72('0xd')]],'as':_0x10f9be['as'],'attributes':_0x10f9be[_0xaa72('0x9')],'include':_0x10f9be[_0xaa72('0xc')]?_[_0xaa72('0xb')](_0x10f9be[_0xaa72('0xc')],function(_0x4493ca){return{'model':db[_0x4493ca[_0xaa72('0xd')]],'as':_0x4493ca['as'],'attributes':_0x4493ca['attributes'],'include':_0x4493ca['include']?_[_0xaa72('0xb')](_0x4493ca[_0xaa72('0xc')],function(_0x27df84){return{'model':db[_0x27df84[_0xaa72('0xd')]],'as':_0x27df84['as'],'attributes':_0x27df84['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa72('0xe')](function(_0x2f9cf9){logger['info'](_0xaa72('0x16'),_0x4ac74c);logger[_0xaa72('0x10')](_0xaa72('0x16'),_0x4ac74c,JSON['stringify'](_0x2f9cf9));_0x2fc82e(_0x2f9cf9);})[_0xaa72('0x11')](function(_0x1aa27d){logger[_0xaa72('0x13')](_0xaa72('0x16'),_0x1aa27d[_0xaa72('0x12')],_0x4ac74c);_0x425725(_0x3b80e5['error'](0x1f4,_0x1aa27d[_0xaa72('0x12')]));});});};exports[_0xaa72('0x17')]=function(_0xf10985){var _0x4f2306=this;return new Promise(function(_0x181abe,_0x34ac31){return db[_0xaa72('0x6')]['create'](_0xf10985[_0xaa72('0x18')],{'raw':_0xf10985['options']?_0xf10985['options'][_0xaa72('0x15')]===undefined?!![]:![]:!![]})[_0xaa72('0xe')](function(_0x5bba33){logger[_0xaa72('0xf')](_0xaa72('0x17'),_0xf10985);logger[_0xaa72('0x10')](_0xaa72('0x17'),_0xf10985,JSON[_0xaa72('0x19')](_0x5bba33));_0x181abe(_0x5bba33);})[_0xaa72('0x11')](function(_0x306e71){logger[_0xaa72('0x13')](_0xaa72('0x17'),_0x306e71[_0xaa72('0x12')],_0xf10985);_0x34ac31(_0x4f2306[_0xaa72('0x13')](0x1f4,_0x306e71[_0xaa72('0x12')]));});});};exports[_0xaa72('0x1a')]=function(_0x49c9db){var _0x27c8fa=this;return new Promise(function(_0x2ef12d,_0x11a77e){return db['CmHopper'][_0xaa72('0x1b')](_0x49c9db[_0xaa72('0x18')],{'raw':_0x49c9db[_0xaa72('0x7')]?_0x49c9db[_0xaa72('0x7')][_0xaa72('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49c9db[_0xaa72('0x7')]?_0x49c9db[_0xaa72('0x7')][_0xaa72('0x8')]||null:null,'attributes':_0x49c9db['options']?_0x49c9db[_0xaa72('0x7')][_0xaa72('0x9')]||null:null,'limit':_0x49c9db[_0xaa72('0x7')]?_0x49c9db[_0xaa72('0x7')][_0xaa72('0xa')]||null:null})[_0xaa72('0xe')](function(_0x1f46f7){logger[_0xaa72('0xf')](_0xaa72('0x1a'),_0x49c9db);logger[_0xaa72('0xf')](_0xaa72('0x1c'),JSON[_0xaa72('0x19')](_0x49c9db[_0xaa72('0x7')][_0xaa72('0x8')]),_0x49c9db[_0xaa72('0x18')][_0xaa72('0x1d')]);logger['debug'](_0xaa72('0x1a'),_0x49c9db,JSON[_0xaa72('0x19')](_0x1f46f7));_0x2ef12d(_0x1f46f7);})['catch'](function(_0x5d1ec2){logger[_0xaa72('0x13')](_0xaa72('0x1a'),_0x5d1ec2[_0xaa72('0x12')],_0x49c9db);_0x11a77e(_0x27c8fa['error'](0x1f4,_0x5d1ec2[_0xaa72('0x12')]));});});};exports[_0xaa72('0x1e')]=function(_0x3c4694){var _0x46b2d1=this;return new Promise(function(_0x22b8d1,_0x3be8d8){return db[_0xaa72('0x6')][_0xaa72('0x1f')]({'where':_0x3c4694[_0xaa72('0x7')]?_0x3c4694['options']['where']||null:null})['then'](function(_0x54888c){logger['info']('DestroyCmHopper',_0x3c4694);logger['debug'](_0xaa72('0x1e'),_0x3c4694,JSON['stringify'](_0x54888c));_0x22b8d1(_0x54888c);})['catch'](function(_0x4a2f5f){logger[_0xaa72('0x13')]('DestroyCmHopper',_0x4a2f5f[_0xaa72('0x12')],_0x3c4694);_0x3be8d8(_0x46b2d1['error'](0x1f4,_0x4a2f5f[_0xaa72('0x12')]));});});};exports[_0xaa72('0x20')]=function(_0x107dbd){var _0x24602b=this;return new Promise(function(_0xee24d9,_0x3de0db){return db[_0xaa72('0x21')][_0xaa72('0x22')]()[_0xaa72('0xe')](function(_0x38f071){return db[_0xaa72('0x23')][_0xaa72('0x24')](function(_0x1cd01a){return db['CmHopper']['findAll']({'where':_0x107dbd[_0xaa72('0x7')]?_0x107dbd['options']['where']||null:null,'attributes':_0x107dbd[_0xaa72('0x7')]?_0x107dbd['options']['attributes']||null:null,'limit':_0x107dbd['options']?_0x107dbd['options'][_0xaa72('0xa')]||null:null,'order':_0x107dbd[_0xaa72('0x7')]?_0x107dbd[_0xaa72('0x7')][_0xaa72('0x25')]||null:null,'transaction':_0x1cd01a,'lock':_0x1cd01a[_0xaa72('0x26')]['UPDATE'],'include':[{'model':db[_0xaa72('0x21')],'as':'Contact','attributes':_[_0xaa72('0x27')](_0x38f071)},{'model':db[_0xaa72('0x28')],'as':'Agent','attributes':['id',_0xaa72('0x29'),_0xaa72('0x2a')]}]})[_0xaa72('0xe')](function(_0x26bc9e){var _0x3dc517=[];var _0x284a9c=[];for(var _0x29783c=0x0;_0x29783c<_0x26bc9e[_0xaa72('0x2b')];_0x29783c+=0x1){var _0x33b701=_0x26bc9e[_0x29783c][_0xaa72('0x2c')];if(_0x33b701===null){_0x3dc517[_0xaa72('0x2d')](_0x26bc9e[_0x29783c][_0xaa72('0x1b')](_0x107dbd['body'],{'transaction':_0x1cd01a}));}else if(!_0x284a9c[_0xaa72('0x2e')](_0x33b701)){_0x284a9c['push'](_0x33b701);_0x3dc517['push'](_0x26bc9e[_0x29783c]['update'](_0x107dbd['body'],{'transaction':_0x1cd01a}));}}return BPromise[_0xaa72('0x2f')](_0x3dc517);});})['then'](function(_0x135687){logger['info'](_0xaa72('0x20'),_0x107dbd);if(_0x135687[_0xaa72('0x2b')]>0x0){logger[_0xaa72('0xf')](_0xaa72('0x30'),_0x135687[0x0][_0xaa72('0x31')]['id'],_0x135687[0x0][_0xaa72('0x31')]['ContactId'],_0x135687[0x0][_0xaa72('0x31')]['active']);}logger[_0xaa72('0x10')](_0xaa72('0x20'),_0x107dbd,JSON[_0xaa72('0x19')](_0x135687));_0xee24d9(_0x135687);})[_0xaa72('0x11')](function(_0x355f3e){logger[_0xaa72('0x13')](_0xaa72('0x20'),_0x355f3e[_0xaa72('0x12')],_0x107dbd);_0x3de0db(_0x24602b[_0xaa72('0x13')](0x1f4,_0x355f3e[_0xaa72('0x12')]));});});});};exports[_0xaa72('0x32')]=function(_0x336e1d){var _0x544b5b=this;return new Promise(function(_0x5690f9,_0x302b0d){return db[_0xaa72('0x23')]['transaction'](function(_0xb9a4d2){return db['CmHopperFinal'][_0xaa72('0x33')](_0x336e1d[_0xaa72('0x18')],{'raw':_0x336e1d['options']?_0x336e1d[_0xaa72('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0xb9a4d2})['then'](function(){logger[_0xaa72('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xaa72('0x19')](_0x336e1d[_0xaa72('0x7')]['where']),_0x336e1d[_0xaa72('0x7')]['where'][_0xaa72('0x1d')]);return db[_0xaa72('0x6')][_0xaa72('0x1f')]({'where':_0x336e1d[_0xaa72('0x7')]?_0x336e1d[_0xaa72('0x7')][_0xaa72('0x8')]||null:null,'transaction':_0xb9a4d2});});})[_0xaa72('0xe')](function(_0x2fe3c0){logger['info'](_0xaa72('0x32'),_0x336e1d);logger[_0xaa72('0x10')](_0xaa72('0x32'),_0x336e1d,JSON['stringify'](_0x2fe3c0));_0x5690f9(_0x2fe3c0);})['catch'](function(_0x4e3fbd){logger[_0xaa72('0x13')]('MoveContactManagedDialer',_0x4e3fbd[_0xaa72('0x12')],_0x336e1d);_0x302b0d(_0x544b5b[_0xaa72('0x13')](0x1f4,_0x4e3fbd[_0xaa72('0x12')]));});});};exports[_0xaa72('0x34')]=function(_0x11e45a){var _0x1cfd2f=this;return new Promise(function(_0x29aecb,_0x49c59a){return db[_0xaa72('0x6')][_0xaa72('0x35')]({'raw':_0x11e45a['options']?_0x11e45a['options'][_0xaa72('0x15')]===undefined?!![]:![]:!![],'where':_0x11e45a['options']?_0x11e45a['options'][_0xaa72('0x8')]||null:null,'attributes':[[db[_0xaa72('0x23')]['fn'](_0xaa72('0x36'),db['sequelize']['fn']('IF',db[_0xaa72('0x23')][_0xaa72('0x37')](_0xaa72('0x38')+util[_0xaa72('0x39')](_0xaa72('0x3a'),moment()[_0xaa72('0x39')](_0xaa72('0x3b')))+_0xaa72('0x3c')))),_0xaa72('0x3d')]]})['then'](function(_0xaaf4ce){logger[_0xaa72('0xf')](_0xaa72('0x34'),_0x11e45a);logger[_0xaa72('0x10')](_0xaa72('0x34'),_0x11e45a,JSON[_0xaa72('0x19')](_0xaaf4ce));_0x29aecb(_0xaaf4ce);})[_0xaa72('0x11')](function(_0x4126e1){logger[_0xaa72('0x13')](_0xaa72('0x34'),_0x4126e1[_0xaa72('0x12')],_0x11e45a);_0x49c59a(_0x1cfd2f[_0xaa72('0x13')](0x1f4,_0x4126e1['message']));});});};exports[_0xaa72('0x3e')]=function(_0x4c48f8){var _0x17c981=this;return new Promise(function(_0xfa9393,_0xba82ea){return db['CmContact']['describe']()['then'](function(){return db[_0xaa72('0x23')]['transaction'](function(_0x34580e){return db[_0xaa72('0x6')][_0xaa72('0x35')]({'where':_0x4c48f8['options']?_0x4c48f8[_0xaa72('0x7')]['where']||null:null,'attributes':_0x4c48f8[_0xaa72('0x7')]?_0x4c48f8[_0xaa72('0x7')][_0xaa72('0x9')]||null:null,'limit':0x1,'order':_0x4c48f8[_0xaa72('0x7')]?_0x4c48f8[_0xaa72('0x7')][_0xaa72('0x25')]||null:null,'group':db[_0xaa72('0x6')]['UserId'],'transaction':_0x34580e,'lock':_0x34580e[_0xaa72('0x26')][_0xaa72('0x3f')],'include':_0x4c48f8[_0xaa72('0x7')]?_0x4c48f8[_0xaa72('0x7')][_0xaa72('0xc')]?_['map'](_0x4c48f8[_0xaa72('0x7')][_0xaa72('0xc')],function(_0x9d8b42){return{'model':db[_0x9d8b42['model']],'as':_0x9d8b42['as'],'attributes':_0x9d8b42[_0xaa72('0x9')],'include':_0x9d8b42[_0xaa72('0xc')]?_['map'](_0x9d8b42[_0xaa72('0xc')],function(_0x1b650d){return{'model':db[_0x1b650d[_0xaa72('0xd')]],'as':_0x1b650d['as'],'attributes':_0x1b650d[_0xaa72('0x9')],'include':_0x1b650d['include']?_[_0xaa72('0xb')](_0x1b650d[_0xaa72('0xc')],function(_0x312433){return{'model':db[_0x312433[_0xaa72('0xd')]],'as':_0x312433['as'],'attributes':_0x312433[_0xaa72('0x9')]};}):[]};}):[]};}):[]:[]})[_0xaa72('0xe')](function(_0x2c83f0){var _0x37e9a1=[];for(var _0x2a6f8c=0x0;_0x2a6f8c<_0x2c83f0[_0xaa72('0x2b')];_0x2a6f8c+=0x1){_0x37e9a1[_0xaa72('0x2d')](_0x2c83f0[_0x2a6f8c][_0xaa72('0x1b')](_0x4c48f8['body'],{'transaction':_0x34580e}));}return BPromise[_0xaa72('0x2f')](_0x37e9a1);});})['then'](function(_0x5ccf2d){logger['info']('GetContactRecallMe',_0x4c48f8);logger['debug'](_0xaa72('0x3e'),_0x4c48f8,JSON[_0xaa72('0x19')](_0x5ccf2d));_0xfa9393(_0x5ccf2d);})['catch'](function(_0x5df3b7){logger[_0xaa72('0x13')]('GetContactRecallMe',_0x5df3b7['message'],_0x4c48f8);_0xba82ea(_0x17c981[_0xaa72('0x13')](0x1f4,_0x5df3b7[_0xaa72('0x12')]));});});});};exports[_0xaa72('0x40')]=function(_0x2da9ac){var _0x1b2cd9=this;return new Promise(function(_0x55d7b6,_0x22a1a2){db[_0xaa72('0x21')][_0xaa72('0x22')]()[_0xaa72('0xe')](function(_0xc29cd9){return db[_0xaa72('0x6')]['findAll']({'raw':_0x2da9ac['options']?_0x2da9ac[_0xaa72('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x2da9ac[_0xaa72('0x7')]?_0x2da9ac['options']['where']||null:null,'attributes':_0x2da9ac[_0xaa72('0x7')]?_0x2da9ac[_0xaa72('0x7')][_0xaa72('0x9')]||null:null,'limit':_0x2da9ac[_0xaa72('0x7')]?_0x2da9ac[_0xaa72('0x7')][_0xaa72('0xa')]||null:null,'include':_0x2da9ac['options']?_0x2da9ac[_0xaa72('0x7')]['include']?_[_0xaa72('0xb')](_0x2da9ac[_0xaa72('0x7')][_0xaa72('0xc')],function(_0x104ccd){return{'model':db[_0x104ccd['model']],'as':_0x104ccd['as'],'attributes':_0x104ccd['as']===_0xaa72('0x41')?_['keys'](_0xc29cd9):_0x104ccd[_0xaa72('0x9')],'include':_0x104ccd[_0xaa72('0xc')]?_['map'](_0x104ccd['include'],function(_0xc339c1){return{'model':db[_0xc339c1[_0xaa72('0xd')]],'as':_0xc339c1['as'],'attributes':_0xc339c1['attributes'],'include':_0xc339c1[_0xaa72('0xc')]?_['map'](_0xc339c1['include'],function(_0x380d8c){return{'model':db[_0x380d8c[_0xaa72('0xd')]],'as':_0x380d8c['as'],'attributes':_0x380d8c[_0xaa72('0x9')]};}):[]};}):[]};}):[]:[]})[_0xaa72('0xe')](function(_0x3d9526){logger[_0xaa72('0xf')]('GetCmHopper',_0x2da9ac);logger['debug'](_0xaa72('0x5'),_0x2da9ac,JSON['stringify'](_0x3d9526));_0x55d7b6(_0x3d9526);})[_0xaa72('0x11')](function(_0x1c107c){logger[_0xaa72('0x13')](_0xaa72('0x5'),_0x1c107c[_0xaa72('0x12')],_0x2da9ac);_0x22a1a2(_0x1b2cd9[_0xaa72('0x13')](0x1f4,_0x1c107c[_0xaa72('0x12')]));});});});};exports[_0xaa72('0x42')]=function(_0x2dbdf9){var _0x2d5787=this;return new Promise(function(_0x5cf87d,_0x4caba2){return db[_0xaa72('0x21')][_0xaa72('0x43')]({'raw':!![],'where':{'phone':_0x2dbdf9['options'][_0xaa72('0x8')]['phone']},'attributes':['id',_0xaa72('0x44')],'order':[['id',_0xaa72('0x45')]]})['then'](function(_0x5699e4){logger['info'](_0xaa72('0x46'),_0x2dbdf9);logger[_0xaa72('0x10')](_0xaa72('0x46'),_0x2dbdf9,JSON[_0xaa72('0x19')](_0x5699e4));_0x5cf87d(_0x5699e4);})[_0xaa72('0x11')](function(_0x574be0){logger[_0xaa72('0x13')](_0xaa72('0x46'),_0x574be0[_0xaa72('0x12')],_0x2dbdf9);_0x4caba2(_0x2d5787['error'](0x1f4,_0x574be0[_0xaa72('0x12')]));});});};exports[_0xaa72('0x47')]=function(_0x193192){var _0x4bd5e7=this;return new Promise(function(_0x156e23,_0x274fd){return db[_0xaa72('0x23')][_0xaa72('0x24')](function(_0x4e5d0f){var _0x9d6a82=_0x193192[_0xaa72('0x7')]&&_0x193192[_0xaa72('0x7')]['where']?_0x193192[_0xaa72('0x7')]['where']:{};return db[_0xaa72('0x6')][_0xaa72('0x1b')](_0x193192[_0xaa72('0x18')],{'where':_0x9d6a82,'transaction':_0x4e5d0f})[_0xaa72('0xe')](function(_0x72c297){logger[_0xaa72('0xf')](_0xaa72('0x47'),_0x193192);logger[_0xaa72('0x10')](_0xaa72('0x47'),_0x193192,JSON['stringify'](_0x72c297));_0x156e23(_0x72c297);})[_0xaa72('0x11')](function(_0x3b9760){logger[_0xaa72('0x13')](_0xaa72('0x47'),_0x3b9760[_0xaa72('0x12')],_0x193192);_0x274fd(_0x4bd5e7['error'](0x1f4,_0x3b9760[_0xaa72('0x12')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x1450ae){var _0x8cf34d=this;var _0x4cc050=_0x1450ae[_0xaa72('0x18')][_0xaa72('0x8')]['voiceQueueIds'];var _0x2a1a99=_0x1450ae[_0xaa72('0x18')][_0xaa72('0x8')][_0xaa72('0x48')];var _0x4949d5=_0x1450ae['body'][_0xaa72('0x8')]['availableAgentsIds'];return new Promise(function(_0x5ae3b7,_0x4d7914){return db[_0xaa72('0x6')]['findAll']({'where':{'voiceQueueId':{'$in':_0x4cc050},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xaa72('0x23')][_0xaa72('0x37')](_0xaa72('0x49')+_0x2a1a99+_0xaa72('0x4a')),'$gt':db[_0xaa72('0x23')][_0xaa72('0x37')](_0xaa72('0x4b'))}},'UserId':{'$in':_0x4949d5}},'include':[{'model':db['CmContact'],'as':_0xaa72('0x41')},{'model':db['User'],'as':'Agent','attributes':['id',_0xaa72('0x29'),_0xaa72('0x2a')]},{'model':db[_0xaa72('0x4c')],'as':_0xaa72('0x4d')}]})[_0xaa72('0xe')](function(_0xd61191){if(_0xd61191[_0xaa72('0x2b')]>0x0){return db[_0xaa72('0x23')]['transaction'](function(_0x356d22){return db[_0xaa72('0x6')]['update']({'recallmeNotifiedDate':db['sequelize'][_0xaa72('0x37')]('NOW()')},{'where':{'id':{'$in':_[_0xaa72('0xb')](_0xd61191,'id')}},'transaction':_0x356d22})[_0xaa72('0xe')](function(){_0x5ae3b7(_0xd61191);})['catch'](function(_0x5830c9){logger['error'](_0xaa72('0x4e'),_0x5830c9['message'],_0x1450ae);_0x4d7914(_0x8cf34d[_0xaa72('0x13')](0x1f4,_0x5830c9['message']));});})[_0xaa72('0x11')](function(_0x447ab9){logger[_0xaa72('0x13')](_0xaa72('0x4e'),_0x447ab9['message'],_0x1450ae);_0x4d7914(_0x8cf34d[_0xaa72('0x13')](0x1f4,_0x447ab9[_0xaa72('0x12')]));});}else{_0x5ae3b7(_0xd61191);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index e08661b..b5999d3 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 _0x5a55=['getOpenContacts','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','/timezone','getTimezone','put','/:id','update','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0x5a55,0x1d6));var _0x55a5=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x5a55[_0x54c9dd];return _0x855156;};'use strict';var express=require(_0x55a5('0x0'));var router=express[_0x55a5('0x1')]();var auth=require(_0x55a5('0x2'));var controller=require(_0x55a5('0x3'));router[_0x55a5('0x4')]('/',auth['isAuthenticated'](),controller[_0x55a5('0x5')]);router['get'](_0x55a5('0x6'),auth[_0x55a5('0x7')](),controller[_0x55a5('0x8')]);router[_0x55a5('0x4')](_0x55a5('0x9'),auth[_0x55a5('0x7')](),controller[_0x55a5('0xa')]);router[_0x55a5('0x4')]('/timezones',auth[_0x55a5('0x7')](),controller[_0x55a5('0xb')]);router[_0x55a5('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x55a5('0xc')]);router['get'](_0x55a5('0xd'),auth[_0x55a5('0x7')](),controller[_0x55a5('0xe')]);router[_0x55a5('0xf')]('/',auth['isAuthenticated'](),controller[_0x55a5('0x10')]);router[_0x55a5('0xf')]('/preview',auth[_0x55a5('0x7')](),controller[_0x55a5('0x11')]);router[_0x55a5('0xf')](_0x55a5('0x12'),auth[_0x55a5('0x7')](),controller[_0x55a5('0x13')]);router[_0x55a5('0x14')](_0x55a5('0x15'),auth[_0x55a5('0x7')](),controller[_0x55a5('0x16')]);router['delete']('/:id',auth[_0x55a5('0x7')](),controller['destroy']);module[_0x55a5('0x17')]=router; \ No newline at end of file +var _0x7095=['/preview','getPreview','getTimezone','put','delete','destroy','exports','express','Router','./cmHopper.controller','get','isAuthenticated','describe','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','post'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7095,0x66));var _0x5709=function(_0x2cf6e7,_0xe43557){_0x2cf6e7=_0x2cf6e7-0x0;var _0x3caf4e=_0x7095[_0x2cf6e7];return _0x3caf4e;};'use strict';var express=require(_0x5709('0x0'));var router=express[_0x5709('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5709('0x2'));router[_0x5709('0x3')]('/',auth[_0x5709('0x4')](),controller['index']);router[_0x5709('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x5709('0x5')]);router[_0x5709('0x3')]('/opencontacts',auth[_0x5709('0x4')](),controller[_0x5709('0x6')]);router[_0x5709('0x3')](_0x5709('0x7'),auth[_0x5709('0x4')](),controller[_0x5709('0x8')]);router[_0x5709('0x3')](_0x5709('0x9'),auth[_0x5709('0x4')](),controller['show']);router['get'](_0x5709('0xa'),auth[_0x5709('0x4')](),controller['getPreviewRecall']);router[_0x5709('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5709('0xb')](_0x5709('0xc'),auth[_0x5709('0x4')](),controller[_0x5709('0xd')]);router[_0x5709('0xb')]('/timezone',auth['isAuthenticated'](),controller[_0x5709('0xe')]);router[_0x5709('0xf')](_0x5709('0x9'),auth[_0x5709('0x4')](),controller['update']);router[_0x5709('0x10')](_0x5709('0x9'),auth['isAuthenticated'](),controller[_0x5709('0x11')]);module[_0x5709('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index edc62bb..860d19e 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 _0xcf05=['INTEGER','STRING','DATE','format','exports'];(function(_0x37cfde,_0x1e0827){var _0x12ecc4=function(_0x3376b3){while(--_0x3376b3){_0x37cfde['push'](_0x37cfde['shift']());}};_0x12ecc4(++_0x1e0827);}(_0xcf05,0xbd));var _0x5cf0=function(_0x4088d5,_0x4ded2f){_0x4088d5=_0x4088d5-0x0;var _0x3efc8e=_0xcf05[_0x4088d5];return _0x3efc8e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5cf0('0x0')]={'CmHopperId':{'type':Sequelize[_0x5cf0('0x1')]},'phone':{'type':Sequelize[_0x5cf0('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x5cf0('0x3')],'defaultValue':moment()[_0x5cf0('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5cf0('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5cf0('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5cf0('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5cf0('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5cf0('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5cf0('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5cf0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe3b3=['exports','INTEGER','format','sequelize'];(function(_0x40b387,_0x38fba9){var _0x5afceb=function(_0x2bebbf){while(--_0x2bebbf){_0x40b387['push'](_0x40b387['shift']());}};_0x5afceb(++_0x38fba9);}(_0xe3b3,0x1d3));var _0x3e3b=function(_0x1a01fc,_0x5483cf){_0x1a01fc=_0x1a01fc-0x0;var _0x3e7c94=_0xe3b3[_0x1a01fc];return _0x3e7c94;};'use strict';var moment=require('moment');var Sequelize=require(_0x3e3b('0x0'));module[_0x3e3b('0x1')]={'CmHopperId':{'type':Sequelize[_0x3e3b('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x3e3b('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x3e3b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3e3b('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x3e3b('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3e3b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 acead59..1d65f43 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 _0x2dc6=['request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','type','VIRTUAL','options','includeAll','include','CmHopperAdditionalPhone','findAll','rows','params','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5d2ed9,_0x16c436){var _0x4262c5=function(_0x124aee){while(--_0x124aee){_0x5d2ed9['push'](_0x5d2ed9['shift']());}};_0x4262c5(++_0x16c436);}(_0x2dc6,0xa0));var _0x62dc=function(_0x97c979,_0x3034b6){_0x97c979=_0x97c979-0x0;var _0x44d6db=_0x2dc6[_0x97c979];return _0x44d6db;};'use strict';var emlformat=require(_0x62dc('0x0'));var rimraf=require(_0x62dc('0x1'));var zipdir=require(_0x62dc('0x2'));var jsonpatch=require(_0x62dc('0x3'));var rp=require(_0x62dc('0x4'));var moment=require(_0x62dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x62dc('0x6'));var util=require(_0x62dc('0x7'));var path=require('path');var sox=require(_0x62dc('0x8'));var csv=require(_0x62dc('0x9'));var ejs=require(_0x62dc('0xa'));var fs=require('fs');var fs_extra=require(_0x62dc('0xb'));var _=require(_0x62dc('0xc'));var squel=require('squel');var crypto=require(_0x62dc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x62dc('0xe'));var Papa=require('papaparse');var Redis=require(_0x62dc('0xf'));var authService=require(_0x62dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x62dc('0x11'));var hardwareService=require(_0x62dc('0x12'));var logger=require(_0x62dc('0x13'))('api');var utils=require(_0x62dc('0x14'));var config=require(_0x62dc('0x15'));var licenseUtil=require(_0x62dc('0x16'));var db=require(_0x62dc('0x17'))['db'];function respondWithStatusCode(_0x4edd97,_0x1eb3e9){_0x1eb3e9=_0x1eb3e9||0xcc;return function(_0x41aa7a){if(_0x41aa7a){return _0x4edd97[_0x62dc('0x18')](_0x1eb3e9);}return _0x4edd97['status'](_0x1eb3e9)[_0x62dc('0x19')]();};}function respondWithResult(_0x138679,_0x80876e){_0x80876e=_0x80876e||0xc8;return function(_0x2cb83f){if(_0x2cb83f){return _0x138679['status'](_0x80876e)[_0x62dc('0x1a')](_0x2cb83f);}};}function respondWithFilteredResult(_0xd10e29,_0x2ce58c){return function(_0x4eb11f){if(_0x4eb11f){var _0x4eb526=typeof _0x2ce58c[_0x62dc('0x1b')]===_0x62dc('0x1c')&&typeof _0x2ce58c[_0x62dc('0x1d')]===_0x62dc('0x1c');var _0x4bc195=_0x4eb11f[_0x62dc('0x1e')];var _0x43afe4=_0x4eb526?0x0:_0x2ce58c[_0x62dc('0x1b')];var _0x1f2871=_0x4eb526?_0x4eb11f[_0x62dc('0x1e')]:_0x2ce58c[_0x62dc('0x1b')]+_0x2ce58c[_0x62dc('0x1d')];var _0x115154;if(_0x1f2871>=_0x4bc195){_0x1f2871=_0x4bc195;_0x115154=0xc8;}else{_0x115154=0xce;}_0xd10e29['status'](_0x115154);return _0xd10e29[_0x62dc('0x1f')](_0x62dc('0x20'),_0x43afe4+'-'+_0x1f2871+'/'+_0x4bc195)[_0x62dc('0x1a')](_0x4eb11f);}return null;};}function patchUpdates(_0x17b71b){return function(_0x371bd3){try{jsonpatch[_0x62dc('0x21')](_0x371bd3,_0x17b71b,!![]);}catch(_0x14dc98){return BPromise[_0x62dc('0x22')](_0x14dc98);}return _0x371bd3[_0x62dc('0x23')]();};}function saveUpdates(_0x2f604e,_0x90f357){return function(_0x5abedd){if(_0x5abedd){return _0x5abedd[_0x62dc('0x24')](_0x2f604e)[_0x62dc('0x25')](function(_0x54907a){return _0x54907a;});}return null;};}function removeEntity(_0x9aed76,_0x36db2c){return function(_0x367c3d){if(_0x367c3d){return _0x367c3d[_0x62dc('0x26')]()[_0x62dc('0x25')](function(){var _0x2d2a7b=_0x367c3d[_0x62dc('0x27')]({'plain':!![]});var _0x527c7b=_0x62dc('0x28');return db['UserProfileResource'][_0x62dc('0x26')]({'where':{'type':_0x527c7b,'resourceId':_0x2d2a7b['id']}})[_0x62dc('0x25')](function(){return _0x367c3d;});})[_0x62dc('0x25')](function(){_0x9aed76['status'](0xcc)[_0x62dc('0x19')]();});}};}function handleEntityNotFound(_0x55ee7a,_0x28252d){return function(_0x579dfa){if(!_0x579dfa){_0x55ee7a[_0x62dc('0x18')](0x194);}return _0x579dfa;};}function handleError(_0x2e6305,_0x2e98ef){_0x2e98ef=_0x2e98ef||0x1f4;return function(_0x55c9c6){logger['error'](_0x55c9c6[_0x62dc('0x29')]);if(_0x55c9c6[_0x62dc('0x2a')]){delete _0x55c9c6[_0x62dc('0x2a')];}_0x2e6305['status'](_0x2e98ef)[_0x62dc('0x2b')](_0x55c9c6);};}exports[_0x62dc('0x2c')]=function(_0x235eca,_0x54425b){var _0x5db0e7={},_0x2779d2={},_0x9d3928={'count':0x0,'rows':[]};var _0x21bd1e=_[_0x62dc('0x2d')](db['CmHopperAdditionalPhone'][_0x62dc('0x2e')],function(_0x1773af){return{'name':_0x1773af[_0x62dc('0x2f')],'type':_0x1773af['type'][_0x62dc('0x30')]};});_0x2779d2[_0x62dc('0x31')]=_[_0x62dc('0x2d')](_0x21bd1e,'name');_0x2779d2['query']=_[_0x62dc('0x32')](_0x235eca[_0x62dc('0x33')]);_0x2779d2[_0x62dc('0x34')]=_[_0x62dc('0x35')](_0x2779d2[_0x62dc('0x31')],_0x2779d2['query']);_0x5db0e7[_0x62dc('0x36')]=_[_0x62dc('0x35')](_0x2779d2[_0x62dc('0x31')],qs[_0x62dc('0x37')](_0x235eca[_0x62dc('0x33')][_0x62dc('0x37')]));_0x5db0e7[_0x62dc('0x36')]=_0x5db0e7['attributes'][_0x62dc('0x38')]?_0x5db0e7[_0x62dc('0x36')]:_0x2779d2[_0x62dc('0x31')];if(!_0x235eca[_0x62dc('0x33')]['hasOwnProperty'](_0x62dc('0x39'))){_0x5db0e7[_0x62dc('0x1d')]=qs[_0x62dc('0x1d')](_0x235eca[_0x62dc('0x33')][_0x62dc('0x1d')]);_0x5db0e7[_0x62dc('0x1b')]=qs[_0x62dc('0x1b')](_0x235eca['query']['offset']);}_0x5db0e7['order']=qs[_0x62dc('0x3a')](_0x235eca['query'][_0x62dc('0x3a')]);_0x5db0e7[_0x62dc('0x3b')]=qs['filters'](_['pick'](_0x235eca[_0x62dc('0x33')],_0x2779d2[_0x62dc('0x34')]),_0x21bd1e);if(_0x235eca[_0x62dc('0x33')]['filter']){_0x5db0e7[_0x62dc('0x3b')]=_[_0x62dc('0x3c')](_0x5db0e7[_0x62dc('0x3b')],{'$or':_[_0x62dc('0x2d')](_0x21bd1e,function(_0x4a2d20){if(_0x4a2d20[_0x62dc('0x3d')]!==_0x62dc('0x3e')){var _0x325b32={};_0x325b32[_0x4a2d20[_0x62dc('0x2a')]]={'$like':'%'+_0x235eca[_0x62dc('0x33')]['filter']+'%'};return _0x325b32;}})});}_0x5db0e7=_[_0x62dc('0x3c')]({},_0x5db0e7,_0x235eca[_0x62dc('0x3f')]);var _0x43647d={'where':_0x5db0e7[_0x62dc('0x3b')]};return db['CmHopperAdditionalPhone'][_0x62dc('0x1e')](_0x43647d)[_0x62dc('0x25')](function(_0x56795b){_0x9d3928[_0x62dc('0x1e')]=_0x56795b;if(_0x235eca[_0x62dc('0x33')][_0x62dc('0x40')]){_0x5db0e7[_0x62dc('0x41')]=[{'all':!![]}];}return db[_0x62dc('0x42')][_0x62dc('0x43')](_0x5db0e7);})[_0x62dc('0x25')](function(_0x4c53cb){_0x9d3928[_0x62dc('0x44')]=_0x4c53cb;return _0x9d3928;})['then'](respondWithFilteredResult(_0x54425b,_0x5db0e7))['catch'](handleError(_0x54425b,null));};exports['show']=function(_0x51ce6d,_0x8d2fec){var _0x6547df={'raw':!![],'where':{'id':_0x51ce6d[_0x62dc('0x45')]['id']}},_0x33bcab={};_0x33bcab[_0x62dc('0x31')]=_[_0x62dc('0x32')](db[_0x62dc('0x42')][_0x62dc('0x2e')]);_0x33bcab[_0x62dc('0x33')]=_[_0x62dc('0x32')](_0x51ce6d[_0x62dc('0x33')]);_0x33bcab[_0x62dc('0x34')]=_[_0x62dc('0x35')](_0x33bcab['model'],_0x33bcab[_0x62dc('0x33')]);_0x6547df[_0x62dc('0x36')]=_[_0x62dc('0x35')](_0x33bcab[_0x62dc('0x31')],qs[_0x62dc('0x37')](_0x51ce6d['query'][_0x62dc('0x37')]));_0x6547df[_0x62dc('0x36')]=_0x6547df['attributes'][_0x62dc('0x38')]?_0x6547df['attributes']:_0x33bcab[_0x62dc('0x31')];if(_0x51ce6d[_0x62dc('0x33')][_0x62dc('0x40')]){_0x6547df[_0x62dc('0x41')]=[{'all':!![]}];}_0x6547df=_[_0x62dc('0x3c')]({},_0x6547df,_0x51ce6d[_0x62dc('0x3f')]);return db['CmHopperAdditionalPhone'][_0x62dc('0x46')](_0x6547df)[_0x62dc('0x25')](handleEntityNotFound(_0x8d2fec,null))[_0x62dc('0x25')](respondWithResult(_0x8d2fec,null))[_0x62dc('0x47')](handleError(_0x8d2fec,null));};exports[_0x62dc('0x48')]=function(_0x6e4f46,_0x3341fc){return db['CmHopperAdditionalPhone'][_0x62dc('0x48')](_0x6e4f46[_0x62dc('0x49')],{})[_0x62dc('0x25')](function(_0xe1f005){var _0x44405a=_0x6e4f46[_0x62dc('0x4a')]['get']({'plain':!![]});if(!_0x44405a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44405a[_0x62dc('0x4b')]===_0x62dc('0x4a')){var _0x4e0dee=_0xe1f005[_0x62dc('0x27')]({'plain':!![]});var _0x5f0ba0=_0x62dc('0x28');return db[_0x62dc('0x4c')][_0x62dc('0x46')]({'where':{'name':_0x5f0ba0,'userProfileId':_0x44405a[_0x62dc('0x4d')]},'raw':!![]})[_0x62dc('0x25')](function(_0x262faa){if(_0x262faa&&_0x262faa[_0x62dc('0x4e')]===0x0){return db[_0x62dc('0x4f')][_0x62dc('0x48')]({'name':_0x4e0dee[_0x62dc('0x2a')],'resourceId':_0x4e0dee['id'],'type':_0x262faa['name'],'sectionId':_0x262faa['id']},{})[_0x62dc('0x25')](function(){return _0xe1f005;});}else{return _0xe1f005;}})['catch'](function(_0x1ee7ee){logger[_0x62dc('0x50')](_0x62dc('0x51'),_0x1ee7ee);throw _0x1ee7ee;});}return _0xe1f005;})['then'](respondWithResult(_0x3341fc,0xc9))[_0x62dc('0x47')](handleError(_0x3341fc,null));};exports[_0x62dc('0x24')]=function(_0x445e2c,_0x885f6a){if(_0x445e2c[_0x62dc('0x49')]['id']){delete _0x445e2c[_0x62dc('0x49')]['id'];}return db[_0x62dc('0x42')][_0x62dc('0x46')]({'where':{'id':_0x445e2c[_0x62dc('0x45')]['id']}})[_0x62dc('0x25')](handleEntityNotFound(_0x885f6a,null))[_0x62dc('0x25')](saveUpdates(_0x445e2c[_0x62dc('0x49')],null))[_0x62dc('0x25')](respondWithResult(_0x885f6a,null))[_0x62dc('0x47')](handleError(_0x885f6a,null));};exports[_0x62dc('0x26')]=function(_0x315d44,_0x11030f){return db[_0x62dc('0x42')][_0x62dc('0x46')]({'where':{'id':_0x315d44[_0x62dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x11030f,null))[_0x62dc('0x25')](removeEntity(_0x11030f,null))[_0x62dc('0x47')](handleError(_0x11030f,null));}; \ No newline at end of file +var _0xe30e=['fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection'];(function(_0x30c8ec,_0x46d5b7){var _0x482432=function(_0x3a78b5){while(--_0x3a78b5){_0x30c8ec['push'](_0x30c8ec['shift']());}};_0x482432(++_0x46d5b7);}(_0xe30e,0x158));var _0xee30=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe30e[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xee30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee30('0x1'));var jsonpatch=require(_0xee30('0x2'));var rp=require(_0xee30('0x3'));var moment=require(_0xee30('0x4'));var BPromise=require(_0xee30('0x5'));var Mustache=require(_0xee30('0x6'));var util=require(_0xee30('0x7'));var path=require(_0xee30('0x8'));var sox=require(_0xee30('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee30('0xa'));var squel=require('squel');var crypto=require(_0xee30('0xb'));var jsforce=require(_0xee30('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee30('0xd'));var Papa=require(_0xee30('0xe'));var Redis=require(_0xee30('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xee30('0x10'));var as=require(_0xee30('0x11'));var hardwareService=require(_0xee30('0x12'));var logger=require(_0xee30('0x13'))('api');var utils=require(_0xee30('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xee30('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e07fe,_0x390dc0){_0x390dc0=_0x390dc0||0xcc;return function(_0x1a38d0){if(_0x1a38d0){return _0x4e07fe[_0xee30('0x16')](_0x390dc0);}return _0x4e07fe[_0xee30('0x17')](_0x390dc0)[_0xee30('0x18')]();};}function respondWithResult(_0x493f28,_0x420056){_0x420056=_0x420056||0xc8;return function(_0x3c6128){if(_0x3c6128){return _0x493f28['status'](_0x420056)[_0xee30('0x19')](_0x3c6128);}};}function respondWithFilteredResult(_0x2ad6cd,_0x13361b){return function(_0xb9664a){if(_0xb9664a){var _0x155207=typeof _0x13361b['offset']===_0xee30('0x1a')&&typeof _0x13361b[_0xee30('0x1b')]==='undefined';var _0x926b7f=_0xb9664a['count'];var _0x1beebd=_0x155207?0x0:_0x13361b[_0xee30('0x1c')];var _0x1fa601=_0x155207?_0xb9664a[_0xee30('0x1d')]:_0x13361b[_0xee30('0x1c')]+_0x13361b[_0xee30('0x1b')];var _0x5035de;if(_0x1fa601>=_0x926b7f){_0x1fa601=_0x926b7f;_0x5035de=0xc8;}else{_0x5035de=0xce;}_0x2ad6cd[_0xee30('0x17')](_0x5035de);return _0x2ad6cd[_0xee30('0x1e')](_0xee30('0x1f'),_0x1beebd+'-'+_0x1fa601+'/'+_0x926b7f)[_0xee30('0x19')](_0xb9664a);}return null;};}function patchUpdates(_0x469042){return function(_0x3b6cec){try{jsonpatch[_0xee30('0x20')](_0x3b6cec,_0x469042,!![]);}catch(_0x12f132){return BPromise[_0xee30('0x21')](_0x12f132);}return _0x3b6cec['save']();};}function saveUpdates(_0x21db62,_0x5274db){return function(_0x29a7d6){if(_0x29a7d6){return _0x29a7d6[_0xee30('0x22')](_0x21db62)[_0xee30('0x23')](function(_0x2e59d3){return _0x2e59d3;});}return null;};}function removeEntity(_0x3e52c6,_0x16db0f){return function(_0x2ad6ef){if(_0x2ad6ef){return _0x2ad6ef['destroy']()[_0xee30('0x23')](function(){var _0x305198=_0x2ad6ef[_0xee30('0x24')]({'plain':!![]});var _0x43e1b8=_0xee30('0x25');return db[_0xee30('0x26')][_0xee30('0x27')]({'where':{'type':_0x43e1b8,'resourceId':_0x305198['id']}})[_0xee30('0x23')](function(){return _0x2ad6ef;});})[_0xee30('0x23')](function(){_0x3e52c6[_0xee30('0x17')](0xcc)[_0xee30('0x18')]();});}};}function handleEntityNotFound(_0x11c699,_0x1c9d36){return function(_0x5dd1f1){if(!_0x5dd1f1){_0x11c699[_0xee30('0x16')](0x194);}return _0x5dd1f1;};}function handleError(_0x5ccbf0,_0x5069ae){_0x5069ae=_0x5069ae||0x1f4;return function(_0x3c7145){logger[_0xee30('0x28')](_0x3c7145[_0xee30('0x29')]);if(_0x3c7145[_0xee30('0x2a')]){delete _0x3c7145[_0xee30('0x2a')];}_0x5ccbf0[_0xee30('0x17')](_0x5069ae)[_0xee30('0x2b')](_0x3c7145);};}exports['index']=function(_0x3cf3bb,_0x5656cc){var _0x423c3f={},_0x3ef8bd={},_0x1af9bf={'count':0x0,'rows':[]};var _0x549e2b=_[_0xee30('0x2c')](db[_0xee30('0x2d')][_0xee30('0x2e')],function(_0x446778){return{'name':_0x446778[_0xee30('0x2f')],'type':_0x446778[_0xee30('0x30')][_0xee30('0x31')]};});_0x3ef8bd[_0xee30('0x32')]=_['map'](_0x549e2b,_0xee30('0x2a'));_0x3ef8bd[_0xee30('0x33')]=_[_0xee30('0x34')](_0x3cf3bb['query']);_0x3ef8bd[_0xee30('0x35')]=_['intersection'](_0x3ef8bd['model'],_0x3ef8bd['query']);_0x423c3f[_0xee30('0x36')]=_[_0xee30('0x37')](_0x3ef8bd[_0xee30('0x32')],qs['fields'](_0x3cf3bb['query'][_0xee30('0x38')]));_0x423c3f[_0xee30('0x36')]=_0x423c3f[_0xee30('0x36')][_0xee30('0x39')]?_0x423c3f[_0xee30('0x36')]:_0x3ef8bd[_0xee30('0x32')];if(!_0x3cf3bb['query'][_0xee30('0x3a')]('nolimit')){_0x423c3f[_0xee30('0x1b')]=qs[_0xee30('0x1b')](_0x3cf3bb['query']['limit']);_0x423c3f[_0xee30('0x1c')]=qs[_0xee30('0x1c')](_0x3cf3bb[_0xee30('0x33')][_0xee30('0x1c')]);}_0x423c3f[_0xee30('0x3b')]=qs[_0xee30('0x3c')](_0x3cf3bb[_0xee30('0x33')][_0xee30('0x3c')]);_0x423c3f['where']=qs[_0xee30('0x35')](_[_0xee30('0x3d')](_0x3cf3bb[_0xee30('0x33')],_0x3ef8bd[_0xee30('0x35')]),_0x549e2b);if(_0x3cf3bb[_0xee30('0x33')][_0xee30('0x3e')]){_0x423c3f[_0xee30('0x3f')]=_[_0xee30('0x40')](_0x423c3f['where'],{'$or':_[_0xee30('0x2c')](_0x549e2b,function(_0x44622a){if(_0x44622a[_0xee30('0x30')]!=='VIRTUAL'){var _0x43b4b3={};_0x43b4b3[_0x44622a['name']]={'$like':'%'+_0x3cf3bb[_0xee30('0x33')][_0xee30('0x3e')]+'%'};return _0x43b4b3;}})});}_0x423c3f=_[_0xee30('0x40')]({},_0x423c3f,_0x3cf3bb['options']);var _0x18104b={'where':_0x423c3f[_0xee30('0x3f')]};return db[_0xee30('0x2d')][_0xee30('0x1d')](_0x18104b)[_0xee30('0x23')](function(_0x3c5283){_0x1af9bf[_0xee30('0x1d')]=_0x3c5283;if(_0x3cf3bb[_0xee30('0x33')][_0xee30('0x41')]){_0x423c3f[_0xee30('0x42')]=[{'all':!![]}];}return db[_0xee30('0x2d')][_0xee30('0x43')](_0x423c3f);})['then'](function(_0x47d9c2){_0x1af9bf[_0xee30('0x44')]=_0x47d9c2;return _0x1af9bf;})['then'](respondWithFilteredResult(_0x5656cc,_0x423c3f))[_0xee30('0x45')](handleError(_0x5656cc,null));};exports[_0xee30('0x46')]=function(_0x1ed7de,_0x269530){var _0x129672={'raw':!![],'where':{'id':_0x1ed7de[_0xee30('0x47')]['id']}},_0x5d381e={};_0x5d381e['model']=_[_0xee30('0x34')](db[_0xee30('0x2d')][_0xee30('0x2e')]);_0x5d381e['query']=_[_0xee30('0x34')](_0x1ed7de[_0xee30('0x33')]);_0x5d381e[_0xee30('0x35')]=_[_0xee30('0x37')](_0x5d381e[_0xee30('0x32')],_0x5d381e['query']);_0x129672['attributes']=_['intersection'](_0x5d381e['model'],qs[_0xee30('0x38')](_0x1ed7de[_0xee30('0x33')][_0xee30('0x38')]));_0x129672[_0xee30('0x36')]=_0x129672[_0xee30('0x36')][_0xee30('0x39')]?_0x129672[_0xee30('0x36')]:_0x5d381e[_0xee30('0x32')];if(_0x1ed7de[_0xee30('0x33')][_0xee30('0x41')]){_0x129672[_0xee30('0x42')]=[{'all':!![]}];}_0x129672=_['merge']({},_0x129672,_0x1ed7de[_0xee30('0x48')]);return db[_0xee30('0x2d')][_0xee30('0x49')](_0x129672)[_0xee30('0x23')](handleEntityNotFound(_0x269530,null))[_0xee30('0x23')](respondWithResult(_0x269530,null))[_0xee30('0x45')](handleError(_0x269530,null));};exports['create']=function(_0x45905f,_0x25f564){return db[_0xee30('0x2d')][_0xee30('0x4a')](_0x45905f[_0xee30('0x4b')],{})[_0xee30('0x23')](function(_0x5f1dcd){var _0x663273=_0x45905f[_0xee30('0x4c')][_0xee30('0x24')]({'plain':!![]});if(!_0x663273)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x663273[_0xee30('0x4d')]===_0xee30('0x4c')){var _0x57eee4=_0x5f1dcd[_0xee30('0x24')]({'plain':!![]});var _0x2d8dd0=_0xee30('0x25');return db[_0xee30('0x4e')][_0xee30('0x49')]({'where':{'name':_0x2d8dd0,'userProfileId':_0x663273['userProfileId']},'raw':!![]})[_0xee30('0x23')](function(_0x45bf16){if(_0x45bf16&&_0x45bf16['autoAssociation']===0x0){return db[_0xee30('0x26')][_0xee30('0x4a')]({'name':_0x57eee4['name'],'resourceId':_0x57eee4['id'],'type':_0x45bf16['name'],'sectionId':_0x45bf16['id']},{})[_0xee30('0x23')](function(){return _0x5f1dcd;});}else{return _0x5f1dcd;}})[_0xee30('0x45')](function(_0x4beb2f){logger[_0xee30('0x28')](_0xee30('0x4f'),_0x4beb2f);throw _0x4beb2f;});}return _0x5f1dcd;})['then'](respondWithResult(_0x25f564,0xc9))['catch'](handleError(_0x25f564,null));};exports[_0xee30('0x22')]=function(_0x2e82db,_0x4047f0){if(_0x2e82db['body']['id']){delete _0x2e82db[_0xee30('0x4b')]['id'];}return db[_0xee30('0x2d')][_0xee30('0x49')]({'where':{'id':_0x2e82db[_0xee30('0x47')]['id']}})[_0xee30('0x23')](handleEntityNotFound(_0x4047f0,null))['then'](saveUpdates(_0x2e82db['body'],null))[_0xee30('0x23')](respondWithResult(_0x4047f0,null))[_0xee30('0x45')](handleError(_0x4047f0,null));};exports['destroy']=function(_0x345a5d,_0x44595a){return db['CmHopperAdditionalPhone'][_0xee30('0x49')]({'where':{'id':_0x345a5d[_0xee30('0x47')]['id']}})[_0xee30('0x23')](handleEntityNotFound(_0x44595a,null))[_0xee30('0x23')](removeEntity(_0x44595a,null))[_0xee30('0x45')](handleError(_0x44595a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 5bd358f..f15599a 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 _0xd7c5=['cm_hopper_additional_phones','util','api','moment','request-promise','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone'];(function(_0xe1f5ca,_0x1550f1){var _0x723c85=function(_0x2020c6){while(--_0x2020c6){_0xe1f5ca['push'](_0xe1f5ca['shift']());}};_0x723c85(++_0x1550f1);}(_0xd7c5,0xf4));var _0x5d7c=function(_0x13ce3d,_0x5e4217){_0x13ce3d=_0x13ce3d-0x0;var _0x4b3b27=_0xd7c5[_0x13ce3d];return _0x4b3b27;};'use strict';var _=require('lodash');var util=require(_0x5d7c('0x0'));var logger=require('../../config/logger')(_0x5d7c('0x1'));var moment=require(_0x5d7c('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d7c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5d7c('0x4'));var attributes=require(_0x5d7c('0x5'));module['exports']=function(_0x2c6075,_0x42db1d){return _0x2c6075[_0x5d7c('0x6')](_0x5d7c('0x7'),attributes,{'tableName':_0x5d7c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d7d=['CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define'];(function(_0x11ba07,_0x30d324){var _0x37b993=function(_0x35969a){while(--_0x35969a){_0x11ba07['push'](_0x11ba07['shift']());}};_0x37b993(++_0x30d324);}(_0x5d7d,0x182));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d7('0x0'));var util=require('util');var logger=require(_0xd5d7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd5d7('0x2'));var rp=require(_0xd5d7('0x3'));var fs=require('fs');var path=require(_0xd5d7('0x4'));var rimraf=require(_0xd5d7('0x5'));var config=require(_0xd5d7('0x6'));var attributes=require(_0xd5d7('0x7'));module[_0xd5d7('0x8')]=function(_0x211fe0,_0x116fca){return _0x211fe0[_0xd5d7('0x9')](_0xd5d7('0xa'),attributes,{'tableName':_0xd5d7('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 3d6becf..c885dab 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 _0x4c29=['request\x20sent','debug','stringify','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','SwapAdditionalPhones','CmHopper','waitTime','duration','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s'];(function(_0x5a1613,_0x370b1b){var _0x2197d8=function(_0x4fc508){while(--_0x4fc508){_0x5a1613['push'](_0x5a1613['shift']());}};_0x2197d8(++_0x370b1b);}(_0x4c29,0x9c));var _0x94c2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4c29[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x94c2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x94c2('0x1'));var logger=require(_0x94c2('0x2'))(_0x94c2('0x3'));var config=require(_0x94c2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x94c2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20bca2,_0x912988,_0x32c3c1){return new BPromise(function(_0x22115b,_0x4a4e88){return client[_0x94c2('0x6')](_0x20bca2,_0x32c3c1)['then'](function(_0x25b39d){logger[_0x94c2('0x7')](_0x94c2('0x8'),_0x912988,_0x94c2('0x9'));logger[_0x94c2('0xa')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x912988,_0x94c2('0x9'),JSON[_0x94c2('0xb')](_0x25b39d));if(_0x25b39d[_0x94c2('0xc')]){if(_0x25b39d[_0x94c2('0xc')][_0x94c2('0xd')]===0x1f4){logger[_0x94c2('0xc')](_0x94c2('0x8'),_0x912988,_0x25b39d[_0x94c2('0xc')][_0x94c2('0xe')]);return _0x4a4e88(_0x25b39d[_0x94c2('0xc')][_0x94c2('0xe')]);}logger[_0x94c2('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x912988,_0x25b39d[_0x94c2('0xc')][_0x94c2('0xe')]);return _0x22115b(_0x25b39d[_0x94c2('0xc')][_0x94c2('0xe')]);}else{logger[_0x94c2('0x7')](_0x94c2('0x8'),_0x912988,_0x94c2('0x9'));_0x22115b(_0x25b39d[_0x94c2('0xf')][_0x94c2('0xe')]);}})[_0x94c2('0x10')](function(_0x567528){logger[_0x94c2('0xc')](_0x94c2('0x8'),_0x912988,_0x567528);_0x4a4e88(_0x567528);});});}exports[_0x94c2('0x11')]=function(_0x1522b5){var _0x1c9f98=this;return new Promise(function(_0x46061a,_0x208ab9){return db['CmHopper'][_0x94c2('0x12')]({'raw':!![],'where':{'ContactId':_0x1522b5[_0x94c2('0x13')][_0x94c2('0x14')],'ListId':_0x1522b5['body'][_0x94c2('0x15')],'VoiceQueueId':_0x1522b5['body'][_0x94c2('0x16')]===undefined?null:_0x1522b5['body']['VoiceQueueId'],'CampaignId':_0x1522b5[_0x94c2('0x13')][_0x94c2('0x17')]===undefined?null:_0x1522b5['body']['CampaignId']}})[_0x94c2('0x18')](function(_0x5124fe){if(_0x5124fe!=null){return db[_0x94c2('0x19')][_0x94c2('0x12')]({'raw':!![],'where':{'CmHopperId':_0x5124fe['id'],'OrderBy':{'$gt':_0x5124fe[_0x94c2('0x1a')]}},'order':[['OrderBy',_0x94c2('0x1b')]]})[_0x94c2('0x18')](function(_0x239409){var _0x1a394c=0x0;if(_0x239409){if(_0x239409['countbusyretry']+_0x239409[_0x94c2('0x1c')]+_0x239409[_0x94c2('0x1d')]+_0x239409[_0x94c2('0x1e')]+_0x239409[_0x94c2('0x1f')]+_0x239409[_0x94c2('0x20')]+_0x239409[_0x94c2('0x21')]+_0x239409[_0x94c2('0x22')]<_0x1522b5[_0x94c2('0x23')][_0x94c2('0x24')])_0x1a394c=0x1;_0x46061a({'additional':_0x1a394c});}else{return db[_0x94c2('0x19')][_0x94c2('0x12')]({'raw':!![],'where':{'CmHopperId':_0x5124fe['id']},'order':[['OrderBy','ASC']]})[_0x94c2('0x18')](function(_0xb61e57){var _0x3dea85=0x0;if(_0xb61e57){if(_0xb61e57[_0x94c2('0x25')]+_0xb61e57[_0x94c2('0x1c')]+_0xb61e57[_0x94c2('0x1d')]+_0xb61e57['countnosuchnumberretry']+_0xb61e57['countdropretry']+_0xb61e57[_0x94c2('0x20')]+_0xb61e57[_0x94c2('0x21')]+_0xb61e57[_0x94c2('0x22')]<_0x1522b5['entity'][_0x94c2('0x24')])_0x3dea85=0x1;_0x46061a({'additional':_0x3dea85});}else{_0x46061a({'additional':0x0});}})[_0x94c2('0x10')](function(_0x38a98f){logger[_0x94c2('0xc')](_0x94c2('0x11'),_0x38a98f[_0x94c2('0xe')]);_0x208ab9(_0x1c9f98['error'](0x1f4,_0x38a98f['message']));});}})[_0x94c2('0x10')](function(_0x7304ac){logger['error'](_0x94c2('0x11'),_0x7304ac['message']);_0x208ab9(_0x1c9f98['error'](0x1f4,_0x7304ac[_0x94c2('0xe')]));});}else _0x46061a({'additional':0x0});});});};exports[_0x94c2('0x26')]=function(_0x1a75a9){var _0x555ef9=this;return new Promise(function(_0x2b11f6,_0x3f2f30){return db[_0x94c2('0x27')]['findOne']({'raw':!![],'where':{'ContactId':_0x1a75a9[_0x94c2('0x13')][_0x94c2('0x14')],'ListId':_0x1a75a9[_0x94c2('0x13')][_0x94c2('0x15')],'VoiceQueueId':_0x1a75a9[_0x94c2('0x13')][_0x94c2('0x16')]===undefined?null:_0x1a75a9['body'][_0x94c2('0x16')],'CampaignId':_0x1a75a9[_0x94c2('0x13')][_0x94c2('0x17')]===undefined?null:_0x1a75a9[_0x94c2('0x13')][_0x94c2('0x17')]}})[_0x94c2('0x18')](function(_0x386125){if(_0x386125!=null){return db[_0x94c2('0x19')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x386125['id'],'OrderBy':{'$gte':_0x386125[_0x94c2('0x1a')]}},'order':[[_0x94c2('0x1a'),_0x94c2('0x1b')]]})[_0x94c2('0x18')](function(_0x5497b0){if(_0x5497b0)return activateAdditionalPhone(_0x386125,_0x1a75a9[_0x94c2('0x13')],_0x5497b0,_0x1a75a9['duration'],_0x1a75a9[_0x94c2('0x28')])['then'](function(_0x504b62){_0x2b11f6(_0x504b62);});else{return db['CmHopperAdditionalPhone'][_0x94c2('0x12')]({'raw':!![],'where':{'CmHopperId':_0x386125['id']},'order':[[_0x94c2('0x1a'),_0x94c2('0x1b')]]})[_0x94c2('0x18')](function(_0x57b97b){if(_0x57b97b)return activateAdditionalPhone(_0x386125,_0x1a75a9['body'],_0x57b97b,_0x1a75a9[_0x94c2('0x29')],_0x1a75a9[_0x94c2('0x28')])[_0x94c2('0x18')](function(_0x2f97e0){_0x2b11f6(_0x2f97e0);});else{_0x2b11f6({'id':_0x386125['id'],'phone':''});}})['catch'](function(_0x34c0de){logger[_0x94c2('0xc')]('VerifyAdditionalPhones',_0x34c0de['message']);_0x3f2f30(_0x555ef9[_0x94c2('0xc')](0x1f4,_0x34c0de['message']));});}})['catch'](function(_0x43958c){logger[_0x94c2('0xc')]('VerifyAdditionalPhones',_0x43958c['message']);_0x3f2f30(_0x555ef9[_0x94c2('0xc')](0x1f4,_0x43958c[_0x94c2('0xe')]));});}else _0x2b11f6(0x1);});});};function activateAdditionalPhone(_0x3c5d44,_0x42828a,_0x536564,_0x37e727,_0x252a87){return new Promise(function(_0xaa4a19,_0x52ef8){var _0x1349ca;if(_['isNil'](_0x536564[_0x94c2('0x2a')])){_0x536564[_0x94c2('0x2a')]=moment();}if(moment()>moment(_0x536564[_0x94c2('0x2a')])){_0x1349ca=moment()[_0x94c2('0x2b')](_0x252a87||0x3,_0x94c2('0x2c'));}else{if(_0x536564[_0x94c2('0x1a')]==0x0){_0x1349ca=moment(_0x536564[_0x94c2('0x2a')]);}else{_0x1349ca=moment()[_0x94c2('0x2b')](_0x252a87||0x3,_0x94c2('0x2c'));}}if(_[_0x94c2('0x2d')](_0x1349ca)){_0x1349ca=moment()['add'](_0x252a87||0x3,_0x94c2('0x2c'));}var _0x5b6a40={'phone':_0x3c5d44[_0x94c2('0x2e')],'active':0x0,'OrderBy':_['isNil'](_0x3c5d44[_0x94c2('0x1a')])?0x0:_0x3c5d44[_0x94c2('0x1a')],'scheduledat':moment()[_0x94c2('0x2b')](_0x37e727||0x1,_0x94c2('0x2c')),'countbusyretry':_0x42828a[_0x94c2('0x25')],'countcongestionretry':_0x42828a[_0x94c2('0x1c')],'countnoanswerretry':_0x42828a['countnoanswerretry'],'countnosuchnumberretry':_0x42828a[_0x94c2('0x1e')],'countdropretry':_0x42828a['countdropretry'],'countabandonedretry':_0x42828a['countabandonedretry'],'countmachineretry':_0x42828a[_0x94c2('0x21')],'countagentrejectretry':_0x42828a['countagentrejectretry'],'createdAt':_0x42828a[_0x94c2('0x2f')],'updatedAt':_0x42828a[_0x94c2('0x30')]};var _0x1b1353={'CmHopperId':_0x3c5d44['id'],'phone':_0x536564['phone'],'active':0x0,'OrderBy':_[_0x94c2('0x2d')](_0x536564['OrderBy'])?0x0:_0x536564[_0x94c2('0x1a')],'scheduledat':_0x1349ca,'countbusyretry':_0x536564[_0x94c2('0x25')],'countcongestionretry':_0x536564[_0x94c2('0x1c')],'countnoanswerretry':_0x536564[_0x94c2('0x1d')],'countnosuchnumberretry':_0x536564['countnosuchnumberretry'],'countdropretry':_0x536564[_0x94c2('0x1f')],'countabandonedretry':_0x536564['countabandonedretry'],'countmachineretry':_0x536564[_0x94c2('0x21')],'countagentrejectretry':_0x536564[_0x94c2('0x22')],'createdAt':_0x536564['createdAt'],'updatedAt':_0x536564[_0x94c2('0x30')]};return db[_0x94c2('0x31')][_0x94c2('0x32')](function(_0x4e3050){return db[_0x94c2('0x19')][_0x94c2('0x33')](_0x5b6a40,{'where':{'id':_0x536564['id']}},{'transaction':_0x4e3050})[_0x94c2('0x18')](function(){return db[_0x94c2('0x27')][_0x94c2('0x33')](_0x1b1353,{'where':{'id':_0x3c5d44['id']}},{'transaction':_0x4e3050});});})[_0x94c2('0x18')](function(_0x575194){_0xaa4a19({'id':_0x3c5d44['id'],'phone':_0x536564[_0x94c2('0x2e')]});})[_0x94c2('0x10')](function(_0x49d602){logger[_0x94c2('0xc')](_0x94c2('0x34'),_0x49d602[_0x94c2('0xe')]);_0x52ef8({'error':_0x49d602[_0x94c2('0xe')]});});});}exports[_0x94c2('0x35')]=function(_0x178936){var _0x5684ea=this;return new Promise(function(_0x638f4a,_0x24c529){return db[_0x94c2('0x27')]['update'](_0x178936[_0x94c2('0x13')][_0x94c2('0x36')],{'where':{'id':_0x178936[_0x94c2('0x13')]['id']}})['then'](function(_0x42fc0a){_0x638f4a(_0x42fc0a);})[_0x94c2('0x10')](function(_0x2d3786){logger['error'](_0x94c2('0x35'),_0x2d3786[_0x94c2('0xe')]);_0x24c529(_0x5684ea[_0x94c2('0xc')](0x1f4,_0x2d3786[_0x94c2('0xe')]));});});}; \ No newline at end of file +var _0x1655=['VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','findOne','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','CmHopperAdditionalPhone','countbusyretry','countagentrejectretry','SwapAdditionalPhones','duration','waitTime','scheduledat','minutes','isNil','add','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch'];(function(_0x3eae0c,_0x33bc9e){var _0x1921ec=function(_0x1b444a){while(--_0x1b444a){_0x3eae0c['push'](_0x3eae0c['shift']());}};_0x1921ec(++_0x33bc9e);}(_0x1655,0x95));var _0x5165=function(_0x12dc14,_0x3d5794){_0x12dc14=_0x12dc14-0x0;var _0x542250=_0x1655[_0x12dc14];return _0x542250;};'use strict';var _=require('lodash');var util=require(_0x5165('0x0'));var moment=require('moment');var BPromise=require(_0x5165('0x1'));var rs=require(_0x5165('0x2'));var fs=require('fs');var Redis=require(_0x5165('0x3'));var db=require(_0x5165('0x4'))['db'];var utils=require(_0x5165('0x5'));var logger=require(_0x5165('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5165('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1dae55,_0x51ff7e,_0x2fc5c3){return new BPromise(function(_0x25d38a,_0x909706){return client[_0x5165('0x8')](_0x1dae55,_0x2fc5c3)['then'](function(_0x5a12c3){logger['info'](_0x5165('0x9'),_0x51ff7e,'request\x20sent');logger[_0x5165('0xa')](_0x5165('0xb'),_0x51ff7e,_0x5165('0xc'),JSON[_0x5165('0xd')](_0x5a12c3));if(_0x5a12c3[_0x5165('0xe')]){if(_0x5a12c3['error'][_0x5165('0xf')]===0x1f4){logger[_0x5165('0xe')](_0x5165('0x9'),_0x51ff7e,_0x5a12c3[_0x5165('0xe')][_0x5165('0x10')]);return _0x909706(_0x5a12c3[_0x5165('0xe')][_0x5165('0x10')]);}logger[_0x5165('0xe')](_0x5165('0x9'),_0x51ff7e,_0x5a12c3[_0x5165('0xe')]['message']);return _0x25d38a(_0x5a12c3[_0x5165('0xe')][_0x5165('0x10')]);}else{logger[_0x5165('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x51ff7e,_0x5165('0xc'));_0x25d38a(_0x5a12c3['result']['message']);}})[_0x5165('0x12')](function(_0x22e092){logger['error'](_0x5165('0x9'),_0x51ff7e,_0x22e092);_0x909706(_0x22e092);});});}exports[_0x5165('0x13')]=function(_0x59d3b5){var _0xf50857=this;return new Promise(function(_0x3e3e55,_0x367542){return db[_0x5165('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0x59d3b5[_0x5165('0x15')][_0x5165('0x16')],'ListId':_0x59d3b5['body'][_0x5165('0x17')],'VoiceQueueId':_0x59d3b5['body'][_0x5165('0x18')]===undefined?null:_0x59d3b5[_0x5165('0x15')][_0x5165('0x18')],'CampaignId':_0x59d3b5[_0x5165('0x15')]['CampaignId']===undefined?null:_0x59d3b5[_0x5165('0x15')][_0x5165('0x19')]}})[_0x5165('0x1a')](function(_0xd1b56e){if(_0xd1b56e!=null){return db['CmHopperAdditionalPhone'][_0x5165('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xd1b56e['id'],'OrderBy':{'$gt':_0xd1b56e[_0x5165('0x1c')]}},'order':[[_0x5165('0x1c'),_0x5165('0x1d')]]})['then'](function(_0xf97904){var _0x5d74bf=0x0;if(_0xf97904){if(_0xf97904['countbusyretry']+_0xf97904[_0x5165('0x1e')]+_0xf97904[_0x5165('0x1f')]+_0xf97904[_0x5165('0x20')]+_0xf97904[_0x5165('0x21')]+_0xf97904[_0x5165('0x22')]+_0xf97904[_0x5165('0x23')]+_0xf97904['countagentrejectretry']<_0x59d3b5['entity'][_0x5165('0x24')])_0x5d74bf=0x1;_0x3e3e55({'additional':_0x5d74bf});}else{return db[_0x5165('0x25')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xd1b56e['id']},'order':[[_0x5165('0x1c'),_0x5165('0x1d')]]})[_0x5165('0x1a')](function(_0x2ed2a1){var _0x2f0732=0x0;if(_0x2ed2a1){if(_0x2ed2a1[_0x5165('0x26')]+_0x2ed2a1['countcongestionretry']+_0x2ed2a1[_0x5165('0x1f')]+_0x2ed2a1['countnosuchnumberretry']+_0x2ed2a1['countdropretry']+_0x2ed2a1[_0x5165('0x22')]+_0x2ed2a1[_0x5165('0x23')]+_0x2ed2a1[_0x5165('0x27')]<_0x59d3b5['entity'][_0x5165('0x24')])_0x2f0732=0x1;_0x3e3e55({'additional':_0x2f0732});}else{_0x3e3e55({'additional':0x0});}})[_0x5165('0x12')](function(_0x33954c){logger[_0x5165('0xe')](_0x5165('0x13'),_0x33954c[_0x5165('0x10')]);_0x367542(_0xf50857[_0x5165('0xe')](0x1f4,_0x33954c[_0x5165('0x10')]));});}})['catch'](function(_0x4b9a20){logger[_0x5165('0xe')]('VerifyAdditionalPhones',_0x4b9a20[_0x5165('0x10')]);_0x367542(_0xf50857[_0x5165('0xe')](0x1f4,_0x4b9a20[_0x5165('0x10')]));});}else _0x3e3e55({'additional':0x0});});});};exports[_0x5165('0x28')]=function(_0x21192a){var _0x197dc6=this;return new Promise(function(_0x414135,_0x4745ec){return db['CmHopper'][_0x5165('0x1b')]({'raw':!![],'where':{'ContactId':_0x21192a[_0x5165('0x15')]['ContactId'],'ListId':_0x21192a['body'][_0x5165('0x17')],'VoiceQueueId':_0x21192a[_0x5165('0x15')][_0x5165('0x18')]===undefined?null:_0x21192a[_0x5165('0x15')][_0x5165('0x18')],'CampaignId':_0x21192a[_0x5165('0x15')]['CampaignId']===undefined?null:_0x21192a[_0x5165('0x15')]['CampaignId']}})['then'](function(_0x1d52f5){if(_0x1d52f5!=null){return db[_0x5165('0x25')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1d52f5['id'],'OrderBy':{'$gte':_0x1d52f5['OrderBy']}},'order':[[_0x5165('0x1c'),_0x5165('0x1d')]]})[_0x5165('0x1a')](function(_0x1a57de){if(_0x1a57de)return activateAdditionalPhone(_0x1d52f5,_0x21192a['body'],_0x1a57de,_0x21192a[_0x5165('0x29')],_0x21192a[_0x5165('0x2a')])[_0x5165('0x1a')](function(_0x217f4d){_0x414135(_0x217f4d);});else{return db[_0x5165('0x25')][_0x5165('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x1d52f5['id']},'order':[[_0x5165('0x1c'),_0x5165('0x1d')]]})['then'](function(_0x3ed7d4){if(_0x3ed7d4)return activateAdditionalPhone(_0x1d52f5,_0x21192a[_0x5165('0x15')],_0x3ed7d4,_0x21192a[_0x5165('0x29')],_0x21192a['waitTime'])[_0x5165('0x1a')](function(_0x1f01fe){_0x414135(_0x1f01fe);});else{_0x414135({'id':_0x1d52f5['id'],'phone':''});}})[_0x5165('0x12')](function(_0x292789){logger[_0x5165('0xe')](_0x5165('0x13'),_0x292789[_0x5165('0x10')]);_0x4745ec(_0x197dc6[_0x5165('0xe')](0x1f4,_0x292789[_0x5165('0x10')]));});}})[_0x5165('0x12')](function(_0x236241){logger['error'](_0x5165('0x13'),_0x236241[_0x5165('0x10')]);_0x4745ec(_0x197dc6['error'](0x1f4,_0x236241[_0x5165('0x10')]));});}else _0x414135(0x1);});});};function activateAdditionalPhone(_0x269ac5,_0x57e16b,_0x596e90,_0x37313e,_0x5729f8){return new Promise(function(_0x246f34,_0x5a046a){var _0x3e062f;if(_['isNil'](_0x596e90[_0x5165('0x2b')])){_0x596e90[_0x5165('0x2b')]=moment();}if(moment()>moment(_0x596e90[_0x5165('0x2b')])){_0x3e062f=moment()['add'](_0x5729f8||0x3,'minutes');}else{if(_0x596e90[_0x5165('0x1c')]==0x0){_0x3e062f=moment(_0x596e90[_0x5165('0x2b')]);}else{_0x3e062f=moment()['add'](_0x5729f8||0x3,_0x5165('0x2c'));}}if(_[_0x5165('0x2d')](_0x3e062f)){_0x3e062f=moment()[_0x5165('0x2e')](_0x5729f8||0x3,'minutes');}var _0x5c45b1={'phone':_0x269ac5[_0x5165('0x2f')],'active':0x0,'OrderBy':_[_0x5165('0x2d')](_0x269ac5[_0x5165('0x1c')])?0x0:_0x269ac5[_0x5165('0x1c')],'scheduledat':moment()[_0x5165('0x2e')](_0x37313e||0x1,'minutes'),'countbusyretry':_0x57e16b['countbusyretry'],'countcongestionretry':_0x57e16b[_0x5165('0x1e')],'countnoanswerretry':_0x57e16b[_0x5165('0x1f')],'countnosuchnumberretry':_0x57e16b['countnosuchnumberretry'],'countdropretry':_0x57e16b[_0x5165('0x21')],'countabandonedretry':_0x57e16b[_0x5165('0x22')],'countmachineretry':_0x57e16b[_0x5165('0x23')],'countagentrejectretry':_0x57e16b['countagentrejectretry'],'createdAt':_0x57e16b['createdAt'],'updatedAt':_0x57e16b['updatedAt']};var _0x581172={'CmHopperId':_0x269ac5['id'],'phone':_0x596e90[_0x5165('0x2f')],'active':0x0,'OrderBy':_[_0x5165('0x2d')](_0x596e90['OrderBy'])?0x0:_0x596e90[_0x5165('0x1c')],'scheduledat':_0x3e062f,'countbusyretry':_0x596e90['countbusyretry'],'countcongestionretry':_0x596e90[_0x5165('0x1e')],'countnoanswerretry':_0x596e90['countnoanswerretry'],'countnosuchnumberretry':_0x596e90[_0x5165('0x20')],'countdropretry':_0x596e90[_0x5165('0x21')],'countabandonedretry':_0x596e90[_0x5165('0x22')],'countmachineretry':_0x596e90['countmachineretry'],'countagentrejectretry':_0x596e90['countagentrejectretry'],'createdAt':_0x596e90[_0x5165('0x30')],'updatedAt':_0x596e90[_0x5165('0x31')]};return db[_0x5165('0x32')][_0x5165('0x33')](function(_0x458263){return db['CmHopperAdditionalPhone']['update'](_0x5c45b1,{'where':{'id':_0x596e90['id']}},{'transaction':_0x458263})[_0x5165('0x1a')](function(){return db['CmHopper'][_0x5165('0x34')](_0x581172,{'where':{'id':_0x269ac5['id']}},{'transaction':_0x458263});});})['then'](function(_0x2979c0){_0x246f34({'id':_0x269ac5['id'],'phone':_0x596e90['phone']});})[_0x5165('0x12')](function(_0x43f685){logger[_0x5165('0xe')](_0x5165('0x35'),_0x43f685['message']);_0x5a046a({'error':_0x43f685[_0x5165('0x10')]});});});}exports[_0x5165('0x36')]=function(_0x21edeb){var _0x481c11=this;return new Promise(function(_0x34b915,_0x3075c2){return db[_0x5165('0x14')][_0x5165('0x34')](_0x21edeb[_0x5165('0x15')][_0x5165('0x37')],{'where':{'id':_0x21edeb['body']['id']}})['then'](function(_0x3dae56){_0x34b915(_0x3dae56);})[_0x5165('0x12')](function(_0x2dbc7e){logger[_0x5165('0xe')]('IncrementPreviewCounters',_0x2dbc7e['message']);_0x3075c2(_0x481c11[_0x5165('0xe')](0x1f4,_0x2dbc7e['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index bda10ed..7b9b1b9 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 _0x4148=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer','util'];(function(_0x5a552b,_0x1a1831){var _0x18dbd5=function(_0x196993){while(--_0x196993){_0x5a552b['push'](_0x5a552b['shift']());}};_0x18dbd5(++_0x1a1831);}(_0x4148,0x75));var _0x8414=function(_0x33c562,_0x54f29c){_0x33c562=_0x33c562-0x0;var _0x4199e3=_0x4148[_0x33c562];return _0x4199e3;};'use strict';var multer=require(_0x8414('0x0'));var util=require(_0x8414('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8414('0x2'));var router=express[_0x8414('0x3')]();var fs_extra=require(_0x8414('0x4'));var auth=require(_0x8414('0x5'));var interaction=require(_0x8414('0x6'));var config=require('../../config/environment');var controller=require(_0x8414('0x7'));router[_0x8414('0x8')]('/',auth[_0x8414('0x9')](),controller[_0x8414('0xa')]);router[_0x8414('0x8')](_0x8414('0xb'),auth['isAuthenticated'](),controller[_0x8414('0xc')]);router[_0x8414('0xd')]('/',auth[_0x8414('0x9')](),controller[_0x8414('0xe')]);router['put'](_0x8414('0xb'),auth[_0x8414('0x9')](),controller['update']);router[_0x8414('0xf')]('/:id',auth[_0x8414('0x9')](),controller[_0x8414('0x10')]);module['exports']=router; \ No newline at end of file +var _0xdace=['update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','show','isAuthenticated','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdace,0xad));var _0xedac=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xdace[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0xedac('0x0'));var util=require(_0xedac('0x1'));var path=require(_0xedac('0x2'));var timeout=require(_0xedac('0x3'));var express=require(_0xedac('0x4'));var router=express[_0xedac('0x5')]();var fs_extra=require(_0xedac('0x6'));var auth=require(_0xedac('0x7'));var interaction=require(_0xedac('0x8'));var config=require(_0xedac('0x9'));var controller=require(_0xedac('0xa'));router[_0xedac('0xb')]('/',auth['isAuthenticated'](),controller[_0xedac('0xc')]);router[_0xedac('0xb')](_0xedac('0xd'),auth['isAuthenticated'](),controller[_0xedac('0xe')]);router['post']('/',auth[_0xedac('0xf')](),controller['create']);router[_0xedac('0x10')](_0xedac('0xd'),auth['isAuthenticated'](),controller[_0xedac('0x11')]);router['delete'](_0xedac('0xd'),auth[_0xedac('0xf')](),controller[_0xedac('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 1c5bbfd..b54f1ba 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 _0xe604=['contactListQueue','INTEGER','moment'];(function(_0x21638d,_0x24c1ea){var _0x98a6a7=function(_0x2672cd){while(--_0x2672cd){_0x21638d['push'](_0x21638d['shift']());}};_0x98a6a7(++_0x24c1ea);}(_0xe604,0x101));var _0x4e60=function(_0x4a1726,_0x19c6dd){_0x4a1726=_0x4a1726-0x0;var _0x21b430=_0xe604[_0x4a1726];return _0x21b430;};'use strict';var moment=require(_0x4e60('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x4e60('0x1')},'ListId':{'type':Sequelize[_0x4e60('0x2')],'unique':_0x4e60('0x1')},'VoiceQueueId':{'type':Sequelize[_0x4e60('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x0e50=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x0e50,0x168));var _0x00e5=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0e50[_0x599f41];return _0x2e4d58;};'use strict';var moment=require(_0x00e5('0x0'));var Sequelize=require(_0x00e5('0x1'));module[_0x00e5('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x00e5('0x3')],'unique':_0x00e5('0x4')},'ListId':{'type':Sequelize[_0x00e5('0x3')],'unique':_0x00e5('0x4')},'VoiceQueueId':{'type':Sequelize[_0x00e5('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e458b32..f7041df 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 _0x9ce8=['attributes','length','hasOwnProperty','nolimit','sort','where','filter','type','merge','options','includeAll','include','findAll','show','params','keys','find','catch','body','describe','rimraf','zip-dir','moment','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','filters','intersection','fields'];(function(_0x25cb6a,_0x144b6f){var _0x1bd826=function(_0x168cb6){while(--_0x168cb6){_0x25cb6a['push'](_0x25cb6a['shift']());}};_0x1bd826(++_0x144b6f);}(_0x9ce8,0x9a));var _0x89ce=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x9ce8[_0x4fbb15];return _0x436338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89ce('0x0'));var zipdir=require(_0x89ce('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x89ce('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x89ce('0x3'));var sox=require('sox');var csv=require(_0x89ce('0x4'));var ejs=require(_0x89ce('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89ce('0x6'));var squel=require('squel');var crypto=require(_0x89ce('0x7'));var jsforce=require(_0x89ce('0x8'));var deskjs=require(_0x89ce('0x9'));var toCsv=require(_0x89ce('0x4'));var querystring=require(_0x89ce('0xa'));var Papa=require(_0x89ce('0xb'));var Redis=require('ioredis');var authService=require(_0x89ce('0xc'));var qs=require(_0x89ce('0xd'));var as=require(_0x89ce('0xe'));var hardwareService=require(_0x89ce('0xf'));var logger=require(_0x89ce('0x10'))(_0x89ce('0x11'));var utils=require(_0x89ce('0x12'));var config=require(_0x89ce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x89ce('0x14'))['db'];function respondWithStatusCode(_0x4787a8,_0x5f069a){_0x5f069a=_0x5f069a||0xcc;return function(_0x1ead6e){if(_0x1ead6e){return _0x4787a8['sendStatus'](_0x5f069a);}return _0x4787a8[_0x89ce('0x15')](_0x5f069a)['end']();};}function respondWithResult(_0x50b44f,_0x5a5e10){_0x5a5e10=_0x5a5e10||0xc8;return function(_0xda4217){if(_0xda4217){return _0x50b44f[_0x89ce('0x15')](_0x5a5e10)[_0x89ce('0x16')](_0xda4217);}};}function respondWithFilteredResult(_0x520deb,_0x4f8173){return function(_0xfdf73b){if(_0xfdf73b){var _0x39d62d=typeof _0x4f8173[_0x89ce('0x17')]==='undefined'&&typeof _0x4f8173[_0x89ce('0x18')]==='undefined';var _0x5d9d0a=_0xfdf73b[_0x89ce('0x19')];var _0x1ca85e=_0x39d62d?0x0:_0x4f8173[_0x89ce('0x17')];var _0x277825=_0x39d62d?_0xfdf73b['count']:_0x4f8173['offset']+_0x4f8173['limit'];var _0x16b2e2;if(_0x277825>=_0x5d9d0a){_0x277825=_0x5d9d0a;_0x16b2e2=0xc8;}else{_0x16b2e2=0xce;}_0x520deb[_0x89ce('0x15')](_0x16b2e2);return _0x520deb[_0x89ce('0x1a')](_0x89ce('0x1b'),_0x1ca85e+'-'+_0x277825+'/'+_0x5d9d0a)[_0x89ce('0x16')](_0xfdf73b);}return null;};}function patchUpdates(_0xa7255d){return function(_0x340d2b){try{jsonpatch[_0x89ce('0x1c')](_0x340d2b,_0xa7255d,!![]);}catch(_0x3adae8){return BPromise['reject'](_0x3adae8);}return _0x340d2b['save']();};}function saveUpdates(_0x3b3027,_0x518ca8){return function(_0x3f2760){if(_0x3f2760){return _0x3f2760[_0x89ce('0x1d')](_0x3b3027)[_0x89ce('0x1e')](function(_0x256e36){return _0x256e36;});}return null;};}function removeEntity(_0xe6fc08,_0x1897af){return function(_0x4c1e55){if(_0x4c1e55){return _0x4c1e55[_0x89ce('0x1f')]()[_0x89ce('0x1e')](function(){_0xe6fc08['status'](0xcc)[_0x89ce('0x20')]();});}};}function handleEntityNotFound(_0x25feb1,_0x59a8d5){return function(_0x383a8b){if(!_0x383a8b){_0x25feb1['sendStatus'](0x194);}return _0x383a8b;};}function handleError(_0x215d1b,_0xe48a4d){_0xe48a4d=_0xe48a4d||0x1f4;return function(_0x1d71cb){logger['error'](_0x1d71cb[_0x89ce('0x21')]);if(_0x1d71cb[_0x89ce('0x22')]){delete _0x1d71cb[_0x89ce('0x22')];}_0x215d1b[_0x89ce('0x15')](_0xe48a4d)[_0x89ce('0x23')](_0x1d71cb);};}exports[_0x89ce('0x24')]=function(_0x2ab275,_0x92f697){var _0x1c6e02={},_0x49bfd3={},_0x515abf={'count':0x0,'rows':[]};var _0x42c258=_[_0x89ce('0x25')](db[_0x89ce('0x26')][_0x89ce('0x27')],function(_0x327f58){return{'name':_0x327f58[_0x89ce('0x28')],'type':_0x327f58['type'][_0x89ce('0x29')]};});_0x49bfd3[_0x89ce('0x2a')]=_[_0x89ce('0x25')](_0x42c258,_0x89ce('0x22'));_0x49bfd3['query']=_['keys'](_0x2ab275[_0x89ce('0x2b')]);_0x49bfd3[_0x89ce('0x2c')]=_[_0x89ce('0x2d')](_0x49bfd3['model'],_0x49bfd3[_0x89ce('0x2b')]);_0x1c6e02['attributes']=_['intersection'](_0x49bfd3[_0x89ce('0x2a')],qs['fields'](_0x2ab275[_0x89ce('0x2b')][_0x89ce('0x2e')]));_0x1c6e02[_0x89ce('0x2f')]=_0x1c6e02[_0x89ce('0x2f')][_0x89ce('0x30')]?_0x1c6e02['attributes']:_0x49bfd3[_0x89ce('0x2a')];if(!_0x2ab275[_0x89ce('0x2b')][_0x89ce('0x31')](_0x89ce('0x32'))){_0x1c6e02[_0x89ce('0x18')]=qs[_0x89ce('0x18')](_0x2ab275[_0x89ce('0x2b')][_0x89ce('0x18')]);_0x1c6e02[_0x89ce('0x17')]=qs[_0x89ce('0x17')](_0x2ab275['query']['offset']);}_0x1c6e02['order']=qs[_0x89ce('0x33')](_0x2ab275[_0x89ce('0x2b')][_0x89ce('0x33')]);_0x1c6e02[_0x89ce('0x34')]=qs[_0x89ce('0x2c')](_['pick'](_0x2ab275[_0x89ce('0x2b')],_0x49bfd3['filters']),_0x42c258);if(_0x2ab275[_0x89ce('0x2b')][_0x89ce('0x35')]){_0x1c6e02[_0x89ce('0x34')]=_['merge'](_0x1c6e02[_0x89ce('0x34')],{'$or':_[_0x89ce('0x25')](_0x42c258,function(_0x6c37cc){if(_0x6c37cc[_0x89ce('0x36')]!=='VIRTUAL'){var _0x3d9b29={};_0x3d9b29[_0x6c37cc[_0x89ce('0x22')]]={'$like':'%'+_0x2ab275[_0x89ce('0x2b')]['filter']+'%'};return _0x3d9b29;}})});}_0x1c6e02=_[_0x89ce('0x37')]({},_0x1c6e02,_0x2ab275[_0x89ce('0x38')]);var _0x4829b2={'where':_0x1c6e02[_0x89ce('0x34')]};return db[_0x89ce('0x26')][_0x89ce('0x19')](_0x4829b2)['then'](function(_0x408d8b){_0x515abf['count']=_0x408d8b;if(_0x2ab275['query'][_0x89ce('0x39')]){_0x1c6e02[_0x89ce('0x3a')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x89ce('0x3b')](_0x1c6e02);})[_0x89ce('0x1e')](function(_0x5758cb){_0x515abf['rows']=_0x5758cb;return _0x515abf;})[_0x89ce('0x1e')](respondWithFilteredResult(_0x92f697,_0x1c6e02))['catch'](handleError(_0x92f697,null));};exports[_0x89ce('0x3c')]=function(_0x26c3b9,_0x20b0b6){var _0x4bfa8a={'raw':!![],'where':{'id':_0x26c3b9[_0x89ce('0x3d')]['id']}},_0x3d150e={};_0x3d150e[_0x89ce('0x2a')]=_[_0x89ce('0x3e')](db[_0x89ce('0x26')]['rawAttributes']);_0x3d150e[_0x89ce('0x2b')]=_[_0x89ce('0x3e')](_0x26c3b9[_0x89ce('0x2b')]);_0x3d150e[_0x89ce('0x2c')]=_[_0x89ce('0x2d')](_0x3d150e[_0x89ce('0x2a')],_0x3d150e[_0x89ce('0x2b')]);_0x4bfa8a[_0x89ce('0x2f')]=_[_0x89ce('0x2d')](_0x3d150e[_0x89ce('0x2a')],qs[_0x89ce('0x2e')](_0x26c3b9[_0x89ce('0x2b')][_0x89ce('0x2e')]));_0x4bfa8a[_0x89ce('0x2f')]=_0x4bfa8a[_0x89ce('0x2f')][_0x89ce('0x30')]?_0x4bfa8a[_0x89ce('0x2f')]:_0x3d150e[_0x89ce('0x2a')];if(_0x26c3b9[_0x89ce('0x2b')][_0x89ce('0x39')]){_0x4bfa8a[_0x89ce('0x3a')]=[{'all':!![]}];}_0x4bfa8a=_[_0x89ce('0x37')]({},_0x4bfa8a,_0x26c3b9[_0x89ce('0x38')]);return db[_0x89ce('0x26')][_0x89ce('0x3f')](_0x4bfa8a)[_0x89ce('0x1e')](handleEntityNotFound(_0x20b0b6,null))['then'](respondWithResult(_0x20b0b6,null))[_0x89ce('0x40')](handleError(_0x20b0b6,null));};exports[_0x89ce('0x1d')]=function(_0x1d2415,_0x54e818){if(_0x1d2415[_0x89ce('0x41')]['id']){delete _0x1d2415[_0x89ce('0x41')]['id'];}return db['CmHopperBlack'][_0x89ce('0x3f')]({'where':{'id':_0x1d2415[_0x89ce('0x3d')]['id']}})[_0x89ce('0x1e')](handleEntityNotFound(_0x54e818,null))['then'](saveUpdates(_0x1d2415[_0x89ce('0x41')],null))[_0x89ce('0x1e')](respondWithResult(_0x54e818,null))['catch'](handleError(_0x54e818,null));};exports[_0x89ce('0x1f')]=function(_0x4496e9,_0x12b331){return db['CmHopperBlack'][_0x89ce('0x3f')]({'where':{'id':_0x4496e9[_0x89ce('0x3d')]['id']}})[_0x89ce('0x1e')](handleEntityNotFound(_0x12b331,null))[_0x89ce('0x1e')](removeEntity(_0x12b331,null))[_0x89ce('0x40')](handleError(_0x12b331,null));};exports['describe']=function(_0x1a6965,_0x587ae9){return db[_0x89ce('0x26')][_0x89ce('0x42')]()[_0x89ce('0x1e')](respondWithResult(_0x587ae9,null))[_0x89ce('0x40')](handleError(_0x587ae9,null));}; \ No newline at end of file +var _0x4716=['api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','update','then','destroy','sendStatus','stack','name','map','CmHopperBlack','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3a4b59,_0x10a215){var _0x410bb4=function(_0x43b012){while(--_0x43b012){_0x3a4b59['push'](_0x3a4b59['shift']());}};_0x410bb4(++_0x10a215);}(_0x4716,0x19b));var _0x6471=function(_0x4505cb,_0x135d7d){_0x4505cb=_0x4505cb-0x0;var _0x188f78=_0x4716[_0x4505cb];return _0x188f78;};'use strict';var emlformat=require(_0x6471('0x0'));var rimraf=require(_0x6471('0x1'));var zipdir=require(_0x6471('0x2'));var jsonpatch=require(_0x6471('0x3'));var rp=require(_0x6471('0x4'));var moment=require(_0x6471('0x5'));var BPromise=require(_0x6471('0x6'));var Mustache=require(_0x6471('0x7'));var util=require(_0x6471('0x8'));var path=require(_0x6471('0x9'));var sox=require(_0x6471('0xa'));var csv=require('to-csv');var ejs=require(_0x6471('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6471('0xc'));var jsforce=require(_0x6471('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6471('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6471('0xf'));var authService=require(_0x6471('0x10'));var qs=require(_0x6471('0x11'));var as=require(_0x6471('0x12'));var hardwareService=require(_0x6471('0x13'));var logger=require(_0x6471('0x14'))(_0x6471('0x15'));var utils=require(_0x6471('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6471('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d1229,_0x4c5093){_0x4c5093=_0x4c5093||0xcc;return function(_0x5f3d71){if(_0x5f3d71){return _0x2d1229['sendStatus'](_0x4c5093);}return _0x2d1229[_0x6471('0x18')](_0x4c5093)[_0x6471('0x19')]();};}function respondWithResult(_0x580978,_0x9e8c98){_0x9e8c98=_0x9e8c98||0xc8;return function(_0x1fb7eb){if(_0x1fb7eb){return _0x580978[_0x6471('0x18')](_0x9e8c98)[_0x6471('0x1a')](_0x1fb7eb);}};}function respondWithFilteredResult(_0x3af573,_0x5c701f){return function(_0x2bcf86){if(_0x2bcf86){var _0x278077=typeof _0x5c701f[_0x6471('0x1b')]===_0x6471('0x1c')&&typeof _0x5c701f['limit']===_0x6471('0x1c');var _0x4b4ed9=_0x2bcf86[_0x6471('0x1d')];var _0x18f3ea=_0x278077?0x0:_0x5c701f[_0x6471('0x1b')];var _0x1b28bd=_0x278077?_0x2bcf86[_0x6471('0x1d')]:_0x5c701f['offset']+_0x5c701f[_0x6471('0x1e')];var _0x1c9fc1;if(_0x1b28bd>=_0x4b4ed9){_0x1b28bd=_0x4b4ed9;_0x1c9fc1=0xc8;}else{_0x1c9fc1=0xce;}_0x3af573[_0x6471('0x18')](_0x1c9fc1);return _0x3af573[_0x6471('0x1f')]('Content-Range',_0x18f3ea+'-'+_0x1b28bd+'/'+_0x4b4ed9)['json'](_0x2bcf86);}return null;};}function patchUpdates(_0x3c6deb){return function(_0xea7f7){try{jsonpatch[_0x6471('0x20')](_0xea7f7,_0x3c6deb,!![]);}catch(_0x2b2720){return BPromise['reject'](_0x2b2720);}return _0xea7f7['save']();};}function saveUpdates(_0x476395,_0x489f3c){return function(_0x1837e6){if(_0x1837e6){return _0x1837e6[_0x6471('0x21')](_0x476395)[_0x6471('0x22')](function(_0x491c7c){return _0x491c7c;});}return null;};}function removeEntity(_0x46ea4f,_0x3fe6d){return function(_0x2fd19a){if(_0x2fd19a){return _0x2fd19a[_0x6471('0x23')]()[_0x6471('0x22')](function(){_0x46ea4f[_0x6471('0x18')](0xcc)[_0x6471('0x19')]();});}};}function handleEntityNotFound(_0x18253f,_0x465d0a){return function(_0x2eb4b0){if(!_0x2eb4b0){_0x18253f[_0x6471('0x24')](0x194);}return _0x2eb4b0;};}function handleError(_0x62abe4,_0x2a9be4){_0x2a9be4=_0x2a9be4||0x1f4;return function(_0x495b16){logger['error'](_0x495b16[_0x6471('0x25')]);if(_0x495b16[_0x6471('0x26')]){delete _0x495b16['name'];}_0x62abe4[_0x6471('0x18')](_0x2a9be4)['send'](_0x495b16);};}exports['index']=function(_0x33907b,_0x2547ed){var _0x47d6af={},_0x5ed776={},_0x3be61a={'count':0x0,'rows':[]};var _0xd20886=_[_0x6471('0x27')](db[_0x6471('0x28')]['rawAttributes'],function(_0x3d92af){return{'name':_0x3d92af[_0x6471('0x29')],'type':_0x3d92af[_0x6471('0x2a')][_0x6471('0x2b')]};});_0x5ed776[_0x6471('0x2c')]=_[_0x6471('0x27')](_0xd20886,_0x6471('0x26'));_0x5ed776[_0x6471('0x2d')]=_[_0x6471('0x2e')](_0x33907b['query']);_0x5ed776[_0x6471('0x2f')]=_['intersection'](_0x5ed776['model'],_0x5ed776[_0x6471('0x2d')]);_0x47d6af[_0x6471('0x30')]=_[_0x6471('0x31')](_0x5ed776[_0x6471('0x2c')],qs[_0x6471('0x32')](_0x33907b[_0x6471('0x2d')][_0x6471('0x32')]));_0x47d6af[_0x6471('0x30')]=_0x47d6af[_0x6471('0x30')][_0x6471('0x33')]?_0x47d6af[_0x6471('0x30')]:_0x5ed776[_0x6471('0x2c')];if(!_0x33907b[_0x6471('0x2d')][_0x6471('0x34')](_0x6471('0x35'))){_0x47d6af[_0x6471('0x1e')]=qs[_0x6471('0x1e')](_0x33907b['query']['limit']);_0x47d6af[_0x6471('0x1b')]=qs[_0x6471('0x1b')](_0x33907b[_0x6471('0x2d')]['offset']);}_0x47d6af[_0x6471('0x36')]=qs['sort'](_0x33907b[_0x6471('0x2d')][_0x6471('0x37')]);_0x47d6af['where']=qs[_0x6471('0x2f')](_[_0x6471('0x38')](_0x33907b[_0x6471('0x2d')],_0x5ed776['filters']),_0xd20886);if(_0x33907b['query']['filter']){_0x47d6af[_0x6471('0x39')]=_[_0x6471('0x3a')](_0x47d6af[_0x6471('0x39')],{'$or':_[_0x6471('0x27')](_0xd20886,function(_0x4853f7){if(_0x4853f7['type']!==_0x6471('0x3b')){var _0x2f4c74={};_0x2f4c74[_0x4853f7['name']]={'$like':'%'+_0x33907b[_0x6471('0x2d')][_0x6471('0x3c')]+'%'};return _0x2f4c74;}})});}_0x47d6af=_[_0x6471('0x3a')]({},_0x47d6af,_0x33907b[_0x6471('0x3d')]);var _0x398d08={'where':_0x47d6af[_0x6471('0x39')]};return db[_0x6471('0x28')][_0x6471('0x1d')](_0x398d08)['then'](function(_0x187cd2){_0x3be61a[_0x6471('0x1d')]=_0x187cd2;if(_0x33907b[_0x6471('0x2d')][_0x6471('0x3e')]){_0x47d6af[_0x6471('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x6471('0x40')](_0x47d6af);})['then'](function(_0x3a595a){_0x3be61a[_0x6471('0x41')]=_0x3a595a;return _0x3be61a;})[_0x6471('0x22')](respondWithFilteredResult(_0x2547ed,_0x47d6af))[_0x6471('0x42')](handleError(_0x2547ed,null));};exports['show']=function(_0x588e5a,_0x11b4db){var _0x4653ec={'raw':!![],'where':{'id':_0x588e5a[_0x6471('0x43')]['id']}},_0x286edf={};_0x286edf[_0x6471('0x2c')]=_[_0x6471('0x2e')](db[_0x6471('0x28')][_0x6471('0x44')]);_0x286edf['query']=_[_0x6471('0x2e')](_0x588e5a['query']);_0x286edf[_0x6471('0x2f')]=_[_0x6471('0x31')](_0x286edf[_0x6471('0x2c')],_0x286edf['query']);_0x4653ec[_0x6471('0x30')]=_[_0x6471('0x31')](_0x286edf['model'],qs[_0x6471('0x32')](_0x588e5a[_0x6471('0x2d')][_0x6471('0x32')]));_0x4653ec[_0x6471('0x30')]=_0x4653ec[_0x6471('0x30')][_0x6471('0x33')]?_0x4653ec[_0x6471('0x30')]:_0x286edf[_0x6471('0x2c')];if(_0x588e5a[_0x6471('0x2d')][_0x6471('0x3e')]){_0x4653ec[_0x6471('0x3f')]=[{'all':!![]}];}_0x4653ec=_['merge']({},_0x4653ec,_0x588e5a[_0x6471('0x3d')]);return db[_0x6471('0x28')][_0x6471('0x45')](_0x4653ec)['then'](handleEntityNotFound(_0x11b4db,null))['then'](respondWithResult(_0x11b4db,null))[_0x6471('0x42')](handleError(_0x11b4db,null));};exports[_0x6471('0x21')]=function(_0x2bc00a,_0x1be652){if(_0x2bc00a['body']['id']){delete _0x2bc00a[_0x6471('0x46')]['id'];}return db[_0x6471('0x28')]['find']({'where':{'id':_0x2bc00a[_0x6471('0x43')]['id']}})[_0x6471('0x22')](handleEntityNotFound(_0x1be652,null))[_0x6471('0x22')](saveUpdates(_0x2bc00a[_0x6471('0x46')],null))[_0x6471('0x22')](respondWithResult(_0x1be652,null))[_0x6471('0x42')](handleError(_0x1be652,null));};exports[_0x6471('0x23')]=function(_0x4b84b4,_0x241926){return db[_0x6471('0x28')][_0x6471('0x45')]({'where':{'id':_0x4b84b4[_0x6471('0x43')]['id']}})[_0x6471('0x22')](handleEntityNotFound(_0x241926,null))[_0x6471('0x22')](removeEntity(_0x241926,null))['catch'](handleError(_0x241926,null));};exports[_0x6471('0x47')]=function(_0x250206,_0x3bdd8c){return db[_0x6471('0x28')][_0x6471('0x47')]()[_0x6471('0x22')](respondWithResult(_0x3bdd8c,null))[_0x6471('0x42')](handleError(_0x3bdd8c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 571eff9..02e0f5c 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 _0xfd8d=['request-promise','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','moment','bluebird'];(function(_0x4237a6,_0x2c950b){var _0x5dcabe=function(_0x21dd92){while(--_0x21dd92){_0x4237a6['push'](_0x4237a6['shift']());}};_0x5dcabe(++_0x2c950b);}(_0xfd8d,0xd8));var _0xdfd8=function(_0x173464,_0x4636d4){_0x173464=_0x173464-0x0;var _0x458da0=_0xfd8d[_0x173464];return _0x458da0;};'use strict';var _=require(_0xdfd8('0x0'));var util=require('util');var logger=require(_0xdfd8('0x1'))('api');var moment=require(_0xdfd8('0x2'));var BPromise=require(_0xdfd8('0x3'));var rp=require(_0xdfd8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdfd8('0x5'));var config=require(_0xdfd8('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0xdfd8('0x7')]=function(_0x22f673,_0x32e51c){return _0x22f673[_0xdfd8('0x8')](_0xdfd8('0x9'),attributes,{'tableName':_0xdfd8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x985b=['cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x4796b7,_0x35bd4c){var _0x2e879a=function(_0x223b65){while(--_0x223b65){_0x4796b7['push'](_0x4796b7['shift']());}};_0x2e879a(++_0x35bd4c);}(_0x985b,0x10f));var _0xb985=function(_0x196809,_0x335bbd){_0x196809=_0x196809-0x0;var _0x59a3d1=_0x985b[_0x196809];return _0x59a3d1;};'use strict';var _=require(_0xb985('0x0'));var util=require(_0xb985('0x1'));var logger=require(_0xb985('0x2'))(_0xb985('0x3'));var moment=require(_0xb985('0x4'));var BPromise=require(_0xb985('0x5'));var rp=require(_0xb985('0x6'));var fs=require('fs');var path=require(_0xb985('0x7'));var rimraf=require(_0xb985('0x8'));var config=require(_0xb985('0x9'));var attributes=require(_0xb985('0xa'));module[_0xb985('0xb')]=function(_0x3a34b8,_0x27d89f){return _0x3a34b8[_0xb985('0xc')](_0xb985('0xd'),attributes,{'tableName':_0xb985('0xe'),'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 8f63faf..8393abc 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 _0x48d2=['message','catch','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','then','GetCmHopperBlack','stringify','UpdateCmHopperBlack','raw','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x20afdc,_0x2499e0){var _0x37b41b=function(_0x5ab305){while(--_0x5ab305){_0x20afdc['push'](_0x20afdc['shift']());}};_0x37b41b(++_0x2499e0);}(_0x48d2,0x87));var _0x248d=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x48d2[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0x248d('0x0'));var util=require('util');var moment=require(_0x248d('0x1'));var BPromise=require(_0x248d('0x2'));var rs=require(_0x248d('0x3'));var fs=require('fs');var Redis=require(_0x248d('0x4'));var db=require(_0x248d('0x5'))['db'];var utils=require(_0x248d('0x6'));var logger=require(_0x248d('0x7'))(_0x248d('0x8'));var config=require(_0x248d('0x9'));var jayson=require(_0x248d('0xa'));var client=jayson[_0x248d('0xb')][_0x248d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf0ae02,_0x211e89,_0x1b459a){return new BPromise(function(_0x432eef,_0x3af1d1){return client[_0x248d('0xd')](_0xf0ae02,_0x1b459a)['then'](function(_0x5a4dd3){logger[_0x248d('0xe')](_0x248d('0xf'),_0x211e89,_0x248d('0x10'));logger[_0x248d('0x11')](_0x248d('0x12'),_0x211e89,'request\x20sent',JSON['stringify'](_0x5a4dd3));if(_0x5a4dd3['error']){if(_0x5a4dd3['error'][_0x248d('0x13')]===0x1f4){logger[_0x248d('0x14')](_0x248d('0xf'),_0x211e89,_0x5a4dd3[_0x248d('0x14')]['message']);return _0x3af1d1(_0x5a4dd3[_0x248d('0x14')]['message']);}logger[_0x248d('0x14')](_0x248d('0xf'),_0x211e89,_0x5a4dd3[_0x248d('0x14')][_0x248d('0x15')]);return _0x432eef(_0x5a4dd3[_0x248d('0x14')][_0x248d('0x15')]);}else{logger[_0x248d('0xe')](_0x248d('0xf'),_0x211e89,_0x248d('0x10'));_0x432eef(_0x5a4dd3['result']['message']);}})[_0x248d('0x16')](function(_0x502636){logger[_0x248d('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x211e89,_0x502636);_0x3af1d1(_0x502636);});});}exports['GetCmHopperBlack']=function(_0x80d4cb){var _0x565338=this;return new Promise(function(_0x22d3ec,_0x6dd0c1){return db[_0x248d('0x17')][_0x248d('0x18')]({'raw':_0x80d4cb[_0x248d('0x19')]?_0x80d4cb[_0x248d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x80d4cb[_0x248d('0x19')]?_0x80d4cb[_0x248d('0x19')][_0x248d('0x1a')]||null:null,'attributes':_0x80d4cb[_0x248d('0x19')]?_0x80d4cb[_0x248d('0x19')][_0x248d('0x1b')]||null:null,'limit':_0x80d4cb['options']?_0x80d4cb[_0x248d('0x19')][_0x248d('0x1c')]||null:null,'include':_0x80d4cb['options']?_0x80d4cb['options'][_0x248d('0x1d')]?_[_0x248d('0x1e')](_0x80d4cb[_0x248d('0x19')][_0x248d('0x1d')],function(_0x571007){return{'model':db[_0x571007[_0x248d('0x1f')]],'as':_0x571007['as'],'attributes':_0x571007['attributes'],'include':_0x571007['include']?_[_0x248d('0x1e')](_0x571007[_0x248d('0x1d')],function(_0x5c51d6){return{'model':db[_0x5c51d6[_0x248d('0x1f')]],'as':_0x5c51d6['as'],'attributes':_0x5c51d6['attributes'],'include':_0x5c51d6['include']?_[_0x248d('0x1e')](_0x5c51d6[_0x248d('0x1d')],function(_0x46d1ee){return{'model':db[_0x46d1ee['model']],'as':_0x46d1ee['as'],'attributes':_0x46d1ee[_0x248d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x248d('0x20')](function(_0x4892e1){logger[_0x248d('0xe')](_0x248d('0x21'),_0x80d4cb);logger[_0x248d('0x11')]('GetCmHopperBlack',_0x80d4cb,JSON[_0x248d('0x22')](_0x4892e1));_0x22d3ec(_0x4892e1);})[_0x248d('0x16')](function(_0x220705){logger[_0x248d('0x14')]('GetCmHopperBlack',_0x220705[_0x248d('0x15')],_0x80d4cb);_0x6dd0c1(_0x565338[_0x248d('0x14')](0x1f4,_0x220705[_0x248d('0x15')]));});});};exports[_0x248d('0x23')]=function(_0x33e884){var _0x386041=this;return new Promise(function(_0x2c4191,_0x739b60){return db[_0x248d('0x17')]['update'](_0x33e884['body'],{'raw':_0x33e884[_0x248d('0x19')]?_0x33e884[_0x248d('0x19')][_0x248d('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33e884[_0x248d('0x19')]?_0x33e884[_0x248d('0x19')][_0x248d('0x1a')]||null:null,'attributes':_0x33e884[_0x248d('0x19')]?_0x33e884[_0x248d('0x19')][_0x248d('0x1b')]||null:null,'limit':_0x33e884[_0x248d('0x19')]?_0x33e884[_0x248d('0x19')][_0x248d('0x1c')]||null:null})[_0x248d('0x20')](function(_0x43f982){logger[_0x248d('0xe')](_0x248d('0x23'),_0x33e884);logger['debug'](_0x248d('0x23'),_0x33e884,JSON['stringify'](_0x43f982));_0x2c4191(_0x43f982);})['catch'](function(_0x376e2b){logger[_0x248d('0x14')](_0x248d('0x23'),_0x376e2b[_0x248d('0x15')],_0x33e884);_0x739b60(_0x386041[_0x248d('0x14')](0x1f4,_0x376e2b[_0x248d('0x15')]));});});};exports[_0x248d('0x25')]=function(_0x431ebb){var _0x281cf4=this;return new Promise(function(_0x4571ae,_0x17d342){return db['CmHopperBlack'][_0x248d('0x26')]({'where':_0x431ebb[_0x248d('0x19')]?_0x431ebb[_0x248d('0x19')][_0x248d('0x1a')]||null:null})[_0x248d('0x20')](function(_0x5bf871){logger['info'](_0x248d('0x25'),_0x431ebb);logger[_0x248d('0x11')](_0x248d('0x25'),_0x431ebb,JSON[_0x248d('0x22')](_0x5bf871));_0x4571ae(_0x5bf871);})['catch'](function(_0x39d9fb){logger[_0x248d('0x14')](_0x248d('0x25'),_0x39d9fb[_0x248d('0x15')],_0x431ebb);_0x17d342(_0x281cf4[_0x248d('0x14')](0x1f4,_0x39d9fb[_0x248d('0x15')]));});});}; \ No newline at end of file +var _0x58a5=['where','limit','include','map','model','attributes','UpdateCmHopperBlack','body','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw'];(function(_0x4334c1,_0xef64f4){var _0x35fcda=function(_0x26c061){while(--_0x26c061){_0x4334c1['push'](_0x4334c1['shift']());}};_0x35fcda(++_0xef64f4);}(_0x58a5,0x129));var _0x558a=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x58a5[_0x403cff];return _0x5a7c56;};'use strict';var _=require(_0x558a('0x0'));var util=require('util');var moment=require(_0x558a('0x1'));var BPromise=require(_0x558a('0x2'));var rs=require(_0x558a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x558a('0x4'))['db'];var utils=require(_0x558a('0x5'));var logger=require(_0x558a('0x6'))('rpc');var config=require(_0x558a('0x7'));var jayson=require(_0x558a('0x8'));var client=jayson['client'][_0x558a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x79ec7a,_0x12b690,_0x85a5dd){return new BPromise(function(_0xbbd12f,_0x110710){return client['request'](_0x79ec7a,_0x85a5dd)[_0x558a('0xa')](function(_0x1852aa){logger[_0x558a('0xb')](_0x558a('0xc'),_0x12b690,_0x558a('0xd'));logger[_0x558a('0xe')](_0x558a('0xf'),_0x12b690,_0x558a('0xd'),JSON[_0x558a('0x10')](_0x1852aa));if(_0x1852aa[_0x558a('0x11')]){if(_0x1852aa[_0x558a('0x11')][_0x558a('0x12')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x12b690,_0x1852aa[_0x558a('0x11')][_0x558a('0x13')]);return _0x110710(_0x1852aa[_0x558a('0x11')][_0x558a('0x13')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x12b690,_0x1852aa[_0x558a('0x11')]['message']);return _0xbbd12f(_0x1852aa['error']['message']);}else{logger[_0x558a('0xb')](_0x558a('0xc'),_0x12b690,_0x558a('0xd'));_0xbbd12f(_0x1852aa[_0x558a('0x14')][_0x558a('0x13')]);}})[_0x558a('0x15')](function(_0x58a0ed){logger[_0x558a('0x11')](_0x558a('0xc'),_0x12b690,_0x58a0ed);_0x110710(_0x58a0ed);});});}exports[_0x558a('0x16')]=function(_0x3fc5b6){var _0x1a0873=this;return new Promise(function(_0x8a8b3b,_0x77076f){return db[_0x558a('0x17')][_0x558a('0x18')]({'raw':_0x3fc5b6['options']?_0x3fc5b6[_0x558a('0x19')][_0x558a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3fc5b6[_0x558a('0x19')]?_0x3fc5b6[_0x558a('0x19')][_0x558a('0x1b')]||null:null,'attributes':_0x3fc5b6['options']?_0x3fc5b6[_0x558a('0x19')]['attributes']||null:null,'limit':_0x3fc5b6['options']?_0x3fc5b6[_0x558a('0x19')][_0x558a('0x1c')]||null:null,'include':_0x3fc5b6[_0x558a('0x19')]?_0x3fc5b6['options'][_0x558a('0x1d')]?_[_0x558a('0x1e')](_0x3fc5b6[_0x558a('0x19')][_0x558a('0x1d')],function(_0x5866c0){return{'model':db[_0x5866c0[_0x558a('0x1f')]],'as':_0x5866c0['as'],'attributes':_0x5866c0['attributes'],'include':_0x5866c0[_0x558a('0x1d')]?_[_0x558a('0x1e')](_0x5866c0[_0x558a('0x1d')],function(_0x51a9fb){return{'model':db[_0x51a9fb[_0x558a('0x1f')]],'as':_0x51a9fb['as'],'attributes':_0x51a9fb['attributes'],'include':_0x51a9fb[_0x558a('0x1d')]?_[_0x558a('0x1e')](_0x51a9fb['include'],function(_0xf1feb1){return{'model':db[_0xf1feb1[_0x558a('0x1f')]],'as':_0xf1feb1['as'],'attributes':_0xf1feb1[_0x558a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x558a('0xa')](function(_0x3f37a5){logger['info'](_0x558a('0x16'),_0x3fc5b6);logger[_0x558a('0xe')](_0x558a('0x16'),_0x3fc5b6,JSON[_0x558a('0x10')](_0x3f37a5));_0x8a8b3b(_0x3f37a5);})['catch'](function(_0x9957db){logger[_0x558a('0x11')](_0x558a('0x16'),_0x9957db[_0x558a('0x13')],_0x3fc5b6);_0x77076f(_0x1a0873['error'](0x1f4,_0x9957db[_0x558a('0x13')]));});});};exports[_0x558a('0x21')]=function(_0x3e051c){var _0x4f9bb3=this;return new Promise(function(_0x11dd61,_0x536010){return db[_0x558a('0x17')]['update'](_0x3e051c[_0x558a('0x22')],{'raw':_0x3e051c['options']?_0x3e051c[_0x558a('0x19')][_0x558a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e051c[_0x558a('0x19')]?_0x3e051c[_0x558a('0x19')][_0x558a('0x1b')]||null:null,'attributes':_0x3e051c[_0x558a('0x19')]?_0x3e051c[_0x558a('0x19')][_0x558a('0x20')]||null:null,'limit':_0x3e051c[_0x558a('0x19')]?_0x3e051c[_0x558a('0x19')][_0x558a('0x1c')]||null:null})[_0x558a('0xa')](function(_0x3144cf){logger[_0x558a('0xb')](_0x558a('0x21'),_0x3e051c);logger['debug'](_0x558a('0x21'),_0x3e051c,JSON[_0x558a('0x10')](_0x3144cf));_0x11dd61(_0x3144cf);})['catch'](function(_0x36e3ce){logger[_0x558a('0x11')]('UpdateCmHopperBlack',_0x36e3ce[_0x558a('0x13')],_0x3e051c);_0x536010(_0x4f9bb3[_0x558a('0x11')](0x1f4,_0x36e3ce[_0x558a('0x13')]));});});};exports[_0x558a('0x23')]=function(_0x52b820){var _0x4d3025=this;return new Promise(function(_0x5e87ce,_0x465b64){return db[_0x558a('0x17')]['destroy']({'where':_0x52b820[_0x558a('0x19')]?_0x52b820['options'][_0x558a('0x1b')]||null:null})[_0x558a('0xa')](function(_0x5cc2aa){logger[_0x558a('0xb')]('DestroyCmHopperBlack',_0x52b820);logger[_0x558a('0xe')](_0x558a('0x23'),_0x52b820,JSON[_0x558a('0x10')](_0x5cc2aa));_0x5e87ce(_0x5cc2aa);})[_0x558a('0x15')](function(_0x53ffdd){logger['error']('DestroyCmHopperBlack',_0x53ffdd[_0x558a('0x13')],_0x52b820);_0x465b64(_0x4d3025['error'](0x1f4,_0x53ffdd[_0x558a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b902d7c..94e7f99 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 _0x5d17=['index','/describe','isAuthenticated','describe','/:id','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x5d17,0x114));var _0x75d1=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x5d17[_0x2c7b86];return _0x256735;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x75d1('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0xf')]);router[_0x75d1('0x10')]('/:id',auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);module[_0x75d1('0x12')]=router; \ No newline at end of file +var _0xed1c=['describe','/:id','show','put','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0x3ba277,_0x2b9ecf){var _0x5c4326=function(_0x4e0d5e){while(--_0x4e0d5e){_0x3ba277['push'](_0x3ba277['shift']());}};_0x5c4326(++_0x2b9ecf);}(_0xed1c,0xe4));var _0xced1=function(_0x586bd5,_0x51353b){_0x586bd5=_0x586bd5-0x0;var _0x5b5704=_0xed1c[_0x586bd5];return _0x5b5704;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0xd')]('/:id',auth[_0xced1('0x7')](),controller['update']);router[_0xced1('0xe')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xf')]);module[_0xced1('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 798996f..3b96d05 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 _0x9467=['DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0xa720e9,_0xf162db){var _0x902310=function(_0x538001){while(--_0x538001){_0xa720e9['push'](_0xa720e9['shift']());}};_0x902310(++_0xf162db);}(_0x9467,0x167));var _0x7946=function(_0x12ea10,_0x3b5c84){_0x12ea10=_0x12ea10-0x0;var _0x2c0eb3=_0x9467[_0x12ea10];return _0x2c0eb3;};'use strict';var Sequelize=require(_0x7946('0x0'));var moment=require(_0x7946('0x1'));module[_0x7946('0x2')]={'state':{'type':Sequelize[_0x7946('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x7946('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7946('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x7946('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7946('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x7946('0x5')]},'droptime':{'type':Sequelize[_0x7946('0x5')]},'endtime':{'type':Sequelize[_0x7946('0x5')]},'ringtime':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7946('0x4')]},'campaign':{'type':Sequelize[_0x7946('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7946('0x4')]},'reason':{'type':Sequelize[_0x7946('0x4')]},'disposition':{'type':Sequelize[_0x7946('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x7946('0x5')],'set':function(_0x5e1ba9){var _0x15191a=this[_0x7946('0x6')](_0x7946('0x7'));if(_0x15191a&&_0x5e1ba9){this[_0x7946('0x8')](_0x7946('0x9'),moment(_0x5e1ba9)[_0x7946('0xa')](moment(_0x15191a),_0x7946('0xb')));}}},'amd':{'type':Sequelize[_0x7946('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x7946('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x7946('0x5')]},'callback':{'type':Sequelize[_0x7946('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7946('0x5')]},'deleted':{'type':Sequelize[_0x7946('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x7946('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x7946('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7946('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x636d=['followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue'];(function(_0x48c2ae,_0x4cea90){var _0x8f7531=function(_0x126458){while(--_0x126458){_0x48c2ae['push'](_0x48c2ae['shift']());}};_0x8f7531(++_0x4cea90);}(_0x636d,0xc4));var _0xd636=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x636d[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xd636('0x0'));var moment=require(_0xd636('0x1'));module[_0xd636('0x2')]={'state':{'type':Sequelize[_0xd636('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xd636('0x4')]},'scheduledat':{'type':Sequelize[_0xd636('0x5')]},'countbusyretry':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd636('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xd636('0x4')]},'originatecalleridname':{'type':Sequelize[_0xd636('0x4')]},'calleridnum':{'type':Sequelize[_0xd636('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd636('0x5')]},'responsetime':{'type':Sequelize[_0xd636('0x5')]},'answertime':{'type':Sequelize[_0xd636('0x5')]},'droptime':{'type':Sequelize[_0xd636('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd636('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd636('0x4')]},'membername':{'type':Sequelize[_0xd636('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xd636('0x4')]},'secondDisposition':{'type':Sequelize[_0xd636('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd636('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0xb21d8f){var _0x2f9be9=this['getDataValue'](_0xd636('0x6'));if(_0x2f9be9&&_0xb21d8f){this[_0xd636('0x7')](_0xd636('0x8'),moment(_0xb21d8f)[_0xd636('0x9')](moment(_0x2f9be9),_0xd636('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd636('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd636('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd636('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd636('0x5')]},'callback':{'type':Sequelize[_0xd636('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd636('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd636('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd636('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd636('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index e54700d..d3fa224 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 _0x9536=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','CmHopperFinal','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ListId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ListId)','CampaignId\x20=\x20?','cm_hopper_final','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x319218,_0x3cb9f1){var _0x10667a=function(_0xb143da){while(--_0xb143da){_0x319218['push'](_0x319218['shift']());}};_0x10667a(++_0x3cb9f1);}(_0x9536,0x179));var _0x6953=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0x9536[_0x3b16e1];return _0x311d1b;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':!![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['describe']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['describe']()[_0x6953('0x3c')](respondWithResult(_0x1d5979,null))[_0x6953('0x41')](handleError(_0x1d5979,null));};exports['update']=function(_0x525145,_0xbf5b61){if(_0x525145[_0x6953('0x48')][_0x6953('0x49')]){delete _0x525145[_0x6953('0x48')][_0x6953('0x49')];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'uniqueid':_0x525145[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xbf5b61,null))[_0x6953('0x3c')](saveUpdates(_0x525145[_0x6953('0x48')],null))['then'](respondWithResult(_0xbf5b61,null))['catch'](handleError(_0xbf5b61,null));};exports[_0x6953('0x4a')]=function(_0x38e3e8,_0x68ab5d,_0x7bcd92){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x38e3e8[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db['sequelize']['fn']('COUNT',db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db['sequelize']['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db['sequelize']['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x57')))),'reCallContacts'],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x58')))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x68ab5d,null))['then'](respondWithResult(_0x68ab5d,null))[_0x6953('0x41')](handleError(_0x68ab5d,null));};exports[_0x6953('0x5a')]=function(_0x35ac0e,_0x57ffab,_0x479ab4){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'CampaignId':_0x35ac0e[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5b')))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5c')))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5d')))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x57')))),_0x6953('0x5e')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x57ffab,null))['then'](respondWithResult(_0x57ffab,null))[_0x6953('0x41')](handleError(_0x57ffab,null));};exports[_0x6953('0x5f')]=function(_0x41d74d,_0x5063ac,_0x4cb8a4){return db[_0x6953('0x60')][_0x6953('0x47')]({'where':{'id':_0x41d74d[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x5063ac,null))[_0x6953('0x3c')](function(_0x43a39f){var _0x3cf1c0;if(_0x43a39f){_0x3cf1c0=squel[_0x6953('0x61')]()[_0x6953('0x62')]('cm_hopper')[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),_0x6953('0x66'),'ListId',_0x6953('0x67'),_0x6953('0x68'),_0x6953('0x69')],squel['select']()[_0x6953('0x6a')](_0x6953('0x6b'),_0x6953('0x64'))[_0x6953('0x6a')]('NOW()',_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field']('ANY_VALUE(ListId)',_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x68'))[_0x6953('0x6a')]('NOW()',_0x6953('0x69'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id']['toString']())['where'](_0x6953('0x71'),_0x41d74d[_0x6953('0x48')][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x64'))[_0x6953('0x6f')](_0x6953('0x76'))[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id'][_0x6953('0x73')]()))['where'](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x77'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))['group'](_0x6953('0x66')))[_0x6953('0x73')]();return db[_0x6953('0x4b')][_0x6953('0x2e')](_0x3cf1c0);}return[];})[_0x6953('0x3c')](respondWithResult(_0x5063ac,null))[_0x6953('0x41')](handleError(_0x5063ac,null));};exports[_0x6953('0x79')]=function(_0xa26241,_0xefb593,_0x216b92){return db[_0x6953('0x7a')]['find']({'where':{'id':_0xa26241[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xefb593,null))[_0x6953('0x3c')](function(_0x396a9f){var _0x92c0bc;if(_0x396a9f){_0x92c0bc=squel[_0x6953('0x61')]()[_0x6953('0x62')](_0x6953('0x76'))[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),'ContactId',_0x6953('0x6d'),_0x6953('0x7b'),_0x6953('0x68'),'updatedAt'],squel[_0x6953('0x7c')]()['field']('ANY_VALUE(calleridnum)',_0x6953('0x64'))[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field'](_0x6953('0x7d'),_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(CampaignId)',_0x6953('0x7b'))[_0x6953('0x6a')]('NOW()',_0x6953('0x68'))['field']('NOW()',_0x6953('0x69'))['from']('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id']['toString']())[_0x6953('0x39')](_0x6953('0x71'),_0xa26241['body'][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x64'))['from'](_0x6953('0x76'))[_0x6953('0x39')]('CampaignId\x20=\x20?',_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]()))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x77'))['from'](_0x6953('0x7f'))[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))[_0x6953('0x80')](_0x6953('0x66')))['toString']();return db[_0x6953('0x4b')]['query'](_0x92c0bc);}return[];})[_0x6953('0x3c')](respondWithResult(_0xefb593,null))['catch'](handleError(_0xefb593,null));};exports[_0x6953('0x81')]=function(_0x7215ed,_0x3cb96a,_0x46bcec){return db[_0x6953('0x82')]['findOne']({'where':{'VoiceQueueId':_0x7215ed[_0x6953('0x48')]['VoiceQueueId'],'CampaignId':_0x7215ed[_0x6953('0x48')][_0x6953('0x7b')],'ContactId':_0x7215ed[_0x6953('0x48')][_0x6953('0x66')]}})['then'](handleEntityNotFound(_0x3cb96a,null))[_0x6953('0x3c')](function(_0x50f019){if(_0x50f019){return _0x50f019;}return null;})[_0x6953('0x3c')](respondWithResult(_0x3cb96a,null))[_0x6953('0x41')](handleError(_0x3cb96a,null));}; \ No newline at end of file +var _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x326f,0xd1));var _0xf326=function(_0x43017a,_0x54e4df){_0x43017a=_0x43017a-0x0;var _0x447d9c=_0x326f[_0x43017a];return _0x447d9c;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d31ee90..7902e6c 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 _0xda7a=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x3d7450,_0x51a35c){var _0x5e895a=function(_0x12fa5e){while(--_0x12fa5e){_0x3d7450['push'](_0x3d7450['shift']());}};_0x5e895a(++_0x51a35c);}(_0xda7a,0x111));var _0xada7=function(_0x1297f8,_0x251a0f){_0x1297f8=_0x1297f8-0x0;var _0x198f42=_0xda7a[_0x1297f8];return _0x198f42;};'use strict';var _=require(_0xada7('0x0'));var util=require(_0xada7('0x1'));var logger=require(_0xada7('0x2'))(_0xada7('0x3'));var moment=require(_0xada7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xada7('0x5'));var rimraf=require('rimraf');var config=require(_0xada7('0x6'));var attributes=require(_0xada7('0x7'));module[_0xada7('0x8')]=function(_0x4eb899,_0x4a8b5e){return _0x4eb899[_0xada7('0x9')](_0xada7('0xa'),attributes,{'tableName':_0xada7('0xb'),'paranoid':![],'indexes':[{'name':_0xada7('0xc'),'fields':[_0xada7('0xc')]},{'name':_0xada7('0xd'),'fields':[_0xada7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae35=['util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','uniqueid','lodash'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xae35,0x1cd));var _0x5ae3=function(_0x536648,_0x662ae5){_0x536648=_0x536648-0x0;var _0x851401=_0xae35[_0x536648];return _0x851401;};'use strict';var _=require(_0x5ae3('0x0'));var util=require(_0x5ae3('0x1'));var logger=require(_0x5ae3('0x2'))(_0x5ae3('0x3'));var moment=require(_0x5ae3('0x4'));var BPromise=require(_0x5ae3('0x5'));var rp=require(_0x5ae3('0x6'));var fs=require('fs');var path=require(_0x5ae3('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5ae3('0x8'));module[_0x5ae3('0x9')]=function(_0x5ddc7c,_0x537f5d){return _0x5ddc7c[_0x5ae3('0xa')](_0x5ae3('0xb'),attributes,{'tableName':_0x5ae3('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x5ae3('0xd'),'fields':[_0x5ae3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 243e235..bebffd8 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(_0x315f68,_0x49166f){var _0x3da10c=function(_0x37ea98){while(--_0x37ea98){_0x315f68['push'](_0x315f68['shift']());}};_0x3da10c(++_0x49166f);}(_0xb10b,0x12a));var _0xbb10=function(_0x27fa65,_0x4e02ee){_0x27fa65=_0x27fa65-0x0;var _0x456594=_0xb10b[_0x27fa65];return _0x456594;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x13f7ae,_0x37c67c){var _0x2d24b5=function(_0xfb6048){while(--_0xfb6048){_0x13f7ae['push'](_0x13f7ae['shift']());}};_0x2d24b5(++_0x37c67c);}(_0x7a54,0x106));var _0x47a5=function(_0x55e2ee,_0x3f268b){_0x55e2ee=_0x55e2ee-0x0;var _0x17093e=_0x7a54[_0x55e2ee];return _0x17093e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 9aacc5a..d05c65a 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 _0x6f75=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','describe','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','exports','multer','util','path'];(function(_0x483afe,_0x466d80){var _0x21fd39=function(_0x7ec1c5){while(--_0x7ec1c5){_0x483afe['push'](_0x483afe['shift']());}};_0x21fd39(++_0x466d80);}(_0x6f75,0x71));var _0x56f7=function(_0x514a20,_0x2ab7a7){_0x514a20=_0x514a20-0x0;var _0x1d62df=_0x6f75[_0x514a20];return _0x1d62df;};'use strict';var multer=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var path=require(_0x56f7('0x2'));var timeout=require(_0x56f7('0x3'));var express=require(_0x56f7('0x4'));var router=express[_0x56f7('0x5')]();var fs_extra=require(_0x56f7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x56f7('0x7'));var config=require(_0x56f7('0x8'));var controller=require(_0x56f7('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x56f7('0xa')](_0x56f7('0xb'),auth['isAuthenticated'](),controller[_0x56f7('0xc')]);router['get']('/:id',auth[_0x56f7('0xd')](),controller[_0x56f7('0xe')]);router[_0x56f7('0xa')](_0x56f7('0xf'),auth[_0x56f7('0xd')](),controller[_0x56f7('0x10')]);router[_0x56f7('0xa')](_0x56f7('0x11'),auth[_0x56f7('0xd')](),controller[_0x56f7('0x12')]);router[_0x56f7('0x13')](_0x56f7('0x14'),auth[_0x56f7('0xd')](),controller[_0x56f7('0x15')]);router['post'](_0x56f7('0x16'),auth[_0x56f7('0xd')](),controller[_0x56f7('0x17')]);router[_0x56f7('0x13')](_0x56f7('0x18'),auth[_0x56f7('0xd')](),controller[_0x56f7('0x19')]);router[_0x56f7('0x1a')](_0x56f7('0x1b'),auth['isAuthenticated'](),controller['update']);module[_0x56f7('0x1c')]=router; \ No newline at end of file +var _0xa319=['show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe'];(function(_0x1cd96a,_0x350afa){var _0x29cff4=function(_0x427e3c){while(--_0x427e3c){_0x1cd96a['push'](_0x1cd96a['shift']());}};_0x29cff4(++_0x350afa);}(_0xa319,0x179));var _0x9a31=function(_0x55eaee,_0x459926){_0x55eaee=_0x55eaee-0x0;var _0x37314d=_0xa319[_0x55eaee];return _0x37314d;};'use strict';var multer=require(_0x9a31('0x0'));var util=require(_0x9a31('0x1'));var path=require(_0x9a31('0x2'));var timeout=require(_0x9a31('0x3'));var express=require('express');var router=express[_0x9a31('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a31('0x5'));var interaction=require(_0x9a31('0x6'));var config=require(_0x9a31('0x7'));var controller=require(_0x9a31('0x8'));router[_0x9a31('0x9')]('/',auth[_0x9a31('0xa')](),controller[_0x9a31('0xb')]);router['get']('/describe',auth[_0x9a31('0xa')](),controller[_0x9a31('0xc')]);router[_0x9a31('0x9')]('/:id',auth[_0x9a31('0xa')](),controller[_0x9a31('0xd')]);router[_0x9a31('0x9')](_0x9a31('0xe'),auth['isAuthenticated'](),controller[_0x9a31('0xf')]);router[_0x9a31('0x9')](_0x9a31('0x10'),auth[_0x9a31('0xa')](),controller[_0x9a31('0x11')]);router[_0x9a31('0x12')](_0x9a31('0x13'),auth[_0x9a31('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x9a31('0x14'),auth[_0x9a31('0xa')](),controller[_0x9a31('0x15')]);router['post']('/checkContactHopper',auth[_0x9a31('0xa')](),controller[_0x9a31('0x16')]);router[_0x9a31('0x17')]('/:id',auth[_0x9a31('0xa')](),controller[_0x9a31('0x18')]);module[_0x9a31('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index a738787..419a5ce 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 _0x11a2=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x11a2,0x10c));var _0x211a=function(_0x21dce1,_0x4f7ec5){_0x21dce1=_0x21dce1-0x0;var _0x239ecc=_0x11a2[_0x21dce1];return _0x239ecc;};'use strict';var Sequelize=require(_0x211a('0x0'));module[_0x211a('0x1')]={'state':{'type':Sequelize[_0x211a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x211a('0x3')]},'scheduledat':{'type':Sequelize[_0x211a('0x4')]},'countbusyretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x211a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x211a('0x3')]},'originatecalleridname':{'type':Sequelize[_0x211a('0x3')]},'calleridnum':{'type':Sequelize[_0x211a('0x3')]},'calleridname':{'type':Sequelize[_0x211a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x211a('0x4')]},'droptime':{'type':Sequelize[_0x211a('0x4')]},'endtime':{'type':Sequelize[_0x211a('0x4')]},'ringtime':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x211a('0x3')]},'campaign':{'type':Sequelize[_0x211a('0x3')]},'campaigntype':{'type':Sequelize[_0x211a('0x3')]},'membername':{'type':Sequelize[_0x211a('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x211a('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x211a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x211a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x211a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x211a('0x4')]},'edited':{'type':Sequelize[_0x211a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x211a('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x211a('0x3')]}}; \ No newline at end of file +var _0xda6a=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x1b0482,_0x2167c7){var _0x35fa01=function(_0x4750b6){while(--_0x4750b6){_0x1b0482['push'](_0x1b0482['shift']());}};_0x35fa01(++_0x2167c7);}(_0xda6a,0x10d));var _0xada6=function(_0x2abfee,_0x487368){_0x2abfee=_0x2abfee-0x0;var _0x3fe259=_0xda6a[_0x2abfee];return _0x3fe259;};'use strict';var Sequelize=require(_0xada6('0x0'));module[_0xada6('0x1')]={'state':{'type':Sequelize[_0xada6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xada6('0x3')]},'scheduledat':{'type':Sequelize[_0xada6('0x4')]},'countbusyretry':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xada6('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xada6('0x3')]},'originatecalleridname':{'type':Sequelize[_0xada6('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xada6('0x3')]},'starttime':{'type':Sequelize[_0xada6('0x4')]},'responsetime':{'type':Sequelize[_0xada6('0x4')]},'answertime':{'type':Sequelize[_0xada6('0x4')]},'droptime':{'type':Sequelize[_0xada6('0x4')]},'endtime':{'type':Sequelize[_0xada6('0x4')]},'ringtime':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xada6('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xada6('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xada6('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xada6('0x4')]},'edited':{'type':Sequelize[_0xada6('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xada6('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xada6('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 9866147..6ba17ba 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 _0x48c0=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','map','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','describe','uniqueid','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','CmHopperHistory','rawAttributes'];(function(_0x415335,_0x5c5100){var _0x300fa7=function(_0x4809e2){while(--_0x4809e2){_0x415335['push'](_0x415335['shift']());}};_0x300fa7(++_0x5c5100);}(_0x48c0,0x1cd));var _0x048c=function(_0x485400,_0xd9cdb1){_0x485400=_0x485400-0x0;var _0x447829=_0x48c0[_0x485400];return _0x447829;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x048c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x048c('0x1'));var rp=require('request-promise');var moment=require(_0x048c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x048c('0x3'));var path=require(_0x048c('0x4'));var sox=require(_0x048c('0x5'));var csv=require(_0x048c('0x6'));var ejs=require(_0x048c('0x7'));var fs=require('fs');var fs_extra=require(_0x048c('0x8'));var _=require(_0x048c('0x9'));var squel=require(_0x048c('0xa'));var crypto=require(_0x048c('0xb'));var jsforce=require(_0x048c('0xc'));var deskjs=require(_0x048c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x048c('0xe'));var Redis=require(_0x048c('0xf'));var authService=require(_0x048c('0x10'));var qs=require(_0x048c('0x11'));var as=require(_0x048c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x048c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x048c('0x14'));var db=require(_0x048c('0x15'))['db'];function respondWithStatusCode(_0x53a57b,_0x521b1d){_0x521b1d=_0x521b1d||0xcc;return function(_0x3d8222){if(_0x3d8222){return _0x53a57b[_0x048c('0x16')](_0x521b1d);}return _0x53a57b[_0x048c('0x17')](_0x521b1d)[_0x048c('0x18')]();};}function respondWithResult(_0x59a6f7,_0x325bf3){_0x325bf3=_0x325bf3||0xc8;return function(_0x56ccd8){if(_0x56ccd8){return _0x59a6f7['status'](_0x325bf3)['json'](_0x56ccd8);}};}function respondWithFilteredResult(_0x57d27e,_0x3ba089){return function(_0x7cc075){if(_0x7cc075){var _0x32ceb8=typeof _0x3ba089['offset']==='undefined'&&typeof _0x3ba089[_0x048c('0x19')]===_0x048c('0x1a');var _0x5d1fbb=_0x7cc075['count'];var _0x7e3310=_0x32ceb8?0x0:_0x3ba089[_0x048c('0x1b')];var _0x43e1a8=_0x32ceb8?_0x7cc075[_0x048c('0x1c')]:_0x3ba089[_0x048c('0x1b')]+_0x3ba089[_0x048c('0x19')];var _0x18263d;if(_0x43e1a8>=_0x5d1fbb){_0x43e1a8=_0x5d1fbb;_0x18263d=0xc8;}else{_0x18263d=0xce;}_0x57d27e[_0x048c('0x17')](_0x18263d);return _0x57d27e[_0x048c('0x1d')](_0x048c('0x1e'),_0x7e3310+'-'+_0x43e1a8+'/'+_0x5d1fbb)[_0x048c('0x1f')](_0x7cc075);}return null;};}function patchUpdates(_0x5c0f2b){return function(_0x471b59){try{jsonpatch[_0x048c('0x20')](_0x471b59,_0x5c0f2b,!![]);}catch(_0x5d59b3){return BPromise[_0x048c('0x21')](_0x5d59b3);}return _0x471b59[_0x048c('0x22')]();};}function saveUpdates(_0x48d87e,_0x2ea59a){return function(_0x1f88a5){if(_0x1f88a5){return _0x1f88a5['update'](_0x48d87e)[_0x048c('0x23')](function(_0x9cf040){return _0x9cf040;});}return null;};}function removeEntity(_0x350002,_0xf875d9){return function(_0x2472c2){if(_0x2472c2){return _0x2472c2[_0x048c('0x24')]()['then'](function(){_0x350002[_0x048c('0x17')](0xcc)[_0x048c('0x18')]();});}};}function handleEntityNotFound(_0x2fef1d,_0xae1a5e){return function(_0x50773a){if(!_0x50773a){_0x2fef1d['sendStatus'](0x194);}return _0x50773a;};}function handleError(_0x366f5e,_0x4b2e98){_0x4b2e98=_0x4b2e98||0x1f4;return function(_0x5689a6){logger[_0x048c('0x25')](_0x5689a6['stack']);if(_0x5689a6[_0x048c('0x26')]){delete _0x5689a6[_0x048c('0x26')];}_0x366f5e[_0x048c('0x17')](_0x4b2e98)[_0x048c('0x27')](_0x5689a6);};}exports[_0x048c('0x28')]=function(_0x44a8ae,_0x3c3ade){var _0x486020={},_0x2be1bd={},_0x5b56be={'count':0x0,'rows':[]};var _0x283376=_['map'](db[_0x048c('0x29')][_0x048c('0x2a')],function(_0x525a65){return{'name':_0x525a65['fieldName'],'type':_0x525a65['type'][_0x048c('0x2b')]};});_0x2be1bd[_0x048c('0x2c')]=_['map'](_0x283376,_0x048c('0x26'));_0x2be1bd[_0x048c('0x2d')]=_[_0x048c('0x2e')](_0x44a8ae['query']);_0x2be1bd[_0x048c('0x2f')]=_[_0x048c('0x30')](_0x2be1bd[_0x048c('0x2c')],_0x2be1bd[_0x048c('0x2d')]);_0x486020[_0x048c('0x31')]=_['intersection'](_0x2be1bd[_0x048c('0x2c')],qs[_0x048c('0x32')](_0x44a8ae[_0x048c('0x2d')][_0x048c('0x32')]));_0x486020['attributes']=_0x486020[_0x048c('0x31')][_0x048c('0x33')]?_0x486020[_0x048c('0x31')]:_0x2be1bd['model'];if(!_0x44a8ae[_0x048c('0x2d')]['hasOwnProperty'](_0x048c('0x34'))){_0x486020[_0x048c('0x19')]=qs[_0x048c('0x19')](_0x44a8ae['query'][_0x048c('0x19')]);_0x486020[_0x048c('0x1b')]=qs[_0x048c('0x1b')](_0x44a8ae[_0x048c('0x2d')][_0x048c('0x1b')]);}_0x486020[_0x048c('0x35')]=qs['sort'](_0x44a8ae['query'][_0x048c('0x36')]);_0x486020['where']=qs[_0x048c('0x2f')](_['pick'](_0x44a8ae['query'],_0x2be1bd['filters']),_0x283376);if(_0x44a8ae[_0x048c('0x2d')][_0x048c('0x37')]){_0x486020[_0x048c('0x38')]=_['merge'](_0x486020[_0x048c('0x38')],{'$or':_[_0x048c('0x39')](_0x283376,function(_0x5d8f0c){if(_0x5d8f0c[_0x048c('0x3a')]!==_0x048c('0x3b')){var _0x30a545={};_0x30a545[_0x5d8f0c[_0x048c('0x26')]]={'$like':'%'+_0x44a8ae['query'][_0x048c('0x37')]+'%'};return _0x30a545;}})});}_0x486020=_[_0x048c('0x3c')]({},_0x486020,_0x44a8ae[_0x048c('0x3d')]);var _0x397cdc={'where':_0x486020[_0x048c('0x38')]};return db['CmHopperHistory'][_0x048c('0x1c')](_0x397cdc)[_0x048c('0x23')](function(_0x3c6899){_0x5b56be[_0x048c('0x1c')]=_0x3c6899;if(_0x44a8ae['query'][_0x048c('0x3e')]){_0x486020[_0x048c('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x486020);})[_0x048c('0x23')](function(_0x8d2512){_0x5b56be[_0x048c('0x40')]=_0x8d2512;return _0x5b56be;})[_0x048c('0x23')](respondWithFilteredResult(_0x3c3ade,_0x486020))[_0x048c('0x41')](handleError(_0x3c3ade,null));};exports[_0x048c('0x42')]=function(_0x2c1589,_0x9511d1){var _0x3dfb8e={'raw':!![],'where':{'id':_0x2c1589[_0x048c('0x43')]['id']}},_0x1fb53c={};_0x1fb53c[_0x048c('0x2c')]=_[_0x048c('0x2e')](db[_0x048c('0x29')]['rawAttributes']);_0x1fb53c[_0x048c('0x2d')]=_['keys'](_0x2c1589[_0x048c('0x2d')]);_0x1fb53c['filters']=_['intersection'](_0x1fb53c['model'],_0x1fb53c['query']);_0x3dfb8e[_0x048c('0x31')]=_[_0x048c('0x30')](_0x1fb53c[_0x048c('0x2c')],qs[_0x048c('0x32')](_0x2c1589[_0x048c('0x2d')][_0x048c('0x32')]));_0x3dfb8e['attributes']=_0x3dfb8e[_0x048c('0x31')][_0x048c('0x33')]?_0x3dfb8e[_0x048c('0x31')]:_0x1fb53c[_0x048c('0x2c')];if(_0x2c1589[_0x048c('0x2d')][_0x048c('0x3e')]){_0x3dfb8e['include']=[{'all':!![]}];}_0x3dfb8e=_['merge']({},_0x3dfb8e,_0x2c1589[_0x048c('0x3d')]);return db[_0x048c('0x29')]['find'](_0x3dfb8e)[_0x048c('0x23')](handleEntityNotFound(_0x9511d1,null))[_0x048c('0x23')](respondWithResult(_0x9511d1,null))[_0x048c('0x41')](handleError(_0x9511d1,null));};exports[_0x048c('0x44')]=function(_0x4207f2,_0x26673f){return db[_0x048c('0x29')][_0x048c('0x44')](_0x4207f2[_0x048c('0x45')],{})[_0x048c('0x23')](respondWithResult(_0x26673f,0xc9))[_0x048c('0x41')](handleError(_0x26673f,null));};exports[_0x048c('0x46')]=function(_0xf2a2fa,_0x20fec3){return db['CmHopperHistory'][_0x048c('0x46')]()[_0x048c('0x23')](respondWithResult(_0x20fec3,null))['catch'](handleError(_0x20fec3,null));};exports['update']=function(_0x2023b8,_0x3bc1e3){if(_0x2023b8['body'][_0x048c('0x47')]){delete _0x2023b8[_0x048c('0x45')][_0x048c('0x47')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x2023b8[_0x048c('0x43')]['id']}})[_0x048c('0x23')](handleEntityNotFound(_0x3bc1e3,null))[_0x048c('0x23')](saveUpdates(_0x2023b8[_0x048c('0x45')],null))[_0x048c('0x23')](respondWithResult(_0x3bc1e3,null))[_0x048c('0x41')](handleError(_0x3bc1e3,null));}; \ No newline at end of file +var _0x7c78=['apply','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperHistory','includeAll','include','findAll','rows','catch','show','params','options','create','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x7c78,0x1a1));var _0x87c7=function(_0x43c407,_0x128a36){_0x43c407=_0x43c407-0x0;var _0x2dfe3e=_0x7c78[_0x43c407];return _0x2dfe3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87c7('0x0'));var zipdir=require(_0x87c7('0x1'));var jsonpatch=require(_0x87c7('0x2'));var rp=require(_0x87c7('0x3'));var moment=require('moment');var BPromise=require(_0x87c7('0x4'));var Mustache=require(_0x87c7('0x5'));var util=require(_0x87c7('0x6'));var path=require(_0x87c7('0x7'));var sox=require('sox');var csv=require(_0x87c7('0x8'));var ejs=require(_0x87c7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87c7('0xa'));var squel=require(_0x87c7('0xb'));var crypto=require(_0x87c7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x87c7('0xd'));var toCsv=require(_0x87c7('0x8'));var querystring=require(_0x87c7('0xe'));var Papa=require('papaparse');var Redis=require(_0x87c7('0xf'));var authService=require(_0x87c7('0x10'));var qs=require(_0x87c7('0x11'));var as=require(_0x87c7('0x12'));var hardwareService=require(_0x87c7('0x13'));var logger=require('../../config/logger')(_0x87c7('0x14'));var utils=require(_0x87c7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x87c7('0x16'));var db=require(_0x87c7('0x17'))['db'];function respondWithStatusCode(_0x2be3f8,_0x57da53){_0x57da53=_0x57da53||0xcc;return function(_0x3e2df4){if(_0x3e2df4){return _0x2be3f8[_0x87c7('0x18')](_0x57da53);}return _0x2be3f8[_0x87c7('0x19')](_0x57da53)[_0x87c7('0x1a')]();};}function respondWithResult(_0x5e5e85,_0x46fdb0){_0x46fdb0=_0x46fdb0||0xc8;return function(_0x1a306a){if(_0x1a306a){return _0x5e5e85[_0x87c7('0x19')](_0x46fdb0)[_0x87c7('0x1b')](_0x1a306a);}};}function respondWithFilteredResult(_0x28c9a5,_0x2e1471){return function(_0x5e6cb1){if(_0x5e6cb1){var _0xc32bc0=typeof _0x2e1471[_0x87c7('0x1c')]===_0x87c7('0x1d')&&typeof _0x2e1471['limit']===_0x87c7('0x1d');var _0x53c992=_0x5e6cb1['count'];var _0x3a15b2=_0xc32bc0?0x0:_0x2e1471['offset'];var _0x18e1a1=_0xc32bc0?_0x5e6cb1[_0x87c7('0x1e')]:_0x2e1471[_0x87c7('0x1c')]+_0x2e1471['limit'];var _0x51c48d;if(_0x18e1a1>=_0x53c992){_0x18e1a1=_0x53c992;_0x51c48d=0xc8;}else{_0x51c48d=0xce;}_0x28c9a5[_0x87c7('0x19')](_0x51c48d);return _0x28c9a5[_0x87c7('0x1f')](_0x87c7('0x20'),_0x3a15b2+'-'+_0x18e1a1+'/'+_0x53c992)[_0x87c7('0x1b')](_0x5e6cb1);}return null;};}function patchUpdates(_0x289788){return function(_0x5bc4b0){try{jsonpatch[_0x87c7('0x21')](_0x5bc4b0,_0x289788,!![]);}catch(_0x33cbc5){return BPromise['reject'](_0x33cbc5);}return _0x5bc4b0[_0x87c7('0x22')]();};}function saveUpdates(_0x4c65b7,_0x3c5988){return function(_0x4cb372){if(_0x4cb372){return _0x4cb372[_0x87c7('0x23')](_0x4c65b7)[_0x87c7('0x24')](function(_0x382b9c){return _0x382b9c;});}return null;};}function removeEntity(_0x9fc6cc,_0x6020fd){return function(_0x6e4a98){if(_0x6e4a98){return _0x6e4a98[_0x87c7('0x25')]()[_0x87c7('0x24')](function(){_0x9fc6cc[_0x87c7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b3361,_0x1af30b){return function(_0x371eaf){if(!_0x371eaf){_0x5b3361[_0x87c7('0x18')](0x194);}return _0x371eaf;};}function handleError(_0x24d6c3,_0x331f5a){_0x331f5a=_0x331f5a||0x1f4;return function(_0x26ba1a){logger['error'](_0x26ba1a[_0x87c7('0x26')]);if(_0x26ba1a[_0x87c7('0x27')]){delete _0x26ba1a[_0x87c7('0x27')];}_0x24d6c3[_0x87c7('0x19')](_0x331f5a)['send'](_0x26ba1a);};}exports[_0x87c7('0x28')]=function(_0x1cb180,_0x276056){var _0x237a34={},_0x2ad0ef={},_0x3eb3ef={'count':0x0,'rows':[]};var _0xfedfef=_[_0x87c7('0x29')](db['CmHopperHistory'][_0x87c7('0x2a')],function(_0x1d6017){return{'name':_0x1d6017[_0x87c7('0x2b')],'type':_0x1d6017[_0x87c7('0x2c')]['key']};});_0x2ad0ef[_0x87c7('0x2d')]=_[_0x87c7('0x29')](_0xfedfef,'name');_0x2ad0ef[_0x87c7('0x2e')]=_[_0x87c7('0x2f')](_0x1cb180[_0x87c7('0x2e')]);_0x2ad0ef[_0x87c7('0x30')]=_[_0x87c7('0x31')](_0x2ad0ef['model'],_0x2ad0ef[_0x87c7('0x2e')]);_0x237a34[_0x87c7('0x32')]=_[_0x87c7('0x31')](_0x2ad0ef[_0x87c7('0x2d')],qs[_0x87c7('0x33')](_0x1cb180['query'][_0x87c7('0x33')]));_0x237a34[_0x87c7('0x32')]=_0x237a34[_0x87c7('0x32')][_0x87c7('0x34')]?_0x237a34[_0x87c7('0x32')]:_0x2ad0ef[_0x87c7('0x2d')];if(!_0x1cb180[_0x87c7('0x2e')]['hasOwnProperty'](_0x87c7('0x35'))){_0x237a34[_0x87c7('0x36')]=qs['limit'](_0x1cb180[_0x87c7('0x2e')]['limit']);_0x237a34[_0x87c7('0x1c')]=qs['offset'](_0x1cb180[_0x87c7('0x2e')][_0x87c7('0x1c')]);}_0x237a34[_0x87c7('0x37')]=qs[_0x87c7('0x38')](_0x1cb180[_0x87c7('0x2e')][_0x87c7('0x38')]);_0x237a34['where']=qs['filters'](_[_0x87c7('0x39')](_0x1cb180[_0x87c7('0x2e')],_0x2ad0ef[_0x87c7('0x30')]),_0xfedfef);if(_0x1cb180[_0x87c7('0x2e')][_0x87c7('0x3a')]){_0x237a34[_0x87c7('0x3b')]=_[_0x87c7('0x3c')](_0x237a34[_0x87c7('0x3b')],{'$or':_[_0x87c7('0x29')](_0xfedfef,function(_0x380480){if(_0x380480[_0x87c7('0x2c')]!==_0x87c7('0x3d')){var _0x59266a={};_0x59266a[_0x380480['name']]={'$like':'%'+_0x1cb180[_0x87c7('0x2e')][_0x87c7('0x3a')]+'%'};return _0x59266a;}})});}_0x237a34=_[_0x87c7('0x3c')]({},_0x237a34,_0x1cb180['options']);var _0x33f9a7={'where':_0x237a34[_0x87c7('0x3b')]};return db[_0x87c7('0x3e')][_0x87c7('0x1e')](_0x33f9a7)[_0x87c7('0x24')](function(_0x219b7b){_0x3eb3ef[_0x87c7('0x1e')]=_0x219b7b;if(_0x1cb180[_0x87c7('0x2e')][_0x87c7('0x3f')]){_0x237a34[_0x87c7('0x40')]=[{'all':!![]}];}return db[_0x87c7('0x3e')][_0x87c7('0x41')](_0x237a34);})[_0x87c7('0x24')](function(_0x5d25d4){_0x3eb3ef[_0x87c7('0x42')]=_0x5d25d4;return _0x3eb3ef;})['then'](respondWithFilteredResult(_0x276056,_0x237a34))[_0x87c7('0x43')](handleError(_0x276056,null));};exports[_0x87c7('0x44')]=function(_0x4a6e83,_0x5354c8){var _0x1a7181={'raw':!![],'where':{'id':_0x4a6e83[_0x87c7('0x45')]['id']}},_0x310c1b={};_0x310c1b[_0x87c7('0x2d')]=_[_0x87c7('0x2f')](db[_0x87c7('0x3e')][_0x87c7('0x2a')]);_0x310c1b[_0x87c7('0x2e')]=_['keys'](_0x4a6e83['query']);_0x310c1b[_0x87c7('0x30')]=_[_0x87c7('0x31')](_0x310c1b[_0x87c7('0x2d')],_0x310c1b[_0x87c7('0x2e')]);_0x1a7181[_0x87c7('0x32')]=_[_0x87c7('0x31')](_0x310c1b[_0x87c7('0x2d')],qs[_0x87c7('0x33')](_0x4a6e83[_0x87c7('0x2e')]['fields']));_0x1a7181[_0x87c7('0x32')]=_0x1a7181[_0x87c7('0x32')][_0x87c7('0x34')]?_0x1a7181[_0x87c7('0x32')]:_0x310c1b[_0x87c7('0x2d')];if(_0x4a6e83['query'][_0x87c7('0x3f')]){_0x1a7181[_0x87c7('0x40')]=[{'all':!![]}];}_0x1a7181=_['merge']({},_0x1a7181,_0x4a6e83[_0x87c7('0x46')]);return db[_0x87c7('0x3e')]['find'](_0x1a7181)[_0x87c7('0x24')](handleEntityNotFound(_0x5354c8,null))[_0x87c7('0x24')](respondWithResult(_0x5354c8,null))['catch'](handleError(_0x5354c8,null));};exports[_0x87c7('0x47')]=function(_0x508fea,_0x2cbcaf){return db[_0x87c7('0x3e')][_0x87c7('0x47')](_0x508fea[_0x87c7('0x48')],{})['then'](respondWithResult(_0x2cbcaf,0xc9))[_0x87c7('0x43')](handleError(_0x2cbcaf,null));};exports['describe']=function(_0x299784,_0x2e3679){return db[_0x87c7('0x3e')][_0x87c7('0x49')]()[_0x87c7('0x24')](respondWithResult(_0x2e3679,null))[_0x87c7('0x43')](handleError(_0x2e3679,null));};exports[_0x87c7('0x23')]=function(_0x1ea771,_0x2983d7){if(_0x1ea771[_0x87c7('0x48')][_0x87c7('0x4a')]){delete _0x1ea771[_0x87c7('0x48')][_0x87c7('0x4a')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x1ea771[_0x87c7('0x45')]['id']}})[_0x87c7('0x24')](handleEntityNotFound(_0x2983d7,null))[_0x87c7('0x24')](saveUpdates(_0x1ea771[_0x87c7('0x48')],null))[_0x87c7('0x24')](respondWithResult(_0x2983d7,null))[_0x87c7('0x43')](handleError(_0x2983d7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 86b8c38..f5e1391 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 _0x3cae=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmHopperHistory','endtime','uniqueid','lodash'];(function(_0x174de8,_0x47c633){var _0xb30eba=function(_0xc071f4){while(--_0xc071f4){_0x174de8['push'](_0x174de8['shift']());}};_0xb30eba(++_0x47c633);}(_0x3cae,0x117));var _0xe3ca=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x3cae[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var logger=require(_0xe3ca('0x2'))(_0xe3ca('0x3'));var moment=require(_0xe3ca('0x4'));var BPromise=require(_0xe3ca('0x5'));var rp=require(_0xe3ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3ca('0x7'));var config=require(_0xe3ca('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0xe3ca('0x9')]=function(_0x48691a,_0x2f2632){return _0x48691a[_0xe3ca('0xa')](_0xe3ca('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xe3ca('0xc'),'fields':[_0xe3ca('0xc')]},{'name':_0xe3ca('0xd'),'fields':[_0xe3ca('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ac2=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','lodash','../../config/logger'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0x6ac2,0x184));var _0x26ac=function(_0x4d1cb2,_0x558095){_0x4d1cb2=_0x4d1cb2-0x0;var _0x4f83ce=_0x6ac2[_0x4d1cb2];return _0x4f83ce;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var logger=require(_0x26ac('0x1'))(_0x26ac('0x2'));var moment=require(_0x26ac('0x3'));var BPromise=require(_0x26ac('0x4'));var rp=require(_0x26ac('0x5'));var fs=require('fs');var path=require(_0x26ac('0x6'));var rimraf=require('rimraf');var config=require(_0x26ac('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x26ac('0x8')]=function(_0x4168ff,_0x1cc988){return _0x4168ff[_0x26ac('0x9')](_0x26ac('0xa'),attributes,{'tableName':_0x26ac('0xb'),'paranoid':![],'indexes':[{'name':_0x26ac('0xc'),'fields':[_0x26ac('0xc')]},{'name':'uniqueid','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 72dee07..fc581c9 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 _0xab02=['then','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','CreateCmHopperHistory','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xab02,0xc5));var _0x2ab0=function(_0x5a2d3c,_0x49e114){_0x5a2d3c=_0x5a2d3c-0x0;var _0x531638=_0xab02[_0x5a2d3c];return _0x531638;};'use strict';var _=require(_0x2ab0('0x0'));var util=require(_0x2ab0('0x1'));var moment=require(_0x2ab0('0x2'));var BPromise=require(_0x2ab0('0x3'));var rs=require(_0x2ab0('0x4'));var fs=require('fs');var Redis=require(_0x2ab0('0x5'));var db=require(_0x2ab0('0x6'))['db'];var utils=require(_0x2ab0('0x7'));var logger=require(_0x2ab0('0x8'))(_0x2ab0('0x9'));var config=require(_0x2ab0('0xa'));var jayson=require(_0x2ab0('0xb'));var client=jayson[_0x2ab0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d0c67,_0x5e7e13,_0x524916){return new BPromise(function(_0x51e798,_0x54a674){return client['request'](_0x1d0c67,_0x524916)[_0x2ab0('0xd')](function(_0x4de577){logger[_0x2ab0('0xe')](_0x2ab0('0xf'),_0x5e7e13,'request\x20sent');logger[_0x2ab0('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5e7e13,_0x2ab0('0x11'),JSON[_0x2ab0('0x12')](_0x4de577));if(_0x4de577[_0x2ab0('0x13')]){if(_0x4de577[_0x2ab0('0x13')][_0x2ab0('0x14')]===0x1f4){logger[_0x2ab0('0x13')](_0x2ab0('0xf'),_0x5e7e13,_0x4de577['error'][_0x2ab0('0x15')]);return _0x54a674(_0x4de577[_0x2ab0('0x13')]['message']);}logger[_0x2ab0('0x13')](_0x2ab0('0xf'),_0x5e7e13,_0x4de577[_0x2ab0('0x13')][_0x2ab0('0x15')]);return _0x51e798(_0x4de577[_0x2ab0('0x13')]['message']);}else{logger[_0x2ab0('0xe')](_0x2ab0('0xf'),_0x5e7e13,_0x2ab0('0x11'));_0x51e798(_0x4de577['result'][_0x2ab0('0x15')]);}})[_0x2ab0('0x16')](function(_0x4b26f4){logger[_0x2ab0('0x13')](_0x2ab0('0xf'),_0x5e7e13,_0x4b26f4);_0x54a674(_0x4b26f4);});});}exports[_0x2ab0('0x17')]=function(_0x5d3e9e){var _0x2789a9=this;return new Promise(function(_0x4c55da,_0xae1102){return db['CmHopperHistory']['create'](_0x5d3e9e[_0x2ab0('0x18')],{'raw':_0x5d3e9e[_0x2ab0('0x19')]?_0x5d3e9e[_0x2ab0('0x19')][_0x2ab0('0x1a')]===undefined?!![]:![]:!![]})[_0x2ab0('0xd')](function(_0x11f642){logger[_0x2ab0('0xe')](_0x2ab0('0x17'),_0x5d3e9e);logger['debug'](_0x2ab0('0x17'),_0x5d3e9e,JSON[_0x2ab0('0x12')](_0x11f642));_0x4c55da(_0x11f642);})[_0x2ab0('0x16')](function(_0x1d20cb){logger[_0x2ab0('0x13')](_0x2ab0('0x17'),_0x1d20cb[_0x2ab0('0x15')],_0x5d3e9e);_0xae1102(_0x2789a9['error'](0x1f4,_0x1d20cb[_0x2ab0('0x15')]));});});};exports[_0x2ab0('0x1b')]=function(_0x18021e){var _0x35571d=this;return new Promise(function(_0x59b826,_0x5bdaee){return db[_0x2ab0('0x1c')][_0x2ab0('0x1d')]({'raw':_0x18021e[_0x2ab0('0x19')]?_0x18021e[_0x2ab0('0x19')][_0x2ab0('0x1a')]===undefined?!![]:![]:!![],'where':_0x18021e[_0x2ab0('0x19')]?_0x18021e[_0x2ab0('0x19')]['where']||null:null,'attributes':[[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db[_0x2ab0('0x1e')][_0x2ab0('0x20')]('id')),_0x2ab0('0x21')],[db[_0x2ab0('0x1e')]['fn']('COUNT',db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db['sequelize']['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x2ab0('0x1e')]['fn']('COUNT',db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x24')))),_0x2ab0('0x25')],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x26'),db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x27')))),_0x2ab0('0x28')],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x26'),db[_0x2ab0('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x2ab0('0x29')))),_0x2ab0('0x2a')]]})['then'](function(_0x644e2e){logger['info']('AvgHandleTime',_0x18021e);logger[_0x2ab0('0x10')](_0x2ab0('0x1b'),_0x18021e,JSON['stringify'](_0x644e2e));_0x59b826(_0x644e2e);})['catch'](function(_0x2de628){logger[_0x2ab0('0x13')](_0x2ab0('0x1b'),_0x2de628['message'],_0x18021e);_0x5bdaee(_0x35571d[_0x2ab0('0x13')](0x1f4,_0x2de628[_0x2ab0('0x15')]));});});};exports[_0x2ab0('0x2b')]=function(_0x8cf4d8){var _0x37b0f5=this;return new Promise(function(_0x244399,_0x2eecfb){return db[_0x2ab0('0x1c')][_0x2ab0('0x1d')]({'raw':_0x8cf4d8[_0x2ab0('0x19')]?_0x8cf4d8['options']['raw']===undefined?!![]:![]:!![],'where':_0x8cf4d8[_0x2ab0('0x19')]?_0x8cf4d8[_0x2ab0('0x19')][_0x2ab0('0x2c')]||null:null,'attributes':[[_0x2ab0('0x2d'),'name'],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db[_0x2ab0('0x1e')]['fn']('IF',db['sequelize'][_0x2ab0('0x22')](_0x2ab0('0x2e')))),_0x2ab0('0x2f')],[db[_0x2ab0('0x1e')]['fn']('COUNT',db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x2ab0('0x30')],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db['sequelize']['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x2ab0('0x31')],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x32')))),'outboundBusyCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x33')))),_0x2ab0('0x34')],[db['sequelize']['fn'](_0x2ab0('0x1f'),db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x35')))),'outboundDropCallsDayTimeout'],[db[_0x2ab0('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2ab0('0x1e')]['literal'](_0x2ab0('0x36')))),'outboundDropCallsDayCallersExit'],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db['sequelize']['fn']('IF',db[_0x2ab0('0x1e')]['literal'](_0x2ab0('0x37')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x2ab0('0x1f'),db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x38')))),_0x2ab0('0x39')],[db['sequelize']['fn'](_0x2ab0('0x1f'),db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x3a')))),_0x2ab0('0x3b')],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db['sequelize']['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x3c')))),_0x2ab0('0x3d')],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db['sequelize']['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x2ab0('0x3e')],[db[_0x2ab0('0x1e')]['fn']('COUNT',db[_0x2ab0('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x2ab0('0x3f')))),_0x2ab0('0x3d')],[db[_0x2ab0('0x1e')]['fn'](_0x2ab0('0x1f'),db[_0x2ab0('0x1e')]['fn']('IF',db[_0x2ab0('0x1e')][_0x2ab0('0x22')](_0x2ab0('0x40')))),_0x2ab0('0x41')]],'group':[_0x2ab0('0x2d')]})[_0x2ab0('0xd')](function(_0x51eef1){logger[_0x2ab0('0xe')](_0x2ab0('0x2b'),_0x8cf4d8);logger[_0x2ab0('0x10')]('GetVoiceQueueHopperHistory',_0x8cf4d8,JSON[_0x2ab0('0x12')](_0x51eef1));_0x244399(_0x51eef1);})[_0x2ab0('0x16')](function(_0x38f7da){logger[_0x2ab0('0x13')](_0x2ab0('0x2b'),_0x38f7da['message'],_0x8cf4d8);_0x2eecfb(_0x37b0f5[_0x2ab0('0x13')](0x1f4,_0x38f7da[_0x2ab0('0x15')]));});});};exports[_0x2ab0('0x42')]=function(_0x193118){var _0x2bb1b0=this;return new Promise(function(_0x1adb11,_0x4684a8){return db['CmHopperHistory']['findAll']({'raw':_0x193118[_0x2ab0('0x19')]?_0x193118[_0x2ab0('0x19')][_0x2ab0('0x1a')]===undefined?!![]:![]:!![],'where':_0x193118[_0x2ab0('0x19')]?_0x193118[_0x2ab0('0x19')]['where']||null:null,'attributes':[[_0x2ab0('0x2d'),_0x2ab0('0x43')],[db[_0x2ab0('0x1e')]['fn']('COUNT',db[_0x2ab0('0x1e')][_0x2ab0('0x20')]('id')),_0x2ab0('0x44')],[db[_0x2ab0('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x2ab0('0x45')]],'group':[_0x2ab0('0x2d')]})[_0x2ab0('0xd')](function(_0x4444e3){logger[_0x2ab0('0xe')](_0x2ab0('0x42'),_0x193118);logger[_0x2ab0('0x10')](_0x2ab0('0x42'),_0x193118,JSON[_0x2ab0('0x12')](_0x4444e3));_0x1adb11(_0x4444e3);})['catch'](function(_0x2cbd15){logger[_0x2ab0('0x13')]('GetCampaignHopperHistory',_0x2cbd15[_0x2ab0('0x15')],_0x193118);_0x4684a8(_0x2bb1b0[_0x2ab0('0x13')](0x1f4,_0x2cbd15[_0x2ab0('0x15')]));});});}; \ No newline at end of file +var _0x9e0d=['GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','col','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopperHistory','options','CreateCmHopperHistory','AvgHandleTime','raw','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime'];(function(_0x13ac0a,_0x4a2374){var _0x5400fd=function(_0x3b652f){while(--_0x3b652f){_0x13ac0a['push'](_0x13ac0a['shift']());}};_0x5400fd(++_0x4a2374);}(_0x9e0d,0xf7));var _0xd9e0=function(_0xc7ca44,_0x383f64){_0xc7ca44=_0xc7ca44-0x0;var _0x5154ff=_0x9e0d[_0xc7ca44];return _0x5154ff;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ce1e,_0x36d1c7,_0x3f8bb2){return new BPromise(function(_0x256df0,_0x3315d8){return client['request'](_0x28ce1e,_0x3f8bb2)[_0xd9e0('0xb')](function(_0x36e6e7){logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,_0xd9e0('0xe'));logger[_0xd9e0('0xf')](_0xd9e0('0x10'),_0x36d1c7,'request\x20sent',JSON[_0xd9e0('0x11')](_0x36e6e7));if(_0x36e6e7[_0xd9e0('0x12')]){if(_0x36e6e7['error'][_0xd9e0('0x13')]===0x1f4){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3315d8(_0x36e6e7['error'][_0xd9e0('0x14')]);}logger['error'](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7['error'][_0xd9e0('0x14')]);return _0x256df0(_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,'request\x20sent');_0x256df0(_0x36e6e7['result']['message']);}})[_0xd9e0('0x15')](function(_0x386816){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x386816);_0x3315d8(_0x386816);});});}exports['CreateCmHopperHistory']=function(_0x209c04){var _0x56421e=this;return new Promise(function(_0x483b74,_0x2fcad6){return db[_0xd9e0('0x16')]['create'](_0x209c04['body'],{'raw':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xd9e0('0xb')](function(_0x4cc3c9){logger[_0xd9e0('0xc')](_0xd9e0('0x18'),_0x209c04);logger[_0xd9e0('0xf')](_0xd9e0('0x18'),_0x209c04,JSON[_0xd9e0('0x11')](_0x4cc3c9));_0x483b74(_0x4cc3c9);})['catch'](function(_0x19534a){logger[_0xd9e0('0x12')]('CreateCmHopperHistory',_0x19534a[_0xd9e0('0x14')],_0x209c04);_0x2fcad6(_0x56421e[_0xd9e0('0x12')](0x1f4,_0x19534a['message']));});});};exports[_0xd9e0('0x19')]=function(_0x5e17d4){var _0x274815=this;return new Promise(function(_0x33a1ea,_0x48dbf9){return db[_0xd9e0('0x16')]['findAll']({'raw':_0x5e17d4['options']?_0x5e17d4['options'][_0xd9e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e17d4[_0xd9e0('0x17')]?_0x5e17d4[_0xd9e0('0x17')][_0xd9e0('0x1b')]||null:null,'attributes':[[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['col']('id')),_0xd9e0('0x1e')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x20')))),_0xd9e0('0x21')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db['sequelize'][_0xd9e0('0x1f')](_0xd9e0('0x22')))),_0xd9e0('0x23')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x24'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x25')))),_0xd9e0('0x26')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x24'),db['sequelize']['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x27')))),_0xd9e0('0x28')]]})[_0xd9e0('0xb')](function(_0x514069){logger[_0xd9e0('0xc')](_0xd9e0('0x19'),_0x5e17d4);logger[_0xd9e0('0xf')](_0xd9e0('0x19'),_0x5e17d4,JSON['stringify'](_0x514069));_0x33a1ea(_0x514069);})[_0xd9e0('0x15')](function(_0x510829){logger[_0xd9e0('0x12')](_0xd9e0('0x19'),_0x510829[_0xd9e0('0x14')],_0x5e17d4);_0x48dbf9(_0x274815[_0xd9e0('0x12')](0x1f4,_0x510829[_0xd9e0('0x14')]));});});};exports[_0xd9e0('0x29')]=function(_0x19ff63){var _0x40a542=this;return new Promise(function(_0x4574fb,_0x5065f7){return db[_0xd9e0('0x16')][_0xd9e0('0x2a')]({'raw':_0x19ff63[_0xd9e0('0x17')]?_0x19ff63[_0xd9e0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x19ff63[_0xd9e0('0x17')]?_0x19ff63[_0xd9e0('0x17')][_0xd9e0('0x1b')]||null:null,'attributes':[[_0xd9e0('0x2b'),_0xd9e0('0x2c')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x2d')))),_0xd9e0('0x2e')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')]['literal'](_0xd9e0('0x2f')))),_0xd9e0('0x30')],[db['sequelize']['fn'](_0xd9e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x31')))),_0xd9e0('0x32')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xd9e0('0x1f')](_0xd9e0('0x33')))),_0xd9e0('0x34')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x35')))),_0xd9e0('0x36')],[db['sequelize']['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd9e0('0x37')],[db[_0xd9e0('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x38')))),_0xd9e0('0x39')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')]['literal'](_0xd9e0('0x3a')))),_0xd9e0('0x3b')],[db['sequelize']['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x3c')))),_0xd9e0('0x3d')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')](_0xd9e0('0x3e')))),'outboundOriginateFailureCallsDay'],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd9e0('0x1c')]['literal'](_0xd9e0('0x3f')))),_0xd9e0('0x40')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')][_0xd9e0('0x1f')]('`state`\x20=\x2016,\x201,\x20null'))),_0xd9e0('0x41')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db[_0xd9e0('0x1c')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0xd9e0('0x40')],[db['sequelize']['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xd9e0('0x42')))),_0xd9e0('0x43')]],'group':[_0xd9e0('0x2b')]})['then'](function(_0x328d1a){logger['info'](_0xd9e0('0x29'),_0x19ff63);logger[_0xd9e0('0xf')](_0xd9e0('0x29'),_0x19ff63,JSON['stringify'](_0x328d1a));_0x4574fb(_0x328d1a);})[_0xd9e0('0x15')](function(_0x57d39d){logger[_0xd9e0('0x12')](_0xd9e0('0x29'),_0x57d39d['message'],_0x19ff63);_0x5065f7(_0x40a542[_0xd9e0('0x12')](0x1f4,_0x57d39d[_0xd9e0('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x43c7ad){var _0x35247f=this;return new Promise(function(_0x5adc9e,_0x2cc168){return db[_0xd9e0('0x16')]['findAll']({'raw':_0x43c7ad[_0xd9e0('0x17')]?_0x43c7ad[_0xd9e0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x43c7ad[_0xd9e0('0x17')]?_0x43c7ad[_0xd9e0('0x17')][_0xd9e0('0x1b')]||null:null,'attributes':[[_0xd9e0('0x2b'),_0xd9e0('0x2c')],[db[_0xd9e0('0x1c')]['fn'](_0xd9e0('0x1d'),db[_0xd9e0('0x1c')][_0xd9e0('0x44')]('id')),_0xd9e0('0x45')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd9e0('0x1c')]['literal'](_0xd9e0('0x31')))),_0xd9e0('0x46')]],'group':[_0xd9e0('0x2b')]})[_0xd9e0('0xb')](function(_0x5376f9){logger[_0xd9e0('0xc')](_0xd9e0('0x47'),_0x43c7ad);logger[_0xd9e0('0xf')](_0xd9e0('0x47'),_0x43c7ad,JSON[_0xd9e0('0x11')](_0x5376f9));_0x5adc9e(_0x5376f9);})['catch'](function(_0x202f56){logger[_0xd9e0('0x12')]('GetCampaignHopperHistory',_0x202f56[_0xd9e0('0x14')],_0x43c7ad);_0x2cc168(_0x35247f[_0xd9e0('0x12')](0x1f4,_0x202f56[_0xd9e0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 59cb615..57eaa5c 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 _0x3dfd=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','exports','util','path','connect-timeout'];(function(_0x6a67c5,_0x46d5a7){var _0x1c158c=function(_0x1d4c4f){while(--_0x1d4c4f){_0x6a67c5['push'](_0x6a67c5['shift']());}};_0x1c158c(++_0x46d5a7);}(_0x3dfd,0xed));var _0xd3df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3dfd[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0xd3df('0x0'));var path=require(_0xd3df('0x1'));var timeout=require(_0xd3df('0x2'));var express=require(_0xd3df('0x3'));var router=express[_0xd3df('0x4')]();var fs_extra=require(_0xd3df('0x5'));var auth=require(_0xd3df('0x6'));var interaction=require(_0xd3df('0x7'));var config=require('../../config/environment');var controller=require(_0xd3df('0x8'));router[_0xd3df('0x9')]('/',auth[_0xd3df('0xa')](),controller[_0xd3df('0xb')]);router[_0xd3df('0x9')](_0xd3df('0xc'),auth['isAuthenticated'](),controller[_0xd3df('0xd')]);router[_0xd3df('0x9')](_0xd3df('0xe'),auth[_0xd3df('0xa')](),controller[_0xd3df('0xf')]);router['post']('/',auth[_0xd3df('0xa')](),controller[_0xd3df('0x10')]);router[_0xd3df('0x11')]('/:id',auth[_0xd3df('0xa')](),controller[_0xd3df('0x12')]);module[_0xd3df('0x13')]=router; \ No newline at end of file +var _0x858f=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','exports','multer','../../components/interaction/service','../../config/environment','get'];(function(_0x37184e,_0x432413){var _0xa78028=function(_0x1078d8){while(--_0x1078d8){_0x37184e['push'](_0x37184e['shift']());}};_0xa78028(++_0x432413);}(_0x858f,0x1e6));var _0xf858=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0x858f[_0x316c42];return _0x2b38f7;};'use strict';var multer=require(_0xf858('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf858('0x1'));var config=require(_0xf858('0x2'));var controller=require('./cmHopperHistory.controller');router[_0xf858('0x3')]('/',auth[_0xf858('0x4')](),controller[_0xf858('0x5')]);router[_0xf858('0x3')](_0xf858('0x6'),auth[_0xf858('0x4')](),controller[_0xf858('0x7')]);router[_0xf858('0x3')](_0xf858('0x8'),auth[_0xf858('0x4')](),controller['show']);router[_0xf858('0x9')]('/',auth[_0xf858('0x4')](),controller[_0xf858('0xa')]);router[_0xf858('0xb')](_0xf858('0x8'),auth[_0xf858('0x4')](),controller[_0xf858('0xc')]);module[_0xf858('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 8ac2fc9..20733d3 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 _0xe35c=['STRING','name','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe35c,0x146));var _0xce35=function(_0x152c3d,_0x1d3e32){_0x152c3d=_0x152c3d-0x0;var _0x2a02b4=_0xe35c[_0x152c3d];return _0x2a02b4;};'use strict';var Sequelize=require(_0xce35('0x0'));module[_0xce35('0x1')]={'name':{'type':Sequelize[_0xce35('0x2')],'unique':_0xce35('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xce35('0x2')]},'dialPrefix':{'type':Sequelize[_0xce35('0x2')]}}; \ No newline at end of file +var _0xeddd=['name','sequelize','exports','STRING'];(function(_0x495dc6,_0x35e571){var _0x2959e9=function(_0x1f6ebc){while(--_0x1f6ebc){_0x495dc6['push'](_0x495dc6['shift']());}};_0x2959e9(++_0x35e571);}(_0xeddd,0x69));var _0xdedd=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xeddd[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0xdedd('0x0'));module[_0xdedd('0x1')]={'name':{'type':Sequelize[_0xdedd('0x2')],'unique':_0xdedd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xdedd('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 9524c82..673ee83 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 _0x4bcf=['setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','download','sendStatus','addCustomField','sequelize','transaction','CmCustomField','addCustomFields','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','message','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','options','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','ListId','includeAll','removeDispositions','addContacts','CmContact','isArray','tags','join','each','ids','success','push','errors','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','customField_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv'];(function(_0x1dfce8,_0x5d1607){var _0x4c689a=function(_0x278955){while(--_0x278955){_0x1dfce8['push'](_0x1dfce8['shift']());}};_0x4c689a(++_0x5d1607);}(_0x4bcf,0xc0));var _0xf4bc=function(_0x5b5af1,_0x1db01b){_0x5b5af1=_0x5b5af1-0x0;var _0x45ab7b=_0x4bcf[_0x5b5af1];return _0x45ab7b;};'use strict';var emlformat=require(_0xf4bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4bc('0x2'));var moment=require(_0xf4bc('0x3'));var BPromise=require(_0xf4bc('0x4'));var Mustache=require(_0xf4bc('0x5'));var util=require('util');var path=require(_0xf4bc('0x6'));var sox=require('sox');var csv=require(_0xf4bc('0x7'));var ejs=require(_0xf4bc('0x8'));var fs=require('fs');var fs_extra=require(_0xf4bc('0x9'));var _=require(_0xf4bc('0xa'));var squel=require(_0xf4bc('0xb'));var crypto=require(_0xf4bc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf4bc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf4bc('0xe'));var Redis=require('ioredis');var authService=require(_0xf4bc('0xf'));var qs=require(_0xf4bc('0x10'));var as=require(_0xf4bc('0x11'));var hardwareService=require(_0xf4bc('0x12'));var logger=require(_0xf4bc('0x13'))(_0xf4bc('0x14'));var utils=require('../../config/utils');var config=require(_0xf4bc('0x15'));var licenseUtil=require(_0xf4bc('0x16'));var db=require(_0xf4bc('0x17'))['db'];var csv_results;config['redis']=_['defaults'](config[_0xf4bc('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf4bc('0x19'))(new Redis(config[_0xf4bc('0x18')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x4e99b9,_0x46859b){_0x46859b=_0x46859b||0xcc;return function(_0x4880e7){if(_0x4880e7){return _0x4e99b9['sendStatus'](_0x46859b);}return _0x4e99b9[_0xf4bc('0x1a')](_0x46859b)[_0xf4bc('0x1b')]();};}function respondWithResult(_0x1c7a24,_0x434d64){_0x434d64=_0x434d64||0xc8;return function(_0x9e0a24){if(_0x9e0a24){return _0x1c7a24[_0xf4bc('0x1a')](_0x434d64)[_0xf4bc('0x1c')](_0x9e0a24);}};}function respondWithFilteredResult(_0x4b0a98,_0x302fe6){return function(_0x1f30c2){if(_0x1f30c2){var _0x45da5a=typeof _0x302fe6[_0xf4bc('0x1d')]==='undefined'&&typeof _0x302fe6['limit']===_0xf4bc('0x1e');var _0x5de01f=_0x1f30c2[_0xf4bc('0x1f')];var _0x41f620=_0x45da5a?0x0:_0x302fe6[_0xf4bc('0x1d')];var _0x47c3d6=_0x45da5a?_0x1f30c2[_0xf4bc('0x1f')]:_0x302fe6[_0xf4bc('0x1d')]+_0x302fe6[_0xf4bc('0x20')];var _0x44304f;if(_0x47c3d6>=_0x5de01f){_0x47c3d6=_0x5de01f;_0x44304f=0xc8;}else{_0x44304f=0xce;}_0x4b0a98[_0xf4bc('0x1a')](_0x44304f);return _0x4b0a98[_0xf4bc('0x21')](_0xf4bc('0x22'),_0x41f620+'-'+_0x47c3d6+'/'+_0x5de01f)['json'](_0x1f30c2);}return null;};}function patchUpdates(_0x1c59f7){return function(_0x3ee75d){try{jsonpatch[_0xf4bc('0x23')](_0x3ee75d,_0x1c59f7,!![]);}catch(_0x203662){return BPromise[_0xf4bc('0x24')](_0x203662);}return _0x3ee75d[_0xf4bc('0x25')]();};}function saveUpdates(_0x178e2b,_0x16c9fd){return function(_0xabff60){if(_0xabff60){return _0xabff60['update'](_0x178e2b)[_0xf4bc('0x26')](function(_0x5c9280){return _0x5c9280;});}return null;};}function removeEntity(_0x53beb7,_0x399af3){return function(_0x2f02c9){if(_0x2f02c9){return _0x2f02c9[_0xf4bc('0x27')]()[_0xf4bc('0x26')](function(){var _0x584f9a=_0x2f02c9[_0xf4bc('0x28')]({'plain':!![]});var _0x42ce13=_0xf4bc('0x29');return db[_0xf4bc('0x2a')][_0xf4bc('0x27')]({'where':{'type':_0x42ce13,'resourceId':_0x584f9a['id']}})['then'](function(){return _0x2f02c9;});})[_0xf4bc('0x26')](function(){_0x53beb7[_0xf4bc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52541a,_0x5544bc){return function(_0x9ddb70){if(!_0x9ddb70){_0x52541a['sendStatus'](0x194);}return _0x9ddb70;};}function handleError(_0x211288,_0x1a401a){_0x1a401a=_0x1a401a||0x1f4;return function(_0x46c301){logger[_0xf4bc('0x2b')](_0x46c301[_0xf4bc('0x2c')]);if(_0x46c301[_0xf4bc('0x2d')]){delete _0x46c301[_0xf4bc('0x2d')];}_0x211288[_0xf4bc('0x1a')](_0x1a401a)[_0xf4bc('0x2e')](_0x46c301);};}exports[_0xf4bc('0x2f')]=function(_0x5c122,_0x4a1501){var _0x4a5905={},_0x18ba5d={},_0x29cd2f={'count':0x0,'rows':[]};var _0x4a5e9a=_[_0xf4bc('0x30')](db[_0xf4bc('0x31')][_0xf4bc('0x32')],function(_0x34b85d){return{'name':_0x34b85d[_0xf4bc('0x33')],'type':_0x34b85d[_0xf4bc('0x34')]['key']};});_0x18ba5d[_0xf4bc('0x35')]=_['map'](_0x4a5e9a,_0xf4bc('0x2d'));_0x18ba5d[_0xf4bc('0x36')]=_[_0xf4bc('0x37')](_0x5c122[_0xf4bc('0x36')]);_0x18ba5d[_0xf4bc('0x38')]=_[_0xf4bc('0x39')](_0x18ba5d[_0xf4bc('0x35')],_0x18ba5d[_0xf4bc('0x36')]);_0x4a5905[_0xf4bc('0x3a')]=_[_0xf4bc('0x39')](_0x18ba5d['model'],qs['fields'](_0x5c122[_0xf4bc('0x36')][_0xf4bc('0x3b')]));_0x4a5905[_0xf4bc('0x3a')]=_0x4a5905[_0xf4bc('0x3a')][_0xf4bc('0x3c')]?_0x4a5905[_0xf4bc('0x3a')]:_0x18ba5d['model'];if(!_0x5c122[_0xf4bc('0x36')][_0xf4bc('0x3d')](_0xf4bc('0x3e'))){_0x4a5905[_0xf4bc('0x20')]=qs[_0xf4bc('0x20')](_0x5c122[_0xf4bc('0x36')][_0xf4bc('0x20')]);_0x4a5905[_0xf4bc('0x1d')]=qs[_0xf4bc('0x1d')](_0x5c122[_0xf4bc('0x36')][_0xf4bc('0x1d')]);}_0x4a5905[_0xf4bc('0x3f')]=qs[_0xf4bc('0x40')](_0x5c122[_0xf4bc('0x36')]['sort']);_0x4a5905[_0xf4bc('0x41')]=qs[_0xf4bc('0x38')](_[_0xf4bc('0x42')](_0x5c122['query'],_0x18ba5d[_0xf4bc('0x38')]),_0x4a5e9a);if(_0x5c122[_0xf4bc('0x36')][_0xf4bc('0x43')]){_0x4a5905[_0xf4bc('0x41')]=_[_0xf4bc('0x44')](_0x4a5905[_0xf4bc('0x41')],{'$or':_[_0xf4bc('0x30')](_0x4a5e9a,function(_0x55078c){if(_0x55078c[_0xf4bc('0x34')]!==_0xf4bc('0x45')){var _0x5730e7={};_0x5730e7[_0x55078c[_0xf4bc('0x2d')]]={'$like':'%'+_0x5c122['query']['filter']+'%'};return _0x5730e7;}})});}_0x4a5905=_[_0xf4bc('0x44')]({},_0x4a5905,_0x5c122['options']);var _0x444bde={'where':_0x4a5905[_0xf4bc('0x41')]};return db[_0xf4bc('0x31')]['count'](_0x444bde)['then'](function(_0x526eda){_0x29cd2f[_0xf4bc('0x1f')]=_0x526eda;if(_0x5c122['query']['includeAll']){_0x4a5905[_0xf4bc('0x46')]=[{'all':!![]}];}return db[_0xf4bc('0x31')][_0xf4bc('0x47')](_0x4a5905);})[_0xf4bc('0x26')](function(_0x22650d){_0x29cd2f[_0xf4bc('0x48')]=_0x22650d;return _0x29cd2f;})[_0xf4bc('0x26')](respondWithFilteredResult(_0x4a1501,_0x4a5905))[_0xf4bc('0x49')](handleError(_0x4a1501,null));};exports['show']=function(_0x40a3a7,_0x419554){var _0x56eddb={'raw':![],'where':{'id':_0x40a3a7[_0xf4bc('0x4a')]['id']}},_0x1f7b85={};_0x1f7b85['model']=_[_0xf4bc('0x37')](db[_0xf4bc('0x31')]['rawAttributes']);_0x1f7b85[_0xf4bc('0x36')]=_[_0xf4bc('0x37')](_0x40a3a7[_0xf4bc('0x36')]);_0x1f7b85[_0xf4bc('0x38')]=_[_0xf4bc('0x39')](_0x1f7b85['model'],_0x1f7b85[_0xf4bc('0x36')]);_0x56eddb[_0xf4bc('0x3a')]=_['intersection'](_0x1f7b85[_0xf4bc('0x35')],qs[_0xf4bc('0x3b')](_0x40a3a7[_0xf4bc('0x36')][_0xf4bc('0x3b')]));_0x56eddb['attributes']=_0x56eddb[_0xf4bc('0x3a')][_0xf4bc('0x3c')]?_0x56eddb['attributes']:_0x1f7b85['model'];if(_0x40a3a7['query']['includeAll']){_0x56eddb[_0xf4bc('0x46')]=[{'all':!![]}];}_0x56eddb=_[_0xf4bc('0x44')]({},_0x56eddb,_0x40a3a7[_0xf4bc('0x4b')]);return db[_0xf4bc('0x31')][_0xf4bc('0x4c')](_0x56eddb)[_0xf4bc('0x26')](handleEntityNotFound(_0x419554,null))[_0xf4bc('0x26')](respondWithResult(_0x419554,null))['catch'](handleError(_0x419554,null));};exports[_0xf4bc('0x4d')]=function(_0x5b7b88,_0x3bc642){return db[_0xf4bc('0x31')][_0xf4bc('0x4d')](_0x5b7b88[_0xf4bc('0x4e')],{})[_0xf4bc('0x26')](function(_0x29bb93){var _0x55157a=_0x5b7b88[_0xf4bc('0x4f')][_0xf4bc('0x28')]({'plain':!![]});if(!_0x55157a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55157a[_0xf4bc('0x50')]===_0xf4bc('0x4f')){var _0x2c3f79=_0x29bb93['get']({'plain':!![]});var _0x4e663b='Lists';return db[_0xf4bc('0x51')][_0xf4bc('0x4c')]({'where':{'name':_0x4e663b,'userProfileId':_0x55157a[_0xf4bc('0x52')]},'raw':!![]})[_0xf4bc('0x26')](function(_0x2f889b){if(_0x2f889b&&_0x2f889b['autoAssociation']===0x0){return db['UserProfileResource'][_0xf4bc('0x4d')]({'name':_0x2c3f79['name'],'resourceId':_0x2c3f79['id'],'type':_0x2f889b[_0xf4bc('0x2d')],'sectionId':_0x2f889b['id']},{})[_0xf4bc('0x26')](function(){return _0x29bb93;});}else{return _0x29bb93;}})[_0xf4bc('0x49')](function(_0x5df09d){logger[_0xf4bc('0x2b')](_0xf4bc('0x53'),_0x5df09d);throw _0x5df09d;});}return _0x29bb93;})[_0xf4bc('0x26')](respondWithResult(_0x3bc642,0xc9))['catch'](handleError(_0x3bc642,null));};exports[_0xf4bc('0x54')]=function(_0x510244,_0x3208fd){if(_0x510244[_0xf4bc('0x4e')]['id']){delete _0x510244[_0xf4bc('0x4e')]['id'];}return db['CmList']['find']({'where':{'id':_0x510244[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x3208fd,null))[_0xf4bc('0x26')](saveUpdates(_0x510244[_0xf4bc('0x4e')],null))[_0xf4bc('0x26')](respondWithResult(_0x3208fd,null))[_0xf4bc('0x49')](handleError(_0x3208fd,null));};exports['destroy']=function(_0xe2bce3,_0x16a711){return db[_0xf4bc('0x31')][_0xf4bc('0x4c')]({'where':{'id':_0xe2bce3[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x16a711,null))[_0xf4bc('0x26')](removeEntity(_0x16a711,null))[_0xf4bc('0x49')](handleError(_0x16a711,null));};exports[_0xf4bc('0x55')]=function(_0x4f1aa0,_0x61eed4){return db[_0xf4bc('0x31')][_0xf4bc('0x55')]()[_0xf4bc('0x26')](respondWithResult(_0x61eed4,null))[_0xf4bc('0x49')](handleError(_0x61eed4,null));};exports[_0xf4bc('0x56')]=function(_0x74639b,_0x1b4864,_0x22f0fc){if(_0x74639b[_0xf4bc('0x4e')]['id']){delete _0x74639b[_0xf4bc('0x4e')]['id'];}return db[_0xf4bc('0x31')][_0xf4bc('0x4c')]({'where':{'id':_0x74639b[_0xf4bc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b4864,null))[_0xf4bc('0x26')](function(_0x1e0d46){if(_0x1e0d46){_0x74639b['body']['ListId']=_0x1e0d46['id'];return db[_0xf4bc('0x57')][_0xf4bc('0x4d')](_0x74639b[_0xf4bc('0x4e')]);}})[_0xf4bc('0x26')](respondWithResult(_0x1b4864,null))[_0xf4bc('0x49')](handleError(_0x1b4864,null));};exports[_0xf4bc('0x58')]=function(_0x354f2c,_0x2db757,_0x29a96b){var _0x2e5085={'raw':![],'where':{}};var _0x46c82e={};var _0x201c61={'count':0x0,'rows':[]};return db[_0xf4bc('0x31')][_0xf4bc('0x59')]({'where':{'id':_0x354f2c[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x2db757,null))['then'](function(_0x26863d){if(_0x26863d){_0x46c82e[_0xf4bc('0x35')]=_[_0xf4bc('0x37')](db['Disposition'][_0xf4bc('0x32')]);_0x46c82e[_0xf4bc('0x36')]=_[_0xf4bc('0x37')](_0x354f2c[_0xf4bc('0x36')]);_0x46c82e[_0xf4bc('0x38')]=_[_0xf4bc('0x39')](_0x46c82e['model'],_0x46c82e[_0xf4bc('0x36')]);_0x2e5085['attributes']=_[_0xf4bc('0x39')](_0x46c82e['model'],qs['fields'](_0x354f2c[_0xf4bc('0x36')]['fields']));_0x2e5085[_0xf4bc('0x3a')]=_0x2e5085['attributes'][_0xf4bc('0x3c')]?_0x2e5085[_0xf4bc('0x3a')]:_0x46c82e[_0xf4bc('0x35')];if(!_0x354f2c[_0xf4bc('0x36')]['hasOwnProperty']('nolimit')){_0x2e5085[_0xf4bc('0x20')]=qs['limit'](_0x354f2c[_0xf4bc('0x36')][_0xf4bc('0x20')]);_0x2e5085[_0xf4bc('0x1d')]=qs['offset'](_0x354f2c[_0xf4bc('0x36')][_0xf4bc('0x1d')]);}_0x2e5085[_0xf4bc('0x3f')]=qs[_0xf4bc('0x40')](_0x354f2c[_0xf4bc('0x36')][_0xf4bc('0x40')]);_0x2e5085[_0xf4bc('0x41')]=qs[_0xf4bc('0x38')](_[_0xf4bc('0x42')](_0x354f2c['query'],_0x46c82e['filters']));_0x2e5085[_0xf4bc('0x41')][_0xf4bc('0x5a')]=_0x26863d['id'];if(_0x354f2c[_0xf4bc('0x36')][_0xf4bc('0x43')]){_0x2e5085[_0xf4bc('0x41')]=_[_0xf4bc('0x44')](_0x2e5085[_0xf4bc('0x41')],{'$or':_[_0xf4bc('0x30')](_0x2e5085[_0xf4bc('0x3a')],function(_0x5d21e7){var _0x3fad27={};_0x3fad27[_0x5d21e7]={'$like':'%'+_0x354f2c[_0xf4bc('0x36')][_0xf4bc('0x43')]+'%'};return _0x3fad27;})});}_0x2e5085=_[_0xf4bc('0x44')]({},_0x2e5085,_0x354f2c[_0xf4bc('0x4b')]);return db[_0xf4bc('0x57')][_0xf4bc('0x1f')]({'where':_0x2e5085[_0xf4bc('0x41')]})['then'](function(_0x2cf0ff){_0x201c61['count']=_0x2cf0ff;if(_0x354f2c['query'][_0xf4bc('0x5b')]){_0x2e5085[_0xf4bc('0x46')]=[{'all':!![]}];}return db[_0xf4bc('0x57')][_0xf4bc('0x47')](_0x2e5085);})['then'](function(_0x4bb261){_0x201c61[_0xf4bc('0x48')]=_0x4bb261;return _0x201c61;});}})['then'](respondWithFilteredResult(_0x2db757,_0x2e5085))['catch'](handleError(_0x2db757,null));};exports[_0xf4bc('0x5c')]=function(_0x2c5abd,_0x38784d,_0x11e7e0){return db[_0xf4bc('0x31')]['find']({'where':{'id':_0x2c5abd[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x38784d,null))[_0xf4bc('0x26')](function(_0x412459){if(_0x412459){return _0x412459[_0xf4bc('0x5c')](_0x2c5abd[_0xf4bc('0x36')]['ids']);}})[_0xf4bc('0x26')](respondWithStatusCode(_0x38784d,null))[_0xf4bc('0x49')](handleError(_0x38784d,null));};exports[_0xf4bc('0x5d')]=function(_0xa14394,_0x30f664,_0x1545d4){return db[_0xf4bc('0x31')][_0xf4bc('0x4c')]({'where':{'id':_0xa14394[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x30f664,null))[_0xf4bc('0x26')](function(_0x441ac6){if(_0x441ac6){var _0x10f0bc=[];var _0x350798={'success':[],'errors':[]};return db[_0xf4bc('0x5e')][_0xf4bc('0x55')]()[_0xf4bc('0x26')](function(_0x45cfa8){if(_0xa14394[_0xf4bc('0x4e')]['tags']&&_[_0xf4bc('0x5f')](_0xa14394[_0xf4bc('0x4e')][_0xf4bc('0x60')])){if(_0xa14394[_0xf4bc('0x4e')]['tags']['length']){_0xa14394[_0xf4bc('0x4e')][_0xf4bc('0x60')]=_0xa14394[_0xf4bc('0x4e')][_0xf4bc('0x60')][_0xf4bc('0x61')](';')+';';}else{_0xa14394[_0xf4bc('0x4e')][_0xf4bc('0x60')]=null;}}else{_0xa14394[_0xf4bc('0x4e')][_0xf4bc('0x60')]=null;}if(_0xa14394[_0xf4bc('0x4e')]&&_[_0xf4bc('0x5f')](_0xa14394[_0xf4bc('0x4e')])){for(var _0x4bcda4=0x0;_0x4bcda4<_0xa14394['body'][_0xf4bc('0x3c')];_0x4bcda4+=0x1){_0xa14394[_0xf4bc('0x4e')][_0x4bcda4][_0xf4bc('0x5a')]=_0xa14394[_0xf4bc('0x4a')]['id'];_0x10f0bc['push'](_0xa14394[_0xf4bc('0x4e')][_0x4bcda4]);}return BPromise[_0xf4bc('0x62')](_0x10f0bc,function(_0x33a9ba){return db['CmContact'][_0xf4bc('0x4d')](_['omit'](_0x33a9ba,[_0xf4bc('0x63'),'id'])||{},{'fields':_['keys'](_0x45cfa8),'raw':!![]})[_0xf4bc('0x26')](function(_0x848c6b){_0x350798[_0xf4bc('0x64')][_0xf4bc('0x65')](_0x848c6b['dataValues']);})[_0xf4bc('0x49')](function(_0x2d8291){_0x350798[_0xf4bc('0x66')][_0xf4bc('0x65')]({'data':_0x33a9ba,'error':_0x2d8291['message']});});})[_0xf4bc('0x26')](function(_0x332794){return _0x350798;})[_0xf4bc('0x49')](function(_0x57555c){return _0x57555c;});}else{_0x30f664[_0xf4bc('0x1a')](0x190)[_0xf4bc('0x1c')]({'message':_0xf4bc('0x67')});}});}})[_0xf4bc('0x26')](respondWithResult(_0x30f664,null))[_0xf4bc('0x49')](handleError(_0x30f664,null));};exports[_0xf4bc('0x68')]=function(_0x58a70f,_0xb209b,_0x3eb86c){var _0x4db6ac;return db[_0xf4bc('0x31')]['find']({'where':{'id':_0x58a70f['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xf4bc('0x69')}]})[_0xf4bc('0x26')](handleEntityNotFound(_0xb209b,null))[_0xf4bc('0x26')](function(_0x4a6fbe){if(_0x4a6fbe){_0x4db6ac=_0x4a6fbe;return db[_0xf4bc('0x5e')][_0xf4bc('0x32')];}})['then'](function(_0x44b05f){if(_0x44b05f){var _0x271da9={};var _0x4789fa={};_0x4789fa['model']=_[_0xf4bc('0x6a')](_[_0xf4bc('0x37')](_0x44b05f),_[_0xf4bc('0x30')](_0x4db6ac[_0xf4bc('0x69')],function(_0x56ae6d){return util[_0xf4bc('0x6b')]('cf_%d',_0x56ae6d['id']);}));_0x4789fa[_0xf4bc('0x36')]=_[_0xf4bc('0x37')](_0x58a70f['query']);_0x4789fa[_0xf4bc('0x38')]=_['intersection'](_0x4789fa[_0xf4bc('0x35')],_0x4789fa[_0xf4bc('0x36')]);_0x271da9[_0xf4bc('0x3a')]=_[_0xf4bc('0x39')](_0x4789fa[_0xf4bc('0x35')],qs[_0xf4bc('0x3b')](_0x58a70f['query'][_0xf4bc('0x3b')]));_0x271da9['attributes']=_0x271da9[_0xf4bc('0x3a')][_0xf4bc('0x3c')]?_0x271da9['attributes']:_0x4789fa['model'];if(!_0x58a70f[_0xf4bc('0x36')][_0xf4bc('0x3d')]('nolimit')){_0x271da9[_0xf4bc('0x20')]=qs[_0xf4bc('0x20')](_0x58a70f[_0xf4bc('0x36')][_0xf4bc('0x20')]);_0x271da9[_0xf4bc('0x1d')]=qs[_0xf4bc('0x1d')](_0x58a70f['query'][_0xf4bc('0x1d')]);}_0x271da9[_0xf4bc('0x3f')]=qs['sort'](_0x58a70f[_0xf4bc('0x36')][_0xf4bc('0x40')]);_0x271da9[_0xf4bc('0x41')]=qs['filters'](_[_0xf4bc('0x42')](_0x58a70f[_0xf4bc('0x36')],_0x4789fa[_0xf4bc('0x38')]));_0x271da9['raw']=!![];if(_0x58a70f[_0xf4bc('0x36')][_0xf4bc('0x43')]){_0x271da9['where']=_[_0xf4bc('0x44')](_0x271da9[_0xf4bc('0x41')],{'$or':_[_0xf4bc('0x30')](_0x271da9['attributes'],function(_0x539bf8){var _0x1e4513={};_0x1e4513[_0x539bf8]={'$like':'%'+_0x58a70f[_0xf4bc('0x36')][_0xf4bc('0x43')]+'%'};return _0x1e4513;})});}_0x271da9=_[_0xf4bc('0x44')]({},_0x271da9,_0x58a70f['options']);return _0x4db6ac[_0xf4bc('0x68')](_0x271da9);}})[_0xf4bc('0x26')](respondWithResult(_0xb209b,null))[_0xf4bc('0x49')](handleError(_0xb209b,null));};exports['getContactsCsv']=function(_0x2a7f37,_0x39d613,_0x344d58){var _0xd0846c;var _0x4c278a;var _0x48e8db;var _0x306dab=_0x2a7f37[_0xf4bc('0x4a')]['id'];csv_results=[];return db[_0xf4bc('0x6c')]['findAll']({'attributes':['id','name'],'raw':!![],'order':[_0xf4bc('0x6d')]})[_0xf4bc('0x26')](function(_0x486703){_0xd0846c=_0x486703;var _0x17046e=_[_0xf4bc('0x37')](db[_0xf4bc('0x5e')][_0xf4bc('0x32')]);return db['CmCustomField'][_0xf4bc('0x47')]({'raw':!![],'attributes':['id',_0xf4bc('0x6e')]})[_0xf4bc('0x26')](function(_0x2a23e0){_0x4c278a=_0x2a23e0;var _0x530ef9=squel[_0xf4bc('0x6f')]()[_0xf4bc('0x3b')](_0x17046e)[_0xf4bc('0x70')](_0xf4bc('0x71'),'c')[_0xf4bc('0x41')](_0xf4bc('0x72'),_0x306dab)[_0xf4bc('0x41')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x18494b=0x0;_0x18494b<_0x4c278a[_0xf4bc('0x3c')];_0x18494b++){_0x530ef9[_0xf4bc('0x73')](_0xf4bc('0x74')+_0x4c278a[_0x18494b]['id'],_0xf4bc('0x75')+_0x4c278a[_0x18494b]['alias']);}for(var _0x18494b=0x0;_0x18494b<_0xd0846c[_0xf4bc('0x3c')];_0x18494b++){_0x530ef9['field'](squel[_0xf4bc('0x6f')]()[_0xf4bc('0x73')](_0xf4bc('0x76'))['from'](_0xf4bc('0x77'))[_0xf4bc('0x41')]('ItemTypeId\x20=\x20?',_0xd0846c[_0x18494b]['id'])[_0xf4bc('0x41')](_0xf4bc('0x78')),_0xf4bc('0x79')+_0xd0846c[_0x18494b]['name']);_0x530ef9['field'](squel[_0xf4bc('0x6f')]()[_0xf4bc('0x73')](_0xf4bc('0x7a'))['from'](_0xf4bc('0x77'))[_0xf4bc('0x41')]('ItemTypeId\x20=\x20?',_0xd0846c[_0x18494b]['id'])[_0xf4bc('0x41')](_0xf4bc('0x78')),_0xf4bc('0x7b')+_0xd0846c[_0x18494b][_0xf4bc('0x2d')]);}var _0x57546f=[];_0x57546f[_0xf4bc('0x65')](_0x530ef9[_0xf4bc('0x7c')]());BPromise[_0xf4bc('0x62')](_0x57546f,handleQuery)[_0xf4bc('0x26')](function(_0x5f46b2){handleQuery(_0x530ef9[_0xf4bc('0x7c')]());var _0x8fe574=csv_results[0x0];if(!_['isEmpty'](_0x8fe574)){var _0x41d04b=toCsv(_0x8fe574);var _0x54950a=Date[_0xf4bc('0x7d')]();fs[_0xf4bc('0x7e')](util[_0xf4bc('0x6b')](_0xf4bc('0x7f'),_0x306dab,_0x54950a),_0x41d04b);_0x39d613[_0xf4bc('0x80')](_0xf4bc('0x81'),_0xf4bc('0x82')+util[_0xf4bc('0x6b')](_0xf4bc('0x83'),_0x306dab,_0x54950a));_0x39d613[_0xf4bc('0x80')]('Content-type','text/csv');return _0x39d613[_0xf4bc('0x84')](util['format'](_0xf4bc('0x7f'),_0x306dab,_0x54950a));}else{return _0x39d613[_0xf4bc('0x85')](0xcc);}});});});};exports[_0xf4bc('0x86')]=function(_0x2ba462,_0x1df536,_0x51dd64){var _0x2f9d07;delete _0x2ba462[_0xf4bc('0x4e')]['id'];return db['CmList']['findOne']({'where':{'id':_0x2ba462[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x1df536,null))[_0xf4bc('0x26')](function(_0x26d546){if(_0x26d546){return db[_0xf4bc('0x87')][_0xf4bc('0x88')](function(_0x163a2a){return db[_0xf4bc('0x89')][_0xf4bc('0x4d')](_0x2ba462[_0xf4bc('0x4e')],{'transaction':_0x163a2a})[_0xf4bc('0x26')](function(_0xdbe448){_0x2f9d07=_0xdbe448;return _0x26d546[_0xf4bc('0x8a')](_0xdbe448,{'transaction':_0x163a2a});})['then'](function(){var _0x5d88ea={'type':db[_0xf4bc('0x8b')]['TEXT'],'transaction':_0x163a2a};switch(_0x2ba462[_0xf4bc('0x4e')][_0xf4bc('0x34')]){case _0xf4bc('0x8c'):_0x5d88ea['type']=db['Sequelize'][_0xf4bc('0x8d')];break;case'number':_0x5d88ea[_0xf4bc('0x34')]=db['Sequelize'][_0xf4bc('0x8e')];break;case _0xf4bc('0x8f'):_0x5d88ea[_0xf4bc('0x34')]=db[_0xf4bc('0x8b')][_0xf4bc('0x90')];_0x5d88ea['defaultValue']=![];break;default:}return db['sequelize'][_0xf4bc('0x91')][_0xf4bc('0x92')](_0xf4bc('0x71'),util['format'](_0xf4bc('0x93'),_0x2f9d07['id']),_0x5d88ea);})[_0xf4bc('0x26')](function(){return _0x2f9d07;});});}})[_0xf4bc('0x26')](respondWithResult(_0x1df536,null))[_0xf4bc('0x49')](handleError(_0x1df536,null));};exports[_0xf4bc('0x94')]=function(_0x90262c,_0x3b86cf,_0x2a6d39){var _0x1613e4={};var _0x268416={};var _0x4edb73;var _0x1c9dc4;return db[_0xf4bc('0x31')][_0xf4bc('0x59')]({'where':{'id':_0x90262c[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x3b86cf,null))['then'](function(_0x2f68e7){if(_0x2f68e7){_0x4edb73=_0x2f68e7;_0x268416[_0xf4bc('0x35')]=_[_0xf4bc('0x37')](db[_0xf4bc('0x89')]['rawAttributes']);_0x268416[_0xf4bc('0x36')]=_['keys'](_0x90262c[_0xf4bc('0x36')]);_0x268416[_0xf4bc('0x38')]=_[_0xf4bc('0x39')](_0x268416['model'],_0x268416['query']);_0x1613e4['attributes']=_[_0xf4bc('0x39')](_0x268416[_0xf4bc('0x35')],qs[_0xf4bc('0x3b')](_0x90262c[_0xf4bc('0x36')]['fields']));_0x1613e4[_0xf4bc('0x3a')]=_0x1613e4[_0xf4bc('0x3a')][_0xf4bc('0x3c')]?_0x1613e4[_0xf4bc('0x3a')]:_0x268416[_0xf4bc('0x35')];_0x1613e4[_0xf4bc('0x3f')]=qs[_0xf4bc('0x40')](_0x90262c[_0xf4bc('0x36')]['sort']);_0x1613e4[_0xf4bc('0x41')]=qs[_0xf4bc('0x38')](_[_0xf4bc('0x42')](_0x90262c[_0xf4bc('0x36')],_0x268416[_0xf4bc('0x38')]));_0x1613e4[_0xf4bc('0x41')]=_[_0xf4bc('0x44')](_0x1613e4[_0xf4bc('0x41')],{'$or':[{'ListId':_0x2f68e7['id']},{'ListId':null}]});if(_0x90262c[_0xf4bc('0x36')][_0xf4bc('0x43')]){_0x1613e4[_0xf4bc('0x41')]=_[_0xf4bc('0x44')](_0x1613e4[_0xf4bc('0x41')],{'$or':_[_0xf4bc('0x30')](_0x1613e4[_0xf4bc('0x3a')],function(_0x591e45){var _0x2cd498={};_0x2cd498[_0x591e45]={'$like':'%'+_0x90262c[_0xf4bc('0x36')][_0xf4bc('0x43')]+'%'};return _0x2cd498;})});}_0x1613e4=_['merge']({},_0x1613e4,_0x90262c[_0xf4bc('0x4b')]);return db[_0xf4bc('0x89')]['findAndCountAll'](_0x1613e4);}})['then'](respondWithResult(_0x3b86cf,null))[_0xf4bc('0x49')](handleError(_0x3b86cf,null));};exports[_0xf4bc('0x95')]=function(_0x2b3873,_0x2de904){return db[_0xf4bc('0x89')][_0xf4bc('0x96')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x2de904,null))['then'](function(_0x45fde6){return _0x45fde6;})[_0xf4bc('0x26')](respondWithResult(_0x2de904,null))['catch'](handleError(_0x2de904,null));};exports[_0xf4bc('0x97')]=function(_0x31d75a,_0x113953,_0xbefc44){return db['CmList']['find']({'where':{'id':_0x31d75a[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x113953,null))['then'](function(_0x3b6c0e){if(_0x3b6c0e){return _0x3b6c0e[_0xf4bc('0x97')](_0x31d75a[_0xf4bc('0x4e')]['ids'],_[_0xf4bc('0x98')](_0x31d75a[_0xf4bc('0x4e')],[_0xf4bc('0x63'),'id'])||{})[_0xf4bc('0x99')](function(_0x29aaa1){for(var _0x419a87=0x0;_0x419a87<_0x31d75a[_0xf4bc('0x4e')]['ids'][_0xf4bc('0x3c')];_0x419a87+=0x1){socket[_0xf4bc('0x9a')](_0xf4bc('0x9b'),{'UserId':Number(_0x31d75a[_0xf4bc('0x4e')][_0xf4bc('0x63')][_0x419a87]),'CmListId':Number(_0x31d75a[_0xf4bc('0x4a')]['id'])});}return _0x29aaa1;});}})['then'](respondWithResult(_0x113953,null))['catch'](handleError(_0x113953,null));};exports[_0xf4bc('0x9c')]=function(_0x330d51,_0x4899cf,_0xb4540){return db[_0xf4bc('0x31')]['find']({'where':{'id':_0x330d51[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x4899cf,null))['then'](function(_0x14dbad){if(_0x14dbad){return _0x14dbad[_0xf4bc('0x9c')](_0x330d51['query'][_0xf4bc('0x63')])[_0xf4bc('0x26')](function(){if(_[_0xf4bc('0x5f')](_0x330d51[_0xf4bc('0x36')]['ids'])){for(var _0x1dd75=0x0;_0x1dd75<_0x330d51['query'][_0xf4bc('0x63')][_0xf4bc('0x3c')];_0x1dd75+=0x1){socket[_0xf4bc('0x9a')](_0xf4bc('0x9d'),{'UserId':Number(_0x330d51[_0xf4bc('0x36')][_0xf4bc('0x63')][_0x1dd75]),'CmListId':Number(_0x330d51[_0xf4bc('0x4a')]['id'])});}}else{socket[_0xf4bc('0x9a')]('userCmList:remove',{'UserId':Number(_0x330d51[_0xf4bc('0x36')][_0xf4bc('0x63')]),'CmListId':Number(_0x330d51['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4899cf,null))[_0xf4bc('0x49')](handleError(_0x4899cf,null));};exports['getAgents']=function(_0x5d9248,_0x2aa3e0,_0x232349){var _0x44a2ae={};var _0x311ccb={};var _0x368f9a;var _0x261370;return db[_0xf4bc('0x31')]['findOne']({'where':{'id':_0x5d9248[_0xf4bc('0x4a')]['id']}})[_0xf4bc('0x26')](handleEntityNotFound(_0x2aa3e0,null))[_0xf4bc('0x26')](function(_0x44056e){if(_0x44056e){_0x368f9a=_0x44056e;_0x311ccb[_0xf4bc('0x35')]=_[_0xf4bc('0x37')](db['User'][_0xf4bc('0x32')]);_0x311ccb[_0xf4bc('0x36')]=_['keys'](_0x5d9248[_0xf4bc('0x36')]);_0x311ccb[_0xf4bc('0x38')]=_[_0xf4bc('0x39')](_0x311ccb[_0xf4bc('0x35')],_0x311ccb[_0xf4bc('0x36')]);_0x44a2ae[_0xf4bc('0x3a')]=_['intersection'](_0x311ccb[_0xf4bc('0x35')],qs[_0xf4bc('0x3b')](_0x5d9248[_0xf4bc('0x36')][_0xf4bc('0x3b')]));_0x44a2ae[_0xf4bc('0x3a')]=_0x44a2ae[_0xf4bc('0x3a')][_0xf4bc('0x3c')]?_0x44a2ae['attributes']:_0x311ccb['model'];_0x44a2ae['order']=qs[_0xf4bc('0x40')](_0x5d9248[_0xf4bc('0x36')]['sort']);_0x44a2ae[_0xf4bc('0x41')]=qs['filters'](_[_0xf4bc('0x42')](_0x5d9248[_0xf4bc('0x36')],_0x311ccb[_0xf4bc('0x38')]));if(_0x5d9248[_0xf4bc('0x36')][_0xf4bc('0x43')]){_0x44a2ae[_0xf4bc('0x41')]=_[_0xf4bc('0x44')](_0x44a2ae[_0xf4bc('0x41')],{'$or':_[_0xf4bc('0x30')](_0x44a2ae[_0xf4bc('0x3a')],function(_0x2b84a){var _0x4fea22={};_0x4fea22[_0x2b84a]={'$like':'%'+_0x5d9248[_0xf4bc('0x36')][_0xf4bc('0x43')]+'%'};return _0x4fea22;})});}_0x44a2ae=_[_0xf4bc('0x44')]({},_0x44a2ae,_0x5d9248[_0xf4bc('0x4b')]);return _0x368f9a[_0xf4bc('0x9e')](_0x44a2ae);}})[_0xf4bc('0x26')](function(_0x2640e9){if(_0x2640e9){_0x261370=_0x2640e9['length'];if(!_0x5d9248['query']['hasOwnProperty']('nolimit')){_0x44a2ae[_0xf4bc('0x20')]=qs[_0xf4bc('0x20')](_0x5d9248[_0xf4bc('0x36')][_0xf4bc('0x20')]);_0x44a2ae[_0xf4bc('0x1d')]=qs[_0xf4bc('0x1d')](_0x5d9248['query']['offset']);}return _0x368f9a[_0xf4bc('0x9e')](_0x44a2ae);}})[_0xf4bc('0x26')](function(_0x4fa1bd){if(_0x4fa1bd){return _0x4fa1bd?{'count':_0x261370,'rows':_0x4fa1bd}:null;}})[_0xf4bc('0x26')](respondWithResult(_0x2aa3e0,null))[_0xf4bc('0x49')](handleError(_0x2aa3e0,null));};function handleQuery(_0x1323b2){logger['info'](_0x1323b2);return db[_0xf4bc('0x87')]['query'](_0x1323b2)[_0xf4bc('0x99')](function(_0x1576f2){csv_results[_0xf4bc('0x65')](_0x1576f2);})['catch'](function(_0xe0c4e9){logger[_0xf4bc('0x2b')](_0xe0c4e9[_0xf4bc('0x9f')]);});} \ No newline at end of file +var _0x20b6=['format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','spread','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','get','end','error','stack','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmList','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ListId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','cf_%d','raw','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','now','writeFileSync'];(function(_0x12f4af,_0x4a2bb9){var _0x4c4d50=function(_0x25a7f7){while(--_0x25a7f7){_0x12f4af['push'](_0x12f4af['shift']());}};_0x4c4d50(++_0x4a2bb9);}(_0x20b6,0x17a));var _0x620b=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x20b6[_0x20118a];return _0x538b5f;};'use strict';var emlformat=require(_0x620b('0x0'));var rimraf=require(_0x620b('0x1'));var zipdir=require(_0x620b('0x2'));var jsonpatch=require(_0x620b('0x3'));var rp=require(_0x620b('0x4'));var moment=require(_0x620b('0x5'));var BPromise=require(_0x620b('0x6'));var Mustache=require(_0x620b('0x7'));var util=require(_0x620b('0x8'));var path=require(_0x620b('0x9'));var sox=require(_0x620b('0xa'));var csv=require(_0x620b('0xb'));var ejs=require(_0x620b('0xc'));var fs=require('fs');var fs_extra=require(_0x620b('0xd'));var _=require(_0x620b('0xe'));var squel=require('squel');var crypto=require(_0x620b('0xf'));var jsforce=require(_0x620b('0x10'));var deskjs=require(_0x620b('0x11'));var toCsv=require(_0x620b('0xb'));var querystring=require(_0x620b('0x12'));var Papa=require(_0x620b('0x13'));var Redis=require(_0x620b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x620b('0x15'));var as=require(_0x620b('0x16'));var hardwareService=require(_0x620b('0x17'));var logger=require(_0x620b('0x18'))(_0x620b('0x19'));var utils=require(_0x620b('0x1a'));var config=require(_0x620b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x620b('0x1c'))['db'];var csv_results;config[_0x620b('0x1d')]=_[_0x620b('0x1e')](config[_0x620b('0x1d')],{'host':_0x620b('0x1f'),'port':0x18eb});var socket=require(_0x620b('0x20'))(new Redis(config[_0x620b('0x1d')]));require(_0x620b('0x21'))[_0x620b('0x22')](socket);function respondWithStatusCode(_0x32195a,_0x36f310){_0x36f310=_0x36f310||0xcc;return function(_0x12c46a){if(_0x12c46a){return _0x32195a[_0x620b('0x23')](_0x36f310);}return _0x32195a[_0x620b('0x24')](_0x36f310)['end']();};}function respondWithResult(_0x1a1f3c,_0x8e7679){_0x8e7679=_0x8e7679||0xc8;return function(_0x4c27f3){if(_0x4c27f3){return _0x1a1f3c[_0x620b('0x24')](_0x8e7679)['json'](_0x4c27f3);}};}function respondWithFilteredResult(_0x23ac2f,_0x15d351){return function(_0x36a4a2){if(_0x36a4a2){var _0x42ea3d=typeof _0x15d351[_0x620b('0x25')]===_0x620b('0x26')&&typeof _0x15d351[_0x620b('0x27')]===_0x620b('0x26');var _0x45f6d2=_0x36a4a2[_0x620b('0x28')];var _0x5817ea=_0x42ea3d?0x0:_0x15d351['offset'];var _0x426dcb=_0x42ea3d?_0x36a4a2[_0x620b('0x28')]:_0x15d351[_0x620b('0x25')]+_0x15d351[_0x620b('0x27')];var _0x19cdf2;if(_0x426dcb>=_0x45f6d2){_0x426dcb=_0x45f6d2;_0x19cdf2=0xc8;}else{_0x19cdf2=0xce;}_0x23ac2f[_0x620b('0x24')](_0x19cdf2);return _0x23ac2f[_0x620b('0x29')](_0x620b('0x2a'),_0x5817ea+'-'+_0x426dcb+'/'+_0x45f6d2)[_0x620b('0x2b')](_0x36a4a2);}return null;};}function patchUpdates(_0x3e3bbe){return function(_0x202aa0){try{jsonpatch['apply'](_0x202aa0,_0x3e3bbe,!![]);}catch(_0x5a469e){return BPromise[_0x620b('0x2c')](_0x5a469e);}return _0x202aa0[_0x620b('0x2d')]();};}function saveUpdates(_0x133eee,_0x4631a1){return function(_0x71dae3){if(_0x71dae3){return _0x71dae3['update'](_0x133eee)[_0x620b('0x2e')](function(_0x533c96){return _0x533c96;});}return null;};}function removeEntity(_0x3a29ce,_0x26c8ff){return function(_0x577aea){if(_0x577aea){return _0x577aea[_0x620b('0x2f')]()[_0x620b('0x2e')](function(){var _0x7f0857=_0x577aea[_0x620b('0x30')]({'plain':!![]});var _0x5f1c87='Lists';return db['UserProfileResource'][_0x620b('0x2f')]({'where':{'type':_0x5f1c87,'resourceId':_0x7f0857['id']}})[_0x620b('0x2e')](function(){return _0x577aea;});})['then'](function(){_0x3a29ce[_0x620b('0x24')](0xcc)[_0x620b('0x31')]();});}};}function handleEntityNotFound(_0x1df440,_0x40050f){return function(_0x4cd1db){if(!_0x4cd1db){_0x1df440['sendStatus'](0x194);}return _0x4cd1db;};}function handleError(_0xecd22a,_0x261ddd){_0x261ddd=_0x261ddd||0x1f4;return function(_0x20fd54){logger[_0x620b('0x32')](_0x20fd54[_0x620b('0x33')]);if(_0x20fd54['name']){delete _0x20fd54['name'];}_0xecd22a[_0x620b('0x24')](_0x261ddd)['send'](_0x20fd54);};}exports['index']=function(_0x5bdd8b,_0xa7e1a5){var _0x6bdc64={},_0x4ce5fb={},_0x4d0822={'count':0x0,'rows':[]};var _0x4d8e59=_[_0x620b('0x34')](db['CmList'][_0x620b('0x35')],function(_0x3fa94e){return{'name':_0x3fa94e[_0x620b('0x36')],'type':_0x3fa94e[_0x620b('0x37')][_0x620b('0x38')]};});_0x4ce5fb[_0x620b('0x39')]=_[_0x620b('0x34')](_0x4d8e59,_0x620b('0x3a'));_0x4ce5fb['query']=_[_0x620b('0x3b')](_0x5bdd8b[_0x620b('0x3c')]);_0x4ce5fb[_0x620b('0x3d')]=_[_0x620b('0x3e')](_0x4ce5fb['model'],_0x4ce5fb[_0x620b('0x3c')]);_0x6bdc64[_0x620b('0x3f')]=_[_0x620b('0x3e')](_0x4ce5fb[_0x620b('0x39')],qs['fields'](_0x5bdd8b['query'][_0x620b('0x40')]));_0x6bdc64[_0x620b('0x3f')]=_0x6bdc64[_0x620b('0x3f')]['length']?_0x6bdc64['attributes']:_0x4ce5fb[_0x620b('0x39')];if(!_0x5bdd8b[_0x620b('0x3c')][_0x620b('0x41')](_0x620b('0x42'))){_0x6bdc64[_0x620b('0x27')]=qs['limit'](_0x5bdd8b[_0x620b('0x3c')]['limit']);_0x6bdc64[_0x620b('0x25')]=qs[_0x620b('0x25')](_0x5bdd8b[_0x620b('0x3c')][_0x620b('0x25')]);}_0x6bdc64[_0x620b('0x43')]=qs[_0x620b('0x44')](_0x5bdd8b[_0x620b('0x3c')][_0x620b('0x44')]);_0x6bdc64[_0x620b('0x45')]=qs[_0x620b('0x3d')](_[_0x620b('0x46')](_0x5bdd8b[_0x620b('0x3c')],_0x4ce5fb['filters']),_0x4d8e59);if(_0x5bdd8b[_0x620b('0x3c')][_0x620b('0x47')]){_0x6bdc64[_0x620b('0x45')]=_[_0x620b('0x48')](_0x6bdc64[_0x620b('0x45')],{'$or':_[_0x620b('0x34')](_0x4d8e59,function(_0x4317ad){if(_0x4317ad[_0x620b('0x37')]!==_0x620b('0x49')){var _0x400420={};_0x400420[_0x4317ad[_0x620b('0x3a')]]={'$like':'%'+_0x5bdd8b[_0x620b('0x3c')][_0x620b('0x47')]+'%'};return _0x400420;}})});}_0x6bdc64=_[_0x620b('0x48')]({},_0x6bdc64,_0x5bdd8b[_0x620b('0x4a')]);var _0x218f72={'where':_0x6bdc64[_0x620b('0x45')]};return db[_0x620b('0x4b')][_0x620b('0x28')](_0x218f72)['then'](function(_0x37cffb){_0x4d0822['count']=_0x37cffb;if(_0x5bdd8b[_0x620b('0x3c')][_0x620b('0x4c')]){_0x6bdc64[_0x620b('0x4d')]=[{'all':!![]}];}return db['CmList'][_0x620b('0x4e')](_0x6bdc64);})['then'](function(_0x23383f){_0x4d0822['rows']=_0x23383f;return _0x4d0822;})[_0x620b('0x2e')](respondWithFilteredResult(_0xa7e1a5,_0x6bdc64))[_0x620b('0x4f')](handleError(_0xa7e1a5,null));};exports[_0x620b('0x50')]=function(_0x3bc7e3,_0x4cdd9e){var _0x11b50b={'raw':![],'where':{'id':_0x3bc7e3[_0x620b('0x51')]['id']}},_0x154c2c={};_0x154c2c['model']=_[_0x620b('0x3b')](db[_0x620b('0x4b')][_0x620b('0x35')]);_0x154c2c[_0x620b('0x3c')]=_[_0x620b('0x3b')](_0x3bc7e3[_0x620b('0x3c')]);_0x154c2c['filters']=_[_0x620b('0x3e')](_0x154c2c[_0x620b('0x39')],_0x154c2c['query']);_0x11b50b[_0x620b('0x3f')]=_[_0x620b('0x3e')](_0x154c2c['model'],qs['fields'](_0x3bc7e3['query'][_0x620b('0x40')]));_0x11b50b[_0x620b('0x3f')]=_0x11b50b[_0x620b('0x3f')][_0x620b('0x52')]?_0x11b50b['attributes']:_0x154c2c[_0x620b('0x39')];if(_0x3bc7e3[_0x620b('0x3c')][_0x620b('0x4c')]){_0x11b50b[_0x620b('0x4d')]=[{'all':!![]}];}_0x11b50b=_[_0x620b('0x48')]({},_0x11b50b,_0x3bc7e3[_0x620b('0x4a')]);return db[_0x620b('0x4b')][_0x620b('0x53')](_0x11b50b)[_0x620b('0x2e')](handleEntityNotFound(_0x4cdd9e,null))[_0x620b('0x2e')](respondWithResult(_0x4cdd9e,null))[_0x620b('0x4f')](handleError(_0x4cdd9e,null));};exports[_0x620b('0x54')]=function(_0x4a5375,_0x24e316){return db[_0x620b('0x4b')][_0x620b('0x54')](_0x4a5375[_0x620b('0x55')],{})[_0x620b('0x2e')](function(_0x433d26){var _0x46ddfb=_0x4a5375[_0x620b('0x56')][_0x620b('0x30')]({'plain':!![]});if(!_0x46ddfb)throw new Error(_0x620b('0x57'));if(_0x46ddfb[_0x620b('0x58')]==='user'){var _0x288644=_0x433d26[_0x620b('0x30')]({'plain':!![]});var _0x53179b=_0x620b('0x59');return db[_0x620b('0x5a')]['find']({'where':{'name':_0x53179b,'userProfileId':_0x46ddfb[_0x620b('0x5b')]},'raw':!![]})['then'](function(_0x5ad8f7){if(_0x5ad8f7&&_0x5ad8f7['autoAssociation']===0x0){return db['UserProfileResource'][_0x620b('0x54')]({'name':_0x288644[_0x620b('0x3a')],'resourceId':_0x288644['id'],'type':_0x5ad8f7[_0x620b('0x3a')],'sectionId':_0x5ad8f7['id']},{})[_0x620b('0x2e')](function(){return _0x433d26;});}else{return _0x433d26;}})[_0x620b('0x4f')](function(_0x11a97e){logger[_0x620b('0x32')](_0x620b('0x5c'),_0x11a97e);throw _0x11a97e;});}return _0x433d26;})[_0x620b('0x2e')](respondWithResult(_0x24e316,0xc9))[_0x620b('0x4f')](handleError(_0x24e316,null));};exports[_0x620b('0x5d')]=function(_0x1d908c,_0x2b6e60){if(_0x1d908c[_0x620b('0x55')]['id']){delete _0x1d908c['body']['id'];}return db[_0x620b('0x4b')][_0x620b('0x53')]({'where':{'id':_0x1d908c[_0x620b('0x51')]['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x2b6e60,null))['then'](saveUpdates(_0x1d908c[_0x620b('0x55')],null))['then'](respondWithResult(_0x2b6e60,null))[_0x620b('0x4f')](handleError(_0x2b6e60,null));};exports[_0x620b('0x2f')]=function(_0x1f2a24,_0x1a2a57){return db[_0x620b('0x4b')]['find']({'where':{'id':_0x1f2a24[_0x620b('0x51')]['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x1a2a57,null))['then'](removeEntity(_0x1a2a57,null))[_0x620b('0x4f')](handleError(_0x1a2a57,null));};exports[_0x620b('0x5e')]=function(_0x153980,_0x139235){return db[_0x620b('0x4b')][_0x620b('0x5e')]()[_0x620b('0x2e')](respondWithResult(_0x139235,null))[_0x620b('0x4f')](handleError(_0x139235,null));};exports['addDisposition']=function(_0x35e051,_0x1da53d,_0x15ce8d){if(_0x35e051[_0x620b('0x55')]['id']){delete _0x35e051[_0x620b('0x55')]['id'];}return db['CmList'][_0x620b('0x53')]({'where':{'id':_0x35e051[_0x620b('0x51')]['id']}})['then'](handleEntityNotFound(_0x1da53d,null))[_0x620b('0x2e')](function(_0x77720a){if(_0x77720a){_0x35e051['body'][_0x620b('0x5f')]=_0x77720a['id'];return db[_0x620b('0x60')][_0x620b('0x54')](_0x35e051[_0x620b('0x55')]);}})[_0x620b('0x2e')](respondWithResult(_0x1da53d,null))['catch'](handleError(_0x1da53d,null));};exports[_0x620b('0x61')]=function(_0x136adc,_0x424007,_0x4215f2){var _0x357a1f={'raw':![],'where':{}};var _0x2334d3={};var _0x51c71c={'count':0x0,'rows':[]};return db[_0x620b('0x4b')][_0x620b('0x62')]({'where':{'id':_0x136adc[_0x620b('0x51')]['id']}})['then'](handleEntityNotFound(_0x424007,null))[_0x620b('0x2e')](function(_0x1f480c){if(_0x1f480c){_0x2334d3[_0x620b('0x39')]=_[_0x620b('0x3b')](db[_0x620b('0x60')][_0x620b('0x35')]);_0x2334d3[_0x620b('0x3c')]=_['keys'](_0x136adc['query']);_0x2334d3[_0x620b('0x3d')]=_[_0x620b('0x3e')](_0x2334d3[_0x620b('0x39')],_0x2334d3['query']);_0x357a1f[_0x620b('0x3f')]=_[_0x620b('0x3e')](_0x2334d3[_0x620b('0x39')],qs[_0x620b('0x40')](_0x136adc[_0x620b('0x3c')][_0x620b('0x40')]));_0x357a1f[_0x620b('0x3f')]=_0x357a1f[_0x620b('0x3f')][_0x620b('0x52')]?_0x357a1f[_0x620b('0x3f')]:_0x2334d3[_0x620b('0x39')];if(!_0x136adc[_0x620b('0x3c')]['hasOwnProperty'](_0x620b('0x42'))){_0x357a1f['limit']=qs[_0x620b('0x27')](_0x136adc['query'][_0x620b('0x27')]);_0x357a1f[_0x620b('0x25')]=qs['offset'](_0x136adc[_0x620b('0x3c')][_0x620b('0x25')]);}_0x357a1f['order']=qs[_0x620b('0x44')](_0x136adc[_0x620b('0x3c')]['sort']);_0x357a1f[_0x620b('0x45')]=qs[_0x620b('0x3d')](_[_0x620b('0x46')](_0x136adc[_0x620b('0x3c')],_0x2334d3[_0x620b('0x3d')]));_0x357a1f[_0x620b('0x45')][_0x620b('0x5f')]=_0x1f480c['id'];if(_0x136adc[_0x620b('0x3c')][_0x620b('0x47')]){_0x357a1f['where']=_[_0x620b('0x48')](_0x357a1f[_0x620b('0x45')],{'$or':_[_0x620b('0x34')](_0x357a1f[_0x620b('0x3f')],function(_0x54c71c){var _0x4c33a8={};_0x4c33a8[_0x54c71c]={'$like':'%'+_0x136adc[_0x620b('0x3c')]['filter']+'%'};return _0x4c33a8;})});}_0x357a1f=_[_0x620b('0x48')]({},_0x357a1f,_0x136adc[_0x620b('0x4a')]);return db[_0x620b('0x60')][_0x620b('0x28')]({'where':_0x357a1f[_0x620b('0x45')]})['then'](function(_0x139a80){_0x51c71c[_0x620b('0x28')]=_0x139a80;if(_0x136adc['query'][_0x620b('0x4c')]){_0x357a1f[_0x620b('0x4d')]=[{'all':!![]}];}return db[_0x620b('0x60')]['findAll'](_0x357a1f);})['then'](function(_0x46e5d0){_0x51c71c[_0x620b('0x63')]=_0x46e5d0;return _0x51c71c;});}})[_0x620b('0x2e')](respondWithFilteredResult(_0x424007,_0x357a1f))[_0x620b('0x4f')](handleError(_0x424007,null));};exports[_0x620b('0x64')]=function(_0x49257a,_0x40a396,_0xb6172a){return db[_0x620b('0x4b')][_0x620b('0x53')]({'where':{'id':_0x49257a[_0x620b('0x51')]['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x40a396,null))['then'](function(_0x4d05a3){if(_0x4d05a3){return _0x4d05a3[_0x620b('0x64')](_0x49257a[_0x620b('0x3c')][_0x620b('0x65')]);}})['then'](respondWithStatusCode(_0x40a396,null))['catch'](handleError(_0x40a396,null));};exports['addContacts']=function(_0x5efb9f,_0x532fb3,_0x42fd90){return db[_0x620b('0x4b')][_0x620b('0x53')]({'where':{'id':_0x5efb9f[_0x620b('0x51')]['id']}})['then'](handleEntityNotFound(_0x532fb3,null))[_0x620b('0x2e')](function(_0x2f35ea){if(_0x2f35ea){var _0x2b89f9=[];var _0x2f763f={'success':[],'errors':[]};return db[_0x620b('0x66')]['describe']()[_0x620b('0x2e')](function(_0x266f6b){if(_0x5efb9f[_0x620b('0x55')][_0x620b('0x67')]&&_[_0x620b('0x68')](_0x5efb9f[_0x620b('0x55')][_0x620b('0x67')])){if(_0x5efb9f[_0x620b('0x55')][_0x620b('0x67')]['length']){_0x5efb9f[_0x620b('0x55')]['tags']=_0x5efb9f[_0x620b('0x55')][_0x620b('0x67')][_0x620b('0x69')](';')+';';}else{_0x5efb9f[_0x620b('0x55')]['tags']=null;}}else{_0x5efb9f[_0x620b('0x55')][_0x620b('0x67')]=null;}if(_0x5efb9f[_0x620b('0x55')]&&_[_0x620b('0x68')](_0x5efb9f['body'])){for(var _0x3add4a=0x0;_0x3add4a<_0x5efb9f[_0x620b('0x55')][_0x620b('0x52')];_0x3add4a+=0x1){_0x5efb9f[_0x620b('0x55')][_0x3add4a][_0x620b('0x5f')]=_0x5efb9f[_0x620b('0x51')]['id'];_0x2b89f9[_0x620b('0x6a')](_0x5efb9f['body'][_0x3add4a]);}return BPromise[_0x620b('0x6b')](_0x2b89f9,function(_0xe7106f){return db[_0x620b('0x66')][_0x620b('0x54')](_[_0x620b('0x6c')](_0xe7106f,[_0x620b('0x65'),'id'])||{},{'fields':_[_0x620b('0x3b')](_0x266f6b),'raw':!![]})[_0x620b('0x2e')](function(_0x5cd233){_0x2f763f[_0x620b('0x6d')]['push'](_0x5cd233[_0x620b('0x6e')]);})[_0x620b('0x4f')](function(_0x543551){_0x2f763f[_0x620b('0x6f')][_0x620b('0x6a')]({'data':_0xe7106f,'error':_0x543551[_0x620b('0x70')]});});})['then'](function(_0x2f8e2f){return _0x2f763f;})[_0x620b('0x4f')](function(_0x251af3){return _0x251af3;});}else{_0x532fb3[_0x620b('0x24')](0x190)[_0x620b('0x2b')]({'message':_0x620b('0x71')});}});}})[_0x620b('0x2e')](respondWithResult(_0x532fb3,null))[_0x620b('0x4f')](handleError(_0x532fb3,null));};exports['getContacts']=function(_0x33e0cc,_0x3740e4,_0x5ea9f7){var _0x3b89fc;return db['CmList']['find']({'where':{'id':_0x33e0cc[_0x620b('0x51')]['id']},'include':[{'model':db[_0x620b('0x72')],'as':_0x620b('0x73')}]})[_0x620b('0x2e')](handleEntityNotFound(_0x3740e4,null))[_0x620b('0x2e')](function(_0x1fbf2e){if(_0x1fbf2e){_0x3b89fc=_0x1fbf2e;return db['CmContact'][_0x620b('0x35')];}})[_0x620b('0x2e')](function(_0x348828){if(_0x348828){var _0x41c5f6={};var _0x6f1ae2={};_0x6f1ae2[_0x620b('0x39')]=_[_0x620b('0x74')](_['keys'](_0x348828),_[_0x620b('0x34')](_0x3b89fc[_0x620b('0x73')],function(_0x314536){return util['format'](_0x620b('0x75'),_0x314536['id']);}));_0x6f1ae2[_0x620b('0x3c')]=_[_0x620b('0x3b')](_0x33e0cc['query']);_0x6f1ae2['filters']=_[_0x620b('0x3e')](_0x6f1ae2[_0x620b('0x39')],_0x6f1ae2[_0x620b('0x3c')]);_0x41c5f6[_0x620b('0x3f')]=_[_0x620b('0x3e')](_0x6f1ae2[_0x620b('0x39')],qs[_0x620b('0x40')](_0x33e0cc['query'][_0x620b('0x40')]));_0x41c5f6[_0x620b('0x3f')]=_0x41c5f6[_0x620b('0x3f')][_0x620b('0x52')]?_0x41c5f6[_0x620b('0x3f')]:_0x6f1ae2[_0x620b('0x39')];if(!_0x33e0cc[_0x620b('0x3c')]['hasOwnProperty'](_0x620b('0x42'))){_0x41c5f6[_0x620b('0x27')]=qs[_0x620b('0x27')](_0x33e0cc[_0x620b('0x3c')][_0x620b('0x27')]);_0x41c5f6[_0x620b('0x25')]=qs[_0x620b('0x25')](_0x33e0cc[_0x620b('0x3c')][_0x620b('0x25')]);}_0x41c5f6[_0x620b('0x43')]=qs[_0x620b('0x44')](_0x33e0cc[_0x620b('0x3c')]['sort']);_0x41c5f6[_0x620b('0x45')]=qs[_0x620b('0x3d')](_[_0x620b('0x46')](_0x33e0cc[_0x620b('0x3c')],_0x6f1ae2['filters']));_0x41c5f6[_0x620b('0x76')]=!![];if(_0x33e0cc[_0x620b('0x3c')][_0x620b('0x47')]){_0x41c5f6[_0x620b('0x45')]=_[_0x620b('0x48')](_0x41c5f6[_0x620b('0x45')],{'$or':_['map'](_0x41c5f6[_0x620b('0x3f')],function(_0x500498){var _0x221c9d={};_0x221c9d[_0x500498]={'$like':'%'+_0x33e0cc[_0x620b('0x3c')][_0x620b('0x47')]+'%'};return _0x221c9d;})});}_0x41c5f6=_[_0x620b('0x48')]({},_0x41c5f6,_0x33e0cc['options']);return _0x3b89fc['getContacts'](_0x41c5f6);}})['then'](respondWithResult(_0x3740e4,null))[_0x620b('0x4f')](handleError(_0x3740e4,null));};exports['getContactsCsv']=function(_0x4abdc8,_0x305f1a,_0x3c2a7c){var _0x8ef726;var _0x1cdfd3;var _0x1b1da1;var _0x8ceb5c=_0x4abdc8[_0x620b('0x51')]['id'];csv_results=[];return db[_0x620b('0x77')][_0x620b('0x4e')]({'attributes':['id','name'],'raw':!![],'order':[_0x620b('0x78')]})[_0x620b('0x2e')](function(_0x246db2){_0x8ef726=_0x246db2;var _0x501a41=_['keys'](db[_0x620b('0x66')]['rawAttributes']);return db[_0x620b('0x72')][_0x620b('0x4e')]({'raw':!![],'attributes':['id',_0x620b('0x79')]})[_0x620b('0x2e')](function(_0x43871a){_0x1cdfd3=_0x43871a;var _0x2a0a29=squel[_0x620b('0x7a')]()[_0x620b('0x40')](_0x501a41)[_0x620b('0x7b')](_0x620b('0x7c'),'c')['where'](_0x620b('0x7d'),_0x8ceb5c)[_0x620b('0x45')]('c.deletedAt\x20is\x20null')[_0x620b('0x7e')]();for(var _0x15c4ef=0x0;_0x15c4ef<_0x1cdfd3[_0x620b('0x52')];_0x15c4ef++){_0x2a0a29[_0x620b('0x7f')](_0x620b('0x80')+_0x1cdfd3[_0x15c4ef]['id'],'customField_'+_0x1cdfd3[_0x15c4ef]['alias']);}for(var _0x15c4ef=0x0;_0x15c4ef<_0x8ef726[_0x620b('0x52')];_0x15c4ef++){_0x2a0a29[_0x620b('0x7f')](squel[_0x620b('0x7a')]()[_0x620b('0x7f')](_0x620b('0x81'))[_0x620b('0x7b')](_0x620b('0x82'))[_0x620b('0x45')](_0x620b('0x83'),_0x8ef726[_0x15c4ef]['id'])['where']('CmContactId\x20=\x20c.id'),_0x620b('0x84')+_0x8ef726[_0x15c4ef][_0x620b('0x3a')]);_0x2a0a29[_0x620b('0x7f')](squel['select']()[_0x620b('0x7f')]('description')[_0x620b('0x7b')](_0x620b('0x82'))[_0x620b('0x45')](_0x620b('0x83'),_0x8ef726[_0x15c4ef]['id'])[_0x620b('0x45')](_0x620b('0x85')),_0x620b('0x86')+_0x8ef726[_0x15c4ef][_0x620b('0x3a')]);}var _0x55d5fb=[];_0x55d5fb[_0x620b('0x6a')](_0x2a0a29['toString']());BPromise['each'](_0x55d5fb,handleQuery)[_0x620b('0x2e')](function(_0x48fbbf){handleQuery(_0x2a0a29[_0x620b('0x87')]());var _0x41630a=csv_results[0x0];if(!_['isEmpty'](_0x41630a)){var _0x1adb44=toCsv(_0x41630a);var _0x4a9021=Date[_0x620b('0x88')]();fs[_0x620b('0x89')](util[_0x620b('0x8a')](_0x620b('0x8b'),_0x8ceb5c,_0x4a9021),_0x1adb44);_0x305f1a[_0x620b('0x8c')](_0x620b('0x8d'),_0x620b('0x8e')+util['format'](_0x620b('0x8f'),_0x8ceb5c,_0x4a9021));_0x305f1a[_0x620b('0x8c')](_0x620b('0x90'),_0x620b('0x91'));return _0x305f1a[_0x620b('0x92')](util[_0x620b('0x8a')]('/tmp/list_%d_%s.csv',_0x8ceb5c,_0x4a9021));}else{return _0x305f1a[_0x620b('0x23')](0xcc);}});});});};exports[_0x620b('0x93')]=function(_0x5af63b,_0x16d923,_0x3d015d){var _0x47db35;delete _0x5af63b['body']['id'];return db[_0x620b('0x4b')][_0x620b('0x62')]({'where':{'id':_0x5af63b[_0x620b('0x51')]['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x16d923,null))['then'](function(_0x4bb606){if(_0x4bb606){return db[_0x620b('0x94')][_0x620b('0x95')](function(_0x317613){return db[_0x620b('0x72')][_0x620b('0x54')](_0x5af63b[_0x620b('0x55')],{'transaction':_0x317613})[_0x620b('0x2e')](function(_0x21a44b){_0x47db35=_0x21a44b;return _0x4bb606['addCustomFields'](_0x21a44b,{'transaction':_0x317613});})[_0x620b('0x2e')](function(){var _0x2d5194={'type':db[_0x620b('0x96')][_0x620b('0x97')],'transaction':_0x317613};switch(_0x5af63b[_0x620b('0x55')][_0x620b('0x37')]){case _0x620b('0x98'):_0x2d5194[_0x620b('0x37')]=db['Sequelize'][_0x620b('0x97')];break;case _0x620b('0x99'):_0x2d5194[_0x620b('0x37')]=db[_0x620b('0x96')][_0x620b('0x9a')];break;case _0x620b('0x9b'):_0x2d5194[_0x620b('0x37')]=db['Sequelize'][_0x620b('0x9c')];_0x2d5194[_0x620b('0x9d')]=![];break;default:}return db['sequelize'][_0x620b('0x9e')][_0x620b('0x9f')]('cm_contacts',util[_0x620b('0x8a')](_0x620b('0xa0'),_0x47db35['id']),_0x2d5194);})[_0x620b('0x2e')](function(){return _0x47db35;});});}})['then'](respondWithResult(_0x16d923,null))[_0x620b('0x4f')](handleError(_0x16d923,null));};exports[_0x620b('0xa1')]=function(_0xc90149,_0x412155,_0x32dc2e){var _0x41fa74={};var _0x414d0f={};var _0x202680;var _0x234c95;return db['CmList']['findOne']({'where':{'id':_0xc90149[_0x620b('0x51')]['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x412155,null))[_0x620b('0x2e')](function(_0x2037f1){if(_0x2037f1){_0x202680=_0x2037f1;_0x414d0f[_0x620b('0x39')]=_[_0x620b('0x3b')](db['CmCustomField'][_0x620b('0x35')]);_0x414d0f['query']=_[_0x620b('0x3b')](_0xc90149[_0x620b('0x3c')]);_0x414d0f[_0x620b('0x3d')]=_[_0x620b('0x3e')](_0x414d0f[_0x620b('0x39')],_0x414d0f[_0x620b('0x3c')]);_0x41fa74[_0x620b('0x3f')]=_[_0x620b('0x3e')](_0x414d0f[_0x620b('0x39')],qs[_0x620b('0x40')](_0xc90149[_0x620b('0x3c')][_0x620b('0x40')]));_0x41fa74[_0x620b('0x3f')]=_0x41fa74[_0x620b('0x3f')][_0x620b('0x52')]?_0x41fa74['attributes']:_0x414d0f[_0x620b('0x39')];_0x41fa74[_0x620b('0x43')]=qs[_0x620b('0x44')](_0xc90149[_0x620b('0x3c')][_0x620b('0x44')]);_0x41fa74[_0x620b('0x45')]=qs[_0x620b('0x3d')](_[_0x620b('0x46')](_0xc90149[_0x620b('0x3c')],_0x414d0f[_0x620b('0x3d')]));_0x41fa74[_0x620b('0x45')]=_[_0x620b('0x48')](_0x41fa74['where'],{'$or':[{'ListId':_0x2037f1['id']},{'ListId':null}]});if(_0xc90149['query'][_0x620b('0x47')]){_0x41fa74[_0x620b('0x45')]=_[_0x620b('0x48')](_0x41fa74[_0x620b('0x45')],{'$or':_[_0x620b('0x34')](_0x41fa74['attributes'],function(_0x16c473){var _0x3b22b0={};_0x3b22b0[_0x16c473]={'$like':'%'+_0xc90149[_0x620b('0x3c')][_0x620b('0x47')]+'%'};return _0x3b22b0;})});}_0x41fa74=_[_0x620b('0x48')]({},_0x41fa74,_0xc90149[_0x620b('0x4a')]);return db[_0x620b('0x72')][_0x620b('0xa2')](_0x41fa74);}})[_0x620b('0x2e')](respondWithResult(_0x412155,null))['catch'](handleError(_0x412155,null));};exports['getGlobalCustomFields']=function(_0xbb8e30,_0x5db592){return db[_0x620b('0x72')][_0x620b('0xa2')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x5db592,null))[_0x620b('0x2e')](function(_0x16f77a){return _0x16f77a;})[_0x620b('0x2e')](respondWithResult(_0x5db592,null))[_0x620b('0x4f')](handleError(_0x5db592,null));};exports[_0x620b('0xa3')]=function(_0x5836ac,_0x490d5d,_0x979081){return db[_0x620b('0x4b')][_0x620b('0x53')]({'where':{'id':_0x5836ac[_0x620b('0x51')]['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x490d5d,null))[_0x620b('0x2e')](function(_0x255989){if(_0x255989){return _0x255989['addAgents'](_0x5836ac[_0x620b('0x55')]['ids'],_[_0x620b('0x6c')](_0x5836ac[_0x620b('0x55')],[_0x620b('0x65'),'id'])||{})['spread'](function(_0x43e7ba){for(var _0x466ea0=0x0;_0x466ea0<_0x5836ac['body'][_0x620b('0x65')]['length'];_0x466ea0+=0x1){socket[_0x620b('0xa4')](_0x620b('0xa5'),{'UserId':Number(_0x5836ac[_0x620b('0x55')][_0x620b('0x65')][_0x466ea0]),'CmListId':Number(_0x5836ac['params']['id'])});}return _0x43e7ba;});}})[_0x620b('0x2e')](respondWithResult(_0x490d5d,null))['catch'](handleError(_0x490d5d,null));};exports[_0x620b('0xa6')]=function(_0x74e013,_0x2cde0b,_0x31ee67){return db[_0x620b('0x4b')][_0x620b('0x53')]({'where':{'id':_0x74e013['params']['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x2cde0b,null))[_0x620b('0x2e')](function(_0x4b2267){if(_0x4b2267){return _0x4b2267[_0x620b('0xa6')](_0x74e013['query'][_0x620b('0x65')])[_0x620b('0x2e')](function(){if(_['isArray'](_0x74e013['query'][_0x620b('0x65')])){for(var _0x12dd74=0x0;_0x12dd74<_0x74e013['query'][_0x620b('0x65')][_0x620b('0x52')];_0x12dd74+=0x1){socket[_0x620b('0xa4')](_0x620b('0xa7'),{'UserId':Number(_0x74e013[_0x620b('0x3c')]['ids'][_0x12dd74]),'CmListId':Number(_0x74e013['params']['id'])});}}else{socket[_0x620b('0xa4')](_0x620b('0xa7'),{'UserId':Number(_0x74e013['query'][_0x620b('0x65')]),'CmListId':Number(_0x74e013[_0x620b('0x51')]['id'])});}});}})[_0x620b('0x2e')](respondWithStatusCode(_0x2cde0b,null))[_0x620b('0x4f')](handleError(_0x2cde0b,null));};exports[_0x620b('0xa8')]=function(_0x5bff93,_0x23da34,_0x4a11b7){var _0xc15c88={};var _0x49da6c={};var _0x284a00;var _0x26462f;return db[_0x620b('0x4b')][_0x620b('0x62')]({'where':{'id':_0x5bff93[_0x620b('0x51')]['id']}})[_0x620b('0x2e')](handleEntityNotFound(_0x23da34,null))['then'](function(_0x229b1d){if(_0x229b1d){_0x284a00=_0x229b1d;_0x49da6c['model']=_[_0x620b('0x3b')](db[_0x620b('0xa9')][_0x620b('0x35')]);_0x49da6c[_0x620b('0x3c')]=_[_0x620b('0x3b')](_0x5bff93['query']);_0x49da6c[_0x620b('0x3d')]=_['intersection'](_0x49da6c[_0x620b('0x39')],_0x49da6c[_0x620b('0x3c')]);_0xc15c88[_0x620b('0x3f')]=_['intersection'](_0x49da6c['model'],qs['fields'](_0x5bff93['query'][_0x620b('0x40')]));_0xc15c88[_0x620b('0x3f')]=_0xc15c88[_0x620b('0x3f')][_0x620b('0x52')]?_0xc15c88['attributes']:_0x49da6c['model'];_0xc15c88[_0x620b('0x43')]=qs[_0x620b('0x44')](_0x5bff93[_0x620b('0x3c')][_0x620b('0x44')]);_0xc15c88['where']=qs[_0x620b('0x3d')](_['pick'](_0x5bff93[_0x620b('0x3c')],_0x49da6c[_0x620b('0x3d')]));if(_0x5bff93[_0x620b('0x3c')]['filter']){_0xc15c88['where']=_[_0x620b('0x48')](_0xc15c88[_0x620b('0x45')],{'$or':_['map'](_0xc15c88[_0x620b('0x3f')],function(_0x106648){var _0x2b9318={};_0x2b9318[_0x106648]={'$like':'%'+_0x5bff93['query'][_0x620b('0x47')]+'%'};return _0x2b9318;})});}_0xc15c88=_[_0x620b('0x48')]({},_0xc15c88,_0x5bff93['options']);return _0x284a00[_0x620b('0xa8')](_0xc15c88);}})['then'](function(_0x26b2b8){if(_0x26b2b8){_0x26462f=_0x26b2b8[_0x620b('0x52')];if(!_0x5bff93[_0x620b('0x3c')][_0x620b('0x41')](_0x620b('0x42'))){_0xc15c88['limit']=qs[_0x620b('0x27')](_0x5bff93[_0x620b('0x3c')][_0x620b('0x27')]);_0xc15c88[_0x620b('0x25')]=qs['offset'](_0x5bff93['query']['offset']);}return _0x284a00[_0x620b('0xa8')](_0xc15c88);}})['then'](function(_0x2286c5){if(_0x2286c5){return _0x2286c5?{'count':_0x26462f,'rows':_0x2286c5}:null;}})[_0x620b('0x2e')](respondWithResult(_0x23da34,null))['catch'](handleError(_0x23da34,null));};function handleQuery(_0x57d44f){logger[_0x620b('0xaa')](_0x57d44f);return db['sequelize'][_0x620b('0x3c')](_0x57d44f)[_0x620b('0xab')](function(_0x590100){csv_results[_0x620b('0x6a')](_0x590100);})[_0x620b('0x4f')](function(_0x3f7ebd){logger['error'](_0x3f7ebd[_0x620b('0x70')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 6ee44f2..68df82d 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x55ca,0x126));var _0xa55c=function(_0x3e5f6d,_0x121db6){_0x3e5f6d=_0x3e5f6d-0x0;var _0x1bea6e=_0x55ca[_0x3e5f6d];return _0x1bea6e;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x55ca,0x126));var _0xa55c=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x55ca[_0x3dfea6];return _0x567aca;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 0a20bf4..021e789 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 _0xec56=['define','CmList','cm_lists','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x151f00,_0x4ca3a1){var _0x418d9b=function(_0x5c37c7){while(--_0x5c37c7){_0x151f00['push'](_0x151f00['shift']());}};_0x418d9b(++_0x4ca3a1);}(_0xec56,0x1bd));var _0x6ec5=function(_0x3e491e,_0x46af5d){_0x3e491e=_0x3e491e-0x0;var _0x407e05=_0xec56[_0x3e491e];return _0x407e05;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x3a8aa7,_0x12159b){var _0x1e0a11=function(_0x5f2fcc){while(--_0x5f2fcc){_0x3a8aa7['push'](_0x3a8aa7['shift']());}};_0x1e0a11(++_0x12159b);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3109f9,_0x4c2eb9){_0x3109f9=_0x3109f9-0x0;var _0x28f7a3=_0x5ff3[_0x3109f9];return _0x28f7a3;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'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 d160e31..21b1613 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 _0xbe2d=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request'];(function(_0x131f50,_0x3948e0){var _0x564924=function(_0xed22bd){while(--_0xed22bd){_0x131f50['push'](_0x131f50['shift']());}};_0x564924(++_0x3948e0);}(_0xbe2d,0xec));var _0xdbe2=function(_0x5a8f5d,_0x35d371){_0x5a8f5d=_0x5a8f5d-0x0;var _0x1e130c=_0xbe2d[_0x5a8f5d];return _0x1e130c;};'use strict';var _=require('lodash');var util=require(_0xdbe2('0x0'));var moment=require('moment');var BPromise=require(_0xdbe2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbe2('0x2'))['db'];var utils=require(_0xdbe2('0x3'));var logger=require(_0xdbe2('0x4'))(_0xdbe2('0x5'));var config=require(_0xdbe2('0x6'));var jayson=require(_0xdbe2('0x7'));var client=jayson['client'][_0xdbe2('0x8')]({'port':0x232a});config[_0xdbe2('0x9')]=_[_0xdbe2('0xa')](config[_0xdbe2('0x9')],{'host':_0xdbe2('0xb'),'port':0x18eb});var socket=require(_0xdbe2('0xc'))(new Redis(config['redis']));require(_0xdbe2('0xd'))[_0xdbe2('0xe')](socket);function respondWithRpcPromise(_0x29f357,_0x339b9d,_0x1d448c){return new BPromise(function(_0x5a850b,_0x2c6ddb){return client[_0xdbe2('0xf')](_0x29f357,_0x1d448c)[_0xdbe2('0x10')](function(_0x140bd6){logger[_0xdbe2('0x11')](_0xdbe2('0x12'),_0x339b9d,_0xdbe2('0x13'));logger[_0xdbe2('0x14')](_0xdbe2('0x15'),_0x339b9d,'request\x20sent',JSON[_0xdbe2('0x16')](_0x140bd6));if(_0x140bd6[_0xdbe2('0x17')]){if(_0x140bd6[_0xdbe2('0x17')][_0xdbe2('0x18')]===0x1f4){logger[_0xdbe2('0x17')](_0xdbe2('0x12'),_0x339b9d,_0x140bd6[_0xdbe2('0x17')][_0xdbe2('0x19')]);return _0x2c6ddb(_0x140bd6['error'][_0xdbe2('0x19')]);}logger[_0xdbe2('0x17')](_0xdbe2('0x12'),_0x339b9d,_0x140bd6[_0xdbe2('0x17')][_0xdbe2('0x19')]);return _0x5a850b(_0x140bd6[_0xdbe2('0x17')]['message']);}else{logger['info'](_0xdbe2('0x12'),_0x339b9d,_0xdbe2('0x13'));_0x5a850b(_0x140bd6[_0xdbe2('0x1a')][_0xdbe2('0x19')]);}})[_0xdbe2('0x1b')](function(_0x49174d){logger['error'](_0xdbe2('0x12'),_0x339b9d,_0x49174d);_0x2c6ddb(_0x49174d);});});} \ No newline at end of file +var _0x4fa8=['../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x443494,_0x51fc7e){var _0x4a6794=function(_0x15197a){while(--_0x15197a){_0x443494['push'](_0x443494['shift']());}};_0x4a6794(++_0x51fc7e);}(_0x4fa8,0x126));var _0x84fa=function(_0x4841c9,_0x10e316){_0x4841c9=_0x4841c9-0x0;var _0x105137=_0x4fa8[_0x4841c9];return _0x105137;};'use strict';var _=require(_0x84fa('0x0'));var util=require(_0x84fa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84fa('0x2'));var fs=require('fs');var Redis=require(_0x84fa('0x3'));var db=require(_0x84fa('0x4'))['db'];var utils=require(_0x84fa('0x5'));var logger=require(_0x84fa('0x6'))('rpc');var config=require(_0x84fa('0x7'));var jayson=require(_0x84fa('0x8'));var client=jayson[_0x84fa('0x9')]['http']({'port':0x232a});config[_0x84fa('0xa')]=_[_0x84fa('0xb')](config[_0x84fa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x84fa('0xc'))(new Redis(config[_0x84fa('0xa')]));require(_0x84fa('0xd'))[_0x84fa('0xe')](socket);function respondWithRpcPromise(_0x3a68c6,_0x5e735a,_0x1aad57){return new BPromise(function(_0x32ef78,_0x180e93){return client[_0x84fa('0xf')](_0x3a68c6,_0x1aad57)[_0x84fa('0x10')](function(_0x1eb34b){logger['info'](_0x84fa('0x11'),_0x5e735a,_0x84fa('0x12'));logger[_0x84fa('0x13')](_0x84fa('0x14'),_0x5e735a,_0x84fa('0x12'),JSON['stringify'](_0x1eb34b));if(_0x1eb34b[_0x84fa('0x15')]){if(_0x1eb34b[_0x84fa('0x15')][_0x84fa('0x16')]===0x1f4){logger['error'](_0x84fa('0x11'),_0x5e735a,_0x1eb34b[_0x84fa('0x15')][_0x84fa('0x17')]);return _0x180e93(_0x1eb34b[_0x84fa('0x15')][_0x84fa('0x17')]);}logger[_0x84fa('0x15')](_0x84fa('0x11'),_0x5e735a,_0x1eb34b[_0x84fa('0x15')][_0x84fa('0x17')]);return _0x32ef78(_0x1eb34b[_0x84fa('0x15')][_0x84fa('0x17')]);}else{logger['info'](_0x84fa('0x11'),_0x5e735a,_0x84fa('0x12'));_0x32ef78(_0x1eb34b[_0x84fa('0x18')]['message']);}})['catch'](function(_0x38160c){logger[_0x84fa('0x15')](_0x84fa('0x11'),_0x5e735a,_0x38160c);_0x180e93(_0x38160c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index ea543c1..901b2e4 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 _0x92ce=['remove','update','emit','removeListener','register','length','save'];(function(_0x14ac9e,_0x443c98){var _0x455527=function(_0x43c0bc){while(--_0x43c0bc){_0x14ac9e['push'](_0x14ac9e['shift']());}};_0x455527(++_0x443c98);}(_0x92ce,0x16b));var _0xe92c=function(_0x855da9,_0x42335b){_0x855da9=_0x855da9-0x0;var _0x1364d7=_0x92ce[_0x855da9];return _0x1364d7;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xe92c('0x0'),_0xe92c('0x1'),_0xe92c('0x2')];function createListener(_0x506ac3,_0xefb9e8){return function(_0x198c52){_0xefb9e8[_0xe92c('0x3')](_0x506ac3,_0x198c52);};}function removeListener(_0x6e208e,_0x63a949){return function(){CmListEvents[_0xe92c('0x4')](_0x6e208e,_0x63a949);};}exports[_0xe92c('0x5')]=function(_0x1e6717){for(var _0xf11973=0x0,_0x5e4c2d=events[_0xe92c('0x6')];_0xf11973<_0x5e4c2d;_0xf11973++){var _0x3b59cb=events[_0xf11973];var _0x32511e=createListener('cmList:'+_0x3b59cb,_0x1e6717);CmListEvents['on'](_0x3b59cb,_0x32511e);}}; \ No newline at end of file +var _0xb3ca=['register','length','cmList:','./cmList.events','save','remove','removeListener'];(function(_0x5050c5,_0x31e484){var _0x7dca49=function(_0xaf28d0){while(--_0xaf28d0){_0x5050c5['push'](_0x5050c5['shift']());}};_0x7dca49(++_0x31e484);}(_0xb3ca,0x1d8));var _0xab3c=function(_0x4db40c,_0x5aebda){_0x4db40c=_0x4db40c-0x0;var _0x572a4b=_0xb3ca[_0x4db40c];return _0x572a4b;};'use strict';var CmListEvents=require(_0xab3c('0x0'));var events=[_0xab3c('0x1'),_0xab3c('0x2'),'update'];function createListener(_0x2a16ad,_0x5e0ee6){return function(_0x78bf9d){_0x5e0ee6['emit'](_0x2a16ad,_0x78bf9d);};}function removeListener(_0x22875f,_0x5a066b){return function(){CmListEvents[_0xab3c('0x3')](_0x22875f,_0x5a066b);};}exports[_0xab3c('0x4')]=function(_0x1c0222){for(var _0x542c70=0x0,_0x147534=events[_0xab3c('0x5')];_0x542c70<_0x147534;_0x542c70++){var _0x1ffc62=events[_0x542c70];var _0x18e822=createListener(_0xab3c('0x6')+_0x1ffc62,_0x1c0222);CmListEvents['on'](_0x1ffc62,_0x18e822);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 399a6ef..fdd3eeb 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 _0xcaaf=['/:id/users','getAgents','create','post','addDisposition','/:id/contacts','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','/describe','isAuthenticated','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields'];(function(_0x28698b,_0x5ccc05){var _0x35abab=function(_0x20cc63){while(--_0x20cc63){_0x28698b['push'](_0x28698b['shift']());}};_0x35abab(++_0x5ccc05);}(_0xcaaf,0xcb));var _0xfcaa=function(_0x4cfb,_0x4ac2cd){_0x4cfb=_0x4cfb-0x0;var _0x42b2e0=_0xcaaf[_0x4cfb];return _0x42b2e0;};'use strict';var multer=require(_0xfcaa('0x0'));var util=require(_0xfcaa('0x1'));var path=require(_0xfcaa('0x2'));var timeout=require(_0xfcaa('0x3'));var express=require(_0xfcaa('0x4'));var router=express[_0xfcaa('0x5')]();var fs_extra=require(_0xfcaa('0x6'));var auth=require(_0xfcaa('0x7'));var interaction=require(_0xfcaa('0x8'));var config=require(_0xfcaa('0x9'));var controller=require(_0xfcaa('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xfcaa('0xb')]);router[_0xfcaa('0xc')](_0xfcaa('0xd'),auth[_0xfcaa('0xe')](),controller['describe']);router[_0xfcaa('0xc')](_0xfcaa('0xf'),auth[_0xfcaa('0xe')](),controller[_0xfcaa('0x10')]);router['get'](_0xfcaa('0x11'),auth[_0xfcaa('0xe')](),controller['show']);router[_0xfcaa('0xc')](_0xfcaa('0x12'),auth[_0xfcaa('0xe')](),controller[_0xfcaa('0x13')]);router[_0xfcaa('0xc')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xfcaa('0x14')]);router[_0xfcaa('0xc')](_0xfcaa('0x15'),auth['isAuthenticated'](),controller[_0xfcaa('0x16')]);router[_0xfcaa('0xc')](_0xfcaa('0x17'),auth[_0xfcaa('0xe')](),controller[_0xfcaa('0x18')]);router[_0xfcaa('0xc')](_0xfcaa('0x19'),auth[_0xfcaa('0xe')](),controller[_0xfcaa('0x1a')]);router['post']('/',auth[_0xfcaa('0xe')](),controller[_0xfcaa('0x1b')]);router[_0xfcaa('0x1c')](_0xfcaa('0x12'),auth['isAuthenticated'](),controller[_0xfcaa('0x1d')]);router[_0xfcaa('0x1c')](_0xfcaa('0x1e'),auth[_0xfcaa('0xe')](),controller['addContacts']);router['post'](_0xfcaa('0x17'),auth[_0xfcaa('0xe')](),controller['addCustomField']);router[_0xfcaa('0x1c')]('/:id/users',auth[_0xfcaa('0xe')](),controller[_0xfcaa('0x1f')]);router[_0xfcaa('0x20')](_0xfcaa('0x11'),auth[_0xfcaa('0xe')](),controller[_0xfcaa('0x21')]);router[_0xfcaa('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xfcaa('0x23')]);router[_0xfcaa('0x22')](_0xfcaa('0x12'),auth['isAuthenticated'](),controller[_0xfcaa('0x24')]);router['delete'](_0xfcaa('0x19'),auth[_0xfcaa('0xe')](),controller['removeAgents']);module[_0xfcaa('0x25')]=router; \ No newline at end of file +var _0xf5b7=['fs-extra','../../components/interaction/service','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router'];(function(_0x40ec6d,_0x579178){var _0x3cb980=function(_0x5326c5){while(--_0x5326c5){_0x40ec6d['push'](_0x40ec6d['shift']());}};_0x3cb980(++_0x579178);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x526633,_0x3c249b){_0x526633=_0x526633-0x0;var _0x4ed61d=_0xf5b7[_0x526633];return _0x4ed61d;};'use strict';var multer=require('multer');var util=require(_0x7f5b('0x0'));var path=require(_0x7f5b('0x1'));var timeout=require(_0x7f5b('0x2'));var express=require(_0x7f5b('0x3'));var router=express[_0x7f5b('0x4')]();var fs_extra=require(_0x7f5b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7f5b('0x6'));var config=require('../../config/environment');var controller=require(_0x7f5b('0x7'));router[_0x7f5b('0x8')]('/',auth['isAuthenticated'](),controller[_0x7f5b('0x9')]);router[_0x7f5b('0x8')](_0x7f5b('0xa'),auth[_0x7f5b('0xb')](),controller[_0x7f5b('0xc')]);router[_0x7f5b('0x8')](_0x7f5b('0xd'),auth[_0x7f5b('0xb')](),controller[_0x7f5b('0xe')]);router[_0x7f5b('0x8')](_0x7f5b('0xf'),auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x10')]);router[_0x7f5b('0x8')](_0x7f5b('0x11'),auth['isAuthenticated'](),controller[_0x7f5b('0x12')]);router[_0x7f5b('0x8')](_0x7f5b('0x13'),auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x14')]);router[_0x7f5b('0x8')]('/:id/contacts/csv',auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x15')]);router[_0x7f5b('0x8')](_0x7f5b('0x16'),auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x17')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7f5b('0x18')]);router[_0x7f5b('0x19')]('/',auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x1a')]);router[_0x7f5b('0x19')](_0x7f5b('0x11'),auth[_0x7f5b('0xb')](),controller['addDisposition']);router['post'](_0x7f5b('0x13'),auth['isAuthenticated'](),controller[_0x7f5b('0x1b')]);router[_0x7f5b('0x19')]('/:id/fields',auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x1c')]);router['post']('/:id/users',auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x1d')]);router[_0x7f5b('0x1e')]('/:id',auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x1f')]);router[_0x7f5b('0x20')](_0x7f5b('0xf'),auth['isAuthenticated'](),controller[_0x7f5b('0x21')]);router['delete'](_0x7f5b('0x11'),auth[_0x7f5b('0xb')](),controller['removeDispositions']);router[_0x7f5b('0x20')]('/:id/users',auth[_0x7f5b('0xb')](),controller[_0x7f5b('0x22')]);module[_0x7f5b('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index c8b1b81..82ab833 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 _0xe45f=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x3c242f,_0x4da0ee){var _0x1b30df=function(_0x562187){while(--_0x562187){_0x3c242f['push'](_0x3c242f['shift']());}};_0x1b30df(++_0x4da0ee);}(_0xe45f,0x150));var _0xfe45=function(_0x4043c6,_0xdbe949){_0x4043c6=_0x4043c6-0x0;var _0x37784e=_0xe45f[_0x4043c6];return _0x37784e;};'use strict';var Sequelize=require('sequelize');module[_0xfe45('0x0')]={'name':{'type':Sequelize[_0xfe45('0x1')],'get':function(_0x39c4a8){return this[_0xfe45('0x2')](_0xfe45('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xfe45('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xfe45('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xbf59=['STRING','exports','getDataValue','field'];(function(_0x283b46,_0x33587f){var _0x2afe48=function(_0x1d0a27){while(--_0x1d0a27){_0x283b46['push'](_0x283b46['shift']());}};_0x2afe48(++_0x33587f);}(_0xbf59,0x95));var _0x9bf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf59[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9bf5('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x12c5cc){return this[_0x9bf5('0x1')](_0x9bf5('0x2'));}},'field':{'type':Sequelize[_0x9bf5('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x9bf5('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x9bf5('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 3b9ebed..656190c 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(_0x3789b5,_0x4c94ff){var _0x3d7215=function(_0x1367a0){while(--_0x1367a0){_0x3789b5['push'](_0x3789b5['shift']());}};_0x3d7215(++_0x4c94ff);}(_0x7a54,0x106));var _0x47a5=function(_0x26f2a6,_0x5d97cb){_0x26f2a6=_0x26f2a6-0x0;var _0x2fd7f6=_0x7a54[_0x26f2a6];return _0x2fd7f6;};'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(_0x54770f,_0x1b8ab3){var _0x2e2230=function(_0x1c6356){while(--_0x1c6356){_0x54770f['push'](_0x54770f['shift']());}};_0x2e2230(++_0x1b8ab3);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 9f34a10..753a589 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 _0x547c=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Condition','tools_conditions'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x547c,0xc0));var _0xc547=function(_0x4e1cba,_0x3bd559){_0x4e1cba=_0x4e1cba-0x0;var _0x340a30=_0x547c[_0x4e1cba];return _0x340a30;};'use strict';var _=require(_0xc547('0x0'));var util=require(_0xc547('0x1'));var logger=require(_0xc547('0x2'))('api');var moment=require(_0xc547('0x3'));var BPromise=require(_0xc547('0x4'));var rp=require(_0xc547('0x5'));var fs=require('fs');var path=require(_0xc547('0x6'));var rimraf=require(_0xc547('0x7'));var config=require(_0xc547('0x8'));var attributes=require('./condition.attributes');module[_0xc547('0x9')]=function(_0x13493e,_0x3c081e){return _0x13493e['define'](_0xc547('0xa'),attributes,{'tableName':_0xc547('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a40=['Condition','tools_conditions','util','api','moment','request-promise','rimraf','../../config/environment','./condition.attributes','exports','define'];(function(_0x2310a3,_0x1c3796){var _0x2442b9=function(_0xd14435){while(--_0xd14435){_0x2310a3['push'](_0x2310a3['shift']());}};_0x2442b9(++_0x1c3796);}(_0x6a40,0x1f1));var _0x06a4=function(_0x3659ba,_0x5ba3cb){_0x3659ba=_0x3659ba-0x0;var _0x301b16=_0x6a40[_0x3659ba];return _0x301b16;};'use strict';var _=require('lodash');var util=require(_0x06a4('0x0'));var logger=require('../../config/logger')(_0x06a4('0x1'));var moment=require(_0x06a4('0x2'));var BPromise=require('bluebird');var rp=require(_0x06a4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06a4('0x4'));var config=require(_0x06a4('0x5'));var attributes=require(_0x06a4('0x6'));module[_0x06a4('0x7')]=function(_0x17d4e1,_0x3b10d0){return _0x17d4e1[_0x06a4('0x8')](_0x06a4('0x9'),attributes,{'tableName':_0x06a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index ff508b8..cd783c0 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 _0x4545=['then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x4a1160,_0x22b485){var _0x2657cd=function(_0x3f07d6){while(--_0x3f07d6){_0x4a1160['push'](_0x4a1160['shift']());}};_0x2657cd(++_0x22b485);}(_0x4545,0x1f0));var _0x5454=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4545[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x5454('0x0'));var moment=require('moment');var BPromise=require(_0x5454('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5454('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5454('0x3'));var logger=require(_0x5454('0x4'))(_0x5454('0x5'));var config=require('../../config/environment');var jayson=require(_0x5454('0x6'));var client=jayson[_0x5454('0x7')][_0x5454('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x217627,_0x19be3d,_0x43ea3c){return new BPromise(function(_0x1c5efb,_0x3d4137){return client[_0x5454('0x9')](_0x217627,_0x43ea3c)[_0x5454('0xa')](function(_0x2cfc1e){logger['info'](_0x5454('0xb'),_0x19be3d,_0x5454('0xc'));logger[_0x5454('0xd')](_0x5454('0xe'),_0x19be3d,_0x5454('0xc'),JSON[_0x5454('0xf')](_0x2cfc1e));if(_0x2cfc1e[_0x5454('0x10')]){if(_0x2cfc1e['error'][_0x5454('0x11')]===0x1f4){logger[_0x5454('0x10')](_0x5454('0xb'),_0x19be3d,_0x2cfc1e['error'][_0x5454('0x12')]);return _0x3d4137(_0x2cfc1e['error'][_0x5454('0x12')]);}logger[_0x5454('0x10')](_0x5454('0xb'),_0x19be3d,_0x2cfc1e[_0x5454('0x10')][_0x5454('0x12')]);return _0x1c5efb(_0x2cfc1e[_0x5454('0x10')][_0x5454('0x12')]);}else{logger[_0x5454('0x13')](_0x5454('0xb'),_0x19be3d,_0x5454('0xc'));_0x1c5efb(_0x2cfc1e[_0x5454('0x14')][_0x5454('0x12')]);}})[_0x5454('0x15')](function(_0x224f4d){logger['error'](_0x5454('0xb'),_0x19be3d,_0x224f4d);_0x3d4137(_0x224f4d);});});} \ No newline at end of file +var _0x97a5=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x6cf5ec,_0x194d2e){var _0x271c4f=function(_0x206fee){while(--_0x206fee){_0x6cf5ec['push'](_0x6cf5ec['shift']());}};_0x271c4f(++_0x194d2e);}(_0x97a5,0x1e6));var _0x597a=function(_0x392b07,_0x1ad240){_0x392b07=_0x392b07-0x0;var _0x15f106=_0x97a5[_0x392b07];return _0x15f106;};'use strict';var _=require(_0x597a('0x0'));var util=require('util');var moment=require(_0x597a('0x1'));var BPromise=require(_0x597a('0x2'));var rs=require(_0x597a('0x3'));var fs=require('fs');var Redis=require(_0x597a('0x4'));var db=require(_0x597a('0x5'))['db'];var utils=require(_0x597a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x597a('0x7'));var jayson=require(_0x597a('0x8'));var client=jayson[_0x597a('0x9')][_0x597a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18b942,_0x59121d,_0x1356de){return new BPromise(function(_0x2946b3,_0x1b5fc0){return client['request'](_0x18b942,_0x1356de)[_0x597a('0xb')](function(_0x46e9ee){logger[_0x597a('0xc')](_0x597a('0xd'),_0x59121d,_0x597a('0xe'));logger[_0x597a('0xf')](_0x597a('0x10'),_0x59121d,_0x597a('0xe'),JSON[_0x597a('0x11')](_0x46e9ee));if(_0x46e9ee[_0x597a('0x12')]){if(_0x46e9ee[_0x597a('0x12')][_0x597a('0x13')]===0x1f4){logger[_0x597a('0x12')](_0x597a('0xd'),_0x59121d,_0x46e9ee[_0x597a('0x12')][_0x597a('0x14')]);return _0x1b5fc0(_0x46e9ee[_0x597a('0x12')]['message']);}logger['error']('Condition,\x20%s,\x20%s',_0x59121d,_0x46e9ee['error'][_0x597a('0x14')]);return _0x2946b3(_0x46e9ee[_0x597a('0x12')][_0x597a('0x14')]);}else{logger['info'](_0x597a('0xd'),_0x59121d,_0x597a('0xe'));_0x2946b3(_0x46e9ee[_0x597a('0x15')][_0x597a('0x14')]);}})[_0x597a('0x16')](function(_0x1284cd){logger[_0x597a('0x12')]('Condition,\x20%s,\x20%s',_0x59121d,_0x1284cd);_0x1b5fc0(_0x1284cd);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a50e742..5d137c5 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 _0x6823=['exports','path','Router','fs-extra','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy'];(function(_0x30fe81,_0x5915d6){var _0xb3947b=function(_0xac59c0){while(--_0xac59c0){_0x30fe81['push'](_0x30fe81['shift']());}};_0xb3947b(++_0x5915d6);}(_0x6823,0x1ed));var _0x3682=function(_0x26497c,_0x4d0d1b){_0x26497c=_0x26497c-0x0;var _0x500422=_0x6823[_0x26497c];return _0x500422;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3682('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3682('0x1')]();var fs_extra=require(_0x3682('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3682('0x3'));var controller=require(_0x3682('0x4'));router[_0x3682('0x5')]('/:id',auth[_0x3682('0x6')](),controller[_0x3682('0x7')]);router[_0x3682('0x8')](_0x3682('0x9'),auth[_0x3682('0x6')](),controller[_0x3682('0xa')]);module[_0x3682('0xb')]=router; \ No newline at end of file +var _0x7ef7=['exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','destroy'];(function(_0x25d408,_0x45b469){var _0x323860=function(_0x484149){while(--_0x484149){_0x25d408['push'](_0x25d408['shift']());}};_0x323860(++_0x45b469);}(_0x7ef7,0x91));var _0x77ef=function(_0x442f45,_0x1f03f0){_0x442f45=_0x442f45-0x0;var _0x50c2ed=_0x7ef7[_0x442f45];return _0x50c2ed;};'use strict';var multer=require('multer');var util=require(_0x77ef('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77ef('0x1'));var router=express['Router']();var fs_extra=require(_0x77ef('0x2'));var auth=require(_0x77ef('0x3'));var interaction=require(_0x77ef('0x4'));var config=require(_0x77ef('0x5'));var controller=require(_0x77ef('0x6'));router[_0x77ef('0x7')](_0x77ef('0x8'),auth[_0x77ef('0x9')](),controller['update']);router['delete']('/:id',auth[_0x77ef('0x9')](),controller[_0x77ef('0xa')]);module[_0x77ef('0xb')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index fe6af16..53161b4 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 _0x4867=['name','INTEGER','STRING','sequelize','exports'];(function(_0x290450,_0x4a2b1f){var _0x23b4f7=function(_0x13602d){while(--_0x13602d){_0x290450['push'](_0x290450['shift']());}};_0x23b4f7(++_0x4a2b1f);}(_0x4867,0xc1));var _0x7486=function(_0x569d04,_0x2aeba8){_0x569d04=_0x569d04-0x0;var _0x23a3ee=_0x4867[_0x569d04];return _0x23a3ee;};'use strict';var Sequelize=require(_0x7486('0x0'));module[_0x7486('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7486('0x2')},'OrderBy':{'type':Sequelize[_0x7486('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7486('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0xd5e6=['name','exports','STRING'];(function(_0xee8dc4,_0x35b4f8){var _0x1edef5=function(_0x4104b0){while(--_0x4104b0){_0xee8dc4['push'](_0xee8dc4['shift']());}};_0x1edef5(++_0x35b4f8);}(_0xd5e6,0x100));var _0x6d5e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xd5e6[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require('sequelize');module[_0x6d5e('0x0')]={'name':{'type':Sequelize[_0x6d5e('0x1')],'allowNull':![],'unique':_0x6d5e('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6d5e('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index c3299b2..25f7ce8 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 _0xbbbc=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','create','body','user','ContactItemTypes','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x15a269,_0x489199){var _0xc9ac3=function(_0x5402eb){while(--_0x5402eb){_0x15a269['push'](_0x15a269['shift']());}};_0xc9ac3(++_0x489199);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x490b05,_0x7f0934){_0x490b05=_0x490b05-0x0;var _0x37ad3c=_0xbbbc[_0x490b05];return _0x37ad3c;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){var _0x4c543a=_0x5e3970[_0xcbbb('0x27')]({'plain':!![]});var _0x4ffa80='ContactItemTypes';return db[_0xcbbb('0x28')][_0xcbbb('0x26')]({'where':{'type':_0x4ffa80,'resourceId':_0x4c543a['id']}})['then'](function(){return _0x5e3970;});})['then'](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x55e1d8,_0x4da775){return function(_0x21e3b1){if(!_0x21e3b1){_0x55e1d8[_0xcbbb('0x18')](0x194);}return _0x21e3b1;};}function handleError(_0x38f1c6,_0x13121e){_0x13121e=_0x13121e||0x1f4;return function(_0x372024){logger[_0xcbbb('0x29')](_0x372024[_0xcbbb('0x2a')]);if(_0x372024[_0xcbbb('0x2b')]){delete _0x372024[_0xcbbb('0x2b')];}_0x38f1c6[_0xcbbb('0x19')](_0x13121e)[_0xcbbb('0x2c')](_0x372024);};}exports[_0xcbbb('0x2d')]=function(_0xfa973b,_0x1ce741){var _0x2a9639={},_0xcae72c={},_0x117739={'count':0x0,'rows':[]};var _0x21c560=_['map'](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')],function(_0x5332f9){return{'name':_0x5332f9[_0xcbbb('0x30')],'type':_0x5332f9['type'][_0xcbbb('0x31')]};});_0xcae72c[_0xcbbb('0x32')]=_[_0xcbbb('0x33')](_0x21c560,'name');_0xcae72c[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0xfa973b[_0xcbbb('0x34')]);_0xcae72c[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],_0xcae72c[_0xcbbb('0x34')]);_0x2a9639[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],qs['fields'](_0xfa973b['query']['fields']));_0x2a9639['attributes']=_0x2a9639[_0xcbbb('0x38')][_0xcbbb('0x39')]?_0x2a9639[_0xcbbb('0x38')]:_0xcae72c[_0xcbbb('0x32')];if(!_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3a')](_0xcbbb('0x3b'))){_0x2a9639[_0xcbbb('0x1f')]=qs[_0xcbbb('0x1f')](_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x1f')]);_0x2a9639[_0xcbbb('0x1c')]=qs['offset'](_0xfa973b['query'][_0xcbbb('0x1c')]);}_0x2a9639['order']=qs['sort'](_0xfa973b['query'][_0xcbbb('0x3c')]);_0x2a9639[_0xcbbb('0x3d')]=qs[_0xcbbb('0x36')](_[_0xcbbb('0x3e')](_0xfa973b[_0xcbbb('0x34')],_0xcae72c[_0xcbbb('0x36')]),_0x21c560);if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]){_0x2a9639[_0xcbbb('0x3d')]=_[_0xcbbb('0x40')](_0x2a9639[_0xcbbb('0x3d')],{'$or':_['map'](_0x21c560,function(_0x21ec4b){if(_0x21ec4b['type']!==_0xcbbb('0x41')){var _0xf5b6f9={};_0xf5b6f9[_0x21ec4b[_0xcbbb('0x2b')]]={'$like':'%'+_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]+'%'};return _0xf5b6f9;}})});}_0x2a9639=_[_0xcbbb('0x40')]({},_0x2a9639,_0xfa973b['options']);var _0x4d31d2={'where':_0x2a9639['where']};return db[_0xcbbb('0x2e')][_0xcbbb('0x1e')](_0x4d31d2)[_0xcbbb('0x25')](function(_0x162979){_0x117739[_0xcbbb('0x1e')]=_0x162979;if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x2a9639['include']=[{'all':!![]}];}return db[_0xcbbb('0x2e')][_0xcbbb('0x43')](_0x2a9639);})['then'](function(_0x15b3bc){_0x117739[_0xcbbb('0x44')]=_0x15b3bc;return _0x117739;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x1ce741,_0x2a9639))[_0xcbbb('0x45')](handleError(_0x1ce741,null));};exports[_0xcbbb('0x46')]=function(_0x50adf5,_0x224682){var _0x58d5cb={'raw':!![],'where':{'id':_0x50adf5[_0xcbbb('0x47')]['id']}},_0x520448={};_0x520448[_0xcbbb('0x32')]=_[_0xcbbb('0x35')](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')]);_0x520448[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0x50adf5[_0xcbbb('0x34')]);_0x520448[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0x520448[_0xcbbb('0x32')],_0x520448[_0xcbbb('0x34')]);_0x58d5cb[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0x520448['model'],qs[_0xcbbb('0x48')](_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x48')]));_0x58d5cb[_0xcbbb('0x38')]=_0x58d5cb['attributes']['length']?_0x58d5cb['attributes']:_0x520448[_0xcbbb('0x32')];if(_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x58d5cb[_0xcbbb('0x49')]=[{'all':!![]}];}_0x58d5cb=_[_0xcbbb('0x40')]({},_0x58d5cb,_0x50adf5[_0xcbbb('0x4a')]);return db[_0xcbbb('0x2e')]['find'](_0x58d5cb)[_0xcbbb('0x25')](handleEntityNotFound(_0x224682,null))[_0xcbbb('0x25')](respondWithResult(_0x224682,null))[_0xcbbb('0x45')](handleError(_0x224682,null));};exports[_0xcbbb('0x4b')]=function(_0x478c22,_0x3378cd){return db[_0xcbbb('0x2e')][_0xcbbb('0x4b')](_0x478c22[_0xcbbb('0x4c')],{})['then'](function(_0x5e0366){var _0x3e1fdc=_0x478c22[_0xcbbb('0x4d')][_0xcbbb('0x27')]({'plain':!![]});if(!_0x3e1fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1fdc['role']==='user'){var _0x189a40=_0x5e0366[_0xcbbb('0x27')]({'plain':!![]});var _0x4b866e=_0xcbbb('0x4e');return db[_0xcbbb('0x4f')][_0xcbbb('0x50')]({'where':{'name':_0x4b866e,'userProfileId':_0x3e1fdc[_0xcbbb('0x51')]},'raw':!![]})['then'](function(_0x33d21c){if(_0x33d21c&&_0x33d21c[_0xcbbb('0x52')]===0x0){return db[_0xcbbb('0x28')][_0xcbbb('0x4b')]({'name':_0x189a40[_0xcbbb('0x2b')],'resourceId':_0x189a40['id'],'type':_0x33d21c[_0xcbbb('0x2b')],'sectionId':_0x33d21c['id']},{})[_0xcbbb('0x25')](function(){return _0x5e0366;});}else{return _0x5e0366;}})[_0xcbbb('0x45')](function(_0x2d3990){logger[_0xcbbb('0x29')](_0xcbbb('0x53'),_0x2d3990);throw _0x2d3990;});}return _0x5e0366;})['then'](respondWithResult(_0x3378cd,0xc9))['catch'](handleError(_0x3378cd,null));};exports[_0xcbbb('0x24')]=function(_0x1eb822,_0x354efc){if(_0x1eb822['body']['id']){delete _0x1eb822[_0xcbbb('0x4c')]['id'];}return db['ContactItemType'][_0xcbbb('0x50')]({'where':{'id':_0x1eb822[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x354efc,null))[_0xcbbb('0x25')](saveUpdates(_0x1eb822[_0xcbbb('0x4c')],null))[_0xcbbb('0x25')](respondWithResult(_0x354efc,null))['catch'](handleError(_0x354efc,null));};exports['destroy']=function(_0x4cc098,_0x370e6d){return db[_0xcbbb('0x2e')][_0xcbbb('0x50')]({'where':{'id':_0x4cc098[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x370e6d,null))[_0xcbbb('0x25')](db[_0xcbbb('0x54')][_0xcbbb('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4cc098[_0xcbbb('0x47')]['id']}}))[_0xcbbb('0x25')](removeEntity(_0x370e6d,null))[_0xcbbb('0x45')](handleError(_0x370e6d,null));}; \ No newline at end of file +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(_0x2f94c0,_0x108c3b){var _0xffecec=function(_0x4da16f){while(--_0x4da16f){_0x2f94c0['push'](_0x2f94c0['shift']());}};_0xffecec(++_0x108c3b);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x55702c,_0x19d820){_0x55702c=_0x55702c-0x0;var _0x4d6132=_0xfcbb[_0x55702c];return _0x4d6132;};'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 diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 46bf29c..e9ab7e2 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 _0x5ff4=['../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0x5ff4,0xa1));var _0x45ff=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5ff4[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x45ff('0x0'));var util=require(_0x45ff('0x1'));var logger=require('../../config/logger')(_0x45ff('0x2'));var moment=require(_0x45ff('0x3'));var BPromise=require('bluebird');var rp=require(_0x45ff('0x4'));var fs=require('fs');var path=require(_0x45ff('0x5'));var rimraf=require(_0x45ff('0x6'));var config=require(_0x45ff('0x7'));var attributes=require(_0x45ff('0x8'));module[_0x45ff('0x9')]=function(_0x54520a,_0xa660fa){return _0x54520a[_0x45ff('0xa')]('ContactItemType',attributes,{'tableName':_0x45ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x816b=['util','../../config/logger','api','request-promise','path','rimraf','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x816b,0xdc));var _0xb816=function(_0x290909,_0x3eb57c){_0x290909=_0x290909-0x0;var _0x41bc0b=_0x816b[_0x290909];return _0x41bc0b;};'use strict';var _=require('lodash');var util=require(_0xb816('0x0'));var logger=require(_0xb816('0x1'))(_0xb816('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb816('0x3'));var fs=require('fs');var path=require(_0xb816('0x4'));var rimraf=require(_0xb816('0x5'));var config=require('../../config/environment');var attributes=require(_0xb816('0x6'));module[_0xb816('0x7')]=function(_0x5b01dc,_0x2c3b3c){return _0x5b01dc[_0xb816('0x8')](_0xb816('0x9'),attributes,{'tableName':_0xb816('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 2f28c28..71e0ac3 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 _0x751f=['ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x179519,_0x560e62){var _0x419168=function(_0x7766fe){while(--_0x7766fe){_0x179519['push'](_0x179519['shift']());}};_0x419168(++_0x560e62);}(_0x751f,0x150));var _0xf751=function(_0x4dee19,_0x266756){_0x4dee19=_0x4dee19-0x0;var _0x4aa923=_0x751f[_0x4dee19];return _0x4aa923;};'use strict';var _=require(_0xf751('0x0'));var util=require(_0xf751('0x1'));var moment=require(_0xf751('0x2'));var BPromise=require(_0xf751('0x3'));var rs=require(_0xf751('0x4'));var fs=require('fs');var Redis=require(_0xf751('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf751('0x6'));var logger=require('../../config/logger')(_0xf751('0x7'));var config=require(_0xf751('0x8'));var jayson=require(_0xf751('0x9'));var client=jayson['client'][_0xf751('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56bc56,_0x2172a6,_0x447ac0){return new BPromise(function(_0x38ff66,_0xe11408){return client['request'](_0x56bc56,_0x447ac0)[_0xf751('0xb')](function(_0x4b8a31){logger[_0xf751('0xc')](_0xf751('0xd'),_0x2172a6,_0xf751('0xe'));logger[_0xf751('0xf')](_0xf751('0x10'),_0x2172a6,'request\x20sent',JSON[_0xf751('0x11')](_0x4b8a31));if(_0x4b8a31['error']){if(_0x4b8a31[_0xf751('0x12')][_0xf751('0x13')]===0x1f4){logger[_0xf751('0x12')](_0xf751('0xd'),_0x2172a6,_0x4b8a31[_0xf751('0x12')][_0xf751('0x14')]);return _0xe11408(_0x4b8a31[_0xf751('0x12')][_0xf751('0x14')]);}logger['error'](_0xf751('0xd'),_0x2172a6,_0x4b8a31[_0xf751('0x12')][_0xf751('0x14')]);return _0x38ff66(_0x4b8a31[_0xf751('0x12')][_0xf751('0x14')]);}else{logger['info'](_0xf751('0xd'),_0x2172a6,'request\x20sent');_0x38ff66(_0x4b8a31['result'][_0xf751('0x14')]);}})[_0xf751('0x15')](function(_0x3d21e4){logger[_0xf751('0x12')](_0xf751('0xd'),_0x2172a6,_0x3d21e4);_0xe11408(_0x3d21e4);});});} \ No newline at end of file +var _0x1646=['info','request\x20sent','debug','stringify','error','ContactItemType,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','request','then'];(function(_0x5e9e76,_0x3cb685){var _0x2bc580=function(_0x5a2bd3){while(--_0x5a2bd3){_0x5e9e76['push'](_0x5e9e76['shift']());}};_0x2bc580(++_0x3cb685);}(_0x1646,0x1bd));var _0x6164=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x1646[_0x2b5b44];return _0x32cb66;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var moment=require(_0x6164('0x2'));var BPromise=require(_0x6164('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6164('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6164('0x5'));var logger=require('../../config/logger')(_0x6164('0x6'));var config=require('../../config/environment');var jayson=require(_0x6164('0x7'));var client=jayson[_0x6164('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45107a,_0x490e94,_0x2048a2){return new BPromise(function(_0x3d6867,_0x23636f){return client[_0x6164('0x9')](_0x45107a,_0x2048a2)[_0x6164('0xa')](function(_0x3ece0b){logger[_0x6164('0xb')]('ContactItemType,\x20%s,\x20%s',_0x490e94,_0x6164('0xc'));logger[_0x6164('0xd')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x490e94,_0x6164('0xc'),JSON[_0x6164('0xe')](_0x3ece0b));if(_0x3ece0b[_0x6164('0xf')]){if(_0x3ece0b[_0x6164('0xf')]['code']===0x1f4){logger[_0x6164('0xf')](_0x6164('0x10'),_0x490e94,_0x3ece0b[_0x6164('0xf')]['message']);return _0x23636f(_0x3ece0b[_0x6164('0xf')][_0x6164('0x11')]);}logger['error'](_0x6164('0x10'),_0x490e94,_0x3ece0b[_0x6164('0xf')]['message']);return _0x3d6867(_0x3ece0b[_0x6164('0xf')]['message']);}else{logger[_0x6164('0xb')](_0x6164('0x10'),_0x490e94,_0x6164('0xc'));_0x3d6867(_0x3ece0b[_0x6164('0x12')][_0x6164('0x11')]);}})['catch'](function(_0x14d729){logger[_0x6164('0xf')](_0x6164('0x10'),_0x490e94,_0x14d729);_0x23636f(_0x14d729);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 9041177..d42e683 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 _0xf92f=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer','path','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf92f,0x11a));var _0xff92=function(_0x136a9f,_0x32f2c9){_0x136a9f=_0x136a9f-0x0;var _0x1471a4=_0xf92f[_0x136a9f];return _0x1471a4;};'use strict';var multer=require(_0xff92('0x0'));var util=require('util');var path=require(_0xff92('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xff92('0x2'));var interaction=require(_0xff92('0x3'));var config=require(_0xff92('0x4'));var controller=require('./contactItemType.controller');router['get']('/',auth[_0xff92('0x5')](),controller[_0xff92('0x6')]);router[_0xff92('0x7')](_0xff92('0x8'),auth['isAuthenticated'](),controller[_0xff92('0x9')]);router[_0xff92('0xa')]('/',auth[_0xff92('0x5')](),controller[_0xff92('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xff92('0xc')]('/:id',auth[_0xff92('0x5')](),controller[_0xff92('0xd')]);module[_0xff92('0xe')]=router; \ No newline at end of file +var _0x703a=['../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x219cc1,_0x3d03b5){var _0x177034=function(_0x45e0fe){while(--_0x45e0fe){_0x219cc1['push'](_0x219cc1['shift']());}};_0x177034(++_0x3d03b5);}(_0x703a,0xab));var _0xa703=function(_0x5b2c85,_0x52e01f){_0x5b2c85=_0x5b2c85-0x0;var _0x1e3134=_0x703a[_0x5b2c85];return _0x1e3134;};'use strict';var multer=require('multer');var util=require(_0xa703('0x0'));var path=require(_0xa703('0x1'));var timeout=require(_0xa703('0x2'));var express=require(_0xa703('0x3'));var router=express['Router']();var fs_extra=require(_0xa703('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa703('0x5'));var controller=require(_0xa703('0x6'));router[_0xa703('0x7')]('/',auth[_0xa703('0x8')](),controller[_0xa703('0x9')]);router[_0xa703('0x7')](_0xa703('0xa'),auth[_0xa703('0x8')](),controller['show']);router[_0xa703('0xb')]('/',auth[_0xa703('0x8')](),controller[_0xa703('0xc')]);router[_0xa703('0xd')]('/:id',auth[_0xa703('0x8')](),controller['update']);router[_0xa703('0xe')](_0xa703('0xa'),auth[_0xa703('0x8')](),controller['destroy']);module[_0xa703('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index cf1dabc..d412b20 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 _0xb10b=['name','sequelize','STRING'];(function(_0x2deba3,_0x1e7675){var _0x2e6ed4=function(_0x2220e1){while(--_0x2220e1){_0x2deba3['push'](_0x2deba3['shift']());}};_0x2e6ed4(++_0x1e7675);}(_0xb10b,0x12a));var _0xbb10=function(_0x211576,_0xcc41af){_0x211576=_0x211576-0x0;var _0x3ce235=_0xb10b[_0x211576];return _0x3ce235;};'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 +var _0xb10b=['name','sequelize','STRING'];(function(_0x1fa586,_0x45aad9){var _0xd0fbd2=function(_0x464743){while(--_0x464743){_0x1fa586['push'](_0x1fa586['shift']());}};_0xd0fbd2(++_0x45aad9);}(_0xb10b,0x12a));var _0xbb10=function(_0xf5fbb7,_0xdb7f69){_0xf5fbb7=_0xf5fbb7-0x0;var _0x330d55=_0xb10b[_0xf5fbb7];return _0x330d55;};'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/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index a96ae68..616b5e9 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 _0xf366=['value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','sendStatus','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','userProfileId','create','error','clone','omit','updatedAt','createdAt','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs'];(function(_0x238f74,_0x15d77f){var _0x31322f=function(_0x1e0860){while(--_0x1e0860){_0x238f74['push'](_0x238f74['shift']());}};_0x31322f(++_0x15d77f);}(_0xf366,0x19f));var _0x6f36=function(_0xf99610,_0x3a21dd){_0xf99610=_0xf99610-0x0;var _0x370f90=_0xf366[_0xf99610];return _0x370f90;};'use strict';var emlformat=require(_0x6f36('0x0'));var rimraf=require(_0x6f36('0x1'));var zipdir=require(_0x6f36('0x2'));var jsonpatch=require(_0x6f36('0x3'));var rp=require(_0x6f36('0x4'));var moment=require('moment');var BPromise=require(_0x6f36('0x5'));var Mustache=require('mustache');var util=require(_0x6f36('0x6'));var path=require(_0x6f36('0x7'));var sox=require(_0x6f36('0x8'));var csv=require(_0x6f36('0x9'));var ejs=require(_0x6f36('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f36('0xb'));var squel=require(_0x6f36('0xc'));var crypto=require(_0x6f36('0xd'));var jsforce=require(_0x6f36('0xe'));var deskjs=require(_0x6f36('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6f36('0x10'));var Papa=require('papaparse');var Redis=require(_0x6f36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6f36('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f36('0x13'))('api');var utils=require(_0x6f36('0x14'));var config=require(_0x6f36('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f36('0x16'))['db'];config[_0x6f36('0x17')]=_[_0x6f36('0x18')](config[_0x6f36('0x17')],{'host':_0x6f36('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f36('0x17')]));require(_0x6f36('0x1a'))[_0x6f36('0x1b')](socket);function respondWithStatusCode(_0x297bed,_0x1bee52){_0x1bee52=_0x1bee52||0xcc;return function(_0x2e926b){if(_0x2e926b){return _0x297bed[_0x6f36('0x1c')](_0x1bee52);}return _0x297bed['status'](_0x1bee52)[_0x6f36('0x1d')]();};}function respondWithResult(_0x21aee3,_0x13f11a){_0x13f11a=_0x13f11a||0xc8;return function(_0x3ff5b4){if(_0x3ff5b4){return _0x21aee3['status'](_0x13f11a)[_0x6f36('0x1e')](_0x3ff5b4);}};}function respondWithFilteredResult(_0x1e2636,_0x4178e0){return function(_0x335e4a){if(_0x335e4a){var _0x60797f=typeof _0x4178e0['offset']===_0x6f36('0x1f')&&typeof _0x4178e0['limit']===_0x6f36('0x1f');var _0x3423ad=_0x335e4a[_0x6f36('0x20')];var _0x39db11=_0x60797f?0x0:_0x4178e0[_0x6f36('0x21')];var _0x11e440=_0x60797f?_0x335e4a[_0x6f36('0x20')]:_0x4178e0[_0x6f36('0x21')]+_0x4178e0[_0x6f36('0x22')];var _0x9115de;if(_0x11e440>=_0x3423ad){_0x11e440=_0x3423ad;_0x9115de=0xc8;}else{_0x9115de=0xce;}_0x1e2636['status'](_0x9115de);return _0x1e2636[_0x6f36('0x23')](_0x6f36('0x24'),_0x39db11+'-'+_0x11e440+'/'+_0x3423ad)[_0x6f36('0x1e')](_0x335e4a);}return null;};}function patchUpdates(_0x34721e){return function(_0x2d9c0c){try{jsonpatch[_0x6f36('0x25')](_0x2d9c0c,_0x34721e,!![]);}catch(_0x124baf){return BPromise[_0x6f36('0x26')](_0x124baf);}return _0x2d9c0c['save']();};}function saveUpdates(_0xedad6e,_0x4303ab){return function(_0x3b121a){if(_0x3b121a){return _0x3b121a[_0x6f36('0x27')](_0xedad6e)[_0x6f36('0x28')](function(_0x193c86){return _0x193c86;});}return null;};}function removeEntity(_0x151ec1,_0x5aa5a4){return function(_0xfa5e3a){if(_0xfa5e3a){return _0xfa5e3a['destroy']()['then'](function(){var _0x42442b=_0xfa5e3a[_0x6f36('0x29')]({'plain':!![]});var _0x14949d='CustomDashboards';return db[_0x6f36('0x2a')][_0x6f36('0x2b')]({'where':{'type':_0x14949d,'resourceId':_0x42442b['id']}})[_0x6f36('0x28')](function(){return _0xfa5e3a;});})['then'](function(){_0x151ec1['status'](0xcc)[_0x6f36('0x1d')]();});}};}function handleEntityNotFound(_0x3b2027,_0x5b2469){return function(_0x25a86a){if(!_0x25a86a){_0x3b2027[_0x6f36('0x1c')](0x194);}return _0x25a86a;};}function handleError(_0x5c497f,_0x583d56){_0x583d56=_0x583d56||0x1f4;return function(_0xd3ec59){logger['error'](_0xd3ec59['stack']);if(_0xd3ec59[_0x6f36('0x2c')]){delete _0xd3ec59[_0x6f36('0x2c')];}_0x5c497f['status'](_0x583d56)[_0x6f36('0x2d')](_0xd3ec59);};}exports[_0x6f36('0x2e')]=function(_0x243cc0,_0xad0f1){var _0xfca848={},_0x5db810={},_0x327465={'count':0x0,'rows':[]};var _0x1ef261=_[_0x6f36('0x2f')](db[_0x6f36('0x30')][_0x6f36('0x31')],function(_0x5dc4f6){return{'name':_0x5dc4f6[_0x6f36('0x32')],'type':_0x5dc4f6[_0x6f36('0x33')][_0x6f36('0x34')]};});_0x5db810[_0x6f36('0x35')]=_['map'](_0x1ef261,_0x6f36('0x2c'));_0x5db810['query']=_[_0x6f36('0x36')](_0x243cc0[_0x6f36('0x37')]);_0x5db810[_0x6f36('0x38')]=_[_0x6f36('0x39')](_0x5db810[_0x6f36('0x35')],_0x5db810[_0x6f36('0x37')]);_0xfca848[_0x6f36('0x3a')]=_[_0x6f36('0x39')](_0x5db810[_0x6f36('0x35')],qs[_0x6f36('0x3b')](_0x243cc0[_0x6f36('0x37')][_0x6f36('0x3b')]));_0xfca848['attributes']=_0xfca848[_0x6f36('0x3a')][_0x6f36('0x3c')]?_0xfca848[_0x6f36('0x3a')]:_0x5db810[_0x6f36('0x35')];if(!_0x243cc0[_0x6f36('0x37')][_0x6f36('0x3d')](_0x6f36('0x3e'))){_0xfca848[_0x6f36('0x22')]=qs[_0x6f36('0x22')](_0x243cc0['query']['limit']);_0xfca848['offset']=qs[_0x6f36('0x21')](_0x243cc0[_0x6f36('0x37')][_0x6f36('0x21')]);}_0xfca848['order']=qs[_0x6f36('0x3f')](_0x243cc0[_0x6f36('0x37')][_0x6f36('0x3f')]);_0xfca848[_0x6f36('0x40')]=qs[_0x6f36('0x38')](_[_0x6f36('0x41')](_0x243cc0[_0x6f36('0x37')],_0x5db810[_0x6f36('0x38')]),_0x1ef261);if(_0x243cc0[_0x6f36('0x37')]['filter']){_0xfca848[_0x6f36('0x40')]=_[_0x6f36('0x42')](_0xfca848['where'],{'$or':_[_0x6f36('0x2f')](_0x1ef261,function(_0x58fd4f){if(_0x58fd4f['type']!=='VIRTUAL'){var _0x5099cc={};_0x5099cc[_0x58fd4f[_0x6f36('0x2c')]]={'$like':'%'+_0x243cc0[_0x6f36('0x37')][_0x6f36('0x43')]+'%'};return _0x5099cc;}})});}_0xfca848=_[_0x6f36('0x42')]({},_0xfca848,_0x243cc0[_0x6f36('0x44')]);var _0x1ee648={'where':_0xfca848[_0x6f36('0x40')]};return db[_0x6f36('0x30')]['count'](_0x1ee648)[_0x6f36('0x28')](function(_0x339075){_0x327465[_0x6f36('0x20')]=_0x339075;if(_0x243cc0[_0x6f36('0x37')][_0x6f36('0x45')]){_0xfca848['include']=[{'all':!![]}];}return db[_0x6f36('0x30')][_0x6f36('0x46')](_0xfca848);})[_0x6f36('0x28')](function(_0x58f651){_0x327465[_0x6f36('0x47')]=_0x58f651;return _0x327465;})[_0x6f36('0x28')](respondWithFilteredResult(_0xad0f1,_0xfca848))[_0x6f36('0x48')](handleError(_0xad0f1,null));};exports['show']=function(_0x3aadb8,_0x3f7e6b){var _0xd5723={'raw':![],'where':{'id':_0x3aadb8[_0x6f36('0x49')]['id']}},_0x231124={};_0x231124[_0x6f36('0x35')]=_[_0x6f36('0x36')](db[_0x6f36('0x30')][_0x6f36('0x31')]);_0x231124[_0x6f36('0x37')]=_[_0x6f36('0x36')](_0x3aadb8[_0x6f36('0x37')]);_0x231124[_0x6f36('0x38')]=_['intersection'](_0x231124['model'],_0x231124['query']);_0xd5723[_0x6f36('0x3a')]=_[_0x6f36('0x39')](_0x231124[_0x6f36('0x35')],qs['fields'](_0x3aadb8['query']['fields']));_0xd5723[_0x6f36('0x3a')]=_0xd5723[_0x6f36('0x3a')][_0x6f36('0x3c')]?_0xd5723[_0x6f36('0x3a')]:_0x231124[_0x6f36('0x35')];if(_0x3aadb8[_0x6f36('0x37')][_0x6f36('0x45')]){_0xd5723[_0x6f36('0x4a')]=[{'all':!![]}];}_0xd5723=_[_0x6f36('0x42')]({},_0xd5723,_0x3aadb8[_0x6f36('0x44')]);return db['Dashboard'][_0x6f36('0x4b')](_0xd5723)[_0x6f36('0x28')](handleEntityNotFound(_0x3f7e6b,null))['then'](respondWithResult(_0x3f7e6b,null))[_0x6f36('0x48')](handleError(_0x3f7e6b,null));};exports['create']=function(_0x2362f7,_0x48735b){return db[_0x6f36('0x30')]['create'](_0x2362f7[_0x6f36('0x4c')],{})[_0x6f36('0x28')](function(_0x5173d1){var _0x3d5eec=_0x2362f7[_0x6f36('0x4d')][_0x6f36('0x29')]({'plain':!![]});if(!_0x3d5eec)throw new Error(_0x6f36('0x4e'));if(_0x3d5eec['role']===_0x6f36('0x4d')){var _0x356802=_0x5173d1[_0x6f36('0x29')]({'plain':!![]});var _0x27da75=_0x6f36('0x4f');return db['UserProfileSection'][_0x6f36('0x4b')]({'where':{'name':_0x27da75,'userProfileId':_0x3d5eec[_0x6f36('0x50')]},'raw':!![]})[_0x6f36('0x28')](function(_0x499840){if(_0x499840&&_0x499840['autoAssociation']===0x0){return db[_0x6f36('0x2a')][_0x6f36('0x51')]({'name':_0x356802[_0x6f36('0x2c')],'resourceId':_0x356802['id'],'type':_0x499840[_0x6f36('0x2c')],'sectionId':_0x499840['id']},{})[_0x6f36('0x28')](function(){return _0x5173d1;});}else{return _0x5173d1;}})[_0x6f36('0x48')](function(_0x319340){logger[_0x6f36('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x319340);throw _0x319340;});}return _0x5173d1;})['then'](respondWithResult(_0x48735b,0xc9))[_0x6f36('0x48')](handleError(_0x48735b,null));};exports[_0x6f36('0x53')]=function(_0x1c7f79,_0x597466){var _0x50122d={'where':{'id':_0x1c7f79[_0x6f36('0x49')]['id']}},_0x3af69b={};_0x3af69b['model']=_[_0x6f36('0x36')](db[_0x6f36('0x30')]['rawAttributes']);_0x50122d[_0x6f36('0x3a')]=_[_0x6f36('0x39')](_0x3af69b[_0x6f36('0x35')],qs[_0x6f36('0x3b')](_0x1c7f79['query'][_0x6f36('0x3b')]));_0x50122d[_0x6f36('0x3a')]=_0x50122d[_0x6f36('0x3a')][_0x6f36('0x3c')]?_0x50122d[_0x6f36('0x3a')]:_0x3af69b[_0x6f36('0x35')];if(_0x1c7f79[_0x6f36('0x37')]['includeAll']){_0x50122d[_0x6f36('0x4a')]=[{'all':!![]}];}_0x50122d=_[_0x6f36('0x42')]({},_0x50122d,_0x1c7f79[_0x6f36('0x44')]);return db['Dashboard'][_0x6f36('0x4b')](_0x50122d)[_0x6f36('0x28')](handleEntityNotFound(_0x597466,null))['then'](function(_0x4a8ab4){if(_0x4a8ab4){var _0x5762ff=_0x4a8ab4[_0x6f36('0x29')]({'plain':!![]});_0x5762ff=qs[_0x6f36('0x54')](_0x5762ff,['id','createdAt',_0x6f36('0x55')]);_0x1c7f79['body']=_['omit'](_0x1c7f79[_0x6f36('0x4c')],['id',_0x6f36('0x56'),_0x6f36('0x55')]);return db[_0x6f36('0x30')][_0x6f36('0x51')](_[_0x6f36('0x42')](_0x5762ff,_0x1c7f79[_0x6f36('0x4c')]),{'include':_0x1c7f79[_0x6f36('0x37')][_0x6f36('0x45')]?[{'all':!![]}]:undefined})[_0x6f36('0x28')](function(_0x39abae){var _0x2cac28=_0x1c7f79[_0x6f36('0x4d')][_0x6f36('0x29')]({'plain':!![]});if(!_0x2cac28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cac28[_0x6f36('0x57')]===_0x6f36('0x4d')){var _0x5de250=_0x39abae[_0x6f36('0x29')]({'plain':!![]});var _0x4d4a11=_0x6f36('0x4f');return db[_0x6f36('0x58')][_0x6f36('0x4b')]({'where':{'name':_0x4d4a11,'userProfileId':_0x2cac28[_0x6f36('0x50')]},'raw':!![]})['then'](function(_0x3ae812){if(_0x3ae812&&_0x3ae812['autoAssociation']===0x0){return db[_0x6f36('0x2a')][_0x6f36('0x51')]({'name':_0x5de250[_0x6f36('0x2c')],'resourceId':_0x5de250['id'],'type':_0x3ae812[_0x6f36('0x2c')],'sectionId':_0x3ae812['id']},{})[_0x6f36('0x28')](function(){return _0x39abae;});}else{return _0x39abae;}})[_0x6f36('0x48')](function(_0x30b20a){logger[_0x6f36('0x52')](_0x6f36('0x59'),_0x30b20a);throw _0x30b20a;});}return _0x39abae;});}})['then'](respondWithResult(_0x597466,0xc9))[_0x6f36('0x48')](handleError(_0x597466,null));};exports[_0x6f36('0x27')]=function(_0x22867a,_0x3841e0){if(_0x22867a['body']['id']){delete _0x22867a[_0x6f36('0x4c')]['id'];}return db[_0x6f36('0x30')]['find']({'where':{'id':_0x22867a[_0x6f36('0x49')]['id']}})[_0x6f36('0x28')](handleEntityNotFound(_0x3841e0,null))[_0x6f36('0x28')](saveUpdates(_0x22867a[_0x6f36('0x4c')],null))[_0x6f36('0x28')](respondWithResult(_0x3841e0,null))['catch'](handleError(_0x3841e0,null));};exports[_0x6f36('0x2b')]=function(_0x5f07e9,_0x356c35){return db[_0x6f36('0x30')][_0x6f36('0x4b')]({'where':{'id':_0x5f07e9[_0x6f36('0x49')]['id']}})[_0x6f36('0x28')](handleEntityNotFound(_0x356c35,null))['then'](removeEntity(_0x356c35,null))[_0x6f36('0x48')](handleError(_0x356c35,null));};function widgetAttributes(_0x381cd9){try{switch(_0x381cd9[_0x6f36('0x33')]){case _0x6f36('0x5a'):return[{'name':_0x6f36('0x5b'),'value':_0x381cd9[_0x6f36('0x5b')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x0]?_0x381cd9[_0x6f36('0x5c')][0x0][_0x6f36('0x5d')]:undefined)||_0x6f36('0x5e')}];case _0x6f36('0x5f'):return[{'name':_0x6f36('0x60'),'value':_0x381cd9[_0x6f36('0x60')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x0]?_0x381cd9[_0x6f36('0x5c')][0x0][_0x6f36('0x5d')]:undefined)||''}];case _0x6f36('0x61'):return[{'name':'attrHourFormat','value':_0x381cd9[_0x6f36('0x62')]||(_0x381cd9['attrs']&&_0x381cd9[_0x6f36('0x5c')][0x0]?_0x381cd9[_0x6f36('0x5c')][0x0][_0x6f36('0x5d')]:undefined)||'HH:mm:ss'},{'name':_0x6f36('0x63'),'value':_0x381cd9[_0x6f36('0x63')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x1]?_0x381cd9[_0x6f36('0x5c')][0x1][_0x6f36('0x5d')]:undefined)||_0x6f36('0x64')},{'name':_0x6f36('0x65'),'value':_0x381cd9[_0x6f36('0x65')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x2]?_0x381cd9[_0x6f36('0x5c')][0x2][_0x6f36('0x5d')]:undefined)||0xc}];case _0x6f36('0x66'):return[{'name':_0x6f36('0x67'),'value':_0x381cd9[_0x6f36('0x67')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9['attrs'][0x0]?_0x381cd9[_0x6f36('0x5c')][0x0][_0x6f36('0x5d')]:undefined)||_0x6f36('0x68')},{'name':_0x6f36('0x69'),'value':_0x381cd9[_0x6f36('0x69')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x1]?_0x381cd9[_0x6f36('0x5c')][0x1][_0x6f36('0x5d')]:undefined)||[]},{'name':_0x6f36('0x65'),'value':_0x381cd9[_0x6f36('0x65')]||(_0x381cd9['attrs']&&_0x381cd9['attrs'][0x2]?_0x381cd9[_0x6f36('0x5c')][0x2][_0x6f36('0x5d')]:undefined)||0x14},{'name':_0x6f36('0x6a'),'value':_0x381cd9['attrChannel']||(_0x381cd9['attrs']&&_0x381cd9[_0x6f36('0x5c')][0x3]?_0x381cd9[_0x6f36('0x5c')][0x3][_0x6f36('0x5d')]:undefined)||_0x6f36('0x6b')},{'name':_0x6f36('0x6c'),'value':_0x381cd9[_0x6f36('0x6c')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x4]?_0x381cd9['attrs'][0x4][_0x6f36('0x5d')]:undefined)||''},{'name':_0x6f36('0x6d'),'value':_0x381cd9[_0x6f36('0x6d')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x5]?_0x381cd9[_0x6f36('0x5c')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x381cd9['attrSmsAccounts']||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x6]?_0x381cd9['attrs'][0x6][_0x6f36('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x381cd9[_0x6f36('0x6e')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9['attrs'][0x7]?_0x381cd9[_0x6f36('0x5c')][0x7][_0x6f36('0x5d')]:undefined)||''},{'name':_0x6f36('0x6f'),'value':_0x381cd9[_0x6f36('0x6f')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9['attrs'][0x8]?_0x381cd9['attrs'][0x8][_0x6f36('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x381cd9[_0x6f36('0x70')]||(_0x381cd9['attrs']&&_0x381cd9['attrs'][0x9]?_0x381cd9['attrs'][0x9][_0x6f36('0x5d')]:undefined)||''}];case _0x6f36('0x71'):case _0x6f36('0x72'):return[{'name':_0x6f36('0x73'),'value':_0x381cd9[_0x6f36('0x73')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x0]?_0x381cd9['attrs'][0x0]['value']:undefined)||_0x6f36('0x68')},{'name':_0x6f36('0x74'),'value':_0x381cd9[_0x6f36('0x74')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x1]?_0x381cd9['attrs'][0x1]['value']:undefined)||null},{'name':_0x6f36('0x75'),'value':_0x381cd9[_0x6f36('0x75')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x2]?_0x381cd9[_0x6f36('0x5c')][0x2][_0x6f36('0x5d')]:undefined)||null},{'name':_0x6f36('0x69'),'value':_0x381cd9[_0x6f36('0x69')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x3]?_0x381cd9['attrs'][0x3][_0x6f36('0x5d')]:undefined)||[]},{'name':'attrChannel','value':_0x381cd9['attrChannel']||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x4]?_0x381cd9[_0x6f36('0x5c')][0x4][_0x6f36('0x5d')]:undefined)||'voice'},{'name':_0x6f36('0x6c'),'value':_0x381cd9[_0x6f36('0x6c')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x5]?_0x381cd9[_0x6f36('0x5c')][0x5][_0x6f36('0x5d')]:undefined)||''},{'name':_0x6f36('0x6d'),'value':_0x381cd9[_0x6f36('0x6d')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x6]?_0x381cd9[_0x6f36('0x5c')][0x6]['value']:undefined)||''},{'name':_0x6f36('0x76'),'value':_0x381cd9['attrSmsAccounts']||(_0x381cd9['attrs']&&_0x381cd9[_0x6f36('0x5c')][0x7]?_0x381cd9[_0x6f36('0x5c')][0x7][_0x6f36('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x381cd9[_0x6f36('0x6e')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x8]?_0x381cd9['attrs'][0x8][_0x6f36('0x5d')]:undefined)||''},{'name':_0x6f36('0x6f'),'value':_0x381cd9['attrWhatsappAccounts']||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9[_0x6f36('0x5c')][0x9]?_0x381cd9[_0x6f36('0x5c')][0x9][_0x6f36('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x381cd9[_0x6f36('0x70')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9['attrs'][0xa]?_0x381cd9[_0x6f36('0x5c')][0xa]['value']:undefined)||''}];case _0x6f36('0x77'):return[{'name':_0x6f36('0x78'),'type':_0x381cd9['reportType']||(_0x381cd9['attrs']&&_0x381cd9['attrs'][0x0]?_0x381cd9['attrs'][0x0][_0x6f36('0x33')]:undefined)||null,'value':_0x381cd9[_0x6f36('0x78')]||(_0x381cd9[_0x6f36('0x5c')]&&_0x381cd9['attrs'][0x0]?_0x381cd9['attrs'][0x0][_0x6f36('0x5d')]:undefined)||null},{'name':_0x6f36('0x79'),'value':_0x381cd9[_0x6f36('0x79')]||(_0x381cd9['attrs']&&_0x381cd9['attrs'][0x1]?_0x381cd9[_0x6f36('0x5c')][0x1][_0x6f36('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x402978){logger[_0x6f36('0x52')](_0x6f36('0x7a'),JSON['stringify'](_0x402978));return[];}}exports[_0x6f36('0x7b')]=function(_0x18cef8,_0x3e2128,_0x55d124){if(_0x18cef8[_0x6f36('0x4c')]['id']){delete _0x18cef8[_0x6f36('0x4c')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x18cef8[_0x6f36('0x49')]['id']}})[_0x6f36('0x28')](handleEntityNotFound(_0x3e2128,null))[_0x6f36('0x28')](function(_0x237349){if(_0x237349){_0x18cef8[_0x6f36('0x4c')]['DashboardId']=_0x237349['id'];_0x18cef8[_0x6f36('0x4c')][_0x6f36('0x5c')]=widgetAttributes(_0x18cef8['body']);return db[_0x6f36('0x7c')][_0x6f36('0x51')](_0x18cef8['body']);}})[_0x6f36('0x28')](respondWithResult(_0x3e2128,null))[_0x6f36('0x48')](handleError(_0x3e2128,null));};exports[_0x6f36('0x7d')]=function(_0x2965b1,_0x36b105,_0x4e6a88){var _0x2314e7={};var _0x19a5fc={};var _0x3a93a4;var _0x3bbf38;return db['Dashboard']['findOne']({'where':{'id':_0x2965b1['params']['id']}})[_0x6f36('0x28')](handleEntityNotFound(_0x36b105,null))[_0x6f36('0x28')](function(_0x4c3734){if(_0x4c3734){_0x3a93a4=_0x4c3734;_0x19a5fc['model']=_[_0x6f36('0x36')](db[_0x6f36('0x7c')][_0x6f36('0x31')]);_0x19a5fc[_0x6f36('0x37')]=_[_0x6f36('0x36')](_0x2965b1[_0x6f36('0x37')]);_0x19a5fc[_0x6f36('0x38')]=_[_0x6f36('0x39')](_0x19a5fc[_0x6f36('0x35')],_0x19a5fc['query']);_0x2314e7[_0x6f36('0x3a')]=_[_0x6f36('0x39')](_0x19a5fc['model'],qs[_0x6f36('0x3b')](_0x2965b1['query'][_0x6f36('0x3b')]));_0x2314e7[_0x6f36('0x3a')]=_0x2314e7['attributes'][_0x6f36('0x3c')]?_0x2314e7[_0x6f36('0x3a')]:_0x19a5fc[_0x6f36('0x35')];_0x2314e7[_0x6f36('0x7e')]=qs[_0x6f36('0x3f')](_0x2965b1['query']['sort']);_0x2314e7[_0x6f36('0x40')]=qs[_0x6f36('0x38')](_[_0x6f36('0x41')](_0x2965b1['query'],_0x19a5fc[_0x6f36('0x38')]));if(_0x2965b1[_0x6f36('0x37')][_0x6f36('0x43')]){_0x2314e7[_0x6f36('0x40')]=_[_0x6f36('0x42')](_0x2314e7[_0x6f36('0x40')],{'$or':_[_0x6f36('0x2f')](_0x2314e7['attributes'],function(_0x4e818e){var _0x89bdfe={};_0x89bdfe[_0x4e818e]={'$like':'%'+_0x2965b1['query'][_0x6f36('0x43')]+'%'};return _0x89bdfe;})});}_0x2314e7=_['merge']({},_0x2314e7,_0x2965b1[_0x6f36('0x44')]);return _0x3a93a4[_0x6f36('0x7d')](_0x2314e7);}})[_0x6f36('0x28')](function(_0xc7501d){if(_0xc7501d){_0x3bbf38=_0xc7501d[_0x6f36('0x3c')];if(!_0x2965b1[_0x6f36('0x37')][_0x6f36('0x3d')](_0x6f36('0x3e'))){_0x2314e7[_0x6f36('0x22')]=qs[_0x6f36('0x22')](_0x2965b1[_0x6f36('0x37')][_0x6f36('0x22')]);_0x2314e7[_0x6f36('0x21')]=qs[_0x6f36('0x21')](_0x2965b1['query'][_0x6f36('0x21')]);}return _0x3a93a4[_0x6f36('0x7d')](_0x2314e7);}})[_0x6f36('0x28')](function(_0x5bb1f0){if(_0x5bb1f0){return _0x5bb1f0?{'count':_0x3bbf38,'rows':_0x5bb1f0}:null;}})[_0x6f36('0x28')](respondWithResult(_0x36b105,null))[_0x6f36('0x48')](handleError(_0x36b105,null));}; \ No newline at end of file +var _0xddd8=['../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','rows','show','params','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','omit','createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x55cb93,_0x299bc8){var _0x46fb5b=function(_0x462222){while(--_0x462222){_0x55cb93['push'](_0x55cb93['shift']());}};_0x46fb5b(++_0x299bc8);}(_0xddd8,0x6e));var _0x8ddd=function(_0x47c884,_0x365742){_0x47c884=_0x47c884-0x0;var _0x32210c=_0xddd8[_0x47c884];return _0x32210c;};'use strict';var emlformat=require(_0x8ddd('0x0'));var rimraf=require(_0x8ddd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ddd('0x2'));var moment=require(_0x8ddd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8ddd('0x4'));var util=require(_0x8ddd('0x5'));var path=require(_0x8ddd('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8ddd('0x7'));var fs=require('fs');var fs_extra=require(_0x8ddd('0x8'));var _=require(_0x8ddd('0x9'));var squel=require(_0x8ddd('0xa'));var crypto=require(_0x8ddd('0xb'));var jsforce=require(_0x8ddd('0xc'));var deskjs=require(_0x8ddd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8ddd('0xe'));var Papa=require('papaparse');var Redis=require(_0x8ddd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ddd('0x10'));var logger=require(_0x8ddd('0x11'))(_0x8ddd('0x12'));var utils=require(_0x8ddd('0x13'));var config=require(_0x8ddd('0x14'));var licenseUtil=require(_0x8ddd('0x15'));var db=require('../../mysqldb')['db'];config[_0x8ddd('0x16')]=_[_0x8ddd('0x17')](config[_0x8ddd('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ddd('0x18'))(new Redis(config['redis']));require('./dashboard.socket')[_0x8ddd('0x19')](socket);function respondWithStatusCode(_0x4d23f7,_0x30fd65){_0x30fd65=_0x30fd65||0xcc;return function(_0x3910a0){if(_0x3910a0){return _0x4d23f7['sendStatus'](_0x30fd65);}return _0x4d23f7[_0x8ddd('0x1a')](_0x30fd65)['end']();};}function respondWithResult(_0x5a59d3,_0x36998b){_0x36998b=_0x36998b||0xc8;return function(_0x24f186){if(_0x24f186){return _0x5a59d3[_0x8ddd('0x1a')](_0x36998b)[_0x8ddd('0x1b')](_0x24f186);}};}function respondWithFilteredResult(_0x58f75c,_0x15de24){return function(_0x3703c7){if(_0x3703c7){var _0x3e18a2=typeof _0x15de24[_0x8ddd('0x1c')]===_0x8ddd('0x1d')&&typeof _0x15de24['limit']==='undefined';var _0x3fa32e=_0x3703c7[_0x8ddd('0x1e')];var _0x496199=_0x3e18a2?0x0:_0x15de24[_0x8ddd('0x1c')];var _0x202c9a=_0x3e18a2?_0x3703c7[_0x8ddd('0x1e')]:_0x15de24[_0x8ddd('0x1c')]+_0x15de24[_0x8ddd('0x1f')];var _0x27e136;if(_0x202c9a>=_0x3fa32e){_0x202c9a=_0x3fa32e;_0x27e136=0xc8;}else{_0x27e136=0xce;}_0x58f75c[_0x8ddd('0x1a')](_0x27e136);return _0x58f75c[_0x8ddd('0x20')](_0x8ddd('0x21'),_0x496199+'-'+_0x202c9a+'/'+_0x3fa32e)[_0x8ddd('0x1b')](_0x3703c7);}return null;};}function patchUpdates(_0x23f576){return function(_0x243a3d){try{jsonpatch[_0x8ddd('0x22')](_0x243a3d,_0x23f576,!![]);}catch(_0x5cae1e){return BPromise[_0x8ddd('0x23')](_0x5cae1e);}return _0x243a3d[_0x8ddd('0x24')]();};}function saveUpdates(_0x185ef6,_0x200b44){return function(_0x5c0a85){if(_0x5c0a85){return _0x5c0a85[_0x8ddd('0x25')](_0x185ef6)[_0x8ddd('0x26')](function(_0x5c058d){return _0x5c058d;});}return null;};}function removeEntity(_0x4c435b,_0x49306f){return function(_0x48552c){if(_0x48552c){return _0x48552c[_0x8ddd('0x27')]()[_0x8ddd('0x26')](function(){var _0x43f143=_0x48552c['get']({'plain':!![]});var _0x4f61d4=_0x8ddd('0x28');return db[_0x8ddd('0x29')][_0x8ddd('0x27')]({'where':{'type':_0x4f61d4,'resourceId':_0x43f143['id']}})['then'](function(){return _0x48552c;});})[_0x8ddd('0x26')](function(){_0x4c435b['status'](0xcc)[_0x8ddd('0x2a')]();});}};}function handleEntityNotFound(_0x24f909,_0x4b47e6){return function(_0x468c78){if(!_0x468c78){_0x24f909[_0x8ddd('0x2b')](0x194);}return _0x468c78;};}function handleError(_0x4a77ee,_0x12e8b6){_0x12e8b6=_0x12e8b6||0x1f4;return function(_0x74d8bb){logger[_0x8ddd('0x2c')](_0x74d8bb[_0x8ddd('0x2d')]);if(_0x74d8bb[_0x8ddd('0x2e')]){delete _0x74d8bb[_0x8ddd('0x2e')];}_0x4a77ee[_0x8ddd('0x1a')](_0x12e8b6)[_0x8ddd('0x2f')](_0x74d8bb);};}exports['index']=function(_0xd6e5a6,_0x47a8ba){var _0x2a052c={},_0x11602e={},_0x580e20={'count':0x0,'rows':[]};var _0x3a1f65=_[_0x8ddd('0x30')](db['Dashboard'][_0x8ddd('0x31')],function(_0x5affa0){return{'name':_0x5affa0[_0x8ddd('0x32')],'type':_0x5affa0[_0x8ddd('0x33')][_0x8ddd('0x34')]};});_0x11602e[_0x8ddd('0x35')]=_[_0x8ddd('0x30')](_0x3a1f65,_0x8ddd('0x2e'));_0x11602e['query']=_[_0x8ddd('0x36')](_0xd6e5a6[_0x8ddd('0x37')]);_0x11602e[_0x8ddd('0x38')]=_[_0x8ddd('0x39')](_0x11602e[_0x8ddd('0x35')],_0x11602e[_0x8ddd('0x37')]);_0x2a052c[_0x8ddd('0x3a')]=_[_0x8ddd('0x39')](_0x11602e[_0x8ddd('0x35')],qs['fields'](_0xd6e5a6['query']['fields']));_0x2a052c['attributes']=_0x2a052c[_0x8ddd('0x3a')][_0x8ddd('0x3b')]?_0x2a052c[_0x8ddd('0x3a')]:_0x11602e[_0x8ddd('0x35')];if(!_0xd6e5a6[_0x8ddd('0x37')][_0x8ddd('0x3c')](_0x8ddd('0x3d'))){_0x2a052c[_0x8ddd('0x1f')]=qs[_0x8ddd('0x1f')](_0xd6e5a6[_0x8ddd('0x37')][_0x8ddd('0x1f')]);_0x2a052c[_0x8ddd('0x1c')]=qs[_0x8ddd('0x1c')](_0xd6e5a6[_0x8ddd('0x37')]['offset']);}_0x2a052c[_0x8ddd('0x3e')]=qs[_0x8ddd('0x3f')](_0xd6e5a6[_0x8ddd('0x37')]['sort']);_0x2a052c[_0x8ddd('0x40')]=qs[_0x8ddd('0x38')](_[_0x8ddd('0x41')](_0xd6e5a6[_0x8ddd('0x37')],_0x11602e[_0x8ddd('0x38')]),_0x3a1f65);if(_0xd6e5a6['query'][_0x8ddd('0x42')]){_0x2a052c[_0x8ddd('0x40')]=_[_0x8ddd('0x43')](_0x2a052c['where'],{'$or':_[_0x8ddd('0x30')](_0x3a1f65,function(_0xdf2bd4){if(_0xdf2bd4[_0x8ddd('0x33')]!==_0x8ddd('0x44')){var _0x51eddd={};_0x51eddd[_0xdf2bd4[_0x8ddd('0x2e')]]={'$like':'%'+_0xd6e5a6['query'][_0x8ddd('0x42')]+'%'};return _0x51eddd;}})});}_0x2a052c=_[_0x8ddd('0x43')]({},_0x2a052c,_0xd6e5a6[_0x8ddd('0x45')]);var _0xe0df48={'where':_0x2a052c[_0x8ddd('0x40')]};return db[_0x8ddd('0x46')]['count'](_0xe0df48)['then'](function(_0x2c3d85){_0x580e20[_0x8ddd('0x1e')]=_0x2c3d85;if(_0xd6e5a6['query'][_0x8ddd('0x47')]){_0x2a052c[_0x8ddd('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0x8ddd('0x49')](_0x2a052c);})['then'](function(_0x20eb2c){_0x580e20[_0x8ddd('0x4a')]=_0x20eb2c;return _0x580e20;})[_0x8ddd('0x26')](respondWithFilteredResult(_0x47a8ba,_0x2a052c))['catch'](handleError(_0x47a8ba,null));};exports[_0x8ddd('0x4b')]=function(_0x49266d,_0x28843e){var _0x37bedc={'raw':![],'where':{'id':_0x49266d[_0x8ddd('0x4c')]['id']}},_0x4b4346={};_0x4b4346[_0x8ddd('0x35')]=_[_0x8ddd('0x36')](db[_0x8ddd('0x46')][_0x8ddd('0x31')]);_0x4b4346['query']=_[_0x8ddd('0x36')](_0x49266d[_0x8ddd('0x37')]);_0x4b4346[_0x8ddd('0x38')]=_[_0x8ddd('0x39')](_0x4b4346['model'],_0x4b4346[_0x8ddd('0x37')]);_0x37bedc[_0x8ddd('0x3a')]=_[_0x8ddd('0x39')](_0x4b4346[_0x8ddd('0x35')],qs[_0x8ddd('0x4d')](_0x49266d[_0x8ddd('0x37')][_0x8ddd('0x4d')]));_0x37bedc[_0x8ddd('0x3a')]=_0x37bedc[_0x8ddd('0x3a')]['length']?_0x37bedc[_0x8ddd('0x3a')]:_0x4b4346[_0x8ddd('0x35')];if(_0x49266d[_0x8ddd('0x37')][_0x8ddd('0x47')]){_0x37bedc[_0x8ddd('0x48')]=[{'all':!![]}];}_0x37bedc=_[_0x8ddd('0x43')]({},_0x37bedc,_0x49266d['options']);return db[_0x8ddd('0x46')][_0x8ddd('0x4e')](_0x37bedc)[_0x8ddd('0x26')](handleEntityNotFound(_0x28843e,null))[_0x8ddd('0x26')](respondWithResult(_0x28843e,null))['catch'](handleError(_0x28843e,null));};exports[_0x8ddd('0x4f')]=function(_0x42f498,_0x77995b){return db['Dashboard']['create'](_0x42f498[_0x8ddd('0x50')],{})['then'](function(_0x4b8c06){var _0x4b2788=_0x42f498[_0x8ddd('0x51')][_0x8ddd('0x52')]({'plain':!![]});if(!_0x4b2788)throw new Error(_0x8ddd('0x53'));if(_0x4b2788[_0x8ddd('0x54')]==='user'){var _0x32dcf5=_0x4b8c06[_0x8ddd('0x52')]({'plain':!![]});var _0x164183=_0x8ddd('0x28');return db[_0x8ddd('0x55')][_0x8ddd('0x4e')]({'where':{'name':_0x164183,'userProfileId':_0x4b2788['userProfileId']},'raw':!![]})['then'](function(_0x30c243){if(_0x30c243&&_0x30c243[_0x8ddd('0x56')]===0x0){return db['UserProfileResource'][_0x8ddd('0x4f')]({'name':_0x32dcf5[_0x8ddd('0x2e')],'resourceId':_0x32dcf5['id'],'type':_0x30c243[_0x8ddd('0x2e')],'sectionId':_0x30c243['id']},{})[_0x8ddd('0x26')](function(){return _0x4b8c06;});}else{return _0x4b8c06;}})['catch'](function(_0xe79513){logger[_0x8ddd('0x2c')](_0x8ddd('0x57'),_0xe79513);throw _0xe79513;});}return _0x4b8c06;})[_0x8ddd('0x26')](respondWithResult(_0x77995b,0xc9))[_0x8ddd('0x58')](handleError(_0x77995b,null));};exports['clone']=function(_0x2b77b9,_0x3e872f){var _0x1a130f={'where':{'id':_0x2b77b9[_0x8ddd('0x4c')]['id']}},_0x46e5ff={};_0x46e5ff[_0x8ddd('0x35')]=_[_0x8ddd('0x36')](db['Dashboard'][_0x8ddd('0x31')]);_0x1a130f[_0x8ddd('0x3a')]=_[_0x8ddd('0x39')](_0x46e5ff[_0x8ddd('0x35')],qs[_0x8ddd('0x4d')](_0x2b77b9['query']['fields']));_0x1a130f[_0x8ddd('0x3a')]=_0x1a130f[_0x8ddd('0x3a')][_0x8ddd('0x3b')]?_0x1a130f[_0x8ddd('0x3a')]:_0x46e5ff['model'];if(_0x2b77b9[_0x8ddd('0x37')]['includeAll']){_0x1a130f[_0x8ddd('0x48')]=[{'all':!![]}];}_0x1a130f=_[_0x8ddd('0x43')]({},_0x1a130f,_0x2b77b9[_0x8ddd('0x45')]);return db[_0x8ddd('0x46')]['find'](_0x1a130f)[_0x8ddd('0x26')](handleEntityNotFound(_0x3e872f,null))[_0x8ddd('0x26')](function(_0x23b217){if(_0x23b217){var _0x71528=_0x23b217[_0x8ddd('0x52')]({'plain':!![]});_0x71528=qs[_0x8ddd('0x59')](_0x71528,['id',_0x8ddd('0x5a'),'updatedAt']);_0x2b77b9['body']=_[_0x8ddd('0x59')](_0x2b77b9[_0x8ddd('0x50')],['id','createdAt',_0x8ddd('0x5b')]);return db[_0x8ddd('0x46')][_0x8ddd('0x4f')](_['merge'](_0x71528,_0x2b77b9[_0x8ddd('0x50')]),{'include':_0x2b77b9['query'][_0x8ddd('0x47')]?[{'all':!![]}]:undefined})[_0x8ddd('0x26')](function(_0x4f894b){var _0x543c70=_0x2b77b9[_0x8ddd('0x51')]['get']({'plain':!![]});if(!_0x543c70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x543c70[_0x8ddd('0x54')]===_0x8ddd('0x51')){var _0x219258=_0x4f894b[_0x8ddd('0x52')]({'plain':!![]});var _0x51b005=_0x8ddd('0x28');return db[_0x8ddd('0x55')]['find']({'where':{'name':_0x51b005,'userProfileId':_0x543c70[_0x8ddd('0x5c')]},'raw':!![]})[_0x8ddd('0x26')](function(_0x3f7583){if(_0x3f7583&&_0x3f7583[_0x8ddd('0x56')]===0x0){return db[_0x8ddd('0x29')][_0x8ddd('0x4f')]({'name':_0x219258[_0x8ddd('0x2e')],'resourceId':_0x219258['id'],'type':_0x3f7583[_0x8ddd('0x2e')],'sectionId':_0x3f7583['id']},{})['then'](function(){return _0x4f894b;});}else{return _0x4f894b;}})['catch'](function(_0x9bd115){logger[_0x8ddd('0x2c')](_0x8ddd('0x57'),_0x9bd115);throw _0x9bd115;});}return _0x4f894b;});}})[_0x8ddd('0x26')](respondWithResult(_0x3e872f,0xc9))[_0x8ddd('0x58')](handleError(_0x3e872f,null));};exports[_0x8ddd('0x25')]=function(_0x106e35,_0x3be3f8){if(_0x106e35['body']['id']){delete _0x106e35[_0x8ddd('0x50')]['id'];}return db[_0x8ddd('0x46')][_0x8ddd('0x4e')]({'where':{'id':_0x106e35['params']['id']}})['then'](handleEntityNotFound(_0x3be3f8,null))[_0x8ddd('0x26')](saveUpdates(_0x106e35[_0x8ddd('0x50')],null))['then'](respondWithResult(_0x3be3f8,null))[_0x8ddd('0x58')](handleError(_0x3be3f8,null));};exports[_0x8ddd('0x27')]=function(_0x9fcc8e,_0x418cd1){return db[_0x8ddd('0x46')][_0x8ddd('0x4e')]({'where':{'id':_0x9fcc8e[_0x8ddd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x418cd1,null))['then'](removeEntity(_0x418cd1,null))[_0x8ddd('0x58')](handleError(_0x418cd1,null));};function widgetAttributes(_0x25226b){try{switch(_0x25226b[_0x8ddd('0x33')]){case _0x8ddd('0x5d'):return[{'name':_0x8ddd('0x5e'),'value':_0x25226b[_0x8ddd('0x5e')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b['attrs'][0x0]?_0x25226b[_0x8ddd('0x5f')][0x0]['value']:undefined)||_0x8ddd('0x60')}];case _0x8ddd('0x61'):return[{'name':_0x8ddd('0x62'),'value':_0x25226b[_0x8ddd('0x62')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x0]?_0x25226b[_0x8ddd('0x5f')][0x0][_0x8ddd('0x63')]:undefined)||''}];case'clock':return[{'name':_0x8ddd('0x64'),'value':_0x25226b[_0x8ddd('0x64')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x0]?_0x25226b['attrs'][0x0][_0x8ddd('0x63')]:undefined)||_0x8ddd('0x65')},{'name':'attrTimezone','value':_0x25226b[_0x8ddd('0x66')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x1]?_0x25226b[_0x8ddd('0x5f')][0x1][_0x8ddd('0x63')]:undefined)||_0x8ddd('0x67')},{'name':'attrFontSize','value':_0x25226b['attrFontSize']||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b['attrs'][0x2]?_0x25226b[_0x8ddd('0x5f')][0x2][_0x8ddd('0x63')]:undefined)||0xc}];case _0x8ddd('0x68'):return[{'name':_0x8ddd('0x69'),'value':_0x25226b[_0x8ddd('0x69')]||(_0x25226b['attrs']&&_0x25226b[_0x8ddd('0x5f')][0x0]?_0x25226b[_0x8ddd('0x5f')][0x0]['value']:undefined)||_0x8ddd('0x6a')},{'name':_0x8ddd('0x6b'),'value':_0x25226b[_0x8ddd('0x6b')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x1]?_0x25226b['attrs'][0x1][_0x8ddd('0x63')]:undefined)||[]},{'name':_0x8ddd('0x6c'),'value':_0x25226b[_0x8ddd('0x6c')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x2]?_0x25226b[_0x8ddd('0x5f')][0x2][_0x8ddd('0x63')]:undefined)||0x14},{'name':_0x8ddd('0x6d'),'value':_0x25226b[_0x8ddd('0x6d')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x3]?_0x25226b[_0x8ddd('0x5f')][0x3][_0x8ddd('0x63')]:undefined)||_0x8ddd('0x6e')},{'name':_0x8ddd('0x6f'),'value':_0x25226b[_0x8ddd('0x6f')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x4]?_0x25226b[_0x8ddd('0x5f')][0x4][_0x8ddd('0x63')]:undefined)||''},{'name':_0x8ddd('0x70'),'value':_0x25226b['attrFaxAccounts']||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x5]?_0x25226b[_0x8ddd('0x5f')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x25226b[_0x8ddd('0x71')]||(_0x25226b['attrs']&&_0x25226b['attrs'][0x6]?_0x25226b[_0x8ddd('0x5f')][0x6][_0x8ddd('0x63')]:undefined)||''},{'name':_0x8ddd('0x72'),'value':_0x25226b[_0x8ddd('0x72')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x7]?_0x25226b[_0x8ddd('0x5f')][0x7][_0x8ddd('0x63')]:undefined)||''},{'name':_0x8ddd('0x73'),'value':_0x25226b[_0x8ddd('0x73')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x8]?_0x25226b['attrs'][0x8][_0x8ddd('0x63')]:undefined)||''},{'name':_0x8ddd('0x74'),'value':_0x25226b[_0x8ddd('0x74')]||(_0x25226b['attrs']&&_0x25226b[_0x8ddd('0x5f')][0x9]?_0x25226b[_0x8ddd('0x5f')][0x9][_0x8ddd('0x63')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x8ddd('0x75'),'value':_0x25226b[_0x8ddd('0x75')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b['attrs'][0x0]?_0x25226b[_0x8ddd('0x5f')][0x0]['value']:undefined)||_0x8ddd('0x6a')},{'name':_0x8ddd('0x76'),'value':_0x25226b[_0x8ddd('0x76')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x1]?_0x25226b['attrs'][0x1][_0x8ddd('0x63')]:undefined)||null},{'name':_0x8ddd('0x77'),'value':_0x25226b[_0x8ddd('0x77')]||(_0x25226b['attrs']&&_0x25226b[_0x8ddd('0x5f')][0x2]?_0x25226b[_0x8ddd('0x5f')][0x2][_0x8ddd('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x25226b[_0x8ddd('0x6b')]||(_0x25226b['attrs']&&_0x25226b[_0x8ddd('0x5f')][0x3]?_0x25226b[_0x8ddd('0x5f')][0x3][_0x8ddd('0x63')]:undefined)||[]},{'name':_0x8ddd('0x6d'),'value':_0x25226b[_0x8ddd('0x6d')]||(_0x25226b['attrs']&&_0x25226b['attrs'][0x4]?_0x25226b[_0x8ddd('0x5f')][0x4][_0x8ddd('0x63')]:undefined)||_0x8ddd('0x6e')},{'name':'attrEmailAccounts','value':_0x25226b[_0x8ddd('0x6f')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x5]?_0x25226b['attrs'][0x5][_0x8ddd('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x25226b['attrFaxAccounts']||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b['attrs'][0x6]?_0x25226b[_0x8ddd('0x5f')][0x6][_0x8ddd('0x63')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x25226b[_0x8ddd('0x71')]||(_0x25226b['attrs']&&_0x25226b[_0x8ddd('0x5f')][0x7]?_0x25226b['attrs'][0x7]['value']:undefined)||''},{'name':_0x8ddd('0x72'),'value':_0x25226b[_0x8ddd('0x72')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b['attrs'][0x8]?_0x25226b[_0x8ddd('0x5f')][0x8][_0x8ddd('0x63')]:undefined)||''},{'name':_0x8ddd('0x73'),'value':_0x25226b['attrWhatsappAccounts']||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b['attrs'][0x9]?_0x25226b[_0x8ddd('0x5f')][0x9][_0x8ddd('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x25226b[_0x8ddd('0x74')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0xa]?_0x25226b[_0x8ddd('0x5f')][0xa]['value']:undefined)||''}];case _0x8ddd('0x78'):return[{'name':_0x8ddd('0x79'),'type':_0x25226b[_0x8ddd('0x7a')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x0]?_0x25226b[_0x8ddd('0x5f')][0x0][_0x8ddd('0x33')]:undefined)||null,'value':_0x25226b['attrReport']||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b['attrs'][0x0]?_0x25226b[_0x8ddd('0x5f')][0x0][_0x8ddd('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x25226b[_0x8ddd('0x7b')]||(_0x25226b[_0x8ddd('0x5f')]&&_0x25226b[_0x8ddd('0x5f')][0x1]?_0x25226b[_0x8ddd('0x5f')][0x1][_0x8ddd('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x37d458){logger[_0x8ddd('0x2c')](_0x8ddd('0x7c'),JSON[_0x8ddd('0x7d')](_0x37d458));return[];}}exports['addItem']=function(_0x5c810f,_0x48e793,_0x1f3396){if(_0x5c810f[_0x8ddd('0x50')]['id']){delete _0x5c810f[_0x8ddd('0x50')]['id'];}return db[_0x8ddd('0x46')][_0x8ddd('0x4e')]({'where':{'id':_0x5c810f[_0x8ddd('0x4c')]['id']}})[_0x8ddd('0x26')](handleEntityNotFound(_0x48e793,null))[_0x8ddd('0x26')](function(_0xeaaf30){if(_0xeaaf30){_0x5c810f[_0x8ddd('0x50')][_0x8ddd('0x7e')]=_0xeaaf30['id'];_0x5c810f['body'][_0x8ddd('0x5f')]=widgetAttributes(_0x5c810f[_0x8ddd('0x50')]);return db[_0x8ddd('0x7f')][_0x8ddd('0x4f')](_0x5c810f['body']);}})[_0x8ddd('0x26')](respondWithResult(_0x48e793,null))[_0x8ddd('0x58')](handleError(_0x48e793,null));};exports['getItems']=function(_0x4faa27,_0x5a9075,_0x5b5edc){var _0x37f161={};var _0xd3fa1b={};var _0x45e660;var _0x2c0ba3;return db['Dashboard'][_0x8ddd('0x80')]({'where':{'id':_0x4faa27[_0x8ddd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a9075,null))[_0x8ddd('0x26')](function(_0x4f0192){if(_0x4f0192){_0x45e660=_0x4f0192;_0xd3fa1b[_0x8ddd('0x35')]=_['keys'](db[_0x8ddd('0x7f')][_0x8ddd('0x31')]);_0xd3fa1b[_0x8ddd('0x37')]=_[_0x8ddd('0x36')](_0x4faa27[_0x8ddd('0x37')]);_0xd3fa1b[_0x8ddd('0x38')]=_[_0x8ddd('0x39')](_0xd3fa1b[_0x8ddd('0x35')],_0xd3fa1b['query']);_0x37f161['attributes']=_[_0x8ddd('0x39')](_0xd3fa1b[_0x8ddd('0x35')],qs['fields'](_0x4faa27[_0x8ddd('0x37')][_0x8ddd('0x4d')]));_0x37f161[_0x8ddd('0x3a')]=_0x37f161[_0x8ddd('0x3a')]['length']?_0x37f161[_0x8ddd('0x3a')]:_0xd3fa1b['model'];_0x37f161['order']=qs[_0x8ddd('0x3f')](_0x4faa27[_0x8ddd('0x37')][_0x8ddd('0x3f')]);_0x37f161[_0x8ddd('0x40')]=qs['filters'](_['pick'](_0x4faa27[_0x8ddd('0x37')],_0xd3fa1b['filters']));if(_0x4faa27[_0x8ddd('0x37')]['filter']){_0x37f161[_0x8ddd('0x40')]=_[_0x8ddd('0x43')](_0x37f161[_0x8ddd('0x40')],{'$or':_[_0x8ddd('0x30')](_0x37f161['attributes'],function(_0x516c93){var _0x14d908={};_0x14d908[_0x516c93]={'$like':'%'+_0x4faa27[_0x8ddd('0x37')][_0x8ddd('0x42')]+'%'};return _0x14d908;})});}_0x37f161=_['merge']({},_0x37f161,_0x4faa27[_0x8ddd('0x45')]);return _0x45e660['getItems'](_0x37f161);}})[_0x8ddd('0x26')](function(_0x5e34d1){if(_0x5e34d1){_0x2c0ba3=_0x5e34d1[_0x8ddd('0x3b')];if(!_0x4faa27[_0x8ddd('0x37')][_0x8ddd('0x3c')](_0x8ddd('0x3d'))){_0x37f161[_0x8ddd('0x1f')]=qs[_0x8ddd('0x1f')](_0x4faa27[_0x8ddd('0x37')][_0x8ddd('0x1f')]);_0x37f161[_0x8ddd('0x1c')]=qs[_0x8ddd('0x1c')](_0x4faa27[_0x8ddd('0x37')][_0x8ddd('0x1c')]);}return _0x45e660[_0x8ddd('0x81')](_0x37f161);}})['then'](function(_0x334ccc){if(_0x334ccc){return _0x334ccc?{'count':_0x2c0ba3,'rows':_0x334ccc}:null;}})['then'](respondWithResult(_0x5a9075,null))[_0x8ddd('0x58')](handleError(_0x5a9075,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7a30e84..a0ad933 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 _0x3b1c=['../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3b1c,0xe9));var _0xc3b1=function(_0x25e512,_0x2be96c){_0x25e512=_0x25e512-0x0;var _0x473a48=_0x3b1c[_0x25e512];return _0x473a48;};'use strict';var EventEmitter=require(_0xc3b1('0x0'));var Dashboard=require(_0xc3b1('0x1'))['db'][_0xc3b1('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc3b1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc3b1('0x4'),'afterDestroy':_0xc3b1('0x5')};function emitEvent(_0x4c68ef){return function(_0x31d2bf,_0x14a162,_0x54bc35){DashboardEvents[_0xc3b1('0x6')](_0x4c68ef+':'+_0x31d2bf['id'],_0x31d2bf);DashboardEvents[_0xc3b1('0x6')](_0x4c68ef,_0x31d2bf);_0x54bc35(null);};}for(var e in events){if(events[_0xc3b1('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xc3b1('0x8')]=DashboardEvents; \ No newline at end of file +var _0x7bd9=['save','emit','hasOwnProperty','hook','events','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bd9,0xee));var _0x97bd=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7bd9[_0x1b349a];return _0x5d1f7c;};'use strict';var EventEmitter=require(_0x97bd('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x97bd('0x1')](0x0);var events={'afterCreate':_0x97bd('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb521e2){return function(_0x1ca13d,_0x45d8dd,_0x5d8d33){DashboardEvents['emit'](_0xb521e2+':'+_0x1ca13d['id'],_0x1ca13d);DashboardEvents[_0x97bd('0x3')](_0xb521e2,_0x1ca13d);_0x5d8d33(null);};}for(var e in events){if(events[_0x97bd('0x4')](e)){var event=events[e];Dashboard[_0x97bd('0x5')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 481cec1..db73cf4 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 _0x0c24=['../../config/logger','api','bluebird','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x0c24,0x13b));var _0x40c2=function(_0x427787,_0xf1abc9){_0x427787=_0x427787-0x0;var _0x4f5f61=_0x0c24[_0x427787];return _0x4f5f61;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x40c2('0x0'))(_0x40c2('0x1'));var moment=require('moment');var BPromise=require(_0x40c2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x40c2('0x3'));var config=require(_0x40c2('0x4'));var attributes=require(_0x40c2('0x5'));module['exports']=function(_0x146749,_0x3f204c){return _0x146749[_0x40c2('0x6')](_0x40c2('0x7'),attributes,{'tableName':_0x40c2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x274e=['Dashboard','lodash','util','moment','bluebird','rimraf','exports','define'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x274e,0x1d1));var _0xe274=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x274e[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xe274('0x0'));var util=require(_0xe274('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe274('0x2'));var BPromise=require(_0xe274('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe274('0x4'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0xe274('0x5')]=function(_0x2b0eb4,_0x4b4493){return _0x2b0eb4[_0xe274('0x6')](_0xe274('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 986526a..a430f3d 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 _0xb9d3=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x5a5762,_0x41ce84){var _0x1fa9a1=function(_0x4a0b05){while(--_0x4a0b05){_0x5a5762['push'](_0x5a5762['shift']());}};_0x1fa9a1(++_0x41ce84);}(_0xb9d3,0x15c));var _0x3b9d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb9d3[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x3b9d('0x0'));var util=require('util');var moment=require(_0x3b9d('0x1'));var BPromise=require(_0x3b9d('0x2'));var rs=require(_0x3b9d('0x3'));var fs=require('fs');var Redis=require(_0x3b9d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b9d('0x5'));var logger=require(_0x3b9d('0x6'))('rpc');var config=require(_0x3b9d('0x7'));var jayson=require(_0x3b9d('0x8'));var client=jayson[_0x3b9d('0x9')][_0x3b9d('0xa')]({'port':0x232a});config[_0x3b9d('0xb')]=_[_0x3b9d('0xc')](config[_0x3b9d('0xb')],{'host':_0x3b9d('0xd'),'port':0x18eb});var socket=require(_0x3b9d('0xe'))(new Redis(config[_0x3b9d('0xb')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x36e08b,_0xb89a7d,_0x5046d5){return new BPromise(function(_0x31e06e,_0x171a8e){return client[_0x3b9d('0xf')](_0x36e08b,_0x5046d5)[_0x3b9d('0x10')](function(_0x19856a){logger[_0x3b9d('0x11')](_0x3b9d('0x12'),_0xb89a7d,_0x3b9d('0x13'));logger[_0x3b9d('0x14')](_0x3b9d('0x15'),_0xb89a7d,_0x3b9d('0x13'),JSON['stringify'](_0x19856a));if(_0x19856a[_0x3b9d('0x16')]){if(_0x19856a[_0x3b9d('0x16')][_0x3b9d('0x17')]===0x1f4){logger[_0x3b9d('0x16')](_0x3b9d('0x12'),_0xb89a7d,_0x19856a[_0x3b9d('0x16')][_0x3b9d('0x18')]);return _0x171a8e(_0x19856a[_0x3b9d('0x16')]['message']);}logger[_0x3b9d('0x16')](_0x3b9d('0x12'),_0xb89a7d,_0x19856a[_0x3b9d('0x16')][_0x3b9d('0x18')]);return _0x31e06e(_0x19856a['error']['message']);}else{logger['info'](_0x3b9d('0x12'),_0xb89a7d,_0x3b9d('0x13'));_0x31e06e(_0x19856a[_0x3b9d('0x19')][_0x3b9d('0x18')]);}})[_0x3b9d('0x1a')](function(_0x441bc2){logger[_0x3b9d('0x16')]('Dashboard,\x20%s,\x20%s',_0xb89a7d,_0x441bc2);_0x171a8e(_0x441bc2);});});} \ No newline at end of file +var _0x8da5=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0x408e4f,_0x38c7dc){var _0x3e5015=function(_0x4b7741){while(--_0x4b7741){_0x408e4f['push'](_0x408e4f['shift']());}};_0x3e5015(++_0x38c7dc);}(_0x8da5,0x71));var _0x58da=function(_0x2bcd4f,_0x485e47){_0x2bcd4f=_0x2bcd4f-0x0;var _0xceb524=_0x8da5[_0x2bcd4f];return _0xceb524;};'use strict';var _=require(_0x58da('0x0'));var util=require('util');var moment=require(_0x58da('0x1'));var BPromise=require('bluebird');var rs=require(_0x58da('0x2'));var fs=require('fs');var Redis=require(_0x58da('0x3'));var db=require(_0x58da('0x4'))['db'];var utils=require(_0x58da('0x5'));var logger=require(_0x58da('0x6'))(_0x58da('0x7'));var config=require('../../config/environment');var jayson=require(_0x58da('0x8'));var client=jayson[_0x58da('0x9')][_0x58da('0xa')]({'port':0x232a});config[_0x58da('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x58da('0xc'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x4565b8,_0x3addc6,_0x3fa05c){return new BPromise(function(_0x34c7b6,_0x2b0419){return client['request'](_0x4565b8,_0x3fa05c)['then'](function(_0xcc4bf6){logger[_0x58da('0xd')](_0x58da('0xe'),_0x3addc6,_0x58da('0xf'));logger[_0x58da('0x10')](_0x58da('0x11'),_0x3addc6,_0x58da('0xf'),JSON['stringify'](_0xcc4bf6));if(_0xcc4bf6[_0x58da('0x12')]){if(_0xcc4bf6['error']['code']===0x1f4){logger[_0x58da('0x12')](_0x58da('0xe'),_0x3addc6,_0xcc4bf6[_0x58da('0x12')]['message']);return _0x2b0419(_0xcc4bf6[_0x58da('0x12')]['message']);}logger['error'](_0x58da('0xe'),_0x3addc6,_0xcc4bf6[_0x58da('0x12')][_0x58da('0x13')]);return _0x34c7b6(_0xcc4bf6[_0x58da('0x12')][_0x58da('0x13')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x3addc6,_0x58da('0xf'));_0x34c7b6(_0xcc4bf6[_0x58da('0x14')][_0x58da('0x13')]);}})['catch'](function(_0x2113da){logger[_0x58da('0x12')](_0x58da('0xe'),_0x3addc6,_0x2113da);_0x2b0419(_0x2113da);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1e8d949..2e012b3 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 _0x89dd=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x570a18,_0x4237f6){var _0x1e5232=function(_0xdbdd59){while(--_0xdbdd59){_0x570a18['push'](_0x570a18['shift']());}};_0x1e5232(++_0x4237f6);}(_0x89dd,0x84));var _0xd89d=function(_0x4d5837,_0xf95db6){_0x4d5837=_0x4d5837-0x0;var _0x442b18=_0x89dd[_0x4d5837];return _0x442b18;};'use strict';var DashboardEvents=require(_0xd89d('0x0'));var events=[_0xd89d('0x1'),_0xd89d('0x2'),_0xd89d('0x3')];function createListener(_0x541b11,_0x1f81f9){return function(_0x2b004e){_0x1f81f9[_0xd89d('0x4')](_0x541b11,_0x2b004e);};}function removeListener(_0x44eb59,_0x4d7d12){return function(){DashboardEvents[_0xd89d('0x5')](_0x44eb59,_0x4d7d12);};}exports[_0xd89d('0x6')]=function(_0x20bbbd){for(var _0x132244=0x0,_0x15a970=events[_0xd89d('0x7')];_0x132244<_0x15a970;_0x132244++){var _0x50d920=events[_0x132244];var _0x4066f8=createListener(_0xd89d('0x8')+_0x50d920,_0x20bbbd);DashboardEvents['on'](_0x50d920,_0x4066f8);}}; \ No newline at end of file +var _0x2abb=['./dashboard.events','save','remove','update','emit','removeListener','length','dashboard:'];(function(_0x26e593,_0x1a02d5){var _0x56bac9=function(_0x416bad){while(--_0x416bad){_0x26e593['push'](_0x26e593['shift']());}};_0x56bac9(++_0x1a02d5);}(_0x2abb,0xc8));var _0xb2ab=function(_0x273034,_0x41e8e8){_0x273034=_0x273034-0x0;var _0xf116ca=_0x2abb[_0x273034];return _0xf116ca;};'use strict';var DashboardEvents=require(_0xb2ab('0x0'));var events=[_0xb2ab('0x1'),_0xb2ab('0x2'),_0xb2ab('0x3')];function createListener(_0x4784ac,_0x1501db){return function(_0x223b5a){_0x1501db[_0xb2ab('0x4')](_0x4784ac,_0x223b5a);};}function removeListener(_0x45a950,_0x14fcce){return function(){DashboardEvents[_0xb2ab('0x5')](_0x45a950,_0x14fcce);};}exports['register']=function(_0x11db6d){for(var _0x461fde=0x0,_0x6bddab=events[_0xb2ab('0x6')];_0x461fde<_0x6bddab;_0x461fde++){var _0x29e5ac=events[_0x461fde];var _0x3779c3=createListener(_0xb2ab('0x7')+_0x29e5ac,_0x11db6d);DashboardEvents['on'](_0x29e5ac,_0x3779c3);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 750eb07..2553f99 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 _0x645c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','/:id/clone','post','addItem','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4eba98,_0x20d665){var _0x2ddb1e=function(_0x1d8b0d){while(--_0x1d8b0d){_0x4eba98['push'](_0x4eba98['shift']());}};_0x2ddb1e(++_0x20d665);}(_0x645c,0x1ce));var _0xc645=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x645c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc645('0x0'));var util=require(_0xc645('0x1'));var path=require(_0xc645('0x2'));var timeout=require(_0xc645('0x3'));var express=require(_0xc645('0x4'));var router=express[_0xc645('0x5')]();var fs_extra=require(_0xc645('0x6'));var auth=require(_0xc645('0x7'));var interaction=require(_0xc645('0x8'));var config=require(_0xc645('0x9'));var controller=require(_0xc645('0xa'));router[_0xc645('0xb')]('/',auth[_0xc645('0xc')](),controller[_0xc645('0xd')]);router[_0xc645('0xb')](_0xc645('0xe'),auth[_0xc645('0xc')](),controller[_0xc645('0xf')]);router[_0xc645('0xb')](_0xc645('0x10'),auth[_0xc645('0xc')](),controller[_0xc645('0x11')]);router['post']('/',auth[_0xc645('0xc')](),controller[_0xc645('0x12')]);router['post'](_0xc645('0x13'),auth[_0xc645('0xc')](),controller['clone']);router[_0xc645('0x14')](_0xc645('0x10'),auth['isAuthenticated'](),controller[_0xc645('0x15')]);router[_0xc645('0x16')](_0xc645('0xe'),auth[_0xc645('0xc')](),controller[_0xc645('0x17')]);router['delete']('/:id',auth[_0xc645('0xc')](),controller[_0xc645('0x18')]);module[_0xc645('0x19')]=router; \ No newline at end of file +var _0xdc6f=['create','/:id/clone','addItem','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xdc6f,0xb0));var _0xfdc6=function(_0xb7fca7,_0x38ca46){_0xb7fca7=_0xb7fca7-0x0;var _0x3c0d34=_0xdc6f[_0xb7fca7];return _0x3c0d34;};'use strict';var multer=require(_0xfdc6('0x0'));var util=require('util');var path=require(_0xfdc6('0x1'));var timeout=require(_0xfdc6('0x2'));var express=require(_0xfdc6('0x3'));var router=express['Router']();var fs_extra=require(_0xfdc6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfdc6('0x5'));var controller=require('./dashboard.controller');router[_0xfdc6('0x6')]('/',auth[_0xfdc6('0x7')](),controller[_0xfdc6('0x8')]);router[_0xfdc6('0x6')](_0xfdc6('0x9'),auth[_0xfdc6('0x7')](),controller[_0xfdc6('0xa')]);router[_0xfdc6('0x6')](_0xfdc6('0xb'),auth[_0xfdc6('0x7')](),controller[_0xfdc6('0xc')]);router[_0xfdc6('0xd')]('/',auth[_0xfdc6('0x7')](),controller[_0xfdc6('0xe')]);router[_0xfdc6('0xd')](_0xfdc6('0xf'),auth[_0xfdc6('0x7')](),controller['clone']);router[_0xfdc6('0xd')](_0xfdc6('0xb'),auth['isAuthenticated'](),controller[_0xfdc6('0x10')]);router['put'](_0xfdc6('0x9'),auth[_0xfdc6('0x7')](),controller['update']);router[_0xfdc6('0x11')]('/:id',auth[_0xfdc6('0x7')](),controller[_0xfdc6('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 2bc9114..125c05f 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 _0x187d=['stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue'];(function(_0x313112,_0x4af4a4){var _0x422beb=function(_0x545c94){while(--_0x545c94){_0x313112['push'](_0x313112['shift']());}};_0x422beb(++_0x4af4a4);}(_0x187d,0x93));var _0xd187=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x187d[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0xd187('0x0'));var squel=require('squel');var _=require(_0xd187('0x1'));module[_0xd187('0x2')]={'title':{'type':Sequelize[_0xd187('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x5')),'get':function(){try{return JSON['parse'](this[_0xd187('0x6')](_0xd187('0x7')));}catch(_0x4ebc8d){return[];}},'set':function(_0x1d2533){try{this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')](_0x1d2533));}catch(_0x28ce2f){this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd187('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd187('0xa')]},'col':{'type':Sequelize[_0xd187('0xa')]},'background':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':_0xd187('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd187('0x3')]},'titleFontSize':{'type':Sequelize[_0xd187('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2eb2=['STRING','TEXT','parse','setDataValue','attrs','stringify','INTEGER','#2196f3','squel','lodash','exports'];(function(_0x2fe804,_0x619aaa){var _0x59340b=function(_0x4a0e46){while(--_0x4a0e46){_0x2fe804['push'](_0x2fe804['shift']());}};_0x59340b(++_0x619aaa);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x2eb2[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x22eb('0x0'));var _=require(_0x22eb('0x1'));module[_0x22eb('0x2')]={'title':{'type':Sequelize[_0x22eb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x22eb('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x22eb('0x4')]('long'),'get':function(){try{return JSON[_0x22eb('0x5')](this['getDataValue']('attrs'));}catch(_0x1dfef7){return[];}},'set':function(_0x10e116){try{this[_0x22eb('0x6')](_0x22eb('0x7'),JSON[_0x22eb('0x8')](_0x10e116));}catch(_0x396806){this[_0x22eb('0x6')](_0x22eb('0x7'),JSON[_0x22eb('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x22eb('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x22eb('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x22eb('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x22eb('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x22eb('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x22eb('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 31a521c..38c3c73 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 _0x03db=['../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','includeAll','include','find','catch','type','attrUrl','attrs','https://','attrPath','value','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie3','attrEmailAccounts','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','body','create','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb03d('0x0'));var rimraf=require(_0xb03d('0x1'));var zipdir=require(_0xb03d('0x2'));var jsonpatch=require(_0xb03d('0x3'));var rp=require('request-promise');var moment=require(_0xb03d('0x4'));var BPromise=require(_0xb03d('0x5'));var Mustache=require(_0xb03d('0x6'));var util=require(_0xb03d('0x7'));var path=require(_0xb03d('0x8'));var sox=require('sox');var csv=require(_0xb03d('0x9'));var ejs=require(_0xb03d('0xa'));var fs=require('fs');var fs_extra=require(_0xb03d('0xb'));var _=require('lodash');var squel=require(_0xb03d('0xc'));var crypto=require('crypto');var jsforce=require(_0xb03d('0xd'));var deskjs=require(_0xb03d('0xe'));var toCsv=require(_0xb03d('0x9'));var querystring=require(_0xb03d('0xf'));var Papa=require(_0xb03d('0x10'));var Redis=require(_0xb03d('0x11'));var authService=require(_0xb03d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb03d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb03d('0x14'));var utils=require(_0xb03d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb03d('0x16'))['db'];config['redis']=_['defaults'](config[_0xb03d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb03d('0x18'))(new Redis(config[_0xb03d('0x17')]));require(_0xb03d('0x19'))[_0xb03d('0x1a')](socket);function respondWithStatusCode(_0x1e85d5,_0x2fb19e){_0x2fb19e=_0x2fb19e||0xcc;return function(_0x443fed){if(_0x443fed){return _0x1e85d5['sendStatus'](_0x2fb19e);}return _0x1e85d5[_0xb03d('0x1b')](_0x2fb19e)[_0xb03d('0x1c')]();};}function respondWithResult(_0x2de6db,_0x5980a6){_0x5980a6=_0x5980a6||0xc8;return function(_0x5ca81f){if(_0x5ca81f){return _0x2de6db[_0xb03d('0x1b')](_0x5980a6)[_0xb03d('0x1d')](_0x5ca81f);}};}function respondWithFilteredResult(_0xc0a76a,_0x10b526){return function(_0x17398a){if(_0x17398a){var _0x54fd94=typeof _0x10b526[_0xb03d('0x1e')]===_0xb03d('0x1f')&&typeof _0x10b526['limit']===_0xb03d('0x1f');var _0xfd13c6=_0x17398a[_0xb03d('0x20')];var _0x29c20=_0x54fd94?0x0:_0x10b526[_0xb03d('0x1e')];var _0x331d45=_0x54fd94?_0x17398a[_0xb03d('0x20')]:_0x10b526[_0xb03d('0x1e')]+_0x10b526[_0xb03d('0x21')];var _0x491105;if(_0x331d45>=_0xfd13c6){_0x331d45=_0xfd13c6;_0x491105=0xc8;}else{_0x491105=0xce;}_0xc0a76a['status'](_0x491105);return _0xc0a76a[_0xb03d('0x22')](_0xb03d('0x23'),_0x29c20+'-'+_0x331d45+'/'+_0xfd13c6)[_0xb03d('0x1d')](_0x17398a);}return null;};}function patchUpdates(_0x809c5f){return function(_0x3de6fd){try{jsonpatch['apply'](_0x3de6fd,_0x809c5f,!![]);}catch(_0x380844){return BPromise[_0xb03d('0x24')](_0x380844);}return _0x3de6fd['save']();};}function saveUpdates(_0x2e6783,_0x233761){return function(_0x50885d){if(_0x50885d){return _0x50885d[_0xb03d('0x25')](_0x2e6783)[_0xb03d('0x26')](function(_0x594009){return _0x594009;});}return null;};}function removeEntity(_0xdc21cf,_0x350fe6){return function(_0x2217b1){if(_0x2217b1){return _0x2217b1[_0xb03d('0x27')]()['then'](function(){_0xdc21cf[_0xb03d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f24c,_0x1bc1d1){return function(_0x339e9f){if(!_0x339e9f){_0x23f24c['sendStatus'](0x194);}return _0x339e9f;};}function handleError(_0x4d9fa5,_0x5c70ad){_0x5c70ad=_0x5c70ad||0x1f4;return function(_0x21c897){logger[_0xb03d('0x28')](_0x21c897[_0xb03d('0x29')]);if(_0x21c897['name']){delete _0x21c897[_0xb03d('0x2a')];}_0x4d9fa5[_0xb03d('0x1b')](_0x5c70ad)[_0xb03d('0x2b')](_0x21c897);};}exports[_0xb03d('0x2c')]=function(_0x34b17a,_0x49b011){var _0x1bf0c1={'raw':![],'where':{'id':_0x34b17a[_0xb03d('0x2d')]['id']}},_0x1a0f74={};_0x1a0f74[_0xb03d('0x2e')]=_[_0xb03d('0x2f')](db[_0xb03d('0x30')][_0xb03d('0x31')]);_0x1a0f74[_0xb03d('0x32')]=_[_0xb03d('0x2f')](_0x34b17a[_0xb03d('0x32')]);_0x1a0f74['filters']=_[_0xb03d('0x33')](_0x1a0f74['model'],_0x1a0f74[_0xb03d('0x32')]);_0x1bf0c1[_0xb03d('0x34')]=_['intersection'](_0x1a0f74[_0xb03d('0x2e')],qs[_0xb03d('0x35')](_0x34b17a['query'][_0xb03d('0x35')]));_0x1bf0c1[_0xb03d('0x34')]=_0x1bf0c1[_0xb03d('0x34')]['length']?_0x1bf0c1[_0xb03d('0x34')]:_0x1a0f74[_0xb03d('0x2e')];if(_0x34b17a[_0xb03d('0x32')][_0xb03d('0x36')]){_0x1bf0c1[_0xb03d('0x37')]=[{'all':!![]}];}_0x1bf0c1=_['merge']({},_0x1bf0c1,_0x34b17a['options']);return db['DashboardItem'][_0xb03d('0x38')](_0x1bf0c1)['then'](handleEntityNotFound(_0x49b011,null))[_0xb03d('0x26')](respondWithResult(_0x49b011,null))['catch'](handleError(_0x49b011,null));};exports[_0xb03d('0x27')]=function(_0x53312a,_0x32c5ec){return db['DashboardItem'][_0xb03d('0x38')]({'where':{'id':_0x53312a[_0xb03d('0x2d')]['id']}})['then'](handleEntityNotFound(_0x32c5ec,null))[_0xb03d('0x26')](removeEntity(_0x32c5ec,null))[_0xb03d('0x39')](handleError(_0x32c5ec,null));};function widgetAttributes(_0x359831){try{switch(_0x359831[_0xb03d('0x3a')]){case'iframe':return[{'name':_0xb03d('0x3b'),'value':_0x359831[_0xb03d('0x3b')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x0]?_0x359831['attrs'][0x0]['value']:undefined)||_0xb03d('0x3d')}];case'custom':return[{'name':_0xb03d('0x3e'),'value':_0x359831[_0xb03d('0x3e')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x0]?_0x359831[_0xb03d('0x3c')][0x0][_0xb03d('0x3f')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x359831[_0xb03d('0x40')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0x0]?_0x359831[_0xb03d('0x3c')][0x0][_0xb03d('0x3f')]:undefined)||'HH:mm:ss'},{'name':_0xb03d('0x41'),'value':_0x359831['attrTimezone']||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x1]?_0x359831['attrs'][0x1]['value']:undefined)||_0xb03d('0x42')},{'name':'attrFontSize','value':_0x359831[_0xb03d('0x43')]||(_0x359831['attrs']&&_0x359831[_0xb03d('0x3c')][0x2]?_0x359831['attrs'][0x2][_0xb03d('0x3f')]:undefined)||0xc}];case _0xb03d('0x44'):return[{'name':_0xb03d('0x45'),'value':_0x359831[_0xb03d('0x45')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0x0]?_0x359831[_0xb03d('0x3c')][0x0][_0xb03d('0x3f')]:undefined)||_0xb03d('0x46')},{'name':_0xb03d('0x47'),'value':_0x359831[_0xb03d('0x47')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x1]?_0x359831[_0xb03d('0x3c')][0x1][_0xb03d('0x3f')]:undefined)||[]},{'name':_0xb03d('0x43'),'value':_0x359831['attrFontSize']||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0x2]?_0x359831[_0xb03d('0x3c')][0x2][_0xb03d('0x3f')]:undefined)||0x14},{'name':_0xb03d('0x48'),'value':_0x359831[_0xb03d('0x48')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0x3]?_0x359831[_0xb03d('0x3c')][0x3]['value']:undefined)||_0xb03d('0x49')},{'name':'attrEmailAccounts','value':_0x359831['attrEmailAccounts']||(_0x359831['attrs']&&_0x359831['attrs'][0x4]?_0x359831['attrs'][0x4][_0xb03d('0x3f')]:undefined)||''},{'name':_0xb03d('0x4a'),'value':_0x359831['attrFaxAccounts']||(_0x359831['attrs']&&_0x359831[_0xb03d('0x3c')][0x5]?_0x359831[_0xb03d('0x3c')][0x5][_0xb03d('0x3f')]:undefined)||''},{'name':_0xb03d('0x4b'),'value':_0x359831[_0xb03d('0x4b')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x6]?_0x359831[_0xb03d('0x3c')][0x6]['value']:undefined)||''},{'name':_0xb03d('0x4c'),'value':_0x359831[_0xb03d('0x4c')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0x7]?_0x359831[_0xb03d('0x3c')][0x7][_0xb03d('0x3f')]:undefined)||''},{'name':_0xb03d('0x4d'),'value':_0x359831[_0xb03d('0x4d')]||(_0x359831['attrs']&&_0x359831[_0xb03d('0x3c')][0x8]?_0x359831[_0xb03d('0x3c')][0x8][_0xb03d('0x3f')]:undefined)||''},{'name':_0xb03d('0x4e'),'value':_0x359831[_0xb03d('0x4e')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x9]?_0x359831[_0xb03d('0x3c')][0x9][_0xb03d('0x3f')]:undefined)||''}];case _0xb03d('0x4f'):case'pie-chart':return[{'name':_0xb03d('0x50'),'value':_0x359831[_0xb03d('0x50')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x0]?_0x359831['attrs'][0x0][_0xb03d('0x3f')]:undefined)||_0xb03d('0x46')},{'name':'attrSerie2','value':_0x359831['attrSerie2']||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x1]?_0x359831[_0xb03d('0x3c')][0x1][_0xb03d('0x3f')]:undefined)||null},{'name':_0xb03d('0x51'),'value':_0x359831[_0xb03d('0x51')]||(_0x359831['attrs']&&_0x359831['attrs'][0x2]?_0x359831['attrs'][0x2][_0xb03d('0x3f')]:undefined)||null},{'name':_0xb03d('0x47'),'value':_0x359831['attrVoiceQueues']||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x3]?_0x359831['attrs'][0x3][_0xb03d('0x3f')]:undefined)||[]},{'name':_0xb03d('0x48'),'value':_0x359831[_0xb03d('0x48')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0x4]?_0x359831[_0xb03d('0x3c')][0x4][_0xb03d('0x3f')]:undefined)||_0xb03d('0x49')},{'name':_0xb03d('0x52'),'value':_0x359831[_0xb03d('0x52')]||(_0x359831['attrs']&&_0x359831[_0xb03d('0x3c')][0x5]?_0x359831[_0xb03d('0x3c')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x359831[_0xb03d('0x4a')]||(_0x359831['attrs']&&_0x359831[_0xb03d('0x3c')][0x6]?_0x359831[_0xb03d('0x3c')][0x6][_0xb03d('0x3f')]:undefined)||''},{'name':_0xb03d('0x4b'),'value':_0x359831[_0xb03d('0x4b')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x7]?_0x359831['attrs'][0x7][_0xb03d('0x3f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x359831[_0xb03d('0x4c')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x8]?_0x359831[_0xb03d('0x3c')][0x8][_0xb03d('0x3f')]:undefined)||''},{'name':_0xb03d('0x4d'),'value':_0x359831[_0xb03d('0x4d')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0x9]?_0x359831['attrs'][0x9][_0xb03d('0x3f')]:undefined)||''},{'name':_0xb03d('0x4e'),'value':_0x359831[_0xb03d('0x4e')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831['attrs'][0xa]?_0x359831['attrs'][0xa][_0xb03d('0x3f')]:undefined)||''}];case _0xb03d('0x53'):return[{'name':'attrReport','type':_0x359831[_0xb03d('0x54')]||(_0x359831['attrs']&&_0x359831[_0xb03d('0x3c')][0x0]?_0x359831[_0xb03d('0x3c')][0x0]['type']:undefined)||null,'value':_0x359831[_0xb03d('0x55')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x0]?_0x359831[_0xb03d('0x3c')][0x0][_0xb03d('0x3f')]:undefined)||null},{'name':_0xb03d('0x56'),'value':_0x359831[_0xb03d('0x56')]||(_0x359831[_0xb03d('0x3c')]&&_0x359831[_0xb03d('0x3c')][0x1]?_0x359831['attrs'][0x1][_0xb03d('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x19c473){logger[_0xb03d('0x28')](_0xb03d('0x57'),JSON['stringify'](_0x19c473));return[];}}exports['create']=function(_0xd8c7e7,_0x5ef7d2){if(_0xd8c7e7[_0xb03d('0x58')]){_0xd8c7e7[_0xb03d('0x58')][_0xb03d('0x3c')]=widgetAttributes(_0xd8c7e7['body']);}return db[_0xb03d('0x30')][_0xb03d('0x59')](_0xd8c7e7[_0xb03d('0x58')],{})['then'](respondWithResult(_0x5ef7d2,0xc9))[_0xb03d('0x39')](handleError(_0x5ef7d2,null));};exports['update']=function(_0x5a28f4,_0x6afa56){if(_0x5a28f4[_0xb03d('0x58')]['id']){delete _0x5a28f4[_0xb03d('0x58')]['id'];}_0x5a28f4[_0xb03d('0x58')]['attrs']=widgetAttributes(_0x5a28f4[_0xb03d('0x58')]);return db[_0xb03d('0x30')][_0xb03d('0x38')]({'where':{'id':_0x5a28f4[_0xb03d('0x2d')]['id']}})['then'](handleEntityNotFound(_0x6afa56,null))[_0xb03d('0x26')](saveUpdates(_0x5a28f4[_0xb03d('0x58')],null))[_0xb03d('0x26')](respondWithResult(_0x6afa56,null))['catch'](handleError(_0x6afa56,null));}; \ No newline at end of file +var _0x34f2=['catch','find','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrReport','reportType','type','widgetAttributes:\x20%s','stringify','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','options'];(function(_0x2f2214,_0x59f1cc){var _0x2b7ff3=function(_0x58bfe9){while(--_0x58bfe9){_0x2f2214['push'](_0x2f2214['shift']());}};_0x2b7ff3(++_0x59f1cc);}(_0x34f2,0x15a));var _0x234f=function(_0x54d41d,_0x5a7a54){_0x54d41d=_0x54d41d-0x0;var _0xc12bcf=_0x34f2[_0x54d41d];return _0xc12bcf;};'use strict';var emlformat=require(_0x234f('0x0'));var rimraf=require(_0x234f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x234f('0x2'));var rp=require(_0x234f('0x3'));var moment=require(_0x234f('0x4'));var BPromise=require(_0x234f('0x5'));var Mustache=require(_0x234f('0x6'));var util=require(_0x234f('0x7'));var path=require(_0x234f('0x8'));var sox=require(_0x234f('0x9'));var csv=require(_0x234f('0xa'));var ejs=require(_0x234f('0xb'));var fs=require('fs');var fs_extra=require(_0x234f('0xc'));var _=require(_0x234f('0xd'));var squel=require(_0x234f('0xe'));var crypto=require(_0x234f('0xf'));var jsforce=require(_0x234f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x234f('0xa'));var querystring=require(_0x234f('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x234f('0x12'));var qs=require(_0x234f('0x13'));var as=require(_0x234f('0x14'));var hardwareService=require(_0x234f('0x15'));var logger=require(_0x234f('0x16'))('api');var utils=require(_0x234f('0x17'));var config=require(_0x234f('0x18'));var licenseUtil=require(_0x234f('0x19'));var db=require(_0x234f('0x1a'))['db'];config['redis']=_[_0x234f('0x1b')](config['redis'],{'host':_0x234f('0x1c'),'port':0x18eb});var socket=require(_0x234f('0x1d'))(new Redis(config[_0x234f('0x1e')]));require(_0x234f('0x1f'))[_0x234f('0x20')](socket);function respondWithStatusCode(_0x10ee30,_0x296c3a){_0x296c3a=_0x296c3a||0xcc;return function(_0x533bd4){if(_0x533bd4){return _0x10ee30['sendStatus'](_0x296c3a);}return _0x10ee30[_0x234f('0x21')](_0x296c3a)[_0x234f('0x22')]();};}function respondWithResult(_0x5f0e9c,_0x14f879){_0x14f879=_0x14f879||0xc8;return function(_0x15fd64){if(_0x15fd64){return _0x5f0e9c[_0x234f('0x21')](_0x14f879)[_0x234f('0x23')](_0x15fd64);}};}function respondWithFilteredResult(_0x304c08,_0x1de6f3){return function(_0x144ea0){if(_0x144ea0){var _0x2ce5e1=typeof _0x1de6f3[_0x234f('0x24')]==='undefined'&&typeof _0x1de6f3[_0x234f('0x25')]===_0x234f('0x26');var _0x357ecb=_0x144ea0[_0x234f('0x27')];var _0x410977=_0x2ce5e1?0x0:_0x1de6f3[_0x234f('0x24')];var _0x470363=_0x2ce5e1?_0x144ea0[_0x234f('0x27')]:_0x1de6f3[_0x234f('0x24')]+_0x1de6f3['limit'];var _0x5e7edd;if(_0x470363>=_0x357ecb){_0x470363=_0x357ecb;_0x5e7edd=0xc8;}else{_0x5e7edd=0xce;}_0x304c08[_0x234f('0x21')](_0x5e7edd);return _0x304c08[_0x234f('0x28')]('Content-Range',_0x410977+'-'+_0x470363+'/'+_0x357ecb)[_0x234f('0x23')](_0x144ea0);}return null;};}function patchUpdates(_0x4ca657){return function(_0x395d16){try{jsonpatch[_0x234f('0x29')](_0x395d16,_0x4ca657,!![]);}catch(_0x17a23c){return BPromise[_0x234f('0x2a')](_0x17a23c);}return _0x395d16[_0x234f('0x2b')]();};}function saveUpdates(_0x434e9f,_0x2b585b){return function(_0x327f99){if(_0x327f99){return _0x327f99[_0x234f('0x2c')](_0x434e9f)[_0x234f('0x2d')](function(_0x758e8d){return _0x758e8d;});}return null;};}function removeEntity(_0xd8ffbf,_0x15de29){return function(_0x31d244){if(_0x31d244){return _0x31d244[_0x234f('0x2e')]()[_0x234f('0x2d')](function(){_0xd8ffbf[_0x234f('0x21')](0xcc)[_0x234f('0x22')]();});}};}function handleEntityNotFound(_0x1521b1,_0x2e7ff0){return function(_0xf16a84){if(!_0xf16a84){_0x1521b1[_0x234f('0x2f')](0x194);}return _0xf16a84;};}function handleError(_0x157b77,_0x5d3759){_0x5d3759=_0x5d3759||0x1f4;return function(_0x1f6032){logger[_0x234f('0x30')](_0x1f6032[_0x234f('0x31')]);if(_0x1f6032[_0x234f('0x32')]){delete _0x1f6032[_0x234f('0x32')];}_0x157b77[_0x234f('0x21')](_0x5d3759)[_0x234f('0x33')](_0x1f6032);};}exports[_0x234f('0x34')]=function(_0x43b338,_0x19f33b){var _0x5ecf4e={'raw':![],'where':{'id':_0x43b338['params']['id']}},_0x3eb02e={};_0x3eb02e[_0x234f('0x35')]=_[_0x234f('0x36')](db[_0x234f('0x37')][_0x234f('0x38')]);_0x3eb02e['query']=_[_0x234f('0x36')](_0x43b338[_0x234f('0x39')]);_0x3eb02e[_0x234f('0x3a')]=_['intersection'](_0x3eb02e['model'],_0x3eb02e[_0x234f('0x39')]);_0x5ecf4e[_0x234f('0x3b')]=_['intersection'](_0x3eb02e['model'],qs[_0x234f('0x3c')](_0x43b338['query']['fields']));_0x5ecf4e[_0x234f('0x3b')]=_0x5ecf4e['attributes'][_0x234f('0x3d')]?_0x5ecf4e[_0x234f('0x3b')]:_0x3eb02e[_0x234f('0x35')];if(_0x43b338[_0x234f('0x39')][_0x234f('0x3e')]){_0x5ecf4e[_0x234f('0x3f')]=[{'all':!![]}];}_0x5ecf4e=_[_0x234f('0x40')]({},_0x5ecf4e,_0x43b338[_0x234f('0x41')]);return db[_0x234f('0x37')]['find'](_0x5ecf4e)[_0x234f('0x2d')](handleEntityNotFound(_0x19f33b,null))[_0x234f('0x2d')](respondWithResult(_0x19f33b,null))[_0x234f('0x42')](handleError(_0x19f33b,null));};exports[_0x234f('0x2e')]=function(_0x34567c,_0x156f25){return db[_0x234f('0x37')][_0x234f('0x43')]({'where':{'id':_0x34567c['params']['id']}})[_0x234f('0x2d')](handleEntityNotFound(_0x156f25,null))[_0x234f('0x2d')](removeEntity(_0x156f25,null))[_0x234f('0x42')](handleError(_0x156f25,null));};function widgetAttributes(_0x21e2e5){try{switch(_0x21e2e5['type']){case'iframe':return[{'name':'attrUrl','value':_0x21e2e5[_0x234f('0x44')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x0]?_0x21e2e5[_0x234f('0x45')][0x0][_0x234f('0x46')]:undefined)||_0x234f('0x47')}];case _0x234f('0x48'):return[{'name':_0x234f('0x49'),'value':_0x21e2e5[_0x234f('0x49')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x0]?_0x21e2e5[_0x234f('0x45')][0x0][_0x234f('0x46')]:undefined)||''}];case _0x234f('0x4a'):return[{'name':_0x234f('0x4b'),'value':_0x21e2e5[_0x234f('0x4b')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x0]?_0x21e2e5[_0x234f('0x45')][0x0][_0x234f('0x46')]:undefined)||_0x234f('0x4c')},{'name':'attrTimezone','value':_0x21e2e5[_0x234f('0x4d')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x1]?_0x21e2e5[_0x234f('0x45')][0x1][_0x234f('0x46')]:undefined)||_0x234f('0x4e')},{'name':_0x234f('0x4f'),'value':_0x21e2e5['attrFontSize']||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x2]?_0x21e2e5['attrs'][0x2][_0x234f('0x46')]:undefined)||0xc}];case _0x234f('0x50'):return[{'name':_0x234f('0x51'),'value':_0x21e2e5['attrMetric']||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x0]?_0x21e2e5[_0x234f('0x45')][0x0][_0x234f('0x46')]:undefined)||_0x234f('0x52')},{'name':_0x234f('0x53'),'value':_0x21e2e5[_0x234f('0x53')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5['attrs'][0x1]?_0x21e2e5[_0x234f('0x45')][0x1]['value']:undefined)||[]},{'name':_0x234f('0x4f'),'value':_0x21e2e5[_0x234f('0x4f')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x2]?_0x21e2e5[_0x234f('0x45')][0x2]['value']:undefined)||0x14},{'name':_0x234f('0x54'),'value':_0x21e2e5[_0x234f('0x54')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5['attrs'][0x3]?_0x21e2e5[_0x234f('0x45')][0x3][_0x234f('0x46')]:undefined)||_0x234f('0x55')},{'name':'attrEmailAccounts','value':_0x21e2e5[_0x234f('0x56')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5['attrs'][0x4]?_0x21e2e5[_0x234f('0x45')][0x4][_0x234f('0x46')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x21e2e5[_0x234f('0x57')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x5]?_0x21e2e5[_0x234f('0x45')][0x5][_0x234f('0x46')]:undefined)||''},{'name':_0x234f('0x58'),'value':_0x21e2e5[_0x234f('0x58')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x6]?_0x21e2e5[_0x234f('0x45')][0x6][_0x234f('0x46')]:undefined)||''},{'name':_0x234f('0x59'),'value':_0x21e2e5[_0x234f('0x59')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x7]?_0x21e2e5[_0x234f('0x45')][0x7][_0x234f('0x46')]:undefined)||''},{'name':_0x234f('0x5a'),'value':_0x21e2e5[_0x234f('0x5a')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x8]?_0x21e2e5[_0x234f('0x45')][0x8][_0x234f('0x46')]:undefined)||''},{'name':_0x234f('0x5b'),'value':_0x21e2e5[_0x234f('0x5b')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x9]?_0x21e2e5[_0x234f('0x45')][0x9]['value']:undefined)||''}];case _0x234f('0x5c'):case'pie-chart':return[{'name':'attrSerie1','value':_0x21e2e5[_0x234f('0x5d')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x0]?_0x21e2e5['attrs'][0x0][_0x234f('0x46')]:undefined)||_0x234f('0x52')},{'name':_0x234f('0x5e'),'value':_0x21e2e5[_0x234f('0x5e')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x1]?_0x21e2e5[_0x234f('0x45')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x21e2e5['attrSerie3']||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5['attrs'][0x2]?_0x21e2e5[_0x234f('0x45')][0x2]['value']:undefined)||null},{'name':_0x234f('0x53'),'value':_0x21e2e5[_0x234f('0x53')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5['attrs'][0x3]?_0x21e2e5['attrs'][0x3][_0x234f('0x46')]:undefined)||[]},{'name':_0x234f('0x54'),'value':_0x21e2e5[_0x234f('0x54')]||(_0x21e2e5['attrs']&&_0x21e2e5['attrs'][0x4]?_0x21e2e5[_0x234f('0x45')][0x4][_0x234f('0x46')]:undefined)||_0x234f('0x55')},{'name':_0x234f('0x56'),'value':_0x21e2e5[_0x234f('0x56')]||(_0x21e2e5['attrs']&&_0x21e2e5['attrs'][0x5]?_0x21e2e5[_0x234f('0x45')][0x5][_0x234f('0x46')]:undefined)||''},{'name':_0x234f('0x57'),'value':_0x21e2e5[_0x234f('0x57')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x6]?_0x21e2e5[_0x234f('0x45')][0x6][_0x234f('0x46')]:undefined)||''},{'name':_0x234f('0x58'),'value':_0x21e2e5[_0x234f('0x58')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x7]?_0x21e2e5['attrs'][0x7][_0x234f('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x21e2e5[_0x234f('0x59')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x8]?_0x21e2e5[_0x234f('0x45')][0x8]['value']:undefined)||''},{'name':_0x234f('0x5a'),'value':_0x21e2e5[_0x234f('0x5a')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0x9]?_0x21e2e5[_0x234f('0x45')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x21e2e5[_0x234f('0x5b')]||(_0x21e2e5[_0x234f('0x45')]&&_0x21e2e5[_0x234f('0x45')][0xa]?_0x21e2e5[_0x234f('0x45')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x234f('0x5f'),'type':_0x21e2e5[_0x234f('0x60')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x0]?_0x21e2e5[_0x234f('0x45')][0x0][_0x234f('0x61')]:undefined)||null,'value':_0x21e2e5[_0x234f('0x5f')]||(_0x21e2e5['attrs']&&_0x21e2e5[_0x234f('0x45')][0x0]?_0x21e2e5['attrs'][0x0][_0x234f('0x46')]:undefined)||null},{'name':'attrRefresh','value':_0x21e2e5['attrRefresh']||(_0x21e2e5['attrs']&&_0x21e2e5['attrs'][0x1]?_0x21e2e5[_0x234f('0x45')][0x1][_0x234f('0x46')]:undefined)||0x0}];default:return[];}}catch(_0xac24ff){logger[_0x234f('0x30')](_0x234f('0x62'),JSON[_0x234f('0x63')](_0xac24ff));return[];}}exports[_0x234f('0x64')]=function(_0x53f2b5,_0x31caa5){if(_0x53f2b5['body']){_0x53f2b5[_0x234f('0x65')][_0x234f('0x45')]=widgetAttributes(_0x53f2b5[_0x234f('0x65')]);}return db[_0x234f('0x37')][_0x234f('0x64')](_0x53f2b5[_0x234f('0x65')],{})['then'](respondWithResult(_0x31caa5,0xc9))[_0x234f('0x42')](handleError(_0x31caa5,null));};exports[_0x234f('0x2c')]=function(_0x2cfea7,_0x1f1016){if(_0x2cfea7['body']['id']){delete _0x2cfea7[_0x234f('0x65')]['id'];}_0x2cfea7['body'][_0x234f('0x45')]=widgetAttributes(_0x2cfea7[_0x234f('0x65')]);return db[_0x234f('0x37')][_0x234f('0x43')]({'where':{'id':_0x2cfea7[_0x234f('0x66')]['id']}})[_0x234f('0x2d')](handleEntityNotFound(_0x1f1016,null))['then'](saveUpdates(_0x2cfea7['body'],null))[_0x234f('0x2d')](respondWithResult(_0x1f1016,null))[_0x234f('0x42')](handleError(_0x1f1016,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 166740c..0fd7ef6 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 _0x9264=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners','remove'];(function(_0x248317,_0x3d22ea){var _0x56eeba=function(_0x15dd5a){while(--_0x15dd5a){_0x248317['push'](_0x248317['shift']());}};_0x56eeba(++_0x3d22ea);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4926('0x0'));var DashboardItem=require(_0x4926('0x1'))['db'][_0x4926('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4926('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4926('0x4')};function emitEvent(_0x483fdd){return function(_0x49b167,_0x1a2246,_0x4e0848){DashboardItemEvents['emit'](_0x483fdd+':'+_0x49b167['id'],_0x49b167);DashboardItemEvents['emit'](_0x483fdd,_0x49b167);_0x4e0848(null);};}for(var e in events){if(events[_0x4926('0x5')](e)){var event=events[e];DashboardItem[_0x4926('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x7949=['events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x40dc85,_0x294be4){var _0x33eb9c=function(_0x4302a6){while(--_0x4302a6){_0x40dc85['push'](_0x40dc85['shift']());}};_0x33eb9c(++_0x294be4);}(_0x7949,0xfc));var _0x9794=function(_0x919a2c,_0x475496){_0x919a2c=_0x919a2c-0x0;var _0x1604b2=_0x7949[_0x919a2c];return _0x1604b2;};'use strict';var EventEmitter=require(_0x9794('0x0'));var DashboardItem=require(_0x9794('0x1'))['db'][_0x9794('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9794('0x3')](0x0);var events={'afterCreate':_0x9794('0x4'),'afterUpdate':'update','afterDestroy':_0x9794('0x5')};function emitEvent(_0x57d739){return function(_0x489a02,_0x2bdda7,_0x1c618d){DashboardItemEvents[_0x9794('0x6')](_0x57d739+':'+_0x489a02['id'],_0x489a02);DashboardItemEvents[_0x9794('0x6')](_0x57d739,_0x489a02);_0x1c618d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x9794('0x7')](e,emitEvent(event));}}module[_0x9794('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 7d1014b..1f629b5 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 _0xcc1b=['bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items','lodash','../../config/logger','moment'];(function(_0x201298,_0x4da3ed){var _0x2dbc6b=function(_0xcd482c){while(--_0xcd482c){_0x201298['push'](_0x201298['shift']());}};_0x2dbc6b(++_0x4da3ed);}(_0xcc1b,0x8c));var _0xbcc1=function(_0x577b80,_0x2f7b54){_0x577b80=_0x577b80-0x0;var _0x36af8f=_0xcc1b[_0x577b80];return _0x36af8f;};'use strict';var _=require(_0xbcc1('0x0'));var util=require('util');var logger=require(_0xbcc1('0x1'))('api');var moment=require(_0xbcc1('0x2'));var BPromise=require(_0xbcc1('0x3'));var rp=require(_0xbcc1('0x4'));var fs=require('fs');var path=require(_0xbcc1('0x5'));var rimraf=require(_0xbcc1('0x6'));var config=require(_0xbcc1('0x7'));var attributes=require(_0xbcc1('0x8'));module['exports']=function(_0x3497dc,_0x23c6a2){return _0x3497dc[_0xbcc1('0x9')]('DashboardItem',attributes,{'tableName':_0xbcc1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6460=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','dashboard_items'];(function(_0x364852,_0x17691e){var _0x2ec071=function(_0x5608a1){while(--_0x5608a1){_0x364852['push'](_0x364852['shift']());}};_0x2ec071(++_0x17691e);}(_0x6460,0xb4));var _0x0646=function(_0x15cef4,_0x448b97){_0x15cef4=_0x15cef4-0x0;var _0x384430=_0x6460[_0x15cef4];return _0x384430;};'use strict';var _=require(_0x0646('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0646('0x1'));var BPromise=require(_0x0646('0x2'));var rp=require(_0x0646('0x3'));var fs=require('fs');var path=require(_0x0646('0x4'));var rimraf=require(_0x0646('0x5'));var config=require(_0x0646('0x6'));var attributes=require(_0x0646('0x7'));module[_0x0646('0x8')]=function(_0x577663,_0x4a0b87){return _0x577663['define']('DashboardItem',attributes,{'tableName':_0x0646('0x9'),'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 fc9d95f..bd943a8 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 _0x74a8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util'];(function(_0x70d346,_0x5a3bb9){var _0xa8ea38=function(_0x21f8ae){while(--_0x21f8ae){_0x70d346['push'](_0x70d346['shift']());}};_0xa8ea38(++_0x5a3bb9);}(_0x74a8,0xb4));var _0x874a=function(_0x100953,_0x2a6dad){_0x100953=_0x100953-0x0;var _0x1fb14d=_0x74a8[_0x100953];return _0x1fb14d;};'use strict';var _=require(_0x874a('0x0'));var util=require(_0x874a('0x1'));var moment=require(_0x874a('0x2'));var BPromise=require(_0x874a('0x3'));var rs=require(_0x874a('0x4'));var fs=require('fs');var Redis=require(_0x874a('0x5'));var db=require(_0x874a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x874a('0x7'))(_0x874a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x874a('0x9')][_0x874a('0xa')]({'port':0x232a});config[_0x874a('0xb')]=_[_0x874a('0xc')](config[_0x874a('0xb')],{'host':_0x874a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x874a('0xe'))[_0x874a('0xf')](socket);function respondWithRpcPromise(_0x14332d,_0x4e5cac,_0x2b275b){return new BPromise(function(_0x1bb6b5,_0x4aaf8b){return client[_0x874a('0x10')](_0x14332d,_0x2b275b)[_0x874a('0x11')](function(_0x2a41df){logger[_0x874a('0x12')](_0x874a('0x13'),_0x4e5cac,_0x874a('0x14'));logger[_0x874a('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4e5cac,_0x874a('0x14'),JSON[_0x874a('0x16')](_0x2a41df));if(_0x2a41df[_0x874a('0x17')]){if(_0x2a41df['error'][_0x874a('0x18')]===0x1f4){logger[_0x874a('0x17')](_0x874a('0x13'),_0x4e5cac,_0x2a41df[_0x874a('0x17')][_0x874a('0x19')]);return _0x4aaf8b(_0x2a41df[_0x874a('0x17')][_0x874a('0x19')]);}logger[_0x874a('0x17')](_0x874a('0x13'),_0x4e5cac,_0x2a41df['error'][_0x874a('0x19')]);return _0x1bb6b5(_0x2a41df[_0x874a('0x17')][_0x874a('0x19')]);}else{logger[_0x874a('0x12')](_0x874a('0x13'),_0x4e5cac,_0x874a('0x14'));_0x1bb6b5(_0x2a41df['result'][_0x874a('0x19')]);}})['catch'](function(_0x262866){logger[_0x874a('0x17')](_0x874a('0x13'),_0x4e5cac,_0x262866);_0x4aaf8b(_0x262866);});});} \ No newline at end of file +var _0x6ee9=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3a4639,_0x42370a){var _0x17f851=function(_0x210a54){while(--_0x210a54){_0x3a4639['push'](_0x3a4639['shift']());}};_0x17f851(++_0x42370a);}(_0x6ee9,0x199));var _0x96ee=function(_0x3f7c98,_0x5f3fb7){_0x3f7c98=_0x3f7c98-0x0;var _0x2bc60e=_0x6ee9[_0x3f7c98];return _0x2bc60e;};'use strict';var _=require(_0x96ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x96ee('0x1'));var rs=require(_0x96ee('0x2'));var fs=require('fs');var Redis=require(_0x96ee('0x3'));var db=require(_0x96ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x96ee('0x5'))(_0x96ee('0x6'));var config=require(_0x96ee('0x7'));var jayson=require(_0x96ee('0x8'));var client=jayson[_0x96ee('0x9')]['http']({'port':0x232a});config[_0x96ee('0xa')]=_[_0x96ee('0xb')](config[_0x96ee('0xa')],{'host':_0x96ee('0xc'),'port':0x18eb});var socket=require(_0x96ee('0xd'))(new Redis(config[_0x96ee('0xa')]));require('./dashboardItem.socket')[_0x96ee('0xe')](socket);function respondWithRpcPromise(_0x336283,_0x279d63,_0x5354f5){return new BPromise(function(_0x2a451f,_0x4eac3a){return client[_0x96ee('0xf')](_0x336283,_0x5354f5)[_0x96ee('0x10')](function(_0x3b3ab9){logger[_0x96ee('0x11')](_0x96ee('0x12'),_0x279d63,_0x96ee('0x13'));logger[_0x96ee('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x279d63,_0x96ee('0x13'),JSON[_0x96ee('0x15')](_0x3b3ab9));if(_0x3b3ab9[_0x96ee('0x16')]){if(_0x3b3ab9[_0x96ee('0x16')][_0x96ee('0x17')]===0x1f4){logger[_0x96ee('0x16')](_0x96ee('0x12'),_0x279d63,_0x3b3ab9[_0x96ee('0x16')][_0x96ee('0x18')]);return _0x4eac3a(_0x3b3ab9[_0x96ee('0x16')][_0x96ee('0x18')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x279d63,_0x3b3ab9[_0x96ee('0x16')][_0x96ee('0x18')]);return _0x2a451f(_0x3b3ab9['error'][_0x96ee('0x18')]);}else{logger[_0x96ee('0x11')]('DashboardItem,\x20%s,\x20%s',_0x279d63,_0x96ee('0x13'));_0x2a451f(_0x3b3ab9['result']['message']);}})[_0x96ee('0x19')](function(_0x2388ee){logger['error'](_0x96ee('0x12'),_0x279d63,_0x2388ee);_0x4eac3a(_0x2388ee);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 928e424..eb6752e 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 _0x9536=['./dashboardItem.events','save','remove','update','emit','removeListener','register','dashboardItem:'];(function(_0x5c967a,_0x254ae5){var _0x412b4a=function(_0x186e93){while(--_0x186e93){_0x5c967a['push'](_0x5c967a['shift']());}};_0x412b4a(++_0x254ae5);}(_0x9536,0xf0));var _0x6953=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x9536[_0x1e1965];return _0x1a2e96;};'use strict';var DashboardItemEvents=require(_0x6953('0x0'));var events=[_0x6953('0x1'),_0x6953('0x2'),_0x6953('0x3')];function createListener(_0x2e0234,_0x2ea2c7){return function(_0x3e844f){_0x2ea2c7[_0x6953('0x4')](_0x2e0234,_0x3e844f);};}function removeListener(_0x49f704,_0xcfe6f2){return function(){DashboardItemEvents[_0x6953('0x5')](_0x49f704,_0xcfe6f2);};}exports[_0x6953('0x6')]=function(_0x413610){for(var _0x464719=0x0,_0x2cadc8=events['length'];_0x464719<_0x2cadc8;_0x464719++){var _0x22b8ac=events[_0x464719];var _0x18b338=createListener(_0x6953('0x7')+_0x22b8ac,_0x413610);DashboardItemEvents['on'](_0x22b8ac,_0x18b338);}}; \ No newline at end of file +var _0xdf22=['length','./dashboardItem.events','update','emit','removeListener','register'];(function(_0x18322f,_0x41ac92){var _0x22ad42=function(_0x181aa5){while(--_0x181aa5){_0x18322f['push'](_0x18322f['shift']());}};_0x22ad42(++_0x41ac92);}(_0xdf22,0x139));var _0x2df2=function(_0x5d3a51,_0x1af182){_0x5d3a51=_0x5d3a51-0x0;var _0x63cb46=_0xdf22[_0x5d3a51];return _0x63cb46;};'use strict';var DashboardItemEvents=require(_0x2df2('0x0'));var events=['save','remove',_0x2df2('0x1')];function createListener(_0x44c93a,_0x1cbf7c){return function(_0x2ce6ff){_0x1cbf7c[_0x2df2('0x2')](_0x44c93a,_0x2ce6ff);};}function removeListener(_0x4720c9,_0x4fbe8d){return function(){DashboardItemEvents[_0x2df2('0x3')](_0x4720c9,_0x4fbe8d);};}exports[_0x2df2('0x4')]=function(_0x2fde49){for(var _0x6b8e78=0x0,_0x173b50=events[_0x2df2('0x5')];_0x6b8e78<_0x173b50;_0x6b8e78++){var _0x4707c3=events[_0x6b8e78];var _0x22548c=createListener('dashboardItem:'+_0x4707c3,_0x2fde49);DashboardItemEvents['on'](_0x4707c3,_0x22548c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index b625a9c..ac643ca 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 _0x613d=['delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x613d,0x1d7));var _0xd613=function(_0x12c289,_0x3376b8){_0x12c289=_0x12c289-0x0;var _0x9e28d5=_0x613d[_0x12c289];return _0x9e28d5;};'use strict';var multer=require(_0xd613('0x0'));var util=require(_0xd613('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd613('0x2')]();var fs_extra=require(_0xd613('0x3'));var auth=require(_0xd613('0x4'));var interaction=require(_0xd613('0x5'));var config=require(_0xd613('0x6'));var controller=require(_0xd613('0x7'));router[_0xd613('0x8')](_0xd613('0x9'),auth[_0xd613('0xa')](),controller[_0xd613('0xb')]);router['post']('/',auth[_0xd613('0xa')](),controller[_0xd613('0xc')]);router[_0xd613('0xd')](_0xd613('0x9'),auth[_0xd613('0xa')](),controller[_0xd613('0xe')]);router[_0xd613('0xf')](_0xd613('0x9'),auth[_0xd613('0xa')](),controller[_0xd613('0x10')]);module[_0xd613('0x11')]=router; \ No newline at end of file +var _0x5600=['./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c24be,_0x216414){var _0x8c4a3d=function(_0x2288f0){while(--_0x2288f0){_0x4c24be['push'](_0x4c24be['shift']());}};_0x8c4a3d(++_0x216414);}(_0x5600,0x64));var _0x0560=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x5600[_0x3f4dd9];return _0x31c54a;};'use strict';var multer=require(_0x0560('0x0'));var util=require('util');var path=require(_0x0560('0x1'));var timeout=require(_0x0560('0x2'));var express=require(_0x0560('0x3'));var router=express[_0x0560('0x4')]();var fs_extra=require(_0x0560('0x5'));var auth=require(_0x0560('0x6'));var interaction=require(_0x0560('0x7'));var config=require('../../config/environment');var controller=require(_0x0560('0x8'));router[_0x0560('0x9')](_0x0560('0xa'),auth[_0x0560('0xb')](),controller[_0x0560('0xc')]);router[_0x0560('0xd')]('/',auth[_0x0560('0xb')](),controller[_0x0560('0xe')]);router[_0x0560('0xf')](_0x0560('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x0560('0x10')](_0x0560('0xa'),auth[_0x0560('0xb')](),controller[_0x0560('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 172272a..92f292e 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 _0x221a=['first','sequelize','STRING','ENUM','third'];(function(_0x203db3,_0xa5bf83){var _0x569f75=function(_0xa9272d){while(--_0xa9272d){_0x203db3['push'](_0x203db3['shift']());}};_0x569f75(++_0xa5bf83);}(_0x221a,0xab));var _0xa221=function(_0x450bbc,_0x1b7af3){_0x450bbc=_0x450bbc-0x0;var _0x3f558a=_0x221a[_0x450bbc];return _0x3f558a;};'use strict';var Sequelize=require(_0xa221('0x0'));module['exports']={'name':{'type':Sequelize[_0xa221('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xa221('0x2')]('first','second',_0xa221('0x3')),'allowNull':![],'defaultValue':_0xa221('0x4')},'description':{'type':Sequelize[_0xa221('0x1')]}}; \ No newline at end of file +var _0xa119=['third','first','STRING','exports','ENUM','second'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa119,0xe7));var _0x9a11=function(_0x32dbd0,_0x17f660){_0x32dbd0=_0x32dbd0-0x0;var _0x38dd01=_0xa119[_0x32dbd0];return _0x38dd01;};'use strict';var Sequelize=require('sequelize');module[_0x9a11('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x9a11('0x1')]('first',_0x9a11('0x2'),_0x9a11('0x3')),'allowNull':![],'defaultValue':_0x9a11('0x4')},'description':{'type':Sequelize[_0x9a11('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index a5b819b..7f3da0c 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 _0x68de=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','get','end','name','index','Disposition','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x68de,0x17b));var _0xe68d=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x68de[_0x2c7dc6];return _0x10002b;};'use strict';var emlformat=require(_0xe68d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe68d('0x1'));var jsonpatch=require(_0xe68d('0x2'));var rp=require(_0xe68d('0x3'));var moment=require(_0xe68d('0x4'));var BPromise=require(_0xe68d('0x5'));var Mustache=require(_0xe68d('0x6'));var util=require(_0xe68d('0x7'));var path=require(_0xe68d('0x8'));var sox=require('sox');var csv=require(_0xe68d('0x9'));var ejs=require(_0xe68d('0xa'));var fs=require('fs');var fs_extra=require(_0xe68d('0xb'));var _=require(_0xe68d('0xc'));var squel=require('squel');var crypto=require(_0xe68d('0xd'));var jsforce=require(_0xe68d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe68d('0x9'));var querystring=require(_0xe68d('0xf'));var Papa=require('papaparse');var Redis=require(_0xe68d('0x10'));var authService=require(_0xe68d('0x11'));var qs=require(_0xe68d('0x12'));var as=require(_0xe68d('0x13'));var hardwareService=require(_0xe68d('0x14'));var logger=require(_0xe68d('0x15'))('api');var utils=require(_0xe68d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x326710,_0x288e05){_0x288e05=_0x288e05||0xcc;return function(_0x4fe5f5){if(_0x4fe5f5){return _0x326710[_0xe68d('0x17')](_0x288e05);}return _0x326710['status'](_0x288e05)['end']();};}function respondWithResult(_0x312a88,_0x50d4b9){_0x50d4b9=_0x50d4b9||0xc8;return function(_0x1d274c){if(_0x1d274c){return _0x312a88['status'](_0x50d4b9)[_0xe68d('0x18')](_0x1d274c);}};}function respondWithFilteredResult(_0x2b5dad,_0x3aaddb){return function(_0x1db48f){if(_0x1db48f){var _0x18d63c=typeof _0x3aaddb[_0xe68d('0x19')]===_0xe68d('0x1a')&&typeof _0x3aaddb[_0xe68d('0x1b')]==='undefined';var _0xfebc70=_0x1db48f[_0xe68d('0x1c')];var _0x1c1405=_0x18d63c?0x0:_0x3aaddb[_0xe68d('0x19')];var _0x307326=_0x18d63c?_0x1db48f[_0xe68d('0x1c')]:_0x3aaddb['offset']+_0x3aaddb[_0xe68d('0x1b')];var _0x509aa1;if(_0x307326>=_0xfebc70){_0x307326=_0xfebc70;_0x509aa1=0xc8;}else{_0x509aa1=0xce;}_0x2b5dad[_0xe68d('0x1d')](_0x509aa1);return _0x2b5dad[_0xe68d('0x1e')](_0xe68d('0x1f'),_0x1c1405+'-'+_0x307326+'/'+_0xfebc70)[_0xe68d('0x18')](_0x1db48f);}return null;};}function patchUpdates(_0x56d5a8){return function(_0x3ca0dc){try{jsonpatch[_0xe68d('0x20')](_0x3ca0dc,_0x56d5a8,!![]);}catch(_0x1ee4d2){return BPromise['reject'](_0x1ee4d2);}return _0x3ca0dc[_0xe68d('0x21')]();};}function saveUpdates(_0x5e1121,_0x372487){return function(_0x3b98b0){if(_0x3b98b0){return _0x3b98b0[_0xe68d('0x22')](_0x5e1121)[_0xe68d('0x23')](function(_0x48382e){return _0x48382e;});}return null;};}function removeEntity(_0x500696,_0x16ff50){return function(_0x33047b){if(_0x33047b){return _0x33047b[_0xe68d('0x24')]()[_0xe68d('0x23')](function(){var _0x479e7e=_0x33047b[_0xe68d('0x25')]({'plain':!![]});var _0x534eeb='Dispositions';return db['UserProfileResource'][_0xe68d('0x24')]({'where':{'type':_0x534eeb,'resourceId':_0x479e7e['id']}})[_0xe68d('0x23')](function(){return _0x33047b;});})[_0xe68d('0x23')](function(){_0x500696['status'](0xcc)[_0xe68d('0x26')]();});}};}function handleEntityNotFound(_0x4e466e,_0xf4914c){return function(_0x1c3005){if(!_0x1c3005){_0x4e466e['sendStatus'](0x194);}return _0x1c3005;};}function handleError(_0xa936f,_0x17d6cf){_0x17d6cf=_0x17d6cf||0x1f4;return function(_0x5651be){logger['error'](_0x5651be['stack']);if(_0x5651be[_0xe68d('0x27')]){delete _0x5651be[_0xe68d('0x27')];}_0xa936f[_0xe68d('0x1d')](_0x17d6cf)['send'](_0x5651be);};}exports[_0xe68d('0x28')]=function(_0x1aa770,_0x13abb6){var _0x44f26c={},_0x58c3ca={},_0x3253db={'count':0x0,'rows':[]};var _0x5a90f0=_['map'](db[_0xe68d('0x29')][_0xe68d('0x2a')],function(_0x229305){return{'name':_0x229305[_0xe68d('0x2b')],'type':_0x229305['type'][_0xe68d('0x2c')]};});_0x58c3ca[_0xe68d('0x2d')]=_[_0xe68d('0x2e')](_0x5a90f0,_0xe68d('0x27'));_0x58c3ca['query']=_[_0xe68d('0x2f')](_0x1aa770[_0xe68d('0x30')]);_0x58c3ca[_0xe68d('0x31')]=_[_0xe68d('0x32')](_0x58c3ca[_0xe68d('0x2d')],_0x58c3ca[_0xe68d('0x30')]);_0x44f26c['attributes']=_[_0xe68d('0x32')](_0x58c3ca[_0xe68d('0x2d')],qs[_0xe68d('0x33')](_0x1aa770[_0xe68d('0x30')][_0xe68d('0x33')]));_0x44f26c['attributes']=_0x44f26c['attributes'][_0xe68d('0x34')]?_0x44f26c[_0xe68d('0x35')]:_0x58c3ca[_0xe68d('0x2d')];if(!_0x1aa770['query'][_0xe68d('0x36')]('nolimit')){_0x44f26c[_0xe68d('0x1b')]=qs[_0xe68d('0x1b')](_0x1aa770[_0xe68d('0x30')][_0xe68d('0x1b')]);_0x44f26c['offset']=qs['offset'](_0x1aa770['query']['offset']);}_0x44f26c[_0xe68d('0x37')]=qs[_0xe68d('0x38')](_0x1aa770[_0xe68d('0x30')][_0xe68d('0x38')]);_0x44f26c['where']=qs[_0xe68d('0x31')](_['pick'](_0x1aa770[_0xe68d('0x30')],_0x58c3ca[_0xe68d('0x31')]),_0x5a90f0);if(_0x1aa770[_0xe68d('0x30')][_0xe68d('0x39')]){_0x44f26c[_0xe68d('0x3a')]=_['merge'](_0x44f26c['where'],{'$or':_['map'](_0x5a90f0,function(_0x2d0c8d){if(_0x2d0c8d[_0xe68d('0x3b')]!==_0xe68d('0x3c')){var _0x45e0e9={};_0x45e0e9[_0x2d0c8d[_0xe68d('0x27')]]={'$like':'%'+_0x1aa770[_0xe68d('0x30')][_0xe68d('0x39')]+'%'};return _0x45e0e9;}})});}_0x44f26c=_['merge']({},_0x44f26c,_0x1aa770[_0xe68d('0x3d')]);var _0x5efb76={'where':_0x44f26c[_0xe68d('0x3a')]};return db[_0xe68d('0x29')][_0xe68d('0x1c')](_0x5efb76)[_0xe68d('0x23')](function(_0x52246a){_0x3253db[_0xe68d('0x1c')]=_0x52246a;if(_0x1aa770[_0xe68d('0x30')]['includeAll']){_0x44f26c[_0xe68d('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0xe68d('0x3f')](_0x44f26c);})['then'](function(_0x2ab2b2){_0x3253db[_0xe68d('0x40')]=_0x2ab2b2;return _0x3253db;})[_0xe68d('0x23')](respondWithFilteredResult(_0x13abb6,_0x44f26c))[_0xe68d('0x41')](handleError(_0x13abb6,null));};exports[_0xe68d('0x42')]=function(_0x36ac69,_0x46639f){var _0x1bab7e={'raw':!![],'where':{'id':_0x36ac69[_0xe68d('0x43')]['id']}},_0x59813e={};_0x59813e['model']=_[_0xe68d('0x2f')](db['Disposition'][_0xe68d('0x2a')]);_0x59813e[_0xe68d('0x30')]=_[_0xe68d('0x2f')](_0x36ac69[_0xe68d('0x30')]);_0x59813e[_0xe68d('0x31')]=_[_0xe68d('0x32')](_0x59813e[_0xe68d('0x2d')],_0x59813e['query']);_0x1bab7e[_0xe68d('0x35')]=_[_0xe68d('0x32')](_0x59813e['model'],qs['fields'](_0x36ac69[_0xe68d('0x30')][_0xe68d('0x33')]));_0x1bab7e[_0xe68d('0x35')]=_0x1bab7e['attributes'][_0xe68d('0x34')]?_0x1bab7e[_0xe68d('0x35')]:_0x59813e[_0xe68d('0x2d')];if(_0x36ac69[_0xe68d('0x30')][_0xe68d('0x44')]){_0x1bab7e['include']=[{'all':!![]}];}_0x1bab7e=_[_0xe68d('0x45')]({},_0x1bab7e,_0x36ac69[_0xe68d('0x3d')]);return db[_0xe68d('0x29')][_0xe68d('0x46')](_0x1bab7e)[_0xe68d('0x23')](handleEntityNotFound(_0x46639f,null))[_0xe68d('0x23')](respondWithResult(_0x46639f,null))[_0xe68d('0x41')](handleError(_0x46639f,null));};exports['create']=function(_0x2f94fd,_0x2ecd88){return db[_0xe68d('0x29')][_0xe68d('0x47')](_0x2f94fd[_0xe68d('0x48')],{})['then'](function(_0x3359a6){var _0x3807fa=_0x2f94fd['user'][_0xe68d('0x25')]({'plain':!![]});if(!_0x3807fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3807fa['role']===_0xe68d('0x49')){var _0x3c333c=_0x3359a6[_0xe68d('0x25')]({'plain':!![]});var _0x1e76a0='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x1e76a0,'userProfileId':_0x3807fa[_0xe68d('0x4a')]},'raw':!![]})[_0xe68d('0x23')](function(_0x17854f){if(_0x17854f&&_0x17854f[_0xe68d('0x4b')]===0x0){return db[_0xe68d('0x4c')]['create']({'name':_0x3c333c['name'],'resourceId':_0x3c333c['id'],'type':_0x17854f[_0xe68d('0x27')],'sectionId':_0x17854f['id']},{})['then'](function(){return _0x3359a6;});}else{return _0x3359a6;}})[_0xe68d('0x41')](function(_0x4f6596){logger[_0xe68d('0x4d')](_0xe68d('0x4e'),_0x4f6596);throw _0x4f6596;});}return _0x3359a6;})[_0xe68d('0x23')](respondWithResult(_0x2ecd88,0xc9))['catch'](handleError(_0x2ecd88,null));};exports[_0xe68d('0x22')]=function(_0x2c0d52,_0x246abd){if(_0x2c0d52[_0xe68d('0x48')]['id']){delete _0x2c0d52[_0xe68d('0x48')]['id'];}return db[_0xe68d('0x29')][_0xe68d('0x46')]({'where':{'id':_0x2c0d52[_0xe68d('0x43')]['id']}})[_0xe68d('0x23')](handleEntityNotFound(_0x246abd,null))[_0xe68d('0x23')](saveUpdates(_0x2c0d52['body'],null))['then'](respondWithResult(_0x246abd,null))[_0xe68d('0x41')](handleError(_0x246abd,null));};exports[_0xe68d('0x24')]=function(_0x295ca5,_0x124e58){return db['Disposition'][_0xe68d('0x46')]({'where':{'id':_0x295ca5[_0xe68d('0x43')]['id']}})['then'](handleEntityNotFound(_0x124e58,null))[_0xe68d('0x23')](removeEntity(_0x124e58,null))['catch'](handleError(_0x124e58,null));}; \ No newline at end of file +var _0x063a=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','Disposition','include','rows','catch','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Dispositions','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x1f66b4,_0x5f251c){var _0x50999e=function(_0x40e4f2){while(--_0x40e4f2){_0x1f66b4['push'](_0x1f66b4['shift']());}};_0x50999e(++_0x5f251c);}(_0x063a,0x1e0));var _0xa063=function(_0x1a32e2,_0x1c7d02){_0x1a32e2=_0x1a32e2-0x0;var _0x5af212=_0x063a[_0x1a32e2];return _0x5af212;};'use strict';var emlformat=require(_0xa063('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa063('0x1'));var rp=require('request-promise');var moment=require(_0xa063('0x2'));var BPromise=require(_0xa063('0x3'));var Mustache=require(_0xa063('0x4'));var util=require(_0xa063('0x5'));var path=require(_0xa063('0x6'));var sox=require('sox');var csv=require(_0xa063('0x7'));var ejs=require(_0xa063('0x8'));var fs=require('fs');var fs_extra=require(_0xa063('0x9'));var _=require('lodash');var squel=require(_0xa063('0xa'));var crypto=require(_0xa063('0xb'));var jsforce=require(_0xa063('0xc'));var deskjs=require(_0xa063('0xd'));var toCsv=require(_0xa063('0x7'));var querystring=require(_0xa063('0xe'));var Papa=require(_0xa063('0xf'));var Redis=require(_0xa063('0x10'));var authService=require(_0xa063('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa063('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa063('0x13'))(_0xa063('0x14'));var utils=require(_0xa063('0x15'));var config=require(_0xa063('0x16'));var licenseUtil=require(_0xa063('0x17'));var db=require(_0xa063('0x18'))['db'];function respondWithStatusCode(_0x45241f,_0x5d2d0d){_0x5d2d0d=_0x5d2d0d||0xcc;return function(_0x462dbd){if(_0x462dbd){return _0x45241f[_0xa063('0x19')](_0x5d2d0d);}return _0x45241f[_0xa063('0x1a')](_0x5d2d0d)['end']();};}function respondWithResult(_0x40521a,_0x1c58f1){_0x1c58f1=_0x1c58f1||0xc8;return function(_0x4a5edd){if(_0x4a5edd){return _0x40521a[_0xa063('0x1a')](_0x1c58f1)[_0xa063('0x1b')](_0x4a5edd);}};}function respondWithFilteredResult(_0x539852,_0x2d7819){return function(_0x48396e){if(_0x48396e){var _0x3b3f37=typeof _0x2d7819[_0xa063('0x1c')]===_0xa063('0x1d')&&typeof _0x2d7819[_0xa063('0x1e')]===_0xa063('0x1d');var _0x2fc768=_0x48396e[_0xa063('0x1f')];var _0x4aabc8=_0x3b3f37?0x0:_0x2d7819[_0xa063('0x1c')];var _0xc5b2ed=_0x3b3f37?_0x48396e[_0xa063('0x1f')]:_0x2d7819['offset']+_0x2d7819['limit'];var _0x59725f;if(_0xc5b2ed>=_0x2fc768){_0xc5b2ed=_0x2fc768;_0x59725f=0xc8;}else{_0x59725f=0xce;}_0x539852[_0xa063('0x1a')](_0x59725f);return _0x539852[_0xa063('0x20')](_0xa063('0x21'),_0x4aabc8+'-'+_0xc5b2ed+'/'+_0x2fc768)[_0xa063('0x1b')](_0x48396e);}return null;};}function patchUpdates(_0x4aba7d){return function(_0x53fe54){try{jsonpatch['apply'](_0x53fe54,_0x4aba7d,!![]);}catch(_0x4300d5){return BPromise[_0xa063('0x22')](_0x4300d5);}return _0x53fe54[_0xa063('0x23')]();};}function saveUpdates(_0x16d2dd,_0x4484bd){return function(_0x1106b4){if(_0x1106b4){return _0x1106b4[_0xa063('0x24')](_0x16d2dd)[_0xa063('0x25')](function(_0x426dc7){return _0x426dc7;});}return null;};}function removeEntity(_0x1f156a,_0x532d15){return function(_0x191051){if(_0x191051){return _0x191051[_0xa063('0x26')]()[_0xa063('0x25')](function(){var _0x22759d=_0x191051[_0xa063('0x27')]({'plain':!![]});var _0x904498='Dispositions';return db[_0xa063('0x28')][_0xa063('0x26')]({'where':{'type':_0x904498,'resourceId':_0x22759d['id']}})[_0xa063('0x25')](function(){return _0x191051;});})['then'](function(){_0x1f156a[_0xa063('0x1a')](0xcc)[_0xa063('0x29')]();});}};}function handleEntityNotFound(_0xcff237,_0x418fa1){return function(_0x1e0c24){if(!_0x1e0c24){_0xcff237['sendStatus'](0x194);}return _0x1e0c24;};}function handleError(_0x348eed,_0x2d60b4){_0x2d60b4=_0x2d60b4||0x1f4;return function(_0x385aba){logger[_0xa063('0x2a')](_0x385aba[_0xa063('0x2b')]);if(_0x385aba['name']){delete _0x385aba[_0xa063('0x2c')];}_0x348eed[_0xa063('0x1a')](_0x2d60b4)[_0xa063('0x2d')](_0x385aba);};}exports[_0xa063('0x2e')]=function(_0x3b1fb0,_0x2565d1){var _0x2f6663={},_0x3de7be={},_0x1f7b29={'count':0x0,'rows':[]};var _0x3e5e11=_[_0xa063('0x2f')](db['Disposition'][_0xa063('0x30')],function(_0x3b0ea1){return{'name':_0x3b0ea1[_0xa063('0x31')],'type':_0x3b0ea1[_0xa063('0x32')][_0xa063('0x33')]};});_0x3de7be[_0xa063('0x34')]=_[_0xa063('0x2f')](_0x3e5e11,_0xa063('0x2c'));_0x3de7be[_0xa063('0x35')]=_[_0xa063('0x36')](_0x3b1fb0['query']);_0x3de7be[_0xa063('0x37')]=_[_0xa063('0x38')](_0x3de7be['model'],_0x3de7be[_0xa063('0x35')]);_0x2f6663[_0xa063('0x39')]=_['intersection'](_0x3de7be[_0xa063('0x34')],qs[_0xa063('0x3a')](_0x3b1fb0[_0xa063('0x35')][_0xa063('0x3a')]));_0x2f6663[_0xa063('0x39')]=_0x2f6663['attributes'][_0xa063('0x3b')]?_0x2f6663[_0xa063('0x39')]:_0x3de7be[_0xa063('0x34')];if(!_0x3b1fb0[_0xa063('0x35')]['hasOwnProperty']('nolimit')){_0x2f6663[_0xa063('0x1e')]=qs[_0xa063('0x1e')](_0x3b1fb0[_0xa063('0x35')]['limit']);_0x2f6663['offset']=qs[_0xa063('0x1c')](_0x3b1fb0[_0xa063('0x35')]['offset']);}_0x2f6663[_0xa063('0x3c')]=qs[_0xa063('0x3d')](_0x3b1fb0[_0xa063('0x35')][_0xa063('0x3d')]);_0x2f6663[_0xa063('0x3e')]=qs[_0xa063('0x37')](_[_0xa063('0x3f')](_0x3b1fb0['query'],_0x3de7be[_0xa063('0x37')]),_0x3e5e11);if(_0x3b1fb0[_0xa063('0x35')][_0xa063('0x40')]){_0x2f6663[_0xa063('0x3e')]=_[_0xa063('0x41')](_0x2f6663[_0xa063('0x3e')],{'$or':_[_0xa063('0x2f')](_0x3e5e11,function(_0x1123b0){if(_0x1123b0['type']!=='VIRTUAL'){var _0x2a52b8={};_0x2a52b8[_0x1123b0[_0xa063('0x2c')]]={'$like':'%'+_0x3b1fb0[_0xa063('0x35')][_0xa063('0x40')]+'%'};return _0x2a52b8;}})});}_0x2f6663=_[_0xa063('0x41')]({},_0x2f6663,_0x3b1fb0[_0xa063('0x42')]);var _0xaadf8c={'where':_0x2f6663['where']};return db[_0xa063('0x43')]['count'](_0xaadf8c)['then'](function(_0x494dc7){_0x1f7b29[_0xa063('0x1f')]=_0x494dc7;if(_0x3b1fb0[_0xa063('0x35')]['includeAll']){_0x2f6663[_0xa063('0x44')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2f6663);})[_0xa063('0x25')](function(_0x5dc93e){_0x1f7b29[_0xa063('0x45')]=_0x5dc93e;return _0x1f7b29;})[_0xa063('0x25')](respondWithFilteredResult(_0x2565d1,_0x2f6663))[_0xa063('0x46')](handleError(_0x2565d1,null));};exports['show']=function(_0x193203,_0x509817){var _0xe6327e={'raw':!![],'where':{'id':_0x193203[_0xa063('0x47')]['id']}},_0x4dc4b1={};_0x4dc4b1[_0xa063('0x34')]=_['keys'](db[_0xa063('0x43')][_0xa063('0x30')]);_0x4dc4b1[_0xa063('0x35')]=_[_0xa063('0x36')](_0x193203[_0xa063('0x35')]);_0x4dc4b1[_0xa063('0x37')]=_[_0xa063('0x38')](_0x4dc4b1[_0xa063('0x34')],_0x4dc4b1[_0xa063('0x35')]);_0xe6327e[_0xa063('0x39')]=_[_0xa063('0x38')](_0x4dc4b1[_0xa063('0x34')],qs[_0xa063('0x3a')](_0x193203[_0xa063('0x35')]['fields']));_0xe6327e['attributes']=_0xe6327e[_0xa063('0x39')][_0xa063('0x3b')]?_0xe6327e[_0xa063('0x39')]:_0x4dc4b1['model'];if(_0x193203[_0xa063('0x35')][_0xa063('0x48')]){_0xe6327e['include']=[{'all':!![]}];}_0xe6327e=_[_0xa063('0x41')]({},_0xe6327e,_0x193203[_0xa063('0x42')]);return db[_0xa063('0x43')]['find'](_0xe6327e)[_0xa063('0x25')](handleEntityNotFound(_0x509817,null))[_0xa063('0x25')](respondWithResult(_0x509817,null))['catch'](handleError(_0x509817,null));};exports['create']=function(_0x2bec5d,_0x54e087){return db[_0xa063('0x43')][_0xa063('0x49')](_0x2bec5d[_0xa063('0x4a')],{})['then'](function(_0x44eee0){var _0x46e77d=_0x2bec5d[_0xa063('0x4b')][_0xa063('0x27')]({'plain':!![]});if(!_0x46e77d)throw new Error(_0xa063('0x4c'));if(_0x46e77d['role']===_0xa063('0x4b')){var _0x5649c0=_0x44eee0[_0xa063('0x27')]({'plain':!![]});var _0x2a16f6=_0xa063('0x4d');return db[_0xa063('0x4e')]['find']({'where':{'name':_0x2a16f6,'userProfileId':_0x46e77d['userProfileId']},'raw':!![]})['then'](function(_0x5928ca){if(_0x5928ca&&_0x5928ca[_0xa063('0x4f')]===0x0){return db[_0xa063('0x28')][_0xa063('0x49')]({'name':_0x5649c0[_0xa063('0x2c')],'resourceId':_0x5649c0['id'],'type':_0x5928ca[_0xa063('0x2c')],'sectionId':_0x5928ca['id']},{})['then'](function(){return _0x44eee0;});}else{return _0x44eee0;}})['catch'](function(_0x56e415){logger[_0xa063('0x2a')](_0xa063('0x50'),_0x56e415);throw _0x56e415;});}return _0x44eee0;})[_0xa063('0x25')](respondWithResult(_0x54e087,0xc9))[_0xa063('0x46')](handleError(_0x54e087,null));};exports[_0xa063('0x24')]=function(_0x18bbb5,_0x1419d4){if(_0x18bbb5[_0xa063('0x4a')]['id']){delete _0x18bbb5['body']['id'];}return db[_0xa063('0x43')][_0xa063('0x51')]({'where':{'id':_0x18bbb5['params']['id']}})['then'](handleEntityNotFound(_0x1419d4,null))['then'](saveUpdates(_0x18bbb5[_0xa063('0x4a')],null))['then'](respondWithResult(_0x1419d4,null))['catch'](handleError(_0x1419d4,null));};exports[_0xa063('0x26')]=function(_0x3fc8db,_0x4f8d91){return db['Disposition'][_0xa063('0x51')]({'where':{'id':_0x3fc8db['params']['id']}})[_0xa063('0x25')](handleEntityNotFound(_0x4f8d91,null))['then'](removeEntity(_0x4f8d91,null))[_0xa063('0x46')](handleError(_0x4f8d91,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index d1f44d1..7c352d9 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 _0xbccc=['rimraf','../../config/environment','exports','define','Disposition','name_voice','ListId','name_chat','ChatWebsiteId','name_mail','name','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x4b897b,_0x374df){var _0x4ae00a=function(_0x5cfa6d){while(--_0x5cfa6d){_0x4b897b['push'](_0x4b897b['shift']());}};_0x4ae00a(++_0x374df);}(_0xbccc,0x19c));var _0xcbcc=function(_0x5b82dd,_0x3e591c){_0x5b82dd=_0x5b82dd-0x0;var _0x4adb42=_0xbccc[_0x5b82dd];return _0x4adb42;};'use strict';var _=require(_0xcbcc('0x0'));var util=require(_0xcbcc('0x1'));var logger=require(_0xcbcc('0x2'))('api');var moment=require(_0xcbcc('0x3'));var BPromise=require('bluebird');var rp=require(_0xcbcc('0x4'));var fs=require('fs');var path=require(_0xcbcc('0x5'));var rimraf=require(_0xcbcc('0x6'));var config=require(_0xcbcc('0x7'));var attributes=require('./disposition.attributes');module[_0xcbcc('0x8')]=function(_0x3738f6,_0x47def1){return _0x3738f6[_0xcbcc('0x9')](_0xcbcc('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xcbcc('0xb'),'fields':['name',_0xcbcc('0xc')]},{'unique':!![],'name':_0xcbcc('0xd'),'fields':['name',_0xcbcc('0xe')]},{'unique':!![],'name':_0xcbcc('0xf'),'fields':[_0xcbcc('0x10'),_0xcbcc('0x11')]},{'unique':!![],'name':'name_sms','fields':['name',_0xcbcc('0x12')]},{'unique':!![],'name':_0xcbcc('0x13'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xcbcc('0x14'),'fields':[_0xcbcc('0x10'),_0xcbcc('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x09f4=['OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','name_openchannel'];(function(_0x46e4ea,_0x571b3a){var _0x29fbac=function(_0x465af1){while(--_0x465af1){_0x46e4ea['push'](_0x46e4ea['shift']());}};_0x29fbac(++_0x571b3a);}(_0x09f4,0x120));var _0x409f=function(_0xb9631a,_0x5b02f8){_0xb9631a=_0xb9631a-0x0;var _0x491d8c=_0x09f4[_0xb9631a];return _0x491d8c;};'use strict';var _=require(_0x409f('0x0'));var util=require(_0x409f('0x1'));var logger=require(_0x409f('0x2'))(_0x409f('0x3'));var moment=require(_0x409f('0x4'));var BPromise=require(_0x409f('0x5'));var rp=require(_0x409f('0x6'));var fs=require('fs');var path=require(_0x409f('0x7'));var rimraf=require(_0x409f('0x8'));var config=require(_0x409f('0x9'));var attributes=require('./disposition.attributes');module['exports']=function(_0x5bef8e,_0x232d15){return _0x5bef8e['define']('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x409f('0xa'),'fields':[_0x409f('0xb'),_0x409f('0xc')]},{'unique':!![],'name':_0x409f('0xd'),'fields':['name',_0x409f('0xe')]},{'unique':!![],'name':_0x409f('0xf'),'fields':[_0x409f('0xb'),_0x409f('0x10')]},{'unique':!![],'name':_0x409f('0x11'),'fields':[_0x409f('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x409f('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x409f('0x13'),'fields':['name',_0x409f('0x14')]},{'unique':!![],'name':_0x409f('0x15'),'fields':[_0x409f('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index bb8cb76..e277fa4 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(_0x36e976,_0x1df359){var _0x9fff2c=function(_0x236009){while(--_0x236009){_0x36e976['push'](_0x36e976['shift']());}};_0x9fff2c(++_0x1df359);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x553b82,_0x7501c7){var _0x204382=function(_0x33fd26){while(--_0x33fd26){_0x553b82['push'](_0x553b82['shift']());}};_0x204382(++_0x7501c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 988d79e..0497138 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 _0x9625=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2d55a4,_0x4dbbd4){var _0x5a743e=function(_0x2ddb1c){while(--_0x2ddb1c){_0x2d55a4['push'](_0x2d55a4['shift']());}};_0x5a743e(++_0x4dbbd4);}(_0x9625,0x109));var _0x5962=function(_0x3bb93f,_0x1df47c){_0x3bb93f=_0x3bb93f-0x0;var _0x483e02=_0x9625[_0x3bb93f];return _0x483e02;};'use strict';var multer=require(_0x5962('0x0'));var util=require('util');var path=require(_0x5962('0x1'));var timeout=require(_0x5962('0x2'));var express=require(_0x5962('0x3'));var router=express[_0x5962('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5962('0x5'));var interaction=require(_0x5962('0x6'));var config=require(_0x5962('0x7'));var controller=require('./disposition.controller');router[_0x5962('0x8')]('/',auth[_0x5962('0x9')](),controller['index']);router[_0x5962('0x8')](_0x5962('0xa'),auth[_0x5962('0x9')](),controller[_0x5962('0xb')]);router[_0x5962('0xc')]('/',auth['isAuthenticated'](),controller[_0x5962('0xd')]);router['put'](_0x5962('0xa'),auth[_0x5962('0x9')](),controller[_0x5962('0xe')]);router[_0x5962('0xf')](_0x5962('0xa'),auth[_0x5962('0x9')](),controller[_0x5962('0x10')]);module[_0x5962('0x11')]=router; \ No newline at end of file +var _0x3f5d=['connect-timeout','express','../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','multer','path'];(function(_0xddfb3,_0x509f41){var _0x5cc06b=function(_0x5c5f5d){while(--_0x5c5f5d){_0xddfb3['push'](_0xddfb3['shift']());}};_0x5cc06b(++_0x509f41);}(_0x3f5d,0x15e));var _0xd3f5=function(_0x1cd096,_0x120619){_0x1cd096=_0x1cd096-0x0;var _0x195274=_0x3f5d[_0x1cd096];return _0x195274;};'use strict';var multer=require(_0xd3f5('0x0'));var util=require('util');var path=require(_0xd3f5('0x1'));var timeout=require(_0xd3f5('0x2'));var express=require(_0xd3f5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd3f5('0x4'));var config=require(_0xd3f5('0x5'));var controller=require(_0xd3f5('0x6'));router[_0xd3f5('0x7')]('/',auth['isAuthenticated'](),controller[_0xd3f5('0x8')]);router[_0xd3f5('0x7')](_0xd3f5('0x9'),auth[_0xd3f5('0xa')](),controller['show']);router[_0xd3f5('0xb')]('/',auth[_0xd3f5('0xa')](),controller['create']);router[_0xd3f5('0xc')](_0xd3f5('0x9'),auth['isAuthenticated'](),controller[_0xd3f5('0xd')]);router[_0xd3f5('0xe')]('/:id',auth[_0xd3f5('0xa')](),controller[_0xd3f5('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 230d6d4..ee8cc3c 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 _0x11e5=['9600','12000','SIP','IAX','DADHI','KHOMP','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','sequelize','STRING','yes','2400','4800','7200','14400','ENUM'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x11e5,0x8b));var _0x511e=function(_0x495c2b,_0x5044b0){_0x495c2b=_0x495c2b-0x0;var _0x370520=_0x11e5[_0x495c2b];return _0x370520;};'use strict';var Sequelize=require(_0x511e('0x0'));module['exports']={'name':{'type':Sequelize[_0x511e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x511e('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x511e('0x2'),'no'),'defaultValue':_0x511e('0x2')},'headerinfo':{'type':Sequelize[_0x511e('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x511e('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0x511e('0x3'),_0x511e('0x4'),_0x511e('0x5'),'9600','12000',_0x511e('0x6')),'defaultValue':_0x511e('0x4')},'maxrate':{'type':Sequelize[_0x511e('0x7')](_0x511e('0x3'),_0x511e('0x4'),_0x511e('0x5'),_0x511e('0x8'),_0x511e('0x9'),_0x511e('0x6')),'defaultValue':_0x511e('0x6')},'modem':{'type':Sequelize[_0x511e('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x511e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x511e('0x7')](_0x511e('0xa'),_0x511e('0xb'),_0x511e('0xc'),_0x511e('0xd')),'defaultValue':_0x511e('0xa')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x511e('0xe')],'defaultValue':function(){return _0x511e('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x511e('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x511e('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x511e('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x511e('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x511e('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x511e('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x511e('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x511e('0x10')],'defaultValue':![],'comment':_0x511e('0x13'),'set':function(_0x577616){if(!_0x577616)this[_0x511e('0x14')]('mandatoryDispositionPauseId',null);this[_0x511e('0x14')]('mandatoryDisposition',_0x577616);}}}; \ No newline at end of file +var _0x44e8=['IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','2400','14400','v17,v27,v29','INTEGER','SIP'];(function(_0x2333b0,_0x2abf08){var _0x3470e3=function(_0x175897){while(--_0x175897){_0x2333b0['push'](_0x2333b0['shift']());}};_0x3470e3(++_0x2abf08);}(_0x44e8,0xd7));var _0x844e=function(_0x13ff04,_0x40f74e){_0x13ff04=_0x13ff04-0x0;var _0x4811ad=_0x44e8[_0x13ff04];return _0x4811ad;};'use strict';var Sequelize=require(_0x844e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x844e('0x1')]},'ecm':{'type':Sequelize[_0x844e('0x2')](_0x844e('0x3'),'no'),'defaultValue':_0x844e('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x844e('0x4')},'localstationid':{'type':Sequelize[_0x844e('0x1')],'unique':_0x844e('0x5')},'minrate':{'type':Sequelize[_0x844e('0x2')]('2400',_0x844e('0x6'),_0x844e('0x7'),_0x844e('0x8'),_0x844e('0x9'),'14400'),'defaultValue':_0x844e('0x6')},'maxrate':{'type':Sequelize[_0x844e('0x2')](_0x844e('0xa'),_0x844e('0x6'),_0x844e('0x7'),_0x844e('0x8'),'12000',_0x844e('0xb')),'defaultValue':_0x844e('0xb')},'modem':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0xc')},'gateway':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x844e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x844e('0xe'),_0x844e('0xf'),'DADHI',_0x844e('0x10')),'defaultValue':_0x844e('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x844e('0x11')],'defaultValue':function(){return _0x844e('0x12');}},'notificationSound':{'type':Sequelize[_0x844e('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x844e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x844e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x844e('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x844e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x844e('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x844e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x844e('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x844e('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x844e('0x15'),'set':function(_0x56791b){if(!_0x56791b)this[_0x844e('0x16')]('mandatoryDispositionPauseId',null);this[_0x844e('0x16')]('mandatoryDisposition',_0x56791b);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 2947045..bd6fc04 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 _0xc7e0=['bulkCreate','FaxApplication','findAndCountAll','priority','finally','getApplications','context','exten','app','system','description','Fax\x20Extension','appdata','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','push','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','format','List','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','out','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','Pause','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','Owner','fullname','internal','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xc7e0,0x1bd));var _0x0c7e=function(_0x154452,_0x165203){_0x154452=_0x154452-0x0;var _0x1e36cd=_0xc7e0[_0x154452];return _0x1e36cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c7e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c7e('0x1'));var rp=require(_0x0c7e('0x2'));var moment=require(_0x0c7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0c7e('0x4'));var util=require(_0x0c7e('0x5'));var path=require('path');var sox=require(_0x0c7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c7e('0x7'));var _=require(_0x0c7e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0c7e('0x9'));var deskjs=require(_0x0c7e('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c7e('0xb'));var Redis=require(_0x0c7e('0xc'));var authService=require(_0x0c7e('0xd'));var qs=require(_0x0c7e('0xe'));var as=require(_0x0c7e('0xf'));var hardwareService=require(_0x0c7e('0x10'));var logger=require('../../config/logger')(_0x0c7e('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0c7e('0x12'));var db=require(_0x0c7e('0x13'))['db'];config[_0x0c7e('0x14')]=_[_0x0c7e('0x15')](config[_0x0c7e('0x14')],{'host':_0x0c7e('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c7e('0x14')]));require(_0x0c7e('0x17'))[_0x0c7e('0x18')](socket);var jayson=require(_0x0c7e('0x19'));var client=jayson[_0x0c7e('0x1a')][_0x0c7e('0x1b')]({'port':0x232c});var client9002=jayson[_0x0c7e('0x1a')][_0x0c7e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x9092cb,_0x50d3b2,_0x34b414,_0x649a11){return new BPromise(function(_0x3a14a,_0x24c83f){var _0x3acae1=_0x649a11||client;return _0x3acae1[_0x0c7e('0x1c')](_0x9092cb,_0x34b414)[_0x0c7e('0x1d')](function(_0x27e5ac){logger[_0x0c7e('0x1e')](_0x0c7e('0x1f'),_0x50d3b2,_0x0c7e('0x20'));logger[_0x0c7e('0x21')](_0x0c7e('0x22'),_0x50d3b2,'request\x20sent',JSON[_0x0c7e('0x23')](_0x27e5ac));if(_0x27e5ac[_0x0c7e('0x24')]){if(_0x27e5ac[_0x0c7e('0x24')][_0x0c7e('0x25')]===0x1f4){logger[_0x0c7e('0x24')]('FaxAccount,\x20%s,\x20%s',_0x50d3b2,_0x27e5ac['error'][_0x0c7e('0x26')]);return _0x24c83f(_0x27e5ac[_0x0c7e('0x24')]['message']);}logger['error'](_0x0c7e('0x1f'),_0x50d3b2,_0x27e5ac[_0x0c7e('0x24')][_0x0c7e('0x26')]);return _0x3a14a(_0x27e5ac[_0x0c7e('0x24')][_0x0c7e('0x26')]);}else{logger[_0x0c7e('0x1e')](_0x0c7e('0x1f'),_0x50d3b2,_0x0c7e('0x20'));_0x3a14a(_0x27e5ac[_0x0c7e('0x27')]['message']);}})[_0x0c7e('0x28')](function(_0x3257c0){logger[_0x0c7e('0x24')]('FaxAccount,\x20%s,\x20%s',_0x50d3b2,_0x3257c0);_0x24c83f(_0x3257c0);});});}function respondWithStatusCode(_0x4c3afd,_0x215a25){_0x215a25=_0x215a25||0xcc;return function(_0x14e615){if(_0x14e615){return _0x4c3afd[_0x0c7e('0x29')](_0x215a25);}return _0x4c3afd[_0x0c7e('0x2a')](_0x215a25)[_0x0c7e('0x2b')]();};}function respondWithResult(_0x392dee,_0x3bd910){_0x3bd910=_0x3bd910||0xc8;return function(_0x5c05a3){if(_0x5c05a3){return _0x392dee[_0x0c7e('0x2a')](_0x3bd910)[_0x0c7e('0x2c')](_0x5c05a3);}};}function respondWithFilteredResult(_0x1d8531,_0x18db35){return function(_0x5af0b2){if(_0x5af0b2){var _0x550e83=typeof _0x18db35[_0x0c7e('0x2d')]===_0x0c7e('0x2e')&&typeof _0x18db35[_0x0c7e('0x2f')]===_0x0c7e('0x2e');var _0x18f6f7=_0x5af0b2[_0x0c7e('0x30')];var _0x5bfbbd=_0x550e83?0x0:_0x18db35[_0x0c7e('0x2d')];var _0x51e96c=_0x550e83?_0x5af0b2[_0x0c7e('0x30')]:_0x18db35['offset']+_0x18db35[_0x0c7e('0x2f')];var _0x2e90bb;if(_0x51e96c>=_0x18f6f7){_0x51e96c=_0x18f6f7;_0x2e90bb=0xc8;}else{_0x2e90bb=0xce;}_0x1d8531[_0x0c7e('0x2a')](_0x2e90bb);return _0x1d8531[_0x0c7e('0x31')]('Content-Range',_0x5bfbbd+'-'+_0x51e96c+'/'+_0x18f6f7)['json'](_0x5af0b2);}return null;};}function patchUpdates(_0x1f319d){return function(_0x445e10){try{jsonpatch[_0x0c7e('0x32')](_0x445e10,_0x1f319d,!![]);}catch(_0x28f90f){return BPromise[_0x0c7e('0x33')](_0x28f90f);}return _0x445e10[_0x0c7e('0x34')]();};}function saveUpdates(_0x1ce782,_0x1bc4bd){return function(_0x47ab3f){if(_0x47ab3f){return _0x47ab3f[_0x0c7e('0x35')](_0x1ce782)[_0x0c7e('0x1d')](function(_0x4e2137){return _0x4e2137;});}return null;};}function removeEntity(_0x5a901d,_0x5b0137){return function(_0x4a09f9){if(_0x4a09f9){return _0x4a09f9[_0x0c7e('0x36')]()[_0x0c7e('0x1d')](function(){var _0x5679d7=_0x4a09f9[_0x0c7e('0x37')]({'plain':!![]});var _0x161df8=_0x0c7e('0x38');return db[_0x0c7e('0x39')][_0x0c7e('0x36')]({'where':{'type':_0x161df8,'resourceId':_0x5679d7['id']}})['then'](function(){return _0x4a09f9;});})[_0x0c7e('0x1d')](function(){_0x5a901d[_0x0c7e('0x2a')](0xcc)[_0x0c7e('0x2b')]();});}};}function handleEntityNotFound(_0x27aeb5,_0x46a8f4){return function(_0x2027ac){if(!_0x2027ac){_0x27aeb5[_0x0c7e('0x29')](0x194);}return _0x2027ac;};}function handleError(_0x8561b0,_0x9b3852){_0x9b3852=_0x9b3852||0x1f4;return function(_0x41f1af){logger[_0x0c7e('0x24')](_0x41f1af['stack']);if(_0x41f1af[_0x0c7e('0x3a')]){delete _0x41f1af[_0x0c7e('0x3a')];}_0x8561b0[_0x0c7e('0x2a')](_0x9b3852)['send'](_0x41f1af);};}exports[_0x0c7e('0x3b')]=function(_0x211853,_0x358533){var _0x42d785={'include':[{'model':db['Pause'],'as':_0x0c7e('0x3c')}]},_0x5a7063={},_0x584d12={'count':0x0,'rows':[]};var _0x1b579a=_[_0x0c7e('0x3d')](db[_0x0c7e('0x3e')][_0x0c7e('0x3f')],function(_0x4dec55){return{'name':_0x4dec55['fieldName'],'type':_0x4dec55[_0x0c7e('0x40')][_0x0c7e('0x41')]};});_0x5a7063[_0x0c7e('0x42')]=_[_0x0c7e('0x3d')](_0x1b579a,_0x0c7e('0x3a'));_0x5a7063['query']=_[_0x0c7e('0x43')](_0x211853[_0x0c7e('0x44')]);_0x5a7063[_0x0c7e('0x45')]=_[_0x0c7e('0x46')](_0x5a7063[_0x0c7e('0x42')],_0x5a7063[_0x0c7e('0x44')]);_0x42d785['attributes']=_[_0x0c7e('0x46')](_0x5a7063['model'],qs[_0x0c7e('0x47')](_0x211853['query'][_0x0c7e('0x47')]));_0x42d785[_0x0c7e('0x48')]=_0x42d785[_0x0c7e('0x48')][_0x0c7e('0x49')]?_0x42d785[_0x0c7e('0x48')]:_0x5a7063[_0x0c7e('0x42')];if(!_0x211853[_0x0c7e('0x44')]['hasOwnProperty'](_0x0c7e('0x4a'))){_0x42d785[_0x0c7e('0x2f')]=qs[_0x0c7e('0x2f')](_0x211853[_0x0c7e('0x44')][_0x0c7e('0x2f')]);_0x42d785['offset']=qs[_0x0c7e('0x2d')](_0x211853['query'][_0x0c7e('0x2d')]);}_0x42d785[_0x0c7e('0x4b')]=qs[_0x0c7e('0x4c')](_0x211853['query'][_0x0c7e('0x4c')]);_0x42d785[_0x0c7e('0x4d')]=qs[_0x0c7e('0x45')](_['pick'](_0x211853[_0x0c7e('0x44')],_0x5a7063[_0x0c7e('0x45')]),_0x1b579a);if(_0x211853[_0x0c7e('0x44')][_0x0c7e('0x4e')]){_0x42d785[_0x0c7e('0x4d')]=_[_0x0c7e('0x4f')](_0x42d785[_0x0c7e('0x4d')],{'$or':_[_0x0c7e('0x3d')](_0x1b579a,function(_0x116acc){if(_0x116acc['type']!=='VIRTUAL'){var _0x409e27={};_0x409e27[_0x116acc[_0x0c7e('0x3a')]]={'$like':'%'+_0x211853['query'][_0x0c7e('0x4e')]+'%'};return _0x409e27;}})});}_0x42d785=_['merge']({},_0x42d785,_0x211853[_0x0c7e('0x50')]);var _0x19006c={'where':_0x42d785[_0x0c7e('0x4d')]};return db[_0x0c7e('0x3e')][_0x0c7e('0x30')](_0x19006c)[_0x0c7e('0x1d')](function(_0x43f3ab){_0x584d12[_0x0c7e('0x30')]=_0x43f3ab;if(_0x211853[_0x0c7e('0x44')][_0x0c7e('0x51')]){_0x42d785['include']=[{'all':!![]}];}return db[_0x0c7e('0x3e')][_0x0c7e('0x52')](_0x42d785);})['then'](function(_0x2db47d){_0x584d12[_0x0c7e('0x53')]=_0x2db47d;return _0x584d12;})['then'](respondWithFilteredResult(_0x358533,_0x42d785))[_0x0c7e('0x28')](handleError(_0x358533,null));};exports[_0x0c7e('0x54')]=function(_0x13fa86,_0x59e146){var _0x1688d6={'raw':![],'where':{'id':_0x13fa86['params']['id']},'include':[{'model':db[_0x0c7e('0x55')],'as':_0x0c7e('0x3c')}]},_0x327b44={};_0x327b44[_0x0c7e('0x42')]=_['keys'](db['FaxAccount'][_0x0c7e('0x3f')]);_0x327b44[_0x0c7e('0x44')]=_[_0x0c7e('0x43')](_0x13fa86['query']);_0x327b44[_0x0c7e('0x45')]=_[_0x0c7e('0x46')](_0x327b44[_0x0c7e('0x42')],_0x327b44[_0x0c7e('0x44')]);_0x1688d6[_0x0c7e('0x48')]=_[_0x0c7e('0x46')](_0x327b44['model'],qs[_0x0c7e('0x47')](_0x13fa86[_0x0c7e('0x44')][_0x0c7e('0x47')]));_0x1688d6['attributes']=_0x1688d6[_0x0c7e('0x48')][_0x0c7e('0x49')]?_0x1688d6[_0x0c7e('0x48')]:_0x327b44[_0x0c7e('0x42')];if(_0x13fa86[_0x0c7e('0x44')][_0x0c7e('0x51')]){_0x1688d6[_0x0c7e('0x56')]=[{'all':!![]}];}_0x1688d6=_[_0x0c7e('0x4f')]({},_0x1688d6,_0x13fa86['options']);return db['FaxAccount'][_0x0c7e('0x57')](_0x1688d6)[_0x0c7e('0x1d')](handleEntityNotFound(_0x59e146,null))[_0x0c7e('0x1d')](respondWithResult(_0x59e146,null))[_0x0c7e('0x28')](handleError(_0x59e146,null));};exports[_0x0c7e('0x58')]=function(_0xe6473f,_0x2bc452){return db[_0x0c7e('0x3e')][_0x0c7e('0x58')](_0xe6473f['body'],{})[_0x0c7e('0x1d')](function(_0x4d6047){var _0x2fde84=_0xe6473f[_0x0c7e('0x59')][_0x0c7e('0x37')]({'plain':!![]});if(!_0x2fde84)throw new Error(_0x0c7e('0x5a'));if(_0x2fde84[_0x0c7e('0x5b')]===_0x0c7e('0x59')){var _0x5c8424=_0x4d6047['get']({'plain':!![]});var _0x324ac0=_0x0c7e('0x38');return db[_0x0c7e('0x5c')][_0x0c7e('0x57')]({'where':{'name':_0x324ac0,'userProfileId':_0x2fde84['userProfileId']},'raw':!![]})[_0x0c7e('0x1d')](function(_0xf74fa6){if(_0xf74fa6&&_0xf74fa6[_0x0c7e('0x5d')]===0x0){return db['UserProfileResource'][_0x0c7e('0x58')]({'name':_0x5c8424[_0x0c7e('0x3a')],'resourceId':_0x5c8424['id'],'type':_0xf74fa6[_0x0c7e('0x3a')],'sectionId':_0xf74fa6['id']},{})[_0x0c7e('0x1d')](function(){return _0x4d6047;});}else{return _0x4d6047;}})[_0x0c7e('0x28')](function(_0x550c64){logger['error'](_0x0c7e('0x5e'),_0x550c64);throw _0x550c64;});}return _0x4d6047;})[_0x0c7e('0x1d')](respondWithResult(_0x2bc452,0xc9))[_0x0c7e('0x28')](handleError(_0x2bc452,null));};exports[_0x0c7e('0x35')]=function(_0x137ac2,_0x5ce69c){if(_0x137ac2[_0x0c7e('0x5f')]['id']){delete _0x137ac2['body']['id'];}return db[_0x0c7e('0x3e')]['find']({'where':{'id':_0x137ac2[_0x0c7e('0x60')]['id']},'include':[{'model':db[_0x0c7e('0x55')],'as':'mandatoryDispositionPause'}]})[_0x0c7e('0x1d')](handleEntityNotFound(_0x5ce69c,null))[_0x0c7e('0x1d')](saveUpdates(_0x137ac2['body'],null))[_0x0c7e('0x1d')](respondWithResult(_0x5ce69c,null))[_0x0c7e('0x28')](handleError(_0x5ce69c,null));};exports[_0x0c7e('0x36')]=function(_0x322b27,_0x343c5c){return db[_0x0c7e('0x3e')][_0x0c7e('0x57')]({'where':{'id':_0x322b27[_0x0c7e('0x60')]['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x343c5c,null))[_0x0c7e('0x1d')](removeEntity(_0x343c5c,null))[_0x0c7e('0x28')](handleError(_0x343c5c,null));};exports[_0x0c7e('0x61')]=function(_0x379e9d,_0x2bafa0){return db[_0x0c7e('0x3e')][_0x0c7e('0x61')]()[_0x0c7e('0x1d')](respondWithResult(_0x2bafa0,null))['catch'](handleError(_0x2bafa0,null));};exports[_0x0c7e('0x62')]=function(_0x503bd0,_0x9bac71,_0x12250c){if(_0x503bd0[_0x0c7e('0x5f')]['id']){delete _0x503bd0[_0x0c7e('0x5f')]['id'];}return db[_0x0c7e('0x3e')]['find']({'where':{'id':_0x503bd0[_0x0c7e('0x60')]['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x9bac71,null))[_0x0c7e('0x1d')](function(_0x274de7){if(_0x274de7){_0x503bd0[_0x0c7e('0x5f')]['FaxAccountId']=_0x274de7['id'];return db[_0x0c7e('0x63')][_0x0c7e('0x58')](_0x503bd0[_0x0c7e('0x5f')]);}})[_0x0c7e('0x1d')](respondWithResult(_0x9bac71,null))[_0x0c7e('0x28')](handleError(_0x9bac71,null));};exports[_0x0c7e('0x64')]=function(_0x1f28da,_0x1ce069,_0x1dc266){var _0x3a5453={'raw':![],'where':{}};var _0x16dba2={};var _0x30044f={'count':0x0,'rows':[]};return db[_0x0c7e('0x3e')][_0x0c7e('0x65')]({'where':{'id':_0x1f28da[_0x0c7e('0x60')]['id']}})['then'](handleEntityNotFound(_0x1ce069,null))[_0x0c7e('0x1d')](function(_0xca3a46){if(_0xca3a46){_0x16dba2[_0x0c7e('0x42')]=_['keys'](db[_0x0c7e('0x63')]['rawAttributes']);_0x16dba2['query']=_[_0x0c7e('0x43')](_0x1f28da[_0x0c7e('0x44')]);_0x16dba2[_0x0c7e('0x45')]=_[_0x0c7e('0x46')](_0x16dba2[_0x0c7e('0x42')],_0x16dba2[_0x0c7e('0x44')]);_0x3a5453[_0x0c7e('0x48')]=_[_0x0c7e('0x46')](_0x16dba2[_0x0c7e('0x42')],qs['fields'](_0x1f28da[_0x0c7e('0x44')][_0x0c7e('0x47')]));_0x3a5453[_0x0c7e('0x48')]=_0x3a5453['attributes']['length']?_0x3a5453[_0x0c7e('0x48')]:_0x16dba2[_0x0c7e('0x42')];if(!_0x1f28da[_0x0c7e('0x44')][_0x0c7e('0x66')](_0x0c7e('0x4a'))){_0x3a5453[_0x0c7e('0x2f')]=qs[_0x0c7e('0x2f')](_0x1f28da[_0x0c7e('0x44')][_0x0c7e('0x2f')]);_0x3a5453[_0x0c7e('0x2d')]=qs['offset'](_0x1f28da[_0x0c7e('0x44')][_0x0c7e('0x2d')]);}_0x3a5453[_0x0c7e('0x4b')]=qs[_0x0c7e('0x4c')](_0x1f28da['query']['sort']);_0x3a5453[_0x0c7e('0x4d')]=qs[_0x0c7e('0x45')](_[_0x0c7e('0x67')](_0x1f28da['query'],_0x16dba2[_0x0c7e('0x45')]));_0x3a5453[_0x0c7e('0x4d')]['FaxAccountId']=_0xca3a46['id'];if(_0x1f28da[_0x0c7e('0x44')][_0x0c7e('0x4e')]){_0x3a5453[_0x0c7e('0x4d')]=_['merge'](_0x3a5453[_0x0c7e('0x4d')],{'$or':_['map'](_0x3a5453[_0x0c7e('0x48')],function(_0x5a81c5){var _0x3f8ce2={};_0x3f8ce2[_0x5a81c5]={'$like':'%'+_0x1f28da['query'][_0x0c7e('0x4e')]+'%'};return _0x3f8ce2;})});}_0x3a5453=_[_0x0c7e('0x4f')]({},_0x3a5453,_0x1f28da[_0x0c7e('0x50')]);return db['Disposition'][_0x0c7e('0x30')]({'where':_0x3a5453[_0x0c7e('0x4d')]})[_0x0c7e('0x1d')](function(_0x1a19c7){_0x30044f[_0x0c7e('0x30')]=_0x1a19c7;if(_0x1f28da[_0x0c7e('0x44')][_0x0c7e('0x51')]){_0x3a5453[_0x0c7e('0x56')]=[{'all':!![]}];}return db[_0x0c7e('0x63')][_0x0c7e('0x52')](_0x3a5453);})[_0x0c7e('0x1d')](function(_0x278faa){_0x30044f['rows']=_0x278faa;return _0x30044f;});}})[_0x0c7e('0x1d')](respondWithFilteredResult(_0x1ce069,_0x3a5453))[_0x0c7e('0x28')](handleError(_0x1ce069,null));};exports[_0x0c7e('0x68')]=function(_0x239eb4,_0x1734ee,_0x2e413b){return db['FaxAccount'][_0x0c7e('0x57')]({'where':{'id':_0x239eb4['params']['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x1734ee,null))[_0x0c7e('0x1d')](function(_0x18303b){if(_0x18303b){return _0x18303b[_0x0c7e('0x68')](_0x239eb4[_0x0c7e('0x44')][_0x0c7e('0x69')]);}})[_0x0c7e('0x1d')](respondWithStatusCode(_0x1734ee,null))[_0x0c7e('0x28')](handleError(_0x1734ee,null));};exports[_0x0c7e('0x6a')]=function(_0x2b86bc,_0x75bd65,_0x6e59ab){if(_0x2b86bc['body']['id']){delete _0x2b86bc[_0x0c7e('0x5f')]['id'];}return db[_0x0c7e('0x3e')][_0x0c7e('0x57')]({'where':{'id':_0x2b86bc[_0x0c7e('0x60')]['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x75bd65,null))[_0x0c7e('0x1d')](function(_0x3454bc){if(_0x3454bc){_0x2b86bc[_0x0c7e('0x5f')][_0x0c7e('0x6b')]=_0x3454bc['id'];return db[_0x0c7e('0x6c')][_0x0c7e('0x58')](_0x2b86bc[_0x0c7e('0x5f')]);}})[_0x0c7e('0x1d')](respondWithResult(_0x75bd65,null))[_0x0c7e('0x28')](handleError(_0x75bd65,null));};exports[_0x0c7e('0x6d')]=function(_0x318e48,_0x312d86,_0x5d7eec){var _0x18d1eb={'raw':![],'where':{}};var _0x21dada={};var _0x4f5009={'count':0x0,'rows':[]};return db[_0x0c7e('0x3e')][_0x0c7e('0x65')]({'where':{'id':_0x318e48[_0x0c7e('0x60')]['id']}})['then'](handleEntityNotFound(_0x312d86,null))[_0x0c7e('0x1d')](function(_0x51071e){if(_0x51071e){_0x21dada[_0x0c7e('0x42')]=_[_0x0c7e('0x43')](db[_0x0c7e('0x6c')][_0x0c7e('0x3f')]);_0x21dada[_0x0c7e('0x44')]=_[_0x0c7e('0x43')](_0x318e48['query']);_0x21dada[_0x0c7e('0x45')]=_[_0x0c7e('0x46')](_0x21dada[_0x0c7e('0x42')],_0x21dada['query']);_0x18d1eb['attributes']=_[_0x0c7e('0x46')](_0x21dada['model'],qs[_0x0c7e('0x47')](_0x318e48[_0x0c7e('0x44')]['fields']));_0x18d1eb[_0x0c7e('0x48')]=_0x18d1eb[_0x0c7e('0x48')][_0x0c7e('0x49')]?_0x18d1eb[_0x0c7e('0x48')]:_0x21dada['model'];if(!_0x318e48[_0x0c7e('0x44')][_0x0c7e('0x66')](_0x0c7e('0x4a'))){_0x18d1eb[_0x0c7e('0x2f')]=qs[_0x0c7e('0x2f')](_0x318e48[_0x0c7e('0x44')][_0x0c7e('0x2f')]);_0x18d1eb[_0x0c7e('0x2d')]=qs[_0x0c7e('0x2d')](_0x318e48[_0x0c7e('0x44')][_0x0c7e('0x2d')]);}_0x18d1eb['order']=qs[_0x0c7e('0x4c')](_0x318e48[_0x0c7e('0x44')][_0x0c7e('0x4c')]);_0x18d1eb[_0x0c7e('0x4d')]=qs[_0x0c7e('0x45')](_[_0x0c7e('0x67')](_0x318e48['query'],_0x21dada[_0x0c7e('0x45')]));_0x18d1eb[_0x0c7e('0x4d')][_0x0c7e('0x6b')]=_0x51071e['id'];if(_0x318e48[_0x0c7e('0x44')][_0x0c7e('0x4e')]){_0x18d1eb['where']=_[_0x0c7e('0x4f')](_0x18d1eb[_0x0c7e('0x4d')],{'$or':_[_0x0c7e('0x3d')](_0x18d1eb[_0x0c7e('0x48')],function(_0x4dc00d){var _0x1b6b2f={};_0x1b6b2f[_0x4dc00d]={'$like':'%'+_0x318e48[_0x0c7e('0x44')][_0x0c7e('0x4e')]+'%'};return _0x1b6b2f;})});}_0x18d1eb=_[_0x0c7e('0x4f')]({},_0x18d1eb,_0x318e48[_0x0c7e('0x50')]);return db[_0x0c7e('0x6c')][_0x0c7e('0x30')]({'where':_0x18d1eb[_0x0c7e('0x4d')]})[_0x0c7e('0x1d')](function(_0x5006cc){_0x4f5009['count']=_0x5006cc;if(_0x318e48[_0x0c7e('0x44')]['includeAll']){_0x18d1eb[_0x0c7e('0x56')]=[{'all':!![]}];}return db[_0x0c7e('0x6c')][_0x0c7e('0x52')](_0x18d1eb);})[_0x0c7e('0x1d')](function(_0x3381c6){_0x4f5009[_0x0c7e('0x53')]=_0x3381c6;return _0x4f5009;});}})[_0x0c7e('0x1d')](respondWithFilteredResult(_0x312d86,_0x18d1eb))[_0x0c7e('0x28')](handleError(_0x312d86,null));};exports[_0x0c7e('0x6e')]=function(_0x40a5bc,_0x1afbf9,_0x56f91e){return db[_0x0c7e('0x3e')][_0x0c7e('0x57')]({'where':{'id':_0x40a5bc[_0x0c7e('0x60')]['id']}})['then'](handleEntityNotFound(_0x1afbf9,null))[_0x0c7e('0x1d')](function(_0x187d58){if(_0x187d58){return _0x187d58[_0x0c7e('0x6e')](_0x40a5bc[_0x0c7e('0x44')][_0x0c7e('0x69')]);}})[_0x0c7e('0x1d')](respondWithStatusCode(_0x1afbf9,null))[_0x0c7e('0x28')](handleError(_0x1afbf9,null));};exports[_0x0c7e('0x6f')]=function(_0xe71a1d,_0x437a12,_0x45d6df){return db['FaxInteraction']['find']({'where':{'id':_0xe71a1d['params']['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x437a12,null))[_0x0c7e('0x1d')](function(_0x38b9c3){if(_0x38b9c3){return _0x38b9c3['addInteraction'](_0xe71a1d[_0x0c7e('0x5f')]['ids'],_[_0x0c7e('0x70')](_0xe71a1d[_0x0c7e('0x5f')],[_0x0c7e('0x69'),'id'])||{});}})[_0x0c7e('0x1d')](respondWithResult(_0x437a12,null))[_0x0c7e('0x28')](handleError(_0x437a12,null));};exports[_0x0c7e('0x71')]=function(_0x4903be,_0xafa378,_0x59607f){var _0x23e72f={'raw':![],'where':{}};var _0x25efe0={};var _0x1da637={'count':0x0,'rows':[]};return db[_0x0c7e('0x3e')][_0x0c7e('0x65')]({'where':{'id':_0x4903be[_0x0c7e('0x60')]['id']}})['then'](handleEntityNotFound(_0xafa378,null))[_0x0c7e('0x1d')](function(_0x27e3f6){if(_0x27e3f6){_0x25efe0[_0x0c7e('0x42')]=_[_0x0c7e('0x43')](db[_0x0c7e('0x72')][_0x0c7e('0x3f')]);_0x25efe0['query']=_[_0x0c7e('0x43')](_0x4903be[_0x0c7e('0x44')]);_0x25efe0[_0x0c7e('0x45')]=_['intersection'](_0x25efe0[_0x0c7e('0x42')],_0x25efe0['query']);_0x23e72f[_0x0c7e('0x48')]=_[_0x0c7e('0x46')](_0x25efe0['model'],qs[_0x0c7e('0x47')](_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x47')]));_0x23e72f[_0x0c7e('0x48')]=_0x23e72f[_0x0c7e('0x48')][_0x0c7e('0x49')]?_0x23e72f[_0x0c7e('0x48')]:_0x25efe0[_0x0c7e('0x42')];if(!_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x66')]('nolimit')){_0x23e72f[_0x0c7e('0x2f')]=qs[_0x0c7e('0x2f')](_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x2f')]);_0x23e72f[_0x0c7e('0x2d')]=qs[_0x0c7e('0x2d')](_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x2d')]);}_0x23e72f[_0x0c7e('0x4b')]=qs[_0x0c7e('0x4c')](_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x4c')]);_0x23e72f[_0x0c7e('0x4d')]=qs[_0x0c7e('0x45')](_[_0x0c7e('0x67')](_0x4903be['query'],_0x25efe0[_0x0c7e('0x45')]));_0x23e72f[_0x0c7e('0x4d')]['FaxAccountId']=_0x27e3f6['id'];if(_0x4903be[_0x0c7e('0x44')]['filter']){_0x23e72f[_0x0c7e('0x4d')]=_[_0x0c7e('0x4f')](_0x23e72f['where'],{'$or':_[_0x0c7e('0x3d')](_0x23e72f['attributes'],function(_0x4836a3){var _0x59162f={};_0x59162f[_0x4836a3]={'$like':'%'+_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x4e')]+'%'};return _0x59162f;})});}_0x23e72f=_[_0x0c7e('0x4f')]({},_0x23e72f,_0x4903be[_0x0c7e('0x50')]);return db[_0x0c7e('0x72')][_0x0c7e('0x30')]({'where':_0x23e72f[_0x0c7e('0x4d')]})[_0x0c7e('0x1d')](function(_0x47719e){_0x1da637['count']=_0x47719e;if(_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x51')]){_0x23e72f[_0x0c7e('0x56')]=[{'model':db[_0x0c7e('0x73')],'as':_0x0c7e('0x74'),'required':![]},{'model':db['User'],'as':_0x0c7e('0x75'),'attributes':['name',_0x0c7e('0x76'),_0x0c7e('0x77')],'required':![]},{'model':db['Tag'],'as':_0x0c7e('0x78'),'attributes':['id',_0x0c7e('0x3a'),'color'],'where':_0x4903be['query'][_0x0c7e('0x79')]?{'id':_0x4903be['query'][_0x0c7e('0x79')]}:undefined,'required':_0x4903be[_0x0c7e('0x44')][_0x0c7e('0x79')]?!![]:![]}];}return db[_0x0c7e('0x72')][_0x0c7e('0x52')](_0x23e72f);})['then'](function(_0x1f0c42){_0x1da637[_0x0c7e('0x53')]=_0x1f0c42;return _0x1da637;});}})[_0x0c7e('0x1d')](respondWithFilteredResult(_0xafa378,_0x23e72f))[_0x0c7e('0x28')](handleError(_0xafa378,null));};exports[_0x0c7e('0x7a')]=function(_0x317481,_0x43a299){var _0x5ef1de=_0x317481[_0x0c7e('0x60')]['id'];var _0x15ff19=_0x317481['body'];var _0x2089a7=0xc8;var _0x23ef9e=null;return db[_0x0c7e('0x7b')][_0x0c7e('0x7c')]({'isolationLevel':db[_0x0c7e('0x7b')][_0x0c7e('0x7d')][_0x0c7e('0x7e')][_0x0c7e('0x7f')]},function(_0x410eec){return db[_0x0c7e('0x3e')]['findOne']({'where':{'id':_0x5ef1de},'transaction':_0x410eec})['then'](function(_0x5deb41){if(_0x5deb41){return db['FaxApplication'][_0x0c7e('0x36')]({'where':{'FaxAccountId':_0x5ef1de},'transaction':_0x410eec})[_0x0c7e('0x1d')](function(){var _0x9718fe=_[_0x0c7e('0x3d')](_0x15ff19,function(_0x3193f8){_0x3193f8[_0x0c7e('0x6b')]=_0x5ef1de;return _0x3193f8;});return db['FaxApplication'][_0x0c7e('0x80')](_0x9718fe,{'transaction':_0x410eec});});}else{_0x2089a7=0x194;_0x23ef9e=[];}});})[_0x0c7e('0x1d')](function(){if(_0x2089a7!==0x194){return db[_0x0c7e('0x81')][_0x0c7e('0x82')]({'where':{'FaxAccountId':_0x5ef1de},'order':_0x0c7e('0x83')})['then'](function(_0x3fa2e7){_0x23ef9e=_0x3fa2e7;});}})[_0x0c7e('0x28')](function(_0x1f68b1){_0x2089a7=0x1f4;logger['error'](_0x1f68b1['stack']);if(_0x1f68b1['name']){delete _0x1f68b1[_0x0c7e('0x3a')];}_0x23ef9e=_0x1f68b1;})[_0x0c7e('0x84')](function(){if(_0x23ef9e===null){_0x43a299[_0x0c7e('0x29')](_0x2089a7);}else{if(_0x2089a7===0x1f4){_0x43a299['status'](_0x2089a7)['send'](_0x23ef9e);}else{_0x43a299['status'](_0x2089a7)[_0x0c7e('0x2c')](_0x23ef9e);}}});};exports['getApplications']=function(_0x24633c,_0x37f618,_0x1f7295){var _0x58b31b={};var _0x78bdb4={};var _0x2c7282;var _0x20ed61;return db[_0x0c7e('0x3e')][_0x0c7e('0x65')]({'where':{'id':_0x24633c[_0x0c7e('0x60')]['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x37f618,null))['then'](function(_0x5dd490){if(_0x5dd490){_0x2c7282=_0x5dd490;_0x78bdb4[_0x0c7e('0x42')]=_[_0x0c7e('0x43')](db[_0x0c7e('0x81')][_0x0c7e('0x3f')]);_0x78bdb4[_0x0c7e('0x44')]=_['keys'](_0x24633c[_0x0c7e('0x44')]);_0x78bdb4[_0x0c7e('0x45')]=_[_0x0c7e('0x46')](_0x78bdb4[_0x0c7e('0x42')],_0x78bdb4[_0x0c7e('0x44')]);_0x58b31b[_0x0c7e('0x48')]=_[_0x0c7e('0x46')](_0x78bdb4[_0x0c7e('0x42')],qs[_0x0c7e('0x47')](_0x24633c[_0x0c7e('0x44')][_0x0c7e('0x47')]));_0x58b31b[_0x0c7e('0x48')]=_0x58b31b[_0x0c7e('0x48')][_0x0c7e('0x49')]?_0x58b31b['attributes']:_0x78bdb4[_0x0c7e('0x42')];_0x58b31b[_0x0c7e('0x4b')]=qs[_0x0c7e('0x4c')](_0x24633c[_0x0c7e('0x44')][_0x0c7e('0x4c')]);_0x58b31b[_0x0c7e('0x4d')]=qs[_0x0c7e('0x45')](_[_0x0c7e('0x67')](_0x24633c['query'],_0x78bdb4[_0x0c7e('0x45')]));if(_0x24633c['query']['filter']){_0x58b31b[_0x0c7e('0x4d')]=_['merge'](_0x58b31b['where'],{'$or':_['map'](_0x58b31b[_0x0c7e('0x48')],function(_0x1acff3){var _0x4c27d9={};_0x4c27d9[_0x1acff3]={'$like':'%'+_0x24633c[_0x0c7e('0x44')][_0x0c7e('0x4e')]+'%'};return _0x4c27d9;})});}_0x58b31b=_[_0x0c7e('0x4f')]({},_0x58b31b,_0x24633c[_0x0c7e('0x50')]);return _0x2c7282[_0x0c7e('0x85')](_0x58b31b);}})[_0x0c7e('0x1d')](function(_0x33b64b){if(_0x33b64b){_0x20ed61=_0x33b64b[_0x0c7e('0x49')];if(!_0x24633c[_0x0c7e('0x44')][_0x0c7e('0x66')](_0x0c7e('0x4a'))){_0x58b31b[_0x0c7e('0x2f')]=qs['limit'](_0x24633c['query'][_0x0c7e('0x2f')]);_0x58b31b[_0x0c7e('0x2d')]=qs[_0x0c7e('0x2d')](_0x24633c[_0x0c7e('0x44')]['offset']);}return _0x2c7282['getApplications'](_0x58b31b);}})[_0x0c7e('0x1d')](function(_0x47a3cd){if(_0x47a3cd){return _0x47a3cd?{'count':_0x20ed61,'rows':_0x47a3cd}:null;}})['then'](respondWithResult(_0x37f618,null))['catch'](handleError(_0x37f618,null));};function Extension(_0x2e27ad,_0x567dc6,_0x49d4c4,_0x4ec391){this[_0x0c7e('0x86')]='from-voip-provider';this[_0x0c7e('0x87')]=_0x2e27ad['localstationid'];this[_0x0c7e('0x88')]=_0x4ec391;this[_0x0c7e('0x40')]=_0x0c7e('0x89');this[_0x0c7e('0x8a')]=_0x0c7e('0x8b');this[_0x0c7e('0x6b')]=_0x2e27ad['id'];this[_0x0c7e('0x83')]=_0x567dc6;this[_0x0c7e('0x8c')]=_0x49d4c4;}function createExtensionsReciveFax(_0x14ab2c){var _0x1c704b=0x1;var _0x2c4b14=[];_0x2c4b14['push'](new Extension(_0x14ab2c,_0x1c704b,'',_0x0c7e('0x8d')));_0x1c704b+=0x1;_0x2c4b14['push'](new Extension(_0x14ab2c,_0x1c704b,_0x0c7e('0x8e'),'Set'));_0x1c704b+=0x1;for(var _0x440e57 in _0x14ab2c){if(_0x14ab2c[_0x0c7e('0x66')](_0x440e57)&&(_0x440e57===_0x0c7e('0x8f')||_0x440e57==='localstationid'||_0x440e57===_0x0c7e('0x90')||_0x440e57===_0x0c7e('0x91')||_0x440e57===_0x0c7e('0x92')||_0x440e57==='maxrate'||_0x440e57===_0x0c7e('0x93')||_0x440e57===_0x0c7e('0x94')||_0x440e57===_0x0c7e('0x95'))){_0x2c4b14['push'](new Extension(_0x14ab2c,_0x1c704b,_0x0c7e('0x96')+_0x440e57+')='+_0x14ab2c[_0x440e57],'Set'));_0x1c704b+=0x1;}}_0x2c4b14[_0x0c7e('0x97')](new Extension(_0x14ab2c,_0x1c704b,'6','Wait'));_0x1c704b+=0x1;_0x2c4b14[_0x0c7e('0x97')](new Extension(_0x14ab2c,_0x1c704b,'/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'));_0x1c704b=0x0;return _0x2c4b14;}exports[_0x0c7e('0x98')]=function(_0x2f0277,_0x40b0bb,_0x47dc23){var _0x40401e;return db[_0x0c7e('0x7b')][_0x0c7e('0x7c')](function(_0x1a29bc){return db[_0x0c7e('0x3e')]['create'](_0x2f0277[_0x0c7e('0x5f')],{'transaction':_0x1a29bc})[_0x0c7e('0x1d')](function(_0x4664f4){_0x40401e=_0x4664f4[_0x0c7e('0x37')]({'plain':!![]});return db[_0x0c7e('0x99')][_0x0c7e('0x80')](createExtensionsReciveFax(_0x40401e),{'transaction':_0x1a29bc});});})[_0x0c7e('0x1d')](function(){return _0x40401e;})[_0x0c7e('0x1d')](respondWithResult(_0x40b0bb,null))[_0x0c7e('0x28')](handleError(_0x40b0bb,null));};exports[_0x0c7e('0x9a')]=function(_0x3700c1,_0x272412,_0x1960c3){var _0x14cfe2;return db[_0x0c7e('0x7b')][_0x0c7e('0x7c')](function(_0x207de9){return db[_0x0c7e('0x3e')][_0x0c7e('0x35')](_0x3700c1[_0x0c7e('0x5f')],{'where':{'id':_0x3700c1[_0x0c7e('0x5f')]['id']},'transaction':_0x207de9})[_0x0c7e('0x1d')](function(_0x5297ed){return db[_0x0c7e('0x99')][_0x0c7e('0x36')]({'where':{'FaxAccountId':_0x3700c1[_0x0c7e('0x5f')]['id']},'transaction':_0x207de9})[_0x0c7e('0x1d')](function(_0x4cc896){return db[_0x0c7e('0x99')][_0x0c7e('0x80')](createExtensionsReciveFax(_[_0x0c7e('0x70')](_0x3700c1[_0x0c7e('0x5f')],['tech',_0x0c7e('0x41'),_0x0c7e('0x9b'),_0x0c7e('0x9c'),_0x0c7e('0x9d'),_0x0c7e('0x9e')])),{'transaction':_0x207de9});});});})['then'](function(){return db[_0x0c7e('0x3e')]['findById'](_0x3700c1[_0x0c7e('0x5f')]['id']);})[_0x0c7e('0x1d')](respondWithResult(_0x272412,null))['catch'](handleError(_0x272412,null));};exports['getMessages']=function(_0x392afa,_0x5a121f,_0x15d6e6){var _0x226804={'raw':!![],'where':{}};var _0x10c398={};var _0xb9eeca={'count':0x0,'rows':[]};return db[_0x0c7e('0x3e')][_0x0c7e('0x65')]({'where':{'id':_0x392afa[_0x0c7e('0x60')]['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x5a121f,null))['then'](function(_0x2b9b41){if(_0x2b9b41){_0x10c398[_0x0c7e('0x42')]=_[_0x0c7e('0x43')](db[_0x0c7e('0x9f')][_0x0c7e('0x3f')]);_0x10c398[_0x0c7e('0x44')]=_[_0x0c7e('0x43')](_0x392afa[_0x0c7e('0x44')]);_0x10c398[_0x0c7e('0x45')]=_[_0x0c7e('0x46')](_0x10c398['model'],_0x10c398[_0x0c7e('0x44')]);_0x226804[_0x0c7e('0x48')]=_['intersection'](_0x10c398[_0x0c7e('0x42')],qs[_0x0c7e('0x47')](_0x392afa[_0x0c7e('0x44')][_0x0c7e('0x47')]));_0x226804['attributes']=_0x226804[_0x0c7e('0x48')][_0x0c7e('0x49')]?_0x226804[_0x0c7e('0x48')]:_0x10c398['model'];if(!_0x392afa[_0x0c7e('0x44')][_0x0c7e('0x66')](_0x0c7e('0x4a'))){_0x226804[_0x0c7e('0x2f')]=qs['limit'](_0x392afa[_0x0c7e('0x44')][_0x0c7e('0x2f')]);_0x226804['offset']=qs['offset'](_0x392afa['query'][_0x0c7e('0x2d')]);}_0x226804['order']=qs[_0x0c7e('0x4c')](_0x392afa[_0x0c7e('0x44')][_0x0c7e('0x4c')]);_0x226804['where']=qs[_0x0c7e('0x45')](_['pick'](_0x392afa[_0x0c7e('0x44')],_0x10c398[_0x0c7e('0x45')]));_0x226804[_0x0c7e('0x4d')][_0x0c7e('0x6b')]=_0x2b9b41['id'];if(_0x392afa[_0x0c7e('0x44')][_0x0c7e('0x4e')]){_0x226804[_0x0c7e('0x4d')]=_[_0x0c7e('0x4f')](_0x226804[_0x0c7e('0x4d')],{'$or':_[_0x0c7e('0x3d')](_0x226804[_0x0c7e('0x48')],function(_0x11401b){var _0x15dd6d={};_0x15dd6d[_0x11401b]={'$like':'%'+_0x392afa[_0x0c7e('0x44')][_0x0c7e('0x4e')]+'%'};return _0x15dd6d;})});}if(_0x392afa[_0x0c7e('0x44')][_0x0c7e('0xa0')]){var _0x4d1a49=_0x392afa[_0x0c7e('0x44')][_0x0c7e('0xa0')]['split'](',');var _0x5573da={};_0x5573da[_0x4d1a49[0x0]]={'$gte':moment(_0x4d1a49[0x1])[_0x0c7e('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x226804[_0x0c7e('0x4d')]=_['merge'](_0x226804[_0x0c7e('0x4d')],_0x5573da);}_0x226804=_[_0x0c7e('0x4f')]({},_0x226804,_0x392afa[_0x0c7e('0x50')]);return db[_0x0c7e('0x9f')]['count']({'where':_0x226804[_0x0c7e('0x4d')]})[_0x0c7e('0x1d')](function(_0x205993){_0xb9eeca[_0x0c7e('0x30')]=_0x205993;if(_0x392afa[_0x0c7e('0x44')]['includeAll']){_0x226804['include']=[{'all':!![]}];}return db[_0x0c7e('0x9f')]['findAll'](_0x226804);})[_0x0c7e('0x1d')](function(_0x558cb9){_0xb9eeca[_0x0c7e('0x53')]=_0x558cb9;return _0xb9eeca;});}})[_0x0c7e('0x1d')](respondWithFilteredResult(_0x5a121f,_0x226804))[_0x0c7e('0x28')](handleError(_0x5a121f,null));};exports['send']=function(_0x53e28d,_0x461aa7,_0x4f7432){var _0x34a13f,_0x20b024={},_0x1cf033;if(_0x53e28d[_0x0c7e('0x5f')]['to']){_0x1cf033=_0x53e28d[_0x0c7e('0x5f')]['to'][0x0];}return db[_0x0c7e('0x3e')][_0x0c7e('0x57')]({'where':{'id':_0x53e28d[_0x0c7e('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x0c7e('0xa2'),'include':[{'model':db['CmContact'],'as':_0x0c7e('0xa3'),'where':{'fax':_0x1cf033},'limit':0x1,'order':[[_0x0c7e('0x9c'),_0x0c7e('0xa4')]]}]}]})[_0x0c7e('0x1d')](handleEntityNotFound(_0x461aa7,null))[_0x0c7e('0x1d')](function(_0x12d82b){_0x34a13f=_0x12d82b;if(_0x53e28d[_0x0c7e('0x5f')]['attachments']&&_0x53e28d['body'][_0x0c7e('0xa5')]['length']){for(var _0x27ba6e=0x0;_0x27ba6e<_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][_0x0c7e('0x49')];_0x27ba6e+=0x1){_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][_0x27ba6e]={'filename':_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][_0x27ba6e][_0x0c7e('0x3a')],'id':_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][_0x27ba6e]['id'],'path':path['join'](config['root'],_0x0c7e('0xa6'),_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][_0x27ba6e][_0x0c7e('0xa7')])};}}return respondWithRpcPromise(_0x0c7e('0xa8'),_0x0c7e('0xa8'),{'FaxAccountId':_[_0x0c7e('0xa9')](_0x53e28d['params']['id'])?undefined:_0x53e28d[_0x0c7e('0x60')]['id'],'path':_['isNil'](_0x53e28d['body'][_0x0c7e('0xa5')][0x0][_0x0c7e('0xaa')])?undefined:_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][0x0][_0x0c7e('0xaa')],'fax':_[_0x0c7e('0xa9')](_0x53e28d[_0x0c7e('0x5f')]['to'][0x0])?undefined:_0x53e28d[_0x0c7e('0x5f')]['to'][0x0]},client9002);})[_0x0c7e('0x1d')](function(){if(_0x34a13f){if(_[_0x0c7e('0xa9')](_0x53e28d[_0x0c7e('0x5f')]['from'])){_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xab')]=util[_0x0c7e('0xa1')](_0x0c7e('0xac'),_0x34a13f[_0x0c7e('0x3a')],_0x34a13f[_0x0c7e('0xad')]);}if(_0x34a13f[_0x0c7e('0xa2')]){if(_0x34a13f[_0x0c7e('0xa2')]['Contacts'][_0x0c7e('0x49')]){return _0x34a13f['List'][_0x0c7e('0xa3')][0x0];}else{return db[_0x0c7e('0x73')][_0x0c7e('0x58')](_[_0x0c7e('0x15')](_0x53e28d[_0x0c7e('0x5f')],{'firstName':_0x53e28d[_0x0c7e('0x5f')]['to'][0x0],'phone':_0x53e28d[_0x0c7e('0x5f')]['to'][0x0],'fax':_0x53e28d['body']['to'][0x0],'ListId':_0x34a13f['ListId']}));}}else{throw new Error(_0x0c7e('0xae'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x0c7e('0x1d')](function(_0x588ffb){if(_0x588ffb){return db[_0x0c7e('0x72')]['find']({'where':{'ContactId':_0x588ffb['id'],'closed':![],'FaxAccountId':_0x34a13f['id']}})[_0x0c7e('0x1d')](function(_0x56b37b){if(_0x56b37b){return[_0x56b37b,![]];}return db[_0x0c7e('0x72')][_0x0c7e('0x58')]({'UserId':_0x53e28d['user']['id'],'ContactId':_0x588ffb['id'],'FaxAccountId':_0x34a13f['id'],'fax':_0x53e28d['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x53e28d[_0x0c7e('0x5f')],{'read':![],'body':_0x53e28d['body'][_0x0c7e('0xa5')][0x0][_0x0c7e('0xaf')],'FaxAccountId':_0x34a13f['id'],'UserId':_0x53e28d[_0x0c7e('0x59')]['id'],'ContactId':_0x588ffb['id'],'AttachmentId':_0x53e28d['body'][_0x0c7e('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x0c7e('0xb0')}]})[_0x0c7e('0x1d')](function(_0x4f15cc){return[_0x4f15cc,!![]];});});}else{throw new Error(_0x0c7e('0xb1'));}})['spread'](function(_0x4378c7,_0x42c8a6){if(_0x42c8a6){return _0x4378c7;}return db[_0x0c7e('0x9f')]['create']({'direction':_0x0c7e('0xb2'),'read':![],'body':_0x53e28d[_0x0c7e('0x5f')]['attachments'][0x0][_0x0c7e('0xaf')],'FaxAccountId':_0x34a13f['id'],'FaxInteractionId':_0x4378c7['id'],'UserId':_0x53e28d[_0x0c7e('0x59')]['id'],'ContactId':_0x4378c7['ContactId'],'AttachmentId':_0x53e28d[_0x0c7e('0x5f')]['attachments'][0x0]['id']})[_0x0c7e('0x1d')](function(_0x1ea88f){_0x4378c7['dataValues'][_0x0c7e('0xb0')]=[];_0x4378c7[_0x0c7e('0xb3')][_0x0c7e('0xb0')][_0x0c7e('0x97')](_0x1ea88f['dataValues']);return _0x4378c7;});})[_0x0c7e('0x1d')](function(_0x568f89){respondWithRpcPromise(_0x0c7e('0xb4'),_0x0c7e('0xb4'),{'FaxAccountId':_['isNil'](_0x53e28d[_0x0c7e('0x60')]['id'])?undefined:_0x53e28d[_0x0c7e('0x60')]['id'],'path':_[_0x0c7e('0xa9')](_0x53e28d['body']['attachments'][0x0][_0x0c7e('0xaa')])?undefined:_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][0x0][_0x0c7e('0xaa')],'fax':_[_0x0c7e('0xa9')](_0x53e28d['body']['to'][0x0])?undefined:_0x53e28d['body']['to'][0x0],'AttachmentId':_0x53e28d[_0x0c7e('0x5f')][_0x0c7e('0xa5')][0x0]['id']},client9002)[_0x0c7e('0x1d')](function(_0x249dc4){logger[_0x0c7e('0x1e')](_0x0c7e('0xb5'),_0x249dc4);})['catch'](function(_0x9f0405){logger[_0x0c7e('0x1e')]('SendFaxRpc,\x20%s',_0x9f0405);});return _0x568f89;})['then'](respondWithResult(_0x461aa7,null))[_0x0c7e('0x28')](handleError(_0x461aa7,null));};exports[_0x0c7e('0xb6')]=function(_0xd0497f,_0x52a50f,_0x4a3e98){return db['FaxAccount'][_0x0c7e('0x57')]({'where':{'id':_0xd0497f['params']['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x52a50f,null))[_0x0c7e('0x1d')](function(_0x1e5806){if(_0x1e5806){return _0x1e5806[_0x0c7e('0xb6')](_0xd0497f[_0x0c7e('0x5f')]['ids'],_[_0x0c7e('0x70')](_0xd0497f[_0x0c7e('0x5f')],[_0x0c7e('0x69'),'id'])||{})[_0x0c7e('0xb7')](function(_0x18a7c6){for(var _0x153fad=0x0;_0x153fad<_0xd0497f[_0x0c7e('0x5f')]['ids'][_0x0c7e('0x49')];_0x153fad+=0x1){socket[_0x0c7e('0xb8')](_0x0c7e('0xb9'),{'UserId':Number(_0xd0497f[_0x0c7e('0x5f')][_0x0c7e('0x69')][_0x153fad]),'FaxAccountId':Number(_0xd0497f[_0x0c7e('0x60')]['id'])});}return _0x18a7c6;});}})[_0x0c7e('0x1d')](respondWithResult(_0x52a50f,null))[_0x0c7e('0x28')](handleError(_0x52a50f,null));};exports[_0x0c7e('0xba')]=function(_0x4feeee,_0xc3bae3,_0x2d30f2){return db['FaxAccount']['find']({'where':{'id':_0x4feeee[_0x0c7e('0x60')]['id']}})['then'](handleEntityNotFound(_0xc3bae3,null))[_0x0c7e('0x1d')](function(_0x303d39){if(_0x303d39){return _0x303d39[_0x0c7e('0xba')](_0x4feeee[_0x0c7e('0x44')][_0x0c7e('0x69')])[_0x0c7e('0x1d')](function(){if(_[_0x0c7e('0xbb')](_0x4feeee['query']['ids'])){for(var _0x364c87=0x0;_0x364c87<_0x4feeee[_0x0c7e('0x44')]['ids'][_0x0c7e('0x49')];_0x364c87+=0x1){socket[_0x0c7e('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x4feeee[_0x0c7e('0x44')][_0x0c7e('0x69')][_0x364c87]),'FaxAccountId':Number(_0x4feeee[_0x0c7e('0x60')]['id'])});}}else{socket[_0x0c7e('0xb8')](_0x0c7e('0xbc'),{'UserId':Number(_0x4feeee[_0x0c7e('0x44')][_0x0c7e('0x69')]),'FaxAccountId':Number(_0x4feeee[_0x0c7e('0x60')]['id'])});}});}})[_0x0c7e('0x1d')](respondWithStatusCode(_0xc3bae3,null))[_0x0c7e('0x28')](handleError(_0xc3bae3,null));};exports[_0x0c7e('0xbd')]=function(_0x23fb97,_0x2948a4,_0x1712f7){var _0x5ee3de={};var _0x4f4a3a={};var _0x21f03f;var _0x47de99;return db['FaxAccount'][_0x0c7e('0x65')]({'where':{'id':_0x23fb97[_0x0c7e('0x60')]['id']}})[_0x0c7e('0x1d')](handleEntityNotFound(_0x2948a4,null))['then'](function(_0x43d211){if(_0x43d211){_0x21f03f=_0x43d211;_0x4f4a3a[_0x0c7e('0x42')]=_[_0x0c7e('0x43')](db[_0x0c7e('0xbe')][_0x0c7e('0x3f')]);_0x4f4a3a['query']=_[_0x0c7e('0x43')](_0x23fb97[_0x0c7e('0x44')]);_0x4f4a3a[_0x0c7e('0x45')]=_[_0x0c7e('0x46')](_0x4f4a3a['model'],_0x4f4a3a['query']);_0x5ee3de['attributes']=_[_0x0c7e('0x46')](_0x4f4a3a[_0x0c7e('0x42')],qs['fields'](_0x23fb97[_0x0c7e('0x44')][_0x0c7e('0x47')]));_0x5ee3de[_0x0c7e('0x48')]=_0x5ee3de['attributes']['length']?_0x5ee3de['attributes']:_0x4f4a3a[_0x0c7e('0x42')];_0x5ee3de['order']=qs[_0x0c7e('0x4c')](_0x23fb97['query'][_0x0c7e('0x4c')]);_0x5ee3de['where']=qs['filters'](_['pick'](_0x23fb97[_0x0c7e('0x44')],_0x4f4a3a[_0x0c7e('0x45')]));if(_0x23fb97['query'][_0x0c7e('0x4e')]){_0x5ee3de[_0x0c7e('0x4d')]=_[_0x0c7e('0x4f')](_0x5ee3de['where'],{'$or':_[_0x0c7e('0x3d')](_0x5ee3de['attributes'],function(_0x4bbabe){var _0x202d9b={};_0x202d9b[_0x4bbabe]={'$like':'%'+_0x23fb97[_0x0c7e('0x44')][_0x0c7e('0x4e')]+'%'};return _0x202d9b;})});}_0x5ee3de=_[_0x0c7e('0x4f')]({},_0x5ee3de,_0x23fb97[_0x0c7e('0x50')]);return _0x21f03f[_0x0c7e('0xbd')](_0x5ee3de);}})[_0x0c7e('0x1d')](function(_0x1e2bb5){if(_0x1e2bb5){_0x47de99=_0x1e2bb5[_0x0c7e('0x49')];if(!_0x23fb97[_0x0c7e('0x44')][_0x0c7e('0x66')](_0x0c7e('0x4a'))){_0x5ee3de[_0x0c7e('0x2f')]=qs[_0x0c7e('0x2f')](_0x23fb97[_0x0c7e('0x44')][_0x0c7e('0x2f')]);_0x5ee3de[_0x0c7e('0x2d')]=qs[_0x0c7e('0x2d')](_0x23fb97[_0x0c7e('0x44')][_0x0c7e('0x2d')]);}return _0x21f03f[_0x0c7e('0xbd')](_0x5ee3de);}})['then'](function(_0x4bbf5b){if(_0x4bbf5b){return _0x4bbf5b?{'count':_0x47de99,'rows':_0x4bbf5b}:null;}})[_0x0c7e('0x1d')](respondWithResult(_0x2948a4,null))['catch'](handleError(_0x2948a4,null));}; \ No newline at end of file +var _0xbc11=['set','Content-Range','apply','reject','save','update','then','destroy','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','where','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','order','removeAnswers','addInteraction','FaxInteraction','ids','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','exten','localstationid','app','Fax\x20Extension','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','t38timeout','push','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x1dafa1,_0x903f2f){var _0x25a133=function(_0x5e227a){while(--_0x5e227a){_0x1dafa1['push'](_0x1dafa1['shift']());}};_0x25a133(++_0x903f2f);}(_0xbc11,0x95));var _0x1bc1=function(_0x194e84,_0x5104ec){_0x194e84=_0x194e84-0x0;var _0x3952b7=_0xbc11[_0x194e84];return _0x3952b7;};'use strict';var emlformat=require(_0x1bc1('0x0'));var rimraf=require(_0x1bc1('0x1'));var zipdir=require(_0x1bc1('0x2'));var jsonpatch=require(_0x1bc1('0x3'));var rp=require(_0x1bc1('0x4'));var moment=require(_0x1bc1('0x5'));var BPromise=require(_0x1bc1('0x6'));var Mustache=require(_0x1bc1('0x7'));var util=require('util');var path=require(_0x1bc1('0x8'));var sox=require(_0x1bc1('0x9'));var csv=require(_0x1bc1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bc1('0xb'));var _=require('lodash');var squel=require(_0x1bc1('0xc'));var crypto=require(_0x1bc1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1bc1('0xe'));var toCsv=require(_0x1bc1('0xa'));var querystring=require(_0x1bc1('0xf'));var Papa=require(_0x1bc1('0x10'));var Redis=require('ioredis');var authService=require(_0x1bc1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1bc1('0x12'));var hardwareService=require(_0x1bc1('0x13'));var logger=require(_0x1bc1('0x14'))(_0x1bc1('0x15'));var utils=require(_0x1bc1('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1bc1('0x17'))['db'];config['redis']=_[_0x1bc1('0x18')](config[_0x1bc1('0x19')],{'host':_0x1bc1('0x1a'),'port':0x18eb});var socket=require(_0x1bc1('0x1b'))(new Redis(config[_0x1bc1('0x19')]));require(_0x1bc1('0x1c'))['register'](socket);var jayson=require(_0x1bc1('0x1d'));var client=jayson['client'][_0x1bc1('0x1e')]({'port':0x232c});var client9002=jayson[_0x1bc1('0x1f')][_0x1bc1('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x37c648,_0x307c47,_0x284757,_0x33b798){return new BPromise(function(_0x184d81,_0x3af928){var _0xd5f276=_0x33b798||client;return _0xd5f276[_0x1bc1('0x20')](_0x37c648,_0x284757)['then'](function(_0x25c46a){logger[_0x1bc1('0x21')](_0x1bc1('0x22'),_0x307c47,_0x1bc1('0x23'));logger[_0x1bc1('0x24')](_0x1bc1('0x25'),_0x307c47,'request\x20sent',JSON[_0x1bc1('0x26')](_0x25c46a));if(_0x25c46a[_0x1bc1('0x27')]){if(_0x25c46a[_0x1bc1('0x27')][_0x1bc1('0x28')]===0x1f4){logger[_0x1bc1('0x27')]('FaxAccount,\x20%s,\x20%s',_0x307c47,_0x25c46a[_0x1bc1('0x27')][_0x1bc1('0x29')]);return _0x3af928(_0x25c46a[_0x1bc1('0x27')]['message']);}logger['error'](_0x1bc1('0x22'),_0x307c47,_0x25c46a['error'][_0x1bc1('0x29')]);return _0x184d81(_0x25c46a[_0x1bc1('0x27')]['message']);}else{logger[_0x1bc1('0x21')]('FaxAccount,\x20%s,\x20%s',_0x307c47,'request\x20sent');_0x184d81(_0x25c46a['result'][_0x1bc1('0x29')]);}})[_0x1bc1('0x2a')](function(_0x297379){logger['error'](_0x1bc1('0x22'),_0x307c47,_0x297379);_0x3af928(_0x297379);});});}function respondWithStatusCode(_0xe10a1c,_0x49187f){_0x49187f=_0x49187f||0xcc;return function(_0x2d1bf8){if(_0x2d1bf8){return _0xe10a1c[_0x1bc1('0x2b')](_0x49187f);}return _0xe10a1c[_0x1bc1('0x2c')](_0x49187f)['end']();};}function respondWithResult(_0x4f5215,_0x301b94){_0x301b94=_0x301b94||0xc8;return function(_0x35245a){if(_0x35245a){return _0x4f5215[_0x1bc1('0x2c')](_0x301b94)[_0x1bc1('0x2d')](_0x35245a);}};}function respondWithFilteredResult(_0x3c5f75,_0x4bc0f4){return function(_0x39d080){if(_0x39d080){var _0x4b8cab=typeof _0x4bc0f4[_0x1bc1('0x2e')]===_0x1bc1('0x2f')&&typeof _0x4bc0f4[_0x1bc1('0x30')]===_0x1bc1('0x2f');var _0x34fab8=_0x39d080['count'];var _0x1b1bae=_0x4b8cab?0x0:_0x4bc0f4[_0x1bc1('0x2e')];var _0x253bbd=_0x4b8cab?_0x39d080[_0x1bc1('0x31')]:_0x4bc0f4[_0x1bc1('0x2e')]+_0x4bc0f4['limit'];var _0x28e001;if(_0x253bbd>=_0x34fab8){_0x253bbd=_0x34fab8;_0x28e001=0xc8;}else{_0x28e001=0xce;}_0x3c5f75[_0x1bc1('0x2c')](_0x28e001);return _0x3c5f75[_0x1bc1('0x32')](_0x1bc1('0x33'),_0x1b1bae+'-'+_0x253bbd+'/'+_0x34fab8)[_0x1bc1('0x2d')](_0x39d080);}return null;};}function patchUpdates(_0x4f9480){return function(_0x4a7706){try{jsonpatch[_0x1bc1('0x34')](_0x4a7706,_0x4f9480,!![]);}catch(_0x42cb94){return BPromise[_0x1bc1('0x35')](_0x42cb94);}return _0x4a7706[_0x1bc1('0x36')]();};}function saveUpdates(_0x1ed109,_0x1b140b){return function(_0x5d08e5){if(_0x5d08e5){return _0x5d08e5[_0x1bc1('0x37')](_0x1ed109)[_0x1bc1('0x38')](function(_0x520d20){return _0x520d20;});}return null;};}function removeEntity(_0x5d38b6,_0x44d19a){return function(_0x41d2be){if(_0x41d2be){return _0x41d2be[_0x1bc1('0x39')]()[_0x1bc1('0x38')](function(){var _0x45dce7=_0x41d2be['get']({'plain':!![]});var _0x32bac9=_0x1bc1('0x3a');return db[_0x1bc1('0x3b')][_0x1bc1('0x39')]({'where':{'type':_0x32bac9,'resourceId':_0x45dce7['id']}})['then'](function(){return _0x41d2be;});})[_0x1bc1('0x38')](function(){_0x5d38b6[_0x1bc1('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57e1ce,_0x5907fc){return function(_0x1d4d78){if(!_0x1d4d78){_0x57e1ce[_0x1bc1('0x2b')](0x194);}return _0x1d4d78;};}function handleError(_0x3f6cbc,_0x27d3fd){_0x27d3fd=_0x27d3fd||0x1f4;return function(_0x491a05){logger[_0x1bc1('0x27')](_0x491a05[_0x1bc1('0x3c')]);if(_0x491a05[_0x1bc1('0x3d')]){delete _0x491a05[_0x1bc1('0x3d')];}_0x3f6cbc[_0x1bc1('0x2c')](_0x27d3fd)['send'](_0x491a05);};}exports[_0x1bc1('0x3e')]=function(_0x4d72b1,_0x4d5d4b){var _0x34ff7b={'include':[{'model':db[_0x1bc1('0x3f')],'as':_0x1bc1('0x40')}]},_0x3e1262={},_0x57b15b={'count':0x0,'rows':[]};var _0x2ce3d1=_[_0x1bc1('0x41')](db[_0x1bc1('0x42')][_0x1bc1('0x43')],function(_0x2c6205){return{'name':_0x2c6205[_0x1bc1('0x44')],'type':_0x2c6205[_0x1bc1('0x45')]['key']};});_0x3e1262[_0x1bc1('0x46')]=_[_0x1bc1('0x41')](_0x2ce3d1,_0x1bc1('0x3d'));_0x3e1262[_0x1bc1('0x47')]=_[_0x1bc1('0x48')](_0x4d72b1[_0x1bc1('0x47')]);_0x3e1262[_0x1bc1('0x49')]=_[_0x1bc1('0x4a')](_0x3e1262[_0x1bc1('0x46')],_0x3e1262['query']);_0x34ff7b[_0x1bc1('0x4b')]=_['intersection'](_0x3e1262[_0x1bc1('0x46')],qs['fields'](_0x4d72b1[_0x1bc1('0x47')][_0x1bc1('0x4c')]));_0x34ff7b[_0x1bc1('0x4b')]=_0x34ff7b[_0x1bc1('0x4b')][_0x1bc1('0x4d')]?_0x34ff7b[_0x1bc1('0x4b')]:_0x3e1262[_0x1bc1('0x46')];if(!_0x4d72b1[_0x1bc1('0x47')][_0x1bc1('0x4e')](_0x1bc1('0x4f'))){_0x34ff7b[_0x1bc1('0x30')]=qs[_0x1bc1('0x30')](_0x4d72b1[_0x1bc1('0x47')]['limit']);_0x34ff7b[_0x1bc1('0x2e')]=qs[_0x1bc1('0x2e')](_0x4d72b1['query'][_0x1bc1('0x2e')]);}_0x34ff7b['order']=qs[_0x1bc1('0x50')](_0x4d72b1['query']['sort']);_0x34ff7b['where']=qs[_0x1bc1('0x49')](_[_0x1bc1('0x51')](_0x4d72b1[_0x1bc1('0x47')],_0x3e1262[_0x1bc1('0x49')]),_0x2ce3d1);if(_0x4d72b1[_0x1bc1('0x47')][_0x1bc1('0x52')]){_0x34ff7b['where']=_['merge'](_0x34ff7b['where'],{'$or':_[_0x1bc1('0x41')](_0x2ce3d1,function(_0x3d1270){if(_0x3d1270[_0x1bc1('0x45')]!==_0x1bc1('0x53')){var _0x2ed37b={};_0x2ed37b[_0x3d1270[_0x1bc1('0x3d')]]={'$like':'%'+_0x4d72b1[_0x1bc1('0x47')][_0x1bc1('0x52')]+'%'};return _0x2ed37b;}})});}_0x34ff7b=_[_0x1bc1('0x54')]({},_0x34ff7b,_0x4d72b1[_0x1bc1('0x55')]);var _0x1e5059={'where':_0x34ff7b['where']};return db[_0x1bc1('0x42')]['count'](_0x1e5059)[_0x1bc1('0x38')](function(_0x452073){_0x57b15b[_0x1bc1('0x31')]=_0x452073;if(_0x4d72b1[_0x1bc1('0x47')][_0x1bc1('0x56')]){_0x34ff7b[_0x1bc1('0x57')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x34ff7b);})[_0x1bc1('0x38')](function(_0x1f90dd){_0x57b15b[_0x1bc1('0x58')]=_0x1f90dd;return _0x57b15b;})['then'](respondWithFilteredResult(_0x4d5d4b,_0x34ff7b))['catch'](handleError(_0x4d5d4b,null));};exports['show']=function(_0x2e0609,_0x3824e0){var _0xcd413f={'raw':![],'where':{'id':_0x2e0609[_0x1bc1('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xc592ac={};_0xc592ac[_0x1bc1('0x46')]=_['keys'](db[_0x1bc1('0x42')]['rawAttributes']);_0xc592ac[_0x1bc1('0x47')]=_[_0x1bc1('0x48')](_0x2e0609[_0x1bc1('0x47')]);_0xc592ac[_0x1bc1('0x49')]=_[_0x1bc1('0x4a')](_0xc592ac[_0x1bc1('0x46')],_0xc592ac['query']);_0xcd413f[_0x1bc1('0x4b')]=_['intersection'](_0xc592ac[_0x1bc1('0x46')],qs[_0x1bc1('0x4c')](_0x2e0609[_0x1bc1('0x47')][_0x1bc1('0x4c')]));_0xcd413f[_0x1bc1('0x4b')]=_0xcd413f[_0x1bc1('0x4b')][_0x1bc1('0x4d')]?_0xcd413f[_0x1bc1('0x4b')]:_0xc592ac[_0x1bc1('0x46')];if(_0x2e0609[_0x1bc1('0x47')][_0x1bc1('0x56')]){_0xcd413f[_0x1bc1('0x57')]=[{'all':!![]}];}_0xcd413f=_['merge']({},_0xcd413f,_0x2e0609[_0x1bc1('0x55')]);return db[_0x1bc1('0x42')][_0x1bc1('0x5a')](_0xcd413f)[_0x1bc1('0x38')](handleEntityNotFound(_0x3824e0,null))['then'](respondWithResult(_0x3824e0,null))[_0x1bc1('0x2a')](handleError(_0x3824e0,null));};exports[_0x1bc1('0x5b')]=function(_0x2a566e,_0xb73a6b){return db[_0x1bc1('0x42')][_0x1bc1('0x5b')](_0x2a566e[_0x1bc1('0x5c')],{})['then'](function(_0xee9b93){var _0x37db3e=_0x2a566e[_0x1bc1('0x5d')][_0x1bc1('0x5e')]({'plain':!![]});if(!_0x37db3e)throw new Error(_0x1bc1('0x5f'));if(_0x37db3e[_0x1bc1('0x60')]===_0x1bc1('0x5d')){var _0x59935f=_0xee9b93['get']({'plain':!![]});var _0x5b4d0c=_0x1bc1('0x3a');return db[_0x1bc1('0x61')][_0x1bc1('0x5a')]({'where':{'name':_0x5b4d0c,'userProfileId':_0x37db3e[_0x1bc1('0x62')]},'raw':!![]})['then'](function(_0x22f0b9){if(_0x22f0b9&&_0x22f0b9[_0x1bc1('0x63')]===0x0){return db[_0x1bc1('0x3b')][_0x1bc1('0x5b')]({'name':_0x59935f[_0x1bc1('0x3d')],'resourceId':_0x59935f['id'],'type':_0x22f0b9['name'],'sectionId':_0x22f0b9['id']},{})[_0x1bc1('0x38')](function(){return _0xee9b93;});}else{return _0xee9b93;}})[_0x1bc1('0x2a')](function(_0x56a930){logger[_0x1bc1('0x27')](_0x1bc1('0x64'),_0x56a930);throw _0x56a930;});}return _0xee9b93;})[_0x1bc1('0x38')](respondWithResult(_0xb73a6b,0xc9))[_0x1bc1('0x2a')](handleError(_0xb73a6b,null));};exports[_0x1bc1('0x37')]=function(_0x1be8fe,_0x5cb391){if(_0x1be8fe['body']['id']){delete _0x1be8fe['body']['id'];}return db[_0x1bc1('0x42')][_0x1bc1('0x5a')]({'where':{'id':_0x1be8fe['params']['id']},'include':[{'model':db[_0x1bc1('0x3f')],'as':_0x1bc1('0x40')}]})[_0x1bc1('0x38')](handleEntityNotFound(_0x5cb391,null))[_0x1bc1('0x38')](saveUpdates(_0x1be8fe['body'],null))[_0x1bc1('0x38')](respondWithResult(_0x5cb391,null))[_0x1bc1('0x2a')](handleError(_0x5cb391,null));};exports[_0x1bc1('0x39')]=function(_0x5df694,_0x4457c2){return db[_0x1bc1('0x42')]['find']({'where':{'id':_0x5df694[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x4457c2,null))[_0x1bc1('0x38')](removeEntity(_0x4457c2,null))[_0x1bc1('0x2a')](handleError(_0x4457c2,null));};exports[_0x1bc1('0x65')]=function(_0x11401c,_0x506351){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x506351,null))[_0x1bc1('0x2a')](handleError(_0x506351,null));};exports[_0x1bc1('0x66')]=function(_0x358f30,_0x4f0ded,_0x3d88cb){if(_0x358f30[_0x1bc1('0x5c')]['id']){delete _0x358f30[_0x1bc1('0x5c')]['id'];}return db['FaxAccount'][_0x1bc1('0x5a')]({'where':{'id':_0x358f30[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x4f0ded,null))[_0x1bc1('0x38')](function(_0x174e54){if(_0x174e54){_0x358f30[_0x1bc1('0x5c')][_0x1bc1('0x67')]=_0x174e54['id'];return db['Disposition'][_0x1bc1('0x5b')](_0x358f30[_0x1bc1('0x5c')]);}})[_0x1bc1('0x38')](respondWithResult(_0x4f0ded,null))['catch'](handleError(_0x4f0ded,null));};exports[_0x1bc1('0x68')]=function(_0x7cd325,_0x20477d,_0x2bf0f9){var _0x20948c={'raw':![],'where':{}};var _0x23ef36={};var _0xfcbddc={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1bc1('0x69')]({'where':{'id':_0x7cd325[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x20477d,null))[_0x1bc1('0x38')](function(_0x749948){if(_0x749948){_0x23ef36[_0x1bc1('0x46')]=_[_0x1bc1('0x48')](db['Disposition'][_0x1bc1('0x43')]);_0x23ef36[_0x1bc1('0x47')]=_[_0x1bc1('0x48')](_0x7cd325['query']);_0x23ef36[_0x1bc1('0x49')]=_[_0x1bc1('0x4a')](_0x23ef36['model'],_0x23ef36['query']);_0x20948c[_0x1bc1('0x4b')]=_['intersection'](_0x23ef36['model'],qs[_0x1bc1('0x4c')](_0x7cd325[_0x1bc1('0x47')][_0x1bc1('0x4c')]));_0x20948c[_0x1bc1('0x4b')]=_0x20948c[_0x1bc1('0x4b')]['length']?_0x20948c['attributes']:_0x23ef36[_0x1bc1('0x46')];if(!_0x7cd325[_0x1bc1('0x47')][_0x1bc1('0x4e')](_0x1bc1('0x4f'))){_0x20948c[_0x1bc1('0x30')]=qs[_0x1bc1('0x30')](_0x7cd325[_0x1bc1('0x47')]['limit']);_0x20948c['offset']=qs[_0x1bc1('0x2e')](_0x7cd325[_0x1bc1('0x47')][_0x1bc1('0x2e')]);}_0x20948c['order']=qs[_0x1bc1('0x50')](_0x7cd325['query'][_0x1bc1('0x50')]);_0x20948c[_0x1bc1('0x6a')]=qs[_0x1bc1('0x49')](_[_0x1bc1('0x51')](_0x7cd325[_0x1bc1('0x47')],_0x23ef36['filters']));_0x20948c[_0x1bc1('0x6a')]['FaxAccountId']=_0x749948['id'];if(_0x7cd325['query']['filter']){_0x20948c['where']=_[_0x1bc1('0x54')](_0x20948c[_0x1bc1('0x6a')],{'$or':_[_0x1bc1('0x41')](_0x20948c[_0x1bc1('0x4b')],function(_0x4e70db){var _0x4c09fc={};_0x4c09fc[_0x4e70db]={'$like':'%'+_0x7cd325[_0x1bc1('0x47')]['filter']+'%'};return _0x4c09fc;})});}_0x20948c=_['merge']({},_0x20948c,_0x7cd325[_0x1bc1('0x55')]);return db[_0x1bc1('0x6b')][_0x1bc1('0x31')]({'where':_0x20948c[_0x1bc1('0x6a')]})[_0x1bc1('0x38')](function(_0x1d2ab8){_0xfcbddc[_0x1bc1('0x31')]=_0x1d2ab8;if(_0x7cd325[_0x1bc1('0x47')][_0x1bc1('0x56')]){_0x20948c['include']=[{'all':!![]}];}return db[_0x1bc1('0x6b')][_0x1bc1('0x6c')](_0x20948c);})[_0x1bc1('0x38')](function(_0x5405d8){_0xfcbddc[_0x1bc1('0x58')]=_0x5405d8;return _0xfcbddc;});}})[_0x1bc1('0x38')](respondWithFilteredResult(_0x20477d,_0x20948c))[_0x1bc1('0x2a')](handleError(_0x20477d,null));};exports[_0x1bc1('0x6d')]=function(_0x15f9c5,_0x32f934,_0x276b67){return db[_0x1bc1('0x42')][_0x1bc1('0x5a')]({'where':{'id':_0x15f9c5[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x32f934,null))[_0x1bc1('0x38')](function(_0x53e737){if(_0x53e737){return _0x53e737['removeDispositions'](_0x15f9c5[_0x1bc1('0x47')]['ids']);}})[_0x1bc1('0x38')](respondWithStatusCode(_0x32f934,null))['catch'](handleError(_0x32f934,null));};exports[_0x1bc1('0x6e')]=function(_0x506de2,_0x4ca99e,_0x3b32b5){if(_0x506de2['body']['id']){delete _0x506de2[_0x1bc1('0x5c')]['id'];}return db[_0x1bc1('0x42')][_0x1bc1('0x5a')]({'where':{'id':_0x506de2['params']['id']}})['then'](handleEntityNotFound(_0x4ca99e,null))[_0x1bc1('0x38')](function(_0x41e3ee){if(_0x41e3ee){_0x506de2['body'][_0x1bc1('0x67')]=_0x41e3ee['id'];return db[_0x1bc1('0x6f')]['create'](_0x506de2['body']);}})[_0x1bc1('0x38')](respondWithResult(_0x4ca99e,null))['catch'](handleError(_0x4ca99e,null));};exports['getAnswers']=function(_0x2f1569,_0x945f1b,_0x1b4fbc){var _0xbd696e={'raw':![],'where':{}};var _0x2421e7={};var _0x5d3528={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1bc1('0x69')]({'where':{'id':_0x2f1569['params']['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x945f1b,null))[_0x1bc1('0x38')](function(_0x115605){if(_0x115605){_0x2421e7[_0x1bc1('0x46')]=_[_0x1bc1('0x48')](db[_0x1bc1('0x6f')][_0x1bc1('0x43')]);_0x2421e7[_0x1bc1('0x47')]=_['keys'](_0x2f1569[_0x1bc1('0x47')]);_0x2421e7['filters']=_[_0x1bc1('0x4a')](_0x2421e7['model'],_0x2421e7[_0x1bc1('0x47')]);_0xbd696e[_0x1bc1('0x4b')]=_[_0x1bc1('0x4a')](_0x2421e7[_0x1bc1('0x46')],qs[_0x1bc1('0x4c')](_0x2f1569[_0x1bc1('0x47')][_0x1bc1('0x4c')]));_0xbd696e[_0x1bc1('0x4b')]=_0xbd696e[_0x1bc1('0x4b')]['length']?_0xbd696e['attributes']:_0x2421e7[_0x1bc1('0x46')];if(!_0x2f1569[_0x1bc1('0x47')][_0x1bc1('0x4e')](_0x1bc1('0x4f'))){_0xbd696e[_0x1bc1('0x30')]=qs[_0x1bc1('0x30')](_0x2f1569[_0x1bc1('0x47')][_0x1bc1('0x30')]);_0xbd696e[_0x1bc1('0x2e')]=qs[_0x1bc1('0x2e')](_0x2f1569[_0x1bc1('0x47')][_0x1bc1('0x2e')]);}_0xbd696e[_0x1bc1('0x70')]=qs[_0x1bc1('0x50')](_0x2f1569[_0x1bc1('0x47')][_0x1bc1('0x50')]);_0xbd696e[_0x1bc1('0x6a')]=qs['filters'](_[_0x1bc1('0x51')](_0x2f1569['query'],_0x2421e7[_0x1bc1('0x49')]));_0xbd696e[_0x1bc1('0x6a')][_0x1bc1('0x67')]=_0x115605['id'];if(_0x2f1569[_0x1bc1('0x47')][_0x1bc1('0x52')]){_0xbd696e[_0x1bc1('0x6a')]=_['merge'](_0xbd696e[_0x1bc1('0x6a')],{'$or':_['map'](_0xbd696e[_0x1bc1('0x4b')],function(_0x17ad44){var _0x436f79={};_0x436f79[_0x17ad44]={'$like':'%'+_0x2f1569[_0x1bc1('0x47')]['filter']+'%'};return _0x436f79;})});}_0xbd696e=_['merge']({},_0xbd696e,_0x2f1569['options']);return db['CannedAnswer']['count']({'where':_0xbd696e['where']})['then'](function(_0x315346){_0x5d3528[_0x1bc1('0x31')]=_0x315346;if(_0x2f1569[_0x1bc1('0x47')][_0x1bc1('0x56')]){_0xbd696e[_0x1bc1('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1bc1('0x6c')](_0xbd696e);})[_0x1bc1('0x38')](function(_0x8380d2){_0x5d3528[_0x1bc1('0x58')]=_0x8380d2;return _0x5d3528;});}})[_0x1bc1('0x38')](respondWithFilteredResult(_0x945f1b,_0xbd696e))[_0x1bc1('0x2a')](handleError(_0x945f1b,null));};exports[_0x1bc1('0x71')]=function(_0x96b297,_0x21232f,_0x40019c){return db[_0x1bc1('0x42')][_0x1bc1('0x5a')]({'where':{'id':_0x96b297[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x21232f,null))['then'](function(_0x1be66a){if(_0x1be66a){return _0x1be66a[_0x1bc1('0x71')](_0x96b297['query']['ids']);}})[_0x1bc1('0x38')](respondWithStatusCode(_0x21232f,null))[_0x1bc1('0x2a')](handleError(_0x21232f,null));};exports[_0x1bc1('0x72')]=function(_0x53faa3,_0x35232c,_0x1f2fa2){return db[_0x1bc1('0x73')]['find']({'where':{'id':_0x53faa3['params']['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x35232c,null))[_0x1bc1('0x38')](function(_0x39b68a){if(_0x39b68a){return _0x39b68a[_0x1bc1('0x72')](_0x53faa3['body'][_0x1bc1('0x74')],_[_0x1bc1('0x75')](_0x53faa3[_0x1bc1('0x5c')],[_0x1bc1('0x74'),'id'])||{});}})['then'](respondWithResult(_0x35232c,null))['catch'](handleError(_0x35232c,null));};exports[_0x1bc1('0x76')]=function(_0x38a610,_0x3f84d9,_0x5ec84d){var _0x513d9f={'raw':![],'where':{}};var _0x1d3109={};var _0x5b2b59={'count':0x0,'rows':[]};return db[_0x1bc1('0x42')]['findOne']({'where':{'id':_0x38a610[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x3f84d9,null))['then'](function(_0x4ad7cb){if(_0x4ad7cb){_0x1d3109['model']=_[_0x1bc1('0x48')](db['FaxInteraction'][_0x1bc1('0x43')]);_0x1d3109[_0x1bc1('0x47')]=_[_0x1bc1('0x48')](_0x38a610['query']);_0x1d3109[_0x1bc1('0x49')]=_[_0x1bc1('0x4a')](_0x1d3109[_0x1bc1('0x46')],_0x1d3109[_0x1bc1('0x47')]);_0x513d9f['attributes']=_[_0x1bc1('0x4a')](_0x1d3109['model'],qs['fields'](_0x38a610[_0x1bc1('0x47')]['fields']));_0x513d9f[_0x1bc1('0x4b')]=_0x513d9f[_0x1bc1('0x4b')][_0x1bc1('0x4d')]?_0x513d9f['attributes']:_0x1d3109[_0x1bc1('0x46')];if(!_0x38a610['query'][_0x1bc1('0x4e')](_0x1bc1('0x4f'))){_0x513d9f['limit']=qs[_0x1bc1('0x30')](_0x38a610[_0x1bc1('0x47')][_0x1bc1('0x30')]);_0x513d9f[_0x1bc1('0x2e')]=qs[_0x1bc1('0x2e')](_0x38a610['query'][_0x1bc1('0x2e')]);}_0x513d9f[_0x1bc1('0x70')]=qs[_0x1bc1('0x50')](_0x38a610['query']['sort']);_0x513d9f[_0x1bc1('0x6a')]=qs[_0x1bc1('0x49')](_['pick'](_0x38a610[_0x1bc1('0x47')],_0x1d3109[_0x1bc1('0x49')]));_0x513d9f[_0x1bc1('0x6a')]['FaxAccountId']=_0x4ad7cb['id'];if(_0x38a610[_0x1bc1('0x47')][_0x1bc1('0x52')]){_0x513d9f[_0x1bc1('0x6a')]=_[_0x1bc1('0x54')](_0x513d9f[_0x1bc1('0x6a')],{'$or':_['map'](_0x513d9f[_0x1bc1('0x4b')],function(_0xd9170f){var _0x53d16e={};_0x53d16e[_0xd9170f]={'$like':'%'+_0x38a610[_0x1bc1('0x47')]['filter']+'%'};return _0x53d16e;})});}_0x513d9f=_[_0x1bc1('0x54')]({},_0x513d9f,_0x38a610[_0x1bc1('0x55')]);return db['FaxInteraction'][_0x1bc1('0x31')]({'where':_0x513d9f[_0x1bc1('0x6a')]})[_0x1bc1('0x38')](function(_0x52fc18){_0x5b2b59[_0x1bc1('0x31')]=_0x52fc18;if(_0x38a610[_0x1bc1('0x47')][_0x1bc1('0x56')]){_0x513d9f[_0x1bc1('0x57')]=[{'model':db[_0x1bc1('0x77')],'as':_0x1bc1('0x78'),'required':![]},{'model':db[_0x1bc1('0x79')],'as':_0x1bc1('0x7a'),'attributes':['name',_0x1bc1('0x7b'),_0x1bc1('0x7c')],'required':![]},{'model':db[_0x1bc1('0x7d')],'as':_0x1bc1('0x7e'),'attributes':['id',_0x1bc1('0x3d'),_0x1bc1('0x7f')],'where':_0x38a610[_0x1bc1('0x47')][_0x1bc1('0x80')]?{'id':_0x38a610['query'][_0x1bc1('0x80')]}:undefined,'required':_0x38a610['query']['tag']?!![]:![]}];}return db['FaxInteraction'][_0x1bc1('0x6c')](_0x513d9f);})[_0x1bc1('0x38')](function(_0x365085){_0x5b2b59['rows']=_0x365085;return _0x5b2b59;});}})[_0x1bc1('0x38')](respondWithFilteredResult(_0x3f84d9,_0x513d9f))['catch'](handleError(_0x3f84d9,null));};exports['addApplications']=function(_0x33706b,_0x1eb7bd){var _0x21ea7c=_0x33706b[_0x1bc1('0x59')]['id'];var _0x444112=_0x33706b[_0x1bc1('0x5c')];var _0x4df585=0xc8;var _0x2b0274=null;return db[_0x1bc1('0x81')][_0x1bc1('0x82')]({'isolationLevel':db[_0x1bc1('0x81')][_0x1bc1('0x83')][_0x1bc1('0x84')]['READ_COMMITTED']},function(_0x25801b){return db[_0x1bc1('0x42')][_0x1bc1('0x69')]({'where':{'id':_0x21ea7c},'transaction':_0x25801b})['then'](function(_0x23a40b){if(_0x23a40b){return db[_0x1bc1('0x85')][_0x1bc1('0x39')]({'where':{'FaxAccountId':_0x21ea7c},'transaction':_0x25801b})[_0x1bc1('0x38')](function(){var _0x243f0c=_[_0x1bc1('0x41')](_0x444112,function(_0x5d92e6){_0x5d92e6[_0x1bc1('0x67')]=_0x21ea7c;return _0x5d92e6;});return db[_0x1bc1('0x85')][_0x1bc1('0x86')](_0x243f0c,{'transaction':_0x25801b});});}else{_0x4df585=0x194;_0x2b0274=[];}});})[_0x1bc1('0x38')](function(){if(_0x4df585!==0x194){return db[_0x1bc1('0x85')][_0x1bc1('0x87')]({'where':{'FaxAccountId':_0x21ea7c},'order':_0x1bc1('0x88')})['then'](function(_0x2ffe38){_0x2b0274=_0x2ffe38;});}})[_0x1bc1('0x2a')](function(_0x43231e){_0x4df585=0x1f4;logger[_0x1bc1('0x27')](_0x43231e[_0x1bc1('0x3c')]);if(_0x43231e[_0x1bc1('0x3d')]){delete _0x43231e[_0x1bc1('0x3d')];}_0x2b0274=_0x43231e;})[_0x1bc1('0x89')](function(){if(_0x2b0274===null){_0x1eb7bd['sendStatus'](_0x4df585);}else{if(_0x4df585===0x1f4){_0x1eb7bd[_0x1bc1('0x2c')](_0x4df585)[_0x1bc1('0x8a')](_0x2b0274);}else{_0x1eb7bd[_0x1bc1('0x2c')](_0x4df585)[_0x1bc1('0x2d')](_0x2b0274);}}});};exports[_0x1bc1('0x8b')]=function(_0x272908,_0x1876bc,_0x2c4754){var _0x43a57a={};var _0x582026={};var _0x3ebdab;var _0x1eb50f;return db['FaxAccount'][_0x1bc1('0x69')]({'where':{'id':_0x272908['params']['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x1876bc,null))[_0x1bc1('0x38')](function(_0x1b9903){if(_0x1b9903){_0x3ebdab=_0x1b9903;_0x582026[_0x1bc1('0x46')]=_['keys'](db[_0x1bc1('0x85')][_0x1bc1('0x43')]);_0x582026[_0x1bc1('0x47')]=_[_0x1bc1('0x48')](_0x272908[_0x1bc1('0x47')]);_0x582026['filters']=_['intersection'](_0x582026[_0x1bc1('0x46')],_0x582026[_0x1bc1('0x47')]);_0x43a57a['attributes']=_[_0x1bc1('0x4a')](_0x582026[_0x1bc1('0x46')],qs[_0x1bc1('0x4c')](_0x272908[_0x1bc1('0x47')][_0x1bc1('0x4c')]));_0x43a57a[_0x1bc1('0x4b')]=_0x43a57a[_0x1bc1('0x4b')]['length']?_0x43a57a['attributes']:_0x582026[_0x1bc1('0x46')];_0x43a57a[_0x1bc1('0x70')]=qs[_0x1bc1('0x50')](_0x272908[_0x1bc1('0x47')]['sort']);_0x43a57a['where']=qs[_0x1bc1('0x49')](_[_0x1bc1('0x51')](_0x272908[_0x1bc1('0x47')],_0x582026[_0x1bc1('0x49')]));if(_0x272908[_0x1bc1('0x47')][_0x1bc1('0x52')]){_0x43a57a[_0x1bc1('0x6a')]=_[_0x1bc1('0x54')](_0x43a57a[_0x1bc1('0x6a')],{'$or':_[_0x1bc1('0x41')](_0x43a57a['attributes'],function(_0x493b7b){var _0x12d820={};_0x12d820[_0x493b7b]={'$like':'%'+_0x272908[_0x1bc1('0x47')][_0x1bc1('0x52')]+'%'};return _0x12d820;})});}_0x43a57a=_[_0x1bc1('0x54')]({},_0x43a57a,_0x272908['options']);return _0x3ebdab[_0x1bc1('0x8b')](_0x43a57a);}})[_0x1bc1('0x38')](function(_0x1a196e){if(_0x1a196e){_0x1eb50f=_0x1a196e[_0x1bc1('0x4d')];if(!_0x272908[_0x1bc1('0x47')][_0x1bc1('0x4e')]('nolimit')){_0x43a57a['limit']=qs[_0x1bc1('0x30')](_0x272908['query'][_0x1bc1('0x30')]);_0x43a57a[_0x1bc1('0x2e')]=qs[_0x1bc1('0x2e')](_0x272908[_0x1bc1('0x47')][_0x1bc1('0x2e')]);}return _0x3ebdab[_0x1bc1('0x8b')](_0x43a57a);}})[_0x1bc1('0x38')](function(_0x6c18bb){if(_0x6c18bb){return _0x6c18bb?{'count':_0x1eb50f,'rows':_0x6c18bb}:null;}})[_0x1bc1('0x38')](respondWithResult(_0x1876bc,null))[_0x1bc1('0x2a')](handleError(_0x1876bc,null));};function Extension(_0x3b9827,_0x25839a,_0x197f24,_0x503f19){this['context']='from-voip-provider';this[_0x1bc1('0x8c')]=_0x3b9827[_0x1bc1('0x8d')];this[_0x1bc1('0x8e')]=_0x503f19;this[_0x1bc1('0x45')]='system';this['description']=_0x1bc1('0x8f');this['FaxAccountId']=_0x3b9827['id'];this[_0x1bc1('0x88')]=_0x25839a;this[_0x1bc1('0x90')]=_0x197f24;}function createExtensionsReciveFax(_0x4b2a75){var _0x2c3624=0x1;var _0x122fba=[];_0x122fba['push'](new Extension(_0x4b2a75,_0x2c3624,'',_0x1bc1('0x91')));_0x2c3624+=0x1;_0x122fba['push'](new Extension(_0x4b2a75,_0x2c3624,_0x1bc1('0x92'),_0x1bc1('0x93')));_0x2c3624+=0x1;for(var _0x5e2e89 in _0x4b2a75){if(_0x4b2a75['hasOwnProperty'](_0x5e2e89)&&(_0x5e2e89===_0x1bc1('0x94')||_0x5e2e89==='localstationid'||_0x5e2e89===_0x1bc1('0x95')||_0x5e2e89===_0x1bc1('0x96')||_0x5e2e89==='headerinfo'||_0x5e2e89===_0x1bc1('0x97')||_0x5e2e89===_0x1bc1('0x98')||_0x5e2e89===_0x1bc1('0x99')||_0x5e2e89===_0x1bc1('0x9a'))){_0x122fba[_0x1bc1('0x9b')](new Extension(_0x4b2a75,_0x2c3624,_0x1bc1('0x9c')+_0x5e2e89+')='+_0x4b2a75[_0x5e2e89],_0x1bc1('0x93')));_0x2c3624+=0x1;}}_0x122fba[_0x1bc1('0x9b')](new Extension(_0x4b2a75,_0x2c3624,'6','Wait'));_0x2c3624+=0x1;_0x122fba[_0x1bc1('0x9b')](new Extension(_0x4b2a75,_0x2c3624,_0x1bc1('0x9d'),'ReceiveFax'));_0x2c3624=0x0;return _0x122fba;}exports[_0x1bc1('0x9e')]=function(_0x1f8025,_0x54cd00,_0x167961){var _0x948456;return db[_0x1bc1('0x81')][_0x1bc1('0x82')](function(_0x32eae7){return db[_0x1bc1('0x42')][_0x1bc1('0x5b')](_0x1f8025[_0x1bc1('0x5c')],{'transaction':_0x32eae7})[_0x1bc1('0x38')](function(_0x562d95){_0x948456=_0x562d95[_0x1bc1('0x5e')]({'plain':!![]});return db['VoiceExtension'][_0x1bc1('0x86')](createExtensionsReciveFax(_0x948456),{'transaction':_0x32eae7});});})[_0x1bc1('0x38')](function(){return _0x948456;})['then'](respondWithResult(_0x54cd00,null))['catch'](handleError(_0x54cd00,null));};exports[_0x1bc1('0x9f')]=function(_0x2892ac,_0x2b6d5c,_0x159801){var _0x4b6ae4;return db[_0x1bc1('0x81')][_0x1bc1('0x82')](function(_0x4c7ca6){return db[_0x1bc1('0x42')][_0x1bc1('0x37')](_0x2892ac[_0x1bc1('0x5c')],{'where':{'id':_0x2892ac[_0x1bc1('0x5c')]['id']},'transaction':_0x4c7ca6})[_0x1bc1('0x38')](function(_0x507474){return db[_0x1bc1('0xa0')][_0x1bc1('0x39')]({'where':{'FaxAccountId':_0x2892ac[_0x1bc1('0x5c')]['id']},'transaction':_0x4c7ca6})['then'](function(_0x1ae21d){return db[_0x1bc1('0xa0')][_0x1bc1('0x86')](createExtensionsReciveFax(_[_0x1bc1('0x75')](_0x2892ac[_0x1bc1('0x5c')],[_0x1bc1('0xa1'),'key','createdAt',_0x1bc1('0xa2'),_0x1bc1('0xa3'),_0x1bc1('0xa4')])),{'transaction':_0x4c7ca6});});});})[_0x1bc1('0x38')](function(){return db[_0x1bc1('0x42')][_0x1bc1('0xa5')](_0x2892ac['body']['id']);})['then'](respondWithResult(_0x2b6d5c,null))[_0x1bc1('0x2a')](handleError(_0x2b6d5c,null));};exports['getMessages']=function(_0x213861,_0x57d9f2,_0x3e58ee){var _0x12854b={'raw':!![],'where':{}};var _0x6edf61={};var _0x3a1768={'count':0x0,'rows':[]};return db[_0x1bc1('0x42')][_0x1bc1('0x69')]({'where':{'id':_0x213861[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x57d9f2,null))[_0x1bc1('0x38')](function(_0x168f01){if(_0x168f01){_0x6edf61['model']=_[_0x1bc1('0x48')](db[_0x1bc1('0xa6')][_0x1bc1('0x43')]);_0x6edf61[_0x1bc1('0x47')]=_[_0x1bc1('0x48')](_0x213861['query']);_0x6edf61[_0x1bc1('0x49')]=_['intersection'](_0x6edf61['model'],_0x6edf61[_0x1bc1('0x47')]);_0x12854b['attributes']=_['intersection'](_0x6edf61[_0x1bc1('0x46')],qs[_0x1bc1('0x4c')](_0x213861[_0x1bc1('0x47')][_0x1bc1('0x4c')]));_0x12854b['attributes']=_0x12854b['attributes']['length']?_0x12854b[_0x1bc1('0x4b')]:_0x6edf61['model'];if(!_0x213861[_0x1bc1('0x47')][_0x1bc1('0x4e')](_0x1bc1('0x4f'))){_0x12854b[_0x1bc1('0x30')]=qs[_0x1bc1('0x30')](_0x213861[_0x1bc1('0x47')][_0x1bc1('0x30')]);_0x12854b['offset']=qs[_0x1bc1('0x2e')](_0x213861[_0x1bc1('0x47')][_0x1bc1('0x2e')]);}_0x12854b[_0x1bc1('0x70')]=qs[_0x1bc1('0x50')](_0x213861[_0x1bc1('0x47')][_0x1bc1('0x50')]);_0x12854b[_0x1bc1('0x6a')]=qs[_0x1bc1('0x49')](_['pick'](_0x213861[_0x1bc1('0x47')],_0x6edf61[_0x1bc1('0x49')]));_0x12854b['where'][_0x1bc1('0x67')]=_0x168f01['id'];if(_0x213861['query'][_0x1bc1('0x52')]){_0x12854b[_0x1bc1('0x6a')]=_[_0x1bc1('0x54')](_0x12854b[_0x1bc1('0x6a')],{'$or':_[_0x1bc1('0x41')](_0x12854b[_0x1bc1('0x4b')],function(_0x467d5a){var _0x108268={};_0x108268[_0x467d5a]={'$like':'%'+_0x213861['query'][_0x1bc1('0x52')]+'%'};return _0x108268;})});}if(_0x213861[_0x1bc1('0x47')][_0x1bc1('0xa7')]){var _0x5af7ee=_0x213861['query']['$gte']['split'](',');var _0x1d0dbe={};_0x1d0dbe[_0x5af7ee[0x0]]={'$gte':moment(_0x5af7ee[0x1])[_0x1bc1('0xa8')](_0x1bc1('0xa9'))};_0x12854b[_0x1bc1('0x6a')]=_[_0x1bc1('0x54')](_0x12854b['where'],_0x1d0dbe);}_0x12854b=_[_0x1bc1('0x54')]({},_0x12854b,_0x213861[_0x1bc1('0x55')]);return db[_0x1bc1('0xa6')][_0x1bc1('0x31')]({'where':_0x12854b[_0x1bc1('0x6a')]})[_0x1bc1('0x38')](function(_0x5df4db){_0x3a1768[_0x1bc1('0x31')]=_0x5df4db;if(_0x213861['query'][_0x1bc1('0x56')]){_0x12854b[_0x1bc1('0x57')]=[{'all':!![]}];}return db['FaxMessage'][_0x1bc1('0x6c')](_0x12854b);})[_0x1bc1('0x38')](function(_0x395795){_0x3a1768['rows']=_0x395795;return _0x3a1768;});}})[_0x1bc1('0x38')](respondWithFilteredResult(_0x57d9f2,_0x12854b))['catch'](handleError(_0x57d9f2,null));};exports[_0x1bc1('0x8a')]=function(_0x1e1b1a,_0x50ab9c,_0x29e1d5){var _0x50f760,_0x20d2e8={},_0x325b99;if(_0x1e1b1a[_0x1bc1('0x5c')]['to']){_0x325b99=_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0];}return db['FaxAccount'][_0x1bc1('0x5a')]({'where':{'id':_0x1e1b1a[_0x1bc1('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x1bc1('0xaa'),'include':[{'model':db[_0x1bc1('0x77')],'as':_0x1bc1('0xab'),'where':{'fax':_0x325b99},'limit':0x1,'order':[[_0x1bc1('0xa2'),_0x1bc1('0xac')]]}]}]})[_0x1bc1('0x38')](handleEntityNotFound(_0x50ab9c,null))[_0x1bc1('0x38')](function(_0x4aa19f){_0x50f760=_0x4aa19f;if(_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')]&&_0x1e1b1a[_0x1bc1('0x5c')]['attachments'][_0x1bc1('0x4d')]){for(var _0xa23582=0x0;_0xa23582<_0x1e1b1a[_0x1bc1('0x5c')]['attachments'][_0x1bc1('0x4d')];_0xa23582+=0x1){_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][_0xa23582]={'filename':_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][_0xa23582][_0x1bc1('0x3d')],'id':_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][_0xa23582]['id'],'path':path[_0x1bc1('0xae')](config[_0x1bc1('0xaf')],_0x1bc1('0xb0'),_0x1e1b1a[_0x1bc1('0x5c')]['attachments'][_0xa23582][_0x1bc1('0xb1')])};}}return respondWithRpcPromise('CheckAfterSend',_0x1bc1('0xb2'),{'FaxAccountId':_[_0x1bc1('0xb3')](_0x1e1b1a[_0x1bc1('0x59')]['id'])?undefined:_0x1e1b1a[_0x1bc1('0x59')]['id'],'path':_[_0x1bc1('0xb3')](_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][0x0]['path'])?undefined:_0x1e1b1a['body'][_0x1bc1('0xad')][0x0][_0x1bc1('0x8')],'fax':_[_0x1bc1('0xb3')](_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0])?undefined:_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x50f760){if(_[_0x1bc1('0xb3')](_0x1e1b1a[_0x1bc1('0x5c')]['from'])){_0x1e1b1a['body'][_0x1bc1('0xb4')]=util[_0x1bc1('0xa8')](_0x1bc1('0xb5'),_0x50f760['name'],_0x50f760[_0x1bc1('0xb6')]);}if(_0x50f760[_0x1bc1('0xaa')]){if(_0x50f760[_0x1bc1('0xaa')]['Contacts'][_0x1bc1('0x4d')]){return _0x50f760[_0x1bc1('0xaa')][_0x1bc1('0xab')][0x0];}else{return db[_0x1bc1('0x77')][_0x1bc1('0x5b')](_['defaults'](_0x1e1b1a[_0x1bc1('0x5c')],{'firstName':_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0],'phone':_0x1e1b1a['body']['to'][0x0],'fax':_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0],'ListId':_0x50f760[_0x1bc1('0xa4')]}));}}else{throw new Error(_0x1bc1('0xb7'));}}else{throw new Error(_0x1bc1('0xb8'));}})[_0x1bc1('0x38')](function(_0x54e288){if(_0x54e288){return db[_0x1bc1('0x73')][_0x1bc1('0x5a')]({'where':{'ContactId':_0x54e288['id'],'closed':![],'FaxAccountId':_0x50f760['id']}})[_0x1bc1('0x38')](function(_0x1c2ed6){if(_0x1c2ed6){return[_0x1c2ed6,![]];}return db[_0x1bc1('0x73')][_0x1bc1('0x5b')]({'UserId':_0x1e1b1a[_0x1bc1('0x5d')]['id'],'ContactId':_0x54e288['id'],'FaxAccountId':_0x50f760['id'],'fax':_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1bc1('0x54')](_0x1e1b1a['body'],{'read':![],'body':_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][0x0][_0x1bc1('0xb9')],'FaxAccountId':_0x50f760['id'],'UserId':_0x1e1b1a[_0x1bc1('0x5d')]['id'],'ContactId':_0x54e288['id'],'AttachmentId':_0x1e1b1a['body']['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x1bc1('0xba')}]})['then'](function(_0x504a27){return[_0x504a27,!![]];});});}else{throw new Error(_0x1bc1('0xbb'));}})[_0x1bc1('0xbc')](function(_0x27f344,_0x32d5ea){if(_0x32d5ea){return _0x27f344;}return db[_0x1bc1('0xa6')]['create']({'direction':'out','read':![],'body':_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][0x0][_0x1bc1('0xb9')],'FaxAccountId':_0x50f760['id'],'FaxInteractionId':_0x27f344['id'],'UserId':_0x1e1b1a['user']['id'],'ContactId':_0x27f344[_0x1bc1('0xbd')],'AttachmentId':_0x1e1b1a[_0x1bc1('0x5c')]['attachments'][0x0]['id']})['then'](function(_0x38f223){_0x27f344['dataValues'][_0x1bc1('0xba')]=[];_0x27f344[_0x1bc1('0xbe')][_0x1bc1('0xba')]['push'](_0x38f223[_0x1bc1('0xbe')]);return _0x27f344;});})[_0x1bc1('0x38')](function(_0x367793){respondWithRpcPromise(_0x1bc1('0xbf'),_0x1bc1('0xbf'),{'FaxAccountId':_[_0x1bc1('0xb3')](_0x1e1b1a[_0x1bc1('0x59')]['id'])?undefined:_0x1e1b1a['params']['id'],'path':_['isNil'](_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][0x0][_0x1bc1('0x8')])?undefined:_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][0x0][_0x1bc1('0x8')],'fax':_['isNil'](_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0])?undefined:_0x1e1b1a[_0x1bc1('0x5c')]['to'][0x0],'AttachmentId':_0x1e1b1a[_0x1bc1('0x5c')][_0x1bc1('0xad')][0x0]['id']},client9002)['then'](function(_0x3dd7f0){logger['info'](_0x1bc1('0xc0'),_0x3dd7f0);})[_0x1bc1('0x2a')](function(_0x181726){logger[_0x1bc1('0x21')](_0x1bc1('0xc0'),_0x181726);});return _0x367793;})[_0x1bc1('0x38')](respondWithResult(_0x50ab9c,null))[_0x1bc1('0x2a')](handleError(_0x50ab9c,null));};exports[_0x1bc1('0xc1')]=function(_0x68bbde,_0x38f6f0,_0x322def){return db['FaxAccount'][_0x1bc1('0x5a')]({'where':{'id':_0x68bbde[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x38f6f0,null))[_0x1bc1('0x38')](function(_0x1e80ce){if(_0x1e80ce){return _0x1e80ce[_0x1bc1('0xc1')](_0x68bbde[_0x1bc1('0x5c')][_0x1bc1('0x74')],_[_0x1bc1('0x75')](_0x68bbde[_0x1bc1('0x5c')],[_0x1bc1('0x74'),'id'])||{})['spread'](function(_0x1b394e){for(var _0x2ec3d3=0x0;_0x2ec3d3<_0x68bbde[_0x1bc1('0x5c')][_0x1bc1('0x74')][_0x1bc1('0x4d')];_0x2ec3d3+=0x1){socket[_0x1bc1('0xc2')](_0x1bc1('0xc3'),{'UserId':Number(_0x68bbde['body'][_0x1bc1('0x74')][_0x2ec3d3]),'FaxAccountId':Number(_0x68bbde['params']['id'])});}return _0x1b394e;});}})[_0x1bc1('0x38')](respondWithResult(_0x38f6f0,null))['catch'](handleError(_0x38f6f0,null));};exports[_0x1bc1('0xc4')]=function(_0x8bb560,_0x24025e,_0x16d93e){return db[_0x1bc1('0x42')]['find']({'where':{'id':_0x8bb560[_0x1bc1('0x59')]['id']}})[_0x1bc1('0x38')](handleEntityNotFound(_0x24025e,null))[_0x1bc1('0x38')](function(_0x482cdc){if(_0x482cdc){return _0x482cdc[_0x1bc1('0xc4')](_0x8bb560[_0x1bc1('0x47')][_0x1bc1('0x74')])[_0x1bc1('0x38')](function(){if(_['isArray'](_0x8bb560[_0x1bc1('0x47')]['ids'])){for(var _0x18a7e4=0x0;_0x18a7e4<_0x8bb560[_0x1bc1('0x47')][_0x1bc1('0x74')][_0x1bc1('0x4d')];_0x18a7e4+=0x1){socket[_0x1bc1('0xc2')](_0x1bc1('0xc5'),{'UserId':Number(_0x8bb560[_0x1bc1('0x47')]['ids'][_0x18a7e4]),'FaxAccountId':Number(_0x8bb560[_0x1bc1('0x59')]['id'])});}}else{socket[_0x1bc1('0xc2')](_0x1bc1('0xc5'),{'UserId':Number(_0x8bb560[_0x1bc1('0x47')][_0x1bc1('0x74')]),'FaxAccountId':Number(_0x8bb560['params']['id'])});}});}})['then'](respondWithStatusCode(_0x24025e,null))['catch'](handleError(_0x24025e,null));};exports[_0x1bc1('0xc6')]=function(_0x227585,_0x3ba793,_0x56a20f){var _0x52c84a={};var _0xd3ec8d={};var _0x14c557;var _0x4124e5;return db[_0x1bc1('0x42')]['findOne']({'where':{'id':_0x227585[_0x1bc1('0x59')]['id']}})['then'](handleEntityNotFound(_0x3ba793,null))[_0x1bc1('0x38')](function(_0x154d46){if(_0x154d46){_0x14c557=_0x154d46;_0xd3ec8d[_0x1bc1('0x46')]=_[_0x1bc1('0x48')](db[_0x1bc1('0x79')][_0x1bc1('0x43')]);_0xd3ec8d[_0x1bc1('0x47')]=_[_0x1bc1('0x48')](_0x227585[_0x1bc1('0x47')]);_0xd3ec8d[_0x1bc1('0x49')]=_[_0x1bc1('0x4a')](_0xd3ec8d['model'],_0xd3ec8d[_0x1bc1('0x47')]);_0x52c84a[_0x1bc1('0x4b')]=_[_0x1bc1('0x4a')](_0xd3ec8d[_0x1bc1('0x46')],qs['fields'](_0x227585[_0x1bc1('0x47')]['fields']));_0x52c84a['attributes']=_0x52c84a[_0x1bc1('0x4b')]['length']?_0x52c84a[_0x1bc1('0x4b')]:_0xd3ec8d[_0x1bc1('0x46')];_0x52c84a['order']=qs['sort'](_0x227585[_0x1bc1('0x47')]['sort']);_0x52c84a[_0x1bc1('0x6a')]=qs['filters'](_[_0x1bc1('0x51')](_0x227585[_0x1bc1('0x47')],_0xd3ec8d[_0x1bc1('0x49')]));if(_0x227585['query']['filter']){_0x52c84a[_0x1bc1('0x6a')]=_['merge'](_0x52c84a[_0x1bc1('0x6a')],{'$or':_[_0x1bc1('0x41')](_0x52c84a[_0x1bc1('0x4b')],function(_0x5637c7){var _0x4dbb24={};_0x4dbb24[_0x5637c7]={'$like':'%'+_0x227585[_0x1bc1('0x47')][_0x1bc1('0x52')]+'%'};return _0x4dbb24;})});}_0x52c84a=_['merge']({},_0x52c84a,_0x227585[_0x1bc1('0x55')]);return _0x14c557[_0x1bc1('0xc6')](_0x52c84a);}})['then'](function(_0x327bd5){if(_0x327bd5){_0x4124e5=_0x327bd5[_0x1bc1('0x4d')];if(!_0x227585['query'][_0x1bc1('0x4e')](_0x1bc1('0x4f'))){_0x52c84a[_0x1bc1('0x30')]=qs[_0x1bc1('0x30')](_0x227585[_0x1bc1('0x47')][_0x1bc1('0x30')]);_0x52c84a[_0x1bc1('0x2e')]=qs['offset'](_0x227585[_0x1bc1('0x47')][_0x1bc1('0x2e')]);}return _0x14c557[_0x1bc1('0xc6')](_0x52c84a);}})['then'](function(_0x3c8c9f){if(_0x3c8c9f){return _0x3c8c9f?{'count':_0x4124e5,'rows':_0x3c8c9f}:null;}})[_0x1bc1('0x38')](respondWithResult(_0x3ba793,null))[_0x1bc1('0x2a')](handleError(_0x3ba793,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 9148610..e6e2877 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 _0x65f6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxAccount'];(function(_0x29dda1,_0x508e13){var _0x21b0ef=function(_0x118906){while(--_0x118906){_0x29dda1['push'](_0x29dda1['shift']());}};_0x21b0ef(++_0x508e13);}(_0x65f6,0x170));var _0x665f=function(_0x35aa57,_0x41a1a2){_0x35aa57=_0x35aa57-0x0;var _0x56408f=_0x65f6[_0x35aa57];return _0x56408f;};'use strict';var EventEmitter=require(_0x665f('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x665f('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x665f('0x2')](0x0);var events={'afterCreate':_0x665f('0x3'),'afterUpdate':_0x665f('0x4'),'afterDestroy':_0x665f('0x5')};function emitEvent(_0x173c00){return function(_0x58be4b,_0x4279d8,_0x51904d){FaxAccountEvents[_0x665f('0x6')](_0x173c00+':'+_0x58be4b['id'],_0x58be4b);FaxAccountEvents[_0x665f('0x6')](_0x173c00,_0x58be4b);_0x51904d(null);};}for(var e in events){if(events[_0x665f('0x7')](e)){var event=events[e];FaxAccount[_0x665f('0x8')](e,emitEvent(event));}}module[_0x665f('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x1ebb=['FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x20ba62,_0x539a35){var _0x4cf2d0=function(_0x4686db){while(--_0x4686db){_0x20ba62['push'](_0x20ba62['shift']());}};_0x4cf2d0(++_0x539a35);}(_0x1ebb,0x1d2));var _0xb1eb=function(_0x58cca2,_0x293cec){_0x58cca2=_0x58cca2-0x0;var _0x162d66=_0x1ebb[_0x58cca2];return _0x162d66;};'use strict';var EventEmitter=require(_0xb1eb('0x0'));var FaxAccount=require(_0xb1eb('0x1'))['db'][_0xb1eb('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb1eb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb1eb('0x4'),'afterDestroy':_0xb1eb('0x5')};function emitEvent(_0x22de5){return function(_0x2ed2a7,_0x196068,_0x307ce3){FaxAccountEvents[_0xb1eb('0x6')](_0x22de5+':'+_0x2ed2a7['id'],_0x2ed2a7);FaxAccountEvents[_0xb1eb('0x6')](_0x22de5,_0x2ed2a7);_0x307ce3(null);};}for(var e in events){if(events[_0xb1eb('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xb1eb('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 380a948..609a7cd 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 _0xb6fa=['bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x506f53,_0x2e2992){var _0x2e0a07=function(_0x36f8fa){while(--_0x36f8fa){_0x506f53['push'](_0x506f53['shift']());}};_0x2e0a07(++_0x2e2992);}(_0xb6fa,0x145));var _0xab6f=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb6fa[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xab6f('0x0'));var util=require(_0xab6f('0x1'));var logger=require(_0xab6f('0x2'))(_0xab6f('0x3'));var moment=require(_0xab6f('0x4'));var BPromise=require(_0xab6f('0x5'));var rp=require(_0xab6f('0x6'));var fs=require('fs');var path=require(_0xab6f('0x7'));var rimraf=require(_0xab6f('0x8'));var config=require(_0xab6f('0x9'));var attributes=require(_0xab6f('0xa'));module[_0xab6f('0xb')]=function(_0x4647f6,_0x1d1409){return _0x4647f6[_0xab6f('0xc')](_0xab6f('0xd'),attributes,{'tableName':_0xab6f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37da=['./faxAccount.attributes','exports','FaxAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2d5ba8,_0x16b612){var _0x2a0a90=function(_0xa9ce24){while(--_0xa9ce24){_0x2d5ba8['push'](_0x2d5ba8['shift']());}};_0x2a0a90(++_0x16b612);}(_0x37da,0x142));var _0xa37d=function(_0x32b681,_0x3a62f2){_0x32b681=_0x32b681-0x0;var _0x51776e=_0x37da[_0x32b681];return _0x51776e;};'use strict';var _=require(_0xa37d('0x0'));var util=require(_0xa37d('0x1'));var logger=require(_0xa37d('0x2'))(_0xa37d('0x3'));var moment=require(_0xa37d('0x4'));var BPromise=require('bluebird');var rp=require(_0xa37d('0x5'));var fs=require('fs');var path=require(_0xa37d('0x6'));var rimraf=require(_0xa37d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa37d('0x8'));module[_0xa37d('0x9')]=function(_0x3fd700,_0x27e825){return _0x3fd700['define'](_0xa37d('0xa'),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 e0affaa..62b2d19 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 _0xa429=['Applications','get','applications','list','priority','asc','defaults','ListId','FaxInteraction','create','autoclose','push','length','close','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','redis','./faxAccount.socket','register','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','CmContact','then','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','FaxApplication'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xa429,0xd4));var _0x9a42=function(_0x5ed7b8,_0x5fa6c){_0x5ed7b8=_0x5ed7b8-0x0;var _0x33c0b1=_0xa429[_0x5ed7b8];return _0x33c0b1;};'use strict';var _=require('lodash');var util=require(_0x9a42('0x0'));var moment=require('moment');var BPromise=require(_0x9a42('0x1'));var rs=require(_0x9a42('0x2'));var fs=require('fs');var Redis=require(_0x9a42('0x3'));var db=require(_0x9a42('0x4'))['db'];var utils=require(_0x9a42('0x5'));var logger=require(_0x9a42('0x6'))(_0x9a42('0x7'));var config=require(_0x9a42('0x8'));var jayson=require(_0x9a42('0x9'));var client=jayson[_0x9a42('0xa')][_0x9a42('0xb')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9a42('0xc'))(new Redis(config[_0x9a42('0xd')]));require(_0x9a42('0xe'))[_0x9a42('0xf')](socket);function respondWithRpcPromise(_0x253455,_0x354e53,_0x5b955c){return new BPromise(function(_0x21a80d,_0x2f3d14){return client['request'](_0x253455,_0x5b955c)['then'](function(_0x1c5d90){logger[_0x9a42('0x10')](_0x9a42('0x11'),_0x354e53,_0x9a42('0x12'));logger[_0x9a42('0x13')](_0x9a42('0x14'),_0x354e53,_0x9a42('0x12'),JSON['stringify'](_0x1c5d90));if(_0x1c5d90[_0x9a42('0x15')]){if(_0x1c5d90[_0x9a42('0x15')][_0x9a42('0x16')]===0x1f4){logger['error'](_0x9a42('0x11'),_0x354e53,_0x1c5d90['error'][_0x9a42('0x17')]);return _0x2f3d14(_0x1c5d90[_0x9a42('0x15')]['message']);}logger[_0x9a42('0x15')](_0x9a42('0x11'),_0x354e53,_0x1c5d90[_0x9a42('0x15')][_0x9a42('0x17')]);return _0x21a80d(_0x1c5d90[_0x9a42('0x15')]['message']);}else{logger[_0x9a42('0x10')](_0x9a42('0x11'),_0x354e53,_0x9a42('0x12'));_0x21a80d(_0x1c5d90[_0x9a42('0x18')][_0x9a42('0x17')]);}})[_0x9a42('0x19')](function(_0x170895){logger[_0x9a42('0x15')](_0x9a42('0x11'),_0x354e53,_0x170895);_0x2f3d14(_0x170895);});});}exports[_0x9a42('0x1a')]=function(_0x1fcb59){var _0x915a03=this;return new Promise(function(_0x951f6,_0x47a2f6){return db['FaxAccount'][_0x9a42('0x1b')]({'raw':_0x1fcb59[_0x9a42('0x1c')]?_0x1fcb59['options'][_0x9a42('0x1d')]===undefined?!![]:![]:!![],'where':_0x1fcb59['options']?_0x1fcb59[_0x9a42('0x1c')][_0x9a42('0x1e')]||null:null,'attributes':_0x1fcb59['options']?_0x1fcb59['options'][_0x9a42('0x1f')]||null:null,'limit':_0x1fcb59[_0x9a42('0x1c')]?_0x1fcb59[_0x9a42('0x1c')][_0x9a42('0x20')]||null:null,'include':_0x1fcb59[_0x9a42('0x1c')]?_0x1fcb59[_0x9a42('0x1c')][_0x9a42('0x21')]?_[_0x9a42('0x22')](_0x1fcb59[_0x9a42('0x1c')][_0x9a42('0x21')],function(_0x51d0b3){return{'model':db[_0x51d0b3[_0x9a42('0x23')]],'as':_0x51d0b3['as'],'attributes':_0x51d0b3['attributes'],'include':_0x51d0b3[_0x9a42('0x21')]?_['map'](_0x51d0b3[_0x9a42('0x21')],function(_0x181022){return{'model':db[_0x181022[_0x9a42('0x23')]],'as':_0x181022['as'],'attributes':_0x181022[_0x9a42('0x1f')],'include':_0x181022[_0x9a42('0x21')]?_['map'](_0x181022[_0x9a42('0x21')],function(_0xd6338d){return{'model':db[_0xd6338d[_0x9a42('0x23')]],'as':_0xd6338d['as'],'attributes':_0xd6338d[_0x9a42('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20abd2){logger[_0x9a42('0x10')](_0x9a42('0x1a'),_0x1fcb59);logger[_0x9a42('0x13')](_0x9a42('0x1a'),_0x1fcb59,JSON[_0x9a42('0x24')](_0x20abd2));_0x951f6(_0x20abd2);})[_0x9a42('0x19')](function(_0x83a300){logger[_0x9a42('0x15')](_0x9a42('0x1a'),_0x83a300[_0x9a42('0x17')],_0x1fcb59);_0x47a2f6(_0x915a03[_0x9a42('0x15')](0x1f4,_0x83a300[_0x9a42('0x17')]));});});};exports[_0x9a42('0x25')]=function(_0x455328,_0x2e9179,_0x470ae1){var _0x5ad9f6=this;return new Promise(function(_0x1f3820,_0x418595){var _0x32ec3f={'body':_0x455328[_0x9a42('0x26')],'channel':'fax'};var _0x35b96f=[];var _0x3eb48a=[];var _0x2778cb={};return db[_0x9a42('0x27')]['describe']()[_0x9a42('0x28')](function(_0xc5dc34){if(!_0xc5dc34){throw new db[(_0x9a42('0x29'))][(_0x9a42('0x2a'))]('no\x20available\x20attributes');}_0x35b96f=_[_0x9a42('0x2b')](_[_0x9a42('0x2c')](_0xc5dc34),[_0x9a42('0x2d'),_0x9a42('0x2e')]);_0x3eb48a=_['difference'](_[_0x9a42('0x2c')](_0xc5dc34),[_0x9a42('0x2d'),'updatedAt',_0x9a42('0x2f'),'ListId']);if(_0x455328[_0x9a42('0x26')]['id']){delete _0x455328[_0x9a42('0x26')]['id'];}if(_[_0x9a42('0x30')](_0x455328[_0x9a42('0x26')]['from'])){throw new db[(_0x9a42('0x29'))]['ValidationError'](_0x9a42('0x31'));}if(_[_0x9a42('0x30')](_0x455328['body']['body'])||_0x455328[_0x9a42('0x26')][_0x9a42('0x26')]===''){throw new db[(_0x9a42('0x29'))][(_0x9a42('0x2a'))](_0x9a42('0x32'));}if(_['isNil'](_0x455328[_0x9a42('0x26')][_0x9a42('0x33')])){throw new db[(_0x9a42('0x29'))][(_0x9a42('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3eb48a);}if(!_[_0x9a42('0x34')](_0x3eb48a,_0x455328['body'][_0x9a42('0x33')])){throw new db[(_0x9a42('0x29'))][(_0x9a42('0x2a'))](_0x9a42('0x35')+_0x3eb48a);}_0x2778cb[_0x455328[_0x9a42('0x26')][_0x9a42('0x33')]]=_0x455328[_0x9a42('0x26')][_0x9a42('0x36')];})[_0x9a42('0x28')](function(){return db['FaxAccount'][_0x9a42('0x37')]({'where':{'id':_0x455328[_0x9a42('0x38')]['id']},'include':[{'model':db[_0x9a42('0x39')],'as':_0x9a42('0x3a'),'include':[{'model':db[_0x9a42('0x27')],'as':_0x9a42('0x3b'),'where':_0x2778cb,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x9a42('0x3c')],'as':_0x9a42('0x3d')}]});})['then'](function(_0x3ca03d){if(_0x3ca03d&&_0x3ca03d[_0x9a42('0x3a')]){var _0xb54162=_0x3ca03d[_0x9a42('0x3e')]({'plain':!![]});_0x32ec3f['account']=_0xb54162;_0x32ec3f[_0x9a42('0x3f')]=_0xb54162[_0x9a42('0x3d')];_0x32ec3f[_0x9a42('0x40')]=_0xb54162['List'];_0x32ec3f[_0x9a42('0x3f')]=_['orderBy'](_0x32ec3f[_0x9a42('0x3f')],[_0x9a42('0x41')],[_0x9a42('0x42')]);if(_0x32ec3f['account'][_0x9a42('0x3d')]){delete _0x32ec3f['account'][_0x9a42('0x3d')];}if(_0x32ec3f[_0x9a42('0x38')][_0x9a42('0x3a')]&&_0x32ec3f[_0x9a42('0x38')][_0x9a42('0x3a')]['Contacts']['length']){return _0x32ec3f[_0x9a42('0x38')][_0x9a42('0x3a')]['Contacts'][0x0];}var _0x5dda9e=_[_0x9a42('0x43')](_0x455328[_0x9a42('0x26')],{'firstName':_0x455328['body'][_0x9a42('0x36')],'ListId':_0xb54162[_0x9a42('0x44')]});_0x5dda9e[_0x455328[_0x9a42('0x26')][_0x9a42('0x33')]]=_0x455328['body'][_0x9a42('0x36')];return db[_0x9a42('0x27')]['create'](_0x5dda9e,{'fields':_0x35b96f,'raw':!![]});}})[_0x9a42('0x28')](function(_0x4aecba){_0x32ec3f['contact']=_0x4aecba;if(_0x4aecba){var _0x9d5c6c={'ContactId':_0x4aecba['id'],'FaxAccountId':_0x455328[_0x9a42('0x38')]['id'],'fax':_0x4aecba['fax']};return db[_0x9a42('0x45')][_0x9a42('0x37')]({'where':{'ContactId':_0x4aecba['id'],'closed':![],'FaxAccountId':_0x455328[_0x9a42('0x38')]['id']}})[_0x9a42('0x28')](function(_0x318ad6){if(_0x318ad6){return[_0x318ad6,![]];}return db[_0x9a42('0x45')][_0x9a42('0x46')](_0x9d5c6c)[_0x9a42('0x28')](function(_0x21e6dc){return[_0x21e6dc,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x27b256,_0x45841a){var _0x1a8be1=_0x27b256[_0x9a42('0x3e')]({'plain':!![]});if(_0x45841a){if(_0x32ec3f[_0x9a42('0x38')][_0x9a42('0x47')]){_0x32ec3f[_0x9a42('0x3f')][_0x9a42('0x48')]({'id':0x0,'priority':_0x32ec3f[_0x9a42('0x3f')][_0x9a42('0x49')]+0x1,'app':_0x9a42('0x4a'),'appdata':'unmanaged','interval':_0x9a42('0x4b')});}_0x1a8be1['created']=!![];}else{_0x1a8be1[_0x9a42('0x4c')]=![];}_0x32ec3f[_0x9a42('0x4d')]=_0x1a8be1;return db[_0x9a42('0x4e')][_0x9a42('0x46')]({'body':_0x455328[_0x9a42('0x26')][_0x9a42('0x26')],'FaxAccountId':_0x455328['account']['id'],'FaxInteractionId':_0x27b256['id'],'direction':'in','ContactId':_0x27b256[_0x9a42('0x4f')],'AttachmentId':_0x455328['body']['AttachmentId']});})['then'](function(_0xf87a79){_0x32ec3f[_0x9a42('0x17')]=_0xf87a79;if(!_0x32ec3f[_0x9a42('0x4d')][_0x9a42('0x50')])return;return db[_0x9a42('0x51')][_0x9a42('0x37')]({'attributes':['id',_0x9a42('0x52')],'where':{'id':_0x32ec3f[_0x9a42('0x4d')][_0x9a42('0x50')]}});})['then'](function(_0x3b34c0){if(_0x3b34c0){_0x32ec3f[_0x9a42('0x3f')][_0x9a42('0x53')]({'id':0x0,'priority':0x0,'app':_0x9a42('0x54'),'appdata':_0x3b34c0[_0x9a42('0x52')]+','+(_0x32ec3f[_0x9a42('0x38')][_0x9a42('0x55')]||0xa),'interval':'*,*,*,*'});}if(!_0x32ec3f[_0x9a42('0x4d')]['queueId'])return;return db[_0x9a42('0x56')][_0x9a42('0x37')]({'attributes':['id',_0x9a42('0x52')],'where':{'id':_0x32ec3f[_0x9a42('0x4d')]['queueId']}});})[_0x9a42('0x28')](function(_0x4f99bc){if(_0x4f99bc){_0x32ec3f[_0x9a42('0x3f')]['unshift']({'id':0x0,'priority':0x1,'app':_0x9a42('0x57'),'appdata':_0x4f99bc['name']+','+(_0x32ec3f[_0x9a42('0x38')][_0x9a42('0x58')]||0x12c),'interval':_0x9a42('0x4b')});}return respondWithRpcPromise(_0x9a42('0x59'),_0x9a42('0x5a'),_0x32ec3f);})[_0x9a42('0x28')](function(_0x2ae7dc){_0x1f3820(_0x2ae7dc);})[_0x9a42('0x19')](function(_0x59ffec){_0x418595(_0x5ad9f6[_0x9a42('0x15')](0x1f4,_0x59ffec[_0x9a42('0x17')]));});});}; \ No newline at end of file +var _0xc954=['Contacts','DESC','Applications','get','applications','list','orderBy','priority','asc','length','defaults','contact','FaxInteraction','find','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxAccount.socket','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List'];(function(_0x31cd79,_0xbfb3fc){var _0x47f395=function(_0x596e98){while(--_0x596e98){_0x31cd79['push'](_0x31cd79['shift']());}};_0x47f395(++_0xbfb3fc);}(_0xc954,0x87));var _0x4c95=function(_0x22195,_0x27aeae){_0x22195=_0x22195-0x0;var _0x3dc2d9=_0xc954[_0x22195];return _0x3dc2d9;};'use strict';var _=require(_0x4c95('0x0'));var util=require(_0x4c95('0x1'));var moment=require(_0x4c95('0x2'));var BPromise=require(_0x4c95('0x3'));var rs=require(_0x4c95('0x4'));var fs=require('fs');var Redis=require(_0x4c95('0x5'));var db=require(_0x4c95('0x6'))['db'];var utils=require(_0x4c95('0x7'));var logger=require(_0x4c95('0x8'))(_0x4c95('0x9'));var config=require('../../config/environment');var jayson=require(_0x4c95('0xa'));var client=jayson['client'][_0x4c95('0xb')]({'port':0x232c});config['redis']=_['defaults'](config[_0x4c95('0xc')],{'host':_0x4c95('0xd'),'port':0x18eb});var socket=require(_0x4c95('0xe'))(new Redis(config['redis']));require(_0x4c95('0xf'))['register'](socket);function respondWithRpcPromise(_0x28d664,_0x5ce1f3,_0x27eb5d){return new BPromise(function(_0x3ffb25,_0xa39237){return client['request'](_0x28d664,_0x27eb5d)[_0x4c95('0x10')](function(_0x687372){logger['info'](_0x4c95('0x11'),_0x5ce1f3,_0x4c95('0x12'));logger[_0x4c95('0x13')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5ce1f3,_0x4c95('0x12'),JSON[_0x4c95('0x14')](_0x687372));if(_0x687372[_0x4c95('0x15')]){if(_0x687372[_0x4c95('0x15')][_0x4c95('0x16')]===0x1f4){logger[_0x4c95('0x15')](_0x4c95('0x11'),_0x5ce1f3,_0x687372['error'][_0x4c95('0x17')]);return _0xa39237(_0x687372[_0x4c95('0x15')][_0x4c95('0x17')]);}logger[_0x4c95('0x15')](_0x4c95('0x11'),_0x5ce1f3,_0x687372[_0x4c95('0x15')][_0x4c95('0x17')]);return _0x3ffb25(_0x687372[_0x4c95('0x15')][_0x4c95('0x17')]);}else{logger['info'](_0x4c95('0x11'),_0x5ce1f3,_0x4c95('0x12'));_0x3ffb25(_0x687372[_0x4c95('0x18')][_0x4c95('0x17')]);}})[_0x4c95('0x19')](function(_0x440381){logger[_0x4c95('0x15')](_0x4c95('0x11'),_0x5ce1f3,_0x440381);_0xa39237(_0x440381);});});}exports[_0x4c95('0x1a')]=function(_0x2d18a1){var _0x2f2083=this;return new Promise(function(_0x401e38,_0x5db8da){return db['FaxAccount'][_0x4c95('0x1b')]({'raw':_0x2d18a1[_0x4c95('0x1c')]?_0x2d18a1['options'][_0x4c95('0x1d')]===undefined?!![]:![]:!![],'where':_0x2d18a1['options']?_0x2d18a1['options'][_0x4c95('0x1e')]||null:null,'attributes':_0x2d18a1[_0x4c95('0x1c')]?_0x2d18a1[_0x4c95('0x1c')][_0x4c95('0x1f')]||null:null,'limit':_0x2d18a1['options']?_0x2d18a1[_0x4c95('0x1c')][_0x4c95('0x20')]||null:null,'include':_0x2d18a1[_0x4c95('0x1c')]?_0x2d18a1[_0x4c95('0x1c')][_0x4c95('0x21')]?_[_0x4c95('0x22')](_0x2d18a1[_0x4c95('0x1c')]['include'],function(_0x2b1683){return{'model':db[_0x2b1683['model']],'as':_0x2b1683['as'],'attributes':_0x2b1683['attributes'],'include':_0x2b1683['include']?_[_0x4c95('0x22')](_0x2b1683[_0x4c95('0x21')],function(_0x385e85){return{'model':db[_0x385e85[_0x4c95('0x23')]],'as':_0x385e85['as'],'attributes':_0x385e85['attributes'],'include':_0x385e85[_0x4c95('0x21')]?_['map'](_0x385e85[_0x4c95('0x21')],function(_0x3f3cb5){return{'model':db[_0x3f3cb5[_0x4c95('0x23')]],'as':_0x3f3cb5['as'],'attributes':_0x3f3cb5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c95('0x10')](function(_0x58cb1f){logger[_0x4c95('0x24')](_0x4c95('0x1a'),_0x2d18a1);logger[_0x4c95('0x13')](_0x4c95('0x1a'),_0x2d18a1,JSON[_0x4c95('0x14')](_0x58cb1f));_0x401e38(_0x58cb1f);})[_0x4c95('0x19')](function(_0x28bcd0){logger[_0x4c95('0x15')]('GetFaxAccount',_0x28bcd0['message'],_0x2d18a1);_0x5db8da(_0x2f2083['error'](0x1f4,_0x28bcd0[_0x4c95('0x17')]));});});};exports[_0x4c95('0x25')]=function(_0x758ed9,_0x19b10c,_0x106244){var _0x3fe5e4=this;return new Promise(function(_0x36e204,_0x13701c){var _0x42c371={'body':_0x758ed9[_0x4c95('0x26')],'channel':_0x4c95('0x27')};var _0x502e40=[];var _0x497248=[];var _0x319f5a={};return db[_0x4c95('0x28')][_0x4c95('0x29')]()[_0x4c95('0x10')](function(_0x4f897c){if(!_0x4f897c){throw new db[(_0x4c95('0x2a'))]['ValidationError'](_0x4c95('0x2b'));}_0x502e40=_[_0x4c95('0x2c')](_[_0x4c95('0x2d')](_0x4f897c),[_0x4c95('0x2e'),_0x4c95('0x2f')]);_0x497248=_['difference'](_[_0x4c95('0x2d')](_0x4f897c),['createdAt',_0x4c95('0x2f'),_0x4c95('0x30'),_0x4c95('0x31')]);if(_0x758ed9[_0x4c95('0x26')]['id']){delete _0x758ed9[_0x4c95('0x26')]['id'];}if(_[_0x4c95('0x32')](_0x758ed9[_0x4c95('0x26')]['from'])){throw new db[(_0x4c95('0x2a'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x4c95('0x32')](_0x758ed9[_0x4c95('0x26')][_0x4c95('0x26')])||_0x758ed9[_0x4c95('0x26')][_0x4c95('0x26')]===''){throw new db['Sequelize'][(_0x4c95('0x33'))](_0x4c95('0x34'));}if(_['isNil'](_0x758ed9['body'][_0x4c95('0x35')])){throw new db[(_0x4c95('0x2a'))][(_0x4c95('0x33'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x497248);}if(!_[_0x4c95('0x36')](_0x497248,_0x758ed9[_0x4c95('0x26')]['mapKey'])){throw new db[(_0x4c95('0x2a'))][(_0x4c95('0x33'))](_0x4c95('0x37')+_0x497248);}_0x319f5a[_0x758ed9[_0x4c95('0x26')][_0x4c95('0x35')]]=_0x758ed9['body'][_0x4c95('0x38')];})[_0x4c95('0x10')](function(){return db['FaxAccount']['find']({'where':{'id':_0x758ed9[_0x4c95('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x4c95('0x3a'),'include':[{'model':db[_0x4c95('0x28')],'as':_0x4c95('0x3b'),'where':_0x319f5a,'limit':0x1,'order':[[_0x4c95('0x2f'),_0x4c95('0x3c')]]}]},{'model':db['FaxApplication'],'as':_0x4c95('0x3d')}]});})[_0x4c95('0x10')](function(_0x6c10e7){if(_0x6c10e7&&_0x6c10e7['List']){var _0x3c374c=_0x6c10e7[_0x4c95('0x3e')]({'plain':!![]});_0x42c371[_0x4c95('0x39')]=_0x3c374c;_0x42c371[_0x4c95('0x3f')]=_0x3c374c[_0x4c95('0x3d')];_0x42c371[_0x4c95('0x40')]=_0x3c374c[_0x4c95('0x3a')];_0x42c371[_0x4c95('0x3f')]=_[_0x4c95('0x41')](_0x42c371['applications'],[_0x4c95('0x42')],[_0x4c95('0x43')]);if(_0x42c371[_0x4c95('0x39')][_0x4c95('0x3d')]){delete _0x42c371[_0x4c95('0x39')]['Applications'];}if(_0x42c371[_0x4c95('0x39')][_0x4c95('0x3a')]&&_0x42c371['account']['List'][_0x4c95('0x3b')][_0x4c95('0x44')]){return _0x42c371[_0x4c95('0x39')]['List'][_0x4c95('0x3b')][0x0];}var _0x509e07=_[_0x4c95('0x45')](_0x758ed9[_0x4c95('0x26')],{'firstName':_0x758ed9[_0x4c95('0x26')][_0x4c95('0x38')],'ListId':_0x3c374c[_0x4c95('0x31')]});_0x509e07[_0x758ed9[_0x4c95('0x26')][_0x4c95('0x35')]]=_0x758ed9[_0x4c95('0x26')][_0x4c95('0x38')];return db[_0x4c95('0x28')]['create'](_0x509e07,{'fields':_0x502e40,'raw':!![]});}})[_0x4c95('0x10')](function(_0x27d472){_0x42c371[_0x4c95('0x46')]=_0x27d472;if(_0x27d472){var _0x1e6dcc={'ContactId':_0x27d472['id'],'FaxAccountId':_0x758ed9['account']['id'],'fax':_0x27d472[_0x4c95('0x27')]};return db[_0x4c95('0x47')][_0x4c95('0x48')]({'where':{'ContactId':_0x27d472['id'],'closed':![],'FaxAccountId':_0x758ed9[_0x4c95('0x39')]['id']}})[_0x4c95('0x10')](function(_0x3deafa){if(_0x3deafa){return[_0x3deafa,![]];}return db[_0x4c95('0x47')][_0x4c95('0x49')](_0x1e6dcc)[_0x4c95('0x10')](function(_0x527000){return[_0x527000,!![]];});});}else{throw new Error(_0x4c95('0x4a'));}})[_0x4c95('0x4b')](function(_0x429f5a,_0x2ef9e5){var _0xa33f93=_0x429f5a['get']({'plain':!![]});if(_0x2ef9e5){if(_0x42c371[_0x4c95('0x39')][_0x4c95('0x4c')]){_0x42c371[_0x4c95('0x3f')][_0x4c95('0x4d')]({'id':0x0,'priority':_0x42c371['applications'][_0x4c95('0x44')]+0x1,'app':_0x4c95('0x4e'),'appdata':_0x4c95('0x4f'),'interval':_0x4c95('0x50')});}_0xa33f93[_0x4c95('0x51')]=!![];}else{_0xa33f93[_0x4c95('0x51')]=![];}_0x42c371[_0x4c95('0x52')]=_0xa33f93;return db[_0x4c95('0x53')]['create']({'body':_0x758ed9[_0x4c95('0x26')][_0x4c95('0x26')],'FaxAccountId':_0x758ed9[_0x4c95('0x39')]['id'],'FaxInteractionId':_0x429f5a['id'],'direction':'in','ContactId':_0x429f5a['ContactId'],'AttachmentId':_0x758ed9[_0x4c95('0x26')][_0x4c95('0x54')]});})[_0x4c95('0x10')](function(_0x440c72){_0x42c371[_0x4c95('0x17')]=_0x440c72;if(!_0x42c371[_0x4c95('0x52')][_0x4c95('0x55')])return;return db[_0x4c95('0x56')][_0x4c95('0x48')]({'attributes':['id',_0x4c95('0x57')],'where':{'id':_0x42c371[_0x4c95('0x52')][_0x4c95('0x55')]}});})['then'](function(_0x30d4f8){if(_0x30d4f8){_0x42c371[_0x4c95('0x3f')][_0x4c95('0x58')]({'id':0x0,'priority':0x0,'app':_0x4c95('0x59'),'appdata':_0x30d4f8[_0x4c95('0x57')]+','+(_0x42c371[_0x4c95('0x39')][_0x4c95('0x5a')]||0xa),'interval':_0x4c95('0x50')});}if(!_0x42c371[_0x4c95('0x52')][_0x4c95('0x5b')])return;return db[_0x4c95('0x5c')][_0x4c95('0x48')]({'attributes':['id','name'],'where':{'id':_0x42c371[_0x4c95('0x52')][_0x4c95('0x5b')]}});})[_0x4c95('0x10')](function(_0x1b9d3b){if(_0x1b9d3b){_0x42c371[_0x4c95('0x3f')][_0x4c95('0x58')]({'id':0x0,'priority':0x1,'app':_0x4c95('0x5d'),'appdata':_0x1b9d3b[_0x4c95('0x57')]+','+(_0x42c371['account'][_0x4c95('0x5e')]||0x12c),'interval':_0x4c95('0x50')});}return respondWithRpcPromise(_0x4c95('0x5f'),_0x4c95('0x60'),_0x42c371);})['then'](function(_0x252828){_0x36e204(_0x252828);})[_0x4c95('0x19')](function(_0x3ac646){_0x13701c(_0x3fe5e4['error'](0x1f4,_0x3ac646[_0x4c95('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f2c50a9..9924016 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 _0x4fe2=['faxAccount:','./faxAccount.events','save','update','emit','register','length'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0x4fe2,0x1dd));var _0x24fe=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4fe2[_0x17d9e3];return _0x14192d;};'use strict';var FaxAccountEvents=require(_0x24fe('0x0'));var events=[_0x24fe('0x1'),'remove',_0x24fe('0x2')];function createListener(_0x1af153,_0x47ded6){return function(_0x5a8907){_0x47ded6[_0x24fe('0x3')](_0x1af153,_0x5a8907);};}function removeListener(_0x30270d,_0x2a05fd){return function(){FaxAccountEvents['removeListener'](_0x30270d,_0x2a05fd);};}exports[_0x24fe('0x4')]=function(_0xf8d6b9){for(var _0x1904de=0x0,_0xc163c5=events[_0x24fe('0x5')];_0x1904de<_0xc163c5;_0x1904de++){var _0x22b0fb=events[_0x1904de];var _0x2b9dd4=createListener(_0x24fe('0x6')+_0x22b0fb,_0xf8d6b9);FaxAccountEvents['on'](_0x22b0fb,_0x2b9dd4);}}; \ No newline at end of file +var _0x9f6c=['./faxAccount.events','save','remove','update','removeListener','register','length','faxAccount:'];(function(_0x11aed3,_0x1b6698){var _0x5a3570=function(_0x3d5eba){while(--_0x3d5eba){_0x11aed3['push'](_0x11aed3['shift']());}};_0x5a3570(++_0x1b6698);}(_0x9f6c,0x128));var _0xc9f6=function(_0x43e840,_0x197fd3){_0x43e840=_0x43e840-0x0;var _0x550115=_0x9f6c[_0x43e840];return _0x550115;};'use strict';var FaxAccountEvents=require(_0xc9f6('0x0'));var events=[_0xc9f6('0x1'),_0xc9f6('0x2'),_0xc9f6('0x3')];function createListener(_0xdc40f9,_0x1ab4bf){return function(_0x5227b9){_0x1ab4bf['emit'](_0xdc40f9,_0x5227b9);};}function removeListener(_0x1553d3,_0x1785e9){return function(){FaxAccountEvents[_0xc9f6('0x4')](_0x1553d3,_0x1785e9);};}exports[_0xc9f6('0x5')]=function(_0x2364e6){for(var _0x551e4b=0x0,_0x49eb85=events[_0xc9f6('0x6')];_0x551e4b<_0x49eb85;_0x551e4b++){var _0x16a63a=events[_0x551e4b];var _0x5d2849=createListener(_0xc9f6('0x7')+_0x16a63a,_0x2364e6);FaxAccountEvents['on'](_0x16a63a,_0x5d2849);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index a102a6f..0899a97 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 _0x6993=['show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/:id/send','addAgents','put','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x13a2d3,_0x34c89a){var _0x3c394e=function(_0xcd204a){while(--_0xcd204a){_0x13a2d3['push'](_0x13a2d3['shift']());}};_0x3c394e(++_0x34c89a);}(_0x6993,0x94));var _0x3699=function(_0x487524,_0x292ba6){_0x487524=_0x487524-0x0;var _0x3f3543=_0x6993[_0x487524];return _0x3f3543;};'use strict';var multer=require(_0x3699('0x0'));var util=require(_0x3699('0x1'));var path=require(_0x3699('0x2'));var timeout=require(_0x3699('0x3'));var express=require(_0x3699('0x4'));var router=express[_0x3699('0x5')]();var fs_extra=require(_0x3699('0x6'));var auth=require(_0x3699('0x7'));var interaction=require(_0x3699('0x8'));var config=require(_0x3699('0x9'));var controller=require(_0x3699('0xa'));router[_0x3699('0xb')]('/',auth['isAuthenticated'](),controller[_0x3699('0xc')]);router[_0x3699('0xb')]('/describe',auth[_0x3699('0xd')](),controller[_0x3699('0xe')]);router[_0x3699('0xb')](_0x3699('0xf'),auth['isAuthenticated'](),controller[_0x3699('0x10')]);router['get'](_0x3699('0x11'),auth[_0x3699('0xd')](),controller[_0x3699('0x12')]);router[_0x3699('0xb')]('/:id/canned_answers',auth[_0x3699('0xd')](),controller[_0x3699('0x13')]);router[_0x3699('0xb')](_0x3699('0x14'),auth[_0x3699('0xd')](),controller['getInteractions']);router['get'](_0x3699('0x15'),auth[_0x3699('0xd')](),controller['getApplications']);router[_0x3699('0xb')](_0x3699('0x16'),auth[_0x3699('0xd')](),controller[_0x3699('0x17')]);router['get'](_0x3699('0x18'),auth[_0x3699('0xd')](),controller['getAgents']);router[_0x3699('0x19')]('/',auth[_0x3699('0xd')](),controller[_0x3699('0x1a')]);router[_0x3699('0x19')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3699('0x1b')]);router['post'](_0x3699('0x1c'),auth[_0x3699('0xd')](),controller[_0x3699('0x1d')]);router[_0x3699('0x19')](_0x3699('0x14'),auth[_0x3699('0xd')](),controller[_0x3699('0x1e')]);router[_0x3699('0x19')]('/:id/applications',auth[_0x3699('0xd')](),controller[_0x3699('0x1f')]);router['post'](_0x3699('0x20'),auth[_0x3699('0xd')](),controller[_0x3699('0x21')]);router[_0x3699('0x19')]('/updateaccountapplications',auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x3699('0x19')](_0x3699('0x22'),auth[_0x3699('0xd')](),controller['send']);router['post']('/:id/users',auth[_0x3699('0xd')](),controller[_0x3699('0x23')]);router[_0x3699('0x24')](_0x3699('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x3699('0x25')](_0x3699('0xf'),auth['isAuthenticated'](),controller[_0x3699('0x26')]);router[_0x3699('0x25')](_0x3699('0x11'),auth[_0x3699('0xd')](),controller[_0x3699('0x27')]);router[_0x3699('0x25')](_0x3699('0x1c'),auth[_0x3699('0xd')](),controller['removeAnswers']);router[_0x3699('0x25')](_0x3699('0x18'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x3699('0x28')]=router; \ No newline at end of file +var _0x803c=['addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','/:id/applications','getApplications','getMessages','/:id/users','getAgents','post','create','addAnswer','addInteraction','addApplications','/addaccountapplications'];(function(_0x263664,_0x4779c9){var _0x44e79a=function(_0x456ff5){while(--_0x456ff5){_0x263664['push'](_0x263664['shift']());}};_0x44e79a(++_0x4779c9);}(_0x803c,0x189));var _0xc803=function(_0x4b3308,_0x593e7b){_0x4b3308=_0x4b3308-0x0;var _0x1d07be=_0x803c[_0x4b3308];return _0x1d07be;};'use strict';var multer=require('multer');var util=require(_0xc803('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc803('0x1'));var auth=require(_0xc803('0x2'));var interaction=require(_0xc803('0x3'));var config=require(_0xc803('0x4'));var controller=require('./faxAccount.controller');router[_0xc803('0x5')]('/',auth[_0xc803('0x6')](),controller[_0xc803('0x7')]);router['get'](_0xc803('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xc803('0x5')](_0xc803('0x9'),auth[_0xc803('0x6')](),controller['show']);router[_0xc803('0x5')](_0xc803('0xa'),auth[_0xc803('0x6')](),controller[_0xc803('0xb')]);router[_0xc803('0x5')]('/:id/canned_answers',auth[_0xc803('0x6')](),controller[_0xc803('0xc')]);router[_0xc803('0x5')](_0xc803('0xd'),auth[_0xc803('0x6')](),controller['getInteractions']);router['get'](_0xc803('0xe'),auth[_0xc803('0x6')](),controller[_0xc803('0xf')]);router['get']('/:id/messages',auth[_0xc803('0x6')](),controller[_0xc803('0x10')]);router[_0xc803('0x5')](_0xc803('0x11'),auth['isAuthenticated'](),controller[_0xc803('0x12')]);router[_0xc803('0x13')]('/',auth[_0xc803('0x6')](),controller[_0xc803('0x14')]);router[_0xc803('0x13')](_0xc803('0xa'),auth[_0xc803('0x6')](),controller['addDisposition']);router[_0xc803('0x13')]('/:id/canned_answers',auth[_0xc803('0x6')](),controller[_0xc803('0x15')]);router[_0xc803('0x13')](_0xc803('0xd'),auth['isAuthenticated'](),controller[_0xc803('0x16')]);router[_0xc803('0x13')](_0xc803('0xe'),auth[_0xc803('0x6')](),controller[_0xc803('0x17')]);router[_0xc803('0x13')](_0xc803('0x18'),auth[_0xc803('0x6')](),controller[_0xc803('0x19')]);router[_0xc803('0x13')](_0xc803('0x1a'),auth['isAuthenticated'](),controller[_0xc803('0x1b')]);router[_0xc803('0x13')](_0xc803('0x1c'),auth[_0xc803('0x6')](),controller[_0xc803('0x1d')]);router['post'](_0xc803('0x11'),auth['isAuthenticated'](),controller[_0xc803('0x1e')]);router[_0xc803('0x1f')]('/:id',auth[_0xc803('0x6')](),controller[_0xc803('0x20')]);router[_0xc803('0x21')]('/:id',auth[_0xc803('0x6')](),controller[_0xc803('0x22')]);router[_0xc803('0x21')]('/:id/dispositions',auth[_0xc803('0x6')](),controller[_0xc803('0x23')]);router[_0xc803('0x21')](_0xc803('0x24'),auth[_0xc803('0x6')](),controller['removeAnswers']);router[_0xc803('0x21')]('/:id/users',auth[_0xc803('0x6')](),controller['removeAgents']);module[_0xc803('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 75f0037..6da435e 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 _0x2fc9=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x210056,_0x23235b){var _0x45eb54=function(_0x2f031a){while(--_0x2f031a){_0x210056['push'](_0x210056['shift']());}};_0x45eb54(++_0x23235b);}(_0x2fc9,0xc2));var _0x92fc=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0x2fc9[_0x3de7e0];return _0x11d0b3;};'use strict';var Sequelize=require('sequelize');module[_0x92fc('0x0')]={'priority':{'type':Sequelize[_0x92fc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x92fc('0x2')],'allowNull':![],'defaultValue':_0x92fc('0x3')},'appdata':{'type':Sequelize[_0x92fc('0x4')]()},'description':{'type':Sequelize[_0x92fc('0x2')]},'interval':{'type':Sequelize[_0x92fc('0x2')],'defaultValue':_0x92fc('0x5')}}; \ No newline at end of file +var _0xb31a=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x38bc11,_0x24839b){var _0x11f0df=function(_0x4ffa66){while(--_0x4ffa66){_0x38bc11['push'](_0x38bc11['shift']());}};_0x11f0df(++_0x24839b);}(_0xb31a,0xb8));var _0xab31=function(_0x44d96d,_0x3a80c3){_0x44d96d=_0x44d96d-0x0;var _0x3709eb=_0xb31a[_0x44d96d];return _0x3709eb;};'use strict';var Sequelize=require(_0xab31('0x0'));module[_0xab31('0x1')]={'priority':{'type':Sequelize[_0xab31('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xab31('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xab31('0x4')]()},'description':{'type':Sequelize[_0xab31('0x3')]},'interval':{'type':Sequelize[_0xab31('0x3')],'defaultValue':_0xab31('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b9ed352..bd36927 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 _0x3d53=['sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','save','update','then','destroy','end','sendStatus','error','name','send','index','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x9f27a3,_0x3716d9){var _0x1e712e=function(_0x5cb75a){while(--_0x5cb75a){_0x9f27a3['push'](_0x9f27a3['shift']());}};_0x1e712e(++_0x3716d9);}(_0x3d53,0x9b));var _0x33d5=function(_0x2bcddb,_0x3eaf37){_0x2bcddb=_0x2bcddb-0x0;var _0x12a9e8=_0x3d53[_0x2bcddb];return _0x12a9e8;};'use strict';var emlformat=require(_0x33d5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x33d5('0x1'));var moment=require(_0x33d5('0x2'));var BPromise=require(_0x33d5('0x3'));var Mustache=require(_0x33d5('0x4'));var util=require(_0x33d5('0x5'));var path=require(_0x33d5('0x6'));var sox=require(_0x33d5('0x7'));var csv=require(_0x33d5('0x8'));var ejs=require(_0x33d5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33d5('0xa'));var squel=require(_0x33d5('0xb'));var crypto=require(_0x33d5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x33d5('0x8'));var querystring=require(_0x33d5('0xd'));var Papa=require(_0x33d5('0xe'));var Redis=require(_0x33d5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x33d5('0x10'));var as=require(_0x33d5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33d5('0x12'))('api');var utils=require(_0x33d5('0x13'));var config=require(_0x33d5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x33d5('0x15'))['db'];function respondWithStatusCode(_0x1c281b,_0x5350fa){_0x5350fa=_0x5350fa||0xcc;return function(_0x15cd78){if(_0x15cd78){return _0x1c281b['sendStatus'](_0x5350fa);}return _0x1c281b[_0x33d5('0x16')](_0x5350fa)['end']();};}function respondWithResult(_0x5bbfe0,_0x3799b6){_0x3799b6=_0x3799b6||0xc8;return function(_0x31dac1){if(_0x31dac1){return _0x5bbfe0['status'](_0x3799b6)[_0x33d5('0x17')](_0x31dac1);}};}function respondWithFilteredResult(_0x6f5363,_0x4d8dde){return function(_0x4995e2){if(_0x4995e2){var _0x2c1a28=typeof _0x4d8dde[_0x33d5('0x18')]===_0x33d5('0x19')&&typeof _0x4d8dde[_0x33d5('0x1a')]===_0x33d5('0x19');var _0x3c52e3=_0x4995e2[_0x33d5('0x1b')];var _0x115d7e=_0x2c1a28?0x0:_0x4d8dde['offset'];var _0x227080=_0x2c1a28?_0x4995e2[_0x33d5('0x1b')]:_0x4d8dde[_0x33d5('0x18')]+_0x4d8dde['limit'];var _0x4a6326;if(_0x227080>=_0x3c52e3){_0x227080=_0x3c52e3;_0x4a6326=0xc8;}else{_0x4a6326=0xce;}_0x6f5363[_0x33d5('0x16')](_0x4a6326);return _0x6f5363[_0x33d5('0x1c')]('Content-Range',_0x115d7e+'-'+_0x227080+'/'+_0x3c52e3)[_0x33d5('0x17')](_0x4995e2);}return null;};}function patchUpdates(_0x2c3199){return function(_0x521f86){try{jsonpatch['apply'](_0x521f86,_0x2c3199,!![]);}catch(_0x291cd9){return BPromise['reject'](_0x291cd9);}return _0x521f86[_0x33d5('0x1d')]();};}function saveUpdates(_0xc69c18,_0x187c6c){return function(_0x3711e7){if(_0x3711e7){return _0x3711e7[_0x33d5('0x1e')](_0xc69c18)[_0x33d5('0x1f')](function(_0x3344f0){return _0x3344f0;});}return null;};}function removeEntity(_0x5c30a6,_0x70f86a){return function(_0x434983){if(_0x434983){return _0x434983[_0x33d5('0x20')]()[_0x33d5('0x1f')](function(){_0x5c30a6[_0x33d5('0x16')](0xcc)[_0x33d5('0x21')]();});}};}function handleEntityNotFound(_0x5d9f5f,_0xf63028){return function(_0x25845b){if(!_0x25845b){_0x5d9f5f[_0x33d5('0x22')](0x194);}return _0x25845b;};}function handleError(_0x5be107,_0x43e80b){_0x43e80b=_0x43e80b||0x1f4;return function(_0x552d9e){logger[_0x33d5('0x23')](_0x552d9e['stack']);if(_0x552d9e[_0x33d5('0x24')]){delete _0x552d9e[_0x33d5('0x24')];}_0x5be107['status'](_0x43e80b)[_0x33d5('0x25')](_0x552d9e);};}exports[_0x33d5('0x26')]=function(_0x4b816d,_0x3f236d){var _0x2f392a={},_0x34e2cf={},_0x5f5988={'count':0x0,'rows':[]};var _0x5ce3d5=_[_0x33d5('0x27')](db[_0x33d5('0x28')]['rawAttributes'],function(_0x2e8d2f){return{'name':_0x2e8d2f[_0x33d5('0x29')],'type':_0x2e8d2f[_0x33d5('0x2a')][_0x33d5('0x2b')]};});_0x34e2cf[_0x33d5('0x2c')]=_[_0x33d5('0x27')](_0x5ce3d5,_0x33d5('0x24'));_0x34e2cf[_0x33d5('0x2d')]=_[_0x33d5('0x2e')](_0x4b816d[_0x33d5('0x2d')]);_0x34e2cf[_0x33d5('0x2f')]=_[_0x33d5('0x30')](_0x34e2cf[_0x33d5('0x2c')],_0x34e2cf[_0x33d5('0x2d')]);_0x2f392a[_0x33d5('0x31')]=_[_0x33d5('0x30')](_0x34e2cf[_0x33d5('0x2c')],qs[_0x33d5('0x32')](_0x4b816d[_0x33d5('0x2d')][_0x33d5('0x32')]));_0x2f392a['attributes']=_0x2f392a['attributes']['length']?_0x2f392a['attributes']:_0x34e2cf[_0x33d5('0x2c')];if(!_0x4b816d[_0x33d5('0x2d')][_0x33d5('0x33')]('nolimit')){_0x2f392a[_0x33d5('0x1a')]=qs[_0x33d5('0x1a')](_0x4b816d['query'][_0x33d5('0x1a')]);_0x2f392a[_0x33d5('0x18')]=qs[_0x33d5('0x18')](_0x4b816d['query'][_0x33d5('0x18')]);}_0x2f392a['order']=qs['sort'](_0x4b816d[_0x33d5('0x2d')][_0x33d5('0x34')]);_0x2f392a['where']=qs['filters'](_[_0x33d5('0x35')](_0x4b816d['query'],_0x34e2cf[_0x33d5('0x2f')]),_0x5ce3d5);if(_0x4b816d[_0x33d5('0x2d')]['filter']){_0x2f392a[_0x33d5('0x36')]=_[_0x33d5('0x37')](_0x2f392a['where'],{'$or':_['map'](_0x5ce3d5,function(_0x227b53){if(_0x227b53[_0x33d5('0x2a')]!==_0x33d5('0x38')){var _0x46e51f={};_0x46e51f[_0x227b53[_0x33d5('0x24')]]={'$like':'%'+_0x4b816d[_0x33d5('0x2d')][_0x33d5('0x39')]+'%'};return _0x46e51f;}})});}_0x2f392a=_[_0x33d5('0x37')]({},_0x2f392a,_0x4b816d[_0x33d5('0x3a')]);var _0x174f0d={'where':_0x2f392a[_0x33d5('0x36')]};return db['FaxApplication'][_0x33d5('0x1b')](_0x174f0d)[_0x33d5('0x1f')](function(_0x40fb67){_0x5f5988[_0x33d5('0x1b')]=_0x40fb67;if(_0x4b816d['query'][_0x33d5('0x3b')]){_0x2f392a['include']=[{'all':!![]}];}return db[_0x33d5('0x28')][_0x33d5('0x3c')](_0x2f392a);})['then'](function(_0x7f9e1f){_0x5f5988[_0x33d5('0x3d')]=_0x7f9e1f;return _0x5f5988;})[_0x33d5('0x1f')](respondWithFilteredResult(_0x3f236d,_0x2f392a))[_0x33d5('0x3e')](handleError(_0x3f236d,null));};exports[_0x33d5('0x3f')]=function(_0x303f6b,_0x159508){var _0x24fdea={'raw':!![],'where':{'id':_0x303f6b[_0x33d5('0x40')]['id']}},_0x529721={};_0x529721[_0x33d5('0x2c')]=_[_0x33d5('0x2e')](db['FaxApplication'][_0x33d5('0x41')]);_0x529721[_0x33d5('0x2d')]=_['keys'](_0x303f6b[_0x33d5('0x2d')]);_0x529721[_0x33d5('0x2f')]=_[_0x33d5('0x30')](_0x529721['model'],_0x529721['query']);_0x24fdea[_0x33d5('0x31')]=_[_0x33d5('0x30')](_0x529721[_0x33d5('0x2c')],qs[_0x33d5('0x32')](_0x303f6b[_0x33d5('0x2d')][_0x33d5('0x32')]));_0x24fdea[_0x33d5('0x31')]=_0x24fdea['attributes']['length']?_0x24fdea['attributes']:_0x529721[_0x33d5('0x2c')];if(_0x303f6b['query'][_0x33d5('0x3b')]){_0x24fdea['include']=[{'all':!![]}];}_0x24fdea=_['merge']({},_0x24fdea,_0x303f6b[_0x33d5('0x3a')]);return db['FaxApplication'][_0x33d5('0x42')](_0x24fdea)[_0x33d5('0x1f')](handleEntityNotFound(_0x159508,null))[_0x33d5('0x1f')](respondWithResult(_0x159508,null))[_0x33d5('0x3e')](handleError(_0x159508,null));};exports['create']=function(_0x5dc726,_0x206f7b){return db['FaxApplication'][_0x33d5('0x43')](_0x5dc726[_0x33d5('0x44')],{})[_0x33d5('0x1f')](respondWithResult(_0x206f7b,0xc9))[_0x33d5('0x3e')](handleError(_0x206f7b,null));};exports[_0x33d5('0x1e')]=function(_0xbdbf6b,_0x54a72d){if(_0xbdbf6b[_0x33d5('0x44')]['id']){delete _0xbdbf6b[_0x33d5('0x44')]['id'];}return db['FaxApplication'][_0x33d5('0x42')]({'where':{'id':_0xbdbf6b['params']['id']}})['then'](handleEntityNotFound(_0x54a72d,null))['then'](saveUpdates(_0xbdbf6b[_0x33d5('0x44')],null))[_0x33d5('0x1f')](respondWithResult(_0x54a72d,null))['catch'](handleError(_0x54a72d,null));};exports[_0x33d5('0x20')]=function(_0x3d08df,_0x1b113b){return db[_0x33d5('0x28')][_0x33d5('0x42')]({'where':{'id':_0x3d08df[_0x33d5('0x40')]['id']}})[_0x33d5('0x1f')](handleEntityNotFound(_0x1b113b,null))[_0x33d5('0x1f')](removeEntity(_0x1b113b,null))[_0x33d5('0x3e')](handleError(_0x1b113b,null));}; \ No newline at end of file +var _0x0366=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','FaxApplication','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x30a815,_0x22cdc7){var _0x2f3432=function(_0x2957de){while(--_0x2957de){_0x30a815['push'](_0x30a815['shift']());}};_0x2f3432(++_0x22cdc7);}(_0x0366,0xcf));var _0x6036=function(_0x48ceb3,_0x4ac50e){_0x48ceb3=_0x48ceb3-0x0;var _0x31e325=_0x0366[_0x48ceb3];return _0x31e325;};'use strict';var emlformat=require(_0x6036('0x0'));var rimraf=require(_0x6036('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6036('0x2'));var rp=require(_0x6036('0x3'));var moment=require(_0x6036('0x4'));var BPromise=require(_0x6036('0x5'));var Mustache=require(_0x6036('0x6'));var util=require(_0x6036('0x7'));var path=require(_0x6036('0x8'));var sox=require(_0x6036('0x9'));var csv=require('to-csv');var ejs=require(_0x6036('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6036('0xb'));var squel=require(_0x6036('0xc'));var crypto=require(_0x6036('0xd'));var jsforce=require(_0x6036('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6036('0xf'));var querystring=require(_0x6036('0x10'));var Papa=require(_0x6036('0x11'));var Redis=require(_0x6036('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6036('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6036('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x6036('0x15'));var config=require(_0x6036('0x16'));var licenseUtil=require(_0x6036('0x17'));var db=require(_0x6036('0x18'))['db'];function respondWithStatusCode(_0x46b635,_0x188c9a){_0x188c9a=_0x188c9a||0xcc;return function(_0x7fffd8){if(_0x7fffd8){return _0x46b635['sendStatus'](_0x188c9a);}return _0x46b635['status'](_0x188c9a)[_0x6036('0x19')]();};}function respondWithResult(_0x147314,_0x345e77){_0x345e77=_0x345e77||0xc8;return function(_0x57690d){if(_0x57690d){return _0x147314[_0x6036('0x1a')](_0x345e77)[_0x6036('0x1b')](_0x57690d);}};}function respondWithFilteredResult(_0x57648b,_0x3def3f){return function(_0x1f60ed){if(_0x1f60ed){var _0x9e02ef=typeof _0x3def3f[_0x6036('0x1c')]===_0x6036('0x1d')&&typeof _0x3def3f[_0x6036('0x1e')]===_0x6036('0x1d');var _0x5d92d9=_0x1f60ed[_0x6036('0x1f')];var _0x436a5c=_0x9e02ef?0x0:_0x3def3f[_0x6036('0x1c')];var _0x519d95=_0x9e02ef?_0x1f60ed['count']:_0x3def3f[_0x6036('0x1c')]+_0x3def3f['limit'];var _0x16ca49;if(_0x519d95>=_0x5d92d9){_0x519d95=_0x5d92d9;_0x16ca49=0xc8;}else{_0x16ca49=0xce;}_0x57648b[_0x6036('0x1a')](_0x16ca49);return _0x57648b['set'](_0x6036('0x20'),_0x436a5c+'-'+_0x519d95+'/'+_0x5d92d9)['json'](_0x1f60ed);}return null;};}function patchUpdates(_0x3851ae){return function(_0x9837d4){try{jsonpatch[_0x6036('0x21')](_0x9837d4,_0x3851ae,!![]);}catch(_0x56a59a){return BPromise[_0x6036('0x22')](_0x56a59a);}return _0x9837d4[_0x6036('0x23')]();};}function saveUpdates(_0x25aa13,_0x448b31){return function(_0x43f0fd){if(_0x43f0fd){return _0x43f0fd[_0x6036('0x24')](_0x25aa13)[_0x6036('0x25')](function(_0x5f3218){return _0x5f3218;});}return null;};}function removeEntity(_0x5569cb,_0x4cc189){return function(_0x44c09d){if(_0x44c09d){return _0x44c09d[_0x6036('0x26')]()[_0x6036('0x25')](function(){_0x5569cb['status'](0xcc)[_0x6036('0x19')]();});}};}function handleEntityNotFound(_0x1605d8,_0x4ff2bb){return function(_0x1ba570){if(!_0x1ba570){_0x1605d8[_0x6036('0x27')](0x194);}return _0x1ba570;};}function handleError(_0x2b2356,_0x44744c){_0x44744c=_0x44744c||0x1f4;return function(_0x201fad){logger[_0x6036('0x28')](_0x201fad[_0x6036('0x29')]);if(_0x201fad[_0x6036('0x2a')]){delete _0x201fad[_0x6036('0x2a')];}_0x2b2356[_0x6036('0x1a')](_0x44744c)[_0x6036('0x2b')](_0x201fad);};}exports[_0x6036('0x2c')]=function(_0x5d250f,_0xae8648){var _0x4465a1={},_0x4a1ac5={},_0x28a34c={'count':0x0,'rows':[]};var _0x401228=_[_0x6036('0x2d')](db['FaxApplication'][_0x6036('0x2e')],function(_0x5639af){return{'name':_0x5639af[_0x6036('0x2f')],'type':_0x5639af[_0x6036('0x30')][_0x6036('0x31')]};});_0x4a1ac5['model']=_[_0x6036('0x2d')](_0x401228,_0x6036('0x2a'));_0x4a1ac5[_0x6036('0x32')]=_[_0x6036('0x33')](_0x5d250f['query']);_0x4a1ac5['filters']=_['intersection'](_0x4a1ac5[_0x6036('0x34')],_0x4a1ac5[_0x6036('0x32')]);_0x4465a1[_0x6036('0x35')]=_[_0x6036('0x36')](_0x4a1ac5[_0x6036('0x34')],qs[_0x6036('0x37')](_0x5d250f[_0x6036('0x32')][_0x6036('0x37')]));_0x4465a1[_0x6036('0x35')]=_0x4465a1['attributes'][_0x6036('0x38')]?_0x4465a1['attributes']:_0x4a1ac5[_0x6036('0x34')];if(!_0x5d250f['query'][_0x6036('0x39')]('nolimit')){_0x4465a1[_0x6036('0x1e')]=qs['limit'](_0x5d250f[_0x6036('0x32')][_0x6036('0x1e')]);_0x4465a1[_0x6036('0x1c')]=qs['offset'](_0x5d250f[_0x6036('0x32')]['offset']);}_0x4465a1[_0x6036('0x3a')]=qs['sort'](_0x5d250f[_0x6036('0x32')][_0x6036('0x3b')]);_0x4465a1[_0x6036('0x3c')]=qs['filters'](_['pick'](_0x5d250f[_0x6036('0x32')],_0x4a1ac5[_0x6036('0x3d')]),_0x401228);if(_0x5d250f[_0x6036('0x32')][_0x6036('0x3e')]){_0x4465a1['where']=_[_0x6036('0x3f')](_0x4465a1[_0x6036('0x3c')],{'$or':_['map'](_0x401228,function(_0x34dd0f){if(_0x34dd0f['type']!=='VIRTUAL'){var _0x7c9c6d={};_0x7c9c6d[_0x34dd0f['name']]={'$like':'%'+_0x5d250f['query']['filter']+'%'};return _0x7c9c6d;}})});}_0x4465a1=_[_0x6036('0x3f')]({},_0x4465a1,_0x5d250f[_0x6036('0x40')]);var _0x294c3f={'where':_0x4465a1[_0x6036('0x3c')]};return db[_0x6036('0x41')][_0x6036('0x1f')](_0x294c3f)['then'](function(_0x2dfcad){_0x28a34c['count']=_0x2dfcad;if(_0x5d250f['query'][_0x6036('0x42')]){_0x4465a1[_0x6036('0x43')]=[{'all':!![]}];}return db[_0x6036('0x41')][_0x6036('0x44')](_0x4465a1);})[_0x6036('0x25')](function(_0xc7bdad){_0x28a34c[_0x6036('0x45')]=_0xc7bdad;return _0x28a34c;})[_0x6036('0x25')](respondWithFilteredResult(_0xae8648,_0x4465a1))[_0x6036('0x46')](handleError(_0xae8648,null));};exports[_0x6036('0x47')]=function(_0x22cd50,_0x2e0a24){var _0x482874={'raw':!![],'where':{'id':_0x22cd50[_0x6036('0x48')]['id']}},_0x20848d={};_0x20848d[_0x6036('0x34')]=_[_0x6036('0x33')](db[_0x6036('0x41')]['rawAttributes']);_0x20848d[_0x6036('0x32')]=_[_0x6036('0x33')](_0x22cd50[_0x6036('0x32')]);_0x20848d['filters']=_[_0x6036('0x36')](_0x20848d['model'],_0x20848d[_0x6036('0x32')]);_0x482874[_0x6036('0x35')]=_[_0x6036('0x36')](_0x20848d[_0x6036('0x34')],qs[_0x6036('0x37')](_0x22cd50[_0x6036('0x32')][_0x6036('0x37')]));_0x482874['attributes']=_0x482874[_0x6036('0x35')]['length']?_0x482874[_0x6036('0x35')]:_0x20848d[_0x6036('0x34')];if(_0x22cd50[_0x6036('0x32')][_0x6036('0x42')]){_0x482874[_0x6036('0x43')]=[{'all':!![]}];}_0x482874=_['merge']({},_0x482874,_0x22cd50[_0x6036('0x40')]);return db[_0x6036('0x41')][_0x6036('0x49')](_0x482874)['then'](handleEntityNotFound(_0x2e0a24,null))[_0x6036('0x25')](respondWithResult(_0x2e0a24,null))[_0x6036('0x46')](handleError(_0x2e0a24,null));};exports[_0x6036('0x4a')]=function(_0x4f3296,_0x1a26a7){return db[_0x6036('0x41')][_0x6036('0x4a')](_0x4f3296['body'],{})['then'](respondWithResult(_0x1a26a7,0xc9))[_0x6036('0x46')](handleError(_0x1a26a7,null));};exports[_0x6036('0x24')]=function(_0x44f913,_0x23445c){if(_0x44f913[_0x6036('0x4b')]['id']){delete _0x44f913[_0x6036('0x4b')]['id'];}return db[_0x6036('0x41')][_0x6036('0x49')]({'where':{'id':_0x44f913['params']['id']}})['then'](handleEntityNotFound(_0x23445c,null))[_0x6036('0x25')](saveUpdates(_0x44f913[_0x6036('0x4b')],null))[_0x6036('0x25')](respondWithResult(_0x23445c,null))[_0x6036('0x46')](handleError(_0x23445c,null));};exports[_0x6036('0x26')]=function(_0x4ed6bf,_0x3177fd){return db[_0x6036('0x41')][_0x6036('0x49')]({'where':{'id':_0x4ed6bf['params']['id']}})[_0x6036('0x25')](handleEntityNotFound(_0x3177fd,null))[_0x6036('0x25')](removeEntity(_0x3177fd,null))[_0x6036('0x46')](handleError(_0x3177fd,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 05b6c76..fb5be95 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 _0xafe6=['moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x161f85,_0x1b1968){var _0x3f98ad=function(_0x44b3d5){while(--_0x44b3d5){_0x161f85['push'](_0x161f85['shift']());}};_0x3f98ad(++_0x1b1968);}(_0xafe6,0xcf));var _0x6afe=function(_0x381405,_0x48eba7){_0x381405=_0x381405-0x0;var _0x5e5d66=_0xafe6[_0x381405];return _0x5e5d66;};'use strict';var _=require('lodash');var util=require(_0x6afe('0x0'));var logger=require(_0x6afe('0x1'))(_0x6afe('0x2'));var moment=require(_0x6afe('0x3'));var BPromise=require('bluebird');var rp=require(_0x6afe('0x4'));var fs=require('fs');var path=require(_0x6afe('0x5'));var rimraf=require(_0x6afe('0x6'));var config=require(_0x6afe('0x7'));var attributes=require(_0x6afe('0x8'));module[_0x6afe('0x9')]=function(_0x44c3d1,_0x56093c){return _0x44c3d1[_0x6afe('0xa')](_0x6afe('0xb'),attributes,{'tableName':_0x6afe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6afe('0xd')});}; \ No newline at end of file +var _0x8ba5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ba5,0x150));var _0x58ba=function(_0x53f715,_0x52587b){_0x53f715=_0x53f715-0x0;var _0x16c757=_0x8ba5[_0x53f715];return _0x16c757;};'use strict';var _=require('lodash');var util=require(_0x58ba('0x0'));var logger=require(_0x58ba('0x1'))(_0x58ba('0x2'));var moment=require(_0x58ba('0x3'));var BPromise=require(_0x58ba('0x4'));var rp=require(_0x58ba('0x5'));var fs=require('fs');var path=require(_0x58ba('0x6'));var rimraf=require(_0x58ba('0x7'));var config=require('../../config/environment');var attributes=require(_0x58ba('0x8'));module['exports']=function(_0x152a21,_0x585293){return _0x152a21[_0x58ba('0x9')](_0x58ba('0xa'),attributes,{'tableName':_0x58ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x58ba('0xc'),'collate':_0x58ba('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 985e0c4..ea5dcc6 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 _0xb773=['error','code','message','info','result','catch','UpdateFaxApplication','update','body','options','raw','where','attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4501bc,_0x5076ad){var _0x1eaa85=function(_0x543aff){while(--_0x543aff){_0x4501bc['push'](_0x4501bc['shift']());}};_0x1eaa85(++_0x5076ad);}(_0xb773,0x6c));var _0x3b77=function(_0x2bc2a2,_0x51e95f){_0x2bc2a2=_0x2bc2a2-0x0;var _0x20de67=_0xb773[_0x2bc2a2];return _0x20de67;};'use strict';var _=require('lodash');var util=require(_0x3b77('0x0'));var moment=require(_0x3b77('0x1'));var BPromise=require(_0x3b77('0x2'));var rs=require(_0x3b77('0x3'));var fs=require('fs');var Redis=require(_0x3b77('0x4'));var db=require(_0x3b77('0x5'))['db'];var utils=require(_0x3b77('0x6'));var logger=require(_0x3b77('0x7'))(_0x3b77('0x8'));var config=require(_0x3b77('0x9'));var jayson=require(_0x3b77('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x221353,_0x12d47c,_0x1e0090){return new BPromise(function(_0x4ba021,_0x315858){return client[_0x3b77('0xb')](_0x221353,_0x1e0090)[_0x3b77('0xc')](function(_0x59c2bb){logger['info'](_0x3b77('0xd'),_0x12d47c,_0x3b77('0xe'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x12d47c,_0x3b77('0xe'),JSON[_0x3b77('0xf')](_0x59c2bb));if(_0x59c2bb['error']){if(_0x59c2bb[_0x3b77('0x10')][_0x3b77('0x11')]===0x1f4){logger[_0x3b77('0x10')]('FaxApplication,\x20%s,\x20%s',_0x12d47c,_0x59c2bb['error']['message']);return _0x315858(_0x59c2bb[_0x3b77('0x10')][_0x3b77('0x12')]);}logger[_0x3b77('0x10')](_0x3b77('0xd'),_0x12d47c,_0x59c2bb[_0x3b77('0x10')][_0x3b77('0x12')]);return _0x4ba021(_0x59c2bb[_0x3b77('0x10')][_0x3b77('0x12')]);}else{logger[_0x3b77('0x13')](_0x3b77('0xd'),_0x12d47c,_0x3b77('0xe'));_0x4ba021(_0x59c2bb[_0x3b77('0x14')]['message']);}})[_0x3b77('0x15')](function(_0x173d6a){logger[_0x3b77('0x10')]('FaxApplication,\x20%s,\x20%s',_0x12d47c,_0x173d6a);_0x315858(_0x173d6a);});});}exports[_0x3b77('0x16')]=function(_0x533bb9){var _0x1c6b2f=this;return new Promise(function(_0x291e4f,_0x38f626){return db['FaxApplication'][_0x3b77('0x17')](_0x533bb9[_0x3b77('0x18')],{'raw':_0x533bb9['options']?_0x533bb9[_0x3b77('0x19')][_0x3b77('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533bb9[_0x3b77('0x19')]?_0x533bb9[_0x3b77('0x19')][_0x3b77('0x1b')]||null:null,'attributes':_0x533bb9[_0x3b77('0x19')]?_0x533bb9[_0x3b77('0x19')][_0x3b77('0x1c')]||null:null,'limit':_0x533bb9[_0x3b77('0x19')]?_0x533bb9[_0x3b77('0x19')][_0x3b77('0x1d')]||null:null})['then'](function(_0x4b3ae1){logger[_0x3b77('0x13')](_0x3b77('0x16'),_0x533bb9);logger[_0x3b77('0x1e')](_0x3b77('0x16'),_0x533bb9,JSON[_0x3b77('0xf')](_0x4b3ae1));_0x291e4f(_0x4b3ae1);})[_0x3b77('0x15')](function(_0x227bd1){logger[_0x3b77('0x10')](_0x3b77('0x16'),_0x227bd1[_0x3b77('0x12')],_0x533bb9);_0x38f626(_0x1c6b2f[_0x3b77('0x10')](0x1f4,_0x227bd1[_0x3b77('0x12')]));});});}; \ No newline at end of file +var _0x3d40=['jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','UpdateFaxApplication','body','raw','options','where','attributes','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x3d40,0x10d));var _0x03d4=function(_0x38c9bf,_0x126bc7){_0x38c9bf=_0x38c9bf-0x0;var _0x32618d=_0x3d40[_0x38c9bf];return _0x32618d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03d4('0x0'));var fs=require('fs');var Redis=require(_0x03d4('0x1'));var db=require(_0x03d4('0x2'))['db'];var utils=require(_0x03d4('0x3'));var logger=require(_0x03d4('0x4'))(_0x03d4('0x5'));var config=require('../../config/environment');var jayson=require(_0x03d4('0x6'));var client=jayson[_0x03d4('0x7')][_0x03d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59b88c,_0x47675d,_0x33c9f3){return new BPromise(function(_0x22a9ee,_0x134ba2){return client['request'](_0x59b88c,_0x33c9f3)[_0x03d4('0x9')](function(_0x48951e){logger['info'](_0x03d4('0xa'),_0x47675d,_0x03d4('0xb'));logger[_0x03d4('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x47675d,_0x03d4('0xb'),JSON[_0x03d4('0xd')](_0x48951e));if(_0x48951e[_0x03d4('0xe')]){if(_0x48951e[_0x03d4('0xe')]['code']===0x1f4){logger[_0x03d4('0xe')](_0x03d4('0xa'),_0x47675d,_0x48951e[_0x03d4('0xe')]['message']);return _0x134ba2(_0x48951e[_0x03d4('0xe')][_0x03d4('0xf')]);}logger[_0x03d4('0xe')](_0x03d4('0xa'),_0x47675d,_0x48951e[_0x03d4('0xe')][_0x03d4('0xf')]);return _0x22a9ee(_0x48951e[_0x03d4('0xe')][_0x03d4('0xf')]);}else{logger[_0x03d4('0x10')](_0x03d4('0xa'),_0x47675d,_0x03d4('0xb'));_0x22a9ee(_0x48951e[_0x03d4('0x11')]['message']);}})[_0x03d4('0x12')](function(_0x543280){logger['error'](_0x03d4('0xa'),_0x47675d,_0x543280);_0x134ba2(_0x543280);});});}exports[_0x03d4('0x13')]=function(_0x3bf411){var _0x472a5a=this;return new Promise(function(_0x5780f6,_0x35fd53){return db['FaxApplication']['update'](_0x3bf411[_0x03d4('0x14')],{'raw':_0x3bf411['options']?_0x3bf411['options'][_0x03d4('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bf411[_0x03d4('0x16')]?_0x3bf411[_0x03d4('0x16')][_0x03d4('0x17')]||null:null,'attributes':_0x3bf411[_0x03d4('0x16')]?_0x3bf411['options'][_0x03d4('0x18')]||null:null,'limit':_0x3bf411['options']?_0x3bf411['options']['limit']||null:null})[_0x03d4('0x9')](function(_0x4693a2){logger[_0x03d4('0x10')]('UpdateFaxApplication',_0x3bf411);logger[_0x03d4('0xc')](_0x03d4('0x13'),_0x3bf411,JSON[_0x03d4('0xd')](_0x4693a2));_0x5780f6(_0x4693a2);})['catch'](function(_0x34007d){logger['error'](_0x03d4('0x13'),_0x34007d[_0x03d4('0xf')],_0x3bf411);_0x35fd53(_0x472a5a[_0x03d4('0xe')](0x1f4,_0x34007d[_0x03d4('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index c725f98..cae6f09 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb688,0xcf));var _0x8b68=function(_0x36ac91,_0x28afa6){_0x36ac91=_0x36ac91-0x0;var _0x1fdfbc=_0xb688[_0x36ac91];return _0x1fdfbc;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x3a4064,_0x12a8e8){var _0x4c40c6=function(_0x231abf){while(--_0x231abf){_0x3a4064['push'](_0x3a4064['shift']());}};_0x4c40c6(++_0x12a8e8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb7e7[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 3d5b12a..2117676 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 _0xb03e=['INTEGER','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x12c0ea,_0x2ed696){var _0x276352=function(_0x18e053){while(--_0x18e053){_0x12c0ea['push'](_0x12c0ea['shift']());}};_0x276352(++_0x2ed696);}(_0xb03e,0x1eb));var _0xeb03=function(_0x3199f2,_0x664299){_0x3199f2=_0x3199f2-0x0;var _0x26272c=_0xb03e[_0x3199f2];return _0x26272c;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'closed':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xeb03('0x2')]},'disposition':{'type':Sequelize[_0xeb03('0x3')]},'secondDisposition':{'type':Sequelize[_0xeb03('0x3')]},'thirdDisposition':{'type':Sequelize[_0xeb03('0x3')]},'note':{'type':Sequelize[_0xeb03('0x3')]},'read1stAt':{'type':Sequelize[_0xeb03('0x2')]},'fax':{'type':Sequelize[_0xeb03('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xeb03('0x4')]('in',_0xeb03('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xeb03('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xeb03('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xeb03('0x6')]}}; \ No newline at end of file +var _0x2a07=['STRING','ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x17ef3a,_0x59959b){var _0x42204b=function(_0x31ca3e){while(--_0x31ca3e){_0x17ef3a['push'](_0x17ef3a['shift']());}};_0x42204b(++_0x59959b);}(_0x2a07,0x74));var _0x72a0=function(_0x3ed4d7,_0x3783e0){_0x3ed4d7=_0x3ed4d7-0x0;var _0x2be1a4=_0x2a07[_0x3ed4d7];return _0x2be1a4;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'closed':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x72a0('0x3')]},'disposition':{'type':Sequelize[_0x72a0('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x72a0('0x4')]},'note':{'type':Sequelize[_0x72a0('0x4')]},'read1stAt':{'type':Sequelize[_0x72a0('0x3')]},'fax':{'type':Sequelize[_0x72a0('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x72a0('0x5')]('in',_0x72a0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x72a0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x72a0('0x5')]('in',_0x72a0('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x72a0('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index c82daca..9a1891b 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 _0x5509=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','map','FaxInteraction','fieldName','type','key','getOptions','fax','query','user','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','FaxMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','findAll','color','emit','faxInteractionTags:save','download','toString','server','files','join','root','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register'];(function(_0x2e22d4,_0x3bb223){var _0x3d5ce8=function(_0x1ae04f){while(--_0x1ae04f){_0x2e22d4['push'](_0x2e22d4['shift']());}};_0x3d5ce8(++_0x3bb223);}(_0x5509,0x188));var _0x9550=function(_0x13ff52,_0x2bbe05){_0x13ff52=_0x13ff52-0x0;var _0x182bba=_0x5509[_0x13ff52];return _0x182bba;};'use strict';var rimraf=require(_0x9550('0x0'));var zipdir=require(_0x9550('0x1'));var moment=require('moment');var BPromise=require(_0x9550('0x2'));var util=require(_0x9550('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x9550('0x4'));var Redis=require(_0x9550('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x9550('0x6'));var logger=require(_0x9550('0x7'))(_0x9550('0x8'));var config=require(_0x9550('0x9'));var db=require(_0x9550('0xa'))['db'];config[_0x9550('0xb')]=_[_0x9550('0xc')](config[_0x9550('0xb')],{'host':_0x9550('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9550('0xb')]));require(_0x9550('0xe'))[_0x9550('0xf')](socket);function respondWithStatusCode(_0x1c89bd,_0x5d47ff){_0x5d47ff=_0x5d47ff||0xcc;return function(_0x560df9){if(_0x560df9){return _0x1c89bd[_0x9550('0x10')](_0x5d47ff);}return _0x1c89bd['status'](_0x5d47ff)[_0x9550('0x11')]();};}function respondWithResult(_0x221346,_0x502feb){_0x502feb=_0x502feb||0xc8;return function(_0x201e58){if(_0x201e58){return _0x221346[_0x9550('0x12')](_0x502feb)[_0x9550('0x13')](_0x201e58);}};}function respondWithFilteredResult(_0x4d2fe6,_0x36ec7e){return function(_0x5e8c81){if(_0x5e8c81){var _0x180800=typeof _0x36ec7e[_0x9550('0x14')]===_0x9550('0x15')&&typeof _0x36ec7e[_0x9550('0x16')]===_0x9550('0x15');var _0x428ce5=_0x5e8c81[_0x9550('0x17')];var _0x128adc=_0x180800?0x0:_0x36ec7e[_0x9550('0x14')];var _0x202d50=_0x180800?_0x5e8c81[_0x9550('0x17')]:_0x36ec7e[_0x9550('0x14')]+_0x36ec7e[_0x9550('0x16')];var _0x5c78f2;if(_0x202d50>=_0x428ce5){_0x202d50=_0x428ce5;_0x5c78f2=0xc8;}else{_0x5c78f2=0xce;}_0x4d2fe6['status'](_0x5c78f2);return _0x4d2fe6[_0x9550('0x18')](_0x9550('0x19'),_0x128adc+'-'+_0x202d50+'/'+_0x428ce5)[_0x9550('0x13')](_0x5e8c81);}return null;};}function saveUpdates(_0x1a3b77){return function(_0x11ab14){if(_0x11ab14){return _0x11ab14['update'](_0x1a3b77)[_0x9550('0x1a')](function(_0x1a276e){return _0x1a276e;});}return null;};}function removeEntity(_0x37d375){return function(_0x54feae){if(_0x54feae){return _0x54feae[_0x9550('0x1b')]()[_0x9550('0x1a')](function(){_0x37d375[_0x9550('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2113b1){return function(_0x1a3ac8){if(!_0x1a3ac8){_0x2113b1[_0x9550('0x10')](0x194);}return _0x1a3ac8;};}function handleError(_0x206be7,_0x410ba6){_0x410ba6=_0x410ba6||0x1f4;return function(_0x44a0bc){logger[_0x9550('0x1c')](_0x44a0bc[_0x9550('0x1d')]);if(_0x44a0bc['name']){delete _0x44a0bc[_0x9550('0x1e')];}_0x206be7[_0x9550('0x12')](_0x410ba6)[_0x9550('0x1f')](_0x44a0bc);};}exports[_0x9550('0x20')]=function(_0x445444,_0x2c9c77){var _0x532911={};var _0x4500f0=_[_0x9550('0x21')](db[_0x9550('0x22')]['rawAttributes'],function(_0xf9205d){return{'name':_0xf9205d[_0x9550('0x23')],'type':_0xf9205d[_0x9550('0x24')][_0x9550('0x25')]};});_0x532911=qs[_0x9550('0x26')](_0x4500f0,_0x445444);return interaction['findAll'](_0x9550('0x27'),_0x445444[_0x9550('0x28')],_0x445444[_0x9550('0x29')],_0x532911,_0x4500f0)[_0x9550('0x1a')](respondWithFilteredResult(_0x2c9c77,_0x532911))[_0x9550('0x2a')](handleError(_0x2c9c77,null));};exports[_0x9550('0x2b')]=function(_0x195662,_0x3decff){var _0x47de21={'raw':![],'where':{'id':_0x195662[_0x9550('0x2c')]['id']}},_0x4715a3={};_0x4715a3[_0x9550('0x2d')]=_[_0x9550('0x2e')](db[_0x9550('0x22')][_0x9550('0x2f')]);_0x4715a3[_0x9550('0x28')]=_[_0x9550('0x2e')](_0x195662['query']);_0x4715a3[_0x9550('0x30')]=_[_0x9550('0x31')](_0x4715a3['model'],_0x4715a3[_0x9550('0x28')]);_0x47de21[_0x9550('0x32')]=_[_0x9550('0x31')](_0x4715a3['model'],qs[_0x9550('0x33')](_0x195662[_0x9550('0x28')][_0x9550('0x33')]));_0x47de21[_0x9550('0x32')]=_0x47de21[_0x9550('0x32')][_0x9550('0x34')]?_0x47de21[_0x9550('0x32')]:_0x4715a3[_0x9550('0x2d')];if(_0x195662[_0x9550('0x28')][_0x9550('0x35')]){_0x47de21[_0x9550('0x36')]=[{'all':!![]}];}_0x47de21=_[_0x9550('0x37')]({},_0x47de21,_0x195662[_0x9550('0x38')]);return db[_0x9550('0x22')][_0x9550('0x39')](_0x47de21)['then'](handleEntityNotFound(_0x3decff,null))['then'](respondWithResult(_0x3decff,null))[_0x9550('0x2a')](handleError(_0x3decff,null));};exports['create']=function(_0xa9b933,_0x3e3d0a){return db['FaxInteraction'][_0x9550('0x3a')](_0xa9b933[_0x9550('0x3b')],{})[_0x9550('0x1a')](respondWithResult(_0x3e3d0a,0xc9))['catch'](handleError(_0x3e3d0a,null));};exports['update']=function(_0x31dfef,_0x19effc){if(_0x31dfef[_0x9550('0x3b')]['id']){delete _0x31dfef[_0x9550('0x3b')]['id'];}return db[_0x9550('0x22')][_0x9550('0x39')]({'where':{'id':_0x31dfef[_0x9550('0x2c')]['id']}})[_0x9550('0x1a')](handleEntityNotFound(_0x19effc,null))[_0x9550('0x1a')](saveUpdates(_0x31dfef[_0x9550('0x3b')],null))[_0x9550('0x1a')](respondWithResult(_0x19effc,null))[_0x9550('0x2a')](handleError(_0x19effc,null));};exports[_0x9550('0x1b')]=function(_0x1f45cf,_0x1f5ec9){return db[_0x9550('0x22')][_0x9550('0x39')]({'where':{'id':_0x1f45cf[_0x9550('0x2c')]['id']}})[_0x9550('0x1a')](handleEntityNotFound(_0x1f5ec9,null))[_0x9550('0x1a')](removeEntity(_0x1f5ec9,null))[_0x9550('0x2a')](handleError(_0x1f5ec9,null));};exports[_0x9550('0x3c')]=function(_0x562004,_0x19b667){return db['FaxInteraction'][_0x9550('0x3c')]()['then'](respondWithResult(_0x19b667,null))[_0x9550('0x2a')](handleError(_0x19b667,null));};exports[_0x9550('0x3d')]=function(_0x3e128b,_0x117dbd){return db[_0x9550('0x3e')][_0x9550('0x39')]({'where':{'id':_0x3e128b[_0x9550('0x2c')]['id']}})[_0x9550('0x1a')](handleEntityNotFound(_0x117dbd,null))['then'](function(_0xcd3939){if(_0xcd3939){return _0xcd3939[_0x9550('0x3d')](_0x3e128b[_0x9550('0x3b')][_0x9550('0x3f')],_['omit'](_0x3e128b[_0x9550('0x3b')],[_0x9550('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x117dbd,null))[_0x9550('0x2a')](handleError(_0x117dbd,null));};exports[_0x9550('0x40')]=function(_0x452b6a,_0x2a30f9){var _0x153155={'raw':![],'where':{}};var _0x53bb54={};var _0x49a7bb={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x9550('0x41')]({'where':{'id':_0x452b6a['params']['id']}})[_0x9550('0x1a')](handleEntityNotFound(_0x2a30f9,null))['then'](function(_0x481ea1){if(_0x481ea1){_0x53bb54[_0x9550('0x2d')]=_['keys'](db[_0x9550('0x3e')]['rawAttributes']);_0x53bb54[_0x9550('0x28')]=_[_0x9550('0x2e')](_0x452b6a[_0x9550('0x28')]);_0x53bb54[_0x9550('0x30')]=_[_0x9550('0x31')](_0x53bb54[_0x9550('0x2d')],_0x53bb54[_0x9550('0x28')]);_0x153155[_0x9550('0x32')]=_[_0x9550('0x31')](_0x53bb54[_0x9550('0x2d')],qs[_0x9550('0x33')](_0x452b6a['query'][_0x9550('0x33')]));_0x153155['attributes']=_0x153155[_0x9550('0x32')][_0x9550('0x34')]?_0x153155['attributes']:_0x53bb54[_0x9550('0x2d')];if(!_0x452b6a[_0x9550('0x28')][_0x9550('0x42')](_0x9550('0x43'))){_0x153155[_0x9550('0x16')]=qs[_0x9550('0x16')](_0x452b6a[_0x9550('0x28')]['limit']);_0x153155['offset']=qs[_0x9550('0x14')](_0x452b6a['query'][_0x9550('0x14')]);}_0x153155['order']=qs[_0x9550('0x44')](_0x452b6a[_0x9550('0x28')][_0x9550('0x44')]);_0x153155[_0x9550('0x45')]=qs['filters'](_[_0x9550('0x46')](_0x452b6a[_0x9550('0x28')],_0x53bb54[_0x9550('0x30')]));_0x153155['where']['FaxInteractionId']=_0x481ea1['id'];if(_0x452b6a['query'][_0x9550('0x47')]){_0x153155['where']=_[_0x9550('0x37')](_0x153155['where'],{'$or':_['map'](_0x153155[_0x9550('0x32')],function(_0x326805){var _0x998960={};_0x998960[_0x326805]={'$like':'%'+_0x452b6a[_0x9550('0x28')][_0x9550('0x47')]+'%'};return _0x998960;})});}if(_0x452b6a[_0x9550('0x28')][_0x9550('0x48')]){var _0x29723e=_0x452b6a[_0x9550('0x28')][_0x9550('0x48')]['split'](',');var _0x3487e1={};_0x3487e1[_0x29723e[0x0]]={'$gte':moment(_0x29723e[0x1])[_0x9550('0x49')](_0x9550('0x4a'))};_0x153155[_0x9550('0x45')]=_[_0x9550('0x37')](_0x153155['where'],_0x3487e1);}_0x153155=_[_0x9550('0x37')]({},_0x153155,_0x452b6a[_0x9550('0x38')]);return db[_0x9550('0x3e')][_0x9550('0x17')]({'where':_0x153155['where']})[_0x9550('0x1a')](function(_0x2e354f){_0x49a7bb[_0x9550('0x17')]=_0x2e354f;if(_0x452b6a[_0x9550('0x28')][_0x9550('0x35')]){_0x153155[_0x9550('0x36')]=[{'all':!![]}];}return db[_0x9550('0x3e')]['findAll'](_0x153155);})[_0x9550('0x1a')](function(_0x1bdbb4){_0x49a7bb[_0x9550('0x4b')]=_0x1bdbb4;return _0x49a7bb;});}})[_0x9550('0x1a')](respondWithFilteredResult(_0x2a30f9,_0x153155))[_0x9550('0x2a')](handleError(_0x2a30f9,null));};exports['addTags']=function(_0x5be4ca,_0x1ab0bd){return db[_0x9550('0x22')][_0x9550('0x39')]({'where':{'id':_0x5be4ca[_0x9550('0x2c')]['id']}})[_0x9550('0x1a')](handleEntityNotFound(_0x1ab0bd,null))[_0x9550('0x1a')](function(_0x3861a7){if(_0x3861a7){return _0x3861a7[_0x9550('0x4c')](_0x5be4ca[_0x9550('0x3b')][_0x9550('0x3f')],_['omit'](_0x5be4ca[_0x9550('0x3b')],[_0x9550('0x3f'),'id'])||{})['spread'](function(){return db['Tag'][_0x9550('0x4d')]({'attributes':['id','name',_0x9550('0x4e')],'where':{'id':_0x5be4ca[_0x9550('0x3b')][_0x9550('0x3f')]}});})['then'](function(_0xf9f00f){socket[_0x9550('0x4f')](_0x9550('0x50'),{'id':Number(_0x5be4ca[_0x9550('0x2c')]['id']),'tags':_0xf9f00f||[]});return{'id':Number(_0x5be4ca[_0x9550('0x2c')]['id']),'tags':_0xf9f00f||[]};});}})[_0x9550('0x1a')](respondWithResult(_0x1ab0bd,null))[_0x9550('0x2a')](handleError(_0x1ab0bd,null));};exports['removeTags']=function(_0x585e07,_0x39d3e0){return db[_0x9550('0x22')][_0x9550('0x39')]({'where':{'id':_0x585e07[_0x9550('0x2c')]['id']}})[_0x9550('0x1a')](handleEntityNotFound(_0x39d3e0,null))[_0x9550('0x1a')](function(_0xb282de){if(_0xb282de){return _0xb282de['removeTags'](_0x585e07['query'][_0x9550('0x3f')]);}})[_0x9550('0x1a')](respondWithStatusCode(_0x39d3e0,null))[_0x9550('0x2a')](handleError(_0x39d3e0,null));};exports[_0x9550('0x51')]=function(_0x439d1c,_0x4a8179){var _0x185750=moment()['unix']()[_0x9550('0x52')]();var _0x3a0704=path['join'](config['root'],_0x9550('0x53'),_0x9550('0x54'),'tmp');var _0x2f7b36=path[_0x9550('0x55')](config[_0x9550('0x56')],_0x9550('0x53'),_0x9550('0x54'),'attachments');var _0x57b958=path[_0x9550('0x55')](_0x3a0704,_0x185750);var _0x2388e0=util[_0x9550('0x49')](_0x9550('0x57'),_0x439d1c[_0x9550('0x2c')]['id'],_0x185750);var _0x43d1b8=path[_0x9550('0x55')](_0x3a0704,_0x2388e0);var _0x3d6484=[];_0x3d6484[_0x9550('0x58')]({'model':db[_0x9550('0x59')],'as':_0x9550('0x59'),'raw':!![]});var _0x212af2=[{'model':db[_0x9550('0x3e')],'as':_0x9550('0x5a'),'attributes':['id',_0x9550('0x3b'),_0x9550('0x5b')],'include':_0x3d6484}];return db[_0x9550('0x22')][_0x9550('0x39')]({'where':{'id':_0x439d1c[_0x9550('0x2c')]['id']},'include':_0x212af2})[_0x9550('0x1a')](handleEntityNotFound(_0x4a8179,null))[_0x9550('0x1a')](function(_0xa47386){if(_0xa47386&&_0xa47386['Messages']){var _0x57c2fa=_0xa47386[_0x9550('0x5c')]({'plain':!![]});fs[_0x9550('0x5d')](_0x57b958);for(var _0x294d8a=0x0;_0x294d8a<_0x57c2fa[_0x9550('0x5a')][_0x9550('0x34')];_0x294d8a++){var _0x5d4cf6=_0x57c2fa['Messages'][_0x294d8a][_0x9550('0x59')];if(_0x5d4cf6){var _0x46c086=path[_0x9550('0x55')](_0x2f7b36,_0x5d4cf6[_0x9550('0x5e')]);if(fs[_0x9550('0x5f')](_0x46c086)){fs[_0x9550('0x60')](_0x46c086)[_0x9550('0x61')](fs[_0x9550('0x62')](path[_0x9550('0x55')](_0x57b958,_0x5d4cf6['basename'])));}}}return BPromise['resolve']()[_0x9550('0x1a')](function(){return new BPromise(function(_0x516733,_0x106e83){zipdir(_0x57b958,{'saveTo':_0x43d1b8},function(_0x24c9a9,_0x567958){if(_0x24c9a9)return _0x106e83(_0x24c9a9);return _0x516733(_0x567958);});})[_0x9550('0x1a')](function(){return new BPromise(function(_0x2b4b14,_0x3ed72f){rimraf(_0x57b958,function(_0x101e09){if(_0x101e09)_0x3ed72f(_0x101e09);return _0x2b4b14();});});})[_0x9550('0x1a')](function(){return _0x4a8179[_0x9550('0x51')](_0x43d1b8,_0x2388e0,function(_0x1379f5){if(_0x1379f5){console[_0x9550('0x63')](_0x9550('0x64'),_0x1379f5);}else{fs[_0x9550('0x65')](_0x43d1b8);}});});});}else{return _0x4a8179[_0x9550('0x10')](0xc8);}})[_0x9550('0x2a')](handleError(_0x4a8179,null));}; \ No newline at end of file +var _0x6bd7=['filter','$gte','split','format','rows','addTags','setTags','color','emit','removeTags','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','zip-dir','moment','bluebird','util','path','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','status','json','offset','undefined','count','limit','set','then','sendStatus','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','user','catch','show','params','model','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','create','body','update','find','describe','addMessage','omit','ids','getMessages','findOne','FaxMessage','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId'];(function(_0x3b7cb6,_0x2e2e6c){var _0x2ab75d=function(_0x1c0ac8){while(--_0x1c0ac8){_0x3b7cb6['push'](_0x3b7cb6['shift']());}};_0x2ab75d(++_0x2e2e6c);}(_0x6bd7,0x1c1));var _0x76bd=function(_0x17dab8,_0x19d0ec){_0x17dab8=_0x17dab8-0x0;var _0x336fb5=_0x6bd7[_0x17dab8];return _0x336fb5;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x76bd('0x0'));var moment=require(_0x76bd('0x1'));var BPromise=require(_0x76bd('0x2'));var util=require(_0x76bd('0x3'));var path=require(_0x76bd('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x76bd('0x5'));var qs=require(_0x76bd('0x6'));var logger=require(_0x76bd('0x7'))(_0x76bd('0x8'));var config=require(_0x76bd('0x9'));var db=require(_0x76bd('0xa'))['db'];config['redis']=_['defaults'](config[_0x76bd('0xb')],{'host':_0x76bd('0xc'),'port':0x18eb});var socket=require(_0x76bd('0xd'))(new Redis(config[_0x76bd('0xb')]));require(_0x76bd('0xe'))[_0x76bd('0xf')](socket);function respondWithStatusCode(_0x27fe4e,_0x14f49f){_0x14f49f=_0x14f49f||0xcc;return function(_0x3aab8f){if(_0x3aab8f){return _0x27fe4e['sendStatus'](_0x14f49f);}return _0x27fe4e['status'](_0x14f49f)['end']();};}function respondWithResult(_0x491303,_0x236183){_0x236183=_0x236183||0xc8;return function(_0x5bf384){if(_0x5bf384){return _0x491303[_0x76bd('0x10')](_0x236183)[_0x76bd('0x11')](_0x5bf384);}};}function respondWithFilteredResult(_0x4b945b,_0x29bcc2){return function(_0x146f2e){if(_0x146f2e){var _0x541322=typeof _0x29bcc2[_0x76bd('0x12')]===_0x76bd('0x13')&&typeof _0x29bcc2['limit']==='undefined';var _0x2fc7f5=_0x146f2e[_0x76bd('0x14')];var _0x36f6ba=_0x541322?0x0:_0x29bcc2[_0x76bd('0x12')];var _0x185638=_0x541322?_0x146f2e['count']:_0x29bcc2[_0x76bd('0x12')]+_0x29bcc2[_0x76bd('0x15')];var _0x5f16b0;if(_0x185638>=_0x2fc7f5){_0x185638=_0x2fc7f5;_0x5f16b0=0xc8;}else{_0x5f16b0=0xce;}_0x4b945b[_0x76bd('0x10')](_0x5f16b0);return _0x4b945b[_0x76bd('0x16')]('Content-Range',_0x36f6ba+'-'+_0x185638+'/'+_0x2fc7f5)[_0x76bd('0x11')](_0x146f2e);}return null;};}function saveUpdates(_0x533749){return function(_0x9d593f){if(_0x9d593f){return _0x9d593f['update'](_0x533749)['then'](function(_0x4c511b){return _0x4c511b;});}return null;};}function removeEntity(_0x38656e){return function(_0x4e7513){if(_0x4e7513){return _0x4e7513['destroy']()[_0x76bd('0x17')](function(){_0x38656e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6b13){return function(_0x258fff){if(!_0x258fff){_0x3c6b13[_0x76bd('0x18')](0x194);}return _0x258fff;};}function handleError(_0x5bab02,_0x59084f){_0x59084f=_0x59084f||0x1f4;return function(_0x19ed35){logger[_0x76bd('0x19')](_0x19ed35[_0x76bd('0x1a')]);if(_0x19ed35[_0x76bd('0x1b')]){delete _0x19ed35['name'];}_0x5bab02[_0x76bd('0x10')](_0x59084f)[_0x76bd('0x1c')](_0x19ed35);};}exports[_0x76bd('0x1d')]=function(_0x43d521,_0x3feaff){var _0x29bc9d={};var _0x3b1c8f=_[_0x76bd('0x1e')](db[_0x76bd('0x1f')][_0x76bd('0x20')],function(_0x59627f){return{'name':_0x59627f[_0x76bd('0x21')],'type':_0x59627f[_0x76bd('0x22')][_0x76bd('0x23')]};});_0x29bc9d=qs[_0x76bd('0x24')](_0x3b1c8f,_0x43d521);return interaction[_0x76bd('0x25')](_0x76bd('0x26'),_0x43d521['query'],_0x43d521[_0x76bd('0x27')],_0x29bc9d,_0x3b1c8f)[_0x76bd('0x17')](respondWithFilteredResult(_0x3feaff,_0x29bc9d))[_0x76bd('0x28')](handleError(_0x3feaff,null));};exports[_0x76bd('0x29')]=function(_0x1fd564,_0x314850){var _0x1060a3={'raw':![],'where':{'id':_0x1fd564[_0x76bd('0x2a')]['id']}},_0x5727fe={};_0x5727fe[_0x76bd('0x2b')]=_['keys'](db[_0x76bd('0x1f')][_0x76bd('0x20')]);_0x5727fe[_0x76bd('0x2c')]=_[_0x76bd('0x2d')](_0x1fd564[_0x76bd('0x2c')]);_0x5727fe[_0x76bd('0x2e')]=_['intersection'](_0x5727fe[_0x76bd('0x2b')],_0x5727fe[_0x76bd('0x2c')]);_0x1060a3[_0x76bd('0x2f')]=_[_0x76bd('0x30')](_0x5727fe[_0x76bd('0x2b')],qs[_0x76bd('0x31')](_0x1fd564[_0x76bd('0x2c')]['fields']));_0x1060a3[_0x76bd('0x2f')]=_0x1060a3[_0x76bd('0x2f')][_0x76bd('0x32')]?_0x1060a3['attributes']:_0x5727fe[_0x76bd('0x2b')];if(_0x1fd564[_0x76bd('0x2c')][_0x76bd('0x33')]){_0x1060a3['include']=[{'all':!![]}];}_0x1060a3=_[_0x76bd('0x34')]({},_0x1060a3,_0x1fd564[_0x76bd('0x35')]);return db[_0x76bd('0x1f')]['find'](_0x1060a3)['then'](handleEntityNotFound(_0x314850,null))[_0x76bd('0x17')](respondWithResult(_0x314850,null))['catch'](handleError(_0x314850,null));};exports[_0x76bd('0x36')]=function(_0x22e80a,_0x1b9977){return db[_0x76bd('0x1f')]['create'](_0x22e80a[_0x76bd('0x37')],{})['then'](respondWithResult(_0x1b9977,0xc9))[_0x76bd('0x28')](handleError(_0x1b9977,null));};exports[_0x76bd('0x38')]=function(_0x3893d6,_0x1a4ab9){if(_0x3893d6[_0x76bd('0x37')]['id']){delete _0x3893d6[_0x76bd('0x37')]['id'];}return db[_0x76bd('0x1f')][_0x76bd('0x39')]({'where':{'id':_0x3893d6['params']['id']}})[_0x76bd('0x17')](handleEntityNotFound(_0x1a4ab9,null))[_0x76bd('0x17')](saveUpdates(_0x3893d6[_0x76bd('0x37')],null))[_0x76bd('0x17')](respondWithResult(_0x1a4ab9,null))[_0x76bd('0x28')](handleError(_0x1a4ab9,null));};exports['destroy']=function(_0x44973b,_0x30f6aa){return db[_0x76bd('0x1f')][_0x76bd('0x39')]({'where':{'id':_0x44973b['params']['id']}})['then'](handleEntityNotFound(_0x30f6aa,null))[_0x76bd('0x17')](removeEntity(_0x30f6aa,null))[_0x76bd('0x28')](handleError(_0x30f6aa,null));};exports['describe']=function(_0x30eef3,_0x41e06f){return db[_0x76bd('0x1f')][_0x76bd('0x3a')]()['then'](respondWithResult(_0x41e06f,null))[_0x76bd('0x28')](handleError(_0x41e06f,null));};exports[_0x76bd('0x3b')]=function(_0x399b6d,_0x39f466){return db['FaxMessage'][_0x76bd('0x39')]({'where':{'id':_0x399b6d[_0x76bd('0x2a')]['id']}})[_0x76bd('0x17')](handleEntityNotFound(_0x39f466,null))['then'](function(_0x3fc4f1){if(_0x3fc4f1){return _0x3fc4f1[_0x76bd('0x3b')](_0x399b6d[_0x76bd('0x37')]['ids'],_[_0x76bd('0x3c')](_0x399b6d[_0x76bd('0x37')],[_0x76bd('0x3d'),'id'])||{});}})[_0x76bd('0x17')](respondWithResult(_0x39f466,null))[_0x76bd('0x28')](handleError(_0x39f466,null));};exports[_0x76bd('0x3e')]=function(_0x55d0c3,_0x3f42f3){var _0x383a15={'raw':![],'where':{}};var _0x522356={};var _0x55af52={'count':0x0,'rows':[]};return db[_0x76bd('0x1f')][_0x76bd('0x3f')]({'where':{'id':_0x55d0c3['params']['id']}})[_0x76bd('0x17')](handleEntityNotFound(_0x3f42f3,null))[_0x76bd('0x17')](function(_0x2ec37a){if(_0x2ec37a){_0x522356[_0x76bd('0x2b')]=_[_0x76bd('0x2d')](db[_0x76bd('0x40')][_0x76bd('0x20')]);_0x522356['query']=_['keys'](_0x55d0c3[_0x76bd('0x2c')]);_0x522356[_0x76bd('0x2e')]=_[_0x76bd('0x30')](_0x522356[_0x76bd('0x2b')],_0x522356[_0x76bd('0x2c')]);_0x383a15[_0x76bd('0x2f')]=_[_0x76bd('0x30')](_0x522356[_0x76bd('0x2b')],qs[_0x76bd('0x31')](_0x55d0c3[_0x76bd('0x2c')]['fields']));_0x383a15[_0x76bd('0x2f')]=_0x383a15['attributes']['length']?_0x383a15[_0x76bd('0x2f')]:_0x522356['model'];if(!_0x55d0c3[_0x76bd('0x2c')][_0x76bd('0x41')](_0x76bd('0x42'))){_0x383a15['limit']=qs['limit'](_0x55d0c3[_0x76bd('0x2c')][_0x76bd('0x15')]);_0x383a15[_0x76bd('0x12')]=qs[_0x76bd('0x12')](_0x55d0c3[_0x76bd('0x2c')][_0x76bd('0x12')]);}_0x383a15[_0x76bd('0x43')]=qs[_0x76bd('0x44')](_0x55d0c3[_0x76bd('0x2c')]['sort']);_0x383a15[_0x76bd('0x45')]=qs[_0x76bd('0x2e')](_['pick'](_0x55d0c3['query'],_0x522356[_0x76bd('0x2e')]));_0x383a15[_0x76bd('0x45')][_0x76bd('0x46')]=_0x2ec37a['id'];if(_0x55d0c3[_0x76bd('0x2c')]['filter']){_0x383a15[_0x76bd('0x45')]=_[_0x76bd('0x34')](_0x383a15[_0x76bd('0x45')],{'$or':_[_0x76bd('0x1e')](_0x383a15[_0x76bd('0x2f')],function(_0x1244d8){var _0x523392={};_0x523392[_0x1244d8]={'$like':'%'+_0x55d0c3[_0x76bd('0x2c')][_0x76bd('0x47')]+'%'};return _0x523392;})});}if(_0x55d0c3[_0x76bd('0x2c')]['$gte']){var _0x26173b=_0x55d0c3['query'][_0x76bd('0x48')][_0x76bd('0x49')](',');var _0x536a20={};_0x536a20[_0x26173b[0x0]]={'$gte':moment(_0x26173b[0x1])[_0x76bd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x383a15[_0x76bd('0x45')]=_['merge'](_0x383a15[_0x76bd('0x45')],_0x536a20);}_0x383a15=_[_0x76bd('0x34')]({},_0x383a15,_0x55d0c3[_0x76bd('0x35')]);return db[_0x76bd('0x40')]['count']({'where':_0x383a15[_0x76bd('0x45')]})[_0x76bd('0x17')](function(_0x1070ee){_0x55af52[_0x76bd('0x14')]=_0x1070ee;if(_0x55d0c3['query']['includeAll']){_0x383a15['include']=[{'all':!![]}];}return db[_0x76bd('0x40')][_0x76bd('0x25')](_0x383a15);})[_0x76bd('0x17')](function(_0x73a0ff){_0x55af52[_0x76bd('0x4b')]=_0x73a0ff;return _0x55af52;});}})[_0x76bd('0x17')](respondWithFilteredResult(_0x3f42f3,_0x383a15))['catch'](handleError(_0x3f42f3,null));};exports[_0x76bd('0x4c')]=function(_0x25b525,_0x34d529){return db['FaxInteraction'][_0x76bd('0x39')]({'where':{'id':_0x25b525['params']['id']}})[_0x76bd('0x17')](handleEntityNotFound(_0x34d529,null))['then'](function(_0x4cacdd){if(_0x4cacdd){return _0x4cacdd[_0x76bd('0x4d')](_0x25b525[_0x76bd('0x37')][_0x76bd('0x3d')],_[_0x76bd('0x3c')](_0x25b525[_0x76bd('0x37')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x76bd('0x25')]({'attributes':['id',_0x76bd('0x1b'),_0x76bd('0x4e')],'where':{'id':_0x25b525['body'][_0x76bd('0x3d')]}});})[_0x76bd('0x17')](function(_0xf059fe){socket[_0x76bd('0x4f')]('faxInteractionTags:save',{'id':Number(_0x25b525['params']['id']),'tags':_0xf059fe||[]});return{'id':Number(_0x25b525[_0x76bd('0x2a')]['id']),'tags':_0xf059fe||[]};});}})[_0x76bd('0x17')](respondWithResult(_0x34d529,null))[_0x76bd('0x28')](handleError(_0x34d529,null));};exports[_0x76bd('0x50')]=function(_0x149007,_0xed1764){return db[_0x76bd('0x1f')]['find']({'where':{'id':_0x149007['params']['id']}})[_0x76bd('0x17')](handleEntityNotFound(_0xed1764,null))[_0x76bd('0x17')](function(_0x5920e2){if(_0x5920e2){return _0x5920e2[_0x76bd('0x50')](_0x149007['query'][_0x76bd('0x3d')]);}})[_0x76bd('0x17')](respondWithStatusCode(_0xed1764,null))[_0x76bd('0x28')](handleError(_0xed1764,null));};exports['download']=function(_0x228f14,_0x220100){var _0x2a6ea9=moment()[_0x76bd('0x51')]()[_0x76bd('0x52')]();var _0x4bd8f6=path[_0x76bd('0x53')](config[_0x76bd('0x54')],_0x76bd('0x55'),_0x76bd('0x56'),_0x76bd('0x57'));var _0x4f966c=path[_0x76bd('0x53')](config['root'],'server',_0x76bd('0x56'),_0x76bd('0x58'));var _0x3cb04e=path['join'](_0x4bd8f6,_0x2a6ea9);var _0x55c434=util[_0x76bd('0x4a')](_0x76bd('0x59'),_0x228f14['params']['id'],_0x2a6ea9);var _0x36a4af=path[_0x76bd('0x53')](_0x4bd8f6,_0x55c434);var _0x4b81b2=[];_0x4b81b2[_0x76bd('0x5a')]({'model':db[_0x76bd('0x5b')],'as':_0x76bd('0x5b'),'raw':!![]});var _0x344c94=[{'model':db[_0x76bd('0x40')],'as':_0x76bd('0x5c'),'attributes':['id',_0x76bd('0x37'),_0x76bd('0x5d')],'include':_0x4b81b2}];return db[_0x76bd('0x1f')]['find']({'where':{'id':_0x228f14['params']['id']},'include':_0x344c94})[_0x76bd('0x17')](handleEntityNotFound(_0x220100,null))['then'](function(_0x59e172){if(_0x59e172&&_0x59e172['Messages']){var _0x10e553=_0x59e172['get']({'plain':!![]});fs[_0x76bd('0x5e')](_0x3cb04e);for(var _0x483cdf=0x0;_0x483cdf<_0x10e553[_0x76bd('0x5c')][_0x76bd('0x32')];_0x483cdf++){var _0x22ed39=_0x10e553[_0x76bd('0x5c')][_0x483cdf][_0x76bd('0x5b')];if(_0x22ed39){var _0x1720d9=path[_0x76bd('0x53')](_0x4f966c,_0x22ed39[_0x76bd('0x5f')]);if(fs[_0x76bd('0x60')](_0x1720d9)){fs[_0x76bd('0x61')](_0x1720d9)[_0x76bd('0x62')](fs[_0x76bd('0x63')](path[_0x76bd('0x53')](_0x3cb04e,_0x22ed39[_0x76bd('0x5f')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x1682c2,_0x540993){zipdir(_0x3cb04e,{'saveTo':_0x36a4af},function(_0x160455,_0xc93e92){if(_0x160455)return _0x540993(_0x160455);return _0x1682c2(_0xc93e92);});})[_0x76bd('0x17')](function(){return new BPromise(function(_0x1c2d5c,_0x3b37f8){rimraf(_0x3cb04e,function(_0x5bdc2b){if(_0x5bdc2b)_0x3b37f8(_0x5bdc2b);return _0x1c2d5c();});});})[_0x76bd('0x17')](function(){return _0x220100[_0x76bd('0x64')](_0x36a4af,_0x55c434,function(_0x57dce9){if(_0x57dce9){console[_0x76bd('0x65')](_0x76bd('0x66'),_0x57dce9);}else{fs[_0x76bd('0x67')](_0x36a4af);}});});});}else{return _0x220100[_0x76bd('0x18')](0xc8);}})[_0x76bd('0x28')](handleError(_0x220100,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 786518c..3861422 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 _0x4846=['FaxInteraction','FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x24c9e3,_0x569342){var _0x1106d5=function(_0x5633d0){while(--_0x5633d0){_0x24c9e3['push'](_0x24c9e3['shift']());}};_0x1106d5(++_0x569342);}(_0x4846,0xee));var _0x6484=function(_0x368b19,_0xcf4ad7){_0x368b19=_0x368b19-0x0;var _0x8ec657=_0x4846[_0x368b19];return _0x8ec657;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0x6484('0x0')];var FaxMessage=require('../../mysqldb')['db'][_0x6484('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6484('0x2')](0x0);var events={'afterCreate':_0x6484('0x3'),'afterUpdate':_0x6484('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1a0c27){return function(_0x1f6201,_0x5927cd,_0x2ecf82){_0x1f6201[_0x6484('0x5')]({'attributes':['id'],'raw':!![]})[_0x6484('0x6')](function(_0x1f0e5d){_0x1f6201[_0x6484('0x7')](_0x6484('0x8'),_0x1f0e5d[_0x6484('0x9')](function(_0x48d486){return{'id':_0x48d486['id']};}));return FaxMessage[_0x6484('0xa')]({'where':{'FaxInteractionId':_0x1f6201['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6484('0x6')](function(_0xd90fab){_0x1f6201['setDataValue'](_0x6484('0xb'),_0xd90fab[_0x6484('0xc')]);FaxInteractionEvents[_0x6484('0xd')](_0x1a0c27+':'+_0x1f6201['id'],_0x1f6201);FaxInteractionEvents[_0x6484('0xd')](_0x1a0c27,_0x1f6201);_0x2ecf82(null);})['catch'](_0x2ecf82(null));};}for(var e in events){if(events[_0x6484('0xe')](e)){var event=events[e];FaxInteraction[_0x6484('0xf')](e,emitEvent(event));}}module[_0x6484('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xa3c9=['setMaxListeners','save','update','remove','setDataValue','Users','findAll','then','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x2769e5,_0x26444b){var _0x3150fb=function(_0x5cc337){while(--_0x5cc337){_0x2769e5['push'](_0x2769e5['shift']());}};_0x3150fb(++_0x26444b);}(_0xa3c9,0x161));var _0x9a3c=function(_0xcaf223,_0xd39f07){_0xcaf223=_0xcaf223-0x0;var _0x17e00d=_0xa3c9[_0xcaf223];return _0x17e00d;};'use strict';var EventEmitter=require(_0x9a3c('0x0'));var FaxInteraction=require(_0x9a3c('0x1'))['db'][_0x9a3c('0x2')];var FaxMessage=require(_0x9a3c('0x1'))['db'][_0x9a3c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9a3c('0x4')](0x0);var events={'afterCreate':_0x9a3c('0x5'),'afterUpdate':_0x9a3c('0x6'),'afterDestroy':_0x9a3c('0x7')};function emitEvent(_0x2d5099){return function(_0x35a1c9,_0xa8d72,_0x94afea){_0x35a1c9['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x209246){_0x35a1c9[_0x9a3c('0x8')](_0x9a3c('0x9'),_0x209246['map'](function(_0x371f5e){return{'id':_0x371f5e['id']};}));return FaxMessage[_0x9a3c('0xa')]({'where':{'FaxInteractionId':_0x35a1c9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9a3c('0xb')](function(_0x3598e1){_0x35a1c9[_0x9a3c('0x8')]('unreadMessages',_0x3598e1[_0x9a3c('0xc')]);FaxInteractionEvents[_0x9a3c('0xd')](_0x2d5099+':'+_0x35a1c9['id'],_0x35a1c9);FaxInteractionEvents['emit'](_0x2d5099,_0x35a1c9);_0x94afea(null);})[_0x9a3c('0xe')](_0x94afea(null));};}for(var e in events){if(events[_0x9a3c('0xf')](e)){var event=events[e];FaxInteraction[_0x9a3c('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index aee7d51..eb20fcf 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 _0xcefb=['path','rimraf','../../config/environment','./faxInteraction.attributes','FaxInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','request-promise'];(function(_0x47f007,_0x162793){var _0x480825=function(_0x37b1d6){while(--_0x37b1d6){_0x47f007['push'](_0x47f007['shift']());}};_0x480825(++_0x162793);}(_0xcefb,0x1cb));var _0xbcef=function(_0x15681d,_0x40d775){_0x15681d=_0x15681d-0x0;var _0x21f3df=_0xcefb[_0x15681d];return _0x21f3df;};'use strict';var _=require('lodash');var util=require(_0xbcef('0x0'));var logger=require('../../config/logger')(_0xbcef('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbcef('0x2'));var fs=require('fs');var path=require(_0xbcef('0x3'));var rimraf=require(_0xbcef('0x4'));var config=require(_0xbcef('0x5'));var attributes=require(_0xbcef('0x6'));module['exports']=function(_0x17be2d,_0xe8dd2d){return _0x17be2d['define'](_0xbcef('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x219dc7,_0x4da4fe,_0x5391c1){if(_0x219dc7[_0xbcef('0x8')]('closed')){_0x219dc7[_0xbcef('0x9')]=moment()['format'](_0xbcef('0xa'));}_0x5391c1(null,_0x219dc7);}}});}; \ No newline at end of file +var _0x4ec4=['FaxInteraction','fax_interactions','changed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x4ec4,0x125));var _0x44ec=function(_0x2593bc,_0x443a54){_0x2593bc=_0x2593bc-0x0;var _0x257e86=_0x4ec4[_0x2593bc];return _0x257e86;};'use strict';var _=require(_0x44ec('0x0'));var util=require(_0x44ec('0x1'));var logger=require(_0x44ec('0x2'))('api');var moment=require(_0x44ec('0x3'));var BPromise=require(_0x44ec('0x4'));var rp=require(_0x44ec('0x5'));var fs=require('fs');var path=require(_0x44ec('0x6'));var rimraf=require(_0x44ec('0x7'));var config=require(_0x44ec('0x8'));var attributes=require('./faxInteraction.attributes');module[_0x44ec('0x9')]=function(_0x16b97d,_0x525902){return _0x16b97d[_0x44ec('0xa')](_0x44ec('0xb'),attributes,{'tableName':_0x44ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x217427,_0x111a61,_0x750cac){if(_0x217427[_0x44ec('0xd')]('closed')){_0x217427[_0x44ec('0xe')]=moment()[_0x44ec('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x750cac(null,_0x217427);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 21d105b..c8385ba 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 _0x04e0=['jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateFaxInteraction','body','options','attributes','limit','catch','FaxInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x36072d,_0x24f414){var _0x32a52c=function(_0x19834c){while(--_0x19834c){_0x36072d['push'](_0x36072d['shift']());}};_0x32a52c(++_0x24f414);}(_0x04e0,0x1ce));var _0x004e=function(_0x324ae4,_0xfbae47){_0x324ae4=_0x324ae4-0x0;var _0x515312=_0x04e0[_0x324ae4];return _0x515312;};'use strict';var _=require(_0x004e('0x0'));var util=require(_0x004e('0x1'));var moment=require('moment');var BPromise=require(_0x004e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x004e('0x3'));var db=require(_0x004e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x004e('0x5'));var config=require('../../config/environment');var jayson=require(_0x004e('0x6'));var client=jayson[_0x004e('0x7')][_0x004e('0x8')]({'port':0x232a});config[_0x004e('0x9')]=_[_0x004e('0xa')](config[_0x004e('0x9')],{'host':_0x004e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x004e('0x9')]));require(_0x004e('0xc'))[_0x004e('0xd')](socket);function respondWithRpcPromise(_0x21a76b,_0x2c2103,_0x37b680){return new BPromise(function(_0x57bbc2,_0x289d94){return client[_0x004e('0xe')](_0x21a76b,_0x37b680)['then'](function(_0xd5106d){logger[_0x004e('0xf')](_0x004e('0x10'),_0x2c2103,'request\x20sent');logger[_0x004e('0x11')](_0x004e('0x12'),_0x2c2103,_0x004e('0x13'),JSON[_0x004e('0x14')](_0xd5106d));if(_0xd5106d['error']){if(_0xd5106d[_0x004e('0x15')][_0x004e('0x16')]===0x1f4){logger['error'](_0x004e('0x10'),_0x2c2103,_0xd5106d[_0x004e('0x15')]['message']);return _0x289d94(_0xd5106d[_0x004e('0x15')][_0x004e('0x17')]);}logger['error'](_0x004e('0x10'),_0x2c2103,_0xd5106d['error'][_0x004e('0x17')]);return _0x57bbc2(_0xd5106d[_0x004e('0x15')][_0x004e('0x17')]);}else{logger[_0x004e('0xf')](_0x004e('0x10'),_0x2c2103,'request\x20sent');_0x57bbc2(_0xd5106d[_0x004e('0x18')]['message']);}})['catch'](function(_0x14e55e){logger['error'](_0x004e('0x10'),_0x2c2103,_0x14e55e);_0x289d94(_0x14e55e);});});}exports[_0x004e('0x19')]=function(_0x59252c){var _0x149ae0=this;return new Promise(function(_0x23d9a5,_0x6560d9){return db['FaxInteraction']['update'](_0x59252c[_0x004e('0x1a')],{'raw':_0x59252c[_0x004e('0x1b')]?_0x59252c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59252c[_0x004e('0x1b')]?_0x59252c[_0x004e('0x1b')]['where']||null:null,'attributes':_0x59252c['options']?_0x59252c[_0x004e('0x1b')][_0x004e('0x1c')]||null:null,'limit':_0x59252c[_0x004e('0x1b')]?_0x59252c[_0x004e('0x1b')][_0x004e('0x1d')]||null:null})['then'](function(_0x50f4be){logger[_0x004e('0xf')](_0x004e('0x19'),_0x59252c);logger[_0x004e('0x11')]('UpdateFaxInteraction',_0x59252c,JSON[_0x004e('0x14')](_0x50f4be));_0x23d9a5(_0x50f4be);})[_0x004e('0x1e')](function(_0x452e44){logger['error']('UpdateFaxInteraction',_0x452e44[_0x004e('0x17')],_0x59252c);_0x6560d9(_0x149ae0['error'](0x1f4,_0x452e44[_0x004e('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x230ad9){return new Promise(function(_0x327ada,_0x529ef0){return db[_0x004e('0x1f')][_0x004e('0x20')]({'where':_0x230ad9[_0x004e('0x1b')]?_0x230ad9['options']['where']||null:null})[_0x004e('0x21')](function(_0x4388bf){if(_0x4388bf){return _0x4388bf[_0x004e('0x22')](_0x230ad9['body'][_0x004e('0x23')],_[_0x004e('0x24')](_0x230ad9['body'],['ids','id'])||{});}})[_0x004e('0x25')](function(_0x11498a){logger[_0x004e('0xf')](_0x004e('0x26'),_0x230ad9);logger[_0x004e('0x11')](_0x004e('0x26'),_0x230ad9,JSON['stringify'](_0x11498a));_0x327ada(_0x11498a);})['catch'](function(_0x2a62d1){logger[_0x004e('0x15')](_0x004e('0x26'),_0x2a62d1[_0x004e('0x17')],_0x230ad9);_0x529ef0(_this['error'](0x1f4,_0x2a62d1[_0x004e('0x17')]));});});}; \ No newline at end of file +var _0x0f8c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','UpdateFaxInteraction','update','options','raw','limit','stringify','catch','AddTagsToFaxInteraction','FaxInteraction','where','addTags','body','ids','omit','spread','AddTags','lodash','util'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x0f8c,0xb2));var _0xc0f8=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x0f8c[_0x4f35f4];return _0x2e9a70;};'use strict';var _=require(_0xc0f8('0x0'));var util=require(_0xc0f8('0x1'));var moment=require('moment');var BPromise=require(_0xc0f8('0x2'));var rs=require(_0xc0f8('0x3'));var fs=require('fs');var Redis=require(_0xc0f8('0x4'));var db=require(_0xc0f8('0x5'))['db'];var utils=require(_0xc0f8('0x6'));var logger=require(_0xc0f8('0x7'))(_0xc0f8('0x8'));var config=require(_0xc0f8('0x9'));var jayson=require(_0xc0f8('0xa'));var client=jayson[_0xc0f8('0xb')][_0xc0f8('0xc')]({'port':0x232a});config[_0xc0f8('0xd')]=_[_0xc0f8('0xe')](config[_0xc0f8('0xd')],{'host':_0xc0f8('0xf'),'port':0x18eb});var socket=require(_0xc0f8('0x10'))(new Redis(config[_0xc0f8('0xd')]));require(_0xc0f8('0x11'))[_0xc0f8('0x12')](socket);function respondWithRpcPromise(_0x275058,_0x379259,_0x1411d3){return new BPromise(function(_0x54dd37,_0x4bb1fa){return client[_0xc0f8('0x13')](_0x275058,_0x1411d3)[_0xc0f8('0x14')](function(_0x433236){logger[_0xc0f8('0x15')](_0xc0f8('0x16'),_0x379259,'request\x20sent');logger[_0xc0f8('0x17')](_0xc0f8('0x18'),_0x379259,_0xc0f8('0x19'),JSON['stringify'](_0x433236));if(_0x433236[_0xc0f8('0x1a')]){if(_0x433236[_0xc0f8('0x1a')]['code']===0x1f4){logger[_0xc0f8('0x1a')](_0xc0f8('0x16'),_0x379259,_0x433236[_0xc0f8('0x1a')]['message']);return _0x4bb1fa(_0x433236[_0xc0f8('0x1a')][_0xc0f8('0x1b')]);}logger[_0xc0f8('0x1a')](_0xc0f8('0x16'),_0x379259,_0x433236[_0xc0f8('0x1a')][_0xc0f8('0x1b')]);return _0x54dd37(_0x433236['error'][_0xc0f8('0x1b')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x379259,_0xc0f8('0x19'));_0x54dd37(_0x433236[_0xc0f8('0x1c')][_0xc0f8('0x1b')]);}})['catch'](function(_0x1db195){logger['error'](_0xc0f8('0x16'),_0x379259,_0x1db195);_0x4bb1fa(_0x1db195);});});}exports[_0xc0f8('0x1d')]=function(_0x3ddbad){var _0x51ac67=this;return new Promise(function(_0x4e1213,_0x196fb6){return db['FaxInteraction'][_0xc0f8('0x1e')](_0x3ddbad['body'],{'raw':_0x3ddbad[_0xc0f8('0x1f')]?_0x3ddbad[_0xc0f8('0x1f')][_0xc0f8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ddbad[_0xc0f8('0x1f')]?_0x3ddbad['options']['where']||null:null,'attributes':_0x3ddbad['options']?_0x3ddbad[_0xc0f8('0x1f')]['attributes']||null:null,'limit':_0x3ddbad['options']?_0x3ddbad[_0xc0f8('0x1f')][_0xc0f8('0x21')]||null:null})['then'](function(_0x584216){logger[_0xc0f8('0x15')](_0xc0f8('0x1d'),_0x3ddbad);logger[_0xc0f8('0x17')](_0xc0f8('0x1d'),_0x3ddbad,JSON[_0xc0f8('0x22')](_0x584216));_0x4e1213(_0x584216);})[_0xc0f8('0x23')](function(_0x3fd16b){logger[_0xc0f8('0x1a')](_0xc0f8('0x1d'),_0x3fd16b[_0xc0f8('0x1b')],_0x3ddbad);_0x196fb6(_0x51ac67[_0xc0f8('0x1a')](0x1f4,_0x3fd16b[_0xc0f8('0x1b')]));});});};exports[_0xc0f8('0x24')]=function(_0xe52568){return new Promise(function(_0x4c49b2,_0x205332){return db[_0xc0f8('0x25')]['find']({'where':_0xe52568['options']?_0xe52568[_0xc0f8('0x1f')][_0xc0f8('0x26')]||null:null})['then'](function(_0x1a23ce){if(_0x1a23ce){return _0x1a23ce[_0xc0f8('0x27')](_0xe52568[_0xc0f8('0x28')][_0xc0f8('0x29')],_[_0xc0f8('0x2a')](_0xe52568[_0xc0f8('0x28')],['ids','id'])||{});}})[_0xc0f8('0x2b')](function(_0x211e67){logger[_0xc0f8('0x15')](_0xc0f8('0x2c'),_0xe52568);logger['debug'](_0xc0f8('0x2c'),_0xe52568,JSON[_0xc0f8('0x22')](_0x211e67));_0x4c49b2(_0x211e67);})[_0xc0f8('0x23')](function(_0x4f3d51){logger[_0xc0f8('0x1a')](_0xc0f8('0x2c'),_0x4f3d51['message'],_0xe52568);_0x205332(_this[_0xc0f8('0x1a')](0x1f4,_0x4f3d51[_0xc0f8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 4d2577b..63b9312 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 _0xe66f=['length','./faxInteraction.events','save','remove','update','removeListener','register'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xe66f,0x1ac));var _0xfe66=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xe66f[_0x5d2803];return _0xdcad2c;};'use strict';var FaxInteractionEvents=require(_0xfe66('0x0'));var events=[_0xfe66('0x1'),_0xfe66('0x2'),_0xfe66('0x3')];function createListener(_0x20dc5f,_0x2e8a01){return function(_0x1ff175){_0x2e8a01['emit'](_0x20dc5f,_0x1ff175);};}function removeListener(_0x24801a,_0x15a174){return function(){FaxInteractionEvents[_0xfe66('0x4')](_0x24801a,_0x15a174);};}exports[_0xfe66('0x5')]=function(_0x46c5f3){for(var _0x4fed14=0x0,_0x88de25=events[_0xfe66('0x6')];_0x4fed14<_0x88de25;_0x4fed14++){var _0x429beb=events[_0x4fed14];var _0x1a0172=createListener('faxInteraction:'+_0x429beb,_0x46c5f3);FaxInteractionEvents['on'](_0x429beb,_0x1a0172);}}; \ No newline at end of file +var _0xb583=['register','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb583,0x98));var _0x3b58=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb583[_0x167cc1];return _0x10bc4b;};'use strict';var FaxInteractionEvents=require(_0x3b58('0x0'));var events=['save',_0x3b58('0x1'),_0x3b58('0x2')];function createListener(_0x250b36,_0x52a58a){return function(_0xa6cab){_0x52a58a['emit'](_0x250b36,_0xa6cab);};}function removeListener(_0x1619b1,_0x1dbc78){return function(){FaxInteractionEvents['removeListener'](_0x1619b1,_0x1dbc78);};}exports[_0x3b58('0x3')]=function(_0x49361d){for(var _0x11b210=0x0,_0x5dc019=events['length'];_0x11b210<_0x5dc019;_0x11b210++){var _0x18efb0=events[_0x11b210];var _0x257f78=createListener(_0x3b58('0x4')+_0x18efb0,_0x49361d);FaxInteractionEvents['on'](_0x18efb0,_0x257f78);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3e6cc10..79aa695 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 _0x6658=['../../config/environment','./faxInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6658,0x198));var _0x8665=function(_0x177fa0,_0x4eb882){_0x177fa0=_0x177fa0-0x0;var _0x44ca53=_0x6658[_0x177fa0];return _0x44ca53;};'use strict';var multer=require(_0x8665('0x0'));var util=require(_0x8665('0x1'));var path=require(_0x8665('0x2'));var timeout=require(_0x8665('0x3'));var express=require(_0x8665('0x4'));var router=express[_0x8665('0x5')]();var fs_extra=require(_0x8665('0x6'));var auth=require(_0x8665('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8665('0x8'));var controller=require(_0x8665('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8665('0xa')]);router[_0x8665('0xb')](_0x8665('0xc'),auth[_0x8665('0xd')](),controller[_0x8665('0xe')]);router[_0x8665('0xb')](_0x8665('0xf'),auth[_0x8665('0xd')](),controller['show']);router[_0x8665('0xb')](_0x8665('0x10'),auth[_0x8665('0xd')](),controller[_0x8665('0x11')]);router[_0x8665('0xb')](_0x8665('0x12'),auth[_0x8665('0xd')](),controller[_0x8665('0x13')]);router[_0x8665('0x14')]('/',auth[_0x8665('0xd')](),controller[_0x8665('0x15')]);router[_0x8665('0x14')](_0x8665('0x10'),auth[_0x8665('0xd')](),controller['addMessage']);router[_0x8665('0x14')]('/:id/tags',auth[_0x8665('0xd')](),interaction[_0x8665('0x16')](_0x8665('0x17'),_0x8665('0x18')),controller[_0x8665('0x19')]);router[_0x8665('0x1a')]('/:id',auth[_0x8665('0xd')](),interaction[_0x8665('0x16')]('fax',_0x8665('0x1b')),controller['update']);router[_0x8665('0x1c')](_0x8665('0xf'),auth[_0x8665('0xd')](),interaction['tracked'](_0x8665('0x17'),_0x8665('0x1d')),controller['destroy']);router[_0x8665('0x1c')](_0x8665('0x1e'),auth[_0x8665('0xd')](),controller['removeTags']);module[_0x8665('0x1f')]=router; \ No newline at end of file +var _0x06ce=['/:id','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','get','/describe','describe','isAuthenticated','getMessages','download','create','post','/:id/messages','/:id/tags','tracked','faxinteraction:addtags','addTags','put'];(function(_0xb15637,_0x87eb64){var _0x1802d5=function(_0x33ea4){while(--_0x33ea4){_0xb15637['push'](_0xb15637['shift']());}};_0x1802d5(++_0x87eb64);}(_0x06ce,0xf7));var _0xe06c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x06ce[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xe06c('0x0'));var util=require(_0xe06c('0x1'));var path=require(_0xe06c('0x2'));var timeout=require(_0xe06c('0x3'));var express=require('express');var router=express[_0xe06c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe06c('0x5'));var config=require(_0xe06c('0x6'));var controller=require(_0xe06c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe06c('0x8')]);router[_0xe06c('0x9')](_0xe06c('0xa'),auth['isAuthenticated'](),controller[_0xe06c('0xb')]);router['get']('/:id',auth[_0xe06c('0xc')](),controller['show']);router['get']('/:id/messages',auth[_0xe06c('0xc')](),controller[_0xe06c('0xd')]);router[_0xe06c('0x9')]('/:id/download',auth[_0xe06c('0xc')](),controller[_0xe06c('0xe')]);router['post']('/',auth[_0xe06c('0xc')](),controller[_0xe06c('0xf')]);router[_0xe06c('0x10')](_0xe06c('0x11'),auth[_0xe06c('0xc')](),controller['addMessage']);router[_0xe06c('0x10')](_0xe06c('0x12'),auth[_0xe06c('0xc')](),interaction[_0xe06c('0x13')]('fax',_0xe06c('0x14')),controller[_0xe06c('0x15')]);router[_0xe06c('0x16')](_0xe06c('0x17'),auth[_0xe06c('0xc')](),interaction[_0xe06c('0x13')]('fax',_0xe06c('0x18')),controller[_0xe06c('0x19')]);router[_0xe06c('0x1a')](_0xe06c('0x17'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xe06c('0x1b')),controller['destroy']);router[_0xe06c('0x1a')](_0xe06c('0x12'),auth[_0xe06c('0xc')](),controller[_0xe06c('0x1c')]);module[_0xe06c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 7727783..bc6efd1 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 _0x3685=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x459335,_0x2e95dd){var _0x50f00b=function(_0x5ccdaf){while(--_0x5ccdaf){_0x459335['push'](_0x459335['shift']());}};_0x50f00b(++_0x2e95dd);}(_0x3685,0xf8));var _0x5368=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3685[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5368('0x0'));module['exports']={'body':{'type':Sequelize[_0x5368('0x1')](_0x5368('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5368('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5368('0x4')]('in',_0x5368('0x5')),'defaultValue':_0x5368('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x5368('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5368('0x6')]}}; \ No newline at end of file +var _0xcc73=['TEXT','ENUM','out','exports'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcc73[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x3cc7('0x0')]={'body':{'type':Sequelize[_0x3cc7('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3cc7('0x2')]('in','out'),'defaultValue':_0x3cc7('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8d2cd28..7765eb3 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 _0xdfa7=['length','body','find','params','describe','fax-interactions','read','UserId','user','agent','get','FaxInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','fax','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','format','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','attachments','Attachment','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','count','set','json','apply','reject','save','update','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show'];(function(_0x25beef,_0x387b1d){var _0x55e09c=function(_0x1231ef){while(--_0x1231ef){_0x25beef['push'](_0x25beef['shift']());}};_0x55e09c(++_0x387b1d);}(_0xdfa7,0x1df));var _0x7dfa=function(_0x589821,_0x36c809){_0x589821=_0x589821-0x0;var _0x227f19=_0xdfa7[_0x589821];return _0x227f19;};'use strict';var emlformat=require(_0x7dfa('0x0'));var rimraf=require(_0x7dfa('0x1'));var zipdir=require(_0x7dfa('0x2'));var jsonpatch=require(_0x7dfa('0x3'));var rp=require(_0x7dfa('0x4'));var moment=require(_0x7dfa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7dfa('0x6'));var util=require(_0x7dfa('0x7'));var path=require(_0x7dfa('0x8'));var sox=require(_0x7dfa('0x9'));var csv=require(_0x7dfa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dfa('0xb'));var squel=require(_0x7dfa('0xc'));var crypto=require('crypto');var jsforce=require(_0x7dfa('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7dfa('0xe'));var Papa=require(_0x7dfa('0xf'));var Redis=require('ioredis');var authService=require(_0x7dfa('0x10'));var qs=require(_0x7dfa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7dfa('0x12'));var logger=require(_0x7dfa('0x13'))(_0x7dfa('0x14'));var utils=require('../../config/utils');var config=require(_0x7dfa('0x15'));var licenseUtil=require(_0x7dfa('0x16'));var db=require(_0x7dfa('0x17'))['db'];config[_0x7dfa('0x18')]=_['defaults'](config[_0x7dfa('0x18')],{'host':_0x7dfa('0x19'),'port':0x18eb});var socket=require(_0x7dfa('0x1a'))(new Redis(config[_0x7dfa('0x18')]));require(_0x7dfa('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x7dfa('0x1c')][_0x7dfa('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7c4c52,_0x16b040,_0x14ab38,_0x59e5a5){return new BPromise(function(_0x2f7d6,_0xca077b){var _0x1636f1=_0x59e5a5||client;return _0x1636f1[_0x7dfa('0x1e')](_0x7c4c52,_0x14ab38)[_0x7dfa('0x1f')](function(_0x460913){logger[_0x7dfa('0x20')](_0x7dfa('0x21'),_0x16b040,'request\x20sent');logger[_0x7dfa('0x22')](_0x7dfa('0x23'),_0x16b040,_0x7dfa('0x24'),JSON[_0x7dfa('0x25')](_0x460913));if(_0x460913['error']){if(_0x460913[_0x7dfa('0x26')][_0x7dfa('0x27')]===0x1f4){logger[_0x7dfa('0x26')]('FaxMessage,\x20%s,\x20%s',_0x16b040,_0x460913[_0x7dfa('0x26')][_0x7dfa('0x28')]);return _0xca077b(_0x460913['error'][_0x7dfa('0x28')]);}logger['error'](_0x7dfa('0x21'),_0x16b040,_0x460913['error']['message']);return _0x2f7d6(_0x460913[_0x7dfa('0x26')][_0x7dfa('0x28')]);}else{logger[_0x7dfa('0x20')](_0x7dfa('0x21'),_0x16b040,_0x7dfa('0x24'));_0x2f7d6(_0x460913[_0x7dfa('0x29')][_0x7dfa('0x28')]);}})[_0x7dfa('0x2a')](function(_0x380281){logger[_0x7dfa('0x26')](_0x7dfa('0x21'),_0x16b040,_0x380281);_0xca077b(_0x380281);});});}function respondWithStatusCode(_0x9506c8,_0x37fc81){_0x37fc81=_0x37fc81||0xcc;return function(_0x56e19b){if(_0x56e19b){return _0x9506c8[_0x7dfa('0x2b')](_0x37fc81);}return _0x9506c8[_0x7dfa('0x2c')](_0x37fc81)[_0x7dfa('0x2d')]();};}function respondWithResult(_0x222cab,_0x31cbdd){_0x31cbdd=_0x31cbdd||0xc8;return function(_0x204e46){if(_0x204e46){return _0x222cab['status'](_0x31cbdd)['json'](_0x204e46);}};}function respondWithFilteredResult(_0x5156bf,_0x2a3339){return function(_0x3d55b7){if(_0x3d55b7){var _0x235a0b=typeof _0x2a3339[_0x7dfa('0x2e')]==='undefined'&&typeof _0x2a3339[_0x7dfa('0x2f')]==='undefined';var _0x4628af=_0x3d55b7[_0x7dfa('0x30')];var _0x4dae03=_0x235a0b?0x0:_0x2a3339[_0x7dfa('0x2e')];var _0x9feff=_0x235a0b?_0x3d55b7[_0x7dfa('0x30')]:_0x2a3339[_0x7dfa('0x2e')]+_0x2a3339[_0x7dfa('0x2f')];var _0x313a11;if(_0x9feff>=_0x4628af){_0x9feff=_0x4628af;_0x313a11=0xc8;}else{_0x313a11=0xce;}_0x5156bf['status'](_0x313a11);return _0x5156bf[_0x7dfa('0x31')]('Content-Range',_0x4dae03+'-'+_0x9feff+'/'+_0x4628af)[_0x7dfa('0x32')](_0x3d55b7);}return null;};}function patchUpdates(_0x15b275){return function(_0x4f8946){try{jsonpatch[_0x7dfa('0x33')](_0x4f8946,_0x15b275,!![]);}catch(_0x3cd6b3){return BPromise[_0x7dfa('0x34')](_0x3cd6b3);}return _0x4f8946[_0x7dfa('0x35')]();};}function saveUpdates(_0x4f7f5e,_0x296e0d){return function(_0x518eb2){if(_0x518eb2){return _0x518eb2[_0x7dfa('0x36')](_0x4f7f5e)[_0x7dfa('0x1f')](function(_0x4d38a7){return _0x4d38a7;});}return null;};}function removeEntity(_0x112380,_0x6df5bb){return function(_0x184ec5){if(_0x184ec5){return _0x184ec5[_0x7dfa('0x37')]()[_0x7dfa('0x1f')](function(){_0x112380[_0x7dfa('0x2c')](0xcc)[_0x7dfa('0x2d')]();});}};}function handleEntityNotFound(_0x22ea29,_0x5244ba){return function(_0x2d14be){if(!_0x2d14be){_0x22ea29[_0x7dfa('0x2b')](0x194);}return _0x2d14be;};}function handleError(_0x33634c,_0x474f5a){_0x474f5a=_0x474f5a||0x1f4;return function(_0x4dba52){logger[_0x7dfa('0x26')](_0x4dba52['stack']);if(_0x4dba52[_0x7dfa('0x38')]){delete _0x4dba52['name'];}_0x33634c[_0x7dfa('0x2c')](_0x474f5a)[_0x7dfa('0x39')](_0x4dba52);};}exports[_0x7dfa('0x3a')]=function(_0x33bfe1,_0x4b041c){var _0x130271={},_0x26b801={},_0xf3f857={'count':0x0,'rows':[]};var _0x56703e=_[_0x7dfa('0x3b')](db[_0x7dfa('0x3c')][_0x7dfa('0x3d')],function(_0xbfe721){return{'name':_0xbfe721[_0x7dfa('0x3e')],'type':_0xbfe721['type']['key']};});_0x26b801[_0x7dfa('0x3f')]=_[_0x7dfa('0x3b')](_0x56703e,_0x7dfa('0x38'));_0x26b801[_0x7dfa('0x40')]=_[_0x7dfa('0x41')](_0x33bfe1['query']);_0x26b801[_0x7dfa('0x42')]=_['intersection'](_0x26b801[_0x7dfa('0x3f')],_0x26b801['query']);_0x130271[_0x7dfa('0x43')]=_[_0x7dfa('0x44')](_0x26b801['model'],qs['fields'](_0x33bfe1[_0x7dfa('0x40')][_0x7dfa('0x45')]));_0x130271[_0x7dfa('0x43')]=_0x130271[_0x7dfa('0x43')]['length']?_0x130271[_0x7dfa('0x43')]:_0x26b801[_0x7dfa('0x3f')];if(!_0x33bfe1[_0x7dfa('0x40')][_0x7dfa('0x46')](_0x7dfa('0x47'))){_0x130271['limit']=qs[_0x7dfa('0x2f')](_0x33bfe1['query']['limit']);_0x130271[_0x7dfa('0x2e')]=qs[_0x7dfa('0x2e')](_0x33bfe1['query']['offset']);}_0x130271[_0x7dfa('0x48')]=qs['sort'](_0x33bfe1[_0x7dfa('0x40')][_0x7dfa('0x49')]);_0x130271[_0x7dfa('0x4a')]=qs[_0x7dfa('0x42')](_[_0x7dfa('0x4b')](_0x33bfe1[_0x7dfa('0x40')],_0x26b801[_0x7dfa('0x42')]),_0x56703e);if(_0x33bfe1[_0x7dfa('0x40')][_0x7dfa('0x4c')]){_0x130271[_0x7dfa('0x4a')]=_[_0x7dfa('0x4d')](_0x130271[_0x7dfa('0x4a')],{'$or':_[_0x7dfa('0x3b')](_0x56703e,function(_0x3d0260){if(_0x3d0260[_0x7dfa('0x4e')]!==_0x7dfa('0x4f')){var _0x18b1a5={};_0x18b1a5[_0x3d0260[_0x7dfa('0x38')]]={'$like':'%'+_0x33bfe1['query']['filter']+'%'};return _0x18b1a5;}})});}_0x130271=_[_0x7dfa('0x4d')]({},_0x130271,_0x33bfe1[_0x7dfa('0x50')]);var _0x50ff5d={'where':_0x130271['where']};return db[_0x7dfa('0x3c')][_0x7dfa('0x30')](_0x50ff5d)[_0x7dfa('0x1f')](function(_0x203146){_0xf3f857[_0x7dfa('0x30')]=_0x203146;if(_0x33bfe1[_0x7dfa('0x40')][_0x7dfa('0x51')]){_0x130271[_0x7dfa('0x52')]=[{'all':!![]}];}return db[_0x7dfa('0x3c')]['findAll'](_0x130271);})[_0x7dfa('0x1f')](function(_0x5f1593){_0xf3f857[_0x7dfa('0x53')]=_0x5f1593;return _0xf3f857;})[_0x7dfa('0x1f')](respondWithFilteredResult(_0x4b041c,_0x130271))['catch'](handleError(_0x4b041c,null));};exports[_0x7dfa('0x54')]=function(_0x1376c9,_0x496904){var _0x5035da={'raw':!![],'where':{'id':_0x1376c9['params']['id']}},_0x121437={};_0x121437[_0x7dfa('0x3f')]=_['keys'](db[_0x7dfa('0x3c')]['rawAttributes']);_0x121437['query']=_['keys'](_0x1376c9[_0x7dfa('0x40')]);_0x121437[_0x7dfa('0x42')]=_[_0x7dfa('0x44')](_0x121437[_0x7dfa('0x3f')],_0x121437[_0x7dfa('0x40')]);_0x5035da[_0x7dfa('0x43')]=_[_0x7dfa('0x44')](_0x121437[_0x7dfa('0x3f')],qs['fields'](_0x1376c9[_0x7dfa('0x40')]['fields']));_0x5035da['attributes']=_0x5035da[_0x7dfa('0x43')][_0x7dfa('0x55')]?_0x5035da[_0x7dfa('0x43')]:_0x121437[_0x7dfa('0x3f')];if(_0x1376c9[_0x7dfa('0x40')][_0x7dfa('0x51')]){_0x5035da[_0x7dfa('0x52')]=[{'all':!![]}];}_0x5035da=_['merge']({},_0x5035da,_0x1376c9['options']);return db[_0x7dfa('0x3c')]['find'](_0x5035da)['then'](handleEntityNotFound(_0x496904,null))[_0x7dfa('0x1f')](respondWithResult(_0x496904,null))[_0x7dfa('0x2a')](handleError(_0x496904,null));};exports['update']=function(_0x2c27e9,_0x21df93){if(_0x2c27e9['body']['id']){delete _0x2c27e9[_0x7dfa('0x56')]['id'];}return db[_0x7dfa('0x3c')][_0x7dfa('0x57')]({'where':{'id':_0x2c27e9[_0x7dfa('0x58')]['id']}})[_0x7dfa('0x1f')](handleEntityNotFound(_0x21df93,null))[_0x7dfa('0x1f')](saveUpdates(_0x2c27e9['body'],null))[_0x7dfa('0x1f')](respondWithResult(_0x21df93,null))[_0x7dfa('0x2a')](handleError(_0x21df93,null));};exports[_0x7dfa('0x37')]=function(_0x2ca552,_0x4f3171){return db[_0x7dfa('0x3c')][_0x7dfa('0x57')]({'where':{'id':_0x2ca552[_0x7dfa('0x58')]['id']}})['then'](handleEntityNotFound(_0x4f3171,null))['then'](removeEntity(_0x4f3171,null))['catch'](handleError(_0x4f3171,null));};exports[_0x7dfa('0x59')]=function(_0x1ef043,_0x4527fe){return db[_0x7dfa('0x3c')][_0x7dfa('0x59')]()[_0x7dfa('0x1f')](respondWithResult(_0x4527fe,null))['catch'](handleError(_0x4527fe,null));};var interaction_log=require(_0x7dfa('0x13'))(_0x7dfa('0x5a'));exports['accept']=function(_0x11f495,_0x5f21bc,_0x22593d){var _0x51d557={'agent':{},'channel':'fax'};if(_0x11f495[_0x7dfa('0x56')]['id']){delete _0x11f495[_0x7dfa('0x56')]['id'];}_0x11f495['body'][_0x7dfa('0x5b')]=!![];_0x11f495['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x11f495[_0x7dfa('0x56')][_0x7dfa('0x5c')]=_0x11f495['body'][_0x7dfa('0x5c')]||_0x11f495[_0x7dfa('0x5d')]['id'];_0x51d557[_0x7dfa('0x5e')]['id']=_0x11f495[_0x7dfa('0x56')]['UserId'];return db['FaxMessage'][_0x7dfa('0x57')]({'where':{'id':_0x11f495[_0x7dfa('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5f21bc,null))[_0x7dfa('0x1f')](saveUpdates(_0x11f495[_0x7dfa('0x56')],null))['then'](function(_0x1ed59d){if(_0x1ed59d){_0x51d557['message']=_0x1ed59d[_0x7dfa('0x5f')]({'plain':!![]});return db[_0x7dfa('0x60')][_0x7dfa('0x57')]({'where':{'id':_0x1ed59d['FaxInteractionId']}});}return null;})[_0x7dfa('0x1f')](handleEntityNotFound(_0x5f21bc,null))['then'](function(_0x133f18){if(_0x133f18){return _0x133f18[_0x7dfa('0x36')]({'UserId':_0x11f495[_0x7dfa('0x56')][_0x7dfa('0x5c')],'read1stAt':_[_0x7dfa('0x61')](_0x133f18['read1stAt'])?moment()['format'](_0x7dfa('0x62')):undefined});}return null;})['then'](function(_0x4450a7){if(_0x4450a7){_0x51d557[_0x7dfa('0x63')]=_0x4450a7[_0x7dfa('0x5f')]({'plain':!![]});interaction_log[_0x7dfa('0x20')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11f495[_0x7dfa('0x5d')]['id'],_0x11f495[_0x7dfa('0x5d')][_0x7dfa('0x38')],_0x11f495[_0x7dfa('0x5d')]['role'],_0x51d557[_0x7dfa('0x63')]['id'],_0x11f495[_0x7dfa('0x56')]?JSON[_0x7dfa('0x25')](_0x11f495[_0x7dfa('0x56')]):_0x7dfa('0x64'));return respondWithRpcPromise(_0x7dfa('0x65'),_0x7dfa('0x66'),_0x51d557);}return null;})[_0x7dfa('0x1f')](function(_0x389104){var _0x414316=_0x7dfa('0x67')+_0x389104[_0x7dfa('0x28')][_0x7dfa('0x68')];return db['sequelize'][_0x7dfa('0x40')](_0x414316,{'type':db[_0x7dfa('0x69')][_0x7dfa('0x6a')][_0x7dfa('0x6b')],'raw':!![]})[_0x7dfa('0x1f')](function(_0x4ef21a){return _0x4ef21a;});})[_0x7dfa('0x1f')](function(_0x444836){if(_0x444836){_0x51d557['message'][_0x7dfa('0x6c')]=_0x444836[0x0];if(!_0x11f495[_0x7dfa('0x56')][_0x7dfa('0x5c')])return;return db[_0x7dfa('0x6d')][_0x7dfa('0x57')]({'where':{'id':_0x11f495[_0x7dfa('0x56')][_0x7dfa('0x5c')],'role':_0x7dfa('0x5e')},'attributes':['id',_0x7dfa('0x38'),_0x7dfa('0x6e'),_0x7dfa('0x6f'),'internal'],'raw':!![]});}return null;})[_0x7dfa('0x1f')](function(_0xf16997){if(!_0xf16997)return null;_0x51d557['message']['agent']=_0xf16997;return _0x51d557;})[_0x7dfa('0x1f')](function(_0x4fb1cd){if(_0x4fb1cd){if(_0x11f495[_0x7dfa('0x56')][_0x7dfa('0x70')]){_0x51d557[_0x7dfa('0x28')]['interface']=util['format'](_0x7dfa('0x71'),_0x11f495['user'][_0x7dfa('0x38')]);_0x51d557['message'][_0x7dfa('0x72')]=_0x51d557['channel'];_0x51d557['message'][_0x7dfa('0x73')]=_0x51d557[_0x7dfa('0x72')];_0x51d557[_0x7dfa('0x28')][_0x7dfa('0x74')]=_0x7dfa('0x75');return respondWithRpcPromise('EventManager',_0x7dfa('0x76'),{'event':_0x7dfa('0x77'),'message':_0x51d557['message']},client9002)[_0x7dfa('0x1f')](function(){return _0x51d557;});}return _0x51d557;}return null;})[_0x7dfa('0x1f')](respondWithResult(_0x5f21bc,null))['catch'](handleError(_0x5f21bc,null));};var interaction_log=require(_0x7dfa('0x13'))(_0x7dfa('0x5a'));exports[_0x7dfa('0x34')]=function(_0x26afda,_0x17f546,_0x529cfc){var _0x1ada87={'agent':{},'channel':_0x7dfa('0x78')};if(_0x26afda[_0x7dfa('0x56')]['id']){delete _0x26afda[_0x7dfa('0x56')]['id'];}_0x26afda[_0x7dfa('0x56')][_0x7dfa('0x5c')]=_0x26afda['body'][_0x7dfa('0x5c')]||_0x26afda[_0x7dfa('0x5d')]['id'];_0x1ada87[_0x7dfa('0x5e')]['id']=_0x26afda[_0x7dfa('0x56')][_0x7dfa('0x5c')];return db[_0x7dfa('0x3c')][_0x7dfa('0x57')]({'where':{'id':_0x26afda['params']['id'],'UserId':null}})[_0x7dfa('0x1f')](handleEntityNotFound(_0x17f546,null))[_0x7dfa('0x1f')](function(_0x40bb28){if(_0x40bb28){_0x1ada87['message']=_0x40bb28[_0x7dfa('0x5f')]({'plain':!![]});return db[_0x7dfa('0x60')]['find']({'where':{'id':_0x40bb28[_0x7dfa('0x79')]}});}return null;})[_0x7dfa('0x1f')](handleEntityNotFound(_0x17f546,null))['then'](function(_0x583785){if(_0x583785){_0x1ada87[_0x7dfa('0x63')]=_0x583785[_0x7dfa('0x5f')]({'plain':!![]});interaction_log['info'](_0x7dfa('0x7a'),_0x26afda[_0x7dfa('0x5d')]['id'],_0x26afda[_0x7dfa('0x5d')][_0x7dfa('0x38')],_0x26afda['user'][_0x7dfa('0x7b')],_0x1ada87[_0x7dfa('0x63')]['id'],_0x26afda[_0x7dfa('0x56')]?JSON['stringify'](_0x26afda[_0x7dfa('0x56')]):_0x7dfa('0x64'));return respondWithRpcPromise(_0x7dfa('0x7c'),_0x7dfa('0x7d'),_0x1ada87);}return null;})[_0x7dfa('0x1f')](function(_0x4c5319){var _0x5c61b3=_0x7dfa('0x67')+_0x4c5319['message'][_0x7dfa('0x68')];return db['sequelize']['query'](_0x5c61b3,{'type':db['Sequelize'][_0x7dfa('0x6a')][_0x7dfa('0x6b')],'raw':!![]})[_0x7dfa('0x1f')](function(_0x5648ad){return _0x5648ad;});})['then'](function(_0x2c0167){if(_0x2c0167){_0x1ada87[_0x7dfa('0x28')][_0x7dfa('0x6c')]=_0x2c0167[0x0];if(!_0x26afda['body'][_0x7dfa('0x5c')])return;return db[_0x7dfa('0x6d')][_0x7dfa('0x57')]({'where':{'id':_0x26afda[_0x7dfa('0x56')][_0x7dfa('0x5c')],'role':_0x7dfa('0x5e')},'attributes':['id','name',_0x7dfa('0x6e'),_0x7dfa('0x6f'),'internal'],'raw':!![]});}return null;})[_0x7dfa('0x1f')](function(_0x1ff519){if(!_0x1ff519)return null;_0x1ada87[_0x7dfa('0x28')]['agent']=_0x1ff519;return _0x1ada87;})[_0x7dfa('0x1f')](function(_0x342889){if(_0x342889){_0x342889[_0x7dfa('0x28')]['interface']=util[_0x7dfa('0x7e')]('SIP/%s',_0x26afda[_0x7dfa('0x5d')][_0x7dfa('0x38')]);_0x342889['message'][_0x7dfa('0x72')]=_0x1ada87[_0x7dfa('0x72')];_0x342889['message'][_0x7dfa('0x73')]=_0x1ada87['channel'];_0x342889[_0x7dfa('0x28')][_0x7dfa('0x74')]=_0x7dfa('0x34');respondWithRpcPromise('EventManager',_0x7dfa('0x76'),{'event':'rejectmessage','message':_0x342889[_0x7dfa('0x28')]},client9002);return _0x1ada87;}return null;})['then'](respondWithResult(_0x17f546,null))[_0x7dfa('0x2a')](handleError(_0x17f546,null));};exports[_0x7dfa('0x7f')]=function(_0x230106,_0x9f93fd){var _0x319e6f;return db['FaxMessage'][_0x7dfa('0x7f')](_0x230106[_0x7dfa('0x56')],{})[_0x7dfa('0x1f')](function(_0x440109){_0x319e6f=_0x440109;return db[_0x7dfa('0x80')]['findOne']({'where':{'id':_0x319e6f[_0x7dfa('0x68')]}});})['then'](function(_0x484c46){if(_[_0x7dfa('0x61')](_0x484c46)){return;}else{_0x319e6f[_0x7dfa('0x78')]=_0x484c46[_0x7dfa('0x78')];return db['Attachment'][_0x7dfa('0x81')]({'where':{'id':_0x319e6f[_0x7dfa('0x82')]}});}})[_0x7dfa('0x1f')](function(_0x39aa40){return respondWithRpcPromise(_0x7dfa('0x83'),'SendFax',{'FaxAccountId':_[_0x7dfa('0x61')](_0x230106[_0x7dfa('0x56')])?undefined:_0x230106[_0x7dfa('0x56')][_0x7dfa('0x84')],'path':_[_0x7dfa('0x61')](_0x39aa40)?undefined:util[_0x7dfa('0x7e')](_0x7dfa('0x85'),_0x39aa40[_0x7dfa('0x86')]),'fax':_[_0x7dfa('0x61')](_0x319e6f[_0x7dfa('0x78')])?undefined:_0x319e6f['fax'],'AttachmentId':_0x319e6f[_0x7dfa('0x82')]},client9002);})[_0x7dfa('0x1f')](respondWithResult(_0x9f93fd,0xc9))[_0x7dfa('0x2a')](handleError(_0x9f93fd,null));};exports[_0x7dfa('0x87')]=function(_0x5ee7c5,_0x2f35c6){var _0x26f998=path['join'](config[_0x7dfa('0x88')],_0x7dfa('0x89'),'files',_0x7dfa('0x8a'));return db[_0x7dfa('0x3c')][_0x7dfa('0x57')]({'where':{'id':_0x5ee7c5[_0x7dfa('0x58')]['id']},'include':[{'model':db[_0x7dfa('0x8b')],'as':_0x7dfa('0x8b')}]})[_0x7dfa('0x1f')](handleEntityNotFound(_0x2f35c6,null))[_0x7dfa('0x1f')](function(_0x260a4a){if(_0x260a4a){return _0x2f35c6[_0x7dfa('0x87')](path[_0x7dfa('0x8c')](_0x26f998,_0x260a4a[_0x7dfa('0x8b')][_0x7dfa('0x86')]));}})['catch'](handleError(_0x2f35c6,null));}; \ No newline at end of file +var _0x2773=['isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','server','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','map','FaxMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','nolimit','order','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','params','intersection','length','find','body','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','User','SIP/%s','rejectmessage','create','CmContact','findOne'];(function(_0x154b4c,_0xa38e2){var _0x100586=function(_0x2912a8){while(--_0x2912a8){_0x154b4c['push'](_0x154b4c['shift']());}};_0x100586(++_0xa38e2);}(_0x2773,0x1c9));var _0x3277=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2773[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x3277('0x0'));var rimraf=require(_0x3277('0x1'));var zipdir=require(_0x3277('0x2'));var jsonpatch=require(_0x3277('0x3'));var rp=require(_0x3277('0x4'));var moment=require(_0x3277('0x5'));var BPromise=require(_0x3277('0x6'));var Mustache=require(_0x3277('0x7'));var util=require(_0x3277('0x8'));var path=require(_0x3277('0x9'));var sox=require(_0x3277('0xa'));var csv=require(_0x3277('0xb'));var ejs=require(_0x3277('0xc'));var fs=require('fs');var fs_extra=require(_0x3277('0xd'));var _=require(_0x3277('0xe'));var squel=require(_0x3277('0xf'));var crypto=require(_0x3277('0x10'));var jsforce=require(_0x3277('0x11'));var deskjs=require(_0x3277('0x12'));var toCsv=require('to-csv');var querystring=require(_0x3277('0x13'));var Papa=require(_0x3277('0x14'));var Redis=require(_0x3277('0x15'));var authService=require(_0x3277('0x16'));var qs=require(_0x3277('0x17'));var as=require(_0x3277('0x18'));var hardwareService=require(_0x3277('0x19'));var logger=require(_0x3277('0x1a'))('api');var utils=require(_0x3277('0x1b'));var config=require(_0x3277('0x1c'));var licenseUtil=require(_0x3277('0x1d'));var db=require(_0x3277('0x1e'))['db'];config[_0x3277('0x1f')]=_[_0x3277('0x20')](config['redis'],{'host':_0x3277('0x21'),'port':0x18eb});var socket=require(_0x3277('0x22'))(new Redis(config['redis']));require(_0x3277('0x23'))[_0x3277('0x24')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3277('0x25')][_0x3277('0x26')]({'port':0x232c});var client9002=jayson[_0x3277('0x25')][_0x3277('0x26')]({'port':0x232a});function respondWithRpcPromise(_0x192eab,_0x2684e6,_0x20cfa7,_0x53dd04){return new BPromise(function(_0x20d241,_0x355bfe){var _0xf24e44=_0x53dd04||client;return _0xf24e44[_0x3277('0x27')](_0x192eab,_0x20cfa7)[_0x3277('0x28')](function(_0x2a884c){logger[_0x3277('0x29')](_0x3277('0x2a'),_0x2684e6,_0x3277('0x2b'));logger[_0x3277('0x2c')](_0x3277('0x2d'),_0x2684e6,_0x3277('0x2b'),JSON[_0x3277('0x2e')](_0x2a884c));if(_0x2a884c['error']){if(_0x2a884c['error'][_0x3277('0x2f')]===0x1f4){logger[_0x3277('0x30')](_0x3277('0x2a'),_0x2684e6,_0x2a884c['error'][_0x3277('0x31')]);return _0x355bfe(_0x2a884c['error'][_0x3277('0x31')]);}logger['error'](_0x3277('0x2a'),_0x2684e6,_0x2a884c[_0x3277('0x30')][_0x3277('0x31')]);return _0x20d241(_0x2a884c[_0x3277('0x30')][_0x3277('0x31')]);}else{logger['info'](_0x3277('0x2a'),_0x2684e6,_0x3277('0x2b'));_0x20d241(_0x2a884c[_0x3277('0x32')]['message']);}})[_0x3277('0x33')](function(_0x1ff00d){logger[_0x3277('0x30')](_0x3277('0x2a'),_0x2684e6,_0x1ff00d);_0x355bfe(_0x1ff00d);});});}function respondWithStatusCode(_0x287115,_0x9e7bda){_0x9e7bda=_0x9e7bda||0xcc;return function(_0x90ac28){if(_0x90ac28){return _0x287115['sendStatus'](_0x9e7bda);}return _0x287115[_0x3277('0x34')](_0x9e7bda)['end']();};}function respondWithResult(_0x420fd2,_0x34efcd){_0x34efcd=_0x34efcd||0xc8;return function(_0x1c2cb3){if(_0x1c2cb3){return _0x420fd2['status'](_0x34efcd)[_0x3277('0x35')](_0x1c2cb3);}};}function respondWithFilteredResult(_0x5d64e7,_0x686869){return function(_0x14cabb){if(_0x14cabb){var _0x2d419b=typeof _0x686869[_0x3277('0x36')]===_0x3277('0x37')&&typeof _0x686869[_0x3277('0x38')]===_0x3277('0x37');var _0x2d99ef=_0x14cabb[_0x3277('0x39')];var _0x2ef1c5=_0x2d419b?0x0:_0x686869[_0x3277('0x36')];var _0x43ca3f=_0x2d419b?_0x14cabb['count']:_0x686869[_0x3277('0x36')]+_0x686869[_0x3277('0x38')];var _0x1c6815;if(_0x43ca3f>=_0x2d99ef){_0x43ca3f=_0x2d99ef;_0x1c6815=0xc8;}else{_0x1c6815=0xce;}_0x5d64e7[_0x3277('0x34')](_0x1c6815);return _0x5d64e7['set'](_0x3277('0x3a'),_0x2ef1c5+'-'+_0x43ca3f+'/'+_0x2d99ef)[_0x3277('0x35')](_0x14cabb);}return null;};}function patchUpdates(_0x5225e7){return function(_0x2e2c55){try{jsonpatch['apply'](_0x2e2c55,_0x5225e7,!![]);}catch(_0x1251f1){return BPromise[_0x3277('0x3b')](_0x1251f1);}return _0x2e2c55[_0x3277('0x3c')]();};}function saveUpdates(_0x3d748a,_0x378978){return function(_0x23717e){if(_0x23717e){return _0x23717e[_0x3277('0x3d')](_0x3d748a)[_0x3277('0x28')](function(_0x148669){return _0x148669;});}return null;};}function removeEntity(_0x511a43,_0x119a3c){return function(_0x5164a6){if(_0x5164a6){return _0x5164a6[_0x3277('0x3e')]()[_0x3277('0x28')](function(){_0x511a43[_0x3277('0x34')](0xcc)[_0x3277('0x3f')]();});}};}function handleEntityNotFound(_0x337fac,_0x2e9f64){return function(_0x16d4f6){if(!_0x16d4f6){_0x337fac[_0x3277('0x40')](0x194);}return _0x16d4f6;};}function handleError(_0x56ea39,_0x300ff7){_0x300ff7=_0x300ff7||0x1f4;return function(_0x4716d1){logger[_0x3277('0x30')](_0x4716d1[_0x3277('0x41')]);if(_0x4716d1['name']){delete _0x4716d1[_0x3277('0x42')];}_0x56ea39[_0x3277('0x34')](_0x300ff7)[_0x3277('0x43')](_0x4716d1);};}exports['index']=function(_0x94ea4b,_0x5178b4){var _0x4da385={},_0x52c2e2={},_0x1b80a1={'count':0x0,'rows':[]};var _0x375945=_[_0x3277('0x44')](db[_0x3277('0x45')][_0x3277('0x46')],function(_0x366885){return{'name':_0x366885[_0x3277('0x47')],'type':_0x366885['type'][_0x3277('0x48')]};});_0x52c2e2[_0x3277('0x49')]=_[_0x3277('0x44')](_0x375945,_0x3277('0x42'));_0x52c2e2[_0x3277('0x4a')]=_[_0x3277('0x4b')](_0x94ea4b[_0x3277('0x4a')]);_0x52c2e2[_0x3277('0x4c')]=_['intersection'](_0x52c2e2['model'],_0x52c2e2[_0x3277('0x4a')]);_0x4da385[_0x3277('0x4d')]=_['intersection'](_0x52c2e2[_0x3277('0x49')],qs[_0x3277('0x4e')](_0x94ea4b[_0x3277('0x4a')][_0x3277('0x4e')]));_0x4da385[_0x3277('0x4d')]=_0x4da385[_0x3277('0x4d')]['length']?_0x4da385['attributes']:_0x52c2e2[_0x3277('0x49')];if(!_0x94ea4b[_0x3277('0x4a')]['hasOwnProperty'](_0x3277('0x4f'))){_0x4da385[_0x3277('0x38')]=qs['limit'](_0x94ea4b[_0x3277('0x4a')]['limit']);_0x4da385[_0x3277('0x36')]=qs[_0x3277('0x36')](_0x94ea4b[_0x3277('0x4a')][_0x3277('0x36')]);}_0x4da385[_0x3277('0x50')]=qs['sort'](_0x94ea4b['query']['sort']);_0x4da385['where']=qs['filters'](_['pick'](_0x94ea4b[_0x3277('0x4a')],_0x52c2e2[_0x3277('0x4c')]),_0x375945);if(_0x94ea4b[_0x3277('0x4a')][_0x3277('0x51')]){_0x4da385[_0x3277('0x52')]=_[_0x3277('0x53')](_0x4da385[_0x3277('0x52')],{'$or':_[_0x3277('0x44')](_0x375945,function(_0x2a581a){if(_0x2a581a[_0x3277('0x54')]!==_0x3277('0x55')){var _0x2655ce={};_0x2655ce[_0x2a581a[_0x3277('0x42')]]={'$like':'%'+_0x94ea4b[_0x3277('0x4a')]['filter']+'%'};return _0x2655ce;}})});}_0x4da385=_[_0x3277('0x53')]({},_0x4da385,_0x94ea4b[_0x3277('0x56')]);var _0xc7942d={'where':_0x4da385[_0x3277('0x52')]};return db['FaxMessage'][_0x3277('0x39')](_0xc7942d)[_0x3277('0x28')](function(_0x2badb1){_0x1b80a1[_0x3277('0x39')]=_0x2badb1;if(_0x94ea4b[_0x3277('0x4a')][_0x3277('0x57')]){_0x4da385[_0x3277('0x58')]=[{'all':!![]}];}return db[_0x3277('0x45')]['findAll'](_0x4da385);})[_0x3277('0x28')](function(_0x2e7cb7){_0x1b80a1[_0x3277('0x59')]=_0x2e7cb7;return _0x1b80a1;})[_0x3277('0x28')](respondWithFilteredResult(_0x5178b4,_0x4da385))[_0x3277('0x33')](handleError(_0x5178b4,null));};exports['show']=function(_0xd3c656,_0x1561bc){var _0x1e3e62={'raw':!![],'where':{'id':_0xd3c656[_0x3277('0x5a')]['id']}},_0x4081e9={};_0x4081e9[_0x3277('0x49')]=_[_0x3277('0x4b')](db[_0x3277('0x45')][_0x3277('0x46')]);_0x4081e9[_0x3277('0x4a')]=_['keys'](_0xd3c656[_0x3277('0x4a')]);_0x4081e9['filters']=_[_0x3277('0x5b')](_0x4081e9[_0x3277('0x49')],_0x4081e9[_0x3277('0x4a')]);_0x1e3e62['attributes']=_[_0x3277('0x5b')](_0x4081e9[_0x3277('0x49')],qs[_0x3277('0x4e')](_0xd3c656[_0x3277('0x4a')]['fields']));_0x1e3e62[_0x3277('0x4d')]=_0x1e3e62['attributes'][_0x3277('0x5c')]?_0x1e3e62[_0x3277('0x4d')]:_0x4081e9[_0x3277('0x49')];if(_0xd3c656['query'][_0x3277('0x57')]){_0x1e3e62['include']=[{'all':!![]}];}_0x1e3e62=_[_0x3277('0x53')]({},_0x1e3e62,_0xd3c656[_0x3277('0x56')]);return db[_0x3277('0x45')][_0x3277('0x5d')](_0x1e3e62)[_0x3277('0x28')](handleEntityNotFound(_0x1561bc,null))[_0x3277('0x28')](respondWithResult(_0x1561bc,null))['catch'](handleError(_0x1561bc,null));};exports[_0x3277('0x3d')]=function(_0x1424e7,_0x2a384e){if(_0x1424e7[_0x3277('0x5e')]['id']){delete _0x1424e7['body']['id'];}return db['FaxMessage'][_0x3277('0x5d')]({'where':{'id':_0x1424e7[_0x3277('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2a384e,null))[_0x3277('0x28')](saveUpdates(_0x1424e7[_0x3277('0x5e')],null))['then'](respondWithResult(_0x2a384e,null))[_0x3277('0x33')](handleError(_0x2a384e,null));};exports['destroy']=function(_0x510ebc,_0x3f5e66){return db[_0x3277('0x45')]['find']({'where':{'id':_0x510ebc[_0x3277('0x5a')]['id']}})[_0x3277('0x28')](handleEntityNotFound(_0x3f5e66,null))[_0x3277('0x28')](removeEntity(_0x3f5e66,null))['catch'](handleError(_0x3f5e66,null));};exports[_0x3277('0x5f')]=function(_0x5d0691,_0x3cad97){return db[_0x3277('0x45')][_0x3277('0x5f')]()[_0x3277('0x28')](respondWithResult(_0x3cad97,null))['catch'](handleError(_0x3cad97,null));};var interaction_log=require(_0x3277('0x1a'))('fax-interactions');exports[_0x3277('0x60')]=function(_0x37b9e3,_0x7d8ee1,_0x12ef06){var _0x2e71ce={'agent':{},'channel':_0x3277('0x61')};if(_0x37b9e3[_0x3277('0x5e')]['id']){delete _0x37b9e3['body']['id'];}_0x37b9e3[_0x3277('0x5e')][_0x3277('0x62')]=!![];_0x37b9e3['body'][_0x3277('0x63')]=moment()[_0x3277('0x64')](_0x3277('0x65'));_0x37b9e3[_0x3277('0x5e')][_0x3277('0x66')]=_0x37b9e3[_0x3277('0x5e')][_0x3277('0x66')]||_0x37b9e3[_0x3277('0x67')]['id'];_0x2e71ce[_0x3277('0x68')]['id']=_0x37b9e3[_0x3277('0x5e')][_0x3277('0x66')];return db[_0x3277('0x45')][_0x3277('0x5d')]({'where':{'id':_0x37b9e3[_0x3277('0x5a')]['id'],'UserId':null}})[_0x3277('0x28')](handleEntityNotFound(_0x7d8ee1,null))[_0x3277('0x28')](saveUpdates(_0x37b9e3['body'],null))['then'](function(_0x478bfb){if(_0x478bfb){_0x2e71ce[_0x3277('0x31')]=_0x478bfb[_0x3277('0x69')]({'plain':!![]});return db[_0x3277('0x6a')][_0x3277('0x5d')]({'where':{'id':_0x478bfb[_0x3277('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x7d8ee1,null))[_0x3277('0x28')](function(_0x4bb914){if(_0x4bb914){return _0x4bb914[_0x3277('0x3d')]({'UserId':_0x37b9e3['body'][_0x3277('0x66')],'read1stAt':_['isNil'](_0x4bb914[_0x3277('0x6c')])?moment()[_0x3277('0x64')](_0x3277('0x65')):undefined});}return null;})[_0x3277('0x28')](function(_0x204cc6){if(_0x204cc6){_0x2e71ce[_0x3277('0x6d')]=_0x204cc6[_0x3277('0x69')]({'plain':!![]});interaction_log[_0x3277('0x29')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x37b9e3[_0x3277('0x67')]['id'],_0x37b9e3['user'][_0x3277('0x42')],_0x37b9e3[_0x3277('0x67')][_0x3277('0x6e')],_0x2e71ce[_0x3277('0x6d')]['id'],_0x37b9e3[_0x3277('0x5e')]?JSON[_0x3277('0x2e')](_0x37b9e3['body']):'null');return respondWithRpcPromise(_0x3277('0x6f'),_0x3277('0x70'),_0x2e71ce);}return null;})['then'](function(_0x15d973){var _0x471547=_0x3277('0x71')+_0x15d973['message']['ContactId'];return db[_0x3277('0x72')]['query'](_0x471547,{'type':db[_0x3277('0x73')]['QueryTypes'][_0x3277('0x74')],'raw':!![]})[_0x3277('0x28')](function(_0x6e1c80){return _0x6e1c80;});})['then'](function(_0x350f61){if(_0x350f61){_0x2e71ce[_0x3277('0x31')][_0x3277('0x75')]=_0x350f61[0x0];if(!_0x37b9e3[_0x3277('0x5e')]['UserId'])return;return db['User'][_0x3277('0x5d')]({'where':{'id':_0x37b9e3[_0x3277('0x5e')][_0x3277('0x66')],'role':_0x3277('0x68')},'attributes':['id',_0x3277('0x42'),_0x3277('0x76'),_0x3277('0x77'),_0x3277('0x78')],'raw':!![]});}return null;})[_0x3277('0x28')](function(_0x6a6b43){if(!_0x6a6b43)return null;_0x2e71ce[_0x3277('0x31')][_0x3277('0x68')]=_0x6a6b43;return _0x2e71ce;})['then'](function(_0x1fd9e6){if(_0x1fd9e6){if(_0x37b9e3[_0x3277('0x5e')][_0x3277('0x79')]){_0x2e71ce[_0x3277('0x31')][_0x3277('0x7a')]=util['format']('SIP/%s',_0x37b9e3[_0x3277('0x67')]['name']);_0x2e71ce[_0x3277('0x31')]['channel']=_0x2e71ce[_0x3277('0x7b')];_0x2e71ce[_0x3277('0x31')][_0x3277('0x7c')]=_0x2e71ce['channel'];_0x2e71ce[_0x3277('0x31')][_0x3277('0x7d')]=_0x3277('0x60');return respondWithRpcPromise(_0x3277('0x7e'),_0x3277('0x7e'),{'event':'acceptmessage','message':_0x2e71ce['message']},client9002)[_0x3277('0x28')](function(){return _0x2e71ce;});}return _0x2e71ce;}return null;})[_0x3277('0x28')](respondWithResult(_0x7d8ee1,null))['catch'](handleError(_0x7d8ee1,null));};var interaction_log=require('../../config/logger')(_0x3277('0x7f'));exports[_0x3277('0x3b')]=function(_0x1ab654,_0x24287b,_0x99c94f){var _0xbb7dfe={'agent':{},'channel':_0x3277('0x61')};if(_0x1ab654['body']['id']){delete _0x1ab654[_0x3277('0x5e')]['id'];}_0x1ab654['body']['UserId']=_0x1ab654[_0x3277('0x5e')]['UserId']||_0x1ab654[_0x3277('0x67')]['id'];_0xbb7dfe[_0x3277('0x68')]['id']=_0x1ab654[_0x3277('0x5e')][_0x3277('0x66')];return db[_0x3277('0x45')][_0x3277('0x5d')]({'where':{'id':_0x1ab654[_0x3277('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24287b,null))[_0x3277('0x28')](function(_0x3d0dba){if(_0x3d0dba){_0xbb7dfe[_0x3277('0x31')]=_0x3d0dba['get']({'plain':!![]});return db[_0x3277('0x6a')][_0x3277('0x5d')]({'where':{'id':_0x3d0dba[_0x3277('0x6b')]}});}return null;})[_0x3277('0x28')](handleEntityNotFound(_0x24287b,null))[_0x3277('0x28')](function(_0x598f05){if(_0x598f05){_0xbb7dfe['interaction']=_0x598f05[_0x3277('0x69')]({'plain':!![]});interaction_log[_0x3277('0x29')](_0x3277('0x80'),_0x1ab654['user']['id'],_0x1ab654[_0x3277('0x67')][_0x3277('0x42')],_0x1ab654['user']['role'],_0xbb7dfe['interaction']['id'],_0x1ab654[_0x3277('0x5e')]?JSON['stringify'](_0x1ab654[_0x3277('0x5e')]):_0x3277('0x81'));return respondWithRpcPromise(_0x3277('0x82'),_0x3277('0x83'),_0xbb7dfe);}return null;})[_0x3277('0x28')](function(_0xcc9805){var _0x318fdb=_0x3277('0x71')+_0xcc9805['message'][_0x3277('0x84')];return db['sequelize']['query'](_0x318fdb,{'type':db[_0x3277('0x73')]['QueryTypes'][_0x3277('0x74')],'raw':!![]})[_0x3277('0x28')](function(_0x15a64d){return _0x15a64d;});})[_0x3277('0x28')](function(_0x494265){if(_0x494265){_0xbb7dfe['message'][_0x3277('0x75')]=_0x494265[0x0];if(!_0x1ab654[_0x3277('0x5e')][_0x3277('0x66')])return;return db[_0x3277('0x85')][_0x3277('0x5d')]({'where':{'id':_0x1ab654[_0x3277('0x5e')]['UserId'],'role':_0x3277('0x68')},'attributes':['id',_0x3277('0x42'),'fullname','email',_0x3277('0x78')],'raw':!![]});}return null;})[_0x3277('0x28')](function(_0x5e1ea4){if(!_0x5e1ea4)return null;_0xbb7dfe['message'][_0x3277('0x68')]=_0x5e1ea4;return _0xbb7dfe;})[_0x3277('0x28')](function(_0x3b16df){if(_0x3b16df){_0x3b16df[_0x3277('0x31')][_0x3277('0x7a')]=util[_0x3277('0x64')](_0x3277('0x86'),_0x1ab654[_0x3277('0x67')]['name']);_0x3b16df[_0x3277('0x31')][_0x3277('0x7b')]=_0xbb7dfe[_0x3277('0x7b')];_0x3b16df['message'][_0x3277('0x7c')]=_0xbb7dfe[_0x3277('0x7b')];_0x3b16df[_0x3277('0x31')][_0x3277('0x7d')]=_0x3277('0x3b');respondWithRpcPromise('EventManager',_0x3277('0x7e'),{'event':_0x3277('0x87'),'message':_0x3b16df[_0x3277('0x31')]},client9002);return _0xbb7dfe;}return null;})['then'](respondWithResult(_0x24287b,null))[_0x3277('0x33')](handleError(_0x24287b,null));};exports[_0x3277('0x88')]=function(_0x49ddb0,_0x1d8382){var _0x4b8430;return db[_0x3277('0x45')]['create'](_0x49ddb0[_0x3277('0x5e')],{})[_0x3277('0x28')](function(_0x1e4a92){_0x4b8430=_0x1e4a92;return db[_0x3277('0x89')][_0x3277('0x8a')]({'where':{'id':_0x4b8430['ContactId']}});})[_0x3277('0x28')](function(_0xb9511c){if(_[_0x3277('0x8b')](_0xb9511c)){return;}else{_0x4b8430[_0x3277('0x61')]=_0xb9511c[_0x3277('0x61')];return db[_0x3277('0x8c')][_0x3277('0x8a')]({'where':{'id':_0x4b8430[_0x3277('0x8d')]}});}})[_0x3277('0x28')](function(_0x30dfeb){return respondWithRpcPromise(_0x3277('0x8e'),_0x3277('0x8e'),{'FaxAccountId':_['isNil'](_0x49ddb0[_0x3277('0x5e')])?undefined:_0x49ddb0[_0x3277('0x5e')][_0x3277('0x8f')],'path':_['isNil'](_0x30dfeb)?undefined:util[_0x3277('0x64')](_0x3277('0x90'),_0x30dfeb[_0x3277('0x91')]),'fax':_[_0x3277('0x8b')](_0x4b8430[_0x3277('0x61')])?undefined:_0x4b8430[_0x3277('0x61')],'AttachmentId':_0x4b8430[_0x3277('0x8d')]},client9002);})['then'](respondWithResult(_0x1d8382,0xc9))[_0x3277('0x33')](handleError(_0x1d8382,null));};exports['download']=function(_0x1e9c9f,_0x26a0db){var _0x427b8f=path[_0x3277('0x92')](config['root'],_0x3277('0x93'),'files','attachments');return db['FaxMessage'][_0x3277('0x5d')]({'where':{'id':_0x1e9c9f[_0x3277('0x5a')]['id']},'include':[{'model':db[_0x3277('0x8c')],'as':_0x3277('0x8c')}]})[_0x3277('0x28')](handleEntityNotFound(_0x26a0db,null))['then'](function(_0x59510e){if(_0x59510e){return _0x26a0db[_0x3277('0x94')](path['join'](_0x427b8f,_0x59510e['Attachment']['basename']));}})[_0x3277('0x33')](handleError(_0x26a0db,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 343546f..f98e0d6 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 _0x6337=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','FaxMessage'];(function(_0x404287,_0x335b0b){var _0x23e259=function(_0x2dc641){while(--_0x2dc641){_0x404287['push'](_0x404287['shift']());}};_0x23e259(++_0x335b0b);}(_0x6337,0x18a));var _0x7633=function(_0x6aee86,_0x4a9ba7){_0x6aee86=_0x6aee86-0x0;var _0x39b967=_0x6337[_0x6aee86];return _0x39b967;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7633('0x0'))['db'][_0x7633('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7633('0x2')](0x0);var events={'afterCreate':_0x7633('0x3'),'afterUpdate':_0x7633('0x4'),'afterDestroy':_0x7633('0x5')};function emitEvent(_0xf5dc52){return function(_0x3f476d,_0x2ccc60,_0x56f3ba){FaxMessageEvents[_0x7633('0x6')](_0xf5dc52+':'+_0x3f476d['id'],_0x3f476d);FaxMessageEvents[_0x7633('0x6')](_0xf5dc52,_0x3f476d);_0x56f3ba(null);};}for(var e in events){if(events[_0x7633('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7633('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x41d0=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update'];(function(_0x11d284,_0x3e67ef){var _0x275a7b=function(_0x5bb042){while(--_0x5bb042){_0x11d284['push'](_0x11d284['shift']());}};_0x275a7b(++_0x3e67ef);}(_0x41d0,0x1c6));var _0x041d=function(_0x5555c6,_0x3b388f){_0x5555c6=_0x5555c6-0x0;var _0x5e8dc5=_0x41d0[_0x5555c6];return _0x5e8dc5;};'use strict';var EventEmitter=require(_0x041d('0x0'));var FaxMessage=require(_0x041d('0x1'))['db'][_0x041d('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x041d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x041d('0x4'),'afterDestroy':_0x041d('0x5')};function emitEvent(_0x12e55d){return function(_0x397dad,_0x41e587,_0x3a22a4){FaxMessageEvents[_0x041d('0x6')](_0x12e55d+':'+_0x397dad['id'],_0x397dad);FaxMessageEvents[_0x041d('0x6')](_0x12e55d,_0x397dad);_0x3a22a4(null);};}for(var e in events){if(events[_0x041d('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x041d('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 624dfbb..df6843d 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 _0x82fb=['UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','out','secret','isNil'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x82fb,0x14c));var _0xb82f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x82fb[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xb82f('0x0'));var util=require(_0xb82f('0x1'));var logger=require('../../config/logger')(_0xb82f('0x2'));var moment=require(_0xb82f('0x3'));var BPromise=require(_0xb82f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb82f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb82f('0x6'));module[_0xb82f('0x7')]=function(_0x38c5d4,_0x3ece1b){return _0x38c5d4[_0xb82f('0x8')](_0xb82f('0x9'),attributes,{'tableName':_0xb82f('0xa'),'paranoid':![],'indexes':[{'name':_0xb82f('0xb'),'fields':[_0xb82f('0xc')],'type':_0xb82f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf689a7,_0x590708,_0x496952){var _0x1f97c4=_0x38c5d4[_0xb82f('0xe')];var _0x29acd6=_0xf689a7[_0xb82f('0xf')]({'plain':!![]});if(_0x29acd6[_0xb82f('0x10')]['toLowerCase']()==='in'||_0x29acd6[_0xb82f('0x10')]['toLowerCase']()===_0xb82f('0x11')&&!_0x29acd6[_0xb82f('0x12')]&&!_[_0xb82f('0x13')](_0x29acd6[_0xb82f('0x14')])){_0x1f97c4[_0xb82f('0x15')][_0xb82f('0x16')]({'where':{'id':_0x29acd6[_0xb82f('0x17')]}})[_0xb82f('0x18')](function(_0x5c1277){if(_0x5c1277){_0x5c1277[_0xb82f('0x19')]({'lastMsgAt':_0x29acd6[_0xb82f('0x1a')],'lastMsgDirection':_0x29acd6['direction'][_0xb82f('0x1b')]()});}})[_0xb82f('0x1c')](function(_0x3f5d06){console[_0xb82f('0x1d')](_0x3f5d06);});}_0x496952();}},'charset':_0xb82f('0x1e'),'collate':_0xb82f('0x1f')});}; \ No newline at end of file +var _0xa67d=['direction','toLowerCase','secret','isNil','UserId','findOne','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get'];(function(_0x46e23f,_0xda33d6){var _0x34e1ab=function(_0xfb25c4){while(--_0xfb25c4){_0x46e23f['push'](_0x46e23f['shift']());}};_0x34e1ab(++_0xda33d6);}(_0xa67d,0x143));var _0xda67=function(_0x5a36dd,_0x5b2d2c){_0x5a36dd=_0x5a36dd-0x0;var _0x15503d=_0xa67d[_0x5a36dd];return _0x15503d;};'use strict';var _=require(_0xda67('0x0'));var util=require(_0xda67('0x1'));var logger=require(_0xda67('0x2'))('api');var moment=require(_0xda67('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xda67('0x4'));var rimraf=require(_0xda67('0x5'));var config=require(_0xda67('0x6'));var attributes=require('./faxMessage.attributes');module[_0xda67('0x7')]=function(_0x48b866,_0x2384e8){return _0x48b866[_0xda67('0x8')](_0xda67('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xda67('0xa'),'fields':[_0xda67('0xb')],'type':_0xda67('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x259512,_0x4d3c19,_0x56ec52){var _0x5032fa=_0x48b866[_0xda67('0xd')];var _0xc98a44=_0x259512[_0xda67('0xe')]({'plain':!![]});if(_0xc98a44[_0xda67('0xf')][_0xda67('0x10')]()==='in'||_0xc98a44['direction']['toLowerCase']()==='out'&&!_0xc98a44[_0xda67('0x11')]&&!_[_0xda67('0x12')](_0xc98a44[_0xda67('0x13')])){_0x5032fa['FaxInteraction'][_0xda67('0x14')]({'where':{'id':_0xc98a44['FaxInteractionId']}})[_0xda67('0x15')](function(_0x1502b9){if(_0x1502b9){_0x1502b9['update']({'lastMsgAt':_0xc98a44[_0xda67('0x16')],'lastMsgDirection':_0xc98a44[_0xda67('0xf')][_0xda67('0x10')]()});}})['catch'](function(_0x51ad36){console[_0xda67('0x17')](_0x51ad36);});}_0x56ec52();}},'charset':_0xda67('0x18'),'collate':_0xda67('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 35efe3a..1f8afa2 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 _0xfd28=['message','info','catch','create','body','options','then','CreateFaxMessage','UpdateFaxMessage','FaxMessage','raw','where','attributes','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x224b46,_0xfdad54){var _0x23aa1e=function(_0x4e77d5){while(--_0x4e77d5){_0x224b46['push'](_0x224b46['shift']());}};_0x23aa1e(++_0xfdad54);}(_0xfd28,0x148));var _0x8fd2=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0xfd28[_0xa3463d];return _0x50fd67;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});config[_0x8fd2('0xa')]=_['defaults'](config['redis'],{'host':_0x8fd2('0xb'),'port':0x18eb});var socket=require(_0x8fd2('0xc'))(new Redis(config[_0x8fd2('0xa')]));require('./faxMessage.socket')[_0x8fd2('0xd')](socket);function respondWithRpcPromise(_0x49ca87,_0x2842f3,_0x5aabf0){return new BPromise(function(_0x34ae5c,_0x4fdf0b){return client[_0x8fd2('0xe')](_0x49ca87,_0x5aabf0)['then'](function(_0x1b6558){logger['info'](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));logger[_0x8fd2('0x11')](_0x8fd2('0x12'),_0x2842f3,_0x8fd2('0x10'),JSON[_0x8fd2('0x13')](_0x1b6558));if(_0x1b6558[_0x8fd2('0x14')]){if(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x15')]===0x1f4){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);return _0x4fdf0b(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);}logger['error'](_0x8fd2('0xf'),_0x2842f3,_0x1b6558['error']['message']);return _0x34ae5c(_0x1b6558['error'][_0x8fd2('0x16')]);}else{logger[_0x8fd2('0x17')](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));_0x34ae5c(_0x1b6558['result'][_0x8fd2('0x16')]);}})[_0x8fd2('0x18')](function(_0x411943){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x411943);_0x4fdf0b(_0x411943);});});}exports['CreateFaxMessage']=function(_0x48ad51){var _0x3a0939=this;return new Promise(function(_0x4a2002,_0x3c03de){return db['FaxMessage'][_0x8fd2('0x19')](_0x48ad51[_0x8fd2('0x1a')],{'raw':_0x48ad51['options']?_0x48ad51[_0x8fd2('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8fd2('0x1c')](function(_0x44ee7a){logger['info'](_0x8fd2('0x1d'),_0x48ad51);logger[_0x8fd2('0x11')](_0x8fd2('0x1d'),_0x48ad51,JSON['stringify'](_0x44ee7a));_0x4a2002(_0x44ee7a);})[_0x8fd2('0x18')](function(_0x3b9e2f){logger[_0x8fd2('0x14')](_0x8fd2('0x1d'),_0x3b9e2f[_0x8fd2('0x16')],_0x48ad51);_0x3c03de(_0x3a0939[_0x8fd2('0x14')](0x1f4,_0x3b9e2f[_0x8fd2('0x16')]));});});};exports[_0x8fd2('0x1e')]=function(_0x1456b4){var _0xbc5945=this;return new Promise(function(_0x3392fb,_0x1f3237){return db[_0x8fd2('0x1f')]['update'](_0x1456b4['body'],{'raw':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1456b4['options']?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x21')]||null:null,'attributes':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x22')]||null:null,'limit':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')]['limit']||null:null})[_0x8fd2('0x1c')](function(_0x13c9b9){logger[_0x8fd2('0x17')](_0x8fd2('0x1e'),_0x1456b4);logger[_0x8fd2('0x11')](_0x8fd2('0x1e'),_0x1456b4,JSON[_0x8fd2('0x13')](_0x13c9b9));_0x3392fb(_0x13c9b9);})['catch'](function(_0x5b992a){logger['error'](_0x8fd2('0x1e'),_0x5b992a[_0x8fd2('0x16')],_0x1456b4);_0x1f3237(_0xbc5945[_0x8fd2('0x14')](0x1f4,_0x5b992a[_0x8fd2('0x16')]));});});}; \ No newline at end of file +var _0x5c12=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','then','stringify','UpdateFaxMessage','raw','attributes','limit','util','moment','randomstring','ioredis'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5c12,0x188));var _0x25c1=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0x5c12[_0x459a0a];return _0x4ab46c;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});config[_0x25c1('0xb')]=_['defaults'](config['redis'],{'host':_0x25c1('0xc'),'port':0x18eb});var socket=require(_0x25c1('0xd'))(new Redis(config[_0x25c1('0xb')]));require(_0x25c1('0xe'))[_0x25c1('0xf')](socket);function respondWithRpcPromise(_0x588f30,_0x3e062e,_0x41c89d){return new BPromise(function(_0x11a223,_0x81f0f4){return client[_0x25c1('0x10')](_0x588f30,_0x41c89d)['then'](function(_0x196e2f){logger[_0x25c1('0x11')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));logger[_0x25c1('0x13')](_0x25c1('0x14'),_0x3e062e,_0x25c1('0x12'),JSON['stringify'](_0x196e2f));if(_0x196e2f['error']){if(_0x196e2f['error']['code']===0x1f4){logger[_0x25c1('0x15')](_0x25c1('0x16'),_0x3e062e,_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);return _0x81f0f4(_0x196e2f[_0x25c1('0x15')]['message']);}logger[_0x25c1('0x15')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x196e2f['error']['message']);return _0x11a223(_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));_0x11a223(_0x196e2f['result'][_0x25c1('0x17')]);}})[_0x25c1('0x18')](function(_0x5c3c5d){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x5c3c5d);_0x81f0f4(_0x5c3c5d);});});}exports[_0x25c1('0x19')]=function(_0x3d3149){var _0x22a36e=this;return new Promise(function(_0x1bf95d,_0x481c12){return db[_0x25c1('0x1a')][_0x25c1('0x1b')](_0x3d3149[_0x25c1('0x1c')],{'raw':_0x3d3149[_0x25c1('0x1d')]?_0x3d3149['options']['raw']===undefined?!![]:![]:!![]})[_0x25c1('0x1e')](function(_0xac3335){logger[_0x25c1('0x11')](_0x25c1('0x19'),_0x3d3149);logger[_0x25c1('0x13')](_0x25c1('0x19'),_0x3d3149,JSON[_0x25c1('0x1f')](_0xac3335));_0x1bf95d(_0xac3335);})[_0x25c1('0x18')](function(_0x14ffd9){logger[_0x25c1('0x15')](_0x25c1('0x19'),_0x14ffd9[_0x25c1('0x17')],_0x3d3149);_0x481c12(_0x22a36e[_0x25c1('0x15')](0x1f4,_0x14ffd9['message']));});});};exports[_0x25c1('0x20')]=function(_0x20dbb9){var _0x1b1c96=this;return new Promise(function(_0x1fb59f,_0x21fdb8){return db[_0x25c1('0x1a')]['update'](_0x20dbb9[_0x25c1('0x1c')],{'raw':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')]['where']||null:null,'attributes':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9['options'][_0x25c1('0x22')]||null:null,'limit':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x23')]||null:null})[_0x25c1('0x1e')](function(_0x21069c){logger[_0x25c1('0x11')](_0x25c1('0x20'),_0x20dbb9);logger[_0x25c1('0x13')]('UpdateFaxMessage',_0x20dbb9,JSON[_0x25c1('0x1f')](_0x21069c));_0x1fb59f(_0x21069c);})['catch'](function(_0x492715){logger[_0x25c1('0x15')](_0x25c1('0x20'),_0x492715['message'],_0x20dbb9);_0x21fdb8(_0x1b1c96[_0x25c1('0x15')](0x1f4,_0x492715['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index dd96cef..ccc7522 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 _0xec83=['emit','removeListener','register','faxMessage:','save','update'];(function(_0x42cc58,_0x5a4760){var _0x5ca9cb=function(_0xf46e9b){while(--_0xf46e9b){_0x42cc58['push'](_0x42cc58['shift']());}};_0x5ca9cb(++_0x5a4760);}(_0xec83,0x184));var _0x3ec8=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xec83[_0x1e393b];return _0x3d0bfe;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x3ec8('0x0'),'remove',_0x3ec8('0x1')];function createListener(_0x314226,_0x181e2c){return function(_0x2edcdd){_0x181e2c[_0x3ec8('0x2')](_0x314226,_0x2edcdd);};}function removeListener(_0x59dd63,_0x49133d){return function(){FaxMessageEvents[_0x3ec8('0x3')](_0x59dd63,_0x49133d);};}exports[_0x3ec8('0x4')]=function(_0x2f98e4){for(var _0x532cc3=0x0,_0x1c9195=events['length'];_0x532cc3<_0x1c9195;_0x532cc3++){var _0x4bd3eb=events[_0x532cc3];var _0x132348=createListener(_0x3ec8('0x5')+_0x4bd3eb,_0x2f98e4);FaxMessageEvents['on'](_0x4bd3eb,_0x132348);}}; \ No newline at end of file +var _0x2abb=['save','update','removeListener','faxMessage:'];(function(_0x598b78,_0xf4ee7e){var _0x6392fa=function(_0x810353){while(--_0x810353){_0x598b78['push'](_0x598b78['shift']());}};_0x6392fa(++_0xf4ee7e);}(_0x2abb,0x194));var _0xb2ab=function(_0x1cfcb1,_0x2421a8){_0x1cfcb1=_0x1cfcb1-0x0;var _0xe30fff=_0x2abb[_0x1cfcb1];return _0xe30fff;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xb2ab('0x0'),'remove',_0xb2ab('0x1')];function createListener(_0xb67a07,_0x482a0c){return function(_0x32e3b0){_0x482a0c['emit'](_0xb67a07,_0x32e3b0);};}function removeListener(_0x17efc7,_0xe4505f){return function(){FaxMessageEvents[_0xb2ab('0x2')](_0x17efc7,_0xe4505f);};}exports['register']=function(_0x675780){for(var _0x49f750=0x0,_0x5f00b5=events['length'];_0x49f750<_0x5f00b5;_0x49f750++){var _0x58c8dc=events[_0x49f750];var _0x1a5492=createListener(_0xb2ab('0x3')+_0x58c8dc,_0x675780);FaxMessageEvents['on'](_0x58c8dc,_0x1a5492);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a16aecf..9356389 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 _0x6e6c=['reject','/:id','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxMessage.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0x6')]('/:id',auth[_0xc6e6('0x7')](),controller['show']);router[_0xc6e6('0x6')](_0xc6e6('0xa'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xb')]);router[_0xc6e6('0xc')]('/',auth[_0xc6e6('0x7')](),interaction[_0xc6e6('0xd')](_0xc6e6('0xe'),_0xc6e6('0xf')),controller['create']);router[_0xc6e6('0x10')]('/:id',auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x11')]);router[_0xc6e6('0x10')](_0xc6e6('0x12'),auth['isAuthenticated'](),controller[_0xc6e6('0x13')]);router[_0xc6e6('0x10')](_0xc6e6('0x14'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0x15')]);router['delete'](_0xc6e6('0x16'),auth[_0xc6e6('0x7')](),controller['destroy']);module[_0xc6e6('0x17')]=router; \ No newline at end of file +var _0x9aea=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','fax','faxmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express'];(function(_0x10a97c,_0x2565e7){var _0x5da79a=function(_0x1e5ec2){while(--_0x1e5ec2){_0x10a97c['push'](_0x10a97c['shift']());}};_0x5da79a(++_0x2565e7);}(_0x9aea,0xdd));var _0xa9ae=function(_0x5e9d2f,_0x1192ef){_0x5e9d2f=_0x5e9d2f-0x0;var _0xd52cd1=_0x9aea[_0x5e9d2f];return _0xd52cd1;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa9ae('0x4'));var interaction=require(_0xa9ae('0x5'));var config=require(_0xa9ae('0x6'));var controller=require(_0xa9ae('0x7'));router[_0xa9ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9ae('0x9')]);router[_0xa9ae('0x8')](_0xa9ae('0xa'),auth['isAuthenticated'](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0x8')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0xe')]);router[_0xa9ae('0x8')](_0xa9ae('0xf'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x10')]);router['post']('/',auth[_0xa9ae('0xd')](),interaction['tracked'](_0xa9ae('0x11'),_0xa9ae('0x12')),controller[_0xa9ae('0x13')]);router[_0xa9ae('0x14')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x15')]);router[_0xa9ae('0x14')]('/:id/accept',auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x16')]);router[_0xa9ae('0x14')](_0xa9ae('0x17'),auth['isAuthenticated'](),controller[_0xa9ae('0x18')]);router[_0xa9ae('0x19')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x1a')]);module[_0xa9ae('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 fa1a412..9d5662a 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 _0x5ce5=['exports','STRING','name','INTEGER','ENUM','rrmemory','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5ce5,0xa0));var _0x55ce=function(_0x284290,_0x44f41d){_0x284290=_0x284290-0x0;var _0x290abc=_0x5ce5[_0x284290];return _0x290abc;};'use strict';var Sequelize=require(_0x55ce('0x0'));module[_0x55ce('0x1')]={'name':{'type':Sequelize[_0x55ce('0x2')],'unique':_0x55ce('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x55ce('0x2')]},'timeout':{'type':Sequelize[_0x55ce('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x55ce('0x5')](_0x55ce('0x6'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x55ce('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc029=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xc029,0x1df));var _0x9c02=function(_0x1385f0,_0x5550bb){_0x1385f0=_0x1385f0-0x0;var _0x36ca00=_0xc029[_0x1385f0];return _0x36ca00;};'use strict';var Sequelize=require(_0x9c02('0x0'));module[_0x9c02('0x1')]={'name':{'type':Sequelize[_0x9c02('0x2')],'unique':_0x9c02('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9c02('0x2')]},'timeout':{'type':Sequelize[_0x9c02('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9c02('0x5')](_0x9c02('0x6'),_0x9c02('0x7'),_0x9c02('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9c02('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 5d259c1..5ea23c8 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 _0x9fe7=['removeAgents','emit','userFaxQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util','squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','FaxQueues','UserProfileResource','destroy','stack','name','fieldName','type','getOptions','where','findAll','rows','catch','show','params','model','keys','FaxQueue','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','fields','hasOwnProperty','nolimit','sort','pick','FaxQueueId','filter','map','UserFaxQueue','findAndCountAll','agent','faxPause','format','%s/%s','createdAt','updatedAt','order','getTeams','addTeams','ids','Team','User','online','voicePause','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','includes','all','union','compact','value','isEmpty'];(function(_0x2b5500,_0x24f4de){var _0x154587=function(_0x2ced67){while(--_0x2ced67){_0x2b5500['push'](_0x2b5500['shift']());}};_0x154587(++_0x24f4de);}(_0x9fe7,0x1df));var _0x79fe=function(_0x3b273f,_0x15e028){_0x3b273f=_0x3b273f-0x0;var _0x37b612=_0x9fe7[_0x3b273f];return _0x37b612;};'use strict';var BPromise=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var _=require('lodash');var squel=require(_0x79fe('0x2'));var Redis=require('ioredis');var qs=require(_0x79fe('0x3'));var logger=require(_0x79fe('0x4'))(_0x79fe('0x5'));var config=require('../../config/environment');var db=require(_0x79fe('0x6'))['db'];config[_0x79fe('0x7')]=_[_0x79fe('0x8')](config['redis'],{'host':_0x79fe('0x9'),'port':0x18eb});var socket=require(_0x79fe('0xa'))(new Redis(config[_0x79fe('0x7')]));require('./faxQueue.socket')[_0x79fe('0xb')](socket);function respondWithStatusCode(_0x264323,_0x29b317){_0x29b317=_0x29b317||0xcc;return function(_0x26d723){if(_0x26d723){return _0x264323[_0x79fe('0xc')](_0x29b317);}return _0x264323['status'](_0x29b317)[_0x79fe('0xd')]();};}function respondWithResult(_0x253f7d,_0x4a3ccf){_0x4a3ccf=_0x4a3ccf||0xc8;return function(_0x20cde6){if(_0x20cde6){return _0x253f7d[_0x79fe('0xe')](_0x4a3ccf)[_0x79fe('0xf')](_0x20cde6);}};}function respondWithFilteredResult(_0x20607a,_0x5d3063){return function(_0x3e6e31){if(_0x3e6e31){var _0x30c992=typeof _0x5d3063[_0x79fe('0x10')]===_0x79fe('0x11')&&typeof _0x5d3063[_0x79fe('0x12')]===_0x79fe('0x11');var _0x42bbe4=_0x3e6e31[_0x79fe('0x13')];var _0x4be1c4=_0x30c992?0x0:_0x5d3063[_0x79fe('0x10')];var _0x238e60=_0x30c992?_0x3e6e31[_0x79fe('0x13')]:_0x5d3063[_0x79fe('0x10')]+_0x5d3063[_0x79fe('0x12')];var _0x25e91b;if(_0x238e60>=_0x42bbe4){_0x238e60=_0x42bbe4;_0x25e91b=0xc8;}else{_0x25e91b=0xce;}_0x20607a['status'](_0x25e91b);return _0x20607a[_0x79fe('0x14')](_0x79fe('0x15'),_0x4be1c4+'-'+_0x238e60+'/'+_0x42bbe4)[_0x79fe('0xf')](_0x3e6e31);}return null;};}function saveUpdates(_0x5f0af3){return function(_0x5eadbf){if(_0x5eadbf){return _0x5eadbf[_0x79fe('0x16')](_0x5f0af3)[_0x79fe('0x17')](function(_0x39be95){return _0x39be95;});}return null;};}function removeEntity(_0x40a549){return function(_0x536641){if(_0x536641){return _0x536641['destroy']()[_0x79fe('0x17')](function(){var _0x1a1224=_0x536641[_0x79fe('0x18')]({'plain':!![]});var _0x4bca4d=_0x79fe('0x19');return db[_0x79fe('0x1a')][_0x79fe('0x1b')]({'where':{'type':_0x4bca4d,'resourceId':_0x1a1224['id']}})['then'](function(){return _0x536641;});})[_0x79fe('0x17')](function(){_0x40a549['status'](0xcc)[_0x79fe('0xd')]();});}};}function handleEntityNotFound(_0xde2451){return function(_0x3f1b15){if(!_0x3f1b15){_0xde2451[_0x79fe('0xc')](0x194);}return _0x3f1b15;};}function handleError(_0x1ac8d7,_0x23bff8){_0x23bff8=_0x23bff8||0x1f4;return function(_0x53c3a1){logger['error'](_0x53c3a1[_0x79fe('0x1c')]);if(_0x53c3a1['name']){delete _0x53c3a1[_0x79fe('0x1d')];}_0x1ac8d7[_0x79fe('0xe')](_0x23bff8)['send'](_0x53c3a1);};}exports['index']=function(_0x454e93,_0x321778){var _0x59339b={};var _0x46d93d={'count':0x0,'rows':[]};var _0x1c1f74=_['map'](db['FaxQueue']['rawAttributes'],function(_0x3720fa){return{'name':_0x3720fa[_0x79fe('0x1e')],'type':_0x3720fa[_0x79fe('0x1f')]['key']};});_0x59339b=qs[_0x79fe('0x20')](_0x1c1f74,_0x454e93);var _0x43782e={'where':_0x59339b[_0x79fe('0x21')]};return db['FaxQueue']['count'](_0x43782e)[_0x79fe('0x17')](function(_0x51200f){_0x46d93d[_0x79fe('0x13')]=_0x51200f;_0x59339b['include']=qs['include'](_0x454e93['query']);return db['FaxQueue'][_0x79fe('0x22')](_0x59339b);})[_0x79fe('0x17')](function(_0x4dff5f){_0x46d93d[_0x79fe('0x23')]=_0x4dff5f;return _0x46d93d;})['then'](respondWithFilteredResult(_0x321778,_0x59339b))[_0x79fe('0x24')](handleError(_0x321778,null));};exports[_0x79fe('0x25')]=function(_0xd01981,_0x3558f2){var _0x128ca3={'raw':!![],'where':{'id':_0xd01981[_0x79fe('0x26')]['id']}},_0x5ac1c4={};_0x5ac1c4[_0x79fe('0x27')]=_[_0x79fe('0x28')](db[_0x79fe('0x29')][_0x79fe('0x2a')]);_0x5ac1c4[_0x79fe('0x2b')]=_['keys'](_0xd01981[_0x79fe('0x2b')]);_0x5ac1c4[_0x79fe('0x2c')]=_[_0x79fe('0x2d')](_0x5ac1c4[_0x79fe('0x27')],_0x5ac1c4[_0x79fe('0x2b')]);_0x128ca3[_0x79fe('0x2e')]=_['intersection'](_0x5ac1c4[_0x79fe('0x27')],qs['fields'](_0xd01981[_0x79fe('0x2b')]['fields']));_0x128ca3[_0x79fe('0x2e')]=_0x128ca3['attributes'][_0x79fe('0x2f')]?_0x128ca3[_0x79fe('0x2e')]:_0x5ac1c4[_0x79fe('0x27')];if(_0xd01981['query'][_0x79fe('0x30')]){_0x128ca3[_0x79fe('0x31')]=[{'all':!![]}];}_0x128ca3=_[_0x79fe('0x32')]({},_0x128ca3,_0xd01981[_0x79fe('0x33')]);return db[_0x79fe('0x29')]['find'](_0x128ca3)['then'](handleEntityNotFound(_0x3558f2,null))[_0x79fe('0x17')](respondWithResult(_0x3558f2,null))['catch'](handleError(_0x3558f2,null));};exports[_0x79fe('0x34')]=function(_0x44d97e,_0x497a02){return db[_0x79fe('0x29')][_0x79fe('0x34')](_0x44d97e[_0x79fe('0x35')],{})[_0x79fe('0x17')](function(_0x43d8b6){var _0x4696f4=_0x44d97e['user'][_0x79fe('0x18')]({'plain':!![]});if(!_0x4696f4)throw new Error(_0x79fe('0x36'));if(_0x4696f4[_0x79fe('0x37')]===_0x79fe('0x38')){var _0x4eada4=_0x43d8b6[_0x79fe('0x18')]({'plain':!![]});var _0x49d107=_0x79fe('0x19');return db['UserProfileSection'][_0x79fe('0x39')]({'where':{'name':_0x49d107,'userProfileId':_0x4696f4['userProfileId']},'raw':!![]})[_0x79fe('0x17')](function(_0x132662){if(_0x132662&&_0x132662['autoAssociation']===0x0){return db['UserProfileResource'][_0x79fe('0x34')]({'name':_0x4eada4[_0x79fe('0x1d')],'resourceId':_0x4eada4['id'],'type':_0x132662[_0x79fe('0x1d')],'sectionId':_0x132662['id']},{})[_0x79fe('0x17')](function(){return _0x43d8b6;});}else{return _0x43d8b6;}})['catch'](function(_0x5698a2){logger[_0x79fe('0x3a')](_0x79fe('0x3b'),_0x5698a2);throw _0x5698a2;});}return _0x43d8b6;})[_0x79fe('0x17')](respondWithResult(_0x497a02,0xc9))[_0x79fe('0x24')](handleError(_0x497a02,null));};exports[_0x79fe('0x16')]=function(_0x3feb46,_0xc31ac6){if(_0x3feb46[_0x79fe('0x35')]['id']){delete _0x3feb46['body']['id'];}return db[_0x79fe('0x29')][_0x79fe('0x39')]({'where':{'id':_0x3feb46[_0x79fe('0x26')]['id']}})[_0x79fe('0x17')](handleEntityNotFound(_0xc31ac6,null))[_0x79fe('0x17')](saveUpdates(_0x3feb46[_0x79fe('0x35')],null))['then'](respondWithResult(_0xc31ac6,null))[_0x79fe('0x24')](handleError(_0xc31ac6,null));};exports[_0x79fe('0x1b')]=function(_0x218d62,_0x428e4d){return db[_0x79fe('0x29')][_0x79fe('0x39')]({'where':{'id':_0x218d62['params']['id']}})[_0x79fe('0x17')](handleEntityNotFound(_0x428e4d,null))[_0x79fe('0x17')](removeEntity(_0x428e4d,null))[_0x79fe('0x24')](handleError(_0x428e4d,null));};exports['describe']=function(_0x14e9e0,_0x563b71){return db['FaxQueue'][_0x79fe('0x3c')]()[_0x79fe('0x17')](respondWithResult(_0x563b71,null))[_0x79fe('0x24')](handleError(_0x563b71,null));};exports['getMembers']=function(_0x2aebbc,_0x29cb34){var _0x42c5af={'raw':!![],'where':{}},_0x4d698d={},_0x4b3841;return db[_0x79fe('0x29')][_0x79fe('0x3d')]({'where':{'id':_0x2aebbc[_0x79fe('0x26')]['id']}})[_0x79fe('0x17')](handleEntityNotFound(_0x29cb34,null))[_0x79fe('0x17')](function(_0x144a97){if(_0x144a97){_0x4b3841=_0x144a97[_0x79fe('0x18')]({'plain':!![]});_0x4d698d[_0x79fe('0x27')]=_[_0x79fe('0x28')](db['UserFaxQueue'][_0x79fe('0x2a')]);_0x4d698d[_0x79fe('0x2b')]=_['keys'](_0x2aebbc[_0x79fe('0x2b')]);_0x4d698d['filters']=_[_0x79fe('0x2d')](_0x4d698d[_0x79fe('0x27')],_0x4d698d[_0x79fe('0x2b')]);_0x42c5af[_0x79fe('0x2e')]=_['intersection'](_0x4d698d[_0x79fe('0x27')],qs[_0x79fe('0x3e')](_0x2aebbc[_0x79fe('0x2b')]['fields']));_0x42c5af['attributes']=_0x42c5af[_0x79fe('0x2e')][_0x79fe('0x2f')]?_0x42c5af['attributes']:_0x4d698d[_0x79fe('0x27')];if(!_0x2aebbc[_0x79fe('0x2b')][_0x79fe('0x3f')](_0x79fe('0x40'))){_0x42c5af['limit']=qs[_0x79fe('0x12')](_0x2aebbc[_0x79fe('0x2b')][_0x79fe('0x12')]);_0x42c5af['offset']=qs['offset'](_0x2aebbc['query']['offset']);}_0x42c5af['order']=qs[_0x79fe('0x41')](_0x2aebbc[_0x79fe('0x2b')]['sort']);_0x42c5af[_0x79fe('0x21')]=qs[_0x79fe('0x2c')](_[_0x79fe('0x42')](_0x2aebbc['query'],_0x4d698d['filters']));_0x42c5af['where'][_0x79fe('0x43')]=_0x144a97['id'];if(_0x2aebbc['query'][_0x79fe('0x44')]){_0x42c5af[_0x79fe('0x21')]=_[_0x79fe('0x32')](_0x42c5af[_0x79fe('0x21')],{'$or':_[_0x79fe('0x45')](_0x42c5af[_0x79fe('0x2e')],function(_0x345974){var _0x2578da={};_0x2578da[_0x345974]={'$like':'%'+_0x2aebbc[_0x79fe('0x2b')][_0x79fe('0x44')]+'%'};return _0x2578da;})});}_0x42c5af=_[_0x79fe('0x32')]({},_0x42c5af,_0x2aebbc['options']);return db[_0x79fe('0x46')][_0x79fe('0x22')](_0x42c5af);}})['then'](function(_0x27f412){if(_0x27f412){return db['User'][_0x79fe('0x47')]({'where':{'id':_[_0x79fe('0x45')](_0x27f412,'UserId'),'role':_0x79fe('0x48')},'attributes':['id','name',_0x79fe('0x49'),'updatedAt','createdAt']});}})['then'](function(_0x9728b9){if(_0x9728b9){return{'count':_0x9728b9[_0x79fe('0x13')],'rows':_[_0x79fe('0x45')](_0x9728b9[_0x79fe('0x23')],function(_0x42b7ea){return{'membername':_0x42b7ea[_0x79fe('0x1d')],'UserId':_0x42b7ea['id'],'queue_name':_0x4b3841[_0x79fe('0x1d')],'FaxQueueId':_0x4b3841['id'],'interface':util[_0x79fe('0x4a')](_0x79fe('0x4b'),'SIP',_0x42b7ea[_0x79fe('0x1d')]),'penalty':0x0,'paused':_0x42b7ea[_0x79fe('0x49')],'createdAt':_0x42b7ea[_0x79fe('0x4c')],'updatedAt':_0x42b7ea[_0x79fe('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x29cb34,_0x42c5af))[_0x79fe('0x24')](handleError(_0x29cb34,null));};exports['getTeams']=function(_0x24da87,_0x52d583){var _0x136b97={};var _0x32750b={};var _0x13c203;var _0xec619e;return db['FaxQueue'][_0x79fe('0x3d')]({'where':{'id':_0x24da87[_0x79fe('0x26')]['id']}})[_0x79fe('0x17')](handleEntityNotFound(_0x52d583,null))[_0x79fe('0x17')](function(_0x5821f6){if(_0x5821f6){_0x13c203=_0x5821f6;_0x32750b[_0x79fe('0x27')]=_[_0x79fe('0x28')](db['Team'][_0x79fe('0x2a')]);_0x32750b['query']=_['keys'](_0x24da87[_0x79fe('0x2b')]);_0x32750b[_0x79fe('0x2c')]=_[_0x79fe('0x2d')](_0x32750b['model'],_0x32750b['query']);_0x136b97[_0x79fe('0x2e')]=_['intersection'](_0x32750b['model'],qs[_0x79fe('0x3e')](_0x24da87[_0x79fe('0x2b')][_0x79fe('0x3e')]));_0x136b97[_0x79fe('0x2e')]=_0x136b97[_0x79fe('0x2e')][_0x79fe('0x2f')]?_0x136b97[_0x79fe('0x2e')]:_0x32750b[_0x79fe('0x27')];_0x136b97[_0x79fe('0x4e')]=qs['sort'](_0x24da87[_0x79fe('0x2b')][_0x79fe('0x41')]);_0x136b97['where']=qs[_0x79fe('0x2c')](_[_0x79fe('0x42')](_0x24da87[_0x79fe('0x2b')],_0x32750b[_0x79fe('0x2c')]));if(_0x24da87[_0x79fe('0x2b')][_0x79fe('0x44')]){_0x136b97[_0x79fe('0x21')]=_[_0x79fe('0x32')](_0x136b97[_0x79fe('0x21')],{'$or':_[_0x79fe('0x45')](_0x136b97[_0x79fe('0x2e')],function(_0x52fd0b){var _0x4d5458={};_0x4d5458[_0x52fd0b]={'$like':'%'+_0x24da87[_0x79fe('0x2b')][_0x79fe('0x44')]+'%'};return _0x4d5458;})});}_0x136b97=_[_0x79fe('0x32')]({},_0x136b97,_0x24da87[_0x79fe('0x33')]);return _0x13c203[_0x79fe('0x4f')](_0x136b97);}})[_0x79fe('0x17')](function(_0x492d92){if(_0x492d92){_0xec619e=_0x492d92[_0x79fe('0x2f')];if(!_0x24da87[_0x79fe('0x2b')][_0x79fe('0x3f')]('nolimit')){_0x136b97['limit']=qs['limit'](_0x24da87['query'][_0x79fe('0x12')]);_0x136b97['offset']=qs[_0x79fe('0x10')](_0x24da87[_0x79fe('0x2b')][_0x79fe('0x10')]);}return _0x13c203[_0x79fe('0x4f')](_0x136b97);}})[_0x79fe('0x17')](function(_0x55a782){if(_0x55a782){return _0x55a782?{'count':_0xec619e,'rows':_0x55a782}:null;}})[_0x79fe('0x17')](respondWithResult(_0x52d583,null))['catch'](handleError(_0x52d583,null));};exports[_0x79fe('0x50')]=function(_0x1b8507,_0x102923){var _0x134584=_0x1b8507[_0x79fe('0x35')][_0x79fe('0x51')];return db[_0x79fe('0x52')]['findAll']({'where':{'id':_0x134584},'attributes':['id'],'include':[{'model':db[_0x79fe('0x53')],'as':'Agents','attributes':['id',_0x79fe('0x1d'),_0x79fe('0x54'),_0x79fe('0x55'),'interface'],'raw':!![]}]})[_0x79fe('0x17')](function(_0x21fc30){if(_0x21fc30){var _0x1f38d3=_[_0x79fe('0x56')](_0x21fc30,function(_0x4a2832){var _0x30d99b=_0x4a2832[_0x79fe('0x18')]({'plain':!![]});return _0x30d99b[_0x79fe('0x57')];});return db['FaxQueue'][_0x79fe('0x39')]({'where':{'id':_0x1b8507[_0x79fe('0x26')]['id']}})[_0x79fe('0x17')](function(_0x3eefa0){return db[_0x79fe('0x58')][_0x79fe('0x59')](function(_0x448350){return _0x3eefa0[_0x79fe('0x50')](_0x134584,{'transaction':_0x448350})[_0x79fe('0x17')](function(){return BPromise['each'](_0x1f38d3,function(_0x18def0){return db['UserFaxQueue'][_0x79fe('0x5a')]({'where':{'UserId':_0x18def0['id'],'FaxQueueId':_0x1b8507[_0x79fe('0x26')]['id']},'transaction':_0x448350});});})[_0x79fe('0x17')](function(){_0x1f38d3[_0x79fe('0x5b')](function(_0x2044d8){socket['emit'](_0x79fe('0x5c'),{'UserId':_0x2044d8['id'],'FaxQueueId':_0x3eefa0['id']});});});});});}})['then'](respondWithStatusCode(_0x102923,null))[_0x79fe('0x24')](handleError(_0x102923,null));};exports[_0x79fe('0x5d')]=function(_0x4d2366,_0x339a74){return db[_0x79fe('0x52')][_0x79fe('0x22')]({'where':{'id':_0x4d2366[_0x79fe('0x2b')][_0x79fe('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x79fe('0x57'),'attributes':['id'],'raw':!![]}]})[_0x79fe('0x17')](handleEntityNotFound(_0x339a74,null))[_0x79fe('0x17')](function(_0x3078a7){var _0x113b8c=_[_0x79fe('0x45')](_0x3078a7,'id');var _0x477c6f=[];var _0x24c6ad=[];var _0x38fc15=squel[_0x79fe('0x5e')]();_0x38fc15['field'](_0x79fe('0x5f'))['from'](_0x79fe('0x60'),'tq')['join'](_0x79fe('0x61'),'ut',_0x79fe('0x62'))[_0x79fe('0x21')](_0x79fe('0x63'),_0x4d2366[_0x79fe('0x26')]['id']);for(var _0x4dc8cd=0x0;_0x4dc8cd<_0x3078a7[_0x79fe('0x2f')];_0x4dc8cd+=0x1){let _0x29581e=_0x3078a7[_0x4dc8cd];for(var _0x43820f=0x0;_0x43820f<_0x29581e[_0x79fe('0x57')]['length'];_0x43820f+=0x1){let _0x2de2d5=_0x29581e['Agents'][_0x43820f];var _0x2d665c=_0x38fc15[_0x79fe('0x64')]();_0x2d665c[_0x79fe('0x21')](_0x79fe('0x65'),_0x2de2d5['id']);_0x24c6ad[_0x79fe('0x66')](db['sequelize'][_0x79fe('0x2b')](_0x2d665c['toString'](),{'type':db[_0x79fe('0x58')][_0x79fe('0x67')]['SELECT']})[_0x79fe('0x17')](function(_0x331176){if(_0x331176[_0x79fe('0x2f')]===0x1){return _0x2de2d5['id'];}else{var _0x3aa36b=_[_0x79fe('0x68')](_[_0x79fe('0x45')](_0x331176,'TeamId'),function(_0x4da8fb){return _[_0x79fe('0x69')](_0x113b8c,_0x4da8fb);});if(_0x3aa36b){return _0x2de2d5['id'];}}}));}}return BPromise[_0x79fe('0x6a')](_0x24c6ad)[_0x79fe('0x17')](function(_0x550501){_0x477c6f=_(_0x477c6f)[_0x79fe('0x6b')](_0x550501)[_0x79fe('0x6c')]()[_0x79fe('0x6d')]();return db[_0x79fe('0x29')][_0x79fe('0x39')]({'where':{'id':_0x4d2366['params']['id']}})[_0x79fe('0x17')](function(_0xfb2ee6){return db[_0x79fe('0x58')]['transaction'](function(_0x3e3b72){return _0xfb2ee6[_0x79fe('0x5d')](_0x4d2366[_0x79fe('0x2b')][_0x79fe('0x51')],{'transaction':_0x3e3b72})['then'](function(){if(!_[_0x79fe('0x6e')](_0x477c6f)){return _0xfb2ee6[_0x79fe('0x6f')](_0x477c6f,{'transaction':_0x3e3b72});}})['then'](function(){_0x477c6f[_0x79fe('0x5b')](function(_0x125940){socket[_0x79fe('0x70')](_0x79fe('0x71'),{'UserId':_0x125940,'FaxQueueId':_0xfb2ee6['id']});});});});});});})[_0x79fe('0x17')](respondWithStatusCode(_0x339a74,null))['catch'](handleError(_0x339a74,null));};exports[_0x79fe('0x72')]=function(_0x3ad4b7,_0x517612){return db['FaxQueue']['find']({'where':{'id':_0x3ad4b7[_0x79fe('0x26')]['id']}})[_0x79fe('0x17')](handleEntityNotFound(_0x517612,null))[_0x79fe('0x17')](function(_0x32aae7){if(_0x32aae7){return _0x32aae7[_0x79fe('0x72')](_0x3ad4b7['body'][_0x79fe('0x51')],_[_0x79fe('0x73')](_0x3ad4b7['body'],[_0x79fe('0x51'),'id'])||{})['spread'](function(_0x56abb2){for(var _0x4662f8=0x0;_0x4662f8<_0x3ad4b7[_0x79fe('0x35')][_0x79fe('0x51')][_0x79fe('0x2f')];_0x4662f8+=0x1){socket[_0x79fe('0x70')](_0x79fe('0x5c'),{'UserId':Number(_0x3ad4b7[_0x79fe('0x35')][_0x79fe('0x51')][_0x4662f8]),'FaxQueueId':Number(_0x3ad4b7[_0x79fe('0x26')]['id'])});}return _0x56abb2;});}})[_0x79fe('0x17')](respondWithResult(_0x517612,null))[_0x79fe('0x24')](handleError(_0x517612,null));};exports['removeAgents']=function(_0x56eff3,_0x245b77){return db[_0x79fe('0x29')][_0x79fe('0x39')]({'where':{'id':_0x56eff3[_0x79fe('0x26')]['id']}})[_0x79fe('0x17')](handleEntityNotFound(_0x245b77,null))[_0x79fe('0x17')](function(_0x3e910e){if(_0x3e910e){return _0x3e910e[_0x79fe('0x6f')](_0x56eff3['query'][_0x79fe('0x51')])[_0x79fe('0x17')](function(){if(_[_0x79fe('0x74')](_0x56eff3[_0x79fe('0x2b')]['ids'])){for(var _0xfcbd13=0x0;_0xfcbd13<_0x56eff3['query'][_0x79fe('0x51')]['length'];_0xfcbd13+=0x1){socket[_0x79fe('0x70')](_0x79fe('0x71'),{'UserId':Number(_0x56eff3[_0x79fe('0x2b')][_0x79fe('0x51')][_0xfcbd13]),'FaxQueueId':Number(_0x56eff3[_0x79fe('0x26')]['id'])});}}else{socket[_0x79fe('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x56eff3['query'][_0x79fe('0x51')]),'FaxQueueId':Number(_0x56eff3[_0x79fe('0x26')]['id'])});}});}})[_0x79fe('0x17')](respondWithStatusCode(_0x245b77,null))[_0x79fe('0x24')](handleError(_0x245b77,null));};exports[_0x79fe('0x75')]=function(_0x5eca8c,_0x159679){var _0x4e6725={};var _0x487856={};var _0x28685f;var _0x517c85;return db[_0x79fe('0x29')][_0x79fe('0x3d')]({'where':{'id':_0x5eca8c[_0x79fe('0x26')]['id']}})[_0x79fe('0x17')](handleEntityNotFound(_0x159679,null))[_0x79fe('0x17')](function(_0x454eb0){if(_0x454eb0){_0x28685f=_0x454eb0;_0x487856[_0x79fe('0x27')]=_[_0x79fe('0x28')](db['User'][_0x79fe('0x2a')]);_0x487856[_0x79fe('0x2b')]=_['keys'](_0x5eca8c[_0x79fe('0x2b')]);_0x487856[_0x79fe('0x2c')]=_[_0x79fe('0x2d')](_0x487856[_0x79fe('0x27')],_0x487856['query']);_0x4e6725['attributes']=_[_0x79fe('0x2d')](_0x487856['model'],qs[_0x79fe('0x3e')](_0x5eca8c[_0x79fe('0x2b')][_0x79fe('0x3e')]));_0x4e6725['attributes']=_0x4e6725[_0x79fe('0x2e')][_0x79fe('0x2f')]?_0x4e6725[_0x79fe('0x2e')]:_0x487856[_0x79fe('0x27')];_0x4e6725[_0x79fe('0x4e')]=qs[_0x79fe('0x41')](_0x5eca8c['query']['sort']);_0x4e6725[_0x79fe('0x21')]=qs['filters'](_[_0x79fe('0x42')](_0x5eca8c[_0x79fe('0x2b')],_0x487856[_0x79fe('0x2c')]));if(_0x5eca8c[_0x79fe('0x2b')]['filter']){_0x4e6725[_0x79fe('0x21')]=_[_0x79fe('0x32')](_0x4e6725[_0x79fe('0x21')],{'$or':_[_0x79fe('0x45')](_0x4e6725['attributes'],function(_0x14a2c9){var _0x57b79e={};_0x57b79e[_0x14a2c9]={'$like':'%'+_0x5eca8c[_0x79fe('0x2b')]['filter']+'%'};return _0x57b79e;})});}_0x4e6725=_[_0x79fe('0x32')]({},_0x4e6725,_0x5eca8c[_0x79fe('0x33')]);return _0x28685f[_0x79fe('0x75')](_0x4e6725);}})[_0x79fe('0x17')](function(_0x1061f4){if(_0x1061f4){_0x517c85=_0x1061f4[_0x79fe('0x2f')];if(!_0x5eca8c['query'][_0x79fe('0x3f')]('nolimit')){_0x4e6725[_0x79fe('0x12')]=qs[_0x79fe('0x12')](_0x5eca8c[_0x79fe('0x2b')][_0x79fe('0x12')]);_0x4e6725[_0x79fe('0x10')]=qs[_0x79fe('0x10')](_0x5eca8c[_0x79fe('0x2b')][_0x79fe('0x10')]);}return _0x28685f[_0x79fe('0x75')](_0x4e6725);}})[_0x79fe('0x17')](function(_0x2dc336){if(_0x2dc336){return _0x2dc336?{'count':_0x517c85,'rows':_0x2dc336}:null;}})[_0x79fe('0x17')](respondWithResult(_0x159679,null))[_0x79fe('0x24')](handleError(_0x159679,null));}; \ No newline at end of file +var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userFaxQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','FaxQueueId','merge','UserFaxQueue','User','findAndCountAll','map','UserId','agent','faxPause','updatedAt','createdAt','format'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0xadb5,0xad));var _0x5adb=function(_0x5391c2,_0x493df6){_0x5391c2=_0x5391c2-0x0;var _0x286cd2=_0xadb5[_0x5391c2];return _0x286cd2;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserFaxQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'FaxQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['FaxQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['FaxQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'FaxQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'FaxQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'FaxQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'FaxQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['FaxQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'FaxQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'FaxQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c04d8c9..575504a 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 _0x0e27=['exports','../../mysqldb','FaxQueue','update','remove','emit','hasOwnProperty'];(function(_0x3cd390,_0x502e77){var _0x1ed2e7=function(_0x9c74ee){while(--_0x9c74ee){_0x3cd390['push'](_0x3cd390['shift']());}};_0x1ed2e7(++_0x502e77);}(_0x0e27,0x1c1));var _0x70e2=function(_0x4e220c,_0x13756b){_0x4e220c=_0x4e220c-0x0;var _0x4166bf=_0x0e27[_0x4e220c];return _0x4166bf;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x70e2('0x0'))['db'][_0x70e2('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x70e2('0x2'),'afterDestroy':_0x70e2('0x3')};function emitEvent(_0x1ed142){return function(_0x227f25,_0x4d5b74,_0x1fd447){FaxQueueEvents[_0x70e2('0x4')](_0x1ed142+':'+_0x227f25['id'],_0x227f25);FaxQueueEvents[_0x70e2('0x4')](_0x1ed142,_0x227f25);_0x1fd447(null);};}for(var e in events){if(events[_0x70e2('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x70e2('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0xbfea=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xbfea,0xe3));var _0xabfe=function(_0xac333b,_0x5de319){_0xac333b=_0xac333b-0x0;var _0x105e7a=_0xbfea[_0xac333b];return _0x105e7a;};'use strict';var EventEmitter=require(_0xabfe('0x0'));var FaxQueue=require(_0xabfe('0x1'))['db'][_0xabfe('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xabfe('0x3')](0x0);var events={'afterCreate':_0xabfe('0x4'),'afterUpdate':_0xabfe('0x5'),'afterDestroy':_0xabfe('0x6')};function emitEvent(_0x3a247d){return function(_0x4a4d64,_0x25fd6c,_0x15e625){FaxQueueEvents[_0xabfe('0x7')](_0x3a247d+':'+_0x4a4d64['id'],_0x4a4d64);FaxQueueEvents['emit'](_0x3a247d,_0x4a4d64);_0x15e625(null);};}for(var e in events){if(events[_0xabfe('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xabfe('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 080838d..c2746b2 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 _0x7e0b=['moment','request-promise','path','rimraf','../../config/environment','exports','define','lodash','api'];(function(_0x525528,_0x373d7a){var _0x29b3b1=function(_0x57f4f3){while(--_0x57f4f3){_0x525528['push'](_0x525528['shift']());}};_0x29b3b1(++_0x373d7a);}(_0x7e0b,0x142));var _0xb7e0=function(_0x8a38bb,_0xc4fb21){_0x8a38bb=_0x8a38bb-0x0;var _0x5cfe5e=_0x7e0b[_0x8a38bb];return _0x5cfe5e;};'use strict';var _=require(_0xb7e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb7e0('0x1'));var moment=require(_0xb7e0('0x2'));var BPromise=require('bluebird');var rp=require(_0xb7e0('0x3'));var fs=require('fs');var path=require(_0xb7e0('0x4'));var rimraf=require(_0xb7e0('0x5'));var config=require(_0xb7e0('0x6'));var attributes=require('./faxQueue.attributes');module[_0xb7e0('0x7')]=function(_0x334dec,_0x503ee0){return _0x334dec[_0xb7e0('0x8')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x197e=['api','moment','bluebird','path','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x197e,0x19d));var _0xe197=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x197e[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xe197('0x0'));var util=require(_0xe197('0x1'));var logger=require(_0xe197('0x2'))(_0xe197('0x3'));var moment=require(_0xe197('0x4'));var BPromise=require(_0xe197('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe197('0x6'));var rimraf=require('rimraf');var config=require(_0xe197('0x7'));var attributes=require(_0xe197('0x8'));module[_0xe197('0x9')]=function(_0x2bee37,_0x5c5e5b){return _0x2bee37[_0xe197('0xa')](_0xe197('0xb'),attributes,{'tableName':_0xe197('0xc'),'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 bf1137e..e1b12b0 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 _0x3352=['result','catch','FaxQueue','findAll','options','raw','where','attributes','include','map','model','GetFaxQueue','debug','ShowFaxQueue','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','info'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3352,0x1bb));var _0x2335=function(_0x4af23c,_0x50e294){_0x4af23c=_0x4af23c-0x0;var _0x194b63=_0x3352[_0x4af23c];return _0x194b63;};'use strict';var _=require('lodash');var util=require(_0x2335('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2335('0x1'));var db=require(_0x2335('0x2'))['db'];var utils=require(_0x2335('0x3'));var logger=require(_0x2335('0x4'))(_0x2335('0x5'));var config=require(_0x2335('0x6'));var jayson=require(_0x2335('0x7'));var client=jayson[_0x2335('0x8')][_0x2335('0x9')]({'port':0x232a});config[_0x2335('0xa')]=_[_0x2335('0xb')](config[_0x2335('0xa')],{'host':_0x2335('0xc'),'port':0x18eb});var socket=require(_0x2335('0xd'))(new Redis(config[_0x2335('0xa')]));require(_0x2335('0xe'))[_0x2335('0xf')](socket);function respondWithRpcPromise(_0x24929b,_0x28c848,_0x33d3b6){return new BPromise(function(_0x1d8bcf,_0x1bbef3){return client['request'](_0x24929b,_0x33d3b6)[_0x2335('0x10')](function(_0x4f4f52){logger['info']('FaxQueue,\x20%s,\x20%s',_0x28c848,'request\x20sent');logger['debug'](_0x2335('0x11'),_0x28c848,_0x2335('0x12'),JSON[_0x2335('0x13')](_0x4f4f52));if(_0x4f4f52[_0x2335('0x14')]){if(_0x4f4f52[_0x2335('0x14')][_0x2335('0x15')]===0x1f4){logger['error'](_0x2335('0x16'),_0x28c848,_0x4f4f52[_0x2335('0x14')][_0x2335('0x17')]);return _0x1bbef3(_0x4f4f52[_0x2335('0x14')][_0x2335('0x17')]);}logger[_0x2335('0x14')](_0x2335('0x16'),_0x28c848,_0x4f4f52['error'][_0x2335('0x17')]);return _0x1d8bcf(_0x4f4f52[_0x2335('0x14')][_0x2335('0x17')]);}else{logger[_0x2335('0x18')](_0x2335('0x16'),_0x28c848,_0x2335('0x12'));_0x1d8bcf(_0x4f4f52[_0x2335('0x19')][_0x2335('0x17')]);}})[_0x2335('0x1a')](function(_0x5a7e25){logger['error'](_0x2335('0x16'),_0x28c848,_0x5a7e25);_0x1bbef3(_0x5a7e25);});});}exports['GetFaxQueue']=function(_0x20b7e6){var _0x3f5676=this;return new Promise(function(_0x1601ef,_0x4f49ed){return db[_0x2335('0x1b')][_0x2335('0x1c')]({'raw':_0x20b7e6[_0x2335('0x1d')]?_0x20b7e6[_0x2335('0x1d')][_0x2335('0x1e')]===undefined?!![]:![]:!![],'where':_0x20b7e6[_0x2335('0x1d')]?_0x20b7e6[_0x2335('0x1d')][_0x2335('0x1f')]||null:null,'attributes':_0x20b7e6[_0x2335('0x1d')]?_0x20b7e6[_0x2335('0x1d')][_0x2335('0x20')]||null:null,'limit':_0x20b7e6['options']?_0x20b7e6[_0x2335('0x1d')]['limit']||null:null,'include':_0x20b7e6['options']?_0x20b7e6[_0x2335('0x1d')][_0x2335('0x21')]?_[_0x2335('0x22')](_0x20b7e6[_0x2335('0x1d')][_0x2335('0x21')],function(_0x1999cf){return{'model':db[_0x1999cf['model']],'as':_0x1999cf['as'],'attributes':_0x1999cf['attributes'],'include':_0x1999cf[_0x2335('0x21')]?_[_0x2335('0x22')](_0x1999cf[_0x2335('0x21')],function(_0x585778){return{'model':db[_0x585778[_0x2335('0x23')]],'as':_0x585778['as'],'attributes':_0x585778[_0x2335('0x20')],'include':_0x585778[_0x2335('0x21')]?_[_0x2335('0x22')](_0x585778[_0x2335('0x21')],function(_0x283854){return{'model':db[_0x283854['model']],'as':_0x283854['as'],'attributes':_0x283854[_0x2335('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2335('0x10')](function(_0xa8ee8a){logger['info'](_0x2335('0x24'),_0x20b7e6);logger[_0x2335('0x25')]('GetFaxQueue',_0x20b7e6,JSON[_0x2335('0x13')](_0xa8ee8a));_0x1601ef(_0xa8ee8a);})[_0x2335('0x1a')](function(_0x5016d4){logger[_0x2335('0x14')](_0x2335('0x24'),_0x5016d4[_0x2335('0x17')],_0x20b7e6);_0x4f49ed(_0x3f5676[_0x2335('0x14')](0x1f4,_0x5016d4[_0x2335('0x17')]));});});};exports[_0x2335('0x26')]=function(_0x448f49){var _0x54dd13=this;return new Promise(function(_0x1ceda0,_0x318637){return db[_0x2335('0x1b')]['find']({'raw':_0x448f49[_0x2335('0x1d')]?_0x448f49[_0x2335('0x1d')][_0x2335('0x1e')]===undefined?!![]:![]:!![],'where':_0x448f49[_0x2335('0x1d')]?_0x448f49[_0x2335('0x1d')]['where']||null:null,'attributes':_0x448f49['options']?_0x448f49[_0x2335('0x1d')][_0x2335('0x20')]||null:null,'include':_0x448f49['options']?_0x448f49[_0x2335('0x1d')]['include']?_[_0x2335('0x22')](_0x448f49['options']['include'],function(_0x145928){return{'model':db[_0x145928[_0x2335('0x23')]],'as':_0x145928['as'],'attributes':_0x145928[_0x2335('0x20')],'include':_0x145928[_0x2335('0x21')]?_[_0x2335('0x22')](_0x145928[_0x2335('0x21')],function(_0x2cc000){return{'model':db[_0x2cc000['model']],'as':_0x2cc000['as'],'attributes':_0x2cc000[_0x2335('0x20')],'include':_0x2cc000[_0x2335('0x21')]?_[_0x2335('0x22')](_0x2cc000[_0x2335('0x21')],function(_0x5dc1c7){return{'model':db[_0x5dc1c7[_0x2335('0x23')]],'as':_0x5dc1c7['as'],'attributes':_0x5dc1c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x2335('0x10')](function(_0x33bb7e){logger[_0x2335('0x18')](_0x2335('0x26'),_0x448f49);logger[_0x2335('0x25')](_0x2335('0x26'),_0x448f49,JSON['stringify'](_0x33bb7e));_0x1ceda0(_0x33bb7e);})['catch'](function(_0x3c2ad8){logger[_0x2335('0x14')]('ShowFaxQueue',_0x3c2ad8[_0x2335('0x17')],_0x448f49);_0x318637(_0x54dd13['error'](0x1f4,_0x3c2ad8[_0x2335('0x17')]));});});}; \ No newline at end of file +var _0xb3f5=['then','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','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','request'];(function(_0x52326b,_0x50e99c){var _0x3b695f=function(_0x5cb88e){while(--_0x5cb88e){_0x52326b['push'](_0x52326b['shift']());}};_0x3b695f(++_0x50e99c);}(_0xb3f5,0xeb));var _0x5b3f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb3f5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5b3f('0x0'));var util=require(_0x5b3f('0x1'));var moment=require(_0x5b3f('0x2'));var BPromise=require(_0x5b3f('0x3'));var rs=require(_0x5b3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b3f('0x6'))(_0x5b3f('0x7'));var config=require(_0x5b3f('0x8'));var jayson=require(_0x5b3f('0x9'));var client=jayson[_0x5b3f('0xa')][_0x5b3f('0xb')]({'port':0x232a});config[_0x5b3f('0xc')]=_['defaults'](config['redis'],{'host':_0x5b3f('0xd'),'port':0x18eb});var socket=require(_0x5b3f('0xe'))(new Redis(config[_0x5b3f('0xc')]));require(_0x5b3f('0xf'))['register'](socket);function respondWithRpcPromise(_0x3693ab,_0x266b13,_0xab8b47){return new BPromise(function(_0x2fa512,_0x2ce194){return client[_0x5b3f('0x10')](_0x3693ab,_0xab8b47)[_0x5b3f('0x11')](function(_0x2ae328){logger[_0x5b3f('0x12')](_0x5b3f('0x13'),_0x266b13,_0x5b3f('0x14'));logger[_0x5b3f('0x15')](_0x5b3f('0x16'),_0x266b13,'request\x20sent',JSON[_0x5b3f('0x17')](_0x2ae328));if(_0x2ae328[_0x5b3f('0x18')]){if(_0x2ae328['error'][_0x5b3f('0x19')]===0x1f4){logger[_0x5b3f('0x18')](_0x5b3f('0x13'),_0x266b13,_0x2ae328[_0x5b3f('0x18')][_0x5b3f('0x1a')]);return _0x2ce194(_0x2ae328['error'][_0x5b3f('0x1a')]);}logger[_0x5b3f('0x18')](_0x5b3f('0x13'),_0x266b13,_0x2ae328[_0x5b3f('0x18')][_0x5b3f('0x1a')]);return _0x2fa512(_0x2ae328[_0x5b3f('0x18')][_0x5b3f('0x1a')]);}else{logger[_0x5b3f('0x12')](_0x5b3f('0x13'),_0x266b13,'request\x20sent');_0x2fa512(_0x2ae328[_0x5b3f('0x1b')][_0x5b3f('0x1a')]);}})[_0x5b3f('0x1c')](function(_0x5bb8e0){logger[_0x5b3f('0x18')](_0x5b3f('0x13'),_0x266b13,_0x5bb8e0);_0x2ce194(_0x5bb8e0);});});}exports[_0x5b3f('0x1d')]=function(_0x50c07e){var _0x32dbd1=this;return new Promise(function(_0x304bc2,_0x1d44c0){return db[_0x5b3f('0x1e')][_0x5b3f('0x1f')]({'raw':_0x50c07e[_0x5b3f('0x20')]?_0x50c07e['options'][_0x5b3f('0x21')]===undefined?!![]:![]:!![],'where':_0x50c07e['options']?_0x50c07e['options'][_0x5b3f('0x22')]||null:null,'attributes':_0x50c07e[_0x5b3f('0x20')]?_0x50c07e[_0x5b3f('0x20')][_0x5b3f('0x23')]||null:null,'limit':_0x50c07e['options']?_0x50c07e[_0x5b3f('0x20')][_0x5b3f('0x24')]||null:null,'include':_0x50c07e['options']?_0x50c07e['options'][_0x5b3f('0x25')]?_[_0x5b3f('0x26')](_0x50c07e[_0x5b3f('0x20')][_0x5b3f('0x25')],function(_0x436328){return{'model':db[_0x436328[_0x5b3f('0x27')]],'as':_0x436328['as'],'attributes':_0x436328[_0x5b3f('0x23')],'include':_0x436328[_0x5b3f('0x25')]?_['map'](_0x436328[_0x5b3f('0x25')],function(_0x40cafe){return{'model':db[_0x40cafe[_0x5b3f('0x27')]],'as':_0x40cafe['as'],'attributes':_0x40cafe[_0x5b3f('0x23')],'include':_0x40cafe[_0x5b3f('0x25')]?_['map'](_0x40cafe[_0x5b3f('0x25')],function(_0x2a9664){return{'model':db[_0x2a9664[_0x5b3f('0x27')]],'as':_0x2a9664['as'],'attributes':_0x2a9664[_0x5b3f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x535e4d){logger[_0x5b3f('0x12')]('GetFaxQueue',_0x50c07e);logger['debug'](_0x5b3f('0x1d'),_0x50c07e,JSON[_0x5b3f('0x17')](_0x535e4d));_0x304bc2(_0x535e4d);})[_0x5b3f('0x1c')](function(_0x13afd2){logger[_0x5b3f('0x18')]('GetFaxQueue',_0x13afd2[_0x5b3f('0x1a')],_0x50c07e);_0x1d44c0(_0x32dbd1['error'](0x1f4,_0x13afd2[_0x5b3f('0x1a')]));});});};exports[_0x5b3f('0x28')]=function(_0x3da258){var _0x26a62b=this;return new Promise(function(_0x313c67,_0x588221){return db[_0x5b3f('0x1e')][_0x5b3f('0x29')]({'raw':_0x3da258[_0x5b3f('0x20')]?_0x3da258[_0x5b3f('0x20')][_0x5b3f('0x21')]===undefined?!![]:![]:!![],'where':_0x3da258[_0x5b3f('0x20')]?_0x3da258[_0x5b3f('0x20')]['where']||null:null,'attributes':_0x3da258['options']?_0x3da258[_0x5b3f('0x20')]['attributes']||null:null,'include':_0x3da258[_0x5b3f('0x20')]?_0x3da258['options'][_0x5b3f('0x25')]?_[_0x5b3f('0x26')](_0x3da258['options'][_0x5b3f('0x25')],function(_0x5ee033){return{'model':db[_0x5ee033[_0x5b3f('0x27')]],'as':_0x5ee033['as'],'attributes':_0x5ee033[_0x5b3f('0x23')],'include':_0x5ee033[_0x5b3f('0x25')]?_[_0x5b3f('0x26')](_0x5ee033[_0x5b3f('0x25')],function(_0x46e72a){return{'model':db[_0x46e72a[_0x5b3f('0x27')]],'as':_0x46e72a['as'],'attributes':_0x46e72a[_0x5b3f('0x23')],'include':_0x46e72a[_0x5b3f('0x25')]?_[_0x5b3f('0x26')](_0x46e72a[_0x5b3f('0x25')],function(_0x42defc){return{'model':db[_0x42defc[_0x5b3f('0x27')]],'as':_0x42defc['as'],'attributes':_0x42defc[_0x5b3f('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5b3f('0x11')](function(_0x17d4b5){logger[_0x5b3f('0x12')](_0x5b3f('0x28'),_0x3da258);logger[_0x5b3f('0x15')](_0x5b3f('0x28'),_0x3da258,JSON[_0x5b3f('0x17')](_0x17d4b5));_0x313c67(_0x17d4b5);})[_0x5b3f('0x1c')](function(_0x678531){logger[_0x5b3f('0x18')](_0x5b3f('0x28'),_0x678531['message'],_0x3da258);_0x588221(_0x26a62b[_0x5b3f('0x18')](0x1f4,_0x678531[_0x5b3f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 3f221a9..5363bf6 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 _0xd8f6=['save','remove','update','emit','removeListener','register','length','faxQueue:'];(function(_0x46bc91,_0x2be289){var _0x29b464=function(_0x26c3aa){while(--_0x26c3aa){_0x46bc91['push'](_0x46bc91['shift']());}};_0x29b464(++_0x2be289);}(_0xd8f6,0xf0));var _0x6d8f=function(_0x380ce5,_0x50b282){_0x380ce5=_0x380ce5-0x0;var _0x139794=_0xd8f6[_0x380ce5];return _0x139794;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x6d8f('0x0'),_0x6d8f('0x1'),_0x6d8f('0x2')];function createListener(_0x21f123,_0x49244d){return function(_0x358289){_0x49244d[_0x6d8f('0x3')](_0x21f123,_0x358289);};}function removeListener(_0xa4dc98,_0x508445){return function(){FaxQueueEvents[_0x6d8f('0x4')](_0xa4dc98,_0x508445);};}exports[_0x6d8f('0x5')]=function(_0x226398){for(var _0xb94769=0x0,_0x5ec4ba=events[_0x6d8f('0x6')];_0xb94769<_0x5ec4ba;_0xb94769++){var _0x5c6ac7=events[_0xb94769];var _0x17f33d=createListener(_0x6d8f('0x7')+_0x5c6ac7,_0x226398);FaxQueueEvents['on'](_0x5c6ac7,_0x17f33d);}}; \ No newline at end of file +var _0xdc8c=['length','faxQueue:','./faxQueue.events','save','removeListener'];(function(_0x4b358c,_0x5564ea){var _0x48bb60=function(_0x5f18c1){while(--_0x5f18c1){_0x4b358c['push'](_0x4b358c['shift']());}};_0x48bb60(++_0x5564ea);}(_0xdc8c,0xd9));var _0xcdc8=function(_0x29dc1d,_0x1b9640){_0x29dc1d=_0x29dc1d-0x0;var _0x42bf1c=_0xdc8c[_0x29dc1d];return _0x42bf1c;};'use strict';var FaxQueueEvents=require(_0xcdc8('0x0'));var events=[_0xcdc8('0x1'),'remove','update'];function createListener(_0x2480d5,_0x55ebc3){return function(_0xbf2050){_0x55ebc3['emit'](_0x2480d5,_0xbf2050);};}function removeListener(_0x1ea31e,_0x3adbf0){return function(){FaxQueueEvents[_0xcdc8('0x2')](_0x1ea31e,_0x3adbf0);};}exports['register']=function(_0x2808b1){for(var _0x36e0db=0x0,_0x2feede=events[_0xcdc8('0x3')];_0x36e0db<_0x2feede;_0x36e0db++){var _0x1f6292=events[_0x36e0db];var _0x1830d2=createListener(_0xcdc8('0x4')+_0x1f6292,_0x2808b1);FaxQueueEvents['on'](_0x1f6292,_0x1830d2);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 08bc71c..e9da61c 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 _0xe3da=['/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','/:id','update','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers'];(function(_0x3f8b2e,_0x3bff5a){var _0x24a3a5=function(_0x41493d){while(--_0x41493d){_0x3f8b2e['push'](_0x3f8b2e['shift']());}};_0x24a3a5(++_0x3bff5a);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0xb')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0xb')]('/:id/teams',auth[_0xae3d('0xc')](),controller['getTeams']);router[_0xae3d('0xb')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x14')]);router['post']('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x15')]);router[_0xae3d('0x16')](_0xae3d('0x17'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x18')]);router[_0xae3d('0x16')]('/:id/users',auth[_0xae3d('0xc')](),controller[_0xae3d('0x19')]);router[_0xae3d('0x1a')](_0xae3d('0x1b'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1c')]);router['delete'](_0xae3d('0x1b'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1d')]);router['delete'](_0xae3d('0x17'),auth[_0xae3d('0xc')](),controller['removeTeams']);router['delete'](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1e')]);module[_0xae3d('0x1f')]=router; \ No newline at end of file +var _0xb46f=['addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams'];(function(_0x2863c0,_0x4cc0d9){var _0x152c27=function(_0x208807){while(--_0x208807){_0x2863c0['push'](_0x2863c0['shift']());}};_0x152c27(++_0x4cc0d9);}(_0xb46f,0xb6));var _0xfb46=function(_0x5d9f26,_0x3aa76c){_0x5d9f26=_0x5d9f26-0x0;var _0xf8441f=_0xb46f[_0x5d9f26];return _0xf8441f;};'use strict';var multer=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var path=require('path');var timeout=require(_0xfb46('0x2'));var express=require(_0xfb46('0x3'));var router=express[_0xfb46('0x4')]();var fs_extra=require(_0xfb46('0x5'));var auth=require(_0xfb46('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb46('0x7'));var controller=require('./faxQueue.controller');router[_0xfb46('0x8')]('/',auth[_0xfb46('0x9')](),controller[_0xfb46('0xa')]);router[_0xfb46('0x8')](_0xfb46('0xb'),auth['isAuthenticated'](),controller[_0xfb46('0xc')]);router[_0xfb46('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xfb46('0xd'),auth['isAuthenticated'](),controller[_0xfb46('0xe')]);router[_0xfb46('0x8')](_0xfb46('0xf'),auth[_0xfb46('0x9')](),controller[_0xfb46('0x10')]);router[_0xfb46('0x8')](_0xfb46('0x11'),auth[_0xfb46('0x9')](),controller[_0xfb46('0x12')]);router[_0xfb46('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfb46('0x13')]('/:id/teams',auth[_0xfb46('0x9')](),controller[_0xfb46('0x14')]);router['post'](_0xfb46('0x11'),auth[_0xfb46('0x9')](),controller[_0xfb46('0x15')]);router[_0xfb46('0x16')]('/:id',auth[_0xfb46('0x9')](),controller[_0xfb46('0x17')]);router[_0xfb46('0x18')]('/:id',auth[_0xfb46('0x9')](),controller[_0xfb46('0x19')]);router['delete']('/:id/teams',auth[_0xfb46('0x9')](),controller[_0xfb46('0x1a')]);router[_0xfb46('0x18')](_0xfb46('0x11'),auth[_0xfb46('0x9')](),controller[_0xfb46('0x1b')]);module[_0xfb46('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 8bf0fb8..45a59ce 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 _0x902d=['STRING','DATE','moment','sequelize','exports'];(function(_0x288527,_0x1870eb){var _0xc8b569=function(_0x5f0b74){while(--_0x5f0b74){_0x288527['push'](_0x288527['shift']());}};_0xc8b569(++_0x1870eb);}(_0x902d,0x11f));var _0xd902=function(_0x582ab9,_0x5f08b6){_0x582ab9=_0x582ab9-0x0;var _0x3732d3=_0x902d[_0x582ab9];return _0x3732d3;};'use strict';var moment=require(_0xd902('0x0'));var Sequelize=require(_0xd902('0x1'));module[_0xd902('0x2')]={'uniqueid':{'type':Sequelize[_0xd902('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd902('0x3')]},'joinAt':{'type':Sequelize[_0xd902('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd902('0x4')]},'exitAt':{'type':Sequelize[_0xd902('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdcbb=['DATE','moment','sequelize','exports','STRING'];(function(_0x10faf,_0x45c106){var _0x38985f=function(_0x5c9e34){while(--_0x5c9e34){_0x10faf['push'](_0x10faf['shift']());}};_0x38985f(++_0x45c106);}(_0xdcbb,0x18c));var _0xbdcb=function(_0x248b81,_0x439449){_0x248b81=_0x248b81-0x0;var _0x3f6b9d=_0xdcbb[_0x248b81];return _0x3f6b9d;};'use strict';var moment=require(_0xbdcb('0x0'));var Sequelize=require(_0xbdcb('0x1'));module[_0xbdcb('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xbdcb('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbdcb('0x4')]},'acceptAt':{'type':Sequelize[_0xbdcb('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 2cf9597..7e061f3 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 _0x37f8=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','index','FaxQueueReport','rawAttributes','fieldName','map','query','keys','filters','model','intersection','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','rows','catch','show','attributes','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','ejs'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x37f8,0xd2));var _0x837f=function(_0x5ea4b2,_0x366fa3){_0x5ea4b2=_0x5ea4b2-0x0;var _0x21b8cc=_0x37f8[_0x5ea4b2];return _0x21b8cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837f('0x0'));var zipdir=require(_0x837f('0x1'));var jsonpatch=require(_0x837f('0x2'));var rp=require(_0x837f('0x3'));var moment=require('moment');var BPromise=require(_0x837f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x837f('0x5'));var fs=require('fs');var fs_extra=require(_0x837f('0x6'));var _=require(_0x837f('0x7'));var squel=require(_0x837f('0x8'));var crypto=require(_0x837f('0x9'));var jsforce=require(_0x837f('0xa'));var deskjs=require(_0x837f('0xb'));var toCsv=require(_0x837f('0xc'));var querystring=require(_0x837f('0xd'));var Papa=require(_0x837f('0xe'));var Redis=require(_0x837f('0xf'));var authService=require(_0x837f('0x10'));var qs=require(_0x837f('0x11'));var as=require(_0x837f('0x12'));var hardwareService=require(_0x837f('0x13'));var logger=require('../../config/logger')(_0x837f('0x14'));var utils=require(_0x837f('0x15'));var config=require(_0x837f('0x16'));var licenseUtil=require(_0x837f('0x17'));var db=require(_0x837f('0x18'))['db'];function respondWithStatusCode(_0x4a8c00,_0x53045e){_0x53045e=_0x53045e||0xcc;return function(_0x14ff6d){if(_0x14ff6d){return _0x4a8c00[_0x837f('0x19')](_0x53045e);}return _0x4a8c00[_0x837f('0x1a')](_0x53045e)[_0x837f('0x1b')]();};}function respondWithResult(_0x2b3cd6,_0x483267){_0x483267=_0x483267||0xc8;return function(_0x18d8aa){if(_0x18d8aa){return _0x2b3cd6[_0x837f('0x1a')](_0x483267)[_0x837f('0x1c')](_0x18d8aa);}};}function respondWithFilteredResult(_0x1664e7,_0x2e4257){return function(_0x29369d){if(_0x29369d){var _0x546352=typeof _0x2e4257[_0x837f('0x1d')]===_0x837f('0x1e')&&typeof _0x2e4257['limit']===_0x837f('0x1e');var _0x2745f6=_0x29369d[_0x837f('0x1f')];var _0x1d17b3=_0x546352?0x0:_0x2e4257['offset'];var _0x1d974f=_0x546352?_0x29369d[_0x837f('0x1f')]:_0x2e4257[_0x837f('0x1d')]+_0x2e4257[_0x837f('0x20')];var _0x14b3da;if(_0x1d974f>=_0x2745f6){_0x1d974f=_0x2745f6;_0x14b3da=0xc8;}else{_0x14b3da=0xce;}_0x1664e7['status'](_0x14b3da);return _0x1664e7[_0x837f('0x21')](_0x837f('0x22'),_0x1d17b3+'-'+_0x1d974f+'/'+_0x2745f6)[_0x837f('0x1c')](_0x29369d);}return null;};}function patchUpdates(_0x33c7cb){return function(_0x3540f3){try{jsonpatch['apply'](_0x3540f3,_0x33c7cb,!![]);}catch(_0x2e9603){return BPromise[_0x837f('0x23')](_0x2e9603);}return _0x3540f3[_0x837f('0x24')]();};}function saveUpdates(_0xe68eb1,_0xa0af78){return function(_0x237656){if(_0x237656){return _0x237656[_0x837f('0x25')](_0xe68eb1)[_0x837f('0x26')](function(_0x11a9b3){return _0x11a9b3;});}return null;};}function removeEntity(_0x168455,_0x3fa18e){return function(_0xfb4df0){if(_0xfb4df0){return _0xfb4df0[_0x837f('0x27')]()[_0x837f('0x26')](function(){_0x168455[_0x837f('0x1a')](0xcc)[_0x837f('0x1b')]();});}};}function handleEntityNotFound(_0x43ca7d,_0x38da9f){return function(_0x1a6f26){if(!_0x1a6f26){_0x43ca7d[_0x837f('0x19')](0x194);}return _0x1a6f26;};}function handleError(_0x2c6a90,_0x246637){_0x246637=_0x246637||0x1f4;return function(_0x21f826){logger['error'](_0x21f826[_0x837f('0x28')]);if(_0x21f826[_0x837f('0x29')]){delete _0x21f826[_0x837f('0x29')];}_0x2c6a90['status'](_0x246637)['send'](_0x21f826);};}exports[_0x837f('0x2a')]=function(_0x1ab2e4,_0x1435fd){var _0x4072a4={},_0x30a3d9={},_0x387533={'count':0x0,'rows':[]};var _0x323565=_['map'](db[_0x837f('0x2b')][_0x837f('0x2c')],function(_0x266871){return{'name':_0x266871[_0x837f('0x2d')],'type':_0x266871['type']['key']};});_0x30a3d9['model']=_[_0x837f('0x2e')](_0x323565,_0x837f('0x29'));_0x30a3d9[_0x837f('0x2f')]=_[_0x837f('0x30')](_0x1ab2e4['query']);_0x30a3d9[_0x837f('0x31')]=_['intersection'](_0x30a3d9[_0x837f('0x32')],_0x30a3d9['query']);_0x4072a4['attributes']=_[_0x837f('0x33')](_0x30a3d9[_0x837f('0x32')],qs[_0x837f('0x34')](_0x1ab2e4[_0x837f('0x2f')][_0x837f('0x34')]));_0x4072a4['attributes']=_0x4072a4['attributes'][_0x837f('0x35')]?_0x4072a4['attributes']:_0x30a3d9[_0x837f('0x32')];if(!_0x1ab2e4[_0x837f('0x2f')]['hasOwnProperty'](_0x837f('0x36'))){_0x4072a4[_0x837f('0x20')]=qs[_0x837f('0x20')](_0x1ab2e4[_0x837f('0x2f')][_0x837f('0x20')]);_0x4072a4['offset']=qs[_0x837f('0x1d')](_0x1ab2e4[_0x837f('0x2f')][_0x837f('0x1d')]);}_0x4072a4[_0x837f('0x37')]=qs[_0x837f('0x38')](_0x1ab2e4['query']['sort']);_0x4072a4[_0x837f('0x39')]=qs['filters'](_['pick'](_0x1ab2e4[_0x837f('0x2f')],_0x30a3d9[_0x837f('0x31')]),_0x323565);if(_0x1ab2e4['query']['filter']){_0x4072a4[_0x837f('0x39')]=_[_0x837f('0x3a')](_0x4072a4[_0x837f('0x39')],{'$or':_['map'](_0x323565,function(_0x26fb32){if(_0x26fb32[_0x837f('0x3b')]!==_0x837f('0x3c')){var _0x214e50={};_0x214e50[_0x26fb32[_0x837f('0x29')]]={'$like':'%'+_0x1ab2e4['query']['filter']+'%'};return _0x214e50;}})});}_0x4072a4=_[_0x837f('0x3a')]({},_0x4072a4,_0x1ab2e4[_0x837f('0x3d')]);var _0x2b859a={'where':_0x4072a4['where']};return db['FaxQueueReport'][_0x837f('0x1f')](_0x2b859a)[_0x837f('0x26')](function(_0x207bcb){_0x387533['count']=_0x207bcb;if(_0x1ab2e4[_0x837f('0x2f')][_0x837f('0x3e')]){_0x4072a4['include']=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x4072a4);})[_0x837f('0x26')](function(_0x3509b6){_0x387533[_0x837f('0x3f')]=_0x3509b6;return _0x387533;})[_0x837f('0x26')](respondWithFilteredResult(_0x1435fd,_0x4072a4))[_0x837f('0x40')](handleError(_0x1435fd,null));};exports[_0x837f('0x41')]=function(_0x199769,_0x4e6ec9){var _0xdbd892={'raw':!![],'where':{'id':_0x199769['params']['id']}},_0xb06317={};_0xb06317[_0x837f('0x32')]=_[_0x837f('0x30')](db['FaxQueueReport'][_0x837f('0x2c')]);_0xb06317[_0x837f('0x2f')]=_[_0x837f('0x30')](_0x199769[_0x837f('0x2f')]);_0xb06317[_0x837f('0x31')]=_[_0x837f('0x33')](_0xb06317['model'],_0xb06317[_0x837f('0x2f')]);_0xdbd892[_0x837f('0x42')]=_[_0x837f('0x33')](_0xb06317[_0x837f('0x32')],qs[_0x837f('0x34')](_0x199769[_0x837f('0x2f')][_0x837f('0x34')]));_0xdbd892[_0x837f('0x42')]=_0xdbd892['attributes'][_0x837f('0x35')]?_0xdbd892[_0x837f('0x42')]:_0xb06317['model'];if(_0x199769[_0x837f('0x2f')][_0x837f('0x3e')]){_0xdbd892['include']=[{'all':!![]}];}_0xdbd892=_[_0x837f('0x3a')]({},_0xdbd892,_0x199769[_0x837f('0x3d')]);return db[_0x837f('0x2b')][_0x837f('0x43')](_0xdbd892)[_0x837f('0x26')](handleEntityNotFound(_0x4e6ec9,null))[_0x837f('0x26')](respondWithResult(_0x4e6ec9,null))['catch'](handleError(_0x4e6ec9,null));};exports[_0x837f('0x44')]=function(_0x4819d4,_0x1146ef){return db[_0x837f('0x2b')][_0x837f('0x44')](_0x4819d4[_0x837f('0x45')],{})[_0x837f('0x26')](respondWithResult(_0x1146ef,0xc9))[_0x837f('0x40')](handleError(_0x1146ef,null));};exports['update']=function(_0x554f74,_0x5edfcc){if(_0x554f74[_0x837f('0x45')]['id']){delete _0x554f74[_0x837f('0x45')]['id'];}return db['FaxQueueReport'][_0x837f('0x43')]({'where':{'id':_0x554f74['params']['id']}})[_0x837f('0x26')](handleEntityNotFound(_0x5edfcc,null))[_0x837f('0x26')](saveUpdates(_0x554f74[_0x837f('0x45')],null))[_0x837f('0x26')](respondWithResult(_0x5edfcc,null))[_0x837f('0x40')](handleError(_0x5edfcc,null));};exports[_0x837f('0x27')]=function(_0x4d9156,_0x23406b){return db['FaxQueueReport'][_0x837f('0x43')]({'where':{'id':_0x4d9156[_0x837f('0x46')]['id']}})[_0x837f('0x26')](handleEntityNotFound(_0x23406b,null))['then'](removeEntity(_0x23406b,null))[_0x837f('0x40')](handleError(_0x23406b,null));};exports[_0x837f('0x47')]=function(_0x1021e8,_0x166e52){return db[_0x837f('0x2b')][_0x837f('0x47')]()['then'](respondWithResult(_0x166e52,null))[_0x837f('0x40')](handleError(_0x166e52,null));}; \ No newline at end of file +var _0xdeb3=['filter','merge','options','FaxQueueReport','count','includeAll','rows','catch','show','keys','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x19154d,_0x282c59){var _0x5608ef=function(_0x13032d){while(--_0x13032d){_0x19154d['push'](_0x19154d['shift']());}};_0x5608ef(++_0x282c59);}(_0xdeb3,0xeb));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x3deb('0x0'));var rimraf=require(_0x3deb('0x1'));var zipdir=require(_0x3deb('0x2'));var jsonpatch=require(_0x3deb('0x3'));var rp=require(_0x3deb('0x4'));var moment=require(_0x3deb('0x5'));var BPromise=require(_0x3deb('0x6'));var Mustache=require(_0x3deb('0x7'));var util=require(_0x3deb('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3deb('0x9'));var fs=require('fs');var fs_extra=require(_0x3deb('0xa'));var _=require(_0x3deb('0xb'));var squel=require(_0x3deb('0xc'));var crypto=require(_0x3deb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3deb('0xe'));var querystring=require(_0x3deb('0xf'));var Papa=require(_0x3deb('0x10'));var Redis=require(_0x3deb('0x11'));var authService=require(_0x3deb('0x12'));var qs=require(_0x3deb('0x13'));var as=require(_0x3deb('0x14'));var hardwareService=require(_0x3deb('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3deb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3deb('0x17'))['db'];function respondWithStatusCode(_0x21f596,_0x78aa81){_0x78aa81=_0x78aa81||0xcc;return function(_0x1055dc){if(_0x1055dc){return _0x21f596['sendStatus'](_0x78aa81);}return _0x21f596[_0x3deb('0x18')](_0x78aa81)[_0x3deb('0x19')]();};}function respondWithResult(_0x1a651d,_0x228e23){_0x228e23=_0x228e23||0xc8;return function(_0x329f3a){if(_0x329f3a){return _0x1a651d[_0x3deb('0x18')](_0x228e23)[_0x3deb('0x1a')](_0x329f3a);}};}function respondWithFilteredResult(_0xa25716,_0x4a291e){return function(_0x428f90){if(_0x428f90){var _0xa45605=typeof _0x4a291e['offset']===_0x3deb('0x1b')&&typeof _0x4a291e[_0x3deb('0x1c')]==='undefined';var _0x5cd9db=_0x428f90['count'];var _0x2a8ec4=_0xa45605?0x0:_0x4a291e[_0x3deb('0x1d')];var _0x4adbaa=_0xa45605?_0x428f90['count']:_0x4a291e[_0x3deb('0x1d')]+_0x4a291e[_0x3deb('0x1c')];var _0xb6be32;if(_0x4adbaa>=_0x5cd9db){_0x4adbaa=_0x5cd9db;_0xb6be32=0xc8;}else{_0xb6be32=0xce;}_0xa25716[_0x3deb('0x18')](_0xb6be32);return _0xa25716['set'](_0x3deb('0x1e'),_0x2a8ec4+'-'+_0x4adbaa+'/'+_0x5cd9db)[_0x3deb('0x1a')](_0x428f90);}return null;};}function patchUpdates(_0xbd82de){return function(_0x4ceab2){try{jsonpatch[_0x3deb('0x1f')](_0x4ceab2,_0xbd82de,!![]);}catch(_0x144671){return BPromise[_0x3deb('0x20')](_0x144671);}return _0x4ceab2[_0x3deb('0x21')]();};}function saveUpdates(_0x22ea80,_0x543014){return function(_0x35843b){if(_0x35843b){return _0x35843b[_0x3deb('0x22')](_0x22ea80)[_0x3deb('0x23')](function(_0x428869){return _0x428869;});}return null;};}function removeEntity(_0x12f415,_0x385e2a){return function(_0x3f3d52){if(_0x3f3d52){return _0x3f3d52[_0x3deb('0x24')]()['then'](function(){_0x12f415[_0x3deb('0x18')](0xcc)[_0x3deb('0x19')]();});}};}function handleEntityNotFound(_0x1aacbd,_0x427f9f){return function(_0x472a46){if(!_0x472a46){_0x1aacbd['sendStatus'](0x194);}return _0x472a46;};}function handleError(_0x1185dd,_0x225ea9){_0x225ea9=_0x225ea9||0x1f4;return function(_0x474878){logger[_0x3deb('0x25')](_0x474878[_0x3deb('0x26')]);if(_0x474878[_0x3deb('0x27')]){delete _0x474878[_0x3deb('0x27')];}_0x1185dd['status'](_0x225ea9)['send'](_0x474878);};}exports[_0x3deb('0x28')]=function(_0x520f24,_0x2efb59){var _0x28a4ca={},_0x2bd20f={},_0x492ca0={'count':0x0,'rows':[]};var _0x460512=_['map'](db['FaxQueueReport'][_0x3deb('0x29')],function(_0x205c22){return{'name':_0x205c22[_0x3deb('0x2a')],'type':_0x205c22[_0x3deb('0x2b')]['key']};});_0x2bd20f['model']=_[_0x3deb('0x2c')](_0x460512,_0x3deb('0x27'));_0x2bd20f['query']=_['keys'](_0x520f24[_0x3deb('0x2d')]);_0x2bd20f[_0x3deb('0x2e')]=_[_0x3deb('0x2f')](_0x2bd20f['model'],_0x2bd20f[_0x3deb('0x2d')]);_0x28a4ca['attributes']=_[_0x3deb('0x2f')](_0x2bd20f[_0x3deb('0x30')],qs[_0x3deb('0x31')](_0x520f24[_0x3deb('0x2d')][_0x3deb('0x31')]));_0x28a4ca[_0x3deb('0x32')]=_0x28a4ca[_0x3deb('0x32')][_0x3deb('0x33')]?_0x28a4ca[_0x3deb('0x32')]:_0x2bd20f[_0x3deb('0x30')];if(!_0x520f24['query'][_0x3deb('0x34')](_0x3deb('0x35'))){_0x28a4ca[_0x3deb('0x1c')]=qs[_0x3deb('0x1c')](_0x520f24[_0x3deb('0x2d')][_0x3deb('0x1c')]);_0x28a4ca[_0x3deb('0x1d')]=qs[_0x3deb('0x1d')](_0x520f24[_0x3deb('0x2d')][_0x3deb('0x1d')]);}_0x28a4ca[_0x3deb('0x36')]=qs[_0x3deb('0x37')](_0x520f24[_0x3deb('0x2d')][_0x3deb('0x37')]);_0x28a4ca[_0x3deb('0x38')]=qs[_0x3deb('0x2e')](_['pick'](_0x520f24['query'],_0x2bd20f[_0x3deb('0x2e')]),_0x460512);if(_0x520f24[_0x3deb('0x2d')][_0x3deb('0x39')]){_0x28a4ca['where']=_[_0x3deb('0x3a')](_0x28a4ca['where'],{'$or':_[_0x3deb('0x2c')](_0x460512,function(_0x53525c){if(_0x53525c[_0x3deb('0x2b')]!=='VIRTUAL'){var _0x3103c5={};_0x3103c5[_0x53525c[_0x3deb('0x27')]]={'$like':'%'+_0x520f24[_0x3deb('0x2d')][_0x3deb('0x39')]+'%'};return _0x3103c5;}})});}_0x28a4ca=_['merge']({},_0x28a4ca,_0x520f24[_0x3deb('0x3b')]);var _0x53fdef={'where':_0x28a4ca[_0x3deb('0x38')]};return db[_0x3deb('0x3c')][_0x3deb('0x3d')](_0x53fdef)[_0x3deb('0x23')](function(_0x3c9310){_0x492ca0[_0x3deb('0x3d')]=_0x3c9310;if(_0x520f24[_0x3deb('0x2d')][_0x3deb('0x3e')]){_0x28a4ca['include']=[{'all':!![]}];}return db[_0x3deb('0x3c')]['findAll'](_0x28a4ca);})['then'](function(_0x5bbbfa){_0x492ca0[_0x3deb('0x3f')]=_0x5bbbfa;return _0x492ca0;})[_0x3deb('0x23')](respondWithFilteredResult(_0x2efb59,_0x28a4ca))[_0x3deb('0x40')](handleError(_0x2efb59,null));};exports[_0x3deb('0x41')]=function(_0x27a64e,_0x7e7374){var _0x2e2c03={'raw':!![],'where':{'id':_0x27a64e['params']['id']}},_0x4eed4a={};_0x4eed4a[_0x3deb('0x30')]=_[_0x3deb('0x42')](db[_0x3deb('0x3c')][_0x3deb('0x29')]);_0x4eed4a[_0x3deb('0x2d')]=_['keys'](_0x27a64e[_0x3deb('0x2d')]);_0x4eed4a[_0x3deb('0x2e')]=_[_0x3deb('0x2f')](_0x4eed4a['model'],_0x4eed4a[_0x3deb('0x2d')]);_0x2e2c03[_0x3deb('0x32')]=_[_0x3deb('0x2f')](_0x4eed4a[_0x3deb('0x30')],qs[_0x3deb('0x31')](_0x27a64e['query'][_0x3deb('0x31')]));_0x2e2c03[_0x3deb('0x32')]=_0x2e2c03[_0x3deb('0x32')]['length']?_0x2e2c03['attributes']:_0x4eed4a[_0x3deb('0x30')];if(_0x27a64e[_0x3deb('0x2d')][_0x3deb('0x3e')]){_0x2e2c03[_0x3deb('0x43')]=[{'all':!![]}];}_0x2e2c03=_[_0x3deb('0x3a')]({},_0x2e2c03,_0x27a64e['options']);return db[_0x3deb('0x3c')][_0x3deb('0x44')](_0x2e2c03)[_0x3deb('0x23')](handleEntityNotFound(_0x7e7374,null))[_0x3deb('0x23')](respondWithResult(_0x7e7374,null))[_0x3deb('0x40')](handleError(_0x7e7374,null));};exports[_0x3deb('0x45')]=function(_0x524ac8,_0x384788){return db[_0x3deb('0x3c')]['create'](_0x524ac8[_0x3deb('0x46')],{})[_0x3deb('0x23')](respondWithResult(_0x384788,0xc9))[_0x3deb('0x40')](handleError(_0x384788,null));};exports[_0x3deb('0x22')]=function(_0x448505,_0x4b3cd6){if(_0x448505[_0x3deb('0x46')]['id']){delete _0x448505[_0x3deb('0x46')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x448505['params']['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x4b3cd6,null))[_0x3deb('0x23')](saveUpdates(_0x448505['body'],null))['then'](respondWithResult(_0x4b3cd6,null))[_0x3deb('0x40')](handleError(_0x4b3cd6,null));};exports[_0x3deb('0x24')]=function(_0x8aabc0,_0x3b4688){return db['FaxQueueReport'][_0x3deb('0x44')]({'where':{'id':_0x8aabc0[_0x3deb('0x47')]['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x3b4688,null))[_0x3deb('0x23')](removeEntity(_0x3b4688,null))[_0x3deb('0x40')](handleError(_0x3b4688,null));};exports[_0x3deb('0x48')]=function(_0x19a1d7,_0x662ee6){return db['FaxQueueReport']['describe']()[_0x3deb('0x23')](respondWithResult(_0x662ee6,null))[_0x3deb('0x40')](handleError(_0x662ee6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index ff38f57..e4ae979 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x814b,0x1a2));var _0xb814=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x814b[_0x4aa838];return _0x3abff0;};'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_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x54b745,_0x5a9d1c){var _0x476fc0=function(_0x486966){while(--_0x486966){_0x54b745['push'](_0x54b745['shift']());}};_0x476fc0(++_0x5a9d1c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index a4bf631..30188f5 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 _0xc9d2=['FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','raw','then','update','options','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x186278,_0x592e41){var _0x256ce0=function(_0x29385e){while(--_0x29385e){_0x186278['push'](_0x186278['shift']());}};_0x256ce0(++_0x592e41);}(_0xc9d2,0x159));var _0x2c9d=function(_0x144aff,_0x5e638f){_0x144aff=_0x144aff-0x0;var _0x481d2a=_0xc9d2[_0x144aff];return _0x481d2a;};'use strict';var _=require(_0x2c9d('0x0'));var util=require(_0x2c9d('0x1'));var moment=require(_0x2c9d('0x2'));var BPromise=require(_0x2c9d('0x3'));var rs=require(_0x2c9d('0x4'));var fs=require('fs');var Redis=require(_0x2c9d('0x5'));var db=require(_0x2c9d('0x6'))['db'];var utils=require(_0x2c9d('0x7'));var logger=require(_0x2c9d('0x8'))(_0x2c9d('0x9'));var config=require(_0x2c9d('0xa'));var jayson=require(_0x2c9d('0xb'));var client=jayson['client'][_0x2c9d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x256590,_0x11474a,_0x378601){return new BPromise(function(_0x1d805e,_0xb51ebf){return client[_0x2c9d('0xd')](_0x256590,_0x378601)['then'](function(_0x10ec57){logger[_0x2c9d('0xe')](_0x2c9d('0xf'),_0x11474a,_0x2c9d('0x10'));logger[_0x2c9d('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x11474a,_0x2c9d('0x10'),JSON[_0x2c9d('0x12')](_0x10ec57));if(_0x10ec57['error']){if(_0x10ec57[_0x2c9d('0x13')][_0x2c9d('0x14')]===0x1f4){logger[_0x2c9d('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x11474a,_0x10ec57[_0x2c9d('0x13')][_0x2c9d('0x15')]);return _0xb51ebf(_0x10ec57[_0x2c9d('0x13')][_0x2c9d('0x15')]);}logger['error'](_0x2c9d('0xf'),_0x11474a,_0x10ec57[_0x2c9d('0x13')][_0x2c9d('0x15')]);return _0x1d805e(_0x10ec57[_0x2c9d('0x13')]['message']);}else{logger[_0x2c9d('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x11474a,_0x2c9d('0x10'));_0x1d805e(_0x10ec57[_0x2c9d('0x16')]['message']);}})[_0x2c9d('0x17')](function(_0xd91020){logger['error'](_0x2c9d('0xf'),_0x11474a,_0xd91020);_0xb51ebf(_0xd91020);});});}exports[_0x2c9d('0x18')]=function(_0x2bd4bb){var _0x23c91a=this;return new Promise(function(_0x284b05,_0x3b5f11){return db[_0x2c9d('0x19')][_0x2c9d('0x1a')](_0x2bd4bb[_0x2c9d('0x1b')],{'raw':_0x2bd4bb['options']?_0x2bd4bb['options'][_0x2c9d('0x1c')]===undefined?!![]:![]:!![]})[_0x2c9d('0x1d')](function(_0x4d5997){logger[_0x2c9d('0xe')](_0x2c9d('0x18'),_0x2bd4bb);logger[_0x2c9d('0x11')](_0x2c9d('0x18'),_0x2bd4bb,JSON['stringify'](_0x4d5997));_0x284b05(_0x4d5997);})[_0x2c9d('0x17')](function(_0xc33406){logger['error'](_0x2c9d('0x18'),_0xc33406['message'],_0x2bd4bb);_0x3b5f11(_0x23c91a[_0x2c9d('0x13')](0x1f4,_0xc33406['message']));});});};exports['UpdateFaxQueueReport']=function(_0x68f7d2){var _0x3b7e5c=this;return new Promise(function(_0x670b6f,_0x5a5ac5){return db[_0x2c9d('0x19')][_0x2c9d('0x1e')](_0x68f7d2[_0x2c9d('0x1b')],{'raw':_0x68f7d2['options']?_0x68f7d2[_0x2c9d('0x1f')][_0x2c9d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x68f7d2[_0x2c9d('0x1f')]?_0x68f7d2[_0x2c9d('0x1f')][_0x2c9d('0x20')]||null:null,'attributes':_0x68f7d2[_0x2c9d('0x1f')]?_0x68f7d2[_0x2c9d('0x1f')][_0x2c9d('0x21')]||null:null,'limit':_0x68f7d2[_0x2c9d('0x1f')]?_0x68f7d2[_0x2c9d('0x1f')][_0x2c9d('0x22')]||null:null})[_0x2c9d('0x1d')](function(_0x23c912){logger['info'](_0x2c9d('0x23'),_0x68f7d2);logger[_0x2c9d('0x11')](_0x2c9d('0x23'),_0x68f7d2,JSON[_0x2c9d('0x12')](_0x23c912));_0x670b6f(_0x23c912);})[_0x2c9d('0x17')](function(_0xaf3a60){logger['error'](_0x2c9d('0x23'),_0xaf3a60[_0x2c9d('0x15')],_0x68f7d2);_0x5a5ac5(_0x3b7e5c[_0x2c9d('0x13')](0x1f4,_0xaf3a60['message']));});});}; \ No newline at end of file +var _0x7708=['FaxQueueReport','create','body','options','stringify','catch','UpdateFaxQueueReport','update','attributes','limit','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7708,0x83));var _0x8770=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0x7708[_0x54a2e4];return _0x4742d0;};'use strict';var _=require(_0x8770('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8770('0x1'));var rs=require(_0x8770('0x2'));var fs=require('fs');var Redis=require(_0x8770('0x3'));var db=require(_0x8770('0x4'))['db'];var utils=require(_0x8770('0x5'));var logger=require('../../config/logger')(_0x8770('0x6'));var config=require(_0x8770('0x7'));var jayson=require(_0x8770('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d288b,_0x1795bc,_0x38c855){return new BPromise(function(_0x42e8f8,_0x20a583){return client[_0x8770('0x9')](_0x2d288b,_0x38c855)['then'](function(_0x134579){logger[_0x8770('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x1795bc,_0x8770('0xb'));logger[_0x8770('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1795bc,_0x8770('0xb'),JSON['stringify'](_0x134579));if(_0x134579[_0x8770('0xd')]){if(_0x134579['error'][_0x8770('0xe')]===0x1f4){logger[_0x8770('0xd')](_0x8770('0xf'),_0x1795bc,_0x134579['error'][_0x8770('0x10')]);return _0x20a583(_0x134579[_0x8770('0xd')]['message']);}logger[_0x8770('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1795bc,_0x134579[_0x8770('0xd')][_0x8770('0x10')]);return _0x42e8f8(_0x134579['error'][_0x8770('0x10')]);}else{logger[_0x8770('0xa')](_0x8770('0xf'),_0x1795bc,_0x8770('0xb'));_0x42e8f8(_0x134579[_0x8770('0x11')][_0x8770('0x10')]);}})['catch'](function(_0x1fd63b){logger[_0x8770('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1795bc,_0x1fd63b);_0x20a583(_0x1fd63b);});});}exports[_0x8770('0x12')]=function(_0x233f3a){var _0x10e927=this;return new Promise(function(_0x1b0bcc,_0x2a46eb){return db[_0x8770('0x13')][_0x8770('0x14')](_0x233f3a[_0x8770('0x15')],{'raw':_0x233f3a[_0x8770('0x16')]?_0x233f3a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x39765c){logger[_0x8770('0xa')](_0x8770('0x12'),_0x233f3a);logger[_0x8770('0xc')](_0x8770('0x12'),_0x233f3a,JSON[_0x8770('0x17')](_0x39765c));_0x1b0bcc(_0x39765c);})[_0x8770('0x18')](function(_0x2f1049){logger[_0x8770('0xd')]('CreateFaxQueueReport',_0x2f1049['message'],_0x233f3a);_0x2a46eb(_0x10e927[_0x8770('0xd')](0x1f4,_0x2f1049[_0x8770('0x10')]));});});};exports[_0x8770('0x19')]=function(_0x1e0ade){var _0x3a6eef=this;return new Promise(function(_0x278543,_0x58f32c){return db[_0x8770('0x13')][_0x8770('0x1a')](_0x1e0ade[_0x8770('0x15')],{'raw':_0x1e0ade[_0x8770('0x16')]?_0x1e0ade['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e0ade[_0x8770('0x16')]?_0x1e0ade['options']['where']||null:null,'attributes':_0x1e0ade['options']?_0x1e0ade['options'][_0x8770('0x1b')]||null:null,'limit':_0x1e0ade[_0x8770('0x16')]?_0x1e0ade[_0x8770('0x16')][_0x8770('0x1c')]||null:null})[_0x8770('0x1d')](function(_0x273027){logger['info'](_0x8770('0x19'),_0x1e0ade);logger[_0x8770('0xc')](_0x8770('0x19'),_0x1e0ade,JSON['stringify'](_0x273027));_0x278543(_0x273027);})[_0x8770('0x18')](function(_0x35049e){logger[_0x8770('0xd')](_0x8770('0x19'),_0x35049e[_0x8770('0x10')],_0x1e0ade);_0x58f32c(_0x3a6eef['error'](0x1f4,_0x35049e[_0x8770('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d26fcea..78f6eaa 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 _0xca61=['describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','index','/describe','isAuthenticated'];(function(_0x582f0c,_0xb17c82){var _0x421f3a=function(_0x366de9){while(--_0x366de9){_0x582f0c['push'](_0x582f0c['shift']());}};_0x421f3a(++_0xb17c82);}(_0xca61,0xec));var _0x1ca6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xca61[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x1ca6('0x0'));var util=require(_0x1ca6('0x1'));var path=require(_0x1ca6('0x2'));var timeout=require(_0x1ca6('0x3'));var express=require(_0x1ca6('0x4'));var router=express[_0x1ca6('0x5')]();var fs_extra=require(_0x1ca6('0x6'));var auth=require(_0x1ca6('0x7'));var interaction=require(_0x1ca6('0x8'));var config=require(_0x1ca6('0x9'));var controller=require(_0x1ca6('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ca6('0xb')]);router['get'](_0x1ca6('0xc'),auth[_0x1ca6('0xd')](),controller[_0x1ca6('0xe')]);router[_0x1ca6('0xf')](_0x1ca6('0x10'),auth[_0x1ca6('0xd')](),controller[_0x1ca6('0x11')]);router[_0x1ca6('0x12')]('/',auth['isAuthenticated'](),controller[_0x1ca6('0x13')]);router[_0x1ca6('0x14')](_0x1ca6('0x10'),auth['isAuthenticated'](),controller[_0x1ca6('0x15')]);router[_0x1ca6('0x16')](_0x1ca6('0x10'),auth['isAuthenticated'](),controller[_0x1ca6('0x17')]);module[_0x1ca6('0x18')]=router; \ No newline at end of file +var _0x1433=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','update','destroy','exports','multer'];(function(_0x548503,_0x1aa00c){var _0xf8f05f=function(_0x2014c2){while(--_0x2014c2){_0x548503['push'](_0x548503['shift']());}};_0xf8f05f(++_0x1aa00c);}(_0x1433,0x13f));var _0x3143=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1433[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x3143('0x0'));var util=require(_0x3143('0x1'));var path=require('path');var timeout=require(_0x3143('0x2'));var express=require(_0x3143('0x3'));var router=express[_0x3143('0x4')]();var fs_extra=require(_0x3143('0x5'));var auth=require(_0x3143('0x6'));var interaction=require(_0x3143('0x7'));var config=require('../../config/environment');var controller=require(_0x3143('0x8'));router[_0x3143('0x9')]('/',auth['isAuthenticated'](),controller[_0x3143('0xa')]);router[_0x3143('0x9')](_0x3143('0xb'),auth['isAuthenticated'](),controller[_0x3143('0xc')]);router[_0x3143('0x9')](_0x3143('0xd'),auth[_0x3143('0xe')](),controller[_0x3143('0xf')]);router[_0x3143('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3143('0xd'),auth[_0x3143('0xe')](),controller[_0x3143('0x11')]);router['delete'](_0x3143('0xd'),auth['isAuthenticated'](),controller[_0x3143('0x12')]);module[_0x3143('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 5b6494a..541f549 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3e27e4,_0xf2f98c){var _0x4ad0f0=function(_0x220ce0){while(--_0x220ce0){_0x3e27e4['push'](_0x3e27e4['shift']());}};_0x4ad0f0(++_0xf2f98c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0xcb91[_0x5cb97e];return _0x1714b4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x22046b,_0x44ab78){var _0xc3808d=function(_0x362a83){while(--_0x362a83){_0x22046b['push'](_0x22046b['shift']());}};_0xc3808d(++_0x44ab78);}(_0x70e0,0x17b));var _0x070e=function(_0x2cb825,_0x3788bf){_0x2cb825=_0x2cb825-0x0;var _0x315c53=_0x70e0[_0x2cb825];return _0x315c53;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d772319..14a2ef3 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 _0xcbbd=['set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','rawAttributes','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset'];(function(_0x22ab28,_0x544624){var _0x2e635a=function(_0x4a60e8){while(--_0x4a60e8){_0x22ab28['push'](_0x22ab28['shift']());}};_0x2e635a(++_0x544624);}(_0xcbbd,0x15c));var _0xdcbb=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0xcbbd[_0x1488cd];return _0x63fa13;};'use strict';var emlformat=require(_0xdcbb('0x0'));var rimraf=require(_0xdcbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdcbb('0x2'));var moment=require(_0xdcbb('0x3'));var BPromise=require(_0xdcbb('0x4'));var Mustache=require(_0xdcbb('0x5'));var util=require(_0xdcbb('0x6'));var path=require('path');var sox=require(_0xdcbb('0x7'));var csv=require(_0xdcbb('0x8'));var ejs=require(_0xdcbb('0x9'));var fs=require('fs');var fs_extra=require(_0xdcbb('0xa'));var _=require(_0xdcbb('0xb'));var squel=require('squel');var crypto=require(_0xdcbb('0xc'));var jsforce=require(_0xdcbb('0xd'));var deskjs=require(_0xdcbb('0xe'));var toCsv=require(_0xdcbb('0x8'));var querystring=require(_0xdcbb('0xf'));var Papa=require(_0xdcbb('0x10'));var Redis=require(_0xdcbb('0x11'));var authService=require(_0xdcbb('0x12'));var qs=require(_0xdcbb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcbb('0x14'))(_0xdcbb('0x15'));var utils=require(_0xdcbb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdcbb('0x17'));var db=require(_0xdcbb('0x18'))['db'];function respondWithStatusCode(_0x27c558,_0x2bf6c1){_0x2bf6c1=_0x2bf6c1||0xcc;return function(_0x3dd515){if(_0x3dd515){return _0x27c558[_0xdcbb('0x19')](_0x2bf6c1);}return _0x27c558[_0xdcbb('0x1a')](_0x2bf6c1)['end']();};}function respondWithResult(_0x115a72,_0x5337e1){_0x5337e1=_0x5337e1||0xc8;return function(_0x30bb8b){if(_0x30bb8b){return _0x115a72['status'](_0x5337e1)[_0xdcbb('0x1b')](_0x30bb8b);}};}function respondWithFilteredResult(_0x1bb08c,_0x29d0b2){return function(_0x59ff71){if(_0x59ff71){var _0x3fa2d7=typeof _0x29d0b2['offset']==='undefined'&&typeof _0x29d0b2[_0xdcbb('0x1c')]===_0xdcbb('0x1d');var _0x28dae2=_0x59ff71[_0xdcbb('0x1e')];var _0x14adf2=_0x3fa2d7?0x0:_0x29d0b2[_0xdcbb('0x1f')];var _0x3b7b2f=_0x3fa2d7?_0x59ff71[_0xdcbb('0x1e')]:_0x29d0b2[_0xdcbb('0x1f')]+_0x29d0b2[_0xdcbb('0x1c')];var _0x413480;if(_0x3b7b2f>=_0x28dae2){_0x3b7b2f=_0x28dae2;_0x413480=0xc8;}else{_0x413480=0xce;}_0x1bb08c[_0xdcbb('0x1a')](_0x413480);return _0x1bb08c[_0xdcbb('0x20')](_0xdcbb('0x21'),_0x14adf2+'-'+_0x3b7b2f+'/'+_0x28dae2)['json'](_0x59ff71);}return null;};}function patchUpdates(_0x57a2cc){return function(_0x12473c){try{jsonpatch[_0xdcbb('0x22')](_0x12473c,_0x57a2cc,!![]);}catch(_0x386cf7){return BPromise[_0xdcbb('0x23')](_0x386cf7);}return _0x12473c[_0xdcbb('0x24')]();};}function saveUpdates(_0x105f5c,_0x353256){return function(_0x4ebea2){if(_0x4ebea2){return _0x4ebea2[_0xdcbb('0x25')](_0x105f5c)[_0xdcbb('0x26')](function(_0x50ec6c){return _0x50ec6c;});}return null;};}function removeEntity(_0x26e753,_0x39763c){return function(_0x5bb720){if(_0x5bb720){return _0x5bb720[_0xdcbb('0x27')]()[_0xdcbb('0x26')](function(){_0x26e753['status'](0xcc)[_0xdcbb('0x28')]();});}};}function handleEntityNotFound(_0x40675f,_0x16236c){return function(_0x5d0963){if(!_0x5d0963){_0x40675f[_0xdcbb('0x19')](0x194);}return _0x5d0963;};}function handleError(_0xcf2d7e,_0x316fdb){_0x316fdb=_0x316fdb||0x1f4;return function(_0xac0513){logger[_0xdcbb('0x29')](_0xac0513[_0xdcbb('0x2a')]);if(_0xac0513['name']){delete _0xac0513[_0xdcbb('0x2b')];}_0xcf2d7e[_0xdcbb('0x1a')](_0x316fdb)[_0xdcbb('0x2c')](_0xac0513);};}exports[_0xdcbb('0x2d')]=function(_0x1bd94f,_0x3ad0c0){var _0x5ecf5e={},_0x531ab1={},_0x150956={'count':0x0,'rows':[]};var _0x25c8aa=_[_0xdcbb('0x2e')](db[_0xdcbb('0x2f')]['rawAttributes'],function(_0x4beef7){return{'name':_0x4beef7[_0xdcbb('0x30')],'type':_0x4beef7[_0xdcbb('0x31')][_0xdcbb('0x32')]};});_0x531ab1[_0xdcbb('0x33')]=_[_0xdcbb('0x2e')](_0x25c8aa,_0xdcbb('0x2b'));_0x531ab1[_0xdcbb('0x34')]=_[_0xdcbb('0x35')](_0x1bd94f[_0xdcbb('0x34')]);_0x531ab1['filters']=_['intersection'](_0x531ab1[_0xdcbb('0x33')],_0x531ab1['query']);_0x5ecf5e[_0xdcbb('0x36')]=_[_0xdcbb('0x37')](_0x531ab1['model'],qs['fields'](_0x1bd94f['query'][_0xdcbb('0x38')]));_0x5ecf5e[_0xdcbb('0x36')]=_0x5ecf5e[_0xdcbb('0x36')][_0xdcbb('0x39')]?_0x5ecf5e[_0xdcbb('0x36')]:_0x531ab1['model'];if(!_0x1bd94f['query'][_0xdcbb('0x3a')]('nolimit')){_0x5ecf5e[_0xdcbb('0x1c')]=qs['limit'](_0x1bd94f['query'][_0xdcbb('0x1c')]);_0x5ecf5e[_0xdcbb('0x1f')]=qs['offset'](_0x1bd94f[_0xdcbb('0x34')][_0xdcbb('0x1f')]);}_0x5ecf5e[_0xdcbb('0x3b')]=qs[_0xdcbb('0x3c')](_0x1bd94f[_0xdcbb('0x34')][_0xdcbb('0x3c')]);_0x5ecf5e[_0xdcbb('0x3d')]=qs[_0xdcbb('0x3e')](_['pick'](_0x1bd94f['query'],_0x531ab1[_0xdcbb('0x3e')]),_0x25c8aa);if(_0x1bd94f[_0xdcbb('0x34')][_0xdcbb('0x3f')]){_0x5ecf5e['where']=_[_0xdcbb('0x40')](_0x5ecf5e[_0xdcbb('0x3d')],{'$or':_[_0xdcbb('0x2e')](_0x25c8aa,function(_0x2fd841){if(_0x2fd841[_0xdcbb('0x31')]!==_0xdcbb('0x41')){var _0x2d66ad={};_0x2d66ad[_0x2fd841[_0xdcbb('0x2b')]]={'$like':'%'+_0x1bd94f[_0xdcbb('0x34')]['filter']+'%'};return _0x2d66ad;}})});}_0x5ecf5e=_['merge']({},_0x5ecf5e,_0x1bd94f[_0xdcbb('0x42')]);var _0x2f9df8={'where':_0x5ecf5e[_0xdcbb('0x3d')]};return db[_0xdcbb('0x2f')]['count'](_0x2f9df8)[_0xdcbb('0x26')](function(_0x55a227){_0x150956[_0xdcbb('0x1e')]=_0x55a227;if(_0x1bd94f['query']['includeAll']){_0x5ecf5e[_0xdcbb('0x43')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xdcbb('0x44')](_0x5ecf5e);})[_0xdcbb('0x26')](function(_0x2c94a8){_0x150956['rows']=_0x2c94a8;return _0x150956;})[_0xdcbb('0x26')](respondWithFilteredResult(_0x3ad0c0,_0x5ecf5e))[_0xdcbb('0x45')](handleError(_0x3ad0c0,null));};exports['show']=function(_0x3ad465,_0x207e65){var _0x4a0e53={'raw':!![],'where':{'id':_0x3ad465['params']['id']}},_0x57e722={};_0x57e722['model']=_[_0xdcbb('0x35')](db[_0xdcbb('0x2f')][_0xdcbb('0x46')]);_0x57e722[_0xdcbb('0x34')]=_[_0xdcbb('0x35')](_0x3ad465['query']);_0x57e722[_0xdcbb('0x3e')]=_[_0xdcbb('0x37')](_0x57e722[_0xdcbb('0x33')],_0x57e722[_0xdcbb('0x34')]);_0x4a0e53[_0xdcbb('0x36')]=_['intersection'](_0x57e722[_0xdcbb('0x33')],qs[_0xdcbb('0x38')](_0x3ad465[_0xdcbb('0x34')][_0xdcbb('0x38')]));_0x4a0e53[_0xdcbb('0x36')]=_0x4a0e53['attributes'][_0xdcbb('0x39')]?_0x4a0e53[_0xdcbb('0x36')]:_0x57e722['model'];if(_0x3ad465[_0xdcbb('0x34')]['includeAll']){_0x4a0e53[_0xdcbb('0x43')]=[{'all':!![]}];}_0x4a0e53=_[_0xdcbb('0x40')]({},_0x4a0e53,_0x3ad465[_0xdcbb('0x42')]);return db[_0xdcbb('0x2f')][_0xdcbb('0x47')](_0x4a0e53)[_0xdcbb('0x26')](handleEntityNotFound(_0x207e65,null))[_0xdcbb('0x26')](respondWithResult(_0x207e65,null))['catch'](handleError(_0x207e65,null));};exports[_0xdcbb('0x48')]=function(_0x19a45b,_0x96a7af){return db[_0xdcbb('0x2f')][_0xdcbb('0x48')](_0x19a45b[_0xdcbb('0x49')],{})[_0xdcbb('0x26')](respondWithResult(_0x96a7af,0xc9))['catch'](handleError(_0x96a7af,null));};exports['update']=function(_0x1bc9f5,_0x25d22e){if(_0x1bc9f5[_0xdcbb('0x49')]['id']){delete _0x1bc9f5[_0xdcbb('0x49')]['id'];}return db[_0xdcbb('0x2f')][_0xdcbb('0x47')]({'where':{'id':_0x1bc9f5[_0xdcbb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x25d22e,null))['then'](saveUpdates(_0x1bc9f5['body'],null))[_0xdcbb('0x26')](respondWithResult(_0x25d22e,null))[_0xdcbb('0x45')](handleError(_0x25d22e,null));};exports[_0xdcbb('0x27')]=function(_0x4a94f1,_0x3d18bc){return db['FaxTransferReport'][_0xdcbb('0x47')]({'where':{'id':_0x4a94f1[_0xdcbb('0x4a')]['id']}})[_0xdcbb('0x26')](handleEntityNotFound(_0x3d18bc,null))[_0xdcbb('0x26')](removeEntity(_0x3d18bc,null))[_0xdcbb('0x45')](handleError(_0x3d18bc,null));};exports[_0xdcbb('0x4b')]=function(_0x13b925,_0x332d46){return db['FaxTransferReport'][_0xdcbb('0x4b')]()[_0xdcbb('0x26')](respondWithResult(_0x332d46,null))['catch'](handleError(_0x332d46,null));}; \ No newline at end of file +var _0x1d08=['util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','then','sendStatus','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','filter','type','merge','where','includeAll','include','catch','show','params','intersection','length','options','find','create','body','update','describe','eml-format','fast-json-patch','request-promise'];(function(_0x220504,_0x462414){var _0x4778ee=function(_0x1e4099){while(--_0x1e4099){_0x220504['push'](_0x220504['shift']());}};_0x4778ee(++_0x462414);}(_0x1d08,0x1e0));var _0x81d0=function(_0x5ab89f,_0x1b21ea){_0x5ab89f=_0x5ab89f-0x0;var _0x7b6011=_0x1d08[_0x5ab89f];return _0x7b6011;};'use strict';var emlformat=require(_0x81d0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x81d0('0x1'));var rp=require(_0x81d0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x81d0('0x3'));var path=require('path');var sox=require(_0x81d0('0x4'));var csv=require(_0x81d0('0x5'));var ejs=require(_0x81d0('0x6'));var fs=require('fs');var fs_extra=require(_0x81d0('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x81d0('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x81d0('0x5'));var querystring=require(_0x81d0('0x9'));var Papa=require(_0x81d0('0xa'));var Redis=require(_0x81d0('0xb'));var authService=require(_0x81d0('0xc'));var qs=require(_0x81d0('0xd'));var as=require(_0x81d0('0xe'));var hardwareService=require(_0x81d0('0xf'));var logger=require(_0x81d0('0x10'))(_0x81d0('0x11'));var utils=require(_0x81d0('0x12'));var config=require(_0x81d0('0x13'));var licenseUtil=require(_0x81d0('0x14'));var db=require(_0x81d0('0x15'))['db'];function respondWithStatusCode(_0x37c0f2,_0x5ddcf4){_0x5ddcf4=_0x5ddcf4||0xcc;return function(_0x4a8e37){if(_0x4a8e37){return _0x37c0f2['sendStatus'](_0x5ddcf4);}return _0x37c0f2[_0x81d0('0x16')](_0x5ddcf4)[_0x81d0('0x17')]();};}function respondWithResult(_0x481079,_0x2a237f){_0x2a237f=_0x2a237f||0xc8;return function(_0x3dbf8f){if(_0x3dbf8f){return _0x481079['status'](_0x2a237f)[_0x81d0('0x18')](_0x3dbf8f);}};}function respondWithFilteredResult(_0x55e729,_0x5b5297){return function(_0x4fa9bd){if(_0x4fa9bd){var _0x4495e0=typeof _0x5b5297[_0x81d0('0x19')]===_0x81d0('0x1a')&&typeof _0x5b5297[_0x81d0('0x1b')]===_0x81d0('0x1a');var _0x341c63=_0x4fa9bd[_0x81d0('0x1c')];var _0x1f2c90=_0x4495e0?0x0:_0x5b5297[_0x81d0('0x19')];var _0x4ca7fd=_0x4495e0?_0x4fa9bd[_0x81d0('0x1c')]:_0x5b5297[_0x81d0('0x19')]+_0x5b5297[_0x81d0('0x1b')];var _0x151d74;if(_0x4ca7fd>=_0x341c63){_0x4ca7fd=_0x341c63;_0x151d74=0xc8;}else{_0x151d74=0xce;}_0x55e729[_0x81d0('0x16')](_0x151d74);return _0x55e729[_0x81d0('0x1d')]('Content-Range',_0x1f2c90+'-'+_0x4ca7fd+'/'+_0x341c63)[_0x81d0('0x18')](_0x4fa9bd);}return null;};}function patchUpdates(_0x54cd3a){return function(_0x15c1be){try{jsonpatch['apply'](_0x15c1be,_0x54cd3a,!![]);}catch(_0x27824d){return BPromise[_0x81d0('0x1e')](_0x27824d);}return _0x15c1be[_0x81d0('0x1f')]();};}function saveUpdates(_0x1202d9,_0x2d939d){return function(_0x498c38){if(_0x498c38){return _0x498c38['update'](_0x1202d9)['then'](function(_0x2d0691){return _0x2d0691;});}return null;};}function removeEntity(_0x202662,_0x471026){return function(_0x143eeb){if(_0x143eeb){return _0x143eeb['destroy']()[_0x81d0('0x20')](function(){_0x202662[_0x81d0('0x16')](0xcc)[_0x81d0('0x17')]();});}};}function handleEntityNotFound(_0x521500,_0x5ede88){return function(_0x148ea2){if(!_0x148ea2){_0x521500[_0x81d0('0x21')](0x194);}return _0x148ea2;};}function handleError(_0x2e8b97,_0x124050){_0x124050=_0x124050||0x1f4;return function(_0x2afeef){logger[_0x81d0('0x22')](_0x2afeef[_0x81d0('0x23')]);if(_0x2afeef[_0x81d0('0x24')]){delete _0x2afeef[_0x81d0('0x24')];}_0x2e8b97[_0x81d0('0x16')](_0x124050)[_0x81d0('0x25')](_0x2afeef);};}exports[_0x81d0('0x26')]=function(_0x3560eb,_0xa754e6){var _0x30cd59={},_0x4d15f1={},_0x1f7499={'count':0x0,'rows':[]};var _0x1d5e61=_[_0x81d0('0x27')](db[_0x81d0('0x28')][_0x81d0('0x29')],function(_0x4e4705){return{'name':_0x4e4705[_0x81d0('0x2a')],'type':_0x4e4705['type']['key']};});_0x4d15f1[_0x81d0('0x2b')]=_[_0x81d0('0x27')](_0x1d5e61,_0x81d0('0x24'));_0x4d15f1[_0x81d0('0x2c')]=_[_0x81d0('0x2d')](_0x3560eb[_0x81d0('0x2c')]);_0x4d15f1[_0x81d0('0x2e')]=_['intersection'](_0x4d15f1[_0x81d0('0x2b')],_0x4d15f1[_0x81d0('0x2c')]);_0x30cd59[_0x81d0('0x2f')]=_['intersection'](_0x4d15f1[_0x81d0('0x2b')],qs['fields'](_0x3560eb[_0x81d0('0x2c')][_0x81d0('0x30')]));_0x30cd59[_0x81d0('0x2f')]=_0x30cd59[_0x81d0('0x2f')]['length']?_0x30cd59[_0x81d0('0x2f')]:_0x4d15f1[_0x81d0('0x2b')];if(!_0x3560eb[_0x81d0('0x2c')][_0x81d0('0x31')](_0x81d0('0x32'))){_0x30cd59[_0x81d0('0x1b')]=qs[_0x81d0('0x1b')](_0x3560eb[_0x81d0('0x2c')][_0x81d0('0x1b')]);_0x30cd59[_0x81d0('0x19')]=qs['offset'](_0x3560eb['query'][_0x81d0('0x19')]);}_0x30cd59['order']=qs['sort'](_0x3560eb[_0x81d0('0x2c')][_0x81d0('0x33')]);_0x30cd59['where']=qs['filters'](_['pick'](_0x3560eb[_0x81d0('0x2c')],_0x4d15f1[_0x81d0('0x2e')]),_0x1d5e61);if(_0x3560eb[_0x81d0('0x2c')][_0x81d0('0x34')]){_0x30cd59['where']=_['merge'](_0x30cd59['where'],{'$or':_['map'](_0x1d5e61,function(_0x420e7b){if(_0x420e7b[_0x81d0('0x35')]!=='VIRTUAL'){var _0x55f9be={};_0x55f9be[_0x420e7b[_0x81d0('0x24')]]={'$like':'%'+_0x3560eb[_0x81d0('0x2c')][_0x81d0('0x34')]+'%'};return _0x55f9be;}})});}_0x30cd59=_[_0x81d0('0x36')]({},_0x30cd59,_0x3560eb['options']);var _0x1984d2={'where':_0x30cd59[_0x81d0('0x37')]};return db['FaxTransferReport'][_0x81d0('0x1c')](_0x1984d2)[_0x81d0('0x20')](function(_0x4a2988){_0x1f7499[_0x81d0('0x1c')]=_0x4a2988;if(_0x3560eb[_0x81d0('0x2c')][_0x81d0('0x38')]){_0x30cd59[_0x81d0('0x39')]=[{'all':!![]}];}return db[_0x81d0('0x28')]['findAll'](_0x30cd59);})[_0x81d0('0x20')](function(_0x55e781){_0x1f7499['rows']=_0x55e781;return _0x1f7499;})[_0x81d0('0x20')](respondWithFilteredResult(_0xa754e6,_0x30cd59))[_0x81d0('0x3a')](handleError(_0xa754e6,null));};exports[_0x81d0('0x3b')]=function(_0x5c25a9,_0x37bfe5){var _0x45ccc4={'raw':!![],'where':{'id':_0x5c25a9[_0x81d0('0x3c')]['id']}},_0x20d781={};_0x20d781[_0x81d0('0x2b')]=_[_0x81d0('0x2d')](db[_0x81d0('0x28')][_0x81d0('0x29')]);_0x20d781[_0x81d0('0x2c')]=_[_0x81d0('0x2d')](_0x5c25a9['query']);_0x20d781[_0x81d0('0x2e')]=_[_0x81d0('0x3d')](_0x20d781[_0x81d0('0x2b')],_0x20d781[_0x81d0('0x2c')]);_0x45ccc4[_0x81d0('0x2f')]=_[_0x81d0('0x3d')](_0x20d781[_0x81d0('0x2b')],qs['fields'](_0x5c25a9['query'][_0x81d0('0x30')]));_0x45ccc4[_0x81d0('0x2f')]=_0x45ccc4[_0x81d0('0x2f')][_0x81d0('0x3e')]?_0x45ccc4['attributes']:_0x20d781['model'];if(_0x5c25a9[_0x81d0('0x2c')]['includeAll']){_0x45ccc4[_0x81d0('0x39')]=[{'all':!![]}];}_0x45ccc4=_['merge']({},_0x45ccc4,_0x5c25a9[_0x81d0('0x3f')]);return db[_0x81d0('0x28')][_0x81d0('0x40')](_0x45ccc4)[_0x81d0('0x20')](handleEntityNotFound(_0x37bfe5,null))[_0x81d0('0x20')](respondWithResult(_0x37bfe5,null))[_0x81d0('0x3a')](handleError(_0x37bfe5,null));};exports[_0x81d0('0x41')]=function(_0xa3b81d,_0x202f7d){return db[_0x81d0('0x28')][_0x81d0('0x41')](_0xa3b81d[_0x81d0('0x42')],{})[_0x81d0('0x20')](respondWithResult(_0x202f7d,0xc9))[_0x81d0('0x3a')](handleError(_0x202f7d,null));};exports[_0x81d0('0x43')]=function(_0xc4add,_0x43d2a0){if(_0xc4add[_0x81d0('0x42')]['id']){delete _0xc4add[_0x81d0('0x42')]['id'];}return db['FaxTransferReport'][_0x81d0('0x40')]({'where':{'id':_0xc4add[_0x81d0('0x3c')]['id']}})[_0x81d0('0x20')](handleEntityNotFound(_0x43d2a0,null))[_0x81d0('0x20')](saveUpdates(_0xc4add[_0x81d0('0x42')],null))[_0x81d0('0x20')](respondWithResult(_0x43d2a0,null))[_0x81d0('0x3a')](handleError(_0x43d2a0,null));};exports['destroy']=function(_0x115fee,_0x629186){return db['FaxTransferReport'][_0x81d0('0x40')]({'where':{'id':_0x115fee['params']['id']}})[_0x81d0('0x20')](handleEntityNotFound(_0x629186,null))[_0x81d0('0x20')](removeEntity(_0x629186,null))[_0x81d0('0x3a')](handleError(_0x629186,null));};exports['describe']=function(_0x3dee00,_0xe108f1){return db[_0x81d0('0x28')][_0x81d0('0x44')]()[_0x81d0('0x20')](respondWithResult(_0xe108f1,null))[_0x81d0('0x3a')](handleError(_0xe108f1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3249fa1..1cb7821 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 _0xa2d0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','report_fax_transfer','uniqueid','lodash'];(function(_0x46d172,_0x3f1abe){var _0x4026ba=function(_0x23cc13){while(--_0x23cc13){_0x46d172['push'](_0x46d172['shift']());}};_0x4026ba(++_0x3f1abe);}(_0xa2d0,0x77));var _0x0a2d=function(_0x2b12e2,_0x5d15a2){_0x2b12e2=_0x2b12e2-0x0;var _0x3cb612=_0xa2d0[_0x2b12e2];return _0x3cb612;};'use strict';var _=require(_0x0a2d('0x0'));var util=require('util');var logger=require(_0x0a2d('0x1'))(_0x0a2d('0x2'));var moment=require(_0x0a2d('0x3'));var BPromise=require(_0x0a2d('0x4'));var rp=require(_0x0a2d('0x5'));var fs=require('fs');var path=require(_0x0a2d('0x6'));var rimraf=require(_0x0a2d('0x7'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x29e11f,_0x55d9d1){return _0x29e11f['define']('FaxTransferReport',attributes,{'tableName':_0x0a2d('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a2d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd547=['moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3fe2b1,_0x967d3b){var _0xeff4db=function(_0x23f480){while(--_0x23f480){_0x3fe2b1['push'](_0x3fe2b1['shift']());}};_0xeff4db(++_0x967d3b);}(_0xd547,0x1a9));var _0x7d54=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd547[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7d54('0x0'));var util=require(_0x7d54('0x1'));var logger=require(_0x7d54('0x2'))(_0x7d54('0x3'));var moment=require(_0x7d54('0x4'));var BPromise=require(_0x7d54('0x5'));var rp=require(_0x7d54('0x6'));var fs=require('fs');var path=require(_0x7d54('0x7'));var rimraf=require(_0x7d54('0x8'));var config=require('../../config/environment');var attributes=require(_0x7d54('0x9'));module[_0x7d54('0xa')]=function(_0x28d24a,_0x128523){return _0x28d24a['define'](_0x7d54('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x7d54('0xc'),'fields':[_0x7d54('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 8f52b3d..6c1fe1f 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 _0x7d64=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x3e8a95,_0xdcb0b4){var _0x1df478=function(_0x1ef687){while(--_0x1ef687){_0x3e8a95['push'](_0x3e8a95['shift']());}};_0x1df478(++_0xdcb0b4);}(_0x7d64,0x16f));var _0x47d6=function(_0x20cb05,_0x6e46af){_0x20cb05=_0x20cb05-0x0;var _0x37368c=_0x7d64[_0x20cb05];return _0x37368c;};'use strict';var _=require('lodash');var util=require(_0x47d6('0x0'));var moment=require(_0x47d6('0x1'));var BPromise=require(_0x47d6('0x2'));var rs=require(_0x47d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47d6('0x4'))['db'];var utils=require(_0x47d6('0x5'));var logger=require(_0x47d6('0x6'))(_0x47d6('0x7'));var config=require(_0x47d6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x47d6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5caba2,_0x2a41fb,_0x58babb){return new BPromise(function(_0x2a83db,_0x1bf9e8){return client[_0x47d6('0xa')](_0x5caba2,_0x58babb)[_0x47d6('0xb')](function(_0x2ea9bc){logger[_0x47d6('0xc')](_0x47d6('0xd'),_0x2a41fb,_0x47d6('0xe'));logger[_0x47d6('0xf')](_0x47d6('0x10'),_0x2a41fb,_0x47d6('0xe'),JSON['stringify'](_0x2ea9bc));if(_0x2ea9bc[_0x47d6('0x11')]){if(_0x2ea9bc[_0x47d6('0x11')]['code']===0x1f4){logger[_0x47d6('0x11')](_0x47d6('0xd'),_0x2a41fb,_0x2ea9bc['error'][_0x47d6('0x12')]);return _0x1bf9e8(_0x2ea9bc[_0x47d6('0x11')][_0x47d6('0x12')]);}logger[_0x47d6('0x11')](_0x47d6('0xd'),_0x2a41fb,_0x2ea9bc[_0x47d6('0x11')][_0x47d6('0x12')]);return _0x2a83db(_0x2ea9bc['error'][_0x47d6('0x12')]);}else{logger[_0x47d6('0xc')](_0x47d6('0xd'),_0x2a41fb,_0x47d6('0xe'));_0x2a83db(_0x2ea9bc[_0x47d6('0x13')][_0x47d6('0x12')]);}})['catch'](function(_0xde8bb0){logger[_0x47d6('0x11')](_0x47d6('0xd'),_0x2a41fb,_0xde8bb0);_0x1bf9e8(_0xde8bb0);});});} \ No newline at end of file +var _0x0bd6=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4cf59a,_0x3d3fb0){var _0x513f00=function(_0x4c4ef9){while(--_0x4c4ef9){_0x4cf59a['push'](_0x4cf59a['shift']());}};_0x513f00(++_0x3d3fb0);}(_0x0bd6,0xcd));var _0x60bd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0bd6[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x60bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60bd('0x1'));var rs=require(_0x60bd('0x2'));var fs=require('fs');var Redis=require(_0x60bd('0x3'));var db=require(_0x60bd('0x4'))['db'];var utils=require(_0x60bd('0x5'));var logger=require(_0x60bd('0x6'))(_0x60bd('0x7'));var config=require(_0x60bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x60bd('0x9')][_0x60bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x989cf0,_0x42473c,_0x3752b4){return new BPromise(function(_0x55a568,_0x5e281e){return client['request'](_0x989cf0,_0x3752b4)[_0x60bd('0xb')](function(_0x2e78c2){logger['info'](_0x60bd('0xc'),_0x42473c,_0x60bd('0xd'));logger[_0x60bd('0xe')](_0x60bd('0xf'),_0x42473c,'request\x20sent',JSON[_0x60bd('0x10')](_0x2e78c2));if(_0x2e78c2[_0x60bd('0x11')]){if(_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x12')]===0x1f4){logger[_0x60bd('0x11')](_0x60bd('0xc'),_0x42473c,_0x2e78c2['error'][_0x60bd('0x13')]);return _0x5e281e(_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x13')]);}logger[_0x60bd('0x11')](_0x60bd('0xc'),_0x42473c,_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x13')]);return _0x55a568(_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x13')]);}else{logger[_0x60bd('0x14')](_0x60bd('0xc'),_0x42473c,_0x60bd('0xd'));_0x55a568(_0x2e78c2['result'][_0x60bd('0x13')]);}})[_0x60bd('0x15')](function(_0xe6d744){logger[_0x60bd('0x11')](_0x60bd('0xc'),_0x42473c,_0xe6d744);_0x5e281e(_0xe6d744);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 8ca7545..4b7fa92 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 _0x51de=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','update','/:id','exports','util','path','connect-timeout'];(function(_0x158147,_0x15c105){var _0x2a751b=function(_0x111e0e){while(--_0x111e0e){_0x158147['push'](_0x158147['shift']());}};_0x2a751b(++_0x15c105);}(_0x51de,0x179));var _0xe51d=function(_0x410e45,_0x5837f3){_0x410e45=_0x410e45-0x0;var _0x3d24aa=_0x51de[_0x410e45];return _0x3d24aa;};'use strict';var multer=require('multer');var util=require(_0xe51d('0x0'));var path=require(_0xe51d('0x1'));var timeout=require(_0xe51d('0x2'));var express=require('express');var router=express[_0xe51d('0x3')]();var fs_extra=require(_0xe51d('0x4'));var auth=require(_0xe51d('0x5'));var interaction=require(_0xe51d('0x6'));var config=require(_0xe51d('0x7'));var controller=require(_0xe51d('0x8'));router[_0xe51d('0x9')]('/',auth[_0xe51d('0xa')](),controller[_0xe51d('0xb')]);router[_0xe51d('0x9')](_0xe51d('0xc'),auth[_0xe51d('0xa')](),controller[_0xe51d('0xd')]);router[_0xe51d('0x9')]('/:id',auth[_0xe51d('0xa')](),controller[_0xe51d('0xe')]);router[_0xe51d('0xf')]('/',auth[_0xe51d('0xa')](),controller[_0xe51d('0x10')]);router['put']('/:id',auth[_0xe51d('0xa')](),controller[_0xe51d('0x11')]);router['delete'](_0xe51d('0x12'),auth[_0xe51d('0xa')](),controller['destroy']);module[_0xe51d('0x13')]=router; \ No newline at end of file +var _0x5e32=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','exports','util','path','connect-timeout'];(function(_0x326eb4,_0x19a7f3){var _0x756fec=function(_0xeb6fac){while(--_0xeb6fac){_0x326eb4['push'](_0x326eb4['shift']());}};_0x756fec(++_0x19a7f3);}(_0x5e32,0x173));var _0x25e3=function(_0x26de78,_0x1c8d08){_0x26de78=_0x26de78-0x0;var _0x1b6fee=_0x5e32[_0x26de78];return _0x1b6fee;};'use strict';var multer=require('multer');var util=require(_0x25e3('0x0'));var path=require(_0x25e3('0x1'));var timeout=require(_0x25e3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x25e3('0x3'));var config=require(_0x25e3('0x4'));var controller=require(_0x25e3('0x5'));router[_0x25e3('0x6')]('/',auth[_0x25e3('0x7')](),controller[_0x25e3('0x8')]);router[_0x25e3('0x6')](_0x25e3('0x9'),auth[_0x25e3('0x7')](),controller[_0x25e3('0xa')]);router[_0x25e3('0x6')](_0x25e3('0xb'),auth[_0x25e3('0x7')](),controller['show']);router[_0x25e3('0xc')]('/',auth[_0x25e3('0x7')](),controller[_0x25e3('0xd')]);router[_0x25e3('0xe')](_0x25e3('0xb'),auth[_0x25e3('0x7')](),controller[_0x25e3('0xf')]);router['delete'](_0x25e3('0xb'),auth[_0x25e3('0x7')](),controller['destroy']);module[_0x25e3('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e437254..8ed2251 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 _0x19c1=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x4be7c6,_0x553831){var _0x24a86e=function(_0x16feb0){while(--_0x16feb0){_0x4be7c6['push'](_0x4be7c6['shift']());}};_0x24a86e(++_0x553831);}(_0x19c1,0x1da));var _0x119c=function(_0x1b3e28,_0x5a92b7){_0x1b3e28=_0x1b3e28-0x0;var _0x6224f8=_0x19c1[_0x1b3e28];return _0x6224f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x119c('0x0'));var timeout=require(_0x119c('0x1'));var express=require('express');var router=express[_0x119c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x119c('0x3'));var config=require(_0x119c('0x4'));var controller=require('./intDeskAccount.controller');router[_0x119c('0x5')]('/',auth[_0x119c('0x6')](),controller[_0x119c('0x7')]);router[_0x119c('0x5')]('/:id',auth[_0x119c('0x6')](),controller[_0x119c('0x8')]);router[_0x119c('0x5')](_0x119c('0x9'),auth['isAuthenticated'](),controller[_0x119c('0xa')]);router[_0x119c('0x5')](_0x119c('0xb'),auth['isAuthenticated'](),controller[_0x119c('0xc')]);router[_0x119c('0xd')]('/',auth[_0x119c('0x6')](),controller['create']);router[_0x119c('0xd')](_0x119c('0x9'),auth[_0x119c('0x6')](),controller[_0x119c('0xe')]);router[_0x119c('0xf')](_0x119c('0x10'),auth['isAuthenticated'](),controller[_0x119c('0x11')]);router[_0x119c('0x12')](_0x119c('0x10'),auth[_0x119c('0x6')](),controller[_0x119c('0x13')]);module[_0x119c('0x14')]=router; \ No newline at end of file +var _0x5b07=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','show','get','/:id/configurations','getConfigurations','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x5b07,0x121));var _0x75b0=function(_0x5d1ade,_0x260055){_0x5d1ade=_0x5d1ade-0x0;var _0x219d29=_0x5b07[_0x5d1ade];return _0x219d29;};'use strict';var multer=require(_0x75b0('0x0'));var util=require(_0x75b0('0x1'));var path=require(_0x75b0('0x2'));var timeout=require(_0x75b0('0x3'));var express=require('express');var router=express[_0x75b0('0x4')]();var fs_extra=require(_0x75b0('0x5'));var auth=require(_0x75b0('0x6'));var interaction=require(_0x75b0('0x7'));var config=require(_0x75b0('0x8'));var controller=require('./intDeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x75b0('0x9')]);router['get']('/:id',auth[_0x75b0('0xa')](),controller[_0x75b0('0xb')]);router[_0x75b0('0xc')](_0x75b0('0xd'),auth[_0x75b0('0xa')](),controller[_0x75b0('0xe')]);router[_0x75b0('0xc')]('/:id/fields',auth[_0x75b0('0xa')](),controller['getFields']);router[_0x75b0('0xf')]('/',auth['isAuthenticated'](),controller[_0x75b0('0x10')]);router[_0x75b0('0xf')](_0x75b0('0xd'),auth[_0x75b0('0xa')](),controller['addConfiguration']);router[_0x75b0('0x11')](_0x75b0('0x12'),auth[_0x75b0('0xa')](),controller[_0x75b0('0x13')]);router[_0x75b0('0x14')](_0x75b0('0x12'),auth[_0x75b0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 30b74fa..47b35f1 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 _0x9707=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x581dee,_0x392336){var _0x4afb49=function(_0x5da650){while(--_0x5da650){_0x581dee['push'](_0x581dee['shift']());}};_0x4afb49(++_0x392336);}(_0x9707,0xed));var _0x7970=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9707[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7970('0x0'));module[_0x7970('0x1')]={'name':{'type':Sequelize[_0x7970('0x2')]},'description':{'type':Sequelize[_0x7970('0x2')]},'username':{'type':Sequelize[_0x7970('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x7970('0x3')](_0x7970('0x4')),'defaultValue':_0x7970('0x4')},'password':{'type':Sequelize[_0x7970('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x7970('0x2')]},'token':{'type':Sequelize[_0x7970('0x2')]},'tokenSecret':{'type':Sequelize[_0x7970('0x2')]},'serverUrl':{'type':Sequelize[_0x7970('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7970('0x3')](_0x7970('0x5'),_0x7970('0x6')),'defaultValue':_0x7970('0x5')}}; \ No newline at end of file +var _0x58c8=['ENUM','integrationTab','exports','STRING'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x58c8,0x1b6));var _0x858c=function(_0x4998f7,_0x4c0a5f){_0x4998f7=_0x4998f7-0x0;var _0xdd9537=_0x58c8[_0x4998f7];return _0xdd9537;};'use strict';var Sequelize=require('sequelize');module[_0x858c('0x0')]={'name':{'type':Sequelize[_0x858c('0x1')]},'description':{'type':Sequelize[_0x858c('0x1')]},'username':{'type':Sequelize[_0x858c('0x1')]},'remoteUri':{'type':Sequelize[_0x858c('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x858c('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x858c('0x1')]},'token':{'type':Sequelize[_0x858c('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x858c('0x2')]('integrationTab','newTab'),'defaultValue':_0x858c('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 5ae1dea..8ce2064 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 _0x2c86=['getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','DeskAccount','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','length','options','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','headers','format','Basic\x20%s','%s:%s','toString','statusCode'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x2c86,0x1bc));var _0x62c8=function(_0x5b5c60,_0x24f1de){_0x5b5c60=_0x5b5c60-0x0;var _0x100366=_0x2c86[_0x5b5c60];return _0x100366;};'use strict';var emlformat=require(_0x62c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x62c8('0x1'));var jsonpatch=require(_0x62c8('0x2'));var rp=require(_0x62c8('0x3'));var moment=require('moment');var BPromise=require(_0x62c8('0x4'));var Mustache=require(_0x62c8('0x5'));var util=require(_0x62c8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x62c8('0x7'));var ejs=require(_0x62c8('0x8'));var fs=require('fs');var fs_extra=require(_0x62c8('0x9'));var _=require(_0x62c8('0xa'));var squel=require('squel');var crypto=require(_0x62c8('0xb'));var jsforce=require(_0x62c8('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x62c8('0xd'));var Papa=require(_0x62c8('0xe'));var Redis=require(_0x62c8('0xf'));var authService=require(_0x62c8('0x10'));var qs=require(_0x62c8('0x11'));var as=require(_0x62c8('0x12'));var hardwareService=require(_0x62c8('0x13'));var logger=require(_0x62c8('0x14'))(_0x62c8('0x15'));var utils=require('../../config/utils');var config=require(_0x62c8('0x16'));var licenseUtil=require(_0x62c8('0x17'));var db=require(_0x62c8('0x18'))['db'];var integrations=require(_0x62c8('0x19'));function respondWithStatusCode(_0x1f60a7,_0x107c6d){_0x107c6d=_0x107c6d||0xcc;return function(_0xf71323){if(_0xf71323){return _0x1f60a7[_0x62c8('0x1a')](_0x107c6d);}return _0x1f60a7['status'](_0x107c6d)[_0x62c8('0x1b')]();};}function respondWithResult(_0x5792f1,_0x2c9bed){_0x2c9bed=_0x2c9bed||0xc8;return function(_0x54bd2e){if(_0x54bd2e){return _0x5792f1['status'](_0x2c9bed)[_0x62c8('0x1c')](_0x54bd2e);}};}function respondWithFilteredResult(_0xdac497,_0x3c5353){return function(_0x171983){if(_0x171983){var _0x37f66f=typeof _0x3c5353[_0x62c8('0x1d')]===_0x62c8('0x1e')&&typeof _0x3c5353[_0x62c8('0x1f')]===_0x62c8('0x1e');var _0x140736=_0x171983[_0x62c8('0x20')];var _0x37fb20=_0x37f66f?0x0:_0x3c5353[_0x62c8('0x1d')];var _0x33a292=_0x37f66f?_0x171983[_0x62c8('0x20')]:_0x3c5353['offset']+_0x3c5353[_0x62c8('0x1f')];var _0x12e906;if(_0x33a292>=_0x140736){_0x33a292=_0x140736;_0x12e906=0xc8;}else{_0x12e906=0xce;}_0xdac497[_0x62c8('0x21')](_0x12e906);return _0xdac497[_0x62c8('0x22')](_0x62c8('0x23'),_0x37fb20+'-'+_0x33a292+'/'+_0x140736)['json'](_0x171983);}return null;};}function patchUpdates(_0x4fb06c){return function(_0x10d375){try{jsonpatch[_0x62c8('0x24')](_0x10d375,_0x4fb06c,!![]);}catch(_0x35747c){return BPromise['reject'](_0x35747c);}return _0x10d375[_0x62c8('0x25')]();};}function saveUpdates(_0x300d8a,_0x4e5801){return function(_0x2ee416){if(_0x2ee416){return _0x2ee416[_0x62c8('0x26')](_0x300d8a)[_0x62c8('0x27')](function(_0x38f4fb){return _0x38f4fb;});}return null;};}function removeEntity(_0x9b59e3,_0x5f4ff4){return function(_0x1b5bc5){if(_0x1b5bc5){return _0x1b5bc5[_0x62c8('0x28')]()['then'](function(){_0x9b59e3[_0x62c8('0x21')](0xcc)[_0x62c8('0x1b')]();});}};}function handleEntityNotFound(_0x3321d0,_0x4421cf){return function(_0x530467){if(!_0x530467){_0x3321d0[_0x62c8('0x1a')](0x194);}return _0x530467;};}function handleError(_0xe25703,_0x52bfe8){_0x52bfe8=_0x52bfe8||0x1f4;return function(_0x1499d5){logger[_0x62c8('0x29')](_0x1499d5['stack']);if(_0x1499d5[_0x62c8('0x2a')]){delete _0x1499d5[_0x62c8('0x2a')];}_0xe25703[_0x62c8('0x21')](_0x52bfe8)[_0x62c8('0x2b')](_0x1499d5);};}exports[_0x62c8('0x2c')]=function(_0x3654d4,_0x2137d0){var _0x5e27d1={},_0x2fbb82={},_0x2aa7f3={'count':0x0,'rows':[]};var _0x580fd9=_['map'](db[_0x62c8('0x2d')][_0x62c8('0x2e')],function(_0x45d31a){return{'name':_0x45d31a['fieldName'],'type':_0x45d31a['type']['key']};});_0x2fbb82[_0x62c8('0x2f')]=_[_0x62c8('0x30')](_0x580fd9,_0x62c8('0x2a'));_0x2fbb82[_0x62c8('0x31')]=_[_0x62c8('0x32')](_0x3654d4[_0x62c8('0x31')]);_0x2fbb82[_0x62c8('0x33')]=_[_0x62c8('0x34')](_0x2fbb82['model'],_0x2fbb82['query']);_0x5e27d1[_0x62c8('0x35')]=_[_0x62c8('0x34')](_0x2fbb82[_0x62c8('0x2f')],qs['fields'](_0x3654d4[_0x62c8('0x31')][_0x62c8('0x36')]));_0x5e27d1['attributes']=_0x5e27d1['attributes']['length']?_0x5e27d1['attributes']:_0x2fbb82[_0x62c8('0x2f')];if(!_0x3654d4[_0x62c8('0x31')][_0x62c8('0x37')](_0x62c8('0x38'))){_0x5e27d1[_0x62c8('0x1f')]=qs['limit'](_0x3654d4['query'][_0x62c8('0x1f')]);_0x5e27d1[_0x62c8('0x1d')]=qs[_0x62c8('0x1d')](_0x3654d4['query'][_0x62c8('0x1d')]);}_0x5e27d1[_0x62c8('0x39')]=qs['sort'](_0x3654d4['query'][_0x62c8('0x3a')]);_0x5e27d1[_0x62c8('0x3b')]=qs['filters'](_[_0x62c8('0x3c')](_0x3654d4[_0x62c8('0x31')],_0x2fbb82[_0x62c8('0x33')]),_0x580fd9);if(_0x3654d4[_0x62c8('0x31')][_0x62c8('0x3d')]){_0x5e27d1[_0x62c8('0x3b')]=_[_0x62c8('0x3e')](_0x5e27d1[_0x62c8('0x3b')],{'$or':_[_0x62c8('0x30')](_0x580fd9,function(_0x1896ad){if(_0x1896ad[_0x62c8('0x3f')]!==_0x62c8('0x40')){var _0xb92b27={};_0xb92b27[_0x1896ad[_0x62c8('0x2a')]]={'$like':'%'+_0x3654d4['query'][_0x62c8('0x3d')]+'%'};return _0xb92b27;}})});}_0x5e27d1=_[_0x62c8('0x3e')]({},_0x5e27d1,_0x3654d4['options']);var _0x556380={'where':_0x5e27d1[_0x62c8('0x3b')]};return db[_0x62c8('0x2d')][_0x62c8('0x20')](_0x556380)['then'](function(_0x20514f){_0x2aa7f3['count']=_0x20514f;if(_0x3654d4[_0x62c8('0x31')][_0x62c8('0x41')]){_0x5e27d1[_0x62c8('0x42')]=[{'all':!![]}];}return db[_0x62c8('0x2d')][_0x62c8('0x43')](_0x5e27d1);})[_0x62c8('0x27')](function(_0x17ff48){_0x2aa7f3['rows']=_0x17ff48;return _0x2aa7f3;})[_0x62c8('0x27')](respondWithFilteredResult(_0x2137d0,_0x5e27d1))[_0x62c8('0x44')](handleError(_0x2137d0,null));};exports[_0x62c8('0x45')]=function(_0x500bc4,_0x133332){var _0x3c3c9e={'raw':![],'where':{'id':_0x500bc4[_0x62c8('0x46')]['id']}},_0x5ff23={};_0x5ff23[_0x62c8('0x2f')]=_[_0x62c8('0x32')](db[_0x62c8('0x2d')][_0x62c8('0x2e')]);_0x5ff23['query']=_['keys'](_0x500bc4[_0x62c8('0x31')]);_0x5ff23['filters']=_[_0x62c8('0x34')](_0x5ff23['model'],_0x5ff23[_0x62c8('0x31')]);_0x3c3c9e[_0x62c8('0x35')]=_[_0x62c8('0x34')](_0x5ff23[_0x62c8('0x2f')],qs[_0x62c8('0x36')](_0x500bc4[_0x62c8('0x31')][_0x62c8('0x36')]));_0x3c3c9e['attributes']=_0x3c3c9e[_0x62c8('0x35')][_0x62c8('0x47')]?_0x3c3c9e[_0x62c8('0x35')]:_0x5ff23[_0x62c8('0x2f')];if(_0x500bc4[_0x62c8('0x31')][_0x62c8('0x41')]){_0x3c3c9e[_0x62c8('0x42')]=[{'all':!![]}];}_0x3c3c9e=_[_0x62c8('0x3e')]({},_0x3c3c9e,_0x500bc4[_0x62c8('0x48')]);return db[_0x62c8('0x2d')][_0x62c8('0x49')](_0x3c3c9e)[_0x62c8('0x27')](handleEntityNotFound(_0x133332,null))[_0x62c8('0x27')](respondWithResult(_0x133332,null))[_0x62c8('0x44')](handleError(_0x133332,null));};exports[_0x62c8('0x4a')]=function(_0x514575,_0x457a7b){return db[_0x62c8('0x2d')][_0x62c8('0x4a')](_0x514575[_0x62c8('0x4b')],{})[_0x62c8('0x27')](respondWithResult(_0x457a7b,0xc9))[_0x62c8('0x44')](handleError(_0x457a7b,null));};exports[_0x62c8('0x26')]=function(_0x5d6a56,_0x2853ee){if(_0x5d6a56[_0x62c8('0x4b')]['id']){delete _0x5d6a56[_0x62c8('0x4b')]['id'];}return db[_0x62c8('0x2d')][_0x62c8('0x49')]({'where':{'id':_0x5d6a56[_0x62c8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2853ee,null))[_0x62c8('0x27')](saveUpdates(_0x5d6a56[_0x62c8('0x4b')],null))[_0x62c8('0x27')](respondWithResult(_0x2853ee,null))[_0x62c8('0x44')](handleError(_0x2853ee,null));};exports[_0x62c8('0x28')]=function(_0x5ad716,_0x299c64){return db[_0x62c8('0x2d')][_0x62c8('0x49')]({'where':{'id':_0x5ad716['params']['id']}})[_0x62c8('0x27')](handleEntityNotFound(_0x299c64,null))['then'](removeEntity(_0x299c64,null))[_0x62c8('0x44')](handleError(_0x299c64,null));};exports[_0x62c8('0x4c')]=function(_0x31a646,_0x415a48,_0x3f5e69){var _0xb08cb4={};var _0x1210e0={};var _0x5e1320;var _0x4eba75;return db[_0x62c8('0x2d')][_0x62c8('0x4d')]({'where':{'id':_0x31a646['params']['id']}})['then'](handleEntityNotFound(_0x415a48,null))['then'](function(_0x17d3a1){if(_0x17d3a1){_0x5e1320=_0x17d3a1;_0x1210e0[_0x62c8('0x2f')]=_[_0x62c8('0x32')](db[_0x62c8('0x4e')][_0x62c8('0x2e')]);_0x1210e0[_0x62c8('0x31')]=_[_0x62c8('0x32')](_0x31a646[_0x62c8('0x31')]);_0x1210e0[_0x62c8('0x33')]=_['intersection'](_0x1210e0[_0x62c8('0x2f')],_0x1210e0['query']);_0xb08cb4[_0x62c8('0x35')]=_['intersection'](_0x1210e0[_0x62c8('0x2f')],qs[_0x62c8('0x36')](_0x31a646['query'][_0x62c8('0x36')]));_0xb08cb4['attributes']=_0xb08cb4[_0x62c8('0x35')]['length']?_0xb08cb4[_0x62c8('0x35')]:_0x1210e0['model'];_0xb08cb4['order']=qs[_0x62c8('0x3a')](_0x31a646[_0x62c8('0x31')]['sort']);_0xb08cb4[_0x62c8('0x3b')]=qs['filters'](_[_0x62c8('0x3c')](_0x31a646[_0x62c8('0x31')],_0x1210e0['filters']));if(_0x31a646[_0x62c8('0x31')]['filter']){_0xb08cb4[_0x62c8('0x3b')]=_['merge'](_0xb08cb4[_0x62c8('0x3b')],{'$or':_[_0x62c8('0x30')](_0xb08cb4['attributes'],function(_0x15c37a){var _0x212f35={};_0x212f35[_0x15c37a]={'$like':'%'+_0x31a646['query'][_0x62c8('0x3d')]+'%'};return _0x212f35;})});}_0xb08cb4=_['merge']({},_0xb08cb4,_0x31a646[_0x62c8('0x48')]);return _0x5e1320[_0x62c8('0x4c')](_0xb08cb4);}})[_0x62c8('0x27')](function(_0x48014c){if(_0x48014c){_0x4eba75=_0x48014c['length'];if(!_0x31a646[_0x62c8('0x31')][_0x62c8('0x37')]('nolimit')){_0xb08cb4[_0x62c8('0x1f')]=qs['limit'](_0x31a646['query'][_0x62c8('0x1f')]);_0xb08cb4['offset']=qs[_0x62c8('0x1d')](_0x31a646[_0x62c8('0x31')]['offset']);}return _0x5e1320[_0x62c8('0x4c')](_0xb08cb4);}})[_0x62c8('0x27')](function(_0x463b84){if(_0x463b84){return _0x463b84?{'count':_0x4eba75,'rows':_0x463b84}:null;}})[_0x62c8('0x27')](respondWithResult(_0x415a48,null))['catch'](handleError(_0x415a48,null));};exports[_0x62c8('0x4f')]=function(_0x408959,_0x578455,_0x25a9e8){if(_0x408959['body']['id']){delete _0x408959[_0x62c8('0x4b')]['id'];}return db[_0x62c8('0x2d')][_0x62c8('0x4d')]({'where':{'id':_0x408959[_0x62c8('0x46')]['id']}})[_0x62c8('0x27')](handleEntityNotFound(_0x578455,null))[_0x62c8('0x27')](function(_0x262f7d){if(_0x262f7d){_0x408959[_0x62c8('0x4b')]['AccountId']=_0x262f7d['id'];_0x408959[_0x62c8('0x4b')][_0x62c8('0x50')]=integrations[_0x62c8('0x51')](_0x408959[_0x62c8('0x4b')][_0x62c8('0x52')],_0x408959['body'][_0x62c8('0x3f')]);_0x408959[_0x62c8('0x4b')]['Descriptions']=integrations[_0x62c8('0x53')](_0x408959[_0x62c8('0x4b')]['channel'],_0x408959[_0x62c8('0x4b')][_0x62c8('0x3f')]);return db[_0x62c8('0x4e')][_0x62c8('0x4a')](_0x408959[_0x62c8('0x4b')],{'include':[{'model':db[_0x62c8('0x54')],'as':_0x62c8('0x50')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0x62c8('0x27')](respondWithResult(_0x578455,null))[_0x62c8('0x44')](handleError(_0x578455,null));};exports[_0x62c8('0x55')]=function(_0x8ac00,_0x330a9a,_0x996b){var _0x48ef17=[{'name':_0x62c8('0x56'),'label':_0x62c8('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 _0x1b55e6='';return db[_0x62c8('0x2d')][_0x62c8('0x4d')]({'where':{'id':_0x8ac00['params']['id']},'attributes':['id',_0x62c8('0x57'),_0x62c8('0x58'),_0x62c8('0x59'),_0x62c8('0x5a'),'consumerKey',_0x62c8('0x5b'),_0x62c8('0x5c'),_0x62c8('0x5d')]})[_0x62c8('0x27')](handleEntityNotFound(_0x330a9a,null))[_0x62c8('0x27')](function(_0x527643){if(_0x527643){_0x1b55e6=_0x527643[_0x62c8('0x57')];var _0xfeea14=_0x1b55e6[_0x62c8('0x5e')](-0x1);if(_0xfeea14==='/'){_0x1b55e6=_0x1b55e6[_0x62c8('0x5f')](0x0,_0x1b55e6[_0x62c8('0x60')](_0xfeea14));}var _0x2ac921={'method':_0x62c8('0x61'),'uri':util['format'](_0x62c8('0x62'),_0x1b55e6),'headers':{'Content-Type':_0x62c8('0x63'),'Accept':_0x62c8('0x63')},'json':!![]};if(_0x527643[_0x62c8('0x58')]==='basic'){_0x2ac921[_0x62c8('0x64')]['Authorization']=util[_0x62c8('0x65')](_0x62c8('0x66'),new Buffer(util[_0x62c8('0x65')](_0x62c8('0x67'),_0x527643[_0x62c8('0x59')],_0x527643[_0x62c8('0x5a')]))[_0x62c8('0x68')]('base64'));}return rp(_0x2ac921)[_0x62c8('0x27')](function(_0x1e5681){return _0x48ef17['concat'](_['map'](_0x1e5681['_embedded']['entries'],function(_0x6204db){return{'id':_0x6204db['name'],'name':_0x6204db[_0x62c8('0x2a')],'type':_0x6204db['type'],'active':_0x6204db['active'],'label':_0x6204db['label'],'custom':!![]};}));});}})[_0x62c8('0x27')](function(_0x4ed4e1){return{'count':_0x4ed4e1['length'],'rows':_0x4ed4e1};})['then'](respondWithResult(_0x330a9a,null))['catch'](function(_0x1d0212){var _0x41c873=_0x8ac00[_0x62c8('0x31')]['test']?0x1f4:_0x1d0212[_0x62c8('0x69')]||0x1f4;logger[_0x62c8('0x29')](_0x62c8('0x6a'),_0x62c8('0x55'),_0x41c873,JSON[_0x62c8('0x6b')](_0x1d0212));delete _0x1d0212[_0x62c8('0x2a')];if(_0x41c873===0x191){_0x41c873=0x190;}_0x330a9a[_0x62c8('0x21')](_0x41c873)[_0x62c8('0x2b')](_0x8ac00[_0x62c8('0x31')][_0x62c8('0x6c')]?{'message':_0x62c8('0x6d'),'statusCode':_0x1d0212['statusCode']}:_0x1d0212);});}; \ No newline at end of file +var _0xc4d1=['stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','base64','concat','active','label','test','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x11ac13,_0x4e3d72){var _0x4f37df=function(_0x15f708){while(--_0x15f708){_0x11ac13['push'](_0x11ac13['shift']());}};_0x4f37df(++_0x4e3d72);}(_0xc4d1,0x1ce));var _0x1c4d=function(_0x175a46,_0x467177){_0x175a46=_0x175a46-0x0;var _0x4050a7=_0xc4d1[_0x175a46];return _0x4050a7;};'use strict';var emlformat=require(_0x1c4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c4d('0x1'));var jsonpatch=require(_0x1c4d('0x2'));var rp=require(_0x1c4d('0x3'));var moment=require(_0x1c4d('0x4'));var BPromise=require(_0x1c4d('0x5'));var Mustache=require(_0x1c4d('0x6'));var util=require(_0x1c4d('0x7'));var path=require(_0x1c4d('0x8'));var sox=require(_0x1c4d('0x9'));var csv=require('to-csv');var ejs=require(_0x1c4d('0xa'));var fs=require('fs');var fs_extra=require(_0x1c4d('0xb'));var _=require(_0x1c4d('0xc'));var squel=require(_0x1c4d('0xd'));var crypto=require(_0x1c4d('0xe'));var jsforce=require(_0x1c4d('0xf'));var deskjs=require(_0x1c4d('0x10'));var toCsv=require(_0x1c4d('0x11'));var querystring=require(_0x1c4d('0x12'));var Papa=require('papaparse');var Redis=require(_0x1c4d('0x13'));var authService=require(_0x1c4d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1c4d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c4d('0x16'))(_0x1c4d('0x17'));var utils=require(_0x1c4d('0x18'));var config=require(_0x1c4d('0x19'));var licenseUtil=require(_0x1c4d('0x1a'));var db=require(_0x1c4d('0x1b'))['db'];var integrations=require(_0x1c4d('0x1c'));function respondWithStatusCode(_0x261864,_0x58660d){_0x58660d=_0x58660d||0xcc;return function(_0x814aa4){if(_0x814aa4){return _0x261864[_0x1c4d('0x1d')](_0x58660d);}return _0x261864[_0x1c4d('0x1e')](_0x58660d)[_0x1c4d('0x1f')]();};}function respondWithResult(_0x2a901e,_0x3fea0e){_0x3fea0e=_0x3fea0e||0xc8;return function(_0x3316d6){if(_0x3316d6){return _0x2a901e[_0x1c4d('0x1e')](_0x3fea0e)[_0x1c4d('0x20')](_0x3316d6);}};}function respondWithFilteredResult(_0x308a0d,_0x75eedb){return function(_0x2adbbe){if(_0x2adbbe){var _0x15e3c4=typeof _0x75eedb[_0x1c4d('0x21')]==='undefined'&&typeof _0x75eedb[_0x1c4d('0x22')]===_0x1c4d('0x23');var _0x14cc6c=_0x2adbbe[_0x1c4d('0x24')];var _0x3533b7=_0x15e3c4?0x0:_0x75eedb[_0x1c4d('0x21')];var _0x54e6c3=_0x15e3c4?_0x2adbbe[_0x1c4d('0x24')]:_0x75eedb[_0x1c4d('0x21')]+_0x75eedb[_0x1c4d('0x22')];var _0x3e9d8c;if(_0x54e6c3>=_0x14cc6c){_0x54e6c3=_0x14cc6c;_0x3e9d8c=0xc8;}else{_0x3e9d8c=0xce;}_0x308a0d[_0x1c4d('0x1e')](_0x3e9d8c);return _0x308a0d[_0x1c4d('0x25')](_0x1c4d('0x26'),_0x3533b7+'-'+_0x54e6c3+'/'+_0x14cc6c)['json'](_0x2adbbe);}return null;};}function patchUpdates(_0x5362b9){return function(_0x3ccd4a){try{jsonpatch[_0x1c4d('0x27')](_0x3ccd4a,_0x5362b9,!![]);}catch(_0x47f141){return BPromise['reject'](_0x47f141);}return _0x3ccd4a[_0x1c4d('0x28')]();};}function saveUpdates(_0x241c7,_0x9ee03f){return function(_0x142978){if(_0x142978){return _0x142978[_0x1c4d('0x29')](_0x241c7)['then'](function(_0x4e3ba5){return _0x4e3ba5;});}return null;};}function removeEntity(_0x48c476,_0x4b02c7){return function(_0x3ecf6d){if(_0x3ecf6d){return _0x3ecf6d[_0x1c4d('0x2a')]()['then'](function(){_0x48c476[_0x1c4d('0x1e')](0xcc)[_0x1c4d('0x1f')]();});}};}function handleEntityNotFound(_0x4ec51e,_0x3095a8){return function(_0x510d08){if(!_0x510d08){_0x4ec51e[_0x1c4d('0x1d')](0x194);}return _0x510d08;};}function handleError(_0xa27275,_0x36db5e){_0x36db5e=_0x36db5e||0x1f4;return function(_0x353bbc){logger[_0x1c4d('0x2b')](_0x353bbc[_0x1c4d('0x2c')]);if(_0x353bbc[_0x1c4d('0x2d')]){delete _0x353bbc[_0x1c4d('0x2d')];}_0xa27275[_0x1c4d('0x1e')](_0x36db5e)[_0x1c4d('0x2e')](_0x353bbc);};}exports[_0x1c4d('0x2f')]=function(_0x4469a3,_0x44b993){var _0x526ab2={},_0x503265={},_0x4f820c={'count':0x0,'rows':[]};var _0x38c3d4=_[_0x1c4d('0x30')](db[_0x1c4d('0x31')][_0x1c4d('0x32')],function(_0x3e0efb){return{'name':_0x3e0efb[_0x1c4d('0x33')],'type':_0x3e0efb[_0x1c4d('0x34')][_0x1c4d('0x35')]};});_0x503265[_0x1c4d('0x36')]=_[_0x1c4d('0x30')](_0x38c3d4,_0x1c4d('0x2d'));_0x503265[_0x1c4d('0x37')]=_[_0x1c4d('0x38')](_0x4469a3[_0x1c4d('0x37')]);_0x503265[_0x1c4d('0x39')]=_[_0x1c4d('0x3a')](_0x503265['model'],_0x503265['query']);_0x526ab2[_0x1c4d('0x3b')]=_[_0x1c4d('0x3a')](_0x503265[_0x1c4d('0x36')],qs[_0x1c4d('0x3c')](_0x4469a3[_0x1c4d('0x37')]['fields']));_0x526ab2['attributes']=_0x526ab2[_0x1c4d('0x3b')][_0x1c4d('0x3d')]?_0x526ab2[_0x1c4d('0x3b')]:_0x503265['model'];if(!_0x4469a3['query']['hasOwnProperty'](_0x1c4d('0x3e'))){_0x526ab2[_0x1c4d('0x22')]=qs[_0x1c4d('0x22')](_0x4469a3[_0x1c4d('0x37')][_0x1c4d('0x22')]);_0x526ab2[_0x1c4d('0x21')]=qs[_0x1c4d('0x21')](_0x4469a3[_0x1c4d('0x37')][_0x1c4d('0x21')]);}_0x526ab2[_0x1c4d('0x3f')]=qs[_0x1c4d('0x40')](_0x4469a3['query'][_0x1c4d('0x40')]);_0x526ab2[_0x1c4d('0x41')]=qs[_0x1c4d('0x39')](_['pick'](_0x4469a3[_0x1c4d('0x37')],_0x503265['filters']),_0x38c3d4);if(_0x4469a3['query'][_0x1c4d('0x42')]){_0x526ab2[_0x1c4d('0x41')]=_[_0x1c4d('0x43')](_0x526ab2[_0x1c4d('0x41')],{'$or':_[_0x1c4d('0x30')](_0x38c3d4,function(_0x28d5e6){if(_0x28d5e6[_0x1c4d('0x34')]!=='VIRTUAL'){var _0x177299={};_0x177299[_0x28d5e6['name']]={'$like':'%'+_0x4469a3['query'][_0x1c4d('0x42')]+'%'};return _0x177299;}})});}_0x526ab2=_[_0x1c4d('0x43')]({},_0x526ab2,_0x4469a3[_0x1c4d('0x44')]);var _0x2b2e7a={'where':_0x526ab2['where']};return db[_0x1c4d('0x31')][_0x1c4d('0x24')](_0x2b2e7a)[_0x1c4d('0x45')](function(_0x2232bd){_0x4f820c[_0x1c4d('0x24')]=_0x2232bd;if(_0x4469a3[_0x1c4d('0x37')][_0x1c4d('0x46')]){_0x526ab2[_0x1c4d('0x47')]=[{'all':!![]}];}return db['DeskAccount'][_0x1c4d('0x48')](_0x526ab2);})[_0x1c4d('0x45')](function(_0x193ef7){_0x4f820c[_0x1c4d('0x49')]=_0x193ef7;return _0x4f820c;})[_0x1c4d('0x45')](respondWithFilteredResult(_0x44b993,_0x526ab2))[_0x1c4d('0x4a')](handleError(_0x44b993,null));};exports[_0x1c4d('0x4b')]=function(_0x24706c,_0x626288){var _0x236ad7={'raw':![],'where':{'id':_0x24706c[_0x1c4d('0x4c')]['id']}},_0x3483a5={};_0x3483a5[_0x1c4d('0x36')]=_['keys'](db[_0x1c4d('0x31')][_0x1c4d('0x32')]);_0x3483a5[_0x1c4d('0x37')]=_[_0x1c4d('0x38')](_0x24706c[_0x1c4d('0x37')]);_0x3483a5[_0x1c4d('0x39')]=_[_0x1c4d('0x3a')](_0x3483a5[_0x1c4d('0x36')],_0x3483a5[_0x1c4d('0x37')]);_0x236ad7[_0x1c4d('0x3b')]=_['intersection'](_0x3483a5['model'],qs['fields'](_0x24706c[_0x1c4d('0x37')][_0x1c4d('0x3c')]));_0x236ad7['attributes']=_0x236ad7[_0x1c4d('0x3b')][_0x1c4d('0x3d')]?_0x236ad7[_0x1c4d('0x3b')]:_0x3483a5[_0x1c4d('0x36')];if(_0x24706c['query'][_0x1c4d('0x46')]){_0x236ad7['include']=[{'all':!![]}];}_0x236ad7=_[_0x1c4d('0x43')]({},_0x236ad7,_0x24706c[_0x1c4d('0x44')]);return db[_0x1c4d('0x31')]['find'](_0x236ad7)[_0x1c4d('0x45')](handleEntityNotFound(_0x626288,null))[_0x1c4d('0x45')](respondWithResult(_0x626288,null))[_0x1c4d('0x4a')](handleError(_0x626288,null));};exports['create']=function(_0x23232c,_0x15d091){return db[_0x1c4d('0x31')][_0x1c4d('0x4d')](_0x23232c[_0x1c4d('0x4e')],{})[_0x1c4d('0x45')](respondWithResult(_0x15d091,0xc9))[_0x1c4d('0x4a')](handleError(_0x15d091,null));};exports[_0x1c4d('0x29')]=function(_0x238ade,_0x12d29a){if(_0x238ade['body']['id']){delete _0x238ade['body']['id'];}return db['DeskAccount'][_0x1c4d('0x4f')]({'where':{'id':_0x238ade[_0x1c4d('0x4c')]['id']}})[_0x1c4d('0x45')](handleEntityNotFound(_0x12d29a,null))[_0x1c4d('0x45')](saveUpdates(_0x238ade[_0x1c4d('0x4e')],null))['then'](respondWithResult(_0x12d29a,null))[_0x1c4d('0x4a')](handleError(_0x12d29a,null));};exports['destroy']=function(_0x8c4b09,_0x206065){return db[_0x1c4d('0x31')][_0x1c4d('0x4f')]({'where':{'id':_0x8c4b09[_0x1c4d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x206065,null))[_0x1c4d('0x45')](removeEntity(_0x206065,null))[_0x1c4d('0x4a')](handleError(_0x206065,null));};exports[_0x1c4d('0x50')]=function(_0x4b797d,_0x5dd686,_0x49932d){var _0x181f36={};var _0x1c7013={};var _0x356ccb;var _0x2c4124;return db[_0x1c4d('0x31')][_0x1c4d('0x51')]({'where':{'id':_0x4b797d[_0x1c4d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dd686,null))[_0x1c4d('0x45')](function(_0x14436a){if(_0x14436a){_0x356ccb=_0x14436a;_0x1c7013[_0x1c4d('0x36')]=_[_0x1c4d('0x38')](db['DeskConfiguration'][_0x1c4d('0x32')]);_0x1c7013[_0x1c4d('0x37')]=_['keys'](_0x4b797d[_0x1c4d('0x37')]);_0x1c7013[_0x1c4d('0x39')]=_[_0x1c4d('0x3a')](_0x1c7013[_0x1c4d('0x36')],_0x1c7013[_0x1c4d('0x37')]);_0x181f36[_0x1c4d('0x3b')]=_[_0x1c4d('0x3a')](_0x1c7013[_0x1c4d('0x36')],qs[_0x1c4d('0x3c')](_0x4b797d['query'][_0x1c4d('0x3c')]));_0x181f36[_0x1c4d('0x3b')]=_0x181f36[_0x1c4d('0x3b')][_0x1c4d('0x3d')]?_0x181f36[_0x1c4d('0x3b')]:_0x1c7013['model'];_0x181f36[_0x1c4d('0x3f')]=qs['sort'](_0x4b797d['query'][_0x1c4d('0x40')]);_0x181f36[_0x1c4d('0x41')]=qs[_0x1c4d('0x39')](_['pick'](_0x4b797d['query'],_0x1c7013[_0x1c4d('0x39')]));if(_0x4b797d['query'][_0x1c4d('0x42')]){_0x181f36['where']=_[_0x1c4d('0x43')](_0x181f36[_0x1c4d('0x41')],{'$or':_[_0x1c4d('0x30')](_0x181f36['attributes'],function(_0x40e3e4){var _0x2d170b={};_0x2d170b[_0x40e3e4]={'$like':'%'+_0x4b797d[_0x1c4d('0x37')][_0x1c4d('0x42')]+'%'};return _0x2d170b;})});}_0x181f36=_['merge']({},_0x181f36,_0x4b797d[_0x1c4d('0x44')]);return _0x356ccb['getConfigurations'](_0x181f36);}})[_0x1c4d('0x45')](function(_0x451706){if(_0x451706){_0x2c4124=_0x451706[_0x1c4d('0x3d')];if(!_0x4b797d['query'][_0x1c4d('0x52')](_0x1c4d('0x3e'))){_0x181f36[_0x1c4d('0x22')]=qs[_0x1c4d('0x22')](_0x4b797d[_0x1c4d('0x37')][_0x1c4d('0x22')]);_0x181f36[_0x1c4d('0x21')]=qs[_0x1c4d('0x21')](_0x4b797d[_0x1c4d('0x37')]['offset']);}return _0x356ccb[_0x1c4d('0x50')](_0x181f36);}})[_0x1c4d('0x45')](function(_0x1eeb45){if(_0x1eeb45){return _0x1eeb45?{'count':_0x2c4124,'rows':_0x1eeb45}:null;}})[_0x1c4d('0x45')](respondWithResult(_0x5dd686,null))[_0x1c4d('0x4a')](handleError(_0x5dd686,null));};exports['addConfiguration']=function(_0x515ba1,_0x2f3e88,_0x279ac7){if(_0x515ba1[_0x1c4d('0x4e')]['id']){delete _0x515ba1['body']['id'];}return db[_0x1c4d('0x31')][_0x1c4d('0x51')]({'where':{'id':_0x515ba1[_0x1c4d('0x4c')]['id']}})[_0x1c4d('0x45')](handleEntityNotFound(_0x2f3e88,null))[_0x1c4d('0x45')](function(_0x2a08b4){if(_0x2a08b4){_0x515ba1['body'][_0x1c4d('0x53')]=_0x2a08b4['id'];_0x515ba1[_0x1c4d('0x4e')]['Subjects']=integrations[_0x1c4d('0x54')](_0x515ba1[_0x1c4d('0x4e')][_0x1c4d('0x55')],_0x515ba1[_0x1c4d('0x4e')]['type']);_0x515ba1[_0x1c4d('0x4e')][_0x1c4d('0x56')]=integrations['getDescriptions'](_0x515ba1[_0x1c4d('0x4e')][_0x1c4d('0x55')],_0x515ba1['body']['type']);return db['DeskConfiguration'][_0x1c4d('0x4d')](_0x515ba1[_0x1c4d('0x4e')],{'include':[{'model':db[_0x1c4d('0x57')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x1c4d('0x56')}]});}return null;})[_0x1c4d('0x45')](respondWithResult(_0x2f3e88,null))[_0x1c4d('0x4a')](handleError(_0x2f3e88,null));};exports[_0x1c4d('0x58')]=function(_0x596f36,_0x135661,_0x35c289){var _0x35c6b1=[{'name':_0x1c4d('0x59'),'label':_0x1c4d('0x59'),'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 _0x1bbe34='';return db['DeskAccount'][_0x1c4d('0x51')]({'where':{'id':_0x596f36[_0x1c4d('0x4c')]['id']},'attributes':['id',_0x1c4d('0x5a'),_0x1c4d('0x5b'),_0x1c4d('0x5c'),_0x1c4d('0x5d'),_0x1c4d('0x5e'),'consumerSecret',_0x1c4d('0x5f'),_0x1c4d('0x60')]})[_0x1c4d('0x45')](handleEntityNotFound(_0x135661,null))['then'](function(_0x3f066c){if(_0x3f066c){_0x1bbe34=_0x3f066c['remoteUri'];var _0x4cae61=_0x1bbe34[_0x1c4d('0x61')](-0x1);if(_0x4cae61==='/'){_0x1bbe34=_0x1bbe34[_0x1c4d('0x62')](0x0,_0x1bbe34[_0x1c4d('0x63')](_0x4cae61));}var _0x43b58b={'method':'GET','uri':util[_0x1c4d('0x64')](_0x1c4d('0x65'),_0x1bbe34),'headers':{'Content-Type':_0x1c4d('0x66'),'Accept':_0x1c4d('0x66')},'json':!![]};if(_0x3f066c[_0x1c4d('0x5b')]===_0x1c4d('0x67')){_0x43b58b[_0x1c4d('0x68')]['Authorization']=util[_0x1c4d('0x64')](_0x1c4d('0x69'),new Buffer(util[_0x1c4d('0x64')](_0x1c4d('0x6a'),_0x3f066c[_0x1c4d('0x5c')],_0x3f066c['password']))['toString'](_0x1c4d('0x6b')));}return rp(_0x43b58b)['then'](function(_0x2188c1){return _0x35c6b1[_0x1c4d('0x6c')](_[_0x1c4d('0x30')](_0x2188c1['_embedded']['entries'],function(_0x14fa5c){return{'id':_0x14fa5c[_0x1c4d('0x2d')],'name':_0x14fa5c[_0x1c4d('0x2d')],'type':_0x14fa5c[_0x1c4d('0x34')],'active':_0x14fa5c[_0x1c4d('0x6d')],'label':_0x14fa5c[_0x1c4d('0x6e')],'custom':!![]};}));});}})['then'](function(_0x545b26){return{'count':_0x545b26[_0x1c4d('0x3d')],'rows':_0x545b26};})[_0x1c4d('0x45')](respondWithResult(_0x135661,null))[_0x1c4d('0x4a')](function(_0x1b1bc2){var _0x42c8c1=_0x596f36[_0x1c4d('0x37')][_0x1c4d('0x6f')]?0x1f4:_0x1b1bc2['statusCode']||0x1f4;logger[_0x1c4d('0x2b')](_0x1c4d('0x70'),_0x1c4d('0x58'),_0x42c8c1,JSON[_0x1c4d('0x71')](_0x1b1bc2));delete _0x1b1bc2[_0x1c4d('0x2d')];if(_0x42c8c1===0x191){_0x42c8c1=0x190;}_0x135661[_0x1c4d('0x1e')](_0x42c8c1)[_0x1c4d('0x2e')](_0x596f36['query'][_0x1c4d('0x6f')]?{'message':_0x1c4d('0x72'),'statusCode':_0x1b1bc2['statusCode']}:_0x1b1bc2);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 9ca14c8..1875ba2 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 _0x0bc4=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x0bc4,0x16d));var _0x40bc=function(_0x2fe9e7,_0xa8a3eb){_0x2fe9e7=_0x2fe9e7-0x0;var _0x48307d=_0x0bc4[_0x2fe9e7];return _0x48307d;};'use strict';var _=require('lodash');var util=require(_0x40bc('0x0'));var logger=require(_0x40bc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x40bc('0x2'));var rp=require(_0x40bc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x40bc('0x4'));var attributes=require(_0x40bc('0x5'));var integrations=require(_0x40bc('0x6'));module[_0x40bc('0x7')]=function(_0x18332d,_0x14199d){return _0x18332d[_0x40bc('0x8')]('DeskAccount',attributes,{'tableName':_0x40bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ce8=['path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','../../config/logger','bluebird','request-promise'];(function(_0x194e18,_0x5d5f3a){var _0x5e41f2=function(_0x5ea3ac){while(--_0x5ea3ac){_0x194e18['push'](_0x194e18['shift']());}};_0x5e41f2(++_0x5d5f3a);}(_0x2ce8,0xee));var _0x82ce=function(_0x33c3d3,_0x51eed3){_0x33c3d3=_0x33c3d3-0x0;var _0xf3a17f=_0x2ce8[_0x33c3d3];return _0xf3a17f;};'use strict';var _=require(_0x82ce('0x0'));var util=require('util');var logger=require(_0x82ce('0x1'))('api');var moment=require('moment');var BPromise=require(_0x82ce('0x2'));var rp=require(_0x82ce('0x3'));var fs=require('fs');var path=require(_0x82ce('0x4'));var rimraf=require('rimraf');var config=require(_0x82ce('0x5'));var attributes=require(_0x82ce('0x6'));var integrations=require(_0x82ce('0x7'));module[_0x82ce('0x8')]=function(_0x3fcd4e,_0x2c031f){return _0x3fcd4e['define'](_0x82ce('0x9'),attributes,{'tableName':_0x82ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 09a14cd..6c12924 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 _0xdded=['error','message','result','findAll','options','raw','attributes','limit','map','include','model','debug','GetDeskAccount','ShowDeskAccount','DeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x34facd,_0x645058){var _0x3deed5=function(_0xdafaca){while(--_0xdafaca){_0x34facd['push'](_0x34facd['shift']());}};_0x3deed5(++_0x645058);}(_0xdded,0x1ca));var _0xddde=function(_0x515088,_0x2647f9){_0x515088=_0x515088-0x0;var _0x5db0c1=_0xdded[_0x515088];return _0x5db0c1;};'use strict';var _=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var moment=require(_0xddde('0x2'));var BPromise=require(_0xddde('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddde('0x4'));var db=require(_0xddde('0x5'))['db'];var utils=require(_0xddde('0x6'));var logger=require(_0xddde('0x7'))(_0xddde('0x8'));var config=require(_0xddde('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xddde('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418a61,_0x159ecb,_0x28a951){return new BPromise(function(_0x21512e,_0xb24298){return client[_0xddde('0xb')](_0x418a61,_0x28a951)[_0xddde('0xc')](function(_0x43b154){logger[_0xddde('0xd')](_0xddde('0xe'),_0x159ecb,_0xddde('0xf'));logger['debug'](_0xddde('0x10'),_0x159ecb,_0xddde('0xf'),JSON[_0xddde('0x11')](_0x43b154));if(_0x43b154[_0xddde('0x12')]){if(_0x43b154['error']['code']===0x1f4){logger[_0xddde('0x12')](_0xddde('0xe'),_0x159ecb,_0x43b154[_0xddde('0x12')][_0xddde('0x13')]);return _0xb24298(_0x43b154[_0xddde('0x12')]['message']);}logger[_0xddde('0x12')](_0xddde('0xe'),_0x159ecb,_0x43b154[_0xddde('0x12')]['message']);return _0x21512e(_0x43b154[_0xddde('0x12')]['message']);}else{logger[_0xddde('0xd')](_0xddde('0xe'),_0x159ecb,_0xddde('0xf'));_0x21512e(_0x43b154[_0xddde('0x14')]['message']);}})['catch'](function(_0x2e96a9){logger[_0xddde('0x12')](_0xddde('0xe'),_0x159ecb,_0x2e96a9);_0xb24298(_0x2e96a9);});});}exports['GetDeskAccount']=function(_0x3636f4){var _0x1c5080=this;return new Promise(function(_0x567d8f,_0x5a18bd){return db['DeskAccount'][_0xddde('0x15')]({'raw':_0x3636f4[_0xddde('0x16')]?_0x3636f4[_0xddde('0x16')][_0xddde('0x17')]===undefined?!![]:![]:!![],'where':_0x3636f4[_0xddde('0x16')]?_0x3636f4[_0xddde('0x16')]['where']||null:null,'attributes':_0x3636f4[_0xddde('0x16')]?_0x3636f4['options'][_0xddde('0x18')]||null:null,'limit':_0x3636f4[_0xddde('0x16')]?_0x3636f4['options'][_0xddde('0x19')]||null:null,'include':_0x3636f4['options']?_0x3636f4[_0xddde('0x16')]['include']?_[_0xddde('0x1a')](_0x3636f4[_0xddde('0x16')]['include'],function(_0x27fc0d){return{'model':db[_0x27fc0d['model']],'as':_0x27fc0d['as'],'attributes':_0x27fc0d['attributes'],'include':_0x27fc0d['include']?_['map'](_0x27fc0d[_0xddde('0x1b')],function(_0x23f5ee){return{'model':db[_0x23f5ee[_0xddde('0x1c')]],'as':_0x23f5ee['as'],'attributes':_0x23f5ee[_0xddde('0x18')],'include':_0x23f5ee['include']?_[_0xddde('0x1a')](_0x23f5ee[_0xddde('0x1b')],function(_0xaae44f){return{'model':db[_0xaae44f[_0xddde('0x1c')]],'as':_0xaae44f['as'],'attributes':_0xaae44f['attributes']};}):[]};}):[]};}):[]:[]})[_0xddde('0xc')](function(_0xea2932){logger[_0xddde('0xd')]('GetDeskAccount',_0x3636f4);logger[_0xddde('0x1d')](_0xddde('0x1e'),_0x3636f4,JSON[_0xddde('0x11')](_0xea2932));_0x567d8f(_0xea2932);})['catch'](function(_0x539a9c){logger['error']('GetDeskAccount',_0x539a9c['message'],_0x3636f4);_0x5a18bd(_0x1c5080[_0xddde('0x12')](0x1f4,_0x539a9c[_0xddde('0x13')]));});});};exports[_0xddde('0x1f')]=function(_0x5845dd){var _0x166129=this;return new Promise(function(_0x9539d5,_0x1199ba){return db[_0xddde('0x20')][_0xddde('0x21')]({'raw':_0x5845dd[_0xddde('0x16')]?_0x5845dd[_0xddde('0x16')][_0xddde('0x17')]===undefined?!![]:![]:!![],'where':_0x5845dd[_0xddde('0x16')]?_0x5845dd['options']['where']||null:null,'attributes':_0x5845dd[_0xddde('0x16')]?_0x5845dd[_0xddde('0x16')][_0xddde('0x18')]||null:null,'include':_0x5845dd[_0xddde('0x16')]?_0x5845dd[_0xddde('0x16')]['include']?_['map'](_0x5845dd[_0xddde('0x16')][_0xddde('0x1b')],function(_0x2a7835){return{'model':db[_0x2a7835[_0xddde('0x1c')]],'as':_0x2a7835['as'],'attributes':_0x2a7835['attributes'],'include':_0x2a7835['include']?_[_0xddde('0x1a')](_0x2a7835['include'],function(_0x53154a){return{'model':db[_0x53154a[_0xddde('0x1c')]],'as':_0x53154a['as'],'attributes':_0x53154a['attributes'],'include':_0x53154a[_0xddde('0x1b')]?_[_0xddde('0x1a')](_0x53154a[_0xddde('0x1b')],function(_0x1e3f43){return{'model':db[_0x1e3f43['model']],'as':_0x1e3f43['as'],'attributes':_0x1e3f43[_0xddde('0x18')]};}):[]};}):[]};}):[]:[]})[_0xddde('0xc')](function(_0x488af2){logger['info'](_0xddde('0x1f'),_0x5845dd);logger[_0xddde('0x1d')](_0xddde('0x1f'),_0x5845dd,JSON['stringify'](_0x488af2));_0x9539d5(_0x488af2);})['catch'](function(_0x55f091){logger[_0xddde('0x12')](_0xddde('0x1f'),_0x55f091[_0xddde('0x13')],_0x5845dd);_0x1199ba(_0x166129['error'](0x1f4,_0x55f091['message']));});});}; \ No newline at end of file +var _0xdb60=['attributes','limit','include','map','model','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','catch','GetDeskAccount','DeskAccount','findAll','options','where'];(function(_0x40104f,_0x3f1223){var _0x37d5ed=function(_0x452938){while(--_0x452938){_0x40104f['push'](_0x40104f['shift']());}};_0x37d5ed(++_0x3f1223);}(_0xdb60,0x188));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0db6('0x0'));var util=require(_0x0db6('0x1'));var moment=require(_0x0db6('0x2'));var BPromise=require(_0x0db6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0db6('0x4'));var db=require(_0x0db6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0db6('0x6'))(_0x0db6('0x7'));var config=require(_0x0db6('0x8'));var jayson=require(_0x0db6('0x9'));var client=jayson['client'][_0x0db6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b697c,_0x163465,_0x42196b){return new BPromise(function(_0x1173a2,_0x1fba1f){return client[_0x0db6('0xb')](_0x2b697c,_0x42196b)[_0x0db6('0xc')](function(_0x455896){logger[_0x0db6('0xd')]('DeskAccount,\x20%s,\x20%s',_0x163465,'request\x20sent');logger[_0x0db6('0xe')](_0x0db6('0xf'),_0x163465,_0x0db6('0x10'),JSON[_0x0db6('0x11')](_0x455896));if(_0x455896[_0x0db6('0x12')]){if(_0x455896[_0x0db6('0x12')][_0x0db6('0x13')]===0x1f4){logger[_0x0db6('0x12')](_0x0db6('0x14'),_0x163465,_0x455896['error']['message']);return _0x1fba1f(_0x455896[_0x0db6('0x12')][_0x0db6('0x15')]);}logger[_0x0db6('0x12')](_0x0db6('0x14'),_0x163465,_0x455896['error'][_0x0db6('0x15')]);return _0x1173a2(_0x455896[_0x0db6('0x12')][_0x0db6('0x15')]);}else{logger[_0x0db6('0xd')](_0x0db6('0x14'),_0x163465,_0x0db6('0x10'));_0x1173a2(_0x455896['result'][_0x0db6('0x15')]);}})[_0x0db6('0x16')](function(_0x3a06b9){logger[_0x0db6('0x12')](_0x0db6('0x14'),_0x163465,_0x3a06b9);_0x1fba1f(_0x3a06b9);});});}exports[_0x0db6('0x17')]=function(_0x2b0ca2){var _0x591b40=this;return new Promise(function(_0x55707c,_0x156898){return db[_0x0db6('0x18')][_0x0db6('0x19')]({'raw':_0x2b0ca2[_0x0db6('0x1a')]?_0x2b0ca2[_0x0db6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2b0ca2['options']?_0x2b0ca2[_0x0db6('0x1a')][_0x0db6('0x1b')]||null:null,'attributes':_0x2b0ca2['options']?_0x2b0ca2[_0x0db6('0x1a')][_0x0db6('0x1c')]||null:null,'limit':_0x2b0ca2[_0x0db6('0x1a')]?_0x2b0ca2[_0x0db6('0x1a')][_0x0db6('0x1d')]||null:null,'include':_0x2b0ca2[_0x0db6('0x1a')]?_0x2b0ca2['options'][_0x0db6('0x1e')]?_[_0x0db6('0x1f')](_0x2b0ca2[_0x0db6('0x1a')][_0x0db6('0x1e')],function(_0x1bc4f0){return{'model':db[_0x1bc4f0[_0x0db6('0x20')]],'as':_0x1bc4f0['as'],'attributes':_0x1bc4f0['attributes'],'include':_0x1bc4f0['include']?_['map'](_0x1bc4f0[_0x0db6('0x1e')],function(_0x328787){return{'model':db[_0x328787[_0x0db6('0x20')]],'as':_0x328787['as'],'attributes':_0x328787['attributes'],'include':_0x328787['include']?_[_0x0db6('0x1f')](_0x328787[_0x0db6('0x1e')],function(_0x51f507){return{'model':db[_0x51f507[_0x0db6('0x20')]],'as':_0x51f507['as'],'attributes':_0x51f507[_0x0db6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0db6('0xc')](function(_0x5475c4){logger[_0x0db6('0xd')](_0x0db6('0x17'),_0x2b0ca2);logger[_0x0db6('0xe')](_0x0db6('0x17'),_0x2b0ca2,JSON[_0x0db6('0x11')](_0x5475c4));_0x55707c(_0x5475c4);})['catch'](function(_0x350a52){logger[_0x0db6('0x12')](_0x0db6('0x17'),_0x350a52[_0x0db6('0x15')],_0x2b0ca2);_0x156898(_0x591b40['error'](0x1f4,_0x350a52[_0x0db6('0x15')]));});});};exports[_0x0db6('0x21')]=function(_0x36b97a){var _0x208597=this;return new Promise(function(_0x5619e2,_0x30f65b){return db[_0x0db6('0x18')][_0x0db6('0x22')]({'raw':_0x36b97a[_0x0db6('0x1a')]?_0x36b97a[_0x0db6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x36b97a[_0x0db6('0x1a')]?_0x36b97a[_0x0db6('0x1a')][_0x0db6('0x1b')]||null:null,'attributes':_0x36b97a[_0x0db6('0x1a')]?_0x36b97a[_0x0db6('0x1a')][_0x0db6('0x1c')]||null:null,'include':_0x36b97a[_0x0db6('0x1a')]?_0x36b97a['options'][_0x0db6('0x1e')]?_[_0x0db6('0x1f')](_0x36b97a[_0x0db6('0x1a')][_0x0db6('0x1e')],function(_0x49d2d9){return{'model':db[_0x49d2d9[_0x0db6('0x20')]],'as':_0x49d2d9['as'],'attributes':_0x49d2d9['attributes'],'include':_0x49d2d9[_0x0db6('0x1e')]?_[_0x0db6('0x1f')](_0x49d2d9[_0x0db6('0x1e')],function(_0xe2400a){return{'model':db[_0xe2400a[_0x0db6('0x20')]],'as':_0xe2400a['as'],'attributes':_0xe2400a['attributes'],'include':_0xe2400a[_0x0db6('0x1e')]?_[_0x0db6('0x1f')](_0xe2400a[_0x0db6('0x1e')],function(_0xb1aa23){return{'model':db[_0xb1aa23[_0x0db6('0x20')]],'as':_0xb1aa23['as'],'attributes':_0xb1aa23[_0x0db6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0db6('0xc')](function(_0x40997c){logger[_0x0db6('0xd')](_0x0db6('0x21'),_0x36b97a);logger['debug'](_0x0db6('0x21'),_0x36b97a,JSON[_0x0db6('0x11')](_0x40997c));_0x5619e2(_0x40997c);})['catch'](function(_0x111a9f){logger[_0x0db6('0x12')](_0x0db6('0x21'),_0x111a9f[_0x0db6('0x15')],_0x36b97a);_0x30f65b(_0x208597[_0x0db6('0x12')](0x1f4,_0x111a9f[_0x0db6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a3f5305..a75e80f 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0xa1916f,_0x2f8ba3){var _0x2ad877=function(_0x44e776){while(--_0x44e776){_0xa1916f['push'](_0xa1916f['shift']());}};_0x2ad877(++_0x2f8ba3);}(_0xedd9,0xfc));var _0x9edd=function(_0x201ece,_0x31c91e){_0x201ece=_0x201ece-0x0;var _0x5724ae=_0xedd9[_0x201ece];return _0x5724ae;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x314831,_0x2a49da){var _0x90851d=function(_0x3fcdb2){while(--_0x3fcdb2){_0x314831['push'](_0x314831['shift']());}};_0x90851d(++_0x2a49da);}(_0x008c,0x188));var _0xc008=function(_0x24594d,_0x18cfaa){_0x24594d=_0x24594d-0x0;var _0x215d28=_0x008c[_0x24594d];return _0x215d28;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f290056..21d025d 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 _0x6f44=['STRING','sequelize','exports'];(function(_0x41f882,_0x360760){var _0x402761=function(_0x325158){while(--_0x325158){_0x41f882['push'](_0x41f882['shift']());}};_0x402761(++_0x360760);}(_0x6f44,0x154));var _0x46f4=function(_0x308e29,_0x4b9abf){_0x308e29=_0x308e29-0x0;var _0x1bb322=_0x6f44[_0x308e29];return _0x1bb322;};'use strict';var Sequelize=require(_0x46f4('0x0'));module[_0x46f4('0x1')]={'name':{'type':Sequelize[_0x46f4('0x2')]},'description':{'type':Sequelize[_0x46f4('0x2')]}}; \ No newline at end of file +var _0xec69=['STRING','sequelize','exports'];(function(_0x3c2e0c,_0x62ca5f){var _0xa67634=function(_0x7fe4b5){while(--_0x7fe4b5){_0x3c2e0c['push'](_0x3c2e0c['shift']());}};_0xa67634(++_0x62ca5f);}(_0xec69,0x8e));var _0x9ec6=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xec69[_0x310504];return _0x5b36d0;};'use strict';var Sequelize=require(_0x9ec6('0x0'));module[_0x9ec6('0x1')]={'name':{'type':Sequelize[_0x9ec6('0x2')]},'description':{'type':Sequelize[_0x9ec6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 0cd4fe3..abf041c 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 _0xc6f7=['map','DeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','findAll','rows','show','params','intersection','include','find','create','body','catch','update','findOne','length','getFields','getSubjects','DeskField','order','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','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','status','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','end','sendStatus','error','stack','name','send','index'];(function(_0x3d8055,_0x19ef63){var _0x5a8e41=function(_0x397a1c){while(--_0x397a1c){_0x3d8055['push'](_0x3d8055['shift']());}};_0x5a8e41(++_0x19ef63);}(_0xc6f7,0x17f));var _0x7c6f=function(_0x355273,_0x533c9b){_0x355273=_0x355273-0x0;var _0x5d5e6d=_0xc6f7[_0x355273];return _0x5d5e6d;};'use strict';var emlformat=require(_0x7c6f('0x0'));var rimraf=require(_0x7c6f('0x1'));var zipdir=require(_0x7c6f('0x2'));var jsonpatch=require(_0x7c6f('0x3'));var rp=require(_0x7c6f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7c6f('0x5'));var util=require('util');var path=require(_0x7c6f('0x6'));var sox=require('sox');var csv=require(_0x7c6f('0x7'));var ejs=require(_0x7c6f('0x8'));var fs=require('fs');var fs_extra=require(_0x7c6f('0x9'));var _=require(_0x7c6f('0xa'));var squel=require(_0x7c6f('0xb'));var crypto=require(_0x7c6f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7c6f('0xd'));var toCsv=require(_0x7c6f('0x7'));var querystring=require(_0x7c6f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7c6f('0xf'));var authService=require(_0x7c6f('0x10'));var qs=require(_0x7c6f('0x11'));var as=require(_0x7c6f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c6f('0x13'))(_0x7c6f('0x14'));var utils=require(_0x7c6f('0x15'));var config=require(_0x7c6f('0x16'));var licenseUtil=require(_0x7c6f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf0e9b1,_0xabe6f){_0xabe6f=_0xabe6f||0xcc;return function(_0x54bb55){if(_0x54bb55){return _0xf0e9b1['sendStatus'](_0xabe6f);}return _0xf0e9b1[_0x7c6f('0x18')](_0xabe6f)['end']();};}function respondWithResult(_0x238ab8,_0x396357){_0x396357=_0x396357||0xc8;return function(_0xb4d60d){if(_0xb4d60d){return _0x238ab8[_0x7c6f('0x18')](_0x396357)[_0x7c6f('0x19')](_0xb4d60d);}};}function respondWithFilteredResult(_0x1c49f6,_0x553383){return function(_0x403111){if(_0x403111){var _0xe76a79=typeof _0x553383[_0x7c6f('0x1a')]===_0x7c6f('0x1b')&&typeof _0x553383['limit']==='undefined';var _0x58c652=_0x403111[_0x7c6f('0x1c')];var _0x5cb3c5=_0xe76a79?0x0:_0x553383[_0x7c6f('0x1a')];var _0x5626d5=_0xe76a79?_0x403111['count']:_0x553383[_0x7c6f('0x1a')]+_0x553383[_0x7c6f('0x1d')];var _0x3d9f74;if(_0x5626d5>=_0x58c652){_0x5626d5=_0x58c652;_0x3d9f74=0xc8;}else{_0x3d9f74=0xce;}_0x1c49f6[_0x7c6f('0x18')](_0x3d9f74);return _0x1c49f6[_0x7c6f('0x1e')](_0x7c6f('0x1f'),_0x5cb3c5+'-'+_0x5626d5+'/'+_0x58c652)[_0x7c6f('0x19')](_0x403111);}return null;};}function patchUpdates(_0x4340a1){return function(_0x3b4f74){try{jsonpatch[_0x7c6f('0x20')](_0x3b4f74,_0x4340a1,!![]);}catch(_0x1cf486){return BPromise['reject'](_0x1cf486);}return _0x3b4f74['save']();};}function saveUpdates(_0x1a2900,_0xc1497d){return function(_0x46938a){if(_0x46938a){return _0x46938a['update'](_0x1a2900)[_0x7c6f('0x21')](function(_0x4a095a){return _0x4a095a;});}return null;};}function removeEntity(_0x504d9d,_0x4fb6f7){return function(_0x71b3a8){if(_0x71b3a8){return _0x71b3a8[_0x7c6f('0x22')]()[_0x7c6f('0x21')](function(){_0x504d9d[_0x7c6f('0x18')](0xcc)[_0x7c6f('0x23')]();});}};}function handleEntityNotFound(_0x41bf9b,_0x294796){return function(_0x20749c){if(!_0x20749c){_0x41bf9b[_0x7c6f('0x24')](0x194);}return _0x20749c;};}function handleError(_0x4c81dd,_0x14d7f3){_0x14d7f3=_0x14d7f3||0x1f4;return function(_0x108068){logger[_0x7c6f('0x25')](_0x108068[_0x7c6f('0x26')]);if(_0x108068['name']){delete _0x108068[_0x7c6f('0x27')];}_0x4c81dd[_0x7c6f('0x18')](_0x14d7f3)[_0x7c6f('0x28')](_0x108068);};}exports[_0x7c6f('0x29')]=function(_0x5f5702,_0x32db54){var _0x30921d={},_0x5f1d05={},_0x188c36={'count':0x0,'rows':[]};var _0x38002d=_[_0x7c6f('0x2a')](db[_0x7c6f('0x2b')][_0x7c6f('0x2c')],function(_0x1d7487){return{'name':_0x1d7487[_0x7c6f('0x2d')],'type':_0x1d7487['type'][_0x7c6f('0x2e')]};});_0x5f1d05[_0x7c6f('0x2f')]=_['map'](_0x38002d,_0x7c6f('0x27'));_0x5f1d05[_0x7c6f('0x30')]=_[_0x7c6f('0x31')](_0x5f5702[_0x7c6f('0x30')]);_0x5f1d05[_0x7c6f('0x32')]=_['intersection'](_0x5f1d05[_0x7c6f('0x2f')],_0x5f1d05[_0x7c6f('0x30')]);_0x30921d['attributes']=_['intersection'](_0x5f1d05[_0x7c6f('0x2f')],qs[_0x7c6f('0x33')](_0x5f5702[_0x7c6f('0x30')][_0x7c6f('0x33')]));_0x30921d[_0x7c6f('0x34')]=_0x30921d[_0x7c6f('0x34')]['length']?_0x30921d[_0x7c6f('0x34')]:_0x5f1d05[_0x7c6f('0x2f')];if(!_0x5f5702[_0x7c6f('0x30')][_0x7c6f('0x35')](_0x7c6f('0x36'))){_0x30921d['limit']=qs[_0x7c6f('0x1d')](_0x5f5702[_0x7c6f('0x30')][_0x7c6f('0x1d')]);_0x30921d[_0x7c6f('0x1a')]=qs[_0x7c6f('0x1a')](_0x5f5702[_0x7c6f('0x30')][_0x7c6f('0x1a')]);}_0x30921d['order']=qs[_0x7c6f('0x37')](_0x5f5702[_0x7c6f('0x30')][_0x7c6f('0x37')]);_0x30921d[_0x7c6f('0x38')]=qs[_0x7c6f('0x32')](_[_0x7c6f('0x39')](_0x5f5702[_0x7c6f('0x30')],_0x5f1d05[_0x7c6f('0x32')]),_0x38002d);if(_0x5f5702[_0x7c6f('0x30')][_0x7c6f('0x3a')]){_0x30921d[_0x7c6f('0x38')]=_['merge'](_0x30921d['where'],{'$or':_[_0x7c6f('0x2a')](_0x38002d,function(_0x3feb52){if(_0x3feb52[_0x7c6f('0x3b')]!==_0x7c6f('0x3c')){var _0x4b811d={};_0x4b811d[_0x3feb52['name']]={'$like':'%'+_0x5f5702[_0x7c6f('0x30')][_0x7c6f('0x3a')]+'%'};return _0x4b811d;}})});}_0x30921d=_[_0x7c6f('0x3d')]({},_0x30921d,_0x5f5702[_0x7c6f('0x3e')]);var _0x5c80ef={'where':_0x30921d['where']};return db[_0x7c6f('0x2b')][_0x7c6f('0x1c')](_0x5c80ef)[_0x7c6f('0x21')](function(_0x24c7a1){_0x188c36['count']=_0x24c7a1;if(_0x5f5702['query']['includeAll']){_0x30921d['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x7c6f('0x3f')](_0x30921d);})[_0x7c6f('0x21')](function(_0x17cef4){_0x188c36[_0x7c6f('0x40')]=_0x17cef4;return _0x188c36;})['then'](respondWithFilteredResult(_0x32db54,_0x30921d))['catch'](handleError(_0x32db54,null));};exports[_0x7c6f('0x41')]=function(_0x44949a,_0x381d4c){var _0x2f1b7d={'raw':![],'where':{'id':_0x44949a[_0x7c6f('0x42')]['id']}},_0x33b4dd={};_0x33b4dd[_0x7c6f('0x2f')]=_[_0x7c6f('0x31')](db['DeskConfiguration'][_0x7c6f('0x2c')]);_0x33b4dd[_0x7c6f('0x30')]=_[_0x7c6f('0x31')](_0x44949a['query']);_0x33b4dd[_0x7c6f('0x32')]=_[_0x7c6f('0x43')](_0x33b4dd[_0x7c6f('0x2f')],_0x33b4dd[_0x7c6f('0x30')]);_0x2f1b7d[_0x7c6f('0x34')]=_['intersection'](_0x33b4dd[_0x7c6f('0x2f')],qs[_0x7c6f('0x33')](_0x44949a[_0x7c6f('0x30')]['fields']));_0x2f1b7d['attributes']=_0x2f1b7d[_0x7c6f('0x34')]['length']?_0x2f1b7d[_0x7c6f('0x34')]:_0x33b4dd[_0x7c6f('0x2f')];if(_0x44949a[_0x7c6f('0x30')]['includeAll']){_0x2f1b7d[_0x7c6f('0x44')]=[{'all':!![]}];}_0x2f1b7d=_[_0x7c6f('0x3d')]({},_0x2f1b7d,_0x44949a[_0x7c6f('0x3e')]);return db['DeskConfiguration'][_0x7c6f('0x45')](_0x2f1b7d)[_0x7c6f('0x21')](handleEntityNotFound(_0x381d4c,null))[_0x7c6f('0x21')](respondWithResult(_0x381d4c,null))['catch'](handleError(_0x381d4c,null));};exports[_0x7c6f('0x46')]=function(_0x20b0f9,_0x5a5ce7){return db[_0x7c6f('0x2b')][_0x7c6f('0x46')](_0x20b0f9[_0x7c6f('0x47')],{})['then'](respondWithResult(_0x5a5ce7,0xc9))[_0x7c6f('0x48')](handleError(_0x5a5ce7,null));};exports[_0x7c6f('0x49')]=function(_0x88ab39,_0x2f0740){if(_0x88ab39['body']['id']){delete _0x88ab39['body']['id'];}return db[_0x7c6f('0x2b')]['find']({'where':{'id':_0x88ab39['params']['id']}})[_0x7c6f('0x21')](handleEntityNotFound(_0x2f0740,null))[_0x7c6f('0x21')](saveUpdates(_0x88ab39[_0x7c6f('0x47')],null))[_0x7c6f('0x21')](respondWithResult(_0x2f0740,null))[_0x7c6f('0x48')](handleError(_0x2f0740,null));};exports['destroy']=function(_0x5a90c8,_0x404fbd){return db[_0x7c6f('0x2b')][_0x7c6f('0x45')]({'where':{'id':_0x5a90c8[_0x7c6f('0x42')]['id']}})[_0x7c6f('0x21')](handleEntityNotFound(_0x404fbd,null))['then'](removeEntity(_0x404fbd,null))[_0x7c6f('0x48')](handleError(_0x404fbd,null));};exports['getFields']=function(_0x5bacfe,_0x2c91c6,_0x2cda32){var _0x175e12={};var _0x2e9774={};var _0x5ab828;var _0x26ab80;return db['DeskConfiguration'][_0x7c6f('0x4a')]({'where':{'id':_0x5bacfe[_0x7c6f('0x42')]['id']}})[_0x7c6f('0x21')](handleEntityNotFound(_0x2c91c6,null))[_0x7c6f('0x21')](function(_0x3c4abb){if(_0x3c4abb){_0x5ab828=_0x3c4abb;_0x2e9774['model']=_[_0x7c6f('0x31')](db['DeskField'][_0x7c6f('0x2c')]);_0x2e9774['query']=_[_0x7c6f('0x31')](_0x5bacfe[_0x7c6f('0x30')]);_0x2e9774[_0x7c6f('0x32')]=_[_0x7c6f('0x43')](_0x2e9774['model'],_0x2e9774[_0x7c6f('0x30')]);_0x175e12[_0x7c6f('0x34')]=_[_0x7c6f('0x43')](_0x2e9774[_0x7c6f('0x2f')],qs[_0x7c6f('0x33')](_0x5bacfe[_0x7c6f('0x30')][_0x7c6f('0x33')]));_0x175e12[_0x7c6f('0x34')]=_0x175e12[_0x7c6f('0x34')][_0x7c6f('0x4b')]?_0x175e12[_0x7c6f('0x34')]:_0x2e9774[_0x7c6f('0x2f')];_0x175e12['order']=qs['sort'](_0x5bacfe['query'][_0x7c6f('0x37')]);_0x175e12[_0x7c6f('0x38')]=qs[_0x7c6f('0x32')](_[_0x7c6f('0x39')](_0x5bacfe[_0x7c6f('0x30')],_0x2e9774['filters']));if(_0x5bacfe[_0x7c6f('0x30')][_0x7c6f('0x3a')]){_0x175e12[_0x7c6f('0x38')]=_[_0x7c6f('0x3d')](_0x175e12[_0x7c6f('0x38')],{'$or':_[_0x7c6f('0x2a')](_0x175e12['attributes'],function(_0x550e4e){var _0xbdcdf2={};_0xbdcdf2[_0x550e4e]={'$like':'%'+_0x5bacfe[_0x7c6f('0x30')][_0x7c6f('0x3a')]+'%'};return _0xbdcdf2;})});}_0x175e12=_[_0x7c6f('0x3d')]({},_0x175e12,_0x5bacfe['options']);return _0x5ab828[_0x7c6f('0x4c')](_0x175e12);}})[_0x7c6f('0x21')](function(_0x4fca5c){if(_0x4fca5c){_0x26ab80=_0x4fca5c[_0x7c6f('0x4b')];if(!_0x5bacfe[_0x7c6f('0x30')][_0x7c6f('0x35')](_0x7c6f('0x36'))){_0x175e12[_0x7c6f('0x1d')]=qs[_0x7c6f('0x1d')](_0x5bacfe['query'][_0x7c6f('0x1d')]);_0x175e12[_0x7c6f('0x1a')]=qs[_0x7c6f('0x1a')](_0x5bacfe[_0x7c6f('0x30')][_0x7c6f('0x1a')]);}return _0x5ab828[_0x7c6f('0x4c')](_0x175e12);}})[_0x7c6f('0x21')](function(_0x56662f){if(_0x56662f){return _0x56662f?{'count':_0x26ab80,'rows':_0x56662f}:null;}})[_0x7c6f('0x21')](respondWithResult(_0x2c91c6,null))[_0x7c6f('0x48')](handleError(_0x2c91c6,null));};exports[_0x7c6f('0x4d')]=function(_0x505a63,_0x2cc05b,_0x4efe6d){var _0x3d5e63={};var _0x509b14={};var _0x2591c7;var _0x5666e0;return db[_0x7c6f('0x2b')]['findOne']({'where':{'id':_0x505a63[_0x7c6f('0x42')]['id']}})[_0x7c6f('0x21')](handleEntityNotFound(_0x2cc05b,null))[_0x7c6f('0x21')](function(_0xed43f6){if(_0xed43f6){_0x2591c7=_0xed43f6;_0x509b14[_0x7c6f('0x2f')]=_[_0x7c6f('0x31')](db[_0x7c6f('0x4e')][_0x7c6f('0x2c')]);_0x509b14[_0x7c6f('0x30')]=_[_0x7c6f('0x31')](_0x505a63[_0x7c6f('0x30')]);_0x509b14[_0x7c6f('0x32')]=_['intersection'](_0x509b14['model'],_0x509b14[_0x7c6f('0x30')]);_0x3d5e63[_0x7c6f('0x34')]=_['intersection'](_0x509b14['model'],qs['fields'](_0x505a63[_0x7c6f('0x30')]['fields']));_0x3d5e63[_0x7c6f('0x34')]=_0x3d5e63[_0x7c6f('0x34')][_0x7c6f('0x4b')]?_0x3d5e63[_0x7c6f('0x34')]:_0x509b14[_0x7c6f('0x2f')];_0x3d5e63['order']=qs[_0x7c6f('0x37')](_0x505a63[_0x7c6f('0x30')]['sort']);_0x3d5e63[_0x7c6f('0x38')]=qs[_0x7c6f('0x32')](_[_0x7c6f('0x39')](_0x505a63[_0x7c6f('0x30')],_0x509b14[_0x7c6f('0x32')]));if(_0x505a63[_0x7c6f('0x30')]['filter']){_0x3d5e63[_0x7c6f('0x38')]=_[_0x7c6f('0x3d')](_0x3d5e63[_0x7c6f('0x38')],{'$or':_[_0x7c6f('0x2a')](_0x3d5e63['attributes'],function(_0x1db318){var _0x26cb64={};_0x26cb64[_0x1db318]={'$like':'%'+_0x505a63[_0x7c6f('0x30')][_0x7c6f('0x3a')]+'%'};return _0x26cb64;})});}_0x3d5e63=_['merge']({},_0x3d5e63,_0x505a63['options']);return _0x2591c7['getSubjects'](_0x3d5e63);}})[_0x7c6f('0x21')](function(_0x56b47f){if(_0x56b47f){_0x5666e0=_0x56b47f[_0x7c6f('0x4b')];if(!_0x505a63[_0x7c6f('0x30')][_0x7c6f('0x35')]('nolimit')){_0x3d5e63[_0x7c6f('0x1d')]=qs['limit'](_0x505a63[_0x7c6f('0x30')][_0x7c6f('0x1d')]);_0x3d5e63[_0x7c6f('0x1a')]=qs[_0x7c6f('0x1a')](_0x505a63[_0x7c6f('0x30')][_0x7c6f('0x1a')]);}return _0x2591c7[_0x7c6f('0x4d')](_0x3d5e63);}})[_0x7c6f('0x21')](function(_0x2e6f9d){if(_0x2e6f9d){return _0x2e6f9d?{'count':_0x5666e0,'rows':_0x2e6f9d}:null;}})['then'](respondWithResult(_0x2cc05b,null))[_0x7c6f('0x48')](handleError(_0x2cc05b,null));};exports['getDescriptions']=function(_0xc6f7b9,_0x56e3b8,_0x4dd86d){var _0x54f2ea={};var _0x46629f={};var _0x2f2e95;var _0x1b0f4d;return db[_0x7c6f('0x2b')]['findOne']({'where':{'id':_0xc6f7b9[_0x7c6f('0x42')]['id']}})[_0x7c6f('0x21')](handleEntityNotFound(_0x56e3b8,null))[_0x7c6f('0x21')](function(_0x2bb74d){if(_0x2bb74d){_0x2f2e95=_0x2bb74d;_0x46629f[_0x7c6f('0x2f')]=_[_0x7c6f('0x31')](db[_0x7c6f('0x4e')][_0x7c6f('0x2c')]);_0x46629f[_0x7c6f('0x30')]=_[_0x7c6f('0x31')](_0xc6f7b9[_0x7c6f('0x30')]);_0x46629f[_0x7c6f('0x32')]=_[_0x7c6f('0x43')](_0x46629f[_0x7c6f('0x2f')],_0x46629f[_0x7c6f('0x30')]);_0x54f2ea[_0x7c6f('0x34')]=_[_0x7c6f('0x43')](_0x46629f[_0x7c6f('0x2f')],qs[_0x7c6f('0x33')](_0xc6f7b9[_0x7c6f('0x30')]['fields']));_0x54f2ea[_0x7c6f('0x34')]=_0x54f2ea['attributes'][_0x7c6f('0x4b')]?_0x54f2ea[_0x7c6f('0x34')]:_0x46629f[_0x7c6f('0x2f')];_0x54f2ea[_0x7c6f('0x4f')]=qs[_0x7c6f('0x37')](_0xc6f7b9[_0x7c6f('0x30')][_0x7c6f('0x37')]);_0x54f2ea['where']=qs[_0x7c6f('0x32')](_[_0x7c6f('0x39')](_0xc6f7b9[_0x7c6f('0x30')],_0x46629f['filters']));if(_0xc6f7b9['query'][_0x7c6f('0x3a')]){_0x54f2ea['where']=_[_0x7c6f('0x3d')](_0x54f2ea[_0x7c6f('0x38')],{'$or':_[_0x7c6f('0x2a')](_0x54f2ea[_0x7c6f('0x34')],function(_0x46f1ae){var _0x1b078f={};_0x1b078f[_0x46f1ae]={'$like':'%'+_0xc6f7b9[_0x7c6f('0x30')]['filter']+'%'};return _0x1b078f;})});}_0x54f2ea=_[_0x7c6f('0x3d')]({},_0x54f2ea,_0xc6f7b9[_0x7c6f('0x3e')]);return _0x2f2e95[_0x7c6f('0x50')](_0x54f2ea);}})['then'](function(_0x4502a9){if(_0x4502a9){_0x1b0f4d=_0x4502a9[_0x7c6f('0x4b')];if(!_0xc6f7b9[_0x7c6f('0x30')][_0x7c6f('0x35')]('nolimit')){_0x54f2ea['limit']=qs[_0x7c6f('0x1d')](_0xc6f7b9['query'][_0x7c6f('0x1d')]);_0x54f2ea[_0x7c6f('0x1a')]=qs[_0x7c6f('0x1a')](_0xc6f7b9['query'][_0x7c6f('0x1a')]);}return _0x2f2e95['getDescriptions'](_0x54f2ea);}})[_0x7c6f('0x21')](function(_0x2630c2){if(_0x2630c2){return _0x2630c2?{'count':_0x1b0f4d,'rows':_0x2630c2}:null;}})[_0x7c6f('0x21')](respondWithResult(_0x56e3b8,null))[_0x7c6f('0x48')](handleError(_0x56e3b8,null));};exports[_0x7c6f('0x51')]=function(_0x5a5114,_0x24b2d0,_0xa6c17b){var _0x12de0d={};var _0x3dbef5={};var _0x4135cd;var _0x4d1c00;return db[_0x7c6f('0x2b')][_0x7c6f('0x4a')]({'where':{'id':_0x5a5114['params']['id']}})[_0x7c6f('0x21')](handleEntityNotFound(_0x24b2d0,null))[_0x7c6f('0x21')](function(_0x1f9168){if(_0x1f9168){_0x4135cd=_0x1f9168;_0x3dbef5[_0x7c6f('0x2f')]=_[_0x7c6f('0x31')](db[_0x7c6f('0x52')][_0x7c6f('0x2c')]);_0x3dbef5['query']=_[_0x7c6f('0x31')](_0x5a5114[_0x7c6f('0x30')]);_0x3dbef5[_0x7c6f('0x32')]=_[_0x7c6f('0x43')](_0x3dbef5[_0x7c6f('0x2f')],_0x3dbef5[_0x7c6f('0x30')]);_0x12de0d[_0x7c6f('0x34')]=_[_0x7c6f('0x43')](_0x3dbef5[_0x7c6f('0x2f')],qs[_0x7c6f('0x33')](_0x5a5114[_0x7c6f('0x30')]['fields']));_0x12de0d[_0x7c6f('0x34')]=_0x12de0d[_0x7c6f('0x34')]['length']?_0x12de0d[_0x7c6f('0x34')]:_0x3dbef5[_0x7c6f('0x2f')];_0x12de0d['order']=qs[_0x7c6f('0x37')](_0x5a5114[_0x7c6f('0x30')][_0x7c6f('0x37')]);_0x12de0d[_0x7c6f('0x38')]=qs[_0x7c6f('0x32')](_[_0x7c6f('0x39')](_0x5a5114[_0x7c6f('0x30')],_0x3dbef5['filters']));if(_0x5a5114[_0x7c6f('0x30')][_0x7c6f('0x3a')]){_0x12de0d[_0x7c6f('0x38')]=_[_0x7c6f('0x3d')](_0x12de0d[_0x7c6f('0x38')],{'$or':_[_0x7c6f('0x2a')](_0x12de0d[_0x7c6f('0x34')],function(_0x17880c){var _0x2dba07={};_0x2dba07[_0x17880c]={'$like':'%'+_0x5a5114[_0x7c6f('0x30')][_0x7c6f('0x3a')]+'%'};return _0x2dba07;})});}_0x12de0d=_[_0x7c6f('0x3d')]({},_0x12de0d,_0x5a5114[_0x7c6f('0x3e')]);return _0x4135cd[_0x7c6f('0x51')](_0x12de0d);}})['then'](function(_0x3253f0){if(_0x3253f0){_0x4d1c00=_0x3253f0['length'];if(!_0x5a5114[_0x7c6f('0x30')][_0x7c6f('0x35')](_0x7c6f('0x36'))){_0x12de0d[_0x7c6f('0x1d')]=qs[_0x7c6f('0x1d')](_0x5a5114['query']['limit']);_0x12de0d['offset']=qs[_0x7c6f('0x1a')](_0x5a5114['query'][_0x7c6f('0x1a')]);}return _0x4135cd[_0x7c6f('0x51')](_0x12de0d);}})['then'](function(_0x54c910){if(_0x54c910){return _0x54c910?{'count':_0x4d1c00,'rows':_0x54c910}:null;}})[_0x7c6f('0x21')](respondWithResult(_0x24b2d0,null))['catch'](handleError(_0x24b2d0,null));};exports['setTags']=function(_0x32c660,_0xe6a25e,_0x3197c5){if(_0x32c660[_0x7c6f('0x47')]['id']){delete _0x32c660[_0x7c6f('0x47')]['id'];}return db[_0x7c6f('0x2b')][_0x7c6f('0x4a')]({'where':{'id':_0x32c660['params']['id']}})[_0x7c6f('0x21')](handleEntityNotFound(_0xe6a25e,null))['then'](function(_0x46fb26){if(_0x46fb26){return _0x46fb26[_0x7c6f('0x53')](_0x32c660[_0x7c6f('0x47')][_0x7c6f('0x54')]||[]);}return null;})[_0x7c6f('0x21')](respondWithResult(_0xe6a25e,null))[_0x7c6f('0x48')](handleError(_0xe6a25e,null));}; \ No newline at end of file +var _0x689d=['query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','update','getFields','findOne','DeskField','length','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','stack','name','index','DeskConfiguration','fieldName','type','key','model'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x689d,0x17f));var _0xd689=function(_0x175bda,_0x3afa11){_0x175bda=_0x175bda-0x0;var _0x1537d9=_0x689d[_0x175bda];return _0x1537d9;};'use strict';var emlformat=require(_0xd689('0x0'));var rimraf=require(_0xd689('0x1'));var zipdir=require(_0xd689('0x2'));var jsonpatch=require(_0xd689('0x3'));var rp=require(_0xd689('0x4'));var moment=require(_0xd689('0x5'));var BPromise=require(_0xd689('0x6'));var Mustache=require(_0xd689('0x7'));var util=require(_0xd689('0x8'));var path=require(_0xd689('0x9'));var sox=require(_0xd689('0xa'));var csv=require(_0xd689('0xb'));var ejs=require(_0xd689('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd689('0xd'));var squel=require(_0xd689('0xe'));var crypto=require(_0xd689('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd689('0x10'));var toCsv=require(_0xd689('0xb'));var querystring=require('querystring');var Papa=require(_0xd689('0x11'));var Redis=require(_0xd689('0x12'));var authService=require(_0xd689('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd689('0x14'));var logger=require(_0xd689('0x15'))(_0xd689('0x16'));var utils=require(_0xd689('0x17'));var config=require(_0xd689('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd689('0x19'))['db'];function respondWithStatusCode(_0x599a3b,_0x3ca66b){_0x3ca66b=_0x3ca66b||0xcc;return function(_0x3f28b4){if(_0x3f28b4){return _0x599a3b[_0xd689('0x1a')](_0x3ca66b);}return _0x599a3b[_0xd689('0x1b')](_0x3ca66b)['end']();};}function respondWithResult(_0x136cde,_0x322ebb){_0x322ebb=_0x322ebb||0xc8;return function(_0x3e3004){if(_0x3e3004){return _0x136cde[_0xd689('0x1b')](_0x322ebb)['json'](_0x3e3004);}};}function respondWithFilteredResult(_0x231303,_0x3dcf42){return function(_0x537ee5){if(_0x537ee5){var _0x256944=typeof _0x3dcf42['offset']===_0xd689('0x1c')&&typeof _0x3dcf42['limit']==='undefined';var _0x3dc9c7=_0x537ee5[_0xd689('0x1d')];var _0x3bb50f=_0x256944?0x0:_0x3dcf42[_0xd689('0x1e')];var _0x2f46f7=_0x256944?_0x537ee5['count']:_0x3dcf42[_0xd689('0x1e')]+_0x3dcf42['limit'];var _0x25137d;if(_0x2f46f7>=_0x3dc9c7){_0x2f46f7=_0x3dc9c7;_0x25137d=0xc8;}else{_0x25137d=0xce;}_0x231303[_0xd689('0x1b')](_0x25137d);return _0x231303[_0xd689('0x1f')](_0xd689('0x20'),_0x3bb50f+'-'+_0x2f46f7+'/'+_0x3dc9c7)[_0xd689('0x21')](_0x537ee5);}return null;};}function patchUpdates(_0x37097d){return function(_0x55a9bd){try{jsonpatch[_0xd689('0x22')](_0x55a9bd,_0x37097d,!![]);}catch(_0x3d24f3){return BPromise[_0xd689('0x23')](_0x3d24f3);}return _0x55a9bd[_0xd689('0x24')]();};}function saveUpdates(_0x575e23,_0x340955){return function(_0x472e63){if(_0x472e63){return _0x472e63['update'](_0x575e23)['then'](function(_0x1e5488){return _0x1e5488;});}return null;};}function removeEntity(_0x407711,_0x1aaec7){return function(_0x188674){if(_0x188674){return _0x188674[_0xd689('0x25')]()[_0xd689('0x26')](function(){_0x407711[_0xd689('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcedb36,_0x3cf253){return function(_0x7ee7fe){if(!_0x7ee7fe){_0xcedb36[_0xd689('0x1a')](0x194);}return _0x7ee7fe;};}function handleError(_0x3e4ebb,_0x48ec03){_0x48ec03=_0x48ec03||0x1f4;return function(_0x357061){logger['error'](_0x357061[_0xd689('0x27')]);if(_0x357061[_0xd689('0x28')]){delete _0x357061[_0xd689('0x28')];}_0x3e4ebb[_0xd689('0x1b')](_0x48ec03)['send'](_0x357061);};}exports[_0xd689('0x29')]=function(_0x1ed5b5,_0x1009be){var _0xfdcd61={},_0x4dc697={},_0x2dc9da={'count':0x0,'rows':[]};var _0x107daa=_['map'](db[_0xd689('0x2a')]['rawAttributes'],function(_0x3bc45e){return{'name':_0x3bc45e[_0xd689('0x2b')],'type':_0x3bc45e[_0xd689('0x2c')][_0xd689('0x2d')]};});_0x4dc697[_0xd689('0x2e')]=_['map'](_0x107daa,_0xd689('0x28'));_0x4dc697[_0xd689('0x2f')]=_[_0xd689('0x30')](_0x1ed5b5[_0xd689('0x2f')]);_0x4dc697['filters']=_[_0xd689('0x31')](_0x4dc697[_0xd689('0x2e')],_0x4dc697[_0xd689('0x2f')]);_0xfdcd61[_0xd689('0x32')]=_[_0xd689('0x31')](_0x4dc697[_0xd689('0x2e')],qs[_0xd689('0x33')](_0x1ed5b5[_0xd689('0x2f')][_0xd689('0x33')]));_0xfdcd61[_0xd689('0x32')]=_0xfdcd61[_0xd689('0x32')]['length']?_0xfdcd61[_0xd689('0x32')]:_0x4dc697[_0xd689('0x2e')];if(!_0x1ed5b5['query']['hasOwnProperty'](_0xd689('0x34'))){_0xfdcd61[_0xd689('0x35')]=qs['limit'](_0x1ed5b5[_0xd689('0x2f')][_0xd689('0x35')]);_0xfdcd61[_0xd689('0x1e')]=qs[_0xd689('0x1e')](_0x1ed5b5['query'][_0xd689('0x1e')]);}_0xfdcd61[_0xd689('0x36')]=qs[_0xd689('0x37')](_0x1ed5b5['query']['sort']);_0xfdcd61[_0xd689('0x38')]=qs[_0xd689('0x39')](_[_0xd689('0x3a')](_0x1ed5b5['query'],_0x4dc697[_0xd689('0x39')]),_0x107daa);if(_0x1ed5b5[_0xd689('0x2f')][_0xd689('0x3b')]){_0xfdcd61['where']=_['merge'](_0xfdcd61[_0xd689('0x38')],{'$or':_[_0xd689('0x3c')](_0x107daa,function(_0x24e9b9){if(_0x24e9b9[_0xd689('0x2c')]!==_0xd689('0x3d')){var _0x3b2010={};_0x3b2010[_0x24e9b9[_0xd689('0x28')]]={'$like':'%'+_0x1ed5b5['query']['filter']+'%'};return _0x3b2010;}})});}_0xfdcd61=_[_0xd689('0x3e')]({},_0xfdcd61,_0x1ed5b5[_0xd689('0x3f')]);var _0x5474e8={'where':_0xfdcd61[_0xd689('0x38')]};return db['DeskConfiguration'][_0xd689('0x1d')](_0x5474e8)[_0xd689('0x26')](function(_0x437ad3){_0x2dc9da[_0xd689('0x1d')]=_0x437ad3;if(_0x1ed5b5[_0xd689('0x2f')][_0xd689('0x40')]){_0xfdcd61['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xd689('0x41')](_0xfdcd61);})[_0xd689('0x26')](function(_0x4efdd2){_0x2dc9da['rows']=_0x4efdd2;return _0x2dc9da;})[_0xd689('0x26')](respondWithFilteredResult(_0x1009be,_0xfdcd61))[_0xd689('0x42')](handleError(_0x1009be,null));};exports[_0xd689('0x43')]=function(_0x133e2f,_0x26f0d9){var _0x5cae06={'raw':![],'where':{'id':_0x133e2f[_0xd689('0x44')]['id']}},_0x1b4219={};_0x1b4219[_0xd689('0x2e')]=_[_0xd689('0x30')](db[_0xd689('0x2a')][_0xd689('0x45')]);_0x1b4219[_0xd689('0x2f')]=_[_0xd689('0x30')](_0x133e2f['query']);_0x1b4219['filters']=_[_0xd689('0x31')](_0x1b4219['model'],_0x1b4219[_0xd689('0x2f')]);_0x5cae06[_0xd689('0x32')]=_[_0xd689('0x31')](_0x1b4219[_0xd689('0x2e')],qs[_0xd689('0x33')](_0x133e2f['query']['fields']));_0x5cae06[_0xd689('0x32')]=_0x5cae06['attributes']['length']?_0x5cae06[_0xd689('0x32')]:_0x1b4219[_0xd689('0x2e')];if(_0x133e2f[_0xd689('0x2f')][_0xd689('0x40')]){_0x5cae06[_0xd689('0x46')]=[{'all':!![]}];}_0x5cae06=_[_0xd689('0x3e')]({},_0x5cae06,_0x133e2f[_0xd689('0x3f')]);return db[_0xd689('0x2a')][_0xd689('0x47')](_0x5cae06)['then'](handleEntityNotFound(_0x26f0d9,null))[_0xd689('0x26')](respondWithResult(_0x26f0d9,null))[_0xd689('0x42')](handleError(_0x26f0d9,null));};exports[_0xd689('0x48')]=function(_0x2662ab,_0xc71223){return db[_0xd689('0x2a')]['create'](_0x2662ab[_0xd689('0x49')],{})[_0xd689('0x26')](respondWithResult(_0xc71223,0xc9))[_0xd689('0x42')](handleError(_0xc71223,null));};exports[_0xd689('0x4a')]=function(_0x154932,_0x33b118){if(_0x154932[_0xd689('0x49')]['id']){delete _0x154932[_0xd689('0x49')]['id'];}return db['DeskConfiguration'][_0xd689('0x47')]({'where':{'id':_0x154932[_0xd689('0x44')]['id']}})['then'](handleEntityNotFound(_0x33b118,null))[_0xd689('0x26')](saveUpdates(_0x154932[_0xd689('0x49')],null))[_0xd689('0x26')](respondWithResult(_0x33b118,null))[_0xd689('0x42')](handleError(_0x33b118,null));};exports['destroy']=function(_0x56e2ca,_0x46e90f){return db[_0xd689('0x2a')][_0xd689('0x47')]({'where':{'id':_0x56e2ca[_0xd689('0x44')]['id']}})[_0xd689('0x26')](handleEntityNotFound(_0x46e90f,null))[_0xd689('0x26')](removeEntity(_0x46e90f,null))[_0xd689('0x42')](handleError(_0x46e90f,null));};exports[_0xd689('0x4b')]=function(_0x306119,_0x5ea628,_0x1a4944){var _0x460112={};var _0x1e0cf9={};var _0x19857a;var _0x4b8677;return db[_0xd689('0x2a')][_0xd689('0x4c')]({'where':{'id':_0x306119[_0xd689('0x44')]['id']}})[_0xd689('0x26')](handleEntityNotFound(_0x5ea628,null))[_0xd689('0x26')](function(_0x4a1b54){if(_0x4a1b54){_0x19857a=_0x4a1b54;_0x1e0cf9[_0xd689('0x2e')]=_[_0xd689('0x30')](db[_0xd689('0x4d')][_0xd689('0x45')]);_0x1e0cf9[_0xd689('0x2f')]=_['keys'](_0x306119['query']);_0x1e0cf9[_0xd689('0x39')]=_[_0xd689('0x31')](_0x1e0cf9[_0xd689('0x2e')],_0x1e0cf9[_0xd689('0x2f')]);_0x460112['attributes']=_[_0xd689('0x31')](_0x1e0cf9[_0xd689('0x2e')],qs[_0xd689('0x33')](_0x306119[_0xd689('0x2f')][_0xd689('0x33')]));_0x460112[_0xd689('0x32')]=_0x460112[_0xd689('0x32')]['length']?_0x460112[_0xd689('0x32')]:_0x1e0cf9[_0xd689('0x2e')];_0x460112[_0xd689('0x36')]=qs[_0xd689('0x37')](_0x306119[_0xd689('0x2f')]['sort']);_0x460112['where']=qs['filters'](_[_0xd689('0x3a')](_0x306119['query'],_0x1e0cf9[_0xd689('0x39')]));if(_0x306119[_0xd689('0x2f')][_0xd689('0x3b')]){_0x460112[_0xd689('0x38')]=_['merge'](_0x460112[_0xd689('0x38')],{'$or':_[_0xd689('0x3c')](_0x460112['attributes'],function(_0x3e292b){var _0x43f466={};_0x43f466[_0x3e292b]={'$like':'%'+_0x306119[_0xd689('0x2f')][_0xd689('0x3b')]+'%'};return _0x43f466;})});}_0x460112=_[_0xd689('0x3e')]({},_0x460112,_0x306119[_0xd689('0x3f')]);return _0x19857a['getFields'](_0x460112);}})['then'](function(_0x42538b){if(_0x42538b){_0x4b8677=_0x42538b[_0xd689('0x4e')];if(!_0x306119[_0xd689('0x2f')][_0xd689('0x4f')](_0xd689('0x34'))){_0x460112[_0xd689('0x35')]=qs[_0xd689('0x35')](_0x306119['query'][_0xd689('0x35')]);_0x460112[_0xd689('0x1e')]=qs[_0xd689('0x1e')](_0x306119['query'][_0xd689('0x1e')]);}return _0x19857a[_0xd689('0x4b')](_0x460112);}})[_0xd689('0x26')](function(_0x25c6a6){if(_0x25c6a6){return _0x25c6a6?{'count':_0x4b8677,'rows':_0x25c6a6}:null;}})[_0xd689('0x26')](respondWithResult(_0x5ea628,null))[_0xd689('0x42')](handleError(_0x5ea628,null));};exports[_0xd689('0x50')]=function(_0x3a34f1,_0x2e634c,_0x4f7bd4){var _0x5d8824={};var _0x2e9579={};var _0x2b6e06;var _0x3f9541;return db['DeskConfiguration'][_0xd689('0x4c')]({'where':{'id':_0x3a34f1['params']['id']}})[_0xd689('0x26')](handleEntityNotFound(_0x2e634c,null))[_0xd689('0x26')](function(_0x1ef136){if(_0x1ef136){_0x2b6e06=_0x1ef136;_0x2e9579['model']=_[_0xd689('0x30')](db[_0xd689('0x4d')][_0xd689('0x45')]);_0x2e9579[_0xd689('0x2f')]=_[_0xd689('0x30')](_0x3a34f1[_0xd689('0x2f')]);_0x2e9579[_0xd689('0x39')]=_[_0xd689('0x31')](_0x2e9579['model'],_0x2e9579[_0xd689('0x2f')]);_0x5d8824[_0xd689('0x32')]=_[_0xd689('0x31')](_0x2e9579[_0xd689('0x2e')],qs[_0xd689('0x33')](_0x3a34f1['query'][_0xd689('0x33')]));_0x5d8824[_0xd689('0x32')]=_0x5d8824[_0xd689('0x32')]['length']?_0x5d8824[_0xd689('0x32')]:_0x2e9579[_0xd689('0x2e')];_0x5d8824[_0xd689('0x36')]=qs[_0xd689('0x37')](_0x3a34f1[_0xd689('0x2f')]['sort']);_0x5d8824['where']=qs[_0xd689('0x39')](_[_0xd689('0x3a')](_0x3a34f1[_0xd689('0x2f')],_0x2e9579[_0xd689('0x39')]));if(_0x3a34f1[_0xd689('0x2f')][_0xd689('0x3b')]){_0x5d8824[_0xd689('0x38')]=_[_0xd689('0x3e')](_0x5d8824[_0xd689('0x38')],{'$or':_['map'](_0x5d8824[_0xd689('0x32')],function(_0x18adf7){var _0x2bb79d={};_0x2bb79d[_0x18adf7]={'$like':'%'+_0x3a34f1[_0xd689('0x2f')][_0xd689('0x3b')]+'%'};return _0x2bb79d;})});}_0x5d8824=_[_0xd689('0x3e')]({},_0x5d8824,_0x3a34f1['options']);return _0x2b6e06['getSubjects'](_0x5d8824);}})['then'](function(_0x257f96){if(_0x257f96){_0x3f9541=_0x257f96[_0xd689('0x4e')];if(!_0x3a34f1[_0xd689('0x2f')][_0xd689('0x4f')]('nolimit')){_0x5d8824['limit']=qs['limit'](_0x3a34f1[_0xd689('0x2f')]['limit']);_0x5d8824[_0xd689('0x1e')]=qs[_0xd689('0x1e')](_0x3a34f1[_0xd689('0x2f')][_0xd689('0x1e')]);}return _0x2b6e06['getSubjects'](_0x5d8824);}})['then'](function(_0x3affce){if(_0x3affce){return _0x3affce?{'count':_0x3f9541,'rows':_0x3affce}:null;}})[_0xd689('0x26')](respondWithResult(_0x2e634c,null))[_0xd689('0x42')](handleError(_0x2e634c,null));};exports[_0xd689('0x51')]=function(_0x3afa4a,_0x332b76,_0x2fc0c3){var _0x41377d={};var _0x43aa97={};var _0x5857f8;var _0x4d15fa;return db[_0xd689('0x2a')][_0xd689('0x4c')]({'where':{'id':_0x3afa4a[_0xd689('0x44')]['id']}})[_0xd689('0x26')](handleEntityNotFound(_0x332b76,null))['then'](function(_0x58b48e){if(_0x58b48e){_0x5857f8=_0x58b48e;_0x43aa97['model']=_[_0xd689('0x30')](db[_0xd689('0x4d')][_0xd689('0x45')]);_0x43aa97[_0xd689('0x2f')]=_[_0xd689('0x30')](_0x3afa4a['query']);_0x43aa97[_0xd689('0x39')]=_[_0xd689('0x31')](_0x43aa97[_0xd689('0x2e')],_0x43aa97[_0xd689('0x2f')]);_0x41377d[_0xd689('0x32')]=_[_0xd689('0x31')](_0x43aa97['model'],qs[_0xd689('0x33')](_0x3afa4a[_0xd689('0x2f')][_0xd689('0x33')]));_0x41377d[_0xd689('0x32')]=_0x41377d[_0xd689('0x32')][_0xd689('0x4e')]?_0x41377d['attributes']:_0x43aa97[_0xd689('0x2e')];_0x41377d[_0xd689('0x36')]=qs[_0xd689('0x37')](_0x3afa4a[_0xd689('0x2f')][_0xd689('0x37')]);_0x41377d['where']=qs[_0xd689('0x39')](_[_0xd689('0x3a')](_0x3afa4a[_0xd689('0x2f')],_0x43aa97['filters']));if(_0x3afa4a[_0xd689('0x2f')][_0xd689('0x3b')]){_0x41377d[_0xd689('0x38')]=_[_0xd689('0x3e')](_0x41377d[_0xd689('0x38')],{'$or':_[_0xd689('0x3c')](_0x41377d[_0xd689('0x32')],function(_0x461070){var _0x141c58={};_0x141c58[_0x461070]={'$like':'%'+_0x3afa4a['query']['filter']+'%'};return _0x141c58;})});}_0x41377d=_['merge']({},_0x41377d,_0x3afa4a[_0xd689('0x3f')]);return _0x5857f8[_0xd689('0x51')](_0x41377d);}})[_0xd689('0x26')](function(_0x1c9d62){if(_0x1c9d62){_0x4d15fa=_0x1c9d62[_0xd689('0x4e')];if(!_0x3afa4a['query'][_0xd689('0x4f')]('nolimit')){_0x41377d[_0xd689('0x35')]=qs[_0xd689('0x35')](_0x3afa4a[_0xd689('0x2f')][_0xd689('0x35')]);_0x41377d[_0xd689('0x1e')]=qs[_0xd689('0x1e')](_0x3afa4a['query']['offset']);}return _0x5857f8[_0xd689('0x51')](_0x41377d);}})[_0xd689('0x26')](function(_0x3d8082){if(_0x3d8082){return _0x3d8082?{'count':_0x4d15fa,'rows':_0x3d8082}:null;}})['then'](respondWithResult(_0x332b76,null))[_0xd689('0x42')](handleError(_0x332b76,null));};exports['getTags']=function(_0x1defd5,_0x21869e,_0xb7dd0){var _0x10bd91={};var _0x82debb={};var _0x17e50c;var _0x2252d1;return db[_0xd689('0x2a')][_0xd689('0x4c')]({'where':{'id':_0x1defd5[_0xd689('0x44')]['id']}})['then'](handleEntityNotFound(_0x21869e,null))[_0xd689('0x26')](function(_0x5d77b2){if(_0x5d77b2){_0x17e50c=_0x5d77b2;_0x82debb[_0xd689('0x2e')]=_[_0xd689('0x30')](db[_0xd689('0x52')][_0xd689('0x45')]);_0x82debb['query']=_[_0xd689('0x30')](_0x1defd5['query']);_0x82debb[_0xd689('0x39')]=_[_0xd689('0x31')](_0x82debb[_0xd689('0x2e')],_0x82debb['query']);_0x10bd91['attributes']=_[_0xd689('0x31')](_0x82debb[_0xd689('0x2e')],qs[_0xd689('0x33')](_0x1defd5['query'][_0xd689('0x33')]));_0x10bd91[_0xd689('0x32')]=_0x10bd91['attributes'][_0xd689('0x4e')]?_0x10bd91['attributes']:_0x82debb[_0xd689('0x2e')];_0x10bd91[_0xd689('0x36')]=qs[_0xd689('0x37')](_0x1defd5[_0xd689('0x2f')][_0xd689('0x37')]);_0x10bd91[_0xd689('0x38')]=qs[_0xd689('0x39')](_[_0xd689('0x3a')](_0x1defd5['query'],_0x82debb[_0xd689('0x39')]));if(_0x1defd5[_0xd689('0x2f')][_0xd689('0x3b')]){_0x10bd91[_0xd689('0x38')]=_[_0xd689('0x3e')](_0x10bd91[_0xd689('0x38')],{'$or':_['map'](_0x10bd91[_0xd689('0x32')],function(_0x6e0e2a){var _0x27f11b={};_0x27f11b[_0x6e0e2a]={'$like':'%'+_0x1defd5[_0xd689('0x2f')]['filter']+'%'};return _0x27f11b;})});}_0x10bd91=_[_0xd689('0x3e')]({},_0x10bd91,_0x1defd5['options']);return _0x17e50c[_0xd689('0x53')](_0x10bd91);}})['then'](function(_0x443a0a){if(_0x443a0a){_0x2252d1=_0x443a0a[_0xd689('0x4e')];if(!_0x1defd5[_0xd689('0x2f')][_0xd689('0x4f')](_0xd689('0x34'))){_0x10bd91[_0xd689('0x35')]=qs[_0xd689('0x35')](_0x1defd5[_0xd689('0x2f')][_0xd689('0x35')]);_0x10bd91['offset']=qs[_0xd689('0x1e')](_0x1defd5[_0xd689('0x2f')][_0xd689('0x1e')]);}return _0x17e50c[_0xd689('0x53')](_0x10bd91);}})['then'](function(_0x2228a0){if(_0x2228a0){return _0x2228a0?{'count':_0x2252d1,'rows':_0x2228a0}:null;}})['then'](respondWithResult(_0x21869e,null))['catch'](handleError(_0x21869e,null));};exports[_0xd689('0x54')]=function(_0x15fad0,_0x50f676,_0x5cec0a){if(_0x15fad0[_0xd689('0x49')]['id']){delete _0x15fad0[_0xd689('0x49')]['id'];}return db[_0xd689('0x2a')][_0xd689('0x4c')]({'where':{'id':_0x15fad0['params']['id']}})[_0xd689('0x26')](handleEntityNotFound(_0x50f676,null))['then'](function(_0x5e3dda){if(_0x5e3dda){return _0x5e3dda[_0xd689('0x54')](_0x15fad0[_0xd689('0x49')][_0xd689('0x55')]||[]);}return null;})[_0xd689('0x26')](respondWithResult(_0x50f676,null))[_0xd689('0x42')](handleError(_0x50f676,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index d5d4f70..ec4793e 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 _0x2ff7=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','int_desk_configurations'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x2ff7,0xc8));var _0x72ff=function(_0x3f732b,_0x54d460){_0x3f732b=_0x3f732b-0x0;var _0x3bdb1f=_0x2ff7[_0x3f732b];return _0x3bdb1f;};'use strict';var _=require(_0x72ff('0x0'));var util=require(_0x72ff('0x1'));var logger=require(_0x72ff('0x2'))(_0x72ff('0x3'));var moment=require('moment');var BPromise=require(_0x72ff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x72ff('0x5'));var config=require(_0x72ff('0x6'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x2cf6c3,_0x76ea0d){return _0x2cf6c3['define']('DeskConfiguration',attributes,{'tableName':_0x72ff('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc196=['DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define'];(function(_0x1edc64,_0x1aaad3){var _0x4cb4bb=function(_0x15f956){while(--_0x15f956){_0x1edc64['push'](_0x1edc64['shift']());}};_0x4cb4bb(++_0x1aaad3);}(_0xc196,0x1bc));var _0x6c19=function(_0x443d77,_0x34e687){_0x443d77=_0x443d77-0x0;var _0x132cc5=_0xc196[_0x443d77];return _0x132cc5;};'use strict';var _=require(_0x6c19('0x0'));var util=require(_0x6c19('0x1'));var logger=require(_0x6c19('0x2'))(_0x6c19('0x3'));var moment=require(_0x6c19('0x4'));var BPromise=require(_0x6c19('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6c19('0x6'));var config=require(_0x6c19('0x7'));var attributes=require(_0x6c19('0x8'));module[_0x6c19('0x9')]=function(_0x448488,_0x589fd3){return _0x448488[_0x6c19('0xa')](_0x6c19('0xb'),attributes,{'tableName':_0x6c19('0xc'),'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 6d12051..decd617 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 _0x36ee=['jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2870a6,_0x327309){var _0x48087c=function(_0x404141){while(--_0x404141){_0x2870a6['push'](_0x2870a6['shift']());}};_0x48087c(++_0x327309);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});} \ No newline at end of file +var _0xfdbf=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x21268b,_0x530c67){var _0x31c8f4=function(_0x107af5){while(--_0x107af5){_0x21268b['push'](_0x21268b['shift']());}};_0x31c8f4(++_0x530c67);}(_0xfdbf,0xb5));var _0xffdb=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xfdbf[_0x511bd1];return _0x4c48ec;};'use strict';var _=require(_0xffdb('0x0'));var util=require(_0xffdb('0x1'));var moment=require(_0xffdb('0x2'));var BPromise=require('bluebird');var rs=require(_0xffdb('0x3'));var fs=require('fs');var Redis=require(_0xffdb('0x4'));var db=require(_0xffdb('0x5'))['db'];var utils=require(_0xffdb('0x6'));var logger=require('../../config/logger')(_0xffdb('0x7'));var config=require('../../config/environment');var jayson=require(_0xffdb('0x8'));var client=jayson[_0xffdb('0x9')][_0xffdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb05d77,_0x39c233,_0x1b024a){return new BPromise(function(_0xd4c378,_0x2e25cf){return client[_0xffdb('0xb')](_0xb05d77,_0x1b024a)[_0xffdb('0xc')](function(_0x2d5f34){logger[_0xffdb('0xd')](_0xffdb('0xe'),_0x39c233,_0xffdb('0xf'));logger[_0xffdb('0x10')](_0xffdb('0x11'),_0x39c233,'request\x20sent',JSON[_0xffdb('0x12')](_0x2d5f34));if(_0x2d5f34[_0xffdb('0x13')]){if(_0x2d5f34['error']['code']===0x1f4){logger[_0xffdb('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x39c233,_0x2d5f34['error'][_0xffdb('0x14')]);return _0x2e25cf(_0x2d5f34[_0xffdb('0x13')][_0xffdb('0x14')]);}logger[_0xffdb('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x39c233,_0x2d5f34['error'][_0xffdb('0x14')]);return _0xd4c378(_0x2d5f34[_0xffdb('0x13')]['message']);}else{logger[_0xffdb('0xd')](_0xffdb('0xe'),_0x39c233,_0xffdb('0xf'));_0xd4c378(_0x2d5f34[_0xffdb('0x15')]['message']);}})[_0xffdb('0x16')](function(_0x515e97){logger['error'](_0xffdb('0xe'),_0x39c233,_0x515e97);_0x2e25cf(_0x515e97);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index b13db0c..7b7f3bf 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 _0x8cdb=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x8cdb,0x193));var _0xb8cd=function(_0x357015,_0x533c0a){_0x357015=_0x357015-0x0;var _0x1c42bc=_0x8cdb[_0x357015];return _0x1c42bc;};'use strict';var multer=require(_0xb8cd('0x0'));var util=require(_0xb8cd('0x1'));var path=require(_0xb8cd('0x2'));var timeout=require(_0xb8cd('0x3'));var express=require('express');var router=express[_0xb8cd('0x4')]();var fs_extra=require(_0xb8cd('0x5'));var auth=require(_0xb8cd('0x6'));var interaction=require(_0xb8cd('0x7'));var config=require(_0xb8cd('0x8'));var controller=require(_0xb8cd('0x9'));router[_0xb8cd('0xa')]('/',auth['isAuthenticated'](),controller[_0xb8cd('0xb')]);router[_0xb8cd('0xa')](_0xb8cd('0xc'),auth[_0xb8cd('0xd')](),controller[_0xb8cd('0xe')]);router[_0xb8cd('0xf')]('/',auth['isAuthenticated'](),controller[_0xb8cd('0x10')]);router[_0xb8cd('0x11')](_0xb8cd('0xc'),auth['isAuthenticated'](),controller[_0xb8cd('0x12')]);router[_0xb8cd('0x13')]('/:id',auth[_0xb8cd('0xd')](),controller[_0xb8cd('0x14')]);module[_0xb8cd('0x15')]=router; \ No newline at end of file +var _0x3c12=['Router','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer','util','path','express'];(function(_0x5b9d68,_0x384d59){var _0x251da4=function(_0x4a5dca){while(--_0x4a5dca){_0x5b9d68['push'](_0x5b9d68['shift']());}};_0x251da4(++_0x384d59);}(_0x3c12,0x161));var _0x23c1=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0x3c12[_0x15106b];return _0x521203;};'use strict';var multer=require(_0x23c1('0x0'));var util=require(_0x23c1('0x1'));var path=require(_0x23c1('0x2'));var timeout=require('connect-timeout');var express=require(_0x23c1('0x3'));var router=express[_0x23c1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x23c1('0x5'));var interaction=require(_0x23c1('0x6'));var config=require('../../config/environment');var controller=require(_0x23c1('0x7'));router[_0x23c1('0x8')]('/',auth[_0x23c1('0x9')](),controller[_0x23c1('0xa')]);router[_0x23c1('0x8')](_0x23c1('0xb'),auth['isAuthenticated'](),controller[_0x23c1('0xc')]);router[_0x23c1('0xd')]('/',auth[_0x23c1('0x9')](),controller[_0x23c1('0xe')]);router['put'](_0x23c1('0xb'),auth[_0x23c1('0x9')](),controller['update']);router[_0x23c1('0xf')](_0x23c1('0xb'),auth[_0x23c1('0x9')](),controller[_0x23c1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 2272bfb..1a17d27 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 _0x2cca=['STRING','customVariable','BOOLEAN','sequelize','ENUM','string','variable','keyValue','picklist'];(function(_0x20d9f0,_0x453415){var _0x195dda=function(_0x58d8e8){while(--_0x58d8e8){_0x20d9f0['push'](_0x20d9f0['shift']());}};_0x195dda(++_0x453415);}(_0x2cca,0x111));var _0xa2cc=function(_0x2fd86c,_0x5d5a88){_0x2fd86c=_0x2fd86c-0x0;var _0x53db45=_0x2cca[_0x2fd86c];return _0x53db45;};'use strict';var Sequelize=require(_0xa2cc('0x0'));module['exports']={'type':{'type':Sequelize[_0xa2cc('0x1')](_0xa2cc('0x2'),_0xa2cc('0x3'),'customVariable',_0xa2cc('0x4'),_0xa2cc('0x5')),'defaultValue':_0xa2cc('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa2cc('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa2cc('0x3'),_0xa2cc('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa2cc('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa2cc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa2cc('0x6')]}}; \ No newline at end of file +var _0x1582=['string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x4438fd,_0x598f9a){var _0x2044ec=function(_0x1a2bf8){while(--_0x1a2bf8){_0x4438fd['push'](_0x4438fd['shift']());}};_0x2044ec(++_0x598f9a);}(_0x1582,0x117));var _0x2158=function(_0x38b255,_0x3fd343){_0x38b255=_0x38b255-0x0;var _0x26f9bb=_0x1582[_0x38b255];return _0x26f9bb;};'use strict';var Sequelize=require(_0x2158('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x2158('0x1'),_0x2158('0x2'),_0x2158('0x3'),'keyValue',_0x2158('0x4')),'defaultValue':_0x2158('0x1')},'content':{'type':Sequelize[_0x2158('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2158('0x6')]('string','variable',_0x2158('0x3'))},'keyContent':{'type':Sequelize[_0x2158('0x5')]},'idField':{'type':Sequelize[_0x2158('0x5')]},'nameField':{'type':Sequelize[_0x2158('0x5')]},'customField':{'type':Sequelize[_0x2158('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index b9f7026..8e5b1d7 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 _0x0eb2=['moment','bluebird','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','then','error','stack','name','rawAttributes','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','DeskField','include','findAll','rows','catch','show','params','keys','includeAll','find','body','update','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x1aa911,_0xbbc315){var _0x3cca8e=function(_0x192a64){while(--_0x192a64){_0x1aa911['push'](_0x1aa911['shift']());}};_0x3cca8e(++_0xbbc315);}(_0x0eb2,0x11c));var _0x20eb=function(_0x1785a4,_0x3d9cfc){_0x1785a4=_0x1785a4-0x0;var _0x3add73=_0x0eb2[_0x1785a4];return _0x3add73;};'use strict';var emlformat=require(_0x20eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20eb('0x1'));var jsonpatch=require(_0x20eb('0x2'));var rp=require(_0x20eb('0x3'));var moment=require(_0x20eb('0x4'));var BPromise=require(_0x20eb('0x5'));var Mustache=require('mustache');var util=require(_0x20eb('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20eb('0x7'));var fs=require('fs');var fs_extra=require(_0x20eb('0x8'));var _=require(_0x20eb('0x9'));var squel=require('squel');var crypto=require(_0x20eb('0xa'));var jsforce=require(_0x20eb('0xb'));var deskjs=require(_0x20eb('0xc'));var toCsv=require(_0x20eb('0xd'));var querystring=require(_0x20eb('0xe'));var Papa=require(_0x20eb('0xf'));var Redis=require(_0x20eb('0x10'));var authService=require(_0x20eb('0x11'));var qs=require(_0x20eb('0x12'));var as=require(_0x20eb('0x13'));var hardwareService=require(_0x20eb('0x14'));var logger=require(_0x20eb('0x15'))(_0x20eb('0x16'));var utils=require(_0x20eb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x20eb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120651,_0x5371a8){_0x5371a8=_0x5371a8||0xcc;return function(_0x2ffef9){if(_0x2ffef9){return _0x120651[_0x20eb('0x19')](_0x5371a8);}return _0x120651[_0x20eb('0x1a')](_0x5371a8)[_0x20eb('0x1b')]();};}function respondWithResult(_0xfee98d,_0xa548eb){_0xa548eb=_0xa548eb||0xc8;return function(_0x4160b2){if(_0x4160b2){return _0xfee98d[_0x20eb('0x1a')](_0xa548eb)[_0x20eb('0x1c')](_0x4160b2);}};}function respondWithFilteredResult(_0x45473f,_0x155545){return function(_0x11b1cc){if(_0x11b1cc){var _0x150704=typeof _0x155545[_0x20eb('0x1d')]===_0x20eb('0x1e')&&typeof _0x155545['limit']===_0x20eb('0x1e');var _0x579270=_0x11b1cc[_0x20eb('0x1f')];var _0x21765e=_0x150704?0x0:_0x155545[_0x20eb('0x1d')];var _0x3c083a=_0x150704?_0x11b1cc[_0x20eb('0x1f')]:_0x155545[_0x20eb('0x1d')]+_0x155545[_0x20eb('0x20')];var _0x51eb8d;if(_0x3c083a>=_0x579270){_0x3c083a=_0x579270;_0x51eb8d=0xc8;}else{_0x51eb8d=0xce;}_0x45473f[_0x20eb('0x1a')](_0x51eb8d);return _0x45473f[_0x20eb('0x21')]('Content-Range',_0x21765e+'-'+_0x3c083a+'/'+_0x579270)[_0x20eb('0x1c')](_0x11b1cc);}return null;};}function patchUpdates(_0x3eb2be){return function(_0x5d5d8d){try{jsonpatch[_0x20eb('0x22')](_0x5d5d8d,_0x3eb2be,!![]);}catch(_0x1c7853){return BPromise[_0x20eb('0x23')](_0x1c7853);}return _0x5d5d8d['save']();};}function saveUpdates(_0x989b4,_0x258a64){return function(_0x431f82){if(_0x431f82){return _0x431f82['update'](_0x989b4)[_0x20eb('0x24')](function(_0x15bac3){return _0x15bac3;});}return null;};}function removeEntity(_0x22350d,_0x5dc978){return function(_0x2a1b56){if(_0x2a1b56){return _0x2a1b56['destroy']()[_0x20eb('0x24')](function(){_0x22350d[_0x20eb('0x1a')](0xcc)[_0x20eb('0x1b')]();});}};}function handleEntityNotFound(_0x3b88b3,_0x2e88d6){return function(_0x391739){if(!_0x391739){_0x3b88b3[_0x20eb('0x19')](0x194);}return _0x391739;};}function handleError(_0x1adb65,_0x4256ca){_0x4256ca=_0x4256ca||0x1f4;return function(_0x58b8c3){logger[_0x20eb('0x25')](_0x58b8c3[_0x20eb('0x26')]);if(_0x58b8c3[_0x20eb('0x27')]){delete _0x58b8c3['name'];}_0x1adb65['status'](_0x4256ca)['send'](_0x58b8c3);};}exports['index']=function(_0x42455f,_0xd3592a){var _0x53c0f0={},_0x155752={},_0x50b08d={'count':0x0,'rows':[]};var _0x4547d6=_['map'](db['DeskField'][_0x20eb('0x28')],function(_0x3999ec){return{'name':_0x3999ec['fieldName'],'type':_0x3999ec['type'][_0x20eb('0x29')]};});_0x155752[_0x20eb('0x2a')]=_['map'](_0x4547d6,_0x20eb('0x27'));_0x155752[_0x20eb('0x2b')]=_['keys'](_0x42455f[_0x20eb('0x2b')]);_0x155752[_0x20eb('0x2c')]=_['intersection'](_0x155752[_0x20eb('0x2a')],_0x155752['query']);_0x53c0f0[_0x20eb('0x2d')]=_[_0x20eb('0x2e')](_0x155752[_0x20eb('0x2a')],qs['fields'](_0x42455f[_0x20eb('0x2b')][_0x20eb('0x2f')]));_0x53c0f0[_0x20eb('0x2d')]=_0x53c0f0[_0x20eb('0x2d')]['length']?_0x53c0f0[_0x20eb('0x2d')]:_0x155752[_0x20eb('0x2a')];if(!_0x42455f[_0x20eb('0x2b')][_0x20eb('0x30')](_0x20eb('0x31'))){_0x53c0f0[_0x20eb('0x20')]=qs[_0x20eb('0x20')](_0x42455f[_0x20eb('0x2b')][_0x20eb('0x20')]);_0x53c0f0[_0x20eb('0x1d')]=qs[_0x20eb('0x1d')](_0x42455f['query'][_0x20eb('0x1d')]);}_0x53c0f0[_0x20eb('0x32')]=qs[_0x20eb('0x33')](_0x42455f[_0x20eb('0x2b')]['sort']);_0x53c0f0[_0x20eb('0x34')]=qs[_0x20eb('0x2c')](_[_0x20eb('0x35')](_0x42455f['query'],_0x155752[_0x20eb('0x2c')]),_0x4547d6);if(_0x42455f[_0x20eb('0x2b')][_0x20eb('0x36')]){_0x53c0f0[_0x20eb('0x34')]=_[_0x20eb('0x37')](_0x53c0f0[_0x20eb('0x34')],{'$or':_[_0x20eb('0x38')](_0x4547d6,function(_0x44eb8b){if(_0x44eb8b[_0x20eb('0x39')]!==_0x20eb('0x3a')){var _0x588837={};_0x588837[_0x44eb8b[_0x20eb('0x27')]]={'$like':'%'+_0x42455f['query'][_0x20eb('0x36')]+'%'};return _0x588837;}})});}_0x53c0f0=_[_0x20eb('0x37')]({},_0x53c0f0,_0x42455f[_0x20eb('0x3b')]);var _0x341f62={'where':_0x53c0f0[_0x20eb('0x34')]};return db[_0x20eb('0x3c')][_0x20eb('0x1f')](_0x341f62)[_0x20eb('0x24')](function(_0x1dc004){_0x50b08d['count']=_0x1dc004;if(_0x42455f[_0x20eb('0x2b')]['includeAll']){_0x53c0f0[_0x20eb('0x3d')]=[{'all':!![]}];}return db['DeskField'][_0x20eb('0x3e')](_0x53c0f0);})[_0x20eb('0x24')](function(_0x565f6b){_0x50b08d[_0x20eb('0x3f')]=_0x565f6b;return _0x50b08d;})[_0x20eb('0x24')](respondWithFilteredResult(_0xd3592a,_0x53c0f0))[_0x20eb('0x40')](handleError(_0xd3592a,null));};exports[_0x20eb('0x41')]=function(_0x363138,_0xb9b902){var _0x3c9020={'raw':!![],'where':{'id':_0x363138[_0x20eb('0x42')]['id']}},_0x8fb3af={};_0x8fb3af[_0x20eb('0x2a')]=_[_0x20eb('0x43')](db[_0x20eb('0x3c')][_0x20eb('0x28')]);_0x8fb3af[_0x20eb('0x2b')]=_[_0x20eb('0x43')](_0x363138[_0x20eb('0x2b')]);_0x8fb3af[_0x20eb('0x2c')]=_[_0x20eb('0x2e')](_0x8fb3af[_0x20eb('0x2a')],_0x8fb3af['query']);_0x3c9020[_0x20eb('0x2d')]=_[_0x20eb('0x2e')](_0x8fb3af[_0x20eb('0x2a')],qs[_0x20eb('0x2f')](_0x363138[_0x20eb('0x2b')]['fields']));_0x3c9020[_0x20eb('0x2d')]=_0x3c9020[_0x20eb('0x2d')]['length']?_0x3c9020[_0x20eb('0x2d')]:_0x8fb3af['model'];if(_0x363138[_0x20eb('0x2b')][_0x20eb('0x44')]){_0x3c9020[_0x20eb('0x3d')]=[{'all':!![]}];}_0x3c9020=_[_0x20eb('0x37')]({},_0x3c9020,_0x363138['options']);return db[_0x20eb('0x3c')][_0x20eb('0x45')](_0x3c9020)[_0x20eb('0x24')](handleEntityNotFound(_0xb9b902,null))['then'](respondWithResult(_0xb9b902,null))[_0x20eb('0x40')](handleError(_0xb9b902,null));};exports['create']=function(_0x27bd65,_0xeb35d9){return db[_0x20eb('0x3c')]['create'](_0x27bd65[_0x20eb('0x46')],{})[_0x20eb('0x24')](respondWithResult(_0xeb35d9,0xc9))[_0x20eb('0x40')](handleError(_0xeb35d9,null));};exports[_0x20eb('0x47')]=function(_0x4aa040,_0xcd25ff){if(_0x4aa040[_0x20eb('0x46')]['id']){delete _0x4aa040[_0x20eb('0x46')]['id'];}return db[_0x20eb('0x3c')][_0x20eb('0x45')]({'where':{'id':_0x4aa040['params']['id']}})[_0x20eb('0x24')](handleEntityNotFound(_0xcd25ff,null))[_0x20eb('0x24')](saveUpdates(_0x4aa040[_0x20eb('0x46')],null))[_0x20eb('0x24')](respondWithResult(_0xcd25ff,null))[_0x20eb('0x40')](handleError(_0xcd25ff,null));};exports['destroy']=function(_0x1ffce3,_0x3faa09){return db[_0x20eb('0x3c')]['find']({'where':{'id':_0x1ffce3[_0x20eb('0x42')]['id']}})[_0x20eb('0x24')](handleEntityNotFound(_0x3faa09,null))[_0x20eb('0x24')](removeEntity(_0x3faa09,null))[_0x20eb('0x40')](handleError(_0x3faa09,null));}; \ No newline at end of file +var _0x0f9f=['merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick'];(function(_0x79c6de,_0x10de94){var _0x321a56=function(_0x2e313e){while(--_0x2e313e){_0x79c6de['push'](_0x79c6de['shift']());}};_0x321a56(++_0x10de94);}(_0x0f9f,0xae));var _0xf0f9=function(_0x8d68ce,_0x135a7f){_0x8d68ce=_0x8d68ce-0x0;var _0x2e1f64=_0x0f9f[_0x8d68ce];return _0x2e1f64;};'use strict';var emlformat=require(_0xf0f9('0x0'));var rimraf=require(_0xf0f9('0x1'));var zipdir=require(_0xf0f9('0x2'));var jsonpatch=require(_0xf0f9('0x3'));var rp=require(_0xf0f9('0x4'));var moment=require(_0xf0f9('0x5'));var BPromise=require(_0xf0f9('0x6'));var Mustache=require(_0xf0f9('0x7'));var util=require(_0xf0f9('0x8'));var path=require(_0xf0f9('0x9'));var sox=require(_0xf0f9('0xa'));var csv=require('to-csv');var ejs=require(_0xf0f9('0xb'));var fs=require('fs');var fs_extra=require(_0xf0f9('0xc'));var _=require('lodash');var squel=require(_0xf0f9('0xd'));var crypto=require(_0xf0f9('0xe'));var jsforce=require(_0xf0f9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf0f9('0x10'));var querystring=require(_0xf0f9('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0f9('0x12'));var authService=require(_0xf0f9('0x13'));var qs=require(_0xf0f9('0x14'));var as=require(_0xf0f9('0x15'));var hardwareService=require(_0xf0f9('0x16'));var logger=require(_0xf0f9('0x17'))(_0xf0f9('0x18'));var utils=require(_0xf0f9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf0f9('0x1a'));var db=require(_0xf0f9('0x1b'))['db'];function respondWithStatusCode(_0xc23039,_0x458e1c){_0x458e1c=_0x458e1c||0xcc;return function(_0x5b0fa7){if(_0x5b0fa7){return _0xc23039[_0xf0f9('0x1c')](_0x458e1c);}return _0xc23039[_0xf0f9('0x1d')](_0x458e1c)['end']();};}function respondWithResult(_0x334c39,_0x519adf){_0x519adf=_0x519adf||0xc8;return function(_0x538864){if(_0x538864){return _0x334c39[_0xf0f9('0x1d')](_0x519adf)['json'](_0x538864);}};}function respondWithFilteredResult(_0x3e1587,_0x516717){return function(_0x3c23ec){if(_0x3c23ec){var _0x336483=typeof _0x516717[_0xf0f9('0x1e')]===_0xf0f9('0x1f')&&typeof _0x516717[_0xf0f9('0x20')]===_0xf0f9('0x1f');var _0x10dae6=_0x3c23ec['count'];var _0x44d248=_0x336483?0x0:_0x516717[_0xf0f9('0x1e')];var _0x43de16=_0x336483?_0x3c23ec[_0xf0f9('0x21')]:_0x516717[_0xf0f9('0x1e')]+_0x516717[_0xf0f9('0x20')];var _0x1765ad;if(_0x43de16>=_0x10dae6){_0x43de16=_0x10dae6;_0x1765ad=0xc8;}else{_0x1765ad=0xce;}_0x3e1587[_0xf0f9('0x1d')](_0x1765ad);return _0x3e1587['set'](_0xf0f9('0x22'),_0x44d248+'-'+_0x43de16+'/'+_0x10dae6)['json'](_0x3c23ec);}return null;};}function patchUpdates(_0x3664ff){return function(_0x510119){try{jsonpatch[_0xf0f9('0x23')](_0x510119,_0x3664ff,!![]);}catch(_0x1d5965){return BPromise[_0xf0f9('0x24')](_0x1d5965);}return _0x510119[_0xf0f9('0x25')]();};}function saveUpdates(_0xaff53c,_0x1b9740){return function(_0x49bddc){if(_0x49bddc){return _0x49bddc[_0xf0f9('0x26')](_0xaff53c)['then'](function(_0x2cb8f8){return _0x2cb8f8;});}return null;};}function removeEntity(_0x21dd05,_0x55ba89){return function(_0x217a15){if(_0x217a15){return _0x217a15[_0xf0f9('0x27')]()['then'](function(){_0x21dd05[_0xf0f9('0x1d')](0xcc)[_0xf0f9('0x28')]();});}};}function handleEntityNotFound(_0xa0b46e,_0x27defc){return function(_0x3ce34a){if(!_0x3ce34a){_0xa0b46e[_0xf0f9('0x1c')](0x194);}return _0x3ce34a;};}function handleError(_0x4c7c7c,_0x1849f0){_0x1849f0=_0x1849f0||0x1f4;return function(_0x4c31f2){logger[_0xf0f9('0x29')](_0x4c31f2[_0xf0f9('0x2a')]);if(_0x4c31f2[_0xf0f9('0x2b')]){delete _0x4c31f2[_0xf0f9('0x2b')];}_0x4c7c7c['status'](_0x1849f0)[_0xf0f9('0x2c')](_0x4c31f2);};}exports[_0xf0f9('0x2d')]=function(_0x477eb0,_0x5a435d){var _0x3bcd66={},_0x1cafc0={},_0x5957b1={'count':0x0,'rows':[]};var _0xfd5593=_['map'](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')],function(_0x280681){return{'name':_0x280681[_0xf0f9('0x30')],'type':_0x280681[_0xf0f9('0x31')][_0xf0f9('0x32')]};});_0x1cafc0[_0xf0f9('0x33')]=_[_0xf0f9('0x34')](_0xfd5593,_0xf0f9('0x2b'));_0x1cafc0[_0xf0f9('0x35')]=_['keys'](_0x477eb0[_0xf0f9('0x35')]);_0x1cafc0[_0xf0f9('0x36')]=_['intersection'](_0x1cafc0['model'],_0x1cafc0[_0xf0f9('0x35')]);_0x3bcd66[_0xf0f9('0x37')]=_[_0xf0f9('0x38')](_0x1cafc0[_0xf0f9('0x33')],qs[_0xf0f9('0x39')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x39')]));_0x3bcd66['attributes']=_0x3bcd66[_0xf0f9('0x37')]['length']?_0x3bcd66[_0xf0f9('0x37')]:_0x1cafc0[_0xf0f9('0x33')];if(!_0x477eb0[_0xf0f9('0x35')]['hasOwnProperty'](_0xf0f9('0x3a'))){_0x3bcd66['limit']=qs[_0xf0f9('0x20')](_0x477eb0['query']['limit']);_0x3bcd66[_0xf0f9('0x1e')]=qs[_0xf0f9('0x1e')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x1e')]);}_0x3bcd66[_0xf0f9('0x3b')]=qs[_0xf0f9('0x3c')](_0x477eb0['query']['sort']);_0x3bcd66[_0xf0f9('0x3d')]=qs[_0xf0f9('0x36')](_[_0xf0f9('0x3e')](_0x477eb0['query'],_0x1cafc0['filters']),_0xfd5593);if(_0x477eb0[_0xf0f9('0x35')]['filter']){_0x3bcd66[_0xf0f9('0x3d')]=_[_0xf0f9('0x3f')](_0x3bcd66[_0xf0f9('0x3d')],{'$or':_[_0xf0f9('0x34')](_0xfd5593,function(_0x5b19b2){if(_0x5b19b2[_0xf0f9('0x31')]!==_0xf0f9('0x40')){var _0x11ea8f={};_0x11ea8f[_0x5b19b2[_0xf0f9('0x2b')]]={'$like':'%'+_0x477eb0['query']['filter']+'%'};return _0x11ea8f;}})});}_0x3bcd66=_['merge']({},_0x3bcd66,_0x477eb0[_0xf0f9('0x41')]);var _0x458810={'where':_0x3bcd66[_0xf0f9('0x3d')]};return db[_0xf0f9('0x2e')][_0xf0f9('0x21')](_0x458810)[_0xf0f9('0x42')](function(_0xcf598f){_0x5957b1['count']=_0xcf598f;if(_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x43')]){_0x3bcd66[_0xf0f9('0x44')]=[{'all':!![]}];}return db[_0xf0f9('0x2e')][_0xf0f9('0x45')](_0x3bcd66);})[_0xf0f9('0x42')](function(_0x4eb772){_0x5957b1[_0xf0f9('0x46')]=_0x4eb772;return _0x5957b1;})['then'](respondWithFilteredResult(_0x5a435d,_0x3bcd66))[_0xf0f9('0x47')](handleError(_0x5a435d,null));};exports[_0xf0f9('0x48')]=function(_0x290849,_0x181ed0){var _0x294e57={'raw':!![],'where':{'id':_0x290849[_0xf0f9('0x49')]['id']}},_0x574364={};_0x574364['model']=_[_0xf0f9('0x4a')](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')]);_0x574364[_0xf0f9('0x35')]=_[_0xf0f9('0x4a')](_0x290849[_0xf0f9('0x35')]);_0x574364['filters']=_[_0xf0f9('0x38')](_0x574364[_0xf0f9('0x33')],_0x574364[_0xf0f9('0x35')]);_0x294e57['attributes']=_[_0xf0f9('0x38')](_0x574364['model'],qs[_0xf0f9('0x39')](_0x290849['query']['fields']));_0x294e57['attributes']=_0x294e57['attributes'][_0xf0f9('0x4b')]?_0x294e57['attributes']:_0x574364[_0xf0f9('0x33')];if(_0x290849[_0xf0f9('0x35')]['includeAll']){_0x294e57[_0xf0f9('0x44')]=[{'all':!![]}];}_0x294e57=_[_0xf0f9('0x3f')]({},_0x294e57,_0x290849[_0xf0f9('0x41')]);return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')](_0x294e57)['then'](handleEntityNotFound(_0x181ed0,null))[_0xf0f9('0x42')](respondWithResult(_0x181ed0,null))[_0xf0f9('0x47')](handleError(_0x181ed0,null));};exports[_0xf0f9('0x4d')]=function(_0x3512d5,_0x5601ca){return db[_0xf0f9('0x2e')][_0xf0f9('0x4d')](_0x3512d5[_0xf0f9('0x4e')],{})[_0xf0f9('0x42')](respondWithResult(_0x5601ca,0xc9))[_0xf0f9('0x47')](handleError(_0x5601ca,null));};exports[_0xf0f9('0x26')]=function(_0x3dd389,_0x299cec){if(_0x3dd389[_0xf0f9('0x4e')]['id']){delete _0x3dd389[_0xf0f9('0x4e')]['id'];}return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0x3dd389['params']['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x299cec,null))[_0xf0f9('0x42')](saveUpdates(_0x3dd389[_0xf0f9('0x4e')],null))['then'](respondWithResult(_0x299cec,null))[_0xf0f9('0x47')](handleError(_0x299cec,null));};exports[_0xf0f9('0x27')]=function(_0xa003e7,_0x1fe3b7){return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0xa003e7[_0xf0f9('0x49')]['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x1fe3b7,null))['then'](removeEntity(_0x1fe3b7,null))[_0xf0f9('0x47')](handleError(_0x1fe3b7,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 41298f5..280f002 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 _0x8232=['../../config/environment','exports','DeskField','desk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x17bfa4,_0x3eb5f7){var _0x3d9ca8=function(_0x235cd4){while(--_0x235cd4){_0x17bfa4['push'](_0x17bfa4['shift']());}};_0x3d9ca8(++_0x3eb5f7);}(_0x8232,0x1e2));var _0x2823=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x8232[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x2823('0x0'));var util=require(_0x2823('0x1'));var logger=require('../../config/logger')(_0x2823('0x2'));var moment=require(_0x2823('0x3'));var BPromise=require(_0x2823('0x4'));var rp=require(_0x2823('0x5'));var fs=require('fs');var path=require(_0x2823('0x6'));var rimraf=require(_0x2823('0x7'));var config=require(_0x2823('0x8'));var attributes=require('./intDeskField.attributes');module[_0x2823('0x9')]=function(_0x3249b6,_0x3862bf){return _0x3249b6['define'](_0x2823('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x2823('0xb'),'fields':[_0x2823('0xc'),_0x2823('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1816=['request-promise','path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index','util','api','moment','bluebird'];(function(_0x794014,_0x54d763){var _0x443048=function(_0x4e3a35){while(--_0x4e3a35){_0x794014['push'](_0x794014['shift']());}};_0x443048(++_0x54d763);}(_0x1816,0x1ea));var _0x6181=function(_0x1eafa9,_0x5791b6){_0x1eafa9=_0x1eafa9-0x0;var _0x7bb048=_0x1816[_0x1eafa9];return _0x7bb048;};'use strict';var _=require('lodash');var util=require(_0x6181('0x0'));var logger=require('../../config/logger')(_0x6181('0x1'));var moment=require(_0x6181('0x2'));var BPromise=require(_0x6181('0x3'));var rp=require(_0x6181('0x4'));var fs=require('fs');var path=require(_0x6181('0x5'));var rimraf=require(_0x6181('0x6'));var config=require(_0x6181('0x7'));var attributes=require('./intDeskField.attributes');module[_0x6181('0x8')]=function(_0x515968,_0x2be0e7){return _0x515968[_0x6181('0x9')](_0x6181('0xa'),attributes,{'tableName':_0x6181('0xb'),'paranoid':![],'indexes':[{'name':_0x6181('0xc'),'fields':['idField','FieldId'],'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 320e659..928a88e 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 _0x38db=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4dd20e,_0x2e9b53){var _0x1a9dcb=function(_0xca6322){while(--_0xca6322){_0x4dd20e['push'](_0x4dd20e['shift']());}};_0x1a9dcb(++_0x2e9b53);}(_0x38db,0xcd));var _0xb38d=function(_0x18093b,_0x11994f){_0x18093b=_0x18093b-0x0;var _0x488e03=_0x38db[_0x18093b];return _0x488e03;};'use strict';var _=require(_0xb38d('0x0'));var util=require(_0xb38d('0x1'));var moment=require(_0xb38d('0x2'));var BPromise=require(_0xb38d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb38d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb38d('0x5'))(_0xb38d('0x6'));var config=require(_0xb38d('0x7'));var jayson=require(_0xb38d('0x8'));var client=jayson[_0xb38d('0x9')][_0xb38d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cb1aa,_0x268bd9,_0x58a6a5){return new BPromise(function(_0xd9036a,_0x44ab64){return client['request'](_0x2cb1aa,_0x58a6a5)[_0xb38d('0xb')](function(_0x1bd7ad){logger[_0xb38d('0xc')](_0xb38d('0xd'),_0x268bd9,_0xb38d('0xe'));logger[_0xb38d('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x268bd9,'request\x20sent',JSON[_0xb38d('0x10')](_0x1bd7ad));if(_0x1bd7ad[_0xb38d('0x11')]){if(_0x1bd7ad[_0xb38d('0x11')][_0xb38d('0x12')]===0x1f4){logger[_0xb38d('0x11')](_0xb38d('0xd'),_0x268bd9,_0x1bd7ad['error']['message']);return _0x44ab64(_0x1bd7ad[_0xb38d('0x11')][_0xb38d('0x13')]);}logger[_0xb38d('0x11')]('DeskField,\x20%s,\x20%s',_0x268bd9,_0x1bd7ad[_0xb38d('0x11')][_0xb38d('0x13')]);return _0xd9036a(_0x1bd7ad['error']['message']);}else{logger['info'](_0xb38d('0xd'),_0x268bd9,_0xb38d('0xe'));_0xd9036a(_0x1bd7ad['result'][_0xb38d('0x13')]);}})[_0xb38d('0x14')](function(_0x48440e){logger['error'](_0xb38d('0xd'),_0x268bd9,_0x48440e);_0x44ab64(_0x48440e);});});} \ No newline at end of file +var _0x1648=['message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s'];(function(_0x3a4cba,_0x369ccc){var _0x54ec19=function(_0x401eaf){while(--_0x401eaf){_0x3a4cba['push'](_0x3a4cba['shift']());}};_0x54ec19(++_0x369ccc);}(_0x1648,0x114));var _0x8164=function(_0x4a118b,_0x4ec38c){_0x4a118b=_0x4a118b-0x0;var _0x27c88e=_0x1648[_0x4a118b];return _0x27c88e;};'use strict';var _=require('lodash');var util=require(_0x8164('0x0'));var moment=require(_0x8164('0x1'));var BPromise=require(_0x8164('0x2'));var rs=require(_0x8164('0x3'));var fs=require('fs');var Redis=require(_0x8164('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8164('0x5'));var logger=require('../../config/logger')(_0x8164('0x6'));var config=require(_0x8164('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8164('0x8')][_0x8164('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x257092,_0x45b4b1,_0x56dec5){return new BPromise(function(_0x1460c2,_0x217338){return client[_0x8164('0xa')](_0x257092,_0x56dec5)['then'](function(_0x1177da){logger['info']('DeskField,\x20%s,\x20%s',_0x45b4b1,_0x8164('0xb'));logger[_0x8164('0xc')](_0x8164('0xd'),_0x45b4b1,_0x8164('0xb'),JSON[_0x8164('0xe')](_0x1177da));if(_0x1177da['error']){if(_0x1177da[_0x8164('0xf')][_0x8164('0x10')]===0x1f4){logger['error'](_0x8164('0x11'),_0x45b4b1,_0x1177da[_0x8164('0xf')][_0x8164('0x12')]);return _0x217338(_0x1177da[_0x8164('0xf')][_0x8164('0x12')]);}logger[_0x8164('0xf')](_0x8164('0x11'),_0x45b4b1,_0x1177da[_0x8164('0xf')][_0x8164('0x12')]);return _0x1460c2(_0x1177da[_0x8164('0xf')][_0x8164('0x12')]);}else{logger[_0x8164('0x13')](_0x8164('0x11'),_0x45b4b1,_0x8164('0xb'));_0x1460c2(_0x1177da['result'][_0x8164('0x12')]);}})[_0x8164('0x14')](function(_0x43c869){logger[_0x8164('0xf')](_0x8164('0x11'),_0x45b4b1,_0x43c869);_0x217338(_0x43c869);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index d029ba6..53a61b8 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 _0x13cc=['../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2dfe59,_0x31aaa5){var _0x4a8b84=function(_0x295bfb){while(--_0x295bfb){_0x2dfe59['push'](_0x2dfe59['shift']());}};_0x4a8b84(++_0x31aaa5);}(_0x13cc,0x1dd));var _0xc13c=function(_0x54c80e,_0x3edf39){_0x54c80e=_0x54c80e-0x0;var _0x25111a=_0x13cc[_0x54c80e];return _0x25111a;};'use strict';var multer=require(_0xc13c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc13c('0x1'));var express=require(_0xc13c('0x2'));var router=express[_0xc13c('0x3')]();var fs_extra=require(_0xc13c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc13c('0x5'));var config=require(_0xc13c('0x6'));var controller=require(_0xc13c('0x7'));router[_0xc13c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc13c('0x8')](_0xc13c('0x9'),auth['isAuthenticated'](),controller[_0xc13c('0xa')]);router[_0xc13c('0x8')](_0xc13c('0xb'),auth[_0xc13c('0xc')](),controller['getConfigurations']);router['get'](_0xc13c('0xd'),auth[_0xc13c('0xc')](),controller[_0xc13c('0xe')]);router[_0xc13c('0xf')]('/',auth[_0xc13c('0xc')](),controller[_0xc13c('0x10')]);router[_0xc13c('0xf')](_0xc13c('0xb'),auth[_0xc13c('0xc')](),controller[_0xc13c('0x11')]);router[_0xc13c('0x12')]('/:id',auth[_0xc13c('0xc')](),controller[_0xc13c('0x13')]);router['delete'](_0xc13c('0x9'),auth[_0xc13c('0xc')](),controller['destroy']);module[_0xc13c('0x14')]=router; \ No newline at end of file +var _0x32a3=['index','/:id','isAuthenticated','/:id/fields','create','post','/:id/configurations','addConfiguration','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get'];(function(_0x3da728,_0x3e9f29){var _0xa531a9=function(_0x15a32e){while(--_0x15a32e){_0x3da728['push'](_0x3da728['shift']());}};_0xa531a9(++_0x3e9f29);}(_0x32a3,0xe7));var _0x332a=function(_0x4fd87c,_0x13b74c){_0x4fd87c=_0x4fd87c-0x0;var _0x1510bb=_0x32a3[_0x4fd87c];return _0x1510bb;};'use strict';var multer=require(_0x332a('0x0'));var util=require('util');var path=require(_0x332a('0x1'));var timeout=require(_0x332a('0x2'));var express=require(_0x332a('0x3'));var router=express[_0x332a('0x4')]();var fs_extra=require(_0x332a('0x5'));var auth=require(_0x332a('0x6'));var interaction=require(_0x332a('0x7'));var config=require(_0x332a('0x8'));var controller=require(_0x332a('0x9'));router[_0x332a('0xa')]('/',auth['isAuthenticated'](),controller[_0x332a('0xb')]);router[_0x332a('0xa')](_0x332a('0xc'),auth[_0x332a('0xd')](),controller['show']);router[_0x332a('0xa')]('/:id/configurations',auth[_0x332a('0xd')](),controller['getConfigurations']);router[_0x332a('0xa')](_0x332a('0xe'),auth[_0x332a('0xd')](),controller['getFields']);router['post']('/',auth[_0x332a('0xd')](),controller[_0x332a('0xf')]);router[_0x332a('0x10')](_0x332a('0x11'),auth[_0x332a('0xd')](),controller[_0x332a('0x12')]);router['put']('/:id',auth[_0x332a('0xd')](),controller[_0x332a('0x13')]);router[_0x332a('0x14')](_0x332a('0xc'),auth[_0x332a('0xd')](),controller['destroy']);module[_0x332a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 7a74fbd..3298f02 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 _0xcddb=['exports','STRING','sequelize'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x5812e9,_0x3346e2){_0x5812e9=_0x5812e9-0x0;var _0x5eda23=_0xcddb[_0x5812e9];return _0x5eda23;};'use strict';var Sequelize=require(_0xbcdd('0x0'));module[_0xbcdd('0x1')]={'name':{'type':Sequelize[_0xbcdd('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbcdd('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbcdd('0x2')]},'clientSecret':{'type':Sequelize[_0xbcdd('0x2')]},'serverUrl':{'type':Sequelize[_0xbcdd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbcdd('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x254a=['sequelize','exports','STRING','BOOLEAN'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x254a,0x138));var _0xa254=function(_0x2d6d0f,_0x3cf2a5){_0x2d6d0f=_0x2d6d0f-0x0;var _0xd2bee6=_0x254a[_0x2d6d0f];return _0xd2bee6;};'use strict';var Sequelize=require(_0xa254('0x0'));module[_0xa254('0x1')]={'name':{'type':Sequelize[_0xa254('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa254('0x2')]},'remoteUri':{'type':Sequelize[_0xa254('0x2')]},'tenantId':{'type':Sequelize[_0xa254('0x2')]},'clientId':{'type':Sequelize[_0xa254('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa254('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xa254('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index cc1271a..be5a7bc 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 _0xfaca=['createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','access_token','data5','https://login.microsoftonline.com/','tenantId','/oauth2/token','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','DisplayName','TrueOption','UserLocalizedLabel','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','undefined','limit','offset','status','set','update','then','destroy','end','error','stack','name','send','map','key','model','keys','query','filters','attributes','intersection','fields','order','sort','where','pick','filter','VIRTUAL','merge','options','Dynamics365Account','count','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','findOne','params','Dynamics365Configuration','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','Dynamics365Field','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','title','description','customerid','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname'];(function(_0x10d5e7,_0x4f884d){var _0x3efcb8=function(_0x46fbed){while(--_0x46fbed){_0x10d5e7['push'](_0x10d5e7['shift']());}};_0x3efcb8(++_0x4f884d);}(_0xfaca,0x114));var _0xafac=function(_0x3abd49,_0x5ec0ec){_0x3abd49=_0x3abd49-0x0;var _0x5f5677=_0xfaca[_0x3abd49];return _0x5f5677;};'use strict';var rp=require(_0xafac('0x0'));var util=require(_0xafac('0x1'));var _=require('lodash');var qs=require(_0xafac('0x2'));var logger=require(_0xafac('0x3'))(_0xafac('0x4'));var db=require(_0xafac('0x5'))['db'];var integrations=require(_0xafac('0x6'));function respondWithResult(_0x451832,_0x2f086c){_0x2f086c=_0x2f086c||0xc8;return function(_0x48db6c){if(_0x48db6c){return _0x451832['status'](_0x2f086c)[_0xafac('0x7')](_0x48db6c);}};}function respondWithFilteredResult(_0x656585,_0x5cd055){return function(_0x10da52){if(_0x10da52){var _0x1f48ae=typeof _0x5cd055['offset']===_0xafac('0x8')&&typeof _0x5cd055[_0xafac('0x9')]===_0xafac('0x8');var _0x2df8fb=_0x10da52['count'];var _0x2c11ae=_0x1f48ae?0x0:_0x5cd055[_0xafac('0xa')];var _0x5773e2=_0x1f48ae?_0x10da52['count']:_0x5cd055[_0xafac('0xa')]+_0x5cd055[_0xafac('0x9')];var _0x11a9b3;if(_0x5773e2>=_0x2df8fb){_0x5773e2=_0x2df8fb;_0x11a9b3=0xc8;}else{_0x11a9b3=0xce;}_0x656585[_0xafac('0xb')](_0x11a9b3);return _0x656585[_0xafac('0xc')]('Content-Range',_0x2c11ae+'-'+_0x5773e2+'/'+_0x2df8fb)['json'](_0x10da52);}return null;};}function saveUpdates(_0x5c3890){return function(_0x40171a){if(_0x40171a){return _0x40171a[_0xafac('0xd')](_0x5c3890)[_0xafac('0xe')](function(_0x13ee2b){return _0x13ee2b;});}return null;};}function removeEntity(_0x35de10){return function(_0x6b3711){if(_0x6b3711){return _0x6b3711[_0xafac('0xf')]()[_0xafac('0xe')](function(){_0x35de10[_0xafac('0xb')](0xcc)[_0xafac('0x10')]();});}};}function handleEntityNotFound(_0x1ef516){return function(_0x3ebb3e){if(!_0x3ebb3e){_0x1ef516['sendStatus'](0x194);}return _0x3ebb3e;};}function handleError(_0x153cb0,_0x41ccd6){_0x41ccd6=_0x41ccd6||0x1f4;return function(_0x33a48d){logger[_0xafac('0x11')](_0x33a48d[_0xafac('0x12')]);if(_0x33a48d[_0xafac('0x13')]){delete _0x33a48d['name'];}_0x153cb0[_0xafac('0xb')](_0x41ccd6)[_0xafac('0x14')](_0x33a48d);};}exports['index']=function(_0x1ccf80,_0x2d31ff){var _0x2ae3e={},_0x3b2788={},_0x4d4eff={'count':0x0,'rows':[]};var _0x26b1f7=_[_0xafac('0x15')](db['Dynamics365Account']['rawAttributes'],function(_0x14fb05){return{'name':_0x14fb05['fieldName'],'type':_0x14fb05['type'][_0xafac('0x16')]};});_0x3b2788[_0xafac('0x17')]=_[_0xafac('0x15')](_0x26b1f7,'name');_0x3b2788['query']=_[_0xafac('0x18')](_0x1ccf80[_0xafac('0x19')]);_0x3b2788[_0xafac('0x1a')]=_['intersection'](_0x3b2788[_0xafac('0x17')],_0x3b2788[_0xafac('0x19')]);_0x2ae3e[_0xafac('0x1b')]=_[_0xafac('0x1c')](_0x3b2788['model'],qs[_0xafac('0x1d')](_0x1ccf80[_0xafac('0x19')][_0xafac('0x1d')]));_0x2ae3e[_0xafac('0x1b')]=_0x2ae3e['attributes']['length']?_0x2ae3e[_0xafac('0x1b')]:_0x3b2788['model'];if(!_0x1ccf80[_0xafac('0x19')]['hasOwnProperty']('nolimit')){_0x2ae3e['limit']=qs[_0xafac('0x9')](_0x1ccf80['query']['limit']);_0x2ae3e[_0xafac('0xa')]=qs[_0xafac('0xa')](_0x1ccf80[_0xafac('0x19')][_0xafac('0xa')]);}_0x2ae3e[_0xafac('0x1e')]=qs[_0xafac('0x1f')](_0x1ccf80[_0xafac('0x19')][_0xafac('0x1f')]);_0x2ae3e[_0xafac('0x20')]=qs[_0xafac('0x1a')](_[_0xafac('0x21')](_0x1ccf80[_0xafac('0x19')],_0x3b2788['filters']),_0x26b1f7);if(_0x1ccf80[_0xafac('0x19')][_0xafac('0x22')]){_0x2ae3e[_0xafac('0x20')]=_['merge'](_0x2ae3e['where'],{'$or':_[_0xafac('0x15')](_0x26b1f7,function(_0x54da9f){if(_0x54da9f['type']!==_0xafac('0x23')){var _0x3b3b60={};_0x3b3b60[_0x54da9f['name']]={'$like':'%'+_0x1ccf80['query'][_0xafac('0x22')]+'%'};return _0x3b3b60;}})});}_0x2ae3e=_[_0xafac('0x24')]({},_0x2ae3e,_0x1ccf80[_0xafac('0x25')]);var _0x578474={'where':_0x2ae3e[_0xafac('0x20')]};return db[_0xafac('0x26')][_0xafac('0x27')](_0x578474)[_0xafac('0xe')](function(_0x5f38d6){_0x4d4eff['count']=_0x5f38d6;if(_0x1ccf80[_0xafac('0x19')][_0xafac('0x28')]){_0x2ae3e[_0xafac('0x29')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xafac('0x2a')](_0x2ae3e);})[_0xafac('0xe')](function(_0x3eb52e){_0x4d4eff[_0xafac('0x2b')]=_0x3eb52e;return _0x4d4eff;})[_0xafac('0xe')](respondWithFilteredResult(_0x2d31ff,_0x2ae3e))[_0xafac('0x2c')](handleError(_0x2d31ff,null));};exports['show']=function(_0x40a7f8,_0x3a5203){var _0x21d5f1={'raw':![],'where':{'id':_0x40a7f8['params']['id']}},_0xe2b7ee={};_0xe2b7ee[_0xafac('0x17')]=_[_0xafac('0x18')](db['Dynamics365Account'][_0xafac('0x2d')]);_0xe2b7ee[_0xafac('0x19')]=_[_0xafac('0x18')](_0x40a7f8[_0xafac('0x19')]);_0xe2b7ee[_0xafac('0x1a')]=_[_0xafac('0x1c')](_0xe2b7ee[_0xafac('0x17')],_0xe2b7ee[_0xafac('0x19')]);_0x21d5f1[_0xafac('0x1b')]=_[_0xafac('0x1c')](_0xe2b7ee[_0xafac('0x17')],qs[_0xafac('0x1d')](_0x40a7f8[_0xafac('0x19')][_0xafac('0x1d')]));_0x21d5f1[_0xafac('0x1b')]=_0x21d5f1[_0xafac('0x1b')][_0xafac('0x2e')]?_0x21d5f1[_0xafac('0x1b')]:_0xe2b7ee[_0xafac('0x17')];if(_0x40a7f8['query'][_0xafac('0x28')]){_0x21d5f1[_0xafac('0x29')]=[{'all':!![]}];}_0x21d5f1=_['merge']({},_0x21d5f1,_0x40a7f8[_0xafac('0x25')]);return db[_0xafac('0x26')][_0xafac('0x2f')](_0x21d5f1)[_0xafac('0xe')](handleEntityNotFound(_0x3a5203,null))[_0xafac('0xe')](respondWithResult(_0x3a5203,null))[_0xafac('0x2c')](handleError(_0x3a5203,null));};exports['create']=function(_0xacf81c,_0x456630){return db[_0xafac('0x26')][_0xafac('0x30')](_0xacf81c[_0xafac('0x31')],{})[_0xafac('0xe')](respondWithResult(_0x456630,0xc9))[_0xafac('0x2c')](handleError(_0x456630,null));};exports['update']=function(_0x46f295,_0x49e934){if(_0x46f295[_0xafac('0x31')]['id']){delete _0x46f295['body']['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x46f295['params']['id']}})['then'](handleEntityNotFound(_0x49e934,null))[_0xafac('0xe')](saveUpdates(_0x46f295[_0xafac('0x31')],null))['then'](respondWithResult(_0x49e934,null))[_0xafac('0x2c')](handleError(_0x49e934,null));};exports[_0xafac('0xf')]=function(_0x1e6503,_0x51c70c){return db[_0xafac('0x26')][_0xafac('0x2f')]({'where':{'id':_0x1e6503['params']['id']}})[_0xafac('0xe')](handleEntityNotFound(_0x51c70c,null))[_0xafac('0xe')](removeEntity(_0x51c70c,null))[_0xafac('0x2c')](handleError(_0x51c70c,null));};exports['getConfigurations']=function(_0x62372d,_0x2b9cd2){var _0x84874b={};var _0x3d9f6e={};var _0x5e50fe;var _0x16e3cb;return db[_0xafac('0x26')][_0xafac('0x32')]({'where':{'id':_0x62372d[_0xafac('0x33')]['id']}})[_0xafac('0xe')](handleEntityNotFound(_0x2b9cd2,null))[_0xafac('0xe')](function(_0x3f27de){if(_0x3f27de){_0x5e50fe=_0x3f27de;_0x3d9f6e[_0xafac('0x17')]=_[_0xafac('0x18')](db[_0xafac('0x34')][_0xafac('0x2d')]);_0x3d9f6e['query']=_[_0xafac('0x18')](_0x62372d[_0xafac('0x19')]);_0x3d9f6e[_0xafac('0x1a')]=_['intersection'](_0x3d9f6e[_0xafac('0x17')],_0x3d9f6e[_0xafac('0x19')]);_0x84874b[_0xafac('0x1b')]=_['intersection'](_0x3d9f6e['model'],qs[_0xafac('0x1d')](_0x62372d['query'][_0xafac('0x1d')]));_0x84874b[_0xafac('0x1b')]=_0x84874b[_0xafac('0x1b')][_0xafac('0x2e')]?_0x84874b[_0xafac('0x1b')]:_0x3d9f6e['model'];_0x84874b[_0xafac('0x1e')]=qs['sort'](_0x62372d[_0xafac('0x19')][_0xafac('0x1f')]);_0x84874b[_0xafac('0x20')]=qs[_0xafac('0x1a')](_['pick'](_0x62372d[_0xafac('0x19')],_0x3d9f6e[_0xafac('0x1a')]));if(_0x62372d[_0xafac('0x19')][_0xafac('0x22')]){_0x84874b[_0xafac('0x20')]=_['merge'](_0x84874b['where'],{'$or':_['map'](_0x84874b['attributes'],function(_0x380546){var _0x31c1c7={};_0x31c1c7[_0x380546]={'$like':'%'+_0x62372d[_0xafac('0x19')][_0xafac('0x22')]+'%'};return _0x31c1c7;})});}_0x84874b=_[_0xafac('0x24')]({},_0x84874b,_0x62372d[_0xafac('0x25')]);return _0x5e50fe[_0xafac('0x35')](_0x84874b);}})[_0xafac('0xe')](function(_0x23f6d1){if(_0x23f6d1){_0x16e3cb=_0x23f6d1[_0xafac('0x2e')];if(!_0x62372d[_0xafac('0x19')]['hasOwnProperty'](_0xafac('0x36'))){_0x84874b[_0xafac('0x9')]=qs[_0xafac('0x9')](_0x62372d[_0xafac('0x19')][_0xafac('0x9')]);_0x84874b[_0xafac('0xa')]=qs['offset'](_0x62372d[_0xafac('0x19')][_0xafac('0xa')]);}return _0x5e50fe['getConfigurations'](_0x84874b);}})[_0xafac('0xe')](function(_0x14f676){if(_0x14f676){return _0x14f676?{'count':_0x16e3cb,'rows':_0x14f676}:null;}})[_0xafac('0xe')](respondWithResult(_0x2b9cd2,null))[_0xafac('0x2c')](handleError(_0x2b9cd2,null));};exports[_0xafac('0x37')]=function(_0x541f28,_0x9fc6a1){if(_0x541f28[_0xafac('0x31')]['id']){delete _0x541f28[_0xafac('0x31')]['id'];}return db[_0xafac('0x26')][_0xafac('0x32')]({'where':{'id':_0x541f28[_0xafac('0x33')]['id']}})[_0xafac('0xe')](handleEntityNotFound(_0x9fc6a1,null))[_0xafac('0xe')](function(_0x56c222){if(_0x56c222){_0x541f28[_0xafac('0x31')]['AccountId']=_0x56c222['id'];_0x541f28[_0xafac('0x31')][_0xafac('0x38')]=integrations[_0xafac('0x39')](_0x541f28[_0xafac('0x31')]['channel'],_0x541f28[_0xafac('0x31')][_0xafac('0x3a')]);_0x541f28[_0xafac('0x31')][_0xafac('0x3b')]=integrations[_0xafac('0x3c')](_0x541f28['body'][_0xafac('0x3d')],_0x541f28['body']['type']);return db[_0xafac('0x34')]['create'](_0x541f28[_0xafac('0x31')],{'include':[{'model':db['Dynamics365Field'],'as':_0xafac('0x38')},{'model':db[_0xafac('0x3e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x9fc6a1,null))['catch'](handleError(_0x9fc6a1,null));};function sanitizeRemoteUri(_0x4a3be2){var _0x1e7dc6=_0x4a3be2['slice'](-0x1);if(_0x1e7dc6==='/')return _0x4a3be2['substring'](0x0,_0x4a3be2[_0xafac('0x3f')](_0x1e7dc6));return _0x4a3be2;}function getWebApiUrl(_0x17ac7b){return util[_0xafac('0x40')](_0xafac('0x41'),_0x17ac7b);}exports['getFields']=function(_0x16ee96,_0x941dc9){var _0x49f00c=_0x16ee96[_0xafac('0x19')][_0xafac('0x42')];var _0x357a92=_0x49f00c===_0xafac('0x43')?_0xafac('0x44'):'PhoneCall';var _0x4036e5='';var _0x46763b='';var _0x5793b2='';var _0x175f31='';var _0xc9a8fc='';var _0x2414ec='';var _0x3af0d3='';var _0x54f704='';var _0x3be1fd=[_0xafac('0x45'),_0xafac('0x46'),_0xafac('0x47'),'ownerid',_0xafac('0x48'),'subject','phonenumber',_0xafac('0x49'),_0xafac('0x4a'),_0xafac('0x4b')];var _0x897f1d=[_0xafac('0x4c'),_0xafac('0x4d'),_0xafac('0x4e'),_0xafac('0x4f'),_0xafac('0x50'),_0xafac('0x51'),_0xafac('0x52'),'contractidname',_0xafac('0x53'),_0xafac('0x54'),_0xafac('0x55'),_0xafac('0x56'),_0xafac('0x57'),_0xafac('0x58'),_0xafac('0x59'),_0xafac('0x5a'),'customeridtype',_0xafac('0x5b'),'emailaddress','entitlementidname',_0xafac('0x5c'),_0xafac('0x5d'),'escalatedon',_0xafac('0x5e'),_0xafac('0x5f'),_0xafac('0x60'),'importsequencenumber',_0xafac('0x61'),'kbarticleidname',_0xafac('0x62'),_0xafac('0x63'),_0xafac('0x64'),'modifiedbyexternalpartyyominame','modifiedbyname',_0xafac('0x65'),_0xafac('0x66'),_0xafac('0x67'),_0xafac('0x68'),'msdyn_incidenttypename',_0xafac('0x69'),'numberofchildincidents','onholdtime',_0xafac('0x6a'),_0xafac('0x6b'),_0xafac('0x6c'),'owneridyominame',_0xafac('0x6d'),_0xafac('0x6e'),_0xafac('0x6f'),'prioritycodename',_0xafac('0x70'),_0xafac('0x71'),_0xafac('0x72'),_0xafac('0x73'),_0xafac('0x74'),_0xafac('0x75'),_0xafac('0x76'),'sentimentvalue','slainvokedidname',_0xafac('0x77'),_0xafac('0x78'),_0xafac('0x79'),_0xafac('0x7a'),_0xafac('0x7b'),_0xafac('0x7c'),_0xafac('0x7d'),_0xafac('0x7e'),'traversedpath',_0xafac('0x7f'),'versionnumber'];var _0x532010=_0x3be1fd[_0xafac('0x80')](_0x897f1d);return db[_0xafac('0x26')][_0xafac('0x32')]({'where':{'id':_0x16ee96[_0xafac('0x33')]['id']},'attributes':['id',_0xafac('0x81'),_0xafac('0x82'),_0xafac('0x83'),'tenantId',_0xafac('0x84'),_0xafac('0x85'),_0xafac('0x86')],'include':[{'model':db[_0xafac('0x87')],'as':_0xafac('0x87'),'attributes':['id','data5','data7']}]})[_0xafac('0xe')](handleEntityNotFound(_0x941dc9,null))[_0xafac('0xe')](function(_0x1f1ae6){if(_0x1f1ae6){if(_0x1f1ae6[_0xafac('0x86')]){_0x1f1ae6[_0xafac('0x88')]=_0x1f1ae6[_0xafac('0x87')][_0xafac('0x89')];_0x54f704=sanitizeRemoteUri(_0x1f1ae6[_0xafac('0x87')]['data7']);_0x3af0d3=getWebApiUrl(_0x54f704);return _0x1f1ae6;}_0x54f704=sanitizeRemoteUri(_0x1f1ae6[_0xafac('0x83')]);_0x3af0d3=getWebApiUrl(_0x54f704);var _0x15a7d7={'method':'POST','uri':_0xafac('0x8a')+_0x1f1ae6[_0xafac('0x8b')]+_0xafac('0x8c'),'form':{'client_id':_0x1f1ae6[_0xafac('0x84')],'resource':_0x54f704,'username':_0x1f1ae6[_0xafac('0x81')],'password':_0x1f1ae6[_0xafac('0x82')],'grant_type':_0xafac('0x82'),'client_secret':_0x1f1ae6[_0xafac('0x85')]},'json':!![]};return rp(_0x15a7d7);}})[_0xafac('0xe')](function(_0x7dfdd4){_0x2414ec=_0x7dfdd4[_0xafac('0x88')];var _0x2fea59={'method':'GET','uri':encodeURI(_0x3af0d3+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x357a92+'\x27'),'headers':{'Authorization':_0xafac('0x8d')+_0x2414ec,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2fea59);})['then'](function(_0x9a6619){var _0x54e8e2=_0x9a6619[_0xafac('0x8e')][0x0];var _0x213fd5=_0x54e8e2[_0xafac('0x8f')];var _0x24b638={'method':_0xafac('0x90'),'uri':_0x3af0d3+_0xafac('0x91')+_0x213fd5+_0xafac('0x92'),'headers':{'Authorization':_0xafac('0x8d')+_0x2414ec,'If-None-Match':null,'OData-Version':_0xafac('0x93')},'json':!![]};return rp(_0x24b638);})['then'](function(_0x289f42){_0x4036e5=_0x289f42;_0x46763b=_0x4036e5[_0xafac('0x94')];_0x46763b=_['remove'](_0x46763b,function(_0x4ffd41){return!_0x532010[_0xafac('0x95')](_0x4ffd41[_0xafac('0x96')]);});var _0x596750=[];var _0x564328=[];_0x46763b[_0xafac('0x97')](function(_0x13178e){if(_0x13178e[_0xafac('0x98')]){var _0x306beb=_0x13178e[_0xafac('0x98')][_0xafac('0x99')](_0x13178e[_0xafac('0x98')][_0xafac('0x3f')]('.')+0x1);if(_0x306beb===_0xafac('0x9a')){_0x596750[_0xafac('0x9b')](getSelectList(_0x3af0d3,_0x49f00c,_0x564328,_0x4036e5[_0xafac('0x8f')],_0x13178e['MetadataId'],_0x2414ec));}}});return Promise['all'](_0x596750);})['then'](function(_0xfb9efd){_0x5793b2=_0xfb9efd[0x0];var _0x4b4159=[];var _0x290a7c=[];_0x46763b[_0xafac('0x97')](function(_0x48d9d9){if(!_['isNil'](_0x48d9d9[_0xafac('0x98')])){var _0x3a10cf=_0x48d9d9[_0xafac('0x98')]['substring'](_0x48d9d9[_0xafac('0x98')]['lastIndexOf']('.')+0x1);if(_0x3a10cf===_0xafac('0x9c')){_0x4b4159['push'](getBooleanList(_0x3af0d3,_0x49f00c,_0x290a7c,_0x4036e5[_0xafac('0x8f')],_0x48d9d9[_0xafac('0x8f')],_0x2414ec));}}});return Promise[_0xafac('0x9d')](_0x4b4159);})[_0xafac('0xe')](function(_0x24495a){_0x175f31=_0x24495a[0x0];var _0x4ee8cc=[];var _0x430888=[];_0x46763b[_0xafac('0x97')](function(_0x5933c0){if(_0x5933c0[_0xafac('0x98')]){var _0x700d85=_0x5933c0['@odata.type'][_0xafac('0x99')](_0x5933c0[_0xafac('0x98')][_0xafac('0x3f')]('.')+0x1);if(_0x700d85===_0xafac('0x9e')||_0x700d85===_0xafac('0x9f')||_0x700d85==='BigIntAttributeMetadata'||_0x700d85==='IntegerAttributeMetadata'||_0x700d85===_0xafac('0xa0')||_0x700d85===_0xafac('0xa1')||_0x700d85===_0xafac('0xa2')||_0x700d85===_0xafac('0xa3')||_0x700d85===_0xafac('0xa4')||_0x700d85===_0xafac('0xa5')){_0x4ee8cc['push'](getInputList(_0x3af0d3,_0x49f00c,_0x700d85,_0x430888,_0x4036e5['MetadataId'],_0x5933c0[_0xafac('0x8f')],_0x2414ec));}}});return Promise[_0xafac('0x9d')](_0x4ee8cc);})[_0xafac('0xe')](function(_0x237b28){_0xc9a8fc=_0x237b28[0x0];var _0x130c3c=_0x5793b2[_0xafac('0x80')](_0x175f31)[_0xafac('0x80')](_0xc9a8fc);var _0x45feb3={'count':_0x130c3c['length'],'rows':_0x130c3c};return _0x45feb3;})['then'](respondWithResult(_0x941dc9,null))['catch'](function(_0x42686d){var _0xb33684=_0x16ee96[_0xafac('0x19')][_0xafac('0xa6')]?0x1f4:_0x42686d[_0xafac('0xa7')]||0x1f4;logger['error'](_0x42686d[_0xafac('0x12')]);delete _0x42686d['name'];if(_0xb33684===0x191){_0xb33684=0x190;}_0x941dc9[_0xafac('0xb')](_0xb33684)['send'](_0x16ee96['query'][_0xafac('0xa6')]?{'message':'Wrong\x20credentials','statusCode':_0x42686d[_0xafac('0xa7')]}:_0x42686d);});};function getSelectList(_0x271f14,_0x180782,_0x3b110c,_0x56a200,_0x579191,_0x2c26a0){var _0x27dc48={'method':_0xafac('0x90'),'uri':_0x271f14+_0xafac('0x91')+_0x56a200+_0xafac('0xa8')+_0x579191+_0xafac('0xa9')+_0xafac('0xaa'),'headers':{'Authorization':_0xafac('0x8d')+_0x2c26a0,'If-None-Match':null,'OData-Version':_0xafac('0x93')},'json':!![]};return rp(_0x27dc48)[_0xafac('0xe')](function(_0xdbc894){var _0x5b0ed9=[];var _0x482320=_0xdbc894[_0xafac('0xab')]['Options'];_0x482320['forEach'](function(_0x1e7132){_0x5b0ed9['push']({'name':_0x1e7132[_0xafac('0xac')]['UserLocalizedLabel']['Label'],'value':String(_0x1e7132[_0xafac('0xad')])});});var _0x484485={'id':_0x180782+'_'+_0xdbc894[_0xafac('0x96')],'name':_0xdbc894[_0xafac('0xae')]['UserLocalizedLabel'][_0xafac('0xac')],'custom':![],'options':_0x5b0ed9};_0x3b110c[_0xafac('0x9b')](_0x484485);return _0x3b110c;});}function getBooleanList(_0x134792,_0x582344,_0x37916b,_0xeaa178,_0x12e520,_0x5a667c){var _0x2c1d24={'method':_0xafac('0x90'),'uri':_0x134792+_0xafac('0x91')+_0xeaa178+')/Attributes('+_0x12e520+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xafac('0x8d')+_0x5a667c,'If-None-Match':null,'OData-Version':_0xafac('0x93')},'json':!![]};return rp(_0x2c1d24)[_0xafac('0xe')](function(_0x2134cb){var _0x1f2e54=[];_0x1f2e54[_0xafac('0x9b')]({'name':_0x2134cb[_0xafac('0xab')][_0xafac('0xaf')][_0xafac('0xac')][_0xafac('0xb0')][_0xafac('0xac')],'value':_0xafac('0xb1')},{'name':_0x2134cb[_0xafac('0xab')][_0xafac('0xb2')][_0xafac('0xac')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x140d01={'id':_0x582344+'_'+_0x2134cb[_0xafac('0x96')],'name':_0x2134cb['DisplayName'][_0xafac('0xb0')]['Label'],'custom':![],'options':_0x1f2e54};_0x37916b[_0xafac('0x9b')](_0x140d01);return _0x37916b;});}function getInputList(_0x477e44,_0x4227d8,_0x46c821,_0x3f6ae2,_0x2faa06,_0x3f8a48,_0x592778){var _0x4e02c1={'method':_0xafac('0x90'),'uri':_0x477e44+_0xafac('0x91')+_0x2faa06+_0xafac('0xa8')+_0x3f8a48+_0xafac('0xb3')+_0x46c821+_0xafac('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x592778,'If-None-Match':null,'OData-Version':_0xafac('0x93')},'json':!![]};return rp(_0x4e02c1)[_0xafac('0xe')](function(_0xe72b5d){var _0x34ca87={'id':_0x4227d8+'_'+_0xe72b5d['LogicalName'],'name':_0xe72b5d[_0xafac('0xae')][_0xafac('0xb0')]?_0xe72b5d['DisplayName'][_0xafac('0xb0')][_0xafac('0xac')]:_0xe72b5d[_0xafac('0x96')],'custom':![],'options':[]};_0x3f6ae2[_0xafac('0x9b')](_0x34ca87);return _0x3f6ae2;});} \ No newline at end of file +var _0x672e=['actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','forEach','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','stack','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','update','then','sendStatus','name','send','index','map','Dynamics365Account','fieldName','type','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','length','include','create','body','find','params','destroy','findOne','Dynamics365Configuration','sort','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame'];(function(_0x15296c,_0x24126c){var _0x2a46a1=function(_0x119677){while(--_0x119677){_0x15296c['push'](_0x15296c['shift']());}};_0x2a46a1(++_0x24126c);}(_0x672e,0x1e2));var _0xe672=function(_0x232c55,_0x51d83d){_0x232c55=_0x232c55-0x0;var _0x1a4275=_0x672e[_0x232c55];return _0x1a4275;};'use strict';var rp=require(_0xe672('0x0'));var util=require('util');var _=require(_0xe672('0x1'));var qs=require(_0xe672('0x2'));var logger=require(_0xe672('0x3'))(_0xe672('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe672('0x5'));function respondWithResult(_0x5c0dc5,_0xe89db8){_0xe89db8=_0xe89db8||0xc8;return function(_0x251724){if(_0x251724){return _0x5c0dc5[_0xe672('0x6')](_0xe89db8)['json'](_0x251724);}};}function respondWithFilteredResult(_0x37c809,_0x15420d){return function(_0x36cc93){if(_0x36cc93){var _0x1781fc=typeof _0x15420d[_0xe672('0x7')]===_0xe672('0x8')&&typeof _0x15420d[_0xe672('0x9')]==='undefined';var _0x508c2b=_0x36cc93['count'];var _0xfc486c=_0x1781fc?0x0:_0x15420d[_0xe672('0x7')];var _0x5ceb7d=_0x1781fc?_0x36cc93[_0xe672('0xa')]:_0x15420d[_0xe672('0x7')]+_0x15420d['limit'];var _0x37885e;if(_0x5ceb7d>=_0x508c2b){_0x5ceb7d=_0x508c2b;_0x37885e=0xc8;}else{_0x37885e=0xce;}_0x37c809[_0xe672('0x6')](_0x37885e);return _0x37c809[_0xe672('0xb')](_0xe672('0xc'),_0xfc486c+'-'+_0x5ceb7d+'/'+_0x508c2b)[_0xe672('0xd')](_0x36cc93);}return null;};}function saveUpdates(_0x2f0e99){return function(_0x204ae1){if(_0x204ae1){return _0x204ae1[_0xe672('0xe')](_0x2f0e99)[_0xe672('0xf')](function(_0x1e58d7){return _0x1e58d7;});}return null;};}function removeEntity(_0x10918c){return function(_0x128a22){if(_0x128a22){return _0x128a22['destroy']()[_0xe672('0xf')](function(){_0x10918c[_0xe672('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330789){return function(_0x4b74d5){if(!_0x4b74d5){_0x330789[_0xe672('0x10')](0x194);}return _0x4b74d5;};}function handleError(_0x2744dd,_0x2273b7){_0x2273b7=_0x2273b7||0x1f4;return function(_0x491989){logger['error'](_0x491989['stack']);if(_0x491989[_0xe672('0x11')]){delete _0x491989[_0xe672('0x11')];}_0x2744dd['status'](_0x2273b7)[_0xe672('0x12')](_0x491989);};}exports[_0xe672('0x13')]=function(_0x51abb5,_0x23628e){var _0x2935e0={},_0x1ef7f4={},_0x500b68={'count':0x0,'rows':[]};var _0x4b32e9=_[_0xe672('0x14')](db[_0xe672('0x15')]['rawAttributes'],function(_0x46775d){return{'name':_0x46775d[_0xe672('0x16')],'type':_0x46775d[_0xe672('0x17')]['key']};});_0x1ef7f4['model']=_[_0xe672('0x14')](_0x4b32e9,_0xe672('0x11'));_0x1ef7f4['query']=_[_0xe672('0x18')](_0x51abb5[_0xe672('0x19')]);_0x1ef7f4[_0xe672('0x1a')]=_['intersection'](_0x1ef7f4[_0xe672('0x1b')],_0x1ef7f4['query']);_0x2935e0[_0xe672('0x1c')]=_[_0xe672('0x1d')](_0x1ef7f4[_0xe672('0x1b')],qs[_0xe672('0x1e')](_0x51abb5[_0xe672('0x19')][_0xe672('0x1e')]));_0x2935e0[_0xe672('0x1c')]=_0x2935e0[_0xe672('0x1c')]['length']?_0x2935e0[_0xe672('0x1c')]:_0x1ef7f4[_0xe672('0x1b')];if(!_0x51abb5['query'][_0xe672('0x1f')](_0xe672('0x20'))){_0x2935e0['limit']=qs[_0xe672('0x9')](_0x51abb5[_0xe672('0x19')]['limit']);_0x2935e0[_0xe672('0x7')]=qs[_0xe672('0x7')](_0x51abb5[_0xe672('0x19')][_0xe672('0x7')]);}_0x2935e0['order']=qs['sort'](_0x51abb5[_0xe672('0x19')]['sort']);_0x2935e0[_0xe672('0x21')]=qs[_0xe672('0x1a')](_['pick'](_0x51abb5[_0xe672('0x19')],_0x1ef7f4['filters']),_0x4b32e9);if(_0x51abb5[_0xe672('0x19')][_0xe672('0x22')]){_0x2935e0[_0xe672('0x21')]=_[_0xe672('0x23')](_0x2935e0[_0xe672('0x21')],{'$or':_[_0xe672('0x14')](_0x4b32e9,function(_0x2e10b3){if(_0x2e10b3[_0xe672('0x17')]!==_0xe672('0x24')){var _0x24a8fa={};_0x24a8fa[_0x2e10b3[_0xe672('0x11')]]={'$like':'%'+_0x51abb5[_0xe672('0x19')][_0xe672('0x22')]+'%'};return _0x24a8fa;}})});}_0x2935e0=_[_0xe672('0x23')]({},_0x2935e0,_0x51abb5[_0xe672('0x25')]);var _0x598b88={'where':_0x2935e0['where']};return db[_0xe672('0x15')][_0xe672('0xa')](_0x598b88)['then'](function(_0x35a133){_0x500b68[_0xe672('0xa')]=_0x35a133;if(_0x51abb5['query'][_0xe672('0x26')]){_0x2935e0['include']=[{'all':!![]}];}return db[_0xe672('0x15')][_0xe672('0x27')](_0x2935e0);})[_0xe672('0xf')](function(_0x52e66e){_0x500b68[_0xe672('0x28')]=_0x52e66e;return _0x500b68;})[_0xe672('0xf')](respondWithFilteredResult(_0x23628e,_0x2935e0))[_0xe672('0x29')](handleError(_0x23628e,null));};exports[_0xe672('0x2a')]=function(_0x38d423,_0x26c01d){var _0x22b262={'raw':![],'where':{'id':_0x38d423['params']['id']}},_0x1cb460={};_0x1cb460['model']=_[_0xe672('0x18')](db[_0xe672('0x15')][_0xe672('0x2b')]);_0x1cb460['query']=_[_0xe672('0x18')](_0x38d423[_0xe672('0x19')]);_0x1cb460[_0xe672('0x1a')]=_[_0xe672('0x1d')](_0x1cb460[_0xe672('0x1b')],_0x1cb460['query']);_0x22b262['attributes']=_['intersection'](_0x1cb460['model'],qs['fields'](_0x38d423[_0xe672('0x19')]['fields']));_0x22b262[_0xe672('0x1c')]=_0x22b262[_0xe672('0x1c')][_0xe672('0x2c')]?_0x22b262['attributes']:_0x1cb460[_0xe672('0x1b')];if(_0x38d423[_0xe672('0x19')]['includeAll']){_0x22b262[_0xe672('0x2d')]=[{'all':!![]}];}_0x22b262=_[_0xe672('0x23')]({},_0x22b262,_0x38d423['options']);return db[_0xe672('0x15')]['find'](_0x22b262)[_0xe672('0xf')](handleEntityNotFound(_0x26c01d,null))[_0xe672('0xf')](respondWithResult(_0x26c01d,null))['catch'](handleError(_0x26c01d,null));};exports[_0xe672('0x2e')]=function(_0x1f01cf,_0x54b900){return db['Dynamics365Account'][_0xe672('0x2e')](_0x1f01cf[_0xe672('0x2f')],{})['then'](respondWithResult(_0x54b900,0xc9))[_0xe672('0x29')](handleError(_0x54b900,null));};exports[_0xe672('0xe')]=function(_0xfd3940,_0x2debd0){if(_0xfd3940[_0xe672('0x2f')]['id']){delete _0xfd3940[_0xe672('0x2f')]['id'];}return db[_0xe672('0x15')][_0xe672('0x30')]({'where':{'id':_0xfd3940[_0xe672('0x31')]['id']}})[_0xe672('0xf')](handleEntityNotFound(_0x2debd0,null))[_0xe672('0xf')](saveUpdates(_0xfd3940['body'],null))[_0xe672('0xf')](respondWithResult(_0x2debd0,null))[_0xe672('0x29')](handleError(_0x2debd0,null));};exports[_0xe672('0x32')]=function(_0x51e3dc,_0x3937b5){return db['Dynamics365Account'][_0xe672('0x30')]({'where':{'id':_0x51e3dc[_0xe672('0x31')]['id']}})['then'](handleEntityNotFound(_0x3937b5,null))[_0xe672('0xf')](removeEntity(_0x3937b5,null))[_0xe672('0x29')](handleError(_0x3937b5,null));};exports['getConfigurations']=function(_0x556098,_0x323c09){var _0x163d08={};var _0x599a66={};var _0x177570;var _0xd650c0;return db[_0xe672('0x15')][_0xe672('0x33')]({'where':{'id':_0x556098[_0xe672('0x31')]['id']}})['then'](handleEntityNotFound(_0x323c09,null))[_0xe672('0xf')](function(_0x3ef1ab){if(_0x3ef1ab){_0x177570=_0x3ef1ab;_0x599a66[_0xe672('0x1b')]=_['keys'](db[_0xe672('0x34')][_0xe672('0x2b')]);_0x599a66[_0xe672('0x19')]=_[_0xe672('0x18')](_0x556098[_0xe672('0x19')]);_0x599a66[_0xe672('0x1a')]=_[_0xe672('0x1d')](_0x599a66[_0xe672('0x1b')],_0x599a66['query']);_0x163d08[_0xe672('0x1c')]=_[_0xe672('0x1d')](_0x599a66[_0xe672('0x1b')],qs[_0xe672('0x1e')](_0x556098['query'][_0xe672('0x1e')]));_0x163d08[_0xe672('0x1c')]=_0x163d08[_0xe672('0x1c')]['length']?_0x163d08[_0xe672('0x1c')]:_0x599a66[_0xe672('0x1b')];_0x163d08['order']=qs[_0xe672('0x35')](_0x556098[_0xe672('0x19')][_0xe672('0x35')]);_0x163d08[_0xe672('0x21')]=qs['filters'](_[_0xe672('0x36')](_0x556098[_0xe672('0x19')],_0x599a66[_0xe672('0x1a')]));if(_0x556098[_0xe672('0x19')][_0xe672('0x22')]){_0x163d08[_0xe672('0x21')]=_[_0xe672('0x23')](_0x163d08[_0xe672('0x21')],{'$or':_['map'](_0x163d08[_0xe672('0x1c')],function(_0x57a5e7){var _0x467333={};_0x467333[_0x57a5e7]={'$like':'%'+_0x556098[_0xe672('0x19')][_0xe672('0x22')]+'%'};return _0x467333;})});}_0x163d08=_[_0xe672('0x23')]({},_0x163d08,_0x556098[_0xe672('0x25')]);return _0x177570[_0xe672('0x37')](_0x163d08);}})[_0xe672('0xf')](function(_0xeac7c){if(_0xeac7c){_0xd650c0=_0xeac7c[_0xe672('0x2c')];if(!_0x556098[_0xe672('0x19')][_0xe672('0x1f')](_0xe672('0x20'))){_0x163d08[_0xe672('0x9')]=qs[_0xe672('0x9')](_0x556098[_0xe672('0x19')][_0xe672('0x9')]);_0x163d08[_0xe672('0x7')]=qs['offset'](_0x556098[_0xe672('0x19')][_0xe672('0x7')]);}return _0x177570[_0xe672('0x37')](_0x163d08);}})[_0xe672('0xf')](function(_0x2dc066){if(_0x2dc066){return _0x2dc066?{'count':_0xd650c0,'rows':_0x2dc066}:null;}})[_0xe672('0xf')](respondWithResult(_0x323c09,null))[_0xe672('0x29')](handleError(_0x323c09,null));};exports[_0xe672('0x38')]=function(_0x50e132,_0x4c6793){if(_0x50e132[_0xe672('0x2f')]['id']){delete _0x50e132[_0xe672('0x2f')]['id'];}return db[_0xe672('0x15')]['findOne']({'where':{'id':_0x50e132[_0xe672('0x31')]['id']}})[_0xe672('0xf')](handleEntityNotFound(_0x4c6793,null))[_0xe672('0xf')](function(_0x4cb384){if(_0x4cb384){_0x50e132[_0xe672('0x2f')][_0xe672('0x39')]=_0x4cb384['id'];_0x50e132[_0xe672('0x2f')][_0xe672('0x3a')]=integrations[_0xe672('0x3b')](_0x50e132[_0xe672('0x2f')]['channel'],_0x50e132['body'][_0xe672('0x17')]);_0x50e132[_0xe672('0x2f')]['Descriptions']=integrations[_0xe672('0x3c')](_0x50e132[_0xe672('0x2f')]['channel'],_0x50e132[_0xe672('0x2f')][_0xe672('0x17')]);return db[_0xe672('0x34')]['create'](_0x50e132[_0xe672('0x2f')],{'include':[{'model':db[_0xe672('0x3d')],'as':_0xe672('0x3a')},{'model':db[_0xe672('0x3d')],'as':'Descriptions'}]});}return null;})[_0xe672('0xf')](respondWithResult(_0x4c6793,null))[_0xe672('0x29')](handleError(_0x4c6793,null));};function sanitizeRemoteUri(_0x5bfaac){var _0x5f238a=_0x5bfaac[_0xe672('0x3e')](-0x1);if(_0x5f238a==='/')return _0x5bfaac[_0xe672('0x3f')](0x0,_0x5bfaac[_0xe672('0x40')](_0x5f238a));return _0x5bfaac;}function getWebApiUrl(_0x35d6dd){return util['format'](_0xe672('0x41'),_0x35d6dd);}exports[_0xe672('0x42')]=function(_0xda1274,_0xc3181b){var _0x34af17=_0xda1274[_0xe672('0x19')][_0xe672('0x43')];var _0x48329f=_0x34af17===_0xe672('0x44')?_0xe672('0x45'):_0xe672('0x46');var _0x1b94bb='';var _0xe0beb9='';var _0x2542fe='';var _0x322998='';var _0x50753f='';var _0x5c113b='';var _0x399105='';var _0x24f268='';var _0x176aff=[_0xe672('0x47'),_0xe672('0x48'),_0xe672('0x49'),_0xe672('0x4a'),_0xe672('0x4b'),_0xe672('0x4c'),_0xe672('0x4d'),_0xe672('0x4e'),_0xe672('0x4f'),_0xe672('0x50')];var _0x1a582b=['accountidname',_0xe672('0x51'),_0xe672('0x52'),'billedserviceunits',_0xe672('0x53'),_0xe672('0x54'),'contractdetailidname',_0xe672('0x55'),_0xe672('0x56'),'createdbyexternalpartyyominame',_0xe672('0x57'),_0xe672('0x58'),'createdon',_0xe672('0x59'),_0xe672('0x5a'),_0xe672('0x5b'),_0xe672('0x5c'),_0xe672('0x5d'),_0xe672('0x5e'),'entitlementidname',_0xe672('0x5f'),'entityimage_url','escalatedon','exchangerate',_0xe672('0x60'),_0xe672('0x61'),_0xe672('0x62'),_0xe672('0x63'),_0xe672('0x64'),_0xe672('0x65'),_0xe672('0x66'),_0xe672('0x67'),_0xe672('0x68'),_0xe672('0x69'),'modifiedbyyominame',_0xe672('0x6a'),_0xe672('0x6b'),_0xe672('0x6c'),_0xe672('0x6d'),_0xe672('0x6e'),_0xe672('0x6f'),'onholdtime',_0xe672('0x70'),'owneridname',_0xe672('0x71'),_0xe672('0x72'),_0xe672('0x73'),_0xe672('0x74'),'primarycontactidyominame',_0xe672('0x75'),'productidname','productserialnumber',_0xe672('0x76'),_0xe672('0x77'),_0xe672('0x78'),'responsiblecontactidname',_0xe672('0x79'),_0xe672('0x7a'),_0xe672('0x7b'),'slaname',_0xe672('0x7c'),_0xe672('0x7d'),'statuscode','subjectidname','ticketnumber',_0xe672('0x7e'),_0xe672('0x7f'),_0xe672('0x80'),_0xe672('0x81'),'versionnumber'];var _0x333c29=_0x176aff[_0xe672('0x82')](_0x1a582b);return db[_0xe672('0x15')][_0xe672('0x33')]({'where':{'id':_0xda1274['params']['id']},'attributes':['id',_0xe672('0x83'),_0xe672('0x84'),_0xe672('0x85'),_0xe672('0x86'),_0xe672('0x87'),_0xe672('0x88'),_0xe672('0x89')],'include':[{'model':db[_0xe672('0x8a')],'as':_0xe672('0x8a'),'attributes':['id',_0xe672('0x8b'),_0xe672('0x8c')]}]})[_0xe672('0xf')](handleEntityNotFound(_0xc3181b,null))['then'](function(_0x313dcf){if(_0x313dcf){if(_0x313dcf[_0xe672('0x89')]){_0x313dcf['access_token']=_0x313dcf['CloudProvider']['data5'];_0x24f268=sanitizeRemoteUri(_0x313dcf[_0xe672('0x8a')][_0xe672('0x8c')]);_0x399105=getWebApiUrl(_0x24f268);return _0x313dcf;}_0x24f268=sanitizeRemoteUri(_0x313dcf[_0xe672('0x85')]);_0x399105=getWebApiUrl(_0x24f268);var _0x358332={'method':_0xe672('0x8d'),'uri':'https://login.microsoftonline.com/'+_0x313dcf[_0xe672('0x86')]+'/oauth2/token','form':{'client_id':_0x313dcf['clientId'],'resource':_0x24f268,'username':_0x313dcf[_0xe672('0x83')],'password':_0x313dcf[_0xe672('0x84')],'grant_type':_0xe672('0x84'),'client_secret':_0x313dcf[_0xe672('0x88')]},'json':!![]};return rp(_0x358332);}})[_0xe672('0xf')](function(_0x1a5ff3){_0x5c113b=_0x1a5ff3['access_token'];var _0x549d06={'method':'GET','uri':encodeURI(_0x399105+_0xe672('0x8e')+_0x48329f+'\x27'),'headers':{'Authorization':_0xe672('0x8f')+_0x5c113b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x549d06);})['then'](function(_0x52b532){var _0x3b5171=_0x52b532[_0xe672('0x90')][0x0];var _0x4d8001=_0x3b5171['MetadataId'];var _0x265d63={'method':_0xe672('0x91'),'uri':_0x399105+_0xe672('0x92')+_0x4d8001+_0xe672('0x93'),'headers':{'Authorization':'Bearer\x20'+_0x5c113b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x265d63);})['then'](function(_0x5cf32f){_0x1b94bb=_0x5cf32f;_0xe0beb9=_0x1b94bb[_0xe672('0x94')];_0xe0beb9=_[_0xe672('0x95')](_0xe0beb9,function(_0x4cdb68){return!_0x333c29[_0xe672('0x96')](_0x4cdb68[_0xe672('0x97')]);});var _0x449d41=[];var _0x3a5406=[];_0xe0beb9['forEach'](function(_0x25ec2c){if(_0x25ec2c[_0xe672('0x98')]){var _0xc6a96e=_0x25ec2c[_0xe672('0x98')]['substring'](_0x25ec2c['@odata.type']['lastIndexOf']('.')+0x1);if(_0xc6a96e===_0xe672('0x99')){_0x449d41[_0xe672('0x9a')](getSelectList(_0x399105,_0x34af17,_0x3a5406,_0x1b94bb[_0xe672('0x9b')],_0x25ec2c[_0xe672('0x9b')],_0x5c113b));}}});return Promise['all'](_0x449d41);})[_0xe672('0xf')](function(_0x17036d){_0x2542fe=_0x17036d[0x0];var _0x4435ac=[];var _0x19faff=[];_0xe0beb9[_0xe672('0x9c')](function(_0x574399){if(!_['isNil'](_0x574399[_0xe672('0x98')])){var _0x271708=_0x574399['@odata.type']['substring'](_0x574399[_0xe672('0x98')][_0xe672('0x40')]('.')+0x1);if(_0x271708===_0xe672('0x9d')){_0x4435ac['push'](getBooleanList(_0x399105,_0x34af17,_0x19faff,_0x1b94bb['MetadataId'],_0x574399[_0xe672('0x9b')],_0x5c113b));}}});return Promise['all'](_0x4435ac);})[_0xe672('0xf')](function(_0x106778){_0x322998=_0x106778[0x0];var _0x556e08=[];var _0x371abe=[];_0xe0beb9[_0xe672('0x9c')](function(_0x3dff4e){if(_0x3dff4e[_0xe672('0x98')]){var _0x11486=_0x3dff4e[_0xe672('0x98')][_0xe672('0x3f')](_0x3dff4e[_0xe672('0x98')]['lastIndexOf']('.')+0x1);if(_0x11486===_0xe672('0x9e')||_0x11486===_0xe672('0x9f')||_0x11486===_0xe672('0xa0')||_0x11486===_0xe672('0xa1')||_0x11486===_0xe672('0xa2')||_0x11486===_0xe672('0xa3')||_0x11486===_0xe672('0xa4')||_0x11486===_0xe672('0xa5')||_0x11486===_0xe672('0xa6')||_0x11486===_0xe672('0xa7')){_0x556e08[_0xe672('0x9a')](getInputList(_0x399105,_0x34af17,_0x11486,_0x371abe,_0x1b94bb[_0xe672('0x9b')],_0x3dff4e['MetadataId'],_0x5c113b));}}});return Promise['all'](_0x556e08);})['then'](function(_0x59232e){_0x50753f=_0x59232e[0x0];var _0xc945f7=_0x2542fe['concat'](_0x322998)[_0xe672('0x82')](_0x50753f);var _0x43d027={'count':_0xc945f7[_0xe672('0x2c')],'rows':_0xc945f7};return _0x43d027;})[_0xe672('0xf')](respondWithResult(_0xc3181b,null))[_0xe672('0x29')](function(_0x36fb7f){var _0x1a4864=_0xda1274['query'][_0xe672('0xa8')]?0x1f4:_0x36fb7f['statusCode']||0x1f4;logger['error'](_0x36fb7f[_0xe672('0xa9')]);delete _0x36fb7f[_0xe672('0x11')];if(_0x1a4864===0x191){_0x1a4864=0x190;}_0xc3181b[_0xe672('0x6')](_0x1a4864)[_0xe672('0x12')](_0xda1274['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x36fb7f[_0xe672('0xaa')]}:_0x36fb7f);});};function getSelectList(_0x363ec6,_0x5bcb29,_0x408676,_0x38d690,_0x1c1766,_0x1a2119){var _0x3d11e1={'method':_0xe672('0x91'),'uri':_0x363ec6+'EntityDefinitions('+_0x38d690+_0xe672('0xab')+_0x1c1766+_0xe672('0xac')+_0xe672('0xad'),'headers':{'Authorization':_0xe672('0x8f')+_0x1a2119,'If-None-Match':null,'OData-Version':_0xe672('0xae')},'json':!![]};return rp(_0x3d11e1)['then'](function(_0x355f2d){var _0x7ded30=[];var _0x2b0d72=_0x355f2d[_0xe672('0xaf')][_0xe672('0xb0')];_0x2b0d72[_0xe672('0x9c')](function(_0x5ee30d){_0x7ded30['push']({'name':_0x5ee30d[_0xe672('0xb1')][_0xe672('0xb2')][_0xe672('0xb1')],'value':String(_0x5ee30d[_0xe672('0xb3')])});});var _0x4bb574={'id':_0x5bcb29+'_'+_0x355f2d[_0xe672('0x97')],'name':_0x355f2d[_0xe672('0xb4')]['UserLocalizedLabel'][_0xe672('0xb1')],'custom':![],'options':_0x7ded30};_0x408676[_0xe672('0x9a')](_0x4bb574);return _0x408676;});}function getBooleanList(_0x228f23,_0xa22301,_0x19f745,_0x57bbf4,_0x14aa27,_0x299564){var _0x273e8a={'method':_0xe672('0x91'),'uri':_0x228f23+_0xe672('0x92')+_0x57bbf4+_0xe672('0xab')+_0x14aa27+_0xe672('0xb5'),'headers':{'Authorization':_0xe672('0x8f')+_0x299564,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x273e8a)[_0xe672('0xf')](function(_0x1a94a8){var _0x1b6d5a=[];_0x1b6d5a['push']({'name':_0x1a94a8[_0xe672('0xaf')][_0xe672('0xb6')]['Label']['UserLocalizedLabel'][_0xe672('0xb1')],'value':_0xe672('0xb7')},{'name':_0x1a94a8[_0xe672('0xaf')][_0xe672('0xb8')][_0xe672('0xb1')][_0xe672('0xb2')]['Label'],'value':_0xe672('0xb9')});var _0x5ca957={'id':_0xa22301+'_'+_0x1a94a8[_0xe672('0x97')],'name':_0x1a94a8[_0xe672('0xb4')][_0xe672('0xb2')][_0xe672('0xb1')],'custom':![],'options':_0x1b6d5a};_0x19f745['push'](_0x5ca957);return _0x19f745;});}function getInputList(_0x402ec7,_0x309eea,_0x55bc62,_0x11a042,_0x375648,_0x10326c,_0x2a07a4){var _0x265246={'method':'GET','uri':_0x402ec7+_0xe672('0x92')+_0x375648+_0xe672('0xab')+_0x10326c+_0xe672('0xba')+_0x55bc62+_0xe672('0xbb'),'headers':{'Authorization':'Bearer\x20'+_0x2a07a4,'If-None-Match':null,'OData-Version':_0xe672('0xae')},'json':!![]};return rp(_0x265246)[_0xe672('0xf')](function(_0x50f1c7){var _0x462e77={'id':_0x309eea+'_'+_0x50f1c7[_0xe672('0x97')],'name':_0x50f1c7[_0xe672('0xb4')][_0xe672('0xb2')]?_0x50f1c7[_0xe672('0xb4')]['UserLocalizedLabel']['Label']:_0x50f1c7[_0xe672('0x97')],'custom':![],'options':[]};_0x11a042['push'](_0x462e77);return _0x11a042;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index cb9ff57..39b476b 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1871af,_0x588ce4){var _0x4bba36=function(_0x21a998){while(--_0x21a998){_0x1871af['push'](_0x1871af['shift']());}};_0x4bba36(++_0x588ce4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./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 +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x308b7d,_0x579a87){var _0x4e5993=function(_0x101d8c){while(--_0x101d8c){_0x308b7d['push'](_0x308b7d['shift']());}};_0x4e5993(++_0x579a87);}(_0xb7e7,0x121));var _0x7b7e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xb7e7[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'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 f6024ee..92d1d79 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 _0x0b8a=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','debug','ShowDynamics365Account','find','where','stringify','lodash'];(function(_0x4e3058,_0x1b6e3e){var _0x41d369=function(_0x2fea1a){while(--_0x2fea1a){_0x4e3058['push'](_0x4e3058['shift']());}};_0x41d369(++_0x1b6e3e);}(_0x0b8a,0x19f));var _0xa0b8=function(_0x1d4327,_0xd77cef){_0x1d4327=_0x1d4327-0x0;var _0x51043c=_0x0b8a[_0x1d4327];return _0x51043c;};'use strict';var _=require(_0xa0b8('0x0'));var util=require('util');var moment=require(_0xa0b8('0x1'));var BPromise=require(_0xa0b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0b8('0x4'));var logger=require(_0xa0b8('0x5'))(_0xa0b8('0x6'));var config=require(_0xa0b8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa0b8('0x8')][_0xa0b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5932e7,_0x438651,_0x721e84){return new BPromise(function(_0x7e067e,_0x4bd12f){return client['request'](_0x5932e7,_0x721e84)[_0xa0b8('0xa')](function(_0x30751d){logger[_0xa0b8('0xb')](_0xa0b8('0xc'),_0x438651,_0xa0b8('0xd'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x438651,_0xa0b8('0xd'),JSON['stringify'](_0x30751d));if(_0x30751d[_0xa0b8('0xe')]){if(_0x30751d[_0xa0b8('0xe')]['code']===0x1f4){logger[_0xa0b8('0xe')](_0xa0b8('0xc'),_0x438651,_0x30751d[_0xa0b8('0xe')]['message']);return _0x4bd12f(_0x30751d[_0xa0b8('0xe')][_0xa0b8('0xf')]);}logger[_0xa0b8('0xe')](_0xa0b8('0xc'),_0x438651,_0x30751d[_0xa0b8('0xe')][_0xa0b8('0xf')]);return _0x7e067e(_0x30751d[_0xa0b8('0xe')][_0xa0b8('0xf')]);}else{logger[_0xa0b8('0xb')](_0xa0b8('0xc'),_0x438651,_0xa0b8('0xd'));_0x7e067e(_0x30751d['result'][_0xa0b8('0xf')]);}})[_0xa0b8('0x10')](function(_0x44b24a){logger[_0xa0b8('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x438651,_0x44b24a);_0x4bd12f(_0x44b24a);});});}exports[_0xa0b8('0x11')]=function(_0x5a37e8){var _0x45cd46=this;return new Promise(function(_0x1da244,_0x11f888){return db[_0xa0b8('0x12')][_0xa0b8('0x13')]({'raw':_0x5a37e8[_0xa0b8('0x14')]?_0x5a37e8[_0xa0b8('0x14')][_0xa0b8('0x15')]===undefined?!![]:![]:!![],'where':_0x5a37e8[_0xa0b8('0x14')]?_0x5a37e8['options']['where']||null:null,'attributes':_0x5a37e8[_0xa0b8('0x14')]?_0x5a37e8['options'][_0xa0b8('0x16')]||null:null,'limit':_0x5a37e8[_0xa0b8('0x14')]?_0x5a37e8[_0xa0b8('0x14')][_0xa0b8('0x17')]||null:null,'include':_0x5a37e8[_0xa0b8('0x14')]?_0x5a37e8[_0xa0b8('0x14')][_0xa0b8('0x18')]?_[_0xa0b8('0x19')](_0x5a37e8['options'][_0xa0b8('0x18')],function(_0x4d91a){return{'model':db[_0x4d91a[_0xa0b8('0x1a')]],'as':_0x4d91a['as'],'attributes':_0x4d91a[_0xa0b8('0x16')],'include':_0x4d91a['include']?_[_0xa0b8('0x19')](_0x4d91a['include'],function(_0x3fc5c9){return{'model':db[_0x3fc5c9[_0xa0b8('0x1a')]],'as':_0x3fc5c9['as'],'attributes':_0x3fc5c9[_0xa0b8('0x16')],'include':_0x3fc5c9[_0xa0b8('0x18')]?_['map'](_0x3fc5c9['include'],function(_0x42bb07){return{'model':db[_0x42bb07[_0xa0b8('0x1a')]],'as':_0x42bb07['as'],'attributes':_0x42bb07['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x306b9d){logger[_0xa0b8('0xb')](_0xa0b8('0x11'),_0x5a37e8);logger[_0xa0b8('0x1b')](_0xa0b8('0x11'),_0x5a37e8,JSON['stringify'](_0x306b9d));_0x1da244(_0x306b9d);})[_0xa0b8('0x10')](function(_0x4400c1){logger[_0xa0b8('0xe')](_0xa0b8('0x11'),_0x4400c1[_0xa0b8('0xf')],_0x5a37e8);_0x11f888(_0x45cd46[_0xa0b8('0xe')](0x1f4,_0x4400c1['message']));});});};exports[_0xa0b8('0x1c')]=function(_0x8971f7){var _0x3b870f=this;return new Promise(function(_0x1ddcda,_0x1cfd89){return db['Dynamics365Account'][_0xa0b8('0x1d')]({'raw':_0x8971f7[_0xa0b8('0x14')]?_0x8971f7['options'][_0xa0b8('0x15')]===undefined?!![]:![]:!![],'where':_0x8971f7[_0xa0b8('0x14')]?_0x8971f7['options'][_0xa0b8('0x1e')]||null:null,'attributes':_0x8971f7['options']?_0x8971f7['options']['attributes']||null:null,'include':_0x8971f7[_0xa0b8('0x14')]?_0x8971f7[_0xa0b8('0x14')][_0xa0b8('0x18')]?_[_0xa0b8('0x19')](_0x8971f7['options'][_0xa0b8('0x18')],function(_0x3277fd){return{'model':db[_0x3277fd[_0xa0b8('0x1a')]],'as':_0x3277fd['as'],'attributes':_0x3277fd[_0xa0b8('0x16')],'include':_0x3277fd[_0xa0b8('0x18')]?_[_0xa0b8('0x19')](_0x3277fd[_0xa0b8('0x18')],function(_0x132777){return{'model':db[_0x132777['model']],'as':_0x132777['as'],'attributes':_0x132777[_0xa0b8('0x16')],'include':_0x132777[_0xa0b8('0x18')]?_[_0xa0b8('0x19')](_0x132777['include'],function(_0x1489a3){return{'model':db[_0x1489a3['model']],'as':_0x1489a3['as'],'attributes':_0x1489a3[_0xa0b8('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2572ea){logger['info'](_0xa0b8('0x1c'),_0x8971f7);logger[_0xa0b8('0x1b')](_0xa0b8('0x1c'),_0x8971f7,JSON[_0xa0b8('0x1f')](_0x2572ea));_0x1ddcda(_0x2572ea);})[_0xa0b8('0x10')](function(_0x4e9840){logger[_0xa0b8('0xe')](_0xa0b8('0x1c'),_0x4e9840[_0xa0b8('0xf')],_0x8971f7);_0x1cfd89(_0x3b870f['error'](0x1f4,_0x4e9840[_0xa0b8('0xf')]));});});}; \ No newline at end of file +var _0x16aa=['info','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','ShowDynamics365Account','find','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x16aa,0x1c8));var _0xa16a=function(_0x1936af,_0x5338e7){_0x1936af=_0x1936af-0x0;var _0x5d5ae8=_0x16aa[_0x1936af];return _0x5d5ae8;};'use strict';var _=require(_0xa16a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa16a('0x1'));var rs=require(_0xa16a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa16a('0x3'));var logger=require(_0xa16a('0x4'))(_0xa16a('0x5'));var config=require(_0xa16a('0x6'));var jayson=require(_0xa16a('0x7'));var client=jayson[_0xa16a('0x8')][_0xa16a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db69d,_0x317b80,_0x47ec0f){return new BPromise(function(_0x2c4c67,_0x1a318e){return client[_0xa16a('0xa')](_0x3db69d,_0x47ec0f)[_0xa16a('0xb')](function(_0x149c47){logger['info'](_0xa16a('0xc'),_0x317b80,_0xa16a('0xd'));logger[_0xa16a('0xe')](_0xa16a('0xf'),_0x317b80,'request\x20sent',JSON[_0xa16a('0x10')](_0x149c47));if(_0x149c47[_0xa16a('0x11')]){if(_0x149c47[_0xa16a('0x11')][_0xa16a('0x12')]===0x1f4){logger['error'](_0xa16a('0xc'),_0x317b80,_0x149c47[_0xa16a('0x11')][_0xa16a('0x13')]);return _0x1a318e(_0x149c47[_0xa16a('0x11')][_0xa16a('0x13')]);}logger['error'](_0xa16a('0xc'),_0x317b80,_0x149c47[_0xa16a('0x11')][_0xa16a('0x13')]);return _0x2c4c67(_0x149c47['error'][_0xa16a('0x13')]);}else{logger[_0xa16a('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x317b80,'request\x20sent');_0x2c4c67(_0x149c47['result']['message']);}})[_0xa16a('0x15')](function(_0x1478ba){logger[_0xa16a('0x11')](_0xa16a('0xc'),_0x317b80,_0x1478ba);_0x1a318e(_0x1478ba);});});}exports[_0xa16a('0x16')]=function(_0x1f7dc6){var _0x31be68=this;return new Promise(function(_0x51875f,_0x5d1efb){return db['Dynamics365Account'][_0xa16a('0x17')]({'raw':_0x1f7dc6[_0xa16a('0x18')]?_0x1f7dc6['options'][_0xa16a('0x19')]===undefined?!![]:![]:!![],'where':_0x1f7dc6[_0xa16a('0x18')]?_0x1f7dc6['options'][_0xa16a('0x1a')]||null:null,'attributes':_0x1f7dc6[_0xa16a('0x18')]?_0x1f7dc6[_0xa16a('0x18')][_0xa16a('0x1b')]||null:null,'limit':_0x1f7dc6['options']?_0x1f7dc6[_0xa16a('0x18')][_0xa16a('0x1c')]||null:null,'include':_0x1f7dc6[_0xa16a('0x18')]?_0x1f7dc6[_0xa16a('0x18')][_0xa16a('0x1d')]?_['map'](_0x1f7dc6[_0xa16a('0x18')][_0xa16a('0x1d')],function(_0x3adcb8){return{'model':db[_0x3adcb8['model']],'as':_0x3adcb8['as'],'attributes':_0x3adcb8[_0xa16a('0x1b')],'include':_0x3adcb8['include']?_[_0xa16a('0x1e')](_0x3adcb8['include'],function(_0x127b5b){return{'model':db[_0x127b5b[_0xa16a('0x1f')]],'as':_0x127b5b['as'],'attributes':_0x127b5b[_0xa16a('0x1b')],'include':_0x127b5b[_0xa16a('0x1d')]?_[_0xa16a('0x1e')](_0x127b5b[_0xa16a('0x1d')],function(_0xfb2ace){return{'model':db[_0xfb2ace[_0xa16a('0x1f')]],'as':_0xfb2ace['as'],'attributes':_0xfb2ace[_0xa16a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa16a('0xb')](function(_0x3a1410){logger[_0xa16a('0x14')](_0xa16a('0x16'),_0x1f7dc6);logger[_0xa16a('0xe')](_0xa16a('0x16'),_0x1f7dc6,JSON[_0xa16a('0x10')](_0x3a1410));_0x51875f(_0x3a1410);})['catch'](function(_0x8c0c99){logger[_0xa16a('0x11')](_0xa16a('0x16'),_0x8c0c99['message'],_0x1f7dc6);_0x5d1efb(_0x31be68[_0xa16a('0x11')](0x1f4,_0x8c0c99['message']));});});};exports[_0xa16a('0x20')]=function(_0x36a21c){var _0x182c28=this;return new Promise(function(_0x519806,_0x2bfe1d){return db['Dynamics365Account'][_0xa16a('0x21')]({'raw':_0x36a21c[_0xa16a('0x18')]?_0x36a21c[_0xa16a('0x18')][_0xa16a('0x19')]===undefined?!![]:![]:!![],'where':_0x36a21c[_0xa16a('0x18')]?_0x36a21c[_0xa16a('0x18')]['where']||null:null,'attributes':_0x36a21c[_0xa16a('0x18')]?_0x36a21c['options'][_0xa16a('0x1b')]||null:null,'include':_0x36a21c[_0xa16a('0x18')]?_0x36a21c[_0xa16a('0x18')]['include']?_['map'](_0x36a21c[_0xa16a('0x18')][_0xa16a('0x1d')],function(_0x43cc1f){return{'model':db[_0x43cc1f['model']],'as':_0x43cc1f['as'],'attributes':_0x43cc1f['attributes'],'include':_0x43cc1f['include']?_[_0xa16a('0x1e')](_0x43cc1f[_0xa16a('0x1d')],function(_0x493245){return{'model':db[_0x493245['model']],'as':_0x493245['as'],'attributes':_0x493245[_0xa16a('0x1b')],'include':_0x493245[_0xa16a('0x1d')]?_['map'](_0x493245[_0xa16a('0x1d')],function(_0x1eb206){return{'model':db[_0x1eb206[_0xa16a('0x1f')]],'as':_0x1eb206['as'],'attributes':_0x1eb206['attributes']};}):[]};}):[]};}):[]:[]})[_0xa16a('0xb')](function(_0x3fb15c){logger[_0xa16a('0x14')](_0xa16a('0x20'),_0x36a21c);logger['debug'](_0xa16a('0x20'),_0x36a21c,JSON['stringify'](_0x3fb15c));_0x519806(_0x3fb15c);})[_0xa16a('0x15')](function(_0x19e08f){logger[_0xa16a('0x11')](_0xa16a('0x20'),_0x19e08f[_0xa16a('0x13')],_0x36a21c);_0x2bfe1d(_0x182c28[_0xa16a('0x11')](0x1f4,_0x19e08f[_0xa16a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 6efc6c5..8ec22e3 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 _0x96ee=['util','path','../../components/auth/service','./intDynamics365Configuration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','exports'];(function(_0x3e51bf,_0x387447){var _0x5a0c50=function(_0x4ec69b){while(--_0x4ec69b){_0x3e51bf['push'](_0x3e51bf['shift']());}};_0x5a0c50(++_0x387447);}(_0x96ee,0x72));var _0xe96e=function(_0x9ffdd8,_0x414bbd){_0x9ffdd8=_0x9ffdd8-0x0;var _0x222710=_0x96ee[_0x9ffdd8];return _0x222710;};'use strict';var multer=require('multer');var util=require(_0xe96e('0x0'));var path=require(_0xe96e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe96e('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe96e('0x3'));router[_0xe96e('0x4')]('/',auth['isAuthenticated'](),controller[_0xe96e('0x5')]);router[_0xe96e('0x4')](_0xe96e('0x6'),auth['isAuthenticated'](),controller[_0xe96e('0x7')]);router[_0xe96e('0x4')](_0xe96e('0x8'),auth[_0xe96e('0x9')](),controller[_0xe96e('0xa')]);router[_0xe96e('0x4')](_0xe96e('0xb'),auth[_0xe96e('0x9')](),controller[_0xe96e('0xc')]);router[_0xe96e('0x4')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe96e('0xd')]);router[_0xe96e('0xe')]('/',auth[_0xe96e('0x9')](),controller[_0xe96e('0xf')]);router[_0xe96e('0x10')](_0xe96e('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xe96e('0x11')](_0xe96e('0x6'),auth[_0xe96e('0x9')](),controller['destroy']);module[_0xe96e('0x12')]=router; \ No newline at end of file +var _0x43a5=['/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x43a5,0xb0));var _0x543a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x43a5[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x543a('0x0'));var util=require(_0x543a('0x1'));var path=require(_0x543a('0x2'));var timeout=require(_0x543a('0x3'));var express=require(_0x543a('0x4'));var router=express[_0x543a('0x5')]();var fs_extra=require(_0x543a('0x6'));var auth=require(_0x543a('0x7'));var interaction=require(_0x543a('0x8'));var config=require(_0x543a('0x9'));var controller=require(_0x543a('0xa'));router[_0x543a('0xb')]('/',auth['isAuthenticated'](),controller[_0x543a('0xc')]);router[_0x543a('0xb')](_0x543a('0xd'),auth[_0x543a('0xe')](),controller[_0x543a('0xf')]);router[_0x543a('0xb')](_0x543a('0x10'),auth[_0x543a('0xe')](),controller['getFields']);router['get'](_0x543a('0x11'),auth[_0x543a('0xe')](),controller['getSubjects']);router[_0x543a('0xb')](_0x543a('0x12'),auth['isAuthenticated'](),controller[_0x543a('0x13')]);router[_0x543a('0x14')]('/',auth[_0x543a('0xe')](),controller['create']);router['put'](_0x543a('0xd'),auth[_0x543a('0xe')](),controller[_0x543a('0x15')]);router[_0x543a('0x16')](_0x543a('0xd'),auth['isAuthenticated'](),controller[_0x543a('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index eb93a85..87780ae 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 _0x8061=['sequelize','exports','STRING','ENUM','incident','contact','nothing'];(function(_0x2a19b2,_0xe36be6){var _0xeeeaf1=function(_0x146222){while(--_0x146222){_0x2a19b2['push'](_0x2a19b2['shift']());}};_0xeeeaf1(++_0xe36be6);}(_0x8061,0xd2));var _0x1806=function(_0x3cd47e,_0x34e998){_0x3cd47e=_0x3cd47e-0x0;var _0x3e6e36=_0x8061[_0x3cd47e];return _0x3e6e36;};'use strict';var Sequelize=require(_0x1806('0x0'));module[_0x1806('0x1')]={'name':{'type':Sequelize[_0x1806('0x2')]},'description':{'type':Sequelize[_0x1806('0x2')]},'ticketType':{'type':Sequelize[_0x1806('0x3')]('incident','phonecall'),'defaultValue':_0x1806('0x4')},'moduleCreate':{'type':Sequelize[_0x1806('0x3')](_0x1806('0x5'),_0x1806('0x6')),'defaultValue':_0x1806('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x1806('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb2cb=['nothing','BOOLEAN','exports','ENUM','incident','contact'];(function(_0x265cf6,_0x26f1d8){var _0x3f2737=function(_0x3d095f){while(--_0x3d095f){_0x265cf6['push'](_0x265cf6['shift']());}};_0x3f2737(++_0x26f1d8);}(_0xb2cb,0x13a));var _0xbb2c=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xb2cb[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require('sequelize');module[_0xbb2c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbb2c('0x1')](_0xbb2c('0x2'),'phonecall'),'defaultValue':_0xbb2c('0x2')},'moduleCreate':{'type':Sequelize[_0xbb2c('0x1')](_0xbb2c('0x3'),_0xbb2c('0x4')),'defaultValue':_0xbb2c('0x3'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xbb2c('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 4750398..b371033 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 _0x64cd=['undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','find','catch','create','body','getFields','findOne','Dynamics365Field','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0x64cd,0x126));var _0xd64c=function(_0x31bd8b,_0x56fa02){_0x31bd8b=_0x31bd8b-0x0;var _0x1506e4=_0x64cd[_0x31bd8b];return _0x1506e4;};'use strict';var emlformat=require(_0xd64c('0x0'));var rimraf=require(_0xd64c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd64c('0x2'));var rp=require(_0xd64c('0x3'));var moment=require('moment');var BPromise=require(_0xd64c('0x4'));var Mustache=require(_0xd64c('0x5'));var util=require('util');var path=require(_0xd64c('0x6'));var sox=require(_0xd64c('0x7'));var csv=require(_0xd64c('0x8'));var ejs=require(_0xd64c('0x9'));var fs=require('fs');var fs_extra=require(_0xd64c('0xa'));var _=require(_0xd64c('0xb'));var squel=require(_0xd64c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd64c('0xd'));var deskjs=require(_0xd64c('0xe'));var toCsv=require(_0xd64c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd64c('0xf'));var authService=require(_0xd64c('0x10'));var qs=require(_0xd64c('0x11'));var as=require(_0xd64c('0x12'));var hardwareService=require(_0xd64c('0x13'));var logger=require(_0xd64c('0x14'))(_0xd64c('0x15'));var utils=require(_0xd64c('0x16'));var config=require(_0xd64c('0x17'));var licenseUtil=require(_0xd64c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fbaaa,_0x3cb6e4){_0x3cb6e4=_0x3cb6e4||0xcc;return function(_0x3ab401){if(_0x3ab401){return _0x2fbaaa[_0xd64c('0x19')](_0x3cb6e4);}return _0x2fbaaa[_0xd64c('0x1a')](_0x3cb6e4)[_0xd64c('0x1b')]();};}function respondWithResult(_0x5892c6,_0x40d51f){_0x40d51f=_0x40d51f||0xc8;return function(_0x31605d){if(_0x31605d){return _0x5892c6[_0xd64c('0x1a')](_0x40d51f)[_0xd64c('0x1c')](_0x31605d);}};}function respondWithFilteredResult(_0xfb2bff,_0x543504){return function(_0x493cea){if(_0x493cea){var _0x26dc61=typeof _0x543504[_0xd64c('0x1d')]===_0xd64c('0x1e')&&typeof _0x543504[_0xd64c('0x1f')]===_0xd64c('0x1e');var _0x1a8f79=_0x493cea['count'];var _0x176ecd=_0x26dc61?0x0:_0x543504['offset'];var _0x171469=_0x26dc61?_0x493cea['count']:_0x543504['offset']+_0x543504[_0xd64c('0x1f')];var _0x307355;if(_0x171469>=_0x1a8f79){_0x171469=_0x1a8f79;_0x307355=0xc8;}else{_0x307355=0xce;}_0xfb2bff['status'](_0x307355);return _0xfb2bff[_0xd64c('0x20')](_0xd64c('0x21'),_0x176ecd+'-'+_0x171469+'/'+_0x1a8f79)['json'](_0x493cea);}return null;};}function patchUpdates(_0xdd48cc){return function(_0x59f7b5){try{jsonpatch[_0xd64c('0x22')](_0x59f7b5,_0xdd48cc,!![]);}catch(_0x3b9bc4){return BPromise[_0xd64c('0x23')](_0x3b9bc4);}return _0x59f7b5[_0xd64c('0x24')]();};}function saveUpdates(_0xb460fd,_0x48974d){return function(_0x1324db){if(_0x1324db){return _0x1324db[_0xd64c('0x25')](_0xb460fd)[_0xd64c('0x26')](function(_0x226548){return _0x226548;});}return null;};}function removeEntity(_0x337be3,_0xe69137){return function(_0x12b04f){if(_0x12b04f){return _0x12b04f[_0xd64c('0x27')]()[_0xd64c('0x26')](function(){_0x337be3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1747ce,_0x645473){return function(_0x3641de){if(!_0x3641de){_0x1747ce[_0xd64c('0x19')](0x194);}return _0x3641de;};}function handleError(_0x2551b8,_0x4c2236){_0x4c2236=_0x4c2236||0x1f4;return function(_0x40060f){logger[_0xd64c('0x28')](_0x40060f['stack']);if(_0x40060f[_0xd64c('0x29')]){delete _0x40060f[_0xd64c('0x29')];}_0x2551b8[_0xd64c('0x1a')](_0x4c2236)[_0xd64c('0x2a')](_0x40060f);};}exports['index']=function(_0x52a6d5,_0x5b25da){var _0x53fef9={},_0xf9725c={},_0x30b6b2={'count':0x0,'rows':[]};var _0x5d14d7=_[_0xd64c('0x2b')](db[_0xd64c('0x2c')][_0xd64c('0x2d')],function(_0x2afda6){return{'name':_0x2afda6[_0xd64c('0x2e')],'type':_0x2afda6[_0xd64c('0x2f')]['key']};});_0xf9725c['model']=_[_0xd64c('0x2b')](_0x5d14d7,_0xd64c('0x29'));_0xf9725c[_0xd64c('0x30')]=_[_0xd64c('0x31')](_0x52a6d5[_0xd64c('0x30')]);_0xf9725c[_0xd64c('0x32')]=_[_0xd64c('0x33')](_0xf9725c[_0xd64c('0x34')],_0xf9725c[_0xd64c('0x30')]);_0x53fef9[_0xd64c('0x35')]=_[_0xd64c('0x33')](_0xf9725c[_0xd64c('0x34')],qs[_0xd64c('0x36')](_0x52a6d5[_0xd64c('0x30')][_0xd64c('0x36')]));_0x53fef9[_0xd64c('0x35')]=_0x53fef9['attributes'][_0xd64c('0x37')]?_0x53fef9[_0xd64c('0x35')]:_0xf9725c[_0xd64c('0x34')];if(!_0x52a6d5[_0xd64c('0x30')][_0xd64c('0x38')]('nolimit')){_0x53fef9['limit']=qs[_0xd64c('0x1f')](_0x52a6d5[_0xd64c('0x30')][_0xd64c('0x1f')]);_0x53fef9[_0xd64c('0x1d')]=qs['offset'](_0x52a6d5[_0xd64c('0x30')][_0xd64c('0x1d')]);}_0x53fef9[_0xd64c('0x39')]=qs['sort'](_0x52a6d5[_0xd64c('0x30')][_0xd64c('0x3a')]);_0x53fef9[_0xd64c('0x3b')]=qs[_0xd64c('0x32')](_[_0xd64c('0x3c')](_0x52a6d5[_0xd64c('0x30')],_0xf9725c['filters']),_0x5d14d7);if(_0x52a6d5[_0xd64c('0x30')][_0xd64c('0x3d')]){_0x53fef9['where']=_[_0xd64c('0x3e')](_0x53fef9['where'],{'$or':_[_0xd64c('0x2b')](_0x5d14d7,function(_0x35f4bc){if(_0x35f4bc['type']!==_0xd64c('0x3f')){var _0x349482={};_0x349482[_0x35f4bc[_0xd64c('0x29')]]={'$like':'%'+_0x52a6d5[_0xd64c('0x30')]['filter']+'%'};return _0x349482;}})});}_0x53fef9=_[_0xd64c('0x3e')]({},_0x53fef9,_0x52a6d5[_0xd64c('0x40')]);var _0x160cb5={'where':_0x53fef9[_0xd64c('0x3b')]};return db[_0xd64c('0x2c')][_0xd64c('0x41')](_0x160cb5)['then'](function(_0x58b83d){_0x30b6b2['count']=_0x58b83d;if(_0x52a6d5['query'][_0xd64c('0x42')]){_0x53fef9[_0xd64c('0x43')]=[{'all':!![]}];}return db[_0xd64c('0x2c')][_0xd64c('0x44')](_0x53fef9);})['then'](function(_0x117ed1){_0x30b6b2['rows']=_0x117ed1;return _0x30b6b2;})[_0xd64c('0x26')](respondWithFilteredResult(_0x5b25da,_0x53fef9))['catch'](handleError(_0x5b25da,null));};exports[_0xd64c('0x45')]=function(_0x20f655,_0xf045b3){var _0x203a45={'raw':![],'where':{'id':_0x20f655[_0xd64c('0x46')]['id']}},_0x505d21={};_0x505d21[_0xd64c('0x34')]=_[_0xd64c('0x31')](db[_0xd64c('0x2c')][_0xd64c('0x2d')]);_0x505d21[_0xd64c('0x30')]=_[_0xd64c('0x31')](_0x20f655['query']);_0x505d21['filters']=_[_0xd64c('0x33')](_0x505d21['model'],_0x505d21['query']);_0x203a45[_0xd64c('0x35')]=_[_0xd64c('0x33')](_0x505d21[_0xd64c('0x34')],qs['fields'](_0x20f655[_0xd64c('0x30')][_0xd64c('0x36')]));_0x203a45[_0xd64c('0x35')]=_0x203a45['attributes'][_0xd64c('0x37')]?_0x203a45['attributes']:_0x505d21[_0xd64c('0x34')];if(_0x20f655[_0xd64c('0x30')][_0xd64c('0x42')]){_0x203a45[_0xd64c('0x43')]=[{'all':!![]}];}_0x203a45=_[_0xd64c('0x3e')]({},_0x203a45,_0x20f655['options']);return db['Dynamics365Configuration'][_0xd64c('0x47')](_0x203a45)[_0xd64c('0x26')](handleEntityNotFound(_0xf045b3,null))['then'](respondWithResult(_0xf045b3,null))[_0xd64c('0x48')](handleError(_0xf045b3,null));};exports['create']=function(_0x437f9d,_0x3a24dd){return db[_0xd64c('0x2c')][_0xd64c('0x49')](_0x437f9d[_0xd64c('0x4a')],{})['then'](respondWithResult(_0x3a24dd,0xc9))['catch'](handleError(_0x3a24dd,null));};exports[_0xd64c('0x25')]=function(_0x1aff8e,_0x535ad4){if(_0x1aff8e['body']['id']){delete _0x1aff8e[_0xd64c('0x4a')]['id'];}return db[_0xd64c('0x2c')][_0xd64c('0x47')]({'where':{'id':_0x1aff8e[_0xd64c('0x46')]['id']}})[_0xd64c('0x26')](handleEntityNotFound(_0x535ad4,null))[_0xd64c('0x26')](saveUpdates(_0x1aff8e[_0xd64c('0x4a')],null))['then'](respondWithResult(_0x535ad4,null))[_0xd64c('0x48')](handleError(_0x535ad4,null));};exports[_0xd64c('0x27')]=function(_0x385e39,_0x4fb552){return db['Dynamics365Configuration'][_0xd64c('0x47')]({'where':{'id':_0x385e39['params']['id']}})[_0xd64c('0x26')](handleEntityNotFound(_0x4fb552,null))[_0xd64c('0x26')](removeEntity(_0x4fb552,null))[_0xd64c('0x48')](handleError(_0x4fb552,null));};exports[_0xd64c('0x4b')]=function(_0x282e04,_0x29894d,_0x4ab18b){var _0x123edc={};var _0x5e5df0={};var _0x354acd;var _0xcdd90a;return db[_0xd64c('0x2c')][_0xd64c('0x4c')]({'where':{'id':_0x282e04['params']['id']}})['then'](handleEntityNotFound(_0x29894d,null))['then'](function(_0x2b4787){if(_0x2b4787){_0x354acd=_0x2b4787;_0x5e5df0[_0xd64c('0x34')]=_['keys'](db[_0xd64c('0x4d')][_0xd64c('0x2d')]);_0x5e5df0[_0xd64c('0x30')]=_[_0xd64c('0x31')](_0x282e04[_0xd64c('0x30')]);_0x5e5df0[_0xd64c('0x32')]=_['intersection'](_0x5e5df0[_0xd64c('0x34')],_0x5e5df0[_0xd64c('0x30')]);_0x123edc[_0xd64c('0x35')]=_[_0xd64c('0x33')](_0x5e5df0['model'],qs[_0xd64c('0x36')](_0x282e04[_0xd64c('0x30')][_0xd64c('0x36')]));_0x123edc[_0xd64c('0x35')]=_0x123edc[_0xd64c('0x35')][_0xd64c('0x37')]?_0x123edc[_0xd64c('0x35')]:_0x5e5df0['model'];_0x123edc['order']=qs['sort'](_0x282e04[_0xd64c('0x30')]['sort']);_0x123edc[_0xd64c('0x3b')]=qs['filters'](_[_0xd64c('0x3c')](_0x282e04[_0xd64c('0x30')],_0x5e5df0['filters']));if(_0x282e04['query'][_0xd64c('0x3d')]){_0x123edc[_0xd64c('0x3b')]=_['merge'](_0x123edc[_0xd64c('0x3b')],{'$or':_['map'](_0x123edc[_0xd64c('0x35')],function(_0x462d57){var _0x3593aa={};_0x3593aa[_0x462d57]={'$like':'%'+_0x282e04[_0xd64c('0x30')][_0xd64c('0x3d')]+'%'};return _0x3593aa;})});}_0x123edc=_[_0xd64c('0x3e')]({},_0x123edc,_0x282e04[_0xd64c('0x40')]);return _0x354acd[_0xd64c('0x4b')](_0x123edc);}})[_0xd64c('0x26')](function(_0x190f22){if(_0x190f22){_0xcdd90a=_0x190f22[_0xd64c('0x37')];if(!_0x282e04[_0xd64c('0x30')][_0xd64c('0x38')](_0xd64c('0x4e'))){_0x123edc[_0xd64c('0x1f')]=qs[_0xd64c('0x1f')](_0x282e04[_0xd64c('0x30')][_0xd64c('0x1f')]);_0x123edc[_0xd64c('0x1d')]=qs[_0xd64c('0x1d')](_0x282e04[_0xd64c('0x30')][_0xd64c('0x1d')]);}return _0x354acd[_0xd64c('0x4b')](_0x123edc);}})[_0xd64c('0x26')](function(_0x325bb2){if(_0x325bb2){return _0x325bb2?{'count':_0xcdd90a,'rows':_0x325bb2}:null;}})[_0xd64c('0x26')](respondWithResult(_0x29894d,null))[_0xd64c('0x48')](handleError(_0x29894d,null));};exports['getSubjects']=function(_0x3b124d,_0x48aae9,_0x4763ba){var _0x560851={};var _0x373f5a={};var _0x506332;var _0x1b2282;return db[_0xd64c('0x2c')][_0xd64c('0x4c')]({'where':{'id':_0x3b124d[_0xd64c('0x46')]['id']}})[_0xd64c('0x26')](handleEntityNotFound(_0x48aae9,null))[_0xd64c('0x26')](function(_0x4f57eb){if(_0x4f57eb){_0x506332=_0x4f57eb;_0x373f5a[_0xd64c('0x34')]=_[_0xd64c('0x31')](db['Dynamics365Field'][_0xd64c('0x2d')]);_0x373f5a[_0xd64c('0x30')]=_[_0xd64c('0x31')](_0x3b124d[_0xd64c('0x30')]);_0x373f5a[_0xd64c('0x32')]=_['intersection'](_0x373f5a['model'],_0x373f5a[_0xd64c('0x30')]);_0x560851['attributes']=_[_0xd64c('0x33')](_0x373f5a['model'],qs[_0xd64c('0x36')](_0x3b124d[_0xd64c('0x30')][_0xd64c('0x36')]));_0x560851[_0xd64c('0x35')]=_0x560851[_0xd64c('0x35')][_0xd64c('0x37')]?_0x560851[_0xd64c('0x35')]:_0x373f5a['model'];_0x560851['order']=qs[_0xd64c('0x3a')](_0x3b124d['query']['sort']);_0x560851[_0xd64c('0x3b')]=qs[_0xd64c('0x32')](_[_0xd64c('0x3c')](_0x3b124d[_0xd64c('0x30')],_0x373f5a['filters']));if(_0x3b124d[_0xd64c('0x30')][_0xd64c('0x3d')]){_0x560851[_0xd64c('0x3b')]=_[_0xd64c('0x3e')](_0x560851[_0xd64c('0x3b')],{'$or':_[_0xd64c('0x2b')](_0x560851[_0xd64c('0x35')],function(_0x145999){var _0x59c979={};_0x59c979[_0x145999]={'$like':'%'+_0x3b124d[_0xd64c('0x30')][_0xd64c('0x3d')]+'%'};return _0x59c979;})});}_0x560851=_['merge']({},_0x560851,_0x3b124d['options']);return _0x506332[_0xd64c('0x4f')](_0x560851);}})[_0xd64c('0x26')](function(_0x53a4db){if(_0x53a4db){_0x1b2282=_0x53a4db['length'];if(!_0x3b124d[_0xd64c('0x30')][_0xd64c('0x38')](_0xd64c('0x4e'))){_0x560851[_0xd64c('0x1f')]=qs[_0xd64c('0x1f')](_0x3b124d[_0xd64c('0x30')]['limit']);_0x560851[_0xd64c('0x1d')]=qs[_0xd64c('0x1d')](_0x3b124d[_0xd64c('0x30')]['offset']);}return _0x506332[_0xd64c('0x4f')](_0x560851);}})[_0xd64c('0x26')](function(_0x5643d4){if(_0x5643d4){return _0x5643d4?{'count':_0x1b2282,'rows':_0x5643d4}:null;}})[_0xd64c('0x26')](respondWithResult(_0x48aae9,null))[_0xd64c('0x48')](handleError(_0x48aae9,null));};exports[_0xd64c('0x50')]=function(_0x1714f2,_0x3a98e9,_0xa22886){var _0x4ef925={};var _0x1d14d3={};var _0x5abb6f;var _0x228283;return db[_0xd64c('0x2c')][_0xd64c('0x4c')]({'where':{'id':_0x1714f2[_0xd64c('0x46')]['id']}})[_0xd64c('0x26')](handleEntityNotFound(_0x3a98e9,null))['then'](function(_0x1fa4cc){if(_0x1fa4cc){_0x5abb6f=_0x1fa4cc;_0x1d14d3['model']=_[_0xd64c('0x31')](db[_0xd64c('0x4d')][_0xd64c('0x2d')]);_0x1d14d3['query']=_['keys'](_0x1714f2['query']);_0x1d14d3[_0xd64c('0x32')]=_[_0xd64c('0x33')](_0x1d14d3['model'],_0x1d14d3[_0xd64c('0x30')]);_0x4ef925[_0xd64c('0x35')]=_[_0xd64c('0x33')](_0x1d14d3[_0xd64c('0x34')],qs[_0xd64c('0x36')](_0x1714f2[_0xd64c('0x30')][_0xd64c('0x36')]));_0x4ef925[_0xd64c('0x35')]=_0x4ef925['attributes'][_0xd64c('0x37')]?_0x4ef925['attributes']:_0x1d14d3[_0xd64c('0x34')];_0x4ef925['order']=qs['sort'](_0x1714f2['query']['sort']);_0x4ef925[_0xd64c('0x3b')]=qs[_0xd64c('0x32')](_[_0xd64c('0x3c')](_0x1714f2[_0xd64c('0x30')],_0x1d14d3[_0xd64c('0x32')]));if(_0x1714f2['query'][_0xd64c('0x3d')]){_0x4ef925['where']=_[_0xd64c('0x3e')](_0x4ef925['where'],{'$or':_['map'](_0x4ef925['attributes'],function(_0x561c59){var _0x5cb5f0={};_0x5cb5f0[_0x561c59]={'$like':'%'+_0x1714f2[_0xd64c('0x30')][_0xd64c('0x3d')]+'%'};return _0x5cb5f0;})});}_0x4ef925=_[_0xd64c('0x3e')]({},_0x4ef925,_0x1714f2[_0xd64c('0x40')]);return _0x5abb6f[_0xd64c('0x50')](_0x4ef925);}})[_0xd64c('0x26')](function(_0x5c27dc){if(_0x5c27dc){_0x228283=_0x5c27dc[_0xd64c('0x37')];if(!_0x1714f2[_0xd64c('0x30')][_0xd64c('0x38')](_0xd64c('0x4e'))){_0x4ef925[_0xd64c('0x1f')]=qs[_0xd64c('0x1f')](_0x1714f2[_0xd64c('0x30')][_0xd64c('0x1f')]);_0x4ef925[_0xd64c('0x1d')]=qs[_0xd64c('0x1d')](_0x1714f2[_0xd64c('0x30')][_0xd64c('0x1d')]);}return _0x5abb6f[_0xd64c('0x50')](_0x4ef925);}})[_0xd64c('0x26')](function(_0x3d39b5){if(_0x3d39b5){return _0x3d39b5?{'count':_0x228283,'rows':_0x3d39b5}:null;}})[_0xd64c('0x26')](respondWithResult(_0x3a98e9,null))['catch'](handleError(_0x3a98e9,null));}; \ No newline at end of file +var _0x85f6=['rows','show','params','length','merge','find','catch','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','set','Content-Range','json','reject','save','update','then','status','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','Dynamics365Configuration','count'];(function(_0x3a1a7e,_0x40c366){var _0xd25f96=function(_0x5db72f){while(--_0x5db72f){_0x3a1a7e['push'](_0x3a1a7e['shift']());}};_0xd25f96(++_0x40c366);}(_0x85f6,0xa8));var _0x685f=function(_0x5b100b,_0xf84f9e){_0x5b100b=_0x5b100b-0x0;var _0x682aa6=_0x85f6[_0x5b100b];return _0x682aa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x685f('0x0'));var zipdir=require(_0x685f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x685f('0x2'));var BPromise=require(_0x685f('0x3'));var Mustache=require(_0x685f('0x4'));var util=require('util');var path=require(_0x685f('0x5'));var sox=require(_0x685f('0x6'));var csv=require(_0x685f('0x7'));var ejs=require(_0x685f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x685f('0x9'));var squel=require(_0x685f('0xa'));var crypto=require(_0x685f('0xb'));var jsforce=require(_0x685f('0xc'));var deskjs=require(_0x685f('0xd'));var toCsv=require(_0x685f('0x7'));var querystring=require('querystring');var Papa=require(_0x685f('0xe'));var Redis=require(_0x685f('0xf'));var authService=require(_0x685f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x685f('0x11'));var logger=require(_0x685f('0x12'))(_0x685f('0x13'));var utils=require('../../config/utils');var config=require(_0x685f('0x14'));var licenseUtil=require(_0x685f('0x15'));var db=require(_0x685f('0x16'))['db'];function respondWithStatusCode(_0x5a2e36,_0x522dc9){_0x522dc9=_0x522dc9||0xcc;return function(_0x24eb60){if(_0x24eb60){return _0x5a2e36[_0x685f('0x17')](_0x522dc9);}return _0x5a2e36['status'](_0x522dc9)[_0x685f('0x18')]();};}function respondWithResult(_0x75e49,_0x10d75f){_0x10d75f=_0x10d75f||0xc8;return function(_0x12aff5){if(_0x12aff5){return _0x75e49['status'](_0x10d75f)['json'](_0x12aff5);}};}function respondWithFilteredResult(_0x1358a9,_0x2f8da1){return function(_0x224cf5){if(_0x224cf5){var _0x35e613=typeof _0x2f8da1[_0x685f('0x19')]==='undefined'&&typeof _0x2f8da1[_0x685f('0x1a')]===_0x685f('0x1b');var _0x5a22e7=_0x224cf5['count'];var _0x4938da=_0x35e613?0x0:_0x2f8da1['offset'];var _0x1f2c57=_0x35e613?_0x224cf5['count']:_0x2f8da1[_0x685f('0x19')]+_0x2f8da1[_0x685f('0x1a')];var _0x51f018;if(_0x1f2c57>=_0x5a22e7){_0x1f2c57=_0x5a22e7;_0x51f018=0xc8;}else{_0x51f018=0xce;}_0x1358a9['status'](_0x51f018);return _0x1358a9[_0x685f('0x1c')](_0x685f('0x1d'),_0x4938da+'-'+_0x1f2c57+'/'+_0x5a22e7)[_0x685f('0x1e')](_0x224cf5);}return null;};}function patchUpdates(_0x397d17){return function(_0x3fbe6b){try{jsonpatch['apply'](_0x3fbe6b,_0x397d17,!![]);}catch(_0x56bbda){return BPromise[_0x685f('0x1f')](_0x56bbda);}return _0x3fbe6b[_0x685f('0x20')]();};}function saveUpdates(_0x2a58a8,_0x5d1530){return function(_0x4a5d3b){if(_0x4a5d3b){return _0x4a5d3b[_0x685f('0x21')](_0x2a58a8)[_0x685f('0x22')](function(_0x453fb5){return _0x453fb5;});}return null;};}function removeEntity(_0xe85dbf,_0x44f061){return function(_0x34ae6e){if(_0x34ae6e){return _0x34ae6e['destroy']()['then'](function(){_0xe85dbf[_0x685f('0x23')](0xcc)[_0x685f('0x18')]();});}};}function handleEntityNotFound(_0x49bb5f,_0x179d34){return function(_0x4c4a57){if(!_0x4c4a57){_0x49bb5f['sendStatus'](0x194);}return _0x4c4a57;};}function handleError(_0x3db400,_0x8501dc){_0x8501dc=_0x8501dc||0x1f4;return function(_0x30bd8c){logger[_0x685f('0x24')](_0x30bd8c[_0x685f('0x25')]);if(_0x30bd8c[_0x685f('0x26')]){delete _0x30bd8c['name'];}_0x3db400[_0x685f('0x23')](_0x8501dc)[_0x685f('0x27')](_0x30bd8c);};}exports[_0x685f('0x28')]=function(_0x4b4fa1,_0x16482d){var _0x5c0d0a={},_0x44d68e={},_0x1309fe={'count':0x0,'rows':[]};var _0x397dd8=_['map'](db['Dynamics365Configuration'][_0x685f('0x29')],function(_0x2be7ba){return{'name':_0x2be7ba[_0x685f('0x2a')],'type':_0x2be7ba[_0x685f('0x2b')]['key']};});_0x44d68e[_0x685f('0x2c')]=_[_0x685f('0x2d')](_0x397dd8,_0x685f('0x26'));_0x44d68e[_0x685f('0x2e')]=_[_0x685f('0x2f')](_0x4b4fa1[_0x685f('0x2e')]);_0x44d68e[_0x685f('0x30')]=_[_0x685f('0x31')](_0x44d68e[_0x685f('0x2c')],_0x44d68e[_0x685f('0x2e')]);_0x5c0d0a['attributes']=_[_0x685f('0x31')](_0x44d68e['model'],qs[_0x685f('0x32')](_0x4b4fa1['query'][_0x685f('0x32')]));_0x5c0d0a['attributes']=_0x5c0d0a[_0x685f('0x33')]['length']?_0x5c0d0a['attributes']:_0x44d68e['model'];if(!_0x4b4fa1[_0x685f('0x2e')][_0x685f('0x34')](_0x685f('0x35'))){_0x5c0d0a['limit']=qs[_0x685f('0x1a')](_0x4b4fa1[_0x685f('0x2e')][_0x685f('0x1a')]);_0x5c0d0a[_0x685f('0x19')]=qs[_0x685f('0x19')](_0x4b4fa1[_0x685f('0x2e')][_0x685f('0x19')]);}_0x5c0d0a[_0x685f('0x36')]=qs[_0x685f('0x37')](_0x4b4fa1['query']['sort']);_0x5c0d0a[_0x685f('0x38')]=qs[_0x685f('0x30')](_[_0x685f('0x39')](_0x4b4fa1[_0x685f('0x2e')],_0x44d68e['filters']),_0x397dd8);if(_0x4b4fa1[_0x685f('0x2e')][_0x685f('0x3a')]){_0x5c0d0a[_0x685f('0x38')]=_['merge'](_0x5c0d0a[_0x685f('0x38')],{'$or':_[_0x685f('0x2d')](_0x397dd8,function(_0x2b6ed6){if(_0x2b6ed6[_0x685f('0x2b')]!==_0x685f('0x3b')){var _0x602d49={};_0x602d49[_0x2b6ed6['name']]={'$like':'%'+_0x4b4fa1[_0x685f('0x2e')][_0x685f('0x3a')]+'%'};return _0x602d49;}})});}_0x5c0d0a=_['merge']({},_0x5c0d0a,_0x4b4fa1[_0x685f('0x3c')]);var _0x188211={'where':_0x5c0d0a[_0x685f('0x38')]};return db[_0x685f('0x3d')][_0x685f('0x3e')](_0x188211)[_0x685f('0x22')](function(_0x50a3b6){_0x1309fe[_0x685f('0x3e')]=_0x50a3b6;if(_0x4b4fa1[_0x685f('0x2e')]['includeAll']){_0x5c0d0a['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x5c0d0a);})[_0x685f('0x22')](function(_0x4d3974){_0x1309fe[_0x685f('0x3f')]=_0x4d3974;return _0x1309fe;})['then'](respondWithFilteredResult(_0x16482d,_0x5c0d0a))['catch'](handleError(_0x16482d,null));};exports[_0x685f('0x40')]=function(_0x578b38,_0x139db2){var _0x14ebea={'raw':![],'where':{'id':_0x578b38[_0x685f('0x41')]['id']}},_0x1390fa={};_0x1390fa[_0x685f('0x2c')]=_[_0x685f('0x2f')](db['Dynamics365Configuration']['rawAttributes']);_0x1390fa[_0x685f('0x2e')]=_['keys'](_0x578b38[_0x685f('0x2e')]);_0x1390fa[_0x685f('0x30')]=_[_0x685f('0x31')](_0x1390fa['model'],_0x1390fa[_0x685f('0x2e')]);_0x14ebea[_0x685f('0x33')]=_[_0x685f('0x31')](_0x1390fa[_0x685f('0x2c')],qs['fields'](_0x578b38[_0x685f('0x2e')][_0x685f('0x32')]));_0x14ebea[_0x685f('0x33')]=_0x14ebea[_0x685f('0x33')][_0x685f('0x42')]?_0x14ebea[_0x685f('0x33')]:_0x1390fa[_0x685f('0x2c')];if(_0x578b38[_0x685f('0x2e')]['includeAll']){_0x14ebea['include']=[{'all':!![]}];}_0x14ebea=_[_0x685f('0x43')]({},_0x14ebea,_0x578b38[_0x685f('0x3c')]);return db['Dynamics365Configuration'][_0x685f('0x44')](_0x14ebea)[_0x685f('0x22')](handleEntityNotFound(_0x139db2,null))[_0x685f('0x22')](respondWithResult(_0x139db2,null))[_0x685f('0x45')](handleError(_0x139db2,null));};exports[_0x685f('0x46')]=function(_0xc0b13b,_0x54b09f){return db[_0x685f('0x3d')][_0x685f('0x46')](_0xc0b13b[_0x685f('0x47')],{})[_0x685f('0x22')](respondWithResult(_0x54b09f,0xc9))[_0x685f('0x45')](handleError(_0x54b09f,null));};exports['update']=function(_0x213a9f,_0xb85608){if(_0x213a9f[_0x685f('0x47')]['id']){delete _0x213a9f['body']['id'];}return db[_0x685f('0x3d')][_0x685f('0x44')]({'where':{'id':_0x213a9f[_0x685f('0x41')]['id']}})[_0x685f('0x22')](handleEntityNotFound(_0xb85608,null))[_0x685f('0x22')](saveUpdates(_0x213a9f[_0x685f('0x47')],null))[_0x685f('0x22')](respondWithResult(_0xb85608,null))[_0x685f('0x45')](handleError(_0xb85608,null));};exports['destroy']=function(_0x10f346,_0x27f17a){return db['Dynamics365Configuration'][_0x685f('0x44')]({'where':{'id':_0x10f346['params']['id']}})['then'](handleEntityNotFound(_0x27f17a,null))[_0x685f('0x22')](removeEntity(_0x27f17a,null))['catch'](handleError(_0x27f17a,null));};exports[_0x685f('0x48')]=function(_0x18ed7b,_0x12f6d8,_0x2c47e8){var _0x1a6f4b={};var _0x1ffb10={};var _0x48edb5;var _0x263a69;return db[_0x685f('0x3d')][_0x685f('0x49')]({'where':{'id':_0x18ed7b[_0x685f('0x41')]['id']}})[_0x685f('0x22')](handleEntityNotFound(_0x12f6d8,null))['then'](function(_0x147223){if(_0x147223){_0x48edb5=_0x147223;_0x1ffb10[_0x685f('0x2c')]=_['keys'](db[_0x685f('0x4a')]['rawAttributes']);_0x1ffb10[_0x685f('0x2e')]=_[_0x685f('0x2f')](_0x18ed7b['query']);_0x1ffb10['filters']=_[_0x685f('0x31')](_0x1ffb10[_0x685f('0x2c')],_0x1ffb10['query']);_0x1a6f4b['attributes']=_[_0x685f('0x31')](_0x1ffb10['model'],qs[_0x685f('0x32')](_0x18ed7b[_0x685f('0x2e')]['fields']));_0x1a6f4b[_0x685f('0x33')]=_0x1a6f4b[_0x685f('0x33')][_0x685f('0x42')]?_0x1a6f4b[_0x685f('0x33')]:_0x1ffb10[_0x685f('0x2c')];_0x1a6f4b[_0x685f('0x36')]=qs[_0x685f('0x37')](_0x18ed7b[_0x685f('0x2e')][_0x685f('0x37')]);_0x1a6f4b[_0x685f('0x38')]=qs[_0x685f('0x30')](_[_0x685f('0x39')](_0x18ed7b['query'],_0x1ffb10['filters']));if(_0x18ed7b[_0x685f('0x2e')]['filter']){_0x1a6f4b[_0x685f('0x38')]=_[_0x685f('0x43')](_0x1a6f4b[_0x685f('0x38')],{'$or':_[_0x685f('0x2d')](_0x1a6f4b[_0x685f('0x33')],function(_0x4f2d03){var _0x1a2fdb={};_0x1a2fdb[_0x4f2d03]={'$like':'%'+_0x18ed7b[_0x685f('0x2e')][_0x685f('0x3a')]+'%'};return _0x1a2fdb;})});}_0x1a6f4b=_[_0x685f('0x43')]({},_0x1a6f4b,_0x18ed7b['options']);return _0x48edb5[_0x685f('0x48')](_0x1a6f4b);}})[_0x685f('0x22')](function(_0x1802d1){if(_0x1802d1){_0x263a69=_0x1802d1[_0x685f('0x42')];if(!_0x18ed7b[_0x685f('0x2e')][_0x685f('0x34')](_0x685f('0x35'))){_0x1a6f4b[_0x685f('0x1a')]=qs[_0x685f('0x1a')](_0x18ed7b[_0x685f('0x2e')][_0x685f('0x1a')]);_0x1a6f4b[_0x685f('0x19')]=qs[_0x685f('0x19')](_0x18ed7b[_0x685f('0x2e')][_0x685f('0x19')]);}return _0x48edb5[_0x685f('0x48')](_0x1a6f4b);}})[_0x685f('0x22')](function(_0x119785){if(_0x119785){return _0x119785?{'count':_0x263a69,'rows':_0x119785}:null;}})[_0x685f('0x22')](respondWithResult(_0x12f6d8,null))[_0x685f('0x45')](handleError(_0x12f6d8,null));};exports['getSubjects']=function(_0x2ebbe1,_0x19edf6,_0x4bcbba){var _0x295e8f={};var _0x4b0d41={};var _0x2abd95;var _0x4afc16;return db['Dynamics365Configuration'][_0x685f('0x49')]({'where':{'id':_0x2ebbe1[_0x685f('0x41')]['id']}})[_0x685f('0x22')](handleEntityNotFound(_0x19edf6,null))['then'](function(_0x36f864){if(_0x36f864){_0x2abd95=_0x36f864;_0x4b0d41[_0x685f('0x2c')]=_[_0x685f('0x2f')](db['Dynamics365Field']['rawAttributes']);_0x4b0d41[_0x685f('0x2e')]=_[_0x685f('0x2f')](_0x2ebbe1[_0x685f('0x2e')]);_0x4b0d41[_0x685f('0x30')]=_['intersection'](_0x4b0d41[_0x685f('0x2c')],_0x4b0d41[_0x685f('0x2e')]);_0x295e8f[_0x685f('0x33')]=_['intersection'](_0x4b0d41[_0x685f('0x2c')],qs[_0x685f('0x32')](_0x2ebbe1[_0x685f('0x2e')][_0x685f('0x32')]));_0x295e8f[_0x685f('0x33')]=_0x295e8f[_0x685f('0x33')][_0x685f('0x42')]?_0x295e8f[_0x685f('0x33')]:_0x4b0d41['model'];_0x295e8f[_0x685f('0x36')]=qs['sort'](_0x2ebbe1[_0x685f('0x2e')][_0x685f('0x37')]);_0x295e8f['where']=qs[_0x685f('0x30')](_['pick'](_0x2ebbe1['query'],_0x4b0d41[_0x685f('0x30')]));if(_0x2ebbe1[_0x685f('0x2e')][_0x685f('0x3a')]){_0x295e8f[_0x685f('0x38')]=_[_0x685f('0x43')](_0x295e8f[_0x685f('0x38')],{'$or':_[_0x685f('0x2d')](_0x295e8f[_0x685f('0x33')],function(_0x265db9){var _0x4cc773={};_0x4cc773[_0x265db9]={'$like':'%'+_0x2ebbe1[_0x685f('0x2e')][_0x685f('0x3a')]+'%'};return _0x4cc773;})});}_0x295e8f=_[_0x685f('0x43')]({},_0x295e8f,_0x2ebbe1[_0x685f('0x3c')]);return _0x2abd95[_0x685f('0x4b')](_0x295e8f);}})[_0x685f('0x22')](function(_0x23d0c5){if(_0x23d0c5){_0x4afc16=_0x23d0c5['length'];if(!_0x2ebbe1['query'][_0x685f('0x34')](_0x685f('0x35'))){_0x295e8f['limit']=qs[_0x685f('0x1a')](_0x2ebbe1[_0x685f('0x2e')][_0x685f('0x1a')]);_0x295e8f[_0x685f('0x19')]=qs[_0x685f('0x19')](_0x2ebbe1['query'][_0x685f('0x19')]);}return _0x2abd95[_0x685f('0x4b')](_0x295e8f);}})[_0x685f('0x22')](function(_0x30e68a){if(_0x30e68a){return _0x30e68a?{'count':_0x4afc16,'rows':_0x30e68a}:null;}})[_0x685f('0x22')](respondWithResult(_0x19edf6,null))[_0x685f('0x45')](handleError(_0x19edf6,null));};exports[_0x685f('0x4c')]=function(_0x24d371,_0x151541,_0x580d55){var _0x3a67cb={};var _0xe1ba99={};var _0x282029;var _0x5d5a9d;return db[_0x685f('0x3d')][_0x685f('0x49')]({'where':{'id':_0x24d371[_0x685f('0x41')]['id']}})[_0x685f('0x22')](handleEntityNotFound(_0x151541,null))[_0x685f('0x22')](function(_0x3a5f5d){if(_0x3a5f5d){_0x282029=_0x3a5f5d;_0xe1ba99[_0x685f('0x2c')]=_['keys'](db[_0x685f('0x4a')][_0x685f('0x29')]);_0xe1ba99[_0x685f('0x2e')]=_[_0x685f('0x2f')](_0x24d371[_0x685f('0x2e')]);_0xe1ba99['filters']=_['intersection'](_0xe1ba99[_0x685f('0x2c')],_0xe1ba99[_0x685f('0x2e')]);_0x3a67cb[_0x685f('0x33')]=_['intersection'](_0xe1ba99[_0x685f('0x2c')],qs[_0x685f('0x32')](_0x24d371[_0x685f('0x2e')][_0x685f('0x32')]));_0x3a67cb[_0x685f('0x33')]=_0x3a67cb['attributes'][_0x685f('0x42')]?_0x3a67cb[_0x685f('0x33')]:_0xe1ba99['model'];_0x3a67cb[_0x685f('0x36')]=qs[_0x685f('0x37')](_0x24d371[_0x685f('0x2e')][_0x685f('0x37')]);_0x3a67cb[_0x685f('0x38')]=qs[_0x685f('0x30')](_[_0x685f('0x39')](_0x24d371[_0x685f('0x2e')],_0xe1ba99[_0x685f('0x30')]));if(_0x24d371[_0x685f('0x2e')][_0x685f('0x3a')]){_0x3a67cb[_0x685f('0x38')]=_[_0x685f('0x43')](_0x3a67cb[_0x685f('0x38')],{'$or':_[_0x685f('0x2d')](_0x3a67cb[_0x685f('0x33')],function(_0x5ebeeb){var _0x582091={};_0x582091[_0x5ebeeb]={'$like':'%'+_0x24d371[_0x685f('0x2e')][_0x685f('0x3a')]+'%'};return _0x582091;})});}_0x3a67cb=_[_0x685f('0x43')]({},_0x3a67cb,_0x24d371[_0x685f('0x3c')]);return _0x282029[_0x685f('0x4c')](_0x3a67cb);}})[_0x685f('0x22')](function(_0x1273d0){if(_0x1273d0){_0x5d5a9d=_0x1273d0[_0x685f('0x42')];if(!_0x24d371[_0x685f('0x2e')][_0x685f('0x34')](_0x685f('0x35'))){_0x3a67cb[_0x685f('0x1a')]=qs[_0x685f('0x1a')](_0x24d371[_0x685f('0x2e')][_0x685f('0x1a')]);_0x3a67cb[_0x685f('0x19')]=qs['offset'](_0x24d371[_0x685f('0x2e')]['offset']);}return _0x282029[_0x685f('0x4c')](_0x3a67cb);}})[_0x685f('0x22')](function(_0x446bc1){if(_0x446bc1){return _0x446bc1?{'count':_0x5d5a9d,'rows':_0x446bc1}:null;}})['then'](respondWithResult(_0x151541,null))['catch'](handleError(_0x151541,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 9498f0f..2f6fc05 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x3a7f17,_0x80f296){var _0x51a90c=function(_0x31f65a){while(--_0x31f65a){_0x3a7f17['push'](_0x3a7f17['shift']());}};_0x51a90c(++_0x80f296);}(_0x9f62,0x154));var _0x29f6=function(_0x237ca6,_0x5add49){_0x237ca6=_0x237ca6-0x0;var _0x21df2f=_0x9f62[_0x237ca6];return _0x21df2f;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x2b1cdd,_0x1c47ef){var _0xc554f2=function(_0x4ad4e8){while(--_0x4ad4e8){_0x2b1cdd['push'](_0x2b1cdd['shift']());}};_0xc554f2(++_0x1c47ef);}(_0x3e74,0x175));var _0x43e7=function(_0x475d99,_0x17162a){_0x475d99=_0x475d99-0x0;var _0x92a3ad=_0x3e74[_0x475d99];return _0x92a3ad;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 7f0765e..8aa85e1 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 _0x491a=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x24b0e4,_0x227012){var _0x1b732e=function(_0x2cd2d3){while(--_0x2cd2d3){_0x24b0e4['push'](_0x24b0e4['shift']());}};_0x1b732e(++_0x227012);}(_0x491a,0xfd));var _0xa491=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x491a[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0xa491('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa491('0x1'));var rs=require(_0xa491('0x2'));var fs=require('fs');var Redis=require(_0xa491('0x3'));var db=require(_0xa491('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa491('0x5'))(_0xa491('0x6'));var config=require('../../config/environment');var jayson=require(_0xa491('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2eeff7,_0x5c9b36,_0x2b7c23){return new BPromise(function(_0x3033bf,_0xc03108){return client[_0xa491('0x8')](_0x2eeff7,_0x2b7c23)[_0xa491('0x9')](function(_0x40870c){logger['info'](_0xa491('0xa'),_0x5c9b36,_0xa491('0xb'));logger[_0xa491('0xc')](_0xa491('0xd'),_0x5c9b36,'request\x20sent',JSON[_0xa491('0xe')](_0x40870c));if(_0x40870c['error']){if(_0x40870c[_0xa491('0xf')][_0xa491('0x10')]===0x1f4){logger[_0xa491('0xf')](_0xa491('0xa'),_0x5c9b36,_0x40870c['error'][_0xa491('0x11')]);return _0xc03108(_0x40870c[_0xa491('0xf')]['message']);}logger[_0xa491('0xf')](_0xa491('0xa'),_0x5c9b36,_0x40870c[_0xa491('0xf')][_0xa491('0x11')]);return _0x3033bf(_0x40870c[_0xa491('0xf')][_0xa491('0x11')]);}else{logger[_0xa491('0x12')](_0xa491('0xa'),_0x5c9b36,'request\x20sent');_0x3033bf(_0x40870c[_0xa491('0x13')][_0xa491('0x11')]);}})[_0xa491('0x14')](function(_0x7d330b){logger['error'](_0xa491('0xa'),_0x5c9b36,_0x7d330b);_0xc03108(_0x7d330b);});});} \ No newline at end of file +var _0x90ed=['http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x59bcbf,_0x16bf47){var _0x42bec3=function(_0x290b72){while(--_0x290b72){_0x59bcbf['push'](_0x59bcbf['shift']());}};_0x42bec3(++_0x16bf47);}(_0x90ed,0x6e));var _0xd90e=function(_0x196478,_0x9dfb92){_0x196478=_0x196478-0x0;var _0x1e8251=_0x90ed[_0x196478];return _0x1e8251;};'use strict';var _=require('lodash');var util=require(_0xd90e('0x0'));var moment=require(_0xd90e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd90e('0x2'));var db=require(_0xd90e('0x3'))['db'];var utils=require(_0xd90e('0x4'));var logger=require(_0xd90e('0x5'))(_0xd90e('0x6'));var config=require(_0xd90e('0x7'));var jayson=require(_0xd90e('0x8'));var client=jayson[_0xd90e('0x9')][_0xd90e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x122730,_0x3ba834,_0x4d4157){return new BPromise(function(_0x18ab64,_0x37e3bc){return client[_0xd90e('0xb')](_0x122730,_0x4d4157)[_0xd90e('0xc')](function(_0xf8a529){logger[_0xd90e('0xd')](_0xd90e('0xe'),_0x3ba834,_0xd90e('0xf'));logger[_0xd90e('0x10')](_0xd90e('0x11'),_0x3ba834,'request\x20sent',JSON[_0xd90e('0x12')](_0xf8a529));if(_0xf8a529[_0xd90e('0x13')]){if(_0xf8a529[_0xd90e('0x13')][_0xd90e('0x14')]===0x1f4){logger[_0xd90e('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3ba834,_0xf8a529[_0xd90e('0x13')][_0xd90e('0x15')]);return _0x37e3bc(_0xf8a529[_0xd90e('0x13')]['message']);}logger[_0xd90e('0x13')](_0xd90e('0xe'),_0x3ba834,_0xf8a529['error'][_0xd90e('0x15')]);return _0x18ab64(_0xf8a529[_0xd90e('0x13')][_0xd90e('0x15')]);}else{logger[_0xd90e('0xd')](_0xd90e('0xe'),_0x3ba834,_0xd90e('0xf'));_0x18ab64(_0xf8a529[_0xd90e('0x16')][_0xd90e('0x15')]);}})[_0xd90e('0x17')](function(_0x474bf0){logger[_0xd90e('0x13')](_0xd90e('0xe'),_0x3ba834,_0x474bf0);_0x37e3bc(_0x474bf0);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index cd05943..f5e6aa3 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 _0x0942=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x34ddc9,_0x5edf60){var _0x8ca749=function(_0x4ae437){while(--_0x4ae437){_0x34ddc9['push'](_0x34ddc9['shift']());}};_0x8ca749(++_0x5edf60);}(_0x0942,0x1f4));var _0x2094=function(_0x2f638e,_0x130615){_0x2f638e=_0x2f638e-0x0;var _0x27053e=_0x0942[_0x2f638e];return _0x27053e;};'use strict';var multer=require('multer');var util=require(_0x2094('0x0'));var path=require(_0x2094('0x1'));var timeout=require(_0x2094('0x2'));var express=require('express');var router=express[_0x2094('0x3')]();var fs_extra=require(_0x2094('0x4'));var auth=require(_0x2094('0x5'));var interaction=require(_0x2094('0x6'));var config=require(_0x2094('0x7'));var controller=require(_0x2094('0x8'));router[_0x2094('0x9')]('/',auth[_0x2094('0xa')](),controller[_0x2094('0xb')]);router[_0x2094('0x9')](_0x2094('0xc'),auth[_0x2094('0xa')](),controller[_0x2094('0xd')]);router[_0x2094('0xe')]('/',auth['isAuthenticated'](),controller[_0x2094('0xf')]);router[_0x2094('0x10')](_0x2094('0xc'),auth[_0x2094('0xa')](),controller[_0x2094('0x11')]);router[_0x2094('0x12')](_0x2094('0xc'),auth[_0x2094('0xa')](),controller[_0x2094('0x13')]);module[_0x2094('0x14')]=router; \ No newline at end of file +var _0xbe6f=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','put','delete'];(function(_0x3a0d6b,_0x5f7469){var _0x3eca23=function(_0x187ee5){while(--_0x187ee5){_0x3a0d6b['push'](_0x3a0d6b['shift']());}};_0x3eca23(++_0x5f7469);}(_0xbe6f,0xcd));var _0xfbe6=function(_0x1d5c80,_0x70efa3){_0x1d5c80=_0x1d5c80-0x0;var _0x22e006=_0xbe6f[_0x1d5c80];return _0x22e006;};'use strict';var multer=require(_0xfbe6('0x0'));var util=require(_0xfbe6('0x1'));var path=require(_0xfbe6('0x2'));var timeout=require('connect-timeout');var express=require(_0xfbe6('0x3'));var router=express[_0xfbe6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfbe6('0x5'));var interaction=require(_0xfbe6('0x6'));var config=require('../../config/environment');var controller=require(_0xfbe6('0x7'));router[_0xfbe6('0x8')]('/',auth[_0xfbe6('0x9')](),controller[_0xfbe6('0xa')]);router[_0xfbe6('0x8')](_0xfbe6('0xb'),auth['isAuthenticated'](),controller[_0xfbe6('0xc')]);router[_0xfbe6('0xd')]('/',auth[_0xfbe6('0x9')](),controller['create']);router[_0xfbe6('0xe')](_0xfbe6('0xb'),auth[_0xfbe6('0x9')](),controller['update']);router[_0xfbe6('0xf')]('/:id',auth[_0xfbe6('0x9')](),controller['destroy']);module[_0xfbe6('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 19a05be..d498ca3 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 _0x93a6=['picklist','STRING','customVariable','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x93a6,0xc9));var _0x693a=function(_0x4737a0,_0x36520e){_0x4737a0=_0x4737a0-0x0;var _0x4d558b=_0x93a6[_0x4737a0];return _0x4d558b;};'use strict';var Sequelize=require(_0x693a('0x0'));module[_0x693a('0x1')]={'type':{'type':Sequelize[_0x693a('0x2')](_0x693a('0x3'),_0x693a('0x4'),'customVariable',_0x693a('0x5'),_0x693a('0x6')),'defaultValue':_0x693a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x693a('0x7')]},'keyType':{'type':Sequelize[_0x693a('0x2')](_0x693a('0x3'),_0x693a('0x4'),_0x693a('0x8'))},'keyContent':{'type':Sequelize[_0x693a('0x7')]},'idField':{'type':Sequelize[_0x693a('0x7')]},'nameField':{'type':Sequelize[_0x693a('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x25ba=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING','customVariable'];(function(_0x44d09c,_0x4a8c0f){var _0x24fcf5=function(_0x46a023){while(--_0x46a023){_0x44d09c['push'](_0x44d09c['shift']());}};_0x24fcf5(++_0x4a8c0f);}(_0x25ba,0x18d));var _0xa25b=function(_0x38502b,_0x393d71){_0x38502b=_0x38502b-0x0;var _0x1d0cee=_0x25ba[_0x38502b];return _0x1d0cee;};'use strict';var Sequelize=require(_0xa25b('0x0'));module[_0xa25b('0x1')]={'type':{'type':Sequelize[_0xa25b('0x2')](_0xa25b('0x3'),'variable','customVariable',_0xa25b('0x4'),_0xa25b('0x5')),'defaultValue':_0xa25b('0x3')},'content':{'type':Sequelize[_0xa25b('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa25b('0x2')](_0xa25b('0x3'),'variable',_0xa25b('0x7'))},'keyContent':{'type':Sequelize[_0xa25b('0x6')]},'idField':{'type':Sequelize[_0xa25b('0x6')]},'nameField':{'type':Sequelize[_0xa25b('0x6')]},'customField':{'type':Sequelize[_0xa25b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa25b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 5599606..a44bcb1 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 _0xb7c9=['include','findAll','rows','catch','show','fields','find','create','body','destroy','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x288244,_0x3e68c1){var _0x47dc29=function(_0x15ef0a){while(--_0x15ef0a){_0x288244['push'](_0x288244['shift']());}};_0x47dc29(++_0x3e68c1);}(_0xb7c9,0xe8));var _0x9b7c=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xb7c9[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9b7c('0x0'));var jsonpatch=require(_0x9b7c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b7c('0x2'));var Mustache=require(_0x9b7c('0x3'));var util=require('util');var path=require(_0x9b7c('0x4'));var sox=require('sox');var csv=require(_0x9b7c('0x5'));var ejs=require(_0x9b7c('0x6'));var fs=require('fs');var fs_extra=require(_0x9b7c('0x7'));var _=require(_0x9b7c('0x8'));var squel=require(_0x9b7c('0x9'));var crypto=require(_0x9b7c('0xa'));var jsforce=require(_0x9b7c('0xb'));var deskjs=require(_0x9b7c('0xc'));var toCsv=require(_0x9b7c('0x5'));var querystring=require(_0x9b7c('0xd'));var Papa=require(_0x9b7c('0xe'));var Redis=require(_0x9b7c('0xf'));var authService=require(_0x9b7c('0x10'));var qs=require(_0x9b7c('0x11'));var as=require(_0x9b7c('0x12'));var hardwareService=require(_0x9b7c('0x13'));var logger=require(_0x9b7c('0x14'))(_0x9b7c('0x15'));var utils=require('../../config/utils');var config=require(_0x9b7c('0x16'));var licenseUtil=require(_0x9b7c('0x17'));var db=require(_0x9b7c('0x18'))['db'];function respondWithStatusCode(_0x10bf23,_0x2d4997){_0x2d4997=_0x2d4997||0xcc;return function(_0x284368){if(_0x284368){return _0x10bf23[_0x9b7c('0x19')](_0x2d4997);}return _0x10bf23[_0x9b7c('0x1a')](_0x2d4997)[_0x9b7c('0x1b')]();};}function respondWithResult(_0x403654,_0x17005c){_0x17005c=_0x17005c||0xc8;return function(_0x328c85){if(_0x328c85){return _0x403654[_0x9b7c('0x1a')](_0x17005c)[_0x9b7c('0x1c')](_0x328c85);}};}function respondWithFilteredResult(_0x259c50,_0x240b24){return function(_0x2b4a22){if(_0x2b4a22){var _0x2e77a2=typeof _0x240b24[_0x9b7c('0x1d')]===_0x9b7c('0x1e')&&typeof _0x240b24[_0x9b7c('0x1f')]===_0x9b7c('0x1e');var _0x22b62b=_0x2b4a22[_0x9b7c('0x20')];var _0x29a952=_0x2e77a2?0x0:_0x240b24['offset'];var _0x2b2b77=_0x2e77a2?_0x2b4a22[_0x9b7c('0x20')]:_0x240b24[_0x9b7c('0x1d')]+_0x240b24[_0x9b7c('0x1f')];var _0x556ba7;if(_0x2b2b77>=_0x22b62b){_0x2b2b77=_0x22b62b;_0x556ba7=0xc8;}else{_0x556ba7=0xce;}_0x259c50[_0x9b7c('0x1a')](_0x556ba7);return _0x259c50['set'](_0x9b7c('0x21'),_0x29a952+'-'+_0x2b2b77+'/'+_0x22b62b)[_0x9b7c('0x1c')](_0x2b4a22);}return null;};}function patchUpdates(_0x4c7b91){return function(_0x250154){try{jsonpatch['apply'](_0x250154,_0x4c7b91,!![]);}catch(_0x502560){return BPromise[_0x9b7c('0x22')](_0x502560);}return _0x250154[_0x9b7c('0x23')]();};}function saveUpdates(_0x550570,_0x3010c1){return function(_0xbb9db3){if(_0xbb9db3){return _0xbb9db3[_0x9b7c('0x24')](_0x550570)[_0x9b7c('0x25')](function(_0x3cf5b4){return _0x3cf5b4;});}return null;};}function removeEntity(_0x4c9d11,_0x2e8ffe){return function(_0x25670b){if(_0x25670b){return _0x25670b['destroy']()['then'](function(){_0x4c9d11[_0x9b7c('0x1a')](0xcc)[_0x9b7c('0x1b')]();});}};}function handleEntityNotFound(_0x27df42,_0x155f34){return function(_0x36c26c){if(!_0x36c26c){_0x27df42['sendStatus'](0x194);}return _0x36c26c;};}function handleError(_0x12665e,_0x4d51d4){_0x4d51d4=_0x4d51d4||0x1f4;return function(_0x1fa9d6){logger[_0x9b7c('0x26')](_0x1fa9d6[_0x9b7c('0x27')]);if(_0x1fa9d6[_0x9b7c('0x28')]){delete _0x1fa9d6['name'];}_0x12665e['status'](_0x4d51d4)[_0x9b7c('0x29')](_0x1fa9d6);};}exports[_0x9b7c('0x2a')]=function(_0x442848,_0x505a57){var _0x38a7f8={},_0x1a95f3={},_0x217bc8={'count':0x0,'rows':[]};var _0x4d96cf=_[_0x9b7c('0x2b')](db[_0x9b7c('0x2c')][_0x9b7c('0x2d')],function(_0x26d139){return{'name':_0x26d139['fieldName'],'type':_0x26d139[_0x9b7c('0x2e')][_0x9b7c('0x2f')]};});_0x1a95f3[_0x9b7c('0x30')]=_['map'](_0x4d96cf,_0x9b7c('0x28'));_0x1a95f3[_0x9b7c('0x31')]=_[_0x9b7c('0x32')](_0x442848[_0x9b7c('0x31')]);_0x1a95f3[_0x9b7c('0x33')]=_['intersection'](_0x1a95f3[_0x9b7c('0x30')],_0x1a95f3['query']);_0x38a7f8[_0x9b7c('0x34')]=_[_0x9b7c('0x35')](_0x1a95f3['model'],qs['fields'](_0x442848['query']['fields']));_0x38a7f8[_0x9b7c('0x34')]=_0x38a7f8['attributes'][_0x9b7c('0x36')]?_0x38a7f8[_0x9b7c('0x34')]:_0x1a95f3[_0x9b7c('0x30')];if(!_0x442848[_0x9b7c('0x31')][_0x9b7c('0x37')]('nolimit')){_0x38a7f8[_0x9b7c('0x1f')]=qs[_0x9b7c('0x1f')](_0x442848['query'][_0x9b7c('0x1f')]);_0x38a7f8[_0x9b7c('0x1d')]=qs['offset'](_0x442848[_0x9b7c('0x31')]['offset']);}_0x38a7f8[_0x9b7c('0x38')]=qs[_0x9b7c('0x39')](_0x442848['query'][_0x9b7c('0x39')]);_0x38a7f8[_0x9b7c('0x3a')]=qs['filters'](_[_0x9b7c('0x3b')](_0x442848[_0x9b7c('0x31')],_0x1a95f3[_0x9b7c('0x33')]),_0x4d96cf);if(_0x442848[_0x9b7c('0x31')][_0x9b7c('0x3c')]){_0x38a7f8[_0x9b7c('0x3a')]=_[_0x9b7c('0x3d')](_0x38a7f8[_0x9b7c('0x3a')],{'$or':_[_0x9b7c('0x2b')](_0x4d96cf,function(_0x539813){if(_0x539813[_0x9b7c('0x2e')]!==_0x9b7c('0x3e')){var _0x5195d0={};_0x5195d0[_0x539813[_0x9b7c('0x28')]]={'$like':'%'+_0x442848[_0x9b7c('0x31')][_0x9b7c('0x3c')]+'%'};return _0x5195d0;}})});}_0x38a7f8=_[_0x9b7c('0x3d')]({},_0x38a7f8,_0x442848[_0x9b7c('0x3f')]);var _0x330cbf={'where':_0x38a7f8['where']};return db['Dynamics365Field'][_0x9b7c('0x20')](_0x330cbf)[_0x9b7c('0x25')](function(_0x38412f){_0x217bc8[_0x9b7c('0x20')]=_0x38412f;if(_0x442848[_0x9b7c('0x31')]['includeAll']){_0x38a7f8[_0x9b7c('0x40')]=[{'all':!![]}];}return db[_0x9b7c('0x2c')][_0x9b7c('0x41')](_0x38a7f8);})[_0x9b7c('0x25')](function(_0xfb621){_0x217bc8[_0x9b7c('0x42')]=_0xfb621;return _0x217bc8;})[_0x9b7c('0x25')](respondWithFilteredResult(_0x505a57,_0x38a7f8))[_0x9b7c('0x43')](handleError(_0x505a57,null));};exports[_0x9b7c('0x44')]=function(_0x35b4d2,_0x4224b2){var _0x1280e9={'raw':!![],'where':{'id':_0x35b4d2['params']['id']}},_0x106875={};_0x106875[_0x9b7c('0x30')]=_[_0x9b7c('0x32')](db[_0x9b7c('0x2c')][_0x9b7c('0x2d')]);_0x106875[_0x9b7c('0x31')]=_[_0x9b7c('0x32')](_0x35b4d2[_0x9b7c('0x31')]);_0x106875[_0x9b7c('0x33')]=_[_0x9b7c('0x35')](_0x106875['model'],_0x106875['query']);_0x1280e9['attributes']=_['intersection'](_0x106875[_0x9b7c('0x30')],qs[_0x9b7c('0x45')](_0x35b4d2[_0x9b7c('0x31')]['fields']));_0x1280e9[_0x9b7c('0x34')]=_0x1280e9['attributes'][_0x9b7c('0x36')]?_0x1280e9['attributes']:_0x106875[_0x9b7c('0x30')];if(_0x35b4d2[_0x9b7c('0x31')]['includeAll']){_0x1280e9['include']=[{'all':!![]}];}_0x1280e9=_[_0x9b7c('0x3d')]({},_0x1280e9,_0x35b4d2[_0x9b7c('0x3f')]);return db['Dynamics365Field'][_0x9b7c('0x46')](_0x1280e9)[_0x9b7c('0x25')](handleEntityNotFound(_0x4224b2,null))[_0x9b7c('0x25')](respondWithResult(_0x4224b2,null))['catch'](handleError(_0x4224b2,null));};exports['create']=function(_0xadf002,_0x5956c3){return db[_0x9b7c('0x2c')][_0x9b7c('0x47')](_0xadf002[_0x9b7c('0x48')],{})[_0x9b7c('0x25')](respondWithResult(_0x5956c3,0xc9))['catch'](handleError(_0x5956c3,null));};exports[_0x9b7c('0x24')]=function(_0x341c3b,_0x441775){if(_0x341c3b['body']['id']){delete _0x341c3b[_0x9b7c('0x48')]['id'];}return db[_0x9b7c('0x2c')][_0x9b7c('0x46')]({'where':{'id':_0x341c3b['params']['id']}})[_0x9b7c('0x25')](handleEntityNotFound(_0x441775,null))[_0x9b7c('0x25')](saveUpdates(_0x341c3b[_0x9b7c('0x48')],null))['then'](respondWithResult(_0x441775,null))['catch'](handleError(_0x441775,null));};exports[_0x9b7c('0x49')]=function(_0x4acd4b,_0x5611a6){return db[_0x9b7c('0x2c')][_0x9b7c('0x46')]({'where':{'id':_0x4acd4b['params']['id']}})[_0x9b7c('0x25')](handleEntityNotFound(_0x5611a6,null))[_0x9b7c('0x25')](removeEntity(_0x5611a6,null))[_0x9b7c('0x43')](handleError(_0x5611a6,null));}; \ No newline at end of file +var _0xecc5=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','Dynamics365Field','includeAll','findAll','show','params','include','create','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xecc5,0x124));var _0x5ecc=function(_0x3efcab,_0x228866){_0x3efcab=_0x3efcab-0x0;var _0x5d2621=_0xecc5[_0x3efcab];return _0x5d2621;};'use strict';var emlformat=require(_0x5ecc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ecc('0x1'));var jsonpatch=require(_0x5ecc('0x2'));var rp=require(_0x5ecc('0x3'));var moment=require(_0x5ecc('0x4'));var BPromise=require(_0x5ecc('0x5'));var Mustache=require(_0x5ecc('0x6'));var util=require(_0x5ecc('0x7'));var path=require(_0x5ecc('0x8'));var sox=require(_0x5ecc('0x9'));var csv=require(_0x5ecc('0xa'));var ejs=require(_0x5ecc('0xb'));var fs=require('fs');var fs_extra=require(_0x5ecc('0xc'));var _=require(_0x5ecc('0xd'));var squel=require(_0x5ecc('0xe'));var crypto=require(_0x5ecc('0xf'));var jsforce=require(_0x5ecc('0x10'));var deskjs=require(_0x5ecc('0x11'));var toCsv=require(_0x5ecc('0xa'));var querystring=require(_0x5ecc('0x12'));var Papa=require(_0x5ecc('0x13'));var Redis=require(_0x5ecc('0x14'));var authService=require(_0x5ecc('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x5ecc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ecc('0x17'))(_0x5ecc('0x18'));var utils=require(_0x5ecc('0x19'));var config=require(_0x5ecc('0x1a'));var licenseUtil=require(_0x5ecc('0x1b'));var db=require(_0x5ecc('0x1c'))['db'];function respondWithStatusCode(_0x247561,_0x257d99){_0x257d99=_0x257d99||0xcc;return function(_0x1af534){if(_0x1af534){return _0x247561[_0x5ecc('0x1d')](_0x257d99);}return _0x247561[_0x5ecc('0x1e')](_0x257d99)[_0x5ecc('0x1f')]();};}function respondWithResult(_0x2f74be,_0x4ec0e4){_0x4ec0e4=_0x4ec0e4||0xc8;return function(_0x1b2d65){if(_0x1b2d65){return _0x2f74be[_0x5ecc('0x1e')](_0x4ec0e4)[_0x5ecc('0x20')](_0x1b2d65);}};}function respondWithFilteredResult(_0x33af8b,_0x1b3696){return function(_0x438222){if(_0x438222){var _0x13e935=typeof _0x1b3696[_0x5ecc('0x21')]===_0x5ecc('0x22')&&typeof _0x1b3696[_0x5ecc('0x23')]===_0x5ecc('0x22');var _0x2824c9=_0x438222[_0x5ecc('0x24')];var _0x50ecfa=_0x13e935?0x0:_0x1b3696[_0x5ecc('0x21')];var _0x593f30=_0x13e935?_0x438222['count']:_0x1b3696['offset']+_0x1b3696[_0x5ecc('0x23')];var _0x2c3b8e;if(_0x593f30>=_0x2824c9){_0x593f30=_0x2824c9;_0x2c3b8e=0xc8;}else{_0x2c3b8e=0xce;}_0x33af8b['status'](_0x2c3b8e);return _0x33af8b[_0x5ecc('0x25')](_0x5ecc('0x26'),_0x50ecfa+'-'+_0x593f30+'/'+_0x2824c9)[_0x5ecc('0x20')](_0x438222);}return null;};}function patchUpdates(_0x3d15ed){return function(_0x174702){try{jsonpatch[_0x5ecc('0x27')](_0x174702,_0x3d15ed,!![]);}catch(_0x5adafb){return BPromise[_0x5ecc('0x28')](_0x5adafb);}return _0x174702[_0x5ecc('0x29')]();};}function saveUpdates(_0x48a074,_0x4c9842){return function(_0xdfc5b7){if(_0xdfc5b7){return _0xdfc5b7[_0x5ecc('0x2a')](_0x48a074)['then'](function(_0x390cec){return _0x390cec;});}return null;};}function removeEntity(_0x3441ec,_0xf5ae34){return function(_0x2ee55f){if(_0x2ee55f){return _0x2ee55f[_0x5ecc('0x2b')]()[_0x5ecc('0x2c')](function(){_0x3441ec[_0x5ecc('0x1e')](0xcc)[_0x5ecc('0x1f')]();});}};}function handleEntityNotFound(_0x132903,_0x2c4669){return function(_0x1e8694){if(!_0x1e8694){_0x132903[_0x5ecc('0x1d')](0x194);}return _0x1e8694;};}function handleError(_0x1bcbc9,_0x2b3d1c){_0x2b3d1c=_0x2b3d1c||0x1f4;return function(_0xaab535){logger['error'](_0xaab535[_0x5ecc('0x2d')]);if(_0xaab535[_0x5ecc('0x2e')]){delete _0xaab535[_0x5ecc('0x2e')];}_0x1bcbc9[_0x5ecc('0x1e')](_0x2b3d1c)[_0x5ecc('0x2f')](_0xaab535);};}exports['index']=function(_0x269f8c,_0x28abaf){var _0x3eadad={},_0x42ecd1={},_0x72eb0b={'count':0x0,'rows':[]};var _0x5393a9=_[_0x5ecc('0x30')](db['Dynamics365Field'][_0x5ecc('0x31')],function(_0x42a441){return{'name':_0x42a441[_0x5ecc('0x32')],'type':_0x42a441[_0x5ecc('0x33')][_0x5ecc('0x34')]};});_0x42ecd1[_0x5ecc('0x35')]=_[_0x5ecc('0x30')](_0x5393a9,_0x5ecc('0x2e'));_0x42ecd1[_0x5ecc('0x36')]=_[_0x5ecc('0x37')](_0x269f8c[_0x5ecc('0x36')]);_0x42ecd1[_0x5ecc('0x38')]=_['intersection'](_0x42ecd1[_0x5ecc('0x35')],_0x42ecd1[_0x5ecc('0x36')]);_0x3eadad['attributes']=_[_0x5ecc('0x39')](_0x42ecd1['model'],qs['fields'](_0x269f8c[_0x5ecc('0x36')][_0x5ecc('0x3a')]));_0x3eadad[_0x5ecc('0x3b')]=_0x3eadad[_0x5ecc('0x3b')][_0x5ecc('0x3c')]?_0x3eadad['attributes']:_0x42ecd1[_0x5ecc('0x35')];if(!_0x269f8c[_0x5ecc('0x36')]['hasOwnProperty'](_0x5ecc('0x3d'))){_0x3eadad['limit']=qs[_0x5ecc('0x23')](_0x269f8c[_0x5ecc('0x36')]['limit']);_0x3eadad[_0x5ecc('0x21')]=qs[_0x5ecc('0x21')](_0x269f8c[_0x5ecc('0x36')]['offset']);}_0x3eadad[_0x5ecc('0x3e')]=qs[_0x5ecc('0x3f')](_0x269f8c[_0x5ecc('0x36')]['sort']);_0x3eadad[_0x5ecc('0x40')]=qs[_0x5ecc('0x38')](_['pick'](_0x269f8c[_0x5ecc('0x36')],_0x42ecd1[_0x5ecc('0x38')]),_0x5393a9);if(_0x269f8c[_0x5ecc('0x36')]['filter']){_0x3eadad[_0x5ecc('0x40')]=_[_0x5ecc('0x41')](_0x3eadad[_0x5ecc('0x40')],{'$or':_[_0x5ecc('0x30')](_0x5393a9,function(_0x2fd21b){if(_0x2fd21b[_0x5ecc('0x33')]!==_0x5ecc('0x42')){var _0x1982fe={};_0x1982fe[_0x2fd21b[_0x5ecc('0x2e')]]={'$like':'%'+_0x269f8c['query']['filter']+'%'};return _0x1982fe;}})});}_0x3eadad=_[_0x5ecc('0x41')]({},_0x3eadad,_0x269f8c['options']);var _0x2f7730={'where':_0x3eadad[_0x5ecc('0x40')]};return db[_0x5ecc('0x43')][_0x5ecc('0x24')](_0x2f7730)[_0x5ecc('0x2c')](function(_0x536c37){_0x72eb0b['count']=_0x536c37;if(_0x269f8c['query'][_0x5ecc('0x44')]){_0x3eadad['include']=[{'all':!![]}];}return db[_0x5ecc('0x43')][_0x5ecc('0x45')](_0x3eadad);})[_0x5ecc('0x2c')](function(_0x4463aa){_0x72eb0b['rows']=_0x4463aa;return _0x72eb0b;})[_0x5ecc('0x2c')](respondWithFilteredResult(_0x28abaf,_0x3eadad))['catch'](handleError(_0x28abaf,null));};exports[_0x5ecc('0x46')]=function(_0x430b0d,_0x45542d){var _0x30a11c={'raw':!![],'where':{'id':_0x430b0d[_0x5ecc('0x47')]['id']}},_0x2898a1={};_0x2898a1[_0x5ecc('0x35')]=_['keys'](db['Dynamics365Field'][_0x5ecc('0x31')]);_0x2898a1[_0x5ecc('0x36')]=_[_0x5ecc('0x37')](_0x430b0d[_0x5ecc('0x36')]);_0x2898a1[_0x5ecc('0x38')]=_[_0x5ecc('0x39')](_0x2898a1[_0x5ecc('0x35')],_0x2898a1[_0x5ecc('0x36')]);_0x30a11c[_0x5ecc('0x3b')]=_[_0x5ecc('0x39')](_0x2898a1['model'],qs['fields'](_0x430b0d[_0x5ecc('0x36')][_0x5ecc('0x3a')]));_0x30a11c[_0x5ecc('0x3b')]=_0x30a11c[_0x5ecc('0x3b')]['length']?_0x30a11c['attributes']:_0x2898a1[_0x5ecc('0x35')];if(_0x430b0d[_0x5ecc('0x36')][_0x5ecc('0x44')]){_0x30a11c[_0x5ecc('0x48')]=[{'all':!![]}];}_0x30a11c=_[_0x5ecc('0x41')]({},_0x30a11c,_0x430b0d['options']);return db[_0x5ecc('0x43')]['find'](_0x30a11c)[_0x5ecc('0x2c')](handleEntityNotFound(_0x45542d,null))[_0x5ecc('0x2c')](respondWithResult(_0x45542d,null))['catch'](handleError(_0x45542d,null));};exports['create']=function(_0x2fe64b,_0x368264){return db['Dynamics365Field'][_0x5ecc('0x49')](_0x2fe64b['body'],{})['then'](respondWithResult(_0x368264,0xc9))[_0x5ecc('0x4a')](handleError(_0x368264,null));};exports[_0x5ecc('0x2a')]=function(_0xe33133,_0x25f59c){if(_0xe33133[_0x5ecc('0x4b')]['id']){delete _0xe33133[_0x5ecc('0x4b')]['id'];}return db['Dynamics365Field'][_0x5ecc('0x4c')]({'where':{'id':_0xe33133['params']['id']}})['then'](handleEntityNotFound(_0x25f59c,null))[_0x5ecc('0x2c')](saveUpdates(_0xe33133[_0x5ecc('0x4b')],null))[_0x5ecc('0x2c')](respondWithResult(_0x25f59c,null))[_0x5ecc('0x4a')](handleError(_0x25f59c,null));};exports[_0x5ecc('0x2b')]=function(_0x4894eb,_0x3ab111){return db[_0x5ecc('0x43')][_0x5ecc('0x4c')]({'where':{'id':_0x4894eb[_0x5ecc('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ab111,null))[_0x5ecc('0x2c')](removeEntity(_0x3ab111,null))[_0x5ecc('0x4a')](handleError(_0x3ab111,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index dd69fda..44793a3 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 _0xbc7a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xbc7a,0xdc));var _0xabc7=function(_0x1afec2,_0x58c3d5){_0x1afec2=_0x1afec2-0x0;var _0x16eba9=_0xbc7a[_0x1afec2];return _0x16eba9;};'use strict';var _=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var logger=require(_0xabc7('0x2'))(_0xabc7('0x3'));var moment=require(_0xabc7('0x4'));var BPromise=require(_0xabc7('0x5'));var rp=require(_0xabc7('0x6'));var fs=require('fs');var path=require(_0xabc7('0x7'));var rimraf=require(_0xabc7('0x8'));var config=require(_0xabc7('0x9'));var attributes=require(_0xabc7('0xa'));module[_0xabc7('0xb')]=function(_0x282f20,_0x2a6f40){return _0x282f20[_0xabc7('0xc')](_0xabc7('0xd'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xabc7('0xe'),'fields':[_0xabc7('0xf'),_0xabc7('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa60=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define'];(function(_0x365143,_0x46fd86){var _0x45bb49=function(_0x20bb4b){while(--_0x20bb4b){_0x365143['push'](_0x365143['shift']());}};_0x45bb49(++_0x46fd86);}(_0xfa60,0x16f));var _0x0fa6=function(_0x241437,_0x25cc06){_0x241437=_0x241437-0x0;var _0x26fadf=_0xfa60[_0x241437];return _0x26fadf;};'use strict';var _=require(_0x0fa6('0x0'));var util=require(_0x0fa6('0x1'));var logger=require(_0x0fa6('0x2'))('api');var moment=require(_0x0fa6('0x3'));var BPromise=require('bluebird');var rp=require(_0x0fa6('0x4'));var fs=require('fs');var path=require(_0x0fa6('0x5'));var rimraf=require(_0x0fa6('0x6'));var config=require(_0x0fa6('0x7'));var attributes=require(_0x0fa6('0x8'));module[_0x0fa6('0x9')]=function(_0x9bf77,_0x5dcaf9){return _0x9bf77[_0x0fa6('0xa')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x0fa6('0xb'),'fields':[_0x0fa6('0xc'),_0x0fa6('0xd')],'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 c32f920..2702e0e 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 _0x75ee=['request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b8f7d,_0x29db5f){var _0x4d3a55=function(_0x476835){while(--_0x476835){_0x2b8f7d['push'](_0x2b8f7d['shift']());}};_0x4d3a55(++_0x29db5f);}(_0x75ee,0xfc));var _0xe75e=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x75ee[_0x31c19c];return _0x1a87f7;};'use strict';var _=require(_0xe75e('0x0'));var util=require(_0xe75e('0x1'));var moment=require(_0xe75e('0x2'));var BPromise=require(_0xe75e('0x3'));var rs=require(_0xe75e('0x4'));var fs=require('fs');var Redis=require(_0xe75e('0x5'));var db=require(_0xe75e('0x6'))['db'];var utils=require(_0xe75e('0x7'));var logger=require('../../config/logger')(_0xe75e('0x8'));var config=require(_0xe75e('0x9'));var jayson=require(_0xe75e('0xa'));var client=jayson[_0xe75e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3428a4,_0x791aed,_0x51e257){return new BPromise(function(_0x173636,_0x5c6833){return client[_0xe75e('0xc')](_0x3428a4,_0x51e257)[_0xe75e('0xd')](function(_0x105f96){logger[_0xe75e('0xe')](_0xe75e('0xf'),_0x791aed,_0xe75e('0x10'));logger['debug'](_0xe75e('0x11'),_0x791aed,'request\x20sent',JSON[_0xe75e('0x12')](_0x105f96));if(_0x105f96[_0xe75e('0x13')]){if(_0x105f96['error']['code']===0x1f4){logger[_0xe75e('0x13')](_0xe75e('0xf'),_0x791aed,_0x105f96[_0xe75e('0x13')]['message']);return _0x5c6833(_0x105f96['error']['message']);}logger[_0xe75e('0x13')](_0xe75e('0xf'),_0x791aed,_0x105f96[_0xe75e('0x13')][_0xe75e('0x14')]);return _0x173636(_0x105f96[_0xe75e('0x13')][_0xe75e('0x14')]);}else{logger[_0xe75e('0xe')](_0xe75e('0xf'),_0x791aed,_0xe75e('0x10'));_0x173636(_0x105f96[_0xe75e('0x15')][_0xe75e('0x14')]);}})['catch'](function(_0x7ffb99){logger['error'](_0xe75e('0xf'),_0x791aed,_0x7ffb99);_0x5c6833(_0x7ffb99);});});} \ No newline at end of file +var _0xa699=['stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x458172,_0x15c780){var _0x14aba1=function(_0x3976a7){while(--_0x3976a7){_0x458172['push'](_0x458172['shift']());}};_0x14aba1(++_0x15c780);}(_0xa699,0xc6));var _0x9a69=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0xa699[_0x39ffd1];return _0x31267e;};'use strict';var _=require('lodash');var util=require(_0x9a69('0x0'));var moment=require(_0x9a69('0x1'));var BPromise=require(_0x9a69('0x2'));var rs=require(_0x9a69('0x3'));var fs=require('fs');var Redis=require(_0x9a69('0x4'));var db=require(_0x9a69('0x5'))['db'];var utils=require(_0x9a69('0x6'));var logger=require(_0x9a69('0x7'))(_0x9a69('0x8'));var config=require(_0x9a69('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9a69('0xa')][_0x9a69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6025e3,_0x30624a,_0x5204ed){return new BPromise(function(_0x3a987f,_0x46f98b){return client[_0x9a69('0xc')](_0x6025e3,_0x5204ed)[_0x9a69('0xd')](function(_0x2409e6){logger['info'](_0x9a69('0xe'),_0x30624a,_0x9a69('0xf'));logger[_0x9a69('0x10')](_0x9a69('0x11'),_0x30624a,_0x9a69('0xf'),JSON[_0x9a69('0x12')](_0x2409e6));if(_0x2409e6[_0x9a69('0x13')]){if(_0x2409e6[_0x9a69('0x13')][_0x9a69('0x14')]===0x1f4){logger[_0x9a69('0x13')](_0x9a69('0xe'),_0x30624a,_0x2409e6[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x46f98b(_0x2409e6[_0x9a69('0x13')][_0x9a69('0x15')]);}logger[_0x9a69('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x30624a,_0x2409e6[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x3a987f(_0x2409e6['error'][_0x9a69('0x15')]);}else{logger[_0x9a69('0x16')](_0x9a69('0xe'),_0x30624a,_0x9a69('0xf'));_0x3a987f(_0x2409e6['result'][_0x9a69('0x15')]);}})[_0x9a69('0x17')](function(_0x729c51){logger[_0x9a69('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x30624a,_0x729c51);_0x46f98b(_0x729c51);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 2c92c07..f093413 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 _0x7cd9=['./intFreshdeskAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','exports','util','path','express','Router','fs-extra','../../config/environment'];(function(_0x3cf0dc,_0x1b34c4){var _0x2f2d97=function(_0x1a38ec){while(--_0x1a38ec){_0x3cf0dc['push'](_0x3cf0dc['shift']());}};_0x2f2d97(++_0x1b34c4);}(_0x7cd9,0x15f));var _0x97cd=function(_0x489017,_0x3ece06){_0x489017=_0x489017-0x0;var _0x442ab7=_0x7cd9[_0x489017];return _0x442ab7;};'use strict';var multer=require('multer');var util=require(_0x97cd('0x0'));var path=require(_0x97cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x97cd('0x2'));var router=express[_0x97cd('0x3')]();var fs_extra=require(_0x97cd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x97cd('0x5'));var controller=require(_0x97cd('0x6'));router[_0x97cd('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x97cd('0x7')](_0x97cd('0x8'),auth[_0x97cd('0x9')](),controller['show']);router['get'](_0x97cd('0xa'),auth[_0x97cd('0x9')](),controller[_0x97cd('0xb')]);router[_0x97cd('0x7')](_0x97cd('0xc'),auth[_0x97cd('0x9')](),controller[_0x97cd('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x97cd('0xe')]);router[_0x97cd('0xf')](_0x97cd('0xa'),auth[_0x97cd('0x9')](),controller[_0x97cd('0x10')]);router[_0x97cd('0x11')](_0x97cd('0x8'),auth['isAuthenticated'](),controller[_0x97cd('0x12')]);router[_0x97cd('0x13')](_0x97cd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x97cd('0x14')]=router; \ No newline at end of file +var _0xefa4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','update','destroy','multer','util','path'];(function(_0x4780dc,_0x24dd9a){var _0x5cdc2c=function(_0x5e63ac){while(--_0x5e63ac){_0x4780dc['push'](_0x4780dc['shift']());}};_0x5cdc2c(++_0x24dd9a);}(_0xefa4,0x19f));var _0x4efa=function(_0x239094,_0x19d8ff){_0x239094=_0x239094-0x0;var _0x2aba33=_0xefa4[_0x239094];return _0x2aba33;};'use strict';var multer=require(_0x4efa('0x0'));var util=require(_0x4efa('0x1'));var path=require(_0x4efa('0x2'));var timeout=require(_0x4efa('0x3'));var express=require(_0x4efa('0x4'));var router=express[_0x4efa('0x5')]();var fs_extra=require(_0x4efa('0x6'));var auth=require(_0x4efa('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x4efa('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4efa('0x8')](_0x4efa('0x9'),auth[_0x4efa('0xa')](),controller[_0x4efa('0xb')]);router[_0x4efa('0x8')]('/:id/configurations',auth[_0x4efa('0xa')](),controller[_0x4efa('0xc')]);router[_0x4efa('0x8')](_0x4efa('0xd'),auth[_0x4efa('0xa')](),controller[_0x4efa('0xe')]);router['post']('/',auth[_0x4efa('0xa')](),controller['create']);router[_0x4efa('0xf')](_0x4efa('0x10'),auth[_0x4efa('0xa')](),controller['addConfiguration']);router['put'](_0x4efa('0x9'),auth[_0x4efa('0xa')](),controller[_0x4efa('0x11')]);router['delete']('/:id',auth[_0x4efa('0xa')](),controller[_0x4efa('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index e714ab2..0c2a9c3 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 _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0x51a3bb,_0x1388d2){var _0x52a2d0=function(_0xaac3ff){while(--_0xaac3ff){_0x51a3bb['push'](_0x51a3bb['shift']());}};_0x52a2d0(++_0x1388d2);}(_0x5464,0x15d));var _0x4546=function(_0x4f9b4f,_0x4344d0){_0x4f9b4f=_0x4f9b4f-0x0;var _0x40cbd3=_0x5464[_0x4f9b4f];return _0x40cbd3;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a85=['STRING','remoteUri'];(function(_0x3520a3,_0x585b4e){var _0x266257=function(_0x4d763a){while(--_0x4d763a){_0x3520a3['push'](_0x3520a3['shift']());}};_0x266257(++_0x585b4e);}(_0x1a85,0x178));var _0x51a8=function(_0x953a55,_0x736d43){_0x953a55=_0x953a55-0x0;var _0x43fa9a=_0x1a85[_0x953a55];return _0x43fa9a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 03e6c91..14654e8 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 _0xdb94=['hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','apiKey','slice','substring','lastIndexOf','GET','format','%s:X','toString','requester','subject','agent','description','priority','source','ticket_type','group','remove','default','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x434ab8,_0x164e29){var _0x4173a2=function(_0xb62744){while(--_0xb62744){_0x434ab8['push'](_0x434ab8['shift']());}};_0x4173a2(++_0x164e29);}(_0xdb94,0xab));var _0x4db9=function(_0x1ae98,_0x1e1c77){_0x1ae98=_0x1ae98-0x0;var _0x59d6fd=_0xdb94[_0x1ae98];return _0x59d6fd;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x4db9('0x17'));function respondWithStatusCode(_0x5e644c,_0x571685){_0x571685=_0x571685||0xcc;return function(_0x34fc7d){if(_0x34fc7d){return _0x5e644c[_0x4db9('0x18')](_0x571685);}return _0x5e644c['status'](_0x571685)[_0x4db9('0x19')]();};}function respondWithResult(_0x1f9638,_0x452896){_0x452896=_0x452896||0xc8;return function(_0x22667c){if(_0x22667c){return _0x1f9638['status'](_0x452896)['json'](_0x22667c);}};}function respondWithFilteredResult(_0x102274,_0x34de1a){return function(_0x4a037f){if(_0x4a037f){var _0xadc104=typeof _0x34de1a[_0x4db9('0x1a')]==='undefined'&&typeof _0x34de1a['limit']===_0x4db9('0x1b');var _0x143b88=_0x4a037f[_0x4db9('0x1c')];var _0xa693c4=_0xadc104?0x0:_0x34de1a[_0x4db9('0x1a')];var _0x55494a=_0xadc104?_0x4a037f[_0x4db9('0x1c')]:_0x34de1a[_0x4db9('0x1a')]+_0x34de1a[_0x4db9('0x1d')];var _0x5e3b36;if(_0x55494a>=_0x143b88){_0x55494a=_0x143b88;_0x5e3b36=0xc8;}else{_0x5e3b36=0xce;}_0x102274[_0x4db9('0x1e')](_0x5e3b36);return _0x102274[_0x4db9('0x1f')](_0x4db9('0x20'),_0xa693c4+'-'+_0x55494a+'/'+_0x143b88)['json'](_0x4a037f);}return null;};}function patchUpdates(_0x46b522){return function(_0x2e8f95){try{jsonpatch[_0x4db9('0x21')](_0x2e8f95,_0x46b522,!![]);}catch(_0x46fc3d){return BPromise[_0x4db9('0x22')](_0x46fc3d);}return _0x2e8f95[_0x4db9('0x23')]();};}function saveUpdates(_0x3585d5,_0x5aef3b){return function(_0x4ceb0c){if(_0x4ceb0c){return _0x4ceb0c[_0x4db9('0x24')](_0x3585d5)[_0x4db9('0x25')](function(_0x319475){return _0x319475;});}return null;};}function removeEntity(_0x4aaa84,_0x213daa){return function(_0xdac966){if(_0xdac966){return _0xdac966['destroy']()[_0x4db9('0x25')](function(){_0x4aaa84[_0x4db9('0x1e')](0xcc)[_0x4db9('0x19')]();});}};}function handleEntityNotFound(_0x4dbb1b,_0x3c8237){return function(_0xd250c5){if(!_0xd250c5){_0x4dbb1b[_0x4db9('0x18')](0x194);}return _0xd250c5;};}function handleError(_0x2d330e,_0x3f9f7e){_0x3f9f7e=_0x3f9f7e||0x1f4;return function(_0x385e22){logger[_0x4db9('0x26')](_0x385e22[_0x4db9('0x27')]);if(_0x385e22[_0x4db9('0x28')]){delete _0x385e22[_0x4db9('0x28')];}_0x2d330e[_0x4db9('0x1e')](_0x3f9f7e)[_0x4db9('0x29')](_0x385e22);};}exports[_0x4db9('0x2a')]=function(_0x20f133,_0x583861){var _0x5031fe={},_0x3951b2={},_0x331279={'count':0x0,'rows':[]};var _0x119371=_[_0x4db9('0x2b')](db[_0x4db9('0x2c')][_0x4db9('0x2d')],function(_0x4dc946){return{'name':_0x4dc946[_0x4db9('0x2e')],'type':_0x4dc946['type'][_0x4db9('0x2f')]};});_0x3951b2[_0x4db9('0x30')]=_[_0x4db9('0x2b')](_0x119371,_0x4db9('0x28'));_0x3951b2[_0x4db9('0x31')]=_['keys'](_0x20f133['query']);_0x3951b2[_0x4db9('0x32')]=_['intersection'](_0x3951b2[_0x4db9('0x30')],_0x3951b2[_0x4db9('0x31')]);_0x5031fe['attributes']=_[_0x4db9('0x33')](_0x3951b2[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0x20f133['query'][_0x4db9('0x34')]));_0x5031fe['attributes']=_0x5031fe[_0x4db9('0x35')][_0x4db9('0x36')]?_0x5031fe[_0x4db9('0x35')]:_0x3951b2['model'];if(!_0x20f133['query'][_0x4db9('0x37')](_0x4db9('0x38'))){_0x5031fe[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x20f133[_0x4db9('0x31')][_0x4db9('0x1d')]);_0x5031fe[_0x4db9('0x1a')]=qs[_0x4db9('0x1a')](_0x20f133[_0x4db9('0x31')]['offset']);}_0x5031fe[_0x4db9('0x39')]=qs[_0x4db9('0x3a')](_0x20f133[_0x4db9('0x31')][_0x4db9('0x3a')]);_0x5031fe['where']=qs[_0x4db9('0x32')](_[_0x4db9('0x3b')](_0x20f133[_0x4db9('0x31')],_0x3951b2['filters']),_0x119371);if(_0x20f133[_0x4db9('0x31')][_0x4db9('0x3c')]){_0x5031fe[_0x4db9('0x3d')]=_[_0x4db9('0x3e')](_0x5031fe['where'],{'$or':_['map'](_0x119371,function(_0x41da52){if(_0x41da52[_0x4db9('0x3f')]!==_0x4db9('0x40')){var _0x8bc540={};_0x8bc540[_0x41da52[_0x4db9('0x28')]]={'$like':'%'+_0x20f133['query'][_0x4db9('0x3c')]+'%'};return _0x8bc540;}})});}_0x5031fe=_[_0x4db9('0x3e')]({},_0x5031fe,_0x20f133[_0x4db9('0x41')]);var _0x367c4c={'where':_0x5031fe[_0x4db9('0x3d')]};return db['FreshdeskAccount'][_0x4db9('0x1c')](_0x367c4c)[_0x4db9('0x25')](function(_0x38a727){_0x331279['count']=_0x38a727;if(_0x20f133[_0x4db9('0x31')][_0x4db9('0x42')]){_0x5031fe[_0x4db9('0x43')]=[{'all':!![]}];}return db[_0x4db9('0x2c')][_0x4db9('0x44')](_0x5031fe);})[_0x4db9('0x25')](function(_0x412aab){_0x331279[_0x4db9('0x45')]=_0x412aab;return _0x331279;})[_0x4db9('0x25')](respondWithFilteredResult(_0x583861,_0x5031fe))[_0x4db9('0x46')](handleError(_0x583861,null));};exports['show']=function(_0x56bd68,_0x48aaf5){var _0x22a021={'raw':![],'where':{'id':_0x56bd68['params']['id']}},_0x28a3ef={};_0x28a3ef[_0x4db9('0x30')]=_[_0x4db9('0x47')](db['FreshdeskAccount']['rawAttributes']);_0x28a3ef[_0x4db9('0x31')]=_['keys'](_0x56bd68[_0x4db9('0x31')]);_0x28a3ef[_0x4db9('0x32')]=_['intersection'](_0x28a3ef[_0x4db9('0x30')],_0x28a3ef[_0x4db9('0x31')]);_0x22a021['attributes']=_[_0x4db9('0x33')](_0x28a3ef[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0x56bd68['query']['fields']));_0x22a021[_0x4db9('0x35')]=_0x22a021[_0x4db9('0x35')][_0x4db9('0x36')]?_0x22a021[_0x4db9('0x35')]:_0x28a3ef[_0x4db9('0x30')];if(_0x56bd68[_0x4db9('0x31')][_0x4db9('0x42')]){_0x22a021[_0x4db9('0x43')]=[{'all':!![]}];}_0x22a021=_[_0x4db9('0x3e')]({},_0x22a021,_0x56bd68[_0x4db9('0x41')]);return db[_0x4db9('0x2c')][_0x4db9('0x48')](_0x22a021)[_0x4db9('0x25')](handleEntityNotFound(_0x48aaf5,null))['then'](respondWithResult(_0x48aaf5,null))[_0x4db9('0x46')](handleError(_0x48aaf5,null));};exports[_0x4db9('0x49')]=function(_0x3852f0,_0xba27c0){return db[_0x4db9('0x2c')][_0x4db9('0x49')](_0x3852f0[_0x4db9('0x4a')],{})[_0x4db9('0x25')](respondWithResult(_0xba27c0,0xc9))[_0x4db9('0x46')](handleError(_0xba27c0,null));};exports[_0x4db9('0x24')]=function(_0x10dccb,_0x49ea0c){if(_0x10dccb['body']['id']){delete _0x10dccb[_0x4db9('0x4a')]['id'];}return db[_0x4db9('0x2c')][_0x4db9('0x48')]({'where':{'id':_0x10dccb[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x49ea0c,null))[_0x4db9('0x25')](saveUpdates(_0x10dccb[_0x4db9('0x4a')],null))[_0x4db9('0x25')](respondWithResult(_0x49ea0c,null))['catch'](handleError(_0x49ea0c,null));};exports[_0x4db9('0x4c')]=function(_0xcb832e,_0x121225){return db[_0x4db9('0x2c')][_0x4db9('0x48')]({'where':{'id':_0xcb832e[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x121225,null))[_0x4db9('0x25')](removeEntity(_0x121225,null))['catch'](handleError(_0x121225,null));};exports[_0x4db9('0x4d')]=function(_0xd6701a,_0x216696,_0x3a1f0e){var _0x15486f={};var _0x2d7fa2={};var _0x4e88c2;var _0x188663;return db['FreshdeskAccount'][_0x4db9('0x4e')]({'where':{'id':_0xd6701a['params']['id']}})['then'](handleEntityNotFound(_0x216696,null))[_0x4db9('0x25')](function(_0x5996f2){if(_0x5996f2){_0x4e88c2=_0x5996f2;_0x2d7fa2[_0x4db9('0x30')]=_[_0x4db9('0x47')](db[_0x4db9('0x4f')][_0x4db9('0x2d')]);_0x2d7fa2['query']=_[_0x4db9('0x47')](_0xd6701a['query']);_0x2d7fa2[_0x4db9('0x32')]=_[_0x4db9('0x33')](_0x2d7fa2['model'],_0x2d7fa2[_0x4db9('0x31')]);_0x15486f['attributes']=_[_0x4db9('0x33')](_0x2d7fa2[_0x4db9('0x30')],qs[_0x4db9('0x34')](_0xd6701a[_0x4db9('0x31')][_0x4db9('0x34')]));_0x15486f[_0x4db9('0x35')]=_0x15486f[_0x4db9('0x35')][_0x4db9('0x36')]?_0x15486f[_0x4db9('0x35')]:_0x2d7fa2[_0x4db9('0x30')];_0x15486f[_0x4db9('0x39')]=qs[_0x4db9('0x3a')](_0xd6701a[_0x4db9('0x31')][_0x4db9('0x3a')]);_0x15486f[_0x4db9('0x3d')]=qs['filters'](_[_0x4db9('0x3b')](_0xd6701a[_0x4db9('0x31')],_0x2d7fa2['filters']));if(_0xd6701a[_0x4db9('0x31')][_0x4db9('0x3c')]){_0x15486f[_0x4db9('0x3d')]=_[_0x4db9('0x3e')](_0x15486f[_0x4db9('0x3d')],{'$or':_[_0x4db9('0x2b')](_0x15486f[_0x4db9('0x35')],function(_0x355083){var _0x215538={};_0x215538[_0x355083]={'$like':'%'+_0xd6701a['query']['filter']+'%'};return _0x215538;})});}_0x15486f=_[_0x4db9('0x3e')]({},_0x15486f,_0xd6701a[_0x4db9('0x41')]);return _0x4e88c2[_0x4db9('0x4d')](_0x15486f);}})[_0x4db9('0x25')](function(_0x35e822){if(_0x35e822){_0x188663=_0x35e822[_0x4db9('0x36')];if(!_0xd6701a[_0x4db9('0x31')][_0x4db9('0x37')](_0x4db9('0x38'))){_0x15486f[_0x4db9('0x1d')]=qs['limit'](_0xd6701a[_0x4db9('0x31')]['limit']);_0x15486f['offset']=qs['offset'](_0xd6701a['query'][_0x4db9('0x1a')]);}return _0x4e88c2['getConfigurations'](_0x15486f);}})['then'](function(_0x7aea3a){if(_0x7aea3a){return _0x7aea3a?{'count':_0x188663,'rows':_0x7aea3a}:null;}})[_0x4db9('0x25')](respondWithResult(_0x216696,null))[_0x4db9('0x46')](handleError(_0x216696,null));};exports[_0x4db9('0x50')]=function(_0x2d91d9,_0x3e833d,_0xaea8ff){if(_0x2d91d9[_0x4db9('0x4a')]['id']){delete _0x2d91d9[_0x4db9('0x4a')]['id'];}return db[_0x4db9('0x2c')][_0x4db9('0x4e')]({'where':{'id':_0x2d91d9[_0x4db9('0x4b')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x3e833d,null))[_0x4db9('0x25')](function(_0xd84c6c){if(_0xd84c6c){_0x2d91d9[_0x4db9('0x4a')]['AccountId']=_0xd84c6c['id'];_0x2d91d9['body']['Subjects']=integrations[_0x4db9('0x51')](_0x2d91d9['body'][_0x4db9('0x52')],_0x2d91d9[_0x4db9('0x4a')][_0x4db9('0x3f')]);_0x2d91d9['body']['Descriptions']=integrations[_0x4db9('0x53')](_0x2d91d9['body'][_0x4db9('0x52')],_0x2d91d9[_0x4db9('0x4a')][_0x4db9('0x3f')]);return db[_0x4db9('0x4f')][_0x4db9('0x49')](_0x2d91d9['body'],{'include':[{'model':db[_0x4db9('0x54')],'as':'Subjects'},{'model':db[_0x4db9('0x54')],'as':_0x4db9('0x55')}]});}return null;})[_0x4db9('0x25')](respondWithResult(_0x3e833d,null))[_0x4db9('0x46')](handleError(_0x3e833d,null));};exports[_0x4db9('0x56')]=function(_0x543d35,_0x524d82,_0x3901b5){var _0xd8a34='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x543d35[_0x4db9('0x4b')]['id']},'attributes':['id','remoteUri',_0x4db9('0x57')]})['then'](handleEntityNotFound(_0x524d82,null))[_0x4db9('0x25')](function(_0x417802){if(_0x417802){_0xd8a34=_0x417802['remoteUri'];var _0x492d09=_0xd8a34[_0x4db9('0x58')](-0x1);if(_0x492d09==='/'){_0xd8a34=_0xd8a34[_0x4db9('0x59')](0x0,_0xd8a34[_0x4db9('0x5a')](_0x492d09));}return rp({'method':_0x4db9('0x5b'),'uri':util[_0x4db9('0x5c')]('%s/%s',_0xd8a34,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4db9('0x5c')](_0x4db9('0x5d'),_0x417802[_0x4db9('0x57')]))[_0x4db9('0x5e')]('base64'))},'json':!![]});}})[_0x4db9('0x25')](function(_0x5561e0){if(_0x5561e0){var _0x143e13=[_0x4db9('0x5f'),_0x4db9('0x60'),_0x4db9('0x61'),_0x4db9('0x62'),_0x4db9('0x1e'),_0x4db9('0x63'),'group',_0x4db9('0x64'),_0x4db9('0x65'),_0x4db9('0x66'),'company'];_[_0x4db9('0x67')](_0x5561e0,function(_0x2d75d8){return _0x143e13['includes'](_0x2d75d8['name'])||!_0x2d75d8[_0x4db9('0x68')]&&_0x2d75d8['type']!=='custom_text'&&_0x2d75d8[_0x4db9('0x3f')]!==_0x4db9('0x69');});return{'count':_0x5561e0[_0x4db9('0x36')],'rows':_['map'](_0x5561e0,function(_0x551671){return{'id':_0x551671['name'],'name':_0x551671['label'],'custom':!_0x551671['default'],'options':_0x551671[_0x4db9('0x6a')]?_[_0x4db9('0x2b')](_0x551671[_0x4db9('0x6a')],function(_0x437f6a){return{'name':_[_0x4db9('0x6b')](_0x437f6a),'value':_0x437f6a};}):[]};})};}})[_0x4db9('0x25')](respondWithResult(_0x524d82,null))[_0x4db9('0x46')](function(_0x347f49){var _0x4c5be0=_0x543d35[_0x4db9('0x31')][_0x4db9('0x6c')]?0x1f4:_0x347f49[_0x4db9('0x6d')]||0x1f4;logger[_0x4db9('0x26')](_0x4db9('0x6e'),_0x4db9('0x56'),_0x4c5be0,JSON[_0x4db9('0x6f')](_0x347f49));delete _0x347f49[_0x4db9('0x28')];if(_0x4c5be0===0x191){_0x4c5be0=0x190;}_0x524d82['status'](_0x4c5be0)[_0x4db9('0x29')](_0x543d35['query'][_0x4db9('0x6c')]?{'message':_0x4db9('0x70'),'statusCode':_0x347f49[_0x4db9('0x6d')]}:_0x347f49);});}; \ No newline at end of file +var _0x2e31=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','merge','options','includeAll','include','FreshdeskAccount','findAll','rows','show','params','keys','create','body','catch','find','getConfigurations','findOne','FreshdeskConfiguration','order','pick','filter','addConfiguration','AccountId','Subjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','format','apiKey','toString','base64','requester','subject','agent','description','priority','source','group','remove','includes','custom_text','custom_dropdown','default','choices','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x31ed63,_0x116bff){var _0x496509=function(_0x11cd29){while(--_0x11cd29){_0x31ed63['push'](_0x31ed63['shift']());}};_0x496509(++_0x116bff);}(_0x2e31,0x145));var _0x12e3=function(_0x64b57d,_0x2a79d8){_0x64b57d=_0x64b57d-0x0;var _0x2f55bd=_0x2e31[_0x64b57d];return _0x2f55bd;};'use strict';var emlformat=require(_0x12e3('0x0'));var rimraf=require(_0x12e3('0x1'));var zipdir=require(_0x12e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12e3('0x3'));var moment=require(_0x12e3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12e3('0x5'));var path=require(_0x12e3('0x6'));var sox=require(_0x12e3('0x7'));var csv=require('to-csv');var ejs=require(_0x12e3('0x8'));var fs=require('fs');var fs_extra=require(_0x12e3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12e3('0xa'));var jsforce=require(_0x12e3('0xb'));var deskjs=require(_0x12e3('0xc'));var toCsv=require(_0x12e3('0xd'));var querystring=require('querystring');var Papa=require(_0x12e3('0xe'));var Redis=require(_0x12e3('0xf'));var authService=require(_0x12e3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12e3('0x11'));var logger=require(_0x12e3('0x12'))(_0x12e3('0x13'));var utils=require(_0x12e3('0x14'));var config=require(_0x12e3('0x15'));var licenseUtil=require(_0x12e3('0x16'));var db=require(_0x12e3('0x17'))['db'];var integrations=require(_0x12e3('0x18'));function respondWithStatusCode(_0x2b5dc3,_0x464b63){_0x464b63=_0x464b63||0xcc;return function(_0x247631){if(_0x247631){return _0x2b5dc3[_0x12e3('0x19')](_0x464b63);}return _0x2b5dc3['status'](_0x464b63)[_0x12e3('0x1a')]();};}function respondWithResult(_0x19de67,_0xd9f80f){_0xd9f80f=_0xd9f80f||0xc8;return function(_0x5f315a){if(_0x5f315a){return _0x19de67[_0x12e3('0x1b')](_0xd9f80f)[_0x12e3('0x1c')](_0x5f315a);}};}function respondWithFilteredResult(_0x4a29e8,_0x5434fd){return function(_0x583ca3){if(_0x583ca3){var _0x7e6a5c=typeof _0x5434fd['offset']===_0x12e3('0x1d')&&typeof _0x5434fd[_0x12e3('0x1e')]===_0x12e3('0x1d');var _0x16dab1=_0x583ca3[_0x12e3('0x1f')];var _0x2041e9=_0x7e6a5c?0x0:_0x5434fd['offset'];var _0x77ad03=_0x7e6a5c?_0x583ca3[_0x12e3('0x1f')]:_0x5434fd['offset']+_0x5434fd['limit'];var _0x4a68ec;if(_0x77ad03>=_0x16dab1){_0x77ad03=_0x16dab1;_0x4a68ec=0xc8;}else{_0x4a68ec=0xce;}_0x4a29e8[_0x12e3('0x1b')](_0x4a68ec);return _0x4a29e8['set'](_0x12e3('0x20'),_0x2041e9+'-'+_0x77ad03+'/'+_0x16dab1)[_0x12e3('0x1c')](_0x583ca3);}return null;};}function patchUpdates(_0x5a1990){return function(_0x48f4b6){try{jsonpatch[_0x12e3('0x21')](_0x48f4b6,_0x5a1990,!![]);}catch(_0x7a0793){return BPromise[_0x12e3('0x22')](_0x7a0793);}return _0x48f4b6[_0x12e3('0x23')]();};}function saveUpdates(_0x4b8617,_0x55380a){return function(_0x3e03d8){if(_0x3e03d8){return _0x3e03d8[_0x12e3('0x24')](_0x4b8617)[_0x12e3('0x25')](function(_0x2705e8){return _0x2705e8;});}return null;};}function removeEntity(_0x2cf78a,_0x553982){return function(_0xaaf65f){if(_0xaaf65f){return _0xaaf65f[_0x12e3('0x26')]()[_0x12e3('0x25')](function(){_0x2cf78a[_0x12e3('0x1b')](0xcc)[_0x12e3('0x1a')]();});}};}function handleEntityNotFound(_0x3361d2,_0x578681){return function(_0xaf0b43){if(!_0xaf0b43){_0x3361d2[_0x12e3('0x19')](0x194);}return _0xaf0b43;};}function handleError(_0x4213db,_0x42765f){_0x42765f=_0x42765f||0x1f4;return function(_0x4d1792){logger[_0x12e3('0x27')](_0x4d1792[_0x12e3('0x28')]);if(_0x4d1792[_0x12e3('0x29')]){delete _0x4d1792['name'];}_0x4213db[_0x12e3('0x1b')](_0x42765f)[_0x12e3('0x2a')](_0x4d1792);};}exports[_0x12e3('0x2b')]=function(_0x337790,_0x5a5dd1){var _0x342ad2={},_0x2859d2={},_0x40aefe={'count':0x0,'rows':[]};var _0x546f26=_[_0x12e3('0x2c')](db['FreshdeskAccount'][_0x12e3('0x2d')],function(_0x1a3a4a){return{'name':_0x1a3a4a[_0x12e3('0x2e')],'type':_0x1a3a4a[_0x12e3('0x2f')][_0x12e3('0x30')]};});_0x2859d2[_0x12e3('0x31')]=_['map'](_0x546f26,_0x12e3('0x29'));_0x2859d2[_0x12e3('0x32')]=_['keys'](_0x337790[_0x12e3('0x32')]);_0x2859d2[_0x12e3('0x33')]=_['intersection'](_0x2859d2[_0x12e3('0x31')],_0x2859d2[_0x12e3('0x32')]);_0x342ad2['attributes']=_[_0x12e3('0x34')](_0x2859d2[_0x12e3('0x31')],qs[_0x12e3('0x35')](_0x337790['query'][_0x12e3('0x35')]));_0x342ad2[_0x12e3('0x36')]=_0x342ad2[_0x12e3('0x36')][_0x12e3('0x37')]?_0x342ad2[_0x12e3('0x36')]:_0x2859d2[_0x12e3('0x31')];if(!_0x337790[_0x12e3('0x32')][_0x12e3('0x38')](_0x12e3('0x39'))){_0x342ad2[_0x12e3('0x1e')]=qs[_0x12e3('0x1e')](_0x337790[_0x12e3('0x32')][_0x12e3('0x1e')]);_0x342ad2['offset']=qs[_0x12e3('0x3a')](_0x337790['query'][_0x12e3('0x3a')]);}_0x342ad2['order']=qs[_0x12e3('0x3b')](_0x337790[_0x12e3('0x32')]['sort']);_0x342ad2[_0x12e3('0x3c')]=qs[_0x12e3('0x33')](_['pick'](_0x337790[_0x12e3('0x32')],_0x2859d2[_0x12e3('0x33')]),_0x546f26);if(_0x337790[_0x12e3('0x32')]['filter']){_0x342ad2[_0x12e3('0x3c')]=_[_0x12e3('0x3d')](_0x342ad2[_0x12e3('0x3c')],{'$or':_['map'](_0x546f26,function(_0x42392b){if(_0x42392b['type']!=='VIRTUAL'){var _0x367180={};_0x367180[_0x42392b[_0x12e3('0x29')]]={'$like':'%'+_0x337790[_0x12e3('0x32')]['filter']+'%'};return _0x367180;}})});}_0x342ad2=_['merge']({},_0x342ad2,_0x337790[_0x12e3('0x3e')]);var _0x501e83={'where':_0x342ad2[_0x12e3('0x3c')]};return db['FreshdeskAccount'][_0x12e3('0x1f')](_0x501e83)[_0x12e3('0x25')](function(_0x27546e){_0x40aefe['count']=_0x27546e;if(_0x337790[_0x12e3('0x32')][_0x12e3('0x3f')]){_0x342ad2[_0x12e3('0x40')]=[{'all':!![]}];}return db[_0x12e3('0x41')][_0x12e3('0x42')](_0x342ad2);})[_0x12e3('0x25')](function(_0x4d4844){_0x40aefe[_0x12e3('0x43')]=_0x4d4844;return _0x40aefe;})[_0x12e3('0x25')](respondWithFilteredResult(_0x5a5dd1,_0x342ad2))['catch'](handleError(_0x5a5dd1,null));};exports[_0x12e3('0x44')]=function(_0x448d96,_0x52c1c5){var _0x433ca4={'raw':![],'where':{'id':_0x448d96[_0x12e3('0x45')]['id']}},_0xc03bd0={};_0xc03bd0[_0x12e3('0x31')]=_[_0x12e3('0x46')](db[_0x12e3('0x41')][_0x12e3('0x2d')]);_0xc03bd0['query']=_[_0x12e3('0x46')](_0x448d96[_0x12e3('0x32')]);_0xc03bd0[_0x12e3('0x33')]=_[_0x12e3('0x34')](_0xc03bd0[_0x12e3('0x31')],_0xc03bd0[_0x12e3('0x32')]);_0x433ca4[_0x12e3('0x36')]=_[_0x12e3('0x34')](_0xc03bd0['model'],qs['fields'](_0x448d96[_0x12e3('0x32')][_0x12e3('0x35')]));_0x433ca4['attributes']=_0x433ca4[_0x12e3('0x36')]['length']?_0x433ca4[_0x12e3('0x36')]:_0xc03bd0[_0x12e3('0x31')];if(_0x448d96[_0x12e3('0x32')][_0x12e3('0x3f')]){_0x433ca4[_0x12e3('0x40')]=[{'all':!![]}];}_0x433ca4=_[_0x12e3('0x3d')]({},_0x433ca4,_0x448d96['options']);return db['FreshdeskAccount']['find'](_0x433ca4)[_0x12e3('0x25')](handleEntityNotFound(_0x52c1c5,null))[_0x12e3('0x25')](respondWithResult(_0x52c1c5,null))['catch'](handleError(_0x52c1c5,null));};exports['create']=function(_0x34a629,_0x5ceb50){return db[_0x12e3('0x41')][_0x12e3('0x47')](_0x34a629[_0x12e3('0x48')],{})[_0x12e3('0x25')](respondWithResult(_0x5ceb50,0xc9))[_0x12e3('0x49')](handleError(_0x5ceb50,null));};exports[_0x12e3('0x24')]=function(_0x20fb60,_0x5541db){if(_0x20fb60[_0x12e3('0x48')]['id']){delete _0x20fb60[_0x12e3('0x48')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x20fb60[_0x12e3('0x45')]['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x5541db,null))[_0x12e3('0x25')](saveUpdates(_0x20fb60['body'],null))[_0x12e3('0x25')](respondWithResult(_0x5541db,null))[_0x12e3('0x49')](handleError(_0x5541db,null));};exports[_0x12e3('0x26')]=function(_0x498cdb,_0x327a2b){return db[_0x12e3('0x41')][_0x12e3('0x4a')]({'where':{'id':_0x498cdb['params']['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x327a2b,null))[_0x12e3('0x25')](removeEntity(_0x327a2b,null))[_0x12e3('0x49')](handleError(_0x327a2b,null));};exports[_0x12e3('0x4b')]=function(_0x3e772d,_0x220d97,_0x60e6fc){var _0x2d409f={};var _0x4159ab={};var _0x2d9ed0;var _0x3ea59e;return db[_0x12e3('0x41')][_0x12e3('0x4c')]({'where':{'id':_0x3e772d[_0x12e3('0x45')]['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x220d97,null))['then'](function(_0x5066de){if(_0x5066de){_0x2d9ed0=_0x5066de;_0x4159ab[_0x12e3('0x31')]=_[_0x12e3('0x46')](db[_0x12e3('0x4d')][_0x12e3('0x2d')]);_0x4159ab[_0x12e3('0x32')]=_[_0x12e3('0x46')](_0x3e772d[_0x12e3('0x32')]);_0x4159ab['filters']=_[_0x12e3('0x34')](_0x4159ab[_0x12e3('0x31')],_0x4159ab['query']);_0x2d409f[_0x12e3('0x36')]=_[_0x12e3('0x34')](_0x4159ab['model'],qs['fields'](_0x3e772d[_0x12e3('0x32')][_0x12e3('0x35')]));_0x2d409f[_0x12e3('0x36')]=_0x2d409f[_0x12e3('0x36')][_0x12e3('0x37')]?_0x2d409f[_0x12e3('0x36')]:_0x4159ab[_0x12e3('0x31')];_0x2d409f[_0x12e3('0x4e')]=qs[_0x12e3('0x3b')](_0x3e772d['query'][_0x12e3('0x3b')]);_0x2d409f['where']=qs[_0x12e3('0x33')](_[_0x12e3('0x4f')](_0x3e772d[_0x12e3('0x32')],_0x4159ab[_0x12e3('0x33')]));if(_0x3e772d[_0x12e3('0x32')][_0x12e3('0x50')]){_0x2d409f[_0x12e3('0x3c')]=_[_0x12e3('0x3d')](_0x2d409f[_0x12e3('0x3c')],{'$or':_[_0x12e3('0x2c')](_0x2d409f[_0x12e3('0x36')],function(_0x35cd26){var _0x879064={};_0x879064[_0x35cd26]={'$like':'%'+_0x3e772d[_0x12e3('0x32')][_0x12e3('0x50')]+'%'};return _0x879064;})});}_0x2d409f=_['merge']({},_0x2d409f,_0x3e772d[_0x12e3('0x3e')]);return _0x2d9ed0[_0x12e3('0x4b')](_0x2d409f);}})['then'](function(_0x106e76){if(_0x106e76){_0x3ea59e=_0x106e76[_0x12e3('0x37')];if(!_0x3e772d[_0x12e3('0x32')]['hasOwnProperty'](_0x12e3('0x39'))){_0x2d409f[_0x12e3('0x1e')]=qs[_0x12e3('0x1e')](_0x3e772d[_0x12e3('0x32')]['limit']);_0x2d409f[_0x12e3('0x3a')]=qs[_0x12e3('0x3a')](_0x3e772d[_0x12e3('0x32')][_0x12e3('0x3a')]);}return _0x2d9ed0[_0x12e3('0x4b')](_0x2d409f);}})[_0x12e3('0x25')](function(_0x4ac6a0){if(_0x4ac6a0){return _0x4ac6a0?{'count':_0x3ea59e,'rows':_0x4ac6a0}:null;}})[_0x12e3('0x25')](respondWithResult(_0x220d97,null))[_0x12e3('0x49')](handleError(_0x220d97,null));};exports[_0x12e3('0x51')]=function(_0x4307d7,_0x238aa6,_0x2da056){if(_0x4307d7[_0x12e3('0x48')]['id']){delete _0x4307d7['body']['id'];}return db[_0x12e3('0x41')][_0x12e3('0x4c')]({'where':{'id':_0x4307d7['params']['id']}})[_0x12e3('0x25')](handleEntityNotFound(_0x238aa6,null))[_0x12e3('0x25')](function(_0x38020d){if(_0x38020d){_0x4307d7[_0x12e3('0x48')][_0x12e3('0x52')]=_0x38020d['id'];_0x4307d7['body'][_0x12e3('0x53')]=integrations['getSubjects'](_0x4307d7['body'][_0x12e3('0x54')],_0x4307d7[_0x12e3('0x48')][_0x12e3('0x2f')]);_0x4307d7[_0x12e3('0x48')][_0x12e3('0x55')]=integrations['getDescriptions'](_0x4307d7[_0x12e3('0x48')][_0x12e3('0x54')],_0x4307d7['body'][_0x12e3('0x2f')]);return db[_0x12e3('0x4d')][_0x12e3('0x47')](_0x4307d7[_0x12e3('0x48')],{'include':[{'model':db[_0x12e3('0x56')],'as':'Subjects'},{'model':db[_0x12e3('0x56')],'as':_0x12e3('0x55')}]});}return null;})[_0x12e3('0x25')](respondWithResult(_0x238aa6,null))[_0x12e3('0x49')](handleError(_0x238aa6,null));};exports[_0x12e3('0x57')]=function(_0x5078bc,_0x40d32c,_0xe73106){var _0x2d8d37='';return db[_0x12e3('0x41')]['findOne']({'where':{'id':_0x5078bc[_0x12e3('0x45')]['id']},'attributes':['id',_0x12e3('0x58'),'apiKey']})[_0x12e3('0x25')](handleEntityNotFound(_0x40d32c,null))[_0x12e3('0x25')](function(_0x4f0d07){if(_0x4f0d07){_0x2d8d37=_0x4f0d07['remoteUri'];var _0x77aa9a=_0x2d8d37[_0x12e3('0x59')](-0x1);if(_0x77aa9a==='/'){_0x2d8d37=_0x2d8d37[_0x12e3('0x5a')](0x0,_0x2d8d37[_0x12e3('0x5b')](_0x77aa9a));}return rp({'method':_0x12e3('0x5c'),'uri':util['format'](_0x12e3('0x5d'),_0x2d8d37,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x12e3('0x5e')]('Basic\x20%s',new Buffer(util[_0x12e3('0x5e')]('%s:X',_0x4f0d07[_0x12e3('0x5f')]))[_0x12e3('0x60')](_0x12e3('0x61')))},'json':!![]});}})[_0x12e3('0x25')](function(_0x355301){if(_0x355301){var _0x497d54=[_0x12e3('0x62'),_0x12e3('0x63'),_0x12e3('0x64'),_0x12e3('0x65'),_0x12e3('0x1b'),_0x12e3('0x66'),'group',_0x12e3('0x67'),'ticket_type',_0x12e3('0x68'),'company'];_[_0x12e3('0x69')](_0x355301,function(_0x2ab227){return _0x497d54[_0x12e3('0x6a')](_0x2ab227[_0x12e3('0x29')])||!_0x2ab227['default']&&_0x2ab227['type']!==_0x12e3('0x6b')&&_0x2ab227[_0x12e3('0x2f')]!==_0x12e3('0x6c');});return{'count':_0x355301[_0x12e3('0x37')],'rows':_[_0x12e3('0x2c')](_0x355301,function(_0x2474bf){return{'id':_0x2474bf[_0x12e3('0x29')],'name':_0x2474bf['label'],'custom':!_0x2474bf[_0x12e3('0x6d')],'options':_0x2474bf[_0x12e3('0x6e')]?_[_0x12e3('0x2c')](_0x2474bf[_0x12e3('0x6e')],function(_0x5328c8){return{'name':_['capitalize'](_0x5328c8),'value':_0x5328c8};}):[]};})};}})[_0x12e3('0x25')](respondWithResult(_0x40d32c,null))[_0x12e3('0x49')](function(_0x2cf2b0){var _0x198c11=_0x5078bc[_0x12e3('0x32')]['test']?0x1f4:_0x2cf2b0['statusCode']||0x1f4;logger[_0x12e3('0x27')](_0x12e3('0x6f'),_0x12e3('0x57'),_0x198c11,JSON['stringify'](_0x2cf2b0));delete _0x2cf2b0[_0x12e3('0x29')];if(_0x198c11===0x191){_0x198c11=0x190;}_0x40d32c[_0x12e3('0x1b')](_0x198c11)[_0x12e3('0x2a')](_0x5078bc[_0x12e3('0x32')][_0x12e3('0x70')]?{'message':_0x12e3('0x71'),'statusCode':_0x2cf2b0[_0x12e3('0x72')]}:_0x2cf2b0);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0f48db9..36800c5 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 _0x93b1=['int_freshdesk_accounts','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x93b1,0x105));var _0x193b=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x93b1[_0x18d631];return _0x50d708;};'use strict';var _=require('lodash');var util=require(_0x193b('0x0'));var logger=require(_0x193b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x193b('0x2'));var rp=require(_0x193b('0x3'));var fs=require('fs');var path=require(_0x193b('0x4'));var rimraf=require(_0x193b('0x5'));var config=require(_0x193b('0x6'));var attributes=require(_0x193b('0x7'));var integrations=require(_0x193b('0x8'));module[_0x193b('0x9')]=function(_0x25cbd0,_0x5ba533){return _0x25cbd0[_0x193b('0xa')](_0x193b('0xb'),attributes,{'tableName':_0x193b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7172=['exports','FreshdeskAccount','lodash','util','moment','request-promise','path','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x2d02c7,_0x46e2be){var _0x5ed446=function(_0x60fb6b){while(--_0x60fb6b){_0x2d02c7['push'](_0x2d02c7['shift']());}};_0x5ed446(++_0x46e2be);}(_0x7172,0x107));var _0x2717=function(_0x58746d,_0x393abc){_0x58746d=_0x58746d-0x0;var _0x442bed=_0x7172[_0x58746d];return _0x442bed;};'use strict';var _=require(_0x2717('0x0'));var util=require(_0x2717('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2717('0x2'));var BPromise=require('bluebird');var rp=require(_0x2717('0x3'));var fs=require('fs');var path=require(_0x2717('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2717('0x5'));var integrations=require(_0x2717('0x6'));module[_0x2717('0x7')]=function(_0x4dc94a,_0x5f0158){return _0x4dc94a['define'](_0x2717('0x8'),attributes,{'tableName':'int_freshdesk_accounts','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 01b64a5..dc019c5 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 _0x204d=['map','model','ShowFreshdeskAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include'];(function(_0x39aef1,_0x3fc5d5){var _0x1478a0=function(_0x3f1be3){while(--_0x3f1be3){_0x39aef1['push'](_0x39aef1['shift']());}};_0x1478a0(++_0x3fc5d5);}(_0x204d,0x1f4));var _0xd204=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x204d[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require(_0xd204('0x0'));var util=require(_0xd204('0x1'));var moment=require('moment');var BPromise=require(_0xd204('0x2'));var rs=require(_0xd204('0x3'));var fs=require('fs');var Redis=require(_0xd204('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd204('0x5'))(_0xd204('0x6'));var config=require(_0xd204('0x7'));var jayson=require(_0xd204('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1661e5,_0x5ed5a2,_0x26a10f){return new BPromise(function(_0x5d8d8d,_0x6db018){return client['request'](_0x1661e5,_0x26a10f)[_0xd204('0x9')](function(_0x2a5f1e){logger[_0xd204('0xa')](_0xd204('0xb'),_0x5ed5a2,_0xd204('0xc'));logger[_0xd204('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5ed5a2,'request\x20sent',JSON[_0xd204('0xe')](_0x2a5f1e));if(_0x2a5f1e['error']){if(_0x2a5f1e['error'][_0xd204('0xf')]===0x1f4){logger[_0xd204('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5ed5a2,_0x2a5f1e[_0xd204('0x10')][_0xd204('0x11')]);return _0x6db018(_0x2a5f1e['error'][_0xd204('0x11')]);}logger[_0xd204('0x10')](_0xd204('0xb'),_0x5ed5a2,_0x2a5f1e[_0xd204('0x10')]['message']);return _0x5d8d8d(_0x2a5f1e['error'][_0xd204('0x11')]);}else{logger[_0xd204('0xa')](_0xd204('0xb'),_0x5ed5a2,_0xd204('0xc'));_0x5d8d8d(_0x2a5f1e[_0xd204('0x12')][_0xd204('0x11')]);}})[_0xd204('0x13')](function(_0x3a7832){logger[_0xd204('0x10')](_0xd204('0xb'),_0x5ed5a2,_0x3a7832);_0x6db018(_0x3a7832);});});}exports[_0xd204('0x14')]=function(_0x451081){var _0x282b25=this;return new Promise(function(_0xe7bdc9,_0x31c840){return db[_0xd204('0x15')][_0xd204('0x16')]({'raw':_0x451081['options']?_0x451081[_0xd204('0x17')][_0xd204('0x18')]===undefined?!![]:![]:!![],'where':_0x451081[_0xd204('0x17')]?_0x451081[_0xd204('0x17')]['where']||null:null,'attributes':_0x451081[_0xd204('0x17')]?_0x451081[_0xd204('0x17')][_0xd204('0x19')]||null:null,'limit':_0x451081[_0xd204('0x17')]?_0x451081['options'][_0xd204('0x1a')]||null:null,'include':_0x451081[_0xd204('0x17')]?_0x451081[_0xd204('0x17')][_0xd204('0x1b')]?_[_0xd204('0x1c')](_0x451081[_0xd204('0x17')][_0xd204('0x1b')],function(_0x3e7433){return{'model':db[_0x3e7433['model']],'as':_0x3e7433['as'],'attributes':_0x3e7433[_0xd204('0x19')],'include':_0x3e7433[_0xd204('0x1b')]?_[_0xd204('0x1c')](_0x3e7433[_0xd204('0x1b')],function(_0x236925){return{'model':db[_0x236925[_0xd204('0x1d')]],'as':_0x236925['as'],'attributes':_0x236925[_0xd204('0x19')],'include':_0x236925['include']?_['map'](_0x236925[_0xd204('0x1b')],function(_0x12e500){return{'model':db[_0x12e500[_0xd204('0x1d')]],'as':_0x12e500['as'],'attributes':_0x12e500['attributes']};}):[]};}):[]};}):[]:[]})[_0xd204('0x9')](function(_0x44f13f){logger[_0xd204('0xa')](_0xd204('0x14'),_0x451081);logger[_0xd204('0xd')](_0xd204('0x14'),_0x451081,JSON['stringify'](_0x44f13f));_0xe7bdc9(_0x44f13f);})[_0xd204('0x13')](function(_0x5621d6){logger[_0xd204('0x10')](_0xd204('0x14'),_0x5621d6['message'],_0x451081);_0x31c840(_0x282b25[_0xd204('0x10')](0x1f4,_0x5621d6['message']));});});};exports[_0xd204('0x1e')]=function(_0x194989){var _0x5bbaa3=this;return new Promise(function(_0x125957,_0x30fab8){return db[_0xd204('0x15')][_0xd204('0x1f')]({'raw':_0x194989[_0xd204('0x17')]?_0x194989['options']['raw']===undefined?!![]:![]:!![],'where':_0x194989[_0xd204('0x17')]?_0x194989[_0xd204('0x17')][_0xd204('0x20')]||null:null,'attributes':_0x194989['options']?_0x194989[_0xd204('0x17')][_0xd204('0x19')]||null:null,'include':_0x194989[_0xd204('0x17')]?_0x194989[_0xd204('0x17')][_0xd204('0x1b')]?_['map'](_0x194989[_0xd204('0x17')][_0xd204('0x1b')],function(_0xfe4280){return{'model':db[_0xfe4280[_0xd204('0x1d')]],'as':_0xfe4280['as'],'attributes':_0xfe4280[_0xd204('0x19')],'include':_0xfe4280[_0xd204('0x1b')]?_['map'](_0xfe4280[_0xd204('0x1b')],function(_0x423748){return{'model':db[_0x423748[_0xd204('0x1d')]],'as':_0x423748['as'],'attributes':_0x423748[_0xd204('0x19')],'include':_0x423748['include']?_['map'](_0x423748[_0xd204('0x1b')],function(_0x275004){return{'model':db[_0x275004['model']],'as':_0x275004['as'],'attributes':_0x275004[_0xd204('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd204('0x9')](function(_0x287e90){logger[_0xd204('0xa')](_0xd204('0x1e'),_0x194989);logger[_0xd204('0xd')]('ShowFreshdeskAccount',_0x194989,JSON[_0xd204('0xe')](_0x287e90));_0x125957(_0x287e90);})[_0xd204('0x13')](function(_0x39cd7b){logger[_0xd204('0x10')]('ShowFreshdeskAccount',_0x39cd7b[_0xd204('0x11')],_0x194989);_0x30fab8(_0x5bbaa3[_0xd204('0x10')](0x1f4,_0x39cd7b[_0xd204('0x11')]));});});}; \ No newline at end of file +var _0x1ab4=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','findAll','options','attributes','include','map','model','then','ShowFreshdeskAccount','FreshdeskAccount','find','raw','where','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x52cc2c,_0x1f6c0e){var _0x7e5a1f=function(_0x826c8f){while(--_0x826c8f){_0x52cc2c['push'](_0x52cc2c['shift']());}};_0x7e5a1f(++_0x1f6c0e);}(_0x1ab4,0x1ae));var _0x41ab=function(_0x44e5bc,_0x5bb7ef){_0x44e5bc=_0x44e5bc-0x0;var _0x58c13d=_0x1ab4[_0x44e5bc];return _0x58c13d;};'use strict';var _=require(_0x41ab('0x0'));var util=require('util');var moment=require(_0x41ab('0x1'));var BPromise=require('bluebird');var rs=require(_0x41ab('0x2'));var fs=require('fs');var Redis=require(_0x41ab('0x3'));var db=require(_0x41ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x41ab('0x5'));var config=require(_0x41ab('0x6'));var jayson=require(_0x41ab('0x7'));var client=jayson[_0x41ab('0x8')][_0x41ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ebdfe,_0x61ac96,_0x5b9dcc){return new BPromise(function(_0x486180,_0x3a8367){return client[_0x41ab('0xa')](_0x1ebdfe,_0x5b9dcc)['then'](function(_0xc0f756){logger[_0x41ab('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x61ac96,_0x41ab('0xc'));logger[_0x41ab('0xd')](_0x41ab('0xe'),_0x61ac96,_0x41ab('0xc'),JSON[_0x41ab('0xf')](_0xc0f756));if(_0xc0f756[_0x41ab('0x10')]){if(_0xc0f756[_0x41ab('0x10')][_0x41ab('0x11')]===0x1f4){logger['error'](_0x41ab('0x12'),_0x61ac96,_0xc0f756['error'][_0x41ab('0x13')]);return _0x3a8367(_0xc0f756[_0x41ab('0x10')][_0x41ab('0x13')]);}logger[_0x41ab('0x10')](_0x41ab('0x12'),_0x61ac96,_0xc0f756[_0x41ab('0x10')][_0x41ab('0x13')]);return _0x486180(_0xc0f756[_0x41ab('0x10')][_0x41ab('0x13')]);}else{logger[_0x41ab('0xb')](_0x41ab('0x12'),_0x61ac96,_0x41ab('0xc'));_0x486180(_0xc0f756['result'][_0x41ab('0x13')]);}})[_0x41ab('0x14')](function(_0x567237){logger[_0x41ab('0x10')](_0x41ab('0x12'),_0x61ac96,_0x567237);_0x3a8367(_0x567237);});});}exports[_0x41ab('0x15')]=function(_0x58fc78){var _0x23fb69=this;return new Promise(function(_0x8ef8e5,_0x26cc57){return db['FreshdeskAccount'][_0x41ab('0x16')]({'raw':_0x58fc78['options']?_0x58fc78[_0x41ab('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58fc78[_0x41ab('0x17')]?_0x58fc78[_0x41ab('0x17')]['where']||null:null,'attributes':_0x58fc78[_0x41ab('0x17')]?_0x58fc78[_0x41ab('0x17')][_0x41ab('0x18')]||null:null,'limit':_0x58fc78[_0x41ab('0x17')]?_0x58fc78[_0x41ab('0x17')]['limit']||null:null,'include':_0x58fc78[_0x41ab('0x17')]?_0x58fc78[_0x41ab('0x17')][_0x41ab('0x19')]?_[_0x41ab('0x1a')](_0x58fc78[_0x41ab('0x17')][_0x41ab('0x19')],function(_0x16826d){return{'model':db[_0x16826d[_0x41ab('0x1b')]],'as':_0x16826d['as'],'attributes':_0x16826d[_0x41ab('0x18')],'include':_0x16826d[_0x41ab('0x19')]?_[_0x41ab('0x1a')](_0x16826d[_0x41ab('0x19')],function(_0x920ee6){return{'model':db[_0x920ee6[_0x41ab('0x1b')]],'as':_0x920ee6['as'],'attributes':_0x920ee6[_0x41ab('0x18')],'include':_0x920ee6[_0x41ab('0x19')]?_[_0x41ab('0x1a')](_0x920ee6['include'],function(_0x19fc31){return{'model':db[_0x19fc31[_0x41ab('0x1b')]],'as':_0x19fc31['as'],'attributes':_0x19fc31[_0x41ab('0x18')]};}):[]};}):[]};}):[]:[]})[_0x41ab('0x1c')](function(_0x341a08){logger['info'](_0x41ab('0x15'),_0x58fc78);logger[_0x41ab('0xd')](_0x41ab('0x15'),_0x58fc78,JSON['stringify'](_0x341a08));_0x8ef8e5(_0x341a08);})[_0x41ab('0x14')](function(_0x4e8c51){logger[_0x41ab('0x10')](_0x41ab('0x15'),_0x4e8c51[_0x41ab('0x13')],_0x58fc78);_0x26cc57(_0x23fb69['error'](0x1f4,_0x4e8c51[_0x41ab('0x13')]));});});};exports[_0x41ab('0x1d')]=function(_0x5a9df7){var _0x1e26cb=this;return new Promise(function(_0x1174b4,_0x49ed87){return db[_0x41ab('0x1e')][_0x41ab('0x1f')]({'raw':_0x5a9df7[_0x41ab('0x17')]?_0x5a9df7[_0x41ab('0x17')][_0x41ab('0x20')]===undefined?!![]:![]:!![],'where':_0x5a9df7[_0x41ab('0x17')]?_0x5a9df7[_0x41ab('0x17')][_0x41ab('0x21')]||null:null,'attributes':_0x5a9df7[_0x41ab('0x17')]?_0x5a9df7['options'][_0x41ab('0x18')]||null:null,'include':_0x5a9df7[_0x41ab('0x17')]?_0x5a9df7[_0x41ab('0x17')][_0x41ab('0x19')]?_[_0x41ab('0x1a')](_0x5a9df7['options'][_0x41ab('0x19')],function(_0xe90e4e){return{'model':db[_0xe90e4e[_0x41ab('0x1b')]],'as':_0xe90e4e['as'],'attributes':_0xe90e4e[_0x41ab('0x18')],'include':_0xe90e4e[_0x41ab('0x19')]?_['map'](_0xe90e4e[_0x41ab('0x19')],function(_0x32ac15){return{'model':db[_0x32ac15['model']],'as':_0x32ac15['as'],'attributes':_0x32ac15[_0x41ab('0x18')],'include':_0x32ac15['include']?_[_0x41ab('0x1a')](_0x32ac15[_0x41ab('0x19')],function(_0x37aaed){return{'model':db[_0x37aaed['model']],'as':_0x37aaed['as'],'attributes':_0x37aaed['attributes']};}):[]};}):[]};}):[]:[]})[_0x41ab('0x1c')](function(_0x181112){logger[_0x41ab('0xb')]('ShowFreshdeskAccount',_0x5a9df7);logger['debug'](_0x41ab('0x1d'),_0x5a9df7,JSON['stringify'](_0x181112));_0x1174b4(_0x181112);})[_0x41ab('0x14')](function(_0xeba336){logger[_0x41ab('0x10')](_0x41ab('0x1d'),_0xeba336['message'],_0x5a9df7);_0x49ed87(_0x1e26cb[_0x41ab('0x10')](0x1f4,_0xeba336[_0x41ab('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index cd41038..05eeb1d 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 _0x9064=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x2e9cf4,_0x4c0da5){var _0x66831c=function(_0x6d08cc){while(--_0x6d08cc){_0x2e9cf4['push'](_0x2e9cf4['shift']());}};_0x66831c(++_0x4c0da5);}(_0x9064,0x110));var _0x4906=function(_0x4dd6d2,_0x585544){_0x4dd6d2=_0x4dd6d2-0x0;var _0x240a2d=_0x9064[_0x4dd6d2];return _0x240a2d;};'use strict';var multer=require(_0x4906('0x0'));var util=require(_0x4906('0x1'));var path=require('path');var timeout=require(_0x4906('0x2'));var express=require(_0x4906('0x3'));var router=express[_0x4906('0x4')]();var fs_extra=require(_0x4906('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4906('0x6'));var config=require('../../config/environment');var controller=require(_0x4906('0x7'));router[_0x4906('0x8')]('/',auth['isAuthenticated'](),controller[_0x4906('0x9')]);router[_0x4906('0x8')](_0x4906('0xa'),auth[_0x4906('0xb')](),controller[_0x4906('0xc')]);router[_0x4906('0x8')](_0x4906('0xd'),auth[_0x4906('0xb')](),controller['getFields']);router['get'](_0x4906('0xe'),auth[_0x4906('0xb')](),controller[_0x4906('0xf')]);router[_0x4906('0x8')](_0x4906('0x10'),auth['isAuthenticated'](),controller[_0x4906('0x11')]);router['get'](_0x4906('0x12'),auth[_0x4906('0xb')](),controller['getTags']);router[_0x4906('0x13')]('/',auth[_0x4906('0xb')](),controller[_0x4906('0x14')]);router[_0x4906('0x13')](_0x4906('0x12'),auth[_0x4906('0xb')](),controller[_0x4906('0x15')]);router['put'](_0x4906('0xa'),auth['isAuthenticated'](),controller[_0x4906('0x16')]);router[_0x4906('0x17')](_0x4906('0xa'),auth[_0x4906('0xb')](),controller[_0x4906('0x18')]);module[_0x4906('0x19')]=router; \ No newline at end of file +var _0xe4ec=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','/:id/fields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe4ec,0x90));var _0xce4e=function(_0x43ef22,_0x51e0aa){_0x43ef22=_0x43ef22-0x0;var _0x66e56a=_0xe4ec[_0x43ef22];return _0x66e56a;};'use strict';var multer=require(_0xce4e('0x0'));var util=require(_0xce4e('0x1'));var path=require(_0xce4e('0x2'));var timeout=require('connect-timeout');var express=require(_0xce4e('0x3'));var router=express['Router']();var fs_extra=require(_0xce4e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xce4e('0x5'));var config=require(_0xce4e('0x6'));var controller=require(_0xce4e('0x7'));router[_0xce4e('0x8')]('/',auth[_0xce4e('0x9')](),controller['index']);router[_0xce4e('0x8')]('/:id',auth[_0xce4e('0x9')](),controller[_0xce4e('0xa')]);router[_0xce4e('0x8')](_0xce4e('0xb'),auth[_0xce4e('0x9')](),controller['getFields']);router[_0xce4e('0x8')]('/:id/subjects',auth[_0xce4e('0x9')](),controller[_0xce4e('0xc')]);router[_0xce4e('0x8')](_0xce4e('0xd'),auth[_0xce4e('0x9')](),controller[_0xce4e('0xe')]);router[_0xce4e('0x8')](_0xce4e('0xf'),auth['isAuthenticated'](),controller[_0xce4e('0x10')]);router[_0xce4e('0x11')]('/',auth[_0xce4e('0x9')](),controller[_0xce4e('0x12')]);router[_0xce4e('0x11')](_0xce4e('0xf'),auth[_0xce4e('0x9')](),controller[_0xce4e('0x13')]);router[_0xce4e('0x14')](_0xce4e('0x15'),auth['isAuthenticated'](),controller[_0xce4e('0x16')]);router[_0xce4e('0x17')]('/:id',auth[_0xce4e('0x9')](),controller[_0xce4e('0x18')]);module[_0xce4e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 84275c0..c925cd2 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 _0xdde8=['sequelize','exports'];(function(_0x39c75b,_0x51d77c){var _0x1bcabc=function(_0x38cb42){while(--_0x38cb42){_0x39c75b['push'](_0x39c75b['shift']());}};_0x1bcabc(++_0x51d77c);}(_0xdde8,0x190));var _0x8dde=function(_0x12d087,_0x1a2349){_0x12d087=_0x12d087-0x0;var _0x5e812f=_0xdde8[_0x12d087];return _0x5e812f;};'use strict';var Sequelize=require(_0x8dde('0x0'));module[_0x8dde('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x59b8=['sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x59b8,0x102));var _0x859b=function(_0xdc634,_0x4db9d6){_0xdc634=_0xdc634-0x0;var _0x163850=_0x59b8[_0xdc634];return _0x163850;};'use strict';var Sequelize=require(_0x859b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 0698008..3d60c01 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 _0x3c9f=['order','sort','filter','merge','where','map','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','create','body','find','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit'];(function(_0x39e0a0,_0x54c7a0){var _0x24cda2=function(_0x48e8d8){while(--_0x48e8d8){_0x39e0a0['push'](_0x39e0a0['shift']());}};_0x24cda2(++_0x54c7a0);}(_0x3c9f,0x15f));var _0xf3c9=function(_0x28150d,_0x5085dc){_0x28150d=_0x28150d-0x0;var _0x912db2=_0x3c9f[_0x28150d];return _0x912db2;};'use strict';var emlformat=require(_0xf3c9('0x0'));var rimraf=require(_0xf3c9('0x1'));var zipdir=require(_0xf3c9('0x2'));var jsonpatch=require(_0xf3c9('0x3'));var rp=require(_0xf3c9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf3c9('0x5'));var path=require(_0xf3c9('0x6'));var sox=require(_0xf3c9('0x7'));var csv=require('to-csv');var ejs=require(_0xf3c9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3c9('0x9'));var squel=require(_0xf3c9('0xa'));var crypto=require(_0xf3c9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf3c9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf3c9('0xd'));var Papa=require(_0xf3c9('0xe'));var Redis=require(_0xf3c9('0xf'));var authService=require(_0xf3c9('0x10'));var qs=require(_0xf3c9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3c9('0x12'));var logger=require(_0xf3c9('0x13'))(_0xf3c9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3c9('0x15'));var db=require(_0xf3c9('0x16'))['db'];function respondWithStatusCode(_0x3f26f6,_0x7e3974){_0x7e3974=_0x7e3974||0xcc;return function(_0x319215){if(_0x319215){return _0x3f26f6[_0xf3c9('0x17')](_0x7e3974);}return _0x3f26f6[_0xf3c9('0x18')](_0x7e3974)['end']();};}function respondWithResult(_0x3a6600,_0xb6211c){_0xb6211c=_0xb6211c||0xc8;return function(_0x260939){if(_0x260939){return _0x3a6600[_0xf3c9('0x18')](_0xb6211c)['json'](_0x260939);}};}function respondWithFilteredResult(_0x2a7649,_0x10512f){return function(_0x17ed19){if(_0x17ed19){var _0x445a59=typeof _0x10512f[_0xf3c9('0x19')]===_0xf3c9('0x1a')&&typeof _0x10512f[_0xf3c9('0x1b')]==='undefined';var _0x58c7b1=_0x17ed19[_0xf3c9('0x1c')];var _0x4e8e64=_0x445a59?0x0:_0x10512f[_0xf3c9('0x19')];var _0x5bb514=_0x445a59?_0x17ed19[_0xf3c9('0x1c')]:_0x10512f['offset']+_0x10512f[_0xf3c9('0x1b')];var _0x328e92;if(_0x5bb514>=_0x58c7b1){_0x5bb514=_0x58c7b1;_0x328e92=0xc8;}else{_0x328e92=0xce;}_0x2a7649[_0xf3c9('0x18')](_0x328e92);return _0x2a7649[_0xf3c9('0x1d')]('Content-Range',_0x4e8e64+'-'+_0x5bb514+'/'+_0x58c7b1)['json'](_0x17ed19);}return null;};}function patchUpdates(_0x72a55b){return function(_0x4ce57a){try{jsonpatch[_0xf3c9('0x1e')](_0x4ce57a,_0x72a55b,!![]);}catch(_0x4c2d30){return BPromise[_0xf3c9('0x1f')](_0x4c2d30);}return _0x4ce57a[_0xf3c9('0x20')]();};}function saveUpdates(_0xabc81d,_0x56dbff){return function(_0x429d9d){if(_0x429d9d){return _0x429d9d[_0xf3c9('0x21')](_0xabc81d)[_0xf3c9('0x22')](function(_0x38cde9){return _0x38cde9;});}return null;};}function removeEntity(_0x4f626c,_0x4c0154){return function(_0x5046c6){if(_0x5046c6){return _0x5046c6[_0xf3c9('0x23')]()[_0xf3c9('0x22')](function(){_0x4f626c[_0xf3c9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f5dbd,_0x5aac32){return function(_0x25b14c){if(!_0x25b14c){_0x5f5dbd[_0xf3c9('0x17')](0x194);}return _0x25b14c;};}function handleError(_0x30d566,_0x5b1710){_0x5b1710=_0x5b1710||0x1f4;return function(_0x318ec5){logger['error'](_0x318ec5[_0xf3c9('0x24')]);if(_0x318ec5['name']){delete _0x318ec5[_0xf3c9('0x25')];}_0x30d566['status'](_0x5b1710)[_0xf3c9('0x26')](_0x318ec5);};}exports[_0xf3c9('0x27')]=function(_0x8bf679,_0x45958d){var _0x456deb={},_0x780fa1={},_0xca94c={'count':0x0,'rows':[]};var _0x4c7f9d=_['map'](db[_0xf3c9('0x28')][_0xf3c9('0x29')],function(_0x47a31f){return{'name':_0x47a31f[_0xf3c9('0x2a')],'type':_0x47a31f[_0xf3c9('0x2b')][_0xf3c9('0x2c')]};});_0x780fa1[_0xf3c9('0x2d')]=_['map'](_0x4c7f9d,_0xf3c9('0x25'));_0x780fa1[_0xf3c9('0x2e')]=_[_0xf3c9('0x2f')](_0x8bf679[_0xf3c9('0x2e')]);_0x780fa1[_0xf3c9('0x30')]=_['intersection'](_0x780fa1[_0xf3c9('0x2d')],_0x780fa1[_0xf3c9('0x2e')]);_0x456deb[_0xf3c9('0x31')]=_[_0xf3c9('0x32')](_0x780fa1[_0xf3c9('0x2d')],qs[_0xf3c9('0x33')](_0x8bf679[_0xf3c9('0x2e')][_0xf3c9('0x33')]));_0x456deb[_0xf3c9('0x31')]=_0x456deb[_0xf3c9('0x31')]['length']?_0x456deb[_0xf3c9('0x31')]:_0x780fa1[_0xf3c9('0x2d')];if(!_0x8bf679[_0xf3c9('0x2e')][_0xf3c9('0x34')](_0xf3c9('0x35'))){_0x456deb[_0xf3c9('0x1b')]=qs[_0xf3c9('0x1b')](_0x8bf679[_0xf3c9('0x2e')][_0xf3c9('0x1b')]);_0x456deb[_0xf3c9('0x19')]=qs[_0xf3c9('0x19')](_0x8bf679[_0xf3c9('0x2e')]['offset']);}_0x456deb[_0xf3c9('0x36')]=qs['sort'](_0x8bf679[_0xf3c9('0x2e')][_0xf3c9('0x37')]);_0x456deb['where']=qs[_0xf3c9('0x30')](_['pick'](_0x8bf679[_0xf3c9('0x2e')],_0x780fa1['filters']),_0x4c7f9d);if(_0x8bf679['query'][_0xf3c9('0x38')]){_0x456deb['where']=_[_0xf3c9('0x39')](_0x456deb[_0xf3c9('0x3a')],{'$or':_[_0xf3c9('0x3b')](_0x4c7f9d,function(_0x339327){if(_0x339327[_0xf3c9('0x2b')]!==_0xf3c9('0x3c')){var _0x3ac3e7={};_0x3ac3e7[_0x339327['name']]={'$like':'%'+_0x8bf679[_0xf3c9('0x2e')][_0xf3c9('0x38')]+'%'};return _0x3ac3e7;}})});}_0x456deb=_[_0xf3c9('0x39')]({},_0x456deb,_0x8bf679[_0xf3c9('0x3d')]);var _0x5ad6c7={'where':_0x456deb['where']};return db[_0xf3c9('0x28')]['count'](_0x5ad6c7)[_0xf3c9('0x22')](function(_0x3216d6){_0xca94c[_0xf3c9('0x1c')]=_0x3216d6;if(_0x8bf679[_0xf3c9('0x2e')]['includeAll']){_0x456deb[_0xf3c9('0x3e')]=[{'all':!![]}];}return db[_0xf3c9('0x28')][_0xf3c9('0x3f')](_0x456deb);})['then'](function(_0x5c5759){_0xca94c['rows']=_0x5c5759;return _0xca94c;})['then'](respondWithFilteredResult(_0x45958d,_0x456deb))[_0xf3c9('0x40')](handleError(_0x45958d,null));};exports[_0xf3c9('0x41')]=function(_0x470d90,_0x213637){var _0x2bdfec={'raw':![],'where':{'id':_0x470d90[_0xf3c9('0x42')]['id']}},_0x385309={};_0x385309[_0xf3c9('0x2d')]=_[_0xf3c9('0x2f')](db[_0xf3c9('0x28')][_0xf3c9('0x29')]);_0x385309[_0xf3c9('0x2e')]=_[_0xf3c9('0x2f')](_0x470d90[_0xf3c9('0x2e')]);_0x385309[_0xf3c9('0x30')]=_[_0xf3c9('0x32')](_0x385309[_0xf3c9('0x2d')],_0x385309['query']);_0x2bdfec[_0xf3c9('0x31')]=_[_0xf3c9('0x32')](_0x385309[_0xf3c9('0x2d')],qs['fields'](_0x470d90[_0xf3c9('0x2e')][_0xf3c9('0x33')]));_0x2bdfec[_0xf3c9('0x31')]=_0x2bdfec[_0xf3c9('0x31')][_0xf3c9('0x43')]?_0x2bdfec[_0xf3c9('0x31')]:_0x385309[_0xf3c9('0x2d')];if(_0x470d90[_0xf3c9('0x2e')][_0xf3c9('0x44')]){_0x2bdfec['include']=[{'all':!![]}];}_0x2bdfec=_[_0xf3c9('0x39')]({},_0x2bdfec,_0x470d90['options']);return db['FreshdeskConfiguration']['find'](_0x2bdfec)[_0xf3c9('0x22')](handleEntityNotFound(_0x213637,null))[_0xf3c9('0x22')](respondWithResult(_0x213637,null))['catch'](handleError(_0x213637,null));};exports[_0xf3c9('0x45')]=function(_0x53f935,_0x21e4bd){return db[_0xf3c9('0x28')][_0xf3c9('0x45')](_0x53f935[_0xf3c9('0x46')],{})[_0xf3c9('0x22')](respondWithResult(_0x21e4bd,0xc9))[_0xf3c9('0x40')](handleError(_0x21e4bd,null));};exports[_0xf3c9('0x21')]=function(_0x42aeb4,_0x3f1fdc){if(_0x42aeb4[_0xf3c9('0x46')]['id']){delete _0x42aeb4['body']['id'];}return db[_0xf3c9('0x28')]['find']({'where':{'id':_0x42aeb4['params']['id']}})[_0xf3c9('0x22')](handleEntityNotFound(_0x3f1fdc,null))[_0xf3c9('0x22')](saveUpdates(_0x42aeb4['body'],null))[_0xf3c9('0x22')](respondWithResult(_0x3f1fdc,null))[_0xf3c9('0x40')](handleError(_0x3f1fdc,null));};exports[_0xf3c9('0x23')]=function(_0x5a8a67,_0x281383){return db[_0xf3c9('0x28')][_0xf3c9('0x47')]({'where':{'id':_0x5a8a67[_0xf3c9('0x42')]['id']}})[_0xf3c9('0x22')](handleEntityNotFound(_0x281383,null))['then'](removeEntity(_0x281383,null))['catch'](handleError(_0x281383,null));};exports[_0xf3c9('0x48')]=function(_0x275cc0,_0x4568d1,_0x776867){var _0x4d04a4={};var _0x219958={};var _0x4b9fa2;var _0x5c9beb;return db[_0xf3c9('0x28')][_0xf3c9('0x49')]({'where':{'id':_0x275cc0[_0xf3c9('0x42')]['id']}})[_0xf3c9('0x22')](handleEntityNotFound(_0x4568d1,null))['then'](function(_0x4686d5){if(_0x4686d5){_0x4b9fa2=_0x4686d5;_0x219958[_0xf3c9('0x2d')]=_[_0xf3c9('0x2f')](db[_0xf3c9('0x4a')][_0xf3c9('0x29')]);_0x219958[_0xf3c9('0x2e')]=_['keys'](_0x275cc0[_0xf3c9('0x2e')]);_0x219958[_0xf3c9('0x30')]=_[_0xf3c9('0x32')](_0x219958[_0xf3c9('0x2d')],_0x219958['query']);_0x4d04a4[_0xf3c9('0x31')]=_[_0xf3c9('0x32')](_0x219958[_0xf3c9('0x2d')],qs['fields'](_0x275cc0[_0xf3c9('0x2e')]['fields']));_0x4d04a4[_0xf3c9('0x31')]=_0x4d04a4[_0xf3c9('0x31')]['length']?_0x4d04a4[_0xf3c9('0x31')]:_0x219958[_0xf3c9('0x2d')];_0x4d04a4[_0xf3c9('0x36')]=qs[_0xf3c9('0x37')](_0x275cc0[_0xf3c9('0x2e')]['sort']);_0x4d04a4[_0xf3c9('0x3a')]=qs['filters'](_[_0xf3c9('0x4b')](_0x275cc0[_0xf3c9('0x2e')],_0x219958['filters']));if(_0x275cc0[_0xf3c9('0x2e')]['filter']){_0x4d04a4[_0xf3c9('0x3a')]=_[_0xf3c9('0x39')](_0x4d04a4[_0xf3c9('0x3a')],{'$or':_[_0xf3c9('0x3b')](_0x4d04a4['attributes'],function(_0x265d7a){var _0x5abfca={};_0x5abfca[_0x265d7a]={'$like':'%'+_0x275cc0[_0xf3c9('0x2e')][_0xf3c9('0x38')]+'%'};return _0x5abfca;})});}_0x4d04a4=_[_0xf3c9('0x39')]({},_0x4d04a4,_0x275cc0[_0xf3c9('0x3d')]);return _0x4b9fa2[_0xf3c9('0x48')](_0x4d04a4);}})[_0xf3c9('0x22')](function(_0x33ccd7){if(_0x33ccd7){_0x5c9beb=_0x33ccd7['length'];if(!_0x275cc0['query'][_0xf3c9('0x34')](_0xf3c9('0x35'))){_0x4d04a4[_0xf3c9('0x1b')]=qs[_0xf3c9('0x1b')](_0x275cc0[_0xf3c9('0x2e')]['limit']);_0x4d04a4[_0xf3c9('0x19')]=qs['offset'](_0x275cc0[_0xf3c9('0x2e')][_0xf3c9('0x19')]);}return _0x4b9fa2[_0xf3c9('0x48')](_0x4d04a4);}})['then'](function(_0xe2d1b1){if(_0xe2d1b1){return _0xe2d1b1?{'count':_0x5c9beb,'rows':_0xe2d1b1}:null;}})[_0xf3c9('0x22')](respondWithResult(_0x4568d1,null))[_0xf3c9('0x40')](handleError(_0x4568d1,null));};exports['getSubjects']=function(_0x365876,_0x5ddf24,_0x5496c3){var _0x220ba1={};var _0x29c666={};var _0x58566e;var _0x459b11;return db[_0xf3c9('0x28')][_0xf3c9('0x49')]({'where':{'id':_0x365876[_0xf3c9('0x42')]['id']}})[_0xf3c9('0x22')](handleEntityNotFound(_0x5ddf24,null))[_0xf3c9('0x22')](function(_0xb666ce){if(_0xb666ce){_0x58566e=_0xb666ce;_0x29c666[_0xf3c9('0x2d')]=_['keys'](db[_0xf3c9('0x4a')][_0xf3c9('0x29')]);_0x29c666[_0xf3c9('0x2e')]=_['keys'](_0x365876[_0xf3c9('0x2e')]);_0x29c666[_0xf3c9('0x30')]=_[_0xf3c9('0x32')](_0x29c666[_0xf3c9('0x2d')],_0x29c666[_0xf3c9('0x2e')]);_0x220ba1[_0xf3c9('0x31')]=_[_0xf3c9('0x32')](_0x29c666['model'],qs['fields'](_0x365876['query'][_0xf3c9('0x33')]));_0x220ba1[_0xf3c9('0x31')]=_0x220ba1[_0xf3c9('0x31')]['length']?_0x220ba1[_0xf3c9('0x31')]:_0x29c666[_0xf3c9('0x2d')];_0x220ba1['order']=qs[_0xf3c9('0x37')](_0x365876[_0xf3c9('0x2e')][_0xf3c9('0x37')]);_0x220ba1[_0xf3c9('0x3a')]=qs['filters'](_[_0xf3c9('0x4b')](_0x365876[_0xf3c9('0x2e')],_0x29c666[_0xf3c9('0x30')]));if(_0x365876['query'][_0xf3c9('0x38')]){_0x220ba1['where']=_['merge'](_0x220ba1['where'],{'$or':_[_0xf3c9('0x3b')](_0x220ba1[_0xf3c9('0x31')],function(_0x2634f1){var _0x68d113={};_0x68d113[_0x2634f1]={'$like':'%'+_0x365876[_0xf3c9('0x2e')][_0xf3c9('0x38')]+'%'};return _0x68d113;})});}_0x220ba1=_[_0xf3c9('0x39')]({},_0x220ba1,_0x365876[_0xf3c9('0x3d')]);return _0x58566e['getSubjects'](_0x220ba1);}})[_0xf3c9('0x22')](function(_0x409c7f){if(_0x409c7f){_0x459b11=_0x409c7f[_0xf3c9('0x43')];if(!_0x365876[_0xf3c9('0x2e')]['hasOwnProperty']('nolimit')){_0x220ba1['limit']=qs[_0xf3c9('0x1b')](_0x365876['query']['limit']);_0x220ba1[_0xf3c9('0x19')]=qs[_0xf3c9('0x19')](_0x365876[_0xf3c9('0x2e')][_0xf3c9('0x19')]);}return _0x58566e[_0xf3c9('0x4c')](_0x220ba1);}})[_0xf3c9('0x22')](function(_0x298eae){if(_0x298eae){return _0x298eae?{'count':_0x459b11,'rows':_0x298eae}:null;}})['then'](respondWithResult(_0x5ddf24,null))[_0xf3c9('0x40')](handleError(_0x5ddf24,null));};exports[_0xf3c9('0x4d')]=function(_0x461527,_0x264ba9,_0x1c4236){var _0x271225={};var _0x38412c={};var _0x1239f8;var _0x1c50ac;return db[_0xf3c9('0x28')][_0xf3c9('0x49')]({'where':{'id':_0x461527[_0xf3c9('0x42')]['id']}})['then'](handleEntityNotFound(_0x264ba9,null))[_0xf3c9('0x22')](function(_0x31d88e){if(_0x31d88e){_0x1239f8=_0x31d88e;_0x38412c['model']=_[_0xf3c9('0x2f')](db[_0xf3c9('0x4a')][_0xf3c9('0x29')]);_0x38412c[_0xf3c9('0x2e')]=_[_0xf3c9('0x2f')](_0x461527[_0xf3c9('0x2e')]);_0x38412c[_0xf3c9('0x30')]=_['intersection'](_0x38412c['model'],_0x38412c[_0xf3c9('0x2e')]);_0x271225['attributes']=_['intersection'](_0x38412c[_0xf3c9('0x2d')],qs[_0xf3c9('0x33')](_0x461527['query'][_0xf3c9('0x33')]));_0x271225[_0xf3c9('0x31')]=_0x271225[_0xf3c9('0x31')]['length']?_0x271225[_0xf3c9('0x31')]:_0x38412c[_0xf3c9('0x2d')];_0x271225[_0xf3c9('0x36')]=qs[_0xf3c9('0x37')](_0x461527[_0xf3c9('0x2e')]['sort']);_0x271225[_0xf3c9('0x3a')]=qs[_0xf3c9('0x30')](_[_0xf3c9('0x4b')](_0x461527['query'],_0x38412c[_0xf3c9('0x30')]));if(_0x461527[_0xf3c9('0x2e')]['filter']){_0x271225[_0xf3c9('0x3a')]=_[_0xf3c9('0x39')](_0x271225['where'],{'$or':_[_0xf3c9('0x3b')](_0x271225[_0xf3c9('0x31')],function(_0x43a9b9){var _0x24865e={};_0x24865e[_0x43a9b9]={'$like':'%'+_0x461527[_0xf3c9('0x2e')][_0xf3c9('0x38')]+'%'};return _0x24865e;})});}_0x271225=_[_0xf3c9('0x39')]({},_0x271225,_0x461527[_0xf3c9('0x3d')]);return _0x1239f8[_0xf3c9('0x4d')](_0x271225);}})['then'](function(_0x5ddd46){if(_0x5ddd46){_0x1c50ac=_0x5ddd46[_0xf3c9('0x43')];if(!_0x461527[_0xf3c9('0x2e')][_0xf3c9('0x34')]('nolimit')){_0x271225['limit']=qs[_0xf3c9('0x1b')](_0x461527[_0xf3c9('0x2e')][_0xf3c9('0x1b')]);_0x271225[_0xf3c9('0x19')]=qs['offset'](_0x461527['query']['offset']);}return _0x1239f8['getDescriptions'](_0x271225);}})['then'](function(_0x556d45){if(_0x556d45){return _0x556d45?{'count':_0x1c50ac,'rows':_0x556d45}:null;}})['then'](respondWithResult(_0x264ba9,null))['catch'](handleError(_0x264ba9,null));};exports[_0xf3c9('0x4e')]=function(_0x3a37ad,_0x4ade58,_0x349059){var _0x29df6e={};var _0x2f2eb0={};var _0x1cc5fb;var _0x192a34;return db[_0xf3c9('0x28')][_0xf3c9('0x49')]({'where':{'id':_0x3a37ad[_0xf3c9('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ade58,null))[_0xf3c9('0x22')](function(_0x326b0b){if(_0x326b0b){_0x1cc5fb=_0x326b0b;_0x2f2eb0['model']=_[_0xf3c9('0x2f')](db[_0xf3c9('0x4f')][_0xf3c9('0x29')]);_0x2f2eb0[_0xf3c9('0x2e')]=_[_0xf3c9('0x2f')](_0x3a37ad[_0xf3c9('0x2e')]);_0x2f2eb0[_0xf3c9('0x30')]=_[_0xf3c9('0x32')](_0x2f2eb0[_0xf3c9('0x2d')],_0x2f2eb0['query']);_0x29df6e[_0xf3c9('0x31')]=_['intersection'](_0x2f2eb0['model'],qs[_0xf3c9('0x33')](_0x3a37ad[_0xf3c9('0x2e')]['fields']));_0x29df6e['attributes']=_0x29df6e[_0xf3c9('0x31')][_0xf3c9('0x43')]?_0x29df6e[_0xf3c9('0x31')]:_0x2f2eb0[_0xf3c9('0x2d')];_0x29df6e[_0xf3c9('0x36')]=qs['sort'](_0x3a37ad[_0xf3c9('0x2e')]['sort']);_0x29df6e[_0xf3c9('0x3a')]=qs[_0xf3c9('0x30')](_[_0xf3c9('0x4b')](_0x3a37ad[_0xf3c9('0x2e')],_0x2f2eb0[_0xf3c9('0x30')]));if(_0x3a37ad[_0xf3c9('0x2e')][_0xf3c9('0x38')]){_0x29df6e[_0xf3c9('0x3a')]=_[_0xf3c9('0x39')](_0x29df6e[_0xf3c9('0x3a')],{'$or':_[_0xf3c9('0x3b')](_0x29df6e[_0xf3c9('0x31')],function(_0x38309c){var _0x38f13d={};_0x38f13d[_0x38309c]={'$like':'%'+_0x3a37ad[_0xf3c9('0x2e')][_0xf3c9('0x38')]+'%'};return _0x38f13d;})});}_0x29df6e=_['merge']({},_0x29df6e,_0x3a37ad[_0xf3c9('0x3d')]);return _0x1cc5fb[_0xf3c9('0x4e')](_0x29df6e);}})[_0xf3c9('0x22')](function(_0x18bb40){if(_0x18bb40){_0x192a34=_0x18bb40[_0xf3c9('0x43')];if(!_0x3a37ad['query'][_0xf3c9('0x34')]('nolimit')){_0x29df6e[_0xf3c9('0x1b')]=qs[_0xf3c9('0x1b')](_0x3a37ad[_0xf3c9('0x2e')]['limit']);_0x29df6e['offset']=qs[_0xf3c9('0x19')](_0x3a37ad[_0xf3c9('0x2e')][_0xf3c9('0x19')]);}return _0x1cc5fb['getTags'](_0x29df6e);}})['then'](function(_0x3ff5de){if(_0x3ff5de){return _0x3ff5de?{'count':_0x192a34,'rows':_0x3ff5de}:null;}})['then'](respondWithResult(_0x4ade58,null))[_0xf3c9('0x40')](handleError(_0x4ade58,null));};exports[_0xf3c9('0x50')]=function(_0x5ae7b0,_0x51f1d9,_0x113cd9){if(_0x5ae7b0['body']['id']){delete _0x5ae7b0[_0xf3c9('0x46')]['id'];}return db[_0xf3c9('0x28')][_0xf3c9('0x49')]({'where':{'id':_0x5ae7b0['params']['id']}})[_0xf3c9('0x22')](handleEntityNotFound(_0x51f1d9,null))[_0xf3c9('0x22')](function(_0xfbbd65){if(_0xfbbd65){return _0xfbbd65[_0xf3c9('0x50')](_0x5ae7b0[_0xf3c9('0x46')]['ids']||[]);}return null;})[_0xf3c9('0x22')](respondWithResult(_0x51f1d9,null))[_0xf3c9('0x40')](handleError(_0x51f1d9,null));}; \ No newline at end of file +var _0x7163=['FreshdeskConfiguration','includeAll','include','findAll','catch','show','fields','merge','find','create','body','params','FreshdeskField','order','getFields','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','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','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','limit','sort','filters','pick','where','VIRTUAL','filter','options'];(function(_0x430127,_0x17cdbb){var _0x1761ce=function(_0x1b9318){while(--_0x1b9318){_0x430127['push'](_0x430127['shift']());}};_0x1761ce(++_0x17cdbb);}(_0x7163,0x1cb));var _0x3716=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x7163[_0x18cac4];return _0x2227c6;};'use strict';var emlformat=require(_0x3716('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3716('0x1'));var jsonpatch=require(_0x3716('0x2'));var rp=require(_0x3716('0x3'));var moment=require('moment');var BPromise=require(_0x3716('0x4'));var Mustache=require(_0x3716('0x5'));var util=require(_0x3716('0x6'));var path=require(_0x3716('0x7'));var sox=require('sox');var csv=require(_0x3716('0x8'));var ejs=require(_0x3716('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3716('0xa'));var squel=require(_0x3716('0xb'));var crypto=require(_0x3716('0xc'));var jsforce=require(_0x3716('0xd'));var deskjs=require(_0x3716('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3716('0xf'));var Papa=require(_0x3716('0x10'));var Redis=require('ioredis');var authService=require(_0x3716('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3716('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3716('0x13'))(_0x3716('0x14'));var utils=require(_0x3716('0x15'));var config=require(_0x3716('0x16'));var licenseUtil=require(_0x3716('0x17'));var db=require(_0x3716('0x18'))['db'];function respondWithStatusCode(_0x4d97a1,_0x603b99){_0x603b99=_0x603b99||0xcc;return function(_0x2ff3da){if(_0x2ff3da){return _0x4d97a1[_0x3716('0x19')](_0x603b99);}return _0x4d97a1[_0x3716('0x1a')](_0x603b99)[_0x3716('0x1b')]();};}function respondWithResult(_0x12f1e5,_0xb20093){_0xb20093=_0xb20093||0xc8;return function(_0xbb8143){if(_0xbb8143){return _0x12f1e5[_0x3716('0x1a')](_0xb20093)[_0x3716('0x1c')](_0xbb8143);}};}function respondWithFilteredResult(_0x3e6bde,_0x9bb0b2){return function(_0x218aef){if(_0x218aef){var _0x84d520=typeof _0x9bb0b2[_0x3716('0x1d')]===_0x3716('0x1e')&&typeof _0x9bb0b2['limit']==='undefined';var _0x52eef8=_0x218aef['count'];var _0x4a4f3e=_0x84d520?0x0:_0x9bb0b2[_0x3716('0x1d')];var _0x478a2e=_0x84d520?_0x218aef[_0x3716('0x1f')]:_0x9bb0b2[_0x3716('0x1d')]+_0x9bb0b2['limit'];var _0x3d2d4b;if(_0x478a2e>=_0x52eef8){_0x478a2e=_0x52eef8;_0x3d2d4b=0xc8;}else{_0x3d2d4b=0xce;}_0x3e6bde[_0x3716('0x1a')](_0x3d2d4b);return _0x3e6bde[_0x3716('0x20')](_0x3716('0x21'),_0x4a4f3e+'-'+_0x478a2e+'/'+_0x52eef8)[_0x3716('0x1c')](_0x218aef);}return null;};}function patchUpdates(_0x4b1869){return function(_0x393912){try{jsonpatch[_0x3716('0x22')](_0x393912,_0x4b1869,!![]);}catch(_0x348d87){return BPromise[_0x3716('0x23')](_0x348d87);}return _0x393912['save']();};}function saveUpdates(_0x3af604,_0x5aebe7){return function(_0x435d14){if(_0x435d14){return _0x435d14[_0x3716('0x24')](_0x3af604)[_0x3716('0x25')](function(_0x19cffa){return _0x19cffa;});}return null;};}function removeEntity(_0x45ddf3,_0x58c16f){return function(_0x381b12){if(_0x381b12){return _0x381b12[_0x3716('0x26')]()['then'](function(){_0x45ddf3[_0x3716('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590370,_0x4befc5){return function(_0x3d6444){if(!_0x3d6444){_0x590370['sendStatus'](0x194);}return _0x3d6444;};}function handleError(_0x409701,_0x1dc783){_0x1dc783=_0x1dc783||0x1f4;return function(_0x5f1ee0){logger[_0x3716('0x27')](_0x5f1ee0[_0x3716('0x28')]);if(_0x5f1ee0[_0x3716('0x29')]){delete _0x5f1ee0[_0x3716('0x29')];}_0x409701[_0x3716('0x1a')](_0x1dc783)[_0x3716('0x2a')](_0x5f1ee0);};}exports[_0x3716('0x2b')]=function(_0x24a1a5,_0x33d1b2){var _0x235088={},_0xb0fd31={},_0x5727ac={'count':0x0,'rows':[]};var _0x11b0cc=_[_0x3716('0x2c')](db['FreshdeskConfiguration'][_0x3716('0x2d')],function(_0x539f9e){return{'name':_0x539f9e[_0x3716('0x2e')],'type':_0x539f9e[_0x3716('0x2f')][_0x3716('0x30')]};});_0xb0fd31['model']=_[_0x3716('0x2c')](_0x11b0cc,_0x3716('0x29'));_0xb0fd31[_0x3716('0x31')]=_[_0x3716('0x32')](_0x24a1a5[_0x3716('0x31')]);_0xb0fd31['filters']=_[_0x3716('0x33')](_0xb0fd31[_0x3716('0x34')],_0xb0fd31[_0x3716('0x31')]);_0x235088[_0x3716('0x35')]=_['intersection'](_0xb0fd31['model'],qs['fields'](_0x24a1a5[_0x3716('0x31')]['fields']));_0x235088[_0x3716('0x35')]=_0x235088[_0x3716('0x35')][_0x3716('0x36')]?_0x235088['attributes']:_0xb0fd31['model'];if(!_0x24a1a5[_0x3716('0x31')]['hasOwnProperty']('nolimit')){_0x235088[_0x3716('0x37')]=qs[_0x3716('0x37')](_0x24a1a5[_0x3716('0x31')][_0x3716('0x37')]);_0x235088[_0x3716('0x1d')]=qs[_0x3716('0x1d')](_0x24a1a5[_0x3716('0x31')][_0x3716('0x1d')]);}_0x235088['order']=qs[_0x3716('0x38')](_0x24a1a5[_0x3716('0x31')][_0x3716('0x38')]);_0x235088['where']=qs[_0x3716('0x39')](_[_0x3716('0x3a')](_0x24a1a5[_0x3716('0x31')],_0xb0fd31[_0x3716('0x39')]),_0x11b0cc);if(_0x24a1a5['query']['filter']){_0x235088[_0x3716('0x3b')]=_['merge'](_0x235088['where'],{'$or':_[_0x3716('0x2c')](_0x11b0cc,function(_0x422a9b){if(_0x422a9b[_0x3716('0x2f')]!==_0x3716('0x3c')){var _0x1d102b={};_0x1d102b[_0x422a9b[_0x3716('0x29')]]={'$like':'%'+_0x24a1a5['query'][_0x3716('0x3d')]+'%'};return _0x1d102b;}})});}_0x235088=_['merge']({},_0x235088,_0x24a1a5[_0x3716('0x3e')]);var _0x89b4f={'where':_0x235088[_0x3716('0x3b')]};return db[_0x3716('0x3f')][_0x3716('0x1f')](_0x89b4f)[_0x3716('0x25')](function(_0x1b69ff){_0x5727ac['count']=_0x1b69ff;if(_0x24a1a5[_0x3716('0x31')][_0x3716('0x40')]){_0x235088[_0x3716('0x41')]=[{'all':!![]}];}return db[_0x3716('0x3f')][_0x3716('0x42')](_0x235088);})[_0x3716('0x25')](function(_0x2fc47b){_0x5727ac['rows']=_0x2fc47b;return _0x5727ac;})[_0x3716('0x25')](respondWithFilteredResult(_0x33d1b2,_0x235088))[_0x3716('0x43')](handleError(_0x33d1b2,null));};exports[_0x3716('0x44')]=function(_0x3e52fe,_0x125a4d){var _0x13e7f8={'raw':![],'where':{'id':_0x3e52fe['params']['id']}},_0x2c5b89={};_0x2c5b89['model']=_[_0x3716('0x32')](db['FreshdeskConfiguration']['rawAttributes']);_0x2c5b89[_0x3716('0x31')]=_[_0x3716('0x32')](_0x3e52fe[_0x3716('0x31')]);_0x2c5b89[_0x3716('0x39')]=_[_0x3716('0x33')](_0x2c5b89['model'],_0x2c5b89['query']);_0x13e7f8[_0x3716('0x35')]=_['intersection'](_0x2c5b89['model'],qs['fields'](_0x3e52fe[_0x3716('0x31')][_0x3716('0x45')]));_0x13e7f8[_0x3716('0x35')]=_0x13e7f8[_0x3716('0x35')][_0x3716('0x36')]?_0x13e7f8[_0x3716('0x35')]:_0x2c5b89['model'];if(_0x3e52fe[_0x3716('0x31')]['includeAll']){_0x13e7f8[_0x3716('0x41')]=[{'all':!![]}];}_0x13e7f8=_[_0x3716('0x46')]({},_0x13e7f8,_0x3e52fe[_0x3716('0x3e')]);return db[_0x3716('0x3f')][_0x3716('0x47')](_0x13e7f8)[_0x3716('0x25')](handleEntityNotFound(_0x125a4d,null))[_0x3716('0x25')](respondWithResult(_0x125a4d,null))[_0x3716('0x43')](handleError(_0x125a4d,null));};exports[_0x3716('0x48')]=function(_0x83aaf3,_0x1b046e){return db[_0x3716('0x3f')]['create'](_0x83aaf3[_0x3716('0x49')],{})['then'](respondWithResult(_0x1b046e,0xc9))[_0x3716('0x43')](handleError(_0x1b046e,null));};exports['update']=function(_0x55858e,_0x2e159a){if(_0x55858e['body']['id']){delete _0x55858e[_0x3716('0x49')]['id'];}return db[_0x3716('0x3f')][_0x3716('0x47')]({'where':{'id':_0x55858e[_0x3716('0x4a')]['id']}})[_0x3716('0x25')](handleEntityNotFound(_0x2e159a,null))[_0x3716('0x25')](saveUpdates(_0x55858e['body'],null))[_0x3716('0x25')](respondWithResult(_0x2e159a,null))[_0x3716('0x43')](handleError(_0x2e159a,null));};exports[_0x3716('0x26')]=function(_0x4682d8,_0x41cb39){return db[_0x3716('0x3f')][_0x3716('0x47')]({'where':{'id':_0x4682d8[_0x3716('0x4a')]['id']}})[_0x3716('0x25')](handleEntityNotFound(_0x41cb39,null))[_0x3716('0x25')](removeEntity(_0x41cb39,null))[_0x3716('0x43')](handleError(_0x41cb39,null));};exports['getFields']=function(_0x4a33f4,_0x22ce22,_0x46052d){var _0x3c4bad={};var _0xd3da78={};var _0x1e7203;var _0xf863d6;return db[_0x3716('0x3f')]['findOne']({'where':{'id':_0x4a33f4[_0x3716('0x4a')]['id']}})[_0x3716('0x25')](handleEntityNotFound(_0x22ce22,null))[_0x3716('0x25')](function(_0xf26336){if(_0xf26336){_0x1e7203=_0xf26336;_0xd3da78[_0x3716('0x34')]=_[_0x3716('0x32')](db[_0x3716('0x4b')][_0x3716('0x2d')]);_0xd3da78['query']=_[_0x3716('0x32')](_0x4a33f4[_0x3716('0x31')]);_0xd3da78['filters']=_['intersection'](_0xd3da78[_0x3716('0x34')],_0xd3da78['query']);_0x3c4bad[_0x3716('0x35')]=_[_0x3716('0x33')](_0xd3da78[_0x3716('0x34')],qs[_0x3716('0x45')](_0x4a33f4['query'][_0x3716('0x45')]));_0x3c4bad['attributes']=_0x3c4bad['attributes'][_0x3716('0x36')]?_0x3c4bad[_0x3716('0x35')]:_0xd3da78[_0x3716('0x34')];_0x3c4bad[_0x3716('0x4c')]=qs[_0x3716('0x38')](_0x4a33f4[_0x3716('0x31')][_0x3716('0x38')]);_0x3c4bad[_0x3716('0x3b')]=qs[_0x3716('0x39')](_['pick'](_0x4a33f4[_0x3716('0x31')],_0xd3da78[_0x3716('0x39')]));if(_0x4a33f4['query'][_0x3716('0x3d')]){_0x3c4bad[_0x3716('0x3b')]=_[_0x3716('0x46')](_0x3c4bad[_0x3716('0x3b')],{'$or':_['map'](_0x3c4bad[_0x3716('0x35')],function(_0x2bcb1c){var _0x4c01c6={};_0x4c01c6[_0x2bcb1c]={'$like':'%'+_0x4a33f4[_0x3716('0x31')][_0x3716('0x3d')]+'%'};return _0x4c01c6;})});}_0x3c4bad=_[_0x3716('0x46')]({},_0x3c4bad,_0x4a33f4[_0x3716('0x3e')]);return _0x1e7203[_0x3716('0x4d')](_0x3c4bad);}})[_0x3716('0x25')](function(_0xe07428){if(_0xe07428){_0xf863d6=_0xe07428[_0x3716('0x36')];if(!_0x4a33f4[_0x3716('0x31')][_0x3716('0x4e')](_0x3716('0x4f'))){_0x3c4bad[_0x3716('0x37')]=qs[_0x3716('0x37')](_0x4a33f4[_0x3716('0x31')][_0x3716('0x37')]);_0x3c4bad[_0x3716('0x1d')]=qs[_0x3716('0x1d')](_0x4a33f4['query'][_0x3716('0x1d')]);}return _0x1e7203[_0x3716('0x4d')](_0x3c4bad);}})[_0x3716('0x25')](function(_0x15e890){if(_0x15e890){return _0x15e890?{'count':_0xf863d6,'rows':_0x15e890}:null;}})[_0x3716('0x25')](respondWithResult(_0x22ce22,null))[_0x3716('0x43')](handleError(_0x22ce22,null));};exports[_0x3716('0x50')]=function(_0x77845b,_0xe39d07,_0xb7bea1){var _0x5e2bf7={};var _0x24f012={};var _0x108e40;var _0x2863d6;return db['FreshdeskConfiguration'][_0x3716('0x51')]({'where':{'id':_0x77845b[_0x3716('0x4a')]['id']}})[_0x3716('0x25')](handleEntityNotFound(_0xe39d07,null))[_0x3716('0x25')](function(_0x34eb78){if(_0x34eb78){_0x108e40=_0x34eb78;_0x24f012[_0x3716('0x34')]=_[_0x3716('0x32')](db['FreshdeskField'][_0x3716('0x2d')]);_0x24f012['query']=_[_0x3716('0x32')](_0x77845b[_0x3716('0x31')]);_0x24f012[_0x3716('0x39')]=_[_0x3716('0x33')](_0x24f012[_0x3716('0x34')],_0x24f012[_0x3716('0x31')]);_0x5e2bf7['attributes']=_[_0x3716('0x33')](_0x24f012[_0x3716('0x34')],qs[_0x3716('0x45')](_0x77845b['query']['fields']));_0x5e2bf7[_0x3716('0x35')]=_0x5e2bf7['attributes'][_0x3716('0x36')]?_0x5e2bf7[_0x3716('0x35')]:_0x24f012['model'];_0x5e2bf7[_0x3716('0x4c')]=qs[_0x3716('0x38')](_0x77845b[_0x3716('0x31')][_0x3716('0x38')]);_0x5e2bf7[_0x3716('0x3b')]=qs[_0x3716('0x39')](_[_0x3716('0x3a')](_0x77845b[_0x3716('0x31')],_0x24f012[_0x3716('0x39')]));if(_0x77845b[_0x3716('0x31')][_0x3716('0x3d')]){_0x5e2bf7['where']=_['merge'](_0x5e2bf7[_0x3716('0x3b')],{'$or':_[_0x3716('0x2c')](_0x5e2bf7['attributes'],function(_0x4d6622){var _0x5ac7b2={};_0x5ac7b2[_0x4d6622]={'$like':'%'+_0x77845b[_0x3716('0x31')][_0x3716('0x3d')]+'%'};return _0x5ac7b2;})});}_0x5e2bf7=_['merge']({},_0x5e2bf7,_0x77845b[_0x3716('0x3e')]);return _0x108e40[_0x3716('0x50')](_0x5e2bf7);}})[_0x3716('0x25')](function(_0x37048d){if(_0x37048d){_0x2863d6=_0x37048d[_0x3716('0x36')];if(!_0x77845b[_0x3716('0x31')][_0x3716('0x4e')](_0x3716('0x4f'))){_0x5e2bf7[_0x3716('0x37')]=qs[_0x3716('0x37')](_0x77845b[_0x3716('0x31')][_0x3716('0x37')]);_0x5e2bf7[_0x3716('0x1d')]=qs[_0x3716('0x1d')](_0x77845b[_0x3716('0x31')][_0x3716('0x1d')]);}return _0x108e40[_0x3716('0x50')](_0x5e2bf7);}})[_0x3716('0x25')](function(_0x18ffa2){if(_0x18ffa2){return _0x18ffa2?{'count':_0x2863d6,'rows':_0x18ffa2}:null;}})[_0x3716('0x25')](respondWithResult(_0xe39d07,null))[_0x3716('0x43')](handleError(_0xe39d07,null));};exports[_0x3716('0x52')]=function(_0x2e7fb7,_0x1540c8,_0x561e1f){var _0xbbd12c={};var _0x1ecf13={};var _0x20fdf8;var _0x25ae95;return db[_0x3716('0x3f')][_0x3716('0x51')]({'where':{'id':_0x2e7fb7[_0x3716('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1540c8,null))['then'](function(_0x2a753a){if(_0x2a753a){_0x20fdf8=_0x2a753a;_0x1ecf13[_0x3716('0x34')]=_[_0x3716('0x32')](db[_0x3716('0x4b')][_0x3716('0x2d')]);_0x1ecf13['query']=_[_0x3716('0x32')](_0x2e7fb7[_0x3716('0x31')]);_0x1ecf13[_0x3716('0x39')]=_[_0x3716('0x33')](_0x1ecf13['model'],_0x1ecf13['query']);_0xbbd12c[_0x3716('0x35')]=_[_0x3716('0x33')](_0x1ecf13[_0x3716('0x34')],qs[_0x3716('0x45')](_0x2e7fb7[_0x3716('0x31')][_0x3716('0x45')]));_0xbbd12c['attributes']=_0xbbd12c[_0x3716('0x35')][_0x3716('0x36')]?_0xbbd12c['attributes']:_0x1ecf13[_0x3716('0x34')];_0xbbd12c[_0x3716('0x4c')]=qs['sort'](_0x2e7fb7['query'][_0x3716('0x38')]);_0xbbd12c[_0x3716('0x3b')]=qs[_0x3716('0x39')](_[_0x3716('0x3a')](_0x2e7fb7[_0x3716('0x31')],_0x1ecf13['filters']));if(_0x2e7fb7[_0x3716('0x31')]['filter']){_0xbbd12c[_0x3716('0x3b')]=_['merge'](_0xbbd12c[_0x3716('0x3b')],{'$or':_['map'](_0xbbd12c['attributes'],function(_0x3e9a89){var _0x10aeee={};_0x10aeee[_0x3e9a89]={'$like':'%'+_0x2e7fb7[_0x3716('0x31')][_0x3716('0x3d')]+'%'};return _0x10aeee;})});}_0xbbd12c=_[_0x3716('0x46')]({},_0xbbd12c,_0x2e7fb7[_0x3716('0x3e')]);return _0x20fdf8['getDescriptions'](_0xbbd12c);}})[_0x3716('0x25')](function(_0x384c34){if(_0x384c34){_0x25ae95=_0x384c34[_0x3716('0x36')];if(!_0x2e7fb7['query'][_0x3716('0x4e')]('nolimit')){_0xbbd12c['limit']=qs[_0x3716('0x37')](_0x2e7fb7[_0x3716('0x31')][_0x3716('0x37')]);_0xbbd12c[_0x3716('0x1d')]=qs[_0x3716('0x1d')](_0x2e7fb7[_0x3716('0x31')][_0x3716('0x1d')]);}return _0x20fdf8[_0x3716('0x52')](_0xbbd12c);}})[_0x3716('0x25')](function(_0x1ce969){if(_0x1ce969){return _0x1ce969?{'count':_0x25ae95,'rows':_0x1ce969}:null;}})['then'](respondWithResult(_0x1540c8,null))[_0x3716('0x43')](handleError(_0x1540c8,null));};exports['getTags']=function(_0x5514b6,_0x5906dd,_0x207bc5){var _0x8e9f49={};var _0x1c9434={};var _0x4bbdde;var _0x19d13f;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5514b6['params']['id']}})[_0x3716('0x25')](handleEntityNotFound(_0x5906dd,null))['then'](function(_0x144669){if(_0x144669){_0x4bbdde=_0x144669;_0x1c9434['model']=_[_0x3716('0x32')](db[_0x3716('0x53')][_0x3716('0x2d')]);_0x1c9434[_0x3716('0x31')]=_['keys'](_0x5514b6[_0x3716('0x31')]);_0x1c9434[_0x3716('0x39')]=_[_0x3716('0x33')](_0x1c9434[_0x3716('0x34')],_0x1c9434[_0x3716('0x31')]);_0x8e9f49[_0x3716('0x35')]=_[_0x3716('0x33')](_0x1c9434[_0x3716('0x34')],qs[_0x3716('0x45')](_0x5514b6['query'][_0x3716('0x45')]));_0x8e9f49[_0x3716('0x35')]=_0x8e9f49['attributes']['length']?_0x8e9f49[_0x3716('0x35')]:_0x1c9434['model'];_0x8e9f49[_0x3716('0x4c')]=qs[_0x3716('0x38')](_0x5514b6['query']['sort']);_0x8e9f49[_0x3716('0x3b')]=qs['filters'](_[_0x3716('0x3a')](_0x5514b6['query'],_0x1c9434[_0x3716('0x39')]));if(_0x5514b6['query'][_0x3716('0x3d')]){_0x8e9f49['where']=_['merge'](_0x8e9f49['where'],{'$or':_['map'](_0x8e9f49[_0x3716('0x35')],function(_0x101207){var _0x1446a6={};_0x1446a6[_0x101207]={'$like':'%'+_0x5514b6['query']['filter']+'%'};return _0x1446a6;})});}_0x8e9f49=_[_0x3716('0x46')]({},_0x8e9f49,_0x5514b6[_0x3716('0x3e')]);return _0x4bbdde[_0x3716('0x54')](_0x8e9f49);}})['then'](function(_0x20428f){if(_0x20428f){_0x19d13f=_0x20428f[_0x3716('0x36')];if(!_0x5514b6[_0x3716('0x31')]['hasOwnProperty'](_0x3716('0x4f'))){_0x8e9f49[_0x3716('0x37')]=qs[_0x3716('0x37')](_0x5514b6[_0x3716('0x31')][_0x3716('0x37')]);_0x8e9f49[_0x3716('0x1d')]=qs[_0x3716('0x1d')](_0x5514b6[_0x3716('0x31')]['offset']);}return _0x4bbdde[_0x3716('0x54')](_0x8e9f49);}})[_0x3716('0x25')](function(_0x1e441b){if(_0x1e441b){return _0x1e441b?{'count':_0x19d13f,'rows':_0x1e441b}:null;}})[_0x3716('0x25')](respondWithResult(_0x5906dd,null))[_0x3716('0x43')](handleError(_0x5906dd,null));};exports[_0x3716('0x55')]=function(_0x20ab46,_0x178abe,_0x307f37){if(_0x20ab46[_0x3716('0x49')]['id']){delete _0x20ab46['body']['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x20ab46[_0x3716('0x4a')]['id']}})[_0x3716('0x25')](handleEntityNotFound(_0x178abe,null))[_0x3716('0x25')](function(_0x4d51ff){if(_0x4d51ff){return _0x4d51ff[_0x3716('0x55')](_0x20ab46[_0x3716('0x49')][_0x3716('0x56')]||[]);}return null;})['then'](respondWithResult(_0x178abe,null))[_0x3716('0x43')](handleError(_0x178abe,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index dbf5243..a71fc2e 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 _0xc9cc=['define','FreshdeskConfiguration','lodash','util','api','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x3ad0bb,_0x2a7098){var _0x4359c6=function(_0x12b22a){while(--_0x12b22a){_0x3ad0bb['push'](_0x3ad0bb['shift']());}};_0x4359c6(++_0x2a7098);}(_0xc9cc,0xa2));var _0xcc9c=function(_0xaad24a,_0x1c7172){_0xaad24a=_0xaad24a-0x0;var _0x32df5b=_0xc9cc[_0xaad24a];return _0x32df5b;};'use strict';var _=require(_0xcc9c('0x0'));var util=require(_0xcc9c('0x1'));var logger=require('../../config/logger')(_0xcc9c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc9c('0x3'));var fs=require('fs');var path=require(_0xcc9c('0x4'));var rimraf=require('rimraf');var config=require(_0xcc9c('0x5'));var attributes=require(_0xcc9c('0x6'));module[_0xcc9c('0x7')]=function(_0x10d7d2,_0x36b4a6){return _0x10d7d2[_0xcc9c('0x8')](_0xcc9c('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92fe=['FreshdeskConfiguration','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x92fe,0x196));var _0xe92f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe92f('0x0'));var logger=require(_0xe92f('0x1'))(_0xe92f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe92f('0x3'));var rimraf=require(_0xe92f('0x4'));var config=require(_0xe92f('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xe92f('0x6')]=function(_0x590294,_0x4034e7){return _0x590294[_0xe92f('0x7')](_0xe92f('0x8'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 48d09b2..196798c 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 _0x664b=['message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x664b,0x1b4));var _0xb664=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x664b[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb664('0x0'));var util=require(_0xb664('0x1'));var moment=require('moment');var BPromise=require(_0xb664('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb664('0x3'));var db=require(_0xb664('0x4'))['db'];var utils=require(_0xb664('0x5'));var logger=require(_0xb664('0x6'))(_0xb664('0x7'));var config=require(_0xb664('0x8'));var jayson=require(_0xb664('0x9'));var client=jayson[_0xb664('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433f1e,_0x39cebc,_0x4107f3){return new BPromise(function(_0x3a9bdc,_0x539e6a){return client[_0xb664('0xb')](_0x433f1e,_0x4107f3)[_0xb664('0xc')](function(_0x4cd5ee){logger['info'](_0xb664('0xd'),_0x39cebc,_0xb664('0xe'));logger[_0xb664('0xf')](_0xb664('0x10'),_0x39cebc,_0xb664('0xe'),JSON[_0xb664('0x11')](_0x4cd5ee));if(_0x4cd5ee[_0xb664('0x12')]){if(_0x4cd5ee['error'][_0xb664('0x13')]===0x1f4){logger[_0xb664('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x39cebc,_0x4cd5ee[_0xb664('0x12')][_0xb664('0x14')]);return _0x539e6a(_0x4cd5ee[_0xb664('0x12')][_0xb664('0x14')]);}logger['error'](_0xb664('0xd'),_0x39cebc,_0x4cd5ee[_0xb664('0x12')][_0xb664('0x14')]);return _0x3a9bdc(_0x4cd5ee[_0xb664('0x12')][_0xb664('0x14')]);}else{logger[_0xb664('0x15')](_0xb664('0xd'),_0x39cebc,'request\x20sent');_0x3a9bdc(_0x4cd5ee[_0xb664('0x16')][_0xb664('0x14')]);}})[_0xb664('0x17')](function(_0x3148b1){logger[_0xb664('0x12')](_0xb664('0xd'),_0x39cebc,_0x3148b1);_0x539e6a(_0x3148b1);});});} \ No newline at end of file +var _0x3750=['jayson/promise','client','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3750,0x14f));var _0x0375=function(_0x304976,_0x14432b){_0x304976=_0x304976-0x0;var _0xb73047=_0x3750[_0x304976];return _0xb73047;};'use strict';var _=require(_0x0375('0x0'));var util=require(_0x0375('0x1'));var moment=require(_0x0375('0x2'));var BPromise=require('bluebird');var rs=require(_0x0375('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0375('0x4'))['db'];var utils=require(_0x0375('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0375('0x6'));var jayson=require(_0x0375('0x7'));var client=jayson[_0x0375('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b64d0,_0xae6374,_0x545dcb){return new BPromise(function(_0x2bac17,_0x42def0){return client['request'](_0x3b64d0,_0x545dcb)['then'](function(_0x3150a1){logger[_0x0375('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xae6374,_0x0375('0xa'));logger[_0x0375('0xb')](_0x0375('0xc'),_0xae6374,_0x0375('0xa'),JSON['stringify'](_0x3150a1));if(_0x3150a1['error']){if(_0x3150a1[_0x0375('0xd')][_0x0375('0xe')]===0x1f4){logger['error'](_0x0375('0xf'),_0xae6374,_0x3150a1[_0x0375('0xd')][_0x0375('0x10')]);return _0x42def0(_0x3150a1['error'][_0x0375('0x10')]);}logger['error'](_0x0375('0xf'),_0xae6374,_0x3150a1[_0x0375('0xd')][_0x0375('0x10')]);return _0x2bac17(_0x3150a1['error'][_0x0375('0x10')]);}else{logger['info'](_0x0375('0xf'),_0xae6374,_0x0375('0xa'));_0x2bac17(_0x3150a1[_0x0375('0x11')][_0x0375('0x10')]);}})[_0x0375('0x12')](function(_0x37c10f){logger[_0x0375('0xd')](_0x0375('0xf'),_0xae6374,_0x37c10f);_0x42def0(_0x37c10f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 856545b..7858ea6 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 _0x6857=['../../config/environment','./intFreshdeskField.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x6857,0xe9));var _0x7685=function(_0x3e9865,_0x37d3ab){_0x3e9865=_0x3e9865-0x0;var _0x2e88bb=_0x6857[_0x3e9865];return _0x2e88bb;};'use strict';var multer=require(_0x7685('0x0'));var util=require(_0x7685('0x1'));var path=require(_0x7685('0x2'));var timeout=require(_0x7685('0x3'));var express=require('express');var router=express[_0x7685('0x4')]();var fs_extra=require(_0x7685('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7685('0x6'));var config=require(_0x7685('0x7'));var controller=require(_0x7685('0x8'));router[_0x7685('0x9')]('/',auth['isAuthenticated'](),controller[_0x7685('0xa')]);router[_0x7685('0x9')](_0x7685('0xb'),auth['isAuthenticated'](),controller[_0x7685('0xc')]);router[_0x7685('0xd')]('/',auth[_0x7685('0xe')](),controller[_0x7685('0xf')]);router[_0x7685('0x10')](_0x7685('0xb'),auth[_0x7685('0xe')](),controller[_0x7685('0x11')]);router[_0x7685('0x12')](_0x7685('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7685('0x13')]=router; \ No newline at end of file +var _0xc2f1=['multer','util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','destroy'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xc2f1,0x1b2));var _0x1c2f=function(_0xeab678,_0x1a2853){_0xeab678=_0xeab678-0x0;var _0x5b3abf=_0xc2f1[_0xeab678];return _0x5b3abf;};'use strict';var multer=require(_0x1c2f('0x0'));var util=require(_0x1c2f('0x1'));var path=require('path');var timeout=require(_0x1c2f('0x2'));var express=require(_0x1c2f('0x3'));var router=express[_0x1c2f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1c2f('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x1c2f('0x6')]('/',auth[_0x1c2f('0x7')](),controller['index']);router[_0x1c2f('0x6')](_0x1c2f('0x8'),auth['isAuthenticated'](),controller[_0x1c2f('0x9')]);router[_0x1c2f('0xa')]('/',auth[_0x1c2f('0x7')](),controller[_0x1c2f('0xb')]);router[_0x1c2f('0xc')](_0x1c2f('0x8'),auth[_0x1c2f('0x7')](),controller['update']);router['delete'](_0x1c2f('0x8'),auth['isAuthenticated'](),controller[_0x1c2f('0xd')]);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 a862c0b..a6bcbe9 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 _0xbf51=['customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0xcd3436,_0x4b0666){var _0x39a59a=function(_0x2262fc){while(--_0x2262fc){_0xcd3436['push'](_0xcd3436['shift']());}};_0x39a59a(++_0x4b0666);}(_0xbf51,0xe6));var _0x1bf5=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xbf51[_0x1a9204];return _0x17ca68;};'use strict';var Sequelize=require(_0x1bf5('0x0'));module[_0x1bf5('0x1')]={'type':{'type':Sequelize[_0x1bf5('0x2')](_0x1bf5('0x3'),'variable',_0x1bf5('0x4'),_0x1bf5('0x5'),'picklist'),'defaultValue':_0x1bf5('0x3')},'content':{'type':Sequelize[_0x1bf5('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1bf5('0x2')]('string',_0x1bf5('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x1bf5('0x6')]},'idField':{'type':Sequelize[_0x1bf5('0x6')]},'nameField':{'type':Sequelize[_0x1bf5('0x6')]},'customField':{'type':Sequelize[_0x1bf5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1bf5('0x6')]}}; \ No newline at end of file +var _0xb47e=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x30cb43,_0x1c7604){var _0x53244e=function(_0x16d13a){while(--_0x16d13a){_0x30cb43['push'](_0x30cb43['shift']());}};_0x53244e(++_0x1c7604);}(_0xb47e,0x193));var _0xeb47=function(_0xb80fc7,_0x3e1989){_0xb80fc7=_0xb80fc7-0x0;var _0x4255f3=_0xb47e[_0xb80fc7];return _0x4255f3;};'use strict';var Sequelize=require(_0xeb47('0x0'));module[_0xeb47('0x1')]={'type':{'type':Sequelize['ENUM'](_0xeb47('0x2'),_0xeb47('0x3'),_0xeb47('0x4'),_0xeb47('0x5'),_0xeb47('0x6')),'defaultValue':_0xeb47('0x2')},'content':{'type':Sequelize[_0xeb47('0x7')]},'key':{'type':Sequelize[_0xeb47('0x7')]},'keyType':{'type':Sequelize[_0xeb47('0x8')]('string',_0xeb47('0x3'),_0xeb47('0x4'))},'keyContent':{'type':Sequelize[_0xeb47('0x7')]},'idField':{'type':Sequelize[_0xeb47('0x7')]},'nameField':{'type':Sequelize[_0xeb47('0x7')]},'customField':{'type':Sequelize[_0xeb47('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeb47('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 93564a6..10e5f19 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 _0x0fd9=['VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','FreshdeskField','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x2e1b4a,_0x32b923){var _0x12add1=function(_0x37b2e6){while(--_0x37b2e6){_0x2e1b4a['push'](_0x2e1b4a['shift']());}};_0x12add1(++_0x32b923);}(_0x0fd9,0xa3));var _0x90fd=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x0fd9[_0x487496];return _0x539dc8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={},_0x397aaf={},_0x59b3e8={'count':0x0,'rows':[]};var _0x4f69e7=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x3a0102){return{'name':_0x3a0102['fieldName'],'type':_0x3a0102['type'][_0x90fd('0x2d')]};});_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2a')](_0x4f69e7,_0x90fd('0x28'));_0x397aaf['query']=_[_0x90fd('0x2f')](_0x170cfb[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x31')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],_0x397aaf[_0x90fd('0x30')]);_0x404971[_0x90fd('0x33')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x34')]));_0x404971[_0x90fd('0x33')]=_0x404971[_0x90fd('0x33')][_0x90fd('0x35')]?_0x404971[_0x90fd('0x33')]:_0x397aaf['model'];if(!_0x170cfb[_0x90fd('0x30')][_0x90fd('0x36')](_0x90fd('0x37'))){_0x404971[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x404971[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1e')]);}_0x404971[_0x90fd('0x38')]=qs[_0x90fd('0x39')](_0x170cfb['query'][_0x90fd('0x39')]);_0x404971[_0x90fd('0x3a')]=qs[_0x90fd('0x31')](_[_0x90fd('0x3b')](_0x170cfb['query'],_0x397aaf[_0x90fd('0x31')]),_0x4f69e7);if(_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]){_0x404971['where']=_['merge'](_0x404971[_0x90fd('0x3a')],{'$or':_[_0x90fd('0x2a')](_0x4f69e7,function(_0x377319){if(_0x377319[_0x90fd('0x3d')]!==_0x90fd('0x3e')){var _0x254200={};_0x254200[_0x377319[_0x90fd('0x28')]]={'$like':'%'+_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]+'%'};return _0x254200;}})});}_0x404971=_[_0x90fd('0x3f')]({},_0x404971,_0x170cfb[_0x90fd('0x40')]);var _0x43c84c={'where':_0x404971[_0x90fd('0x3a')]};return db[_0x90fd('0x2b')][_0x90fd('0x1d')](_0x43c84c)[_0x90fd('0x25')](function(_0x2717ca){_0x59b3e8[_0x90fd('0x1d')]=_0x2717ca;if(_0x170cfb['query'][_0x90fd('0x41')]){_0x404971[_0x90fd('0x42')]=[{'all':!![]}];}return db[_0x90fd('0x2b')]['findAll'](_0x404971);})['then'](function(_0x47b8c8){_0x59b3e8[_0x90fd('0x43')]=_0x47b8c8;return _0x59b3e8;})[_0x90fd('0x25')](respondWithFilteredResult(_0x2924e9,_0x404971))[_0x90fd('0x44')](handleError(_0x2924e9,null));};exports[_0x90fd('0x45')]=function(_0x1361d9,_0x311c7e){var _0x363365={'raw':!![],'where':{'id':_0x1361d9[_0x90fd('0x46')]['id']}},_0x733d4d={};_0x733d4d[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x733d4d[_0x90fd('0x30')]=_[_0x90fd('0x2f')](_0x1361d9['query']);_0x733d4d['filters']=_[_0x90fd('0x32')](_0x733d4d[_0x90fd('0x2e')],_0x733d4d[_0x90fd('0x30')]);_0x363365['attributes']=_['intersection'](_0x733d4d[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x1361d9['query']['fields']));_0x363365[_0x90fd('0x33')]=_0x363365[_0x90fd('0x33')]['length']?_0x363365['attributes']:_0x733d4d[_0x90fd('0x2e')];if(_0x1361d9[_0x90fd('0x30')][_0x90fd('0x41')]){_0x363365['include']=[{'all':!![]}];}_0x363365=_[_0x90fd('0x3f')]({},_0x363365,_0x1361d9[_0x90fd('0x40')]);return db['FreshdeskField']['find'](_0x363365)['then'](handleEntityNotFound(_0x311c7e,null))[_0x90fd('0x25')](respondWithResult(_0x311c7e,null))[_0x90fd('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x2d42b3,_0x2b73f7){return db[_0x90fd('0x2b')][_0x90fd('0x47')](_0x2d42b3[_0x90fd('0x48')],{})['then'](respondWithResult(_0x2b73f7,0xc9))['catch'](handleError(_0x2b73f7,null));};exports[_0x90fd('0x24')]=function(_0x326e4d,_0x125874){if(_0x326e4d[_0x90fd('0x48')]['id']){delete _0x326e4d[_0x90fd('0x48')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x49')]({'where':{'id':_0x326e4d[_0x90fd('0x46')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x125874,null))[_0x90fd('0x25')](saveUpdates(_0x326e4d['body'],null))[_0x90fd('0x25')](respondWithResult(_0x125874,null))[_0x90fd('0x44')](handleError(_0x125874,null));};exports[_0x90fd('0x4a')]=function(_0x38021b,_0x4b47bc){return db['FreshdeskField'][_0x90fd('0x49')]({'where':{'id':_0x38021b['params']['id']}})['then'](handleEntityNotFound(_0x4b47bc,null))[_0x90fd('0x25')](removeEntity(_0x4b47bc,null))[_0x90fd('0x44')](handleError(_0x4b47bc,null));}; \ No newline at end of file +var _0x4483=['offset','undefined','limit','count','set','apply','reject','update','destroy','then','stack','name','send','index','FreshdeskField','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','catch','show','params','filters','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x29872c,_0x211296){var _0x31f39a=function(_0x2af5aa){while(--_0x2af5aa){_0x29872c['push'](_0x29872c['shift']());}};_0x31f39a(++_0x211296);}(_0x4483,0x1a3));var _0x3448=function(_0x3d2eda,_0x43c870){_0x3d2eda=_0x3d2eda-0x0;var _0x388648=_0x4483[_0x3d2eda];return _0x388648;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x298ae6,_0x38fbb1){_0x38fbb1=_0x38fbb1||0xcc;return function(_0x5f52bd){if(_0x5f52bd){return _0x298ae6[_0x3448('0x1b')](_0x38fbb1);}return _0x298ae6[_0x3448('0x1c')](_0x38fbb1)[_0x3448('0x1d')]();};}function respondWithResult(_0x549306,_0x14104c){_0x14104c=_0x14104c||0xc8;return function(_0x2952a6){if(_0x2952a6){return _0x549306['status'](_0x14104c)[_0x3448('0x1e')](_0x2952a6);}};}function respondWithFilteredResult(_0x2c2da6,_0x46784f){return function(_0x4fc70f){if(_0x4fc70f){var _0x472518=typeof _0x46784f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x46784f[_0x3448('0x21')]===_0x3448('0x20');var _0x1b2081=_0x4fc70f[_0x3448('0x22')];var _0x425514=_0x472518?0x0:_0x46784f['offset'];var _0x1658cd=_0x472518?_0x4fc70f['count']:_0x46784f['offset']+_0x46784f['limit'];var _0x1e9774;if(_0x1658cd>=_0x1b2081){_0x1658cd=_0x1b2081;_0x1e9774=0xc8;}else{_0x1e9774=0xce;}_0x2c2da6[_0x3448('0x1c')](_0x1e9774);return _0x2c2da6[_0x3448('0x23')]('Content-Range',_0x425514+'-'+_0x1658cd+'/'+_0x1b2081)[_0x3448('0x1e')](_0x4fc70f);}return null;};}function patchUpdates(_0x392c8d){return function(_0x317de6){try{jsonpatch[_0x3448('0x24')](_0x317de6,_0x392c8d,!![]);}catch(_0x29a15a){return BPromise[_0x3448('0x25')](_0x29a15a);}return _0x317de6['save']();};}function saveUpdates(_0x54c7ee,_0x4e6716){return function(_0x1b3d5a){if(_0x1b3d5a){return _0x1b3d5a[_0x3448('0x26')](_0x54c7ee)['then'](function(_0x5b1f7c){return _0x5b1f7c;});}return null;};}function removeEntity(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(_0x22ad5c){return _0x22ad5c[_0x3448('0x27')]()[_0x3448('0x28')](function(){_0x2dcd40['status'](0xcc)[_0x3448('0x1d')]();});}};}function handleEntityNotFound(_0x1b5c49,_0x114244){return function(_0x2088de){if(!_0x2088de){_0x1b5c49[_0x3448('0x1b')](0x194);}return _0x2088de;};}function handleError(_0x56b3ff,_0x329947){_0x329947=_0x329947||0x1f4;return function(_0x393081){logger['error'](_0x393081[_0x3448('0x29')]);if(_0x393081[_0x3448('0x2a')]){delete _0x393081[_0x3448('0x2a')];}_0x56b3ff[_0x3448('0x1c')](_0x329947)[_0x3448('0x2b')](_0x393081);};}exports[_0x3448('0x2c')]=function(_0x31be64,_0x95714e){var _0x5911b8={},_0x3307dc={},_0x450704={'count':0x0,'rows':[]};var _0xcfdc5=_['map'](db[_0x3448('0x2d')]['rawAttributes'],function(_0x486f2c){return{'name':_0x486f2c['fieldName'],'type':_0x486f2c[_0x3448('0x2e')][_0x3448('0x2f')]};});_0x3307dc['model']=_['map'](_0xcfdc5,_0x3448('0x2a'));_0x3307dc[_0x3448('0x30')]=_[_0x3448('0x31')](_0x31be64[_0x3448('0x30')]);_0x3307dc['filters']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],_0x3307dc[_0x3448('0x30')]);_0x5911b8['attributes']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],qs['fields'](_0x31be64['query'][_0x3448('0x34')]));_0x5911b8[_0x3448('0x35')]=_0x5911b8[_0x3448('0x35')][_0x3448('0x36')]?_0x5911b8['attributes']:_0x3307dc[_0x3448('0x33')];if(!_0x31be64[_0x3448('0x30')][_0x3448('0x37')](_0x3448('0x38'))){_0x5911b8['limit']=qs[_0x3448('0x21')](_0x31be64[_0x3448('0x30')]['limit']);_0x5911b8[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x31be64[_0x3448('0x30')][_0x3448('0x1f')]);}_0x5911b8[_0x3448('0x39')]=qs[_0x3448('0x3a')](_0x31be64[_0x3448('0x30')][_0x3448('0x3a')]);_0x5911b8[_0x3448('0x3b')]=qs['filters'](_['pick'](_0x31be64[_0x3448('0x30')],_0x3307dc['filters']),_0xcfdc5);if(_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]){_0x5911b8[_0x3448('0x3b')]=_[_0x3448('0x3d')](_0x5911b8['where'],{'$or':_[_0x3448('0x3e')](_0xcfdc5,function(_0x18fc16){if(_0x18fc16[_0x3448('0x2e')]!==_0x3448('0x3f')){var _0x2e83c6={};_0x2e83c6[_0x18fc16[_0x3448('0x2a')]]={'$like':'%'+_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]+'%'};return _0x2e83c6;}})});}_0x5911b8=_[_0x3448('0x3d')]({},_0x5911b8,_0x31be64['options']);var _0x39b22e={'where':_0x5911b8[_0x3448('0x3b')]};return db[_0x3448('0x2d')][_0x3448('0x22')](_0x39b22e)[_0x3448('0x28')](function(_0x58963d){_0x450704[_0x3448('0x22')]=_0x58963d;if(_0x31be64[_0x3448('0x30')][_0x3448('0x40')]){_0x5911b8[_0x3448('0x41')]=[{'all':!![]}];}return db[_0x3448('0x2d')][_0x3448('0x42')](_0x5911b8);})[_0x3448('0x28')](function(_0x3db5f1){_0x450704['rows']=_0x3db5f1;return _0x450704;})[_0x3448('0x28')](respondWithFilteredResult(_0x95714e,_0x5911b8))[_0x3448('0x43')](handleError(_0x95714e,null));};exports[_0x3448('0x44')]=function(_0x4a04d0,_0x2465ff){var _0x1d2a7c={'raw':!![],'where':{'id':_0x4a04d0[_0x3448('0x45')]['id']}},_0x21f989={};_0x21f989[_0x3448('0x33')]=_[_0x3448('0x31')](db[_0x3448('0x2d')]['rawAttributes']);_0x21f989[_0x3448('0x30')]=_[_0x3448('0x31')](_0x4a04d0[_0x3448('0x30')]);_0x21f989[_0x3448('0x46')]=_[_0x3448('0x32')](_0x21f989[_0x3448('0x33')],_0x21f989['query']);_0x1d2a7c[_0x3448('0x35')]=_['intersection'](_0x21f989['model'],qs[_0x3448('0x34')](_0x4a04d0[_0x3448('0x30')]['fields']));_0x1d2a7c[_0x3448('0x35')]=_0x1d2a7c[_0x3448('0x35')]['length']?_0x1d2a7c[_0x3448('0x35')]:_0x21f989[_0x3448('0x33')];if(_0x4a04d0['query'][_0x3448('0x40')]){_0x1d2a7c[_0x3448('0x41')]=[{'all':!![]}];}_0x1d2a7c=_[_0x3448('0x3d')]({},_0x1d2a7c,_0x4a04d0[_0x3448('0x47')]);return db[_0x3448('0x2d')][_0x3448('0x48')](_0x1d2a7c)[_0x3448('0x28')](handleEntityNotFound(_0x2465ff,null))['then'](respondWithResult(_0x2465ff,null))['catch'](handleError(_0x2465ff,null));};exports[_0x3448('0x49')]=function(_0x3c9b82,_0x1b82e7){return db[_0x3448('0x2d')]['create'](_0x3c9b82[_0x3448('0x4a')],{})[_0x3448('0x28')](respondWithResult(_0x1b82e7,0xc9))[_0x3448('0x43')](handleError(_0x1b82e7,null));};exports[_0x3448('0x26')]=function(_0x363374,_0x5d942b){if(_0x363374[_0x3448('0x4a')]['id']){delete _0x363374['body']['id'];}return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0x363374['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5d942b,null))[_0x3448('0x28')](saveUpdates(_0x363374[_0x3448('0x4a')],null))[_0x3448('0x28')](respondWithResult(_0x5d942b,null))[_0x3448('0x43')](handleError(_0x5d942b,null));};exports[_0x3448('0x27')]=function(_0xc769e1,_0x53236c){return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0xc769e1['params']['id']}})['then'](handleEntityNotFound(_0x53236c,null))[_0x3448('0x28')](removeEntity(_0x53236c,null))[_0x3448('0x43')](handleError(_0x53236c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 4c69488..69a753b 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 _0xba5b=['path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','lodash','util','api','bluebird'];(function(_0x560589,_0x3889f0){var _0x386054=function(_0x3cba96){while(--_0x3cba96){_0x560589['push'](_0x560589['shift']());}};_0x386054(++_0x3889f0);}(_0xba5b,0xa1));var _0xbba5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xba5b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xbba5('0x0'));var util=require(_0xbba5('0x1'));var logger=require('../../config/logger')(_0xbba5('0x2'));var moment=require('moment');var BPromise=require(_0xbba5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbba5('0x4'));var rimraf=require(_0xbba5('0x5'));var config=require(_0xbba5('0x6'));var attributes=require(_0xbba5('0x7'));module[_0xbba5('0x8')]=function(_0x3e9f80,_0x86e2a0){return _0x3e9f80['define'](_0xbba5('0x9'),attributes,{'tableName':_0xbba5('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab53=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x534e68,_0x16d996){var _0x5b5176=function(_0x1e8f9a){while(--_0x1e8f9a){_0x534e68['push'](_0x534e68['shift']());}};_0x5b5176(++_0x16d996);}(_0xab53,0x12d));var _0x3ab5=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xab53[_0x35d4e9];return _0x5c2770;};'use strict';var _=require(_0x3ab5('0x0'));var util=require(_0x3ab5('0x1'));var logger=require(_0x3ab5('0x2'))(_0x3ab5('0x3'));var moment=require(_0x3ab5('0x4'));var BPromise=require(_0x3ab5('0x5'));var rp=require(_0x3ab5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ab5('0x7'));var config=require(_0x3ab5('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x3ab5('0x9')]=function(_0x6fd74c,_0x43fb64){return _0x6fd74c[_0x3ab5('0xa')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x3ab5('0xb')],'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 cb09d37..6de0a04 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 _0x096d=['request\x20sent','debug','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2c4a57,_0x2930c8){var _0x5334e9=function(_0x166d4a){while(--_0x166d4a){_0x2c4a57['push'](_0x2c4a57['shift']());}};_0x5334e9(++_0x2930c8);}(_0x096d,0x15b));var _0xd096=function(_0x48accc,_0x3142e9){_0x48accc=_0x48accc-0x0;var _0x460cc4=_0x096d[_0x48accc];return _0x460cc4;};'use strict';var _=require('lodash');var util=require(_0xd096('0x0'));var moment=require(_0xd096('0x1'));var BPromise=require('bluebird');var rs=require(_0xd096('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd096('0x3'))['db'];var utils=require(_0xd096('0x4'));var logger=require('../../config/logger')(_0xd096('0x5'));var config=require(_0xd096('0x6'));var jayson=require(_0xd096('0x7'));var client=jayson[_0xd096('0x8')][_0xd096('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x175167,_0x3979ba,_0x112979){return new BPromise(function(_0xd384f,_0x4b282f){return client[_0xd096('0xa')](_0x175167,_0x112979)[_0xd096('0xb')](function(_0xb12b6a){logger[_0xd096('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x3979ba,_0xd096('0xd'));logger[_0xd096('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x3979ba,_0xd096('0xd'),JSON[_0xd096('0xf')](_0xb12b6a));if(_0xb12b6a[_0xd096('0x10')]){if(_0xb12b6a[_0xd096('0x10')][_0xd096('0x11')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x3979ba,_0xb12b6a[_0xd096('0x10')][_0xd096('0x12')]);return _0x4b282f(_0xb12b6a[_0xd096('0x10')][_0xd096('0x12')]);}logger['error'](_0xd096('0x13'),_0x3979ba,_0xb12b6a[_0xd096('0x10')][_0xd096('0x12')]);return _0xd384f(_0xb12b6a[_0xd096('0x10')][_0xd096('0x12')]);}else{logger[_0xd096('0xc')](_0xd096('0x13'),_0x3979ba,_0xd096('0xd'));_0xd384f(_0xb12b6a['result'][_0xd096('0x12')]);}})['catch'](function(_0xdafa07){logger[_0xd096('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x3979ba,_0xdafa07);_0x4b282f(_0xdafa07);});});} \ No newline at end of file +var _0xe09d=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','FreshdeskField,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xe09d,0x1c9));var _0xde09=function(_0x40f4d0,_0x433043){_0x40f4d0=_0x40f4d0-0x0;var _0x5a952b=_0xe09d[_0x40f4d0];return _0x5a952b;};'use strict';var _=require(_0xde09('0x0'));var util=require(_0xde09('0x1'));var moment=require(_0xde09('0x2'));var BPromise=require(_0xde09('0x3'));var rs=require(_0xde09('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde09('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde09('0x6'))(_0xde09('0x7'));var config=require(_0xde09('0x8'));var jayson=require(_0xde09('0x9'));var client=jayson[_0xde09('0xa')][_0xde09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x343c97,_0x52cd74,_0x372693){return new BPromise(function(_0x1b2efa,_0xf58439){return client[_0xde09('0xc')](_0x343c97,_0x372693)[_0xde09('0xd')](function(_0x322f7c){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x52cd74,_0xde09('0xe'));logger[_0xde09('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x52cd74,_0xde09('0xe'),JSON['stringify'](_0x322f7c));if(_0x322f7c[_0xde09('0x10')]){if(_0x322f7c['error'][_0xde09('0x11')]===0x1f4){logger[_0xde09('0x10')](_0xde09('0x12'),_0x52cd74,_0x322f7c[_0xde09('0x10')][_0xde09('0x13')]);return _0xf58439(_0x322f7c[_0xde09('0x10')][_0xde09('0x13')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x52cd74,_0x322f7c['error'][_0xde09('0x13')]);return _0x1b2efa(_0x322f7c[_0xde09('0x10')]['message']);}else{logger[_0xde09('0x14')](_0xde09('0x12'),_0x52cd74,_0xde09('0xe'));_0x1b2efa(_0x322f7c['result'][_0xde09('0x13')]);}})['catch'](function(_0x4dbf50){logger[_0xde09('0x10')](_0xde09('0x12'),_0x52cd74,_0x4dbf50);_0xf58439(_0x4dbf50);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 63901fb..b9960bb 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 _0xbfcc=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update'];(function(_0x305dd0,_0xf910d){var _0x42b168=function(_0xce143d){while(--_0xce143d){_0x305dd0['push'](_0x305dd0['shift']());}};_0x42b168(++_0xf910d);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xbfcc[_0x179e11];return _0x549f04;};'use strict';var multer=require(_0xcbfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcbfc('0x1'));var express=require(_0xcbfc('0x2'));var router=express[_0xcbfc('0x3')]();var fs_extra=require(_0xcbfc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xcbfc('0x5')]('/',auth[_0xcbfc('0x6')](),controller['index']);router[_0xcbfc('0x5')]('/:id',auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x7')]);router[_0xcbfc('0x5')](_0xcbfc('0x8'),auth['isAuthenticated'](),controller[_0xcbfc('0x9')]);router[_0xcbfc('0x5')](_0xcbfc('0xa'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0xb')]);router[_0xcbfc('0xc')]('/',auth['isAuthenticated'](),controller[_0xcbfc('0xd')]);router[_0xcbfc('0xc')](_0xcbfc('0x8'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0xe')]);router['put'](_0xcbfc('0xf'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x10')]);router['delete'](_0xcbfc('0xf'),auth[_0xcbfc('0x6')](),controller[_0xcbfc('0x11')]);module[_0xcbfc('0x12')]=router; \ No newline at end of file +var _0x34b7=['getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x34b7,0x196));var _0x734b=function(_0x1ba57f,_0xb81938){_0x1ba57f=_0x1ba57f-0x0;var _0x5a7f02=_0x34b7[_0x1ba57f];return _0x5a7f02;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x734b('0x7')]('/:id/fields',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0xd')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xd')](_0x734b('0xf'),auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0x11')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0x13')]('/:id',auth[_0x734b('0x8')](),controller[_0x734b('0x14')]);module[_0x734b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 4c55fca..28f3fc9 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 _0x3423=['username','remoteUri','STRING'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')]},'description':{'type':Sequelize[_0x3342('0x0')]},'username':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1')},'apiKey':{'type':Sequelize[_0x3342('0x0')]},'remoteUri':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x2')},'serverUrl':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x958a=['sequelize','exports','STRING','username'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x958a,0x128));var _0xa958=function(_0x3df36a,_0x49a4c7){_0x3df36a=_0x3df36a-0x0;var _0x163709=_0x958a[_0x3df36a];return _0x163709;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa958('0x2')]},'username':{'type':Sequelize[_0xa958('0x2')],'unique':_0xa958('0x3')},'apiKey':{'type':Sequelize[_0xa958('0x2')]},'remoteUri':{'type':Sequelize[_0xa958('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa958('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 4566f09..d9bf04b 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 _0x3856=['stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','FreshsalesAccount','includeAll','include','findAll','rows','show','merge','find','catch','create','body','params','destroy','getConfigurations','findOne','FreshsalesConfiguration','rawAttributes','addConfiguration','AccountId','getSubjects','channel','type','getDescriptions','FreshsalesField','Subjects','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x51ecee,_0x2f0c9a){var _0x5415e1=function(_0x5c13a0){while(--_0x5c13a0){_0x51ecee['push'](_0x51ecee['shift']());}};_0x5415e1(++_0x2f0c9a);}(_0x3856,0x66));var _0x6385=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0x3856[_0x100682];return _0xcb6e87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6385('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6385('0x1'));var rp=require(_0x6385('0x2'));var moment=require(_0x6385('0x3'));var BPromise=require(_0x6385('0x4'));var Mustache=require(_0x6385('0x5'));var util=require('util');var path=require(_0x6385('0x6'));var sox=require('sox');var csv=require(_0x6385('0x7'));var ejs=require(_0x6385('0x8'));var fs=require('fs');var fs_extra=require(_0x6385('0x9'));var _=require('lodash');var squel=require(_0x6385('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6385('0xb'));var toCsv=require(_0x6385('0x7'));var querystring=require(_0x6385('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6385('0xd'));var qs=require(_0x6385('0xe'));var as=require(_0x6385('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6385('0x10'))(_0x6385('0x11'));var utils=require(_0x6385('0x12'));var config=require(_0x6385('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6385('0x14'))['db'];var integrations=require(_0x6385('0x15'));function respondWithStatusCode(_0x15ae37,_0x1da0d6){_0x1da0d6=_0x1da0d6||0xcc;return function(_0x2fc576){if(_0x2fc576){return _0x15ae37[_0x6385('0x16')](_0x1da0d6);}return _0x15ae37[_0x6385('0x17')](_0x1da0d6)[_0x6385('0x18')]();};}function respondWithResult(_0x13606c,_0x36e12b){_0x36e12b=_0x36e12b||0xc8;return function(_0x203aef){if(_0x203aef){return _0x13606c['status'](_0x36e12b)[_0x6385('0x19')](_0x203aef);}};}function respondWithFilteredResult(_0x428d20,_0x16130a){return function(_0x1f4889){if(_0x1f4889){var _0xc2b628=typeof _0x16130a[_0x6385('0x1a')]===_0x6385('0x1b')&&typeof _0x16130a[_0x6385('0x1c')]===_0x6385('0x1b');var _0x3ab952=_0x1f4889[_0x6385('0x1d')];var _0x3cc50d=_0xc2b628?0x0:_0x16130a['offset'];var _0x2817e6=_0xc2b628?_0x1f4889[_0x6385('0x1d')]:_0x16130a[_0x6385('0x1a')]+_0x16130a[_0x6385('0x1c')];var _0x3b8034;if(_0x2817e6>=_0x3ab952){_0x2817e6=_0x3ab952;_0x3b8034=0xc8;}else{_0x3b8034=0xce;}_0x428d20['status'](_0x3b8034);return _0x428d20[_0x6385('0x1e')]('Content-Range',_0x3cc50d+'-'+_0x2817e6+'/'+_0x3ab952)['json'](_0x1f4889);}return null;};}function patchUpdates(_0x134ed4){return function(_0x597dac){try{jsonpatch['apply'](_0x597dac,_0x134ed4,!![]);}catch(_0x4088ac){return BPromise[_0x6385('0x1f')](_0x4088ac);}return _0x597dac[_0x6385('0x20')]();};}function saveUpdates(_0x5d290a,_0x16fbce){return function(_0xce5f9a){if(_0xce5f9a){return _0xce5f9a[_0x6385('0x21')](_0x5d290a)[_0x6385('0x22')](function(_0x1b192b){return _0x1b192b;});}return null;};}function removeEntity(_0x44e0a8,_0x1f5b76){return function(_0x3bfac3){if(_0x3bfac3){return _0x3bfac3['destroy']()[_0x6385('0x22')](function(){_0x44e0a8[_0x6385('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3205b0,_0x2f9fd3){return function(_0x5c567c){if(!_0x5c567c){_0x3205b0[_0x6385('0x16')](0x194);}return _0x5c567c;};}function handleError(_0x3a687f,_0x1c790a){_0x1c790a=_0x1c790a||0x1f4;return function(_0x101186){logger[_0x6385('0x23')](_0x101186[_0x6385('0x24')]);if(_0x101186[_0x6385('0x25')]){delete _0x101186[_0x6385('0x25')];}_0x3a687f['status'](_0x1c790a)[_0x6385('0x26')](_0x101186);};}exports['index']=function(_0x1a5e23,_0x57e2f7){var _0x5ce442={},_0x5c6a7b={},_0x399a85={'count':0x0,'rows':[]};var _0xc88c97=_[_0x6385('0x27')](db['FreshsalesAccount']['rawAttributes'],function(_0xae6c47){return{'name':_0xae6c47[_0x6385('0x28')],'type':_0xae6c47['type'][_0x6385('0x29')]};});_0x5c6a7b[_0x6385('0x2a')]=_[_0x6385('0x27')](_0xc88c97,_0x6385('0x25'));_0x5c6a7b[_0x6385('0x2b')]=_[_0x6385('0x2c')](_0x1a5e23[_0x6385('0x2b')]);_0x5c6a7b[_0x6385('0x2d')]=_[_0x6385('0x2e')](_0x5c6a7b['model'],_0x5c6a7b['query']);_0x5ce442[_0x6385('0x2f')]=_[_0x6385('0x2e')](_0x5c6a7b[_0x6385('0x2a')],qs[_0x6385('0x30')](_0x1a5e23[_0x6385('0x2b')]['fields']));_0x5ce442[_0x6385('0x2f')]=_0x5ce442[_0x6385('0x2f')][_0x6385('0x31')]?_0x5ce442[_0x6385('0x2f')]:_0x5c6a7b[_0x6385('0x2a')];if(!_0x1a5e23[_0x6385('0x2b')][_0x6385('0x32')](_0x6385('0x33'))){_0x5ce442['limit']=qs[_0x6385('0x1c')](_0x1a5e23['query'][_0x6385('0x1c')]);_0x5ce442['offset']=qs[_0x6385('0x1a')](_0x1a5e23[_0x6385('0x2b')][_0x6385('0x1a')]);}_0x5ce442[_0x6385('0x34')]=qs[_0x6385('0x35')](_0x1a5e23['query'][_0x6385('0x35')]);_0x5ce442[_0x6385('0x36')]=qs[_0x6385('0x2d')](_[_0x6385('0x37')](_0x1a5e23['query'],_0x5c6a7b[_0x6385('0x2d')]),_0xc88c97);if(_0x1a5e23[_0x6385('0x2b')][_0x6385('0x38')]){_0x5ce442[_0x6385('0x36')]=_['merge'](_0x5ce442[_0x6385('0x36')],{'$or':_[_0x6385('0x27')](_0xc88c97,function(_0x38b59d){if(_0x38b59d['type']!=='VIRTUAL'){var _0x2aaed2={};_0x2aaed2[_0x38b59d[_0x6385('0x25')]]={'$like':'%'+_0x1a5e23[_0x6385('0x2b')]['filter']+'%'};return _0x2aaed2;}})});}_0x5ce442=_['merge']({},_0x5ce442,_0x1a5e23[_0x6385('0x39')]);var _0x27175c={'where':_0x5ce442[_0x6385('0x36')]};return db[_0x6385('0x3a')][_0x6385('0x1d')](_0x27175c)[_0x6385('0x22')](function(_0x2d24da){_0x399a85[_0x6385('0x1d')]=_0x2d24da;if(_0x1a5e23[_0x6385('0x2b')][_0x6385('0x3b')]){_0x5ce442[_0x6385('0x3c')]=[{'all':!![]}];}return db[_0x6385('0x3a')][_0x6385('0x3d')](_0x5ce442);})[_0x6385('0x22')](function(_0x2e8a0e){_0x399a85[_0x6385('0x3e')]=_0x2e8a0e;return _0x399a85;})[_0x6385('0x22')](respondWithFilteredResult(_0x57e2f7,_0x5ce442))['catch'](handleError(_0x57e2f7,null));};exports[_0x6385('0x3f')]=function(_0x33ce4d,_0x1a66e4){var _0x27f0d3={'raw':![],'where':{'id':_0x33ce4d['params']['id']}},_0x10b9b3={};_0x10b9b3[_0x6385('0x2a')]=_[_0x6385('0x2c')](db[_0x6385('0x3a')]['rawAttributes']);_0x10b9b3[_0x6385('0x2b')]=_[_0x6385('0x2c')](_0x33ce4d[_0x6385('0x2b')]);_0x10b9b3['filters']=_[_0x6385('0x2e')](_0x10b9b3[_0x6385('0x2a')],_0x10b9b3[_0x6385('0x2b')]);_0x27f0d3[_0x6385('0x2f')]=_[_0x6385('0x2e')](_0x10b9b3[_0x6385('0x2a')],qs[_0x6385('0x30')](_0x33ce4d[_0x6385('0x2b')][_0x6385('0x30')]));_0x27f0d3[_0x6385('0x2f')]=_0x27f0d3[_0x6385('0x2f')][_0x6385('0x31')]?_0x27f0d3[_0x6385('0x2f')]:_0x10b9b3[_0x6385('0x2a')];if(_0x33ce4d[_0x6385('0x2b')][_0x6385('0x3b')]){_0x27f0d3[_0x6385('0x3c')]=[{'all':!![]}];}_0x27f0d3=_[_0x6385('0x40')]({},_0x27f0d3,_0x33ce4d[_0x6385('0x39')]);return db['FreshsalesAccount'][_0x6385('0x41')](_0x27f0d3)[_0x6385('0x22')](handleEntityNotFound(_0x1a66e4,null))[_0x6385('0x22')](respondWithResult(_0x1a66e4,null))[_0x6385('0x42')](handleError(_0x1a66e4,null));};exports[_0x6385('0x43')]=function(_0x4583ca,_0x2ea606){return db[_0x6385('0x3a')][_0x6385('0x43')](_0x4583ca[_0x6385('0x44')],{})[_0x6385('0x22')](respondWithResult(_0x2ea606,0xc9))[_0x6385('0x42')](handleError(_0x2ea606,null));};exports[_0x6385('0x21')]=function(_0x12ab86,_0x13d998){if(_0x12ab86['body']['id']){delete _0x12ab86[_0x6385('0x44')]['id'];}return db[_0x6385('0x3a')][_0x6385('0x41')]({'where':{'id':_0x12ab86[_0x6385('0x45')]['id']}})[_0x6385('0x22')](handleEntityNotFound(_0x13d998,null))['then'](saveUpdates(_0x12ab86[_0x6385('0x44')],null))[_0x6385('0x22')](respondWithResult(_0x13d998,null))[_0x6385('0x42')](handleError(_0x13d998,null));};exports[_0x6385('0x46')]=function(_0x30740c,_0x2d4a36){return db[_0x6385('0x3a')][_0x6385('0x41')]({'where':{'id':_0x30740c[_0x6385('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d4a36,null))[_0x6385('0x22')](removeEntity(_0x2d4a36,null))['catch'](handleError(_0x2d4a36,null));};exports[_0x6385('0x47')]=function(_0x1811ff,_0x25b230,_0x4a6d75){var _0x6ca39a={};var _0x163a41={};var _0x26278a;var _0x56da9a;return db[_0x6385('0x3a')][_0x6385('0x48')]({'where':{'id':_0x1811ff[_0x6385('0x45')]['id']}})[_0x6385('0x22')](handleEntityNotFound(_0x25b230,null))[_0x6385('0x22')](function(_0x3d784e){if(_0x3d784e){_0x26278a=_0x3d784e;_0x163a41[_0x6385('0x2a')]=_[_0x6385('0x2c')](db[_0x6385('0x49')][_0x6385('0x4a')]);_0x163a41[_0x6385('0x2b')]=_[_0x6385('0x2c')](_0x1811ff[_0x6385('0x2b')]);_0x163a41[_0x6385('0x2d')]=_[_0x6385('0x2e')](_0x163a41['model'],_0x163a41[_0x6385('0x2b')]);_0x6ca39a[_0x6385('0x2f')]=_[_0x6385('0x2e')](_0x163a41[_0x6385('0x2a')],qs[_0x6385('0x30')](_0x1811ff[_0x6385('0x2b')][_0x6385('0x30')]));_0x6ca39a[_0x6385('0x2f')]=_0x6ca39a[_0x6385('0x2f')]['length']?_0x6ca39a[_0x6385('0x2f')]:_0x163a41[_0x6385('0x2a')];_0x6ca39a[_0x6385('0x34')]=qs[_0x6385('0x35')](_0x1811ff[_0x6385('0x2b')][_0x6385('0x35')]);_0x6ca39a['where']=qs['filters'](_['pick'](_0x1811ff[_0x6385('0x2b')],_0x163a41[_0x6385('0x2d')]));if(_0x1811ff[_0x6385('0x2b')][_0x6385('0x38')]){_0x6ca39a[_0x6385('0x36')]=_[_0x6385('0x40')](_0x6ca39a['where'],{'$or':_[_0x6385('0x27')](_0x6ca39a[_0x6385('0x2f')],function(_0x4a53f2){var _0x3ced59={};_0x3ced59[_0x4a53f2]={'$like':'%'+_0x1811ff[_0x6385('0x2b')][_0x6385('0x38')]+'%'};return _0x3ced59;})});}_0x6ca39a=_[_0x6385('0x40')]({},_0x6ca39a,_0x1811ff[_0x6385('0x39')]);return _0x26278a[_0x6385('0x47')](_0x6ca39a);}})[_0x6385('0x22')](function(_0x1b8d75){if(_0x1b8d75){_0x56da9a=_0x1b8d75['length'];if(!_0x1811ff['query'][_0x6385('0x32')](_0x6385('0x33'))){_0x6ca39a[_0x6385('0x1c')]=qs['limit'](_0x1811ff[_0x6385('0x2b')][_0x6385('0x1c')]);_0x6ca39a[_0x6385('0x1a')]=qs[_0x6385('0x1a')](_0x1811ff[_0x6385('0x2b')][_0x6385('0x1a')]);}return _0x26278a['getConfigurations'](_0x6ca39a);}})[_0x6385('0x22')](function(_0x51f800){if(_0x51f800){return _0x51f800?{'count':_0x56da9a,'rows':_0x51f800}:null;}})[_0x6385('0x22')](respondWithResult(_0x25b230,null))[_0x6385('0x42')](handleError(_0x25b230,null));};exports[_0x6385('0x4b')]=function(_0x502bd1,_0x3356c8,_0x465445){if(_0x502bd1['body']['id']){delete _0x502bd1[_0x6385('0x44')]['id'];}return db['FreshsalesAccount'][_0x6385('0x48')]({'where':{'id':_0x502bd1[_0x6385('0x45')]['id']}})[_0x6385('0x22')](handleEntityNotFound(_0x3356c8,null))[_0x6385('0x22')](function(_0x323bb5){if(_0x323bb5){_0x502bd1['body'][_0x6385('0x4c')]=_0x323bb5['id'];_0x502bd1['body']['Subjects']=integrations[_0x6385('0x4d')](_0x502bd1['body'][_0x6385('0x4e')],_0x502bd1[_0x6385('0x44')][_0x6385('0x4f')]);_0x502bd1[_0x6385('0x44')]['Descriptions']=integrations[_0x6385('0x50')](_0x502bd1[_0x6385('0x44')][_0x6385('0x4e')],_0x502bd1[_0x6385('0x44')][_0x6385('0x4f')]);return db[_0x6385('0x49')][_0x6385('0x43')](_0x502bd1[_0x6385('0x44')],{'include':[{'model':db[_0x6385('0x51')],'as':_0x6385('0x52')},{'model':db[_0x6385('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3356c8,null))[_0x6385('0x42')](handleError(_0x3356c8,null));};exports['getFields']=function(_0x1fbc25,_0x422bfe,_0xcf99e5){var _0x5d39ea='';var _0x5034a0='';return db['FreshsalesAccount'][_0x6385('0x48')]({'where':{'id':_0x1fbc25[_0x6385('0x45')]['id']},'attributes':['id',_0x6385('0x53'),_0x6385('0x54'),_0x6385('0x55')]})[_0x6385('0x22')](handleEntityNotFound(_0x422bfe,null))[_0x6385('0x22')](function(_0x358e49){if(_0x358e49){_0x5034a0=_0x358e49[_0x6385('0x53')];_0x5d39ea=_0x358e49[_0x6385('0x54')];var _0x42d950=_0x358e49['remoteUri'][_0x6385('0x56')](-0x1);if(_0x42d950==='/'){_0x5d39ea=_0x5d39ea[_0x6385('0x57')](0x0,_0x5d39ea[_0x6385('0x58')](_0x42d950));}return rp({'method':_0x6385('0x59'),'uri':util[_0x6385('0x5a')](_0x6385('0x5b'),_0x5d39ea,'/api/selector/owners'),'headers':{'Authorization':_0x6385('0x5c')+_0x358e49[_0x6385('0x55')]},'json':!![]});}})[_0x6385('0x22')](function(_0x3f4859){if(_0x3f4859){var _0xa59d2b=_0x3f4859[_0x6385('0x5d')];var _0x3f4da1=![];var _0x35a095=null;for(_0x35a095=0x0;_0x35a095<_0xa59d2b['length'];_0x35a095++){if(_0xa59d2b[_0x35a095]['email']===_0x5034a0){_0x3f4da1=!![];}}if(_0x3f4da1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6385('0x5e')});}}})[_0x6385('0x22')](respondWithResult(_0x422bfe,null))[_0x6385('0x42')](function(_0x31704a){var _0x1093a5=_0x1fbc25[_0x6385('0x2b')][_0x6385('0x5f')]?0x1f4:_0x31704a[_0x6385('0x60')]||0x1f4;logger['error'](_0x6385('0x61'),'getFields',_0x1093a5,JSON[_0x6385('0x62')](_0x31704a));delete _0x31704a[_0x6385('0x25')];if(_0x1093a5===0x191){_0x1093a5=0x190;}_0x422bfe[_0x6385('0x17')](_0x1093a5)[_0x6385('0x26')](_0x1fbc25[_0x6385('0x2b')][_0x6385('0x5f')]?{'message':_0x6385('0x63'),'statusCode':_0x31704a[_0x6385('0x60')]}:_0x31704a);});}; \ No newline at end of file +var _0x17ae=['getDescriptions','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','substring','lastIndexOf','format','Token\x20token=','users','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','length','create','body','find','findOne','FreshsalesConfiguration','order','getConfigurations','hasOwnProperty','AccountId','Descriptions'];(function(_0x3cd6cb,_0x1d6687){var _0x1fd7f7=function(_0x43f021){while(--_0x43f021){_0x3cd6cb['push'](_0x3cd6cb['shift']());}};_0x1fd7f7(++_0x1d6687);}(_0x17ae,0x198));var _0xe17a=function(_0x594fd7,_0x530b70){_0x594fd7=_0x594fd7-0x0;var _0x1d3a1b=_0x17ae[_0x594fd7];return _0x1d3a1b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe17a('0x0'));var zipdir=require(_0xe17a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe17a('0x2'));var moment=require(_0xe17a('0x3'));var BPromise=require(_0xe17a('0x4'));var Mustache=require(_0xe17a('0x5'));var util=require(_0xe17a('0x6'));var path=require('path');var sox=require(_0xe17a('0x7'));var csv=require(_0xe17a('0x8'));var ejs=require(_0xe17a('0x9'));var fs=require('fs');var fs_extra=require(_0xe17a('0xa'));var _=require(_0xe17a('0xb'));var squel=require(_0xe17a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe17a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe17a('0xe'));var Papa=require('papaparse');var Redis=require(_0xe17a('0xf'));var authService=require(_0xe17a('0x10'));var qs=require(_0xe17a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe17a('0x12'));var logger=require(_0xe17a('0x13'))('api');var utils=require(_0xe17a('0x14'));var config=require(_0xe17a('0x15'));var licenseUtil=require(_0xe17a('0x16'));var db=require(_0xe17a('0x17'))['db'];var integrations=require(_0xe17a('0x18'));function respondWithStatusCode(_0x2cedf3,_0x23a24e){_0x23a24e=_0x23a24e||0xcc;return function(_0x58f600){if(_0x58f600){return _0x2cedf3['sendStatus'](_0x23a24e);}return _0x2cedf3[_0xe17a('0x19')](_0x23a24e)['end']();};}function respondWithResult(_0xc87e7f,_0x38e429){_0x38e429=_0x38e429||0xc8;return function(_0x1d7299){if(_0x1d7299){return _0xc87e7f[_0xe17a('0x19')](_0x38e429)[_0xe17a('0x1a')](_0x1d7299);}};}function respondWithFilteredResult(_0xb97bd8,_0x61c51a){return function(_0xb8444f){if(_0xb8444f){var _0x80181c=typeof _0x61c51a['offset']===_0xe17a('0x1b')&&typeof _0x61c51a[_0xe17a('0x1c')]===_0xe17a('0x1b');var _0x585896=_0xb8444f[_0xe17a('0x1d')];var _0x29c9ba=_0x80181c?0x0:_0x61c51a[_0xe17a('0x1e')];var _0x1476f1=_0x80181c?_0xb8444f[_0xe17a('0x1d')]:_0x61c51a[_0xe17a('0x1e')]+_0x61c51a[_0xe17a('0x1c')];var _0xa0b064;if(_0x1476f1>=_0x585896){_0x1476f1=_0x585896;_0xa0b064=0xc8;}else{_0xa0b064=0xce;}_0xb97bd8[_0xe17a('0x19')](_0xa0b064);return _0xb97bd8[_0xe17a('0x1f')](_0xe17a('0x20'),_0x29c9ba+'-'+_0x1476f1+'/'+_0x585896)[_0xe17a('0x1a')](_0xb8444f);}return null;};}function patchUpdates(_0x2b1abe){return function(_0x5b5334){try{jsonpatch[_0xe17a('0x21')](_0x5b5334,_0x2b1abe,!![]);}catch(_0x3faf54){return BPromise[_0xe17a('0x22')](_0x3faf54);}return _0x5b5334['save']();};}function saveUpdates(_0x4694c1,_0x2d5441){return function(_0x55f746){if(_0x55f746){return _0x55f746[_0xe17a('0x23')](_0x4694c1)[_0xe17a('0x24')](function(_0x3af2a7){return _0x3af2a7;});}return null;};}function removeEntity(_0x59923d,_0x1fa0d5){return function(_0x609405){if(_0x609405){return _0x609405[_0xe17a('0x25')]()[_0xe17a('0x24')](function(){_0x59923d['status'](0xcc)[_0xe17a('0x26')]();});}};}function handleEntityNotFound(_0x2eb65a,_0x41f58d){return function(_0x280faa){if(!_0x280faa){_0x2eb65a['sendStatus'](0x194);}return _0x280faa;};}function handleError(_0x4bab38,_0x4eef18){_0x4eef18=_0x4eef18||0x1f4;return function(_0x3ff974){logger[_0xe17a('0x27')](_0x3ff974[_0xe17a('0x28')]);if(_0x3ff974[_0xe17a('0x29')]){delete _0x3ff974[_0xe17a('0x29')];}_0x4bab38[_0xe17a('0x19')](_0x4eef18)[_0xe17a('0x2a')](_0x3ff974);};}exports[_0xe17a('0x2b')]=function(_0xd28089,_0xb839c3){var _0x2a71c4={},_0x1bfa9a={},_0x5135cb={'count':0x0,'rows':[]};var _0x527b3f=_[_0xe17a('0x2c')](db[_0xe17a('0x2d')][_0xe17a('0x2e')],function(_0x3dc213){return{'name':_0x3dc213[_0xe17a('0x2f')],'type':_0x3dc213['type'][_0xe17a('0x30')]};});_0x1bfa9a[_0xe17a('0x31')]=_[_0xe17a('0x2c')](_0x527b3f,_0xe17a('0x29'));_0x1bfa9a[_0xe17a('0x32')]=_['keys'](_0xd28089[_0xe17a('0x32')]);_0x1bfa9a[_0xe17a('0x33')]=_[_0xe17a('0x34')](_0x1bfa9a['model'],_0x1bfa9a['query']);_0x2a71c4[_0xe17a('0x35')]=_[_0xe17a('0x34')](_0x1bfa9a[_0xe17a('0x31')],qs['fields'](_0xd28089[_0xe17a('0x32')][_0xe17a('0x36')]));_0x2a71c4[_0xe17a('0x35')]=_0x2a71c4['attributes']['length']?_0x2a71c4['attributes']:_0x1bfa9a[_0xe17a('0x31')];if(!_0xd28089[_0xe17a('0x32')]['hasOwnProperty'](_0xe17a('0x37'))){_0x2a71c4[_0xe17a('0x1c')]=qs[_0xe17a('0x1c')](_0xd28089['query'][_0xe17a('0x1c')]);_0x2a71c4[_0xe17a('0x1e')]=qs[_0xe17a('0x1e')](_0xd28089[_0xe17a('0x32')][_0xe17a('0x1e')]);}_0x2a71c4['order']=qs[_0xe17a('0x38')](_0xd28089[_0xe17a('0x32')][_0xe17a('0x38')]);_0x2a71c4[_0xe17a('0x39')]=qs[_0xe17a('0x33')](_[_0xe17a('0x3a')](_0xd28089['query'],_0x1bfa9a[_0xe17a('0x33')]),_0x527b3f);if(_0xd28089['query']['filter']){_0x2a71c4['where']=_[_0xe17a('0x3b')](_0x2a71c4['where'],{'$or':_['map'](_0x527b3f,function(_0x5a4a11){if(_0x5a4a11[_0xe17a('0x3c')]!==_0xe17a('0x3d')){var _0x34e4eb={};_0x34e4eb[_0x5a4a11['name']]={'$like':'%'+_0xd28089[_0xe17a('0x32')][_0xe17a('0x3e')]+'%'};return _0x34e4eb;}})});}_0x2a71c4=_[_0xe17a('0x3b')]({},_0x2a71c4,_0xd28089[_0xe17a('0x3f')]);var _0x5da49b={'where':_0x2a71c4[_0xe17a('0x39')]};return db[_0xe17a('0x2d')][_0xe17a('0x1d')](_0x5da49b)[_0xe17a('0x24')](function(_0xf266de){_0x5135cb['count']=_0xf266de;if(_0xd28089[_0xe17a('0x32')][_0xe17a('0x40')]){_0x2a71c4[_0xe17a('0x41')]=[{'all':!![]}];}return db[_0xe17a('0x2d')][_0xe17a('0x42')](_0x2a71c4);})[_0xe17a('0x24')](function(_0x337cb4){_0x5135cb[_0xe17a('0x43')]=_0x337cb4;return _0x5135cb;})['then'](respondWithFilteredResult(_0xb839c3,_0x2a71c4))[_0xe17a('0x44')](handleError(_0xb839c3,null));};exports['show']=function(_0x574aa9,_0x41fb13){var _0x251e3f={'raw':![],'where':{'id':_0x574aa9[_0xe17a('0x45')]['id']}},_0x5ac9c9={};_0x5ac9c9[_0xe17a('0x31')]=_[_0xe17a('0x46')](db[_0xe17a('0x2d')][_0xe17a('0x2e')]);_0x5ac9c9['query']=_[_0xe17a('0x46')](_0x574aa9[_0xe17a('0x32')]);_0x5ac9c9['filters']=_['intersection'](_0x5ac9c9[_0xe17a('0x31')],_0x5ac9c9['query']);_0x251e3f[_0xe17a('0x35')]=_['intersection'](_0x5ac9c9[_0xe17a('0x31')],qs[_0xe17a('0x36')](_0x574aa9[_0xe17a('0x32')][_0xe17a('0x36')]));_0x251e3f[_0xe17a('0x35')]=_0x251e3f[_0xe17a('0x35')][_0xe17a('0x47')]?_0x251e3f[_0xe17a('0x35')]:_0x5ac9c9['model'];if(_0x574aa9[_0xe17a('0x32')][_0xe17a('0x40')]){_0x251e3f['include']=[{'all':!![]}];}_0x251e3f=_['merge']({},_0x251e3f,_0x574aa9[_0xe17a('0x3f')]);return db[_0xe17a('0x2d')]['find'](_0x251e3f)[_0xe17a('0x24')](handleEntityNotFound(_0x41fb13,null))['then'](respondWithResult(_0x41fb13,null))[_0xe17a('0x44')](handleError(_0x41fb13,null));};exports['create']=function(_0x1f7411,_0x58f391){return db[_0xe17a('0x2d')][_0xe17a('0x48')](_0x1f7411[_0xe17a('0x49')],{})['then'](respondWithResult(_0x58f391,0xc9))['catch'](handleError(_0x58f391,null));};exports['update']=function(_0x50c9fa,_0x1c03d6){if(_0x50c9fa[_0xe17a('0x49')]['id']){delete _0x50c9fa['body']['id'];}return db[_0xe17a('0x2d')][_0xe17a('0x4a')]({'where':{'id':_0x50c9fa[_0xe17a('0x45')]['id']}})[_0xe17a('0x24')](handleEntityNotFound(_0x1c03d6,null))[_0xe17a('0x24')](saveUpdates(_0x50c9fa[_0xe17a('0x49')],null))['then'](respondWithResult(_0x1c03d6,null))['catch'](handleError(_0x1c03d6,null));};exports[_0xe17a('0x25')]=function(_0xdd751d,_0x5550eb){return db[_0xe17a('0x2d')][_0xe17a('0x4a')]({'where':{'id':_0xdd751d[_0xe17a('0x45')]['id']}})[_0xe17a('0x24')](handleEntityNotFound(_0x5550eb,null))[_0xe17a('0x24')](removeEntity(_0x5550eb,null))['catch'](handleError(_0x5550eb,null));};exports['getConfigurations']=function(_0x44c5b7,_0x34c47c,_0x410c0b){var _0x3bd826={};var _0x372504={};var _0x4afba9;var _0x1a1ecd;return db[_0xe17a('0x2d')][_0xe17a('0x4b')]({'where':{'id':_0x44c5b7[_0xe17a('0x45')]['id']}})['then'](handleEntityNotFound(_0x34c47c,null))['then'](function(_0x39f273){if(_0x39f273){_0x4afba9=_0x39f273;_0x372504['model']=_[_0xe17a('0x46')](db[_0xe17a('0x4c')]['rawAttributes']);_0x372504['query']=_[_0xe17a('0x46')](_0x44c5b7[_0xe17a('0x32')]);_0x372504[_0xe17a('0x33')]=_['intersection'](_0x372504[_0xe17a('0x31')],_0x372504[_0xe17a('0x32')]);_0x3bd826['attributes']=_[_0xe17a('0x34')](_0x372504[_0xe17a('0x31')],qs[_0xe17a('0x36')](_0x44c5b7[_0xe17a('0x32')][_0xe17a('0x36')]));_0x3bd826[_0xe17a('0x35')]=_0x3bd826['attributes'][_0xe17a('0x47')]?_0x3bd826[_0xe17a('0x35')]:_0x372504[_0xe17a('0x31')];_0x3bd826[_0xe17a('0x4d')]=qs[_0xe17a('0x38')](_0x44c5b7[_0xe17a('0x32')][_0xe17a('0x38')]);_0x3bd826[_0xe17a('0x39')]=qs['filters'](_['pick'](_0x44c5b7[_0xe17a('0x32')],_0x372504[_0xe17a('0x33')]));if(_0x44c5b7[_0xe17a('0x32')][_0xe17a('0x3e')]){_0x3bd826[_0xe17a('0x39')]=_['merge'](_0x3bd826[_0xe17a('0x39')],{'$or':_[_0xe17a('0x2c')](_0x3bd826[_0xe17a('0x35')],function(_0x3766f9){var _0x4b7646={};_0x4b7646[_0x3766f9]={'$like':'%'+_0x44c5b7['query'][_0xe17a('0x3e')]+'%'};return _0x4b7646;})});}_0x3bd826=_[_0xe17a('0x3b')]({},_0x3bd826,_0x44c5b7[_0xe17a('0x3f')]);return _0x4afba9[_0xe17a('0x4e')](_0x3bd826);}})[_0xe17a('0x24')](function(_0x1e0ee7){if(_0x1e0ee7){_0x1a1ecd=_0x1e0ee7[_0xe17a('0x47')];if(!_0x44c5b7['query'][_0xe17a('0x4f')](_0xe17a('0x37'))){_0x3bd826[_0xe17a('0x1c')]=qs[_0xe17a('0x1c')](_0x44c5b7[_0xe17a('0x32')][_0xe17a('0x1c')]);_0x3bd826[_0xe17a('0x1e')]=qs['offset'](_0x44c5b7[_0xe17a('0x32')][_0xe17a('0x1e')]);}return _0x4afba9[_0xe17a('0x4e')](_0x3bd826);}})[_0xe17a('0x24')](function(_0xfe8909){if(_0xfe8909){return _0xfe8909?{'count':_0x1a1ecd,'rows':_0xfe8909}:null;}})[_0xe17a('0x24')](respondWithResult(_0x34c47c,null))[_0xe17a('0x44')](handleError(_0x34c47c,null));};exports['addConfiguration']=function(_0x304b14,_0x34ea41,_0xb59980){if(_0x304b14['body']['id']){delete _0x304b14[_0xe17a('0x49')]['id'];}return db[_0xe17a('0x2d')][_0xe17a('0x4b')]({'where':{'id':_0x304b14['params']['id']}})[_0xe17a('0x24')](handleEntityNotFound(_0x34ea41,null))[_0xe17a('0x24')](function(_0x3abab3){if(_0x3abab3){_0x304b14[_0xe17a('0x49')][_0xe17a('0x50')]=_0x3abab3['id'];_0x304b14['body']['Subjects']=integrations['getSubjects'](_0x304b14[_0xe17a('0x49')]['channel'],_0x304b14['body'][_0xe17a('0x3c')]);_0x304b14[_0xe17a('0x49')][_0xe17a('0x51')]=integrations[_0xe17a('0x52')](_0x304b14[_0xe17a('0x49')]['channel'],_0x304b14['body']['type']);return db[_0xe17a('0x4c')][_0xe17a('0x48')](_0x304b14['body'],{'include':[{'model':db[_0xe17a('0x53')],'as':_0xe17a('0x54')},{'model':db[_0xe17a('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x34ea41,null))[_0xe17a('0x44')](handleError(_0x34ea41,null));};exports[_0xe17a('0x55')]=function(_0x112f0b,_0x14c6d4,_0x5242a2){var _0x5a1624='';var _0xe7f6b2='';return db[_0xe17a('0x2d')][_0xe17a('0x4b')]({'where':{'id':_0x112f0b[_0xe17a('0x45')]['id']},'attributes':['id',_0xe17a('0x56'),'remoteUri',_0xe17a('0x57')]})[_0xe17a('0x24')](handleEntityNotFound(_0x14c6d4,null))[_0xe17a('0x24')](function(_0x1415ca){if(_0x1415ca){_0xe7f6b2=_0x1415ca['username'];_0x5a1624=_0x1415ca['remoteUri'];var _0x2c09d8=_0x1415ca[_0xe17a('0x58')]['slice'](-0x1);if(_0x2c09d8==='/'){_0x5a1624=_0x5a1624[_0xe17a('0x59')](0x0,_0x5a1624[_0xe17a('0x5a')](_0x2c09d8));}return rp({'method':'GET','uri':util[_0xe17a('0x5b')]('%s%s',_0x5a1624,'/api/selector/owners'),'headers':{'Authorization':_0xe17a('0x5c')+_0x1415ca['apiKey']},'json':!![]});}})[_0xe17a('0x24')](function(_0x1a0b79){if(_0x1a0b79){var _0x58bc61=_0x1a0b79[_0xe17a('0x5d')];var _0x4a4e1c=![];var _0x4a16ba=null;for(_0x4a16ba=0x0;_0x4a16ba<_0x58bc61[_0xe17a('0x47')];_0x4a16ba++){if(_0x58bc61[_0x4a16ba]['email']===_0xe7f6b2){_0x4a4e1c=!![];}}if(_0x4a4e1c){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xe17a('0x24')](respondWithResult(_0x14c6d4,null))[_0xe17a('0x44')](function(_0x4cc682){var _0x78b75b=_0x112f0b['query'][_0xe17a('0x5e')]?0x1f4:_0x4cc682['statusCode']||0x1f4;logger[_0xe17a('0x27')](_0xe17a('0x5f'),_0xe17a('0x55'),_0x78b75b,JSON['stringify'](_0x4cc682));delete _0x4cc682[_0xe17a('0x29')];if(_0x78b75b===0x191){_0x78b75b=0x190;}_0x14c6d4[_0xe17a('0x19')](_0x78b75b)['send'](_0x112f0b[_0xe17a('0x32')][_0xe17a('0x5e')]?{'message':_0xe17a('0x60'),'statusCode':_0x4cc682[_0xe17a('0x61')]}:_0x4cc682);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 87ec199..fa6d2c0 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 _0x82c4=['define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshsalesAccount.attributes','exports'];(function(_0x2c5614,_0x418e40){var _0x218f0c=function(_0x3ef91e){while(--_0x3ef91e){_0x2c5614['push'](_0x2c5614['shift']());}};_0x218f0c(++_0x418e40);}(_0x82c4,0x1ca));var _0x482c=function(_0x52bd65,_0x160646){_0x52bd65=_0x52bd65-0x0;var _0x13fd57=_0x82c4[_0x52bd65];return _0x13fd57;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x482c('0x9')]=function(_0x5d7c76,_0xfdb92){return _0x5d7c76[_0x482c('0xa')](_0x482c('0xb'),attributes,{'tableName':_0x482c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','int_freshsales_accounts'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0xc2c7,0x134));var _0x7c2c=function(_0x312a8b,_0x3d90ab){_0x312a8b=_0x312a8b-0x0;var _0x2231dc=_0xc2c7[_0x312a8b];return _0x2231dc;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x7c2c('0x8'));module[_0x7c2c('0x9')]=function(_0x23c038,_0x54f027){return _0x23c038['define']('FreshsalesAccount',attributes,{'tableName':_0x7c2c('0xa'),'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 37e1090..5434797 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 _0x524e=['http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshsalesAccount','catch','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52667e,_0x4725db){var _0x5117b0=function(_0x424c42){while(--_0x424c42){_0x52667e['push'](_0x52667e['shift']());}};_0x5117b0(++_0x4725db);}(_0x524e,0x15e));var _0xe524=function(_0x3e87f2,_0x4489f4){_0x3e87f2=_0x3e87f2-0x0;var _0x989a26=_0x524e[_0x3e87f2];return _0x989a26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['GetFreshsalesAccount']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')]({'raw':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]===undefined?!![]:![]:!![],'where':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1c')]||null:null,'include':_0x3a4027[_0xe524('0x18')]?_0x3a4027['options'][_0xe524('0x1d')]?_['map'](_0x3a4027['options'][_0xe524('0x1d')],function(_0x23df5e){return{'model':db[_0x23df5e[_0xe524('0x1e')]],'as':_0x23df5e['as'],'attributes':_0x23df5e[_0xe524('0x1b')],'include':_0x23df5e['include']?_[_0xe524('0x1f')](_0x23df5e['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x1e')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1b')],'include':_0x17e245[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x17e245[_0xe524('0x1d')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x45abad){logger[_0xe524('0xd')](_0xe524('0x20'),_0x3a4027);logger[_0xe524('0x10')]('GetFreshsalesAccount',_0x3a4027,JSON['stringify'](_0x45abad));_0x11b2a1(_0x45abad);})[_0xe524('0x21')](function(_0x25e7a7){logger[_0xe524('0x13')](_0xe524('0x20'),_0x25e7a7[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x25e7a7[_0xe524('0x15')]));});});};exports[_0xe524('0x22')]=function(_0x4a4e15){var _0x5b7ded=this;return new Promise(function(_0x20688e,_0x376324){return db['FreshsalesAccount'][_0xe524('0x23')]({'raw':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['attributes']||null:null,'include':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')]?_['map'](_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')],function(_0x49c43e){return{'model':db[_0x49c43e[_0xe524('0x1e')]],'as':_0x49c43e['as'],'attributes':_0x49c43e[_0xe524('0x1b')],'include':_0x49c43e[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x49c43e['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x1e')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1b')],'include':_0x415450[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x415450[_0xe524('0x1d')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x1e')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x56f371){logger[_0xe524('0xd')](_0xe524('0x22'),_0x4a4e15);logger['debug'](_0xe524('0x22'),_0x4a4e15,JSON['stringify'](_0x56f371));_0x20688e(_0x56f371);})[_0xe524('0x21')](function(_0x41af26){logger[_0xe524('0x13')](_0xe524('0x22'),_0x41af26[_0xe524('0x15')],_0x4a4e15);_0x376324(_0x5b7ded[_0xe524('0x13')](0x1f4,_0x41af26[_0xe524('0x15')]));});});}; \ No newline at end of file +var _0x687b=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','raw','lodash','util','moment'];(function(_0x3ef5bb,_0x27e3ac){var _0x59d620=function(_0x46cd45){while(--_0x46cd45){_0x3ef5bb['push'](_0x3ef5bb['shift']());}};_0x59d620(++_0x27e3ac);}(_0x687b,0x14a));var _0xb687=function(_0x2aa323,_0x1c492b){_0x2aa323=_0x2aa323-0x0;var _0x17fcab=_0x687b[_0x2aa323];return _0x17fcab;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}exports[_0xb687('0x18')]=function(_0x30d370){var _0x5eb9b9=this;return new Promise(function(_0x48958d,_0x12eff1){return db[_0xb687('0x19')][_0xb687('0x1a')]({'raw':_0x30d370['options']?_0x30d370[_0xb687('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x30d370[_0xb687('0x1b')]?_0x30d370[_0xb687('0x1b')][_0xb687('0x1c')]||null:null,'attributes':_0x30d370[_0xb687('0x1b')]?_0x30d370['options'][_0xb687('0x1d')]||null:null,'limit':_0x30d370['options']?_0x30d370[_0xb687('0x1b')][_0xb687('0x1e')]||null:null,'include':_0x30d370[_0xb687('0x1b')]?_0x30d370['options'][_0xb687('0x1f')]?_[_0xb687('0x20')](_0x30d370[_0xb687('0x1b')][_0xb687('0x1f')],function(_0xbf6c58){return{'model':db[_0xbf6c58[_0xb687('0x21')]],'as':_0xbf6c58['as'],'attributes':_0xbf6c58[_0xb687('0x1d')],'include':_0xbf6c58[_0xb687('0x1f')]?_['map'](_0xbf6c58[_0xb687('0x1f')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x21')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1d')],'include':_0x129347[_0xb687('0x1f')]?_[_0xb687('0x20')](_0x129347[_0xb687('0x1f')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x21')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3712cf){logger[_0xb687('0xd')](_0xb687('0x18'),_0x30d370);logger[_0xb687('0x10')](_0xb687('0x18'),_0x30d370,JSON[_0xb687('0x12')](_0x3712cf));_0x48958d(_0x3712cf);})['catch'](function(_0x28b69a){logger['error'](_0xb687('0x18'),_0x28b69a[_0xb687('0x15')],_0x30d370);_0x12eff1(_0x5eb9b9[_0xb687('0x13')](0x1f4,_0x28b69a[_0xb687('0x15')]));});});};exports[_0xb687('0x22')]=function(_0x43d20d){var _0xf1f0dd=this;return new Promise(function(_0x556815,_0x3da2be){return db[_0xb687('0x19')][_0xb687('0x23')]({'raw':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')][_0xb687('0x24')]===undefined?!![]:![]:!![],'where':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')][_0xb687('0x1c')]||null:null,'attributes':_0x43d20d[_0xb687('0x1b')]?_0x43d20d[_0xb687('0x1b')]['attributes']||null:null,'include':_0x43d20d['options']?_0x43d20d[_0xb687('0x1b')][_0xb687('0x1f')]?_[_0xb687('0x20')](_0x43d20d[_0xb687('0x1b')]['include'],function(_0x4f0b28){return{'model':db[_0x4f0b28[_0xb687('0x21')]],'as':_0x4f0b28['as'],'attributes':_0x4f0b28[_0xb687('0x1d')],'include':_0x4f0b28['include']?_[_0xb687('0x20')](_0x4f0b28[_0xb687('0x1f')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x21')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x1f')]?_[_0xb687('0x20')](_0x548b83[_0xb687('0x1f')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x21')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x529b1a){logger[_0xb687('0xd')](_0xb687('0x22'),_0x43d20d);logger[_0xb687('0x10')]('ShowFreshsalesAccount',_0x43d20d,JSON[_0xb687('0x12')](_0x529b1a));_0x556815(_0x529b1a);})[_0xb687('0x17')](function(_0x1f1c88){logger[_0xb687('0x13')](_0xb687('0x22'),_0x1f1c88['message'],_0x43d20d);_0x3da2be(_0xf1f0dd[_0xb687('0x13')](0x1f4,_0x1f1c88[_0xb687('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 3f7e2d3..2a76970 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 _0x6b63=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','exports'];(function(_0x41a84c,_0x506dce){var _0x4610c1=function(_0x1a5edf){while(--_0x1a5edf){_0x41a84c['push'](_0x41a84c['shift']());}};_0x4610c1(++_0x506dce);}(_0x6b63,0x19e));var _0x36b6=function(_0x2e861d,_0x2c656d){_0x2e861d=_0x2e861d-0x0;var _0x4fd08d=_0x6b63[_0x2e861d];return _0x4fd08d;};'use strict';var multer=require(_0x36b6('0x0'));var util=require(_0x36b6('0x1'));var path=require('path');var timeout=require(_0x36b6('0x2'));var express=require(_0x36b6('0x3'));var router=express[_0x36b6('0x4')]();var fs_extra=require(_0x36b6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x36b6('0x6'));var config=require('../../config/environment');var controller=require(_0x36b6('0x7'));router[_0x36b6('0x8')]('/',auth[_0x36b6('0x9')](),controller['index']);router[_0x36b6('0x8')](_0x36b6('0xa'),auth[_0x36b6('0x9')](),controller['show']);router[_0x36b6('0x8')](_0x36b6('0xb'),auth[_0x36b6('0x9')](),controller[_0x36b6('0xc')]);router['get'](_0x36b6('0xd'),auth['isAuthenticated'](),controller[_0x36b6('0xe')]);router[_0x36b6('0x8')](_0x36b6('0xf'),auth[_0x36b6('0x9')](),controller[_0x36b6('0x10')]);router['post']('/',auth[_0x36b6('0x9')](),controller[_0x36b6('0x11')]);router[_0x36b6('0x12')](_0x36b6('0xa'),auth[_0x36b6('0x9')](),controller[_0x36b6('0x13')]);router[_0x36b6('0x14')](_0x36b6('0xa'),auth['isAuthenticated'](),controller[_0x36b6('0x15')]);module[_0x36b6('0x16')]=router; \ No newline at end of file +var _0x6974=['getSubjects','/:id/descriptions','/:id/fields','post','create','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x6974,0x1aa));var _0x4697=function(_0x138202,_0x50356b){_0x138202=_0x138202-0x0;var _0x3f21fd=_0x6974[_0x138202];return _0x3f21fd;};'use strict';var multer=require(_0x4697('0x0'));var util=require(_0x4697('0x1'));var path=require(_0x4697('0x2'));var timeout=require('connect-timeout');var express=require(_0x4697('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4697('0x4'));var interaction=require(_0x4697('0x5'));var config=require(_0x4697('0x6'));var controller=require(_0x4697('0x7'));router[_0x4697('0x8')]('/',auth['isAuthenticated'](),controller[_0x4697('0x9')]);router[_0x4697('0x8')](_0x4697('0xa'),auth[_0x4697('0xb')](),controller[_0x4697('0xc')]);router[_0x4697('0x8')](_0x4697('0xd'),auth[_0x4697('0xb')](),controller[_0x4697('0xe')]);router[_0x4697('0x8')](_0x4697('0xf'),auth[_0x4697('0xb')](),controller['getDescriptions']);router[_0x4697('0x8')](_0x4697('0x10'),auth[_0x4697('0xb')](),controller['getFields']);router[_0x4697('0x11')]('/',auth['isAuthenticated'](),controller[_0x4697('0x12')]);router['put'](_0x4697('0xa'),auth[_0x4697('0xb')](),controller[_0x4697('0x13')]);router[_0x4697('0x14')](_0x4697('0xa'),auth['isAuthenticated'](),controller[_0x4697('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 781aede..d535821 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 _0x4bc6=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bc6,0xfc));var _0x64bc=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x4bc6[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require(_0x64bc('0x0'));module[_0x64bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x64bc('0x2')]}}; \ No newline at end of file +var _0x3778=['exports','STRING','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3778,0x7a));var _0x8377=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3778[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8377('0x0'));module[_0x8377('0x1')]={'name':{'type':Sequelize[_0x8377('0x2')]},'description':{'type':Sequelize[_0x8377('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index cdfe55e..c20bde8 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 _0xbd1c=['length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','rawAttributes','include','find','create','body','destroy','getSubjects','findOne','FreshsalesField','order','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','FreshsalesConfiguration','key','model','map','query','keys','intersection','attributes','fields'];(function(_0x4428b9,_0x17a4ac){var _0x31c1c8=function(_0x428d84){while(--_0x428d84){_0x4428b9['push'](_0x4428b9['shift']());}};_0x31c1c8(++_0x17a4ac);}(_0xbd1c,0xbe));var _0xcbd1=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xbd1c[_0xc8a931];return _0x28bd27;};'use strict';var emlformat=require(_0xcbd1('0x0'));var rimraf=require(_0xcbd1('0x1'));var zipdir=require(_0xcbd1('0x2'));var jsonpatch=require(_0xcbd1('0x3'));var rp=require(_0xcbd1('0x4'));var moment=require(_0xcbd1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcbd1('0x6'));var util=require(_0xcbd1('0x7'));var path=require('path');var sox=require(_0xcbd1('0x8'));var csv=require(_0xcbd1('0x9'));var ejs=require(_0xcbd1('0xa'));var fs=require('fs');var fs_extra=require(_0xcbd1('0xb'));var _=require('lodash');var squel=require(_0xcbd1('0xc'));var crypto=require(_0xcbd1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcbd1('0xe'));var toCsv=require(_0xcbd1('0x9'));var querystring=require(_0xcbd1('0xf'));var Papa=require(_0xcbd1('0x10'));var Redis=require(_0xcbd1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcbd1('0x12'));var as=require(_0xcbd1('0x13'));var hardwareService=require(_0xcbd1('0x14'));var logger=require('../../config/logger')(_0xcbd1('0x15'));var utils=require(_0xcbd1('0x16'));var config=require(_0xcbd1('0x17'));var licenseUtil=require(_0xcbd1('0x18'));var db=require(_0xcbd1('0x19'))['db'];function respondWithStatusCode(_0x5f5725,_0x15d6ab){_0x15d6ab=_0x15d6ab||0xcc;return function(_0x53d28b){if(_0x53d28b){return _0x5f5725[_0xcbd1('0x1a')](_0x15d6ab);}return _0x5f5725[_0xcbd1('0x1b')](_0x15d6ab)['end']();};}function respondWithResult(_0x5cdf86,_0x1d1eca){_0x1d1eca=_0x1d1eca||0xc8;return function(_0x436676){if(_0x436676){return _0x5cdf86[_0xcbd1('0x1b')](_0x1d1eca)['json'](_0x436676);}};}function respondWithFilteredResult(_0x1976ab,_0x15bda0){return function(_0x258832){if(_0x258832){var _0x450ef9=typeof _0x15bda0[_0xcbd1('0x1c')]==='undefined'&&typeof _0x15bda0[_0xcbd1('0x1d')]===_0xcbd1('0x1e');var _0x24332f=_0x258832[_0xcbd1('0x1f')];var _0x5bea6f=_0x450ef9?0x0:_0x15bda0[_0xcbd1('0x1c')];var _0x3ca92b=_0x450ef9?_0x258832[_0xcbd1('0x1f')]:_0x15bda0['offset']+_0x15bda0[_0xcbd1('0x1d')];var _0x3452a5;if(_0x3ca92b>=_0x24332f){_0x3ca92b=_0x24332f;_0x3452a5=0xc8;}else{_0x3452a5=0xce;}_0x1976ab[_0xcbd1('0x1b')](_0x3452a5);return _0x1976ab['set'](_0xcbd1('0x20'),_0x5bea6f+'-'+_0x3ca92b+'/'+_0x24332f)['json'](_0x258832);}return null;};}function patchUpdates(_0x475146){return function(_0x320416){try{jsonpatch[_0xcbd1('0x21')](_0x320416,_0x475146,!![]);}catch(_0x33801c){return BPromise[_0xcbd1('0x22')](_0x33801c);}return _0x320416[_0xcbd1('0x23')]();};}function saveUpdates(_0x127fb7,_0x3afc2c){return function(_0x6db1f9){if(_0x6db1f9){return _0x6db1f9[_0xcbd1('0x24')](_0x127fb7)[_0xcbd1('0x25')](function(_0x38cbdf){return _0x38cbdf;});}return null;};}function removeEntity(_0x23cff3,_0x2940d8){return function(_0x35eda8){if(_0x35eda8){return _0x35eda8['destroy']()['then'](function(){_0x23cff3[_0xcbd1('0x1b')](0xcc)[_0xcbd1('0x26')]();});}};}function handleEntityNotFound(_0x1dcd0a,_0x2d1530){return function(_0x1b865c){if(!_0x1b865c){_0x1dcd0a[_0xcbd1('0x1a')](0x194);}return _0x1b865c;};}function handleError(_0x7a8cdf,_0x1076c6){_0x1076c6=_0x1076c6||0x1f4;return function(_0x5c4b68){logger[_0xcbd1('0x27')](_0x5c4b68[_0xcbd1('0x28')]);if(_0x5c4b68[_0xcbd1('0x29')]){delete _0x5c4b68['name'];}_0x7a8cdf[_0xcbd1('0x1b')](_0x1076c6)[_0xcbd1('0x2a')](_0x5c4b68);};}exports[_0xcbd1('0x2b')]=function(_0x29eaf0,_0x3c5d65){var _0x293daf={},_0x38f33d={},_0x5e9fdc={'count':0x0,'rows':[]};var _0x5f32a1=_['map'](db[_0xcbd1('0x2c')]['rawAttributes'],function(_0x67aeac){return{'name':_0x67aeac['fieldName'],'type':_0x67aeac['type'][_0xcbd1('0x2d')]};});_0x38f33d[_0xcbd1('0x2e')]=_[_0xcbd1('0x2f')](_0x5f32a1,_0xcbd1('0x29'));_0x38f33d[_0xcbd1('0x30')]=_[_0xcbd1('0x31')](_0x29eaf0[_0xcbd1('0x30')]);_0x38f33d['filters']=_[_0xcbd1('0x32')](_0x38f33d[_0xcbd1('0x2e')],_0x38f33d[_0xcbd1('0x30')]);_0x293daf[_0xcbd1('0x33')]=_[_0xcbd1('0x32')](_0x38f33d['model'],qs[_0xcbd1('0x34')](_0x29eaf0[_0xcbd1('0x30')][_0xcbd1('0x34')]));_0x293daf[_0xcbd1('0x33')]=_0x293daf[_0xcbd1('0x33')][_0xcbd1('0x35')]?_0x293daf[_0xcbd1('0x33')]:_0x38f33d[_0xcbd1('0x2e')];if(!_0x29eaf0[_0xcbd1('0x30')]['hasOwnProperty'](_0xcbd1('0x36'))){_0x293daf['limit']=qs['limit'](_0x29eaf0[_0xcbd1('0x30')]['limit']);_0x293daf[_0xcbd1('0x1c')]=qs['offset'](_0x29eaf0[_0xcbd1('0x30')][_0xcbd1('0x1c')]);}_0x293daf['order']=qs[_0xcbd1('0x37')](_0x29eaf0['query'][_0xcbd1('0x37')]);_0x293daf[_0xcbd1('0x38')]=qs[_0xcbd1('0x39')](_[_0xcbd1('0x3a')](_0x29eaf0['query'],_0x38f33d[_0xcbd1('0x39')]),_0x5f32a1);if(_0x29eaf0[_0xcbd1('0x30')][_0xcbd1('0x3b')]){_0x293daf[_0xcbd1('0x38')]=_[_0xcbd1('0x3c')](_0x293daf[_0xcbd1('0x38')],{'$or':_['map'](_0x5f32a1,function(_0x433efc){if(_0x433efc[_0xcbd1('0x3d')]!==_0xcbd1('0x3e')){var _0x3ec1ff={};_0x3ec1ff[_0x433efc[_0xcbd1('0x29')]]={'$like':'%'+_0x29eaf0['query'][_0xcbd1('0x3b')]+'%'};return _0x3ec1ff;}})});}_0x293daf=_[_0xcbd1('0x3c')]({},_0x293daf,_0x29eaf0[_0xcbd1('0x3f')]);var _0x22d5aa={'where':_0x293daf[_0xcbd1('0x38')]};return db[_0xcbd1('0x2c')][_0xcbd1('0x1f')](_0x22d5aa)['then'](function(_0x3dd11a){_0x5e9fdc[_0xcbd1('0x1f')]=_0x3dd11a;if(_0x29eaf0[_0xcbd1('0x30')]['includeAll']){_0x293daf['include']=[{'all':!![]}];}return db[_0xcbd1('0x2c')][_0xcbd1('0x40')](_0x293daf);})['then'](function(_0x55d7b2){_0x5e9fdc['rows']=_0x55d7b2;return _0x5e9fdc;})['then'](respondWithFilteredResult(_0x3c5d65,_0x293daf))[_0xcbd1('0x41')](handleError(_0x3c5d65,null));};exports[_0xcbd1('0x42')]=function(_0x408458,_0x453379){var _0x2c0499={'raw':![],'where':{'id':_0x408458[_0xcbd1('0x43')]['id']}},_0x204aec={};_0x204aec[_0xcbd1('0x2e')]=_[_0xcbd1('0x31')](db['FreshsalesConfiguration'][_0xcbd1('0x44')]);_0x204aec[_0xcbd1('0x30')]=_[_0xcbd1('0x31')](_0x408458[_0xcbd1('0x30')]);_0x204aec['filters']=_[_0xcbd1('0x32')](_0x204aec[_0xcbd1('0x2e')],_0x204aec[_0xcbd1('0x30')]);_0x2c0499['attributes']=_['intersection'](_0x204aec[_0xcbd1('0x2e')],qs[_0xcbd1('0x34')](_0x408458[_0xcbd1('0x30')][_0xcbd1('0x34')]));_0x2c0499[_0xcbd1('0x33')]=_0x2c0499[_0xcbd1('0x33')][_0xcbd1('0x35')]?_0x2c0499['attributes']:_0x204aec[_0xcbd1('0x2e')];if(_0x408458[_0xcbd1('0x30')]['includeAll']){_0x2c0499[_0xcbd1('0x45')]=[{'all':!![]}];}_0x2c0499=_['merge']({},_0x2c0499,_0x408458[_0xcbd1('0x3f')]);return db[_0xcbd1('0x2c')][_0xcbd1('0x46')](_0x2c0499)['then'](handleEntityNotFound(_0x453379,null))['then'](respondWithResult(_0x453379,null))[_0xcbd1('0x41')](handleError(_0x453379,null));};exports[_0xcbd1('0x47')]=function(_0x429d83,_0x4949d1){return db[_0xcbd1('0x2c')][_0xcbd1('0x47')](_0x429d83[_0xcbd1('0x48')],{})[_0xcbd1('0x25')](respondWithResult(_0x4949d1,0xc9))[_0xcbd1('0x41')](handleError(_0x4949d1,null));};exports[_0xcbd1('0x24')]=function(_0x3195fd,_0x56a970){if(_0x3195fd[_0xcbd1('0x48')]['id']){delete _0x3195fd[_0xcbd1('0x48')]['id'];}return db['FreshsalesConfiguration'][_0xcbd1('0x46')]({'where':{'id':_0x3195fd[_0xcbd1('0x43')]['id']}})[_0xcbd1('0x25')](handleEntityNotFound(_0x56a970,null))[_0xcbd1('0x25')](saveUpdates(_0x3195fd[_0xcbd1('0x48')],null))[_0xcbd1('0x25')](respondWithResult(_0x56a970,null))[_0xcbd1('0x41')](handleError(_0x56a970,null));};exports[_0xcbd1('0x49')]=function(_0x3a3f85,_0x401994){return db[_0xcbd1('0x2c')]['find']({'where':{'id':_0x3a3f85[_0xcbd1('0x43')]['id']}})[_0xcbd1('0x25')](handleEntityNotFound(_0x401994,null))['then'](removeEntity(_0x401994,null))[_0xcbd1('0x41')](handleError(_0x401994,null));};exports[_0xcbd1('0x4a')]=function(_0x566a2f,_0x296e03,_0x500e01){var _0x1288aa={};var _0x5a7d56={};var _0xe045ff;var _0x1e1643;return db[_0xcbd1('0x2c')][_0xcbd1('0x4b')]({'where':{'id':_0x566a2f[_0xcbd1('0x43')]['id']}})[_0xcbd1('0x25')](handleEntityNotFound(_0x296e03,null))[_0xcbd1('0x25')](function(_0x160ced){if(_0x160ced){_0xe045ff=_0x160ced;_0x5a7d56['model']=_['keys'](db[_0xcbd1('0x4c')][_0xcbd1('0x44')]);_0x5a7d56['query']=_[_0xcbd1('0x31')](_0x566a2f[_0xcbd1('0x30')]);_0x5a7d56[_0xcbd1('0x39')]=_[_0xcbd1('0x32')](_0x5a7d56[_0xcbd1('0x2e')],_0x5a7d56[_0xcbd1('0x30')]);_0x1288aa[_0xcbd1('0x33')]=_[_0xcbd1('0x32')](_0x5a7d56[_0xcbd1('0x2e')],qs[_0xcbd1('0x34')](_0x566a2f['query'][_0xcbd1('0x34')]));_0x1288aa[_0xcbd1('0x33')]=_0x1288aa['attributes'][_0xcbd1('0x35')]?_0x1288aa[_0xcbd1('0x33')]:_0x5a7d56['model'];_0x1288aa[_0xcbd1('0x4d')]=qs[_0xcbd1('0x37')](_0x566a2f[_0xcbd1('0x30')][_0xcbd1('0x37')]);_0x1288aa['where']=qs[_0xcbd1('0x39')](_[_0xcbd1('0x3a')](_0x566a2f[_0xcbd1('0x30')],_0x5a7d56[_0xcbd1('0x39')]));if(_0x566a2f[_0xcbd1('0x30')]['filter']){_0x1288aa['where']=_[_0xcbd1('0x3c')](_0x1288aa[_0xcbd1('0x38')],{'$or':_['map'](_0x1288aa[_0xcbd1('0x33')],function(_0x44df61){var _0x2d29e3={};_0x2d29e3[_0x44df61]={'$like':'%'+_0x566a2f[_0xcbd1('0x30')][_0xcbd1('0x3b')]+'%'};return _0x2d29e3;})});}_0x1288aa=_[_0xcbd1('0x3c')]({},_0x1288aa,_0x566a2f['options']);return _0xe045ff[_0xcbd1('0x4a')](_0x1288aa);}})['then'](function(_0x3cb043){if(_0x3cb043){_0x1e1643=_0x3cb043[_0xcbd1('0x35')];if(!_0x566a2f[_0xcbd1('0x30')][_0xcbd1('0x4e')](_0xcbd1('0x36'))){_0x1288aa['limit']=qs['limit'](_0x566a2f[_0xcbd1('0x30')]['limit']);_0x1288aa[_0xcbd1('0x1c')]=qs[_0xcbd1('0x1c')](_0x566a2f[_0xcbd1('0x30')][_0xcbd1('0x1c')]);}return _0xe045ff[_0xcbd1('0x4a')](_0x1288aa);}})[_0xcbd1('0x25')](function(_0x3f72d){if(_0x3f72d){return _0x3f72d?{'count':_0x1e1643,'rows':_0x3f72d}:null;}})[_0xcbd1('0x25')](respondWithResult(_0x296e03,null))[_0xcbd1('0x41')](handleError(_0x296e03,null));};exports[_0xcbd1('0x4f')]=function(_0x3ade47,_0x4a3f25,_0x23f94e){var _0x228389={};var _0x2d1d56={};var _0x32a99d;var _0x1ce9f2;return db[_0xcbd1('0x2c')][_0xcbd1('0x4b')]({'where':{'id':_0x3ade47[_0xcbd1('0x43')]['id']}})[_0xcbd1('0x25')](handleEntityNotFound(_0x4a3f25,null))[_0xcbd1('0x25')](function(_0xc70bd2){if(_0xc70bd2){_0x32a99d=_0xc70bd2;_0x2d1d56[_0xcbd1('0x2e')]=_['keys'](db[_0xcbd1('0x4c')][_0xcbd1('0x44')]);_0x2d1d56[_0xcbd1('0x30')]=_[_0xcbd1('0x31')](_0x3ade47[_0xcbd1('0x30')]);_0x2d1d56[_0xcbd1('0x39')]=_[_0xcbd1('0x32')](_0x2d1d56[_0xcbd1('0x2e')],_0x2d1d56[_0xcbd1('0x30')]);_0x228389[_0xcbd1('0x33')]=_[_0xcbd1('0x32')](_0x2d1d56['model'],qs[_0xcbd1('0x34')](_0x3ade47[_0xcbd1('0x30')]['fields']));_0x228389[_0xcbd1('0x33')]=_0x228389[_0xcbd1('0x33')]['length']?_0x228389[_0xcbd1('0x33')]:_0x2d1d56[_0xcbd1('0x2e')];_0x228389['order']=qs[_0xcbd1('0x37')](_0x3ade47[_0xcbd1('0x30')]['sort']);_0x228389[_0xcbd1('0x38')]=qs[_0xcbd1('0x39')](_[_0xcbd1('0x3a')](_0x3ade47[_0xcbd1('0x30')],_0x2d1d56[_0xcbd1('0x39')]));if(_0x3ade47[_0xcbd1('0x30')][_0xcbd1('0x3b')]){_0x228389[_0xcbd1('0x38')]=_[_0xcbd1('0x3c')](_0x228389[_0xcbd1('0x38')],{'$or':_[_0xcbd1('0x2f')](_0x228389['attributes'],function(_0x3b16c9){var _0x27f0f2={};_0x27f0f2[_0x3b16c9]={'$like':'%'+_0x3ade47[_0xcbd1('0x30')][_0xcbd1('0x3b')]+'%'};return _0x27f0f2;})});}_0x228389=_[_0xcbd1('0x3c')]({},_0x228389,_0x3ade47[_0xcbd1('0x3f')]);return _0x32a99d[_0xcbd1('0x4f')](_0x228389);}})[_0xcbd1('0x25')](function(_0xa451e3){if(_0xa451e3){_0x1ce9f2=_0xa451e3['length'];if(!_0x3ade47[_0xcbd1('0x30')]['hasOwnProperty']('nolimit')){_0x228389['limit']=qs[_0xcbd1('0x1d')](_0x3ade47['query'][_0xcbd1('0x1d')]);_0x228389[_0xcbd1('0x1c')]=qs['offset'](_0x3ade47[_0xcbd1('0x30')][_0xcbd1('0x1c')]);}return _0x32a99d[_0xcbd1('0x4f')](_0x228389);}})[_0xcbd1('0x25')](function(_0x6b9fbc){if(_0x6b9fbc){return _0x6b9fbc?{'count':_0x1ce9f2,'rows':_0x6b9fbc}:null;}})[_0xcbd1('0x25')](respondWithResult(_0x4a3f25,null))[_0xcbd1('0x41')](handleError(_0x4a3f25,null));};exports['getFields']=function(_0x22fbdf,_0x54b88,_0x3050f9){var _0x6cecde={};var _0x536954={};var _0x3d6275;var _0x2201e2;return db[_0xcbd1('0x2c')][_0xcbd1('0x4b')]({'where':{'id':_0x22fbdf[_0xcbd1('0x43')]['id']}})['then'](handleEntityNotFound(_0x54b88,null))[_0xcbd1('0x25')](function(_0x459bd3){if(_0x459bd3){_0x3d6275=_0x459bd3;_0x536954[_0xcbd1('0x2e')]=_[_0xcbd1('0x31')](db[_0xcbd1('0x4c')]['rawAttributes']);_0x536954[_0xcbd1('0x30')]=_['keys'](_0x22fbdf[_0xcbd1('0x30')]);_0x536954[_0xcbd1('0x39')]=_[_0xcbd1('0x32')](_0x536954[_0xcbd1('0x2e')],_0x536954[_0xcbd1('0x30')]);_0x6cecde[_0xcbd1('0x33')]=_['intersection'](_0x536954[_0xcbd1('0x2e')],qs['fields'](_0x22fbdf['query'][_0xcbd1('0x34')]));_0x6cecde[_0xcbd1('0x33')]=_0x6cecde['attributes'][_0xcbd1('0x35')]?_0x6cecde['attributes']:_0x536954[_0xcbd1('0x2e')];_0x6cecde[_0xcbd1('0x4d')]=qs[_0xcbd1('0x37')](_0x22fbdf[_0xcbd1('0x30')][_0xcbd1('0x37')]);_0x6cecde['where']=qs['filters'](_[_0xcbd1('0x3a')](_0x22fbdf[_0xcbd1('0x30')],_0x536954[_0xcbd1('0x39')]));if(_0x22fbdf[_0xcbd1('0x30')][_0xcbd1('0x3b')]){_0x6cecde['where']=_[_0xcbd1('0x3c')](_0x6cecde['where'],{'$or':_[_0xcbd1('0x2f')](_0x6cecde[_0xcbd1('0x33')],function(_0x3542ee){var _0x5bfbf2={};_0x5bfbf2[_0x3542ee]={'$like':'%'+_0x22fbdf[_0xcbd1('0x30')][_0xcbd1('0x3b')]+'%'};return _0x5bfbf2;})});}_0x6cecde=_[_0xcbd1('0x3c')]({},_0x6cecde,_0x22fbdf[_0xcbd1('0x3f')]);return _0x3d6275['getFields'](_0x6cecde);}})[_0xcbd1('0x25')](function(_0x14372e){if(_0x14372e){_0x2201e2=_0x14372e[_0xcbd1('0x35')];if(!_0x22fbdf[_0xcbd1('0x30')][_0xcbd1('0x4e')](_0xcbd1('0x36'))){_0x6cecde[_0xcbd1('0x1d')]=qs[_0xcbd1('0x1d')](_0x22fbdf[_0xcbd1('0x30')][_0xcbd1('0x1d')]);_0x6cecde[_0xcbd1('0x1c')]=qs['offset'](_0x22fbdf[_0xcbd1('0x30')][_0xcbd1('0x1c')]);}return _0x3d6275[_0xcbd1('0x50')](_0x6cecde);}})[_0xcbd1('0x25')](function(_0x3df62b){if(_0x3df62b){return _0x3df62b?{'count':_0x2201e2,'rows':_0x3df62b}:null;}})[_0xcbd1('0x25')](respondWithResult(_0x54b88,null))[_0xcbd1('0x41')](handleError(_0x54b88,null));}; \ No newline at end of file +var _0x4551=['save','update','then','stack','name','map','FreshsalesConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','destroy','findOne','FreshsalesField','order','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject'];(function(_0x4d1cc5,_0x5cf765){var _0x5e3fe5=function(_0x1e96ef){while(--_0x1e96ef){_0x4d1cc5['push'](_0x4d1cc5['shift']());}};_0x5e3fe5(++_0x5cf765);}(_0x4551,0x15d));var _0x1455=function(_0x130011,_0x4e9d3e){_0x130011=_0x130011-0x0;var _0x4f0423=_0x4551[_0x130011];return _0x4f0423;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1455('0x0'));var zipdir=require(_0x1455('0x1'));var jsonpatch=require(_0x1455('0x2'));var rp=require(_0x1455('0x3'));var moment=require(_0x1455('0x4'));var BPromise=require(_0x1455('0x5'));var Mustache=require('mustache');var util=require(_0x1455('0x6'));var path=require(_0x1455('0x7'));var sox=require('sox');var csv=require(_0x1455('0x8'));var ejs=require(_0x1455('0x9'));var fs=require('fs');var fs_extra=require(_0x1455('0xa'));var _=require('lodash');var squel=require(_0x1455('0xb'));var crypto=require(_0x1455('0xc'));var jsforce=require(_0x1455('0xd'));var deskjs=require(_0x1455('0xe'));var toCsv=require(_0x1455('0x8'));var querystring=require(_0x1455('0xf'));var Papa=require(_0x1455('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1455('0x11'));var as=require(_0x1455('0x12'));var hardwareService=require(_0x1455('0x13'));var logger=require(_0x1455('0x14'))(_0x1455('0x15'));var utils=require(_0x1455('0x16'));var config=require(_0x1455('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1455('0x18'))['db'];function respondWithStatusCode(_0x2ef952,_0xfc4fde){_0xfc4fde=_0xfc4fde||0xcc;return function(_0x1257a8){if(_0x1257a8){return _0x2ef952[_0x1455('0x19')](_0xfc4fde);}return _0x2ef952[_0x1455('0x1a')](_0xfc4fde)[_0x1455('0x1b')]();};}function respondWithResult(_0x3ec800,_0x3e84c3){_0x3e84c3=_0x3e84c3||0xc8;return function(_0xb9fdb6){if(_0xb9fdb6){return _0x3ec800[_0x1455('0x1a')](_0x3e84c3)[_0x1455('0x1c')](_0xb9fdb6);}};}function respondWithFilteredResult(_0x17e55b,_0x5eef4f){return function(_0x55f085){if(_0x55f085){var _0x15f3e3=typeof _0x5eef4f[_0x1455('0x1d')]==='undefined'&&typeof _0x5eef4f['limit']===_0x1455('0x1e');var _0x2991f2=_0x55f085[_0x1455('0x1f')];var _0x150d74=_0x15f3e3?0x0:_0x5eef4f['offset'];var _0x4b7240=_0x15f3e3?_0x55f085[_0x1455('0x1f')]:_0x5eef4f[_0x1455('0x1d')]+_0x5eef4f[_0x1455('0x20')];var _0x4c457a;if(_0x4b7240>=_0x2991f2){_0x4b7240=_0x2991f2;_0x4c457a=0xc8;}else{_0x4c457a=0xce;}_0x17e55b[_0x1455('0x1a')](_0x4c457a);return _0x17e55b[_0x1455('0x21')](_0x1455('0x22'),_0x150d74+'-'+_0x4b7240+'/'+_0x2991f2)[_0x1455('0x1c')](_0x55f085);}return null;};}function patchUpdates(_0x3114ae){return function(_0x205c14){try{jsonpatch['apply'](_0x205c14,_0x3114ae,!![]);}catch(_0x286d56){return BPromise[_0x1455('0x23')](_0x286d56);}return _0x205c14[_0x1455('0x24')]();};}function saveUpdates(_0x4911c0,_0x597817){return function(_0x32cf64){if(_0x32cf64){return _0x32cf64[_0x1455('0x25')](_0x4911c0)[_0x1455('0x26')](function(_0x5ea81d){return _0x5ea81d;});}return null;};}function removeEntity(_0x5d87b7,_0x1f6528){return function(_0x2965d7){if(_0x2965d7){return _0x2965d7['destroy']()['then'](function(){_0x5d87b7[_0x1455('0x1a')](0xcc)[_0x1455('0x1b')]();});}};}function handleEntityNotFound(_0xdee7d7,_0x5a6316){return function(_0x2e84dd){if(!_0x2e84dd){_0xdee7d7['sendStatus'](0x194);}return _0x2e84dd;};}function handleError(_0x24e8fd,_0x10fc4a){_0x10fc4a=_0x10fc4a||0x1f4;return function(_0x4d29de){logger['error'](_0x4d29de[_0x1455('0x27')]);if(_0x4d29de['name']){delete _0x4d29de[_0x1455('0x28')];}_0x24e8fd[_0x1455('0x1a')](_0x10fc4a)['send'](_0x4d29de);};}exports['index']=function(_0x5000bc,_0x4a7a3e){var _0x3cf118={},_0xd83917={},_0x4f4752={'count':0x0,'rows':[]};var _0x34ab96=_[_0x1455('0x29')](db[_0x1455('0x2a')][_0x1455('0x2b')],function(_0x656463){return{'name':_0x656463['fieldName'],'type':_0x656463[_0x1455('0x2c')]['key']};});_0xd83917[_0x1455('0x2d')]=_[_0x1455('0x29')](_0x34ab96,_0x1455('0x28'));_0xd83917[_0x1455('0x2e')]=_[_0x1455('0x2f')](_0x5000bc['query']);_0xd83917[_0x1455('0x30')]=_[_0x1455('0x31')](_0xd83917['model'],_0xd83917['query']);_0x3cf118[_0x1455('0x32')]=_[_0x1455('0x31')](_0xd83917[_0x1455('0x2d')],qs[_0x1455('0x33')](_0x5000bc['query'][_0x1455('0x33')]));_0x3cf118[_0x1455('0x32')]=_0x3cf118[_0x1455('0x32')][_0x1455('0x34')]?_0x3cf118['attributes']:_0xd83917['model'];if(!_0x5000bc[_0x1455('0x2e')][_0x1455('0x35')](_0x1455('0x36'))){_0x3cf118[_0x1455('0x20')]=qs[_0x1455('0x20')](_0x5000bc[_0x1455('0x2e')]['limit']);_0x3cf118[_0x1455('0x1d')]=qs[_0x1455('0x1d')](_0x5000bc[_0x1455('0x2e')][_0x1455('0x1d')]);}_0x3cf118['order']=qs[_0x1455('0x37')](_0x5000bc['query'][_0x1455('0x37')]);_0x3cf118[_0x1455('0x38')]=qs[_0x1455('0x30')](_[_0x1455('0x39')](_0x5000bc[_0x1455('0x2e')],_0xd83917[_0x1455('0x30')]),_0x34ab96);if(_0x5000bc[_0x1455('0x2e')][_0x1455('0x3a')]){_0x3cf118['where']=_['merge'](_0x3cf118[_0x1455('0x38')],{'$or':_['map'](_0x34ab96,function(_0x386411){if(_0x386411[_0x1455('0x2c')]!==_0x1455('0x3b')){var _0x3fa46b={};_0x3fa46b[_0x386411[_0x1455('0x28')]]={'$like':'%'+_0x5000bc[_0x1455('0x2e')][_0x1455('0x3a')]+'%'};return _0x3fa46b;}})});}_0x3cf118=_[_0x1455('0x3c')]({},_0x3cf118,_0x5000bc[_0x1455('0x3d')]);var _0x2ec0a9={'where':_0x3cf118[_0x1455('0x38')]};return db[_0x1455('0x2a')]['count'](_0x2ec0a9)[_0x1455('0x26')](function(_0x43dae5){_0x4f4752['count']=_0x43dae5;if(_0x5000bc[_0x1455('0x2e')][_0x1455('0x3e')]){_0x3cf118[_0x1455('0x3f')]=[{'all':!![]}];}return db[_0x1455('0x2a')][_0x1455('0x40')](_0x3cf118);})[_0x1455('0x26')](function(_0x5ecd30){_0x4f4752['rows']=_0x5ecd30;return _0x4f4752;})[_0x1455('0x26')](respondWithFilteredResult(_0x4a7a3e,_0x3cf118))['catch'](handleError(_0x4a7a3e,null));};exports[_0x1455('0x41')]=function(_0x363856,_0x2accc7){var _0x16f9a3={'raw':![],'where':{'id':_0x363856[_0x1455('0x42')]['id']}},_0x2da102={};_0x2da102[_0x1455('0x2d')]=_['keys'](db[_0x1455('0x2a')][_0x1455('0x2b')]);_0x2da102['query']=_[_0x1455('0x2f')](_0x363856['query']);_0x2da102[_0x1455('0x30')]=_[_0x1455('0x31')](_0x2da102[_0x1455('0x2d')],_0x2da102[_0x1455('0x2e')]);_0x16f9a3[_0x1455('0x32')]=_[_0x1455('0x31')](_0x2da102[_0x1455('0x2d')],qs[_0x1455('0x33')](_0x363856[_0x1455('0x2e')][_0x1455('0x33')]));_0x16f9a3[_0x1455('0x32')]=_0x16f9a3[_0x1455('0x32')][_0x1455('0x34')]?_0x16f9a3[_0x1455('0x32')]:_0x2da102[_0x1455('0x2d')];if(_0x363856[_0x1455('0x2e')][_0x1455('0x3e')]){_0x16f9a3['include']=[{'all':!![]}];}_0x16f9a3=_[_0x1455('0x3c')]({},_0x16f9a3,_0x363856['options']);return db['FreshsalesConfiguration'][_0x1455('0x43')](_0x16f9a3)[_0x1455('0x26')](handleEntityNotFound(_0x2accc7,null))[_0x1455('0x26')](respondWithResult(_0x2accc7,null))[_0x1455('0x44')](handleError(_0x2accc7,null));};exports[_0x1455('0x45')]=function(_0x3badf7,_0x1930ff){return db[_0x1455('0x2a')]['create'](_0x3badf7[_0x1455('0x46')],{})['then'](respondWithResult(_0x1930ff,0xc9))[_0x1455('0x44')](handleError(_0x1930ff,null));};exports[_0x1455('0x25')]=function(_0x195913,_0x261063){if(_0x195913['body']['id']){delete _0x195913[_0x1455('0x46')]['id'];}return db[_0x1455('0x2a')][_0x1455('0x43')]({'where':{'id':_0x195913['params']['id']}})[_0x1455('0x26')](handleEntityNotFound(_0x261063,null))['then'](saveUpdates(_0x195913['body'],null))['then'](respondWithResult(_0x261063,null))['catch'](handleError(_0x261063,null));};exports[_0x1455('0x47')]=function(_0xe05ac4,_0x27fae5){return db[_0x1455('0x2a')][_0x1455('0x43')]({'where':{'id':_0xe05ac4[_0x1455('0x42')]['id']}})[_0x1455('0x26')](handleEntityNotFound(_0x27fae5,null))[_0x1455('0x26')](removeEntity(_0x27fae5,null))[_0x1455('0x44')](handleError(_0x27fae5,null));};exports['getSubjects']=function(_0x138168,_0x1207f7,_0x25f227){var _0x53f9b9={};var _0x1283e0={};var _0x28680a;var _0x23cc94;return db['FreshsalesConfiguration'][_0x1455('0x48')]({'where':{'id':_0x138168[_0x1455('0x42')]['id']}})[_0x1455('0x26')](handleEntityNotFound(_0x1207f7,null))['then'](function(_0x3fe191){if(_0x3fe191){_0x28680a=_0x3fe191;_0x1283e0[_0x1455('0x2d')]=_['keys'](db[_0x1455('0x49')][_0x1455('0x2b')]);_0x1283e0['query']=_[_0x1455('0x2f')](_0x138168[_0x1455('0x2e')]);_0x1283e0[_0x1455('0x30')]=_[_0x1455('0x31')](_0x1283e0[_0x1455('0x2d')],_0x1283e0[_0x1455('0x2e')]);_0x53f9b9['attributes']=_[_0x1455('0x31')](_0x1283e0[_0x1455('0x2d')],qs['fields'](_0x138168[_0x1455('0x2e')][_0x1455('0x33')]));_0x53f9b9[_0x1455('0x32')]=_0x53f9b9[_0x1455('0x32')]['length']?_0x53f9b9[_0x1455('0x32')]:_0x1283e0[_0x1455('0x2d')];_0x53f9b9[_0x1455('0x4a')]=qs[_0x1455('0x37')](_0x138168[_0x1455('0x2e')][_0x1455('0x37')]);_0x53f9b9[_0x1455('0x38')]=qs[_0x1455('0x30')](_[_0x1455('0x39')](_0x138168[_0x1455('0x2e')],_0x1283e0[_0x1455('0x30')]));if(_0x138168[_0x1455('0x2e')][_0x1455('0x3a')]){_0x53f9b9[_0x1455('0x38')]=_[_0x1455('0x3c')](_0x53f9b9['where'],{'$or':_[_0x1455('0x29')](_0x53f9b9[_0x1455('0x32')],function(_0x46df03){var _0x2cd608={};_0x2cd608[_0x46df03]={'$like':'%'+_0x138168[_0x1455('0x2e')][_0x1455('0x3a')]+'%'};return _0x2cd608;})});}_0x53f9b9=_[_0x1455('0x3c')]({},_0x53f9b9,_0x138168['options']);return _0x28680a['getSubjects'](_0x53f9b9);}})[_0x1455('0x26')](function(_0x2ebc7d){if(_0x2ebc7d){_0x23cc94=_0x2ebc7d[_0x1455('0x34')];if(!_0x138168[_0x1455('0x2e')][_0x1455('0x35')]('nolimit')){_0x53f9b9['limit']=qs[_0x1455('0x20')](_0x138168[_0x1455('0x2e')][_0x1455('0x20')]);_0x53f9b9[_0x1455('0x1d')]=qs[_0x1455('0x1d')](_0x138168[_0x1455('0x2e')][_0x1455('0x1d')]);}return _0x28680a['getSubjects'](_0x53f9b9);}})[_0x1455('0x26')](function(_0x187ee7){if(_0x187ee7){return _0x187ee7?{'count':_0x23cc94,'rows':_0x187ee7}:null;}})[_0x1455('0x26')](respondWithResult(_0x1207f7,null))[_0x1455('0x44')](handleError(_0x1207f7,null));};exports['getDescriptions']=function(_0x2a973b,_0x172ba7,_0x21b3ce){var _0x588b2f={};var _0x420880={};var _0x1711e1;var _0x18c302;return db[_0x1455('0x2a')][_0x1455('0x48')]({'where':{'id':_0x2a973b[_0x1455('0x42')]['id']}})[_0x1455('0x26')](handleEntityNotFound(_0x172ba7,null))['then'](function(_0x51320e){if(_0x51320e){_0x1711e1=_0x51320e;_0x420880['model']=_['keys'](db[_0x1455('0x49')][_0x1455('0x2b')]);_0x420880[_0x1455('0x2e')]=_[_0x1455('0x2f')](_0x2a973b['query']);_0x420880[_0x1455('0x30')]=_[_0x1455('0x31')](_0x420880[_0x1455('0x2d')],_0x420880[_0x1455('0x2e')]);_0x588b2f[_0x1455('0x32')]=_['intersection'](_0x420880['model'],qs[_0x1455('0x33')](_0x2a973b[_0x1455('0x2e')]['fields']));_0x588b2f[_0x1455('0x32')]=_0x588b2f[_0x1455('0x32')][_0x1455('0x34')]?_0x588b2f[_0x1455('0x32')]:_0x420880[_0x1455('0x2d')];_0x588b2f[_0x1455('0x4a')]=qs[_0x1455('0x37')](_0x2a973b[_0x1455('0x2e')]['sort']);_0x588b2f[_0x1455('0x38')]=qs[_0x1455('0x30')](_[_0x1455('0x39')](_0x2a973b['query'],_0x420880[_0x1455('0x30')]));if(_0x2a973b[_0x1455('0x2e')]['filter']){_0x588b2f['where']=_[_0x1455('0x3c')](_0x588b2f['where'],{'$or':_['map'](_0x588b2f[_0x1455('0x32')],function(_0x2ff46a){var _0x4c62dd={};_0x4c62dd[_0x2ff46a]={'$like':'%'+_0x2a973b[_0x1455('0x2e')]['filter']+'%'};return _0x4c62dd;})});}_0x588b2f=_[_0x1455('0x3c')]({},_0x588b2f,_0x2a973b[_0x1455('0x3d')]);return _0x1711e1[_0x1455('0x4b')](_0x588b2f);}})['then'](function(_0xab2cf6){if(_0xab2cf6){_0x18c302=_0xab2cf6[_0x1455('0x34')];if(!_0x2a973b[_0x1455('0x2e')][_0x1455('0x35')]('nolimit')){_0x588b2f['limit']=qs[_0x1455('0x20')](_0x2a973b['query'][_0x1455('0x20')]);_0x588b2f['offset']=qs[_0x1455('0x1d')](_0x2a973b['query'][_0x1455('0x1d')]);}return _0x1711e1[_0x1455('0x4b')](_0x588b2f);}})[_0x1455('0x26')](function(_0xd9ef57){if(_0xd9ef57){return _0xd9ef57?{'count':_0x18c302,'rows':_0xd9ef57}:null;}})[_0x1455('0x26')](respondWithResult(_0x172ba7,null))[_0x1455('0x44')](handleError(_0x172ba7,null));};exports[_0x1455('0x4c')]=function(_0x18b5b1,_0x2def3d,_0x2eb65f){var _0x18e6dd={};var _0x396f58={};var _0x30995d;var _0x1ada4d;return db[_0x1455('0x2a')][_0x1455('0x48')]({'where':{'id':_0x18b5b1[_0x1455('0x42')]['id']}})['then'](handleEntityNotFound(_0x2def3d,null))['then'](function(_0x378416){if(_0x378416){_0x30995d=_0x378416;_0x396f58['model']=_[_0x1455('0x2f')](db[_0x1455('0x49')][_0x1455('0x2b')]);_0x396f58['query']=_[_0x1455('0x2f')](_0x18b5b1[_0x1455('0x2e')]);_0x396f58[_0x1455('0x30')]=_['intersection'](_0x396f58[_0x1455('0x2d')],_0x396f58[_0x1455('0x2e')]);_0x18e6dd['attributes']=_['intersection'](_0x396f58[_0x1455('0x2d')],qs[_0x1455('0x33')](_0x18b5b1[_0x1455('0x2e')][_0x1455('0x33')]));_0x18e6dd[_0x1455('0x32')]=_0x18e6dd['attributes'][_0x1455('0x34')]?_0x18e6dd[_0x1455('0x32')]:_0x396f58[_0x1455('0x2d')];_0x18e6dd[_0x1455('0x4a')]=qs[_0x1455('0x37')](_0x18b5b1['query'][_0x1455('0x37')]);_0x18e6dd[_0x1455('0x38')]=qs[_0x1455('0x30')](_[_0x1455('0x39')](_0x18b5b1['query'],_0x396f58['filters']));if(_0x18b5b1[_0x1455('0x2e')][_0x1455('0x3a')]){_0x18e6dd[_0x1455('0x38')]=_[_0x1455('0x3c')](_0x18e6dd['where'],{'$or':_[_0x1455('0x29')](_0x18e6dd[_0x1455('0x32')],function(_0x33b0e7){var _0x4bc078={};_0x4bc078[_0x33b0e7]={'$like':'%'+_0x18b5b1[_0x1455('0x2e')]['filter']+'%'};return _0x4bc078;})});}_0x18e6dd=_[_0x1455('0x3c')]({},_0x18e6dd,_0x18b5b1['options']);return _0x30995d[_0x1455('0x4c')](_0x18e6dd);}})[_0x1455('0x26')](function(_0x5cc317){if(_0x5cc317){_0x1ada4d=_0x5cc317[_0x1455('0x34')];if(!_0x18b5b1[_0x1455('0x2e')][_0x1455('0x35')]('nolimit')){_0x18e6dd['limit']=qs[_0x1455('0x20')](_0x18b5b1[_0x1455('0x2e')][_0x1455('0x20')]);_0x18e6dd['offset']=qs['offset'](_0x18b5b1[_0x1455('0x2e')]['offset']);}return _0x30995d[_0x1455('0x4c')](_0x18e6dd);}})[_0x1455('0x26')](function(_0x5d1307){if(_0x5d1307){return _0x5d1307?{'count':_0x1ada4d,'rows':_0x5d1307}:null;}})[_0x1455('0x26')](respondWithResult(_0x2def3d,null))[_0x1455('0x44')](handleError(_0x2def3d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 364401a..e0bb757 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 _0xa0da=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesConfiguration','lodash','util'];(function(_0x51b2f7,_0x2d8a4c){var _0x2adba6=function(_0x4a811b){while(--_0x4a811b){_0x51b2f7['push'](_0x51b2f7['shift']());}};_0x2adba6(++_0x2d8a4c);}(_0xa0da,0x6a));var _0xaa0d=function(_0x118d1f,_0x2a417e){_0x118d1f=_0x118d1f-0x0;var _0x3088e8=_0xa0da[_0x118d1f];return _0x3088e8;};'use strict';var _=require(_0xaa0d('0x0'));var util=require(_0xaa0d('0x1'));var logger=require(_0xaa0d('0x2'))(_0xaa0d('0x3'));var moment=require(_0xaa0d('0x4'));var BPromise=require(_0xaa0d('0x5'));var rp=require(_0xaa0d('0x6'));var fs=require('fs');var path=require(_0xaa0d('0x7'));var rimraf=require(_0xaa0d('0x8'));var config=require(_0xaa0d('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xaa0d('0xa')]=function(_0x69d058,_0x4ae9c1){return _0x69d058['define'](_0xaa0d('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72e7=['define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x45e505,_0x1bf5b3){var _0x52001f=function(_0x12114b){while(--_0x12114b){_0x45e505['push'](_0x45e505['shift']());}};_0x52001f(++_0x1bf5b3);}(_0x72e7,0x1e3));var _0x772e=function(_0x4b5c65,_0x391efa){_0x4b5c65=_0x4b5c65-0x0;var _0x1e79b5=_0x72e7[_0x4b5c65];return _0x1e79b5;};'use strict';var _=require(_0x772e('0x0'));var util=require(_0x772e('0x1'));var logger=require(_0x772e('0x2'))(_0x772e('0x3'));var moment=require(_0x772e('0x4'));var BPromise=require(_0x772e('0x5'));var rp=require(_0x772e('0x6'));var fs=require('fs');var path=require(_0x772e('0x7'));var rimraf=require(_0x772e('0x8'));var config=require(_0x772e('0x9'));var attributes=require(_0x772e('0xa'));module[_0x772e('0xb')]=function(_0x25452e,_0x5b6b00){return _0x25452e[_0x772e('0xc')](_0x772e('0xd'),attributes,{'tableName':_0x772e('0xe'),'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 9833128..88df399 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 _0xfb68=['rpc','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xfb68,0x162));var _0x8fb6=function(_0x53289c,_0x58f9e2){_0x53289c=_0x53289c-0x0;var _0x5c63dc=_0xfb68[_0x53289c];return _0x5c63dc;};'use strict';var _=require(_0x8fb6('0x0'));var util=require(_0x8fb6('0x1'));var moment=require(_0x8fb6('0x2'));var BPromise=require(_0x8fb6('0x3'));var rs=require(_0x8fb6('0x4'));var fs=require('fs');var Redis=require(_0x8fb6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8fb6('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8fb6('0x7')][_0x8fb6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2df601,_0xcd5fa8,_0x55e2c7){return new BPromise(function(_0x2850e7,_0x4580ab){return client[_0x8fb6('0x9')](_0x2df601,_0x55e2c7)['then'](function(_0x3b77e8){logger['info'](_0x8fb6('0xa'),_0xcd5fa8,_0x8fb6('0xb'));logger[_0x8fb6('0xc')](_0x8fb6('0xd'),_0xcd5fa8,_0x8fb6('0xb'),JSON['stringify'](_0x3b77e8));if(_0x3b77e8['error']){if(_0x3b77e8['error'][_0x8fb6('0xe')]===0x1f4){logger['error'](_0x8fb6('0xa'),_0xcd5fa8,_0x3b77e8['error']['message']);return _0x4580ab(_0x3b77e8[_0x8fb6('0xf')][_0x8fb6('0x10')]);}logger[_0x8fb6('0xf')](_0x8fb6('0xa'),_0xcd5fa8,_0x3b77e8[_0x8fb6('0xf')][_0x8fb6('0x10')]);return _0x2850e7(_0x3b77e8[_0x8fb6('0xf')][_0x8fb6('0x10')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0xcd5fa8,'request\x20sent');_0x2850e7(_0x3b77e8[_0x8fb6('0x11')][_0x8fb6('0x10')]);}})['catch'](function(_0x4ccd73){logger[_0x8fb6('0xf')](_0x8fb6('0xa'),_0xcd5fa8,_0x4ccd73);_0x4580ab(_0x4ccd73);});});} \ No newline at end of file +var _0xa43d=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x440593,_0x58be0f){var _0x28ba9a=function(_0x40a13c){while(--_0x40a13c){_0x440593['push'](_0x440593['shift']());}};_0x28ba9a(++_0x58be0f);}(_0xa43d,0x1da));var _0xda43=function(_0x59c233,_0xe0627e){_0x59c233=_0x59c233-0x0;var _0x26e0ef=_0xa43d[_0x59c233];return _0x26e0ef;};'use strict';var _=require(_0xda43('0x0'));var util=require(_0xda43('0x1'));var moment=require(_0xda43('0x2'));var BPromise=require(_0xda43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xda43('0x5'));var logger=require(_0xda43('0x6'))(_0xda43('0x7'));var config=require(_0xda43('0x8'));var jayson=require(_0xda43('0x9'));var client=jayson[_0xda43('0xa')][_0xda43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a4128,_0x2bd611,_0x4b969f){return new BPromise(function(_0x5af674,_0x42c1fa){return client[_0xda43('0xc')](_0x1a4128,_0x4b969f)[_0xda43('0xd')](function(_0x3a29dd){logger[_0xda43('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2bd611,'request\x20sent');logger[_0xda43('0xf')](_0xda43('0x10'),_0x2bd611,_0xda43('0x11'),JSON[_0xda43('0x12')](_0x3a29dd));if(_0x3a29dd[_0xda43('0x13')]){if(_0x3a29dd[_0xda43('0x13')][_0xda43('0x14')]===0x1f4){logger[_0xda43('0x13')](_0xda43('0x15'),_0x2bd611,_0x3a29dd['error'][_0xda43('0x16')]);return _0x42c1fa(_0x3a29dd[_0xda43('0x13')][_0xda43('0x16')]);}logger['error'](_0xda43('0x15'),_0x2bd611,_0x3a29dd[_0xda43('0x13')][_0xda43('0x16')]);return _0x5af674(_0x3a29dd[_0xda43('0x13')][_0xda43('0x16')]);}else{logger[_0xda43('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2bd611,'request\x20sent');_0x5af674(_0x3a29dd[_0xda43('0x17')][_0xda43('0x16')]);}})[_0xda43('0x18')](function(_0x557760){logger[_0xda43('0x13')](_0xda43('0x15'),_0x2bd611,_0x557760);_0x42c1fa(_0x557760);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 14ec8c4..a0db20f 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 _0x98b8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x28d2de,_0x1249c4){var _0x629adc=function(_0x630147){while(--_0x630147){_0x28d2de['push'](_0x28d2de['shift']());}};_0x629adc(++_0x1249c4);}(_0x98b8,0x93));var _0x898b=function(_0xae76fd,_0x88f18f){_0xae76fd=_0xae76fd-0x0;var _0x338282=_0x98b8[_0xae76fd];return _0x338282;};'use strict';var multer=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var path=require(_0x898b('0x2'));var timeout=require(_0x898b('0x3'));var express=require(_0x898b('0x4'));var router=express[_0x898b('0x5')]();var fs_extra=require(_0x898b('0x6'));var auth=require(_0x898b('0x7'));var interaction=require(_0x898b('0x8'));var config=require(_0x898b('0x9'));var controller=require(_0x898b('0xa'));router[_0x898b('0xb')]('/',auth[_0x898b('0xc')](),controller[_0x898b('0xd')]);router[_0x898b('0xb')]('/:id',auth[_0x898b('0xc')](),controller[_0x898b('0xe')]);router[_0x898b('0xf')]('/',auth[_0x898b('0xc')](),controller[_0x898b('0x10')]);router[_0x898b('0x11')](_0x898b('0x12'),auth[_0x898b('0xc')](),controller['update']);router[_0x898b('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x898b('0x14')]);module[_0x898b('0x15')]=router; \ No newline at end of file +var _0xf6fb=['isAuthenticated','index','/:id','show','create','put','destroy','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get'];(function(_0x12be89,_0x32459e){var _0x1d0b3d=function(_0x1f560b){while(--_0x1f560b){_0x12be89['push'](_0x12be89['shift']());}};_0x1d0b3d(++_0x32459e);}(_0xf6fb,0x111));var _0xbf6f=function(_0x1ac526,_0x28cb90){_0x1ac526=_0x1ac526-0x0;var _0xc34d87=_0xf6fb[_0x1ac526];return _0xc34d87;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf6f('0x0'));var timeout=require(_0xbf6f('0x1'));var express=require('express');var router=express[_0xbf6f('0x2')]();var fs_extra=require(_0xbf6f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbf6f('0x4'));var config=require('../../config/environment');var controller=require(_0xbf6f('0x5'));router[_0xbf6f('0x6')]('/',auth[_0xbf6f('0x7')](),controller[_0xbf6f('0x8')]);router[_0xbf6f('0x6')](_0xbf6f('0x9'),auth[_0xbf6f('0x7')](),controller[_0xbf6f('0xa')]);router['post']('/',auth[_0xbf6f('0x7')](),controller[_0xbf6f('0xb')]);router[_0xbf6f('0xc')](_0xbf6f('0x9'),auth[_0xbf6f('0x7')](),controller['update']);router['delete'](_0xbf6f('0x9'),auth[_0xbf6f('0x7')](),controller[_0xbf6f('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 9ff22b3..4ad8f93 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 _0x66fa=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x2c0d7b,_0x4ec918){var _0x3c769f=function(_0x13fb48){while(--_0x13fb48){_0x2c0d7b['push'](_0x2c0d7b['shift']());}};_0x3c769f(++_0x4ec918);}(_0x66fa,0x1e9));var _0xa66f=function(_0x355b46,_0xabb53e){_0x355b46=_0x355b46-0x0;var _0x247539=_0x66fa[_0x355b46];return _0x247539;};'use strict';var Sequelize=require(_0xa66f('0x0'));module['exports']={'type':{'type':Sequelize[_0xa66f('0x1')](_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa66f('0x7')]},'key':{'type':Sequelize[_0xa66f('0x7')]},'keyType':{'type':Sequelize[_0xa66f('0x1')](_0xa66f('0x2'),_0xa66f('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa66f('0x7')]},'idField':{'type':Sequelize[_0xa66f('0x7')]},'nameField':{'type':Sequelize[_0xa66f('0x7')]},'customField':{'type':Sequelize[_0xa66f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa66f('0x7')]}}; \ No newline at end of file +var _0x1933=['ENUM','variable','customVariable','keyValue','picklist','STRING','string'];(function(_0x3b0e0c,_0x5e4814){var _0x3efb86=function(_0x82a918){while(--_0x82a918){_0x3b0e0c['push'](_0x3b0e0c['shift']());}};_0x3efb86(++_0x5e4814);}(_0x1933,0x10a));var _0x3193=function(_0x3d32d6,_0x25c147){_0x3d32d6=_0x3d32d6-0x0;var _0x3db593=_0x1933[_0x3d32d6];return _0x3db593;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3193('0x0')]('string',_0x3193('0x1'),_0x3193('0x2'),_0x3193('0x3'),_0x3193('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3193('0x5')]},'key':{'type':Sequelize[_0x3193('0x5')]},'keyType':{'type':Sequelize[_0x3193('0x0')](_0x3193('0x6'),_0x3193('0x1'),_0x3193('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3193('0x5')]},'nameField':{'type':Sequelize[_0x3193('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 46550e5..110e088 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 _0xca53=['destroy','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','options','find','create','params','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x54d488,_0xff506f){var _0x1f04df=function(_0x3d68ea){while(--_0x3d68ea){_0x54d488['push'](_0x54d488['shift']());}};_0x1f04df(++_0xff506f);}(_0xca53,0xfb));var _0x3ca5=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0xca53[_0x15bbf1];return _0x5c4b47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ca5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ca5('0x1'));var rp=require(_0x3ca5('0x2'));var moment=require(_0x3ca5('0x3'));var BPromise=require(_0x3ca5('0x4'));var Mustache=require(_0x3ca5('0x5'));var util=require(_0x3ca5('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ca5('0x7'));var fs=require('fs');var fs_extra=require(_0x3ca5('0x8'));var _=require('lodash');var squel=require(_0x3ca5('0x9'));var crypto=require(_0x3ca5('0xa'));var jsforce=require(_0x3ca5('0xb'));var deskjs=require(_0x3ca5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3ca5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3ca5('0xe'));var qs=require(_0x3ca5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ca5('0x10'));var logger=require('../../config/logger')(_0x3ca5('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3ca5('0x12'))['db'];function respondWithStatusCode(_0x2215c2,_0x24779e){_0x24779e=_0x24779e||0xcc;return function(_0x20f611){if(_0x20f611){return _0x2215c2['sendStatus'](_0x24779e);}return _0x2215c2[_0x3ca5('0x13')](_0x24779e)[_0x3ca5('0x14')]();};}function respondWithResult(_0x5c1841,_0x16e444){_0x16e444=_0x16e444||0xc8;return function(_0x2d3933){if(_0x2d3933){return _0x5c1841[_0x3ca5('0x13')](_0x16e444)[_0x3ca5('0x15')](_0x2d3933);}};}function respondWithFilteredResult(_0x3111ce,_0x3d9282){return function(_0x331cad){if(_0x331cad){var _0x14f13e=typeof _0x3d9282['offset']==='undefined'&&typeof _0x3d9282['limit']===_0x3ca5('0x16');var _0x2b5f26=_0x331cad['count'];var _0x58ccbe=_0x14f13e?0x0:_0x3d9282[_0x3ca5('0x17')];var _0x350841=_0x14f13e?_0x331cad[_0x3ca5('0x18')]:_0x3d9282['offset']+_0x3d9282[_0x3ca5('0x19')];var _0x5367c7;if(_0x350841>=_0x2b5f26){_0x350841=_0x2b5f26;_0x5367c7=0xc8;}else{_0x5367c7=0xce;}_0x3111ce['status'](_0x5367c7);return _0x3111ce[_0x3ca5('0x1a')](_0x3ca5('0x1b'),_0x58ccbe+'-'+_0x350841+'/'+_0x2b5f26)['json'](_0x331cad);}return null;};}function patchUpdates(_0x4d578e){return function(_0x3be15b){try{jsonpatch[_0x3ca5('0x1c')](_0x3be15b,_0x4d578e,!![]);}catch(_0x3ef53d){return BPromise[_0x3ca5('0x1d')](_0x3ef53d);}return _0x3be15b[_0x3ca5('0x1e')]();};}function saveUpdates(_0x28ad51,_0x361934){return function(_0x235aba){if(_0x235aba){return _0x235aba[_0x3ca5('0x1f')](_0x28ad51)[_0x3ca5('0x20')](function(_0x9977a8){return _0x9977a8;});}return null;};}function removeEntity(_0x4a7968,_0x8124c6){return function(_0x2aefae){if(_0x2aefae){return _0x2aefae[_0x3ca5('0x21')]()['then'](function(){_0x4a7968[_0x3ca5('0x13')](0xcc)[_0x3ca5('0x14')]();});}};}function handleEntityNotFound(_0x329753,_0x33ba45){return function(_0x494b90){if(!_0x494b90){_0x329753[_0x3ca5('0x22')](0x194);}return _0x494b90;};}function handleError(_0x5a4f16,_0x37ecb0){_0x37ecb0=_0x37ecb0||0x1f4;return function(_0x308cd9){logger[_0x3ca5('0x23')](_0x308cd9[_0x3ca5('0x24')]);if(_0x308cd9[_0x3ca5('0x25')]){delete _0x308cd9[_0x3ca5('0x25')];}_0x5a4f16[_0x3ca5('0x13')](_0x37ecb0)[_0x3ca5('0x26')](_0x308cd9);};}exports[_0x3ca5('0x27')]=function(_0x4ba5,_0x1d65fe){var _0x57a1f9={},_0x383ba5={},_0x3ded3d={'count':0x0,'rows':[]};var _0x17a122=_[_0x3ca5('0x28')](db[_0x3ca5('0x29')][_0x3ca5('0x2a')],function(_0x81ef87){return{'name':_0x81ef87[_0x3ca5('0x2b')],'type':_0x81ef87['type'][_0x3ca5('0x2c')]};});_0x383ba5[_0x3ca5('0x2d')]=_['map'](_0x17a122,'name');_0x383ba5[_0x3ca5('0x2e')]=_[_0x3ca5('0x2f')](_0x4ba5[_0x3ca5('0x2e')]);_0x383ba5[_0x3ca5('0x30')]=_[_0x3ca5('0x31')](_0x383ba5[_0x3ca5('0x2d')],_0x383ba5[_0x3ca5('0x2e')]);_0x57a1f9[_0x3ca5('0x32')]=_['intersection'](_0x383ba5[_0x3ca5('0x2d')],qs['fields'](_0x4ba5[_0x3ca5('0x2e')][_0x3ca5('0x33')]));_0x57a1f9[_0x3ca5('0x32')]=_0x57a1f9[_0x3ca5('0x32')][_0x3ca5('0x34')]?_0x57a1f9[_0x3ca5('0x32')]:_0x383ba5[_0x3ca5('0x2d')];if(!_0x4ba5['query']['hasOwnProperty']('nolimit')){_0x57a1f9[_0x3ca5('0x19')]=qs[_0x3ca5('0x19')](_0x4ba5[_0x3ca5('0x2e')][_0x3ca5('0x19')]);_0x57a1f9['offset']=qs[_0x3ca5('0x17')](_0x4ba5[_0x3ca5('0x2e')][_0x3ca5('0x17')]);}_0x57a1f9[_0x3ca5('0x35')]=qs[_0x3ca5('0x36')](_0x4ba5[_0x3ca5('0x2e')][_0x3ca5('0x36')]);_0x57a1f9[_0x3ca5('0x37')]=qs[_0x3ca5('0x30')](_[_0x3ca5('0x38')](_0x4ba5[_0x3ca5('0x2e')],_0x383ba5['filters']),_0x17a122);if(_0x4ba5[_0x3ca5('0x2e')]['filter']){_0x57a1f9[_0x3ca5('0x37')]=_[_0x3ca5('0x39')](_0x57a1f9['where'],{'$or':_['map'](_0x17a122,function(_0x522bf9){if(_0x522bf9[_0x3ca5('0x3a')]!==_0x3ca5('0x3b')){var _0x33bfef={};_0x33bfef[_0x522bf9[_0x3ca5('0x25')]]={'$like':'%'+_0x4ba5[_0x3ca5('0x2e')][_0x3ca5('0x3c')]+'%'};return _0x33bfef;}})});}_0x57a1f9=_[_0x3ca5('0x39')]({},_0x57a1f9,_0x4ba5['options']);var _0x536fe3={'where':_0x57a1f9[_0x3ca5('0x37')]};return db[_0x3ca5('0x29')]['count'](_0x536fe3)['then'](function(_0x47a87d){_0x3ded3d['count']=_0x47a87d;if(_0x4ba5[_0x3ca5('0x2e')][_0x3ca5('0x3d')]){_0x57a1f9[_0x3ca5('0x3e')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x57a1f9);})['then'](function(_0x2f7717){_0x3ded3d[_0x3ca5('0x3f')]=_0x2f7717;return _0x3ded3d;})[_0x3ca5('0x20')](respondWithFilteredResult(_0x1d65fe,_0x57a1f9))[_0x3ca5('0x40')](handleError(_0x1d65fe,null));};exports[_0x3ca5('0x41')]=function(_0x13f2e9,_0x1abe68){var _0x55aac9={'raw':!![],'where':{'id':_0x13f2e9['params']['id']}},_0x5e2028={};_0x5e2028['model']=_[_0x3ca5('0x2f')](db[_0x3ca5('0x29')][_0x3ca5('0x2a')]);_0x5e2028[_0x3ca5('0x2e')]=_[_0x3ca5('0x2f')](_0x13f2e9[_0x3ca5('0x2e')]);_0x5e2028[_0x3ca5('0x30')]=_[_0x3ca5('0x31')](_0x5e2028['model'],_0x5e2028[_0x3ca5('0x2e')]);_0x55aac9['attributes']=_[_0x3ca5('0x31')](_0x5e2028[_0x3ca5('0x2d')],qs[_0x3ca5('0x33')](_0x13f2e9[_0x3ca5('0x2e')][_0x3ca5('0x33')]));_0x55aac9['attributes']=_0x55aac9[_0x3ca5('0x32')]['length']?_0x55aac9[_0x3ca5('0x32')]:_0x5e2028[_0x3ca5('0x2d')];if(_0x13f2e9['query'][_0x3ca5('0x3d')]){_0x55aac9[_0x3ca5('0x3e')]=[{'all':!![]}];}_0x55aac9=_[_0x3ca5('0x39')]({},_0x55aac9,_0x13f2e9[_0x3ca5('0x42')]);return db[_0x3ca5('0x29')][_0x3ca5('0x43')](_0x55aac9)['then'](handleEntityNotFound(_0x1abe68,null))['then'](respondWithResult(_0x1abe68,null))[_0x3ca5('0x40')](handleError(_0x1abe68,null));};exports[_0x3ca5('0x44')]=function(_0xdf73a0,_0x413f46){return db[_0x3ca5('0x29')][_0x3ca5('0x44')](_0xdf73a0['body'],{})[_0x3ca5('0x20')](respondWithResult(_0x413f46,0xc9))[_0x3ca5('0x40')](handleError(_0x413f46,null));};exports[_0x3ca5('0x1f')]=function(_0xcc7b11,_0x84d798){if(_0xcc7b11['body']['id']){delete _0xcc7b11['body']['id'];}return db[_0x3ca5('0x29')][_0x3ca5('0x43')]({'where':{'id':_0xcc7b11[_0x3ca5('0x45')]['id']}})[_0x3ca5('0x20')](handleEntityNotFound(_0x84d798,null))['then'](saveUpdates(_0xcc7b11[_0x3ca5('0x46')],null))[_0x3ca5('0x20')](respondWithResult(_0x84d798,null))['catch'](handleError(_0x84d798,null));};exports[_0x3ca5('0x21')]=function(_0x3bd22e,_0x490c31){return db['FreshsalesField'][_0x3ca5('0x43')]({'where':{'id':_0x3bd22e[_0x3ca5('0x45')]['id']}})[_0x3ca5('0x20')](handleEntityNotFound(_0x490c31,null))[_0x3ca5('0x20')](removeEntity(_0x490c31,null))['catch'](handleError(_0x490c31,null));}; \ No newline at end of file +var _0x65d3=['moment','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','limit','order','sort','where','filter','merge','VIRTUAL','options','FreshsalesField','count','include','findAll','rows','catch','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x37ee6b,_0x33a85f){var _0x4061e1=function(_0x239a3e){while(--_0x239a3e){_0x37ee6b['push'](_0x37ee6b['shift']());}};_0x4061e1(++_0x33a85f);}(_0x65d3,0x1b1));var _0x365d=function(_0x424a30,_0x4c71e3){_0x424a30=_0x424a30-0x0;var _0x31cc90=_0x65d3[_0x424a30];return _0x31cc90;};'use strict';var emlformat=require(_0x365d('0x0'));var rimraf=require(_0x365d('0x1'));var zipdir=require(_0x365d('0x2'));var jsonpatch=require(_0x365d('0x3'));var rp=require(_0x365d('0x4'));var moment=require(_0x365d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x365d('0x6'));var sox=require(_0x365d('0x7'));var csv=require(_0x365d('0x8'));var ejs=require(_0x365d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x365d('0xa'));var squel=require(_0x365d('0xb'));var crypto=require(_0x365d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x365d('0xd'));var toCsv=require(_0x365d('0x8'));var querystring=require(_0x365d('0xe'));var Papa=require(_0x365d('0xf'));var Redis=require(_0x365d('0x10'));var authService=require(_0x365d('0x11'));var qs=require(_0x365d('0x12'));var as=require(_0x365d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x365d('0x14'))(_0x365d('0x15'));var utils=require(_0x365d('0x16'));var config=require(_0x365d('0x17'));var licenseUtil=require(_0x365d('0x18'));var db=require(_0x365d('0x19'))['db'];function respondWithStatusCode(_0x3de863,_0x5e79a1){_0x5e79a1=_0x5e79a1||0xcc;return function(_0x5170b6){if(_0x5170b6){return _0x3de863[_0x365d('0x1a')](_0x5e79a1);}return _0x3de863[_0x365d('0x1b')](_0x5e79a1)[_0x365d('0x1c')]();};}function respondWithResult(_0x54f02d,_0x3951b4){_0x3951b4=_0x3951b4||0xc8;return function(_0x2718bb){if(_0x2718bb){return _0x54f02d['status'](_0x3951b4)[_0x365d('0x1d')](_0x2718bb);}};}function respondWithFilteredResult(_0x2403cf,_0x3a355a){return function(_0x2112c7){if(_0x2112c7){var _0x5b4f30=typeof _0x3a355a['offset']===_0x365d('0x1e')&&typeof _0x3a355a['limit']===_0x365d('0x1e');var _0x40c698=_0x2112c7['count'];var _0x11d8fd=_0x5b4f30?0x0:_0x3a355a[_0x365d('0x1f')];var _0x497876=_0x5b4f30?_0x2112c7['count']:_0x3a355a[_0x365d('0x1f')]+_0x3a355a['limit'];var _0x503512;if(_0x497876>=_0x40c698){_0x497876=_0x40c698;_0x503512=0xc8;}else{_0x503512=0xce;}_0x2403cf[_0x365d('0x1b')](_0x503512);return _0x2403cf['set'](_0x365d('0x20'),_0x11d8fd+'-'+_0x497876+'/'+_0x40c698)['json'](_0x2112c7);}return null;};}function patchUpdates(_0x137d6e){return function(_0x1351a6){try{jsonpatch[_0x365d('0x21')](_0x1351a6,_0x137d6e,!![]);}catch(_0x5197ae){return BPromise[_0x365d('0x22')](_0x5197ae);}return _0x1351a6[_0x365d('0x23')]();};}function saveUpdates(_0x3e9e2c,_0xf1f68c){return function(_0x1895b6){if(_0x1895b6){return _0x1895b6[_0x365d('0x24')](_0x3e9e2c)['then'](function(_0x5c55cd){return _0x5c55cd;});}return null;};}function removeEntity(_0x52dd21,_0x53e027){return function(_0x365fda){if(_0x365fda){return _0x365fda[_0x365d('0x25')]()[_0x365d('0x26')](function(){_0x52dd21[_0x365d('0x1b')](0xcc)[_0x365d('0x1c')]();});}};}function handleEntityNotFound(_0x5caef2,_0x421bed){return function(_0x1a6007){if(!_0x1a6007){_0x5caef2[_0x365d('0x1a')](0x194);}return _0x1a6007;};}function handleError(_0x29e517,_0x1fcd78){_0x1fcd78=_0x1fcd78||0x1f4;return function(_0x1cd077){logger[_0x365d('0x27')](_0x1cd077['stack']);if(_0x1cd077[_0x365d('0x28')]){delete _0x1cd077[_0x365d('0x28')];}_0x29e517[_0x365d('0x1b')](_0x1fcd78)['send'](_0x1cd077);};}exports[_0x365d('0x29')]=function(_0x224df0,_0x3b3ae4){var _0x4ae522={},_0xdbf1cb={},_0x2d29d8={'count':0x0,'rows':[]};var _0x4b92d4=_[_0x365d('0x2a')](db['FreshsalesField'][_0x365d('0x2b')],function(_0x2f525f){return{'name':_0x2f525f['fieldName'],'type':_0x2f525f[_0x365d('0x2c')][_0x365d('0x2d')]};});_0xdbf1cb[_0x365d('0x2e')]=_['map'](_0x4b92d4,_0x365d('0x28'));_0xdbf1cb['query']=_[_0x365d('0x2f')](_0x224df0[_0x365d('0x30')]);_0xdbf1cb[_0x365d('0x31')]=_[_0x365d('0x32')](_0xdbf1cb[_0x365d('0x2e')],_0xdbf1cb[_0x365d('0x30')]);_0x4ae522[_0x365d('0x33')]=_['intersection'](_0xdbf1cb[_0x365d('0x2e')],qs[_0x365d('0x34')](_0x224df0[_0x365d('0x30')][_0x365d('0x34')]));_0x4ae522[_0x365d('0x33')]=_0x4ae522[_0x365d('0x33')]['length']?_0x4ae522[_0x365d('0x33')]:_0xdbf1cb[_0x365d('0x2e')];if(!_0x224df0[_0x365d('0x30')]['hasOwnProperty']('nolimit')){_0x4ae522[_0x365d('0x35')]=qs[_0x365d('0x35')](_0x224df0[_0x365d('0x30')]['limit']);_0x4ae522['offset']=qs[_0x365d('0x1f')](_0x224df0['query'][_0x365d('0x1f')]);}_0x4ae522[_0x365d('0x36')]=qs[_0x365d('0x37')](_0x224df0[_0x365d('0x30')][_0x365d('0x37')]);_0x4ae522[_0x365d('0x38')]=qs[_0x365d('0x31')](_['pick'](_0x224df0[_0x365d('0x30')],_0xdbf1cb[_0x365d('0x31')]),_0x4b92d4);if(_0x224df0[_0x365d('0x30')][_0x365d('0x39')]){_0x4ae522[_0x365d('0x38')]=_[_0x365d('0x3a')](_0x4ae522['where'],{'$or':_['map'](_0x4b92d4,function(_0x3fdbb0){if(_0x3fdbb0[_0x365d('0x2c')]!==_0x365d('0x3b')){var _0x275880={};_0x275880[_0x3fdbb0['name']]={'$like':'%'+_0x224df0[_0x365d('0x30')][_0x365d('0x39')]+'%'};return _0x275880;}})});}_0x4ae522=_[_0x365d('0x3a')]({},_0x4ae522,_0x224df0[_0x365d('0x3c')]);var _0x5c391d={'where':_0x4ae522[_0x365d('0x38')]};return db[_0x365d('0x3d')][_0x365d('0x3e')](_0x5c391d)['then'](function(_0x55ed4c){_0x2d29d8[_0x365d('0x3e')]=_0x55ed4c;if(_0x224df0['query']['includeAll']){_0x4ae522[_0x365d('0x3f')]=[{'all':!![]}];}return db[_0x365d('0x3d')][_0x365d('0x40')](_0x4ae522);})['then'](function(_0x9c82bb){_0x2d29d8[_0x365d('0x41')]=_0x9c82bb;return _0x2d29d8;})[_0x365d('0x26')](respondWithFilteredResult(_0x3b3ae4,_0x4ae522))[_0x365d('0x42')](handleError(_0x3b3ae4,null));};exports['show']=function(_0x3bd2c5,_0x182869){var _0x488678={'raw':!![],'where':{'id':_0x3bd2c5[_0x365d('0x43')]['id']}},_0x4eb416={};_0x4eb416['model']=_['keys'](db['FreshsalesField'][_0x365d('0x2b')]);_0x4eb416[_0x365d('0x30')]=_[_0x365d('0x2f')](_0x3bd2c5[_0x365d('0x30')]);_0x4eb416[_0x365d('0x31')]=_[_0x365d('0x32')](_0x4eb416['model'],_0x4eb416[_0x365d('0x30')]);_0x488678[_0x365d('0x33')]=_[_0x365d('0x32')](_0x4eb416[_0x365d('0x2e')],qs[_0x365d('0x34')](_0x3bd2c5[_0x365d('0x30')][_0x365d('0x34')]));_0x488678[_0x365d('0x33')]=_0x488678[_0x365d('0x33')][_0x365d('0x44')]?_0x488678[_0x365d('0x33')]:_0x4eb416[_0x365d('0x2e')];if(_0x3bd2c5[_0x365d('0x30')][_0x365d('0x45')]){_0x488678['include']=[{'all':!![]}];}_0x488678=_[_0x365d('0x3a')]({},_0x488678,_0x3bd2c5[_0x365d('0x3c')]);return db[_0x365d('0x3d')][_0x365d('0x46')](_0x488678)[_0x365d('0x26')](handleEntityNotFound(_0x182869,null))[_0x365d('0x26')](respondWithResult(_0x182869,null))['catch'](handleError(_0x182869,null));};exports[_0x365d('0x47')]=function(_0x2b97b3,_0xcf3789){return db[_0x365d('0x3d')]['create'](_0x2b97b3[_0x365d('0x48')],{})[_0x365d('0x26')](respondWithResult(_0xcf3789,0xc9))[_0x365d('0x42')](handleError(_0xcf3789,null));};exports[_0x365d('0x24')]=function(_0x5926fb,_0x21ec1a){if(_0x5926fb[_0x365d('0x48')]['id']){delete _0x5926fb['body']['id'];}return db[_0x365d('0x3d')][_0x365d('0x46')]({'where':{'id':_0x5926fb[_0x365d('0x43')]['id']}})[_0x365d('0x26')](handleEntityNotFound(_0x21ec1a,null))[_0x365d('0x26')](saveUpdates(_0x5926fb[_0x365d('0x48')],null))[_0x365d('0x26')](respondWithResult(_0x21ec1a,null))['catch'](handleError(_0x21ec1a,null));};exports[_0x365d('0x25')]=function(_0x70b60c,_0x165676){return db[_0x365d('0x3d')][_0x365d('0x46')]({'where':{'id':_0x70b60c[_0x365d('0x43')]['id']}})['then'](handleEntityNotFound(_0x165676,null))[_0x365d('0x26')](removeEntity(_0x165676,null))['catch'](handleError(_0x165676,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 0a53980..448b6f2 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 _0x6bab=['exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0x6bab[_0x354164];return _0x5db9a8;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var logger=require(_0xb6ba('0x2'))(_0xb6ba('0x3'));var moment=require('moment');var BPromise=require(_0xb6ba('0x4'));var rp=require(_0xb6ba('0x5'));var fs=require('fs');var path=require(_0xb6ba('0x6'));var rimraf=require(_0xb6ba('0x7'));var config=require(_0xb6ba('0x8'));var attributes=require('./intFreshsalesField.attributes');module[_0xb6ba('0x9')]=function(_0x5220a1,_0x176097){return _0x5220a1[_0xb6ba('0xa')](_0xb6ba('0xb'),attributes,{'tableName':_0xb6ba('0xc'),'paranoid':![],'indexes':[{'name':_0xb6ba('0xd'),'fields':[_0xb6ba('0xe'),_0xb6ba('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x23a3=['exports','FreshsalesField','int_freshsales_fields','idField','FieldId','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x174661,_0x4ea43a){var _0x53c5e9=function(_0x2bf9a){while(--_0x2bf9a){_0x174661['push'](_0x174661['shift']());}};_0x53c5e9(++_0x4ea43a);}(_0x23a3,0x131));var _0x323a=function(_0x34cbdb,_0xa53f6){_0x34cbdb=_0x34cbdb-0x0;var _0x2fc43d=_0x23a3[_0x34cbdb];return _0x2fc43d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x323a('0x0'));var moment=require('moment');var BPromise=require(_0x323a('0x1'));var rp=require(_0x323a('0x2'));var fs=require('fs');var path=require(_0x323a('0x3'));var rimraf=require(_0x323a('0x4'));var config=require(_0x323a('0x5'));var attributes=require(_0x323a('0x6'));module[_0x323a('0x7')]=function(_0x3c1648,_0x14a418){return _0x3c1648['define'](_0x323a('0x8'),attributes,{'tableName':_0x323a('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x323a('0xa'),_0x323a('0xb')],'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 ffbcecf..78678cb 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x524e,0x15e));var _0xe524=function(_0x1144df,_0x5bc2f1){_0x1144df=_0x1144df-0x0;var _0x1b3a56=_0x524e[_0x1144df];return _0x1b3a56;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0xbd51=['FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x61c914,_0x5f3a96){_0x61c914=_0x61c914-0x0;var _0x4e75cf=_0xbd51[_0x61c914];return _0x4e75cf;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){return client['request'](_0x29abea,_0x19077c)[_0x1bd5('0x8')](function(_0x5c8e0d){logger[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x30a385,_0x1bd5('0xb'));logger[_0x1bd5('0xc')](_0x1bd5('0xd'),_0x30a385,_0x1bd5('0xb'),JSON['stringify'](_0x5c8e0d));if(_0x5c8e0d[_0x1bd5('0xe')]){if(_0x5c8e0d['error'][_0x1bd5('0xf')]===0x1f4){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0xd8418f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0x27d58f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x1bd5('0xb'));_0x27d58f(_0x5c8e0d[_0x1bd5('0x11')][_0x1bd5('0x10')]);}})[_0x1bd5('0x12')](function(_0x43ea3e){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x43ea3e);_0xd8418f(_0x43ea3e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 32bf8ad..d2eb8ea 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(_0x2010b0,_0x58e9c9){var _0x2b9012=function(_0xce156c){while(--_0xce156c){_0x2010b0['push'](_0x2010b0['shift']());}};_0x2b9012(++_0x58e9c9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x41b164,_0x48d6f1){var _0x635742=function(_0x182dcc){while(--_0x182dcc){_0x41b164['push'](_0x41b164['shift']());}};_0x635742(++_0x48d6f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 4ea8a7a..9858aca 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 _0x3940=['STRING','username','integrationTab','newTab','sequelize','exports'];(function(_0xe7e2ed,_0x1d93a9){var _0x4f9eea=function(_0x2d0e0d){while(--_0x2d0e0d){_0xe7e2ed['push'](_0xe7e2ed['shift']());}};_0x4f9eea(++_0x1d93a9);}(_0x3940,0xa6));var _0x0394=function(_0x1ce8b6,_0x1fcec5){_0x1ce8b6=_0x1ce8b6-0x0;var _0x409ad1=_0x3940[_0x1ce8b6];return _0x409ad1;};'use strict';var Sequelize=require(_0x0394('0x0'));module[_0x0394('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0394('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x0394('0x3')},'remoteUri':{'type':Sequelize[_0x0394('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x0394('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x0394('0x2')]},'serverUrl':{'type':Sequelize[_0x0394('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0394('0x4'),_0x0394('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xc110=['newTab','sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x5bf79a,_0x2eaa1d){var _0x3ff10f=function(_0x48523){while(--_0x48523){_0x5bf79a['push'](_0x5bf79a['shift']());}};_0x3ff10f(++_0x2eaa1d);}(_0xc110,0x1c1));var _0x0c11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc110[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0c11('0x0'));module[_0x0c11('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c11('0x2')]},'username':{'type':Sequelize[_0x0c11('0x2')],'unique':_0x0c11('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0c11('0x2')]},'clientId':{'type':Sequelize[_0x0c11('0x2')]},'clientSecret':{'type':Sequelize[_0x0c11('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x0c11('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0c11('0x4')](_0x0c11('0x5'),_0x0c11('0x6')),'defaultValue':_0x0c11('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b4b3398..b7b30a2 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 _0xbae3=['body','destroy','getConfigurations','findOne','SalesforceConfiguration','length','sort','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SalesforceField','getFields','Task','clientId','clientSecret','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','login','password','isNil','sobject','describe','OwnerId','IsRecurrence','Description','string','int','picklist','boolean','textarea','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','SalesforceAccount','findAll','catch','show','params','find'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0xbae3,0x1b2));var _0x3bae=function(_0x259bec,_0x5b1b58){_0x259bec=_0x259bec-0x0;var _0x4f5703=_0xbae3[_0x259bec];return _0x4f5703;};'use strict';var emlformat=require(_0x3bae('0x0'));var rimraf=require(_0x3bae('0x1'));var zipdir=require(_0x3bae('0x2'));var jsonpatch=require(_0x3bae('0x3'));var rp=require(_0x3bae('0x4'));var moment=require(_0x3bae('0x5'));var BPromise=require(_0x3bae('0x6'));var Mustache=require(_0x3bae('0x7'));var util=require(_0x3bae('0x8'));var path=require(_0x3bae('0x9'));var sox=require(_0x3bae('0xa'));var csv=require(_0x3bae('0xb'));var ejs=require(_0x3bae('0xc'));var fs=require('fs');var fs_extra=require(_0x3bae('0xd'));var _=require(_0x3bae('0xe'));var squel=require(_0x3bae('0xf'));var crypto=require('crypto');var jsforce=require(_0x3bae('0x10'));var deskjs=require(_0x3bae('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3bae('0x12'));var Papa=require(_0x3bae('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3bae('0x14'));var as=require(_0x3bae('0x15'));var hardwareService=require(_0x3bae('0x16'));var logger=require(_0x3bae('0x17'))(_0x3bae('0x18'));var utils=require(_0x3bae('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3bae('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3bae('0x1b'));function respondWithStatusCode(_0x3cf0f2,_0x56581){_0x56581=_0x56581||0xcc;return function(_0xca8ccc){if(_0xca8ccc){return _0x3cf0f2[_0x3bae('0x1c')](_0x56581);}return _0x3cf0f2[_0x3bae('0x1d')](_0x56581)['end']();};}function respondWithResult(_0x258d0b,_0x7e260d){_0x7e260d=_0x7e260d||0xc8;return function(_0x3c4167){if(_0x3c4167){return _0x258d0b['status'](_0x7e260d)['json'](_0x3c4167);}};}function respondWithFilteredResult(_0x13a741,_0x2ef4d5){return function(_0x1b6a08){if(_0x1b6a08){var _0x151195=typeof _0x2ef4d5[_0x3bae('0x1e')]===_0x3bae('0x1f')&&typeof _0x2ef4d5[_0x3bae('0x20')]===_0x3bae('0x1f');var _0x53ef7b=_0x1b6a08[_0x3bae('0x21')];var _0x3dca75=_0x151195?0x0:_0x2ef4d5[_0x3bae('0x1e')];var _0x12e6c5=_0x151195?_0x1b6a08[_0x3bae('0x21')]:_0x2ef4d5[_0x3bae('0x1e')]+_0x2ef4d5[_0x3bae('0x20')];var _0x4b2c37;if(_0x12e6c5>=_0x53ef7b){_0x12e6c5=_0x53ef7b;_0x4b2c37=0xc8;}else{_0x4b2c37=0xce;}_0x13a741[_0x3bae('0x1d')](_0x4b2c37);return _0x13a741[_0x3bae('0x22')](_0x3bae('0x23'),_0x3dca75+'-'+_0x12e6c5+'/'+_0x53ef7b)[_0x3bae('0x24')](_0x1b6a08);}return null;};}function patchUpdates(_0x504943){return function(_0x16002f){try{jsonpatch[_0x3bae('0x25')](_0x16002f,_0x504943,!![]);}catch(_0x376e13){return BPromise[_0x3bae('0x26')](_0x376e13);}return _0x16002f[_0x3bae('0x27')]();};}function saveUpdates(_0x8c3561,_0x19d7cf){return function(_0x26c55f){if(_0x26c55f){return _0x26c55f[_0x3bae('0x28')](_0x8c3561)[_0x3bae('0x29')](function(_0x1703db){return _0x1703db;});}return null;};}function removeEntity(_0x302442,_0x54eac1){return function(_0x91028a){if(_0x91028a){return _0x91028a['destroy']()['then'](function(){_0x302442[_0x3bae('0x1d')](0xcc)[_0x3bae('0x2a')]();});}};}function handleEntityNotFound(_0x2dcbed,_0x396e17){return function(_0x5f3ed8){if(!_0x5f3ed8){_0x2dcbed[_0x3bae('0x1c')](0x194);}return _0x5f3ed8;};}function handleError(_0x2d6595,_0x536785){_0x536785=_0x536785||0x1f4;return function(_0x461cf4){logger[_0x3bae('0x2b')](_0x461cf4[_0x3bae('0x2c')]);if(_0x461cf4[_0x3bae('0x2d')]){delete _0x461cf4['name'];}_0x2d6595[_0x3bae('0x1d')](_0x536785)[_0x3bae('0x2e')](_0x461cf4);};}exports[_0x3bae('0x2f')]=function(_0x36f826,_0x5b8914){var _0xb0704d={},_0x23eaaa={},_0x5d4236={'count':0x0,'rows':[]};var _0x186f72=_['map'](db['SalesforceAccount'][_0x3bae('0x30')],function(_0x2d5ca2){return{'name':_0x2d5ca2['fieldName'],'type':_0x2d5ca2['type'][_0x3bae('0x31')]};});_0x23eaaa[_0x3bae('0x32')]=_[_0x3bae('0x33')](_0x186f72,_0x3bae('0x2d'));_0x23eaaa[_0x3bae('0x34')]=_[_0x3bae('0x35')](_0x36f826[_0x3bae('0x34')]);_0x23eaaa[_0x3bae('0x36')]=_[_0x3bae('0x37')](_0x23eaaa[_0x3bae('0x32')],_0x23eaaa['query']);_0xb0704d['attributes']=_[_0x3bae('0x37')](_0x23eaaa[_0x3bae('0x32')],qs[_0x3bae('0x38')](_0x36f826[_0x3bae('0x34')]['fields']));_0xb0704d[_0x3bae('0x39')]=_0xb0704d['attributes']['length']?_0xb0704d['attributes']:_0x23eaaa[_0x3bae('0x32')];if(!_0x36f826['query']['hasOwnProperty'](_0x3bae('0x3a'))){_0xb0704d['limit']=qs[_0x3bae('0x20')](_0x36f826[_0x3bae('0x34')][_0x3bae('0x20')]);_0xb0704d[_0x3bae('0x1e')]=qs['offset'](_0x36f826[_0x3bae('0x34')][_0x3bae('0x1e')]);}_0xb0704d[_0x3bae('0x3b')]=qs['sort'](_0x36f826[_0x3bae('0x34')]['sort']);_0xb0704d[_0x3bae('0x3c')]=qs[_0x3bae('0x36')](_['pick'](_0x36f826[_0x3bae('0x34')],_0x23eaaa[_0x3bae('0x36')]),_0x186f72);if(_0x36f826[_0x3bae('0x34')][_0x3bae('0x3d')]){_0xb0704d['where']=_[_0x3bae('0x3e')](_0xb0704d[_0x3bae('0x3c')],{'$or':_[_0x3bae('0x33')](_0x186f72,function(_0xa6c20c){if(_0xa6c20c[_0x3bae('0x3f')]!==_0x3bae('0x40')){var _0x4ab45f={};_0x4ab45f[_0xa6c20c[_0x3bae('0x2d')]]={'$like':'%'+_0x36f826['query']['filter']+'%'};return _0x4ab45f;}})});}_0xb0704d=_[_0x3bae('0x3e')]({},_0xb0704d,_0x36f826[_0x3bae('0x41')]);var _0x1b2ea0={'where':_0xb0704d[_0x3bae('0x3c')]};return db['SalesforceAccount'][_0x3bae('0x21')](_0x1b2ea0)[_0x3bae('0x29')](function(_0x292dbf){_0x5d4236['count']=_0x292dbf;if(_0x36f826[_0x3bae('0x34')][_0x3bae('0x42')]){_0xb0704d[_0x3bae('0x43')]=[{'all':!![]}];}return db[_0x3bae('0x44')][_0x3bae('0x45')](_0xb0704d);})[_0x3bae('0x29')](function(_0x187d7e){_0x5d4236['rows']=_0x187d7e;return _0x5d4236;})['then'](respondWithFilteredResult(_0x5b8914,_0xb0704d))[_0x3bae('0x46')](handleError(_0x5b8914,null));};exports[_0x3bae('0x47')]=function(_0x36368d,_0x569db4){var _0x31ff37={'raw':![],'where':{'id':_0x36368d[_0x3bae('0x48')]['id']}},_0x2e1fae={};_0x2e1fae[_0x3bae('0x32')]=_['keys'](db['SalesforceAccount'][_0x3bae('0x30')]);_0x2e1fae[_0x3bae('0x34')]=_[_0x3bae('0x35')](_0x36368d[_0x3bae('0x34')]);_0x2e1fae[_0x3bae('0x36')]=_['intersection'](_0x2e1fae[_0x3bae('0x32')],_0x2e1fae[_0x3bae('0x34')]);_0x31ff37[_0x3bae('0x39')]=_[_0x3bae('0x37')](_0x2e1fae[_0x3bae('0x32')],qs[_0x3bae('0x38')](_0x36368d[_0x3bae('0x34')][_0x3bae('0x38')]));_0x31ff37[_0x3bae('0x39')]=_0x31ff37[_0x3bae('0x39')]['length']?_0x31ff37[_0x3bae('0x39')]:_0x2e1fae['model'];if(_0x36368d[_0x3bae('0x34')]['includeAll']){_0x31ff37[_0x3bae('0x43')]=[{'all':!![]}];}_0x31ff37=_[_0x3bae('0x3e')]({},_0x31ff37,_0x36368d[_0x3bae('0x41')]);return db[_0x3bae('0x44')][_0x3bae('0x49')](_0x31ff37)[_0x3bae('0x29')](handleEntityNotFound(_0x569db4,null))['then'](respondWithResult(_0x569db4,null))[_0x3bae('0x46')](handleError(_0x569db4,null));};exports['create']=function(_0x1a5636,_0x1ce83e){return db[_0x3bae('0x44')]['create'](_0x1a5636[_0x3bae('0x4a')],{})[_0x3bae('0x29')](respondWithResult(_0x1ce83e,0xc9))[_0x3bae('0x46')](handleError(_0x1ce83e,null));};exports[_0x3bae('0x28')]=function(_0xe57117,_0x2792bb){if(_0xe57117[_0x3bae('0x4a')]['id']){delete _0xe57117[_0x3bae('0x4a')]['id'];}return db[_0x3bae('0x44')][_0x3bae('0x49')]({'where':{'id':_0xe57117[_0x3bae('0x48')]['id']}})[_0x3bae('0x29')](handleEntityNotFound(_0x2792bb,null))[_0x3bae('0x29')](saveUpdates(_0xe57117[_0x3bae('0x4a')],null))[_0x3bae('0x29')](respondWithResult(_0x2792bb,null))[_0x3bae('0x46')](handleError(_0x2792bb,null));};exports[_0x3bae('0x4b')]=function(_0x2358c6,_0xf2b81d){return db[_0x3bae('0x44')][_0x3bae('0x49')]({'where':{'id':_0x2358c6['params']['id']}})[_0x3bae('0x29')](handleEntityNotFound(_0xf2b81d,null))[_0x3bae('0x29')](removeEntity(_0xf2b81d,null))[_0x3bae('0x46')](handleError(_0xf2b81d,null));};exports[_0x3bae('0x4c')]=function(_0x218d1f,_0x5ce0d0,_0x5eec08){var _0x9adc7b={};var _0x24e44f={};var _0x4057be;var _0x3240bd;return db[_0x3bae('0x44')][_0x3bae('0x4d')]({'where':{'id':_0x218d1f[_0x3bae('0x48')]['id']}})[_0x3bae('0x29')](handleEntityNotFound(_0x5ce0d0,null))[_0x3bae('0x29')](function(_0x483292){if(_0x483292){_0x4057be=_0x483292;_0x24e44f[_0x3bae('0x32')]=_[_0x3bae('0x35')](db[_0x3bae('0x4e')]['rawAttributes']);_0x24e44f['query']=_['keys'](_0x218d1f[_0x3bae('0x34')]);_0x24e44f[_0x3bae('0x36')]=_['intersection'](_0x24e44f[_0x3bae('0x32')],_0x24e44f[_0x3bae('0x34')]);_0x9adc7b['attributes']=_['intersection'](_0x24e44f[_0x3bae('0x32')],qs[_0x3bae('0x38')](_0x218d1f[_0x3bae('0x34')][_0x3bae('0x38')]));_0x9adc7b[_0x3bae('0x39')]=_0x9adc7b[_0x3bae('0x39')][_0x3bae('0x4f')]?_0x9adc7b[_0x3bae('0x39')]:_0x24e44f[_0x3bae('0x32')];_0x9adc7b['order']=qs['sort'](_0x218d1f['query'][_0x3bae('0x50')]);_0x9adc7b[_0x3bae('0x3c')]=qs[_0x3bae('0x36')](_[_0x3bae('0x51')](_0x218d1f['query'],_0x24e44f[_0x3bae('0x36')]));if(_0x218d1f[_0x3bae('0x34')][_0x3bae('0x3d')]){_0x9adc7b[_0x3bae('0x3c')]=_['merge'](_0x9adc7b[_0x3bae('0x3c')],{'$or':_[_0x3bae('0x33')](_0x9adc7b[_0x3bae('0x39')],function(_0x219ef5){var _0x566d9a={};_0x566d9a[_0x219ef5]={'$like':'%'+_0x218d1f[_0x3bae('0x34')][_0x3bae('0x3d')]+'%'};return _0x566d9a;})});}_0x9adc7b=_[_0x3bae('0x3e')]({},_0x9adc7b,_0x218d1f['options']);return _0x4057be['getConfigurations'](_0x9adc7b);}})[_0x3bae('0x29')](function(_0x115490){if(_0x115490){_0x3240bd=_0x115490[_0x3bae('0x4f')];if(!_0x218d1f[_0x3bae('0x34')][_0x3bae('0x52')]('nolimit')){_0x9adc7b['limit']=qs[_0x3bae('0x20')](_0x218d1f[_0x3bae('0x34')][_0x3bae('0x20')]);_0x9adc7b['offset']=qs[_0x3bae('0x1e')](_0x218d1f['query'][_0x3bae('0x1e')]);}return _0x4057be[_0x3bae('0x4c')](_0x9adc7b);}})['then'](function(_0x3a3150){if(_0x3a3150){return _0x3a3150?{'count':_0x3240bd,'rows':_0x3a3150}:null;}})[_0x3bae('0x29')](respondWithResult(_0x5ce0d0,null))[_0x3bae('0x46')](handleError(_0x5ce0d0,null));};exports[_0x3bae('0x53')]=function(_0x5c46c4,_0x425974,_0x525178){if(_0x5c46c4['body']['id']){delete _0x5c46c4[_0x3bae('0x4a')]['id'];}return db[_0x3bae('0x44')][_0x3bae('0x4d')]({'where':{'id':_0x5c46c4['params']['id']}})[_0x3bae('0x29')](handleEntityNotFound(_0x425974,null))[_0x3bae('0x29')](function(_0x28607e){if(_0x28607e){_0x5c46c4[_0x3bae('0x4a')]['AccountId']=_0x28607e['id'];_0x5c46c4[_0x3bae('0x4a')][_0x3bae('0x54')]=integrations[_0x3bae('0x55')](_0x5c46c4[_0x3bae('0x4a')][_0x3bae('0x56')],_0x5c46c4[_0x3bae('0x4a')]['type']);_0x5c46c4[_0x3bae('0x4a')][_0x3bae('0x57')]=integrations[_0x3bae('0x58')](_0x5c46c4[_0x3bae('0x4a')][_0x3bae('0x56')],_0x5c46c4['body'][_0x3bae('0x3f')]);return db[_0x3bae('0x4e')][_0x3bae('0x59')](_0x5c46c4[_0x3bae('0x4a')],{'include':[{'model':db[_0x3bae('0x5a')],'as':_0x3bae('0x54')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x3bae('0x29')](respondWithResult(_0x425974,null))['catch'](handleError(_0x425974,null));};exports[_0x3bae('0x5b')]=function(_0xf8b175,_0x3cbb72,_0x2f57da){var _0x5ea3e0;var _0x2dab24='';var _0xee34de=_0x3bae('0x5c');return db[_0x3bae('0x44')]['findOne']({'where':{'id':_0xf8b175[_0x3bae('0x48')]['id']},'attributes':['id','remoteUri',_0x3bae('0x5d'),_0x3bae('0x5e'),'username','password',_0x3bae('0x5f')]})[_0x3bae('0x29')](handleEntityNotFound(_0x3cbb72,null))[_0x3bae('0x29')](function(_0x489328){if(_0x489328){_0x2dab24=_0x489328[_0x3bae('0x60')];var _0x113c25=_0x2dab24[_0x3bae('0x61')](-0x1);if(_0x113c25==='/'){_0x2dab24=_0x2dab24[_0x3bae('0x62')](0x0,_0x2dab24[_0x3bae('0x63')](_0x113c25));}_0x5ea3e0=new jsforce[(_0x3bae('0x64'))]({'oauth2':{'loginUrl':_0x2dab24,'clientId':_0x489328[_0x3bae('0x5d')],'clientSecret':_0x489328['clientSecret']}});return _0x5ea3e0[_0x3bae('0x65')](_0x489328['username'],_0x489328[_0x3bae('0x66')]['concat'](_0x489328[_0x3bae('0x5f')]));}})['then'](function(_0x19249f){if(_0x19249f){if(!_[_0x3bae('0x67')](_0xf8b175[_0x3bae('0x34')]['ticketType'])){_0xee34de=_0xf8b175[_0x3bae('0x34')]['ticketType'];}return _0x5ea3e0[_0x3bae('0x68')](_0xee34de)[_0x3bae('0x69')]();}})[_0x3bae('0x29')](function(_0x15407b){var _0x314673=[_0x3bae('0x6a'),'ActivityDate','IsReminderSet',_0x3bae('0x6b'),'Subject',_0x3bae('0x6c')];var _0x41cc6c=[_0x3bae('0x6d'),_0x3bae('0x6e'),_0x3bae('0x6f'),_0x3bae('0x70'),'email',_0x3bae('0x71'),'phone'];if(_0x15407b){_['remove'](_0x15407b[_0x3bae('0x38')],function(_0x47b21f){return _0x314673['includes'](_0x47b21f[_0x3bae('0x2d')])||!_0x41cc6c[_0x3bae('0x72')](_0x47b21f[_0x3bae('0x3f')]);});return{'count':_0x15407b[_0x3bae('0x38')]['length'],'rows':_[_0x3bae('0x33')](_0x15407b['fields'],function(_0x1d7e70){return{'id':_0x1d7e70['name'],'name':_0x1d7e70[_0x3bae('0x73')],'custom':_0x1d7e70[_0x3bae('0x74')],'options':_0x1d7e70[_0x3bae('0x75')][_0x3bae('0x4f')]>0x0?_[_0x3bae('0x33')](_0x1d7e70['picklistValues'],function(_0x1f3898){return{'name':_0x1f3898[_0x3bae('0x73')],'value':_0x1f3898[_0x3bae('0x76')]};}):_0x1d7e70[_0x3bae('0x3f')]==_0x3bae('0x70')?[{'name':_0x3bae('0x77'),'value':_0x3bae('0x78')},{'name':_0x3bae('0x79'),'value':_0x3bae('0x7a')}]:[]};})};}})[_0x3bae('0x29')](respondWithResult(_0x3cbb72,null))[_0x3bae('0x46')](function(_0x29b473){var _0x4c9014=_0xf8b175[_0x3bae('0x34')][_0x3bae('0x7b')]?0x1f4:_0x29b473[_0x3bae('0x7c')]||0x1f4;logger[_0x3bae('0x2b')](_0x3bae('0x7d'),'getFields',_0x4c9014,JSON[_0x3bae('0x7e')](_0x29b473));delete _0x29b473['name'];if(_0x4c9014===0x191){_0x4c9014=0x190;}_0x3cbb72['status'](_0x4c9014)['send'](_0xf8b175[_0x3bae('0x34')][_0x3bae('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x29b473['statusCode']}:_0x29b473);});}; \ No newline at end of file +var _0xc81e=['../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','attributes','fields','hasOwnProperty','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','keys','intersection','length','find','create','body','params','SalesforceConfiguration','order','options','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','True','False','false','test','statusCode','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x453ab3,_0x4461dd){var _0x5898c6=function(_0x2c135e){while(--_0x2c135e){_0x453ab3['push'](_0x453ab3['shift']());}};_0x5898c6(++_0x4461dd);}(_0xc81e,0x1dd));var _0xec81=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0xc81e[_0x2389bc];return _0x170548;};'use strict';var emlformat=require(_0xec81('0x0'));var rimraf=require(_0xec81('0x1'));var zipdir=require(_0xec81('0x2'));var jsonpatch=require(_0xec81('0x3'));var rp=require(_0xec81('0x4'));var moment=require('moment');var BPromise=require(_0xec81('0x5'));var Mustache=require(_0xec81('0x6'));var util=require(_0xec81('0x7'));var path=require('path');var sox=require(_0xec81('0x8'));var csv=require(_0xec81('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec81('0xa'));var _=require(_0xec81('0xb'));var squel=require('squel');var crypto=require(_0xec81('0xc'));var jsforce=require(_0xec81('0xd'));var deskjs=require(_0xec81('0xe'));var toCsv=require(_0xec81('0x9'));var querystring=require('querystring');var Papa=require(_0xec81('0xf'));var Redis=require(_0xec81('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xec81('0x11'));var as=require(_0xec81('0x12'));var hardwareService=require(_0xec81('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xec81('0x14'));var licenseUtil=require(_0xec81('0x15'));var db=require(_0xec81('0x16'))['db'];var integrations=require(_0xec81('0x17'));function respondWithStatusCode(_0x83f31c,_0x10caaa){_0x10caaa=_0x10caaa||0xcc;return function(_0x15fe1b){if(_0x15fe1b){return _0x83f31c[_0xec81('0x18')](_0x10caaa);}return _0x83f31c[_0xec81('0x19')](_0x10caaa)[_0xec81('0x1a')]();};}function respondWithResult(_0x3c4756,_0x118ea4){_0x118ea4=_0x118ea4||0xc8;return function(_0x1484e4){if(_0x1484e4){return _0x3c4756[_0xec81('0x19')](_0x118ea4)[_0xec81('0x1b')](_0x1484e4);}};}function respondWithFilteredResult(_0x2dc3cc,_0x1faddd){return function(_0x409b83){if(_0x409b83){var _0x393949=typeof _0x1faddd[_0xec81('0x1c')]===_0xec81('0x1d')&&typeof _0x1faddd[_0xec81('0x1e')]===_0xec81('0x1d');var _0x42badd=_0x409b83[_0xec81('0x1f')];var _0x1d576b=_0x393949?0x0:_0x1faddd[_0xec81('0x1c')];var _0x49b961=_0x393949?_0x409b83[_0xec81('0x1f')]:_0x1faddd[_0xec81('0x1c')]+_0x1faddd['limit'];var _0x58c6b7;if(_0x49b961>=_0x42badd){_0x49b961=_0x42badd;_0x58c6b7=0xc8;}else{_0x58c6b7=0xce;}_0x2dc3cc[_0xec81('0x19')](_0x58c6b7);return _0x2dc3cc[_0xec81('0x20')](_0xec81('0x21'),_0x1d576b+'-'+_0x49b961+'/'+_0x42badd)[_0xec81('0x1b')](_0x409b83);}return null;};}function patchUpdates(_0x4c19ba){return function(_0x1b7a93){try{jsonpatch[_0xec81('0x22')](_0x1b7a93,_0x4c19ba,!![]);}catch(_0x4fd9ae){return BPromise[_0xec81('0x23')](_0x4fd9ae);}return _0x1b7a93[_0xec81('0x24')]();};}function saveUpdates(_0x3445ad,_0x16d0a4){return function(_0xfa7d76){if(_0xfa7d76){return _0xfa7d76[_0xec81('0x25')](_0x3445ad)[_0xec81('0x26')](function(_0x32e193){return _0x32e193;});}return null;};}function removeEntity(_0x2758da,_0x144157){return function(_0x3ea134){if(_0x3ea134){return _0x3ea134['destroy']()[_0xec81('0x26')](function(){_0x2758da[_0xec81('0x19')](0xcc)[_0xec81('0x1a')]();});}};}function handleEntityNotFound(_0x36f435,_0x419f49){return function(_0x581384){if(!_0x581384){_0x36f435[_0xec81('0x18')](0x194);}return _0x581384;};}function handleError(_0x5f0bf5,_0x35bba8){_0x35bba8=_0x35bba8||0x1f4;return function(_0x4fbfa8){logger['error'](_0x4fbfa8[_0xec81('0x27')]);if(_0x4fbfa8[_0xec81('0x28')]){delete _0x4fbfa8[_0xec81('0x28')];}_0x5f0bf5[_0xec81('0x19')](_0x35bba8)['send'](_0x4fbfa8);};}exports[_0xec81('0x29')]=function(_0x3d9a02,_0x4c674f){var _0x492837={},_0x4fe6ec={},_0x37470d={'count':0x0,'rows':[]};var _0x3cfc43=_[_0xec81('0x2a')](db[_0xec81('0x2b')][_0xec81('0x2c')],function(_0x51fc80){return{'name':_0x51fc80[_0xec81('0x2d')],'type':_0x51fc80[_0xec81('0x2e')]['key']};});_0x4fe6ec[_0xec81('0x2f')]=_['map'](_0x3cfc43,_0xec81('0x28'));_0x4fe6ec[_0xec81('0x30')]=_['keys'](_0x3d9a02[_0xec81('0x30')]);_0x4fe6ec['filters']=_['intersection'](_0x4fe6ec[_0xec81('0x2f')],_0x4fe6ec[_0xec81('0x30')]);_0x492837[_0xec81('0x31')]=_['intersection'](_0x4fe6ec[_0xec81('0x2f')],qs[_0xec81('0x32')](_0x3d9a02[_0xec81('0x30')][_0xec81('0x32')]));_0x492837[_0xec81('0x31')]=_0x492837[_0xec81('0x31')]['length']?_0x492837[_0xec81('0x31')]:_0x4fe6ec[_0xec81('0x2f')];if(!_0x3d9a02['query'][_0xec81('0x33')]('nolimit')){_0x492837[_0xec81('0x1e')]=qs[_0xec81('0x1e')](_0x3d9a02[_0xec81('0x30')]['limit']);_0x492837[_0xec81('0x1c')]=qs['offset'](_0x3d9a02[_0xec81('0x30')][_0xec81('0x1c')]);}_0x492837['order']=qs[_0xec81('0x34')](_0x3d9a02[_0xec81('0x30')][_0xec81('0x34')]);_0x492837['where']=qs['filters'](_[_0xec81('0x35')](_0x3d9a02[_0xec81('0x30')],_0x4fe6ec[_0xec81('0x36')]),_0x3cfc43);if(_0x3d9a02[_0xec81('0x30')][_0xec81('0x37')]){_0x492837['where']=_['merge'](_0x492837[_0xec81('0x38')],{'$or':_['map'](_0x3cfc43,function(_0x37bd9c){if(_0x37bd9c['type']!==_0xec81('0x39')){var _0x9314f1={};_0x9314f1[_0x37bd9c['name']]={'$like':'%'+_0x3d9a02[_0xec81('0x30')][_0xec81('0x37')]+'%'};return _0x9314f1;}})});}_0x492837=_[_0xec81('0x3a')]({},_0x492837,_0x3d9a02['options']);var _0x5bb736={'where':_0x492837[_0xec81('0x38')]};return db['SalesforceAccount'][_0xec81('0x1f')](_0x5bb736)[_0xec81('0x26')](function(_0x7e54a1){_0x37470d[_0xec81('0x1f')]=_0x7e54a1;if(_0x3d9a02['query'][_0xec81('0x3b')]){_0x492837[_0xec81('0x3c')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xec81('0x3d')](_0x492837);})[_0xec81('0x26')](function(_0x454e97){_0x37470d['rows']=_0x454e97;return _0x37470d;})['then'](respondWithFilteredResult(_0x4c674f,_0x492837))[_0xec81('0x3e')](handleError(_0x4c674f,null));};exports[_0xec81('0x3f')]=function(_0x541abd,_0x536ef7){var _0x2f659c={'raw':![],'where':{'id':_0x541abd['params']['id']}},_0x4193cc={};_0x4193cc[_0xec81('0x2f')]=_[_0xec81('0x40')](db['SalesforceAccount']['rawAttributes']);_0x4193cc['query']=_['keys'](_0x541abd[_0xec81('0x30')]);_0x4193cc['filters']=_[_0xec81('0x41')](_0x4193cc['model'],_0x4193cc['query']);_0x2f659c['attributes']=_['intersection'](_0x4193cc[_0xec81('0x2f')],qs[_0xec81('0x32')](_0x541abd[_0xec81('0x30')][_0xec81('0x32')]));_0x2f659c[_0xec81('0x31')]=_0x2f659c[_0xec81('0x31')][_0xec81('0x42')]?_0x2f659c['attributes']:_0x4193cc[_0xec81('0x2f')];if(_0x541abd[_0xec81('0x30')][_0xec81('0x3b')]){_0x2f659c['include']=[{'all':!![]}];}_0x2f659c=_[_0xec81('0x3a')]({},_0x2f659c,_0x541abd['options']);return db['SalesforceAccount'][_0xec81('0x43')](_0x2f659c)['then'](handleEntityNotFound(_0x536ef7,null))['then'](respondWithResult(_0x536ef7,null))[_0xec81('0x3e')](handleError(_0x536ef7,null));};exports['create']=function(_0x21b5b7,_0x36ee60){return db[_0xec81('0x2b')][_0xec81('0x44')](_0x21b5b7[_0xec81('0x45')],{})[_0xec81('0x26')](respondWithResult(_0x36ee60,0xc9))['catch'](handleError(_0x36ee60,null));};exports['update']=function(_0x4efcb3,_0x22c7ab){if(_0x4efcb3[_0xec81('0x45')]['id']){delete _0x4efcb3[_0xec81('0x45')]['id'];}return db[_0xec81('0x2b')]['find']({'where':{'id':_0x4efcb3[_0xec81('0x46')]['id']}})[_0xec81('0x26')](handleEntityNotFound(_0x22c7ab,null))[_0xec81('0x26')](saveUpdates(_0x4efcb3[_0xec81('0x45')],null))['then'](respondWithResult(_0x22c7ab,null))[_0xec81('0x3e')](handleError(_0x22c7ab,null));};exports['destroy']=function(_0x16a33b,_0x2ed4a3){return db['SalesforceAccount']['find']({'where':{'id':_0x16a33b['params']['id']}})[_0xec81('0x26')](handleEntityNotFound(_0x2ed4a3,null))['then'](removeEntity(_0x2ed4a3,null))[_0xec81('0x3e')](handleError(_0x2ed4a3,null));};exports['getConfigurations']=function(_0x3dfa6e,_0xe1bca,_0xc73c2e){var _0x3b4d63={};var _0x357df2={};var _0xc10557;var _0x1b449b;return db[_0xec81('0x2b')]['findOne']({'where':{'id':_0x3dfa6e[_0xec81('0x46')]['id']}})[_0xec81('0x26')](handleEntityNotFound(_0xe1bca,null))['then'](function(_0x51e7d2){if(_0x51e7d2){_0xc10557=_0x51e7d2;_0x357df2[_0xec81('0x2f')]=_[_0xec81('0x40')](db[_0xec81('0x47')][_0xec81('0x2c')]);_0x357df2[_0xec81('0x30')]=_['keys'](_0x3dfa6e['query']);_0x357df2[_0xec81('0x36')]=_['intersection'](_0x357df2[_0xec81('0x2f')],_0x357df2[_0xec81('0x30')]);_0x3b4d63[_0xec81('0x31')]=_[_0xec81('0x41')](_0x357df2['model'],qs[_0xec81('0x32')](_0x3dfa6e[_0xec81('0x30')][_0xec81('0x32')]));_0x3b4d63['attributes']=_0x3b4d63[_0xec81('0x31')]['length']?_0x3b4d63['attributes']:_0x357df2[_0xec81('0x2f')];_0x3b4d63[_0xec81('0x48')]=qs[_0xec81('0x34')](_0x3dfa6e[_0xec81('0x30')][_0xec81('0x34')]);_0x3b4d63[_0xec81('0x38')]=qs['filters'](_[_0xec81('0x35')](_0x3dfa6e[_0xec81('0x30')],_0x357df2['filters']));if(_0x3dfa6e[_0xec81('0x30')]['filter']){_0x3b4d63['where']=_[_0xec81('0x3a')](_0x3b4d63['where'],{'$or':_[_0xec81('0x2a')](_0x3b4d63[_0xec81('0x31')],function(_0x28cdb5){var _0x4ba771={};_0x4ba771[_0x28cdb5]={'$like':'%'+_0x3dfa6e[_0xec81('0x30')]['filter']+'%'};return _0x4ba771;})});}_0x3b4d63=_[_0xec81('0x3a')]({},_0x3b4d63,_0x3dfa6e[_0xec81('0x49')]);return _0xc10557[_0xec81('0x4a')](_0x3b4d63);}})['then'](function(_0x539323){if(_0x539323){_0x1b449b=_0x539323[_0xec81('0x42')];if(!_0x3dfa6e[_0xec81('0x30')]['hasOwnProperty'](_0xec81('0x4b'))){_0x3b4d63[_0xec81('0x1e')]=qs['limit'](_0x3dfa6e[_0xec81('0x30')]['limit']);_0x3b4d63[_0xec81('0x1c')]=qs[_0xec81('0x1c')](_0x3dfa6e[_0xec81('0x30')][_0xec81('0x1c')]);}return _0xc10557[_0xec81('0x4a')](_0x3b4d63);}})[_0xec81('0x26')](function(_0x2accef){if(_0x2accef){return _0x2accef?{'count':_0x1b449b,'rows':_0x2accef}:null;}})[_0xec81('0x26')](respondWithResult(_0xe1bca,null))[_0xec81('0x3e')](handleError(_0xe1bca,null));};exports[_0xec81('0x4c')]=function(_0x5db25a,_0x28c63b,_0x68312d){if(_0x5db25a[_0xec81('0x45')]['id']){delete _0x5db25a['body']['id'];}return db[_0xec81('0x2b')][_0xec81('0x4d')]({'where':{'id':_0x5db25a['params']['id']}})['then'](handleEntityNotFound(_0x28c63b,null))[_0xec81('0x26')](function(_0x1a1947){if(_0x1a1947){_0x5db25a['body'][_0xec81('0x4e')]=_0x1a1947['id'];_0x5db25a[_0xec81('0x45')][_0xec81('0x4f')]=integrations[_0xec81('0x50')](_0x5db25a['body'][_0xec81('0x51')],_0x5db25a[_0xec81('0x45')][_0xec81('0x2e')]);_0x5db25a['body'][_0xec81('0x52')]=integrations['getDescriptions'](_0x5db25a[_0xec81('0x45')][_0xec81('0x51')],_0x5db25a[_0xec81('0x45')][_0xec81('0x2e')]);return db[_0xec81('0x47')][_0xec81('0x44')](_0x5db25a['body'],{'include':[{'model':db[_0xec81('0x53')],'as':'Subjects'},{'model':db[_0xec81('0x53')],'as':_0xec81('0x52')}]});}return null;})[_0xec81('0x26')](respondWithResult(_0x28c63b,null))[_0xec81('0x3e')](handleError(_0x28c63b,null));};exports[_0xec81('0x54')]=function(_0x50a3a3,_0x2ff485,_0x218dd7){var _0x180898;var _0x54b0c5='';var _0x119c89=_0xec81('0x55');return db[_0xec81('0x2b')][_0xec81('0x4d')]({'where':{'id':_0x50a3a3[_0xec81('0x46')]['id']},'attributes':['id',_0xec81('0x56'),_0xec81('0x57'),_0xec81('0x58'),_0xec81('0x59'),_0xec81('0x5a'),'securityToken']})[_0xec81('0x26')](handleEntityNotFound(_0x2ff485,null))[_0xec81('0x26')](function(_0x55d1e0){if(_0x55d1e0){_0x54b0c5=_0x55d1e0['remoteUri'];var _0x297930=_0x54b0c5[_0xec81('0x5b')](-0x1);if(_0x297930==='/'){_0x54b0c5=_0x54b0c5[_0xec81('0x5c')](0x0,_0x54b0c5[_0xec81('0x5d')](_0x297930));}_0x180898=new jsforce[(_0xec81('0x5e'))]({'oauth2':{'loginUrl':_0x54b0c5,'clientId':_0x55d1e0[_0xec81('0x57')],'clientSecret':_0x55d1e0[_0xec81('0x58')]}});return _0x180898[_0xec81('0x5f')](_0x55d1e0[_0xec81('0x59')],_0x55d1e0[_0xec81('0x5a')][_0xec81('0x60')](_0x55d1e0[_0xec81('0x61')]));}})[_0xec81('0x26')](function(_0x32f23a){if(_0x32f23a){if(!_['isNil'](_0x50a3a3[_0xec81('0x30')][_0xec81('0x62')])){_0x119c89=_0x50a3a3[_0xec81('0x30')][_0xec81('0x62')];}return _0x180898[_0xec81('0x63')](_0x119c89)[_0xec81('0x64')]();}})[_0xec81('0x26')](function(_0x236b6f){var _0x2f9e29=[_0xec81('0x65'),_0xec81('0x66'),_0xec81('0x67'),'IsRecurrence',_0xec81('0x68'),_0xec81('0x69')];var _0x5b673c=['string',_0xec81('0x6a'),_0xec81('0x6b'),_0xec81('0x6c'),_0xec81('0x6d'),_0xec81('0x6e'),_0xec81('0x6f')];if(_0x236b6f){_[_0xec81('0x70')](_0x236b6f['fields'],function(_0x1cc267){return _0x2f9e29[_0xec81('0x71')](_0x1cc267[_0xec81('0x28')])||!_0x5b673c['includes'](_0x1cc267[_0xec81('0x2e')]);});return{'count':_0x236b6f[_0xec81('0x32')][_0xec81('0x42')],'rows':_[_0xec81('0x2a')](_0x236b6f['fields'],function(_0x306223){return{'id':_0x306223['name'],'name':_0x306223[_0xec81('0x72')],'custom':_0x306223[_0xec81('0x73')],'options':_0x306223[_0xec81('0x74')][_0xec81('0x42')]>0x0?_['map'](_0x306223[_0xec81('0x74')],function(_0x2f94ee){return{'name':_0x2f94ee[_0xec81('0x72')],'value':_0x2f94ee['value']};}):_0x306223[_0xec81('0x2e')]==_0xec81('0x6c')?[{'name':_0xec81('0x75'),'value':'true'},{'name':_0xec81('0x76'),'value':_0xec81('0x77')}]:[]};})};}})[_0xec81('0x26')](respondWithResult(_0x2ff485,null))[_0xec81('0x3e')](function(_0x1bce4f){var _0x4380f7=_0x50a3a3[_0xec81('0x30')][_0xec81('0x78')]?0x1f4:_0x1bce4f[_0xec81('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4380f7,JSON['stringify'](_0x1bce4f));delete _0x1bce4f[_0xec81('0x28')];if(_0x4380f7===0x191){_0x4380f7=0x190;}_0x2ff485[_0xec81('0x19')](_0x4380f7)[_0xec81('0x7a')](_0x50a3a3[_0xec81('0x30')][_0xec81('0x78')]?{'message':_0xec81('0x7b'),'statusCode':_0x1bce4f[_0xec81('0x79')]}:_0x1bce4f);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5126400..2934cde 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 _0xcaa7=['int_salesforce_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4be34e,_0x5dbb5b){var _0x5db5f7=function(_0x22aac4){while(--_0x22aac4){_0x4be34e['push'](_0x4be34e['shift']());}};_0x5db5f7(++_0x5dbb5b);}(_0xcaa7,0x1a5));var _0x7caa=function(_0x3aaccc,_0x1d9083){_0x3aaccc=_0x3aaccc-0x0;var _0x30c65b=_0xcaa7[_0x3aaccc];return _0x30c65b;};'use strict';var _=require(_0x7caa('0x0'));var util=require(_0x7caa('0x1'));var logger=require('../../config/logger')(_0x7caa('0x2'));var moment=require(_0x7caa('0x3'));var BPromise=require(_0x7caa('0x4'));var rp=require(_0x7caa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7caa('0x6'));var config=require('../../config/environment');var attributes=require(_0x7caa('0x7'));var integrations=require(_0x7caa('0x8'));module[_0x7caa('0x9')]=function(_0x6ab9f3,_0x260c8a){return _0x6ab9f3[_0x7caa('0xa')]('SalesforceAccount',attributes,{'tableName':_0x7caa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25dc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x194018,_0x37680b){var _0x12d656=function(_0x26f6fe){while(--_0x26f6fe){_0x194018['push'](_0x194018['shift']());}};_0x12d656(++_0x37680b);}(_0x25dc,0x135));var _0xc25d=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x25dc[_0x22dac7];return _0x3e6cfa;};'use strict';var _=require(_0xc25d('0x0'));var util=require(_0xc25d('0x1'));var logger=require(_0xc25d('0x2'))(_0xc25d('0x3'));var moment=require(_0xc25d('0x4'));var BPromise=require(_0xc25d('0x5'));var rp=require(_0xc25d('0x6'));var fs=require('fs');var path=require(_0xc25d('0x7'));var rimraf=require(_0xc25d('0x8'));var config=require(_0xc25d('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xc25d('0xa')]=function(_0x15b425,_0x145f45){return _0x15b425[_0xc25d('0xb')]('SalesforceAccount',attributes,{'tableName':_0xc25d('0xc'),'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 607f0b9..c33aeb0 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 _0xd97a=['jayson/promise','client','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SalesforceAccount','options','raw','where','attributes','limit','include','model','map','then','GetSalesforceAccount','ShowSalesforceAccount','find','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0xd97a,0x13c));var _0xad97=function(_0x310b48,_0x2fbe9c){_0x310b48=_0x310b48-0x0;var _0x570b36=_0xd97a[_0x310b48];return _0x570b36;};'use strict';var _=require(_0xad97('0x0'));var util=require('util');var moment=require(_0xad97('0x1'));var BPromise=require(_0xad97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad97('0x3'))['db'];var utils=require(_0xad97('0x4'));var logger=require(_0xad97('0x5'))(_0xad97('0x6'));var config=require(_0xad97('0x7'));var jayson=require(_0xad97('0x8'));var client=jayson[_0xad97('0x9')][_0xad97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd0914a,_0x48c842,_0x4acd33){return new BPromise(function(_0x5a82ed,_0x1295ea){return client[_0xad97('0xb')](_0xd0914a,_0x4acd33)['then'](function(_0x4fa2a9){logger['info'](_0xad97('0xc'),_0x48c842,_0xad97('0xd'));logger['debug'](_0xad97('0xe'),_0x48c842,_0xad97('0xd'),JSON[_0xad97('0xf')](_0x4fa2a9));if(_0x4fa2a9[_0xad97('0x10')]){if(_0x4fa2a9['error'][_0xad97('0x11')]===0x1f4){logger['error'](_0xad97('0xc'),_0x48c842,_0x4fa2a9[_0xad97('0x10')][_0xad97('0x12')]);return _0x1295ea(_0x4fa2a9[_0xad97('0x10')][_0xad97('0x12')]);}logger[_0xad97('0x10')](_0xad97('0xc'),_0x48c842,_0x4fa2a9[_0xad97('0x10')][_0xad97('0x12')]);return _0x5a82ed(_0x4fa2a9[_0xad97('0x10')][_0xad97('0x12')]);}else{logger[_0xad97('0x13')](_0xad97('0xc'),_0x48c842,'request\x20sent');_0x5a82ed(_0x4fa2a9[_0xad97('0x14')][_0xad97('0x12')]);}})[_0xad97('0x15')](function(_0x182303){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x48c842,_0x182303);_0x1295ea(_0x182303);});});}exports['GetSalesforceAccount']=function(_0x342927){var _0x200d46=this;return new Promise(function(_0x19c7db,_0x151e07){return db[_0xad97('0x16')]['findAll']({'raw':_0x342927[_0xad97('0x17')]?_0x342927[_0xad97('0x17')][_0xad97('0x18')]===undefined?!![]:![]:!![],'where':_0x342927[_0xad97('0x17')]?_0x342927[_0xad97('0x17')][_0xad97('0x19')]||null:null,'attributes':_0x342927['options']?_0x342927[_0xad97('0x17')][_0xad97('0x1a')]||null:null,'limit':_0x342927[_0xad97('0x17')]?_0x342927['options'][_0xad97('0x1b')]||null:null,'include':_0x342927[_0xad97('0x17')]?_0x342927[_0xad97('0x17')][_0xad97('0x1c')]?_['map'](_0x342927[_0xad97('0x17')][_0xad97('0x1c')],function(_0x4be778){return{'model':db[_0x4be778[_0xad97('0x1d')]],'as':_0x4be778['as'],'attributes':_0x4be778[_0xad97('0x1a')],'include':_0x4be778['include']?_[_0xad97('0x1e')](_0x4be778[_0xad97('0x1c')],function(_0x132d6c){return{'model':db[_0x132d6c[_0xad97('0x1d')]],'as':_0x132d6c['as'],'attributes':_0x132d6c[_0xad97('0x1a')],'include':_0x132d6c['include']?_[_0xad97('0x1e')](_0x132d6c[_0xad97('0x1c')],function(_0x1b346b){return{'model':db[_0x1b346b[_0xad97('0x1d')]],'as':_0x1b346b['as'],'attributes':_0x1b346b[_0xad97('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xad97('0x1f')](function(_0x2a0dc6){logger[_0xad97('0x13')](_0xad97('0x20'),_0x342927);logger['debug'](_0xad97('0x20'),_0x342927,JSON[_0xad97('0xf')](_0x2a0dc6));_0x19c7db(_0x2a0dc6);})['catch'](function(_0x68770e){logger['error']('GetSalesforceAccount',_0x68770e['message'],_0x342927);_0x151e07(_0x200d46[_0xad97('0x10')](0x1f4,_0x68770e[_0xad97('0x12')]));});});};exports[_0xad97('0x21')]=function(_0x47d27b){var _0x4b6306=this;return new Promise(function(_0x4ebae4,_0x407bab){return db[_0xad97('0x16')][_0xad97('0x22')]({'raw':_0x47d27b[_0xad97('0x17')]?_0x47d27b[_0xad97('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x47d27b[_0xad97('0x17')]?_0x47d27b[_0xad97('0x17')][_0xad97('0x19')]||null:null,'attributes':_0x47d27b[_0xad97('0x17')]?_0x47d27b[_0xad97('0x17')]['attributes']||null:null,'include':_0x47d27b['options']?_0x47d27b[_0xad97('0x17')][_0xad97('0x1c')]?_[_0xad97('0x1e')](_0x47d27b[_0xad97('0x17')][_0xad97('0x1c')],function(_0x1cc581){return{'model':db[_0x1cc581[_0xad97('0x1d')]],'as':_0x1cc581['as'],'attributes':_0x1cc581[_0xad97('0x1a')],'include':_0x1cc581[_0xad97('0x1c')]?_[_0xad97('0x1e')](_0x1cc581[_0xad97('0x1c')],function(_0x2e5f71){return{'model':db[_0x2e5f71[_0xad97('0x1d')]],'as':_0x2e5f71['as'],'attributes':_0x2e5f71[_0xad97('0x1a')],'include':_0x2e5f71[_0xad97('0x1c')]?_[_0xad97('0x1e')](_0x2e5f71['include'],function(_0x12172f){return{'model':db[_0x12172f[_0xad97('0x1d')]],'as':_0x12172f['as'],'attributes':_0x12172f['attributes']};}):[]};}):[]};}):[]:[]})[_0xad97('0x1f')](function(_0x3589eb){logger[_0xad97('0x13')](_0xad97('0x21'),_0x47d27b);logger[_0xad97('0x23')](_0xad97('0x21'),_0x47d27b,JSON['stringify'](_0x3589eb));_0x4ebae4(_0x3589eb);})[_0xad97('0x15')](function(_0x4b8ce7){logger['error'](_0xad97('0x21'),_0x4b8ce7[_0xad97('0x12')],_0x47d27b);_0x407bab(_0x4b6306[_0xad97('0x10')](0x1f4,_0x4b8ce7[_0xad97('0x12')]));});});}; \ No newline at end of file +var _0x2adc=['map','model','attributes','find','ShowSalesforceAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0x2adc,0x135));var _0xc2ad=function(_0x1b25ea,_0x4f980d){_0x1b25ea=_0x1b25ea-0x0;var _0x3dc653=_0x2adc[_0x1b25ea];return _0x3dc653;};'use strict';var _=require('lodash');var util=require(_0xc2ad('0x0'));var moment=require(_0xc2ad('0x1'));var BPromise=require(_0xc2ad('0x2'));var rs=require(_0xc2ad('0x3'));var fs=require('fs');var Redis=require(_0xc2ad('0x4'));var db=require(_0xc2ad('0x5'))['db'];var utils=require(_0xc2ad('0x6'));var logger=require('../../config/logger')(_0xc2ad('0x7'));var config=require(_0xc2ad('0x8'));var jayson=require(_0xc2ad('0x9'));var client=jayson[_0xc2ad('0xa')][_0xc2ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa15c47,_0x80a1e2,_0x381f87){return new BPromise(function(_0x1b731d,_0x48ce75){return client[_0xc2ad('0xc')](_0xa15c47,_0x381f87)[_0xc2ad('0xd')](function(_0x33db27){logger[_0xc2ad('0xe')](_0xc2ad('0xf'),_0x80a1e2,'request\x20sent');logger[_0xc2ad('0x10')](_0xc2ad('0x11'),_0x80a1e2,_0xc2ad('0x12'),JSON[_0xc2ad('0x13')](_0x33db27));if(_0x33db27[_0xc2ad('0x14')]){if(_0x33db27[_0xc2ad('0x14')][_0xc2ad('0x15')]===0x1f4){logger[_0xc2ad('0x14')](_0xc2ad('0xf'),_0x80a1e2,_0x33db27[_0xc2ad('0x14')][_0xc2ad('0x16')]);return _0x48ce75(_0x33db27[_0xc2ad('0x14')][_0xc2ad('0x16')]);}logger['error'](_0xc2ad('0xf'),_0x80a1e2,_0x33db27[_0xc2ad('0x14')][_0xc2ad('0x16')]);return _0x1b731d(_0x33db27['error'][_0xc2ad('0x16')]);}else{logger[_0xc2ad('0xe')](_0xc2ad('0xf'),_0x80a1e2,_0xc2ad('0x12'));_0x1b731d(_0x33db27[_0xc2ad('0x17')][_0xc2ad('0x16')]);}})[_0xc2ad('0x18')](function(_0x107e6f){logger[_0xc2ad('0x14')](_0xc2ad('0xf'),_0x80a1e2,_0x107e6f);_0x48ce75(_0x107e6f);});});}exports[_0xc2ad('0x19')]=function(_0x45ab78){var _0x5c7618=this;return new Promise(function(_0x315c3f,_0x49a995){return db[_0xc2ad('0x1a')][_0xc2ad('0x1b')]({'raw':_0x45ab78[_0xc2ad('0x1c')]?_0x45ab78['options'][_0xc2ad('0x1d')]===undefined?!![]:![]:!![],'where':_0x45ab78['options']?_0x45ab78[_0xc2ad('0x1c')][_0xc2ad('0x1e')]||null:null,'attributes':_0x45ab78[_0xc2ad('0x1c')]?_0x45ab78['options']['attributes']||null:null,'limit':_0x45ab78[_0xc2ad('0x1c')]?_0x45ab78[_0xc2ad('0x1c')][_0xc2ad('0x1f')]||null:null,'include':_0x45ab78['options']?_0x45ab78[_0xc2ad('0x1c')][_0xc2ad('0x20')]?_[_0xc2ad('0x21')](_0x45ab78[_0xc2ad('0x1c')][_0xc2ad('0x20')],function(_0x3a1e80){return{'model':db[_0x3a1e80[_0xc2ad('0x22')]],'as':_0x3a1e80['as'],'attributes':_0x3a1e80[_0xc2ad('0x23')],'include':_0x3a1e80[_0xc2ad('0x20')]?_[_0xc2ad('0x21')](_0x3a1e80[_0xc2ad('0x20')],function(_0x1d02a4){return{'model':db[_0x1d02a4['model']],'as':_0x1d02a4['as'],'attributes':_0x1d02a4[_0xc2ad('0x23')],'include':_0x1d02a4['include']?_['map'](_0x1d02a4[_0xc2ad('0x20')],function(_0x194af5){return{'model':db[_0x194af5[_0xc2ad('0x22')]],'as':_0x194af5['as'],'attributes':_0x194af5['attributes']};}):[]};}):[]};}):[]:[]})[_0xc2ad('0xd')](function(_0x204431){logger[_0xc2ad('0xe')](_0xc2ad('0x19'),_0x45ab78);logger['debug'](_0xc2ad('0x19'),_0x45ab78,JSON['stringify'](_0x204431));_0x315c3f(_0x204431);})[_0xc2ad('0x18')](function(_0x2ca1a1){logger['error'](_0xc2ad('0x19'),_0x2ca1a1['message'],_0x45ab78);_0x49a995(_0x5c7618[_0xc2ad('0x14')](0x1f4,_0x2ca1a1['message']));});});};exports['ShowSalesforceAccount']=function(_0x2f215b){var _0x3042f5=this;return new Promise(function(_0x1f9ddc,_0x427b69){return db[_0xc2ad('0x1a')][_0xc2ad('0x24')]({'raw':_0x2f215b[_0xc2ad('0x1c')]?_0x2f215b[_0xc2ad('0x1c')][_0xc2ad('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f215b[_0xc2ad('0x1c')]?_0x2f215b[_0xc2ad('0x1c')][_0xc2ad('0x1e')]||null:null,'attributes':_0x2f215b['options']?_0x2f215b['options'][_0xc2ad('0x23')]||null:null,'include':_0x2f215b['options']?_0x2f215b['options'][_0xc2ad('0x20')]?_[_0xc2ad('0x21')](_0x2f215b[_0xc2ad('0x1c')]['include'],function(_0x22061d){return{'model':db[_0x22061d[_0xc2ad('0x22')]],'as':_0x22061d['as'],'attributes':_0x22061d[_0xc2ad('0x23')],'include':_0x22061d['include']?_[_0xc2ad('0x21')](_0x22061d['include'],function(_0x3a1ac6){return{'model':db[_0x3a1ac6[_0xc2ad('0x22')]],'as':_0x3a1ac6['as'],'attributes':_0x3a1ac6[_0xc2ad('0x23')],'include':_0x3a1ac6[_0xc2ad('0x20')]?_[_0xc2ad('0x21')](_0x3a1ac6[_0xc2ad('0x20')],function(_0x44d876){return{'model':db[_0x44d876[_0xc2ad('0x22')]],'as':_0x44d876['as'],'attributes':_0x44d876[_0xc2ad('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5934f5){logger[_0xc2ad('0xe')](_0xc2ad('0x25'),_0x2f215b);logger[_0xc2ad('0x10')]('ShowSalesforceAccount',_0x2f215b,JSON[_0xc2ad('0x13')](_0x5934f5));_0x1f9ddc(_0x5934f5);})[_0xc2ad('0x18')](function(_0x36c869){logger['error']('ShowSalesforceAccount',_0x36c869[_0xc2ad('0x16')],_0x2f215b);_0x427b69(_0x3042f5['error'](0x1f4,_0x36c869[_0xc2ad('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index ada6411..06ac887 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0xad8c,_0x42a217){var _0xa34db9=function(_0x5aff4c){while(--_0x5aff4c){_0xad8c['push'](_0xad8c['shift']());}};_0xa34db9(++_0x42a217);}(_0xadb5,0xad));var _0x5adb=function(_0x2e1747,_0x23cefd){_0x2e1747=_0x2e1747-0x0;var _0x10d371=_0xadb5[_0x2e1747];return _0x10d371;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x144627,_0x18993c){var _0x2bb874=function(_0x464375){while(--_0x464375){_0x144627['push'](_0x144627['shift']());}};_0x2bb874(++_0x18993c);}(_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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index b42fcdd..3521f8d 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 _0x125c=['exports','STRING','Task','ENUM','contact_lead','contact','account_contact_lead','account','lead','sequelize'];(function(_0x67daf4,_0x503a11){var _0x3913f4=function(_0x2b30e3){while(--_0x2b30e3){_0x67daf4['push'](_0x67daf4['shift']());}};_0x3913f4(++_0x503a11);}(_0x125c,0x185));var _0xc125=function(_0x435aea,_0x1c69ec){_0x435aea=_0x435aea-0x0;var _0x541d68=_0x125c[_0x435aea];return _0x541d68;};'use strict';var Sequelize=require(_0xc125('0x0'));module[_0xc125('0x1')]={'name':{'type':Sequelize[_0xc125('0x2')]},'description':{'type':Sequelize[_0xc125('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xc125('0x3'),'Case'),'defaultValue':_0xc125('0x3')},'moduleSearch':{'type':Sequelize[_0xc125('0x4')](_0xc125('0x5'),_0xc125('0x6'),'lead',_0xc125('0x7'),_0xc125('0x8')),'defaultValue':_0xc125('0x5')},'moduleCreate':{'type':Sequelize[_0xc125('0x4')]('nothing','contact',_0xc125('0x9'),_0xc125('0x8')),'defaultValue':_0xc125('0x9')},'leadId':{'type':Sequelize[_0xc125('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xc125('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xc125('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0cc0=['sequelize','STRING','Task','Case','ENUM','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x1b2cf0,_0x3e1559){var _0x566935=function(_0x5d2b27){while(--_0x5d2b27){_0x1b2cf0['push'](_0x1b2cf0['shift']());}};_0x566935(++_0x3e1559);}(_0x0cc0,0x11e));var _0x00cc=function(_0x20957f,_0x223b01){_0x20957f=_0x20957f-0x0;var _0x131779=_0x0cc0[_0x20957f];return _0x131779;};'use strict';var Sequelize=require(_0x00cc('0x0'));module['exports']={'name':{'type':Sequelize[_0x00cc('0x1')]},'description':{'type':Sequelize[_0x00cc('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x00cc('0x2'),_0x00cc('0x3')),'defaultValue':_0x00cc('0x2')},'moduleSearch':{'type':Sequelize[_0x00cc('0x4')](_0x00cc('0x5'),_0x00cc('0x6'),_0x00cc('0x7'),_0x00cc('0x8'),_0x00cc('0x9')),'defaultValue':_0x00cc('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0x00cc('0xa'),_0x00cc('0x6'),_0x00cc('0x7'),_0x00cc('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x00cc('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x00cc('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4a08613..674e708 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 _0x1093=['map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','create','catch','body','destroy','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','Content-Range','apply','reject','save','then','error','stack','name','send','index'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0x1093,0x1c8));var _0x3109=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x1093[_0x1f9f37];return _0x21c080;};'use strict';var emlformat=require(_0x3109('0x0'));var rimraf=require(_0x3109('0x1'));var zipdir=require(_0x3109('0x2'));var jsonpatch=require(_0x3109('0x3'));var rp=require(_0x3109('0x4'));var moment=require(_0x3109('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3109('0x6'));var util=require(_0x3109('0x7'));var path=require(_0x3109('0x8'));var sox=require(_0x3109('0x9'));var csv=require(_0x3109('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3109('0xb'));var _=require(_0x3109('0xc'));var squel=require(_0x3109('0xd'));var crypto=require('crypto');var jsforce=require(_0x3109('0xe'));var deskjs=require(_0x3109('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3109('0x10'));var Papa=require(_0x3109('0x11'));var Redis=require('ioredis');var authService=require(_0x3109('0x12'));var qs=require(_0x3109('0x13'));var as=require(_0x3109('0x14'));var hardwareService=require(_0x3109('0x15'));var logger=require('../../config/logger')(_0x3109('0x16'));var utils=require(_0x3109('0x17'));var config=require(_0x3109('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3109('0x19'))['db'];function respondWithStatusCode(_0x1b1378,_0x9b6abc){_0x9b6abc=_0x9b6abc||0xcc;return function(_0x419041){if(_0x419041){return _0x1b1378[_0x3109('0x1a')](_0x9b6abc);}return _0x1b1378['status'](_0x9b6abc)[_0x3109('0x1b')]();};}function respondWithResult(_0x40460d,_0x9c955c){_0x9c955c=_0x9c955c||0xc8;return function(_0x5e04b1){if(_0x5e04b1){return _0x40460d[_0x3109('0x1c')](_0x9c955c)['json'](_0x5e04b1);}};}function respondWithFilteredResult(_0x4f7ff3,_0x3780de){return function(_0x251bd6){if(_0x251bd6){var _0x307aff=typeof _0x3780de[_0x3109('0x1d')]===_0x3109('0x1e')&&typeof _0x3780de[_0x3109('0x1f')]===_0x3109('0x1e');var _0x57231f=_0x251bd6['count'];var _0x4840a9=_0x307aff?0x0:_0x3780de[_0x3109('0x1d')];var _0x1e622e=_0x307aff?_0x251bd6['count']:_0x3780de[_0x3109('0x1d')]+_0x3780de[_0x3109('0x1f')];var _0x11de76;if(_0x1e622e>=_0x57231f){_0x1e622e=_0x57231f;_0x11de76=0xc8;}else{_0x11de76=0xce;}_0x4f7ff3[_0x3109('0x1c')](_0x11de76);return _0x4f7ff3['set'](_0x3109('0x20'),_0x4840a9+'-'+_0x1e622e+'/'+_0x57231f)['json'](_0x251bd6);}return null;};}function patchUpdates(_0x16ae61){return function(_0x5dd618){try{jsonpatch[_0x3109('0x21')](_0x5dd618,_0x16ae61,!![]);}catch(_0x29d69c){return BPromise[_0x3109('0x22')](_0x29d69c);}return _0x5dd618[_0x3109('0x23')]();};}function saveUpdates(_0x2c4e9a,_0x30be8a){return function(_0xe8860a){if(_0xe8860a){return _0xe8860a['update'](_0x2c4e9a)['then'](function(_0x23f987){return _0x23f987;});}return null;};}function removeEntity(_0x498990,_0x1831ce){return function(_0x2f8e07){if(_0x2f8e07){return _0x2f8e07['destroy']()[_0x3109('0x24')](function(){_0x498990[_0x3109('0x1c')](0xcc)[_0x3109('0x1b')]();});}};}function handleEntityNotFound(_0x1d1717,_0x2b81ff){return function(_0x41a23d){if(!_0x41a23d){_0x1d1717['sendStatus'](0x194);}return _0x41a23d;};}function handleError(_0x37ddea,_0x3f1cfb){_0x3f1cfb=_0x3f1cfb||0x1f4;return function(_0x435bd1){logger[_0x3109('0x25')](_0x435bd1[_0x3109('0x26')]);if(_0x435bd1[_0x3109('0x27')]){delete _0x435bd1[_0x3109('0x27')];}_0x37ddea['status'](_0x3f1cfb)[_0x3109('0x28')](_0x435bd1);};}exports[_0x3109('0x29')]=function(_0x22156d,_0x3f0a5e){var _0x3cd625={},_0x1a9259={},_0x4c1361={'count':0x0,'rows':[]};var _0x23d54a=_[_0x3109('0x2a')](db[_0x3109('0x2b')][_0x3109('0x2c')],function(_0x25552b){return{'name':_0x25552b[_0x3109('0x2d')],'type':_0x25552b[_0x3109('0x2e')][_0x3109('0x2f')]};});_0x1a9259[_0x3109('0x30')]=_['map'](_0x23d54a,_0x3109('0x27'));_0x1a9259[_0x3109('0x31')]=_[_0x3109('0x32')](_0x22156d['query']);_0x1a9259[_0x3109('0x33')]=_[_0x3109('0x34')](_0x1a9259[_0x3109('0x30')],_0x1a9259[_0x3109('0x31')]);_0x3cd625['attributes']=_[_0x3109('0x34')](_0x1a9259[_0x3109('0x30')],qs['fields'](_0x22156d[_0x3109('0x31')][_0x3109('0x35')]));_0x3cd625[_0x3109('0x36')]=_0x3cd625[_0x3109('0x36')][_0x3109('0x37')]?_0x3cd625[_0x3109('0x36')]:_0x1a9259['model'];if(!_0x22156d[_0x3109('0x31')][_0x3109('0x38')](_0x3109('0x39'))){_0x3cd625[_0x3109('0x1f')]=qs['limit'](_0x22156d['query'][_0x3109('0x1f')]);_0x3cd625[_0x3109('0x1d')]=qs[_0x3109('0x1d')](_0x22156d[_0x3109('0x31')][_0x3109('0x1d')]);}_0x3cd625[_0x3109('0x3a')]=qs['sort'](_0x22156d[_0x3109('0x31')][_0x3109('0x3b')]);_0x3cd625[_0x3109('0x3c')]=qs[_0x3109('0x33')](_['pick'](_0x22156d[_0x3109('0x31')],_0x1a9259[_0x3109('0x33')]),_0x23d54a);if(_0x22156d['query'][_0x3109('0x3d')]){_0x3cd625[_0x3109('0x3c')]=_[_0x3109('0x3e')](_0x3cd625[_0x3109('0x3c')],{'$or':_[_0x3109('0x2a')](_0x23d54a,function(_0x3d7f5e){if(_0x3d7f5e[_0x3109('0x2e')]!==_0x3109('0x3f')){var _0x4470ab={};_0x4470ab[_0x3d7f5e[_0x3109('0x27')]]={'$like':'%'+_0x22156d[_0x3109('0x31')][_0x3109('0x3d')]+'%'};return _0x4470ab;}})});}_0x3cd625=_[_0x3109('0x3e')]({},_0x3cd625,_0x22156d[_0x3109('0x40')]);var _0x402f05={'where':_0x3cd625[_0x3109('0x3c')]};return db['SalesforceConfiguration'][_0x3109('0x41')](_0x402f05)['then'](function(_0x2dc158){_0x4c1361[_0x3109('0x41')]=_0x2dc158;if(_0x22156d[_0x3109('0x31')][_0x3109('0x42')]){_0x3cd625[_0x3109('0x43')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x3109('0x44')](_0x3cd625);})[_0x3109('0x24')](function(_0x48e111){_0x4c1361[_0x3109('0x45')]=_0x48e111;return _0x4c1361;})[_0x3109('0x24')](respondWithFilteredResult(_0x3f0a5e,_0x3cd625))['catch'](handleError(_0x3f0a5e,null));};exports[_0x3109('0x46')]=function(_0x2fb3fc,_0x305fba){var _0x285311={'raw':![],'where':{'id':_0x2fb3fc[_0x3109('0x47')]['id']}},_0x3d34af={};_0x3d34af['model']=_['keys'](db['SalesforceConfiguration'][_0x3109('0x2c')]);_0x3d34af['query']=_[_0x3109('0x32')](_0x2fb3fc[_0x3109('0x31')]);_0x3d34af['filters']=_[_0x3109('0x34')](_0x3d34af[_0x3109('0x30')],_0x3d34af[_0x3109('0x31')]);_0x285311[_0x3109('0x36')]=_['intersection'](_0x3d34af['model'],qs['fields'](_0x2fb3fc[_0x3109('0x31')][_0x3109('0x35')]));_0x285311[_0x3109('0x36')]=_0x285311[_0x3109('0x36')]['length']?_0x285311['attributes']:_0x3d34af[_0x3109('0x30')];if(_0x2fb3fc[_0x3109('0x31')][_0x3109('0x42')]){_0x285311[_0x3109('0x43')]=[{'all':!![]}];}_0x285311=_[_0x3109('0x3e')]({},_0x285311,_0x2fb3fc['options']);return db[_0x3109('0x2b')][_0x3109('0x48')](_0x285311)[_0x3109('0x24')](handleEntityNotFound(_0x305fba,null))[_0x3109('0x24')](respondWithResult(_0x305fba,null))['catch'](handleError(_0x305fba,null));};exports[_0x3109('0x49')]=function(_0x492c24,_0x1421d3){return db[_0x3109('0x2b')][_0x3109('0x49')](_0x492c24['body'],{})[_0x3109('0x24')](respondWithResult(_0x1421d3,0xc9))[_0x3109('0x4a')](handleError(_0x1421d3,null));};exports['update']=function(_0x595893,_0x30ed89){if(_0x595893['body']['id']){delete _0x595893[_0x3109('0x4b')]['id'];}return db['SalesforceConfiguration'][_0x3109('0x48')]({'where':{'id':_0x595893[_0x3109('0x47')]['id']}})[_0x3109('0x24')](handleEntityNotFound(_0x30ed89,null))['then'](saveUpdates(_0x595893[_0x3109('0x4b')],null))[_0x3109('0x24')](respondWithResult(_0x30ed89,null))[_0x3109('0x4a')](handleError(_0x30ed89,null));};exports[_0x3109('0x4c')]=function(_0x248802,_0x34516b){return db[_0x3109('0x2b')][_0x3109('0x48')]({'where':{'id':_0x248802['params']['id']}})[_0x3109('0x24')](handleEntityNotFound(_0x34516b,null))[_0x3109('0x24')](removeEntity(_0x34516b,null))[_0x3109('0x4a')](handleError(_0x34516b,null));};exports[_0x3109('0x4d')]=function(_0x1024fb,_0x372ab0,_0x37657c){var _0x326ed0={};var _0x11ee48={};var _0x527e87;var _0x4a018d;return db[_0x3109('0x2b')][_0x3109('0x4e')]({'where':{'id':_0x1024fb[_0x3109('0x47')]['id']}})[_0x3109('0x24')](handleEntityNotFound(_0x372ab0,null))[_0x3109('0x24')](function(_0x2f48ed){if(_0x2f48ed){_0x527e87=_0x2f48ed;_0x11ee48[_0x3109('0x30')]=_[_0x3109('0x32')](db[_0x3109('0x4f')][_0x3109('0x2c')]);_0x11ee48['query']=_[_0x3109('0x32')](_0x1024fb[_0x3109('0x31')]);_0x11ee48[_0x3109('0x33')]=_[_0x3109('0x34')](_0x11ee48[_0x3109('0x30')],_0x11ee48['query']);_0x326ed0[_0x3109('0x36')]=_[_0x3109('0x34')](_0x11ee48[_0x3109('0x30')],qs['fields'](_0x1024fb[_0x3109('0x31')][_0x3109('0x35')]));_0x326ed0[_0x3109('0x36')]=_0x326ed0['attributes'][_0x3109('0x37')]?_0x326ed0[_0x3109('0x36')]:_0x11ee48[_0x3109('0x30')];_0x326ed0[_0x3109('0x3a')]=qs['sort'](_0x1024fb['query']['sort']);_0x326ed0[_0x3109('0x3c')]=qs['filters'](_[_0x3109('0x50')](_0x1024fb[_0x3109('0x31')],_0x11ee48['filters']));if(_0x1024fb[_0x3109('0x31')][_0x3109('0x3d')]){_0x326ed0[_0x3109('0x3c')]=_[_0x3109('0x3e')](_0x326ed0[_0x3109('0x3c')],{'$or':_[_0x3109('0x2a')](_0x326ed0[_0x3109('0x36')],function(_0x56f906){var _0x2ad54c={};_0x2ad54c[_0x56f906]={'$like':'%'+_0x1024fb[_0x3109('0x31')][_0x3109('0x3d')]+'%'};return _0x2ad54c;})});}_0x326ed0=_[_0x3109('0x3e')]({},_0x326ed0,_0x1024fb['options']);return _0x527e87[_0x3109('0x4d')](_0x326ed0);}})['then'](function(_0x10cf65){if(_0x10cf65){_0x4a018d=_0x10cf65['length'];if(!_0x1024fb[_0x3109('0x31')][_0x3109('0x38')](_0x3109('0x39'))){_0x326ed0[_0x3109('0x1f')]=qs[_0x3109('0x1f')](_0x1024fb[_0x3109('0x31')][_0x3109('0x1f')]);_0x326ed0[_0x3109('0x1d')]=qs[_0x3109('0x1d')](_0x1024fb[_0x3109('0x31')][_0x3109('0x1d')]);}return _0x527e87[_0x3109('0x4d')](_0x326ed0);}})[_0x3109('0x24')](function(_0x4247ee){if(_0x4247ee){return _0x4247ee?{'count':_0x4a018d,'rows':_0x4247ee}:null;}})[_0x3109('0x24')](respondWithResult(_0x372ab0,null))[_0x3109('0x4a')](handleError(_0x372ab0,null));};exports[_0x3109('0x51')]=function(_0x59cf91,_0x42612d,_0x8aa13d){var _0x3b1ff5={};var _0x21cc7a={};var _0x16ceec;var _0x28bc93;return db[_0x3109('0x2b')]['findOne']({'where':{'id':_0x59cf91[_0x3109('0x47')]['id']}})[_0x3109('0x24')](handleEntityNotFound(_0x42612d,null))['then'](function(_0x5cb7bc){if(_0x5cb7bc){_0x16ceec=_0x5cb7bc;_0x21cc7a[_0x3109('0x30')]=_[_0x3109('0x32')](db[_0x3109('0x4f')][_0x3109('0x2c')]);_0x21cc7a[_0x3109('0x31')]=_[_0x3109('0x32')](_0x59cf91[_0x3109('0x31')]);_0x21cc7a[_0x3109('0x33')]=_[_0x3109('0x34')](_0x21cc7a[_0x3109('0x30')],_0x21cc7a[_0x3109('0x31')]);_0x3b1ff5['attributes']=_[_0x3109('0x34')](_0x21cc7a[_0x3109('0x30')],qs[_0x3109('0x35')](_0x59cf91['query'][_0x3109('0x35')]));_0x3b1ff5[_0x3109('0x36')]=_0x3b1ff5[_0x3109('0x36')][_0x3109('0x37')]?_0x3b1ff5['attributes']:_0x21cc7a[_0x3109('0x30')];_0x3b1ff5['order']=qs['sort'](_0x59cf91[_0x3109('0x31')][_0x3109('0x3b')]);_0x3b1ff5['where']=qs['filters'](_[_0x3109('0x50')](_0x59cf91[_0x3109('0x31')],_0x21cc7a[_0x3109('0x33')]));if(_0x59cf91[_0x3109('0x31')][_0x3109('0x3d')]){_0x3b1ff5[_0x3109('0x3c')]=_[_0x3109('0x3e')](_0x3b1ff5['where'],{'$or':_[_0x3109('0x2a')](_0x3b1ff5[_0x3109('0x36')],function(_0x130827){var _0x5285c2={};_0x5285c2[_0x130827]={'$like':'%'+_0x59cf91[_0x3109('0x31')]['filter']+'%'};return _0x5285c2;})});}_0x3b1ff5=_[_0x3109('0x3e')]({},_0x3b1ff5,_0x59cf91[_0x3109('0x40')]);return _0x16ceec[_0x3109('0x51')](_0x3b1ff5);}})[_0x3109('0x24')](function(_0xd8141a){if(_0xd8141a){_0x28bc93=_0xd8141a['length'];if(!_0x59cf91[_0x3109('0x31')][_0x3109('0x38')](_0x3109('0x39'))){_0x3b1ff5[_0x3109('0x1f')]=qs[_0x3109('0x1f')](_0x59cf91[_0x3109('0x31')]['limit']);_0x3b1ff5[_0x3109('0x1d')]=qs[_0x3109('0x1d')](_0x59cf91[_0x3109('0x31')][_0x3109('0x1d')]);}return _0x16ceec[_0x3109('0x51')](_0x3b1ff5);}})[_0x3109('0x24')](function(_0x4c6431){if(_0x4c6431){return _0x4c6431?{'count':_0x28bc93,'rows':_0x4c6431}:null;}})['then'](respondWithResult(_0x42612d,null))[_0x3109('0x4a')](handleError(_0x42612d,null));};exports[_0x3109('0x52')]=function(_0x2c9f93,_0x277b93,_0x2a1206){var _0x2920f6={};var _0x4a1240={};var _0x486f0c;var _0x127dac;return db[_0x3109('0x2b')][_0x3109('0x4e')]({'where':{'id':_0x2c9f93['params']['id']}})[_0x3109('0x24')](handleEntityNotFound(_0x277b93,null))['then'](function(_0xd48bdc){if(_0xd48bdc){_0x486f0c=_0xd48bdc;_0x4a1240['model']=_['keys'](db[_0x3109('0x4f')][_0x3109('0x2c')]);_0x4a1240[_0x3109('0x31')]=_[_0x3109('0x32')](_0x2c9f93[_0x3109('0x31')]);_0x4a1240[_0x3109('0x33')]=_['intersection'](_0x4a1240[_0x3109('0x30')],_0x4a1240[_0x3109('0x31')]);_0x2920f6['attributes']=_[_0x3109('0x34')](_0x4a1240[_0x3109('0x30')],qs[_0x3109('0x35')](_0x2c9f93[_0x3109('0x31')][_0x3109('0x35')]));_0x2920f6[_0x3109('0x36')]=_0x2920f6['attributes'][_0x3109('0x37')]?_0x2920f6[_0x3109('0x36')]:_0x4a1240[_0x3109('0x30')];_0x2920f6['order']=qs[_0x3109('0x3b')](_0x2c9f93[_0x3109('0x31')][_0x3109('0x3b')]);_0x2920f6[_0x3109('0x3c')]=qs['filters'](_[_0x3109('0x50')](_0x2c9f93[_0x3109('0x31')],_0x4a1240[_0x3109('0x33')]));if(_0x2c9f93[_0x3109('0x31')][_0x3109('0x3d')]){_0x2920f6[_0x3109('0x3c')]=_[_0x3109('0x3e')](_0x2920f6[_0x3109('0x3c')],{'$or':_[_0x3109('0x2a')](_0x2920f6[_0x3109('0x36')],function(_0x5d9f2b){var _0x390b50={};_0x390b50[_0x5d9f2b]={'$like':'%'+_0x2c9f93['query']['filter']+'%'};return _0x390b50;})});}_0x2920f6=_[_0x3109('0x3e')]({},_0x2920f6,_0x2c9f93[_0x3109('0x40')]);return _0x486f0c['getDescriptions'](_0x2920f6);}})[_0x3109('0x24')](function(_0x3d683b){if(_0x3d683b){_0x127dac=_0x3d683b[_0x3109('0x37')];if(!_0x2c9f93[_0x3109('0x31')][_0x3109('0x38')]('nolimit')){_0x2920f6['limit']=qs[_0x3109('0x1f')](_0x2c9f93[_0x3109('0x31')]['limit']);_0x2920f6[_0x3109('0x1d')]=qs[_0x3109('0x1d')](_0x2c9f93[_0x3109('0x31')]['offset']);}return _0x486f0c[_0x3109('0x52')](_0x2920f6);}})['then'](function(_0x441f59){if(_0x441f59){return _0x441f59?{'count':_0x127dac,'rows':_0x441f59}:null;}})[_0x3109('0x24')](respondWithResult(_0x277b93,null))[_0x3109('0x4a')](handleError(_0x277b93,null));}; \ No newline at end of file +var _0x8f9e=['name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','params','fields','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack'];(function(_0x4c8e4a,_0x3b220d){var _0x1b9077=function(_0x18b38d){while(--_0x18b38d){_0x4c8e4a['push'](_0x4c8e4a['shift']());}};_0x1b9077(++_0x3b220d);}(_0x8f9e,0x160));var _0xe8f9=function(_0x1f79f8,_0x4b68e7){_0x1f79f8=_0x1f79f8-0x0;var _0x21baa6=_0x8f9e[_0x1f79f8];return _0x21baa6;};'use strict';var emlformat=require(_0xe8f9('0x0'));var rimraf=require(_0xe8f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8f9('0x2'));var rp=require(_0xe8f9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe8f9('0x4'));var path=require('path');var sox=require(_0xe8f9('0x5'));var csv=require(_0xe8f9('0x6'));var ejs=require(_0xe8f9('0x7'));var fs=require('fs');var fs_extra=require(_0xe8f9('0x8'));var _=require(_0xe8f9('0x9'));var squel=require(_0xe8f9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe8f9('0xb'));var deskjs=require(_0xe8f9('0xc'));var toCsv=require(_0xe8f9('0x6'));var querystring=require(_0xe8f9('0xd'));var Papa=require(_0xe8f9('0xe'));var Redis=require('ioredis');var authService=require(_0xe8f9('0xf'));var qs=require(_0xe8f9('0x10'));var as=require(_0xe8f9('0x11'));var hardwareService=require(_0xe8f9('0x12'));var logger=require(_0xe8f9('0x13'))(_0xe8f9('0x14'));var utils=require('../../config/utils');var config=require(_0xe8f9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe8f9('0x16'))['db'];function respondWithStatusCode(_0xc9a1db,_0x227665){_0x227665=_0x227665||0xcc;return function(_0x577a22){if(_0x577a22){return _0xc9a1db[_0xe8f9('0x17')](_0x227665);}return _0xc9a1db[_0xe8f9('0x18')](_0x227665)['end']();};}function respondWithResult(_0x2a8550,_0x5c4d41){_0x5c4d41=_0x5c4d41||0xc8;return function(_0x358f78){if(_0x358f78){return _0x2a8550['status'](_0x5c4d41)[_0xe8f9('0x19')](_0x358f78);}};}function respondWithFilteredResult(_0xd67bb3,_0x8d80cd){return function(_0xc30c73){if(_0xc30c73){var _0x363515=typeof _0x8d80cd[_0xe8f9('0x1a')]===_0xe8f9('0x1b')&&typeof _0x8d80cd[_0xe8f9('0x1c')]===_0xe8f9('0x1b');var _0xa76ab3=_0xc30c73[_0xe8f9('0x1d')];var _0x3a5e3f=_0x363515?0x0:_0x8d80cd[_0xe8f9('0x1a')];var _0x41c3f4=_0x363515?_0xc30c73[_0xe8f9('0x1d')]:_0x8d80cd[_0xe8f9('0x1a')]+_0x8d80cd['limit'];var _0xa29795;if(_0x41c3f4>=_0xa76ab3){_0x41c3f4=_0xa76ab3;_0xa29795=0xc8;}else{_0xa29795=0xce;}_0xd67bb3[_0xe8f9('0x18')](_0xa29795);return _0xd67bb3[_0xe8f9('0x1e')](_0xe8f9('0x1f'),_0x3a5e3f+'-'+_0x41c3f4+'/'+_0xa76ab3)['json'](_0xc30c73);}return null;};}function patchUpdates(_0x5696e6){return function(_0x56a8be){try{jsonpatch['apply'](_0x56a8be,_0x5696e6,!![]);}catch(_0x481633){return BPromise['reject'](_0x481633);}return _0x56a8be[_0xe8f9('0x20')]();};}function saveUpdates(_0x44ed82,_0x5d5c0b){return function(_0x485cc8){if(_0x485cc8){return _0x485cc8[_0xe8f9('0x21')](_0x44ed82)[_0xe8f9('0x22')](function(_0x5888cb){return _0x5888cb;});}return null;};}function removeEntity(_0x2a43ff,_0x13bc83){return function(_0x5939ce){if(_0x5939ce){return _0x5939ce[_0xe8f9('0x23')]()[_0xe8f9('0x22')](function(){_0x2a43ff[_0xe8f9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c88eb,_0x233654){return function(_0x283118){if(!_0x283118){_0x1c88eb[_0xe8f9('0x17')](0x194);}return _0x283118;};}function handleError(_0x520455,_0x33ba8c){_0x33ba8c=_0x33ba8c||0x1f4;return function(_0x282404){logger[_0xe8f9('0x24')](_0x282404[_0xe8f9('0x25')]);if(_0x282404[_0xe8f9('0x26')]){delete _0x282404[_0xe8f9('0x26')];}_0x520455[_0xe8f9('0x18')](_0x33ba8c)[_0xe8f9('0x27')](_0x282404);};}exports[_0xe8f9('0x28')]=function(_0x51810d,_0x46c798){var _0x3a1fb6={},_0x40d5b8={},_0x3f7725={'count':0x0,'rows':[]};var _0x26af41=_[_0xe8f9('0x29')](db['SalesforceConfiguration'][_0xe8f9('0x2a')],function(_0x28bba5){return{'name':_0x28bba5[_0xe8f9('0x2b')],'type':_0x28bba5[_0xe8f9('0x2c')]['key']};});_0x40d5b8[_0xe8f9('0x2d')]=_[_0xe8f9('0x29')](_0x26af41,_0xe8f9('0x26'));_0x40d5b8[_0xe8f9('0x2e')]=_[_0xe8f9('0x2f')](_0x51810d[_0xe8f9('0x2e')]);_0x40d5b8[_0xe8f9('0x30')]=_[_0xe8f9('0x31')](_0x40d5b8[_0xe8f9('0x2d')],_0x40d5b8['query']);_0x3a1fb6[_0xe8f9('0x32')]=_[_0xe8f9('0x31')](_0x40d5b8[_0xe8f9('0x2d')],qs['fields'](_0x51810d[_0xe8f9('0x2e')]['fields']));_0x3a1fb6['attributes']=_0x3a1fb6[_0xe8f9('0x32')][_0xe8f9('0x33')]?_0x3a1fb6[_0xe8f9('0x32')]:_0x40d5b8[_0xe8f9('0x2d')];if(!_0x51810d[_0xe8f9('0x2e')]['hasOwnProperty'](_0xe8f9('0x34'))){_0x3a1fb6[_0xe8f9('0x1c')]=qs[_0xe8f9('0x1c')](_0x51810d[_0xe8f9('0x2e')][_0xe8f9('0x1c')]);_0x3a1fb6['offset']=qs['offset'](_0x51810d[_0xe8f9('0x2e')][_0xe8f9('0x1a')]);}_0x3a1fb6[_0xe8f9('0x35')]=qs[_0xe8f9('0x36')](_0x51810d[_0xe8f9('0x2e')][_0xe8f9('0x36')]);_0x3a1fb6[_0xe8f9('0x37')]=qs[_0xe8f9('0x30')](_[_0xe8f9('0x38')](_0x51810d[_0xe8f9('0x2e')],_0x40d5b8[_0xe8f9('0x30')]),_0x26af41);if(_0x51810d[_0xe8f9('0x2e')][_0xe8f9('0x39')]){_0x3a1fb6['where']=_['merge'](_0x3a1fb6['where'],{'$or':_[_0xe8f9('0x29')](_0x26af41,function(_0x23791f){if(_0x23791f['type']!==_0xe8f9('0x3a')){var _0x260892={};_0x260892[_0x23791f[_0xe8f9('0x26')]]={'$like':'%'+_0x51810d[_0xe8f9('0x2e')]['filter']+'%'};return _0x260892;}})});}_0x3a1fb6=_[_0xe8f9('0x3b')]({},_0x3a1fb6,_0x51810d[_0xe8f9('0x3c')]);var _0x82f308={'where':_0x3a1fb6[_0xe8f9('0x37')]};return db[_0xe8f9('0x3d')][_0xe8f9('0x1d')](_0x82f308)[_0xe8f9('0x22')](function(_0x58380c){_0x3f7725[_0xe8f9('0x1d')]=_0x58380c;if(_0x51810d[_0xe8f9('0x2e')][_0xe8f9('0x3e')]){_0x3a1fb6[_0xe8f9('0x3f')]=[{'all':!![]}];}return db[_0xe8f9('0x3d')][_0xe8f9('0x40')](_0x3a1fb6);})['then'](function(_0x5b9ef7){_0x3f7725[_0xe8f9('0x41')]=_0x5b9ef7;return _0x3f7725;})[_0xe8f9('0x22')](respondWithFilteredResult(_0x46c798,_0x3a1fb6))[_0xe8f9('0x42')](handleError(_0x46c798,null));};exports['show']=function(_0x251dae,_0x1fe550){var _0x41d003={'raw':![],'where':{'id':_0x251dae[_0xe8f9('0x43')]['id']}},_0x4c6a11={};_0x4c6a11[_0xe8f9('0x2d')]=_[_0xe8f9('0x2f')](db['SalesforceConfiguration'][_0xe8f9('0x2a')]);_0x4c6a11['query']=_[_0xe8f9('0x2f')](_0x251dae[_0xe8f9('0x2e')]);_0x4c6a11['filters']=_['intersection'](_0x4c6a11['model'],_0x4c6a11[_0xe8f9('0x2e')]);_0x41d003['attributes']=_[_0xe8f9('0x31')](_0x4c6a11['model'],qs['fields'](_0x251dae['query'][_0xe8f9('0x44')]));_0x41d003['attributes']=_0x41d003['attributes']['length']?_0x41d003['attributes']:_0x4c6a11['model'];if(_0x251dae[_0xe8f9('0x2e')][_0xe8f9('0x3e')]){_0x41d003[_0xe8f9('0x3f')]=[{'all':!![]}];}_0x41d003=_['merge']({},_0x41d003,_0x251dae[_0xe8f9('0x3c')]);return db[_0xe8f9('0x3d')][_0xe8f9('0x45')](_0x41d003)['then'](handleEntityNotFound(_0x1fe550,null))[_0xe8f9('0x22')](respondWithResult(_0x1fe550,null))[_0xe8f9('0x42')](handleError(_0x1fe550,null));};exports[_0xe8f9('0x46')]=function(_0x4df7b3,_0x28630a){return db[_0xe8f9('0x3d')]['create'](_0x4df7b3[_0xe8f9('0x47')],{})[_0xe8f9('0x22')](respondWithResult(_0x28630a,0xc9))[_0xe8f9('0x42')](handleError(_0x28630a,null));};exports[_0xe8f9('0x21')]=function(_0x1b4a80,_0x407e67){if(_0x1b4a80['body']['id']){delete _0x1b4a80['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x1b4a80[_0xe8f9('0x43')]['id']}})[_0xe8f9('0x22')](handleEntityNotFound(_0x407e67,null))[_0xe8f9('0x22')](saveUpdates(_0x1b4a80[_0xe8f9('0x47')],null))[_0xe8f9('0x22')](respondWithResult(_0x407e67,null))[_0xe8f9('0x42')](handleError(_0x407e67,null));};exports['destroy']=function(_0x44c0cd,_0x3bce85){return db['SalesforceConfiguration'][_0xe8f9('0x45')]({'where':{'id':_0x44c0cd[_0xe8f9('0x43')]['id']}})[_0xe8f9('0x22')](handleEntityNotFound(_0x3bce85,null))[_0xe8f9('0x22')](removeEntity(_0x3bce85,null))[_0xe8f9('0x42')](handleError(_0x3bce85,null));};exports[_0xe8f9('0x48')]=function(_0x51c6d4,_0x2abbb1,_0x565f34){var _0x78d845={};var _0x286588={};var _0x4bff86;var _0x4ac731;return db[_0xe8f9('0x3d')][_0xe8f9('0x49')]({'where':{'id':_0x51c6d4[_0xe8f9('0x43')]['id']}})['then'](handleEntityNotFound(_0x2abbb1,null))[_0xe8f9('0x22')](function(_0x2eaec5){if(_0x2eaec5){_0x4bff86=_0x2eaec5;_0x286588[_0xe8f9('0x2d')]=_[_0xe8f9('0x2f')](db[_0xe8f9('0x4a')][_0xe8f9('0x2a')]);_0x286588['query']=_['keys'](_0x51c6d4['query']);_0x286588[_0xe8f9('0x30')]=_[_0xe8f9('0x31')](_0x286588[_0xe8f9('0x2d')],_0x286588[_0xe8f9('0x2e')]);_0x78d845[_0xe8f9('0x32')]=_['intersection'](_0x286588[_0xe8f9('0x2d')],qs[_0xe8f9('0x44')](_0x51c6d4[_0xe8f9('0x2e')][_0xe8f9('0x44')]));_0x78d845[_0xe8f9('0x32')]=_0x78d845[_0xe8f9('0x32')][_0xe8f9('0x33')]?_0x78d845[_0xe8f9('0x32')]:_0x286588[_0xe8f9('0x2d')];_0x78d845[_0xe8f9('0x35')]=qs[_0xe8f9('0x36')](_0x51c6d4['query'][_0xe8f9('0x36')]);_0x78d845[_0xe8f9('0x37')]=qs[_0xe8f9('0x30')](_[_0xe8f9('0x38')](_0x51c6d4['query'],_0x286588[_0xe8f9('0x30')]));if(_0x51c6d4[_0xe8f9('0x2e')][_0xe8f9('0x39')]){_0x78d845[_0xe8f9('0x37')]=_[_0xe8f9('0x3b')](_0x78d845[_0xe8f9('0x37')],{'$or':_[_0xe8f9('0x29')](_0x78d845[_0xe8f9('0x32')],function(_0x2f0b03){var _0xcdbffc={};_0xcdbffc[_0x2f0b03]={'$like':'%'+_0x51c6d4[_0xe8f9('0x2e')][_0xe8f9('0x39')]+'%'};return _0xcdbffc;})});}_0x78d845=_['merge']({},_0x78d845,_0x51c6d4[_0xe8f9('0x3c')]);return _0x4bff86[_0xe8f9('0x48')](_0x78d845);}})['then'](function(_0x385d91){if(_0x385d91){_0x4ac731=_0x385d91[_0xe8f9('0x33')];if(!_0x51c6d4['query']['hasOwnProperty'](_0xe8f9('0x34'))){_0x78d845[_0xe8f9('0x1c')]=qs[_0xe8f9('0x1c')](_0x51c6d4[_0xe8f9('0x2e')]['limit']);_0x78d845[_0xe8f9('0x1a')]=qs['offset'](_0x51c6d4[_0xe8f9('0x2e')][_0xe8f9('0x1a')]);}return _0x4bff86['getFields'](_0x78d845);}})[_0xe8f9('0x22')](function(_0x5f5097){if(_0x5f5097){return _0x5f5097?{'count':_0x4ac731,'rows':_0x5f5097}:null;}})[_0xe8f9('0x22')](respondWithResult(_0x2abbb1,null))[_0xe8f9('0x42')](handleError(_0x2abbb1,null));};exports['getSubjects']=function(_0x2a6288,_0x294671,_0x2a2b0c){var _0x3645d8={};var _0x125479={};var _0x3897ef;var _0x490c2e;return db['SalesforceConfiguration'][_0xe8f9('0x49')]({'where':{'id':_0x2a6288[_0xe8f9('0x43')]['id']}})['then'](handleEntityNotFound(_0x294671,null))[_0xe8f9('0x22')](function(_0x3c443f){if(_0x3c443f){_0x3897ef=_0x3c443f;_0x125479[_0xe8f9('0x2d')]=_[_0xe8f9('0x2f')](db[_0xe8f9('0x4a')][_0xe8f9('0x2a')]);_0x125479['query']=_[_0xe8f9('0x2f')](_0x2a6288['query']);_0x125479[_0xe8f9('0x30')]=_['intersection'](_0x125479[_0xe8f9('0x2d')],_0x125479['query']);_0x3645d8[_0xe8f9('0x32')]=_['intersection'](_0x125479[_0xe8f9('0x2d')],qs[_0xe8f9('0x44')](_0x2a6288[_0xe8f9('0x2e')][_0xe8f9('0x44')]));_0x3645d8['attributes']=_0x3645d8[_0xe8f9('0x32')][_0xe8f9('0x33')]?_0x3645d8[_0xe8f9('0x32')]:_0x125479[_0xe8f9('0x2d')];_0x3645d8[_0xe8f9('0x35')]=qs[_0xe8f9('0x36')](_0x2a6288[_0xe8f9('0x2e')][_0xe8f9('0x36')]);_0x3645d8['where']=qs[_0xe8f9('0x30')](_['pick'](_0x2a6288['query'],_0x125479[_0xe8f9('0x30')]));if(_0x2a6288[_0xe8f9('0x2e')][_0xe8f9('0x39')]){_0x3645d8['where']=_[_0xe8f9('0x3b')](_0x3645d8['where'],{'$or':_[_0xe8f9('0x29')](_0x3645d8[_0xe8f9('0x32')],function(_0x5e4078){var _0x495bb6={};_0x495bb6[_0x5e4078]={'$like':'%'+_0x2a6288[_0xe8f9('0x2e')][_0xe8f9('0x39')]+'%'};return _0x495bb6;})});}_0x3645d8=_['merge']({},_0x3645d8,_0x2a6288[_0xe8f9('0x3c')]);return _0x3897ef[_0xe8f9('0x4b')](_0x3645d8);}})[_0xe8f9('0x22')](function(_0x2bc07b){if(_0x2bc07b){_0x490c2e=_0x2bc07b[_0xe8f9('0x33')];if(!_0x2a6288[_0xe8f9('0x2e')]['hasOwnProperty'](_0xe8f9('0x34'))){_0x3645d8[_0xe8f9('0x1c')]=qs[_0xe8f9('0x1c')](_0x2a6288[_0xe8f9('0x2e')][_0xe8f9('0x1c')]);_0x3645d8[_0xe8f9('0x1a')]=qs[_0xe8f9('0x1a')](_0x2a6288[_0xe8f9('0x2e')][_0xe8f9('0x1a')]);}return _0x3897ef[_0xe8f9('0x4b')](_0x3645d8);}})[_0xe8f9('0x22')](function(_0x239ce4){if(_0x239ce4){return _0x239ce4?{'count':_0x490c2e,'rows':_0x239ce4}:null;}})[_0xe8f9('0x22')](respondWithResult(_0x294671,null))['catch'](handleError(_0x294671,null));};exports[_0xe8f9('0x4c')]=function(_0x4df62f,_0x156edb,_0x434657){var _0x544430={};var _0x27f4fb={};var _0x57963e;var _0x517226;return db[_0xe8f9('0x3d')][_0xe8f9('0x49')]({'where':{'id':_0x4df62f['params']['id']}})[_0xe8f9('0x22')](handleEntityNotFound(_0x156edb,null))['then'](function(_0x1ad87d){if(_0x1ad87d){_0x57963e=_0x1ad87d;_0x27f4fb['model']=_[_0xe8f9('0x2f')](db[_0xe8f9('0x4a')][_0xe8f9('0x2a')]);_0x27f4fb[_0xe8f9('0x2e')]=_[_0xe8f9('0x2f')](_0x4df62f['query']);_0x27f4fb[_0xe8f9('0x30')]=_['intersection'](_0x27f4fb['model'],_0x27f4fb[_0xe8f9('0x2e')]);_0x544430['attributes']=_[_0xe8f9('0x31')](_0x27f4fb[_0xe8f9('0x2d')],qs[_0xe8f9('0x44')](_0x4df62f[_0xe8f9('0x2e')][_0xe8f9('0x44')]));_0x544430[_0xe8f9('0x32')]=_0x544430[_0xe8f9('0x32')][_0xe8f9('0x33')]?_0x544430['attributes']:_0x27f4fb[_0xe8f9('0x2d')];_0x544430[_0xe8f9('0x35')]=qs[_0xe8f9('0x36')](_0x4df62f[_0xe8f9('0x2e')][_0xe8f9('0x36')]);_0x544430[_0xe8f9('0x37')]=qs[_0xe8f9('0x30')](_['pick'](_0x4df62f[_0xe8f9('0x2e')],_0x27f4fb[_0xe8f9('0x30')]));if(_0x4df62f[_0xe8f9('0x2e')][_0xe8f9('0x39')]){_0x544430[_0xe8f9('0x37')]=_[_0xe8f9('0x3b')](_0x544430[_0xe8f9('0x37')],{'$or':_[_0xe8f9('0x29')](_0x544430[_0xe8f9('0x32')],function(_0xdea43a){var _0x198c4d={};_0x198c4d[_0xdea43a]={'$like':'%'+_0x4df62f[_0xe8f9('0x2e')]['filter']+'%'};return _0x198c4d;})});}_0x544430=_['merge']({},_0x544430,_0x4df62f['options']);return _0x57963e['getDescriptions'](_0x544430);}})['then'](function(_0xb87e6c){if(_0xb87e6c){_0x517226=_0xb87e6c[_0xe8f9('0x33')];if(!_0x4df62f['query'][_0xe8f9('0x4d')](_0xe8f9('0x34'))){_0x544430[_0xe8f9('0x1c')]=qs[_0xe8f9('0x1c')](_0x4df62f[_0xe8f9('0x2e')][_0xe8f9('0x1c')]);_0x544430[_0xe8f9('0x1a')]=qs[_0xe8f9('0x1a')](_0x4df62f[_0xe8f9('0x2e')][_0xe8f9('0x1a')]);}return _0x57963e[_0xe8f9('0x4c')](_0x544430);}})[_0xe8f9('0x22')](function(_0x33e203){if(_0x33e203){return _0x33e203?{'count':_0x517226,'rows':_0x33e203}:null;}})[_0xe8f9('0x22')](respondWithResult(_0x156edb,null))[_0xe8f9('0x42')](handleError(_0x156edb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7d264bf..5eecfe7 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 _0x9f7a=['define','SalesforceConfiguration','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0x9f7a,0x1ba));var _0xa9f7=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x9f7a[_0x1203f];return _0x365f0a;};'use strict';var _=require('lodash');var util=require(_0xa9f7('0x0'));var logger=require(_0xa9f7('0x1'))(_0xa9f7('0x2'));var moment=require(_0xa9f7('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9f7('0x5'));var config=require(_0xa9f7('0x6'));var attributes=require(_0xa9f7('0x7'));module[_0xa9f7('0x8')]=function(_0x529d30,_0xdec0ae){return _0x529d30[_0xa9f7('0x9')](_0xa9f7('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f5a=['moment','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x472bf4,_0x5117a3){var _0x12ca6b=function(_0x29ace0){while(--_0x29ace0){_0x472bf4['push'](_0x472bf4['shift']());}};_0x12ca6b(++_0x5117a3);}(_0x6f5a,0x1cb));var _0xa6f5=function(_0xb8d639,_0x1fadbe){_0xb8d639=_0xb8d639-0x0;var _0x1d5e19=_0x6f5a[_0xb8d639];return _0x1d5e19;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var logger=require(_0xa6f5('0x2'))('api');var moment=require(_0xa6f5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f5('0x4'));var rimraf=require(_0xa6f5('0x5'));var config=require(_0xa6f5('0x6'));var attributes=require(_0xa6f5('0x7'));module[_0xa6f5('0x8')]=function(_0x4cf735,_0x21be4d){return _0x4cf735[_0xa6f5('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0xa6f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 80bc2de..a31f13d 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 _0x8959=['message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1dd78b,_0x213fd9){var _0x2d9bf6=function(_0x2c749a){while(--_0x2c749a){_0x1dd78b['push'](_0x1dd78b['shift']());}};_0x2d9bf6(++_0x213fd9);}(_0x8959,0x13e));var _0x9895=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x8959[_0x515afd];return _0x536d53;};'use strict';var _=require('lodash');var util=require(_0x9895('0x0'));var moment=require(_0x9895('0x1'));var BPromise=require('bluebird');var rs=require(_0x9895('0x2'));var fs=require('fs');var Redis=require(_0x9895('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9895('0x4'));var logger=require(_0x9895('0x5'))(_0x9895('0x6'));var config=require(_0x9895('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37a305,_0x522458,_0x7306e4){return new BPromise(function(_0x43eec3,_0x1f7ccc){return client[_0x9895('0x8')](_0x37a305,_0x7306e4)[_0x9895('0x9')](function(_0x2df17c){logger[_0x9895('0xa')](_0x9895('0xb'),_0x522458,_0x9895('0xc'));logger[_0x9895('0xd')](_0x9895('0xe'),_0x522458,_0x9895('0xc'),JSON[_0x9895('0xf')](_0x2df17c));if(_0x2df17c[_0x9895('0x10')]){if(_0x2df17c[_0x9895('0x10')][_0x9895('0x11')]===0x1f4){logger['error'](_0x9895('0xb'),_0x522458,_0x2df17c[_0x9895('0x10')][_0x9895('0x12')]);return _0x1f7ccc(_0x2df17c[_0x9895('0x10')][_0x9895('0x12')]);}logger[_0x9895('0x10')](_0x9895('0xb'),_0x522458,_0x2df17c[_0x9895('0x10')][_0x9895('0x12')]);return _0x43eec3(_0x2df17c[_0x9895('0x10')][_0x9895('0x12')]);}else{logger[_0x9895('0xa')](_0x9895('0xb'),_0x522458,_0x9895('0xc'));_0x43eec3(_0x2df17c[_0x9895('0x13')]['message']);}})[_0x9895('0x14')](function(_0x102d72){logger[_0x9895('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x522458,_0x102d72);_0x1f7ccc(_0x102d72);});});} \ No newline at end of file +var _0x5147=['client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x7468ea,_0x32443e){var _0x5ee951=function(_0xfa242e){while(--_0xfa242e){_0x7468ea['push'](_0x7468ea['shift']());}};_0x5ee951(++_0x32443e);}(_0x5147,0xbf));var _0x7514=function(_0x3b4d32,_0x38e24b){_0x3b4d32=_0x3b4d32-0x0;var _0x6feb4c=_0x5147[_0x3b4d32];return _0x6feb4c;};'use strict';var _=require(_0x7514('0x0'));var util=require(_0x7514('0x1'));var moment=require('moment');var BPromise=require(_0x7514('0x2'));var rs=require(_0x7514('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7514('0x4'));var logger=require(_0x7514('0x5'))(_0x7514('0x6'));var config=require(_0x7514('0x7'));var jayson=require(_0x7514('0x8'));var client=jayson[_0x7514('0x9')][_0x7514('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2efee1,_0x4c1f91,_0x4eec40){return new BPromise(function(_0x1e8414,_0x2b684e){return client['request'](_0x2efee1,_0x4eec40)[_0x7514('0xb')](function(_0x42e714){logger[_0x7514('0xc')](_0x7514('0xd'),_0x4c1f91,_0x7514('0xe'));logger[_0x7514('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4c1f91,_0x7514('0xe'),JSON[_0x7514('0x10')](_0x42e714));if(_0x42e714[_0x7514('0x11')]){if(_0x42e714[_0x7514('0x11')]['code']===0x1f4){logger[_0x7514('0x11')](_0x7514('0xd'),_0x4c1f91,_0x42e714[_0x7514('0x11')]['message']);return _0x2b684e(_0x42e714[_0x7514('0x11')][_0x7514('0x12')]);}logger[_0x7514('0x11')](_0x7514('0xd'),_0x4c1f91,_0x42e714[_0x7514('0x11')][_0x7514('0x12')]);return _0x1e8414(_0x42e714['error'][_0x7514('0x12')]);}else{logger[_0x7514('0xc')](_0x7514('0xd'),_0x4c1f91,_0x7514('0xe'));_0x1e8414(_0x42e714['result'][_0x7514('0x12')]);}})[_0x7514('0x13')](function(_0x63a494){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4c1f91,_0x63a494);_0x2b684e(_0x63a494);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 4f62d4c..751371a 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 _0x461d=['update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','create'];(function(_0x2d8cbd,_0x244b00){var _0x39b157=function(_0x5e3b00){while(--_0x5e3b00){_0x2d8cbd['push'](_0x2d8cbd['shift']());}};_0x39b157(++_0x244b00);}(_0x461d,0x93));var _0xd461=function(_0x5db40f,_0x2e4fe0){_0x5db40f=_0x5db40f-0x0;var _0x202db2=_0x461d[_0x5db40f];return _0x202db2;};'use strict';var multer=require('multer');var util=require(_0xd461('0x0'));var path=require(_0xd461('0x1'));var timeout=require('connect-timeout');var express=require(_0xd461('0x2'));var router=express['Router']();var fs_extra=require(_0xd461('0x3'));var auth=require(_0xd461('0x4'));var interaction=require(_0xd461('0x5'));var config=require(_0xd461('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd461('0x7')]);router['get'](_0xd461('0x8'),auth[_0xd461('0x9')](),controller[_0xd461('0xa')]);router[_0xd461('0xb')]('/',auth[_0xd461('0x9')](),controller[_0xd461('0xc')]);router['put'](_0xd461('0x8'),auth['isAuthenticated'](),controller[_0xd461('0xd')]);router['delete'](_0xd461('0x8'),auth[_0xd461('0x9')](),controller[_0xd461('0xe')]);module[_0xd461('0xf')]=router; \ No newline at end of file +var _0xa9ce=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util'];(function(_0x3af114,_0x372d13){var _0xa89ba9=function(_0x4eefa8){while(--_0x4eefa8){_0x3af114['push'](_0x3af114['shift']());}};_0xa89ba9(++_0x372d13);}(_0xa9ce,0x1cc));var _0xea9c=function(_0x33a174,_0x459c53){_0x33a174=_0x33a174-0x0;var _0x26b90d=_0xa9ce[_0x33a174];return _0x26b90d;};'use strict';var multer=require(_0xea9c('0x0'));var util=require(_0xea9c('0x1'));var path=require(_0xea9c('0x2'));var timeout=require(_0xea9c('0x3'));var express=require('express');var router=express[_0xea9c('0x4')]();var fs_extra=require(_0xea9c('0x5'));var auth=require(_0xea9c('0x6'));var interaction=require(_0xea9c('0x7'));var config=require(_0xea9c('0x8'));var controller=require(_0xea9c('0x9'));router[_0xea9c('0xa')]('/',auth[_0xea9c('0xb')](),controller[_0xea9c('0xc')]);router[_0xea9c('0xa')]('/:id',auth[_0xea9c('0xb')](),controller[_0xea9c('0xd')]);router[_0xea9c('0xe')]('/',auth[_0xea9c('0xb')](),controller[_0xea9c('0xf')]);router[_0xea9c('0x10')](_0xea9c('0x11'),auth[_0xea9c('0xb')](),controller[_0xea9c('0x12')]);router[_0xea9c('0x13')](_0xea9c('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xea9c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 1ea8790..04cbfc7 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 _0xfb4b=['keyValue','picklist','string','STRING','ENUM','sequelize','exports','variable','customVariable'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xfb4b,0x176));var _0xbfb4=function(_0xef6ada,_0x3dfb73){_0xef6ada=_0xef6ada-0x0;var _0x550e4f=_0xfb4b[_0xef6ada];return _0x550e4f;};'use strict';var Sequelize=require(_0xbfb4('0x0'));module[_0xbfb4('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xbfb4('0x2'),_0xbfb4('0x3'),_0xbfb4('0x4'),_0xbfb4('0x5')),'defaultValue':_0xbfb4('0x6')},'content':{'type':Sequelize[_0xbfb4('0x7')]},'key':{'type':Sequelize[_0xbfb4('0x7')]},'keyType':{'type':Sequelize[_0xbfb4('0x8')](_0xbfb4('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xbfb4('0x7')]},'idField':{'type':Sequelize[_0xbfb4('0x7')]},'variableName':{'type':Sequelize[_0xbfb4('0x7')]}}; \ No newline at end of file +var _0x7ea1=['exports','ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x7ea1,0xbd));var _0x17ea=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0x7ea1[_0x1b2422];return _0x376573;};'use strict';var Sequelize=require('sequelize');module[_0x17ea('0x0')]={'type':{'type':Sequelize[_0x17ea('0x1')](_0x17ea('0x2'),_0x17ea('0x3'),'customVariable','keyValue',_0x17ea('0x4')),'defaultValue':_0x17ea('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x17ea('0x5')]},'keyType':{'type':Sequelize[_0x17ea('0x1')](_0x17ea('0x2'),_0x17ea('0x3'),_0x17ea('0x6'))},'keyContent':{'type':Sequelize[_0x17ea('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index eff204c..dfec016 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 _0x45aa=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','error','name','send','index','map','SalesforceField','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x45aa,0x91));var _0xa45a=function(_0x5e56f3,_0x107965){_0x5e56f3=_0x5e56f3-0x0;var _0x356077=_0x45aa[_0x5e56f3];return _0x356077;};'use strict';var emlformat=require(_0xa45a('0x0'));var rimraf=require(_0xa45a('0x1'));var zipdir=require(_0xa45a('0x2'));var jsonpatch=require(_0xa45a('0x3'));var rp=require(_0xa45a('0x4'));var moment=require('moment');var BPromise=require(_0xa45a('0x5'));var Mustache=require(_0xa45a('0x6'));var util=require(_0xa45a('0x7'));var path=require('path');var sox=require(_0xa45a('0x8'));var csv=require('to-csv');var ejs=require(_0xa45a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa45a('0xa'));var squel=require(_0xa45a('0xb'));var crypto=require(_0xa45a('0xc'));var jsforce=require(_0xa45a('0xd'));var deskjs=require(_0xa45a('0xe'));var toCsv=require(_0xa45a('0xf'));var querystring=require('querystring');var Papa=require(_0xa45a('0x10'));var Redis=require(_0xa45a('0x11'));var authService=require(_0xa45a('0x12'));var qs=require(_0xa45a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa45a('0x14'));var utils=require('../../config/utils');var config=require(_0xa45a('0x15'));var licenseUtil=require(_0xa45a('0x16'));var db=require(_0xa45a('0x17'))['db'];function respondWithStatusCode(_0x5b2404,_0x27a7c0){_0x27a7c0=_0x27a7c0||0xcc;return function(_0x3aeead){if(_0x3aeead){return _0x5b2404[_0xa45a('0x18')](_0x27a7c0);}return _0x5b2404[_0xa45a('0x19')](_0x27a7c0)[_0xa45a('0x1a')]();};}function respondWithResult(_0x5ed5ed,_0x32f711){_0x32f711=_0x32f711||0xc8;return function(_0x454ef5){if(_0x454ef5){return _0x5ed5ed['status'](_0x32f711)['json'](_0x454ef5);}};}function respondWithFilteredResult(_0x36d8be,_0x5e4f33){return function(_0x148810){if(_0x148810){var _0x2fa858=typeof _0x5e4f33[_0xa45a('0x1b')]==='undefined'&&typeof _0x5e4f33[_0xa45a('0x1c')]==='undefined';var _0x4b99ab=_0x148810['count'];var _0x1074e8=_0x2fa858?0x0:_0x5e4f33[_0xa45a('0x1b')];var _0x35165b=_0x2fa858?_0x148810['count']:_0x5e4f33[_0xa45a('0x1b')]+_0x5e4f33[_0xa45a('0x1c')];var _0x224418;if(_0x35165b>=_0x4b99ab){_0x35165b=_0x4b99ab;_0x224418=0xc8;}else{_0x224418=0xce;}_0x36d8be[_0xa45a('0x19')](_0x224418);return _0x36d8be['set'](_0xa45a('0x1d'),_0x1074e8+'-'+_0x35165b+'/'+_0x4b99ab)[_0xa45a('0x1e')](_0x148810);}return null;};}function patchUpdates(_0x3f1842){return function(_0x204400){try{jsonpatch[_0xa45a('0x1f')](_0x204400,_0x3f1842,!![]);}catch(_0x7160ec){return BPromise[_0xa45a('0x20')](_0x7160ec);}return _0x204400[_0xa45a('0x21')]();};}function saveUpdates(_0x45cf4a,_0x5c9724){return function(_0x2227cf){if(_0x2227cf){return _0x2227cf['update'](_0x45cf4a)['then'](function(_0x30403f){return _0x30403f;});}return null;};}function removeEntity(_0x3104fc,_0x3037fb){return function(_0x1ffc49){if(_0x1ffc49){return _0x1ffc49['destroy']()['then'](function(){_0x3104fc[_0xa45a('0x19')](0xcc)[_0xa45a('0x1a')]();});}};}function handleEntityNotFound(_0xc6d862,_0x55a028){return function(_0x4846be){if(!_0x4846be){_0xc6d862[_0xa45a('0x18')](0x194);}return _0x4846be;};}function handleError(_0x437472,_0x4cbef9){_0x4cbef9=_0x4cbef9||0x1f4;return function(_0xf7f4b7){logger[_0xa45a('0x22')](_0xf7f4b7['stack']);if(_0xf7f4b7['name']){delete _0xf7f4b7[_0xa45a('0x23')];}_0x437472['status'](_0x4cbef9)[_0xa45a('0x24')](_0xf7f4b7);};}exports[_0xa45a('0x25')]=function(_0x40babe,_0x454ca8){var _0x41987c={},_0x36dcf2={},_0x39adc2={'count':0x0,'rows':[]};var _0x4af8ca=_[_0xa45a('0x26')](db[_0xa45a('0x27')]['rawAttributes'],function(_0x51eee2){return{'name':_0x51eee2['fieldName'],'type':_0x51eee2[_0xa45a('0x28')]['key']};});_0x36dcf2['model']=_[_0xa45a('0x26')](_0x4af8ca,_0xa45a('0x23'));_0x36dcf2[_0xa45a('0x29')]=_[_0xa45a('0x2a')](_0x40babe['query']);_0x36dcf2[_0xa45a('0x2b')]=_[_0xa45a('0x2c')](_0x36dcf2[_0xa45a('0x2d')],_0x36dcf2[_0xa45a('0x29')]);_0x41987c[_0xa45a('0x2e')]=_['intersection'](_0x36dcf2[_0xa45a('0x2d')],qs[_0xa45a('0x2f')](_0x40babe['query'][_0xa45a('0x2f')]));_0x41987c[_0xa45a('0x2e')]=_0x41987c['attributes']['length']?_0x41987c['attributes']:_0x36dcf2[_0xa45a('0x2d')];if(!_0x40babe[_0xa45a('0x29')]['hasOwnProperty'](_0xa45a('0x30'))){_0x41987c[_0xa45a('0x1c')]=qs['limit'](_0x40babe[_0xa45a('0x29')][_0xa45a('0x1c')]);_0x41987c[_0xa45a('0x1b')]=qs['offset'](_0x40babe[_0xa45a('0x29')]['offset']);}_0x41987c[_0xa45a('0x31')]=qs[_0xa45a('0x32')](_0x40babe['query']['sort']);_0x41987c[_0xa45a('0x33')]=qs[_0xa45a('0x2b')](_['pick'](_0x40babe[_0xa45a('0x29')],_0x36dcf2['filters']),_0x4af8ca);if(_0x40babe[_0xa45a('0x29')][_0xa45a('0x34')]){_0x41987c[_0xa45a('0x33')]=_[_0xa45a('0x35')](_0x41987c[_0xa45a('0x33')],{'$or':_[_0xa45a('0x26')](_0x4af8ca,function(_0x20efd3){if(_0x20efd3[_0xa45a('0x28')]!==_0xa45a('0x36')){var _0x531f7d={};_0x531f7d[_0x20efd3[_0xa45a('0x23')]]={'$like':'%'+_0x40babe[_0xa45a('0x29')][_0xa45a('0x34')]+'%'};return _0x531f7d;}})});}_0x41987c=_[_0xa45a('0x35')]({},_0x41987c,_0x40babe[_0xa45a('0x37')]);var _0x1f1711={'where':_0x41987c[_0xa45a('0x33')]};return db[_0xa45a('0x27')][_0xa45a('0x38')](_0x1f1711)[_0xa45a('0x39')](function(_0x97df1e){_0x39adc2[_0xa45a('0x38')]=_0x97df1e;if(_0x40babe['query'][_0xa45a('0x3a')]){_0x41987c[_0xa45a('0x3b')]=[{'all':!![]}];}return db[_0xa45a('0x27')][_0xa45a('0x3c')](_0x41987c);})[_0xa45a('0x39')](function(_0x3b2150){_0x39adc2[_0xa45a('0x3d')]=_0x3b2150;return _0x39adc2;})['then'](respondWithFilteredResult(_0x454ca8,_0x41987c))[_0xa45a('0x3e')](handleError(_0x454ca8,null));};exports[_0xa45a('0x3f')]=function(_0x54f987,_0x2c94cc){var _0x2e2f2d={'raw':!![],'where':{'id':_0x54f987[_0xa45a('0x40')]['id']}},_0x3ba4a1={};_0x3ba4a1[_0xa45a('0x2d')]=_['keys'](db[_0xa45a('0x27')][_0xa45a('0x41')]);_0x3ba4a1['query']=_['keys'](_0x54f987[_0xa45a('0x29')]);_0x3ba4a1[_0xa45a('0x2b')]=_[_0xa45a('0x2c')](_0x3ba4a1[_0xa45a('0x2d')],_0x3ba4a1[_0xa45a('0x29')]);_0x2e2f2d[_0xa45a('0x2e')]=_['intersection'](_0x3ba4a1[_0xa45a('0x2d')],qs[_0xa45a('0x2f')](_0x54f987[_0xa45a('0x29')][_0xa45a('0x2f')]));_0x2e2f2d[_0xa45a('0x2e')]=_0x2e2f2d[_0xa45a('0x2e')][_0xa45a('0x42')]?_0x2e2f2d[_0xa45a('0x2e')]:_0x3ba4a1[_0xa45a('0x2d')];if(_0x54f987['query']['includeAll']){_0x2e2f2d[_0xa45a('0x3b')]=[{'all':!![]}];}_0x2e2f2d=_[_0xa45a('0x35')]({},_0x2e2f2d,_0x54f987[_0xa45a('0x37')]);return db[_0xa45a('0x27')][_0xa45a('0x43')](_0x2e2f2d)[_0xa45a('0x39')](handleEntityNotFound(_0x2c94cc,null))['then'](respondWithResult(_0x2c94cc,null))['catch'](handleError(_0x2c94cc,null));};exports[_0xa45a('0x44')]=function(_0x2e31f4,_0x489307){return db[_0xa45a('0x27')][_0xa45a('0x44')](_0x2e31f4[_0xa45a('0x45')],{})[_0xa45a('0x39')](respondWithResult(_0x489307,0xc9))[_0xa45a('0x3e')](handleError(_0x489307,null));};exports['update']=function(_0x5c2b19,_0x9847b4){if(_0x5c2b19[_0xa45a('0x45')]['id']){delete _0x5c2b19['body']['id'];}return db['SalesforceField'][_0xa45a('0x43')]({'where':{'id':_0x5c2b19[_0xa45a('0x40')]['id']}})[_0xa45a('0x39')](handleEntityNotFound(_0x9847b4,null))[_0xa45a('0x39')](saveUpdates(_0x5c2b19[_0xa45a('0x45')],null))[_0xa45a('0x39')](respondWithResult(_0x9847b4,null))[_0xa45a('0x3e')](handleError(_0x9847b4,null));};exports[_0xa45a('0x46')]=function(_0x44dd80,_0x1338c5){return db[_0xa45a('0x27')][_0xa45a('0x43')]({'where':{'id':_0x44dd80[_0xa45a('0x40')]['id']}})['then'](handleEntityNotFound(_0x1338c5,null))[_0xa45a('0x39')](removeEntity(_0x1338c5,null))[_0xa45a('0x3e')](handleError(_0x1338c5,null));}; \ No newline at end of file +var _0x19dd=['VIRTUAL','name','merge','options','SalesforceField','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','send','map','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x1b4081,_0x2fa14c){var _0x1bd6d8=function(_0xf83646){while(--_0xf83646){_0x1b4081['push'](_0x1b4081['shift']());}};_0x1bd6d8(++_0x2fa14c);}(_0x19dd,0x19a));var _0xd19d=function(_0x250774,_0x4d905c){_0x250774=_0x250774-0x0;var _0x793820=_0x19dd[_0x250774];return _0x793820;};'use strict';var emlformat=require(_0xd19d('0x0'));var rimraf=require(_0xd19d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd19d('0x2'));var rp=require(_0xd19d('0x3'));var moment=require(_0xd19d('0x4'));var BPromise=require(_0xd19d('0x5'));var Mustache=require(_0xd19d('0x6'));var util=require(_0xd19d('0x7'));var path=require(_0xd19d('0x8'));var sox=require(_0xd19d('0x9'));var csv=require(_0xd19d('0xa'));var ejs=require(_0xd19d('0xb'));var fs=require('fs');var fs_extra=require(_0xd19d('0xc'));var _=require(_0xd19d('0xd'));var squel=require(_0xd19d('0xe'));var crypto=require(_0xd19d('0xf'));var jsforce=require(_0xd19d('0x10'));var deskjs=require(_0xd19d('0x11'));var toCsv=require(_0xd19d('0xa'));var querystring=require(_0xd19d('0x12'));var Papa=require(_0xd19d('0x13'));var Redis=require(_0xd19d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd19d('0x15'));var as=require(_0xd19d('0x16'));var hardwareService=require(_0xd19d('0x17'));var logger=require(_0xd19d('0x18'))('api');var utils=require(_0xd19d('0x19'));var config=require(_0xd19d('0x1a'));var licenseUtil=require(_0xd19d('0x1b'));var db=require(_0xd19d('0x1c'))['db'];function respondWithStatusCode(_0x4661af,_0x351db9){_0x351db9=_0x351db9||0xcc;return function(_0x4df319){if(_0x4df319){return _0x4661af[_0xd19d('0x1d')](_0x351db9);}return _0x4661af[_0xd19d('0x1e')](_0x351db9)[_0xd19d('0x1f')]();};}function respondWithResult(_0x37088e,_0x572348){_0x572348=_0x572348||0xc8;return function(_0xf96267){if(_0xf96267){return _0x37088e[_0xd19d('0x1e')](_0x572348)[_0xd19d('0x20')](_0xf96267);}};}function respondWithFilteredResult(_0x3b9d43,_0x2d3789){return function(_0x672b08){if(_0x672b08){var _0x5a621a=typeof _0x2d3789[_0xd19d('0x21')]===_0xd19d('0x22')&&typeof _0x2d3789[_0xd19d('0x23')]===_0xd19d('0x22');var _0x15f65e=_0x672b08[_0xd19d('0x24')];var _0x52f280=_0x5a621a?0x0:_0x2d3789[_0xd19d('0x21')];var _0x2f7700=_0x5a621a?_0x672b08[_0xd19d('0x24')]:_0x2d3789[_0xd19d('0x21')]+_0x2d3789[_0xd19d('0x23')];var _0xe383d3;if(_0x2f7700>=_0x15f65e){_0x2f7700=_0x15f65e;_0xe383d3=0xc8;}else{_0xe383d3=0xce;}_0x3b9d43[_0xd19d('0x1e')](_0xe383d3);return _0x3b9d43['set'](_0xd19d('0x25'),_0x52f280+'-'+_0x2f7700+'/'+_0x15f65e)[_0xd19d('0x20')](_0x672b08);}return null;};}function patchUpdates(_0x9ff645){return function(_0x21dcbe){try{jsonpatch['apply'](_0x21dcbe,_0x9ff645,!![]);}catch(_0x2f562c){return BPromise[_0xd19d('0x26')](_0x2f562c);}return _0x21dcbe[_0xd19d('0x27')]();};}function saveUpdates(_0x1abe5d,_0x2d2c71){return function(_0x2b0b79){if(_0x2b0b79){return _0x2b0b79[_0xd19d('0x28')](_0x1abe5d)[_0xd19d('0x29')](function(_0x497607){return _0x497607;});}return null;};}function removeEntity(_0x2d8262,_0x252dc6){return function(_0x52e249){if(_0x52e249){return _0x52e249[_0xd19d('0x2a')]()[_0xd19d('0x29')](function(){_0x2d8262[_0xd19d('0x1e')](0xcc)[_0xd19d('0x1f')]();});}};}function handleEntityNotFound(_0x2a6c85,_0xd93957){return function(_0x50c91b){if(!_0x50c91b){_0x2a6c85[_0xd19d('0x1d')](0x194);}return _0x50c91b;};}function handleError(_0x58838e,_0x1a8148){_0x1a8148=_0x1a8148||0x1f4;return function(_0x5301d2){logger[_0xd19d('0x2b')](_0x5301d2[_0xd19d('0x2c')]);if(_0x5301d2['name']){delete _0x5301d2['name'];}_0x58838e[_0xd19d('0x1e')](_0x1a8148)[_0xd19d('0x2d')](_0x5301d2);};}exports['index']=function(_0x3e14f0,_0x4e6298){var _0x133f5e={},_0x4ed64a={},_0x2d6ecf={'count':0x0,'rows':[]};var _0x41dc50=_[_0xd19d('0x2e')](db['SalesforceField']['rawAttributes'],function(_0x202bcb){return{'name':_0x202bcb[_0xd19d('0x2f')],'type':_0x202bcb[_0xd19d('0x30')][_0xd19d('0x31')]};});_0x4ed64a[_0xd19d('0x32')]=_[_0xd19d('0x2e')](_0x41dc50,'name');_0x4ed64a['query']=_[_0xd19d('0x33')](_0x3e14f0['query']);_0x4ed64a[_0xd19d('0x34')]=_[_0xd19d('0x35')](_0x4ed64a[_0xd19d('0x32')],_0x4ed64a['query']);_0x133f5e[_0xd19d('0x36')]=_[_0xd19d('0x35')](_0x4ed64a['model'],qs[_0xd19d('0x37')](_0x3e14f0['query']['fields']));_0x133f5e[_0xd19d('0x36')]=_0x133f5e['attributes'][_0xd19d('0x38')]?_0x133f5e['attributes']:_0x4ed64a[_0xd19d('0x32')];if(!_0x3e14f0[_0xd19d('0x39')][_0xd19d('0x3a')](_0xd19d('0x3b'))){_0x133f5e[_0xd19d('0x23')]=qs['limit'](_0x3e14f0[_0xd19d('0x39')][_0xd19d('0x23')]);_0x133f5e[_0xd19d('0x21')]=qs[_0xd19d('0x21')](_0x3e14f0[_0xd19d('0x39')][_0xd19d('0x21')]);}_0x133f5e[_0xd19d('0x3c')]=qs[_0xd19d('0x3d')](_0x3e14f0[_0xd19d('0x39')][_0xd19d('0x3d')]);_0x133f5e['where']=qs[_0xd19d('0x34')](_['pick'](_0x3e14f0[_0xd19d('0x39')],_0x4ed64a['filters']),_0x41dc50);if(_0x3e14f0['query'][_0xd19d('0x3e')]){_0x133f5e['where']=_['merge'](_0x133f5e[_0xd19d('0x3f')],{'$or':_[_0xd19d('0x2e')](_0x41dc50,function(_0x24077f){if(_0x24077f['type']!==_0xd19d('0x40')){var _0x54fce6={};_0x54fce6[_0x24077f[_0xd19d('0x41')]]={'$like':'%'+_0x3e14f0['query'][_0xd19d('0x3e')]+'%'};return _0x54fce6;}})});}_0x133f5e=_[_0xd19d('0x42')]({},_0x133f5e,_0x3e14f0[_0xd19d('0x43')]);var _0x32e3da={'where':_0x133f5e['where']};return db[_0xd19d('0x44')]['count'](_0x32e3da)[_0xd19d('0x29')](function(_0x4c3d44){_0x2d6ecf[_0xd19d('0x24')]=_0x4c3d44;if(_0x3e14f0[_0xd19d('0x39')][_0xd19d('0x45')]){_0x133f5e['include']=[{'all':!![]}];}return db[_0xd19d('0x44')][_0xd19d('0x46')](_0x133f5e);})[_0xd19d('0x29')](function(_0x6fb30f){_0x2d6ecf[_0xd19d('0x47')]=_0x6fb30f;return _0x2d6ecf;})[_0xd19d('0x29')](respondWithFilteredResult(_0x4e6298,_0x133f5e))[_0xd19d('0x48')](handleError(_0x4e6298,null));};exports[_0xd19d('0x49')]=function(_0xec9987,_0x3a78ab){var _0x1729a6={'raw':!![],'where':{'id':_0xec9987['params']['id']}},_0x489a47={};_0x489a47[_0xd19d('0x32')]=_[_0xd19d('0x33')](db[_0xd19d('0x44')][_0xd19d('0x4a')]);_0x489a47['query']=_[_0xd19d('0x33')](_0xec9987[_0xd19d('0x39')]);_0x489a47[_0xd19d('0x34')]=_['intersection'](_0x489a47['model'],_0x489a47[_0xd19d('0x39')]);_0x1729a6[_0xd19d('0x36')]=_[_0xd19d('0x35')](_0x489a47[_0xd19d('0x32')],qs[_0xd19d('0x37')](_0xec9987[_0xd19d('0x39')][_0xd19d('0x37')]));_0x1729a6['attributes']=_0x1729a6['attributes'][_0xd19d('0x38')]?_0x1729a6[_0xd19d('0x36')]:_0x489a47[_0xd19d('0x32')];if(_0xec9987['query']['includeAll']){_0x1729a6['include']=[{'all':!![]}];}_0x1729a6=_[_0xd19d('0x42')]({},_0x1729a6,_0xec9987['options']);return db['SalesforceField'][_0xd19d('0x4b')](_0x1729a6)[_0xd19d('0x29')](handleEntityNotFound(_0x3a78ab,null))[_0xd19d('0x29')](respondWithResult(_0x3a78ab,null))['catch'](handleError(_0x3a78ab,null));};exports['create']=function(_0x3126fa,_0x20ce58){return db['SalesforceField'][_0xd19d('0x4c')](_0x3126fa[_0xd19d('0x4d')],{})[_0xd19d('0x29')](respondWithResult(_0x20ce58,0xc9))['catch'](handleError(_0x20ce58,null));};exports[_0xd19d('0x28')]=function(_0x19c988,_0x2db37c){if(_0x19c988[_0xd19d('0x4d')]['id']){delete _0x19c988[_0xd19d('0x4d')]['id'];}return db[_0xd19d('0x44')][_0xd19d('0x4b')]({'where':{'id':_0x19c988[_0xd19d('0x4e')]['id']}})[_0xd19d('0x29')](handleEntityNotFound(_0x2db37c,null))[_0xd19d('0x29')](saveUpdates(_0x19c988[_0xd19d('0x4d')],null))[_0xd19d('0x29')](respondWithResult(_0x2db37c,null))['catch'](handleError(_0x2db37c,null));};exports[_0xd19d('0x2a')]=function(_0x30c4a6,_0x30fd26){return db['SalesforceField']['find']({'where':{'id':_0x30c4a6['params']['id']}})['then'](handleEntityNotFound(_0x30fd26,null))['then'](removeEntity(_0x30fd26,null))[_0xd19d('0x48')](handleError(_0x30fd26,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index ca1f31c..babf8ad 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 _0x4fa2=['lodash','util','../../config/logger','moment','bluebird','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x540306,_0xeb168b){var _0x393809=function(_0x14ab0e){while(--_0x14ab0e){_0x540306['push'](_0x540306['shift']());}};_0x393809(++_0xeb168b);}(_0x4fa2,0xee));var _0x24fa=function(_0x13f5fe,_0x460a12){_0x13f5fe=_0x13f5fe-0x0;var _0x481c05=_0x4fa2[_0x13f5fe];return _0x481c05;};'use strict';var _=require(_0x24fa('0x0'));var util=require(_0x24fa('0x1'));var logger=require(_0x24fa('0x2'))('api');var moment=require(_0x24fa('0x3'));var BPromise=require(_0x24fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x24fa('0x5'));var attributes=require(_0x24fa('0x6'));module[_0x24fa('0x7')]=function(_0x4c6610,_0xdc3d0c){return _0x4c6610[_0x24fa('0x8')](_0x24fa('0x9'),attributes,{'tableName':_0x24fa('0xa'),'paranoid':![],'indexes':[{'name':_0x24fa('0xb'),'fields':[_0x24fa('0xc'),_0x24fa('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe18=['rimraf','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfe18,0x86));var _0x8fe1=function(_0x26b338,_0x25a4ad){_0x26b338=_0x26b338-0x0;var _0x3e6872=_0xfe18[_0x26b338];return _0x3e6872;};'use strict';var _=require(_0x8fe1('0x0'));var util=require('util');var logger=require(_0x8fe1('0x1'))(_0x8fe1('0x2'));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('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x8fe1('0x7')]=function(_0x1d507c,_0x44c860){return _0x1d507c[_0x8fe1('0x8')](_0x8fe1('0x9'),attributes,{'tableName':_0x8fe1('0xa'),'paranoid':![],'indexes':[{'name':_0x8fe1('0xb'),'fields':[_0x8fe1('0xc'),_0x8fe1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index be953ef..9db9f89 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 _0x0199=['info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','SalesforceField,\x20%s,\x20%s','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x249c20,_0x422275){var _0x46b287=function(_0x555f2a){while(--_0x555f2a){_0x249c20['push'](_0x249c20['shift']());}};_0x46b287(++_0x422275);}(_0x0199,0x145));var _0x9019=function(_0x3d4765,_0x23d4c7){_0x3d4765=_0x3d4765-0x0;var _0x2ecca8=_0x0199[_0x3d4765];return _0x2ecca8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9019('0x0'));var BPromise=require(_0x9019('0x1'));var rs=require(_0x9019('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9019('0x3'))['db'];var utils=require(_0x9019('0x4'));var logger=require('../../config/logger')(_0x9019('0x5'));var config=require(_0x9019('0x6'));var jayson=require(_0x9019('0x7'));var client=jayson[_0x9019('0x8')][_0x9019('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53ab23,_0x921669,_0x1e8eff){return new BPromise(function(_0x41b4f4,_0x25bf84){return client[_0x9019('0xa')](_0x53ab23,_0x1e8eff)['then'](function(_0x13f6cf){logger[_0x9019('0xb')]('SalesforceField,\x20%s,\x20%s',_0x921669,'request\x20sent');logger[_0x9019('0xc')](_0x9019('0xd'),_0x921669,'request\x20sent',JSON['stringify'](_0x13f6cf));if(_0x13f6cf['error']){if(_0x13f6cf[_0x9019('0xe')][_0x9019('0xf')]===0x1f4){logger['error'](_0x9019('0x10'),_0x921669,_0x13f6cf[_0x9019('0xe')][_0x9019('0x11')]);return _0x25bf84(_0x13f6cf[_0x9019('0xe')][_0x9019('0x11')]);}logger[_0x9019('0xe')]('SalesforceField,\x20%s,\x20%s',_0x921669,_0x13f6cf[_0x9019('0xe')][_0x9019('0x11')]);return _0x41b4f4(_0x13f6cf[_0x9019('0xe')][_0x9019('0x11')]);}else{logger[_0x9019('0xb')](_0x9019('0x10'),_0x921669,_0x9019('0x12'));_0x41b4f4(_0x13f6cf[_0x9019('0x13')][_0x9019('0x11')]);}})[_0x9019('0x14')](function(_0x50b09f){logger[_0x9019('0xe')](_0x9019('0x10'),_0x921669,_0x50b09f);_0x25bf84(_0x50b09f);});});} \ No newline at end of file +var _0x7a81=['jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2f103d,_0x41a701){var _0xa52466=function(_0x4fb90e){while(--_0x4fb90e){_0x2f103d['push'](_0x2f103d['shift']());}};_0xa52466(++_0x41a701);}(_0x7a81,0x13a));var _0x17a8=function(_0x10601d,_0x56868a){_0x10601d=_0x10601d-0x0;var _0x35474a=_0x7a81[_0x10601d];return _0x35474a;};'use strict';var _=require(_0x17a8('0x0'));var util=require(_0x17a8('0x1'));var moment=require(_0x17a8('0x2'));var BPromise=require(_0x17a8('0x3'));var rs=require(_0x17a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x17a8('0x5'));var logger=require(_0x17a8('0x6'))('rpc');var config=require(_0x17a8('0x7'));var jayson=require(_0x17a8('0x8'));var client=jayson[_0x17a8('0x9')][_0x17a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56cb2f,_0x1e8222,_0x29c06d){return new BPromise(function(_0x53896b,_0x2e28e1){return client[_0x17a8('0xb')](_0x56cb2f,_0x29c06d)[_0x17a8('0xc')](function(_0xd9af9c){logger['info'](_0x17a8('0xd'),_0x1e8222,_0x17a8('0xe'));logger[_0x17a8('0xf')](_0x17a8('0x10'),_0x1e8222,_0x17a8('0xe'),JSON[_0x17a8('0x11')](_0xd9af9c));if(_0xd9af9c[_0x17a8('0x12')]){if(_0xd9af9c[_0x17a8('0x12')][_0x17a8('0x13')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x1e8222,_0xd9af9c[_0x17a8('0x12')][_0x17a8('0x14')]);return _0x2e28e1(_0xd9af9c[_0x17a8('0x12')][_0x17a8('0x14')]);}logger[_0x17a8('0x12')]('SalesforceField,\x20%s,\x20%s',_0x1e8222,_0xd9af9c['error'][_0x17a8('0x14')]);return _0x53896b(_0xd9af9c[_0x17a8('0x12')][_0x17a8('0x14')]);}else{logger['info'](_0x17a8('0xd'),_0x1e8222,_0x17a8('0xe'));_0x53896b(_0xd9af9c[_0x17a8('0x15')][_0x17a8('0x14')]);}})[_0x17a8('0x16')](function(_0x3e82eb){logger[_0x17a8('0x12')](_0x17a8('0xd'),_0x1e8222,_0x3e82eb);_0x2e28e1(_0x3e82eb);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8ecaf64..2b84f51 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 _0x46a4=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports'];(function(_0x712bff,_0x17ad01){var _0x1c0f22=function(_0x7e16d5){while(--_0x7e16d5){_0x712bff['push'](_0x712bff['shift']());}};_0x1c0f22(++_0x17ad01);}(_0x46a4,0x190));var _0x446a=function(_0x3092a3,_0x200c27){_0x3092a3=_0x3092a3-0x0;var _0x299f8d=_0x46a4[_0x3092a3];return _0x299f8d;};'use strict';var multer=require(_0x446a('0x0'));var util=require(_0x446a('0x1'));var path=require('path');var timeout=require(_0x446a('0x2'));var express=require(_0x446a('0x3'));var router=express[_0x446a('0x4')]();var fs_extra=require(_0x446a('0x5'));var auth=require(_0x446a('0x6'));var interaction=require(_0x446a('0x7'));var config=require(_0x446a('0x8'));var controller=require('./intServicenowAccount.controller');router[_0x446a('0x9')]('/',auth['isAuthenticated'](),controller[_0x446a('0xa')]);router[_0x446a('0x9')](_0x446a('0xb'),auth[_0x446a('0xc')](),controller[_0x446a('0xd')]);router[_0x446a('0x9')](_0x446a('0xe'),auth[_0x446a('0xc')](),controller[_0x446a('0xf')]);router[_0x446a('0x9')](_0x446a('0x10'),auth[_0x446a('0xc')](),controller[_0x446a('0x11')]);router[_0x446a('0x12')]('/',auth[_0x446a('0xc')](),controller[_0x446a('0x13')]);router[_0x446a('0x12')](_0x446a('0xe'),auth[_0x446a('0xc')](),controller[_0x446a('0x14')]);router[_0x446a('0x15')](_0x446a('0xb'),auth[_0x446a('0xc')](),controller[_0x446a('0x16')]);router[_0x446a('0x17')](_0x446a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x446a('0x18')]=router; \ No newline at end of file +var _0x4db1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','getFields','create','post','addConfiguration','put','destroy','exports','multer','util','path','express'];(function(_0x3197ef,_0x70de54){var _0x1d2b65=function(_0x4d1258){while(--_0x4d1258){_0x3197ef['push'](_0x3197ef['shift']());}};_0x1d2b65(++_0x70de54);}(_0x4db1,0x19a));var _0x14db=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x4db1[_0x25e109];return _0xc0f7d6;};'use strict';var multer=require(_0x14db('0x0'));var util=require(_0x14db('0x1'));var path=require(_0x14db('0x2'));var timeout=require('connect-timeout');var express=require(_0x14db('0x3'));var router=express[_0x14db('0x4')]();var fs_extra=require(_0x14db('0x5'));var auth=require(_0x14db('0x6'));var interaction=require(_0x14db('0x7'));var config=require(_0x14db('0x8'));var controller=require(_0x14db('0x9'));router[_0x14db('0xa')]('/',auth['isAuthenticated'](),controller[_0x14db('0xb')]);router[_0x14db('0xa')](_0x14db('0xc'),auth[_0x14db('0xd')](),controller[_0x14db('0xe')]);router[_0x14db('0xa')]('/:id/configurations',auth[_0x14db('0xd')](),controller[_0x14db('0xf')]);router[_0x14db('0xa')]('/:id/fields',auth[_0x14db('0xd')](),controller[_0x14db('0x10')]);router['post']('/',auth[_0x14db('0xd')](),controller[_0x14db('0x11')]);router[_0x14db('0x12')]('/:id/configurations',auth[_0x14db('0xd')](),controller[_0x14db('0x13')]);router[_0x14db('0x14')](_0x14db('0xc'),auth[_0x14db('0xd')](),controller['update']);router['delete'](_0x14db('0xc'),auth[_0x14db('0xd')](),controller[_0x14db('0x15')]);module[_0x14db('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 cc7b5c3..6ba034f 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 _0xa59b=['sequelize','STRING','username','remoteUri'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xa59b,0x1a4));var _0xba59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa59b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xba59('0x0'));module['exports']={'name':{'type':Sequelize[_0xba59('0x1')]},'description':{'type':Sequelize[_0xba59('0x1')]},'username':{'type':Sequelize[_0xba59('0x1')],'unique':_0xba59('0x2')},'password':{'type':Sequelize[_0xba59('0x1')]},'email':{'type':Sequelize[_0xba59('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xba59('0x3')},'serverUrl':{'type':Sequelize[_0xba59('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3185=['STRING','username','remoteUri','sequelize'];(function(_0x4b0503,_0x15ef22){var _0x276965=function(_0x3b9916){while(--_0x3b9916){_0x4b0503['push'](_0x4b0503['shift']());}};_0x276965(++_0x15ef22);}(_0x3185,0xab));var _0x5318=function(_0x568691,_0x523d52){_0x568691=_0x568691-0x0;var _0x12add=_0x3185[_0x568691];return _0x12add;};'use strict';var Sequelize=require(_0x5318('0x0'));module['exports']={'name':{'type':Sequelize[_0x5318('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x5318('0x2')},'password':{'type':Sequelize[_0x5318('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5318('0x1')],'unique':_0x5318('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 8ba1501..e5ab3c9 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 _0x5e4e=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','type','options','includeAll','include','catch','show','params','length','create','body','find','destroy','getConfigurations','findOne','ServicenowConfiguration','order','addConfiguration','AccountId','getSubjects','channel','Descriptions','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','follow_up','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','email','remoteUri','slice','format','%s/api/now/doc/table/schema/','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','result','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0x3d312b,_0x3fd5c5){var _0x4d22dd=function(_0x54ea8e){while(--_0x54ea8e){_0x3d312b['push'](_0x3d312b['shift']());}};_0x4d22dd(++_0x3fd5c5);}(_0x5e4e,0x157));var _0xe5e4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5e4e[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xe5e4('0x0'));var rimraf=require(_0xe5e4('0x1'));var zipdir=require(_0xe5e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5e4('0x3'));var moment=require('moment');var BPromise=require(_0xe5e4('0x4'));var Mustache=require(_0xe5e4('0x5'));var util=require(_0xe5e4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe5e4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5e4('0x8'));var _=require(_0xe5e4('0x9'));var squel=require('squel');var crypto=require(_0xe5e4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe5e4('0xb'));var toCsv=require(_0xe5e4('0x7'));var querystring=require(_0xe5e4('0xc'));var Papa=require(_0xe5e4('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe5e4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe5e4('0xf'));var logger=require(_0xe5e4('0x10'))('api');var utils=require(_0xe5e4('0x11'));var config=require(_0xe5e4('0x12'));var licenseUtil=require(_0xe5e4('0x13'));var db=require(_0xe5e4('0x14'))['db'];var integrations=require(_0xe5e4('0x15'));function respondWithStatusCode(_0x126c01,_0x5df86f){_0x5df86f=_0x5df86f||0xcc;return function(_0x306c43){if(_0x306c43){return _0x126c01[_0xe5e4('0x16')](_0x5df86f);}return _0x126c01['status'](_0x5df86f)[_0xe5e4('0x17')]();};}function respondWithResult(_0x53eb43,_0x467a37){_0x467a37=_0x467a37||0xc8;return function(_0x3e0638){if(_0x3e0638){return _0x53eb43[_0xe5e4('0x18')](_0x467a37)[_0xe5e4('0x19')](_0x3e0638);}};}function respondWithFilteredResult(_0x3a3c55,_0x278492){return function(_0xa4fbfc){if(_0xa4fbfc){var _0x2e6d63=typeof _0x278492[_0xe5e4('0x1a')]===_0xe5e4('0x1b')&&typeof _0x278492[_0xe5e4('0x1c')]===_0xe5e4('0x1b');var _0x285203=_0xa4fbfc['count'];var _0x424bed=_0x2e6d63?0x0:_0x278492['offset'];var _0x99fdf=_0x2e6d63?_0xa4fbfc[_0xe5e4('0x1d')]:_0x278492['offset']+_0x278492[_0xe5e4('0x1c')];var _0x2da3aa;if(_0x99fdf>=_0x285203){_0x99fdf=_0x285203;_0x2da3aa=0xc8;}else{_0x2da3aa=0xce;}_0x3a3c55[_0xe5e4('0x18')](_0x2da3aa);return _0x3a3c55['set'](_0xe5e4('0x1e'),_0x424bed+'-'+_0x99fdf+'/'+_0x285203)['json'](_0xa4fbfc);}return null;};}function patchUpdates(_0x51f7d2){return function(_0x3c71c5){try{jsonpatch['apply'](_0x3c71c5,_0x51f7d2,!![]);}catch(_0x691748){return BPromise[_0xe5e4('0x1f')](_0x691748);}return _0x3c71c5[_0xe5e4('0x20')]();};}function saveUpdates(_0x4ab490,_0x424c58){return function(_0x3b3fb7){if(_0x3b3fb7){return _0x3b3fb7['update'](_0x4ab490)[_0xe5e4('0x21')](function(_0x2a7315){return _0x2a7315;});}return null;};}function removeEntity(_0x264ce6,_0x114df4){return function(_0x361de1){if(_0x361de1){return _0x361de1['destroy']()['then'](function(){_0x264ce6[_0xe5e4('0x18')](0xcc)[_0xe5e4('0x17')]();});}};}function handleEntityNotFound(_0x3fa5b8,_0x57c1f8){return function(_0x2a4cf4){if(!_0x2a4cf4){_0x3fa5b8[_0xe5e4('0x16')](0x194);}return _0x2a4cf4;};}function handleError(_0x3d25a0,_0x3d2d62){_0x3d2d62=_0x3d2d62||0x1f4;return function(_0x100f9c){logger['error'](_0x100f9c[_0xe5e4('0x22')]);if(_0x100f9c[_0xe5e4('0x23')]){delete _0x100f9c[_0xe5e4('0x23')];}_0x3d25a0[_0xe5e4('0x18')](_0x3d2d62)[_0xe5e4('0x24')](_0x100f9c);};}exports[_0xe5e4('0x25')]=function(_0x296192,_0x587d9a){var _0x2fb4af={},_0x374179={},_0x372212={'count':0x0,'rows':[]};var _0x2b13c8=_[_0xe5e4('0x26')](db[_0xe5e4('0x27')][_0xe5e4('0x28')],function(_0x1a8f68){return{'name':_0x1a8f68[_0xe5e4('0x29')],'type':_0x1a8f68['type'][_0xe5e4('0x2a')]};});_0x374179[_0xe5e4('0x2b')]=_[_0xe5e4('0x26')](_0x2b13c8,_0xe5e4('0x23'));_0x374179[_0xe5e4('0x2c')]=_[_0xe5e4('0x2d')](_0x296192['query']);_0x374179['filters']=_[_0xe5e4('0x2e')](_0x374179[_0xe5e4('0x2b')],_0x374179['query']);_0x2fb4af[_0xe5e4('0x2f')]=_[_0xe5e4('0x2e')](_0x374179[_0xe5e4('0x2b')],qs[_0xe5e4('0x30')](_0x296192[_0xe5e4('0x2c')][_0xe5e4('0x30')]));_0x2fb4af['attributes']=_0x2fb4af[_0xe5e4('0x2f')]['length']?_0x2fb4af[_0xe5e4('0x2f')]:_0x374179[_0xe5e4('0x2b')];if(!_0x296192[_0xe5e4('0x2c')][_0xe5e4('0x31')](_0xe5e4('0x32'))){_0x2fb4af[_0xe5e4('0x1c')]=qs[_0xe5e4('0x1c')](_0x296192[_0xe5e4('0x2c')]['limit']);_0x2fb4af[_0xe5e4('0x1a')]=qs[_0xe5e4('0x1a')](_0x296192['query'][_0xe5e4('0x1a')]);}_0x2fb4af['order']=qs[_0xe5e4('0x33')](_0x296192[_0xe5e4('0x2c')][_0xe5e4('0x33')]);_0x2fb4af['where']=qs['filters'](_[_0xe5e4('0x34')](_0x296192['query'],_0x374179[_0xe5e4('0x35')]),_0x2b13c8);if(_0x296192[_0xe5e4('0x2c')][_0xe5e4('0x36')]){_0x2fb4af['where']=_[_0xe5e4('0x37')](_0x2fb4af[_0xe5e4('0x38')],{'$or':_['map'](_0x2b13c8,function(_0x1286af){if(_0x1286af[_0xe5e4('0x39')]!=='VIRTUAL'){var _0x3ab4df={};_0x3ab4df[_0x1286af[_0xe5e4('0x23')]]={'$like':'%'+_0x296192[_0xe5e4('0x2c')][_0xe5e4('0x36')]+'%'};return _0x3ab4df;}})});}_0x2fb4af=_['merge']({},_0x2fb4af,_0x296192[_0xe5e4('0x3a')]);var _0x14831c={'where':_0x2fb4af[_0xe5e4('0x38')]};return db[_0xe5e4('0x27')][_0xe5e4('0x1d')](_0x14831c)[_0xe5e4('0x21')](function(_0x2f8eb7){_0x372212['count']=_0x2f8eb7;if(_0x296192[_0xe5e4('0x2c')][_0xe5e4('0x3b')]){_0x2fb4af[_0xe5e4('0x3c')]=[{'all':!![]}];}return db[_0xe5e4('0x27')]['findAll'](_0x2fb4af);})[_0xe5e4('0x21')](function(_0x153fcf){_0x372212['rows']=_0x153fcf;return _0x372212;})[_0xe5e4('0x21')](respondWithFilteredResult(_0x587d9a,_0x2fb4af))[_0xe5e4('0x3d')](handleError(_0x587d9a,null));};exports[_0xe5e4('0x3e')]=function(_0x3110d9,_0x73844b){var _0x314e6c={'raw':![],'where':{'id':_0x3110d9[_0xe5e4('0x3f')]['id']}},_0x508965={};_0x508965[_0xe5e4('0x2b')]=_[_0xe5e4('0x2d')](db[_0xe5e4('0x27')][_0xe5e4('0x28')]);_0x508965[_0xe5e4('0x2c')]=_['keys'](_0x3110d9[_0xe5e4('0x2c')]);_0x508965[_0xe5e4('0x35')]=_[_0xe5e4('0x2e')](_0x508965[_0xe5e4('0x2b')],_0x508965[_0xe5e4('0x2c')]);_0x314e6c[_0xe5e4('0x2f')]=_[_0xe5e4('0x2e')](_0x508965['model'],qs[_0xe5e4('0x30')](_0x3110d9['query']['fields']));_0x314e6c['attributes']=_0x314e6c[_0xe5e4('0x2f')][_0xe5e4('0x40')]?_0x314e6c[_0xe5e4('0x2f')]:_0x508965['model'];if(_0x3110d9[_0xe5e4('0x2c')][_0xe5e4('0x3b')]){_0x314e6c[_0xe5e4('0x3c')]=[{'all':!![]}];}_0x314e6c=_[_0xe5e4('0x37')]({},_0x314e6c,_0x3110d9[_0xe5e4('0x3a')]);return db[_0xe5e4('0x27')]['find'](_0x314e6c)[_0xe5e4('0x21')](handleEntityNotFound(_0x73844b,null))['then'](respondWithResult(_0x73844b,null))[_0xe5e4('0x3d')](handleError(_0x73844b,null));};exports[_0xe5e4('0x41')]=function(_0x476c45,_0x3ca2a0){return db[_0xe5e4('0x27')][_0xe5e4('0x41')](_0x476c45['body'],{})[_0xe5e4('0x21')](respondWithResult(_0x3ca2a0,0xc9))['catch'](handleError(_0x3ca2a0,null));};exports['update']=function(_0x5c975d,_0x2cf339){if(_0x5c975d[_0xe5e4('0x42')]['id']){delete _0x5c975d[_0xe5e4('0x42')]['id'];}return db['ServicenowAccount'][_0xe5e4('0x43')]({'where':{'id':_0x5c975d[_0xe5e4('0x3f')]['id']}})[_0xe5e4('0x21')](handleEntityNotFound(_0x2cf339,null))[_0xe5e4('0x21')](saveUpdates(_0x5c975d['body'],null))[_0xe5e4('0x21')](respondWithResult(_0x2cf339,null))[_0xe5e4('0x3d')](handleError(_0x2cf339,null));};exports[_0xe5e4('0x44')]=function(_0x27b84d,_0x491d18){return db[_0xe5e4('0x27')][_0xe5e4('0x43')]({'where':{'id':_0x27b84d[_0xe5e4('0x3f')]['id']}})[_0xe5e4('0x21')](handleEntityNotFound(_0x491d18,null))['then'](removeEntity(_0x491d18,null))[_0xe5e4('0x3d')](handleError(_0x491d18,null));};exports[_0xe5e4('0x45')]=function(_0x39dec3,_0x3b4d1b,_0x5b89a0){var _0x28ccce={};var _0x1a3684={};var _0x459f95;var _0x420138;return db[_0xe5e4('0x27')][_0xe5e4('0x46')]({'where':{'id':_0x39dec3['params']['id']}})[_0xe5e4('0x21')](handleEntityNotFound(_0x3b4d1b,null))[_0xe5e4('0x21')](function(_0x5e3b2f){if(_0x5e3b2f){_0x459f95=_0x5e3b2f;_0x1a3684[_0xe5e4('0x2b')]=_[_0xe5e4('0x2d')](db[_0xe5e4('0x47')][_0xe5e4('0x28')]);_0x1a3684[_0xe5e4('0x2c')]=_['keys'](_0x39dec3['query']);_0x1a3684[_0xe5e4('0x35')]=_[_0xe5e4('0x2e')](_0x1a3684['model'],_0x1a3684['query']);_0x28ccce['attributes']=_[_0xe5e4('0x2e')](_0x1a3684['model'],qs[_0xe5e4('0x30')](_0x39dec3[_0xe5e4('0x2c')][_0xe5e4('0x30')]));_0x28ccce['attributes']=_0x28ccce[_0xe5e4('0x2f')][_0xe5e4('0x40')]?_0x28ccce[_0xe5e4('0x2f')]:_0x1a3684[_0xe5e4('0x2b')];_0x28ccce[_0xe5e4('0x48')]=qs['sort'](_0x39dec3[_0xe5e4('0x2c')]['sort']);_0x28ccce[_0xe5e4('0x38')]=qs[_0xe5e4('0x35')](_[_0xe5e4('0x34')](_0x39dec3['query'],_0x1a3684[_0xe5e4('0x35')]));if(_0x39dec3['query'][_0xe5e4('0x36')]){_0x28ccce[_0xe5e4('0x38')]=_['merge'](_0x28ccce[_0xe5e4('0x38')],{'$or':_[_0xe5e4('0x26')](_0x28ccce[_0xe5e4('0x2f')],function(_0x4c3be3){var _0x22892b={};_0x22892b[_0x4c3be3]={'$like':'%'+_0x39dec3[_0xe5e4('0x2c')]['filter']+'%'};return _0x22892b;})});}_0x28ccce=_[_0xe5e4('0x37')]({},_0x28ccce,_0x39dec3['options']);return _0x459f95[_0xe5e4('0x45')](_0x28ccce);}})[_0xe5e4('0x21')](function(_0x1677c8){if(_0x1677c8){_0x420138=_0x1677c8[_0xe5e4('0x40')];if(!_0x39dec3[_0xe5e4('0x2c')][_0xe5e4('0x31')](_0xe5e4('0x32'))){_0x28ccce[_0xe5e4('0x1c')]=qs[_0xe5e4('0x1c')](_0x39dec3[_0xe5e4('0x2c')][_0xe5e4('0x1c')]);_0x28ccce[_0xe5e4('0x1a')]=qs['offset'](_0x39dec3['query'][_0xe5e4('0x1a')]);}return _0x459f95['getConfigurations'](_0x28ccce);}})[_0xe5e4('0x21')](function(_0xba1762){if(_0xba1762){return _0xba1762?{'count':_0x420138,'rows':_0xba1762}:null;}})[_0xe5e4('0x21')](respondWithResult(_0x3b4d1b,null))[_0xe5e4('0x3d')](handleError(_0x3b4d1b,null));};exports[_0xe5e4('0x49')]=function(_0x475f3e,_0x450be6,_0x422414){if(_0x475f3e[_0xe5e4('0x42')]['id']){delete _0x475f3e[_0xe5e4('0x42')]['id'];}return db['ServicenowAccount'][_0xe5e4('0x46')]({'where':{'id':_0x475f3e[_0xe5e4('0x3f')]['id']}})[_0xe5e4('0x21')](handleEntityNotFound(_0x450be6,null))[_0xe5e4('0x21')](function(_0x402d65){if(_0x402d65){_0x475f3e[_0xe5e4('0x42')][_0xe5e4('0x4a')]=_0x402d65['id'];_0x475f3e['body']['Subjects']=integrations[_0xe5e4('0x4b')](_0x475f3e[_0xe5e4('0x42')][_0xe5e4('0x4c')],_0x475f3e['body'][_0xe5e4('0x39')]);_0x475f3e[_0xe5e4('0x42')][_0xe5e4('0x4d')]=integrations['getDescriptions'](_0x475f3e['body'][_0xe5e4('0x4c')],_0x475f3e[_0xe5e4('0x42')][_0xe5e4('0x39')]);return db['ServicenowConfiguration'][_0xe5e4('0x41')](_0x475f3e[_0xe5e4('0x42')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xe5e4('0x4d')}]});}return null;})[_0xe5e4('0x21')](respondWithResult(_0x450be6,null))[_0xe5e4('0x3d')](handleError(_0x450be6,null));};exports['getFields']=function(_0x21cb2a,_0x8e23ba,_0x20b968){var _0x2a057d=['made_sla',_0xe5e4('0x4e'),_0xe5e4('0x4f'),_0xe5e4('0x50'),'close_code',_0xe5e4('0x51'),_0xe5e4('0x52'),_0xe5e4('0x53'),_0xe5e4('0x54')];var _0x56a8f2=[_0xe5e4('0x55'),_0xe5e4('0x56'),_0xe5e4('0x57'),_0xe5e4('0x58'),_0xe5e4('0x59'),_0xe5e4('0x5a'),_0xe5e4('0x5b'),_0xe5e4('0x4e'),_0xe5e4('0x5c'),_0xe5e4('0x5d'),_0xe5e4('0x5e'),_0xe5e4('0x5f'),_0xe5e4('0x60'),_0xe5e4('0x61'),_0xe5e4('0x62'),_0xe5e4('0x63'),'state',_0xe5e4('0x64'),_0xe5e4('0x4f'),_0xe5e4('0x48'),_0xe5e4('0x65'),_0xe5e4('0x66'),'cmdb_ci',_0xe5e4('0x67'),_0xe5e4('0x68'),_0xe5e4('0x69'),'work_notes_list',_0xe5e4('0x6a'),_0xe5e4('0x6b'),_0xe5e4('0x6c'),_0xe5e4('0x6d'),_0xe5e4('0x6e'),'expected_start',_0xe5e4('0x6f'),_0xe5e4('0x70'),_0xe5e4('0x71'),'work_end',_0xe5e4('0x72'),_0xe5e4('0x73'),'caller_id',_0xe5e4('0x74'),'subcategory','work_notes',_0xe5e4('0x75'),'close_code',_0xe5e4('0x76'),_0xe5e4('0x77'),_0xe5e4('0x78'),_0xe5e4('0x79'),_0xe5e4('0x7a'),_0xe5e4('0x7b'),_0xe5e4('0x7c'),'calendar_duration','notify',_0xe5e4('0x7d'),'close_notes','closed_by',_0xe5e4('0x7e'),'parent_incident','sys_id',_0xe5e4('0x7f'),_0xe5e4('0x80'),_0xe5e4('0x52'),_0xe5e4('0x81'),_0xe5e4('0x82'),_0xe5e4('0x83'),_0xe5e4('0x84'),_0xe5e4('0x85'),'assigned_to',_0xe5e4('0x53'),_0xe5e4('0x86'),_0xe5e4('0x87'),_0xe5e4('0x88'),_0xe5e4('0x89'),_0xe5e4('0x8a'),_0xe5e4('0x8b'),_0xe5e4('0x8c'),_0xe5e4('0x8d'),'escalation',_0xe5e4('0x8e'),_0xe5e4('0x8f'),_0xe5e4('0x90'),_0xe5e4('0x54')];var _0x4e6e63='';var _0x12cfbd='';var _0x2529b7=[];var _0x237c70='';var _0x680150='';var _0x37faea=[];var _0x2b99f1='';var _0x5808b4='';var _0x178859={};var _0x5807f8='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x21cb2a[_0xe5e4('0x3f')]['id']},'attributes':['id',_0xe5e4('0x91'),'password',_0xe5e4('0x92'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x8e23ba,null))['then'](function(_0x217352){if(_0x217352){_0x5807f8=_0x217352[_0xe5e4('0x93')];var _0x5543bb=_0x5807f8[_0xe5e4('0x94')](-0x1);if(_0x5543bb==='/'){_0x5807f8=_0x5807f8['substring'](0x0,_0x5807f8['lastIndexOf'](_0x5543bb));}_0x5808b4=util[_0xe5e4('0x95')](_0xe5e4('0x96'),_0x5807f8);_0x2b99f1=util['format']('%s/api/now/table/',_0x5807f8);_0x178859={'user':_0x217352['username'],'pass':_0x217352[_0xe5e4('0x97')]};var _0x2f0978={'method':_0xe5e4('0x98'),'uri':_0x5808b4+_0xe5e4('0x99'),'auth':_0x178859,'json':!![]};return rp(_0x2f0978);}})[_0xe5e4('0x21')](function(_0x4e7ccb){if(_0x4e7ccb['result']['length']>0x0){_0x4e6e63=_0x4e7ccb['result'];}console[_0xe5e4('0x9a')](_0xe5e4('0x9b'),_0x4e6e63);_0x37faea=[];_0x12cfbd=Object[_0xe5e4('0x9c')]([],_0x4e6e63);_[_0xe5e4('0x9d')](_0x12cfbd,function(_0x51b985){return!_0x2a057d[_0xe5e4('0x9e')](_0x51b985[_0xe5e4('0x23')]);});_0x12cfbd['forEach'](function(_0xc6191b){var _0x27bbea=createFieldObject(_0x2b99f1,_0x178859,_0xc6191b[_0xe5e4('0x9f')],_0xc6191b['name'],_0xc6191b[_0xe5e4('0xa0')],![]);_0x37faea[_0xe5e4('0xa1')](_0x27bbea);});return Promise[_0xe5e4('0xa2')](_0x37faea);})[_0xe5e4('0x21')](function(_0x1a6d3d){_0x2529b7=_0x1a6d3d;_0x237c70=Object[_0xe5e4('0x9c')]([],_0x4e6e63);console[_0xe5e4('0x9a')](_0xe5e4('0xa3'),_0x4e6e63);_[_0xe5e4('0x9d')](_0x237c70,function(_0x12bca8){return _0x56a8f2['includes'](_0x12bca8['name']);});console['log'](_0xe5e4('0xa4'),_0x237c70);_0x37faea=[];_0x237c70[_0xe5e4('0xa5')](function(_0x3612ff){var _0x4f5288=createFieldObject(_0x2b99f1,_0x178859,_0x3612ff[_0xe5e4('0x9f')],_0x3612ff['name'],_0x3612ff['label'],!![]);_0x37faea[_0xe5e4('0xa1')](_0x4f5288);});return Promise[_0xe5e4('0xa2')](_0x37faea);})['then'](function(_0x18e6fc){_0x680150=_0x18e6fc;var _0x55ce1b=_0x2529b7[_0xe5e4('0xa6')](_0x680150);return{'count':_0x55ce1b[_0xe5e4('0x40')],'rows':_0x55ce1b};})[_0xe5e4('0x21')](respondWithResult(_0x8e23ba,null))[_0xe5e4('0x3d')](function(_0x48ae85){console[_0xe5e4('0x9a')](_0xe5e4('0xa7')+_0x48ae85);var _0x2e2fda=_0x21cb2a['query'][_0xe5e4('0xa8')]?0x1f4:_0x48ae85[_0xe5e4('0xa9')]||0x1f4;logger[_0xe5e4('0xaa')](_0x48ae85[_0xe5e4('0x22')]);delete _0x48ae85['name'];if(_0x2e2fda===0x191){_0x2e2fda=0x190;}_0x8e23ba['status'](_0x2e2fda)[_0xe5e4('0x24')](_0x21cb2a['query'][_0xe5e4('0xa8')]?{'message':_0xe5e4('0xab'),'statusCode':_0x48ae85[_0xe5e4('0xa9')]}:_0x48ae85);});};function createFieldObject(_0x13f42e,_0x4de5df,_0x561b55,_0x4d625d,_0x58541f,_0x2738f4){return new Promise(function(_0x254407,_0x27582c){var _0x1e2c68={'id':_0x4d625d,'name':_0x58541f,'custom':_0x2738f4};if(_0x561b55===_0xe5e4('0xac')){_0x1e2c68[_0xe5e4('0x3a')]=[{'name':_0xe5e4('0xad'),'value':_0xe5e4('0xae')},{'name':_0xe5e4('0xaf'),'value':_0xe5e4('0xb0')}];_0x254407(_0x1e2c68);}else{var _0x44e7c0={'method':_0xe5e4('0x98'),'uri':_0x13f42e+_0xe5e4('0xb1')+_0x4d625d,'auth':_0x4de5df,'json':!![]};return rp(_0x44e7c0)[_0xe5e4('0x21')](function(_0x97710d){var _0x2d96a0=[];if(_0x97710d[_0xe5e4('0xb2')][_0xe5e4('0x40')]>0x0){_0x97710d[_0xe5e4('0xb2')][_0xe5e4('0xa5')](function(_0x3e1488){if(_0x3e1488['inactive']==='false'){var _0x37cf23={'name':_0x3e1488[_0xe5e4('0xa0')],'value':_0x3e1488['value']};_0x2d96a0[_0xe5e4('0xa1')](_0x37cf23);}});}_0x1e2c68[_0xe5e4('0x3a')]=_0x2d96a0;if(_0x1e2c68[_0xe5e4('0x3a')]['length']>0x0){_0x254407(_0x1e2c68);}else{if(_0x2738f4==![]){_0x254407();}else{_0x254407(_0x1e2c68);}}});}});} \ No newline at end of file +var _0x5efe=['AccountId','Subjects','getDescriptions','Descriptions','getFields','made_sla','knowledge','subcategory','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','all','assign','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','inactive','value','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','order','hasOwnProperty','addConfiguration'];(function(_0x533933,_0x46eba1){var _0x5100ae=function(_0xd37def){while(--_0xd37def){_0x533933['push'](_0x533933['shift']());}};_0x5100ae(++_0x46eba1);}(_0x5efe,0x1ec));var _0xe5ef=function(_0x1b7b64,_0x288a90){_0x1b7b64=_0x1b7b64-0x0;var _0x3fdf98=_0x5efe[_0x1b7b64];return _0x3fdf98;};'use strict';var emlformat=require(_0xe5ef('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe5ef('0x1'));var rp=require(_0xe5ef('0x2'));var moment=require(_0xe5ef('0x3'));var BPromise=require(_0xe5ef('0x4'));var Mustache=require(_0xe5ef('0x5'));var util=require(_0xe5ef('0x6'));var path=require(_0xe5ef('0x7'));var sox=require('sox');var csv=require(_0xe5ef('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5ef('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe5ef('0xa'));var jsforce=require(_0xe5ef('0xb'));var deskjs=require(_0xe5ef('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe5ef('0xd'));var Papa=require(_0xe5ef('0xe'));var Redis=require(_0xe5ef('0xf'));var authService=require(_0xe5ef('0x10'));var qs=require(_0xe5ef('0x11'));var as=require(_0xe5ef('0x12'));var hardwareService=require(_0xe5ef('0x13'));var logger=require(_0xe5ef('0x14'))(_0xe5ef('0x15'));var utils=require(_0xe5ef('0x16'));var config=require(_0xe5ef('0x17'));var licenseUtil=require(_0xe5ef('0x18'));var db=require(_0xe5ef('0x19'))['db'];var integrations=require(_0xe5ef('0x1a'));function respondWithStatusCode(_0x3cf5f6,_0x34ca5f){_0x34ca5f=_0x34ca5f||0xcc;return function(_0x31a399){if(_0x31a399){return _0x3cf5f6['sendStatus'](_0x34ca5f);}return _0x3cf5f6[_0xe5ef('0x1b')](_0x34ca5f)['end']();};}function respondWithResult(_0x34d5f3,_0x1a6ae8){_0x1a6ae8=_0x1a6ae8||0xc8;return function(_0x398caf){if(_0x398caf){return _0x34d5f3[_0xe5ef('0x1b')](_0x1a6ae8)[_0xe5ef('0x1c')](_0x398caf);}};}function respondWithFilteredResult(_0x576e08,_0x113a05){return function(_0x55e76e){if(_0x55e76e){var _0x5c2f11=typeof _0x113a05[_0xe5ef('0x1d')]===_0xe5ef('0x1e')&&typeof _0x113a05[_0xe5ef('0x1f')]===_0xe5ef('0x1e');var _0xcce036=_0x55e76e[_0xe5ef('0x20')];var _0x5502aa=_0x5c2f11?0x0:_0x113a05[_0xe5ef('0x1d')];var _0x540a05=_0x5c2f11?_0x55e76e[_0xe5ef('0x20')]:_0x113a05[_0xe5ef('0x1d')]+_0x113a05['limit'];var _0x11e297;if(_0x540a05>=_0xcce036){_0x540a05=_0xcce036;_0x11e297=0xc8;}else{_0x11e297=0xce;}_0x576e08[_0xe5ef('0x1b')](_0x11e297);return _0x576e08[_0xe5ef('0x21')](_0xe5ef('0x22'),_0x5502aa+'-'+_0x540a05+'/'+_0xcce036)[_0xe5ef('0x1c')](_0x55e76e);}return null;};}function patchUpdates(_0x8c4aeb){return function(_0x4fe6c3){try{jsonpatch[_0xe5ef('0x23')](_0x4fe6c3,_0x8c4aeb,!![]);}catch(_0x568a0e){return BPromise[_0xe5ef('0x24')](_0x568a0e);}return _0x4fe6c3['save']();};}function saveUpdates(_0x5b4f58,_0x4d3915){return function(_0x27bf09){if(_0x27bf09){return _0x27bf09[_0xe5ef('0x25')](_0x5b4f58)[_0xe5ef('0x26')](function(_0x46c0aa){return _0x46c0aa;});}return null;};}function removeEntity(_0x266908,_0x241e1d){return function(_0x411047){if(_0x411047){return _0x411047['destroy']()[_0xe5ef('0x26')](function(){_0x266908[_0xe5ef('0x1b')](0xcc)[_0xe5ef('0x27')]();});}};}function handleEntityNotFound(_0x3954dc,_0x32b297){return function(_0x56c07a){if(!_0x56c07a){_0x3954dc[_0xe5ef('0x28')](0x194);}return _0x56c07a;};}function handleError(_0x6142c,_0x100a9c){_0x100a9c=_0x100a9c||0x1f4;return function(_0x169491){logger[_0xe5ef('0x29')](_0x169491[_0xe5ef('0x2a')]);if(_0x169491[_0xe5ef('0x2b')]){delete _0x169491[_0xe5ef('0x2b')];}_0x6142c[_0xe5ef('0x1b')](_0x100a9c)[_0xe5ef('0x2c')](_0x169491);};}exports['index']=function(_0x49702f,_0x434b2b){var _0x3ece45={},_0x2364c1={},_0x28359c={'count':0x0,'rows':[]};var _0x4bd939=_['map'](db[_0xe5ef('0x2d')][_0xe5ef('0x2e')],function(_0x595206){return{'name':_0x595206[_0xe5ef('0x2f')],'type':_0x595206['type'][_0xe5ef('0x30')]};});_0x2364c1[_0xe5ef('0x31')]=_[_0xe5ef('0x32')](_0x4bd939,'name');_0x2364c1[_0xe5ef('0x33')]=_[_0xe5ef('0x34')](_0x49702f[_0xe5ef('0x33')]);_0x2364c1[_0xe5ef('0x35')]=_[_0xe5ef('0x36')](_0x2364c1[_0xe5ef('0x31')],_0x2364c1[_0xe5ef('0x33')]);_0x3ece45[_0xe5ef('0x37')]=_[_0xe5ef('0x36')](_0x2364c1['model'],qs[_0xe5ef('0x38')](_0x49702f[_0xe5ef('0x33')][_0xe5ef('0x38')]));_0x3ece45[_0xe5ef('0x37')]=_0x3ece45[_0xe5ef('0x37')][_0xe5ef('0x39')]?_0x3ece45[_0xe5ef('0x37')]:_0x2364c1['model'];if(!_0x49702f[_0xe5ef('0x33')]['hasOwnProperty'](_0xe5ef('0x3a'))){_0x3ece45['limit']=qs[_0xe5ef('0x1f')](_0x49702f[_0xe5ef('0x33')][_0xe5ef('0x1f')]);_0x3ece45[_0xe5ef('0x1d')]=qs[_0xe5ef('0x1d')](_0x49702f['query']['offset']);}_0x3ece45['order']=qs[_0xe5ef('0x3b')](_0x49702f[_0xe5ef('0x33')][_0xe5ef('0x3b')]);_0x3ece45[_0xe5ef('0x3c')]=qs[_0xe5ef('0x35')](_[_0xe5ef('0x3d')](_0x49702f[_0xe5ef('0x33')],_0x2364c1[_0xe5ef('0x35')]),_0x4bd939);if(_0x49702f[_0xe5ef('0x33')][_0xe5ef('0x3e')]){_0x3ece45['where']=_[_0xe5ef('0x3f')](_0x3ece45['where'],{'$or':_[_0xe5ef('0x32')](_0x4bd939,function(_0x2b5085){if(_0x2b5085[_0xe5ef('0x40')]!==_0xe5ef('0x41')){var _0x1d135d={};_0x1d135d[_0x2b5085[_0xe5ef('0x2b')]]={'$like':'%'+_0x49702f[_0xe5ef('0x33')][_0xe5ef('0x3e')]+'%'};return _0x1d135d;}})});}_0x3ece45=_[_0xe5ef('0x3f')]({},_0x3ece45,_0x49702f[_0xe5ef('0x42')]);var _0x35888e={'where':_0x3ece45[_0xe5ef('0x3c')]};return db[_0xe5ef('0x2d')][_0xe5ef('0x20')](_0x35888e)['then'](function(_0x2fcd84){_0x28359c[_0xe5ef('0x20')]=_0x2fcd84;if(_0x49702f[_0xe5ef('0x33')][_0xe5ef('0x43')]){_0x3ece45[_0xe5ef('0x44')]=[{'all':!![]}];}return db[_0xe5ef('0x2d')][_0xe5ef('0x45')](_0x3ece45);})[_0xe5ef('0x26')](function(_0xcaa0a5){_0x28359c[_0xe5ef('0x46')]=_0xcaa0a5;return _0x28359c;})[_0xe5ef('0x26')](respondWithFilteredResult(_0x434b2b,_0x3ece45))[_0xe5ef('0x47')](handleError(_0x434b2b,null));};exports[_0xe5ef('0x48')]=function(_0x53e1fd,_0x31b5de){var _0x543cc4={'raw':![],'where':{'id':_0x53e1fd[_0xe5ef('0x49')]['id']}},_0x1bb14c={};_0x1bb14c['model']=_[_0xe5ef('0x34')](db['ServicenowAccount']['rawAttributes']);_0x1bb14c[_0xe5ef('0x33')]=_['keys'](_0x53e1fd[_0xe5ef('0x33')]);_0x1bb14c[_0xe5ef('0x35')]=_[_0xe5ef('0x36')](_0x1bb14c[_0xe5ef('0x31')],_0x1bb14c[_0xe5ef('0x33')]);_0x543cc4[_0xe5ef('0x37')]=_[_0xe5ef('0x36')](_0x1bb14c[_0xe5ef('0x31')],qs[_0xe5ef('0x38')](_0x53e1fd['query'][_0xe5ef('0x38')]));_0x543cc4[_0xe5ef('0x37')]=_0x543cc4['attributes'][_0xe5ef('0x39')]?_0x543cc4['attributes']:_0x1bb14c[_0xe5ef('0x31')];if(_0x53e1fd['query'][_0xe5ef('0x43')]){_0x543cc4[_0xe5ef('0x44')]=[{'all':!![]}];}_0x543cc4=_[_0xe5ef('0x3f')]({},_0x543cc4,_0x53e1fd[_0xe5ef('0x42')]);return db[_0xe5ef('0x2d')][_0xe5ef('0x4a')](_0x543cc4)[_0xe5ef('0x26')](handleEntityNotFound(_0x31b5de,null))[_0xe5ef('0x26')](respondWithResult(_0x31b5de,null))['catch'](handleError(_0x31b5de,null));};exports[_0xe5ef('0x4b')]=function(_0x40196e,_0x51e27a){return db[_0xe5ef('0x2d')][_0xe5ef('0x4b')](_0x40196e[_0xe5ef('0x4c')],{})[_0xe5ef('0x26')](respondWithResult(_0x51e27a,0xc9))['catch'](handleError(_0x51e27a,null));};exports[_0xe5ef('0x25')]=function(_0x1cfec0,_0x2400e5){if(_0x1cfec0[_0xe5ef('0x4c')]['id']){delete _0x1cfec0['body']['id'];}return db['ServicenowAccount'][_0xe5ef('0x4a')]({'where':{'id':_0x1cfec0[_0xe5ef('0x49')]['id']}})[_0xe5ef('0x26')](handleEntityNotFound(_0x2400e5,null))[_0xe5ef('0x26')](saveUpdates(_0x1cfec0['body'],null))['then'](respondWithResult(_0x2400e5,null))[_0xe5ef('0x47')](handleError(_0x2400e5,null));};exports[_0xe5ef('0x4d')]=function(_0x28ef49,_0x39ce66){return db[_0xe5ef('0x2d')][_0xe5ef('0x4a')]({'where':{'id':_0x28ef49[_0xe5ef('0x49')]['id']}})[_0xe5ef('0x26')](handleEntityNotFound(_0x39ce66,null))[_0xe5ef('0x26')](removeEntity(_0x39ce66,null))[_0xe5ef('0x47')](handleError(_0x39ce66,null));};exports[_0xe5ef('0x4e')]=function(_0x1e654b,_0x1505e9,_0x909d89){var _0x13b787={};var _0x5e80ae={};var _0x2e3c1f;var _0x1fca7e;return db[_0xe5ef('0x2d')][_0xe5ef('0x4f')]({'where':{'id':_0x1e654b[_0xe5ef('0x49')]['id']}})[_0xe5ef('0x26')](handleEntityNotFound(_0x1505e9,null))[_0xe5ef('0x26')](function(_0x5cbe7e){if(_0x5cbe7e){_0x2e3c1f=_0x5cbe7e;_0x5e80ae[_0xe5ef('0x31')]=_[_0xe5ef('0x34')](db[_0xe5ef('0x50')]['rawAttributes']);_0x5e80ae[_0xe5ef('0x33')]=_['keys'](_0x1e654b[_0xe5ef('0x33')]);_0x5e80ae[_0xe5ef('0x35')]=_[_0xe5ef('0x36')](_0x5e80ae[_0xe5ef('0x31')],_0x5e80ae['query']);_0x13b787['attributes']=_[_0xe5ef('0x36')](_0x5e80ae[_0xe5ef('0x31')],qs[_0xe5ef('0x38')](_0x1e654b[_0xe5ef('0x33')][_0xe5ef('0x38')]));_0x13b787[_0xe5ef('0x37')]=_0x13b787[_0xe5ef('0x37')]['length']?_0x13b787[_0xe5ef('0x37')]:_0x5e80ae['model'];_0x13b787[_0xe5ef('0x51')]=qs[_0xe5ef('0x3b')](_0x1e654b[_0xe5ef('0x33')][_0xe5ef('0x3b')]);_0x13b787[_0xe5ef('0x3c')]=qs[_0xe5ef('0x35')](_[_0xe5ef('0x3d')](_0x1e654b[_0xe5ef('0x33')],_0x5e80ae[_0xe5ef('0x35')]));if(_0x1e654b[_0xe5ef('0x33')][_0xe5ef('0x3e')]){_0x13b787[_0xe5ef('0x3c')]=_[_0xe5ef('0x3f')](_0x13b787['where'],{'$or':_['map'](_0x13b787['attributes'],function(_0x139d40){var _0x507613={};_0x507613[_0x139d40]={'$like':'%'+_0x1e654b[_0xe5ef('0x33')]['filter']+'%'};return _0x507613;})});}_0x13b787=_[_0xe5ef('0x3f')]({},_0x13b787,_0x1e654b[_0xe5ef('0x42')]);return _0x2e3c1f['getConfigurations'](_0x13b787);}})[_0xe5ef('0x26')](function(_0x58f141){if(_0x58f141){_0x1fca7e=_0x58f141[_0xe5ef('0x39')];if(!_0x1e654b['query'][_0xe5ef('0x52')]('nolimit')){_0x13b787[_0xe5ef('0x1f')]=qs['limit'](_0x1e654b[_0xe5ef('0x33')][_0xe5ef('0x1f')]);_0x13b787['offset']=qs['offset'](_0x1e654b[_0xe5ef('0x33')][_0xe5ef('0x1d')]);}return _0x2e3c1f[_0xe5ef('0x4e')](_0x13b787);}})[_0xe5ef('0x26')](function(_0x1ede6f){if(_0x1ede6f){return _0x1ede6f?{'count':_0x1fca7e,'rows':_0x1ede6f}:null;}})[_0xe5ef('0x26')](respondWithResult(_0x1505e9,null))[_0xe5ef('0x47')](handleError(_0x1505e9,null));};exports[_0xe5ef('0x53')]=function(_0x2c015e,_0x249cf1,_0x40c85b){if(_0x2c015e[_0xe5ef('0x4c')]['id']){delete _0x2c015e['body']['id'];}return db['ServicenowAccount'][_0xe5ef('0x4f')]({'where':{'id':_0x2c015e[_0xe5ef('0x49')]['id']}})[_0xe5ef('0x26')](handleEntityNotFound(_0x249cf1,null))[_0xe5ef('0x26')](function(_0x580aaa){if(_0x580aaa){_0x2c015e['body'][_0xe5ef('0x54')]=_0x580aaa['id'];_0x2c015e[_0xe5ef('0x4c')][_0xe5ef('0x55')]=integrations['getSubjects'](_0x2c015e[_0xe5ef('0x4c')]['channel'],_0x2c015e[_0xe5ef('0x4c')][_0xe5ef('0x40')]);_0x2c015e[_0xe5ef('0x4c')]['Descriptions']=integrations[_0xe5ef('0x56')](_0x2c015e[_0xe5ef('0x4c')]['channel'],_0x2c015e[_0xe5ef('0x4c')]['type']);return db[_0xe5ef('0x50')][_0xe5ef('0x4b')](_0x2c015e['body'],{'include':[{'model':db['ServicenowField'],'as':_0xe5ef('0x55')},{'model':db['ServicenowField'],'as':_0xe5ef('0x57')}]});}return null;})['then'](respondWithResult(_0x249cf1,null))[_0xe5ef('0x47')](handleError(_0x249cf1,null));};exports[_0xe5ef('0x58')]=function(_0x145bbd,_0x480df7,_0x570d3a){var _0x4d93fb=[_0xe5ef('0x59'),'hold_reason',_0xe5ef('0x5a'),_0xe5ef('0x5b'),'close_code','notify',_0xe5ef('0x5c'),_0xe5ef('0x5d'),'category'];var _0x52aa29=[_0xe5ef('0x5e'),_0xe5ef('0x59'),_0xe5ef('0x5f'),'watch_list',_0xe5ef('0x60'),_0xe5ef('0x61'),_0xe5ef('0x62'),_0xe5ef('0x63'),_0xe5ef('0x64'),_0xe5ef('0x65'),_0xe5ef('0x66'),'sys_updated_by',_0xe5ef('0x67'),_0xe5ef('0x68'),_0xe5ef('0x69'),_0xe5ef('0x6a'),_0xe5ef('0x6b'),'sys_created_by',_0xe5ef('0x5a'),_0xe5ef('0x51'),'calendar_stc','closed_at',_0xe5ef('0x6c'),_0xe5ef('0x6d'),_0xe5ef('0x6e'),'active',_0xe5ef('0x6f'),_0xe5ef('0x70'),_0xe5ef('0x71'),_0xe5ef('0x72'),_0xe5ef('0x73'),_0xe5ef('0x74'),_0xe5ef('0x75'),_0xe5ef('0x76'),'business_duration',_0xe5ef('0x77'),_0xe5ef('0x78'),_0xe5ef('0x79'),_0xe5ef('0x7a'),_0xe5ef('0x7b'),_0xe5ef('0x7c'),_0xe5ef('0x5b'),_0xe5ef('0x7d'),_0xe5ef('0x7e'),_0xe5ef('0x7f'),_0xe5ef('0x80'),_0xe5ef('0x81'),_0xe5ef('0x82'),_0xe5ef('0x83'),_0xe5ef('0x84'),_0xe5ef('0x85'),_0xe5ef('0x86'),_0xe5ef('0x87'),_0xe5ef('0x88'),_0xe5ef('0x89'),_0xe5ef('0x8a'),_0xe5ef('0x8b'),_0xe5ef('0x8c'),_0xe5ef('0x8d'),_0xe5ef('0x8e'),'contact_type',_0xe5ef('0x8f'),_0xe5ef('0x5c'),'urgency',_0xe5ef('0x90'),_0xe5ef('0x91'),_0xe5ef('0x92'),_0xe5ef('0x93'),_0xe5ef('0x94'),'severity',_0xe5ef('0x95'),_0xe5ef('0x96'),_0xe5ef('0x97'),_0xe5ef('0x98'),'due_date',_0xe5ef('0x99'),_0xe5ef('0x9a'),_0xe5ef('0x9b'),_0xe5ef('0x9c'),_0xe5ef('0x9d'),_0xe5ef('0x9e'),_0xe5ef('0x9f'),'category'];var _0x2bc969='';var _0x255834='';var _0x20f158=[];var _0x27927a='';var _0x1ba919='';var _0x4ebdc7=[];var _0x5a202c='';var _0x1f61e0='';var _0x3c89c5={};var _0x47148b='';return db[_0xe5ef('0x2d')]['findOne']({'where':{'id':_0x145bbd[_0xe5ef('0x49')]['id']},'attributes':['id',_0xe5ef('0xa0'),_0xe5ef('0xa1'),_0xe5ef('0xa2'),_0xe5ef('0xa3'),'serverUrl']})['then'](handleEntityNotFound(_0x480df7,null))[_0xe5ef('0x26')](function(_0x1f33fd){if(_0x1f33fd){_0x47148b=_0x1f33fd[_0xe5ef('0xa3')];var _0x52f675=_0x47148b[_0xe5ef('0xa4')](-0x1);if(_0x52f675==='/'){_0x47148b=_0x47148b['substring'](0x0,_0x47148b[_0xe5ef('0xa5')](_0x52f675));}_0x1f61e0=util['format'](_0xe5ef('0xa6'),_0x47148b);_0x5a202c=util[_0xe5ef('0xa7')](_0xe5ef('0xa8'),_0x47148b);_0x3c89c5={'user':_0x1f33fd[_0xe5ef('0xa0')],'pass':_0x1f33fd['password']};var _0x2d3def={'method':_0xe5ef('0xa9'),'uri':_0x1f61e0+'incident?sysparm_display_value=all','auth':_0x3c89c5,'json':!![]};return rp(_0x2d3def);}})[_0xe5ef('0x26')](function(_0x15c1b9){if(_0x15c1b9[_0xe5ef('0xaa')][_0xe5ef('0x39')]>0x0){_0x2bc969=_0x15c1b9['result'];}console[_0xe5ef('0xab')](_0xe5ef('0xac'),_0x2bc969);_0x4ebdc7=[];_0x255834=Object['assign']([],_0x2bc969);_[_0xe5ef('0xad')](_0x255834,function(_0x21b7fa){return!_0x4d93fb[_0xe5ef('0xae')](_0x21b7fa['name']);});_0x255834[_0xe5ef('0xaf')](function(_0x1dcc11){var _0x2154e8=createFieldObject(_0x5a202c,_0x3c89c5,_0x1dcc11[_0xe5ef('0xb0')],_0x1dcc11[_0xe5ef('0x2b')],_0x1dcc11[_0xe5ef('0xb1')],![]);_0x4ebdc7['push'](_0x2154e8);});return Promise[_0xe5ef('0xb2')](_0x4ebdc7);})[_0xe5ef('0x26')](function(_0x43ab4b){_0x20f158=_0x43ab4b;_0x27927a=Object[_0xe5ef('0xb3')]([],_0x2bc969);console['log']('TCL:\x20_object',_0x2bc969);_['remove'](_0x27927a,function(_0x410eaf){return _0x52aa29[_0xe5ef('0xae')](_0x410eaf[_0xe5ef('0x2b')]);});console[_0xe5ef('0xab')](_0xe5ef('0xb4'),_0x27927a);_0x4ebdc7=[];_0x27927a['forEach'](function(_0x7b04bd){var _0x46d908=createFieldObject(_0x5a202c,_0x3c89c5,_0x7b04bd[_0xe5ef('0xb0')],_0x7b04bd['name'],_0x7b04bd[_0xe5ef('0xb1')],!![]);_0x4ebdc7[_0xe5ef('0xb5')](_0x46d908);});return Promise[_0xe5ef('0xb2')](_0x4ebdc7);})['then'](function(_0x43c66f){_0x1ba919=_0x43c66f;var _0x82e669=_0x20f158['concat'](_0x1ba919);return{'count':_0x82e669['length'],'rows':_0x82e669};})[_0xe5ef('0x26')](respondWithResult(_0x480df7,null))[_0xe5ef('0x47')](function(_0x2cabdb){console[_0xe5ef('0xab')](_0xe5ef('0xb6')+_0x2cabdb);var _0xa4f9ce=_0x145bbd[_0xe5ef('0x33')][_0xe5ef('0xb7')]?0x1f4:_0x2cabdb['statusCode']||0x1f4;logger[_0xe5ef('0x29')](_0x2cabdb[_0xe5ef('0x2a')]);delete _0x2cabdb[_0xe5ef('0x2b')];if(_0xa4f9ce===0x191){_0xa4f9ce=0x190;}_0x480df7[_0xe5ef('0x1b')](_0xa4f9ce)[_0xe5ef('0x2c')](_0x145bbd['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x2cabdb[_0xe5ef('0xb8')]}:_0x2cabdb);});};function createFieldObject(_0x2ce3fe,_0x40b1b6,_0xaf8051,_0x1c188f,_0x2ad2c4,_0x748ad1){return new Promise(function(_0x2f9046,_0x53a4d0){var _0x175d4e={'id':_0x1c188f,'name':_0x2ad2c4,'custom':_0x748ad1};if(_0xaf8051===_0xe5ef('0xb9')){_0x175d4e[_0xe5ef('0x42')]=[{'name':_0xe5ef('0xba'),'value':_0xe5ef('0xbb')},{'name':_0xe5ef('0xbc'),'value':_0xe5ef('0xbd')}];_0x2f9046(_0x175d4e);}else{var _0xb61bc6={'method':_0xe5ef('0xa9'),'uri':_0x2ce3fe+'sys_choice?sysparm_query=name=incident^element='+_0x1c188f,'auth':_0x40b1b6,'json':!![]};return rp(_0xb61bc6)[_0xe5ef('0x26')](function(_0x1ffdc6){var _0x2dd2ad=[];if(_0x1ffdc6[_0xe5ef('0xaa')]['length']>0x0){_0x1ffdc6[_0xe5ef('0xaa')][_0xe5ef('0xaf')](function(_0x12b01e){if(_0x12b01e[_0xe5ef('0xbe')]===_0xe5ef('0xbd')){var _0x3350aa={'name':_0x12b01e['label'],'value':_0x12b01e[_0xe5ef('0xbf')]};_0x2dd2ad[_0xe5ef('0xb5')](_0x3350aa);}});}_0x175d4e['options']=_0x2dd2ad;if(_0x175d4e[_0xe5ef('0x42')][_0xe5ef('0x39')]>0x0){_0x2f9046(_0x175d4e);}else{if(_0x748ad1==![]){_0x2f9046();}else{_0x2f9046(_0x175d4e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index faa574b..7a9be3a 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 _0xabce=['path','rimraf','../../config/environment','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0xabce,0x103));var _0xeabc=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xabce[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xeabc('0x8')]=function(_0x52a4d7,_0x229ba4){return _0x52a4d7['define'](_0xeabc('0x9'),attributes,{'tableName':_0xeabc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','moment','bluebird'];(function(_0x387d19,_0x3f290e){var _0x27fd4b=function(_0x5db852){while(--_0x5db852){_0x387d19['push'](_0x387d19['shift']());}};_0x27fd4b(++_0x3f290e);}(_0x2675,0x75));var _0x5267=function(_0x37b670,_0x19f70b){_0x37b670=_0x37b670-0x0;var _0x14c3a6=_0x2675[_0x37b670];return _0x14c3a6;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));var integrations=require(_0x5267('0x6'));module[_0x5267('0x7')]=function(_0x10f92c,_0x20f065){return _0x10f92c[_0x5267('0x8')]('ServicenowAccount',attributes,{'tableName':_0x5267('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index d99da28..763f962 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 _0x1043=['ServicenowAccount','options','where','attributes','limit','include','model','map','GetServicenowAccount','debug','find','raw','ShowServicenowAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','then','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','info','catch'];(function(_0x2b9c7c,_0x309a5b){var _0x26f4d8=function(_0xa9b79e){while(--_0xa9b79e){_0x2b9c7c['push'](_0x2b9c7c['shift']());}};_0x26f4d8(++_0x309a5b);}(_0x1043,0x1ad));var _0x3104=function(_0x64a600,_0x3920cb){_0x64a600=_0x64a600-0x0;var _0x10c9fc=_0x1043[_0x64a600];return _0x10c9fc;};'use strict';var _=require('lodash');var util=require(_0x3104('0x0'));var moment=require(_0x3104('0x1'));var BPromise=require(_0x3104('0x2'));var rs=require(_0x3104('0x3'));var fs=require('fs');var Redis=require(_0x3104('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3104('0x5'));var logger=require('../../config/logger')(_0x3104('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3104('0x7')][_0x3104('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c499e,_0x4778ca,_0x3b1605){return new BPromise(function(_0x566387,_0x40f783){return client['request'](_0x4c499e,_0x3b1605)[_0x3104('0x9')](function(_0x34864d){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4778ca,_0x3104('0xa'));logger['debug'](_0x3104('0xb'),_0x4778ca,_0x3104('0xa'),JSON[_0x3104('0xc')](_0x34864d));if(_0x34864d[_0x3104('0xd')]){if(_0x34864d[_0x3104('0xd')][_0x3104('0xe')]===0x1f4){logger[_0x3104('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x4778ca,_0x34864d[_0x3104('0xd')][_0x3104('0xf')]);return _0x40f783(_0x34864d[_0x3104('0xd')][_0x3104('0xf')]);}logger['error'](_0x3104('0x10'),_0x4778ca,_0x34864d['error'][_0x3104('0xf')]);return _0x566387(_0x34864d[_0x3104('0xd')][_0x3104('0xf')]);}else{logger[_0x3104('0x11')](_0x3104('0x10'),_0x4778ca,_0x3104('0xa'));_0x566387(_0x34864d['result']['message']);}})[_0x3104('0x12')](function(_0x21bce0){logger[_0x3104('0xd')](_0x3104('0x10'),_0x4778ca,_0x21bce0);_0x40f783(_0x21bce0);});});}exports['GetServicenowAccount']=function(_0x3ae82d){var _0x17ce52=this;return new Promise(function(_0x2d43c5,_0xd7d3d5){return db[_0x3104('0x13')]['findAll']({'raw':_0x3ae82d[_0x3104('0x14')]?_0x3ae82d[_0x3104('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3ae82d[_0x3104('0x14')]?_0x3ae82d[_0x3104('0x14')][_0x3104('0x15')]||null:null,'attributes':_0x3ae82d['options']?_0x3ae82d[_0x3104('0x14')][_0x3104('0x16')]||null:null,'limit':_0x3ae82d[_0x3104('0x14')]?_0x3ae82d[_0x3104('0x14')][_0x3104('0x17')]||null:null,'include':_0x3ae82d['options']?_0x3ae82d['options']['include']?_['map'](_0x3ae82d[_0x3104('0x14')][_0x3104('0x18')],function(_0x12501e){return{'model':db[_0x12501e[_0x3104('0x19')]],'as':_0x12501e['as'],'attributes':_0x12501e[_0x3104('0x16')],'include':_0x12501e[_0x3104('0x18')]?_[_0x3104('0x1a')](_0x12501e[_0x3104('0x18')],function(_0x286878){return{'model':db[_0x286878[_0x3104('0x19')]],'as':_0x286878['as'],'attributes':_0x286878[_0x3104('0x16')],'include':_0x286878[_0x3104('0x18')]?_[_0x3104('0x1a')](_0x286878[_0x3104('0x18')],function(_0x5b7459){return{'model':db[_0x5b7459[_0x3104('0x19')]],'as':_0x5b7459['as'],'attributes':_0x5b7459[_0x3104('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3104('0x9')](function(_0x2ad61b){logger[_0x3104('0x11')](_0x3104('0x1b'),_0x3ae82d);logger[_0x3104('0x1c')](_0x3104('0x1b'),_0x3ae82d,JSON[_0x3104('0xc')](_0x2ad61b));_0x2d43c5(_0x2ad61b);})['catch'](function(_0x2507bb){logger[_0x3104('0xd')]('GetServicenowAccount',_0x2507bb['message'],_0x3ae82d);_0xd7d3d5(_0x17ce52[_0x3104('0xd')](0x1f4,_0x2507bb['message']));});});};exports['ShowServicenowAccount']=function(_0x2288d6){var _0x1463d5=this;return new Promise(function(_0x5081f2,_0x3c6d79){return db['ServicenowAccount'][_0x3104('0x1d')]({'raw':_0x2288d6[_0x3104('0x14')]?_0x2288d6[_0x3104('0x14')][_0x3104('0x1e')]===undefined?!![]:![]:!![],'where':_0x2288d6['options']?_0x2288d6[_0x3104('0x14')]['where']||null:null,'attributes':_0x2288d6['options']?_0x2288d6[_0x3104('0x14')][_0x3104('0x16')]||null:null,'include':_0x2288d6[_0x3104('0x14')]?_0x2288d6['options'][_0x3104('0x18')]?_[_0x3104('0x1a')](_0x2288d6[_0x3104('0x14')][_0x3104('0x18')],function(_0x43897b){return{'model':db[_0x43897b[_0x3104('0x19')]],'as':_0x43897b['as'],'attributes':_0x43897b[_0x3104('0x16')],'include':_0x43897b['include']?_['map'](_0x43897b[_0x3104('0x18')],function(_0x151574){return{'model':db[_0x151574[_0x3104('0x19')]],'as':_0x151574['as'],'attributes':_0x151574['attributes'],'include':_0x151574[_0x3104('0x18')]?_[_0x3104('0x1a')](_0x151574[_0x3104('0x18')],function(_0x2d515b){return{'model':db[_0x2d515b['model']],'as':_0x2d515b['as'],'attributes':_0x2d515b[_0x3104('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3104('0x9')](function(_0x56a910){logger[_0x3104('0x11')]('ShowServicenowAccount',_0x2288d6);logger['debug'](_0x3104('0x1f'),_0x2288d6,JSON['stringify'](_0x56a910));_0x5081f2(_0x56a910);})[_0x3104('0x12')](function(_0x38e94b){logger[_0x3104('0xd')](_0x3104('0x1f'),_0x38e94b[_0x3104('0xf')],_0x2288d6);_0x3c6d79(_0x1463d5[_0x3104('0xd')](0x1f4,_0x38e94b['message']));});});}; \ No newline at end of file +var _0xe809=['lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','model','include','stringify','catch','map','ShowServicenowAccount'];(function(_0x3e4077,_0x48d561){var _0x4a35d3=function(_0x3b639c){while(--_0x3b639c){_0x3e4077['push'](_0x3e4077['shift']());}};_0x4a35d3(++_0x48d561);}(_0xe809,0x180));var _0x9e80=function(_0x1ccb42,_0x6dd89e){_0x1ccb42=_0x1ccb42-0x0;var _0x1e3d57=_0xe809[_0x1ccb42];return _0x1e3d57;};'use strict';var _=require(_0x9e80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e80('0x1'));var rs=require(_0x9e80('0x2'));var fs=require('fs');var Redis=require(_0x9e80('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e80('0x4'));var config=require(_0x9e80('0x5'));var jayson=require(_0x9e80('0x6'));var client=jayson[_0x9e80('0x7')][_0x9e80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1459f6,_0x3e1c68,_0x164a53){return new BPromise(function(_0x24c538,_0x20172c){return client[_0x9e80('0x9')](_0x1459f6,_0x164a53)[_0x9e80('0xa')](function(_0x2179fe){logger[_0x9e80('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x3e1c68,_0x9e80('0xc'));logger[_0x9e80('0xd')](_0x9e80('0xe'),_0x3e1c68,_0x9e80('0xc'),JSON['stringify'](_0x2179fe));if(_0x2179fe[_0x9e80('0xf')]){if(_0x2179fe[_0x9e80('0xf')][_0x9e80('0x10')]===0x1f4){logger[_0x9e80('0xf')](_0x9e80('0x11'),_0x3e1c68,_0x2179fe[_0x9e80('0xf')]['message']);return _0x20172c(_0x2179fe['error'][_0x9e80('0x12')]);}logger[_0x9e80('0xf')](_0x9e80('0x11'),_0x3e1c68,_0x2179fe[_0x9e80('0xf')]['message']);return _0x24c538(_0x2179fe['error'][_0x9e80('0x12')]);}else{logger[_0x9e80('0xb')](_0x9e80('0x11'),_0x3e1c68,_0x9e80('0xc'));_0x24c538(_0x2179fe[_0x9e80('0x13')][_0x9e80('0x12')]);}})['catch'](function(_0x1c4516){logger['error'](_0x9e80('0x11'),_0x3e1c68,_0x1c4516);_0x20172c(_0x1c4516);});});}exports[_0x9e80('0x14')]=function(_0x28b0d4){var _0x8ad220=this;return new Promise(function(_0x2a9b28,_0x51ba00){return db[_0x9e80('0x15')]['findAll']({'raw':_0x28b0d4['options']?_0x28b0d4[_0x9e80('0x16')][_0x9e80('0x17')]===undefined?!![]:![]:!![],'where':_0x28b0d4[_0x9e80('0x16')]?_0x28b0d4[_0x9e80('0x16')]['where']||null:null,'attributes':_0x28b0d4[_0x9e80('0x16')]?_0x28b0d4['options'][_0x9e80('0x18')]||null:null,'limit':_0x28b0d4[_0x9e80('0x16')]?_0x28b0d4[_0x9e80('0x16')][_0x9e80('0x19')]||null:null,'include':_0x28b0d4[_0x9e80('0x16')]?_0x28b0d4[_0x9e80('0x16')]['include']?_['map'](_0x28b0d4[_0x9e80('0x16')]['include'],function(_0x56dc41){return{'model':db[_0x56dc41[_0x9e80('0x1a')]],'as':_0x56dc41['as'],'attributes':_0x56dc41[_0x9e80('0x18')],'include':_0x56dc41[_0x9e80('0x1b')]?_['map'](_0x56dc41[_0x9e80('0x1b')],function(_0xefa33a){return{'model':db[_0xefa33a[_0x9e80('0x1a')]],'as':_0xefa33a['as'],'attributes':_0xefa33a['attributes'],'include':_0xefa33a[_0x9e80('0x1b')]?_['map'](_0xefa33a[_0x9e80('0x1b')],function(_0x4d9f9a){return{'model':db[_0x4d9f9a['model']],'as':_0x4d9f9a['as'],'attributes':_0x4d9f9a[_0x9e80('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9e80('0xa')](function(_0x4fb85b){logger[_0x9e80('0xb')]('GetServicenowAccount',_0x28b0d4);logger['debug'](_0x9e80('0x14'),_0x28b0d4,JSON[_0x9e80('0x1c')](_0x4fb85b));_0x2a9b28(_0x4fb85b);})[_0x9e80('0x1d')](function(_0x21f2e9){logger[_0x9e80('0xf')](_0x9e80('0x14'),_0x21f2e9[_0x9e80('0x12')],_0x28b0d4);_0x51ba00(_0x8ad220['error'](0x1f4,_0x21f2e9['message']));});});};exports['ShowServicenowAccount']=function(_0x51125c){var _0x3cf399=this;return new Promise(function(_0x207dce,_0x1c51fe){return db['ServicenowAccount']['find']({'raw':_0x51125c[_0x9e80('0x16')]?_0x51125c[_0x9e80('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x51125c[_0x9e80('0x16')]?_0x51125c[_0x9e80('0x16')]['where']||null:null,'attributes':_0x51125c['options']?_0x51125c[_0x9e80('0x16')][_0x9e80('0x18')]||null:null,'include':_0x51125c[_0x9e80('0x16')]?_0x51125c[_0x9e80('0x16')][_0x9e80('0x1b')]?_['map'](_0x51125c['options']['include'],function(_0x367346){return{'model':db[_0x367346[_0x9e80('0x1a')]],'as':_0x367346['as'],'attributes':_0x367346['attributes'],'include':_0x367346[_0x9e80('0x1b')]?_[_0x9e80('0x1e')](_0x367346['include'],function(_0x530e47){return{'model':db[_0x530e47[_0x9e80('0x1a')]],'as':_0x530e47['as'],'attributes':_0x530e47[_0x9e80('0x18')],'include':_0x530e47[_0x9e80('0x1b')]?_[_0x9e80('0x1e')](_0x530e47[_0x9e80('0x1b')],function(_0x3082f6){return{'model':db[_0x3082f6[_0x9e80('0x1a')]],'as':_0x3082f6['as'],'attributes':_0x3082f6[_0x9e80('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9e80('0xa')](function(_0x200449){logger[_0x9e80('0xb')]('ShowServicenowAccount',_0x51125c);logger[_0x9e80('0xd')](_0x9e80('0x1f'),_0x51125c,JSON[_0x9e80('0x1c')](_0x200449));_0x207dce(_0x200449);})[_0x9e80('0x1d')](function(_0xdf4619){logger[_0x9e80('0xf')]('ShowServicenowAccount',_0xdf4619[_0x9e80('0x12')],_0x51125c);_0x1c51fe(_0x3cf399[_0x9e80('0xf')](0x1f4,_0xdf4619[_0x9e80('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 02ed983..3b621ae 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 _0xf818=['express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','path','connect-timeout'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xf818,0x8a));var _0x8f81=function(_0x459eaa,_0x510c7c){_0x459eaa=_0x459eaa-0x0;var _0x16cc1a=_0xf818[_0x459eaa];return _0x16cc1a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8f81('0x0'));var timeout=require(_0x8f81('0x1'));var express=require(_0x8f81('0x2'));var router=express['Router']();var fs_extra=require(_0x8f81('0x3'));var auth=require(_0x8f81('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8f81('0x5'));var controller=require(_0x8f81('0x6'));router['get']('/',auth[_0x8f81('0x7')](),controller[_0x8f81('0x8')]);router['get'](_0x8f81('0x9'),auth['isAuthenticated'](),controller[_0x8f81('0xa')]);router[_0x8f81('0xb')]('/:id/fields',auth[_0x8f81('0x7')](),controller['getFields']);router['get'](_0x8f81('0xc'),auth[_0x8f81('0x7')](),controller['getSubjects']);router['get'](_0x8f81('0xd'),auth['isAuthenticated'](),controller[_0x8f81('0xe')]);router[_0x8f81('0xf')]('/',auth[_0x8f81('0x7')](),controller[_0x8f81('0x10')]);router[_0x8f81('0x11')]('/:id',auth[_0x8f81('0x7')](),controller['update']);router[_0x8f81('0x12')](_0x8f81('0x9'),auth[_0x8f81('0x7')](),controller[_0x8f81('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6973=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','destroy','exports'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x6973,0x1e0));var _0x3697=function(_0xbb9c12,_0x15883a){_0xbb9c12=_0xbb9c12-0x0;var _0x200e05=_0x6973[_0xbb9c12];return _0x200e05;};'use strict';var multer=require(_0x3697('0x0'));var util=require(_0x3697('0x1'));var path=require(_0x3697('0x2'));var timeout=require('connect-timeout');var express=require(_0x3697('0x3'));var router=express['Router']();var fs_extra=require(_0x3697('0x4'));var auth=require(_0x3697('0x5'));var interaction=require(_0x3697('0x6'));var config=require(_0x3697('0x7'));var controller=require(_0x3697('0x8'));router[_0x3697('0x9')]('/',auth[_0x3697('0xa')](),controller['index']);router[_0x3697('0x9')](_0x3697('0xb'),auth[_0x3697('0xa')](),controller[_0x3697('0xc')]);router[_0x3697('0x9')](_0x3697('0xd'),auth[_0x3697('0xa')](),controller[_0x3697('0xe')]);router[_0x3697('0x9')](_0x3697('0xf'),auth[_0x3697('0xa')](),controller[_0x3697('0x10')]);router[_0x3697('0x9')]('/:id/descriptions',auth[_0x3697('0xa')](),controller[_0x3697('0x11')]);router[_0x3697('0x12')]('/',auth['isAuthenticated'](),controller[_0x3697('0x13')]);router[_0x3697('0x14')](_0x3697('0xb'),auth[_0x3697('0xa')](),controller[_0x3697('0x15')]);router['delete'](_0x3697('0xb'),auth['isAuthenticated'](),controller[_0x3697('0x16')]);module[_0x3697('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 89b50c8..6bccb22 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 _0xb44e=['exports','STRING','sequelize'];(function(_0x267fa2,_0x339f2b){var _0x45a6b7=function(_0xce88b7){while(--_0xce88b7){_0x267fa2['push'](_0x267fa2['shift']());}};_0x45a6b7(++_0x339f2b);}(_0xb44e,0xaa));var _0xeb44=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xb44e[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0xeb44('0x0'));module[_0xeb44('0x1')]={'name':{'type':Sequelize[_0xeb44('0x2')]},'description':{'type':Sequelize[_0xeb44('0x2')]}}; \ No newline at end of file +var _0x7374=['sequelize','exports'];(function(_0x2274e9,_0x35e858){var _0x10af77=function(_0x1941cd){while(--_0x1941cd){_0x2274e9['push'](_0x2274e9['shift']());}};_0x10af77(++_0x35e858);}(_0x7374,0x90));var _0x4737=function(_0x5200fc,_0x2727bc){_0x5200fc=_0x5200fc-0x0;var _0x5b2d3b=_0x7374[_0x5200fc];return _0x5b2d3b;};'use strict';var Sequelize=require(_0x4737('0x0'));module[_0x4737('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 3ee93c6..5f7c429 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 _0x5f01=['filters','attributes','intersection','fields','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','getFields','filter','getSubjects','findOne','getDescriptions','ServicenowField','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x528dad,_0x5cbc8b){var _0x4eb1a1=function(_0x2f9501){while(--_0x2f9501){_0x528dad['push'](_0x528dad['shift']());}};_0x4eb1a1(++_0x5cbc8b);}(_0x5f01,0x172));var _0x15f0=function(_0x2576fb,_0x2000e2){_0x2576fb=_0x2576fb-0x0;var _0x1ef706=_0x5f01[_0x2576fb];return _0x1ef706;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15f0('0x0'));var zipdir=require(_0x15f0('0x1'));var jsonpatch=require(_0x15f0('0x2'));var rp=require(_0x15f0('0x3'));var moment=require(_0x15f0('0x4'));var BPromise=require(_0x15f0('0x5'));var Mustache=require(_0x15f0('0x6'));var util=require(_0x15f0('0x7'));var path=require('path');var sox=require(_0x15f0('0x8'));var csv=require(_0x15f0('0x9'));var ejs=require(_0x15f0('0xa'));var fs=require('fs');var fs_extra=require(_0x15f0('0xb'));var _=require(_0x15f0('0xc'));var squel=require(_0x15f0('0xd'));var crypto=require(_0x15f0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x15f0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x15f0('0x10'));var Papa=require('papaparse');var Redis=require(_0x15f0('0x11'));var authService=require(_0x15f0('0x12'));var qs=require(_0x15f0('0x13'));var as=require(_0x15f0('0x14'));var hardwareService=require(_0x15f0('0x15'));var logger=require(_0x15f0('0x16'))('api');var utils=require(_0x15f0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x15f0('0x18'));var db=require(_0x15f0('0x19'))['db'];function respondWithStatusCode(_0x3573a4,_0x2cf339){_0x2cf339=_0x2cf339||0xcc;return function(_0x128a24){if(_0x128a24){return _0x3573a4[_0x15f0('0x1a')](_0x2cf339);}return _0x3573a4[_0x15f0('0x1b')](_0x2cf339)[_0x15f0('0x1c')]();};}function respondWithResult(_0x4e3852,_0x2b7df7){_0x2b7df7=_0x2b7df7||0xc8;return function(_0x2598eb){if(_0x2598eb){return _0x4e3852['status'](_0x2b7df7)['json'](_0x2598eb);}};}function respondWithFilteredResult(_0xa920e4,_0x17df90){return function(_0x2ec56f){if(_0x2ec56f){var _0x15f3d7=typeof _0x17df90[_0x15f0('0x1d')]==='undefined'&&typeof _0x17df90[_0x15f0('0x1e')]===_0x15f0('0x1f');var _0xaaf0ac=_0x2ec56f['count'];var _0x19ad3f=_0x15f3d7?0x0:_0x17df90[_0x15f0('0x1d')];var _0x429029=_0x15f3d7?_0x2ec56f[_0x15f0('0x20')]:_0x17df90[_0x15f0('0x1d')]+_0x17df90['limit'];var _0x2e4b4f;if(_0x429029>=_0xaaf0ac){_0x429029=_0xaaf0ac;_0x2e4b4f=0xc8;}else{_0x2e4b4f=0xce;}_0xa920e4[_0x15f0('0x1b')](_0x2e4b4f);return _0xa920e4['set'](_0x15f0('0x21'),_0x19ad3f+'-'+_0x429029+'/'+_0xaaf0ac)[_0x15f0('0x22')](_0x2ec56f);}return null;};}function patchUpdates(_0x41ad8e){return function(_0x5953f8){try{jsonpatch[_0x15f0('0x23')](_0x5953f8,_0x41ad8e,!![]);}catch(_0x3245b5){return BPromise[_0x15f0('0x24')](_0x3245b5);}return _0x5953f8[_0x15f0('0x25')]();};}function saveUpdates(_0xb9d97e,_0x581a27){return function(_0x46034b){if(_0x46034b){return _0x46034b[_0x15f0('0x26')](_0xb9d97e)['then'](function(_0x451059){return _0x451059;});}return null;};}function removeEntity(_0x712850,_0x4ff28b){return function(_0x1b15ee){if(_0x1b15ee){return _0x1b15ee[_0x15f0('0x27')]()[_0x15f0('0x28')](function(){_0x712850[_0x15f0('0x1b')](0xcc)[_0x15f0('0x1c')]();});}};}function handleEntityNotFound(_0x5c5140,_0x29c850){return function(_0x3bc8b4){if(!_0x3bc8b4){_0x5c5140[_0x15f0('0x1a')](0x194);}return _0x3bc8b4;};}function handleError(_0x52628a,_0x38224b){_0x38224b=_0x38224b||0x1f4;return function(_0x1ee63b){logger[_0x15f0('0x29')](_0x1ee63b[_0x15f0('0x2a')]);if(_0x1ee63b[_0x15f0('0x2b')]){delete _0x1ee63b[_0x15f0('0x2b')];}_0x52628a[_0x15f0('0x1b')](_0x38224b)[_0x15f0('0x2c')](_0x1ee63b);};}exports[_0x15f0('0x2d')]=function(_0x25c4eb,_0xc579fa){var _0x3b11f4={},_0x4797dc={},_0x4b263b={'count':0x0,'rows':[]};var _0x3a15b2=_[_0x15f0('0x2e')](db[_0x15f0('0x2f')][_0x15f0('0x30')],function(_0x7e9fb6){return{'name':_0x7e9fb6[_0x15f0('0x31')],'type':_0x7e9fb6[_0x15f0('0x32')][_0x15f0('0x33')]};});_0x4797dc[_0x15f0('0x34')]=_['map'](_0x3a15b2,_0x15f0('0x2b'));_0x4797dc[_0x15f0('0x35')]=_[_0x15f0('0x36')](_0x25c4eb[_0x15f0('0x35')]);_0x4797dc[_0x15f0('0x37')]=_['intersection'](_0x4797dc[_0x15f0('0x34')],_0x4797dc['query']);_0x3b11f4[_0x15f0('0x38')]=_[_0x15f0('0x39')](_0x4797dc[_0x15f0('0x34')],qs[_0x15f0('0x3a')](_0x25c4eb[_0x15f0('0x35')][_0x15f0('0x3a')]));_0x3b11f4['attributes']=_0x3b11f4['attributes']['length']?_0x3b11f4[_0x15f0('0x38')]:_0x4797dc[_0x15f0('0x34')];if(!_0x25c4eb[_0x15f0('0x35')]['hasOwnProperty'](_0x15f0('0x3b'))){_0x3b11f4[_0x15f0('0x1e')]=qs['limit'](_0x25c4eb[_0x15f0('0x35')][_0x15f0('0x1e')]);_0x3b11f4['offset']=qs[_0x15f0('0x1d')](_0x25c4eb[_0x15f0('0x35')]['offset']);}_0x3b11f4[_0x15f0('0x3c')]=qs[_0x15f0('0x3d')](_0x25c4eb[_0x15f0('0x35')]['sort']);_0x3b11f4[_0x15f0('0x3e')]=qs[_0x15f0('0x37')](_[_0x15f0('0x3f')](_0x25c4eb[_0x15f0('0x35')],_0x4797dc[_0x15f0('0x37')]),_0x3a15b2);if(_0x25c4eb[_0x15f0('0x35')]['filter']){_0x3b11f4[_0x15f0('0x3e')]=_['merge'](_0x3b11f4['where'],{'$or':_['map'](_0x3a15b2,function(_0x58e5d9){if(_0x58e5d9[_0x15f0('0x32')]!==_0x15f0('0x40')){var _0x61f799={};_0x61f799[_0x58e5d9[_0x15f0('0x2b')]]={'$like':'%'+_0x25c4eb[_0x15f0('0x35')]['filter']+'%'};return _0x61f799;}})});}_0x3b11f4=_[_0x15f0('0x41')]({},_0x3b11f4,_0x25c4eb['options']);var _0x41f729={'where':_0x3b11f4[_0x15f0('0x3e')]};return db['ServicenowConfiguration'][_0x15f0('0x20')](_0x41f729)[_0x15f0('0x28')](function(_0x35bd63){_0x4b263b[_0x15f0('0x20')]=_0x35bd63;if(_0x25c4eb[_0x15f0('0x35')][_0x15f0('0x42')]){_0x3b11f4[_0x15f0('0x43')]=[{'all':!![]}];}return db[_0x15f0('0x2f')][_0x15f0('0x44')](_0x3b11f4);})[_0x15f0('0x28')](function(_0xf95f6){_0x4b263b[_0x15f0('0x45')]=_0xf95f6;return _0x4b263b;})['then'](respondWithFilteredResult(_0xc579fa,_0x3b11f4))[_0x15f0('0x46')](handleError(_0xc579fa,null));};exports[_0x15f0('0x47')]=function(_0x24c038,_0x587ab2){var _0x409d1f={'raw':![],'where':{'id':_0x24c038[_0x15f0('0x48')]['id']}},_0x4732d5={};_0x4732d5['model']=_[_0x15f0('0x36')](db['ServicenowConfiguration'][_0x15f0('0x30')]);_0x4732d5['query']=_[_0x15f0('0x36')](_0x24c038[_0x15f0('0x35')]);_0x4732d5[_0x15f0('0x37')]=_[_0x15f0('0x39')](_0x4732d5['model'],_0x4732d5[_0x15f0('0x35')]);_0x409d1f[_0x15f0('0x38')]=_[_0x15f0('0x39')](_0x4732d5[_0x15f0('0x34')],qs[_0x15f0('0x3a')](_0x24c038['query'][_0x15f0('0x3a')]));_0x409d1f[_0x15f0('0x38')]=_0x409d1f[_0x15f0('0x38')][_0x15f0('0x49')]?_0x409d1f[_0x15f0('0x38')]:_0x4732d5[_0x15f0('0x34')];if(_0x24c038[_0x15f0('0x35')]['includeAll']){_0x409d1f[_0x15f0('0x43')]=[{'all':!![]}];}_0x409d1f=_['merge']({},_0x409d1f,_0x24c038[_0x15f0('0x4a')]);return db[_0x15f0('0x2f')][_0x15f0('0x4b')](_0x409d1f)['then'](handleEntityNotFound(_0x587ab2,null))[_0x15f0('0x28')](respondWithResult(_0x587ab2,null))['catch'](handleError(_0x587ab2,null));};exports[_0x15f0('0x4c')]=function(_0x5a25e0,_0x204aa2){return db[_0x15f0('0x2f')][_0x15f0('0x4c')](_0x5a25e0['body'],{})[_0x15f0('0x28')](respondWithResult(_0x204aa2,0xc9))[_0x15f0('0x46')](handleError(_0x204aa2,null));};exports['update']=function(_0x43bd9a,_0x50b78f){if(_0x43bd9a['body']['id']){delete _0x43bd9a[_0x15f0('0x4d')]['id'];}return db[_0x15f0('0x2f')][_0x15f0('0x4b')]({'where':{'id':_0x43bd9a[_0x15f0('0x48')]['id']}})[_0x15f0('0x28')](handleEntityNotFound(_0x50b78f,null))[_0x15f0('0x28')](saveUpdates(_0x43bd9a[_0x15f0('0x4d')],null))['then'](respondWithResult(_0x50b78f,null))[_0x15f0('0x46')](handleError(_0x50b78f,null));};exports['destroy']=function(_0x13b05d,_0x488586){return db[_0x15f0('0x2f')][_0x15f0('0x4b')]({'where':{'id':_0x13b05d[_0x15f0('0x48')]['id']}})[_0x15f0('0x28')](handleEntityNotFound(_0x488586,null))[_0x15f0('0x28')](removeEntity(_0x488586,null))['catch'](handleError(_0x488586,null));};exports[_0x15f0('0x4e')]=function(_0x27482f,_0x12e46c,_0xfb74c0){var _0x3c3baa={};var _0x106683={};var _0x257aa4;var _0x2e1b3a;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x27482f['params']['id']}})['then'](handleEntityNotFound(_0x12e46c,null))[_0x15f0('0x28')](function(_0x46fd13){if(_0x46fd13){_0x257aa4=_0x46fd13;_0x106683[_0x15f0('0x34')]=_[_0x15f0('0x36')](db['ServicenowField'][_0x15f0('0x30')]);_0x106683['query']=_[_0x15f0('0x36')](_0x27482f[_0x15f0('0x35')]);_0x106683[_0x15f0('0x37')]=_[_0x15f0('0x39')](_0x106683['model'],_0x106683[_0x15f0('0x35')]);_0x3c3baa[_0x15f0('0x38')]=_[_0x15f0('0x39')](_0x106683[_0x15f0('0x34')],qs['fields'](_0x27482f[_0x15f0('0x35')]['fields']));_0x3c3baa[_0x15f0('0x38')]=_0x3c3baa[_0x15f0('0x38')]['length']?_0x3c3baa['attributes']:_0x106683[_0x15f0('0x34')];_0x3c3baa[_0x15f0('0x3c')]=qs['sort'](_0x27482f[_0x15f0('0x35')][_0x15f0('0x3d')]);_0x3c3baa['where']=qs[_0x15f0('0x37')](_[_0x15f0('0x3f')](_0x27482f['query'],_0x106683[_0x15f0('0x37')]));if(_0x27482f[_0x15f0('0x35')][_0x15f0('0x4f')]){_0x3c3baa[_0x15f0('0x3e')]=_[_0x15f0('0x41')](_0x3c3baa[_0x15f0('0x3e')],{'$or':_['map'](_0x3c3baa[_0x15f0('0x38')],function(_0xe120d1){var _0x3912a0={};_0x3912a0[_0xe120d1]={'$like':'%'+_0x27482f[_0x15f0('0x35')]['filter']+'%'};return _0x3912a0;})});}_0x3c3baa=_[_0x15f0('0x41')]({},_0x3c3baa,_0x27482f[_0x15f0('0x4a')]);return _0x257aa4['getFields'](_0x3c3baa);}})[_0x15f0('0x28')](function(_0x7737ba){if(_0x7737ba){_0x2e1b3a=_0x7737ba[_0x15f0('0x49')];if(!_0x27482f[_0x15f0('0x35')]['hasOwnProperty']('nolimit')){_0x3c3baa[_0x15f0('0x1e')]=qs['limit'](_0x27482f['query'][_0x15f0('0x1e')]);_0x3c3baa[_0x15f0('0x1d')]=qs[_0x15f0('0x1d')](_0x27482f[_0x15f0('0x35')][_0x15f0('0x1d')]);}return _0x257aa4[_0x15f0('0x4e')](_0x3c3baa);}})[_0x15f0('0x28')](function(_0x213000){if(_0x213000){return _0x213000?{'count':_0x2e1b3a,'rows':_0x213000}:null;}})[_0x15f0('0x28')](respondWithResult(_0x12e46c,null))['catch'](handleError(_0x12e46c,null));};exports[_0x15f0('0x50')]=function(_0x2d5b31,_0x16b4a5,_0x681660){var _0x1f72c1={};var _0x165148={};var _0x2263b4;var _0x4fc427;return db[_0x15f0('0x2f')][_0x15f0('0x51')]({'where':{'id':_0x2d5b31[_0x15f0('0x48')]['id']}})[_0x15f0('0x28')](handleEntityNotFound(_0x16b4a5,null))['then'](function(_0xb40f82){if(_0xb40f82){_0x2263b4=_0xb40f82;_0x165148[_0x15f0('0x34')]=_[_0x15f0('0x36')](db['ServicenowField'][_0x15f0('0x30')]);_0x165148[_0x15f0('0x35')]=_[_0x15f0('0x36')](_0x2d5b31[_0x15f0('0x35')]);_0x165148[_0x15f0('0x37')]=_['intersection'](_0x165148[_0x15f0('0x34')],_0x165148[_0x15f0('0x35')]);_0x1f72c1['attributes']=_[_0x15f0('0x39')](_0x165148[_0x15f0('0x34')],qs['fields'](_0x2d5b31[_0x15f0('0x35')][_0x15f0('0x3a')]));_0x1f72c1[_0x15f0('0x38')]=_0x1f72c1[_0x15f0('0x38')][_0x15f0('0x49')]?_0x1f72c1[_0x15f0('0x38')]:_0x165148[_0x15f0('0x34')];_0x1f72c1[_0x15f0('0x3c')]=qs[_0x15f0('0x3d')](_0x2d5b31['query'][_0x15f0('0x3d')]);_0x1f72c1[_0x15f0('0x3e')]=qs['filters'](_[_0x15f0('0x3f')](_0x2d5b31[_0x15f0('0x35')],_0x165148[_0x15f0('0x37')]));if(_0x2d5b31[_0x15f0('0x35')][_0x15f0('0x4f')]){_0x1f72c1[_0x15f0('0x3e')]=_['merge'](_0x1f72c1[_0x15f0('0x3e')],{'$or':_['map'](_0x1f72c1[_0x15f0('0x38')],function(_0x59ab9b){var _0x496ab3={};_0x496ab3[_0x59ab9b]={'$like':'%'+_0x2d5b31[_0x15f0('0x35')]['filter']+'%'};return _0x496ab3;})});}_0x1f72c1=_[_0x15f0('0x41')]({},_0x1f72c1,_0x2d5b31[_0x15f0('0x4a')]);return _0x2263b4['getSubjects'](_0x1f72c1);}})['then'](function(_0x2cb525){if(_0x2cb525){_0x4fc427=_0x2cb525[_0x15f0('0x49')];if(!_0x2d5b31[_0x15f0('0x35')]['hasOwnProperty']('nolimit')){_0x1f72c1['limit']=qs[_0x15f0('0x1e')](_0x2d5b31[_0x15f0('0x35')][_0x15f0('0x1e')]);_0x1f72c1['offset']=qs['offset'](_0x2d5b31[_0x15f0('0x35')][_0x15f0('0x1d')]);}return _0x2263b4[_0x15f0('0x50')](_0x1f72c1);}})[_0x15f0('0x28')](function(_0x10015a){if(_0x10015a){return _0x10015a?{'count':_0x4fc427,'rows':_0x10015a}:null;}})[_0x15f0('0x28')](respondWithResult(_0x16b4a5,null))[_0x15f0('0x46')](handleError(_0x16b4a5,null));};exports[_0x15f0('0x52')]=function(_0x561c8e,_0x456a3c,_0x280ef9){var _0x28c91a={};var _0x20864b={};var _0x23bc2f;var _0xba4fa2;return db['ServicenowConfiguration'][_0x15f0('0x51')]({'where':{'id':_0x561c8e[_0x15f0('0x48')]['id']}})[_0x15f0('0x28')](handleEntityNotFound(_0x456a3c,null))['then'](function(_0x6b2a1b){if(_0x6b2a1b){_0x23bc2f=_0x6b2a1b;_0x20864b['model']=_['keys'](db[_0x15f0('0x53')][_0x15f0('0x30')]);_0x20864b[_0x15f0('0x35')]=_[_0x15f0('0x36')](_0x561c8e[_0x15f0('0x35')]);_0x20864b['filters']=_[_0x15f0('0x39')](_0x20864b[_0x15f0('0x34')],_0x20864b[_0x15f0('0x35')]);_0x28c91a[_0x15f0('0x38')]=_[_0x15f0('0x39')](_0x20864b[_0x15f0('0x34')],qs[_0x15f0('0x3a')](_0x561c8e[_0x15f0('0x35')][_0x15f0('0x3a')]));_0x28c91a[_0x15f0('0x38')]=_0x28c91a['attributes'][_0x15f0('0x49')]?_0x28c91a[_0x15f0('0x38')]:_0x20864b[_0x15f0('0x34')];_0x28c91a['order']=qs[_0x15f0('0x3d')](_0x561c8e[_0x15f0('0x35')][_0x15f0('0x3d')]);_0x28c91a[_0x15f0('0x3e')]=qs[_0x15f0('0x37')](_[_0x15f0('0x3f')](_0x561c8e[_0x15f0('0x35')],_0x20864b['filters']));if(_0x561c8e['query'][_0x15f0('0x4f')]){_0x28c91a['where']=_[_0x15f0('0x41')](_0x28c91a[_0x15f0('0x3e')],{'$or':_[_0x15f0('0x2e')](_0x28c91a['attributes'],function(_0x2e21bd){var _0x57228b={};_0x57228b[_0x2e21bd]={'$like':'%'+_0x561c8e[_0x15f0('0x35')]['filter']+'%'};return _0x57228b;})});}_0x28c91a=_['merge']({},_0x28c91a,_0x561c8e['options']);return _0x23bc2f[_0x15f0('0x52')](_0x28c91a);}})['then'](function(_0x5502f0){if(_0x5502f0){_0xba4fa2=_0x5502f0[_0x15f0('0x49')];if(!_0x561c8e['query'][_0x15f0('0x54')](_0x15f0('0x3b'))){_0x28c91a[_0x15f0('0x1e')]=qs[_0x15f0('0x1e')](_0x561c8e[_0x15f0('0x35')][_0x15f0('0x1e')]);_0x28c91a[_0x15f0('0x1d')]=qs[_0x15f0('0x1d')](_0x561c8e['query']['offset']);}return _0x23bc2f[_0x15f0('0x52')](_0x28c91a);}})[_0x15f0('0x28')](function(_0x49c5f4){if(_0x49c5f4){return _0x49c5f4?{'count':_0xba4fa2,'rows':_0x49c5f4}:null;}})['then'](respondWithResult(_0x456a3c,null))[_0x15f0('0x46')](handleError(_0x456a3c,null));}; \ No newline at end of file +var _0x4b6b=['error','stack','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','name','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne','nolimit','getSubjects','ServicenowField','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then'];(function(_0x3d9105,_0x11d562){var _0x1fd3f6=function(_0x257d41){while(--_0x257d41){_0x3d9105['push'](_0x3d9105['shift']());}};_0x1fd3f6(++_0x11d562);}(_0x4b6b,0x16c));var _0xb4b6=function(_0x4e265f,_0x37b10a){_0x4e265f=_0x4e265f-0x0;var _0x29d678=_0x4b6b[_0x4e265f];return _0x29d678;};'use strict';var emlformat=require(_0xb4b6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb4b6('0x1'));var rp=require(_0xb4b6('0x2'));var moment=require(_0xb4b6('0x3'));var BPromise=require(_0xb4b6('0x4'));var Mustache=require(_0xb4b6('0x5'));var util=require(_0xb4b6('0x6'));var path=require(_0xb4b6('0x7'));var sox=require(_0xb4b6('0x8'));var csv=require('to-csv');var ejs=require(_0xb4b6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4b6('0xa'));var squel=require(_0xb4b6('0xb'));var crypto=require(_0xb4b6('0xc'));var jsforce=require(_0xb4b6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb4b6('0xe'));var querystring=require(_0xb4b6('0xf'));var Papa=require(_0xb4b6('0x10'));var Redis=require(_0xb4b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb4b6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4b6('0x13'));var logger=require(_0xb4b6('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb4b6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4b6('0x16'))['db'];function respondWithStatusCode(_0x36e2b0,_0x236ea1){_0x236ea1=_0x236ea1||0xcc;return function(_0x4e45bf){if(_0x4e45bf){return _0x36e2b0[_0xb4b6('0x17')](_0x236ea1);}return _0x36e2b0['status'](_0x236ea1)[_0xb4b6('0x18')]();};}function respondWithResult(_0x11b83a,_0x1cdb54){_0x1cdb54=_0x1cdb54||0xc8;return function(_0x9979bc){if(_0x9979bc){return _0x11b83a[_0xb4b6('0x19')](_0x1cdb54)[_0xb4b6('0x1a')](_0x9979bc);}};}function respondWithFilteredResult(_0x4c4862,_0x2be105){return function(_0x760d23){if(_0x760d23){var _0x380db6=typeof _0x2be105[_0xb4b6('0x1b')]===_0xb4b6('0x1c')&&typeof _0x2be105['limit']===_0xb4b6('0x1c');var _0x2f517b=_0x760d23[_0xb4b6('0x1d')];var _0x47d623=_0x380db6?0x0:_0x2be105[_0xb4b6('0x1b')];var _0xf83736=_0x380db6?_0x760d23['count']:_0x2be105[_0xb4b6('0x1b')]+_0x2be105['limit'];var _0x49b55d;if(_0xf83736>=_0x2f517b){_0xf83736=_0x2f517b;_0x49b55d=0xc8;}else{_0x49b55d=0xce;}_0x4c4862[_0xb4b6('0x19')](_0x49b55d);return _0x4c4862[_0xb4b6('0x1e')](_0xb4b6('0x1f'),_0x47d623+'-'+_0xf83736+'/'+_0x2f517b)[_0xb4b6('0x1a')](_0x760d23);}return null;};}function patchUpdates(_0x23c5db){return function(_0x19f4bc){try{jsonpatch[_0xb4b6('0x20')](_0x19f4bc,_0x23c5db,!![]);}catch(_0x20ca77){return BPromise[_0xb4b6('0x21')](_0x20ca77);}return _0x19f4bc['save']();};}function saveUpdates(_0xeaa168,_0x5b6e4a){return function(_0x50f6e7){if(_0x50f6e7){return _0x50f6e7[_0xb4b6('0x22')](_0xeaa168)['then'](function(_0x477b1f){return _0x477b1f;});}return null;};}function removeEntity(_0x328a63,_0x1c4a14){return function(_0x252f0b){if(_0x252f0b){return _0x252f0b['destroy']()[_0xb4b6('0x23')](function(){_0x328a63['status'](0xcc)[_0xb4b6('0x18')]();});}};}function handleEntityNotFound(_0xfa7519,_0x230190){return function(_0x3b6ff5){if(!_0x3b6ff5){_0xfa7519[_0xb4b6('0x17')](0x194);}return _0x3b6ff5;};}function handleError(_0x28030d,_0x5526e6){_0x5526e6=_0x5526e6||0x1f4;return function(_0xd93776){logger[_0xb4b6('0x24')](_0xd93776[_0xb4b6('0x25')]);if(_0xd93776['name']){delete _0xd93776['name'];}_0x28030d[_0xb4b6('0x19')](_0x5526e6)['send'](_0xd93776);};}exports[_0xb4b6('0x26')]=function(_0x126dbb,_0x4c790c){var _0x5624a9={},_0x50dab2={},_0x4a6e15={'count':0x0,'rows':[]};var _0x149dda=_[_0xb4b6('0x27')](db[_0xb4b6('0x28')][_0xb4b6('0x29')],function(_0xe0793b){return{'name':_0xe0793b[_0xb4b6('0x2a')],'type':_0xe0793b[_0xb4b6('0x2b')][_0xb4b6('0x2c')]};});_0x50dab2['model']=_[_0xb4b6('0x27')](_0x149dda,_0xb4b6('0x2d'));_0x50dab2['query']=_[_0xb4b6('0x2e')](_0x126dbb[_0xb4b6('0x2f')]);_0x50dab2['filters']=_['intersection'](_0x50dab2[_0xb4b6('0x30')],_0x50dab2[_0xb4b6('0x2f')]);_0x5624a9[_0xb4b6('0x31')]=_[_0xb4b6('0x32')](_0x50dab2[_0xb4b6('0x30')],qs[_0xb4b6('0x33')](_0x126dbb[_0xb4b6('0x2f')][_0xb4b6('0x33')]));_0x5624a9[_0xb4b6('0x31')]=_0x5624a9[_0xb4b6('0x31')][_0xb4b6('0x34')]?_0x5624a9[_0xb4b6('0x31')]:_0x50dab2[_0xb4b6('0x30')];if(!_0x126dbb[_0xb4b6('0x2f')][_0xb4b6('0x35')]('nolimit')){_0x5624a9[_0xb4b6('0x36')]=qs['limit'](_0x126dbb[_0xb4b6('0x2f')][_0xb4b6('0x36')]);_0x5624a9['offset']=qs['offset'](_0x126dbb[_0xb4b6('0x2f')][_0xb4b6('0x1b')]);}_0x5624a9[_0xb4b6('0x37')]=qs[_0xb4b6('0x38')](_0x126dbb['query']['sort']);_0x5624a9[_0xb4b6('0x39')]=qs[_0xb4b6('0x3a')](_[_0xb4b6('0x3b')](_0x126dbb[_0xb4b6('0x2f')],_0x50dab2[_0xb4b6('0x3a')]),_0x149dda);if(_0x126dbb['query']['filter']){_0x5624a9[_0xb4b6('0x39')]=_[_0xb4b6('0x3c')](_0x5624a9[_0xb4b6('0x39')],{'$or':_[_0xb4b6('0x27')](_0x149dda,function(_0x3c3845){if(_0x3c3845[_0xb4b6('0x2b')]!==_0xb4b6('0x3d')){var _0x54b645={};_0x54b645[_0x3c3845[_0xb4b6('0x2d')]]={'$like':'%'+_0x126dbb[_0xb4b6('0x2f')][_0xb4b6('0x3e')]+'%'};return _0x54b645;}})});}_0x5624a9=_[_0xb4b6('0x3c')]({},_0x5624a9,_0x126dbb[_0xb4b6('0x3f')]);var _0x1abf3a={'where':_0x5624a9['where']};return db['ServicenowConfiguration'][_0xb4b6('0x1d')](_0x1abf3a)[_0xb4b6('0x23')](function(_0x52aa66){_0x4a6e15['count']=_0x52aa66;if(_0x126dbb[_0xb4b6('0x2f')][_0xb4b6('0x40')]){_0x5624a9[_0xb4b6('0x41')]=[{'all':!![]}];}return db[_0xb4b6('0x28')][_0xb4b6('0x42')](_0x5624a9);})[_0xb4b6('0x23')](function(_0x107b3b){_0x4a6e15[_0xb4b6('0x43')]=_0x107b3b;return _0x4a6e15;})[_0xb4b6('0x23')](respondWithFilteredResult(_0x4c790c,_0x5624a9))[_0xb4b6('0x44')](handleError(_0x4c790c,null));};exports[_0xb4b6('0x45')]=function(_0x50fc75,_0x2d9653){var _0x2f2b49={'raw':![],'where':{'id':_0x50fc75[_0xb4b6('0x46')]['id']}},_0x1b6434={};_0x1b6434[_0xb4b6('0x30')]=_[_0xb4b6('0x2e')](db['ServicenowConfiguration'][_0xb4b6('0x29')]);_0x1b6434[_0xb4b6('0x2f')]=_[_0xb4b6('0x2e')](_0x50fc75[_0xb4b6('0x2f')]);_0x1b6434['filters']=_['intersection'](_0x1b6434[_0xb4b6('0x30')],_0x1b6434[_0xb4b6('0x2f')]);_0x2f2b49[_0xb4b6('0x31')]=_[_0xb4b6('0x32')](_0x1b6434[_0xb4b6('0x30')],qs[_0xb4b6('0x33')](_0x50fc75[_0xb4b6('0x2f')]['fields']));_0x2f2b49[_0xb4b6('0x31')]=_0x2f2b49[_0xb4b6('0x31')][_0xb4b6('0x34')]?_0x2f2b49[_0xb4b6('0x31')]:_0x1b6434[_0xb4b6('0x30')];if(_0x50fc75['query'][_0xb4b6('0x40')]){_0x2f2b49[_0xb4b6('0x41')]=[{'all':!![]}];}_0x2f2b49=_['merge']({},_0x2f2b49,_0x50fc75[_0xb4b6('0x3f')]);return db[_0xb4b6('0x28')]['find'](_0x2f2b49)[_0xb4b6('0x23')](handleEntityNotFound(_0x2d9653,null))[_0xb4b6('0x23')](respondWithResult(_0x2d9653,null))[_0xb4b6('0x44')](handleError(_0x2d9653,null));};exports[_0xb4b6('0x47')]=function(_0x105b25,_0x1e4a85){return db[_0xb4b6('0x28')][_0xb4b6('0x47')](_0x105b25[_0xb4b6('0x48')],{})[_0xb4b6('0x23')](respondWithResult(_0x1e4a85,0xc9))[_0xb4b6('0x44')](handleError(_0x1e4a85,null));};exports[_0xb4b6('0x22')]=function(_0x133155,_0x466b5d){if(_0x133155['body']['id']){delete _0x133155[_0xb4b6('0x48')]['id'];}return db[_0xb4b6('0x28')][_0xb4b6('0x49')]({'where':{'id':_0x133155[_0xb4b6('0x46')]['id']}})[_0xb4b6('0x23')](handleEntityNotFound(_0x466b5d,null))[_0xb4b6('0x23')](saveUpdates(_0x133155[_0xb4b6('0x48')],null))[_0xb4b6('0x23')](respondWithResult(_0x466b5d,null))[_0xb4b6('0x44')](handleError(_0x466b5d,null));};exports['destroy']=function(_0x3caca0,_0x4ef029){return db['ServicenowConfiguration'][_0xb4b6('0x49')]({'where':{'id':_0x3caca0[_0xb4b6('0x46')]['id']}})[_0xb4b6('0x23')](handleEntityNotFound(_0x4ef029,null))[_0xb4b6('0x23')](removeEntity(_0x4ef029,null))['catch'](handleError(_0x4ef029,null));};exports[_0xb4b6('0x4a')]=function(_0x44a699,_0x4c2964,_0x5d4ba6){var _0x31a37a={};var _0x114b3a={};var _0x368ae9;var _0x24d4f2;return db[_0xb4b6('0x28')][_0xb4b6('0x4b')]({'where':{'id':_0x44a699[_0xb4b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c2964,null))[_0xb4b6('0x23')](function(_0x364a07){if(_0x364a07){_0x368ae9=_0x364a07;_0x114b3a[_0xb4b6('0x30')]=_[_0xb4b6('0x2e')](db['ServicenowField'][_0xb4b6('0x29')]);_0x114b3a[_0xb4b6('0x2f')]=_['keys'](_0x44a699[_0xb4b6('0x2f')]);_0x114b3a['filters']=_[_0xb4b6('0x32')](_0x114b3a[_0xb4b6('0x30')],_0x114b3a[_0xb4b6('0x2f')]);_0x31a37a[_0xb4b6('0x31')]=_[_0xb4b6('0x32')](_0x114b3a[_0xb4b6('0x30')],qs[_0xb4b6('0x33')](_0x44a699[_0xb4b6('0x2f')][_0xb4b6('0x33')]));_0x31a37a[_0xb4b6('0x31')]=_0x31a37a[_0xb4b6('0x31')][_0xb4b6('0x34')]?_0x31a37a[_0xb4b6('0x31')]:_0x114b3a[_0xb4b6('0x30')];_0x31a37a[_0xb4b6('0x37')]=qs[_0xb4b6('0x38')](_0x44a699['query']['sort']);_0x31a37a[_0xb4b6('0x39')]=qs['filters'](_[_0xb4b6('0x3b')](_0x44a699[_0xb4b6('0x2f')],_0x114b3a[_0xb4b6('0x3a')]));if(_0x44a699['query'][_0xb4b6('0x3e')]){_0x31a37a[_0xb4b6('0x39')]=_['merge'](_0x31a37a['where'],{'$or':_['map'](_0x31a37a[_0xb4b6('0x31')],function(_0x5c856e){var _0x419bd7={};_0x419bd7[_0x5c856e]={'$like':'%'+_0x44a699[_0xb4b6('0x2f')][_0xb4b6('0x3e')]+'%'};return _0x419bd7;})});}_0x31a37a=_[_0xb4b6('0x3c')]({},_0x31a37a,_0x44a699[_0xb4b6('0x3f')]);return _0x368ae9[_0xb4b6('0x4a')](_0x31a37a);}})['then'](function(_0x1894a0){if(_0x1894a0){_0x24d4f2=_0x1894a0[_0xb4b6('0x34')];if(!_0x44a699[_0xb4b6('0x2f')][_0xb4b6('0x35')](_0xb4b6('0x4c'))){_0x31a37a[_0xb4b6('0x36')]=qs[_0xb4b6('0x36')](_0x44a699[_0xb4b6('0x2f')][_0xb4b6('0x36')]);_0x31a37a[_0xb4b6('0x1b')]=qs['offset'](_0x44a699['query'][_0xb4b6('0x1b')]);}return _0x368ae9['getFields'](_0x31a37a);}})[_0xb4b6('0x23')](function(_0x53427d){if(_0x53427d){return _0x53427d?{'count':_0x24d4f2,'rows':_0x53427d}:null;}})[_0xb4b6('0x23')](respondWithResult(_0x4c2964,null))[_0xb4b6('0x44')](handleError(_0x4c2964,null));};exports[_0xb4b6('0x4d')]=function(_0x214f24,_0xdaea6a,_0x5baa91){var _0x4efb5c={};var _0x57a202={};var _0x22a296;var _0x30143a;return db[_0xb4b6('0x28')][_0xb4b6('0x4b')]({'where':{'id':_0x214f24[_0xb4b6('0x46')]['id']}})['then'](handleEntityNotFound(_0xdaea6a,null))[_0xb4b6('0x23')](function(_0x5adde7){if(_0x5adde7){_0x22a296=_0x5adde7;_0x57a202[_0xb4b6('0x30')]=_['keys'](db[_0xb4b6('0x4e')]['rawAttributes']);_0x57a202['query']=_['keys'](_0x214f24['query']);_0x57a202[_0xb4b6('0x3a')]=_[_0xb4b6('0x32')](_0x57a202[_0xb4b6('0x30')],_0x57a202[_0xb4b6('0x2f')]);_0x4efb5c['attributes']=_[_0xb4b6('0x32')](_0x57a202[_0xb4b6('0x30')],qs[_0xb4b6('0x33')](_0x214f24['query']['fields']));_0x4efb5c[_0xb4b6('0x31')]=_0x4efb5c[_0xb4b6('0x31')]['length']?_0x4efb5c[_0xb4b6('0x31')]:_0x57a202[_0xb4b6('0x30')];_0x4efb5c[_0xb4b6('0x37')]=qs[_0xb4b6('0x38')](_0x214f24[_0xb4b6('0x2f')][_0xb4b6('0x38')]);_0x4efb5c[_0xb4b6('0x39')]=qs['filters'](_[_0xb4b6('0x3b')](_0x214f24[_0xb4b6('0x2f')],_0x57a202['filters']));if(_0x214f24[_0xb4b6('0x2f')]['filter']){_0x4efb5c[_0xb4b6('0x39')]=_[_0xb4b6('0x3c')](_0x4efb5c['where'],{'$or':_[_0xb4b6('0x27')](_0x4efb5c['attributes'],function(_0xb03d47){var _0x456a96={};_0x456a96[_0xb03d47]={'$like':'%'+_0x214f24['query'][_0xb4b6('0x3e')]+'%'};return _0x456a96;})});}_0x4efb5c=_[_0xb4b6('0x3c')]({},_0x4efb5c,_0x214f24[_0xb4b6('0x3f')]);return _0x22a296[_0xb4b6('0x4d')](_0x4efb5c);}})[_0xb4b6('0x23')](function(_0x52e634){if(_0x52e634){_0x30143a=_0x52e634[_0xb4b6('0x34')];if(!_0x214f24[_0xb4b6('0x2f')][_0xb4b6('0x35')](_0xb4b6('0x4c'))){_0x4efb5c[_0xb4b6('0x36')]=qs[_0xb4b6('0x36')](_0x214f24[_0xb4b6('0x2f')][_0xb4b6('0x36')]);_0x4efb5c['offset']=qs[_0xb4b6('0x1b')](_0x214f24[_0xb4b6('0x2f')]['offset']);}return _0x22a296[_0xb4b6('0x4d')](_0x4efb5c);}})[_0xb4b6('0x23')](function(_0x14179d){if(_0x14179d){return _0x14179d?{'count':_0x30143a,'rows':_0x14179d}:null;}})['then'](respondWithResult(_0xdaea6a,null))[_0xb4b6('0x44')](handleError(_0xdaea6a,null));};exports[_0xb4b6('0x4f')]=function(_0x532af3,_0x25a040,_0x3795e0){var _0x2a973d={};var _0x113510={};var _0x54f0c9;var _0x53e25b;return db[_0xb4b6('0x28')][_0xb4b6('0x4b')]({'where':{'id':_0x532af3[_0xb4b6('0x46')]['id']}})[_0xb4b6('0x23')](handleEntityNotFound(_0x25a040,null))[_0xb4b6('0x23')](function(_0x33c8e9){if(_0x33c8e9){_0x54f0c9=_0x33c8e9;_0x113510[_0xb4b6('0x30')]=_['keys'](db[_0xb4b6('0x4e')][_0xb4b6('0x29')]);_0x113510['query']=_['keys'](_0x532af3[_0xb4b6('0x2f')]);_0x113510['filters']=_[_0xb4b6('0x32')](_0x113510[_0xb4b6('0x30')],_0x113510[_0xb4b6('0x2f')]);_0x2a973d[_0xb4b6('0x31')]=_[_0xb4b6('0x32')](_0x113510['model'],qs[_0xb4b6('0x33')](_0x532af3['query'][_0xb4b6('0x33')]));_0x2a973d[_0xb4b6('0x31')]=_0x2a973d[_0xb4b6('0x31')]['length']?_0x2a973d['attributes']:_0x113510[_0xb4b6('0x30')];_0x2a973d[_0xb4b6('0x37')]=qs['sort'](_0x532af3['query'][_0xb4b6('0x38')]);_0x2a973d[_0xb4b6('0x39')]=qs['filters'](_[_0xb4b6('0x3b')](_0x532af3['query'],_0x113510['filters']));if(_0x532af3[_0xb4b6('0x2f')][_0xb4b6('0x3e')]){_0x2a973d['where']=_[_0xb4b6('0x3c')](_0x2a973d[_0xb4b6('0x39')],{'$or':_[_0xb4b6('0x27')](_0x2a973d[_0xb4b6('0x31')],function(_0x46aa07){var _0x528f27={};_0x528f27[_0x46aa07]={'$like':'%'+_0x532af3[_0xb4b6('0x2f')][_0xb4b6('0x3e')]+'%'};return _0x528f27;})});}_0x2a973d=_[_0xb4b6('0x3c')]({},_0x2a973d,_0x532af3[_0xb4b6('0x3f')]);return _0x54f0c9[_0xb4b6('0x4f')](_0x2a973d);}})[_0xb4b6('0x23')](function(_0x42932d){if(_0x42932d){_0x53e25b=_0x42932d['length'];if(!_0x532af3[_0xb4b6('0x2f')]['hasOwnProperty'](_0xb4b6('0x4c'))){_0x2a973d[_0xb4b6('0x36')]=qs[_0xb4b6('0x36')](_0x532af3['query'][_0xb4b6('0x36')]);_0x2a973d[_0xb4b6('0x1b')]=qs['offset'](_0x532af3[_0xb4b6('0x2f')]['offset']);}return _0x54f0c9[_0xb4b6('0x4f')](_0x2a973d);}})[_0xb4b6('0x23')](function(_0xde89a6){if(_0xde89a6){return _0xde89a6?{'count':_0x53e25b,'rows':_0xde89a6}:null;}})[_0xb4b6('0x23')](respondWithResult(_0x25a040,null))[_0xb4b6('0x44')](handleError(_0x25a040,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 74c4929..aa2ae61 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 _0xc931=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','util','api','moment'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0xc931,0x19c));var _0x1c93=function(_0x739dd3,_0x426b96){_0x739dd3=_0x739dd3-0x0;var _0x59bba9=_0xc931[_0x739dd3];return _0x59bba9;};'use strict';var _=require(_0x1c93('0x0'));var util=require(_0x1c93('0x1'));var logger=require('../../config/logger')(_0x1c93('0x2'));var moment=require(_0x1c93('0x3'));var BPromise=require(_0x1c93('0x4'));var rp=require(_0x1c93('0x5'));var fs=require('fs');var path=require(_0x1c93('0x6'));var rimraf=require(_0x1c93('0x7'));var config=require(_0x1c93('0x8'));var attributes=require(_0x1c93('0x9'));module[_0x1c93('0xa')]=function(_0x523781,_0x394ae1){return _0x523781[_0x1c93('0xb')](_0x1c93('0xc'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a1d=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x1352f0,_0x4cd565){var _0x1c2a82=function(_0x2a9b63){while(--_0x2a9b63){_0x1352f0['push'](_0x1352f0['shift']());}};_0x1c2a82(++_0x4cd565);}(_0x4a1d,0x77));var _0xd4a1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4a1d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xd4a1('0x0'));var util=require(_0xd4a1('0x1'));var logger=require(_0xd4a1('0x2'))(_0xd4a1('0x3'));var moment=require(_0xd4a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4a1('0x5'));var fs=require('fs');var path=require(_0xd4a1('0x6'));var rimraf=require(_0xd4a1('0x7'));var config=require(_0xd4a1('0x8'));var attributes=require(_0xd4a1('0x9'));module[_0xd4a1('0xa')]=function(_0x11fa5c,_0x1855b7){return _0x11fa5c['define'](_0xd4a1('0xb'),attributes,{'tableName':_0xd4a1('0xc'),'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 a301845..4ab4bda 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 _0x8b5f=['result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x523d0a,_0x29e454){var _0x4c0260=function(_0x554edf){while(--_0x554edf){_0x523d0a['push'](_0x523d0a['shift']());}};_0x4c0260(++_0x29e454);}(_0x8b5f,0x106));var _0xf8b5=function(_0x280582,_0x5509c1){_0x280582=_0x280582-0x0;var _0x41b4b4=_0x8b5f[_0x280582];return _0x41b4b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf8b5('0x0'));var BPromise=require(_0xf8b5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8b5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8b5('0x3'));var logger=require(_0xf8b5('0x4'))(_0xf8b5('0x5'));var config=require(_0xf8b5('0x6'));var jayson=require(_0xf8b5('0x7'));var client=jayson[_0xf8b5('0x8')][_0xf8b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4184c3,_0x23fdf4,_0x195ffe){return new BPromise(function(_0x435110,_0x2229bb){return client[_0xf8b5('0xa')](_0x4184c3,_0x195ffe)[_0xf8b5('0xb')](function(_0x5e600b){logger[_0xf8b5('0xc')](_0xf8b5('0xd'),_0x23fdf4,_0xf8b5('0xe'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x23fdf4,_0xf8b5('0xe'),JSON['stringify'](_0x5e600b));if(_0x5e600b['error']){if(_0x5e600b[_0xf8b5('0xf')][_0xf8b5('0x10')]===0x1f4){logger[_0xf8b5('0xf')](_0xf8b5('0xd'),_0x23fdf4,_0x5e600b[_0xf8b5('0xf')][_0xf8b5('0x11')]);return _0x2229bb(_0x5e600b[_0xf8b5('0xf')][_0xf8b5('0x11')]);}logger[_0xf8b5('0xf')](_0xf8b5('0xd'),_0x23fdf4,_0x5e600b['error'][_0xf8b5('0x11')]);return _0x435110(_0x5e600b['error']['message']);}else{logger['info'](_0xf8b5('0xd'),_0x23fdf4,_0xf8b5('0xe'));_0x435110(_0x5e600b[_0xf8b5('0x12')]['message']);}})[_0xf8b5('0x13')](function(_0x27c8da){logger[_0xf8b5('0xf')](_0xf8b5('0xd'),_0x23fdf4,_0x27c8da);_0x2229bb(_0x27c8da);});});} \ No newline at end of file +var _0x15b8=['code','message','ServicenowConfiguration,\x20%s,\x20%s','result','catch','lodash','util','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x15b8,0x69));var _0x815b=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x15b8[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x815b('0x0'));var util=require(_0x815b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x815b('0x2'))(_0x815b('0x3'));var config=require(_0x815b('0x4'));var jayson=require(_0x815b('0x5'));var client=jayson[_0x815b('0x6')][_0x815b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3e212d,_0x49fead,_0x1f3a6b){return new BPromise(function(_0x5945e7,_0x527d18){return client[_0x815b('0x8')](_0x3e212d,_0x1f3a6b)[_0x815b('0x9')](function(_0x1612bd){logger[_0x815b('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x49fead,_0x815b('0xb'));logger[_0x815b('0xc')](_0x815b('0xd'),_0x49fead,_0x815b('0xb'),JSON['stringify'](_0x1612bd));if(_0x1612bd[_0x815b('0xe')]){if(_0x1612bd[_0x815b('0xe')][_0x815b('0xf')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x49fead,_0x1612bd[_0x815b('0xe')][_0x815b('0x10')]);return _0x527d18(_0x1612bd['error']['message']);}logger[_0x815b('0xe')](_0x815b('0x11'),_0x49fead,_0x1612bd[_0x815b('0xe')]['message']);return _0x5945e7(_0x1612bd[_0x815b('0xe')][_0x815b('0x10')]);}else{logger[_0x815b('0xa')](_0x815b('0x11'),_0x49fead,_0x815b('0xb'));_0x5945e7(_0x1612bd[_0x815b('0x12')][_0x815b('0x10')]);}})[_0x815b('0x13')](function(_0x9b747f){logger['error'](_0x815b('0x11'),_0x49fead,_0x9b747f);_0x527d18(_0x9b747f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 1fd0db3..9d5aee5 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 _0xd52e=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0xcf1a78,_0x1b14ae){var _0x4ef3d2=function(_0x294813){while(--_0x294813){_0xcf1a78['push'](_0xcf1a78['shift']());}};_0x4ef3d2(++_0x1b14ae);}(_0xd52e,0x1cf));var _0xed52=function(_0x2f0799,_0x42ac2e){_0x2f0799=_0x2f0799-0x0;var _0x4dc09d=_0xd52e[_0x2f0799];return _0x4dc09d;};'use strict';var multer=require(_0xed52('0x0'));var util=require(_0xed52('0x1'));var path=require(_0xed52('0x2'));var timeout=require(_0xed52('0x3'));var express=require(_0xed52('0x4'));var router=express[_0xed52('0x5')]();var fs_extra=require(_0xed52('0x6'));var auth=require(_0xed52('0x7'));var interaction=require(_0xed52('0x8'));var config=require(_0xed52('0x9'));var controller=require('./intServicenowField.controller');router[_0xed52('0xa')]('/',auth[_0xed52('0xb')](),controller[_0xed52('0xc')]);router[_0xed52('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xed52('0xd')]);router[_0xed52('0xe')]('/',auth[_0xed52('0xb')](),controller[_0xed52('0xf')]);router[_0xed52('0x10')](_0xed52('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xed52('0x11'),auth[_0xed52('0xb')](),controller[_0xed52('0x12')]);module[_0xed52('0x13')]=router; \ No newline at end of file +var _0x285f=['./intServicenowField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xf9153d,_0x1a33ed){var _0x348313=function(_0x571b5e){while(--_0x571b5e){_0xf9153d['push'](_0xf9153d['shift']());}};_0x348313(++_0x1a33ed);}(_0x285f,0x102));var _0xf285=function(_0x9a10f7,_0x5b2f67){_0x9a10f7=_0x9a10f7-0x0;var _0xfb8f00=_0x285f[_0x9a10f7];return _0xfb8f00;};'use strict';var multer=require(_0xf285('0x0'));var util=require(_0xf285('0x1'));var path=require(_0xf285('0x2'));var timeout=require(_0xf285('0x3'));var express=require(_0xf285('0x4'));var router=express['Router']();var fs_extra=require(_0xf285('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf285('0x6'));var config=require(_0xf285('0x7'));var controller=require(_0xf285('0x8'));router[_0xf285('0x9')]('/',auth['isAuthenticated'](),controller[_0xf285('0xa')]);router[_0xf285('0x9')](_0xf285('0xb'),auth[_0xf285('0xc')](),controller[_0xf285('0xd')]);router['post']('/',auth[_0xf285('0xc')](),controller[_0xf285('0xe')]);router[_0xf285('0xf')](_0xf285('0xb'),auth[_0xf285('0xc')](),controller[_0xf285('0x10')]);router[_0xf285('0x11')](_0xf285('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xf285('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index d2b9d57..d3b8ba7 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 _0xddf6=['variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x5c52a3,_0x13c8d5){var _0x5537b9=function(_0x469e93){while(--_0x469e93){_0x5c52a3['push'](_0x5c52a3['shift']());}};_0x5537b9(++_0x13c8d5);}(_0xddf6,0x12c));var _0x6ddf=function(_0x14642c,_0x249a3b){_0x14642c=_0x14642c-0x0;var _0x25de4f=_0xddf6[_0x14642c];return _0x25de4f;};'use strict';var Sequelize=require(_0x6ddf('0x0'));module[_0x6ddf('0x1')]={'type':{'type':Sequelize[_0x6ddf('0x2')](_0x6ddf('0x3'),_0x6ddf('0x4'),_0x6ddf('0x5'),'keyValue','picklist'),'defaultValue':_0x6ddf('0x3')},'content':{'type':Sequelize[_0x6ddf('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6ddf('0x3'),_0x6ddf('0x4'),_0x6ddf('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6ddf('0x6')]},'nameField':{'type':Sequelize[_0x6ddf('0x6')]},'customField':{'type':Sequelize[_0x6ddf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ddf('0x6')]}}; \ No newline at end of file +var _0xa812=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0xfd09ba,_0x168daa){var _0x545447=function(_0x59a090){while(--_0x59a090){_0xfd09ba['push'](_0xfd09ba['shift']());}};_0x545447(++_0x168daa);}(_0xa812,0x9f));var _0x2a81=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xa812[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require(_0x2a81('0x0'));module[_0x2a81('0x1')]={'type':{'type':Sequelize[_0x2a81('0x2')](_0x2a81('0x3'),_0x2a81('0x4'),_0x2a81('0x5'),_0x2a81('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x2a81('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2a81('0x2')](_0x2a81('0x3'),_0x2a81('0x4'),_0x2a81('0x5'))},'keyContent':{'type':Sequelize[_0x2a81('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2a81('0x7')]},'customField':{'type':Sequelize[_0x2a81('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a81('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f82b783..e4c0fb7 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 _0x4aba=['then','destroy','error','stack','name','map','ServicenowField','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x4aba,0xfc));var _0xa4ab=function(_0x42f3ad,_0x48c222){_0x42f3ad=_0x42f3ad-0x0;var _0x5a13c5=_0x4aba[_0x42f3ad];return _0x5a13c5;};'use strict';var emlformat=require(_0xa4ab('0x0'));var rimraf=require(_0xa4ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4ab('0x2'));var rp=require(_0xa4ab('0x3'));var moment=require('moment');var BPromise=require(_0xa4ab('0x4'));var Mustache=require(_0xa4ab('0x5'));var util=require(_0xa4ab('0x6'));var path=require(_0xa4ab('0x7'));var sox=require(_0xa4ab('0x8'));var csv=require('to-csv');var ejs=require(_0xa4ab('0x9'));var fs=require('fs');var fs_extra=require(_0xa4ab('0xa'));var _=require(_0xa4ab('0xb'));var squel=require(_0xa4ab('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa4ab('0xd'));var toCsv=require(_0xa4ab('0xe'));var querystring=require(_0xa4ab('0xf'));var Papa=require(_0xa4ab('0x10'));var Redis=require(_0xa4ab('0x11'));var authService=require(_0xa4ab('0x12'));var qs=require(_0xa4ab('0x13'));var as=require(_0xa4ab('0x14'));var hardwareService=require(_0xa4ab('0x15'));var logger=require('../../config/logger')(_0xa4ab('0x16'));var utils=require(_0xa4ab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa4ab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31d12d,_0x35e301){_0x35e301=_0x35e301||0xcc;return function(_0x3951ac){if(_0x3951ac){return _0x31d12d[_0xa4ab('0x19')](_0x35e301);}return _0x31d12d[_0xa4ab('0x1a')](_0x35e301)[_0xa4ab('0x1b')]();};}function respondWithResult(_0x1224b0,_0x38bab6){_0x38bab6=_0x38bab6||0xc8;return function(_0x56d42c){if(_0x56d42c){return _0x1224b0[_0xa4ab('0x1a')](_0x38bab6)[_0xa4ab('0x1c')](_0x56d42c);}};}function respondWithFilteredResult(_0x5eb290,_0x2fc3e9){return function(_0x23ebf0){if(_0x23ebf0){var _0x4355f7=typeof _0x2fc3e9['offset']===_0xa4ab('0x1d')&&typeof _0x2fc3e9[_0xa4ab('0x1e')]===_0xa4ab('0x1d');var _0x20ca52=_0x23ebf0['count'];var _0x3ffc3=_0x4355f7?0x0:_0x2fc3e9['offset'];var _0x505270=_0x4355f7?_0x23ebf0[_0xa4ab('0x1f')]:_0x2fc3e9[_0xa4ab('0x20')]+_0x2fc3e9['limit'];var _0x3e6ecb;if(_0x505270>=_0x20ca52){_0x505270=_0x20ca52;_0x3e6ecb=0xc8;}else{_0x3e6ecb=0xce;}_0x5eb290[_0xa4ab('0x1a')](_0x3e6ecb);return _0x5eb290['set'](_0xa4ab('0x21'),_0x3ffc3+'-'+_0x505270+'/'+_0x20ca52)[_0xa4ab('0x1c')](_0x23ebf0);}return null;};}function patchUpdates(_0x98e25c){return function(_0x2d3e3d){try{jsonpatch[_0xa4ab('0x22')](_0x2d3e3d,_0x98e25c,!![]);}catch(_0x213747){return BPromise[_0xa4ab('0x23')](_0x213747);}return _0x2d3e3d['save']();};}function saveUpdates(_0x4878d5,_0x970455){return function(_0x5d3b8e){if(_0x5d3b8e){return _0x5d3b8e['update'](_0x4878d5)[_0xa4ab('0x24')](function(_0x2d1a63){return _0x2d1a63;});}return null;};}function removeEntity(_0x8f518,_0x266d0c){return function(_0xbdd637){if(_0xbdd637){return _0xbdd637[_0xa4ab('0x25')]()[_0xa4ab('0x24')](function(){_0x8f518[_0xa4ab('0x1a')](0xcc)[_0xa4ab('0x1b')]();});}};}function handleEntityNotFound(_0x2f125d,_0x1f89d9){return function(_0x2a5666){if(!_0x2a5666){_0x2f125d['sendStatus'](0x194);}return _0x2a5666;};}function handleError(_0x1b2978,_0x22fbca){_0x22fbca=_0x22fbca||0x1f4;return function(_0x78088e){logger[_0xa4ab('0x26')](_0x78088e[_0xa4ab('0x27')]);if(_0x78088e[_0xa4ab('0x28')]){delete _0x78088e[_0xa4ab('0x28')];}_0x1b2978[_0xa4ab('0x1a')](_0x22fbca)['send'](_0x78088e);};}exports['index']=function(_0x446c7a,_0x59a4fe){var _0x63be15={},_0x3ce37d={},_0x1278d5={'count':0x0,'rows':[]};var _0x5dd459=_[_0xa4ab('0x29')](db[_0xa4ab('0x2a')]['rawAttributes'],function(_0x252cab){return{'name':_0x252cab['fieldName'],'type':_0x252cab['type'][_0xa4ab('0x2b')]};});_0x3ce37d['model']=_[_0xa4ab('0x29')](_0x5dd459,_0xa4ab('0x28'));_0x3ce37d[_0xa4ab('0x2c')]=_[_0xa4ab('0x2d')](_0x446c7a[_0xa4ab('0x2c')]);_0x3ce37d[_0xa4ab('0x2e')]=_[_0xa4ab('0x2f')](_0x3ce37d['model'],_0x3ce37d[_0xa4ab('0x2c')]);_0x63be15[_0xa4ab('0x30')]=_[_0xa4ab('0x2f')](_0x3ce37d[_0xa4ab('0x31')],qs[_0xa4ab('0x32')](_0x446c7a[_0xa4ab('0x2c')][_0xa4ab('0x32')]));_0x63be15[_0xa4ab('0x30')]=_0x63be15[_0xa4ab('0x30')][_0xa4ab('0x33')]?_0x63be15[_0xa4ab('0x30')]:_0x3ce37d[_0xa4ab('0x31')];if(!_0x446c7a['query'][_0xa4ab('0x34')](_0xa4ab('0x35'))){_0x63be15[_0xa4ab('0x1e')]=qs[_0xa4ab('0x1e')](_0x446c7a[_0xa4ab('0x2c')]['limit']);_0x63be15[_0xa4ab('0x20')]=qs[_0xa4ab('0x20')](_0x446c7a['query']['offset']);}_0x63be15[_0xa4ab('0x36')]=qs[_0xa4ab('0x37')](_0x446c7a[_0xa4ab('0x2c')][_0xa4ab('0x37')]);_0x63be15[_0xa4ab('0x38')]=qs[_0xa4ab('0x2e')](_[_0xa4ab('0x39')](_0x446c7a[_0xa4ab('0x2c')],_0x3ce37d[_0xa4ab('0x2e')]),_0x5dd459);if(_0x446c7a[_0xa4ab('0x2c')]['filter']){_0x63be15[_0xa4ab('0x38')]=_[_0xa4ab('0x3a')](_0x63be15[_0xa4ab('0x38')],{'$or':_[_0xa4ab('0x29')](_0x5dd459,function(_0x3f3b62){if(_0x3f3b62['type']!==_0xa4ab('0x3b')){var _0x59be3b={};_0x59be3b[_0x3f3b62[_0xa4ab('0x28')]]={'$like':'%'+_0x446c7a[_0xa4ab('0x2c')][_0xa4ab('0x3c')]+'%'};return _0x59be3b;}})});}_0x63be15=_[_0xa4ab('0x3a')]({},_0x63be15,_0x446c7a[_0xa4ab('0x3d')]);var _0x1c439b={'where':_0x63be15[_0xa4ab('0x38')]};return db[_0xa4ab('0x2a')]['count'](_0x1c439b)[_0xa4ab('0x24')](function(_0x5d12b6){_0x1278d5[_0xa4ab('0x1f')]=_0x5d12b6;if(_0x446c7a[_0xa4ab('0x2c')][_0xa4ab('0x3e')]){_0x63be15[_0xa4ab('0x3f')]=[{'all':!![]}];}return db[_0xa4ab('0x2a')][_0xa4ab('0x40')](_0x63be15);})[_0xa4ab('0x24')](function(_0x41df54){_0x1278d5[_0xa4ab('0x41')]=_0x41df54;return _0x1278d5;})[_0xa4ab('0x24')](respondWithFilteredResult(_0x59a4fe,_0x63be15))[_0xa4ab('0x42')](handleError(_0x59a4fe,null));};exports[_0xa4ab('0x43')]=function(_0xb23d9d,_0x220071){var _0x5e4f2b={'raw':!![],'where':{'id':_0xb23d9d[_0xa4ab('0x44')]['id']}},_0x4d07b7={};_0x4d07b7['model']=_[_0xa4ab('0x2d')](db[_0xa4ab('0x2a')]['rawAttributes']);_0x4d07b7[_0xa4ab('0x2c')]=_[_0xa4ab('0x2d')](_0xb23d9d[_0xa4ab('0x2c')]);_0x4d07b7[_0xa4ab('0x2e')]=_[_0xa4ab('0x2f')](_0x4d07b7[_0xa4ab('0x31')],_0x4d07b7[_0xa4ab('0x2c')]);_0x5e4f2b[_0xa4ab('0x30')]=_['intersection'](_0x4d07b7[_0xa4ab('0x31')],qs[_0xa4ab('0x32')](_0xb23d9d[_0xa4ab('0x2c')][_0xa4ab('0x32')]));_0x5e4f2b[_0xa4ab('0x30')]=_0x5e4f2b['attributes'][_0xa4ab('0x33')]?_0x5e4f2b[_0xa4ab('0x30')]:_0x4d07b7[_0xa4ab('0x31')];if(_0xb23d9d[_0xa4ab('0x2c')][_0xa4ab('0x3e')]){_0x5e4f2b[_0xa4ab('0x3f')]=[{'all':!![]}];}_0x5e4f2b=_[_0xa4ab('0x3a')]({},_0x5e4f2b,_0xb23d9d['options']);return db[_0xa4ab('0x2a')][_0xa4ab('0x45')](_0x5e4f2b)[_0xa4ab('0x24')](handleEntityNotFound(_0x220071,null))[_0xa4ab('0x24')](respondWithResult(_0x220071,null))[_0xa4ab('0x42')](handleError(_0x220071,null));};exports[_0xa4ab('0x46')]=function(_0x5be261,_0x3b934b){return db[_0xa4ab('0x2a')][_0xa4ab('0x46')](_0x5be261[_0xa4ab('0x47')],{})['then'](respondWithResult(_0x3b934b,0xc9))['catch'](handleError(_0x3b934b,null));};exports['update']=function(_0x32d97e,_0x29202a){if(_0x32d97e['body']['id']){delete _0x32d97e[_0xa4ab('0x47')]['id'];}return db[_0xa4ab('0x2a')][_0xa4ab('0x45')]({'where':{'id':_0x32d97e[_0xa4ab('0x44')]['id']}})['then'](handleEntityNotFound(_0x29202a,null))[_0xa4ab('0x24')](saveUpdates(_0x32d97e['body'],null))['then'](respondWithResult(_0x29202a,null))[_0xa4ab('0x42')](handleError(_0x29202a,null));};exports[_0xa4ab('0x25')]=function(_0x282478,_0x1433ac){return db[_0xa4ab('0x2a')][_0xa4ab('0x45')]({'where':{'id':_0x282478[_0xa4ab('0x44')]['id']}})[_0xa4ab('0x24')](handleEntityNotFound(_0x1433ac,null))[_0xa4ab('0x24')](removeEntity(_0x1433ac,null))[_0xa4ab('0x42')](handleError(_0x1433ac,null));}; \ No newline at end of file +var _0x7e8f=['map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','ServicenowField','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x7e8f,0x14d));var _0xf7e8=function(_0x4b75a9,_0x42d2f4){_0x4b75a9=_0x4b75a9-0x0;var _0x2f90b1=_0x7e8f[_0x4b75a9];return _0x2f90b1;};'use strict';var emlformat=require(_0xf7e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7e8('0x2'));var moment=require('moment');var BPromise=require(_0xf7e8('0x3'));var Mustache=require(_0xf7e8('0x4'));var util=require(_0xf7e8('0x5'));var path=require(_0xf7e8('0x6'));var sox=require(_0xf7e8('0x7'));var csv=require('to-csv');var ejs=require(_0xf7e8('0x8'));var fs=require('fs');var fs_extra=require(_0xf7e8('0x9'));var _=require('lodash');var squel=require(_0xf7e8('0xa'));var crypto=require(_0xf7e8('0xb'));var jsforce=require(_0xf7e8('0xc'));var deskjs=require(_0xf7e8('0xd'));var toCsv=require(_0xf7e8('0xe'));var querystring=require('querystring');var Papa=require(_0xf7e8('0xf'));var Redis=require(_0xf7e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf7e8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7e8('0x12'));var logger=require('../../config/logger')(_0xf7e8('0x13'));var utils=require(_0xf7e8('0x14'));var config=require(_0xf7e8('0x15'));var licenseUtil=require(_0xf7e8('0x16'));var db=require(_0xf7e8('0x17'))['db'];function respondWithStatusCode(_0x3f0075,_0x15cef3){_0x15cef3=_0x15cef3||0xcc;return function(_0x1c044b){if(_0x1c044b){return _0x3f0075[_0xf7e8('0x18')](_0x15cef3);}return _0x3f0075[_0xf7e8('0x19')](_0x15cef3)[_0xf7e8('0x1a')]();};}function respondWithResult(_0x5bed33,_0x1de137){_0x1de137=_0x1de137||0xc8;return function(_0x5c7ea3){if(_0x5c7ea3){return _0x5bed33[_0xf7e8('0x19')](_0x1de137)[_0xf7e8('0x1b')](_0x5c7ea3);}};}function respondWithFilteredResult(_0x576f88,_0x638d6e){return function(_0x43f2ee){if(_0x43f2ee){var _0x2b8ebb=typeof _0x638d6e[_0xf7e8('0x1c')]==='undefined'&&typeof _0x638d6e['limit']===_0xf7e8('0x1d');var _0x14e3d9=_0x43f2ee[_0xf7e8('0x1e')];var _0x21f00d=_0x2b8ebb?0x0:_0x638d6e[_0xf7e8('0x1c')];var _0x37a253=_0x2b8ebb?_0x43f2ee[_0xf7e8('0x1e')]:_0x638d6e[_0xf7e8('0x1c')]+_0x638d6e[_0xf7e8('0x1f')];var _0x46da58;if(_0x37a253>=_0x14e3d9){_0x37a253=_0x14e3d9;_0x46da58=0xc8;}else{_0x46da58=0xce;}_0x576f88[_0xf7e8('0x19')](_0x46da58);return _0x576f88[_0xf7e8('0x20')](_0xf7e8('0x21'),_0x21f00d+'-'+_0x37a253+'/'+_0x14e3d9)[_0xf7e8('0x1b')](_0x43f2ee);}return null;};}function patchUpdates(_0xa3eef2){return function(_0x3d502b){try{jsonpatch[_0xf7e8('0x22')](_0x3d502b,_0xa3eef2,!![]);}catch(_0x520bfc){return BPromise[_0xf7e8('0x23')](_0x520bfc);}return _0x3d502b['save']();};}function saveUpdates(_0x2f0973,_0x5018ba){return function(_0x2c3aa5){if(_0x2c3aa5){return _0x2c3aa5[_0xf7e8('0x24')](_0x2f0973)[_0xf7e8('0x25')](function(_0x47d485){return _0x47d485;});}return null;};}function removeEntity(_0x8472c7,_0x4f55c0){return function(_0x243fc2){if(_0x243fc2){return _0x243fc2[_0xf7e8('0x26')]()[_0xf7e8('0x25')](function(){_0x8472c7['status'](0xcc)[_0xf7e8('0x1a')]();});}};}function handleEntityNotFound(_0x7cbffb,_0x33ce56){return function(_0x270892){if(!_0x270892){_0x7cbffb[_0xf7e8('0x18')](0x194);}return _0x270892;};}function handleError(_0x1a6ffe,_0x191e3b){_0x191e3b=_0x191e3b||0x1f4;return function(_0x5379c5){logger['error'](_0x5379c5[_0xf7e8('0x27')]);if(_0x5379c5[_0xf7e8('0x28')]){delete _0x5379c5[_0xf7e8('0x28')];}_0x1a6ffe[_0xf7e8('0x19')](_0x191e3b)['send'](_0x5379c5);};}exports[_0xf7e8('0x29')]=function(_0x537da1,_0x24e087){var _0x2fc2ba={},_0x30aa8e={},_0x1622e3={'count':0x0,'rows':[]};var _0x50274c=_[_0xf7e8('0x2a')](db['ServicenowField'][_0xf7e8('0x2b')],function(_0x33b89a){return{'name':_0x33b89a[_0xf7e8('0x2c')],'type':_0x33b89a[_0xf7e8('0x2d')][_0xf7e8('0x2e')]};});_0x30aa8e[_0xf7e8('0x2f')]=_['map'](_0x50274c,'name');_0x30aa8e['query']=_['keys'](_0x537da1[_0xf7e8('0x30')]);_0x30aa8e['filters']=_[_0xf7e8('0x31')](_0x30aa8e[_0xf7e8('0x2f')],_0x30aa8e[_0xf7e8('0x30')]);_0x2fc2ba[_0xf7e8('0x32')]=_[_0xf7e8('0x31')](_0x30aa8e[_0xf7e8('0x2f')],qs[_0xf7e8('0x33')](_0x537da1[_0xf7e8('0x30')][_0xf7e8('0x33')]));_0x2fc2ba[_0xf7e8('0x32')]=_0x2fc2ba[_0xf7e8('0x32')][_0xf7e8('0x34')]?_0x2fc2ba[_0xf7e8('0x32')]:_0x30aa8e[_0xf7e8('0x2f')];if(!_0x537da1[_0xf7e8('0x30')][_0xf7e8('0x35')]('nolimit')){_0x2fc2ba['limit']=qs[_0xf7e8('0x1f')](_0x537da1['query'][_0xf7e8('0x1f')]);_0x2fc2ba[_0xf7e8('0x1c')]=qs['offset'](_0x537da1[_0xf7e8('0x30')][_0xf7e8('0x1c')]);}_0x2fc2ba[_0xf7e8('0x36')]=qs['sort'](_0x537da1[_0xf7e8('0x30')][_0xf7e8('0x37')]);_0x2fc2ba[_0xf7e8('0x38')]=qs[_0xf7e8('0x39')](_[_0xf7e8('0x3a')](_0x537da1['query'],_0x30aa8e[_0xf7e8('0x39')]),_0x50274c);if(_0x537da1['query']['filter']){_0x2fc2ba['where']=_[_0xf7e8('0x3b')](_0x2fc2ba[_0xf7e8('0x38')],{'$or':_[_0xf7e8('0x2a')](_0x50274c,function(_0x33116a){if(_0x33116a[_0xf7e8('0x2d')]!==_0xf7e8('0x3c')){var _0x77f7a3={};_0x77f7a3[_0x33116a[_0xf7e8('0x28')]]={'$like':'%'+_0x537da1[_0xf7e8('0x30')][_0xf7e8('0x3d')]+'%'};return _0x77f7a3;}})});}_0x2fc2ba=_['merge']({},_0x2fc2ba,_0x537da1[_0xf7e8('0x3e')]);var _0x3a3a50={'where':_0x2fc2ba[_0xf7e8('0x38')]};return db[_0xf7e8('0x3f')][_0xf7e8('0x1e')](_0x3a3a50)[_0xf7e8('0x25')](function(_0x231e2d){_0x1622e3[_0xf7e8('0x1e')]=_0x231e2d;if(_0x537da1[_0xf7e8('0x30')]['includeAll']){_0x2fc2ba[_0xf7e8('0x40')]=[{'all':!![]}];}return db['ServicenowField'][_0xf7e8('0x41')](_0x2fc2ba);})[_0xf7e8('0x25')](function(_0x2e4f54){_0x1622e3[_0xf7e8('0x42')]=_0x2e4f54;return _0x1622e3;})[_0xf7e8('0x25')](respondWithFilteredResult(_0x24e087,_0x2fc2ba))[_0xf7e8('0x43')](handleError(_0x24e087,null));};exports[_0xf7e8('0x44')]=function(_0x5b1644,_0x197d05){var _0x2187c7={'raw':!![],'where':{'id':_0x5b1644[_0xf7e8('0x45')]['id']}},_0x1d9449={};_0x1d9449['model']=_['keys'](db['ServicenowField'][_0xf7e8('0x2b')]);_0x1d9449[_0xf7e8('0x30')]=_[_0xf7e8('0x46')](_0x5b1644[_0xf7e8('0x30')]);_0x1d9449['filters']=_['intersection'](_0x1d9449['model'],_0x1d9449[_0xf7e8('0x30')]);_0x2187c7[_0xf7e8('0x32')]=_[_0xf7e8('0x31')](_0x1d9449[_0xf7e8('0x2f')],qs[_0xf7e8('0x33')](_0x5b1644[_0xf7e8('0x30')][_0xf7e8('0x33')]));_0x2187c7['attributes']=_0x2187c7[_0xf7e8('0x32')]['length']?_0x2187c7[_0xf7e8('0x32')]:_0x1d9449[_0xf7e8('0x2f')];if(_0x5b1644[_0xf7e8('0x30')][_0xf7e8('0x47')]){_0x2187c7[_0xf7e8('0x40')]=[{'all':!![]}];}_0x2187c7=_[_0xf7e8('0x3b')]({},_0x2187c7,_0x5b1644[_0xf7e8('0x3e')]);return db[_0xf7e8('0x3f')][_0xf7e8('0x48')](_0x2187c7)[_0xf7e8('0x25')](handleEntityNotFound(_0x197d05,null))[_0xf7e8('0x25')](respondWithResult(_0x197d05,null))['catch'](handleError(_0x197d05,null));};exports[_0xf7e8('0x49')]=function(_0x241115,_0x5a4d6a){return db[_0xf7e8('0x3f')][_0xf7e8('0x49')](_0x241115['body'],{})[_0xf7e8('0x25')](respondWithResult(_0x5a4d6a,0xc9))[_0xf7e8('0x43')](handleError(_0x5a4d6a,null));};exports[_0xf7e8('0x24')]=function(_0x45cc09,_0x202d4e){if(_0x45cc09[_0xf7e8('0x4a')]['id']){delete _0x45cc09[_0xf7e8('0x4a')]['id'];}return db[_0xf7e8('0x3f')][_0xf7e8('0x48')]({'where':{'id':_0x45cc09[_0xf7e8('0x45')]['id']}})[_0xf7e8('0x25')](handleEntityNotFound(_0x202d4e,null))['then'](saveUpdates(_0x45cc09[_0xf7e8('0x4a')],null))['then'](respondWithResult(_0x202d4e,null))['catch'](handleError(_0x202d4e,null));};exports[_0xf7e8('0x26')]=function(_0x15bfea,_0x1ff6cf){return db[_0xf7e8('0x3f')]['find']({'where':{'id':_0x15bfea[_0xf7e8('0x45')]['id']}})[_0xf7e8('0x25')](handleEntityNotFound(_0x1ff6cf,null))[_0xf7e8('0x25')](removeEntity(_0x1ff6cf,null))['catch'](handleError(_0x1ff6cf,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 639f3e7..8dcd727 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 _0xf494=['define','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xf494,0x1c6));var _0x4f49=function(_0x1f1480,_0x352be7){_0x1f1480=_0x1f1480-0x0;var _0x121692=_0xf494[_0x1f1480];return _0x121692;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xd'),_0x4f49('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b27=['idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x35e124,_0x1d85e2){var _0x53c482=function(_0x5afd39){while(--_0x5afd39){_0x35e124['push'](_0x35e124['shift']());}};_0x53c482(++_0x1d85e2);}(_0x1b27,0x91));var _0x71b2=function(_0x2d60a3,_0x2bb42a){_0x2d60a3=_0x2d60a3-0x0;var _0x1b43df=_0x1b27[_0x2d60a3];return _0x1b43df;};'use strict';var _=require(_0x71b2('0x0'));var util=require(_0x71b2('0x1'));var logger=require(_0x71b2('0x2'))(_0x71b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71b2('0x4'));var fs=require('fs');var path=require(_0x71b2('0x5'));var rimraf=require('rimraf');var config=require(_0x71b2('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x71b2('0x7')]=function(_0x42181c,_0x5a20f){return _0x42181c['define'](_0x71b2('0x8'),attributes,{'tableName':_0x71b2('0x9'),'paranoid':![],'indexes':[{'name':_0x71b2('0xa'),'fields':[_0x71b2('0xb'),_0x71b2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 2b270f3..4a3216f 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 _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0xda3f,0xec));var _0xfda3=function(_0x2c82ff,_0x21b57f){_0x2c82ff=_0x2c82ff-0x0;var _0x585297=_0xda3f[_0x2c82ff];return _0x585297;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 07fb5f1..18d8e3a 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1a927c,_0x4e852c){var _0x5eeb2c=function(_0x33964f){while(--_0x33964f){_0x1a927c['push'](_0x1a927c['shift']());}};_0x5eeb2c(++_0x4e852c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x8b7a25,_0x18039b){var _0x58cbec=function(_0xd9796b){while(--_0xd9796b){_0x8b7a25['push'](_0x8b7a25['shift']());}};_0x58cbec(++_0x18039b);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 41a6742..b6dc569 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(_0x345878,_0x24c6f4){var _0x47be94=function(_0x269f65){while(--_0x269f65){_0x345878['push'](_0x345878['shift']());}};_0x47be94(++_0x24c6f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x4048a6,_0x2a32b0){var _0x28e887=function(_0x76685c){while(--_0x76685c){_0x4048a6['push'](_0x4048a6['shift']());}};_0x28e887(++_0x2a32b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 099a8af..9e96db3 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 _0x7f3f=['zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','fields','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','remoteUri','slice','POST','/service/v4_1/rest.php','login','JSON','username','password','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','%s%s','get_module_fields','stringify','Calls','module_fields','remove','includes','label','endsWith','values','value','test','statusCode','error','send','Wrong\x20credentials','eml-format','rimraf'];(function(_0x5e4eb4,_0x1549eb){var _0xeac0c0=function(_0x33ea21){while(--_0x33ea21){_0x5e4eb4['push'](_0x5e4eb4['shift']());}};_0xeac0c0(++_0x1549eb);}(_0x7f3f,0x1ca));var _0xf7f3=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0x7f3f[_0x403115];return _0x596ef3;};'use strict';var emlformat=require(_0xf7f3('0x0'));var rimraf=require(_0xf7f3('0x1'));var zipdir=require(_0xf7f3('0x2'));var jsonpatch=require(_0xf7f3('0x3'));var rp=require(_0xf7f3('0x4'));var moment=require(_0xf7f3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf7f3('0x6'));var path=require(_0xf7f3('0x7'));var sox=require(_0xf7f3('0x8'));var csv=require(_0xf7f3('0x9'));var ejs=require(_0xf7f3('0xa'));var fs=require('fs');var fs_extra=require(_0xf7f3('0xb'));var _=require('lodash');var squel=require(_0xf7f3('0xc'));var crypto=require('crypto');var jsforce=require(_0xf7f3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7f3('0x9'));var querystring=require(_0xf7f3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf7f3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf7f3('0x10'));var hardwareService=require(_0xf7f3('0x11'));var logger=require('../../config/logger')(_0xf7f3('0x12'));var utils=require(_0xf7f3('0x13'));var config=require(_0xf7f3('0x14'));var licenseUtil=require(_0xf7f3('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xb193de,_0xc48f77){_0xc48f77=_0xc48f77||0xcc;return function(_0x4fa412){if(_0x4fa412){return _0xb193de[_0xf7f3('0x16')](_0xc48f77);}return _0xb193de[_0xf7f3('0x17')](_0xc48f77)[_0xf7f3('0x18')]();};}function respondWithResult(_0x4f2876,_0x3d72dc){_0x3d72dc=_0x3d72dc||0xc8;return function(_0x2c1aa1){if(_0x2c1aa1){return _0x4f2876[_0xf7f3('0x17')](_0x3d72dc)[_0xf7f3('0x19')](_0x2c1aa1);}};}function respondWithFilteredResult(_0x4d0baf,_0x5872f6){return function(_0x3b8c6d){if(_0x3b8c6d){var _0x22c0ad=typeof _0x5872f6[_0xf7f3('0x1a')]===_0xf7f3('0x1b')&&typeof _0x5872f6['limit']===_0xf7f3('0x1b');var _0x4dd4c9=_0x3b8c6d[_0xf7f3('0x1c')];var _0x5364db=_0x22c0ad?0x0:_0x5872f6[_0xf7f3('0x1a')];var _0x348a9c=_0x22c0ad?_0x3b8c6d[_0xf7f3('0x1c')]:_0x5872f6[_0xf7f3('0x1a')]+_0x5872f6[_0xf7f3('0x1d')];var _0x3018f3;if(_0x348a9c>=_0x4dd4c9){_0x348a9c=_0x4dd4c9;_0x3018f3=0xc8;}else{_0x3018f3=0xce;}_0x4d0baf['status'](_0x3018f3);return _0x4d0baf['set']('Content-Range',_0x5364db+'-'+_0x348a9c+'/'+_0x4dd4c9)[_0xf7f3('0x19')](_0x3b8c6d);}return null;};}function patchUpdates(_0x1bae90){return function(_0x32cbad){try{jsonpatch[_0xf7f3('0x1e')](_0x32cbad,_0x1bae90,!![]);}catch(_0x46788d){return BPromise[_0xf7f3('0x1f')](_0x46788d);}return _0x32cbad[_0xf7f3('0x20')]();};}function saveUpdates(_0x22ae7e,_0x34ce4c){return function(_0x159c62){if(_0x159c62){return _0x159c62[_0xf7f3('0x21')](_0x22ae7e)[_0xf7f3('0x22')](function(_0x44182a){return _0x44182a;});}return null;};}function removeEntity(_0x4b3e1b,_0x5cfb46){return function(_0x5ebd5b){if(_0x5ebd5b){return _0x5ebd5b[_0xf7f3('0x23')]()[_0xf7f3('0x22')](function(){_0x4b3e1b['status'](0xcc)[_0xf7f3('0x18')]();});}};}function handleEntityNotFound(_0x165228,_0xfd4c25){return function(_0x10e153){if(!_0x10e153){_0x165228[_0xf7f3('0x16')](0x194);}return _0x10e153;};}function handleError(_0x5112cf,_0x1a3bdc){_0x1a3bdc=_0x1a3bdc||0x1f4;return function(_0x790812){logger['error'](_0x790812['stack']);if(_0x790812[_0xf7f3('0x24')]){delete _0x790812[_0xf7f3('0x24')];}_0x5112cf[_0xf7f3('0x17')](_0x1a3bdc)['send'](_0x790812);};}exports[_0xf7f3('0x25')]=function(_0x5c78bd,_0x4cd05c){var _0x181fe8={},_0x26df12={},_0x1fc121={'count':0x0,'rows':[]};var _0xb7f2d=_[_0xf7f3('0x26')](db[_0xf7f3('0x27')][_0xf7f3('0x28')],function(_0x526fc7){return{'name':_0x526fc7[_0xf7f3('0x29')],'type':_0x526fc7['type'][_0xf7f3('0x2a')]};});_0x26df12[_0xf7f3('0x2b')]=_[_0xf7f3('0x26')](_0xb7f2d,'name');_0x26df12[_0xf7f3('0x2c')]=_['keys'](_0x5c78bd[_0xf7f3('0x2c')]);_0x26df12[_0xf7f3('0x2d')]=_[_0xf7f3('0x2e')](_0x26df12[_0xf7f3('0x2b')],_0x26df12['query']);_0x181fe8[_0xf7f3('0x2f')]=_[_0xf7f3('0x2e')](_0x26df12['model'],qs['fields'](_0x5c78bd[_0xf7f3('0x2c')]['fields']));_0x181fe8[_0xf7f3('0x2f')]=_0x181fe8[_0xf7f3('0x2f')][_0xf7f3('0x30')]?_0x181fe8['attributes']:_0x26df12[_0xf7f3('0x2b')];if(!_0x5c78bd['query'][_0xf7f3('0x31')](_0xf7f3('0x32'))){_0x181fe8[_0xf7f3('0x1d')]=qs[_0xf7f3('0x1d')](_0x5c78bd[_0xf7f3('0x2c')]['limit']);_0x181fe8['offset']=qs[_0xf7f3('0x1a')](_0x5c78bd[_0xf7f3('0x2c')]['offset']);}_0x181fe8[_0xf7f3('0x33')]=qs[_0xf7f3('0x34')](_0x5c78bd[_0xf7f3('0x2c')][_0xf7f3('0x34')]);_0x181fe8[_0xf7f3('0x35')]=qs['filters'](_[_0xf7f3('0x36')](_0x5c78bd['query'],_0x26df12[_0xf7f3('0x2d')]),_0xb7f2d);if(_0x5c78bd[_0xf7f3('0x2c')][_0xf7f3('0x37')]){_0x181fe8['where']=_[_0xf7f3('0x38')](_0x181fe8[_0xf7f3('0x35')],{'$or':_[_0xf7f3('0x26')](_0xb7f2d,function(_0x320cd6){if(_0x320cd6['type']!==_0xf7f3('0x39')){var _0x5624eb={};_0x5624eb[_0x320cd6['name']]={'$like':'%'+_0x5c78bd[_0xf7f3('0x2c')][_0xf7f3('0x37')]+'%'};return _0x5624eb;}})});}_0x181fe8=_['merge']({},_0x181fe8,_0x5c78bd[_0xf7f3('0x3a')]);var _0x302f7b={'where':_0x181fe8[_0xf7f3('0x35')]};return db['SugarcrmAccount'][_0xf7f3('0x1c')](_0x302f7b)['then'](function(_0x10b49f){_0x1fc121[_0xf7f3('0x1c')]=_0x10b49f;if(_0x5c78bd[_0xf7f3('0x2c')][_0xf7f3('0x3b')]){_0x181fe8[_0xf7f3('0x3c')]=[{'all':!![]}];}return db[_0xf7f3('0x27')][_0xf7f3('0x3d')](_0x181fe8);})[_0xf7f3('0x22')](function(_0x5312ce){_0x1fc121['rows']=_0x5312ce;return _0x1fc121;})[_0xf7f3('0x22')](respondWithFilteredResult(_0x4cd05c,_0x181fe8))[_0xf7f3('0x3e')](handleError(_0x4cd05c,null));};exports['show']=function(_0x2a7a04,_0x19e29d){var _0x156f36={'raw':![],'where':{'id':_0x2a7a04[_0xf7f3('0x3f')]['id']}},_0x4994c5={};_0x4994c5[_0xf7f3('0x2b')]=_[_0xf7f3('0x40')](db[_0xf7f3('0x27')][_0xf7f3('0x28')]);_0x4994c5[_0xf7f3('0x2c')]=_[_0xf7f3('0x40')](_0x2a7a04['query']);_0x4994c5[_0xf7f3('0x2d')]=_[_0xf7f3('0x2e')](_0x4994c5[_0xf7f3('0x2b')],_0x4994c5[_0xf7f3('0x2c')]);_0x156f36[_0xf7f3('0x2f')]=_[_0xf7f3('0x2e')](_0x4994c5[_0xf7f3('0x2b')],qs[_0xf7f3('0x41')](_0x2a7a04[_0xf7f3('0x2c')][_0xf7f3('0x41')]));_0x156f36[_0xf7f3('0x2f')]=_0x156f36['attributes'][_0xf7f3('0x30')]?_0x156f36[_0xf7f3('0x2f')]:_0x4994c5['model'];if(_0x2a7a04['query'][_0xf7f3('0x3b')]){_0x156f36[_0xf7f3('0x3c')]=[{'all':!![]}];}_0x156f36=_['merge']({},_0x156f36,_0x2a7a04[_0xf7f3('0x3a')]);return db[_0xf7f3('0x27')]['find'](_0x156f36)[_0xf7f3('0x22')](handleEntityNotFound(_0x19e29d,null))[_0xf7f3('0x22')](respondWithResult(_0x19e29d,null))['catch'](handleError(_0x19e29d,null));};exports[_0xf7f3('0x42')]=function(_0x21ac60,_0x5aa3be){return db[_0xf7f3('0x27')]['create'](_0x21ac60[_0xf7f3('0x43')],{})[_0xf7f3('0x22')](respondWithResult(_0x5aa3be,0xc9))[_0xf7f3('0x3e')](handleError(_0x5aa3be,null));};exports['update']=function(_0x16671a,_0x59fd04){if(_0x16671a['body']['id']){delete _0x16671a[_0xf7f3('0x43')]['id'];}return db['SugarcrmAccount'][_0xf7f3('0x44')]({'where':{'id':_0x16671a['params']['id']}})[_0xf7f3('0x22')](handleEntityNotFound(_0x59fd04,null))['then'](saveUpdates(_0x16671a[_0xf7f3('0x43')],null))['then'](respondWithResult(_0x59fd04,null))[_0xf7f3('0x3e')](handleError(_0x59fd04,null));};exports[_0xf7f3('0x23')]=function(_0x5af16a,_0x4a2d94){return db[_0xf7f3('0x27')][_0xf7f3('0x44')]({'where':{'id':_0x5af16a[_0xf7f3('0x3f')]['id']}})[_0xf7f3('0x22')](handleEntityNotFound(_0x4a2d94,null))['then'](removeEntity(_0x4a2d94,null))[_0xf7f3('0x3e')](handleError(_0x4a2d94,null));};exports[_0xf7f3('0x45')]=function(_0x16b324,_0x165188,_0x5e2505){var _0x4dc59b={};var _0x11632b={};var _0x3b1cd6;var _0x1bb123;return db[_0xf7f3('0x27')][_0xf7f3('0x46')]({'where':{'id':_0x16b324[_0xf7f3('0x3f')]['id']}})[_0xf7f3('0x22')](handleEntityNotFound(_0x165188,null))['then'](function(_0x188308){if(_0x188308){_0x3b1cd6=_0x188308;_0x11632b[_0xf7f3('0x2b')]=_[_0xf7f3('0x40')](db[_0xf7f3('0x47')][_0xf7f3('0x28')]);_0x11632b[_0xf7f3('0x2c')]=_[_0xf7f3('0x40')](_0x16b324[_0xf7f3('0x2c')]);_0x11632b[_0xf7f3('0x2d')]=_[_0xf7f3('0x2e')](_0x11632b['model'],_0x11632b['query']);_0x4dc59b['attributes']=_[_0xf7f3('0x2e')](_0x11632b['model'],qs[_0xf7f3('0x41')](_0x16b324[_0xf7f3('0x2c')]['fields']));_0x4dc59b[_0xf7f3('0x2f')]=_0x4dc59b[_0xf7f3('0x2f')]['length']?_0x4dc59b[_0xf7f3('0x2f')]:_0x11632b[_0xf7f3('0x2b')];_0x4dc59b[_0xf7f3('0x33')]=qs[_0xf7f3('0x34')](_0x16b324[_0xf7f3('0x2c')][_0xf7f3('0x34')]);_0x4dc59b[_0xf7f3('0x35')]=qs[_0xf7f3('0x2d')](_['pick'](_0x16b324[_0xf7f3('0x2c')],_0x11632b[_0xf7f3('0x2d')]));if(_0x16b324['query'][_0xf7f3('0x37')]){_0x4dc59b[_0xf7f3('0x35')]=_[_0xf7f3('0x38')](_0x4dc59b['where'],{'$or':_[_0xf7f3('0x26')](_0x4dc59b[_0xf7f3('0x2f')],function(_0x36cf84){var _0x34b384={};_0x34b384[_0x36cf84]={'$like':'%'+_0x16b324[_0xf7f3('0x2c')][_0xf7f3('0x37')]+'%'};return _0x34b384;})});}_0x4dc59b=_[_0xf7f3('0x38')]({},_0x4dc59b,_0x16b324[_0xf7f3('0x3a')]);return _0x3b1cd6[_0xf7f3('0x45')](_0x4dc59b);}})[_0xf7f3('0x22')](function(_0x543678){if(_0x543678){_0x1bb123=_0x543678[_0xf7f3('0x30')];if(!_0x16b324['query'][_0xf7f3('0x31')](_0xf7f3('0x32'))){_0x4dc59b[_0xf7f3('0x1d')]=qs['limit'](_0x16b324['query'][_0xf7f3('0x1d')]);_0x4dc59b[_0xf7f3('0x1a')]=qs['offset'](_0x16b324[_0xf7f3('0x2c')]['offset']);}return _0x3b1cd6[_0xf7f3('0x45')](_0x4dc59b);}})[_0xf7f3('0x22')](function(_0x4083fe){if(_0x4083fe){return _0x4083fe?{'count':_0x1bb123,'rows':_0x4083fe}:null;}})[_0xf7f3('0x22')](respondWithResult(_0x165188,null))[_0xf7f3('0x3e')](handleError(_0x165188,null));};exports['addConfiguration']=function(_0x40379f,_0x134c98,_0x5f20e0){if(_0x40379f[_0xf7f3('0x43')]['id']){delete _0x40379f['body']['id'];}return db[_0xf7f3('0x27')][_0xf7f3('0x46')]({'where':{'id':_0x40379f[_0xf7f3('0x3f')]['id']}})[_0xf7f3('0x22')](handleEntityNotFound(_0x134c98,null))[_0xf7f3('0x22')](function(_0x4a4b27){if(_0x4a4b27){_0x40379f[_0xf7f3('0x43')][_0xf7f3('0x48')]=_0x4a4b27['id'];_0x40379f[_0xf7f3('0x43')][_0xf7f3('0x49')]=integrations['getSubjects'](_0x40379f['body'][_0xf7f3('0x4a')],_0x40379f['body'][_0xf7f3('0x4b')]);_0x40379f[_0xf7f3('0x43')][_0xf7f3('0x4c')]=integrations[_0xf7f3('0x4d')](_0x40379f[_0xf7f3('0x43')][_0xf7f3('0x4a')],_0x40379f[_0xf7f3('0x43')][_0xf7f3('0x4b')]);return db[_0xf7f3('0x47')][_0xf7f3('0x42')](_0x40379f[_0xf7f3('0x43')],{'include':[{'model':db[_0xf7f3('0x4e')],'as':_0xf7f3('0x49')},{'model':db[_0xf7f3('0x4e')],'as':_0xf7f3('0x4c')}]});}return null;})[_0xf7f3('0x22')](respondWithResult(_0x134c98,null))[_0xf7f3('0x3e')](handleError(_0x134c98,null));};exports['getFields']=function(_0x8fb0a7,_0x3e248d,_0x312b4b){var _0x3342db='';var _0x5bc4d7=['id','name',_0xf7f3('0x4f'),_0xf7f3('0x50'),_0xf7f3('0x51'),'date_start',_0xf7f3('0x52'),_0xf7f3('0x53'),_0xf7f3('0x54'),_0xf7f3('0x55'),_0xf7f3('0x56'),_0xf7f3('0x57')];return db[_0xf7f3('0x27')][_0xf7f3('0x46')]({'where':{'id':_0x8fb0a7[_0xf7f3('0x3f')]['id']},'attributes':['id','username','password',_0xf7f3('0x58')]})['then'](handleEntityNotFound(_0x3e248d,null))[_0xf7f3('0x22')](function(_0x3875b5){if(_0x3875b5){_0x3342db=_0x3875b5[_0xf7f3('0x58')];var _0x3cdca8=_0x3342db[_0xf7f3('0x59')](-0x1);if(_0x3cdca8==='/'){_0x3342db=_0x3342db['substring'](0x0,_0x3342db['lastIndexOf'](_0x3cdca8));}return rp({'method':_0xf7f3('0x5a'),'uri':util['format']('%s%s',_0x3342db,_0xf7f3('0x5b')),'json':!![],'form':{'method':_0xf7f3('0x5c'),'input_type':_0xf7f3('0x5d'),'response_type':_0xf7f3('0x5d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3875b5[_0xf7f3('0x5e')],'password':_0x3875b5[_0xf7f3('0x5f')],'encryption':'PLAIN'},'application':_0xf7f3('0x60')})}});}})[_0xf7f3('0x22')](function(_0xbf06ff){if(_0xbf06ff&&_0xbf06ff[_0xf7f3('0x24')]!=='Invalid\x20Login'&&_0xbf06ff[_0xf7f3('0x24')]!==_0xf7f3('0x61')){return rp({'method':_0xf7f3('0x5a'),'uri':util[_0xf7f3('0x62')](_0xf7f3('0x63'),_0x3342db,_0xf7f3('0x5b')),'json':!![],'form':{'method':_0xf7f3('0x64'),'input_type':_0xf7f3('0x5d'),'response_type':'JSON','rest_data':JSON[_0xf7f3('0x65')]({'session':_0xbf06ff['id'],'module_name':_0xf7f3('0x66')})}})[_0xf7f3('0x22')](function(_0x5a5cdc){if(_0x5a5cdc){var _0xcbc891=_['values'](_0x5a5cdc[_0xf7f3('0x67')]);_[_0xf7f3('0x68')](_0xcbc891,function(_0x2f6170){return _0x5bc4d7[_0xf7f3('0x69')](_0x2f6170[_0xf7f3('0x24')]);});return{'count':_0xcbc891['length'],'rows':_[_0xf7f3('0x26')](_0xcbc891,function(_0x1397b3){return{'id':_0x1397b3['name'],'name':_0x1397b3[_0xf7f3('0x6a')],'custom':_[_0xf7f3('0x6b')](_0x1397b3[_0xf7f3('0x24')],'_c')?!![]:![],'options':_0x1397b3['options']?_[_0xf7f3('0x26')](_[_0xf7f3('0x6c')](_0x1397b3['options']),function(_0x21ffb2){return{'name':_0x21ffb2[_0xf7f3('0x6d')],'value':_0x21ffb2[_0xf7f3('0x24')]};}):[]};})};}})[_0xf7f3('0x22')](respondWithResult(_0x3e248d,null))[_0xf7f3('0x3e')](function(_0x1d9a22){var _0x21f3ae=_0x8fb0a7[_0xf7f3('0x2c')][_0xf7f3('0x6e')]?0x1f4:_0x1d9a22[_0xf7f3('0x6f')]||0x1f4;logger[_0xf7f3('0x70')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x21f3ae,JSON[_0xf7f3('0x65')](_0x1d9a22));delete _0x1d9a22[_0xf7f3('0x24')];if(_0x21f3ae===0x191){_0x21f3ae=0x190;}_0x3e248d[_0xf7f3('0x17')](_0x21f3ae)[_0xf7f3('0x71')](_0x8fb0a7[_0xf7f3('0x2c')]['test']?{'message':_0xf7f3('0x72'),'statusCode':_0x1d9a22[_0xf7f3('0x6f')]}:_0x1d9a22);});}else{var _0x36d85d=0x1f4;_0x3e248d['status'](_0x36d85d)['send']({'message':_0xf7f3('0x72'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xc94a=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','SugarcrmAccount','include','rows','params','keys','rawAttributes','attributes','find','create','body','catch','getConfigurations','findOne','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','login','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','/service/v4_1/rest.php','get_module_fields','JSON','values','remove','includes','label','value','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc94a,0x14a));var _0xac94=function(_0x36a5f0,_0x3f0ecf){_0x36a5f0=_0x36a5f0-0x0;var _0xdf5cae=_0xc94a[_0x36a5f0];return _0xdf5cae;};'use strict';var emlformat=require(_0xac94('0x0'));var rimraf=require(_0xac94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac94('0x2'));var rp=require(_0xac94('0x3'));var moment=require(_0xac94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac94('0x5'));var util=require(_0xac94('0x6'));var path=require(_0xac94('0x7'));var sox=require(_0xac94('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac94('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xac94('0xa'));var jsforce=require(_0xac94('0xb'));var deskjs=require(_0xac94('0xc'));var toCsv=require(_0xac94('0xd'));var querystring=require(_0xac94('0xe'));var Papa=require(_0xac94('0xf'));var Redis=require(_0xac94('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xac94('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac94('0x12'));var logger=require(_0xac94('0x13'))(_0xac94('0x14'));var utils=require('../../config/utils');var config=require(_0xac94('0x15'));var licenseUtil=require(_0xac94('0x16'));var db=require(_0xac94('0x17'))['db'];var integrations=require(_0xac94('0x18'));function respondWithStatusCode(_0x7959b6,_0xe6eac3){_0xe6eac3=_0xe6eac3||0xcc;return function(_0x3256b2){if(_0x3256b2){return _0x7959b6['sendStatus'](_0xe6eac3);}return _0x7959b6[_0xac94('0x19')](_0xe6eac3)[_0xac94('0x1a')]();};}function respondWithResult(_0x3a57b6,_0x5ab15b){_0x5ab15b=_0x5ab15b||0xc8;return function(_0x37ddea){if(_0x37ddea){return _0x3a57b6[_0xac94('0x19')](_0x5ab15b)[_0xac94('0x1b')](_0x37ddea);}};}function respondWithFilteredResult(_0x191612,_0x8b4e3a){return function(_0x1ee53a){if(_0x1ee53a){var _0x2b67d7=typeof _0x8b4e3a[_0xac94('0x1c')]===_0xac94('0x1d')&&typeof _0x8b4e3a[_0xac94('0x1e')]===_0xac94('0x1d');var _0x24fffc=_0x1ee53a[_0xac94('0x1f')];var _0x425e1d=_0x2b67d7?0x0:_0x8b4e3a[_0xac94('0x1c')];var _0x37323d=_0x2b67d7?_0x1ee53a[_0xac94('0x1f')]:_0x8b4e3a[_0xac94('0x1c')]+_0x8b4e3a['limit'];var _0x1f5488;if(_0x37323d>=_0x24fffc){_0x37323d=_0x24fffc;_0x1f5488=0xc8;}else{_0x1f5488=0xce;}_0x191612[_0xac94('0x19')](_0x1f5488);return _0x191612[_0xac94('0x20')](_0xac94('0x21'),_0x425e1d+'-'+_0x37323d+'/'+_0x24fffc)['json'](_0x1ee53a);}return null;};}function patchUpdates(_0x2fd852){return function(_0x4e9e4f){try{jsonpatch[_0xac94('0x22')](_0x4e9e4f,_0x2fd852,!![]);}catch(_0x299ec4){return BPromise[_0xac94('0x23')](_0x299ec4);}return _0x4e9e4f['save']();};}function saveUpdates(_0x6cb0cd,_0x2d3389){return function(_0x4ac66b){if(_0x4ac66b){return _0x4ac66b[_0xac94('0x24')](_0x6cb0cd)[_0xac94('0x25')](function(_0xdb2a56){return _0xdb2a56;});}return null;};}function removeEntity(_0x218a29,_0x3be116){return function(_0x5da979){if(_0x5da979){return _0x5da979[_0xac94('0x26')]()[_0xac94('0x25')](function(){_0x218a29[_0xac94('0x19')](0xcc)[_0xac94('0x1a')]();});}};}function handleEntityNotFound(_0x42ee7d,_0x38b3c5){return function(_0x4687b8){if(!_0x4687b8){_0x42ee7d[_0xac94('0x27')](0x194);}return _0x4687b8;};}function handleError(_0x39e639,_0x450f21){_0x450f21=_0x450f21||0x1f4;return function(_0x505258){logger['error'](_0x505258[_0xac94('0x28')]);if(_0x505258[_0xac94('0x29')]){delete _0x505258[_0xac94('0x29')];}_0x39e639[_0xac94('0x19')](_0x450f21)[_0xac94('0x2a')](_0x505258);};}exports[_0xac94('0x2b')]=function(_0xf5b4c9,_0x340211){var _0x5c78f2={},_0x5e00ea={},_0x5bbd3a={'count':0x0,'rows':[]};var _0x406d78=_['map'](db['SugarcrmAccount']['rawAttributes'],function(_0xb49997){return{'name':_0xb49997[_0xac94('0x2c')],'type':_0xb49997[_0xac94('0x2d')][_0xac94('0x2e')]};});_0x5e00ea[_0xac94('0x2f')]=_[_0xac94('0x30')](_0x406d78,_0xac94('0x29'));_0x5e00ea[_0xac94('0x31')]=_['keys'](_0xf5b4c9[_0xac94('0x31')]);_0x5e00ea[_0xac94('0x32')]=_[_0xac94('0x33')](_0x5e00ea['model'],_0x5e00ea[_0xac94('0x31')]);_0x5c78f2['attributes']=_['intersection'](_0x5e00ea['model'],qs['fields'](_0xf5b4c9[_0xac94('0x31')][_0xac94('0x34')]));_0x5c78f2['attributes']=_0x5c78f2['attributes'][_0xac94('0x35')]?_0x5c78f2['attributes']:_0x5e00ea[_0xac94('0x2f')];if(!_0xf5b4c9[_0xac94('0x31')]['hasOwnProperty'](_0xac94('0x36'))){_0x5c78f2[_0xac94('0x1e')]=qs[_0xac94('0x1e')](_0xf5b4c9[_0xac94('0x31')]['limit']);_0x5c78f2[_0xac94('0x1c')]=qs[_0xac94('0x1c')](_0xf5b4c9[_0xac94('0x31')][_0xac94('0x1c')]);}_0x5c78f2[_0xac94('0x37')]=qs['sort'](_0xf5b4c9[_0xac94('0x31')][_0xac94('0x38')]);_0x5c78f2[_0xac94('0x39')]=qs[_0xac94('0x32')](_[_0xac94('0x3a')](_0xf5b4c9['query'],_0x5e00ea['filters']),_0x406d78);if(_0xf5b4c9[_0xac94('0x31')][_0xac94('0x3b')]){_0x5c78f2[_0xac94('0x39')]=_[_0xac94('0x3c')](_0x5c78f2[_0xac94('0x39')],{'$or':_[_0xac94('0x30')](_0x406d78,function(_0x4d0fb0){if(_0x4d0fb0['type']!=='VIRTUAL'){var _0x35ffa3={};_0x35ffa3[_0x4d0fb0[_0xac94('0x29')]]={'$like':'%'+_0xf5b4c9[_0xac94('0x31')]['filter']+'%'};return _0x35ffa3;}})});}_0x5c78f2=_['merge']({},_0x5c78f2,_0xf5b4c9[_0xac94('0x3d')]);var _0x28791f={'where':_0x5c78f2[_0xac94('0x39')]};return db[_0xac94('0x3e')][_0xac94('0x1f')](_0x28791f)[_0xac94('0x25')](function(_0x1224d9){_0x5bbd3a[_0xac94('0x1f')]=_0x1224d9;if(_0xf5b4c9['query']['includeAll']){_0x5c78f2[_0xac94('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x5c78f2);})['then'](function(_0x15951d){_0x5bbd3a[_0xac94('0x40')]=_0x15951d;return _0x5bbd3a;})[_0xac94('0x25')](respondWithFilteredResult(_0x340211,_0x5c78f2))['catch'](handleError(_0x340211,null));};exports['show']=function(_0x2ab4e3,_0x5c294a){var _0x5185e6={'raw':![],'where':{'id':_0x2ab4e3[_0xac94('0x41')]['id']}},_0x222175={};_0x222175[_0xac94('0x2f')]=_[_0xac94('0x42')](db['SugarcrmAccount'][_0xac94('0x43')]);_0x222175[_0xac94('0x31')]=_[_0xac94('0x42')](_0x2ab4e3['query']);_0x222175[_0xac94('0x32')]=_['intersection'](_0x222175[_0xac94('0x2f')],_0x222175[_0xac94('0x31')]);_0x5185e6[_0xac94('0x44')]=_[_0xac94('0x33')](_0x222175['model'],qs[_0xac94('0x34')](_0x2ab4e3[_0xac94('0x31')][_0xac94('0x34')]));_0x5185e6[_0xac94('0x44')]=_0x5185e6[_0xac94('0x44')][_0xac94('0x35')]?_0x5185e6[_0xac94('0x44')]:_0x222175[_0xac94('0x2f')];if(_0x2ab4e3[_0xac94('0x31')]['includeAll']){_0x5185e6[_0xac94('0x3f')]=[{'all':!![]}];}_0x5185e6=_[_0xac94('0x3c')]({},_0x5185e6,_0x2ab4e3[_0xac94('0x3d')]);return db[_0xac94('0x3e')][_0xac94('0x45')](_0x5185e6)['then'](handleEntityNotFound(_0x5c294a,null))['then'](respondWithResult(_0x5c294a,null))['catch'](handleError(_0x5c294a,null));};exports[_0xac94('0x46')]=function(_0x21e4d8,_0x1c97e3){return db[_0xac94('0x3e')][_0xac94('0x46')](_0x21e4d8[_0xac94('0x47')],{})[_0xac94('0x25')](respondWithResult(_0x1c97e3,0xc9))[_0xac94('0x48')](handleError(_0x1c97e3,null));};exports[_0xac94('0x24')]=function(_0x2129b6,_0x14314d){if(_0x2129b6[_0xac94('0x47')]['id']){delete _0x2129b6[_0xac94('0x47')]['id'];}return db['SugarcrmAccount'][_0xac94('0x45')]({'where':{'id':_0x2129b6[_0xac94('0x41')]['id']}})[_0xac94('0x25')](handleEntityNotFound(_0x14314d,null))[_0xac94('0x25')](saveUpdates(_0x2129b6[_0xac94('0x47')],null))[_0xac94('0x25')](respondWithResult(_0x14314d,null))[_0xac94('0x48')](handleError(_0x14314d,null));};exports[_0xac94('0x26')]=function(_0x18534b,_0x21bc45){return db[_0xac94('0x3e')][_0xac94('0x45')]({'where':{'id':_0x18534b[_0xac94('0x41')]['id']}})['then'](handleEntityNotFound(_0x21bc45,null))[_0xac94('0x25')](removeEntity(_0x21bc45,null))['catch'](handleError(_0x21bc45,null));};exports[_0xac94('0x49')]=function(_0x22e04b,_0x547081,_0xca0de0){var _0x1ad681={};var _0x10f592={};var _0x9e1c94;var _0x48e189;return db['SugarcrmAccount'][_0xac94('0x4a')]({'where':{'id':_0x22e04b[_0xac94('0x41')]['id']}})['then'](handleEntityNotFound(_0x547081,null))[_0xac94('0x25')](function(_0x2f1dfa){if(_0x2f1dfa){_0x9e1c94=_0x2f1dfa;_0x10f592[_0xac94('0x2f')]=_[_0xac94('0x42')](db['SugarcrmConfiguration']['rawAttributes']);_0x10f592['query']=_[_0xac94('0x42')](_0x22e04b[_0xac94('0x31')]);_0x10f592[_0xac94('0x32')]=_[_0xac94('0x33')](_0x10f592[_0xac94('0x2f')],_0x10f592[_0xac94('0x31')]);_0x1ad681[_0xac94('0x44')]=_[_0xac94('0x33')](_0x10f592[_0xac94('0x2f')],qs['fields'](_0x22e04b['query']['fields']));_0x1ad681[_0xac94('0x44')]=_0x1ad681[_0xac94('0x44')][_0xac94('0x35')]?_0x1ad681[_0xac94('0x44')]:_0x10f592[_0xac94('0x2f')];_0x1ad681[_0xac94('0x37')]=qs[_0xac94('0x38')](_0x22e04b['query'][_0xac94('0x38')]);_0x1ad681[_0xac94('0x39')]=qs[_0xac94('0x32')](_[_0xac94('0x3a')](_0x22e04b[_0xac94('0x31')],_0x10f592['filters']));if(_0x22e04b[_0xac94('0x31')]['filter']){_0x1ad681[_0xac94('0x39')]=_[_0xac94('0x3c')](_0x1ad681[_0xac94('0x39')],{'$or':_[_0xac94('0x30')](_0x1ad681[_0xac94('0x44')],function(_0x38fe34){var _0x465461={};_0x465461[_0x38fe34]={'$like':'%'+_0x22e04b[_0xac94('0x31')][_0xac94('0x3b')]+'%'};return _0x465461;})});}_0x1ad681=_[_0xac94('0x3c')]({},_0x1ad681,_0x22e04b[_0xac94('0x3d')]);return _0x9e1c94[_0xac94('0x49')](_0x1ad681);}})[_0xac94('0x25')](function(_0x52c311){if(_0x52c311){_0x48e189=_0x52c311['length'];if(!_0x22e04b[_0xac94('0x31')]['hasOwnProperty'](_0xac94('0x36'))){_0x1ad681[_0xac94('0x1e')]=qs['limit'](_0x22e04b[_0xac94('0x31')][_0xac94('0x1e')]);_0x1ad681['offset']=qs[_0xac94('0x1c')](_0x22e04b[_0xac94('0x31')][_0xac94('0x1c')]);}return _0x9e1c94['getConfigurations'](_0x1ad681);}})[_0xac94('0x25')](function(_0xc5c428){if(_0xc5c428){return _0xc5c428?{'count':_0x48e189,'rows':_0xc5c428}:null;}})[_0xac94('0x25')](respondWithResult(_0x547081,null))[_0xac94('0x48')](handleError(_0x547081,null));};exports['addConfiguration']=function(_0x38ea8e,_0x555400,_0x4db844){if(_0x38ea8e['body']['id']){delete _0x38ea8e[_0xac94('0x47')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x38ea8e[_0xac94('0x41')]['id']}})['then'](handleEntityNotFound(_0x555400,null))[_0xac94('0x25')](function(_0x300cd0){if(_0x300cd0){_0x38ea8e[_0xac94('0x47')]['AccountId']=_0x300cd0['id'];_0x38ea8e['body']['Subjects']=integrations['getSubjects'](_0x38ea8e['body'][_0xac94('0x4b')],_0x38ea8e[_0xac94('0x47')][_0xac94('0x2d')]);_0x38ea8e[_0xac94('0x47')]['Descriptions']=integrations[_0xac94('0x4c')](_0x38ea8e[_0xac94('0x47')][_0xac94('0x4b')],_0x38ea8e[_0xac94('0x47')][_0xac94('0x2d')]);return db[_0xac94('0x4d')][_0xac94('0x46')](_0x38ea8e[_0xac94('0x47')],{'include':[{'model':db[_0xac94('0x4e')],'as':'Subjects'},{'model':db[_0xac94('0x4e')],'as':_0xac94('0x4f')}]});}return null;})['then'](respondWithResult(_0x555400,null))[_0xac94('0x48')](handleError(_0x555400,null));};exports[_0xac94('0x50')]=function(_0x41566a,_0x34e63b,_0x505814){var _0x2e3202='';var _0x373e59=['id',_0xac94('0x29'),_0xac94('0x51'),_0xac94('0x52'),_0xac94('0x53'),'date_start',_0xac94('0x54'),'duration_minutes',_0xac94('0x55'),_0xac94('0x56'),_0xac94('0x57'),_0xac94('0x58')];return db[_0xac94('0x3e')]['findOne']({'where':{'id':_0x41566a['params']['id']},'attributes':['id',_0xac94('0x59'),_0xac94('0x5a'),_0xac94('0x5b')]})[_0xac94('0x25')](handleEntityNotFound(_0x34e63b,null))[_0xac94('0x25')](function(_0x2fbc7b){if(_0x2fbc7b){_0x2e3202=_0x2fbc7b[_0xac94('0x5b')];var _0x1c46a1=_0x2e3202['slice'](-0x1);if(_0x1c46a1==='/'){_0x2e3202=_0x2e3202[_0xac94('0x5c')](0x0,_0x2e3202[_0xac94('0x5d')](_0x1c46a1));}return rp({'method':_0xac94('0x5e'),'uri':util[_0xac94('0x5f')](_0xac94('0x60'),_0x2e3202,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xac94('0x61'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xac94('0x62')]({'user_auth':{'user_name':_0x2fbc7b[_0xac94('0x59')],'password':_0x2fbc7b['password'],'encryption':_0xac94('0x63')},'application':_0xac94('0x64')})}});}})[_0xac94('0x25')](function(_0x395a72){if(_0x395a72&&_0x395a72['name']!==_0xac94('0x65')&&_0x395a72[_0xac94('0x29')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util['format'](_0xac94('0x60'),_0x2e3202,_0xac94('0x66')),'json':!![],'form':{'method':_0xac94('0x67'),'input_type':_0xac94('0x68'),'response_type':'JSON','rest_data':JSON[_0xac94('0x62')]({'session':_0x395a72['id'],'module_name':'Calls'})}})[_0xac94('0x25')](function(_0x4bc895){if(_0x4bc895){var _0x145c6e=_[_0xac94('0x69')](_0x4bc895['module_fields']);_[_0xac94('0x6a')](_0x145c6e,function(_0x55190e){return _0x373e59[_0xac94('0x6b')](_0x55190e[_0xac94('0x29')]);});return{'count':_0x145c6e[_0xac94('0x35')],'rows':_[_0xac94('0x30')](_0x145c6e,function(_0x2d3bd8){return{'id':_0x2d3bd8[_0xac94('0x29')],'name':_0x2d3bd8[_0xac94('0x6c')],'custom':_['endsWith'](_0x2d3bd8[_0xac94('0x29')],'_c')?!![]:![],'options':_0x2d3bd8['options']?_['map'](_['values'](_0x2d3bd8[_0xac94('0x3d')]),function(_0x11afd8){return{'name':_0x11afd8[_0xac94('0x6d')],'value':_0x11afd8[_0xac94('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x34e63b,null))[_0xac94('0x48')](function(_0x117abc){var _0x2f15e0=_0x41566a[_0xac94('0x31')]['test']?0x1f4:_0x117abc['statusCode']||0x1f4;logger[_0xac94('0x6e')](_0xac94('0x6f'),_0xac94('0x50'),_0x2f15e0,JSON['stringify'](_0x117abc));delete _0x117abc['name'];if(_0x2f15e0===0x191){_0x2f15e0=0x190;}_0x34e63b[_0xac94('0x19')](_0x2f15e0)[_0xac94('0x2a')](_0x41566a[_0xac94('0x31')][_0xac94('0x70')]?{'message':_0xac94('0x71'),'statusCode':_0x117abc['statusCode']}:_0x117abc);});}else{var _0x564438=0x1f4;_0x34e63b['status'](_0x564438)[_0xac94('0x2a')]({'message':_0xac94('0x71'),'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 bd64669..d24b8df 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 _0x31b0=['util','../../config/logger','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x750626,_0x3351ee){var _0x36f4c1=function(_0x122a9d){while(--_0x122a9d){_0x750626['push'](_0x750626['shift']());}};_0x36f4c1(++_0x3351ee);}(_0x31b0,0x15f));var _0x031b=function(_0x2fec41,_0x59dbd6){_0x2fec41=_0x2fec41-0x0;var _0x41cca4=_0x31b0[_0x2fec41];return _0x41cca4;};'use strict';var _=require(_0x031b('0x0'));var util=require(_0x031b('0x1'));var logger=require(_0x031b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x031b('0x3'));var rp=require(_0x031b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x031b('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x031b('0x6'));module[_0x031b('0x7')]=function(_0x2385c8,_0x31ca39){return _0x2385c8[_0x031b('0x8')](_0x031b('0x9'),attributes,{'tableName':_0x031b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ab3=['../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','path','rimraf'];(function(_0x518816,_0x4db921){var _0x1ac83e=function(_0x5834c9){while(--_0x5834c9){_0x518816['push'](_0x518816['shift']());}};_0x1ac83e(++_0x4db921);}(_0x2ab3,0x162));var _0x32ab=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x2ab3[_0x602ca8];return _0x26e8ab;};'use strict';var _=require(_0x32ab('0x0'));var util=require(_0x32ab('0x1'));var logger=require('../../config/logger')(_0x32ab('0x2'));var moment=require(_0x32ab('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ab('0x4'));var rimraf=require(_0x32ab('0x5'));var config=require(_0x32ab('0x6'));var attributes=require(_0x32ab('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x32ab('0x8')]=function(_0x166335,_0x120976){return _0x166335[_0x32ab('0x9')](_0x32ab('0xa'),attributes,{'tableName':_0x32ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index c4905ee..ce2ed6f 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 _0xee03=['then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','GetSugarcrmAccount','ShowSugarcrmAccount','find','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xee03,0x81));var _0x3ee0=function(_0x14beb2,_0x2079af){_0x14beb2=_0x14beb2-0x0;var _0x49b1f1=_0xee03[_0x14beb2];return _0x49b1f1;};'use strict';var _=require(_0x3ee0('0x0'));var util=require('util');var moment=require(_0x3ee0('0x1'));var BPromise=require(_0x3ee0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ee0('0x3'));var db=require(_0x3ee0('0x4'))['db'];var utils=require(_0x3ee0('0x5'));var logger=require(_0x3ee0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3ee0('0x7'));var client=jayson[_0x3ee0('0x8')][_0x3ee0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf300e9,_0x47d112,_0x3a2d6c){return new BPromise(function(_0x392aee,_0x608575){return client[_0x3ee0('0xa')](_0xf300e9,_0x3a2d6c)[_0x3ee0('0xb')](function(_0x4189e3){logger[_0x3ee0('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x47d112,_0x3ee0('0xd'));logger['debug'](_0x3ee0('0xe'),_0x47d112,'request\x20sent',JSON[_0x3ee0('0xf')](_0x4189e3));if(_0x4189e3[_0x3ee0('0x10')]){if(_0x4189e3[_0x3ee0('0x10')]['code']===0x1f4){logger['error'](_0x3ee0('0x11'),_0x47d112,_0x4189e3[_0x3ee0('0x10')][_0x3ee0('0x12')]);return _0x608575(_0x4189e3[_0x3ee0('0x10')][_0x3ee0('0x12')]);}logger['error'](_0x3ee0('0x11'),_0x47d112,_0x4189e3[_0x3ee0('0x10')][_0x3ee0('0x12')]);return _0x392aee(_0x4189e3[_0x3ee0('0x10')][_0x3ee0('0x12')]);}else{logger[_0x3ee0('0xc')](_0x3ee0('0x11'),_0x47d112,'request\x20sent');_0x392aee(_0x4189e3[_0x3ee0('0x13')][_0x3ee0('0x12')]);}})['catch'](function(_0xd841dc){logger[_0x3ee0('0x10')](_0x3ee0('0x11'),_0x47d112,_0xd841dc);_0x608575(_0xd841dc);});});}exports['GetSugarcrmAccount']=function(_0x14ede4){var _0xa10b42=this;return new Promise(function(_0xbd9a88,_0x166d2a){return db[_0x3ee0('0x14')][_0x3ee0('0x15')]({'raw':_0x14ede4['options']?_0x14ede4[_0x3ee0('0x16')][_0x3ee0('0x17')]===undefined?!![]:![]:!![],'where':_0x14ede4['options']?_0x14ede4[_0x3ee0('0x16')][_0x3ee0('0x18')]||null:null,'attributes':_0x14ede4[_0x3ee0('0x16')]?_0x14ede4[_0x3ee0('0x16')][_0x3ee0('0x19')]||null:null,'limit':_0x14ede4['options']?_0x14ede4[_0x3ee0('0x16')][_0x3ee0('0x1a')]||null:null,'include':_0x14ede4[_0x3ee0('0x16')]?_0x14ede4[_0x3ee0('0x16')]['include']?_[_0x3ee0('0x1b')](_0x14ede4['options'][_0x3ee0('0x1c')],function(_0x3bea3d){return{'model':db[_0x3bea3d[_0x3ee0('0x1d')]],'as':_0x3bea3d['as'],'attributes':_0x3bea3d[_0x3ee0('0x19')],'include':_0x3bea3d['include']?_['map'](_0x3bea3d['include'],function(_0x458936){return{'model':db[_0x458936[_0x3ee0('0x1d')]],'as':_0x458936['as'],'attributes':_0x458936[_0x3ee0('0x19')],'include':_0x458936['include']?_[_0x3ee0('0x1b')](_0x458936[_0x3ee0('0x1c')],function(_0x35b277){return{'model':db[_0x35b277[_0x3ee0('0x1d')]],'as':_0x35b277['as'],'attributes':_0x35b277[_0x3ee0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1041a9){logger[_0x3ee0('0xc')]('GetSugarcrmAccount',_0x14ede4);logger[_0x3ee0('0x1e')](_0x3ee0('0x1f'),_0x14ede4,JSON['stringify'](_0x1041a9));_0xbd9a88(_0x1041a9);})['catch'](function(_0x4be7e6){logger[_0x3ee0('0x10')](_0x3ee0('0x1f'),_0x4be7e6[_0x3ee0('0x12')],_0x14ede4);_0x166d2a(_0xa10b42[_0x3ee0('0x10')](0x1f4,_0x4be7e6[_0x3ee0('0x12')]));});});};exports[_0x3ee0('0x20')]=function(_0x442d80){var _0x7cbba=this;return new Promise(function(_0x99f914,_0x574fdb){return db[_0x3ee0('0x14')][_0x3ee0('0x21')]({'raw':_0x442d80[_0x3ee0('0x16')]?_0x442d80['options'][_0x3ee0('0x17')]===undefined?!![]:![]:!![],'where':_0x442d80[_0x3ee0('0x16')]?_0x442d80[_0x3ee0('0x16')][_0x3ee0('0x18')]||null:null,'attributes':_0x442d80[_0x3ee0('0x16')]?_0x442d80['options']['attributes']||null:null,'include':_0x442d80[_0x3ee0('0x16')]?_0x442d80['options'][_0x3ee0('0x1c')]?_[_0x3ee0('0x1b')](_0x442d80['options'][_0x3ee0('0x1c')],function(_0x407dc2){return{'model':db[_0x407dc2[_0x3ee0('0x1d')]],'as':_0x407dc2['as'],'attributes':_0x407dc2[_0x3ee0('0x19')],'include':_0x407dc2['include']?_['map'](_0x407dc2[_0x3ee0('0x1c')],function(_0x3c2a3b){return{'model':db[_0x3c2a3b['model']],'as':_0x3c2a3b['as'],'attributes':_0x3c2a3b['attributes'],'include':_0x3c2a3b[_0x3ee0('0x1c')]?_['map'](_0x3c2a3b[_0x3ee0('0x1c')],function(_0x20623e){return{'model':db[_0x20623e[_0x3ee0('0x1d')]],'as':_0x20623e['as'],'attributes':_0x20623e[_0x3ee0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3ee0('0xb')](function(_0x387c37){logger[_0x3ee0('0xc')]('ShowSugarcrmAccount',_0x442d80);logger[_0x3ee0('0x1e')]('ShowSugarcrmAccount',_0x442d80,JSON[_0x3ee0('0xf')](_0x387c37));_0x99f914(_0x387c37);})[_0x3ee0('0x22')](function(_0x18c4f2){logger[_0x3ee0('0x10')](_0x3ee0('0x20'),_0x18c4f2['message'],_0x442d80);_0x574fdb(_0x7cbba[_0x3ee0('0x10')](0x1f4,_0x18c4f2['message']));});});}; \ No newline at end of file +var _0x79cf=['debug','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','model','ShowSugarcrmAccount','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x79cf,0x1cf));var _0xf79c=function(_0x2a103a,_0x1c7b47){_0x2a103a=_0x2a103a-0x0;var _0x30f073=_0x79cf[_0x2a103a];return _0x30f073;};'use strict';var _=require(_0xf79c('0x0'));var util=require(_0xf79c('0x1'));var moment=require(_0xf79c('0x2'));var BPromise=require(_0xf79c('0x3'));var rs=require(_0xf79c('0x4'));var fs=require('fs');var Redis=require(_0xf79c('0x5'));var db=require(_0xf79c('0x6'))['db'];var utils=require(_0xf79c('0x7'));var logger=require(_0xf79c('0x8'))(_0xf79c('0x9'));var config=require(_0xf79c('0xa'));var jayson=require(_0xf79c('0xb'));var client=jayson[_0xf79c('0xc')][_0xf79c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x77f03d,_0x2b6c34,_0x13857e){return new BPromise(function(_0x74e553,_0x50c37c){return client[_0xf79c('0xe')](_0x77f03d,_0x13857e)[_0xf79c('0xf')](function(_0x33c0d9){logger[_0xf79c('0x10')](_0xf79c('0x11'),_0x2b6c34,'request\x20sent');logger[_0xf79c('0x12')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x2b6c34,_0xf79c('0x13'),JSON[_0xf79c('0x14')](_0x33c0d9));if(_0x33c0d9['error']){if(_0x33c0d9[_0xf79c('0x15')][_0xf79c('0x16')]===0x1f4){logger[_0xf79c('0x15')](_0xf79c('0x11'),_0x2b6c34,_0x33c0d9[_0xf79c('0x15')][_0xf79c('0x17')]);return _0x50c37c(_0x33c0d9[_0xf79c('0x15')]['message']);}logger[_0xf79c('0x15')]('SugarcrmAccount,\x20%s,\x20%s',_0x2b6c34,_0x33c0d9[_0xf79c('0x15')][_0xf79c('0x17')]);return _0x74e553(_0x33c0d9['error'][_0xf79c('0x17')]);}else{logger['info'](_0xf79c('0x11'),_0x2b6c34,'request\x20sent');_0x74e553(_0x33c0d9[_0xf79c('0x18')][_0xf79c('0x17')]);}})[_0xf79c('0x19')](function(_0x26f5c3){logger[_0xf79c('0x15')]('SugarcrmAccount,\x20%s,\x20%s',_0x2b6c34,_0x26f5c3);_0x50c37c(_0x26f5c3);});});}exports[_0xf79c('0x1a')]=function(_0x38beaa){var _0x327fca=this;return new Promise(function(_0x182b4c,_0x1b1e07){return db[_0xf79c('0x1b')][_0xf79c('0x1c')]({'raw':_0x38beaa[_0xf79c('0x1d')]?_0x38beaa[_0xf79c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x38beaa['options']?_0x38beaa[_0xf79c('0x1d')][_0xf79c('0x1e')]||null:null,'attributes':_0x38beaa[_0xf79c('0x1d')]?_0x38beaa[_0xf79c('0x1d')][_0xf79c('0x1f')]||null:null,'limit':_0x38beaa['options']?_0x38beaa[_0xf79c('0x1d')][_0xf79c('0x20')]||null:null,'include':_0x38beaa['options']?_0x38beaa[_0xf79c('0x1d')][_0xf79c('0x21')]?_['map'](_0x38beaa['options'][_0xf79c('0x21')],function(_0x4f71a4){return{'model':db[_0x4f71a4[_0xf79c('0x22')]],'as':_0x4f71a4['as'],'attributes':_0x4f71a4[_0xf79c('0x1f')],'include':_0x4f71a4[_0xf79c('0x21')]?_['map'](_0x4f71a4[_0xf79c('0x21')],function(_0x3a3658){return{'model':db[_0x3a3658[_0xf79c('0x22')]],'as':_0x3a3658['as'],'attributes':_0x3a3658[_0xf79c('0x1f')],'include':_0x3a3658[_0xf79c('0x21')]?_['map'](_0x3a3658['include'],function(_0x4e44f0){return{'model':db[_0x4e44f0[_0xf79c('0x22')]],'as':_0x4e44f0['as'],'attributes':_0x4e44f0[_0xf79c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x495d25){logger[_0xf79c('0x10')](_0xf79c('0x1a'),_0x38beaa);logger[_0xf79c('0x12')](_0xf79c('0x1a'),_0x38beaa,JSON[_0xf79c('0x14')](_0x495d25));_0x182b4c(_0x495d25);})[_0xf79c('0x19')](function(_0x26a0a1){logger[_0xf79c('0x15')](_0xf79c('0x1a'),_0x26a0a1[_0xf79c('0x17')],_0x38beaa);_0x1b1e07(_0x327fca[_0xf79c('0x15')](0x1f4,_0x26a0a1['message']));});});};exports[_0xf79c('0x23')]=function(_0x290de5){var _0x1c4d0e=this;return new Promise(function(_0x30ef12,_0x77b532){return db[_0xf79c('0x1b')]['find']({'raw':_0x290de5[_0xf79c('0x1d')]?_0x290de5[_0xf79c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x290de5['options']?_0x290de5['options'][_0xf79c('0x1e')]||null:null,'attributes':_0x290de5[_0xf79c('0x1d')]?_0x290de5[_0xf79c('0x1d')][_0xf79c('0x1f')]||null:null,'include':_0x290de5[_0xf79c('0x1d')]?_0x290de5[_0xf79c('0x1d')][_0xf79c('0x21')]?_[_0xf79c('0x24')](_0x290de5[_0xf79c('0x1d')]['include'],function(_0x32593b){return{'model':db[_0x32593b[_0xf79c('0x22')]],'as':_0x32593b['as'],'attributes':_0x32593b[_0xf79c('0x1f')],'include':_0x32593b[_0xf79c('0x21')]?_[_0xf79c('0x24')](_0x32593b[_0xf79c('0x21')],function(_0x391403){return{'model':db[_0x391403[_0xf79c('0x22')]],'as':_0x391403['as'],'attributes':_0x391403[_0xf79c('0x1f')],'include':_0x391403[_0xf79c('0x21')]?_[_0xf79c('0x24')](_0x391403['include'],function(_0x514987){return{'model':db[_0x514987['model']],'as':_0x514987['as'],'attributes':_0x514987['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12c1d9){logger[_0xf79c('0x10')](_0xf79c('0x23'),_0x290de5);logger[_0xf79c('0x12')]('ShowSugarcrmAccount',_0x290de5,JSON[_0xf79c('0x14')](_0x12c1d9));_0x30ef12(_0x12c1d9);})[_0xf79c('0x19')](function(_0x9ef31a){logger[_0xf79c('0x15')](_0xf79c('0x23'),_0x9ef31a[_0xf79c('0x17')],_0x290de5);_0x77b532(_0x1c4d0e['error'](0x1f4,_0x9ef31a[_0xf79c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 7bf6e89..c124e9a 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 _0x9abd=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','getFields','/:id/subjects','getSubjects','getDescriptions','put','/:id'];(function(_0x3dfea5,_0xc4bc46){var _0x16d2ad=function(_0xa9f375){while(--_0xa9f375){_0x3dfea5['push'](_0x3dfea5['shift']());}};_0x16d2ad(++_0xc4bc46);}(_0x9abd,0x12a));var _0xd9ab=function(_0x206553,_0x4dbbba){_0x206553=_0x206553-0x0;var _0x34d6f7=_0x9abd[_0x206553];return _0x34d6f7;};'use strict';var multer=require(_0xd9ab('0x0'));var util=require(_0xd9ab('0x1'));var path=require(_0xd9ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ab('0x3'));var router=express[_0xd9ab('0x4')]();var fs_extra=require(_0xd9ab('0x5'));var auth=require(_0xd9ab('0x6'));var interaction=require(_0xd9ab('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0xd9ab('0x8')]('/',auth[_0xd9ab('0x9')](),controller[_0xd9ab('0xa')]);router[_0xd9ab('0x8')]('/:id',auth[_0xd9ab('0x9')](),controller['show']);router[_0xd9ab('0x8')]('/:id/fields',auth[_0xd9ab('0x9')](),controller[_0xd9ab('0xb')]);router[_0xd9ab('0x8')](_0xd9ab('0xc'),auth['isAuthenticated'](),controller[_0xd9ab('0xd')]);router[_0xd9ab('0x8')]('/:id/descriptions',auth[_0xd9ab('0x9')](),controller[_0xd9ab('0xe')]);router['post']('/',auth[_0xd9ab('0x9')](),controller['create']);router[_0xd9ab('0xf')](_0xd9ab('0x10'),auth[_0xd9ab('0x9')](),controller[_0xd9ab('0x11')]);router[_0xd9ab('0x12')](_0xd9ab('0x10'),auth[_0xd9ab('0x9')](),controller[_0xd9ab('0x13')]);module[_0xd9ab('0x14')]=router; \ No newline at end of file +var _0xa2d1=['../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','/:id/fields','getFields','getSubjects','getDescriptions','create','put','update','/:id','destroy','exports','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa2d1,0x19f));var _0x1a2d=function(_0x20f96d,_0x23e67f){_0x20f96d=_0x20f96d-0x0;var _0x9a7524=_0xa2d1[_0x20f96d];return _0x9a7524;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1a2d('0x0'));var router=express[_0x1a2d('0x1')]();var fs_extra=require(_0x1a2d('0x2'));var auth=require(_0x1a2d('0x3'));var interaction=require(_0x1a2d('0x4'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x1a2d('0x5')]('/',auth['isAuthenticated'](),controller[_0x1a2d('0x6')]);router[_0x1a2d('0x5')]('/:id',auth[_0x1a2d('0x7')](),controller[_0x1a2d('0x8')]);router['get'](_0x1a2d('0x9'),auth[_0x1a2d('0x7')](),controller[_0x1a2d('0xa')]);router[_0x1a2d('0x5')]('/:id/subjects',auth[_0x1a2d('0x7')](),controller[_0x1a2d('0xb')]);router[_0x1a2d('0x5')]('/:id/descriptions',auth[_0x1a2d('0x7')](),controller[_0x1a2d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a2d('0xd')]);router[_0x1a2d('0xe')]('/:id',auth[_0x1a2d('0x7')](),controller[_0x1a2d('0xf')]);router['delete'](_0x1a2d('0x10'),auth['isAuthenticated'](),controller[_0x1a2d('0x11')]);module[_0x1a2d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 5b4c5dd..b9beea8 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 _0xb82f=['exports','STRING','sequelize'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0xb82f,0xfe));var _0xfb82=function(_0x1e80c2,_0x4faa99){_0x1e80c2=_0x1e80c2-0x0;var _0x10c2c9=_0xb82f[_0x1e80c2];return _0x10c2c9;};'use strict';var Sequelize=require(_0xfb82('0x0'));module[_0xfb82('0x1')]={'name':{'type':Sequelize[_0xfb82('0x2')]},'description':{'type':Sequelize[_0xfb82('0x2')]}}; \ No newline at end of file +var _0x417b=['STRING','sequelize','exports'];(function(_0x20bf74,_0x77d8b4){var _0x582833=function(_0x4a3a56){while(--_0x4a3a56){_0x20bf74['push'](_0x20bf74['shift']());}};_0x582833(++_0x77d8b4);}(_0x417b,0xdf));var _0xb417=function(_0x1cdc6a,_0x574795){_0x1cdc6a=_0x1cdc6a-0x0;var _0xabf9ac=_0x417b[_0x1cdc6a];return _0xabf9ac;};'use strict';var Sequelize=require(_0xb417('0x0'));module[_0xb417('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb417('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 254dc47..6feebe0 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 _0xb4db=['util','path','to-csv','fs-extra','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','findOne','SugarcrmField','filter','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1e7526,_0x4bcb67){var _0x95a89b=function(_0x4e0c67){while(--_0x4e0c67){_0x1e7526['push'](_0x1e7526['shift']());}};_0x95a89b(++_0x4bcb67);}(_0xb4db,0x8f));var _0xbb4d=function(_0x42604e,_0x269ac1){_0x42604e=_0x42604e-0x0;var _0x5481b9=_0xb4db[_0x42604e];return _0x5481b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb4d('0x0'));var zipdir=require(_0xbb4d('0x1'));var jsonpatch=require(_0xbb4d('0x2'));var rp=require(_0xbb4d('0x3'));var moment=require(_0xbb4d('0x4'));var BPromise=require(_0xbb4d('0x5'));var Mustache=require(_0xbb4d('0x6'));var util=require(_0xbb4d('0x7'));var path=require(_0xbb4d('0x8'));var sox=require('sox');var csv=require(_0xbb4d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb4d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb4d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbb4d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbb4d('0xc'));var authService=require(_0xbb4d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xbb4d('0xe'));var hardwareService=require(_0xbb4d('0xf'));var logger=require(_0xbb4d('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xbb4d('0x11'));var licenseUtil=require(_0xbb4d('0x12'));var db=require(_0xbb4d('0x13'))['db'];function respondWithStatusCode(_0xee7f6a,_0xdab5a1){_0xdab5a1=_0xdab5a1||0xcc;return function(_0x3ca739){if(_0x3ca739){return _0xee7f6a[_0xbb4d('0x14')](_0xdab5a1);}return _0xee7f6a[_0xbb4d('0x15')](_0xdab5a1)[_0xbb4d('0x16')]();};}function respondWithResult(_0x5af5ed,_0x5bd8ac){_0x5bd8ac=_0x5bd8ac||0xc8;return function(_0xc70d86){if(_0xc70d86){return _0x5af5ed[_0xbb4d('0x15')](_0x5bd8ac)['json'](_0xc70d86);}};}function respondWithFilteredResult(_0x50a594,_0x29a98f){return function(_0xdb6853){if(_0xdb6853){var _0x59bec9=typeof _0x29a98f[_0xbb4d('0x17')]==='undefined'&&typeof _0x29a98f[_0xbb4d('0x18')]===_0xbb4d('0x19');var _0x6f65d3=_0xdb6853['count'];var _0x48f786=_0x59bec9?0x0:_0x29a98f['offset'];var _0x5ca797=_0x59bec9?_0xdb6853[_0xbb4d('0x1a')]:_0x29a98f[_0xbb4d('0x17')]+_0x29a98f[_0xbb4d('0x18')];var _0x39e510;if(_0x5ca797>=_0x6f65d3){_0x5ca797=_0x6f65d3;_0x39e510=0xc8;}else{_0x39e510=0xce;}_0x50a594[_0xbb4d('0x15')](_0x39e510);return _0x50a594[_0xbb4d('0x1b')](_0xbb4d('0x1c'),_0x48f786+'-'+_0x5ca797+'/'+_0x6f65d3)[_0xbb4d('0x1d')](_0xdb6853);}return null;};}function patchUpdates(_0x5e31a3){return function(_0x32d42a){try{jsonpatch[_0xbb4d('0x1e')](_0x32d42a,_0x5e31a3,!![]);}catch(_0x3e43cb){return BPromise[_0xbb4d('0x1f')](_0x3e43cb);}return _0x32d42a[_0xbb4d('0x20')]();};}function saveUpdates(_0x2c8686,_0x30936){return function(_0x259257){if(_0x259257){return _0x259257[_0xbb4d('0x21')](_0x2c8686)[_0xbb4d('0x22')](function(_0x537a05){return _0x537a05;});}return null;};}function removeEntity(_0x2431e7,_0x214a61){return function(_0x3388c8){if(_0x3388c8){return _0x3388c8['destroy']()['then'](function(){_0x2431e7['status'](0xcc)[_0xbb4d('0x16')]();});}};}function handleEntityNotFound(_0x5ce061,_0x31c14d){return function(_0x2126b8){if(!_0x2126b8){_0x5ce061[_0xbb4d('0x14')](0x194);}return _0x2126b8;};}function handleError(_0x3761e6,_0x3f8b29){_0x3f8b29=_0x3f8b29||0x1f4;return function(_0x5adba4){logger[_0xbb4d('0x23')](_0x5adba4['stack']);if(_0x5adba4[_0xbb4d('0x24')]){delete _0x5adba4[_0xbb4d('0x24')];}_0x3761e6[_0xbb4d('0x15')](_0x3f8b29)['send'](_0x5adba4);};}exports[_0xbb4d('0x25')]=function(_0x4d1174,_0x33fba2){var _0x4c3efc={},_0x87d058={},_0x3121c1={'count':0x0,'rows':[]};var _0x348de8=_[_0xbb4d('0x26')](db[_0xbb4d('0x27')][_0xbb4d('0x28')],function(_0x399435){return{'name':_0x399435[_0xbb4d('0x29')],'type':_0x399435[_0xbb4d('0x2a')]['key']};});_0x87d058[_0xbb4d('0x2b')]=_[_0xbb4d('0x26')](_0x348de8,'name');_0x87d058[_0xbb4d('0x2c')]=_[_0xbb4d('0x2d')](_0x4d1174[_0xbb4d('0x2c')]);_0x87d058[_0xbb4d('0x2e')]=_[_0xbb4d('0x2f')](_0x87d058[_0xbb4d('0x2b')],_0x87d058['query']);_0x4c3efc[_0xbb4d('0x30')]=_[_0xbb4d('0x2f')](_0x87d058[_0xbb4d('0x2b')],qs[_0xbb4d('0x31')](_0x4d1174[_0xbb4d('0x2c')][_0xbb4d('0x31')]));_0x4c3efc[_0xbb4d('0x30')]=_0x4c3efc[_0xbb4d('0x30')][_0xbb4d('0x32')]?_0x4c3efc[_0xbb4d('0x30')]:_0x87d058[_0xbb4d('0x2b')];if(!_0x4d1174[_0xbb4d('0x2c')]['hasOwnProperty'](_0xbb4d('0x33'))){_0x4c3efc[_0xbb4d('0x18')]=qs[_0xbb4d('0x18')](_0x4d1174['query'][_0xbb4d('0x18')]);_0x4c3efc['offset']=qs['offset'](_0x4d1174[_0xbb4d('0x2c')][_0xbb4d('0x17')]);}_0x4c3efc[_0xbb4d('0x34')]=qs[_0xbb4d('0x35')](_0x4d1174[_0xbb4d('0x2c')][_0xbb4d('0x35')]);_0x4c3efc[_0xbb4d('0x36')]=qs[_0xbb4d('0x2e')](_[_0xbb4d('0x37')](_0x4d1174[_0xbb4d('0x2c')],_0x87d058[_0xbb4d('0x2e')]),_0x348de8);if(_0x4d1174[_0xbb4d('0x2c')]['filter']){_0x4c3efc['where']=_['merge'](_0x4c3efc[_0xbb4d('0x36')],{'$or':_[_0xbb4d('0x26')](_0x348de8,function(_0x2c5f0d){if(_0x2c5f0d[_0xbb4d('0x2a')]!=='VIRTUAL'){var _0x35118c={};_0x35118c[_0x2c5f0d[_0xbb4d('0x24')]]={'$like':'%'+_0x4d1174['query']['filter']+'%'};return _0x35118c;}})});}_0x4c3efc=_[_0xbb4d('0x38')]({},_0x4c3efc,_0x4d1174[_0xbb4d('0x39')]);var _0x331715={'where':_0x4c3efc[_0xbb4d('0x36')]};return db[_0xbb4d('0x27')][_0xbb4d('0x1a')](_0x331715)[_0xbb4d('0x22')](function(_0x2cacc4){_0x3121c1[_0xbb4d('0x1a')]=_0x2cacc4;if(_0x4d1174[_0xbb4d('0x2c')][_0xbb4d('0x3a')]){_0x4c3efc[_0xbb4d('0x3b')]=[{'all':!![]}];}return db[_0xbb4d('0x27')]['findAll'](_0x4c3efc);})[_0xbb4d('0x22')](function(_0x454e47){_0x3121c1[_0xbb4d('0x3c')]=_0x454e47;return _0x3121c1;})[_0xbb4d('0x22')](respondWithFilteredResult(_0x33fba2,_0x4c3efc))[_0xbb4d('0x3d')](handleError(_0x33fba2,null));};exports[_0xbb4d('0x3e')]=function(_0x55c456,_0x30cb85){var _0x18fef8={'raw':![],'where':{'id':_0x55c456['params']['id']}},_0x92516f={};_0x92516f['model']=_['keys'](db[_0xbb4d('0x27')][_0xbb4d('0x28')]);_0x92516f[_0xbb4d('0x2c')]=_[_0xbb4d('0x2d')](_0x55c456[_0xbb4d('0x2c')]);_0x92516f[_0xbb4d('0x2e')]=_['intersection'](_0x92516f[_0xbb4d('0x2b')],_0x92516f[_0xbb4d('0x2c')]);_0x18fef8[_0xbb4d('0x30')]=_[_0xbb4d('0x2f')](_0x92516f['model'],qs[_0xbb4d('0x31')](_0x55c456['query'][_0xbb4d('0x31')]));_0x18fef8[_0xbb4d('0x30')]=_0x18fef8[_0xbb4d('0x30')]['length']?_0x18fef8[_0xbb4d('0x30')]:_0x92516f[_0xbb4d('0x2b')];if(_0x55c456['query']['includeAll']){_0x18fef8[_0xbb4d('0x3b')]=[{'all':!![]}];}_0x18fef8=_[_0xbb4d('0x38')]({},_0x18fef8,_0x55c456[_0xbb4d('0x39')]);return db['SugarcrmConfiguration'][_0xbb4d('0x3f')](_0x18fef8)[_0xbb4d('0x22')](handleEntityNotFound(_0x30cb85,null))[_0xbb4d('0x22')](respondWithResult(_0x30cb85,null))[_0xbb4d('0x3d')](handleError(_0x30cb85,null));};exports['create']=function(_0x147aa6,_0x1fbaef){return db[_0xbb4d('0x27')][_0xbb4d('0x40')](_0x147aa6[_0xbb4d('0x41')],{})[_0xbb4d('0x22')](respondWithResult(_0x1fbaef,0xc9))[_0xbb4d('0x3d')](handleError(_0x1fbaef,null));};exports[_0xbb4d('0x21')]=function(_0x3fbb1d,_0x566fd0){if(_0x3fbb1d[_0xbb4d('0x41')]['id']){delete _0x3fbb1d[_0xbb4d('0x41')]['id'];}return db[_0xbb4d('0x27')][_0xbb4d('0x3f')]({'where':{'id':_0x3fbb1d[_0xbb4d('0x42')]['id']}})[_0xbb4d('0x22')](handleEntityNotFound(_0x566fd0,null))[_0xbb4d('0x22')](saveUpdates(_0x3fbb1d['body'],null))[_0xbb4d('0x22')](respondWithResult(_0x566fd0,null))[_0xbb4d('0x3d')](handleError(_0x566fd0,null));};exports[_0xbb4d('0x43')]=function(_0x476105,_0x358a07){return db[_0xbb4d('0x27')][_0xbb4d('0x3f')]({'where':{'id':_0x476105[_0xbb4d('0x42')]['id']}})[_0xbb4d('0x22')](handleEntityNotFound(_0x358a07,null))[_0xbb4d('0x22')](removeEntity(_0x358a07,null))['catch'](handleError(_0x358a07,null));};exports['getFields']=function(_0x14fb18,_0x4d1546,_0x38d82a){var _0x166961={};var _0x33bcae={};var _0x1ebdfe;var _0x34e909;return db[_0xbb4d('0x27')][_0xbb4d('0x44')]({'where':{'id':_0x14fb18['params']['id']}})[_0xbb4d('0x22')](handleEntityNotFound(_0x4d1546,null))[_0xbb4d('0x22')](function(_0x361a9d){if(_0x361a9d){_0x1ebdfe=_0x361a9d;_0x33bcae[_0xbb4d('0x2b')]=_[_0xbb4d('0x2d')](db[_0xbb4d('0x45')][_0xbb4d('0x28')]);_0x33bcae[_0xbb4d('0x2c')]=_[_0xbb4d('0x2d')](_0x14fb18[_0xbb4d('0x2c')]);_0x33bcae[_0xbb4d('0x2e')]=_[_0xbb4d('0x2f')](_0x33bcae[_0xbb4d('0x2b')],_0x33bcae['query']);_0x166961[_0xbb4d('0x30')]=_[_0xbb4d('0x2f')](_0x33bcae['model'],qs[_0xbb4d('0x31')](_0x14fb18[_0xbb4d('0x2c')][_0xbb4d('0x31')]));_0x166961['attributes']=_0x166961['attributes'][_0xbb4d('0x32')]?_0x166961[_0xbb4d('0x30')]:_0x33bcae[_0xbb4d('0x2b')];_0x166961[_0xbb4d('0x34')]=qs['sort'](_0x14fb18[_0xbb4d('0x2c')]['sort']);_0x166961[_0xbb4d('0x36')]=qs['filters'](_['pick'](_0x14fb18[_0xbb4d('0x2c')],_0x33bcae[_0xbb4d('0x2e')]));if(_0x14fb18[_0xbb4d('0x2c')][_0xbb4d('0x46')]){_0x166961[_0xbb4d('0x36')]=_[_0xbb4d('0x38')](_0x166961['where'],{'$or':_[_0xbb4d('0x26')](_0x166961[_0xbb4d('0x30')],function(_0x46b4da){var _0x479317={};_0x479317[_0x46b4da]={'$like':'%'+_0x14fb18[_0xbb4d('0x2c')]['filter']+'%'};return _0x479317;})});}_0x166961=_[_0xbb4d('0x38')]({},_0x166961,_0x14fb18['options']);return _0x1ebdfe[_0xbb4d('0x47')](_0x166961);}})['then'](function(_0x2b3db3){if(_0x2b3db3){_0x34e909=_0x2b3db3['length'];if(!_0x14fb18[_0xbb4d('0x2c')][_0xbb4d('0x48')]('nolimit')){_0x166961['limit']=qs[_0xbb4d('0x18')](_0x14fb18['query'][_0xbb4d('0x18')]);_0x166961[_0xbb4d('0x17')]=qs[_0xbb4d('0x17')](_0x14fb18[_0xbb4d('0x2c')][_0xbb4d('0x17')]);}return _0x1ebdfe[_0xbb4d('0x47')](_0x166961);}})['then'](function(_0x34ebff){if(_0x34ebff){return _0x34ebff?{'count':_0x34e909,'rows':_0x34ebff}:null;}})[_0xbb4d('0x22')](respondWithResult(_0x4d1546,null))[_0xbb4d('0x3d')](handleError(_0x4d1546,null));};exports['getSubjects']=function(_0x3d0761,_0x1dc8fa,_0xaa1290){var _0x3c86b7={};var _0x51f471={};var _0x406ace;var _0x11e5d1;return db[_0xbb4d('0x27')]['findOne']({'where':{'id':_0x3d0761[_0xbb4d('0x42')]['id']}})[_0xbb4d('0x22')](handleEntityNotFound(_0x1dc8fa,null))[_0xbb4d('0x22')](function(_0xdac69b){if(_0xdac69b){_0x406ace=_0xdac69b;_0x51f471[_0xbb4d('0x2b')]=_[_0xbb4d('0x2d')](db[_0xbb4d('0x45')]['rawAttributes']);_0x51f471[_0xbb4d('0x2c')]=_[_0xbb4d('0x2d')](_0x3d0761[_0xbb4d('0x2c')]);_0x51f471[_0xbb4d('0x2e')]=_[_0xbb4d('0x2f')](_0x51f471['model'],_0x51f471[_0xbb4d('0x2c')]);_0x3c86b7[_0xbb4d('0x30')]=_['intersection'](_0x51f471['model'],qs[_0xbb4d('0x31')](_0x3d0761[_0xbb4d('0x2c')][_0xbb4d('0x31')]));_0x3c86b7[_0xbb4d('0x30')]=_0x3c86b7['attributes']['length']?_0x3c86b7[_0xbb4d('0x30')]:_0x51f471['model'];_0x3c86b7[_0xbb4d('0x34')]=qs[_0xbb4d('0x35')](_0x3d0761['query'][_0xbb4d('0x35')]);_0x3c86b7[_0xbb4d('0x36')]=qs[_0xbb4d('0x2e')](_[_0xbb4d('0x37')](_0x3d0761[_0xbb4d('0x2c')],_0x51f471[_0xbb4d('0x2e')]));if(_0x3d0761[_0xbb4d('0x2c')]['filter']){_0x3c86b7[_0xbb4d('0x36')]=_[_0xbb4d('0x38')](_0x3c86b7[_0xbb4d('0x36')],{'$or':_['map'](_0x3c86b7[_0xbb4d('0x30')],function(_0x147a95){var _0x475126={};_0x475126[_0x147a95]={'$like':'%'+_0x3d0761[_0xbb4d('0x2c')]['filter']+'%'};return _0x475126;})});}_0x3c86b7=_[_0xbb4d('0x38')]({},_0x3c86b7,_0x3d0761['options']);return _0x406ace[_0xbb4d('0x49')](_0x3c86b7);}})[_0xbb4d('0x22')](function(_0x97f33){if(_0x97f33){_0x11e5d1=_0x97f33[_0xbb4d('0x32')];if(!_0x3d0761[_0xbb4d('0x2c')][_0xbb4d('0x48')](_0xbb4d('0x33'))){_0x3c86b7[_0xbb4d('0x18')]=qs[_0xbb4d('0x18')](_0x3d0761[_0xbb4d('0x2c')]['limit']);_0x3c86b7[_0xbb4d('0x17')]=qs[_0xbb4d('0x17')](_0x3d0761['query']['offset']);}return _0x406ace['getSubjects'](_0x3c86b7);}})['then'](function(_0x3069ad){if(_0x3069ad){return _0x3069ad?{'count':_0x11e5d1,'rows':_0x3069ad}:null;}})[_0xbb4d('0x22')](respondWithResult(_0x1dc8fa,null))[_0xbb4d('0x3d')](handleError(_0x1dc8fa,null));};exports[_0xbb4d('0x4a')]=function(_0x59bae3,_0x475b42,_0x307636){var _0x4f8a2a={};var _0x2ddd3b={};var _0x130244;var _0x3af64;return db[_0xbb4d('0x27')]['findOne']({'where':{'id':_0x59bae3[_0xbb4d('0x42')]['id']}})[_0xbb4d('0x22')](handleEntityNotFound(_0x475b42,null))[_0xbb4d('0x22')](function(_0x972553){if(_0x972553){_0x130244=_0x972553;_0x2ddd3b[_0xbb4d('0x2b')]=_[_0xbb4d('0x2d')](db['SugarcrmField'][_0xbb4d('0x28')]);_0x2ddd3b[_0xbb4d('0x2c')]=_['keys'](_0x59bae3['query']);_0x2ddd3b[_0xbb4d('0x2e')]=_[_0xbb4d('0x2f')](_0x2ddd3b[_0xbb4d('0x2b')],_0x2ddd3b['query']);_0x4f8a2a[_0xbb4d('0x30')]=_[_0xbb4d('0x2f')](_0x2ddd3b[_0xbb4d('0x2b')],qs[_0xbb4d('0x31')](_0x59bae3['query'][_0xbb4d('0x31')]));_0x4f8a2a[_0xbb4d('0x30')]=_0x4f8a2a[_0xbb4d('0x30')]['length']?_0x4f8a2a[_0xbb4d('0x30')]:_0x2ddd3b[_0xbb4d('0x2b')];_0x4f8a2a[_0xbb4d('0x34')]=qs[_0xbb4d('0x35')](_0x59bae3[_0xbb4d('0x2c')][_0xbb4d('0x35')]);_0x4f8a2a['where']=qs[_0xbb4d('0x2e')](_[_0xbb4d('0x37')](_0x59bae3['query'],_0x2ddd3b[_0xbb4d('0x2e')]));if(_0x59bae3[_0xbb4d('0x2c')][_0xbb4d('0x46')]){_0x4f8a2a['where']=_[_0xbb4d('0x38')](_0x4f8a2a[_0xbb4d('0x36')],{'$or':_['map'](_0x4f8a2a[_0xbb4d('0x30')],function(_0x29fb6f){var _0x1e8e1b={};_0x1e8e1b[_0x29fb6f]={'$like':'%'+_0x59bae3[_0xbb4d('0x2c')][_0xbb4d('0x46')]+'%'};return _0x1e8e1b;})});}_0x4f8a2a=_[_0xbb4d('0x38')]({},_0x4f8a2a,_0x59bae3[_0xbb4d('0x39')]);return _0x130244[_0xbb4d('0x4a')](_0x4f8a2a);}})[_0xbb4d('0x22')](function(_0x4cce41){if(_0x4cce41){_0x3af64=_0x4cce41[_0xbb4d('0x32')];if(!_0x59bae3['query'][_0xbb4d('0x48')](_0xbb4d('0x33'))){_0x4f8a2a['limit']=qs['limit'](_0x59bae3[_0xbb4d('0x2c')][_0xbb4d('0x18')]);_0x4f8a2a[_0xbb4d('0x17')]=qs[_0xbb4d('0x17')](_0x59bae3[_0xbb4d('0x2c')][_0xbb4d('0x17')]);}return _0x130244[_0xbb4d('0x4a')](_0x4f8a2a);}})[_0xbb4d('0x22')](function(_0x5e2c78){if(_0x5e2c78){return _0x5e2c78?{'count':_0x3af64,'rows':_0x5e2c78}:null;}})[_0xbb4d('0x22')](respondWithResult(_0x475b42,null))[_0xbb4d('0x3d')](handleError(_0x475b42,null));}; \ No newline at end of file +var _0x5a3e=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','getFields','findOne','SugarcrmField','length','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x5da5b6,_0x1234f3){var _0x1bde08=function(_0x4abbcf){while(--_0x4abbcf){_0x5da5b6['push'](_0x5da5b6['shift']());}};_0x1bde08(++_0x1234f3);}(_0x5a3e,0x156));var _0xe5a3=function(_0x2c99d4,_0x443b4f){_0x2c99d4=_0x2c99d4-0x0;var _0x122776=_0x5a3e[_0x2c99d4];return _0x122776;};'use strict';var emlformat=require(_0xe5a3('0x0'));var rimraf=require(_0xe5a3('0x1'));var zipdir=require(_0xe5a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5a3('0x3'));var moment=require('moment');var BPromise=require(_0xe5a3('0x4'));var Mustache=require(_0xe5a3('0x5'));var util=require(_0xe5a3('0x6'));var path=require(_0xe5a3('0x7'));var sox=require(_0xe5a3('0x8'));var csv=require(_0xe5a3('0x9'));var ejs=require(_0xe5a3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5a3('0xb'));var squel=require(_0xe5a3('0xc'));var crypto=require('crypto');var jsforce=require(_0xe5a3('0xd'));var deskjs=require(_0xe5a3('0xe'));var toCsv=require(_0xe5a3('0x9'));var querystring=require(_0xe5a3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe5a3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe5a3('0x11'));var hardwareService=require(_0xe5a3('0x12'));var logger=require(_0xe5a3('0x13'))(_0xe5a3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe5a3('0x15'));var db=require(_0xe5a3('0x16'))['db'];function respondWithStatusCode(_0x4f7b24,_0x71b2d1){_0x71b2d1=_0x71b2d1||0xcc;return function(_0x1e37dd){if(_0x1e37dd){return _0x4f7b24['sendStatus'](_0x71b2d1);}return _0x4f7b24[_0xe5a3('0x17')](_0x71b2d1)[_0xe5a3('0x18')]();};}function respondWithResult(_0x19c2cc,_0x3e7485){_0x3e7485=_0x3e7485||0xc8;return function(_0x16e149){if(_0x16e149){return _0x19c2cc[_0xe5a3('0x17')](_0x3e7485)[_0xe5a3('0x19')](_0x16e149);}};}function respondWithFilteredResult(_0x2f4aa7,_0x430e68){return function(_0x427065){if(_0x427065){var _0x4449d5=typeof _0x430e68['offset']===_0xe5a3('0x1a')&&typeof _0x430e68[_0xe5a3('0x1b')]===_0xe5a3('0x1a');var _0x10a5f8=_0x427065['count'];var _0x49af65=_0x4449d5?0x0:_0x430e68[_0xe5a3('0x1c')];var _0xd66196=_0x4449d5?_0x427065['count']:_0x430e68[_0xe5a3('0x1c')]+_0x430e68['limit'];var _0x54e181;if(_0xd66196>=_0x10a5f8){_0xd66196=_0x10a5f8;_0x54e181=0xc8;}else{_0x54e181=0xce;}_0x2f4aa7[_0xe5a3('0x17')](_0x54e181);return _0x2f4aa7[_0xe5a3('0x1d')](_0xe5a3('0x1e'),_0x49af65+'-'+_0xd66196+'/'+_0x10a5f8)[_0xe5a3('0x19')](_0x427065);}return null;};}function patchUpdates(_0x170497){return function(_0x4b7787){try{jsonpatch[_0xe5a3('0x1f')](_0x4b7787,_0x170497,!![]);}catch(_0x479fad){return BPromise[_0xe5a3('0x20')](_0x479fad);}return _0x4b7787[_0xe5a3('0x21')]();};}function saveUpdates(_0x2e31b4,_0x168784){return function(_0x174505){if(_0x174505){return _0x174505[_0xe5a3('0x22')](_0x2e31b4)[_0xe5a3('0x23')](function(_0xa61593){return _0xa61593;});}return null;};}function removeEntity(_0x3be21a,_0x5a4f03){return function(_0x1fc9e4){if(_0x1fc9e4){return _0x1fc9e4[_0xe5a3('0x24')]()[_0xe5a3('0x23')](function(){_0x3be21a[_0xe5a3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x122967,_0x3986ea){return function(_0x1a66e2){if(!_0x1a66e2){_0x122967[_0xe5a3('0x25')](0x194);}return _0x1a66e2;};}function handleError(_0x41db8d,_0x339fba){_0x339fba=_0x339fba||0x1f4;return function(_0x5ede2c){logger['error'](_0x5ede2c['stack']);if(_0x5ede2c[_0xe5a3('0x26')]){delete _0x5ede2c[_0xe5a3('0x26')];}_0x41db8d[_0xe5a3('0x17')](_0x339fba)[_0xe5a3('0x27')](_0x5ede2c);};}exports[_0xe5a3('0x28')]=function(_0xd9dfbb,_0x39614c){var _0x50834d={},_0x550682={},_0x3ce754={'count':0x0,'rows':[]};var _0x79a4e3=_[_0xe5a3('0x29')](db[_0xe5a3('0x2a')]['rawAttributes'],function(_0x188028){return{'name':_0x188028[_0xe5a3('0x2b')],'type':_0x188028[_0xe5a3('0x2c')][_0xe5a3('0x2d')]};});_0x550682[_0xe5a3('0x2e')]=_[_0xe5a3('0x29')](_0x79a4e3,_0xe5a3('0x26'));_0x550682[_0xe5a3('0x2f')]=_[_0xe5a3('0x30')](_0xd9dfbb[_0xe5a3('0x2f')]);_0x550682[_0xe5a3('0x31')]=_[_0xe5a3('0x32')](_0x550682['model'],_0x550682[_0xe5a3('0x2f')]);_0x50834d[_0xe5a3('0x33')]=_[_0xe5a3('0x32')](_0x550682[_0xe5a3('0x2e')],qs[_0xe5a3('0x34')](_0xd9dfbb['query']['fields']));_0x50834d[_0xe5a3('0x33')]=_0x50834d[_0xe5a3('0x33')]['length']?_0x50834d[_0xe5a3('0x33')]:_0x550682['model'];if(!_0xd9dfbb[_0xe5a3('0x2f')][_0xe5a3('0x35')](_0xe5a3('0x36'))){_0x50834d[_0xe5a3('0x1b')]=qs[_0xe5a3('0x1b')](_0xd9dfbb[_0xe5a3('0x2f')][_0xe5a3('0x1b')]);_0x50834d['offset']=qs[_0xe5a3('0x1c')](_0xd9dfbb[_0xe5a3('0x2f')][_0xe5a3('0x1c')]);}_0x50834d['order']=qs[_0xe5a3('0x37')](_0xd9dfbb[_0xe5a3('0x2f')][_0xe5a3('0x37')]);_0x50834d[_0xe5a3('0x38')]=qs['filters'](_[_0xe5a3('0x39')](_0xd9dfbb[_0xe5a3('0x2f')],_0x550682[_0xe5a3('0x31')]),_0x79a4e3);if(_0xd9dfbb[_0xe5a3('0x2f')][_0xe5a3('0x3a')]){_0x50834d[_0xe5a3('0x38')]=_[_0xe5a3('0x3b')](_0x50834d['where'],{'$or':_[_0xe5a3('0x29')](_0x79a4e3,function(_0x3c164a){if(_0x3c164a[_0xe5a3('0x2c')]!==_0xe5a3('0x3c')){var _0x46b018={};_0x46b018[_0x3c164a[_0xe5a3('0x26')]]={'$like':'%'+_0xd9dfbb[_0xe5a3('0x2f')][_0xe5a3('0x3a')]+'%'};return _0x46b018;}})});}_0x50834d=_[_0xe5a3('0x3b')]({},_0x50834d,_0xd9dfbb[_0xe5a3('0x3d')]);var _0x420d20={'where':_0x50834d[_0xe5a3('0x38')]};return db[_0xe5a3('0x2a')][_0xe5a3('0x3e')](_0x420d20)[_0xe5a3('0x23')](function(_0x28ffde){_0x3ce754[_0xe5a3('0x3e')]=_0x28ffde;if(_0xd9dfbb[_0xe5a3('0x2f')][_0xe5a3('0x3f')]){_0x50834d[_0xe5a3('0x40')]=[{'all':!![]}];}return db[_0xe5a3('0x2a')][_0xe5a3('0x41')](_0x50834d);})[_0xe5a3('0x23')](function(_0x59218b){_0x3ce754[_0xe5a3('0x42')]=_0x59218b;return _0x3ce754;})['then'](respondWithFilteredResult(_0x39614c,_0x50834d))[_0xe5a3('0x43')](handleError(_0x39614c,null));};exports['show']=function(_0x43623d,_0x3987b9){var _0x2bd94e={'raw':![],'where':{'id':_0x43623d[_0xe5a3('0x44')]['id']}},_0xecdfc5={};_0xecdfc5[_0xe5a3('0x2e')]=_[_0xe5a3('0x30')](db['SugarcrmConfiguration'][_0xe5a3('0x45')]);_0xecdfc5['query']=_['keys'](_0x43623d[_0xe5a3('0x2f')]);_0xecdfc5[_0xe5a3('0x31')]=_['intersection'](_0xecdfc5['model'],_0xecdfc5[_0xe5a3('0x2f')]);_0x2bd94e['attributes']=_[_0xe5a3('0x32')](_0xecdfc5[_0xe5a3('0x2e')],qs[_0xe5a3('0x34')](_0x43623d[_0xe5a3('0x2f')][_0xe5a3('0x34')]));_0x2bd94e[_0xe5a3('0x33')]=_0x2bd94e[_0xe5a3('0x33')]['length']?_0x2bd94e['attributes']:_0xecdfc5[_0xe5a3('0x2e')];if(_0x43623d[_0xe5a3('0x2f')][_0xe5a3('0x3f')]){_0x2bd94e[_0xe5a3('0x40')]=[{'all':!![]}];}_0x2bd94e=_['merge']({},_0x2bd94e,_0x43623d[_0xe5a3('0x3d')]);return db[_0xe5a3('0x2a')][_0xe5a3('0x46')](_0x2bd94e)[_0xe5a3('0x23')](handleEntityNotFound(_0x3987b9,null))[_0xe5a3('0x23')](respondWithResult(_0x3987b9,null))[_0xe5a3('0x43')](handleError(_0x3987b9,null));};exports['create']=function(_0x1babff,_0x15df07){return db[_0xe5a3('0x2a')]['create'](_0x1babff[_0xe5a3('0x47')],{})[_0xe5a3('0x23')](respondWithResult(_0x15df07,0xc9))['catch'](handleError(_0x15df07,null));};exports[_0xe5a3('0x22')]=function(_0x487a9f,_0x17c21c){if(_0x487a9f['body']['id']){delete _0x487a9f['body']['id'];}return db['SugarcrmConfiguration'][_0xe5a3('0x46')]({'where':{'id':_0x487a9f['params']['id']}})[_0xe5a3('0x23')](handleEntityNotFound(_0x17c21c,null))['then'](saveUpdates(_0x487a9f['body'],null))['then'](respondWithResult(_0x17c21c,null))[_0xe5a3('0x43')](handleError(_0x17c21c,null));};exports[_0xe5a3('0x24')]=function(_0x1b47a6,_0x2dafee){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x1b47a6['params']['id']}})[_0xe5a3('0x23')](handleEntityNotFound(_0x2dafee,null))['then'](removeEntity(_0x2dafee,null))[_0xe5a3('0x43')](handleError(_0x2dafee,null));};exports[_0xe5a3('0x48')]=function(_0x28092b,_0x2936a0,_0x509cfe){var _0x4bb4a6={};var _0x4a421d={};var _0x356582;var _0x1ad319;return db['SugarcrmConfiguration'][_0xe5a3('0x49')]({'where':{'id':_0x28092b['params']['id']}})[_0xe5a3('0x23')](handleEntityNotFound(_0x2936a0,null))[_0xe5a3('0x23')](function(_0x1bb3c0){if(_0x1bb3c0){_0x356582=_0x1bb3c0;_0x4a421d['model']=_['keys'](db[_0xe5a3('0x4a')][_0xe5a3('0x45')]);_0x4a421d['query']=_[_0xe5a3('0x30')](_0x28092b[_0xe5a3('0x2f')]);_0x4a421d[_0xe5a3('0x31')]=_[_0xe5a3('0x32')](_0x4a421d[_0xe5a3('0x2e')],_0x4a421d[_0xe5a3('0x2f')]);_0x4bb4a6[_0xe5a3('0x33')]=_[_0xe5a3('0x32')](_0x4a421d['model'],qs[_0xe5a3('0x34')](_0x28092b[_0xe5a3('0x2f')][_0xe5a3('0x34')]));_0x4bb4a6['attributes']=_0x4bb4a6[_0xe5a3('0x33')][_0xe5a3('0x4b')]?_0x4bb4a6[_0xe5a3('0x33')]:_0x4a421d['model'];_0x4bb4a6[_0xe5a3('0x4c')]=qs[_0xe5a3('0x37')](_0x28092b[_0xe5a3('0x2f')][_0xe5a3('0x37')]);_0x4bb4a6['where']=qs['filters'](_[_0xe5a3('0x39')](_0x28092b[_0xe5a3('0x2f')],_0x4a421d[_0xe5a3('0x31')]));if(_0x28092b['query'][_0xe5a3('0x3a')]){_0x4bb4a6[_0xe5a3('0x38')]=_[_0xe5a3('0x3b')](_0x4bb4a6[_0xe5a3('0x38')],{'$or':_[_0xe5a3('0x29')](_0x4bb4a6[_0xe5a3('0x33')],function(_0x55ef2f){var _0x3ec21f={};_0x3ec21f[_0x55ef2f]={'$like':'%'+_0x28092b['query'][_0xe5a3('0x3a')]+'%'};return _0x3ec21f;})});}_0x4bb4a6=_[_0xe5a3('0x3b')]({},_0x4bb4a6,_0x28092b['options']);return _0x356582['getFields'](_0x4bb4a6);}})[_0xe5a3('0x23')](function(_0x8359c5){if(_0x8359c5){_0x1ad319=_0x8359c5[_0xe5a3('0x4b')];if(!_0x28092b['query'][_0xe5a3('0x35')](_0xe5a3('0x36'))){_0x4bb4a6['limit']=qs['limit'](_0x28092b[_0xe5a3('0x2f')][_0xe5a3('0x1b')]);_0x4bb4a6[_0xe5a3('0x1c')]=qs['offset'](_0x28092b['query'][_0xe5a3('0x1c')]);}return _0x356582[_0xe5a3('0x48')](_0x4bb4a6);}})[_0xe5a3('0x23')](function(_0x5cf161){if(_0x5cf161){return _0x5cf161?{'count':_0x1ad319,'rows':_0x5cf161}:null;}})[_0xe5a3('0x23')](respondWithResult(_0x2936a0,null))['catch'](handleError(_0x2936a0,null));};exports[_0xe5a3('0x4d')]=function(_0x3b31bb,_0x30e986,_0x4145d1){var _0x294f5a={};var _0x227963={};var _0x7d9022;var _0xd45625;return db[_0xe5a3('0x2a')][_0xe5a3('0x49')]({'where':{'id':_0x3b31bb[_0xe5a3('0x44')]['id']}})['then'](handleEntityNotFound(_0x30e986,null))['then'](function(_0x306652){if(_0x306652){_0x7d9022=_0x306652;_0x227963[_0xe5a3('0x2e')]=_[_0xe5a3('0x30')](db[_0xe5a3('0x4a')][_0xe5a3('0x45')]);_0x227963[_0xe5a3('0x2f')]=_['keys'](_0x3b31bb[_0xe5a3('0x2f')]);_0x227963[_0xe5a3('0x31')]=_[_0xe5a3('0x32')](_0x227963[_0xe5a3('0x2e')],_0x227963[_0xe5a3('0x2f')]);_0x294f5a[_0xe5a3('0x33')]=_['intersection'](_0x227963[_0xe5a3('0x2e')],qs[_0xe5a3('0x34')](_0x3b31bb['query'][_0xe5a3('0x34')]));_0x294f5a['attributes']=_0x294f5a[_0xe5a3('0x33')][_0xe5a3('0x4b')]?_0x294f5a[_0xe5a3('0x33')]:_0x227963[_0xe5a3('0x2e')];_0x294f5a['order']=qs[_0xe5a3('0x37')](_0x3b31bb[_0xe5a3('0x2f')][_0xe5a3('0x37')]);_0x294f5a[_0xe5a3('0x38')]=qs[_0xe5a3('0x31')](_['pick'](_0x3b31bb[_0xe5a3('0x2f')],_0x227963[_0xe5a3('0x31')]));if(_0x3b31bb['query'][_0xe5a3('0x3a')]){_0x294f5a['where']=_['merge'](_0x294f5a[_0xe5a3('0x38')],{'$or':_['map'](_0x294f5a[_0xe5a3('0x33')],function(_0x5f0900){var _0x8b538d={};_0x8b538d[_0x5f0900]={'$like':'%'+_0x3b31bb[_0xe5a3('0x2f')][_0xe5a3('0x3a')]+'%'};return _0x8b538d;})});}_0x294f5a=_[_0xe5a3('0x3b')]({},_0x294f5a,_0x3b31bb['options']);return _0x7d9022['getSubjects'](_0x294f5a);}})[_0xe5a3('0x23')](function(_0x5f52e4){if(_0x5f52e4){_0xd45625=_0x5f52e4[_0xe5a3('0x4b')];if(!_0x3b31bb['query'][_0xe5a3('0x35')](_0xe5a3('0x36'))){_0x294f5a['limit']=qs[_0xe5a3('0x1b')](_0x3b31bb[_0xe5a3('0x2f')][_0xe5a3('0x1b')]);_0x294f5a['offset']=qs['offset'](_0x3b31bb[_0xe5a3('0x2f')][_0xe5a3('0x1c')]);}return _0x7d9022[_0xe5a3('0x4d')](_0x294f5a);}})[_0xe5a3('0x23')](function(_0xeca42){if(_0xeca42){return _0xeca42?{'count':_0xd45625,'rows':_0xeca42}:null;}})['then'](respondWithResult(_0x30e986,null))[_0xe5a3('0x43')](handleError(_0x30e986,null));};exports[_0xe5a3('0x4e')]=function(_0xa696,_0x4acd82,_0x51851d){var _0x1ba323={};var _0x3ad3ee={};var _0x54e2e4;var _0x224f30;return db['SugarcrmConfiguration'][_0xe5a3('0x49')]({'where':{'id':_0xa696[_0xe5a3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4acd82,null))['then'](function(_0x254bc7){if(_0x254bc7){_0x54e2e4=_0x254bc7;_0x3ad3ee[_0xe5a3('0x2e')]=_[_0xe5a3('0x30')](db[_0xe5a3('0x4a')]['rawAttributes']);_0x3ad3ee[_0xe5a3('0x2f')]=_[_0xe5a3('0x30')](_0xa696[_0xe5a3('0x2f')]);_0x3ad3ee['filters']=_[_0xe5a3('0x32')](_0x3ad3ee[_0xe5a3('0x2e')],_0x3ad3ee['query']);_0x1ba323[_0xe5a3('0x33')]=_[_0xe5a3('0x32')](_0x3ad3ee['model'],qs['fields'](_0xa696[_0xe5a3('0x2f')][_0xe5a3('0x34')]));_0x1ba323[_0xe5a3('0x33')]=_0x1ba323['attributes'][_0xe5a3('0x4b')]?_0x1ba323[_0xe5a3('0x33')]:_0x3ad3ee[_0xe5a3('0x2e')];_0x1ba323[_0xe5a3('0x4c')]=qs[_0xe5a3('0x37')](_0xa696[_0xe5a3('0x2f')]['sort']);_0x1ba323['where']=qs['filters'](_[_0xe5a3('0x39')](_0xa696[_0xe5a3('0x2f')],_0x3ad3ee[_0xe5a3('0x31')]));if(_0xa696['query'][_0xe5a3('0x3a')]){_0x1ba323[_0xe5a3('0x38')]=_['merge'](_0x1ba323[_0xe5a3('0x38')],{'$or':_['map'](_0x1ba323[_0xe5a3('0x33')],function(_0xe24a7e){var _0x10265b={};_0x10265b[_0xe24a7e]={'$like':'%'+_0xa696[_0xe5a3('0x2f')][_0xe5a3('0x3a')]+'%'};return _0x10265b;})});}_0x1ba323=_[_0xe5a3('0x3b')]({},_0x1ba323,_0xa696[_0xe5a3('0x3d')]);return _0x54e2e4[_0xe5a3('0x4e')](_0x1ba323);}})[_0xe5a3('0x23')](function(_0x28b576){if(_0x28b576){_0x224f30=_0x28b576[_0xe5a3('0x4b')];if(!_0xa696[_0xe5a3('0x2f')][_0xe5a3('0x35')](_0xe5a3('0x36'))){_0x1ba323['limit']=qs[_0xe5a3('0x1b')](_0xa696['query'][_0xe5a3('0x1b')]);_0x1ba323[_0xe5a3('0x1c')]=qs[_0xe5a3('0x1c')](_0xa696['query'][_0xe5a3('0x1c')]);}return _0x54e2e4['getDescriptions'](_0x1ba323);}})[_0xe5a3('0x23')](function(_0x133470){if(_0x133470){return _0x133470?{'count':_0x224f30,'rows':_0x133470}:null;}})[_0xe5a3('0x23')](respondWithResult(_0x4acd82,null))['catch'](handleError(_0x4acd82,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 8473fc6..a54bf1d 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 _0x3fc4=['api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x5d9f86,_0x1f3fa4){var _0x50261c=function(_0x406065){while(--_0x406065){_0x5d9f86['push'](_0x5d9f86['shift']());}};_0x50261c(++_0x1f3fa4);}(_0x3fc4,0x1aa));var _0x43fc=function(_0x2b6c43,_0x380c5e){_0x2b6c43=_0x2b6c43-0x0;var _0xa36ca5=_0x3fc4[_0x2b6c43];return _0xa36ca5;};'use strict';var _=require(_0x43fc('0x0'));var util=require(_0x43fc('0x1'));var logger=require(_0x43fc('0x2'))(_0x43fc('0x3'));var moment=require(_0x43fc('0x4'));var BPromise=require(_0x43fc('0x5'));var rp=require(_0x43fc('0x6'));var fs=require('fs');var path=require(_0x43fc('0x7'));var rimraf=require(_0x43fc('0x8'));var config=require('../../config/environment');var attributes=require(_0x43fc('0x9'));module[_0x43fc('0xa')]=function(_0x1600d9,_0x191a4a){return _0x1600d9[_0x43fc('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0x43fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb88c=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x44a7af,_0x26bcf5){var _0x293b71=function(_0x592359){while(--_0x592359){_0x44a7af['push'](_0x44a7af['shift']());}};_0x293b71(++_0x26bcf5);}(_0xb88c,0x14b));var _0xcb88=function(_0x28369b,_0x2db6f0){_0x28369b=_0x28369b-0x0;var _0xe4d707=_0xb88c[_0x28369b];return _0xe4d707;};'use strict';var _=require('lodash');var util=require(_0xcb88('0x0'));var logger=require('../../config/logger')(_0xcb88('0x1'));var moment=require(_0xcb88('0x2'));var BPromise=require(_0xcb88('0x3'));var rp=require(_0xcb88('0x4'));var fs=require('fs');var path=require(_0xcb88('0x5'));var rimraf=require(_0xcb88('0x6'));var config=require(_0xcb88('0x7'));var attributes=require(_0xcb88('0x8'));module[_0xcb88('0x9')]=function(_0x398b38,_0x33ac15){return _0x398b38[_0xcb88('0xa')](_0xcb88('0xb'),attributes,{'tableName':_0xcb88('0xc'),'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 50691a5..ebe7f46 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 _0x99d9=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ec238,_0x5cfa51){var _0x7562ef=function(_0x407b2e){while(--_0x407b2e){_0x4ec238['push'](_0x4ec238['shift']());}};_0x7562ef(++_0x5cfa51);}(_0x99d9,0xd4));var _0x999d=function(_0x4580fc,_0xbdbb90){_0x4580fc=_0x4580fc-0x0;var _0x4a57a9=_0x99d9[_0x4580fc];return _0x4a57a9;};'use strict';var _=require(_0x999d('0x0'));var util=require(_0x999d('0x1'));var moment=require(_0x999d('0x2'));var BPromise=require(_0x999d('0x3'));var rs=require(_0x999d('0x4'));var fs=require('fs');var Redis=require(_0x999d('0x5'));var db=require(_0x999d('0x6'))['db'];var utils=require(_0x999d('0x7'));var logger=require(_0x999d('0x8'))(_0x999d('0x9'));var config=require(_0x999d('0xa'));var jayson=require(_0x999d('0xb'));var client=jayson[_0x999d('0xc')][_0x999d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3bd846,_0x3e09d7,_0x4f508e){return new BPromise(function(_0x64e7e1,_0x5a3632){return client[_0x999d('0xe')](_0x3bd846,_0x4f508e)[_0x999d('0xf')](function(_0x4ee887){logger[_0x999d('0x10')](_0x999d('0x11'),_0x3e09d7,_0x999d('0x12'));logger[_0x999d('0x13')](_0x999d('0x14'),_0x3e09d7,'request\x20sent',JSON[_0x999d('0x15')](_0x4ee887));if(_0x4ee887[_0x999d('0x16')]){if(_0x4ee887[_0x999d('0x16')]['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3e09d7,_0x4ee887['error']['message']);return _0x5a3632(_0x4ee887[_0x999d('0x16')]['message']);}logger[_0x999d('0x16')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3e09d7,_0x4ee887[_0x999d('0x16')][_0x999d('0x17')]);return _0x64e7e1(_0x4ee887[_0x999d('0x16')][_0x999d('0x17')]);}else{logger[_0x999d('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3e09d7,_0x999d('0x12'));_0x64e7e1(_0x4ee887[_0x999d('0x18')][_0x999d('0x17')]);}})[_0x999d('0x19')](function(_0xdcb86e){logger[_0x999d('0x16')](_0x999d('0x11'),_0x3e09d7,_0xdcb86e);_0x5a3632(_0xdcb86e);});});} \ No newline at end of file +var _0x44ec=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x500be5,_0x380187){var _0x19d644=function(_0x38b462){while(--_0x38b462){_0x500be5['push'](_0x500be5['shift']());}};_0x19d644(++_0x380187);}(_0x44ec,0x1f3));var _0xc44e=function(_0x3b6275,_0x13324a){_0x3b6275=_0x3b6275-0x0;var _0x59b306=_0x44ec[_0x3b6275];return _0x59b306;};'use strict';var _=require(_0xc44e('0x0'));var util=require(_0xc44e('0x1'));var moment=require('moment');var BPromise=require(_0xc44e('0x2'));var rs=require(_0xc44e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc44e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc44e('0x5'));var config=require(_0xc44e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc44e('0x7')][_0xc44e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x237dd1,_0x38b0a0,_0x40d3e3){return new BPromise(function(_0x307564,_0x4b39b2){return client[_0xc44e('0x9')](_0x237dd1,_0x40d3e3)[_0xc44e('0xa')](function(_0x37911a){logger[_0xc44e('0xb')](_0xc44e('0xc'),_0x38b0a0,_0xc44e('0xd'));logger[_0xc44e('0xe')](_0xc44e('0xf'),_0x38b0a0,_0xc44e('0xd'),JSON['stringify'](_0x37911a));if(_0x37911a[_0xc44e('0x10')]){if(_0x37911a[_0xc44e('0x10')][_0xc44e('0x11')]===0x1f4){logger[_0xc44e('0x10')](_0xc44e('0xc'),_0x38b0a0,_0x37911a['error'][_0xc44e('0x12')]);return _0x4b39b2(_0x37911a[_0xc44e('0x10')][_0xc44e('0x12')]);}logger[_0xc44e('0x10')](_0xc44e('0xc'),_0x38b0a0,_0x37911a[_0xc44e('0x10')][_0xc44e('0x12')]);return _0x307564(_0x37911a['error']['message']);}else{logger[_0xc44e('0xb')](_0xc44e('0xc'),_0x38b0a0,_0xc44e('0xd'));_0x307564(_0x37911a['result'][_0xc44e('0x12')]);}})['catch'](function(_0x372628){logger[_0xc44e('0x10')](_0xc44e('0xc'),_0x38b0a0,_0x372628);_0x4b39b2(_0x372628);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 48e5985..22fe803 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 _0xb2c0=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x120b08,_0xebef95){var _0x43ce90=function(_0xc625f){while(--_0xc625f){_0x120b08['push'](_0x120b08['shift']());}};_0x43ce90(++_0xebef95);}(_0xb2c0,0x1a9));var _0x0b2c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2c0[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x0b2c('0x0'));var util=require('util');var path=require(_0x0b2c('0x1'));var timeout=require(_0x0b2c('0x2'));var express=require(_0x0b2c('0x3'));var router=express[_0x0b2c('0x4')]();var fs_extra=require(_0x0b2c('0x5'));var auth=require(_0x0b2c('0x6'));var interaction=require(_0x0b2c('0x7'));var config=require(_0x0b2c('0x8'));var controller=require('./intSugarcrmField.controller');router[_0x0b2c('0x9')]('/',auth[_0x0b2c('0xa')](),controller[_0x0b2c('0xb')]);router[_0x0b2c('0x9')]('/:id',auth[_0x0b2c('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0b2c('0xc')]);router[_0x0b2c('0xd')](_0x0b2c('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x0b2c('0xf')]('/:id',auth[_0x0b2c('0xa')](),controller[_0x0b2c('0x10')]);module[_0x0b2c('0x11')]=router; \ No newline at end of file +var _0xbdfd=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','delete','exports','multer'];(function(_0xaa1a60,_0x1dcf7a){var _0x134681=function(_0x55e5fe){while(--_0x55e5fe){_0xaa1a60['push'](_0xaa1a60['shift']());}};_0x134681(++_0x1dcf7a);}(_0xbdfd,0x99));var _0xdbdf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbdfd[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xdbdf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdbdf('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdbdf('0x2'));var auth=require(_0xdbdf('0x3'));var interaction=require(_0xdbdf('0x4'));var config=require(_0xdbdf('0x5'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xdbdf('0x6')]('/:id',auth[_0xdbdf('0x7')](),controller[_0xdbdf('0x8')]);router['post']('/',auth[_0xdbdf('0x7')](),controller[_0xdbdf('0x9')]);router[_0xdbdf('0xa')](_0xdbdf('0xb'),auth[_0xdbdf('0x7')](),controller['update']);router[_0xdbdf('0xc')](_0xdbdf('0xb'),auth[_0xdbdf('0x7')](),controller['destroy']);module[_0xdbdf('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index cf671c7..0b259f3 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 _0x80a5=['keyValue','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x4b1183,_0x3f5fcf){var _0x260b8e=function(_0x524b0d){while(--_0x524b0d){_0x4b1183['push'](_0x4b1183['shift']());}};_0x260b8e(++_0x3f5fcf);}(_0x80a5,0x1f3));var _0x580a=function(_0x3532e4,_0x14768e){_0x3532e4=_0x3532e4-0x0;var _0x3f2827=_0x80a5[_0x3532e4];return _0x3f2827;};'use strict';var Sequelize=require('sequelize');module[_0x580a('0x0')]={'type':{'type':Sequelize[_0x580a('0x1')](_0x580a('0x2'),_0x580a('0x3'),_0x580a('0x4'),_0x580a('0x5'),'picklist'),'defaultValue':_0x580a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x580a('0x6')]},'keyType':{'type':Sequelize[_0x580a('0x1')](_0x580a('0x2'),_0x580a('0x3'),_0x580a('0x4'))},'keyContent':{'type':Sequelize[_0x580a('0x6')]},'idField':{'type':Sequelize[_0x580a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x580a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x580a('0x6')]}}; \ No newline at end of file +var _0x1a3a=['variable','customVariable','picklist','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x1a3a,0x187));var _0xa1a3=function(_0x124b8d,_0x2e2afb){_0x124b8d=_0x124b8d-0x0;var _0x3b8120=_0x1a3a[_0x124b8d];return _0x3b8120;};'use strict';var Sequelize=require(_0xa1a3('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xa1a3('0x1'),_0xa1a3('0x2'),'keyValue',_0xa1a3('0x3')),'defaultValue':_0xa1a3('0x4')},'content':{'type':Sequelize[_0xa1a3('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa1a3('0x6')](_0xa1a3('0x4'),_0xa1a3('0x1'),_0xa1a3('0x2'))},'keyContent':{'type':Sequelize[_0xa1a3('0x5')]},'idField':{'type':Sequelize[_0xa1a3('0x5')]},'nameField':{'type':Sequelize[_0xa1a3('0x5')]},'customField':{'type':Sequelize[_0xa1a3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa1a3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 5fd1a37..bfca676 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 _0x9022=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','SugarcrmField','findAll','rows','catch','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0xc721f5,_0x42404b){var _0x1bc1bd=function(_0x2870fa){while(--_0x2870fa){_0xc721f5['push'](_0xc721f5['shift']());}};_0x1bc1bd(++_0x42404b);}(_0x9022,0x14b));var _0x2902=function(_0x1f38c6,_0x428650){_0x1f38c6=_0x1f38c6-0x0;var _0x259367=_0x9022[_0x1f38c6];return _0x259367;};'use strict';var emlformat=require(_0x2902('0x0'));var rimraf=require(_0x2902('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2902('0x2'));var rp=require(_0x2902('0x3'));var moment=require(_0x2902('0x4'));var BPromise=require(_0x2902('0x5'));var Mustache=require(_0x2902('0x6'));var util=require('util');var path=require(_0x2902('0x7'));var sox=require(_0x2902('0x8'));var csv=require(_0x2902('0x9'));var ejs=require(_0x2902('0xa'));var fs=require('fs');var fs_extra=require(_0x2902('0xb'));var _=require(_0x2902('0xc'));var squel=require(_0x2902('0xd'));var crypto=require('crypto');var jsforce=require(_0x2902('0xe'));var deskjs=require(_0x2902('0xf'));var toCsv=require(_0x2902('0x9'));var querystring=require(_0x2902('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2902('0x11'));var qs=require(_0x2902('0x12'));var as=require(_0x2902('0x13'));var hardwareService=require(_0x2902('0x14'));var logger=require(_0x2902('0x15'))('api');var utils=require(_0x2902('0x16'));var config=require(_0x2902('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x368e3b,_0x32885c){_0x32885c=_0x32885c||0xcc;return function(_0x4b8563){if(_0x4b8563){return _0x368e3b['sendStatus'](_0x32885c);}return _0x368e3b[_0x2902('0x18')](_0x32885c)[_0x2902('0x19')]();};}function respondWithResult(_0x585638,_0xbe5928){_0xbe5928=_0xbe5928||0xc8;return function(_0x20357e){if(_0x20357e){return _0x585638[_0x2902('0x18')](_0xbe5928)[_0x2902('0x1a')](_0x20357e);}};}function respondWithFilteredResult(_0x51d6d8,_0x200fb5){return function(_0x45e914){if(_0x45e914){var _0x2d5f52=typeof _0x200fb5[_0x2902('0x1b')]===_0x2902('0x1c')&&typeof _0x200fb5[_0x2902('0x1d')]===_0x2902('0x1c');var _0x211a3c=_0x45e914[_0x2902('0x1e')];var _0x508858=_0x2d5f52?0x0:_0x200fb5[_0x2902('0x1b')];var _0x5109c3=_0x2d5f52?_0x45e914[_0x2902('0x1e')]:_0x200fb5['offset']+_0x200fb5[_0x2902('0x1d')];var _0x1add38;if(_0x5109c3>=_0x211a3c){_0x5109c3=_0x211a3c;_0x1add38=0xc8;}else{_0x1add38=0xce;}_0x51d6d8[_0x2902('0x18')](_0x1add38);return _0x51d6d8[_0x2902('0x1f')](_0x2902('0x20'),_0x508858+'-'+_0x5109c3+'/'+_0x211a3c)[_0x2902('0x1a')](_0x45e914);}return null;};}function patchUpdates(_0x4554e0){return function(_0x27743b){try{jsonpatch[_0x2902('0x21')](_0x27743b,_0x4554e0,!![]);}catch(_0x30451e){return BPromise[_0x2902('0x22')](_0x30451e);}return _0x27743b[_0x2902('0x23')]();};}function saveUpdates(_0x3c37a2,_0x16bce4){return function(_0x37c1ac){if(_0x37c1ac){return _0x37c1ac['update'](_0x3c37a2)['then'](function(_0x31964d){return _0x31964d;});}return null;};}function removeEntity(_0x1bc6b2,_0x5b24c8){return function(_0x13493d){if(_0x13493d){return _0x13493d[_0x2902('0x24')]()[_0x2902('0x25')](function(){_0x1bc6b2[_0x2902('0x18')](0xcc)[_0x2902('0x19')]();});}};}function handleEntityNotFound(_0xcf7664,_0x1e0814){return function(_0x197298){if(!_0x197298){_0xcf7664[_0x2902('0x26')](0x194);}return _0x197298;};}function handleError(_0x1100db,_0x4dd66d){_0x4dd66d=_0x4dd66d||0x1f4;return function(_0x35e461){logger[_0x2902('0x27')](_0x35e461[_0x2902('0x28')]);if(_0x35e461['name']){delete _0x35e461[_0x2902('0x29')];}_0x1100db[_0x2902('0x18')](_0x4dd66d)[_0x2902('0x2a')](_0x35e461);};}exports[_0x2902('0x2b')]=function(_0x39fe59,_0x11f013){var _0x5acf80={},_0x259fe1={},_0xefbd6a={'count':0x0,'rows':[]};var _0x48ee7a=_[_0x2902('0x2c')](db['SugarcrmField'][_0x2902('0x2d')],function(_0xbe8023){return{'name':_0xbe8023[_0x2902('0x2e')],'type':_0xbe8023[_0x2902('0x2f')][_0x2902('0x30')]};});_0x259fe1[_0x2902('0x31')]=_['map'](_0x48ee7a,_0x2902('0x29'));_0x259fe1[_0x2902('0x32')]=_[_0x2902('0x33')](_0x39fe59[_0x2902('0x32')]);_0x259fe1[_0x2902('0x34')]=_['intersection'](_0x259fe1[_0x2902('0x31')],_0x259fe1['query']);_0x5acf80['attributes']=_[_0x2902('0x35')](_0x259fe1[_0x2902('0x31')],qs[_0x2902('0x36')](_0x39fe59['query']['fields']));_0x5acf80[_0x2902('0x37')]=_0x5acf80['attributes'][_0x2902('0x38')]?_0x5acf80[_0x2902('0x37')]:_0x259fe1[_0x2902('0x31')];if(!_0x39fe59[_0x2902('0x32')][_0x2902('0x39')](_0x2902('0x3a'))){_0x5acf80[_0x2902('0x1d')]=qs['limit'](_0x39fe59[_0x2902('0x32')][_0x2902('0x1d')]);_0x5acf80['offset']=qs[_0x2902('0x1b')](_0x39fe59[_0x2902('0x32')][_0x2902('0x1b')]);}_0x5acf80[_0x2902('0x3b')]=qs[_0x2902('0x3c')](_0x39fe59[_0x2902('0x32')][_0x2902('0x3c')]);_0x5acf80['where']=qs[_0x2902('0x34')](_[_0x2902('0x3d')](_0x39fe59['query'],_0x259fe1[_0x2902('0x34')]),_0x48ee7a);if(_0x39fe59['query']['filter']){_0x5acf80[_0x2902('0x3e')]=_[_0x2902('0x3f')](_0x5acf80[_0x2902('0x3e')],{'$or':_[_0x2902('0x2c')](_0x48ee7a,function(_0x55eeaf){if(_0x55eeaf['type']!==_0x2902('0x40')){var _0x58a0bf={};_0x58a0bf[_0x55eeaf[_0x2902('0x29')]]={'$like':'%'+_0x39fe59['query'][_0x2902('0x41')]+'%'};return _0x58a0bf;}})});}_0x5acf80=_[_0x2902('0x3f')]({},_0x5acf80,_0x39fe59[_0x2902('0x42')]);var _0x2b453c={'where':_0x5acf80[_0x2902('0x3e')]};return db['SugarcrmField'][_0x2902('0x1e')](_0x2b453c)['then'](function(_0x375338){_0xefbd6a[_0x2902('0x1e')]=_0x375338;if(_0x39fe59['query'][_0x2902('0x43')]){_0x5acf80[_0x2902('0x44')]=[{'all':!![]}];}return db[_0x2902('0x45')][_0x2902('0x46')](_0x5acf80);})[_0x2902('0x25')](function(_0x369b58){_0xefbd6a[_0x2902('0x47')]=_0x369b58;return _0xefbd6a;})['then'](respondWithFilteredResult(_0x11f013,_0x5acf80))[_0x2902('0x48')](handleError(_0x11f013,null));};exports['show']=function(_0x1314a0,_0x3a0221){var _0x40c171={'raw':!![],'where':{'id':_0x1314a0['params']['id']}},_0x1fe484={};_0x1fe484['model']=_[_0x2902('0x33')](db[_0x2902('0x45')]['rawAttributes']);_0x1fe484[_0x2902('0x32')]=_['keys'](_0x1314a0['query']);_0x1fe484[_0x2902('0x34')]=_['intersection'](_0x1fe484[_0x2902('0x31')],_0x1fe484[_0x2902('0x32')]);_0x40c171[_0x2902('0x37')]=_[_0x2902('0x35')](_0x1fe484[_0x2902('0x31')],qs['fields'](_0x1314a0[_0x2902('0x32')][_0x2902('0x36')]));_0x40c171[_0x2902('0x37')]=_0x40c171[_0x2902('0x37')][_0x2902('0x38')]?_0x40c171[_0x2902('0x37')]:_0x1fe484[_0x2902('0x31')];if(_0x1314a0[_0x2902('0x32')][_0x2902('0x43')]){_0x40c171[_0x2902('0x44')]=[{'all':!![]}];}_0x40c171=_[_0x2902('0x3f')]({},_0x40c171,_0x1314a0[_0x2902('0x42')]);return db[_0x2902('0x45')][_0x2902('0x49')](_0x40c171)[_0x2902('0x25')](handleEntityNotFound(_0x3a0221,null))[_0x2902('0x25')](respondWithResult(_0x3a0221,null))[_0x2902('0x48')](handleError(_0x3a0221,null));};exports[_0x2902('0x4a')]=function(_0x6ae34d,_0x2f560e){return db[_0x2902('0x45')][_0x2902('0x4a')](_0x6ae34d[_0x2902('0x4b')],{})[_0x2902('0x25')](respondWithResult(_0x2f560e,0xc9))[_0x2902('0x48')](handleError(_0x2f560e,null));};exports['update']=function(_0x43b096,_0x563cce){if(_0x43b096[_0x2902('0x4b')]['id']){delete _0x43b096[_0x2902('0x4b')]['id'];}return db[_0x2902('0x45')]['find']({'where':{'id':_0x43b096[_0x2902('0x4c')]['id']}})[_0x2902('0x25')](handleEntityNotFound(_0x563cce,null))['then'](saveUpdates(_0x43b096['body'],null))[_0x2902('0x25')](respondWithResult(_0x563cce,null))[_0x2902('0x48')](handleError(_0x563cce,null));};exports[_0x2902('0x24')]=function(_0x480558,_0x3c5158){return db['SugarcrmField']['find']({'where':{'id':_0x480558[_0x2902('0x4c')]['id']}})[_0x2902('0x25')](handleEntityNotFound(_0x3c5158,null))[_0x2902('0x25')](removeEntity(_0x3c5158,null))['catch'](handleError(_0x3c5158,null));}; \ No newline at end of file +var _0x0398=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','map','SugarcrmField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','show','params','rawAttributes','includeAll','find','catch','create','body'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x0398,0x16d));var _0x8039=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x0398[_0x5a6de2];return _0x2c0525;};'use strict';var emlformat=require(_0x8039('0x0'));var rimraf=require(_0x8039('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8039('0x2'));var moment=require(_0x8039('0x3'));var BPromise=require(_0x8039('0x4'));var Mustache=require(_0x8039('0x5'));var util=require(_0x8039('0x6'));var path=require(_0x8039('0x7'));var sox=require(_0x8039('0x8'));var csv=require(_0x8039('0x9'));var ejs=require(_0x8039('0xa'));var fs=require('fs');var fs_extra=require(_0x8039('0xb'));var _=require(_0x8039('0xc'));var squel=require(_0x8039('0xd'));var crypto=require('crypto');var jsforce=require(_0x8039('0xe'));var deskjs=require(_0x8039('0xf'));var toCsv=require(_0x8039('0x9'));var querystring=require(_0x8039('0x10'));var Papa=require(_0x8039('0x11'));var Redis=require(_0x8039('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8039('0x13'));var hardwareService=require(_0x8039('0x14'));var logger=require('../../config/logger')(_0x8039('0x15'));var utils=require(_0x8039('0x16'));var config=require(_0x8039('0x17'));var licenseUtil=require(_0x8039('0x18'));var db=require(_0x8039('0x19'))['db'];function respondWithStatusCode(_0x5f4cab,_0xd080d3){_0xd080d3=_0xd080d3||0xcc;return function(_0x48ecff){if(_0x48ecff){return _0x5f4cab['sendStatus'](_0xd080d3);}return _0x5f4cab[_0x8039('0x1a')](_0xd080d3)['end']();};}function respondWithResult(_0x1f0834,_0xb52c85){_0xb52c85=_0xb52c85||0xc8;return function(_0xa373e3){if(_0xa373e3){return _0x1f0834['status'](_0xb52c85)[_0x8039('0x1b')](_0xa373e3);}};}function respondWithFilteredResult(_0x5c657a,_0x4c271a){return function(_0x503f48){if(_0x503f48){var _0x537117=typeof _0x4c271a[_0x8039('0x1c')]===_0x8039('0x1d')&&typeof _0x4c271a[_0x8039('0x1e')]===_0x8039('0x1d');var _0x9bf450=_0x503f48[_0x8039('0x1f')];var _0x5435db=_0x537117?0x0:_0x4c271a[_0x8039('0x1c')];var _0x293126=_0x537117?_0x503f48[_0x8039('0x1f')]:_0x4c271a[_0x8039('0x1c')]+_0x4c271a[_0x8039('0x1e')];var _0xc74460;if(_0x293126>=_0x9bf450){_0x293126=_0x9bf450;_0xc74460=0xc8;}else{_0xc74460=0xce;}_0x5c657a[_0x8039('0x1a')](_0xc74460);return _0x5c657a['set']('Content-Range',_0x5435db+'-'+_0x293126+'/'+_0x9bf450)[_0x8039('0x1b')](_0x503f48);}return null;};}function patchUpdates(_0x70d2e0){return function(_0x57e4ff){try{jsonpatch[_0x8039('0x20')](_0x57e4ff,_0x70d2e0,!![]);}catch(_0x4881f0){return BPromise[_0x8039('0x21')](_0x4881f0);}return _0x57e4ff['save']();};}function saveUpdates(_0x8e30b6,_0x546742){return function(_0xc1230f){if(_0xc1230f){return _0xc1230f[_0x8039('0x22')](_0x8e30b6)[_0x8039('0x23')](function(_0x56b97c){return _0x56b97c;});}return null;};}function removeEntity(_0x55cf15,_0x5d138a){return function(_0x18efab){if(_0x18efab){return _0x18efab[_0x8039('0x24')]()[_0x8039('0x23')](function(){_0x55cf15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d827,_0x23e04e){return function(_0x22c5b9){if(!_0x22c5b9){_0x13d827['sendStatus'](0x194);}return _0x22c5b9;};}function handleError(_0xcc08c6,_0x3535f0){_0x3535f0=_0x3535f0||0x1f4;return function(_0x511aa2){logger[_0x8039('0x25')](_0x511aa2[_0x8039('0x26')]);if(_0x511aa2[_0x8039('0x27')]){delete _0x511aa2[_0x8039('0x27')];}_0xcc08c6[_0x8039('0x1a')](_0x3535f0)[_0x8039('0x28')](_0x511aa2);};}exports['index']=function(_0x3f7e4e,_0xd6abef){var _0x4548a9={},_0x4b307b={},_0x2b9f3e={'count':0x0,'rows':[]};var _0x2f4738=_[_0x8039('0x29')](db[_0x8039('0x2a')]['rawAttributes'],function(_0xf832cf){return{'name':_0xf832cf['fieldName'],'type':_0xf832cf[_0x8039('0x2b')][_0x8039('0x2c')]};});_0x4b307b[_0x8039('0x2d')]=_[_0x8039('0x29')](_0x2f4738,_0x8039('0x27'));_0x4b307b[_0x8039('0x2e')]=_[_0x8039('0x2f')](_0x3f7e4e['query']);_0x4b307b[_0x8039('0x30')]=_[_0x8039('0x31')](_0x4b307b['model'],_0x4b307b[_0x8039('0x2e')]);_0x4548a9[_0x8039('0x32')]=_[_0x8039('0x31')](_0x4b307b['model'],qs[_0x8039('0x33')](_0x3f7e4e[_0x8039('0x2e')][_0x8039('0x33')]));_0x4548a9['attributes']=_0x4548a9['attributes'][_0x8039('0x34')]?_0x4548a9[_0x8039('0x32')]:_0x4b307b[_0x8039('0x2d')];if(!_0x3f7e4e[_0x8039('0x2e')][_0x8039('0x35')](_0x8039('0x36'))){_0x4548a9['limit']=qs[_0x8039('0x1e')](_0x3f7e4e[_0x8039('0x2e')][_0x8039('0x1e')]);_0x4548a9['offset']=qs[_0x8039('0x1c')](_0x3f7e4e[_0x8039('0x2e')]['offset']);}_0x4548a9[_0x8039('0x37')]=qs[_0x8039('0x38')](_0x3f7e4e[_0x8039('0x2e')][_0x8039('0x38')]);_0x4548a9[_0x8039('0x39')]=qs['filters'](_[_0x8039('0x3a')](_0x3f7e4e['query'],_0x4b307b[_0x8039('0x30')]),_0x2f4738);if(_0x3f7e4e['query']['filter']){_0x4548a9[_0x8039('0x39')]=_[_0x8039('0x3b')](_0x4548a9['where'],{'$or':_[_0x8039('0x29')](_0x2f4738,function(_0x39da06){if(_0x39da06[_0x8039('0x2b')]!==_0x8039('0x3c')){var _0x8aedca={};_0x8aedca[_0x39da06[_0x8039('0x27')]]={'$like':'%'+_0x3f7e4e[_0x8039('0x2e')][_0x8039('0x3d')]+'%'};return _0x8aedca;}})});}_0x4548a9=_[_0x8039('0x3b')]({},_0x4548a9,_0x3f7e4e[_0x8039('0x3e')]);var _0x49b297={'where':_0x4548a9[_0x8039('0x39')]};return db[_0x8039('0x2a')][_0x8039('0x1f')](_0x49b297)[_0x8039('0x23')](function(_0x48db9a){_0x2b9f3e[_0x8039('0x1f')]=_0x48db9a;if(_0x3f7e4e[_0x8039('0x2e')]['includeAll']){_0x4548a9[_0x8039('0x3f')]=[{'all':!![]}];}return db[_0x8039('0x2a')]['findAll'](_0x4548a9);})[_0x8039('0x23')](function(_0x582b51){_0x2b9f3e[_0x8039('0x40')]=_0x582b51;return _0x2b9f3e;})[_0x8039('0x23')](respondWithFilteredResult(_0xd6abef,_0x4548a9))['catch'](handleError(_0xd6abef,null));};exports[_0x8039('0x41')]=function(_0x38e29c,_0x16384c){var _0x5327ac={'raw':!![],'where':{'id':_0x38e29c[_0x8039('0x42')]['id']}},_0x3f69a1={};_0x3f69a1[_0x8039('0x2d')]=_[_0x8039('0x2f')](db[_0x8039('0x2a')][_0x8039('0x43')]);_0x3f69a1[_0x8039('0x2e')]=_[_0x8039('0x2f')](_0x38e29c[_0x8039('0x2e')]);_0x3f69a1['filters']=_[_0x8039('0x31')](_0x3f69a1[_0x8039('0x2d')],_0x3f69a1[_0x8039('0x2e')]);_0x5327ac[_0x8039('0x32')]=_[_0x8039('0x31')](_0x3f69a1['model'],qs[_0x8039('0x33')](_0x38e29c[_0x8039('0x2e')][_0x8039('0x33')]));_0x5327ac['attributes']=_0x5327ac[_0x8039('0x32')][_0x8039('0x34')]?_0x5327ac[_0x8039('0x32')]:_0x3f69a1[_0x8039('0x2d')];if(_0x38e29c[_0x8039('0x2e')][_0x8039('0x44')]){_0x5327ac[_0x8039('0x3f')]=[{'all':!![]}];}_0x5327ac=_[_0x8039('0x3b')]({},_0x5327ac,_0x38e29c[_0x8039('0x3e')]);return db[_0x8039('0x2a')][_0x8039('0x45')](_0x5327ac)[_0x8039('0x23')](handleEntityNotFound(_0x16384c,null))[_0x8039('0x23')](respondWithResult(_0x16384c,null))[_0x8039('0x46')](handleError(_0x16384c,null));};exports[_0x8039('0x47')]=function(_0x216974,_0xfd51cd){return db[_0x8039('0x2a')][_0x8039('0x47')](_0x216974[_0x8039('0x48')],{})[_0x8039('0x23')](respondWithResult(_0xfd51cd,0xc9))[_0x8039('0x46')](handleError(_0xfd51cd,null));};exports[_0x8039('0x22')]=function(_0x237ac0,_0x10f053){if(_0x237ac0[_0x8039('0x48')]['id']){delete _0x237ac0['body']['id'];}return db[_0x8039('0x2a')][_0x8039('0x45')]({'where':{'id':_0x237ac0['params']['id']}})['then'](handleEntityNotFound(_0x10f053,null))['then'](saveUpdates(_0x237ac0[_0x8039('0x48')],null))[_0x8039('0x23')](respondWithResult(_0x10f053,null))[_0x8039('0x46')](handleError(_0x10f053,null));};exports[_0x8039('0x24')]=function(_0x41d425,_0x5bb971){return db[_0x8039('0x2a')]['find']({'where':{'id':_0x41d425[_0x8039('0x42')]['id']}})['then'](handleEntityNotFound(_0x5bb971,null))[_0x8039('0x23')](removeEntity(_0x5bb971,null))[_0x8039('0x46')](handleError(_0x5bb971,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index dcf403e..02aea0b 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 _0x1bd2=['int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x1bd2,0xa3));var _0x21bd=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x1bd2[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x21bd('0x0'));var util=require(_0x21bd('0x1'));var logger=require(_0x21bd('0x2'))(_0x21bd('0x3'));var moment=require(_0x21bd('0x4'));var BPromise=require(_0x21bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21bd('0x6'));var rimraf=require(_0x21bd('0x7'));var config=require(_0x21bd('0x8'));var attributes=require(_0x21bd('0x9'));module[_0x21bd('0xa')]=function(_0x97f3f0,_0x1fdfc5){return _0x97f3f0[_0x21bd('0xb')](_0x21bd('0xc'),attributes,{'tableName':_0x21bd('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x21bd('0xe'),_0x21bd('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd569=['request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x1c0817,_0x1095bc){var _0x20c06b=function(_0x3f739f){while(--_0x3f739f){_0x1c0817['push'](_0x1c0817['shift']());}};_0x20c06b(++_0x1095bc);}(_0xd569,0xbe));var _0x9d56=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xd569[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x9d56('0x0'));var util=require(_0x9d56('0x1'));var logger=require(_0x9d56('0x2'))(_0x9d56('0x3'));var moment=require(_0x9d56('0x4'));var BPromise=require('bluebird');var rp=require(_0x9d56('0x5'));var fs=require('fs');var path=require(_0x9d56('0x6'));var rimraf=require(_0x9d56('0x7'));var config=require(_0x9d56('0x8'));var attributes=require(_0x9d56('0x9'));module['exports']=function(_0x52a998,_0x48a7b0){return _0x52a998['define'](_0x9d56('0xa'),attributes,{'tableName':_0x9d56('0xb'),'paranoid':![],'indexes':[{'name':_0x9d56('0xc'),'fields':[_0x9d56('0xd'),_0x9d56('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index f6bc495..4d284f0 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 _0xd67e=['error','code','SugarcrmField,\x20%s,\x20%s','message','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x3f6cb4,_0xc925e3){var _0x3b6251=function(_0x29d275){while(--_0x29d275){_0x3f6cb4['push'](_0x3f6cb4['shift']());}};_0x3b6251(++_0xc925e3);}(_0xd67e,0x1a8));var _0xed67=function(_0x1378d0,_0x2e8795){_0x1378d0=_0x1378d0-0x0;var _0x31ab41=_0xd67e[_0x1378d0];return _0x31ab41;};'use strict';var _=require(_0xed67('0x0'));var util=require(_0xed67('0x1'));var moment=require(_0xed67('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed67('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xed67('0x4'))(_0xed67('0x5'));var config=require(_0xed67('0x6'));var jayson=require(_0xed67('0x7'));var client=jayson[_0xed67('0x8')][_0xed67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2caecb,_0x3a36ac,_0x4ac90b){return new BPromise(function(_0x19955a,_0x59305b){return client[_0xed67('0xa')](_0x2caecb,_0x4ac90b)[_0xed67('0xb')](function(_0x2674b9){logger[_0xed67('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3a36ac,_0xed67('0xd'));logger[_0xed67('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3a36ac,_0xed67('0xd'),JSON[_0xed67('0xf')](_0x2674b9));if(_0x2674b9[_0xed67('0x10')]){if(_0x2674b9[_0xed67('0x10')][_0xed67('0x11')]===0x1f4){logger[_0xed67('0x10')](_0xed67('0x12'),_0x3a36ac,_0x2674b9['error']['message']);return _0x59305b(_0x2674b9[_0xed67('0x10')]['message']);}logger[_0xed67('0x10')](_0xed67('0x12'),_0x3a36ac,_0x2674b9['error'][_0xed67('0x13')]);return _0x19955a(_0x2674b9[_0xed67('0x10')][_0xed67('0x13')]);}else{logger[_0xed67('0xc')](_0xed67('0x12'),_0x3a36ac,_0xed67('0xd'));_0x19955a(_0x2674b9['result'][_0xed67('0x13')]);}})['catch'](function(_0x7d534e){logger[_0xed67('0x10')](_0xed67('0x12'),_0x3a36ac,_0x7d534e);_0x59305b(_0x7d534e);});});} \ No newline at end of file +var _0xa402=['then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0xecf626,_0x31d164){var _0x17ed8e=function(_0x38dc02){while(--_0x38dc02){_0xecf626['push'](_0xecf626['shift']());}};_0x17ed8e(++_0x31d164);}(_0xa402,0x1f0));var _0x2a40=function(_0x153d3f,_0x242877){_0x153d3f=_0x153d3f-0x0;var _0x3e78a5=_0xa402[_0x153d3f];return _0x3e78a5;};'use strict';var _=require(_0x2a40('0x0'));var util=require('util');var moment=require(_0x2a40('0x1'));var BPromise=require(_0x2a40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a40('0x3'));var db=require(_0x2a40('0x4'))['db'];var utils=require(_0x2a40('0x5'));var logger=require('../../config/logger')(_0x2a40('0x6'));var config=require(_0x2a40('0x7'));var jayson=require(_0x2a40('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x521ae8,_0x2db996,_0x5394f0){return new BPromise(function(_0x11fa6e,_0x37ebb0){return client[_0x2a40('0x9')](_0x521ae8,_0x5394f0)[_0x2a40('0xa')](function(_0x343515){logger[_0x2a40('0xb')](_0x2a40('0xc'),_0x2db996,'request\x20sent');logger[_0x2a40('0xd')](_0x2a40('0xe'),_0x2db996,'request\x20sent',JSON[_0x2a40('0xf')](_0x343515));if(_0x343515[_0x2a40('0x10')]){if(_0x343515['error'][_0x2a40('0x11')]===0x1f4){logger[_0x2a40('0x10')](_0x2a40('0xc'),_0x2db996,_0x343515[_0x2a40('0x10')][_0x2a40('0x12')]);return _0x37ebb0(_0x343515[_0x2a40('0x10')]['message']);}logger[_0x2a40('0x10')](_0x2a40('0xc'),_0x2db996,_0x343515[_0x2a40('0x10')][_0x2a40('0x12')]);return _0x11fa6e(_0x343515['error']['message']);}else{logger[_0x2a40('0xb')](_0x2a40('0xc'),_0x2db996,_0x2a40('0x13'));_0x11fa6e(_0x343515[_0x2a40('0x14')][_0x2a40('0x12')]);}})[_0x2a40('0x15')](function(_0x21c64f){logger[_0x2a40('0x10')](_0x2a40('0xc'),_0x2db996,_0x21c64f);_0x37ebb0(_0x21c64f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 6044787..24abe32 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 _0x5577=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2eeff0,_0x4d5c8d){var _0x2dd9a8=function(_0x1f40b0){while(--_0x1f40b0){_0x2eeff0['push'](_0x2eeff0['shift']());}};_0x2dd9a8(++_0x4d5c8d);}(_0x5577,0x1b4));var _0x7557=function(_0x48cce0,_0x366a85){_0x48cce0=_0x48cce0-0x0;var _0x3fc225=_0x5577[_0x48cce0];return _0x3fc225;};'use strict';var multer=require(_0x7557('0x0'));var util=require('util');var path=require(_0x7557('0x1'));var timeout=require(_0x7557('0x2'));var express=require('express');var router=express[_0x7557('0x3')]();var fs_extra=require(_0x7557('0x4'));var auth=require(_0x7557('0x5'));var interaction=require(_0x7557('0x6'));var config=require(_0x7557('0x7'));var controller=require(_0x7557('0x8'));router['get']('/',auth[_0x7557('0x9')](),controller[_0x7557('0xa')]);router[_0x7557('0xb')](_0x7557('0xc'),auth[_0x7557('0x9')](),controller[_0x7557('0xd')]);router[_0x7557('0xb')](_0x7557('0xe'),auth[_0x7557('0x9')](),controller[_0x7557('0xf')]);router[_0x7557('0xb')](_0x7557('0x10'),auth[_0x7557('0x9')](),controller[_0x7557('0x11')]);router[_0x7557('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7557('0x12')](_0x7557('0xe'),auth[_0x7557('0x9')](),controller[_0x7557('0x13')]);router[_0x7557('0x14')](_0x7557('0xc'),auth[_0x7557('0x9')](),controller[_0x7557('0x15')]);router[_0x7557('0x16')](_0x7557('0xc'),auth['isAuthenticated'](),controller[_0x7557('0x17')]);module[_0x7557('0x18')]=router; \ No newline at end of file +var _0x79d3=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','update','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x79d3,0x15f));var _0x379d=function(_0x160f99,_0x8de3ad){_0x160f99=_0x160f99-0x0;var _0x405e09=_0x79d3[_0x160f99];return _0x405e09;};'use strict';var multer=require(_0x379d('0x0'));var util=require('util');var path=require(_0x379d('0x1'));var timeout=require('connect-timeout');var express=require(_0x379d('0x2'));var router=express[_0x379d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x379d('0x4'));var interaction=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var controller=require(_0x379d('0x7'));router[_0x379d('0x8')]('/',auth[_0x379d('0x9')](),controller[_0x379d('0xa')]);router['get'](_0x379d('0xb'),auth['isAuthenticated'](),controller[_0x379d('0xc')]);router[_0x379d('0x8')](_0x379d('0xd'),auth['isAuthenticated'](),controller[_0x379d('0xe')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x379d('0xf')]);router[_0x379d('0x10')]('/',auth[_0x379d('0x9')](),controller['create']);router[_0x379d('0x10')](_0x379d('0xd'),auth[_0x379d('0x9')](),controller[_0x379d('0x11')]);router['put'](_0x379d('0xb'),auth[_0x379d('0x9')](),controller[_0x379d('0x12')]);router[_0x379d('0x13')](_0x379d('0xb'),auth[_0x379d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a221ebc..ceccad0 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 _0x9338=['STRING','HelpDesk','sequelize','exports'];(function(_0x208705,_0x1ee99d){var _0x101594=function(_0x2c9f2f){while(--_0x2c9f2f){_0x208705['push'](_0x208705['shift']());}};_0x101594(++_0x1ee99d);}(_0x9338,0x72));var _0x8933=function(_0x31b90f,_0x35ef73){_0x31b90f=_0x31b90f-0x0;var _0x15653b=_0x9338[_0x31b90f];return _0x15653b;};'use strict';var Sequelize=require(_0x8933('0x0'));module[_0x8933('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8933('0x2')]},'username':{'type':Sequelize[_0x8933('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8933('0x2')],'allowNull':![],'defaultValue':_0x8933('0x3')},'remoteUri':{'type':Sequelize[_0x8933('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8933('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa312=['sequelize','STRING'];(function(_0x1ca5f7,_0x55d6d5){var _0x4660a1=function(_0x24bbee){while(--_0x24bbee){_0x1ca5f7['push'](_0x1ca5f7['shift']());}};_0x4660a1(++_0x55d6d5);}(_0xa312,0x186));var _0x2a31=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xa312[_0x1b64dd];return _0xeb464c;};'use strict';var Sequelize=require(_0x2a31('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a31('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2a31('0x1')]},'username':{'type':Sequelize[_0x2a31('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2a31('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x2a31('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2a31('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2a31('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 572db94..2ba10f0 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 _0x5cd2=['rows','catch','show','params','options','create','body','find','destroy','getConfigurations','VtigerConfiguration','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','describe','sessionName','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','log','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','map','VtigerAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x57a491,_0x4d1428){var _0x14f6fc=function(_0x57d4e0){while(--_0x57d4e0){_0x57a491['push'](_0x57a491['shift']());}};_0x14f6fc(++_0x4d1428);}(_0x5cd2,0xaf));var _0x25cd=function(_0x4f166b,_0x167810){_0x4f166b=_0x4f166b-0x0;var _0x2307ce=_0x5cd2[_0x4f166b];return _0x2307ce;};'use strict';var emlformat=require(_0x25cd('0x0'));var rimraf=require(_0x25cd('0x1'));var zipdir=require(_0x25cd('0x2'));var jsonpatch=require(_0x25cd('0x3'));var rp=require(_0x25cd('0x4'));var moment=require(_0x25cd('0x5'));var BPromise=require(_0x25cd('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x25cd('0x7'));var sox=require(_0x25cd('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25cd('0x9'));var squel=require(_0x25cd('0xa'));var crypto=require(_0x25cd('0xb'));var jsforce=require(_0x25cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x25cd('0xd'));var querystring=require('querystring');var Papa=require(_0x25cd('0xe'));var Redis=require(_0x25cd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x25cd('0x10'));var hardwareService=require(_0x25cd('0x11'));var logger=require(_0x25cd('0x12'))(_0x25cd('0x13'));var utils=require(_0x25cd('0x14'));var config=require(_0x25cd('0x15'));var licenseUtil=require(_0x25cd('0x16'));var db=require(_0x25cd('0x17'))['db'];var integrations=require(_0x25cd('0x18'));function respondWithStatusCode(_0x5c87ab,_0x5b9fd6){_0x5b9fd6=_0x5b9fd6||0xcc;return function(_0x35dd42){if(_0x35dd42){return _0x5c87ab[_0x25cd('0x19')](_0x5b9fd6);}return _0x5c87ab[_0x25cd('0x1a')](_0x5b9fd6)[_0x25cd('0x1b')]();};}function respondWithResult(_0x576c32,_0x3a6cdb){_0x3a6cdb=_0x3a6cdb||0xc8;return function(_0x1d00e2){if(_0x1d00e2){return _0x576c32[_0x25cd('0x1a')](_0x3a6cdb)[_0x25cd('0x1c')](_0x1d00e2);}};}function respondWithFilteredResult(_0x433ce3,_0x17270c){return function(_0x3139c4){if(_0x3139c4){var _0x26deef=typeof _0x17270c[_0x25cd('0x1d')]===_0x25cd('0x1e')&&typeof _0x17270c[_0x25cd('0x1f')]===_0x25cd('0x1e');var _0x2c9148=_0x3139c4[_0x25cd('0x20')];var _0x3370e9=_0x26deef?0x0:_0x17270c[_0x25cd('0x1d')];var _0x572965=_0x26deef?_0x3139c4[_0x25cd('0x20')]:_0x17270c[_0x25cd('0x1d')]+_0x17270c[_0x25cd('0x1f')];var _0x13d3b2;if(_0x572965>=_0x2c9148){_0x572965=_0x2c9148;_0x13d3b2=0xc8;}else{_0x13d3b2=0xce;}_0x433ce3[_0x25cd('0x1a')](_0x13d3b2);return _0x433ce3[_0x25cd('0x21')](_0x25cd('0x22'),_0x3370e9+'-'+_0x572965+'/'+_0x2c9148)[_0x25cd('0x1c')](_0x3139c4);}return null;};}function patchUpdates(_0xcc913a){return function(_0x58f2c8){try{jsonpatch[_0x25cd('0x23')](_0x58f2c8,_0xcc913a,!![]);}catch(_0x1d33c7){return BPromise[_0x25cd('0x24')](_0x1d33c7);}return _0x58f2c8['save']();};}function saveUpdates(_0x439d0e,_0x2ab112){return function(_0x3830e2){if(_0x3830e2){return _0x3830e2[_0x25cd('0x25')](_0x439d0e)[_0x25cd('0x26')](function(_0x376bb4){return _0x376bb4;});}return null;};}function removeEntity(_0x2cc5f8,_0xc86e26){return function(_0x155950){if(_0x155950){return _0x155950['destroy']()[_0x25cd('0x26')](function(){_0x2cc5f8[_0x25cd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45618d,_0x2ce6d6){return function(_0x3273c9){if(!_0x3273c9){_0x45618d['sendStatus'](0x194);}return _0x3273c9;};}function handleError(_0x4f9953,_0x5d130c){_0x5d130c=_0x5d130c||0x1f4;return function(_0x973d01){logger[_0x25cd('0x27')](_0x973d01[_0x25cd('0x28')]);if(_0x973d01[_0x25cd('0x29')]){delete _0x973d01['name'];}_0x4f9953[_0x25cd('0x1a')](_0x5d130c)['send'](_0x973d01);};}exports['index']=function(_0x4a391f,_0x3d74cc){var _0x28e4b1={},_0x43dfa7={},_0x81762a={'count':0x0,'rows':[]};var _0x155847=_[_0x25cd('0x2a')](db[_0x25cd('0x2b')][_0x25cd('0x2c')],function(_0x5478ed){return{'name':_0x5478ed[_0x25cd('0x2d')],'type':_0x5478ed[_0x25cd('0x2e')][_0x25cd('0x2f')]};});_0x43dfa7['model']=_[_0x25cd('0x2a')](_0x155847,_0x25cd('0x29'));_0x43dfa7[_0x25cd('0x30')]=_[_0x25cd('0x31')](_0x4a391f['query']);_0x43dfa7[_0x25cd('0x32')]=_[_0x25cd('0x33')](_0x43dfa7['model'],_0x43dfa7[_0x25cd('0x30')]);_0x28e4b1[_0x25cd('0x34')]=_[_0x25cd('0x33')](_0x43dfa7[_0x25cd('0x35')],qs[_0x25cd('0x36')](_0x4a391f['query'][_0x25cd('0x36')]));_0x28e4b1[_0x25cd('0x34')]=_0x28e4b1['attributes'][_0x25cd('0x37')]?_0x28e4b1[_0x25cd('0x34')]:_0x43dfa7[_0x25cd('0x35')];if(!_0x4a391f[_0x25cd('0x30')][_0x25cd('0x38')](_0x25cd('0x39'))){_0x28e4b1[_0x25cd('0x1f')]=qs[_0x25cd('0x1f')](_0x4a391f[_0x25cd('0x30')]['limit']);_0x28e4b1['offset']=qs[_0x25cd('0x1d')](_0x4a391f[_0x25cd('0x30')][_0x25cd('0x1d')]);}_0x28e4b1[_0x25cd('0x3a')]=qs['sort'](_0x4a391f['query'][_0x25cd('0x3b')]);_0x28e4b1[_0x25cd('0x3c')]=qs[_0x25cd('0x32')](_[_0x25cd('0x3d')](_0x4a391f[_0x25cd('0x30')],_0x43dfa7[_0x25cd('0x32')]),_0x155847);if(_0x4a391f[_0x25cd('0x30')][_0x25cd('0x3e')]){_0x28e4b1[_0x25cd('0x3c')]=_[_0x25cd('0x3f')](_0x28e4b1[_0x25cd('0x3c')],{'$or':_[_0x25cd('0x2a')](_0x155847,function(_0x3575f5){if(_0x3575f5['type']!==_0x25cd('0x40')){var _0x4ab0f7={};_0x4ab0f7[_0x3575f5[_0x25cd('0x29')]]={'$like':'%'+_0x4a391f[_0x25cd('0x30')][_0x25cd('0x3e')]+'%'};return _0x4ab0f7;}})});}_0x28e4b1=_[_0x25cd('0x3f')]({},_0x28e4b1,_0x4a391f['options']);var _0x12b9b7={'where':_0x28e4b1['where']};return db[_0x25cd('0x2b')][_0x25cd('0x20')](_0x12b9b7)[_0x25cd('0x26')](function(_0x5b83b2){_0x81762a['count']=_0x5b83b2;if(_0x4a391f[_0x25cd('0x30')][_0x25cd('0x41')]){_0x28e4b1[_0x25cd('0x42')]=[{'all':!![]}];}return db[_0x25cd('0x2b')]['findAll'](_0x28e4b1);})[_0x25cd('0x26')](function(_0x4a0c8d){_0x81762a[_0x25cd('0x43')]=_0x4a0c8d;return _0x81762a;})[_0x25cd('0x26')](respondWithFilteredResult(_0x3d74cc,_0x28e4b1))[_0x25cd('0x44')](handleError(_0x3d74cc,null));};exports[_0x25cd('0x45')]=function(_0x24c64b,_0x1f45b6){var _0x297f4c={'raw':![],'where':{'id':_0x24c64b[_0x25cd('0x46')]['id']}},_0x27d24a={};_0x27d24a[_0x25cd('0x35')]=_[_0x25cd('0x31')](db[_0x25cd('0x2b')][_0x25cd('0x2c')]);_0x27d24a[_0x25cd('0x30')]=_[_0x25cd('0x31')](_0x24c64b[_0x25cd('0x30')]);_0x27d24a[_0x25cd('0x32')]=_['intersection'](_0x27d24a['model'],_0x27d24a[_0x25cd('0x30')]);_0x297f4c[_0x25cd('0x34')]=_[_0x25cd('0x33')](_0x27d24a[_0x25cd('0x35')],qs['fields'](_0x24c64b[_0x25cd('0x30')][_0x25cd('0x36')]));_0x297f4c['attributes']=_0x297f4c[_0x25cd('0x34')][_0x25cd('0x37')]?_0x297f4c[_0x25cd('0x34')]:_0x27d24a['model'];if(_0x24c64b[_0x25cd('0x30')][_0x25cd('0x41')]){_0x297f4c[_0x25cd('0x42')]=[{'all':!![]}];}_0x297f4c=_['merge']({},_0x297f4c,_0x24c64b[_0x25cd('0x47')]);return db[_0x25cd('0x2b')]['find'](_0x297f4c)['then'](handleEntityNotFound(_0x1f45b6,null))['then'](respondWithResult(_0x1f45b6,null))[_0x25cd('0x44')](handleError(_0x1f45b6,null));};exports[_0x25cd('0x48')]=function(_0x22ac3e,_0x37829d){return db['VtigerAccount']['create'](_0x22ac3e[_0x25cd('0x49')],{})[_0x25cd('0x26')](respondWithResult(_0x37829d,0xc9))[_0x25cd('0x44')](handleError(_0x37829d,null));};exports['update']=function(_0x26a33d,_0x5b09dc){if(_0x26a33d[_0x25cd('0x49')]['id']){delete _0x26a33d[_0x25cd('0x49')]['id'];}return db['VtigerAccount'][_0x25cd('0x4a')]({'where':{'id':_0x26a33d[_0x25cd('0x46')]['id']}})[_0x25cd('0x26')](handleEntityNotFound(_0x5b09dc,null))[_0x25cd('0x26')](saveUpdates(_0x26a33d[_0x25cd('0x49')],null))[_0x25cd('0x26')](respondWithResult(_0x5b09dc,null))['catch'](handleError(_0x5b09dc,null));};exports[_0x25cd('0x4b')]=function(_0x4931d5,_0x3996a2){return db[_0x25cd('0x2b')][_0x25cd('0x4a')]({'where':{'id':_0x4931d5[_0x25cd('0x46')]['id']}})[_0x25cd('0x26')](handleEntityNotFound(_0x3996a2,null))[_0x25cd('0x26')](removeEntity(_0x3996a2,null))['catch'](handleError(_0x3996a2,null));};exports[_0x25cd('0x4c')]=function(_0x39903c,_0x2bdffa,_0x3ebbbb){var _0x24649a={};var _0xedb23d={};var _0x3c0703;var _0x3d8f0e;return db[_0x25cd('0x2b')]['findOne']({'where':{'id':_0x39903c[_0x25cd('0x46')]['id']}})[_0x25cd('0x26')](handleEntityNotFound(_0x2bdffa,null))[_0x25cd('0x26')](function(_0x21733a){if(_0x21733a){_0x3c0703=_0x21733a;_0xedb23d['model']=_['keys'](db[_0x25cd('0x4d')]['rawAttributes']);_0xedb23d[_0x25cd('0x30')]=_['keys'](_0x39903c[_0x25cd('0x30')]);_0xedb23d['filters']=_[_0x25cd('0x33')](_0xedb23d[_0x25cd('0x35')],_0xedb23d[_0x25cd('0x30')]);_0x24649a[_0x25cd('0x34')]=_[_0x25cd('0x33')](_0xedb23d[_0x25cd('0x35')],qs[_0x25cd('0x36')](_0x39903c[_0x25cd('0x30')]['fields']));_0x24649a[_0x25cd('0x34')]=_0x24649a['attributes'][_0x25cd('0x37')]?_0x24649a[_0x25cd('0x34')]:_0xedb23d['model'];_0x24649a['order']=qs[_0x25cd('0x3b')](_0x39903c[_0x25cd('0x30')]['sort']);_0x24649a[_0x25cd('0x3c')]=qs['filters'](_[_0x25cd('0x3d')](_0x39903c[_0x25cd('0x30')],_0xedb23d['filters']));if(_0x39903c[_0x25cd('0x30')][_0x25cd('0x3e')]){_0x24649a[_0x25cd('0x3c')]=_[_0x25cd('0x3f')](_0x24649a[_0x25cd('0x3c')],{'$or':_['map'](_0x24649a[_0x25cd('0x34')],function(_0x34135e){var _0x5b43a9={};_0x5b43a9[_0x34135e]={'$like':'%'+_0x39903c[_0x25cd('0x30')][_0x25cd('0x3e')]+'%'};return _0x5b43a9;})});}_0x24649a=_[_0x25cd('0x3f')]({},_0x24649a,_0x39903c[_0x25cd('0x47')]);return _0x3c0703['getConfigurations'](_0x24649a);}})[_0x25cd('0x26')](function(_0x58070a){if(_0x58070a){_0x3d8f0e=_0x58070a[_0x25cd('0x37')];if(!_0x39903c['query'][_0x25cd('0x38')](_0x25cd('0x39'))){_0x24649a[_0x25cd('0x1f')]=qs['limit'](_0x39903c['query'][_0x25cd('0x1f')]);_0x24649a[_0x25cd('0x1d')]=qs[_0x25cd('0x1d')](_0x39903c[_0x25cd('0x30')][_0x25cd('0x1d')]);}return _0x3c0703['getConfigurations'](_0x24649a);}})[_0x25cd('0x26')](function(_0x152f51){if(_0x152f51){return _0x152f51?{'count':_0x3d8f0e,'rows':_0x152f51}:null;}})[_0x25cd('0x26')](respondWithResult(_0x2bdffa,null))[_0x25cd('0x44')](handleError(_0x2bdffa,null));};exports[_0x25cd('0x4e')]=function(_0xe19225,_0x29ca7d,_0x416ea4){if(_0xe19225[_0x25cd('0x49')]['id']){delete _0xe19225['body']['id'];}return db[_0x25cd('0x2b')][_0x25cd('0x4f')]({'where':{'id':_0xe19225[_0x25cd('0x46')]['id']}})['then'](handleEntityNotFound(_0x29ca7d,null))[_0x25cd('0x26')](function(_0x14263e){if(_0x14263e){_0xe19225[_0x25cd('0x49')][_0x25cd('0x50')]=_0x14263e['id'];_0xe19225[_0x25cd('0x49')]['Subjects']=integrations[_0x25cd('0x51')](_0xe19225[_0x25cd('0x49')][_0x25cd('0x52')],_0xe19225[_0x25cd('0x49')][_0x25cd('0x2e')]);_0xe19225['body'][_0x25cd('0x53')]=integrations[_0x25cd('0x54')](_0xe19225['body'][_0x25cd('0x52')],_0xe19225[_0x25cd('0x49')][_0x25cd('0x2e')]);return db[_0x25cd('0x4d')][_0x25cd('0x48')](_0xe19225[_0x25cd('0x49')],{'include':[{'model':db[_0x25cd('0x55')],'as':'Subjects'},{'model':db[_0x25cd('0x55')],'as':_0x25cd('0x53')}]});}return null;})[_0x25cd('0x26')](respondWithResult(_0x29ca7d,null))[_0x25cd('0x44')](handleError(_0x29ca7d,null));};var md5=require('md5');exports[_0x25cd('0x56')]=function(_0x50d6db,_0x4cd85d,_0xc7a613){var _0x5273c7=null;var _0x4b1f21=null;var _0x2ccd66=null;var _0x168125=null;var _0x5bea46='';return db[_0x25cd('0x2b')][_0x25cd('0x4f')]({'where':{'id':_0x50d6db[_0x25cd('0x46')]['id']},'attributes':['id','name',_0x25cd('0x57'),'description',_0x25cd('0x58'),_0x25cd('0x59'),_0x25cd('0x5a'),_0x25cd('0x5b')]})[_0x25cd('0x26')](handleEntityNotFound(_0x4cd85d,null))['then'](function(_0x1f41d9){if(_0x1f41d9){_0x5273c7=_0x1f41d9['username'];_0x4b1f21=_0x1f41d9[_0x25cd('0x5b')];_0x2ccd66=_0x1f41d9[_0x25cd('0x58')];_0x5bea46=_0x1f41d9[_0x25cd('0x59')];var _0xe30f9a=_0x5bea46[_0x25cd('0x5c')](-0x1);if(_0xe30f9a==='/'){_0x5bea46=_0x5bea46[_0x25cd('0x5d')](0x0,_0x5bea46['lastIndexOf'](_0xe30f9a));}_0x168125=util[_0x25cd('0x5e')](_0x25cd('0x5f'),_0x5bea46);var _0x27ac75={'method':_0x25cd('0x60'),'uri':_0x168125,'qs':{'operation':_0x25cd('0x61'),'username':_0x1f41d9[_0x25cd('0x57')]},'json':!![]};return rp(_0x27ac75);}})['then'](function(_0x11e551){if(_0x11e551['success']){var _0x5621df={'method':_0x25cd('0x62'),'uri':_0x168125,'form':{'operation':_0x25cd('0x63'),'username':_0x5273c7,'accessKey':md5(_0x11e551[_0x25cd('0x64')][_0x25cd('0x65')]+_0x4b1f21)},'json':!![]};return rp(_0x5621df);}})[_0x25cd('0x26')](function(_0x14a2b2){if(_0x14a2b2[_0x25cd('0x66')]){var _0x38c138={'method':_0x25cd('0x60'),'uri':_0x168125,'qs':{'operation':_0x25cd('0x67'),'username':_0x5273c7,'sessionName':_0x14a2b2[_0x25cd('0x64')][_0x25cd('0x68')],'elementType':_0x2ccd66},'json':!![]};return rp(_0x38c138);}})[_0x25cd('0x26')](function(_0x58a535){if(_0x58a535[_0x25cd('0x66')]){var _0x3239e7=['autogenerated','reference',_0x25cd('0x69')];_[_0x25cd('0x6a')](_0x58a535[_0x25cd('0x64')]['fields'],function(_0x17e118){return _0x3239e7[_0x25cd('0x6b')](_0x17e118[_0x25cd('0x2e')][_0x25cd('0x29')]);});_['remove'](_0x58a535[_0x25cd('0x64')][_0x25cd('0x36')],function(_0x32913e){return _0x32913e[_0x25cd('0x6c')]===_0x25cd('0x6d');});return{'count':_0x58a535['result'][_0x25cd('0x36')][_0x25cd('0x37')],'rows':_[_0x25cd('0x2a')](_0x58a535['result']['fields'],function(_0x14fbe5){return{'id':_0x14fbe5[_0x25cd('0x29')],'name':_0x14fbe5[_0x25cd('0x6e')],'custom':_[_0x25cd('0x6f')](_0x14fbe5[_0x25cd('0x29')],_0x25cd('0x70'))?!![]:![],'options':_0x14fbe5[_0x25cd('0x2e')][_0x25cd('0x29')]===_0x25cd('0x71')&&_0x14fbe5['type']['picklistValues'][_0x25cd('0x37')]>0x0?_[_0x25cd('0x2a')](_0x14fbe5[_0x25cd('0x2e')][_0x25cd('0x72')],function(_0x1fe1fe){return{'name':_0x1fe1fe['label'],'value':_0x1fe1fe['value']};}):[]};})};}})[_0x25cd('0x26')](respondWithResult(_0x4cd85d,null))[_0x25cd('0x44')](function(_0x2b089e){console[_0x25cd('0x73')]('vTiger\x20error:\x20'+_0x2b089e);var _0x3db5e2=_0x50d6db[_0x25cd('0x30')][_0x25cd('0x74')]?0x1f4:_0x2b089e['statusCode']||0x1f4;logger['error'](_0x25cd('0x75'),_0x25cd('0x56'),_0x3db5e2,JSON['stringify'](_0x2b089e));delete _0x2b089e[_0x25cd('0x29')];if(_0x3db5e2===0x191){_0x3db5e2=0x190;}_0x4cd85d['status'](_0x3db5e2)[_0x25cd('0x76')](_0x50d6db['query'][_0x25cd('0x74')]?{'message':_0x25cd('0x77'),'statusCode':_0x2b089e[_0x25cd('0x78')]}:_0x2b089e);});}; \ No newline at end of file +var _0x56ff=['end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','map','VtigerAccount','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','getConfigurations','VtigerConfiguration','order','options','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','description','moduleName','serverUrl','accessKey','username','remoteUri','slice','substring','lastIndexOf','format','getchallenge','POST','login','result','token','success','sessionName','autogenerated','reference','owner','remove','editable','false','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0x56ff,0x1c1));var _0xf56f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x56ff[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf56f('0x0'));var rimraf=require(_0xf56f('0x1'));var zipdir=require(_0xf56f('0x2'));var jsonpatch=require(_0xf56f('0x3'));var rp=require(_0xf56f('0x4'));var moment=require(_0xf56f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf56f('0x6'));var util=require('util');var path=require(_0xf56f('0x7'));var sox=require(_0xf56f('0x8'));var csv=require(_0xf56f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf56f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf56f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf56f('0xc'));var toCsv=require(_0xf56f('0x9'));var querystring=require('querystring');var Papa=require(_0xf56f('0xd'));var Redis=require(_0xf56f('0xe'));var authService=require(_0xf56f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf56f('0x10'));var hardwareService=require(_0xf56f('0x11'));var logger=require('../../config/logger')(_0xf56f('0x12'));var utils=require(_0xf56f('0x13'));var config=require(_0xf56f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf56f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xe6f8a6,_0x3438d1){_0x3438d1=_0x3438d1||0xcc;return function(_0x1a7e03){if(_0x1a7e03){return _0xe6f8a6['sendStatus'](_0x3438d1);}return _0xe6f8a6[_0xf56f('0x16')](_0x3438d1)[_0xf56f('0x17')]();};}function respondWithResult(_0x16d9fc,_0x5f4289){_0x5f4289=_0x5f4289||0xc8;return function(_0x38e7c9){if(_0x38e7c9){return _0x16d9fc['status'](_0x5f4289)[_0xf56f('0x18')](_0x38e7c9);}};}function respondWithFilteredResult(_0x5eb7aa,_0x4ffe33){return function(_0x394806){if(_0x394806){var _0x34757b=typeof _0x4ffe33['offset']===_0xf56f('0x19')&&typeof _0x4ffe33[_0xf56f('0x1a')]===_0xf56f('0x19');var _0x545055=_0x394806[_0xf56f('0x1b')];var _0x244d42=_0x34757b?0x0:_0x4ffe33[_0xf56f('0x1c')];var _0x4170d8=_0x34757b?_0x394806[_0xf56f('0x1b')]:_0x4ffe33[_0xf56f('0x1c')]+_0x4ffe33[_0xf56f('0x1a')];var _0x5af50a;if(_0x4170d8>=_0x545055){_0x4170d8=_0x545055;_0x5af50a=0xc8;}else{_0x5af50a=0xce;}_0x5eb7aa['status'](_0x5af50a);return _0x5eb7aa['set'](_0xf56f('0x1d'),_0x244d42+'-'+_0x4170d8+'/'+_0x545055)[_0xf56f('0x18')](_0x394806);}return null;};}function patchUpdates(_0x5aafbe){return function(_0x4df198){try{jsonpatch[_0xf56f('0x1e')](_0x4df198,_0x5aafbe,!![]);}catch(_0x271d87){return BPromise[_0xf56f('0x1f')](_0x271d87);}return _0x4df198[_0xf56f('0x20')]();};}function saveUpdates(_0x43e688,_0xaecdda){return function(_0x3479e0){if(_0x3479e0){return _0x3479e0[_0xf56f('0x21')](_0x43e688)['then'](function(_0x295453){return _0x295453;});}return null;};}function removeEntity(_0x3ef58a,_0x152506){return function(_0x4c62c){if(_0x4c62c){return _0x4c62c[_0xf56f('0x22')]()['then'](function(){_0x3ef58a['status'](0xcc)[_0xf56f('0x17')]();});}};}function handleEntityNotFound(_0xd57b1b,_0x3aee6e){return function(_0x3f543f){if(!_0x3f543f){_0xd57b1b[_0xf56f('0x23')](0x194);}return _0x3f543f;};}function handleError(_0x3f4066,_0x414ef3){_0x414ef3=_0x414ef3||0x1f4;return function(_0x50ac91){logger[_0xf56f('0x24')](_0x50ac91[_0xf56f('0x25')]);if(_0x50ac91['name']){delete _0x50ac91[_0xf56f('0x26')];}_0x3f4066[_0xf56f('0x16')](_0x414ef3)['send'](_0x50ac91);};}exports['index']=function(_0x1eac39,_0x263254){var _0x30c85c={},_0x14923a={},_0x32cad0={'count':0x0,'rows':[]};var _0x1039f5=_[_0xf56f('0x27')](db[_0xf56f('0x28')]['rawAttributes'],function(_0x1f9bae){return{'name':_0x1f9bae[_0xf56f('0x29')],'type':_0x1f9bae[_0xf56f('0x2a')][_0xf56f('0x2b')]};});_0x14923a['model']=_['map'](_0x1039f5,_0xf56f('0x26'));_0x14923a[_0xf56f('0x2c')]=_[_0xf56f('0x2d')](_0x1eac39[_0xf56f('0x2c')]);_0x14923a[_0xf56f('0x2e')]=_[_0xf56f('0x2f')](_0x14923a['model'],_0x14923a['query']);_0x30c85c['attributes']=_[_0xf56f('0x2f')](_0x14923a[_0xf56f('0x30')],qs[_0xf56f('0x31')](_0x1eac39[_0xf56f('0x2c')][_0xf56f('0x31')]));_0x30c85c[_0xf56f('0x32')]=_0x30c85c[_0xf56f('0x32')][_0xf56f('0x33')]?_0x30c85c[_0xf56f('0x32')]:_0x14923a[_0xf56f('0x30')];if(!_0x1eac39[_0xf56f('0x2c')][_0xf56f('0x34')]('nolimit')){_0x30c85c[_0xf56f('0x1a')]=qs[_0xf56f('0x1a')](_0x1eac39[_0xf56f('0x2c')][_0xf56f('0x1a')]);_0x30c85c[_0xf56f('0x1c')]=qs[_0xf56f('0x1c')](_0x1eac39[_0xf56f('0x2c')][_0xf56f('0x1c')]);}_0x30c85c['order']=qs[_0xf56f('0x35')](_0x1eac39[_0xf56f('0x2c')][_0xf56f('0x35')]);_0x30c85c['where']=qs[_0xf56f('0x2e')](_[_0xf56f('0x36')](_0x1eac39['query'],_0x14923a['filters']),_0x1039f5);if(_0x1eac39[_0xf56f('0x2c')][_0xf56f('0x37')]){_0x30c85c[_0xf56f('0x38')]=_[_0xf56f('0x39')](_0x30c85c['where'],{'$or':_[_0xf56f('0x27')](_0x1039f5,function(_0x3078db){if(_0x3078db['type']!==_0xf56f('0x3a')){var _0x24cee3={};_0x24cee3[_0x3078db[_0xf56f('0x26')]]={'$like':'%'+_0x1eac39['query'][_0xf56f('0x37')]+'%'};return _0x24cee3;}})});}_0x30c85c=_['merge']({},_0x30c85c,_0x1eac39['options']);var _0x10ecce={'where':_0x30c85c[_0xf56f('0x38')]};return db[_0xf56f('0x28')][_0xf56f('0x1b')](_0x10ecce)[_0xf56f('0x3b')](function(_0x2742b2){_0x32cad0[_0xf56f('0x1b')]=_0x2742b2;if(_0x1eac39[_0xf56f('0x2c')][_0xf56f('0x3c')]){_0x30c85c[_0xf56f('0x3d')]=[{'all':!![]}];}return db['VtigerAccount'][_0xf56f('0x3e')](_0x30c85c);})['then'](function(_0x1f56e0){_0x32cad0[_0xf56f('0x3f')]=_0x1f56e0;return _0x32cad0;})[_0xf56f('0x3b')](respondWithFilteredResult(_0x263254,_0x30c85c))[_0xf56f('0x40')](handleError(_0x263254,null));};exports[_0xf56f('0x41')]=function(_0x22f597,_0x114be9){var _0x360902={'raw':![],'where':{'id':_0x22f597['params']['id']}},_0x290aeb={};_0x290aeb[_0xf56f('0x30')]=_[_0xf56f('0x2d')](db[_0xf56f('0x28')][_0xf56f('0x42')]);_0x290aeb[_0xf56f('0x2c')]=_[_0xf56f('0x2d')](_0x22f597['query']);_0x290aeb[_0xf56f('0x2e')]=_[_0xf56f('0x2f')](_0x290aeb['model'],_0x290aeb[_0xf56f('0x2c')]);_0x360902[_0xf56f('0x32')]=_[_0xf56f('0x2f')](_0x290aeb[_0xf56f('0x30')],qs[_0xf56f('0x31')](_0x22f597[_0xf56f('0x2c')][_0xf56f('0x31')]));_0x360902[_0xf56f('0x32')]=_0x360902[_0xf56f('0x32')][_0xf56f('0x33')]?_0x360902[_0xf56f('0x32')]:_0x290aeb[_0xf56f('0x30')];if(_0x22f597[_0xf56f('0x2c')][_0xf56f('0x3c')]){_0x360902[_0xf56f('0x3d')]=[{'all':!![]}];}_0x360902=_['merge']({},_0x360902,_0x22f597['options']);return db[_0xf56f('0x28')][_0xf56f('0x43')](_0x360902)['then'](handleEntityNotFound(_0x114be9,null))[_0xf56f('0x3b')](respondWithResult(_0x114be9,null))['catch'](handleError(_0x114be9,null));};exports[_0xf56f('0x44')]=function(_0x41ed1a,_0x1f5034){return db[_0xf56f('0x28')][_0xf56f('0x44')](_0x41ed1a[_0xf56f('0x45')],{})[_0xf56f('0x3b')](respondWithResult(_0x1f5034,0xc9))[_0xf56f('0x40')](handleError(_0x1f5034,null));};exports[_0xf56f('0x21')]=function(_0x489377,_0x4fd38c){if(_0x489377[_0xf56f('0x45')]['id']){delete _0x489377[_0xf56f('0x45')]['id'];}return db[_0xf56f('0x28')]['find']({'where':{'id':_0x489377['params']['id']}})[_0xf56f('0x3b')](handleEntityNotFound(_0x4fd38c,null))[_0xf56f('0x3b')](saveUpdates(_0x489377[_0xf56f('0x45')],null))[_0xf56f('0x3b')](respondWithResult(_0x4fd38c,null))[_0xf56f('0x40')](handleError(_0x4fd38c,null));};exports[_0xf56f('0x22')]=function(_0x20b6a2,_0x4e5476){return db['VtigerAccount'][_0xf56f('0x43')]({'where':{'id':_0x20b6a2[_0xf56f('0x46')]['id']}})[_0xf56f('0x3b')](handleEntityNotFound(_0x4e5476,null))[_0xf56f('0x3b')](removeEntity(_0x4e5476,null))[_0xf56f('0x40')](handleError(_0x4e5476,null));};exports[_0xf56f('0x47')]=function(_0x403b4a,_0x260757,_0x5782ca){var _0x1a9b51={};var _0x3fd23b={};var _0x301f49;var _0x1781d7;return db[_0xf56f('0x28')]['findOne']({'where':{'id':_0x403b4a[_0xf56f('0x46')]['id']}})['then'](handleEntityNotFound(_0x260757,null))[_0xf56f('0x3b')](function(_0xdf435a){if(_0xdf435a){_0x301f49=_0xdf435a;_0x3fd23b['model']=_[_0xf56f('0x2d')](db[_0xf56f('0x48')][_0xf56f('0x42')]);_0x3fd23b[_0xf56f('0x2c')]=_[_0xf56f('0x2d')](_0x403b4a['query']);_0x3fd23b[_0xf56f('0x2e')]=_[_0xf56f('0x2f')](_0x3fd23b['model'],_0x3fd23b[_0xf56f('0x2c')]);_0x1a9b51[_0xf56f('0x32')]=_['intersection'](_0x3fd23b[_0xf56f('0x30')],qs['fields'](_0x403b4a[_0xf56f('0x2c')][_0xf56f('0x31')]));_0x1a9b51[_0xf56f('0x32')]=_0x1a9b51[_0xf56f('0x32')][_0xf56f('0x33')]?_0x1a9b51['attributes']:_0x3fd23b[_0xf56f('0x30')];_0x1a9b51[_0xf56f('0x49')]=qs[_0xf56f('0x35')](_0x403b4a[_0xf56f('0x2c')][_0xf56f('0x35')]);_0x1a9b51[_0xf56f('0x38')]=qs[_0xf56f('0x2e')](_[_0xf56f('0x36')](_0x403b4a[_0xf56f('0x2c')],_0x3fd23b[_0xf56f('0x2e')]));if(_0x403b4a[_0xf56f('0x2c')]['filter']){_0x1a9b51['where']=_['merge'](_0x1a9b51['where'],{'$or':_[_0xf56f('0x27')](_0x1a9b51[_0xf56f('0x32')],function(_0x4d63a5){var _0x4a3748={};_0x4a3748[_0x4d63a5]={'$like':'%'+_0x403b4a[_0xf56f('0x2c')][_0xf56f('0x37')]+'%'};return _0x4a3748;})});}_0x1a9b51=_[_0xf56f('0x39')]({},_0x1a9b51,_0x403b4a[_0xf56f('0x4a')]);return _0x301f49[_0xf56f('0x47')](_0x1a9b51);}})[_0xf56f('0x3b')](function(_0x4c9664){if(_0x4c9664){_0x1781d7=_0x4c9664[_0xf56f('0x33')];if(!_0x403b4a[_0xf56f('0x2c')][_0xf56f('0x34')]('nolimit')){_0x1a9b51[_0xf56f('0x1a')]=qs[_0xf56f('0x1a')](_0x403b4a[_0xf56f('0x2c')][_0xf56f('0x1a')]);_0x1a9b51['offset']=qs['offset'](_0x403b4a[_0xf56f('0x2c')][_0xf56f('0x1c')]);}return _0x301f49[_0xf56f('0x47')](_0x1a9b51);}})[_0xf56f('0x3b')](function(_0x3e0e5f){if(_0x3e0e5f){return _0x3e0e5f?{'count':_0x1781d7,'rows':_0x3e0e5f}:null;}})[_0xf56f('0x3b')](respondWithResult(_0x260757,null))[_0xf56f('0x40')](handleError(_0x260757,null));};exports[_0xf56f('0x4b')]=function(_0x50fd46,_0x12400d,_0x1f81ef){if(_0x50fd46[_0xf56f('0x45')]['id']){delete _0x50fd46[_0xf56f('0x45')]['id'];}return db[_0xf56f('0x28')][_0xf56f('0x4c')]({'where':{'id':_0x50fd46[_0xf56f('0x46')]['id']}})['then'](handleEntityNotFound(_0x12400d,null))['then'](function(_0x21db49){if(_0x21db49){_0x50fd46['body'][_0xf56f('0x4d')]=_0x21db49['id'];_0x50fd46[_0xf56f('0x45')]['Subjects']=integrations[_0xf56f('0x4e')](_0x50fd46[_0xf56f('0x45')][_0xf56f('0x4f')],_0x50fd46['body'][_0xf56f('0x2a')]);_0x50fd46[_0xf56f('0x45')][_0xf56f('0x50')]=integrations[_0xf56f('0x51')](_0x50fd46['body'][_0xf56f('0x4f')],_0x50fd46[_0xf56f('0x45')][_0xf56f('0x2a')]);return db[_0xf56f('0x48')][_0xf56f('0x44')](_0x50fd46[_0xf56f('0x45')],{'include':[{'model':db[_0xf56f('0x52')],'as':'Subjects'},{'model':db[_0xf56f('0x52')],'as':_0xf56f('0x50')}]});}return null;})[_0xf56f('0x3b')](respondWithResult(_0x12400d,null))['catch'](handleError(_0x12400d,null));};var md5=require(_0xf56f('0x53'));exports[_0xf56f('0x54')]=function(_0x364d97,_0x1bfe5b,_0x5cbda2){var _0x57b6f1=null;var _0x9f2052=null;var _0x494d32=null;var _0x419e01=null;var _0x3ff58f='';return db[_0xf56f('0x28')][_0xf56f('0x4c')]({'where':{'id':_0x364d97[_0xf56f('0x46')]['id']},'attributes':['id',_0xf56f('0x26'),'username',_0xf56f('0x55'),_0xf56f('0x56'),'remoteUri',_0xf56f('0x57'),_0xf56f('0x58')]})[_0xf56f('0x3b')](handleEntityNotFound(_0x1bfe5b,null))['then'](function(_0x2cea5a){if(_0x2cea5a){_0x57b6f1=_0x2cea5a[_0xf56f('0x59')];_0x9f2052=_0x2cea5a[_0xf56f('0x58')];_0x494d32=_0x2cea5a[_0xf56f('0x56')];_0x3ff58f=_0x2cea5a[_0xf56f('0x5a')];var _0x471485=_0x3ff58f[_0xf56f('0x5b')](-0x1);if(_0x471485==='/'){_0x3ff58f=_0x3ff58f[_0xf56f('0x5c')](0x0,_0x3ff58f[_0xf56f('0x5d')](_0x471485));}_0x419e01=util[_0xf56f('0x5e')]('%s/webservice.php',_0x3ff58f);var _0x29affd={'method':'GET','uri':_0x419e01,'qs':{'operation':_0xf56f('0x5f'),'username':_0x2cea5a['username']},'json':!![]};return rp(_0x29affd);}})[_0xf56f('0x3b')](function(_0x1ef8f3){if(_0x1ef8f3['success']){var _0x39c57b={'method':_0xf56f('0x60'),'uri':_0x419e01,'form':{'operation':_0xf56f('0x61'),'username':_0x57b6f1,'accessKey':md5(_0x1ef8f3[_0xf56f('0x62')][_0xf56f('0x63')]+_0x9f2052)},'json':!![]};return rp(_0x39c57b);}})[_0xf56f('0x3b')](function(_0x363afd){if(_0x363afd[_0xf56f('0x64')]){var _0x51c9f7={'method':'GET','uri':_0x419e01,'qs':{'operation':'describe','username':_0x57b6f1,'sessionName':_0x363afd[_0xf56f('0x62')][_0xf56f('0x65')],'elementType':_0x494d32},'json':!![]};return rp(_0x51c9f7);}})[_0xf56f('0x3b')](function(_0x5f377d){if(_0x5f377d[_0xf56f('0x64')]){var _0x4743a3=[_0xf56f('0x66'),_0xf56f('0x67'),_0xf56f('0x68')];_[_0xf56f('0x69')](_0x5f377d[_0xf56f('0x62')]['fields'],function(_0x2bad03){return _0x4743a3['includes'](_0x2bad03[_0xf56f('0x2a')][_0xf56f('0x26')]);});_['remove'](_0x5f377d[_0xf56f('0x62')][_0xf56f('0x31')],function(_0x45e7c6){return _0x45e7c6[_0xf56f('0x6a')]===_0xf56f('0x6b');});return{'count':_0x5f377d[_0xf56f('0x62')][_0xf56f('0x31')]['length'],'rows':_['map'](_0x5f377d['result'][_0xf56f('0x31')],function(_0x428915){return{'id':_0x428915['name'],'name':_0x428915['label'],'custom':_[_0xf56f('0x6c')](_0x428915['name'],'cf_')?!![]:![],'options':_0x428915[_0xf56f('0x2a')][_0xf56f('0x26')]===_0xf56f('0x6d')&&_0x428915[_0xf56f('0x2a')]['picklistValues'][_0xf56f('0x33')]>0x0?_[_0xf56f('0x27')](_0x428915[_0xf56f('0x2a')][_0xf56f('0x6e')],function(_0x48291d){return{'name':_0x48291d['label'],'value':_0x48291d[_0xf56f('0x6f')]};}):[]};})};}})[_0xf56f('0x3b')](respondWithResult(_0x1bfe5b,null))[_0xf56f('0x40')](function(_0x70a6e9){console[_0xf56f('0x70')](_0xf56f('0x71')+_0x70a6e9);var _0x15859a=_0x364d97[_0xf56f('0x2c')][_0xf56f('0x72')]?0x1f4:_0x70a6e9[_0xf56f('0x73')]||0x1f4;logger[_0xf56f('0x24')](_0xf56f('0x74'),'getFields',_0x15859a,JSON[_0xf56f('0x75')](_0x70a6e9));delete _0x70a6e9[_0xf56f('0x26')];if(_0x15859a===0x191){_0x15859a=0x190;}_0x1bfe5b[_0xf56f('0x16')](_0x15859a)['send'](_0x364d97['query'][_0xf56f('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x70a6e9[_0xf56f('0x73')]}:_0x70a6e9);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index b82765d..23fcdb1 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 _0x0541=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x3b9c71,_0x52bd2f){var _0x419087=function(_0x474819){while(--_0x474819){_0x3b9c71['push'](_0x3b9c71['shift']());}};_0x419087(++_0x52bd2f);}(_0x0541,0x1c5));var _0x1054=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x0541[_0x1d930e];return _0x5bbd66;};'use strict';var _=require(_0x1054('0x0'));var util=require(_0x1054('0x1'));var logger=require(_0x1054('0x2'))('api');var moment=require(_0x1054('0x3'));var BPromise=require(_0x1054('0x4'));var rp=require(_0x1054('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1054('0x6'));var attributes=require(_0x1054('0x7'));var integrations=require(_0x1054('0x8'));module[_0x1054('0x9')]=function(_0xdb1f20,_0x12c1d1){return _0xdb1f20[_0x1054('0xa')](_0x1054('0xb'),attributes,{'tableName':_0x1054('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcee4=['util','../../config/logger','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','define','lodash'];(function(_0x56a561,_0x4d6275){var _0x691adf=function(_0x22e733){while(--_0x22e733){_0x56a561['push'](_0x56a561['shift']());}};_0x691adf(++_0x4d6275);}(_0xcee4,0x1af));var _0x4cee=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcee4[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x4cee('0x0'));var util=require(_0x4cee('0x1'));var logger=require(_0x4cee('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4cee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cee('0x4'));var config=require(_0x4cee('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x4cee('0x6'));module['exports']=function(_0x13ced6,_0x17d9e0){return _0x13ced6[_0x4cee('0x7')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index e770438..c926c2d 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 _0x757a=['stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','ShowVtigerAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1b6b5b,_0x596eae){var _0xc2132c=function(_0x2a39a3){while(--_0x2a39a3){_0x1b6b5b['push'](_0x1b6b5b['shift']());}};_0xc2132c(++_0x596eae);}(_0x757a,0xde));var _0xa757=function(_0xc02d1a,_0x7605e7){_0xc02d1a=_0xc02d1a-0x0;var _0x32a4e6=_0x757a[_0xc02d1a];return _0x32a4e6;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetVtigerAccount',_0x4d9f58);logger['debug']('GetVtigerAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetVtigerAccount',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file +var _0x7072=['model','then','ShowVtigerAccount','VtigerAccount','find','map','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','options','raw','where','attributes','limit','include'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7072,0x138));var _0x2707=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7072[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}exports[_0x2707('0x15')]=function(_0x4a8b7f){var _0x119ac4=this;return new Promise(function(_0x449a61,_0x4009f3){return db['VtigerAccount']['findAll']({'raw':_0x4a8b7f['options']?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x19')]||null:null,'limit':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1a')]||null:null,'include':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')]?_['map'](_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')],function(_0x46259e){return{'model':db[_0x46259e[_0x2707('0x1c')]],'as':_0x46259e['as'],'attributes':_0x46259e[_0x2707('0x19')],'include':_0x46259e[_0x2707('0x1b')]?_['map'](_0x46259e[_0x2707('0x1b')],function(_0x3f6976){return{'model':db[_0x3f6976[_0x2707('0x1c')]],'as':_0x3f6976['as'],'attributes':_0x3f6976[_0x2707('0x19')],'include':_0x3f6976[_0x2707('0x1b')]?_['map'](_0x3f6976[_0x2707('0x1b')],function(_0x4ca05d){return{'model':db[_0x4ca05d[_0x2707('0x1c')]],'as':_0x4ca05d['as'],'attributes':_0x4ca05d[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x57da26){logger[_0x2707('0xb')](_0x2707('0x15'),_0x4a8b7f);logger[_0x2707('0xe')]('GetVtigerAccount',_0x4a8b7f,JSON[_0x2707('0x10')](_0x57da26));_0x449a61(_0x57da26);})[_0x2707('0x14')](function(_0x4a99ce){logger[_0x2707('0x11')]('GetVtigerAccount',_0x4a99ce['message'],_0x4a8b7f);_0x4009f3(_0x119ac4[_0x2707('0x11')](0x1f4,_0x4a99ce['message']));});});};exports[_0x2707('0x1e')]=function(_0x3f153d){var _0x417a97=this;return new Promise(function(_0x36b2e9,_0x48832b){return db[_0x2707('0x1f')][_0x2707('0x20')]({'raw':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options'][_0x2707('0x19')]||null:null,'include':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options']['include']?_['map'](_0x3f153d['options']['include'],function(_0x137e04){return{'model':db[_0x137e04['model']],'as':_0x137e04['as'],'attributes':_0x137e04['attributes'],'include':_0x137e04[_0x2707('0x1b')]?_[_0x2707('0x21')](_0x137e04['include'],function(_0x473954){return{'model':db[_0x473954[_0x2707('0x1c')]],'as':_0x473954['as'],'attributes':_0x473954['attributes'],'include':_0x473954['include']?_[_0x2707('0x21')](_0x473954[_0x2707('0x1b')],function(_0x521edb){return{'model':db[_0x521edb['model']],'as':_0x521edb['as'],'attributes':_0x521edb[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x5a18b0){logger[_0x2707('0xb')](_0x2707('0x1e'),_0x3f153d);logger[_0x2707('0xe')](_0x2707('0x1e'),_0x3f153d,JSON[_0x2707('0x10')](_0x5a18b0));_0x36b2e9(_0x5a18b0);})[_0x2707('0x14')](function(_0x5bd2e5){logger[_0x2707('0x11')](_0x2707('0x1e'),_0x5bd2e5[_0x2707('0x13')],_0x3f153d);_0x48832b(_0x417a97[_0x2707('0x11')](0x1f4,_0x5bd2e5[_0x2707('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index c250f5b..198bfda 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 _0x9e60=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','multer'];(function(_0x5cf3a0,_0x1c3438){var _0x29994f=function(_0x551bcd){while(--_0x551bcd){_0x5cf3a0['push'](_0x5cf3a0['shift']());}};_0x29994f(++_0x1c3438);}(_0x9e60,0x179));var _0x09e6=function(_0x8b1369,_0x28de40){_0x8b1369=_0x8b1369-0x0;var _0x1130d0=_0x9e60[_0x8b1369];return _0x1130d0;};'use strict';var multer=require(_0x09e6('0x0'));var util=require('util');var path=require(_0x09e6('0x1'));var timeout=require(_0x09e6('0x2'));var express=require(_0x09e6('0x3'));var router=express[_0x09e6('0x4')]();var fs_extra=require(_0x09e6('0x5'));var auth=require(_0x09e6('0x6'));var interaction=require(_0x09e6('0x7'));var config=require(_0x09e6('0x8'));var controller=require(_0x09e6('0x9'));router[_0x09e6('0xa')]('/',auth[_0x09e6('0xb')](),controller['index']);router[_0x09e6('0xa')](_0x09e6('0xc'),auth[_0x09e6('0xb')](),controller[_0x09e6('0xd')]);router[_0x09e6('0xa')](_0x09e6('0xe'),auth[_0x09e6('0xb')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x09e6('0xf')]);router[_0x09e6('0xa')](_0x09e6('0x10'),auth['isAuthenticated'](),controller[_0x09e6('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x09e6('0x12')](_0x09e6('0xc'),auth[_0x09e6('0xb')](),controller[_0x09e6('0x13')]);router['delete'](_0x09e6('0xc'),auth['isAuthenticated'](),controller[_0x09e6('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdbc9=['show','get','/:id/fields','/:id/subjects','getDescriptions','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','index','/:id'];(function(_0x1bbb7e,_0x4b24ef){var _0x4ea13e=function(_0x4faeb6){while(--_0x4faeb6){_0x1bbb7e['push'](_0x1bbb7e['shift']());}};_0x4ea13e(++_0x4b24ef);}(_0xdbc9,0x1c2));var _0x9dbc=function(_0x52228c,_0x3cae48){_0x52228c=_0x52228c-0x0;var _0x4cf5f4=_0xdbc9[_0x52228c];return _0x4cf5f4;};'use strict';var multer=require(_0x9dbc('0x0'));var util=require(_0x9dbc('0x1'));var path=require(_0x9dbc('0x2'));var timeout=require(_0x9dbc('0x3'));var express=require(_0x9dbc('0x4'));var router=express[_0x9dbc('0x5')]();var fs_extra=require(_0x9dbc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9dbc('0x7'));var config=require('../../config/environment');var controller=require(_0x9dbc('0x8'));router['get']('/',auth[_0x9dbc('0x9')](),controller[_0x9dbc('0xa')]);router['get'](_0x9dbc('0xb'),auth[_0x9dbc('0x9')](),controller[_0x9dbc('0xc')]);router[_0x9dbc('0xd')](_0x9dbc('0xe'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x9dbc('0xf'),auth[_0x9dbc('0x9')](),controller['getSubjects']);router[_0x9dbc('0xd')]('/:id/descriptions',auth[_0x9dbc('0x9')](),controller[_0x9dbc('0x10')]);router[_0x9dbc('0x11')]('/',auth['isAuthenticated'](),controller[_0x9dbc('0x12')]);router[_0x9dbc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x9dbc('0x14')]);router['delete']('/:id',auth[_0x9dbc('0x9')](),controller['destroy']);module[_0x9dbc('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index f5a6e39..b4d6002 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 _0xa455=['STRING','sequelize'];(function(_0x1cff0b,_0x527765){var _0x2a9f84=function(_0x304dec){while(--_0x304dec){_0x1cff0b['push'](_0x1cff0b['shift']());}};_0x2a9f84(++_0x527765);}(_0xa455,0x179));var _0x5a45=function(_0x35cb3d,_0x5da3e6){_0x35cb3d=_0x35cb3d-0x0;var _0xfa694e=_0xa455[_0x35cb3d];return _0xfa694e;};'use strict';var Sequelize=require(_0x5a45('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a45('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7729=['exports','STRING','sequelize'];(function(_0x5eb071,_0x32cc8a){var _0x106c63=function(_0x2e6f82){while(--_0x2e6f82){_0x5eb071['push'](_0x5eb071['shift']());}};_0x106c63(++_0x32cc8a);}(_0x7729,0x1e8));var _0x9772=function(_0x4b3a03,_0x595239){_0x4b3a03=_0x4b3a03-0x0;var _0x2b0bbe=_0x7729[_0x4b3a03];return _0x2b0bbe;};'use strict';var Sequelize=require(_0x9772('0x0'));module[_0x9772('0x1')]={'name':{'type':Sequelize[_0x9772('0x2')]},'description':{'type':Sequelize[_0x9772('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2d97bf5..03cad1e 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 _0xa815=['to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','count','status','set','Content-Range','json','apply','save','update','then','end','error','stack','name','map','VtigerConfiguration','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','keys','includeAll','find','catch','body','destroy','findOne','VtigerField','options','getFields','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x4d2dd5,_0x116a52){var _0x477232=function(_0x29b05b){while(--_0x29b05b){_0x4d2dd5['push'](_0x4d2dd5['shift']());}};_0x477232(++_0x116a52);}(_0xa815,0x17d));var _0x5a81=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xa815[_0x1ae4a9];return _0x54d0b0;};'use strict';var emlformat=require(_0x5a81('0x0'));var rimraf=require(_0x5a81('0x1'));var zipdir=require(_0x5a81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a81('0x3'));var moment=require('moment');var BPromise=require(_0x5a81('0x4'));var Mustache=require(_0x5a81('0x5'));var util=require(_0x5a81('0x6'));var path=require(_0x5a81('0x7'));var sox=require(_0x5a81('0x8'));var csv=require(_0x5a81('0x9'));var ejs=require(_0x5a81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a81('0xb'));var squel=require(_0x5a81('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a81('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5a81('0xe'));var Papa=require(_0x5a81('0xf'));var Redis=require(_0x5a81('0x10'));var authService=require(_0x5a81('0x11'));var qs=require(_0x5a81('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a81('0x13'));var logger=require(_0x5a81('0x14'))(_0x5a81('0x15'));var utils=require('../../config/utils');var config=require(_0x5a81('0x16'));var licenseUtil=require(_0x5a81('0x17'));var db=require(_0x5a81('0x18'))['db'];function respondWithStatusCode(_0x3488a0,_0x390345){_0x390345=_0x390345||0xcc;return function(_0x8b693b){if(_0x8b693b){return _0x3488a0['sendStatus'](_0x390345);}return _0x3488a0['status'](_0x390345)['end']();};}function respondWithResult(_0x4e5220,_0x48e006){_0x48e006=_0x48e006||0xc8;return function(_0x403ca9){if(_0x403ca9){return _0x4e5220['status'](_0x48e006)['json'](_0x403ca9);}};}function respondWithFilteredResult(_0xae5d95,_0x1ea7f2){return function(_0x3c8fc3){if(_0x3c8fc3){var _0x1c4bd0=typeof _0x1ea7f2[_0x5a81('0x19')]==='undefined'&&typeof _0x1ea7f2['limit']===_0x5a81('0x1a');var _0x4ec3dd=_0x3c8fc3[_0x5a81('0x1b')];var _0x483657=_0x1c4bd0?0x0:_0x1ea7f2[_0x5a81('0x19')];var _0x2f0bcb=_0x1c4bd0?_0x3c8fc3[_0x5a81('0x1b')]:_0x1ea7f2[_0x5a81('0x19')]+_0x1ea7f2['limit'];var _0x31e11d;if(_0x2f0bcb>=_0x4ec3dd){_0x2f0bcb=_0x4ec3dd;_0x31e11d=0xc8;}else{_0x31e11d=0xce;}_0xae5d95[_0x5a81('0x1c')](_0x31e11d);return _0xae5d95[_0x5a81('0x1d')](_0x5a81('0x1e'),_0x483657+'-'+_0x2f0bcb+'/'+_0x4ec3dd)[_0x5a81('0x1f')](_0x3c8fc3);}return null;};}function patchUpdates(_0x3ad04e){return function(_0x20e2f9){try{jsonpatch[_0x5a81('0x20')](_0x20e2f9,_0x3ad04e,!![]);}catch(_0x301c56){return BPromise['reject'](_0x301c56);}return _0x20e2f9[_0x5a81('0x21')]();};}function saveUpdates(_0x366fbd,_0x6fac2a){return function(_0x28c609){if(_0x28c609){return _0x28c609[_0x5a81('0x22')](_0x366fbd)[_0x5a81('0x23')](function(_0x50ecdf){return _0x50ecdf;});}return null;};}function removeEntity(_0x3d606e,_0x4975e0){return function(_0x288dde){if(_0x288dde){return _0x288dde['destroy']()['then'](function(){_0x3d606e[_0x5a81('0x1c')](0xcc)[_0x5a81('0x24')]();});}};}function handleEntityNotFound(_0x1120d8,_0x272149){return function(_0x58c68b){if(!_0x58c68b){_0x1120d8['sendStatus'](0x194);}return _0x58c68b;};}function handleError(_0xf5ca83,_0x5f51c3){_0x5f51c3=_0x5f51c3||0x1f4;return function(_0x52ffa6){logger[_0x5a81('0x25')](_0x52ffa6[_0x5a81('0x26')]);if(_0x52ffa6['name']){delete _0x52ffa6[_0x5a81('0x27')];}_0xf5ca83['status'](_0x5f51c3)['send'](_0x52ffa6);};}exports['index']=function(_0x7aad4e,_0xe4f35a){var _0x319192={},_0x1b9567={},_0x799450={'count':0x0,'rows':[]};var _0x143c4d=_[_0x5a81('0x28')](db[_0x5a81('0x29')]['rawAttributes'],function(_0x51ceee){return{'name':_0x51ceee['fieldName'],'type':_0x51ceee[_0x5a81('0x2a')][_0x5a81('0x2b')]};});_0x1b9567[_0x5a81('0x2c')]=_[_0x5a81('0x28')](_0x143c4d,_0x5a81('0x27'));_0x1b9567[_0x5a81('0x2d')]=_['keys'](_0x7aad4e[_0x5a81('0x2d')]);_0x1b9567[_0x5a81('0x2e')]=_[_0x5a81('0x2f')](_0x1b9567[_0x5a81('0x2c')],_0x1b9567[_0x5a81('0x2d')]);_0x319192['attributes']=_[_0x5a81('0x2f')](_0x1b9567[_0x5a81('0x2c')],qs[_0x5a81('0x30')](_0x7aad4e[_0x5a81('0x2d')]['fields']));_0x319192[_0x5a81('0x31')]=_0x319192[_0x5a81('0x31')][_0x5a81('0x32')]?_0x319192[_0x5a81('0x31')]:_0x1b9567[_0x5a81('0x2c')];if(!_0x7aad4e[_0x5a81('0x2d')][_0x5a81('0x33')](_0x5a81('0x34'))){_0x319192['limit']=qs[_0x5a81('0x35')](_0x7aad4e[_0x5a81('0x2d')][_0x5a81('0x35')]);_0x319192['offset']=qs[_0x5a81('0x19')](_0x7aad4e[_0x5a81('0x2d')][_0x5a81('0x19')]);}_0x319192[_0x5a81('0x36')]=qs[_0x5a81('0x37')](_0x7aad4e[_0x5a81('0x2d')][_0x5a81('0x37')]);_0x319192[_0x5a81('0x38')]=qs[_0x5a81('0x2e')](_[_0x5a81('0x39')](_0x7aad4e['query'],_0x1b9567[_0x5a81('0x2e')]),_0x143c4d);if(_0x7aad4e[_0x5a81('0x2d')][_0x5a81('0x3a')]){_0x319192[_0x5a81('0x38')]=_[_0x5a81('0x3b')](_0x319192[_0x5a81('0x38')],{'$or':_[_0x5a81('0x28')](_0x143c4d,function(_0x52fcb4){if(_0x52fcb4[_0x5a81('0x2a')]!==_0x5a81('0x3c')){var _0x2a69ec={};_0x2a69ec[_0x52fcb4[_0x5a81('0x27')]]={'$like':'%'+_0x7aad4e['query'][_0x5a81('0x3a')]+'%'};return _0x2a69ec;}})});}_0x319192=_['merge']({},_0x319192,_0x7aad4e['options']);var _0x133f83={'where':_0x319192[_0x5a81('0x38')]};return db[_0x5a81('0x29')]['count'](_0x133f83)[_0x5a81('0x23')](function(_0x5a29f7){_0x799450[_0x5a81('0x1b')]=_0x5a29f7;if(_0x7aad4e['query']['includeAll']){_0x319192[_0x5a81('0x3d')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x5a81('0x3e')](_0x319192);})[_0x5a81('0x23')](function(_0x4351dd){_0x799450['rows']=_0x4351dd;return _0x799450;})[_0x5a81('0x23')](respondWithFilteredResult(_0xe4f35a,_0x319192))['catch'](handleError(_0xe4f35a,null));};exports[_0x5a81('0x3f')]=function(_0x161ec3,_0x1b0175){var _0x2f7120={'raw':![],'where':{'id':_0x161ec3[_0x5a81('0x40')]['id']}},_0x5de8f5={};_0x5de8f5['model']=_[_0x5a81('0x41')](db[_0x5a81('0x29')]['rawAttributes']);_0x5de8f5[_0x5a81('0x2d')]=_[_0x5a81('0x41')](_0x161ec3[_0x5a81('0x2d')]);_0x5de8f5[_0x5a81('0x2e')]=_['intersection'](_0x5de8f5[_0x5a81('0x2c')],_0x5de8f5[_0x5a81('0x2d')]);_0x2f7120['attributes']=_[_0x5a81('0x2f')](_0x5de8f5['model'],qs['fields'](_0x161ec3[_0x5a81('0x2d')][_0x5a81('0x30')]));_0x2f7120[_0x5a81('0x31')]=_0x2f7120[_0x5a81('0x31')]['length']?_0x2f7120[_0x5a81('0x31')]:_0x5de8f5[_0x5a81('0x2c')];if(_0x161ec3[_0x5a81('0x2d')][_0x5a81('0x42')]){_0x2f7120[_0x5a81('0x3d')]=[{'all':!![]}];}_0x2f7120=_[_0x5a81('0x3b')]({},_0x2f7120,_0x161ec3['options']);return db[_0x5a81('0x29')][_0x5a81('0x43')](_0x2f7120)[_0x5a81('0x23')](handleEntityNotFound(_0x1b0175,null))['then'](respondWithResult(_0x1b0175,null))[_0x5a81('0x44')](handleError(_0x1b0175,null));};exports['create']=function(_0x254999,_0x11969c){return db[_0x5a81('0x29')]['create'](_0x254999['body'],{})[_0x5a81('0x23')](respondWithResult(_0x11969c,0xc9))[_0x5a81('0x44')](handleError(_0x11969c,null));};exports[_0x5a81('0x22')]=function(_0x2f1247,_0x4ddf97){if(_0x2f1247['body']['id']){delete _0x2f1247[_0x5a81('0x45')]['id'];}return db['VtigerConfiguration'][_0x5a81('0x43')]({'where':{'id':_0x2f1247['params']['id']}})[_0x5a81('0x23')](handleEntityNotFound(_0x4ddf97,null))[_0x5a81('0x23')](saveUpdates(_0x2f1247[_0x5a81('0x45')],null))[_0x5a81('0x23')](respondWithResult(_0x4ddf97,null))[_0x5a81('0x44')](handleError(_0x4ddf97,null));};exports[_0x5a81('0x46')]=function(_0x25f04d,_0x2153b4){return db['VtigerConfiguration'][_0x5a81('0x43')]({'where':{'id':_0x25f04d[_0x5a81('0x40')]['id']}})[_0x5a81('0x23')](handleEntityNotFound(_0x2153b4,null))[_0x5a81('0x23')](removeEntity(_0x2153b4,null))['catch'](handleError(_0x2153b4,null));};exports['getFields']=function(_0x53ff85,_0xba9f43,_0x16dc93){var _0x5b8d3f={};var _0x274ab8={};var _0xd78a73;var _0x18ebaf;return db[_0x5a81('0x29')][_0x5a81('0x47')]({'where':{'id':_0x53ff85[_0x5a81('0x40')]['id']}})[_0x5a81('0x23')](handleEntityNotFound(_0xba9f43,null))[_0x5a81('0x23')](function(_0x525ac4){if(_0x525ac4){_0xd78a73=_0x525ac4;_0x274ab8[_0x5a81('0x2c')]=_['keys'](db[_0x5a81('0x48')]['rawAttributes']);_0x274ab8[_0x5a81('0x2d')]=_[_0x5a81('0x41')](_0x53ff85[_0x5a81('0x2d')]);_0x274ab8[_0x5a81('0x2e')]=_['intersection'](_0x274ab8['model'],_0x274ab8[_0x5a81('0x2d')]);_0x5b8d3f['attributes']=_[_0x5a81('0x2f')](_0x274ab8[_0x5a81('0x2c')],qs[_0x5a81('0x30')](_0x53ff85[_0x5a81('0x2d')][_0x5a81('0x30')]));_0x5b8d3f[_0x5a81('0x31')]=_0x5b8d3f[_0x5a81('0x31')][_0x5a81('0x32')]?_0x5b8d3f['attributes']:_0x274ab8[_0x5a81('0x2c')];_0x5b8d3f[_0x5a81('0x36')]=qs[_0x5a81('0x37')](_0x53ff85[_0x5a81('0x2d')][_0x5a81('0x37')]);_0x5b8d3f[_0x5a81('0x38')]=qs[_0x5a81('0x2e')](_[_0x5a81('0x39')](_0x53ff85[_0x5a81('0x2d')],_0x274ab8[_0x5a81('0x2e')]));if(_0x53ff85['query'][_0x5a81('0x3a')]){_0x5b8d3f[_0x5a81('0x38')]=_[_0x5a81('0x3b')](_0x5b8d3f[_0x5a81('0x38')],{'$or':_['map'](_0x5b8d3f[_0x5a81('0x31')],function(_0xeb4e30){var _0x11b7f4={};_0x11b7f4[_0xeb4e30]={'$like':'%'+_0x53ff85['query'][_0x5a81('0x3a')]+'%'};return _0x11b7f4;})});}_0x5b8d3f=_[_0x5a81('0x3b')]({},_0x5b8d3f,_0x53ff85[_0x5a81('0x49')]);return _0xd78a73[_0x5a81('0x4a')](_0x5b8d3f);}})[_0x5a81('0x23')](function(_0x45ed7c){if(_0x45ed7c){_0x18ebaf=_0x45ed7c[_0x5a81('0x32')];if(!_0x53ff85['query'][_0x5a81('0x33')]('nolimit')){_0x5b8d3f['limit']=qs[_0x5a81('0x35')](_0x53ff85[_0x5a81('0x2d')][_0x5a81('0x35')]);_0x5b8d3f[_0x5a81('0x19')]=qs[_0x5a81('0x19')](_0x53ff85[_0x5a81('0x2d')][_0x5a81('0x19')]);}return _0xd78a73[_0x5a81('0x4a')](_0x5b8d3f);}})[_0x5a81('0x23')](function(_0x34adb9){if(_0x34adb9){return _0x34adb9?{'count':_0x18ebaf,'rows':_0x34adb9}:null;}})[_0x5a81('0x23')](respondWithResult(_0xba9f43,null))[_0x5a81('0x44')](handleError(_0xba9f43,null));};exports['getSubjects']=function(_0x2cddd0,_0xe1c88b,_0x17b4c7){var _0x3fe263={};var _0x3088a6={};var _0x3bdfc3;var _0x209d97;return db[_0x5a81('0x29')][_0x5a81('0x47')]({'where':{'id':_0x2cddd0[_0x5a81('0x40')]['id']}})[_0x5a81('0x23')](handleEntityNotFound(_0xe1c88b,null))[_0x5a81('0x23')](function(_0x5a425b){if(_0x5a425b){_0x3bdfc3=_0x5a425b;_0x3088a6[_0x5a81('0x2c')]=_[_0x5a81('0x41')](db['VtigerField'][_0x5a81('0x4b')]);_0x3088a6[_0x5a81('0x2d')]=_[_0x5a81('0x41')](_0x2cddd0[_0x5a81('0x2d')]);_0x3088a6[_0x5a81('0x2e')]=_[_0x5a81('0x2f')](_0x3088a6['model'],_0x3088a6[_0x5a81('0x2d')]);_0x3fe263[_0x5a81('0x31')]=_[_0x5a81('0x2f')](_0x3088a6[_0x5a81('0x2c')],qs['fields'](_0x2cddd0['query'][_0x5a81('0x30')]));_0x3fe263[_0x5a81('0x31')]=_0x3fe263[_0x5a81('0x31')][_0x5a81('0x32')]?_0x3fe263['attributes']:_0x3088a6[_0x5a81('0x2c')];_0x3fe263[_0x5a81('0x36')]=qs['sort'](_0x2cddd0[_0x5a81('0x2d')][_0x5a81('0x37')]);_0x3fe263[_0x5a81('0x38')]=qs[_0x5a81('0x2e')](_[_0x5a81('0x39')](_0x2cddd0[_0x5a81('0x2d')],_0x3088a6[_0x5a81('0x2e')]));if(_0x2cddd0[_0x5a81('0x2d')][_0x5a81('0x3a')]){_0x3fe263[_0x5a81('0x38')]=_[_0x5a81('0x3b')](_0x3fe263[_0x5a81('0x38')],{'$or':_[_0x5a81('0x28')](_0x3fe263['attributes'],function(_0x1dcec0){var _0xb5c98c={};_0xb5c98c[_0x1dcec0]={'$like':'%'+_0x2cddd0['query'][_0x5a81('0x3a')]+'%'};return _0xb5c98c;})});}_0x3fe263=_[_0x5a81('0x3b')]({},_0x3fe263,_0x2cddd0[_0x5a81('0x49')]);return _0x3bdfc3[_0x5a81('0x4c')](_0x3fe263);}})[_0x5a81('0x23')](function(_0x2bea43){if(_0x2bea43){_0x209d97=_0x2bea43['length'];if(!_0x2cddd0['query'][_0x5a81('0x33')](_0x5a81('0x34'))){_0x3fe263[_0x5a81('0x35')]=qs[_0x5a81('0x35')](_0x2cddd0[_0x5a81('0x2d')][_0x5a81('0x35')]);_0x3fe263[_0x5a81('0x19')]=qs[_0x5a81('0x19')](_0x2cddd0[_0x5a81('0x2d')][_0x5a81('0x19')]);}return _0x3bdfc3[_0x5a81('0x4c')](_0x3fe263);}})['then'](function(_0x30ff5f){if(_0x30ff5f){return _0x30ff5f?{'count':_0x209d97,'rows':_0x30ff5f}:null;}})[_0x5a81('0x23')](respondWithResult(_0xe1c88b,null))[_0x5a81('0x44')](handleError(_0xe1c88b,null));};exports[_0x5a81('0x4d')]=function(_0x449593,_0x23dd0e,_0x6a691){var _0x24d1ea={};var _0x5e5964={};var _0x1bc509;var _0x1fb5d4;return db['VtigerConfiguration'][_0x5a81('0x47')]({'where':{'id':_0x449593[_0x5a81('0x40')]['id']}})[_0x5a81('0x23')](handleEntityNotFound(_0x23dd0e,null))[_0x5a81('0x23')](function(_0x2964a1){if(_0x2964a1){_0x1bc509=_0x2964a1;_0x5e5964[_0x5a81('0x2c')]=_[_0x5a81('0x41')](db['VtigerField'][_0x5a81('0x4b')]);_0x5e5964[_0x5a81('0x2d')]=_[_0x5a81('0x41')](_0x449593[_0x5a81('0x2d')]);_0x5e5964[_0x5a81('0x2e')]=_[_0x5a81('0x2f')](_0x5e5964[_0x5a81('0x2c')],_0x5e5964['query']);_0x24d1ea[_0x5a81('0x31')]=_[_0x5a81('0x2f')](_0x5e5964[_0x5a81('0x2c')],qs['fields'](_0x449593['query']['fields']));_0x24d1ea['attributes']=_0x24d1ea[_0x5a81('0x31')][_0x5a81('0x32')]?_0x24d1ea['attributes']:_0x5e5964[_0x5a81('0x2c')];_0x24d1ea['order']=qs[_0x5a81('0x37')](_0x449593['query'][_0x5a81('0x37')]);_0x24d1ea[_0x5a81('0x38')]=qs[_0x5a81('0x2e')](_[_0x5a81('0x39')](_0x449593[_0x5a81('0x2d')],_0x5e5964[_0x5a81('0x2e')]));if(_0x449593[_0x5a81('0x2d')][_0x5a81('0x3a')]){_0x24d1ea[_0x5a81('0x38')]=_[_0x5a81('0x3b')](_0x24d1ea[_0x5a81('0x38')],{'$or':_[_0x5a81('0x28')](_0x24d1ea['attributes'],function(_0x470d61){var _0x3112ae={};_0x3112ae[_0x470d61]={'$like':'%'+_0x449593['query'][_0x5a81('0x3a')]+'%'};return _0x3112ae;})});}_0x24d1ea=_[_0x5a81('0x3b')]({},_0x24d1ea,_0x449593[_0x5a81('0x49')]);return _0x1bc509[_0x5a81('0x4d')](_0x24d1ea);}})['then'](function(_0x42f3f3){if(_0x42f3f3){_0x1fb5d4=_0x42f3f3[_0x5a81('0x32')];if(!_0x449593[_0x5a81('0x2d')]['hasOwnProperty'](_0x5a81('0x34'))){_0x24d1ea[_0x5a81('0x35')]=qs[_0x5a81('0x35')](_0x449593[_0x5a81('0x2d')][_0x5a81('0x35')]);_0x24d1ea[_0x5a81('0x19')]=qs[_0x5a81('0x19')](_0x449593[_0x5a81('0x2d')][_0x5a81('0x19')]);}return _0x1bc509[_0x5a81('0x4d')](_0x24d1ea);}})[_0x5a81('0x23')](function(_0x20c458){if(_0x20c458){return _0x20c458?{'count':_0x1fb5d4,'rows':_0x20c458}:null;}})[_0x5a81('0x23')](respondWithResult(_0x23dd0e,null))['catch'](handleError(_0x23dd0e,null));}; \ No newline at end of file +var _0x732c=['getDescriptions','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','VtigerConfiguration','findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','pick','getSubjects'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0x732c,0x151));var _0xc732=function(_0x1737d7,_0x2d273e){_0x1737d7=_0x1737d7-0x0;var _0x474418=_0x732c[_0x1737d7];return _0x474418;};'use strict';var emlformat=require(_0xc732('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc732('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc732('0x2'));var moment=require('moment');var BPromise=require(_0xc732('0x3'));var Mustache=require(_0xc732('0x4'));var util=require('util');var path=require(_0xc732('0x5'));var sox=require(_0xc732('0x6'));var csv=require(_0xc732('0x7'));var ejs=require(_0xc732('0x8'));var fs=require('fs');var fs_extra=require(_0xc732('0x9'));var _=require(_0xc732('0xa'));var squel=require('squel');var crypto=require(_0xc732('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc732('0xc'));var toCsv=require(_0xc732('0x7'));var querystring=require(_0xc732('0xd'));var Papa=require(_0xc732('0xe'));var Redis=require(_0xc732('0xf'));var authService=require(_0xc732('0x10'));var qs=require(_0xc732('0x11'));var as=require(_0xc732('0x12'));var hardwareService=require(_0xc732('0x13'));var logger=require(_0xc732('0x14'))(_0xc732('0x15'));var utils=require(_0xc732('0x16'));var config=require(_0xc732('0x17'));var licenseUtil=require(_0xc732('0x18'));var db=require(_0xc732('0x19'))['db'];function respondWithStatusCode(_0xe32b56,_0x550b46){_0x550b46=_0x550b46||0xcc;return function(_0x1cc00b){if(_0x1cc00b){return _0xe32b56[_0xc732('0x1a')](_0x550b46);}return _0xe32b56[_0xc732('0x1b')](_0x550b46)['end']();};}function respondWithResult(_0xab6e7,_0x2eefa2){_0x2eefa2=_0x2eefa2||0xc8;return function(_0x5f29e9){if(_0x5f29e9){return _0xab6e7[_0xc732('0x1b')](_0x2eefa2)['json'](_0x5f29e9);}};}function respondWithFilteredResult(_0x11e601,_0x137d8e){return function(_0x372159){if(_0x372159){var _0x254d20=typeof _0x137d8e['offset']===_0xc732('0x1c')&&typeof _0x137d8e[_0xc732('0x1d')]===_0xc732('0x1c');var _0x3624af=_0x372159[_0xc732('0x1e')];var _0x349903=_0x254d20?0x0:_0x137d8e['offset'];var _0x58922d=_0x254d20?_0x372159['count']:_0x137d8e[_0xc732('0x1f')]+_0x137d8e['limit'];var _0x59755c;if(_0x58922d>=_0x3624af){_0x58922d=_0x3624af;_0x59755c=0xc8;}else{_0x59755c=0xce;}_0x11e601[_0xc732('0x1b')](_0x59755c);return _0x11e601[_0xc732('0x20')](_0xc732('0x21'),_0x349903+'-'+_0x58922d+'/'+_0x3624af)[_0xc732('0x22')](_0x372159);}return null;};}function patchUpdates(_0x5d9146){return function(_0x1881cd){try{jsonpatch[_0xc732('0x23')](_0x1881cd,_0x5d9146,!![]);}catch(_0x5c1d6b){return BPromise['reject'](_0x5c1d6b);}return _0x1881cd[_0xc732('0x24')]();};}function saveUpdates(_0x5b4428,_0x55030c){return function(_0x3326ca){if(_0x3326ca){return _0x3326ca[_0xc732('0x25')](_0x5b4428)[_0xc732('0x26')](function(_0x48cf2e){return _0x48cf2e;});}return null;};}function removeEntity(_0x35cf02,_0x51e736){return function(_0x3f7583){if(_0x3f7583){return _0x3f7583[_0xc732('0x27')]()['then'](function(){_0x35cf02['status'](0xcc)[_0xc732('0x28')]();});}};}function handleEntityNotFound(_0x4e0d75,_0x3f07bb){return function(_0x3a1eb1){if(!_0x3a1eb1){_0x4e0d75[_0xc732('0x1a')](0x194);}return _0x3a1eb1;};}function handleError(_0x21c2b6,_0x122aeb){_0x122aeb=_0x122aeb||0x1f4;return function(_0x28ea31){logger[_0xc732('0x29')](_0x28ea31[_0xc732('0x2a')]);if(_0x28ea31[_0xc732('0x2b')]){delete _0x28ea31[_0xc732('0x2b')];}_0x21c2b6[_0xc732('0x1b')](_0x122aeb)[_0xc732('0x2c')](_0x28ea31);};}exports[_0xc732('0x2d')]=function(_0x1449d1,_0x12ff37){var _0x18eac9={},_0x53f493={},_0x73b26f={'count':0x0,'rows':[]};var _0x1e22a4=_[_0xc732('0x2e')](db['VtigerConfiguration'][_0xc732('0x2f')],function(_0x19088a){return{'name':_0x19088a[_0xc732('0x30')],'type':_0x19088a[_0xc732('0x31')][_0xc732('0x32')]};});_0x53f493['model']=_[_0xc732('0x2e')](_0x1e22a4,_0xc732('0x2b'));_0x53f493[_0xc732('0x33')]=_[_0xc732('0x34')](_0x1449d1[_0xc732('0x33')]);_0x53f493['filters']=_[_0xc732('0x35')](_0x53f493[_0xc732('0x36')],_0x53f493[_0xc732('0x33')]);_0x18eac9[_0xc732('0x37')]=_[_0xc732('0x35')](_0x53f493[_0xc732('0x36')],qs[_0xc732('0x38')](_0x1449d1[_0xc732('0x33')]['fields']));_0x18eac9[_0xc732('0x37')]=_0x18eac9[_0xc732('0x37')][_0xc732('0x39')]?_0x18eac9[_0xc732('0x37')]:_0x53f493[_0xc732('0x36')];if(!_0x1449d1['query'][_0xc732('0x3a')](_0xc732('0x3b'))){_0x18eac9[_0xc732('0x1d')]=qs[_0xc732('0x1d')](_0x1449d1[_0xc732('0x33')][_0xc732('0x1d')]);_0x18eac9[_0xc732('0x1f')]=qs[_0xc732('0x1f')](_0x1449d1[_0xc732('0x33')][_0xc732('0x1f')]);}_0x18eac9[_0xc732('0x3c')]=qs['sort'](_0x1449d1[_0xc732('0x33')][_0xc732('0x3d')]);_0x18eac9[_0xc732('0x3e')]=qs[_0xc732('0x3f')](_['pick'](_0x1449d1[_0xc732('0x33')],_0x53f493['filters']),_0x1e22a4);if(_0x1449d1[_0xc732('0x33')][_0xc732('0x40')]){_0x18eac9[_0xc732('0x3e')]=_[_0xc732('0x41')](_0x18eac9['where'],{'$or':_[_0xc732('0x2e')](_0x1e22a4,function(_0x571ede){if(_0x571ede[_0xc732('0x31')]!==_0xc732('0x42')){var _0x4772e3={};_0x4772e3[_0x571ede[_0xc732('0x2b')]]={'$like':'%'+_0x1449d1[_0xc732('0x33')][_0xc732('0x40')]+'%'};return _0x4772e3;}})});}_0x18eac9=_[_0xc732('0x41')]({},_0x18eac9,_0x1449d1[_0xc732('0x43')]);var _0x29a816={'where':_0x18eac9[_0xc732('0x3e')]};return db['VtigerConfiguration'][_0xc732('0x1e')](_0x29a816)[_0xc732('0x26')](function(_0x16fe8a){_0x73b26f[_0xc732('0x1e')]=_0x16fe8a;if(_0x1449d1['query']['includeAll']){_0x18eac9[_0xc732('0x44')]=[{'all':!![]}];}return db[_0xc732('0x45')][_0xc732('0x46')](_0x18eac9);})['then'](function(_0x2950ee){_0x73b26f[_0xc732('0x47')]=_0x2950ee;return _0x73b26f;})[_0xc732('0x26')](respondWithFilteredResult(_0x12ff37,_0x18eac9))[_0xc732('0x48')](handleError(_0x12ff37,null));};exports[_0xc732('0x49')]=function(_0x22d995,_0x1fe223){var _0x431e68={'raw':![],'where':{'id':_0x22d995[_0xc732('0x4a')]['id']}},_0x50b02a={};_0x50b02a[_0xc732('0x36')]=_[_0xc732('0x34')](db[_0xc732('0x45')][_0xc732('0x2f')]);_0x50b02a[_0xc732('0x33')]=_[_0xc732('0x34')](_0x22d995[_0xc732('0x33')]);_0x50b02a[_0xc732('0x3f')]=_[_0xc732('0x35')](_0x50b02a[_0xc732('0x36')],_0x50b02a[_0xc732('0x33')]);_0x431e68['attributes']=_[_0xc732('0x35')](_0x50b02a[_0xc732('0x36')],qs[_0xc732('0x38')](_0x22d995['query'][_0xc732('0x38')]));_0x431e68[_0xc732('0x37')]=_0x431e68[_0xc732('0x37')][_0xc732('0x39')]?_0x431e68[_0xc732('0x37')]:_0x50b02a[_0xc732('0x36')];if(_0x22d995[_0xc732('0x33')]['includeAll']){_0x431e68['include']=[{'all':!![]}];}_0x431e68=_['merge']({},_0x431e68,_0x22d995['options']);return db[_0xc732('0x45')][_0xc732('0x4b')](_0x431e68)[_0xc732('0x26')](handleEntityNotFound(_0x1fe223,null))['then'](respondWithResult(_0x1fe223,null))[_0xc732('0x48')](handleError(_0x1fe223,null));};exports[_0xc732('0x4c')]=function(_0x20b8a9,_0x58bf6d){return db[_0xc732('0x45')][_0xc732('0x4c')](_0x20b8a9[_0xc732('0x4d')],{})['then'](respondWithResult(_0x58bf6d,0xc9))[_0xc732('0x48')](handleError(_0x58bf6d,null));};exports['update']=function(_0x5c74a2,_0x5e9e4d){if(_0x5c74a2[_0xc732('0x4d')]['id']){delete _0x5c74a2[_0xc732('0x4d')]['id'];}return db[_0xc732('0x45')]['find']({'where':{'id':_0x5c74a2[_0xc732('0x4a')]['id']}})[_0xc732('0x26')](handleEntityNotFound(_0x5e9e4d,null))[_0xc732('0x26')](saveUpdates(_0x5c74a2[_0xc732('0x4d')],null))[_0xc732('0x26')](respondWithResult(_0x5e9e4d,null))[_0xc732('0x48')](handleError(_0x5e9e4d,null));};exports[_0xc732('0x27')]=function(_0x5ded73,_0x1c5230){return db[_0xc732('0x45')][_0xc732('0x4b')]({'where':{'id':_0x5ded73['params']['id']}})[_0xc732('0x26')](handleEntityNotFound(_0x1c5230,null))[_0xc732('0x26')](removeEntity(_0x1c5230,null))['catch'](handleError(_0x1c5230,null));};exports[_0xc732('0x4e')]=function(_0x3d1b4c,_0x25bc41,_0x3ae4b8){var _0x48e14d={};var _0xbae137={};var _0x126b17;var _0x21b35e;return db[_0xc732('0x45')][_0xc732('0x4f')]({'where':{'id':_0x3d1b4c[_0xc732('0x4a')]['id']}})[_0xc732('0x26')](handleEntityNotFound(_0x25bc41,null))[_0xc732('0x26')](function(_0x32b152){if(_0x32b152){_0x126b17=_0x32b152;_0xbae137[_0xc732('0x36')]=_[_0xc732('0x34')](db[_0xc732('0x50')][_0xc732('0x2f')]);_0xbae137[_0xc732('0x33')]=_[_0xc732('0x34')](_0x3d1b4c[_0xc732('0x33')]);_0xbae137[_0xc732('0x3f')]=_['intersection'](_0xbae137['model'],_0xbae137[_0xc732('0x33')]);_0x48e14d['attributes']=_['intersection'](_0xbae137[_0xc732('0x36')],qs[_0xc732('0x38')](_0x3d1b4c[_0xc732('0x33')]['fields']));_0x48e14d[_0xc732('0x37')]=_0x48e14d['attributes'][_0xc732('0x39')]?_0x48e14d[_0xc732('0x37')]:_0xbae137['model'];_0x48e14d[_0xc732('0x3c')]=qs['sort'](_0x3d1b4c['query'][_0xc732('0x3d')]);_0x48e14d[_0xc732('0x3e')]=qs['filters'](_[_0xc732('0x51')](_0x3d1b4c[_0xc732('0x33')],_0xbae137['filters']));if(_0x3d1b4c['query'][_0xc732('0x40')]){_0x48e14d[_0xc732('0x3e')]=_[_0xc732('0x41')](_0x48e14d[_0xc732('0x3e')],{'$or':_[_0xc732('0x2e')](_0x48e14d[_0xc732('0x37')],function(_0x145be6){var _0x447afd={};_0x447afd[_0x145be6]={'$like':'%'+_0x3d1b4c['query']['filter']+'%'};return _0x447afd;})});}_0x48e14d=_[_0xc732('0x41')]({},_0x48e14d,_0x3d1b4c[_0xc732('0x43')]);return _0x126b17[_0xc732('0x4e')](_0x48e14d);}})[_0xc732('0x26')](function(_0x105c0c){if(_0x105c0c){_0x21b35e=_0x105c0c[_0xc732('0x39')];if(!_0x3d1b4c[_0xc732('0x33')][_0xc732('0x3a')]('nolimit')){_0x48e14d[_0xc732('0x1d')]=qs[_0xc732('0x1d')](_0x3d1b4c[_0xc732('0x33')][_0xc732('0x1d')]);_0x48e14d['offset']=qs['offset'](_0x3d1b4c[_0xc732('0x33')][_0xc732('0x1f')]);}return _0x126b17[_0xc732('0x4e')](_0x48e14d);}})[_0xc732('0x26')](function(_0x33759b){if(_0x33759b){return _0x33759b?{'count':_0x21b35e,'rows':_0x33759b}:null;}})['then'](respondWithResult(_0x25bc41,null))[_0xc732('0x48')](handleError(_0x25bc41,null));};exports['getSubjects']=function(_0x337844,_0x2a4b68,_0x33025e){var _0xc22e6b={};var _0x265009={};var _0x4b5a78;var _0x53ff87;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x337844['params']['id']}})[_0xc732('0x26')](handleEntityNotFound(_0x2a4b68,null))[_0xc732('0x26')](function(_0x2502c4){if(_0x2502c4){_0x4b5a78=_0x2502c4;_0x265009[_0xc732('0x36')]=_['keys'](db[_0xc732('0x50')][_0xc732('0x2f')]);_0x265009[_0xc732('0x33')]=_[_0xc732('0x34')](_0x337844[_0xc732('0x33')]);_0x265009[_0xc732('0x3f')]=_[_0xc732('0x35')](_0x265009['model'],_0x265009['query']);_0xc22e6b[_0xc732('0x37')]=_[_0xc732('0x35')](_0x265009[_0xc732('0x36')],qs['fields'](_0x337844[_0xc732('0x33')][_0xc732('0x38')]));_0xc22e6b['attributes']=_0xc22e6b['attributes'][_0xc732('0x39')]?_0xc22e6b[_0xc732('0x37')]:_0x265009[_0xc732('0x36')];_0xc22e6b[_0xc732('0x3c')]=qs[_0xc732('0x3d')](_0x337844[_0xc732('0x33')][_0xc732('0x3d')]);_0xc22e6b['where']=qs[_0xc732('0x3f')](_['pick'](_0x337844[_0xc732('0x33')],_0x265009[_0xc732('0x3f')]));if(_0x337844[_0xc732('0x33')][_0xc732('0x40')]){_0xc22e6b['where']=_[_0xc732('0x41')](_0xc22e6b[_0xc732('0x3e')],{'$or':_[_0xc732('0x2e')](_0xc22e6b['attributes'],function(_0x4fb99b){var _0x2e8f62={};_0x2e8f62[_0x4fb99b]={'$like':'%'+_0x337844['query'][_0xc732('0x40')]+'%'};return _0x2e8f62;})});}_0xc22e6b=_[_0xc732('0x41')]({},_0xc22e6b,_0x337844['options']);return _0x4b5a78[_0xc732('0x52')](_0xc22e6b);}})[_0xc732('0x26')](function(_0x284c77){if(_0x284c77){_0x53ff87=_0x284c77['length'];if(!_0x337844['query'][_0xc732('0x3a')]('nolimit')){_0xc22e6b[_0xc732('0x1d')]=qs[_0xc732('0x1d')](_0x337844[_0xc732('0x33')][_0xc732('0x1d')]);_0xc22e6b[_0xc732('0x1f')]=qs[_0xc732('0x1f')](_0x337844[_0xc732('0x33')][_0xc732('0x1f')]);}return _0x4b5a78[_0xc732('0x52')](_0xc22e6b);}})[_0xc732('0x26')](function(_0x844a69){if(_0x844a69){return _0x844a69?{'count':_0x53ff87,'rows':_0x844a69}:null;}})[_0xc732('0x26')](respondWithResult(_0x2a4b68,null))[_0xc732('0x48')](handleError(_0x2a4b68,null));};exports[_0xc732('0x53')]=function(_0x23ab12,_0x52ef34,_0x54580f){var _0x135161={};var _0x52b5e7={};var _0x2b5308;var _0x17af0f;return db[_0xc732('0x45')][_0xc732('0x4f')]({'where':{'id':_0x23ab12[_0xc732('0x4a')]['id']}})[_0xc732('0x26')](handleEntityNotFound(_0x52ef34,null))[_0xc732('0x26')](function(_0x38e163){if(_0x38e163){_0x2b5308=_0x38e163;_0x52b5e7[_0xc732('0x36')]=_[_0xc732('0x34')](db[_0xc732('0x50')][_0xc732('0x2f')]);_0x52b5e7[_0xc732('0x33')]=_[_0xc732('0x34')](_0x23ab12['query']);_0x52b5e7[_0xc732('0x3f')]=_[_0xc732('0x35')](_0x52b5e7[_0xc732('0x36')],_0x52b5e7[_0xc732('0x33')]);_0x135161[_0xc732('0x37')]=_[_0xc732('0x35')](_0x52b5e7[_0xc732('0x36')],qs['fields'](_0x23ab12[_0xc732('0x33')][_0xc732('0x38')]));_0x135161['attributes']=_0x135161['attributes'][_0xc732('0x39')]?_0x135161[_0xc732('0x37')]:_0x52b5e7[_0xc732('0x36')];_0x135161['order']=qs[_0xc732('0x3d')](_0x23ab12[_0xc732('0x33')][_0xc732('0x3d')]);_0x135161['where']=qs[_0xc732('0x3f')](_[_0xc732('0x51')](_0x23ab12[_0xc732('0x33')],_0x52b5e7[_0xc732('0x3f')]));if(_0x23ab12['query']['filter']){_0x135161[_0xc732('0x3e')]=_[_0xc732('0x41')](_0x135161['where'],{'$or':_[_0xc732('0x2e')](_0x135161[_0xc732('0x37')],function(_0x38cfd7){var _0x213689={};_0x213689[_0x38cfd7]={'$like':'%'+_0x23ab12[_0xc732('0x33')][_0xc732('0x40')]+'%'};return _0x213689;})});}_0x135161=_[_0xc732('0x41')]({},_0x135161,_0x23ab12[_0xc732('0x43')]);return _0x2b5308[_0xc732('0x53')](_0x135161);}})[_0xc732('0x26')](function(_0x2d224d){if(_0x2d224d){_0x17af0f=_0x2d224d['length'];if(!_0x23ab12[_0xc732('0x33')][_0xc732('0x3a')]('nolimit')){_0x135161['limit']=qs[_0xc732('0x1d')](_0x23ab12[_0xc732('0x33')][_0xc732('0x1d')]);_0x135161[_0xc732('0x1f')]=qs[_0xc732('0x1f')](_0x23ab12['query'][_0xc732('0x1f')]);}return _0x2b5308[_0xc732('0x53')](_0x135161);}})['then'](function(_0x27e8f2){if(_0x27e8f2){return _0x27e8f2?{'count':_0x17af0f,'rows':_0x27e8f2}:null;}})[_0xc732('0x26')](respondWithResult(_0x52ef34,null))[_0xc732('0x48')](handleError(_0x52ef34,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index f6b3390..f5a8023 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 _0x35d2=['api','moment','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x58ce32,_0x13053a){var _0x4b2990=function(_0x12c49a){while(--_0x12c49a){_0x58ce32['push'](_0x58ce32['shift']());}};_0x4b2990(++_0x13053a);}(_0x35d2,0xbd));var _0x235d=function(_0x2d6545,_0xb2dec7){_0x2d6545=_0x2d6545-0x0;var _0x2c5402=_0x35d2[_0x2d6545];return _0x2c5402;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x235d('0x0'));var moment=require(_0x235d('0x1'));var BPromise=require('bluebird');var rp=require(_0x235d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x235d('0x3'));var config=require(_0x235d('0x4'));var attributes=require(_0x235d('0x5'));module['exports']=function(_0xfa6e74,_0x55252b){return _0xfa6e74[_0x235d('0x6')](_0x235d('0x7'),attributes,{'tableName':_0x235d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x751d=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4bad13,_0x1c576b){var _0x3789e4=function(_0x45d9c2){while(--_0x45d9c2){_0x4bad13['push'](_0x4bad13['shift']());}};_0x3789e4(++_0x1c576b);}(_0x751d,0x6d));var _0xd751=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0x751d[_0x1ca93c];return _0x185169;};'use strict';var _=require(_0xd751('0x0'));var util=require(_0xd751('0x1'));var logger=require(_0xd751('0x2'))(_0xd751('0x3'));var moment=require(_0xd751('0x4'));var BPromise=require(_0xd751('0x5'));var rp=require(_0xd751('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd751('0x7'));var config=require(_0xd751('0x8'));var attributes=require(_0xd751('0x9'));module[_0xd751('0xa')]=function(_0x249898,_0x352f7e){return _0x249898[_0xd751('0xb')]('VtigerConfiguration',attributes,{'tableName':_0xd751('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 349e030..8b10e85 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 _0x6cae=['request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x32a3ac,_0x5883a3){var _0x4115bc=function(_0x5dbc1f){while(--_0x5dbc1f){_0x32a3ac['push'](_0x32a3ac['shift']());}};_0x4115bc(++_0x5883a3);}(_0x6cae,0x6c));var _0xe6ca=function(_0x45a7c0,_0x5caf5d){_0x45a7c0=_0x45a7c0-0x0;var _0x4b2bcc=_0x6cae[_0x45a7c0];return _0x4b2bcc;};'use strict';var _=require(_0xe6ca('0x0'));var util=require('util');var moment=require(_0xe6ca('0x1'));var BPromise=require(_0xe6ca('0x2'));var rs=require(_0xe6ca('0x3'));var fs=require('fs');var Redis=require(_0xe6ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6ca('0x5'));var logger=require(_0xe6ca('0x6'))('rpc');var config=require(_0xe6ca('0x7'));var jayson=require(_0xe6ca('0x8'));var client=jayson[_0xe6ca('0x9')][_0xe6ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290544,_0x28a8ac,_0x120e14){return new BPromise(function(_0x577a1d,_0x3d6b10){return client['request'](_0x290544,_0x120e14)['then'](function(_0x55b2d7){logger['info'](_0xe6ca('0xb'),_0x28a8ac,_0xe6ca('0xc'));logger['debug'](_0xe6ca('0xd'),_0x28a8ac,_0xe6ca('0xc'),JSON[_0xe6ca('0xe')](_0x55b2d7));if(_0x55b2d7['error']){if(_0x55b2d7[_0xe6ca('0xf')][_0xe6ca('0x10')]===0x1f4){logger[_0xe6ca('0xf')](_0xe6ca('0xb'),_0x28a8ac,_0x55b2d7[_0xe6ca('0xf')][_0xe6ca('0x11')]);return _0x3d6b10(_0x55b2d7[_0xe6ca('0xf')][_0xe6ca('0x11')]);}logger[_0xe6ca('0xf')](_0xe6ca('0xb'),_0x28a8ac,_0x55b2d7[_0xe6ca('0xf')][_0xe6ca('0x11')]);return _0x577a1d(_0x55b2d7[_0xe6ca('0xf')][_0xe6ca('0x11')]);}else{logger[_0xe6ca('0x12')](_0xe6ca('0xb'),_0x28a8ac,_0xe6ca('0xc'));_0x577a1d(_0x55b2d7['result']['message']);}})[_0xe6ca('0x13')](function(_0x90e7d1){logger[_0xe6ca('0xf')](_0xe6ca('0xb'),_0x28a8ac,_0x90e7d1);_0x3d6b10(_0x90e7d1);});});} \ No newline at end of file +var _0x6a5a=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0xfea7,_0x39de55){var _0xd17809=function(_0x3005c8){while(--_0x3005c8){_0xfea7['push'](_0xfea7['shift']());}};_0xd17809(++_0x39de55);}(_0x6a5a,0x17d));var _0xa6a5=function(_0x274902,_0x25f86d){_0x274902=_0x274902-0x0;var _0x12c633=_0x6a5a[_0x274902];return _0x12c633;};'use strict';var _=require(_0xa6a5('0x0'));var util=require(_0xa6a5('0x1'));var moment=require(_0xa6a5('0x2'));var BPromise=require(_0xa6a5('0x3'));var rs=require(_0xa6a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6a5('0x6'))('rpc');var config=require(_0xa6a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa6a5('0x8')][_0xa6a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xadd24d,_0x4b8583,_0x26e31a){return new BPromise(function(_0x508f33,_0x1de4ab){return client[_0xa6a5('0xa')](_0xadd24d,_0x26e31a)[_0xa6a5('0xb')](function(_0x2cc51c){logger[_0xa6a5('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x4b8583,_0xa6a5('0xd'));logger[_0xa6a5('0xe')](_0xa6a5('0xf'),_0x4b8583,'request\x20sent',JSON['stringify'](_0x2cc51c));if(_0x2cc51c[_0xa6a5('0x10')]){if(_0x2cc51c['error'][_0xa6a5('0x11')]===0x1f4){logger[_0xa6a5('0x10')](_0xa6a5('0x12'),_0x4b8583,_0x2cc51c[_0xa6a5('0x10')]['message']);return _0x1de4ab(_0x2cc51c[_0xa6a5('0x10')][_0xa6a5('0x13')]);}logger[_0xa6a5('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x4b8583,_0x2cc51c[_0xa6a5('0x10')][_0xa6a5('0x13')]);return _0x508f33(_0x2cc51c[_0xa6a5('0x10')][_0xa6a5('0x13')]);}else{logger[_0xa6a5('0xc')](_0xa6a5('0x12'),_0x4b8583,_0xa6a5('0xd'));_0x508f33(_0x2cc51c[_0xa6a5('0x14')][_0xa6a5('0x13')]);}})[_0xa6a5('0x15')](function(_0x3a2ddb){logger['error'](_0xa6a5('0x12'),_0x4b8583,_0x3a2ddb);_0x1de4ab(_0x3a2ddb);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 7f215d4..7b10edc 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 _0x1d89=['multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','index','/:id','post','create','put','isAuthenticated','update','delete','destroy','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1d89,0x18c));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x91d8('0x0'));var util=require('util');var path=require(_0x91d8('0x1'));var timeout=require('connect-timeout');var express=require(_0x91d8('0x2'));var router=express['Router']();var fs_extra=require(_0x91d8('0x3'));var auth=require(_0x91d8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x91d8('0x5'));var controller=require(_0x91d8('0x6'));router[_0x91d8('0x7')]('/',auth['isAuthenticated'](),controller[_0x91d8('0x8')]);router[_0x91d8('0x7')](_0x91d8('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x91d8('0xa')]('/',auth['isAuthenticated'](),controller[_0x91d8('0xb')]);router[_0x91d8('0xc')](_0x91d8('0x9'),auth[_0x91d8('0xd')](),controller[_0x91d8('0xe')]);router[_0x91d8('0xf')](_0x91d8('0x9'),auth['isAuthenticated'](),controller[_0x91d8('0x10')]);module[_0x91d8('0x11')]=router; \ No newline at end of file +var _0xb3ad=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update','exports','path','connect-timeout'];(function(_0xa5bd84,_0x287943){var _0x22bcca=function(_0x13f6f4){while(--_0x13f6f4){_0xa5bd84['push'](_0xa5bd84['shift']());}};_0x22bcca(++_0x287943);}(_0xb3ad,0x1a7));var _0xdb3a=function(_0x433b60,_0x1e8ef9){_0x433b60=_0x433b60-0x0;var _0x3acd19=_0xb3ad[_0x433b60];return _0x3acd19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdb3a('0x0'));var timeout=require(_0xdb3a('0x1'));var express=require('express');var router=express[_0xdb3a('0x2')]();var fs_extra=require(_0xdb3a('0x3'));var auth=require(_0xdb3a('0x4'));var interaction=require(_0xdb3a('0x5'));var config=require(_0xdb3a('0x6'));var controller=require(_0xdb3a('0x7'));router[_0xdb3a('0x8')]('/',auth[_0xdb3a('0x9')](),controller[_0xdb3a('0xa')]);router[_0xdb3a('0x8')](_0xdb3a('0xb'),auth['isAuthenticated'](),controller[_0xdb3a('0xc')]);router['post']('/',auth[_0xdb3a('0x9')](),controller[_0xdb3a('0xd')]);router[_0xdb3a('0xe')](_0xdb3a('0xb'),auth[_0xdb3a('0x9')](),controller[_0xdb3a('0xf')]);router['delete'](_0xdb3a('0xb'),auth[_0xdb3a('0x9')](),controller['destroy']);module[_0xdb3a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 59a436e..743ce56 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 _0xff46=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xff46,0x124));var _0x6ff4=function(_0xc85513,_0x49e852){_0xc85513=_0xc85513-0x0;var _0x3e70be=_0xff46[_0xc85513];return _0x3e70be;};'use strict';var Sequelize=require(_0x6ff4('0x0'));module[_0x6ff4('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x6ff4('0x2'),_0x6ff4('0x3'),_0x6ff4('0x4'),'picklist'),'defaultValue':_0x6ff4('0x5')},'content':{'type':Sequelize[_0x6ff4('0x6')]},'key':{'type':Sequelize[_0x6ff4('0x6')]},'keyType':{'type':Sequelize[_0x6ff4('0x7')]('string',_0x6ff4('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x6ff4('0x6')]},'idField':{'type':Sequelize[_0x6ff4('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6ff4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ff4('0x6')]}}; \ No newline at end of file +var _0x9fee=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x13c436,_0x2d6d22){var _0x31cac5=function(_0x391288){while(--_0x391288){_0x13c436['push'](_0x13c436['shift']());}};_0x31cac5(++_0x2d6d22);}(_0x9fee,0x1ee));var _0xe9fe=function(_0x5ccdf1,_0x3f4000){_0x5ccdf1=_0x5ccdf1-0x0;var _0x7e5593=_0x9fee[_0x5ccdf1];return _0x7e5593;};'use strict';var Sequelize=require(_0xe9fe('0x0'));module[_0xe9fe('0x1')]={'type':{'type':Sequelize[_0xe9fe('0x2')](_0xe9fe('0x3'),_0xe9fe('0x4'),_0xe9fe('0x5'),_0xe9fe('0x6'),_0xe9fe('0x7')),'defaultValue':_0xe9fe('0x3')},'content':{'type':Sequelize[_0xe9fe('0x8')]},'key':{'type':Sequelize[_0xe9fe('0x8')]},'keyType':{'type':Sequelize[_0xe9fe('0x2')](_0xe9fe('0x3'),_0xe9fe('0x4'),_0xe9fe('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe9fe('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 752b7c4..9faa6eb 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 _0x9bf3=['rows','show','params','keys','find','create','body','catch','eml-format','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x4b72fe,_0x3618b1){var _0x350156=function(_0x1a9872){while(--_0x1a9872){_0x4b72fe['push'](_0x4b72fe['shift']());}};_0x350156(++_0x3618b1);}(_0x9bf3,0x96));var _0x39bf=function(_0x2d69e1,_0x43f881){_0x2d69e1=_0x2d69e1-0x0;var _0x9b5140=_0x9bf3[_0x2d69e1];return _0x9b5140;};'use strict';var emlformat=require(_0x39bf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x39bf('0x1'));var BPromise=require(_0x39bf('0x2'));var Mustache=require(_0x39bf('0x3'));var util=require(_0x39bf('0x4'));var path=require(_0x39bf('0x5'));var sox=require(_0x39bf('0x6'));var csv=require('to-csv');var ejs=require(_0x39bf('0x7'));var fs=require('fs');var fs_extra=require(_0x39bf('0x8'));var _=require('lodash');var squel=require(_0x39bf('0x9'));var crypto=require(_0x39bf('0xa'));var jsforce=require(_0x39bf('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39bf('0xc'));var qs=require(_0x39bf('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x39bf('0xe'));var utils=require(_0x39bf('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x39bf('0x10'));var db=require(_0x39bf('0x11'))['db'];function respondWithStatusCode(_0x51f577,_0x230f42){_0x230f42=_0x230f42||0xcc;return function(_0x36bc2b){if(_0x36bc2b){return _0x51f577[_0x39bf('0x12')](_0x230f42);}return _0x51f577[_0x39bf('0x13')](_0x230f42)[_0x39bf('0x14')]();};}function respondWithResult(_0x524bf6,_0x550331){_0x550331=_0x550331||0xc8;return function(_0x120d30){if(_0x120d30){return _0x524bf6[_0x39bf('0x13')](_0x550331)[_0x39bf('0x15')](_0x120d30);}};}function respondWithFilteredResult(_0x32dd72,_0x511c77){return function(_0x3f4ab8){if(_0x3f4ab8){var _0x3462e6=typeof _0x511c77[_0x39bf('0x16')]===_0x39bf('0x17')&&typeof _0x511c77[_0x39bf('0x18')]==='undefined';var _0x54cf67=_0x3f4ab8['count'];var _0x6a6277=_0x3462e6?0x0:_0x511c77[_0x39bf('0x16')];var _0x5da2a0=_0x3462e6?_0x3f4ab8[_0x39bf('0x19')]:_0x511c77['offset']+_0x511c77[_0x39bf('0x18')];var _0x902d33;if(_0x5da2a0>=_0x54cf67){_0x5da2a0=_0x54cf67;_0x902d33=0xc8;}else{_0x902d33=0xce;}_0x32dd72[_0x39bf('0x13')](_0x902d33);return _0x32dd72[_0x39bf('0x1a')](_0x39bf('0x1b'),_0x6a6277+'-'+_0x5da2a0+'/'+_0x54cf67)[_0x39bf('0x15')](_0x3f4ab8);}return null;};}function patchUpdates(_0x25362c){return function(_0x2efad4){try{jsonpatch['apply'](_0x2efad4,_0x25362c,!![]);}catch(_0x29f484){return BPromise[_0x39bf('0x1c')](_0x29f484);}return _0x2efad4[_0x39bf('0x1d')]();};}function saveUpdates(_0xe682c9,_0x93aa9f){return function(_0x1cf2f9){if(_0x1cf2f9){return _0x1cf2f9[_0x39bf('0x1e')](_0xe682c9)[_0x39bf('0x1f')](function(_0x380bb4){return _0x380bb4;});}return null;};}function removeEntity(_0x1c16b9,_0x2782f6){return function(_0x127146){if(_0x127146){return _0x127146[_0x39bf('0x20')]()[_0x39bf('0x1f')](function(){_0x1c16b9[_0x39bf('0x13')](0xcc)[_0x39bf('0x14')]();});}};}function handleEntityNotFound(_0x27f4e3,_0x42f43f){return function(_0x2f8b75){if(!_0x2f8b75){_0x27f4e3[_0x39bf('0x12')](0x194);}return _0x2f8b75;};}function handleError(_0x2c0030,_0x552f6b){_0x552f6b=_0x552f6b||0x1f4;return function(_0x4a663e){logger[_0x39bf('0x21')](_0x4a663e[_0x39bf('0x22')]);if(_0x4a663e[_0x39bf('0x23')]){delete _0x4a663e[_0x39bf('0x23')];}_0x2c0030['status'](_0x552f6b)[_0x39bf('0x24')](_0x4a663e);};}exports[_0x39bf('0x25')]=function(_0x16d1e0,_0x198321){var _0x17e3b5={},_0x28795d={},_0x570cae={'count':0x0,'rows':[]};var _0x1b129e=_[_0x39bf('0x26')](db[_0x39bf('0x27')][_0x39bf('0x28')],function(_0x102497){return{'name':_0x102497[_0x39bf('0x29')],'type':_0x102497[_0x39bf('0x2a')][_0x39bf('0x2b')]};});_0x28795d['model']=_[_0x39bf('0x26')](_0x1b129e,_0x39bf('0x23'));_0x28795d[_0x39bf('0x2c')]=_['keys'](_0x16d1e0[_0x39bf('0x2c')]);_0x28795d[_0x39bf('0x2d')]=_[_0x39bf('0x2e')](_0x28795d[_0x39bf('0x2f')],_0x28795d[_0x39bf('0x2c')]);_0x17e3b5['attributes']=_['intersection'](_0x28795d['model'],qs['fields'](_0x16d1e0[_0x39bf('0x2c')][_0x39bf('0x30')]));_0x17e3b5['attributes']=_0x17e3b5[_0x39bf('0x31')][_0x39bf('0x32')]?_0x17e3b5['attributes']:_0x28795d[_0x39bf('0x2f')];if(!_0x16d1e0['query'][_0x39bf('0x33')](_0x39bf('0x34'))){_0x17e3b5[_0x39bf('0x18')]=qs[_0x39bf('0x18')](_0x16d1e0[_0x39bf('0x2c')][_0x39bf('0x18')]);_0x17e3b5['offset']=qs[_0x39bf('0x16')](_0x16d1e0[_0x39bf('0x2c')][_0x39bf('0x16')]);}_0x17e3b5[_0x39bf('0x35')]=qs[_0x39bf('0x36')](_0x16d1e0['query'][_0x39bf('0x36')]);_0x17e3b5[_0x39bf('0x37')]=qs[_0x39bf('0x2d')](_[_0x39bf('0x38')](_0x16d1e0[_0x39bf('0x2c')],_0x28795d[_0x39bf('0x2d')]),_0x1b129e);if(_0x16d1e0[_0x39bf('0x2c')][_0x39bf('0x39')]){_0x17e3b5[_0x39bf('0x37')]=_[_0x39bf('0x3a')](_0x17e3b5[_0x39bf('0x37')],{'$or':_[_0x39bf('0x26')](_0x1b129e,function(_0x206d81){if(_0x206d81[_0x39bf('0x2a')]!==_0x39bf('0x3b')){var _0x523175={};_0x523175[_0x206d81['name']]={'$like':'%'+_0x16d1e0['query'][_0x39bf('0x39')]+'%'};return _0x523175;}})});}_0x17e3b5=_[_0x39bf('0x3a')]({},_0x17e3b5,_0x16d1e0[_0x39bf('0x3c')]);var _0x2c40b0={'where':_0x17e3b5[_0x39bf('0x37')]};return db['VtigerField'][_0x39bf('0x19')](_0x2c40b0)[_0x39bf('0x1f')](function(_0x3f639c){_0x570cae[_0x39bf('0x19')]=_0x3f639c;if(_0x16d1e0[_0x39bf('0x2c')][_0x39bf('0x3d')]){_0x17e3b5[_0x39bf('0x3e')]=[{'all':!![]}];}return db[_0x39bf('0x27')]['findAll'](_0x17e3b5);})[_0x39bf('0x1f')](function(_0x5c833d){_0x570cae[_0x39bf('0x3f')]=_0x5c833d;return _0x570cae;})[_0x39bf('0x1f')](respondWithFilteredResult(_0x198321,_0x17e3b5))['catch'](handleError(_0x198321,null));};exports[_0x39bf('0x40')]=function(_0x1aae2e,_0x5249c2){var _0x361f94={'raw':!![],'where':{'id':_0x1aae2e[_0x39bf('0x41')]['id']}},_0x3ce8f7={};_0x3ce8f7[_0x39bf('0x2f')]=_[_0x39bf('0x42')](db[_0x39bf('0x27')][_0x39bf('0x28')]);_0x3ce8f7[_0x39bf('0x2c')]=_['keys'](_0x1aae2e['query']);_0x3ce8f7[_0x39bf('0x2d')]=_[_0x39bf('0x2e')](_0x3ce8f7[_0x39bf('0x2f')],_0x3ce8f7['query']);_0x361f94[_0x39bf('0x31')]=_[_0x39bf('0x2e')](_0x3ce8f7[_0x39bf('0x2f')],qs[_0x39bf('0x30')](_0x1aae2e['query'][_0x39bf('0x30')]));_0x361f94[_0x39bf('0x31')]=_0x361f94[_0x39bf('0x31')][_0x39bf('0x32')]?_0x361f94[_0x39bf('0x31')]:_0x3ce8f7['model'];if(_0x1aae2e[_0x39bf('0x2c')]['includeAll']){_0x361f94['include']=[{'all':!![]}];}_0x361f94=_[_0x39bf('0x3a')]({},_0x361f94,_0x1aae2e[_0x39bf('0x3c')]);return db[_0x39bf('0x27')][_0x39bf('0x43')](_0x361f94)[_0x39bf('0x1f')](handleEntityNotFound(_0x5249c2,null))['then'](respondWithResult(_0x5249c2,null))['catch'](handleError(_0x5249c2,null));};exports[_0x39bf('0x44')]=function(_0x16b6fe,_0x6bee05){return db['VtigerField'][_0x39bf('0x44')](_0x16b6fe[_0x39bf('0x45')],{})['then'](respondWithResult(_0x6bee05,0xc9))[_0x39bf('0x46')](handleError(_0x6bee05,null));};exports[_0x39bf('0x1e')]=function(_0x39ae24,_0x67d38b){if(_0x39ae24[_0x39bf('0x45')]['id']){delete _0x39ae24[_0x39bf('0x45')]['id'];}return db[_0x39bf('0x27')][_0x39bf('0x43')]({'where':{'id':_0x39ae24[_0x39bf('0x41')]['id']}})['then'](handleEntityNotFound(_0x67d38b,null))[_0x39bf('0x1f')](saveUpdates(_0x39ae24['body'],null))[_0x39bf('0x1f')](respondWithResult(_0x67d38b,null))['catch'](handleError(_0x67d38b,null));};exports[_0x39bf('0x20')]=function(_0x5d74a3,_0x1a53df){return db['VtigerField'][_0x39bf('0x43')]({'where':{'id':_0x5d74a3['params']['id']}})[_0x39bf('0x1f')](handleEntityNotFound(_0x1a53df,null))[_0x39bf('0x1f')](removeEntity(_0x1a53df,null))['catch'](handleError(_0x1a53df,null));}; \ No newline at end of file +var _0xde4c=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','VtigerField','rawAttributes','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xde4c,0x11e));var _0xcde4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde4c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcde4('0x0'));var rimraf=require(_0xcde4('0x1'));var zipdir=require(_0xcde4('0x2'));var jsonpatch=require(_0xcde4('0x3'));var rp=require(_0xcde4('0x4'));var moment=require(_0xcde4('0x5'));var BPromise=require(_0xcde4('0x6'));var Mustache=require(_0xcde4('0x7'));var util=require(_0xcde4('0x8'));var path=require(_0xcde4('0x9'));var sox=require(_0xcde4('0xa'));var csv=require(_0xcde4('0xb'));var ejs=require(_0xcde4('0xc'));var fs=require('fs');var fs_extra=require(_0xcde4('0xd'));var _=require(_0xcde4('0xe'));var squel=require(_0xcde4('0xf'));var crypto=require(_0xcde4('0x10'));var jsforce=require(_0xcde4('0x11'));var deskjs=require(_0xcde4('0x12'));var toCsv=require(_0xcde4('0xb'));var querystring=require(_0xcde4('0x13'));var Papa=require(_0xcde4('0x14'));var Redis=require(_0xcde4('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xcde4('0x16'));var as=require(_0xcde4('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcde4('0x18'));var utils=require(_0xcde4('0x19'));var config=require(_0xcde4('0x1a'));var licenseUtil=require(_0xcde4('0x1b'));var db=require(_0xcde4('0x1c'))['db'];function respondWithStatusCode(_0x4a7658,_0x1fda51){_0x1fda51=_0x1fda51||0xcc;return function(_0x4f8e60){if(_0x4f8e60){return _0x4a7658['sendStatus'](_0x1fda51);}return _0x4a7658[_0xcde4('0x1d')](_0x1fda51)['end']();};}function respondWithResult(_0x1f9f8c,_0x170c06){_0x170c06=_0x170c06||0xc8;return function(_0x38b634){if(_0x38b634){return _0x1f9f8c[_0xcde4('0x1d')](_0x170c06)[_0xcde4('0x1e')](_0x38b634);}};}function respondWithFilteredResult(_0x15f388,_0x3b652e){return function(_0x33b974){if(_0x33b974){var _0x40ffef=typeof _0x3b652e[_0xcde4('0x1f')]===_0xcde4('0x20')&&typeof _0x3b652e['limit']==='undefined';var _0x89bbbf=_0x33b974[_0xcde4('0x21')];var _0xf2e58d=_0x40ffef?0x0:_0x3b652e[_0xcde4('0x1f')];var _0x2653a2=_0x40ffef?_0x33b974[_0xcde4('0x21')]:_0x3b652e[_0xcde4('0x1f')]+_0x3b652e[_0xcde4('0x22')];var _0x1c4c5f;if(_0x2653a2>=_0x89bbbf){_0x2653a2=_0x89bbbf;_0x1c4c5f=0xc8;}else{_0x1c4c5f=0xce;}_0x15f388[_0xcde4('0x1d')](_0x1c4c5f);return _0x15f388[_0xcde4('0x23')](_0xcde4('0x24'),_0xf2e58d+'-'+_0x2653a2+'/'+_0x89bbbf)[_0xcde4('0x1e')](_0x33b974);}return null;};}function patchUpdates(_0x1e2ef3){return function(_0x552889){try{jsonpatch[_0xcde4('0x25')](_0x552889,_0x1e2ef3,!![]);}catch(_0x52cafd){return BPromise[_0xcde4('0x26')](_0x52cafd);}return _0x552889['save']();};}function saveUpdates(_0xc4ae12,_0x16cb88){return function(_0x54da2a){if(_0x54da2a){return _0x54da2a[_0xcde4('0x27')](_0xc4ae12)[_0xcde4('0x28')](function(_0x24bc96){return _0x24bc96;});}return null;};}function removeEntity(_0x5f0ceb,_0x473dbc){return function(_0x40bbf6){if(_0x40bbf6){return _0x40bbf6[_0xcde4('0x29')]()[_0xcde4('0x28')](function(){_0x5f0ceb[_0xcde4('0x1d')](0xcc)[_0xcde4('0x2a')]();});}};}function handleEntityNotFound(_0x3a5ffe,_0xb4b1a3){return function(_0x901694){if(!_0x901694){_0x3a5ffe[_0xcde4('0x2b')](0x194);}return _0x901694;};}function handleError(_0x20b255,_0x408e21){_0x408e21=_0x408e21||0x1f4;return function(_0x57fa8a){logger[_0xcde4('0x2c')](_0x57fa8a[_0xcde4('0x2d')]);if(_0x57fa8a[_0xcde4('0x2e')]){delete _0x57fa8a[_0xcde4('0x2e')];}_0x20b255[_0xcde4('0x1d')](_0x408e21)[_0xcde4('0x2f')](_0x57fa8a);};}exports[_0xcde4('0x30')]=function(_0x2ef036,_0x23c504){var _0x575c72={},_0x518107={},_0xab9238={'count':0x0,'rows':[]};var _0x17123d=_['map'](db[_0xcde4('0x31')][_0xcde4('0x32')],function(_0x431728){return{'name':_0x431728['fieldName'],'type':_0x431728[_0xcde4('0x33')][_0xcde4('0x34')]};});_0x518107[_0xcde4('0x35')]=_[_0xcde4('0x36')](_0x17123d,_0xcde4('0x2e'));_0x518107['query']=_['keys'](_0x2ef036[_0xcde4('0x37')]);_0x518107['filters']=_[_0xcde4('0x38')](_0x518107[_0xcde4('0x35')],_0x518107[_0xcde4('0x37')]);_0x575c72['attributes']=_[_0xcde4('0x38')](_0x518107[_0xcde4('0x35')],qs[_0xcde4('0x39')](_0x2ef036['query'][_0xcde4('0x39')]));_0x575c72['attributes']=_0x575c72[_0xcde4('0x3a')][_0xcde4('0x3b')]?_0x575c72['attributes']:_0x518107[_0xcde4('0x35')];if(!_0x2ef036['query'][_0xcde4('0x3c')](_0xcde4('0x3d'))){_0x575c72[_0xcde4('0x22')]=qs['limit'](_0x2ef036[_0xcde4('0x37')][_0xcde4('0x22')]);_0x575c72[_0xcde4('0x1f')]=qs['offset'](_0x2ef036[_0xcde4('0x37')][_0xcde4('0x1f')]);}_0x575c72[_0xcde4('0x3e')]=qs[_0xcde4('0x3f')](_0x2ef036[_0xcde4('0x37')][_0xcde4('0x3f')]);_0x575c72[_0xcde4('0x40')]=qs['filters'](_[_0xcde4('0x41')](_0x2ef036[_0xcde4('0x37')],_0x518107[_0xcde4('0x42')]),_0x17123d);if(_0x2ef036[_0xcde4('0x37')][_0xcde4('0x43')]){_0x575c72['where']=_[_0xcde4('0x44')](_0x575c72[_0xcde4('0x40')],{'$or':_[_0xcde4('0x36')](_0x17123d,function(_0x4ff50b){if(_0x4ff50b[_0xcde4('0x33')]!=='VIRTUAL'){var _0x582b43={};_0x582b43[_0x4ff50b[_0xcde4('0x2e')]]={'$like':'%'+_0x2ef036[_0xcde4('0x37')]['filter']+'%'};return _0x582b43;}})});}_0x575c72=_[_0xcde4('0x44')]({},_0x575c72,_0x2ef036[_0xcde4('0x45')]);var _0xf225e0={'where':_0x575c72[_0xcde4('0x40')]};return db[_0xcde4('0x31')]['count'](_0xf225e0)[_0xcde4('0x28')](function(_0x2e4471){_0xab9238['count']=_0x2e4471;if(_0x2ef036[_0xcde4('0x37')][_0xcde4('0x46')]){_0x575c72[_0xcde4('0x47')]=[{'all':!![]}];}return db[_0xcde4('0x31')][_0xcde4('0x48')](_0x575c72);})[_0xcde4('0x28')](function(_0x6072b9){_0xab9238['rows']=_0x6072b9;return _0xab9238;})[_0xcde4('0x28')](respondWithFilteredResult(_0x23c504,_0x575c72))[_0xcde4('0x49')](handleError(_0x23c504,null));};exports['show']=function(_0xc222cd,_0x4eea54){var _0x54b428={'raw':!![],'where':{'id':_0xc222cd[_0xcde4('0x4a')]['id']}},_0x416a97={};_0x416a97['model']=_[_0xcde4('0x4b')](db[_0xcde4('0x31')]['rawAttributes']);_0x416a97[_0xcde4('0x37')]=_[_0xcde4('0x4b')](_0xc222cd['query']);_0x416a97[_0xcde4('0x42')]=_[_0xcde4('0x38')](_0x416a97[_0xcde4('0x35')],_0x416a97[_0xcde4('0x37')]);_0x54b428[_0xcde4('0x3a')]=_[_0xcde4('0x38')](_0x416a97[_0xcde4('0x35')],qs['fields'](_0xc222cd[_0xcde4('0x37')][_0xcde4('0x39')]));_0x54b428[_0xcde4('0x3a')]=_0x54b428[_0xcde4('0x3a')]['length']?_0x54b428[_0xcde4('0x3a')]:_0x416a97[_0xcde4('0x35')];if(_0xc222cd[_0xcde4('0x37')]['includeAll']){_0x54b428['include']=[{'all':!![]}];}_0x54b428=_[_0xcde4('0x44')]({},_0x54b428,_0xc222cd['options']);return db[_0xcde4('0x31')][_0xcde4('0x4c')](_0x54b428)['then'](handleEntityNotFound(_0x4eea54,null))['then'](respondWithResult(_0x4eea54,null))[_0xcde4('0x49')](handleError(_0x4eea54,null));};exports[_0xcde4('0x4d')]=function(_0xbc580a,_0x44fc75){return db[_0xcde4('0x31')][_0xcde4('0x4d')](_0xbc580a[_0xcde4('0x4e')],{})[_0xcde4('0x28')](respondWithResult(_0x44fc75,0xc9))[_0xcde4('0x49')](handleError(_0x44fc75,null));};exports['update']=function(_0x5567b5,_0x2f8a44){if(_0x5567b5[_0xcde4('0x4e')]['id']){delete _0x5567b5['body']['id'];}return db[_0xcde4('0x31')][_0xcde4('0x4c')]({'where':{'id':_0x5567b5[_0xcde4('0x4a')]['id']}})[_0xcde4('0x28')](handleEntityNotFound(_0x2f8a44,null))[_0xcde4('0x28')](saveUpdates(_0x5567b5[_0xcde4('0x4e')],null))['then'](respondWithResult(_0x2f8a44,null))['catch'](handleError(_0x2f8a44,null));};exports[_0xcde4('0x29')]=function(_0x39210a,_0x343978){return db[_0xcde4('0x31')][_0xcde4('0x4c')]({'where':{'id':_0x39210a[_0xcde4('0x4a')]['id']}})[_0xcde4('0x28')](handleEntityNotFound(_0x343978,null))[_0xcde4('0x28')](removeEntity(_0x343978,null))['catch'](handleError(_0x343978,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index f227f70..c27faa0 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 _0x06fd=['define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x3f90f9,_0x5708f6){var _0x818bd8=function(_0x404449){while(--_0x404449){_0x3f90f9['push'](_0x3f90f9['shift']());}};_0x818bd8(++_0x5708f6);}(_0x06fd,0x18d));var _0xd06f=function(_0x30b159,_0x3fbb50){_0x30b159=_0x30b159-0x0;var _0x23c3f9=_0x06fd[_0x30b159];return _0x23c3f9;};'use strict';var _=require(_0xd06f('0x0'));var util=require('util');var logger=require(_0xd06f('0x1'))(_0xd06f('0x2'));var moment=require(_0xd06f('0x3'));var BPromise=require(_0xd06f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd06f('0x5'));var rimraf=require('rimraf');var config=require(_0xd06f('0x6'));var attributes=require(_0xd06f('0x7'));module[_0xd06f('0x8')]=function(_0x2047c7,_0x3db548){return _0x2047c7[_0xd06f('0x9')]('VtigerField',attributes,{'tableName':_0xd06f('0xa'),'paranoid':![],'indexes':[{'name':_0xd06f('0xb'),'fields':[_0xd06f('0xc'),_0xd06f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2094=['../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','FieldId','lodash','../../config/logger','request-promise','path','rimraf'];(function(_0x2c24d5,_0x3ca9c6){var _0x5e4726=function(_0x18431b){while(--_0x18431b){_0x2c24d5['push'](_0x2c24d5['shift']());}};_0x5e4726(++_0x3ca9c6);}(_0x2094,0x19d));var _0x4209=function(_0x33c2e0,_0x28ec08){_0x33c2e0=_0x33c2e0-0x0;var _0x387d39=_0x2094[_0x33c2e0];return _0x387d39;};'use strict';var _=require(_0x4209('0x0'));var util=require('util');var logger=require(_0x4209('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4209('0x2'));var fs=require('fs');var path=require(_0x4209('0x3'));var rimraf=require(_0x4209('0x4'));var config=require(_0x4209('0x5'));var attributes=require(_0x4209('0x6'));module[_0x4209('0x7')]=function(_0x593661,_0x29ab82){return _0x593661['define'](_0x4209('0x8'),attributes,{'tableName':_0x4209('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x4209('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index b2aad13..51788a7 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 _0x2d76=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x2d76,0x146));var _0x62d7=function(_0x279015,_0x57a7ea){_0x279015=_0x279015-0x0;var _0x146798=_0x2d76[_0x279015];return _0x146798;};'use strict';var _=require(_0x62d7('0x0'));var util=require('util');var moment=require(_0x62d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x62d7('0x2'));var fs=require('fs');var Redis=require(_0x62d7('0x3'));var db=require(_0x62d7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x62d7('0x5'))(_0x62d7('0x6'));var config=require(_0x62d7('0x7'));var jayson=require(_0x62d7('0x8'));var client=jayson[_0x62d7('0x9')][_0x62d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ba54,_0x531088,_0x37d361){return new BPromise(function(_0x16bf98,_0x413885){return client['request'](_0x21ba54,_0x37d361)[_0x62d7('0xb')](function(_0x1fbd79){logger[_0x62d7('0xc')]('VtigerField,\x20%s,\x20%s',_0x531088,_0x62d7('0xd'));logger[_0x62d7('0xe')](_0x62d7('0xf'),_0x531088,'request\x20sent',JSON[_0x62d7('0x10')](_0x1fbd79));if(_0x1fbd79[_0x62d7('0x11')]){if(_0x1fbd79[_0x62d7('0x11')][_0x62d7('0x12')]===0x1f4){logger[_0x62d7('0x11')](_0x62d7('0x13'),_0x531088,_0x1fbd79[_0x62d7('0x11')][_0x62d7('0x14')]);return _0x413885(_0x1fbd79[_0x62d7('0x11')][_0x62d7('0x14')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x531088,_0x1fbd79[_0x62d7('0x11')][_0x62d7('0x14')]);return _0x16bf98(_0x1fbd79[_0x62d7('0x11')][_0x62d7('0x14')]);}else{logger[_0x62d7('0xc')](_0x62d7('0x13'),_0x531088,_0x62d7('0xd'));_0x16bf98(_0x1fbd79['result'][_0x62d7('0x14')]);}})[_0x62d7('0x15')](function(_0x25e2d6){logger[_0x62d7('0x11')](_0x62d7('0x13'),_0x531088,_0x25e2d6);_0x413885(_0x25e2d6);});});} \ No newline at end of file +var _0xd910=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','VtigerField,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x198226,_0x4890c5){var _0x31f6db=function(_0x279419){while(--_0x279419){_0x198226['push'](_0x198226['shift']());}};_0x31f6db(++_0x4890c5);}(_0xd910,0xe2));var _0x0d91=function(_0x32a34f,_0x48007){_0x32a34f=_0x32a34f-0x0;var _0x5ea3b8=_0xd910[_0x32a34f];return _0x5ea3b8;};'use strict';var _=require('lodash');var util=require(_0x0d91('0x0'));var moment=require(_0x0d91('0x1'));var BPromise=require(_0x0d91('0x2'));var rs=require(_0x0d91('0x3'));var fs=require('fs');var Redis=require(_0x0d91('0x4'));var db=require(_0x0d91('0x5'))['db'];var utils=require(_0x0d91('0x6'));var logger=require(_0x0d91('0x7'))('rpc');var config=require(_0x0d91('0x8'));var jayson=require(_0x0d91('0x9'));var client=jayson[_0x0d91('0xa')][_0x0d91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18776d,_0x57d08b,_0x4eb9a4){return new BPromise(function(_0x523145,_0x2ffed4){return client[_0x0d91('0xc')](_0x18776d,_0x4eb9a4)[_0x0d91('0xd')](function(_0x5c8e1f){logger[_0x0d91('0xe')]('VtigerField,\x20%s,\x20%s',_0x57d08b,_0x0d91('0xf'));logger[_0x0d91('0x10')](_0x0d91('0x11'),_0x57d08b,_0x0d91('0xf'),JSON['stringify'](_0x5c8e1f));if(_0x5c8e1f[_0x0d91('0x12')]){if(_0x5c8e1f[_0x0d91('0x12')][_0x0d91('0x13')]===0x1f4){logger[_0x0d91('0x12')](_0x0d91('0x14'),_0x57d08b,_0x5c8e1f[_0x0d91('0x12')][_0x0d91('0x15')]);return _0x2ffed4(_0x5c8e1f['error'][_0x0d91('0x15')]);}logger[_0x0d91('0x12')](_0x0d91('0x14'),_0x57d08b,_0x5c8e1f['error']['message']);return _0x523145(_0x5c8e1f['error'][_0x0d91('0x15')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x57d08b,'request\x20sent');_0x523145(_0x5c8e1f['result'][_0x0d91('0x15')]);}})[_0x0d91('0x16')](function(_0x34d5b6){logger[_0x0d91('0x12')](_0x0d91('0x14'),_0x57d08b,_0x34d5b6);_0x2ffed4(_0x34d5b6);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 3e9712d..cd6ab0a 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 _0x83cd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','delete','exports','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83cd,0x1c4));var _0xd83c=function(_0x5ed287,_0x45c2aa){_0x5ed287=_0x5ed287-0x0;var _0x23781a=_0x83cd[_0x5ed287];return _0x23781a;};'use strict';var multer=require('multer');var util=require(_0xd83c('0x0'));var path=require(_0xd83c('0x1'));var timeout=require(_0xd83c('0x2'));var express=require(_0xd83c('0x3'));var router=express[_0xd83c('0x4')]();var fs_extra=require(_0xd83c('0x5'));var auth=require(_0xd83c('0x6'));var interaction=require(_0xd83c('0x7'));var config=require(_0xd83c('0x8'));var controller=require(_0xd83c('0x9'));router[_0xd83c('0xa')]('/',auth[_0xd83c('0xb')](),controller[_0xd83c('0xc')]);router[_0xd83c('0xa')](_0xd83c('0xd'),auth[_0xd83c('0xb')](),controller[_0xd83c('0xe')]);router[_0xd83c('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd83c('0xa')](_0xd83c('0xf'),auth[_0xd83c('0xb')](),controller[_0xd83c('0x10')]);router['post']('/',auth[_0xd83c('0xb')](),controller[_0xd83c('0x11')]);router[_0xd83c('0x12')](_0xd83c('0x13'),auth[_0xd83c('0xb')](),controller[_0xd83c('0x14')]);router[_0xd83c('0x15')](_0xd83c('0xd'),auth[_0xd83c('0xb')](),controller['update']);router[_0xd83c('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd83c('0x17')]=router; \ No newline at end of file +var _0x9fe9=['get','index','/:id','show','/:id/configurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9fe9,0x184));var _0x99fe=function(_0x41368b,_0x1fa82d){_0x41368b=_0x41368b-0x0;var _0x251fcc=_0x9fe9[_0x41368b];return _0x251fcc;};'use strict';var multer=require(_0x99fe('0x0'));var util=require(_0x99fe('0x1'));var path=require(_0x99fe('0x2'));var timeout=require('connect-timeout');var express=require(_0x99fe('0x3'));var router=express[_0x99fe('0x4')]();var fs_extra=require(_0x99fe('0x5'));var auth=require(_0x99fe('0x6'));var interaction=require(_0x99fe('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0x99fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x99fe('0x9')]);router['get'](_0x99fe('0xa'),auth['isAuthenticated'](),controller[_0x99fe('0xb')]);router[_0x99fe('0x8')](_0x99fe('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x99fe('0x8')](_0x99fe('0xd'),auth[_0x99fe('0xe')](),controller[_0x99fe('0xf')]);router[_0x99fe('0x10')]('/',auth[_0x99fe('0xe')](),controller[_0x99fe('0x11')]);router['post'](_0x99fe('0xc'),auth['isAuthenticated'](),controller[_0x99fe('0x12')]);router[_0x99fe('0x13')](_0x99fe('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x99fe('0x14')](_0x99fe('0xa'),auth[_0x99fe('0xe')](),controller['destroy']);module[_0x99fe('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index a585563..d0d2229 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 _0x6c45=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0xc8f160,_0x251c85){var _0x550f88=function(_0x49d3cb){while(--_0x49d3cb){_0xc8f160['push'](_0xc8f160['shift']());}};_0x550f88(++_0x251c85);}(_0x6c45,0xb1));var _0x56c4=function(_0x1cf21a,_0x477fb6){_0x1cf21a=_0x1cf21a-0x0;var _0x4cffe4=_0x6c45[_0x1cf21a];return _0x4cffe4;};'use strict';var Sequelize=require(_0x56c4('0x0'));module[_0x56c4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x56c4('0x2')]},'username':{'type':Sequelize[_0x56c4('0x2')],'unique':_0x56c4('0x3')},'password':{'type':Sequelize[_0x56c4('0x2')]},'token':{'type':Sequelize[_0x56c4('0x2')]},'remoteUri':{'type':Sequelize[_0x56c4('0x2')],'unique':_0x56c4('0x4')},'authType':{'type':Sequelize[_0x56c4('0x5')](_0x56c4('0x6'),_0x56c4('0x7')),'defaultValue':_0x56c4('0x6')},'serverUrl':{'type':Sequelize[_0x56c4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x56c4('0x5')](_0x56c4('0x8'),_0x56c4('0x9')),'defaultValue':_0x56c4('0x8')}}; \ No newline at end of file +var _0x01d9=['sequelize','exports','STRING','username','remoteUri','ENUM','password','integrationTab','newTab'];(function(_0x1fd292,_0x20dbb4){var _0x210c35=function(_0x30b8cd){while(--_0x30b8cd){_0x1fd292['push'](_0x1fd292['shift']());}};_0x210c35(++_0x20dbb4);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x901d('0x0'));module[_0x901d('0x1')]={'name':{'type':Sequelize[_0x901d('0x2')]},'description':{'type':Sequelize[_0x901d('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x901d('0x3')},'password':{'type':Sequelize[_0x901d('0x2')]},'token':{'type':Sequelize[_0x901d('0x2')]},'remoteUri':{'type':Sequelize[_0x901d('0x2')],'unique':_0x901d('0x4')},'authType':{'type':Sequelize[_0x901d('0x5')](_0x901d('0x6'),'token'),'defaultValue':_0x901d('0x6')},'serverUrl':{'type':Sequelize[_0x901d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x901d('0x5')](_0x901d('0x7'),_0x901d('0x8')),'defaultValue':_0x901d('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5ea3483..b75ca21 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 _0xe511=['getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','ZendeskConfiguration','create','getFields','username','password','authType','remoteUri','substring','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','token','%s/token:%s','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','send','test','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','stack','index','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskAccount','includeAll','include','findAll','catch','show','params','rawAttributes','fields','options','body','find','nolimit'];(function(_0x301690,_0xb4780b){var _0x36e109=function(_0x55e015){while(--_0x55e015){_0x301690['push'](_0x301690['shift']());}};_0x36e109(++_0xb4780b);}(_0xe511,0x16f));var _0x1e51=function(_0x3db1f7,_0x2beb9b){_0x3db1f7=_0x3db1f7-0x0;var _0x5016ed=_0xe511[_0x3db1f7];return _0x5016ed;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];var integrations=require(_0x1e51('0x18'));function respondWithStatusCode(_0x5544eb,_0x408a77){_0x408a77=_0x408a77||0xcc;return function(_0x102f01){if(_0x102f01){return _0x5544eb[_0x1e51('0x19')](_0x408a77);}return _0x5544eb[_0x1e51('0x1a')](_0x408a77)[_0x1e51('0x1b')]();};}function respondWithResult(_0x32945d,_0x441c70){_0x441c70=_0x441c70||0xc8;return function(_0x467e77){if(_0x467e77){return _0x32945d[_0x1e51('0x1a')](_0x441c70)[_0x1e51('0x1c')](_0x467e77);}};}function respondWithFilteredResult(_0x5a5c07,_0x3b01b7){return function(_0x24db4f){if(_0x24db4f){var _0x4526b4=typeof _0x3b01b7['offset']===_0x1e51('0x1d')&&typeof _0x3b01b7['limit']==='undefined';var _0x1f6f4e=_0x24db4f[_0x1e51('0x1e')];var _0x40ae4c=_0x4526b4?0x0:_0x3b01b7[_0x1e51('0x1f')];var _0x4d1aae=_0x4526b4?_0x24db4f[_0x1e51('0x1e')]:_0x3b01b7['offset']+_0x3b01b7[_0x1e51('0x20')];var _0x4a9272;if(_0x4d1aae>=_0x1f6f4e){_0x4d1aae=_0x1f6f4e;_0x4a9272=0xc8;}else{_0x4a9272=0xce;}_0x5a5c07[_0x1e51('0x1a')](_0x4a9272);return _0x5a5c07[_0x1e51('0x21')](_0x1e51('0x22'),_0x40ae4c+'-'+_0x4d1aae+'/'+_0x1f6f4e)[_0x1e51('0x1c')](_0x24db4f);}return null;};}function patchUpdates(_0x506f40){return function(_0x5223c3){try{jsonpatch['apply'](_0x5223c3,_0x506f40,!![]);}catch(_0x548c32){return BPromise[_0x1e51('0x23')](_0x548c32);}return _0x5223c3['save']();};}function saveUpdates(_0x3f7340,_0x28aacb){return function(_0x415154){if(_0x415154){return _0x415154[_0x1e51('0x24')](_0x3f7340)[_0x1e51('0x25')](function(_0xf9298){return _0xf9298;});}return null;};}function removeEntity(_0x270adf,_0x461d3d){return function(_0x4bcdd3){if(_0x4bcdd3){return _0x4bcdd3['destroy']()[_0x1e51('0x25')](function(){_0x270adf[_0x1e51('0x1a')](0xcc)[_0x1e51('0x1b')]();});}};}function handleEntityNotFound(_0x1386db,_0x505d79){return function(_0x54d031){if(!_0x54d031){_0x1386db['sendStatus'](0x194);}return _0x54d031;};}function handleError(_0x1eb83f,_0x2a1561){_0x2a1561=_0x2a1561||0x1f4;return function(_0x433c2d){logger['error'](_0x433c2d[_0x1e51('0x26')]);if(_0x433c2d['name']){delete _0x433c2d['name'];}_0x1eb83f[_0x1e51('0x1a')](_0x2a1561)['send'](_0x433c2d);};}exports[_0x1e51('0x27')]=function(_0x1eb79f,_0x56722f){var _0x3e6ef2={},_0x10ee23={},_0x71c7af={'count':0x0,'rows':[]};var _0x6862d1=_['map'](db['ZendeskAccount']['rawAttributes'],function(_0x20eb9b){return{'name':_0x20eb9b[_0x1e51('0x28')],'type':_0x20eb9b[_0x1e51('0x29')][_0x1e51('0x2a')]};});_0x10ee23[_0x1e51('0x2b')]=_[_0x1e51('0x2c')](_0x6862d1,_0x1e51('0x2d'));_0x10ee23[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x1eb79f[_0x1e51('0x2e')]);_0x10ee23[_0x1e51('0x30')]=_['intersection'](_0x10ee23[_0x1e51('0x2b')],_0x10ee23[_0x1e51('0x2e')]);_0x3e6ef2[_0x1e51('0x31')]=_[_0x1e51('0x32')](_0x10ee23[_0x1e51('0x2b')],qs['fields'](_0x1eb79f[_0x1e51('0x2e')]['fields']));_0x3e6ef2[_0x1e51('0x31')]=_0x3e6ef2[_0x1e51('0x31')][_0x1e51('0x33')]?_0x3e6ef2['attributes']:_0x10ee23[_0x1e51('0x2b')];if(!_0x1eb79f['query'][_0x1e51('0x34')]('nolimit')){_0x3e6ef2['limit']=qs[_0x1e51('0x20')](_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x20')]);_0x3e6ef2['offset']=qs[_0x1e51('0x1f')](_0x1eb79f['query'][_0x1e51('0x1f')]);}_0x3e6ef2[_0x1e51('0x35')]=qs['sort'](_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x36')]);_0x3e6ef2[_0x1e51('0x37')]=qs[_0x1e51('0x30')](_[_0x1e51('0x38')](_0x1eb79f[_0x1e51('0x2e')],_0x10ee23['filters']),_0x6862d1);if(_0x1eb79f['query'][_0x1e51('0x39')]){_0x3e6ef2['where']=_[_0x1e51('0x3a')](_0x3e6ef2[_0x1e51('0x37')],{'$or':_[_0x1e51('0x2c')](_0x6862d1,function(_0xcfa1d8){if(_0xcfa1d8[_0x1e51('0x29')]!==_0x1e51('0x3b')){var _0x845a62={};_0x845a62[_0xcfa1d8[_0x1e51('0x2d')]]={'$like':'%'+_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x39')]+'%'};return _0x845a62;}})});}_0x3e6ef2=_[_0x1e51('0x3a')]({},_0x3e6ef2,_0x1eb79f['options']);var _0x29a689={'where':_0x3e6ef2['where']};return db[_0x1e51('0x3c')][_0x1e51('0x1e')](_0x29a689)[_0x1e51('0x25')](function(_0x471386){_0x71c7af[_0x1e51('0x1e')]=_0x471386;if(_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x3d')]){_0x3e6ef2[_0x1e51('0x3e')]=[{'all':!![]}];}return db[_0x1e51('0x3c')][_0x1e51('0x3f')](_0x3e6ef2);})[_0x1e51('0x25')](function(_0x5b4b3f){_0x71c7af['rows']=_0x5b4b3f;return _0x71c7af;})[_0x1e51('0x25')](respondWithFilteredResult(_0x56722f,_0x3e6ef2))[_0x1e51('0x40')](handleError(_0x56722f,null));};exports[_0x1e51('0x41')]=function(_0x4650e4,_0x1ef3d3){var _0x1a9e0d={'raw':![],'where':{'id':_0x4650e4[_0x1e51('0x42')]['id']}},_0x25592c={};_0x25592c['model']=_[_0x1e51('0x2f')](db[_0x1e51('0x3c')][_0x1e51('0x43')]);_0x25592c[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x4650e4[_0x1e51('0x2e')]);_0x25592c[_0x1e51('0x30')]=_['intersection'](_0x25592c[_0x1e51('0x2b')],_0x25592c[_0x1e51('0x2e')]);_0x1a9e0d['attributes']=_[_0x1e51('0x32')](_0x25592c[_0x1e51('0x2b')],qs[_0x1e51('0x44')](_0x4650e4['query'][_0x1e51('0x44')]));_0x1a9e0d[_0x1e51('0x31')]=_0x1a9e0d[_0x1e51('0x31')][_0x1e51('0x33')]?_0x1a9e0d[_0x1e51('0x31')]:_0x25592c[_0x1e51('0x2b')];if(_0x4650e4[_0x1e51('0x2e')][_0x1e51('0x3d')]){_0x1a9e0d[_0x1e51('0x3e')]=[{'all':!![]}];}_0x1a9e0d=_['merge']({},_0x1a9e0d,_0x4650e4[_0x1e51('0x45')]);return db[_0x1e51('0x3c')]['find'](_0x1a9e0d)[_0x1e51('0x25')](handleEntityNotFound(_0x1ef3d3,null))[_0x1e51('0x25')](respondWithResult(_0x1ef3d3,null))[_0x1e51('0x40')](handleError(_0x1ef3d3,null));};exports['create']=function(_0x44468a,_0x4634de){return db[_0x1e51('0x3c')]['create'](_0x44468a[_0x1e51('0x46')],{})['then'](respondWithResult(_0x4634de,0xc9))['catch'](handleError(_0x4634de,null));};exports['update']=function(_0x169e6c,_0x2e79ca){if(_0x169e6c['body']['id']){delete _0x169e6c['body']['id'];}return db[_0x1e51('0x3c')][_0x1e51('0x47')]({'where':{'id':_0x169e6c[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x2e79ca,null))[_0x1e51('0x25')](saveUpdates(_0x169e6c[_0x1e51('0x46')],null))['then'](respondWithResult(_0x2e79ca,null))[_0x1e51('0x40')](handleError(_0x2e79ca,null));};exports['destroy']=function(_0xf6bd35,_0x43589a){return db['ZendeskAccount']['find']({'where':{'id':_0xf6bd35['params']['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x43589a,null))[_0x1e51('0x25')](removeEntity(_0x43589a,null))[_0x1e51('0x40')](handleError(_0x43589a,null));};exports['getConfigurations']=function(_0x2fdee1,_0x1fe669,_0x4226da){var _0x2100d4={};var _0x1ccb55={};var _0x12584c;var _0x32fe1f;return db[_0x1e51('0x3c')]['findOne']({'where':{'id':_0x2fdee1[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x1fe669,null))[_0x1e51('0x25')](function(_0x213edb){if(_0x213edb){_0x12584c=_0x213edb;_0x1ccb55[_0x1e51('0x2b')]=_[_0x1e51('0x2f')](db['ZendeskConfiguration'][_0x1e51('0x43')]);_0x1ccb55['query']=_['keys'](_0x2fdee1['query']);_0x1ccb55[_0x1e51('0x30')]=_[_0x1e51('0x32')](_0x1ccb55[_0x1e51('0x2b')],_0x1ccb55['query']);_0x2100d4[_0x1e51('0x31')]=_[_0x1e51('0x32')](_0x1ccb55[_0x1e51('0x2b')],qs['fields'](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x44')]));_0x2100d4[_0x1e51('0x31')]=_0x2100d4['attributes'][_0x1e51('0x33')]?_0x2100d4[_0x1e51('0x31')]:_0x1ccb55[_0x1e51('0x2b')];_0x2100d4[_0x1e51('0x35')]=qs[_0x1e51('0x36')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x36')]);_0x2100d4[_0x1e51('0x37')]=qs['filters'](_[_0x1e51('0x38')](_0x2fdee1[_0x1e51('0x2e')],_0x1ccb55['filters']));if(_0x2fdee1['query']['filter']){_0x2100d4[_0x1e51('0x37')]=_[_0x1e51('0x3a')](_0x2100d4[_0x1e51('0x37')],{'$or':_[_0x1e51('0x2c')](_0x2100d4[_0x1e51('0x31')],function(_0x3c322c){var _0x45b649={};_0x45b649[_0x3c322c]={'$like':'%'+_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x39')]+'%'};return _0x45b649;})});}_0x2100d4=_['merge']({},_0x2100d4,_0x2fdee1['options']);return _0x12584c['getConfigurations'](_0x2100d4);}})[_0x1e51('0x25')](function(_0x4048a4){if(_0x4048a4){_0x32fe1f=_0x4048a4['length'];if(!_0x2fdee1['query'][_0x1e51('0x34')](_0x1e51('0x48'))){_0x2100d4['limit']=qs[_0x1e51('0x20')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x20')]);_0x2100d4[_0x1e51('0x1f')]=qs[_0x1e51('0x1f')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x1f')]);}return _0x12584c[_0x1e51('0x49')](_0x2100d4);}})[_0x1e51('0x25')](function(_0x32863f){if(_0x32863f){return _0x32863f?{'count':_0x32fe1f,'rows':_0x32863f}:null;}})['then'](respondWithResult(_0x1fe669,null))[_0x1e51('0x40')](handleError(_0x1fe669,null));};exports[_0x1e51('0x4a')]=function(_0x3657a2,_0x402bbd,_0xc720e2){if(_0x3657a2[_0x1e51('0x46')]['id']){delete _0x3657a2['body']['id'];}return db['ZendeskAccount'][_0x1e51('0x4b')]({'where':{'id':_0x3657a2[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x402bbd,null))[_0x1e51('0x25')](function(_0x52a439){if(_0x52a439){_0x3657a2['body']['AccountId']=_0x52a439['id'];_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4c')]=integrations[_0x1e51('0x4d')](_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4e')],_0x3657a2['body'][_0x1e51('0x29')]);_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4f')]=integrations['getDescriptions'](_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4e')],_0x3657a2[_0x1e51('0x46')]['type']);return db[_0x1e51('0x50')][_0x1e51('0x51')](_0x3657a2['body'],{'include':[{'model':db['ZendeskField'],'as':_0x1e51('0x4c')},{'model':db['ZendeskField'],'as':_0x1e51('0x4f')}]});}return null;})['then'](respondWithResult(_0x402bbd,null))[_0x1e51('0x40')](handleError(_0x402bbd,null));};exports[_0x1e51('0x52')]=function(_0x35f12e,_0x457e4a,_0x5142ed){var _0x37f3e6='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x35f12e[_0x1e51('0x42')]['id']},'attributes':['id',_0x1e51('0x53'),_0x1e51('0x54'),'token',_0x1e51('0x55'),_0x1e51('0x56')]})[_0x1e51('0x25')](handleEntityNotFound(_0x457e4a,null))[_0x1e51('0x25')](function(_0x5b76ae){if(_0x5b76ae){_0x37f3e6=_0x5b76ae[_0x1e51('0x56')];var _0x5ef17b=_0x37f3e6['slice'](-0x1);if(_0x5ef17b==='/'){_0x37f3e6=_0x37f3e6[_0x1e51('0x57')](0x0,_0x37f3e6['lastIndexOf'](_0x5ef17b));}var _0x35ece9={'method':'GET','uri':util[_0x1e51('0x58')]('%s/%s',_0x37f3e6,_0x1e51('0x59')),'json':!![]};switch(_0x5b76ae[_0x1e51('0x55')]){case'password':_0x35ece9[_0x1e51('0x5a')]={'Authorization':util['format'](_0x1e51('0x5b'),new Buffer(util[_0x1e51('0x58')](_0x1e51('0x5c'),_0x5b76ae[_0x1e51('0x53')],_0x5b76ae[_0x1e51('0x54')]))[_0x1e51('0x5d')]('base64'))};break;case _0x1e51('0x5e'):_0x35ece9['headers']={'Authorization':util['format'](_0x1e51('0x5b'),new Buffer(util[_0x1e51('0x58')](_0x1e51('0x5f'),_0x5b76ae[_0x1e51('0x53')],_0x5b76ae[_0x1e51('0x5e')]))[_0x1e51('0x5d')](_0x1e51('0x60')))};break;default:throw new db['Sequelize'][(_0x1e51('0x61'))](_0x1e51('0x62'));}return rp(_0x35ece9);}})[_0x1e51('0x25')](function(_0x4c6920){if(_0x4c6920){var _0x4da887=[_0x1e51('0x63'),_0x1e51('0x64'),'group',_0x1e51('0x65')];_[_0x1e51('0x66')](_0x4c6920['ticket_fields'],function(_0x5eb939){return _0x4da887[_0x1e51('0x67')](_0x5eb939[_0x1e51('0x29')]);});return{'count':_0x4c6920[_0x1e51('0x59')][_0x1e51('0x33')],'rows':_[_0x1e51('0x2c')](_0x4c6920[_0x1e51('0x59')],function(_0x3718d9){return{'id':_0x3718d9['id'],'name':_0x3718d9['position']>0x7?_0x3718d9['title']:_0x3718d9[_0x1e51('0x29')],'custom':_0x3718d9[_0x1e51('0x68')]>0x7?!![]:![],'options':_0x3718d9['system_field_options']?_0x3718d9[_0x1e51('0x69')]:_0x3718d9[_0x1e51('0x6a')]?_0x3718d9['custom_field_options']:[]};})};}})[_0x1e51('0x25')](respondWithResult(_0x457e4a,null))['catch'](function(_0x34b98f){var _0x561812=_0x35f12e['query']['test']?0x1f4:_0x34b98f['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x1e51('0x52'),_0x561812,JSON['stringify'](_0x34b98f));delete _0x34b98f[_0x1e51('0x2d')];if(_0x561812===0x191){_0x561812=0x190;}_0x457e4a['status'](_0x561812)[_0x1e51('0x6b')](_0x35f12e[_0x1e51('0x2e')][_0x1e51('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x34b98f[_0x1e51('0x6d')]}:_0x34b98f);});}; \ No newline at end of file +var _0xe706=['getConfigurations','findOne','ZendeskConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','format','password','headers','Basic\x20%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','show','includeAll','include','find','create','body','catch','params'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0xe706,0xa3));var _0x6e70=function(_0x5d9c37,_0x518b93){_0x5d9c37=_0x5d9c37-0x0;var _0x1ba9eb=_0xe706[_0x5d9c37];return _0x1ba9eb;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];var integrations=require(_0x6e70('0x1d'));function respondWithStatusCode(_0x3b38f3,_0x310eb7){_0x310eb7=_0x310eb7||0xcc;return function(_0xa1eb74){if(_0xa1eb74){return _0x3b38f3[_0x6e70('0x1e')](_0x310eb7);}return _0x3b38f3['status'](_0x310eb7)['end']();};}function respondWithResult(_0x48bc72,_0x257e81){_0x257e81=_0x257e81||0xc8;return function(_0x5a37a6){if(_0x5a37a6){return _0x48bc72['status'](_0x257e81)[_0x6e70('0x1f')](_0x5a37a6);}};}function respondWithFilteredResult(_0x22c50c,_0x5d9263){return function(_0x24f3ac){if(_0x24f3ac){var _0x5c3fe7=typeof _0x5d9263[_0x6e70('0x20')]===_0x6e70('0x21')&&typeof _0x5d9263['limit']==='undefined';var _0x3bd572=_0x24f3ac['count'];var _0x28a21f=_0x5c3fe7?0x0:_0x5d9263[_0x6e70('0x20')];var _0x53acdc=_0x5c3fe7?_0x24f3ac['count']:_0x5d9263[_0x6e70('0x20')]+_0x5d9263[_0x6e70('0x22')];var _0x2368eb;if(_0x53acdc>=_0x3bd572){_0x53acdc=_0x3bd572;_0x2368eb=0xc8;}else{_0x2368eb=0xce;}_0x22c50c[_0x6e70('0x23')](_0x2368eb);return _0x22c50c[_0x6e70('0x24')](_0x6e70('0x25'),_0x28a21f+'-'+_0x53acdc+'/'+_0x3bd572)[_0x6e70('0x1f')](_0x24f3ac);}return null;};}function patchUpdates(_0x44a49f){return function(_0x29326f){try{jsonpatch[_0x6e70('0x26')](_0x29326f,_0x44a49f,!![]);}catch(_0x4a0cfe){return BPromise[_0x6e70('0x27')](_0x4a0cfe);}return _0x29326f[_0x6e70('0x28')]();};}function saveUpdates(_0x27b294,_0x502b2d){return function(_0x3ccd87){if(_0x3ccd87){return _0x3ccd87[_0x6e70('0x29')](_0x27b294)[_0x6e70('0x2a')](function(_0x50da2c){return _0x50da2c;});}return null;};}function removeEntity(_0x10fc91,_0x538b9c){return function(_0x50aec2){if(_0x50aec2){return _0x50aec2['destroy']()[_0x6e70('0x2a')](function(){_0x10fc91[_0x6e70('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecdf1,_0x1196ed){return function(_0x5f268f){if(!_0x5f268f){_0x3ecdf1[_0x6e70('0x1e')](0x194);}return _0x5f268f;};}function handleError(_0x67fb43,_0x2bb231){_0x2bb231=_0x2bb231||0x1f4;return function(_0x4a67ac){logger['error'](_0x4a67ac[_0x6e70('0x2b')]);if(_0x4a67ac[_0x6e70('0x2c')]){delete _0x4a67ac[_0x6e70('0x2c')];}_0x67fb43[_0x6e70('0x23')](_0x2bb231)[_0x6e70('0x2d')](_0x4a67ac);};}exports['index']=function(_0x1952ea,_0x406f29){var _0xecf336={},_0x2864a0={},_0x396a67={'count':0x0,'rows':[]};var _0x20a225=_[_0x6e70('0x2e')](db[_0x6e70('0x2f')][_0x6e70('0x30')],function(_0x3a5d30){return{'name':_0x3a5d30['fieldName'],'type':_0x3a5d30[_0x6e70('0x31')]['key']};});_0x2864a0[_0x6e70('0x32')]=_['map'](_0x20a225,_0x6e70('0x2c'));_0x2864a0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1952ea['query']);_0x2864a0[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x2864a0['model'],_0x2864a0[_0x6e70('0x33')]);_0xecf336[_0x6e70('0x37')]=_['intersection'](_0x2864a0[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x38')]));_0xecf336[_0x6e70('0x37')]=_0xecf336[_0x6e70('0x37')][_0x6e70('0x39')]?_0xecf336[_0x6e70('0x37')]:_0x2864a0[_0x6e70('0x32')];if(!_0x1952ea[_0x6e70('0x33')]['hasOwnProperty'](_0x6e70('0x3a'))){_0xecf336['limit']=qs[_0x6e70('0x22')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x22')]);_0xecf336[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x20')]);}_0xecf336[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3c')]);_0xecf336[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_['pick'](_0x1952ea['query'],_0x2864a0['filters']),_0x20a225);if(_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]){_0xecf336[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0xecf336[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x20a225,function(_0x572a71){if(_0x572a71[_0x6e70('0x31')]!==_0x6e70('0x40')){var _0x1c5cde={};_0x1c5cde[_0x572a71[_0x6e70('0x2c')]]={'$like':'%'+_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]+'%'};return _0x1c5cde;}})});}_0xecf336=_[_0x6e70('0x3f')]({},_0xecf336,_0x1952ea[_0x6e70('0x41')]);var _0x5be100={'where':_0xecf336[_0x6e70('0x3d')]};return db[_0x6e70('0x2f')][_0x6e70('0x42')](_0x5be100)[_0x6e70('0x2a')](function(_0x201da9){_0x396a67[_0x6e70('0x42')]=_0x201da9;if(_0x1952ea[_0x6e70('0x33')]['includeAll']){_0xecf336['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x6e70('0x43')](_0xecf336);})[_0x6e70('0x2a')](function(_0x83847b){_0x396a67[_0x6e70('0x44')]=_0x83847b;return _0x396a67;})[_0x6e70('0x2a')](respondWithFilteredResult(_0x406f29,_0xecf336))['catch'](handleError(_0x406f29,null));};exports[_0x6e70('0x45')]=function(_0x2a58d7,_0x2a2aca){var _0x52b197={'raw':![],'where':{'id':_0x2a58d7['params']['id']}},_0x544ad0={};_0x544ad0[_0x6e70('0x32')]=_['keys'](db[_0x6e70('0x2f')][_0x6e70('0x30')]);_0x544ad0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x2a58d7['query']);_0x544ad0[_0x6e70('0x35')]=_['intersection'](_0x544ad0[_0x6e70('0x32')],_0x544ad0[_0x6e70('0x33')]);_0x52b197[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x544ad0['model'],qs[_0x6e70('0x38')](_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x38')]));_0x52b197[_0x6e70('0x37')]=_0x52b197[_0x6e70('0x37')][_0x6e70('0x39')]?_0x52b197[_0x6e70('0x37')]:_0x544ad0['model'];if(_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x46')]){_0x52b197[_0x6e70('0x47')]=[{'all':!![]}];}_0x52b197=_[_0x6e70('0x3f')]({},_0x52b197,_0x2a58d7[_0x6e70('0x41')]);return db[_0x6e70('0x2f')][_0x6e70('0x48')](_0x52b197)['then'](handleEntityNotFound(_0x2a2aca,null))[_0x6e70('0x2a')](respondWithResult(_0x2a2aca,null))['catch'](handleError(_0x2a2aca,null));};exports[_0x6e70('0x49')]=function(_0x3836e4,_0x4b351e){return db['ZendeskAccount'][_0x6e70('0x49')](_0x3836e4[_0x6e70('0x4a')],{})[_0x6e70('0x2a')](respondWithResult(_0x4b351e,0xc9))['catch'](handleError(_0x4b351e,null));};exports['update']=function(_0x238ebb,_0x11ac3d){if(_0x238ebb[_0x6e70('0x4a')]['id']){delete _0x238ebb[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x238ebb['params']['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x11ac3d,null))[_0x6e70('0x2a')](saveUpdates(_0x238ebb[_0x6e70('0x4a')],null))[_0x6e70('0x2a')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['destroy']=function(_0x4ae901,_0x2c5538){return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4ae901[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x2c5538,null))['then'](removeEntity(_0x2c5538,null))[_0x6e70('0x4b')](handleError(_0x2c5538,null));};exports[_0x6e70('0x4d')]=function(_0x1fa320,_0x23ebfb,_0x3aba34){var _0x4a111a={};var _0x1142cd={};var _0x1dd242;var _0x2c20d3;return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x1fa320[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23ebfb,null))[_0x6e70('0x2a')](function(_0x8d425d){if(_0x8d425d){_0x1dd242=_0x8d425d;_0x1142cd['model']=_[_0x6e70('0x34')](db[_0x6e70('0x4f')]['rawAttributes']);_0x1142cd[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1fa320[_0x6e70('0x33')]);_0x1142cd[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x1142cd['model'],_0x1142cd[_0x6e70('0x33')]);_0x4a111a[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x1142cd[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x38')]));_0x4a111a[_0x6e70('0x37')]=_0x4a111a[_0x6e70('0x37')][_0x6e70('0x39')]?_0x4a111a[_0x6e70('0x37')]:_0x1142cd[_0x6e70('0x32')];_0x4a111a[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3c')]);_0x4a111a[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_[_0x6e70('0x50')](_0x1fa320[_0x6e70('0x33')],_0x1142cd['filters']));if(_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3e')]){_0x4a111a[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0x4a111a[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x4a111a['attributes'],function(_0x42bd85){var _0x6cabf0={};_0x6cabf0[_0x42bd85]={'$like':'%'+_0x1fa320['query'][_0x6e70('0x3e')]+'%'};return _0x6cabf0;})});}_0x4a111a=_[_0x6e70('0x3f')]({},_0x4a111a,_0x1fa320[_0x6e70('0x41')]);return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2f9be4){if(_0x2f9be4){_0x2c20d3=_0x2f9be4[_0x6e70('0x39')];if(!_0x1fa320[_0x6e70('0x33')][_0x6e70('0x51')](_0x6e70('0x3a'))){_0x4a111a[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x1fa320['query']['limit']);_0x4a111a[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x20')]);}return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2e972b){if(_0x2e972b){return _0x2e972b?{'count':_0x2c20d3,'rows':_0x2e972b}:null;}})[_0x6e70('0x2a')](respondWithResult(_0x23ebfb,null))['catch'](handleError(_0x23ebfb,null));};exports['addConfiguration']=function(_0x355708,_0x47fbed,_0x2a8fb7){if(_0x355708[_0x6e70('0x4a')]['id']){delete _0x355708[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x355708[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x47fbed,null))[_0x6e70('0x2a')](function(_0x570115){if(_0x570115){_0x355708[_0x6e70('0x4a')][_0x6e70('0x52')]=_0x570115['id'];_0x355708[_0x6e70('0x4a')][_0x6e70('0x53')]=integrations[_0x6e70('0x54')](_0x355708['body']['channel'],_0x355708['body'][_0x6e70('0x31')]);_0x355708[_0x6e70('0x4a')][_0x6e70('0x55')]=integrations['getDescriptions'](_0x355708['body'][_0x6e70('0x56')],_0x355708[_0x6e70('0x4a')][_0x6e70('0x31')]);return db[_0x6e70('0x4f')][_0x6e70('0x49')](_0x355708[_0x6e70('0x4a')],{'include':[{'model':db['ZendeskField'],'as':_0x6e70('0x53')},{'model':db[_0x6e70('0x57')],'as':_0x6e70('0x55')}]});}return null;})[_0x6e70('0x2a')](respondWithResult(_0x47fbed,null))['catch'](handleError(_0x47fbed,null));};exports[_0x6e70('0x58')]=function(_0x531097,_0x5b4046,_0x30487b){var _0x3249a5='';return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x531097[_0x6e70('0x4c')]['id']},'attributes':['id',_0x6e70('0x59'),'password',_0x6e70('0x5a'),_0x6e70('0x5b'),_0x6e70('0x5c')]})[_0x6e70('0x2a')](handleEntityNotFound(_0x5b4046,null))[_0x6e70('0x2a')](function(_0x13c092){if(_0x13c092){_0x3249a5=_0x13c092[_0x6e70('0x5c')];var _0xd9b4a9=_0x3249a5[_0x6e70('0x5d')](-0x1);if(_0xd9b4a9==='/'){_0x3249a5=_0x3249a5[_0x6e70('0x5e')](0x0,_0x3249a5['lastIndexOf'](_0xd9b4a9));}var _0x44c877={'method':_0x6e70('0x5f'),'uri':util[_0x6e70('0x60')]('%s/%s',_0x3249a5,'ticket_fields'),'json':!![]};switch(_0x13c092[_0x6e70('0x5b')]){case _0x6e70('0x61'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util['format']('%s:%s',_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x61')]))['toString'](_0x6e70('0x64')))};break;case _0x6e70('0x5a'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util[_0x6e70('0x60')](_0x6e70('0x65'),_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x5a')]))[_0x6e70('0x66')](_0x6e70('0x64')))};break;default:throw new db[(_0x6e70('0x67'))][(_0x6e70('0x68'))](_0x6e70('0x69'));}return rp(_0x44c877);}})['then'](function(_0x5b3cb0){if(_0x5b3cb0){var _0x39ed95=['subject',_0x6e70('0x6a'),'group','assignee'];_[_0x6e70('0x6b')](_0x5b3cb0['ticket_fields'],function(_0x576069){return _0x39ed95[_0x6e70('0x6c')](_0x576069[_0x6e70('0x31')]);});return{'count':_0x5b3cb0[_0x6e70('0x6d')]['length'],'rows':_['map'](_0x5b3cb0['ticket_fields'],function(_0x3e7be7){return{'id':_0x3e7be7['id'],'name':_0x3e7be7['position']>0x7?_0x3e7be7[_0x6e70('0x6e')]:_0x3e7be7[_0x6e70('0x31')],'custom':_0x3e7be7[_0x6e70('0x6f')]>0x7?!![]:![],'options':_0x3e7be7[_0x6e70('0x70')]?_0x3e7be7[_0x6e70('0x70')]:_0x3e7be7[_0x6e70('0x71')]?_0x3e7be7[_0x6e70('0x71')]:[]};})};}})['then'](respondWithResult(_0x5b4046,null))[_0x6e70('0x4b')](function(_0x2493b0){var _0xb649a6=_0x531097['query'][_0x6e70('0x72')]?0x1f4:_0x2493b0[_0x6e70('0x73')]||0x1f4;logger[_0x6e70('0x74')](_0x6e70('0x75'),_0x6e70('0x58'),_0xb649a6,JSON[_0x6e70('0x76')](_0x2493b0));delete _0x2493b0[_0x6e70('0x2c')];if(_0xb649a6===0x191){_0xb649a6=0x190;}_0x5b4046[_0x6e70('0x23')](_0xb649a6)[_0x6e70('0x2d')](_0x531097['query'][_0x6e70('0x72')]?{'message':_0x6e70('0x77'),'statusCode':_0x2493b0['statusCode']}:_0x2493b0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 6f5d261..e9e5384 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 _0x250d=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x128b3c,_0x24692a){var _0x8fe7d0=function(_0x461544){while(--_0x461544){_0x128b3c['push'](_0x128b3c['shift']());}};_0x8fe7d0(++_0x24692a);}(_0x250d,0x184));var _0xd250=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0x250d[_0x22e9fe];return _0x47cd19;};'use strict';var _=require(_0xd250('0x0'));var util=require(_0xd250('0x1'));var logger=require(_0xd250('0x2'))(_0xd250('0x3'));var moment=require(_0xd250('0x4'));var BPromise=require(_0xd250('0x5'));var rp=require(_0xd250('0x6'));var fs=require('fs');var path=require(_0xd250('0x7'));var rimraf=require('rimraf');var config=require(_0xd250('0x8'));var attributes=require(_0xd250('0x9'));var integrations=require(_0xd250('0xa'));module[_0xd250('0xb')]=function(_0x55fa16,_0x527a39){return _0x55fa16[_0xd250('0xc')](_0xd250('0xd'),attributes,{'tableName':_0xd250('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc84d=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x9beac5,_0x47172c){var _0x318754=function(_0x63f29){while(--_0x63f29){_0x9beac5['push'](_0x9beac5['shift']());}};_0x318754(++_0x47172c);}(_0xc84d,0x114));var _0xdc84=function(_0x587543,_0x4bff1b){_0x587543=_0x587543-0x0;var _0x1fb87d=_0xc84d[_0x587543];return _0x1fb87d;};'use strict';var _=require(_0xdc84('0x0'));var util=require(_0xdc84('0x1'));var logger=require('../../config/logger')(_0xdc84('0x2'));var moment=require(_0xdc84('0x3'));var BPromise=require(_0xdc84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc84('0x5'));var rimraf=require('rimraf');var config=require(_0xdc84('0x6'));var attributes=require(_0xdc84('0x7'));var integrations=require(_0xdc84('0x8'));module[_0xdc84('0x9')]=function(_0x23f045,_0x51c45f){return _0x23f045[_0xdc84('0xa')](_0xdc84('0xb'),attributes,{'tableName':_0xdc84('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 b0cb083..8e6a25f 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 _0xc6c8=['randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ZendeskAccount','raw','where','options','attributes','limit','model','include','map','GetZendeskAccount','ShowZendeskAccount','then','debug','lodash','moment','bluebird'];(function(_0x483940,_0x4648ee){var _0x1d4b6e=function(_0x5d034e){while(--_0x5d034e){_0x483940['push'](_0x483940['shift']());}};_0x1d4b6e(++_0x4648ee);}(_0xc6c8,0x1bd));var _0x8c6c=function(_0x2c5c53,_0xa13e76){_0x2c5c53=_0x2c5c53-0x0;var _0x3ca866=_0xc6c8[_0x2c5c53];return _0x3ca866;};'use strict';var _=require(_0x8c6c('0x0'));var util=require('util');var moment=require(_0x8c6c('0x1'));var BPromise=require(_0x8c6c('0x2'));var rs=require(_0x8c6c('0x3'));var fs=require('fs');var Redis=require(_0x8c6c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8c6c('0x5'))('rpc');var config=require(_0x8c6c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8c6c('0x7')][_0x8c6c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40dbc4,_0x162f00,_0x2fe276){return new BPromise(function(_0x4bfa42,_0x28d460){return client[_0x8c6c('0x9')](_0x40dbc4,_0x2fe276)['then'](function(_0x255a36){logger[_0x8c6c('0xa')](_0x8c6c('0xb'),_0x162f00,_0x8c6c('0xc'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x162f00,_0x8c6c('0xc'),JSON[_0x8c6c('0xd')](_0x255a36));if(_0x255a36[_0x8c6c('0xe')]){if(_0x255a36[_0x8c6c('0xe')][_0x8c6c('0xf')]===0x1f4){logger['error'](_0x8c6c('0xb'),_0x162f00,_0x255a36[_0x8c6c('0xe')][_0x8c6c('0x10')]);return _0x28d460(_0x255a36[_0x8c6c('0xe')][_0x8c6c('0x10')]);}logger[_0x8c6c('0xe')](_0x8c6c('0xb'),_0x162f00,_0x255a36[_0x8c6c('0xe')][_0x8c6c('0x10')]);return _0x4bfa42(_0x255a36[_0x8c6c('0xe')][_0x8c6c('0x10')]);}else{logger['info'](_0x8c6c('0xb'),_0x162f00,'request\x20sent');_0x4bfa42(_0x255a36[_0x8c6c('0x11')]['message']);}})[_0x8c6c('0x12')](function(_0x171762){logger[_0x8c6c('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x162f00,_0x171762);_0x28d460(_0x171762);});});}exports['GetZendeskAccount']=function(_0x138e50){var _0x47d5b8=this;return new Promise(function(_0x13ed8d,_0x147233){return db[_0x8c6c('0x13')]['findAll']({'raw':_0x138e50['options']?_0x138e50['options'][_0x8c6c('0x14')]===undefined?!![]:![]:!![],'where':_0x138e50['options']?_0x138e50['options'][_0x8c6c('0x15')]||null:null,'attributes':_0x138e50[_0x8c6c('0x16')]?_0x138e50[_0x8c6c('0x16')][_0x8c6c('0x17')]||null:null,'limit':_0x138e50['options']?_0x138e50[_0x8c6c('0x16')][_0x8c6c('0x18')]||null:null,'include':_0x138e50[_0x8c6c('0x16')]?_0x138e50['options']['include']?_['map'](_0x138e50[_0x8c6c('0x16')]['include'],function(_0x46229c){return{'model':db[_0x46229c[_0x8c6c('0x19')]],'as':_0x46229c['as'],'attributes':_0x46229c[_0x8c6c('0x17')],'include':_0x46229c[_0x8c6c('0x1a')]?_[_0x8c6c('0x1b')](_0x46229c[_0x8c6c('0x1a')],function(_0x4710e9){return{'model':db[_0x4710e9[_0x8c6c('0x19')]],'as':_0x4710e9['as'],'attributes':_0x4710e9[_0x8c6c('0x17')],'include':_0x4710e9['include']?_[_0x8c6c('0x1b')](_0x4710e9[_0x8c6c('0x1a')],function(_0xd4a279){return{'model':db[_0xd4a279[_0x8c6c('0x19')]],'as':_0xd4a279['as'],'attributes':_0xd4a279[_0x8c6c('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x159e42){logger[_0x8c6c('0xa')](_0x8c6c('0x1c'),_0x138e50);logger['debug'](_0x8c6c('0x1c'),_0x138e50,JSON[_0x8c6c('0xd')](_0x159e42));_0x13ed8d(_0x159e42);})[_0x8c6c('0x12')](function(_0x5cfb83){logger[_0x8c6c('0xe')](_0x8c6c('0x1c'),_0x5cfb83['message'],_0x138e50);_0x147233(_0x47d5b8[_0x8c6c('0xe')](0x1f4,_0x5cfb83[_0x8c6c('0x10')]));});});};exports[_0x8c6c('0x1d')]=function(_0x275324){var _0x5ec857=this;return new Promise(function(_0x11c309,_0x19a986){return db['ZendeskAccount']['find']({'raw':_0x275324['options']?_0x275324[_0x8c6c('0x16')][_0x8c6c('0x14')]===undefined?!![]:![]:!![],'where':_0x275324[_0x8c6c('0x16')]?_0x275324[_0x8c6c('0x16')][_0x8c6c('0x15')]||null:null,'attributes':_0x275324[_0x8c6c('0x16')]?_0x275324['options'][_0x8c6c('0x17')]||null:null,'include':_0x275324[_0x8c6c('0x16')]?_0x275324[_0x8c6c('0x16')][_0x8c6c('0x1a')]?_[_0x8c6c('0x1b')](_0x275324[_0x8c6c('0x16')][_0x8c6c('0x1a')],function(_0x3ae725){return{'model':db[_0x3ae725[_0x8c6c('0x19')]],'as':_0x3ae725['as'],'attributes':_0x3ae725[_0x8c6c('0x17')],'include':_0x3ae725[_0x8c6c('0x1a')]?_[_0x8c6c('0x1b')](_0x3ae725[_0x8c6c('0x1a')],function(_0x8a2be9){return{'model':db[_0x8a2be9[_0x8c6c('0x19')]],'as':_0x8a2be9['as'],'attributes':_0x8a2be9[_0x8c6c('0x17')],'include':_0x8a2be9['include']?_[_0x8c6c('0x1b')](_0x8a2be9[_0x8c6c('0x1a')],function(_0x4c21d1){return{'model':db[_0x4c21d1['model']],'as':_0x4c21d1['as'],'attributes':_0x4c21d1[_0x8c6c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6c('0x1e')](function(_0x5814cc){logger[_0x8c6c('0xa')](_0x8c6c('0x1d'),_0x275324);logger[_0x8c6c('0x1f')](_0x8c6c('0x1d'),_0x275324,JSON['stringify'](_0x5814cc));_0x11c309(_0x5814cc);})[_0x8c6c('0x12')](function(_0x164bc8){logger[_0x8c6c('0xe')]('ShowZendeskAccount',_0x164bc8[_0x8c6c('0x10')],_0x275324);_0x19a986(_0x5ec857[_0x8c6c('0xe')](0x1f4,_0x164bc8[_0x8c6c('0x10')]));});});}; \ No newline at end of file +var _0x7e3e=['info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','ZendeskAccount','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x24e364,_0x22c22c){var _0x3921b0=function(_0x4f15d9){while(--_0x4f15d9){_0x24e364['push'](_0x24e364['shift']());}};_0x3921b0(++_0x22c22c);}(_0x7e3e,0x126));var _0xe7e3=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7e3e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xe7e3('0x0'));var util=require('util');var moment=require(_0xe7e3('0x1'));var BPromise=require(_0xe7e3('0x2'));var rs=require(_0xe7e3('0x3'));var fs=require('fs');var Redis=require(_0xe7e3('0x4'));var db=require(_0xe7e3('0x5'))['db'];var utils=require(_0xe7e3('0x6'));var logger=require(_0xe7e3('0x7'))(_0xe7e3('0x8'));var config=require(_0xe7e3('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x416828,_0x1551aa,_0x202718){return new BPromise(function(_0x49470f,_0x45ac24){return client[_0xe7e3('0xa')](_0x416828,_0x202718)[_0xe7e3('0xb')](function(_0x1f114c){logger[_0xe7e3('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x1551aa,_0xe7e3('0xd'));logger[_0xe7e3('0xe')](_0xe7e3('0xf'),_0x1551aa,_0xe7e3('0xd'),JSON['stringify'](_0x1f114c));if(_0x1f114c[_0xe7e3('0x10')]){if(_0x1f114c[_0xe7e3('0x10')][_0xe7e3('0x11')]===0x1f4){logger[_0xe7e3('0x10')](_0xe7e3('0x12'),_0x1551aa,_0x1f114c[_0xe7e3('0x10')][_0xe7e3('0x13')]);return _0x45ac24(_0x1f114c[_0xe7e3('0x10')]['message']);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1551aa,_0x1f114c[_0xe7e3('0x10')][_0xe7e3('0x13')]);return _0x49470f(_0x1f114c[_0xe7e3('0x10')]['message']);}else{logger[_0xe7e3('0xc')](_0xe7e3('0x12'),_0x1551aa,_0xe7e3('0xd'));_0x49470f(_0x1f114c[_0xe7e3('0x14')][_0xe7e3('0x13')]);}})['catch'](function(_0x1c3878){logger[_0xe7e3('0x10')](_0xe7e3('0x12'),_0x1551aa,_0x1c3878);_0x45ac24(_0x1c3878);});});}exports['GetZendeskAccount']=function(_0x25e3b9){var _0x5c34c5=this;return new Promise(function(_0x364d3d,_0x7ef16){return db[_0xe7e3('0x15')]['findAll']({'raw':_0x25e3b9[_0xe7e3('0x16')]?_0x25e3b9['options'][_0xe7e3('0x17')]===undefined?!![]:![]:!![],'where':_0x25e3b9[_0xe7e3('0x16')]?_0x25e3b9['options'][_0xe7e3('0x18')]||null:null,'attributes':_0x25e3b9['options']?_0x25e3b9[_0xe7e3('0x16')][_0xe7e3('0x19')]||null:null,'limit':_0x25e3b9[_0xe7e3('0x16')]?_0x25e3b9['options'][_0xe7e3('0x1a')]||null:null,'include':_0x25e3b9[_0xe7e3('0x16')]?_0x25e3b9[_0xe7e3('0x16')][_0xe7e3('0x1b')]?_[_0xe7e3('0x1c')](_0x25e3b9[_0xe7e3('0x16')]['include'],function(_0x2127a8){return{'model':db[_0x2127a8[_0xe7e3('0x1d')]],'as':_0x2127a8['as'],'attributes':_0x2127a8['attributes'],'include':_0x2127a8[_0xe7e3('0x1b')]?_['map'](_0x2127a8[_0xe7e3('0x1b')],function(_0x15417d){return{'model':db[_0x15417d[_0xe7e3('0x1d')]],'as':_0x15417d['as'],'attributes':_0x15417d[_0xe7e3('0x19')],'include':_0x15417d[_0xe7e3('0x1b')]?_[_0xe7e3('0x1c')](_0x15417d[_0xe7e3('0x1b')],function(_0x1054da){return{'model':db[_0x1054da[_0xe7e3('0x1d')]],'as':_0x1054da['as'],'attributes':_0x1054da[_0xe7e3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe7e3('0xb')](function(_0xacae31){logger[_0xe7e3('0xc')](_0xe7e3('0x1e'),_0x25e3b9);logger[_0xe7e3('0xe')](_0xe7e3('0x1e'),_0x25e3b9,JSON[_0xe7e3('0x1f')](_0xacae31));_0x364d3d(_0xacae31);})['catch'](function(_0x42e1df){logger[_0xe7e3('0x10')]('GetZendeskAccount',_0x42e1df['message'],_0x25e3b9);_0x7ef16(_0x5c34c5[_0xe7e3('0x10')](0x1f4,_0x42e1df[_0xe7e3('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x250144){var _0x27d995=this;return new Promise(function(_0x4f5291,_0x426b72){return db[_0xe7e3('0x15')]['find']({'raw':_0x250144[_0xe7e3('0x16')]?_0x250144['options'][_0xe7e3('0x17')]===undefined?!![]:![]:!![],'where':_0x250144[_0xe7e3('0x16')]?_0x250144['options'][_0xe7e3('0x18')]||null:null,'attributes':_0x250144[_0xe7e3('0x16')]?_0x250144['options'][_0xe7e3('0x19')]||null:null,'include':_0x250144[_0xe7e3('0x16')]?_0x250144['options']['include']?_[_0xe7e3('0x1c')](_0x250144[_0xe7e3('0x16')][_0xe7e3('0x1b')],function(_0x11ee03){return{'model':db[_0x11ee03[_0xe7e3('0x1d')]],'as':_0x11ee03['as'],'attributes':_0x11ee03[_0xe7e3('0x19')],'include':_0x11ee03['include']?_[_0xe7e3('0x1c')](_0x11ee03['include'],function(_0x2c0b25){return{'model':db[_0x2c0b25['model']],'as':_0x2c0b25['as'],'attributes':_0x2c0b25[_0xe7e3('0x19')],'include':_0x2c0b25['include']?_[_0xe7e3('0x1c')](_0x2c0b25[_0xe7e3('0x1b')],function(_0x4e42ed){return{'model':db[_0x4e42ed[_0xe7e3('0x1d')]],'as':_0x4e42ed['as'],'attributes':_0x4e42ed[_0xe7e3('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55a4a9){logger['info'](_0xe7e3('0x20'),_0x250144);logger[_0xe7e3('0xe')](_0xe7e3('0x20'),_0x250144,JSON[_0xe7e3('0x1f')](_0x55a4a9));_0x4f5291(_0x55a4a9);})[_0xe7e3('0x21')](function(_0x36c02d){logger[_0xe7e3('0x10')](_0xe7e3('0x20'),_0x36c02d[_0xe7e3('0x13')],_0x250144);_0x426b72(_0x27d995[_0xe7e3('0x10')](0x1f4,_0x36c02d['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 13ab47e..c01f4bc 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 _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x37828b,_0x56cafd){var _0x4c414d=function(_0x4638c1){while(--_0x4638c1){_0x37828b['push'](_0x37828b['shift']());}};_0x4c414d(++_0x56cafd);}(_0x5eb8,0xb0));var _0x85eb=function(_0xcd26a9,_0x512e77){_0xcd26a9=_0xcd26a9-0x0;var _0x3afcbc=_0x5eb8[_0xcd26a9];return _0x3afcbc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xb688,0xcf));var _0x8b68=function(_0x388cf8,_0x5f0ba3){_0x388cf8=_0x388cf8-0x0;var _0xbe7acf=_0xb688[_0x388cf8];return _0xbe7acf;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('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 3ef8951..40262ba 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 _0x5d1c=['STRING','sequelize','exports'];(function(_0x4dcd60,_0x25b0e2){var _0x37eb41=function(_0x42387d){while(--_0x42387d){_0x4dcd60['push'](_0x4dcd60['shift']());}};_0x37eb41(++_0x25b0e2);}(_0x5d1c,0xc1));var _0xc5d1=function(_0x53abac,_0x555d2c){_0x53abac=_0x53abac-0x0;var _0x5beb6f=_0x5d1c[_0x53abac];return _0x5beb6f;};'use strict';var Sequelize=require(_0xc5d1('0x0'));module[_0xc5d1('0x1')]={'name':{'type':Sequelize[_0xc5d1('0x2')]},'description':{'type':Sequelize[_0xc5d1('0x2')]}}; \ No newline at end of file +var _0xbfdf=['exports','STRING','sequelize'];(function(_0x26d173,_0x5d93f4){var _0x5efd81=function(_0x6c8a40){while(--_0x6c8a40){_0x26d173['push'](_0x26d173['shift']());}};_0x5efd81(++_0x5d93f4);}(_0xbfdf,0x1a6));var _0xfbfd=function(_0x55eee0,_0x5d1492){_0x55eee0=_0x55eee0-0x0;var _0x283f98=_0xbfdf[_0x55eee0];return _0x283f98;};'use strict';var Sequelize=require(_0xfbfd('0x0'));module[_0xfbfd('0x1')]={'name':{'type':Sequelize[_0xfbfd('0x2')]},'description':{'type':Sequelize[_0xfbfd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 33ca82c..4d826d3 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 _0xa9bf=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','moment','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x18d191,_0x49d54d){var _0x11dd16=function(_0x2f96ae){while(--_0x2f96ae){_0x18d191['push'](_0x18d191['shift']());}};_0x11dd16(++_0x49d54d);}(_0xa9bf,0x1a4));var _0xfa9b=function(_0x158feb,_0x2558ed){_0x158feb=_0x158feb-0x0;var _0x4dc9e0=_0xa9bf[_0x158feb];return _0x4dc9e0;};'use strict';var emlformat=require(_0xfa9b('0x0'));var rimraf=require(_0xfa9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa9b('0x2'));var BPromise=require(_0xfa9b('0x3'));var Mustache=require('mustache');var util=require(_0xfa9b('0x4'));var path=require(_0xfa9b('0x5'));var sox=require(_0xfa9b('0x6'));var csv=require('to-csv');var ejs=require(_0xfa9b('0x7'));var fs=require('fs');var fs_extra=require(_0xfa9b('0x8'));var _=require(_0xfa9b('0x9'));var squel=require('squel');var crypto=require(_0xfa9b('0xa'));var jsforce=require(_0xfa9b('0xb'));var deskjs=require(_0xfa9b('0xc'));var toCsv=require(_0xfa9b('0xd'));var querystring=require('querystring');var Papa=require(_0xfa9b('0xe'));var Redis=require(_0xfa9b('0xf'));var authService=require(_0xfa9b('0x10'));var qs=require(_0xfa9b('0x11'));var as=require(_0xfa9b('0x12'));var hardwareService=require(_0xfa9b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xfa9b('0x14'));var config=require(_0xfa9b('0x15'));var licenseUtil=require(_0xfa9b('0x16'));var db=require(_0xfa9b('0x17'))['db'];function respondWithStatusCode(_0x492a1c,_0x3e4689){_0x3e4689=_0x3e4689||0xcc;return function(_0x106d6a){if(_0x106d6a){return _0x492a1c[_0xfa9b('0x18')](_0x3e4689);}return _0x492a1c[_0xfa9b('0x19')](_0x3e4689)[_0xfa9b('0x1a')]();};}function respondWithResult(_0x2c7810,_0xe3514f){_0xe3514f=_0xe3514f||0xc8;return function(_0x3bd743){if(_0x3bd743){return _0x2c7810['status'](_0xe3514f)[_0xfa9b('0x1b')](_0x3bd743);}};}function respondWithFilteredResult(_0x4c5792,_0x5360ff){return function(_0x5c5dd5){if(_0x5c5dd5){var _0x5e9515=typeof _0x5360ff[_0xfa9b('0x1c')]===_0xfa9b('0x1d')&&typeof _0x5360ff[_0xfa9b('0x1e')]===_0xfa9b('0x1d');var _0x394130=_0x5c5dd5['count'];var _0x1aafee=_0x5e9515?0x0:_0x5360ff[_0xfa9b('0x1c')];var _0x18d280=_0x5e9515?_0x5c5dd5[_0xfa9b('0x1f')]:_0x5360ff[_0xfa9b('0x1c')]+_0x5360ff['limit'];var _0x18f7b5;if(_0x18d280>=_0x394130){_0x18d280=_0x394130;_0x18f7b5=0xc8;}else{_0x18f7b5=0xce;}_0x4c5792[_0xfa9b('0x19')](_0x18f7b5);return _0x4c5792[_0xfa9b('0x20')](_0xfa9b('0x21'),_0x1aafee+'-'+_0x18d280+'/'+_0x394130)[_0xfa9b('0x1b')](_0x5c5dd5);}return null;};}function patchUpdates(_0x1153f4){return function(_0x3be5f3){try{jsonpatch['apply'](_0x3be5f3,_0x1153f4,!![]);}catch(_0x21c765){return BPromise[_0xfa9b('0x22')](_0x21c765);}return _0x3be5f3[_0xfa9b('0x23')]();};}function saveUpdates(_0x4c7fca,_0x3fb24c){return function(_0x2a59a3){if(_0x2a59a3){return _0x2a59a3[_0xfa9b('0x24')](_0x4c7fca)[_0xfa9b('0x25')](function(_0xee9819){return _0xee9819;});}return null;};}function removeEntity(_0x2a9cce,_0x1b8672){return function(_0x4acac3){if(_0x4acac3){return _0x4acac3[_0xfa9b('0x26')]()[_0xfa9b('0x25')](function(){_0x2a9cce[_0xfa9b('0x19')](0xcc)[_0xfa9b('0x1a')]();});}};}function handleEntityNotFound(_0x5afcb0,_0x373be9){return function(_0x2168eb){if(!_0x2168eb){_0x5afcb0[_0xfa9b('0x18')](0x194);}return _0x2168eb;};}function handleError(_0x5796ab,_0x8add34){_0x8add34=_0x8add34||0x1f4;return function(_0x23d45e){logger['error'](_0x23d45e[_0xfa9b('0x27')]);if(_0x23d45e[_0xfa9b('0x28')]){delete _0x23d45e[_0xfa9b('0x28')];}_0x5796ab[_0xfa9b('0x19')](_0x8add34)[_0xfa9b('0x29')](_0x23d45e);};}exports[_0xfa9b('0x2a')]=function(_0x58a3fa,_0x3adb7f){var _0x82d005={},_0x54e29d={},_0x133471={'count':0x0,'rows':[]};var _0x11abbb=_[_0xfa9b('0x2b')](db[_0xfa9b('0x2c')][_0xfa9b('0x2d')],function(_0x298e99){return{'name':_0x298e99[_0xfa9b('0x2e')],'type':_0x298e99[_0xfa9b('0x2f')][_0xfa9b('0x30')]};});_0x54e29d['model']=_['map'](_0x11abbb,_0xfa9b('0x28'));_0x54e29d[_0xfa9b('0x31')]=_[_0xfa9b('0x32')](_0x58a3fa[_0xfa9b('0x31')]);_0x54e29d[_0xfa9b('0x33')]=_['intersection'](_0x54e29d[_0xfa9b('0x34')],_0x54e29d[_0xfa9b('0x31')]);_0x82d005[_0xfa9b('0x35')]=_[_0xfa9b('0x36')](_0x54e29d['model'],qs[_0xfa9b('0x37')](_0x58a3fa['query']['fields']));_0x82d005[_0xfa9b('0x35')]=_0x82d005[_0xfa9b('0x35')][_0xfa9b('0x38')]?_0x82d005[_0xfa9b('0x35')]:_0x54e29d[_0xfa9b('0x34')];if(!_0x58a3fa[_0xfa9b('0x31')][_0xfa9b('0x39')](_0xfa9b('0x3a'))){_0x82d005[_0xfa9b('0x1e')]=qs[_0xfa9b('0x1e')](_0x58a3fa['query'][_0xfa9b('0x1e')]);_0x82d005[_0xfa9b('0x1c')]=qs[_0xfa9b('0x1c')](_0x58a3fa['query'][_0xfa9b('0x1c')]);}_0x82d005[_0xfa9b('0x3b')]=qs['sort'](_0x58a3fa[_0xfa9b('0x31')][_0xfa9b('0x3c')]);_0x82d005[_0xfa9b('0x3d')]=qs[_0xfa9b('0x33')](_[_0xfa9b('0x3e')](_0x58a3fa[_0xfa9b('0x31')],_0x54e29d[_0xfa9b('0x33')]),_0x11abbb);if(_0x58a3fa[_0xfa9b('0x31')][_0xfa9b('0x3f')]){_0x82d005['where']=_[_0xfa9b('0x40')](_0x82d005[_0xfa9b('0x3d')],{'$or':_[_0xfa9b('0x2b')](_0x11abbb,function(_0x519992){if(_0x519992[_0xfa9b('0x2f')]!==_0xfa9b('0x41')){var _0x1f8f5e={};_0x1f8f5e[_0x519992[_0xfa9b('0x28')]]={'$like':'%'+_0x58a3fa[_0xfa9b('0x31')][_0xfa9b('0x3f')]+'%'};return _0x1f8f5e;}})});}_0x82d005=_[_0xfa9b('0x40')]({},_0x82d005,_0x58a3fa[_0xfa9b('0x42')]);var _0x1b195a={'where':_0x82d005[_0xfa9b('0x3d')]};return db['ZendeskConfiguration'][_0xfa9b('0x1f')](_0x1b195a)[_0xfa9b('0x25')](function(_0x49d57a){_0x133471[_0xfa9b('0x1f')]=_0x49d57a;if(_0x58a3fa['query'][_0xfa9b('0x43')]){_0x82d005[_0xfa9b('0x44')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xfa9b('0x45')](_0x82d005);})['then'](function(_0x1236b2){_0x133471[_0xfa9b('0x46')]=_0x1236b2;return _0x133471;})[_0xfa9b('0x25')](respondWithFilteredResult(_0x3adb7f,_0x82d005))[_0xfa9b('0x47')](handleError(_0x3adb7f,null));};exports[_0xfa9b('0x48')]=function(_0x137beb,_0x175860){var _0x309a9f={'raw':![],'where':{'id':_0x137beb[_0xfa9b('0x49')]['id']}},_0x5e3bbb={};_0x5e3bbb[_0xfa9b('0x34')]=_['keys'](db['ZendeskConfiguration'][_0xfa9b('0x2d')]);_0x5e3bbb[_0xfa9b('0x31')]=_[_0xfa9b('0x32')](_0x137beb[_0xfa9b('0x31')]);_0x5e3bbb[_0xfa9b('0x33')]=_[_0xfa9b('0x36')](_0x5e3bbb[_0xfa9b('0x34')],_0x5e3bbb[_0xfa9b('0x31')]);_0x309a9f[_0xfa9b('0x35')]=_['intersection'](_0x5e3bbb[_0xfa9b('0x34')],qs[_0xfa9b('0x37')](_0x137beb[_0xfa9b('0x31')][_0xfa9b('0x37')]));_0x309a9f[_0xfa9b('0x35')]=_0x309a9f[_0xfa9b('0x35')][_0xfa9b('0x38')]?_0x309a9f[_0xfa9b('0x35')]:_0x5e3bbb[_0xfa9b('0x34')];if(_0x137beb[_0xfa9b('0x31')][_0xfa9b('0x43')]){_0x309a9f['include']=[{'all':!![]}];}_0x309a9f=_['merge']({},_0x309a9f,_0x137beb['options']);return db[_0xfa9b('0x2c')][_0xfa9b('0x4a')](_0x309a9f)[_0xfa9b('0x25')](handleEntityNotFound(_0x175860,null))[_0xfa9b('0x25')](respondWithResult(_0x175860,null))['catch'](handleError(_0x175860,null));};exports[_0xfa9b('0x4b')]=function(_0x535f21,_0x272647){return db[_0xfa9b('0x2c')]['create'](_0x535f21[_0xfa9b('0x4c')],{})[_0xfa9b('0x25')](respondWithResult(_0x272647,0xc9))[_0xfa9b('0x47')](handleError(_0x272647,null));};exports['update']=function(_0x50fbc4,_0x163d7c){if(_0x50fbc4[_0xfa9b('0x4c')]['id']){delete _0x50fbc4[_0xfa9b('0x4c')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x50fbc4['params']['id']}})['then'](handleEntityNotFound(_0x163d7c,null))[_0xfa9b('0x25')](saveUpdates(_0x50fbc4[_0xfa9b('0x4c')],null))['then'](respondWithResult(_0x163d7c,null))['catch'](handleError(_0x163d7c,null));};exports[_0xfa9b('0x26')]=function(_0x591152,_0x36c1f8){return db['ZendeskConfiguration'][_0xfa9b('0x4a')]({'where':{'id':_0x591152[_0xfa9b('0x49')]['id']}})['then'](handleEntityNotFound(_0x36c1f8,null))['then'](removeEntity(_0x36c1f8,null))[_0xfa9b('0x47')](handleError(_0x36c1f8,null));};exports[_0xfa9b('0x4d')]=function(_0x4b07d3,_0x30d1f7,_0x2fec7a){var _0x4498b0={};var _0x15e2ad={};var _0x10b837;var _0x5c5ef1;return db['ZendeskConfiguration'][_0xfa9b('0x4e')]({'where':{'id':_0x4b07d3[_0xfa9b('0x49')]['id']}})[_0xfa9b('0x25')](handleEntityNotFound(_0x30d1f7,null))[_0xfa9b('0x25')](function(_0x50c05e){if(_0x50c05e){_0x10b837=_0x50c05e;_0x15e2ad[_0xfa9b('0x34')]=_['keys'](db[_0xfa9b('0x4f')][_0xfa9b('0x2d')]);_0x15e2ad[_0xfa9b('0x31')]=_['keys'](_0x4b07d3[_0xfa9b('0x31')]);_0x15e2ad[_0xfa9b('0x33')]=_['intersection'](_0x15e2ad[_0xfa9b('0x34')],_0x15e2ad[_0xfa9b('0x31')]);_0x4498b0[_0xfa9b('0x35')]=_[_0xfa9b('0x36')](_0x15e2ad[_0xfa9b('0x34')],qs['fields'](_0x4b07d3[_0xfa9b('0x31')]['fields']));_0x4498b0[_0xfa9b('0x35')]=_0x4498b0[_0xfa9b('0x35')]['length']?_0x4498b0[_0xfa9b('0x35')]:_0x15e2ad[_0xfa9b('0x34')];_0x4498b0[_0xfa9b('0x3b')]=qs[_0xfa9b('0x3c')](_0x4b07d3[_0xfa9b('0x31')][_0xfa9b('0x3c')]);_0x4498b0[_0xfa9b('0x3d')]=qs[_0xfa9b('0x33')](_[_0xfa9b('0x3e')](_0x4b07d3[_0xfa9b('0x31')],_0x15e2ad[_0xfa9b('0x33')]));if(_0x4b07d3[_0xfa9b('0x31')]['filter']){_0x4498b0['where']=_[_0xfa9b('0x40')](_0x4498b0[_0xfa9b('0x3d')],{'$or':_[_0xfa9b('0x2b')](_0x4498b0[_0xfa9b('0x35')],function(_0x4a4d14){var _0x2ec272={};_0x2ec272[_0x4a4d14]={'$like':'%'+_0x4b07d3[_0xfa9b('0x31')][_0xfa9b('0x3f')]+'%'};return _0x2ec272;})});}_0x4498b0=_['merge']({},_0x4498b0,_0x4b07d3[_0xfa9b('0x42')]);return _0x10b837[_0xfa9b('0x4d')](_0x4498b0);}})[_0xfa9b('0x25')](function(_0x19b81e){if(_0x19b81e){_0x5c5ef1=_0x19b81e['length'];if(!_0x4b07d3[_0xfa9b('0x31')][_0xfa9b('0x39')](_0xfa9b('0x3a'))){_0x4498b0[_0xfa9b('0x1e')]=qs['limit'](_0x4b07d3[_0xfa9b('0x31')][_0xfa9b('0x1e')]);_0x4498b0[_0xfa9b('0x1c')]=qs[_0xfa9b('0x1c')](_0x4b07d3[_0xfa9b('0x31')][_0xfa9b('0x1c')]);}return _0x10b837[_0xfa9b('0x4d')](_0x4498b0);}})[_0xfa9b('0x25')](function(_0x8ee65){if(_0x8ee65){return _0x8ee65?{'count':_0x5c5ef1,'rows':_0x8ee65}:null;}})[_0xfa9b('0x25')](respondWithResult(_0x30d1f7,null))[_0xfa9b('0x47')](handleError(_0x30d1f7,null));};exports['getSubjects']=function(_0x3257c7,_0x1b7c8f,_0x303a9c){var _0x577867={};var _0x4becae={};var _0x3921b1;var _0x480bd7;return db[_0xfa9b('0x2c')]['findOne']({'where':{'id':_0x3257c7[_0xfa9b('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b7c8f,null))['then'](function(_0x52f370){if(_0x52f370){_0x3921b1=_0x52f370;_0x4becae[_0xfa9b('0x34')]=_[_0xfa9b('0x32')](db['ZendeskField'][_0xfa9b('0x2d')]);_0x4becae[_0xfa9b('0x31')]=_[_0xfa9b('0x32')](_0x3257c7[_0xfa9b('0x31')]);_0x4becae[_0xfa9b('0x33')]=_[_0xfa9b('0x36')](_0x4becae[_0xfa9b('0x34')],_0x4becae[_0xfa9b('0x31')]);_0x577867['attributes']=_[_0xfa9b('0x36')](_0x4becae[_0xfa9b('0x34')],qs[_0xfa9b('0x37')](_0x3257c7[_0xfa9b('0x31')][_0xfa9b('0x37')]));_0x577867[_0xfa9b('0x35')]=_0x577867[_0xfa9b('0x35')]['length']?_0x577867[_0xfa9b('0x35')]:_0x4becae[_0xfa9b('0x34')];_0x577867[_0xfa9b('0x3b')]=qs[_0xfa9b('0x3c')](_0x3257c7[_0xfa9b('0x31')][_0xfa9b('0x3c')]);_0x577867[_0xfa9b('0x3d')]=qs[_0xfa9b('0x33')](_[_0xfa9b('0x3e')](_0x3257c7[_0xfa9b('0x31')],_0x4becae[_0xfa9b('0x33')]));if(_0x3257c7[_0xfa9b('0x31')][_0xfa9b('0x3f')]){_0x577867[_0xfa9b('0x3d')]=_[_0xfa9b('0x40')](_0x577867['where'],{'$or':_['map'](_0x577867[_0xfa9b('0x35')],function(_0x4e18ef){var _0xa2a8d0={};_0xa2a8d0[_0x4e18ef]={'$like':'%'+_0x3257c7[_0xfa9b('0x31')][_0xfa9b('0x3f')]+'%'};return _0xa2a8d0;})});}_0x577867=_['merge']({},_0x577867,_0x3257c7[_0xfa9b('0x42')]);return _0x3921b1[_0xfa9b('0x50')](_0x577867);}})['then'](function(_0x3a1969){if(_0x3a1969){_0x480bd7=_0x3a1969[_0xfa9b('0x38')];if(!_0x3257c7[_0xfa9b('0x31')]['hasOwnProperty']('nolimit')){_0x577867[_0xfa9b('0x1e')]=qs[_0xfa9b('0x1e')](_0x3257c7[_0xfa9b('0x31')][_0xfa9b('0x1e')]);_0x577867[_0xfa9b('0x1c')]=qs[_0xfa9b('0x1c')](_0x3257c7[_0xfa9b('0x31')][_0xfa9b('0x1c')]);}return _0x3921b1['getSubjects'](_0x577867);}})[_0xfa9b('0x25')](function(_0x5b0a77){if(_0x5b0a77){return _0x5b0a77?{'count':_0x480bd7,'rows':_0x5b0a77}:null;}})[_0xfa9b('0x25')](respondWithResult(_0x1b7c8f,null))[_0xfa9b('0x47')](handleError(_0x1b7c8f,null));};exports[_0xfa9b('0x51')]=function(_0x1d82be,_0x2009b8,_0x10868b){var _0x485610={};var _0x51dc25={};var _0x11237a;var _0x32004a;return db['ZendeskConfiguration'][_0xfa9b('0x4e')]({'where':{'id':_0x1d82be[_0xfa9b('0x49')]['id']}})[_0xfa9b('0x25')](handleEntityNotFound(_0x2009b8,null))[_0xfa9b('0x25')](function(_0x2b89a1){if(_0x2b89a1){_0x11237a=_0x2b89a1;_0x51dc25[_0xfa9b('0x34')]=_[_0xfa9b('0x32')](db[_0xfa9b('0x4f')][_0xfa9b('0x2d')]);_0x51dc25[_0xfa9b('0x31')]=_[_0xfa9b('0x32')](_0x1d82be[_0xfa9b('0x31')]);_0x51dc25['filters']=_[_0xfa9b('0x36')](_0x51dc25[_0xfa9b('0x34')],_0x51dc25[_0xfa9b('0x31')]);_0x485610[_0xfa9b('0x35')]=_[_0xfa9b('0x36')](_0x51dc25[_0xfa9b('0x34')],qs['fields'](_0x1d82be[_0xfa9b('0x31')][_0xfa9b('0x37')]));_0x485610[_0xfa9b('0x35')]=_0x485610['attributes']['length']?_0x485610[_0xfa9b('0x35')]:_0x51dc25[_0xfa9b('0x34')];_0x485610[_0xfa9b('0x3b')]=qs['sort'](_0x1d82be[_0xfa9b('0x31')][_0xfa9b('0x3c')]);_0x485610['where']=qs[_0xfa9b('0x33')](_[_0xfa9b('0x3e')](_0x1d82be['query'],_0x51dc25[_0xfa9b('0x33')]));if(_0x1d82be[_0xfa9b('0x31')][_0xfa9b('0x3f')]){_0x485610['where']=_[_0xfa9b('0x40')](_0x485610[_0xfa9b('0x3d')],{'$or':_['map'](_0x485610[_0xfa9b('0x35')],function(_0x440c9b){var _0x29c3ab={};_0x29c3ab[_0x440c9b]={'$like':'%'+_0x1d82be['query'][_0xfa9b('0x3f')]+'%'};return _0x29c3ab;})});}_0x485610=_[_0xfa9b('0x40')]({},_0x485610,_0x1d82be[_0xfa9b('0x42')]);return _0x11237a[_0xfa9b('0x51')](_0x485610);}})[_0xfa9b('0x25')](function(_0x5826a7){if(_0x5826a7){_0x32004a=_0x5826a7['length'];if(!_0x1d82be['query'][_0xfa9b('0x39')]('nolimit')){_0x485610['limit']=qs['limit'](_0x1d82be['query']['limit']);_0x485610['offset']=qs[_0xfa9b('0x1c')](_0x1d82be[_0xfa9b('0x31')][_0xfa9b('0x1c')]);}return _0x11237a['getDescriptions'](_0x485610);}})[_0xfa9b('0x25')](function(_0x4ee536){if(_0x4ee536){return _0x4ee536?{'count':_0x32004a,'rows':_0x4ee536}:null;}})[_0xfa9b('0x25')](respondWithResult(_0x2009b8,null))['catch'](handleError(_0x2009b8,null));};exports[_0xfa9b('0x52')]=function(_0x3be743,_0x4f91b2,_0x18a079){var _0x2faf88={};var _0x1830a3={};var _0x45fdee;var _0x5571b8;return db[_0xfa9b('0x2c')]['findOne']({'where':{'id':_0x3be743[_0xfa9b('0x49')]['id']}})[_0xfa9b('0x25')](handleEntityNotFound(_0x4f91b2,null))['then'](function(_0x1d7e34){if(_0x1d7e34){_0x45fdee=_0x1d7e34;_0x1830a3[_0xfa9b('0x34')]=_[_0xfa9b('0x32')](db[_0xfa9b('0x53')]['rawAttributes']);_0x1830a3['query']=_[_0xfa9b('0x32')](_0x3be743[_0xfa9b('0x31')]);_0x1830a3[_0xfa9b('0x33')]=_[_0xfa9b('0x36')](_0x1830a3[_0xfa9b('0x34')],_0x1830a3[_0xfa9b('0x31')]);_0x2faf88[_0xfa9b('0x35')]=_['intersection'](_0x1830a3[_0xfa9b('0x34')],qs[_0xfa9b('0x37')](_0x3be743[_0xfa9b('0x31')][_0xfa9b('0x37')]));_0x2faf88['attributes']=_0x2faf88['attributes'][_0xfa9b('0x38')]?_0x2faf88[_0xfa9b('0x35')]:_0x1830a3['model'];_0x2faf88[_0xfa9b('0x3b')]=qs['sort'](_0x3be743[_0xfa9b('0x31')][_0xfa9b('0x3c')]);_0x2faf88[_0xfa9b('0x3d')]=qs[_0xfa9b('0x33')](_[_0xfa9b('0x3e')](_0x3be743[_0xfa9b('0x31')],_0x1830a3['filters']));if(_0x3be743['query'][_0xfa9b('0x3f')]){_0x2faf88[_0xfa9b('0x3d')]=_['merge'](_0x2faf88['where'],{'$or':_[_0xfa9b('0x2b')](_0x2faf88[_0xfa9b('0x35')],function(_0x53f64a){var _0x341e5b={};_0x341e5b[_0x53f64a]={'$like':'%'+_0x3be743[_0xfa9b('0x31')][_0xfa9b('0x3f')]+'%'};return _0x341e5b;})});}_0x2faf88=_[_0xfa9b('0x40')]({},_0x2faf88,_0x3be743[_0xfa9b('0x42')]);return _0x45fdee[_0xfa9b('0x52')](_0x2faf88);}})[_0xfa9b('0x25')](function(_0x1d0f39){if(_0x1d0f39){_0x5571b8=_0x1d0f39[_0xfa9b('0x38')];if(!_0x3be743[_0xfa9b('0x31')][_0xfa9b('0x39')](_0xfa9b('0x3a'))){_0x2faf88['limit']=qs[_0xfa9b('0x1e')](_0x3be743[_0xfa9b('0x31')][_0xfa9b('0x1e')]);_0x2faf88[_0xfa9b('0x1c')]=qs['offset'](_0x3be743['query'][_0xfa9b('0x1c')]);}return _0x45fdee[_0xfa9b('0x52')](_0x2faf88);}})[_0xfa9b('0x25')](function(_0x37a4ba){if(_0x37a4ba){return _0x37a4ba?{'count':_0x5571b8,'rows':_0x37a4ba}:null;}})['then'](respondWithResult(_0x4f91b2,null))[_0xfa9b('0x47')](handleError(_0x4f91b2,null));};exports[_0xfa9b('0x54')]=function(_0x3165ee,_0x17fccb,_0x598f59){if(_0x3165ee[_0xfa9b('0x4c')]['id']){delete _0x3165ee[_0xfa9b('0x4c')]['id'];}return db[_0xfa9b('0x2c')]['findOne']({'where':{'id':_0x3165ee['params']['id']}})[_0xfa9b('0x25')](handleEntityNotFound(_0x17fccb,null))[_0xfa9b('0x25')](function(_0x5dd092){if(_0x5dd092){return _0x5dd092[_0xfa9b('0x54')](_0x3165ee[_0xfa9b('0x4c')][_0xfa9b('0x55')]||[]);}return null;})[_0xfa9b('0x25')](respondWithResult(_0x17fccb,null))[_0xfa9b('0x47')](handleError(_0x17fccb,null));}; \ No newline at end of file +var _0x6fd9=['query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','body','getFields','findOne','ZendeskField','order','pick','getSubjects','getDescriptions','Tag','getTags','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','error','name','index','map','ZendeskConfiguration','type','model'];(function(_0x185327,_0x3e0451){var _0x13ac92=function(_0x1124e6){while(--_0x1124e6){_0x185327['push'](_0x185327['shift']());}};_0x13ac92(++_0x3e0451);}(_0x6fd9,0x10c));var _0x96fd=function(_0x42e4c8,_0x405d81){_0x42e4c8=_0x42e4c8-0x0;var _0x4286fa=_0x6fd9[_0x42e4c8];return _0x4286fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96fd('0x0'));var zipdir=require(_0x96fd('0x1'));var jsonpatch=require(_0x96fd('0x2'));var rp=require(_0x96fd('0x3'));var moment=require(_0x96fd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96fd('0x5'));var util=require(_0x96fd('0x6'));var path=require(_0x96fd('0x7'));var sox=require(_0x96fd('0x8'));var csv=require(_0x96fd('0x9'));var ejs=require(_0x96fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x96fd('0xb'));var crypto=require(_0x96fd('0xc'));var jsforce=require(_0x96fd('0xd'));var deskjs=require(_0x96fd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x96fd('0xf'));var Papa=require('papaparse');var Redis=require(_0x96fd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x96fd('0x11'));var as=require(_0x96fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x96fd('0x13'));var utils=require(_0x96fd('0x14'));var config=require(_0x96fd('0x15'));var licenseUtil=require(_0x96fd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x389ad2,_0x91ad6b){_0x91ad6b=_0x91ad6b||0xcc;return function(_0x51aacd){if(_0x51aacd){return _0x389ad2[_0x96fd('0x17')](_0x91ad6b);}return _0x389ad2[_0x96fd('0x18')](_0x91ad6b)['end']();};}function respondWithResult(_0x5226b9,_0x4b51c7){_0x4b51c7=_0x4b51c7||0xc8;return function(_0x4c9f35){if(_0x4c9f35){return _0x5226b9[_0x96fd('0x18')](_0x4b51c7)['json'](_0x4c9f35);}};}function respondWithFilteredResult(_0x2a7f6c,_0x2baae8){return function(_0x3c97b5){if(_0x3c97b5){var _0x6610c6=typeof _0x2baae8[_0x96fd('0x19')]==='undefined'&&typeof _0x2baae8[_0x96fd('0x1a')]==='undefined';var _0x46b9ee=_0x3c97b5[_0x96fd('0x1b')];var _0x11467f=_0x6610c6?0x0:_0x2baae8[_0x96fd('0x19')];var _0x1949f3=_0x6610c6?_0x3c97b5[_0x96fd('0x1b')]:_0x2baae8[_0x96fd('0x19')]+_0x2baae8[_0x96fd('0x1a')];var _0x2e2788;if(_0x1949f3>=_0x46b9ee){_0x1949f3=_0x46b9ee;_0x2e2788=0xc8;}else{_0x2e2788=0xce;}_0x2a7f6c[_0x96fd('0x18')](_0x2e2788);return _0x2a7f6c[_0x96fd('0x1c')](_0x96fd('0x1d'),_0x11467f+'-'+_0x1949f3+'/'+_0x46b9ee)[_0x96fd('0x1e')](_0x3c97b5);}return null;};}function patchUpdates(_0x252b2f){return function(_0x14440d){try{jsonpatch['apply'](_0x14440d,_0x252b2f,!![]);}catch(_0x1041ae){return BPromise[_0x96fd('0x1f')](_0x1041ae);}return _0x14440d[_0x96fd('0x20')]();};}function saveUpdates(_0x3512a7,_0x379178){return function(_0x3c4d6d){if(_0x3c4d6d){return _0x3c4d6d[_0x96fd('0x21')](_0x3512a7)['then'](function(_0x585678){return _0x585678;});}return null;};}function removeEntity(_0x568d55,_0x3dd342){return function(_0x5882a2){if(_0x5882a2){return _0x5882a2[_0x96fd('0x22')]()[_0x96fd('0x23')](function(){_0x568d55['status'](0xcc)[_0x96fd('0x24')]();});}};}function handleEntityNotFound(_0x6a2d41,_0x4b6a3e){return function(_0x577502){if(!_0x577502){_0x6a2d41['sendStatus'](0x194);}return _0x577502;};}function handleError(_0x3ba211,_0x4a5b17){_0x4a5b17=_0x4a5b17||0x1f4;return function(_0x136f2c){logger[_0x96fd('0x25')](_0x136f2c['stack']);if(_0x136f2c[_0x96fd('0x26')]){delete _0x136f2c[_0x96fd('0x26')];}_0x3ba211[_0x96fd('0x18')](_0x4a5b17)['send'](_0x136f2c);};}exports[_0x96fd('0x27')]=function(_0x1db6fd,_0x2d4299){var _0x34aad4={},_0x412f1e={},_0x45b932={'count':0x0,'rows':[]};var _0x2f76cc=_[_0x96fd('0x28')](db[_0x96fd('0x29')]['rawAttributes'],function(_0x31bcf8){return{'name':_0x31bcf8['fieldName'],'type':_0x31bcf8[_0x96fd('0x2a')]['key']};});_0x412f1e[_0x96fd('0x2b')]=_['map'](_0x2f76cc,'name');_0x412f1e[_0x96fd('0x2c')]=_[_0x96fd('0x2d')](_0x1db6fd[_0x96fd('0x2c')]);_0x412f1e[_0x96fd('0x2e')]=_[_0x96fd('0x2f')](_0x412f1e[_0x96fd('0x2b')],_0x412f1e[_0x96fd('0x2c')]);_0x34aad4['attributes']=_[_0x96fd('0x2f')](_0x412f1e[_0x96fd('0x2b')],qs[_0x96fd('0x30')](_0x1db6fd[_0x96fd('0x2c')]['fields']));_0x34aad4[_0x96fd('0x31')]=_0x34aad4[_0x96fd('0x31')]['length']?_0x34aad4[_0x96fd('0x31')]:_0x412f1e[_0x96fd('0x2b')];if(!_0x1db6fd[_0x96fd('0x2c')][_0x96fd('0x32')](_0x96fd('0x33'))){_0x34aad4['limit']=qs['limit'](_0x1db6fd[_0x96fd('0x2c')]['limit']);_0x34aad4[_0x96fd('0x19')]=qs[_0x96fd('0x19')](_0x1db6fd['query'][_0x96fd('0x19')]);}_0x34aad4['order']=qs['sort'](_0x1db6fd[_0x96fd('0x2c')][_0x96fd('0x34')]);_0x34aad4['where']=qs[_0x96fd('0x2e')](_['pick'](_0x1db6fd[_0x96fd('0x2c')],_0x412f1e[_0x96fd('0x2e')]),_0x2f76cc);if(_0x1db6fd[_0x96fd('0x2c')][_0x96fd('0x35')]){_0x34aad4[_0x96fd('0x36')]=_[_0x96fd('0x37')](_0x34aad4[_0x96fd('0x36')],{'$or':_[_0x96fd('0x28')](_0x2f76cc,function(_0xef7c0a){if(_0xef7c0a[_0x96fd('0x2a')]!=='VIRTUAL'){var _0x5535b6={};_0x5535b6[_0xef7c0a[_0x96fd('0x26')]]={'$like':'%'+_0x1db6fd[_0x96fd('0x2c')][_0x96fd('0x35')]+'%'};return _0x5535b6;}})});}_0x34aad4=_['merge']({},_0x34aad4,_0x1db6fd['options']);var _0x85740={'where':_0x34aad4[_0x96fd('0x36')]};return db['ZendeskConfiguration'][_0x96fd('0x1b')](_0x85740)[_0x96fd('0x23')](function(_0x20d139){_0x45b932[_0x96fd('0x1b')]=_0x20d139;if(_0x1db6fd['query'][_0x96fd('0x38')]){_0x34aad4[_0x96fd('0x39')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x96fd('0x3a')](_0x34aad4);})[_0x96fd('0x23')](function(_0x49abdc){_0x45b932['rows']=_0x49abdc;return _0x45b932;})[_0x96fd('0x23')](respondWithFilteredResult(_0x2d4299,_0x34aad4))[_0x96fd('0x3b')](handleError(_0x2d4299,null));};exports[_0x96fd('0x3c')]=function(_0x2eb0f1,_0x578976){var _0x43baf3={'raw':![],'where':{'id':_0x2eb0f1[_0x96fd('0x3d')]['id']}},_0x2505a4={};_0x2505a4[_0x96fd('0x2b')]=_['keys'](db[_0x96fd('0x29')][_0x96fd('0x3e')]);_0x2505a4['query']=_[_0x96fd('0x2d')](_0x2eb0f1[_0x96fd('0x2c')]);_0x2505a4[_0x96fd('0x2e')]=_[_0x96fd('0x2f')](_0x2505a4[_0x96fd('0x2b')],_0x2505a4[_0x96fd('0x2c')]);_0x43baf3[_0x96fd('0x31')]=_[_0x96fd('0x2f')](_0x2505a4[_0x96fd('0x2b')],qs[_0x96fd('0x30')](_0x2eb0f1[_0x96fd('0x2c')][_0x96fd('0x30')]));_0x43baf3['attributes']=_0x43baf3[_0x96fd('0x31')][_0x96fd('0x3f')]?_0x43baf3['attributes']:_0x2505a4[_0x96fd('0x2b')];if(_0x2eb0f1[_0x96fd('0x2c')][_0x96fd('0x38')]){_0x43baf3[_0x96fd('0x39')]=[{'all':!![]}];}_0x43baf3=_[_0x96fd('0x37')]({},_0x43baf3,_0x2eb0f1[_0x96fd('0x40')]);return db[_0x96fd('0x29')][_0x96fd('0x41')](_0x43baf3)['then'](handleEntityNotFound(_0x578976,null))['then'](respondWithResult(_0x578976,null))[_0x96fd('0x3b')](handleError(_0x578976,null));};exports[_0x96fd('0x42')]=function(_0x7a272,_0x23d233){return db[_0x96fd('0x29')][_0x96fd('0x42')](_0x7a272[_0x96fd('0x43')],{})['then'](respondWithResult(_0x23d233,0xc9))[_0x96fd('0x3b')](handleError(_0x23d233,null));};exports['update']=function(_0x157e7b,_0x4132a9){if(_0x157e7b[_0x96fd('0x43')]['id']){delete _0x157e7b[_0x96fd('0x43')]['id'];}return db[_0x96fd('0x29')][_0x96fd('0x41')]({'where':{'id':_0x157e7b[_0x96fd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4132a9,null))['then'](saveUpdates(_0x157e7b[_0x96fd('0x43')],null))[_0x96fd('0x23')](respondWithResult(_0x4132a9,null))[_0x96fd('0x3b')](handleError(_0x4132a9,null));};exports[_0x96fd('0x22')]=function(_0x339973,_0x6e56e8){return db['ZendeskConfiguration']['find']({'where':{'id':_0x339973[_0x96fd('0x3d')]['id']}})[_0x96fd('0x23')](handleEntityNotFound(_0x6e56e8,null))[_0x96fd('0x23')](removeEntity(_0x6e56e8,null))[_0x96fd('0x3b')](handleError(_0x6e56e8,null));};exports[_0x96fd('0x44')]=function(_0x4ceeec,_0x1766b1,_0x3a17bf){var _0x6d6f1a={};var _0x33dc18={};var _0x139e13;var _0x576f4e;return db['ZendeskConfiguration'][_0x96fd('0x45')]({'where':{'id':_0x4ceeec['params']['id']}})[_0x96fd('0x23')](handleEntityNotFound(_0x1766b1,null))['then'](function(_0xfb8d9a){if(_0xfb8d9a){_0x139e13=_0xfb8d9a;_0x33dc18[_0x96fd('0x2b')]=_[_0x96fd('0x2d')](db[_0x96fd('0x46')][_0x96fd('0x3e')]);_0x33dc18[_0x96fd('0x2c')]=_[_0x96fd('0x2d')](_0x4ceeec[_0x96fd('0x2c')]);_0x33dc18[_0x96fd('0x2e')]=_[_0x96fd('0x2f')](_0x33dc18[_0x96fd('0x2b')],_0x33dc18['query']);_0x6d6f1a[_0x96fd('0x31')]=_[_0x96fd('0x2f')](_0x33dc18['model'],qs[_0x96fd('0x30')](_0x4ceeec[_0x96fd('0x2c')][_0x96fd('0x30')]));_0x6d6f1a[_0x96fd('0x31')]=_0x6d6f1a[_0x96fd('0x31')][_0x96fd('0x3f')]?_0x6d6f1a['attributes']:_0x33dc18[_0x96fd('0x2b')];_0x6d6f1a[_0x96fd('0x47')]=qs[_0x96fd('0x34')](_0x4ceeec['query'][_0x96fd('0x34')]);_0x6d6f1a[_0x96fd('0x36')]=qs['filters'](_[_0x96fd('0x48')](_0x4ceeec[_0x96fd('0x2c')],_0x33dc18[_0x96fd('0x2e')]));if(_0x4ceeec[_0x96fd('0x2c')][_0x96fd('0x35')]){_0x6d6f1a['where']=_['merge'](_0x6d6f1a[_0x96fd('0x36')],{'$or':_[_0x96fd('0x28')](_0x6d6f1a[_0x96fd('0x31')],function(_0x142432){var _0x89ac06={};_0x89ac06[_0x142432]={'$like':'%'+_0x4ceeec[_0x96fd('0x2c')][_0x96fd('0x35')]+'%'};return _0x89ac06;})});}_0x6d6f1a=_[_0x96fd('0x37')]({},_0x6d6f1a,_0x4ceeec[_0x96fd('0x40')]);return _0x139e13[_0x96fd('0x44')](_0x6d6f1a);}})[_0x96fd('0x23')](function(_0x19ad59){if(_0x19ad59){_0x576f4e=_0x19ad59[_0x96fd('0x3f')];if(!_0x4ceeec['query'][_0x96fd('0x32')](_0x96fd('0x33'))){_0x6d6f1a[_0x96fd('0x1a')]=qs['limit'](_0x4ceeec[_0x96fd('0x2c')][_0x96fd('0x1a')]);_0x6d6f1a[_0x96fd('0x19')]=qs['offset'](_0x4ceeec[_0x96fd('0x2c')][_0x96fd('0x19')]);}return _0x139e13['getFields'](_0x6d6f1a);}})['then'](function(_0x260c9a){if(_0x260c9a){return _0x260c9a?{'count':_0x576f4e,'rows':_0x260c9a}:null;}})[_0x96fd('0x23')](respondWithResult(_0x1766b1,null))[_0x96fd('0x3b')](handleError(_0x1766b1,null));};exports[_0x96fd('0x49')]=function(_0x36a355,_0xd40b97,_0x31617d){var _0x1400e0={};var _0x20521b={};var _0x15078b;var _0x42f975;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x36a355[_0x96fd('0x3d')]['id']}})[_0x96fd('0x23')](handleEntityNotFound(_0xd40b97,null))[_0x96fd('0x23')](function(_0x47851d){if(_0x47851d){_0x15078b=_0x47851d;_0x20521b['model']=_[_0x96fd('0x2d')](db[_0x96fd('0x46')]['rawAttributes']);_0x20521b[_0x96fd('0x2c')]=_[_0x96fd('0x2d')](_0x36a355[_0x96fd('0x2c')]);_0x20521b[_0x96fd('0x2e')]=_[_0x96fd('0x2f')](_0x20521b[_0x96fd('0x2b')],_0x20521b[_0x96fd('0x2c')]);_0x1400e0[_0x96fd('0x31')]=_['intersection'](_0x20521b[_0x96fd('0x2b')],qs[_0x96fd('0x30')](_0x36a355[_0x96fd('0x2c')][_0x96fd('0x30')]));_0x1400e0[_0x96fd('0x31')]=_0x1400e0[_0x96fd('0x31')]['length']?_0x1400e0[_0x96fd('0x31')]:_0x20521b[_0x96fd('0x2b')];_0x1400e0[_0x96fd('0x47')]=qs['sort'](_0x36a355[_0x96fd('0x2c')][_0x96fd('0x34')]);_0x1400e0['where']=qs[_0x96fd('0x2e')](_['pick'](_0x36a355[_0x96fd('0x2c')],_0x20521b['filters']));if(_0x36a355[_0x96fd('0x2c')][_0x96fd('0x35')]){_0x1400e0[_0x96fd('0x36')]=_[_0x96fd('0x37')](_0x1400e0[_0x96fd('0x36')],{'$or':_['map'](_0x1400e0[_0x96fd('0x31')],function(_0x154332){var _0x2b6ec9={};_0x2b6ec9[_0x154332]={'$like':'%'+_0x36a355[_0x96fd('0x2c')]['filter']+'%'};return _0x2b6ec9;})});}_0x1400e0=_[_0x96fd('0x37')]({},_0x1400e0,_0x36a355[_0x96fd('0x40')]);return _0x15078b[_0x96fd('0x49')](_0x1400e0);}})[_0x96fd('0x23')](function(_0x1968c3){if(_0x1968c3){_0x42f975=_0x1968c3[_0x96fd('0x3f')];if(!_0x36a355['query'][_0x96fd('0x32')](_0x96fd('0x33'))){_0x1400e0[_0x96fd('0x1a')]=qs['limit'](_0x36a355[_0x96fd('0x2c')][_0x96fd('0x1a')]);_0x1400e0[_0x96fd('0x19')]=qs[_0x96fd('0x19')](_0x36a355[_0x96fd('0x2c')]['offset']);}return _0x15078b[_0x96fd('0x49')](_0x1400e0);}})[_0x96fd('0x23')](function(_0x27c5c4){if(_0x27c5c4){return _0x27c5c4?{'count':_0x42f975,'rows':_0x27c5c4}:null;}})['then'](respondWithResult(_0xd40b97,null))['catch'](handleError(_0xd40b97,null));};exports[_0x96fd('0x4a')]=function(_0x9df5a8,_0x279e2,_0x1a1882){var _0x290cc7={};var _0x254b37={};var _0x1087ca;var _0x353fd0;return db[_0x96fd('0x29')]['findOne']({'where':{'id':_0x9df5a8[_0x96fd('0x3d')]['id']}})[_0x96fd('0x23')](handleEntityNotFound(_0x279e2,null))[_0x96fd('0x23')](function(_0x351b7b){if(_0x351b7b){_0x1087ca=_0x351b7b;_0x254b37[_0x96fd('0x2b')]=_[_0x96fd('0x2d')](db['ZendeskField'][_0x96fd('0x3e')]);_0x254b37[_0x96fd('0x2c')]=_[_0x96fd('0x2d')](_0x9df5a8[_0x96fd('0x2c')]);_0x254b37[_0x96fd('0x2e')]=_['intersection'](_0x254b37[_0x96fd('0x2b')],_0x254b37[_0x96fd('0x2c')]);_0x290cc7[_0x96fd('0x31')]=_[_0x96fd('0x2f')](_0x254b37[_0x96fd('0x2b')],qs['fields'](_0x9df5a8[_0x96fd('0x2c')][_0x96fd('0x30')]));_0x290cc7[_0x96fd('0x31')]=_0x290cc7[_0x96fd('0x31')][_0x96fd('0x3f')]?_0x290cc7[_0x96fd('0x31')]:_0x254b37['model'];_0x290cc7[_0x96fd('0x47')]=qs[_0x96fd('0x34')](_0x9df5a8['query'][_0x96fd('0x34')]);_0x290cc7[_0x96fd('0x36')]=qs[_0x96fd('0x2e')](_[_0x96fd('0x48')](_0x9df5a8[_0x96fd('0x2c')],_0x254b37[_0x96fd('0x2e')]));if(_0x9df5a8[_0x96fd('0x2c')][_0x96fd('0x35')]){_0x290cc7[_0x96fd('0x36')]=_[_0x96fd('0x37')](_0x290cc7[_0x96fd('0x36')],{'$or':_[_0x96fd('0x28')](_0x290cc7[_0x96fd('0x31')],function(_0x553d13){var _0x367585={};_0x367585[_0x553d13]={'$like':'%'+_0x9df5a8[_0x96fd('0x2c')][_0x96fd('0x35')]+'%'};return _0x367585;})});}_0x290cc7=_[_0x96fd('0x37')]({},_0x290cc7,_0x9df5a8[_0x96fd('0x40')]);return _0x1087ca[_0x96fd('0x4a')](_0x290cc7);}})[_0x96fd('0x23')](function(_0x138b43){if(_0x138b43){_0x353fd0=_0x138b43[_0x96fd('0x3f')];if(!_0x9df5a8['query'][_0x96fd('0x32')]('nolimit')){_0x290cc7[_0x96fd('0x1a')]=qs['limit'](_0x9df5a8['query']['limit']);_0x290cc7['offset']=qs[_0x96fd('0x19')](_0x9df5a8['query'][_0x96fd('0x19')]);}return _0x1087ca['getDescriptions'](_0x290cc7);}})[_0x96fd('0x23')](function(_0x9cbacf){if(_0x9cbacf){return _0x9cbacf?{'count':_0x353fd0,'rows':_0x9cbacf}:null;}})[_0x96fd('0x23')](respondWithResult(_0x279e2,null))[_0x96fd('0x3b')](handleError(_0x279e2,null));};exports['getTags']=function(_0x508416,_0x570fa7,_0x220a8f){var _0x1536b8={};var _0x475f35={};var _0x5c51aa;var _0x94740d;return db[_0x96fd('0x29')][_0x96fd('0x45')]({'where':{'id':_0x508416['params']['id']}})[_0x96fd('0x23')](handleEntityNotFound(_0x570fa7,null))[_0x96fd('0x23')](function(_0x3da834){if(_0x3da834){_0x5c51aa=_0x3da834;_0x475f35[_0x96fd('0x2b')]=_['keys'](db[_0x96fd('0x4b')][_0x96fd('0x3e')]);_0x475f35['query']=_[_0x96fd('0x2d')](_0x508416[_0x96fd('0x2c')]);_0x475f35[_0x96fd('0x2e')]=_['intersection'](_0x475f35[_0x96fd('0x2b')],_0x475f35[_0x96fd('0x2c')]);_0x1536b8['attributes']=_[_0x96fd('0x2f')](_0x475f35[_0x96fd('0x2b')],qs[_0x96fd('0x30')](_0x508416[_0x96fd('0x2c')][_0x96fd('0x30')]));_0x1536b8[_0x96fd('0x31')]=_0x1536b8['attributes'][_0x96fd('0x3f')]?_0x1536b8[_0x96fd('0x31')]:_0x475f35['model'];_0x1536b8['order']=qs[_0x96fd('0x34')](_0x508416[_0x96fd('0x2c')]['sort']);_0x1536b8['where']=qs[_0x96fd('0x2e')](_['pick'](_0x508416[_0x96fd('0x2c')],_0x475f35[_0x96fd('0x2e')]));if(_0x508416[_0x96fd('0x2c')][_0x96fd('0x35')]){_0x1536b8[_0x96fd('0x36')]=_['merge'](_0x1536b8[_0x96fd('0x36')],{'$or':_[_0x96fd('0x28')](_0x1536b8[_0x96fd('0x31')],function(_0x54aea0){var _0x10d149={};_0x10d149[_0x54aea0]={'$like':'%'+_0x508416[_0x96fd('0x2c')]['filter']+'%'};return _0x10d149;})});}_0x1536b8=_[_0x96fd('0x37')]({},_0x1536b8,_0x508416[_0x96fd('0x40')]);return _0x5c51aa[_0x96fd('0x4c')](_0x1536b8);}})['then'](function(_0x127ecf){if(_0x127ecf){_0x94740d=_0x127ecf['length'];if(!_0x508416[_0x96fd('0x2c')][_0x96fd('0x32')](_0x96fd('0x33'))){_0x1536b8[_0x96fd('0x1a')]=qs[_0x96fd('0x1a')](_0x508416['query']['limit']);_0x1536b8[_0x96fd('0x19')]=qs[_0x96fd('0x19')](_0x508416[_0x96fd('0x2c')][_0x96fd('0x19')]);}return _0x5c51aa[_0x96fd('0x4c')](_0x1536b8);}})[_0x96fd('0x23')](function(_0xafcdaf){if(_0xafcdaf){return _0xafcdaf?{'count':_0x94740d,'rows':_0xafcdaf}:null;}})['then'](respondWithResult(_0x570fa7,null))[_0x96fd('0x3b')](handleError(_0x570fa7,null));};exports[_0x96fd('0x4d')]=function(_0x5adfc6,_0x4ebb11,_0x384c65){if(_0x5adfc6[_0x96fd('0x43')]['id']){delete _0x5adfc6[_0x96fd('0x43')]['id'];}return db[_0x96fd('0x29')][_0x96fd('0x45')]({'where':{'id':_0x5adfc6['params']['id']}})['then'](handleEntityNotFound(_0x4ebb11,null))[_0x96fd('0x23')](function(_0x1ced9e){if(_0x1ced9e){return _0x1ced9e[_0x96fd('0x4d')](_0x5adfc6[_0x96fd('0x43')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4ebb11,null))[_0x96fd('0x3b')](handleError(_0x4ebb11,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index d56617b..7ea8d82 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 _0xd824=['rimraf','../../config/environment','ZendeskConfiguration','int_zendesk_configurations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2569a5,_0x36eb69){var _0x374d1f=function(_0x1eb4bc){while(--_0x1eb4bc){_0x2569a5['push'](_0x2569a5['shift']());}};_0x374d1f(++_0x36eb69);}(_0xd824,0xc2));var _0x4d82=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd824[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4d82('0x2'));var BPromise=require(_0x4d82('0x3'));var rp=require(_0x4d82('0x4'));var fs=require('fs');var path=require(_0x4d82('0x5'));var rimraf=require(_0x4d82('0x6'));var config=require(_0x4d82('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0xd00023,_0x583c7c){return _0xd00023['define'](_0x4d82('0x8'),attributes,{'tableName':_0x4d82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaebd=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','../../config/logger','api'];(function(_0x5763bf,_0x4d1df5){var _0xfa90d1=function(_0x24a9eb){while(--_0x24a9eb){_0x5763bf['push'](_0x5763bf['shift']());}};_0xfa90d1(++_0x4d1df5);}(_0xaebd,0x1e9));var _0xdaeb=function(_0xbb139f,_0x5f1d3c){_0xbb139f=_0xbb139f-0x0;var _0x5c0809=_0xaebd[_0xbb139f];return _0x5c0809;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 66281fd..bd68dea 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 _0x63d3=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash'];(function(_0x5c41d8,_0x12bcc7){var _0x4418b1=function(_0x4b798b){while(--_0x4b798b){_0x5c41d8['push'](_0x5c41d8['shift']());}};_0x4418b1(++_0x12bcc7);}(_0x63d3,0x10d));var _0x363d=function(_0x3acd12,_0x556b58){_0x3acd12=_0x3acd12-0x0;var _0x40adc0=_0x63d3[_0x3acd12];return _0x40adc0;};'use strict';var _=require(_0x363d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x363d('0x1'))['db'];var utils=require(_0x363d('0x2'));var logger=require('../../config/logger')(_0x363d('0x3'));var config=require(_0x363d('0x4'));var jayson=require(_0x363d('0x5'));var client=jayson[_0x363d('0x6')][_0x363d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f949a,_0xe27773,_0xdc03bf){return new BPromise(function(_0x41a0a6,_0x4b4797){return client[_0x363d('0x8')](_0x1f949a,_0xdc03bf)[_0x363d('0x9')](function(_0x19b2f6){logger[_0x363d('0xa')](_0x363d('0xb'),_0xe27773,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xe27773,'request\x20sent',JSON[_0x363d('0xc')](_0x19b2f6));if(_0x19b2f6[_0x363d('0xd')]){if(_0x19b2f6[_0x363d('0xd')]['code']===0x1f4){logger[_0x363d('0xd')](_0x363d('0xb'),_0xe27773,_0x19b2f6[_0x363d('0xd')][_0x363d('0xe')]);return _0x4b4797(_0x19b2f6[_0x363d('0xd')][_0x363d('0xe')]);}logger[_0x363d('0xd')](_0x363d('0xb'),_0xe27773,_0x19b2f6[_0x363d('0xd')][_0x363d('0xe')]);return _0x41a0a6(_0x19b2f6[_0x363d('0xd')][_0x363d('0xe')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xe27773,_0x363d('0xf'));_0x41a0a6(_0x19b2f6[_0x363d('0x10')]['message']);}})[_0x363d('0x11')](function(_0x2af89d){logger[_0x363d('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe27773,_0x2af89d);_0x4b4797(_0x2af89d);});});} \ No newline at end of file +var _0x5ffa=['result','catch','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','http','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message'];(function(_0x79324e,_0x4af67e){var _0x555666=function(_0x15d9c2){while(--_0x15d9c2){_0x79324e['push'](_0x79324e['shift']());}};_0x555666(++_0x4af67e);}(_0x5ffa,0x16a));var _0xa5ff=function(_0x84bf4d,_0x2d6bba){_0x84bf4d=_0x84bf4d-0x0;var _0x93769e=_0x5ffa[_0x84bf4d];return _0x93769e;};'use strict';var _=require('lodash');var util=require(_0xa5ff('0x0'));var moment=require(_0xa5ff('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5ff('0x2'));var fs=require('fs');var Redis=require(_0xa5ff('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa5ff('0x4'))('rpc');var config=require(_0xa5ff('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa5ff('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1231df,_0x458ac6,_0xa070b8){return new BPromise(function(_0x13c364,_0x1a2cf6){return client['request'](_0x1231df,_0xa070b8)[_0xa5ff('0x7')](function(_0x18cbef){logger[_0xa5ff('0x8')]('ZendeskConfiguration,\x20%s,\x20%s',_0x458ac6,_0xa5ff('0x9'));logger['debug'](_0xa5ff('0xa'),_0x458ac6,_0xa5ff('0x9'),JSON[_0xa5ff('0xb')](_0x18cbef));if(_0x18cbef['error']){if(_0x18cbef[_0xa5ff('0xc')][_0xa5ff('0xd')]===0x1f4){logger[_0xa5ff('0xc')](_0xa5ff('0xe'),_0x458ac6,_0x18cbef[_0xa5ff('0xc')][_0xa5ff('0xf')]);return _0x1a2cf6(_0x18cbef['error'][_0xa5ff('0xf')]);}logger[_0xa5ff('0xc')](_0xa5ff('0xe'),_0x458ac6,_0x18cbef[_0xa5ff('0xc')][_0xa5ff('0xf')]);return _0x13c364(_0x18cbef['error'][_0xa5ff('0xf')]);}else{logger[_0xa5ff('0x8')](_0xa5ff('0xe'),_0x458ac6,_0xa5ff('0x9'));_0x13c364(_0x18cbef[_0xa5ff('0x10')][_0xa5ff('0xf')]);}})[_0xa5ff('0x11')](function(_0x5d05d1){logger[_0xa5ff('0xc')](_0xa5ff('0xe'),_0x458ac6,_0x5d05d1);_0x1a2cf6(_0x5d05d1);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 62c0efc..133283b 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 _0xa9fb=['get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57d816,_0x517e6e){var _0x191f64=function(_0x2cf0b3){while(--_0x2cf0b3){_0x57d816['push'](_0x57d816['shift']());}};_0x191f64(++_0x517e6e);}(_0xa9fb,0x101));var _0xba9f=function(_0xaad15a,_0x39f9e5){_0xaad15a=_0xaad15a-0x0;var _0x414fd5=_0xa9fb[_0xaad15a];return _0x414fd5;};'use strict';var multer=require('multer');var util=require(_0xba9f('0x0'));var path=require(_0xba9f('0x1'));var timeout=require(_0xba9f('0x2'));var express=require(_0xba9f('0x3'));var router=express[_0xba9f('0x4')]();var fs_extra=require(_0xba9f('0x5'));var auth=require(_0xba9f('0x6'));var interaction=require(_0xba9f('0x7'));var config=require(_0xba9f('0x8'));var controller=require('./intZendeskField.controller');router[_0xba9f('0x9')]('/',auth[_0xba9f('0xa')](),controller['index']);router[_0xba9f('0x9')](_0xba9f('0xb'),auth[_0xba9f('0xa')](),controller['show']);router[_0xba9f('0xc')]('/',auth[_0xba9f('0xa')](),controller[_0xba9f('0xd')]);router[_0xba9f('0xe')](_0xba9f('0xb'),auth[_0xba9f('0xa')](),controller[_0xba9f('0xf')]);router[_0xba9f('0x10')](_0xba9f('0xb'),auth[_0xba9f('0xa')](),controller[_0xba9f('0x11')]);module[_0xba9f('0x12')]=router; \ No newline at end of file +var _0x7b69=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x4a00f7,_0x5b8351){var _0x4ac3f4=function(_0x5ce2dc){while(--_0x5ce2dc){_0x4a00f7['push'](_0x4a00f7['shift']());}};_0x4ac3f4(++_0x5b8351);}(_0x7b69,0x9b));var _0x97b6=function(_0x1bcbd0,_0x46e061){_0x1bcbd0=_0x1bcbd0-0x0;var _0xcee627=_0x7b69[_0x1bcbd0];return _0xcee627;};'use strict';var multer=require('multer');var util=require(_0x97b6('0x0'));var path=require(_0x97b6('0x1'));var timeout=require(_0x97b6('0x2'));var express=require(_0x97b6('0x3'));var router=express['Router']();var fs_extra=require(_0x97b6('0x4'));var auth=require(_0x97b6('0x5'));var interaction=require(_0x97b6('0x6'));var config=require(_0x97b6('0x7'));var controller=require(_0x97b6('0x8'));router[_0x97b6('0x9')]('/',auth[_0x97b6('0xa')](),controller[_0x97b6('0xb')]);router[_0x97b6('0x9')]('/:id',auth[_0x97b6('0xa')](),controller[_0x97b6('0xc')]);router['post']('/',auth[_0x97b6('0xa')](),controller[_0x97b6('0xd')]);router[_0x97b6('0xe')]('/:id',auth[_0x97b6('0xa')](),controller[_0x97b6('0xf')]);router[_0x97b6('0x10')](_0x97b6('0x11'),auth[_0x97b6('0xa')](),controller[_0x97b6('0x12')]);module[_0x97b6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 5e0ad24..4d5a26f 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 _0x7f69=['customVariable','picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x310ee0,_0x1c5d46){var _0x2aae43=function(_0x15dabd){while(--_0x15dabd){_0x310ee0['push'](_0x310ee0['shift']());}};_0x2aae43(++_0x1c5d46);}(_0x7f69,0x189));var _0x97f6=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x7f69[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0x97f6('0x0'));module[_0x97f6('0x1')]={'type':{'type':Sequelize[_0x97f6('0x2')]('string','variable',_0x97f6('0x3'),'keyValue',_0x97f6('0x4')),'defaultValue':_0x97f6('0x5')},'content':{'type':Sequelize[_0x97f6('0x6')]},'key':{'type':Sequelize[_0x97f6('0x6')]},'keyType':{'type':Sequelize[_0x97f6('0x2')](_0x97f6('0x5'),_0x97f6('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x97f6('0x6')]},'idField':{'type':Sequelize[_0x97f6('0x6')]},'nameField':{'type':Sequelize[_0x97f6('0x6')]},'customField':{'type':Sequelize[_0x97f6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x97f6('0x6')]}}; \ No newline at end of file +var _0x00d5=['sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x00d5,0x172));var _0x500d=function(_0x7fc3bc,_0x32e792){_0x7fc3bc=_0x7fc3bc-0x0;var _0x8134d5=_0x00d5[_0x7fc3bc];return _0x8134d5;};'use strict';var Sequelize=require(_0x500d('0x0'));module[_0x500d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x500d('0x2'),_0x500d('0x3'),'customVariable',_0x500d('0x4'),_0x500d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x500d('0x6')]},'key':{'type':Sequelize[_0x500d('0x6')]},'keyType':{'type':Sequelize[_0x500d('0x7')]('string','variable',_0x500d('0x8'))},'keyContent':{'type':Sequelize[_0x500d('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x500d('0x6')]},'customField':{'type':Sequelize[_0x500d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index d9e07d2..98f2f84 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 _0xa053=['sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2ec77d,_0x4ca1ec){var _0x2c2512=function(_0xab9af5){while(--_0xab9af5){_0x2ec77d['push'](_0x2ec77d['shift']());}};_0x2c2512(++_0x4ca1ec);}(_0xa053,0xee));var _0x3a05=function(_0x55ec17,_0x3b3546){_0x55ec17=_0x55ec17-0x0;var _0x1e7abf=_0xa053[_0x55ec17];return _0x1e7abf;};'use strict';var emlformat=require(_0x3a05('0x0'));var rimraf=require(_0x3a05('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a05('0x2'));var rp=require(_0x3a05('0x3'));var moment=require(_0x3a05('0x4'));var BPromise=require(_0x3a05('0x5'));var Mustache=require(_0x3a05('0x6'));var util=require(_0x3a05('0x7'));var path=require(_0x3a05('0x8'));var sox=require(_0x3a05('0x9'));var csv=require(_0x3a05('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3a05('0xb'));var crypto=require(_0x3a05('0xc'));var jsforce=require(_0x3a05('0xd'));var deskjs=require(_0x3a05('0xe'));var toCsv=require(_0x3a05('0xa'));var querystring=require(_0x3a05('0xf'));var Papa=require('papaparse');var Redis=require(_0x3a05('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3a05('0x11'));var as=require(_0x3a05('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a05('0x13'));var utils=require(_0x3a05('0x14'));var config=require(_0x3a05('0x15'));var licenseUtil=require(_0x3a05('0x16'));var db=require(_0x3a05('0x17'))['db'];function respondWithStatusCode(_0x5a04ed,_0xbfd6ec){_0xbfd6ec=_0xbfd6ec||0xcc;return function(_0x154b06){if(_0x154b06){return _0x5a04ed[_0x3a05('0x18')](_0xbfd6ec);}return _0x5a04ed[_0x3a05('0x19')](_0xbfd6ec)[_0x3a05('0x1a')]();};}function respondWithResult(_0x4ece81,_0x1f906d){_0x1f906d=_0x1f906d||0xc8;return function(_0x3fa75b){if(_0x3fa75b){return _0x4ece81[_0x3a05('0x19')](_0x1f906d)[_0x3a05('0x1b')](_0x3fa75b);}};}function respondWithFilteredResult(_0xa6b36b,_0x763765){return function(_0x398ce5){if(_0x398ce5){var _0x394fd4=typeof _0x763765[_0x3a05('0x1c')]===_0x3a05('0x1d')&&typeof _0x763765[_0x3a05('0x1e')]==='undefined';var _0x6c5878=_0x398ce5[_0x3a05('0x1f')];var _0x26622f=_0x394fd4?0x0:_0x763765[_0x3a05('0x1c')];var _0x4c17ae=_0x394fd4?_0x398ce5[_0x3a05('0x1f')]:_0x763765[_0x3a05('0x1c')]+_0x763765[_0x3a05('0x1e')];var _0x482e7e;if(_0x4c17ae>=_0x6c5878){_0x4c17ae=_0x6c5878;_0x482e7e=0xc8;}else{_0x482e7e=0xce;}_0xa6b36b[_0x3a05('0x19')](_0x482e7e);return _0xa6b36b[_0x3a05('0x20')]('Content-Range',_0x26622f+'-'+_0x4c17ae+'/'+_0x6c5878)[_0x3a05('0x1b')](_0x398ce5);}return null;};}function patchUpdates(_0x4a3080){return function(_0x31091b){try{jsonpatch[_0x3a05('0x21')](_0x31091b,_0x4a3080,!![]);}catch(_0x290d5){return BPromise['reject'](_0x290d5);}return _0x31091b[_0x3a05('0x22')]();};}function saveUpdates(_0xb91ce7,_0x5b47a2){return function(_0x70347f){if(_0x70347f){return _0x70347f[_0x3a05('0x23')](_0xb91ce7)[_0x3a05('0x24')](function(_0x58f79c){return _0x58f79c;});}return null;};}function removeEntity(_0x2bbdc9,_0x5c5309){return function(_0x485c9b){if(_0x485c9b){return _0x485c9b[_0x3a05('0x25')]()[_0x3a05('0x24')](function(){_0x2bbdc9[_0x3a05('0x19')](0xcc)[_0x3a05('0x1a')]();});}};}function handleEntityNotFound(_0x3c4631,_0x233a81){return function(_0x456d63){if(!_0x456d63){_0x3c4631['sendStatus'](0x194);}return _0x456d63;};}function handleError(_0x3b8cfa,_0x469737){_0x469737=_0x469737||0x1f4;return function(_0x19081a){logger['error'](_0x19081a[_0x3a05('0x26')]);if(_0x19081a[_0x3a05('0x27')]){delete _0x19081a[_0x3a05('0x27')];}_0x3b8cfa['status'](_0x469737)['send'](_0x19081a);};}exports[_0x3a05('0x28')]=function(_0x50ee32,_0x1e521d){var _0x336cce={},_0x2755e5={},_0x212ebf={'count':0x0,'rows':[]};var _0x10bf80=_[_0x3a05('0x29')](db[_0x3a05('0x2a')][_0x3a05('0x2b')],function(_0x43a612){return{'name':_0x43a612[_0x3a05('0x2c')],'type':_0x43a612[_0x3a05('0x2d')][_0x3a05('0x2e')]};});_0x2755e5['model']=_[_0x3a05('0x29')](_0x10bf80,_0x3a05('0x27'));_0x2755e5['query']=_[_0x3a05('0x2f')](_0x50ee32[_0x3a05('0x30')]);_0x2755e5[_0x3a05('0x31')]=_[_0x3a05('0x32')](_0x2755e5[_0x3a05('0x33')],_0x2755e5[_0x3a05('0x30')]);_0x336cce[_0x3a05('0x34')]=_['intersection'](_0x2755e5[_0x3a05('0x33')],qs[_0x3a05('0x35')](_0x50ee32[_0x3a05('0x30')]['fields']));_0x336cce[_0x3a05('0x34')]=_0x336cce[_0x3a05('0x34')][_0x3a05('0x36')]?_0x336cce[_0x3a05('0x34')]:_0x2755e5[_0x3a05('0x33')];if(!_0x50ee32[_0x3a05('0x30')][_0x3a05('0x37')](_0x3a05('0x38'))){_0x336cce[_0x3a05('0x1e')]=qs['limit'](_0x50ee32['query'][_0x3a05('0x1e')]);_0x336cce[_0x3a05('0x1c')]=qs[_0x3a05('0x1c')](_0x50ee32[_0x3a05('0x30')][_0x3a05('0x1c')]);}_0x336cce[_0x3a05('0x39')]=qs['sort'](_0x50ee32['query'][_0x3a05('0x3a')]);_0x336cce[_0x3a05('0x3b')]=qs[_0x3a05('0x31')](_[_0x3a05('0x3c')](_0x50ee32['query'],_0x2755e5[_0x3a05('0x31')]),_0x10bf80);if(_0x50ee32[_0x3a05('0x30')][_0x3a05('0x3d')]){_0x336cce[_0x3a05('0x3b')]=_[_0x3a05('0x3e')](_0x336cce[_0x3a05('0x3b')],{'$or':_[_0x3a05('0x29')](_0x10bf80,function(_0x3b9a80){if(_0x3b9a80['type']!==_0x3a05('0x3f')){var _0x127170={};_0x127170[_0x3b9a80[_0x3a05('0x27')]]={'$like':'%'+_0x50ee32[_0x3a05('0x30')][_0x3a05('0x3d')]+'%'};return _0x127170;}})});}_0x336cce=_[_0x3a05('0x3e')]({},_0x336cce,_0x50ee32['options']);var _0x457e40={'where':_0x336cce[_0x3a05('0x3b')]};return db[_0x3a05('0x2a')]['count'](_0x457e40)[_0x3a05('0x24')](function(_0x48be09){_0x212ebf[_0x3a05('0x1f')]=_0x48be09;if(_0x50ee32['query'][_0x3a05('0x40')]){_0x336cce['include']=[{'all':!![]}];}return db[_0x3a05('0x2a')][_0x3a05('0x41')](_0x336cce);})[_0x3a05('0x24')](function(_0x5a18e1){_0x212ebf[_0x3a05('0x42')]=_0x5a18e1;return _0x212ebf;})['then'](respondWithFilteredResult(_0x1e521d,_0x336cce))[_0x3a05('0x43')](handleError(_0x1e521d,null));};exports['show']=function(_0x53b976,_0x5b34c3){var _0x49ae38={'raw':!![],'where':{'id':_0x53b976[_0x3a05('0x44')]['id']}},_0x4a9689={};_0x4a9689[_0x3a05('0x33')]=_['keys'](db[_0x3a05('0x2a')][_0x3a05('0x2b')]);_0x4a9689['query']=_['keys'](_0x53b976[_0x3a05('0x30')]);_0x4a9689['filters']=_[_0x3a05('0x32')](_0x4a9689['model'],_0x4a9689['query']);_0x49ae38[_0x3a05('0x34')]=_[_0x3a05('0x32')](_0x4a9689[_0x3a05('0x33')],qs[_0x3a05('0x35')](_0x53b976[_0x3a05('0x30')][_0x3a05('0x35')]));_0x49ae38[_0x3a05('0x34')]=_0x49ae38[_0x3a05('0x34')][_0x3a05('0x36')]?_0x49ae38[_0x3a05('0x34')]:_0x4a9689[_0x3a05('0x33')];if(_0x53b976[_0x3a05('0x30')]['includeAll']){_0x49ae38[_0x3a05('0x45')]=[{'all':!![]}];}_0x49ae38=_['merge']({},_0x49ae38,_0x53b976[_0x3a05('0x46')]);return db[_0x3a05('0x2a')][_0x3a05('0x47')](_0x49ae38)[_0x3a05('0x24')](handleEntityNotFound(_0x5b34c3,null))['then'](respondWithResult(_0x5b34c3,null))[_0x3a05('0x43')](handleError(_0x5b34c3,null));};exports['create']=function(_0x12a039,_0x444c0c){return db[_0x3a05('0x2a')][_0x3a05('0x48')](_0x12a039[_0x3a05('0x49')],{})['then'](respondWithResult(_0x444c0c,0xc9))[_0x3a05('0x43')](handleError(_0x444c0c,null));};exports['update']=function(_0x4c14cc,_0x1461e0){if(_0x4c14cc[_0x3a05('0x49')]['id']){delete _0x4c14cc[_0x3a05('0x49')]['id'];}return db[_0x3a05('0x2a')][_0x3a05('0x47')]({'where':{'id':_0x4c14cc[_0x3a05('0x44')]['id']}})[_0x3a05('0x24')](handleEntityNotFound(_0x1461e0,null))['then'](saveUpdates(_0x4c14cc[_0x3a05('0x49')],null))[_0x3a05('0x24')](respondWithResult(_0x1461e0,null))[_0x3a05('0x43')](handleError(_0x1461e0,null));};exports['destroy']=function(_0x8ee6f4,_0x4e37ad){return db[_0x3a05('0x2a')][_0x3a05('0x47')]({'where':{'id':_0x8ee6f4[_0x3a05('0x44')]['id']}})[_0x3a05('0x24')](handleEntityNotFound(_0x4e37ad,null))[_0x3a05('0x24')](removeEntity(_0x4e37ad,null))[_0x3a05('0x43')](handleError(_0x4e37ad,null));}; \ No newline at end of file +var _0x35ca=['../../config/license/util','sendStatus','json','offset','undefined','limit','status','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','then','rows','show','create','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3d4085,_0x7558d5){var _0x27a386=function(_0x6ed9d7){while(--_0x6ed9d7){_0x3d4085['push'](_0x3d4085['shift']());}};_0x27a386(++_0x7558d5);}(_0x35ca,0x10a));var _0xa35c=function(_0x84c76,_0x253c82){_0x84c76=_0x84c76-0x0;var _0x328f68=_0x35ca[_0x84c76];return _0x328f68;};'use strict';var emlformat=require(_0xa35c('0x0'));var rimraf=require(_0xa35c('0x1'));var zipdir=require(_0xa35c('0x2'));var jsonpatch=require(_0xa35c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa35c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa35c('0x5'));var sox=require('sox');var csv=require(_0xa35c('0x6'));var ejs=require(_0xa35c('0x7'));var fs=require('fs');var fs_extra=require(_0xa35c('0x8'));var _=require(_0xa35c('0x9'));var squel=require('squel');var crypto=require(_0xa35c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa35c('0x6'));var querystring=require(_0xa35c('0xb'));var Papa=require(_0xa35c('0xc'));var Redis=require(_0xa35c('0xd'));var authService=require(_0xa35c('0xe'));var qs=require(_0xa35c('0xf'));var as=require(_0xa35c('0x10'));var hardwareService=require(_0xa35c('0x11'));var logger=require(_0xa35c('0x12'))(_0xa35c('0x13'));var utils=require(_0xa35c('0x14'));var config=require(_0xa35c('0x15'));var licenseUtil=require(_0xa35c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4777fa,_0x238c36){_0x238c36=_0x238c36||0xcc;return function(_0x483a73){if(_0x483a73){return _0x4777fa[_0xa35c('0x17')](_0x238c36);}return _0x4777fa['status'](_0x238c36)['end']();};}function respondWithResult(_0x254470,_0x3d19d0){_0x3d19d0=_0x3d19d0||0xc8;return function(_0x4bac85){if(_0x4bac85){return _0x254470['status'](_0x3d19d0)[_0xa35c('0x18')](_0x4bac85);}};}function respondWithFilteredResult(_0x595c7f,_0x7463d5){return function(_0x2cb5ae){if(_0x2cb5ae){var _0x22439b=typeof _0x7463d5[_0xa35c('0x19')]===_0xa35c('0x1a')&&typeof _0x7463d5[_0xa35c('0x1b')]===_0xa35c('0x1a');var _0x228456=_0x2cb5ae['count'];var _0x9f761b=_0x22439b?0x0:_0x7463d5[_0xa35c('0x19')];var _0xdbfaae=_0x22439b?_0x2cb5ae['count']:_0x7463d5[_0xa35c('0x19')]+_0x7463d5['limit'];var _0x288dba;if(_0xdbfaae>=_0x228456){_0xdbfaae=_0x228456;_0x288dba=0xc8;}else{_0x288dba=0xce;}_0x595c7f[_0xa35c('0x1c')](_0x288dba);return _0x595c7f['set'](_0xa35c('0x1d'),_0x9f761b+'-'+_0xdbfaae+'/'+_0x228456)[_0xa35c('0x18')](_0x2cb5ae);}return null;};}function patchUpdates(_0x146419){return function(_0x337b8b){try{jsonpatch[_0xa35c('0x1e')](_0x337b8b,_0x146419,!![]);}catch(_0x560179){return BPromise[_0xa35c('0x1f')](_0x560179);}return _0x337b8b['save']();};}function saveUpdates(_0x3b3048,_0x198b12){return function(_0x2598c3){if(_0x2598c3){return _0x2598c3[_0xa35c('0x20')](_0x3b3048)['then'](function(_0x20dfc8){return _0x20dfc8;});}return null;};}function removeEntity(_0x1021c3,_0xa8baa2){return function(_0x4fb272){if(_0x4fb272){return _0x4fb272[_0xa35c('0x21')]()['then'](function(){_0x1021c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bc980,_0x3c0623){return function(_0x59542e){if(!_0x59542e){_0x5bc980[_0xa35c('0x17')](0x194);}return _0x59542e;};}function handleError(_0x1ca421,_0x710ce3){_0x710ce3=_0x710ce3||0x1f4;return function(_0x24c215){logger[_0xa35c('0x22')](_0x24c215[_0xa35c('0x23')]);if(_0x24c215[_0xa35c('0x24')]){delete _0x24c215[_0xa35c('0x24')];}_0x1ca421[_0xa35c('0x1c')](_0x710ce3)[_0xa35c('0x25')](_0x24c215);};}exports[_0xa35c('0x26')]=function(_0x270eae,_0xc0fdea){var _0x5e57b0={},_0x21ac30={},_0xd4164f={'count':0x0,'rows':[]};var _0x4a22c2=_[_0xa35c('0x27')](db[_0xa35c('0x28')][_0xa35c('0x29')],function(_0x500715){return{'name':_0x500715[_0xa35c('0x2a')],'type':_0x500715[_0xa35c('0x2b')][_0xa35c('0x2c')]};});_0x21ac30[_0xa35c('0x2d')]=_[_0xa35c('0x27')](_0x4a22c2,'name');_0x21ac30[_0xa35c('0x2e')]=_[_0xa35c('0x2f')](_0x270eae[_0xa35c('0x2e')]);_0x21ac30[_0xa35c('0x30')]=_[_0xa35c('0x31')](_0x21ac30['model'],_0x21ac30['query']);_0x5e57b0[_0xa35c('0x32')]=_[_0xa35c('0x31')](_0x21ac30['model'],qs['fields'](_0x270eae[_0xa35c('0x2e')][_0xa35c('0x33')]));_0x5e57b0['attributes']=_0x5e57b0[_0xa35c('0x32')][_0xa35c('0x34')]?_0x5e57b0[_0xa35c('0x32')]:_0x21ac30[_0xa35c('0x2d')];if(!_0x270eae['query'][_0xa35c('0x35')](_0xa35c('0x36'))){_0x5e57b0['limit']=qs['limit'](_0x270eae['query'][_0xa35c('0x1b')]);_0x5e57b0[_0xa35c('0x19')]=qs[_0xa35c('0x19')](_0x270eae[_0xa35c('0x2e')][_0xa35c('0x19')]);}_0x5e57b0['order']=qs[_0xa35c('0x37')](_0x270eae['query'][_0xa35c('0x37')]);_0x5e57b0[_0xa35c('0x38')]=qs['filters'](_[_0xa35c('0x39')](_0x270eae[_0xa35c('0x2e')],_0x21ac30[_0xa35c('0x30')]),_0x4a22c2);if(_0x270eae['query'][_0xa35c('0x3a')]){_0x5e57b0[_0xa35c('0x38')]=_[_0xa35c('0x3b')](_0x5e57b0['where'],{'$or':_['map'](_0x4a22c2,function(_0xd1bb2c){if(_0xd1bb2c[_0xa35c('0x2b')]!=='VIRTUAL'){var _0x69a156={};_0x69a156[_0xd1bb2c[_0xa35c('0x24')]]={'$like':'%'+_0x270eae['query'][_0xa35c('0x3a')]+'%'};return _0x69a156;}})});}_0x5e57b0=_[_0xa35c('0x3b')]({},_0x5e57b0,_0x270eae[_0xa35c('0x3c')]);var _0x134d42={'where':_0x5e57b0['where']};return db[_0xa35c('0x28')][_0xa35c('0x3d')](_0x134d42)['then'](function(_0x26db32){_0xd4164f[_0xa35c('0x3d')]=_0x26db32;if(_0x270eae['query'][_0xa35c('0x3e')]){_0x5e57b0[_0xa35c('0x3f')]=[{'all':!![]}];}return db[_0xa35c('0x28')][_0xa35c('0x40')](_0x5e57b0);})[_0xa35c('0x41')](function(_0x4e17de){_0xd4164f[_0xa35c('0x42')]=_0x4e17de;return _0xd4164f;})['then'](respondWithFilteredResult(_0xc0fdea,_0x5e57b0))['catch'](handleError(_0xc0fdea,null));};exports[_0xa35c('0x43')]=function(_0x404f4d,_0x298d8b){var _0x2e7f4e={'raw':!![],'where':{'id':_0x404f4d['params']['id']}},_0x241a5c={};_0x241a5c[_0xa35c('0x2d')]=_[_0xa35c('0x2f')](db[_0xa35c('0x28')]['rawAttributes']);_0x241a5c['query']=_['keys'](_0x404f4d[_0xa35c('0x2e')]);_0x241a5c[_0xa35c('0x30')]=_[_0xa35c('0x31')](_0x241a5c[_0xa35c('0x2d')],_0x241a5c[_0xa35c('0x2e')]);_0x2e7f4e[_0xa35c('0x32')]=_[_0xa35c('0x31')](_0x241a5c[_0xa35c('0x2d')],qs[_0xa35c('0x33')](_0x404f4d[_0xa35c('0x2e')][_0xa35c('0x33')]));_0x2e7f4e['attributes']=_0x2e7f4e[_0xa35c('0x32')]['length']?_0x2e7f4e[_0xa35c('0x32')]:_0x241a5c[_0xa35c('0x2d')];if(_0x404f4d['query'][_0xa35c('0x3e')]){_0x2e7f4e[_0xa35c('0x3f')]=[{'all':!![]}];}_0x2e7f4e=_[_0xa35c('0x3b')]({},_0x2e7f4e,_0x404f4d[_0xa35c('0x3c')]);return db[_0xa35c('0x28')]['find'](_0x2e7f4e)[_0xa35c('0x41')](handleEntityNotFound(_0x298d8b,null))[_0xa35c('0x41')](respondWithResult(_0x298d8b,null))['catch'](handleError(_0x298d8b,null));};exports[_0xa35c('0x44')]=function(_0x3c8323,_0x2e2f65){return db[_0xa35c('0x28')][_0xa35c('0x44')](_0x3c8323['body'],{})['then'](respondWithResult(_0x2e2f65,0xc9))[_0xa35c('0x45')](handleError(_0x2e2f65,null));};exports[_0xa35c('0x20')]=function(_0x28b13c,_0x2f017f){if(_0x28b13c[_0xa35c('0x46')]['id']){delete _0x28b13c[_0xa35c('0x46')]['id'];}return db[_0xa35c('0x28')]['find']({'where':{'id':_0x28b13c[_0xa35c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f017f,null))[_0xa35c('0x41')](saveUpdates(_0x28b13c[_0xa35c('0x46')],null))[_0xa35c('0x41')](respondWithResult(_0x2f017f,null))[_0xa35c('0x45')](handleError(_0x2f017f,null));};exports[_0xa35c('0x21')]=function(_0x4be807,_0x41849a){return db['ZendeskField']['find']({'where':{'id':_0x4be807[_0xa35c('0x47')]['id']}})[_0xa35c('0x41')](handleEntityNotFound(_0x41849a,null))[_0xa35c('0x41')](removeEntity(_0x41849a,null))[_0xa35c('0x45')](handleError(_0x41849a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 88ead63..a9087b1 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 _0xd01f=['moment','path','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xd01f,0x1d0));var _0xfd01=function(_0x3509da,_0x6fd688){_0x3509da=_0x3509da-0x0;var _0x43d572=_0xd01f[_0x3509da];return _0x43d572;};'use strict';var _=require(_0xfd01('0x0'));var util=require(_0xfd01('0x1'));var logger=require(_0xfd01('0x2'))(_0xfd01('0x3'));var moment=require(_0xfd01('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd01('0x5'));var rimraf=require('rimraf');var config=require(_0xfd01('0x6'));var attributes=require(_0xfd01('0x7'));module['exports']=function(_0x222826,_0x20989f){return _0x222826[_0xfd01('0x8')](_0xfd01('0x9'),attributes,{'tableName':_0xfd01('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xfd01('0xb'),_0xfd01('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3685=['rimraf','./intZendeskField.attributes','exports','define','lodash','util','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3685,0x136));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5368('0x0'));var util=require(_0x5368('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5368('0x2'));var rp=require(_0x5368('0x3'));var fs=require('fs');var path=require(_0x5368('0x4'));var rimraf=require(_0x5368('0x5'));var config=require('../../config/environment');var attributes=require(_0x5368('0x6'));module[_0x5368('0x7')]=function(_0x15c878,_0x25c4a5){return _0x15c878[_0x5368('0x8')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 54c85f3..9a5612f 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 _0x5f07=['then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','ZendeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x47c997,_0x554ab1){var _0x5afc8e=function(_0x1e0559){while(--_0x1e0559){_0x47c997['push'](_0x47c997['shift']());}};_0x5afc8e(++_0x554ab1);}(_0x5f07,0x14d));var _0x75f0=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x5f07[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0x75f0('0x0'));var util=require(_0x75f0('0x1'));var moment=require(_0x75f0('0x2'));var BPromise=require(_0x75f0('0x3'));var rs=require(_0x75f0('0x4'));var fs=require('fs');var Redis=require(_0x75f0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x75f0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x75f0('0x7'));var jayson=require(_0x75f0('0x8'));var client=jayson[_0x75f0('0x9')][_0x75f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ec9e0,_0x4c2c73,_0x16dfcc){return new BPromise(function(_0xc06bac,_0x37ca7d){return client[_0x75f0('0xb')](_0x4ec9e0,_0x16dfcc)[_0x75f0('0xc')](function(_0x402702){logger[_0x75f0('0xd')]('ZendeskField,\x20%s,\x20%s',_0x4c2c73,_0x75f0('0xe'));logger[_0x75f0('0xf')](_0x75f0('0x10'),_0x4c2c73,_0x75f0('0xe'),JSON[_0x75f0('0x11')](_0x402702));if(_0x402702['error']){if(_0x402702['error'][_0x75f0('0x12')]===0x1f4){logger[_0x75f0('0x13')](_0x75f0('0x14'),_0x4c2c73,_0x402702[_0x75f0('0x13')]['message']);return _0x37ca7d(_0x402702[_0x75f0('0x13')]['message']);}logger[_0x75f0('0x13')](_0x75f0('0x14'),_0x4c2c73,_0x402702['error']['message']);return _0xc06bac(_0x402702[_0x75f0('0x13')][_0x75f0('0x15')]);}else{logger['info'](_0x75f0('0x14'),_0x4c2c73,_0x75f0('0xe'));_0xc06bac(_0x402702[_0x75f0('0x16')][_0x75f0('0x15')]);}})['catch'](function(_0x1b068b){logger[_0x75f0('0x13')](_0x75f0('0x14'),_0x4c2c73,_0x1b068b);_0x37ca7d(_0x1b068b);});});} \ No newline at end of file +var _0xa9b5=['catch','moment','bluebird','../../config/utils','client','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3cd336,_0x2fe53f){var _0x5e6421=function(_0x4dde3e){while(--_0x4dde3e){_0x3cd336['push'](_0x3cd336['shift']());}};_0x5e6421(++_0x2fe53f);}(_0xa9b5,0x131));var _0x5a9b=function(_0x26463e,_0x293add){_0x26463e=_0x26463e-0x0;var _0xceee2a=_0xa9b5[_0x26463e];return _0xceee2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5a9b('0x0'));var BPromise=require(_0x5a9b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a9b('0x2'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a9b('0x3')]['http']({'port':0x232a});function respondWithRpcPromise(_0x310983,_0x20df5d,_0x38d804){return new BPromise(function(_0x4f0e8b,_0x2dbb10){return client[_0x5a9b('0x4')](_0x310983,_0x38d804)[_0x5a9b('0x5')](function(_0x392e62){logger['info'](_0x5a9b('0x6'),_0x20df5d,_0x5a9b('0x7'));logger[_0x5a9b('0x8')](_0x5a9b('0x9'),_0x20df5d,_0x5a9b('0x7'),JSON[_0x5a9b('0xa')](_0x392e62));if(_0x392e62[_0x5a9b('0xb')]){if(_0x392e62[_0x5a9b('0xb')][_0x5a9b('0xc')]===0x1f4){logger[_0x5a9b('0xb')](_0x5a9b('0x6'),_0x20df5d,_0x392e62[_0x5a9b('0xb')][_0x5a9b('0xd')]);return _0x2dbb10(_0x392e62[_0x5a9b('0xb')][_0x5a9b('0xd')]);}logger[_0x5a9b('0xb')]('ZendeskField,\x20%s,\x20%s',_0x20df5d,_0x392e62[_0x5a9b('0xb')][_0x5a9b('0xd')]);return _0x4f0e8b(_0x392e62[_0x5a9b('0xb')][_0x5a9b('0xd')]);}else{logger['info'](_0x5a9b('0x6'),_0x20df5d,_0x5a9b('0x7'));_0x4f0e8b(_0x392e62[_0x5a9b('0xe')][_0x5a9b('0xd')]);}})[_0x5a9b('0xf')](function(_0x31e9a0){logger[_0x5a9b('0xb')](_0x5a9b('0x6'),_0x20df5d,_0x31e9a0);_0x2dbb10(_0x31e9a0);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 2ef4fcf..fbefef7 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 _0x8967=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put'];(function(_0x367743,_0x1fa581){var _0x4ee62a=function(_0x5161d4){while(--_0x5161d4){_0x367743['push'](_0x367743['shift']());}};_0x4ee62a(++_0x1fa581);}(_0x8967,0x1e6));var _0x7896=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8967[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x7896('0x0'));var util=require(_0x7896('0x1'));var path=require('path');var timeout=require(_0x7896('0x2'));var express=require(_0x7896('0x3'));var router=express[_0x7896('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7896('0x5'));var interaction=require(_0x7896('0x6'));var config=require(_0x7896('0x7'));var controller=require(_0x7896('0x8'));router[_0x7896('0x9')]('/',auth[_0x7896('0xa')](),controller[_0x7896('0xb')]);router[_0x7896('0x9')](_0x7896('0xc'),auth[_0x7896('0xa')](),controller[_0x7896('0xd')]);router[_0x7896('0x9')](_0x7896('0xe'),auth[_0x7896('0xa')](),controller[_0x7896('0xf')]);router['get']('/:id/fields',auth[_0x7896('0xa')](),controller['getFields']);router[_0x7896('0x10')]('/',auth['isAuthenticated'](),controller[_0x7896('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x7896('0x12')]);router[_0x7896('0x13')]('/:id',auth[_0x7896('0xa')](),controller['update']);router[_0x7896('0x14')](_0x7896('0xc'),auth['isAuthenticated'](),controller[_0x7896('0x15')]);module[_0x7896('0x16')]=router; \ No newline at end of file +var _0xad7b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','destroy','exports','multer','util','path'];(function(_0xb04cb1,_0x13b8e3){var _0x309445=function(_0x21422b){while(--_0x21422b){_0xb04cb1['push'](_0xb04cb1['shift']());}};_0x309445(++_0x13b8e3);}(_0xad7b,0xed));var _0xbad7=function(_0x36f5e1,_0x47efa2){_0x36f5e1=_0x36f5e1-0x0;var _0x289a7d=_0xad7b[_0x36f5e1];return _0x289a7d;};'use strict';var multer=require(_0xbad7('0x0'));var util=require(_0xbad7('0x1'));var path=require(_0xbad7('0x2'));var timeout=require(_0xbad7('0x3'));var express=require('express');var router=express[_0xbad7('0x4')]();var fs_extra=require(_0xbad7('0x5'));var auth=require(_0xbad7('0x6'));var interaction=require(_0xbad7('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xbad7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbad7('0x8')](_0xbad7('0x9'),auth[_0xbad7('0xa')](),controller[_0xbad7('0xb')]);router[_0xbad7('0x8')](_0xbad7('0xc'),auth['isAuthenticated'](),controller[_0xbad7('0xd')]);router[_0xbad7('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbad7('0xe')]);router[_0xbad7('0xf')]('/',auth[_0xbad7('0xa')](),controller['create']);router[_0xbad7('0xf')](_0xbad7('0xc'),auth['isAuthenticated'](),controller[_0xbad7('0x10')]);router[_0xbad7('0x11')](_0xbad7('0x9'),auth[_0xbad7('0xa')](),controller['update']);router['delete'](_0xbad7('0x9'),auth[_0xbad7('0xa')](),controller[_0xbad7('0x12')]);module[_0xbad7('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 266ee9b..988acc1 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 _0x008c=['exports','STRING','sequelize'];(function(_0x1e6f9a,_0x37c6d8){var _0x2b65b0=function(_0xfc8c6){while(--_0xfc8c6){_0x1e6f9a['push'](_0x1e6f9a['shift']());}};_0x2b65b0(++_0x37c6d8);}(_0x008c,0x188));var _0xc008=function(_0x219cc1,_0x3d03b5){_0x219cc1=_0x219cc1-0x0;var _0x177034=_0x008c[_0x219cc1];return _0x177034;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')]},'description':{'type':Sequelize[_0xc008('0x2')]},'host':{'type':Sequelize[_0xc008('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc008('0x2')]},'clientSecret':{'type':Sequelize[_0xc008('0x2')]},'serverUrl':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xc008('0x2')]},'refreshToken':{'type':Sequelize[_0xc008('0x2')]}}; \ No newline at end of file +var _0x54ef=['STRING','sequelize','exports'];(function(_0x44745f,_0x432d7e){var _0xac7f24=function(_0x53038f){while(--_0x53038f){_0x44745f['push'](_0x44745f['shift']());}};_0xac7f24(++_0x432d7e);}(_0x54ef,0x112));var _0xf54e=function(_0x30aa46,_0x26f7bd){_0x30aa46=_0x30aa46-0x0;var _0x51fc2e=_0x54ef[_0x30aa46];return _0x51fc2e;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'name':{'type':Sequelize[_0xf54e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xf54e('0x2')]},'zone':{'type':Sequelize[_0xf54e('0x2')]},'clientId':{'type':Sequelize[_0xf54e('0x2')]},'clientSecret':{'type':Sequelize[_0xf54e('0x2')]},'serverUrl':{'type':Sequelize[_0xf54e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xf54e('0x2')]},'refreshToken':{'type':Sequelize[_0xf54e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 85ca72d..ec93431 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 _0x4326=['https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','serverUrl','code','refreshToken','host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','WhoId','Call_Duration','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','end','error','name','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','type','options','includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone'];(function(_0x2d5f15,_0x55e1c8){var _0x14bdbd=function(_0xa9858e){while(--_0xa9858e){_0x2d5f15['push'](_0x2d5f15['shift']());}};_0x14bdbd(++_0x55e1c8);}(_0x4326,0xb2));var _0x6432=function(_0x14d851,_0x20dee8){_0x14d851=_0x14d851-0x0;var _0x52428b=_0x4326[_0x14d851];return _0x52428b;};'use strict';var emlformat=require(_0x6432('0x0'));var rimraf=require(_0x6432('0x1'));var zipdir=require(_0x6432('0x2'));var jsonpatch=require(_0x6432('0x3'));var rp=require(_0x6432('0x4'));var moment=require(_0x6432('0x5'));var BPromise=require(_0x6432('0x6'));var Mustache=require(_0x6432('0x7'));var util=require(_0x6432('0x8'));var path=require(_0x6432('0x9'));var sox=require(_0x6432('0xa'));var csv=require(_0x6432('0xb'));var ejs=require(_0x6432('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6432('0xd'));var squel=require('squel');var crypto=require(_0x6432('0xe'));var jsforce=require(_0x6432('0xf'));var deskjs=require(_0x6432('0x10'));var toCsv=require(_0x6432('0xb'));var querystring=require('querystring');var Papa=require(_0x6432('0x11'));var Redis=require('ioredis');var authService=require(_0x6432('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6432('0x13'));var hardwareService=require(_0x6432('0x14'));var logger=require(_0x6432('0x15'))(_0x6432('0x16'));var utils=require(_0x6432('0x17'));var config=require(_0x6432('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6432('0x19'))['db'];var integrations=require(_0x6432('0x1a'));function respondWithStatusCode(_0x13894a,_0x28c82a){_0x28c82a=_0x28c82a||0xcc;return function(_0x53aff9){if(_0x53aff9){return _0x13894a[_0x6432('0x1b')](_0x28c82a);}return _0x13894a[_0x6432('0x1c')](_0x28c82a)['end']();};}function respondWithResult(_0x424e1b,_0x40e4d3){_0x40e4d3=_0x40e4d3||0xc8;return function(_0x2e059c){if(_0x2e059c){return _0x424e1b[_0x6432('0x1c')](_0x40e4d3)['json'](_0x2e059c);}};}function respondWithFilteredResult(_0x25563b,_0x3e5c3e){return function(_0x4bf3bf){if(_0x4bf3bf){var _0x2a0e1a=typeof _0x3e5c3e['offset']==='undefined'&&typeof _0x3e5c3e['limit']===_0x6432('0x1d');var _0x560a35=_0x4bf3bf[_0x6432('0x1e')];var _0x1d72b0=_0x2a0e1a?0x0:_0x3e5c3e['offset'];var _0x283705=_0x2a0e1a?_0x4bf3bf[_0x6432('0x1e')]:_0x3e5c3e[_0x6432('0x1f')]+_0x3e5c3e[_0x6432('0x20')];var _0x6cfcdb;if(_0x283705>=_0x560a35){_0x283705=_0x560a35;_0x6cfcdb=0xc8;}else{_0x6cfcdb=0xce;}_0x25563b[_0x6432('0x1c')](_0x6cfcdb);return _0x25563b['set'](_0x6432('0x21'),_0x1d72b0+'-'+_0x283705+'/'+_0x560a35)[_0x6432('0x22')](_0x4bf3bf);}return null;};}function patchUpdates(_0x9b8b5a){return function(_0x3e47c0){try{jsonpatch[_0x6432('0x23')](_0x3e47c0,_0x9b8b5a,!![]);}catch(_0x420e4a){return BPromise['reject'](_0x420e4a);}return _0x3e47c0[_0x6432('0x24')]();};}function saveUpdates(_0x33eda2,_0x4fad10){return function(_0x4c7f21){if(_0x4c7f21){return _0x4c7f21[_0x6432('0x25')](_0x33eda2)[_0x6432('0x26')](function(_0x238617){return _0x238617;});}return null;};}function removeEntity(_0x2b91cf,_0x4b39b2){return function(_0x90eb9c){if(_0x90eb9c){return _0x90eb9c[_0x6432('0x27')]()['then'](function(){_0x2b91cf['status'](0xcc)[_0x6432('0x28')]();});}};}function handleEntityNotFound(_0x500a97,_0x4b99c3){return function(_0xe6e348){if(!_0xe6e348){_0x500a97[_0x6432('0x1b')](0x194);}return _0xe6e348;};}function handleError(_0x11b940,_0x356747){_0x356747=_0x356747||0x1f4;return function(_0x3c960e){logger[_0x6432('0x29')](_0x3c960e['stack']);if(_0x3c960e[_0x6432('0x2a')]){delete _0x3c960e[_0x6432('0x2a')];}_0x11b940[_0x6432('0x1c')](_0x356747)['send'](_0x3c960e);};}exports[_0x6432('0x2b')]=function(_0x1ab2b0,_0x5817ae){var _0x4ddf57={},_0x12cfb1={},_0x5028a0={'count':0x0,'rows':[]};var _0x16e0b0=_[_0x6432('0x2c')](db[_0x6432('0x2d')][_0x6432('0x2e')],function(_0xbb2562){return{'name':_0xbb2562[_0x6432('0x2f')],'type':_0xbb2562['type'][_0x6432('0x30')]};});_0x12cfb1[_0x6432('0x31')]=_[_0x6432('0x2c')](_0x16e0b0,_0x6432('0x2a'));_0x12cfb1[_0x6432('0x32')]=_[_0x6432('0x33')](_0x1ab2b0[_0x6432('0x32')]);_0x12cfb1['filters']=_[_0x6432('0x34')](_0x12cfb1[_0x6432('0x31')],_0x12cfb1[_0x6432('0x32')]);_0x4ddf57['attributes']=_[_0x6432('0x34')](_0x12cfb1[_0x6432('0x31')],qs[_0x6432('0x35')](_0x1ab2b0[_0x6432('0x32')][_0x6432('0x35')]));_0x4ddf57['attributes']=_0x4ddf57[_0x6432('0x36')][_0x6432('0x37')]?_0x4ddf57[_0x6432('0x36')]:_0x12cfb1[_0x6432('0x31')];if(!_0x1ab2b0[_0x6432('0x32')][_0x6432('0x38')](_0x6432('0x39'))){_0x4ddf57[_0x6432('0x20')]=qs[_0x6432('0x20')](_0x1ab2b0[_0x6432('0x32')][_0x6432('0x20')]);_0x4ddf57[_0x6432('0x1f')]=qs[_0x6432('0x1f')](_0x1ab2b0[_0x6432('0x32')]['offset']);}_0x4ddf57[_0x6432('0x3a')]=qs[_0x6432('0x3b')](_0x1ab2b0[_0x6432('0x32')][_0x6432('0x3b')]);_0x4ddf57['where']=qs[_0x6432('0x3c')](_['pick'](_0x1ab2b0[_0x6432('0x32')],_0x12cfb1[_0x6432('0x3c')]),_0x16e0b0);if(_0x1ab2b0[_0x6432('0x32')][_0x6432('0x3d')]){_0x4ddf57['where']=_[_0x6432('0x3e')](_0x4ddf57[_0x6432('0x3f')],{'$or':_[_0x6432('0x2c')](_0x16e0b0,function(_0x3eaba8){if(_0x3eaba8[_0x6432('0x40')]!=='VIRTUAL'){var _0x2d175b={};_0x2d175b[_0x3eaba8[_0x6432('0x2a')]]={'$like':'%'+_0x1ab2b0[_0x6432('0x32')][_0x6432('0x3d')]+'%'};return _0x2d175b;}})});}_0x4ddf57=_[_0x6432('0x3e')]({},_0x4ddf57,_0x1ab2b0[_0x6432('0x41')]);var _0x3e5ec2={'where':_0x4ddf57['where']};return db[_0x6432('0x2d')][_0x6432('0x1e')](_0x3e5ec2)['then'](function(_0x51dc99){_0x5028a0[_0x6432('0x1e')]=_0x51dc99;if(_0x1ab2b0['query'][_0x6432('0x42')]){_0x4ddf57[_0x6432('0x43')]=[{'all':!![]}];}return db['ZohoAccount'][_0x6432('0x44')](_0x4ddf57);})[_0x6432('0x26')](function(_0x7a1751){_0x5028a0[_0x6432('0x45')]=_0x7a1751;return _0x5028a0;})[_0x6432('0x26')](respondWithFilteredResult(_0x5817ae,_0x4ddf57))[_0x6432('0x46')](handleError(_0x5817ae,null));};exports['show']=function(_0xdf0d29,_0x1a2595){var _0x1ae671={'raw':![],'where':{'id':_0xdf0d29['params']['id']}},_0x12aa55={};_0x12aa55[_0x6432('0x31')]=_[_0x6432('0x33')](db[_0x6432('0x2d')]['rawAttributes']);_0x12aa55['query']=_[_0x6432('0x33')](_0xdf0d29['query']);_0x12aa55[_0x6432('0x3c')]=_[_0x6432('0x34')](_0x12aa55[_0x6432('0x31')],_0x12aa55[_0x6432('0x32')]);_0x1ae671[_0x6432('0x36')]=_[_0x6432('0x34')](_0x12aa55[_0x6432('0x31')],qs[_0x6432('0x35')](_0xdf0d29['query'][_0x6432('0x35')]));_0x1ae671[_0x6432('0x36')]=_0x1ae671[_0x6432('0x36')][_0x6432('0x37')]?_0x1ae671[_0x6432('0x36')]:_0x12aa55['model'];if(_0xdf0d29[_0x6432('0x32')][_0x6432('0x42')]){_0x1ae671[_0x6432('0x43')]=[{'all':!![]}];}_0x1ae671=_[_0x6432('0x3e')]({},_0x1ae671,_0xdf0d29['options']);return db[_0x6432('0x2d')][_0x6432('0x47')](_0x1ae671)[_0x6432('0x26')](handleEntityNotFound(_0x1a2595,null))[_0x6432('0x26')](respondWithResult(_0x1a2595,null))[_0x6432('0x46')](handleError(_0x1a2595,null));};exports[_0x6432('0x48')]=function(_0x55f4f0,_0x49caa6){return db[_0x6432('0x2d')][_0x6432('0x48')](_0x55f4f0[_0x6432('0x49')],{})[_0x6432('0x26')](respondWithResult(_0x49caa6,0xc9))['catch'](handleError(_0x49caa6,null));};exports[_0x6432('0x25')]=function(_0x29f1cf,_0x23717c){if(_0x29f1cf[_0x6432('0x49')]['id']){delete _0x29f1cf['body']['id'];}return db[_0x6432('0x2d')]['find']({'where':{'id':_0x29f1cf[_0x6432('0x4a')]['id']}})[_0x6432('0x26')](handleEntityNotFound(_0x23717c,null))[_0x6432('0x26')](saveUpdates(_0x29f1cf[_0x6432('0x49')],null))[_0x6432('0x26')](respondWithResult(_0x23717c,null))[_0x6432('0x46')](handleError(_0x23717c,null));};exports[_0x6432('0x27')]=function(_0xc32241,_0x5ab3f9){return db[_0x6432('0x2d')]['find']({'where':{'id':_0xc32241[_0x6432('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ab3f9,null))['then'](removeEntity(_0x5ab3f9,null))[_0x6432('0x46')](handleError(_0x5ab3f9,null));};exports[_0x6432('0x4b')]=function(_0x3a709f,_0x10f830,_0x3e964b){var _0x4acdf9={};var _0x2380dc={};var _0x5d30c1;var _0x132c42;return db['ZohoAccount'][_0x6432('0x4c')]({'where':{'id':_0x3a709f['params']['id']}})[_0x6432('0x26')](handleEntityNotFound(_0x10f830,null))[_0x6432('0x26')](function(_0xb943f3){if(_0xb943f3){_0x5d30c1=_0xb943f3;_0x2380dc[_0x6432('0x31')]=_[_0x6432('0x33')](db[_0x6432('0x4d')][_0x6432('0x2e')]);_0x2380dc[_0x6432('0x32')]=_[_0x6432('0x33')](_0x3a709f['query']);_0x2380dc['filters']=_['intersection'](_0x2380dc[_0x6432('0x31')],_0x2380dc[_0x6432('0x32')]);_0x4acdf9[_0x6432('0x36')]=_[_0x6432('0x34')](_0x2380dc['model'],qs[_0x6432('0x35')](_0x3a709f[_0x6432('0x32')][_0x6432('0x35')]));_0x4acdf9[_0x6432('0x36')]=_0x4acdf9[_0x6432('0x36')][_0x6432('0x37')]?_0x4acdf9[_0x6432('0x36')]:_0x2380dc[_0x6432('0x31')];_0x4acdf9[_0x6432('0x3a')]=qs[_0x6432('0x3b')](_0x3a709f[_0x6432('0x32')][_0x6432('0x3b')]);_0x4acdf9[_0x6432('0x3f')]=qs['filters'](_[_0x6432('0x4e')](_0x3a709f['query'],_0x2380dc[_0x6432('0x3c')]));if(_0x3a709f[_0x6432('0x32')][_0x6432('0x3d')]){_0x4acdf9['where']=_[_0x6432('0x3e')](_0x4acdf9['where'],{'$or':_[_0x6432('0x2c')](_0x4acdf9[_0x6432('0x36')],function(_0x107d01){var _0x5bdc02={};_0x5bdc02[_0x107d01]={'$like':'%'+_0x3a709f[_0x6432('0x32')][_0x6432('0x3d')]+'%'};return _0x5bdc02;})});}_0x4acdf9=_['merge']({},_0x4acdf9,_0x3a709f['options']);return _0x5d30c1[_0x6432('0x4b')](_0x4acdf9);}})[_0x6432('0x26')](function(_0x5dfc25){if(_0x5dfc25){_0x132c42=_0x5dfc25[_0x6432('0x37')];if(!_0x3a709f[_0x6432('0x32')][_0x6432('0x38')](_0x6432('0x39'))){_0x4acdf9['limit']=qs[_0x6432('0x20')](_0x3a709f[_0x6432('0x32')][_0x6432('0x20')]);_0x4acdf9[_0x6432('0x1f')]=qs[_0x6432('0x1f')](_0x3a709f[_0x6432('0x32')][_0x6432('0x1f')]);}return _0x5d30c1[_0x6432('0x4b')](_0x4acdf9);}})[_0x6432('0x26')](function(_0x170e9a){if(_0x170e9a){return _0x170e9a?{'count':_0x132c42,'rows':_0x170e9a}:null;}})[_0x6432('0x26')](respondWithResult(_0x10f830,null))[_0x6432('0x46')](handleError(_0x10f830,null));};exports[_0x6432('0x4f')]=function(_0x24c916,_0x425c96,_0x3ad6fd){if(_0x24c916[_0x6432('0x49')]['id']){delete _0x24c916[_0x6432('0x49')]['id'];}return db[_0x6432('0x2d')]['findOne']({'where':{'id':_0x24c916[_0x6432('0x4a')]['id']}})[_0x6432('0x26')](handleEntityNotFound(_0x425c96,null))[_0x6432('0x26')](function(_0x1f4793){if(_0x1f4793){_0x24c916[_0x6432('0x49')][_0x6432('0x50')]=_0x1f4793['id'];_0x24c916[_0x6432('0x49')][_0x6432('0x51')]=integrations[_0x6432('0x52')](_0x24c916[_0x6432('0x49')][_0x6432('0x53')],_0x24c916[_0x6432('0x49')]['type']);_0x24c916[_0x6432('0x49')][_0x6432('0x54')]=integrations[_0x6432('0x55')](_0x24c916[_0x6432('0x49')][_0x6432('0x53')],_0x24c916[_0x6432('0x49')][_0x6432('0x40')]);return db[_0x6432('0x4d')][_0x6432('0x48')](_0x24c916[_0x6432('0x49')],{'include':[{'model':db[_0x6432('0x56')],'as':_0x6432('0x51')},{'model':db[_0x6432('0x56')],'as':'Descriptions'}]});}return null;})[_0x6432('0x26')](respondWithResult(_0x425c96,null))[_0x6432('0x46')](handleError(_0x425c96,null));};function getAccessToken(_0xde4e49){return new Promise(function(_0x22b7a8,_0x1adc36){var _0x763b5d;switch(_0xde4e49[_0x6432('0x57')]){case'US':_0x763b5d='https://accounts.zoho.com';break;case'AU':_0x763b5d=_0x6432('0x58');break;case'EU':_0x763b5d='https://accounts.zoho.eu';break;case'IN':_0x763b5d=_0x6432('0x59');break;case'CN':_0x763b5d=_0x6432('0x5a');break;default:_0x763b5d=_0x6432('0x5b');break;}var _0x5873d3={'method':_0x6432('0x5c'),'uri':_0x763b5d+_0x6432('0x5d'),'qs':{'refresh_token':_0xde4e49['refreshToken'],'client_id':_0xde4e49[_0x6432('0x5e')],'client_secret':_0xde4e49[_0x6432('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5873d3)['then'](function(_0x19b664){if(_0x19b664['access_token']){_0x22b7a8(_0x19b664[_0x6432('0x60')]);}else{_0x1adc36(_0x6432('0x61'));}})[_0x6432('0x46')](function(_0x3b8125){_0x1adc36(_0x3b8125);});});}exports['getFields']=function(_0x3a237b,_0x7e0274,_0x9e2c46){var _0x35c2b8,_0x3d72b4,_0x517f71,_0x5e28aa,_0x538813;return db[_0x6432('0x2d')][_0x6432('0x4c')]({'where':{'id':_0x3a237b[_0x6432('0x4a')]['id']},'attributes':['id','host',_0x6432('0x57'),_0x6432('0x5e'),_0x6432('0x5f'),_0x6432('0x62'),_0x6432('0x63'),_0x6432('0x64')]})[_0x6432('0x26')](handleEntityNotFound(_0x7e0274,null))[_0x6432('0x26')](function(_0x176a35){_0x538813=_0x176a35;_0x35c2b8=_0x538813[_0x6432('0x65')];_0x3d72b4=_0x35c2b8===_0x6432('0x66')?'eu':_0x6432('0x67');_0x517f71=_0x538813['serverUrl'];var _0x313dbf=_0x517f71[_0x6432('0x68')](-0x1);if(_0x313dbf==='/'||_0x313dbf==='\x5c'||_0x313dbf===':'){_0x517f71=_0x517f71[_0x6432('0x69')](0x0,_0x517f71[_0x6432('0x6a')](_0x313dbf));}if(!_0x538813['refreshToken']){throw new Error(_0x6432('0x6b'));}return getAccessToken(_0x538813);})['then'](function(_0x5125ab){if(_0x5125ab){return rp({'method':_0x6432('0x6c'),'uri':util[_0x6432('0x6d')](_0x6432('0x6e'),_0x3d72b4),'qs':{'module':_0x6432('0x6f')},'headers':{'Authorization':_0x6432('0x70')+_0x5125ab},'json':!![]});}})[_0x6432('0x26')](function(_0x5eb831){if(_0x5eb831){if(_0x5eb831[_0x6432('0x71')]&&_0x5eb831[_0x6432('0x71')]['error']){throw new Error(_0x5eb831[_0x6432('0x71')][_0x6432('0x29')][_0x6432('0x72')]);}var _0x2977e2=[];var _0x3c0fbc=[];var _0x31da08=[_0x6432('0x73'),'Subject','Description',_0x6432('0x74'),_0x6432('0x75'),'Call_Result',_0x6432('0x76'),'Call_Type'];_0x3c0fbc=_['remove'](_0x5eb831['fields'],function(_0x5f1d20){return _0x31da08[_0x6432('0x77')](_0x5f1d20[_0x6432('0x78')]);});for(var _0x569ccc=0x0;_0x569ccc<_0x3c0fbc[_0x6432('0x37')];_0x569ccc++){if(_0x3c0fbc[_0x569ccc][_0x6432('0x79')]===![]){_0x2977e2[_0x6432('0x7a')]({'id':_0x3c0fbc[_0x569ccc]['id'],'name':_0x3c0fbc[_0x569ccc][_0x6432('0x7b')],'custom':_0x3c0fbc[_0x569ccc][_0x6432('0x7c')],'options':_0x3c0fbc[_0x569ccc][_0x6432('0x7d')]===_0x6432('0x7e')&&_0x3c0fbc[_0x569ccc]['pick_list_values'][_0x6432('0x37')]>-0x1?_['map'](_0x3c0fbc[_0x569ccc][_0x6432('0x7f')],function(_0x2736fa){return{'name':_0x2736fa,'value':_0x2736fa};}):[]});}}return{'count':_0x2977e2[_0x6432('0x37')],'rows':_0x2977e2};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x7e0274,null))[_0x6432('0x46')](function(_0x34c362){var _0x167a60=_0x3a237b[_0x6432('0x32')][_0x6432('0x80')]?0x1f4:_0x34c362[_0x6432('0x81')]||0x1f4;logger[_0x6432('0x29')](_0x6432('0x82'),'getFields',_0x167a60,JSON[_0x6432('0x83')](_0x34c362));delete _0x34c362[_0x6432('0x2a')];if(_0x167a60===0x191){_0x167a60=0x190;}_0x7e0274[_0x6432('0x1c')](_0x167a60)[_0x6432('0x84')](_0x3a237b['query'][_0x6432('0x80')]?{'message':'Wrong\x20credentials','statusCode':_0x34c362[_0x6432('0x81')]}:_0x34c362);});}; \ No newline at end of file +var _0x8ec4=['clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','zoho.eu','com','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','message','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','push','display_label','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','find','create','body','catch','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','channel','Descriptions','ZohoField','Subjects','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x8ec4,0x186));var _0x48ec=function(_0x232a7a,_0x50516e){_0x232a7a=_0x232a7a-0x0;var _0x5f090a=_0x8ec4[_0x232a7a];return _0x5f090a;};'use strict';var emlformat=require(_0x48ec('0x0'));var rimraf=require(_0x48ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x48ec('0x2'));var BPromise=require(_0x48ec('0x3'));var Mustache=require(_0x48ec('0x4'));var util=require(_0x48ec('0x5'));var path=require(_0x48ec('0x6'));var sox=require('sox');var csv=require(_0x48ec('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48ec('0x8'));var squel=require(_0x48ec('0x9'));var crypto=require('crypto');var jsforce=require(_0x48ec('0xa'));var deskjs=require(_0x48ec('0xb'));var toCsv=require(_0x48ec('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x48ec('0xc'));var authService=require(_0x48ec('0xd'));var qs=require(_0x48ec('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x48ec('0xf'))(_0x48ec('0x10'));var utils=require(_0x48ec('0x11'));var config=require(_0x48ec('0x12'));var licenseUtil=require(_0x48ec('0x13'));var db=require(_0x48ec('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x472878,_0x5d0786){_0x5d0786=_0x5d0786||0xcc;return function(_0x4d4985){if(_0x4d4985){return _0x472878[_0x48ec('0x15')](_0x5d0786);}return _0x472878[_0x48ec('0x16')](_0x5d0786)[_0x48ec('0x17')]();};}function respondWithResult(_0x17c6e2,_0x2e5d69){_0x2e5d69=_0x2e5d69||0xc8;return function(_0x1bb5f3){if(_0x1bb5f3){return _0x17c6e2[_0x48ec('0x16')](_0x2e5d69)['json'](_0x1bb5f3);}};}function respondWithFilteredResult(_0x1d813f,_0x592cb2){return function(_0x101faa){if(_0x101faa){var _0x59f945=typeof _0x592cb2[_0x48ec('0x18')]==='undefined'&&typeof _0x592cb2[_0x48ec('0x19')]==='undefined';var _0x517117=_0x101faa[_0x48ec('0x1a')];var _0x809158=_0x59f945?0x0:_0x592cb2['offset'];var _0x359310=_0x59f945?_0x101faa[_0x48ec('0x1a')]:_0x592cb2[_0x48ec('0x18')]+_0x592cb2[_0x48ec('0x19')];var _0x582da6;if(_0x359310>=_0x517117){_0x359310=_0x517117;_0x582da6=0xc8;}else{_0x582da6=0xce;}_0x1d813f[_0x48ec('0x16')](_0x582da6);return _0x1d813f[_0x48ec('0x1b')](_0x48ec('0x1c'),_0x809158+'-'+_0x359310+'/'+_0x517117)['json'](_0x101faa);}return null;};}function patchUpdates(_0x18e263){return function(_0x5d120d){try{jsonpatch[_0x48ec('0x1d')](_0x5d120d,_0x18e263,!![]);}catch(_0x327194){return BPromise[_0x48ec('0x1e')](_0x327194);}return _0x5d120d['save']();};}function saveUpdates(_0x4e855f,_0x19ff29){return function(_0x4e6115){if(_0x4e6115){return _0x4e6115[_0x48ec('0x1f')](_0x4e855f)['then'](function(_0x1bd007){return _0x1bd007;});}return null;};}function removeEntity(_0x190e7e,_0x30e08a){return function(_0x226295){if(_0x226295){return _0x226295[_0x48ec('0x20')]()[_0x48ec('0x21')](function(){_0x190e7e[_0x48ec('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x504787,_0x52b9a6){return function(_0x2a82db){if(!_0x2a82db){_0x504787[_0x48ec('0x15')](0x194);}return _0x2a82db;};}function handleError(_0xb9ae51,_0x3ddd61){_0x3ddd61=_0x3ddd61||0x1f4;return function(_0x45d9ff){logger[_0x48ec('0x22')](_0x45d9ff[_0x48ec('0x23')]);if(_0x45d9ff[_0x48ec('0x24')]){delete _0x45d9ff[_0x48ec('0x24')];}_0xb9ae51[_0x48ec('0x16')](_0x3ddd61)[_0x48ec('0x25')](_0x45d9ff);};}exports['index']=function(_0xcb16fa,_0x1ec204){var _0x13c835={},_0x1afc05={},_0x3aa8ea={'count':0x0,'rows':[]};var _0x391e13=_[_0x48ec('0x26')](db[_0x48ec('0x27')][_0x48ec('0x28')],function(_0x7012ae){return{'name':_0x7012ae[_0x48ec('0x29')],'type':_0x7012ae[_0x48ec('0x2a')][_0x48ec('0x2b')]};});_0x1afc05[_0x48ec('0x2c')]=_[_0x48ec('0x26')](_0x391e13,'name');_0x1afc05[_0x48ec('0x2d')]=_[_0x48ec('0x2e')](_0xcb16fa['query']);_0x1afc05[_0x48ec('0x2f')]=_[_0x48ec('0x30')](_0x1afc05[_0x48ec('0x2c')],_0x1afc05[_0x48ec('0x2d')]);_0x13c835[_0x48ec('0x31')]=_[_0x48ec('0x30')](_0x1afc05[_0x48ec('0x2c')],qs[_0x48ec('0x32')](_0xcb16fa['query']['fields']));_0x13c835[_0x48ec('0x31')]=_0x13c835[_0x48ec('0x31')][_0x48ec('0x33')]?_0x13c835[_0x48ec('0x31')]:_0x1afc05[_0x48ec('0x2c')];if(!_0xcb16fa[_0x48ec('0x2d')][_0x48ec('0x34')]('nolimit')){_0x13c835[_0x48ec('0x19')]=qs[_0x48ec('0x19')](_0xcb16fa[_0x48ec('0x2d')][_0x48ec('0x19')]);_0x13c835[_0x48ec('0x18')]=qs['offset'](_0xcb16fa[_0x48ec('0x2d')][_0x48ec('0x18')]);}_0x13c835[_0x48ec('0x35')]=qs[_0x48ec('0x36')](_0xcb16fa['query']['sort']);_0x13c835[_0x48ec('0x37')]=qs['filters'](_[_0x48ec('0x38')](_0xcb16fa[_0x48ec('0x2d')],_0x1afc05[_0x48ec('0x2f')]),_0x391e13);if(_0xcb16fa['query'][_0x48ec('0x39')]){_0x13c835[_0x48ec('0x37')]=_[_0x48ec('0x3a')](_0x13c835[_0x48ec('0x37')],{'$or':_[_0x48ec('0x26')](_0x391e13,function(_0x45966c){if(_0x45966c[_0x48ec('0x2a')]!==_0x48ec('0x3b')){var _0x41a12e={};_0x41a12e[_0x45966c[_0x48ec('0x24')]]={'$like':'%'+_0xcb16fa[_0x48ec('0x2d')][_0x48ec('0x39')]+'%'};return _0x41a12e;}})});}_0x13c835=_[_0x48ec('0x3a')]({},_0x13c835,_0xcb16fa[_0x48ec('0x3c')]);var _0x4650f9={'where':_0x13c835[_0x48ec('0x37')]};return db[_0x48ec('0x27')][_0x48ec('0x1a')](_0x4650f9)[_0x48ec('0x21')](function(_0x2f3960){_0x3aa8ea[_0x48ec('0x1a')]=_0x2f3960;if(_0xcb16fa[_0x48ec('0x2d')][_0x48ec('0x3d')]){_0x13c835[_0x48ec('0x3e')]=[{'all':!![]}];}return db[_0x48ec('0x27')]['findAll'](_0x13c835);})[_0x48ec('0x21')](function(_0x4cdf99){_0x3aa8ea[_0x48ec('0x3f')]=_0x4cdf99;return _0x3aa8ea;})[_0x48ec('0x21')](respondWithFilteredResult(_0x1ec204,_0x13c835))['catch'](handleError(_0x1ec204,null));};exports['show']=function(_0x50eb5f,_0x428ed4){var _0x25476e={'raw':![],'where':{'id':_0x50eb5f[_0x48ec('0x40')]['id']}},_0x5c477d={};_0x5c477d[_0x48ec('0x2c')]=_[_0x48ec('0x2e')](db[_0x48ec('0x27')][_0x48ec('0x28')]);_0x5c477d['query']=_[_0x48ec('0x2e')](_0x50eb5f[_0x48ec('0x2d')]);_0x5c477d[_0x48ec('0x2f')]=_[_0x48ec('0x30')](_0x5c477d[_0x48ec('0x2c')],_0x5c477d[_0x48ec('0x2d')]);_0x25476e[_0x48ec('0x31')]=_[_0x48ec('0x30')](_0x5c477d['model'],qs['fields'](_0x50eb5f['query']['fields']));_0x25476e[_0x48ec('0x31')]=_0x25476e['attributes'][_0x48ec('0x33')]?_0x25476e[_0x48ec('0x31')]:_0x5c477d[_0x48ec('0x2c')];if(_0x50eb5f[_0x48ec('0x2d')][_0x48ec('0x3d')]){_0x25476e[_0x48ec('0x3e')]=[{'all':!![]}];}_0x25476e=_[_0x48ec('0x3a')]({},_0x25476e,_0x50eb5f[_0x48ec('0x3c')]);return db[_0x48ec('0x27')][_0x48ec('0x41')](_0x25476e)[_0x48ec('0x21')](handleEntityNotFound(_0x428ed4,null))['then'](respondWithResult(_0x428ed4,null))['catch'](handleError(_0x428ed4,null));};exports['create']=function(_0x523bd2,_0x37c9c0){return db['ZohoAccount'][_0x48ec('0x42')](_0x523bd2['body'],{})[_0x48ec('0x21')](respondWithResult(_0x37c9c0,0xc9))['catch'](handleError(_0x37c9c0,null));};exports[_0x48ec('0x1f')]=function(_0xa3ea02,_0x3a6749){if(_0xa3ea02['body']['id']){delete _0xa3ea02[_0x48ec('0x43')]['id'];}return db[_0x48ec('0x27')][_0x48ec('0x41')]({'where':{'id':_0xa3ea02[_0x48ec('0x40')]['id']}})[_0x48ec('0x21')](handleEntityNotFound(_0x3a6749,null))[_0x48ec('0x21')](saveUpdates(_0xa3ea02[_0x48ec('0x43')],null))[_0x48ec('0x21')](respondWithResult(_0x3a6749,null))[_0x48ec('0x44')](handleError(_0x3a6749,null));};exports[_0x48ec('0x20')]=function(_0x1dc32e,_0x27a64e){return db[_0x48ec('0x27')][_0x48ec('0x41')]({'where':{'id':_0x1dc32e[_0x48ec('0x40')]['id']}})[_0x48ec('0x21')](handleEntityNotFound(_0x27a64e,null))[_0x48ec('0x21')](removeEntity(_0x27a64e,null))[_0x48ec('0x44')](handleError(_0x27a64e,null));};exports['getConfigurations']=function(_0x4f2199,_0x28d607,_0x772521){var _0x1e3912={};var _0x4578bf={};var _0x59487e;var _0x553458;return db['ZohoAccount'][_0x48ec('0x45')]({'where':{'id':_0x4f2199['params']['id']}})[_0x48ec('0x21')](handleEntityNotFound(_0x28d607,null))['then'](function(_0x435ccc){if(_0x435ccc){_0x59487e=_0x435ccc;_0x4578bf[_0x48ec('0x2c')]=_[_0x48ec('0x2e')](db[_0x48ec('0x46')]['rawAttributes']);_0x4578bf[_0x48ec('0x2d')]=_[_0x48ec('0x2e')](_0x4f2199['query']);_0x4578bf['filters']=_[_0x48ec('0x30')](_0x4578bf['model'],_0x4578bf[_0x48ec('0x2d')]);_0x1e3912[_0x48ec('0x31')]=_['intersection'](_0x4578bf[_0x48ec('0x2c')],qs['fields'](_0x4f2199[_0x48ec('0x2d')][_0x48ec('0x32')]));_0x1e3912[_0x48ec('0x31')]=_0x1e3912[_0x48ec('0x31')][_0x48ec('0x33')]?_0x1e3912[_0x48ec('0x31')]:_0x4578bf[_0x48ec('0x2c')];_0x1e3912[_0x48ec('0x35')]=qs['sort'](_0x4f2199[_0x48ec('0x2d')][_0x48ec('0x36')]);_0x1e3912[_0x48ec('0x37')]=qs[_0x48ec('0x2f')](_[_0x48ec('0x38')](_0x4f2199['query'],_0x4578bf[_0x48ec('0x2f')]));if(_0x4f2199[_0x48ec('0x2d')][_0x48ec('0x39')]){_0x1e3912[_0x48ec('0x37')]=_[_0x48ec('0x3a')](_0x1e3912[_0x48ec('0x37')],{'$or':_[_0x48ec('0x26')](_0x1e3912['attributes'],function(_0x5c0484){var _0x124790={};_0x124790[_0x5c0484]={'$like':'%'+_0x4f2199[_0x48ec('0x2d')][_0x48ec('0x39')]+'%'};return _0x124790;})});}_0x1e3912=_['merge']({},_0x1e3912,_0x4f2199['options']);return _0x59487e[_0x48ec('0x47')](_0x1e3912);}})[_0x48ec('0x21')](function(_0x17de31){if(_0x17de31){_0x553458=_0x17de31[_0x48ec('0x33')];if(!_0x4f2199['query'][_0x48ec('0x34')]('nolimit')){_0x1e3912[_0x48ec('0x19')]=qs[_0x48ec('0x19')](_0x4f2199['query'][_0x48ec('0x19')]);_0x1e3912[_0x48ec('0x18')]=qs['offset'](_0x4f2199['query'][_0x48ec('0x18')]);}return _0x59487e['getConfigurations'](_0x1e3912);}})[_0x48ec('0x21')](function(_0x58a028){if(_0x58a028){return _0x58a028?{'count':_0x553458,'rows':_0x58a028}:null;}})['then'](respondWithResult(_0x28d607,null))[_0x48ec('0x44')](handleError(_0x28d607,null));};exports[_0x48ec('0x48')]=function(_0x595d8d,_0x41e000,_0x596e4d){if(_0x595d8d[_0x48ec('0x43')]['id']){delete _0x595d8d['body']['id'];}return db[_0x48ec('0x27')][_0x48ec('0x45')]({'where':{'id':_0x595d8d[_0x48ec('0x40')]['id']}})[_0x48ec('0x21')](handleEntityNotFound(_0x41e000,null))[_0x48ec('0x21')](function(_0x4e31a0){if(_0x4e31a0){_0x595d8d['body'][_0x48ec('0x49')]=_0x4e31a0['id'];_0x595d8d[_0x48ec('0x43')]['Subjects']=integrations['getSubjects'](_0x595d8d['body'][_0x48ec('0x4a')],_0x595d8d[_0x48ec('0x43')][_0x48ec('0x2a')]);_0x595d8d['body'][_0x48ec('0x4b')]=integrations['getDescriptions'](_0x595d8d['body'][_0x48ec('0x4a')],_0x595d8d['body'][_0x48ec('0x2a')]);return db[_0x48ec('0x46')][_0x48ec('0x42')](_0x595d8d[_0x48ec('0x43')],{'include':[{'model':db[_0x48ec('0x4c')],'as':_0x48ec('0x4d')},{'model':db[_0x48ec('0x4c')],'as':_0x48ec('0x4b')}]});}return null;})['then'](respondWithResult(_0x41e000,null))[_0x48ec('0x44')](handleError(_0x41e000,null));};function getAccessToken(_0xb5d9ab){return new Promise(function(_0x17daf7,_0x32969f){var _0x3c6beb;switch(_0xb5d9ab[_0x48ec('0x4e')]){case'US':_0x3c6beb='https://accounts.zoho.com';break;case'AU':_0x3c6beb='https://accounts.zoho.com.au';break;case'EU':_0x3c6beb=_0x48ec('0x4f');break;case'IN':_0x3c6beb=_0x48ec('0x50');break;case'CN':_0x3c6beb=_0x48ec('0x51');break;default:_0x3c6beb=_0x48ec('0x4f');break;}var _0x532adf={'method':_0x48ec('0x52'),'uri':_0x3c6beb+_0x48ec('0x53'),'qs':{'refresh_token':_0xb5d9ab[_0x48ec('0x54')],'client_id':_0xb5d9ab[_0x48ec('0x55')],'client_secret':_0xb5d9ab[_0x48ec('0x56')],'grant_type':_0x48ec('0x57')},'json':!![]};return rp(_0x532adf)[_0x48ec('0x21')](function(_0x4cd896){if(_0x4cd896['access_token']){_0x17daf7(_0x4cd896[_0x48ec('0x58')]);}else{_0x32969f(_0x48ec('0x59'));}})[_0x48ec('0x44')](function(_0x177aef){_0x32969f(_0x177aef);});});}exports[_0x48ec('0x5a')]=function(_0x1f1b33,_0x576dae,_0x25e26f){var _0x23bd32,_0x31f7f6,_0x108ed1,_0x1f10e8,_0x233126;return db[_0x48ec('0x27')][_0x48ec('0x45')]({'where':{'id':_0x1f1b33['params']['id']},'attributes':['id','host',_0x48ec('0x4e'),_0x48ec('0x55'),_0x48ec('0x56'),_0x48ec('0x5b'),_0x48ec('0x5c'),_0x48ec('0x54')]})['then'](handleEntityNotFound(_0x576dae,null))[_0x48ec('0x21')](function(_0x24f0d0){_0x233126=_0x24f0d0;_0x23bd32=_0x233126[_0x48ec('0x5d')];_0x31f7f6=_0x23bd32===_0x48ec('0x5e')?'eu':_0x48ec('0x5f');_0x108ed1=_0x233126[_0x48ec('0x5b')];var _0x38d649=_0x108ed1['slice'](-0x1);if(_0x38d649==='/'||_0x38d649==='\x5c'||_0x38d649===':'){_0x108ed1=_0x108ed1[_0x48ec('0x60')](0x0,_0x108ed1['lastIndexOf'](_0x38d649));}if(!_0x233126[_0x48ec('0x54')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x233126);})[_0x48ec('0x21')](function(_0x11219a){if(_0x11219a){return rp({'method':_0x48ec('0x61'),'uri':util[_0x48ec('0x62')](_0x48ec('0x63'),_0x31f7f6),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x11219a},'json':!![]});}})[_0x48ec('0x21')](function(_0x2bf47b){if(_0x2bf47b){if(_0x2bf47b[_0x48ec('0x64')]&&_0x2bf47b[_0x48ec('0x64')]['error']){throw new Error(_0x2bf47b[_0x48ec('0x64')]['error'][_0x48ec('0x65')]);}var _0x5af79e=[];var _0x30e3be=[];var _0x216ebf=['Owner',_0x48ec('0x66'),_0x48ec('0x67'),_0x48ec('0x68'),_0x48ec('0x69'),'Call_Result',_0x48ec('0x6a'),_0x48ec('0x6b')];_0x30e3be=_[_0x48ec('0x6c')](_0x2bf47b[_0x48ec('0x32')],function(_0x56065f){return _0x216ebf[_0x48ec('0x6d')](_0x56065f['api_name']);});for(var _0xc24d19=0x0;_0xc24d19<_0x30e3be[_0x48ec('0x33')];_0xc24d19++){if(_0x30e3be[_0xc24d19]['system_mandatory']===![]){_0x5af79e[_0x48ec('0x6e')]({'id':_0x30e3be[_0xc24d19]['id'],'name':_0x30e3be[_0xc24d19][_0x48ec('0x6f')],'custom':_0x30e3be[_0xc24d19]['custom_field'],'options':_0x30e3be[_0xc24d19]['data_type']===_0x48ec('0x70')&&_0x30e3be[_0xc24d19][_0x48ec('0x71')][_0x48ec('0x33')]>-0x1?_[_0x48ec('0x26')](_0x30e3be[_0xc24d19]['pick_list_values'],function(_0x193a06){return{'name':_0x193a06,'value':_0x193a06};}):[]});}}return{'count':_0x5af79e[_0x48ec('0x33')],'rows':_0x5af79e};}else{return{'count':0x0,'rows':[]};}})[_0x48ec('0x21')](respondWithResult(_0x576dae,null))[_0x48ec('0x44')](function(_0x32776a){var _0x3b15ff=_0x1f1b33[_0x48ec('0x2d')][_0x48ec('0x72')]?0x1f4:_0x32776a[_0x48ec('0x73')]||0x1f4;logger[_0x48ec('0x22')](_0x48ec('0x74'),'getFields',_0x3b15ff,JSON[_0x48ec('0x75')](_0x32776a));delete _0x32776a[_0x48ec('0x24')];if(_0x3b15ff===0x191){_0x3b15ff=0x190;}_0x576dae[_0x48ec('0x16')](_0x3b15ff)[_0x48ec('0x25')](_0x1f1b33[_0x48ec('0x2d')][_0x48ec('0x72')]?{'message':_0x48ec('0x76'),'statusCode':_0x32776a[_0x48ec('0x73')]}:_0x32776a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 092a548..1b79b4b 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 _0x2ed6=['https://accounts.zoho.com.au','POST','refreshToken','catch','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','substring'];(function(_0x1a13ae,_0x3d3543){var _0x5eb077=function(_0x2f7b5a){while(--_0x2f7b5a){_0x1a13ae['push'](_0x1a13ae['shift']());}};_0x5eb077(++_0x3d3543);}(_0x2ed6,0x112));var _0x62ed=function(_0x36b8ef,_0x3cb089){_0x36b8ef=_0x36b8ef-0x0;var _0x3e5708=_0x2ed6[_0x36b8ef];return _0x3e5708;};'use strict';var _=require(_0x62ed('0x0'));var util=require(_0x62ed('0x1'));var logger=require(_0x62ed('0x2'))(_0x62ed('0x3'));var moment=require(_0x62ed('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x62ed('0x5'));var rimraf=require(_0x62ed('0x6'));var config=require(_0x62ed('0x7'));var attributes=require(_0x62ed('0x8'));var integrations=require(_0x62ed('0x9'));module[_0x62ed('0xa')]=function(_0x4b94f9,_0x5ca4d4){return _0x4b94f9[_0x62ed('0xb')](_0x62ed('0xc'),attributes,{'tableName':_0x62ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6567b8,_0x5e50f8,_0x138dbd){if(_0x6567b8['changed'](_0x62ed('0xe'))||_0x6567b8[_0x62ed('0xf')](_0x62ed('0x10'))||_0x6567b8[_0x62ed('0xf')]('clientId')||_0x6567b8[_0x62ed('0xf')](_0x62ed('0x11'))||_0x6567b8[_0x62ed('0xf')](_0x62ed('0x12'))||_0x6567b8['changed'](_0x62ed('0x13'))){var _0x3754cc,_0x5b7ce4;_0x3754cc=_0x6567b8[_0x62ed('0x10')];var _0x684849=_0x3754cc['slice'](-0x1);if(_0x684849==='/'||_0x684849==='\x5c'||_0x684849===':'){_0x3754cc=_0x3754cc['substring'](0x0,_0x3754cc[_0x62ed('0x14')](_0x684849));}switch(_0x6567b8[_0x62ed('0xe')]){case'US':_0x5b7ce4=_0x62ed('0x15');break;case'AU':_0x5b7ce4='https://accounts.zoho.com.au';break;case'IN':_0x5b7ce4=_0x62ed('0x16');break;case'CN':_0x5b7ce4=_0x62ed('0x17');break;default:_0x5b7ce4=_0x62ed('0x18');break;}var _0x589b56={'method':'POST','uri':_0x5b7ce4+_0x62ed('0x19'),'form':{'grant_type':_0x62ed('0x1a'),'client_id':_0x6567b8[_0x62ed('0x1b')],'client_secret':_0x6567b8[_0x62ed('0x11')],'redirect_uri':_0x6567b8[_0x62ed('0x10')],'code':_0x6567b8[_0x62ed('0x12')]},'headers':{'Content-Type':_0x62ed('0x1c')}};return rp(_0x589b56)[_0x62ed('0x1d')](function(_0x5b44b7){var _0x272511=JSON[_0x62ed('0x1e')](_0x5b44b7);if(_0x272511[_0x62ed('0x1f')]){_0x6567b8['refreshToken']=_0x272511[_0x62ed('0x1f')];logger[_0x62ed('0x20')](util[_0x62ed('0x21')](_0x62ed('0x22'),_0x6567b8[_0x62ed('0x23')],_0x6567b8['id']));}else{logger[_0x62ed('0x24')](util[_0x62ed('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x6567b8['name'],_0x6567b8['id']),util[_0x62ed('0x25')](_0x272511,{'showHidden':![],'depth':null}));}return _0x138dbd(null,_0x5e50f8);})['catch'](function(_0x52f055){logger[_0x62ed('0x24')](util[_0x62ed('0x21')](_0x62ed('0x26'),_0x6567b8[_0x62ed('0x23')],_0x6567b8['id']),util[_0x62ed('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x138dbd(_0x52f055);});}else{return _0x138dbd(null,_0x5e50f8);}},'beforeUpdate':function(_0x4abf62,_0xae767f,_0xbdc7a3){if(_0x4abf62[_0x62ed('0xf')]('zone')||_0x4abf62[_0x62ed('0xf')](_0x62ed('0x10'))||_0x4abf62['changed']('clientId')||_0x4abf62[_0x62ed('0xf')](_0x62ed('0x11'))||_0x4abf62[_0x62ed('0xf')](_0x62ed('0x12'))||_0x4abf62[_0x62ed('0xf')](_0x62ed('0x13'))){var _0x10b801,_0xb245ef;_0x10b801=_0x4abf62[_0x62ed('0x10')];var _0x49a0db=_0x10b801[_0x62ed('0x27')](-0x1);if(_0x49a0db==='/'||_0x49a0db==='\x5c'||_0x49a0db===':'){_0x10b801=_0x10b801[_0x62ed('0x28')](0x0,_0x10b801['lastIndexOf'](_0x49a0db));}switch(_0x4abf62[_0x62ed('0xe')]){case'US':_0xb245ef=_0x62ed('0x15');break;case'AU':_0xb245ef=_0x62ed('0x29');break;case'IN':_0xb245ef=_0x62ed('0x16');break;case'CN':_0xb245ef=_0x62ed('0x17');break;default:_0xb245ef=_0x62ed('0x18');break;}var _0x56b89a={'method':_0x62ed('0x2a'),'uri':_0xb245ef+_0x62ed('0x19'),'form':{'grant_type':_0x62ed('0x1a'),'client_id':_0x4abf62[_0x62ed('0x1b')],'client_secret':_0x4abf62[_0x62ed('0x11')],'redirect_uri':_0x4abf62[_0x62ed('0x10')],'code':_0x4abf62[_0x62ed('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x56b89a)[_0x62ed('0x1d')](function(_0x5060ec){var _0x3cf118=JSON['parse'](_0x5060ec);if(_0x3cf118['refresh_token']){_0x4abf62[_0x62ed('0x2b')]=_0x3cf118[_0x62ed('0x1f')];logger[_0x62ed('0x20')](util['format'](_0x62ed('0x22'),_0x4abf62[_0x62ed('0x23')],_0x4abf62['id']));}else{logger['error'](util[_0x62ed('0x21')](_0x62ed('0x26'),_0x4abf62['name'],_0x4abf62['id']),util['inspect'](_0x3cf118,{'showHidden':![],'depth':null}));}return _0xbdc7a3(null,_0xae767f);})[_0x62ed('0x2c')](function(_0x1d414){logger[_0x62ed('0x24')](util[_0x62ed('0x21')](_0x62ed('0x26'),_0x4abf62['name'],_0x4abf62['id']),util[_0x62ed('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0xbdc7a3(_0x1d414);});}else{return _0xbdc7a3(null,_0xae767f);}}}});}; \ No newline at end of file +var _0x017c=['../../config/environment','exports','define','ZohoAccount','int_zoho_accounts','changed','code','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','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','error','zone','clientSecret','https://accounts.zoho.in','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a6772,_0x6c05d0){var _0x21a255=function(_0x189c41){while(--_0x189c41){_0x3a6772['push'](_0x3a6772['shift']());}};_0x21a255(++_0x6c05d0);}(_0x017c,0x151));var _0xc017=function(_0x124da8,_0x2f4adf){_0x124da8=_0x124da8-0x0;var _0x470b89=_0x017c[_0x124da8];return _0x470b89;};'use strict';var _=require(_0xc017('0x0'));var util=require(_0xc017('0x1'));var logger=require(_0xc017('0x2'))(_0xc017('0x3'));var moment=require(_0xc017('0x4'));var BPromise=require(_0xc017('0x5'));var rp=require(_0xc017('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc017('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xc017('0x8')]=function(_0x47e6bc,_0x2f86c5){return _0x47e6bc[_0xc017('0x9')](_0xc017('0xa'),attributes,{'tableName':_0xc017('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x24a545,_0x35b9c6,_0x5a7f3d){if(_0x24a545[_0xc017('0xc')]('zone')||_0x24a545[_0xc017('0xc')]('serverUrl')||_0x24a545[_0xc017('0xc')]('clientId')||_0x24a545[_0xc017('0xc')]('clientSecret')||_0x24a545[_0xc017('0xc')](_0xc017('0xd'))||_0x24a545[_0xc017('0xc')](_0xc017('0xe'))){var _0x140a39,_0x48dcfc;_0x140a39=_0x24a545[_0xc017('0xf')];var _0xbcad1b=_0x140a39[_0xc017('0x10')](-0x1);if(_0xbcad1b==='/'||_0xbcad1b==='\x5c'||_0xbcad1b===':'){_0x140a39=_0x140a39[_0xc017('0x11')](0x0,_0x140a39[_0xc017('0x12')](_0xbcad1b));}switch(_0x24a545['zone']){case'US':_0x48dcfc=_0xc017('0x13');break;case'AU':_0x48dcfc=_0xc017('0x14');break;case'IN':_0x48dcfc='https://accounts.zoho.in';break;case'CN':_0x48dcfc=_0xc017('0x15');break;default:_0x48dcfc=_0xc017('0x16');break;}var _0x373413={'method':_0xc017('0x17'),'uri':_0x48dcfc+_0xc017('0x18'),'form':{'grant_type':_0xc017('0x19'),'client_id':_0x24a545[_0xc017('0x1a')],'client_secret':_0x24a545['clientSecret'],'redirect_uri':_0x24a545[_0xc017('0xf')],'code':_0x24a545[_0xc017('0xd')]},'headers':{'Content-Type':_0xc017('0x1b')}};return rp(_0x373413)[_0xc017('0x1c')](function(_0x389867){var _0x44e069=JSON[_0xc017('0x1d')](_0x389867);if(_0x44e069[_0xc017('0x1e')]){_0x24a545[_0xc017('0x1f')]=_0x44e069[_0xc017('0x1e')];logger[_0xc017('0x20')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x24a545['name'],_0x24a545['id']));}else{logger['error'](util[_0xc017('0x21')](_0xc017('0x22'),_0x24a545[_0xc017('0x23')],_0x24a545['id']),util[_0xc017('0x24')](_0x44e069,{'showHidden':![],'depth':null}));}return _0x5a7f3d(null,_0x35b9c6);})['catch'](function(_0x18516f){logger[_0xc017('0x25')](util[_0xc017('0x21')](_0xc017('0x22'),_0x24a545['name'],_0x24a545['id']),util[_0xc017('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x5a7f3d(_0x18516f);});}else{return _0x5a7f3d(null,_0x35b9c6);}},'beforeUpdate':function(_0x41abbb,_0x2fdff1,_0x5de2d6){if(_0x41abbb['changed'](_0xc017('0x26'))||_0x41abbb[_0xc017('0xc')]('serverUrl')||_0x41abbb[_0xc017('0xc')](_0xc017('0x1a'))||_0x41abbb[_0xc017('0xc')](_0xc017('0x27'))||_0x41abbb[_0xc017('0xc')](_0xc017('0xd'))||_0x41abbb[_0xc017('0xc')]('host')){var _0x16e6fb,_0x312f0f;_0x16e6fb=_0x41abbb[_0xc017('0xf')];var _0x45a104=_0x16e6fb[_0xc017('0x10')](-0x1);if(_0x45a104==='/'||_0x45a104==='\x5c'||_0x45a104===':'){_0x16e6fb=_0x16e6fb[_0xc017('0x11')](0x0,_0x16e6fb[_0xc017('0x12')](_0x45a104));}switch(_0x41abbb[_0xc017('0x26')]){case'US':_0x312f0f=_0xc017('0x13');break;case'AU':_0x312f0f=_0xc017('0x14');break;case'IN':_0x312f0f=_0xc017('0x28');break;case'CN':_0x312f0f='https://accounts.zoho.com.cn';break;default:_0x312f0f=_0xc017('0x16');break;}var _0x3747c6={'method':_0xc017('0x17'),'uri':_0x312f0f+_0xc017('0x18'),'form':{'grant_type':_0xc017('0x19'),'client_id':_0x41abbb['clientId'],'client_secret':_0x41abbb['clientSecret'],'redirect_uri':_0x41abbb[_0xc017('0xf')],'code':_0x41abbb[_0xc017('0xd')]},'headers':{'Content-Type':_0xc017('0x1b')}};return rp(_0x3747c6)[_0xc017('0x1c')](function(_0x3db484){var _0x23d375=JSON[_0xc017('0x1d')](_0x3db484);if(_0x23d375[_0xc017('0x1e')]){_0x41abbb[_0xc017('0x1f')]=_0x23d375[_0xc017('0x1e')];logger[_0xc017('0x20')](util['format'](_0xc017('0x29'),_0x41abbb[_0xc017('0x23')],_0x41abbb['id']));}else{logger[_0xc017('0x25')](util[_0xc017('0x21')](_0xc017('0x22'),_0x41abbb['name'],_0x41abbb['id']),util[_0xc017('0x24')](_0x23d375,{'showHidden':![],'depth':null}));}return _0x5de2d6(null,_0x2fdff1);})[_0xc017('0x2a')](function(_0x5cf4a9){logger['error'](util[_0xc017('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x41abbb[_0xc017('0x23')],_0x41abbb['id']),util[_0xc017('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x5de2d6(_0x5cf4a9);});}else{return _0x5de2d6(null,_0x2fdff1);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 76abb0c..2030bce 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 _0x0a1c=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','map','include','model','attributes','stringify','catch','ShowZohoAccount'];(function(_0x396714,_0x4bb554){var _0x514af5=function(_0x1df3b5){while(--_0x1df3b5){_0x396714['push'](_0x396714['shift']());}};_0x514af5(++_0x4bb554);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x0a1c[_0x296897];return _0x2b44ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc0a1('0x0'));var BPromise=require(_0xc0a1('0x1'));var rs=require(_0xc0a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc0a1('0x3'));var logger=require(_0xc0a1('0x4'))(_0xc0a1('0x5'));var config=require(_0xc0a1('0x6'));var jayson=require(_0xc0a1('0x7'));var client=jayson[_0xc0a1('0x8')][_0xc0a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22405c,_0x1712cd,_0x43d318){return new BPromise(function(_0x43623a,_0x42c215){return client[_0xc0a1('0xa')](_0x22405c,_0x43d318)[_0xc0a1('0xb')](function(_0x38ed7b){logger[_0xc0a1('0xc')](_0xc0a1('0xd'),_0x1712cd,'request\x20sent');logger[_0xc0a1('0xe')](_0xc0a1('0xf'),_0x1712cd,_0xc0a1('0x10'),JSON['stringify'](_0x38ed7b));if(_0x38ed7b[_0xc0a1('0x11')]){if(_0x38ed7b[_0xc0a1('0x11')][_0xc0a1('0x12')]===0x1f4){logger['error'](_0xc0a1('0xd'),_0x1712cd,_0x38ed7b[_0xc0a1('0x11')]['message']);return _0x42c215(_0x38ed7b[_0xc0a1('0x11')][_0xc0a1('0x13')]);}logger[_0xc0a1('0x11')](_0xc0a1('0xd'),_0x1712cd,_0x38ed7b[_0xc0a1('0x11')]['message']);return _0x43623a(_0x38ed7b['error'][_0xc0a1('0x13')]);}else{logger[_0xc0a1('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x1712cd,'request\x20sent');_0x43623a(_0x38ed7b[_0xc0a1('0x14')][_0xc0a1('0x13')]);}})['catch'](function(_0x334cc4){logger[_0xc0a1('0x11')](_0xc0a1('0xd'),_0x1712cd,_0x334cc4);_0x42c215(_0x334cc4);});});}exports[_0xc0a1('0x15')]=function(_0x234067){var _0x124d0f=this;return new Promise(function(_0x36620e,_0x16755f){return db[_0xc0a1('0x16')][_0xc0a1('0x17')]({'raw':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')][_0xc0a1('0x19')]===undefined?!![]:![]:!![],'where':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')][_0xc0a1('0x1a')]||null:null,'attributes':_0x234067['options']?_0x234067[_0xc0a1('0x18')]['attributes']||null:null,'limit':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')][_0xc0a1('0x1b')]||null:null,'include':_0x234067[_0xc0a1('0x18')]?_0x234067[_0xc0a1('0x18')]['include']?_[_0xc0a1('0x1c')](_0x234067[_0xc0a1('0x18')][_0xc0a1('0x1d')],function(_0x3e7997){return{'model':db[_0x3e7997[_0xc0a1('0x1e')]],'as':_0x3e7997['as'],'attributes':_0x3e7997[_0xc0a1('0x1f')],'include':_0x3e7997[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x3e7997[_0xc0a1('0x1d')],function(_0x161bff){return{'model':db[_0x161bff['model']],'as':_0x161bff['as'],'attributes':_0x161bff['attributes'],'include':_0x161bff[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x161bff['include'],function(_0x52ba51){return{'model':db[_0x52ba51[_0xc0a1('0x1e')]],'as':_0x52ba51['as'],'attributes':_0x52ba51[_0xc0a1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x203ab8){logger[_0xc0a1('0xc')](_0xc0a1('0x15'),_0x234067);logger[_0xc0a1('0xe')](_0xc0a1('0x15'),_0x234067,JSON[_0xc0a1('0x20')](_0x203ab8));_0x36620e(_0x203ab8);})[_0xc0a1('0x21')](function(_0x2bc99f){logger['error'](_0xc0a1('0x15'),_0x2bc99f[_0xc0a1('0x13')],_0x234067);_0x16755f(_0x124d0f[_0xc0a1('0x11')](0x1f4,_0x2bc99f[_0xc0a1('0x13')]));});});};exports[_0xc0a1('0x22')]=function(_0x38750d){var _0x4bc7fc=this;return new Promise(function(_0x5741a6,_0x3bf70f){return db[_0xc0a1('0x16')]['find']({'raw':_0x38750d[_0xc0a1('0x18')]?_0x38750d['options'][_0xc0a1('0x19')]===undefined?!![]:![]:!![],'where':_0x38750d['options']?_0x38750d[_0xc0a1('0x18')][_0xc0a1('0x1a')]||null:null,'attributes':_0x38750d[_0xc0a1('0x18')]?_0x38750d['options'][_0xc0a1('0x1f')]||null:null,'include':_0x38750d['options']?_0x38750d[_0xc0a1('0x18')][_0xc0a1('0x1d')]?_['map'](_0x38750d[_0xc0a1('0x18')][_0xc0a1('0x1d')],function(_0x3ea952){return{'model':db[_0x3ea952[_0xc0a1('0x1e')]],'as':_0x3ea952['as'],'attributes':_0x3ea952[_0xc0a1('0x1f')],'include':_0x3ea952[_0xc0a1('0x1d')]?_['map'](_0x3ea952[_0xc0a1('0x1d')],function(_0x402479){return{'model':db[_0x402479[_0xc0a1('0x1e')]],'as':_0x402479['as'],'attributes':_0x402479[_0xc0a1('0x1f')],'include':_0x402479[_0xc0a1('0x1d')]?_[_0xc0a1('0x1c')](_0x402479['include'],function(_0x5e1ac6){return{'model':db[_0x5e1ac6[_0xc0a1('0x1e')]],'as':_0x5e1ac6['as'],'attributes':_0x5e1ac6[_0xc0a1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0a1('0xb')](function(_0x4796a8){logger['info'](_0xc0a1('0x22'),_0x38750d);logger[_0xc0a1('0xe')](_0xc0a1('0x22'),_0x38750d,JSON['stringify'](_0x4796a8));_0x5741a6(_0x4796a8);})[_0xc0a1('0x21')](function(_0x423da0){logger['error'](_0xc0a1('0x22'),_0x423da0[_0xc0a1('0x13')],_0x38750d);_0x3bf70f(_0x4bc7fc['error'](0x1f4,_0x423da0[_0xc0a1('0x13')]));});});}; \ No newline at end of file +var _0xd070=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','raw','options','limit','include','model','map','attributes','GetZohoAccount','ShowZohoAccount','ZohoAccount','find','lodash','moment'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0xd070,0x8e));var _0x0d07=function(_0x36ed77,_0x100474){_0x36ed77=_0x36ed77-0x0;var _0x43c0cc=_0xd070[_0x36ed77];return _0x43c0cc;};'use strict';var _=require(_0x0d07('0x0'));var util=require('util');var moment=require(_0x0d07('0x1'));var BPromise=require(_0x0d07('0x2'));var rs=require(_0x0d07('0x3'));var fs=require('fs');var Redis=require(_0x0d07('0x4'));var db=require(_0x0d07('0x5'))['db'];var utils=require(_0x0d07('0x6'));var logger=require(_0x0d07('0x7'))(_0x0d07('0x8'));var config=require(_0x0d07('0x9'));var jayson=require(_0x0d07('0xa'));var client=jayson[_0x0d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13d75a,_0x5a4366,_0x20fd56){return new BPromise(function(_0x8c16d8,_0x1f989e){return client[_0x0d07('0xc')](_0x13d75a,_0x20fd56)[_0x0d07('0xd')](function(_0xc5b04d){logger[_0x0d07('0xe')](_0x0d07('0xf'),_0x5a4366,_0x0d07('0x10'));logger[_0x0d07('0x11')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5a4366,'request\x20sent',JSON[_0x0d07('0x12')](_0xc5b04d));if(_0xc5b04d[_0x0d07('0x13')]){if(_0xc5b04d['error'][_0x0d07('0x14')]===0x1f4){logger['error'](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')]['message']);return _0x1f989e(_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);}logger[_0x0d07('0x13')](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);return _0x8c16d8(_0xc5b04d['error'][_0x0d07('0x15')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x5a4366,_0x0d07('0x10'));_0x8c16d8(_0xc5b04d[_0x0d07('0x16')][_0x0d07('0x15')]);}})[_0x0d07('0x17')](function(_0x220203){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5a4366,_0x220203);_0x1f989e(_0x220203);});});}exports['GetZohoAccount']=function(_0x187df2){var _0x312015=this;return new Promise(function(_0x52cb4b,_0x410ad2){return db['ZohoAccount'][_0x0d07('0x18')]({'raw':_0x187df2['options']?_0x187df2['options'][_0x0d07('0x19')]===undefined?!![]:![]:!![],'where':_0x187df2['options']?_0x187df2[_0x0d07('0x1a')]['where']||null:null,'attributes':_0x187df2[_0x0d07('0x1a')]?_0x187df2['options']['attributes']||null:null,'limit':_0x187df2[_0x0d07('0x1a')]?_0x187df2[_0x0d07('0x1a')][_0x0d07('0x1b')]||null:null,'include':_0x187df2['options']?_0x187df2[_0x0d07('0x1a')]['include']?_['map'](_0x187df2[_0x0d07('0x1a')][_0x0d07('0x1c')],function(_0xd42245){return{'model':db[_0xd42245[_0x0d07('0x1d')]],'as':_0xd42245['as'],'attributes':_0xd42245['attributes'],'include':_0xd42245['include']?_[_0x0d07('0x1e')](_0xd42245['include'],function(_0x43c7ac){return{'model':db[_0x43c7ac[_0x0d07('0x1d')]],'as':_0x43c7ac['as'],'attributes':_0x43c7ac['attributes'],'include':_0x43c7ac[_0x0d07('0x1c')]?_['map'](_0x43c7ac['include'],function(_0x5da34f){return{'model':db[_0x5da34f[_0x0d07('0x1d')]],'as':_0x5da34f['as'],'attributes':_0x5da34f[_0x0d07('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0d07('0xd')](function(_0x25633b){logger[_0x0d07('0xe')](_0x0d07('0x20'),_0x187df2);logger[_0x0d07('0x11')](_0x0d07('0x20'),_0x187df2,JSON['stringify'](_0x25633b));_0x52cb4b(_0x25633b);})['catch'](function(_0x282468){logger[_0x0d07('0x13')](_0x0d07('0x20'),_0x282468[_0x0d07('0x15')],_0x187df2);_0x410ad2(_0x312015[_0x0d07('0x13')](0x1f4,_0x282468[_0x0d07('0x15')]));});});};exports[_0x0d07('0x21')]=function(_0x314916){var _0x240dc0=this;return new Promise(function(_0xa0c281,_0x3d0663){return db[_0x0d07('0x22')][_0x0d07('0x23')]({'raw':_0x314916[_0x0d07('0x1a')]?_0x314916[_0x0d07('0x1a')][_0x0d07('0x19')]===undefined?!![]:![]:!![],'where':_0x314916[_0x0d07('0x1a')]?_0x314916[_0x0d07('0x1a')]['where']||null:null,'attributes':_0x314916['options']?_0x314916['options'][_0x0d07('0x1f')]||null:null,'include':_0x314916[_0x0d07('0x1a')]?_0x314916['options'][_0x0d07('0x1c')]?_[_0x0d07('0x1e')](_0x314916[_0x0d07('0x1a')][_0x0d07('0x1c')],function(_0x5e847a){return{'model':db[_0x5e847a[_0x0d07('0x1d')]],'as':_0x5e847a['as'],'attributes':_0x5e847a['attributes'],'include':_0x5e847a[_0x0d07('0x1c')]?_['map'](_0x5e847a['include'],function(_0x63f32c){return{'model':db[_0x63f32c['model']],'as':_0x63f32c['as'],'attributes':_0x63f32c['attributes'],'include':_0x63f32c[_0x0d07('0x1c')]?_[_0x0d07('0x1e')](_0x63f32c[_0x0d07('0x1c')],function(_0x3b6af9){return{'model':db[_0x3b6af9[_0x0d07('0x1d')]],'as':_0x3b6af9['as'],'attributes':_0x3b6af9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5547bb){logger[_0x0d07('0xe')](_0x0d07('0x21'),_0x314916);logger[_0x0d07('0x11')](_0x0d07('0x21'),_0x314916,JSON[_0x0d07('0x12')](_0x5547bb));_0xa0c281(_0x5547bb);})[_0x0d07('0x17')](function(_0x3ab9d6){logger[_0x0d07('0x13')](_0x0d07('0x21'),_0x3ab9d6['message'],_0x314916);_0x3d0663(_0x240dc0['error'](0x1f4,_0x3ab9d6[_0x0d07('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9eb3634..f524b73 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 _0x3fa1=['/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','index'];(function(_0x2e914,_0x1c7566){var _0x936e45=function(_0x1b22e4){while(--_0x1b22e4){_0x2e914['push'](_0x2e914['shift']());}};_0x936e45(++_0x1c7566);}(_0x3fa1,0xb7));var _0x13fa=function(_0x38374b,_0x32b2c1){_0x38374b=_0x38374b-0x0;var _0xc59a95=_0x3fa1[_0x38374b];return _0xc59a95;};'use strict';var multer=require(_0x13fa('0x0'));var util=require(_0x13fa('0x1'));var path=require(_0x13fa('0x2'));var timeout=require('connect-timeout');var express=require(_0x13fa('0x3'));var router=express['Router']();var fs_extra=require(_0x13fa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x13fa('0x5'));var config=require('../../config/environment');var controller=require(_0x13fa('0x6'));router[_0x13fa('0x7')]('/',auth['isAuthenticated'](),controller[_0x13fa('0x8')]);router[_0x13fa('0x7')](_0x13fa('0x9'),auth[_0x13fa('0xa')](),controller[_0x13fa('0xb')]);router[_0x13fa('0x7')](_0x13fa('0xc'),auth[_0x13fa('0xa')](),controller[_0x13fa('0xd')]);router[_0x13fa('0x7')](_0x13fa('0xe'),auth[_0x13fa('0xa')](),controller[_0x13fa('0xf')]);router[_0x13fa('0x7')](_0x13fa('0x10'),auth['isAuthenticated'](),controller[_0x13fa('0x11')]);router[_0x13fa('0x12')]('/',auth[_0x13fa('0xa')](),controller['create']);router[_0x13fa('0x13')]('/:id',auth[_0x13fa('0xa')](),controller[_0x13fa('0x14')]);router[_0x13fa('0x15')](_0x13fa('0x9'),auth[_0x13fa('0xa')](),controller[_0x13fa('0x16')]);module[_0x13fa('0x17')]=router; \ No newline at end of file +var _0x2c0a=['../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14074b,_0x527cb9){var _0x508226=function(_0x31c5c1){while(--_0x31c5c1){_0x14074b['push'](_0x14074b['shift']());}};_0x508226(++_0x527cb9);}(_0x2c0a,0xd5));var _0xa2c0=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x2c0a[_0x152121];return _0x592a85;};'use strict';var multer=require(_0xa2c0('0x0'));var util=require(_0xa2c0('0x1'));var path=require(_0xa2c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa2c0('0x3'));var router=express[_0xa2c0('0x4')]();var fs_extra=require(_0xa2c0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa2c0('0x6'));var config=require(_0xa2c0('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xa2c0('0x8')]('/',auth['isAuthenticated'](),controller[_0xa2c0('0x9')]);router[_0xa2c0('0x8')](_0xa2c0('0xa'),auth[_0xa2c0('0xb')](),controller[_0xa2c0('0xc')]);router[_0xa2c0('0x8')](_0xa2c0('0xd'),auth[_0xa2c0('0xb')](),controller['getFields']);router[_0xa2c0('0x8')](_0xa2c0('0xe'),auth[_0xa2c0('0xb')](),controller['getSubjects']);router[_0xa2c0('0x8')](_0xa2c0('0xf'),auth[_0xa2c0('0xb')](),controller[_0xa2c0('0x10')]);router[_0xa2c0('0x11')]('/',auth[_0xa2c0('0xb')](),controller[_0xa2c0('0x12')]);router[_0xa2c0('0x13')](_0xa2c0('0xa'),auth[_0xa2c0('0xb')](),controller['update']);router['delete'](_0xa2c0('0xa'),auth[_0xa2c0('0xb')](),controller[_0xa2c0('0x14')]);module[_0xa2c0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 1614487..1ed5754 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 _0x5fa2=['nothing','contact_lead','sequelize','exports','STRING','ENUM','lead','contact'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5fa2,0x1b2));var _0x25fa=function(_0x584dc2,_0x4382ed){_0x584dc2=_0x584dc2-0x0;var _0x3941af=_0x5fa2[_0x584dc2];return _0x3941af;};'use strict';var Sequelize=require(_0x25fa('0x0'));module[_0x25fa('0x1')]={'name':{'type':Sequelize[_0x25fa('0x2')]},'moduleCreate':{'type':Sequelize[_0x25fa('0x3')](_0x25fa('0x4'),_0x25fa('0x5'),_0x25fa('0x6')),'defaultValue':_0x25fa('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x25fa('0x7'),'contact',_0x25fa('0x4')),'defaultValue':_0x25fa('0x7')},'description':{'type':Sequelize[_0x25fa('0x2')]}}; \ No newline at end of file +var _0x8e52=['STRING','ENUM','lead','contact','nothing','contact_lead','exports'];(function(_0x346597,_0x275261){var _0x4a375a=function(_0x31e083){while(--_0x31e083){_0x346597['push'](_0x346597['shift']());}};_0x4a375a(++_0x275261);}(_0x8e52,0x1c6));var _0x28e5=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0x8e52[_0x21c2c8];return _0x4dd745;};'use strict';var Sequelize=require('sequelize');module[_0x28e5('0x0')]={'name':{'type':Sequelize[_0x28e5('0x1')]},'moduleCreate':{'type':Sequelize[_0x28e5('0x2')](_0x28e5('0x3'),_0x28e5('0x4'),_0x28e5('0x5')),'defaultValue':_0x28e5('0x3')},'moduleSearch':{'type':Sequelize[_0x28e5('0x2')](_0x28e5('0x6'),_0x28e5('0x4'),_0x28e5('0x3')),'defaultValue':_0x28e5('0x6')},'description':{'type':Sequelize[_0x28e5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5330075..fc77687 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 _0xec07=['where','pick','filter','merge','type','includeAll','include','rows','show','params','rawAttributes','options','catch','create','body','find','destroy','getFields','findOne','ZohoField','sort','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','sendStatus','name','send','index','map','ZohoConfiguration','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x593d56,_0x10d793){var _0xb1c92c=function(_0x25f720){while(--_0x25f720){_0x593d56['push'](_0x593d56['shift']());}};_0xb1c92c(++_0x10d793);}(_0xec07,0xb5));var _0x7ec0=function(_0x452165,_0x3689de){_0x452165=_0x452165-0x0;var _0x522eb5=_0xec07[_0x452165];return _0x522eb5;};'use strict';var emlformat=require(_0x7ec0('0x0'));var rimraf=require(_0x7ec0('0x1'));var zipdir=require(_0x7ec0('0x2'));var jsonpatch=require(_0x7ec0('0x3'));var rp=require('request-promise');var moment=require(_0x7ec0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7ec0('0x5'));var path=require(_0x7ec0('0x6'));var sox=require(_0x7ec0('0x7'));var csv=require('to-csv');var ejs=require(_0x7ec0('0x8'));var fs=require('fs');var fs_extra=require(_0x7ec0('0x9'));var _=require(_0x7ec0('0xa'));var squel=require(_0x7ec0('0xb'));var crypto=require(_0x7ec0('0xc'));var jsforce=require(_0x7ec0('0xd'));var deskjs=require(_0x7ec0('0xe'));var toCsv=require(_0x7ec0('0xf'));var querystring=require(_0x7ec0('0x10'));var Papa=require(_0x7ec0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7ec0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ec0('0x13'));var logger=require(_0x7ec0('0x14'))(_0x7ec0('0x15'));var utils=require('../../config/utils');var config=require(_0x7ec0('0x16'));var licenseUtil=require(_0x7ec0('0x17'));var db=require(_0x7ec0('0x18'))['db'];function respondWithStatusCode(_0x219dd0,_0x434276){_0x434276=_0x434276||0xcc;return function(_0x2eed41){if(_0x2eed41){return _0x219dd0['sendStatus'](_0x434276);}return _0x219dd0['status'](_0x434276)[_0x7ec0('0x19')]();};}function respondWithResult(_0x5168f6,_0x421d83){_0x421d83=_0x421d83||0xc8;return function(_0x1a87a6){if(_0x1a87a6){return _0x5168f6[_0x7ec0('0x1a')](_0x421d83)[_0x7ec0('0x1b')](_0x1a87a6);}};}function respondWithFilteredResult(_0x3924ef,_0x45e13f){return function(_0x507b84){if(_0x507b84){var _0x15c0ef=typeof _0x45e13f[_0x7ec0('0x1c')]===_0x7ec0('0x1d')&&typeof _0x45e13f[_0x7ec0('0x1e')]===_0x7ec0('0x1d');var _0x3d159e=_0x507b84[_0x7ec0('0x1f')];var _0x370163=_0x15c0ef?0x0:_0x45e13f[_0x7ec0('0x1c')];var _0x552833=_0x15c0ef?_0x507b84[_0x7ec0('0x1f')]:_0x45e13f['offset']+_0x45e13f['limit'];var _0x2c7591;if(_0x552833>=_0x3d159e){_0x552833=_0x3d159e;_0x2c7591=0xc8;}else{_0x2c7591=0xce;}_0x3924ef[_0x7ec0('0x1a')](_0x2c7591);return _0x3924ef[_0x7ec0('0x20')](_0x7ec0('0x21'),_0x370163+'-'+_0x552833+'/'+_0x3d159e)[_0x7ec0('0x1b')](_0x507b84);}return null;};}function patchUpdates(_0xa2a927){return function(_0x4af299){try{jsonpatch['apply'](_0x4af299,_0xa2a927,!![]);}catch(_0x39e199){return BPromise['reject'](_0x39e199);}return _0x4af299[_0x7ec0('0x22')]();};}function saveUpdates(_0x1e9ca4,_0x4270db){return function(_0x132413){if(_0x132413){return _0x132413[_0x7ec0('0x23')](_0x1e9ca4)[_0x7ec0('0x24')](function(_0x2ad555){return _0x2ad555;});}return null;};}function removeEntity(_0x1384a4,_0x2900ae){return function(_0x298cb4){if(_0x298cb4){return _0x298cb4['destroy']()[_0x7ec0('0x24')](function(){_0x1384a4['status'](0xcc)[_0x7ec0('0x19')]();});}};}function handleEntityNotFound(_0x81a012,_0x182f76){return function(_0x2c49cc){if(!_0x2c49cc){_0x81a012[_0x7ec0('0x25')](0x194);}return _0x2c49cc;};}function handleError(_0x28c150,_0x7a7ffe){_0x7a7ffe=_0x7a7ffe||0x1f4;return function(_0x245f3c){logger['error'](_0x245f3c['stack']);if(_0x245f3c[_0x7ec0('0x26')]){delete _0x245f3c[_0x7ec0('0x26')];}_0x28c150[_0x7ec0('0x1a')](_0x7a7ffe)[_0x7ec0('0x27')](_0x245f3c);};}exports[_0x7ec0('0x28')]=function(_0x237eab,_0x488917){var _0x4022a4={},_0x5973ed={},_0x1b7dc7={'count':0x0,'rows':[]};var _0x50d1b9=_[_0x7ec0('0x29')](db[_0x7ec0('0x2a')]['rawAttributes'],function(_0x2be483){return{'name':_0x2be483[_0x7ec0('0x2b')],'type':_0x2be483['type'][_0x7ec0('0x2c')]};});_0x5973ed[_0x7ec0('0x2d')]=_[_0x7ec0('0x29')](_0x50d1b9,_0x7ec0('0x26'));_0x5973ed['query']=_[_0x7ec0('0x2e')](_0x237eab[_0x7ec0('0x2f')]);_0x5973ed[_0x7ec0('0x30')]=_[_0x7ec0('0x31')](_0x5973ed[_0x7ec0('0x2d')],_0x5973ed[_0x7ec0('0x2f')]);_0x4022a4[_0x7ec0('0x32')]=_[_0x7ec0('0x31')](_0x5973ed[_0x7ec0('0x2d')],qs[_0x7ec0('0x33')](_0x237eab[_0x7ec0('0x2f')][_0x7ec0('0x33')]));_0x4022a4[_0x7ec0('0x32')]=_0x4022a4[_0x7ec0('0x32')][_0x7ec0('0x34')]?_0x4022a4[_0x7ec0('0x32')]:_0x5973ed[_0x7ec0('0x2d')];if(!_0x237eab['query'][_0x7ec0('0x35')](_0x7ec0('0x36'))){_0x4022a4[_0x7ec0('0x1e')]=qs[_0x7ec0('0x1e')](_0x237eab[_0x7ec0('0x2f')]['limit']);_0x4022a4[_0x7ec0('0x1c')]=qs[_0x7ec0('0x1c')](_0x237eab[_0x7ec0('0x2f')]['offset']);}_0x4022a4[_0x7ec0('0x37')]=qs['sort'](_0x237eab[_0x7ec0('0x2f')]['sort']);_0x4022a4[_0x7ec0('0x38')]=qs[_0x7ec0('0x30')](_[_0x7ec0('0x39')](_0x237eab[_0x7ec0('0x2f')],_0x5973ed[_0x7ec0('0x30')]),_0x50d1b9);if(_0x237eab[_0x7ec0('0x2f')][_0x7ec0('0x3a')]){_0x4022a4[_0x7ec0('0x38')]=_[_0x7ec0('0x3b')](_0x4022a4['where'],{'$or':_[_0x7ec0('0x29')](_0x50d1b9,function(_0x50b6e3){if(_0x50b6e3[_0x7ec0('0x3c')]!=='VIRTUAL'){var _0x3b42c9={};_0x3b42c9[_0x50b6e3[_0x7ec0('0x26')]]={'$like':'%'+_0x237eab[_0x7ec0('0x2f')][_0x7ec0('0x3a')]+'%'};return _0x3b42c9;}})});}_0x4022a4=_[_0x7ec0('0x3b')]({},_0x4022a4,_0x237eab['options']);var _0x5967bb={'where':_0x4022a4[_0x7ec0('0x38')]};return db['ZohoConfiguration'][_0x7ec0('0x1f')](_0x5967bb)['then'](function(_0x17b4c6){_0x1b7dc7[_0x7ec0('0x1f')]=_0x17b4c6;if(_0x237eab['query'][_0x7ec0('0x3d')]){_0x4022a4[_0x7ec0('0x3e')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x4022a4);})[_0x7ec0('0x24')](function(_0xdda4ce){_0x1b7dc7[_0x7ec0('0x3f')]=_0xdda4ce;return _0x1b7dc7;})[_0x7ec0('0x24')](respondWithFilteredResult(_0x488917,_0x4022a4))['catch'](handleError(_0x488917,null));};exports[_0x7ec0('0x40')]=function(_0x50755a,_0x532b21){var _0x2b4fd5={'raw':![],'where':{'id':_0x50755a[_0x7ec0('0x41')]['id']}},_0x31620b={};_0x31620b['model']=_[_0x7ec0('0x2e')](db[_0x7ec0('0x2a')][_0x7ec0('0x42')]);_0x31620b[_0x7ec0('0x2f')]=_[_0x7ec0('0x2e')](_0x50755a['query']);_0x31620b[_0x7ec0('0x30')]=_[_0x7ec0('0x31')](_0x31620b[_0x7ec0('0x2d')],_0x31620b[_0x7ec0('0x2f')]);_0x2b4fd5[_0x7ec0('0x32')]=_[_0x7ec0('0x31')](_0x31620b[_0x7ec0('0x2d')],qs[_0x7ec0('0x33')](_0x50755a[_0x7ec0('0x2f')][_0x7ec0('0x33')]));_0x2b4fd5[_0x7ec0('0x32')]=_0x2b4fd5['attributes']['length']?_0x2b4fd5['attributes']:_0x31620b['model'];if(_0x50755a['query'][_0x7ec0('0x3d')]){_0x2b4fd5[_0x7ec0('0x3e')]=[{'all':!![]}];}_0x2b4fd5=_['merge']({},_0x2b4fd5,_0x50755a[_0x7ec0('0x43')]);return db['ZohoConfiguration']['find'](_0x2b4fd5)['then'](handleEntityNotFound(_0x532b21,null))[_0x7ec0('0x24')](respondWithResult(_0x532b21,null))[_0x7ec0('0x44')](handleError(_0x532b21,null));};exports[_0x7ec0('0x45')]=function(_0x4998e5,_0x2f2f3c){return db[_0x7ec0('0x2a')][_0x7ec0('0x45')](_0x4998e5[_0x7ec0('0x46')],{})[_0x7ec0('0x24')](respondWithResult(_0x2f2f3c,0xc9))['catch'](handleError(_0x2f2f3c,null));};exports[_0x7ec0('0x23')]=function(_0x25a652,_0x3d2cf0){if(_0x25a652[_0x7ec0('0x46')]['id']){delete _0x25a652[_0x7ec0('0x46')]['id'];}return db[_0x7ec0('0x2a')][_0x7ec0('0x47')]({'where':{'id':_0x25a652[_0x7ec0('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d2cf0,null))[_0x7ec0('0x24')](saveUpdates(_0x25a652[_0x7ec0('0x46')],null))[_0x7ec0('0x24')](respondWithResult(_0x3d2cf0,null))[_0x7ec0('0x44')](handleError(_0x3d2cf0,null));};exports[_0x7ec0('0x48')]=function(_0x629f74,_0x298be7){return db[_0x7ec0('0x2a')][_0x7ec0('0x47')]({'where':{'id':_0x629f74[_0x7ec0('0x41')]['id']}})[_0x7ec0('0x24')](handleEntityNotFound(_0x298be7,null))['then'](removeEntity(_0x298be7,null))[_0x7ec0('0x44')](handleError(_0x298be7,null));};exports[_0x7ec0('0x49')]=function(_0x13783f,_0x139064,_0x15d9c9){var _0x4b8bfa={};var _0xb7dcfb={};var _0x53dd73;var _0x34655a;return db[_0x7ec0('0x2a')][_0x7ec0('0x4a')]({'where':{'id':_0x13783f[_0x7ec0('0x41')]['id']}})['then'](handleEntityNotFound(_0x139064,null))['then'](function(_0x38e2b7){if(_0x38e2b7){_0x53dd73=_0x38e2b7;_0xb7dcfb['model']=_[_0x7ec0('0x2e')](db[_0x7ec0('0x4b')][_0x7ec0('0x42')]);_0xb7dcfb[_0x7ec0('0x2f')]=_['keys'](_0x13783f[_0x7ec0('0x2f')]);_0xb7dcfb[_0x7ec0('0x30')]=_[_0x7ec0('0x31')](_0xb7dcfb[_0x7ec0('0x2d')],_0xb7dcfb[_0x7ec0('0x2f')]);_0x4b8bfa[_0x7ec0('0x32')]=_[_0x7ec0('0x31')](_0xb7dcfb[_0x7ec0('0x2d')],qs[_0x7ec0('0x33')](_0x13783f[_0x7ec0('0x2f')][_0x7ec0('0x33')]));_0x4b8bfa[_0x7ec0('0x32')]=_0x4b8bfa[_0x7ec0('0x32')][_0x7ec0('0x34')]?_0x4b8bfa[_0x7ec0('0x32')]:_0xb7dcfb[_0x7ec0('0x2d')];_0x4b8bfa[_0x7ec0('0x37')]=qs[_0x7ec0('0x4c')](_0x13783f[_0x7ec0('0x2f')][_0x7ec0('0x4c')]);_0x4b8bfa[_0x7ec0('0x38')]=qs[_0x7ec0('0x30')](_[_0x7ec0('0x39')](_0x13783f[_0x7ec0('0x2f')],_0xb7dcfb[_0x7ec0('0x30')]));if(_0x13783f[_0x7ec0('0x2f')][_0x7ec0('0x3a')]){_0x4b8bfa[_0x7ec0('0x38')]=_['merge'](_0x4b8bfa[_0x7ec0('0x38')],{'$or':_[_0x7ec0('0x29')](_0x4b8bfa[_0x7ec0('0x32')],function(_0x28a067){var _0x5b87e4={};_0x5b87e4[_0x28a067]={'$like':'%'+_0x13783f[_0x7ec0('0x2f')][_0x7ec0('0x3a')]+'%'};return _0x5b87e4;})});}_0x4b8bfa=_['merge']({},_0x4b8bfa,_0x13783f[_0x7ec0('0x43')]);return _0x53dd73[_0x7ec0('0x49')](_0x4b8bfa);}})['then'](function(_0x6878e2){if(_0x6878e2){_0x34655a=_0x6878e2[_0x7ec0('0x34')];if(!_0x13783f[_0x7ec0('0x2f')][_0x7ec0('0x35')]('nolimit')){_0x4b8bfa['limit']=qs[_0x7ec0('0x1e')](_0x13783f[_0x7ec0('0x2f')][_0x7ec0('0x1e')]);_0x4b8bfa['offset']=qs[_0x7ec0('0x1c')](_0x13783f[_0x7ec0('0x2f')][_0x7ec0('0x1c')]);}return _0x53dd73[_0x7ec0('0x49')](_0x4b8bfa);}})[_0x7ec0('0x24')](function(_0x4231ad){if(_0x4231ad){return _0x4231ad?{'count':_0x34655a,'rows':_0x4231ad}:null;}})[_0x7ec0('0x24')](respondWithResult(_0x139064,null))[_0x7ec0('0x44')](handleError(_0x139064,null));};exports['getSubjects']=function(_0x498719,_0x304db9,_0x4cd270){var _0x2f5da9={};var _0x131086={};var _0x574a4b;var _0x155389;return db[_0x7ec0('0x2a')][_0x7ec0('0x4a')]({'where':{'id':_0x498719[_0x7ec0('0x41')]['id']}})[_0x7ec0('0x24')](handleEntityNotFound(_0x304db9,null))[_0x7ec0('0x24')](function(_0x57e020){if(_0x57e020){_0x574a4b=_0x57e020;_0x131086['model']=_[_0x7ec0('0x2e')](db[_0x7ec0('0x4b')][_0x7ec0('0x42')]);_0x131086[_0x7ec0('0x2f')]=_[_0x7ec0('0x2e')](_0x498719[_0x7ec0('0x2f')]);_0x131086[_0x7ec0('0x30')]=_[_0x7ec0('0x31')](_0x131086[_0x7ec0('0x2d')],_0x131086[_0x7ec0('0x2f')]);_0x2f5da9[_0x7ec0('0x32')]=_[_0x7ec0('0x31')](_0x131086[_0x7ec0('0x2d')],qs['fields'](_0x498719['query'][_0x7ec0('0x33')]));_0x2f5da9[_0x7ec0('0x32')]=_0x2f5da9['attributes'][_0x7ec0('0x34')]?_0x2f5da9[_0x7ec0('0x32')]:_0x131086['model'];_0x2f5da9[_0x7ec0('0x37')]=qs[_0x7ec0('0x4c')](_0x498719['query']['sort']);_0x2f5da9['where']=qs['filters'](_[_0x7ec0('0x39')](_0x498719[_0x7ec0('0x2f')],_0x131086['filters']));if(_0x498719[_0x7ec0('0x2f')][_0x7ec0('0x3a')]){_0x2f5da9[_0x7ec0('0x38')]=_[_0x7ec0('0x3b')](_0x2f5da9[_0x7ec0('0x38')],{'$or':_['map'](_0x2f5da9['attributes'],function(_0x50a14d){var _0x47db02={};_0x47db02[_0x50a14d]={'$like':'%'+_0x498719[_0x7ec0('0x2f')]['filter']+'%'};return _0x47db02;})});}_0x2f5da9=_[_0x7ec0('0x3b')]({},_0x2f5da9,_0x498719[_0x7ec0('0x43')]);return _0x574a4b[_0x7ec0('0x4d')](_0x2f5da9);}})[_0x7ec0('0x24')](function(_0x5a073e){if(_0x5a073e){_0x155389=_0x5a073e['length'];if(!_0x498719['query']['hasOwnProperty'](_0x7ec0('0x36'))){_0x2f5da9[_0x7ec0('0x1e')]=qs[_0x7ec0('0x1e')](_0x498719[_0x7ec0('0x2f')]['limit']);_0x2f5da9[_0x7ec0('0x1c')]=qs[_0x7ec0('0x1c')](_0x498719['query'][_0x7ec0('0x1c')]);}return _0x574a4b[_0x7ec0('0x4d')](_0x2f5da9);}})[_0x7ec0('0x24')](function(_0x582517){if(_0x582517){return _0x582517?{'count':_0x155389,'rows':_0x582517}:null;}})[_0x7ec0('0x24')](respondWithResult(_0x304db9,null))['catch'](handleError(_0x304db9,null));};exports['getDescriptions']=function(_0x4a7e5f,_0x23a541,_0x639cb2){var _0xecea61={};var _0x15a9c9={};var _0x12bf1b;var _0x551346;return db[_0x7ec0('0x2a')][_0x7ec0('0x4a')]({'where':{'id':_0x4a7e5f[_0x7ec0('0x41')]['id']}})[_0x7ec0('0x24')](handleEntityNotFound(_0x23a541,null))[_0x7ec0('0x24')](function(_0x2ecf6d){if(_0x2ecf6d){_0x12bf1b=_0x2ecf6d;_0x15a9c9[_0x7ec0('0x2d')]=_[_0x7ec0('0x2e')](db['ZohoField'][_0x7ec0('0x42')]);_0x15a9c9[_0x7ec0('0x2f')]=_['keys'](_0x4a7e5f[_0x7ec0('0x2f')]);_0x15a9c9['filters']=_[_0x7ec0('0x31')](_0x15a9c9['model'],_0x15a9c9[_0x7ec0('0x2f')]);_0xecea61[_0x7ec0('0x32')]=_['intersection'](_0x15a9c9[_0x7ec0('0x2d')],qs[_0x7ec0('0x33')](_0x4a7e5f['query'][_0x7ec0('0x33')]));_0xecea61[_0x7ec0('0x32')]=_0xecea61[_0x7ec0('0x32')][_0x7ec0('0x34')]?_0xecea61['attributes']:_0x15a9c9['model'];_0xecea61['order']=qs[_0x7ec0('0x4c')](_0x4a7e5f['query']['sort']);_0xecea61[_0x7ec0('0x38')]=qs[_0x7ec0('0x30')](_[_0x7ec0('0x39')](_0x4a7e5f[_0x7ec0('0x2f')],_0x15a9c9[_0x7ec0('0x30')]));if(_0x4a7e5f[_0x7ec0('0x2f')]['filter']){_0xecea61[_0x7ec0('0x38')]=_[_0x7ec0('0x3b')](_0xecea61[_0x7ec0('0x38')],{'$or':_['map'](_0xecea61[_0x7ec0('0x32')],function(_0x3fbc65){var _0x558df6={};_0x558df6[_0x3fbc65]={'$like':'%'+_0x4a7e5f[_0x7ec0('0x2f')][_0x7ec0('0x3a')]+'%'};return _0x558df6;})});}_0xecea61=_[_0x7ec0('0x3b')]({},_0xecea61,_0x4a7e5f['options']);return _0x12bf1b[_0x7ec0('0x4e')](_0xecea61);}})[_0x7ec0('0x24')](function(_0xb5107b){if(_0xb5107b){_0x551346=_0xb5107b[_0x7ec0('0x34')];if(!_0x4a7e5f[_0x7ec0('0x2f')]['hasOwnProperty'](_0x7ec0('0x36'))){_0xecea61[_0x7ec0('0x1e')]=qs['limit'](_0x4a7e5f[_0x7ec0('0x2f')][_0x7ec0('0x1e')]);_0xecea61[_0x7ec0('0x1c')]=qs[_0x7ec0('0x1c')](_0x4a7e5f[_0x7ec0('0x2f')][_0x7ec0('0x1c')]);}return _0x12bf1b['getDescriptions'](_0xecea61);}})['then'](function(_0x2ddc14){if(_0x2ddc14){return _0x2ddc14?{'count':_0x551346,'rows':_0x2ddc14}:null;}})['then'](respondWithResult(_0x23a541,null))[_0x7ec0('0x44')](handleError(_0x23a541,null));}; \ No newline at end of file +var _0x42ee=['ejs','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','ZohoConfiguration','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','update','find','getFields','findOne','getSubjects','getDescriptions','ZohoField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x227eec,_0x4a4027){var _0x2ee592=function(_0x3cfa11){while(--_0x3cfa11){_0x227eec['push'](_0x227eec['shift']());}};_0x2ee592(++_0x4a4027);}(_0x42ee,0x1ce));var _0xe42e=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x42ee[_0x213518];return _0x1baf75;};'use strict';var emlformat=require(_0xe42e('0x0'));var rimraf=require(_0xe42e('0x1'));var zipdir=require(_0xe42e('0x2'));var jsonpatch=require(_0xe42e('0x3'));var rp=require(_0xe42e('0x4'));var moment=require(_0xe42e('0x5'));var BPromise=require(_0xe42e('0x6'));var Mustache=require(_0xe42e('0x7'));var util=require(_0xe42e('0x8'));var path=require(_0xe42e('0x9'));var sox=require(_0xe42e('0xa'));var csv=require(_0xe42e('0xb'));var ejs=require(_0xe42e('0xc'));var fs=require('fs');var fs_extra=require(_0xe42e('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe42e('0xe'));var jsforce=require(_0xe42e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe42e('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe42e('0x10'));var authService=require(_0xe42e('0x11'));var qs=require(_0xe42e('0x12'));var as=require(_0xe42e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe42e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe42e('0x15'));var db=require(_0xe42e('0x16'))['db'];function respondWithStatusCode(_0xa0f3ec,_0x3015af){_0x3015af=_0x3015af||0xcc;return function(_0x5f0855){if(_0x5f0855){return _0xa0f3ec[_0xe42e('0x17')](_0x3015af);}return _0xa0f3ec[_0xe42e('0x18')](_0x3015af)[_0xe42e('0x19')]();};}function respondWithResult(_0x56002b,_0x11dc0d){_0x11dc0d=_0x11dc0d||0xc8;return function(_0x1974ac){if(_0x1974ac){return _0x56002b[_0xe42e('0x18')](_0x11dc0d)['json'](_0x1974ac);}};}function respondWithFilteredResult(_0x33c680,_0x46e15f){return function(_0x2c8cd9){if(_0x2c8cd9){var _0x41c9b5=typeof _0x46e15f['offset']==='undefined'&&typeof _0x46e15f[_0xe42e('0x1a')]==='undefined';var _0x54a516=_0x2c8cd9[_0xe42e('0x1b')];var _0xdc5b33=_0x41c9b5?0x0:_0x46e15f['offset'];var _0x493445=_0x41c9b5?_0x2c8cd9[_0xe42e('0x1b')]:_0x46e15f[_0xe42e('0x1c')]+_0x46e15f[_0xe42e('0x1a')];var _0x18022a;if(_0x493445>=_0x54a516){_0x493445=_0x54a516;_0x18022a=0xc8;}else{_0x18022a=0xce;}_0x33c680[_0xe42e('0x18')](_0x18022a);return _0x33c680[_0xe42e('0x1d')]('Content-Range',_0xdc5b33+'-'+_0x493445+'/'+_0x54a516)[_0xe42e('0x1e')](_0x2c8cd9);}return null;};}function patchUpdates(_0x20da9b){return function(_0x2e9a6d){try{jsonpatch[_0xe42e('0x1f')](_0x2e9a6d,_0x20da9b,!![]);}catch(_0x4c16ec){return BPromise[_0xe42e('0x20')](_0x4c16ec);}return _0x2e9a6d[_0xe42e('0x21')]();};}function saveUpdates(_0x58a9ac,_0x5abf4a){return function(_0x44bb41){if(_0x44bb41){return _0x44bb41['update'](_0x58a9ac)[_0xe42e('0x22')](function(_0x1af1e6){return _0x1af1e6;});}return null;};}function removeEntity(_0x5d9426,_0x5585ba){return function(_0x2ec681){if(_0x2ec681){return _0x2ec681[_0xe42e('0x23')]()[_0xe42e('0x22')](function(){_0x5d9426[_0xe42e('0x18')](0xcc)[_0xe42e('0x19')]();});}};}function handleEntityNotFound(_0x306467,_0x4e4878){return function(_0x49f54a){if(!_0x49f54a){_0x306467[_0xe42e('0x17')](0x194);}return _0x49f54a;};}function handleError(_0x33949d,_0x1ee787){_0x1ee787=_0x1ee787||0x1f4;return function(_0x95d712){logger[_0xe42e('0x24')](_0x95d712[_0xe42e('0x25')]);if(_0x95d712[_0xe42e('0x26')]){delete _0x95d712[_0xe42e('0x26')];}_0x33949d[_0xe42e('0x18')](_0x1ee787)['send'](_0x95d712);};}exports[_0xe42e('0x27')]=function(_0x49781f,_0x586791){var _0x500a04={},_0x30c458={},_0x4527db={'count':0x0,'rows':[]};var _0x1494ed=_[_0xe42e('0x28')](db[_0xe42e('0x29')]['rawAttributes'],function(_0x56f0c6){return{'name':_0x56f0c6[_0xe42e('0x2a')],'type':_0x56f0c6['type'][_0xe42e('0x2b')]};});_0x30c458['model']=_[_0xe42e('0x28')](_0x1494ed,'name');_0x30c458['query']=_['keys'](_0x49781f[_0xe42e('0x2c')]);_0x30c458[_0xe42e('0x2d')]=_[_0xe42e('0x2e')](_0x30c458[_0xe42e('0x2f')],_0x30c458['query']);_0x500a04[_0xe42e('0x30')]=_[_0xe42e('0x2e')](_0x30c458['model'],qs[_0xe42e('0x31')](_0x49781f['query'][_0xe42e('0x31')]));_0x500a04[_0xe42e('0x30')]=_0x500a04['attributes'][_0xe42e('0x32')]?_0x500a04[_0xe42e('0x30')]:_0x30c458[_0xe42e('0x2f')];if(!_0x49781f['query'][_0xe42e('0x33')](_0xe42e('0x34'))){_0x500a04['limit']=qs[_0xe42e('0x1a')](_0x49781f[_0xe42e('0x2c')][_0xe42e('0x1a')]);_0x500a04[_0xe42e('0x1c')]=qs[_0xe42e('0x1c')](_0x49781f[_0xe42e('0x2c')][_0xe42e('0x1c')]);}_0x500a04[_0xe42e('0x35')]=qs[_0xe42e('0x36')](_0x49781f['query'][_0xe42e('0x36')]);_0x500a04[_0xe42e('0x37')]=qs['filters'](_[_0xe42e('0x38')](_0x49781f[_0xe42e('0x2c')],_0x30c458[_0xe42e('0x2d')]),_0x1494ed);if(_0x49781f[_0xe42e('0x2c')][_0xe42e('0x39')]){_0x500a04[_0xe42e('0x37')]=_['merge'](_0x500a04[_0xe42e('0x37')],{'$or':_[_0xe42e('0x28')](_0x1494ed,function(_0x1f1630){if(_0x1f1630[_0xe42e('0x3a')]!==_0xe42e('0x3b')){var _0xf0c51={};_0xf0c51[_0x1f1630[_0xe42e('0x26')]]={'$like':'%'+_0x49781f[_0xe42e('0x2c')][_0xe42e('0x39')]+'%'};return _0xf0c51;}})});}_0x500a04=_[_0xe42e('0x3c')]({},_0x500a04,_0x49781f[_0xe42e('0x3d')]);var _0x1e1f3e={'where':_0x500a04['where']};return db[_0xe42e('0x29')][_0xe42e('0x1b')](_0x1e1f3e)[_0xe42e('0x22')](function(_0x473435){_0x4527db[_0xe42e('0x1b')]=_0x473435;if(_0x49781f[_0xe42e('0x2c')][_0xe42e('0x3e')]){_0x500a04[_0xe42e('0x3f')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xe42e('0x40')](_0x500a04);})[_0xe42e('0x22')](function(_0x312179){_0x4527db[_0xe42e('0x41')]=_0x312179;return _0x4527db;})['then'](respondWithFilteredResult(_0x586791,_0x500a04))[_0xe42e('0x42')](handleError(_0x586791,null));};exports['show']=function(_0x354783,_0x49d87c){var _0x4e3866={'raw':![],'where':{'id':_0x354783[_0xe42e('0x43')]['id']}},_0x313386={};_0x313386[_0xe42e('0x2f')]=_[_0xe42e('0x44')](db[_0xe42e('0x29')][_0xe42e('0x45')]);_0x313386['query']=_[_0xe42e('0x44')](_0x354783[_0xe42e('0x2c')]);_0x313386[_0xe42e('0x2d')]=_[_0xe42e('0x2e')](_0x313386['model'],_0x313386['query']);_0x4e3866[_0xe42e('0x30')]=_[_0xe42e('0x2e')](_0x313386[_0xe42e('0x2f')],qs[_0xe42e('0x31')](_0x354783[_0xe42e('0x2c')]['fields']));_0x4e3866[_0xe42e('0x30')]=_0x4e3866['attributes'][_0xe42e('0x32')]?_0x4e3866['attributes']:_0x313386['model'];if(_0x354783['query'][_0xe42e('0x3e')]){_0x4e3866[_0xe42e('0x3f')]=[{'all':!![]}];}_0x4e3866=_[_0xe42e('0x3c')]({},_0x4e3866,_0x354783[_0xe42e('0x3d')]);return db[_0xe42e('0x29')]['find'](_0x4e3866)['then'](handleEntityNotFound(_0x49d87c,null))['then'](respondWithResult(_0x49d87c,null))[_0xe42e('0x42')](handleError(_0x49d87c,null));};exports[_0xe42e('0x46')]=function(_0xe40272,_0x273b7b){return db[_0xe42e('0x29')][_0xe42e('0x46')](_0xe40272[_0xe42e('0x47')],{})[_0xe42e('0x22')](respondWithResult(_0x273b7b,0xc9))[_0xe42e('0x42')](handleError(_0x273b7b,null));};exports[_0xe42e('0x48')]=function(_0x158313,_0x3e005b){if(_0x158313[_0xe42e('0x47')]['id']){delete _0x158313[_0xe42e('0x47')]['id'];}return db[_0xe42e('0x29')]['find']({'where':{'id':_0x158313['params']['id']}})['then'](handleEntityNotFound(_0x3e005b,null))['then'](saveUpdates(_0x158313[_0xe42e('0x47')],null))[_0xe42e('0x22')](respondWithResult(_0x3e005b,null))[_0xe42e('0x42')](handleError(_0x3e005b,null));};exports['destroy']=function(_0x23651e,_0x5487fb){return db['ZohoConfiguration'][_0xe42e('0x49')]({'where':{'id':_0x23651e[_0xe42e('0x43')]['id']}})[_0xe42e('0x22')](handleEntityNotFound(_0x5487fb,null))[_0xe42e('0x22')](removeEntity(_0x5487fb,null))[_0xe42e('0x42')](handleError(_0x5487fb,null));};exports[_0xe42e('0x4a')]=function(_0x224f1c,_0x232a13,_0x22a3b2){var _0x2879b2={};var _0x23a0f2={};var _0x60f49a;var _0x3a90af;return db['ZohoConfiguration'][_0xe42e('0x4b')]({'where':{'id':_0x224f1c[_0xe42e('0x43')]['id']}})[_0xe42e('0x22')](handleEntityNotFound(_0x232a13,null))[_0xe42e('0x22')](function(_0x5bbe8f){if(_0x5bbe8f){_0x60f49a=_0x5bbe8f;_0x23a0f2['model']=_[_0xe42e('0x44')](db['ZohoField'][_0xe42e('0x45')]);_0x23a0f2[_0xe42e('0x2c')]=_[_0xe42e('0x44')](_0x224f1c['query']);_0x23a0f2[_0xe42e('0x2d')]=_['intersection'](_0x23a0f2[_0xe42e('0x2f')],_0x23a0f2[_0xe42e('0x2c')]);_0x2879b2[_0xe42e('0x30')]=_[_0xe42e('0x2e')](_0x23a0f2[_0xe42e('0x2f')],qs[_0xe42e('0x31')](_0x224f1c[_0xe42e('0x2c')]['fields']));_0x2879b2['attributes']=_0x2879b2[_0xe42e('0x30')][_0xe42e('0x32')]?_0x2879b2['attributes']:_0x23a0f2[_0xe42e('0x2f')];_0x2879b2['order']=qs['sort'](_0x224f1c[_0xe42e('0x2c')][_0xe42e('0x36')]);_0x2879b2['where']=qs['filters'](_[_0xe42e('0x38')](_0x224f1c[_0xe42e('0x2c')],_0x23a0f2['filters']));if(_0x224f1c[_0xe42e('0x2c')]['filter']){_0x2879b2['where']=_[_0xe42e('0x3c')](_0x2879b2[_0xe42e('0x37')],{'$or':_['map'](_0x2879b2['attributes'],function(_0x1f6265){var _0xfbe79d={};_0xfbe79d[_0x1f6265]={'$like':'%'+_0x224f1c[_0xe42e('0x2c')][_0xe42e('0x39')]+'%'};return _0xfbe79d;})});}_0x2879b2=_[_0xe42e('0x3c')]({},_0x2879b2,_0x224f1c['options']);return _0x60f49a[_0xe42e('0x4a')](_0x2879b2);}})[_0xe42e('0x22')](function(_0xfeee3c){if(_0xfeee3c){_0x3a90af=_0xfeee3c[_0xe42e('0x32')];if(!_0x224f1c[_0xe42e('0x2c')][_0xe42e('0x33')]('nolimit')){_0x2879b2['limit']=qs[_0xe42e('0x1a')](_0x224f1c[_0xe42e('0x2c')]['limit']);_0x2879b2[_0xe42e('0x1c')]=qs[_0xe42e('0x1c')](_0x224f1c[_0xe42e('0x2c')][_0xe42e('0x1c')]);}return _0x60f49a[_0xe42e('0x4a')](_0x2879b2);}})[_0xe42e('0x22')](function(_0x96f781){if(_0x96f781){return _0x96f781?{'count':_0x3a90af,'rows':_0x96f781}:null;}})[_0xe42e('0x22')](respondWithResult(_0x232a13,null))[_0xe42e('0x42')](handleError(_0x232a13,null));};exports[_0xe42e('0x4c')]=function(_0xd0cc74,_0x35cf91,_0x1b3be0){var _0x5ca1a2={};var _0x2ccf3a={};var _0x33ad9a;var _0x2fba93;return db['ZohoConfiguration'][_0xe42e('0x4b')]({'where':{'id':_0xd0cc74[_0xe42e('0x43')]['id']}})[_0xe42e('0x22')](handleEntityNotFound(_0x35cf91,null))[_0xe42e('0x22')](function(_0x4ba20b){if(_0x4ba20b){_0x33ad9a=_0x4ba20b;_0x2ccf3a['model']=_[_0xe42e('0x44')](db['ZohoField'][_0xe42e('0x45')]);_0x2ccf3a[_0xe42e('0x2c')]=_[_0xe42e('0x44')](_0xd0cc74[_0xe42e('0x2c')]);_0x2ccf3a[_0xe42e('0x2d')]=_[_0xe42e('0x2e')](_0x2ccf3a['model'],_0x2ccf3a['query']);_0x5ca1a2[_0xe42e('0x30')]=_[_0xe42e('0x2e')](_0x2ccf3a[_0xe42e('0x2f')],qs['fields'](_0xd0cc74[_0xe42e('0x2c')][_0xe42e('0x31')]));_0x5ca1a2[_0xe42e('0x30')]=_0x5ca1a2[_0xe42e('0x30')][_0xe42e('0x32')]?_0x5ca1a2[_0xe42e('0x30')]:_0x2ccf3a[_0xe42e('0x2f')];_0x5ca1a2['order']=qs[_0xe42e('0x36')](_0xd0cc74[_0xe42e('0x2c')][_0xe42e('0x36')]);_0x5ca1a2[_0xe42e('0x37')]=qs[_0xe42e('0x2d')](_[_0xe42e('0x38')](_0xd0cc74[_0xe42e('0x2c')],_0x2ccf3a['filters']));if(_0xd0cc74[_0xe42e('0x2c')][_0xe42e('0x39')]){_0x5ca1a2['where']=_[_0xe42e('0x3c')](_0x5ca1a2[_0xe42e('0x37')],{'$or':_[_0xe42e('0x28')](_0x5ca1a2[_0xe42e('0x30')],function(_0x4b3ee0){var _0x289c55={};_0x289c55[_0x4b3ee0]={'$like':'%'+_0xd0cc74[_0xe42e('0x2c')][_0xe42e('0x39')]+'%'};return _0x289c55;})});}_0x5ca1a2=_[_0xe42e('0x3c')]({},_0x5ca1a2,_0xd0cc74[_0xe42e('0x3d')]);return _0x33ad9a[_0xe42e('0x4c')](_0x5ca1a2);}})[_0xe42e('0x22')](function(_0x15cc7e){if(_0x15cc7e){_0x2fba93=_0x15cc7e[_0xe42e('0x32')];if(!_0xd0cc74[_0xe42e('0x2c')][_0xe42e('0x33')](_0xe42e('0x34'))){_0x5ca1a2[_0xe42e('0x1a')]=qs[_0xe42e('0x1a')](_0xd0cc74[_0xe42e('0x2c')][_0xe42e('0x1a')]);_0x5ca1a2['offset']=qs[_0xe42e('0x1c')](_0xd0cc74['query'][_0xe42e('0x1c')]);}return _0x33ad9a[_0xe42e('0x4c')](_0x5ca1a2);}})[_0xe42e('0x22')](function(_0x3de56d){if(_0x3de56d){return _0x3de56d?{'count':_0x2fba93,'rows':_0x3de56d}:null;}})[_0xe42e('0x22')](respondWithResult(_0x35cf91,null))[_0xe42e('0x42')](handleError(_0x35cf91,null));};exports[_0xe42e('0x4d')]=function(_0x1cb875,_0x31d4f2,_0x3a90db){var _0x212b5c={};var _0x2a1936={};var _0x1fbf52;var _0x325cc5;return db[_0xe42e('0x29')][_0xe42e('0x4b')]({'where':{'id':_0x1cb875[_0xe42e('0x43')]['id']}})[_0xe42e('0x22')](handleEntityNotFound(_0x31d4f2,null))['then'](function(_0x7a584c){if(_0x7a584c){_0x1fbf52=_0x7a584c;_0x2a1936[_0xe42e('0x2f')]=_[_0xe42e('0x44')](db[_0xe42e('0x4e')]['rawAttributes']);_0x2a1936['query']=_[_0xe42e('0x44')](_0x1cb875[_0xe42e('0x2c')]);_0x2a1936[_0xe42e('0x2d')]=_[_0xe42e('0x2e')](_0x2a1936['model'],_0x2a1936[_0xe42e('0x2c')]);_0x212b5c['attributes']=_[_0xe42e('0x2e')](_0x2a1936['model'],qs['fields'](_0x1cb875[_0xe42e('0x2c')][_0xe42e('0x31')]));_0x212b5c[_0xe42e('0x30')]=_0x212b5c[_0xe42e('0x30')][_0xe42e('0x32')]?_0x212b5c[_0xe42e('0x30')]:_0x2a1936[_0xe42e('0x2f')];_0x212b5c[_0xe42e('0x35')]=qs[_0xe42e('0x36')](_0x1cb875[_0xe42e('0x2c')][_0xe42e('0x36')]);_0x212b5c[_0xe42e('0x37')]=qs['filters'](_[_0xe42e('0x38')](_0x1cb875[_0xe42e('0x2c')],_0x2a1936[_0xe42e('0x2d')]));if(_0x1cb875['query']['filter']){_0x212b5c[_0xe42e('0x37')]=_['merge'](_0x212b5c[_0xe42e('0x37')],{'$or':_[_0xe42e('0x28')](_0x212b5c[_0xe42e('0x30')],function(_0x13e37b){var _0x50c54c={};_0x50c54c[_0x13e37b]={'$like':'%'+_0x1cb875[_0xe42e('0x2c')]['filter']+'%'};return _0x50c54c;})});}_0x212b5c=_[_0xe42e('0x3c')]({},_0x212b5c,_0x1cb875[_0xe42e('0x3d')]);return _0x1fbf52['getDescriptions'](_0x212b5c);}})[_0xe42e('0x22')](function(_0x10f170){if(_0x10f170){_0x325cc5=_0x10f170['length'];if(!_0x1cb875[_0xe42e('0x2c')][_0xe42e('0x33')](_0xe42e('0x34'))){_0x212b5c[_0xe42e('0x1a')]=qs['limit'](_0x1cb875['query'][_0xe42e('0x1a')]);_0x212b5c['offset']=qs[_0xe42e('0x1c')](_0x1cb875['query'][_0xe42e('0x1c')]);}return _0x1fbf52[_0xe42e('0x4d')](_0x212b5c);}})[_0xe42e('0x22')](function(_0x5a29a8){if(_0x5a29a8){return _0x5a29a8?{'count':_0x325cc5,'rows':_0x5a29a8}:null;}})[_0xe42e('0x22')](respondWithResult(_0x31d4f2,null))[_0xe42e('0x42')](handleError(_0x31d4f2,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 0fbe450..c47a13a 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 _0xec74=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xec74,0x163));var _0x4ec7=function(_0x37128b,_0x1b8034){_0x37128b=_0x37128b-0x0;var _0x527a8a=_0xec74[_0x37128b];return _0x527a8a;};'use strict';var _=require(_0x4ec7('0x0'));var util=require(_0x4ec7('0x1'));var logger=require(_0x4ec7('0x2'))(_0x4ec7('0x3'));var moment=require(_0x4ec7('0x4'));var BPromise=require(_0x4ec7('0x5'));var rp=require(_0x4ec7('0x6'));var fs=require('fs');var path=require(_0x4ec7('0x7'));var rimraf=require(_0x4ec7('0x8'));var config=require('../../config/environment');var attributes=require(_0x4ec7('0x9'));module[_0x4ec7('0xa')]=function(_0x4f77b4,_0x5b96dd){return _0x4f77b4[_0x4ec7('0xb')](_0x4ec7('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa16b=['path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0xa16b,0x15c));var _0xba16=function(_0x3c2943,_0x4ce5d3){_0x3c2943=_0x3c2943-0x0;var _0x24dbb2=_0xa16b[_0x3c2943];return _0x24dbb2;};'use strict';var _=require(_0xba16('0x0'));var util=require(_0xba16('0x1'));var logger=require('../../config/logger')(_0xba16('0x2'));var moment=require(_0xba16('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba16('0x4'));var rimraf=require('rimraf');var config=require(_0xba16('0x5'));var attributes=require(_0xba16('0x6'));module[_0xba16('0x7')]=function(_0x3118d2,_0x5c86a2){return _0x3118d2[_0xba16('0x8')](_0xba16('0x9'),attributes,{'tableName':_0xba16('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 68a9579..7bf27be 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 _0xd519=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0x46d077,_0x468dde){var _0x1aa67f=function(_0x10025b){while(--_0x10025b){_0x46d077['push'](_0x46d077['shift']());}};_0x1aa67f(++_0x468dde);}(_0xd519,0x1a0));var _0x9d51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd519[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d51('0x0'));var util=require('util');var moment=require(_0x9d51('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d51('0x2'));var db=require(_0x9d51('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d51('0x4'))(_0x9d51('0x5'));var config=require(_0x9d51('0x6'));var jayson=require(_0x9d51('0x7'));var client=jayson[_0x9d51('0x8')][_0x9d51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3544c3,_0x1e3a38,_0x44e774){return new BPromise(function(_0x9314bf,_0x6dc6d9){return client[_0x9d51('0xa')](_0x3544c3,_0x44e774)[_0x9d51('0xb')](function(_0x698771){logger['info'](_0x9d51('0xc'),_0x1e3a38,_0x9d51('0xd'));logger[_0x9d51('0xe')](_0x9d51('0xf'),_0x1e3a38,_0x9d51('0xd'),JSON[_0x9d51('0x10')](_0x698771));if(_0x698771[_0x9d51('0x11')]){if(_0x698771['error']['code']===0x1f4){logger[_0x9d51('0x11')](_0x9d51('0xc'),_0x1e3a38,_0x698771[_0x9d51('0x11')][_0x9d51('0x12')]);return _0x6dc6d9(_0x698771[_0x9d51('0x11')][_0x9d51('0x12')]);}logger['error'](_0x9d51('0xc'),_0x1e3a38,_0x698771[_0x9d51('0x11')][_0x9d51('0x12')]);return _0x9314bf(_0x698771['error'][_0x9d51('0x12')]);}else{logger[_0x9d51('0x13')](_0x9d51('0xc'),_0x1e3a38,_0x9d51('0xd'));_0x9314bf(_0x698771['result']['message']);}})[_0x9d51('0x14')](function(_0x375ba0){logger[_0x9d51('0x11')](_0x9d51('0xc'),_0x1e3a38,_0x375ba0);_0x6dc6d9(_0x375ba0);});});} \ No newline at end of file +var _0x2fc5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x30ff32,_0x2e47e9){var _0x355cce=function(_0x12f6a0){while(--_0x12f6a0){_0x30ff32['push'](_0x30ff32['shift']());}};_0x355cce(++_0x2e47e9);}(_0x2fc5,0x11c));var _0x52fc=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x2fc5[_0x21f931];return _0x3f083c;};'use strict';var _=require('lodash');var util=require(_0x52fc('0x0'));var moment=require(_0x52fc('0x1'));var BPromise=require(_0x52fc('0x2'));var rs=require(_0x52fc('0x3'));var fs=require('fs');var Redis=require(_0x52fc('0x4'));var db=require(_0x52fc('0x5'))['db'];var utils=require(_0x52fc('0x6'));var logger=require(_0x52fc('0x7'))(_0x52fc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x52fc('0x9')][_0x52fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x303a5c,_0x541918,_0x3d5765){return new BPromise(function(_0x4e581e,_0x358f4e){return client[_0x52fc('0xb')](_0x303a5c,_0x3d5765)[_0x52fc('0xc')](function(_0x436b50){logger[_0x52fc('0xd')](_0x52fc('0xe'),_0x541918,_0x52fc('0xf'));logger[_0x52fc('0x10')](_0x52fc('0x11'),_0x541918,'request\x20sent',JSON[_0x52fc('0x12')](_0x436b50));if(_0x436b50[_0x52fc('0x13')]){if(_0x436b50[_0x52fc('0x13')][_0x52fc('0x14')]===0x1f4){logger[_0x52fc('0x13')](_0x52fc('0xe'),_0x541918,_0x436b50[_0x52fc('0x13')][_0x52fc('0x15')]);return _0x358f4e(_0x436b50[_0x52fc('0x13')][_0x52fc('0x15')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x541918,_0x436b50[_0x52fc('0x13')][_0x52fc('0x15')]);return _0x4e581e(_0x436b50['error']['message']);}else{logger[_0x52fc('0xd')](_0x52fc('0xe'),_0x541918,_0x52fc('0xf'));_0x4e581e(_0x436b50[_0x52fc('0x16')][_0x52fc('0x15')]);}})[_0x52fc('0x17')](function(_0x4babae){logger[_0x52fc('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x541918,_0x4babae);_0x358f4e(_0x4babae);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f3315c4..9139a16 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 _0xa21e=['/:id','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post','create','put','update','delete'];(function(_0x546d33,_0x174ec9){var _0x45b8a5=function(_0x24920c){while(--_0x24920c){_0x546d33['push'](_0x546d33['shift']());}};_0x45b8a5(++_0x174ec9);}(_0xa21e,0xe5));var _0xea21=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0xa21e[_0x680821];return _0x3f132c;};'use strict';var multer=require(_0xea21('0x0'));var util=require(_0xea21('0x1'));var path=require(_0xea21('0x2'));var timeout=require(_0xea21('0x3'));var express=require(_0xea21('0x4'));var router=express['Router']();var fs_extra=require(_0xea21('0x5'));var auth=require(_0xea21('0x6'));var interaction=require(_0xea21('0x7'));var config=require(_0xea21('0x8'));var controller=require(_0xea21('0x9'));router[_0xea21('0xa')]('/',auth[_0xea21('0xb')](),controller['index']);router['get']('/:id',auth[_0xea21('0xb')](),controller[_0xea21('0xc')]);router[_0xea21('0xd')]('/',auth[_0xea21('0xb')](),controller[_0xea21('0xe')]);router[_0xea21('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xea21('0x10')]);router[_0xea21('0x11')](_0xea21('0x12'),auth[_0xea21('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe504=['exports','multer','util','path','express','fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xe504,0x144));var _0x4e50=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe504[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x4e50('0x0'));var util=require(_0x4e50('0x1'));var path=require(_0x4e50('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e50('0x3'));var router=express['Router']();var fs_extra=require(_0x4e50('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e50('0x5'));var controller=require(_0x4e50('0x6'));router[_0x4e50('0x7')]('/',auth[_0x4e50('0x8')](),controller[_0x4e50('0x9')]);router[_0x4e50('0x7')](_0x4e50('0xa'),auth[_0x4e50('0x8')](),controller['show']);router[_0x4e50('0xb')]('/',auth[_0x4e50('0x8')](),controller[_0x4e50('0xc')]);router['put'](_0x4e50('0xa'),auth['isAuthenticated'](),controller[_0x4e50('0xd')]);router[_0x4e50('0xe')](_0x4e50('0xa'),auth[_0x4e50('0x8')](),controller[_0x4e50('0xf')]);module[_0x4e50('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 994f517..b1238c5 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 _0x3ef4=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x4cb231,_0x3d3c5b){var _0x4d5063=function(_0x4af9d0){while(--_0x4af9d0){_0x4cb231['push'](_0x4cb231['shift']());}};_0x4d5063(++_0x3d3c5b);}(_0x3ef4,0x149));var _0x43ef=function(_0x5ca7b8,_0x1d8f03){_0x5ca7b8=_0x5ca7b8-0x0;var _0x58e84e=_0x3ef4[_0x5ca7b8];return _0x58e84e;};'use strict';var Sequelize=require(_0x43ef('0x0'));module[_0x43ef('0x1')]={'type':{'type':Sequelize[_0x43ef('0x2')](_0x43ef('0x3'),_0x43ef('0x4'),'customVariable',_0x43ef('0x5'),_0x43ef('0x6')),'defaultValue':_0x43ef('0x3')},'content':{'type':Sequelize[_0x43ef('0x7')]},'key':{'type':Sequelize[_0x43ef('0x7')]},'keyType':{'type':Sequelize[_0x43ef('0x2')](_0x43ef('0x3'),_0x43ef('0x4'),_0x43ef('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x43ef('0x7')]},'nameField':{'type':Sequelize[_0x43ef('0x7')]},'customField':{'type':Sequelize[_0x43ef('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbd71=['customVariable','keyValue','picklist','STRING','exports','ENUM','string','variable'];(function(_0xae193,_0x48a21e){var _0x17a04f=function(_0x101147){while(--_0x101147){_0xae193['push'](_0xae193['shift']());}};_0x17a04f(++_0x48a21e);}(_0xbd71,0x174));var _0x1bd7=function(_0x20f0be,_0x3085c0){_0x20f0be=_0x20f0be-0x0;var _0x71eb9=_0xbd71[_0x20f0be];return _0x71eb9;};'use strict';var Sequelize=require('sequelize');module[_0x1bd7('0x0')]={'type':{'type':Sequelize[_0x1bd7('0x1')](_0x1bd7('0x2'),_0x1bd7('0x3'),_0x1bd7('0x4'),_0x1bd7('0x5'),_0x1bd7('0x6')),'defaultValue':_0x1bd7('0x2')},'content':{'type':Sequelize[_0x1bd7('0x7')]},'key':{'type':Sequelize[_0x1bd7('0x7')]},'keyType':{'type':Sequelize[_0x1bd7('0x1')](_0x1bd7('0x2'),'variable',_0x1bd7('0x4'))},'keyContent':{'type':Sequelize[_0x1bd7('0x7')]},'idField':{'type':Sequelize[_0x1bd7('0x7')]},'nameField':{'type':Sequelize[_0x1bd7('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1bd7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index d3713f7..587b622 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 _0x78a4=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','catch','show','params','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0xcfed91,_0x29b51b){var _0x42e245=function(_0x1a131c){while(--_0x1a131c){_0xcfed91['push'](_0xcfed91['shift']());}};_0x42e245(++_0x29b51b);}(_0x78a4,0x12c));var _0x478a=function(_0x21bfab,_0x2fee48){_0x21bfab=_0x21bfab-0x0;var _0x4db318=_0x78a4[_0x21bfab];return _0x4db318;};'use strict';var emlformat=require(_0x478a('0x0'));var rimraf=require(_0x478a('0x1'));var zipdir=require(_0x478a('0x2'));var jsonpatch=require(_0x478a('0x3'));var rp=require(_0x478a('0x4'));var moment=require(_0x478a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x478a('0x6'));var path=require(_0x478a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x478a('0x8'));var fs=require('fs');var fs_extra=require(_0x478a('0x9'));var _=require(_0x478a('0xa'));var squel=require('squel');var crypto=require(_0x478a('0xb'));var jsforce=require(_0x478a('0xc'));var deskjs=require(_0x478a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x478a('0xe'));var Papa=require(_0x478a('0xf'));var Redis=require('ioredis');var authService=require(_0x478a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x478a('0x11'));var hardwareService=require(_0x478a('0x12'));var logger=require('../../config/logger')(_0x478a('0x13'));var utils=require(_0x478a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x478a('0x15'));var db=require(_0x478a('0x16'))['db'];function respondWithStatusCode(_0x31ca9b,_0x269d78){_0x269d78=_0x269d78||0xcc;return function(_0x5844c4){if(_0x5844c4){return _0x31ca9b[_0x478a('0x17')](_0x269d78);}return _0x31ca9b['status'](_0x269d78)['end']();};}function respondWithResult(_0x174b9f,_0x15c2f0){_0x15c2f0=_0x15c2f0||0xc8;return function(_0x5ed697){if(_0x5ed697){return _0x174b9f[_0x478a('0x18')](_0x15c2f0)[_0x478a('0x19')](_0x5ed697);}};}function respondWithFilteredResult(_0x4b9153,_0x3d5778){return function(_0x352e3c){if(_0x352e3c){var _0x4d7265=typeof _0x3d5778[_0x478a('0x1a')]===_0x478a('0x1b')&&typeof _0x3d5778[_0x478a('0x1c')]===_0x478a('0x1b');var _0x7a569d=_0x352e3c['count'];var _0x13c752=_0x4d7265?0x0:_0x3d5778[_0x478a('0x1a')];var _0x48e447=_0x4d7265?_0x352e3c[_0x478a('0x1d')]:_0x3d5778[_0x478a('0x1a')]+_0x3d5778['limit'];var _0x14a3c7;if(_0x48e447>=_0x7a569d){_0x48e447=_0x7a569d;_0x14a3c7=0xc8;}else{_0x14a3c7=0xce;}_0x4b9153[_0x478a('0x18')](_0x14a3c7);return _0x4b9153[_0x478a('0x1e')](_0x478a('0x1f'),_0x13c752+'-'+_0x48e447+'/'+_0x7a569d)[_0x478a('0x19')](_0x352e3c);}return null;};}function patchUpdates(_0x4b8d48){return function(_0x86f711){try{jsonpatch[_0x478a('0x20')](_0x86f711,_0x4b8d48,!![]);}catch(_0x3cfc5c){return BPromise[_0x478a('0x21')](_0x3cfc5c);}return _0x86f711[_0x478a('0x22')]();};}function saveUpdates(_0x5826dd,_0x549828){return function(_0x39d8e2){if(_0x39d8e2){return _0x39d8e2['update'](_0x5826dd)['then'](function(_0x3b1612){return _0x3b1612;});}return null;};}function removeEntity(_0x6de6f6,_0x12abe8){return function(_0x25ce79){if(_0x25ce79){return _0x25ce79[_0x478a('0x23')]()[_0x478a('0x24')](function(){_0x6de6f6[_0x478a('0x18')](0xcc)[_0x478a('0x25')]();});}};}function handleEntityNotFound(_0x5ba527,_0xf67f01){return function(_0x22d923){if(!_0x22d923){_0x5ba527['sendStatus'](0x194);}return _0x22d923;};}function handleError(_0xf50e9a,_0x3aac8d){_0x3aac8d=_0x3aac8d||0x1f4;return function(_0x18e32a){logger[_0x478a('0x26')](_0x18e32a[_0x478a('0x27')]);if(_0x18e32a[_0x478a('0x28')]){delete _0x18e32a[_0x478a('0x28')];}_0xf50e9a['status'](_0x3aac8d)[_0x478a('0x29')](_0x18e32a);};}exports[_0x478a('0x2a')]=function(_0x1824ec,_0x2558ca){var _0x4a5c7d={},_0x2dc9b8={},_0x4bfdc7={'count':0x0,'rows':[]};var _0x2cb298=_['map'](db['ZohoField'][_0x478a('0x2b')],function(_0x36af80){return{'name':_0x36af80[_0x478a('0x2c')],'type':_0x36af80[_0x478a('0x2d')][_0x478a('0x2e')]};});_0x2dc9b8[_0x478a('0x2f')]=_[_0x478a('0x30')](_0x2cb298,_0x478a('0x28'));_0x2dc9b8['query']=_[_0x478a('0x31')](_0x1824ec[_0x478a('0x32')]);_0x2dc9b8[_0x478a('0x33')]=_[_0x478a('0x34')](_0x2dc9b8[_0x478a('0x2f')],_0x2dc9b8['query']);_0x4a5c7d['attributes']=_['intersection'](_0x2dc9b8[_0x478a('0x2f')],qs['fields'](_0x1824ec[_0x478a('0x32')][_0x478a('0x35')]));_0x4a5c7d[_0x478a('0x36')]=_0x4a5c7d[_0x478a('0x36')][_0x478a('0x37')]?_0x4a5c7d['attributes']:_0x2dc9b8[_0x478a('0x2f')];if(!_0x1824ec[_0x478a('0x32')][_0x478a('0x38')](_0x478a('0x39'))){_0x4a5c7d[_0x478a('0x1c')]=qs[_0x478a('0x1c')](_0x1824ec[_0x478a('0x32')][_0x478a('0x1c')]);_0x4a5c7d[_0x478a('0x1a')]=qs['offset'](_0x1824ec[_0x478a('0x32')][_0x478a('0x1a')]);}_0x4a5c7d[_0x478a('0x3a')]=qs[_0x478a('0x3b')](_0x1824ec[_0x478a('0x32')][_0x478a('0x3b')]);_0x4a5c7d[_0x478a('0x3c')]=qs[_0x478a('0x33')](_[_0x478a('0x3d')](_0x1824ec[_0x478a('0x32')],_0x2dc9b8[_0x478a('0x33')]),_0x2cb298);if(_0x1824ec['query'][_0x478a('0x3e')]){_0x4a5c7d[_0x478a('0x3c')]=_[_0x478a('0x3f')](_0x4a5c7d[_0x478a('0x3c')],{'$or':_[_0x478a('0x30')](_0x2cb298,function(_0xe92359){if(_0xe92359['type']!==_0x478a('0x40')){var _0x4e58c3={};_0x4e58c3[_0xe92359[_0x478a('0x28')]]={'$like':'%'+_0x1824ec[_0x478a('0x32')][_0x478a('0x3e')]+'%'};return _0x4e58c3;}})});}_0x4a5c7d=_[_0x478a('0x3f')]({},_0x4a5c7d,_0x1824ec[_0x478a('0x41')]);var _0x4749f9={'where':_0x4a5c7d[_0x478a('0x3c')]};return db[_0x478a('0x42')][_0x478a('0x1d')](_0x4749f9)[_0x478a('0x24')](function(_0xd5aa01){_0x4bfdc7['count']=_0xd5aa01;if(_0x1824ec[_0x478a('0x32')][_0x478a('0x43')]){_0x4a5c7d[_0x478a('0x44')]=[{'all':!![]}];}return db[_0x478a('0x42')][_0x478a('0x45')](_0x4a5c7d);})[_0x478a('0x24')](function(_0x4c031f){_0x4bfdc7['rows']=_0x4c031f;return _0x4bfdc7;})[_0x478a('0x24')](respondWithFilteredResult(_0x2558ca,_0x4a5c7d))[_0x478a('0x46')](handleError(_0x2558ca,null));};exports[_0x478a('0x47')]=function(_0x5e4d78,_0xe2e3b4){var _0x5acf3f={'raw':!![],'where':{'id':_0x5e4d78[_0x478a('0x48')]['id']}},_0xd6d7c1={};_0xd6d7c1[_0x478a('0x2f')]=_['keys'](db['ZohoField'][_0x478a('0x2b')]);_0xd6d7c1[_0x478a('0x32')]=_[_0x478a('0x31')](_0x5e4d78[_0x478a('0x32')]);_0xd6d7c1[_0x478a('0x33')]=_[_0x478a('0x34')](_0xd6d7c1['model'],_0xd6d7c1[_0x478a('0x32')]);_0x5acf3f[_0x478a('0x36')]=_[_0x478a('0x34')](_0xd6d7c1[_0x478a('0x2f')],qs[_0x478a('0x35')](_0x5e4d78[_0x478a('0x32')][_0x478a('0x35')]));_0x5acf3f['attributes']=_0x5acf3f['attributes'][_0x478a('0x37')]?_0x5acf3f[_0x478a('0x36')]:_0xd6d7c1[_0x478a('0x2f')];if(_0x5e4d78['query'][_0x478a('0x43')]){_0x5acf3f[_0x478a('0x44')]=[{'all':!![]}];}_0x5acf3f=_[_0x478a('0x3f')]({},_0x5acf3f,_0x5e4d78[_0x478a('0x41')]);return db[_0x478a('0x42')][_0x478a('0x49')](_0x5acf3f)[_0x478a('0x24')](handleEntityNotFound(_0xe2e3b4,null))[_0x478a('0x24')](respondWithResult(_0xe2e3b4,null))[_0x478a('0x46')](handleError(_0xe2e3b4,null));};exports['create']=function(_0x3ba3dd,_0x9bd03b){return db[_0x478a('0x42')][_0x478a('0x4a')](_0x3ba3dd['body'],{})['then'](respondWithResult(_0x9bd03b,0xc9))[_0x478a('0x46')](handleError(_0x9bd03b,null));};exports[_0x478a('0x4b')]=function(_0x129b49,_0xa4ed65){if(_0x129b49[_0x478a('0x4c')]['id']){delete _0x129b49[_0x478a('0x4c')]['id'];}return db[_0x478a('0x42')]['find']({'where':{'id':_0x129b49[_0x478a('0x48')]['id']}})['then'](handleEntityNotFound(_0xa4ed65,null))[_0x478a('0x24')](saveUpdates(_0x129b49[_0x478a('0x4c')],null))[_0x478a('0x24')](respondWithResult(_0xa4ed65,null))[_0x478a('0x46')](handleError(_0xa4ed65,null));};exports['destroy']=function(_0x1ed535,_0x1de4e2){return db[_0x478a('0x42')][_0x478a('0x49')]({'where':{'id':_0x1ed535[_0x478a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1de4e2,null))[_0x478a('0x24')](removeEntity(_0x1de4e2,null))[_0x478a('0x46')](handleError(_0x1de4e2,null));}; \ No newline at end of file +var _0xcceb=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x21b907,_0x29f43f){var _0xaf56b5=function(_0x19d25c){while(--_0x19d25c){_0x21b907['push'](_0x21b907['shift']());}};_0xaf56b5(++_0x29f43f);}(_0xcceb,0x79));var _0xbcce=function(_0x9e7f3a,_0x37105f){_0x9e7f3a=_0x9e7f3a-0x0;var _0x5ab145=_0xcceb[_0x9e7f3a];return _0x5ab145;};'use strict';var emlformat=require(_0xbcce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcce('0x1'));var jsonpatch=require(_0xbcce('0x2'));var rp=require(_0xbcce('0x3'));var moment=require(_0xbcce('0x4'));var BPromise=require(_0xbcce('0x5'));var Mustache=require(_0xbcce('0x6'));var util=require(_0xbcce('0x7'));var path=require(_0xbcce('0x8'));var sox=require(_0xbcce('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbcce('0xa'));var squel=require('squel');var crypto=require(_0xbcce('0xb'));var jsforce=require(_0xbcce('0xc'));var deskjs=require(_0xbcce('0xd'));var toCsv=require(_0xbcce('0xe'));var querystring=require('querystring');var Papa=require(_0xbcce('0xf'));var Redis=require(_0xbcce('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbcce('0x11'));var as=require(_0xbcce('0x12'));var hardwareService=require(_0xbcce('0x13'));var logger=require(_0xbcce('0x14'))('api');var utils=require(_0xbcce('0x15'));var config=require(_0xbcce('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcce('0x17'))['db'];function respondWithStatusCode(_0x394f7d,_0x1e0888){_0x1e0888=_0x1e0888||0xcc;return function(_0x22f3f2){if(_0x22f3f2){return _0x394f7d[_0xbcce('0x18')](_0x1e0888);}return _0x394f7d[_0xbcce('0x19')](_0x1e0888)['end']();};}function respondWithResult(_0x102d83,_0x2cb81a){_0x2cb81a=_0x2cb81a||0xc8;return function(_0x587a4e){if(_0x587a4e){return _0x102d83[_0xbcce('0x19')](_0x2cb81a)['json'](_0x587a4e);}};}function respondWithFilteredResult(_0x4b8291,_0x3fcf06){return function(_0x3288c7){if(_0x3288c7){var _0x445cfc=typeof _0x3fcf06[_0xbcce('0x1a')]===_0xbcce('0x1b')&&typeof _0x3fcf06['limit']===_0xbcce('0x1b');var _0x43adfe=_0x3288c7['count'];var _0x12bade=_0x445cfc?0x0:_0x3fcf06[_0xbcce('0x1a')];var _0x10067f=_0x445cfc?_0x3288c7[_0xbcce('0x1c')]:_0x3fcf06[_0xbcce('0x1a')]+_0x3fcf06[_0xbcce('0x1d')];var _0x2b800c;if(_0x10067f>=_0x43adfe){_0x10067f=_0x43adfe;_0x2b800c=0xc8;}else{_0x2b800c=0xce;}_0x4b8291[_0xbcce('0x19')](_0x2b800c);return _0x4b8291[_0xbcce('0x1e')]('Content-Range',_0x12bade+'-'+_0x10067f+'/'+_0x43adfe)['json'](_0x3288c7);}return null;};}function patchUpdates(_0x2ed255){return function(_0x160c7d){try{jsonpatch[_0xbcce('0x1f')](_0x160c7d,_0x2ed255,!![]);}catch(_0x5d29f0){return BPromise[_0xbcce('0x20')](_0x5d29f0);}return _0x160c7d['save']();};}function saveUpdates(_0x48ba85,_0x35f216){return function(_0x3fe48e){if(_0x3fe48e){return _0x3fe48e[_0xbcce('0x21')](_0x48ba85)[_0xbcce('0x22')](function(_0x1c0dd0){return _0x1c0dd0;});}return null;};}function removeEntity(_0x506f33,_0x100cfc){return function(_0x553da3){if(_0x553da3){return _0x553da3[_0xbcce('0x23')]()[_0xbcce('0x22')](function(){_0x506f33[_0xbcce('0x19')](0xcc)[_0xbcce('0x24')]();});}};}function handleEntityNotFound(_0x4a6b9f,_0x1332dd){return function(_0x1364f3){if(!_0x1364f3){_0x4a6b9f['sendStatus'](0x194);}return _0x1364f3;};}function handleError(_0x10a284,_0x5c9c8a){_0x5c9c8a=_0x5c9c8a||0x1f4;return function(_0x5ca875){logger[_0xbcce('0x25')](_0x5ca875[_0xbcce('0x26')]);if(_0x5ca875[_0xbcce('0x27')]){delete _0x5ca875['name'];}_0x10a284[_0xbcce('0x19')](_0x5c9c8a)[_0xbcce('0x28')](_0x5ca875);};}exports['index']=function(_0x1f62c5,_0xfe7657){var _0x406814={},_0x277e7b={},_0x51685d={'count':0x0,'rows':[]};var _0x5102aa=_[_0xbcce('0x29')](db[_0xbcce('0x2a')][_0xbcce('0x2b')],function(_0x1cd8aa){return{'name':_0x1cd8aa[_0xbcce('0x2c')],'type':_0x1cd8aa[_0xbcce('0x2d')][_0xbcce('0x2e')]};});_0x277e7b['model']=_[_0xbcce('0x29')](_0x5102aa,'name');_0x277e7b[_0xbcce('0x2f')]=_[_0xbcce('0x30')](_0x1f62c5[_0xbcce('0x2f')]);_0x277e7b[_0xbcce('0x31')]=_['intersection'](_0x277e7b[_0xbcce('0x32')],_0x277e7b['query']);_0x406814['attributes']=_[_0xbcce('0x33')](_0x277e7b[_0xbcce('0x32')],qs[_0xbcce('0x34')](_0x1f62c5['query']['fields']));_0x406814[_0xbcce('0x35')]=_0x406814[_0xbcce('0x35')][_0xbcce('0x36')]?_0x406814[_0xbcce('0x35')]:_0x277e7b['model'];if(!_0x1f62c5[_0xbcce('0x2f')][_0xbcce('0x37')](_0xbcce('0x38'))){_0x406814[_0xbcce('0x1d')]=qs[_0xbcce('0x1d')](_0x1f62c5['query'][_0xbcce('0x1d')]);_0x406814[_0xbcce('0x1a')]=qs[_0xbcce('0x1a')](_0x1f62c5[_0xbcce('0x2f')][_0xbcce('0x1a')]);}_0x406814['order']=qs[_0xbcce('0x39')](_0x1f62c5[_0xbcce('0x2f')][_0xbcce('0x39')]);_0x406814[_0xbcce('0x3a')]=qs[_0xbcce('0x31')](_[_0xbcce('0x3b')](_0x1f62c5[_0xbcce('0x2f')],_0x277e7b[_0xbcce('0x31')]),_0x5102aa);if(_0x1f62c5['query'][_0xbcce('0x3c')]){_0x406814[_0xbcce('0x3a')]=_[_0xbcce('0x3d')](_0x406814['where'],{'$or':_[_0xbcce('0x29')](_0x5102aa,function(_0x107e01){if(_0x107e01[_0xbcce('0x2d')]!=='VIRTUAL'){var _0x45644c={};_0x45644c[_0x107e01[_0xbcce('0x27')]]={'$like':'%'+_0x1f62c5[_0xbcce('0x2f')][_0xbcce('0x3c')]+'%'};return _0x45644c;}})});}_0x406814=_[_0xbcce('0x3d')]({},_0x406814,_0x1f62c5['options']);var _0x5e9c13={'where':_0x406814[_0xbcce('0x3a')]};return db[_0xbcce('0x2a')][_0xbcce('0x1c')](_0x5e9c13)[_0xbcce('0x22')](function(_0xfbd9e1){_0x51685d[_0xbcce('0x1c')]=_0xfbd9e1;if(_0x1f62c5[_0xbcce('0x2f')][_0xbcce('0x3e')]){_0x406814[_0xbcce('0x3f')]=[{'all':!![]}];}return db[_0xbcce('0x2a')]['findAll'](_0x406814);})[_0xbcce('0x22')](function(_0x2be5fa){_0x51685d[_0xbcce('0x40')]=_0x2be5fa;return _0x51685d;})['then'](respondWithFilteredResult(_0xfe7657,_0x406814))[_0xbcce('0x41')](handleError(_0xfe7657,null));};exports[_0xbcce('0x42')]=function(_0x10c69f,_0x2990e7){var _0x11bca1={'raw':!![],'where':{'id':_0x10c69f[_0xbcce('0x43')]['id']}},_0x1dc298={};_0x1dc298[_0xbcce('0x32')]=_[_0xbcce('0x30')](db[_0xbcce('0x2a')]['rawAttributes']);_0x1dc298[_0xbcce('0x2f')]=_[_0xbcce('0x30')](_0x10c69f[_0xbcce('0x2f')]);_0x1dc298[_0xbcce('0x31')]=_[_0xbcce('0x33')](_0x1dc298['model'],_0x1dc298['query']);_0x11bca1[_0xbcce('0x35')]=_[_0xbcce('0x33')](_0x1dc298[_0xbcce('0x32')],qs['fields'](_0x10c69f[_0xbcce('0x2f')]['fields']));_0x11bca1['attributes']=_0x11bca1['attributes'][_0xbcce('0x36')]?_0x11bca1[_0xbcce('0x35')]:_0x1dc298[_0xbcce('0x32')];if(_0x10c69f['query'][_0xbcce('0x3e')]){_0x11bca1[_0xbcce('0x3f')]=[{'all':!![]}];}_0x11bca1=_[_0xbcce('0x3d')]({},_0x11bca1,_0x10c69f['options']);return db['ZohoField']['find'](_0x11bca1)[_0xbcce('0x22')](handleEntityNotFound(_0x2990e7,null))[_0xbcce('0x22')](respondWithResult(_0x2990e7,null))[_0xbcce('0x41')](handleError(_0x2990e7,null));};exports[_0xbcce('0x44')]=function(_0x43344,_0x1b7f59){return db[_0xbcce('0x2a')][_0xbcce('0x44')](_0x43344['body'],{})[_0xbcce('0x22')](respondWithResult(_0x1b7f59,0xc9))[_0xbcce('0x41')](handleError(_0x1b7f59,null));};exports[_0xbcce('0x21')]=function(_0x4d4864,_0x576ca6){if(_0x4d4864[_0xbcce('0x45')]['id']){delete _0x4d4864['body']['id'];}return db['ZohoField']['find']({'where':{'id':_0x4d4864[_0xbcce('0x43')]['id']}})[_0xbcce('0x22')](handleEntityNotFound(_0x576ca6,null))['then'](saveUpdates(_0x4d4864[_0xbcce('0x45')],null))[_0xbcce('0x22')](respondWithResult(_0x576ca6,null))[_0xbcce('0x41')](handleError(_0x576ca6,null));};exports[_0xbcce('0x23')]=function(_0x3da55f,_0x27d581){return db[_0xbcce('0x2a')][_0xbcce('0x46')]({'where':{'id':_0x3da55f[_0xbcce('0x43')]['id']}})[_0xbcce('0x22')](handleEntityNotFound(_0x27d581,null))[_0xbcce('0x22')](removeEntity(_0x27d581,null))[_0xbcce('0x41')](handleError(_0x27d581,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index f086cf5..fd51690 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 _0x781d=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x781d,0x14a));var _0xd781=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x781d[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd781('0x2'));var BPromise=require(_0xd781('0x3'));var rp=require(_0xd781('0x4'));var fs=require('fs');var path=require(_0xd781('0x5'));var rimraf=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var attributes=require(_0xd781('0x8'));module[_0xd781('0x9')]=function(_0x830b,_0x2f98ee){return _0x830b['define'](_0xd781('0xa'),attributes,{'tableName':_0xd781('0xb'),'paranoid':![],'indexes':[{'name':_0xd781('0xc'),'fields':[_0xd781('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId'];(function(_0x4e3b13,_0xdde621){var _0x30dbfa=function(_0x330318){while(--_0x330318){_0x4e3b13['push'](_0x4e3b13['shift']());}};_0x30dbfa(++_0xdde621);}(_0x5fab,0x177));var _0xb5fa=function(_0x55a777,_0x2c95f7){_0x55a777=_0x55a777-0x0;var _0x8ca6a1=_0x5fab[_0x55a777];return _0x8ca6a1;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['idField',_0xb5fa('0xe')],'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 a868c5c..b3460f1 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 _0xcc99=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcc99,0x7b));var _0x9cc9=function(_0x2698b5,_0x2faad4){_0x2698b5=_0x2698b5-0x0;var _0x5375c1=_0xcc99[_0x2698b5];return _0x5375c1;};'use strict';var _=require(_0x9cc9('0x0'));var util=require(_0x9cc9('0x1'));var moment=require(_0x9cc9('0x2'));var BPromise=require(_0x9cc9('0x3'));var rs=require(_0x9cc9('0x4'));var fs=require('fs');var Redis=require(_0x9cc9('0x5'));var db=require(_0x9cc9('0x6'))['db'];var utils=require(_0x9cc9('0x7'));var logger=require(_0x9cc9('0x8'))(_0x9cc9('0x9'));var config=require(_0x9cc9('0xa'));var jayson=require(_0x9cc9('0xb'));var client=jayson[_0x9cc9('0xc')][_0x9cc9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3f5a7e,_0x40b7e2,_0x363f4b){return new BPromise(function(_0x586c36,_0x98cc93){return client[_0x9cc9('0xe')](_0x3f5a7e,_0x363f4b)[_0x9cc9('0xf')](function(_0x44da09){logger[_0x9cc9('0x10')]('ZohoField,\x20%s,\x20%s',_0x40b7e2,_0x9cc9('0x11'));logger[_0x9cc9('0x12')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x40b7e2,'request\x20sent',JSON[_0x9cc9('0x13')](_0x44da09));if(_0x44da09[_0x9cc9('0x14')]){if(_0x44da09[_0x9cc9('0x14')][_0x9cc9('0x15')]===0x1f4){logger['error'](_0x9cc9('0x16'),_0x40b7e2,_0x44da09['error']['message']);return _0x98cc93(_0x44da09[_0x9cc9('0x14')]['message']);}logger[_0x9cc9('0x14')](_0x9cc9('0x16'),_0x40b7e2,_0x44da09[_0x9cc9('0x14')][_0x9cc9('0x17')]);return _0x586c36(_0x44da09[_0x9cc9('0x14')][_0x9cc9('0x17')]);}else{logger[_0x9cc9('0x10')](_0x9cc9('0x16'),_0x40b7e2,_0x9cc9('0x11'));_0x586c36(_0x44da09[_0x9cc9('0x18')][_0x9cc9('0x17')]);}})[_0x9cc9('0x19')](function(_0x3302e9){logger['error'](_0x9cc9('0x16'),_0x40b7e2,_0x3302e9);_0x98cc93(_0x3302e9);});});} \ No newline at end of file +var _0x1d4a=['jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1cc04c,_0x409d3e){var _0x4642c8=function(_0x135c4a){while(--_0x135c4a){_0x1cc04c['push'](_0x1cc04c['shift']());}};_0x4642c8(++_0x409d3e);}(_0x1d4a,0x12d));var _0xa1d4=function(_0x29a662,_0x7202bc){_0x29a662=_0x29a662-0x0;var _0x14ec68=_0x1d4a[_0x29a662];return _0x14ec68;};'use strict';var _=require(_0xa1d4('0x0'));var util=require(_0xa1d4('0x1'));var moment=require(_0xa1d4('0x2'));var BPromise=require(_0xa1d4('0x3'));var rs=require(_0xa1d4('0x4'));var fs=require('fs');var Redis=require(_0xa1d4('0x5'));var db=require(_0xa1d4('0x6'))['db'];var utils=require(_0xa1d4('0x7'));var logger=require(_0xa1d4('0x8'))(_0xa1d4('0x9'));var config=require(_0xa1d4('0xa'));var jayson=require(_0xa1d4('0xb'));var client=jayson['client'][_0xa1d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xafbacc,_0x20ac2a,_0x34bdf6){return new BPromise(function(_0x5ee0f8,_0x5a63a5){return client[_0xa1d4('0xd')](_0xafbacc,_0x34bdf6)[_0xa1d4('0xe')](function(_0x42e823){logger[_0xa1d4('0xf')](_0xa1d4('0x10'),_0x20ac2a,_0xa1d4('0x11'));logger[_0xa1d4('0x12')](_0xa1d4('0x13'),_0x20ac2a,_0xa1d4('0x11'),JSON[_0xa1d4('0x14')](_0x42e823));if(_0x42e823[_0xa1d4('0x15')]){if(_0x42e823[_0xa1d4('0x15')][_0xa1d4('0x16')]===0x1f4){logger[_0xa1d4('0x15')](_0xa1d4('0x10'),_0x20ac2a,_0x42e823[_0xa1d4('0x15')][_0xa1d4('0x17')]);return _0x5a63a5(_0x42e823[_0xa1d4('0x15')][_0xa1d4('0x17')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x20ac2a,_0x42e823[_0xa1d4('0x15')][_0xa1d4('0x17')]);return _0x5ee0f8(_0x42e823[_0xa1d4('0x15')][_0xa1d4('0x17')]);}else{logger[_0xa1d4('0xf')]('ZohoField,\x20%s,\x20%s',_0x20ac2a,'request\x20sent');_0x5ee0f8(_0x42e823[_0xa1d4('0x18')][_0xa1d4('0x17')]);}})[_0xa1d4('0x19')](function(_0x2cb2a0){logger[_0xa1d4('0x15')](_0xa1d4('0x10'),_0x20ac2a,_0x2cb2a0);_0x5a63a5(_0x2cb2a0);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 96d6ccd..78f24bf 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x253f58,_0x2e5e9a){var _0x1ea894=function(_0x42d864){while(--_0x42d864){_0x253f58['push'](_0x253f58['shift']());}};_0x1ea894(++_0x2e5e9a);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xa369e0,_0x15ec2f){var _0x5052b0=function(_0x32388d){while(--_0x32388d){_0xa369e0['push'](_0xa369e0['shift']());}};_0x5052b0(++_0x15ec2f);}(_0xe706,0xa3));var _0x6e70=function(_0xff5684,_0xfe6e00){_0xff5684=_0xff5684-0x0;var _0x41e374=_0xe706[_0xff5684];return _0x41e374;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index f83736b..8f9dc09 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 _0xe7b9=['INTEGER','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x3ea8b8,_0x508efb){var _0x7d213f=function(_0x13c1e1){while(--_0x13c1e1){_0x3ea8b8['push'](_0x3ea8b8['shift']());}};_0x7d213f(++_0x508efb);}(_0xe7b9,0x170));var _0x9e7b=function(_0x1eb874,_0x3f506){_0x1eb874=_0x1eb874-0x0;var _0x4265e0=_0xe7b9[_0x1eb874];return _0x4265e0;};'use strict';var Sequelize=require(_0x9e7b('0x0'));module[_0x9e7b('0x1')]={'name':{'type':Sequelize[_0x9e7b('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9e7b('0x3')},'main':{'type':Sequelize[_0x9e7b('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x9e7b('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x9e7b('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x9e7b('0x2')]},'state':{'type':Sequelize[_0x9e7b('0x2')],'unique':_0x9e7b('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x9e7b('0x2')]},'remoteUri':{'type':Sequelize[_0x9e7b('0x2')]},'link':{'type':Sequelize[_0x9e7b('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x42cb=['STRING','app.js','BOOLEAN','state'];(function(_0x41e34b,_0x115bbd){var _0x407e74=function(_0x383411){while(--_0x383411){_0x41e34b['push'](_0x41e34b['shift']());}};_0x407e74(++_0x115bbd);}(_0x42cb,0x178));var _0xb42c=function(_0x125336,_0x55839d){_0x125336=_0x125336-0x0;var _0xfa79c2=_0x42cb[_0x125336];return _0xfa79c2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb42c('0x0')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xb42c('0x0')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xb42c('0x0')],'defaultValue':_0xb42c('0x1')},'filename':{'type':Sequelize[_0xb42c('0x0')]},'path':{'type':Sequelize[_0xb42c('0x0')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xb42c('0x2')],'defaultValue':![]},'author':{'type':Sequelize[_0xb42c('0x0')]},'logo':{'type':Sequelize[_0xb42c('0x0')]},'state':{'type':Sequelize[_0xb42c('0x0')],'unique':_0xb42c('0x3')},'description':{'type':Sequelize[_0xb42c('0x0')]},'title':{'type':Sequelize[_0xb42c('0x0')]},'remoteUri':{'type':Sequelize[_0xb42c('0x0')]},'link':{'type':Sequelize[_0xb42c('0x0')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d6cc42a..86495e4 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xadb5,0xad));var _0x5adb=function(_0x4655db,_0x1e54e0){_0x4655db=_0x4655db-0x0;var _0x3e9b37=_0xadb5[_0x4655db];return _0x3e9b37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file +var _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x4864ea,_0x7764ed){var _0x12e74f=function(_0x3fe41d){while(--_0x3fe41d){_0x4864ea['push'](_0x4864ea['shift']());}};_0x12e74f(++_0x7764ed);}(_0x9582,0x95));var _0x2958=function(_0x3762de,_0x446e8d){_0x3762de=_0x3762de-0x0;var _0x17667c=_0x9582[_0x3762de];return _0x17667c;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 11a5557..cc29f9d 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 _0x8992=['moment','request-promise','path','rimraf','../../config/environment','./integration.attributes','define','Integration','util','../../config/logger','api'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x8992,0x17e));var _0x2899=function(_0x143291,_0x520ebc){_0x143291=_0x143291-0x0;var _0x4e56b5=_0x8992[_0x143291];return _0x4e56b5;};'use strict';var _=require('lodash');var util=require(_0x2899('0x0'));var logger=require(_0x2899('0x1'))(_0x2899('0x2'));var moment=require(_0x2899('0x3'));var BPromise=require('bluebird');var rp=require(_0x2899('0x4'));var fs=require('fs');var path=require(_0x2899('0x5'));var rimraf=require(_0x2899('0x6'));var config=require(_0x2899('0x7'));var attributes=require(_0x2899('0x8'));module['exports']=function(_0x18b7a9,_0x824c2){return _0x18b7a9[_0x2899('0x9')](_0x2899('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc1d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','Integration','integrations','lodash','util','api','moment'];(function(_0x3af2d9,_0x4a95fe){var _0x3bdac2=function(_0x58b6e4){while(--_0x58b6e4){_0x3af2d9['push'](_0x3af2d9['shift']());}};_0x3bdac2(++_0x4a95fe);}(_0xbc1d,0x98));var _0xdbc1=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xbc1d[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0xdbc1('0x0'));var util=require(_0xdbc1('0x1'));var logger=require('../../config/logger')(_0xdbc1('0x2'));var moment=require(_0xdbc1('0x3'));var BPromise=require(_0xdbc1('0x4'));var rp=require(_0xdbc1('0x5'));var fs=require('fs');var path=require(_0xdbc1('0x6'));var rimraf=require(_0xdbc1('0x7'));var config=require(_0xdbc1('0x8'));var attributes=require('./integration.attributes');module[_0xdbc1('0x9')]=function(_0x126f16,_0x1c2e8f){return _0x126f16['define'](_0xdbc1('0xa'),attributes,{'tableName':_0xdbc1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index e6abf4d..1b0799a 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x3bcb34,_0x591ff5){var _0x372e14=function(_0xa28c10){while(--_0xa28c10){_0x3bcb34['push'](_0x3bcb34['shift']());}};_0x372e14(++_0x591ff5);}(_0x66fa,0x117));var _0xa66f=function(_0x4dfbf2,_0x499fa5){_0x4dfbf2=_0x4dfbf2-0x0;var _0x56dd91=_0x66fa[_0x4dfbf2];return _0x56dd91;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x46435d,_0x37dce7){var _0x1c26dd=function(_0x3a3f01){while(--_0x3a3f01){_0x46435d['push'](_0x46435d['shift']());}};_0x1c26dd(++_0x37dce7);}(_0x1a85,0x178));var _0x51a8=function(_0x530804,_0x44e860){_0x530804=_0x530804-0x0;var _0x3c0f69=_0x1a85[_0x530804];return _0x3c0f69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index e3450c8..92a5c49 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 _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x4830fa,_0x6bc819){var _0x2f8d5b=function(_0x17704d){while(--_0x17704d){_0x4830fa['push'](_0x4830fa['shift']());}};_0x2f8d5b(++_0x6bc819);}(_0x1a85,0x178));var _0x51a8=function(_0x4660b9,_0x172664){_0x4660b9=_0x4660b9-0x0;var _0x3d0b6b=_0x1a85[_0x4660b9];return _0x3d0b6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x985714,_0x5b668c){var _0x190698=function(_0xea24ec){while(--_0xea24ec){_0x985714['push'](_0x985714['shift']());}};_0x190698(++_0x5b668c);}(_0x4975,0x86));var _0x5497=function(_0x5366ff,_0x36c411){_0x5366ff=_0x5366ff-0x0;var _0x347247=_0x4975[_0x5366ff];return _0x347247;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a43b71e..3c5f9b4 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 _0xaf1b=['TEXT','ENUM','RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x173eff,_0x55a7d0){var _0x119fbd=function(_0x31a223){while(--_0x31a223){_0x173eff['push'](_0x173eff['shift']());}};_0x119fbd(++_0x55a7d0);}(_0xaf1b,0x11b));var _0xbaf1=function(_0xd44ec5,_0x292510){_0xd44ec5=_0xd44ec5-0x0;var _0x256ed5=_0xaf1b[_0xd44ec5];return _0x256ed5;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module['exports']={'integration':{'type':Sequelize[_0xbaf1('0x1')]},'eventChannel':{'type':Sequelize[_0xbaf1('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xbaf1('0x2')]},'contacts':{'type':Sequelize[_0xbaf1('0x1')]},'uniqueid':{'type':Sequelize[_0xbaf1('0x1')]},'calleridnum':{'type':Sequelize[_0xbaf1('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xbaf1('0x1')]},'interface':{'type':Sequelize[_0xbaf1('0x1')]},'membername':{'type':Sequelize[_0xbaf1('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xbaf1('0x3')]},'holdtime':{'type':Sequelize[_0xbaf1('0x2')]},'agentcomplete':{'type':Sequelize[_0xbaf1('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xbaf1('0x2')]},'agentacw':{'type':Sequelize[_0xbaf1('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xbaf1('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xbaf1('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xbaf1('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xbaf1('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbaf1('0x1')]},'channelstate':{'type':Sequelize[_0xbaf1('0x2')]},'channelstatedesc':{'type':Sequelize[_0xbaf1('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbaf1('0x1')]},'language':{'type':Sequelize[_0xbaf1('0x1')]},'accountcode':{'type':Sequelize[_0xbaf1('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xbaf1('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xbaf1('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xbaf1('0x1')]},'destcalleridname':{'type':Sequelize[_0xbaf1('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xbaf1('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xbaf1('0x1')]},'destcontext':{'type':Sequelize[_0xbaf1('0x1')]},'destexten':{'type':Sequelize[_0xbaf1('0x1')]},'destpriority':{'type':Sequelize[_0xbaf1('0x1')]},'destuniqueid':{'type':Sequelize[_0xbaf1('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xbaf1('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbaf1('0x1')]},'cc':{'type':Sequelize[_0xbaf1('0x1')]},'attachment':{'type':Sequelize[_0xbaf1('0x5')]},'html':{'type':Sequelize[_0xbaf1('0x5')]},'text':{'type':Sequelize[_0xbaf1('0x5')]},'status':{'type':Sequelize[_0xbaf1('0x6')]('SENT','SENDING',_0xbaf1('0x7'),_0xbaf1('0x8'))},'url':{'type':Sequelize[_0xbaf1('0x1')]},'app':{'type':Sequelize[_0xbaf1('0x1')]},'appdata':{'type':Sequelize[_0xbaf1('0x1')]},'projectId':{'type':Sequelize[_0xbaf1('0x2')]}}; \ No newline at end of file +var _0xd757=['SENDING','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x41f614,_0x38a379){var _0x57256d=function(_0x2288ec){while(--_0x2288ec){_0x41f614['push'](_0x41f614['shift']());}};_0x57256d(++_0x38a379);}(_0xd757,0xfb));var _0x7d75=function(_0x19d88b,_0x31558d){_0x19d88b=_0x19d88b-0x0;var _0x5cda43=_0xd757[_0x19d88b];return _0x5cda43;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'integration':{'type':Sequelize[_0x7d75('0x2')]},'eventChannel':{'type':Sequelize[_0x7d75('0x2')]},'exitStatus':{'type':Sequelize[_0x7d75('0x2')]},'ticketId':{'type':Sequelize[_0x7d75('0x2')]},'integrationId':{'type':Sequelize[_0x7d75('0x3')]},'contacts':{'type':Sequelize[_0x7d75('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7d75('0x4')]},'agentconnectAt':{'type':Sequelize[_0x7d75('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x7d75('0x3')]},'agentacw':{'type':Sequelize[_0x7d75('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x7d75('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7d75('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7d75('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x7d75('0x2')]},'channel':{'type':Sequelize[_0x7d75('0x2')]},'channelstate':{'type':Sequelize[_0x7d75('0x3')]},'channelstatedesc':{'type':Sequelize[_0x7d75('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7d75('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7d75('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7d75('0x2')]},'exten':{'type':Sequelize[_0x7d75('0x2')]},'priority':{'type':Sequelize[_0x7d75('0x2')]},'destchannel':{'type':Sequelize[_0x7d75('0x2')]},'destchannelstate':{'type':Sequelize[_0x7d75('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7d75('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7d75('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7d75('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7d75('0x2')]},'destlanguage':{'type':Sequelize[_0x7d75('0x2')]},'destaccountcode':{'type':Sequelize[_0x7d75('0x2')]},'destcontext':{'type':Sequelize[_0x7d75('0x2')]},'destexten':{'type':Sequelize[_0x7d75('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7d75('0x2')]},'subject':{'type':Sequelize[_0x7d75('0x2')]},'from':{'type':Sequelize[_0x7d75('0x2')]},'to':{'type':Sequelize[_0x7d75('0x2')]},'cc':{'type':Sequelize[_0x7d75('0x2')]},'attachment':{'type':Sequelize[_0x7d75('0x6')]},'html':{'type':Sequelize[_0x7d75('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x7d75('0x7')](_0x7d75('0x8'),_0x7d75('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x7d75('0x2')]},'app':{'type':Sequelize[_0x7d75('0x2')]},'appdata':{'type':Sequelize[_0x7d75('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 158c4de..9381a43 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 _0x60c4=['order','sort','pick','filter','where','map','type','merge','count','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit'];(function(_0xc5995,_0x1e0322){var _0x48105d=function(_0x2469c0){while(--_0x2469c0){_0xc5995['push'](_0xc5995['shift']());}};_0x48105d(++_0x1e0322);}(_0x60c4,0xa2));var _0x460c=function(_0x3c0f3b,_0x3d3806){_0x3c0f3b=_0x3c0f3b-0x0;var _0xd891cf=_0x60c4[_0x3c0f3b];return _0xd891cf;};'use strict';var emlformat=require(_0x460c('0x0'));var rimraf=require(_0x460c('0x1'));var zipdir=require(_0x460c('0x2'));var jsonpatch=require(_0x460c('0x3'));var rp=require(_0x460c('0x4'));var moment=require(_0x460c('0x5'));var BPromise=require(_0x460c('0x6'));var Mustache=require('mustache');var util=require(_0x460c('0x7'));var path=require(_0x460c('0x8'));var sox=require(_0x460c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x460c('0xa'));var _=require(_0x460c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x460c('0xc'));var deskjs=require(_0x460c('0xd'));var toCsv=require(_0x460c('0xe'));var querystring=require('querystring');var Papa=require(_0x460c('0xf'));var Redis=require(_0x460c('0x10'));var authService=require(_0x460c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x460c('0x12'));var hardwareService=require(_0x460c('0x13'));var logger=require(_0x460c('0x14'))('api');var utils=require(_0x460c('0x15'));var config=require(_0x460c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c3535,_0x6b774d){_0x6b774d=_0x6b774d||0xcc;return function(_0x2293ab){if(_0x2293ab){return _0x2c3535['sendStatus'](_0x6b774d);}return _0x2c3535[_0x460c('0x17')](_0x6b774d)[_0x460c('0x18')]();};}function respondWithResult(_0x1aa3e1,_0x7b1647){_0x7b1647=_0x7b1647||0xc8;return function(_0x33f6bd){if(_0x33f6bd){return _0x1aa3e1[_0x460c('0x17')](_0x7b1647)[_0x460c('0x19')](_0x33f6bd);}};}function respondWithFilteredResult(_0x50d023,_0x491962){return function(_0xc956ac){if(_0xc956ac){var _0x390a73=typeof _0x491962[_0x460c('0x1a')]==='undefined'&&typeof _0x491962[_0x460c('0x1b')]===_0x460c('0x1c');var _0x46264c=_0xc956ac['count'];var _0x1806b5=_0x390a73?0x0:_0x491962['offset'];var _0x46f133=_0x390a73?_0xc956ac['count']:_0x491962[_0x460c('0x1a')]+_0x491962[_0x460c('0x1b')];var _0x3a4736;if(_0x46f133>=_0x46264c){_0x46f133=_0x46264c;_0x3a4736=0xc8;}else{_0x3a4736=0xce;}_0x50d023[_0x460c('0x17')](_0x3a4736);return _0x50d023[_0x460c('0x1d')](_0x460c('0x1e'),_0x1806b5+'-'+_0x46f133+'/'+_0x46264c)[_0x460c('0x19')](_0xc956ac);}return null;};}function patchUpdates(_0xe83e90){return function(_0x1e4c97){try{jsonpatch[_0x460c('0x1f')](_0x1e4c97,_0xe83e90,!![]);}catch(_0x16835e){return BPromise[_0x460c('0x20')](_0x16835e);}return _0x1e4c97[_0x460c('0x21')]();};}function saveUpdates(_0x4487b2,_0x1a78d2){return function(_0x7310aa){if(_0x7310aa){return _0x7310aa[_0x460c('0x22')](_0x4487b2)[_0x460c('0x23')](function(_0x3bb176){return _0x3bb176;});}return null;};}function removeEntity(_0x5e5c90,_0x1bbb1d){return function(_0x52ba70){if(_0x52ba70){return _0x52ba70[_0x460c('0x24')]()['then'](function(){_0x5e5c90[_0x460c('0x17')](0xcc)[_0x460c('0x18')]();});}};}function handleEntityNotFound(_0x56075f,_0x59d191){return function(_0x1d5d69){if(!_0x1d5d69){_0x56075f['sendStatus'](0x194);}return _0x1d5d69;};}function handleError(_0x1a9bed,_0x387144){_0x387144=_0x387144||0x1f4;return function(_0x817de){logger[_0x460c('0x25')](_0x817de[_0x460c('0x26')]);if(_0x817de['name']){delete _0x817de[_0x460c('0x27')];}_0x1a9bed[_0x460c('0x17')](_0x387144)['send'](_0x817de);};}exports[_0x460c('0x28')]=function(_0x4f6d8a,_0x35236f){var _0x19fc7d={},_0xa34ecc={},_0x52aa50={'count':0x0,'rows':[]};var _0x480298=_['map'](db[_0x460c('0x29')][_0x460c('0x2a')],function(_0x5ff4be){return{'name':_0x5ff4be[_0x460c('0x2b')],'type':_0x5ff4be['type'][_0x460c('0x2c')]};});_0xa34ecc[_0x460c('0x2d')]=_['map'](_0x480298,_0x460c('0x27'));_0xa34ecc[_0x460c('0x2e')]=_[_0x460c('0x2f')](_0x4f6d8a[_0x460c('0x2e')]);_0xa34ecc[_0x460c('0x30')]=_[_0x460c('0x31')](_0xa34ecc['model'],_0xa34ecc[_0x460c('0x2e')]);_0x19fc7d['attributes']=_[_0x460c('0x31')](_0xa34ecc[_0x460c('0x2d')],qs[_0x460c('0x32')](_0x4f6d8a[_0x460c('0x2e')][_0x460c('0x32')]));_0x19fc7d[_0x460c('0x33')]=_0x19fc7d[_0x460c('0x33')][_0x460c('0x34')]?_0x19fc7d['attributes']:_0xa34ecc[_0x460c('0x2d')];if(!_0x4f6d8a[_0x460c('0x2e')]['hasOwnProperty'](_0x460c('0x35'))){_0x19fc7d[_0x460c('0x1b')]=qs[_0x460c('0x1b')](_0x4f6d8a[_0x460c('0x2e')][_0x460c('0x1b')]);_0x19fc7d['offset']=qs[_0x460c('0x1a')](_0x4f6d8a['query'][_0x460c('0x1a')]);}_0x19fc7d[_0x460c('0x36')]=qs[_0x460c('0x37')](_0x4f6d8a[_0x460c('0x2e')][_0x460c('0x37')]);_0x19fc7d['where']=qs[_0x460c('0x30')](_[_0x460c('0x38')](_0x4f6d8a[_0x460c('0x2e')],_0xa34ecc[_0x460c('0x30')]),_0x480298);if(_0x4f6d8a[_0x460c('0x2e')][_0x460c('0x39')]){_0x19fc7d['where']=_['merge'](_0x19fc7d[_0x460c('0x3a')],{'$or':_[_0x460c('0x3b')](_0x480298,function(_0xfcd97c){if(_0xfcd97c[_0x460c('0x3c')]!=='VIRTUAL'){var _0x403769={};_0x403769[_0xfcd97c[_0x460c('0x27')]]={'$like':'%'+_0x4f6d8a[_0x460c('0x2e')]['filter']+'%'};return _0x403769;}})});}_0x19fc7d=_[_0x460c('0x3d')]({},_0x19fc7d,_0x4f6d8a['options']);var _0x2b5b03={'where':_0x19fc7d[_0x460c('0x3a')]};return db[_0x460c('0x29')][_0x460c('0x3e')](_0x2b5b03)[_0x460c('0x23')](function(_0x39e88e){_0x52aa50['count']=_0x39e88e;if(_0x4f6d8a[_0x460c('0x2e')]['includeAll']){_0x19fc7d['include']=[{'all':!![]}];}return db[_0x460c('0x29')][_0x460c('0x3f')](_0x19fc7d);})[_0x460c('0x23')](function(_0x28f396){_0x52aa50['rows']=_0x28f396;return _0x52aa50;})[_0x460c('0x23')](respondWithFilteredResult(_0x35236f,_0x19fc7d))[_0x460c('0x40')](handleError(_0x35236f,null));};exports[_0x460c('0x41')]=function(_0x2fed97,_0x143046){var _0x435883={'raw':![],'where':{'id':_0x2fed97[_0x460c('0x42')]['id']}},_0x40524c={};_0x40524c[_0x460c('0x2d')]=_[_0x460c('0x2f')](db[_0x460c('0x29')]['rawAttributes']);_0x40524c['query']=_[_0x460c('0x2f')](_0x2fed97[_0x460c('0x2e')]);_0x40524c[_0x460c('0x30')]=_[_0x460c('0x31')](_0x40524c[_0x460c('0x2d')],_0x40524c['query']);_0x435883['attributes']=_['intersection'](_0x40524c[_0x460c('0x2d')],qs['fields'](_0x2fed97[_0x460c('0x2e')]['fields']));_0x435883['attributes']=_0x435883[_0x460c('0x33')][_0x460c('0x34')]?_0x435883['attributes']:_0x40524c[_0x460c('0x2d')];if(_0x2fed97[_0x460c('0x2e')]['includeAll']){_0x435883[_0x460c('0x43')]=[{'all':!![]}];}_0x435883=_['merge']({},_0x435883,_0x2fed97['options']);return db['IntegrationReport'][_0x460c('0x44')](_0x435883)[_0x460c('0x23')](handleEntityNotFound(_0x143046,null))[_0x460c('0x23')](respondWithResult(_0x143046,null))[_0x460c('0x40')](handleError(_0x143046,null));};exports[_0x460c('0x45')]=function(_0x2d6466,_0x21ab8e){return db['IntegrationReport'][_0x460c('0x45')](_0x2d6466[_0x460c('0x46')],{})['then'](respondWithResult(_0x21ab8e,0xc9))['catch'](handleError(_0x21ab8e,null));};exports[_0x460c('0x22')]=function(_0x1203b2,_0x16a6b0){if(_0x1203b2[_0x460c('0x46')]['id']){delete _0x1203b2[_0x460c('0x46')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x1203b2['params']['id']}})['then'](handleEntityNotFound(_0x16a6b0,null))[_0x460c('0x23')](saveUpdates(_0x1203b2[_0x460c('0x46')],null))[_0x460c('0x23')](respondWithResult(_0x16a6b0,null))[_0x460c('0x40')](handleError(_0x16a6b0,null));};exports[_0x460c('0x24')]=function(_0x363644,_0x303063){return db['IntegrationReport'][_0x460c('0x44')]({'where':{'id':_0x363644[_0x460c('0x42')]['id']}})[_0x460c('0x23')](handleEntityNotFound(_0x303063,null))[_0x460c('0x23')](removeEntity(_0x303063,null))[_0x460c('0x40')](handleError(_0x303063,null));};exports[_0x460c('0x47')]=function(_0x1c7ecc,_0x729dff){return db[_0x460c('0x29')]['describe']()['then'](respondWithResult(_0x729dff,null))[_0x460c('0x40')](handleError(_0x729dff,null));}; \ No newline at end of file +var _0x8832=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','length','options','find','catch','create','body','update','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x343874,_0x325d1b){var _0x40053c=function(_0x3cd2cd){while(--_0x3cd2cd){_0x343874['push'](_0x343874['shift']());}};_0x40053c(++_0x325d1b);}(_0x8832,0x16d));var _0x2883=function(_0x59166d,_0x415c2d){_0x59166d=_0x59166d-0x0;var _0x2184e1=_0x8832[_0x59166d];return _0x2184e1;};'use strict';var emlformat=require(_0x2883('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2883('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2883('0x2'));var moment=require(_0x2883('0x3'));var BPromise=require(_0x2883('0x4'));var Mustache=require(_0x2883('0x5'));var util=require(_0x2883('0x6'));var path=require(_0x2883('0x7'));var sox=require(_0x2883('0x8'));var csv=require(_0x2883('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(_0x2883('0xa'));var jsforce=require(_0x2883('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2883('0x9'));var querystring=require(_0x2883('0xc'));var Papa=require(_0x2883('0xd'));var Redis=require(_0x2883('0xe'));var authService=require(_0x2883('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2883('0x10'));var hardwareService=require(_0x2883('0x11'));var logger=require('../../config/logger')(_0x2883('0x12'));var utils=require(_0x2883('0x13'));var config=require(_0x2883('0x14'));var licenseUtil=require(_0x2883('0x15'));var db=require(_0x2883('0x16'))['db'];function respondWithStatusCode(_0x13378a,_0x14c996){_0x14c996=_0x14c996||0xcc;return function(_0x405cf6){if(_0x405cf6){return _0x13378a[_0x2883('0x17')](_0x14c996);}return _0x13378a['status'](_0x14c996)[_0x2883('0x18')]();};}function respondWithResult(_0x48e496,_0x151bfe){_0x151bfe=_0x151bfe||0xc8;return function(_0xfd8a){if(_0xfd8a){return _0x48e496[_0x2883('0x19')](_0x151bfe)[_0x2883('0x1a')](_0xfd8a);}};}function respondWithFilteredResult(_0x71901c,_0x21bd02){return function(_0x4d1274){if(_0x4d1274){var _0x4ee284=typeof _0x21bd02[_0x2883('0x1b')]===_0x2883('0x1c')&&typeof _0x21bd02[_0x2883('0x1d')]===_0x2883('0x1c');var _0x281029=_0x4d1274[_0x2883('0x1e')];var _0x2c5dd2=_0x4ee284?0x0:_0x21bd02[_0x2883('0x1b')];var _0x1fb14a=_0x4ee284?_0x4d1274['count']:_0x21bd02[_0x2883('0x1b')]+_0x21bd02['limit'];var _0x1e187a;if(_0x1fb14a>=_0x281029){_0x1fb14a=_0x281029;_0x1e187a=0xc8;}else{_0x1e187a=0xce;}_0x71901c[_0x2883('0x19')](_0x1e187a);return _0x71901c['set'](_0x2883('0x1f'),_0x2c5dd2+'-'+_0x1fb14a+'/'+_0x281029)[_0x2883('0x1a')](_0x4d1274);}return null;};}function patchUpdates(_0x464664){return function(_0x440a26){try{jsonpatch[_0x2883('0x20')](_0x440a26,_0x464664,!![]);}catch(_0x562151){return BPromise[_0x2883('0x21')](_0x562151);}return _0x440a26['save']();};}function saveUpdates(_0xcb068,_0x2ecadb){return function(_0x4fa496){if(_0x4fa496){return _0x4fa496['update'](_0xcb068)[_0x2883('0x22')](function(_0x40808d){return _0x40808d;});}return null;};}function removeEntity(_0x29fbb1,_0x454bd5){return function(_0x4e8de0){if(_0x4e8de0){return _0x4e8de0[_0x2883('0x23')]()['then'](function(){_0x29fbb1[_0x2883('0x19')](0xcc)[_0x2883('0x18')]();});}};}function handleEntityNotFound(_0x5a674d,_0x377bac){return function(_0x5e3940){if(!_0x5e3940){_0x5a674d[_0x2883('0x17')](0x194);}return _0x5e3940;};}function handleError(_0x47d8b1,_0x182a21){_0x182a21=_0x182a21||0x1f4;return function(_0x1c06d3){logger[_0x2883('0x24')](_0x1c06d3[_0x2883('0x25')]);if(_0x1c06d3[_0x2883('0x26')]){delete _0x1c06d3[_0x2883('0x26')];}_0x47d8b1[_0x2883('0x19')](_0x182a21)[_0x2883('0x27')](_0x1c06d3);};}exports[_0x2883('0x28')]=function(_0x53950d,_0x40b0f5){var _0x20b8b2={},_0xc634b5={},_0x8e7ef6={'count':0x0,'rows':[]};var _0x3ccc9a=_[_0x2883('0x29')](db[_0x2883('0x2a')][_0x2883('0x2b')],function(_0x3ecdd4){return{'name':_0x3ecdd4[_0x2883('0x2c')],'type':_0x3ecdd4[_0x2883('0x2d')][_0x2883('0x2e')]};});_0xc634b5[_0x2883('0x2f')]=_[_0x2883('0x29')](_0x3ccc9a,_0x2883('0x26'));_0xc634b5['query']=_[_0x2883('0x30')](_0x53950d[_0x2883('0x31')]);_0xc634b5[_0x2883('0x32')]=_[_0x2883('0x33')](_0xc634b5[_0x2883('0x2f')],_0xc634b5[_0x2883('0x31')]);_0x20b8b2[_0x2883('0x34')]=_[_0x2883('0x33')](_0xc634b5['model'],qs[_0x2883('0x35')](_0x53950d['query']['fields']));_0x20b8b2[_0x2883('0x34')]=_0x20b8b2[_0x2883('0x34')]['length']?_0x20b8b2[_0x2883('0x34')]:_0xc634b5[_0x2883('0x2f')];if(!_0x53950d[_0x2883('0x31')][_0x2883('0x36')]('nolimit')){_0x20b8b2[_0x2883('0x1d')]=qs[_0x2883('0x1d')](_0x53950d[_0x2883('0x31')][_0x2883('0x1d')]);_0x20b8b2[_0x2883('0x1b')]=qs[_0x2883('0x1b')](_0x53950d[_0x2883('0x31')][_0x2883('0x1b')]);}_0x20b8b2[_0x2883('0x37')]=qs[_0x2883('0x38')](_0x53950d[_0x2883('0x31')][_0x2883('0x38')]);_0x20b8b2['where']=qs[_0x2883('0x32')](_[_0x2883('0x39')](_0x53950d[_0x2883('0x31')],_0xc634b5[_0x2883('0x32')]),_0x3ccc9a);if(_0x53950d[_0x2883('0x31')][_0x2883('0x3a')]){_0x20b8b2[_0x2883('0x3b')]=_[_0x2883('0x3c')](_0x20b8b2[_0x2883('0x3b')],{'$or':_[_0x2883('0x29')](_0x3ccc9a,function(_0x4d80b9){if(_0x4d80b9[_0x2883('0x2d')]!==_0x2883('0x3d')){var _0x4abd1f={};_0x4abd1f[_0x4d80b9[_0x2883('0x26')]]={'$like':'%'+_0x53950d[_0x2883('0x31')][_0x2883('0x3a')]+'%'};return _0x4abd1f;}})});}_0x20b8b2=_[_0x2883('0x3c')]({},_0x20b8b2,_0x53950d['options']);var _0x16c69d={'where':_0x20b8b2[_0x2883('0x3b')]};return db[_0x2883('0x2a')][_0x2883('0x1e')](_0x16c69d)[_0x2883('0x22')](function(_0x3c37cc){_0x8e7ef6[_0x2883('0x1e')]=_0x3c37cc;if(_0x53950d[_0x2883('0x31')][_0x2883('0x3e')]){_0x20b8b2[_0x2883('0x3f')]=[{'all':!![]}];}return db[_0x2883('0x2a')]['findAll'](_0x20b8b2);})['then'](function(_0x4c3f53){_0x8e7ef6[_0x2883('0x40')]=_0x4c3f53;return _0x8e7ef6;})[_0x2883('0x22')](respondWithFilteredResult(_0x40b0f5,_0x20b8b2))['catch'](handleError(_0x40b0f5,null));};exports[_0x2883('0x41')]=function(_0x4ec100,_0x2086e2){var _0x58ff76={'raw':![],'where':{'id':_0x4ec100['params']['id']}},_0x27ac61={};_0x27ac61[_0x2883('0x2f')]=_['keys'](db[_0x2883('0x2a')][_0x2883('0x2b')]);_0x27ac61[_0x2883('0x31')]=_['keys'](_0x4ec100['query']);_0x27ac61[_0x2883('0x32')]=_['intersection'](_0x27ac61[_0x2883('0x2f')],_0x27ac61[_0x2883('0x31')]);_0x58ff76['attributes']=_[_0x2883('0x33')](_0x27ac61[_0x2883('0x2f')],qs['fields'](_0x4ec100['query']['fields']));_0x58ff76[_0x2883('0x34')]=_0x58ff76[_0x2883('0x34')][_0x2883('0x42')]?_0x58ff76[_0x2883('0x34')]:_0x27ac61['model'];if(_0x4ec100[_0x2883('0x31')][_0x2883('0x3e')]){_0x58ff76['include']=[{'all':!![]}];}_0x58ff76=_['merge']({},_0x58ff76,_0x4ec100[_0x2883('0x43')]);return db[_0x2883('0x2a')][_0x2883('0x44')](_0x58ff76)[_0x2883('0x22')](handleEntityNotFound(_0x2086e2,null))[_0x2883('0x22')](respondWithResult(_0x2086e2,null))[_0x2883('0x45')](handleError(_0x2086e2,null));};exports[_0x2883('0x46')]=function(_0x396a0e,_0x53944d){return db[_0x2883('0x2a')][_0x2883('0x46')](_0x396a0e[_0x2883('0x47')],{})[_0x2883('0x22')](respondWithResult(_0x53944d,0xc9))[_0x2883('0x45')](handleError(_0x53944d,null));};exports[_0x2883('0x48')]=function(_0x5cedf1,_0x25cdff){if(_0x5cedf1[_0x2883('0x47')]['id']){delete _0x5cedf1[_0x2883('0x47')]['id'];}return db[_0x2883('0x2a')][_0x2883('0x44')]({'where':{'id':_0x5cedf1[_0x2883('0x49')]['id']}})[_0x2883('0x22')](handleEntityNotFound(_0x25cdff,null))['then'](saveUpdates(_0x5cedf1[_0x2883('0x47')],null))['then'](respondWithResult(_0x25cdff,null))[_0x2883('0x45')](handleError(_0x25cdff,null));};exports[_0x2883('0x23')]=function(_0x40cd17,_0x2b3a00){return db[_0x2883('0x2a')][_0x2883('0x44')]({'where':{'id':_0x40cd17[_0x2883('0x49')]['id']}})[_0x2883('0x22')](handleEntityNotFound(_0x2b3a00,null))[_0x2883('0x22')](removeEntity(_0x2b3a00,null))[_0x2883('0x45')](handleError(_0x2b3a00,null));};exports[_0x2883('0x4a')]=function(_0x15e490,_0x5c167e){return db[_0x2883('0x2a')]['describe']()['then'](respondWithResult(_0x5c167e,null))[_0x2883('0x45')](handleError(_0x5c167e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 170a1aa..dca90b0 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 _0x6596=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','IntegrationReport','report_integration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6596,0x1a2));var _0x6659=function(_0x13c92d,_0x40b071){_0x13c92d=_0x13c92d-0x0;var _0x326fbb=_0x6596[_0x13c92d];return _0x326fbb;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var logger=require(_0x6659('0x2'))(_0x6659('0x3'));var moment=require(_0x6659('0x4'));var BPromise=require(_0x6659('0x5'));var rp=require(_0x6659('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6659('0x7'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x5b0760,_0x9cd27d){return _0x5b0760['define'](_0x6659('0x8'),attributes,{'tableName':_0x6659('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2554=['IntegrationReport','report_integration','../../config/logger','api','bluebird','request-promise','../../config/environment','./integrationReport.attributes','exports'];(function(_0x8398a9,_0x510eef){var _0x175a1e=function(_0x187466){while(--_0x187466){_0x8398a9['push'](_0x8398a9['shift']());}};_0x175a1e(++_0x510eef);}(_0x2554,0x146));var _0x4255=function(_0x17f66a,_0x31423e){_0x17f66a=_0x17f66a-0x0;var _0x508a47=_0x2554[_0x17f66a];return _0x508a47;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4255('0x0'))(_0x4255('0x1'));var moment=require('moment');var BPromise=require(_0x4255('0x2'));var rp=require(_0x4255('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4255('0x4'));var attributes=require(_0x4255('0x5'));module[_0x4255('0x6')]=function(_0x313e65,_0x18e619){return _0x313e65['define'](_0x4255('0x7'),attributes,{'tableName':_0x4255('0x8'),'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 9e77b37..6b6160d 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['client','http','then','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27c9fa,_0x587dea){var _0x5fdde8=function(_0x1a320d){while(--_0x1a320d){_0x27c9fa['push'](_0x27c9fa['shift']());}};_0x5fdde8(++_0x587dea);}(_0x0295,0x1f0));var _0x5029=function(_0x329905,_0x13c144){_0x329905=_0x329905-0x0;var _0x3aa42=_0x0295[_0x329905];return _0x3aa42;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('IntegrationReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x4137,0xf8));var _0x7413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4137[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d954cbe..acd40e4 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 _0x867e=['express','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1f4817,_0x432d15){var _0x28d3b7=function(_0x2a7a76){while(--_0x2a7a76){_0x1f4817['push'](_0x1f4817['shift']());}};_0x28d3b7(++_0x432d15);}(_0x867e,0x1c5));var _0xe867=function(_0x2e0cde,_0xdb1152){_0x2e0cde=_0x2e0cde-0x0;var _0x270225=_0x867e[_0x2e0cde];return _0x270225;};'use strict';var multer=require(_0xe867('0x0'));var util=require(_0xe867('0x1'));var path=require(_0xe867('0x2'));var timeout=require('connect-timeout');var express=require(_0xe867('0x3'));var router=express['Router']();var fs_extra=require(_0xe867('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe867('0x5'));var config=require(_0xe867('0x6'));var controller=require(_0xe867('0x7'));router[_0xe867('0x8')]('/',auth[_0xe867('0x9')](),controller[_0xe867('0xa')]);router[_0xe867('0x8')](_0xe867('0xb'),auth[_0xe867('0x9')](),controller[_0xe867('0xc')]);router[_0xe867('0x8')](_0xe867('0xd'),auth[_0xe867('0x9')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0xe867('0xe')]);router[_0xe867('0xf')](_0xe867('0xd'),auth[_0xe867('0x9')](),controller[_0xe867('0x10')]);router[_0xe867('0xf')](_0xe867('0x11'),auth[_0xe867('0x9')](),controller[_0xe867('0x12')]);router[_0xe867('0x13')](_0xe867('0xb'),auth[_0xe867('0x9')](),controller[_0xe867('0x14')]);router[_0xe867('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xe867('0x16')]);module[_0xe867('0x17')]=router; \ No newline at end of file +var _0x8c45=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','create','post','/:id/sub_intervals/create_many','put','update','delete'];(function(_0x524e4d,_0x48ebd7){var _0x39748d=function(_0x4cae32){while(--_0x4cae32){_0x524e4d['push'](_0x524e4d['shift']());}};_0x39748d(++_0x48ebd7);}(_0x8c45,0xda));var _0x58c4=function(_0x4ed625,_0x384757){_0x4ed625=_0x4ed625-0x0;var _0x5b4bad=_0x8c45[_0x4ed625];return _0x5b4bad;};'use strict';var multer=require(_0x58c4('0x0'));var util=require(_0x58c4('0x1'));var path=require(_0x58c4('0x2'));var timeout=require(_0x58c4('0x3'));var express=require(_0x58c4('0x4'));var router=express[_0x58c4('0x5')]();var fs_extra=require(_0x58c4('0x6'));var auth=require(_0x58c4('0x7'));var interaction=require(_0x58c4('0x8'));var config=require(_0x58c4('0x9'));var controller=require('./interval.controller');router[_0x58c4('0xa')]('/',auth[_0x58c4('0xb')](),controller[_0x58c4('0xc')]);router['get'](_0x58c4('0xd'),auth[_0x58c4('0xb')](),controller[_0x58c4('0xe')]);router['get'](_0x58c4('0xf'),auth[_0x58c4('0xb')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x58c4('0x10')]);router[_0x58c4('0x11')](_0x58c4('0xf'),auth['isAuthenticated'](),controller['addInterval']);router[_0x58c4('0x11')](_0x58c4('0x12'),auth['isAuthenticated'](),controller['addIntervals']);router[_0x58c4('0x13')](_0x58c4('0xd'),auth['isAuthenticated'](),controller[_0x58c4('0x14')]);router[_0x58c4('0x15')]('/:id',auth[_0x58c4('0xb')](),controller[_0x58c4('0x16')]);module[_0x58c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 9f6dc3c..d3e49cd 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 _0x2c2e=['exports','STRING','sequelize'];(function(_0x5d307c,_0x332816){var _0x5dab6f=function(_0x1ad9f3){while(--_0x1ad9f3){_0x5d307c['push'](_0x5d307c['shift']());}};_0x5dab6f(++_0x332816);}(_0x2c2e,0xe3));var _0xe2c2=function(_0x141973,_0x435d84){_0x141973=_0x141973-0x0;var _0x42c51a=_0x2c2e[_0x141973];return _0x42c51a;};'use strict';var Sequelize=require(_0xe2c2('0x0'));module[_0xe2c2('0x1')]={'name':{'type':Sequelize[_0xe2c2('0x2')]},'description':{'type':Sequelize[_0xe2c2('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x8c12=['exports','STRING'];(function(_0x2df04c,_0x4466fc){var _0x23dbff=function(_0xd28c37){while(--_0xd28c37){_0x2df04c['push'](_0x2df04c['shift']());}};_0x23dbff(++_0x4466fc);}(_0x8c12,0x146));var _0x28c1=function(_0x5c6819,_0x2a82f5){_0x5c6819=_0x5c6819-0x0;var _0x103875=_0x8c12[_0x5c6819];return _0x103875;};'use strict';var Sequelize=require('sequelize');module[_0x28c1('0x0')]={'name':{'type':Sequelize[_0x28c1('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 6466a56..dd7a9b0 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 _0xef0b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','map','Interval','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','addInterval','IntervalId','findOne','pick','getIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x5c1150,_0x57988a){var _0x5d1068=function(_0x3b7750){while(--_0x3b7750){_0x5c1150['push'](_0x5c1150['shift']());}};_0x5d1068(++_0x57988a);}(_0xef0b,0x19f));var _0xbef0=function(_0x50ab10,_0x51b765){_0x50ab10=_0x50ab10-0x0;var _0x24a800=_0xef0b[_0x50ab10];return _0x24a800;};'use strict';var emlformat=require(_0xbef0('0x0'));var rimraf=require(_0xbef0('0x1'));var zipdir=require(_0xbef0('0x2'));var jsonpatch=require(_0xbef0('0x3'));var rp=require(_0xbef0('0x4'));var moment=require(_0xbef0('0x5'));var BPromise=require(_0xbef0('0x6'));var Mustache=require(_0xbef0('0x7'));var util=require(_0xbef0('0x8'));var path=require('path');var sox=require(_0xbef0('0x9'));var csv=require(_0xbef0('0xa'));var ejs=require(_0xbef0('0xb'));var fs=require('fs');var fs_extra=require(_0xbef0('0xc'));var _=require(_0xbef0('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbef0('0xe'));var Papa=require(_0xbef0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbef0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbef0('0x11'))(_0xbef0('0x12'));var utils=require(_0xbef0('0x13'));var config=require(_0xbef0('0x14'));var licenseUtil=require(_0xbef0('0x15'));var db=require(_0xbef0('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2dfc39,_0x56ec2d){_0x56ec2d=_0x56ec2d||0xcc;return function(_0x278bb5){if(_0x278bb5){return _0x2dfc39[_0xbef0('0x17')](_0x56ec2d);}return _0x2dfc39[_0xbef0('0x18')](_0x56ec2d)[_0xbef0('0x19')]();};}function respondWithResult(_0x209392,_0x346a20){_0x346a20=_0x346a20||0xc8;return function(_0x5b66b5){if(_0x5b66b5){return _0x209392[_0xbef0('0x18')](_0x346a20)[_0xbef0('0x1a')](_0x5b66b5);}};}function respondWithFilteredResult(_0x13457a,_0x2e2f0c){return function(_0x3534c2){if(_0x3534c2){var _0x18563c=typeof _0x2e2f0c[_0xbef0('0x1b')]==='undefined'&&typeof _0x2e2f0c[_0xbef0('0x1c')]===_0xbef0('0x1d');var _0x105150=_0x3534c2[_0xbef0('0x1e')];var _0x1d5a10=_0x18563c?0x0:_0x2e2f0c[_0xbef0('0x1b')];var _0xae5788=_0x18563c?_0x3534c2[_0xbef0('0x1e')]:_0x2e2f0c[_0xbef0('0x1b')]+_0x2e2f0c[_0xbef0('0x1c')];var _0x37989c;if(_0xae5788>=_0x105150){_0xae5788=_0x105150;_0x37989c=0xc8;}else{_0x37989c=0xce;}_0x13457a['status'](_0x37989c);return _0x13457a[_0xbef0('0x1f')](_0xbef0('0x20'),_0x1d5a10+'-'+_0xae5788+'/'+_0x105150)[_0xbef0('0x1a')](_0x3534c2);}return null;};}function patchUpdates(_0x213a48){return function(_0x10daf7){try{jsonpatch[_0xbef0('0x21')](_0x10daf7,_0x213a48,!![]);}catch(_0x5caac2){return BPromise[_0xbef0('0x22')](_0x5caac2);}return _0x10daf7[_0xbef0('0x23')]();};}function saveUpdates(_0x69686,_0x194d82){return function(_0x53a423){if(_0x53a423){return _0x53a423[_0xbef0('0x24')](_0x69686)[_0xbef0('0x25')](function(_0x56e677){return _0x56e677;});}return null;};}function removeEntity(_0x48aaf2,_0x3a3e8b){return function(_0x375204){if(_0x375204){return _0x375204[_0xbef0('0x26')]()[_0xbef0('0x25')](function(){var _0x715db9=_0x375204['get']({'plain':!![]});var _0x43fe71=_0xbef0('0x27');return db[_0xbef0('0x28')][_0xbef0('0x26')]({'where':{'type':_0x43fe71,'resourceId':_0x715db9['id']}})['then'](function(){return _0x375204;});})['then'](function(){_0x48aaf2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6acb,_0x332757){return function(_0x17533b){if(!_0x17533b){_0x1e6acb[_0xbef0('0x17')](0x194);}return _0x17533b;};}function handleError(_0x5b6f88,_0x22dd22){_0x22dd22=_0x22dd22||0x1f4;return function(_0x1264d4){logger[_0xbef0('0x29')](_0x1264d4[_0xbef0('0x2a')]);if(_0x1264d4[_0xbef0('0x2b')]){delete _0x1264d4[_0xbef0('0x2b')];}_0x5b6f88[_0xbef0('0x18')](_0x22dd22)[_0xbef0('0x2c')](_0x1264d4);};}exports['index']=function(_0x81e858,_0x5a3097){var _0xc51162={},_0x4309b0={},_0x12983b={'count':0x0,'rows':[]};var _0x2a4238=_[_0xbef0('0x2d')](db[_0xbef0('0x2e')][_0xbef0('0x2f')],function(_0x12d402){return{'name':_0x12d402[_0xbef0('0x30')],'type':_0x12d402[_0xbef0('0x31')]['key']};});_0x4309b0[_0xbef0('0x32')]=_[_0xbef0('0x2d')](_0x2a4238,_0xbef0('0x2b'));_0x4309b0[_0xbef0('0x33')]=_[_0xbef0('0x34')](_0x81e858[_0xbef0('0x33')]);_0x4309b0[_0xbef0('0x35')]=_[_0xbef0('0x36')](_0x4309b0[_0xbef0('0x32')],_0x4309b0[_0xbef0('0x33')]);_0xc51162['attributes']=_[_0xbef0('0x36')](_0x4309b0[_0xbef0('0x32')],qs[_0xbef0('0x37')](_0x81e858[_0xbef0('0x33')][_0xbef0('0x37')]));_0xc51162[_0xbef0('0x38')]=_0xc51162[_0xbef0('0x38')][_0xbef0('0x39')]?_0xc51162[_0xbef0('0x38')]:_0x4309b0[_0xbef0('0x32')];if(!_0x81e858[_0xbef0('0x33')][_0xbef0('0x3a')](_0xbef0('0x3b'))){_0xc51162[_0xbef0('0x1c')]=qs['limit'](_0x81e858[_0xbef0('0x33')]['limit']);_0xc51162[_0xbef0('0x1b')]=qs[_0xbef0('0x1b')](_0x81e858[_0xbef0('0x33')][_0xbef0('0x1b')]);}_0xc51162[_0xbef0('0x3c')]=qs[_0xbef0('0x3d')](_0x81e858[_0xbef0('0x33')][_0xbef0('0x3d')]);_0xc51162[_0xbef0('0x3e')]=qs[_0xbef0('0x35')](_['pick'](_0x81e858[_0xbef0('0x33')],_0x4309b0[_0xbef0('0x35')]),_0x2a4238);if(_0x81e858[_0xbef0('0x33')][_0xbef0('0x3f')]){_0xc51162['where']=_[_0xbef0('0x40')](_0xc51162[_0xbef0('0x3e')],{'$or':_['map'](_0x2a4238,function(_0x1f30d5){if(_0x1f30d5[_0xbef0('0x31')]!=='VIRTUAL'){var _0x5a8b60={};_0x5a8b60[_0x1f30d5[_0xbef0('0x2b')]]={'$like':'%'+_0x81e858['query'][_0xbef0('0x3f')]+'%'};return _0x5a8b60;}})});}_0xc51162=_[_0xbef0('0x40')]({},_0xc51162,_0x81e858[_0xbef0('0x41')]);var _0x55c3da={'where':_0xc51162['where']};return db[_0xbef0('0x2e')][_0xbef0('0x1e')](_0x55c3da)['then'](function(_0x4d26a4){_0x12983b[_0xbef0('0x1e')]=_0x4d26a4;if(_0x81e858[_0xbef0('0x33')][_0xbef0('0x42')]){_0xc51162[_0xbef0('0x43')]=[{'all':!![]}];}return db[_0xbef0('0x2e')][_0xbef0('0x44')](_0xc51162);})[_0xbef0('0x25')](function(_0x3b49df){_0x12983b[_0xbef0('0x45')]=_0x3b49df;return _0x12983b;})[_0xbef0('0x25')](respondWithFilteredResult(_0x5a3097,_0xc51162))[_0xbef0('0x46')](handleError(_0x5a3097,null));};exports['show']=function(_0x20da75,_0x5427be){var _0x38780f={'raw':!![],'where':{'id':_0x20da75[_0xbef0('0x47')]['id']}},_0xe923fc={};_0xe923fc[_0xbef0('0x32')]=_[_0xbef0('0x34')](db[_0xbef0('0x2e')][_0xbef0('0x2f')]);_0xe923fc[_0xbef0('0x33')]=_[_0xbef0('0x34')](_0x20da75['query']);_0xe923fc['filters']=_['intersection'](_0xe923fc['model'],_0xe923fc[_0xbef0('0x33')]);_0x38780f[_0xbef0('0x38')]=_['intersection'](_0xe923fc[_0xbef0('0x32')],qs[_0xbef0('0x37')](_0x20da75[_0xbef0('0x33')]['fields']));_0x38780f[_0xbef0('0x38')]=_0x38780f['attributes'][_0xbef0('0x39')]?_0x38780f[_0xbef0('0x38')]:_0xe923fc[_0xbef0('0x32')];if(_0x20da75['query']['includeAll']){_0x38780f[_0xbef0('0x43')]=[{'all':!![]}];}_0x38780f=_[_0xbef0('0x40')]({},_0x38780f,_0x20da75['options']);return db['Interval'][_0xbef0('0x48')](_0x38780f)[_0xbef0('0x25')](handleEntityNotFound(_0x5427be,null))[_0xbef0('0x25')](respondWithResult(_0x5427be,null))['catch'](handleError(_0x5427be,null));};exports[_0xbef0('0x49')]=function(_0x1ea748,_0x2d8ff7){return db['Interval'][_0xbef0('0x49')](_0x1ea748[_0xbef0('0x4a')],{})[_0xbef0('0x25')](function(_0x3628bf){var _0x3d5117=_0x1ea748['user']['get']({'plain':!![]});if(!_0x3d5117)throw new Error(_0xbef0('0x4b'));if(_0x3d5117['role']===_0xbef0('0x4c')){var _0x5b8458=_0x3628bf[_0xbef0('0x4d')]({'plain':!![]});var _0x532ff0=_0xbef0('0x27');return db[_0xbef0('0x4e')][_0xbef0('0x48')]({'where':{'name':_0x532ff0,'userProfileId':_0x3d5117['userProfileId']},'raw':!![]})[_0xbef0('0x25')](function(_0x2067b0){if(_0x2067b0&&_0x2067b0['autoAssociation']===0x0){return db['UserProfileResource'][_0xbef0('0x49')]({'name':_0x5b8458['name'],'resourceId':_0x5b8458['id'],'type':_0x2067b0[_0xbef0('0x2b')],'sectionId':_0x2067b0['id']},{})[_0xbef0('0x25')](function(){return _0x3628bf;});}else{return _0x3628bf;}})[_0xbef0('0x46')](function(_0x2d645){logger[_0xbef0('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d645);throw _0x2d645;});}return _0x3628bf;})[_0xbef0('0x25')](respondWithResult(_0x2d8ff7,0xc9))[_0xbef0('0x46')](handleError(_0x2d8ff7,null));};exports[_0xbef0('0x24')]=function(_0x562f85,_0x27f31f){if(_0x562f85[_0xbef0('0x4a')]['id']){delete _0x562f85[_0xbef0('0x4a')]['id'];}return db[_0xbef0('0x2e')][_0xbef0('0x48')]({'where':{'id':_0x562f85[_0xbef0('0x47')]['id']}})[_0xbef0('0x25')](handleEntityNotFound(_0x27f31f,null))[_0xbef0('0x25')](saveUpdates(_0x562f85['body'],null))[_0xbef0('0x25')](respondWithResult(_0x27f31f,null))[_0xbef0('0x46')](handleError(_0x27f31f,null));};exports[_0xbef0('0x26')]=function(_0x369e0a,_0x1ee5aa){return db[_0xbef0('0x2e')][_0xbef0('0x48')]({'where':{'id':_0x369e0a['params']['id']}})[_0xbef0('0x25')](handleEntityNotFound(_0x1ee5aa,null))['then'](removeEntity(_0x1ee5aa,null))[_0xbef0('0x46')](handleError(_0x1ee5aa,null));};exports[_0xbef0('0x4f')]=function(_0x5d81cb,_0x2ea872,_0x347dc5){if(_0x5d81cb[_0xbef0('0x4a')]['id']){delete _0x5d81cb[_0xbef0('0x4a')]['id'];}return db['Interval']['find']({'where':{'id':_0x5d81cb[_0xbef0('0x47')]['id']}})[_0xbef0('0x25')](handleEntityNotFound(_0x2ea872,null))[_0xbef0('0x25')](function(_0x1f7949){if(_0x1f7949){_0x5d81cb['body'][_0xbef0('0x50')]=_0x1f7949['id'];return db[_0xbef0('0x2e')][_0xbef0('0x49')](_0x5d81cb['body']);}})[_0xbef0('0x25')](respondWithResult(_0x2ea872,null))[_0xbef0('0x46')](handleError(_0x2ea872,null));};exports['getIntervals']=function(_0xe04a37,_0x4fda43,_0x5290ea){var _0x3c9b20={};var _0x3c2772={};var _0x1c40ef;var _0x5c9915;return db[_0xbef0('0x2e')][_0xbef0('0x51')]({'where':{'id':_0xe04a37[_0xbef0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fda43,null))[_0xbef0('0x25')](function(_0x1ec8c6){if(_0x1ec8c6){_0x1c40ef=_0x1ec8c6;_0x3c2772[_0xbef0('0x32')]=_[_0xbef0('0x34')](db[_0xbef0('0x2e')][_0xbef0('0x2f')]);_0x3c2772[_0xbef0('0x33')]=_[_0xbef0('0x34')](_0xe04a37[_0xbef0('0x33')]);_0x3c2772[_0xbef0('0x35')]=_[_0xbef0('0x36')](_0x3c2772['model'],_0x3c2772['query']);_0x3c9b20['attributes']=_['intersection'](_0x3c2772[_0xbef0('0x32')],qs[_0xbef0('0x37')](_0xe04a37[_0xbef0('0x33')][_0xbef0('0x37')]));_0x3c9b20[_0xbef0('0x38')]=_0x3c9b20['attributes'][_0xbef0('0x39')]?_0x3c9b20[_0xbef0('0x38')]:_0x3c2772[_0xbef0('0x32')];_0x3c9b20[_0xbef0('0x3c')]=qs[_0xbef0('0x3d')](_0xe04a37[_0xbef0('0x33')]['sort']);_0x3c9b20[_0xbef0('0x3e')]=qs[_0xbef0('0x35')](_[_0xbef0('0x52')](_0xe04a37[_0xbef0('0x33')],_0x3c2772[_0xbef0('0x35')]));if(_0xe04a37[_0xbef0('0x33')][_0xbef0('0x3f')]){_0x3c9b20[_0xbef0('0x3e')]=_[_0xbef0('0x40')](_0x3c9b20[_0xbef0('0x3e')],{'$or':_[_0xbef0('0x2d')](_0x3c9b20['attributes'],function(_0x29ca50){var _0x416623={};_0x416623[_0x29ca50]={'$like':'%'+_0xe04a37[_0xbef0('0x33')][_0xbef0('0x3f')]+'%'};return _0x416623;})});}_0x3c9b20=_[_0xbef0('0x40')]({},_0x3c9b20,_0xe04a37[_0xbef0('0x41')]);return _0x1c40ef[_0xbef0('0x53')](_0x3c9b20);}})[_0xbef0('0x25')](function(_0x5f0c6c){if(_0x5f0c6c){_0x5c9915=_0x5f0c6c[_0xbef0('0x39')];if(!_0xe04a37[_0xbef0('0x33')][_0xbef0('0x3a')](_0xbef0('0x3b'))){_0x3c9b20['limit']=qs[_0xbef0('0x1c')](_0xe04a37[_0xbef0('0x33')][_0xbef0('0x1c')]);_0x3c9b20[_0xbef0('0x1b')]=qs[_0xbef0('0x1b')](_0xe04a37[_0xbef0('0x33')][_0xbef0('0x1b')]);}return _0x1c40ef['getIntervals'](_0x3c9b20);}})[_0xbef0('0x25')](function(_0x118bbe){if(_0x118bbe){return _0x118bbe?{'count':_0x5c9915,'rows':_0x118bbe}:null;}})[_0xbef0('0x25')](respondWithResult(_0x4fda43,null))[_0xbef0('0x46')](handleError(_0x4fda43,null));};exports['addIntervals']=function(_0x3eaa62,_0x3d4fbd,_0x3045d7){return db[_0xbef0('0x2e')]['findOne']({'where':{'id':_0x3eaa62[_0xbef0('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d4fbd,null))['then'](function(_0xf76e21){if(_0xf76e21){return db[_0xbef0('0x54')][_0xbef0('0x55')](function(_0x4463f4){return db[_0xbef0('0x2e')][_0xbef0('0x26')]({'where':{'IntervalId':_0x3eaa62[_0xbef0('0x47')]['id']},'transaction':_0x4463f4})[_0xbef0('0x25')](function(_0x9e7c29){var _0x386ac6=_[_0xbef0('0x2d')](_0x3eaa62['body'],function(_0x4d2e59){delete _0x4d2e59['id'];_0x4d2e59['IntervalId']=_0x3eaa62[_0xbef0('0x47')]['id'];return _0x4d2e59;});return db[_0xbef0('0x2e')][_0xbef0('0x56')](_0x386ac6,{'transaction':_0x4463f4});});})[_0xbef0('0x25')](function(){return db[_0xbef0('0x2e')][_0xbef0('0x44')]({'where':{'IntervalId':_0x3eaa62['params']['id']}});});}})['then'](respondWithResult(_0x3d4fbd,null))[_0xbef0('0x46')](handleError(_0x3d4fbd,null));}; \ No newline at end of file +var _0x40ee=['update','destroy','then','get','Intervals','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','Interval','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','findOne','rawAttributes','getIntervals','sequelize','transaction','IntervalId','bulkCreate','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end','undefined','limit','count','offset','set','Content-Range','json'];(function(_0x8973a5,_0x2914ca){var _0x573205=function(_0x51c775){while(--_0x51c775){_0x8973a5['push'](_0x8973a5['shift']());}};_0x573205(++_0x2914ca);}(_0x40ee,0xfa));var _0xe40e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x40ee[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xe40e('0x0'));var rimraf=require(_0xe40e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe40e('0x2'));var rp=require(_0xe40e('0x3'));var moment=require(_0xe40e('0x4'));var BPromise=require(_0xe40e('0x5'));var Mustache=require(_0xe40e('0x6'));var util=require(_0xe40e('0x7'));var path=require(_0xe40e('0x8'));var sox=require(_0xe40e('0x9'));var csv=require(_0xe40e('0xa'));var ejs=require(_0xe40e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe40e('0xc'));var squel=require(_0xe40e('0xd'));var crypto=require(_0xe40e('0xe'));var jsforce=require(_0xe40e('0xf'));var deskjs=require(_0xe40e('0x10'));var toCsv=require(_0xe40e('0xa'));var querystring=require(_0xe40e('0x11'));var Papa=require(_0xe40e('0x12'));var Redis=require(_0xe40e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe40e('0x14'));var as=require(_0xe40e('0x15'));var hardwareService=require(_0xe40e('0x16'));var logger=require(_0xe40e('0x17'))(_0xe40e('0x18'));var utils=require(_0xe40e('0x19'));var config=require(_0xe40e('0x1a'));var licenseUtil=require(_0xe40e('0x1b'));var db=require('../../mysqldb')['db'];var extensions=require(_0xe40e('0x1c'));function respondWithStatusCode(_0x101460,_0x173dfc){_0x173dfc=_0x173dfc||0xcc;return function(_0x50feb1){if(_0x50feb1){return _0x101460['sendStatus'](_0x173dfc);}return _0x101460[_0xe40e('0x1d')](_0x173dfc)[_0xe40e('0x1e')]();};}function respondWithResult(_0x806935,_0xf77e6){_0xf77e6=_0xf77e6||0xc8;return function(_0x17c56b){if(_0x17c56b){return _0x806935['status'](_0xf77e6)['json'](_0x17c56b);}};}function respondWithFilteredResult(_0x5ca9fb,_0x2aa588){return function(_0x18dfe6){if(_0x18dfe6){var _0x55efc5=typeof _0x2aa588['offset']===_0xe40e('0x1f')&&typeof _0x2aa588[_0xe40e('0x20')]===_0xe40e('0x1f');var _0x2a0985=_0x18dfe6[_0xe40e('0x21')];var _0x34a084=_0x55efc5?0x0:_0x2aa588[_0xe40e('0x22')];var _0x3ded40=_0x55efc5?_0x18dfe6['count']:_0x2aa588['offset']+_0x2aa588[_0xe40e('0x20')];var _0x1d89a9;if(_0x3ded40>=_0x2a0985){_0x3ded40=_0x2a0985;_0x1d89a9=0xc8;}else{_0x1d89a9=0xce;}_0x5ca9fb[_0xe40e('0x1d')](_0x1d89a9);return _0x5ca9fb[_0xe40e('0x23')](_0xe40e('0x24'),_0x34a084+'-'+_0x3ded40+'/'+_0x2a0985)[_0xe40e('0x25')](_0x18dfe6);}return null;};}function patchUpdates(_0x1edbf1){return function(_0xb4ca2a){try{jsonpatch['apply'](_0xb4ca2a,_0x1edbf1,!![]);}catch(_0x242808){return BPromise['reject'](_0x242808);}return _0xb4ca2a['save']();};}function saveUpdates(_0x240da8,_0x4dbb09){return function(_0x799470){if(_0x799470){return _0x799470[_0xe40e('0x26')](_0x240da8)['then'](function(_0x4a8a8){return _0x4a8a8;});}return null;};}function removeEntity(_0x548908,_0x13812c){return function(_0x39c1ca){if(_0x39c1ca){return _0x39c1ca[_0xe40e('0x27')]()[_0xe40e('0x28')](function(){var _0x700a0a=_0x39c1ca[_0xe40e('0x29')]({'plain':!![]});var _0xbe6466=_0xe40e('0x2a');return db[_0xe40e('0x2b')][_0xe40e('0x27')]({'where':{'type':_0xbe6466,'resourceId':_0x700a0a['id']}})[_0xe40e('0x28')](function(){return _0x39c1ca;});})['then'](function(){_0x548908[_0xe40e('0x1d')](0xcc)[_0xe40e('0x1e')]();});}};}function handleEntityNotFound(_0x49d22a,_0x47a931){return function(_0x51094e){if(!_0x51094e){_0x49d22a[_0xe40e('0x2c')](0x194);}return _0x51094e;};}function handleError(_0x402543,_0x4ad94a){_0x4ad94a=_0x4ad94a||0x1f4;return function(_0x5b0f54){logger[_0xe40e('0x2d')](_0x5b0f54[_0xe40e('0x2e')]);if(_0x5b0f54[_0xe40e('0x2f')]){delete _0x5b0f54[_0xe40e('0x2f')];}_0x402543['status'](_0x4ad94a)[_0xe40e('0x30')](_0x5b0f54);};}exports[_0xe40e('0x31')]=function(_0x486efe,_0x413054){var _0xa14a9d={},_0xde1df8={},_0x1c6f90={'count':0x0,'rows':[]};var _0x5cf95e=_['map'](db['Interval']['rawAttributes'],function(_0x470c92){return{'name':_0x470c92[_0xe40e('0x32')],'type':_0x470c92[_0xe40e('0x33')][_0xe40e('0x34')]};});_0xde1df8['model']=_[_0xe40e('0x35')](_0x5cf95e,_0xe40e('0x2f'));_0xde1df8[_0xe40e('0x36')]=_['keys'](_0x486efe['query']);_0xde1df8[_0xe40e('0x37')]=_[_0xe40e('0x38')](_0xde1df8[_0xe40e('0x39')],_0xde1df8[_0xe40e('0x36')]);_0xa14a9d[_0xe40e('0x3a')]=_[_0xe40e('0x38')](_0xde1df8['model'],qs['fields'](_0x486efe[_0xe40e('0x36')][_0xe40e('0x3b')]));_0xa14a9d['attributes']=_0xa14a9d[_0xe40e('0x3a')][_0xe40e('0x3c')]?_0xa14a9d[_0xe40e('0x3a')]:_0xde1df8[_0xe40e('0x39')];if(!_0x486efe[_0xe40e('0x36')][_0xe40e('0x3d')](_0xe40e('0x3e'))){_0xa14a9d['limit']=qs[_0xe40e('0x20')](_0x486efe[_0xe40e('0x36')][_0xe40e('0x20')]);_0xa14a9d[_0xe40e('0x22')]=qs[_0xe40e('0x22')](_0x486efe['query'][_0xe40e('0x22')]);}_0xa14a9d[_0xe40e('0x3f')]=qs['sort'](_0x486efe[_0xe40e('0x36')][_0xe40e('0x40')]);_0xa14a9d[_0xe40e('0x41')]=qs['filters'](_[_0xe40e('0x42')](_0x486efe[_0xe40e('0x36')],_0xde1df8['filters']),_0x5cf95e);if(_0x486efe['query'][_0xe40e('0x43')]){_0xa14a9d[_0xe40e('0x41')]=_[_0xe40e('0x44')](_0xa14a9d[_0xe40e('0x41')],{'$or':_[_0xe40e('0x35')](_0x5cf95e,function(_0x59ba01){if(_0x59ba01[_0xe40e('0x33')]!==_0xe40e('0x45')){var _0x1765b2={};_0x1765b2[_0x59ba01[_0xe40e('0x2f')]]={'$like':'%'+_0x486efe['query']['filter']+'%'};return _0x1765b2;}})});}_0xa14a9d=_[_0xe40e('0x44')]({},_0xa14a9d,_0x486efe[_0xe40e('0x46')]);var _0x2ff272={'where':_0xa14a9d[_0xe40e('0x41')]};return db['Interval']['count'](_0x2ff272)[_0xe40e('0x28')](function(_0x1aa2e5){_0x1c6f90['count']=_0x1aa2e5;if(_0x486efe['query']['includeAll']){_0xa14a9d['include']=[{'all':!![]}];}return db['Interval'][_0xe40e('0x47')](_0xa14a9d);})[_0xe40e('0x28')](function(_0x56176b){_0x1c6f90[_0xe40e('0x48')]=_0x56176b;return _0x1c6f90;})[_0xe40e('0x28')](respondWithFilteredResult(_0x413054,_0xa14a9d))['catch'](handleError(_0x413054,null));};exports[_0xe40e('0x49')]=function(_0x3769e9,_0x2a4afc){var _0x4fd194={'raw':!![],'where':{'id':_0x3769e9['params']['id']}},_0x44d9fe={};_0x44d9fe['model']=_['keys'](db[_0xe40e('0x4a')]['rawAttributes']);_0x44d9fe[_0xe40e('0x36')]=_[_0xe40e('0x4b')](_0x3769e9[_0xe40e('0x36')]);_0x44d9fe[_0xe40e('0x37')]=_['intersection'](_0x44d9fe[_0xe40e('0x39')],_0x44d9fe[_0xe40e('0x36')]);_0x4fd194[_0xe40e('0x3a')]=_[_0xe40e('0x38')](_0x44d9fe[_0xe40e('0x39')],qs[_0xe40e('0x3b')](_0x3769e9[_0xe40e('0x36')][_0xe40e('0x3b')]));_0x4fd194[_0xe40e('0x3a')]=_0x4fd194['attributes'][_0xe40e('0x3c')]?_0x4fd194[_0xe40e('0x3a')]:_0x44d9fe[_0xe40e('0x39')];if(_0x3769e9[_0xe40e('0x36')]['includeAll']){_0x4fd194[_0xe40e('0x4c')]=[{'all':!![]}];}_0x4fd194=_[_0xe40e('0x44')]({},_0x4fd194,_0x3769e9['options']);return db['Interval'][_0xe40e('0x4d')](_0x4fd194)['then'](handleEntityNotFound(_0x2a4afc,null))[_0xe40e('0x28')](respondWithResult(_0x2a4afc,null))[_0xe40e('0x4e')](handleError(_0x2a4afc,null));};exports[_0xe40e('0x4f')]=function(_0x3403c3,_0x5203e9){return db[_0xe40e('0x4a')][_0xe40e('0x4f')](_0x3403c3[_0xe40e('0x50')],{})[_0xe40e('0x28')](function(_0x56ff62){var _0x28f852=_0x3403c3[_0xe40e('0x51')][_0xe40e('0x29')]({'plain':!![]});if(!_0x28f852)throw new Error(_0xe40e('0x52'));if(_0x28f852[_0xe40e('0x53')]===_0xe40e('0x51')){var _0xe3296e=_0x56ff62[_0xe40e('0x29')]({'plain':!![]});var _0x4d7651=_0xe40e('0x2a');return db['UserProfileSection'][_0xe40e('0x4d')]({'where':{'name':_0x4d7651,'userProfileId':_0x28f852[_0xe40e('0x54')]},'raw':!![]})['then'](function(_0x2f4845){if(_0x2f4845&&_0x2f4845[_0xe40e('0x55')]===0x0){return db[_0xe40e('0x2b')]['create']({'name':_0xe3296e[_0xe40e('0x2f')],'resourceId':_0xe3296e['id'],'type':_0x2f4845[_0xe40e('0x2f')],'sectionId':_0x2f4845['id']},{})['then'](function(){return _0x56ff62;});}else{return _0x56ff62;}})[_0xe40e('0x4e')](function(_0x1a6dd7){logger[_0xe40e('0x2d')](_0xe40e('0x56'),_0x1a6dd7);throw _0x1a6dd7;});}return _0x56ff62;})[_0xe40e('0x28')](respondWithResult(_0x5203e9,0xc9))[_0xe40e('0x4e')](handleError(_0x5203e9,null));};exports[_0xe40e('0x26')]=function(_0x320e74,_0x35c062){if(_0x320e74[_0xe40e('0x50')]['id']){delete _0x320e74[_0xe40e('0x50')]['id'];}return db[_0xe40e('0x4a')][_0xe40e('0x4d')]({'where':{'id':_0x320e74[_0xe40e('0x57')]['id']}})['then'](handleEntityNotFound(_0x35c062,null))[_0xe40e('0x28')](saveUpdates(_0x320e74['body'],null))[_0xe40e('0x28')](respondWithResult(_0x35c062,null))[_0xe40e('0x4e')](handleError(_0x35c062,null));};exports[_0xe40e('0x27')]=function(_0x56d30e,_0x579b85){return db[_0xe40e('0x4a')][_0xe40e('0x4d')]({'where':{'id':_0x56d30e[_0xe40e('0x57')]['id']}})[_0xe40e('0x28')](handleEntityNotFound(_0x579b85,null))[_0xe40e('0x28')](removeEntity(_0x579b85,null))[_0xe40e('0x4e')](handleError(_0x579b85,null));};exports[_0xe40e('0x58')]=function(_0x58563f,_0x10a918,_0x3ee901){if(_0x58563f[_0xe40e('0x50')]['id']){delete _0x58563f[_0xe40e('0x50')]['id'];}return db[_0xe40e('0x4a')][_0xe40e('0x4d')]({'where':{'id':_0x58563f[_0xe40e('0x57')]['id']}})[_0xe40e('0x28')](handleEntityNotFound(_0x10a918,null))[_0xe40e('0x28')](function(_0x515e5b){if(_0x515e5b){_0x58563f['body']['IntervalId']=_0x515e5b['id'];return db[_0xe40e('0x4a')][_0xe40e('0x4f')](_0x58563f[_0xe40e('0x50')]);}})[_0xe40e('0x28')](respondWithResult(_0x10a918,null))['catch'](handleError(_0x10a918,null));};exports['getIntervals']=function(_0x120c1e,_0x58229c,_0x58d53b){var _0x12fe8e={};var _0x3dc3a3={};var _0x491486;var _0x6cfd53;return db[_0xe40e('0x4a')][_0xe40e('0x59')]({'where':{'id':_0x120c1e[_0xe40e('0x57')]['id']}})[_0xe40e('0x28')](handleEntityNotFound(_0x58229c,null))[_0xe40e('0x28')](function(_0x1c18c5){if(_0x1c18c5){_0x491486=_0x1c18c5;_0x3dc3a3[_0xe40e('0x39')]=_[_0xe40e('0x4b')](db['Interval'][_0xe40e('0x5a')]);_0x3dc3a3[_0xe40e('0x36')]=_[_0xe40e('0x4b')](_0x120c1e['query']);_0x3dc3a3[_0xe40e('0x37')]=_[_0xe40e('0x38')](_0x3dc3a3[_0xe40e('0x39')],_0x3dc3a3[_0xe40e('0x36')]);_0x12fe8e[_0xe40e('0x3a')]=_['intersection'](_0x3dc3a3[_0xe40e('0x39')],qs[_0xe40e('0x3b')](_0x120c1e[_0xe40e('0x36')][_0xe40e('0x3b')]));_0x12fe8e['attributes']=_0x12fe8e[_0xe40e('0x3a')][_0xe40e('0x3c')]?_0x12fe8e[_0xe40e('0x3a')]:_0x3dc3a3[_0xe40e('0x39')];_0x12fe8e[_0xe40e('0x3f')]=qs[_0xe40e('0x40')](_0x120c1e['query']['sort']);_0x12fe8e[_0xe40e('0x41')]=qs[_0xe40e('0x37')](_[_0xe40e('0x42')](_0x120c1e[_0xe40e('0x36')],_0x3dc3a3[_0xe40e('0x37')]));if(_0x120c1e[_0xe40e('0x36')]['filter']){_0x12fe8e[_0xe40e('0x41')]=_[_0xe40e('0x44')](_0x12fe8e[_0xe40e('0x41')],{'$or':_['map'](_0x12fe8e[_0xe40e('0x3a')],function(_0x53c2d6){var _0x528ab6={};_0x528ab6[_0x53c2d6]={'$like':'%'+_0x120c1e[_0xe40e('0x36')][_0xe40e('0x43')]+'%'};return _0x528ab6;})});}_0x12fe8e=_[_0xe40e('0x44')]({},_0x12fe8e,_0x120c1e[_0xe40e('0x46')]);return _0x491486[_0xe40e('0x5b')](_0x12fe8e);}})['then'](function(_0x1ee38b){if(_0x1ee38b){_0x6cfd53=_0x1ee38b['length'];if(!_0x120c1e[_0xe40e('0x36')]['hasOwnProperty'](_0xe40e('0x3e'))){_0x12fe8e[_0xe40e('0x20')]=qs[_0xe40e('0x20')](_0x120c1e['query']['limit']);_0x12fe8e['offset']=qs[_0xe40e('0x22')](_0x120c1e[_0xe40e('0x36')][_0xe40e('0x22')]);}return _0x491486['getIntervals'](_0x12fe8e);}})[_0xe40e('0x28')](function(_0x34397d){if(_0x34397d){return _0x34397d?{'count':_0x6cfd53,'rows':_0x34397d}:null;}})[_0xe40e('0x28')](respondWithResult(_0x58229c,null))[_0xe40e('0x4e')](handleError(_0x58229c,null));};exports['addIntervals']=function(_0x346b1c,_0x136355,_0x43e172){return db[_0xe40e('0x4a')][_0xe40e('0x59')]({'where':{'id':_0x346b1c['params']['id']}})[_0xe40e('0x28')](handleEntityNotFound(_0x136355,null))[_0xe40e('0x28')](function(_0xee83dc){if(_0xee83dc){return db[_0xe40e('0x5c')][_0xe40e('0x5d')](function(_0x1f2b52){return db['Interval'][_0xe40e('0x27')]({'where':{'IntervalId':_0x346b1c[_0xe40e('0x57')]['id']},'transaction':_0x1f2b52})[_0xe40e('0x28')](function(_0x159c14){var _0x28b068=_[_0xe40e('0x35')](_0x346b1c[_0xe40e('0x50')],function(_0x5b7a43){delete _0x5b7a43['id'];_0x5b7a43[_0xe40e('0x5e')]=_0x346b1c[_0xe40e('0x57')]['id'];return _0x5b7a43;});return db[_0xe40e('0x4a')][_0xe40e('0x5f')](_0x28b068,{'transaction':_0x1f2b52});});})[_0xe40e('0x28')](function(){return db[_0xe40e('0x4a')]['findAll']({'where':{'IntervalId':_0x346b1c[_0xe40e('0x57')]['id']}});});}})[_0xe40e('0x28')](respondWithResult(_0x136355,null))[_0xe40e('0x4e')](handleError(_0x136355,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 217c1dc..729b22b 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 _0xd2af=['tools_intervals','rewrite','interval','string','getIntervals','all','map','ifTime','./interval.attributes','iftime','exports','define','Interval'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd2af,0xbe));var _0xfd2a=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xd2af[_0x29db36];return _0x234e87;};'use strict';var attributes=require(_0xfd2a('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0xfd2a('0x1')];module[_0xfd2a('0x2')]=function(_0x718317){return _0x718317[_0xfd2a('0x3')](_0xfd2a('0x4'),attributes,{'tableName':_0xfd2a('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bfb77){extensions[_0xfd2a('0x6')](_0x718317,_0x2bfb77);},'afterBulkCreate':function(_0x127c6f,_0x4ea201,_0x308532){_0x308532();extensions[_0xfd2a('0x6')](_0x718317,_0x127c6f[0x0]);},'afterUpdate':function(_0x52fe2d){extensions['rewrite'](_0x718317,_0x52fe2d);},'afterDestroy':function(_0x166794){extensions[_0xfd2a('0x6')](_0x718317,_0x166794);}},'instanceMethods':{'ifTime':function(_0x46c9d3=undefined,_0x5c314d=new Date()){if(typeof this[_0xfd2a('0x7')]===_0xfd2a('0x8')){return iftime(this['interval'],_0x46c9d3,_0x5c314d);}else{return this[_0xfd2a('0x9')]()['then'](function(_0x45530b){return Promise[_0xfd2a('0xa')](_0x45530b[_0xfd2a('0xb')](function(_0x3934ec){return _0x3934ec[_0xfd2a('0xc')](_0x46c9d3,_0x5c314d);}));})['then'](function(_0x49cb0a){return _0x49cb0a['reduce'](function(_0x16c1da,_0x84f5dd){return _0x16c1da||_0x84f5dd;},![]);});}}}});}; \ No newline at end of file +var _0x63b9=['interval','getIntervals','then','all','reduce','../../components/extensions/rewrite','iftime','define','Interval','rewrite'];(function(_0x26793a,_0x49cf51){var _0x575efb=function(_0x2f4db7){while(--_0x2f4db7){_0x26793a['push'](_0x26793a['shift']());}};_0x575efb(++_0x49cf51);}(_0x63b9,0x159));var _0x963b=function(_0x4f30c5,_0x5414b2){_0x4f30c5=_0x4f30c5-0x0;var _0x1eabaa=_0x63b9[_0x4f30c5];return _0x1eabaa;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x963b('0x0'));var iftime=require('../../utils/iftime')[_0x963b('0x1')];module['exports']=function(_0x5db281){return _0x5db281[_0x963b('0x2')](_0x963b('0x3'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x45d8cd){extensions[_0x963b('0x4')](_0x5db281,_0x45d8cd);},'afterBulkCreate':function(_0x2daa77,_0x400e94,_0x5237ea){_0x5237ea();extensions[_0x963b('0x4')](_0x5db281,_0x2daa77[0x0]);},'afterUpdate':function(_0x16465){extensions[_0x963b('0x4')](_0x5db281,_0x16465);},'afterDestroy':function(_0x367668){extensions[_0x963b('0x4')](_0x5db281,_0x367668);}},'instanceMethods':{'ifTime':function(_0x431c79=undefined,_0x55f931=new Date()){if(typeof this[_0x963b('0x5')]==='string'){return iftime(this[_0x963b('0x5')],_0x431c79,_0x55f931);}else{return this[_0x963b('0x6')]()[_0x963b('0x7')](function(_0x30d748){return Promise[_0x963b('0x8')](_0x30d748['map'](function(_0x3d9b6f){return _0x3d9b6f['ifTime'](_0x431c79,_0x55f931);}));})[_0x963b('0x7')](function(_0x1664b0){return _0x1664b0[_0x963b('0x9')](function(_0x58b427,_0x39572c){return _0x58b427||_0x39572c;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f98ba21..a5adf1d 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 _0xab67=['catch','message','error','Interval','then','info','ShowInterval','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','format','ifTime','IntervalIftime','intervalIds','isArray','intervals','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','resolve','lodash','util','../../mysqldb','../../config/logger','rpc','GetInterval','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0xab67,0x117));var _0x7ab6=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0xab67[_0x48c4ef];return _0x435715;};'use strict';var _=require(_0x7ab6('0x0'));var util=require(_0x7ab6('0x1'));var db=require(_0x7ab6('0x2'))['db'];var iftime=require('../../utils/iftime')['iftime'];var logger=require(_0x7ab6('0x3'))(_0x7ab6('0x4'));exports[_0x7ab6('0x5')]=function(_0x5d6af2){var _0x4ef843=this;return new Promise(function(_0x37f77b,_0x33c2c8){return db['Interval'][_0x7ab6('0x6')]({'raw':_0x5d6af2['options']?_0x5d6af2[_0x7ab6('0x7')][_0x7ab6('0x8')]===undefined?!![]:![]:!![],'where':_0x5d6af2[_0x7ab6('0x7')]?_0x5d6af2[_0x7ab6('0x7')][_0x7ab6('0x9')]||null:null,'attributes':_0x5d6af2['options']?_0x5d6af2[_0x7ab6('0x7')][_0x7ab6('0xa')]||null:null,'limit':_0x5d6af2[_0x7ab6('0x7')]?_0x5d6af2[_0x7ab6('0x7')][_0x7ab6('0xb')]||null:null,'include':_0x5d6af2[_0x7ab6('0x7')]?_0x5d6af2['options'][_0x7ab6('0xc')]?_[_0x7ab6('0xd')](_0x5d6af2[_0x7ab6('0x7')][_0x7ab6('0xc')],function(_0x3b12f8){return{'model':db[_0x3b12f8[_0x7ab6('0xe')]],'as':_0x3b12f8['as'],'attributes':_0x3b12f8[_0x7ab6('0xa')],'include':_0x3b12f8[_0x7ab6('0xc')]?_[_0x7ab6('0xd')](_0x3b12f8[_0x7ab6('0xc')],function(_0x4f3bed){return{'model':db[_0x4f3bed['model']],'as':_0x4f3bed['as'],'attributes':_0x4f3bed[_0x7ab6('0xa')],'include':_0x4f3bed[_0x7ab6('0xc')]?_[_0x7ab6('0xd')](_0x4f3bed[_0x7ab6('0xc')],function(_0x55bcb9){return{'model':db[_0x55bcb9[_0x7ab6('0xe')]],'as':_0x55bcb9['as'],'attributes':_0x55bcb9[_0x7ab6('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b2e8b){logger['info']('GetInterval',_0x5d6af2);logger[_0x7ab6('0xf')](_0x7ab6('0x5'),_0x5d6af2,JSON[_0x7ab6('0x10')](_0x1b2e8b));_0x37f77b(_0x1b2e8b);})[_0x7ab6('0x11')](function(_0x2a51f0){logger['error'](_0x7ab6('0x5'),_0x2a51f0[_0x7ab6('0x12')],_0x5d6af2);_0x33c2c8(_0x4ef843[_0x7ab6('0x13')](0x1f4,_0x2a51f0[_0x7ab6('0x12')]));});});};exports['ShowInterval']=function(_0x518e39){var _0x390208=this;return new Promise(function(_0x1d7468,_0x11c6f0){return db[_0x7ab6('0x14')]['find']({'raw':_0x518e39[_0x7ab6('0x7')]?_0x518e39[_0x7ab6('0x7')][_0x7ab6('0x8')]===undefined?!![]:![]:!![],'where':_0x518e39[_0x7ab6('0x7')]?_0x518e39[_0x7ab6('0x7')][_0x7ab6('0x9')]||null:null,'attributes':_0x518e39['options']?_0x518e39[_0x7ab6('0x7')][_0x7ab6('0xa')]||null:null,'include':_0x518e39[_0x7ab6('0x7')]?_0x518e39[_0x7ab6('0x7')]['include']?_[_0x7ab6('0xd')](_0x518e39['options'][_0x7ab6('0xc')],function(_0x259f59){return{'model':db[_0x259f59[_0x7ab6('0xe')]],'as':_0x259f59['as'],'attributes':_0x259f59[_0x7ab6('0xa')],'include':_0x259f59[_0x7ab6('0xc')]?_[_0x7ab6('0xd')](_0x259f59['include'],function(_0x5ed5d5){return{'model':db[_0x5ed5d5['model']],'as':_0x5ed5d5['as'],'attributes':_0x5ed5d5[_0x7ab6('0xa')],'include':_0x5ed5d5['include']?_[_0x7ab6('0xd')](_0x5ed5d5[_0x7ab6('0xc')],function(_0x4bec5b){return{'model':db[_0x4bec5b[_0x7ab6('0xe')]],'as':_0x4bec5b['as'],'attributes':_0x4bec5b[_0x7ab6('0xa')]};}):[]};}):[]};}):[]:[]})[_0x7ab6('0x15')](function(_0x18871c){logger[_0x7ab6('0x16')]('ShowInterval',_0x518e39);logger[_0x7ab6('0xf')]('ShowInterval',_0x518e39,JSON[_0x7ab6('0x10')](_0x18871c));_0x1d7468(_0x18871c);})[_0x7ab6('0x11')](function(_0x34d3ce){logger[_0x7ab6('0x13')](_0x7ab6('0x17'),_0x34d3ce[_0x7ab6('0x12')],_0x518e39);_0x11c6f0(_0x390208[_0x7ab6('0x13')](0x1f4,_0x34d3ce[_0x7ab6('0x12')]));});});};function checkArrayOfIntervals(_0x4fd597,_0x56c4a6){var _0x5b2c4c=[];return db[_0x7ab6('0x14')][_0x7ab6('0x6')]({'where':{'id':_0x4fd597}})[_0x7ab6('0x15')](function(_0x5720a5){_0x5b2c4c=_0x5720a5;return Promise['all'](_0x5b2c4c['map'](function(_0x21c4d2){return _0x21c4d2['ifTime'](_0x56c4a6);}));})[_0x7ab6('0x15')](function(_0x1a9fc5){var _0x3faae4=_0x1a9fc5[_0x7ab6('0x18')](function(_0x12afc0,_0x2bd01a){return _0x12afc0||_0x2bd01a;},![]);logger[_0x7ab6('0x16')](util['format'](_0x7ab6('0x19'),_0x5b2c4c[_0x7ab6('0xd')](function(_0x37826b){return _0x37826b[_0x7ab6('0x1a')];})[_0x7ab6('0x1b')](',\x20'),_0x5b2c4c['map'](function(_0x3b8a82){return _0x3b8a82['id'];})[_0x7ab6('0x1b')](',\x20')));return _0x3faae4;});}function checkSingleInterval(_0x794580,_0x2c0913){return db[_0x7ab6('0x14')]['findById'](_0x794580)['then'](function(_0x5dbbb3){if(_0x5dbbb3){logger[_0x7ab6('0x16')](util[_0x7ab6('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x5dbbb3['name'],_0x5dbbb3['id']));return _0x5dbbb3[_0x7ab6('0x1d')](_0x2c0913);}});}exports[_0x7ab6('0x1e')]=function(_0x499555){var _0x42f210=_0x499555[_0x7ab6('0x1f')];var _0x27aa97=Array[_0x7ab6('0x20')](_0x499555[_0x7ab6('0x21')])?_0x499555[_0x7ab6('0x21')]:typeof _0x499555['intervals']==='string'?[_0x499555['intervals']]:[];var _0x381b9a=_0x499555['timezone']||undefined;var _0x4db64d=![];if(_0x27aa97['length']){logger['info'](util[_0x7ab6('0x1c')](_0x7ab6('0x22'),_0x27aa97['join'](';\x20')));}if(_0x381b9a){logger[_0x7ab6('0x16')](util[_0x7ab6('0x1c')](_0x7ab6('0x23'),_0x381b9a));}logger[_0x7ab6('0xf')]('Iftime',_0x4db64d);logger['silly'](_0x7ab6('0x1e'),_0x499555);return Promise[_0x7ab6('0x24')]()[_0x7ab6('0x15')](function(){if(Array[_0x7ab6('0x20')](_0x42f210)){return checkArrayOfIntervals(_0x42f210,_0x381b9a);}else if(_0x42f210){return checkSingleInterval(_0x42f210,_0x381b9a);}})['then'](function(_0x8c9eda){var _0x36ed7=_0x27aa97[_0x7ab6('0x18')](function(_0x2ac9ff,_0x43653e){return _0x2ac9ff||iftime(_0x43653e,_0x381b9a);},![]);_0x4db64d=_0x8c9eda||_0x36ed7;return _0x4db64d;})[_0x7ab6('0x11')](function(_0x3fef62){logger['error']('IntervalIftime',_0x499555,_0x3fef62);throw this[_0x7ab6('0x13')](0x1f4,_0x3fef62[_0x7ab6('0x12')]);});}; \ No newline at end of file +var _0xb9b3=['map','attributes','model','info','debug','stringify','catch','error','message','ShowInterval','find','then','all','ifTime','reduce','format','findById','IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','where','limit','include'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xb9b3,0x10b));var _0x3b9b=function(_0x16d068,_0x3be4e3){_0x16d068=_0x16d068-0x0;var _0x1c17ad=_0xb9b3[_0x16d068];return _0x1c17ad;};'use strict';var _=require(_0x3b9b('0x0'));var util=require(_0x3b9b('0x1'));var db=require(_0x3b9b('0x2'))['db'];var iftime=require(_0x3b9b('0x3'))[_0x3b9b('0x4')];var logger=require('../../config/logger')(_0x3b9b('0x5'));exports[_0x3b9b('0x6')]=function(_0x2804b0){var _0x59e7f9=this;return new Promise(function(_0x49e959,_0x3079f1){return db[_0x3b9b('0x7')][_0x3b9b('0x8')]({'raw':_0x2804b0[_0x3b9b('0x9')]?_0x2804b0[_0x3b9b('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x2804b0['options']?_0x2804b0[_0x3b9b('0x9')][_0x3b9b('0xa')]||null:null,'attributes':_0x2804b0['options']?_0x2804b0[_0x3b9b('0x9')]['attributes']||null:null,'limit':_0x2804b0[_0x3b9b('0x9')]?_0x2804b0[_0x3b9b('0x9')][_0x3b9b('0xb')]||null:null,'include':_0x2804b0[_0x3b9b('0x9')]?_0x2804b0[_0x3b9b('0x9')][_0x3b9b('0xc')]?_[_0x3b9b('0xd')](_0x2804b0['options'][_0x3b9b('0xc')],function(_0x4b5f68){return{'model':db[_0x4b5f68['model']],'as':_0x4b5f68['as'],'attributes':_0x4b5f68[_0x3b9b('0xe')],'include':_0x4b5f68['include']?_[_0x3b9b('0xd')](_0x4b5f68['include'],function(_0x1926c2){return{'model':db[_0x1926c2[_0x3b9b('0xf')]],'as':_0x1926c2['as'],'attributes':_0x1926c2[_0x3b9b('0xe')],'include':_0x1926c2[_0x3b9b('0xc')]?_[_0x3b9b('0xd')](_0x1926c2[_0x3b9b('0xc')],function(_0xa7427f){return{'model':db[_0xa7427f[_0x3b9b('0xf')]],'as':_0xa7427f['as'],'attributes':_0xa7427f[_0x3b9b('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ed4cb){logger[_0x3b9b('0x10')](_0x3b9b('0x6'),_0x2804b0);logger[_0x3b9b('0x11')](_0x3b9b('0x6'),_0x2804b0,JSON[_0x3b9b('0x12')](_0x3ed4cb));_0x49e959(_0x3ed4cb);})[_0x3b9b('0x13')](function(_0xd3861b){logger[_0x3b9b('0x14')](_0x3b9b('0x6'),_0xd3861b[_0x3b9b('0x15')],_0x2804b0);_0x3079f1(_0x59e7f9['error'](0x1f4,_0xd3861b['message']));});});};exports[_0x3b9b('0x16')]=function(_0x4470da){var _0x39f71d=this;return new Promise(function(_0x52cdcf,_0x555d6d){return db[_0x3b9b('0x7')][_0x3b9b('0x17')]({'raw':_0x4470da['options']?_0x4470da[_0x3b9b('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4470da[_0x3b9b('0x9')]?_0x4470da[_0x3b9b('0x9')][_0x3b9b('0xa')]||null:null,'attributes':_0x4470da['options']?_0x4470da[_0x3b9b('0x9')][_0x3b9b('0xe')]||null:null,'include':_0x4470da[_0x3b9b('0x9')]?_0x4470da[_0x3b9b('0x9')][_0x3b9b('0xc')]?_[_0x3b9b('0xd')](_0x4470da[_0x3b9b('0x9')][_0x3b9b('0xc')],function(_0x455f01){return{'model':db[_0x455f01['model']],'as':_0x455f01['as'],'attributes':_0x455f01[_0x3b9b('0xe')],'include':_0x455f01[_0x3b9b('0xc')]?_[_0x3b9b('0xd')](_0x455f01['include'],function(_0x3dd01f){return{'model':db[_0x3dd01f[_0x3b9b('0xf')]],'as':_0x3dd01f['as'],'attributes':_0x3dd01f['attributes'],'include':_0x3dd01f['include']?_[_0x3b9b('0xd')](_0x3dd01f[_0x3b9b('0xc')],function(_0x5b9f20){return{'model':db[_0x5b9f20[_0x3b9b('0xf')]],'as':_0x5b9f20['as'],'attributes':_0x5b9f20[_0x3b9b('0xe')]};}):[]};}):[]};}):[]:[]})[_0x3b9b('0x18')](function(_0xf1ce8d){logger[_0x3b9b('0x10')]('ShowInterval',_0x4470da);logger['debug'](_0x3b9b('0x16'),_0x4470da,JSON[_0x3b9b('0x12')](_0xf1ce8d));_0x52cdcf(_0xf1ce8d);})[_0x3b9b('0x13')](function(_0x577742){logger[_0x3b9b('0x14')](_0x3b9b('0x16'),_0x577742[_0x3b9b('0x15')],_0x4470da);_0x555d6d(_0x39f71d['error'](0x1f4,_0x577742[_0x3b9b('0x15')]));});});};function checkArrayOfIntervals(_0x46c899,_0x5516e3){var _0x251d49=[];return db[_0x3b9b('0x7')]['findAll']({'where':{'id':_0x46c899}})[_0x3b9b('0x18')](function(_0x397305){_0x251d49=_0x397305;return Promise[_0x3b9b('0x19')](_0x251d49['map'](function(_0x39faaf){return _0x39faaf[_0x3b9b('0x1a')](_0x5516e3);}));})[_0x3b9b('0x18')](function(_0x32333d){var _0x2fa6a8=_0x32333d[_0x3b9b('0x1b')](function(_0x3e503f,_0xb37ceb){return _0x3e503f||_0xb37ceb;},![]);logger[_0x3b9b('0x10')](util[_0x3b9b('0x1c')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x251d49['map'](function(_0x54ec0a){return _0x54ec0a['name'];})['join'](',\x20'),_0x251d49[_0x3b9b('0xd')](function(_0x2950a2){return _0x2950a2['id'];})['join'](',\x20')));return _0x2fa6a8;});}function checkSingleInterval(_0x45198c,_0x4f7b33){return db['Interval'][_0x3b9b('0x1d')](_0x45198c)['then'](function(_0x48db9e){if(_0x48db9e){logger[_0x3b9b('0x10')](util[_0x3b9b('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x48db9e['name'],_0x48db9e['id']));return _0x48db9e[_0x3b9b('0x1a')](_0x4f7b33);}});}exports[_0x3b9b('0x1e')]=function(_0x239537){var _0x5b4215=_0x239537[_0x3b9b('0x1f')];var _0x4f6d30=Array[_0x3b9b('0x20')](_0x239537[_0x3b9b('0x21')])?_0x239537[_0x3b9b('0x21')]:typeof _0x239537[_0x3b9b('0x21')]===_0x3b9b('0x22')?[_0x239537[_0x3b9b('0x21')]]:[];var _0x5c8459=_0x239537['timezone']||undefined;var _0x397daa=![];if(_0x4f6d30[_0x3b9b('0x23')]){logger[_0x3b9b('0x10')](util['format']('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x4f6d30['join'](';\x20')));}if(_0x5c8459){logger[_0x3b9b('0x10')](util['format'](_0x3b9b('0x24'),_0x5c8459));}logger['debug'](_0x3b9b('0x25'),_0x397daa);logger[_0x3b9b('0x26')]('IntervalIftime',_0x239537);return Promise[_0x3b9b('0x27')]()[_0x3b9b('0x18')](function(){if(Array[_0x3b9b('0x20')](_0x5b4215)){return checkArrayOfIntervals(_0x5b4215,_0x5c8459);}else if(_0x5b4215){return checkSingleInterval(_0x5b4215,_0x5c8459);}})['then'](function(_0x37ef81){var _0x4fb260=_0x4f6d30[_0x3b9b('0x1b')](function(_0x237ab3,_0x43c82c){return _0x237ab3||iftime(_0x43c82c,_0x5c8459);},![]);_0x397daa=_0x37ef81||_0x4fb260;return _0x397daa;})[_0x3b9b('0x13')](function(_0x41629e){logger[_0x3b9b('0x14')](_0x3b9b('0x1e'),_0x239537,_0x41629e);throw this[_0x3b9b('0x14')](0x1f4,_0x41629e[_0x3b9b('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d611acb..c917070 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(_0x104242,_0x5e904f){var _0x202f80=function(_0x49e24d){while(--_0x49e24d){_0x104242['push'](_0x104242['shift']());}};_0x202f80(++_0x5e904f);}(_0x2032,0xd9));var _0x2203=function(_0x239cdf,_0x9759ac){_0x239cdf=_0x239cdf-0x0;var _0x40e9ac=_0x2032[_0x239cdf];return _0x40e9ac;};'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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x1773d2,_0x3dcf49){var _0x1b850d=function(_0x127a0d){while(--_0x127a0d){_0x1773d2['push'](_0x1773d2['shift']());}};_0x1b850d(++_0x3dcf49);}(_0x2ef3,0xba));var _0x32ef=function(_0x4cd4b0,_0x10d16f){_0x4cd4b0=_0x4cd4b0-0x0;var _0x3d9b63=_0x2ef3[_0x4cd4b0];return _0x3d9b63;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('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 05124d5..f104798 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 _0xb84a=['track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','write','openIssue','send','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','customfield_11500','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_10102'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb84a,0x9b));var _0xab84=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb84a[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xab84('0x0'));var https=require(_0xab84('0x1'));var logger=require(_0xab84('0x2'))('api');var USERNAME='support';var PASSWORD=_0xab84('0x3');function openIssue(_0x1ff85f,_0x5805dc){var _0x38c83f={'fields':{'project':{'key':_0x1ff85f[_0xab84('0x4')]||_0xab84('0x5')},'summary':(_0x1ff85f[_0xab84('0x6')]||_0xab84('0x7'))+_0xab84('0x8')+_0x1ff85f['ip'],'description':_0x1ff85f[_0xab84('0x9')]||JSON[_0xab84('0xa')](_0x1ff85f),'issuetype':{'name':_0x1ff85f[_0xab84('0xb')]||'Bug'}}};_0x38c83f['fields'][_0xab84('0xc')]=_0x1ff85f['email'];_0x38c83f[_0xab84('0xd')][_0xab84('0xe')]=_0x1ff85f[_0xab84('0xf')];_0x38c83f[_0xab84('0xd')][_0xab84('0x10')]=_0x1ff85f[_0xab84('0x11')];_0x38c83f[_0xab84('0xd')][_0xab84('0x12')]=_0x1ff85f[_0xab84('0x13')];_0x38c83f[_0xab84('0xd')]['customfield_11504']=_0x1ff85f['reason'];_0x38c83f[_0xab84('0xd')][_0xab84('0x14')]=_0x1ff85f['ip'];var _0xe52009={'host':_0xab84('0x15'),'port':0x1bb,'path':_0xab84('0x16'),'method':_0xab84('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xab84('0x18'),'Authorization':_0xab84('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xab84('0x1a')]('base64')}};var _0x26d64e=JSON[_0xab84('0xa')](_0x38c83f);var _0x3925e5=https[_0xab84('0x1b')](_0xe52009,function(_0x246752){_0x246752[_0xab84('0x1c')](_0xab84('0x1d'));var _0x2032c5='';_0x246752['on'](_0xab84('0x1e'),function(_0x1df6c5){_0x2032c5+=_0x1df6c5;});_0x246752['on'](_0xab84('0x1f'),function(){if(_0x5805dc){return _0x5805dc[_0xab84('0x20')](_0x246752[_0xab84('0x21')])[_0xab84('0x22')](JSON[_0xab84('0x23')](_0x2032c5));}});});_0x3925e5['on'](_0xab84('0x24'),function(_0x28ea88){if(_0x5805dc){return _0x5805dc[_0xab84('0x20')](0x1f4)[_0xab84('0x22')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x3925e5[_0xab84('0x25')](_0x26d64e);_0x3925e5[_0xab84('0x1f')]();}exports[_0xab84('0x26')]=openIssue;exports[_0xab84('0x27')]=function(_0x22e5a8,_0x9cb15d){_0x22e5a8['body']['ip']=_0x22e5a8['headers'][_0xab84('0x28')]||_0x22e5a8[_0xab84('0x29')]['remoteAddress']||_0x22e5a8[_0xab84('0x2a')][_0xab84('0x2b')]||_0x22e5a8['connection']['socket'][_0xab84('0x2b')];return openIssue(_0x22e5a8['body'],_0x9cb15d);}; \ No newline at end of file +var _0x8031=['end','openIssue','send','x-forwarded-for','connection','socket','remoteAddress','body','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','issuetype','fields','customfield_11500','customfield_11502','newToken','customfield_11503','reason','customfield_10102','/rest/api/2/issue','toString','base64','stringify','request','setEncoding','utf8','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x8031,0x170));var _0x1803=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x8031[_0x3070dc];return _0x431489;};'use strict';var BPromise=require(_0x1803('0x0'));var https=require(_0x1803('0x1'));var logger=require(_0x1803('0x2'))('api');var USERNAME=_0x1803('0x3');var PASSWORD=_0x1803('0x4');function openIssue(_0xde8d4f,_0x54599d){var _0x2c2242={'fields':{'project':{'key':_0xde8d4f[_0x1803('0x5')]||_0x1803('0x6')},'summary':(_0xde8d4f[_0x1803('0x7')]||'Report')+_0x1803('0x8')+_0xde8d4f['ip'],'description':_0xde8d4f[_0x1803('0x9')]||JSON['stringify'](_0xde8d4f),'issuetype':{'name':_0xde8d4f[_0x1803('0xa')]||'Bug'}}};_0x2c2242[_0x1803('0xb')][_0x1803('0xc')]=_0xde8d4f['email'];_0x2c2242[_0x1803('0xb')]['customfield_11501']=_0xde8d4f['oldToken'];_0x2c2242['fields'][_0x1803('0xd')]=_0xde8d4f[_0x1803('0xe')];_0x2c2242[_0x1803('0xb')][_0x1803('0xf')]=_0xde8d4f['name'];_0x2c2242[_0x1803('0xb')]['customfield_11504']=_0xde8d4f[_0x1803('0x10')];_0x2c2242[_0x1803('0xb')][_0x1803('0x11')]=_0xde8d4f['ip'];var _0x1e3ccb={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x1803('0x12'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x1803('0x13')](_0x1803('0x14'))}};var _0x373c9e=JSON[_0x1803('0x15')](_0x2c2242);var _0x58fb7f=https[_0x1803('0x16')](_0x1e3ccb,function(_0x1ae7b7){_0x1ae7b7[_0x1803('0x17')](_0x1803('0x18'));var _0x32db28='';_0x1ae7b7['on']('data',function(_0x2f25f8){_0x32db28+=_0x2f25f8;});_0x1ae7b7['on']('end',function(){if(_0x54599d){return _0x54599d[_0x1803('0x19')](_0x1ae7b7[_0x1803('0x1a')])[_0x1803('0x1b')](JSON[_0x1803('0x1c')](_0x32db28));}});});_0x58fb7f['on'](_0x1803('0x1d'),function(_0x542f77){if(_0x54599d){return _0x54599d[_0x1803('0x19')](0x1f4)[_0x1803('0x1b')]({'errors':[{'message':_0x1803('0x1e'),'type':_0x1803('0x1f')}]});}});_0x58fb7f['write'](_0x373c9e);_0x58fb7f[_0x1803('0x20')]();}exports[_0x1803('0x21')]=openIssue;exports[_0x1803('0x22')]=function(_0x2968e1,_0x1f5fe6){_0x2968e1['body']['ip']=_0x2968e1['headers'][_0x1803('0x23')]||_0x2968e1[_0x1803('0x24')]['remoteAddress']||_0x2968e1[_0x1803('0x25')][_0x1803('0x26')]||_0x2968e1[_0x1803('0x24')][_0x1803('0x25')][_0x1803('0x26')];return openIssue(_0x2968e1[_0x1803('0x27')],_0x1f5fe6);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 7e1a0ee..0f2d440 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 _0x55e0=['./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x118d61,_0x28b248){var _0x529dec=function(_0x36e546){while(--_0x36e546){_0x118d61['push'](_0x118d61['shift']());}};_0x529dec(++_0x28b248);}(_0x55e0,0xdc));var _0x055e=function(_0x52cb03,_0x3fa29c){_0x52cb03=_0x52cb03-0x0;var _0x30eda2=_0x55e0[_0x52cb03];return _0x30eda2;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/describe',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0x9')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller['show']);router[_0x055e('0xd')]('/',auth[_0x055e('0xa')](),controller[_0x055e('0xe')]);router[_0x055e('0xf')](_0x055e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x055e('0x10')]('/:id',auth[_0x055e('0xa')](),controller[_0x055e('0x11')]);module[_0x055e('0x12')]=router; \ No newline at end of file +var _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x2f91ad,_0x4c5495){var _0x5d25ed=function(_0x318192){while(--_0x318192){_0x2f91ad['push'](_0x2f91ad['shift']());}};_0x5d25ed(++_0x4c5495);}(_0x0bb5,0x148));var _0x50bb=function(_0x850fec,_0x4e0948){_0x850fec=_0x850fec-0x0;var _0x9164b7=_0x0bb5[_0x850fec];return _0x9164b7;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 2ee7ffe..dfa686f 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x3545d5,_0x4fe891){_0x3545d5=_0x3545d5-0x0;var _0x17dc58=_0x7a54[_0x3545d5];return _0x17dc58;};'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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x17a74e,_0x187f3f){_0x17a74e=_0x17a74e-0x0;var _0x4af833=_0x7a54[_0x17a74e];return _0x4af833;};'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 978d224..d32b7c4 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 _0xc949=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','rawAttributes','intersection','include','find','create','body','params','describe'];(function(_0x2f1b22,_0xe099b5){var _0x371b1b=function(_0x524a57){while(--_0x524a57){_0x2f1b22['push'](_0x2f1b22['shift']());}};_0x371b1b(++_0xe099b5);}(_0xc949,0x181));var _0x9c94=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xc949[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require('path');var sox=require(_0x9c94('0x7'));var csv=require(_0x9c94('0x8'));var ejs=require(_0x9c94('0x9'));var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x8'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var licenseUtil=require(_0x9c94('0x19'));var db=require(_0x9c94('0x1a'))['db'];function respondWithStatusCode(_0x423adb,_0x30f64e){_0x30f64e=_0x30f64e||0xcc;return function(_0x1e326f){if(_0x1e326f){return _0x423adb[_0x9c94('0x1b')](_0x30f64e);}return _0x423adb[_0x9c94('0x1c')](_0x30f64e)[_0x9c94('0x1d')]();};}function respondWithResult(_0x15c51c,_0x54d956){_0x54d956=_0x54d956||0xc8;return function(_0x9789bc){if(_0x9789bc){return _0x15c51c['status'](_0x54d956)[_0x9c94('0x1e')](_0x9789bc);}};}function respondWithFilteredResult(_0x26e629,_0x4f0013){return function(_0xe52641){if(_0xe52641){var _0x4d6308=typeof _0x4f0013['offset']===_0x9c94('0x1f')&&typeof _0x4f0013['limit']===_0x9c94('0x1f');var _0x33bd19=_0xe52641['count'];var _0x201e04=_0x4d6308?0x0:_0x4f0013[_0x9c94('0x20')];var _0x412804=_0x4d6308?_0xe52641[_0x9c94('0x21')]:_0x4f0013[_0x9c94('0x20')]+_0x4f0013[_0x9c94('0x22')];var _0x3e361c;if(_0x412804>=_0x33bd19){_0x412804=_0x33bd19;_0x3e361c=0xc8;}else{_0x3e361c=0xce;}_0x26e629['status'](_0x3e361c);return _0x26e629[_0x9c94('0x23')](_0x9c94('0x24'),_0x201e04+'-'+_0x412804+'/'+_0x33bd19)['json'](_0xe52641);}return null;};}function patchUpdates(_0x141801){return function(_0x845304){try{jsonpatch[_0x9c94('0x25')](_0x845304,_0x141801,!![]);}catch(_0x326b38){return BPromise[_0x9c94('0x26')](_0x326b38);}return _0x845304[_0x9c94('0x27')]();};}function saveUpdates(_0xadab16,_0x23cdf5){return function(_0x8fe4fb){if(_0x8fe4fb){return _0x8fe4fb[_0x9c94('0x28')](_0xadab16)[_0x9c94('0x29')](function(_0xe9280a){return _0xe9280a;});}return null;};}function removeEntity(_0x44d732,_0x8c0b7f){return function(_0x5b1020){if(_0x5b1020){return _0x5b1020[_0x9c94('0x2a')]()[_0x9c94('0x29')](function(){_0x44d732['status'](0xcc)[_0x9c94('0x1d')]();});}};}function handleEntityNotFound(_0x2c3d25,_0x4795bb){return function(_0x335184){if(!_0x335184){_0x2c3d25[_0x9c94('0x1b')](0x194);}return _0x335184;};}function handleError(_0x4dd38e,_0xc18230){_0xc18230=_0xc18230||0x1f4;return function(_0x45cf4d){logger['error'](_0x45cf4d[_0x9c94('0x2b')]);if(_0x45cf4d['name']){delete _0x45cf4d[_0x9c94('0x2c')];}_0x4dd38e[_0x9c94('0x1c')](_0xc18230)[_0x9c94('0x2d')](_0x45cf4d);};}exports[_0x9c94('0x2e')]=function(_0x1581c0,_0x3f2622){var _0xf30dd1={},_0x561fdc={},_0x5a6b1c={'count':0x0,'rows':[]};var _0xc4a819=_[_0x9c94('0x2f')](db[_0x9c94('0x30')]['rawAttributes'],function(_0x25a6b9){return{'name':_0x25a6b9['fieldName'],'type':_0x25a6b9[_0x9c94('0x31')][_0x9c94('0x32')]};});_0x561fdc[_0x9c94('0x33')]=_['map'](_0xc4a819,'name');_0x561fdc[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x1581c0[_0x9c94('0x34')]);_0x561fdc['filters']=_['intersection'](_0x561fdc['model'],_0x561fdc['query']);_0xf30dd1[_0x9c94('0x36')]=_['intersection'](_0x561fdc[_0x9c94('0x33')],qs[_0x9c94('0x37')](_0x1581c0['query']['fields']));_0xf30dd1[_0x9c94('0x36')]=_0xf30dd1[_0x9c94('0x36')][_0x9c94('0x38')]?_0xf30dd1[_0x9c94('0x36')]:_0x561fdc[_0x9c94('0x33')];if(!_0x1581c0[_0x9c94('0x34')][_0x9c94('0x39')](_0x9c94('0x3a'))){_0xf30dd1[_0x9c94('0x22')]=qs[_0x9c94('0x22')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x22')]);_0xf30dd1[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x20')]);}_0xf30dd1[_0x9c94('0x3b')]=qs[_0x9c94('0x3c')](_0x1581c0['query'][_0x9c94('0x3c')]);_0xf30dd1[_0x9c94('0x3d')]=qs[_0x9c94('0x3e')](_[_0x9c94('0x3f')](_0x1581c0[_0x9c94('0x34')],_0x561fdc[_0x9c94('0x3e')]),_0xc4a819);if(_0x1581c0[_0x9c94('0x34')]['filter']){_0xf30dd1[_0x9c94('0x3d')]=_['merge'](_0xf30dd1[_0x9c94('0x3d')],{'$or':_[_0x9c94('0x2f')](_0xc4a819,function(_0x442d46){if(_0x442d46[_0x9c94('0x31')]!=='VIRTUAL'){var _0x245278={};_0x245278[_0x442d46['name']]={'$like':'%'+_0x1581c0[_0x9c94('0x34')][_0x9c94('0x40')]+'%'};return _0x245278;}})});}_0xf30dd1=_[_0x9c94('0x41')]({},_0xf30dd1,_0x1581c0['options']);var _0x21e9f7={'where':_0xf30dd1['where']};return db[_0x9c94('0x30')]['count'](_0x21e9f7)['then'](function(_0x9a75f0){_0x5a6b1c[_0x9c94('0x21')]=_0x9a75f0;if(_0x1581c0[_0x9c94('0x34')][_0x9c94('0x42')]){_0xf30dd1['include']=[{'all':!![]}];}return db[_0x9c94('0x30')][_0x9c94('0x43')](_0xf30dd1);})[_0x9c94('0x29')](function(_0x360960){_0x5a6b1c['rows']=_0x360960;return _0x5a6b1c;})[_0x9c94('0x29')](respondWithFilteredResult(_0x3f2622,_0xf30dd1))[_0x9c94('0x44')](handleError(_0x3f2622,null));};exports['show']=function(_0x24e74c,_0x3d8b31){var _0x2a5bd5={'raw':!![],'where':{'id':_0x24e74c['params']['id']}},_0x5e6a90={};_0x5e6a90[_0x9c94('0x33')]=_[_0x9c94('0x35')](db[_0x9c94('0x30')][_0x9c94('0x45')]);_0x5e6a90[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x24e74c[_0x9c94('0x34')]);_0x5e6a90[_0x9c94('0x3e')]=_[_0x9c94('0x46')](_0x5e6a90[_0x9c94('0x33')],_0x5e6a90[_0x9c94('0x34')]);_0x2a5bd5['attributes']=_[_0x9c94('0x46')](_0x5e6a90['model'],qs[_0x9c94('0x37')](_0x24e74c[_0x9c94('0x34')][_0x9c94('0x37')]));_0x2a5bd5[_0x9c94('0x36')]=_0x2a5bd5[_0x9c94('0x36')][_0x9c94('0x38')]?_0x2a5bd5[_0x9c94('0x36')]:_0x5e6a90['model'];if(_0x24e74c['query'][_0x9c94('0x42')]){_0x2a5bd5[_0x9c94('0x47')]=[{'all':!![]}];}_0x2a5bd5=_[_0x9c94('0x41')]({},_0x2a5bd5,_0x24e74c['options']);return db[_0x9c94('0x30')][_0x9c94('0x48')](_0x2a5bd5)['then'](handleEntityNotFound(_0x3d8b31,null))['then'](respondWithResult(_0x3d8b31,null))['catch'](handleError(_0x3d8b31,null));};exports['create']=function(_0x2b94e0,_0x5362f4){return db['JscriptyAnswerReport'][_0x9c94('0x49')](_0x2b94e0['body'],{})[_0x9c94('0x29')](respondWithResult(_0x5362f4,0xc9))[_0x9c94('0x44')](handleError(_0x5362f4,null));};exports[_0x9c94('0x28')]=function(_0x205f51,_0x22eaa4){if(_0x205f51['body']['id']){delete _0x205f51[_0x9c94('0x4a')]['id'];}return db[_0x9c94('0x30')][_0x9c94('0x48')]({'where':{'id':_0x205f51[_0x9c94('0x4b')]['id']}})[_0x9c94('0x29')](handleEntityNotFound(_0x22eaa4,null))[_0x9c94('0x29')](saveUpdates(_0x205f51['body'],null))[_0x9c94('0x29')](respondWithResult(_0x22eaa4,null))['catch'](handleError(_0x22eaa4,null));};exports[_0x9c94('0x2a')]=function(_0x38bb48,_0x426c0f){return db['JscriptyAnswerReport'][_0x9c94('0x48')]({'where':{'id':_0x38bb48[_0x9c94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426c0f,null))[_0x9c94('0x29')](removeEntity(_0x426c0f,null))['catch'](handleError(_0x426c0f,null));};exports[_0x9c94('0x4c')]=function(_0x3aa1dd,_0x537c78){return db['JscriptyAnswerReport'][_0x9c94('0x4c')]()['then'](respondWithResult(_0x537c78,null))[_0x9c94('0x44')](handleError(_0x537c78,null));}; \ No newline at end of file +var _0x1354=['moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyAnswerReport','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5a8531,_0x30ca48){var _0x578028=function(_0xb2108c){while(--_0xb2108c){_0x5a8531['push'](_0x5a8531['shift']());}};_0x578028(++_0x30ca48);}(_0x1354,0x95));var _0x4135=function(_0x390752,_0x42cad3){_0x390752=_0x390752-0x0;var _0x5eca55=_0x1354[_0x390752];return _0x5eca55;};'use strict';var emlformat=require(_0x4135('0x0'));var rimraf=require(_0x4135('0x1'));var zipdir=require(_0x4135('0x2'));var jsonpatch=require(_0x4135('0x3'));var rp=require(_0x4135('0x4'));var moment=require(_0x4135('0x5'));var BPromise=require(_0x4135('0x6'));var Mustache=require('mustache');var util=require(_0x4135('0x7'));var path=require(_0x4135('0x8'));var sox=require(_0x4135('0x9'));var csv=require('to-csv');var ejs=require(_0x4135('0xa'));var fs=require('fs');var fs_extra=require(_0x4135('0xb'));var _=require('lodash');var squel=require(_0x4135('0xc'));var crypto=require(_0x4135('0xd'));var jsforce=require(_0x4135('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4135('0xf'));var querystring=require('querystring');var Papa=require(_0x4135('0x10'));var Redis=require(_0x4135('0x11'));var authService=require(_0x4135('0x12'));var qs=require(_0x4135('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4135('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4135('0x15'));var config=require(_0x4135('0x16'));var licenseUtil=require(_0x4135('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x307e6f,_0x838d6f){_0x838d6f=_0x838d6f||0xcc;return function(_0xb825cb){if(_0xb825cb){return _0x307e6f[_0x4135('0x18')](_0x838d6f);}return _0x307e6f[_0x4135('0x19')](_0x838d6f)[_0x4135('0x1a')]();};}function respondWithResult(_0x54f954,_0x50dd01){_0x50dd01=_0x50dd01||0xc8;return function(_0x249c86){if(_0x249c86){return _0x54f954[_0x4135('0x19')](_0x50dd01)[_0x4135('0x1b')](_0x249c86);}};}function respondWithFilteredResult(_0x17179a,_0x4b7609){return function(_0x34fd82){if(_0x34fd82){var _0x2e8733=typeof _0x4b7609['offset']==='undefined'&&typeof _0x4b7609[_0x4135('0x1c')]==='undefined';var _0x2f2600=_0x34fd82['count'];var _0x53f54e=_0x2e8733?0x0:_0x4b7609['offset'];var _0x53f5a7=_0x2e8733?_0x34fd82[_0x4135('0x1d')]:_0x4b7609['offset']+_0x4b7609[_0x4135('0x1c')];var _0xf81757;if(_0x53f5a7>=_0x2f2600){_0x53f5a7=_0x2f2600;_0xf81757=0xc8;}else{_0xf81757=0xce;}_0x17179a[_0x4135('0x19')](_0xf81757);return _0x17179a['set'](_0x4135('0x1e'),_0x53f54e+'-'+_0x53f5a7+'/'+_0x2f2600)[_0x4135('0x1b')](_0x34fd82);}return null;};}function patchUpdates(_0x398294){return function(_0x485395){try{jsonpatch[_0x4135('0x1f')](_0x485395,_0x398294,!![]);}catch(_0x58bdb1){return BPromise[_0x4135('0x20')](_0x58bdb1);}return _0x485395[_0x4135('0x21')]();};}function saveUpdates(_0x314f11,_0x188707){return function(_0x5a3777){if(_0x5a3777){return _0x5a3777[_0x4135('0x22')](_0x314f11)[_0x4135('0x23')](function(_0x32dcf6){return _0x32dcf6;});}return null;};}function removeEntity(_0x3912e9,_0x83a794){return function(_0x2c604b){if(_0x2c604b){return _0x2c604b[_0x4135('0x24')]()[_0x4135('0x23')](function(){_0x3912e9[_0x4135('0x19')](0xcc)[_0x4135('0x1a')]();});}};}function handleEntityNotFound(_0x12a9fd,_0x192126){return function(_0x212228){if(!_0x212228){_0x12a9fd[_0x4135('0x18')](0x194);}return _0x212228;};}function handleError(_0x4b448f,_0x1a3d30){_0x1a3d30=_0x1a3d30||0x1f4;return function(_0x3e40bc){logger[_0x4135('0x25')](_0x3e40bc[_0x4135('0x26')]);if(_0x3e40bc[_0x4135('0x27')]){delete _0x3e40bc[_0x4135('0x27')];}_0x4b448f['status'](_0x1a3d30)[_0x4135('0x28')](_0x3e40bc);};}exports[_0x4135('0x29')]=function(_0x31b508,_0x2c06d0){var _0x284121={},_0x511fce={},_0x411ee0={'count':0x0,'rows':[]};var _0x381e86=_['map'](db[_0x4135('0x2a')]['rawAttributes'],function(_0x2438d2){return{'name':_0x2438d2[_0x4135('0x2b')],'type':_0x2438d2[_0x4135('0x2c')][_0x4135('0x2d')]};});_0x511fce['model']=_[_0x4135('0x2e')](_0x381e86,_0x4135('0x27'));_0x511fce[_0x4135('0x2f')]=_[_0x4135('0x30')](_0x31b508[_0x4135('0x2f')]);_0x511fce[_0x4135('0x31')]=_['intersection'](_0x511fce[_0x4135('0x32')],_0x511fce[_0x4135('0x2f')]);_0x284121['attributes']=_[_0x4135('0x33')](_0x511fce['model'],qs[_0x4135('0x34')](_0x31b508[_0x4135('0x2f')]['fields']));_0x284121['attributes']=_0x284121[_0x4135('0x35')][_0x4135('0x36')]?_0x284121[_0x4135('0x35')]:_0x511fce['model'];if(!_0x31b508[_0x4135('0x2f')][_0x4135('0x37')](_0x4135('0x38'))){_0x284121['limit']=qs[_0x4135('0x1c')](_0x31b508[_0x4135('0x2f')]['limit']);_0x284121[_0x4135('0x39')]=qs[_0x4135('0x39')](_0x31b508['query'][_0x4135('0x39')]);}_0x284121['order']=qs[_0x4135('0x3a')](_0x31b508[_0x4135('0x2f')][_0x4135('0x3a')]);_0x284121[_0x4135('0x3b')]=qs[_0x4135('0x31')](_[_0x4135('0x3c')](_0x31b508['query'],_0x511fce[_0x4135('0x31')]),_0x381e86);if(_0x31b508[_0x4135('0x2f')]['filter']){_0x284121[_0x4135('0x3b')]=_['merge'](_0x284121[_0x4135('0x3b')],{'$or':_[_0x4135('0x2e')](_0x381e86,function(_0x14f353){if(_0x14f353[_0x4135('0x2c')]!==_0x4135('0x3d')){var _0x41ce9e={};_0x41ce9e[_0x14f353[_0x4135('0x27')]]={'$like':'%'+_0x31b508[_0x4135('0x2f')][_0x4135('0x3e')]+'%'};return _0x41ce9e;}})});}_0x284121=_[_0x4135('0x3f')]({},_0x284121,_0x31b508[_0x4135('0x40')]);var _0x53689f={'where':_0x284121['where']};return db[_0x4135('0x2a')][_0x4135('0x1d')](_0x53689f)[_0x4135('0x23')](function(_0x2dfd11){_0x411ee0[_0x4135('0x1d')]=_0x2dfd11;if(_0x31b508['query'][_0x4135('0x41')]){_0x284121[_0x4135('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4135('0x43')](_0x284121);})[_0x4135('0x23')](function(_0x1ddad4){_0x411ee0[_0x4135('0x44')]=_0x1ddad4;return _0x411ee0;})['then'](respondWithFilteredResult(_0x2c06d0,_0x284121))['catch'](handleError(_0x2c06d0,null));};exports[_0x4135('0x45')]=function(_0x58c6e1,_0x166ecb){var _0x5894fb={'raw':!![],'where':{'id':_0x58c6e1['params']['id']}},_0x25d1c4={};_0x25d1c4[_0x4135('0x32')]=_['keys'](db[_0x4135('0x2a')][_0x4135('0x46')]);_0x25d1c4[_0x4135('0x2f')]=_['keys'](_0x58c6e1[_0x4135('0x2f')]);_0x25d1c4[_0x4135('0x31')]=_[_0x4135('0x33')](_0x25d1c4[_0x4135('0x32')],_0x25d1c4[_0x4135('0x2f')]);_0x5894fb[_0x4135('0x35')]=_[_0x4135('0x33')](_0x25d1c4[_0x4135('0x32')],qs[_0x4135('0x34')](_0x58c6e1[_0x4135('0x2f')]['fields']));_0x5894fb[_0x4135('0x35')]=_0x5894fb[_0x4135('0x35')][_0x4135('0x36')]?_0x5894fb[_0x4135('0x35')]:_0x25d1c4[_0x4135('0x32')];if(_0x58c6e1['query'][_0x4135('0x41')]){_0x5894fb['include']=[{'all':!![]}];}_0x5894fb=_['merge']({},_0x5894fb,_0x58c6e1[_0x4135('0x40')]);return db[_0x4135('0x2a')][_0x4135('0x47')](_0x5894fb)[_0x4135('0x23')](handleEntityNotFound(_0x166ecb,null))[_0x4135('0x23')](respondWithResult(_0x166ecb,null))[_0x4135('0x48')](handleError(_0x166ecb,null));};exports[_0x4135('0x49')]=function(_0x18aed5,_0x13f1f1){return db[_0x4135('0x2a')][_0x4135('0x49')](_0x18aed5[_0x4135('0x4a')],{})[_0x4135('0x23')](respondWithResult(_0x13f1f1,0xc9))[_0x4135('0x48')](handleError(_0x13f1f1,null));};exports[_0x4135('0x22')]=function(_0x74a924,_0x540029){if(_0x74a924[_0x4135('0x4a')]['id']){delete _0x74a924['body']['id'];}return db[_0x4135('0x2a')][_0x4135('0x47')]({'where':{'id':_0x74a924[_0x4135('0x4b')]['id']}})[_0x4135('0x23')](handleEntityNotFound(_0x540029,null))[_0x4135('0x23')](saveUpdates(_0x74a924[_0x4135('0x4a')],null))[_0x4135('0x23')](respondWithResult(_0x540029,null))['catch'](handleError(_0x540029,null));};exports['destroy']=function(_0x1b98e8,_0x5b6255){return db[_0x4135('0x2a')][_0x4135('0x47')]({'where':{'id':_0x1b98e8[_0x4135('0x4b')]['id']}})[_0x4135('0x23')](handleEntityNotFound(_0x5b6255,null))[_0x4135('0x23')](removeEntity(_0x5b6255,null))[_0x4135('0x48')](handleError(_0x5b6255,null));};exports['describe']=function(_0x1c4049,_0x31c532){return db[_0x4135('0x2a')][_0x4135('0x4c')]()[_0x4135('0x23')](respondWithResult(_0x31c532,null))[_0x4135('0x48')](handleError(_0x31c532,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 28115ec..677a3cc 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 _0xee53=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','lodash'];(function(_0x3d9ac5,_0x341a61){var _0x17f692=function(_0x15d31d){while(--_0x15d31d){_0x3d9ac5['push'](_0x3d9ac5['shift']());}};_0x17f692(++_0x341a61);}(_0xee53,0x1ac));var _0x3ee5=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xee53[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x3ee5('0x0'));var util=require(_0x3ee5('0x1'));var logger=require(_0x3ee5('0x2'))('api');var moment=require(_0x3ee5('0x3'));var BPromise=require(_0x3ee5('0x4'));var rp=require(_0x3ee5('0x5'));var fs=require('fs');var path=require(_0x3ee5('0x6'));var rimraf=require(_0x3ee5('0x7'));var config=require('../../config/environment');var attributes=require(_0x3ee5('0x8'));module[_0x3ee5('0x9')]=function(_0x5c9fac,_0x1687a6){return _0x5c9fac[_0x3ee5('0xa')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ff9=['define','report_jscripty_answers','lodash','moment','bluebird','request-promise','path','./jscriptyAnswerReport.attributes','exports'];(function(_0x2c7451,_0x17c2dc){var _0x1e3a2e=function(_0x5d10f4){while(--_0x5d10f4){_0x2c7451['push'](_0x2c7451['shift']());}};_0x1e3a2e(++_0x17c2dc);}(_0x0ff9,0x77));var _0x90ff=function(_0x22daaf,_0x2761a7){_0x22daaf=_0x22daaf-0x0;var _0x3192a8=_0x0ff9[_0x22daaf];return _0x3192a8;};'use strict';var _=require(_0x90ff('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x90ff('0x1'));var BPromise=require(_0x90ff('0x2'));var rp=require(_0x90ff('0x3'));var fs=require('fs');var path=require(_0x90ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90ff('0x5'));module[_0x90ff('0x6')]=function(_0x251b1c,_0x4f8245){return _0x251b1c[_0x90ff('0x7')]('JscriptyAnswerReport',attributes,{'tableName':_0x90ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index f6734a6..fefca35 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 _0xa3a2=['request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x48f839,_0x49f4bf){var _0x2019ce=function(_0x45e371){while(--_0x45e371){_0x48f839['push'](_0x48f839['shift']());}};_0x2019ce(++_0x49f4bf);}(_0xa3a2,0xa9));var _0x2a3a=function(_0x9b11c9,_0x20548a){_0x9b11c9=_0x9b11c9-0x0;var _0x272265=_0xa3a2[_0x9b11c9];return _0x272265;};'use strict';var _=require('lodash');var util=require(_0x2a3a('0x0'));var moment=require('moment');var BPromise=require(_0x2a3a('0x1'));var rs=require(_0x2a3a('0x2'));var fs=require('fs');var Redis=require(_0x2a3a('0x3'));var db=require(_0x2a3a('0x4'))['db'];var utils=require(_0x2a3a('0x5'));var logger=require(_0x2a3a('0x6'))(_0x2a3a('0x7'));var config=require(_0x2a3a('0x8'));var jayson=require(_0x2a3a('0x9'));var client=jayson[_0x2a3a('0xa')][_0x2a3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x500e3f,_0x3c1cba,_0x5aa9a1){return new BPromise(function(_0xcd4e09,_0x208f42){return client['request'](_0x500e3f,_0x5aa9a1)[_0x2a3a('0xc')](function(_0x373d5e){logger[_0x2a3a('0xd')](_0x2a3a('0xe'),_0x3c1cba,_0x2a3a('0xf'));logger[_0x2a3a('0x10')](_0x2a3a('0x11'),_0x3c1cba,_0x2a3a('0xf'),JSON['stringify'](_0x373d5e));if(_0x373d5e[_0x2a3a('0x12')]){if(_0x373d5e[_0x2a3a('0x12')][_0x2a3a('0x13')]===0x1f4){logger[_0x2a3a('0x12')](_0x2a3a('0xe'),_0x3c1cba,_0x373d5e['error'][_0x2a3a('0x14')]);return _0x208f42(_0x373d5e[_0x2a3a('0x12')][_0x2a3a('0x14')]);}logger[_0x2a3a('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c1cba,_0x373d5e[_0x2a3a('0x12')][_0x2a3a('0x14')]);return _0xcd4e09(_0x373d5e[_0x2a3a('0x12')]['message']);}else{logger[_0x2a3a('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c1cba,_0x2a3a('0xf'));_0xcd4e09(_0x373d5e[_0x2a3a('0x15')]['message']);}})[_0x2a3a('0x16')](function(_0x36abf3){logger[_0x2a3a('0x12')](_0x2a3a('0xe'),_0x3c1cba,_0x36abf3);_0x208f42(_0x36abf3);});});} \ No newline at end of file +var _0xfe4f=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5e23d0,_0x373112){var _0xee1975=function(_0x595fe1){while(--_0x595fe1){_0x5e23d0['push'](_0x5e23d0['shift']());}};_0xee1975(++_0x373112);}(_0xfe4f,0xe4));var _0xffe4=function(_0x53c4f8,_0x44ccaf){_0x53c4f8=_0x53c4f8-0x0;var _0x416458=_0xfe4f[_0x53c4f8];return _0x416458;};'use strict';var _=require(_0xffe4('0x0'));var util=require(_0xffe4('0x1'));var moment=require(_0xffe4('0x2'));var BPromise=require(_0xffe4('0x3'));var rs=require(_0xffe4('0x4'));var fs=require('fs');var Redis=require(_0xffe4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xffe4('0x6'))(_0xffe4('0x7'));var config=require(_0xffe4('0x8'));var jayson=require(_0xffe4('0x9'));var client=jayson[_0xffe4('0xa')][_0xffe4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57ea7b,_0x1039fb,_0x23abe5){return new BPromise(function(_0x2bab8,_0x4b8c93){return client['request'](_0x57ea7b,_0x23abe5)[_0xffe4('0xc')](function(_0x56cf04){logger[_0xffe4('0xd')](_0xffe4('0xe'),_0x1039fb,_0xffe4('0xf'));logger[_0xffe4('0x10')](_0xffe4('0x11'),_0x1039fb,_0xffe4('0xf'),JSON[_0xffe4('0x12')](_0x56cf04));if(_0x56cf04[_0xffe4('0x13')]){if(_0x56cf04['error'][_0xffe4('0x14')]===0x1f4){logger[_0xffe4('0x13')](_0xffe4('0xe'),_0x1039fb,_0x56cf04['error'][_0xffe4('0x15')]);return _0x4b8c93(_0x56cf04['error'][_0xffe4('0x15')]);}logger['error'](_0xffe4('0xe'),_0x1039fb,_0x56cf04[_0xffe4('0x13')][_0xffe4('0x15')]);return _0x2bab8(_0x56cf04[_0xffe4('0x13')][_0xffe4('0x15')]);}else{logger[_0xffe4('0xd')](_0xffe4('0xe'),_0x1039fb,_0xffe4('0xf'));_0x2bab8(_0x56cf04[_0xffe4('0x16')][_0xffe4('0x15')]);}})[_0xffe4('0x17')](function(_0x36f739){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1039fb,_0x36f739);_0x4b8c93(_0x36f739);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 0e922c9..ee73708 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 _0x1b32=['/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','post','/:id/clone','clone','put','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x41e339,_0x39a763){var _0x36704c=function(_0x1a83ee){while(--_0x1a83ee){_0x41e339['push'](_0x41e339['shift']());}};_0x36704c(++_0x39a763);}(_0x1b32,0xdc));var _0x21b3=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x1b32[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0x21b3('0x0'));var util=require(_0x21b3('0x1'));var path=require('path');var timeout=require(_0x21b3('0x2'));var express=require(_0x21b3('0x3'));var router=express['Router']();var fs_extra=require(_0x21b3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x21b3('0x5'));var config=require('../../config/environment');var controller=require(_0x21b3('0x6'));router[_0x21b3('0x7')]('/',auth[_0x21b3('0x8')](),controller[_0x21b3('0x9')]);router['get'](_0x21b3('0xa'),auth[_0x21b3('0x8')](),controller[_0x21b3('0xb')]);router['get'](_0x21b3('0xc'),auth[_0x21b3('0x8')](),controller[_0x21b3('0xd')]);router[_0x21b3('0x7')](_0x21b3('0xe'),auth['isAuthenticated'](),controller[_0x21b3('0xf')]);router[_0x21b3('0x7')](_0x21b3('0x10'),auth[_0x21b3('0x8')](),timeout('30s'),controller['getSummary']);router[_0x21b3('0x11')]('/',auth[_0x21b3('0x8')](),controller['create']);router[_0x21b3('0x11')](_0x21b3('0x12'),auth['isAuthenticated'](),controller[_0x21b3('0x13')]);router[_0x21b3('0x14')](_0x21b3('0xa'),auth[_0x21b3('0x8')](),controller[_0x21b3('0x15')]);router[_0x21b3('0x16')](_0x21b3('0xa'),auth[_0x21b3('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2d55=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','/:id/answers','getAnswers','30s','getSummary','create','post','/:id/clone','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0xb527ad,_0xa9bd87){var _0x5d7448=function(_0x276021){while(--_0x276021){_0xb527ad['push'](_0xb527ad['shift']());}};_0x5d7448(++_0xa9bd87);}(_0x2d55,0xea));var _0x52d5=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2d55[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x52d5('0x0'));var util=require(_0x52d5('0x1'));var path=require('path');var timeout=require(_0x52d5('0x2'));var express=require(_0x52d5('0x3'));var router=express[_0x52d5('0x4')]();var fs_extra=require(_0x52d5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x52d5('0x6'));var config=require(_0x52d5('0x7'));var controller=require('./jscriptyProject.controller');router[_0x52d5('0x8')]('/',auth[_0x52d5('0x9')](),controller[_0x52d5('0xa')]);router[_0x52d5('0x8')](_0x52d5('0xb'),auth[_0x52d5('0x9')](),controller[_0x52d5('0xc')]);router[_0x52d5('0x8')](_0x52d5('0xd'),auth[_0x52d5('0x9')](),controller['getSessions']);router[_0x52d5('0x8')](_0x52d5('0xe'),auth['isAuthenticated'](),controller[_0x52d5('0xf')]);router[_0x52d5('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x52d5('0x10')),controller[_0x52d5('0x11')]);router['post']('/',auth[_0x52d5('0x9')](),controller[_0x52d5('0x12')]);router[_0x52d5('0x13')](_0x52d5('0x14'),auth[_0x52d5('0x9')](),controller['clone']);router[_0x52d5('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x52d5('0x16')]);router['delete'](_0x52d5('0xb'),auth[_0x52d5('0x9')](),controller[_0x52d5('0x17')]);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 cf0358a..1726352 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 _0x9319=['exports','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x24cad6,_0xfbfd8a){var _0x24cee9=function(_0x1b466f){while(--_0x1b466f){_0x24cad6['push'](_0x24cad6['shift']());}};_0x24cee9(++_0xfbfd8a);}(_0x9319,0xd1));var _0x9931=function(_0x410d2,_0x282612){_0x410d2=_0x410d2-0x0;var _0x464ea3=_0x9319[_0x410d2];return _0x464ea3;};'use strict';var Sequelize=require(_0x9931('0x0'));var _=require('lodash');var util=require('util');module[_0x9931('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9931('0x2')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x9931('0x3')](_0x9931('0x4')),'set':function(_0x5d7ce1){if(_[_0x9931('0x5')](_0x5d7ce1)){this[_0x9931('0x6')](_0x9931('0x7'),JSON[_0x9931('0x8')](_0x5d7ce1));}else if(_['isString'](_0x5d7ce1)){this['setDataValue'](_0x9931('0x7'),_0x5d7ce1);}else{this['setDataValue'](_0x9931('0x7'),util[_0x9931('0x9')](_0x9931('0xa'),this[_0x9931('0xb')](_0x9931('0x2'))||'',this[_0x9931('0xb')](_0x9931('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9931('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x3de0=['setDataValue','formData','isString','format','description','BOOLEAN','lodash','util','exports','name','STRING','TEXT','long'];(function(_0xac6558,_0x13eaee){var _0x56d29a=function(_0x59f4de){while(--_0x59f4de){_0xac6558['push'](_0xac6558['shift']());}};_0x56d29a(++_0x13eaee);}(_0x3de0,0xbc));var _0x03de=function(_0x5f58d5,_0x5468ad){_0x5f58d5=_0x5f58d5-0x0;var _0x28787e=_0x3de0[_0x5f58d5];return _0x28787e;};'use strict';var Sequelize=require('sequelize');var _=require(_0x03de('0x0'));var util=require(_0x03de('0x1'));module[_0x03de('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x03de('0x3')},'description':{'type':Sequelize[_0x03de('0x4')]},'formData':{'type':Sequelize[_0x03de('0x5')](_0x03de('0x6')),'set':function(_0x37bf03){if(_['isObjectLike'](_0x37bf03)){this[_0x03de('0x7')](_0x03de('0x8'),JSON['stringify'](_0x37bf03));}else if(_[_0x03de('0x9')](_0x37bf03)){this[_0x03de('0x7')](_0x03de('0x8'),_0x37bf03);}else{this[_0x03de('0x7')]('formData',util[_0x03de('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x03de('0x3'))||'',this['getDataValue'](_0x03de('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x03de('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x03de('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index c564911..a33b0b0 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 _0x6d2d=['map','JscriptyProject','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','merge','options','includeAll','include','rows','show','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','Projects','getSessions','findOne','JscriptySessionReport','hasOwnProperty','order','ProjectId','filter','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','findAll','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','download','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','index'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0x6d2d,0xbc));var _0xd6d2=function(_0x1d961a,_0x403678){_0x1d961a=_0x1d961a-0x0;var _0x18d9cf=_0x6d2d[_0x1d961a];return _0x18d9cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd6d2('0x0'));var jsonpatch=require(_0xd6d2('0x1'));var rp=require(_0xd6d2('0x2'));var moment=require('moment');var BPromise=require(_0xd6d2('0x3'));var Mustache=require(_0xd6d2('0x4'));var util=require(_0xd6d2('0x5'));var path=require(_0xd6d2('0x6'));var sox=require(_0xd6d2('0x7'));var csv=require(_0xd6d2('0x8'));var ejs=require(_0xd6d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd6d2('0xa'));var _=require('lodash');var squel=require(_0xd6d2('0xb'));var crypto=require(_0xd6d2('0xc'));var jsforce=require(_0xd6d2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd6d2('0x8'));var querystring=require(_0xd6d2('0xe'));var Papa=require(_0xd6d2('0xf'));var Redis=require(_0xd6d2('0x10'));var authService=require(_0xd6d2('0x11'));var qs=require(_0xd6d2('0x12'));var as=require(_0xd6d2('0x13'));var hardwareService=require(_0xd6d2('0x14'));var logger=require('../../config/logger')(_0xd6d2('0x15'));var utils=require(_0xd6d2('0x16'));var config=require(_0xd6d2('0x17'));var licenseUtil=require(_0xd6d2('0x18'));var db=require(_0xd6d2('0x19'))['db'];function respondWithStatusCode(_0x664490,_0x5d0335){_0x5d0335=_0x5d0335||0xcc;return function(_0x4ebec6){if(_0x4ebec6){return _0x664490[_0xd6d2('0x1a')](_0x5d0335);}return _0x664490[_0xd6d2('0x1b')](_0x5d0335)[_0xd6d2('0x1c')]();};}function respondWithResult(_0x13be62,_0x35258e){_0x35258e=_0x35258e||0xc8;return function(_0x4c4ae9){if(_0x4c4ae9){return _0x13be62[_0xd6d2('0x1b')](_0x35258e)[_0xd6d2('0x1d')](_0x4c4ae9);}};}function respondWithFilteredResult(_0x511a9c,_0x4c93ce){return function(_0xef4acc){if(_0xef4acc){var _0x1cca32=typeof _0x4c93ce['offset']===_0xd6d2('0x1e')&&typeof _0x4c93ce[_0xd6d2('0x1f')]==='undefined';var _0x470b19=_0xef4acc[_0xd6d2('0x20')];var _0x22a07b=_0x1cca32?0x0:_0x4c93ce[_0xd6d2('0x21')];var _0x7a3cf6=_0x1cca32?_0xef4acc[_0xd6d2('0x20')]:_0x4c93ce[_0xd6d2('0x21')]+_0x4c93ce[_0xd6d2('0x1f')];var _0x175813;if(_0x7a3cf6>=_0x470b19){_0x7a3cf6=_0x470b19;_0x175813=0xc8;}else{_0x175813=0xce;}_0x511a9c[_0xd6d2('0x1b')](_0x175813);return _0x511a9c[_0xd6d2('0x22')](_0xd6d2('0x23'),_0x22a07b+'-'+_0x7a3cf6+'/'+_0x470b19)[_0xd6d2('0x1d')](_0xef4acc);}return null;};}function patchUpdates(_0xfc32c9){return function(_0x148a26){try{jsonpatch[_0xd6d2('0x24')](_0x148a26,_0xfc32c9,!![]);}catch(_0x3ab7e1){return BPromise[_0xd6d2('0x25')](_0x3ab7e1);}return _0x148a26[_0xd6d2('0x26')]();};}function saveUpdates(_0x5dbb38,_0x9dd2be){return function(_0x553ad8){if(_0x553ad8){return _0x553ad8[_0xd6d2('0x27')](_0x5dbb38)['then'](function(_0x5c31bd){return _0x5c31bd;});}return null;};}function removeEntity(_0x1ad9f6,_0x5d26db){return function(_0x4cf856){if(_0x4cf856){return _0x4cf856[_0xd6d2('0x28')]()['then'](function(){var _0x153b8c=_0x4cf856[_0xd6d2('0x29')]({'plain':!![]});var _0x232e0f='Projects';return db[_0xd6d2('0x2a')][_0xd6d2('0x28')]({'where':{'type':_0x232e0f,'resourceId':_0x153b8c['id']}})[_0xd6d2('0x2b')](function(){return _0x4cf856;});})[_0xd6d2('0x2b')](function(){_0x1ad9f6['status'](0xcc)[_0xd6d2('0x1c')]();});}};}function handleEntityNotFound(_0x58df41,_0x418bc5){return function(_0x3cc2ec){if(!_0x3cc2ec){_0x58df41[_0xd6d2('0x1a')](0x194);}return _0x3cc2ec;};}function handleError(_0x5de4f3,_0x17b699){_0x17b699=_0x17b699||0x1f4;return function(_0x2fbbf0){logger['error'](_0x2fbbf0[_0xd6d2('0x2c')]);if(_0x2fbbf0[_0xd6d2('0x2d')]){delete _0x2fbbf0[_0xd6d2('0x2d')];}_0x5de4f3[_0xd6d2('0x1b')](_0x17b699)[_0xd6d2('0x2e')](_0x2fbbf0);};}exports[_0xd6d2('0x2f')]=function(_0x113f42,_0x845e5a){var _0x2c66dd={},_0x181ec0={},_0x37fee8={'count':0x0,'rows':[]};var _0x528b87=_[_0xd6d2('0x30')](db[_0xd6d2('0x31')][_0xd6d2('0x32')],function(_0x987f51){return{'name':_0x987f51['fieldName'],'type':_0x987f51[_0xd6d2('0x33')][_0xd6d2('0x34')]};});_0x181ec0[_0xd6d2('0x35')]=_['map'](_0x528b87,_0xd6d2('0x2d'));_0x181ec0[_0xd6d2('0x36')]=_[_0xd6d2('0x37')](_0x113f42['query']);_0x181ec0[_0xd6d2('0x38')]=_[_0xd6d2('0x39')](_0x181ec0['model'],_0x181ec0['query']);_0x2c66dd[_0xd6d2('0x3a')]=_[_0xd6d2('0x39')](_0x181ec0[_0xd6d2('0x35')],qs['fields'](_0x113f42['query']['fields']));_0x2c66dd[_0xd6d2('0x3a')]=_0x2c66dd[_0xd6d2('0x3a')][_0xd6d2('0x3b')]?_0x2c66dd[_0xd6d2('0x3a')]:_0x181ec0[_0xd6d2('0x35')];if(!_0x113f42[_0xd6d2('0x36')]['hasOwnProperty'](_0xd6d2('0x3c'))){_0x2c66dd[_0xd6d2('0x1f')]=qs[_0xd6d2('0x1f')](_0x113f42[_0xd6d2('0x36')]['limit']);_0x2c66dd[_0xd6d2('0x21')]=qs[_0xd6d2('0x21')](_0x113f42[_0xd6d2('0x36')]['offset']);}_0x2c66dd['order']=qs[_0xd6d2('0x3d')](_0x113f42['query'][_0xd6d2('0x3d')]);_0x2c66dd[_0xd6d2('0x3e')]=qs[_0xd6d2('0x38')](_[_0xd6d2('0x3f')](_0x113f42[_0xd6d2('0x36')],_0x181ec0[_0xd6d2('0x38')]),_0x528b87);if(_0x113f42[_0xd6d2('0x36')]['filter']){_0x2c66dd[_0xd6d2('0x3e')]=_[_0xd6d2('0x40')](_0x2c66dd['where'],{'$or':_[_0xd6d2('0x30')](_0x528b87,function(_0x34b050){if(_0x34b050[_0xd6d2('0x33')]!=='VIRTUAL'){var _0x39a6e7={};_0x39a6e7[_0x34b050[_0xd6d2('0x2d')]]={'$like':'%'+_0x113f42['query']['filter']+'%'};return _0x39a6e7;}})});}_0x2c66dd=_[_0xd6d2('0x40')]({},_0x2c66dd,_0x113f42[_0xd6d2('0x41')]);var _0x146cee={'where':_0x2c66dd[_0xd6d2('0x3e')]};return db[_0xd6d2('0x31')][_0xd6d2('0x20')](_0x146cee)[_0xd6d2('0x2b')](function(_0x145968){_0x37fee8[_0xd6d2('0x20')]=_0x145968;if(_0x113f42['query'][_0xd6d2('0x42')]){_0x2c66dd[_0xd6d2('0x43')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x2c66dd);})[_0xd6d2('0x2b')](function(_0x4b4248){_0x37fee8[_0xd6d2('0x44')]=_0x4b4248;return _0x37fee8;})['then'](respondWithFilteredResult(_0x845e5a,_0x2c66dd))['catch'](handleError(_0x845e5a,null));};exports[_0xd6d2('0x45')]=function(_0x2283a7,_0x11492a){var _0x5be897={'raw':![],'where':{'id':_0x2283a7['params']['id']}},_0x52fc8b={};_0x52fc8b[_0xd6d2('0x35')]=_[_0xd6d2('0x37')](db[_0xd6d2('0x31')]['rawAttributes']);_0x52fc8b[_0xd6d2('0x36')]=_[_0xd6d2('0x37')](_0x2283a7[_0xd6d2('0x36')]);_0x52fc8b['filters']=_[_0xd6d2('0x39')](_0x52fc8b[_0xd6d2('0x35')],_0x52fc8b[_0xd6d2('0x36')]);_0x5be897[_0xd6d2('0x3a')]=_[_0xd6d2('0x39')](_0x52fc8b[_0xd6d2('0x35')],qs['fields'](_0x2283a7['query'][_0xd6d2('0x46')]));_0x5be897[_0xd6d2('0x3a')]=_0x5be897[_0xd6d2('0x3a')][_0xd6d2('0x3b')]?_0x5be897[_0xd6d2('0x3a')]:_0x52fc8b['model'];if(_0x2283a7['query'][_0xd6d2('0x42')]){_0x5be897[_0xd6d2('0x43')]=[{'all':!![]}];}_0x5be897=_[_0xd6d2('0x40')]({},_0x5be897,_0x2283a7[_0xd6d2('0x41')]);return db[_0xd6d2('0x31')][_0xd6d2('0x47')](_0x5be897)[_0xd6d2('0x2b')](handleEntityNotFound(_0x11492a,null))['then'](respondWithResult(_0x11492a,null))['catch'](handleError(_0x11492a,null));};exports[_0xd6d2('0x48')]=function(_0x28649b,_0x267b8a){return db[_0xd6d2('0x31')][_0xd6d2('0x48')](_0x28649b[_0xd6d2('0x49')],{})['then'](function(_0x4f2876){var _0x54f785=_0x28649b[_0xd6d2('0x4a')][_0xd6d2('0x29')]({'plain':!![]});if(!_0x54f785)throw new Error(_0xd6d2('0x4b'));if(_0x54f785['role']==='user'){var _0x3bb0b4=_0x4f2876[_0xd6d2('0x29')]({'plain':!![]});var _0x51deea='Projects';return db[_0xd6d2('0x4c')]['find']({'where':{'name':_0x51deea,'userProfileId':_0x54f785[_0xd6d2('0x4d')]},'raw':!![]})[_0xd6d2('0x2b')](function(_0x2b9e21){if(_0x2b9e21&&_0x2b9e21[_0xd6d2('0x4e')]===0x0){return db[_0xd6d2('0x2a')][_0xd6d2('0x48')]({'name':_0x3bb0b4[_0xd6d2('0x2d')],'resourceId':_0x3bb0b4['id'],'type':_0x2b9e21[_0xd6d2('0x2d')],'sectionId':_0x2b9e21['id']},{})['then'](function(){return _0x4f2876;});}else{return _0x4f2876;}})[_0xd6d2('0x4f')](function(_0x33321e){logger['error'](_0xd6d2('0x50'),_0x33321e);throw _0x33321e;});}return _0x4f2876;})[_0xd6d2('0x2b')](respondWithResult(_0x267b8a,0xc9))[_0xd6d2('0x4f')](handleError(_0x267b8a,null));};exports[_0xd6d2('0x51')]=function(_0x2dc726,_0x427e82){var _0x36c2af={'where':{'id':_0x2dc726[_0xd6d2('0x52')]['id']}},_0x738fdd={};_0x738fdd['model']=_[_0xd6d2('0x37')](db[_0xd6d2('0x31')][_0xd6d2('0x32')]);_0x36c2af[_0xd6d2('0x3a')]=_[_0xd6d2('0x39')](_0x738fdd[_0xd6d2('0x35')],qs['fields'](_0x2dc726[_0xd6d2('0x36')]['fields']));_0x36c2af['attributes']=_0x36c2af[_0xd6d2('0x3a')]['length']?_0x36c2af['attributes']:_0x738fdd[_0xd6d2('0x35')];if(_0x2dc726[_0xd6d2('0x36')][_0xd6d2('0x42')]){_0x36c2af[_0xd6d2('0x43')]=[{'all':!![]}];}_0x36c2af=_[_0xd6d2('0x40')]({},_0x36c2af,_0x2dc726['options']);return db[_0xd6d2('0x31')][_0xd6d2('0x47')](_0x36c2af)['then'](handleEntityNotFound(_0x427e82,null))['then'](function(_0x4a2b82){if(_0x4a2b82){var _0x47fdd5=_0x4a2b82[_0xd6d2('0x29')]({'plain':!![]});_0x47fdd5=qs[_0xd6d2('0x53')](_0x47fdd5,['id',_0xd6d2('0x54'),_0xd6d2('0x55')]);_0x2dc726[_0xd6d2('0x49')]=_[_0xd6d2('0x53')](_0x2dc726[_0xd6d2('0x49')],['id',_0xd6d2('0x54'),'updatedAt']);return db['JscriptyProject'][_0xd6d2('0x48')](_[_0xd6d2('0x40')](_0x47fdd5,_0x2dc726[_0xd6d2('0x49')]),{'include':_0x2dc726['query'][_0xd6d2('0x42')]?[{'all':!![]}]:undefined})[_0xd6d2('0x2b')](function(_0x3ab096){var _0x1469d3=_0x2dc726['user'][_0xd6d2('0x29')]({'plain':!![]});if(!_0x1469d3)throw new Error(_0xd6d2('0x4b'));if(_0x1469d3[_0xd6d2('0x56')]===_0xd6d2('0x4a')){var _0x24eca1=_0x3ab096['get']({'plain':!![]});var _0x4a76bd=_0xd6d2('0x57');return db['UserProfileSection']['find']({'where':{'name':_0x4a76bd,'userProfileId':_0x1469d3['userProfileId']},'raw':!![]})[_0xd6d2('0x2b')](function(_0x4470e7){if(_0x4470e7&&_0x4470e7[_0xd6d2('0x4e')]===0x0){return db['UserProfileResource'][_0xd6d2('0x48')]({'name':_0x24eca1[_0xd6d2('0x2d')],'resourceId':_0x24eca1['id'],'type':_0x4470e7[_0xd6d2('0x2d')],'sectionId':_0x4470e7['id']},{})[_0xd6d2('0x2b')](function(){return _0x3ab096;});}else{return _0x3ab096;}})[_0xd6d2('0x4f')](function(_0x3bde7b){logger['error'](_0xd6d2('0x50'),_0x3bde7b);throw _0x3bde7b;});}return _0x3ab096;});}})[_0xd6d2('0x2b')](respondWithResult(_0x427e82,0xc9))['catch'](handleError(_0x427e82,null));};exports[_0xd6d2('0x27')]=function(_0x19dd8c,_0x1d7798){if(_0x19dd8c[_0xd6d2('0x49')]['id']){delete _0x19dd8c[_0xd6d2('0x49')]['id'];}return db[_0xd6d2('0x31')][_0xd6d2('0x47')]({'where':{'id':_0x19dd8c[_0xd6d2('0x52')]['id']}})[_0xd6d2('0x2b')](handleEntityNotFound(_0x1d7798,null))[_0xd6d2('0x2b')](saveUpdates(_0x19dd8c[_0xd6d2('0x49')],null))[_0xd6d2('0x2b')](respondWithResult(_0x1d7798,null))[_0xd6d2('0x4f')](handleError(_0x1d7798,null));};exports[_0xd6d2('0x28')]=function(_0x303ae6,_0x41a4e7){return db[_0xd6d2('0x31')][_0xd6d2('0x47')]({'where':{'id':_0x303ae6[_0xd6d2('0x52')]['id']}})[_0xd6d2('0x2b')](handleEntityNotFound(_0x41a4e7,null))[_0xd6d2('0x2b')](removeEntity(_0x41a4e7,null))[_0xd6d2('0x4f')](handleError(_0x41a4e7,null));};exports[_0xd6d2('0x58')]=function(_0x11b9c7,_0x21aa74,_0xdced46){var _0x113d2e={'raw':!![],'where':{}};var _0x27446c={};var _0x1e5d2c={'count':0x0,'rows':[]};return db[_0xd6d2('0x31')][_0xd6d2('0x59')]({'where':{'id':_0x11b9c7['params']['id']}})[_0xd6d2('0x2b')](handleEntityNotFound(_0x21aa74,null))[_0xd6d2('0x2b')](function(_0x1baf8a){if(_0x1baf8a){_0x27446c['model']=_[_0xd6d2('0x37')](db[_0xd6d2('0x5a')][_0xd6d2('0x32')]);_0x27446c[_0xd6d2('0x36')]=_[_0xd6d2('0x37')](_0x11b9c7['query']);_0x27446c[_0xd6d2('0x38')]=_[_0xd6d2('0x39')](_0x27446c[_0xd6d2('0x35')],_0x27446c['query']);_0x113d2e['attributes']=_[_0xd6d2('0x39')](_0x27446c[_0xd6d2('0x35')],qs['fields'](_0x11b9c7[_0xd6d2('0x36')][_0xd6d2('0x46')]));_0x113d2e[_0xd6d2('0x3a')]=_0x113d2e[_0xd6d2('0x3a')][_0xd6d2('0x3b')]?_0x113d2e[_0xd6d2('0x3a')]:_0x27446c[_0xd6d2('0x35')];if(!_0x11b9c7[_0xd6d2('0x36')][_0xd6d2('0x5b')](_0xd6d2('0x3c'))){_0x113d2e['limit']=qs[_0xd6d2('0x1f')](_0x11b9c7[_0xd6d2('0x36')][_0xd6d2('0x1f')]);_0x113d2e['offset']=qs[_0xd6d2('0x21')](_0x11b9c7['query']['offset']);}_0x113d2e[_0xd6d2('0x5c')]=qs[_0xd6d2('0x3d')](_0x11b9c7['query']['sort']);_0x113d2e[_0xd6d2('0x3e')]=qs['filters'](_['pick'](_0x11b9c7['query'],_0x27446c[_0xd6d2('0x38')]));_0x113d2e['where'][_0xd6d2('0x5d')]=_0x1baf8a['id'];if(_0x11b9c7['query'][_0xd6d2('0x5e')]){_0x113d2e[_0xd6d2('0x3e')]=_[_0xd6d2('0x40')](_0x113d2e[_0xd6d2('0x3e')],{'$or':_['map'](_0x113d2e[_0xd6d2('0x3a')],function(_0x2de66f){var _0x2178f8={};_0x2178f8[_0x2de66f]={'$like':'%'+_0x11b9c7[_0xd6d2('0x36')][_0xd6d2('0x5e')]+'%'};return _0x2178f8;})});}_0x113d2e=_[_0xd6d2('0x40')]({},_0x113d2e,_0x11b9c7[_0xd6d2('0x41')]);return db[_0xd6d2('0x5a')][_0xd6d2('0x20')]({'where':_0x113d2e[_0xd6d2('0x3e')]})['then'](function(_0x14cbd4){_0x1e5d2c[_0xd6d2('0x20')]=_0x14cbd4;if(_0x11b9c7[_0xd6d2('0x36')]['includeAll']){_0x113d2e[_0xd6d2('0x43')]=[{'all':!![]}];}return db[_0xd6d2('0x5a')]['findAll'](_0x113d2e);})[_0xd6d2('0x2b')](function(_0x29c5e3){_0x1e5d2c['rows']=_0x29c5e3;return _0x1e5d2c;});}})[_0xd6d2('0x2b')](respondWithFilteredResult(_0x21aa74,_0x113d2e))['catch'](handleError(_0x21aa74,null));};exports[_0xd6d2('0x5f')]=function(_0xcd92e1,_0x2aa98f,_0x1dac6c){var _0x3609f0={'raw':!![],'where':{}};var _0xa8ea4b={};var _0x413edb={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xd6d2('0x59')]({'where':{'id':_0xcd92e1[_0xd6d2('0x52')]['id']}})[_0xd6d2('0x2b')](handleEntityNotFound(_0x2aa98f,null))[_0xd6d2('0x2b')](function(_0x1c2c48){if(_0x1c2c48){_0xa8ea4b[_0xd6d2('0x35')]=_[_0xd6d2('0x37')](db[_0xd6d2('0x60')]['rawAttributes']);_0xa8ea4b['query']=_[_0xd6d2('0x37')](_0xcd92e1[_0xd6d2('0x36')]);_0xa8ea4b[_0xd6d2('0x38')]=_['intersection'](_0xa8ea4b['model'],_0xa8ea4b[_0xd6d2('0x36')]);_0x3609f0[_0xd6d2('0x3a')]=_[_0xd6d2('0x39')](_0xa8ea4b['model'],qs['fields'](_0xcd92e1[_0xd6d2('0x36')][_0xd6d2('0x46')]));_0x3609f0['attributes']=_0x3609f0['attributes'][_0xd6d2('0x3b')]?_0x3609f0[_0xd6d2('0x3a')]:_0xa8ea4b[_0xd6d2('0x35')];if(!_0xcd92e1[_0xd6d2('0x36')]['hasOwnProperty'](_0xd6d2('0x3c'))){_0x3609f0['limit']=qs[_0xd6d2('0x1f')](_0xcd92e1[_0xd6d2('0x36')]['limit']);_0x3609f0[_0xd6d2('0x21')]=qs[_0xd6d2('0x21')](_0xcd92e1[_0xd6d2('0x36')][_0xd6d2('0x21')]);}_0x3609f0[_0xd6d2('0x5c')]=qs[_0xd6d2('0x3d')](_0xcd92e1[_0xd6d2('0x36')][_0xd6d2('0x3d')]);_0x3609f0[_0xd6d2('0x3e')]=qs['filters'](_[_0xd6d2('0x3f')](_0xcd92e1[_0xd6d2('0x36')],_0xa8ea4b[_0xd6d2('0x38')]));_0x3609f0[_0xd6d2('0x3e')][_0xd6d2('0x5d')]=_0x1c2c48['id'];if(_0xcd92e1['query']['filter']){_0x3609f0[_0xd6d2('0x3e')]=_[_0xd6d2('0x40')](_0x3609f0['where'],{'$or':_[_0xd6d2('0x30')](_0x3609f0[_0xd6d2('0x3a')],function(_0x52c577){var _0x2d0428={};_0x2d0428[_0x52c577]={'$like':'%'+_0xcd92e1['query'][_0xd6d2('0x5e')]+'%'};return _0x2d0428;})});}_0x3609f0=_[_0xd6d2('0x40')]({},_0x3609f0,_0xcd92e1[_0xd6d2('0x41')]);return db['JscriptyAnswerReport']['count']({'where':_0x3609f0[_0xd6d2('0x3e')]})[_0xd6d2('0x2b')](function(_0x10e940){_0x413edb[_0xd6d2('0x20')]=_0x10e940;if(_0xcd92e1[_0xd6d2('0x36')][_0xd6d2('0x42')]){_0x3609f0[_0xd6d2('0x43')]=[{'all':!![]}];}return db[_0xd6d2('0x60')]['findAll'](_0x3609f0);})[_0xd6d2('0x2b')](function(_0x369da4){_0x413edb[_0xd6d2('0x44')]=_0x369da4;return _0x413edb;});}})[_0xd6d2('0x2b')](respondWithFilteredResult(_0x2aa98f,_0x3609f0))[_0xd6d2('0x4f')](handleError(_0x2aa98f,null));};function char(_0x564101){return'number'===typeof _0x564101?String[_0xd6d2('0x61')][_0xd6d2('0x24')](null,arguments):_0x564101;}function needsEncapsulation(_0x69e2c){return!!_0x69e2c&&(_0x69e2c[_0xd6d2('0x62')]()[_0xd6d2('0x63')](char(0xd))>=0x0||_0x69e2c[_0xd6d2('0x62')]()[_0xd6d2('0x63')](char(0xa))>=0x0||_0x69e2c[_0xd6d2('0x62')]()[_0xd6d2('0x63')](char(0x2c))>=0x0||_0x69e2c['toString']()[_0xd6d2('0x63')](char(0x22))>=0x0);}function encapsulate(_0x3a72fd){var _0x932a80=char(0x22),_0x2589f4='\x5c'+char(0x22),_0x3f9302=_0x3a72fd[_0xd6d2('0x62')]()['replace'](new RegExp(_0x932a80,'g'),_0x2589f4);return _0x932a80+_0x3f9302+_0x932a80;}exports[_0xd6d2('0x64')]=function(_0x2ac681,_0x30d57c,_0x3ad773){var _0x2295a8,_0x41c196;var _0x56ae33={'where':{'ProjectId':_0x2ac681['params']['id']}};if(_0x2ac681[_0xd6d2('0x36')]['startTime']){_0x56ae33['where'][_0xd6d2('0x65')]=JSON[_0xd6d2('0x66')](_0x2ac681['query'][_0xd6d2('0x67')]);}return db[_0xd6d2('0x5a')]['findAll'](_0x56ae33)[_0xd6d2('0x2b')](handleEntityNotFound(_0x30d57c,null))[_0xd6d2('0x2b')](function(_0x465b52){if(_0x465b52){_0x2295a8=_0x465b52;return db['JscriptyQuestionReport'][_0xd6d2('0x68')]({'where':{'SessionId':{'$in':_[_0xd6d2('0x30')](_0x2295a8,'id')},'ProjectId':_0x2ac681[_0xd6d2('0x52')]['id']},'order':'-createdAt'});}})[_0xd6d2('0x2b')](handleEntityNotFound(_0x30d57c,null))['then'](function(_0x3def18){if(_0x3def18){_0x41c196=_0x3def18;var _0x2614f4={};for(var _0x177dad=0x0,_0x44d445=_0x41c196['length'];_0x177dad<_0x44d445;_0x177dad++){if(!_0x2614f4[_0xd6d2('0x5b')](_0x41c196[_0x177dad][_0xd6d2('0x69')])){_0x2614f4[_0x41c196[_0x177dad]['questionId']]=needsEncapsulation(_0x41c196[_0x177dad]['question'])?encapsulate(_0x41c196[_0x177dad][_0xd6d2('0x6a')]):_0x41c196[_0x177dad]['question'];}}var _0x4db81d=[],_0x4dae70={};for(var _0x52a47f=0x0,_0x1a5db5=_0x2295a8['length'];_0x52a47f<_0x1a5db5;_0x52a47f++){_0x4dae70={'ProjectId':_0x2ac681[_0xd6d2('0x52')]['id'],'SessionId':_0x2295a8[_0x52a47f]['id'],'StartTime':moment(_0x2295a8[_0x52a47f]['starttime'])[_0xd6d2('0x6b')](_0xd6d2('0x6c'))};for(var _0x343036=0x0,_0x15b508=_0x41c196[_0xd6d2('0x3b')];_0x343036<_0x15b508;_0x343036++){if(_0x41c196[_0x343036][_0xd6d2('0x6d')]==_0x2295a8[_0x52a47f]['id']&&_0x2614f4['hasOwnProperty'](_0x41c196[_0x343036][_0xd6d2('0x69')])){_0x4dae70[_0x2614f4[_0x41c196[_0x343036][_0xd6d2('0x69')]]]=_0x41c196[_0x343036][_0xd6d2('0x6e')];}}for(var _0x3b9ea6 in _0x2614f4){if(!_0x4dae70['hasOwnProperty'](_0x2614f4[_0x3b9ea6])){_0x4dae70[_0x2614f4[_0x3b9ea6]]=null;}}_0x4db81d[_0xd6d2('0x6f')](_0x4dae70);}return _0x4db81d;}})[_0xd6d2('0x2b')](function(_0x4460d9){if(!_[_0xd6d2('0x70')](_0x4460d9)){var _0x1b5e3c=toCsv(_0x4460d9);var _0x461bf9=Date['now']();fs[_0xd6d2('0x71')](util[_0xd6d2('0x6b')](_0xd6d2('0x72'),_0x2ac681['params']['id'],_0x461bf9),_0x1b5e3c);_0x30d57c[_0xd6d2('0x73')](_0xd6d2('0x74'),'attachment;\x20filename='+util[_0xd6d2('0x6b')]('Jscripty_Project_%d_Summary_%s.csv',_0x2ac681[_0xd6d2('0x52')]['id'],_0x461bf9));_0x30d57c[_0xd6d2('0x73')]('Content-type','text/csv');return _0x30d57c[_0xd6d2('0x75')](util[_0xd6d2('0x6b')](_0xd6d2('0x72'),_0x2ac681[_0xd6d2('0x52')]['id'],_0x461bf9));}else{return _0x30d57c[_0xd6d2('0x1a')](0xcc);}})[_0xd6d2('0x4f')](handleError(_0x30d57c,null));}; \ No newline at end of file +var _0x8814=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','json','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','index','map','JscriptyProject','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','find','userProfileId','catch','clone','params','rawAttributes','omit','createdAt','UserProfileSection','autoAssociation','update','getSessions','JscriptySessionReport','ProjectId','count','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x1339fe,_0x5bb1c9){var _0x2aa6cc=function(_0x5edc40){while(--_0x5edc40){_0x1339fe['push'](_0x1339fe['shift']());}};_0x2aa6cc(++_0x5bb1c9);}(_0x8814,0x1b8));var _0x4881=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x8814[_0x164af1];return _0x5d81a2;};'use strict';var emlformat=require(_0x4881('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4881('0x1'));var rp=require('request-promise');var moment=require(_0x4881('0x2'));var BPromise=require(_0x4881('0x3'));var Mustache=require(_0x4881('0x4'));var util=require(_0x4881('0x5'));var path=require('path');var sox=require(_0x4881('0x6'));var csv=require(_0x4881('0x7'));var ejs=require(_0x4881('0x8'));var fs=require('fs');var fs_extra=require(_0x4881('0x9'));var _=require('lodash');var squel=require(_0x4881('0xa'));var crypto=require('crypto');var jsforce=require(_0x4881('0xb'));var deskjs=require(_0x4881('0xc'));var toCsv=require(_0x4881('0x7'));var querystring=require(_0x4881('0xd'));var Papa=require('papaparse');var Redis=require(_0x4881('0xe'));var authService=require(_0x4881('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4881('0x10'));var hardwareService=require(_0x4881('0x11'));var logger=require(_0x4881('0x12'))(_0x4881('0x13'));var utils=require(_0x4881('0x14'));var config=require(_0x4881('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4881('0x16'))['db'];function respondWithStatusCode(_0x1aa300,_0x42454b){_0x42454b=_0x42454b||0xcc;return function(_0x2794fe){if(_0x2794fe){return _0x1aa300['sendStatus'](_0x42454b);}return _0x1aa300[_0x4881('0x17')](_0x42454b)[_0x4881('0x18')]();};}function respondWithResult(_0x20357a,_0x44b25b){_0x44b25b=_0x44b25b||0xc8;return function(_0x1b409f){if(_0x1b409f){return _0x20357a[_0x4881('0x17')](_0x44b25b)['json'](_0x1b409f);}};}function respondWithFilteredResult(_0x4bdffa,_0x527762){return function(_0x5ad538){if(_0x5ad538){var _0x22df92=typeof _0x527762[_0x4881('0x19')]==='undefined'&&typeof _0x527762[_0x4881('0x1a')]===_0x4881('0x1b');var _0x3e1b6c=_0x5ad538['count'];var _0x4f7f4e=_0x22df92?0x0:_0x527762['offset'];var _0x333305=_0x22df92?_0x5ad538['count']:_0x527762[_0x4881('0x19')]+_0x527762[_0x4881('0x1a')];var _0x513bd1;if(_0x333305>=_0x3e1b6c){_0x333305=_0x3e1b6c;_0x513bd1=0xc8;}else{_0x513bd1=0xce;}_0x4bdffa['status'](_0x513bd1);return _0x4bdffa['set']('Content-Range',_0x4f7f4e+'-'+_0x333305+'/'+_0x3e1b6c)[_0x4881('0x1c')](_0x5ad538);}return null;};}function patchUpdates(_0x543c5e){return function(_0x4dc126){try{jsonpatch[_0x4881('0x1d')](_0x4dc126,_0x543c5e,!![]);}catch(_0x20bc72){return BPromise[_0x4881('0x1e')](_0x20bc72);}return _0x4dc126[_0x4881('0x1f')]();};}function saveUpdates(_0x347b35,_0x33b74a){return function(_0x5a514d){if(_0x5a514d){return _0x5a514d['update'](_0x347b35)['then'](function(_0x15aebc){return _0x15aebc;});}return null;};}function removeEntity(_0x2727c4,_0xb965c9){return function(_0x470df9){if(_0x470df9){return _0x470df9[_0x4881('0x20')]()[_0x4881('0x21')](function(){var _0x4cf5c3=_0x470df9[_0x4881('0x22')]({'plain':!![]});var _0x383c70='Projects';return db[_0x4881('0x23')][_0x4881('0x20')]({'where':{'type':_0x383c70,'resourceId':_0x4cf5c3['id']}})[_0x4881('0x21')](function(){return _0x470df9;});})[_0x4881('0x21')](function(){_0x2727c4[_0x4881('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x658ec9,_0x2bf637){return function(_0x41b83f){if(!_0x41b83f){_0x658ec9['sendStatus'](0x194);}return _0x41b83f;};}function handleError(_0x339600,_0xcd1152){_0xcd1152=_0xcd1152||0x1f4;return function(_0x5bcb74){logger[_0x4881('0x24')](_0x5bcb74[_0x4881('0x25')]);if(_0x5bcb74[_0x4881('0x26')]){delete _0x5bcb74[_0x4881('0x26')];}_0x339600[_0x4881('0x17')](_0xcd1152)['send'](_0x5bcb74);};}exports[_0x4881('0x27')]=function(_0x3de7c2,_0x373c7e){var _0x42fc74={},_0x1bfd97={},_0x144c63={'count':0x0,'rows':[]};var _0xa21343=_[_0x4881('0x28')](db[_0x4881('0x29')]['rawAttributes'],function(_0x5ad603){return{'name':_0x5ad603[_0x4881('0x2a')],'type':_0x5ad603[_0x4881('0x2b')]['key']};});_0x1bfd97[_0x4881('0x2c')]=_[_0x4881('0x28')](_0xa21343,'name');_0x1bfd97[_0x4881('0x2d')]=_[_0x4881('0x2e')](_0x3de7c2[_0x4881('0x2d')]);_0x1bfd97['filters']=_['intersection'](_0x1bfd97[_0x4881('0x2c')],_0x1bfd97[_0x4881('0x2d')]);_0x42fc74[_0x4881('0x2f')]=_['intersection'](_0x1bfd97[_0x4881('0x2c')],qs[_0x4881('0x30')](_0x3de7c2[_0x4881('0x2d')]['fields']));_0x42fc74[_0x4881('0x2f')]=_0x42fc74[_0x4881('0x2f')][_0x4881('0x31')]?_0x42fc74[_0x4881('0x2f')]:_0x1bfd97[_0x4881('0x2c')];if(!_0x3de7c2['query'][_0x4881('0x32')](_0x4881('0x33'))){_0x42fc74['limit']=qs[_0x4881('0x1a')](_0x3de7c2[_0x4881('0x2d')][_0x4881('0x1a')]);_0x42fc74[_0x4881('0x19')]=qs[_0x4881('0x19')](_0x3de7c2['query'][_0x4881('0x19')]);}_0x42fc74[_0x4881('0x34')]=qs['sort'](_0x3de7c2[_0x4881('0x2d')][_0x4881('0x35')]);_0x42fc74[_0x4881('0x36')]=qs['filters'](_[_0x4881('0x37')](_0x3de7c2[_0x4881('0x2d')],_0x1bfd97[_0x4881('0x38')]),_0xa21343);if(_0x3de7c2[_0x4881('0x2d')][_0x4881('0x39')]){_0x42fc74['where']=_[_0x4881('0x3a')](_0x42fc74[_0x4881('0x36')],{'$or':_['map'](_0xa21343,function(_0x52a198){if(_0x52a198['type']!==_0x4881('0x3b')){var _0x5dc0e6={};_0x5dc0e6[_0x52a198[_0x4881('0x26')]]={'$like':'%'+_0x3de7c2['query'][_0x4881('0x39')]+'%'};return _0x5dc0e6;}})});}_0x42fc74=_[_0x4881('0x3a')]({},_0x42fc74,_0x3de7c2[_0x4881('0x3c')]);var _0x1808c4={'where':_0x42fc74['where']};return db[_0x4881('0x29')]['count'](_0x1808c4)[_0x4881('0x21')](function(_0x497baa){_0x144c63['count']=_0x497baa;if(_0x3de7c2[_0x4881('0x2d')][_0x4881('0x3d')]){_0x42fc74[_0x4881('0x3e')]=[{'all':!![]}];}return db[_0x4881('0x29')][_0x4881('0x3f')](_0x42fc74);})[_0x4881('0x21')](function(_0x3b06ad){_0x144c63[_0x4881('0x40')]=_0x3b06ad;return _0x144c63;})[_0x4881('0x21')](respondWithFilteredResult(_0x373c7e,_0x42fc74))['catch'](handleError(_0x373c7e,null));};exports[_0x4881('0x41')]=function(_0x1df1a9,_0x40bb4b){var _0x3b5f2a={'raw':![],'where':{'id':_0x1df1a9['params']['id']}},_0x352ab7={};_0x352ab7[_0x4881('0x2c')]=_['keys'](db[_0x4881('0x29')]['rawAttributes']);_0x352ab7['query']=_[_0x4881('0x2e')](_0x1df1a9[_0x4881('0x2d')]);_0x352ab7[_0x4881('0x38')]=_[_0x4881('0x42')](_0x352ab7[_0x4881('0x2c')],_0x352ab7[_0x4881('0x2d')]);_0x3b5f2a[_0x4881('0x2f')]=_['intersection'](_0x352ab7['model'],qs[_0x4881('0x30')](_0x1df1a9['query']['fields']));_0x3b5f2a[_0x4881('0x2f')]=_0x3b5f2a[_0x4881('0x2f')]['length']?_0x3b5f2a[_0x4881('0x2f')]:_0x352ab7[_0x4881('0x2c')];if(_0x1df1a9[_0x4881('0x2d')][_0x4881('0x3d')]){_0x3b5f2a[_0x4881('0x3e')]=[{'all':!![]}];}_0x3b5f2a=_[_0x4881('0x3a')]({},_0x3b5f2a,_0x1df1a9['options']);return db[_0x4881('0x29')]['find'](_0x3b5f2a)[_0x4881('0x21')](handleEntityNotFound(_0x40bb4b,null))[_0x4881('0x21')](respondWithResult(_0x40bb4b,null))['catch'](handleError(_0x40bb4b,null));};exports['create']=function(_0x18bb78,_0x58f9ac){return db[_0x4881('0x29')][_0x4881('0x43')](_0x18bb78[_0x4881('0x44')],{})[_0x4881('0x21')](function(_0xfdc77c){var _0x9b18cb=_0x18bb78[_0x4881('0x45')][_0x4881('0x22')]({'plain':!![]});if(!_0x9b18cb)throw new Error(_0x4881('0x46'));if(_0x9b18cb[_0x4881('0x47')]===_0x4881('0x45')){var _0x4186bb=_0xfdc77c[_0x4881('0x22')]({'plain':!![]});var _0x3baa84=_0x4881('0x48');return db['UserProfileSection'][_0x4881('0x49')]({'where':{'name':_0x3baa84,'userProfileId':_0x9b18cb[_0x4881('0x4a')]},'raw':!![]})['then'](function(_0x553819){if(_0x553819&&_0x553819['autoAssociation']===0x0){return db['UserProfileResource'][_0x4881('0x43')]({'name':_0x4186bb[_0x4881('0x26')],'resourceId':_0x4186bb['id'],'type':_0x553819['name'],'sectionId':_0x553819['id']},{})[_0x4881('0x21')](function(){return _0xfdc77c;});}else{return _0xfdc77c;}})[_0x4881('0x4b')](function(_0x3c05ab){logger[_0x4881('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c05ab);throw _0x3c05ab;});}return _0xfdc77c;})[_0x4881('0x21')](respondWithResult(_0x58f9ac,0xc9))[_0x4881('0x4b')](handleError(_0x58f9ac,null));};exports[_0x4881('0x4c')]=function(_0x252736,_0x1042eb){var _0x540e1e={'where':{'id':_0x252736[_0x4881('0x4d')]['id']}},_0x4612b9={};_0x4612b9['model']=_[_0x4881('0x2e')](db[_0x4881('0x29')][_0x4881('0x4e')]);_0x540e1e[_0x4881('0x2f')]=_[_0x4881('0x42')](_0x4612b9[_0x4881('0x2c')],qs[_0x4881('0x30')](_0x252736[_0x4881('0x2d')]['fields']));_0x540e1e[_0x4881('0x2f')]=_0x540e1e[_0x4881('0x2f')][_0x4881('0x31')]?_0x540e1e[_0x4881('0x2f')]:_0x4612b9['model'];if(_0x252736['query'][_0x4881('0x3d')]){_0x540e1e[_0x4881('0x3e')]=[{'all':!![]}];}_0x540e1e=_[_0x4881('0x3a')]({},_0x540e1e,_0x252736[_0x4881('0x3c')]);return db[_0x4881('0x29')][_0x4881('0x49')](_0x540e1e)[_0x4881('0x21')](handleEntityNotFound(_0x1042eb,null))[_0x4881('0x21')](function(_0x121262){if(_0x121262){var _0x3480a2=_0x121262[_0x4881('0x22')]({'plain':!![]});_0x3480a2=qs[_0x4881('0x4f')](_0x3480a2,['id',_0x4881('0x50'),'updatedAt']);_0x252736[_0x4881('0x44')]=_[_0x4881('0x4f')](_0x252736[_0x4881('0x44')],['id',_0x4881('0x50'),'updatedAt']);return db[_0x4881('0x29')][_0x4881('0x43')](_[_0x4881('0x3a')](_0x3480a2,_0x252736[_0x4881('0x44')]),{'include':_0x252736[_0x4881('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x4881('0x21')](function(_0x4dedea){var _0x4dc903=_0x252736[_0x4881('0x45')][_0x4881('0x22')]({'plain':!![]});if(!_0x4dc903)throw new Error(_0x4881('0x46'));if(_0x4dc903['role']===_0x4881('0x45')){var _0x4f33fe=_0x4dedea['get']({'plain':!![]});var _0x3254a0=_0x4881('0x48');return db[_0x4881('0x51')]['find']({'where':{'name':_0x3254a0,'userProfileId':_0x4dc903[_0x4881('0x4a')]},'raw':!![]})[_0x4881('0x21')](function(_0x212f0d){if(_0x212f0d&&_0x212f0d[_0x4881('0x52')]===0x0){return db[_0x4881('0x23')][_0x4881('0x43')]({'name':_0x4f33fe[_0x4881('0x26')],'resourceId':_0x4f33fe['id'],'type':_0x212f0d[_0x4881('0x26')],'sectionId':_0x212f0d['id']},{})['then'](function(){return _0x4dedea;});}else{return _0x4dedea;}})[_0x4881('0x4b')](function(_0x3b112c){logger[_0x4881('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b112c);throw _0x3b112c;});}return _0x4dedea;});}})['then'](respondWithResult(_0x1042eb,0xc9))['catch'](handleError(_0x1042eb,null));};exports[_0x4881('0x53')]=function(_0x3b6e17,_0x422623){if(_0x3b6e17[_0x4881('0x44')]['id']){delete _0x3b6e17[_0x4881('0x44')]['id'];}return db['JscriptyProject'][_0x4881('0x49')]({'where':{'id':_0x3b6e17[_0x4881('0x4d')]['id']}})[_0x4881('0x21')](handleEntityNotFound(_0x422623,null))[_0x4881('0x21')](saveUpdates(_0x3b6e17['body'],null))[_0x4881('0x21')](respondWithResult(_0x422623,null))[_0x4881('0x4b')](handleError(_0x422623,null));};exports[_0x4881('0x20')]=function(_0x499a61,_0x5a0688){return db[_0x4881('0x29')][_0x4881('0x49')]({'where':{'id':_0x499a61[_0x4881('0x4d')]['id']}})[_0x4881('0x21')](handleEntityNotFound(_0x5a0688,null))[_0x4881('0x21')](removeEntity(_0x5a0688,null))['catch'](handleError(_0x5a0688,null));};exports[_0x4881('0x54')]=function(_0x2e9e65,_0x4a6d56,_0x300cf6){var _0x316ed1={'raw':!![],'where':{}};var _0x567f56={};var _0x694c67={'count':0x0,'rows':[]};return db[_0x4881('0x29')]['findOne']({'where':{'id':_0x2e9e65['params']['id']}})['then'](handleEntityNotFound(_0x4a6d56,null))[_0x4881('0x21')](function(_0x2b1b59){if(_0x2b1b59){_0x567f56[_0x4881('0x2c')]=_[_0x4881('0x2e')](db[_0x4881('0x55')]['rawAttributes']);_0x567f56[_0x4881('0x2d')]=_[_0x4881('0x2e')](_0x2e9e65[_0x4881('0x2d')]);_0x567f56[_0x4881('0x38')]=_[_0x4881('0x42')](_0x567f56[_0x4881('0x2c')],_0x567f56[_0x4881('0x2d')]);_0x316ed1['attributes']=_[_0x4881('0x42')](_0x567f56['model'],qs[_0x4881('0x30')](_0x2e9e65['query']['fields']));_0x316ed1['attributes']=_0x316ed1[_0x4881('0x2f')][_0x4881('0x31')]?_0x316ed1[_0x4881('0x2f')]:_0x567f56[_0x4881('0x2c')];if(!_0x2e9e65['query'][_0x4881('0x32')](_0x4881('0x33'))){_0x316ed1['limit']=qs[_0x4881('0x1a')](_0x2e9e65[_0x4881('0x2d')][_0x4881('0x1a')]);_0x316ed1[_0x4881('0x19')]=qs[_0x4881('0x19')](_0x2e9e65[_0x4881('0x2d')]['offset']);}_0x316ed1[_0x4881('0x34')]=qs[_0x4881('0x35')](_0x2e9e65[_0x4881('0x2d')]['sort']);_0x316ed1[_0x4881('0x36')]=qs[_0x4881('0x38')](_[_0x4881('0x37')](_0x2e9e65[_0x4881('0x2d')],_0x567f56[_0x4881('0x38')]));_0x316ed1['where'][_0x4881('0x56')]=_0x2b1b59['id'];if(_0x2e9e65[_0x4881('0x2d')]['filter']){_0x316ed1['where']=_['merge'](_0x316ed1[_0x4881('0x36')],{'$or':_[_0x4881('0x28')](_0x316ed1[_0x4881('0x2f')],function(_0x246c4a){var _0x43872d={};_0x43872d[_0x246c4a]={'$like':'%'+_0x2e9e65[_0x4881('0x2d')][_0x4881('0x39')]+'%'};return _0x43872d;})});}_0x316ed1=_[_0x4881('0x3a')]({},_0x316ed1,_0x2e9e65[_0x4881('0x3c')]);return db[_0x4881('0x55')]['count']({'where':_0x316ed1['where']})[_0x4881('0x21')](function(_0x51fbd6){_0x694c67[_0x4881('0x57')]=_0x51fbd6;if(_0x2e9e65[_0x4881('0x2d')][_0x4881('0x3d')]){_0x316ed1[_0x4881('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x316ed1);})['then'](function(_0x549ae0){_0x694c67['rows']=_0x549ae0;return _0x694c67;});}})[_0x4881('0x21')](respondWithFilteredResult(_0x4a6d56,_0x316ed1))[_0x4881('0x4b')](handleError(_0x4a6d56,null));};exports['getAnswers']=function(_0xf557a4,_0x1fcb57,_0x599fa1){var _0x1e1574={'raw':!![],'where':{}};var _0x362acf={};var _0x12064d={'count':0x0,'rows':[]};return db[_0x4881('0x29')]['findOne']({'where':{'id':_0xf557a4[_0x4881('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1fcb57,null))[_0x4881('0x21')](function(_0x567b15){if(_0x567b15){_0x362acf['model']=_['keys'](db[_0x4881('0x58')][_0x4881('0x4e')]);_0x362acf['query']=_[_0x4881('0x2e')](_0xf557a4[_0x4881('0x2d')]);_0x362acf[_0x4881('0x38')]=_[_0x4881('0x42')](_0x362acf[_0x4881('0x2c')],_0x362acf['query']);_0x1e1574[_0x4881('0x2f')]=_[_0x4881('0x42')](_0x362acf[_0x4881('0x2c')],qs[_0x4881('0x30')](_0xf557a4[_0x4881('0x2d')][_0x4881('0x30')]));_0x1e1574[_0x4881('0x2f')]=_0x1e1574[_0x4881('0x2f')][_0x4881('0x31')]?_0x1e1574['attributes']:_0x362acf['model'];if(!_0xf557a4['query'][_0x4881('0x32')](_0x4881('0x33'))){_0x1e1574[_0x4881('0x1a')]=qs[_0x4881('0x1a')](_0xf557a4[_0x4881('0x2d')]['limit']);_0x1e1574[_0x4881('0x19')]=qs[_0x4881('0x19')](_0xf557a4['query'][_0x4881('0x19')]);}_0x1e1574['order']=qs[_0x4881('0x35')](_0xf557a4[_0x4881('0x2d')]['sort']);_0x1e1574[_0x4881('0x36')]=qs[_0x4881('0x38')](_[_0x4881('0x37')](_0xf557a4[_0x4881('0x2d')],_0x362acf[_0x4881('0x38')]));_0x1e1574[_0x4881('0x36')][_0x4881('0x56')]=_0x567b15['id'];if(_0xf557a4[_0x4881('0x2d')][_0x4881('0x39')]){_0x1e1574[_0x4881('0x36')]=_[_0x4881('0x3a')](_0x1e1574['where'],{'$or':_[_0x4881('0x28')](_0x1e1574['attributes'],function(_0x540ba7){var _0x4d4fb4={};_0x4d4fb4[_0x540ba7]={'$like':'%'+_0xf557a4['query'][_0x4881('0x39')]+'%'};return _0x4d4fb4;})});}_0x1e1574=_[_0x4881('0x3a')]({},_0x1e1574,_0xf557a4[_0x4881('0x3c')]);return db[_0x4881('0x58')][_0x4881('0x57')]({'where':_0x1e1574['where']})[_0x4881('0x21')](function(_0x4f786c){_0x12064d[_0x4881('0x57')]=_0x4f786c;if(_0xf557a4[_0x4881('0x2d')]['includeAll']){_0x1e1574[_0x4881('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4881('0x3f')](_0x1e1574);})[_0x4881('0x21')](function(_0x2b2bf7){_0x12064d[_0x4881('0x40')]=_0x2b2bf7;return _0x12064d;});}})[_0x4881('0x21')](respondWithFilteredResult(_0x1fcb57,_0x1e1574))['catch'](handleError(_0x1fcb57,null));};function char(_0x2023d8){return _0x4881('0x59')===typeof _0x2023d8?String[_0x4881('0x5a')][_0x4881('0x1d')](null,arguments):_0x2023d8;}function needsEncapsulation(_0xc4d47){return!!_0xc4d47&&(_0xc4d47['toString']()['indexOf'](char(0xd))>=0x0||_0xc4d47['toString']()[_0x4881('0x5b')](char(0xa))>=0x0||_0xc4d47[_0x4881('0x5c')]()[_0x4881('0x5b')](char(0x2c))>=0x0||_0xc4d47[_0x4881('0x5c')]()[_0x4881('0x5b')](char(0x22))>=0x0);}function encapsulate(_0x1cf802){var _0x22bbbc=char(0x22),_0x2ea108='\x5c'+char(0x22),_0xdeaf0a=_0x1cf802[_0x4881('0x5c')]()[_0x4881('0x5d')](new RegExp(_0x22bbbc,'g'),_0x2ea108);return _0x22bbbc+_0xdeaf0a+_0x22bbbc;}exports['getSummary']=function(_0x20abef,_0x5547e2,_0x2ae93f){var _0x356dc7,_0x14268b;var _0x2a522e={'where':{'ProjectId':_0x20abef[_0x4881('0x4d')]['id']}};if(_0x20abef[_0x4881('0x2d')][_0x4881('0x5e')]){_0x2a522e['where'][_0x4881('0x5f')]=JSON[_0x4881('0x60')](_0x20abef['query'][_0x4881('0x5e')]);}return db['JscriptySessionReport'][_0x4881('0x3f')](_0x2a522e)['then'](handleEntityNotFound(_0x5547e2,null))[_0x4881('0x21')](function(_0x1b97db){if(_0x1b97db){_0x356dc7=_0x1b97db;return db[_0x4881('0x61')][_0x4881('0x3f')]({'where':{'SessionId':{'$in':_[_0x4881('0x28')](_0x356dc7,'id')},'ProjectId':_0x20abef['params']['id']},'order':'-createdAt'});}})[_0x4881('0x21')](handleEntityNotFound(_0x5547e2,null))['then'](function(_0x19fc94){if(_0x19fc94){_0x14268b=_0x19fc94;var _0x1b0192={};for(var _0x2543d1=0x0,_0x36f86f=_0x14268b[_0x4881('0x31')];_0x2543d1<_0x36f86f;_0x2543d1++){if(!_0x1b0192[_0x4881('0x32')](_0x14268b[_0x2543d1]['questionId'])){_0x1b0192[_0x14268b[_0x2543d1][_0x4881('0x62')]]=needsEncapsulation(_0x14268b[_0x2543d1][_0x4881('0x63')])?encapsulate(_0x14268b[_0x2543d1][_0x4881('0x63')]):_0x14268b[_0x2543d1][_0x4881('0x63')];}}var _0x47abca=[],_0x1f669e={};for(var _0x164654=0x0,_0x27cb8a=_0x356dc7['length'];_0x164654<_0x27cb8a;_0x164654++){_0x1f669e={'ProjectId':_0x20abef[_0x4881('0x4d')]['id'],'SessionId':_0x356dc7[_0x164654]['id'],'StartTime':moment(_0x356dc7[_0x164654][_0x4881('0x5f')])[_0x4881('0x64')](_0x4881('0x65'))};for(var _0xfa66b2=0x0,_0x48325d=_0x14268b[_0x4881('0x31')];_0xfa66b2<_0x48325d;_0xfa66b2++){if(_0x14268b[_0xfa66b2][_0x4881('0x66')]==_0x356dc7[_0x164654]['id']&&_0x1b0192[_0x4881('0x32')](_0x14268b[_0xfa66b2]['questionId'])){_0x1f669e[_0x1b0192[_0x14268b[_0xfa66b2][_0x4881('0x62')]]]=_0x14268b[_0xfa66b2][_0x4881('0x67')];}}for(var _0x4399d7 in _0x1b0192){if(!_0x1f669e['hasOwnProperty'](_0x1b0192[_0x4399d7])){_0x1f669e[_0x1b0192[_0x4399d7]]=null;}}_0x47abca[_0x4881('0x68')](_0x1f669e);}return _0x47abca;}})[_0x4881('0x21')](function(_0x47c459){if(!_[_0x4881('0x69')](_0x47c459)){var _0x397b46=toCsv(_0x47c459);var _0xe01fbf=Date[_0x4881('0x6a')]();fs[_0x4881('0x6b')](util[_0x4881('0x64')](_0x4881('0x6c'),_0x20abef[_0x4881('0x4d')]['id'],_0xe01fbf),_0x397b46);_0x5547e2[_0x4881('0x6d')](_0x4881('0x6e'),_0x4881('0x6f')+util[_0x4881('0x64')](_0x4881('0x70'),_0x20abef['params']['id'],_0xe01fbf));_0x5547e2[_0x4881('0x6d')]('Content-type',_0x4881('0x71'));return _0x5547e2['download'](util[_0x4881('0x64')](_0x4881('0x6c'),_0x20abef[_0x4881('0x4d')]['id'],_0xe01fbf));}else{return _0x5547e2['sendStatus'](0xcc);}})[_0x4881('0x4b')](handleError(_0x5547e2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 49cc33b..4df91e6 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 _0x8832=['lodash','util','moment','bluebird','request-promise','rimraf','./jscriptyProject.attributes','exports','define','jscripty_projects'];(function(_0x488818,_0x17c6de){var _0x30783c=function(_0x1b418c){while(--_0x1b418c){_0x488818['push'](_0x488818['shift']());}};_0x30783c(++_0x17c6de);}(_0x8832,0x1f4));var _0x2883=function(_0x38e9cc,_0x4c0f16){_0x38e9cc=_0x38e9cc-0x0;var _0x3e4b1d=_0x8832[_0x38e9cc];return _0x3e4b1d;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rp=require(_0x2883('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2883('0x5'));var config=require('../../config/environment');var attributes=require(_0x2883('0x6'));module[_0x2883('0x7')]=function(_0x278026,_0x556903){return _0x278026[_0x2883('0x8')]('JscriptyProject',attributes,{'tableName':_0x2883('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x826a=['request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','api','bluebird'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x826a,0x1aa));var _0xa826=function(_0x495470,_0x4d1949){_0x495470=_0x495470-0x0;var _0x385acc=_0x826a[_0x495470];return _0x385acc;};'use strict';var _=require('lodash');var util=require(_0xa826('0x0'));var logger=require('../../config/logger')(_0xa826('0x1'));var moment=require('moment');var BPromise=require(_0xa826('0x2'));var rp=require(_0xa826('0x3'));var fs=require('fs');var path=require(_0xa826('0x4'));var rimraf=require(_0xa826('0x5'));var config=require('../../config/environment');var attributes=require(_0xa826('0x6'));module[_0xa826('0x7')]=function(_0x3929d4,_0x34327b){return _0x3929d4[_0xa826('0x8')](_0xa826('0x9'),attributes,{'tableName':_0xa826('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 2305a55..9b19cf9 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x58dbf7,_0x40635f){var _0x200491=function(_0x4fb974){while(--_0x4fb974){_0x58dbf7['push'](_0x58dbf7['shift']());}};_0x200491(++_0x40635f);}(_0x70e0,0x17b));var _0x070e=function(_0x1281fd,_0x1d4d9d){_0x1281fd=_0x1281fd-0x0;var _0x4c9df8=_0x70e0[_0x1281fd];return _0x4c9df8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xda3f,0xec));var _0xfda3=function(_0x53996f,_0x5ead0f){_0x53996f=_0x53996f-0x0;var _0xa6eca5=_0xda3f[_0x53996f];return _0xa6eca5;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 20b93e5..a1b1e32 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 _0xc1a2=['show','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id'];(function(_0x12d03d,_0x1ec232){var _0x23d165=function(_0x1508dc){while(--_0x1508dc){_0x12d03d['push'](_0x12d03d['shift']());}};_0x23d165(++_0x1ec232);}(_0xc1a2,0x184));var _0x2c1a=function(_0x286325,_0x4d5b65){_0x286325=_0x286325-0x0;var _0x4c8939=_0xc1a2[_0x286325];return _0x4c8939;};'use strict';var multer=require(_0x2c1a('0x0'));var util=require('util');var path=require(_0x2c1a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c1a('0x2')]();var fs_extra=require(_0x2c1a('0x3'));var auth=require(_0x2c1a('0x4'));var interaction=require(_0x2c1a('0x5'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x2c1a('0x6')]('/',auth[_0x2c1a('0x7')](),controller[_0x2c1a('0x8')]);router[_0x2c1a('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x2c1a('0x9')]);router[_0x2c1a('0x6')](_0x2c1a('0xa'),auth[_0x2c1a('0x7')](),controller[_0x2c1a('0xb')]);router[_0x2c1a('0xc')]('/',auth[_0x2c1a('0x7')](),controller[_0x2c1a('0xd')]);router[_0x2c1a('0xe')](_0x2c1a('0xa'),auth[_0x2c1a('0x7')](),controller[_0x2c1a('0xf')]);router[_0x2c1a('0x10')](_0x2c1a('0xa'),auth[_0x2c1a('0x7')](),controller[_0x2c1a('0x11')]);module[_0x2c1a('0x12')]=router; \ No newline at end of file +var _0x4766=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra'];(function(_0x6d8b10,_0x3287f1){var _0x20e4b3=function(_0x3fc88f){while(--_0x3fc88f){_0x6d8b10['push'](_0x6d8b10['shift']());}};_0x20e4b3(++_0x3287f1);}(_0x4766,0xd8));var _0x6476=function(_0x288415,_0x115d49){_0x288415=_0x288415-0x0;var _0x2c43fe=_0x4766[_0x288415];return _0x2c43fe;};'use strict';var multer=require('multer');var util=require(_0x6476('0x0'));var path=require('path');var timeout=require(_0x6476('0x1'));var express=require(_0x6476('0x2'));var router=express['Router']();var fs_extra=require(_0x6476('0x3'));var auth=require(_0x6476('0x4'));var interaction=require(_0x6476('0x5'));var config=require(_0x6476('0x6'));var controller=require(_0x6476('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6476('0x8')]);router[_0x6476('0x9')](_0x6476('0xa'),auth[_0x6476('0xb')](),controller['describe']);router[_0x6476('0x9')](_0x6476('0xc'),auth[_0x6476('0xb')](),controller['show']);router[_0x6476('0xd')]('/',auth[_0x6476('0xb')](),controller[_0x6476('0xe')]);router[_0x6476('0xf')]('/:id',auth[_0x6476('0xb')](),controller[_0x6476('0x10')]);router[_0x6476('0x11')](_0x6476('0xc'),auth[_0x6476('0xb')](),controller[_0x6476('0x12')]);module[_0x6476('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 5f3c4b7..5f4cf35 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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x1e1556,_0x53d7cb){_0x1e1556=_0x1e1556-0x0;var _0x22612b=_0x7a54[_0x1e1556];return _0x22612b;};'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(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x17e10e,_0x46fc31){_0x17e10e=_0x17e10e-0x0;var _0x3df1cb=_0x7a54[_0x17e10e];return _0x3df1cb;};'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 d0d85e0..2002a5c 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 _0x27bc=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','params','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5745e2,_0x26a4ba){var _0x4c2543=function(_0x579245){while(--_0x579245){_0x5745e2['push'](_0x5745e2['shift']());}};_0x4c2543(++_0x26a4ba);}(_0x27bc,0x16d));var _0xc27b=function(_0x2d735a,_0x4bc2fe){_0x2d735a=_0x2d735a-0x0;var _0x20a03d=_0x27bc[_0x2d735a];return _0x20a03d;};'use strict';var emlformat=require(_0xc27b('0x0'));var rimraf=require(_0xc27b('0x1'));var zipdir=require(_0xc27b('0x2'));var jsonpatch=require(_0xc27b('0x3'));var rp=require(_0xc27b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc27b('0x5'));var util=require(_0xc27b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc27b('0x7'));var ejs=require(_0xc27b('0x8'));var fs=require('fs');var fs_extra=require(_0xc27b('0x9'));var _=require('lodash');var squel=require(_0xc27b('0xa'));var crypto=require(_0xc27b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc27b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc27b('0xd'));var Papa=require(_0xc27b('0xe'));var Redis=require(_0xc27b('0xf'));var authService=require(_0xc27b('0x10'));var qs=require(_0xc27b('0x11'));var as=require(_0xc27b('0x12'));var hardwareService=require(_0xc27b('0x13'));var logger=require(_0xc27b('0x14'))(_0xc27b('0x15'));var utils=require(_0xc27b('0x16'));var config=require(_0xc27b('0x17'));var licenseUtil=require(_0xc27b('0x18'));var db=require(_0xc27b('0x19'))['db'];function respondWithStatusCode(_0x33b203,_0x2a6276){_0x2a6276=_0x2a6276||0xcc;return function(_0x55d60f){if(_0x55d60f){return _0x33b203[_0xc27b('0x1a')](_0x2a6276);}return _0x33b203[_0xc27b('0x1b')](_0x2a6276)[_0xc27b('0x1c')]();};}function respondWithResult(_0x2a2799,_0x33ae95){_0x33ae95=_0x33ae95||0xc8;return function(_0x77c2a3){if(_0x77c2a3){return _0x2a2799[_0xc27b('0x1b')](_0x33ae95)[_0xc27b('0x1d')](_0x77c2a3);}};}function respondWithFilteredResult(_0x4b839b,_0xb30c38){return function(_0x29f16d){if(_0x29f16d){var _0x1085bd=typeof _0xb30c38[_0xc27b('0x1e')]===_0xc27b('0x1f')&&typeof _0xb30c38[_0xc27b('0x20')]===_0xc27b('0x1f');var _0x2b627a=_0x29f16d[_0xc27b('0x21')];var _0x2eefdc=_0x1085bd?0x0:_0xb30c38[_0xc27b('0x1e')];var _0x17ffca=_0x1085bd?_0x29f16d[_0xc27b('0x21')]:_0xb30c38[_0xc27b('0x1e')]+_0xb30c38[_0xc27b('0x20')];var _0x2679da;if(_0x17ffca>=_0x2b627a){_0x17ffca=_0x2b627a;_0x2679da=0xc8;}else{_0x2679da=0xce;}_0x4b839b[_0xc27b('0x1b')](_0x2679da);return _0x4b839b[_0xc27b('0x22')](_0xc27b('0x23'),_0x2eefdc+'-'+_0x17ffca+'/'+_0x2b627a)[_0xc27b('0x1d')](_0x29f16d);}return null;};}function patchUpdates(_0x2e93fe){return function(_0x276dfa){try{jsonpatch[_0xc27b('0x24')](_0x276dfa,_0x2e93fe,!![]);}catch(_0x2a15be){return BPromise[_0xc27b('0x25')](_0x2a15be);}return _0x276dfa[_0xc27b('0x26')]();};}function saveUpdates(_0x5298be,_0x354046){return function(_0x1e08ac){if(_0x1e08ac){return _0x1e08ac['update'](_0x5298be)[_0xc27b('0x27')](function(_0x2e20f7){return _0x2e20f7;});}return null;};}function removeEntity(_0x35f69c,_0x407f21){return function(_0x4b03db){if(_0x4b03db){return _0x4b03db[_0xc27b('0x28')]()[_0xc27b('0x27')](function(){_0x35f69c[_0xc27b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x237c93,_0x326940){return function(_0x316489){if(!_0x316489){_0x237c93[_0xc27b('0x1a')](0x194);}return _0x316489;};}function handleError(_0xf16bbf,_0x231730){_0x231730=_0x231730||0x1f4;return function(_0x27ab67){logger[_0xc27b('0x29')](_0x27ab67[_0xc27b('0x2a')]);if(_0x27ab67[_0xc27b('0x2b')]){delete _0x27ab67[_0xc27b('0x2b')];}_0xf16bbf[_0xc27b('0x1b')](_0x231730)['send'](_0x27ab67);};}exports[_0xc27b('0x2c')]=function(_0x39a840,_0x38c5ce){var _0x49929f={},_0x235875={},_0x5d7ab3={'count':0x0,'rows':[]};var _0x13f678=_[_0xc27b('0x2d')](db[_0xc27b('0x2e')][_0xc27b('0x2f')],function(_0x110b35){return{'name':_0x110b35[_0xc27b('0x30')],'type':_0x110b35[_0xc27b('0x31')][_0xc27b('0x32')]};});_0x235875[_0xc27b('0x33')]=_[_0xc27b('0x2d')](_0x13f678,_0xc27b('0x2b'));_0x235875['query']=_[_0xc27b('0x34')](_0x39a840[_0xc27b('0x35')]);_0x235875[_0xc27b('0x36')]=_[_0xc27b('0x37')](_0x235875['model'],_0x235875['query']);_0x49929f[_0xc27b('0x38')]=_[_0xc27b('0x37')](_0x235875[_0xc27b('0x33')],qs[_0xc27b('0x39')](_0x39a840['query'][_0xc27b('0x39')]));_0x49929f['attributes']=_0x49929f[_0xc27b('0x38')][_0xc27b('0x3a')]?_0x49929f[_0xc27b('0x38')]:_0x235875[_0xc27b('0x33')];if(!_0x39a840[_0xc27b('0x35')][_0xc27b('0x3b')](_0xc27b('0x3c'))){_0x49929f[_0xc27b('0x20')]=qs['limit'](_0x39a840[_0xc27b('0x35')][_0xc27b('0x20')]);_0x49929f[_0xc27b('0x1e')]=qs['offset'](_0x39a840[_0xc27b('0x35')][_0xc27b('0x1e')]);}_0x49929f[_0xc27b('0x3d')]=qs[_0xc27b('0x3e')](_0x39a840['query'][_0xc27b('0x3e')]);_0x49929f[_0xc27b('0x3f')]=qs[_0xc27b('0x36')](_[_0xc27b('0x40')](_0x39a840[_0xc27b('0x35')],_0x235875[_0xc27b('0x36')]),_0x13f678);if(_0x39a840[_0xc27b('0x35')]['filter']){_0x49929f[_0xc27b('0x3f')]=_[_0xc27b('0x41')](_0x49929f[_0xc27b('0x3f')],{'$or':_[_0xc27b('0x2d')](_0x13f678,function(_0x2ee18c){if(_0x2ee18c[_0xc27b('0x31')]!==_0xc27b('0x42')){var _0x409b48={};_0x409b48[_0x2ee18c[_0xc27b('0x2b')]]={'$like':'%'+_0x39a840[_0xc27b('0x35')][_0xc27b('0x43')]+'%'};return _0x409b48;}})});}_0x49929f=_['merge']({},_0x49929f,_0x39a840['options']);var _0x29674f={'where':_0x49929f['where']};return db[_0xc27b('0x2e')][_0xc27b('0x21')](_0x29674f)[_0xc27b('0x27')](function(_0x141274){_0x5d7ab3[_0xc27b('0x21')]=_0x141274;if(_0x39a840['query'][_0xc27b('0x44')]){_0x49929f[_0xc27b('0x45')]=[{'all':!![]}];}return db[_0xc27b('0x2e')]['findAll'](_0x49929f);})['then'](function(_0x7c67c7){_0x5d7ab3[_0xc27b('0x46')]=_0x7c67c7;return _0x5d7ab3;})[_0xc27b('0x27')](respondWithFilteredResult(_0x38c5ce,_0x49929f))[_0xc27b('0x47')](handleError(_0x38c5ce,null));};exports['show']=function(_0x26a549,_0x52c50b){var _0x45b938={'raw':!![],'where':{'id':_0x26a549[_0xc27b('0x48')]['id']}},_0x323245={};_0x323245[_0xc27b('0x33')]=_[_0xc27b('0x34')](db[_0xc27b('0x2e')][_0xc27b('0x2f')]);_0x323245['query']=_[_0xc27b('0x34')](_0x26a549['query']);_0x323245[_0xc27b('0x36')]=_[_0xc27b('0x37')](_0x323245[_0xc27b('0x33')],_0x323245[_0xc27b('0x35')]);_0x45b938[_0xc27b('0x38')]=_[_0xc27b('0x37')](_0x323245[_0xc27b('0x33')],qs[_0xc27b('0x39')](_0x26a549['query'][_0xc27b('0x39')]));_0x45b938['attributes']=_0x45b938[_0xc27b('0x38')]['length']?_0x45b938['attributes']:_0x323245[_0xc27b('0x33')];if(_0x26a549['query'][_0xc27b('0x44')]){_0x45b938[_0xc27b('0x45')]=[{'all':!![]}];}_0x45b938=_[_0xc27b('0x41')]({},_0x45b938,_0x26a549[_0xc27b('0x49')]);return db['JscriptyQuestionReport'][_0xc27b('0x4a')](_0x45b938)[_0xc27b('0x27')](handleEntityNotFound(_0x52c50b,null))['then'](respondWithResult(_0x52c50b,null))[_0xc27b('0x47')](handleError(_0x52c50b,null));};exports[_0xc27b('0x4b')]=function(_0x12ccf8,_0x6fe503){return db[_0xc27b('0x2e')][_0xc27b('0x4b')](_0x12ccf8[_0xc27b('0x4c')],{})[_0xc27b('0x27')](respondWithResult(_0x6fe503,0xc9))[_0xc27b('0x47')](handleError(_0x6fe503,null));};exports[_0xc27b('0x4d')]=function(_0x1541ea,_0x221bc1){if(_0x1541ea['body']['id']){delete _0x1541ea[_0xc27b('0x4c')]['id'];}return db[_0xc27b('0x2e')][_0xc27b('0x4a')]({'where':{'id':_0x1541ea[_0xc27b('0x48')]['id']}})[_0xc27b('0x27')](handleEntityNotFound(_0x221bc1,null))[_0xc27b('0x27')](saveUpdates(_0x1541ea['body'],null))[_0xc27b('0x27')](respondWithResult(_0x221bc1,null))[_0xc27b('0x47')](handleError(_0x221bc1,null));};exports[_0xc27b('0x28')]=function(_0x320803,_0x4a2a71){return db[_0xc27b('0x2e')][_0xc27b('0x4a')]({'where':{'id':_0x320803['params']['id']}})['then'](handleEntityNotFound(_0x4a2a71,null))['then'](removeEntity(_0x4a2a71,null))[_0xc27b('0x47')](handleError(_0x4a2a71,null));};exports[_0xc27b('0x4e')]=function(_0x363981,_0x319376){return db[_0xc27b('0x2e')][_0xc27b('0x4e')]()[_0xc27b('0x27')](respondWithResult(_0x319376,null))['catch'](handleError(_0x319376,null));}; \ No newline at end of file +var _0x3871=['filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','reject','update','then','end','sendStatus','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x5e076d,_0x4b3151){var _0x1f5b85=function(_0x1c7695){while(--_0x1c7695){_0x5e076d['push'](_0x5e076d['shift']());}};_0x1f5b85(++_0x4b3151);}(_0x3871,0x137));var _0x1387=function(_0x351dea,_0x29bdee){_0x351dea=_0x351dea-0x0;var _0x3aefab=_0x3871[_0x351dea];return _0x3aefab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1387('0x0'));var zipdir=require(_0x1387('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1387('0x2'));var moment=require(_0x1387('0x3'));var BPromise=require(_0x1387('0x4'));var Mustache=require('mustache');var util=require(_0x1387('0x5'));var path=require(_0x1387('0x6'));var sox=require(_0x1387('0x7'));var csv=require(_0x1387('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1387('0x9'));var _=require(_0x1387('0xa'));var squel=require(_0x1387('0xb'));var crypto=require(_0x1387('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1387('0xd'));var toCsv=require(_0x1387('0x8'));var querystring=require(_0x1387('0xe'));var Papa=require(_0x1387('0xf'));var Redis=require(_0x1387('0x10'));var authService=require(_0x1387('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1387('0x12'));var hardwareService=require(_0x1387('0x13'));var logger=require(_0x1387('0x14'))(_0x1387('0x15'));var utils=require(_0x1387('0x16'));var config=require(_0x1387('0x17'));var licenseUtil=require(_0x1387('0x18'));var db=require(_0x1387('0x19'))['db'];function respondWithStatusCode(_0x4e9df9,_0x3fd012){_0x3fd012=_0x3fd012||0xcc;return function(_0x28a109){if(_0x28a109){return _0x4e9df9['sendStatus'](_0x3fd012);}return _0x4e9df9[_0x1387('0x1a')](_0x3fd012)['end']();};}function respondWithResult(_0x44c356,_0x9d56c){_0x9d56c=_0x9d56c||0xc8;return function(_0x423058){if(_0x423058){return _0x44c356['status'](_0x9d56c)['json'](_0x423058);}};}function respondWithFilteredResult(_0x330e55,_0x246f2a){return function(_0x31fe91){if(_0x31fe91){var _0x524e4d=typeof _0x246f2a[_0x1387('0x1b')]===_0x1387('0x1c')&&typeof _0x246f2a[_0x1387('0x1d')]==='undefined';var _0xb6af7e=_0x31fe91[_0x1387('0x1e')];var _0x14a341=_0x524e4d?0x0:_0x246f2a['offset'];var _0x13c1f0=_0x524e4d?_0x31fe91[_0x1387('0x1e')]:_0x246f2a[_0x1387('0x1b')]+_0x246f2a[_0x1387('0x1d')];var _0x9b9f0f;if(_0x13c1f0>=_0xb6af7e){_0x13c1f0=_0xb6af7e;_0x9b9f0f=0xc8;}else{_0x9b9f0f=0xce;}_0x330e55['status'](_0x9b9f0f);return _0x330e55['set'](_0x1387('0x1f'),_0x14a341+'-'+_0x13c1f0+'/'+_0xb6af7e)[_0x1387('0x20')](_0x31fe91);}return null;};}function patchUpdates(_0x2cc440){return function(_0x27e729){try{jsonpatch['apply'](_0x27e729,_0x2cc440,!![]);}catch(_0x2d5418){return BPromise[_0x1387('0x21')](_0x2d5418);}return _0x27e729['save']();};}function saveUpdates(_0x53207c,_0x520f11){return function(_0x34b9c4){if(_0x34b9c4){return _0x34b9c4[_0x1387('0x22')](_0x53207c)['then'](function(_0x3fe682){return _0x3fe682;});}return null;};}function removeEntity(_0x56977a,_0x58757b){return function(_0x3fa2d5){if(_0x3fa2d5){return _0x3fa2d5['destroy']()[_0x1387('0x23')](function(){_0x56977a['status'](0xcc)[_0x1387('0x24')]();});}};}function handleEntityNotFound(_0x496348,_0x4142e8){return function(_0x16d836){if(!_0x16d836){_0x496348[_0x1387('0x25')](0x194);}return _0x16d836;};}function handleError(_0x3970c8,_0x3cf634){_0x3cf634=_0x3cf634||0x1f4;return function(_0x260d8e){logger[_0x1387('0x26')](_0x260d8e[_0x1387('0x27')]);if(_0x260d8e[_0x1387('0x28')]){delete _0x260d8e[_0x1387('0x28')];}_0x3970c8[_0x1387('0x1a')](_0x3cf634)[_0x1387('0x29')](_0x260d8e);};}exports[_0x1387('0x2a')]=function(_0x5b1fab,_0x4628b3){var _0x38d391={},_0x129c48={},_0x1e8982={'count':0x0,'rows':[]};var _0x250fc7=_[_0x1387('0x2b')](db[_0x1387('0x2c')]['rawAttributes'],function(_0x37bb38){return{'name':_0x37bb38[_0x1387('0x2d')],'type':_0x37bb38[_0x1387('0x2e')][_0x1387('0x2f')]};});_0x129c48[_0x1387('0x30')]=_[_0x1387('0x2b')](_0x250fc7,_0x1387('0x28'));_0x129c48['query']=_[_0x1387('0x31')](_0x5b1fab[_0x1387('0x32')]);_0x129c48['filters']=_[_0x1387('0x33')](_0x129c48[_0x1387('0x30')],_0x129c48[_0x1387('0x32')]);_0x38d391[_0x1387('0x34')]=_[_0x1387('0x33')](_0x129c48[_0x1387('0x30')],qs[_0x1387('0x35')](_0x5b1fab['query'][_0x1387('0x35')]));_0x38d391[_0x1387('0x34')]=_0x38d391[_0x1387('0x34')][_0x1387('0x36')]?_0x38d391[_0x1387('0x34')]:_0x129c48['model'];if(!_0x5b1fab[_0x1387('0x32')]['hasOwnProperty'](_0x1387('0x37'))){_0x38d391[_0x1387('0x1d')]=qs[_0x1387('0x1d')](_0x5b1fab[_0x1387('0x32')][_0x1387('0x1d')]);_0x38d391[_0x1387('0x1b')]=qs['offset'](_0x5b1fab[_0x1387('0x32')]['offset']);}_0x38d391[_0x1387('0x38')]=qs[_0x1387('0x39')](_0x5b1fab[_0x1387('0x32')]['sort']);_0x38d391[_0x1387('0x3a')]=qs['filters'](_['pick'](_0x5b1fab[_0x1387('0x32')],_0x129c48[_0x1387('0x3b')]),_0x250fc7);if(_0x5b1fab['query'][_0x1387('0x3c')]){_0x38d391[_0x1387('0x3a')]=_['merge'](_0x38d391[_0x1387('0x3a')],{'$or':_[_0x1387('0x2b')](_0x250fc7,function(_0x3f12ca){if(_0x3f12ca['type']!=='VIRTUAL'){var _0x3bc831={};_0x3bc831[_0x3f12ca[_0x1387('0x28')]]={'$like':'%'+_0x5b1fab[_0x1387('0x32')][_0x1387('0x3c')]+'%'};return _0x3bc831;}})});}_0x38d391=_[_0x1387('0x3d')]({},_0x38d391,_0x5b1fab[_0x1387('0x3e')]);var _0x4c94b0={'where':_0x38d391[_0x1387('0x3a')]};return db[_0x1387('0x2c')][_0x1387('0x1e')](_0x4c94b0)['then'](function(_0x23433d){_0x1e8982[_0x1387('0x1e')]=_0x23433d;if(_0x5b1fab['query'][_0x1387('0x3f')]){_0x38d391['include']=[{'all':!![]}];}return db[_0x1387('0x2c')][_0x1387('0x40')](_0x38d391);})[_0x1387('0x23')](function(_0x127783){_0x1e8982[_0x1387('0x41')]=_0x127783;return _0x1e8982;})[_0x1387('0x23')](respondWithFilteredResult(_0x4628b3,_0x38d391))[_0x1387('0x42')](handleError(_0x4628b3,null));};exports[_0x1387('0x43')]=function(_0x7a5de1,_0x382066){var _0x21abed={'raw':!![],'where':{'id':_0x7a5de1[_0x1387('0x44')]['id']}},_0x5e51c0={};_0x5e51c0['model']=_[_0x1387('0x31')](db[_0x1387('0x2c')][_0x1387('0x45')]);_0x5e51c0[_0x1387('0x32')]=_[_0x1387('0x31')](_0x7a5de1[_0x1387('0x32')]);_0x5e51c0[_0x1387('0x3b')]=_[_0x1387('0x33')](_0x5e51c0[_0x1387('0x30')],_0x5e51c0[_0x1387('0x32')]);_0x21abed[_0x1387('0x34')]=_[_0x1387('0x33')](_0x5e51c0[_0x1387('0x30')],qs[_0x1387('0x35')](_0x7a5de1[_0x1387('0x32')]['fields']));_0x21abed['attributes']=_0x21abed[_0x1387('0x34')][_0x1387('0x36')]?_0x21abed[_0x1387('0x34')]:_0x5e51c0[_0x1387('0x30')];if(_0x7a5de1[_0x1387('0x32')][_0x1387('0x3f')]){_0x21abed['include']=[{'all':!![]}];}_0x21abed=_['merge']({},_0x21abed,_0x7a5de1[_0x1387('0x3e')]);return db['JscriptyQuestionReport'][_0x1387('0x46')](_0x21abed)[_0x1387('0x23')](handleEntityNotFound(_0x382066,null))['then'](respondWithResult(_0x382066,null))[_0x1387('0x42')](handleError(_0x382066,null));};exports[_0x1387('0x47')]=function(_0xeb1abb,_0x834716){return db[_0x1387('0x2c')][_0x1387('0x47')](_0xeb1abb[_0x1387('0x48')],{})[_0x1387('0x23')](respondWithResult(_0x834716,0xc9))[_0x1387('0x42')](handleError(_0x834716,null));};exports[_0x1387('0x22')]=function(_0x4a3cfc,_0xd3c584){if(_0x4a3cfc[_0x1387('0x48')]['id']){delete _0x4a3cfc[_0x1387('0x48')]['id'];}return db[_0x1387('0x2c')][_0x1387('0x46')]({'where':{'id':_0x4a3cfc[_0x1387('0x44')]['id']}})['then'](handleEntityNotFound(_0xd3c584,null))['then'](saveUpdates(_0x4a3cfc[_0x1387('0x48')],null))[_0x1387('0x23')](respondWithResult(_0xd3c584,null))[_0x1387('0x42')](handleError(_0xd3c584,null));};exports[_0x1387('0x49')]=function(_0x3c61c4,_0xd99110){return db['JscriptyQuestionReport'][_0x1387('0x46')]({'where':{'id':_0x3c61c4[_0x1387('0x44')]['id']}})['then'](handleEntityNotFound(_0xd99110,null))[_0x1387('0x23')](removeEntity(_0xd99110,null))['catch'](handleError(_0xd99110,null));};exports['describe']=function(_0x4fa61c,_0x3e4483){return db['JscriptyQuestionReport']['describe']()[_0x1387('0x23')](respondWithResult(_0x3e4483,null))[_0x1387('0x42')](handleError(_0x3e4483,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 493dbf4..ffbb3a9 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 _0x0620=['exports','define','report_jscripty_questions','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x515c58,_0x347d97){var _0x24ce9e=function(_0x1049f6){while(--_0x1049f6){_0x515c58['push'](_0x515c58['shift']());}};_0x24ce9e(++_0x347d97);}(_0x0620,0x1bb));var _0x0062=function(_0x51706c,_0x134daf){_0x51706c=_0x51706c-0x0;var _0x545efa=_0x0620[_0x51706c];return _0x545efa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0062('0x0'))(_0x0062('0x1'));var moment=require(_0x0062('0x2'));var BPromise=require(_0x0062('0x3'));var rp=require(_0x0062('0x4'));var fs=require('fs');var path=require(_0x0062('0x5'));var rimraf=require('rimraf');var config=require(_0x0062('0x6'));var attributes=require(_0x0062('0x7'));module[_0x0062('0x8')]=function(_0x30cf24,_0x55d287){return _0x30cf24[_0x0062('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x0062('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8022=['define','report_jscripty_questions','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8022,0x70));var _0x2802=function(_0x3d3bd2,_0x5aad60){_0x3d3bd2=_0x3d3bd2-0x0;var _0x4c795e=_0x8022[_0x3d3bd2];return _0x4c795e;};'use strict';var _=require(_0x2802('0x0'));var util=require(_0x2802('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2802('0x2'));var BPromise=require(_0x2802('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2802('0x4'));var rimraf=require(_0x2802('0x5'));var config=require(_0x2802('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x2802('0x7')]=function(_0x569b12,_0x10b47e){return _0x569b12[_0x2802('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x2802('0x9'),'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 aa6e8ee..d320c9d 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 _0xa16d=['JscriptyQuestionReport,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1fb038,_0xc3f69b){var _0x1600dc=function(_0x2a040e){while(--_0x2a040e){_0x1fb038['push'](_0x1fb038['shift']());}};_0x1600dc(++_0xc3f69b);}(_0xa16d,0x1ce));var _0xda16=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0xa16d[_0x4af01e];return _0x178c11;};'use strict';var _=require('lodash');var util=require(_0xda16('0x0'));var moment=require(_0xda16('0x1'));var BPromise=require(_0xda16('0x2'));var rs=require(_0xda16('0x3'));var fs=require('fs');var Redis=require(_0xda16('0x4'));var db=require(_0xda16('0x5'))['db'];var utils=require(_0xda16('0x6'));var logger=require(_0xda16('0x7'))(_0xda16('0x8'));var config=require(_0xda16('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xda16('0xa')][_0xda16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x93e756,_0x222c40,_0x4f201e){return new BPromise(function(_0x4beba6,_0x256bcc){return client[_0xda16('0xc')](_0x93e756,_0x4f201e)['then'](function(_0x21a161){logger[_0xda16('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x222c40,_0xda16('0xe'));logger[_0xda16('0xf')](_0xda16('0x10'),_0x222c40,_0xda16('0xe'),JSON[_0xda16('0x11')](_0x21a161));if(_0x21a161['error']){if(_0x21a161[_0xda16('0x12')][_0xda16('0x13')]===0x1f4){logger[_0xda16('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x222c40,_0x21a161[_0xda16('0x12')][_0xda16('0x14')]);return _0x256bcc(_0x21a161[_0xda16('0x12')][_0xda16('0x14')]);}logger[_0xda16('0x12')](_0xda16('0x15'),_0x222c40,_0x21a161[_0xda16('0x12')]['message']);return _0x4beba6(_0x21a161[_0xda16('0x12')]['message']);}else{logger[_0xda16('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x222c40,_0xda16('0xe'));_0x4beba6(_0x21a161[_0xda16('0x16')][_0xda16('0x14')]);}})['catch'](function(_0x37d077){logger[_0xda16('0x12')](_0xda16('0x15'),_0x222c40,_0x37d077);_0x256bcc(_0x37d077);});});} \ No newline at end of file +var _0x9e5b=['message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x9e5b,0x18e));var _0xb9e5=function(_0x211594,_0x1f4a00){_0x211594=_0x211594-0x0;var _0x8be26c=_0x9e5b[_0x211594];return _0x8be26c;};'use strict';var _=require('lodash');var util=require(_0xb9e5('0x0'));var moment=require(_0xb9e5('0x1'));var BPromise=require(_0xb9e5('0x2'));var rs=require(_0xb9e5('0x3'));var fs=require('fs');var Redis=require(_0xb9e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9e5('0x5'));var logger=require(_0xb9e5('0x6'))(_0xb9e5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb9e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ac41,_0x26a0a7,_0x21e4af){return new BPromise(function(_0x392976,_0x2e9969){return client[_0xb9e5('0x9')](_0x45ac41,_0x21e4af)[_0xb9e5('0xa')](function(_0x55ffa5){logger[_0xb9e5('0xb')](_0xb9e5('0xc'),_0x26a0a7,_0xb9e5('0xd'));logger[_0xb9e5('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x26a0a7,'request\x20sent',JSON['stringify'](_0x55ffa5));if(_0x55ffa5[_0xb9e5('0xf')]){if(_0x55ffa5[_0xb9e5('0xf')]['code']===0x1f4){logger[_0xb9e5('0xf')](_0xb9e5('0xc'),_0x26a0a7,_0x55ffa5[_0xb9e5('0xf')][_0xb9e5('0x10')]);return _0x2e9969(_0x55ffa5[_0xb9e5('0xf')]['message']);}logger[_0xb9e5('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x26a0a7,_0x55ffa5[_0xb9e5('0xf')]['message']);return _0x392976(_0x55ffa5[_0xb9e5('0xf')][_0xb9e5('0x10')]);}else{logger['info'](_0xb9e5('0xc'),_0x26a0a7,'request\x20sent');_0x392976(_0x55ffa5[_0xb9e5('0x11')][_0xb9e5('0x10')]);}})['catch'](function(_0x53de24){logger[_0xb9e5('0xf')](_0xb9e5('0xc'),_0x26a0a7,_0x53de24);_0x2e9969(_0x53de24);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 6540f5b..2358d38 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 _0x1998=['isAuthenticated','describe','show','/:id/questions','getQuestions','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe'];(function(_0x48f494,_0x53225b){var _0x213924=function(_0x571bf1){while(--_0x571bf1){_0x48f494['push'](_0x48f494['shift']());}};_0x213924(++_0x53225b);}(_0x1998,0xed));var _0x8199=function(_0x2d5f4e,_0x47dbdf){_0x2d5f4e=_0x2d5f4e-0x0;var _0xbd92bc=_0x1998[_0x2d5f4e];return _0xbd92bc;};'use strict';var multer=require(_0x8199('0x0'));var util=require(_0x8199('0x1'));var path=require(_0x8199('0x2'));var timeout=require(_0x8199('0x3'));var express=require(_0x8199('0x4'));var router=express[_0x8199('0x5')]();var fs_extra=require(_0x8199('0x6'));var auth=require(_0x8199('0x7'));var interaction=require(_0x8199('0x8'));var config=require(_0x8199('0x9'));var controller=require(_0x8199('0xa'));router[_0x8199('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8199('0xb')](_0x8199('0xc'),auth[_0x8199('0xd')](),controller[_0x8199('0xe')]);router[_0x8199('0xb')]('/:id',auth[_0x8199('0xd')](),controller[_0x8199('0xf')]);router[_0x8199('0xb')](_0x8199('0x10'),auth[_0x8199('0xd')](),controller[_0x8199('0x11')]);router['post']('/',auth[_0x8199('0xd')](),controller[_0x8199('0x12')]);router[_0x8199('0x13')]('/:id',auth[_0x8199('0xd')](),controller[_0x8199('0x14')]);router[_0x8199('0x15')](_0x8199('0x16'),auth[_0x8199('0xd')](),controller[_0x8199('0x17')]);module[_0x8199('0x18')]=router; \ No newline at end of file +var _0xfdf2=['update','destroy','exports','multer','util','connect-timeout','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','getQuestions','post','put','/:id'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xfdf2,0xe7));var _0x2fdf=function(_0x3c8247,_0x237054){_0x3c8247=_0x3c8247-0x0;var _0x47ca00=_0xfdf2[_0x3c8247];return _0x47ca00;};'use strict';var multer=require(_0x2fdf('0x0'));var util=require(_0x2fdf('0x1'));var path=require('path');var timeout=require(_0x2fdf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2fdf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2fdf('0x4'));var controller=require(_0x2fdf('0x5'));router[_0x2fdf('0x6')]('/',auth[_0x2fdf('0x7')](),controller[_0x2fdf('0x8')]);router[_0x2fdf('0x6')](_0x2fdf('0x9'),auth['isAuthenticated'](),controller[_0x2fdf('0xa')]);router[_0x2fdf('0x6')]('/:id',auth[_0x2fdf('0x7')](),controller[_0x2fdf('0xb')]);router[_0x2fdf('0x6')]('/:id/questions',auth[_0x2fdf('0x7')](),controller[_0x2fdf('0xc')]);router[_0x2fdf('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2fdf('0xe')](_0x2fdf('0xf'),auth['isAuthenticated'](),controller[_0x2fdf('0x10')]);router['delete']('/:id',auth[_0x2fdf('0x7')](),controller[_0x2fdf('0x11')]);module[_0x2fdf('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a35dd52..9d49b83 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 _0xd4f9=['STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','format'];(function(_0x160747,_0x36cb3d){var _0x94d7a0=function(_0x110d1c){while(--_0x110d1c){_0x160747['push'](_0x160747['shift']());}};_0x94d7a0(++_0x36cb3d);}(_0xd4f9,0x1c9));var _0x9d4f=function(_0x5a41f1,_0x13b29d){_0x5a41f1=_0x5a41f1-0x0;var _0x1758c1=_0xd4f9[_0x5a41f1];return _0x1758c1;};'use strict';var moment=require(_0x9d4f('0x0'));var Sequelize=require(_0x9d4f('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x9d4f('0x2')],'set':function(_0x172c30){this['setDataValue']('starttime',_0x172c30);this[_0x9d4f('0x3')]('endtime',moment()[_0x9d4f('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x9d4f('0x2')]},'membername':{'type':Sequelize[_0x9d4f('0x5')]},'projectname':{'type':Sequelize[_0x9d4f('0x5')]},'queue':{'type':Sequelize[_0x9d4f('0x5')]},'uniqueid':{'type':Sequelize[_0x9d4f('0x5')]},'calleridname':{'type':Sequelize[_0x9d4f('0x5')]},'calleridnum':{'type':Sequelize[_0x9d4f('0x5')]},'completed':{'type':Sequelize[_0x9d4f('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x9a4d=['exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize'];(function(_0x17ea60,_0x26adcc){var _0x172545=function(_0x209f2a){while(--_0x209f2a){_0x17ea60['push'](_0x17ea60['shift']());}};_0x172545(++_0x26adcc);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x50c5fd,_0x4d9f10){_0x50c5fd=_0x50c5fd-0x0;var _0x547eb7=_0x9a4d[_0x50c5fd];return _0x547eb7;};'use strict';var moment=require(_0xd9a4('0x0'));var Sequelize=require(_0xd9a4('0x1'));module[_0xd9a4('0x2')]={'starttime':{'type':Sequelize[_0xd9a4('0x3')],'set':function(_0x4ef43e){this['setDataValue']('starttime',_0x4ef43e);this[_0xd9a4('0x4')](_0xd9a4('0x5'),moment()[_0xd9a4('0x6')](_0xd9a4('0x7')));}},'endtime':{'type':Sequelize[_0xd9a4('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xd9a4('0x8')]},'queue':{'type':Sequelize[_0xd9a4('0x8')]},'uniqueid':{'type':Sequelize[_0xd9a4('0x8')]},'calleridname':{'type':Sequelize[_0xd9a4('0x8')]},'calleridnum':{'type':Sequelize[_0xd9a4('0x8')]},'completed':{'type':Sequelize[_0xd9a4('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 6061683..effad74 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 _0x854f=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','apply','save','update','then','error','stack','name','send','JscriptySessionReport','fieldName','type','key','map','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','destroy','describe','getQuestions','findOne','sort','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x53a49a,_0x16b08d){var _0x19a0fb=function(_0x30b0f0){while(--_0x30b0f0){_0x53a49a['push'](_0x53a49a['shift']());}};_0x19a0fb(++_0x16b08d);}(_0x854f,0x12e));var _0xf854=function(_0x351c86,_0x98542e){_0x351c86=_0x351c86-0x0;var _0x5e9711=_0x854f[_0x351c86];return _0x5e9711;};'use strict';var emlformat=require(_0xf854('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf854('0x1'));var jsonpatch=require(_0xf854('0x2'));var rp=require(_0xf854('0x3'));var moment=require(_0xf854('0x4'));var BPromise=require(_0xf854('0x5'));var Mustache=require(_0xf854('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf854('0x7'));var ejs=require(_0xf854('0x8'));var fs=require('fs');var fs_extra=require(_0xf854('0x9'));var _=require(_0xf854('0xa'));var squel=require('squel');var crypto=require(_0xf854('0xb'));var jsforce=require(_0xf854('0xc'));var deskjs=require(_0xf854('0xd'));var toCsv=require(_0xf854('0x7'));var querystring=require(_0xf854('0xe'));var Papa=require(_0xf854('0xf'));var Redis=require('ioredis');var authService=require(_0xf854('0x10'));var qs=require(_0xf854('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf854('0x12'));var logger=require(_0xf854('0x13'))(_0xf854('0x14'));var utils=require(_0xf854('0x15'));var config=require(_0xf854('0x16'));var licenseUtil=require(_0xf854('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37209c,_0x44e24){_0x44e24=_0x44e24||0xcc;return function(_0x1c82af){if(_0x1c82af){return _0x37209c['sendStatus'](_0x44e24);}return _0x37209c[_0xf854('0x18')](_0x44e24)[_0xf854('0x19')]();};}function respondWithResult(_0x5bad07,_0x5fdb1a){_0x5fdb1a=_0x5fdb1a||0xc8;return function(_0x1a8d01){if(_0x1a8d01){return _0x5bad07[_0xf854('0x18')](_0x5fdb1a)[_0xf854('0x1a')](_0x1a8d01);}};}function respondWithFilteredResult(_0x5e5484,_0x128f22){return function(_0x4295e6){if(_0x4295e6){var _0x2c62d4=typeof _0x128f22[_0xf854('0x1b')]==='undefined'&&typeof _0x128f22[_0xf854('0x1c')]===_0xf854('0x1d');var _0xda65b0=_0x4295e6[_0xf854('0x1e')];var _0x156f58=_0x2c62d4?0x0:_0x128f22['offset'];var _0x494716=_0x2c62d4?_0x4295e6['count']:_0x128f22[_0xf854('0x1b')]+_0x128f22['limit'];var _0x18147b;if(_0x494716>=_0xda65b0){_0x494716=_0xda65b0;_0x18147b=0xc8;}else{_0x18147b=0xce;}_0x5e5484[_0xf854('0x18')](_0x18147b);return _0x5e5484['set']('Content-Range',_0x156f58+'-'+_0x494716+'/'+_0xda65b0)[_0xf854('0x1a')](_0x4295e6);}return null;};}function patchUpdates(_0x3c148b){return function(_0x38f679){try{jsonpatch[_0xf854('0x1f')](_0x38f679,_0x3c148b,!![]);}catch(_0x22acd8){return BPromise['reject'](_0x22acd8);}return _0x38f679[_0xf854('0x20')]();};}function saveUpdates(_0x27ea60,_0x30b469){return function(_0x217a40){if(_0x217a40){return _0x217a40[_0xf854('0x21')](_0x27ea60)[_0xf854('0x22')](function(_0x4bdc60){return _0x4bdc60;});}return null;};}function removeEntity(_0x2d7b87,_0x379529){return function(_0x5ccb89){if(_0x5ccb89){return _0x5ccb89['destroy']()[_0xf854('0x22')](function(){_0x2d7b87[_0xf854('0x18')](0xcc)[_0xf854('0x19')]();});}};}function handleEntityNotFound(_0x21a206,_0x2b6dce){return function(_0x23dd2f){if(!_0x23dd2f){_0x21a206['sendStatus'](0x194);}return _0x23dd2f;};}function handleError(_0x1ca7e1,_0x2f8c0c){_0x2f8c0c=_0x2f8c0c||0x1f4;return function(_0x40ed01){logger[_0xf854('0x23')](_0x40ed01[_0xf854('0x24')]);if(_0x40ed01[_0xf854('0x25')]){delete _0x40ed01[_0xf854('0x25')];}_0x1ca7e1[_0xf854('0x18')](_0x2f8c0c)[_0xf854('0x26')](_0x40ed01);};}exports['index']=function(_0x1bb6b2,_0x3969c0){var _0x9c20a5={},_0x37c222={},_0x5188a4={'count':0x0,'rows':[]};var _0x20d23d=_['map'](db[_0xf854('0x27')]['rawAttributes'],function(_0x4f9112){return{'name':_0x4f9112[_0xf854('0x28')],'type':_0x4f9112[_0xf854('0x29')][_0xf854('0x2a')]};});_0x37c222['model']=_[_0xf854('0x2b')](_0x20d23d,'name');_0x37c222[_0xf854('0x2c')]=_['keys'](_0x1bb6b2['query']);_0x37c222[_0xf854('0x2d')]=_[_0xf854('0x2e')](_0x37c222['model'],_0x37c222[_0xf854('0x2c')]);_0x9c20a5['attributes']=_['intersection'](_0x37c222['model'],qs['fields'](_0x1bb6b2['query'][_0xf854('0x2f')]));_0x9c20a5[_0xf854('0x30')]=_0x9c20a5[_0xf854('0x30')][_0xf854('0x31')]?_0x9c20a5[_0xf854('0x30')]:_0x37c222[_0xf854('0x32')];if(!_0x1bb6b2[_0xf854('0x2c')][_0xf854('0x33')](_0xf854('0x34'))){_0x9c20a5[_0xf854('0x1c')]=qs[_0xf854('0x1c')](_0x1bb6b2[_0xf854('0x2c')][_0xf854('0x1c')]);_0x9c20a5['offset']=qs[_0xf854('0x1b')](_0x1bb6b2['query']['offset']);}_0x9c20a5[_0xf854('0x35')]=qs['sort'](_0x1bb6b2[_0xf854('0x2c')]['sort']);_0x9c20a5[_0xf854('0x36')]=qs[_0xf854('0x2d')](_[_0xf854('0x37')](_0x1bb6b2[_0xf854('0x2c')],_0x37c222[_0xf854('0x2d')]),_0x20d23d);if(_0x1bb6b2[_0xf854('0x2c')][_0xf854('0x38')]){_0x9c20a5[_0xf854('0x36')]=_[_0xf854('0x39')](_0x9c20a5[_0xf854('0x36')],{'$or':_[_0xf854('0x2b')](_0x20d23d,function(_0x3ad499){if(_0x3ad499[_0xf854('0x29')]!==_0xf854('0x3a')){var _0x4771f5={};_0x4771f5[_0x3ad499[_0xf854('0x25')]]={'$like':'%'+_0x1bb6b2[_0xf854('0x2c')][_0xf854('0x38')]+'%'};return _0x4771f5;}})});}_0x9c20a5=_[_0xf854('0x39')]({},_0x9c20a5,_0x1bb6b2[_0xf854('0x3b')]);var _0x41c832={'where':_0x9c20a5[_0xf854('0x36')]};return db[_0xf854('0x27')]['count'](_0x41c832)[_0xf854('0x22')](function(_0x3ed8a5){_0x5188a4['count']=_0x3ed8a5;if(_0x1bb6b2[_0xf854('0x2c')][_0xf854('0x3c')]){_0x9c20a5[_0xf854('0x3d')]=[{'all':!![]}];}return db[_0xf854('0x27')][_0xf854('0x3e')](_0x9c20a5);})[_0xf854('0x22')](function(_0xe04fdd){_0x5188a4[_0xf854('0x3f')]=_0xe04fdd;return _0x5188a4;})[_0xf854('0x22')](respondWithFilteredResult(_0x3969c0,_0x9c20a5))['catch'](handleError(_0x3969c0,null));};exports[_0xf854('0x40')]=function(_0x3b9718,_0x598ed8){var _0x1b1f16={'raw':!![],'where':{'id':_0x3b9718[_0xf854('0x41')]['id']}},_0x1380de={};_0x1380de[_0xf854('0x32')]=_['keys'](db[_0xf854('0x27')][_0xf854('0x42')]);_0x1380de[_0xf854('0x2c')]=_[_0xf854('0x43')](_0x3b9718[_0xf854('0x2c')]);_0x1380de[_0xf854('0x2d')]=_[_0xf854('0x2e')](_0x1380de[_0xf854('0x32')],_0x1380de[_0xf854('0x2c')]);_0x1b1f16[_0xf854('0x30')]=_['intersection'](_0x1380de['model'],qs[_0xf854('0x2f')](_0x3b9718['query'][_0xf854('0x2f')]));_0x1b1f16[_0xf854('0x30')]=_0x1b1f16[_0xf854('0x30')][_0xf854('0x31')]?_0x1b1f16[_0xf854('0x30')]:_0x1380de[_0xf854('0x32')];if(_0x3b9718[_0xf854('0x2c')][_0xf854('0x3c')]){_0x1b1f16['include']=[{'all':!![]}];}_0x1b1f16=_['merge']({},_0x1b1f16,_0x3b9718['options']);return db[_0xf854('0x27')][_0xf854('0x44')](_0x1b1f16)[_0xf854('0x22')](handleEntityNotFound(_0x598ed8,null))[_0xf854('0x22')](respondWithResult(_0x598ed8,null))[_0xf854('0x45')](handleError(_0x598ed8,null));};exports['create']=function(_0x5d58b1,_0x54cc44){return db[_0xf854('0x27')][_0xf854('0x46')](_0x5d58b1[_0xf854('0x47')],{})[_0xf854('0x22')](respondWithResult(_0x54cc44,0xc9))['catch'](handleError(_0x54cc44,null));};exports[_0xf854('0x21')]=function(_0x253e25,_0x202bfd){if(_0x253e25[_0xf854('0x47')]['id']){delete _0x253e25[_0xf854('0x47')]['id'];}return db[_0xf854('0x27')][_0xf854('0x44')]({'where':{'id':_0x253e25['params']['id']}})[_0xf854('0x22')](handleEntityNotFound(_0x202bfd,null))[_0xf854('0x22')](saveUpdates(_0x253e25[_0xf854('0x47')],null))['then'](respondWithResult(_0x202bfd,null))[_0xf854('0x45')](handleError(_0x202bfd,null));};exports[_0xf854('0x48')]=function(_0x14be76,_0x4e43a1){return db[_0xf854('0x27')][_0xf854('0x44')]({'where':{'id':_0x14be76[_0xf854('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e43a1,null))[_0xf854('0x22')](removeEntity(_0x4e43a1,null))[_0xf854('0x45')](handleError(_0x4e43a1,null));};exports[_0xf854('0x49')]=function(_0x67fb89,_0x4d6b5b){return db[_0xf854('0x27')][_0xf854('0x49')]()[_0xf854('0x22')](respondWithResult(_0x4d6b5b,null))[_0xf854('0x45')](handleError(_0x4d6b5b,null));};exports[_0xf854('0x4a')]=function(_0x4ec918,_0x3c9358,_0x31d298){var _0x597b79={'raw':!![],'where':{}};var _0x214531={};var _0x457904={'count':0x0,'rows':[]};return db[_0xf854('0x27')][_0xf854('0x4b')]({'where':{'id':_0x4ec918[_0xf854('0x41')]['id']}})[_0xf854('0x22')](handleEntityNotFound(_0x3c9358,null))['then'](function(_0x1c8d9a){if(_0x1c8d9a){_0x214531['model']=_[_0xf854('0x43')](db['JscriptyQuestionReport'][_0xf854('0x42')]);_0x214531[_0xf854('0x2c')]=_['keys'](_0x4ec918[_0xf854('0x2c')]);_0x214531[_0xf854('0x2d')]=_[_0xf854('0x2e')](_0x214531[_0xf854('0x32')],_0x214531[_0xf854('0x2c')]);_0x597b79[_0xf854('0x30')]=_[_0xf854('0x2e')](_0x214531[_0xf854('0x32')],qs['fields'](_0x4ec918['query'][_0xf854('0x2f')]));_0x597b79[_0xf854('0x30')]=_0x597b79[_0xf854('0x30')][_0xf854('0x31')]?_0x597b79[_0xf854('0x30')]:_0x214531[_0xf854('0x32')];if(!_0x4ec918[_0xf854('0x2c')]['hasOwnProperty'](_0xf854('0x34'))){_0x597b79[_0xf854('0x1c')]=qs[_0xf854('0x1c')](_0x4ec918[_0xf854('0x2c')][_0xf854('0x1c')]);_0x597b79['offset']=qs[_0xf854('0x1b')](_0x4ec918[_0xf854('0x2c')]['offset']);}_0x597b79[_0xf854('0x35')]=qs[_0xf854('0x4c')](_0x4ec918['query']['sort']);_0x597b79[_0xf854('0x36')]=qs['filters'](_[_0xf854('0x37')](_0x4ec918[_0xf854('0x2c')],_0x214531['filters']));_0x597b79[_0xf854('0x36')][_0xf854('0x4d')]=_0x1c8d9a['id'];if(_0x4ec918['query'][_0xf854('0x38')]){_0x597b79[_0xf854('0x36')]=_['merge'](_0x597b79[_0xf854('0x36')],{'$or':_[_0xf854('0x2b')](_0x597b79[_0xf854('0x30')],function(_0x2610c2){var _0x99403c={};_0x99403c[_0x2610c2]={'$like':'%'+_0x4ec918[_0xf854('0x2c')][_0xf854('0x38')]+'%'};return _0x99403c;})});}_0x597b79=_[_0xf854('0x39')]({},_0x597b79,_0x4ec918[_0xf854('0x3b')]);return db[_0xf854('0x4e')][_0xf854('0x1e')]({'where':_0x597b79['where']})['then'](function(_0x2305d6){_0x457904[_0xf854('0x1e')]=_0x2305d6;if(_0x4ec918['query'][_0xf854('0x3c')]){_0x597b79[_0xf854('0x3d')]=[{'all':!![]}];}return db[_0xf854('0x4e')]['findAll'](_0x597b79);})[_0xf854('0x22')](function(_0x5a868e){_0x457904['rows']=_0x5a868e;return _0x457904;});}})[_0xf854('0x22')](respondWithFilteredResult(_0x3c9358,_0x597b79))['catch'](handleError(_0x3c9358,null));}; \ No newline at end of file +var _0x1e91=['send','index','map','JscriptySessionReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','stack','name'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0x1e91,0x168));var _0x11e9=function(_0x2b5587,_0x2de0c0){_0x2b5587=_0x2b5587-0x0;var _0x317e3a=_0x1e91[_0x2b5587];return _0x317e3a;};'use strict';var emlformat=require(_0x11e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11e9('0x1'));var jsonpatch=require(_0x11e9('0x2'));var rp=require(_0x11e9('0x3'));var moment=require(_0x11e9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x11e9('0x5'));var path=require(_0x11e9('0x6'));var sox=require(_0x11e9('0x7'));var csv=require(_0x11e9('0x8'));var ejs=require(_0x11e9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11e9('0xa'));var squel=require(_0x11e9('0xb'));var crypto=require('crypto');var jsforce=require(_0x11e9('0xc'));var deskjs=require(_0x11e9('0xd'));var toCsv=require(_0x11e9('0x8'));var querystring=require(_0x11e9('0xe'));var Papa=require(_0x11e9('0xf'));var Redis=require(_0x11e9('0x10'));var authService=require(_0x11e9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x11e9('0x12'));var hardwareService=require(_0x11e9('0x13'));var logger=require(_0x11e9('0x14'))(_0x11e9('0x15'));var utils=require(_0x11e9('0x16'));var config=require(_0x11e9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x11e9('0x18'))['db'];function respondWithStatusCode(_0x5ac226,_0x1aea3e){_0x1aea3e=_0x1aea3e||0xcc;return function(_0x1ef1ce){if(_0x1ef1ce){return _0x5ac226[_0x11e9('0x19')](_0x1aea3e);}return _0x5ac226[_0x11e9('0x1a')](_0x1aea3e)[_0x11e9('0x1b')]();};}function respondWithResult(_0x400078,_0x2a829b){_0x2a829b=_0x2a829b||0xc8;return function(_0x1d931a){if(_0x1d931a){return _0x400078[_0x11e9('0x1a')](_0x2a829b)[_0x11e9('0x1c')](_0x1d931a);}};}function respondWithFilteredResult(_0x11fec0,_0x5e9757){return function(_0x38f5d1){if(_0x38f5d1){var _0x5a8cbd=typeof _0x5e9757[_0x11e9('0x1d')]==='undefined'&&typeof _0x5e9757['limit']===_0x11e9('0x1e');var _0x2c01db=_0x38f5d1['count'];var _0x412e68=_0x5a8cbd?0x0:_0x5e9757[_0x11e9('0x1d')];var _0x3d92df=_0x5a8cbd?_0x38f5d1['count']:_0x5e9757[_0x11e9('0x1d')]+_0x5e9757[_0x11e9('0x1f')];var _0xe89191;if(_0x3d92df>=_0x2c01db){_0x3d92df=_0x2c01db;_0xe89191=0xc8;}else{_0xe89191=0xce;}_0x11fec0['status'](_0xe89191);return _0x11fec0[_0x11e9('0x20')](_0x11e9('0x21'),_0x412e68+'-'+_0x3d92df+'/'+_0x2c01db)[_0x11e9('0x1c')](_0x38f5d1);}return null;};}function patchUpdates(_0xdcf407){return function(_0x572e9f){try{jsonpatch['apply'](_0x572e9f,_0xdcf407,!![]);}catch(_0x483f8e){return BPromise['reject'](_0x483f8e);}return _0x572e9f['save']();};}function saveUpdates(_0x112479,_0x1ea50f){return function(_0x141322){if(_0x141322){return _0x141322[_0x11e9('0x22')](_0x112479)[_0x11e9('0x23')](function(_0x4e3a71){return _0x4e3a71;});}return null;};}function removeEntity(_0x4f5ae1,_0x2cd44b){return function(_0xf13fa7){if(_0xf13fa7){return _0xf13fa7[_0x11e9('0x24')]()[_0x11e9('0x23')](function(){_0x4f5ae1[_0x11e9('0x1a')](0xcc)[_0x11e9('0x1b')]();});}};}function handleEntityNotFound(_0x167e02,_0x15d1ed){return function(_0xf75817){if(!_0xf75817){_0x167e02[_0x11e9('0x19')](0x194);}return _0xf75817;};}function handleError(_0x410c27,_0x532b08){_0x532b08=_0x532b08||0x1f4;return function(_0x2bc9c9){logger[_0x11e9('0x25')](_0x2bc9c9[_0x11e9('0x26')]);if(_0x2bc9c9[_0x11e9('0x27')]){delete _0x2bc9c9[_0x11e9('0x27')];}_0x410c27[_0x11e9('0x1a')](_0x532b08)[_0x11e9('0x28')](_0x2bc9c9);};}exports[_0x11e9('0x29')]=function(_0x3ffa2d,_0x462366){var _0x3e8c02={},_0x586422={},_0xf293cc={'count':0x0,'rows':[]};var _0x2f02bb=_[_0x11e9('0x2a')](db[_0x11e9('0x2b')]['rawAttributes'],function(_0x245bb7){return{'name':_0x245bb7[_0x11e9('0x2c')],'type':_0x245bb7[_0x11e9('0x2d')]['key']};});_0x586422[_0x11e9('0x2e')]=_['map'](_0x2f02bb,_0x11e9('0x27'));_0x586422[_0x11e9('0x2f')]=_[_0x11e9('0x30')](_0x3ffa2d[_0x11e9('0x2f')]);_0x586422[_0x11e9('0x31')]=_[_0x11e9('0x32')](_0x586422[_0x11e9('0x2e')],_0x586422[_0x11e9('0x2f')]);_0x3e8c02[_0x11e9('0x33')]=_[_0x11e9('0x32')](_0x586422[_0x11e9('0x2e')],qs['fields'](_0x3ffa2d[_0x11e9('0x2f')][_0x11e9('0x34')]));_0x3e8c02[_0x11e9('0x33')]=_0x3e8c02[_0x11e9('0x33')]['length']?_0x3e8c02[_0x11e9('0x33')]:_0x586422[_0x11e9('0x2e')];if(!_0x3ffa2d['query'][_0x11e9('0x35')](_0x11e9('0x36'))){_0x3e8c02[_0x11e9('0x1f')]=qs[_0x11e9('0x1f')](_0x3ffa2d[_0x11e9('0x2f')][_0x11e9('0x1f')]);_0x3e8c02[_0x11e9('0x1d')]=qs['offset'](_0x3ffa2d[_0x11e9('0x2f')]['offset']);}_0x3e8c02[_0x11e9('0x37')]=qs[_0x11e9('0x38')](_0x3ffa2d[_0x11e9('0x2f')][_0x11e9('0x38')]);_0x3e8c02[_0x11e9('0x39')]=qs[_0x11e9('0x31')](_[_0x11e9('0x3a')](_0x3ffa2d[_0x11e9('0x2f')],_0x586422[_0x11e9('0x31')]),_0x2f02bb);if(_0x3ffa2d[_0x11e9('0x2f')]['filter']){_0x3e8c02[_0x11e9('0x39')]=_[_0x11e9('0x3b')](_0x3e8c02['where'],{'$or':_[_0x11e9('0x2a')](_0x2f02bb,function(_0x4dfa5e){if(_0x4dfa5e[_0x11e9('0x2d')]!=='VIRTUAL'){var _0x5321bd={};_0x5321bd[_0x4dfa5e[_0x11e9('0x27')]]={'$like':'%'+_0x3ffa2d['query'][_0x11e9('0x3c')]+'%'};return _0x5321bd;}})});}_0x3e8c02=_[_0x11e9('0x3b')]({},_0x3e8c02,_0x3ffa2d[_0x11e9('0x3d')]);var _0x916d52={'where':_0x3e8c02[_0x11e9('0x39')]};return db[_0x11e9('0x2b')][_0x11e9('0x3e')](_0x916d52)[_0x11e9('0x23')](function(_0x17bc75){_0xf293cc['count']=_0x17bc75;if(_0x3ffa2d[_0x11e9('0x2f')][_0x11e9('0x3f')]){_0x3e8c02[_0x11e9('0x40')]=[{'all':!![]}];}return db[_0x11e9('0x2b')][_0x11e9('0x41')](_0x3e8c02);})[_0x11e9('0x23')](function(_0x54af87){_0xf293cc[_0x11e9('0x42')]=_0x54af87;return _0xf293cc;})['then'](respondWithFilteredResult(_0x462366,_0x3e8c02))[_0x11e9('0x43')](handleError(_0x462366,null));};exports[_0x11e9('0x44')]=function(_0x368956,_0x3be318){var _0x3dc712={'raw':!![],'where':{'id':_0x368956[_0x11e9('0x45')]['id']}},_0x51a9a9={};_0x51a9a9['model']=_['keys'](db[_0x11e9('0x2b')]['rawAttributes']);_0x51a9a9[_0x11e9('0x2f')]=_['keys'](_0x368956['query']);_0x51a9a9[_0x11e9('0x31')]=_['intersection'](_0x51a9a9[_0x11e9('0x2e')],_0x51a9a9[_0x11e9('0x2f')]);_0x3dc712[_0x11e9('0x33')]=_[_0x11e9('0x32')](_0x51a9a9[_0x11e9('0x2e')],qs[_0x11e9('0x34')](_0x368956[_0x11e9('0x2f')]['fields']));_0x3dc712['attributes']=_0x3dc712[_0x11e9('0x33')][_0x11e9('0x46')]?_0x3dc712[_0x11e9('0x33')]:_0x51a9a9['model'];if(_0x368956[_0x11e9('0x2f')]['includeAll']){_0x3dc712[_0x11e9('0x40')]=[{'all':!![]}];}_0x3dc712=_[_0x11e9('0x3b')]({},_0x3dc712,_0x368956['options']);return db[_0x11e9('0x2b')][_0x11e9('0x47')](_0x3dc712)[_0x11e9('0x23')](handleEntityNotFound(_0x3be318,null))[_0x11e9('0x23')](respondWithResult(_0x3be318,null))[_0x11e9('0x43')](handleError(_0x3be318,null));};exports[_0x11e9('0x48')]=function(_0x1144ea,_0x55e0b8){return db[_0x11e9('0x2b')]['create'](_0x1144ea['body'],{})['then'](respondWithResult(_0x55e0b8,0xc9))[_0x11e9('0x43')](handleError(_0x55e0b8,null));};exports['update']=function(_0x35e3aa,_0x2c1e89){if(_0x35e3aa[_0x11e9('0x49')]['id']){delete _0x35e3aa[_0x11e9('0x49')]['id'];}return db[_0x11e9('0x2b')][_0x11e9('0x47')]({'where':{'id':_0x35e3aa[_0x11e9('0x45')]['id']}})[_0x11e9('0x23')](handleEntityNotFound(_0x2c1e89,null))[_0x11e9('0x23')](saveUpdates(_0x35e3aa['body'],null))[_0x11e9('0x23')](respondWithResult(_0x2c1e89,null))[_0x11e9('0x43')](handleError(_0x2c1e89,null));};exports[_0x11e9('0x24')]=function(_0x20c3ac,_0x33b7be){return db['JscriptySessionReport'][_0x11e9('0x47')]({'where':{'id':_0x20c3ac[_0x11e9('0x45')]['id']}})[_0x11e9('0x23')](handleEntityNotFound(_0x33b7be,null))[_0x11e9('0x23')](removeEntity(_0x33b7be,null))[_0x11e9('0x43')](handleError(_0x33b7be,null));};exports[_0x11e9('0x4a')]=function(_0x1feb6e,_0x16e6e2){return db[_0x11e9('0x2b')][_0x11e9('0x4a')]()[_0x11e9('0x23')](respondWithResult(_0x16e6e2,null))['catch'](handleError(_0x16e6e2,null));};exports[_0x11e9('0x4b')]=function(_0xf1461a,_0x434155,_0x44392f){var _0xbec6c2={'raw':!![],'where':{}};var _0x2ae6e4={};var _0x5cc014={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x11e9('0x4c')]({'where':{'id':_0xf1461a[_0x11e9('0x45')]['id']}})[_0x11e9('0x23')](handleEntityNotFound(_0x434155,null))[_0x11e9('0x23')](function(_0x533daa){if(_0x533daa){_0x2ae6e4[_0x11e9('0x2e')]=_['keys'](db[_0x11e9('0x4d')][_0x11e9('0x4e')]);_0x2ae6e4[_0x11e9('0x2f')]=_[_0x11e9('0x30')](_0xf1461a[_0x11e9('0x2f')]);_0x2ae6e4[_0x11e9('0x31')]=_['intersection'](_0x2ae6e4[_0x11e9('0x2e')],_0x2ae6e4[_0x11e9('0x2f')]);_0xbec6c2[_0x11e9('0x33')]=_[_0x11e9('0x32')](_0x2ae6e4[_0x11e9('0x2e')],qs[_0x11e9('0x34')](_0xf1461a['query'][_0x11e9('0x34')]));_0xbec6c2[_0x11e9('0x33')]=_0xbec6c2['attributes']['length']?_0xbec6c2['attributes']:_0x2ae6e4[_0x11e9('0x2e')];if(!_0xf1461a[_0x11e9('0x2f')]['hasOwnProperty'](_0x11e9('0x36'))){_0xbec6c2[_0x11e9('0x1f')]=qs[_0x11e9('0x1f')](_0xf1461a[_0x11e9('0x2f')][_0x11e9('0x1f')]);_0xbec6c2[_0x11e9('0x1d')]=qs[_0x11e9('0x1d')](_0xf1461a[_0x11e9('0x2f')][_0x11e9('0x1d')]);}_0xbec6c2[_0x11e9('0x37')]=qs[_0x11e9('0x38')](_0xf1461a[_0x11e9('0x2f')][_0x11e9('0x38')]);_0xbec6c2[_0x11e9('0x39')]=qs['filters'](_['pick'](_0xf1461a[_0x11e9('0x2f')],_0x2ae6e4[_0x11e9('0x31')]));_0xbec6c2['where'][_0x11e9('0x4f')]=_0x533daa['id'];if(_0xf1461a['query'][_0x11e9('0x3c')]){_0xbec6c2[_0x11e9('0x39')]=_['merge'](_0xbec6c2[_0x11e9('0x39')],{'$or':_[_0x11e9('0x2a')](_0xbec6c2['attributes'],function(_0x3c480a){var _0x58f4a5={};_0x58f4a5[_0x3c480a]={'$like':'%'+_0xf1461a[_0x11e9('0x2f')]['filter']+'%'};return _0x58f4a5;})});}_0xbec6c2=_[_0x11e9('0x3b')]({},_0xbec6c2,_0xf1461a[_0x11e9('0x3d')]);return db[_0x11e9('0x4d')][_0x11e9('0x3e')]({'where':_0xbec6c2['where']})[_0x11e9('0x23')](function(_0x579776){_0x5cc014[_0x11e9('0x3e')]=_0x579776;if(_0xf1461a['query'][_0x11e9('0x3f')]){_0xbec6c2[_0x11e9('0x40')]=[{'all':!![]}];}return db[_0x11e9('0x4d')][_0x11e9('0x41')](_0xbec6c2);})['then'](function(_0x4d5297){_0x5cc014['rows']=_0x4d5297;return _0x5cc014;});}})[_0x11e9('0x23')](respondWithFilteredResult(_0x434155,_0xbec6c2))[_0x11e9('0x43')](handleError(_0x434155,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d1641b7..155ddaa 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 _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x9a5a,0x194));var _0xa9a5=function(_0x4ed4e0,_0x30a417){_0x4ed4e0=_0x4ed4e0-0x0;var _0x51e02f=_0x9a5a[_0x4ed4e0];return _0x51e02f;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','report_jscripty_sessions','lodash'];(function(_0x233c38,_0x51ad0f){var _0x52e16f=function(_0x404370){while(--_0x404370){_0x233c38['push'](_0x233c38['shift']());}};_0x52e16f(++_0x51ad0f);}(_0xabce,0x103));var _0xeabc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xabce[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xeabc('0x9'),'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 0ca6fe8..a0d4293 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 _0x2d72=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','JscriptySessionReport,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4c196f,_0x5e0b44){var _0x18d45b=function(_0x5d137f){while(--_0x5d137f){_0x4c196f['push'](_0x4c196f['shift']());}};_0x18d45b(++_0x5e0b44);}(_0x2d72,0xa8));var _0x22d7=function(_0x282850,_0x17911d){_0x282850=_0x282850-0x0;var _0x44f7c8=_0x2d72[_0x282850];return _0x44f7c8;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52a3e3,_0x23a731,_0x3791d6){return new BPromise(function(_0x492ca8,_0x3b12cd){return client[_0x22d7('0xe')](_0x52a3e3,_0x3791d6)[_0x22d7('0xf')](function(_0x3c694f){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x23a731,_0x22d7('0x10'));logger[_0x22d7('0x11')](_0x22d7('0x12'),_0x23a731,_0x22d7('0x10'),JSON[_0x22d7('0x13')](_0x3c694f));if(_0x3c694f['error']){if(_0x3c694f['error'][_0x22d7('0x14')]===0x1f4){logger['error'](_0x22d7('0x15'),_0x23a731,_0x3c694f[_0x22d7('0x16')]['message']);return _0x3b12cd(_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);}logger[_0x22d7('0x16')](_0x22d7('0x15'),_0x23a731,_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);return _0x492ca8(_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);}else{logger['info'](_0x22d7('0x15'),_0x23a731,_0x22d7('0x10'));_0x492ca8(_0x3c694f[_0x22d7('0x18')]['message']);}})['catch'](function(_0x52b21c){logger[_0x22d7('0x16')](_0x22d7('0x15'),_0x23a731,_0x52b21c);_0x3b12cd(_0x52b21c);});});} \ No newline at end of file +var _0x781d=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x425344,_0x2ddadc){var _0x5ef751=function(_0x3fb583){while(--_0x3fb583){_0x425344['push'](_0x425344['shift']());}};_0x5ef751(++_0x2ddadc);}(_0x781d,0x14a));var _0xd781=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x781d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 6082c75..2b40e5f 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 _0x040f=['../../config/environment','./license.controller','get','put','isAuthenticated','/download_log_file','downloadLogFile','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5aeed5,_0x4e0f2c){var _0x2b3e99=function(_0x12cef1){while(--_0x12cef1){_0x5aeed5['push'](_0x5aeed5['shift']());}};_0x2b3e99(++_0x4e0f2c);}(_0x040f,0x1ab));var _0xf040=function(_0x4beaca,_0x92d420){_0x4beaca=_0x4beaca-0x0;var _0x2febe4=_0x040f[_0x4beaca];return _0x2febe4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf040('0x0'));var timeout=require(_0xf040('0x1'));var express=require(_0xf040('0x2'));var router=express[_0xf040('0x3')]();var fs_extra=require(_0xf040('0x4'));var auth=require(_0xf040('0x5'));var interaction=require(_0xf040('0x6'));var config=require(_0xf040('0x7'));var controller=require(_0xf040('0x8'));router[_0xf040('0x9')]('/',controller['index']);router[_0xf040('0xa')]('/:id',auth[_0xf040('0xb')](),controller['update']);router['get'](_0xf040('0xc'),auth[_0xf040('0xb')](),controller[_0xf040('0xd')]);module['exports']=router; \ No newline at end of file +var _0xcfcc=['../../components/auth/service','../../config/environment','./license.controller','get','index','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x8cdb08,_0x59062f){var _0xd348c3=function(_0x585252){while(--_0x585252){_0x8cdb08['push'](_0x8cdb08['shift']());}};_0xd348c3(++_0x59062f);}(_0xcfcc,0x1cd));var _0xccfc=function(_0x335397,_0x1286b8){_0x335397=_0x335397-0x0;var _0x27c688=_0xcfcc[_0x335397];return _0x27c688;};'use strict';var multer=require(_0xccfc('0x0'));var util=require(_0xccfc('0x1'));var path=require(_0xccfc('0x2'));var timeout=require(_0xccfc('0x3'));var express=require(_0xccfc('0x4'));var router=express[_0xccfc('0x5')]();var fs_extra=require(_0xccfc('0x6'));var auth=require(_0xccfc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xccfc('0x8'));var controller=require(_0xccfc('0x9'));router[_0xccfc('0xa')]('/',controller[_0xccfc('0xb')]);router['put'](_0xccfc('0xc'),auth['isAuthenticated'](),controller[_0xccfc('0xd')]);router[_0xccfc('0xa')](_0xccfc('0xe'),auth[_0xccfc('0xf')](),controller[_0xccfc('0x10')]);module[_0xccfc('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index a69c043..682ac0a 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 _0xdb75=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdb75,0x153));var _0x5db7=function(_0x51a9f7,_0x589d78){_0x51a9f7=_0x51a9f7-0x0;var _0x533668=_0xdb75[_0x51a9f7];return _0x533668;};'use strict';var Sequelize=require(_0x5db7('0x0'));module[_0x5db7('0x1')]={'license':{'type':Sequelize[_0x5db7('0x2')]},'data1':{'type':Sequelize[_0x5db7('0x3')]},'data2':{'type':Sequelize[_0x5db7('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x5db7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7cff=['TEXT','STRING','INTEGER','exports'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x7cff,0x6f));var _0xf7cf=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x7cff[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require('sequelize');module[_0xf7cf('0x0')]={'license':{'type':Sequelize[_0xf7cf('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xf7cf('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xf7cf('0x3')],'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 73e6bb0..76a09f1 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 _0x9b35=['attributes','fields','length','options','getLicense','catch','update','body','checkLicense','key','downloadLogFile','license-info.log','join','/var','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','send','model','keys','License','rawAttributes','query','filters','intersection'];(function(_0x5e961f,_0x410eac){var _0x157371=function(_0x3b87c6){while(--_0x3b87c6){_0x5e961f['push'](_0x5e961f['shift']());}};_0x157371(++_0x410eac);}(_0x9b35,0x99));var _0x59b3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9b35[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x59b3('0x0'));var rimraf=require(_0x59b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59b3('0x2'));var rp=require(_0x59b3('0x3'));var moment=require(_0x59b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x59b3('0x5'));var util=require(_0x59b3('0x6'));var path=require(_0x59b3('0x7'));var sox=require(_0x59b3('0x8'));var csv=require(_0x59b3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59b3('0xa'));var _=require(_0x59b3('0xb'));var squel=require(_0x59b3('0xc'));var crypto=require(_0x59b3('0xd'));var jsforce=require(_0x59b3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x59b3('0x9'));var querystring=require(_0x59b3('0xf'));var Papa=require(_0x59b3('0x10'));var Redis=require(_0x59b3('0x11'));var authService=require(_0x59b3('0x12'));var qs=require(_0x59b3('0x13'));var as=require(_0x59b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59b3('0x15'))(_0x59b3('0x16'));var utils=require(_0x59b3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x59b3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x203db4,_0x5329a0){_0x5329a0=_0x5329a0||0xcc;return function(_0x347b10){if(_0x347b10){return _0x203db4['sendStatus'](_0x5329a0);}return _0x203db4['status'](_0x5329a0)[_0x59b3('0x19')]();};}function respondWithResult(_0x5f0a21,_0x310fb1){_0x310fb1=_0x310fb1||0xc8;return function(_0x1e6e19){if(_0x1e6e19){return _0x5f0a21[_0x59b3('0x1a')](_0x310fb1)[_0x59b3('0x1b')](_0x1e6e19);}};}function respondWithFilteredResult(_0x2b53d2,_0xef9109){return function(_0x4de455){if(_0x4de455){var _0x3e52dd=typeof _0xef9109[_0x59b3('0x1c')]===_0x59b3('0x1d')&&typeof _0xef9109[_0x59b3('0x1e')]===_0x59b3('0x1d');var _0x49ed32=_0x4de455['count'];var _0x69c05d=_0x3e52dd?0x0:_0xef9109[_0x59b3('0x1c')];var _0x38c05e=_0x3e52dd?_0x4de455[_0x59b3('0x1f')]:_0xef9109[_0x59b3('0x1c')]+_0xef9109[_0x59b3('0x1e')];var _0x5f580d;if(_0x38c05e>=_0x49ed32){_0x38c05e=_0x49ed32;_0x5f580d=0xc8;}else{_0x5f580d=0xce;}_0x2b53d2[_0x59b3('0x1a')](_0x5f580d);return _0x2b53d2[_0x59b3('0x20')](_0x59b3('0x21'),_0x69c05d+'-'+_0x38c05e+'/'+_0x49ed32)[_0x59b3('0x1b')](_0x4de455);}return null;};}function patchUpdates(_0x5c4562){return function(_0x521c61){try{jsonpatch[_0x59b3('0x22')](_0x521c61,_0x5c4562,!![]);}catch(_0x4cca7c){return BPromise[_0x59b3('0x23')](_0x4cca7c);}return _0x521c61['save']();};}function saveUpdates(_0x5f044d,_0xcf50ff){return function(_0xf72a5b){if(_0xf72a5b){return _0xf72a5b['update'](_0x5f044d)[_0x59b3('0x24')](function(_0x39be17){return _0x39be17;});}return null;};}function removeEntity(_0x3691e9,_0x23c21a){return function(_0xcba380){if(_0xcba380){return _0xcba380[_0x59b3('0x25')]()[_0x59b3('0x24')](function(){_0x3691e9[_0x59b3('0x1a')](0xcc)[_0x59b3('0x19')]();});}};}function handleEntityNotFound(_0x2cdd1f,_0x2ad9c6){return function(_0x2f4df8){if(!_0x2f4df8){_0x2cdd1f[_0x59b3('0x26')](0x194);}return _0x2f4df8;};}function handleError(_0x42e2d1,_0x23e57c){_0x23e57c=_0x23e57c||0x1f4;return function(_0x56b419){logger[_0x59b3('0x27')](_0x56b419['stack']);if(_0x56b419['name']){delete _0x56b419['name'];}_0x42e2d1['status'](_0x23e57c)[_0x59b3('0x28')](_0x56b419);};}var utilLicense=require(_0x59b3('0x18'));exports['index']=function(_0x419964,_0xf3dcfd){var _0x56ca6b={'raw':!![],'where':{'id':0x1}},_0x16f525={};_0x16f525[_0x59b3('0x29')]=_[_0x59b3('0x2a')](db[_0x59b3('0x2b')][_0x59b3('0x2c')]);_0x16f525[_0x59b3('0x2d')]=_[_0x59b3('0x2a')](_0x419964[_0x59b3('0x2d')]);_0x16f525[_0x59b3('0x2e')]=_[_0x59b3('0x2f')](_0x16f525[_0x59b3('0x29')],_0x16f525[_0x59b3('0x2d')]);_0x56ca6b[_0x59b3('0x30')]=_[_0x59b3('0x2f')](_0x16f525[_0x59b3('0x29')],qs[_0x59b3('0x31')](_0x419964[_0x59b3('0x2d')][_0x59b3('0x31')]));_0x56ca6b['attributes']=_0x56ca6b['attributes'][_0x59b3('0x32')]?_0x56ca6b[_0x59b3('0x30')]:_0x16f525[_0x59b3('0x29')];_0x56ca6b=_['merge']({},_0x56ca6b,_0x419964[_0x59b3('0x33')]);return utilLicense[_0x59b3('0x34')](_0x56ca6b)['then'](respondWithResult(_0xf3dcfd,null))[_0x59b3('0x35')](handleError(_0xf3dcfd,null));};exports[_0x59b3('0x36')]=function(_0x1132eb,_0x57471f){if(_0x1132eb[_0x59b3('0x37')]['id']){delete _0x1132eb['body']['id'];}return db[_0x59b3('0x2b')]['find']({'where':{'id':_0x1132eb['params']['id']}})[_0x59b3('0x24')](handleEntityNotFound(_0x57471f,null))[_0x59b3('0x24')](function(_0x49111d){var _0x264f3e=_0x49111d['get']({'plain':!![]});return utilLicense[_0x59b3('0x38')](_0x264f3e,_0x1132eb[_0x59b3('0x37')][_0x59b3('0x39')]);})[_0x59b3('0x24')](function(_0x4567ff){if(!_0x4567ff['demo']){return saveUpdates(_0x1132eb['body'],null);}return _0x4567ff;})[_0x59b3('0x24')](respondWithResult(_0x57471f,null))[_0x59b3('0x35')](handleError(_0x57471f,null));};exports[_0x59b3('0x3a')]=function(_0x2a5c17,_0x4a965c){var _0xe68367=_0x59b3('0x3b');var _0x45ec92=path[_0x59b3('0x3c')](_0x59b3('0x3d'),'log','xcally',_0xe68367);_0x4a965c[_0x59b3('0x3e')]('Content-disposition',_0x59b3('0x3f')+_0xe68367);_0x4a965c[_0x59b3('0x20')](_0x59b3('0x40'),_0x59b3('0x41'));_0x4a965c[_0x59b3('0x42')](_0x45ec92);}; \ No newline at end of file +var _0x564a=['model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','key','license-info.log','join','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','name','index'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x564a,0x1b0));var _0xa564=function(_0x181631,_0x26f8e0){_0x181631=_0x181631-0x0;var _0x4f2077=_0x564a[_0x181631];return _0x4f2077;};'use strict';var emlformat=require(_0xa564('0x0'));var rimraf=require(_0xa564('0x1'));var zipdir=require(_0xa564('0x2'));var jsonpatch=require(_0xa564('0x3'));var rp=require('request-promise');var moment=require(_0xa564('0x4'));var BPromise=require(_0xa564('0x5'));var Mustache=require('mustache');var util=require(_0xa564('0x6'));var path=require(_0xa564('0x7'));var sox=require(_0xa564('0x8'));var csv=require(_0xa564('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa564('0xa'));var _=require('lodash');var squel=require(_0xa564('0xb'));var crypto=require(_0xa564('0xc'));var jsforce=require(_0xa564('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa564('0x9'));var querystring=require('querystring');var Papa=require(_0xa564('0xe'));var Redis=require(_0xa564('0xf'));var authService=require(_0xa564('0x10'));var qs=require(_0xa564('0x11'));var as=require(_0xa564('0x12'));var hardwareService=require(_0xa564('0x13'));var logger=require(_0xa564('0x14'))(_0xa564('0x15'));var utils=require(_0xa564('0x16'));var config=require(_0xa564('0x17'));var licenseUtil=require(_0xa564('0x18'));var db=require(_0xa564('0x19'))['db'];function respondWithStatusCode(_0x457942,_0x484bb9){_0x484bb9=_0x484bb9||0xcc;return function(_0x25d687){if(_0x25d687){return _0x457942[_0xa564('0x1a')](_0x484bb9);}return _0x457942[_0xa564('0x1b')](_0x484bb9)[_0xa564('0x1c')]();};}function respondWithResult(_0x4bc76e,_0x4eb579){_0x4eb579=_0x4eb579||0xc8;return function(_0x53a718){if(_0x53a718){return _0x4bc76e['status'](_0x4eb579)[_0xa564('0x1d')](_0x53a718);}};}function respondWithFilteredResult(_0x150e12,_0x10c68c){return function(_0x3487fa){if(_0x3487fa){var _0x294698=typeof _0x10c68c[_0xa564('0x1e')]===_0xa564('0x1f')&&typeof _0x10c68c['limit']==='undefined';var _0x451645=_0x3487fa['count'];var _0x574f6=_0x294698?0x0:_0x10c68c['offset'];var _0x1dfac4=_0x294698?_0x3487fa[_0xa564('0x20')]:_0x10c68c[_0xa564('0x1e')]+_0x10c68c[_0xa564('0x21')];var _0x41e716;if(_0x1dfac4>=_0x451645){_0x1dfac4=_0x451645;_0x41e716=0xc8;}else{_0x41e716=0xce;}_0x150e12['status'](_0x41e716);return _0x150e12[_0xa564('0x22')]('Content-Range',_0x574f6+'-'+_0x1dfac4+'/'+_0x451645)[_0xa564('0x1d')](_0x3487fa);}return null;};}function patchUpdates(_0x2bb245){return function(_0x3c4943){try{jsonpatch[_0xa564('0x23')](_0x3c4943,_0x2bb245,!![]);}catch(_0x132822){return BPromise[_0xa564('0x24')](_0x132822);}return _0x3c4943[_0xa564('0x25')]();};}function saveUpdates(_0x306976,_0x38743a){return function(_0x16e253){if(_0x16e253){return _0x16e253[_0xa564('0x26')](_0x306976)[_0xa564('0x27')](function(_0x13a8da){return _0x13a8da;});}return null;};}function removeEntity(_0x4dc1ab,_0xa98af1){return function(_0x1b2d62){if(_0x1b2d62){return _0x1b2d62[_0xa564('0x28')]()['then'](function(){_0x4dc1ab[_0xa564('0x1b')](0xcc)[_0xa564('0x1c')]();});}};}function handleEntityNotFound(_0x23fd63,_0x24f93d){return function(_0x2b8ad0){if(!_0x2b8ad0){_0x23fd63[_0xa564('0x1a')](0x194);}return _0x2b8ad0;};}function handleError(_0x3e3f07,_0x1ef1fa){_0x1ef1fa=_0x1ef1fa||0x1f4;return function(_0x35a4a1){logger[_0xa564('0x29')](_0x35a4a1['stack']);if(_0x35a4a1[_0xa564('0x2a')]){delete _0x35a4a1[_0xa564('0x2a')];}_0x3e3f07['status'](_0x1ef1fa)['send'](_0x35a4a1);};}var utilLicense=require(_0xa564('0x18'));exports[_0xa564('0x2b')]=function(_0x59785d,_0x1f24ad){var _0xd4c934={'raw':!![],'where':{'id':0x1}},_0x316ec0={};_0x316ec0[_0xa564('0x2c')]=_[_0xa564('0x2d')](db[_0xa564('0x2e')][_0xa564('0x2f')]);_0x316ec0['query']=_[_0xa564('0x2d')](_0x59785d[_0xa564('0x30')]);_0x316ec0['filters']=_[_0xa564('0x31')](_0x316ec0['model'],_0x316ec0[_0xa564('0x30')]);_0xd4c934[_0xa564('0x32')]=_[_0xa564('0x31')](_0x316ec0[_0xa564('0x2c')],qs['fields'](_0x59785d[_0xa564('0x30')][_0xa564('0x33')]));_0xd4c934[_0xa564('0x32')]=_0xd4c934[_0xa564('0x32')][_0xa564('0x34')]?_0xd4c934[_0xa564('0x32')]:_0x316ec0[_0xa564('0x2c')];_0xd4c934=_[_0xa564('0x35')]({},_0xd4c934,_0x59785d[_0xa564('0x36')]);return utilLicense[_0xa564('0x37')](_0xd4c934)['then'](respondWithResult(_0x1f24ad,null))[_0xa564('0x38')](handleError(_0x1f24ad,null));};exports[_0xa564('0x26')]=function(_0x595cdf,_0xc74518){if(_0x595cdf[_0xa564('0x39')]['id']){delete _0x595cdf['body']['id'];}return db[_0xa564('0x2e')][_0xa564('0x3a')]({'where':{'id':_0x595cdf[_0xa564('0x3b')]['id']}})[_0xa564('0x27')](handleEntityNotFound(_0xc74518,null))[_0xa564('0x27')](function(_0x5bf656){var _0xeff5fe=_0x5bf656['get']({'plain':!![]});return utilLicense['checkLicense'](_0xeff5fe,_0x595cdf[_0xa564('0x39')][_0xa564('0x3c')]);})['then'](function(_0x33e8f4){if(!_0x33e8f4['demo']){return saveUpdates(_0x595cdf[_0xa564('0x39')],null);}return _0x33e8f4;})[_0xa564('0x27')](respondWithResult(_0xc74518,null))[_0xa564('0x38')](handleError(_0xc74518,null));};exports['downloadLogFile']=function(_0x188691,_0x2c334b){var _0x56b2c3=_0xa564('0x3d');var _0x134871=path[_0xa564('0x3e')]('/var','log','xcally',_0x56b2c3);_0x2c334b[_0xa564('0x3f')](_0xa564('0x40'),_0xa564('0x41')+_0x56b2c3);_0x2c334b['set'](_0xa564('0x42'),_0xa564('0x43'));_0x2c334b['download'](_0x134871);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 3d669ba..ff16fcd 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 _0x4863=['moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define','lodash','util','api'];(function(_0x37b5e9,_0x3179eb){var _0x5115c1=function(_0x316a3a){while(--_0x316a3a){_0x37b5e9['push'](_0x37b5e9['shift']());}};_0x5115c1(++_0x3179eb);}(_0x4863,0xb8));var _0x3486=function(_0x5cc242,_0xad95f6){_0x5cc242=_0x5cc242-0x0;var _0x47ca87=_0x4863[_0x5cc242];return _0x47ca87;};'use strict';var _=require(_0x3486('0x0'));var util=require(_0x3486('0x1'));var logger=require('../../config/logger')(_0x3486('0x2'));var moment=require(_0x3486('0x3'));var BPromise=require(_0x3486('0x4'));var rp=require(_0x3486('0x5'));var fs=require('fs');var path=require(_0x3486('0x6'));var rimraf=require('rimraf');var config=require(_0x3486('0x7'));var attributes=require(_0x3486('0x8'));module[_0x3486('0x9')]=function(_0x1ab194,_0x59f7f3){return _0x1ab194[_0x3486('0xa')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x250e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./license.attributes','exports','define','License','license','lodash'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0x250e,0x1e9));var _0xe250=function(_0x37331f,_0x29399e){_0x37331f=_0x37331f-0x0;var _0x54e379=_0x250e[_0x37331f];return _0x54e379;};'use strict';var _=require(_0xe250('0x0'));var util=require(_0xe250('0x1'));var logger=require(_0xe250('0x2'))(_0xe250('0x3'));var moment=require(_0xe250('0x4'));var BPromise=require(_0xe250('0x5'));var rp=require(_0xe250('0x6'));var fs=require('fs');var path=require(_0xe250('0x7'));var rimraf=require(_0xe250('0x8'));var config=require('../../config/environment');var attributes=require(_0xe250('0x9'));module[_0xe250('0xa')]=function(_0x1ef28c,_0x3da29e){return _0x1ef28c[_0xe250('0xb')](_0xe250('0xc'),attributes,{'tableName':_0xe250('0xd'),'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 30f70b3..5f133b4 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 _0x3ab1=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x3ab1,0xdc));var _0x13ab=function(_0xf285bc,_0x42ba34){_0xf285bc=_0xf285bc-0x0;var _0x1f54b1=_0x3ab1[_0xf285bc];return _0x1f54b1;};'use strict';var _=require('lodash');var util=require(_0x13ab('0x0'));var moment=require(_0x13ab('0x1'));var BPromise=require(_0x13ab('0x2'));var rs=require(_0x13ab('0x3'));var fs=require('fs');var Redis=require(_0x13ab('0x4'));var db=require(_0x13ab('0x5'))['db'];var utils=require(_0x13ab('0x6'));var logger=require(_0x13ab('0x7'))(_0x13ab('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x13ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a0e88,_0xc065df,_0x501ebd){return new BPromise(function(_0x149ff6,_0x386b28){return client[_0x13ab('0xa')](_0x4a0e88,_0x501ebd)[_0x13ab('0xb')](function(_0x258127){logger[_0x13ab('0xc')](_0x13ab('0xd'),_0xc065df,_0x13ab('0xe'));logger[_0x13ab('0xf')](_0x13ab('0x10'),_0xc065df,_0x13ab('0xe'),JSON[_0x13ab('0x11')](_0x258127));if(_0x258127[_0x13ab('0x12')]){if(_0x258127[_0x13ab('0x12')][_0x13ab('0x13')]===0x1f4){logger[_0x13ab('0x12')]('License,\x20%s,\x20%s',_0xc065df,_0x258127[_0x13ab('0x12')][_0x13ab('0x14')]);return _0x386b28(_0x258127[_0x13ab('0x12')][_0x13ab('0x14')]);}logger[_0x13ab('0x12')]('License,\x20%s,\x20%s',_0xc065df,_0x258127['error'][_0x13ab('0x14')]);return _0x149ff6(_0x258127[_0x13ab('0x12')][_0x13ab('0x14')]);}else{logger['info'](_0x13ab('0xd'),_0xc065df,_0x13ab('0xe'));_0x149ff6(_0x258127[_0x13ab('0x15')][_0x13ab('0x14')]);}})[_0x13ab('0x16')](function(_0x35770f){logger[_0x13ab('0x12')](_0x13ab('0xd'),_0xc065df,_0x35770f);_0x386b28(_0x35770f);});});} \ No newline at end of file +var _0x361a=['jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x25160e,_0x4b8e52){var _0x54b20d=function(_0x219192){while(--_0x219192){_0x25160e['push'](_0x25160e['shift']());}};_0x54b20d(++_0x4b8e52);}(_0x361a,0x1ad));var _0xa361=function(_0x268d22,_0x25b765){_0x268d22=_0x268d22-0x0;var _0x4db9ec=_0x361a[_0x268d22];return _0x4db9ec;};'use strict';var _=require(_0xa361('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa361('0x1'));var rs=require(_0xa361('0x2'));var fs=require('fs');var Redis=require(_0xa361('0x3'));var db=require(_0xa361('0x4'))['db'];var utils=require(_0xa361('0x5'));var logger=require(_0xa361('0x6'))(_0xa361('0x7'));var config=require('../../config/environment');var jayson=require(_0xa361('0x8'));var client=jayson['client'][_0xa361('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2271e4,_0x22e06f,_0x4e61d5){return new BPromise(function(_0x4eefc3,_0x2642cb){return client[_0xa361('0xa')](_0x2271e4,_0x4e61d5)[_0xa361('0xb')](function(_0x8e39c9){logger[_0xa361('0xc')](_0xa361('0xd'),_0x22e06f,'request\x20sent');logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x22e06f,_0xa361('0xe'),JSON[_0xa361('0xf')](_0x8e39c9));if(_0x8e39c9[_0xa361('0x10')]){if(_0x8e39c9[_0xa361('0x10')]['code']===0x1f4){logger['error'](_0xa361('0xd'),_0x22e06f,_0x8e39c9[_0xa361('0x10')][_0xa361('0x11')]);return _0x2642cb(_0x8e39c9[_0xa361('0x10')][_0xa361('0x11')]);}logger[_0xa361('0x10')]('License,\x20%s,\x20%s',_0x22e06f,_0x8e39c9[_0xa361('0x10')][_0xa361('0x11')]);return _0x4eefc3(_0x8e39c9[_0xa361('0x10')][_0xa361('0x11')]);}else{logger[_0xa361('0xc')](_0xa361('0xd'),_0x22e06f,'request\x20sent');_0x4eefc3(_0x8e39c9['result']['message']);}})[_0xa361('0x12')](function(_0x169ac1){logger[_0xa361('0x10')](_0xa361('0xd'),_0x22e06f,_0x169ac1);_0x2642cb(_0x169ac1);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 1e6c3b1..3ecceab 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 _0x828c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/verify','/:id/users','post','/:id/dispositions','addDisposition','create','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','path','connect-timeout','express','Router'];(function(_0x4cf9b0,_0x6b6dae){var _0x111d04=function(_0x2d58ed){while(--_0x2d58ed){_0x4cf9b0['push'](_0x4cf9b0['shift']());}};_0x111d04(++_0x6b6dae);}(_0x828c,0x110));var _0xc828=function(_0x24e747,_0x2d5368){_0x24e747=_0x24e747-0x0;var _0x2e2f66=_0x828c[_0x24e747];return _0x2e2f66;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc828('0x0'));var timeout=require(_0xc828('0x1'));var express=require(_0xc828('0x2'));var router=express[_0xc828('0x3')]();var fs_extra=require(_0xc828('0x4'));var auth=require(_0xc828('0x5'));var interaction=require(_0xc828('0x6'));var config=require(_0xc828('0x7'));var controller=require(_0xc828('0x8'));router[_0xc828('0x9')]('/',auth[_0xc828('0xa')](),controller[_0xc828('0xb')]);router[_0xc828('0x9')](_0xc828('0xc'),auth[_0xc828('0xa')](),controller[_0xc828('0xd')]);router[_0xc828('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc828('0xe')]);router[_0xc828('0x9')]('/:id/dispositions',auth[_0xc828('0xa')](),controller[_0xc828('0xf')]);router[_0xc828('0x9')](_0xc828('0x10'),auth[_0xc828('0xa')](),controller[_0xc828('0x11')]);router[_0xc828('0x9')](_0xc828('0x12'),auth[_0xc828('0xa')](),controller[_0xc828('0x13')]);router[_0xc828('0x9')](_0xc828('0x14'),auth['isAuthenticated'](),controller['getSmtp']);router[_0xc828('0x9')](_0xc828('0x15'),auth[_0xc828('0xa')](),controller[_0xc828('0x16')]);router[_0xc828('0x9')](_0xc828('0x17'),auth['isAuthenticated'](),controller[_0xc828('0x18')]);router[_0xc828('0x9')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xc828('0x9')](_0xc828('0x19'),auth[_0xc828('0xa')](),controller['verifySmtp']);router['get'](_0xc828('0x1a'),auth[_0xc828('0xa')](),controller['getAgents']);router[_0xc828('0x1b')](_0xc828('0x1c'),auth['isAuthenticated'](),controller[_0xc828('0x1d')]);router[_0xc828('0x1b')](_0xc828('0x10'),auth[_0xc828('0xa')](),controller['addAnswer']);router[_0xc828('0x1b')]('/',auth[_0xc828('0xa')](),controller[_0xc828('0x1e')]);router[_0xc828('0x1b')]('/:id/in_servers',auth[_0xc828('0xa')](),controller[_0xc828('0x1f')]);router[_0xc828('0x1b')]('/:id/out_servers',auth[_0xc828('0xa')](),controller[_0xc828('0x20')]);router[_0xc828('0x1b')]('/:id/interactions',auth[_0xc828('0xa')](),controller['addInteraction']);router[_0xc828('0x1b')](_0xc828('0x17'),auth['isAuthenticated'](),controller[_0xc828('0x21')]);router[_0xc828('0x1b')](_0xc828('0x22'),auth['isAuthenticated'](),controller[_0xc828('0x23')]);router[_0xc828('0x1b')](_0xc828('0x1a'),auth[_0xc828('0xa')](),controller[_0xc828('0x24')]);router[_0xc828('0x25')](_0xc828('0x26'),auth[_0xc828('0xa')](),controller[_0xc828('0x27')]);router[_0xc828('0x28')](_0xc828('0x1c'),auth[_0xc828('0xa')](),controller[_0xc828('0x29')]);router['delete'](_0xc828('0x10'),auth['isAuthenticated'](),controller[_0xc828('0x2a')]);router['delete'](_0xc828('0x12'),auth[_0xc828('0xa')](),controller[_0xc828('0x2b')]);router[_0xc828('0x28')](_0xc828('0x14'),auth[_0xc828('0xa')](),controller[_0xc828('0x2c')]);router['delete'](_0xc828('0x26'),auth[_0xc828('0xa')](),controller[_0xc828('0x2d')]);router['delete'](_0xc828('0x1a'),auth[_0xc828('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x5ef3=['isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp','/:id/users','getAgents','/:id/dispositions','post','addAnswer','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller'];(function(_0x515e58,_0x489bd5){var _0xb8e84e=function(_0x180236){while(--_0x180236){_0x515e58['push'](_0x515e58['shift']());}};_0xb8e84e(++_0x489bd5);}(_0x5ef3,0x80));var _0x35ef=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x5ef3[_0x486f4a];return _0x135d99;};'use strict';var multer=require(_0x35ef('0x0'));var util=require(_0x35ef('0x1'));var path=require(_0x35ef('0x2'));var timeout=require(_0x35ef('0x3'));var express=require(_0x35ef('0x4'));var router=express['Router']();var fs_extra=require(_0x35ef('0x5'));var auth=require(_0x35ef('0x6'));var interaction=require(_0x35ef('0x7'));var config=require(_0x35ef('0x8'));var controller=require(_0x35ef('0x9'));router['get']('/',auth[_0x35ef('0xa')](),controller[_0x35ef('0xb')]);router[_0x35ef('0xc')](_0x35ef('0xd'),auth[_0x35ef('0xa')](),controller[_0x35ef('0xe')]);router[_0x35ef('0xc')](_0x35ef('0xf'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x10')]);router[_0x35ef('0xc')]('/:id/dispositions',auth[_0x35ef('0xa')](),controller[_0x35ef('0x11')]);router[_0x35ef('0xc')](_0x35ef('0x12'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x13')]);router[_0x35ef('0xc')](_0x35ef('0x14'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x15')]);router['get'](_0x35ef('0x16'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x17')]);router[_0x35ef('0xc')]('/:id/interactions',auth[_0x35ef('0xa')](),controller[_0x35ef('0x18')]);router[_0x35ef('0xc')](_0x35ef('0x19'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x1a')]);router[_0x35ef('0xc')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x35ef('0xc')](_0x35ef('0x1b'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x1c')]);router['get'](_0x35ef('0x1d'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x1e')]);router['post'](_0x35ef('0x1f'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x35ef('0x20')](_0x35ef('0x12'),auth['isAuthenticated'](),controller[_0x35ef('0x21')]);router[_0x35ef('0x20')]('/',auth[_0x35ef('0xa')](),controller['create']);router[_0x35ef('0x20')](_0x35ef('0x14'),auth[_0x35ef('0xa')](),controller['addImap']);router[_0x35ef('0x20')](_0x35ef('0x16'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x35ef('0x20')]('/:id/interactions',auth[_0x35ef('0xa')](),controller['addInteraction']);router[_0x35ef('0x20')](_0x35ef('0x19'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x22')]);router[_0x35ef('0x20')](_0x35ef('0x23'),auth[_0x35ef('0xa')](),controller['send']);router[_0x35ef('0x20')](_0x35ef('0x1d'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x24')]);router[_0x35ef('0x25')](_0x35ef('0xf'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x26')]);router[_0x35ef('0x27')](_0x35ef('0x1f'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x28')]);router[_0x35ef('0x27')](_0x35ef('0x12'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x29')]);router['delete'](_0x35ef('0x14'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x2a')]);router[_0x35ef('0x27')](_0x35ef('0x16'),auth[_0x35ef('0xa')](),controller[_0x35ef('0x2b')]);router[_0x35ef('0x27')](_0x35ef('0xf'),auth[_0x35ef('0xa')](),controller['destroy']);router['delete'](_0x35ef('0x1d'),auth['isAuthenticated'](),controller[_0x35ef('0x2c')]);module[_0x35ef('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 3600c12..8f6cdcb 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 _0x89ff=['mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0x89ff,0x148));var _0xf89f=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0x89ff[_0x52bfa5];return _0x26f80b;};'use strict';var Sequelize=require(_0xf89f('0x0'));module[_0xf89f('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf89f('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xf89f('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf89f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xf89f('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf89f('0x4')]},'markAsUnread':{'type':Sequelize[_0xf89f('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf89f('0x2')],'allowNull':![],'defaultValue':_0xf89f('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xf89f('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf89f('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf89f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf89f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf89f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf89f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf89f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf89f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf89f('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xf89f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf89f('0x3')],'defaultValue':![],'comment':_0xf89f('0xa'),'set':function(_0x2c9a91){if(!_0x2c9a91)this[_0xf89f('0xb')](_0xf89f('0xc'),null);this[_0xf89f('0xb')](_0xf89f('0xd'),_0x2c9a91);}},'provider':{'type':Sequelize['ENUM'](_0xf89f('0xe'),_0xf89f('0xf'),'yahoo',_0xf89f('0x10')),'defaultValue':null,'get':function(){var _0x4ba736=this[_0xf89f('0x11')](_0xf89f('0x12'));return _0x4ba736||_0xf89f('0x13');},'set':function(_0x4de964){if(_0x4de964===_0xf89f('0x13')){_0x4de964=null;}return this[_0xf89f('0xb')](_0xf89f('0x12'),_0x4de964);}}}; \ No newline at end of file +var _0x7553=['ENUM','hotmail','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}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x529222,_0x4a234e){var _0xa47ab0=function(_0x3da9e1){while(--_0x3da9e1){_0x529222['push'](_0x529222['shift']());}};_0xa47ab0(++_0x4a234e);}(_0x7553,0xde));var _0x3755=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x7553[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0x3755('0x0'));module[_0x3755('0x1')]={'description':{'type':Sequelize[_0x3755('0x2')]},'name':{'type':Sequelize[_0x3755('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3755('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x3755('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x3755('0x4')]},'markAsUnread':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3755('0x2')],'allowNull':![],'defaultValue':_0x3755('0x5')},'fontSize':{'type':Sequelize[_0x3755('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3755('0x4')],'defaultValue':function(){return _0x3755('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3755('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3755('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3755('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![],'comment':_0x3755('0x8'),'set':function(_0x1df88c){if(!_0x1df88c)this['setDataValue'](_0x3755('0x9'),null);this[_0x3755('0xa')](_0x3755('0xb'),_0x1df88c);}},'provider':{'type':Sequelize[_0x3755('0xc')]('gmail',_0x3755('0xd'),_0x3755('0xe'),'outlook365'),'defaultValue':null,'get':function(){var _0x432b35=this[_0x3755('0xf')](_0x3755('0x10'));return _0x432b35||_0x3755('0x11');},'set':function(_0x4ad0b1){if(_0x4ad0b1===_0x3755('0x11')){_0x4ad0b1=null;}return this[_0x3755('0xa')](_0x3755('0x10'),_0x4ad0b1);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 76ad854..1c99d65 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 _0x1b17=['out','Interaction','Messages','getSmtpOptions','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','MailAccount,\x20%s,\x20%s','message','result','status','end','json','undefined','limit','count','offset','Content-Range','update','destroy','get','MailAccounts','sendStatus','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','MailAccount','includeAll','findAll','rows','catch','show','params','length','find','body','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','include','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','custom','email','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','fullname','Tag','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','ListId','messageId','attach'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b17,0x199));var _0x71b1=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x1b17[_0x648163];return _0x199d4d;};'use strict';var moment=require(_0x71b1('0x0'));var BPromise=require(_0x71b1('0x1'));var util=require('util');var path=require(_0x71b1('0x2'));var _=require(_0x71b1('0x3'));var juice=require(_0x71b1('0x4'));var Redis=require(_0x71b1('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x71b1('0x6'))(_0x71b1('0x7'));var config=require(_0x71b1('0x8'));var db=require(_0x71b1('0x9'))['db'];config['redis']=_[_0x71b1('0xa')](config[_0x71b1('0xb')],{'host':_0x71b1('0xc'),'port':0x18eb});var socket=require(_0x71b1('0xd'))(new Redis(config[_0x71b1('0xb')]));require('./mailAccount.socket')[_0x71b1('0xe')](socket);var jayson=require(_0x71b1('0xf'));var client=jayson[_0x71b1('0x10')][_0x71b1('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x48a501,_0x391f25,_0x54a28d,_0x505c45){return new BPromise(function(_0x31e76d,_0x580e89){var _0x341a0f=_0x505c45||client;return _0x341a0f['request'](_0x48a501,_0x54a28d)[_0x71b1('0x12')](function(_0x26170d){logger[_0x71b1('0x13')]('MailAccount,\x20%s,\x20%s',_0x391f25,_0x71b1('0x14'));logger[_0x71b1('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x391f25,_0x71b1('0x14'),JSON['stringify'](_0x26170d));if(_0x26170d['error']){if(_0x26170d[_0x71b1('0x16')][_0x71b1('0x17')]===0x1f4){logger['error'](_0x71b1('0x18'),_0x391f25,_0x26170d['error'][_0x71b1('0x19')]);return _0x580e89(_0x26170d[_0x71b1('0x16')][_0x71b1('0x19')]);}logger[_0x71b1('0x16')]('MailAccount,\x20%s,\x20%s',_0x391f25,_0x26170d[_0x71b1('0x16')][_0x71b1('0x19')]);return _0x31e76d(_0x26170d[_0x71b1('0x16')]['message']);}else{logger[_0x71b1('0x13')](_0x71b1('0x18'),_0x391f25,_0x71b1('0x14'));_0x31e76d(_0x26170d[_0x71b1('0x1a')][_0x71b1('0x19')]);}})['catch'](function(_0x156a1f){logger['error']('MailAccount,\x20%s,\x20%s',_0x391f25,_0x156a1f);_0x580e89(_0x156a1f);});});}function respondWithStatusCode(_0x34dce4,_0x56b84f){_0x56b84f=_0x56b84f||0xcc;return function(_0xc1116e){if(_0xc1116e){return _0x34dce4['sendStatus'](_0x56b84f);}return _0x34dce4[_0x71b1('0x1b')](_0x56b84f)[_0x71b1('0x1c')]();};}function respondWithResult(_0x67aa2,_0x4d203c){_0x4d203c=_0x4d203c||0xc8;return function(_0x42df2e){if(_0x42df2e){return _0x67aa2[_0x71b1('0x1b')](_0x4d203c)[_0x71b1('0x1d')](_0x42df2e);}};}function respondWithFilteredResult(_0x5f46b5,_0x2391d9){return function(_0x378552){if(_0x378552){var _0x1ba54f=typeof _0x2391d9['offset']===_0x71b1('0x1e')&&typeof _0x2391d9[_0x71b1('0x1f')]==='undefined';var _0x577b3a=_0x378552[_0x71b1('0x20')];var _0x37f244=_0x1ba54f?0x0:_0x2391d9[_0x71b1('0x21')];var _0x486a6e=_0x1ba54f?_0x378552[_0x71b1('0x20')]:_0x2391d9['offset']+_0x2391d9['limit'];var _0x1417fa;if(_0x486a6e>=_0x577b3a){_0x486a6e=_0x577b3a;_0x1417fa=0xc8;}else{_0x1417fa=0xce;}_0x5f46b5[_0x71b1('0x1b')](_0x1417fa);return _0x5f46b5['set'](_0x71b1('0x22'),_0x37f244+'-'+_0x486a6e+'/'+_0x577b3a)[_0x71b1('0x1d')](_0x378552);}return null;};}function saveUpdates(_0x1ec07a){return function(_0x5ef511){if(_0x5ef511){return _0x5ef511[_0x71b1('0x23')](_0x1ec07a)[_0x71b1('0x12')](function(_0x239e1f){return _0x239e1f;});}return null;};}function removeEntity(_0x31af94){return function(_0x9cf74){if(_0x9cf74){return _0x9cf74[_0x71b1('0x24')]()['then'](function(){var _0x27640d=_0x9cf74[_0x71b1('0x25')]({'plain':!![]});var _0x2e0db9=_0x71b1('0x26');return db['UserProfileResource'][_0x71b1('0x24')]({'where':{'type':_0x2e0db9,'resourceId':_0x27640d['id']}})[_0x71b1('0x12')](function(){return _0x9cf74;});})[_0x71b1('0x12')](function(){_0x31af94[_0x71b1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f077){return function(_0x2c9ecb){if(!_0x2c9ecb){_0x19f077[_0x71b1('0x27')](0x194);}return _0x2c9ecb;};}function handleError(_0x147a50,_0x46599d){_0x46599d=_0x46599d||0x1f4;return function(_0x512eb7){logger[_0x71b1('0x16')](_0x512eb7['stack']);if(_0x512eb7[_0x71b1('0x28')]){delete _0x512eb7[_0x71b1('0x28')];}_0x147a50[_0x71b1('0x1b')](_0x46599d)[_0x71b1('0x29')](_0x512eb7);};}function getImapHost(_0x4c5f2b){switch(_0x4c5f2b){case'gmail':return _0x71b1('0x2a');case _0x71b1('0x2b'):return _0x71b1('0x2c');case _0x71b1('0x2d'):return'imap-mail.outlook.com';case'outlook365':return _0x71b1('0x2e');}throw new Error(_0x71b1('0x2f'),_0x4c5f2b);}function getSmtpHost(_0x5cbed3){switch(_0x5cbed3){case'gmail':return _0x71b1('0x30');case _0x71b1('0x2b'):return _0x71b1('0x31');case'hotmail':return _0x71b1('0x32');case _0x71b1('0x33'):return _0x71b1('0x34');}throw new Error(_0x71b1('0x2f'),_0x5cbed3);}function getAuthenticationOptions(_0x301040,_0x251c80){var _0x204d3c={};var _0x5570c0={};if(_0x301040){_0x204d3c[_0x71b1('0x35')]=_0x5570c0[_0x71b1('0x35')]=_0x251c80[_0x71b1('0x36')];_0x204d3c['password']=_0x5570c0['pass']=_0x251c80[_0x71b1('0x37')];if(_0x251c80['modernAuthentication']){_0x204d3c[_0x71b1('0x38')]=_0x5570c0['modernAuthentication']=!![];_0x204d3c['CloudProviderId']=_0x5570c0['CloudProviderId']=_0x251c80[_0x71b1('0x39')];_0x204d3c[_0x71b1('0x37')]=_0x5570c0[_0x71b1('0x3a')]=null;}else{_0x204d3c['CloudProviderId']=_0x5570c0[_0x71b1('0x39')]=null;}_0x204d3c[_0x71b1('0x3b')]=getImapHost(_0x301040);_0x204d3c[_0x71b1('0x3c')]=0x3e1;_0x5570c0[_0x71b1('0x3b')]=getSmtpHost(_0x301040);_0x5570c0[_0x71b1('0x3c')]=0x24b;_0x5570c0[_0x71b1('0x3d')]=![];_0x204d3c['service']=_0x5570c0[_0x71b1('0x3e')]=null;}else{if(_0x251c80[_0x71b1('0x3f')]){_0x204d3c[_0x71b1('0x35')]=_0x5570c0[_0x71b1('0x35')]=_0x251c80[_0x71b1('0x36')];_0x204d3c[_0x71b1('0x37')]=_0x5570c0[_0x71b1('0x3a')]=_0x251c80[_0x71b1('0x37')];}else{_0x204d3c[_0x71b1('0x3f')]=_0x5570c0['authentication']=![];_0x204d3c[_0x71b1('0x35')]=_0x5570c0['user']=null;_0x204d3c[_0x71b1('0x37')]=_0x5570c0[_0x71b1('0x3a')]=null;}_0x204d3c['host']=_0x251c80[_0x71b1('0x40')][_0x71b1('0x3b')];_0x204d3c[_0x71b1('0x3c')]=_0x251c80[_0x71b1('0x40')][_0x71b1('0x3c')];_0x5570c0[_0x71b1('0x3b')]=_0x251c80[_0x71b1('0x41')][_0x71b1('0x3b')];_0x5570c0[_0x71b1('0x3c')]=_0x251c80['Smtp'][_0x71b1('0x3c')];}return{'Imap':_0x204d3c,'Smtp':_0x5570c0};}exports['index']=function(_0x244246,_0x2142ce){var _0x1afe67={'include':[{'model':db[_0x71b1('0x42')],'as':_0x71b1('0x40')},{'model':db[_0x71b1('0x43')],'as':_0x71b1('0x41')},{'model':db[_0x71b1('0x44')],'as':_0x71b1('0x45')}]},_0x59c4d3={},_0x443f4c={'count':0x0,'rows':[]};var _0x4b8f9c=_[_0x71b1('0x46')](db['MailAccount'][_0x71b1('0x47')],function(_0x55d5b3){return{'name':_0x55d5b3[_0x71b1('0x48')],'type':_0x55d5b3[_0x71b1('0x49')][_0x71b1('0x4a')]};});_0x59c4d3[_0x71b1('0x4b')]=_[_0x71b1('0x46')](_0x4b8f9c,_0x71b1('0x28'));_0x59c4d3['query']=_[_0x71b1('0x4c')](_0x244246[_0x71b1('0x4d')]);_0x59c4d3[_0x71b1('0x4e')]=_[_0x71b1('0x4f')](_0x59c4d3[_0x71b1('0x4b')],_0x59c4d3[_0x71b1('0x4d')]);_0x1afe67[_0x71b1('0x50')]=_[_0x71b1('0x4f')](_0x59c4d3[_0x71b1('0x4b')],qs[_0x71b1('0x51')](_0x244246['query'][_0x71b1('0x51')]));_0x1afe67[_0x71b1('0x50')]=_0x1afe67[_0x71b1('0x50')]['length']?_0x1afe67[_0x71b1('0x50')]:_0x59c4d3[_0x71b1('0x4b')];if(!_0x244246[_0x71b1('0x4d')]['hasOwnProperty'](_0x71b1('0x52'))){_0x1afe67[_0x71b1('0x1f')]=qs['limit'](_0x244246[_0x71b1('0x4d')][_0x71b1('0x1f')]);_0x1afe67[_0x71b1('0x21')]=qs[_0x71b1('0x21')](_0x244246[_0x71b1('0x4d')][_0x71b1('0x21')]);}_0x1afe67[_0x71b1('0x53')]=qs['sort'](_0x244246['query'][_0x71b1('0x54')]);_0x1afe67[_0x71b1('0x55')]=qs[_0x71b1('0x4e')](_[_0x71b1('0x56')](_0x244246[_0x71b1('0x4d')],_0x59c4d3[_0x71b1('0x4e')]),_0x4b8f9c);if(_0x244246['query'][_0x71b1('0x57')]){_0x1afe67[_0x71b1('0x55')]=_[_0x71b1('0x58')](_0x1afe67[_0x71b1('0x55')],{'$or':_['map'](_0x4b8f9c,function(_0xf44d53){if(_0xf44d53[_0x71b1('0x49')]!=='VIRTUAL'){var _0xd3bb6={};_0xd3bb6[_0xf44d53['name']]={'$like':'%'+_0x244246['query'][_0x71b1('0x57')]+'%'};return _0xd3bb6;}})});}_0x1afe67=_[_0x71b1('0x58')]({},_0x1afe67,_0x244246[_0x71b1('0x59')]);var _0x4e2035={'where':_0x1afe67['where']};return db[_0x71b1('0x5a')][_0x71b1('0x20')](_0x4e2035)[_0x71b1('0x12')](function(_0x39348d){_0x443f4c[_0x71b1('0x20')]=_0x39348d;if(_0x244246[_0x71b1('0x4d')][_0x71b1('0x5b')]){_0x1afe67['include']=[{'all':!![]}];}return db[_0x71b1('0x5a')][_0x71b1('0x5c')](_0x1afe67);})[_0x71b1('0x12')](function(_0x21a3ca){_0x443f4c[_0x71b1('0x5d')]=_0x21a3ca;return _0x443f4c;})[_0x71b1('0x12')](respondWithFilteredResult(_0x2142ce,_0x1afe67))[_0x71b1('0x5e')](handleError(_0x2142ce,null));};exports[_0x71b1('0x5f')]=function(_0x2f7e35,_0x2cd4cb){var _0x499720={'raw':![],'where':{'id':_0x2f7e35[_0x71b1('0x60')]['id']},'include':[{'model':db[_0x71b1('0x42')],'as':_0x71b1('0x40')},{'model':db[_0x71b1('0x43')],'as':_0x71b1('0x41')},{'model':db[_0x71b1('0x44')],'as':'mandatoryDispositionPause'}]},_0x53760c={};_0x53760c['model']=_[_0x71b1('0x4c')](db['MailAccount'][_0x71b1('0x47')]);_0x53760c[_0x71b1('0x4d')]=_[_0x71b1('0x4c')](_0x2f7e35['query']);_0x53760c['filters']=_['intersection'](_0x53760c[_0x71b1('0x4b')],_0x53760c[_0x71b1('0x4d')]);_0x499720[_0x71b1('0x50')]=_[_0x71b1('0x4f')](_0x53760c[_0x71b1('0x4b')],qs['fields'](_0x2f7e35[_0x71b1('0x4d')][_0x71b1('0x51')]));_0x499720[_0x71b1('0x50')]=_0x499720[_0x71b1('0x50')][_0x71b1('0x61')]?_0x499720[_0x71b1('0x50')]:_0x53760c[_0x71b1('0x4b')];if(_0x2f7e35[_0x71b1('0x4d')]['includeAll']){_0x499720['include']=[{'all':!![]}];}_0x499720=_[_0x71b1('0x58')]({},_0x499720,_0x2f7e35[_0x71b1('0x59')]);return db[_0x71b1('0x5a')][_0x71b1('0x62')](_0x499720)[_0x71b1('0x12')](handleEntityNotFound(_0x2cd4cb,null))['then'](respondWithResult(_0x2cd4cb,null))[_0x71b1('0x5e')](handleError(_0x2cd4cb,null));};exports[_0x71b1('0x23')]=function(_0x59f399,_0x3140a7){if(_0x59f399['body']['id']){delete _0x59f399[_0x71b1('0x63')]['id'];}var _0x3cf476=_0x59f399['body'][_0x71b1('0x64')]==='custom'?null:_0x59f399[_0x71b1('0x63')]['provider'];var _0x573b61=_0x59f399[_0x71b1('0x63')][_0x71b1('0x40')]||{};var _0x3c516c=_0x59f399[_0x71b1('0x63')][_0x71b1('0x41')]||{};if(_0x3cf476){_0x573b61[_0x71b1('0x3b')]=getImapHost(_0x3cf476);_0x573b61[_0x71b1('0x3c')]=0x3e1;_0x3c516c[_0x71b1('0x3b')]=getSmtpHost(_0x3cf476);_0x3c516c[_0x71b1('0x3c')]=0x24b;_0x3c516c[_0x71b1('0x3d')]=![];}if(_0x3c516c[_0x71b1('0x38')]){_0x3c516c[_0x71b1('0x3d')]=![];}else{_0x3c516c[_0x71b1('0x39')]=null;}if(!_0x573b61['modernAuthentication'])_0x573b61[_0x71b1('0x39')]=null;_0x59f399[_0x71b1('0x63')][_0x71b1('0x40')]=_0x573b61;_0x59f399['body'][_0x71b1('0x41')]=_0x3c516c;return db['MailAccount'][_0x71b1('0x62')]({'where':{'id':_0x59f399[_0x71b1('0x60')]['id']},'include':[{'model':db[_0x71b1('0x42')],'as':_0x71b1('0x40')},{'model':db[_0x71b1('0x43')],'as':_0x71b1('0x41')},{'model':db[_0x71b1('0x44')],'as':_0x71b1('0x45')}]})[_0x71b1('0x12')](handleEntityNotFound(_0x3140a7,null))[_0x71b1('0x12')](function(_0x33d597){if(!_0x33d597)throw new Error(_0x71b1('0x65'));if(_0x33d597['service'])delete _0x59f399[_0x71b1('0x63')]['Imap'];return _0x33d597;})['then'](saveUpdates(_0x59f399[_0x71b1('0x63')],null))[_0x71b1('0x12')](function(_0xeb1b9d){if(!_0x59f399['body'][_0x71b1('0x40')])return _0xeb1b9d;return db[_0x71b1('0x42')][_0x71b1('0x23')](_0x59f399[_0x71b1('0x63')][_0x71b1('0x40')],{'where':{'MailAccountId':_0xeb1b9d['id']}})[_0x71b1('0x12')](function(){return _0xeb1b9d;});})[_0x71b1('0x12')](function(_0x58f36e){if(!_0x59f399[_0x71b1('0x63')]['Smtp'])return _0x58f36e;return db[_0x71b1('0x43')]['update'](_0x59f399[_0x71b1('0x63')][_0x71b1('0x41')],{'where':{'MailAccountId':_0x58f36e['id']}})[_0x71b1('0x12')](function(){return _0x58f36e;});})[_0x71b1('0x12')](respondWithResult(_0x3140a7,null))[_0x71b1('0x5e')](handleError(_0x3140a7,null));};exports[_0x71b1('0x66')]=function(_0x26f918,_0x27fe25){return db[_0x71b1('0x5a')]['describe']()[_0x71b1('0x12')](respondWithResult(_0x27fe25,null))['catch'](handleError(_0x27fe25,null));};exports[_0x71b1('0x67')]=function(_0x344793,_0x5ddb95){if(_0x344793[_0x71b1('0x63')]['id']){delete _0x344793[_0x71b1('0x63')]['id'];}return db[_0x71b1('0x5a')][_0x71b1('0x62')]({'where':{'id':_0x344793[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x5ddb95,null))[_0x71b1('0x12')](function(_0x5edd26){if(_0x5edd26){_0x344793['body'][_0x71b1('0x68')]=_0x5edd26['id'];return db[_0x71b1('0x69')][_0x71b1('0x6a')](_0x344793['body']);}})[_0x71b1('0x12')](respondWithResult(_0x5ddb95,null))[_0x71b1('0x5e')](handleError(_0x5ddb95,null));};exports[_0x71b1('0x6b')]=function(_0x37e0e4,_0x341016){var _0x131659={'raw':![],'where':{}};var _0x54bc4e={};var _0x31c4ac={'count':0x0,'rows':[]};return db[_0x71b1('0x5a')][_0x71b1('0x6c')]({'where':{'id':_0x37e0e4[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x341016,null))[_0x71b1('0x12')](function(_0x3a08a9){if(_0x3a08a9){_0x54bc4e[_0x71b1('0x4b')]=_[_0x71b1('0x4c')](db['Disposition'][_0x71b1('0x47')]);_0x54bc4e['query']=_[_0x71b1('0x4c')](_0x37e0e4[_0x71b1('0x4d')]);_0x54bc4e[_0x71b1('0x4e')]=_[_0x71b1('0x4f')](_0x54bc4e[_0x71b1('0x4b')],_0x54bc4e[_0x71b1('0x4d')]);_0x131659[_0x71b1('0x50')]=_[_0x71b1('0x4f')](_0x54bc4e[_0x71b1('0x4b')],qs[_0x71b1('0x51')](_0x37e0e4[_0x71b1('0x4d')][_0x71b1('0x51')]));_0x131659['attributes']=_0x131659[_0x71b1('0x50')][_0x71b1('0x61')]?_0x131659[_0x71b1('0x50')]:_0x54bc4e[_0x71b1('0x4b')];if(!_0x37e0e4[_0x71b1('0x4d')]['hasOwnProperty'](_0x71b1('0x52'))){_0x131659[_0x71b1('0x1f')]=qs['limit'](_0x37e0e4[_0x71b1('0x4d')]['limit']);_0x131659[_0x71b1('0x21')]=qs[_0x71b1('0x21')](_0x37e0e4[_0x71b1('0x4d')][_0x71b1('0x21')]);}_0x131659[_0x71b1('0x53')]=qs[_0x71b1('0x54')](_0x37e0e4['query']['sort']);_0x131659[_0x71b1('0x55')]=qs[_0x71b1('0x4e')](_[_0x71b1('0x56')](_0x37e0e4[_0x71b1('0x4d')],_0x54bc4e[_0x71b1('0x4e')]));_0x131659[_0x71b1('0x55')][_0x71b1('0x68')]=_0x3a08a9['id'];if(_0x37e0e4[_0x71b1('0x4d')]['filter']){_0x131659[_0x71b1('0x55')]=_['merge'](_0x131659['where'],{'$or':_[_0x71b1('0x46')](_0x131659[_0x71b1('0x50')],function(_0x50ad3e){var _0x94095b={};_0x94095b[_0x50ad3e]={'$like':'%'+_0x37e0e4[_0x71b1('0x4d')][_0x71b1('0x57')]+'%'};return _0x94095b;})});}_0x131659=_[_0x71b1('0x58')]({},_0x131659,_0x37e0e4[_0x71b1('0x59')]);return db['Disposition']['count']({'where':_0x131659[_0x71b1('0x55')]})['then'](function(_0x3df329){_0x31c4ac['count']=_0x3df329;if(_0x37e0e4[_0x71b1('0x4d')][_0x71b1('0x5b')]){_0x131659[_0x71b1('0x6d')]=[{'all':!![]}];}return db['Disposition'][_0x71b1('0x5c')](_0x131659);})[_0x71b1('0x12')](function(_0x1d35d9){_0x31c4ac[_0x71b1('0x5d')]=_0x1d35d9;return _0x31c4ac;});}})['then'](respondWithFilteredResult(_0x341016,_0x131659))[_0x71b1('0x5e')](handleError(_0x341016,null));};exports[_0x71b1('0x6e')]=function(_0x16ac53,_0x25f0bf){return db[_0x71b1('0x5a')]['find']({'where':{'id':_0x16ac53['params']['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x25f0bf,null))[_0x71b1('0x12')](function(_0x3ef3c8){if(_0x3ef3c8){return _0x3ef3c8[_0x71b1('0x6e')](_0x16ac53[_0x71b1('0x4d')][_0x71b1('0x6f')]);}})[_0x71b1('0x12')](respondWithStatusCode(_0x25f0bf,null))[_0x71b1('0x5e')](handleError(_0x25f0bf,null));};exports[_0x71b1('0x70')]=function(_0x1df7f6,_0x108b13){if(_0x1df7f6[_0x71b1('0x63')]['id']){delete _0x1df7f6[_0x71b1('0x63')]['id'];}return db['MailAccount'][_0x71b1('0x62')]({'where':{'id':_0x1df7f6[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x108b13,null))[_0x71b1('0x12')](function(_0x16b6f5){if(_0x16b6f5){_0x1df7f6[_0x71b1('0x63')][_0x71b1('0x68')]=_0x16b6f5['id'];return db[_0x71b1('0x71')][_0x71b1('0x6a')](_0x1df7f6[_0x71b1('0x63')]);}})['then'](respondWithResult(_0x108b13,null))[_0x71b1('0x5e')](handleError(_0x108b13,null));};exports['getAnswers']=function(_0x4b67d6,_0x4c9609){var _0x147a06={'raw':![],'where':{}};var _0x4d13a9={};var _0x271628={'count':0x0,'rows':[]};return db[_0x71b1('0x5a')][_0x71b1('0x6c')]({'where':{'id':_0x4b67d6[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x4c9609,null))[_0x71b1('0x12')](function(_0xc90d53){if(_0xc90d53){_0x4d13a9[_0x71b1('0x4b')]=_['keys'](db[_0x71b1('0x71')]['rawAttributes']);_0x4d13a9['query']=_['keys'](_0x4b67d6[_0x71b1('0x4d')]);_0x4d13a9[_0x71b1('0x4e')]=_[_0x71b1('0x4f')](_0x4d13a9['model'],_0x4d13a9[_0x71b1('0x4d')]);_0x147a06[_0x71b1('0x50')]=_[_0x71b1('0x4f')](_0x4d13a9[_0x71b1('0x4b')],qs['fields'](_0x4b67d6[_0x71b1('0x4d')][_0x71b1('0x51')]));_0x147a06[_0x71b1('0x50')]=_0x147a06[_0x71b1('0x50')]['length']?_0x147a06['attributes']:_0x4d13a9[_0x71b1('0x4b')];if(!_0x4b67d6[_0x71b1('0x4d')][_0x71b1('0x72')]('nolimit')){_0x147a06[_0x71b1('0x1f')]=qs[_0x71b1('0x1f')](_0x4b67d6[_0x71b1('0x4d')][_0x71b1('0x1f')]);_0x147a06[_0x71b1('0x21')]=qs[_0x71b1('0x21')](_0x4b67d6[_0x71b1('0x4d')][_0x71b1('0x21')]);}_0x147a06[_0x71b1('0x53')]=qs[_0x71b1('0x54')](_0x4b67d6['query'][_0x71b1('0x54')]);_0x147a06[_0x71b1('0x55')]=qs['filters'](_[_0x71b1('0x56')](_0x4b67d6[_0x71b1('0x4d')],_0x4d13a9[_0x71b1('0x4e')]));_0x147a06['where'][_0x71b1('0x68')]=_0xc90d53['id'];if(_0x4b67d6[_0x71b1('0x4d')][_0x71b1('0x57')]){_0x147a06['where']=_[_0x71b1('0x58')](_0x147a06[_0x71b1('0x55')],{'$or':_[_0x71b1('0x46')](_0x147a06['attributes'],function(_0x55416d){var _0x1c1796={};_0x1c1796[_0x55416d]={'$like':'%'+_0x4b67d6[_0x71b1('0x4d')][_0x71b1('0x57')]+'%'};return _0x1c1796;})});}_0x147a06=_['merge']({},_0x147a06,_0x4b67d6[_0x71b1('0x59')]);return db[_0x71b1('0x71')]['count']({'where':_0x147a06['where']})[_0x71b1('0x12')](function(_0x448d3f){_0x271628[_0x71b1('0x20')]=_0x448d3f;if(_0x4b67d6[_0x71b1('0x4d')][_0x71b1('0x5b')]){_0x147a06['include']=[{'all':!![]}];}return db[_0x71b1('0x71')][_0x71b1('0x5c')](_0x147a06);})[_0x71b1('0x12')](function(_0x58c2ef){_0x271628[_0x71b1('0x5d')]=_0x58c2ef;return _0x271628;});}})[_0x71b1('0x12')](respondWithFilteredResult(_0x4c9609,_0x147a06))[_0x71b1('0x5e')](handleError(_0x4c9609,null));};exports[_0x71b1('0x73')]=function(_0x1c7bd7,_0x159c2c){return db[_0x71b1('0x5a')][_0x71b1('0x62')]({'where':{'id':_0x1c7bd7[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x159c2c,null))['then'](function(_0x3c1ac9){if(_0x3c1ac9){return _0x3c1ac9['removeAnswers'](_0x1c7bd7[_0x71b1('0x4d')][_0x71b1('0x6f')]);}})[_0x71b1('0x12')](respondWithStatusCode(_0x159c2c,null))[_0x71b1('0x5e')](handleError(_0x159c2c,null));};exports['create']=function(_0xe59301,_0x56c38c){var _0x3a65f4={'name':_0xe59301[_0x71b1('0x63')]['name'],'key':_0xe59301[_0x71b1('0x63')][_0x71b1('0x4a')],'provider':_0xe59301[_0x71b1('0x63')]['provider']===_0x71b1('0x74')?null:_0xe59301[_0x71b1('0x63')][_0x71b1('0x64')],'email':_0xe59301['body'][_0x71b1('0x75')],'ListId':_0xe59301[_0x71b1('0x63')]['ListId'],'active':!_['isNil'](_0xe59301['body'][_0x71b1('0x76')])?_0xe59301[_0x71b1('0x63')][_0x71b1('0x76')]:!![],'description':_0xe59301[_0x71b1('0x63')][_0x71b1('0x77')]||null};var _0x551bdc=getAuthenticationOptions(_0x3a65f4[_0x71b1('0x64')],_0xe59301[_0x71b1('0x63')]);_0x3a65f4[_0x71b1('0x40')]=_0x551bdc[_0x71b1('0x40')];_0x3a65f4[_0x71b1('0x41')]=_0x551bdc['Smtp'];return db[_0x71b1('0x5a')][_0x71b1('0x6a')](_0x3a65f4,{'include':[{'model':db[_0x71b1('0x43')],'as':_0x71b1('0x41')},{'model':db[_0x71b1('0x42')],'as':_0x71b1('0x40')}]})[_0x71b1('0x12')](function(_0x3ecbeb){var _0x145388=_0xe59301['user']['get']({'plain':!![]});if(!_0x145388)throw new Error(_0x71b1('0x78'));if(_0x145388[_0x71b1('0x79')]===_0x71b1('0x35')){var _0x1423c8=_0x3ecbeb[_0x71b1('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x71b1('0x62')]({'where':{'name':_0x71b1('0x26'),'userProfileId':_0x145388[_0x71b1('0x7a')]},'raw':!![]})[_0x71b1('0x12')](function(_0x38dd46){if(_0x38dd46&&_0x38dd46[_0x71b1('0x7b')]===0x0){return db[_0x71b1('0x7c')]['create']({'name':_0x1423c8['name'],'resourceId':_0x1423c8['id'],'type':_0x38dd46['name'],'sectionId':_0x38dd46['id']},{})[_0x71b1('0x12')](function(){return _0x3ecbeb;});}else{return _0x3ecbeb;}})[_0x71b1('0x5e')](function(_0x1df666){logger[_0x71b1('0x16')](_0x71b1('0x7d'),_0x1df666);throw _0x1df666;});}return _0x3ecbeb;})[_0x71b1('0x12')](respondWithResult(_0x56c38c,0xc9))[_0x71b1('0x5e')](handleError(_0x56c38c,null));};exports['getImap']=function(_0x1f0d3c,_0x408afc){return db[_0x71b1('0x5a')][_0x71b1('0x6c')]({'where':{'id':_0x1f0d3c[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x408afc,null))['then'](function(_0x35a99a){if(_0x35a99a){return _0x35a99a[_0x71b1('0x7e')]();}return null;})[_0x71b1('0x12')](respondWithResult(_0x408afc,null))[_0x71b1('0x5e')](handleError(_0x408afc,null));};exports[_0x71b1('0x7f')]=function(_0x2ad5b4,_0x1bb366){if(_0x2ad5b4[_0x71b1('0x63')]['id']){delete _0x2ad5b4[_0x71b1('0x63')]['id'];}return db['MailAccount'][_0x71b1('0x62')]({'where':{'id':_0x2ad5b4[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x1bb366,null))[_0x71b1('0x12')](function(_0x4b7686){if(_0x4b7686){_0x2ad5b4[_0x71b1('0x63')][_0x71b1('0x68')]=_0x4b7686['id'];return db['MailServerIn'][_0x71b1('0x6a')](_0x2ad5b4[_0x71b1('0x63')]);}})['then'](respondWithResult(_0x1bb366,null))[_0x71b1('0x5e')](handleError(_0x1bb366,null));};exports[_0x71b1('0x80')]=function(_0x1714ce,_0xe29ac1){return db[_0x71b1('0x5a')][_0x71b1('0x6c')]({'where':{'id':_0x1714ce[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0xe29ac1,null))['then'](function(_0x252cae){if(_0x252cae){return _0x252cae[_0x71b1('0x81')](null);}return null;})['then'](respondWithStatusCode(_0xe29ac1,null))[_0x71b1('0x5e')](handleError(_0xe29ac1,null));};exports[_0x71b1('0x82')]=function(_0x9e941f,_0x7e145c){return db[_0x71b1('0x5a')]['findOne']({'where':{'id':_0x9e941f['params']['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x7e145c,null))[_0x71b1('0x12')](function(_0x2024c9){if(_0x2024c9){return _0x2024c9[_0x71b1('0x82')]();}return null;})[_0x71b1('0x12')](respondWithResult(_0x7e145c,null))[_0x71b1('0x5e')](handleError(_0x7e145c,null));};exports[_0x71b1('0x83')]=function(_0x10c5c3,_0x1cec17){if(_0x10c5c3[_0x71b1('0x63')]['id']){delete _0x10c5c3[_0x71b1('0x63')]['id'];}return db[_0x71b1('0x5a')][_0x71b1('0x62')]({'where':{'id':_0x10c5c3[_0x71b1('0x60')]['id']}})['then'](handleEntityNotFound(_0x1cec17,null))[_0x71b1('0x12')](function(_0x537634){if(_0x537634){_0x10c5c3[_0x71b1('0x63')]['MailAccountId']=_0x537634['id'];return db[_0x71b1('0x43')]['create'](_0x10c5c3[_0x71b1('0x63')]);}})[_0x71b1('0x12')](respondWithResult(_0x1cec17,null))[_0x71b1('0x5e')](handleError(_0x1cec17,null));};exports[_0x71b1('0x84')]=function(_0xcd147c,_0x481418){return db[_0x71b1('0x5a')]['findOne']({'where':{'id':_0xcd147c[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x481418,null))[_0x71b1('0x12')](function(_0x347d60){if(_0x347d60){return _0x347d60['setSmtp'](null);}return null;})[_0x71b1('0x12')](respondWithStatusCode(_0x481418,null))[_0x71b1('0x5e')](handleError(_0x481418,null));};exports[_0x71b1('0x85')]=function(_0x54f840,_0x216073){return db[_0x71b1('0x86')]['find']({'where':{'id':_0x54f840['params']['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x216073,null))['then'](function(_0x777985){if(_0x777985){return _0x777985[_0x71b1('0x85')](_0x54f840[_0x71b1('0x63')]['ids'],_[_0x71b1('0x87')](_0x54f840[_0x71b1('0x63')],[_0x71b1('0x6f'),'id'])||{});}})[_0x71b1('0x12')](respondWithResult(_0x216073,null))[_0x71b1('0x5e')](handleError(_0x216073,null));};exports['getInteractions']=function(_0x3c837c,_0x4ca183){var _0x1e603a={'raw':![],'where':{}};var _0xe25ce5={};var _0x4f8ae2={'count':0x0,'rows':[]};return db[_0x71b1('0x5a')]['findOne']({'where':{'id':_0x3c837c['params']['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x4ca183,null))[_0x71b1('0x12')](function(_0x53889e){if(_0x53889e){_0xe25ce5[_0x71b1('0x4b')]=_[_0x71b1('0x4c')](db['MailInteraction']['rawAttributes']);_0xe25ce5[_0x71b1('0x4d')]=_[_0x71b1('0x4c')](_0x3c837c[_0x71b1('0x4d')]);_0xe25ce5[_0x71b1('0x4e')]=_[_0x71b1('0x4f')](_0xe25ce5['model'],_0xe25ce5['query']);_0x1e603a['attributes']=_[_0x71b1('0x4f')](_0xe25ce5['model'],qs[_0x71b1('0x51')](_0x3c837c[_0x71b1('0x4d')]['fields']));_0x1e603a[_0x71b1('0x50')]=_0x1e603a[_0x71b1('0x50')][_0x71b1('0x61')]?_0x1e603a[_0x71b1('0x50')]:_0xe25ce5['model'];if(!_0x3c837c[_0x71b1('0x4d')][_0x71b1('0x72')]('nolimit')){_0x1e603a[_0x71b1('0x1f')]=qs[_0x71b1('0x1f')](_0x3c837c[_0x71b1('0x4d')][_0x71b1('0x1f')]);_0x1e603a[_0x71b1('0x21')]=qs[_0x71b1('0x21')](_0x3c837c[_0x71b1('0x4d')][_0x71b1('0x21')]);}_0x1e603a['order']=qs[_0x71b1('0x54')](_0x3c837c['query'][_0x71b1('0x54')]);_0x1e603a[_0x71b1('0x55')]=qs['filters'](_[_0x71b1('0x56')](_0x3c837c[_0x71b1('0x4d')],_0xe25ce5[_0x71b1('0x4e')]));_0x1e603a['where'][_0x71b1('0x68')]=_0x53889e['id'];if(_0x3c837c[_0x71b1('0x4d')][_0x71b1('0x57')]){_0x1e603a['where']=_[_0x71b1('0x58')](_0x1e603a[_0x71b1('0x55')],{'$or':_[_0x71b1('0x46')](_0x1e603a[_0x71b1('0x50')],function(_0x338283){var _0x7d6639={};_0x7d6639[_0x338283]={'$like':'%'+_0x3c837c[_0x71b1('0x4d')]['filter']+'%'};return _0x7d6639;})});}_0x1e603a=_['merge']({},_0x1e603a,_0x3c837c[_0x71b1('0x59')]);return db[_0x71b1('0x86')]['count']({'where':_0x1e603a[_0x71b1('0x55')]})['then'](function(_0x1043ef){_0x4f8ae2[_0x71b1('0x20')]=_0x1043ef;if(_0x3c837c['query'][_0x71b1('0x5b')]){_0x1e603a[_0x71b1('0x6d')]=[{'model':db[_0x71b1('0x88')],'as':_0x71b1('0x89'),'required':![]},{'model':db[_0x71b1('0x8a')],'as':'Owner','attributes':[_0x71b1('0x28'),_0x71b1('0x8b'),'internal'],'required':![]},{'model':db[_0x71b1('0x8c')],'as':'Tags','attributes':['id',_0x71b1('0x28'),_0x71b1('0x8d')],'where':_0x3c837c[_0x71b1('0x4d')][_0x71b1('0x8e')]?{'id':_0x3c837c[_0x71b1('0x4d')]['tag']}:undefined,'required':_0x3c837c[_0x71b1('0x4d')][_0x71b1('0x8e')]?!![]:![]}];}return db[_0x71b1('0x86')][_0x71b1('0x5c')](_0x1e603a);})['then'](function(_0xe0df6a){_0x4f8ae2['rows']=_0xe0df6a;return _0x4f8ae2;});}})[_0x71b1('0x12')](respondWithFilteredResult(_0x4ca183,_0x1e603a))[_0x71b1('0x5e')](handleError(_0x4ca183,null));};exports[_0x71b1('0x8f')]=function addApplications(_0x2b9c2d,_0x7e4ede){var _0x3286d1=_0x2b9c2d[_0x71b1('0x60')]['id'];var _0x5d07ea=_0x2b9c2d[_0x71b1('0x63')];var _0x4be506=0xc8;var _0x1ad761=null;return db[_0x71b1('0x90')][_0x71b1('0x91')]({'isolationLevel':db['sequelize']['Transaction'][_0x71b1('0x92')][_0x71b1('0x93')]},function(_0x3c60ee){return db[_0x71b1('0x5a')][_0x71b1('0x6c')]({'where':{'id':_0x3286d1},'transaction':_0x3c60ee})['then'](function(_0x15c60e){if(_0x15c60e){return db['MailApplication'][_0x71b1('0x24')]({'where':{'MailAccountId':_0x3286d1},'transaction':_0x3c60ee})[_0x71b1('0x12')](function(){var _0x439446=_['map'](_0x5d07ea,function(_0x379d1e){_0x379d1e['MailAccountId']=_0x3286d1;return _0x379d1e;});return db[_0x71b1('0x94')][_0x71b1('0x95')](_0x439446,{'transaction':_0x3c60ee});});}else{_0x4be506=0x194;_0x1ad761=[];}});})['then'](function(){if(_0x4be506!==0x194){return db['MailApplication'][_0x71b1('0x96')]({'where':{'MailAccountId':_0x3286d1},'order':_0x71b1('0x97')})[_0x71b1('0x12')](function(_0x1bb8ac){_0x1ad761=_0x1bb8ac;});}})[_0x71b1('0x5e')](function(_0x1e22eb){_0x4be506=0x1f4;logger[_0x71b1('0x16')](_0x1e22eb['stack']);if(_0x1e22eb[_0x71b1('0x28')]){delete _0x1e22eb['name'];}_0x1ad761=_0x1e22eb;})[_0x71b1('0x98')](function(){if(_0x1ad761===null){_0x7e4ede[_0x71b1('0x27')](_0x4be506);}else{if(_0x4be506===0x1f4){_0x7e4ede[_0x71b1('0x1b')](_0x4be506)[_0x71b1('0x29')](_0x1ad761);}else{_0x7e4ede[_0x71b1('0x1b')](_0x4be506)[_0x71b1('0x1d')](_0x1ad761);}}});};exports[_0x71b1('0x99')]=function(_0x5925c1,_0x102469){var _0xbbace2={};var _0x4c8f92={};var _0x2eddd2;var _0x4f714a;return db[_0x71b1('0x5a')][_0x71b1('0x6c')]({'where':{'id':_0x5925c1[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x102469,null))[_0x71b1('0x12')](function(_0x3d3f5b){if(_0x3d3f5b){_0x2eddd2=_0x3d3f5b;_0x4c8f92[_0x71b1('0x4b')]=_['keys'](db[_0x71b1('0x94')]['rawAttributes']);_0x4c8f92[_0x71b1('0x4d')]=_['keys'](_0x5925c1[_0x71b1('0x4d')]);_0x4c8f92[_0x71b1('0x4e')]=_[_0x71b1('0x4f')](_0x4c8f92['model'],_0x4c8f92['query']);_0xbbace2[_0x71b1('0x50')]=_[_0x71b1('0x4f')](_0x4c8f92[_0x71b1('0x4b')],qs[_0x71b1('0x51')](_0x5925c1['query'][_0x71b1('0x51')]));_0xbbace2[_0x71b1('0x50')]=_0xbbace2[_0x71b1('0x50')][_0x71b1('0x61')]?_0xbbace2[_0x71b1('0x50')]:_0x4c8f92[_0x71b1('0x4b')];_0xbbace2[_0x71b1('0x53')]=qs[_0x71b1('0x54')](_0x5925c1[_0x71b1('0x4d')][_0x71b1('0x54')]);_0xbbace2[_0x71b1('0x55')]=qs['filters'](_['pick'](_0x5925c1['query'],_0x4c8f92[_0x71b1('0x4e')]));if(_0x5925c1[_0x71b1('0x4d')][_0x71b1('0x57')]){_0xbbace2['where']=_[_0x71b1('0x58')](_0xbbace2[_0x71b1('0x55')],{'$or':_['map'](_0xbbace2[_0x71b1('0x50')],function(_0x42a922){var _0x2dc02f={};_0x2dc02f[_0x42a922]={'$like':'%'+_0x5925c1[_0x71b1('0x4d')][_0x71b1('0x57')]+'%'};return _0x2dc02f;})});}_0xbbace2=_['merge']({},_0xbbace2,_0x5925c1[_0x71b1('0x59')]);return _0x2eddd2[_0x71b1('0x99')](_0xbbace2);}})['then'](function(_0x5f1b57){if(_0x5f1b57){_0x4f714a=_0x5f1b57[_0x71b1('0x61')];if(!_0x5925c1[_0x71b1('0x4d')]['hasOwnProperty'](_0x71b1('0x52'))){_0xbbace2[_0x71b1('0x1f')]=qs[_0x71b1('0x1f')](_0x5925c1['query'][_0x71b1('0x1f')]);_0xbbace2[_0x71b1('0x21')]=qs[_0x71b1('0x21')](_0x5925c1[_0x71b1('0x4d')]['offset']);}return _0x2eddd2['getApplications'](_0xbbace2);}})[_0x71b1('0x12')](function(_0x4b10e7){if(_0x4b10e7){return _0x4b10e7?{'count':_0x4f714a,'rows':_0x4b10e7}:null;}})[_0x71b1('0x12')](respondWithResult(_0x102469,null))['catch'](handleError(_0x102469,null));};exports[_0x71b1('0x9a')]=function(_0x38d73d,_0x98b58f){var _0x292b62={'raw':!![],'where':{}};var _0x589be0={};var _0x50932a={'count':0x0,'rows':[]};return db[_0x71b1('0x5a')][_0x71b1('0x6c')]({'where':{'id':_0x38d73d[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x98b58f,null))[_0x71b1('0x12')](function(_0x1cd0b8){if(_0x1cd0b8){_0x589be0[_0x71b1('0x4b')]=_[_0x71b1('0x4c')](db[_0x71b1('0x9b')][_0x71b1('0x47')]);_0x589be0[_0x71b1('0x4d')]=_['keys'](_0x38d73d[_0x71b1('0x4d')]);_0x589be0['filters']=_['intersection'](_0x589be0[_0x71b1('0x4b')],_0x589be0[_0x71b1('0x4d')]);_0x292b62[_0x71b1('0x50')]=_[_0x71b1('0x4f')](_0x589be0[_0x71b1('0x4b')],qs[_0x71b1('0x51')](_0x38d73d[_0x71b1('0x4d')]['fields']));_0x292b62[_0x71b1('0x50')]=_0x292b62[_0x71b1('0x50')][_0x71b1('0x61')]?_0x292b62['attributes']:_0x589be0[_0x71b1('0x4b')];if(!_0x38d73d[_0x71b1('0x4d')][_0x71b1('0x72')](_0x71b1('0x52'))){_0x292b62[_0x71b1('0x1f')]=qs['limit'](_0x38d73d[_0x71b1('0x4d')][_0x71b1('0x1f')]);_0x292b62['offset']=qs[_0x71b1('0x21')](_0x38d73d[_0x71b1('0x4d')][_0x71b1('0x21')]);}_0x292b62[_0x71b1('0x53')]=qs[_0x71b1('0x54')](_0x38d73d[_0x71b1('0x4d')]['sort']);_0x292b62[_0x71b1('0x55')]=qs['filters'](_[_0x71b1('0x56')](_0x38d73d['query'],_0x589be0[_0x71b1('0x4e')]));_0x292b62[_0x71b1('0x55')][_0x71b1('0x68')]=_0x1cd0b8['id'];if(_0x38d73d[_0x71b1('0x4d')][_0x71b1('0x57')]){_0x292b62[_0x71b1('0x55')]=_[_0x71b1('0x58')](_0x292b62[_0x71b1('0x55')],{'$or':_[_0x71b1('0x46')](_0x292b62['attributes'],function(_0x451b38){var _0x4deb75={};_0x4deb75[_0x451b38]={'$like':'%'+_0x38d73d[_0x71b1('0x4d')][_0x71b1('0x57')]+'%'};return _0x4deb75;})});}if(_0x38d73d[_0x71b1('0x4d')]['$gte']){var _0x2c674f=_0x38d73d[_0x71b1('0x4d')]['$gte'][_0x71b1('0x9c')](',');var _0x32972b={};_0x32972b[_0x2c674f[0x0]]={'$gte':moment(_0x2c674f[0x1])[_0x71b1('0x9d')](_0x71b1('0x9e'))};_0x292b62[_0x71b1('0x55')]=_[_0x71b1('0x58')](_0x292b62[_0x71b1('0x55')],_0x32972b);}_0x292b62=_[_0x71b1('0x58')]({},_0x292b62,_0x38d73d[_0x71b1('0x59')]);return db['MailMessage'][_0x71b1('0x20')]({'where':_0x292b62['where']})[_0x71b1('0x12')](function(_0x328748){_0x50932a[_0x71b1('0x20')]=_0x328748;if(_0x38d73d['query'][_0x71b1('0x5b')]){_0x292b62[_0x71b1('0x6d')]=[{'all':!![]}];}return db[_0x71b1('0x9b')][_0x71b1('0x5c')](_0x292b62);})['then'](function(_0x2e4f2f){if(_0x38d73d[_0x71b1('0x4d')][_0x71b1('0x9f')]===_0x71b1('0xa0')){for(var _0x13ea56=0x0;_0x13ea56<_0x2e4f2f['length'];_0x13ea56++){_0x2e4f2f[_0x13ea56][_0x71b1('0x63')]=juice(_0x2e4f2f[_0x13ea56]['body']);}}_0x50932a[_0x71b1('0x5d')]=_0x2e4f2f;return _0x50932a;});}})['then'](respondWithFilteredResult(_0x98b58f,_0x292b62))[_0x71b1('0x5e')](handleError(_0x98b58f,null));};exports['send']=function(_0x13eeb4,_0x226396){var _0x4ec6fc,_0x1d3f79={},_0x3c98c1;if(_0x13eeb4['body']['to']){_0x3c98c1=_0x13eeb4[_0x71b1('0x63')]['to'][_0x71b1('0x9c')](',')[0x0];}return db[_0x71b1('0x5a')][_0x71b1('0x62')]({'where':{'id':_0x13eeb4[_0x71b1('0x60')]['id']},'include':[{'model':db[_0x71b1('0xa1')],'as':_0x71b1('0xa2'),'include':[{'model':db[_0x71b1('0x88')],'as':_0x71b1('0xa3'),'where':{'email':_0x3c98c1},'limit':0x1,'order':[[_0x71b1('0xa4'),_0x71b1('0xa5')]]}]},{'model':db['MailServerOut'],'as':_0x71b1('0x41'),'raw':!![],'include':[{'model':db[_0x71b1('0xa6')],'as':'CloudProvider','raw':!![]}]}]})[_0x71b1('0x12')](handleEntityNotFound(_0x226396,null))[_0x71b1('0x12')](function(_0x1288c0){if(!_0x1288c0)return;_0x4ec6fc=_0x1288c0;if(!_0x1288c0['Smtp'])throw new Error(_0x71b1('0xa7'));if(_[_0x71b1('0xa8')](_0x13eeb4['body'][_0x71b1('0xa9')])){_0x13eeb4[_0x71b1('0x63')]['from']=util['format'](_0x71b1('0xaa'),_0x1288c0[_0x71b1('0x28')],_0x1288c0[_0x71b1('0x75')]||_0x1288c0[_0x71b1('0x41')][_0x71b1('0x35')]);}if(_0x13eeb4['body'][_0x71b1('0xab')]&&_0x13eeb4[_0x71b1('0x63')][_0x71b1('0xab')]['length']){for(var _0x1d4ef2=0x0;_0x1d4ef2<_0x13eeb4[_0x71b1('0x63')][_0x71b1('0xab')][_0x71b1('0x61')];_0x1d4ef2+=0x1){_0x13eeb4['body'][_0x71b1('0xab')][_0x1d4ef2]={'filename':_0x13eeb4[_0x71b1('0x63')][_0x71b1('0xab')][_0x1d4ef2][_0x71b1('0x28')],'path':path[_0x71b1('0xac')](config[_0x71b1('0xad')],_0x71b1('0xae'),_0x13eeb4[_0x71b1('0x63')][_0x71b1('0xab')][_0x1d4ef2][_0x71b1('0xaf')])};}}var _0x8dc40a=_0x1288c0['getSmtpOptions']();return respondWithRpcPromise(_0x71b1('0xb0'),_0x71b1('0xb1'),{'account':_0x8dc40a,'message':_0x13eeb4[_0x71b1('0x63')]});})[_0x71b1('0x12')](function(_0x52baff){if(!_0x52baff)return;_0x1d3f79=_0x52baff;if(!_0x4ec6fc[_0x71b1('0xa2')])throw new Error(_0x71b1('0xb2'));if(_0x4ec6fc[_0x71b1('0xa2')]['Contacts']['length'])return _0x4ec6fc['List'][_0x71b1('0xa3')][0x0];return db[_0x71b1('0x88')][_0x71b1('0x6a')](_[_0x71b1('0xa')](_0x13eeb4[_0x71b1('0x63')],{'firstName':_0x13eeb4[_0x71b1('0x63')]['to'],'email':_0x13eeb4[_0x71b1('0x63')]['to'],'phone':_0x13eeb4['body']['to'],'ListId':_0x4ec6fc[_0x71b1('0xb3')]}));})[_0x71b1('0x12')](function(_0x2b0a0c){if(!_0x2b0a0c)return;var _0x5d167f={'UserId':_0x13eeb4[_0x71b1('0x35')]['id'],'ContactId':_0x2b0a0c['id'],'MailAccountId':_0x4ec6fc['id'],'inReplyTo':_0x1d3f79[_0x71b1('0xb4')],'to':_0x13eeb4['body'][_0x71b1('0xa9')],'cc':_0x13eeb4[_0x71b1('0x63')]['cc'],'subject':_0x13eeb4[_0x71b1('0x63')]['subject'],'attach':_0x13eeb4[_0x71b1('0x63')][_0x71b1('0xb5')],'firstMsgDirection':_0x71b1('0xb6'),'lastMsgAt':moment()[_0x71b1('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x71b1('0x58')](_0x13eeb4['body'],{'messageId':_0x1d3f79[_0x71b1('0xb4')],'sentAt':moment()[_0x71b1('0x9d')](_0x71b1('0x9e')),'read':!![],'MailAccountId':_0x4ec6fc['id'],'UserId':_0x13eeb4[_0x71b1('0x35')]['id'],'ContactId':_0x2b0a0c['id']})]};if(_0x13eeb4[_0x71b1('0x63')]['Interaction']){_0x5d167f=_[_0x71b1('0x58')](_0x5d167f,_0x13eeb4[_0x71b1('0x63')][_0x71b1('0xb7')]);}return db[_0x71b1('0x86')][_0x71b1('0x6a')](_0x5d167f,{'include':[{'model':db['MailMessage'],'as':_0x71b1('0xb8')}]});})[_0x71b1('0x12')](respondWithResult(_0x226396,null))[_0x71b1('0x5e')](handleError(_0x226396,null));};exports['verifySmtp']=function(_0x3b8645,_0x1d6c28){return db[_0x71b1('0x5a')][_0x71b1('0x62')]({'where':{'id':_0x3b8645['params']['id']},'include':[{'model':db[_0x71b1('0x43')],'as':_0x71b1('0x41'),'raw':!![],'include':[{'model':db[_0x71b1('0xa6')],'as':_0x71b1('0xa6'),'raw':!![]}]}]})[_0x71b1('0x12')](handleEntityNotFound(_0x1d6c28,null))[_0x71b1('0x12')](function(_0x3245bb){if(!_0x3245bb[_0x71b1('0x41')])return;var _0x2d26ce=_0x3245bb[_0x71b1('0xb9')]();return respondWithRpcPromise(_0x71b1('0xba'),_0x71b1('0xbb'),{'account':_0x2d26ce});})[_0x71b1('0x12')](respondWithResult(_0x1d6c28,null))[_0x71b1('0x5e')](handleError(_0x1d6c28,null));};exports[_0x71b1('0x24')]=function(_0x2a2fbd,_0x4e174a){return db[_0x71b1('0x5a')][_0x71b1('0x62')]({'where':{'id':_0x2a2fbd[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x4e174a,null))[_0x71b1('0x12')](function(_0x1c4e50){if(_0x1c4e50&&_0x1c4e50[_0x71b1('0x3e')]){throw new db[(_0x71b1('0xbc'))][(_0x71b1('0xbd'))](_0x71b1('0xbe'));}return _0x1c4e50;})[_0x71b1('0x12')](removeEntity(_0x4e174a,null))[_0x71b1('0x5e')](handleError(_0x4e174a,null));};exports[_0x71b1('0xbf')]=function(_0x2715ac,_0x544724){return db['MailAccount'][_0x71b1('0x62')]({'where':{'id':_0x2715ac[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x544724,null))[_0x71b1('0x12')](function(_0x56f21d){if(_0x56f21d){return _0x56f21d[_0x71b1('0xbf')](_0x2715ac[_0x71b1('0x63')][_0x71b1('0x6f')],_[_0x71b1('0x87')](_0x2715ac[_0x71b1('0x63')],['ids','id'])||{})['spread'](function(_0x26942d){for(var _0x190216=0x0;_0x190216<_0x2715ac[_0x71b1('0x63')][_0x71b1('0x6f')][_0x71b1('0x61')];_0x190216+=0x1){socket[_0x71b1('0xc0')]('userMailAccount:save',{'UserId':Number(_0x2715ac[_0x71b1('0x63')]['ids'][_0x190216]),'MailAccountId':Number(_0x2715ac[_0x71b1('0x60')]['id'])});}return _0x26942d;});}})[_0x71b1('0x12')](respondWithResult(_0x544724,null))[_0x71b1('0x5e')](handleError(_0x544724,null));};exports[_0x71b1('0xc1')]=function(_0x36a17b,_0x4008f3){return db['MailAccount']['find']({'where':{'id':_0x36a17b[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x4008f3,null))[_0x71b1('0x12')](function(_0x54bc37){if(_0x54bc37){return _0x54bc37[_0x71b1('0xc1')](_0x36a17b[_0x71b1('0x4d')][_0x71b1('0x6f')])[_0x71b1('0x12')](function(){if(_[_0x71b1('0xc2')](_0x36a17b[_0x71b1('0x4d')][_0x71b1('0x6f')])){for(var _0xd823c2=0x0;_0xd823c2<_0x36a17b[_0x71b1('0x4d')][_0x71b1('0x6f')][_0x71b1('0x61')];_0xd823c2+=0x1){socket[_0x71b1('0xc0')](_0x71b1('0xc3'),{'UserId':Number(_0x36a17b[_0x71b1('0x4d')][_0x71b1('0x6f')][_0xd823c2]),'MailAccountId':Number(_0x36a17b[_0x71b1('0x60')]['id'])});}}else{socket['emit'](_0x71b1('0xc3'),{'UserId':Number(_0x36a17b['query'][_0x71b1('0x6f')]),'MailAccountId':Number(_0x36a17b[_0x71b1('0x60')]['id'])});}});}})[_0x71b1('0x12')](respondWithStatusCode(_0x4008f3,null))[_0x71b1('0x5e')](handleError(_0x4008f3,null));};exports[_0x71b1('0xc4')]=function(_0x5cb661,_0x9a4400){var _0x10f9aa={};var _0x1ebc47={};var _0x953846;var _0x581d69;return db['MailAccount'][_0x71b1('0x6c')]({'where':{'id':_0x5cb661[_0x71b1('0x60')]['id']}})[_0x71b1('0x12')](handleEntityNotFound(_0x9a4400,null))['then'](function(_0x3f7393){if(_0x3f7393){_0x953846=_0x3f7393;_0x1ebc47[_0x71b1('0x4b')]=_[_0x71b1('0x4c')](db[_0x71b1('0x8a')]['rawAttributes']);_0x1ebc47[_0x71b1('0x4d')]=_['keys'](_0x5cb661[_0x71b1('0x4d')]);_0x1ebc47['filters']=_[_0x71b1('0x4f')](_0x1ebc47[_0x71b1('0x4b')],_0x1ebc47[_0x71b1('0x4d')]);_0x10f9aa[_0x71b1('0x50')]=_[_0x71b1('0x4f')](_0x1ebc47[_0x71b1('0x4b')],qs[_0x71b1('0x51')](_0x5cb661[_0x71b1('0x4d')][_0x71b1('0x51')]));_0x10f9aa[_0x71b1('0x50')]=_0x10f9aa[_0x71b1('0x50')][_0x71b1('0x61')]?_0x10f9aa[_0x71b1('0x50')]:_0x1ebc47[_0x71b1('0x4b')];_0x10f9aa[_0x71b1('0x53')]=qs[_0x71b1('0x54')](_0x5cb661['query']['sort']);_0x10f9aa[_0x71b1('0x55')]=qs['filters'](_[_0x71b1('0x56')](_0x5cb661[_0x71b1('0x4d')],_0x1ebc47['filters']));if(_0x5cb661['query'][_0x71b1('0x57')]){_0x10f9aa[_0x71b1('0x55')]=_[_0x71b1('0x58')](_0x10f9aa[_0x71b1('0x55')],{'$or':_['map'](_0x10f9aa[_0x71b1('0x50')],function(_0xc2d8ac){var _0x3114a1={};_0x3114a1[_0xc2d8ac]={'$like':'%'+_0x5cb661[_0x71b1('0x4d')]['filter']+'%'};return _0x3114a1;})});}_0x10f9aa=_[_0x71b1('0x58')]({},_0x10f9aa,_0x5cb661[_0x71b1('0x59')]);return _0x953846[_0x71b1('0xc4')](_0x10f9aa);}})['then'](function(_0xb51971){if(_0xb51971){_0x581d69=_0xb51971[_0x71b1('0x61')];if(!_0x5cb661[_0x71b1('0x4d')][_0x71b1('0x72')](_0x71b1('0x52'))){_0x10f9aa['limit']=qs['limit'](_0x5cb661[_0x71b1('0x4d')]['limit']);_0x10f9aa[_0x71b1('0x21')]=qs[_0x71b1('0x21')](_0x5cb661['query']['offset']);}return _0x953846[_0x71b1('0xc4')](_0x10f9aa);}})[_0x71b1('0x12')](function(_0x2d24a1){if(_0x2d24a1){return _0x2d24a1?{'count':_0x581d69,'rows':_0x2d24a1}:null;}})['then'](respondWithResult(_0x9a4400,null))[_0x71b1('0x5e')](handleError(_0x9a4400,null));}; \ No newline at end of file +var _0x320b=['MailAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','show','keys','options','find','body','provider','secure','params','MailServerOut','Mail\x20Account\x20not\x20found','update','describe','addDisposition','Disposition','create','getDispositions','findOne','MailAccountId','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','getImap','addImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','hasOwnProperty','MailInteraction','User','Owner','Tag','color','tag','findAll','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','Contacts','defaults','ListId','messageId','attach','out','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','getAgents','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','json','destroy','get','MailAccounts','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','service','authentication','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','map'];(function(_0x3e6de5,_0x1e1c83){var _0x1a4d79=function(_0x61bb7a){while(--_0x61bb7a){_0x3e6de5['push'](_0x3e6de5['shift']());}};_0x1a4d79(++_0x1e1c83);}(_0x320b,0x137));var _0xb320=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x320b[_0x50007c];return _0x5c1ec7;};'use strict';var moment=require(_0xb320('0x0'));var BPromise=require(_0xb320('0x1'));var util=require(_0xb320('0x2'));var path=require('path');var _=require(_0xb320('0x3'));var juice=require('juice');var Redis=require(_0xb320('0x4'));var qs=require(_0xb320('0x5'));var logger=require(_0xb320('0x6'))(_0xb320('0x7'));var config=require(_0xb320('0x8'));var db=require('../../mysqldb')['db'];config[_0xb320('0x9')]=_['defaults'](config[_0xb320('0x9')],{'host':_0xb320('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb320('0x9')]));require(_0xb320('0xb'))[_0xb320('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x4b26fd,_0x428007,_0x3730c7,_0x39dbb5){return new BPromise(function(_0x35fb10,_0x566136){var _0x1c74b3=_0x39dbb5||client;return _0x1c74b3[_0xb320('0xd')](_0x4b26fd,_0x3730c7)[_0xb320('0xe')](function(_0x4f855c){logger[_0xb320('0xf')]('MailAccount,\x20%s,\x20%s',_0x428007,_0xb320('0x10'));logger[_0xb320('0x11')](_0xb320('0x12'),_0x428007,_0xb320('0x10'),JSON[_0xb320('0x13')](_0x4f855c));if(_0x4f855c[_0xb320('0x14')]){if(_0x4f855c[_0xb320('0x14')][_0xb320('0x15')]===0x1f4){logger[_0xb320('0x14')](_0xb320('0x16'),_0x428007,_0x4f855c[_0xb320('0x14')][_0xb320('0x17')]);return _0x566136(_0x4f855c['error'][_0xb320('0x17')]);}logger['error'](_0xb320('0x16'),_0x428007,_0x4f855c['error'][_0xb320('0x17')]);return _0x35fb10(_0x4f855c[_0xb320('0x14')][_0xb320('0x17')]);}else{logger[_0xb320('0xf')]('MailAccount,\x20%s,\x20%s',_0x428007,_0xb320('0x10'));_0x35fb10(_0x4f855c[_0xb320('0x18')]['message']);}})[_0xb320('0x19')](function(_0x5289f7){logger['error'](_0xb320('0x16'),_0x428007,_0x5289f7);_0x566136(_0x5289f7);});});}function respondWithStatusCode(_0x14dfb6,_0x4aa264){_0x4aa264=_0x4aa264||0xcc;return function(_0x54e005){if(_0x54e005){return _0x14dfb6[_0xb320('0x1a')](_0x4aa264);}return _0x14dfb6[_0xb320('0x1b')](_0x4aa264)['end']();};}function respondWithResult(_0x4230f7,_0x5c5977){_0x5c5977=_0x5c5977||0xc8;return function(_0x1105d3){if(_0x1105d3){return _0x4230f7[_0xb320('0x1b')](_0x5c5977)['json'](_0x1105d3);}};}function respondWithFilteredResult(_0x50c846,_0x117e38){return function(_0x415fb7){if(_0x415fb7){var _0x507adf=typeof _0x117e38[_0xb320('0x1c')]===_0xb320('0x1d')&&typeof _0x117e38[_0xb320('0x1e')]===_0xb320('0x1d');var _0x8637c5=_0x415fb7[_0xb320('0x1f')];var _0x2c4d75=_0x507adf?0x0:_0x117e38['offset'];var _0x541ab9=_0x507adf?_0x415fb7[_0xb320('0x1f')]:_0x117e38[_0xb320('0x1c')]+_0x117e38[_0xb320('0x1e')];var _0xcf0006;if(_0x541ab9>=_0x8637c5){_0x541ab9=_0x8637c5;_0xcf0006=0xc8;}else{_0xcf0006=0xce;}_0x50c846[_0xb320('0x1b')](_0xcf0006);return _0x50c846['set']('Content-Range',_0x2c4d75+'-'+_0x541ab9+'/'+_0x8637c5)[_0xb320('0x20')](_0x415fb7);}return null;};}function saveUpdates(_0x527123){return function(_0x3c0731){if(_0x3c0731){return _0x3c0731['update'](_0x527123)[_0xb320('0xe')](function(_0x18c9c6){return _0x18c9c6;});}return null;};}function removeEntity(_0x3eaff2){return function(_0x5769da){if(_0x5769da){return _0x5769da[_0xb320('0x21')]()[_0xb320('0xe')](function(){var _0x354113=_0x5769da[_0xb320('0x22')]({'plain':!![]});var _0x5efdfd=_0xb320('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efdfd,'resourceId':_0x354113['id']}})[_0xb320('0xe')](function(){return _0x5769da;});})[_0xb320('0xe')](function(){_0x3eaff2[_0xb320('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46ae42){return function(_0x2f726c){if(!_0x2f726c){_0x46ae42[_0xb320('0x1a')](0x194);}return _0x2f726c;};}function handleError(_0x552d03,_0x14dc88){_0x14dc88=_0x14dc88||0x1f4;return function(_0x59bdb3){logger['error'](_0x59bdb3[_0xb320('0x24')]);if(_0x59bdb3[_0xb320('0x25')]){delete _0x59bdb3[_0xb320('0x25')];}_0x552d03[_0xb320('0x1b')](_0x14dc88)[_0xb320('0x26')](_0x59bdb3);};}function getImapHost(_0x37eb87){switch(_0x37eb87){case'gmail':return _0xb320('0x27');case _0xb320('0x28'):return _0xb320('0x29');case _0xb320('0x2a'):return _0xb320('0x2b');case'outlook365':return _0xb320('0x2c');}throw new Error(_0xb320('0x2d'),_0x37eb87);}function getSmtpHost(_0x478899){switch(_0x478899){case _0xb320('0x2e'):return _0xb320('0x2f');case _0xb320('0x28'):return _0xb320('0x30');case _0xb320('0x2a'):return _0xb320('0x31');case _0xb320('0x32'):return _0xb320('0x33');}throw new Error(_0xb320('0x2d'),_0x478899);}function getAuthenticationOptions(_0x2ab695,_0x3ec88c){var _0x3a41e4={};var _0x5a7384={};if(_0x2ab695){_0x3a41e4[_0xb320('0x34')]=_0x5a7384['user']=_0x3ec88c[_0xb320('0x35')];_0x3a41e4[_0xb320('0x36')]=_0x5a7384[_0xb320('0x37')]=_0x3ec88c[_0xb320('0x36')];if(_0x3ec88c['modernAuthentication']){_0x3a41e4[_0xb320('0x38')]=_0x5a7384[_0xb320('0x38')]=!![];_0x3a41e4[_0xb320('0x39')]=_0x5a7384[_0xb320('0x39')]=_0x3ec88c[_0xb320('0x39')];_0x3a41e4[_0xb320('0x36')]=_0x5a7384['pass']=null;}else{_0x3a41e4[_0xb320('0x39')]=_0x5a7384[_0xb320('0x39')]=null;}_0x3a41e4['host']=getImapHost(_0x2ab695);_0x3a41e4[_0xb320('0x3a')]=0x3e1;_0x5a7384[_0xb320('0x3b')]=getSmtpHost(_0x2ab695);_0x5a7384[_0xb320('0x3a')]=0x24b;_0x5a7384['secure']=![];_0x3a41e4['service']=_0x5a7384[_0xb320('0x3c')]=null;}else{if(_0x3ec88c[_0xb320('0x3d')]){_0x3a41e4[_0xb320('0x34')]=_0x5a7384[_0xb320('0x34')]=_0x3ec88c['username'];_0x3a41e4[_0xb320('0x36')]=_0x5a7384['pass']=_0x3ec88c[_0xb320('0x36')];}else{_0x3a41e4[_0xb320('0x3d')]=_0x5a7384['authentication']=![];_0x3a41e4['user']=_0x5a7384[_0xb320('0x34')]=null;_0x3a41e4[_0xb320('0x36')]=_0x5a7384[_0xb320('0x37')]=null;}_0x3a41e4[_0xb320('0x3b')]=_0x3ec88c['Imap']['host'];_0x3a41e4[_0xb320('0x3a')]=_0x3ec88c[_0xb320('0x3e')][_0xb320('0x3a')];_0x5a7384['host']=_0x3ec88c[_0xb320('0x3f')][_0xb320('0x3b')];_0x5a7384[_0xb320('0x3a')]=_0x3ec88c[_0xb320('0x3f')]['port'];}return{'Imap':_0x3a41e4,'Smtp':_0x5a7384};}exports[_0xb320('0x40')]=function(_0x1f8769,_0x8d55b6){var _0x22f14f={'include':[{'model':db[_0xb320('0x41')],'as':_0xb320('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xb320('0x42')],'as':_0xb320('0x43')}]},_0x5ee901={},_0x21d6da={'count':0x0,'rows':[]};var _0x444e96=_[_0xb320('0x44')](db[_0xb320('0x45')][_0xb320('0x46')],function(_0xd65d01){return{'name':_0xd65d01[_0xb320('0x47')],'type':_0xd65d01[_0xb320('0x48')][_0xb320('0x49')]};});_0x5ee901['model']=_[_0xb320('0x44')](_0x444e96,_0xb320('0x25'));_0x5ee901[_0xb320('0x4a')]=_['keys'](_0x1f8769[_0xb320('0x4a')]);_0x5ee901[_0xb320('0x4b')]=_[_0xb320('0x4c')](_0x5ee901[_0xb320('0x4d')],_0x5ee901[_0xb320('0x4a')]);_0x22f14f[_0xb320('0x4e')]=_[_0xb320('0x4c')](_0x5ee901['model'],qs[_0xb320('0x4f')](_0x1f8769['query'][_0xb320('0x4f')]));_0x22f14f['attributes']=_0x22f14f[_0xb320('0x4e')][_0xb320('0x50')]?_0x22f14f['attributes']:_0x5ee901[_0xb320('0x4d')];if(!_0x1f8769['query']['hasOwnProperty'](_0xb320('0x51'))){_0x22f14f[_0xb320('0x1e')]=qs[_0xb320('0x1e')](_0x1f8769[_0xb320('0x4a')][_0xb320('0x1e')]);_0x22f14f[_0xb320('0x1c')]=qs[_0xb320('0x1c')](_0x1f8769[_0xb320('0x4a')][_0xb320('0x1c')]);}_0x22f14f[_0xb320('0x52')]=qs['sort'](_0x1f8769[_0xb320('0x4a')][_0xb320('0x53')]);_0x22f14f[_0xb320('0x54')]=qs[_0xb320('0x4b')](_[_0xb320('0x55')](_0x1f8769[_0xb320('0x4a')],_0x5ee901[_0xb320('0x4b')]),_0x444e96);if(_0x1f8769[_0xb320('0x4a')][_0xb320('0x56')]){_0x22f14f['where']=_['merge'](_0x22f14f[_0xb320('0x54')],{'$or':_['map'](_0x444e96,function(_0x1e739f){if(_0x1e739f[_0xb320('0x48')]!==_0xb320('0x57')){var _0x3362c9={};_0x3362c9[_0x1e739f['name']]={'$like':'%'+_0x1f8769[_0xb320('0x4a')]['filter']+'%'};return _0x3362c9;}})});}_0x22f14f=_[_0xb320('0x58')]({},_0x22f14f,_0x1f8769['options']);var _0x493b95={'where':_0x22f14f[_0xb320('0x54')]};return db[_0xb320('0x45')][_0xb320('0x1f')](_0x493b95)[_0xb320('0xe')](function(_0x405b23){_0x21d6da[_0xb320('0x1f')]=_0x405b23;if(_0x1f8769['query']['includeAll']){_0x22f14f[_0xb320('0x59')]=[{'all':!![]}];}return db[_0xb320('0x45')]['findAll'](_0x22f14f);})['then'](function(_0x572a0a){_0x21d6da['rows']=_0x572a0a;return _0x21d6da;})[_0xb320('0xe')](respondWithFilteredResult(_0x8d55b6,_0x22f14f))[_0xb320('0x19')](handleError(_0x8d55b6,null));};exports[_0xb320('0x5a')]=function(_0x542eb6,_0xd11633){var _0x215ce1={'raw':![],'where':{'id':_0x542eb6['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xb320('0x3e')},{'model':db['MailServerOut'],'as':_0xb320('0x3f')},{'model':db['Pause'],'as':_0xb320('0x43')}]},_0x1da662={};_0x1da662['model']=_[_0xb320('0x5b')](db['MailAccount'][_0xb320('0x46')]);_0x1da662[_0xb320('0x4a')]=_[_0xb320('0x5b')](_0x542eb6['query']);_0x1da662['filters']=_['intersection'](_0x1da662[_0xb320('0x4d')],_0x1da662[_0xb320('0x4a')]);_0x215ce1[_0xb320('0x4e')]=_['intersection'](_0x1da662[_0xb320('0x4d')],qs['fields'](_0x542eb6[_0xb320('0x4a')][_0xb320('0x4f')]));_0x215ce1[_0xb320('0x4e')]=_0x215ce1[_0xb320('0x4e')]['length']?_0x215ce1[_0xb320('0x4e')]:_0x1da662[_0xb320('0x4d')];if(_0x542eb6[_0xb320('0x4a')]['includeAll']){_0x215ce1[_0xb320('0x59')]=[{'all':!![]}];}_0x215ce1=_[_0xb320('0x58')]({},_0x215ce1,_0x542eb6[_0xb320('0x5c')]);return db[_0xb320('0x45')][_0xb320('0x5d')](_0x215ce1)[_0xb320('0xe')](handleEntityNotFound(_0xd11633,null))[_0xb320('0xe')](respondWithResult(_0xd11633,null))[_0xb320('0x19')](handleError(_0xd11633,null));};exports['update']=function(_0x1af4ca,_0x3777fb){if(_0x1af4ca[_0xb320('0x5e')]['id']){delete _0x1af4ca['body']['id'];}var _0x2d61c3=_0x1af4ca[_0xb320('0x5e')][_0xb320('0x5f')]==='custom'?null:_0x1af4ca[_0xb320('0x5e')][_0xb320('0x5f')];var _0xcc4c40=_0x1af4ca[_0xb320('0x5e')][_0xb320('0x3e')]||{};var _0x29bbc2=_0x1af4ca[_0xb320('0x5e')]['Smtp']||{};if(_0x2d61c3){_0xcc4c40[_0xb320('0x3b')]=getImapHost(_0x2d61c3);_0xcc4c40[_0xb320('0x3a')]=0x3e1;_0x29bbc2[_0xb320('0x3b')]=getSmtpHost(_0x2d61c3);_0x29bbc2[_0xb320('0x3a')]=0x24b;_0x29bbc2[_0xb320('0x60')]=![];}if(_0x29bbc2['modernAuthentication']){_0x29bbc2[_0xb320('0x60')]=![];}else{_0x29bbc2[_0xb320('0x39')]=null;}if(!_0xcc4c40[_0xb320('0x38')])_0xcc4c40['CloudProviderId']=null;_0x1af4ca[_0xb320('0x5e')][_0xb320('0x3e')]=_0xcc4c40;_0x1af4ca[_0xb320('0x5e')][_0xb320('0x3f')]=_0x29bbc2;return db[_0xb320('0x45')][_0xb320('0x5d')]({'where':{'id':_0x1af4ca[_0xb320('0x61')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xb320('0x3e')},{'model':db[_0xb320('0x62')],'as':'Smtp'},{'model':db['Pause'],'as':_0xb320('0x43')}]})[_0xb320('0xe')](handleEntityNotFound(_0x3777fb,null))[_0xb320('0xe')](function(_0x54e4cf){if(!_0x54e4cf)throw new Error(_0xb320('0x63'));if(_0x54e4cf[_0xb320('0x3c')])delete _0x1af4ca[_0xb320('0x5e')]['Imap'];return _0x54e4cf;})['then'](saveUpdates(_0x1af4ca['body'],null))[_0xb320('0xe')](function(_0xfb042e){if(!_0x1af4ca[_0xb320('0x5e')][_0xb320('0x3e')])return _0xfb042e;return db[_0xb320('0x41')][_0xb320('0x64')](_0x1af4ca[_0xb320('0x5e')][_0xb320('0x3e')],{'where':{'MailAccountId':_0xfb042e['id']}})[_0xb320('0xe')](function(){return _0xfb042e;});})[_0xb320('0xe')](function(_0x58567d){if(!_0x1af4ca['body'][_0xb320('0x3f')])return _0x58567d;return db['MailServerOut'][_0xb320('0x64')](_0x1af4ca[_0xb320('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x58567d['id']}})[_0xb320('0xe')](function(){return _0x58567d;});})[_0xb320('0xe')](respondWithResult(_0x3777fb,null))[_0xb320('0x19')](handleError(_0x3777fb,null));};exports[_0xb320('0x65')]=function(_0x121c26,_0x31fed2){return db[_0xb320('0x45')]['describe']()['then'](respondWithResult(_0x31fed2,null))[_0xb320('0x19')](handleError(_0x31fed2,null));};exports[_0xb320('0x66')]=function(_0x46bf76,_0x3a535e){if(_0x46bf76[_0xb320('0x5e')]['id']){delete _0x46bf76[_0xb320('0x5e')]['id'];}return db[_0xb320('0x45')]['find']({'where':{'id':_0x46bf76[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x3a535e,null))[_0xb320('0xe')](function(_0x32c789){if(_0x32c789){_0x46bf76['body']['MailAccountId']=_0x32c789['id'];return db[_0xb320('0x67')][_0xb320('0x68')](_0x46bf76[_0xb320('0x5e')]);}})[_0xb320('0xe')](respondWithResult(_0x3a535e,null))[_0xb320('0x19')](handleError(_0x3a535e,null));};exports[_0xb320('0x69')]=function(_0x3bd48a,_0x57da75){var _0x1aceea={'raw':![],'where':{}};var _0x62acc4={};var _0x270e77={'count':0x0,'rows':[]};return db[_0xb320('0x45')][_0xb320('0x6a')]({'where':{'id':_0x3bd48a[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x57da75,null))[_0xb320('0xe')](function(_0x4f3040){if(_0x4f3040){_0x62acc4[_0xb320('0x4d')]=_['keys'](db[_0xb320('0x67')]['rawAttributes']);_0x62acc4[_0xb320('0x4a')]=_[_0xb320('0x5b')](_0x3bd48a[_0xb320('0x4a')]);_0x62acc4[_0xb320('0x4b')]=_[_0xb320('0x4c')](_0x62acc4[_0xb320('0x4d')],_0x62acc4[_0xb320('0x4a')]);_0x1aceea['attributes']=_[_0xb320('0x4c')](_0x62acc4[_0xb320('0x4d')],qs[_0xb320('0x4f')](_0x3bd48a[_0xb320('0x4a')][_0xb320('0x4f')]));_0x1aceea[_0xb320('0x4e')]=_0x1aceea[_0xb320('0x4e')][_0xb320('0x50')]?_0x1aceea['attributes']:_0x62acc4[_0xb320('0x4d')];if(!_0x3bd48a[_0xb320('0x4a')]['hasOwnProperty']('nolimit')){_0x1aceea[_0xb320('0x1e')]=qs['limit'](_0x3bd48a[_0xb320('0x4a')][_0xb320('0x1e')]);_0x1aceea[_0xb320('0x1c')]=qs[_0xb320('0x1c')](_0x3bd48a[_0xb320('0x4a')][_0xb320('0x1c')]);}_0x1aceea[_0xb320('0x52')]=qs[_0xb320('0x53')](_0x3bd48a['query'][_0xb320('0x53')]);_0x1aceea['where']=qs[_0xb320('0x4b')](_['pick'](_0x3bd48a[_0xb320('0x4a')],_0x62acc4['filters']));_0x1aceea['where'][_0xb320('0x6b')]=_0x4f3040['id'];if(_0x3bd48a[_0xb320('0x4a')][_0xb320('0x56')]){_0x1aceea['where']=_[_0xb320('0x58')](_0x1aceea[_0xb320('0x54')],{'$or':_[_0xb320('0x44')](_0x1aceea[_0xb320('0x4e')],function(_0x194fc6){var _0x45b75f={};_0x45b75f[_0x194fc6]={'$like':'%'+_0x3bd48a[_0xb320('0x4a')]['filter']+'%'};return _0x45b75f;})});}_0x1aceea=_['merge']({},_0x1aceea,_0x3bd48a['options']);return db[_0xb320('0x67')]['count']({'where':_0x1aceea[_0xb320('0x54')]})[_0xb320('0xe')](function(_0x283b32){_0x270e77['count']=_0x283b32;if(_0x3bd48a[_0xb320('0x4a')][_0xb320('0x6c')]){_0x1aceea['include']=[{'all':!![]}];}return db[_0xb320('0x67')]['findAll'](_0x1aceea);})[_0xb320('0xe')](function(_0x2c52c3){_0x270e77[_0xb320('0x6d')]=_0x2c52c3;return _0x270e77;});}})['then'](respondWithFilteredResult(_0x57da75,_0x1aceea))['catch'](handleError(_0x57da75,null));};exports[_0xb320('0x6e')]=function(_0x197bc7,_0x291029){return db[_0xb320('0x45')]['find']({'where':{'id':_0x197bc7['params']['id']}})['then'](handleEntityNotFound(_0x291029,null))[_0xb320('0xe')](function(_0x262fd1){if(_0x262fd1){return _0x262fd1[_0xb320('0x6e')](_0x197bc7['query'][_0xb320('0x6f')]);}})[_0xb320('0xe')](respondWithStatusCode(_0x291029,null))[_0xb320('0x19')](handleError(_0x291029,null));};exports[_0xb320('0x70')]=function(_0x5421d7,_0x3ebb71){if(_0x5421d7[_0xb320('0x5e')]['id']){delete _0x5421d7[_0xb320('0x5e')]['id'];}return db[_0xb320('0x45')][_0xb320('0x5d')]({'where':{'id':_0x5421d7[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x3ebb71,null))['then'](function(_0x286ff8){if(_0x286ff8){_0x5421d7[_0xb320('0x5e')]['MailAccountId']=_0x286ff8['id'];return db[_0xb320('0x71')][_0xb320('0x68')](_0x5421d7[_0xb320('0x5e')]);}})['then'](respondWithResult(_0x3ebb71,null))[_0xb320('0x19')](handleError(_0x3ebb71,null));};exports[_0xb320('0x72')]=function(_0x2fa173,_0x15ec80){var _0xd717d1={'raw':![],'where':{}};var _0x4cf81a={};var _0x20be41={'count':0x0,'rows':[]};return db[_0xb320('0x45')]['findOne']({'where':{'id':_0x2fa173['params']['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x15ec80,null))[_0xb320('0xe')](function(_0x200392){if(_0x200392){_0x4cf81a[_0xb320('0x4d')]=_[_0xb320('0x5b')](db['CannedAnswer'][_0xb320('0x46')]);_0x4cf81a[_0xb320('0x4a')]=_[_0xb320('0x5b')](_0x2fa173[_0xb320('0x4a')]);_0x4cf81a[_0xb320('0x4b')]=_[_0xb320('0x4c')](_0x4cf81a['model'],_0x4cf81a[_0xb320('0x4a')]);_0xd717d1[_0xb320('0x4e')]=_[_0xb320('0x4c')](_0x4cf81a[_0xb320('0x4d')],qs[_0xb320('0x4f')](_0x2fa173[_0xb320('0x4a')][_0xb320('0x4f')]));_0xd717d1['attributes']=_0xd717d1[_0xb320('0x4e')][_0xb320('0x50')]?_0xd717d1[_0xb320('0x4e')]:_0x4cf81a[_0xb320('0x4d')];if(!_0x2fa173[_0xb320('0x4a')]['hasOwnProperty'](_0xb320('0x51'))){_0xd717d1[_0xb320('0x1e')]=qs[_0xb320('0x1e')](_0x2fa173[_0xb320('0x4a')][_0xb320('0x1e')]);_0xd717d1[_0xb320('0x1c')]=qs['offset'](_0x2fa173['query'][_0xb320('0x1c')]);}_0xd717d1[_0xb320('0x52')]=qs[_0xb320('0x53')](_0x2fa173[_0xb320('0x4a')][_0xb320('0x53')]);_0xd717d1[_0xb320('0x54')]=qs[_0xb320('0x4b')](_[_0xb320('0x55')](_0x2fa173[_0xb320('0x4a')],_0x4cf81a[_0xb320('0x4b')]));_0xd717d1[_0xb320('0x54')][_0xb320('0x6b')]=_0x200392['id'];if(_0x2fa173['query'][_0xb320('0x56')]){_0xd717d1[_0xb320('0x54')]=_[_0xb320('0x58')](_0xd717d1[_0xb320('0x54')],{'$or':_['map'](_0xd717d1[_0xb320('0x4e')],function(_0x457e03){var _0x382398={};_0x382398[_0x457e03]={'$like':'%'+_0x2fa173[_0xb320('0x4a')]['filter']+'%'};return _0x382398;})});}_0xd717d1=_['merge']({},_0xd717d1,_0x2fa173[_0xb320('0x5c')]);return db[_0xb320('0x71')][_0xb320('0x1f')]({'where':_0xd717d1['where']})['then'](function(_0x37e6af){_0x20be41[_0xb320('0x1f')]=_0x37e6af;if(_0x2fa173['query'][_0xb320('0x6c')]){_0xd717d1['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xd717d1);})[_0xb320('0xe')](function(_0xc7b386){_0x20be41[_0xb320('0x6d')]=_0xc7b386;return _0x20be41;});}})[_0xb320('0xe')](respondWithFilteredResult(_0x15ec80,_0xd717d1))[_0xb320('0x19')](handleError(_0x15ec80,null));};exports[_0xb320('0x73')]=function(_0x224107,_0x4bb3a5){return db[_0xb320('0x45')]['find']({'where':{'id':_0x224107[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x4bb3a5,null))['then'](function(_0x2b729b){if(_0x2b729b){return _0x2b729b[_0xb320('0x73')](_0x224107[_0xb320('0x4a')][_0xb320('0x6f')]);}})[_0xb320('0xe')](respondWithStatusCode(_0x4bb3a5,null))[_0xb320('0x19')](handleError(_0x4bb3a5,null));};exports[_0xb320('0x68')]=function(_0x563a6c,_0x4dafc6){var _0x1e0505={'name':_0x563a6c[_0xb320('0x5e')][_0xb320('0x25')],'key':_0x563a6c['body'][_0xb320('0x49')],'provider':_0x563a6c[_0xb320('0x5e')][_0xb320('0x5f')]==='custom'?null:_0x563a6c[_0xb320('0x5e')][_0xb320('0x5f')],'email':_0x563a6c[_0xb320('0x5e')][_0xb320('0x74')],'ListId':_0x563a6c[_0xb320('0x5e')]['ListId'],'active':!_[_0xb320('0x75')](_0x563a6c[_0xb320('0x5e')][_0xb320('0x76')])?_0x563a6c[_0xb320('0x5e')][_0xb320('0x76')]:!![],'description':_0x563a6c[_0xb320('0x5e')]['description']||null};var _0x5cce08=getAuthenticationOptions(_0x1e0505[_0xb320('0x5f')],_0x563a6c['body']);_0x1e0505[_0xb320('0x3e')]=_0x5cce08[_0xb320('0x3e')];_0x1e0505['Smtp']=_0x5cce08[_0xb320('0x3f')];return db['MailAccount'][_0xb320('0x68')](_0x1e0505,{'include':[{'model':db[_0xb320('0x62')],'as':_0xb320('0x3f')},{'model':db[_0xb320('0x41')],'as':_0xb320('0x3e')}]})[_0xb320('0xe')](function(_0x224e35){var _0x3b2d95=_0x563a6c['user'][_0xb320('0x22')]({'plain':!![]});if(!_0x3b2d95)throw new Error(_0xb320('0x77'));if(_0x3b2d95[_0xb320('0x78')]===_0xb320('0x34')){var _0x385c21=_0x224e35[_0xb320('0x22')]({'plain':!![]});return db['UserProfileSection'][_0xb320('0x5d')]({'where':{'name':'MailAccounts','userProfileId':_0x3b2d95['userProfileId']},'raw':!![]})[_0xb320('0xe')](function(_0x3b45ae){if(_0x3b45ae&&_0x3b45ae['autoAssociation']===0x0){return db[_0xb320('0x79')][_0xb320('0x68')]({'name':_0x385c21[_0xb320('0x25')],'resourceId':_0x385c21['id'],'type':_0x3b45ae['name'],'sectionId':_0x3b45ae['id']},{})['then'](function(){return _0x224e35;});}else{return _0x224e35;}})[_0xb320('0x19')](function(_0x31ff76){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31ff76);throw _0x31ff76;});}return _0x224e35;})[_0xb320('0xe')](respondWithResult(_0x4dafc6,0xc9))[_0xb320('0x19')](handleError(_0x4dafc6,null));};exports[_0xb320('0x7a')]=function(_0x56f03d,_0x23bf34){return db[_0xb320('0x45')][_0xb320('0x6a')]({'where':{'id':_0x56f03d[_0xb320('0x61')]['id']}})['then'](handleEntityNotFound(_0x23bf34,null))[_0xb320('0xe')](function(_0x1728ab){if(_0x1728ab){return _0x1728ab[_0xb320('0x7a')]();}return null;})[_0xb320('0xe')](respondWithResult(_0x23bf34,null))[_0xb320('0x19')](handleError(_0x23bf34,null));};exports[_0xb320('0x7b')]=function(_0x28cca7,_0x2d3176){if(_0x28cca7['body']['id']){delete _0x28cca7[_0xb320('0x5e')]['id'];}return db[_0xb320('0x45')][_0xb320('0x5d')]({'where':{'id':_0x28cca7[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x2d3176,null))['then'](function(_0x250990){if(_0x250990){_0x28cca7[_0xb320('0x5e')][_0xb320('0x6b')]=_0x250990['id'];return db[_0xb320('0x41')][_0xb320('0x68')](_0x28cca7[_0xb320('0x5e')]);}})[_0xb320('0xe')](respondWithResult(_0x2d3176,null))[_0xb320('0x19')](handleError(_0x2d3176,null));};exports['removeImap']=function(_0x5e2c1e,_0x1587b2){return db[_0xb320('0x45')][_0xb320('0x6a')]({'where':{'id':_0x5e2c1e[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x1587b2,null))['then'](function(_0x420ec9){if(_0x420ec9){return _0x420ec9[_0xb320('0x7c')](null);}return null;})[_0xb320('0xe')](respondWithStatusCode(_0x1587b2,null))[_0xb320('0x19')](handleError(_0x1587b2,null));};exports[_0xb320('0x7d')]=function(_0x4351b0,_0x51e48c){return db['MailAccount'][_0xb320('0x6a')]({'where':{'id':_0x4351b0[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x51e48c,null))['then'](function(_0x128c6e){if(_0x128c6e){return _0x128c6e['getSmtp']();}return null;})[_0xb320('0xe')](respondWithResult(_0x51e48c,null))[_0xb320('0x19')](handleError(_0x51e48c,null));};exports['addSmtp']=function(_0x2eaa2c,_0x370d4f){if(_0x2eaa2c[_0xb320('0x5e')]['id']){delete _0x2eaa2c[_0xb320('0x5e')]['id'];}return db[_0xb320('0x45')][_0xb320('0x5d')]({'where':{'id':_0x2eaa2c['params']['id']}})['then'](handleEntityNotFound(_0x370d4f,null))[_0xb320('0xe')](function(_0x1b2110){if(_0x1b2110){_0x2eaa2c[_0xb320('0x5e')][_0xb320('0x6b')]=_0x1b2110['id'];return db[_0xb320('0x62')]['create'](_0x2eaa2c[_0xb320('0x5e')]);}})[_0xb320('0xe')](respondWithResult(_0x370d4f,null))[_0xb320('0x19')](handleError(_0x370d4f,null));};exports[_0xb320('0x7e')]=function(_0x4cf97b,_0x6e4e42){return db['MailAccount'][_0xb320('0x6a')]({'where':{'id':_0x4cf97b['params']['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x6e4e42,null))['then'](function(_0xef8fc){if(_0xef8fc){return _0xef8fc[_0xb320('0x7f')](null);}return null;})[_0xb320('0xe')](respondWithStatusCode(_0x6e4e42,null))[_0xb320('0x19')](handleError(_0x6e4e42,null));};exports[_0xb320('0x80')]=function(_0x24e70d,_0x1127de){return db['MailInteraction'][_0xb320('0x5d')]({'where':{'id':_0x24e70d['params']['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x1127de,null))['then'](function(_0x2c2df5){if(_0x2c2df5){return _0x2c2df5['addInteraction'](_0x24e70d['body']['ids'],_[_0xb320('0x81')](_0x24e70d['body'],['ids','id'])||{});}})[_0xb320('0xe')](respondWithResult(_0x1127de,null))[_0xb320('0x19')](handleError(_0x1127de,null));};exports[_0xb320('0x82')]=function(_0x4e5722,_0x4813a5){var _0x23d27b={'raw':![],'where':{}};var _0x1dab60={};var _0x5614d4={'count':0x0,'rows':[]};return db[_0xb320('0x45')][_0xb320('0x6a')]({'where':{'id':_0x4e5722[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x4813a5,null))[_0xb320('0xe')](function(_0x4e27d5){if(_0x4e27d5){_0x1dab60[_0xb320('0x4d')]=_[_0xb320('0x5b')](db['MailInteraction'][_0xb320('0x46')]);_0x1dab60[_0xb320('0x4a')]=_[_0xb320('0x5b')](_0x4e5722[_0xb320('0x4a')]);_0x1dab60[_0xb320('0x4b')]=_[_0xb320('0x4c')](_0x1dab60[_0xb320('0x4d')],_0x1dab60['query']);_0x23d27b[_0xb320('0x4e')]=_['intersection'](_0x1dab60[_0xb320('0x4d')],qs[_0xb320('0x4f')](_0x4e5722[_0xb320('0x4a')][_0xb320('0x4f')]));_0x23d27b[_0xb320('0x4e')]=_0x23d27b['attributes'][_0xb320('0x50')]?_0x23d27b[_0xb320('0x4e')]:_0x1dab60['model'];if(!_0x4e5722[_0xb320('0x4a')][_0xb320('0x83')](_0xb320('0x51'))){_0x23d27b[_0xb320('0x1e')]=qs[_0xb320('0x1e')](_0x4e5722['query'][_0xb320('0x1e')]);_0x23d27b[_0xb320('0x1c')]=qs['offset'](_0x4e5722[_0xb320('0x4a')][_0xb320('0x1c')]);}_0x23d27b[_0xb320('0x52')]=qs[_0xb320('0x53')](_0x4e5722[_0xb320('0x4a')]['sort']);_0x23d27b[_0xb320('0x54')]=qs['filters'](_[_0xb320('0x55')](_0x4e5722['query'],_0x1dab60[_0xb320('0x4b')]));_0x23d27b['where'][_0xb320('0x6b')]=_0x4e27d5['id'];if(_0x4e5722[_0xb320('0x4a')][_0xb320('0x56')]){_0x23d27b[_0xb320('0x54')]=_['merge'](_0x23d27b[_0xb320('0x54')],{'$or':_['map'](_0x23d27b['attributes'],function(_0x46594c){var _0x327dd1={};_0x327dd1[_0x46594c]={'$like':'%'+_0x4e5722[_0xb320('0x4a')]['filter']+'%'};return _0x327dd1;})});}_0x23d27b=_[_0xb320('0x58')]({},_0x23d27b,_0x4e5722[_0xb320('0x5c')]);return db[_0xb320('0x84')]['count']({'where':_0x23d27b[_0xb320('0x54')]})['then'](function(_0x64606f){_0x5614d4['count']=_0x64606f;if(_0x4e5722['query']['includeAll']){_0x23d27b[_0xb320('0x59')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xb320('0x85')],'as':_0xb320('0x86'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xb320('0x87')],'as':'Tags','attributes':['id','name',_0xb320('0x88')],'where':_0x4e5722[_0xb320('0x4a')][_0xb320('0x89')]?{'id':_0x4e5722['query'][_0xb320('0x89')]}:undefined,'required':_0x4e5722[_0xb320('0x4a')][_0xb320('0x89')]?!![]:![]}];}return db['MailInteraction'][_0xb320('0x8a')](_0x23d27b);})[_0xb320('0xe')](function(_0x1522b9){_0x5614d4[_0xb320('0x6d')]=_0x1522b9;return _0x5614d4;});}})[_0xb320('0xe')](respondWithFilteredResult(_0x4813a5,_0x23d27b))[_0xb320('0x19')](handleError(_0x4813a5,null));};exports[_0xb320('0x8b')]=function addApplications(_0x2d2c00,_0x3be9f0){var _0xfc6d3a=_0x2d2c00[_0xb320('0x61')]['id'];var _0x3341f8=_0x2d2c00[_0xb320('0x5e')];var _0x27890d=0xc8;var _0x331b0f=null;return db[_0xb320('0x8c')]['transaction']({'isolationLevel':db[_0xb320('0x8c')][_0xb320('0x8d')][_0xb320('0x8e')][_0xb320('0x8f')]},function(_0x2f6585){return db[_0xb320('0x45')]['findOne']({'where':{'id':_0xfc6d3a},'transaction':_0x2f6585})['then'](function(_0x5e8876){if(_0x5e8876){return db[_0xb320('0x90')][_0xb320('0x21')]({'where':{'MailAccountId':_0xfc6d3a},'transaction':_0x2f6585})[_0xb320('0xe')](function(){var _0x3f5f71=_['map'](_0x3341f8,function(_0x110105){_0x110105[_0xb320('0x6b')]=_0xfc6d3a;return _0x110105;});return db[_0xb320('0x90')]['bulkCreate'](_0x3f5f71,{'transaction':_0x2f6585});});}else{_0x27890d=0x194;_0x331b0f=[];}});})['then'](function(){if(_0x27890d!==0x194){return db[_0xb320('0x90')]['findAndCountAll']({'where':{'MailAccountId':_0xfc6d3a},'order':_0xb320('0x91')})[_0xb320('0xe')](function(_0x5abf1f){_0x331b0f=_0x5abf1f;});}})['catch'](function(_0x29dc3e){_0x27890d=0x1f4;logger[_0xb320('0x14')](_0x29dc3e[_0xb320('0x24')]);if(_0x29dc3e['name']){delete _0x29dc3e[_0xb320('0x25')];}_0x331b0f=_0x29dc3e;})[_0xb320('0x92')](function(){if(_0x331b0f===null){_0x3be9f0[_0xb320('0x1a')](_0x27890d);}else{if(_0x27890d===0x1f4){_0x3be9f0[_0xb320('0x1b')](_0x27890d)[_0xb320('0x26')](_0x331b0f);}else{_0x3be9f0[_0xb320('0x1b')](_0x27890d)[_0xb320('0x20')](_0x331b0f);}}});};exports[_0xb320('0x93')]=function(_0x50f0f5,_0x373bd0){var _0x50b6ba={};var _0x273d5f={};var _0x1efc7f;var _0x107ff8;return db[_0xb320('0x45')][_0xb320('0x6a')]({'where':{'id':_0x50f0f5[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x373bd0,null))[_0xb320('0xe')](function(_0x1389ba){if(_0x1389ba){_0x1efc7f=_0x1389ba;_0x273d5f[_0xb320('0x4d')]=_[_0xb320('0x5b')](db[_0xb320('0x90')][_0xb320('0x46')]);_0x273d5f[_0xb320('0x4a')]=_[_0xb320('0x5b')](_0x50f0f5[_0xb320('0x4a')]);_0x273d5f[_0xb320('0x4b')]=_[_0xb320('0x4c')](_0x273d5f[_0xb320('0x4d')],_0x273d5f[_0xb320('0x4a')]);_0x50b6ba[_0xb320('0x4e')]=_[_0xb320('0x4c')](_0x273d5f[_0xb320('0x4d')],qs[_0xb320('0x4f')](_0x50f0f5[_0xb320('0x4a')]['fields']));_0x50b6ba[_0xb320('0x4e')]=_0x50b6ba['attributes'][_0xb320('0x50')]?_0x50b6ba[_0xb320('0x4e')]:_0x273d5f['model'];_0x50b6ba[_0xb320('0x52')]=qs['sort'](_0x50f0f5['query']['sort']);_0x50b6ba[_0xb320('0x54')]=qs['filters'](_[_0xb320('0x55')](_0x50f0f5[_0xb320('0x4a')],_0x273d5f[_0xb320('0x4b')]));if(_0x50f0f5['query'][_0xb320('0x56')]){_0x50b6ba[_0xb320('0x54')]=_[_0xb320('0x58')](_0x50b6ba['where'],{'$or':_[_0xb320('0x44')](_0x50b6ba[_0xb320('0x4e')],function(_0x156d27){var _0x340669={};_0x340669[_0x156d27]={'$like':'%'+_0x50f0f5[_0xb320('0x4a')][_0xb320('0x56')]+'%'};return _0x340669;})});}_0x50b6ba=_['merge']({},_0x50b6ba,_0x50f0f5['options']);return _0x1efc7f['getApplications'](_0x50b6ba);}})[_0xb320('0xe')](function(_0x35b254){if(_0x35b254){_0x107ff8=_0x35b254['length'];if(!_0x50f0f5[_0xb320('0x4a')]['hasOwnProperty'](_0xb320('0x51'))){_0x50b6ba[_0xb320('0x1e')]=qs['limit'](_0x50f0f5[_0xb320('0x4a')][_0xb320('0x1e')]);_0x50b6ba[_0xb320('0x1c')]=qs[_0xb320('0x1c')](_0x50f0f5[_0xb320('0x4a')][_0xb320('0x1c')]);}return _0x1efc7f['getApplications'](_0x50b6ba);}})[_0xb320('0xe')](function(_0x22174c){if(_0x22174c){return _0x22174c?{'count':_0x107ff8,'rows':_0x22174c}:null;}})['then'](respondWithResult(_0x373bd0,null))['catch'](handleError(_0x373bd0,null));};exports[_0xb320('0x94')]=function(_0x424f08,_0x4acd66){var _0x3c49be={'raw':!![],'where':{}};var _0x29bb64={};var _0x5f0155={'count':0x0,'rows':[]};return db['MailAccount'][_0xb320('0x6a')]({'where':{'id':_0x424f08['params']['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x4acd66,null))[_0xb320('0xe')](function(_0x41cae4){if(_0x41cae4){_0x29bb64[_0xb320('0x4d')]=_['keys'](db[_0xb320('0x95')][_0xb320('0x46')]);_0x29bb64['query']=_['keys'](_0x424f08[_0xb320('0x4a')]);_0x29bb64['filters']=_[_0xb320('0x4c')](_0x29bb64['model'],_0x29bb64[_0xb320('0x4a')]);_0x3c49be['attributes']=_[_0xb320('0x4c')](_0x29bb64['model'],qs[_0xb320('0x4f')](_0x424f08[_0xb320('0x4a')][_0xb320('0x4f')]));_0x3c49be[_0xb320('0x4e')]=_0x3c49be[_0xb320('0x4e')][_0xb320('0x50')]?_0x3c49be[_0xb320('0x4e')]:_0x29bb64[_0xb320('0x4d')];if(!_0x424f08['query'][_0xb320('0x83')](_0xb320('0x51'))){_0x3c49be[_0xb320('0x1e')]=qs[_0xb320('0x1e')](_0x424f08[_0xb320('0x4a')][_0xb320('0x1e')]);_0x3c49be['offset']=qs['offset'](_0x424f08[_0xb320('0x4a')]['offset']);}_0x3c49be[_0xb320('0x52')]=qs['sort'](_0x424f08[_0xb320('0x4a')][_0xb320('0x53')]);_0x3c49be[_0xb320('0x54')]=qs['filters'](_[_0xb320('0x55')](_0x424f08[_0xb320('0x4a')],_0x29bb64[_0xb320('0x4b')]));_0x3c49be[_0xb320('0x54')]['MailAccountId']=_0x41cae4['id'];if(_0x424f08[_0xb320('0x4a')][_0xb320('0x56')]){_0x3c49be[_0xb320('0x54')]=_[_0xb320('0x58')](_0x3c49be[_0xb320('0x54')],{'$or':_[_0xb320('0x44')](_0x3c49be[_0xb320('0x4e')],function(_0xbf75ab){var _0x174a36={};_0x174a36[_0xbf75ab]={'$like':'%'+_0x424f08['query']['filter']+'%'};return _0x174a36;})});}if(_0x424f08[_0xb320('0x4a')][_0xb320('0x96')]){var _0x15da98=_0x424f08[_0xb320('0x4a')][_0xb320('0x96')][_0xb320('0x97')](',');var _0x431283={};_0x431283[_0x15da98[0x0]]={'$gte':moment(_0x15da98[0x1])[_0xb320('0x98')](_0xb320('0x99'))};_0x3c49be[_0xb320('0x54')]=_[_0xb320('0x58')](_0x3c49be[_0xb320('0x54')],_0x431283);}_0x3c49be=_[_0xb320('0x58')]({},_0x3c49be,_0x424f08[_0xb320('0x5c')]);return db[_0xb320('0x95')]['count']({'where':_0x3c49be[_0xb320('0x54')]})['then'](function(_0x433cd3){_0x5f0155[_0xb320('0x1f')]=_0x433cd3;if(_0x424f08[_0xb320('0x4a')]['includeAll']){_0x3c49be['include']=[{'all':!![]}];}return db[_0xb320('0x95')][_0xb320('0x8a')](_0x3c49be);})['then'](function(_0x3ab8f1){if(_0x424f08[_0xb320('0x4a')][_0xb320('0x9a')]===_0xb320('0x9b')){for(var _0x134638=0x0;_0x134638<_0x3ab8f1[_0xb320('0x50')];_0x134638++){_0x3ab8f1[_0x134638][_0xb320('0x5e')]=juice(_0x3ab8f1[_0x134638][_0xb320('0x5e')]);}}_0x5f0155[_0xb320('0x6d')]=_0x3ab8f1;return _0x5f0155;});}})[_0xb320('0xe')](respondWithFilteredResult(_0x4acd66,_0x3c49be))['catch'](handleError(_0x4acd66,null));};exports[_0xb320('0x26')]=function(_0xa81456,_0x354ddb){var _0x2c1713,_0x205c39={},_0x27a176;if(_0xa81456[_0xb320('0x5e')]['to']){_0x27a176=_0xa81456[_0xb320('0x5e')]['to'][_0xb320('0x97')](',')[0x0];}return db['MailAccount'][_0xb320('0x5d')]({'where':{'id':_0xa81456[_0xb320('0x61')]['id']},'include':[{'model':db[_0xb320('0x9c')],'as':_0xb320('0x9d'),'include':[{'model':db[_0xb320('0x9e')],'as':'Contacts','where':{'email':_0x27a176},'limit':0x1,'order':[[_0xb320('0x9f'),_0xb320('0xa0')]]}]},{'model':db[_0xb320('0x62')],'as':_0xb320('0x3f'),'raw':!![],'include':[{'model':db[_0xb320('0xa1')],'as':_0xb320('0xa1'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x354ddb,null))[_0xb320('0xe')](function(_0x4b5bc3){if(!_0x4b5bc3)return;_0x2c1713=_0x4b5bc3;if(!_0x4b5bc3[_0xb320('0x3f')])throw new Error(_0xb320('0xa2'));if(_[_0xb320('0x75')](_0xa81456[_0xb320('0x5e')][_0xb320('0xa3')])){_0xa81456['body'][_0xb320('0xa3')]=util[_0xb320('0x98')]('%s\x20<%s>',_0x4b5bc3[_0xb320('0x25')],_0x4b5bc3['email']||_0x4b5bc3['Smtp'][_0xb320('0x34')]);}if(_0xa81456[_0xb320('0x5e')]['attachments']&&_0xa81456[_0xb320('0x5e')][_0xb320('0xa4')][_0xb320('0x50')]){for(var _0x15cc36=0x0;_0x15cc36<_0xa81456[_0xb320('0x5e')]['attachments']['length'];_0x15cc36+=0x1){_0xa81456[_0xb320('0x5e')][_0xb320('0xa4')][_0x15cc36]={'filename':_0xa81456[_0xb320('0x5e')][_0xb320('0xa4')][_0x15cc36]['name'],'path':path[_0xb320('0xa5')](config[_0xb320('0xa6')],_0xb320('0xa7'),_0xa81456[_0xb320('0x5e')][_0xb320('0xa4')][_0x15cc36][_0xb320('0xa8')])};}}var _0x47ac27=_0x4b5bc3[_0xb320('0xa9')]();return respondWithRpcPromise(_0xb320('0xaa'),_0xb320('0xab'),{'account':_0x47ac27,'message':_0xa81456[_0xb320('0x5e')]});})[_0xb320('0xe')](function(_0x5e8bf7){if(!_0x5e8bf7)return;_0x205c39=_0x5e8bf7;if(!_0x2c1713['List'])throw new Error('List\x20not\x20found');if(_0x2c1713[_0xb320('0x9d')]['Contacts'][_0xb320('0x50')])return _0x2c1713[_0xb320('0x9d')][_0xb320('0xac')][0x0];return db[_0xb320('0x9e')][_0xb320('0x68')](_[_0xb320('0xad')](_0xa81456[_0xb320('0x5e')],{'firstName':_0xa81456['body']['to'],'email':_0xa81456['body']['to'],'phone':_0xa81456['body']['to'],'ListId':_0x2c1713[_0xb320('0xae')]}));})['then'](function(_0x444764){if(!_0x444764)return;var _0x32b42a={'UserId':_0xa81456[_0xb320('0x34')]['id'],'ContactId':_0x444764['id'],'MailAccountId':_0x2c1713['id'],'inReplyTo':_0x205c39[_0xb320('0xaf')],'to':_0xa81456[_0xb320('0x5e')][_0xb320('0xa3')],'cc':_0xa81456[_0xb320('0x5e')]['cc'],'subject':_0xa81456[_0xb320('0x5e')]['subject'],'attach':_0xa81456['body'][_0xb320('0xb0')],'firstMsgDirection':_0xb320('0xb1'),'lastMsgAt':moment()[_0xb320('0x98')](_0xb320('0x99')),'lastMsgDirection':'out','Messages':[_[_0xb320('0x58')](_0xa81456[_0xb320('0x5e')],{'messageId':_0x205c39[_0xb320('0xaf')],'sentAt':moment()[_0xb320('0x98')](_0xb320('0x99')),'read':!![],'MailAccountId':_0x2c1713['id'],'UserId':_0xa81456['user']['id'],'ContactId':_0x444764['id']})]};if(_0xa81456[_0xb320('0x5e')]['Interaction']){_0x32b42a=_[_0xb320('0x58')](_0x32b42a,_0xa81456[_0xb320('0x5e')]['Interaction']);}return db[_0xb320('0x84')][_0xb320('0x68')](_0x32b42a,{'include':[{'model':db[_0xb320('0x95')],'as':_0xb320('0xb2')}]});})[_0xb320('0xe')](respondWithResult(_0x354ddb,null))['catch'](handleError(_0x354ddb,null));};exports['verifySmtp']=function(_0x12febd,_0x4b4ee1){return db[_0xb320('0x45')][_0xb320('0x5d')]({'where':{'id':_0x12febd[_0xb320('0x61')]['id']},'include':[{'model':db[_0xb320('0x62')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xb320('0xa1')],'as':_0xb320('0xa1'),'raw':!![]}]}]})[_0xb320('0xe')](handleEntityNotFound(_0x4b4ee1,null))[_0xb320('0xe')](function(_0x18d8d5){if(!_0x18d8d5['Smtp'])return;var _0x501df2=_0x18d8d5[_0xb320('0xa9')]();return respondWithRpcPromise(_0xb320('0xb3'),_0xb320('0xb4'),{'account':_0x501df2});})[_0xb320('0xe')](respondWithResult(_0x4b4ee1,null))[_0xb320('0x19')](handleError(_0x4b4ee1,null));};exports[_0xb320('0x21')]=function(_0x5a2df1,_0x7fe0e7){return db['MailAccount'][_0xb320('0x5d')]({'where':{'id':_0x5a2df1[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x7fe0e7,null))[_0xb320('0xe')](function(_0x5150f0){if(_0x5150f0&&_0x5150f0[_0xb320('0x3c')]){throw new db[(_0xb320('0xb5'))][(_0xb320('0xb6'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5150f0;})['then'](removeEntity(_0x7fe0e7,null))['catch'](handleError(_0x7fe0e7,null));};exports['addAgents']=function(_0x2b6a7d,_0x84d641){return db['MailAccount'][_0xb320('0x5d')]({'where':{'id':_0x2b6a7d[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x84d641,null))[_0xb320('0xe')](function(_0x591c8a){if(_0x591c8a){return _0x591c8a[_0xb320('0xb7')](_0x2b6a7d[_0xb320('0x5e')][_0xb320('0x6f')],_['omit'](_0x2b6a7d[_0xb320('0x5e')],[_0xb320('0x6f'),'id'])||{})[_0xb320('0xb8')](function(_0x57809e){for(var _0x52495f=0x0;_0x52495f<_0x2b6a7d[_0xb320('0x5e')][_0xb320('0x6f')][_0xb320('0x50')];_0x52495f+=0x1){socket['emit'](_0xb320('0xb9'),{'UserId':Number(_0x2b6a7d[_0xb320('0x5e')][_0xb320('0x6f')][_0x52495f]),'MailAccountId':Number(_0x2b6a7d['params']['id'])});}return _0x57809e;});}})[_0xb320('0xe')](respondWithResult(_0x84d641,null))[_0xb320('0x19')](handleError(_0x84d641,null));};exports[_0xb320('0xba')]=function(_0xce9a29,_0x2cd508){return db[_0xb320('0x45')]['find']({'where':{'id':_0xce9a29[_0xb320('0x61')]['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x2cd508,null))['then'](function(_0x29981c){if(_0x29981c){return _0x29981c[_0xb320('0xba')](_0xce9a29[_0xb320('0x4a')][_0xb320('0x6f')])[_0xb320('0xe')](function(){if(_[_0xb320('0xbb')](_0xce9a29['query'][_0xb320('0x6f')])){for(var _0x5886a1=0x0;_0x5886a1<_0xce9a29[_0xb320('0x4a')][_0xb320('0x6f')][_0xb320('0x50')];_0x5886a1+=0x1){socket[_0xb320('0xbc')]('userMailAccount:remove',{'UserId':Number(_0xce9a29['query'][_0xb320('0x6f')][_0x5886a1]),'MailAccountId':Number(_0xce9a29[_0xb320('0x61')]['id'])});}}else{socket[_0xb320('0xbc')]('userMailAccount:remove',{'UserId':Number(_0xce9a29[_0xb320('0x4a')][_0xb320('0x6f')]),'MailAccountId':Number(_0xce9a29['params']['id'])});}});}})[_0xb320('0xe')](respondWithStatusCode(_0x2cd508,null))[_0xb320('0x19')](handleError(_0x2cd508,null));};exports['getAgents']=function(_0x3e3a72,_0x2ab48){var _0x5f4747={};var _0x3c837e={};var _0x53a4b1;var _0x1973d2;return db[_0xb320('0x45')][_0xb320('0x6a')]({'where':{'id':_0x3e3a72['params']['id']}})[_0xb320('0xe')](handleEntityNotFound(_0x2ab48,null))['then'](function(_0x299d1f){if(_0x299d1f){_0x53a4b1=_0x299d1f;_0x3c837e['model']=_['keys'](db['User'][_0xb320('0x46')]);_0x3c837e[_0xb320('0x4a')]=_[_0xb320('0x5b')](_0x3e3a72[_0xb320('0x4a')]);_0x3c837e[_0xb320('0x4b')]=_[_0xb320('0x4c')](_0x3c837e[_0xb320('0x4d')],_0x3c837e['query']);_0x5f4747[_0xb320('0x4e')]=_[_0xb320('0x4c')](_0x3c837e['model'],qs[_0xb320('0x4f')](_0x3e3a72[_0xb320('0x4a')][_0xb320('0x4f')]));_0x5f4747['attributes']=_0x5f4747[_0xb320('0x4e')][_0xb320('0x50')]?_0x5f4747[_0xb320('0x4e')]:_0x3c837e['model'];_0x5f4747[_0xb320('0x52')]=qs[_0xb320('0x53')](_0x3e3a72['query'][_0xb320('0x53')]);_0x5f4747[_0xb320('0x54')]=qs['filters'](_['pick'](_0x3e3a72['query'],_0x3c837e['filters']));if(_0x3e3a72[_0xb320('0x4a')][_0xb320('0x56')]){_0x5f4747[_0xb320('0x54')]=_['merge'](_0x5f4747[_0xb320('0x54')],{'$or':_[_0xb320('0x44')](_0x5f4747[_0xb320('0x4e')],function(_0x21a5b4){var _0x2cbb02={};_0x2cbb02[_0x21a5b4]={'$like':'%'+_0x3e3a72['query']['filter']+'%'};return _0x2cbb02;})});}_0x5f4747=_[_0xb320('0x58')]({},_0x5f4747,_0x3e3a72[_0xb320('0x5c')]);return _0x53a4b1[_0xb320('0xbd')](_0x5f4747);}})[_0xb320('0xe')](function(_0xf68dd3){if(_0xf68dd3){_0x1973d2=_0xf68dd3[_0xb320('0x50')];if(!_0x3e3a72['query'][_0xb320('0x83')](_0xb320('0x51'))){_0x5f4747[_0xb320('0x1e')]=qs[_0xb320('0x1e')](_0x3e3a72['query']['limit']);_0x5f4747[_0xb320('0x1c')]=qs[_0xb320('0x1c')](_0x3e3a72[_0xb320('0x4a')][_0xb320('0x1c')]);}return _0x53a4b1['getAgents'](_0x5f4747);}})['then'](function(_0x24f6eb){if(_0x24f6eb){return _0x24f6eb?{'count':_0x1973d2,'rows':_0x24f6eb}:null;}})[_0xb320('0xe')](respondWithResult(_0x2ab48,null))[_0xb320('0x19')](handleError(_0x2ab48,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b9d7ec4..3181995 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 _0xc051=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0xc051,0xb5));var _0x1c05=function(_0x11dc88,_0x2416fe){_0x11dc88=_0x11dc88-0x0;var _0x5c8870=_0xc051[_0x11dc88];return _0x5c8870;};'use strict';var EventEmitter=require(_0x1c05('0x0'));var MailAccount=require(_0x1c05('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c05('0x2'),'afterUpdate':_0x1c05('0x3'),'afterDestroy':_0x1c05('0x4')};function emitEvent(_0xd5f638){return function(_0x5d181d,_0x352877,_0x1493c6){MailAccountEvents[_0x1c05('0x5')](_0xd5f638+':'+_0x5d181d['id'],_0x5d181d);MailAccountEvents[_0x1c05('0x5')](_0xd5f638,_0x5d181d);_0x1493c6(null);};}for(var e in events){if(events[_0x1c05('0x6')](e)){var event=events[e];MailAccount[_0x1c05('0x7')](e,emitEvent(event));}}module[_0x1c05('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xacc6=['emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','remove'];(function(_0x4f5fbc,_0x74cb4e){var _0x486e0e=function(_0x306829){while(--_0x306829){_0x4f5fbc['push'](_0x4f5fbc['shift']());}};_0x486e0e(++_0x74cb4e);}(_0xacc6,0x150));var _0x6acc=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xacc6[_0x211fef];return _0x5447bf;};'use strict';var EventEmitter=require(_0x6acc('0x0'));var MailAccount=require(_0x6acc('0x1'))['db'][_0x6acc('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6acc('0x3')](0x0);var events={'afterCreate':_0x6acc('0x4'),'afterUpdate':'update','afterDestroy':_0x6acc('0x5')};function emitEvent(_0x14a0d1){return function(_0x2ff2ff,_0x53dcdb,_0x148455){MailAccountEvents['emit'](_0x14a0d1+':'+_0x2ff2ff['id'],_0x2ff2ff);MailAccountEvents[_0x6acc('0x6')](_0x14a0d1,_0x2ff2ff);_0x148455(null);};}for(var e in events){if(events[_0x6acc('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x6acc('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 d0fe897..6e8c9f8 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 _0x91c8=['data5','pass','./mailAccount.attributes','exports','mail_accounts','custom','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user'];(function(_0x4ff969,_0x14137f){var _0x44658f=function(_0x5aa135){while(--_0x5aa135){_0x4ff969['push'](_0x4ff969['shift']());}};_0x44658f(++_0x14137f);}(_0x91c8,0xc2));var _0x891c=function(_0x15f9cb,_0x4fdda6){_0x15f9cb=_0x15f9cb-0x0;var _0x7706fa=_0x91c8[_0x15f9cb];return _0x7706fa;};'use strict';var attributes=require(_0x891c('0x0'));module[_0x891c('0x1')]=function(_0x5927c9){return _0x5927c9['define']('MailAccount',attributes,{'tableName':_0x891c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2f6690=this;var _0x53d5be={'id':_0x2f6690['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2f6690['provider']!==_0x891c('0x3')){_0x53d5be[_0x891c('0x4')]=_0x2f6690['provider'];}else{_0x53d5be[_0x891c('0x5')]=_0x2f6690[_0x891c('0x6')][_0x891c('0x5')];_0x53d5be[_0x891c('0x7')]=_0x2f6690[_0x891c('0x6')][_0x891c('0x7')];_0x53d5be['secure']=_0x2f6690[_0x891c('0x6')][_0x891c('0x8')];}if(_0x2f6690[_0x891c('0x6')]['authentication']){if(_0x2f6690[_0x891c('0x6')][_0x891c('0x9')]){if(!_0x2f6690[_0x891c('0x6')][_0x891c('0xa')])throw new Error(_0x891c('0xb'));_0x53d5be[_0x891c('0xc')]={'type':'OAuth2','user':_0x2f6690['Smtp'][_0x891c('0xd')],'accessToken':_0x2f6690[_0x891c('0x6')][_0x891c('0xa')][_0x891c('0xe')]};}else{_0x53d5be['auth']={'user':_0x2f6690[_0x891c('0x6')][_0x891c('0xd')],'pass':_0x2f6690[_0x891c('0x6')][_0x891c('0xf')]};}}return _0x53d5be;}}});}; \ No newline at end of file +var _0xc120=['authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','service','host','Smtp','port','secure'];(function(_0x119920,_0x18be73){var _0x14140a=function(_0x1c2dde){while(--_0x1c2dde){_0x119920['push'](_0x119920['shift']());}};_0x14140a(++_0x18be73);}(_0xc120,0x15e));var _0x0c12=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc120[_0x19e35c];return _0x3e1fe8;};'use strict';var attributes=require(_0x0c12('0x0'));module['exports']=function(_0x2876af){return _0x2876af[_0x0c12('0x1')](_0x0c12('0x2'),attributes,{'tableName':_0x0c12('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1742c1=this;var _0x1ebbe8={'id':_0x1742c1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1742c1[_0x0c12('0x4')]!=='custom'){_0x1ebbe8[_0x0c12('0x5')]=_0x1742c1[_0x0c12('0x4')];}else{_0x1ebbe8[_0x0c12('0x6')]=_0x1742c1[_0x0c12('0x7')][_0x0c12('0x6')];_0x1ebbe8['port']=_0x1742c1[_0x0c12('0x7')][_0x0c12('0x8')];_0x1ebbe8[_0x0c12('0x9')]=_0x1742c1[_0x0c12('0x7')][_0x0c12('0x9')];}if(_0x1742c1[_0x0c12('0x7')][_0x0c12('0xa')]){if(_0x1742c1[_0x0c12('0x7')][_0x0c12('0xb')]){if(!_0x1742c1['Smtp'][_0x0c12('0xc')])throw new Error(_0x0c12('0xd'));_0x1ebbe8[_0x0c12('0xe')]={'type':_0x0c12('0xf'),'user':_0x1742c1[_0x0c12('0x7')][_0x0c12('0x10')],'accessToken':_0x1742c1[_0x0c12('0x7')][_0x0c12('0xc')][_0x0c12('0x11')]};}else{_0x1ebbe8[_0x0c12('0xe')]={'user':_0x1742c1[_0x0c12('0x7')][_0x0c12('0x10')],'pass':_0x1742c1[_0x0c12('0x7')]['pass']};}}return _0x1ebbe8;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index a1e00f9..308eb7f 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 _0x5d58=['body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','find','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','Smtp','CloudProvider','then','account','omit','smtpOptions','applications','List','orderBy','priority','asc','autoclose','push','length','close','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','attach','YYYY-MM-DD\x20HH:mm:ss','get','interaction','created','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','map','include','model','attributes','ShowMailAccount','smtp','setDataValue','getSmtpOptions','stringify','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','CompanyId'];(function(_0x5649c8,_0x7e9dcd){var _0xd8d27d=function(_0x140bbd){while(--_0x140bbd){_0x5649c8['push'](_0x5649c8['shift']());}};_0xd8d27d(++_0x7e9dcd);}(_0x5d58,0x187));var _0x85d5=function(_0x577773,_0x166fbb){_0x577773=_0x577773-0x0;var _0x1394f9=_0x5d58[_0x577773];return _0x1394f9;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var Redis=require('ioredis');var db=require(_0x85d5('0x0'))['db'];var logger=require(_0x85d5('0x1'))('rpc');var config=require(_0x85d5('0x2'));var jayson=require(_0x85d5('0x3'));var client=jayson['client'][_0x85d5('0x4')]({'port':0x232c});config[_0x85d5('0x5')]=_[_0x85d5('0x6')](config[_0x85d5('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x85d5('0x7'))(new Redis(config[_0x85d5('0x5')]));require('./mailAccount.socket')[_0x85d5('0x8')](socket);function respondWithRpcPromise(_0x4eb3ae,_0x1098be,_0x2ce6b9){return new BPromise(function(_0x258f0c,_0x488dcb){return client['request'](_0x4eb3ae,_0x2ce6b9)['then'](function(_0x1a2b82){logger[_0x85d5('0x9')](_0x85d5('0xa'),_0x1098be,_0x85d5('0xb'));logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x1098be,_0x85d5('0xb'),JSON['stringify'](_0x1a2b82));if(_0x1a2b82['error']){if(_0x1a2b82['error'][_0x85d5('0xe')]===0x1f4){logger[_0x85d5('0xf')](_0x85d5('0xa'),_0x1098be,_0x1a2b82[_0x85d5('0xf')][_0x85d5('0x10')]);return _0x488dcb(_0x1a2b82[_0x85d5('0xf')][_0x85d5('0x10')]);}logger['error'](_0x85d5('0xa'),_0x1098be,_0x1a2b82[_0x85d5('0xf')][_0x85d5('0x10')]);return _0x258f0c(_0x1a2b82[_0x85d5('0xf')][_0x85d5('0x10')]);}else{logger[_0x85d5('0x9')](_0x85d5('0xa'),_0x1098be,_0x85d5('0xb'));_0x258f0c(_0x1a2b82[_0x85d5('0x11')][_0x85d5('0x10')]);}})[_0x85d5('0x12')](function(_0x432bd6){logger[_0x85d5('0xf')](_0x85d5('0xa'),_0x1098be,_0x432bd6);_0x488dcb(_0x432bd6);});});}exports[_0x85d5('0x13')]=function(_0x26981b){var _0x54e991=this;return new Promise(function(_0x1d6134,_0x53bd11){return db[_0x85d5('0x14')][_0x85d5('0x15')]({'raw':_0x26981b['options']?_0x26981b[_0x85d5('0x16')][_0x85d5('0x17')]===undefined?!![]:![]:!![],'where':_0x26981b['options']?_0x26981b['options'][_0x85d5('0x18')]||null:null,'attributes':_0x26981b['options']?_0x26981b[_0x85d5('0x16')]['attributes']||null:null,'limit':_0x26981b[_0x85d5('0x16')]?_0x26981b[_0x85d5('0x16')]['limit']||null:null,'include':_0x26981b['options']?_0x26981b['options']['include']?_[_0x85d5('0x19')](_0x26981b[_0x85d5('0x16')][_0x85d5('0x1a')],function(_0x466bbd){return{'model':db[_0x466bbd[_0x85d5('0x1b')]],'as':_0x466bbd['as'],'attributes':_0x466bbd[_0x85d5('0x1c')],'include':_0x466bbd['include']?_[_0x85d5('0x19')](_0x466bbd['include'],function(_0x1b3fae){return{'model':db[_0x1b3fae[_0x85d5('0x1b')]],'as':_0x1b3fae['as'],'attributes':_0x1b3fae[_0x85d5('0x1c')],'include':_0x1b3fae['include']?_[_0x85d5('0x19')](_0x1b3fae[_0x85d5('0x1a')],function(_0x815808){return{'model':db[_0x815808[_0x85d5('0x1b')]],'as':_0x815808['as'],'attributes':_0x815808[_0x85d5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cbef1){logger[_0x85d5('0x9')](_0x85d5('0x13'),_0x26981b);logger[_0x85d5('0xc')](_0x85d5('0x13'),_0x26981b,JSON['stringify'](_0x1cbef1));_0x1d6134(_0x1cbef1);})['catch'](function(_0x2ce7a9){logger[_0x85d5('0xf')](_0x85d5('0x13'),_0x2ce7a9[_0x85d5('0x10')],_0x26981b);_0x53bd11(_0x54e991[_0x85d5('0xf')](0x1f4,_0x2ce7a9['message']));});});};exports[_0x85d5('0x1d')]=function(_0x214908){var _0x5561dd=this;return new Promise(function(_0x4ea24e,_0x26b8eb){return db[_0x85d5('0x14')]['find']({'raw':_0x214908[_0x85d5('0x16')]?_0x214908['options'][_0x85d5('0x17')]===undefined?!![]:![]:!![],'where':_0x214908[_0x85d5('0x16')]?_0x214908['options'][_0x85d5('0x18')]||null:null,'attributes':_0x214908[_0x85d5('0x16')]?_0x214908[_0x85d5('0x16')][_0x85d5('0x1c')]||null:null,'include':_0x214908['options']?_0x214908['options'][_0x85d5('0x1a')]?_[_0x85d5('0x19')](_0x214908[_0x85d5('0x16')][_0x85d5('0x1a')],function(_0x228bf2){return{'model':db[_0x228bf2[_0x85d5('0x1b')]],'as':_0x228bf2['as'],'attributes':_0x228bf2[_0x85d5('0x1c')],'include':_0x228bf2[_0x85d5('0x1a')]?_[_0x85d5('0x19')](_0x228bf2['include'],function(_0x5a15fd){return{'model':db[_0x5a15fd[_0x85d5('0x1b')]],'as':_0x5a15fd['as'],'attributes':_0x5a15fd[_0x85d5('0x1c')],'include':_0x5a15fd[_0x85d5('0x1a')]?_[_0x85d5('0x19')](_0x5a15fd[_0x85d5('0x1a')],function(_0x2a0ff0){return{'model':db[_0x2a0ff0[_0x85d5('0x1b')]],'as':_0x2a0ff0['as'],'attributes':_0x2a0ff0[_0x85d5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x358555){if(_0x214908[_0x85d5('0x16')][_0x85d5('0x1e')]===!![])_0x358555[_0x85d5('0x1f')]('smtpOptions',_0x358555[_0x85d5('0x20')]());logger[_0x85d5('0x9')](_0x85d5('0x1d'),_0x214908);logger[_0x85d5('0xc')]('ShowMailAccount',_0x214908,JSON[_0x85d5('0x21')](_0x358555));_0x4ea24e(_0x358555);})['catch'](function(_0x484a4d){logger[_0x85d5('0xf')]('ShowMailAccount',_0x484a4d[_0x85d5('0x10')],_0x214908);_0x26b8eb(_0x5561dd['error'](0x1f4,_0x484a4d['message']));});});};exports[_0x85d5('0x22')]=function(_0x28e93b){var _0x40360f=this;return new Promise(function(_0x1beffc,_0x234c44){var _0x556800={'body':_0x28e93b['body'],'channel':_0x85d5('0x23')};var _0x173717=_[_0x85d5('0x24')](_[_0x85d5('0x25')](db[_0x85d5('0x26')][_0x85d5('0x27')]),['createdAt','updatedAt',_0x85d5('0x28'),'ListId']);var _0xfbf466=![];if(_0x28e93b[_0x85d5('0x29')]['id']){delete _0x28e93b[_0x85d5('0x29')]['id'];}if(_[_0x85d5('0x2a')](_0x28e93b[_0x85d5('0x29')]['from'])){return _0x234c44(_0x40360f['error'](0x1f4,_0x85d5('0x2b')));}if(_[_0x85d5('0x2a')](_0x28e93b[_0x85d5('0x29')][_0x85d5('0x29')])||_0x28e93b[_0x85d5('0x29')][_0x85d5('0x29')]===''){return _0x234c44(_0x40360f[_0x85d5('0xf')](0x1f4,_0x85d5('0x2c')));}if(_[_0x85d5('0x2a')](_0x28e93b[_0x85d5('0x29')][_0x85d5('0x2d')])){return _0x234c44(_0x40360f[_0x85d5('0xf')](0x1f4,_0x85d5('0x2e')+_0x173717));}if(!_[_0x85d5('0x2f')](_0x173717,_0x28e93b[_0x85d5('0x29')][_0x85d5('0x2d')])){return _0x234c44(_0x40360f[_0x85d5('0xf')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x173717));}var _0x54c786={};_0x54c786[_0x28e93b[_0x85d5('0x29')][_0x85d5('0x2d')]]=_0x28e93b[_0x85d5('0x29')][_0x85d5('0x30')];return db[_0x85d5('0x14')][_0x85d5('0x31')]({'where':{'id':_0x28e93b['account']['id']},'include':[{'model':db[_0x85d5('0x32')],'as':'List','include':[{'model':db['CmContact'],'as':_0x85d5('0x33'),'where':_0x54c786,'limit':0x1,'order':[[_0x85d5('0x34'),_0x85d5('0x35')]]}]},{'model':db[_0x85d5('0x36')],'as':_0x85d5('0x37')},{'model':db['MailServerOut'],'as':_0x85d5('0x38'),'include':[{'model':db['CloudProvider'],'as':_0x85d5('0x39')}]}]})[_0x85d5('0x3a')](function(_0x219154){if(_0x219154&&_0x219154['List']){var _0x58a44d=_0x219154['get']({'plain':!![]});_0x556800[_0x85d5('0x3b')]=_[_0x85d5('0x3c')](_0x58a44d,[_0x85d5('0x37'),'List']);_0x556800['account'][_0x85d5('0x3d')]=_0x219154[_0x85d5('0x20')]();_0x556800[_0x85d5('0x3e')]=_0x58a44d[_0x85d5('0x37')];_0x556800['list']=_0x58a44d[_0x85d5('0x3f')];_0x556800[_0x85d5('0x3e')]=_[_0x85d5('0x40')](_0x556800[_0x85d5('0x3e')],[_0x85d5('0x41')],[_0x85d5('0x42')]);if(_0x556800[_0x85d5('0x3b')]&&_0x556800[_0x85d5('0x3b')][_0x85d5('0x43')]){_0x556800[_0x85d5('0x3e')][_0x85d5('0x44')]({'id':0x0,'priority':_0x556800[_0x85d5('0x3e')][_0x85d5('0x45')]+0x1,'app':_0x85d5('0x46'),'appdata':_0x85d5('0x43'),'interval':'*,*,*,*'});}if(_0x556800[_0x85d5('0x3b')][_0x85d5('0x37')]){delete _0x556800[_0x85d5('0x3b')][_0x85d5('0x37')];}if(_0x556800['account'][_0x85d5('0x3f')]){delete _0x556800['account'][_0x85d5('0x3f')];}if(_0x58a44d[_0x85d5('0x3f')][_0x85d5('0x33')][_0x85d5('0x45')]){return _0x58a44d['List'][_0x85d5('0x33')][0x0];}var _0x5b1a82=_['defaults'](_0x28e93b['body'],{'firstName':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x30')],'ListId':_0x58a44d[_0x85d5('0x47')]});_0x5b1a82[_0x28e93b[_0x85d5('0x29')][_0x85d5('0x2d')]]=_0x28e93b['body']['from'];return db[_0x85d5('0x26')][_0x85d5('0x48')](_0x5b1a82);}else{throw new Error(_0x85d5('0x49'));}})[_0x85d5('0x3a')](function(_0x5809d4){_0x556800[_0x85d5('0x4a')]=_0x5809d4;if(_0x5809d4){if(!_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')]['messageId']){_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x4b')]=rs[_0x85d5('0x4c')]()+'\x20'+_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x30')];}var _0xa5153d={'ContactId':_0x5809d4['id'],'MailAccountId':_0x28e93b[_0x85d5('0x3b')]['id'],'inReplyTo':_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x4b')],'to':_0x28e93b[_0x85d5('0x29')]['message'][_0x85d5('0x30')],'cc':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')]['cc'],'subject':_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x4d')],'attach':_0x28e93b['body'][_0x85d5('0x10')]['attach'],'lastMsgAt':moment()[_0x85d5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x85d5('0x4f')][_0x85d5('0x31')]({'where':{'closed':![],'MailAccountId':_0x28e93b[_0x85d5('0x3b')]['id']},'include':[{'model':db[_0x85d5('0x50')],'as':'Messages','attributes':[_0x85d5('0x4b')],'where':{'messageId':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')][_0x85d5('0x51')]}}]})[_0x85d5('0x3a')](function(_0x226795){if(_0x226795){return[_0x226795,![]];}return db[_0x85d5('0x4f')][_0x85d5('0x48')](_0xa5153d)['then'](function(_0x5d67d1){return[_0x5d67d1,!![]];});});}else{throw new Error(_0x85d5('0x52'));}})['spread'](function(_0x29e17f,_0x12c235){if(_0x29e17f){_0xfbf466=_0x12c235;if(!_0x12c235){return _0x29e17f['update']({'inReplyTo':_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x4b')],'to':_0x28e93b[_0x85d5('0x29')]['message'][_0x85d5('0x30')],'cc':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')]['cc'],'subject':_0x28e93b[_0x85d5('0x29')]['message']['subject'],'attach':_0x29e17f[_0x85d5('0x53')]?_0x29e17f['attach']:_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x53')],'substatus':null,'substatusAt':moment()[_0x85d5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x85d5('0x54')),'lastMsgDirection':'in'});}else{return _0x29e17f;}}})[_0x85d5('0x3a')](function(_0x291298){_0x556800['interaction']=_0x291298[_0x85d5('0x55')]({'plain':!![]});_0x556800[_0x85d5('0x56')][_0x85d5('0x57')]=_0xfbf466;return db[_0x85d5('0x50')][_0x85d5('0x48')]({'body':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x29')],'MailAccountId':_0x28e93b[_0x85d5('0x3b')]['id'],'MailInteractionId':_0x291298['id'],'direction':'in','ContactId':_0x556800['contact']['id'],'messageId':_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x4b')],'from':_0x28e93b[_0x85d5('0x29')]['message'][_0x85d5('0x30')],'to':_0x28e93b[_0x85d5('0x29')]['message']['to'],'cc':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')]['cc'],'subject':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')][_0x85d5('0x4d')],'attach':_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x53')],'Attachments':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')][_0x85d5('0x58')],'originTo':_0x28e93b['body'][_0x85d5('0x10')][_0x85d5('0x59')],'originCc':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')][_0x85d5('0x5a')],'bcc':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')][_0x85d5('0x5b')],'ChatWebsiteId':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')]['ChatWebsiteId']||null,'originChannel':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')][_0x85d5('0x5c')]||_0x85d5('0x5d'),'ChatOfflineMessageId':_0x28e93b[_0x85d5('0x29')][_0x85d5('0x10')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x85d5('0x5e')],'as':'Attachments'}]});})['then'](function(_0x296d6e){_0x556800[_0x85d5('0x10')]=_0x296d6e;if(!_0x556800[_0x85d5('0x56')][_0x85d5('0x5f')]){return;}return db[_0x85d5('0x60')][_0x85d5('0x31')]({'attributes':['id',_0x85d5('0x61')],'where':{'id':_0x556800[_0x85d5('0x56')][_0x85d5('0x5f')]}});})['then'](function(_0x26399f){if(_0x26399f){_0x556800[_0x85d5('0x3e')][_0x85d5('0x62')]({'id':0x0,'priority':0x0,'app':_0x85d5('0x63'),'appdata':_0x26399f[_0x85d5('0x61')]+','+(_0x556800[_0x85d5('0x3b')][_0x85d5('0x64')]||0xa),'interval':_0x85d5('0x65')});}if(!_0x556800[_0x85d5('0x56')][_0x85d5('0x66')]){return;}return db[_0x85d5('0x67')][_0x85d5('0x31')]({'attributes':['id',_0x85d5('0x61')],'where':{'id':_0x556800[_0x85d5('0x56')][_0x85d5('0x66')]}});})['then'](function(_0x52243a){if(_0x52243a){_0x556800[_0x85d5('0x3e')]['unshift']({'id':0x0,'priority':0x1,'app':_0x85d5('0x68'),'appdata':_0x52243a[_0x85d5('0x61')]+','+(_0x556800[_0x85d5('0x3b')][_0x85d5('0x69')]||0x12c),'interval':_0x85d5('0x65')});}return respondWithRpcPromise(_0x85d5('0x6a'),_0x85d5('0x6b'),_0x556800);})[_0x85d5('0x3a')](function(_0x2715da){_0x1beffc(_0x2715da);})['catch'](function(_0x2ebc45){_0x234c44(_0x40360f[_0x85d5('0xf')](0x1f4,_0x2ebc45['message']));});});}; \ No newline at end of file +var _0xee3c=['localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','CloudProvider','List','applications','orderBy','priority','asc','push','close','autoclose','*,*,*,*','length','create','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','update','attach','interaction','get','created','MailMessage','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x24d8a5,_0x4e62b7){var _0x1d1657=function(_0x2d99a6){while(--_0x2d99a6){_0x24d8a5['push'](_0x24d8a5['shift']());}};_0x1d1657(++_0x4e62b7);}(_0xee3c,0x14a));var _0xcee3=function(_0x7a0592,_0x468c96){_0x7a0592=_0x7a0592-0x0;var _0x53eb05=_0xee3c[_0x7a0592];return _0x53eb05;};'use strict';var _=require(_0xcee3('0x0'));var moment=require(_0xcee3('0x1'));var BPromise=require(_0xcee3('0x2'));var rs=require(_0xcee3('0x3'));var Redis=require(_0xcee3('0x4'));var db=require(_0xcee3('0x5'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0xcee3('0x6'));var jayson=require(_0xcee3('0x7'));var client=jayson[_0xcee3('0x8')][_0xcee3('0x9')]({'port':0x232c});config[_0xcee3('0xa')]=_[_0xcee3('0xb')](config[_0xcee3('0xa')],{'host':_0xcee3('0xc'),'port':0x18eb});var socket=require(_0xcee3('0xd'))(new Redis(config[_0xcee3('0xa')]));require(_0xcee3('0xe'))[_0xcee3('0xf')](socket);function respondWithRpcPromise(_0x861421,_0x81de8e,_0x15d2af){return new BPromise(function(_0x507d8c,_0x1ed6a6){return client[_0xcee3('0x10')](_0x861421,_0x15d2af)[_0xcee3('0x11')](function(_0x2790ba){logger[_0xcee3('0x12')](_0xcee3('0x13'),_0x81de8e,'request\x20sent');logger[_0xcee3('0x14')](_0xcee3('0x15'),_0x81de8e,_0xcee3('0x16'),JSON[_0xcee3('0x17')](_0x2790ba));if(_0x2790ba[_0xcee3('0x18')]){if(_0x2790ba['error'][_0xcee3('0x19')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x81de8e,_0x2790ba['error'][_0xcee3('0x1a')]);return _0x1ed6a6(_0x2790ba[_0xcee3('0x18')]['message']);}logger['error'](_0xcee3('0x13'),_0x81de8e,_0x2790ba['error'][_0xcee3('0x1a')]);return _0x507d8c(_0x2790ba['error'][_0xcee3('0x1a')]);}else{logger[_0xcee3('0x12')]('MailAccount,\x20%s,\x20%s',_0x81de8e,_0xcee3('0x16'));_0x507d8c(_0x2790ba[_0xcee3('0x1b')][_0xcee3('0x1a')]);}})[_0xcee3('0x1c')](function(_0x50bf6e){logger[_0xcee3('0x18')](_0xcee3('0x13'),_0x81de8e,_0x50bf6e);_0x1ed6a6(_0x50bf6e);});});}exports[_0xcee3('0x1d')]=function(_0x11bf37){var _0x52f4d7=this;return new Promise(function(_0x254de7,_0xf2f32){return db[_0xcee3('0x1e')][_0xcee3('0x1f')]({'raw':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x21')]===undefined?!![]:![]:!![],'where':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x22')]||null:null,'attributes':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x23')]||null:null,'limit':_0x11bf37['options']?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x24')]||null:null,'include':_0x11bf37[_0xcee3('0x20')]?_0x11bf37[_0xcee3('0x20')][_0xcee3('0x25')]?_['map'](_0x11bf37['options'][_0xcee3('0x25')],function(_0x5b92ba){return{'model':db[_0x5b92ba['model']],'as':_0x5b92ba['as'],'attributes':_0x5b92ba[_0xcee3('0x23')],'include':_0x5b92ba['include']?_[_0xcee3('0x26')](_0x5b92ba[_0xcee3('0x25')],function(_0x19a15e){return{'model':db[_0x19a15e['model']],'as':_0x19a15e['as'],'attributes':_0x19a15e[_0xcee3('0x23')],'include':_0x19a15e['include']?_[_0xcee3('0x26')](_0x19a15e['include'],function(_0x2c2d48){return{'model':db[_0x2c2d48[_0xcee3('0x27')]],'as':_0x2c2d48['as'],'attributes':_0x2c2d48['attributes']};}):[]};}):[]};}):[]:[]})[_0xcee3('0x11')](function(_0x1efb1b){logger['info'](_0xcee3('0x1d'),_0x11bf37);logger['debug']('GetMailAccount',_0x11bf37,JSON[_0xcee3('0x17')](_0x1efb1b));_0x254de7(_0x1efb1b);})['catch'](function(_0x22e342){logger[_0xcee3('0x18')](_0xcee3('0x1d'),_0x22e342[_0xcee3('0x1a')],_0x11bf37);_0xf2f32(_0x52f4d7[_0xcee3('0x18')](0x1f4,_0x22e342[_0xcee3('0x1a')]));});});};exports[_0xcee3('0x28')]=function(_0x5ce5be){var _0x298a29=this;return new Promise(function(_0x56f705,_0x74019c){return db[_0xcee3('0x1e')][_0xcee3('0x29')]({'raw':_0x5ce5be[_0xcee3('0x20')]?_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x21')]===undefined?!![]:![]:!![],'where':_0x5ce5be[_0xcee3('0x20')]?_0x5ce5be[_0xcee3('0x20')]['where']||null:null,'attributes':_0x5ce5be[_0xcee3('0x20')]?_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x23')]||null:null,'include':_0x5ce5be['options']?_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x25')]?_['map'](_0x5ce5be[_0xcee3('0x20')]['include'],function(_0x2a4996){return{'model':db[_0x2a4996['model']],'as':_0x2a4996['as'],'attributes':_0x2a4996['attributes'],'include':_0x2a4996[_0xcee3('0x25')]?_['map'](_0x2a4996[_0xcee3('0x25')],function(_0x322e05){return{'model':db[_0x322e05[_0xcee3('0x27')]],'as':_0x322e05['as'],'attributes':_0x322e05[_0xcee3('0x23')],'include':_0x322e05['include']?_['map'](_0x322e05[_0xcee3('0x25')],function(_0x45feca){return{'model':db[_0x45feca['model']],'as':_0x45feca['as'],'attributes':_0x45feca[_0xcee3('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcee3('0x11')](function(_0x55081a){if(_0x5ce5be[_0xcee3('0x20')][_0xcee3('0x2a')]===!![])_0x55081a[_0xcee3('0x2b')](_0xcee3('0x2c'),_0x55081a[_0xcee3('0x2d')]());logger[_0xcee3('0x12')]('ShowMailAccount',_0x5ce5be);logger[_0xcee3('0x14')](_0xcee3('0x28'),_0x5ce5be,JSON[_0xcee3('0x17')](_0x55081a));_0x56f705(_0x55081a);})[_0xcee3('0x1c')](function(_0x3ea90f){logger[_0xcee3('0x18')](_0xcee3('0x28'),_0x3ea90f['message'],_0x5ce5be);_0x74019c(_0x298a29[_0xcee3('0x18')](0x1f4,_0x3ea90f[_0xcee3('0x1a')]));});});};exports[_0xcee3('0x2e')]=function(_0x51aae6){var _0x45dab9=this;return new Promise(function(_0x436961,_0x5a7c9f){var _0x305bfa={'body':_0x51aae6[_0xcee3('0x2f')],'channel':_0xcee3('0x30')};var _0x5b4b40=_[_0xcee3('0x31')](_[_0xcee3('0x32')](db[_0xcee3('0x33')][_0xcee3('0x34')]),[_0xcee3('0x35'),'updatedAt','CompanyId',_0xcee3('0x36')]);var _0x41cd61=![];if(_0x51aae6[_0xcee3('0x2f')]['id']){delete _0x51aae6[_0xcee3('0x2f')]['id'];}if(_[_0xcee3('0x37')](_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')])){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xcee3('0x37')](_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x2f')])||_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x2f')]===''){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,_0xcee3('0x39')));}if(_['isNil'](_0x51aae6[_0xcee3('0x2f')]['mapKey'])){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,_0xcee3('0x3a')+_0x5b4b40));}if(!_['includes'](_0x5b4b40,_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x3b')])){return _0x5a7c9f(_0x45dab9[_0xcee3('0x18')](0x1f4,_0xcee3('0x3c')+_0x5b4b40));}var _0x12d32e={};_0x12d32e[_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x3b')]]=_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')];return db[_0xcee3('0x1e')]['find']({'where':{'id':_0x51aae6[_0xcee3('0x3d')]['id']},'include':[{'model':db[_0xcee3('0x3e')],'as':'List','include':[{'model':db[_0xcee3('0x33')],'as':_0xcee3('0x3f'),'where':_0x12d32e,'limit':0x1,'order':[[_0xcee3('0x40'),_0xcee3('0x41')]]}]},{'model':db[_0xcee3('0x42')],'as':_0xcee3('0x43')},{'model':db[_0xcee3('0x44')],'as':'Smtp','include':[{'model':db[_0xcee3('0x45')],'as':_0xcee3('0x45')}]}]})[_0xcee3('0x11')](function(_0x27022b){if(_0x27022b&&_0x27022b[_0xcee3('0x46')]){var _0x2a0b71=_0x27022b['get']({'plain':!![]});_0x305bfa[_0xcee3('0x3d')]=_['omit'](_0x2a0b71,[_0xcee3('0x43'),_0xcee3('0x46')]);_0x305bfa[_0xcee3('0x3d')]['smtpOptions']=_0x27022b['getSmtpOptions']();_0x305bfa[_0xcee3('0x47')]=_0x2a0b71[_0xcee3('0x43')];_0x305bfa['list']=_0x2a0b71[_0xcee3('0x46')];_0x305bfa['applications']=_[_0xcee3('0x48')](_0x305bfa[_0xcee3('0x47')],[_0xcee3('0x49')],[_0xcee3('0x4a')]);if(_0x305bfa['account']&&_0x305bfa['account']['autoclose']){_0x305bfa[_0xcee3('0x47')][_0xcee3('0x4b')]({'id':0x0,'priority':_0x305bfa[_0xcee3('0x47')]['length']+0x1,'app':_0xcee3('0x4c'),'appdata':_0xcee3('0x4d'),'interval':_0xcee3('0x4e')});}if(_0x305bfa[_0xcee3('0x3d')][_0xcee3('0x43')]){delete _0x305bfa[_0xcee3('0x3d')][_0xcee3('0x43')];}if(_0x305bfa['account']['List']){delete _0x305bfa[_0xcee3('0x3d')]['List'];}if(_0x2a0b71['List']['Contacts'][_0xcee3('0x4f')]){return _0x2a0b71[_0xcee3('0x46')][_0xcee3('0x3f')][0x0];}var _0x295451=_[_0xcee3('0xb')](_0x51aae6['body'],{'firstName':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')],'ListId':_0x2a0b71[_0xcee3('0x36')]});_0x295451[_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x3b')]]=_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x38')];return db[_0xcee3('0x33')][_0xcee3('0x50')](_0x295451);}else{throw new Error('List\x20not\x20found');}})[_0xcee3('0x11')](function(_0x2e7a8d){_0x305bfa[_0xcee3('0x51')]=_0x2e7a8d;if(_0x2e7a8d){if(!_0x51aae6['body'][_0xcee3('0x1a')]['messageId']){_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x52')]=rs[_0xcee3('0x53')]()+'\x20'+_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x38')];}var _0x46f817={'ContactId':_0x2e7a8d['id'],'MailAccountId':_0x51aae6['account']['id'],'inReplyTo':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x52')],'to':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')][_0xcee3('0x38')],'cc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['cc'],'subject':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x54')],'attach':_0x51aae6['body']['message']['attach'],'lastMsgAt':moment()[_0xcee3('0x55')](_0xcee3('0x56')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x51aae6[_0xcee3('0x3d')]['id']},'include':[{'model':db['MailMessage'],'as':_0xcee3('0x57'),'attributes':[_0xcee3('0x52')],'where':{'messageId':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x58')]}}]})[_0xcee3('0x11')](function(_0x1b5d89){if(_0x1b5d89){return[_0x1b5d89,![]];}return db['MailInteraction']['create'](_0x46f817)[_0xcee3('0x11')](function(_0x9d6ffd){return[_0x9d6ffd,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x22e6b9,_0x3ce8ad){if(_0x22e6b9){_0x41cd61=_0x3ce8ad;if(!_0x3ce8ad){return _0x22e6b9[_0xcee3('0x59')]({'inReplyTo':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['messageId'],'to':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['from'],'cc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['cc'],'subject':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x54')],'attach':_0x22e6b9[_0xcee3('0x5a')]?_0x22e6b9['attach']:_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x5a')],'substatus':null,'substatusAt':moment()[_0xcee3('0x55')](_0xcee3('0x56')),'lastMsgAt':moment()[_0xcee3('0x55')](_0xcee3('0x56')),'lastMsgDirection':'in'});}else{return _0x22e6b9;}}})[_0xcee3('0x11')](function(_0x1cb05d){_0x305bfa[_0xcee3('0x5b')]=_0x1cb05d[_0xcee3('0x5c')]({'plain':!![]});_0x305bfa['interaction'][_0xcee3('0x5d')]=_0x41cd61;return db[_0xcee3('0x5e')][_0xcee3('0x50')]({'body':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x2f')],'MailAccountId':_0x51aae6['account']['id'],'MailInteractionId':_0x1cb05d['id'],'direction':'in','ContactId':_0x305bfa[_0xcee3('0x51')]['id'],'messageId':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['messageId'],'from':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['from'],'to':_0x51aae6['body'][_0xcee3('0x1a')]['to'],'cc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['cc'],'subject':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x54')],'attach':_0x51aae6[_0xcee3('0x2f')]['message']['attach'],'Attachments':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x5f')],'originTo':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')][_0xcee3('0x60')],'originCc':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')]['originCc'],'bcc':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x61')],'ChatWebsiteId':_0x51aae6[_0xcee3('0x2f')]['message'][_0xcee3('0x62')]||null,'originChannel':_0x51aae6[_0xcee3('0x2f')][_0xcee3('0x1a')][_0xcee3('0x63')]||_0xcee3('0x64'),'ChatOfflineMessageId':_0x51aae6['body'][_0xcee3('0x1a')][_0xcee3('0x65')]||null},{'include':[{'model':db[_0xcee3('0x66')],'as':'Attachments'}]});})['then'](function(_0x23cd22){_0x305bfa[_0xcee3('0x1a')]=_0x23cd22;if(!_0x305bfa[_0xcee3('0x5b')][_0xcee3('0x67')]){return;}return db[_0xcee3('0x68')]['find']({'attributes':['id',_0xcee3('0x69')],'where':{'id':_0x305bfa['interaction']['UserId']}});})['then'](function(_0x237a9d){if(_0x237a9d){_0x305bfa[_0xcee3('0x47')][_0xcee3('0x6a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x237a9d[_0xcee3('0x69')]+','+(_0x305bfa[_0xcee3('0x3d')][_0xcee3('0x6b')]||0xa),'interval':_0xcee3('0x4e')});}if(!_0x305bfa[_0xcee3('0x5b')][_0xcee3('0x6c')]){return;}return db[_0xcee3('0x6d')][_0xcee3('0x29')]({'attributes':['id',_0xcee3('0x69')],'where':{'id':_0x305bfa['interaction'][_0xcee3('0x6c')]}});})[_0xcee3('0x11')](function(_0x513fce){if(_0x513fce){_0x305bfa[_0xcee3('0x47')][_0xcee3('0x6a')]({'id':0x0,'priority':0x1,'app':_0xcee3('0x6e'),'appdata':_0x513fce[_0xcee3('0x69')]+','+(_0x305bfa[_0xcee3('0x3d')][_0xcee3('0x6f')]||0x12c),'interval':_0xcee3('0x4e')});}return respondWithRpcPromise(_0xcee3('0x70'),_0xcee3('0x71'),_0x305bfa);})[_0xcee3('0x11')](function(_0x17cb5c){_0x436961(_0x17cb5c);})[_0xcee3('0x1c')](function(_0x51d3cf){_0x5a7c9f(_0x45dab9['error'](0x1f4,_0x51d3cf['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index df0c5ca..f06e721 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 _0x8d62=['removeListener','register','mailAccount:','save','remove','update','emit'];(function(_0x1404e3,_0x517dea){var _0x1f3f05=function(_0x382ecd){while(--_0x382ecd){_0x1404e3['push'](_0x1404e3['shift']());}};_0x1f3f05(++_0x517dea);}(_0x8d62,0xf8));var _0x28d6=function(_0x1ba0f1,_0x4426e6){_0x1ba0f1=_0x1ba0f1-0x0;var _0x2e5f8b=_0x8d62[_0x1ba0f1];return _0x2e5f8b;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x28d6('0x0'),_0x28d6('0x1'),_0x28d6('0x2')];function createListener(_0x35f879,_0x289849){return function(_0x600112){_0x289849[_0x28d6('0x3')](_0x35f879,_0x600112);};}function removeListener(_0x41e7b4,_0x34029f){return function(){MailAccountEvents[_0x28d6('0x4')](_0x41e7b4,_0x34029f);};}exports[_0x28d6('0x5')]=function(_0x4385ba){for(var _0x3c827b=0x0,_0xe8aa7b=events['length'];_0x3c827b<_0xe8aa7b;_0x3c827b++){var _0x1d5399=events[_0x3c827b];var _0xb9dccb=createListener(_0x28d6('0x6')+_0x1d5399,_0x4385ba);MailAccountEvents['on'](_0x1d5399,_0xb9dccb);}}; \ No newline at end of file +var _0xc224=['save','remove','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x32ed23,_0x36e53c){var _0x15c3ab=function(_0x110dec){while(--_0x110dec){_0x32ed23['push'](_0x32ed23['shift']());}};_0x15c3ab(++_0x36e53c);}(_0xc224,0x1af));var _0x4c22=function(_0x548234,_0x1f77bd){_0x548234=_0x548234-0x0;var _0x2b8582=_0xc224[_0x548234];return _0x2b8582;};'use strict';var MailAccountEvents=require(_0x4c22('0x0'));var events=[_0x4c22('0x1'),_0x4c22('0x2'),'update'];function createListener(_0x2e2f0e,_0x3e65a2){return function(_0x3b252b){_0x3e65a2[_0x4c22('0x3')](_0x2e2f0e,_0x3b252b);};}function removeListener(_0x369842,_0x313fb9){return function(){MailAccountEvents[_0x4c22('0x4')](_0x369842,_0x313fb9);};}exports[_0x4c22('0x5')]=function(_0x576de1){for(var _0x5d036f=0x0,_0x49f782=events[_0x4c22('0x6')];_0x5d036f<_0x49f782;_0x5d036f++){var _0x3a6191=events[_0x5d036f];var _0x45397c=createListener(_0x4c22('0x7')+_0x3a6191,_0x576de1);MailAccountEvents['on'](_0x3a6191,_0x45397c);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b5ba02d..46bc6bf 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 _0xec5c=['delete','/:id','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','update'];(function(_0x327214,_0x347563){var _0x2bddbb=function(_0x1bdf9c){while(--_0x1bdf9c){_0x327214['push'](_0x327214['shift']());}};_0x2bddbb(++_0x347563);}(_0xec5c,0xe2));var _0xcec5=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xec5c[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0xcec5('0x0'));var util=require(_0xcec5('0x1'));var path=require(_0xcec5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcec5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcec5('0x4'));var interaction=require(_0xcec5('0x5'));var config=require(_0xcec5('0x6'));var controller=require(_0xcec5('0x7'));router['get']('/:id',auth[_0xcec5('0x8')](),controller[_0xcec5('0x9')]);router[_0xcec5('0xa')]('/:id',auth[_0xcec5('0x8')](),controller[_0xcec5('0xb')]);router[_0xcec5('0xc')](_0xcec5('0xd'),auth[_0xcec5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe4a0=['destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','put','isAuthenticated','update','delete'];(function(_0x2f91a6,_0x4e44ff){var _0x324cb5=function(_0x452102){while(--_0x452102){_0x2f91a6['push'](_0x2f91a6['shift']());}};_0x324cb5(++_0x4e44ff);}(_0xe4a0,0xc5));var _0x0e4a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe4a0[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x0e4a('0x0'));var util=require(_0x0e4a('0x1'));var path=require('path');var timeout=require(_0x0e4a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0e4a('0x3'));var auth=require(_0x0e4a('0x4'));var interaction=require(_0x0e4a('0x5'));var config=require('../../config/environment');var controller=require(_0x0e4a('0x6'));router[_0x0e4a('0x7')](_0x0e4a('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0e4a('0x9')](_0x0e4a('0x8'),auth[_0x0e4a('0xa')](),controller[_0x0e4a('0xb')]);router[_0x0e4a('0xc')](_0x0e4a('0x8'),auth['isAuthenticated'](),controller[_0x0e4a('0xd')]);module[_0x0e4a('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ba1e7bb..15fc5af 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 _0x2bfd=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x2bfd,0x77));var _0xd2bf=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x2bfd[_0x22bdd3];return _0x44d9d9;};'use strict';var Sequelize=require(_0xd2bf('0x0'));module[_0xd2bf('0x1')]={'priority':{'type':Sequelize[_0xd2bf('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd2bf('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd2bf('0x4')]},'interval':{'type':Sequelize[_0xd2bf('0x4')],'defaultValue':_0xd2bf('0x5')}}; \ No newline at end of file +var _0x0e3a=['STRING','noop','*,*,*,*','INTEGER'];(function(_0x12db55,_0x293a54){var _0x1bc5f5=function(_0x43801b){while(--_0x43801b){_0x12db55['push'](_0x12db55['shift']());}};_0x1bc5f5(++_0x293a54);}(_0x0e3a,0x16b));var _0xa0e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0e3a[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xa0e3('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xa0e3('0x1')],'allowNull':![],'defaultValue':_0xa0e3('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa0e3('0x1')]},'interval':{'type':Sequelize[_0xa0e3('0x1')],'defaultValue':_0xa0e3('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c643d07..2cc3348 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(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x70e0,0x17b));var _0x070e=function(_0x300e7e,_0x17b200){_0x300e7e=_0x300e7e-0x0;var _0x89266e=_0x70e0[_0x300e7e];return _0x89266e;};'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 _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','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','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x2f3104,_0x133bea){var _0x3f0eb7=function(_0x2fe31d){while(--_0x2fe31d){_0x2f3104['push'](_0x2f3104['shift']());}};_0x3f0eb7(++_0x133bea);}(_0xda3f,0xec));var _0xfda3=function(_0x238128,_0x29e2d6){_0x238128=_0x238128-0x0;var _0x41a7f6=_0xda3f[_0x238128];return _0x41a7f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 8f024e1..4f0f377 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 _0xee84=['mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./mailApplication.attributes','exports','define'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0xee84,0x189));var _0x4ee8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xee84[_0x432682];return _0x463d05;};'use strict';var _=require(_0x4ee8('0x0'));var util=require(_0x4ee8('0x1'));var logger=require(_0x4ee8('0x2'))(_0x4ee8('0x3'));var moment=require(_0x4ee8('0x4'));var BPromise=require('bluebird');var rp=require(_0x4ee8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ee8('0x6'));var config=require('../../config/environment');var attributes=require(_0x4ee8('0x7'));module[_0x4ee8('0x8')]=function(_0xd1bc65,_0xe0b1da){return _0xd1bc65[_0x4ee8('0x9')]('MailApplication',attributes,{'tableName':_0x4ee8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ee8('0xb'),'collate':_0x4ee8('0xc')});}; \ No newline at end of file +var _0xf53f=['bluebird','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x2195da,_0x567f27){var _0x229a0a=function(_0x2779cd){while(--_0x2779cd){_0x2195da['push'](_0x2195da['shift']());}};_0x229a0a(++_0x567f27);}(_0xf53f,0x191));var _0xff53=function(_0x1c1205,_0x450ea6){_0x1c1205=_0x1c1205-0x0;var _0x5da119=_0xf53f[_0x1c1205];return _0x5da119;};'use strict';var _=require(_0xff53('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xff53('0x1'));var moment=require('moment');var BPromise=require(_0xff53('0x2'));var rp=require(_0xff53('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff53('0x4'));var config=require(_0xff53('0x5'));var attributes=require(_0xff53('0x6'));module[_0xff53('0x7')]=function(_0x445c67,_0x4918cd){return _0x445c67[_0xff53('0x8')](_0xff53('0x9'),attributes,{'tableName':_0xff53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xff53('0xb'),'collate':_0xff53('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index dbb208e..deeeea3 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 _0xa883=['client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateMailApplication','update','body','options','where','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa883,0xe8));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a88('0x0'));var util=require(_0x3a88('0x1'));var moment=require(_0x3a88('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a88('0x3'));var db=require(_0x3a88('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a88('0x5'));var config=require(_0x3a88('0x6'));var jayson=require(_0x3a88('0x7'));var client=jayson[_0x3a88('0x8')][_0x3a88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x641655,_0x33b827,_0x489d5e){return new BPromise(function(_0x31a2dc,_0x329b04){return client[_0x3a88('0xa')](_0x641655,_0x489d5e)[_0x3a88('0xb')](function(_0x3ad430){logger[_0x3a88('0xc')](_0x3a88('0xd'),_0x33b827,'request\x20sent');logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x33b827,_0x3a88('0xe'),JSON['stringify'](_0x3ad430));if(_0x3ad430['error']){if(_0x3ad430[_0x3a88('0xf')]['code']===0x1f4){logger[_0x3a88('0xf')](_0x3a88('0xd'),_0x33b827,_0x3ad430['error'][_0x3a88('0x10')]);return _0x329b04(_0x3ad430[_0x3a88('0xf')][_0x3a88('0x10')]);}logger[_0x3a88('0xf')](_0x3a88('0xd'),_0x33b827,_0x3ad430[_0x3a88('0xf')][_0x3a88('0x10')]);return _0x31a2dc(_0x3ad430[_0x3a88('0xf')][_0x3a88('0x10')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x33b827,'request\x20sent');_0x31a2dc(_0x3ad430[_0x3a88('0x11')][_0x3a88('0x10')]);}})[_0x3a88('0x12')](function(_0x3fa4a9){logger['error'](_0x3a88('0xd'),_0x33b827,_0x3fa4a9);_0x329b04(_0x3fa4a9);});});}exports[_0x3a88('0x13')]=function(_0x1c2421){var _0x195f5b=this;return new Promise(function(_0x25a5a6,_0x30ac04){return db['MailApplication'][_0x3a88('0x14')](_0x1c2421[_0x3a88('0x15')],{'raw':_0x1c2421[_0x3a88('0x16')]?_0x1c2421[_0x3a88('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c2421['options']?_0x1c2421[_0x3a88('0x16')][_0x3a88('0x17')]||null:null,'attributes':_0x1c2421[_0x3a88('0x16')]?_0x1c2421[_0x3a88('0x16')]['attributes']||null:null,'limit':_0x1c2421[_0x3a88('0x16')]?_0x1c2421['options']['limit']||null:null})[_0x3a88('0xb')](function(_0x35bf1c){logger[_0x3a88('0xc')](_0x3a88('0x13'),_0x1c2421);logger['debug'](_0x3a88('0x13'),_0x1c2421,JSON['stringify'](_0x35bf1c));_0x25a5a6(_0x35bf1c);})[_0x3a88('0x12')](function(_0x48c0ea){logger['error'](_0x3a88('0x13'),_0x48c0ea[_0x3a88('0x10')],_0x1c2421);_0x30ac04(_0x195f5b[_0x3a88('0xf')](0x1f4,_0x48c0ea[_0x3a88('0x10')]));});});}; \ No newline at end of file +var _0x5264=['options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','body'];(function(_0x2be070,_0x39cf2e){var _0x37eb4a=function(_0x22f28d){while(--_0x22f28d){_0x2be070['push'](_0x2be070['shift']());}};_0x37eb4a(++_0x39cf2e);}(_0x5264,0x81));var _0x4526=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5264[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4526('0x0'));var util=require(_0x4526('0x1'));var moment=require(_0x4526('0x2'));var BPromise=require('bluebird');var rs=require(_0x4526('0x3'));var fs=require('fs');var Redis=require(_0x4526('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4526('0x5'));var logger=require(_0x4526('0x6'))(_0x4526('0x7'));var config=require(_0x4526('0x8'));var jayson=require(_0x4526('0x9'));var client=jayson[_0x4526('0xa')][_0x4526('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a6f94,_0x27eb5e,_0x5c99bf){return new BPromise(function(_0x17e721,_0x55b028){return client['request'](_0x3a6f94,_0x5c99bf)[_0x4526('0xc')](function(_0x4c728f){logger[_0x4526('0xd')]('MailApplication,\x20%s,\x20%s',_0x27eb5e,_0x4526('0xe'));logger[_0x4526('0xf')](_0x4526('0x10'),_0x27eb5e,_0x4526('0xe'),JSON['stringify'](_0x4c728f));if(_0x4c728f[_0x4526('0x11')]){if(_0x4c728f[_0x4526('0x11')][_0x4526('0x12')]===0x1f4){logger[_0x4526('0x11')](_0x4526('0x13'),_0x27eb5e,_0x4c728f['error'][_0x4526('0x14')]);return _0x55b028(_0x4c728f[_0x4526('0x11')][_0x4526('0x14')]);}logger[_0x4526('0x11')]('MailApplication,\x20%s,\x20%s',_0x27eb5e,_0x4c728f[_0x4526('0x11')]['message']);return _0x17e721(_0x4c728f['error'][_0x4526('0x14')]);}else{logger[_0x4526('0xd')]('MailApplication,\x20%s,\x20%s',_0x27eb5e,_0x4526('0xe'));_0x17e721(_0x4c728f[_0x4526('0x15')][_0x4526('0x14')]);}})[_0x4526('0x16')](function(_0x5966ae){logger[_0x4526('0x11')]('MailApplication,\x20%s,\x20%s',_0x27eb5e,_0x5966ae);_0x55b028(_0x5966ae);});});}exports[_0x4526('0x17')]=function(_0x334866){var _0x539033=this;return new Promise(function(_0x69b4e,_0x417526){return db['MailApplication'][_0x4526('0x18')](_0x334866[_0x4526('0x19')],{'raw':_0x334866[_0x4526('0x1a')]?_0x334866[_0x4526('0x1a')][_0x4526('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x334866['options']?_0x334866[_0x4526('0x1a')][_0x4526('0x1c')]||null:null,'attributes':_0x334866[_0x4526('0x1a')]?_0x334866[_0x4526('0x1a')][_0x4526('0x1d')]||null:null,'limit':_0x334866[_0x4526('0x1a')]?_0x334866[_0x4526('0x1a')][_0x4526('0x1e')]||null:null})[_0x4526('0xc')](function(_0x3eb1d2){logger[_0x4526('0xd')](_0x4526('0x17'),_0x334866);logger[_0x4526('0xf')](_0x4526('0x17'),_0x334866,JSON['stringify'](_0x3eb1d2));_0x69b4e(_0x3eb1d2);})[_0x4526('0x16')](function(_0xd3a152){logger[_0x4526('0x11')](_0x4526('0x17'),_0xd3a152[_0x4526('0x14')],_0x334866);_0x417526(_0x539033['error'](0x1f4,_0xd3a152[_0x4526('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 80df019..3360b4f 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 _0xce02=['post','create','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','mailinteraction:destroy','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/:id','show','getMessages','download'];(function(_0x38b3e8,_0x5c35e4){var _0x3ed782=function(_0x226e51){while(--_0x226e51){_0x38b3e8['push'](_0x38b3e8['shift']());}};_0x3ed782(++_0x5c35e4);}(_0xce02,0x139));var _0x2ce0=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0xce02[_0x25701b];return _0x3a8a2c;};'use strict';var express=require(_0x2ce0('0x0'));var router=express[_0x2ce0('0x1')]();var auth=require(_0x2ce0('0x2'));var interaction=require(_0x2ce0('0x3'));var controller=require(_0x2ce0('0x4'));router[_0x2ce0('0x5')]('/',auth[_0x2ce0('0x6')](),controller[_0x2ce0('0x7')]);router[_0x2ce0('0x5')]('/describe',auth[_0x2ce0('0x6')](),controller['describe']);router[_0x2ce0('0x5')](_0x2ce0('0x8'),auth[_0x2ce0('0x6')](),controller[_0x2ce0('0x9')]);router[_0x2ce0('0x5')]('/:id/messages',auth[_0x2ce0('0x6')](),controller[_0x2ce0('0xa')]);router[_0x2ce0('0x5')]('/:id/download',auth[_0x2ce0('0x6')](),controller[_0x2ce0('0xb')]);router[_0x2ce0('0xc')]('/',auth[_0x2ce0('0x6')](),controller[_0x2ce0('0xd')]);router[_0x2ce0('0xc')](_0x2ce0('0xe'),auth['isAuthenticated'](),controller['addMessage']);router[_0x2ce0('0xc')](_0x2ce0('0xf'),auth[_0x2ce0('0x6')](),interaction[_0x2ce0('0x10')](_0x2ce0('0x11'),_0x2ce0('0x12')),controller[_0x2ce0('0x13')]);router['put'](_0x2ce0('0x8'),auth[_0x2ce0('0x6')](),interaction[_0x2ce0('0x10')](_0x2ce0('0x11'),_0x2ce0('0x14')),controller[_0x2ce0('0x15')]);router['delete'](_0x2ce0('0x8'),auth[_0x2ce0('0x6')](),interaction[_0x2ce0('0x10')](_0x2ce0('0x11'),_0x2ce0('0x16')),controller['destroy']);router[_0x2ce0('0x17')](_0x2ce0('0xf'),auth[_0x2ce0('0x6')](),controller['removeTags']);module[_0x2ce0('0x18')]=router; \ No newline at end of file +var _0x092a=['../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','addTags','put','tracked','mail','update','delete','mailinteraction:destroy','destroy','express','Router','../../components/auth/service'];(function(_0x624727,_0x42f874){var _0x5ac512=function(_0x2a45b3){while(--_0x2a45b3){_0x624727['push'](_0x624727['shift']());}};_0x5ac512(++_0x42f874);}(_0x092a,0x18d));var _0xa092=function(_0x3446af,_0x3b2f92){_0x3446af=_0x3446af-0x0;var _0x252b14=_0x092a[_0x3446af];return _0x252b14;};'use strict';var express=require(_0xa092('0x0'));var router=express[_0xa092('0x1')]();var auth=require(_0xa092('0x2'));var interaction=require(_0xa092('0x3'));var controller=require(_0xa092('0x4'));router[_0xa092('0x5')]('/',auth[_0xa092('0x6')](),controller[_0xa092('0x7')]);router['get'](_0xa092('0x8'),auth['isAuthenticated'](),controller[_0xa092('0x9')]);router[_0xa092('0x5')](_0xa092('0xa'),auth[_0xa092('0x6')](),controller['show']);router[_0xa092('0x5')](_0xa092('0xb'),auth[_0xa092('0x6')](),controller['getMessages']);router['get'](_0xa092('0xc'),auth[_0xa092('0x6')](),controller[_0xa092('0xd')]);router[_0xa092('0xe')]('/',auth[_0xa092('0x6')](),controller['create']);router[_0xa092('0xe')](_0xa092('0xb'),auth[_0xa092('0x6')](),controller[_0xa092('0xf')]);router[_0xa092('0xe')](_0xa092('0x10'),auth[_0xa092('0x6')](),interaction['tracked']('mail','mailinteraction:addtags'),controller[_0xa092('0x11')]);router[_0xa092('0x12')](_0xa092('0xa'),auth[_0xa092('0x6')](),interaction[_0xa092('0x13')](_0xa092('0x14'),'mailinteraction:update'),controller[_0xa092('0x15')]);router[_0xa092('0x16')]('/:id',auth[_0xa092('0x6')](),interaction['tracked'](_0xa092('0x14'),_0xa092('0x17')),controller[_0xa092('0x18')]);router[_0xa092('0x16')](_0xa092('0x10'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 202c95d..9c48d23 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 _0xf929=['out','INTEGER','sequelize','iconv','DATE','STRING','TEXT','long','BOOLEAN','ENUM'];(function(_0x1defb7,_0xdcac88){var _0x148e3c=function(_0x58aa7f){while(--_0x58aa7f){_0x1defb7['push'](_0x1defb7['shift']());}};_0x148e3c(++_0xdcac88);}(_0xf929,0x1ce));var _0x9f92=function(_0x534dd0,_0x48807b){_0x534dd0=_0x534dd0-0x0;var _0x16c2a7=_0xf929[_0x534dd0];return _0x16c2a7;};'use strict';var Sequelize=require(_0x9f92('0x0'));var iconv=require(_0x9f92('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9f92('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9f92('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x9f92('0x3')](0x1fe)},'to':{'type':Sequelize[_0x9f92('0x3')]},'cc':{'type':Sequelize[_0x9f92('0x4')](_0x9f92('0x5'))},'subject':{'type':Sequelize[_0x9f92('0x4')]()},'attach':{'type':Sequelize[_0x9f92('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x9f92('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9f92('0x7')]('in',_0x9f92('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9f92('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9f92('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9f92('0x9')]}}; \ No newline at end of file +var _0x2357=['ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x2357,0xc1));var _0x7235=function(_0x511f28,_0x172aad){_0x511f28=_0x511f28-0x0;var _0x55a3ee=_0x2357[_0x511f28];return _0x55a3ee;};'use strict';var Sequelize=require(_0x7235('0x0'));var iconv=require('iconv');module[_0x7235('0x1')]={'closed':{'type':Sequelize[_0x7235('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7235('0x3')]},'disposition':{'type':Sequelize[_0x7235('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7235('0x4')](0x1fe)},'to':{'type':Sequelize[_0x7235('0x4')]},'cc':{'type':Sequelize[_0x7235('0x5')](_0x7235('0x6'))},'subject':{'type':Sequelize[_0x7235('0x5')]()},'attach':{'type':Sequelize[_0x7235('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x7235('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x7235('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7235('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7235('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7235('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7235('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7235('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index a5203bc..4f4413c 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 _0x2d2a=['bcc','subject','createdAt','Messages','get','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','readFileSync','build','writeFileSync','unlinkSync','eml-format','zip-dir','moment','bluebird','util','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','status','json','undefined','count','offset','set','Content-Range','update','then','end','error','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','key','query','show','params','model','keys','filters','intersection','attributes','fields','includeAll','options','find','create','body','catch','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','length','hasOwnProperty','limit','order','MailInteractionId','filter','where','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','spread','Tag','findAll','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','root','join','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','from'];(function(_0x56f44f,_0x23df36){var _0x34c37a=function(_0x369590){while(--_0x369590){_0x56f44f['push'](_0x56f44f['shift']());}};_0x34c37a(++_0x23df36);}(_0x2d2a,0xed));var _0xa2d2=function(_0x1962e5,_0x491f13){_0x1962e5=_0x1962e5-0x0;var _0x423f82=_0x2d2a[_0x1962e5];return _0x423f82;};'use strict';var emlformat=require(_0xa2d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa2d2('0x1'));var moment=require(_0xa2d2('0x2'));var BPromise=require(_0xa2d2('0x3'));var util=require(_0xa2d2('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xa2d2('0x5'));var juice=require(_0xa2d2('0x6'));var Redis=require(_0xa2d2('0x7'));var interaction=require(_0xa2d2('0x8'));var qs=require(_0xa2d2('0x9'));var logger=require(_0xa2d2('0xa'))(_0xa2d2('0xb'));var config=require(_0xa2d2('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0xa2d2('0xd')]=_[_0xa2d2('0xe')](config[_0xa2d2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2d2('0xf'))(new Redis(config[_0xa2d2('0xd')]));require(_0xa2d2('0x10'))[_0xa2d2('0x11')](socket);function respondWithStatusCode(_0x1fe8e2,_0x24db5e){_0x24db5e=_0x24db5e||0xcc;return function(_0x2bee7e){if(_0x2bee7e){return _0x1fe8e2['sendStatus'](_0x24db5e);}return _0x1fe8e2[_0xa2d2('0x12')](_0x24db5e)['end']();};}function respondWithResult(_0x4e4e8b,_0x21fbf8){_0x21fbf8=_0x21fbf8||0xc8;return function(_0x39fbc8){if(_0x39fbc8){return _0x4e4e8b[_0xa2d2('0x12')](_0x21fbf8)[_0xa2d2('0x13')](_0x39fbc8);}};}function respondWithFilteredResult(_0x173ca9,_0x57488d){return function(_0x1ce30f){if(_0x1ce30f){var _0x888337=typeof _0x57488d['offset']===_0xa2d2('0x14')&&typeof _0x57488d['limit']===_0xa2d2('0x14');var _0x5e5be2=_0x1ce30f[_0xa2d2('0x15')];var _0x330714=_0x888337?0x0:_0x57488d[_0xa2d2('0x16')];var _0x2f5807=_0x888337?_0x1ce30f[_0xa2d2('0x15')]:_0x57488d[_0xa2d2('0x16')]+_0x57488d['limit'];var _0x2ac820;if(_0x2f5807>=_0x5e5be2){_0x2f5807=_0x5e5be2;_0x2ac820=0xc8;}else{_0x2ac820=0xce;}_0x173ca9[_0xa2d2('0x12')](_0x2ac820);return _0x173ca9[_0xa2d2('0x17')](_0xa2d2('0x18'),_0x330714+'-'+_0x2f5807+'/'+_0x5e5be2)[_0xa2d2('0x13')](_0x1ce30f);}return null;};}function saveUpdates(_0x58f71b){return function(_0x343992){if(_0x343992){return _0x343992[_0xa2d2('0x19')](_0x58f71b)[_0xa2d2('0x1a')](function(_0x14f25c){return _0x14f25c;});}return null;};}function removeEntity(_0x37b385){return function(_0x385f5f){if(_0x385f5f){return _0x385f5f['destroy']()['then'](function(){_0x37b385['status'](0xcc)[_0xa2d2('0x1b')]();});}};}function handleEntityNotFound(_0x31b22a){return function(_0xc66054){if(!_0xc66054){_0x31b22a['sendStatus'](0x194);}return _0xc66054;};}function handleError(_0x3496ba,_0x2c0ca8){_0x2c0ca8=_0x2c0ca8||0x1f4;return function(_0x206c62){logger[_0xa2d2('0x1c')](_0x206c62[_0xa2d2('0x1d')]);if(_0x206c62[_0xa2d2('0x1e')]){delete _0x206c62[_0xa2d2('0x1e')];}_0x3496ba['status'](_0x2c0ca8)[_0xa2d2('0x1f')](_0x206c62);};}exports['index']=function(_0x5501f1,_0x147428){var _0x30d7c3={};var _0x568d9d=_[_0xa2d2('0x20')](db[_0xa2d2('0x21')][_0xa2d2('0x22')],function(_0x4e1cc9){return{'name':_0x4e1cc9[_0xa2d2('0x23')],'type':_0x4e1cc9[_0xa2d2('0x24')][_0xa2d2('0x25')]};});_0x30d7c3=qs['getOptions'](_0x568d9d,_0x5501f1);return interaction['findAll']('mail',_0x5501f1[_0xa2d2('0x26')],_0x5501f1['user'],_0x30d7c3,_0x568d9d)[_0xa2d2('0x1a')](respondWithFilteredResult(_0x147428,_0x30d7c3))['catch'](handleError(_0x147428,null));};exports[_0xa2d2('0x27')]=function(_0x171320,_0xe037ac){var _0x5cb1cf={'raw':![],'where':{'id':_0x171320[_0xa2d2('0x28')]['id']}},_0x47cbef={};_0x47cbef[_0xa2d2('0x29')]=_[_0xa2d2('0x2a')](db[_0xa2d2('0x21')][_0xa2d2('0x22')]);_0x47cbef[_0xa2d2('0x26')]=_['keys'](_0x171320[_0xa2d2('0x26')]);_0x47cbef[_0xa2d2('0x2b')]=_[_0xa2d2('0x2c')](_0x47cbef[_0xa2d2('0x29')],_0x47cbef['query']);_0x5cb1cf[_0xa2d2('0x2d')]=_[_0xa2d2('0x2c')](_0x47cbef[_0xa2d2('0x29')],qs[_0xa2d2('0x2e')](_0x171320[_0xa2d2('0x26')][_0xa2d2('0x2e')]));_0x5cb1cf['attributes']=_0x5cb1cf['attributes']['length']?_0x5cb1cf[_0xa2d2('0x2d')]:_0x47cbef[_0xa2d2('0x29')];if(_0x171320['query'][_0xa2d2('0x2f')]){_0x5cb1cf['include']=[{'all':!![]}];}_0x5cb1cf=_['merge']({},_0x5cb1cf,_0x171320[_0xa2d2('0x30')]);return db['MailInteraction'][_0xa2d2('0x31')](_0x5cb1cf)[_0xa2d2('0x1a')](handleEntityNotFound(_0xe037ac,null))[_0xa2d2('0x1a')](respondWithResult(_0xe037ac,null))['catch'](handleError(_0xe037ac,null));};exports[_0xa2d2('0x32')]=function(_0x84195,_0x590376){return db[_0xa2d2('0x21')][_0xa2d2('0x32')](_0x84195[_0xa2d2('0x33')],{})['then'](respondWithResult(_0x590376,0xc9))['catch'](handleError(_0x590376,null));};exports[_0xa2d2('0x19')]=function(_0x3d4b65,_0x51b79a){if(_0x3d4b65[_0xa2d2('0x33')]['id']){delete _0x3d4b65[_0xa2d2('0x33')]['id'];}return db[_0xa2d2('0x21')][_0xa2d2('0x31')]({'where':{'id':_0x3d4b65[_0xa2d2('0x28')]['id']}})[_0xa2d2('0x1a')](handleEntityNotFound(_0x51b79a,null))['then'](saveUpdates(_0x3d4b65[_0xa2d2('0x33')],null))[_0xa2d2('0x1a')](respondWithResult(_0x51b79a,null))[_0xa2d2('0x34')](handleError(_0x51b79a,null));};exports['destroy']=function(_0x5634f2,_0x384f8c){return db[_0xa2d2('0x21')]['find']({'where':{'id':_0x5634f2['params']['id']}})['then'](handleEntityNotFound(_0x384f8c,null))['then'](removeEntity(_0x384f8c,null))[_0xa2d2('0x34')](handleError(_0x384f8c,null));};exports[_0xa2d2('0x35')]=function(_0x5c6cbf,_0xc55c6c){return db[_0xa2d2('0x21')][_0xa2d2('0x35')]()['then'](respondWithResult(_0xc55c6c,null))['catch'](handleError(_0xc55c6c,null));};exports[_0xa2d2('0x36')]=function(_0x4464ec,_0x3cd435){return db['MailMessage'][_0xa2d2('0x31')]({'where':{'id':_0x4464ec[_0xa2d2('0x28')]['id']}})[_0xa2d2('0x1a')](handleEntityNotFound(_0x3cd435,null))[_0xa2d2('0x1a')](function(_0x4dfec8){if(_0x4dfec8){return _0x4dfec8[_0xa2d2('0x36')](_0x4464ec[_0xa2d2('0x33')][_0xa2d2('0x37')],_[_0xa2d2('0x38')](_0x4464ec[_0xa2d2('0x33')],[_0xa2d2('0x37'),'id'])||{});}})['then'](respondWithResult(_0x3cd435,null))['catch'](handleError(_0x3cd435,null));};exports[_0xa2d2('0x39')]=function(_0x436c58,_0x4336fe){var _0x51c164={'raw':![],'where':{}};var _0x5d1963={};var _0x389d02={'count':0x0,'rows':[]};return db[_0xa2d2('0x21')][_0xa2d2('0x3a')]({'where':{'id':_0x436c58[_0xa2d2('0x28')]['id']}})[_0xa2d2('0x1a')](handleEntityNotFound(_0x4336fe,null))[_0xa2d2('0x1a')](function(_0x4edf79){if(_0x4edf79){_0x5d1963[_0xa2d2('0x29')]=_['keys'](db[_0xa2d2('0x3b')][_0xa2d2('0x22')]);_0x5d1963[_0xa2d2('0x26')]=_['keys'](_0x436c58[_0xa2d2('0x26')]);_0x5d1963[_0xa2d2('0x2b')]=_['intersection'](_0x5d1963[_0xa2d2('0x29')],_0x5d1963[_0xa2d2('0x26')]);_0x51c164['attributes']=_[_0xa2d2('0x2c')](_0x5d1963['model'],qs[_0xa2d2('0x2e')](_0x436c58[_0xa2d2('0x26')][_0xa2d2('0x2e')]));_0x51c164[_0xa2d2('0x2d')]=_0x51c164['attributes'][_0xa2d2('0x3c')]?_0x51c164[_0xa2d2('0x2d')]:_0x5d1963[_0xa2d2('0x29')];if(!_0x436c58[_0xa2d2('0x26')][_0xa2d2('0x3d')]('nolimit')){_0x51c164[_0xa2d2('0x3e')]=qs[_0xa2d2('0x3e')](_0x436c58[_0xa2d2('0x26')][_0xa2d2('0x3e')]);_0x51c164[_0xa2d2('0x16')]=qs[_0xa2d2('0x16')](_0x436c58[_0xa2d2('0x26')][_0xa2d2('0x16')]);}_0x51c164[_0xa2d2('0x3f')]=qs['sort'](_0x436c58[_0xa2d2('0x26')]['sort']);_0x51c164['where']=qs[_0xa2d2('0x2b')](_['pick'](_0x436c58['query'],_0x5d1963['filters']));_0x51c164['where'][_0xa2d2('0x40')]=_0x4edf79['id'];if(_0x436c58['query'][_0xa2d2('0x41')]){_0x51c164[_0xa2d2('0x42')]=_[_0xa2d2('0x43')](_0x51c164[_0xa2d2('0x42')],{'$or':_['map'](_0x51c164[_0xa2d2('0x2d')],function(_0x4b9465){var _0x5ea369={};_0x5ea369[_0x4b9465]={'$like':'%'+_0x436c58['query'][_0xa2d2('0x41')]+'%'};return _0x5ea369;})});}if(_0x436c58['query']['$gte']){var _0x434365=_0x436c58[_0xa2d2('0x26')][_0xa2d2('0x44')]['split'](',');var _0x4bdff0={};_0x4bdff0[_0x434365[0x0]]={'$gte':moment(_0x434365[0x1])[_0xa2d2('0x45')](_0xa2d2('0x46'))};_0x51c164[_0xa2d2('0x42')]=_[_0xa2d2('0x43')](_0x51c164['where'],_0x4bdff0);}_0x51c164=_[_0xa2d2('0x43')]({},_0x51c164,_0x436c58['options']);return db['MailMessage'][_0xa2d2('0x15')]({'where':_0x51c164[_0xa2d2('0x42')]})[_0xa2d2('0x1a')](function(_0x582a7c){_0x389d02[_0xa2d2('0x15')]=_0x582a7c;if(_0x436c58[_0xa2d2('0x26')][_0xa2d2('0x2f')]){_0x51c164['include']=[{'all':!![]}];}return db[_0xa2d2('0x3b')]['findAll'](_0x51c164);})[_0xa2d2('0x1a')](function(_0x2c2bae){if(_0x436c58['query'][_0xa2d2('0x47')]===_0xa2d2('0x48')){for(var _0x58305d=0x0;_0x58305d<_0x2c2bae['length'];_0x58305d++){_0x2c2bae[_0x58305d]['body']=juice(_0x2c2bae[_0x58305d]['body']);}}_0x389d02[_0xa2d2('0x49')]=_0x2c2bae;return _0x389d02;});}})[_0xa2d2('0x1a')](respondWithFilteredResult(_0x4336fe,_0x51c164))[_0xa2d2('0x34')](handleError(_0x4336fe,null));};exports[_0xa2d2('0x4a')]=function(_0x288e59,_0x26df9d){return db[_0xa2d2('0x21')][_0xa2d2('0x31')]({'where':{'id':_0x288e59[_0xa2d2('0x28')]['id']}})[_0xa2d2('0x1a')](handleEntityNotFound(_0x26df9d,null))['then'](function(_0x5c01c3){if(_0x5c01c3){return _0x5c01c3[_0xa2d2('0x4b')](_0x288e59[_0xa2d2('0x33')]['ids'],_[_0xa2d2('0x38')](_0x288e59[_0xa2d2('0x33')],[_0xa2d2('0x37'),'id'])||{})[_0xa2d2('0x4c')](function(){return db[_0xa2d2('0x4d')][_0xa2d2('0x4e')]({'attributes':['id',_0xa2d2('0x1e'),_0xa2d2('0x4f')],'where':{'id':_0x288e59['body']['ids']}});})['then'](function(_0x40b17d){socket[_0xa2d2('0x50')](_0xa2d2('0x51'),{'id':Number(_0x288e59[_0xa2d2('0x28')]['id']),'tags':_0x40b17d||[]});return{'id':Number(_0x288e59['params']['id']),'tags':_0x40b17d||[]};});}})[_0xa2d2('0x1a')](respondWithResult(_0x26df9d,null))[_0xa2d2('0x34')](handleError(_0x26df9d,null));};exports[_0xa2d2('0x52')]=function(_0x23ebd9,_0x49c649){return db[_0xa2d2('0x21')]['find']({'where':{'id':_0x23ebd9['params']['id']}})[_0xa2d2('0x1a')](handleEntityNotFound(_0x49c649,null))[_0xa2d2('0x1a')](function(_0x3e554d){if(_0x3e554d){return _0x3e554d[_0xa2d2('0x52')](_0x23ebd9['query'][_0xa2d2('0x37')]);}})[_0xa2d2('0x1a')](respondWithStatusCode(_0x49c649,null))['catch'](handleError(_0x49c649,null));};exports[_0xa2d2('0x53')]=function(_0xcc3102,_0x29f1b9){var _0x2002b6=moment()[_0xa2d2('0x54')]()[_0xa2d2('0x55')]();var _0x337a6a=path['join'](config[_0xa2d2('0x56')],'server','files','tmp');var _0x28e7fd=path[_0xa2d2('0x57')](config[_0xa2d2('0x56')],_0xa2d2('0x58'),_0xa2d2('0x59'),_0xa2d2('0x5a'));var _0xc4bc97=path[_0xa2d2('0x57')](_0x337a6a,_0x2002b6);var _0x4623f9=util['format'](_0xa2d2('0x5b'),_0xcc3102[_0xa2d2('0x28')]['id'],_0x2002b6);var _0x1620c5=path[_0xa2d2('0x57')](_0x337a6a,_0x4623f9);var _0x116db2=[];if(_0xcc3102['query']['attachments']){_0x116db2[_0xa2d2('0x5c')]({'model':db[_0xa2d2('0x5d')],'as':_0xa2d2('0x5e'),'raw':!![]});}var _0x4087f=[{'model':db[_0xa2d2('0x3b')],'as':'Messages','attributes':['id',_0xa2d2('0x33'),_0xa2d2('0x5f'),'to','cc',_0xa2d2('0x60'),_0xa2d2('0x61'),_0xa2d2('0x62')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x116db2}];return db[_0xa2d2('0x21')][_0xa2d2('0x31')]({'where':{'id':_0xcc3102['params']['id']},'include':_0x4087f})[_0xa2d2('0x1a')](handleEntityNotFound(_0x29f1b9,null))[_0xa2d2('0x1a')](function(_0xf555af){if(_0xf555af&&_0xf555af[_0xa2d2('0x63')]){var _0x31ac94=_0xf555af[_0xa2d2('0x64')]({'plain':!![]});fs['mkdirSync'](_0xc4bc97);return BPromise[_0xa2d2('0x65')](_0x31ac94['Messages'],function(_0x1932aa,_0x33bacc){var _0x1e08a3={'from':_0x1932aa[_0xa2d2('0x5f')],'to':_0x1932aa['to']||_0xa2d2('0x66'),'subject':_0x1932aa['subject'],'html':htmlEntities[_0xa2d2('0x67')](_0x1932aa['body']),'headers':{'Date':moment(_0x1932aa[_0xa2d2('0x62')])[_0xa2d2('0x45')](_0xa2d2('0x68'))},'attachments':[]};if(_0x1932aa['cc']){_0x1e08a3[_0xa2d2('0x69')]['Cc']=_0x1932aa['cc'];}if(_0x1932aa[_0xa2d2('0x60')]){_0x1e08a3['headers']['Bcc']=_0x1932aa[_0xa2d2('0x60')];}return new BPromise(function(_0x131240,_0x4e815d){if(_0x1932aa['Attachments']){for(var _0x5338a6=0x0;_0x5338a6<_0x1932aa[_0xa2d2('0x5e')][_0xa2d2('0x3c')];_0x5338a6++){var _0x490526=_0x1932aa[_0xa2d2('0x5e')][_0x5338a6];var _0x11c1f2=path[_0xa2d2('0x57')](_0x28e7fd,_0x490526[_0xa2d2('0x6a')]);if(fs['existsSync'](_0x11c1f2)){_0x1e08a3[_0xa2d2('0x5a')]['push']({'name':_0x490526['name'],'contentType':_0x490526['type'],'data':fs[_0xa2d2('0x6b')](_0x11c1f2)});}}}emlformat[_0xa2d2('0x6c')](_0x1e08a3,function(_0x252e3a,_0x35d9df){if(_0x252e3a)return _0x4e815d(_0x252e3a);fs[_0xa2d2('0x6d')](path[_0xa2d2('0x57')](_0xc4bc97,util['format']('message%d.eml',_0x33bacc)),_0x35d9df);return _0x131240(_0x35d9df);});});})[_0xa2d2('0x1a')](function(){return new BPromise(function(_0x31bcd8,_0x2b49c){zipdir(_0xc4bc97,{'saveTo':_0x1620c5},function(_0xd9cae6,_0x311f71){if(_0xd9cae6)return _0x2b49c(_0xd9cae6);return _0x31bcd8(_0x311f71);});})[_0xa2d2('0x1a')](function(){return new BPromise(function(_0x35930e,_0x5513fd){rimraf(_0xc4bc97,function(_0x57f78a){if(_0x57f78a)_0x5513fd(_0x57f78a);return _0x35930e();});});})['then'](function(){return _0x29f1b9['download'](_0x1620c5,_0x4623f9,function(_0x3ef6e8){if(!_0x3ef6e8)fs[_0xa2d2('0x6e')](_0x1620c5);});});});}else{return _0x29f1b9['sendStatus'](0xc8);}})['catch'](handleError(_0x29f1b9,null));}; \ No newline at end of file +var _0xd78d=['findOne','length','nolimit','sort','pick','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','color','emit','mailInteractionTags:save','removeTags','unix','toString','join','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','createdAt','mkdirSync','missing.recipient@your.company.com','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','error','stack','name','send','index','map','fieldName','type','key','getOptions','mail','query','then','catch','show','params','model','keys','MailInteraction','rawAttributes','filters','intersection','fields','attributes','includeAll','include','merge','options','create','body','update','find','describe','addMessage','MailMessage','ids','getMessages'];(function(_0x1e7429,_0x21d4da){var _0x24a2ab=function(_0x1fcb4d){while(--_0x1fcb4d){_0x1e7429['push'](_0x1e7429['shift']());}};_0x24a2ab(++_0x21d4da);}(_0xd78d,0x116));var _0xdd78=function(_0x24ea68,_0x1bd197){_0x24ea68=_0x24ea68-0x0;var _0x464b4c=_0xd78d[_0x24ea68];return _0x464b4c;};'use strict';var emlformat=require(_0xdd78('0x0'));var rimraf=require(_0xdd78('0x1'));var zipdir=require(_0xdd78('0x2'));var moment=require(_0xdd78('0x3'));var BPromise=require(_0xdd78('0x4'));var util=require(_0xdd78('0x5'));var path=require(_0xdd78('0x6'));var fs=require('fs');var _=require(_0xdd78('0x7'));var juice=require(_0xdd78('0x8'));var Redis=require(_0xdd78('0x9'));var interaction=require(_0xdd78('0xa'));var qs=require(_0xdd78('0xb'));var logger=require('../../config/logger')(_0xdd78('0xc'));var config=require(_0xdd78('0xd'));var db=require(_0xdd78('0xe'))['db'];var htmlEntities=require(_0xdd78('0xf'));config[_0xdd78('0x10')]=_[_0xdd78('0x11')](config[_0xdd78('0x10')],{'host':_0xdd78('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x12b0d1,_0x5be555){_0x5be555=_0x5be555||0xcc;return function(_0x282b12){if(_0x282b12){return _0x12b0d1[_0xdd78('0x13')](_0x5be555);}return _0x12b0d1[_0xdd78('0x14')](_0x5be555)[_0xdd78('0x15')]();};}function respondWithResult(_0x4e196c,_0xd0f170){_0xd0f170=_0xd0f170||0xc8;return function(_0x3e1ce6){if(_0x3e1ce6){return _0x4e196c['status'](_0xd0f170)[_0xdd78('0x16')](_0x3e1ce6);}};}function respondWithFilteredResult(_0x515c6a,_0xec5dc){return function(_0x5dd992){if(_0x5dd992){var _0x57a75e=typeof _0xec5dc[_0xdd78('0x17')]===_0xdd78('0x18')&&typeof _0xec5dc[_0xdd78('0x19')]===_0xdd78('0x18');var _0x129935=_0x5dd992[_0xdd78('0x1a')];var _0x435e7b=_0x57a75e?0x0:_0xec5dc[_0xdd78('0x17')];var _0x42c4b5=_0x57a75e?_0x5dd992[_0xdd78('0x1a')]:_0xec5dc[_0xdd78('0x17')]+_0xec5dc[_0xdd78('0x19')];var _0x565eaf;if(_0x42c4b5>=_0x129935){_0x42c4b5=_0x129935;_0x565eaf=0xc8;}else{_0x565eaf=0xce;}_0x515c6a['status'](_0x565eaf);return _0x515c6a[_0xdd78('0x1b')](_0xdd78('0x1c'),_0x435e7b+'-'+_0x42c4b5+'/'+_0x129935)[_0xdd78('0x16')](_0x5dd992);}return null;};}function saveUpdates(_0x3710c1){return function(_0x3b7c92){if(_0x3b7c92){return _0x3b7c92['update'](_0x3710c1)['then'](function(_0x4b4542){return _0x4b4542;});}return null;};}function removeEntity(_0x785216){return function(_0x3c750d){if(_0x3c750d){return _0x3c750d[_0xdd78('0x1d')]()['then'](function(){_0x785216[_0xdd78('0x14')](0xcc)[_0xdd78('0x15')]();});}};}function handleEntityNotFound(_0xf40e47){return function(_0x179844){if(!_0x179844){_0xf40e47[_0xdd78('0x13')](0x194);}return _0x179844;};}function handleError(_0x288431,_0x4d171e){_0x4d171e=_0x4d171e||0x1f4;return function(_0x5c5d9d){logger[_0xdd78('0x1e')](_0x5c5d9d[_0xdd78('0x1f')]);if(_0x5c5d9d[_0xdd78('0x20')]){delete _0x5c5d9d[_0xdd78('0x20')];}_0x288431[_0xdd78('0x14')](_0x4d171e)[_0xdd78('0x21')](_0x5c5d9d);};}exports[_0xdd78('0x22')]=function(_0x402cb5,_0x235315){var _0x299362={};var _0x404207=_[_0xdd78('0x23')](db['MailInteraction']['rawAttributes'],function(_0x36f3a8){return{'name':_0x36f3a8[_0xdd78('0x24')],'type':_0x36f3a8[_0xdd78('0x25')][_0xdd78('0x26')]};});_0x299362=qs[_0xdd78('0x27')](_0x404207,_0x402cb5);return interaction['findAll'](_0xdd78('0x28'),_0x402cb5[_0xdd78('0x29')],_0x402cb5['user'],_0x299362,_0x404207)[_0xdd78('0x2a')](respondWithFilteredResult(_0x235315,_0x299362))[_0xdd78('0x2b')](handleError(_0x235315,null));};exports[_0xdd78('0x2c')]=function(_0x284099,_0x46fe82){var _0x3ac9db={'raw':![],'where':{'id':_0x284099[_0xdd78('0x2d')]['id']}},_0x371b88={};_0x371b88[_0xdd78('0x2e')]=_[_0xdd78('0x2f')](db[_0xdd78('0x30')][_0xdd78('0x31')]);_0x371b88[_0xdd78('0x29')]=_['keys'](_0x284099['query']);_0x371b88[_0xdd78('0x32')]=_[_0xdd78('0x33')](_0x371b88[_0xdd78('0x2e')],_0x371b88[_0xdd78('0x29')]);_0x3ac9db['attributes']=_[_0xdd78('0x33')](_0x371b88[_0xdd78('0x2e')],qs[_0xdd78('0x34')](_0x284099[_0xdd78('0x29')][_0xdd78('0x34')]));_0x3ac9db[_0xdd78('0x35')]=_0x3ac9db[_0xdd78('0x35')]['length']?_0x3ac9db[_0xdd78('0x35')]:_0x371b88[_0xdd78('0x2e')];if(_0x284099['query'][_0xdd78('0x36')]){_0x3ac9db[_0xdd78('0x37')]=[{'all':!![]}];}_0x3ac9db=_[_0xdd78('0x38')]({},_0x3ac9db,_0x284099[_0xdd78('0x39')]);return db['MailInteraction']['find'](_0x3ac9db)[_0xdd78('0x2a')](handleEntityNotFound(_0x46fe82,null))[_0xdd78('0x2a')](respondWithResult(_0x46fe82,null))[_0xdd78('0x2b')](handleError(_0x46fe82,null));};exports['create']=function(_0x1d4a86,_0x5b64ce){return db[_0xdd78('0x30')][_0xdd78('0x3a')](_0x1d4a86[_0xdd78('0x3b')],{})[_0xdd78('0x2a')](respondWithResult(_0x5b64ce,0xc9))[_0xdd78('0x2b')](handleError(_0x5b64ce,null));};exports[_0xdd78('0x3c')]=function(_0x498332,_0x1d82c5){if(_0x498332[_0xdd78('0x3b')]['id']){delete _0x498332[_0xdd78('0x3b')]['id'];}return db[_0xdd78('0x30')][_0xdd78('0x3d')]({'where':{'id':_0x498332[_0xdd78('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1d82c5,null))[_0xdd78('0x2a')](saveUpdates(_0x498332['body'],null))[_0xdd78('0x2a')](respondWithResult(_0x1d82c5,null))['catch'](handleError(_0x1d82c5,null));};exports['destroy']=function(_0x4a86cf,_0x3c4ac6){return db['MailInteraction'][_0xdd78('0x3d')]({'where':{'id':_0x4a86cf[_0xdd78('0x2d')]['id']}})[_0xdd78('0x2a')](handleEntityNotFound(_0x3c4ac6,null))[_0xdd78('0x2a')](removeEntity(_0x3c4ac6,null))[_0xdd78('0x2b')](handleError(_0x3c4ac6,null));};exports[_0xdd78('0x3e')]=function(_0x128722,_0x38132b){return db[_0xdd78('0x30')][_0xdd78('0x3e')]()[_0xdd78('0x2a')](respondWithResult(_0x38132b,null))[_0xdd78('0x2b')](handleError(_0x38132b,null));};exports[_0xdd78('0x3f')]=function(_0x24d86b,_0x265063){return db[_0xdd78('0x40')][_0xdd78('0x3d')]({'where':{'id':_0x24d86b['params']['id']}})[_0xdd78('0x2a')](handleEntityNotFound(_0x265063,null))[_0xdd78('0x2a')](function(_0x572a4e){if(_0x572a4e){return _0x572a4e[_0xdd78('0x3f')](_0x24d86b[_0xdd78('0x3b')]['ids'],_['omit'](_0x24d86b[_0xdd78('0x3b')],[_0xdd78('0x41'),'id'])||{});}})[_0xdd78('0x2a')](respondWithResult(_0x265063,null))[_0xdd78('0x2b')](handleError(_0x265063,null));};exports[_0xdd78('0x42')]=function(_0x327d3f,_0x5acbaa){var _0x4431dd={'raw':![],'where':{}};var _0x4d7f97={};var _0x4dc209={'count':0x0,'rows':[]};return db[_0xdd78('0x30')][_0xdd78('0x43')]({'where':{'id':_0x327d3f[_0xdd78('0x2d')]['id']}})[_0xdd78('0x2a')](handleEntityNotFound(_0x5acbaa,null))['then'](function(_0x19059e){if(_0x19059e){_0x4d7f97[_0xdd78('0x2e')]=_['keys'](db[_0xdd78('0x40')][_0xdd78('0x31')]);_0x4d7f97[_0xdd78('0x29')]=_[_0xdd78('0x2f')](_0x327d3f[_0xdd78('0x29')]);_0x4d7f97[_0xdd78('0x32')]=_[_0xdd78('0x33')](_0x4d7f97['model'],_0x4d7f97[_0xdd78('0x29')]);_0x4431dd['attributes']=_[_0xdd78('0x33')](_0x4d7f97[_0xdd78('0x2e')],qs['fields'](_0x327d3f[_0xdd78('0x29')][_0xdd78('0x34')]));_0x4431dd[_0xdd78('0x35')]=_0x4431dd['attributes'][_0xdd78('0x44')]?_0x4431dd[_0xdd78('0x35')]:_0x4d7f97[_0xdd78('0x2e')];if(!_0x327d3f[_0xdd78('0x29')]['hasOwnProperty'](_0xdd78('0x45'))){_0x4431dd[_0xdd78('0x19')]=qs[_0xdd78('0x19')](_0x327d3f[_0xdd78('0x29')][_0xdd78('0x19')]);_0x4431dd[_0xdd78('0x17')]=qs[_0xdd78('0x17')](_0x327d3f[_0xdd78('0x29')][_0xdd78('0x17')]);}_0x4431dd['order']=qs[_0xdd78('0x46')](_0x327d3f[_0xdd78('0x29')]['sort']);_0x4431dd['where']=qs[_0xdd78('0x32')](_[_0xdd78('0x47')](_0x327d3f[_0xdd78('0x29')],_0x4d7f97[_0xdd78('0x32')]));_0x4431dd[_0xdd78('0x48')]['MailInteractionId']=_0x19059e['id'];if(_0x327d3f[_0xdd78('0x29')][_0xdd78('0x49')]){_0x4431dd[_0xdd78('0x48')]=_['merge'](_0x4431dd[_0xdd78('0x48')],{'$or':_[_0xdd78('0x23')](_0x4431dd[_0xdd78('0x35')],function(_0x21fe60){var _0x5a9197={};_0x5a9197[_0x21fe60]={'$like':'%'+_0x327d3f['query'][_0xdd78('0x49')]+'%'};return _0x5a9197;})});}if(_0x327d3f[_0xdd78('0x29')][_0xdd78('0x4a')]){var _0x1dc272=_0x327d3f[_0xdd78('0x29')][_0xdd78('0x4a')][_0xdd78('0x4b')](',');var _0x4cb45f={};_0x4cb45f[_0x1dc272[0x0]]={'$gte':moment(_0x1dc272[0x1])[_0xdd78('0x4c')](_0xdd78('0x4d'))};_0x4431dd[_0xdd78('0x48')]=_[_0xdd78('0x38')](_0x4431dd[_0xdd78('0x48')],_0x4cb45f);}_0x4431dd=_['merge']({},_0x4431dd,_0x327d3f[_0xdd78('0x39')]);return db[_0xdd78('0x40')][_0xdd78('0x1a')]({'where':_0x4431dd['where']})[_0xdd78('0x2a')](function(_0x1c2433){_0x4dc209[_0xdd78('0x1a')]=_0x1c2433;if(_0x327d3f['query'][_0xdd78('0x36')]){_0x4431dd[_0xdd78('0x37')]=[{'all':!![]}];}return db[_0xdd78('0x40')][_0xdd78('0x4e')](_0x4431dd);})['then'](function(_0x27b1e2){if(_0x327d3f[_0xdd78('0x29')]['inlineCss']==='true'){for(var _0x7c7f90=0x0;_0x7c7f90<_0x27b1e2[_0xdd78('0x44')];_0x7c7f90++){_0x27b1e2[_0x7c7f90][_0xdd78('0x3b')]=juice(_0x27b1e2[_0x7c7f90]['body']);}}_0x4dc209[_0xdd78('0x4f')]=_0x27b1e2;return _0x4dc209;});}})[_0xdd78('0x2a')](respondWithFilteredResult(_0x5acbaa,_0x4431dd))[_0xdd78('0x2b')](handleError(_0x5acbaa,null));};exports[_0xdd78('0x50')]=function(_0x32694b,_0x26d53a){return db['MailInteraction']['find']({'where':{'id':_0x32694b[_0xdd78('0x2d')]['id']}})['then'](handleEntityNotFound(_0x26d53a,null))[_0xdd78('0x2a')](function(_0x2e5744){if(_0x2e5744){return _0x2e5744[_0xdd78('0x51')](_0x32694b[_0xdd78('0x3b')][_0xdd78('0x41')],_[_0xdd78('0x52')](_0x32694b['body'],[_0xdd78('0x41'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xdd78('0x20'),_0xdd78('0x53')],'where':{'id':_0x32694b[_0xdd78('0x3b')][_0xdd78('0x41')]}});})[_0xdd78('0x2a')](function(_0x37106c){socket[_0xdd78('0x54')](_0xdd78('0x55'),{'id':Number(_0x32694b[_0xdd78('0x2d')]['id']),'tags':_0x37106c||[]});return{'id':Number(_0x32694b[_0xdd78('0x2d')]['id']),'tags':_0x37106c||[]};});}})[_0xdd78('0x2a')](respondWithResult(_0x26d53a,null))[_0xdd78('0x2b')](handleError(_0x26d53a,null));};exports['removeTags']=function(_0x12a4dc,_0x215980){return db[_0xdd78('0x30')][_0xdd78('0x3d')]({'where':{'id':_0x12a4dc[_0xdd78('0x2d')]['id']}})['then'](handleEntityNotFound(_0x215980,null))[_0xdd78('0x2a')](function(_0x10706a){if(_0x10706a){return _0x10706a[_0xdd78('0x56')](_0x12a4dc[_0xdd78('0x29')][_0xdd78('0x41')]);}})[_0xdd78('0x2a')](respondWithStatusCode(_0x215980,null))[_0xdd78('0x2b')](handleError(_0x215980,null));};exports['download']=function(_0x51510d,_0x33a8a9){var _0x3b5b5b=moment()[_0xdd78('0x57')]()[_0xdd78('0x58')]();var _0x92a254=path[_0xdd78('0x59')](config['root'],_0xdd78('0x5a'),_0xdd78('0x5b'),_0xdd78('0x5c'));var _0x43862e=path['join'](config['root'],_0xdd78('0x5a'),'files',_0xdd78('0x5d'));var _0xb1ce4d=path[_0xdd78('0x59')](_0x92a254,_0x3b5b5b);var _0x1e3e9c=util[_0xdd78('0x4c')](_0xdd78('0x5e'),_0x51510d[_0xdd78('0x2d')]['id'],_0x3b5b5b);var _0x32a217=path['join'](_0x92a254,_0x1e3e9c);var _0x185c0c=[];if(_0x51510d['query'][_0xdd78('0x5d')]){_0x185c0c[_0xdd78('0x5f')]({'model':db[_0xdd78('0x60')],'as':'Attachments','raw':!![]});}var _0x23ff53=[{'model':db[_0xdd78('0x40')],'as':_0xdd78('0x61'),'attributes':['id',_0xdd78('0x3b'),_0xdd78('0x62'),'to','cc',_0xdd78('0x63'),'subject',_0xdd78('0x64')],'where':{'secret':![]},'order':qs[_0xdd78('0x46')]('id'),'include':_0x185c0c}];return db[_0xdd78('0x30')][_0xdd78('0x3d')]({'where':{'id':_0x51510d['params']['id']},'include':_0x23ff53})['then'](handleEntityNotFound(_0x33a8a9,null))['then'](function(_0x53652b){if(_0x53652b&&_0x53652b[_0xdd78('0x61')]){var _0x5379e3=_0x53652b['get']({'plain':!![]});fs[_0xdd78('0x65')](_0xb1ce4d);return BPromise['each'](_0x5379e3['Messages'],function(_0x48b7d0,_0x2306b2){var _0xf431f2={'from':_0x48b7d0['from'],'to':_0x48b7d0['to']||_0xdd78('0x66'),'subject':_0x48b7d0[_0xdd78('0x67')],'html':htmlEntities['decode'](_0x48b7d0[_0xdd78('0x3b')]),'headers':{'Date':moment(_0x48b7d0[_0xdd78('0x64')])[_0xdd78('0x4c')](_0xdd78('0x68'))},'attachments':[]};if(_0x48b7d0['cc']){_0xf431f2['headers']['Cc']=_0x48b7d0['cc'];}if(_0x48b7d0['bcc']){_0xf431f2['headers'][_0xdd78('0x69')]=_0x48b7d0[_0xdd78('0x63')];}return new BPromise(function(_0xb7602,_0x29ed6e){if(_0x48b7d0['Attachments']){for(var _0xd2b214=0x0;_0xd2b214<_0x48b7d0['Attachments']['length'];_0xd2b214++){var _0x5bde2e=_0x48b7d0[_0xdd78('0x6a')][_0xd2b214];var _0x248ecb=path[_0xdd78('0x59')](_0x43862e,_0x5bde2e[_0xdd78('0x6b')]);if(fs[_0xdd78('0x6c')](_0x248ecb)){_0xf431f2[_0xdd78('0x5d')]['push']({'name':_0x5bde2e[_0xdd78('0x20')],'contentType':_0x5bde2e['type'],'data':fs[_0xdd78('0x6d')](_0x248ecb)});}}}emlformat[_0xdd78('0x6e')](_0xf431f2,function(_0x54b97c,_0x209853){if(_0x54b97c)return _0x29ed6e(_0x54b97c);fs[_0xdd78('0x6f')](path['join'](_0xb1ce4d,util['format'](_0xdd78('0x70'),_0x2306b2)),_0x209853);return _0xb7602(_0x209853);});});})[_0xdd78('0x2a')](function(){return new BPromise(function(_0x48a945,_0x4d1442){zipdir(_0xb1ce4d,{'saveTo':_0x32a217},function(_0x360e54,_0x44c380){if(_0x360e54)return _0x4d1442(_0x360e54);return _0x48a945(_0x44c380);});})[_0xdd78('0x2a')](function(){return new BPromise(function(_0x4f3c03,_0x255af5){rimraf(_0xb1ce4d,function(_0x22b90d){if(_0x22b90d)_0x255af5(_0x22b90d);return _0x4f3c03();});});})['then'](function(){return _0x33a8a9[_0xdd78('0x71')](_0x32a217,_0x1e3e9c,function(_0x142a45){if(!_0x142a45)fs[_0xdd78('0x72')](_0x32a217);});});});}else{return _0x33a8a9[_0xdd78('0x13')](0xc8);}})[_0xdd78('0x2b')](handleError(_0x33a8a9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 2ab08ce..eb1898d 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 _0x3a70=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then'];(function(_0x372c6b,_0x154341){var _0x4a4695=function(_0x5ad47f){while(--_0x5ad47f){_0x372c6b['push'](_0x372c6b['shift']());}};_0x4a4695(++_0x154341);}(_0x3a70,0x1de));var _0x03a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a70[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x03a7('0x0'))['db'][_0x03a7('0x1')];var MailMessage=require(_0x03a7('0x0'))['db'][_0x03a7('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x03a7('0x3'),'afterUpdate':_0x03a7('0x4'),'afterDestroy':_0x03a7('0x5')};function emitEvent(_0x2e2ad7){return function(_0x5b3f3c,_0xa7bf87,_0x42100a){_0x5b3f3c[_0x03a7('0x6')]({'attributes':['id'],'raw':!![]})[_0x03a7('0x7')](function(_0x2e6eef){_0x5b3f3c[_0x03a7('0x8')](_0x03a7('0x9'),_0x2e6eef[_0x03a7('0xa')](function(_0x28f731){return{'id':_0x28f731['id']};}));return MailMessage[_0x03a7('0xb')]({'where':{'MailInteractionId':_0x5b3f3c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x03a7('0x7')](function(_0x1c92b8){_0x5b3f3c['setDataValue'](_0x03a7('0xc'),_0x1c92b8[_0x03a7('0xd')]);MailInteractionEvents[_0x03a7('0xe')](_0x2e2ad7+':'+_0x5b3f3c['id'],_0x5b3f3c);MailInteractionEvents[_0x03a7('0xe')](_0x2e2ad7,_0x5b3f3c);_0x42100a(null);})[_0x03a7('0xf')](_0x42100a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x03a7('0x10')](e,emitEvent(event));}}module[_0x03a7('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0xe1cd=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','events'];(function(_0x3ab936,_0x4f4d92){var _0x105c86=function(_0x2b4c5d){while(--_0x2b4c5d){_0x3ab936['push'](_0x3ab936['shift']());}};_0x105c86(++_0x4f4d92);}(_0xe1cd,0x95));var _0xde1c=function(_0x320c2c,_0x2b5c01){_0x320c2c=_0x320c2c-0x0;var _0x3c87b0=_0xe1cd[_0x320c2c];return _0x3c87b0;};'use strict';var EventEmitter=require(_0xde1c('0x0'));var MailInteraction=require(_0xde1c('0x1'))['db'][_0xde1c('0x2')];var MailMessage=require(_0xde1c('0x1'))['db'][_0xde1c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xde1c('0x4')](0x0);var events={'afterCreate':_0xde1c('0x5'),'afterUpdate':'update','afterDestroy':_0xde1c('0x6')};function emitEvent(_0x7a692){return function(_0x346ac9,_0x47e45c,_0x147768){_0x346ac9[_0xde1c('0x7')]({'attributes':['id'],'raw':!![]})[_0xde1c('0x8')](function(_0x2f73b4){_0x346ac9[_0xde1c('0x9')](_0xde1c('0xa'),_0x2f73b4['map'](function(_0x31ca0e){return{'id':_0x31ca0e['id']};}));return MailMessage[_0xde1c('0xb')]({'where':{'MailInteractionId':_0x346ac9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xde1c('0x8')](function(_0x318627){_0x346ac9['setDataValue'](_0xde1c('0xc'),_0x318627['length']);MailInteractionEvents[_0xde1c('0xd')](_0x7a692+':'+_0x346ac9['id'],_0x346ac9);MailInteractionEvents[_0xde1c('0xd')](_0x7a692,_0x346ac9);_0x147768(null);})[_0xde1c('0xe')](_0x147768(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0f7af90..ac7f3a0 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 _0xae12=['request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','changed','format','substatusAt','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird'];(function(_0x2b2d67,_0x18606e){var _0x118fda=function(_0x44c89e){while(--_0x44c89e){_0x2b2d67['push'](_0x2b2d67['shift']());}};_0x118fda(++_0x18606e);}(_0xae12,0x1ad));var _0x2ae1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xae12[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require('lodash');var util=require(_0x2ae1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2ae1('0x1'));var BPromise=require(_0x2ae1('0x2'));var rp=require(_0x2ae1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ae1('0x4'));var config=require(_0x2ae1('0x5'));var attributes=require(_0x2ae1('0x6'));module[_0x2ae1('0x7')]=function(_0x48538c,_0x20fbcd){return _0x48538c[_0x2ae1('0x8')](_0x2ae1('0x9'),attributes,{'tableName':_0x2ae1('0xa'),'paranoid':![],'indexes':[{'name':_0x2ae1('0xb'),'fields':[_0x2ae1('0xc'),'to'],'type':_0x2ae1('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x375408,_0x53e531,_0x28c2cf){if(_0x375408[_0x2ae1('0xe')]){_0x375408['substatusAt']=moment()['format'](_0x2ae1('0xf'));}if(_0x375408[_0x2ae1('0x10')]){_0x375408['closedAt']=moment()['format'](_0x2ae1('0xf'));}_0x28c2cf(null,_0x53e531);},'beforeUpdate':function(_0x228537,_0x1b87e6,_0x4f1ced){if(_0x228537[_0x2ae1('0x11')](_0x2ae1('0xe'))){_0x228537['substatusAt']=_0x228537[_0x2ae1('0xe')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x228537['changed'](_0x2ae1('0x10'))){_0x228537['closedAt']=moment()[_0x2ae1('0x12')](_0x2ae1('0xf'));_0x228537['substatus']=null;_0x228537[_0x2ae1('0x13')]=null;}_0x4f1ced(null,_0x228537);},'afterUpdate':function(_0x880f2a,_0x3db5f9,_0x2af1af){var _0x525ce0=_0x48538c[_0x2ae1('0x14')];var _0x456db8=_0x880f2a['get']({'plain':!![]});if(_0x456db8[_0x2ae1('0x10')]){return _0x525ce0[_0x2ae1('0x15')][_0x2ae1('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x456db8['id']}})[_0x2ae1('0x17')](function(){_0x2af1af();})[_0x2ae1('0x18')](function(_0x2d0121){_0x2af1af(_0x2d0121);});}else{_0x2af1af();}}},'charset':_0x2ae1('0x19'),'collate':_0x2ae1('0x1a')});}; \ No newline at end of file +var _0x430a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x6045e7,_0x25786a){var _0x3b626e=function(_0x4e09d5){while(--_0x4e09d5){_0x6045e7['push'](_0x6045e7['shift']());}};_0x3b626e(++_0x25786a);}(_0x430a,0x1a3));var _0xa430=function(_0x45853d,_0x241369){_0x45853d=_0x45853d-0x0;var _0x1fafec=_0x430a[_0x45853d];return _0x1fafec;};'use strict';var _=require('lodash');var util=require(_0xa430('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa430('0x1'));var BPromise=require(_0xa430('0x2'));var rp=require(_0xa430('0x3'));var fs=require('fs');var path=require(_0xa430('0x4'));var rimraf=require(_0xa430('0x5'));var config=require(_0xa430('0x6'));var attributes=require(_0xa430('0x7'));module[_0xa430('0x8')]=function(_0x5c5153,_0x305f42){return _0x5c5153[_0xa430('0x9')](_0xa430('0xa'),attributes,{'tableName':_0xa430('0xb'),'paranoid':![],'indexes':[{'name':_0xa430('0xc'),'fields':[_0xa430('0xd'),'to'],'type':_0xa430('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a5337,_0x2e213a,_0x35a8a9){if(_0x4a5337[_0xa430('0xf')]){_0x4a5337[_0xa430('0x10')]=moment()['format'](_0xa430('0x11'));}if(_0x4a5337[_0xa430('0x12')]){_0x4a5337[_0xa430('0x13')]=moment()[_0xa430('0x14')]('YYYY-MM-DD\x20HH:mm:ss');}_0x35a8a9(null,_0x2e213a);},'beforeUpdate':function(_0x518f02,_0x34f6f7,_0x36374f){if(_0x518f02[_0xa430('0x15')](_0xa430('0xf'))){_0x518f02[_0xa430('0x10')]=_0x518f02[_0xa430('0xf')]?moment()[_0xa430('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x518f02[_0xa430('0x15')](_0xa430('0x12'))){_0x518f02[_0xa430('0x13')]=moment()[_0xa430('0x14')](_0xa430('0x11'));_0x518f02['substatus']=null;_0x518f02['substatusAt']=null;}_0x36374f(null,_0x518f02);},'afterUpdate':function(_0x410be3,_0x2acab0,_0x5d9a70){var _0x2f9383=_0x5c5153['models'];var _0x261dd7=_0x410be3[_0xa430('0x16')]({'plain':!![]});if(_0x261dd7[_0xa430('0x12')]){return _0x2f9383['MailMessage'][_0xa430('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x261dd7['id']}})[_0xa430('0x18')](function(){_0x5d9a70();})[_0xa430('0x19')](function(_0x5a8a80){_0x5d9a70(_0x5a8a80);});}else{_0x5d9a70();}}},'charset':_0xa430('0x1a'),'collate':_0xa430('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 9b355d6..bd4cd18 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 _0x9494=['request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','result','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','debug','catch','find','addTags','omit','spread','AddTags','stringify','lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info'];(function(_0x3fa5e5,_0x419741){var _0x4b16a0=function(_0xbaa0d5){while(--_0xbaa0d5){_0x3fa5e5['push'](_0x3fa5e5['shift']());}};_0x4b16a0(++_0x419741);}(_0x9494,0x1a7));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4949('0x0'));var util=require(_0x4949('0x1'));var moment=require('moment');var BPromise=require(_0x4949('0x2'));var rs=require(_0x4949('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4949('0x4'));var logger=require('../../config/logger')(_0x4949('0x5'));var config=require('../../config/environment');var jayson=require(_0x4949('0x6'));var client=jayson[_0x4949('0x7')]['http']({'port':0x232a});config['redis']=_[_0x4949('0x8')](config[_0x4949('0x9')],{'host':_0x4949('0xa'),'port':0x18eb});var socket=require(_0x4949('0xb'))(new Redis(config[_0x4949('0x9')]));require(_0x4949('0xc'))[_0x4949('0xd')](socket);function respondWithRpcPromise(_0x1ff5a6,_0x50e3d5,_0x133037){return new BPromise(function(_0x500856,_0x18f716){return client[_0x4949('0xe')](_0x1ff5a6,_0x133037)[_0x4949('0xf')](function(_0x5b1f45){logger[_0x4949('0x10')]('MailInteraction,\x20%s,\x20%s',_0x50e3d5,_0x4949('0x11'));logger['debug'](_0x4949('0x12'),_0x50e3d5,_0x4949('0x11'),JSON['stringify'](_0x5b1f45));if(_0x5b1f45[_0x4949('0x13')]){if(_0x5b1f45[_0x4949('0x13')][_0x4949('0x14')]===0x1f4){logger[_0x4949('0x13')](_0x4949('0x15'),_0x50e3d5,_0x5b1f45['error'][_0x4949('0x16')]);return _0x18f716(_0x5b1f45[_0x4949('0x13')][_0x4949('0x16')]);}logger[_0x4949('0x13')]('MailInteraction,\x20%s,\x20%s',_0x50e3d5,_0x5b1f45['error'][_0x4949('0x16')]);return _0x500856(_0x5b1f45[_0x4949('0x13')][_0x4949('0x16')]);}else{logger[_0x4949('0x10')](_0x4949('0x15'),_0x50e3d5,_0x4949('0x11'));_0x500856(_0x5b1f45[_0x4949('0x17')][_0x4949('0x16')]);}})['catch'](function(_0x38bee2){logger[_0x4949('0x13')](_0x4949('0x15'),_0x50e3d5,_0x38bee2);_0x18f716(_0x38bee2);});});}exports[_0x4949('0x18')]=function(_0x2ce92a){var _0x5affa5=this;return new Promise(function(_0x13a0a5,_0x357129){return db[_0x4949('0x19')]['update'](_0x2ce92a[_0x4949('0x1a')],{'raw':_0x2ce92a['options']?_0x2ce92a[_0x4949('0x1b')][_0x4949('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ce92a[_0x4949('0x1b')]?_0x2ce92a[_0x4949('0x1b')][_0x4949('0x1d')]||null:null,'attributes':_0x2ce92a[_0x4949('0x1b')]?_0x2ce92a[_0x4949('0x1b')][_0x4949('0x1e')]||null:null,'limit':_0x2ce92a['options']?_0x2ce92a[_0x4949('0x1b')][_0x4949('0x1f')]||null:null})[_0x4949('0xf')](function(_0x1a8d50){logger[_0x4949('0x10')](_0x4949('0x18'),_0x2ce92a);logger[_0x4949('0x20')](_0x4949('0x18'),_0x2ce92a,JSON['stringify'](_0x1a8d50));_0x13a0a5(_0x1a8d50);})[_0x4949('0x21')](function(_0x2207bc){logger[_0x4949('0x13')](_0x4949('0x18'),_0x2207bc['message'],_0x2ce92a);_0x357129(_0x5affa5[_0x4949('0x13')](0x1f4,_0x2207bc['message']));});});};exports['AddTagsToMailInteraction']=function(_0xb8bca6){return new Promise(function(_0x35af0b,_0x3782cf){return db['MailInteraction'][_0x4949('0x22')]({'where':_0xb8bca6[_0x4949('0x1b')]?_0xb8bca6[_0x4949('0x1b')][_0x4949('0x1d')]||null:null})[_0x4949('0xf')](function(_0x42de57){if(_0x42de57){return _0x42de57[_0x4949('0x23')](_0xb8bca6['body']['ids'],_[_0x4949('0x24')](_0xb8bca6[_0x4949('0x1a')],['ids','id'])||{});}})[_0x4949('0x25')](function(_0x41a21d){logger['info']('AddTags',_0xb8bca6);logger[_0x4949('0x20')](_0x4949('0x26'),_0xb8bca6,JSON[_0x4949('0x27')](_0x41a21d));_0x35af0b(_0x41a21d);})[_0x4949('0x21')](function(_0x4c7598){logger[_0x4949('0x13')](_0x4949('0x26'),_0x4c7598[_0x4949('0x16')],_0xb8bca6);_0x3782cf(_this['error'](0x1f4,_0x4c7598['message']));});});}; \ No newline at end of file +var _0x0a01=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','find','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x25745c,_0x4c7e38){var _0x1b3e14=function(_0x1585a1){while(--_0x1585a1){_0x25745c['push'](_0x25745c['shift']());}};_0x1b3e14(++_0x4c7e38);}(_0x0a01,0x1a6));var _0x10a0=function(_0x4fa8b5,_0x7c24ec){_0x4fa8b5=_0x4fa8b5-0x0;var _0x1b0ec2=_0x0a01[_0x4fa8b5];return _0x1b0ec2;};'use strict';var _=require(_0x10a0('0x0'));var util=require(_0x10a0('0x1'));var moment=require(_0x10a0('0x2'));var BPromise=require(_0x10a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10a0('0x4'));var db=require(_0x10a0('0x5'))['db'];var utils=require(_0x10a0('0x6'));var logger=require(_0x10a0('0x7'))(_0x10a0('0x8'));var config=require(_0x10a0('0x9'));var jayson=require(_0x10a0('0xa'));var client=jayson[_0x10a0('0xb')]['http']({'port':0x232a});config[_0x10a0('0xc')]=_[_0x10a0('0xd')](config[_0x10a0('0xc')],{'host':_0x10a0('0xe'),'port':0x18eb});var socket=require(_0x10a0('0xf'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x591e2b,_0x1ec17e,_0x3e7a73){return new BPromise(function(_0x44942d,_0xee400d){return client[_0x10a0('0x10')](_0x591e2b,_0x3e7a73)[_0x10a0('0x11')](function(_0x14456c){logger[_0x10a0('0x12')]('MailInteraction,\x20%s,\x20%s',_0x1ec17e,_0x10a0('0x13'));logger[_0x10a0('0x14')](_0x10a0('0x15'),_0x1ec17e,_0x10a0('0x13'),JSON[_0x10a0('0x16')](_0x14456c));if(_0x14456c['error']){if(_0x14456c[_0x10a0('0x17')][_0x10a0('0x18')]===0x1f4){logger[_0x10a0('0x17')](_0x10a0('0x19'),_0x1ec17e,_0x14456c[_0x10a0('0x17')][_0x10a0('0x1a')]);return _0xee400d(_0x14456c['error'][_0x10a0('0x1a')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x1ec17e,_0x14456c['error']['message']);return _0x44942d(_0x14456c[_0x10a0('0x17')][_0x10a0('0x1a')]);}else{logger[_0x10a0('0x12')](_0x10a0('0x19'),_0x1ec17e,_0x10a0('0x13'));_0x44942d(_0x14456c['result'][_0x10a0('0x1a')]);}})[_0x10a0('0x1b')](function(_0x506b42){logger['error']('MailInteraction,\x20%s,\x20%s',_0x1ec17e,_0x506b42);_0xee400d(_0x506b42);});});}exports[_0x10a0('0x1c')]=function(_0x37350c){var _0xfb9163=this;return new Promise(function(_0x17e961,_0x1bf19f){return db[_0x10a0('0x1d')][_0x10a0('0x1e')](_0x37350c[_0x10a0('0x1f')],{'raw':_0x37350c[_0x10a0('0x20')]?_0x37350c['options'][_0x10a0('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37350c[_0x10a0('0x20')]?_0x37350c[_0x10a0('0x20')][_0x10a0('0x22')]||null:null,'attributes':_0x37350c['options']?_0x37350c['options'][_0x10a0('0x23')]||null:null,'limit':_0x37350c[_0x10a0('0x20')]?_0x37350c[_0x10a0('0x20')]['limit']||null:null})[_0x10a0('0x11')](function(_0xffa582){logger[_0x10a0('0x12')](_0x10a0('0x1c'),_0x37350c);logger['debug'](_0x10a0('0x1c'),_0x37350c,JSON[_0x10a0('0x16')](_0xffa582));_0x17e961(_0xffa582);})[_0x10a0('0x1b')](function(_0x190b47){logger[_0x10a0('0x17')](_0x10a0('0x1c'),_0x190b47[_0x10a0('0x1a')],_0x37350c);_0x1bf19f(_0xfb9163['error'](0x1f4,_0x190b47[_0x10a0('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0x18c9b5){return new Promise(function(_0x49ab3b,_0x3be3f1){return db['MailInteraction'][_0x10a0('0x24')]({'where':_0x18c9b5[_0x10a0('0x20')]?_0x18c9b5[_0x10a0('0x20')]['where']||null:null})['then'](function(_0x42749b){if(_0x42749b){return _0x42749b['addTags'](_0x18c9b5[_0x10a0('0x1f')]['ids'],_['omit'](_0x18c9b5['body'],[_0x10a0('0x25'),'id'])||{});}})['spread'](function(_0x48dd5c){logger[_0x10a0('0x12')](_0x10a0('0x26'),_0x18c9b5);logger['debug'](_0x10a0('0x26'),_0x18c9b5,JSON[_0x10a0('0x16')](_0x48dd5c));_0x49ab3b(_0x48dd5c);})[_0x10a0('0x1b')](function(_0x3ef8fc){logger[_0x10a0('0x17')](_0x10a0('0x26'),_0x3ef8fc[_0x10a0('0x1a')],_0x18c9b5);_0x3be3f1(_this[_0x10a0('0x17')](0x1f4,_0x3ef8fc[_0x10a0('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index cc665aa..a32f917 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 _0x2a1a=['removeListener','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x202bf2,_0x11f26b){var _0x2be100=function(_0x2773db){while(--_0x2773db){_0x202bf2['push'](_0x202bf2['shift']());}};_0x2be100(++_0x11f26b);}(_0x2a1a,0x163));var _0xa2a1=function(_0x2dbfa2,_0x5b22a5){_0x2dbfa2=_0x2dbfa2-0x0;var _0x5ede96=_0x2a1a[_0x2dbfa2];return _0x5ede96;};'use strict';var MailInteractionEvents=require(_0xa2a1('0x0'));var events=[_0xa2a1('0x1'),_0xa2a1('0x2'),_0xa2a1('0x3')];function createListener(_0x3c6a02,_0xc1ff2a){return function(_0x7aff6){_0xc1ff2a[_0xa2a1('0x4')](_0x3c6a02,_0x7aff6);};}function removeListener(_0xb35e54,_0x31ec18){return function(){MailInteractionEvents[_0xa2a1('0x5')](_0xb35e54,_0x31ec18);};}exports['register']=function(_0x5d67e0){for(var _0x2df0dc=0x0,_0x2e9a6e=events[_0xa2a1('0x6')];_0x2df0dc<_0x2e9a6e;_0x2df0dc++){var _0x2c230d=events[_0x2df0dc];var _0x13df76=createListener(_0xa2a1('0x7')+_0x2c230d,_0x5d67e0);MailInteractionEvents['on'](_0x2c230d,_0x13df76);}}; \ No newline at end of file +var _0x5a79=['length','mailInteraction:','./mailInteraction.events','save','update','emit','removeListener','register'];(function(_0xfed299,_0x21b8d0){var _0x4ef1f2=function(_0x347a84){while(--_0x347a84){_0xfed299['push'](_0xfed299['shift']());}};_0x4ef1f2(++_0x21b8d0);}(_0x5a79,0x1e2));var _0x95a7=function(_0x8c8176,_0x5360a1){_0x8c8176=_0x8c8176-0x0;var _0x4dc47b=_0x5a79[_0x8c8176];return _0x4dc47b;};'use strict';var MailInteractionEvents=require(_0x95a7('0x0'));var events=[_0x95a7('0x1'),'remove',_0x95a7('0x2')];function createListener(_0x5f22b9,_0x1b5bf3){return function(_0x15a952){_0x1b5bf3[_0x95a7('0x3')](_0x5f22b9,_0x15a952);};}function removeListener(_0x3d8e69,_0x48b0de){return function(){MailInteractionEvents[_0x95a7('0x4')](_0x3d8e69,_0x48b0de);};}exports[_0x95a7('0x5')]=function(_0x211864){for(var _0x2c6985=0x0,_0x4d3cbf=events[_0x95a7('0x6')];_0x2c6985<_0x4d3cbf;_0x2c6985++){var _0x456256=events[_0x2c6985];var _0xacc21b=createListener(_0x95a7('0x7')+_0x456256,_0x211864);MailInteractionEvents['on'](_0x456256,_0xacc21b);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 3ad1f52..3e01151 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6778=['get','isAuthenticated','describe','exports','express','Router','../../components/auth/service'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x6778,0x1d2));var _0x8677=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x6778[_0x541ea6];return _0x3c3e84;};'use strict';var express=require(_0x8677('0x0'));var router=express[_0x8677('0x1')]();var auth=require(_0x8677('0x2'));var controller=require('./mailInteractionHasTag.controller');router[_0x8677('0x3')]('/describe',auth[_0x8677('0x4')](),controller[_0x8677('0x5')]);module[_0x8677('0x6')]=router; \ No newline at end of file +var _0x8921=['describe','exports','express','../../components/auth/service','./mailInteractionHasTag.controller','get','/describe','isAuthenticated'];(function(_0xed7c77,_0x19544e){var _0x25e668=function(_0x41548f){while(--_0x41548f){_0xed7c77['push'](_0xed7c77['shift']());}};_0x25e668(++_0x19544e);}(_0x8921,0x9a));var _0x1892=function(_0x895558,_0x2978d9){_0x895558=_0x895558-0x0;var _0x8fd70d=_0x8921[_0x895558];return _0x8fd70d;};'use strict';var express=require(_0x1892('0x0'));var router=express['Router']();var auth=require(_0x1892('0x1'));var controller=require(_0x1892('0x2'));router[_0x1892('0x3')](_0x1892('0x4'),auth[_0x1892('0x5')](),controller[_0x1892('0x6')]);module[_0x1892('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index fdb641c..c6e3c7f 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x4d296c,_0x17d05b){var _0x583dbf=function(_0x37e64a){while(--_0x37e64a){_0x4d296c['push'](_0x4d296c['shift']());}};_0x583dbf(++_0x17d05b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x32445d,_0x552432){var _0x22241c=function(_0x36609a){while(--_0x36609a){_0x32445d['push'](_0x32445d['shift']());}};_0x22241c(++_0x552432);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index e5b9de8..996ebda 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x451c=['exports','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x451c,0x1e0));var _0xc451=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0x451c[_0xa1e3ca];return _0x5005ab;};'use strict';var Sequelize=require('sequelize');module[_0xc451('0x0')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xc451('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0xabc3=['exports','INTEGER'];(function(_0x5bbf1f,_0x3b1735){var _0x56557f=function(_0x1f35fd){while(--_0x1f35fd){_0x5bbf1f['push'](_0x5bbf1f['shift']());}};_0x56557f(++_0x3b1735);}(_0xabc3,0xfc));var _0x3abc=function(_0x1712f8,_0x45409f){_0x1712f8=_0x1712f8-0x0;var _0x56e19c=_0xabc3[_0x1712f8];return _0x56e19c;};'use strict';var Sequelize=require('sequelize');module[_0x3abc('0x0')]={'MailInteractionId':{'type':Sequelize[_0x3abc('0x1')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0x3abc('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 21a857f..805e7d5 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadec=['MailInteractionHasTag','./mailInteractionHasTag','exports','define'];(function(_0x401221,_0x7b3acc){var _0x5e9bb9=function(_0x2ee8c4){while(--_0x2ee8c4){_0x401221['push'](_0x401221['shift']());}};_0x5e9bb9(++_0x7b3acc);}(_0xadec,0x1a1));var _0xcade=function(_0x271571,_0x4737a8){_0x271571=_0x271571-0x0;var _0x30fde9=_0xadec[_0x271571];return _0x30fde9;};'use strict';var attributes=require(_0xcade('0x0'));module[_0xcade('0x1')]=function(_0x12c473){return _0x12c473[_0xcade('0x2')](_0xcade('0x3'),attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5bf=['define','./mailInteractionHasTag'];(function(_0x449a38,_0x3f8271){var _0x38a415=function(_0x261b53){while(--_0x261b53){_0x449a38['push'](_0x449a38['shift']());}};_0x38a415(++_0x3f8271);}(_0xd5bf,0x15d));var _0xfd5b=function(_0xe9d10a,_0x191e32){_0xe9d10a=_0xe9d10a-0x0;var _0x3e019a=_0xd5bf[_0xe9d10a];return _0x3e019a;};'use strict';var attributes=require(_0xfd5b('0x0'));module['exports']=function(_0x5ea36c){return _0x5ea36c[_0xfd5b('0x1')]('MailInteractionHasTag',attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 6f4517f..188de5c 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 _0x47fd=['/:id','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','/:id/download','download','tracked','mailmessage:create','create','put'];(function(_0x3a8cce,_0x350409){var _0x4e99e7=function(_0x47e698){while(--_0x47e698){_0x3a8cce['push'](_0x3a8cce['shift']());}};_0x4e99e7(++_0x350409);}(_0x47fd,0x13c));var _0xd47f=function(_0x7303c,_0x2d7803){_0x7303c=_0x7303c-0x0;var _0x367cc7=_0x47fd[_0x7303c];return _0x367cc7;};'use strict';var multer=require(_0xd47f('0x0'));var util=require(_0xd47f('0x1'));var path=require(_0xd47f('0x2'));var timeout=require(_0xd47f('0x3'));var express=require(_0xd47f('0x4'));var router=express[_0xd47f('0x5')]();var fs_extra=require(_0xd47f('0x6'));var auth=require(_0xd47f('0x7'));var interaction=require(_0xd47f('0x8'));var config=require(_0xd47f('0x9'));var controller=require('./mailMessage.controller');router[_0xd47f('0xa')]('/',auth[_0xd47f('0xb')](),controller['index']);router[_0xd47f('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xd47f('0xc')]);router['get']('/:id',auth[_0xd47f('0xb')](),controller[_0xd47f('0xd')]);router[_0xd47f('0xa')](_0xd47f('0xe'),auth[_0xd47f('0xb')](),controller[_0xd47f('0xf')]);router['post']('/',auth[_0xd47f('0xb')](),interaction[_0xd47f('0x10')]('mail',_0xd47f('0x11')),controller[_0xd47f('0x12')]);router[_0xd47f('0x13')](_0xd47f('0x14'),auth[_0xd47f('0xb')](),controller[_0xd47f('0x15')]);router['put'](_0xd47f('0x16'),auth[_0xd47f('0xb')](),controller[_0xd47f('0x17')]);router[_0xd47f('0x13')](_0xd47f('0x18'),auth[_0xd47f('0xb')](),controller[_0xd47f('0x19')]);router[_0xd47f('0x1a')](_0xd47f('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0xd47f('0x1b')]=router; \ No newline at end of file +var _0xaa1b=['/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','get','isAuthenticated','describe'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xbaa1('0x0'));var util=require(_0xbaa1('0x1'));var path=require(_0xbaa1('0x2'));var timeout=require('connect-timeout');var express=require(_0xbaa1('0x3'));var router=express['Router']();var fs_extra=require(_0xbaa1('0x4'));var auth=require(_0xbaa1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xbaa1('0x6')]('/',auth[_0xbaa1('0x7')](),controller['index']);router[_0xbaa1('0x6')]('/describe',auth[_0xbaa1('0x7')](),controller[_0xbaa1('0x8')]);router[_0xbaa1('0x6')](_0xbaa1('0x9'),auth[_0xbaa1('0x7')](),controller[_0xbaa1('0xa')]);router['get'](_0xbaa1('0xb'),auth[_0xbaa1('0x7')](),controller[_0xbaa1('0xc')]);router[_0xbaa1('0xd')]('/',auth[_0xbaa1('0x7')](),interaction[_0xbaa1('0xe')](_0xbaa1('0xf'),_0xbaa1('0x10')),controller[_0xbaa1('0x11')]);router[_0xbaa1('0x12')](_0xbaa1('0x9'),auth[_0xbaa1('0x7')](),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xbaa1('0x13')]);router[_0xbaa1('0x12')](_0xbaa1('0x14'),auth[_0xbaa1('0x7')](),controller[_0xbaa1('0x15')]);router[_0xbaa1('0x16')](_0xbaa1('0x9'),auth[_0xbaa1('0x7')](),controller[_0xbaa1('0x17')]);module[_0xbaa1('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 6e329c6..ffa9971 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 _0xfde2=['long','TEXT','medium','BOOLEAN','out','STRING','DATE','Email','Chat'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xfde2,0xea));var _0x2fde=function(_0x3e80e5,_0x5ba461){_0x3e80e5=_0x3e80e5-0x0;var _0x43a128=_0xfde2[_0x3e80e5];return _0x43a128;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'body':{'type':Sequelize['TEXT'](_0x2fde('0x0')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2fde('0x1')](_0x2fde('0x2'))},'read':{'type':Sequelize[_0x2fde('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2fde('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2fde('0x5')](0x1fe)},'from':{'type':Sequelize[_0x2fde('0x5')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x2fde('0x1')](_0x2fde('0x0'))},'bcc':{'type':Sequelize[_0x2fde('0x1')](_0x2fde('0x0'))},'subject':{'type':Sequelize[_0x2fde('0x1')]},'sentAt':{'type':Sequelize[_0x2fde('0x6')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2fde('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2fde('0x6')]},'originTo':{'type':Sequelize[_0x2fde('0x1')](_0x2fde('0x0'))},'originCc':{'type':Sequelize[_0x2fde('0x1')](_0x2fde('0x0'))},'originChannel':{'type':Sequelize['ENUM'](_0x2fde('0x7'),_0x2fde('0x8')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x072e=['BOOLEAN','ENUM','STRING','long','DATE','INTEGER','Email','lodash','exports','TEXT','medium'];(function(_0x477a89,_0x1eced9){var _0x4363f9=function(_0x1cb699){while(--_0x1cb699){_0x477a89['push'](_0x477a89['shift']());}};_0x4363f9(++_0x1eced9);}(_0x072e,0x75));var _0xe072=function(_0x5ac2e3,_0x1425aa){_0x5ac2e3=_0x5ac2e3-0x0;var _0x3890b1=_0x072e[_0x5ac2e3];return _0x3890b1;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe072('0x0'));module[_0xe072('0x1')]={'body':{'type':Sequelize[_0xe072('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe072('0x2')](_0xe072('0x3'))},'read':{'type':Sequelize[_0xe072('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe072('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe072('0x6')](0x1fe)},'from':{'type':Sequelize[_0xe072('0x6')]},'to':{'type':Sequelize[_0xe072('0x2')](_0xe072('0x7'))},'cc':{'type':Sequelize['TEXT'](_0xe072('0x7'))},'bcc':{'type':Sequelize[_0xe072('0x2')](_0xe072('0x7'))},'subject':{'type':Sequelize[_0xe072('0x2')]},'sentAt':{'type':Sequelize[_0xe072('0x8')]},'attach':{'type':Sequelize[_0xe072('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe072('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe072('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0xe072('0x7'))},'originCc':{'type':Sequelize[_0xe072('0x2')](_0xe072('0x7'))},'originChannel':{'type':Sequelize['ENUM'](_0xe072('0xa'),'Chat'),'defaultValue':_0xe072('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 957cb23..b00e5a7 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 _0x3c93=['writeFileSync','unlinkSync','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','localhost','redis','html-entities','./mailMessage.socket','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','length','find','body','describe','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','create','ListId','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','email','interface','event','rejectmessage','download','toString','server','files','tmp','root','message-%s.eml','createdAt','Attachment','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','Attachments','existsSync','push','build'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3c93,0x148));var _0x33c9=function(_0x3a5562,_0x381ca5){_0x3a5562=_0x3a5562-0x0;var _0x3b49d6=_0x3c93[_0x3a5562];return _0x3b49d6;};'use strict';var emlformat=require('eml-format');var moment=require(_0x33c9('0x0'));var BPromise=require(_0x33c9('0x1'));var util=require('util');var path=require(_0x33c9('0x2'));var fs=require('fs');var _=require(_0x33c9('0x3'));var Redis=require(_0x33c9('0x4'));var htmlToText=require(_0x33c9('0x5'));var qs=require(_0x33c9('0x6'));var logger=require(_0x33c9('0x7'))(_0x33c9('0x8'));var interaction_log=require(_0x33c9('0x7'))(_0x33c9('0x9'));var config=require(_0x33c9('0xa'));var db=require(_0x33c9('0xb'))['db'];config['redis']=_[_0x33c9('0xc')](config['redis'],{'host':_0x33c9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33c9('0xe')]));var htmlEntities=require(_0x33c9('0xf'));require(_0x33c9('0x10'))['register'](socket);var jayson=require(_0x33c9('0x11'));var client=jayson[_0x33c9('0x12')]['http']({'port':0x232c});var client9003=jayson[_0x33c9('0x12')]['http']({'port':0x232b});var client9002=jayson['client'][_0x33c9('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x124e51,_0x1c026b,_0x1ce8d7,_0x4cd8bd){return new BPromise(function(_0x36e078,_0x1468c2){var _0x4cc284=_0x4cd8bd||client;return _0x4cc284[_0x33c9('0x14')](_0x124e51,_0x1ce8d7)['then'](function(_0x5a4246){logger[_0x33c9('0x15')](_0x33c9('0x16'),_0x1c026b,_0x33c9('0x17'));logger['debug'](_0x33c9('0x18'),_0x1c026b,_0x33c9('0x17'),JSON[_0x33c9('0x19')](_0x5a4246));if(_0x5a4246[_0x33c9('0x1a')]){if(_0x5a4246[_0x33c9('0x1a')][_0x33c9('0x1b')]===0x1f4){logger[_0x33c9('0x1a')](_0x33c9('0x16'),_0x1c026b,_0x5a4246[_0x33c9('0x1a')]['message']);return _0x1468c2(_0x5a4246[_0x33c9('0x1a')][_0x33c9('0x1c')]);}logger[_0x33c9('0x1a')](_0x33c9('0x16'),_0x1c026b,_0x5a4246[_0x33c9('0x1a')][_0x33c9('0x1c')]);return _0x36e078(_0x5a4246[_0x33c9('0x1a')][_0x33c9('0x1c')]);}else{logger[_0x33c9('0x15')]('MailMessage,\x20%s,\x20%s',_0x1c026b,_0x33c9('0x17'));_0x36e078(_0x5a4246[_0x33c9('0x1d')][_0x33c9('0x1c')]);}})[_0x33c9('0x1e')](function(_0x27db54){logger['error'](_0x33c9('0x16'),_0x1c026b,_0x27db54);_0x1468c2(_0x27db54);});});}function respondWithResult(_0x156810,_0x29a502){_0x29a502=_0x29a502||0xc8;return function(_0x44d27){if(_0x44d27){return _0x156810[_0x33c9('0x1f')](_0x29a502)[_0x33c9('0x20')](_0x44d27);}};}function respondWithFilteredResult(_0x442099,_0x317881){return function(_0x5b9c6e){if(_0x5b9c6e){var _0x17b582=typeof _0x317881[_0x33c9('0x21')]===_0x33c9('0x22')&&typeof _0x317881[_0x33c9('0x23')]==='undefined';var _0x1dfe64=_0x5b9c6e['count'];var _0x48ceb8=_0x17b582?0x0:_0x317881[_0x33c9('0x21')];var _0x2e6060=_0x17b582?_0x5b9c6e[_0x33c9('0x24')]:_0x317881[_0x33c9('0x21')]+_0x317881[_0x33c9('0x23')];var _0x4eefd3;if(_0x2e6060>=_0x1dfe64){_0x2e6060=_0x1dfe64;_0x4eefd3=0xc8;}else{_0x4eefd3=0xce;}_0x442099['status'](_0x4eefd3);return _0x442099['set'](_0x33c9('0x25'),_0x48ceb8+'-'+_0x2e6060+'/'+_0x1dfe64)[_0x33c9('0x20')](_0x5b9c6e);}return null;};}function saveUpdates(_0x47cc9d){return function(_0x2b7093){if(_0x2b7093){return _0x2b7093[_0x33c9('0x26')](_0x47cc9d)[_0x33c9('0x27')](function(_0x3e08c1){return _0x3e08c1;});}return null;};}function removeEntity(_0xe3c590){return function(_0x2d5267){if(_0x2d5267){return _0x2d5267[_0x33c9('0x28')]()[_0x33c9('0x27')](function(){_0xe3c590['status'](0xcc)[_0x33c9('0x29')]();});}};}function handleEntityNotFound(_0x50388c){return function(_0x1262cf){if(!_0x1262cf){_0x50388c[_0x33c9('0x2a')](0x194);}return _0x1262cf;};}function handleError(_0x33f65b,_0x2dc8ad){_0x2dc8ad=_0x2dc8ad||0x1f4;return function(_0x47390c){logger[_0x33c9('0x1a')](_0x47390c[_0x33c9('0x2b')]);if(_0x47390c[_0x33c9('0x2c')]){delete _0x47390c[_0x33c9('0x2c')];}_0x33f65b['status'](_0x2dc8ad)['send'](_0x47390c);};}exports[_0x33c9('0x2d')]=function(_0x4df781,_0x44c7a0){var _0x140768={},_0x244b7a={},_0x126b5a={'count':0x0,'rows':[]};var _0x4417e1=_[_0x33c9('0x2e')](db[_0x33c9('0x2f')][_0x33c9('0x30')],function(_0x54af62){return{'name':_0x54af62[_0x33c9('0x31')],'type':_0x54af62[_0x33c9('0x32')]['key']};});_0x244b7a[_0x33c9('0x33')]=_['map'](_0x4417e1,_0x33c9('0x2c'));_0x244b7a[_0x33c9('0x34')]=_[_0x33c9('0x35')](_0x4df781[_0x33c9('0x34')]);_0x244b7a[_0x33c9('0x36')]=_[_0x33c9('0x37')](_0x244b7a[_0x33c9('0x33')],_0x244b7a[_0x33c9('0x34')]);_0x140768[_0x33c9('0x38')]=_[_0x33c9('0x37')](_0x244b7a[_0x33c9('0x33')],qs[_0x33c9('0x39')](_0x4df781[_0x33c9('0x34')][_0x33c9('0x39')]));_0x140768[_0x33c9('0x38')]=_0x140768[_0x33c9('0x38')]['length']?_0x140768[_0x33c9('0x38')]:_0x244b7a[_0x33c9('0x33')];if(!_0x4df781[_0x33c9('0x34')][_0x33c9('0x3a')](_0x33c9('0x3b'))){_0x140768[_0x33c9('0x23')]=qs['limit'](_0x4df781[_0x33c9('0x34')][_0x33c9('0x23')]);_0x140768['offset']=qs[_0x33c9('0x21')](_0x4df781[_0x33c9('0x34')][_0x33c9('0x21')]);}_0x140768[_0x33c9('0x3c')]=qs[_0x33c9('0x3d')](_0x4df781[_0x33c9('0x34')][_0x33c9('0x3d')]);_0x140768[_0x33c9('0x3e')]=qs[_0x33c9('0x36')](_[_0x33c9('0x3f')](_0x4df781[_0x33c9('0x34')],_0x244b7a[_0x33c9('0x36')]),_0x4417e1);if(_0x4df781['query']['filter']){_0x140768[_0x33c9('0x3e')]=_[_0x33c9('0x40')](_0x140768['where'],{'$or':_[_0x33c9('0x2e')](_0x4417e1,function(_0x263e9c){if(_0x263e9c[_0x33c9('0x32')]!=='VIRTUAL'){var _0xa0d329={};_0xa0d329[_0x263e9c[_0x33c9('0x2c')]]={'$like':'%'+_0x4df781['query'][_0x33c9('0x41')]+'%'};return _0xa0d329;}})});}_0x140768=_['merge']({},_0x140768,_0x4df781[_0x33c9('0x42')]);var _0xfaaa66={'where':_0x140768[_0x33c9('0x3e')]};return db[_0x33c9('0x2f')][_0x33c9('0x24')](_0xfaaa66)[_0x33c9('0x27')](function(_0x213f91){_0x126b5a[_0x33c9('0x24')]=_0x213f91;if(_0x4df781[_0x33c9('0x34')][_0x33c9('0x43')]){_0x140768[_0x33c9('0x44')]=[{'all':!![]}];}return db[_0x33c9('0x2f')][_0x33c9('0x45')](_0x140768);})[_0x33c9('0x27')](function(_0x165c87){_0x126b5a[_0x33c9('0x46')]=_0x165c87;return _0x126b5a;})[_0x33c9('0x27')](respondWithFilteredResult(_0x44c7a0,_0x140768))['catch'](handleError(_0x44c7a0,null));};exports[_0x33c9('0x47')]=function(_0x3c3751,_0x4516e5){var _0xe970ec={'raw':!![],'where':{'id':_0x3c3751[_0x33c9('0x48')]['id']}},_0x6766f4={};_0x6766f4['model']=_[_0x33c9('0x35')](db[_0x33c9('0x2f')][_0x33c9('0x30')]);_0x6766f4[_0x33c9('0x34')]=_['keys'](_0x3c3751[_0x33c9('0x34')]);_0x6766f4['filters']=_['intersection'](_0x6766f4['model'],_0x6766f4[_0x33c9('0x34')]);_0xe970ec[_0x33c9('0x38')]=_['intersection'](_0x6766f4[_0x33c9('0x33')],qs[_0x33c9('0x39')](_0x3c3751[_0x33c9('0x34')]['fields']));_0xe970ec[_0x33c9('0x38')]=_0xe970ec[_0x33c9('0x38')][_0x33c9('0x49')]?_0xe970ec['attributes']:_0x6766f4[_0x33c9('0x33')];if(_0x3c3751[_0x33c9('0x34')][_0x33c9('0x43')]){_0xe970ec[_0x33c9('0x44')]=[{'all':!![]}];}_0xe970ec=_[_0x33c9('0x40')]({},_0xe970ec,_0x3c3751[_0x33c9('0x42')]);return db[_0x33c9('0x2f')][_0x33c9('0x4a')](_0xe970ec)[_0x33c9('0x27')](handleEntityNotFound(_0x4516e5,null))[_0x33c9('0x27')](respondWithResult(_0x4516e5,null))[_0x33c9('0x1e')](handleError(_0x4516e5,null));};exports[_0x33c9('0x26')]=function(_0x1cd3e1,_0x5e4c3b){if(_0x1cd3e1[_0x33c9('0x4b')]['id']){delete _0x1cd3e1['body']['id'];}return db[_0x33c9('0x2f')][_0x33c9('0x4a')]({'where':{'id':_0x1cd3e1['params']['id']}})[_0x33c9('0x27')](handleEntityNotFound(_0x5e4c3b,null))[_0x33c9('0x27')](saveUpdates(_0x1cd3e1[_0x33c9('0x4b')],null))[_0x33c9('0x27')](respondWithResult(_0x5e4c3b,null))[_0x33c9('0x1e')](handleError(_0x5e4c3b,null));};exports['destroy']=function(_0x3a5908,_0x37d7be){return db[_0x33c9('0x2f')][_0x33c9('0x4a')]({'where':{'id':_0x3a5908[_0x33c9('0x48')]['id']}})[_0x33c9('0x27')](handleEntityNotFound(_0x37d7be,null))[_0x33c9('0x27')](removeEntity(_0x37d7be,null))['catch'](handleError(_0x37d7be,null));};exports[_0x33c9('0x4c')]=function(_0x2d4156,_0x4ccd3a){return db[_0x33c9('0x2f')][_0x33c9('0x4c')]()['then'](respondWithResult(_0x4ccd3a,null))[_0x33c9('0x1e')](handleError(_0x4ccd3a,null));};exports['create']=function(_0x55d079,_0x44e118){return db[_0x33c9('0x2f')]['create'](_0x55d079[_0x33c9('0x4b')])[_0x33c9('0x27')](function(_0x4e94c5){if(_0x4e94c5){if(_0x4e94c5[_0x33c9('0x4d')]===_0x33c9('0x4e')&&!_0x4e94c5[_0x33c9('0x4f')]){var _0x54ee50,_0x134dd7,_0x2cda5f;if(_0x55d079[_0x33c9('0x4b')]['to']){_0x134dd7=_0x55d079[_0x33c9('0x4b')]['to'][_0x33c9('0x50')](',')[0x0];}return db[_0x33c9('0x51')][_0x33c9('0x52')]({'where':{'id':_0x4e94c5['MailAccountId']},'include':[{'model':db[_0x33c9('0x53')],'as':_0x33c9('0x54'),'include':[{'model':db[_0x33c9('0x55')],'as':_0x33c9('0x56'),'where':{'email':_0x134dd7},'limit':0x1,'order':[[_0x33c9('0x57'),'DESC']]}]},{'model':db[_0x33c9('0x58')],'as':_0x33c9('0x59'),'raw':!![],'include':[{'model':db[_0x33c9('0x5a')],'as':'CloudProvider','raw':!![]}]}]})[_0x33c9('0x27')](function(_0x3f8e1f){_0x54ee50=_0x3f8e1f;if(!_0x54ee50||!_0x54ee50[_0x33c9('0x59')])return;var _0x2ab682=_0x54ee50[_0x33c9('0x5b')]();if(_0x55d079[_0x33c9('0x4b')][_0x33c9('0x5c')]&&_0x55d079[_0x33c9('0x4b')]['attachments'][_0x33c9('0x49')]){for(var _0x44a723=0x0;_0x44a723<_0x55d079['body']['attachments'][_0x33c9('0x49')];_0x44a723+=0x1){_0x55d079[_0x33c9('0x4b')][_0x33c9('0x5c')][_0x44a723]={'filename':_0x55d079[_0x33c9('0x4b')][_0x33c9('0x5c')][_0x44a723]['name'],'path':path[_0x33c9('0x5d')](config['root'],_0x33c9('0x5e'),_0x55d079['body'][_0x33c9('0x5c')][_0x44a723][_0x33c9('0x5f')])};}}_0x2cda5f={'account':_0x2ab682,'message':_0x55d079[_0x33c9('0x4b')]};return;})[_0x33c9('0x27')](function(){if(_0x54ee50['List']){if(_0x54ee50[_0x33c9('0x54')][_0x33c9('0x56')][_0x33c9('0x49')]){return _0x54ee50[_0x33c9('0x54')][_0x33c9('0x56')][0x0];}else{return db[_0x33c9('0x55')][_0x33c9('0x60')](_['defaults'](_0x55d079[_0x33c9('0x4b')],{'firstName':_0x55d079[_0x33c9('0x4b')]['to'],'email':_0x55d079['body']['to'],'phone':_0x55d079['body']['to'],'ListId':_0x54ee50[_0x33c9('0x61')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x33c9('0x27')](function(){if(_0x2cda5f){return respondWithRpcPromise('SendMail',_0x33c9('0x62'),_0x2cda5f,client9003)[_0x33c9('0x27')](function(_0x2cc171){return _0x4e94c5[_0x33c9('0x26')]({'read':!![],'messageId':_0x2cc171['messageId'],'sentAt':moment()[_0x33c9('0x63')](_0x33c9('0x64'))});})['catch'](function(_0x34c8b9){logger['error']('%s',JSON['stringify'](_0x34c8b9));return _0x4e94c5;});}return _0x4e94c5;});}return _0x4e94c5;}})['then'](respondWithResult(_0x44e118,0xc9))['catch'](handleError(_0x44e118,null));};exports[_0x33c9('0x65')]=function(_0xa975db,_0x74ed66){var _0x223061={'agent':{},'channel':_0x33c9('0x66')};if(_0xa975db[_0x33c9('0x4b')]['id']){delete _0xa975db[_0x33c9('0x4b')]['id'];}_0xa975db[_0x33c9('0x4b')][_0x33c9('0x67')]=!![];_0xa975db['body'][_0x33c9('0x68')]=moment()[_0x33c9('0x63')](_0x33c9('0x64'));_0xa975db[_0x33c9('0x4b')][_0x33c9('0x69')]=_0xa975db[_0x33c9('0x4b')][_0x33c9('0x69')]||_0xa975db[_0x33c9('0x6a')]['id'];_0x223061[_0x33c9('0x6b')]['id']=_0xa975db[_0x33c9('0x4b')][_0x33c9('0x69')];return db[_0x33c9('0x2f')][_0x33c9('0x4a')]({'where':{'id':_0xa975db[_0x33c9('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x74ed66,null))[_0x33c9('0x27')](saveUpdates(_0xa975db[_0x33c9('0x4b')],null))[_0x33c9('0x27')](function(_0x54bbdb){if(_0x54bbdb){_0x223061['message']=_0x54bbdb['get']({'plain':!![]});return db[_0x33c9('0x6c')][_0x33c9('0x4a')]({'where':{'id':_0x54bbdb[_0x33c9('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x74ed66,null))[_0x33c9('0x27')](function(_0x1add77){if(_0x1add77){return _0x1add77[_0x33c9('0x26')]({'UserId':_0xa975db['body'][_0x33c9('0x69')],'read1stAt':_[_0x33c9('0x6e')](_0x1add77[_0x33c9('0x6f')])?moment()[_0x33c9('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x33c9('0x27')](function(_0x261e08){if(_0x261e08){_0x223061[_0x33c9('0x70')]=_0x261e08[_0x33c9('0x71')]({'plain':!![]});interaction_log['info'](_0x33c9('0x72'),_0xa975db[_0x33c9('0x6a')]['id'],_0xa975db[_0x33c9('0x6a')]['name'],_0xa975db[_0x33c9('0x6a')][_0x33c9('0x73')],_0x223061[_0x33c9('0x70')]['id'],_0xa975db[_0x33c9('0x4b')]?JSON['stringify'](_0xa975db[_0x33c9('0x4b')]):'null');return respondWithRpcPromise(_0x33c9('0x74'),_0x33c9('0x75'),_0x223061);}return null;})[_0x33c9('0x27')](function(_0x5ee356){var _0x1e6d80=_0x33c9('0x76')+_0x5ee356['message']['ContactId'];return db[_0x33c9('0x77')][_0x33c9('0x34')](_0x1e6d80,{'type':db['Sequelize'][_0x33c9('0x78')][_0x33c9('0x79')],'raw':!![]})['then'](function(_0x650f79){return _0x650f79;});})[_0x33c9('0x27')](function(_0x21536a){if(_0x21536a){_0x223061[_0x33c9('0x1c')][_0x33c9('0x7a')]=_0x21536a[0x0];if(!_0xa975db[_0x33c9('0x4b')][_0x33c9('0x69')])return;return db[_0x33c9('0x7b')]['find']({'where':{'id':_0xa975db[_0x33c9('0x4b')][_0x33c9('0x69')],'role':_0x33c9('0x6b')},'attributes':['id',_0x33c9('0x2c'),_0x33c9('0x7c'),'email',_0x33c9('0x7d')],'raw':!![]});}return null;})[_0x33c9('0x27')](function(_0x19c3d9){if(!_0x19c3d9)return null;_0x223061['message'][_0x33c9('0x6b')]=_0x19c3d9;return _0x223061;})[_0x33c9('0x27')](function(_0x1e888){if(_0x1e888){if(_0xa975db[_0x33c9('0x4b')][_0x33c9('0x7e')]){_0x223061[_0x33c9('0x1c')]['interface']=util[_0x33c9('0x63')](_0x33c9('0x7f'),_0xa975db[_0x33c9('0x6a')]['name']);_0x223061[_0x33c9('0x1c')]['channel']=_0x223061[_0x33c9('0x80')];_0x223061['message'][_0x33c9('0x81')]=_0x223061[_0x33c9('0x80')];_0x223061['message']['event']=_0x33c9('0x65');_0x223061[_0x33c9('0x1c')][_0x33c9('0x4b')]=htmlToText[_0x33c9('0x82')](_0x223061[_0x33c9('0x1c')][_0x33c9('0x4b')]);return respondWithRpcPromise(_0x33c9('0x83'),'EventManager',{'event':'acceptmessage','message':_0x223061[_0x33c9('0x1c')]},client9002)[_0x33c9('0x27')](function(){return _0x223061;});}return _0x223061;}return null;})[_0x33c9('0x27')](respondWithResult(_0x74ed66,null))['catch'](handleError(_0x74ed66,null));};exports[_0x33c9('0x84')]=function(_0x5a387f,_0x4627ac){var _0x1b9948={'agent':{},'channel':_0x33c9('0x66')};if(_0x5a387f['body']['id']){delete _0x5a387f[_0x33c9('0x4b')]['id'];}_0x5a387f[_0x33c9('0x4b')][_0x33c9('0x69')]=_0x5a387f[_0x33c9('0x4b')][_0x33c9('0x69')]||_0x5a387f[_0x33c9('0x6a')]['id'];_0x1b9948[_0x33c9('0x6b')]['id']=_0x5a387f[_0x33c9('0x4b')]['UserId'];return db[_0x33c9('0x2f')][_0x33c9('0x4a')]({'where':{'id':_0x5a387f['params']['id'],'UserId':null}})[_0x33c9('0x27')](handleEntityNotFound(_0x4627ac,null))[_0x33c9('0x27')](function(_0x54c55a){if(_0x54c55a){_0x1b9948['message']=_0x54c55a[_0x33c9('0x71')]({'plain':!![]});return db[_0x33c9('0x6c')][_0x33c9('0x4a')]({'where':{'id':_0x54c55a['MailInteractionId']}});}return null;})[_0x33c9('0x27')](handleEntityNotFound(_0x4627ac,null))[_0x33c9('0x27')](function(_0x496a90){if(_0x496a90){_0x1b9948[_0x33c9('0x70')]=_0x496a90[_0x33c9('0x71')]({'plain':!![]});interaction_log[_0x33c9('0x15')](_0x33c9('0x85'),_0x5a387f[_0x33c9('0x6a')]['id'],_0x5a387f[_0x33c9('0x6a')]['name'],_0x5a387f[_0x33c9('0x6a')][_0x33c9('0x73')],_0x1b9948[_0x33c9('0x70')]['id'],_0x5a387f['body']?JSON[_0x33c9('0x19')](_0x5a387f[_0x33c9('0x4b')]):'null');return respondWithRpcPromise(_0x33c9('0x86'),_0x33c9('0x87'),_0x1b9948);}return null;})[_0x33c9('0x27')](function(_0xd6c72){var _0x3ba2ad=_0x33c9('0x76')+_0xd6c72[_0x33c9('0x1c')]['ContactId'];return db[_0x33c9('0x77')]['query'](_0x3ba2ad,{'type':db[_0x33c9('0x88')][_0x33c9('0x78')][_0x33c9('0x79')],'raw':!![]})[_0x33c9('0x27')](function(_0x2bc616){return _0x2bc616;});})[_0x33c9('0x27')](function(_0x12dc06){if(_0x12dc06){_0x1b9948[_0x33c9('0x1c')][_0x33c9('0x7a')]=_0x12dc06[0x0];if(!_0x5a387f['body'][_0x33c9('0x69')])return;return db[_0x33c9('0x7b')][_0x33c9('0x4a')]({'where':{'id':_0x5a387f[_0x33c9('0x4b')]['UserId'],'role':_0x33c9('0x6b')},'attributes':['id',_0x33c9('0x2c'),_0x33c9('0x7c'),_0x33c9('0x89'),_0x33c9('0x7d')],'raw':!![]});}return null;})[_0x33c9('0x27')](function(_0x2daaa6){if(!_0x2daaa6)return null;_0x1b9948[_0x33c9('0x1c')][_0x33c9('0x6b')]=_0x2daaa6;return _0x1b9948;})[_0x33c9('0x27')](function(_0x1095b5){if(_0x1095b5){_0x1095b5[_0x33c9('0x1c')][_0x33c9('0x8a')]=util[_0x33c9('0x63')](_0x33c9('0x7f'),_0x5a387f[_0x33c9('0x6a')]['name']);_0x1095b5[_0x33c9('0x1c')][_0x33c9('0x80')]=_0x1b9948[_0x33c9('0x80')];_0x1095b5[_0x33c9('0x1c')]['motionChannel']=_0x1b9948[_0x33c9('0x80')];_0x1095b5[_0x33c9('0x1c')][_0x33c9('0x8b')]=_0x33c9('0x84');_0x1095b5[_0x33c9('0x1c')][_0x33c9('0x4b')]=htmlToText[_0x33c9('0x82')](_0x1b9948[_0x33c9('0x1c')]['body']);respondWithRpcPromise(_0x33c9('0x83'),_0x33c9('0x83'),{'event':_0x33c9('0x8c'),'message':_0x1095b5['message']},client9002);return _0x1b9948;}return null;})[_0x33c9('0x27')](respondWithResult(_0x4627ac,null))[_0x33c9('0x1e')](handleError(_0x4627ac,null));};exports[_0x33c9('0x8d')]=function(_0x11ce40,_0x5104cd){var _0x3c5fb9=moment()['unix']()[_0x33c9('0x8e')]();var _0x1e8be9=path[_0x33c9('0x5d')](config['root'],_0x33c9('0x8f'),_0x33c9('0x90'),_0x33c9('0x91'));var _0x542552=path[_0x33c9('0x5d')](config[_0x33c9('0x92')],_0x33c9('0x8f'),'files','attachments');var _0x388a17=util[_0x33c9('0x63')](_0x33c9('0x93'),_0x3c5fb9);return db[_0x33c9('0x2f')][_0x33c9('0x4a')]({'where':{'id':_0x11ce40[_0x33c9('0x48')]['id']},'attributes':['id','body','from','to','cc','bcc','subject',_0x33c9('0x94')],'include':_0x11ce40[_0x33c9('0x34')]['attachments']?[{'model':db[_0x33c9('0x95')],'as':'Attachments'}]:undefined})[_0x33c9('0x27')](handleEntityNotFound(_0x5104cd,null))[_0x33c9('0x27')](function(_0x984f9f){if(_0x984f9f){var _0x133a34=_0x984f9f;var _0x2d0492={'from':_0x133a34[_0x33c9('0x96')],'to':_0x133a34['to'],'subject':_0x133a34[_0x33c9('0x97')],'html':htmlEntities[_0x33c9('0x98')](_0x133a34[_0x33c9('0x4b')]),'headers':{'Date':moment(_0x133a34['createdAt'])[_0x33c9('0x63')](_0x33c9('0x99'))},'attachments':[]};if(_0x984f9f['cc']){_0x2d0492['headers']['Cc']=_0x984f9f['cc'];}if(_0x984f9f[_0x33c9('0x9a')]){_0x2d0492[_0x33c9('0x9b')][_0x33c9('0x9c')]=_0x984f9f[_0x33c9('0x9a')];}return new BPromise(function(_0x14e2be,_0x5102cf){if(_0x984f9f[_0x33c9('0x9d')]){for(var _0x2483e0=0x0;_0x2483e0<_0x984f9f[_0x33c9('0x9d')][_0x33c9('0x49')];_0x2483e0++){var _0x1f69b7=_0x984f9f[_0x33c9('0x9d')][_0x2483e0];var _0x15eb33=path[_0x33c9('0x5d')](_0x542552,_0x1f69b7[_0x33c9('0x5f')]);if(fs[_0x33c9('0x9e')](_0x15eb33)){_0x2d0492['attachments'][_0x33c9('0x9f')]({'name':_0x1f69b7[_0x33c9('0x2c')],'contentType':_0x1f69b7[_0x33c9('0x32')],'data':fs['readFileSync'](_0x15eb33)});}}}emlformat[_0x33c9('0xa0')](_0x2d0492,function(_0x127e20,_0x5cb469){if(_0x127e20)return _0x5102cf(_0x127e20);fs[_0x33c9('0xa1')](path['join'](_0x1e8be9,_0x388a17),_0x5cb469);return _0x14e2be(_0x5cb469);});});}})['then'](function(_0x372379){if(_0x372379){return _0x5104cd[_0x33c9('0x8d')](path[_0x33c9('0x5d')](_0x1e8be9,_0x388a17),_0x388a17,function(_0x492f74){if(!_0x492f74)fs[_0x33c9('0xa2')](path[_0x33c9('0x5d')](_0x1e8be9,_0x388a17));});}})['catch'](handleError(_0x5104cd,null));}; \ No newline at end of file +var _0x320c=['rejectmessage','download','unix','toString','server','files','tmp','from','bcc','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','stack','name','send','index','MailMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','List','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','get','MailInteraction','MailInteractionId','isNil','read1stAt','user','role','interaction','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','agent','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','internal','motionChannel'];(function(_0x5021d2,_0x318b87){var _0x2cd288=function(_0x217164){while(--_0x217164){_0x5021d2['push'](_0x5021d2['shift']());}};_0x2cd288(++_0x318b87);}(_0x320c,0xb5));var _0xc320=function(_0x2c745d,_0x57ff22){_0x2c745d=_0x2c745d-0x0;var _0x2b2c28=_0x320c[_0x2c745d];return _0x2b2c28;};'use strict';var emlformat=require(_0xc320('0x0'));var moment=require(_0xc320('0x1'));var BPromise=require('bluebird');var util=require(_0xc320('0x2'));var path=require(_0xc320('0x3'));var fs=require('fs');var _=require(_0xc320('0x4'));var Redis=require(_0xc320('0x5'));var htmlToText=require(_0xc320('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xc320('0x7'))(_0xc320('0x8'));var interaction_log=require('../../config/logger')(_0xc320('0x9'));var config=require('../../config/environment');var db=require(_0xc320('0xa'))['db'];config[_0xc320('0xb')]=_[_0xc320('0xc')](config[_0xc320('0xb')],{'host':_0xc320('0xd'),'port':0x18eb});var socket=require(_0xc320('0xe'))(new Redis(config[_0xc320('0xb')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0xc320('0xf')](socket);var jayson=require(_0xc320('0x10'));var client=jayson[_0xc320('0x11')][_0xc320('0x12')]({'port':0x232c});var client9003=jayson[_0xc320('0x11')][_0xc320('0x12')]({'port':0x232b});var client9002=jayson[_0xc320('0x11')][_0xc320('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x11e717,_0x13698d,_0x9ff5b9,_0x806685){return new BPromise(function(_0x119dcf,_0x327f05){var _0x5f1583=_0x806685||client;return _0x5f1583[_0xc320('0x13')](_0x11e717,_0x9ff5b9)[_0xc320('0x14')](function(_0x1c2a9c){logger[_0xc320('0x15')](_0xc320('0x16'),_0x13698d,_0xc320('0x17'));logger[_0xc320('0x18')](_0xc320('0x19'),_0x13698d,_0xc320('0x17'),JSON[_0xc320('0x1a')](_0x1c2a9c));if(_0x1c2a9c['error']){if(_0x1c2a9c[_0xc320('0x1b')][_0xc320('0x1c')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x13698d,_0x1c2a9c[_0xc320('0x1b')][_0xc320('0x1d')]);return _0x327f05(_0x1c2a9c[_0xc320('0x1b')][_0xc320('0x1d')]);}logger[_0xc320('0x1b')](_0xc320('0x16'),_0x13698d,_0x1c2a9c[_0xc320('0x1b')]['message']);return _0x119dcf(_0x1c2a9c['error'][_0xc320('0x1d')]);}else{logger[_0xc320('0x15')](_0xc320('0x16'),_0x13698d,_0xc320('0x17'));_0x119dcf(_0x1c2a9c[_0xc320('0x1e')][_0xc320('0x1d')]);}})[_0xc320('0x1f')](function(_0x4e6737){logger[_0xc320('0x1b')](_0xc320('0x16'),_0x13698d,_0x4e6737);_0x327f05(_0x4e6737);});});}function respondWithResult(_0x35da27,_0x5d24b5){_0x5d24b5=_0x5d24b5||0xc8;return function(_0x3dcf47){if(_0x3dcf47){return _0x35da27[_0xc320('0x20')](_0x5d24b5)[_0xc320('0x21')](_0x3dcf47);}};}function respondWithFilteredResult(_0x2a6e87,_0x564989){return function(_0x536f40){if(_0x536f40){var _0x417978=typeof _0x564989[_0xc320('0x22')]===_0xc320('0x23')&&typeof _0x564989[_0xc320('0x24')]===_0xc320('0x23');var _0x70b5b2=_0x536f40[_0xc320('0x25')];var _0x3d605e=_0x417978?0x0:_0x564989['offset'];var _0xf1a1bb=_0x417978?_0x536f40[_0xc320('0x25')]:_0x564989[_0xc320('0x22')]+_0x564989[_0xc320('0x24')];var _0x36065a;if(_0xf1a1bb>=_0x70b5b2){_0xf1a1bb=_0x70b5b2;_0x36065a=0xc8;}else{_0x36065a=0xce;}_0x2a6e87[_0xc320('0x20')](_0x36065a);return _0x2a6e87[_0xc320('0x26')](_0xc320('0x27'),_0x3d605e+'-'+_0xf1a1bb+'/'+_0x70b5b2)['json'](_0x536f40);}return null;};}function saveUpdates(_0x24af1c){return function(_0x51fce4){if(_0x51fce4){return _0x51fce4[_0xc320('0x28')](_0x24af1c)[_0xc320('0x14')](function(_0x825362){return _0x825362;});}return null;};}function removeEntity(_0x4d55af){return function(_0x48782d){if(_0x48782d){return _0x48782d[_0xc320('0x29')]()[_0xc320('0x14')](function(){_0x4d55af[_0xc320('0x20')](0xcc)[_0xc320('0x2a')]();});}};}function handleEntityNotFound(_0x3744cf){return function(_0x58116f){if(!_0x58116f){_0x3744cf['sendStatus'](0x194);}return _0x58116f;};}function handleError(_0x2a7124,_0x313506){_0x313506=_0x313506||0x1f4;return function(_0x32aa99){logger[_0xc320('0x1b')](_0x32aa99[_0xc320('0x2b')]);if(_0x32aa99[_0xc320('0x2c')]){delete _0x32aa99[_0xc320('0x2c')];}_0x2a7124[_0xc320('0x20')](_0x313506)[_0xc320('0x2d')](_0x32aa99);};}exports[_0xc320('0x2e')]=function(_0x56b3a7,_0x4e67dd){var _0x34cde2={},_0x1f0a8b={},_0x4c7bba={'count':0x0,'rows':[]};var _0x21365b=_['map'](db[_0xc320('0x2f')][_0xc320('0x30')],function(_0x33bcb2){return{'name':_0x33bcb2[_0xc320('0x31')],'type':_0x33bcb2['type']['key']};});_0x1f0a8b[_0xc320('0x32')]=_['map'](_0x21365b,_0xc320('0x2c'));_0x1f0a8b[_0xc320('0x33')]=_[_0xc320('0x34')](_0x56b3a7[_0xc320('0x33')]);_0x1f0a8b[_0xc320('0x35')]=_[_0xc320('0x36')](_0x1f0a8b[_0xc320('0x32')],_0x1f0a8b[_0xc320('0x33')]);_0x34cde2[_0xc320('0x37')]=_['intersection'](_0x1f0a8b[_0xc320('0x32')],qs[_0xc320('0x38')](_0x56b3a7[_0xc320('0x33')][_0xc320('0x38')]));_0x34cde2['attributes']=_0x34cde2['attributes'][_0xc320('0x39')]?_0x34cde2[_0xc320('0x37')]:_0x1f0a8b['model'];if(!_0x56b3a7[_0xc320('0x33')]['hasOwnProperty'](_0xc320('0x3a'))){_0x34cde2[_0xc320('0x24')]=qs[_0xc320('0x24')](_0x56b3a7[_0xc320('0x33')]['limit']);_0x34cde2[_0xc320('0x22')]=qs[_0xc320('0x22')](_0x56b3a7[_0xc320('0x33')]['offset']);}_0x34cde2[_0xc320('0x3b')]=qs[_0xc320('0x3c')](_0x56b3a7['query'][_0xc320('0x3c')]);_0x34cde2[_0xc320('0x3d')]=qs[_0xc320('0x35')](_[_0xc320('0x3e')](_0x56b3a7['query'],_0x1f0a8b[_0xc320('0x35')]),_0x21365b);if(_0x56b3a7[_0xc320('0x33')][_0xc320('0x3f')]){_0x34cde2['where']=_['merge'](_0x34cde2[_0xc320('0x3d')],{'$or':_['map'](_0x21365b,function(_0x4f90a0){if(_0x4f90a0[_0xc320('0x40')]!==_0xc320('0x41')){var _0x38f55a={};_0x38f55a[_0x4f90a0[_0xc320('0x2c')]]={'$like':'%'+_0x56b3a7['query'][_0xc320('0x3f')]+'%'};return _0x38f55a;}})});}_0x34cde2=_[_0xc320('0x42')]({},_0x34cde2,_0x56b3a7[_0xc320('0x43')]);var _0x2f3f12={'where':_0x34cde2[_0xc320('0x3d')]};return db[_0xc320('0x2f')][_0xc320('0x25')](_0x2f3f12)[_0xc320('0x14')](function(_0x2c5305){_0x4c7bba[_0xc320('0x25')]=_0x2c5305;if(_0x56b3a7['query']['includeAll']){_0x34cde2[_0xc320('0x44')]=[{'all':!![]}];}return db[_0xc320('0x2f')][_0xc320('0x45')](_0x34cde2);})[_0xc320('0x14')](function(_0x3b31dd){_0x4c7bba[_0xc320('0x46')]=_0x3b31dd;return _0x4c7bba;})[_0xc320('0x14')](respondWithFilteredResult(_0x4e67dd,_0x34cde2))['catch'](handleError(_0x4e67dd,null));};exports[_0xc320('0x47')]=function(_0x13146a,_0x56763d){var _0x5ab27f={'raw':!![],'where':{'id':_0x13146a[_0xc320('0x48')]['id']}},_0x5bcf02={};_0x5bcf02[_0xc320('0x32')]=_[_0xc320('0x34')](db[_0xc320('0x2f')][_0xc320('0x30')]);_0x5bcf02[_0xc320('0x33')]=_[_0xc320('0x34')](_0x13146a[_0xc320('0x33')]);_0x5bcf02[_0xc320('0x35')]=_['intersection'](_0x5bcf02[_0xc320('0x32')],_0x5bcf02['query']);_0x5ab27f[_0xc320('0x37')]=_[_0xc320('0x36')](_0x5bcf02['model'],qs[_0xc320('0x38')](_0x13146a[_0xc320('0x33')][_0xc320('0x38')]));_0x5ab27f[_0xc320('0x37')]=_0x5ab27f[_0xc320('0x37')]['length']?_0x5ab27f['attributes']:_0x5bcf02[_0xc320('0x32')];if(_0x13146a['query'][_0xc320('0x49')]){_0x5ab27f[_0xc320('0x44')]=[{'all':!![]}];}_0x5ab27f=_[_0xc320('0x42')]({},_0x5ab27f,_0x13146a['options']);return db[_0xc320('0x2f')][_0xc320('0x4a')](_0x5ab27f)[_0xc320('0x14')](handleEntityNotFound(_0x56763d,null))['then'](respondWithResult(_0x56763d,null))[_0xc320('0x1f')](handleError(_0x56763d,null));};exports[_0xc320('0x28')]=function(_0x4c447e,_0x4391b3){if(_0x4c447e['body']['id']){delete _0x4c447e['body']['id'];}return db['MailMessage'][_0xc320('0x4a')]({'where':{'id':_0x4c447e[_0xc320('0x48')]['id']}})[_0xc320('0x14')](handleEntityNotFound(_0x4391b3,null))['then'](saveUpdates(_0x4c447e[_0xc320('0x4b')],null))['then'](respondWithResult(_0x4391b3,null))['catch'](handleError(_0x4391b3,null));};exports['destroy']=function(_0x3f56e9,_0x464790){return db[_0xc320('0x2f')]['find']({'where':{'id':_0x3f56e9[_0xc320('0x48')]['id']}})[_0xc320('0x14')](handleEntityNotFound(_0x464790,null))['then'](removeEntity(_0x464790,null))[_0xc320('0x1f')](handleError(_0x464790,null));};exports[_0xc320('0x4c')]=function(_0x4b71cb,_0x4737d9){return db[_0xc320('0x2f')][_0xc320('0x4c')]()['then'](respondWithResult(_0x4737d9,null))[_0xc320('0x1f')](handleError(_0x4737d9,null));};exports['create']=function(_0x146a83,_0x1cdd7f){return db['MailMessage'][_0xc320('0x4d')](_0x146a83[_0xc320('0x4b')])[_0xc320('0x14')](function(_0x225ee3){if(_0x225ee3){if(_0x225ee3[_0xc320('0x4e')]===_0xc320('0x4f')&&!_0x225ee3[_0xc320('0x50')]){var _0x1ebd6e,_0x336ca7,_0x130db6;if(_0x146a83['body']['to']){_0x336ca7=_0x146a83[_0xc320('0x4b')]['to']['split'](',')[0x0];}return db[_0xc320('0x51')][_0xc320('0x52')]({'where':{'id':_0x225ee3[_0xc320('0x53')]},'include':[{'model':db[_0xc320('0x54')],'as':'List','include':[{'model':db[_0xc320('0x55')],'as':_0xc320('0x56'),'where':{'email':_0x336ca7},'limit':0x1,'order':[[_0xc320('0x57'),_0xc320('0x58')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc320('0x59')],'as':_0xc320('0x59'),'raw':!![]}]}]})[_0xc320('0x14')](function(_0x2bc242){_0x1ebd6e=_0x2bc242;if(!_0x1ebd6e||!_0x1ebd6e[_0xc320('0x5a')])return;var _0x184d3b=_0x1ebd6e[_0xc320('0x5b')]();if(_0x146a83[_0xc320('0x4b')]['attachments']&&_0x146a83[_0xc320('0x4b')][_0xc320('0x5c')][_0xc320('0x39')]){for(var _0x4030ec=0x0;_0x4030ec<_0x146a83[_0xc320('0x4b')][_0xc320('0x5c')][_0xc320('0x39')];_0x4030ec+=0x1){_0x146a83[_0xc320('0x4b')][_0xc320('0x5c')][_0x4030ec]={'filename':_0x146a83[_0xc320('0x4b')]['attachments'][_0x4030ec][_0xc320('0x2c')],'path':path[_0xc320('0x5d')](config['root'],_0xc320('0x5e'),_0x146a83[_0xc320('0x4b')]['attachments'][_0x4030ec][_0xc320('0x5f')])};}}_0x130db6={'account':_0x184d3b,'message':_0x146a83[_0xc320('0x4b')]};return;})['then'](function(){if(_0x1ebd6e[_0xc320('0x60')]){if(_0x1ebd6e['List'][_0xc320('0x56')][_0xc320('0x39')]){return _0x1ebd6e['List']['Contacts'][0x0];}else{return db['CmContact'][_0xc320('0x4d')](_[_0xc320('0xc')](_0x146a83[_0xc320('0x4b')],{'firstName':_0x146a83[_0xc320('0x4b')]['to'],'email':_0x146a83[_0xc320('0x4b')]['to'],'phone':_0x146a83[_0xc320('0x4b')]['to'],'ListId':_0x1ebd6e[_0xc320('0x61')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xc320('0x14')](function(){if(_0x130db6){return respondWithRpcPromise(_0xc320('0x62'),_0xc320('0x63'),_0x130db6,client9003)[_0xc320('0x14')](function(_0x3df2cb){return _0x225ee3[_0xc320('0x28')]({'read':!![],'messageId':_0x3df2cb[_0xc320('0x64')],'sentAt':moment()[_0xc320('0x65')](_0xc320('0x66'))});})[_0xc320('0x1f')](function(_0x181609){logger[_0xc320('0x1b')]('%s',JSON['stringify'](_0x181609));return _0x225ee3;});}return _0x225ee3;});}return _0x225ee3;}})[_0xc320('0x14')](respondWithResult(_0x1cdd7f,0xc9))[_0xc320('0x1f')](handleError(_0x1cdd7f,null));};exports[_0xc320('0x67')]=function(_0x5982eb,_0x2aa58c){var _0xc55603={'agent':{},'channel':_0xc320('0x68')};if(_0x5982eb['body']['id']){delete _0x5982eb['body']['id'];}_0x5982eb[_0xc320('0x4b')][_0xc320('0x69')]=!![];_0x5982eb[_0xc320('0x4b')][_0xc320('0x6a')]=moment()[_0xc320('0x65')](_0xc320('0x66'));_0x5982eb['body'][_0xc320('0x6b')]=_0x5982eb[_0xc320('0x4b')][_0xc320('0x6b')]||_0x5982eb['user']['id'];_0xc55603['agent']['id']=_0x5982eb[_0xc320('0x4b')]['UserId'];return db[_0xc320('0x2f')][_0xc320('0x4a')]({'where':{'id':_0x5982eb[_0xc320('0x48')]['id'],'UserId':null}})[_0xc320('0x14')](handleEntityNotFound(_0x2aa58c,null))[_0xc320('0x14')](saveUpdates(_0x5982eb['body'],null))[_0xc320('0x14')](function(_0x7078a8){if(_0x7078a8){_0xc55603[_0xc320('0x1d')]=_0x7078a8[_0xc320('0x6c')]({'plain':!![]});return db[_0xc320('0x6d')][_0xc320('0x4a')]({'where':{'id':_0x7078a8[_0xc320('0x6e')]}});}return null;})[_0xc320('0x14')](handleEntityNotFound(_0x2aa58c,null))['then'](function(_0xc95b04){if(_0xc95b04){return _0xc95b04[_0xc320('0x28')]({'UserId':_0x5982eb[_0xc320('0x4b')][_0xc320('0x6b')],'read1stAt':_[_0xc320('0x6f')](_0xc95b04[_0xc320('0x70')])?moment()[_0xc320('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc320('0x14')](function(_0x5c618b){if(_0x5c618b){_0xc55603['interaction']=_0x5c618b[_0xc320('0x6c')]({'plain':!![]});interaction_log[_0xc320('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5982eb[_0xc320('0x71')]['id'],_0x5982eb['user'][_0xc320('0x2c')],_0x5982eb[_0xc320('0x71')][_0xc320('0x72')],_0xc55603[_0xc320('0x73')]['id'],_0x5982eb[_0xc320('0x4b')]?JSON[_0xc320('0x1a')](_0x5982eb['body']):_0xc320('0x74'));return respondWithRpcPromise('AcceptMessage',_0xc320('0x75'),_0xc55603);}return null;})[_0xc320('0x14')](function(_0x4e0509){var _0x115c50='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e0509[_0xc320('0x1d')][_0xc320('0x76')];return db[_0xc320('0x77')]['query'](_0x115c50,{'type':db[_0xc320('0x78')][_0xc320('0x79')][_0xc320('0x7a')],'raw':!![]})[_0xc320('0x14')](function(_0x255ebf){return _0x255ebf;});})[_0xc320('0x14')](function(_0x4f0f46){if(_0x4f0f46){_0xc55603[_0xc320('0x1d')]['contact']=_0x4f0f46[0x0];if(!_0x5982eb[_0xc320('0x4b')][_0xc320('0x6b')])return;return db[_0xc320('0x7b')][_0xc320('0x4a')]({'where':{'id':_0x5982eb[_0xc320('0x4b')][_0xc320('0x6b')],'role':'agent'},'attributes':['id',_0xc320('0x2c'),'fullname',_0xc320('0x7c'),'internal'],'raw':!![]});}return null;})[_0xc320('0x14')](function(_0x1b7826){if(!_0x1b7826)return null;_0xc55603[_0xc320('0x1d')][_0xc320('0x7d')]=_0x1b7826;return _0xc55603;})[_0xc320('0x14')](function(_0x351a6e){if(_0x351a6e){if(_0x5982eb[_0xc320('0x4b')][_0xc320('0x7e')]){_0xc55603[_0xc320('0x1d')][_0xc320('0x7f')]=util[_0xc320('0x65')](_0xc320('0x80'),_0x5982eb['user'][_0xc320('0x2c')]);_0xc55603['message'][_0xc320('0x81')]=_0xc55603['channel'];_0xc55603[_0xc320('0x1d')]['motionChannel']=_0xc55603['channel'];_0xc55603[_0xc320('0x1d')][_0xc320('0x82')]='accept';_0xc55603[_0xc320('0x1d')]['body']=htmlToText[_0xc320('0x83')](_0xc55603[_0xc320('0x1d')][_0xc320('0x4b')]);return respondWithRpcPromise('EventManager',_0xc320('0x84'),{'event':_0xc320('0x85'),'message':_0xc55603[_0xc320('0x1d')]},client9002)['then'](function(){return _0xc55603;});}return _0xc55603;}return null;})['then'](respondWithResult(_0x2aa58c,null))[_0xc320('0x1f')](handleError(_0x2aa58c,null));};exports[_0xc320('0x86')]=function(_0x55d7d4,_0x3056f8){var _0x13a5f3={'agent':{},'channel':_0xc320('0x68')};if(_0x55d7d4[_0xc320('0x4b')]['id']){delete _0x55d7d4['body']['id'];}_0x55d7d4[_0xc320('0x4b')][_0xc320('0x6b')]=_0x55d7d4[_0xc320('0x4b')][_0xc320('0x6b')]||_0x55d7d4[_0xc320('0x71')]['id'];_0x13a5f3[_0xc320('0x7d')]['id']=_0x55d7d4[_0xc320('0x4b')]['UserId'];return db[_0xc320('0x2f')][_0xc320('0x4a')]({'where':{'id':_0x55d7d4[_0xc320('0x48')]['id'],'UserId':null}})[_0xc320('0x14')](handleEntityNotFound(_0x3056f8,null))[_0xc320('0x14')](function(_0xc716b8){if(_0xc716b8){_0x13a5f3[_0xc320('0x1d')]=_0xc716b8['get']({'plain':!![]});return db[_0xc320('0x6d')][_0xc320('0x4a')]({'where':{'id':_0xc716b8['MailInteractionId']}});}return null;})[_0xc320('0x14')](handleEntityNotFound(_0x3056f8,null))[_0xc320('0x14')](function(_0x33aff4){if(_0x33aff4){_0x13a5f3[_0xc320('0x73')]=_0x33aff4[_0xc320('0x6c')]({'plain':!![]});interaction_log[_0xc320('0x15')](_0xc320('0x87'),_0x55d7d4[_0xc320('0x71')]['id'],_0x55d7d4[_0xc320('0x71')][_0xc320('0x2c')],_0x55d7d4[_0xc320('0x71')][_0xc320('0x72')],_0x13a5f3['interaction']['id'],_0x55d7d4[_0xc320('0x4b')]?JSON['stringify'](_0x55d7d4['body']):_0xc320('0x74'));return respondWithRpcPromise('RejectMessage',_0xc320('0x88'),_0x13a5f3);}return null;})[_0xc320('0x14')](function(_0x5448e5){var _0x1a8b83=_0xc320('0x89')+_0x5448e5[_0xc320('0x1d')]['ContactId'];return db['sequelize'][_0xc320('0x33')](_0x1a8b83,{'type':db[_0xc320('0x78')][_0xc320('0x79')][_0xc320('0x7a')],'raw':!![]})[_0xc320('0x14')](function(_0x37df2c){return _0x37df2c;});})[_0xc320('0x14')](function(_0x34408a){if(_0x34408a){_0x13a5f3[_0xc320('0x1d')]['contact']=_0x34408a[0x0];if(!_0x55d7d4[_0xc320('0x4b')][_0xc320('0x6b')])return;return db[_0xc320('0x7b')][_0xc320('0x4a')]({'where':{'id':_0x55d7d4[_0xc320('0x4b')][_0xc320('0x6b')],'role':'agent'},'attributes':['id',_0xc320('0x2c'),_0xc320('0x8a'),_0xc320('0x7c'),_0xc320('0x8b')],'raw':!![]});}return null;})[_0xc320('0x14')](function(_0x5890b7){if(!_0x5890b7)return null;_0x13a5f3[_0xc320('0x1d')][_0xc320('0x7d')]=_0x5890b7;return _0x13a5f3;})[_0xc320('0x14')](function(_0x927040){if(_0x927040){_0x927040[_0xc320('0x1d')]['interface']=util[_0xc320('0x65')](_0xc320('0x80'),_0x55d7d4[_0xc320('0x71')][_0xc320('0x2c')]);_0x927040[_0xc320('0x1d')][_0xc320('0x81')]=_0x13a5f3[_0xc320('0x81')];_0x927040[_0xc320('0x1d')][_0xc320('0x8c')]=_0x13a5f3[_0xc320('0x81')];_0x927040['message'][_0xc320('0x82')]=_0xc320('0x86');_0x927040[_0xc320('0x1d')]['body']=htmlToText[_0xc320('0x83')](_0x13a5f3['message'][_0xc320('0x4b')]);respondWithRpcPromise('EventManager',_0xc320('0x84'),{'event':_0xc320('0x8d'),'message':_0x927040['message']},client9002);return _0x13a5f3;}return null;})[_0xc320('0x14')](respondWithResult(_0x3056f8,null))[_0xc320('0x1f')](handleError(_0x3056f8,null));};exports[_0xc320('0x8e')]=function(_0x5a3067,_0x5d930d){var _0x5990bc=moment()[_0xc320('0x8f')]()[_0xc320('0x90')]();var _0x3793e1=path[_0xc320('0x5d')](config['root'],_0xc320('0x91'),_0xc320('0x92'),_0xc320('0x93'));var _0xf0b52a=path[_0xc320('0x5d')](config['root'],_0xc320('0x91'),_0xc320('0x92'),_0xc320('0x5c'));var _0x22c72c=util[_0xc320('0x65')]('message-%s.eml',_0x5990bc);return db[_0xc320('0x2f')][_0xc320('0x4a')]({'where':{'id':_0x5a3067[_0xc320('0x48')]['id']},'attributes':['id','body',_0xc320('0x94'),'to','cc',_0xc320('0x95'),'subject',_0xc320('0x96')],'include':_0x5a3067['query'][_0xc320('0x5c')]?[{'model':db[_0xc320('0x97')],'as':'Attachments'}]:undefined})[_0xc320('0x14')](handleEntityNotFound(_0x5d930d,null))[_0xc320('0x14')](function(_0x3f592d){if(_0x3f592d){var _0x587cb7=_0x3f592d;var _0x2e3f7f={'from':_0x587cb7[_0xc320('0x94')],'to':_0x587cb7['to'],'subject':_0x587cb7['subject'],'html':htmlEntities[_0xc320('0x98')](_0x587cb7[_0xc320('0x4b')]),'headers':{'Date':moment(_0x587cb7[_0xc320('0x96')])[_0xc320('0x65')](_0xc320('0x99'))},'attachments':[]};if(_0x3f592d['cc']){_0x2e3f7f[_0xc320('0x9a')]['Cc']=_0x3f592d['cc'];}if(_0x3f592d[_0xc320('0x95')]){_0x2e3f7f['headers'][_0xc320('0x9b')]=_0x3f592d['bcc'];}return new BPromise(function(_0x50bc3c,_0xf4e829){if(_0x3f592d[_0xc320('0x9c')]){for(var _0x5a4693=0x0;_0x5a4693<_0x3f592d[_0xc320('0x9c')]['length'];_0x5a4693++){var _0x26aeec=_0x3f592d[_0xc320('0x9c')][_0x5a4693];var _0x5bf614=path['join'](_0xf0b52a,_0x26aeec[_0xc320('0x5f')]);if(fs[_0xc320('0x9d')](_0x5bf614)){_0x2e3f7f[_0xc320('0x5c')]['push']({'name':_0x26aeec[_0xc320('0x2c')],'contentType':_0x26aeec['type'],'data':fs[_0xc320('0x9e')](_0x5bf614)});}}}emlformat[_0xc320('0x9f')](_0x2e3f7f,function(_0x9f9141,_0x4c44f9){if(_0x9f9141)return _0xf4e829(_0x9f9141);fs[_0xc320('0xa0')](path['join'](_0x3793e1,_0x22c72c),_0x4c44f9);return _0x50bc3c(_0x4c44f9);});});}})[_0xc320('0x14')](function(_0x2d250d){if(_0x2d250d){return _0x5d930d['download'](path[_0xc320('0x5d')](_0x3793e1,_0x22c72c),_0x22c72c,function(_0x3a8a3c){if(!_0x3a8a3c)fs['unlinkSync'](path[_0xc320('0x5d')](_0x3793e1,_0x22c72c));});}})['catch'](handleError(_0x5d930d,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 5698819..c542fbb 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 _0x0496=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove'];(function(_0x4e6ba5,_0x4ccf17){var _0x41122b=function(_0x3fec38){while(--_0x3fec38){_0x4e6ba5['push'](_0x4e6ba5['shift']());}};_0x41122b(++_0x4ccf17);}(_0x0496,0x144));var _0x6049=function(_0x24d3d3,_0x58fd1e){_0x24d3d3=_0x24d3d3-0x0;var _0x32b481=_0x0496[_0x24d3d3];return _0x32b481;};'use strict';var EventEmitter=require(_0x6049('0x0'));var MailMessage=require(_0x6049('0x1'))['db'][_0x6049('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6049('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6049('0x4'),'afterDestroy':_0x6049('0x5')};function emitEvent(_0xe9a0ac){return function(_0xd93eac,_0x3fba57,_0x74e02c){MailMessageEvents[_0x6049('0x6')](_0xe9a0ac+':'+_0xd93eac['id'],_0xd93eac);MailMessageEvents[_0x6049('0x6')](_0xe9a0ac,_0xd93eac);_0x74e02c(null);};}for(var e in events){if(events[_0x6049('0x7')](e)){var event=events[e];MailMessage[_0x6049('0x8')](e,emitEvent(event));}}module[_0x6049('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x637d=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','save','update','remove'];(function(_0x17e492,_0x7353de){var _0x16f676=function(_0x2feb6e){while(--_0x2feb6e){_0x17e492['push'](_0x17e492['shift']());}};_0x16f676(++_0x7353de);}(_0x637d,0x8b));var _0xd637=function(_0x2525ae,_0x5519aa){_0x2525ae=_0x2525ae-0x0;var _0x50093e=_0x637d[_0x2525ae];return _0x50093e;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xd637('0x0'))['db'][_0xd637('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd637('0x2'),'afterUpdate':_0xd637('0x3'),'afterDestroy':_0xd637('0x4')};function emitEvent(_0x34ebe7){return function(_0x3ec977,_0x3b1199,_0x5bdd82){MailMessageEvents[_0xd637('0x5')](_0x34ebe7+':'+_0x3ec977['id'],_0x3ec977);MailMessageEvents[_0xd637('0x5')](_0x34ebe7,_0x3ec977);_0x5bdd82(null);};}for(var e in events){if(events[_0xd637('0x6')](e)){var event=events[e];MailMessage[_0xd637('0x7')](e,emitEvent(event));}}module[_0xd637('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 519d110..d9b8af7 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 _0x3833=['MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','get','direction','toLowerCase','secret','isNil','UserId'];(function(_0x298191,_0x377c2f){var _0x240d8f=function(_0x32ff4c){while(--_0x32ff4c){_0x298191['push'](_0x298191['shift']());}};_0x240d8f(++_0x377c2f);}(_0x3833,0x194));var _0x3383=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x3833[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0x3383('0x0'));var util=require(_0x3383('0x1'));var logger=require(_0x3383('0x2'))('api');var moment=require(_0x3383('0x3'));var BPromise=require(_0x3383('0x4'));var rp=require(_0x3383('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x3383('0x6'));var rimraf=require(_0x3383('0x7'));var config=require(_0x3383('0x8'));var attributes=require('./mailMessage.attributes');module[_0x3383('0x9')]=function(_0x37b222,_0x399534){return _0x37b222['define'](_0x3383('0xa'),attributes,{'tableName':_0x3383('0xb'),'paranoid':![],'indexes':[{'name':_0x3383('0xc'),'fields':[_0x3383('0xc')]},{'name':_0x3383('0xd'),'fields':[_0x3383('0xe'),_0x3383('0xf')],'type':_0x3383('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x548e78,_0xcf6039,_0x1dcc15){if(_0x548e78[_0x3383('0x11')]){_0x548e78[_0x3383('0xe')]=htmlToText[_0x3383('0x12')](_0x548e78[_0x3383('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1dcc15(null,_0xcf6039);},'afterCreate':function(_0x40771b,_0x12c744,_0x9e32d7){var _0x4ece50=_0x37b222['models'];var _0x20f64d=_0x40771b[_0x3383('0x13')]({'plain':!![]});if(_0x20f64d[_0x3383('0x14')][_0x3383('0x15')]()==='in'||_0x20f64d[_0x3383('0x14')]['toLowerCase']()==='out'&&!_0x20f64d[_0x3383('0x16')]&&!_[_0x3383('0x17')](_0x20f64d[_0x3383('0x18')])){_0x4ece50[_0x3383('0x19')][_0x3383('0x1a')]({'where':{'id':_0x20f64d[_0x3383('0x1b')]}})[_0x3383('0x1c')](function(_0x42e68c){if(_0x42e68c){_0x42e68c[_0x3383('0x1d')]({'lastMsgAt':_0x20f64d[_0x3383('0x1e')],'lastMsgDirection':_0x20f64d['direction'][_0x3383('0x15')]()});}})[_0x3383('0x1f')](function(_0xdf73ab){console[_0x3383('0x20')](_0xdf73ab);});}_0x9e32d7();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5a28=['util','../../config/logger','api','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','FULLTEXT','body','plainBody','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','update','createdAt','error','utf8mb4'];(function(_0x129d52,_0x1beadf){var _0x79ef89=function(_0x4913bb){while(--_0x4913bb){_0x129d52['push'](_0x129d52['shift']());}};_0x79ef89(++_0x1beadf);}(_0x5a28,0xa0));var _0x85a2=function(_0x15fb19,_0x3f9d71){_0x15fb19=_0x15fb19-0x0;var _0x5b1b67=_0x5a28[_0x15fb19];return _0x5b1b67;};'use strict';var _=require('lodash');var util=require(_0x85a2('0x0'));var logger=require(_0x85a2('0x1'))(_0x85a2('0x2'));var moment=require('moment');var BPromise=require(_0x85a2('0x3'));var rp=require(_0x85a2('0x4'));var htmlToText=require(_0x85a2('0x5'));var fs=require('fs');var path=require(_0x85a2('0x6'));var rimraf=require('rimraf');var config=require(_0x85a2('0x7'));var attributes=require(_0x85a2('0x8'));module[_0x85a2('0x9')]=function(_0x38d689,_0x327126){return _0x38d689[_0x85a2('0xa')](_0x85a2('0xb'),attributes,{'tableName':_0x85a2('0xc'),'paranoid':![],'indexes':[{'name':_0x85a2('0xd'),'fields':[_0x85a2('0xd')]},{'name':'fti_mail_messages','fields':['plainBody','subject'],'type':_0x85a2('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x103703,_0x572b0f,_0x372fe1){if(_0x103703[_0x85a2('0xf')]){_0x103703[_0x85a2('0x10')]=htmlToText[_0x85a2('0x11')](_0x103703['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x372fe1(null,_0x572b0f);},'afterCreate':function(_0x146cba,_0x458197,_0x2ae142){var _0x5eed5d=_0x38d689[_0x85a2('0x12')];var _0x1b85ef=_0x146cba[_0x85a2('0x13')]({'plain':!![]});if(_0x1b85ef[_0x85a2('0x14')][_0x85a2('0x15')]()==='in'||_0x1b85ef[_0x85a2('0x14')][_0x85a2('0x15')]()===_0x85a2('0x16')&&!_0x1b85ef[_0x85a2('0x17')]&&!_[_0x85a2('0x18')](_0x1b85ef['UserId'])){_0x5eed5d[_0x85a2('0x19')][_0x85a2('0x1a')]({'where':{'id':_0x1b85ef[_0x85a2('0x1b')]}})['then'](function(_0x509526){if(_0x509526){_0x509526[_0x85a2('0x1c')]({'lastMsgAt':_0x1b85ef[_0x85a2('0x1d')],'lastMsgDirection':_0x1b85ef[_0x85a2('0x14')][_0x85a2('0x15')]()});}})['catch'](function(_0x380064){console[_0x85a2('0x1e')](_0x380064);});}_0x2ae142();}},'charset':_0x85a2('0x1f'),'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 58a3003..09c059d 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 _0xb44a=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0x3942a6,_0x221d39){var _0x369d50=function(_0x433ab5){while(--_0x433ab5){_0x3942a6['push'](_0x3942a6['shift']());}};_0x369d50(++_0x221d39);}(_0xb44a,0x1c2));var _0xab44=function(_0x364471,_0x302e8a){_0x364471=_0x364471-0x0;var _0x59236f=_0xb44a[_0x364471];return _0x59236f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});config[_0xab44('0x8')]=_[_0xab44('0x9')](config[_0xab44('0x8')],{'host':_0xab44('0xa'),'port':0x18eb});var socket=require(_0xab44('0xb'))(new Redis(config[_0xab44('0x8')]));require(_0xab44('0xc'))[_0xab44('0xd')](socket);function respondWithRpcPromise(_0x55c7d2,_0x2a670e,_0x500a9f){return new BPromise(function(_0x15e64e,_0x5168fa){return client['request'](_0x55c7d2,_0x500a9f)[_0xab44('0xe')](function(_0x6746cc){logger[_0xab44('0xf')](_0xab44('0x10'),_0x2a670e,_0xab44('0x11'));logger[_0xab44('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2a670e,'request\x20sent',JSON[_0xab44('0x13')](_0x6746cc));if(_0x6746cc['error']){if(_0x6746cc[_0xab44('0x14')]['code']===0x1f4){logger[_0xab44('0x14')](_0xab44('0x10'),_0x2a670e,_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);return _0x5168fa(_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2a670e,_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);return _0x15e64e(_0x6746cc[_0xab44('0x14')][_0xab44('0x15')]);}else{logger[_0xab44('0xf')](_0xab44('0x10'),_0x2a670e,_0xab44('0x11'));_0x15e64e(_0x6746cc[_0xab44('0x16')][_0xab44('0x15')]);}})[_0xab44('0x17')](function(_0x27fc7f){logger['error'](_0xab44('0x10'),_0x2a670e,_0x27fc7f);_0x5168fa(_0x27fc7f);});});}exports[_0xab44('0x18')]=function(_0x101a1b){var _0x2902ca=this;return new Promise(function(_0x29bb73,_0x5123b1){return db[_0xab44('0x19')]['create'](_0x101a1b[_0xab44('0x1a')],{'raw':_0x101a1b[_0xab44('0x1b')]?_0x101a1b[_0xab44('0x1b')][_0xab44('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3a2b1d){logger[_0xab44('0xf')](_0xab44('0x18'),_0x101a1b);logger[_0xab44('0x12')](_0xab44('0x18'),_0x101a1b,JSON[_0xab44('0x13')](_0x3a2b1d));_0x29bb73(_0x3a2b1d);})[_0xab44('0x17')](function(_0x554955){logger['error'](_0xab44('0x18'),_0x554955['message'],_0x101a1b);_0x5123b1(_0x2902ca[_0xab44('0x14')](0x1f4,_0x554955['message']));});});}; \ No newline at end of file +var _0x6d11=['options','raw','CreateMailMessage','debug','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage','create','body'];(function(_0x5143c5,_0x5a688e){var _0x157214=function(_0x5e9e53){while(--_0x5e9e53){_0x5143c5['push'](_0x5143c5['shift']());}};_0x157214(++_0x5a688e);}(_0x6d11,0xbf));var _0x16d1=function(_0x409d62,_0x41507c){_0x409d62=_0x409d62-0x0;var _0x2e2d31=_0x6d11[_0x409d62];return _0x2e2d31;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});config[_0x16d1('0xa')]=_[_0x16d1('0xb')](config[_0x16d1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x16d1('0xc'))[_0x16d1('0xd')](socket);function respondWithRpcPromise(_0xe67758,_0x5a6abb,_0x4b7d4f){return new BPromise(function(_0x265a84,_0x2c360f){return client[_0x16d1('0xe')](_0xe67758,_0x4b7d4f)[_0x16d1('0xf')](function(_0x28188f){logger[_0x16d1('0x10')](_0x16d1('0x11'),_0x5a6abb,_0x16d1('0x12'));logger['debug'](_0x16d1('0x13'),_0x5a6abb,_0x16d1('0x12'),JSON[_0x16d1('0x14')](_0x28188f));if(_0x28188f[_0x16d1('0x15')]){if(_0x28188f[_0x16d1('0x15')]['code']===0x1f4){logger[_0x16d1('0x15')](_0x16d1('0x11'),_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x2c360f(_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);}logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x28188f[_0x16d1('0x15')][_0x16d1('0x16')]);return _0x265a84(_0x28188f['error']['message']);}else{logger[_0x16d1('0x10')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x16d1('0x12'));_0x265a84(_0x28188f['result'][_0x16d1('0x16')]);}})['catch'](function(_0x30f694){logger[_0x16d1('0x15')]('MailMessage,\x20%s,\x20%s',_0x5a6abb,_0x30f694);_0x2c360f(_0x30f694);});});}exports['CreateMailMessage']=function(_0x52a0f2){var _0x5b9599=this;return new Promise(function(_0x348425,_0x55a0e0){return db[_0x16d1('0x17')][_0x16d1('0x18')](_0x52a0f2[_0x16d1('0x19')],{'raw':_0x52a0f2[_0x16d1('0x1a')]?_0x52a0f2['options'][_0x16d1('0x1b')]===undefined?!![]:![]:!![]})[_0x16d1('0xf')](function(_0x2a897d){logger['info'](_0x16d1('0x1c'),_0x52a0f2);logger[_0x16d1('0x1d')](_0x16d1('0x1c'),_0x52a0f2,JSON[_0x16d1('0x14')](_0x2a897d));_0x348425(_0x2a897d);})[_0x16d1('0x1e')](function(_0x1448b7){logger[_0x16d1('0x15')](_0x16d1('0x1c'),_0x1448b7[_0x16d1('0x16')],_0x52a0f2);_0x55a0e0(_0x5b9599[_0x16d1('0x15')](0x1f4,_0x1448b7[_0x16d1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 000c205..832b60f 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 _0xf5ab=['emit','removeListener','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xf5ab,0x16c));var _0xbf5a=function(_0x4702f0,_0x5b1db1){_0x4702f0=_0x4702f0-0x0;var _0x2a3336=_0xf5ab[_0x4702f0];return _0x2a3336;};'use strict';var MailMessageEvents=require(_0xbf5a('0x0'));var events=[_0xbf5a('0x1'),_0xbf5a('0x2'),_0xbf5a('0x3')];function createListener(_0x1c697f,_0xf16d20){return function(_0x5b4121){_0xf16d20[_0xbf5a('0x4')](_0x1c697f,_0x5b4121);};}function removeListener(_0x16a8a3,_0x3c5401){return function(){MailMessageEvents[_0xbf5a('0x5')](_0x16a8a3,_0x3c5401);};}exports['register']=function(_0x45334f){for(var _0x152549=0x0,_0xbb19db=events[_0xbf5a('0x6')];_0x152549<_0xbb19db;_0x152549++){var _0x37dd78=events[_0x152549];var _0xa7d86a=createListener(_0xbf5a('0x7')+_0x37dd78,_0x45334f);MailMessageEvents['on'](_0x37dd78,_0xa7d86a);}}; \ No newline at end of file +var _0x2242=['register','length','mailMessage:','./mailMessage.events','save','remove','emit','removeListener'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x2242,0x1a3));var _0x2224=function(_0x5b0742,_0x26263d){_0x5b0742=_0x5b0742-0x0;var _0x515d00=_0x2242[_0x5b0742];return _0x515d00;};'use strict';var MailMessageEvents=require(_0x2224('0x0'));var events=[_0x2224('0x1'),_0x2224('0x2'),'update'];function createListener(_0x3180c8,_0x317565){return function(_0x4acc10){_0x317565[_0x2224('0x3')](_0x3180c8,_0x4acc10);};}function removeListener(_0xb65b2f,_0x4b2099){return function(){MailMessageEvents[_0x2224('0x4')](_0xb65b2f,_0x4b2099);};}exports[_0x2224('0x5')]=function(_0x23a873){for(var _0x54d057=0x0,_0x28833b=events[_0x2224('0x6')];_0x54d057<_0x28833b;_0x54d057++){var _0x35f807=events[_0x54d057];var _0x25c6d4=createListener(_0x2224('0x7')+_0x35f807,_0x23a873);MailMessageEvents['on'](_0x35f807,_0x25c6d4);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 2643bc3..a75f84d 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 _0x282e=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','multer'];(function(_0x3500fe,_0xfe9e5f){var _0x45cd33=function(_0xa7acad){while(--_0xa7acad){_0x3500fe['push'](_0x3500fe['shift']());}};_0x45cd33(++_0xfe9e5f);}(_0x282e,0xfb));var _0xe282=function(_0x5c1b03,_0x3e8077){_0x5c1b03=_0x5c1b03-0x0;var _0x53706b=_0x282e[_0x5c1b03];return _0x53706b;};'use strict';var multer=require(_0xe282('0x0'));var util=require(_0xe282('0x1'));var path=require(_0xe282('0x2'));var timeout=require('connect-timeout');var express=require(_0xe282('0x3'));var router=express['Router']();var fs_extra=require(_0xe282('0x4'));var auth=require(_0xe282('0x5'));var interaction=require(_0xe282('0x6'));var config=require(_0xe282('0x7'));var controller=require(_0xe282('0x8'));router[_0xe282('0x9')]('/',auth[_0xe282('0xa')](),controller[_0xe282('0xb')]);router['get'](_0xe282('0xc'),auth[_0xe282('0xa')](),controller[_0xe282('0xd')]);router['get'](_0xe282('0xe'),auth[_0xe282('0xa')](),controller[_0xe282('0xf')]);router[_0xe282('0x9')](_0xe282('0x10'),auth[_0xe282('0xa')](),controller[_0xe282('0x11')]);router[_0xe282('0x9')](_0xe282('0x12'),auth[_0xe282('0xa')](),controller[_0xe282('0x13')]);router[_0xe282('0x9')](_0xe282('0x14'),auth[_0xe282('0xa')](),controller['getAgents']);router[_0xe282('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe282('0x15')]('/:id/teams',auth[_0xe282('0xa')](),controller[_0xe282('0x16')]);router['post'](_0xe282('0x14'),auth[_0xe282('0xa')](),controller[_0xe282('0x17')]);router[_0xe282('0x18')]('/:id',auth[_0xe282('0xa')](),controller[_0xe282('0x19')]);router[_0xe282('0x1a')](_0xe282('0xe'),auth[_0xe282('0xa')](),controller[_0xe282('0x1b')]);router[_0xe282('0x1a')](_0xe282('0x12'),auth[_0xe282('0xa')](),controller['removeTeams']);router['delete'](_0xe282('0x14'),auth[_0xe282('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd1e1=['../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x1dcb4d,_0x158910){var _0x18bc70=function(_0x5a8c8a){while(--_0x5a8c8a){_0x1dcb4d['push'](_0x1dcb4d['shift']());}};_0x18bc70(++_0x158910);}(_0xd1e1,0xbe));var _0x1d1e=function(_0x4e45dd,_0x11c489){_0x4e45dd=_0x4e45dd-0x0;var _0x55f014=_0xd1e1[_0x4e45dd];return _0x55f014;};'use strict';var multer=require(_0x1d1e('0x0'));var util=require(_0x1d1e('0x1'));var path=require(_0x1d1e('0x2'));var timeout=require(_0x1d1e('0x3'));var express=require(_0x1d1e('0x4'));var router=express[_0x1d1e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1d1e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d1e('0x7'));var controller=require('./mailQueue.controller');router[_0x1d1e('0x8')]('/',auth[_0x1d1e('0x9')](),controller['index']);router['get'](_0x1d1e('0xa'),auth[_0x1d1e('0x9')](),controller['describe']);router[_0x1d1e('0x8')]('/:id',auth[_0x1d1e('0x9')](),controller[_0x1d1e('0xb')]);router['get'](_0x1d1e('0xc'),auth['isAuthenticated'](),controller[_0x1d1e('0xd')]);router[_0x1d1e('0x8')]('/:id/teams',auth[_0x1d1e('0x9')](),controller[_0x1d1e('0xe')]);router[_0x1d1e('0x8')](_0x1d1e('0xf'),auth[_0x1d1e('0x9')](),controller[_0x1d1e('0x10')]);router[_0x1d1e('0x11')]('/',auth[_0x1d1e('0x9')](),controller[_0x1d1e('0x12')]);router[_0x1d1e('0x11')](_0x1d1e('0x13'),auth['isAuthenticated'](),controller[_0x1d1e('0x14')]);router[_0x1d1e('0x11')](_0x1d1e('0xf'),auth[_0x1d1e('0x9')](),controller[_0x1d1e('0x15')]);router[_0x1d1e('0x16')](_0x1d1e('0x17'),auth[_0x1d1e('0x9')](),controller['update']);router[_0x1d1e('0x18')](_0x1d1e('0x17'),auth[_0x1d1e('0x9')](),controller[_0x1d1e('0x19')]);router[_0x1d1e('0x18')](_0x1d1e('0x13'),auth[_0x1d1e('0x9')](),controller[_0x1d1e('0x1a')]);router[_0x1d1e('0x18')](_0x1d1e('0xf'),auth[_0x1d1e('0x9')](),controller[_0x1d1e('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 117a382..248059a 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 _0x79dc=['name','INTEGER','ENUM','rrmemory','beepall','STRING'];(function(_0x3fa251,_0x5defbf){var _0x569854=function(_0x25a74a){while(--_0x25a74a){_0x3fa251['push'](_0x3fa251['shift']());}};_0x569854(++_0x5defbf);}(_0x79dc,0x143));var _0xc79d=function(_0x51005b,_0x1c04b3){_0x51005b=_0x51005b-0x0;var _0x2cd9b7=_0x79dc[_0x51005b];return _0x2cd9b7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc79d('0x0')],'unique':_0xc79d('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc79d('0x0')]},'timeout':{'type':Sequelize[_0xc79d('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc79d('0x3')](_0xc79d('0x4'),_0xc79d('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x0ccc=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x325c80,_0x5f0357){var _0x1e13e3=function(_0x4a422a){while(--_0x4a422a){_0x325c80['push'](_0x325c80['shift']());}};_0x1e13e3(++_0x5f0357);}(_0x0ccc,0xcb));var _0xc0cc=function(_0xc0cec0,_0x2aa508){_0xc0cec0=_0xc0cec0-0x0;var _0x46949d=_0x0ccc[_0xc0cec0];return _0x46949d;};'use strict';var Sequelize=require(_0xc0cc('0x0'));module[_0xc0cc('0x1')]={'name':{'type':Sequelize[_0xc0cc('0x2')],'unique':_0xc0cc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc0cc('0x2')]},'timeout':{'type':Sequelize[_0xc0cc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc0cc('0x5')](_0xc0cc('0x6'),_0xc0cc('0x7'),_0xc0cc('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 50db77c..e594333 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 _0xe85b=['includeAll','merge','options','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','offset','sort','where','pick','MailQueueId','filter','map','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','updatedAt','getTeams','Team','order','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','hasOwnProperty','bluebird','squel','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','undefined','limit','count','status','Content-Range','json','update','then','get','MailQueues','UserProfileResource','destroy','error','name','send','index','MailQueue','rawAttributes','fieldName','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe85b,0x12e));var _0xbe85=function(_0x164c6e,_0x25abdb){_0x164c6e=_0x164c6e-0x0;var _0xe3731a=_0xe85b[_0x164c6e];return _0xe3731a;};'use strict';var BPromise=require(_0xbe85('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xbe85('0x1'));var Redis=require(_0xbe85('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xbe85('0x3'))('api');var config=require(_0xbe85('0x4'));var db=require(_0xbe85('0x5'))['db'];config['redis']=_['defaults'](config[_0xbe85('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe85('0x7'))(new Redis(config['redis']));require(_0xbe85('0x8'))[_0xbe85('0x9')](socket);function respondWithStatusCode(_0x4bd753,_0x4b7aec){_0x4b7aec=_0x4b7aec||0xcc;return function(_0x11e591){if(_0x11e591){return _0x4bd753[_0xbe85('0xa')](_0x4b7aec);}return _0x4bd753['status'](_0x4b7aec)[_0xbe85('0xb')]();};}function respondWithResult(_0x6a393e,_0x34abac){_0x34abac=_0x34abac||0xc8;return function(_0x400e19){if(_0x400e19){return _0x6a393e['status'](_0x34abac)['json'](_0x400e19);}};}function respondWithFilteredResult(_0x2cd7cf,_0xb8705){return function(_0x5a8812){if(_0x5a8812){var _0xacbb73=typeof _0xb8705['offset']===_0xbe85('0xc')&&typeof _0xb8705[_0xbe85('0xd')]===_0xbe85('0xc');var _0x55643e=_0x5a8812[_0xbe85('0xe')];var _0x211d84=_0xacbb73?0x0:_0xb8705['offset'];var _0x3b04e4=_0xacbb73?_0x5a8812[_0xbe85('0xe')]:_0xb8705['offset']+_0xb8705['limit'];var _0x3ed526;if(_0x3b04e4>=_0x55643e){_0x3b04e4=_0x55643e;_0x3ed526=0xc8;}else{_0x3ed526=0xce;}_0x2cd7cf[_0xbe85('0xf')](_0x3ed526);return _0x2cd7cf['set'](_0xbe85('0x10'),_0x211d84+'-'+_0x3b04e4+'/'+_0x55643e)[_0xbe85('0x11')](_0x5a8812);}return null;};}function saveUpdates(_0x2bfa50){return function(_0x4a882c){if(_0x4a882c){return _0x4a882c[_0xbe85('0x12')](_0x2bfa50)[_0xbe85('0x13')](function(_0x7ef68b){return _0x7ef68b;});}return null;};}function removeEntity(_0x5a2379){return function(_0x2188c3){if(_0x2188c3){return _0x2188c3['destroy']()[_0xbe85('0x13')](function(){var _0x10ddfa=_0x2188c3[_0xbe85('0x14')]({'plain':!![]});var _0x540cce=_0xbe85('0x15');return db[_0xbe85('0x16')][_0xbe85('0x17')]({'where':{'type':_0x540cce,'resourceId':_0x10ddfa['id']}})[_0xbe85('0x13')](function(){return _0x2188c3;});})[_0xbe85('0x13')](function(){_0x5a2379['status'](0xcc)[_0xbe85('0xb')]();});}};}function handleEntityNotFound(_0x262ba0){return function(_0x3a2f00){if(!_0x3a2f00){_0x262ba0['sendStatus'](0x194);}return _0x3a2f00;};}function handleError(_0x2148c5,_0x777e12){_0x777e12=_0x777e12||0x1f4;return function(_0x5385f9){logger[_0xbe85('0x18')](_0x5385f9['stack']);if(_0x5385f9[_0xbe85('0x19')]){delete _0x5385f9[_0xbe85('0x19')];}_0x2148c5[_0xbe85('0xf')](_0x777e12)[_0xbe85('0x1a')](_0x5385f9);};}exports[_0xbe85('0x1b')]=function(_0x2c0a88,_0x32d837){var _0x481065={};var _0x56fd11={'count':0x0,'rows':[]};var _0x45e118=_['map'](db[_0xbe85('0x1c')][_0xbe85('0x1d')],function(_0x64e4af){return{'name':_0x64e4af[_0xbe85('0x1e')],'type':_0x64e4af['type']['key']};});_0x481065=qs['getOptions'](_0x45e118,_0x2c0a88);var _0x362a74={'where':_0x481065['where']};return db[_0xbe85('0x1c')][_0xbe85('0xe')](_0x362a74)['then'](function(_0x2e84ae){_0x56fd11[_0xbe85('0xe')]=_0x2e84ae;_0x481065[_0xbe85('0x1f')]=qs[_0xbe85('0x1f')](_0x2c0a88[_0xbe85('0x20')]);return db[_0xbe85('0x1c')][_0xbe85('0x21')](_0x481065);})[_0xbe85('0x13')](function(_0xf27de6){_0x56fd11[_0xbe85('0x22')]=_0xf27de6;return _0x56fd11;})[_0xbe85('0x13')](respondWithFilteredResult(_0x32d837,_0x481065))[_0xbe85('0x23')](handleError(_0x32d837,null));};exports['show']=function(_0x5c3ab4,_0x311840){var _0x30d462={'raw':!![],'where':{'id':_0x5c3ab4[_0xbe85('0x24')]['id']}},_0x2f6df6={};_0x2f6df6[_0xbe85('0x25')]=_[_0xbe85('0x26')](db['MailQueue'][_0xbe85('0x1d')]);_0x2f6df6[_0xbe85('0x20')]=_[_0xbe85('0x26')](_0x5c3ab4[_0xbe85('0x20')]);_0x2f6df6[_0xbe85('0x27')]=_[_0xbe85('0x28')](_0x2f6df6[_0xbe85('0x25')],_0x2f6df6['query']);_0x30d462[_0xbe85('0x29')]=_[_0xbe85('0x28')](_0x2f6df6[_0xbe85('0x25')],qs[_0xbe85('0x2a')](_0x5c3ab4['query'][_0xbe85('0x2a')]));_0x30d462['attributes']=_0x30d462[_0xbe85('0x29')]['length']?_0x30d462[_0xbe85('0x29')]:_0x2f6df6['model'];if(_0x5c3ab4['query'][_0xbe85('0x2b')]){_0x30d462[_0xbe85('0x1f')]=[{'all':!![]}];}_0x30d462=_[_0xbe85('0x2c')]({},_0x30d462,_0x5c3ab4[_0xbe85('0x2d')]);return db[_0xbe85('0x1c')][_0xbe85('0x2e')](_0x30d462)[_0xbe85('0x13')](handleEntityNotFound(_0x311840,null))[_0xbe85('0x13')](respondWithResult(_0x311840,null))[_0xbe85('0x23')](handleError(_0x311840,null));};exports[_0xbe85('0x2f')]=function(_0x583735,_0x2312cc){return db[_0xbe85('0x1c')][_0xbe85('0x2f')](_0x583735[_0xbe85('0x30')],{})[_0xbe85('0x13')](function(_0x3a5edb){var _0x122047=_0x583735[_0xbe85('0x31')][_0xbe85('0x14')]({'plain':!![]});if(!_0x122047)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x122047[_0xbe85('0x32')]==='user'){var _0x467e34=_0x3a5edb[_0xbe85('0x14')]({'plain':!![]});var _0x49c971=_0xbe85('0x15');return db[_0xbe85('0x33')][_0xbe85('0x2e')]({'where':{'name':_0x49c971,'userProfileId':_0x122047['userProfileId']},'raw':!![]})['then'](function(_0x5bec8b){if(_0x5bec8b&&_0x5bec8b['autoAssociation']===0x0){return db[_0xbe85('0x16')][_0xbe85('0x2f')]({'name':_0x467e34[_0xbe85('0x19')],'resourceId':_0x467e34['id'],'type':_0x5bec8b[_0xbe85('0x19')],'sectionId':_0x5bec8b['id']},{})[_0xbe85('0x13')](function(){return _0x3a5edb;});}else{return _0x3a5edb;}})[_0xbe85('0x23')](function(_0x172905){logger['error'](_0xbe85('0x34'),_0x172905);throw _0x172905;});}return _0x3a5edb;})[_0xbe85('0x13')](respondWithResult(_0x2312cc,0xc9))['catch'](handleError(_0x2312cc,null));};exports[_0xbe85('0x12')]=function(_0x38a2da,_0x5e852f){if(_0x38a2da[_0xbe85('0x30')]['id']){delete _0x38a2da['body']['id'];}return db['MailQueue'][_0xbe85('0x2e')]({'where':{'id':_0x38a2da[_0xbe85('0x24')]['id']}})[_0xbe85('0x13')](handleEntityNotFound(_0x5e852f,null))[_0xbe85('0x13')](saveUpdates(_0x38a2da[_0xbe85('0x30')],null))[_0xbe85('0x13')](respondWithResult(_0x5e852f,null))[_0xbe85('0x23')](handleError(_0x5e852f,null));};exports['destroy']=function(_0x443178,_0x6a68ac){return db['MailQueue'][_0xbe85('0x2e')]({'where':{'id':_0x443178['params']['id']}})[_0xbe85('0x13')](handleEntityNotFound(_0x6a68ac,null))['then'](removeEntity(_0x6a68ac,null))[_0xbe85('0x23')](handleError(_0x6a68ac,null));};exports['describe']=function(_0x2e9920,_0x4ffd6f){return db[_0xbe85('0x1c')][_0xbe85('0x35')]()[_0xbe85('0x13')](respondWithResult(_0x4ffd6f,null))[_0xbe85('0x23')](handleError(_0x4ffd6f,null));};exports[_0xbe85('0x36')]=function(_0x18815e,_0x270f30){var _0x1fc343={'raw':!![],'where':{}},_0x3471d9={},_0x5ad7ed;return db[_0xbe85('0x1c')][_0xbe85('0x37')]({'where':{'id':_0x18815e[_0xbe85('0x24')]['id']}})[_0xbe85('0x13')](handleEntityNotFound(_0x270f30,null))['then'](function(_0x2999d8){if(_0x2999d8){_0x5ad7ed=_0x2999d8['get']({'plain':!![]});_0x3471d9[_0xbe85('0x25')]=_[_0xbe85('0x26')](db[_0xbe85('0x38')]['rawAttributes']);_0x3471d9[_0xbe85('0x20')]=_[_0xbe85('0x26')](_0x18815e[_0xbe85('0x20')]);_0x3471d9['filters']=_[_0xbe85('0x28')](_0x3471d9[_0xbe85('0x25')],_0x3471d9[_0xbe85('0x20')]);_0x1fc343[_0xbe85('0x29')]=_[_0xbe85('0x28')](_0x3471d9['model'],qs[_0xbe85('0x2a')](_0x18815e[_0xbe85('0x20')][_0xbe85('0x2a')]));_0x1fc343[_0xbe85('0x29')]=_0x1fc343[_0xbe85('0x29')][_0xbe85('0x39')]?_0x1fc343[_0xbe85('0x29')]:_0x3471d9['model'];if(!_0x18815e[_0xbe85('0x20')]['hasOwnProperty']('nolimit')){_0x1fc343[_0xbe85('0xd')]=qs['limit'](_0x18815e[_0xbe85('0x20')]['limit']);_0x1fc343['offset']=qs[_0xbe85('0x3a')](_0x18815e[_0xbe85('0x20')][_0xbe85('0x3a')]);}_0x1fc343['order']=qs[_0xbe85('0x3b')](_0x18815e['query'][_0xbe85('0x3b')]);_0x1fc343[_0xbe85('0x3c')]=qs[_0xbe85('0x27')](_[_0xbe85('0x3d')](_0x18815e['query'],_0x3471d9[_0xbe85('0x27')]));_0x1fc343[_0xbe85('0x3c')][_0xbe85('0x3e')]=_0x2999d8['id'];if(_0x18815e[_0xbe85('0x20')][_0xbe85('0x3f')]){_0x1fc343[_0xbe85('0x3c')]=_[_0xbe85('0x2c')](_0x1fc343[_0xbe85('0x3c')],{'$or':_[_0xbe85('0x40')](_0x1fc343['attributes'],function(_0x443fa8){var _0xb49c16={};_0xb49c16[_0x443fa8]={'$like':'%'+_0x18815e[_0xbe85('0x20')][_0xbe85('0x3f')]+'%'};return _0xb49c16;})});}_0x1fc343=_[_0xbe85('0x2c')]({},_0x1fc343,_0x18815e[_0xbe85('0x2d')]);return db[_0xbe85('0x38')][_0xbe85('0x21')](_0x1fc343);}})[_0xbe85('0x13')](function(_0x3947fb){if(_0x3947fb){return db[_0xbe85('0x41')][_0xbe85('0x42')]({'where':{'id':_[_0xbe85('0x40')](_0x3947fb,_0xbe85('0x43')),'role':_0xbe85('0x44')},'attributes':['id',_0xbe85('0x19'),_0xbe85('0x45'),'updatedAt',_0xbe85('0x46')]});}})['then'](function(_0xf0be71){if(_0xf0be71){return{'count':_0xf0be71[_0xbe85('0xe')],'rows':_['map'](_0xf0be71[_0xbe85('0x22')],function(_0x12587f){return{'membername':_0x12587f[_0xbe85('0x19')],'UserId':_0x12587f['id'],'queue_name':_0x5ad7ed[_0xbe85('0x19')],'MailQueueId':_0x5ad7ed['id'],'interface':util[_0xbe85('0x47')]('%s/%s','SIP',_0x12587f[_0xbe85('0x19')]),'penalty':0x0,'paused':_0x12587f[_0xbe85('0x45')],'createdAt':_0x12587f[_0xbe85('0x46')],'updatedAt':_0x12587f[_0xbe85('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbe85('0x13')](respondWithFilteredResult(_0x270f30,_0x1fc343))[_0xbe85('0x23')](handleError(_0x270f30,null));};exports[_0xbe85('0x49')]=function(_0x191382,_0x5afc9c){var _0xce67ca={};var _0x3834bb={};var _0xbdc93c;var _0x15b1e5;return db[_0xbe85('0x1c')][_0xbe85('0x37')]({'where':{'id':_0x191382[_0xbe85('0x24')]['id']}})[_0xbe85('0x13')](handleEntityNotFound(_0x5afc9c,null))[_0xbe85('0x13')](function(_0x1c5e28){if(_0x1c5e28){_0xbdc93c=_0x1c5e28;_0x3834bb[_0xbe85('0x25')]=_[_0xbe85('0x26')](db[_0xbe85('0x4a')][_0xbe85('0x1d')]);_0x3834bb[_0xbe85('0x20')]=_[_0xbe85('0x26')](_0x191382[_0xbe85('0x20')]);_0x3834bb[_0xbe85('0x27')]=_[_0xbe85('0x28')](_0x3834bb['model'],_0x3834bb[_0xbe85('0x20')]);_0xce67ca[_0xbe85('0x29')]=_['intersection'](_0x3834bb[_0xbe85('0x25')],qs['fields'](_0x191382['query'][_0xbe85('0x2a')]));_0xce67ca[_0xbe85('0x29')]=_0xce67ca[_0xbe85('0x29')]['length']?_0xce67ca['attributes']:_0x3834bb[_0xbe85('0x25')];_0xce67ca[_0xbe85('0x4b')]=qs[_0xbe85('0x3b')](_0x191382[_0xbe85('0x20')][_0xbe85('0x3b')]);_0xce67ca[_0xbe85('0x3c')]=qs[_0xbe85('0x27')](_[_0xbe85('0x3d')](_0x191382[_0xbe85('0x20')],_0x3834bb['filters']));if(_0x191382[_0xbe85('0x20')][_0xbe85('0x3f')]){_0xce67ca['where']=_['merge'](_0xce67ca[_0xbe85('0x3c')],{'$or':_[_0xbe85('0x40')](_0xce67ca[_0xbe85('0x29')],function(_0x28485b){var _0x5a0a70={};_0x5a0a70[_0x28485b]={'$like':'%'+_0x191382[_0xbe85('0x20')]['filter']+'%'};return _0x5a0a70;})});}_0xce67ca=_['merge']({},_0xce67ca,_0x191382[_0xbe85('0x2d')]);return _0xbdc93c[_0xbe85('0x49')](_0xce67ca);}})[_0xbe85('0x13')](function(_0x2a3161){if(_0x2a3161){_0x15b1e5=_0x2a3161[_0xbe85('0x39')];if(!_0x191382[_0xbe85('0x20')]['hasOwnProperty'](_0xbe85('0x4c'))){_0xce67ca[_0xbe85('0xd')]=qs[_0xbe85('0xd')](_0x191382['query']['limit']);_0xce67ca[_0xbe85('0x3a')]=qs[_0xbe85('0x3a')](_0x191382[_0xbe85('0x20')]['offset']);}return _0xbdc93c['getTeams'](_0xce67ca);}})[_0xbe85('0x13')](function(_0xbe0317){if(_0xbe0317){return _0xbe0317?{'count':_0x15b1e5,'rows':_0xbe0317}:null;}})[_0xbe85('0x13')](respondWithResult(_0x5afc9c,null))[_0xbe85('0x23')](handleError(_0x5afc9c,null));};exports[_0xbe85('0x4d')]=function(_0x2265e4,_0x5c38b0){var _0x1b5fc6=_0x2265e4[_0xbe85('0x30')][_0xbe85('0x4e')];return db[_0xbe85('0x4a')][_0xbe85('0x21')]({'where':{'id':_0x1b5fc6},'attributes':['id'],'include':[{'model':db[_0xbe85('0x41')],'as':_0xbe85('0x4f'),'attributes':['id','name',_0xbe85('0x50'),_0xbe85('0x51'),_0xbe85('0x52')],'raw':!![]}]})['then'](function(_0x508e4b){if(_0x508e4b){var _0x5aab7a=_[_0xbe85('0x53')](_0x508e4b,function(_0x14200d){var _0x252ddd=_0x14200d[_0xbe85('0x14')]({'plain':!![]});return _0x252ddd[_0xbe85('0x4f')];});return db['MailQueue'][_0xbe85('0x2e')]({'where':{'id':_0x2265e4[_0xbe85('0x24')]['id']}})[_0xbe85('0x13')](function(_0x22935e){return db[_0xbe85('0x54')][_0xbe85('0x55')](function(_0x40f3d5){return _0x22935e[_0xbe85('0x4d')](_0x1b5fc6,{'transaction':_0x40f3d5})['then'](function(){return BPromise[_0xbe85('0x56')](_0x5aab7a,function(_0x3efcee){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x3efcee['id'],'MailQueueId':_0x2265e4[_0xbe85('0x24')]['id']},'transaction':_0x40f3d5});});})[_0xbe85('0x13')](function(){_0x5aab7a[_0xbe85('0x57')](function(_0x2b5ecc){socket[_0xbe85('0x58')](_0xbe85('0x59'),{'UserId':_0x2b5ecc['id'],'MailQueueId':_0x22935e['id']});});});});});}})[_0xbe85('0x13')](respondWithStatusCode(_0x5c38b0,null))['catch'](handleError(_0x5c38b0,null));};exports[_0xbe85('0x5a')]=function(_0x1186a4,_0x4bdaa8){return db['Team'][_0xbe85('0x21')]({'where':{'id':_0x1186a4[_0xbe85('0x20')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbe85('0x41')],'as':_0xbe85('0x4f'),'attributes':['id'],'raw':!![]}]})[_0xbe85('0x13')](handleEntityNotFound(_0x4bdaa8,null))['then'](function(_0x1e8096){var _0x5b76f2=_[_0xbe85('0x40')](_0x1e8096,'id');var _0x166b30=[];var _0x313fbe=[];var _0x58df3d=squel[_0xbe85('0x5b')]();_0x58df3d[_0xbe85('0x5c')](_0xbe85('0x5d'))[_0xbe85('0x5e')]('team_has_mail_queues','tq')['join'](_0xbe85('0x5f'),'ut',_0xbe85('0x60'))[_0xbe85('0x3c')](_0xbe85('0x61'),_0x1186a4[_0xbe85('0x24')]['id']);for(var _0x1f5743=0x0;_0x1f5743<_0x1e8096[_0xbe85('0x39')];_0x1f5743+=0x1){let _0x51fc5f=_0x1e8096[_0x1f5743];for(var _0x256a1f=0x0;_0x256a1f<_0x51fc5f['Agents'][_0xbe85('0x39')];_0x256a1f+=0x1){let _0x2ccba6=_0x51fc5f[_0xbe85('0x4f')][_0x256a1f];var _0x46d91d=_0x58df3d[_0xbe85('0x62')]();_0x46d91d['where'](_0xbe85('0x63'),_0x2ccba6['id']);_0x313fbe[_0xbe85('0x64')](db[_0xbe85('0x54')][_0xbe85('0x20')](_0x46d91d[_0xbe85('0x65')](),{'type':db[_0xbe85('0x54')]['QueryTypes'][_0xbe85('0x66')]})['then'](function(_0x982682){if(_0x982682[_0xbe85('0x39')]===0x1){return _0x2ccba6['id'];}else{var _0x1aa8f7=_['every'](_[_0xbe85('0x40')](_0x982682,_0xbe85('0x67')),function(_0x4089a4){return _['includes'](_0x5b76f2,_0x4089a4);});if(_0x1aa8f7){return _0x2ccba6['id'];}}}));}}return BPromise[_0xbe85('0x68')](_0x313fbe)[_0xbe85('0x13')](function(_0x1d98a2){_0x166b30=_(_0x166b30)['union'](_0x1d98a2)[_0xbe85('0x69')]()[_0xbe85('0x6a')]();return db['MailQueue'][_0xbe85('0x2e')]({'where':{'id':_0x1186a4[_0xbe85('0x24')]['id']}})[_0xbe85('0x13')](function(_0x5bb310){return db['sequelize'][_0xbe85('0x55')](function(_0x201fd4){return _0x5bb310[_0xbe85('0x5a')](_0x1186a4['query'][_0xbe85('0x4e')],{'transaction':_0x201fd4})[_0xbe85('0x13')](function(){if(!_[_0xbe85('0x6b')](_0x166b30)){return _0x5bb310[_0xbe85('0x6c')](_0x166b30,{'transaction':_0x201fd4});}})[_0xbe85('0x13')](function(){_0x166b30[_0xbe85('0x57')](function(_0x42026a){socket[_0xbe85('0x58')](_0xbe85('0x6d'),{'UserId':_0x42026a,'MailQueueId':_0x5bb310['id']});});});});});});})[_0xbe85('0x13')](respondWithStatusCode(_0x4bdaa8,null))[_0xbe85('0x23')](handleError(_0x4bdaa8,null));};exports[_0xbe85('0x6e')]=function(_0x5e9f29,_0x7e9de7){return db['MailQueue'][_0xbe85('0x2e')]({'where':{'id':_0x5e9f29[_0xbe85('0x24')]['id']}})[_0xbe85('0x13')](handleEntityNotFound(_0x7e9de7,null))[_0xbe85('0x13')](function(_0x3ddfda){if(_0x3ddfda){return _0x3ddfda[_0xbe85('0x6e')](_0x5e9f29[_0xbe85('0x30')][_0xbe85('0x4e')],_[_0xbe85('0x6f')](_0x5e9f29[_0xbe85('0x30')],[_0xbe85('0x4e'),'id'])||{})['spread'](function(_0x8ab37){for(var _0x1f4c5b=0x0;_0x1f4c5b<_0x5e9f29[_0xbe85('0x30')][_0xbe85('0x4e')]['length'];_0x1f4c5b+=0x1){socket[_0xbe85('0x58')](_0xbe85('0x59'),{'UserId':Number(_0x5e9f29[_0xbe85('0x30')][_0xbe85('0x4e')][_0x1f4c5b]),'MailQueueId':Number(_0x5e9f29['params']['id'])});}return _0x8ab37;});}})[_0xbe85('0x13')](respondWithResult(_0x7e9de7,null))['catch'](handleError(_0x7e9de7,null));};exports['removeAgents']=function(_0x3b4e83,_0x2fceac){return db[_0xbe85('0x1c')][_0xbe85('0x2e')]({'where':{'id':_0x3b4e83[_0xbe85('0x24')]['id']}})['then'](handleEntityNotFound(_0x2fceac,null))['then'](function(_0x36b58e){if(_0x36b58e){return _0x36b58e[_0xbe85('0x6c')](_0x3b4e83[_0xbe85('0x20')][_0xbe85('0x4e')])[_0xbe85('0x13')](function(){if(_[_0xbe85('0x70')](_0x3b4e83[_0xbe85('0x20')][_0xbe85('0x4e')])){for(var _0x142045=0x0;_0x142045<_0x3b4e83[_0xbe85('0x20')][_0xbe85('0x4e')]['length'];_0x142045+=0x1){socket[_0xbe85('0x58')](_0xbe85('0x6d'),{'UserId':Number(_0x3b4e83[_0xbe85('0x20')]['ids'][_0x142045]),'MailQueueId':Number(_0x3b4e83['params']['id'])});}}else{socket[_0xbe85('0x58')](_0xbe85('0x6d'),{'UserId':Number(_0x3b4e83['query'][_0xbe85('0x4e')]),'MailQueueId':Number(_0x3b4e83[_0xbe85('0x24')]['id'])});}});}})['then'](respondWithStatusCode(_0x2fceac,null))[_0xbe85('0x23')](handleError(_0x2fceac,null));};exports[_0xbe85('0x71')]=function(_0xeca160,_0x250d6c){var _0x2e8802={};var _0x331f3d={};var _0x3e68c6;var _0x47d42a;return db[_0xbe85('0x1c')][_0xbe85('0x37')]({'where':{'id':_0xeca160[_0xbe85('0x24')]['id']}})['then'](handleEntityNotFound(_0x250d6c,null))[_0xbe85('0x13')](function(_0x50bea2){if(_0x50bea2){_0x3e68c6=_0x50bea2;_0x331f3d[_0xbe85('0x25')]=_[_0xbe85('0x26')](db[_0xbe85('0x41')][_0xbe85('0x1d')]);_0x331f3d[_0xbe85('0x20')]=_[_0xbe85('0x26')](_0xeca160[_0xbe85('0x20')]);_0x331f3d[_0xbe85('0x27')]=_[_0xbe85('0x28')](_0x331f3d[_0xbe85('0x25')],_0x331f3d['query']);_0x2e8802['attributes']=_['intersection'](_0x331f3d[_0xbe85('0x25')],qs[_0xbe85('0x2a')](_0xeca160[_0xbe85('0x20')][_0xbe85('0x2a')]));_0x2e8802['attributes']=_0x2e8802[_0xbe85('0x29')]['length']?_0x2e8802['attributes']:_0x331f3d['model'];_0x2e8802['order']=qs['sort'](_0xeca160['query'][_0xbe85('0x3b')]);_0x2e8802[_0xbe85('0x3c')]=qs['filters'](_[_0xbe85('0x3d')](_0xeca160['query'],_0x331f3d[_0xbe85('0x27')]));if(_0xeca160[_0xbe85('0x20')][_0xbe85('0x3f')]){_0x2e8802[_0xbe85('0x3c')]=_['merge'](_0x2e8802[_0xbe85('0x3c')],{'$or':_['map'](_0x2e8802[_0xbe85('0x29')],function(_0xe59a0f){var _0x36aab2={};_0x36aab2[_0xe59a0f]={'$like':'%'+_0xeca160[_0xbe85('0x20')][_0xbe85('0x3f')]+'%'};return _0x36aab2;})});}_0x2e8802=_[_0xbe85('0x2c')]({},_0x2e8802,_0xeca160[_0xbe85('0x2d')]);return _0x3e68c6[_0xbe85('0x71')](_0x2e8802);}})[_0xbe85('0x13')](function(_0xa8c26c){if(_0xa8c26c){_0x47d42a=_0xa8c26c[_0xbe85('0x39')];if(!_0xeca160['query'][_0xbe85('0x72')]('nolimit')){_0x2e8802[_0xbe85('0xd')]=qs[_0xbe85('0xd')](_0xeca160['query'][_0xbe85('0xd')]);_0x2e8802['offset']=qs[_0xbe85('0x3a')](_0xeca160['query'][_0xbe85('0x3a')]);}return _0x3e68c6[_0xbe85('0x71')](_0x2e8802);}})[_0xbe85('0x13')](function(_0x5dbf9b){if(_0x5dbf9b){return _0x5dbf9b?{'count':_0x47d42a,'rows':_0x5dbf9b}:null;}})[_0xbe85('0x13')](respondWithResult(_0x250d6c,null))[_0xbe85('0x23')](handleError(_0x250d6c,null));}; \ No newline at end of file +var _0x90e0=['interface','flatMap','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','MailQueues','destroy','sendStatus','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','getOptions','include','query','findAll','catch','show','params','keys','filters','intersection','model','fields','attributes','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','hasOwnProperty','order','sort','pick','where','MailQueueId','filter','User','findAndCountAll','UserId','agent','mailPause','updatedAt','rows','format','%s/%s','createdAt','getTeams','Team','nolimit','addTeams','ids','Agents','online'];(function(_0x8e59c6,_0x4da425){var _0x5e645a=function(_0x1b450b){while(--_0x1b450b){_0x8e59c6['push'](_0x8e59c6['shift']());}};_0x5e645a(++_0x4da425);}(_0x90e0,0xa0));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x090e('0x0'));var util=require(_0x090e('0x1'));var _=require('lodash');var squel=require(_0x090e('0x2'));var Redis=require(_0x090e('0x3'));var qs=require(_0x090e('0x4'));var logger=require(_0x090e('0x5'))(_0x090e('0x6'));var config=require(_0x090e('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x090e('0x8')](config['redis'],{'host':_0x090e('0x9'),'port':0x18eb});var socket=require(_0x090e('0xa'))(new Redis(config['redis']));require(_0x090e('0xb'))['register'](socket);function respondWithStatusCode(_0x51ddb1,_0x4105ea){_0x4105ea=_0x4105ea||0xcc;return function(_0xf8130e){if(_0xf8130e){return _0x51ddb1['sendStatus'](_0x4105ea);}return _0x51ddb1[_0x090e('0xc')](_0x4105ea)[_0x090e('0xd')]();};}function respondWithResult(_0x292660,_0x42b3a6){_0x42b3a6=_0x42b3a6||0xc8;return function(_0x3c4081){if(_0x3c4081){return _0x292660['status'](_0x42b3a6)[_0x090e('0xe')](_0x3c4081);}};}function respondWithFilteredResult(_0x48ffb2,_0xe890ca){return function(_0x3f7468){if(_0x3f7468){var _0x5f5a3b=typeof _0xe890ca[_0x090e('0xf')]===_0x090e('0x10')&&typeof _0xe890ca[_0x090e('0x11')]===_0x090e('0x10');var _0x41efbf=_0x3f7468[_0x090e('0x12')];var _0x39529e=_0x5f5a3b?0x0:_0xe890ca[_0x090e('0xf')];var _0x3e595d=_0x5f5a3b?_0x3f7468[_0x090e('0x12')]:_0xe890ca[_0x090e('0xf')]+_0xe890ca['limit'];var _0x387365;if(_0x3e595d>=_0x41efbf){_0x3e595d=_0x41efbf;_0x387365=0xc8;}else{_0x387365=0xce;}_0x48ffb2['status'](_0x387365);return _0x48ffb2[_0x090e('0x13')](_0x090e('0x14'),_0x39529e+'-'+_0x3e595d+'/'+_0x41efbf)[_0x090e('0xe')](_0x3f7468);}return null;};}function saveUpdates(_0x42332f){return function(_0x46542b){if(_0x46542b){return _0x46542b[_0x090e('0x15')](_0x42332f)['then'](function(_0x2e525f){return _0x2e525f;});}return null;};}function removeEntity(_0x6ce5ca){return function(_0x278c4c){if(_0x278c4c){return _0x278c4c['destroy']()[_0x090e('0x16')](function(){var _0x3983cc=_0x278c4c[_0x090e('0x17')]({'plain':!![]});var _0x436b70=_0x090e('0x18');return db['UserProfileResource'][_0x090e('0x19')]({'where':{'type':_0x436b70,'resourceId':_0x3983cc['id']}})['then'](function(){return _0x278c4c;});})['then'](function(){_0x6ce5ca[_0x090e('0xc')](0xcc)[_0x090e('0xd')]();});}};}function handleEntityNotFound(_0x44433f){return function(_0x1eed65){if(!_0x1eed65){_0x44433f[_0x090e('0x1a')](0x194);}return _0x1eed65;};}function handleError(_0xbc8e6a,_0x3177ec){_0x3177ec=_0x3177ec||0x1f4;return function(_0xb39ced){logger[_0x090e('0x1b')](_0xb39ced[_0x090e('0x1c')]);if(_0xb39ced['name']){delete _0xb39ced[_0x090e('0x1d')];}_0xbc8e6a[_0x090e('0xc')](_0x3177ec)['send'](_0xb39ced);};}exports[_0x090e('0x1e')]=function(_0x177717,_0x529d3a){var _0x5895b6={};var _0x5e2fb0={'count':0x0,'rows':[]};var _0x4fdf13=_[_0x090e('0x1f')](db[_0x090e('0x20')][_0x090e('0x21')],function(_0x957af8){return{'name':_0x957af8[_0x090e('0x22')],'type':_0x957af8[_0x090e('0x23')]['key']};});_0x5895b6=qs[_0x090e('0x24')](_0x4fdf13,_0x177717);var _0x727ea1={'where':_0x5895b6['where']};return db['MailQueue'][_0x090e('0x12')](_0x727ea1)[_0x090e('0x16')](function(_0xa16e6c){_0x5e2fb0[_0x090e('0x12')]=_0xa16e6c;_0x5895b6[_0x090e('0x25')]=qs[_0x090e('0x25')](_0x177717[_0x090e('0x26')]);return db[_0x090e('0x20')][_0x090e('0x27')](_0x5895b6);})[_0x090e('0x16')](function(_0x369a51){_0x5e2fb0['rows']=_0x369a51;return _0x5e2fb0;})[_0x090e('0x16')](respondWithFilteredResult(_0x529d3a,_0x5895b6))[_0x090e('0x28')](handleError(_0x529d3a,null));};exports[_0x090e('0x29')]=function(_0x4e1053,_0x7c55d6){var _0x417b6b={'raw':!![],'where':{'id':_0x4e1053[_0x090e('0x2a')]['id']}},_0xd5b687={};_0xd5b687['model']=_[_0x090e('0x2b')](db[_0x090e('0x20')][_0x090e('0x21')]);_0xd5b687[_0x090e('0x26')]=_[_0x090e('0x2b')](_0x4e1053[_0x090e('0x26')]);_0xd5b687[_0x090e('0x2c')]=_[_0x090e('0x2d')](_0xd5b687[_0x090e('0x2e')],_0xd5b687[_0x090e('0x26')]);_0x417b6b['attributes']=_[_0x090e('0x2d')](_0xd5b687['model'],qs['fields'](_0x4e1053[_0x090e('0x26')][_0x090e('0x2f')]));_0x417b6b['attributes']=_0x417b6b[_0x090e('0x30')]['length']?_0x417b6b[_0x090e('0x30')]:_0xd5b687['model'];if(_0x4e1053['query'][_0x090e('0x31')]){_0x417b6b['include']=[{'all':!![]}];}_0x417b6b=_[_0x090e('0x32')]({},_0x417b6b,_0x4e1053[_0x090e('0x33')]);return db[_0x090e('0x20')][_0x090e('0x34')](_0x417b6b)[_0x090e('0x16')](handleEntityNotFound(_0x7c55d6,null))[_0x090e('0x16')](respondWithResult(_0x7c55d6,null))['catch'](handleError(_0x7c55d6,null));};exports[_0x090e('0x35')]=function(_0x8dcda6,_0x3896d2){return db['MailQueue'][_0x090e('0x35')](_0x8dcda6[_0x090e('0x36')],{})[_0x090e('0x16')](function(_0x51d538){var _0x75ec0a=_0x8dcda6[_0x090e('0x37')]['get']({'plain':!![]});if(!_0x75ec0a)throw new Error(_0x090e('0x38'));if(_0x75ec0a[_0x090e('0x39')]===_0x090e('0x37')){var _0x1347f4=_0x51d538[_0x090e('0x17')]({'plain':!![]});var _0x3fbd0f=_0x090e('0x18');return db[_0x090e('0x3a')]['find']({'where':{'name':_0x3fbd0f,'userProfileId':_0x75ec0a[_0x090e('0x3b')]},'raw':!![]})[_0x090e('0x16')](function(_0x322b33){if(_0x322b33&&_0x322b33[_0x090e('0x3c')]===0x0){return db[_0x090e('0x3d')][_0x090e('0x35')]({'name':_0x1347f4[_0x090e('0x1d')],'resourceId':_0x1347f4['id'],'type':_0x322b33[_0x090e('0x1d')],'sectionId':_0x322b33['id']},{})[_0x090e('0x16')](function(){return _0x51d538;});}else{return _0x51d538;}})[_0x090e('0x28')](function(_0x3045f6){logger[_0x090e('0x1b')](_0x090e('0x3e'),_0x3045f6);throw _0x3045f6;});}return _0x51d538;})[_0x090e('0x16')](respondWithResult(_0x3896d2,0xc9))[_0x090e('0x28')](handleError(_0x3896d2,null));};exports[_0x090e('0x15')]=function(_0x1e6689,_0x1d1f2a){if(_0x1e6689[_0x090e('0x36')]['id']){delete _0x1e6689[_0x090e('0x36')]['id'];}return db[_0x090e('0x20')][_0x090e('0x34')]({'where':{'id':_0x1e6689[_0x090e('0x2a')]['id']}})[_0x090e('0x16')](handleEntityNotFound(_0x1d1f2a,null))[_0x090e('0x16')](saveUpdates(_0x1e6689[_0x090e('0x36')],null))[_0x090e('0x16')](respondWithResult(_0x1d1f2a,null))[_0x090e('0x28')](handleError(_0x1d1f2a,null));};exports[_0x090e('0x19')]=function(_0x267110,_0x2771b4){return db[_0x090e('0x20')]['find']({'where':{'id':_0x267110[_0x090e('0x2a')]['id']}})[_0x090e('0x16')](handleEntityNotFound(_0x2771b4,null))[_0x090e('0x16')](removeEntity(_0x2771b4,null))[_0x090e('0x28')](handleError(_0x2771b4,null));};exports[_0x090e('0x3f')]=function(_0x5c94cf,_0x1a3c26){return db[_0x090e('0x20')][_0x090e('0x3f')]()['then'](respondWithResult(_0x1a3c26,null))['catch'](handleError(_0x1a3c26,null));};exports[_0x090e('0x40')]=function(_0x15275f,_0x3ab9f0){var _0xb940e2={'raw':!![],'where':{}},_0x3b8377={},_0x3d7735;return db[_0x090e('0x20')][_0x090e('0x41')]({'where':{'id':_0x15275f[_0x090e('0x2a')]['id']}})[_0x090e('0x16')](handleEntityNotFound(_0x3ab9f0,null))[_0x090e('0x16')](function(_0x3a3ef2){if(_0x3a3ef2){_0x3d7735=_0x3a3ef2[_0x090e('0x17')]({'plain':!![]});_0x3b8377[_0x090e('0x2e')]=_['keys'](db[_0x090e('0x42')][_0x090e('0x21')]);_0x3b8377[_0x090e('0x26')]=_['keys'](_0x15275f[_0x090e('0x26')]);_0x3b8377[_0x090e('0x2c')]=_[_0x090e('0x2d')](_0x3b8377[_0x090e('0x2e')],_0x3b8377[_0x090e('0x26')]);_0xb940e2['attributes']=_['intersection'](_0x3b8377[_0x090e('0x2e')],qs[_0x090e('0x2f')](_0x15275f[_0x090e('0x26')][_0x090e('0x2f')]));_0xb940e2['attributes']=_0xb940e2[_0x090e('0x30')][_0x090e('0x43')]?_0xb940e2[_0x090e('0x30')]:_0x3b8377[_0x090e('0x2e')];if(!_0x15275f[_0x090e('0x26')][_0x090e('0x44')]('nolimit')){_0xb940e2[_0x090e('0x11')]=qs[_0x090e('0x11')](_0x15275f[_0x090e('0x26')][_0x090e('0x11')]);_0xb940e2['offset']=qs[_0x090e('0xf')](_0x15275f[_0x090e('0x26')][_0x090e('0xf')]);}_0xb940e2[_0x090e('0x45')]=qs[_0x090e('0x46')](_0x15275f['query'][_0x090e('0x46')]);_0xb940e2['where']=qs[_0x090e('0x2c')](_[_0x090e('0x47')](_0x15275f['query'],_0x3b8377['filters']));_0xb940e2[_0x090e('0x48')][_0x090e('0x49')]=_0x3a3ef2['id'];if(_0x15275f[_0x090e('0x26')][_0x090e('0x4a')]){_0xb940e2['where']=_['merge'](_0xb940e2[_0x090e('0x48')],{'$or':_[_0x090e('0x1f')](_0xb940e2[_0x090e('0x30')],function(_0x108f98){var _0x4b9f9f={};_0x4b9f9f[_0x108f98]={'$like':'%'+_0x15275f[_0x090e('0x26')]['filter']+'%'};return _0x4b9f9f;})});}_0xb940e2=_[_0x090e('0x32')]({},_0xb940e2,_0x15275f[_0x090e('0x33')]);return db['UserMailQueue']['findAll'](_0xb940e2);}})[_0x090e('0x16')](function(_0x22bf4b){if(_0x22bf4b){return db[_0x090e('0x4b')][_0x090e('0x4c')]({'where':{'id':_[_0x090e('0x1f')](_0x22bf4b,_0x090e('0x4d')),'role':_0x090e('0x4e')},'attributes':['id',_0x090e('0x1d'),_0x090e('0x4f'),_0x090e('0x50'),'createdAt']});}})[_0x090e('0x16')](function(_0x3b88c9){if(_0x3b88c9){return{'count':_0x3b88c9['count'],'rows':_[_0x090e('0x1f')](_0x3b88c9[_0x090e('0x51')],function(_0x1d825e){return{'membername':_0x1d825e[_0x090e('0x1d')],'UserId':_0x1d825e['id'],'queue_name':_0x3d7735[_0x090e('0x1d')],'MailQueueId':_0x3d7735['id'],'interface':util[_0x090e('0x52')](_0x090e('0x53'),'SIP',_0x1d825e[_0x090e('0x1d')]),'penalty':0x0,'paused':_0x1d825e['mailPause'],'createdAt':_0x1d825e[_0x090e('0x54')],'updatedAt':_0x1d825e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x090e('0x16')](respondWithFilteredResult(_0x3ab9f0,_0xb940e2))[_0x090e('0x28')](handleError(_0x3ab9f0,null));};exports[_0x090e('0x55')]=function(_0x17d274,_0x53c5f7){var _0x17e5a7={};var _0x694615={};var _0x2fc64b;var _0x20030d;return db[_0x090e('0x20')][_0x090e('0x41')]({'where':{'id':_0x17d274['params']['id']}})['then'](handleEntityNotFound(_0x53c5f7,null))[_0x090e('0x16')](function(_0x30ab2e){if(_0x30ab2e){_0x2fc64b=_0x30ab2e;_0x694615[_0x090e('0x2e')]=_['keys'](db[_0x090e('0x56')][_0x090e('0x21')]);_0x694615[_0x090e('0x26')]=_[_0x090e('0x2b')](_0x17d274[_0x090e('0x26')]);_0x694615[_0x090e('0x2c')]=_[_0x090e('0x2d')](_0x694615['model'],_0x694615['query']);_0x17e5a7[_0x090e('0x30')]=_[_0x090e('0x2d')](_0x694615[_0x090e('0x2e')],qs[_0x090e('0x2f')](_0x17d274[_0x090e('0x26')]['fields']));_0x17e5a7[_0x090e('0x30')]=_0x17e5a7[_0x090e('0x30')]['length']?_0x17e5a7['attributes']:_0x694615[_0x090e('0x2e')];_0x17e5a7[_0x090e('0x45')]=qs[_0x090e('0x46')](_0x17d274['query'][_0x090e('0x46')]);_0x17e5a7[_0x090e('0x48')]=qs['filters'](_[_0x090e('0x47')](_0x17d274[_0x090e('0x26')],_0x694615[_0x090e('0x2c')]));if(_0x17d274[_0x090e('0x26')][_0x090e('0x4a')]){_0x17e5a7[_0x090e('0x48')]=_['merge'](_0x17e5a7[_0x090e('0x48')],{'$or':_[_0x090e('0x1f')](_0x17e5a7[_0x090e('0x30')],function(_0x29e37b){var _0xb554e1={};_0xb554e1[_0x29e37b]={'$like':'%'+_0x17d274['query'][_0x090e('0x4a')]+'%'};return _0xb554e1;})});}_0x17e5a7=_[_0x090e('0x32')]({},_0x17e5a7,_0x17d274[_0x090e('0x33')]);return _0x2fc64b['getTeams'](_0x17e5a7);}})['then'](function(_0x279f81){if(_0x279f81){_0x20030d=_0x279f81['length'];if(!_0x17d274[_0x090e('0x26')][_0x090e('0x44')](_0x090e('0x57'))){_0x17e5a7['limit']=qs[_0x090e('0x11')](_0x17d274[_0x090e('0x26')][_0x090e('0x11')]);_0x17e5a7[_0x090e('0xf')]=qs[_0x090e('0xf')](_0x17d274[_0x090e('0x26')][_0x090e('0xf')]);}return _0x2fc64b[_0x090e('0x55')](_0x17e5a7);}})[_0x090e('0x16')](function(_0x264d0c){if(_0x264d0c){return _0x264d0c?{'count':_0x20030d,'rows':_0x264d0c}:null;}})[_0x090e('0x16')](respondWithResult(_0x53c5f7,null))['catch'](handleError(_0x53c5f7,null));};exports[_0x090e('0x58')]=function(_0x127726,_0xd2c995){var _0x556929=_0x127726['body'][_0x090e('0x59')];return db[_0x090e('0x56')][_0x090e('0x27')]({'where':{'id':_0x556929},'attributes':['id'],'include':[{'model':db[_0x090e('0x4b')],'as':_0x090e('0x5a'),'attributes':['id',_0x090e('0x1d'),_0x090e('0x5b'),'voicePause',_0x090e('0x5c')],'raw':!![]}]})['then'](function(_0x2ce1fc){if(_0x2ce1fc){var _0x58fd75=_[_0x090e('0x5d')](_0x2ce1fc,function(_0x2be04c){var _0x23690b=_0x2be04c['get']({'plain':!![]});return _0x23690b[_0x090e('0x5a')];});return db['MailQueue'][_0x090e('0x34')]({'where':{'id':_0x127726['params']['id']}})[_0x090e('0x16')](function(_0x4cdea1){return db['sequelize'][_0x090e('0x5e')](function(_0xab04be){return _0x4cdea1[_0x090e('0x58')](_0x556929,{'transaction':_0xab04be})[_0x090e('0x16')](function(){return BPromise[_0x090e('0x5f')](_0x58fd75,function(_0x4c1dae){return db[_0x090e('0x42')][_0x090e('0x60')]({'where':{'UserId':_0x4c1dae['id'],'MailQueueId':_0x127726[_0x090e('0x2a')]['id']},'transaction':_0xab04be});});})[_0x090e('0x16')](function(){_0x58fd75['forEach'](function(_0x6c97a3){socket[_0x090e('0x61')](_0x090e('0x62'),{'UserId':_0x6c97a3['id'],'MailQueueId':_0x4cdea1['id']});});});});});}})[_0x090e('0x16')](respondWithStatusCode(_0xd2c995,null))['catch'](handleError(_0xd2c995,null));};exports[_0x090e('0x63')]=function(_0x2e5b7b,_0x3b32fb){return db['Team'][_0x090e('0x27')]({'where':{'id':_0x2e5b7b[_0x090e('0x26')]['ids']},'attributes':['id'],'include':[{'model':db[_0x090e('0x4b')],'as':_0x090e('0x5a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3b32fb,null))['then'](function(_0xf03883){var _0x172aab=_['map'](_0xf03883,'id');var _0x2fec40=[];var _0x322f37=[];var _0x23b7a3=squel[_0x090e('0x64')]();_0x23b7a3[_0x090e('0x65')]('tq.TeamId')['from'](_0x090e('0x66'),'tq')['join'](_0x090e('0x67'),'ut',_0x090e('0x68'))[_0x090e('0x48')](_0x090e('0x69'),_0x2e5b7b['params']['id']);for(var _0x4c6425=0x0;_0x4c6425<_0xf03883[_0x090e('0x43')];_0x4c6425+=0x1){let _0x443d53=_0xf03883[_0x4c6425];for(var _0x259501=0x0;_0x259501<_0x443d53[_0x090e('0x5a')][_0x090e('0x43')];_0x259501+=0x1){let _0x1ed637=_0x443d53[_0x090e('0x5a')][_0x259501];var _0x2ed89d=_0x23b7a3[_0x090e('0x6a')]();_0x2ed89d[_0x090e('0x48')](_0x090e('0x6b'),_0x1ed637['id']);_0x322f37[_0x090e('0x6c')](db[_0x090e('0x6d')][_0x090e('0x26')](_0x2ed89d[_0x090e('0x6e')](),{'type':db[_0x090e('0x6d')][_0x090e('0x6f')][_0x090e('0x70')]})[_0x090e('0x16')](function(_0x7b5f57){if(_0x7b5f57[_0x090e('0x43')]===0x1){return _0x1ed637['id'];}else{var _0xdeaf=_[_0x090e('0x71')](_[_0x090e('0x1f')](_0x7b5f57,'TeamId'),function(_0x16493d){return _[_0x090e('0x72')](_0x172aab,_0x16493d);});if(_0xdeaf){return _0x1ed637['id'];}}}));}}return BPromise['all'](_0x322f37)['then'](function(_0x41e29f){_0x2fec40=_(_0x2fec40)['union'](_0x41e29f)[_0x090e('0x73')]()[_0x090e('0x74')]();return db[_0x090e('0x20')][_0x090e('0x34')]({'where':{'id':_0x2e5b7b['params']['id']}})[_0x090e('0x16')](function(_0x1ac79f){return db[_0x090e('0x6d')][_0x090e('0x5e')](function(_0x499996){return _0x1ac79f[_0x090e('0x63')](_0x2e5b7b[_0x090e('0x26')]['ids'],{'transaction':_0x499996})[_0x090e('0x16')](function(){if(!_[_0x090e('0x75')](_0x2fec40)){return _0x1ac79f[_0x090e('0x76')](_0x2fec40,{'transaction':_0x499996});}})[_0x090e('0x16')](function(){_0x2fec40[_0x090e('0x77')](function(_0x28b3fe){socket[_0x090e('0x61')](_0x090e('0x78'),{'UserId':_0x28b3fe,'MailQueueId':_0x1ac79f['id']});});});});});});})[_0x090e('0x16')](respondWithStatusCode(_0x3b32fb,null))[_0x090e('0x28')](handleError(_0x3b32fb,null));};exports[_0x090e('0x79')]=function(_0x35e0d9,_0x4cf2bb){return db[_0x090e('0x20')][_0x090e('0x34')]({'where':{'id':_0x35e0d9[_0x090e('0x2a')]['id']}})[_0x090e('0x16')](handleEntityNotFound(_0x4cf2bb,null))[_0x090e('0x16')](function(_0x1cb9ad){if(_0x1cb9ad){return _0x1cb9ad[_0x090e('0x79')](_0x35e0d9[_0x090e('0x36')][_0x090e('0x59')],_[_0x090e('0x7a')](_0x35e0d9['body'],[_0x090e('0x59'),'id'])||{})[_0x090e('0x7b')](function(_0x11ba57){for(var _0x4c21ad=0x0;_0x4c21ad<_0x35e0d9[_0x090e('0x36')][_0x090e('0x59')][_0x090e('0x43')];_0x4c21ad+=0x1){socket[_0x090e('0x61')](_0x090e('0x62'),{'UserId':Number(_0x35e0d9[_0x090e('0x36')][_0x090e('0x59')][_0x4c21ad]),'MailQueueId':Number(_0x35e0d9[_0x090e('0x2a')]['id'])});}return _0x11ba57;});}})['then'](respondWithResult(_0x4cf2bb,null))[_0x090e('0x28')](handleError(_0x4cf2bb,null));};exports[_0x090e('0x76')]=function(_0xa459ac,_0x34ca71){return db[_0x090e('0x20')][_0x090e('0x34')]({'where':{'id':_0xa459ac['params']['id']}})[_0x090e('0x16')](handleEntityNotFound(_0x34ca71,null))[_0x090e('0x16')](function(_0xe7921a){if(_0xe7921a){return _0xe7921a[_0x090e('0x76')](_0xa459ac[_0x090e('0x26')]['ids'])[_0x090e('0x16')](function(){if(_[_0x090e('0x7c')](_0xa459ac[_0x090e('0x26')]['ids'])){for(var _0x24ea7a=0x0;_0x24ea7a<_0xa459ac[_0x090e('0x26')][_0x090e('0x59')][_0x090e('0x43')];_0x24ea7a+=0x1){socket[_0x090e('0x61')]('userMailQueue:remove',{'UserId':Number(_0xa459ac[_0x090e('0x26')][_0x090e('0x59')][_0x24ea7a]),'MailQueueId':Number(_0xa459ac[_0x090e('0x2a')]['id'])});}}else{socket[_0x090e('0x61')]('userMailQueue:remove',{'UserId':Number(_0xa459ac[_0x090e('0x26')]['ids']),'MailQueueId':Number(_0xa459ac[_0x090e('0x2a')]['id'])});}});}})[_0x090e('0x16')](respondWithStatusCode(_0x34ca71,null))[_0x090e('0x28')](handleError(_0x34ca71,null));};exports[_0x090e('0x7d')]=function(_0x5cb044,_0x48d0f4){var _0x426f19={};var _0x1986a5={};var _0x4c3b4c;var _0x25bc9c;return db[_0x090e('0x20')][_0x090e('0x41')]({'where':{'id':_0x5cb044[_0x090e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x48d0f4,null))[_0x090e('0x16')](function(_0x1e3fcf){if(_0x1e3fcf){_0x4c3b4c=_0x1e3fcf;_0x1986a5[_0x090e('0x2e')]=_[_0x090e('0x2b')](db['User']['rawAttributes']);_0x1986a5[_0x090e('0x26')]=_[_0x090e('0x2b')](_0x5cb044['query']);_0x1986a5[_0x090e('0x2c')]=_[_0x090e('0x2d')](_0x1986a5[_0x090e('0x2e')],_0x1986a5[_0x090e('0x26')]);_0x426f19['attributes']=_['intersection'](_0x1986a5[_0x090e('0x2e')],qs['fields'](_0x5cb044[_0x090e('0x26')]['fields']));_0x426f19[_0x090e('0x30')]=_0x426f19['attributes']['length']?_0x426f19[_0x090e('0x30')]:_0x1986a5[_0x090e('0x2e')];_0x426f19[_0x090e('0x45')]=qs[_0x090e('0x46')](_0x5cb044[_0x090e('0x26')]['sort']);_0x426f19[_0x090e('0x48')]=qs[_0x090e('0x2c')](_[_0x090e('0x47')](_0x5cb044[_0x090e('0x26')],_0x1986a5['filters']));if(_0x5cb044[_0x090e('0x26')]['filter']){_0x426f19['where']=_[_0x090e('0x32')](_0x426f19[_0x090e('0x48')],{'$or':_['map'](_0x426f19[_0x090e('0x30')],function(_0x226bdd){var _0x25c2a1={};_0x25c2a1[_0x226bdd]={'$like':'%'+_0x5cb044[_0x090e('0x26')][_0x090e('0x4a')]+'%'};return _0x25c2a1;})});}_0x426f19=_[_0x090e('0x32')]({},_0x426f19,_0x5cb044[_0x090e('0x33')]);return _0x4c3b4c[_0x090e('0x7d')](_0x426f19);}})[_0x090e('0x16')](function(_0x56db18){if(_0x56db18){_0x25bc9c=_0x56db18['length'];if(!_0x5cb044[_0x090e('0x26')]['hasOwnProperty'](_0x090e('0x57'))){_0x426f19[_0x090e('0x11')]=qs[_0x090e('0x11')](_0x5cb044[_0x090e('0x26')][_0x090e('0x11')]);_0x426f19[_0x090e('0xf')]=qs[_0x090e('0xf')](_0x5cb044[_0x090e('0x26')][_0x090e('0xf')]);}return _0x4c3b4c[_0x090e('0x7d')](_0x426f19);}})[_0x090e('0x16')](function(_0x19d54f){if(_0x19d54f){return _0x19d54f?{'count':_0x25bc9c,'rows':_0x19d54f}:null;}})[_0x090e('0x16')](respondWithResult(_0x48d0f4,null))[_0x090e('0x28')](handleError(_0x48d0f4,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 8356555..884356a 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 _0xdd99=['remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0xdd99,0xab));var _0x9dd9=function(_0x47ea89,_0xc6ce94){_0x47ea89=_0x47ea89-0x0;var _0x52191b=_0xdd99[_0x47ea89];return _0x52191b;};'use strict';var EventEmitter=require(_0x9dd9('0x0'));var MailQueue=require(_0x9dd9('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9dd9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9dd9('0x3')};function emitEvent(_0x5f2859){return function(_0x436c3a,_0x2ee6af,_0x44c82b){MailQueueEvents[_0x9dd9('0x4')](_0x5f2859+':'+_0x436c3a['id'],_0x436c3a);MailQueueEvents[_0x9dd9('0x4')](_0x5f2859,_0x436c3a);_0x44c82b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x9dd9('0x5')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x1517=['update','remove','emit','hasOwnProperty','hook','exports','events','MailQueue','setMaxListeners','save'];(function(_0x3deaa4,_0x54da65){var _0x4eb424=function(_0x12f3bd){while(--_0x12f3bd){_0x3deaa4['push'](_0x3deaa4['shift']());}};_0x4eb424(++_0x54da65);}(_0x1517,0x1dc));var _0x7151=function(_0x59d003,_0x626b4f){_0x59d003=_0x59d003-0x0;var _0x29c845=_0x1517[_0x59d003];return _0x29c845;};'use strict';var EventEmitter=require(_0x7151('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x7151('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7151('0x2')](0x0);var events={'afterCreate':_0x7151('0x3'),'afterUpdate':_0x7151('0x4'),'afterDestroy':_0x7151('0x5')};function emitEvent(_0x3194b7){return function(_0x3f5bae,_0x355963,_0x7fd75b){MailQueueEvents[_0x7151('0x6')](_0x3194b7+':'+_0x3f5bae['id'],_0x3f5bae);MailQueueEvents[_0x7151('0x6')](_0x3194b7,_0x3f5bae);_0x7fd75b(null);};}for(var e in events){if(events[_0x7151('0x7')](e)){var event=events[e];MailQueue[_0x7151('0x8')](e,emitEvent(event));}}module[_0x7151('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 5e07482..04a17e6 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 _0x607e=['mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','exports','MailQueue'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0x607e,0x12d));var _0xe607=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x607e[_0x46efd7];return _0x5637e4;};'use strict';var _=require('lodash');var util=require(_0xe607('0x0'));var logger=require(_0xe607('0x1'))(_0xe607('0x2'));var moment=require(_0xe607('0x3'));var BPromise=require(_0xe607('0x4'));var rp=require(_0xe607('0x5'));var fs=require('fs');var path=require(_0xe607('0x6'));var rimraf=require(_0xe607('0x7'));var config=require('../../config/environment');var attributes=require(_0xe607('0x8'));module[_0xe607('0x9')]=function(_0x480975,_0x67ba9){return _0x480975['define'](_0xe607('0xa'),attributes,{'tableName':_0xe607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7f2=['exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailQueue.attributes'];(function(_0x4052c0,_0x4271ab){var _0x296f04=function(_0x5373fc){while(--_0x5373fc){_0x4052c0['push'](_0x4052c0['shift']());}};_0x296f04(++_0x4271ab);}(_0xa7f2,0xc7));var _0x2a7f=function(_0x3f889c,_0x1c16af){_0x3f889c=_0x3f889c-0x0;var _0x5edf2a=_0xa7f2[_0x3f889c];return _0x5edf2a;};'use strict';var _=require(_0x2a7f('0x0'));var util=require(_0x2a7f('0x1'));var logger=require(_0x2a7f('0x2'))(_0x2a7f('0x3'));var moment=require(_0x2a7f('0x4'));var BPromise=require(_0x2a7f('0x5'));var rp=require(_0x2a7f('0x6'));var fs=require('fs');var path=require(_0x2a7f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2a7f('0x8'));module[_0x2a7f('0x9')]=function(_0x5d0f62,_0x2c0c76){return _0x5d0f62[_0x2a7f('0xa')](_0x2a7f('0xb'),attributes,{'tableName':_0x2a7f('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 ce6debd..ed6200b 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 _0x2b2a=['MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetMailQueue','stringify','ShowMailQueue','find','util','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','./mailQueue.socket','register','then','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','MailQueue,\x20%s,\x20%s','info','result','catch'];(function(_0x287d93,_0x35c239){var _0x1d742a=function(_0x4cf55d){while(--_0x4cf55d){_0x287d93['push'](_0x287d93['shift']());}};_0x1d742a(++_0x35c239);}(_0x2b2a,0x149));var _0xa2b2=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x2b2a[_0x365be9];return _0x185c12;};'use strict';var _=require('lodash');var util=require(_0xa2b2('0x0'));var moment=require(_0xa2b2('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa2b2('0x3'));var logger=require(_0xa2b2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa2b2('0x5'));var client=jayson[_0xa2b2('0x6')][_0xa2b2('0x7')]({'port':0x232a});config[_0xa2b2('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa2b2('0x9'))[_0xa2b2('0xa')](socket);function respondWithRpcPromise(_0x512c9d,_0x2a2908,_0x34444a){return new BPromise(function(_0x50bb34,_0x459109){return client['request'](_0x512c9d,_0x34444a)[_0xa2b2('0xb')](function(_0x55fb72){logger['info']('MailQueue,\x20%s,\x20%s',_0x2a2908,_0xa2b2('0xc'));logger[_0xa2b2('0xd')](_0xa2b2('0xe'),_0x2a2908,_0xa2b2('0xc'),JSON['stringify'](_0x55fb72));if(_0x55fb72[_0xa2b2('0xf')]){if(_0x55fb72[_0xa2b2('0xf')]['code']===0x1f4){logger[_0xa2b2('0xf')]('MailQueue,\x20%s,\x20%s',_0x2a2908,_0x55fb72['error'][_0xa2b2('0x10')]);return _0x459109(_0x55fb72[_0xa2b2('0xf')][_0xa2b2('0x10')]);}logger[_0xa2b2('0xf')](_0xa2b2('0x11'),_0x2a2908,_0x55fb72['error'][_0xa2b2('0x10')]);return _0x50bb34(_0x55fb72[_0xa2b2('0xf')][_0xa2b2('0x10')]);}else{logger[_0xa2b2('0x12')](_0xa2b2('0x11'),_0x2a2908,_0xa2b2('0xc'));_0x50bb34(_0x55fb72[_0xa2b2('0x13')][_0xa2b2('0x10')]);}})[_0xa2b2('0x14')](function(_0x1f7d7a){logger['error'](_0xa2b2('0x11'),_0x2a2908,_0x1f7d7a);_0x459109(_0x1f7d7a);});});}exports['GetMailQueue']=function(_0x32ad9e){var _0x112015=this;return new Promise(function(_0x16f329,_0x4bdcb9){return db[_0xa2b2('0x15')][_0xa2b2('0x16')]({'raw':_0x32ad9e[_0xa2b2('0x17')]?_0x32ad9e['options'][_0xa2b2('0x18')]===undefined?!![]:![]:!![],'where':_0x32ad9e[_0xa2b2('0x17')]?_0x32ad9e[_0xa2b2('0x17')][_0xa2b2('0x19')]||null:null,'attributes':_0x32ad9e[_0xa2b2('0x17')]?_0x32ad9e['options'][_0xa2b2('0x1a')]||null:null,'limit':_0x32ad9e[_0xa2b2('0x17')]?_0x32ad9e[_0xa2b2('0x17')][_0xa2b2('0x1b')]||null:null,'include':_0x32ad9e['options']?_0x32ad9e[_0xa2b2('0x17')][_0xa2b2('0x1c')]?_[_0xa2b2('0x1d')](_0x32ad9e[_0xa2b2('0x17')][_0xa2b2('0x1c')],function(_0x180b1e){return{'model':db[_0x180b1e[_0xa2b2('0x1e')]],'as':_0x180b1e['as'],'attributes':_0x180b1e[_0xa2b2('0x1a')],'include':_0x180b1e['include']?_[_0xa2b2('0x1d')](_0x180b1e['include'],function(_0x596d7f){return{'model':db[_0x596d7f[_0xa2b2('0x1e')]],'as':_0x596d7f['as'],'attributes':_0x596d7f[_0xa2b2('0x1a')],'include':_0x596d7f['include']?_[_0xa2b2('0x1d')](_0x596d7f[_0xa2b2('0x1c')],function(_0xc7545e){return{'model':db[_0xc7545e['model']],'as':_0xc7545e['as'],'attributes':_0xc7545e[_0xa2b2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa2b2('0xb')](function(_0x3f6c6b){logger[_0xa2b2('0x12')]('GetMailQueue',_0x32ad9e);logger[_0xa2b2('0xd')](_0xa2b2('0x1f'),_0x32ad9e,JSON[_0xa2b2('0x20')](_0x3f6c6b));_0x16f329(_0x3f6c6b);})[_0xa2b2('0x14')](function(_0x50cc7f){logger[_0xa2b2('0xf')]('GetMailQueue',_0x50cc7f['message'],_0x32ad9e);_0x4bdcb9(_0x112015['error'](0x1f4,_0x50cc7f[_0xa2b2('0x10')]));});});};exports[_0xa2b2('0x21')]=function(_0x34abac){var _0x595ae4=this;return new Promise(function(_0x410a7c,_0x53ce29){return db[_0xa2b2('0x15')][_0xa2b2('0x22')]({'raw':_0x34abac[_0xa2b2('0x17')]?_0x34abac[_0xa2b2('0x17')][_0xa2b2('0x18')]===undefined?!![]:![]:!![],'where':_0x34abac[_0xa2b2('0x17')]?_0x34abac['options']['where']||null:null,'attributes':_0x34abac[_0xa2b2('0x17')]?_0x34abac['options']['attributes']||null:null,'include':_0x34abac['options']?_0x34abac['options'][_0xa2b2('0x1c')]?_[_0xa2b2('0x1d')](_0x34abac[_0xa2b2('0x17')][_0xa2b2('0x1c')],function(_0x76a0d0){return{'model':db[_0x76a0d0[_0xa2b2('0x1e')]],'as':_0x76a0d0['as'],'attributes':_0x76a0d0['attributes'],'include':_0x76a0d0[_0xa2b2('0x1c')]?_[_0xa2b2('0x1d')](_0x76a0d0[_0xa2b2('0x1c')],function(_0x18707c){return{'model':db[_0x18707c['model']],'as':_0x18707c['as'],'attributes':_0x18707c[_0xa2b2('0x1a')],'include':_0x18707c[_0xa2b2('0x1c')]?_['map'](_0x18707c[_0xa2b2('0x1c')],function(_0x25fc87){return{'model':db[_0x25fc87[_0xa2b2('0x1e')]],'as':_0x25fc87['as'],'attributes':_0x25fc87[_0xa2b2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16e1dc){logger[_0xa2b2('0x12')](_0xa2b2('0x21'),_0x34abac);logger['debug'](_0xa2b2('0x21'),_0x34abac,JSON['stringify'](_0x16e1dc));_0x410a7c(_0x16e1dc);})[_0xa2b2('0x14')](function(_0x412e8e){logger[_0xa2b2('0xf')](_0xa2b2('0x21'),_0x412e8e[_0xa2b2('0x10')],_0x34abac);_0x53ce29(_0x595ae4['error'](0x1f4,_0x412e8e[_0xa2b2('0x10')]));});});}; \ No newline at end of file +var _0x6de8=['socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s','message','result','catch','MailQueue','options','raw','where','attributes','limit','include','model','map','GetMailQueue','ShowMailQueue','find','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x1a20b5,_0x265db5){var _0x2efdaf=function(_0x279cd9){while(--_0x279cd9){_0x1a20b5['push'](_0x1a20b5['shift']());}};_0x2efdaf(++_0x265db5);}(_0x6de8,0x183));var _0x86de=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x6de8[_0x43444b];return _0x392fe5;};'use strict';var _=require(_0x86de('0x0'));var util=require('util');var moment=require(_0x86de('0x1'));var BPromise=require(_0x86de('0x2'));var rs=require(_0x86de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x86de('0x4'));var logger=require(_0x86de('0x5'))(_0x86de('0x6'));var config=require(_0x86de('0x7'));var jayson=require(_0x86de('0x8'));var client=jayson[_0x86de('0x9')][_0x86de('0xa')]({'port':0x232a});config[_0x86de('0xb')]=_['defaults'](config[_0x86de('0xb')],{'host':_0x86de('0xc'),'port':0x18eb});var socket=require(_0x86de('0xd'))(new Redis(config[_0x86de('0xb')]));require(_0x86de('0xe'))[_0x86de('0xf')](socket);function respondWithRpcPromise(_0x5b6ae2,_0x2d0d63,_0x1f80eb){return new BPromise(function(_0xf849d2,_0x151e0a){return client[_0x86de('0x10')](_0x5b6ae2,_0x1f80eb)[_0x86de('0x11')](function(_0x969e64){logger[_0x86de('0x12')]('MailQueue,\x20%s,\x20%s',_0x2d0d63,_0x86de('0x13'));logger[_0x86de('0x14')](_0x86de('0x15'),_0x2d0d63,_0x86de('0x13'),JSON[_0x86de('0x16')](_0x969e64));if(_0x969e64['error']){if(_0x969e64[_0x86de('0x17')]['code']===0x1f4){logger['error'](_0x86de('0x18'),_0x2d0d63,_0x969e64['error'][_0x86de('0x19')]);return _0x151e0a(_0x969e64['error']['message']);}logger[_0x86de('0x17')]('MailQueue,\x20%s,\x20%s',_0x2d0d63,_0x969e64['error'][_0x86de('0x19')]);return _0xf849d2(_0x969e64[_0x86de('0x17')][_0x86de('0x19')]);}else{logger[_0x86de('0x12')](_0x86de('0x18'),_0x2d0d63,_0x86de('0x13'));_0xf849d2(_0x969e64[_0x86de('0x1a')][_0x86de('0x19')]);}})[_0x86de('0x1b')](function(_0x10350b){logger['error'](_0x86de('0x18'),_0x2d0d63,_0x10350b);_0x151e0a(_0x10350b);});});}exports['GetMailQueue']=function(_0x50659d){var _0x3e39e8=this;return new Promise(function(_0x4ab6a9,_0x56f3a6){return db[_0x86de('0x1c')]['findAll']({'raw':_0x50659d[_0x86de('0x1d')]?_0x50659d[_0x86de('0x1d')][_0x86de('0x1e')]===undefined?!![]:![]:!![],'where':_0x50659d['options']?_0x50659d[_0x86de('0x1d')][_0x86de('0x1f')]||null:null,'attributes':_0x50659d['options']?_0x50659d[_0x86de('0x1d')][_0x86de('0x20')]||null:null,'limit':_0x50659d[_0x86de('0x1d')]?_0x50659d['options'][_0x86de('0x21')]||null:null,'include':_0x50659d[_0x86de('0x1d')]?_0x50659d['options'][_0x86de('0x22')]?_['map'](_0x50659d[_0x86de('0x1d')]['include'],function(_0x1e41cf){return{'model':db[_0x1e41cf[_0x86de('0x23')]],'as':_0x1e41cf['as'],'attributes':_0x1e41cf[_0x86de('0x20')],'include':_0x1e41cf[_0x86de('0x22')]?_[_0x86de('0x24')](_0x1e41cf['include'],function(_0x3d7313){return{'model':db[_0x3d7313[_0x86de('0x23')]],'as':_0x3d7313['as'],'attributes':_0x3d7313[_0x86de('0x20')],'include':_0x3d7313['include']?_['map'](_0x3d7313[_0x86de('0x22')],function(_0x5e3591){return{'model':db[_0x5e3591[_0x86de('0x23')]],'as':_0x5e3591['as'],'attributes':_0x5e3591[_0x86de('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ee22f){logger[_0x86de('0x12')](_0x86de('0x25'),_0x50659d);logger[_0x86de('0x14')](_0x86de('0x25'),_0x50659d,JSON[_0x86de('0x16')](_0x4ee22f));_0x4ab6a9(_0x4ee22f);})[_0x86de('0x1b')](function(_0x556794){logger[_0x86de('0x17')](_0x86de('0x25'),_0x556794[_0x86de('0x19')],_0x50659d);_0x56f3a6(_0x3e39e8[_0x86de('0x17')](0x1f4,_0x556794['message']));});});};exports[_0x86de('0x26')]=function(_0x30cafe){var _0x41842f=this;return new Promise(function(_0x2fc341,_0x233581){return db[_0x86de('0x1c')][_0x86de('0x27')]({'raw':_0x30cafe['options']?_0x30cafe[_0x86de('0x1d')][_0x86de('0x1e')]===undefined?!![]:![]:!![],'where':_0x30cafe[_0x86de('0x1d')]?_0x30cafe[_0x86de('0x1d')][_0x86de('0x1f')]||null:null,'attributes':_0x30cafe[_0x86de('0x1d')]?_0x30cafe[_0x86de('0x1d')][_0x86de('0x20')]||null:null,'include':_0x30cafe[_0x86de('0x1d')]?_0x30cafe[_0x86de('0x1d')][_0x86de('0x22')]?_[_0x86de('0x24')](_0x30cafe[_0x86de('0x1d')][_0x86de('0x22')],function(_0x3aff7c){return{'model':db[_0x3aff7c[_0x86de('0x23')]],'as':_0x3aff7c['as'],'attributes':_0x3aff7c['attributes'],'include':_0x3aff7c[_0x86de('0x22')]?_[_0x86de('0x24')](_0x3aff7c[_0x86de('0x22')],function(_0x3b7322){return{'model':db[_0x3b7322[_0x86de('0x23')]],'as':_0x3b7322['as'],'attributes':_0x3b7322[_0x86de('0x20')],'include':_0x3b7322[_0x86de('0x22')]?_[_0x86de('0x24')](_0x3b7322[_0x86de('0x22')],function(_0x5b8306){return{'model':db[_0x5b8306['model']],'as':_0x5b8306['as'],'attributes':_0x5b8306[_0x86de('0x20')]};}):[]};}):[]};}):[]:[]})[_0x86de('0x11')](function(_0x377f74){logger[_0x86de('0x12')](_0x86de('0x26'),_0x30cafe);logger[_0x86de('0x14')](_0x86de('0x26'),_0x30cafe,JSON[_0x86de('0x16')](_0x377f74));_0x2fc341(_0x377f74);})[_0x86de('0x1b')](function(_0x224d74){logger[_0x86de('0x17')]('ShowMailQueue',_0x224d74[_0x86de('0x19')],_0x30cafe);_0x233581(_0x41842f[_0x86de('0x17')](0x1f4,_0x224d74[_0x86de('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c0d9cf3..44b34bd 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 _0xd1d3=['remove','emit','removeListener','register','mailQueue:','./mailQueue.events'];(function(_0x5875ad,_0x3597b8){var _0x32a922=function(_0x2175fd){while(--_0x2175fd){_0x5875ad['push'](_0x5875ad['shift']());}};_0x32a922(++_0x3597b8);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x41dcb8,_0x54d0a1){_0x41dcb8=_0x41dcb8-0x0;var _0x434e9b=_0xd1d3[_0x41dcb8];return _0x434e9b;};'use strict';var MailQueueEvents=require(_0x3d1d('0x0'));var events=['save',_0x3d1d('0x1'),'update'];function createListener(_0xf27386,_0x1cd63f){return function(_0x42446a){_0x1cd63f[_0x3d1d('0x2')](_0xf27386,_0x42446a);};}function removeListener(_0x11cf6f,_0x4dc427){return function(){MailQueueEvents[_0x3d1d('0x3')](_0x11cf6f,_0x4dc427);};}exports[_0x3d1d('0x4')]=function(_0x55c165){for(var _0x2d3a52=0x0,_0x4431f6=events['length'];_0x2d3a52<_0x4431f6;_0x2d3a52++){var _0x160c87=events[_0x2d3a52];var _0x70ca94=createListener(_0x3d1d('0x5')+_0x160c87,_0x55c165);MailQueueEvents['on'](_0x160c87,_0x70ca94);}}; \ No newline at end of file +var _0x920b=['update','emit','removeListener','register','mailQueue:','./mailQueue.events','save','remove'];(function(_0x1495a1,_0x1db63e){var _0x1fb7c9=function(_0x5b667a){while(--_0x5b667a){_0x1495a1['push'](_0x1495a1['shift']());}};_0x1fb7c9(++_0x1db63e);}(_0x920b,0x11d));var _0xb920=function(_0x1b8df7,_0x55256b){_0x1b8df7=_0x1b8df7-0x0;var _0x3dc277=_0x920b[_0x1b8df7];return _0x3dc277;};'use strict';var MailQueueEvents=require(_0xb920('0x0'));var events=[_0xb920('0x1'),_0xb920('0x2'),_0xb920('0x3')];function createListener(_0x48c792,_0x149aa4){return function(_0x19c80f){_0x149aa4[_0xb920('0x4')](_0x48c792,_0x19c80f);};}function removeListener(_0x5c3f71,_0x208900){return function(){MailQueueEvents[_0xb920('0x5')](_0x5c3f71,_0x208900);};}exports[_0xb920('0x6')]=function(_0x75e15e){for(var _0x480383=0x0,_0x1ceebd=events['length'];_0x480383<_0x1ceebd;_0x480383++){var _0xc473b1=events[_0x480383];var _0xd802cf=createListener(_0xb920('0x7')+_0xc473b1,_0x75e15e);MailQueueEvents['on'](_0xc473b1,_0xd802cf);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index d5af98c..a72c7d1 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 _0x2884=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x5a4f3b,_0x344159){var _0x33e973=function(_0x2ff5b0){while(--_0x2ff5b0){_0x5a4f3b['push'](_0x5a4f3b['shift']());}};_0x33e973(++_0x344159);}(_0x2884,0x1ca));var _0x4288=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0x2884[_0x8cb2f9];return _0x164887;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4288('0x0'));var timeout=require(_0x4288('0x1'));var express=require(_0x4288('0x2'));var router=express[_0x4288('0x3')]();var fs_extra=require(_0x4288('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4288('0x5'));var config=require(_0x4288('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4288('0x7')]);router[_0x4288('0x8')](_0x4288('0x9'),auth[_0x4288('0xa')](),controller[_0x4288('0xb')]);router[_0x4288('0x8')](_0x4288('0xc'),auth['isAuthenticated'](),controller[_0x4288('0xd')]);router['post']('/',auth[_0x4288('0xa')](),controller[_0x4288('0xe')]);router[_0x4288('0xf')](_0x4288('0xc'),auth[_0x4288('0xa')](),controller[_0x4288('0x10')]);router[_0x4288('0x11')](_0x4288('0xc'),auth[_0x4288('0xa')](),controller[_0x4288('0x12')]);module[_0x4288('0x13')]=router; \ No newline at end of file +var _0xcc7a=['index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x53e617,_0x207619){var _0x3987c7=function(_0x4f5b78){while(--_0x4f5b78){_0x53e617['push'](_0x53e617['shift']());}};_0x3987c7(++_0x207619);}(_0xcc7a,0x1ae));var _0xacc7=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0xcc7a[_0x427d3a];return _0xe5c521;};'use strict';var multer=require(_0xacc7('0x0'));var util=require(_0xacc7('0x1'));var path=require(_0xacc7('0x2'));var timeout=require(_0xacc7('0x3'));var express=require('express');var router=express[_0xacc7('0x4')]();var fs_extra=require(_0xacc7('0x5'));var auth=require(_0xacc7('0x6'));var interaction=require(_0xacc7('0x7'));var config=require(_0xacc7('0x8'));var controller=require(_0xacc7('0x9'));router[_0xacc7('0xa')]('/',auth['isAuthenticated'](),controller[_0xacc7('0xb')]);router[_0xacc7('0xa')](_0xacc7('0xc'),auth['isAuthenticated'](),controller[_0xacc7('0xd')]);router[_0xacc7('0xa')](_0xacc7('0xe'),auth[_0xacc7('0xf')](),controller[_0xacc7('0x10')]);router[_0xacc7('0x11')]('/',auth[_0xacc7('0xf')](),controller['create']);router[_0xacc7('0x12')]('/:id',auth[_0xacc7('0xf')](),controller[_0xacc7('0x13')]);router[_0xacc7('0x14')](_0xacc7('0xe'),auth[_0xacc7('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 5a05213..1523198 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 _0x032f=['exports','STRING','DATE','moment','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x032f,0x7b));var _0xf032=function(_0x1d01b3,_0x46af86){_0x1d01b3=_0x1d01b3-0x0;var _0x4ad0c0=_0x032f[_0x1d01b3];return _0x4ad0c0;};'use strict';var moment=require(_0xf032('0x0'));var Sequelize=require(_0xf032('0x1'));module[_0xf032('0x2')]={'uniqueid':{'type':Sequelize[_0xf032('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf032('0x4')]},'exitAt':{'type':Sequelize[_0xf032('0x4')]},'reason':{'type':Sequelize[_0xf032('0x3')]}}; \ No newline at end of file +var _0x12c5=['STRING','DATE','sequelize','exports'];(function(_0x59fe7b,_0x40de81){var _0x5beca1=function(_0x45f09){while(--_0x45f09){_0x59fe7b['push'](_0x59fe7b['shift']());}};_0x5beca1(++_0x40de81);}(_0x12c5,0xbe));var _0x512c=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x12c5[_0xd09668];return _0x68726;};'use strict';var moment=require('moment');var Sequelize=require(_0x512c('0x0'));module[_0x512c('0x1')]={'uniqueid':{'type':Sequelize[_0x512c('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x512c('0x3')]},'leaveAt':{'type':Sequelize[_0x512c('0x3')]},'acceptAt':{'type':Sequelize[_0x512c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index ccbdf50..106266d 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 _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','MailQueueReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x0598,0x92));var _0x8059=function(_0x2a75e5,_0x239ac9){_0x2a75e5=_0x2a75e5-0x0;var _0x5f46f9=_0x0598[_0x2a75e5];return _0x5f46f9;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['MailQueueReport']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':!![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['MailQueueReport'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,null));}; \ No newline at end of file +var _0xcf2f=['sort','pick','where','merge','VIRTUAL','filter','options','MailQueueReport','includeAll','include','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x366394,_0x8887e1){_0x366394=_0x366394-0x0;var _0x2cf598=_0xcf2f[_0x366394];return _0x2cf598;};'use strict';var emlformat=require(_0xfcf2('0x0'));var rimraf=require(_0xfcf2('0x1'));var zipdir=require(_0xfcf2('0x2'));var jsonpatch=require(_0xfcf2('0x3'));var rp=require(_0xfcf2('0x4'));var moment=require('moment');var BPromise=require(_0xfcf2('0x5'));var Mustache=require(_0xfcf2('0x6'));var util=require(_0xfcf2('0x7'));var path=require(_0xfcf2('0x8'));var sox=require(_0xfcf2('0x9'));var csv=require(_0xfcf2('0xa'));var ejs=require(_0xfcf2('0xb'));var fs=require('fs');var fs_extra=require(_0xfcf2('0xc'));var _=require(_0xfcf2('0xd'));var squel=require(_0xfcf2('0xe'));var crypto=require(_0xfcf2('0xf'));var jsforce=require(_0xfcf2('0x10'));var deskjs=require(_0xfcf2('0x11'));var toCsv=require(_0xfcf2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcf2('0x12'));var qs=require(_0xfcf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcf2('0x14'));var logger=require(_0xfcf2('0x15'))(_0xfcf2('0x16'));var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfcf2('0x18'))['db'];function respondWithStatusCode(_0x1ba610,_0x175ac9){_0x175ac9=_0x175ac9||0xcc;return function(_0x1be8cc){if(_0x1be8cc){return _0x1ba610['sendStatus'](_0x175ac9);}return _0x1ba610[_0xfcf2('0x19')](_0x175ac9)['end']();};}function respondWithResult(_0x5b414a,_0x5dc04b){_0x5dc04b=_0x5dc04b||0xc8;return function(_0xc87ff4){if(_0xc87ff4){return _0x5b414a['status'](_0x5dc04b)[_0xfcf2('0x1a')](_0xc87ff4);}};}function respondWithFilteredResult(_0x1febf8,_0x245f9a){return function(_0x21f7d1){if(_0x21f7d1){var _0x315b2f=typeof _0x245f9a[_0xfcf2('0x1b')]===_0xfcf2('0x1c')&&typeof _0x245f9a['limit']===_0xfcf2('0x1c');var _0x213125=_0x21f7d1[_0xfcf2('0x1d')];var _0x581d78=_0x315b2f?0x0:_0x245f9a[_0xfcf2('0x1b')];var _0x1b3c89=_0x315b2f?_0x21f7d1[_0xfcf2('0x1d')]:_0x245f9a[_0xfcf2('0x1b')]+_0x245f9a[_0xfcf2('0x1e')];var _0x53c406;if(_0x1b3c89>=_0x213125){_0x1b3c89=_0x213125;_0x53c406=0xc8;}else{_0x53c406=0xce;}_0x1febf8[_0xfcf2('0x19')](_0x53c406);return _0x1febf8[_0xfcf2('0x1f')]('Content-Range',_0x581d78+'-'+_0x1b3c89+'/'+_0x213125)[_0xfcf2('0x1a')](_0x21f7d1);}return null;};}function patchUpdates(_0x23c079){return function(_0x206738){try{jsonpatch[_0xfcf2('0x20')](_0x206738,_0x23c079,!![]);}catch(_0x51e0b7){return BPromise[_0xfcf2('0x21')](_0x51e0b7);}return _0x206738[_0xfcf2('0x22')]();};}function saveUpdates(_0x422c5a,_0x1eeebd){return function(_0x5afab5){if(_0x5afab5){return _0x5afab5[_0xfcf2('0x23')](_0x422c5a)[_0xfcf2('0x24')](function(_0x232f6f){return _0x232f6f;});}return null;};}function removeEntity(_0x584e76,_0x26641a){return function(_0x151aa8){if(_0x151aa8){return _0x151aa8['destroy']()[_0xfcf2('0x24')](function(){_0x584e76[_0xfcf2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6f14,_0x26bfcc){return function(_0x1f0f07){if(!_0x1f0f07){_0x1e6f14[_0xfcf2('0x25')](0x194);}return _0x1f0f07;};}function handleError(_0x5bb384,_0x1deca3){_0x1deca3=_0x1deca3||0x1f4;return function(_0x448222){logger[_0xfcf2('0x26')](_0x448222[_0xfcf2('0x27')]);if(_0x448222[_0xfcf2('0x28')]){delete _0x448222[_0xfcf2('0x28')];}_0x5bb384[_0xfcf2('0x19')](_0x1deca3)[_0xfcf2('0x29')](_0x448222);};}exports[_0xfcf2('0x2a')]=function(_0x56f839,_0x4c2935){var _0x695f31={},_0x878504={},_0x3308c3={'count':0x0,'rows':[]};var _0x532db6=_[_0xfcf2('0x2b')](db['MailQueueReport'][_0xfcf2('0x2c')],function(_0x26651e){return{'name':_0x26651e[_0xfcf2('0x2d')],'type':_0x26651e[_0xfcf2('0x2e')][_0xfcf2('0x2f')]};});_0x878504[_0xfcf2('0x30')]=_[_0xfcf2('0x2b')](_0x532db6,'name');_0x878504['query']=_[_0xfcf2('0x31')](_0x56f839[_0xfcf2('0x32')]);_0x878504[_0xfcf2('0x33')]=_[_0xfcf2('0x34')](_0x878504['model'],_0x878504['query']);_0x695f31[_0xfcf2('0x35')]=_['intersection'](_0x878504[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x56f839['query'][_0xfcf2('0x36')]));_0x695f31[_0xfcf2('0x35')]=_0x695f31[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x695f31[_0xfcf2('0x35')]:_0x878504[_0xfcf2('0x30')];if(!_0x56f839[_0xfcf2('0x32')]['hasOwnProperty'](_0xfcf2('0x38'))){_0x695f31[_0xfcf2('0x1e')]=qs['limit'](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x1e')]);_0x695f31['offset']=qs[_0xfcf2('0x1b')](_0x56f839[_0xfcf2('0x32')]['offset']);}_0x695f31[_0xfcf2('0x39')]=qs[_0xfcf2('0x3a')](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3a')]);_0x695f31['where']=qs[_0xfcf2('0x33')](_[_0xfcf2('0x3b')](_0x56f839[_0xfcf2('0x32')],_0x878504[_0xfcf2('0x33')]),_0x532db6);if(_0x56f839[_0xfcf2('0x32')]['filter']){_0x695f31[_0xfcf2('0x3c')]=_[_0xfcf2('0x3d')](_0x695f31[_0xfcf2('0x3c')],{'$or':_[_0xfcf2('0x2b')](_0x532db6,function(_0x41cac2){if(_0x41cac2['type']!==_0xfcf2('0x3e')){var _0x4dfc61={};_0x4dfc61[_0x41cac2[_0xfcf2('0x28')]]={'$like':'%'+_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3f')]+'%'};return _0x4dfc61;}})});}_0x695f31=_[_0xfcf2('0x3d')]({},_0x695f31,_0x56f839[_0xfcf2('0x40')]);var _0x59b404={'where':_0x695f31[_0xfcf2('0x3c')]};return db[_0xfcf2('0x41')][_0xfcf2('0x1d')](_0x59b404)['then'](function(_0x1e8e71){_0x3308c3[_0xfcf2('0x1d')]=_0x1e8e71;if(_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x695f31[_0xfcf2('0x43')]=[{'all':!![]}];}return db[_0xfcf2('0x41')]['findAll'](_0x695f31);})['then'](function(_0x526c42){_0x3308c3[_0xfcf2('0x44')]=_0x526c42;return _0x3308c3;})[_0xfcf2('0x24')](respondWithFilteredResult(_0x4c2935,_0x695f31))[_0xfcf2('0x45')](handleError(_0x4c2935,null));};exports['show']=function(_0x559aea,_0x5efb5c){var _0x3fb288={'raw':!![],'where':{'id':_0x559aea[_0xfcf2('0x46')]['id']}},_0xab0747={};_0xab0747[_0xfcf2('0x30')]=_[_0xfcf2('0x31')](db[_0xfcf2('0x41')][_0xfcf2('0x2c')]);_0xab0747[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](_0x559aea[_0xfcf2('0x32')]);_0xab0747[_0xfcf2('0x33')]=_['intersection'](_0xab0747['model'],_0xab0747[_0xfcf2('0x32')]);_0x3fb288[_0xfcf2('0x35')]=_[_0xfcf2('0x34')](_0xab0747[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x3fb288[_0xfcf2('0x35')]=_0x3fb288[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x3fb288[_0xfcf2('0x35')]:_0xab0747[_0xfcf2('0x30')];if(_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x3fb288[_0xfcf2('0x43')]=[{'all':!![]}];}_0x3fb288=_[_0xfcf2('0x3d')]({},_0x3fb288,_0x559aea[_0xfcf2('0x40')]);return db['MailQueueReport'][_0xfcf2('0x47')](_0x3fb288)[_0xfcf2('0x24')](handleEntityNotFound(_0x5efb5c,null))['then'](respondWithResult(_0x5efb5c,null))[_0xfcf2('0x45')](handleError(_0x5efb5c,null));};exports['create']=function(_0x12eef4,_0xe85e89){return db[_0xfcf2('0x41')][_0xfcf2('0x48')](_0x12eef4['body'],{})['then'](respondWithResult(_0xe85e89,0xc9))['catch'](handleError(_0xe85e89,null));};exports[_0xfcf2('0x23')]=function(_0x37d4bb,_0x20fcab){if(_0x37d4bb[_0xfcf2('0x49')]['id']){delete _0x37d4bb['body']['id'];}return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x37d4bb[_0xfcf2('0x46')]['id']}})['then'](handleEntityNotFound(_0x20fcab,null))[_0xfcf2('0x24')](saveUpdates(_0x37d4bb[_0xfcf2('0x49')],null))[_0xfcf2('0x24')](respondWithResult(_0x20fcab,null))[_0xfcf2('0x45')](handleError(_0x20fcab,null));};exports[_0xfcf2('0x4a')]=function(_0x4af270,_0x4c14d){return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x4af270[_0xfcf2('0x46')]['id']}})[_0xfcf2('0x24')](handleEntityNotFound(_0x4c14d,null))[_0xfcf2('0x24')](removeEntity(_0x4c14d,null))['catch'](handleError(_0x4c14d,null));};exports['describe']=function(_0x4aa02f,_0x37c8b4){return db[_0xfcf2('0x41')]['describe']()['then'](respondWithResult(_0x37c8b4,null))[_0xfcf2('0x45')](handleError(_0x37c8b4,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 4cd273e..78363da 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 _0xd39c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x34bbb9,_0x4866f9){var _0x39f790=function(_0x5d509a){while(--_0x5d509a){_0x34bbb9['push'](_0x34bbb9['shift']());}};_0x39f790(++_0x4866f9);}(_0xd39c,0xa8));var _0xcd39=function(_0x59f997,_0x286b85){_0x59f997=_0x59f997-0x0;var _0x16f217=_0xd39c[_0x59f997];return _0x16f217;};'use strict';var _=require('lodash');var util=require(_0xcd39('0x0'));var logger=require(_0xcd39('0x1'))(_0xcd39('0x2'));var moment=require(_0xcd39('0x3'));var BPromise=require(_0xcd39('0x4'));var rp=require(_0xcd39('0x5'));var fs=require('fs');var path=require(_0xcd39('0x6'));var rimraf=require(_0xcd39('0x7'));var config=require(_0xcd39('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0xcd39('0x9')]=function(_0x33fae1,_0x1d6753){return _0x33fae1[_0xcd39('0xa')](_0xcd39('0xb'),attributes,{'tableName':_0xcd39('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcd39('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ef7=['uniqueid','util','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x3921b1,_0x4969ff){var _0x588ae8=function(_0x4be954){while(--_0x4be954){_0x3921b1['push'](_0x3921b1['shift']());}};_0x588ae8(++_0x4969ff);}(_0x7ef7,0x91));var _0x77ef=function(_0x17b151,_0x3fab68){_0x17b151=_0x17b151-0x0;var _0x4b3a79=_0x7ef7[_0x17b151];return _0x4b3a79;};'use strict';var _=require('lodash');var util=require(_0x77ef('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x77ef('0x1'));var BPromise=require('bluebird');var rp=require(_0x77ef('0x2'));var fs=require('fs');var path=require(_0x77ef('0x3'));var rimraf=require(_0x77ef('0x4'));var config=require(_0x77ef('0x5'));var attributes=require(_0x77ef('0x6'));module[_0x77ef('0x7')]=function(_0xce66cb,_0x7f205){return _0xce66cb['define']('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x77ef('0x8'),'fields':[_0x77ef('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 43b045c..c7f331d 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x23d4be,_0x3d1ba9){var _0x1f7a8b=function(_0x5a6e64){while(--_0x5a6e64){_0x23d4be['push'](_0x23d4be['shift']());}};_0x1f7a8b(++_0x3d1ba9);}(_0x7a54,0x106));var _0x47a5=function(_0x2c45c3,_0x5d38cc){_0x2c45c3=_0x2c45c3-0x0;var _0x309e2e=_0x7a54[_0x2c45c3];return _0x309e2e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x3df870,_0x32e29f){var _0x53e934=function(_0x5a636d){while(--_0x5a636d){_0x3df870['push'](_0x3df870['shift']());}};_0x53e934(++_0x32e29f);}(_0xdb28,0x106));var _0x8db2=function(_0x405455,_0x1a43f0){_0x405455=_0x405455-0x0;var _0x200e59=_0xdb28[_0x405455];return _0x200e59;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 05befb4..743b120 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1fdd3e,_0x2d7649){var _0xa64122=function(_0x3761de){while(--_0x3761de){_0x1fdd3e['push'](_0x1fdd3e['shift']());}};_0xa64122(++_0x2d7649);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0xcb91[_0x2e58c7];return _0x26eb00;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3b660f,_0x45c3db){var _0x187a29=function(_0x11cedf){while(--_0x11cedf){_0x3b660f['push'](_0x3b660f['shift']());}};_0x187a29(++_0x45c3db);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 398097c..4093f25 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 _0x0599=['STRING','BOOLEAN','INTEGER'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0599,0x120));var _0x9059=function(_0x51e48b,_0x4f6556){_0x51e48b=_0x51e48b-0x0;var _0x28773b=_0x0599[_0x51e48b];return _0x28773b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9059('0x0')]},'authentication':{'type':Sequelize[_0x9059('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9059('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9059('0x2')]},'tls':{'type':Sequelize[_0x9059('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9059('0x0')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x9059('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9059('0x2')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x9059('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xa635=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x58ed84,_0x2ac5aa){var _0x27b770=function(_0x1bcb27){while(--_0x1bcb27){_0x58ed84['push'](_0x58ed84['shift']());}};_0x27b770(++_0x2ac5aa);}(_0xa635,0x73));var _0x5a63=function(_0x1e2da4,_0x32e346){_0x1e2da4=_0x1e2da4-0x0;var _0x1a5b82=_0xa635[_0x1e2da4];return _0x1a5b82;};'use strict';var Sequelize=require(_0x5a63('0x0'));module[_0x5a63('0x1')]={'description':{'type':Sequelize[_0x5a63('0x2')]},'host':{'type':Sequelize[_0x5a63('0x2')]},'authentication':{'type':Sequelize[_0x5a63('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x5a63('0x2')]},'password':{'type':Sequelize[_0x5a63('0x2')]},'port':{'type':Sequelize[_0x5a63('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x5a63('0x2')],'defaultValue':_0x5a63('0x5')},'connTimeout':{'type':Sequelize[_0x5a63('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x5a63('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 61f4b1b..2cf5b45 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 _0x5a4b=['request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird'];(function(_0x15a069,_0x5cf6cc){var _0x2eb71d=function(_0x1b35a2){while(--_0x1b35a2){_0x15a069['push'](_0x15a069['shift']());}};_0x2eb71d(++_0x5cf6cc);}(_0x5a4b,0xb1));var _0xb5a4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5a4b[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xb5a4('0x0'));var util=require(_0xb5a4('0x1'));var logger=require(_0xb5a4('0x2'))('api');var moment=require(_0xb5a4('0x3'));var BPromise=require(_0xb5a4('0x4'));var rp=require(_0xb5a4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5a4('0x6'));var config=require(_0xb5a4('0x7'));var attributes=require(_0xb5a4('0x8'));module[_0xb5a4('0x9')]=function(_0x535434,_0x3e1726){return _0x535434[_0xb5a4('0xa')](_0xb5a4('0xb'),attributes,{'tableName':_0xb5a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6b4=['../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4dcb1f,_0x1cd009){var _0x29a2e7=function(_0x328f27){while(--_0x328f27){_0x4dcb1f['push'](_0x4dcb1f['shift']());}};_0x29a2e7(++_0x1cd009);}(_0xf6b4,0xa1));var _0x4f6b=function(_0x538bd3,_0x1e3c75){_0x538bd3=_0x538bd3-0x0;var _0x5e2fd7=_0xf6b4[_0x538bd3];return _0x5e2fd7;};'use strict';var _=require(_0x4f6b('0x0'));var util=require(_0x4f6b('0x1'));var logger=require('../../config/logger')(_0x4f6b('0x2'));var moment=require(_0x4f6b('0x3'));var BPromise=require(_0x4f6b('0x4'));var rp=require(_0x4f6b('0x5'));var fs=require('fs');var path=require(_0x4f6b('0x6'));var rimraf=require(_0x4f6b('0x7'));var config=require(_0x4f6b('0x8'));var attributes=require(_0x4f6b('0x9'));module[_0x4f6b('0xa')]=function(_0x118f00,_0x11b328){return _0x118f00['define'](_0x4f6b('0xb'),attributes,{'tableName':_0x4f6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 868ee53..f651287 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 _0x067d=['message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit','map','include','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1201d6,_0xec67b7){var _0x47140f=function(_0x3c6b55){while(--_0x3c6b55){_0x1201d6['push'](_0x1201d6['shift']());}};_0x47140f(++_0xec67b7);}(_0x067d,0x1db));var _0xd067=function(_0x119880,_0x4f291f){_0x119880=_0x119880-0x0;var _0x4a1707=_0x067d[_0x119880];return _0x4a1707;};'use strict';var _=require(_0xd067('0x0'));var util=require(_0xd067('0x1'));var moment=require(_0xd067('0x2'));var BPromise=require(_0xd067('0x3'));var rs=require(_0xd067('0x4'));var fs=require('fs');var Redis=require(_0xd067('0x5'));var db=require(_0xd067('0x6'))['db'];var utils=require(_0xd067('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd067('0x8'));var jayson=require(_0xd067('0x9'));var client=jayson[_0xd067('0xa')][_0xd067('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x502739,_0x45f9b0,_0x1ec278){return new BPromise(function(_0x44d263,_0x1295f5){return client[_0xd067('0xc')](_0x502739,_0x1ec278)[_0xd067('0xd')](function(_0x132444){logger['info'](_0xd067('0xe'),_0x45f9b0,_0xd067('0xf'));logger[_0xd067('0x10')](_0xd067('0x11'),_0x45f9b0,_0xd067('0xf'),JSON['stringify'](_0x132444));if(_0x132444[_0xd067('0x12')]){if(_0x132444[_0xd067('0x12')][_0xd067('0x13')]===0x1f4){logger[_0xd067('0x12')](_0xd067('0xe'),_0x45f9b0,_0x132444[_0xd067('0x12')][_0xd067('0x14')]);return _0x1295f5(_0x132444[_0xd067('0x12')][_0xd067('0x14')]);}logger[_0xd067('0x12')](_0xd067('0xe'),_0x45f9b0,_0x132444['error'][_0xd067('0x14')]);return _0x44d263(_0x132444[_0xd067('0x12')][_0xd067('0x14')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x45f9b0,'request\x20sent');_0x44d263(_0x132444['result']['message']);}})[_0xd067('0x15')](function(_0x5bf2d5){logger[_0xd067('0x12')](_0xd067('0xe'),_0x45f9b0,_0x5bf2d5);_0x1295f5(_0x5bf2d5);});});}exports[_0xd067('0x16')]=function(_0xeefd2d){var _0x43096b=this;return new Promise(function(_0x36a6ca,_0x28669e){return db[_0xd067('0x17')][_0xd067('0x18')]({'raw':_0xeefd2d[_0xd067('0x19')]?_0xeefd2d['options'][_0xd067('0x1a')]===undefined?!![]:![]:!![],'where':_0xeefd2d['options']?_0xeefd2d[_0xd067('0x19')]['where']||null:null,'attributes':_0xeefd2d['options']?_0xeefd2d[_0xd067('0x19')]['attributes']||null:null,'limit':_0xeefd2d['options']?_0xeefd2d[_0xd067('0x19')][_0xd067('0x1b')]||null:null,'include':_0xeefd2d['options']?_0xeefd2d['options']['include']?_[_0xd067('0x1c')](_0xeefd2d[_0xd067('0x19')][_0xd067('0x1d')],function(_0x471d34){return{'model':db[_0x471d34[_0xd067('0x1e')]],'as':_0x471d34['as'],'attributes':_0x471d34['attributes'],'include':_0x471d34[_0xd067('0x1d')]?_['map'](_0x471d34['include'],function(_0x5b67c4){return{'model':db[_0x5b67c4[_0xd067('0x1e')]],'as':_0x5b67c4['as'],'attributes':_0x5b67c4['attributes'],'include':_0x5b67c4['include']?_[_0xd067('0x1c')](_0x5b67c4[_0xd067('0x1d')],function(_0x17503c){return{'model':db[_0x17503c['model']],'as':_0x17503c['as'],'attributes':_0x17503c[_0xd067('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x134e3e){logger['info']('GetMailServerIn',_0xeefd2d);logger[_0xd067('0x10')](_0xd067('0x16'),_0xeefd2d,JSON[_0xd067('0x20')](_0x134e3e));_0x36a6ca(_0x134e3e);})[_0xd067('0x15')](function(_0x22a872){logger[_0xd067('0x12')](_0xd067('0x16'),_0x22a872['message'],_0xeefd2d);_0x28669e(_0x43096b[_0xd067('0x12')](0x1f4,_0x22a872[_0xd067('0x14')]));});});}; \ No newline at end of file +var _0x2394=['include','map','model','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit'];(function(_0x5931ac,_0x58908c){var _0x54d6d1=function(_0x5662f1){while(--_0x5662f1){_0x5931ac['push'](_0x5931ac['shift']());}};_0x54d6d1(++_0x58908c);}(_0x2394,0x1f4));var _0x4239=function(_0x6e1b38,_0x3255a3){_0x6e1b38=_0x6e1b38-0x0;var _0x1d1fa8=_0x2394[_0x6e1b38];return _0x1d1fa8;};'use strict';var _=require(_0x4239('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4239('0x1'));var rs=require(_0x4239('0x2'));var fs=require('fs');var Redis=require(_0x4239('0x3'));var db=require(_0x4239('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4239('0x5'));var config=require(_0x4239('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4239('0x7')][_0x4239('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e9ff7,_0x49eaf3,_0x26b373){return new BPromise(function(_0x1307f3,_0x353c7a){return client[_0x4239('0x9')](_0x2e9ff7,_0x26b373)[_0x4239('0xa')](function(_0x2cd5b4){logger[_0x4239('0xb')](_0x4239('0xc'),_0x49eaf3,_0x4239('0xd'));logger['debug'](_0x4239('0xe'),_0x49eaf3,'request\x20sent',JSON[_0x4239('0xf')](_0x2cd5b4));if(_0x2cd5b4['error']){if(_0x2cd5b4[_0x4239('0x10')][_0x4239('0x11')]===0x1f4){logger['error'](_0x4239('0xc'),_0x49eaf3,_0x2cd5b4[_0x4239('0x10')][_0x4239('0x12')]);return _0x353c7a(_0x2cd5b4['error'][_0x4239('0x12')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x49eaf3,_0x2cd5b4['error'][_0x4239('0x12')]);return _0x1307f3(_0x2cd5b4[_0x4239('0x10')][_0x4239('0x12')]);}else{logger[_0x4239('0xb')]('MailServerIn,\x20%s,\x20%s',_0x49eaf3,_0x4239('0xd'));_0x1307f3(_0x2cd5b4['result'][_0x4239('0x12')]);}})[_0x4239('0x13')](function(_0x18a8e8){logger[_0x4239('0x10')]('MailServerIn,\x20%s,\x20%s',_0x49eaf3,_0x18a8e8);_0x353c7a(_0x18a8e8);});});}exports[_0x4239('0x14')]=function(_0x5d1c0b){var _0x3af647=this;return new Promise(function(_0x247c49,_0x33ce01){return db[_0x4239('0x15')]['findAll']({'raw':_0x5d1c0b[_0x4239('0x16')]?_0x5d1c0b['options'][_0x4239('0x17')]===undefined?!![]:![]:!![],'where':_0x5d1c0b[_0x4239('0x16')]?_0x5d1c0b[_0x4239('0x16')][_0x4239('0x18')]||null:null,'attributes':_0x5d1c0b['options']?_0x5d1c0b[_0x4239('0x16')][_0x4239('0x19')]||null:null,'limit':_0x5d1c0b[_0x4239('0x16')]?_0x5d1c0b[_0x4239('0x16')][_0x4239('0x1a')]||null:null,'include':_0x5d1c0b[_0x4239('0x16')]?_0x5d1c0b['options'][_0x4239('0x1b')]?_[_0x4239('0x1c')](_0x5d1c0b[_0x4239('0x16')][_0x4239('0x1b')],function(_0x2f920f){return{'model':db[_0x2f920f[_0x4239('0x1d')]],'as':_0x2f920f['as'],'attributes':_0x2f920f[_0x4239('0x19')],'include':_0x2f920f['include']?_[_0x4239('0x1c')](_0x2f920f['include'],function(_0x1e2e10){return{'model':db[_0x1e2e10[_0x4239('0x1d')]],'as':_0x1e2e10['as'],'attributes':_0x1e2e10[_0x4239('0x19')],'include':_0x1e2e10[_0x4239('0x1b')]?_[_0x4239('0x1c')](_0x1e2e10[_0x4239('0x1b')],function(_0x2e6660){return{'model':db[_0x2e6660[_0x4239('0x1d')]],'as':_0x2e6660['as'],'attributes':_0x2e6660[_0x4239('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4239('0xa')](function(_0x4252af){logger[_0x4239('0xb')]('GetMailServerIn',_0x5d1c0b);logger[_0x4239('0x1e')](_0x4239('0x14'),_0x5d1c0b,JSON[_0x4239('0xf')](_0x4252af));_0x247c49(_0x4252af);})[_0x4239('0x13')](function(_0x1e1cb3){logger[_0x4239('0x10')](_0x4239('0x14'),_0x1e1cb3[_0x4239('0x12')],_0x5d1c0b);_0x33ce01(_0x3af647[_0x4239('0x10')](0x1f4,_0x1e1cb3[_0x4239('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 2806162..4b9a612 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(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7a54,0x106));var _0x47a5=function(_0x455a43,_0x21edd0){_0x455a43=_0x455a43-0x0;var _0x334e5e=_0x7a54[_0x455a43];return _0x334e5e;};'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(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a54,0x106));var _0x47a5=function(_0x1f6f1f,_0x395b2c){_0x1f6f1f=_0x1f6f1f-0x0;var _0x1a65e9=_0x7a54[_0x1f6f1f];return _0x1a65e9;};'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 d9fe729..0d212c5 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 _0xa902=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x114bc0,_0x449b07){var _0x168172=function(_0xb1b1cf){while(--_0xb1b1cf){_0x114bc0['push'](_0x114bc0['shift']());}};_0x168172(++_0x449b07);}(_0xa902,0x8d));var _0x2a90=function(_0x49f796,_0x48db73){_0x49f796=_0x49f796-0x0;var _0x14b78e=_0xa902[_0x49f796];return _0x14b78e;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'description':{'type':Sequelize[_0x2a90('0x2')]},'host':{'type':Sequelize[_0x2a90('0x2')]},'user':{'type':Sequelize[_0x2a90('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2a90('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x2a90('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2a90('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x1eba=['exports','STRING','BOOLEAN','sequelize'];(function(_0x14b123,_0x3986be){var _0x53db8e=function(_0x44e9dc){while(--_0x44e9dc){_0x14b123['push'](_0x14b123['shift']());}};_0x53db8e(++_0x3986be);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x1eba[_0x17406e];return _0x2bfc5a;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'description':{'type':Sequelize[_0xa1eb('0x2')]},'host':{'type':Sequelize[_0xa1eb('0x2')]},'user':{'type':Sequelize[_0xa1eb('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xa1eb('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa1eb('0x2')]},'authentication':{'type':Sequelize[_0xa1eb('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xa1eb('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 28f8bcb..2d936f8 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 _0x9142=['mustache','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','MailServerOut','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','rows','show','params','length','includeAll','include','options','create','catch','body','find','rimraf','zip-dir','moment'];(function(_0x36a560,_0x57378b){var _0x10923a=function(_0xd1fa18){while(--_0xd1fa18){_0x36a560['push'](_0x36a560['shift']());}};_0x10923a(++_0x57378b);}(_0x9142,0xdb));var _0x2914=function(_0x23c352,_0x441970){_0x23c352=_0x23c352-0x0;var _0x568b44=_0x9142[_0x23c352];return _0x568b44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2914('0x0'));var zipdir=require(_0x2914('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2914('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2914('0x3'));var util=require(_0x2914('0x4'));var path=require('path');var sox=require(_0x2914('0x5'));var csv=require(_0x2914('0x6'));var ejs=require(_0x2914('0x7'));var fs=require('fs');var fs_extra=require(_0x2914('0x8'));var _=require(_0x2914('0x9'));var squel=require('squel');var crypto=require(_0x2914('0xa'));var jsforce=require(_0x2914('0xb'));var deskjs=require(_0x2914('0xc'));var toCsv=require(_0x2914('0x6'));var querystring=require(_0x2914('0xd'));var Papa=require(_0x2914('0xe'));var Redis=require(_0x2914('0xf'));var authService=require(_0x2914('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2914('0x11'));var hardwareService=require(_0x2914('0x12'));var logger=require(_0x2914('0x13'))(_0x2914('0x14'));var utils=require('../../config/utils');var config=require(_0x2914('0x15'));var licenseUtil=require(_0x2914('0x16'));var db=require(_0x2914('0x17'))['db'];function respondWithStatusCode(_0x5eda96,_0x28c95e){_0x28c95e=_0x28c95e||0xcc;return function(_0x591844){if(_0x591844){return _0x5eda96[_0x2914('0x18')](_0x28c95e);}return _0x5eda96[_0x2914('0x19')](_0x28c95e)[_0x2914('0x1a')]();};}function respondWithResult(_0x5b2856,_0x44b5ed){_0x44b5ed=_0x44b5ed||0xc8;return function(_0x15c452){if(_0x15c452){return _0x5b2856[_0x2914('0x19')](_0x44b5ed)[_0x2914('0x1b')](_0x15c452);}};}function respondWithFilteredResult(_0x320d94,_0x441ce7){return function(_0x5333f1){if(_0x5333f1){var _0x155a7a=typeof _0x441ce7[_0x2914('0x1c')]===_0x2914('0x1d')&&typeof _0x441ce7[_0x2914('0x1e')]===_0x2914('0x1d');var _0x5331bd=_0x5333f1[_0x2914('0x1f')];var _0xa345f9=_0x155a7a?0x0:_0x441ce7[_0x2914('0x1c')];var _0x3a397e=_0x155a7a?_0x5333f1['count']:_0x441ce7[_0x2914('0x1c')]+_0x441ce7[_0x2914('0x1e')];var _0x1fb207;if(_0x3a397e>=_0x5331bd){_0x3a397e=_0x5331bd;_0x1fb207=0xc8;}else{_0x1fb207=0xce;}_0x320d94[_0x2914('0x19')](_0x1fb207);return _0x320d94[_0x2914('0x20')]('Content-Range',_0xa345f9+'-'+_0x3a397e+'/'+_0x5331bd)[_0x2914('0x1b')](_0x5333f1);}return null;};}function patchUpdates(_0x109519){return function(_0xde8dce){try{jsonpatch[_0x2914('0x21')](_0xde8dce,_0x109519,!![]);}catch(_0x3c984e){return BPromise[_0x2914('0x22')](_0x3c984e);}return _0xde8dce[_0x2914('0x23')]();};}function saveUpdates(_0x159414,_0x157db8){return function(_0x3819fa){if(_0x3819fa){return _0x3819fa[_0x2914('0x24')](_0x159414)[_0x2914('0x25')](function(_0x46ee2f){return _0x46ee2f;});}return null;};}function removeEntity(_0x127efb,_0x30c391){return function(_0x8c3630){if(_0x8c3630){return _0x8c3630[_0x2914('0x26')]()[_0x2914('0x25')](function(){_0x127efb[_0x2914('0x19')](0xcc)[_0x2914('0x1a')]();});}};}function handleEntityNotFound(_0x5884ed,_0x18c392){return function(_0x1f6093){if(!_0x1f6093){_0x5884ed[_0x2914('0x18')](0x194);}return _0x1f6093;};}function handleError(_0x1d6872,_0xe697f9){_0xe697f9=_0xe697f9||0x1f4;return function(_0x276d39){logger[_0x2914('0x27')](_0x276d39[_0x2914('0x28')]);if(_0x276d39[_0x2914('0x29')]){delete _0x276d39[_0x2914('0x29')];}_0x1d6872[_0x2914('0x19')](_0xe697f9)['send'](_0x276d39);};}exports[_0x2914('0x2a')]=function(_0x190395,_0x4c9f22){var _0x58d60f={},_0x195fc3={},_0x28ad3a={'count':0x0,'rows':[]};var _0x420fae=_['map'](db[_0x2914('0x2b')][_0x2914('0x2c')],function(_0x314fa2){return{'name':_0x314fa2[_0x2914('0x2d')],'type':_0x314fa2[_0x2914('0x2e')][_0x2914('0x2f')]};});_0x195fc3[_0x2914('0x30')]=_[_0x2914('0x31')](_0x420fae,_0x2914('0x29'));_0x195fc3['query']=_[_0x2914('0x32')](_0x190395[_0x2914('0x33')]);_0x195fc3[_0x2914('0x34')]=_[_0x2914('0x35')](_0x195fc3[_0x2914('0x30')],_0x195fc3['query']);_0x58d60f[_0x2914('0x36')]=_['intersection'](_0x195fc3['model'],qs['fields'](_0x190395[_0x2914('0x33')][_0x2914('0x37')]));_0x58d60f[_0x2914('0x36')]=_0x58d60f[_0x2914('0x36')]['length']?_0x58d60f['attributes']:_0x195fc3[_0x2914('0x30')];if(!_0x190395[_0x2914('0x33')][_0x2914('0x38')](_0x2914('0x39'))){_0x58d60f[_0x2914('0x1e')]=qs[_0x2914('0x1e')](_0x190395[_0x2914('0x33')][_0x2914('0x1e')]);_0x58d60f['offset']=qs[_0x2914('0x1c')](_0x190395[_0x2914('0x33')][_0x2914('0x1c')]);}_0x58d60f[_0x2914('0x3a')]=qs[_0x2914('0x3b')](_0x190395[_0x2914('0x33')]['sort']);_0x58d60f[_0x2914('0x3c')]=qs[_0x2914('0x34')](_['pick'](_0x190395[_0x2914('0x33')],_0x195fc3[_0x2914('0x34')]),_0x420fae);if(_0x190395['query'][_0x2914('0x3d')]){_0x58d60f['where']=_[_0x2914('0x3e')](_0x58d60f[_0x2914('0x3c')],{'$or':_[_0x2914('0x31')](_0x420fae,function(_0x3156ad){if(_0x3156ad[_0x2914('0x2e')]!=='VIRTUAL'){var _0x2dcfa7={};_0x2dcfa7[_0x3156ad[_0x2914('0x29')]]={'$like':'%'+_0x190395[_0x2914('0x33')][_0x2914('0x3d')]+'%'};return _0x2dcfa7;}})});}_0x58d60f=_['merge']({},_0x58d60f,_0x190395['options']);var _0x3b3a8c={'where':_0x58d60f[_0x2914('0x3c')]};return db[_0x2914('0x2b')]['count'](_0x3b3a8c)['then'](function(_0x5bfa61){_0x28ad3a['count']=_0x5bfa61;if(_0x190395[_0x2914('0x33')]['includeAll']){_0x58d60f['include']=[{'all':!![]}];}return db[_0x2914('0x2b')]['findAll'](_0x58d60f);})[_0x2914('0x25')](function(_0x5983e0){_0x28ad3a[_0x2914('0x3f')]=_0x5983e0;return _0x28ad3a;})[_0x2914('0x25')](respondWithFilteredResult(_0x4c9f22,_0x58d60f))['catch'](handleError(_0x4c9f22,null));};exports[_0x2914('0x40')]=function(_0x1f6eae,_0x2bbca3){var _0xf857db={'raw':!![],'where':{'id':_0x1f6eae[_0x2914('0x41')]['id']}},_0x29aa10={};_0x29aa10[_0x2914('0x30')]=_['keys'](db['MailServerOut']['rawAttributes']);_0x29aa10[_0x2914('0x33')]=_[_0x2914('0x32')](_0x1f6eae[_0x2914('0x33')]);_0x29aa10[_0x2914('0x34')]=_[_0x2914('0x35')](_0x29aa10[_0x2914('0x30')],_0x29aa10[_0x2914('0x33')]);_0xf857db[_0x2914('0x36')]=_['intersection'](_0x29aa10['model'],qs[_0x2914('0x37')](_0x1f6eae[_0x2914('0x33')][_0x2914('0x37')]));_0xf857db[_0x2914('0x36')]=_0xf857db['attributes'][_0x2914('0x42')]?_0xf857db[_0x2914('0x36')]:_0x29aa10['model'];if(_0x1f6eae['query'][_0x2914('0x43')]){_0xf857db[_0x2914('0x44')]=[{'all':!![]}];}_0xf857db=_[_0x2914('0x3e')]({},_0xf857db,_0x1f6eae[_0x2914('0x45')]);return db[_0x2914('0x2b')]['find'](_0xf857db)['then'](handleEntityNotFound(_0x2bbca3,null))[_0x2914('0x25')](respondWithResult(_0x2bbca3,null))['catch'](handleError(_0x2bbca3,null));};exports[_0x2914('0x46')]=function(_0x4b24b9,_0x324692){return db['MailServerOut']['create'](_0x4b24b9['body'],{})[_0x2914('0x25')](respondWithResult(_0x324692,0xc9))[_0x2914('0x47')](handleError(_0x324692,null));};exports[_0x2914('0x24')]=function(_0x5dd924,_0xcd39d5){if(_0x5dd924[_0x2914('0x48')]['id']){delete _0x5dd924[_0x2914('0x48')]['id'];}return db[_0x2914('0x2b')][_0x2914('0x49')]({'where':{'id':_0x5dd924[_0x2914('0x41')]['id']}})['then'](handleEntityNotFound(_0xcd39d5,null))[_0x2914('0x25')](saveUpdates(_0x5dd924['body'],null))[_0x2914('0x25')](respondWithResult(_0xcd39d5,null))[_0x2914('0x47')](handleError(_0xcd39d5,null));};exports[_0x2914('0x26')]=function(_0xd568ae,_0x1cb836){return db[_0x2914('0x2b')][_0x2914('0x49')]({'where':{'id':_0xd568ae[_0x2914('0x41')]['id']}})[_0x2914('0x25')](handleEntityNotFound(_0x1cb836,null))[_0x2914('0x25')](removeEntity(_0x1cb836,null))[_0x2914('0x47')](handleError(_0x1cb836,null));}; \ No newline at end of file +var _0x919f=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','update','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1cb36c,_0x6d6af7){var _0x3d7efc=function(_0x29979c){while(--_0x29979c){_0x1cb36c['push'](_0x1cb36c['shift']());}};_0x3d7efc(++_0x6d6af7);}(_0x919f,0xd7));var _0xf919=function(_0x724393,_0x1a9572){_0x724393=_0x724393-0x0;var _0x45aaf9=_0x919f[_0x724393];return _0x45aaf9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf919('0x0'));var jsonpatch=require(_0xf919('0x1'));var rp=require(_0xf919('0x2'));var moment=require(_0xf919('0x3'));var BPromise=require(_0xf919('0x4'));var Mustache=require(_0xf919('0x5'));var util=require(_0xf919('0x6'));var path=require('path');var sox=require(_0xf919('0x7'));var csv=require(_0xf919('0x8'));var ejs=require(_0xf919('0x9'));var fs=require('fs');var fs_extra=require(_0xf919('0xa'));var _=require(_0xf919('0xb'));var squel=require('squel');var crypto=require(_0xf919('0xc'));var jsforce=require(_0xf919('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf919('0x8'));var querystring=require(_0xf919('0xe'));var Papa=require(_0xf919('0xf'));var Redis=require('ioredis');var authService=require(_0xf919('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf919('0x11'));var utils=require(_0xf919('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf919('0x13'));var db=require(_0xf919('0x14'))['db'];function respondWithStatusCode(_0x2f8615,_0xe35202){_0xe35202=_0xe35202||0xcc;return function(_0x127e1e){if(_0x127e1e){return _0x2f8615[_0xf919('0x15')](_0xe35202);}return _0x2f8615['status'](_0xe35202)[_0xf919('0x16')]();};}function respondWithResult(_0x3c72f2,_0x161bb4){_0x161bb4=_0x161bb4||0xc8;return function(_0x273059){if(_0x273059){return _0x3c72f2[_0xf919('0x17')](_0x161bb4)[_0xf919('0x18')](_0x273059);}};}function respondWithFilteredResult(_0x583fb8,_0x22e6c9){return function(_0x2192a1){if(_0x2192a1){var _0x106969=typeof _0x22e6c9['offset']===_0xf919('0x19')&&typeof _0x22e6c9[_0xf919('0x1a')]===_0xf919('0x19');var _0x3b5227=_0x2192a1[_0xf919('0x1b')];var _0x5d7977=_0x106969?0x0:_0x22e6c9[_0xf919('0x1c')];var _0x5328c2=_0x106969?_0x2192a1['count']:_0x22e6c9[_0xf919('0x1c')]+_0x22e6c9[_0xf919('0x1a')];var _0x2125ca;if(_0x5328c2>=_0x3b5227){_0x5328c2=_0x3b5227;_0x2125ca=0xc8;}else{_0x2125ca=0xce;}_0x583fb8[_0xf919('0x17')](_0x2125ca);return _0x583fb8[_0xf919('0x1d')](_0xf919('0x1e'),_0x5d7977+'-'+_0x5328c2+'/'+_0x3b5227)['json'](_0x2192a1);}return null;};}function patchUpdates(_0x67de07){return function(_0x5723b3){try{jsonpatch[_0xf919('0x1f')](_0x5723b3,_0x67de07,!![]);}catch(_0x4f5296){return BPromise[_0xf919('0x20')](_0x4f5296);}return _0x5723b3[_0xf919('0x21')]();};}function saveUpdates(_0x4c5b4c,_0xc376e0){return function(_0x2d4c4b){if(_0x2d4c4b){return _0x2d4c4b['update'](_0x4c5b4c)['then'](function(_0x24e7a5){return _0x24e7a5;});}return null;};}function removeEntity(_0x36b769,_0x5ea793){return function(_0x184c58){if(_0x184c58){return _0x184c58[_0xf919('0x22')]()[_0xf919('0x23')](function(){_0x36b769[_0xf919('0x17')](0xcc)[_0xf919('0x16')]();});}};}function handleEntityNotFound(_0x46ecf5,_0x384548){return function(_0x31ff6b){if(!_0x31ff6b){_0x46ecf5[_0xf919('0x15')](0x194);}return _0x31ff6b;};}function handleError(_0x242948,_0x3c1d95){_0x3c1d95=_0x3c1d95||0x1f4;return function(_0x22d990){logger[_0xf919('0x24')](_0x22d990[_0xf919('0x25')]);if(_0x22d990[_0xf919('0x26')]){delete _0x22d990['name'];}_0x242948['status'](_0x3c1d95)['send'](_0x22d990);};}exports[_0xf919('0x27')]=function(_0x46b19a,_0xe852d4){var _0x4066aa={},_0x1575a4={},_0x3648f4={'count':0x0,'rows':[]};var _0x1b69be=_[_0xf919('0x28')](db[_0xf919('0x29')][_0xf919('0x2a')],function(_0x4fcba4){return{'name':_0x4fcba4[_0xf919('0x2b')],'type':_0x4fcba4[_0xf919('0x2c')][_0xf919('0x2d')]};});_0x1575a4[_0xf919('0x2e')]=_[_0xf919('0x28')](_0x1b69be,_0xf919('0x26'));_0x1575a4[_0xf919('0x2f')]=_[_0xf919('0x30')](_0x46b19a[_0xf919('0x2f')]);_0x1575a4[_0xf919('0x31')]=_['intersection'](_0x1575a4[_0xf919('0x2e')],_0x1575a4[_0xf919('0x2f')]);_0x4066aa[_0xf919('0x32')]=_[_0xf919('0x33')](_0x1575a4[_0xf919('0x2e')],qs['fields'](_0x46b19a[_0xf919('0x2f')][_0xf919('0x34')]));_0x4066aa[_0xf919('0x32')]=_0x4066aa[_0xf919('0x32')][_0xf919('0x35')]?_0x4066aa['attributes']:_0x1575a4[_0xf919('0x2e')];if(!_0x46b19a[_0xf919('0x2f')][_0xf919('0x36')](_0xf919('0x37'))){_0x4066aa[_0xf919('0x1a')]=qs[_0xf919('0x1a')](_0x46b19a[_0xf919('0x2f')]['limit']);_0x4066aa[_0xf919('0x1c')]=qs[_0xf919('0x1c')](_0x46b19a['query'][_0xf919('0x1c')]);}_0x4066aa[_0xf919('0x38')]=qs[_0xf919('0x39')](_0x46b19a[_0xf919('0x2f')]['sort']);_0x4066aa[_0xf919('0x3a')]=qs[_0xf919('0x31')](_[_0xf919('0x3b')](_0x46b19a[_0xf919('0x2f')],_0x1575a4[_0xf919('0x31')]),_0x1b69be);if(_0x46b19a[_0xf919('0x2f')][_0xf919('0x3c')]){_0x4066aa['where']=_[_0xf919('0x3d')](_0x4066aa[_0xf919('0x3a')],{'$or':_[_0xf919('0x28')](_0x1b69be,function(_0x41b43d){if(_0x41b43d['type']!==_0xf919('0x3e')){var _0x4638b6={};_0x4638b6[_0x41b43d[_0xf919('0x26')]]={'$like':'%'+_0x46b19a[_0xf919('0x2f')][_0xf919('0x3c')]+'%'};return _0x4638b6;}})});}_0x4066aa=_['merge']({},_0x4066aa,_0x46b19a[_0xf919('0x3f')]);var _0x53d4f9={'where':_0x4066aa[_0xf919('0x3a')]};return db[_0xf919('0x29')][_0xf919('0x1b')](_0x53d4f9)[_0xf919('0x23')](function(_0x5d3a88){_0x3648f4[_0xf919('0x1b')]=_0x5d3a88;if(_0x46b19a[_0xf919('0x2f')][_0xf919('0x40')]){_0x4066aa[_0xf919('0x41')]=[{'all':!![]}];}return db[_0xf919('0x29')]['findAll'](_0x4066aa);})[_0xf919('0x23')](function(_0x5cf11c){_0x3648f4[_0xf919('0x42')]=_0x5cf11c;return _0x3648f4;})['then'](respondWithFilteredResult(_0xe852d4,_0x4066aa))[_0xf919('0x43')](handleError(_0xe852d4,null));};exports[_0xf919('0x44')]=function(_0x52f283,_0x590e07){var _0x2a6f4e={'raw':!![],'where':{'id':_0x52f283[_0xf919('0x45')]['id']}},_0x15dae1={};_0x15dae1[_0xf919('0x2e')]=_[_0xf919('0x30')](db[_0xf919('0x29')][_0xf919('0x2a')]);_0x15dae1['query']=_['keys'](_0x52f283[_0xf919('0x2f')]);_0x15dae1[_0xf919('0x31')]=_[_0xf919('0x33')](_0x15dae1[_0xf919('0x2e')],_0x15dae1['query']);_0x2a6f4e['attributes']=_[_0xf919('0x33')](_0x15dae1[_0xf919('0x2e')],qs['fields'](_0x52f283[_0xf919('0x2f')][_0xf919('0x34')]));_0x2a6f4e[_0xf919('0x32')]=_0x2a6f4e[_0xf919('0x32')][_0xf919('0x35')]?_0x2a6f4e[_0xf919('0x32')]:_0x15dae1['model'];if(_0x52f283[_0xf919('0x2f')]['includeAll']){_0x2a6f4e[_0xf919('0x41')]=[{'all':!![]}];}_0x2a6f4e=_['merge']({},_0x2a6f4e,_0x52f283['options']);return db[_0xf919('0x29')]['find'](_0x2a6f4e)['then'](handleEntityNotFound(_0x590e07,null))[_0xf919('0x23')](respondWithResult(_0x590e07,null))['catch'](handleError(_0x590e07,null));};exports[_0xf919('0x46')]=function(_0x1e0c46,_0x198058){return db[_0xf919('0x29')]['create'](_0x1e0c46['body'],{})['then'](respondWithResult(_0x198058,0xc9))[_0xf919('0x43')](handleError(_0x198058,null));};exports[_0xf919('0x47')]=function(_0x16ade4,_0x1f8922){if(_0x16ade4[_0xf919('0x48')]['id']){delete _0x16ade4[_0xf919('0x48')]['id'];}return db[_0xf919('0x29')][_0xf919('0x49')]({'where':{'id':_0x16ade4[_0xf919('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f8922,null))[_0xf919('0x23')](saveUpdates(_0x16ade4['body'],null))[_0xf919('0x23')](respondWithResult(_0x1f8922,null))[_0xf919('0x43')](handleError(_0x1f8922,null));};exports[_0xf919('0x22')]=function(_0x16ac78,_0x3580ad){return db[_0xf919('0x29')][_0xf919('0x49')]({'where':{'id':_0x16ac78[_0xf919('0x45')]['id']}})[_0xf919('0x23')](handleEntityNotFound(_0x3580ad,null))[_0xf919('0x23')](removeEntity(_0x3580ad,null))[_0xf919('0x43')](handleError(_0x3580ad,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index f63440f..4b9956d 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 _0x20ce=['rimraf','../../config/environment','./mailServerOut.attributes','mail_servers_out','lodash','util','../../config/logger','request-promise','path'];(function(_0x5a9d56,_0x339138){var _0x3be8ce=function(_0x2db5db){while(--_0x2db5db){_0x5a9d56['push'](_0x5a9d56['shift']());}};_0x3be8ce(++_0x339138);}(_0x20ce,0xa6));var _0xe20c=function(_0x299e4f,_0x697ead){_0x299e4f=_0x299e4f-0x0;var _0x268ca4=_0x20ce[_0x299e4f];return _0x268ca4;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var logger=require(_0xe20c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe20c('0x3'));var fs=require('fs');var path=require(_0xe20c('0x4'));var rimraf=require(_0xe20c('0x5'));var config=require(_0xe20c('0x6'));var attributes=require(_0xe20c('0x7'));module['exports']=function(_0x1747bc,_0x414898){return _0x1747bc['define']('MailServerOut',attributes,{'tableName':_0xe20c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1de=['mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut'];(function(_0x3b1c1b,_0xf2b398){var _0x449d25=function(_0x544f7a){while(--_0x544f7a){_0x3b1c1b['push'](_0x3b1c1b['shift']());}};_0x449d25(++_0xf2b398);}(_0xd1de,0x1a1));var _0xed1d=function(_0x408a51,_0x44fb61){_0x408a51=_0x408a51-0x0;var _0x54f211=_0xd1de[_0x408a51];return _0x54f211;};'use strict';var _=require(_0xed1d('0x0'));var util=require('util');var logger=require(_0xed1d('0x1'))(_0xed1d('0x2'));var moment=require(_0xed1d('0x3'));var BPromise=require(_0xed1d('0x4'));var rp=require(_0xed1d('0x5'));var fs=require('fs');var path=require(_0xed1d('0x6'));var rimraf=require(_0xed1d('0x7'));var config=require(_0xed1d('0x8'));var attributes=require(_0xed1d('0x9'));module[_0xed1d('0xa')]=function(_0x279e99,_0x12bd83){return _0x279e99['define'](_0xed1d('0xb'),attributes,{'tableName':_0xed1d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index bafb36a..9f1c8cf 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x22bae4,_0x22474b){var _0x2047b6=function(_0x849589){while(--_0x849589){_0x22bae4['push'](_0x22bae4['shift']());}};_0x2047b6(++_0x22474b);}(_0xadb5,0xad));var _0x5adb=function(_0x5a240d,_0x4ba5ea){_0x5a240d=_0x5a240d-0x0;var _0x2917c2=_0xadb5[_0x5a240d];return _0x2917c2;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5e8721,_0x378840){var _0xc78d88=function(_0x3dbff7){while(--_0x3dbff7){_0x5e8721['push'](_0x5e8721['shift']());}};_0xc78d88(++_0x378840);}(_0xadb5,0xad));var _0x5adb=function(_0x285032,_0x529248){_0x285032=_0x285032-0x0;var _0x1ed72a=_0xadb5[_0x285032];return _0x1ed72a;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 9f1dc25..1a346a4 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 _0xcdcb=['isAuthenticated','index','/describe','describe','get','/:id','show','put','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x261d9e,_0x4f0942){var _0x3f8a2c=function(_0x28aaf8){while(--_0x28aaf8){_0x261d9e['push'](_0x261d9e['shift']());}};_0x3f8a2c(++_0x4f0942);}(_0xcdcb,0x6f));var _0xbcdc=function(_0x441bcc,_0x57d7c2){_0x441bcc=_0x441bcc-0x0;var _0x357c73=_0xcdcb[_0x441bcc];return _0x357c73;};'use strict';var multer=require('multer');var util=require(_0xbcdc('0x0'));var path=require(_0xbcdc('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcdc('0x2'));var router=express['Router']();var fs_extra=require(_0xbcdc('0x3'));var auth=require(_0xbcdc('0x4'));var interaction=require(_0xbcdc('0x5'));var config=require(_0xbcdc('0x6'));var controller=require(_0xbcdc('0x7'));router['get']('/',auth[_0xbcdc('0x8')](),controller[_0xbcdc('0x9')]);router['get'](_0xbcdc('0xa'),auth[_0xbcdc('0x8')](),controller[_0xbcdc('0xb')]);router[_0xbcdc('0xc')](_0xbcdc('0xd'),auth[_0xbcdc('0x8')](),controller[_0xbcdc('0xe')]);router['post']('/',auth[_0xbcdc('0x8')](),controller['create']);router[_0xbcdc('0xf')](_0xbcdc('0xd'),auth[_0xbcdc('0x8')](),controller['update']);router[_0xbcdc('0x10')](_0xbcdc('0xd'),auth[_0xbcdc('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xae68=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','update','delete','destroy'];(function(_0x48be61,_0x204c04){var _0x55fcd9=function(_0x5a9c6b){while(--_0x5a9c6b){_0x48be61['push'](_0x48be61['shift']());}};_0x55fcd9(++_0x204c04);}(_0xae68,0x133));var _0x8ae6=function(_0x19a4ac,_0x5d763d){_0x19a4ac=_0x19a4ac-0x0;var _0x8f3876=_0xae68[_0x19a4ac];return _0x8f3876;};'use strict';var multer=require(_0x8ae6('0x0'));var util=require('util');var path=require(_0x8ae6('0x1'));var timeout=require(_0x8ae6('0x2'));var express=require(_0x8ae6('0x3'));var router=express[_0x8ae6('0x4')]();var fs_extra=require(_0x8ae6('0x5'));var auth=require(_0x8ae6('0x6'));var interaction=require(_0x8ae6('0x7'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8ae6('0x8')]);router[_0x8ae6('0x9')](_0x8ae6('0xa'),auth[_0x8ae6('0xb')](),controller[_0x8ae6('0xc')]);router[_0x8ae6('0x9')](_0x8ae6('0xd'),auth[_0x8ae6('0xb')](),controller['show']);router['post']('/',auth[_0x8ae6('0xb')](),controller['create']);router['put'](_0x8ae6('0xd'),auth[_0x8ae6('0xb')](),controller[_0x8ae6('0xe')]);router[_0x8ae6('0xf')]('/:id',auth[_0x8ae6('0xb')](),controller[_0x8ae6('0x10')]);module[_0x8ae6('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 138ce08..117798e 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 _0x8b8e=['sequelize','STRING'];(function(_0x5ec019,_0x5bd130){var _0x556c3c=function(_0x24bb75){while(--_0x24bb75){_0x5ec019['push'](_0x5ec019['shift']());}};_0x556c3c(++_0x5bd130);}(_0x8b8e,0x108));var _0xe8b8=function(_0x5ad5bb,_0x5477e1){_0x5ad5bb=_0x5ad5bb-0x0;var _0x5bb0d7=_0x8b8e[_0x5ad5bb];return _0x5bb0d7;};'use strict';var Sequelize=require(_0xe8b8('0x0'));module['exports']={'name':{'type':Sequelize[_0xe8b8('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe8b8('0x1')]}}; \ No newline at end of file +var _0x83d0=['exports','STRING','name','sequelize'];(function(_0x486f8b,_0x11608c){var _0x37a64c=function(_0x41a8d6){while(--_0x41a8d6){_0x486f8b['push'](_0x486f8b['shift']());}};_0x37a64c(++_0x11608c);}(_0x83d0,0xb7));var _0x083d=function(_0x5cd79e,_0x2c6b4e){_0x5cd79e=_0x5cd79e-0x0;var _0x3b394c=_0x83d0[_0x5cd79e];return _0x3b394c;};'use strict';var Sequelize=require(_0x083d('0x0'));module[_0x083d('0x1')]={'name':{'type':Sequelize[_0x083d('0x2')],'unique':_0x083d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x083d('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 916502d..9cc5d3d 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 _0xe962=['MailSubstatus','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','update','params','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x3780bc,_0x620137){var _0x3fb1d0=function(_0x3bac04){while(--_0x3bac04){_0x3780bc['push'](_0x3780bc['shift']());}};_0x3fb1d0(++_0x620137);}(_0xe962,0x75));var _0x2e96=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe962[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x2e96('0x0'));var rimraf=require(_0x2e96('0x1'));var zipdir=require(_0x2e96('0x2'));var jsonpatch=require(_0x2e96('0x3'));var rp=require(_0x2e96('0x4'));var moment=require(_0x2e96('0x5'));var BPromise=require(_0x2e96('0x6'));var Mustache=require('mustache');var util=require(_0x2e96('0x7'));var path=require(_0x2e96('0x8'));var sox=require(_0x2e96('0x9'));var csv=require(_0x2e96('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e96('0xb'));var _=require(_0x2e96('0xc'));var squel=require(_0x2e96('0xd'));var crypto=require(_0x2e96('0xe'));var jsforce=require(_0x2e96('0xf'));var deskjs=require(_0x2e96('0x10'));var toCsv=require(_0x2e96('0xa'));var querystring=require(_0x2e96('0x11'));var Papa=require(_0x2e96('0x12'));var Redis=require(_0x2e96('0x13'));var authService=require(_0x2e96('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2e96('0x15'));var hardwareService=require(_0x2e96('0x16'));var logger=require(_0x2e96('0x17'))(_0x2e96('0x18'));var utils=require(_0x2e96('0x19'));var config=require(_0x2e96('0x1a'));var licenseUtil=require(_0x2e96('0x1b'));var db=require(_0x2e96('0x1c'))['db'];function respondWithStatusCode(_0x3fe67c,_0x29ee75){_0x29ee75=_0x29ee75||0xcc;return function(_0x3208fe){if(_0x3208fe){return _0x3fe67c['sendStatus'](_0x29ee75);}return _0x3fe67c[_0x2e96('0x1d')](_0x29ee75)[_0x2e96('0x1e')]();};}function respondWithResult(_0x23e22d,_0x4e9689){_0x4e9689=_0x4e9689||0xc8;return function(_0x4c0b92){if(_0x4c0b92){return _0x23e22d[_0x2e96('0x1d')](_0x4e9689)[_0x2e96('0x1f')](_0x4c0b92);}};}function respondWithFilteredResult(_0x31031c,_0x31a2fa){return function(_0x3c27da){if(_0x3c27da){var _0x364fdc=typeof _0x31a2fa['offset']==='undefined'&&typeof _0x31a2fa['limit']===_0x2e96('0x20');var _0x4964d7=_0x3c27da[_0x2e96('0x21')];var _0x4bfc4a=_0x364fdc?0x0:_0x31a2fa['offset'];var _0x4dc341=_0x364fdc?_0x3c27da['count']:_0x31a2fa[_0x2e96('0x22')]+_0x31a2fa[_0x2e96('0x23')];var _0x268e0e;if(_0x4dc341>=_0x4964d7){_0x4dc341=_0x4964d7;_0x268e0e=0xc8;}else{_0x268e0e=0xce;}_0x31031c[_0x2e96('0x1d')](_0x268e0e);return _0x31031c[_0x2e96('0x24')](_0x2e96('0x25'),_0x4bfc4a+'-'+_0x4dc341+'/'+_0x4964d7)[_0x2e96('0x1f')](_0x3c27da);}return null;};}function patchUpdates(_0x1c6909){return function(_0x472969){try{jsonpatch[_0x2e96('0x26')](_0x472969,_0x1c6909,!![]);}catch(_0x21bc79){return BPromise[_0x2e96('0x27')](_0x21bc79);}return _0x472969[_0x2e96('0x28')]();};}function saveUpdates(_0x24e480,_0x5bfa68){return function(_0xb453b8){if(_0xb453b8){return _0xb453b8['update'](_0x24e480)[_0x2e96('0x29')](function(_0x1587c7){return _0x1587c7;});}return null;};}function removeEntity(_0x2a0193,_0x45b389){return function(_0x4a3354){if(_0x4a3354){return _0x4a3354[_0x2e96('0x2a')]()['then'](function(){_0x2a0193[_0x2e96('0x1d')](0xcc)[_0x2e96('0x1e')]();});}};}function handleEntityNotFound(_0x4d642a,_0x2a0cc0){return function(_0x471c70){if(!_0x471c70){_0x4d642a[_0x2e96('0x2b')](0x194);}return _0x471c70;};}function handleError(_0x181d68,_0x28f640){_0x28f640=_0x28f640||0x1f4;return function(_0x41db84){logger[_0x2e96('0x2c')](_0x41db84[_0x2e96('0x2d')]);if(_0x41db84[_0x2e96('0x2e')]){delete _0x41db84[_0x2e96('0x2e')];}_0x181d68[_0x2e96('0x1d')](_0x28f640)[_0x2e96('0x2f')](_0x41db84);};}exports[_0x2e96('0x30')]=function(_0x57459f,_0x4d5a5d){var _0x2a2d88={},_0x350cf8={},_0x98873d={'count':0x0,'rows':[]};var _0x408dbf=_['map'](db[_0x2e96('0x31')]['rawAttributes'],function(_0x4b7ced){return{'name':_0x4b7ced[_0x2e96('0x32')],'type':_0x4b7ced[_0x2e96('0x33')][_0x2e96('0x34')]};});_0x350cf8[_0x2e96('0x35')]=_['map'](_0x408dbf,_0x2e96('0x2e'));_0x350cf8['query']=_[_0x2e96('0x36')](_0x57459f[_0x2e96('0x37')]);_0x350cf8[_0x2e96('0x38')]=_[_0x2e96('0x39')](_0x350cf8[_0x2e96('0x35')],_0x350cf8['query']);_0x2a2d88[_0x2e96('0x3a')]=_[_0x2e96('0x39')](_0x350cf8[_0x2e96('0x35')],qs[_0x2e96('0x3b')](_0x57459f[_0x2e96('0x37')]['fields']));_0x2a2d88[_0x2e96('0x3a')]=_0x2a2d88[_0x2e96('0x3a')][_0x2e96('0x3c')]?_0x2a2d88['attributes']:_0x350cf8['model'];if(!_0x57459f[_0x2e96('0x37')][_0x2e96('0x3d')](_0x2e96('0x3e'))){_0x2a2d88[_0x2e96('0x23')]=qs['limit'](_0x57459f[_0x2e96('0x37')][_0x2e96('0x23')]);_0x2a2d88[_0x2e96('0x22')]=qs['offset'](_0x57459f[_0x2e96('0x37')][_0x2e96('0x22')]);}_0x2a2d88[_0x2e96('0x3f')]=qs['sort'](_0x57459f[_0x2e96('0x37')]['sort']);_0x2a2d88[_0x2e96('0x40')]=qs['filters'](_[_0x2e96('0x41')](_0x57459f[_0x2e96('0x37')],_0x350cf8['filters']),_0x408dbf);if(_0x57459f['query'][_0x2e96('0x42')]){_0x2a2d88[_0x2e96('0x40')]=_[_0x2e96('0x43')](_0x2a2d88[_0x2e96('0x40')],{'$or':_[_0x2e96('0x44')](_0x408dbf,function(_0x2b80a3){if(_0x2b80a3['type']!==_0x2e96('0x45')){var _0x8f1bed={};_0x8f1bed[_0x2b80a3[_0x2e96('0x2e')]]={'$like':'%'+_0x57459f['query'][_0x2e96('0x42')]+'%'};return _0x8f1bed;}})});}_0x2a2d88=_['merge']({},_0x2a2d88,_0x57459f[_0x2e96('0x46')]);var _0x291971={'where':_0x2a2d88[_0x2e96('0x40')]};return db[_0x2e96('0x31')][_0x2e96('0x21')](_0x291971)[_0x2e96('0x29')](function(_0x2ef110){_0x98873d[_0x2e96('0x21')]=_0x2ef110;if(_0x57459f['query'][_0x2e96('0x47')]){_0x2a2d88[_0x2e96('0x48')]=[{'all':!![]}];}return db[_0x2e96('0x31')][_0x2e96('0x49')](_0x2a2d88);})[_0x2e96('0x29')](function(_0xc23f72){_0x98873d[_0x2e96('0x4a')]=_0xc23f72;return _0x98873d;})[_0x2e96('0x29')](respondWithFilteredResult(_0x4d5a5d,_0x2a2d88))[_0x2e96('0x4b')](handleError(_0x4d5a5d,null));};exports[_0x2e96('0x4c')]=function(_0x37958a,_0x2436b3){var _0x6a93a4={'raw':!![],'where':{'id':_0x37958a['params']['id']}},_0x23c009={};_0x23c009[_0x2e96('0x35')]=_[_0x2e96('0x36')](db[_0x2e96('0x31')]['rawAttributes']);_0x23c009[_0x2e96('0x37')]=_[_0x2e96('0x36')](_0x37958a['query']);_0x23c009['filters']=_[_0x2e96('0x39')](_0x23c009[_0x2e96('0x35')],_0x23c009[_0x2e96('0x37')]);_0x6a93a4[_0x2e96('0x3a')]=_[_0x2e96('0x39')](_0x23c009[_0x2e96('0x35')],qs[_0x2e96('0x3b')](_0x37958a[_0x2e96('0x37')][_0x2e96('0x3b')]));_0x6a93a4[_0x2e96('0x3a')]=_0x6a93a4['attributes'][_0x2e96('0x3c')]?_0x6a93a4[_0x2e96('0x3a')]:_0x23c009[_0x2e96('0x35')];if(_0x37958a['query']['includeAll']){_0x6a93a4[_0x2e96('0x48')]=[{'all':!![]}];}_0x6a93a4=_[_0x2e96('0x43')]({},_0x6a93a4,_0x37958a[_0x2e96('0x46')]);return db[_0x2e96('0x31')]['find'](_0x6a93a4)[_0x2e96('0x29')](handleEntityNotFound(_0x2436b3,null))['then'](respondWithResult(_0x2436b3,null))[_0x2e96('0x4b')](handleError(_0x2436b3,null));};exports[_0x2e96('0x4d')]=function(_0x4a2403,_0x317d3d){return db[_0x2e96('0x31')][_0x2e96('0x4d')](_0x4a2403['body'],{})[_0x2e96('0x29')](respondWithResult(_0x317d3d,0xc9))[_0x2e96('0x4b')](handleError(_0x317d3d,null));};exports[_0x2e96('0x4e')]=function(_0x218f30,_0x1b8b06){if(_0x218f30['body']['id']){delete _0x218f30['body']['id'];}return db[_0x2e96('0x31')]['find']({'where':{'id':_0x218f30[_0x2e96('0x4f')]['id']}})[_0x2e96('0x29')](handleEntityNotFound(_0x1b8b06,null))[_0x2e96('0x29')](saveUpdates(_0x218f30[_0x2e96('0x50')],null))[_0x2e96('0x29')](respondWithResult(_0x1b8b06,null))[_0x2e96('0x4b')](handleError(_0x1b8b06,null));};exports['destroy']=function(_0x586fff,_0x3cce59){return db['MailSubstatus'][_0x2e96('0x51')]({'where':{'id':_0x586fff[_0x2e96('0x4f')]['id']}})[_0x2e96('0x29')](handleEntityNotFound(_0x3cce59,null))[_0x2e96('0x29')](removeEntity(_0x3cce59,null))[_0x2e96('0x4b')](handleError(_0x3cce59,null));};exports[_0x2e96('0x52')]=function(_0x1803de,_0x2aa084){return db[_0x2e96('0x31')][_0x2e96('0x52')]()['then'](respondWithResult(_0x2aa084,null))[_0x2e96('0x4b')](handleError(_0x2aa084,null));}; \ No newline at end of file +var _0x6d57=['merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','MailSubstatus','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x6d57,0x1d9));var _0x76d5=function(_0x243f7e,_0x20f844){_0x243f7e=_0x243f7e-0x0;var _0x18fc25=_0x6d57[_0x243f7e];return _0x18fc25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76d5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76d5('0x1'));var rp=require(_0x76d5('0x2'));var moment=require(_0x76d5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x76d5('0x4'));var path=require(_0x76d5('0x5'));var sox=require(_0x76d5('0x6'));var csv=require(_0x76d5('0x7'));var ejs=require(_0x76d5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76d5('0x9'));var squel=require(_0x76d5('0xa'));var crypto=require(_0x76d5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x76d5('0xc'));var Papa=require(_0x76d5('0xd'));var Redis=require(_0x76d5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x76d5('0xf'));var as=require(_0x76d5('0x10'));var hardwareService=require(_0x76d5('0x11'));var logger=require(_0x76d5('0x12'))(_0x76d5('0x13'));var utils=require(_0x76d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x76d5('0x15'));var db=require(_0x76d5('0x16'))['db'];function respondWithStatusCode(_0x492d0b,_0x2e5cb0){_0x2e5cb0=_0x2e5cb0||0xcc;return function(_0x2e59b1){if(_0x2e59b1){return _0x492d0b['sendStatus'](_0x2e5cb0);}return _0x492d0b[_0x76d5('0x17')](_0x2e5cb0)[_0x76d5('0x18')]();};}function respondWithResult(_0x5d8c91,_0x3ac82a){_0x3ac82a=_0x3ac82a||0xc8;return function(_0x912cb0){if(_0x912cb0){return _0x5d8c91[_0x76d5('0x17')](_0x3ac82a)[_0x76d5('0x19')](_0x912cb0);}};}function respondWithFilteredResult(_0x411386,_0x521de0){return function(_0x52dbb7){if(_0x52dbb7){var _0x5e3b4b=typeof _0x521de0[_0x76d5('0x1a')]===_0x76d5('0x1b')&&typeof _0x521de0['limit']===_0x76d5('0x1b');var _0x5af205=_0x52dbb7[_0x76d5('0x1c')];var _0x5f1c6c=_0x5e3b4b?0x0:_0x521de0[_0x76d5('0x1a')];var _0x3a0bda=_0x5e3b4b?_0x52dbb7['count']:_0x521de0[_0x76d5('0x1a')]+_0x521de0[_0x76d5('0x1d')];var _0x3d979d;if(_0x3a0bda>=_0x5af205){_0x3a0bda=_0x5af205;_0x3d979d=0xc8;}else{_0x3d979d=0xce;}_0x411386[_0x76d5('0x17')](_0x3d979d);return _0x411386[_0x76d5('0x1e')](_0x76d5('0x1f'),_0x5f1c6c+'-'+_0x3a0bda+'/'+_0x5af205)[_0x76d5('0x19')](_0x52dbb7);}return null;};}function patchUpdates(_0x4b061d){return function(_0x5957ab){try{jsonpatch[_0x76d5('0x20')](_0x5957ab,_0x4b061d,!![]);}catch(_0x5161f3){return BPromise[_0x76d5('0x21')](_0x5161f3);}return _0x5957ab[_0x76d5('0x22')]();};}function saveUpdates(_0x3be5ee,_0x52d78b){return function(_0x4d52b9){if(_0x4d52b9){return _0x4d52b9[_0x76d5('0x23')](_0x3be5ee)[_0x76d5('0x24')](function(_0x4ed17c){return _0x4ed17c;});}return null;};}function removeEntity(_0x12b87b,_0x53298c){return function(_0x573026){if(_0x573026){return _0x573026['destroy']()['then'](function(){_0x12b87b['status'](0xcc)[_0x76d5('0x18')]();});}};}function handleEntityNotFound(_0x1f980b,_0x52788f){return function(_0x5895bb){if(!_0x5895bb){_0x1f980b[_0x76d5('0x25')](0x194);}return _0x5895bb;};}function handleError(_0x58fbe6,_0x2e8359){_0x2e8359=_0x2e8359||0x1f4;return function(_0x6a0d5f){logger[_0x76d5('0x26')](_0x6a0d5f[_0x76d5('0x27')]);if(_0x6a0d5f['name']){delete _0x6a0d5f[_0x76d5('0x28')];}_0x58fbe6[_0x76d5('0x17')](_0x2e8359)['send'](_0x6a0d5f);};}exports[_0x76d5('0x29')]=function(_0x191b0e,_0xc5b1ad){var _0x48b630={},_0x211b74={},_0xdf602e={'count':0x0,'rows':[]};var _0x2e72d2=_[_0x76d5('0x2a')](db[_0x76d5('0x2b')]['rawAttributes'],function(_0x46c9eb){return{'name':_0x46c9eb[_0x76d5('0x2c')],'type':_0x46c9eb[_0x76d5('0x2d')][_0x76d5('0x2e')]};});_0x211b74[_0x76d5('0x2f')]=_[_0x76d5('0x2a')](_0x2e72d2,_0x76d5('0x28'));_0x211b74['query']=_['keys'](_0x191b0e[_0x76d5('0x30')]);_0x211b74['filters']=_[_0x76d5('0x31')](_0x211b74[_0x76d5('0x2f')],_0x211b74[_0x76d5('0x30')]);_0x48b630[_0x76d5('0x32')]=_['intersection'](_0x211b74[_0x76d5('0x2f')],qs[_0x76d5('0x33')](_0x191b0e[_0x76d5('0x30')][_0x76d5('0x33')]));_0x48b630[_0x76d5('0x32')]=_0x48b630['attributes']['length']?_0x48b630['attributes']:_0x211b74[_0x76d5('0x2f')];if(!_0x191b0e['query'][_0x76d5('0x34')](_0x76d5('0x35'))){_0x48b630[_0x76d5('0x1d')]=qs[_0x76d5('0x1d')](_0x191b0e[_0x76d5('0x30')][_0x76d5('0x1d')]);_0x48b630[_0x76d5('0x1a')]=qs[_0x76d5('0x1a')](_0x191b0e[_0x76d5('0x30')][_0x76d5('0x1a')]);}_0x48b630[_0x76d5('0x36')]=qs[_0x76d5('0x37')](_0x191b0e[_0x76d5('0x30')][_0x76d5('0x37')]);_0x48b630[_0x76d5('0x38')]=qs[_0x76d5('0x39')](_['pick'](_0x191b0e[_0x76d5('0x30')],_0x211b74[_0x76d5('0x39')]),_0x2e72d2);if(_0x191b0e[_0x76d5('0x30')][_0x76d5('0x3a')]){_0x48b630['where']=_[_0x76d5('0x3b')](_0x48b630[_0x76d5('0x38')],{'$or':_[_0x76d5('0x2a')](_0x2e72d2,function(_0x34b047){if(_0x34b047['type']!==_0x76d5('0x3c')){var _0x2cc70a={};_0x2cc70a[_0x34b047[_0x76d5('0x28')]]={'$like':'%'+_0x191b0e[_0x76d5('0x30')]['filter']+'%'};return _0x2cc70a;}})});}_0x48b630=_[_0x76d5('0x3b')]({},_0x48b630,_0x191b0e[_0x76d5('0x3d')]);var _0x116e25={'where':_0x48b630[_0x76d5('0x38')]};return db[_0x76d5('0x2b')][_0x76d5('0x1c')](_0x116e25)['then'](function(_0x566765){_0xdf602e[_0x76d5('0x1c')]=_0x566765;if(_0x191b0e[_0x76d5('0x30')]['includeAll']){_0x48b630[_0x76d5('0x3e')]=[{'all':!![]}];}return db[_0x76d5('0x2b')][_0x76d5('0x3f')](_0x48b630);})[_0x76d5('0x24')](function(_0x1f4cca){_0xdf602e[_0x76d5('0x40')]=_0x1f4cca;return _0xdf602e;})[_0x76d5('0x24')](respondWithFilteredResult(_0xc5b1ad,_0x48b630))[_0x76d5('0x41')](handleError(_0xc5b1ad,null));};exports[_0x76d5('0x42')]=function(_0x59dfda,_0x3fd89a){var _0x4b1e62={'raw':!![],'where':{'id':_0x59dfda[_0x76d5('0x43')]['id']}},_0x417e31={};_0x417e31['model']=_[_0x76d5('0x44')](db[_0x76d5('0x2b')][_0x76d5('0x45')]);_0x417e31['query']=_['keys'](_0x59dfda[_0x76d5('0x30')]);_0x417e31[_0x76d5('0x39')]=_['intersection'](_0x417e31['model'],_0x417e31[_0x76d5('0x30')]);_0x4b1e62[_0x76d5('0x32')]=_['intersection'](_0x417e31[_0x76d5('0x2f')],qs[_0x76d5('0x33')](_0x59dfda[_0x76d5('0x30')][_0x76d5('0x33')]));_0x4b1e62['attributes']=_0x4b1e62[_0x76d5('0x32')][_0x76d5('0x46')]?_0x4b1e62[_0x76d5('0x32')]:_0x417e31[_0x76d5('0x2f')];if(_0x59dfda['query'][_0x76d5('0x47')]){_0x4b1e62[_0x76d5('0x3e')]=[{'all':!![]}];}_0x4b1e62=_[_0x76d5('0x3b')]({},_0x4b1e62,_0x59dfda['options']);return db[_0x76d5('0x2b')][_0x76d5('0x48')](_0x4b1e62)['then'](handleEntityNotFound(_0x3fd89a,null))['then'](respondWithResult(_0x3fd89a,null))[_0x76d5('0x41')](handleError(_0x3fd89a,null));};exports['create']=function(_0x266edd,_0x9cbb65){return db[_0x76d5('0x2b')][_0x76d5('0x49')](_0x266edd['body'],{})[_0x76d5('0x24')](respondWithResult(_0x9cbb65,0xc9))[_0x76d5('0x41')](handleError(_0x9cbb65,null));};exports['update']=function(_0x4db63a,_0x50f5cf){if(_0x4db63a['body']['id']){delete _0x4db63a[_0x76d5('0x4a')]['id'];}return db[_0x76d5('0x2b')][_0x76d5('0x48')]({'where':{'id':_0x4db63a['params']['id']}})[_0x76d5('0x24')](handleEntityNotFound(_0x50f5cf,null))[_0x76d5('0x24')](saveUpdates(_0x4db63a['body'],null))[_0x76d5('0x24')](respondWithResult(_0x50f5cf,null))[_0x76d5('0x41')](handleError(_0x50f5cf,null));};exports[_0x76d5('0x4b')]=function(_0x162abe,_0x22d0d3){return db[_0x76d5('0x2b')][_0x76d5('0x48')]({'where':{'id':_0x162abe[_0x76d5('0x43')]['id']}})[_0x76d5('0x24')](handleEntityNotFound(_0x22d0d3,null))[_0x76d5('0x24')](removeEntity(_0x22d0d3,null))[_0x76d5('0x41')](handleError(_0x22d0d3,null));};exports['describe']=function(_0x61f798,_0x5c1e0c){return db['MailSubstatus']['describe']()[_0x76d5('0x24')](respondWithResult(_0x5c1e0c,null))['catch'](handleError(_0x5c1e0c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 92dc3ac..ce21c8b 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 _0x6e4c=['events','../../mysqldb','emit','hook'];(function(_0x3ff8e6,_0x43d357){var _0x4242fc=function(_0xad5a07){while(--_0xad5a07){_0x3ff8e6['push'](_0x3ff8e6['shift']());}};_0x4242fc(++_0x43d357);}(_0x6e4c,0xf8));var _0xc6e4=function(_0x41ed37,_0xbcd1d4){_0x41ed37=_0x41ed37-0x0;var _0x13f7ea=_0x6e4c[_0x41ed37];return _0x13f7ea;};'use strict';var EventEmitter=require(_0xc6e4('0x0'));var MailSubstatus=require(_0xc6e4('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x3b4b50){return function(_0x1b55cc,_0x192304,_0x2d141b){MailSubstatusEvents[_0xc6e4('0x2')](_0x3b4b50+':'+_0x1b55cc['id'],_0x1b55cc);MailSubstatusEvents[_0xc6e4('0x2')](_0x3b4b50,_0x1b55cc);_0x2d141b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xc6e4('0x3')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xcb44=['exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hook'];(function(_0x48bcb0,_0x3ba74b){var _0x37232c=function(_0x159906){while(--_0x159906){_0x48bcb0['push'](_0x48bcb0['shift']());}};_0x37232c(++_0x3ba74b);}(_0xcb44,0x89));var _0x4cb4=function(_0x3bb43c,_0x5e18f3){_0x3bb43c=_0x3bb43c-0x0;var _0x1c5bf9=_0xcb44[_0x3bb43c];return _0x1c5bf9;};'use strict';var EventEmitter=require(_0x4cb4('0x0'));var MailSubstatus=require(_0x4cb4('0x1'))['db'][_0x4cb4('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x4cb4('0x3')](0x0);var events={'afterUpdate':_0x4cb4('0x4')};function emitEvent(_0x273fb9){return function(_0x4b7f69,_0x544d77,_0x780eea){MailSubstatusEvents[_0x4cb4('0x5')](_0x273fb9+':'+_0x4b7f69['id'],_0x4b7f69);MailSubstatusEvents[_0x4cb4('0x5')](_0x273fb9,_0x4b7f69);_0x780eea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x4cb4('0x6')](e,emitEvent(event));}}module[_0x4cb4('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d2e9921..d81ccbf 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 _0xbb60=['catch','./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then'];(function(_0x4b6cc8,_0x355e5b){var _0x5c4743=function(_0x68d0f6){while(--_0x68d0f6){_0x4b6cc8['push'](_0x4b6cc8['shift']());}};_0x5c4743(++_0x355e5b);}(_0xbb60,0x85));var _0x0bb6=function(_0x45e9f9,_0x19f65c){_0x45e9f9=_0x45e9f9-0x0;var _0x254c65=_0xbb60[_0x45e9f9];return _0x254c65;};'use strict';var attributes=require(_0x0bb6('0x0'));module['exports']=function(_0x49b204){var _0x250027=_0x49b204[_0x0bb6('0x1')];return _0x49b204[_0x0bb6('0x2')](_0x0bb6('0x3'),attributes,{'tableName':_0x0bb6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3f06d8,_0x31801d,_0x14be85){return _0x250027[_0x0bb6('0x5')][_0x0bb6('0x6')]({'value':_0x3f06d8[_0x0bb6('0x7')]},{'where':{'field':_0x0bb6('0x8'),'value':_0x3f06d8[_0x0bb6('0x9')][_0x0bb6('0x7')]}})[_0x0bb6('0xa')](function(){_0x14be85();})[_0x0bb6('0xb')](function(_0x34a2bc){_0x14be85(_0x34a2bc);});}}});}; \ No newline at end of file +var _0x5f13=['define','mail_substatuses','Condition','update','name','mailSubstatus','catch','./mailSubstatus.attributes','exports','models'];(function(_0x395be8,_0x285479){var _0x5ceb20=function(_0x225920){while(--_0x225920){_0x395be8['push'](_0x395be8['shift']());}};_0x5ceb20(++_0x285479);}(_0x5f13,0x115));var _0x35f1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5f13[_0x1ac595];return _0x455fff;};'use strict';var attributes=require(_0x35f1('0x0'));module[_0x35f1('0x1')]=function(_0x514187){var _0x35cbe0=_0x514187[_0x35f1('0x2')];return _0x514187[_0x35f1('0x3')]('MailSubstatus',attributes,{'tableName':_0x35f1('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1b2ecf,_0x1bbdb2,_0x1334f6){return _0x35cbe0[_0x35f1('0x5')][_0x35f1('0x6')]({'value':_0x1b2ecf[_0x35f1('0x7')]},{'where':{'field':_0x35f1('0x8'),'value':_0x1b2ecf['_previousDataValues']['name']}})['then'](function(){_0x1334f6();})[_0x35f1('0x9')](function(_0x8f0321){_0x1334f6(_0x8f0321);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 505d371..c89d4bf 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 _0x97b5=['MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x97b5,0xd4));var _0x597b=function(_0x520d6d,_0x20ed47){_0x520d6d=_0x520d6d-0x0;var _0x17bd7b=_0x97b5[_0x520d6d];return _0x17bd7b;};'use strict';var _=require(_0x597b('0x0'));var util=require(_0x597b('0x1'));var moment=require(_0x597b('0x2'));var BPromise=require(_0x597b('0x3'));var rs=require(_0x597b('0x4'));var fs=require('fs');var Redis=require(_0x597b('0x5'));var db=require(_0x597b('0x6'))['db'];var utils=require(_0x597b('0x7'));var logger=require('../../config/logger')(_0x597b('0x8'));var config=require(_0x597b('0x9'));var jayson=require(_0x597b('0xa'));var client=jayson[_0x597b('0xb')][_0x597b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6ec841,_0x43e1c4,_0x26fee2){return new BPromise(function(_0x519882,_0x54efb1){return client[_0x597b('0xd')](_0x6ec841,_0x26fee2)[_0x597b('0xe')](function(_0x161f2b){logger[_0x597b('0xf')](_0x597b('0x10'),_0x43e1c4,'request\x20sent');logger[_0x597b('0x11')](_0x597b('0x12'),_0x43e1c4,_0x597b('0x13'),JSON[_0x597b('0x14')](_0x161f2b));if(_0x161f2b[_0x597b('0x15')]){if(_0x161f2b[_0x597b('0x15')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x43e1c4,_0x161f2b[_0x597b('0x15')][_0x597b('0x16')]);return _0x54efb1(_0x161f2b[_0x597b('0x15')][_0x597b('0x16')]);}logger[_0x597b('0x15')](_0x597b('0x10'),_0x43e1c4,_0x161f2b[_0x597b('0x15')][_0x597b('0x16')]);return _0x519882(_0x161f2b[_0x597b('0x15')][_0x597b('0x16')]);}else{logger[_0x597b('0xf')](_0x597b('0x10'),_0x43e1c4,_0x597b('0x13'));_0x519882(_0x161f2b['result']['message']);}})['catch'](function(_0x61fa81){logger[_0x597b('0x15')]('MailSubstatus,\x20%s,\x20%s',_0x43e1c4,_0x61fa81);_0x54efb1(_0x61fa81);});});} \ No newline at end of file +var _0xbd72=['error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xbd72,0x119));var _0x2bd7=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0xbd72[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x2bd7('0x0'));var util=require(_0x2bd7('0x1'));var moment=require('moment');var BPromise=require(_0x2bd7('0x2'));var rs=require(_0x2bd7('0x3'));var fs=require('fs');var Redis=require(_0x2bd7('0x4'));var db=require(_0x2bd7('0x5'))['db'];var utils=require(_0x2bd7('0x6'));var logger=require(_0x2bd7('0x7'))('rpc');var config=require(_0x2bd7('0x8'));var jayson=require(_0x2bd7('0x9'));var client=jayson[_0x2bd7('0xa')][_0x2bd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x307795,_0x5ca372,_0x6eb5f0){return new BPromise(function(_0x5aae10,_0x456f0e){return client[_0x2bd7('0xc')](_0x307795,_0x6eb5f0)[_0x2bd7('0xd')](function(_0x24d57a){logger[_0x2bd7('0xe')](_0x2bd7('0xf'),_0x5ca372,'request\x20sent');logger[_0x2bd7('0x10')](_0x2bd7('0x11'),_0x5ca372,'request\x20sent',JSON[_0x2bd7('0x12')](_0x24d57a));if(_0x24d57a[_0x2bd7('0x13')]){if(_0x24d57a[_0x2bd7('0x13')][_0x2bd7('0x14')]===0x1f4){logger[_0x2bd7('0x13')](_0x2bd7('0xf'),_0x5ca372,_0x24d57a[_0x2bd7('0x13')][_0x2bd7('0x15')]);return _0x456f0e(_0x24d57a[_0x2bd7('0x13')][_0x2bd7('0x15')]);}logger[_0x2bd7('0x13')](_0x2bd7('0xf'),_0x5ca372,_0x24d57a[_0x2bd7('0x13')]['message']);return _0x5aae10(_0x24d57a['error'][_0x2bd7('0x15')]);}else{logger[_0x2bd7('0xe')](_0x2bd7('0xf'),_0x5ca372,_0x2bd7('0x16'));_0x5aae10(_0x24d57a[_0x2bd7('0x17')][_0x2bd7('0x15')]);}})[_0x2bd7('0x18')](function(_0x5973b9){logger[_0x2bd7('0x13')](_0x2bd7('0xf'),_0x5ca372,_0x5973b9);_0x456f0e(_0x5973b9);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index e57f1f8..ab91d16 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 _0xf486=['index','get','/describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3c8eee,_0x1ac0e7){var _0x4f1b01=function(_0x45a16a){while(--_0x45a16a){_0x3c8eee['push'](_0x3c8eee['shift']());}};_0x4f1b01(++_0x1ac0e7);}(_0xf486,0x199));var _0x6f48=function(_0x258f70,_0x1fcf2e){_0x258f70=_0x258f70-0x0;var _0x4b8306=_0xf486[_0x258f70];return _0x4b8306;};'use strict';var multer=require(_0x6f48('0x0'));var util=require('util');var path=require(_0x6f48('0x1'));var timeout=require(_0x6f48('0x2'));var express=require(_0x6f48('0x3'));var router=express['Router']();var fs_extra=require(_0x6f48('0x4'));var auth=require(_0x6f48('0x5'));var interaction=require(_0x6f48('0x6'));var config=require(_0x6f48('0x7'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x6f48('0x8')](),controller[_0x6f48('0x9')]);router[_0x6f48('0xa')](_0x6f48('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6f48('0xa')](_0x6f48('0xc'),auth[_0x6f48('0x8')](),controller[_0x6f48('0xd')]);router[_0x6f48('0xe')]('/',auth[_0x6f48('0x8')](),controller[_0x6f48('0xf')]);router['put'](_0x6f48('0xc'),auth[_0x6f48('0x8')](),controller[_0x6f48('0x10')]);router[_0x6f48('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6f48('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa26f=['get','isAuthenticated','index','/describe','describe','show','post','/:id','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller'];(function(_0x1734ab,_0x254bb2){var _0x41008e=function(_0x131727){while(--_0x131727){_0x1734ab['push'](_0x1734ab['shift']());}};_0x41008e(++_0x254bb2);}(_0xa26f,0x118));var _0xfa26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa26f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfa26('0x0'));var util=require('util');var path=require(_0xfa26('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa26('0x2'));var router=express[_0xfa26('0x3')]();var fs_extra=require(_0xfa26('0x4'));var auth=require(_0xfa26('0x5'));var interaction=require(_0xfa26('0x6'));var config=require('../../config/environment');var controller=require(_0xfa26('0x7'));router[_0xfa26('0x8')]('/',auth[_0xfa26('0x9')](),controller[_0xfa26('0xa')]);router['get'](_0xfa26('0xb'),auth['isAuthenticated'](),controller[_0xfa26('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xfa26('0xd')]);router[_0xfa26('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfa26('0xf'),auth[_0xfa26('0x9')](),controller[_0xfa26('0x10')]);router[_0xfa26('0x11')](_0xfa26('0xf'),auth[_0xfa26('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d68df34..4742b68 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0xb43b,0x1b2));var _0xbb43=function(_0xe590b2,_0x276e1b){_0xe590b2=_0xe590b2-0x0;var _0x1a30e7=_0xb43b[_0xe590b2];return _0x1a30e7;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1dbf9a,_0x2189b1){var _0xc858e9=function(_0x4931ac){while(--_0x4931ac){_0x1dbf9a['push'](_0x1dbf9a['shift']());}};_0xc858e9(++_0x2189b1);}(_0xaa88,0x137));var _0x8aa8=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xaa88[_0x1ccdf7];return _0x52a0ae;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index eff4fab..e815879 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 _0x4507=['request-promise','moment','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','MailTransferReport','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','rimraf','zip-dir'];(function(_0x35997a,_0x19226b){var _0xa69f70=function(_0x424795){while(--_0x424795){_0x35997a['push'](_0x35997a['shift']());}};_0xa69f70(++_0x19226b);}(_0x4507,0x157));var _0x7450=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4507[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7450('0x0'));var zipdir=require(_0x7450('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7450('0x2'));var moment=require(_0x7450('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7450('0x4'));var util=require(_0x7450('0x5'));var path=require(_0x7450('0x6'));var sox=require('sox');var csv=require(_0x7450('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7450('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7450('0x9'));var jsforce=require(_0x7450('0xa'));var deskjs=require(_0x7450('0xb'));var toCsv=require(_0x7450('0x7'));var querystring=require(_0x7450('0xc'));var Papa=require(_0x7450('0xd'));var Redis=require(_0x7450('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7450('0xf'));var logger=require(_0x7450('0x10'))(_0x7450('0x11'));var utils=require(_0x7450('0x12'));var config=require(_0x7450('0x13'));var licenseUtil=require(_0x7450('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26360a,_0x46ff11){_0x46ff11=_0x46ff11||0xcc;return function(_0x2db39e){if(_0x2db39e){return _0x26360a['sendStatus'](_0x46ff11);}return _0x26360a[_0x7450('0x15')](_0x46ff11)['end']();};}function respondWithResult(_0x3aa0e2,_0x100aa6){_0x100aa6=_0x100aa6||0xc8;return function(_0x11efa0){if(_0x11efa0){return _0x3aa0e2[_0x7450('0x15')](_0x100aa6)[_0x7450('0x16')](_0x11efa0);}};}function respondWithFilteredResult(_0x40c0ee,_0x25ce50){return function(_0x1036c7){if(_0x1036c7){var _0x4009d4=typeof _0x25ce50[_0x7450('0x17')]===_0x7450('0x18')&&typeof _0x25ce50[_0x7450('0x19')]==='undefined';var _0x4254e8=_0x1036c7['count'];var _0x2337d6=_0x4009d4?0x0:_0x25ce50[_0x7450('0x17')];var _0x52f594=_0x4009d4?_0x1036c7[_0x7450('0x1a')]:_0x25ce50[_0x7450('0x17')]+_0x25ce50[_0x7450('0x19')];var _0x2b0a67;if(_0x52f594>=_0x4254e8){_0x52f594=_0x4254e8;_0x2b0a67=0xc8;}else{_0x2b0a67=0xce;}_0x40c0ee['status'](_0x2b0a67);return _0x40c0ee[_0x7450('0x1b')](_0x7450('0x1c'),_0x2337d6+'-'+_0x52f594+'/'+_0x4254e8)[_0x7450('0x16')](_0x1036c7);}return null;};}function patchUpdates(_0x10197a){return function(_0x1ae8b3){try{jsonpatch[_0x7450('0x1d')](_0x1ae8b3,_0x10197a,!![]);}catch(_0x5a3757){return BPromise[_0x7450('0x1e')](_0x5a3757);}return _0x1ae8b3[_0x7450('0x1f')]();};}function saveUpdates(_0x5c650d,_0x5edb46){return function(_0x10f08e){if(_0x10f08e){return _0x10f08e[_0x7450('0x20')](_0x5c650d)[_0x7450('0x21')](function(_0x45e57d){return _0x45e57d;});}return null;};}function removeEntity(_0x1c1eb6,_0x56dbe7){return function(_0x143ec4){if(_0x143ec4){return _0x143ec4[_0x7450('0x22')]()[_0x7450('0x21')](function(){_0x1c1eb6[_0x7450('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3603f4,_0x1e34a1){return function(_0x40fa2b){if(!_0x40fa2b){_0x3603f4['sendStatus'](0x194);}return _0x40fa2b;};}function handleError(_0x2c45c8,_0x1b21a6){_0x1b21a6=_0x1b21a6||0x1f4;return function(_0x347fbb){logger['error'](_0x347fbb[_0x7450('0x23')]);if(_0x347fbb[_0x7450('0x24')]){delete _0x347fbb['name'];}_0x2c45c8[_0x7450('0x15')](_0x1b21a6)['send'](_0x347fbb);};}exports[_0x7450('0x25')]=function(_0x3535ce,_0x49566e){var _0x20e4fd={},_0x48d822={},_0xb61a7d={'count':0x0,'rows':[]};var _0x435dbe=_[_0x7450('0x26')](db['MailTransferReport']['rawAttributes'],function(_0xcdb4a4){return{'name':_0xcdb4a4[_0x7450('0x27')],'type':_0xcdb4a4[_0x7450('0x28')]['key']};});_0x48d822[_0x7450('0x29')]=_[_0x7450('0x26')](_0x435dbe,'name');_0x48d822['query']=_['keys'](_0x3535ce[_0x7450('0x2a')]);_0x48d822['filters']=_[_0x7450('0x2b')](_0x48d822[_0x7450('0x29')],_0x48d822[_0x7450('0x2a')]);_0x20e4fd[_0x7450('0x2c')]=_[_0x7450('0x2b')](_0x48d822['model'],qs[_0x7450('0x2d')](_0x3535ce[_0x7450('0x2a')][_0x7450('0x2d')]));_0x20e4fd[_0x7450('0x2c')]=_0x20e4fd[_0x7450('0x2c')][_0x7450('0x2e')]?_0x20e4fd['attributes']:_0x48d822[_0x7450('0x29')];if(!_0x3535ce[_0x7450('0x2a')][_0x7450('0x2f')](_0x7450('0x30'))){_0x20e4fd[_0x7450('0x19')]=qs[_0x7450('0x19')](_0x3535ce[_0x7450('0x2a')][_0x7450('0x19')]);_0x20e4fd['offset']=qs[_0x7450('0x17')](_0x3535ce[_0x7450('0x2a')][_0x7450('0x17')]);}_0x20e4fd['order']=qs[_0x7450('0x31')](_0x3535ce['query']['sort']);_0x20e4fd['where']=qs['filters'](_['pick'](_0x3535ce[_0x7450('0x2a')],_0x48d822[_0x7450('0x32')]),_0x435dbe);if(_0x3535ce[_0x7450('0x2a')][_0x7450('0x33')]){_0x20e4fd[_0x7450('0x34')]=_[_0x7450('0x35')](_0x20e4fd[_0x7450('0x34')],{'$or':_[_0x7450('0x26')](_0x435dbe,function(_0x15e2ab){if(_0x15e2ab['type']!==_0x7450('0x36')){var _0x6d756e={};_0x6d756e[_0x15e2ab[_0x7450('0x24')]]={'$like':'%'+_0x3535ce[_0x7450('0x2a')]['filter']+'%'};return _0x6d756e;}})});}_0x20e4fd=_[_0x7450('0x35')]({},_0x20e4fd,_0x3535ce[_0x7450('0x37')]);var _0x5a0a72={'where':_0x20e4fd[_0x7450('0x34')]};return db['MailTransferReport'][_0x7450('0x1a')](_0x5a0a72)[_0x7450('0x21')](function(_0x146c6a){_0xb61a7d[_0x7450('0x1a')]=_0x146c6a;if(_0x3535ce[_0x7450('0x2a')][_0x7450('0x38')]){_0x20e4fd[_0x7450('0x39')]=[{'all':!![]}];}return db[_0x7450('0x3a')]['findAll'](_0x20e4fd);})[_0x7450('0x21')](function(_0x3e57ea){_0xb61a7d[_0x7450('0x3b')]=_0x3e57ea;return _0xb61a7d;})[_0x7450('0x21')](respondWithFilteredResult(_0x49566e,_0x20e4fd))[_0x7450('0x3c')](handleError(_0x49566e,null));};exports[_0x7450('0x3d')]=function(_0x3fd31d,_0xa2463d){var _0x1373f9={'raw':!![],'where':{'id':_0x3fd31d[_0x7450('0x3e')]['id']}},_0x5cda0c={};_0x5cda0c['model']=_[_0x7450('0x3f')](db[_0x7450('0x3a')][_0x7450('0x40')]);_0x5cda0c[_0x7450('0x2a')]=_[_0x7450('0x3f')](_0x3fd31d[_0x7450('0x2a')]);_0x5cda0c[_0x7450('0x32')]=_['intersection'](_0x5cda0c['model'],_0x5cda0c[_0x7450('0x2a')]);_0x1373f9[_0x7450('0x2c')]=_[_0x7450('0x2b')](_0x5cda0c[_0x7450('0x29')],qs[_0x7450('0x2d')](_0x3fd31d[_0x7450('0x2a')][_0x7450('0x2d')]));_0x1373f9['attributes']=_0x1373f9[_0x7450('0x2c')][_0x7450('0x2e')]?_0x1373f9[_0x7450('0x2c')]:_0x5cda0c[_0x7450('0x29')];if(_0x3fd31d[_0x7450('0x2a')][_0x7450('0x38')]){_0x1373f9['include']=[{'all':!![]}];}_0x1373f9=_[_0x7450('0x35')]({},_0x1373f9,_0x3fd31d[_0x7450('0x37')]);return db[_0x7450('0x3a')][_0x7450('0x41')](_0x1373f9)[_0x7450('0x21')](handleEntityNotFound(_0xa2463d,null))[_0x7450('0x21')](respondWithResult(_0xa2463d,null))[_0x7450('0x3c')](handleError(_0xa2463d,null));};exports[_0x7450('0x42')]=function(_0x315ae3,_0xad4bf7){return db['MailTransferReport'][_0x7450('0x42')](_0x315ae3[_0x7450('0x43')],{})[_0x7450('0x21')](respondWithResult(_0xad4bf7,0xc9))[_0x7450('0x3c')](handleError(_0xad4bf7,null));};exports[_0x7450('0x20')]=function(_0x429b9d,_0x363bb6){if(_0x429b9d['body']['id']){delete _0x429b9d[_0x7450('0x43')]['id'];}return db[_0x7450('0x3a')][_0x7450('0x41')]({'where':{'id':_0x429b9d[_0x7450('0x3e')]['id']}})['then'](handleEntityNotFound(_0x363bb6,null))[_0x7450('0x21')](saveUpdates(_0x429b9d[_0x7450('0x43')],null))[_0x7450('0x21')](respondWithResult(_0x363bb6,null))['catch'](handleError(_0x363bb6,null));};exports[_0x7450('0x22')]=function(_0x2f10c2,_0x5b0531){return db['MailTransferReport']['find']({'where':{'id':_0x2f10c2[_0x7450('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5b0531,null))[_0x7450('0x21')](removeEntity(_0x5b0531,null))[_0x7450('0x3c')](handleError(_0x5b0531,null));};exports[_0x7450('0x44')]=function(_0x7bbe1c,_0x4f79be){return db[_0x7450('0x3a')][_0x7450('0x44')]()[_0x7450('0x21')](respondWithResult(_0x4f79be,null))[_0x7450('0x3c')](handleError(_0x4f79be,null));}; \ No newline at end of file +var _0x891a=['../../mysqldb','sendStatus','status','json','undefined','count','offset','reject','update','destroy','then','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','MailTransferReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x31d4da,_0x3acfa6){var _0xafc711=function(_0x21600f){while(--_0x21600f){_0x31d4da['push'](_0x31d4da['shift']());}};_0xafc711(++_0x3acfa6);}(_0x891a,0x76));var _0xa891=function(_0x5cf0ef,_0x212849){_0x5cf0ef=_0x5cf0ef-0x0;var _0x2904e9=_0x891a[_0x5cf0ef];return _0x2904e9;};'use strict';var emlformat=require(_0xa891('0x0'));var rimraf=require(_0xa891('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa891('0x2'));var moment=require(_0xa891('0x3'));var BPromise=require(_0xa891('0x4'));var Mustache=require(_0xa891('0x5'));var util=require(_0xa891('0x6'));var path=require('path');var sox=require(_0xa891('0x7'));var csv=require(_0xa891('0x8'));var ejs=require(_0xa891('0x9'));var fs=require('fs');var fs_extra=require(_0xa891('0xa'));var _=require(_0xa891('0xb'));var squel=require(_0xa891('0xc'));var crypto=require(_0xa891('0xd'));var jsforce=require(_0xa891('0xe'));var deskjs=require(_0xa891('0xf'));var toCsv=require(_0xa891('0x8'));var querystring=require(_0xa891('0x10'));var Papa=require(_0xa891('0x11'));var Redis=require('ioredis');var authService=require(_0xa891('0x12'));var qs=require(_0xa891('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa891('0x14'))(_0xa891('0x15'));var utils=require(_0xa891('0x16'));var config=require(_0xa891('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa891('0x18'))['db'];function respondWithStatusCode(_0x375fa5,_0x532354){_0x532354=_0x532354||0xcc;return function(_0x3e8b17){if(_0x3e8b17){return _0x375fa5[_0xa891('0x19')](_0x532354);}return _0x375fa5['status'](_0x532354)['end']();};}function respondWithResult(_0x935d75,_0x3a7d2a){_0x3a7d2a=_0x3a7d2a||0xc8;return function(_0xd5cace){if(_0xd5cace){return _0x935d75[_0xa891('0x1a')](_0x3a7d2a)[_0xa891('0x1b')](_0xd5cace);}};}function respondWithFilteredResult(_0x499d75,_0x2c5c84){return function(_0x468265){if(_0x468265){var _0x4f3b74=typeof _0x2c5c84['offset']===_0xa891('0x1c')&&typeof _0x2c5c84['limit']===_0xa891('0x1c');var _0x2c373e=_0x468265[_0xa891('0x1d')];var _0x34561e=_0x4f3b74?0x0:_0x2c5c84[_0xa891('0x1e')];var _0x1f0e94=_0x4f3b74?_0x468265[_0xa891('0x1d')]:_0x2c5c84[_0xa891('0x1e')]+_0x2c5c84['limit'];var _0x23326d;if(_0x1f0e94>=_0x2c373e){_0x1f0e94=_0x2c373e;_0x23326d=0xc8;}else{_0x23326d=0xce;}_0x499d75[_0xa891('0x1a')](_0x23326d);return _0x499d75['set']('Content-Range',_0x34561e+'-'+_0x1f0e94+'/'+_0x2c373e)['json'](_0x468265);}return null;};}function patchUpdates(_0x802cfe){return function(_0x4b8ec3){try{jsonpatch['apply'](_0x4b8ec3,_0x802cfe,!![]);}catch(_0x4d3681){return BPromise[_0xa891('0x1f')](_0x4d3681);}return _0x4b8ec3['save']();};}function saveUpdates(_0xa4a7bb,_0x50c5c8){return function(_0x4094f4){if(_0x4094f4){return _0x4094f4[_0xa891('0x20')](_0xa4a7bb)['then'](function(_0x5d29d2){return _0x5d29d2;});}return null;};}function removeEntity(_0x616e68,_0xab4c53){return function(_0x101138){if(_0x101138){return _0x101138[_0xa891('0x21')]()[_0xa891('0x22')](function(){_0x616e68['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dce15,_0x38ab95){return function(_0x42e4b9){if(!_0x42e4b9){_0x4dce15[_0xa891('0x19')](0x194);}return _0x42e4b9;};}function handleError(_0x3558b5,_0x5bb91d){_0x5bb91d=_0x5bb91d||0x1f4;return function(_0x584546){logger['error'](_0x584546[_0xa891('0x23')]);if(_0x584546[_0xa891('0x24')]){delete _0x584546[_0xa891('0x24')];}_0x3558b5[_0xa891('0x1a')](_0x5bb91d)[_0xa891('0x25')](_0x584546);};}exports[_0xa891('0x26')]=function(_0xcbb3b7,_0xf125a8){var _0xbf60fc={},_0x473fdc={},_0x5541fd={'count':0x0,'rows':[]};var _0x3cbd78=_['map'](db['MailTransferReport']['rawAttributes'],function(_0x55f9f1){return{'name':_0x55f9f1[_0xa891('0x27')],'type':_0x55f9f1[_0xa891('0x28')][_0xa891('0x29')]};});_0x473fdc[_0xa891('0x2a')]=_[_0xa891('0x2b')](_0x3cbd78,'name');_0x473fdc['query']=_[_0xa891('0x2c')](_0xcbb3b7[_0xa891('0x2d')]);_0x473fdc[_0xa891('0x2e')]=_[_0xa891('0x2f')](_0x473fdc[_0xa891('0x2a')],_0x473fdc['query']);_0xbf60fc[_0xa891('0x30')]=_['intersection'](_0x473fdc[_0xa891('0x2a')],qs[_0xa891('0x31')](_0xcbb3b7['query'][_0xa891('0x31')]));_0xbf60fc[_0xa891('0x30')]=_0xbf60fc['attributes'][_0xa891('0x32')]?_0xbf60fc[_0xa891('0x30')]:_0x473fdc['model'];if(!_0xcbb3b7[_0xa891('0x2d')]['hasOwnProperty'](_0xa891('0x33'))){_0xbf60fc[_0xa891('0x34')]=qs[_0xa891('0x34')](_0xcbb3b7[_0xa891('0x2d')]['limit']);_0xbf60fc['offset']=qs[_0xa891('0x1e')](_0xcbb3b7['query'][_0xa891('0x1e')]);}_0xbf60fc[_0xa891('0x35')]=qs['sort'](_0xcbb3b7[_0xa891('0x2d')][_0xa891('0x36')]);_0xbf60fc[_0xa891('0x37')]=qs[_0xa891('0x2e')](_[_0xa891('0x38')](_0xcbb3b7[_0xa891('0x2d')],_0x473fdc[_0xa891('0x2e')]),_0x3cbd78);if(_0xcbb3b7[_0xa891('0x2d')]['filter']){_0xbf60fc['where']=_['merge'](_0xbf60fc[_0xa891('0x37')],{'$or':_[_0xa891('0x2b')](_0x3cbd78,function(_0x3846ff){if(_0x3846ff[_0xa891('0x28')]!==_0xa891('0x39')){var _0x93826e={};_0x93826e[_0x3846ff['name']]={'$like':'%'+_0xcbb3b7[_0xa891('0x2d')]['filter']+'%'};return _0x93826e;}})});}_0xbf60fc=_[_0xa891('0x3a')]({},_0xbf60fc,_0xcbb3b7[_0xa891('0x3b')]);var _0x23f170={'where':_0xbf60fc[_0xa891('0x37')]};return db[_0xa891('0x3c')][_0xa891('0x1d')](_0x23f170)[_0xa891('0x22')](function(_0x12e04c){_0x5541fd[_0xa891('0x1d')]=_0x12e04c;if(_0xcbb3b7[_0xa891('0x2d')]['includeAll']){_0xbf60fc[_0xa891('0x3d')]=[{'all':!![]}];}return db[_0xa891('0x3c')][_0xa891('0x3e')](_0xbf60fc);})[_0xa891('0x22')](function(_0x3ea277){_0x5541fd[_0xa891('0x3f')]=_0x3ea277;return _0x5541fd;})[_0xa891('0x22')](respondWithFilteredResult(_0xf125a8,_0xbf60fc))[_0xa891('0x40')](handleError(_0xf125a8,null));};exports[_0xa891('0x41')]=function(_0x4e4712,_0x5114bd){var _0x1fc882={'raw':!![],'where':{'id':_0x4e4712[_0xa891('0x42')]['id']}},_0x48b3e9={};_0x48b3e9[_0xa891('0x2a')]=_[_0xa891('0x2c')](db[_0xa891('0x3c')][_0xa891('0x43')]);_0x48b3e9[_0xa891('0x2d')]=_[_0xa891('0x2c')](_0x4e4712['query']);_0x48b3e9[_0xa891('0x2e')]=_['intersection'](_0x48b3e9[_0xa891('0x2a')],_0x48b3e9[_0xa891('0x2d')]);_0x1fc882[_0xa891('0x30')]=_[_0xa891('0x2f')](_0x48b3e9[_0xa891('0x2a')],qs[_0xa891('0x31')](_0x4e4712['query']['fields']));_0x1fc882['attributes']=_0x1fc882[_0xa891('0x30')][_0xa891('0x32')]?_0x1fc882[_0xa891('0x30')]:_0x48b3e9['model'];if(_0x4e4712[_0xa891('0x2d')][_0xa891('0x44')]){_0x1fc882[_0xa891('0x3d')]=[{'all':!![]}];}_0x1fc882=_['merge']({},_0x1fc882,_0x4e4712[_0xa891('0x3b')]);return db[_0xa891('0x3c')][_0xa891('0x45')](_0x1fc882)[_0xa891('0x22')](handleEntityNotFound(_0x5114bd,null))[_0xa891('0x22')](respondWithResult(_0x5114bd,null))[_0xa891('0x40')](handleError(_0x5114bd,null));};exports['create']=function(_0x2cd842,_0x4ceaea){return db['MailTransferReport']['create'](_0x2cd842[_0xa891('0x46')],{})['then'](respondWithResult(_0x4ceaea,0xc9))[_0xa891('0x40')](handleError(_0x4ceaea,null));};exports[_0xa891('0x20')]=function(_0x4ba57b,_0x85f599){if(_0x4ba57b['body']['id']){delete _0x4ba57b[_0xa891('0x46')]['id'];}return db['MailTransferReport'][_0xa891('0x45')]({'where':{'id':_0x4ba57b[_0xa891('0x42')]['id']}})[_0xa891('0x22')](handleEntityNotFound(_0x85f599,null))[_0xa891('0x22')](saveUpdates(_0x4ba57b[_0xa891('0x46')],null))[_0xa891('0x22')](respondWithResult(_0x85f599,null))[_0xa891('0x40')](handleError(_0x85f599,null));};exports[_0xa891('0x21')]=function(_0x30e749,_0x3dcdde){return db['MailTransferReport']['find']({'where':{'id':_0x30e749['params']['id']}})[_0xa891('0x22')](handleEntityNotFound(_0x3dcdde,null))[_0xa891('0x22')](removeEntity(_0x3dcdde,null))['catch'](handleError(_0x3dcdde,null));};exports['describe']=function(_0xfb1307,_0x35ef89){return db[_0xa891('0x3c')]['describe']()[_0xa891('0x22')](respondWithResult(_0x35ef89,null))[_0xa891('0x40')](handleError(_0x35ef89,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index eb0e754..f0368ef 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 _0x3468=['path','rimraf','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','api','request-promise'];(function(_0x5aa008,_0x3a7feb){var _0x532ae4=function(_0x151651){while(--_0x151651){_0x5aa008['push'](_0x5aa008['shift']());}};_0x532ae4(++_0x3a7feb);}(_0x3468,0x8d));var _0x8346=function(_0x10c6a0,_0x530f07){_0x10c6a0=_0x10c6a0-0x0;var _0x577f36=_0x3468[_0x10c6a0];return _0x577f36;};'use strict';var _=require(_0x8346('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8346('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8346('0x2'));var fs=require('fs');var path=require(_0x8346('0x3'));var rimraf=require(_0x8346('0x4'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x2fc584,_0x52f1be){return _0x2fc584[_0x8346('0x5')](_0x8346('0x6'),attributes,{'tableName':_0x8346('0x7'),'paranoid':![],'indexes':[{'name':_0x8346('0x8'),'fields':[_0x8346('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4534=['bluebird','request-promise','path','rimraf','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x39bfa5,_0x4c50cc){var _0x16aef9=function(_0x1175ab){while(--_0x1175ab){_0x39bfa5['push'](_0x39bfa5['shift']());}};_0x16aef9(++_0x4c50cc);}(_0x4534,0x141));var _0x4453=function(_0x2b7f22,_0x188a18){_0x2b7f22=_0x2b7f22-0x0;var _0x4508e6=_0x4534[_0x2b7f22];return _0x4508e6;};'use strict';var _=require(_0x4453('0x0'));var util=require(_0x4453('0x1'));var logger=require(_0x4453('0x2'))(_0x4453('0x3'));var moment=require('moment');var BPromise=require(_0x4453('0x4'));var rp=require(_0x4453('0x5'));var fs=require('fs');var path=require(_0x4453('0x6'));var rimraf=require(_0x4453('0x7'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0x4453('0x8')]=function(_0x456815,_0x25bf80){return _0x456815[_0x4453('0x9')](_0x4453('0xa'),attributes,{'tableName':_0x4453('0xb'),'paranoid':![],'indexes':[{'name':_0x4453('0xc'),'fields':[_0x4453('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 280af4b..629f329 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 _0xa038=['stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2f7eeb,_0x41872b){var _0x44f27e=function(_0x2b2cac){while(--_0x2b2cac){_0x2f7eeb['push'](_0x2f7eeb['shift']());}};_0x44f27e(++_0x41872b);}(_0xa038,0x1eb));var _0x8a03=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xa038[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x8a03('0x0'));var util=require('util');var moment=require(_0x8a03('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a03('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a03('0x3'))['db'];var utils=require(_0x8a03('0x4'));var logger=require(_0x8a03('0x5'))(_0x8a03('0x6'));var config=require(_0x8a03('0x7'));var jayson=require(_0x8a03('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53a901,_0x10bf5a,_0x486e06){return new BPromise(function(_0x111a6a,_0x29f370){return client['request'](_0x53a901,_0x486e06)[_0x8a03('0x9')](function(_0x2f2664){logger[_0x8a03('0xa')](_0x8a03('0xb'),_0x10bf5a,_0x8a03('0xc'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x10bf5a,_0x8a03('0xc'),JSON[_0x8a03('0xd')](_0x2f2664));if(_0x2f2664['error']){if(_0x2f2664[_0x8a03('0xe')][_0x8a03('0xf')]===0x1f4){logger[_0x8a03('0xe')](_0x8a03('0xb'),_0x10bf5a,_0x2f2664[_0x8a03('0xe')][_0x8a03('0x10')]);return _0x29f370(_0x2f2664['error']['message']);}logger[_0x8a03('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x10bf5a,_0x2f2664[_0x8a03('0xe')][_0x8a03('0x10')]);return _0x111a6a(_0x2f2664[_0x8a03('0xe')][_0x8a03('0x10')]);}else{logger[_0x8a03('0xa')](_0x8a03('0xb'),_0x10bf5a,_0x8a03('0xc'));_0x111a6a(_0x2f2664['result'][_0x8a03('0x10')]);}})[_0x8a03('0x11')](function(_0x13a8a6){logger[_0x8a03('0xe')](_0x8a03('0xb'),_0x10bf5a,_0x13a8a6);_0x29f370(_0x13a8a6);});});} \ No newline at end of file +var _0xc8dc=['jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0xc8dc,0x1f2));var _0xcc8d=function(_0x188c88,_0x210793){_0x188c88=_0x188c88-0x0;var _0x4e4c38=_0xc8dc[_0x188c88];return _0x4e4c38;};'use strict';var _=require(_0xcc8d('0x0'));var util=require(_0xcc8d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc8d('0x2'));var fs=require('fs');var Redis=require(_0xcc8d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc8d('0x4'));var logger=require('../../config/logger')(_0xcc8d('0x5'));var config=require('../../config/environment');var jayson=require(_0xcc8d('0x6'));var client=jayson[_0xcc8d('0x7')][_0xcc8d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x367634,_0x4a52d8,_0x141078){return new BPromise(function(_0xe62d80,_0x9e4f8e){return client[_0xcc8d('0x9')](_0x367634,_0x141078)[_0xcc8d('0xa')](function(_0x5aa17e){logger[_0xcc8d('0xb')](_0xcc8d('0xc'),_0x4a52d8,_0xcc8d('0xd'));logger[_0xcc8d('0xe')](_0xcc8d('0xf'),_0x4a52d8,'request\x20sent',JSON['stringify'](_0x5aa17e));if(_0x5aa17e['error']){if(_0x5aa17e[_0xcc8d('0x10')][_0xcc8d('0x11')]===0x1f4){logger[_0xcc8d('0x10')](_0xcc8d('0xc'),_0x4a52d8,_0x5aa17e[_0xcc8d('0x10')][_0xcc8d('0x12')]);return _0x9e4f8e(_0x5aa17e[_0xcc8d('0x10')][_0xcc8d('0x12')]);}logger['error'](_0xcc8d('0xc'),_0x4a52d8,_0x5aa17e[_0xcc8d('0x10')]['message']);return _0xe62d80(_0x5aa17e['error'][_0xcc8d('0x12')]);}else{logger[_0xcc8d('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x4a52d8,_0xcc8d('0xd'));_0xe62d80(_0x5aa17e[_0xcc8d('0x13')][_0xcc8d('0x12')]);}})[_0xcc8d('0x14')](function(_0x5c6125){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4a52d8,_0x5c6125);_0x9e4f8e(_0x5c6125);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b819f85..4fc6141 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 _0x8668=['update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put'];(function(_0x29b29c,_0x29ecd9){var _0x54b5cb=function(_0x5e5902){while(--_0x5e5902){_0x29b29c['push'](_0x29b29c['shift']());}};_0x54b5cb(++_0x29ecd9);}(_0x8668,0xaa));var _0x8866=function(_0x474e7c,_0x31b849){_0x474e7c=_0x474e7c-0x0;var _0x764d7c=_0x8668[_0x474e7c];return _0x764d7c;};'use strict';var multer=require(_0x8866('0x0'));var util=require(_0x8866('0x1'));var path=require('path');var timeout=require(_0x8866('0x2'));var express=require(_0x8866('0x3'));var router=express[_0x8866('0x4')]();var fs_extra=require(_0x8866('0x5'));var auth=require(_0x8866('0x6'));var interaction=require(_0x8866('0x7'));var config=require(_0x8866('0x8'));var controller=require(_0x8866('0x9'));router['get']('/',auth[_0x8866('0xa')](),controller[_0x8866('0xb')]);router[_0x8866('0xc')](_0x8866('0xd'),auth[_0x8866('0xa')](),controller[_0x8866('0xe')]);router[_0x8866('0xc')](_0x8866('0xf'),auth['isAuthenticated'](),controller[_0x8866('0x10')]);router['post']('/',auth[_0x8866('0xa')](),controller[_0x8866('0x11')]);router[_0x8866('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8866('0x13')]);router['delete'](_0x8866('0xf'),auth[_0x8866('0xa')](),controller['destroy']);module[_0x8866('0x14')]=router; \ No newline at end of file +var _0x0c63=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x34e999,_0x227313){var _0xea8594=function(_0x533c37){while(--_0x533c37){_0x34e999['push'](_0x34e999['shift']());}};_0xea8594(++_0x227313);}(_0x0c63,0x14d));var _0x30c6=function(_0x34017e,_0x25f6b1){_0x34017e=_0x34017e-0x0;var _0x3e725e=_0x0c63[_0x34017e];return _0x3e725e;};'use strict';var multer=require(_0x30c6('0x0'));var util=require(_0x30c6('0x1'));var path=require(_0x30c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x30c6('0x3'));var router=express[_0x30c6('0x4')]();var fs_extra=require(_0x30c6('0x5'));var auth=require(_0x30c6('0x6'));var interaction=require(_0x30c6('0x7'));var config=require(_0x30c6('0x8'));var controller=require(_0x30c6('0x9'));router[_0x30c6('0xa')]('/',auth[_0x30c6('0xb')](),controller[_0x30c6('0xc')]);router[_0x30c6('0xa')](_0x30c6('0xd'),auth['isAuthenticated'](),controller[_0x30c6('0xe')]);router[_0x30c6('0xa')](_0x30c6('0xf'),auth[_0x30c6('0xb')](),controller[_0x30c6('0x10')]);router[_0x30c6('0x11')]('/',auth[_0x30c6('0xb')](),controller[_0x30c6('0x12')]);router[_0x30c6('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x30c6('0x14')]);router[_0x30c6('0x15')]('/:id',auth[_0x30c6('0xb')](),controller[_0x30c6('0x16')]);module[_0x30c6('0x17')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 581e4de..7266a8d 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 _0x2a79=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','seconds','setDataValue'];(function(_0x4cea31,_0x54ef05){var _0x30bf16=function(_0x1530a7){while(--_0x1530a7){_0x4cea31['push'](_0x4cea31['shift']());}};_0x30bf16(++_0x54ef05);}(_0x2a79,0x6c));var _0x92a7=function(_0x4541ec,_0x5e09e8){_0x4541ec=_0x4541ec-0x0;var _0x5bfdfa=_0x2a79[_0x4541ec];return _0x5bfdfa;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x92a7('0x0'));module[_0x92a7('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x92a7('0x2')]},'interface':{'type':Sequelize[_0x92a7('0x2')]},'type':{'type':Sequelize[_0x92a7('0x2')],'defaultValue':_0x92a7('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x92a7('0x4')]},'enterAt':{'type':Sequelize[_0x92a7('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4f1910){var _0x584bdf=moment(_0x4f1910);var _0x172a4e=moment(this[_0x92a7('0x6')]('enterAt'));var _0x397bc0=_0x584bdf['diff'](_0x172a4e,_0x92a7('0x7'));this[_0x92a7('0x8')]('exitAt',_0x4f1910);this[_0x92a7('0x8')]('duration',_0x397bc0>=0x0?_0x397bc0:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x92a7('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x92a7('0xa')},'data4':{'type':Sequelize[_0x92a7('0x2')],'comment':_0x92a7('0xb')},'data5':{'type':Sequelize['STRING'],'comment':_0x92a7('0xc')},'role':{'type':Sequelize[_0x92a7('0x2')]},'internal':{'type':Sequelize[_0x92a7('0x4')]},'uniqueid':{'type':Sequelize[_0x92a7('0x2')]}}; \ No newline at end of file +var _0x0be7=['talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x1471cd,_0x31b38d){var _0x1134af=function(_0x289cd0){while(--_0x289cd0){_0x1471cd['push'](_0x1471cd['shift']());}};_0x1134af(++_0x31b38d);}(_0x0be7,0x182));var _0x70be=function(_0x26e1b9,_0x62eeef){_0x26e1b9=_0x26e1b9-0x0;var _0x1fc560=_0x0be7[_0x26e1b9];return _0x1fc560;};'use strict';var Sequelize=require(_0x70be('0x0'));var moment=require('moment');module[_0x70be('0x1')]={'channel':{'type':Sequelize[_0x70be('0x2')]},'membername':{'type':Sequelize[_0x70be('0x2')]},'interface':{'type':Sequelize[_0x70be('0x2')]},'type':{'type':Sequelize[_0x70be('0x2')],'defaultValue':_0x70be('0x3'),'comment':_0x70be('0x4')},'duration':{'type':Sequelize[_0x70be('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x70be('0x6')],'set':function(_0x4a730d){var _0x5e0cbb=moment(_0x4a730d);var _0x4a76e0=moment(this[_0x70be('0x7')]('enterAt'));var _0x5f687=_0x5e0cbb[_0x70be('0x8')](_0x4a76e0,_0x70be('0x9'));this[_0x70be('0xa')](_0x70be('0xb'),_0x4a730d);this[_0x70be('0xa')]('duration',_0x5f687>=0x0?_0x5f687:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x70be('0xc')},'data2':{'type':Sequelize[_0x70be('0x2')],'comment':_0x70be('0xd')},'data3':{'type':Sequelize[_0x70be('0x2')],'comment':_0x70be('0xe')},'data4':{'type':Sequelize[_0x70be('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x70be('0xf')},'role':{'type':Sequelize[_0x70be('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x70be('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index aec8351..e8aece9 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 _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(_0x1b6621,_0x105c12){var _0x12cad9=function(_0x523cf2){while(--_0x523cf2){_0x1b6621['push'](_0x1b6621['shift']());}};_0x12cad9(++_0x105c12);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x55ca,0x126));var _0xa55c=function(_0x53a1be,_0x42dff2){_0x53a1be=_0x53a1be-0x0;var _0x38ae84=_0x55ca[_0x53a1be];return _0x38ae84;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index ea615d8..4c0206f 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 _0xd4ff=['exports','MemberReport','membername_interface','membername','interface','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x56027b,_0x386782){var _0x505161=function(_0x3b3ac3){while(--_0x3b3ac3){_0x56027b['push'](_0x56027b['shift']());}};_0x505161(++_0x386782);}(_0xd4ff,0x18b));var _0xfd4f=function(_0x2405de,_0x548637){_0x2405de=_0x2405de-0x0;var _0xeadb6e=_0xd4ff[_0x2405de];return _0xeadb6e;};'use strict';var _=require(_0xfd4f('0x0'));var util=require(_0xfd4f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfd4f('0x2'));var BPromise=require(_0xfd4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd4f('0x4'));var rimraf=require(_0xfd4f('0x5'));var config=require(_0xfd4f('0x6'));var attributes=require(_0xfd4f('0x7'));module[_0xfd4f('0x8')]=function(_0x126751,_0x49404b){return _0x126751['define'](_0xfd4f('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xfd4f('0xa'),'fields':[_0xfd4f('0xb'),_0xfd4f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d32=['membername','lodash','request-promise','path','rimraf','../../config/environment','define'];(function(_0x503a61,_0x1a48f7){var _0x2202cb=function(_0x4e6fce){while(--_0x4e6fce){_0x503a61['push'](_0x503a61['shift']());}};_0x2202cb(++_0x1a48f7);}(_0x3d32,0x13c));var _0x23d3=function(_0x579a12,_0xaf7f4c){_0x579a12=_0x579a12-0x0;var _0x42758c=_0x3d32[_0x579a12];return _0x42758c;};'use strict';var _=require(_0x23d3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23d3('0x1'));var fs=require('fs');var path=require(_0x23d3('0x2'));var rimraf=require(_0x23d3('0x3'));var config=require(_0x23d3('0x4'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x40e1c4,_0x5ae258){return _0x40e1c4[_0x23d3('0x5')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x23d3('0x6'),'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 6f9bb52..d0e81a7 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 _0xac0a=['error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','limit','include','map','model','attributes','CreateMemberReport','create','then','UpdateMemberReport','body','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15e73b,_0x191a5d){var _0x433c2a=function(_0x1ea70c){while(--_0x1ea70c){_0x15e73b['push'](_0x15e73b['shift']());}};_0x433c2a(++_0x191a5d);}(_0xac0a,0x11e));var _0xaac0=function(_0x4147b1,_0x34bf45){_0x4147b1=_0x4147b1-0x0;var _0x5b1d00=_0xac0a[_0x4147b1];return _0x5b1d00;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaac0('0x0'));var BPromise=require(_0xaac0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaac0('0x2'));var db=require(_0xaac0('0x3'))['db'];var utils=require(_0xaac0('0x4'));var logger=require(_0xaac0('0x5'))(_0xaac0('0x6'));var config=require(_0xaac0('0x7'));var jayson=require(_0xaac0('0x8'));var client=jayson[_0xaac0('0x9')][_0xaac0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3366d,_0x2d5629,_0x1b9348){return new BPromise(function(_0x5d27ab,_0x91b8f4){return client[_0xaac0('0xb')](_0xc3366d,_0x1b9348)['then'](function(_0x1bdda5){logger[_0xaac0('0xc')](_0xaac0('0xd'),_0x2d5629,_0xaac0('0xe'));logger[_0xaac0('0xf')](_0xaac0('0x10'),_0x2d5629,_0xaac0('0xe'),JSON[_0xaac0('0x11')](_0x1bdda5));if(_0x1bdda5[_0xaac0('0x12')]){if(_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x13')]===0x1f4){logger[_0xaac0('0x12')](_0xaac0('0xd'),_0x2d5629,_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);return _0x91b8f4(_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);}logger[_0xaac0('0x12')](_0xaac0('0xd'),_0x2d5629,_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);return _0x5d27ab(_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);}else{logger[_0xaac0('0xc')](_0xaac0('0xd'),_0x2d5629,_0xaac0('0xe'));_0x5d27ab(_0x1bdda5[_0xaac0('0x15')]['message']);}})[_0xaac0('0x16')](function(_0x542132){logger['error'](_0xaac0('0xd'),_0x2d5629,_0x542132);_0x91b8f4(_0x542132);});});}exports[_0xaac0('0x17')]=function(_0x4a7b58){var _0x2f6dcf=this;return new Promise(function(_0x3cdc8f,_0x4b80e2){return db[_0xaac0('0x18')][_0xaac0('0x19')]({'raw':_0x4a7b58[_0xaac0('0x1a')]?_0x4a7b58[_0xaac0('0x1a')][_0xaac0('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a7b58[_0xaac0('0x1a')]?_0x4a7b58['options']['where']||null:null,'attributes':_0x4a7b58[_0xaac0('0x1a')]?_0x4a7b58[_0xaac0('0x1a')]['attributes']||null:null,'limit':_0x4a7b58['options']?_0x4a7b58[_0xaac0('0x1a')][_0xaac0('0x1c')]||null:null,'include':_0x4a7b58['options']?_0x4a7b58[_0xaac0('0x1a')][_0xaac0('0x1d')]?_[_0xaac0('0x1e')](_0x4a7b58['options'][_0xaac0('0x1d')],function(_0x206fb4){return{'model':db[_0x206fb4[_0xaac0('0x1f')]],'as':_0x206fb4['as'],'attributes':_0x206fb4[_0xaac0('0x20')],'include':_0x206fb4[_0xaac0('0x1d')]?_[_0xaac0('0x1e')](_0x206fb4[_0xaac0('0x1d')],function(_0x50106e){return{'model':db[_0x50106e[_0xaac0('0x1f')]],'as':_0x50106e['as'],'attributes':_0x50106e[_0xaac0('0x20')],'include':_0x50106e[_0xaac0('0x1d')]?_[_0xaac0('0x1e')](_0x50106e['include'],function(_0x2f626f){return{'model':db[_0x2f626f[_0xaac0('0x1f')]],'as':_0x2f626f['as'],'attributes':_0x2f626f[_0xaac0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b9593){logger[_0xaac0('0xc')](_0xaac0('0x17'),_0x4a7b58);logger['debug']('GetMemberReport',_0x4a7b58,JSON[_0xaac0('0x11')](_0x5b9593));_0x3cdc8f(_0x5b9593);})[_0xaac0('0x16')](function(_0x50aae6){logger['error'](_0xaac0('0x17'),_0x50aae6[_0xaac0('0x14')],_0x4a7b58);_0x4b80e2(_0x2f6dcf[_0xaac0('0x12')](0x1f4,_0x50aae6[_0xaac0('0x14')]));});});};exports[_0xaac0('0x21')]=function(_0x5292bb){var _0x32d552=this;return new Promise(function(_0xe2d7c1,_0x3bd25a){return db[_0xaac0('0x18')][_0xaac0('0x22')](_0x5292bb['body'],{'raw':_0x5292bb[_0xaac0('0x1a')]?_0x5292bb['options'][_0xaac0('0x1b')]===undefined?!![]:![]:!![]})[_0xaac0('0x23')](function(_0x5028d8){logger[_0xaac0('0xc')](_0xaac0('0x21'),_0x5292bb);logger['debug'](_0xaac0('0x21'),_0x5292bb,JSON['stringify'](_0x5028d8));_0xe2d7c1(_0x5028d8);})[_0xaac0('0x16')](function(_0x4a7ad7){logger[_0xaac0('0x12')](_0xaac0('0x21'),_0x4a7ad7[_0xaac0('0x14')],_0x5292bb);_0x3bd25a(_0x32d552[_0xaac0('0x12')](0x1f4,_0x4a7ad7[_0xaac0('0x14')]));});});};exports[_0xaac0('0x24')]=function(_0x318291){var _0x2cf7b7=this;return new Promise(function(_0x166862,_0x36a8a8){return db[_0xaac0('0x18')]['update'](_0x318291[_0xaac0('0x25')],{'raw':_0x318291[_0xaac0('0x1a')]?_0x318291[_0xaac0('0x1a')][_0xaac0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x318291['options']?_0x318291['options']['where']||null:null,'attributes':_0x318291['options']?_0x318291[_0xaac0('0x1a')][_0xaac0('0x20')]||null:null,'limit':_0x318291[_0xaac0('0x1a')]?_0x318291['options']['limit']||null:null})[_0xaac0('0x23')](function(_0x426faa){logger[_0xaac0('0xc')](_0xaac0('0x24'),_0x318291);logger['debug']('UpdateMemberReport',_0x318291,JSON['stringify'](_0x426faa));_0x166862(_0x426faa);})[_0xaac0('0x16')](function(_0xfa90b5){logger[_0xaac0('0x12')](_0xaac0('0x24'),_0xfa90b5[_0xaac0('0x14')],_0x318291);_0x36a8a8(_0x2cf7b7['error'](0x1f4,_0xfa90b5[_0xaac0('0x14')]));});});}; \ No newline at end of file +var _0x0619=['MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','include','map','model','attributes','info','CreateMemberReport','create','body','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5bac10,_0x436643){var _0x362c49=function(_0x28b940){while(--_0x28b940){_0x5bac10['push'](_0x5bac10['shift']());}};_0x362c49(++_0x436643);}(_0x0619,0x90));var _0x9061=function(_0x433942,_0x437df2){_0x433942=_0x433942-0x0;var _0x4796cb=_0x0619[_0x433942];return _0x4796cb;};'use strict';var _=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var moment=require(_0x9061('0x2'));var BPromise=require(_0x9061('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9061('0x4'));var db=require(_0x9061('0x5'))['db'];var utils=require(_0x9061('0x6'));var logger=require(_0x9061('0x7'))(_0x9061('0x8'));var config=require(_0x9061('0x9'));var jayson=require(_0x9061('0xa'));var client=jayson[_0x9061('0xb')][_0x9061('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x259fbd,_0x287026,_0x5a950f){return new BPromise(function(_0x3ab87c,_0x59c323){return client['request'](_0x259fbd,_0x5a950f)[_0x9061('0xd')](function(_0x3b27f7){logger['info']('MemberReport,\x20%s,\x20%s',_0x287026,_0x9061('0xe'));logger[_0x9061('0xf')](_0x9061('0x10'),_0x287026,_0x9061('0xe'),JSON[_0x9061('0x11')](_0x3b27f7));if(_0x3b27f7[_0x9061('0x12')]){if(_0x3b27f7[_0x9061('0x12')][_0x9061('0x13')]===0x1f4){logger[_0x9061('0x12')](_0x9061('0x14'),_0x287026,_0x3b27f7[_0x9061('0x12')][_0x9061('0x15')]);return _0x59c323(_0x3b27f7[_0x9061('0x12')]['message']);}logger['error'](_0x9061('0x14'),_0x287026,_0x3b27f7[_0x9061('0x12')][_0x9061('0x15')]);return _0x3ab87c(_0x3b27f7[_0x9061('0x12')][_0x9061('0x15')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x287026,_0x9061('0xe'));_0x3ab87c(_0x3b27f7[_0x9061('0x16')]['message']);}})[_0x9061('0x17')](function(_0x4f2ea6){logger[_0x9061('0x12')]('MemberReport,\x20%s,\x20%s',_0x287026,_0x4f2ea6);_0x59c323(_0x4f2ea6);});});}exports[_0x9061('0x18')]=function(_0x5eae3a){var _0xe89ff2=this;return new Promise(function(_0x358907,_0x1cabb0){return db[_0x9061('0x19')][_0x9061('0x1a')]({'raw':_0x5eae3a[_0x9061('0x1b')]?_0x5eae3a[_0x9061('0x1b')][_0x9061('0x1c')]===undefined?!![]:![]:!![],'where':_0x5eae3a['options']?_0x5eae3a[_0x9061('0x1b')][_0x9061('0x1d')]||null:null,'attributes':_0x5eae3a[_0x9061('0x1b')]?_0x5eae3a[_0x9061('0x1b')]['attributes']||null:null,'limit':_0x5eae3a[_0x9061('0x1b')]?_0x5eae3a[_0x9061('0x1b')]['limit']||null:null,'include':_0x5eae3a['options']?_0x5eae3a['options'][_0x9061('0x1e')]?_[_0x9061('0x1f')](_0x5eae3a['options']['include'],function(_0xbaa53a){return{'model':db[_0xbaa53a['model']],'as':_0xbaa53a['as'],'attributes':_0xbaa53a['attributes'],'include':_0xbaa53a[_0x9061('0x1e')]?_[_0x9061('0x1f')](_0xbaa53a[_0x9061('0x1e')],function(_0x17825b){return{'model':db[_0x17825b[_0x9061('0x20')]],'as':_0x17825b['as'],'attributes':_0x17825b[_0x9061('0x21')],'include':_0x17825b[_0x9061('0x1e')]?_[_0x9061('0x1f')](_0x17825b[_0x9061('0x1e')],function(_0x26962b){return{'model':db[_0x26962b[_0x9061('0x20')]],'as':_0x26962b['as'],'attributes':_0x26962b[_0x9061('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf4f4){logger[_0x9061('0x22')](_0x9061('0x18'),_0x5eae3a);logger[_0x9061('0xf')](_0x9061('0x18'),_0x5eae3a,JSON[_0x9061('0x11')](_0x5bf4f4));_0x358907(_0x5bf4f4);})['catch'](function(_0x2355d3){logger['error']('GetMemberReport',_0x2355d3[_0x9061('0x15')],_0x5eae3a);_0x1cabb0(_0xe89ff2[_0x9061('0x12')](0x1f4,_0x2355d3[_0x9061('0x15')]));});});};exports[_0x9061('0x23')]=function(_0x230a29){var _0x5a9ca4=this;return new Promise(function(_0x3c29d1,_0x33e248){return db[_0x9061('0x19')][_0x9061('0x24')](_0x230a29[_0x9061('0x25')],{'raw':_0x230a29['options']?_0x230a29[_0x9061('0x1b')][_0x9061('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x70754f){logger['info'](_0x9061('0x23'),_0x230a29);logger['debug']('CreateMemberReport',_0x230a29,JSON[_0x9061('0x11')](_0x70754f));_0x3c29d1(_0x70754f);})[_0x9061('0x17')](function(_0x49672b){logger[_0x9061('0x12')]('CreateMemberReport',_0x49672b[_0x9061('0x15')],_0x230a29);_0x33e248(_0x5a9ca4[_0x9061('0x12')](0x1f4,_0x49672b['message']));});});};exports[_0x9061('0x26')]=function(_0x1ee5d4){var _0x1cae3b=this;return new Promise(function(_0x2046d9,_0x53672b){return db[_0x9061('0x19')][_0x9061('0x27')](_0x1ee5d4['body'],{'raw':_0x1ee5d4['options']?_0x1ee5d4[_0x9061('0x1b')][_0x9061('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ee5d4['options']?_0x1ee5d4[_0x9061('0x1b')][_0x9061('0x1d')]||null:null,'attributes':_0x1ee5d4['options']?_0x1ee5d4[_0x9061('0x1b')][_0x9061('0x21')]||null:null,'limit':_0x1ee5d4[_0x9061('0x1b')]?_0x1ee5d4[_0x9061('0x1b')][_0x9061('0x28')]||null:null})[_0x9061('0xd')](function(_0x146e47){logger[_0x9061('0x22')](_0x9061('0x26'),_0x1ee5d4);logger['debug'](_0x9061('0x26'),_0x1ee5d4,JSON['stringify'](_0x146e47));_0x2046d9(_0x146e47);})[_0x9061('0x17')](function(_0x4e5228){logger[_0x9061('0x12')](_0x9061('0x26'),_0x4e5228[_0x9061('0x15')],_0x1ee5d4);_0x53672b(_0x1cae3b[_0x9061('0x12')](0x1f4,_0x4e5228['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 03e5f47..13da835 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 _0x6334=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express'];(function(_0x162323,_0x3fa41d){var _0x14722a=function(_0x358cdf){while(--_0x358cdf){_0x162323['push'](_0x162323['shift']());}};_0x14722a(++_0x3fa41d);}(_0x6334,0x119));var _0x4633=function(_0x54a9b9,_0x31352f){_0x54a9b9=_0x54a9b9-0x0;var _0x2a34ef=_0x6334[_0x54a9b9];return _0x2a34ef;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',controller[_0x4633('0xb')]);module[_0x4633('0xc')]=router; \ No newline at end of file +var _0x1db9=['express','Router','../../components/auth/service','../../components/interaction/service','get','multer','util','path','connect-timeout'];(function(_0x4d1d45,_0xdcd26){var _0x419daf=function(_0x1a4597){while(--_0x1a4597){_0x4d1d45['push'](_0x4d1d45['shift']());}};_0x419daf(++_0xdcd26);}(_0x1db9,0x176));var _0x91db=function(_0x529dcd,_0x3835f4){_0x529dcd=_0x529dcd-0x0;var _0x4b44f1=_0x1db9[_0x529dcd];return _0x4b44f1;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x91db('0x8')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 746d57b..7326513 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 _0xc823=['version','sequelize','exports'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xc823,0xb2));var _0x3c82=function(_0x27ac97,_0x22a386){_0x27ac97=_0x27ac97-0x0;var _0x49e230=_0xc823[_0x27ac97];return _0x49e230;};'use strict';var Sequelize=require(_0x3c82('0x0'));module[_0x3c82('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x3c82('0x2')}}; \ No newline at end of file +var _0x3c04=['exports','version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c04,0x192));var _0x43c0=function(_0x25b459,_0x347064){_0x25b459=_0x25b459-0x0;var _0x4da043=_0x3c04[_0x25b459];return _0x4da043;};'use strict';var Sequelize=require('sequelize');module[_0x43c0('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x43c0('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 393fb8e..54ea743 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 _0x44d0=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','sendStatus','error','stack','name','send','index','map','Migration','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','merge','where','type','VIRTUAL','then','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x17d477,_0x1eec0c){var _0x136a6d=function(_0x409430){while(--_0x409430){_0x17d477['push'](_0x17d477['shift']());}};_0x136a6d(++_0x1eec0c);}(_0x44d0,0xbc));var _0x044d=function(_0x57e429,_0x1834ff){_0x57e429=_0x57e429-0x0;var _0x29286a=_0x44d0[_0x57e429];return _0x29286a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x044d('0x0'));var zipdir=require(_0x044d('0x1'));var jsonpatch=require(_0x044d('0x2'));var rp=require('request-promise');var moment=require(_0x044d('0x3'));var BPromise=require(_0x044d('0x4'));var Mustache=require(_0x044d('0x5'));var util=require('util');var path=require(_0x044d('0x6'));var sox=require(_0x044d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x044d('0x8'));var _=require(_0x044d('0x9'));var squel=require(_0x044d('0xa'));var crypto=require(_0x044d('0xb'));var jsforce=require(_0x044d('0xc'));var deskjs=require(_0x044d('0xd'));var toCsv=require(_0x044d('0xe'));var querystring=require(_0x044d('0xf'));var Papa=require('papaparse');var Redis=require(_0x044d('0x10'));var authService=require(_0x044d('0x11'));var qs=require(_0x044d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x044d('0x13'));var logger=require(_0x044d('0x14'))(_0x044d('0x15'));var utils=require('../../config/utils');var config=require(_0x044d('0x16'));var licenseUtil=require(_0x044d('0x17'));var db=require(_0x044d('0x18'))['db'];function respondWithStatusCode(_0x2eff46,_0x4e9a59){_0x4e9a59=_0x4e9a59||0xcc;return function(_0x9fbaa3){if(_0x9fbaa3){return _0x2eff46['sendStatus'](_0x4e9a59);}return _0x2eff46[_0x044d('0x19')](_0x4e9a59)[_0x044d('0x1a')]();};}function respondWithResult(_0x2f2642,_0x31b67e){_0x31b67e=_0x31b67e||0xc8;return function(_0x37ef64){if(_0x37ef64){return _0x2f2642[_0x044d('0x19')](_0x31b67e)[_0x044d('0x1b')](_0x37ef64);}};}function respondWithFilteredResult(_0x296da5,_0x2d42f6){return function(_0x59c0da){if(_0x59c0da){var _0x180095=typeof _0x2d42f6[_0x044d('0x1c')]==='undefined'&&typeof _0x2d42f6[_0x044d('0x1d')]===_0x044d('0x1e');var _0x42c8f5=_0x59c0da[_0x044d('0x1f')];var _0x56bc1a=_0x180095?0x0:_0x2d42f6[_0x044d('0x1c')];var _0x4784ac=_0x180095?_0x59c0da[_0x044d('0x1f')]:_0x2d42f6[_0x044d('0x1c')]+_0x2d42f6[_0x044d('0x1d')];var _0x2f3895;if(_0x4784ac>=_0x42c8f5){_0x4784ac=_0x42c8f5;_0x2f3895=0xc8;}else{_0x2f3895=0xce;}_0x296da5[_0x044d('0x19')](_0x2f3895);return _0x296da5[_0x044d('0x20')](_0x044d('0x21'),_0x56bc1a+'-'+_0x4784ac+'/'+_0x42c8f5)[_0x044d('0x1b')](_0x59c0da);}return null;};}function patchUpdates(_0x3a64fb){return function(_0x1ad224){try{jsonpatch['apply'](_0x1ad224,_0x3a64fb,!![]);}catch(_0x25c796){return BPromise['reject'](_0x25c796);}return _0x1ad224['save']();};}function saveUpdates(_0x3fb36c,_0x5ef6cb){return function(_0x2ee96e){if(_0x2ee96e){return _0x2ee96e[_0x044d('0x22')](_0x3fb36c)['then'](function(_0x15a4ae){return _0x15a4ae;});}return null;};}function removeEntity(_0xdd8286,_0x3dce83){return function(_0x471070){if(_0x471070){return _0x471070[_0x044d('0x23')]()['then'](function(){_0xdd8286[_0x044d('0x19')](0xcc)[_0x044d('0x1a')]();});}};}function handleEntityNotFound(_0x1139ac,_0x3d1539){return function(_0x292625){if(!_0x292625){_0x1139ac[_0x044d('0x24')](0x194);}return _0x292625;};}function handleError(_0x5f028a,_0x4e04bb){_0x4e04bb=_0x4e04bb||0x1f4;return function(_0x3fd759){logger[_0x044d('0x25')](_0x3fd759[_0x044d('0x26')]);if(_0x3fd759[_0x044d('0x27')]){delete _0x3fd759[_0x044d('0x27')];}_0x5f028a['status'](_0x4e04bb)[_0x044d('0x28')](_0x3fd759);};}exports[_0x044d('0x29')]=function(_0x2b7a7f,_0x2ed699){var _0x4aa2aa={},_0x1bc071={},_0x1ca7b2={'count':0x0,'rows':[]};var _0x20e450=_[_0x044d('0x2a')](db[_0x044d('0x2b')]['rawAttributes'],function(_0x418500){return{'name':_0x418500[_0x044d('0x2c')],'type':_0x418500['type'][_0x044d('0x2d')]};});_0x1bc071[_0x044d('0x2e')]=_[_0x044d('0x2a')](_0x20e450,_0x044d('0x27'));_0x1bc071[_0x044d('0x2f')]=_['keys'](_0x2b7a7f['query']);_0x1bc071[_0x044d('0x30')]=_[_0x044d('0x31')](_0x1bc071['model'],_0x1bc071[_0x044d('0x2f')]);_0x4aa2aa['attributes']=_['intersection'](_0x1bc071[_0x044d('0x2e')],qs[_0x044d('0x32')](_0x2b7a7f['query']['fields']));_0x4aa2aa[_0x044d('0x33')]=_0x4aa2aa[_0x044d('0x33')][_0x044d('0x34')]?_0x4aa2aa['attributes']:_0x1bc071[_0x044d('0x2e')];if(!_0x2b7a7f[_0x044d('0x2f')][_0x044d('0x35')](_0x044d('0x36'))){_0x4aa2aa[_0x044d('0x1d')]=qs[_0x044d('0x1d')](_0x2b7a7f[_0x044d('0x2f')][_0x044d('0x1d')]);_0x4aa2aa[_0x044d('0x1c')]=qs[_0x044d('0x1c')](_0x2b7a7f[_0x044d('0x2f')][_0x044d('0x1c')]);}_0x4aa2aa['order']=qs[_0x044d('0x37')](_0x2b7a7f[_0x044d('0x2f')][_0x044d('0x37')]);_0x4aa2aa['where']=qs[_0x044d('0x30')](_['pick'](_0x2b7a7f[_0x044d('0x2f')],_0x1bc071[_0x044d('0x30')]),_0x20e450);if(_0x2b7a7f[_0x044d('0x2f')][_0x044d('0x38')]){_0x4aa2aa['where']=_[_0x044d('0x39')](_0x4aa2aa[_0x044d('0x3a')],{'$or':_['map'](_0x20e450,function(_0x38d9d7){if(_0x38d9d7[_0x044d('0x3b')]!==_0x044d('0x3c')){var _0x57a05b={};_0x57a05b[_0x38d9d7['name']]={'$like':'%'+_0x2b7a7f[_0x044d('0x2f')][_0x044d('0x38')]+'%'};return _0x57a05b;}})});}_0x4aa2aa=_['merge']({},_0x4aa2aa,_0x2b7a7f['options']);var _0x4d2e06={'where':_0x4aa2aa[_0x044d('0x3a')]};return db['Migration'][_0x044d('0x1f')](_0x4d2e06)[_0x044d('0x3d')](function(_0x58e80d){_0x1ca7b2[_0x044d('0x1f')]=_0x58e80d;if(_0x2b7a7f[_0x044d('0x2f')]['includeAll']){_0x4aa2aa['include']=[{'all':!![]}];}return db['Migration'][_0x044d('0x3e')](_0x4aa2aa);})[_0x044d('0x3d')](function(_0x247a3a){_0x1ca7b2[_0x044d('0x3f')]=_0x247a3a;return _0x1ca7b2;})[_0x044d('0x3d')](respondWithFilteredResult(_0x2ed699,_0x4aa2aa))[_0x044d('0x40')](handleError(_0x2ed699,null));}; \ No newline at end of file +var _0x1b4d=['path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','Migration','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x1b4d,0x1ea));var _0xd1b4=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x1b4d[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1b4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1b4('0x1'));var rp=require(_0xd1b4('0x2'));var moment=require(_0xd1b4('0x3'));var BPromise=require(_0xd1b4('0x4'));var Mustache=require(_0xd1b4('0x5'));var util=require(_0xd1b4('0x6'));var path=require(_0xd1b4('0x7'));var sox=require(_0xd1b4('0x8'));var csv=require(_0xd1b4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1b4('0xa'));var _=require(_0xd1b4('0xb'));var squel=require(_0xd1b4('0xc'));var crypto=require(_0xd1b4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd1b4('0xe'));var toCsv=require(_0xd1b4('0x9'));var querystring=require('querystring');var Papa=require(_0xd1b4('0xf'));var Redis=require(_0xd1b4('0x10'));var authService=require(_0xd1b4('0x11'));var qs=require(_0xd1b4('0x12'));var as=require(_0xd1b4('0x13'));var hardwareService=require(_0xd1b4('0x14'));var logger=require(_0xd1b4('0x15'))(_0xd1b4('0x16'));var utils=require(_0xd1b4('0x17'));var config=require(_0xd1b4('0x18'));var licenseUtil=require(_0xd1b4('0x19'));var db=require(_0xd1b4('0x1a'))['db'];function respondWithStatusCode(_0x8f09f7,_0x3d4439){_0x3d4439=_0x3d4439||0xcc;return function(_0x330f01){if(_0x330f01){return _0x8f09f7[_0xd1b4('0x1b')](_0x3d4439);}return _0x8f09f7[_0xd1b4('0x1c')](_0x3d4439)[_0xd1b4('0x1d')]();};}function respondWithResult(_0x35bbca,_0x3146fa){_0x3146fa=_0x3146fa||0xc8;return function(_0x50dc58){if(_0x50dc58){return _0x35bbca['status'](_0x3146fa)['json'](_0x50dc58);}};}function respondWithFilteredResult(_0x597ec0,_0x54f2f1){return function(_0x53d402){if(_0x53d402){var _0xd3f8ae=typeof _0x54f2f1[_0xd1b4('0x1e')]===_0xd1b4('0x1f')&&typeof _0x54f2f1[_0xd1b4('0x20')]==='undefined';var _0x493cde=_0x53d402[_0xd1b4('0x21')];var _0x1c1a3c=_0xd3f8ae?0x0:_0x54f2f1[_0xd1b4('0x1e')];var _0x623d8c=_0xd3f8ae?_0x53d402[_0xd1b4('0x21')]:_0x54f2f1[_0xd1b4('0x1e')]+_0x54f2f1[_0xd1b4('0x20')];var _0x4d823f;if(_0x623d8c>=_0x493cde){_0x623d8c=_0x493cde;_0x4d823f=0xc8;}else{_0x4d823f=0xce;}_0x597ec0['status'](_0x4d823f);return _0x597ec0[_0xd1b4('0x22')](_0xd1b4('0x23'),_0x1c1a3c+'-'+_0x623d8c+'/'+_0x493cde)[_0xd1b4('0x24')](_0x53d402);}return null;};}function patchUpdates(_0x4547b2){return function(_0x5e40c4){try{jsonpatch[_0xd1b4('0x25')](_0x5e40c4,_0x4547b2,!![]);}catch(_0x5567e8){return BPromise[_0xd1b4('0x26')](_0x5567e8);}return _0x5e40c4[_0xd1b4('0x27')]();};}function saveUpdates(_0x598c66,_0x55eb55){return function(_0x5b964b){if(_0x5b964b){return _0x5b964b[_0xd1b4('0x28')](_0x598c66)[_0xd1b4('0x29')](function(_0x5d362f){return _0x5d362f;});}return null;};}function removeEntity(_0x30075d,_0x5cb67f){return function(_0x474253){if(_0x474253){return _0x474253[_0xd1b4('0x2a')]()[_0xd1b4('0x29')](function(){_0x30075d[_0xd1b4('0x1c')](0xcc)[_0xd1b4('0x1d')]();});}};}function handleEntityNotFound(_0x30fdb4,_0x4d77a8){return function(_0x442bae){if(!_0x442bae){_0x30fdb4[_0xd1b4('0x1b')](0x194);}return _0x442bae;};}function handleError(_0x394407,_0x3c5737){_0x3c5737=_0x3c5737||0x1f4;return function(_0x2d49fb){logger['error'](_0x2d49fb['stack']);if(_0x2d49fb['name']){delete _0x2d49fb[_0xd1b4('0x2b')];}_0x394407[_0xd1b4('0x1c')](_0x3c5737)[_0xd1b4('0x2c')](_0x2d49fb);};}exports['index']=function(_0x2ccae7,_0x1d27ce){var _0x40bf9={},_0x511daa={},_0x1e5df6={'count':0x0,'rows':[]};var _0x41f977=_[_0xd1b4('0x2d')](db[_0xd1b4('0x2e')][_0xd1b4('0x2f')],function(_0x177298){return{'name':_0x177298['fieldName'],'type':_0x177298[_0xd1b4('0x30')][_0xd1b4('0x31')]};});_0x511daa['model']=_['map'](_0x41f977,'name');_0x511daa['query']=_[_0xd1b4('0x32')](_0x2ccae7[_0xd1b4('0x33')]);_0x511daa['filters']=_[_0xd1b4('0x34')](_0x511daa[_0xd1b4('0x35')],_0x511daa[_0xd1b4('0x33')]);_0x40bf9[_0xd1b4('0x36')]=_[_0xd1b4('0x34')](_0x511daa[_0xd1b4('0x35')],qs[_0xd1b4('0x37')](_0x2ccae7[_0xd1b4('0x33')]['fields']));_0x40bf9[_0xd1b4('0x36')]=_0x40bf9['attributes'][_0xd1b4('0x38')]?_0x40bf9[_0xd1b4('0x36')]:_0x511daa[_0xd1b4('0x35')];if(!_0x2ccae7[_0xd1b4('0x33')][_0xd1b4('0x39')](_0xd1b4('0x3a'))){_0x40bf9[_0xd1b4('0x20')]=qs[_0xd1b4('0x20')](_0x2ccae7[_0xd1b4('0x33')][_0xd1b4('0x20')]);_0x40bf9[_0xd1b4('0x1e')]=qs[_0xd1b4('0x1e')](_0x2ccae7[_0xd1b4('0x33')][_0xd1b4('0x1e')]);}_0x40bf9[_0xd1b4('0x3b')]=qs[_0xd1b4('0x3c')](_0x2ccae7[_0xd1b4('0x33')][_0xd1b4('0x3c')]);_0x40bf9['where']=qs['filters'](_['pick'](_0x2ccae7['query'],_0x511daa[_0xd1b4('0x3d')]),_0x41f977);if(_0x2ccae7[_0xd1b4('0x33')][_0xd1b4('0x3e')]){_0x40bf9[_0xd1b4('0x3f')]=_[_0xd1b4('0x40')](_0x40bf9[_0xd1b4('0x3f')],{'$or':_['map'](_0x41f977,function(_0x26b85f){if(_0x26b85f[_0xd1b4('0x30')]!==_0xd1b4('0x41')){var _0x451db3={};_0x451db3[_0x26b85f[_0xd1b4('0x2b')]]={'$like':'%'+_0x2ccae7['query'][_0xd1b4('0x3e')]+'%'};return _0x451db3;}})});}_0x40bf9=_['merge']({},_0x40bf9,_0x2ccae7['options']);var _0x2ecf05={'where':_0x40bf9['where']};return db[_0xd1b4('0x2e')][_0xd1b4('0x21')](_0x2ecf05)['then'](function(_0x5428ae){_0x1e5df6[_0xd1b4('0x21')]=_0x5428ae;if(_0x2ccae7[_0xd1b4('0x33')][_0xd1b4('0x42')]){_0x40bf9[_0xd1b4('0x43')]=[{'all':!![]}];}return db['Migration'][_0xd1b4('0x44')](_0x40bf9);})['then'](function(_0x386721){_0x1e5df6[_0xd1b4('0x45')]=_0x386721;return _0x1e5df6;})['then'](respondWithFilteredResult(_0x1d27ce,_0x40bf9))[_0xd1b4('0x46')](handleError(_0x1d27ce,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b38067a..5d6f3aa 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 _0x7100=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util'];(function(_0x3b6aaf,_0x4aef36){var _0x295fa9=function(_0x4320d3){while(--_0x4320d3){_0x3b6aaf['push'](_0x3b6aaf['shift']());}};_0x295fa9(++_0x4aef36);}(_0x7100,0x1c6));var _0x0710=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x7100[_0x52085a];return _0x5afc1a;};'use strict';var _=require(_0x0710('0x0'));var util=require(_0x0710('0x1'));var logger=require(_0x0710('0x2'))(_0x0710('0x3'));var moment=require('moment');var BPromise=require(_0x0710('0x4'));var rp=require(_0x0710('0x5'));var fs=require('fs');var path=require(_0x0710('0x6'));var rimraf=require('rimraf');var config=require(_0x0710('0x7'));var attributes=require(_0x0710('0x8'));module[_0x0710('0x9')]=function(_0x56af16,_0x54b6fc){return _0x56af16['define'](_0x0710('0xa'),attributes,{'tableName':_0x0710('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f3d=['path','../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','moment'];(function(_0x36453b,_0x2f2e6){var _0x459b19=function(_0x47a181){while(--_0x47a181){_0x36453b['push'](_0x36453b['shift']());}};_0x459b19(++_0x2f2e6);}(_0x8f3d,0x74));var _0xd8f3=function(_0x244a88,_0x1d428e){_0x244a88=_0x244a88-0x0;var _0x167710=_0x8f3d[_0x244a88];return _0x167710;};'use strict';var _=require(_0xd8f3('0x0'));var util=require(_0xd8f3('0x1'));var logger=require(_0xd8f3('0x2'))(_0xd8f3('0x3'));var moment=require(_0xd8f3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8f3('0x5'));var rimraf=require('rimraf');var config=require(_0xd8f3('0x6'));var attributes=require(_0xd8f3('0x7'));module[_0xd8f3('0x8')]=function(_0x105845,_0x31d908){return _0x105845[_0xd8f3('0x9')]('Migration',attributes,{'tableName':_0xd8f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index b3b83e4..83cad5e 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 _0x1123=['moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x57b96f,_0x3feb8e){var _0x11e12a=function(_0x4e96e2){while(--_0x4e96e2){_0x57b96f['push'](_0x57b96f['shift']());}};_0x11e12a(++_0x3feb8e);}(_0x1123,0x118));var _0x3112=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1123[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3112('0x0'));var BPromise=require('bluebird');var rs=require(_0x3112('0x1'));var fs=require('fs');var Redis=require(_0x3112('0x2'));var db=require(_0x3112('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3112('0x4'));var config=require(_0x3112('0x5'));var jayson=require(_0x3112('0x6'));var client=jayson[_0x3112('0x7')][_0x3112('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e2b5c,_0x3bee38,_0x3f7ae4){return new BPromise(function(_0x3cd83c,_0x4849f9){return client[_0x3112('0x9')](_0x3e2b5c,_0x3f7ae4)[_0x3112('0xa')](function(_0x39b75b){logger[_0x3112('0xb')](_0x3112('0xc'),_0x3bee38,_0x3112('0xd'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x3bee38,_0x3112('0xd'),JSON[_0x3112('0xe')](_0x39b75b));if(_0x39b75b[_0x3112('0xf')]){if(_0x39b75b[_0x3112('0xf')][_0x3112('0x10')]===0x1f4){logger['error'](_0x3112('0xc'),_0x3bee38,_0x39b75b['error']['message']);return _0x4849f9(_0x39b75b[_0x3112('0xf')][_0x3112('0x11')]);}logger[_0x3112('0xf')]('Migration,\x20%s,\x20%s',_0x3bee38,_0x39b75b['error'][_0x3112('0x11')]);return _0x3cd83c(_0x39b75b['error'][_0x3112('0x11')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x3bee38,_0x3112('0xd'));_0x3cd83c(_0x39b75b[_0x3112('0x12')]['message']);}})[_0x3112('0x13')](function(_0x3f5cfd){logger['error']('Migration,\x20%s,\x20%s',_0x3bee38,_0x3f5cfd);_0x4849f9(_0x3f5cfd);});});} \ No newline at end of file +var _0x26bc=['Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x437f8f,_0x443c59){var _0x4286f9=function(_0xfb3702){while(--_0xfb3702){_0x437f8f['push'](_0x437f8f['shift']());}};_0x4286f9(++_0x443c59);}(_0x26bc,0x162));var _0xc26b=function(_0x2da95b,_0x527d8d){_0x2da95b=_0x2da95b-0x0;var _0x37ce05=_0x26bc[_0x2da95b];return _0x37ce05;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var moment=require(_0xc26b('0x2'));var BPromise=require(_0xc26b('0x3'));var rs=require(_0xc26b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc26b('0x5'))['db'];var utils=require(_0xc26b('0x6'));var logger=require(_0xc26b('0x7'))('rpc');var config=require(_0xc26b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc26b('0x9')][_0xc26b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13d90e,_0x5c2f6f,_0x11c6f5){return new BPromise(function(_0x453491,_0x465c89){return client[_0xc26b('0xb')](_0x13d90e,_0x11c6f5)[_0xc26b('0xc')](function(_0x1fb2b5){logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));logger[_0xc26b('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0x5c2f6f,_0xc26b('0xf'),JSON[_0xc26b('0x11')](_0x1fb2b5));if(_0x1fb2b5[_0xc26b('0x12')]){if(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x13')]===0x1f4){logger[_0xc26b('0x12')]('Migration,\x20%s,\x20%s',_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x465c89(_0x1fb2b5['error'][_0xc26b('0x14')]);}logger[_0xc26b('0x12')](_0xc26b('0xe'),_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x453491(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x14')]);}else{logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));_0x453491(_0x1fb2b5[_0xc26b('0x15')]['message']);}})[_0xc26b('0x16')](function(_0x2713f6){logger['error'](_0xc26b('0xe'),_0x5c2f6f,_0x2713f6);_0x465c89(_0x2713f6);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 2b08bbe..2422563 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 _0xdaa1=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x18f9ab,_0x3dcf8b){var _0x79f8e3=function(_0x50d678){while(--_0x50d678){_0x18f9ab['push'](_0x18f9ab['shift']());}};_0x79f8e3(++_0x3dcf8b);}(_0xdaa1,0x17d));var _0x1daa=function(_0x4056de,_0x5e2b07){_0x4056de=_0x4056de-0x0;var _0x192ab3=_0xdaa1[_0x4056de];return _0x192ab3;};'use strict';var multer=require(_0x1daa('0x0'));var util=require(_0x1daa('0x1'));var path=require(_0x1daa('0x2'));var timeout=require(_0x1daa('0x3'));var express=require(_0x1daa('0x4'));var router=express[_0x1daa('0x5')]();var fs_extra=require(_0x1daa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1daa('0x7'));var config=require(_0x1daa('0x8'));var controller=require('./network.controller');router[_0x1daa('0x9')]('/',auth[_0x1daa('0xa')](),controller['index']);router[_0x1daa('0x9')](_0x1daa('0xb'),auth[_0x1daa('0xa')](),controller[_0x1daa('0xc')]);router['post']('/',auth[_0x1daa('0xa')](),controller[_0x1daa('0xd')]);router[_0x1daa('0xe')](_0x1daa('0xb'),auth['isAuthenticated'](),controller[_0x1daa('0xf')]);router['delete'](_0x1daa('0xb'),auth[_0x1daa('0xa')](),controller[_0x1daa('0x10')]);module[_0x1daa('0x11')]=router; \ No newline at end of file +var _0x47c5=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x1d38e0,_0x23dcaf){var _0x26e31b=function(_0x26b77b){while(--_0x26b77b){_0x1d38e0['push'](_0x1d38e0['shift']());}};_0x26e31b(++_0x23dcaf);}(_0x47c5,0x165));var _0x547c=function(_0x551ade,_0x48fa98){_0x551ade=_0x551ade-0x0;var _0xe7d001=_0x47c5[_0x551ade];return _0xe7d001;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0xe')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x10')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x12')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);module[_0x547c('0x14')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 209cf49..fc343ba 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 _0x96b3=['externip','stun','STRING','ENUM'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x96b3,0xfb));var _0x396b=function(_0x3831c3,_0x75fc05){_0x3831c3=_0x3831c3-0x0;var _0x14047e=_0x96b3[_0x3831c3];return _0x14047e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x396b('0x0')]('localnet',_0x396b('0x1'),_0x396b('0x2'),'turn')},'value':{'type':Sequelize[_0x396b('0x3')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x396b('0x3')]}}; \ No newline at end of file +var _0x5e07=['localnet','externip','stun','turn','STRING','exports','ENUM'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x5e07,0x83));var _0x75e0=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5e07[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require('sequelize');module[_0x75e0('0x0')]={'type':{'type':Sequelize[_0x75e0('0x1')](_0x75e0('0x2'),_0x75e0('0x3'),_0x75e0('0x4'),_0x75e0('0x5'))},'value':{'type':Sequelize[_0x75e0('0x6')]},'username':{'type':Sequelize[_0x75e0('0x6')]},'password':{'type':Sequelize[_0x75e0('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 41c731a..80bc65c 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 _0x1397=['toLowerCase','chan_sip.so','util','ejs','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','update','destroy','end','stack','name','index','map','Network','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','catch','show','params','length','include','options','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','find','/etc/asterisk/sip_xcally_%s.conf'];(function(_0xb24183,_0x4bc316){var _0x558bf2=function(_0x1d3cef){while(--_0x1d3cef){_0xb24183['push'](_0xb24183['shift']());}};_0x558bf2(++_0x4bc316);}(_0x1397,0xa8));var _0x7139=function(_0x3ee6bc,_0x4025bb){_0x3ee6bc=_0x3ee6bc-0x0;var _0x5bda78=_0x1397[_0x3ee6bc];return _0x5bda78;};'use strict';var util=require(_0x7139('0x0'));var path=require('path');var ejs=require(_0x7139('0x1'));var fs=require('fs');var _=require(_0x7139('0x2'));var qs=require(_0x7139('0x3'));var logger=require(_0x7139('0x4'))('api');var config=require('../../config/environment');var db=require(_0x7139('0x5'))['db'];var jayson=require(_0x7139('0x6'));var client=jayson[_0x7139('0x7')][_0x7139('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47411f,_0x31c7c4,_0x56d377,_0x4ceda2){return new Promise(function(_0x298315,_0x3c6e92){var _0x4345dc=_0x4ceda2||client;return _0x4345dc[_0x7139('0x9')](_0x47411f,_0x56d377)[_0x7139('0xa')](function(_0x3bab93){logger[_0x7139('0xb')](_0x7139('0xc'),_0x31c7c4,_0x7139('0xd'));logger['debug'](_0x7139('0xe'),_0x31c7c4,_0x7139('0xd'),JSON[_0x7139('0xf')](_0x3bab93));if(_0x3bab93[_0x7139('0x10')]){if(_0x3bab93[_0x7139('0x10')][_0x7139('0x11')]===0x1f4){logger[_0x7139('0x10')](_0x7139('0xc'),_0x31c7c4,_0x3bab93[_0x7139('0x10')]['message']);return _0x3c6e92(_0x3bab93['error'][_0x7139('0x12')]);}logger[_0x7139('0x10')](_0x7139('0xc'),_0x31c7c4,_0x3bab93['error'][_0x7139('0x12')]);return _0x298315(_0x3bab93[_0x7139('0x10')][_0x7139('0x12')]);}else{logger[_0x7139('0xb')](_0x7139('0xc'),_0x31c7c4,_0x7139('0xd'));_0x298315(_0x3bab93[_0x7139('0x13')]['message']);}})['catch'](function(_0x31ac7b){logger[_0x7139('0x10')](_0x7139('0xc'),_0x31c7c4,_0x31ac7b);_0x3c6e92(_0x31ac7b);});});}function respondWithResult(_0xa7b004,_0x547f30){_0x547f30=_0x547f30||0xc8;return function(_0x188e00){if(_0x188e00){return _0xa7b004[_0x7139('0x14')](_0x547f30)[_0x7139('0x15')](_0x188e00);}};}function respondWithFilteredResult(_0x13daf6,_0x294d33){return function(_0x301749){if(_0x301749){var _0x413f35=typeof _0x294d33[_0x7139('0x16')]===_0x7139('0x17')&&typeof _0x294d33[_0x7139('0x18')]==='undefined';var _0x4fc751=_0x301749['count'];var _0x422916=_0x413f35?0x0:_0x294d33[_0x7139('0x16')];var _0x474786=_0x413f35?_0x301749['count']:_0x294d33[_0x7139('0x16')]+_0x294d33[_0x7139('0x18')];var _0x244bc4;if(_0x474786>=_0x4fc751){_0x474786=_0x4fc751;_0x244bc4=0xc8;}else{_0x244bc4=0xce;}_0x13daf6[_0x7139('0x14')](_0x244bc4);return _0x13daf6['set']('Content-Range',_0x422916+'-'+_0x474786+'/'+_0x4fc751)[_0x7139('0x15')](_0x301749);}return null;};}function saveUpdates(_0x2de04f){return function(_0x40cd8e){if(_0x40cd8e){return _0x40cd8e[_0x7139('0x19')](_0x2de04f)[_0x7139('0xa')](function(_0x9582ac){return _0x9582ac;});}return null;};}function removeEntity(_0xf15d1){return function(_0x5d3152){if(_0x5d3152){return _0x5d3152[_0x7139('0x1a')]()[_0x7139('0xa')](function(){_0xf15d1[_0x7139('0x14')](0xcc)[_0x7139('0x1b')]();});}};}function handleEntityNotFound(_0x5eee8b){return function(_0x299bd3){if(!_0x299bd3){_0x5eee8b['sendStatus'](0x194);}return _0x299bd3;};}function handleError(_0x498ff0,_0x5dd45f){_0x5dd45f=_0x5dd45f||0x1f4;return function(_0x10ed46){logger[_0x7139('0x10')](_0x10ed46[_0x7139('0x1c')]);if(_0x10ed46['name']){delete _0x10ed46[_0x7139('0x1d')];}_0x498ff0[_0x7139('0x14')](_0x5dd45f)['send'](_0x10ed46);};}exports[_0x7139('0x1e')]=function(_0x33beb7,_0x5f26c2){var _0x420efe={},_0x712639={},_0x5bf0c1={'count':0x0,'rows':[]};var _0xd17e51=_[_0x7139('0x1f')](db[_0x7139('0x20')][_0x7139('0x21')],function(_0x549fec){return{'name':_0x549fec['fieldName'],'type':_0x549fec[_0x7139('0x22')][_0x7139('0x23')]};});_0x712639[_0x7139('0x24')]=_[_0x7139('0x1f')](_0xd17e51,_0x7139('0x1d'));_0x712639['query']=_[_0x7139('0x25')](_0x33beb7[_0x7139('0x26')]);_0x712639[_0x7139('0x27')]=_[_0x7139('0x28')](_0x712639['model'],_0x712639[_0x7139('0x26')]);_0x420efe[_0x7139('0x29')]=_['intersection'](_0x712639[_0x7139('0x24')],qs[_0x7139('0x2a')](_0x33beb7[_0x7139('0x26')][_0x7139('0x2a')]));_0x420efe[_0x7139('0x29')]=_0x420efe[_0x7139('0x29')]['length']?_0x420efe[_0x7139('0x29')]:_0x712639[_0x7139('0x24')];if(!_0x33beb7['query'][_0x7139('0x2b')](_0x7139('0x2c'))){_0x420efe[_0x7139('0x18')]=qs[_0x7139('0x18')](_0x33beb7[_0x7139('0x26')][_0x7139('0x18')]);_0x420efe[_0x7139('0x16')]=qs['offset'](_0x33beb7[_0x7139('0x26')][_0x7139('0x16')]);}_0x420efe[_0x7139('0x2d')]=qs[_0x7139('0x2e')](_0x33beb7['query'][_0x7139('0x2e')]);_0x420efe[_0x7139('0x2f')]=qs['filters'](_[_0x7139('0x30')](_0x33beb7['query'],_0x712639[_0x7139('0x27')]),_0xd17e51);if(_0x33beb7[_0x7139('0x26')][_0x7139('0x31')]){_0x420efe[_0x7139('0x2f')]=_[_0x7139('0x32')](_0x420efe[_0x7139('0x2f')],{'$or':_[_0x7139('0x1f')](_0xd17e51,function(_0x4ddddd){if(_0x4ddddd[_0x7139('0x22')]!==_0x7139('0x33')){var _0x4ca0c0={};_0x4ca0c0[_0x4ddddd[_0x7139('0x1d')]]={'$like':'%'+_0x33beb7['query']['filter']+'%'};return _0x4ca0c0;}})});}_0x420efe=_[_0x7139('0x32')]({},_0x420efe,_0x33beb7['options']);var _0x5e7a71={'where':_0x420efe[_0x7139('0x2f')]};return db['Network'][_0x7139('0x34')](_0x5e7a71)[_0x7139('0xa')](function(_0x1d49c3){_0x5bf0c1['count']=_0x1d49c3;if(_0x33beb7[_0x7139('0x26')][_0x7139('0x35')]){_0x420efe['include']=[{'all':!![]}];}return db['Network'][_0x7139('0x36')](_0x420efe);})[_0x7139('0xa')](function(_0x12cf23){_0x5bf0c1['rows']=_0x12cf23;return _0x5bf0c1;})['then'](respondWithFilteredResult(_0x5f26c2,_0x420efe))[_0x7139('0x37')](handleError(_0x5f26c2,null));};exports[_0x7139('0x38')]=function(_0x1f66d4,_0x9d79c8){var _0x3d21c6={'raw':!![],'where':{'id':_0x1f66d4[_0x7139('0x39')]['id']}},_0x57f951={};_0x57f951[_0x7139('0x24')]=_['keys'](db[_0x7139('0x20')][_0x7139('0x21')]);_0x57f951[_0x7139('0x26')]=_['keys'](_0x1f66d4[_0x7139('0x26')]);_0x57f951[_0x7139('0x27')]=_[_0x7139('0x28')](_0x57f951[_0x7139('0x24')],_0x57f951[_0x7139('0x26')]);_0x3d21c6[_0x7139('0x29')]=_['intersection'](_0x57f951['model'],qs[_0x7139('0x2a')](_0x1f66d4[_0x7139('0x26')][_0x7139('0x2a')]));_0x3d21c6[_0x7139('0x29')]=_0x3d21c6[_0x7139('0x29')][_0x7139('0x3a')]?_0x3d21c6[_0x7139('0x29')]:_0x57f951['model'];if(_0x1f66d4[_0x7139('0x26')]['includeAll']){_0x3d21c6[_0x7139('0x3b')]=[{'all':!![]}];}_0x3d21c6=_[_0x7139('0x32')]({},_0x3d21c6,_0x1f66d4[_0x7139('0x3c')]);return db[_0x7139('0x20')]['find'](_0x3d21c6)[_0x7139('0xa')](handleEntityNotFound(_0x9d79c8,null))['then'](respondWithResult(_0x9d79c8,null))[_0x7139('0x37')](handleError(_0x9d79c8,null));};exports[_0x7139('0x3d')]=function(_0x2e0fad,_0x43ea57){var _0x40dab4;return db['Network'][_0x7139('0x3d')](_0x2e0fad[_0x7139('0x3e')],{'raw':!![]})[_0x7139('0xa')](function(_0xd8d23e){_0x40dab4=_0xd8d23e;return db['Network'][_0x7139('0x36')]({'where':{'type':_0x2e0fad[_0x7139('0x3e')][_0x7139('0x22')]},'raw':!![]});})[_0x7139('0xa')](function(_0x19e97c){if(_0x40dab4[_0x7139('0x22')][_0x7139('0x3f')]()==_0x7139('0x40')){var _0x353414=fs[_0x7139('0x41')](path['join'](config[_0x7139('0x42')],_0x7139('0x43')),_0x7139('0x44'));var _0x2a8bca=ejs[_0x7139('0x45')](_0x353414,{'networks':_0x19e97c||[]});fs[_0x7139('0x46')](_0x7139('0x47'),_0x2a8bca);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x3d'),{'module':_0x7139('0x49')});}else if(_0x40dab4[_0x7139('0x22')]['toUpperCase']()==_0x7139('0x4a')){var _0x44b86b=fs[_0x7139('0x41')](path[_0x7139('0x4b')](config[_0x7139('0x42')],_0x7139('0x4c')),_0x7139('0x44'));var _0x2161e6=ejs[_0x7139('0x45')](_0x44b86b,{'networks':_0x19e97c||[]});fs[_0x7139('0x46')](_0x7139('0x4d'),_0x2161e6);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x3d'),{'module':_0x7139('0x49')});}else{var _0x18920a=fs[_0x7139('0x41')](path['join'](config[_0x7139('0x42')],_0x7139('0x4e')),_0x7139('0x44'));var _0x2e274b=ejs[_0x7139('0x45')](_0x18920a,{'networks':_0x19e97c||[]});fs[_0x7139('0x46')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x2e0fad[_0x7139('0x3e')]['type']['toLowerCase']()),_0x2e274b);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x3d'),{'module':'chan_sip.so'});}})[_0x7139('0xa')](function(){return _0x40dab4;})[_0x7139('0xa')](respondWithResult(_0x43ea57,0xc9))[_0x7139('0x37')](handleError(_0x43ea57,null));};exports['update']=function(_0x1eccd8,_0x52fb75){var _0x58a88b;return db[_0x7139('0x20')][_0x7139('0x4f')]({'where':{'id':_0x1eccd8['params']['id']}})[_0x7139('0xa')](handleEntityNotFound(_0x52fb75,null))['then'](saveUpdates(_0x1eccd8[_0x7139('0x3e')],null))[_0x7139('0xa')](function(_0x4aa123){if(_0x4aa123){_0x58a88b=_0x4aa123;return db[_0x7139('0x20')][_0x7139('0x36')]({'where':{'type':_0x58a88b[_0x7139('0x22')]},'raw':!![]});}return null;})[_0x7139('0xa')](function(_0x15dc0d){if(_0x58a88b[_0x7139('0x22')]['toUpperCase']()==_0x7139('0x40')){var _0x140db4=fs[_0x7139('0x41')](path['join'](config[_0x7139('0x42')],_0x7139('0x43')),_0x7139('0x44'));var _0x172665=ejs[_0x7139('0x45')](_0x140db4,{'networks':_0x15dc0d||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x172665);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x19'),{'module':_0x7139('0x49')});}else if(_0x58a88b['type'][_0x7139('0x3f')]()==_0x7139('0x4a')){var _0x50f5bc=fs[_0x7139('0x41')](path[_0x7139('0x4b')](config[_0x7139('0x42')],_0x7139('0x4c')),_0x7139('0x44'));var _0x3d6031=ejs[_0x7139('0x45')](_0x50f5bc,{'networks':_0x15dc0d||[]});fs[_0x7139('0x46')](_0x7139('0x4d'),_0x3d6031);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x19'),{'module':_0x7139('0x49')});}else{var _0x31896a=fs['readFileSync'](path[_0x7139('0x4b')](config[_0x7139('0x42')],_0x7139('0x4e')),_0x7139('0x44'));var _0x3a04ec=ejs[_0x7139('0x45')](_0x31896a,{'networks':_0x15dc0d||[]});fs['writeFileSync'](util['format'](_0x7139('0x50'),_0x1eccd8[_0x7139('0x3e')][_0x7139('0x22')][_0x7139('0x51')]()),_0x3a04ec);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x19'),{'module':_0x7139('0x52')});}})['then'](function(_0x37273e){if(_0x37273e){return _0x58a88b;}return null;})[_0x7139('0xa')](respondWithResult(_0x52fb75,null))['catch'](handleError(_0x52fb75,null));};exports[_0x7139('0x1a')]=function(_0x277823,_0x4b38c2){var _0x4c9da6;return db['Network']['find']({'where':{'id':_0x277823[_0x7139('0x39')]['id']}})[_0x7139('0xa')](function(_0x559717){_0x4c9da6=_0x559717;return _0x559717;})[_0x7139('0xa')](handleEntityNotFound(_0x4b38c2,null))[_0x7139('0xa')](removeEntity(_0x4b38c2,null))[_0x7139('0xa')](function(){if(_0x4c9da6){return db[_0x7139('0x20')][_0x7139('0x36')]({'where':{'type':_0x4c9da6[_0x7139('0x22')]},'raw':!![]});}})[_0x7139('0xa')](function(_0x10d036){if(_0x4c9da6['type'][_0x7139('0x3f')]()==_0x7139('0x40')){var _0x2b1580=fs[_0x7139('0x41')](path[_0x7139('0x4b')](config[_0x7139('0x42')],'server/files/templates/stun_multiple.ejs'),_0x7139('0x44'));var _0x47bf24=ejs['render'](_0x2b1580,{'networks':_0x10d036||[]});fs[_0x7139('0x46')](_0x7139('0x47'),_0x47bf24);return respondWithRpcPromise('Reload','destroy',{'module':_0x7139('0x49')});}else if(_0x4c9da6[_0x7139('0x22')][_0x7139('0x3f')]()==_0x7139('0x4a')){var _0x9cfec5=fs['readFileSync'](path[_0x7139('0x4b')](config[_0x7139('0x42')],_0x7139('0x4c')),_0x7139('0x44'));var _0x12a9e3=ejs['render'](_0x9cfec5,{'networks':_0x10d036||[]});fs[_0x7139('0x46')]('/etc/asterisk/turn_xcally.conf',_0x12a9e3);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x1a'),{'module':_0x7139('0x49')});}else{var _0x4dbb6f=fs['readFileSync'](path[_0x7139('0x4b')](config[_0x7139('0x42')],_0x7139('0x4e')),_0x7139('0x44'));var _0x53eb27=ejs[_0x7139('0x45')](_0x4dbb6f,{'networks':_0x10d036||[]});fs[_0x7139('0x46')](util['format'](_0x7139('0x50'),_0x4c9da6['type']['toLowerCase']()),_0x53eb27);return respondWithRpcPromise(_0x7139('0x48'),_0x7139('0x1a'),{'module':_0x7139('0x52')});}})[_0x7139('0x37')](handleError(_0x4b38c2,null));}; \ No newline at end of file +var _0x8dd9=['map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','catch','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','writeFileSync','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','find','server/files/templates/turn_multiple.ejs','STUN','server/files/templates/network.ejs','util','path','ejs','../../config/logger','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','status','undefined','count','offset','limit','set','Content-Range','json','destroy','then','end','stack','name','send','index'];(function(_0x256fa5,_0x2965d5){var _0xa54e6f=function(_0x22f895){while(--_0x22f895){_0x256fa5['push'](_0x256fa5['shift']());}};_0xa54e6f(++_0x2965d5);}(_0x8dd9,0x1df));var _0x98dd=function(_0x1d53a8,_0x533494){_0x1d53a8=_0x1d53a8-0x0;var _0x2a3bbc=_0x8dd9[_0x1d53a8];return _0x2a3bbc;};'use strict';var util=require(_0x98dd('0x0'));var path=require(_0x98dd('0x1'));var ejs=require(_0x98dd('0x2'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x98dd('0x3'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x98dd('0x4'));var client=jayson[_0x98dd('0x5')][_0x98dd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5cc383,_0x426632,_0x534cbd,_0x249f60){return new Promise(function(_0x531d4e,_0x1223a1){var _0x8e2fe8=_0x249f60||client;return _0x8e2fe8[_0x98dd('0x7')](_0x5cc383,_0x534cbd)['then'](function(_0x1a6b4b){logger[_0x98dd('0x8')](_0x98dd('0x9'),_0x426632,_0x98dd('0xa'));logger[_0x98dd('0xb')]('Network,\x20%s,\x20%s,\x20%s',_0x426632,'request\x20sent',JSON['stringify'](_0x1a6b4b));if(_0x1a6b4b[_0x98dd('0xc')]){if(_0x1a6b4b[_0x98dd('0xc')][_0x98dd('0xd')]===0x1f4){logger[_0x98dd('0xc')](_0x98dd('0x9'),_0x426632,_0x1a6b4b[_0x98dd('0xc')][_0x98dd('0xe')]);return _0x1223a1(_0x1a6b4b[_0x98dd('0xc')]['message']);}logger['error']('Network,\x20%s,\x20%s',_0x426632,_0x1a6b4b[_0x98dd('0xc')][_0x98dd('0xe')]);return _0x531d4e(_0x1a6b4b[_0x98dd('0xc')][_0x98dd('0xe')]);}else{logger[_0x98dd('0x8')](_0x98dd('0x9'),_0x426632,_0x98dd('0xa'));_0x531d4e(_0x1a6b4b[_0x98dd('0xf')][_0x98dd('0xe')]);}})['catch'](function(_0x2d8140){logger[_0x98dd('0xc')](_0x98dd('0x9'),_0x426632,_0x2d8140);_0x1223a1(_0x2d8140);});});}function respondWithResult(_0x54787d,_0x44bf78){_0x44bf78=_0x44bf78||0xc8;return function(_0x31aa8b){if(_0x31aa8b){return _0x54787d[_0x98dd('0x10')](_0x44bf78)['json'](_0x31aa8b);}};}function respondWithFilteredResult(_0x2d03ca,_0x32b43d){return function(_0x48414c){if(_0x48414c){var _0x196303=typeof _0x32b43d['offset']===_0x98dd('0x11')&&typeof _0x32b43d['limit']===_0x98dd('0x11');var _0x152423=_0x48414c[_0x98dd('0x12')];var _0xbd669d=_0x196303?0x0:_0x32b43d['offset'];var _0xa63e16=_0x196303?_0x48414c[_0x98dd('0x12')]:_0x32b43d[_0x98dd('0x13')]+_0x32b43d[_0x98dd('0x14')];var _0x476bcf;if(_0xa63e16>=_0x152423){_0xa63e16=_0x152423;_0x476bcf=0xc8;}else{_0x476bcf=0xce;}_0x2d03ca[_0x98dd('0x10')](_0x476bcf);return _0x2d03ca[_0x98dd('0x15')](_0x98dd('0x16'),_0xbd669d+'-'+_0xa63e16+'/'+_0x152423)[_0x98dd('0x17')](_0x48414c);}return null;};}function saveUpdates(_0x5c53e1){return function(_0x39af85){if(_0x39af85){return _0x39af85['update'](_0x5c53e1)['then'](function(_0x4e77f1){return _0x4e77f1;});}return null;};}function removeEntity(_0x3842af){return function(_0x1da1fd){if(_0x1da1fd){return _0x1da1fd[_0x98dd('0x18')]()[_0x98dd('0x19')](function(){_0x3842af[_0x98dd('0x10')](0xcc)[_0x98dd('0x1a')]();});}};}function handleEntityNotFound(_0x20eaf1){return function(_0x35652f){if(!_0x35652f){_0x20eaf1['sendStatus'](0x194);}return _0x35652f;};}function handleError(_0x1c9bdf,_0x99c487){_0x99c487=_0x99c487||0x1f4;return function(_0x1a38a3){logger[_0x98dd('0xc')](_0x1a38a3[_0x98dd('0x1b')]);if(_0x1a38a3[_0x98dd('0x1c')]){delete _0x1a38a3[_0x98dd('0x1c')];}_0x1c9bdf['status'](_0x99c487)[_0x98dd('0x1d')](_0x1a38a3);};}exports[_0x98dd('0x1e')]=function(_0x358726,_0x417faa){var _0xefb690={},_0x20a883={},_0x1f7620={'count':0x0,'rows':[]};var _0x2f8d80=_[_0x98dd('0x1f')](db[_0x98dd('0x20')][_0x98dd('0x21')],function(_0x4a3985){return{'name':_0x4a3985[_0x98dd('0x22')],'type':_0x4a3985[_0x98dd('0x23')][_0x98dd('0x24')]};});_0x20a883[_0x98dd('0x25')]=_['map'](_0x2f8d80,_0x98dd('0x1c'));_0x20a883[_0x98dd('0x26')]=_[_0x98dd('0x27')](_0x358726[_0x98dd('0x26')]);_0x20a883[_0x98dd('0x28')]=_[_0x98dd('0x29')](_0x20a883[_0x98dd('0x25')],_0x20a883['query']);_0xefb690[_0x98dd('0x2a')]=_['intersection'](_0x20a883[_0x98dd('0x25')],qs['fields'](_0x358726['query']['fields']));_0xefb690[_0x98dd('0x2a')]=_0xefb690[_0x98dd('0x2a')][_0x98dd('0x2b')]?_0xefb690['attributes']:_0x20a883['model'];if(!_0x358726[_0x98dd('0x26')][_0x98dd('0x2c')](_0x98dd('0x2d'))){_0xefb690[_0x98dd('0x14')]=qs[_0x98dd('0x14')](_0x358726[_0x98dd('0x26')]['limit']);_0xefb690[_0x98dd('0x13')]=qs[_0x98dd('0x13')](_0x358726[_0x98dd('0x26')][_0x98dd('0x13')]);}_0xefb690[_0x98dd('0x2e')]=qs['sort'](_0x358726[_0x98dd('0x26')][_0x98dd('0x2f')]);_0xefb690[_0x98dd('0x30')]=qs['filters'](_[_0x98dd('0x31')](_0x358726[_0x98dd('0x26')],_0x20a883['filters']),_0x2f8d80);if(_0x358726[_0x98dd('0x26')][_0x98dd('0x32')]){_0xefb690[_0x98dd('0x30')]=_[_0x98dd('0x33')](_0xefb690[_0x98dd('0x30')],{'$or':_['map'](_0x2f8d80,function(_0x3d360b){if(_0x3d360b[_0x98dd('0x23')]!==_0x98dd('0x34')){var _0x24b4cf={};_0x24b4cf[_0x3d360b[_0x98dd('0x1c')]]={'$like':'%'+_0x358726[_0x98dd('0x26')]['filter']+'%'};return _0x24b4cf;}})});}_0xefb690=_[_0x98dd('0x33')]({},_0xefb690,_0x358726[_0x98dd('0x35')]);var _0x50d962={'where':_0xefb690[_0x98dd('0x30')]};return db[_0x98dd('0x20')][_0x98dd('0x12')](_0x50d962)[_0x98dd('0x19')](function(_0x24954d){_0x1f7620['count']=_0x24954d;if(_0x358726[_0x98dd('0x26')][_0x98dd('0x36')]){_0xefb690['include']=[{'all':!![]}];}return db['Network'][_0x98dd('0x37')](_0xefb690);})[_0x98dd('0x19')](function(_0x364af9){_0x1f7620[_0x98dd('0x38')]=_0x364af9;return _0x1f7620;})[_0x98dd('0x19')](respondWithFilteredResult(_0x417faa,_0xefb690))['catch'](handleError(_0x417faa,null));};exports[_0x98dd('0x39')]=function(_0x907cdc,_0x1d8007){var _0x4d1edb={'raw':!![],'where':{'id':_0x907cdc[_0x98dd('0x3a')]['id']}},_0xf6f9c={};_0xf6f9c[_0x98dd('0x25')]=_['keys'](db['Network'][_0x98dd('0x21')]);_0xf6f9c[_0x98dd('0x26')]=_['keys'](_0x907cdc[_0x98dd('0x26')]);_0xf6f9c[_0x98dd('0x28')]=_['intersection'](_0xf6f9c[_0x98dd('0x25')],_0xf6f9c[_0x98dd('0x26')]);_0x4d1edb['attributes']=_['intersection'](_0xf6f9c[_0x98dd('0x25')],qs[_0x98dd('0x3b')](_0x907cdc[_0x98dd('0x26')][_0x98dd('0x3b')]));_0x4d1edb[_0x98dd('0x2a')]=_0x4d1edb[_0x98dd('0x2a')][_0x98dd('0x2b')]?_0x4d1edb[_0x98dd('0x2a')]:_0xf6f9c[_0x98dd('0x25')];if(_0x907cdc[_0x98dd('0x26')][_0x98dd('0x36')]){_0x4d1edb['include']=[{'all':!![]}];}_0x4d1edb=_[_0x98dd('0x33')]({},_0x4d1edb,_0x907cdc[_0x98dd('0x35')]);return db[_0x98dd('0x20')]['find'](_0x4d1edb)['then'](handleEntityNotFound(_0x1d8007,null))[_0x98dd('0x19')](respondWithResult(_0x1d8007,null))[_0x98dd('0x3c')](handleError(_0x1d8007,null));};exports[_0x98dd('0x3d')]=function(_0x5db0a1,_0x51838c){var _0x460832;return db[_0x98dd('0x20')]['create'](_0x5db0a1[_0x98dd('0x3e')],{'raw':!![]})[_0x98dd('0x19')](function(_0x16472c){_0x460832=_0x16472c;return db[_0x98dd('0x20')][_0x98dd('0x37')]({'where':{'type':_0x5db0a1['body'][_0x98dd('0x23')]},'raw':!![]});})[_0x98dd('0x19')](function(_0x4e8639){if(_0x460832[_0x98dd('0x23')][_0x98dd('0x3f')]()=='STUN'){var _0x41eb7c=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config[_0x98dd('0x42')],_0x98dd('0x43')),_0x98dd('0x44'));var _0x42271d=ejs[_0x98dd('0x45')](_0x41eb7c,{'networks':_0x4e8639||[]});fs['writeFileSync'](_0x98dd('0x46'),_0x42271d);return respondWithRpcPromise(_0x98dd('0x47'),'create',{'module':_0x98dd('0x48')});}else if(_0x460832['type']['toUpperCase']()==_0x98dd('0x49')){var _0x3f5d4c=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config[_0x98dd('0x42')],'server/files/templates/turn_multiple.ejs'),_0x98dd('0x44'));var _0x2d38c9=ejs['render'](_0x3f5d4c,{'networks':_0x4e8639||[]});fs[_0x98dd('0x4a')](_0x98dd('0x4b'),_0x2d38c9);return respondWithRpcPromise(_0x98dd('0x47'),_0x98dd('0x3d'),{'module':_0x98dd('0x48')});}else{var _0x5cf404=fs['readFileSync'](path[_0x98dd('0x41')](config['root'],'server/files/templates/network.ejs'),_0x98dd('0x44'));var _0x127677=ejs[_0x98dd('0x45')](_0x5cf404,{'networks':_0x4e8639||[]});fs[_0x98dd('0x4a')](util[_0x98dd('0x4c')](_0x98dd('0x4d'),_0x5db0a1[_0x98dd('0x3e')]['type'][_0x98dd('0x4e')]()),_0x127677);return respondWithRpcPromise(_0x98dd('0x47'),_0x98dd('0x3d'),{'module':_0x98dd('0x4f')});}})[_0x98dd('0x19')](function(){return _0x460832;})[_0x98dd('0x19')](respondWithResult(_0x51838c,0xc9))[_0x98dd('0x3c')](handleError(_0x51838c,null));};exports[_0x98dd('0x50')]=function(_0x5cb337,_0x1e89dd){var _0x362687;return db[_0x98dd('0x20')][_0x98dd('0x51')]({'where':{'id':_0x5cb337['params']['id']}})['then'](handleEntityNotFound(_0x1e89dd,null))[_0x98dd('0x19')](saveUpdates(_0x5cb337['body'],null))[_0x98dd('0x19')](function(_0x1619d3){if(_0x1619d3){_0x362687=_0x1619d3;return db[_0x98dd('0x20')][_0x98dd('0x37')]({'where':{'type':_0x362687['type']},'raw':!![]});}return null;})['then'](function(_0x4446a1){if(_0x362687[_0x98dd('0x23')]['toUpperCase']()=='STUN'){var _0x5d24fa=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config[_0x98dd('0x42')],_0x98dd('0x43')),'utf8');var _0x4f51ab=ejs['render'](_0x5d24fa,{'networks':_0x4446a1||[]});fs[_0x98dd('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x4f51ab);return respondWithRpcPromise(_0x98dd('0x47'),_0x98dd('0x50'),{'module':_0x98dd('0x48')});}else if(_0x362687[_0x98dd('0x23')][_0x98dd('0x3f')]()=='TURN'){var _0x41d807=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config['root'],_0x98dd('0x52')),_0x98dd('0x44'));var _0xb05da4=ejs[_0x98dd('0x45')](_0x41d807,{'networks':_0x4446a1||[]});fs[_0x98dd('0x4a')](_0x98dd('0x4b'),_0xb05da4);return respondWithRpcPromise(_0x98dd('0x47'),_0x98dd('0x50'),{'module':'res_stun_monitor.so'});}else{var _0x5ef53c=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config[_0x98dd('0x42')],'server/files/templates/network.ejs'),_0x98dd('0x44'));var _0x495803=ejs[_0x98dd('0x45')](_0x5ef53c,{'networks':_0x4446a1||[]});fs[_0x98dd('0x4a')](util[_0x98dd('0x4c')](_0x98dd('0x4d'),_0x5cb337[_0x98dd('0x3e')][_0x98dd('0x23')][_0x98dd('0x4e')]()),_0x495803);return respondWithRpcPromise('Reload',_0x98dd('0x50'),{'module':_0x98dd('0x4f')});}})[_0x98dd('0x19')](function(_0x581d5d){if(_0x581d5d){return _0x362687;}return null;})['then'](respondWithResult(_0x1e89dd,null))[_0x98dd('0x3c')](handleError(_0x1e89dd,null));};exports[_0x98dd('0x18')]=function(_0x841235,_0x3f568e){var _0x3d53dd;return db[_0x98dd('0x20')][_0x98dd('0x51')]({'where':{'id':_0x841235[_0x98dd('0x3a')]['id']}})['then'](function(_0x35e4af){_0x3d53dd=_0x35e4af;return _0x35e4af;})['then'](handleEntityNotFound(_0x3f568e,null))['then'](removeEntity(_0x3f568e,null))[_0x98dd('0x19')](function(){if(_0x3d53dd){return db['Network']['findAll']({'where':{'type':_0x3d53dd[_0x98dd('0x23')]},'raw':!![]});}})[_0x98dd('0x19')](function(_0x4baa9c){if(_0x3d53dd[_0x98dd('0x23')][_0x98dd('0x3f')]()==_0x98dd('0x53')){var _0x49da24=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config['root'],_0x98dd('0x43')),_0x98dd('0x44'));var _0x28dc1b=ejs[_0x98dd('0x45')](_0x49da24,{'networks':_0x4baa9c||[]});fs[_0x98dd('0x4a')](_0x98dd('0x46'),_0x28dc1b);return respondWithRpcPromise('Reload','destroy',{'module':_0x98dd('0x48')});}else if(_0x3d53dd['type'][_0x98dd('0x3f')]()==_0x98dd('0x49')){var _0x52af03=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config[_0x98dd('0x42')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x172cc3=ejs['render'](_0x52af03,{'networks':_0x4baa9c||[]});fs[_0x98dd('0x4a')]('/etc/asterisk/turn_xcally.conf',_0x172cc3);return respondWithRpcPromise(_0x98dd('0x47'),_0x98dd('0x18'),{'module':_0x98dd('0x48')});}else{var _0x4a2db3=fs[_0x98dd('0x40')](path[_0x98dd('0x41')](config[_0x98dd('0x42')],_0x98dd('0x54')),_0x98dd('0x44'));var _0x1c46f6=ejs[_0x98dd('0x45')](_0x4a2db3,{'networks':_0x4baa9c||[]});fs[_0x98dd('0x4a')](util[_0x98dd('0x4c')](_0x98dd('0x4d'),_0x3d53dd['type'][_0x98dd('0x4e')]()),_0x1c46f6);return respondWithRpcPromise(_0x98dd('0x47'),_0x98dd('0x18'),{'module':_0x98dd('0x4f')});}})['catch'](handleError(_0x3f568e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index cd8a9be..0308238 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 _0x524a=['exports','define','network','lodash','util','../../config/logger','api','bluebird','request-promise','path','./network.attributes'];(function(_0x1038c9,_0x37fbcc){var _0x5ccc90=function(_0x24265e){while(--_0x24265e){_0x1038c9['push'](_0x1038c9['shift']());}};_0x5ccc90(++_0x37fbcc);}(_0x524a,0xf5));var _0xa524=function(_0x353815,_0x490868){_0x353815=_0x353815-0x0;var _0x10ff7f=_0x524a[_0x353815];return _0x10ff7f;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var moment=require('moment');var BPromise=require(_0xa524('0x4'));var rp=require(_0xa524('0x5'));var fs=require('fs');var path=require(_0xa524('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa524('0x7'));module[_0xa524('0x8')]=function(_0x16227b,_0x5f472f){return _0x16227b[_0xa524('0x9')]('Network',attributes,{'tableName':_0xa524('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4746=['rimraf','../../config/environment','exports','define','Network','network','lodash','util','api','bluebird','request-promise','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4746,0xc6));var _0x6474=function(_0x2fede9,_0x4a5d1a){_0x2fede9=_0x2fede9-0x0;var _0x16fdac=_0x4746[_0x2fede9];return _0x16fdac;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var logger=require('../../config/logger')(_0x6474('0x2'));var moment=require('moment');var BPromise=require(_0x6474('0x3'));var rp=require(_0x6474('0x4'));var fs=require('fs');var path=require(_0x6474('0x5'));var rimraf=require(_0x6474('0x6'));var config=require(_0x6474('0x7'));var attributes=require('./network.attributes');module[_0x6474('0x8')]=function(_0x2bcf7c,_0x4cadd7){return _0x2bcf7c[_0x6474('0x9')](_0x6474('0xa'),attributes,{'tableName':_0x6474('0xb'),'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 5c294ef..e125958 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x16c6db,_0x17468f){_0x16c6db=_0x16c6db-0x0;var _0x3705cd=_0x7a54[_0x16c6db];return _0x3705cd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14700d,_0x55a66d){var _0x4ddcd5=function(_0x398af9){while(--_0x398af9){_0x14700d['push'](_0x14700d['shift']());}};_0x4ddcd5(++_0x55a66d);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 66512e2..6cd307f 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 _0x8952=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getAnswers','getApplications','/:id/interactions','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','delete','removeAnswers','exports','util','path','connect-timeout'];(function(_0xa16ef8,_0x40cc48){var _0x40ab63=function(_0x2fb788){while(--_0x2fb788){_0xa16ef8['push'](_0xa16ef8['shift']());}};_0x40ab63(++_0x40cc48);}(_0x8952,0x17e));var _0x2895=function(_0x506e35,_0x49d9d6){_0x506e35=_0x506e35-0x0;var _0x413f25=_0x8952[_0x506e35];return _0x413f25;};'use strict';var multer=require('multer');var util=require(_0x2895('0x0'));var path=require(_0x2895('0x1'));var timeout=require(_0x2895('0x2'));var express=require(_0x2895('0x3'));var router=express[_0x2895('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2895('0x5'));var interaction=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var controller=require('./openchannelAccount.controller');router[_0x2895('0x8')]('/',auth[_0x2895('0x9')](),controller[_0x2895('0xa')]);router['get']('/describe',auth[_0x2895('0x9')](),controller[_0x2895('0xb')]);router[_0x2895('0x8')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller['show']);router[_0x2895('0x8')]('/:id/dispositions',auth[_0x2895('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x2895('0x9')](),controller[_0x2895('0xd')]);router[_0x2895('0x8')]('/:id/applications',auth[_0x2895('0x9')](),controller[_0x2895('0xe')]);router['get'](_0x2895('0xf'),auth[_0x2895('0x9')](),controller['getInteractions']);router['get'](_0x2895('0x10'),auth[_0x2895('0x9')](),controller['getAgents']);router[_0x2895('0x11')]('/',auth[_0x2895('0x9')](),controller[_0x2895('0x12')]);router[_0x2895('0x11')](_0x2895('0x13'),auth[_0x2895('0x9')](),controller[_0x2895('0x14')]);router[_0x2895('0x11')](_0x2895('0x15'),auth[_0x2895('0x9')](),controller[_0x2895('0x16')]);router[_0x2895('0x11')](_0x2895('0x17'),controller[_0x2895('0x18')]);router[_0x2895('0x11')](_0x2895('0x19'),auth[_0x2895('0x9')](),controller[_0x2895('0x1a')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x2895('0x1b')]);router[_0x2895('0x11')](_0x2895('0x1c'),auth['isAuthenticated'](),controller[_0x2895('0x1d')]);router[_0x2895('0x1e')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller[_0x2895('0x1f')]);router['delete'](_0x2895('0xc'),auth[_0x2895('0x9')](),controller['destroy']);router[_0x2895('0x20')](_0x2895('0x13'),auth[_0x2895('0x9')](),controller['removeDispositions']);router['delete'](_0x2895('0x15'),auth[_0x2895('0x9')](),controller[_0x2895('0x21')]);router['delete'](_0x2895('0x10'),auth[_0x2895('0x9')](),controller['removeAgents']);module[_0x2895('0x22')]=router; \ No newline at end of file +var _0x4b17=['path','express','Router','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','create','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','destroy','delete','removeAnswers','removeAgents','exports','multer'];(function(_0xbe9886,_0x128ea5){var _0x82a852=function(_0x4d3325){while(--_0x4d3325){_0xbe9886['push'](_0xbe9886['shift']());}};_0x82a852(++_0x128ea5);}(_0x4b17,0x10f));var _0x74b1=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x4b17[_0x22093a];return _0x2f4989;};'use strict';var multer=require(_0x74b1('0x0'));var util=require('util');var path=require(_0x74b1('0x1'));var timeout=require('connect-timeout');var express=require(_0x74b1('0x2'));var router=express[_0x74b1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x74b1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x74b1('0x5'));router[_0x74b1('0x6')]('/',auth[_0x74b1('0x7')](),controller[_0x74b1('0x8')]);router[_0x74b1('0x6')](_0x74b1('0x9'),auth[_0x74b1('0x7')](),controller['describe']);router[_0x74b1('0x6')](_0x74b1('0xa'),auth[_0x74b1('0x7')](),controller[_0x74b1('0xb')]);router[_0x74b1('0x6')]('/:id/dispositions',auth[_0x74b1('0x7')](),controller[_0x74b1('0xc')]);router['get'](_0x74b1('0xd'),auth[_0x74b1('0x7')](),controller[_0x74b1('0xe')]);router[_0x74b1('0x6')]('/:id/applications',auth[_0x74b1('0x7')](),controller['getApplications']);router['get'](_0x74b1('0xf'),auth[_0x74b1('0x7')](),controller['getInteractions']);router['get']('/:id/users',auth[_0x74b1('0x7')](),controller['getAgents']);router['post']('/',auth[_0x74b1('0x7')](),controller[_0x74b1('0x10')]);router[_0x74b1('0x11')](_0x74b1('0x12'),auth[_0x74b1('0x7')](),controller[_0x74b1('0x13')]);router['post'](_0x74b1('0xd'),auth[_0x74b1('0x7')](),controller[_0x74b1('0x14')]);router[_0x74b1('0x11')](_0x74b1('0x15'),controller[_0x74b1('0x16')]);router[_0x74b1('0x11')]('/:id/applications',auth[_0x74b1('0x7')](),controller[_0x74b1('0x17')]);router['post'](_0x74b1('0x18'),auth[_0x74b1('0x7')](),controller[_0x74b1('0x19')]);router[_0x74b1('0x11')](_0x74b1('0x1a'),auth[_0x74b1('0x7')](),controller[_0x74b1('0x1b')]);router[_0x74b1('0x1c')]('/:id',auth[_0x74b1('0x7')](),controller['update']);router['delete']('/:id',auth[_0x74b1('0x7')](),controller[_0x74b1('0x1d')]);router[_0x74b1('0x1e')](_0x74b1('0x12'),auth[_0x74b1('0x7')](),controller['removeDispositions']);router[_0x74b1('0x1e')]('/:id/canned_answers',auth[_0x74b1('0x7')](),controller[_0x74b1('0x1f')]);router[_0x74b1('0x1e')](_0x74b1('0x18'),auth[_0x74b1('0x7')](),controller[_0x74b1('0x20')]);module[_0x74b1('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3019d5b..f920f37 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 _0x9808=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x1aa139,_0x21dd23){var _0x18fabc=function(_0x34a34c){while(--_0x34a34c){_0x1aa139['push'](_0x1aa139['shift']());}};_0x18fabc(++_0x21dd23);}(_0x9808,0xe8));var _0x8980=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x9808[_0x4aa4af];return _0x3bf44a;};'use strict';var Sequelize=require(_0x8980('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x8980('0x1')],'unique':_0x8980('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8980('0x1')]},'token':{'type':Sequelize[_0x8980('0x1')],'defaultValue':function(){return rs[_0x8980('0x3')]();}},'replyUri':{'type':Sequelize[_0x8980('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8980('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8980('0x4')],'defaultValue':function(){return _0x8980('0x5');}},'notificationSound':{'type':Sequelize[_0x8980('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8980('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8980('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8980('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8980('0x1')]},'queueTransfer':{'type':Sequelize[_0x8980('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8980('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8980('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8980('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8980('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8980('0x6')],'defaultValue':![],'comment':_0x8980('0x8'),'set':function(_0x279bb3){if(!_0x279bb3)this['setDataValue'](_0x8980('0x9'),null);this[_0x8980('0xa')](_0x8980('0xb'),_0x279bb3);}}}; \ No newline at end of file +var _0xbcac=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x5b4c5d,_0x10026d){var _0x194ef4=function(_0x10fbdd){while(--_0x10fbdd){_0x5b4c5d['push'](_0x5b4c5d['shift']());}};_0x194ef4(++_0x10026d);}(_0xbcac,0xff));var _0xcbca=function(_0x25b001,_0x1e4e19){_0x25b001=_0x25b001-0x0;var _0x1ba78c=_0xbcac[_0x25b001];return _0x1ba78c;};'use strict';var Sequelize=require(_0xcbca('0x0'));var rs=require('randomstring');module[_0xcbca('0x1')]={'name':{'type':Sequelize[_0xcbca('0x2')],'unique':_0xcbca('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcbca('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xcbca('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xcbca('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcbca('0x4')],'defaultValue':function(){return _0xcbca('0x5');}},'notificationSound':{'type':Sequelize[_0xcbca('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcbca('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcbca('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xcbca('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xcbca('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcbca('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcbca('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcbca('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcbca('0x8'),'set':function(_0x1dce81){if(!_0x1dce81)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x1dce81);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d0efbc3..4e16277 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 _0x8958=['apply','reject','save','destroy','get','OpenchannelAccounts','end','sendStatus','stack','name','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','Pause','keys','intersection','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','getDispositions','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','Contacts','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','interaction','created','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','getAgents','out','OpenchannelMessage','dataValues','Messages','push','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x27b1c0,_0x1edb22){var _0x355863=function(_0x4850f3){while(--_0x4850f3){_0x27b1c0['push'](_0x27b1c0['shift']());}};_0x355863(++_0x1edb22);}(_0x8958,0x93));var _0x8895=function(_0x41df92,_0x145dfa){_0x41df92=_0x41df92-0x0;var _0x28a6db=_0x8958[_0x41df92];return _0x28a6db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];config[_0x8895('0x18')]=_[_0x8895('0x19')](config['redis'],{'host':_0x8895('0x1a'),'port':0x18eb});var socket=require(_0x8895('0x1b'))(new Redis(config[_0x8895('0x18')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x8895('0x1c'));var client=jayson['client'][_0x8895('0x1d')]({'port':0x232c});var client9002=jayson[_0x8895('0x1e')][_0x8895('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3d7b59,_0x2c9d40,_0x5b4c2e,_0x4128e2){return new BPromise(function(_0x100fc8,_0x24906b){var _0xcdd661=_0x4128e2||client;return _0xcdd661[_0x8895('0x1f')](_0x3d7b59,_0x5b4c2e)[_0x8895('0x20')](function(_0x304be6){logger[_0x8895('0x21')](_0x8895('0x22'),_0x2c9d40,_0x8895('0x23'));logger[_0x8895('0x24')](_0x8895('0x25'),_0x2c9d40,_0x8895('0x23'),JSON['stringify'](_0x304be6));if(_0x304be6['error']){if(_0x304be6['error'][_0x8895('0x26')]===0x1f4){logger[_0x8895('0x27')](_0x8895('0x22'),_0x2c9d40,_0x304be6[_0x8895('0x27')][_0x8895('0x28')]);return _0x24906b(_0x304be6[_0x8895('0x27')][_0x8895('0x28')]);}logger[_0x8895('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x2c9d40,_0x304be6[_0x8895('0x27')][_0x8895('0x28')]);return _0x100fc8(_0x304be6[_0x8895('0x27')][_0x8895('0x28')]);}else{logger[_0x8895('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x2c9d40,'request\x20sent');_0x100fc8(_0x304be6[_0x8895('0x29')][_0x8895('0x28')]);}})[_0x8895('0x2a')](function(_0x24a376){logger['error'](_0x8895('0x22'),_0x2c9d40,_0x24a376);_0x24906b(_0x24a376);});});}function respondWithStatusCode(_0x1e8ac9,_0x187a15){_0x187a15=_0x187a15||0xcc;return function(_0x5486a6){if(_0x5486a6){return _0x1e8ac9['sendStatus'](_0x187a15);}return _0x1e8ac9[_0x8895('0x2b')](_0x187a15)['end']();};}function respondWithResult(_0x3d51b0,_0x3e3b48){_0x3e3b48=_0x3e3b48||0xc8;return function(_0x10b48f){if(_0x10b48f){return _0x3d51b0[_0x8895('0x2b')](_0x3e3b48)[_0x8895('0x2c')](_0x10b48f);}};}function respondWithFilteredResult(_0x5c03ea,_0x4d567a){return function(_0x6e449d){if(_0x6e449d){var _0x37ac3a=typeof _0x4d567a[_0x8895('0x2d')]===_0x8895('0x2e')&&typeof _0x4d567a[_0x8895('0x2f')]==='undefined';var _0x4ce759=_0x6e449d[_0x8895('0x30')];var _0x848a11=_0x37ac3a?0x0:_0x4d567a[_0x8895('0x2d')];var _0x29f565=_0x37ac3a?_0x6e449d[_0x8895('0x30')]:_0x4d567a['offset']+_0x4d567a[_0x8895('0x2f')];var _0x5d2f33;if(_0x29f565>=_0x4ce759){_0x29f565=_0x4ce759;_0x5d2f33=0xc8;}else{_0x5d2f33=0xce;}_0x5c03ea[_0x8895('0x2b')](_0x5d2f33);return _0x5c03ea['set'](_0x8895('0x31'),_0x848a11+'-'+_0x29f565+'/'+_0x4ce759)[_0x8895('0x2c')](_0x6e449d);}return null;};}function patchUpdates(_0x233473){return function(_0x3e71fa){try{jsonpatch[_0x8895('0x32')](_0x3e71fa,_0x233473,!![]);}catch(_0x586111){return BPromise[_0x8895('0x33')](_0x586111);}return _0x3e71fa[_0x8895('0x34')]();};}function saveUpdates(_0x1b5359,_0x34cb11){return function(_0x330692){if(_0x330692){return _0x330692['update'](_0x1b5359)[_0x8895('0x20')](function(_0x5f0a79){return _0x5f0a79;});}return null;};}function removeEntity(_0x384f48,_0x535f25){return function(_0x21c22b){if(_0x21c22b){return _0x21c22b[_0x8895('0x35')]()[_0x8895('0x20')](function(){var _0x418e53=_0x21c22b[_0x8895('0x36')]({'plain':!![]});var _0x4ee352=_0x8895('0x37');return db['UserProfileResource'][_0x8895('0x35')]({'where':{'type':_0x4ee352,'resourceId':_0x418e53['id']}})[_0x8895('0x20')](function(){return _0x21c22b;});})[_0x8895('0x20')](function(){_0x384f48[_0x8895('0x2b')](0xcc)[_0x8895('0x38')]();});}};}function handleEntityNotFound(_0x16e110,_0x4b7fe0){return function(_0x23e30c){if(!_0x23e30c){_0x16e110[_0x8895('0x39')](0x194);}return _0x23e30c;};}function handleError(_0x528cbb,_0x2557fc){_0x2557fc=_0x2557fc||0x1f4;return function(_0x54ca09){logger[_0x8895('0x27')](_0x54ca09[_0x8895('0x3a')]);if(_0x54ca09['name']){delete _0x54ca09[_0x8895('0x3b')];}_0x528cbb[_0x8895('0x2b')](_0x2557fc)['send'](_0x54ca09);};}exports['index']=function(_0x202130,_0xf0b378){var _0x55aacc={'include':[{'model':db['Pause'],'as':_0x8895('0x3c')}]},_0x331a9e={},_0x39944f={'count':0x0,'rows':[]};var _0x25c854=_[_0x8895('0x3d')](db[_0x8895('0x3e')][_0x8895('0x3f')],function(_0x534876){return{'name':_0x534876['fieldName'],'type':_0x534876[_0x8895('0x40')]['key']};});_0x331a9e[_0x8895('0x41')]=_[_0x8895('0x3d')](_0x25c854,'name');_0x331a9e[_0x8895('0x42')]=_['keys'](_0x202130[_0x8895('0x42')]);_0x331a9e['filters']=_['intersection'](_0x331a9e['model'],_0x331a9e['query']);_0x55aacc['attributes']=_['intersection'](_0x331a9e[_0x8895('0x41')],qs[_0x8895('0x43')](_0x202130['query']['fields']));_0x55aacc[_0x8895('0x44')]=_0x55aacc[_0x8895('0x44')]['length']?_0x55aacc[_0x8895('0x44')]:_0x331a9e[_0x8895('0x41')];if(!_0x202130[_0x8895('0x42')][_0x8895('0x45')](_0x8895('0x46'))){_0x55aacc['limit']=qs['limit'](_0x202130['query'][_0x8895('0x2f')]);_0x55aacc['offset']=qs[_0x8895('0x2d')](_0x202130[_0x8895('0x42')][_0x8895('0x2d')]);}_0x55aacc[_0x8895('0x47')]=qs['sort'](_0x202130[_0x8895('0x42')][_0x8895('0x48')]);_0x55aacc[_0x8895('0x49')]=qs[_0x8895('0x4a')](_[_0x8895('0x4b')](_0x202130[_0x8895('0x42')],_0x331a9e[_0x8895('0x4a')]),_0x25c854);if(_0x202130[_0x8895('0x42')]['filter']){_0x55aacc[_0x8895('0x49')]=_[_0x8895('0x4c')](_0x55aacc['where'],{'$or':_[_0x8895('0x3d')](_0x25c854,function(_0x55bd4a){if(_0x55bd4a['type']!==_0x8895('0x4d')){var _0x337a9f={};_0x337a9f[_0x55bd4a[_0x8895('0x3b')]]={'$like':'%'+_0x202130['query'][_0x8895('0x4e')]+'%'};return _0x337a9f;}})});}_0x55aacc=_['merge']({},_0x55aacc,_0x202130[_0x8895('0x4f')]);var _0x152197={'where':_0x55aacc[_0x8895('0x49')]};return db[_0x8895('0x3e')][_0x8895('0x30')](_0x152197)[_0x8895('0x20')](function(_0xebb0c4){_0x39944f['count']=_0xebb0c4;if(_0x202130['query'][_0x8895('0x50')]){_0x55aacc[_0x8895('0x51')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x8895('0x52')](_0x55aacc);})['then'](function(_0x4e8af3){_0x39944f[_0x8895('0x53')]=_0x4e8af3;return _0x39944f;})['then'](respondWithFilteredResult(_0xf0b378,_0x55aacc))[_0x8895('0x2a')](handleError(_0xf0b378,null));};exports[_0x8895('0x54')]=function(_0x43aada,_0x459e1a){var _0x2714d3={'raw':![],'where':{'id':_0x43aada[_0x8895('0x55')]['id']},'include':[{'model':db[_0x8895('0x56')],'as':'mandatoryDispositionPause'}]},_0x39a1d9={};_0x39a1d9[_0x8895('0x41')]=_[_0x8895('0x57')](db[_0x8895('0x3e')]['rawAttributes']);_0x39a1d9[_0x8895('0x42')]=_[_0x8895('0x57')](_0x43aada[_0x8895('0x42')]);_0x39a1d9[_0x8895('0x4a')]=_[_0x8895('0x58')](_0x39a1d9[_0x8895('0x41')],_0x39a1d9[_0x8895('0x42')]);_0x2714d3[_0x8895('0x44')]=_[_0x8895('0x58')](_0x39a1d9[_0x8895('0x41')],qs['fields'](_0x43aada[_0x8895('0x42')][_0x8895('0x43')]));_0x2714d3[_0x8895('0x44')]=_0x2714d3[_0x8895('0x44')][_0x8895('0x59')]?_0x2714d3['attributes']:_0x39a1d9[_0x8895('0x41')];if(_0x43aada[_0x8895('0x42')][_0x8895('0x50')]){_0x2714d3[_0x8895('0x51')]=[{'all':!![]}];}_0x2714d3=_[_0x8895('0x4c')]({},_0x2714d3,_0x43aada['options']);return db[_0x8895('0x3e')][_0x8895('0x5a')](_0x2714d3)[_0x8895('0x20')](handleEntityNotFound(_0x459e1a,null))['then'](respondWithResult(_0x459e1a,null))[_0x8895('0x2a')](handleError(_0x459e1a,null));};exports[_0x8895('0x5b')]=function(_0x2c777b,_0x4ec8eb){return db[_0x8895('0x3e')][_0x8895('0x5b')](_0x2c777b['body'],{})[_0x8895('0x20')](function(_0x26f68c){var _0x5198f8=_0x2c777b[_0x8895('0x5c')][_0x8895('0x36')]({'plain':!![]});if(!_0x5198f8)throw new Error(_0x8895('0x5d'));if(_0x5198f8[_0x8895('0x5e')]==='user'){var _0x5ad62e=_0x26f68c[_0x8895('0x36')]({'plain':!![]});var _0x32f704=_0x8895('0x37');return db['UserProfileSection'][_0x8895('0x5a')]({'where':{'name':_0x32f704,'userProfileId':_0x5198f8[_0x8895('0x5f')]},'raw':!![]})['then'](function(_0x22edd6){if(_0x22edd6&&_0x22edd6['autoAssociation']===0x0){return db[_0x8895('0x60')][_0x8895('0x5b')]({'name':_0x5ad62e[_0x8895('0x3b')],'resourceId':_0x5ad62e['id'],'type':_0x22edd6[_0x8895('0x3b')],'sectionId':_0x22edd6['id']},{})[_0x8895('0x20')](function(){return _0x26f68c;});}else{return _0x26f68c;}})['catch'](function(_0x537263){logger[_0x8895('0x27')](_0x8895('0x61'),_0x537263);throw _0x537263;});}return _0x26f68c;})['then'](respondWithResult(_0x4ec8eb,0xc9))[_0x8895('0x2a')](handleError(_0x4ec8eb,null));};exports[_0x8895('0x62')]=function(_0x38ea77,_0x455557){if(_0x38ea77['body']['id']){delete _0x38ea77[_0x8895('0x63')]['id'];}return db[_0x8895('0x3e')][_0x8895('0x5a')]({'where':{'id':_0x38ea77[_0x8895('0x55')]['id']},'include':[{'model':db[_0x8895('0x56')],'as':_0x8895('0x3c')}]})[_0x8895('0x20')](handleEntityNotFound(_0x455557,null))[_0x8895('0x20')](saveUpdates(_0x38ea77[_0x8895('0x63')],null))[_0x8895('0x20')](respondWithResult(_0x455557,null))[_0x8895('0x2a')](handleError(_0x455557,null));};exports[_0x8895('0x35')]=function(_0x192f25,_0xe56fc2){return db[_0x8895('0x3e')]['find']({'where':{'id':_0x192f25['params']['id']}})['then'](handleEntityNotFound(_0xe56fc2,null))[_0x8895('0x20')](removeEntity(_0xe56fc2,null))[_0x8895('0x2a')](handleError(_0xe56fc2,null));};exports[_0x8895('0x64')]=function(_0x38f960,_0x148951){return db['OpenchannelAccount'][_0x8895('0x64')]()[_0x8895('0x20')](respondWithResult(_0x148951,null))['catch'](handleError(_0x148951,null));};exports[_0x8895('0x65')]=function(_0x39e1de,_0xf51f48,_0xf07634){if(_0x39e1de[_0x8895('0x63')]['id']){delete _0x39e1de['body']['id'];}return db[_0x8895('0x3e')][_0x8895('0x5a')]({'where':{'id':_0x39e1de[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0xf51f48,null))[_0x8895('0x20')](function(_0x7a312c){if(_0x7a312c){_0x39e1de[_0x8895('0x63')]['OpenchannelAccountId']=_0x7a312c['id'];return db[_0x8895('0x66')][_0x8895('0x5b')](_0x39e1de['body']);}})[_0x8895('0x20')](respondWithResult(_0xf51f48,null))[_0x8895('0x2a')](handleError(_0xf51f48,null));};exports[_0x8895('0x67')]=function(_0x3e58a7,_0x38489a,_0x560381){var _0x16cd17={'raw':![],'where':{}};var _0x4b2843={};var _0xe6bef9={'count':0x0,'rows':[]};return db[_0x8895('0x3e')]['findOne']({'where':{'id':_0x3e58a7[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x38489a,null))[_0x8895('0x20')](function(_0x863374){if(_0x863374){_0x4b2843['model']=_[_0x8895('0x57')](db['Disposition']['rawAttributes']);_0x4b2843[_0x8895('0x42')]=_[_0x8895('0x57')](_0x3e58a7[_0x8895('0x42')]);_0x4b2843['filters']=_[_0x8895('0x58')](_0x4b2843['model'],_0x4b2843[_0x8895('0x42')]);_0x16cd17[_0x8895('0x44')]=_[_0x8895('0x58')](_0x4b2843[_0x8895('0x41')],qs[_0x8895('0x43')](_0x3e58a7['query']['fields']));_0x16cd17[_0x8895('0x44')]=_0x16cd17['attributes'][_0x8895('0x59')]?_0x16cd17[_0x8895('0x44')]:_0x4b2843['model'];if(!_0x3e58a7[_0x8895('0x42')][_0x8895('0x45')](_0x8895('0x46'))){_0x16cd17[_0x8895('0x2f')]=qs[_0x8895('0x2f')](_0x3e58a7['query'][_0x8895('0x2f')]);_0x16cd17['offset']=qs['offset'](_0x3e58a7[_0x8895('0x42')]['offset']);}_0x16cd17[_0x8895('0x47')]=qs[_0x8895('0x48')](_0x3e58a7[_0x8895('0x42')][_0x8895('0x48')]);_0x16cd17['where']=qs['filters'](_['pick'](_0x3e58a7[_0x8895('0x42')],_0x4b2843[_0x8895('0x4a')]));_0x16cd17[_0x8895('0x49')][_0x8895('0x68')]=_0x863374['id'];if(_0x3e58a7[_0x8895('0x42')][_0x8895('0x4e')]){_0x16cd17['where']=_[_0x8895('0x4c')](_0x16cd17[_0x8895('0x49')],{'$or':_[_0x8895('0x3d')](_0x16cd17['attributes'],function(_0x19a31c){var _0x565bb8={};_0x565bb8[_0x19a31c]={'$like':'%'+_0x3e58a7[_0x8895('0x42')]['filter']+'%'};return _0x565bb8;})});}_0x16cd17=_[_0x8895('0x4c')]({},_0x16cd17,_0x3e58a7[_0x8895('0x4f')]);return db['Disposition'][_0x8895('0x30')]({'where':_0x16cd17[_0x8895('0x49')]})['then'](function(_0x2c12e3){_0xe6bef9[_0x8895('0x30')]=_0x2c12e3;if(_0x3e58a7[_0x8895('0x42')][_0x8895('0x50')]){_0x16cd17[_0x8895('0x51')]=[{'all':!![]}];}return db[_0x8895('0x66')][_0x8895('0x52')](_0x16cd17);})['then'](function(_0x2816bf){_0xe6bef9['rows']=_0x2816bf;return _0xe6bef9;});}})[_0x8895('0x20')](respondWithFilteredResult(_0x38489a,_0x16cd17))[_0x8895('0x2a')](handleError(_0x38489a,null));};exports[_0x8895('0x69')]=function(_0x325597,_0x4e6691,_0x3be1e4){return db[_0x8895('0x3e')][_0x8895('0x5a')]({'where':{'id':_0x325597[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x4e6691,null))[_0x8895('0x20')](function(_0xc7d38){if(_0xc7d38){return _0xc7d38[_0x8895('0x69')](_0x325597['query'][_0x8895('0x6a')]);}})[_0x8895('0x20')](respondWithStatusCode(_0x4e6691,null))['catch'](handleError(_0x4e6691,null));};exports['addAnswer']=function(_0x37276a,_0x4570d7,_0x1bbcd3){if(_0x37276a[_0x8895('0x63')]['id']){delete _0x37276a['body']['id'];}return db['OpenchannelAccount'][_0x8895('0x5a')]({'where':{'id':_0x37276a[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x4570d7,null))[_0x8895('0x20')](function(_0x3a7f0b){if(_0x3a7f0b){_0x37276a['body'][_0x8895('0x68')]=_0x3a7f0b['id'];return db[_0x8895('0x6b')]['create'](_0x37276a[_0x8895('0x63')]);}})[_0x8895('0x20')](respondWithResult(_0x4570d7,null))[_0x8895('0x2a')](handleError(_0x4570d7,null));};exports[_0x8895('0x6c')]=function(_0x1041ad,_0x21bb69,_0x5ceea5){var _0x3ec392={'raw':![],'where':{}};var _0x12147b={};var _0x5d4bea={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1041ad[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x21bb69,null))['then'](function(_0x16f5a7){if(_0x16f5a7){_0x12147b['model']=_['keys'](db['CannedAnswer'][_0x8895('0x3f')]);_0x12147b[_0x8895('0x42')]=_[_0x8895('0x57')](_0x1041ad[_0x8895('0x42')]);_0x12147b[_0x8895('0x4a')]=_['intersection'](_0x12147b[_0x8895('0x41')],_0x12147b[_0x8895('0x42')]);_0x3ec392[_0x8895('0x44')]=_['intersection'](_0x12147b['model'],qs['fields'](_0x1041ad[_0x8895('0x42')][_0x8895('0x43')]));_0x3ec392[_0x8895('0x44')]=_0x3ec392[_0x8895('0x44')][_0x8895('0x59')]?_0x3ec392[_0x8895('0x44')]:_0x12147b[_0x8895('0x41')];if(!_0x1041ad['query'][_0x8895('0x45')]('nolimit')){_0x3ec392[_0x8895('0x2f')]=qs['limit'](_0x1041ad[_0x8895('0x42')][_0x8895('0x2f')]);_0x3ec392[_0x8895('0x2d')]=qs[_0x8895('0x2d')](_0x1041ad[_0x8895('0x42')][_0x8895('0x2d')]);}_0x3ec392[_0x8895('0x47')]=qs['sort'](_0x1041ad[_0x8895('0x42')][_0x8895('0x48')]);_0x3ec392[_0x8895('0x49')]=qs[_0x8895('0x4a')](_[_0x8895('0x4b')](_0x1041ad['query'],_0x12147b[_0x8895('0x4a')]));_0x3ec392['where'][_0x8895('0x68')]=_0x16f5a7['id'];if(_0x1041ad[_0x8895('0x42')][_0x8895('0x4e')]){_0x3ec392[_0x8895('0x49')]=_[_0x8895('0x4c')](_0x3ec392[_0x8895('0x49')],{'$or':_[_0x8895('0x3d')](_0x3ec392[_0x8895('0x44')],function(_0x40a1a9){var _0x56d3b7={};_0x56d3b7[_0x40a1a9]={'$like':'%'+_0x1041ad[_0x8895('0x42')]['filter']+'%'};return _0x56d3b7;})});}_0x3ec392=_[_0x8895('0x4c')]({},_0x3ec392,_0x1041ad[_0x8895('0x4f')]);return db[_0x8895('0x6b')]['count']({'where':_0x3ec392[_0x8895('0x49')]})['then'](function(_0x620af9){_0x5d4bea[_0x8895('0x30')]=_0x620af9;if(_0x1041ad[_0x8895('0x42')][_0x8895('0x50')]){_0x3ec392['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8895('0x52')](_0x3ec392);})['then'](function(_0x57b4e7){_0x5d4bea[_0x8895('0x53')]=_0x57b4e7;return _0x5d4bea;});}})['then'](respondWithFilteredResult(_0x21bb69,_0x3ec392))[_0x8895('0x2a')](handleError(_0x21bb69,null));};exports[_0x8895('0x6d')]=function(_0xd1baf6,_0xcb467c,_0x457d37){return db[_0x8895('0x3e')][_0x8895('0x5a')]({'where':{'id':_0xd1baf6[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0xcb467c,null))['then'](function(_0x33deba){if(_0x33deba){return _0x33deba[_0x8895('0x6d')](_0xd1baf6[_0x8895('0x42')]['ids']);}})[_0x8895('0x20')](respondWithStatusCode(_0xcb467c,null))[_0x8895('0x2a')](handleError(_0xcb467c,null));};exports[_0x8895('0x6e')]=function(_0x4fbf8d,_0x3a0980,_0x25511e){var _0x19c744={'body':_0x4fbf8d[_0x8895('0x63')],'channel':_0x8895('0x6f')};var _0x134b9d=[];var _0xc0f27e=[];var _0x510d69={};var _0x448a6d=![];return db[_0x8895('0x70')][_0x8895('0x64')]()[_0x8895('0x20')](function(_0x7bc798){if(!_0x7bc798){throw new db[(_0x8895('0x71'))]['ValidationError'](_0x8895('0x72'));}_0x134b9d=_[_0x8895('0x73')](_['keys'](_0x7bc798),['createdAt',_0x8895('0x74')]);_0xc0f27e=_[_0x8895('0x73')](_['keys'](_0x7bc798),[_0x8895('0x75'),_0x8895('0x74'),_0x8895('0x76'),_0x8895('0x77')]);if(_0x4fbf8d[_0x8895('0x63')]['id']){delete _0x4fbf8d['body']['id'];}if(_[_0x8895('0x78')](_0x4fbf8d[_0x8895('0x63')][_0x8895('0x79')])){throw new db[(_0x8895('0x71'))][(_0x8895('0x7a'))](_0x8895('0x7b'));}if(_[_0x8895('0x78')](_0x4fbf8d[_0x8895('0x63')][_0x8895('0x63')])||_0x4fbf8d[_0x8895('0x63')][_0x8895('0x63')]===''){throw new db[(_0x8895('0x71'))]['ValidationError'](_0x8895('0x7c'));}if(_[_0x8895('0x78')](_0x4fbf8d[_0x8895('0x63')][_0x8895('0x7d')])){throw new db['Sequelize'][(_0x8895('0x7a'))](_0x8895('0x7e')+_0xc0f27e);}if(!_['includes'](_0xc0f27e,_0x4fbf8d['body'][_0x8895('0x7d')])){throw new db['Sequelize'][(_0x8895('0x7a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xc0f27e);}_0x510d69[_0x4fbf8d['body'][_0x8895('0x7d')]]=_0x4fbf8d['body'][_0x8895('0x79')];})['then'](function(){return db[_0x8895('0x3e')][_0x8895('0x5a')]({'where':{'id':_0x4fbf8d['params']['id']},'include':[{'model':db[_0x8895('0x7f')],'as':_0x8895('0x80'),'include':[{'model':db[_0x8895('0x70')],'as':'Contacts','where':_0x510d69,'limit':0x1,'order':[['updatedAt',_0x8895('0x81')]]}]},{'model':db[_0x8895('0x82')],'as':_0x8895('0x83')}]});})[_0x8895('0x20')](handleEntityNotFound(_0x3a0980,null))[_0x8895('0x20')](function(_0x252ef8){if(_0x252ef8&&_0x252ef8[_0x8895('0x80')]){_0x19c744[_0x8895('0x84')]=_0x252ef8;_0x19c744[_0x8895('0x85')]=_0x252ef8[_0x8895('0x83')];_0x19c744[_0x8895('0x86')]=_0x252ef8[_0x8895('0x80')];_0x19c744[_0x8895('0x85')]=_[_0x8895('0x87')](_0x19c744['applications'],[_0x8895('0x88')],[_0x8895('0x89')]);if(_0x19c744[_0x8895('0x84')][_0x8895('0x83')]){delete _0x19c744['account'][_0x8895('0x83')];}if(_0x19c744[_0x8895('0x84')][_0x8895('0x80')]&&_0x19c744[_0x8895('0x84')][_0x8895('0x80')][_0x8895('0x8a')][_0x8895('0x59')]){return _0x19c744[_0x8895('0x84')][_0x8895('0x80')][_0x8895('0x8a')][0x0];}var _0x87f440=_[_0x8895('0x19')](_0x4fbf8d[_0x8895('0x63')],{'firstName':_0x4fbf8d[_0x8895('0x63')][_0x8895('0x79')],'ListId':_0x252ef8[_0x8895('0x77')]});_0x87f440[_0x4fbf8d['body'][_0x8895('0x7d')]]=_0x4fbf8d['body'][_0x8895('0x79')];return db[_0x8895('0x70')][_0x8895('0x5b')](_0x87f440,{'fields':_0x134b9d,'raw':!![]});}})['then'](handleEntityNotFound(_0x3a0980,null))[_0x8895('0x20')](function(_0x2ddce6){_0x19c744['contact']=_0x2ddce6;if(_0x2ddce6){var _0x3dfcce={'ContactId':_0x2ddce6['id'],'OpenchannelAccountId':_0x4fbf8d['params']['id'],'from':(_0x2ddce6[_0x8895('0x8b')]||'')+'\x20'+(_0x2ddce6['lastName']||'')};var _0x5c564c={'OpenchannelAccountId':_0x4fbf8d[_0x8895('0x55')]['id'],'closed':![]};if(_0x4fbf8d[_0x8895('0x63')][_0x8895('0x8c')]){_0x5c564c[_0x8895('0x8c')]=_0x4fbf8d[_0x8895('0x63')]['threadId'];return db[_0x8895('0x8d')]['find']({'where':_0x5c564c})['then'](function(_0x1d2ac6){if(_0x1d2ac6){return[_0x1d2ac6,![]];}_0x3dfcce[_0x8895('0x8c')]=_0x4fbf8d['body'][_0x8895('0x8c')];_0x3dfcce[_0x8895('0x8e')]=_0x4fbf8d[_0x8895('0x63')]['externalUrl'];return db[_0x8895('0x8d')][_0x8895('0x5b')](_0x3dfcce)[_0x8895('0x20')](function(_0x54e1b5){return[_0x54e1b5,!![]];});});}else{_0x5c564c[_0x8895('0x8c')]=null;}_0x5c564c[_0x8895('0x8f')]=_0x2ddce6['id'];return db[_0x8895('0x8d')][_0x8895('0x5a')]({'where':_0x5c564c})[_0x8895('0x20')](function(_0x3f33d9){if(_0x3f33d9){return[_0x3f33d9,![]];}return db[_0x8895('0x8d')][_0x8895('0x5b')](_0x3dfcce)['then'](function(_0x5af679){return[_0x5af679,!![]];});});}})[_0x8895('0x90')](function(_0x5e6c9e,_0x28439c){if(_0x5e6c9e){_0x448a6d=_0x28439c;if(!_0x28439c){var _0x1cdc13={'from':(_0x19c744[_0x8895('0x91')][_0x8895('0x8b')]||'')+'\x20'+(_0x19c744[_0x8895('0x91')][_0x8895('0x92')]||'')};if(_0x4fbf8d[_0x8895('0x63')][_0x8895('0x8c')]&&_0x4fbf8d[_0x8895('0x63')][_0x8895('0x93')]&&_0x4fbf8d[_0x8895('0x63')][_0x8895('0x8c')]!=_0x4fbf8d['body'][_0x8895('0x93')]){_0x1cdc13[_0x8895('0x8c')]=_0x4fbf8d[_0x8895('0x63')][_0x8895('0x93')];}return _0x5e6c9e[_0x8895('0x62')](_0x1cdc13);}else{return _0x5e6c9e;}}})[_0x8895('0x20')](function(_0xfd6e97){_0x19c744[_0x8895('0x94')]=_0xfd6e97[_0x8895('0x36')]({'plain':!![]});_0x19c744[_0x8895('0x94')][_0x8895('0x95')]=_0x448a6d;if(_0x19c744[_0x8895('0x94')][_0x8895('0x95')]){if(_0x19c744[_0x8895('0x84')]['autoclose']){_0x19c744[_0x8895('0x85')]['push']({'id':0x0,'priority':_0x19c744['applications']['length']+0x1,'app':_0x8895('0x96'),'appdata':_0x8895('0x97'),'interval':_0x8895('0x98')});}}return db['OpenchannelMessage'][_0x8895('0x5b')]({'body':_0x4fbf8d[_0x8895('0x63')][_0x8895('0x63')],'OpenchannelAccountId':_0x4fbf8d['params']['id'],'OpenchannelInteractionId':_0xfd6e97['id'],'direction':'in','ContactId':_0x19c744[_0x8895('0x91')]['id'],'AttachmentId':_0x4fbf8d[_0x8895('0x63')][_0x8895('0x99')]});})['then'](function(_0x7759e){_0x19c744[_0x8895('0x28')]=_0x7759e;if(!_0x19c744[_0x8895('0x94')][_0x8895('0x9a')])return;return db[_0x8895('0x9b')][_0x8895('0x5a')]({'attributes':['id','name'],'where':{'id':_0x19c744[_0x8895('0x94')][_0x8895('0x9a')]}});})['then'](function(_0x196097){if(_0x196097){_0x19c744[_0x8895('0x85')][_0x8895('0x9c')]({'id':0x0,'priority':0x0,'app':_0x8895('0x9d'),'appdata':_0x196097[_0x8895('0x3b')]+','+(_0x19c744[_0x8895('0x84')][_0x8895('0x9e')]||0xa),'interval':_0x8895('0x98')});}if(!_0x19c744[_0x8895('0x94')][_0x8895('0x9f')])return;return db[_0x8895('0xa0')]['find']({'attributes':['id','name'],'where':{'id':_0x19c744[_0x8895('0x94')][_0x8895('0x9f')]}});})[_0x8895('0x20')](function(_0x1ebfa7){if(_0x1ebfa7){_0x19c744[_0x8895('0x85')][_0x8895('0x9c')]({'id':0x0,'priority':0x1,'app':_0x8895('0xa1'),'appdata':_0x1ebfa7['name']+','+(_0x19c744['account'][_0x8895('0xa2')]||0x12c),'interval':_0x8895('0x98')});}return respondWithRpcPromise(_0x8895('0xa3'),_0x8895('0xa4'),_0x19c744);})[_0x8895('0x20')](function(_0x3b465c){respondWithRpcPromise(_0x8895('0xa5'),_0x8895('0xa5'),{'event':_0x8895('0x6e'),'message':_0x3b465c},client9002);return _0x3b465c;})[_0x8895('0x20')](respondWithResult(_0x3a0980,null))['catch'](handleError(_0x3a0980,null));};exports[_0x8895('0xa6')]=function(_0x5033d6,_0x1caccd){var _0x2b2f05=_0x5033d6[_0x8895('0x55')]['id'];var _0x5e109c=_0x5033d6['body'];var _0x567bc0=0xc8;var _0x22c9f0=null;return db['sequelize'][_0x8895('0xa7')]({'isolationLevel':db[_0x8895('0xa8')][_0x8895('0xa9')]['ISOLATION_LEVELS'][_0x8895('0xaa')]},function(_0x3a348d){return db['OpenchannelAccount'][_0x8895('0xab')]({'where':{'id':_0x2b2f05},'transaction':_0x3a348d})['then'](function(_0x9ce4f5){if(_0x9ce4f5){return db[_0x8895('0x82')][_0x8895('0x35')]({'where':{'OpenchannelAccountId':_0x2b2f05},'transaction':_0x3a348d})[_0x8895('0x20')](function(){var _0x1d5fd7=_['map'](_0x5e109c,function(_0x50eea8){_0x50eea8[_0x8895('0x68')]=_0x2b2f05;return _0x50eea8;});return db[_0x8895('0x82')][_0x8895('0xac')](_0x1d5fd7,{'transaction':_0x3a348d});});}else{_0x567bc0=0x194;_0x22c9f0=[];}});})[_0x8895('0x20')](function(){if(_0x567bc0!==0x194){return db[_0x8895('0x82')][_0x8895('0xad')]({'where':{'OpenchannelAccountId':_0x2b2f05},'order':'priority'})['then'](function(_0x98a63d){_0x22c9f0=_0x98a63d;});}})[_0x8895('0x2a')](function(_0x460e9c){_0x567bc0=0x1f4;logger[_0x8895('0x27')](_0x460e9c[_0x8895('0x3a')]);if(_0x460e9c['name']){delete _0x460e9c['name'];}_0x22c9f0=_0x460e9c;})[_0x8895('0xae')](function(){if(_0x22c9f0===null){_0x1caccd['sendStatus'](_0x567bc0);}else{if(_0x567bc0===0x1f4){_0x1caccd['status'](_0x567bc0)[_0x8895('0xaf')](_0x22c9f0);}else{_0x1caccd[_0x8895('0x2b')](_0x567bc0)['json'](_0x22c9f0);}}});};exports[_0x8895('0xb0')]=function(_0x5f0b5f,_0x29cb64,_0x242a19){var _0x206b43={};var _0x21ea2b={};var _0x920c03;var _0x285e72;return db['OpenchannelAccount'][_0x8895('0xab')]({'where':{'id':_0x5f0b5f[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x29cb64,null))[_0x8895('0x20')](function(_0x117f54){if(_0x117f54){_0x920c03=_0x117f54;_0x21ea2b[_0x8895('0x41')]=_['keys'](db[_0x8895('0x82')][_0x8895('0x3f')]);_0x21ea2b[_0x8895('0x42')]=_[_0x8895('0x57')](_0x5f0b5f[_0x8895('0x42')]);_0x21ea2b['filters']=_['intersection'](_0x21ea2b['model'],_0x21ea2b[_0x8895('0x42')]);_0x206b43[_0x8895('0x44')]=_[_0x8895('0x58')](_0x21ea2b['model'],qs['fields'](_0x5f0b5f[_0x8895('0x42')][_0x8895('0x43')]));_0x206b43[_0x8895('0x44')]=_0x206b43[_0x8895('0x44')][_0x8895('0x59')]?_0x206b43[_0x8895('0x44')]:_0x21ea2b['model'];_0x206b43['order']=qs[_0x8895('0x48')](_0x5f0b5f[_0x8895('0x42')]['sort']);_0x206b43[_0x8895('0x49')]=qs['filters'](_['pick'](_0x5f0b5f[_0x8895('0x42')],_0x21ea2b[_0x8895('0x4a')]));if(_0x5f0b5f[_0x8895('0x42')]['filter']){_0x206b43[_0x8895('0x49')]=_['merge'](_0x206b43[_0x8895('0x49')],{'$or':_[_0x8895('0x3d')](_0x206b43['attributes'],function(_0x154e1f){var _0x5e4b18={};_0x5e4b18[_0x154e1f]={'$like':'%'+_0x5f0b5f[_0x8895('0x42')][_0x8895('0x4e')]+'%'};return _0x5e4b18;})});}_0x206b43=_[_0x8895('0x4c')]({},_0x206b43,_0x5f0b5f[_0x8895('0x4f')]);return _0x920c03['getApplications'](_0x206b43);}})[_0x8895('0x20')](function(_0x4bf06a){if(_0x4bf06a){_0x285e72=_0x4bf06a[_0x8895('0x59')];if(!_0x5f0b5f[_0x8895('0x42')][_0x8895('0x45')](_0x8895('0x46'))){_0x206b43[_0x8895('0x2f')]=qs[_0x8895('0x2f')](_0x5f0b5f[_0x8895('0x42')][_0x8895('0x2f')]);_0x206b43[_0x8895('0x2d')]=qs[_0x8895('0x2d')](_0x5f0b5f[_0x8895('0x42')]['offset']);}return _0x920c03[_0x8895('0xb0')](_0x206b43);}})[_0x8895('0x20')](function(_0x292f40){if(_0x292f40){return _0x292f40?{'count':_0x285e72,'rows':_0x292f40}:null;}})['then'](respondWithResult(_0x29cb64,null))[_0x8895('0x2a')](handleError(_0x29cb64,null));};exports[_0x8895('0xb1')]=function(_0x4b2fff,_0x40b064,_0x2f6ff3){var _0x129d12={'raw':![],'where':{}};var _0x1e5393={};var _0x408753={'count':0x0,'rows':[]};return db[_0x8895('0x3e')][_0x8895('0xab')]({'where':{'id':_0x4b2fff[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x40b064,null))['then'](function(_0x5a319d){if(_0x5a319d){_0x1e5393[_0x8895('0x41')]=_['keys'](db[_0x8895('0x8d')][_0x8895('0x3f')]);_0x1e5393[_0x8895('0x42')]=_['keys'](_0x4b2fff[_0x8895('0x42')]);_0x1e5393['filters']=_[_0x8895('0x58')](_0x1e5393[_0x8895('0x41')],_0x1e5393['query']);_0x129d12[_0x8895('0x44')]=_[_0x8895('0x58')](_0x1e5393[_0x8895('0x41')],qs[_0x8895('0x43')](_0x4b2fff[_0x8895('0x42')]['fields']));_0x129d12[_0x8895('0x44')]=_0x129d12[_0x8895('0x44')]['length']?_0x129d12['attributes']:_0x1e5393[_0x8895('0x41')];if(!_0x4b2fff['query'][_0x8895('0x45')](_0x8895('0x46'))){_0x129d12[_0x8895('0x2f')]=qs[_0x8895('0x2f')](_0x4b2fff[_0x8895('0x42')][_0x8895('0x2f')]);_0x129d12['offset']=qs[_0x8895('0x2d')](_0x4b2fff[_0x8895('0x42')][_0x8895('0x2d')]);}_0x129d12[_0x8895('0x47')]=qs[_0x8895('0x48')](_0x4b2fff[_0x8895('0x42')][_0x8895('0x48')]);_0x129d12['where']=qs['filters'](_[_0x8895('0x4b')](_0x4b2fff[_0x8895('0x42')],_0x1e5393[_0x8895('0x4a')]));_0x129d12[_0x8895('0x49')]['OpenchannelAccountId']=_0x5a319d['id'];if(_0x4b2fff['query'][_0x8895('0x4e')]){_0x129d12[_0x8895('0x49')]=_[_0x8895('0x4c')](_0x129d12[_0x8895('0x49')],{'$or':_[_0x8895('0x3d')](_0x129d12[_0x8895('0x44')],function(_0x572123){var _0x4c4148={};_0x4c4148[_0x572123]={'$like':'%'+_0x4b2fff[_0x8895('0x42')][_0x8895('0x4e')]+'%'};return _0x4c4148;})});}_0x129d12=_[_0x8895('0x4c')]({},_0x129d12,_0x4b2fff[_0x8895('0x4f')]);return db[_0x8895('0x8d')][_0x8895('0x30')]({'where':_0x129d12[_0x8895('0x49')]})[_0x8895('0x20')](function(_0x18a523){_0x408753['count']=_0x18a523;if(_0x4b2fff[_0x8895('0x42')][_0x8895('0x50')]){_0x129d12['include']=[{'model':db[_0x8895('0x70')],'as':_0x8895('0xb2'),'required':![]},{'model':db[_0x8895('0x9b')],'as':_0x8895('0xb3'),'attributes':[_0x8895('0x3b'),_0x8895('0xb4'),_0x8895('0xb5')],'required':![]},{'model':db[_0x8895('0xb6')],'as':'Tags','attributes':['id','name',_0x8895('0xb7')],'where':_0x4b2fff[_0x8895('0x42')][_0x8895('0xb8')]?{'id':_0x4b2fff[_0x8895('0x42')][_0x8895('0xb8')]}:undefined,'required':_0x4b2fff[_0x8895('0x42')]['tag']?!![]:![]}];}return db[_0x8895('0x8d')][_0x8895('0x52')](_0x129d12);})[_0x8895('0x20')](function(_0x596ce0){_0x408753[_0x8895('0x53')]=_0x596ce0;return _0x408753;});}})[_0x8895('0x20')](respondWithFilteredResult(_0x40b064,_0x129d12))[_0x8895('0x2a')](handleError(_0x40b064,null));};exports['addAgents']=function(_0x1a62b4,_0x5b0883,_0xe23f8d){return db[_0x8895('0x3e')][_0x8895('0x5a')]({'where':{'id':_0x1a62b4[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x5b0883,null))['then'](function(_0x53dde1){if(_0x53dde1){return _0x53dde1[_0x8895('0xb9')](_0x1a62b4['body'][_0x8895('0x6a')],_[_0x8895('0xba')](_0x1a62b4[_0x8895('0x63')],[_0x8895('0x6a'),'id'])||{})[_0x8895('0x90')](function(_0x948475){for(var _0xcade2f=0x0;_0xcade2f<_0x1a62b4[_0x8895('0x63')]['ids'][_0x8895('0x59')];_0xcade2f+=0x1){socket[_0x8895('0xbb')](_0x8895('0xbc'),{'UserId':Number(_0x1a62b4['body'][_0x8895('0x6a')][_0xcade2f]),'OpenchannelAccountId':Number(_0x1a62b4['params']['id'])});}return _0x948475;});}})[_0x8895('0x20')](respondWithResult(_0x5b0883,null))[_0x8895('0x2a')](handleError(_0x5b0883,null));};exports[_0x8895('0xbd')]=function(_0x2546e6,_0x1040d8,_0xf3b11f){return db['OpenchannelAccount'][_0x8895('0x5a')]({'where':{'id':_0x2546e6[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x1040d8,null))['then'](function(_0x268d3c){if(_0x268d3c){return _0x268d3c['removeAgents'](_0x2546e6[_0x8895('0x42')][_0x8895('0x6a')])[_0x8895('0x20')](function(){if(_[_0x8895('0xbe')](_0x2546e6[_0x8895('0x42')][_0x8895('0x6a')])){for(var _0x804b80=0x0;_0x804b80<_0x2546e6[_0x8895('0x42')][_0x8895('0x6a')][_0x8895('0x59')];_0x804b80+=0x1){socket[_0x8895('0xbb')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2546e6['query'][_0x8895('0x6a')][_0x804b80]),'OpenchannelAccountId':Number(_0x2546e6[_0x8895('0x55')]['id'])});}}else{socket[_0x8895('0xbb')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2546e6[_0x8895('0x42')][_0x8895('0x6a')]),'OpenchannelAccountId':Number(_0x2546e6['params']['id'])});}});}})[_0x8895('0x20')](respondWithStatusCode(_0x1040d8,null))['catch'](handleError(_0x1040d8,null));};exports[_0x8895('0xbf')]=function(_0x2c6191,_0x401a0d,_0x32d290){var _0x46c02f={};var _0xbe4f09={};var _0x4d2496;var _0x97978b;return db[_0x8895('0x3e')][_0x8895('0xab')]({'where':{'id':_0x2c6191[_0x8895('0x55')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x401a0d,null))[_0x8895('0x20')](function(_0x2dea9c){if(_0x2dea9c){_0x4d2496=_0x2dea9c;_0xbe4f09[_0x8895('0x41')]=_['keys'](db[_0x8895('0x9b')][_0x8895('0x3f')]);_0xbe4f09[_0x8895('0x42')]=_[_0x8895('0x57')](_0x2c6191[_0x8895('0x42')]);_0xbe4f09[_0x8895('0x4a')]=_['intersection'](_0xbe4f09['model'],_0xbe4f09[_0x8895('0x42')]);_0x46c02f[_0x8895('0x44')]=_[_0x8895('0x58')](_0xbe4f09[_0x8895('0x41')],qs[_0x8895('0x43')](_0x2c6191[_0x8895('0x42')][_0x8895('0x43')]));_0x46c02f['attributes']=_0x46c02f['attributes'][_0x8895('0x59')]?_0x46c02f['attributes']:_0xbe4f09[_0x8895('0x41')];_0x46c02f[_0x8895('0x47')]=qs[_0x8895('0x48')](_0x2c6191[_0x8895('0x42')]['sort']);_0x46c02f[_0x8895('0x49')]=qs[_0x8895('0x4a')](_[_0x8895('0x4b')](_0x2c6191[_0x8895('0x42')],_0xbe4f09['filters']));if(_0x2c6191[_0x8895('0x42')][_0x8895('0x4e')]){_0x46c02f['where']=_[_0x8895('0x4c')](_0x46c02f[_0x8895('0x49')],{'$or':_[_0x8895('0x3d')](_0x46c02f[_0x8895('0x44')],function(_0x3564d8){var _0x45724e={};_0x45724e[_0x3564d8]={'$like':'%'+_0x2c6191[_0x8895('0x42')]['filter']+'%'};return _0x45724e;})});}_0x46c02f=_[_0x8895('0x4c')]({},_0x46c02f,_0x2c6191[_0x8895('0x4f')]);return _0x4d2496['getAgents'](_0x46c02f);}})[_0x8895('0x20')](function(_0x23d9a3){if(_0x23d9a3){_0x97978b=_0x23d9a3['length'];if(!_0x2c6191['query'][_0x8895('0x45')](_0x8895('0x46'))){_0x46c02f[_0x8895('0x2f')]=qs[_0x8895('0x2f')](_0x2c6191[_0x8895('0x42')][_0x8895('0x2f')]);_0x46c02f[_0x8895('0x2d')]=qs[_0x8895('0x2d')](_0x2c6191['query'][_0x8895('0x2d')]);}return _0x4d2496['getAgents'](_0x46c02f);}})[_0x8895('0x20')](function(_0x38e225){if(_0x38e225){return _0x38e225?{'count':_0x97978b,'rows':_0x38e225}:null;}})[_0x8895('0x20')](respondWithResult(_0x401a0d,null))[_0x8895('0x2a')](handleError(_0x401a0d,null));};exports[_0x8895('0xaf')]=function(_0x491655,_0x3e9448,_0x201526){var _0x2df8ce,_0x25f40f,_0x2f46aa;if(_['isNil'](_0x491655[_0x8895('0x63')][_0x8895('0x63')])||_0x491655['body']['body']===''){throw new db[(_0x8895('0x71'))][(_0x8895('0x7a'))](_0x8895('0x7c'));}if(_[_0x8895('0x78')](_0x491655[_0x8895('0x63')]['to'])){}_0x2df8ce=_0x491655[_0x8895('0x63')]['to'];return db[_0x8895('0x3e')]['findOne']({'where':{'id':_0x491655[_0x8895('0x55')]['id']}})['then'](handleEntityNotFound(_0x3e9448,null))[_0x8895('0x20')](function(_0x382416){if(_0x382416){return db['OpenchannelAccount']['find']({'where':{'id':_0x382416['id']},'include':[{'model':db[_0x8895('0x7f')],'as':_0x8895('0x80'),'include':[{'model':db[_0x8895('0x70')],'as':'Contacts','where':{[_0x382416[_0x8895('0x7d')]]:_0x2df8ce},'limit':0x1,'order':[[_0x8895('0x74'),'DESC']]}]}]})[_0x8895('0x20')](handleEntityNotFound(_0x3e9448,null))[_0x8895('0x20')](function(_0x27d9f5){if(_0x27d9f5&&_0x27d9f5[_0x8895('0x80')]){_0x25f40f=_0x27d9f5['get']({'plain':!![]});if(_0x25f40f[_0x8895('0x80')]&&_0x25f40f['List'][_0x8895('0x8a')]['length']){return _0x25f40f[_0x8895('0x80')]['Contacts'][0x0];}return db['CmContact'][_0x8895('0x5b')](_[_0x8895('0x19')](_0x491655[_0x8895('0x63')],{'firstName':_0x2df8ce,[_0x27d9f5[_0x8895('0x7d')]]:_0x2df8ce,'phone':_0x2df8ce,'ListId':_0x25f40f[_0x8895('0x77')]}));}})[_0x8895('0x20')](handleEntityNotFound(_0x3e9448,null))[_0x8895('0x20')](function(_0x4d245f){if(_0x4d245f){_0x2f46aa=_0x4d245f;return db['OpenchannelInteraction'][_0x8895('0x5a')]({'where':{'ContactId':_0x2f46aa['id'],'closed':![],'OpenchannelAccountId':_0x25f40f['id']}})[_0x8895('0x20')](function(_0x2ac919){if(_0x2ac919){return[_0x2ac919,![]];}return db[_0x8895('0x8d')][_0x8895('0x5b')]({'UserId':_0x491655[_0x8895('0x5c')]['id'],'ContactId':_0x2f46aa['id'],'OpenchannelAccountId':_0x25f40f['id'],'lastMsgDirection':'out','firstMsgDirection':_0x8895('0xc0'),'Messages':[_[_0x8895('0x4c')](_0x491655[_0x8895('0x63')],{'read':![],'body':_0x491655[_0x8895('0x63')][_0x8895('0x63')],'OpenchannelAccountId':_0x25f40f['id'],'UserId':_0x491655[_0x8895('0x5c')]['id'],'ContactId':_0x2f46aa['id']})]},{'include':[{'model':db[_0x8895('0xc1')],'as':'Messages'}]})[_0x8895('0x20')](function(_0x185120){return[_0x185120,!![]];});});}})[_0x8895('0x90')](function(_0x804205,_0x3b430c){if(_0x3b430c){return _0x804205;}return db[_0x8895('0xc1')][_0x8895('0x5b')](_[_0x8895('0x4c')](_0x491655[_0x8895('0x63')],{'read':![],'body':_0x491655['body'][_0x8895('0x63')],'OpenchannelAccountId':_0x25f40f['id'],'OpenchannelInteractionId':_0x804205['id'],'UserId':_0x491655[_0x8895('0x5c')]['id'],'ContactId':_0x2f46aa['id']}))[_0x8895('0x20')](function(_0x5d4405){_0x804205[_0x8895('0xc2')][_0x8895('0xc3')]=[];_0x804205[_0x8895('0xc2')][_0x8895('0xc3')][_0x8895('0xc4')](_0x5d4405['dataValues']);return _0x804205;});});}})[_0x8895('0x20')](respondWithResult(_0x3e9448,null))[_0x8895('0x2a')](handleError(_0x3e9448,null));}; \ No newline at end of file +var _0x3981=['type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','body','OpenchannelAccountId','findOne','Disposition','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','queueId','OpenchannelQueue','queue','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','bulkCreate','findAndCountAll','finally','getApplications','Contact','Owner','internal','Tag','Tags','tag','addAgents','omit','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','http','request','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','reject','update','then','destroy','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName'];(function(_0x3757c8,_0x4ebaa2){var _0x250a9b=function(_0x513b9b){while(--_0x513b9b){_0x3757c8['push'](_0x3757c8['shift']());}};_0x250a9b(++_0x4ebaa2);}(_0x3981,0x144));var _0x1398=function(_0x3adf97,_0x1aa51d){_0x3adf97=_0x3adf97-0x0;var _0x5c51ea=_0x3981[_0x3adf97];return _0x5c51ea;};'use strict';var emlformat=require(_0x1398('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1398('0x1'));var jsonpatch=require(_0x1398('0x2'));var rp=require(_0x1398('0x3'));var moment=require(_0x1398('0x4'));var BPromise=require(_0x1398('0x5'));var Mustache=require(_0x1398('0x6'));var util=require(_0x1398('0x7'));var path=require(_0x1398('0x8'));var sox=require(_0x1398('0x9'));var csv=require(_0x1398('0xa'));var ejs=require(_0x1398('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1398('0xc'));var squel=require(_0x1398('0xd'));var crypto=require(_0x1398('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1398('0xf'));var toCsv=require(_0x1398('0xa'));var querystring=require(_0x1398('0x10'));var Papa=require(_0x1398('0x11'));var Redis=require(_0x1398('0x12'));var authService=require(_0x1398('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1398('0x14'));var hardwareService=require(_0x1398('0x15'));var logger=require(_0x1398('0x16'))(_0x1398('0x17'));var utils=require(_0x1398('0x18'));var config=require(_0x1398('0x19'));var licenseUtil=require(_0x1398('0x1a'));var db=require(_0x1398('0x1b'))['db'];config[_0x1398('0x1c')]=_[_0x1398('0x1d')](config['redis'],{'host':_0x1398('0x1e'),'port':0x18eb});var socket=require(_0x1398('0x1f'))(new Redis(config[_0x1398('0x1c')]));require(_0x1398('0x20'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1398('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x514216,_0x2afbd6,_0x4abc92,_0x289bd3){return new BPromise(function(_0x255a40,_0x24252f){var _0x382319=_0x289bd3||client;return _0x382319[_0x1398('0x22')](_0x514216,_0x4abc92)['then'](function(_0x33e24a){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2afbd6,_0x1398('0x23'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2afbd6,_0x1398('0x23'),JSON[_0x1398('0x24')](_0x33e24a));if(_0x33e24a['error']){if(_0x33e24a[_0x1398('0x25')][_0x1398('0x26')]===0x1f4){logger[_0x1398('0x25')](_0x1398('0x27'),_0x2afbd6,_0x33e24a[_0x1398('0x25')][_0x1398('0x28')]);return _0x24252f(_0x33e24a['error']['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2afbd6,_0x33e24a[_0x1398('0x25')][_0x1398('0x28')]);return _0x255a40(_0x33e24a[_0x1398('0x25')][_0x1398('0x28')]);}else{logger[_0x1398('0x29')](_0x1398('0x27'),_0x2afbd6,'request\x20sent');_0x255a40(_0x33e24a[_0x1398('0x2a')][_0x1398('0x28')]);}})['catch'](function(_0xb54964){logger[_0x1398('0x25')](_0x1398('0x27'),_0x2afbd6,_0xb54964);_0x24252f(_0xb54964);});});}function respondWithStatusCode(_0x2fe3c9,_0x50d3cf){_0x50d3cf=_0x50d3cf||0xcc;return function(_0x5edfdd){if(_0x5edfdd){return _0x2fe3c9[_0x1398('0x2b')](_0x50d3cf);}return _0x2fe3c9['status'](_0x50d3cf)[_0x1398('0x2c')]();};}function respondWithResult(_0x5144d3,_0x4f23d9){_0x4f23d9=_0x4f23d9||0xc8;return function(_0x543cd9){if(_0x543cd9){return _0x5144d3[_0x1398('0x2d')](_0x4f23d9)[_0x1398('0x2e')](_0x543cd9);}};}function respondWithFilteredResult(_0x76bd5,_0x2c8d2b){return function(_0x24965c){if(_0x24965c){var _0x2fd175=typeof _0x2c8d2b['offset']==='undefined'&&typeof _0x2c8d2b['limit']===_0x1398('0x2f');var _0x14cd86=_0x24965c[_0x1398('0x30')];var _0x585ebb=_0x2fd175?0x0:_0x2c8d2b[_0x1398('0x31')];var _0x983481=_0x2fd175?_0x24965c['count']:_0x2c8d2b['offset']+_0x2c8d2b['limit'];var _0x3e3f23;if(_0x983481>=_0x14cd86){_0x983481=_0x14cd86;_0x3e3f23=0xc8;}else{_0x3e3f23=0xce;}_0x76bd5['status'](_0x3e3f23);return _0x76bd5[_0x1398('0x32')](_0x1398('0x33'),_0x585ebb+'-'+_0x983481+'/'+_0x14cd86)[_0x1398('0x2e')](_0x24965c);}return null;};}function patchUpdates(_0x264b6a){return function(_0x169b12){try{jsonpatch['apply'](_0x169b12,_0x264b6a,!![]);}catch(_0xe5706e){return BPromise[_0x1398('0x34')](_0xe5706e);}return _0x169b12['save']();};}function saveUpdates(_0xe7ade4,_0x4be451){return function(_0x14f19d){if(_0x14f19d){return _0x14f19d[_0x1398('0x35')](_0xe7ade4)[_0x1398('0x36')](function(_0x461e40){return _0x461e40;});}return null;};}function removeEntity(_0xc954e8,_0x4ae9ae){return function(_0x5155e7){if(_0x5155e7){return _0x5155e7[_0x1398('0x37')]()[_0x1398('0x36')](function(){var _0x511276=_0x5155e7['get']({'plain':!![]});var _0x515472=_0x1398('0x38');return db['UserProfileResource'][_0x1398('0x37')]({'where':{'type':_0x515472,'resourceId':_0x511276['id']}})['then'](function(){return _0x5155e7;});})[_0x1398('0x36')](function(){_0xc954e8['status'](0xcc)[_0x1398('0x2c')]();});}};}function handleEntityNotFound(_0xe1fd72,_0x241bf0){return function(_0x3c5e5b){if(!_0x3c5e5b){_0xe1fd72[_0x1398('0x2b')](0x194);}return _0x3c5e5b;};}function handleError(_0x37d61e,_0x2f86cc){_0x2f86cc=_0x2f86cc||0x1f4;return function(_0x13c86d){logger[_0x1398('0x25')](_0x13c86d[_0x1398('0x39')]);if(_0x13c86d[_0x1398('0x3a')]){delete _0x13c86d[_0x1398('0x3a')];}_0x37d61e['status'](_0x2f86cc)[_0x1398('0x3b')](_0x13c86d);};}exports[_0x1398('0x3c')]=function(_0x43723a,_0x4eb937){var _0x2409c6={'include':[{'model':db[_0x1398('0x3d')],'as':_0x1398('0x3e')}]},_0x5a8a27={},_0x1267df={'count':0x0,'rows':[]};var _0x42459f=_['map'](db[_0x1398('0x3f')][_0x1398('0x40')],function(_0x36262f){return{'name':_0x36262f[_0x1398('0x41')],'type':_0x36262f[_0x1398('0x42')][_0x1398('0x43')]};});_0x5a8a27[_0x1398('0x44')]=_[_0x1398('0x45')](_0x42459f,'name');_0x5a8a27[_0x1398('0x46')]=_['keys'](_0x43723a[_0x1398('0x46')]);_0x5a8a27[_0x1398('0x47')]=_[_0x1398('0x48')](_0x5a8a27[_0x1398('0x44')],_0x5a8a27[_0x1398('0x46')]);_0x2409c6[_0x1398('0x49')]=_[_0x1398('0x48')](_0x5a8a27[_0x1398('0x44')],qs['fields'](_0x43723a[_0x1398('0x46')][_0x1398('0x4a')]));_0x2409c6['attributes']=_0x2409c6[_0x1398('0x49')][_0x1398('0x4b')]?_0x2409c6[_0x1398('0x49')]:_0x5a8a27[_0x1398('0x44')];if(!_0x43723a['query']['hasOwnProperty'](_0x1398('0x4c'))){_0x2409c6[_0x1398('0x4d')]=qs['limit'](_0x43723a[_0x1398('0x46')]['limit']);_0x2409c6['offset']=qs[_0x1398('0x31')](_0x43723a[_0x1398('0x46')][_0x1398('0x31')]);}_0x2409c6[_0x1398('0x4e')]=qs[_0x1398('0x4f')](_0x43723a[_0x1398('0x46')]['sort']);_0x2409c6[_0x1398('0x50')]=qs[_0x1398('0x47')](_[_0x1398('0x51')](_0x43723a[_0x1398('0x46')],_0x5a8a27['filters']),_0x42459f);if(_0x43723a[_0x1398('0x46')]['filter']){_0x2409c6[_0x1398('0x50')]=_[_0x1398('0x52')](_0x2409c6[_0x1398('0x50')],{'$or':_[_0x1398('0x45')](_0x42459f,function(_0x5adfe4){if(_0x5adfe4[_0x1398('0x42')]!==_0x1398('0x53')){var _0x41ad73={};_0x41ad73[_0x5adfe4['name']]={'$like':'%'+_0x43723a[_0x1398('0x46')][_0x1398('0x54')]+'%'};return _0x41ad73;}})});}_0x2409c6=_['merge']({},_0x2409c6,_0x43723a[_0x1398('0x55')]);var _0x22b57c={'where':_0x2409c6[_0x1398('0x50')]};return db[_0x1398('0x3f')][_0x1398('0x30')](_0x22b57c)['then'](function(_0x71de69){_0x1267df['count']=_0x71de69;if(_0x43723a[_0x1398('0x46')][_0x1398('0x56')]){_0x2409c6[_0x1398('0x57')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x2409c6);})['then'](function(_0x553ecc){_0x1267df[_0x1398('0x58')]=_0x553ecc;return _0x1267df;})['then'](respondWithFilteredResult(_0x4eb937,_0x2409c6))[_0x1398('0x59')](handleError(_0x4eb937,null));};exports[_0x1398('0x5a')]=function(_0x12b13d,_0xfac679){var _0x1c43db={'raw':![],'where':{'id':_0x12b13d[_0x1398('0x5b')]['id']},'include':[{'model':db[_0x1398('0x3d')],'as':_0x1398('0x3e')}]},_0x44f91f={};_0x44f91f['model']=_[_0x1398('0x5c')](db[_0x1398('0x3f')]['rawAttributes']);_0x44f91f[_0x1398('0x46')]=_['keys'](_0x12b13d[_0x1398('0x46')]);_0x44f91f[_0x1398('0x47')]=_['intersection'](_0x44f91f[_0x1398('0x44')],_0x44f91f[_0x1398('0x46')]);_0x1c43db['attributes']=_[_0x1398('0x48')](_0x44f91f[_0x1398('0x44')],qs[_0x1398('0x4a')](_0x12b13d[_0x1398('0x46')]['fields']));_0x1c43db[_0x1398('0x49')]=_0x1c43db[_0x1398('0x49')]['length']?_0x1c43db['attributes']:_0x44f91f[_0x1398('0x44')];if(_0x12b13d[_0x1398('0x46')][_0x1398('0x56')]){_0x1c43db[_0x1398('0x57')]=[{'all':!![]}];}_0x1c43db=_[_0x1398('0x52')]({},_0x1c43db,_0x12b13d[_0x1398('0x55')]);return db[_0x1398('0x3f')][_0x1398('0x5d')](_0x1c43db)[_0x1398('0x36')](handleEntityNotFound(_0xfac679,null))[_0x1398('0x36')](respondWithResult(_0xfac679,null))[_0x1398('0x59')](handleError(_0xfac679,null));};exports['create']=function(_0x162737,_0x45d7ac){return db[_0x1398('0x3f')][_0x1398('0x5e')](_0x162737['body'],{})['then'](function(_0x2497e4){var _0x505bd6=_0x162737[_0x1398('0x5f')][_0x1398('0x60')]({'plain':!![]});if(!_0x505bd6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x505bd6[_0x1398('0x61')]==='user'){var _0x115fdb=_0x2497e4[_0x1398('0x60')]({'plain':!![]});var _0x34f39e='OpenchannelAccounts';return db[_0x1398('0x62')][_0x1398('0x5d')]({'where':{'name':_0x34f39e,'userProfileId':_0x505bd6[_0x1398('0x63')]},'raw':!![]})[_0x1398('0x36')](function(_0x3e9488){if(_0x3e9488&&_0x3e9488[_0x1398('0x64')]===0x0){return db[_0x1398('0x65')][_0x1398('0x5e')]({'name':_0x115fdb['name'],'resourceId':_0x115fdb['id'],'type':_0x3e9488[_0x1398('0x3a')],'sectionId':_0x3e9488['id']},{})[_0x1398('0x36')](function(){return _0x2497e4;});}else{return _0x2497e4;}})['catch'](function(_0xe813dd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe813dd);throw _0xe813dd;});}return _0x2497e4;})['then'](respondWithResult(_0x45d7ac,0xc9))[_0x1398('0x59')](handleError(_0x45d7ac,null));};exports['update']=function(_0x22b3d4,_0x35aea5){if(_0x22b3d4['body']['id']){delete _0x22b3d4['body']['id'];}return db['OpenchannelAccount'][_0x1398('0x5d')]({'where':{'id':_0x22b3d4[_0x1398('0x5b')]['id']},'include':[{'model':db[_0x1398('0x3d')],'as':_0x1398('0x3e')}]})[_0x1398('0x36')](handleEntityNotFound(_0x35aea5,null))['then'](saveUpdates(_0x22b3d4['body'],null))[_0x1398('0x36')](respondWithResult(_0x35aea5,null))[_0x1398('0x59')](handleError(_0x35aea5,null));};exports[_0x1398('0x37')]=function(_0x1f441f,_0x2ac250){return db['OpenchannelAccount']['find']({'where':{'id':_0x1f441f[_0x1398('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2ac250,null))[_0x1398('0x36')](removeEntity(_0x2ac250,null))['catch'](handleError(_0x2ac250,null));};exports[_0x1398('0x66')]=function(_0x2f4df5,_0x27ab0a){return db['OpenchannelAccount']['describe']()[_0x1398('0x36')](respondWithResult(_0x27ab0a,null))[_0x1398('0x59')](handleError(_0x27ab0a,null));};exports[_0x1398('0x67')]=function(_0x5d3417,_0x26ef3f,_0x4b91e1){if(_0x5d3417[_0x1398('0x68')]['id']){delete _0x5d3417['body']['id'];}return db[_0x1398('0x3f')]['find']({'where':{'id':_0x5d3417[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x26ef3f,null))[_0x1398('0x36')](function(_0x1f3bbf){if(_0x1f3bbf){_0x5d3417[_0x1398('0x68')][_0x1398('0x69')]=_0x1f3bbf['id'];return db['Disposition']['create'](_0x5d3417[_0x1398('0x68')]);}})[_0x1398('0x36')](respondWithResult(_0x26ef3f,null))[_0x1398('0x59')](handleError(_0x26ef3f,null));};exports['getDispositions']=function(_0x2d2c30,_0x149659,_0x1d7642){var _0xaaa838={'raw':![],'where':{}};var _0x46167c={};var _0x2a2d92={'count':0x0,'rows':[]};return db[_0x1398('0x3f')][_0x1398('0x6a')]({'where':{'id':_0x2d2c30[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x149659,null))[_0x1398('0x36')](function(_0x5b9e6d){if(_0x5b9e6d){_0x46167c[_0x1398('0x44')]=_['keys'](db[_0x1398('0x6b')][_0x1398('0x40')]);_0x46167c['query']=_[_0x1398('0x5c')](_0x2d2c30[_0x1398('0x46')]);_0x46167c['filters']=_[_0x1398('0x48')](_0x46167c[_0x1398('0x44')],_0x46167c[_0x1398('0x46')]);_0xaaa838[_0x1398('0x49')]=_['intersection'](_0x46167c[_0x1398('0x44')],qs['fields'](_0x2d2c30[_0x1398('0x46')][_0x1398('0x4a')]));_0xaaa838[_0x1398('0x49')]=_0xaaa838[_0x1398('0x49')][_0x1398('0x4b')]?_0xaaa838[_0x1398('0x49')]:_0x46167c[_0x1398('0x44')];if(!_0x2d2c30['query'][_0x1398('0x6c')]('nolimit')){_0xaaa838[_0x1398('0x4d')]=qs[_0x1398('0x4d')](_0x2d2c30[_0x1398('0x46')][_0x1398('0x4d')]);_0xaaa838[_0x1398('0x31')]=qs['offset'](_0x2d2c30[_0x1398('0x46')][_0x1398('0x31')]);}_0xaaa838[_0x1398('0x4e')]=qs[_0x1398('0x4f')](_0x2d2c30[_0x1398('0x46')][_0x1398('0x4f')]);_0xaaa838[_0x1398('0x50')]=qs[_0x1398('0x47')](_[_0x1398('0x51')](_0x2d2c30[_0x1398('0x46')],_0x46167c[_0x1398('0x47')]));_0xaaa838[_0x1398('0x50')][_0x1398('0x69')]=_0x5b9e6d['id'];if(_0x2d2c30['query']['filter']){_0xaaa838[_0x1398('0x50')]=_['merge'](_0xaaa838['where'],{'$or':_[_0x1398('0x45')](_0xaaa838['attributes'],function(_0x3f4c24){var _0x20bef8={};_0x20bef8[_0x3f4c24]={'$like':'%'+_0x2d2c30['query']['filter']+'%'};return _0x20bef8;})});}_0xaaa838=_[_0x1398('0x52')]({},_0xaaa838,_0x2d2c30[_0x1398('0x55')]);return db[_0x1398('0x6b')][_0x1398('0x30')]({'where':_0xaaa838[_0x1398('0x50')]})[_0x1398('0x36')](function(_0x3bc527){_0x2a2d92[_0x1398('0x30')]=_0x3bc527;if(_0x2d2c30[_0x1398('0x46')][_0x1398('0x56')]){_0xaaa838['include']=[{'all':!![]}];}return db[_0x1398('0x6b')][_0x1398('0x6d')](_0xaaa838);})['then'](function(_0x2a2175){_0x2a2d92[_0x1398('0x58')]=_0x2a2175;return _0x2a2d92;});}})[_0x1398('0x36')](respondWithFilteredResult(_0x149659,_0xaaa838))[_0x1398('0x59')](handleError(_0x149659,null));};exports[_0x1398('0x6e')]=function(_0x3df097,_0x5b46f3,_0x44d208){return db['OpenchannelAccount'][_0x1398('0x5d')]({'where':{'id':_0x3df097[_0x1398('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5b46f3,null))['then'](function(_0x487b00){if(_0x487b00){return _0x487b00[_0x1398('0x6e')](_0x3df097[_0x1398('0x46')][_0x1398('0x6f')]);}})[_0x1398('0x36')](respondWithStatusCode(_0x5b46f3,null))[_0x1398('0x59')](handleError(_0x5b46f3,null));};exports[_0x1398('0x70')]=function(_0x1944e7,_0x2662f6,_0x5a9e02){if(_0x1944e7[_0x1398('0x68')]['id']){delete _0x1944e7[_0x1398('0x68')]['id'];}return db[_0x1398('0x3f')][_0x1398('0x5d')]({'where':{'id':_0x1944e7[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x2662f6,null))[_0x1398('0x36')](function(_0x4a1941){if(_0x4a1941){_0x1944e7[_0x1398('0x68')][_0x1398('0x69')]=_0x4a1941['id'];return db['CannedAnswer'][_0x1398('0x5e')](_0x1944e7[_0x1398('0x68')]);}})[_0x1398('0x36')](respondWithResult(_0x2662f6,null))[_0x1398('0x59')](handleError(_0x2662f6,null));};exports[_0x1398('0x71')]=function(_0x125972,_0x14392b,_0x3ed892){var _0x2d4717={'raw':![],'where':{}};var _0x3d3bb5={};var _0x3bfc40={'count':0x0,'rows':[]};return db[_0x1398('0x3f')][_0x1398('0x6a')]({'where':{'id':_0x125972[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x14392b,null))[_0x1398('0x36')](function(_0x5556dd){if(_0x5556dd){_0x3d3bb5[_0x1398('0x44')]=_[_0x1398('0x5c')](db['CannedAnswer'][_0x1398('0x40')]);_0x3d3bb5[_0x1398('0x46')]=_[_0x1398('0x5c')](_0x125972[_0x1398('0x46')]);_0x3d3bb5[_0x1398('0x47')]=_['intersection'](_0x3d3bb5[_0x1398('0x44')],_0x3d3bb5[_0x1398('0x46')]);_0x2d4717[_0x1398('0x49')]=_['intersection'](_0x3d3bb5[_0x1398('0x44')],qs[_0x1398('0x4a')](_0x125972['query'][_0x1398('0x4a')]));_0x2d4717[_0x1398('0x49')]=_0x2d4717['attributes']['length']?_0x2d4717[_0x1398('0x49')]:_0x3d3bb5[_0x1398('0x44')];if(!_0x125972['query'][_0x1398('0x6c')](_0x1398('0x4c'))){_0x2d4717[_0x1398('0x4d')]=qs[_0x1398('0x4d')](_0x125972[_0x1398('0x46')][_0x1398('0x4d')]);_0x2d4717[_0x1398('0x31')]=qs[_0x1398('0x31')](_0x125972['query'][_0x1398('0x31')]);}_0x2d4717['order']=qs['sort'](_0x125972[_0x1398('0x46')][_0x1398('0x4f')]);_0x2d4717[_0x1398('0x50')]=qs[_0x1398('0x47')](_[_0x1398('0x51')](_0x125972[_0x1398('0x46')],_0x3d3bb5['filters']));_0x2d4717[_0x1398('0x50')]['OpenchannelAccountId']=_0x5556dd['id'];if(_0x125972['query'][_0x1398('0x54')]){_0x2d4717[_0x1398('0x50')]=_[_0x1398('0x52')](_0x2d4717['where'],{'$or':_[_0x1398('0x45')](_0x2d4717[_0x1398('0x49')],function(_0x949cdd){var _0x5a1c1f={};_0x5a1c1f[_0x949cdd]={'$like':'%'+_0x125972[_0x1398('0x46')]['filter']+'%'};return _0x5a1c1f;})});}_0x2d4717=_[_0x1398('0x52')]({},_0x2d4717,_0x125972[_0x1398('0x55')]);return db[_0x1398('0x72')][_0x1398('0x30')]({'where':_0x2d4717[_0x1398('0x50')]})[_0x1398('0x36')](function(_0x518aaa){_0x3bfc40[_0x1398('0x30')]=_0x518aaa;if(_0x125972[_0x1398('0x46')][_0x1398('0x56')]){_0x2d4717[_0x1398('0x57')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2d4717);})['then'](function(_0x16ea18){_0x3bfc40['rows']=_0x16ea18;return _0x3bfc40;});}})[_0x1398('0x36')](respondWithFilteredResult(_0x14392b,_0x2d4717))[_0x1398('0x59')](handleError(_0x14392b,null));};exports[_0x1398('0x73')]=function(_0x4b293e,_0x5ead8d,_0x309338){return db[_0x1398('0x3f')][_0x1398('0x5d')]({'where':{'id':_0x4b293e['params']['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x5ead8d,null))[_0x1398('0x36')](function(_0x7cdb39){if(_0x7cdb39){return _0x7cdb39[_0x1398('0x73')](_0x4b293e['query'][_0x1398('0x6f')]);}})['then'](respondWithStatusCode(_0x5ead8d,null))[_0x1398('0x59')](handleError(_0x5ead8d,null));};exports['notify']=function(_0x278911,_0x4fbdd0,_0x1fe84e){var _0x433b46={'body':_0x278911['body'],'channel':_0x1398('0x74')};var _0x3b9cb4=[];var _0x2176ec=[];var _0x57c992={};var _0xc6d3d8=![];return db[_0x1398('0x75')]['describe']()[_0x1398('0x36')](function(_0x3e199d){if(!_0x3e199d){throw new db['Sequelize'][(_0x1398('0x76'))]('no\x20available\x20attributes');}_0x3b9cb4=_[_0x1398('0x77')](_[_0x1398('0x5c')](_0x3e199d),[_0x1398('0x78'),_0x1398('0x79')]);_0x2176ec=_[_0x1398('0x77')](_[_0x1398('0x5c')](_0x3e199d),[_0x1398('0x78'),'updatedAt',_0x1398('0x7a'),_0x1398('0x7b')]);if(_0x278911['body']['id']){delete _0x278911[_0x1398('0x68')]['id'];}if(_[_0x1398('0x7c')](_0x278911[_0x1398('0x68')][_0x1398('0x7d')])){throw new db[(_0x1398('0x7e'))]['ValidationError'](_0x1398('0x7f'));}if(_[_0x1398('0x7c')](_0x278911[_0x1398('0x68')][_0x1398('0x68')])||_0x278911['body'][_0x1398('0x68')]===''){throw new db[(_0x1398('0x7e'))][(_0x1398('0x76'))](_0x1398('0x80'));}if(_[_0x1398('0x7c')](_0x278911[_0x1398('0x68')][_0x1398('0x81')])){throw new db[(_0x1398('0x7e'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2176ec);}if(!_['includes'](_0x2176ec,_0x278911['body'][_0x1398('0x81')])){throw new db[(_0x1398('0x7e'))][(_0x1398('0x76'))](_0x1398('0x82')+_0x2176ec);}_0x57c992[_0x278911[_0x1398('0x68')]['mapKey']]=_0x278911['body']['from'];})[_0x1398('0x36')](function(){return db[_0x1398('0x3f')][_0x1398('0x5d')]({'where':{'id':_0x278911['params']['id']},'include':[{'model':db['CmList'],'as':_0x1398('0x83'),'include':[{'model':db[_0x1398('0x75')],'as':_0x1398('0x84'),'where':_0x57c992,'limit':0x1,'order':[[_0x1398('0x79'),_0x1398('0x85')]]}]},{'model':db[_0x1398('0x86')],'as':'Applications'}]});})[_0x1398('0x36')](handleEntityNotFound(_0x4fbdd0,null))['then'](function(_0x2ae3a7){if(_0x2ae3a7&&_0x2ae3a7[_0x1398('0x83')]){_0x433b46[_0x1398('0x87')]=_0x2ae3a7;_0x433b46[_0x1398('0x88')]=_0x2ae3a7[_0x1398('0x89')];_0x433b46[_0x1398('0x8a')]=_0x2ae3a7[_0x1398('0x83')];_0x433b46[_0x1398('0x88')]=_[_0x1398('0x8b')](_0x433b46[_0x1398('0x88')],[_0x1398('0x8c')],[_0x1398('0x8d')]);if(_0x433b46[_0x1398('0x87')][_0x1398('0x89')]){delete _0x433b46[_0x1398('0x87')]['Applications'];}if(_0x433b46[_0x1398('0x87')][_0x1398('0x83')]&&_0x433b46['account'][_0x1398('0x83')][_0x1398('0x84')][_0x1398('0x4b')]){return _0x433b46['account'][_0x1398('0x83')][_0x1398('0x84')][0x0];}var _0x249617=_['defaults'](_0x278911[_0x1398('0x68')],{'firstName':_0x278911['body'][_0x1398('0x7d')],'ListId':_0x2ae3a7[_0x1398('0x7b')]});_0x249617[_0x278911['body'][_0x1398('0x81')]]=_0x278911[_0x1398('0x68')][_0x1398('0x7d')];return db[_0x1398('0x75')][_0x1398('0x5e')](_0x249617,{'fields':_0x3b9cb4,'raw':!![]});}})[_0x1398('0x36')](handleEntityNotFound(_0x4fbdd0,null))[_0x1398('0x36')](function(_0x779d90){_0x433b46[_0x1398('0x8e')]=_0x779d90;if(_0x779d90){var _0x32659a={'ContactId':_0x779d90['id'],'OpenchannelAccountId':_0x278911[_0x1398('0x5b')]['id'],'from':(_0x779d90[_0x1398('0x8f')]||'')+'\x20'+(_0x779d90[_0x1398('0x90')]||'')};var _0x521a02={'OpenchannelAccountId':_0x278911[_0x1398('0x5b')]['id'],'closed':![]};if(_0x278911[_0x1398('0x68')][_0x1398('0x91')]){_0x521a02[_0x1398('0x91')]=_0x278911[_0x1398('0x68')][_0x1398('0x91')];return db[_0x1398('0x92')][_0x1398('0x5d')]({'where':_0x521a02})[_0x1398('0x36')](function(_0x5b84ab){if(_0x5b84ab){return[_0x5b84ab,![]];}_0x32659a[_0x1398('0x91')]=_0x278911['body']['threadId'];_0x32659a[_0x1398('0x93')]=_0x278911['body']['externalUrl'];return db[_0x1398('0x92')][_0x1398('0x5e')](_0x32659a)[_0x1398('0x36')](function(_0x4569e2){return[_0x4569e2,!![]];});});}else{_0x521a02['threadId']=null;}_0x521a02[_0x1398('0x94')]=_0x779d90['id'];return db['OpenchannelInteraction'][_0x1398('0x5d')]({'where':_0x521a02})[_0x1398('0x36')](function(_0x5af267){if(_0x5af267){return[_0x5af267,![]];}return db[_0x1398('0x92')][_0x1398('0x5e')](_0x32659a)[_0x1398('0x36')](function(_0x38fa43){return[_0x38fa43,!![]];});});}})[_0x1398('0x95')](function(_0x3dd3bf,_0x13c01c){if(_0x3dd3bf){_0xc6d3d8=_0x13c01c;if(!_0x13c01c){var _0x2f9089={'from':(_0x433b46['contact']['firstName']||'')+'\x20'+(_0x433b46[_0x1398('0x8e')][_0x1398('0x90')]||'')};if(_0x278911[_0x1398('0x68')][_0x1398('0x91')]&&_0x278911[_0x1398('0x68')][_0x1398('0x96')]&&_0x278911['body'][_0x1398('0x91')]!=_0x278911[_0x1398('0x68')][_0x1398('0x96')]){_0x2f9089['threadId']=_0x278911[_0x1398('0x68')][_0x1398('0x96')];}return _0x3dd3bf[_0x1398('0x35')](_0x2f9089);}else{return _0x3dd3bf;}}})['then'](function(_0x43b042){_0x433b46[_0x1398('0x97')]=_0x43b042['get']({'plain':!![]});_0x433b46[_0x1398('0x97')][_0x1398('0x98')]=_0xc6d3d8;if(_0x433b46[_0x1398('0x97')][_0x1398('0x98')]){if(_0x433b46[_0x1398('0x87')][_0x1398('0x99')]){_0x433b46[_0x1398('0x88')][_0x1398('0x9a')]({'id':0x0,'priority':_0x433b46[_0x1398('0x88')][_0x1398('0x4b')]+0x1,'app':'close','appdata':_0x1398('0x9b'),'interval':'*,*,*,*'});}}return db[_0x1398('0x9c')][_0x1398('0x5e')]({'body':_0x278911[_0x1398('0x68')][_0x1398('0x68')],'OpenchannelAccountId':_0x278911[_0x1398('0x5b')]['id'],'OpenchannelInteractionId':_0x43b042['id'],'direction':'in','ContactId':_0x433b46[_0x1398('0x8e')]['id'],'AttachmentId':_0x278911[_0x1398('0x68')][_0x1398('0x9d')]});})[_0x1398('0x36')](function(_0x4d2042){_0x433b46[_0x1398('0x28')]=_0x4d2042;if(!_0x433b46[_0x1398('0x97')][_0x1398('0x9e')])return;return db[_0x1398('0x9f')]['find']({'attributes':['id',_0x1398('0x3a')],'where':{'id':_0x433b46['interaction'][_0x1398('0x9e')]}});})[_0x1398('0x36')](function(_0x427978){if(_0x427978){_0x433b46[_0x1398('0x88')][_0x1398('0xa0')]({'id':0x0,'priority':0x0,'app':_0x1398('0xa1'),'appdata':_0x427978['name']+','+(_0x433b46[_0x1398('0x87')]['waitForTheAssignedAgent']||0xa),'interval':_0x1398('0xa2')});}if(!_0x433b46[_0x1398('0x97')][_0x1398('0xa3')])return;return db[_0x1398('0xa4')]['find']({'attributes':['id',_0x1398('0x3a')],'where':{'id':_0x433b46[_0x1398('0x97')][_0x1398('0xa3')]}});})[_0x1398('0x36')](function(_0x153882){if(_0x153882){_0x433b46[_0x1398('0x88')][_0x1398('0xa0')]({'id':0x0,'priority':0x1,'app':_0x1398('0xa5'),'appdata':_0x153882[_0x1398('0x3a')]+','+(_0x433b46[_0x1398('0x87')]['waitForTheAssignedQueue']||0x12c),'interval':_0x1398('0xa2')});}return respondWithRpcPromise(_0x1398('0xa6'),_0x1398('0xa7'),_0x433b46);})['then'](function(_0x49c7cf){respondWithRpcPromise(_0x1398('0xa8'),_0x1398('0xa8'),{'event':_0x1398('0xa9'),'message':_0x49c7cf},client9002);return _0x49c7cf;})[_0x1398('0x36')](respondWithResult(_0x4fbdd0,null))[_0x1398('0x59')](handleError(_0x4fbdd0,null));};exports[_0x1398('0xaa')]=function(_0x28125e,_0x346014){var _0x3ca01c=_0x28125e[_0x1398('0x5b')]['id'];var _0x488004=_0x28125e[_0x1398('0x68')];var _0x4f0654=0xc8;var _0x2e6e82=null;return db[_0x1398('0xab')][_0x1398('0xac')]({'isolationLevel':db[_0x1398('0xab')][_0x1398('0xad')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x47c421){return db[_0x1398('0x3f')][_0x1398('0x6a')]({'where':{'id':_0x3ca01c},'transaction':_0x47c421})[_0x1398('0x36')](function(_0xa4493){if(_0xa4493){return db['OpenchannelApplication'][_0x1398('0x37')]({'where':{'OpenchannelAccountId':_0x3ca01c},'transaction':_0x47c421})['then'](function(){var _0x1ae60a=_[_0x1398('0x45')](_0x488004,function(_0xe5aad5){_0xe5aad5['OpenchannelAccountId']=_0x3ca01c;return _0xe5aad5;});return db[_0x1398('0x86')][_0x1398('0xae')](_0x1ae60a,{'transaction':_0x47c421});});}else{_0x4f0654=0x194;_0x2e6e82=[];}});})[_0x1398('0x36')](function(){if(_0x4f0654!==0x194){return db[_0x1398('0x86')][_0x1398('0xaf')]({'where':{'OpenchannelAccountId':_0x3ca01c},'order':_0x1398('0x8c')})[_0x1398('0x36')](function(_0x4b4659){_0x2e6e82=_0x4b4659;});}})[_0x1398('0x59')](function(_0x2c5933){_0x4f0654=0x1f4;logger[_0x1398('0x25')](_0x2c5933[_0x1398('0x39')]);if(_0x2c5933[_0x1398('0x3a')]){delete _0x2c5933[_0x1398('0x3a')];}_0x2e6e82=_0x2c5933;})[_0x1398('0xb0')](function(){if(_0x2e6e82===null){_0x346014[_0x1398('0x2b')](_0x4f0654);}else{if(_0x4f0654===0x1f4){_0x346014[_0x1398('0x2d')](_0x4f0654)[_0x1398('0x3b')](_0x2e6e82);}else{_0x346014['status'](_0x4f0654)[_0x1398('0x2e')](_0x2e6e82);}}});};exports[_0x1398('0xb1')]=function(_0x4c66c7,_0x29b9cd,_0x599531){var _0x595010={};var _0x45466c={};var _0x1aa1f1;var _0x1eac0e;return db[_0x1398('0x3f')][_0x1398('0x6a')]({'where':{'id':_0x4c66c7[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x29b9cd,null))['then'](function(_0x31a8b1){if(_0x31a8b1){_0x1aa1f1=_0x31a8b1;_0x45466c[_0x1398('0x44')]=_['keys'](db[_0x1398('0x86')]['rawAttributes']);_0x45466c[_0x1398('0x46')]=_[_0x1398('0x5c')](_0x4c66c7['query']);_0x45466c[_0x1398('0x47')]=_['intersection'](_0x45466c[_0x1398('0x44')],_0x45466c[_0x1398('0x46')]);_0x595010[_0x1398('0x49')]=_[_0x1398('0x48')](_0x45466c[_0x1398('0x44')],qs[_0x1398('0x4a')](_0x4c66c7[_0x1398('0x46')][_0x1398('0x4a')]));_0x595010['attributes']=_0x595010[_0x1398('0x49')][_0x1398('0x4b')]?_0x595010[_0x1398('0x49')]:_0x45466c[_0x1398('0x44')];_0x595010[_0x1398('0x4e')]=qs['sort'](_0x4c66c7[_0x1398('0x46')][_0x1398('0x4f')]);_0x595010[_0x1398('0x50')]=qs[_0x1398('0x47')](_[_0x1398('0x51')](_0x4c66c7[_0x1398('0x46')],_0x45466c['filters']));if(_0x4c66c7[_0x1398('0x46')][_0x1398('0x54')]){_0x595010[_0x1398('0x50')]=_[_0x1398('0x52')](_0x595010[_0x1398('0x50')],{'$or':_['map'](_0x595010[_0x1398('0x49')],function(_0x2646e8){var _0x4cf069={};_0x4cf069[_0x2646e8]={'$like':'%'+_0x4c66c7[_0x1398('0x46')][_0x1398('0x54')]+'%'};return _0x4cf069;})});}_0x595010=_[_0x1398('0x52')]({},_0x595010,_0x4c66c7['options']);return _0x1aa1f1['getApplications'](_0x595010);}})[_0x1398('0x36')](function(_0x2a45b5){if(_0x2a45b5){_0x1eac0e=_0x2a45b5[_0x1398('0x4b')];if(!_0x4c66c7[_0x1398('0x46')][_0x1398('0x6c')](_0x1398('0x4c'))){_0x595010[_0x1398('0x4d')]=qs[_0x1398('0x4d')](_0x4c66c7[_0x1398('0x46')][_0x1398('0x4d')]);_0x595010['offset']=qs[_0x1398('0x31')](_0x4c66c7[_0x1398('0x46')][_0x1398('0x31')]);}return _0x1aa1f1[_0x1398('0xb1')](_0x595010);}})[_0x1398('0x36')](function(_0x2608e3){if(_0x2608e3){return _0x2608e3?{'count':_0x1eac0e,'rows':_0x2608e3}:null;}})[_0x1398('0x36')](respondWithResult(_0x29b9cd,null))[_0x1398('0x59')](handleError(_0x29b9cd,null));};exports['getInteractions']=function(_0x5170e3,_0x465dc4,_0x3dce9e){var _0x3b8e03={'raw':![],'where':{}};var _0x48a717={};var _0x37f6e4={'count':0x0,'rows':[]};return db[_0x1398('0x3f')]['findOne']({'where':{'id':_0x5170e3[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x465dc4,null))[_0x1398('0x36')](function(_0x2ce4d1){if(_0x2ce4d1){_0x48a717[_0x1398('0x44')]=_[_0x1398('0x5c')](db[_0x1398('0x92')][_0x1398('0x40')]);_0x48a717[_0x1398('0x46')]=_['keys'](_0x5170e3[_0x1398('0x46')]);_0x48a717[_0x1398('0x47')]=_[_0x1398('0x48')](_0x48a717[_0x1398('0x44')],_0x48a717['query']);_0x3b8e03['attributes']=_[_0x1398('0x48')](_0x48a717['model'],qs['fields'](_0x5170e3[_0x1398('0x46')]['fields']));_0x3b8e03[_0x1398('0x49')]=_0x3b8e03[_0x1398('0x49')][_0x1398('0x4b')]?_0x3b8e03[_0x1398('0x49')]:_0x48a717[_0x1398('0x44')];if(!_0x5170e3[_0x1398('0x46')]['hasOwnProperty']('nolimit')){_0x3b8e03['limit']=qs[_0x1398('0x4d')](_0x5170e3[_0x1398('0x46')][_0x1398('0x4d')]);_0x3b8e03[_0x1398('0x31')]=qs[_0x1398('0x31')](_0x5170e3[_0x1398('0x46')][_0x1398('0x31')]);}_0x3b8e03[_0x1398('0x4e')]=qs[_0x1398('0x4f')](_0x5170e3['query'][_0x1398('0x4f')]);_0x3b8e03[_0x1398('0x50')]=qs[_0x1398('0x47')](_['pick'](_0x5170e3['query'],_0x48a717[_0x1398('0x47')]));_0x3b8e03[_0x1398('0x50')][_0x1398('0x69')]=_0x2ce4d1['id'];if(_0x5170e3[_0x1398('0x46')]['filter']){_0x3b8e03[_0x1398('0x50')]=_[_0x1398('0x52')](_0x3b8e03[_0x1398('0x50')],{'$or':_[_0x1398('0x45')](_0x3b8e03[_0x1398('0x49')],function(_0x53b136){var _0x35a964={};_0x35a964[_0x53b136]={'$like':'%'+_0x5170e3['query'][_0x1398('0x54')]+'%'};return _0x35a964;})});}_0x3b8e03=_[_0x1398('0x52')]({},_0x3b8e03,_0x5170e3[_0x1398('0x55')]);return db[_0x1398('0x92')][_0x1398('0x30')]({'where':_0x3b8e03[_0x1398('0x50')]})[_0x1398('0x36')](function(_0x412e45){_0x37f6e4[_0x1398('0x30')]=_0x412e45;if(_0x5170e3[_0x1398('0x46')][_0x1398('0x56')]){_0x3b8e03[_0x1398('0x57')]=[{'model':db[_0x1398('0x75')],'as':_0x1398('0xb2'),'required':![]},{'model':db[_0x1398('0x9f')],'as':_0x1398('0xb3'),'attributes':['name','fullname',_0x1398('0xb4')],'required':![]},{'model':db[_0x1398('0xb5')],'as':_0x1398('0xb6'),'attributes':['id',_0x1398('0x3a'),'color'],'where':_0x5170e3[_0x1398('0x46')][_0x1398('0xb7')]?{'id':_0x5170e3[_0x1398('0x46')][_0x1398('0xb7')]}:undefined,'required':_0x5170e3[_0x1398('0x46')][_0x1398('0xb7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x1398('0x6d')](_0x3b8e03);})[_0x1398('0x36')](function(_0x25f093){_0x37f6e4[_0x1398('0x58')]=_0x25f093;return _0x37f6e4;});}})[_0x1398('0x36')](respondWithFilteredResult(_0x465dc4,_0x3b8e03))['catch'](handleError(_0x465dc4,null));};exports[_0x1398('0xb8')]=function(_0x582df9,_0x7040b2,_0x437e58){return db['OpenchannelAccount'][_0x1398('0x5d')]({'where':{'id':_0x582df9['params']['id']}})['then'](handleEntityNotFound(_0x7040b2,null))[_0x1398('0x36')](function(_0x187b65){if(_0x187b65){return _0x187b65[_0x1398('0xb8')](_0x582df9[_0x1398('0x68')][_0x1398('0x6f')],_[_0x1398('0xb9')](_0x582df9[_0x1398('0x68')],[_0x1398('0x6f'),'id'])||{})[_0x1398('0x95')](function(_0x585795){for(var _0xf88289=0x0;_0xf88289<_0x582df9[_0x1398('0x68')][_0x1398('0x6f')][_0x1398('0x4b')];_0xf88289+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x582df9[_0x1398('0x68')][_0x1398('0x6f')][_0xf88289]),'OpenchannelAccountId':Number(_0x582df9[_0x1398('0x5b')]['id'])});}return _0x585795;});}})[_0x1398('0x36')](respondWithResult(_0x7040b2,null))['catch'](handleError(_0x7040b2,null));};exports['removeAgents']=function(_0x328b12,_0x25836a,_0x25ecba){return db[_0x1398('0x3f')][_0x1398('0x5d')]({'where':{'id':_0x328b12[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x25836a,null))['then'](function(_0x31811b){if(_0x31811b){return _0x31811b[_0x1398('0xba')](_0x328b12[_0x1398('0x46')][_0x1398('0x6f')])[_0x1398('0x36')](function(){if(_[_0x1398('0xbb')](_0x328b12[_0x1398('0x46')][_0x1398('0x6f')])){for(var _0x584434=0x0;_0x584434<_0x328b12[_0x1398('0x46')][_0x1398('0x6f')][_0x1398('0x4b')];_0x584434+=0x1){socket[_0x1398('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x328b12[_0x1398('0x46')][_0x1398('0x6f')][_0x584434]),'OpenchannelAccountId':Number(_0x328b12[_0x1398('0x5b')]['id'])});}}else{socket[_0x1398('0xbc')](_0x1398('0xbd'),{'UserId':Number(_0x328b12[_0x1398('0x46')][_0x1398('0x6f')]),'OpenchannelAccountId':Number(_0x328b12[_0x1398('0x5b')]['id'])});}});}})[_0x1398('0x36')](respondWithStatusCode(_0x25836a,null))[_0x1398('0x59')](handleError(_0x25836a,null));};exports[_0x1398('0xbe')]=function(_0xe023ca,_0x99b511,_0x5007c3){var _0x27c065={};var _0x4e4b4a={};var _0x1e99c1;var _0x4f8f7f;return db[_0x1398('0x3f')][_0x1398('0x6a')]({'where':{'id':_0xe023ca[_0x1398('0x5b')]['id']}})['then'](handleEntityNotFound(_0x99b511,null))[_0x1398('0x36')](function(_0x1bff92){if(_0x1bff92){_0x1e99c1=_0x1bff92;_0x4e4b4a['model']=_['keys'](db['User'][_0x1398('0x40')]);_0x4e4b4a['query']=_[_0x1398('0x5c')](_0xe023ca[_0x1398('0x46')]);_0x4e4b4a[_0x1398('0x47')]=_['intersection'](_0x4e4b4a[_0x1398('0x44')],_0x4e4b4a['query']);_0x27c065[_0x1398('0x49')]=_[_0x1398('0x48')](_0x4e4b4a[_0x1398('0x44')],qs[_0x1398('0x4a')](_0xe023ca['query'][_0x1398('0x4a')]));_0x27c065[_0x1398('0x49')]=_0x27c065['attributes'][_0x1398('0x4b')]?_0x27c065['attributes']:_0x4e4b4a[_0x1398('0x44')];_0x27c065[_0x1398('0x4e')]=qs[_0x1398('0x4f')](_0xe023ca[_0x1398('0x46')][_0x1398('0x4f')]);_0x27c065[_0x1398('0x50')]=qs['filters'](_[_0x1398('0x51')](_0xe023ca[_0x1398('0x46')],_0x4e4b4a['filters']));if(_0xe023ca[_0x1398('0x46')][_0x1398('0x54')]){_0x27c065[_0x1398('0x50')]=_[_0x1398('0x52')](_0x27c065[_0x1398('0x50')],{'$or':_['map'](_0x27c065[_0x1398('0x49')],function(_0x29481f){var _0x59f3f6={};_0x59f3f6[_0x29481f]={'$like':'%'+_0xe023ca[_0x1398('0x46')][_0x1398('0x54')]+'%'};return _0x59f3f6;})});}_0x27c065=_['merge']({},_0x27c065,_0xe023ca['options']);return _0x1e99c1[_0x1398('0xbe')](_0x27c065);}})[_0x1398('0x36')](function(_0x2ef3f4){if(_0x2ef3f4){_0x4f8f7f=_0x2ef3f4[_0x1398('0x4b')];if(!_0xe023ca[_0x1398('0x46')]['hasOwnProperty'](_0x1398('0x4c'))){_0x27c065[_0x1398('0x4d')]=qs[_0x1398('0x4d')](_0xe023ca['query'][_0x1398('0x4d')]);_0x27c065[_0x1398('0x31')]=qs[_0x1398('0x31')](_0xe023ca['query'][_0x1398('0x31')]);}return _0x1e99c1[_0x1398('0xbe')](_0x27c065);}})[_0x1398('0x36')](function(_0x1b0371){if(_0x1b0371){return _0x1b0371?{'count':_0x4f8f7f,'rows':_0x1b0371}:null;}})[_0x1398('0x36')](respondWithResult(_0x99b511,null))[_0x1398('0x59')](handleError(_0x99b511,null));};exports['send']=function(_0xe6984,_0x468088,_0x472229){var _0xa9e41c,_0x47b2cf,_0x1b1acb;if(_['isNil'](_0xe6984[_0x1398('0x68')]['body'])||_0xe6984[_0x1398('0x68')]['body']===''){throw new db['Sequelize'][(_0x1398('0x76'))](_0x1398('0x80'));}if(_[_0x1398('0x7c')](_0xe6984[_0x1398('0x68')]['to'])){}_0xa9e41c=_0xe6984['body']['to'];return db['OpenchannelAccount'][_0x1398('0x6a')]({'where':{'id':_0xe6984[_0x1398('0x5b')]['id']}})[_0x1398('0x36')](handleEntityNotFound(_0x468088,null))['then'](function(_0x303a05){if(_0x303a05){return db[_0x1398('0x3f')][_0x1398('0x5d')]({'where':{'id':_0x303a05['id']},'include':[{'model':db[_0x1398('0xbf')],'as':_0x1398('0x83'),'include':[{'model':db[_0x1398('0x75')],'as':_0x1398('0x84'),'where':{[_0x303a05[_0x1398('0x81')]]:_0xa9e41c},'limit':0x1,'order':[['updatedAt',_0x1398('0x85')]]}]}]})[_0x1398('0x36')](handleEntityNotFound(_0x468088,null))[_0x1398('0x36')](function(_0x293969){if(_0x293969&&_0x293969[_0x1398('0x83')]){_0x47b2cf=_0x293969['get']({'plain':!![]});if(_0x47b2cf[_0x1398('0x83')]&&_0x47b2cf[_0x1398('0x83')][_0x1398('0x84')][_0x1398('0x4b')]){return _0x47b2cf['List'][_0x1398('0x84')][0x0];}return db['CmContact'][_0x1398('0x5e')](_[_0x1398('0x1d')](_0xe6984[_0x1398('0x68')],{'firstName':_0xa9e41c,[_0x293969[_0x1398('0x81')]]:_0xa9e41c,'phone':_0xa9e41c,'ListId':_0x47b2cf[_0x1398('0x7b')]}));}})[_0x1398('0x36')](handleEntityNotFound(_0x468088,null))[_0x1398('0x36')](function(_0x1814f4){if(_0x1814f4){_0x1b1acb=_0x1814f4;return db[_0x1398('0x92')][_0x1398('0x5d')]({'where':{'ContactId':_0x1b1acb['id'],'closed':![],'OpenchannelAccountId':_0x47b2cf['id']}})[_0x1398('0x36')](function(_0x2eeed4){if(_0x2eeed4){return[_0x2eeed4,![]];}return db[_0x1398('0x92')][_0x1398('0x5e')]({'UserId':_0xe6984[_0x1398('0x5f')]['id'],'ContactId':_0x1b1acb['id'],'OpenchannelAccountId':_0x47b2cf['id'],'lastMsgDirection':_0x1398('0xc0'),'firstMsgDirection':_0x1398('0xc0'),'Messages':[_[_0x1398('0x52')](_0xe6984['body'],{'read':![],'body':_0xe6984[_0x1398('0x68')][_0x1398('0x68')],'OpenchannelAccountId':_0x47b2cf['id'],'UserId':_0xe6984[_0x1398('0x5f')]['id'],'ContactId':_0x1b1acb['id']})]},{'include':[{'model':db[_0x1398('0x9c')],'as':_0x1398('0xc1')}]})[_0x1398('0x36')](function(_0x2140be){return[_0x2140be,!![]];});});}})[_0x1398('0x95')](function(_0x415f70,_0x10be2c){if(_0x10be2c){return _0x415f70;}return db[_0x1398('0x9c')][_0x1398('0x5e')](_[_0x1398('0x52')](_0xe6984['body'],{'read':![],'body':_0xe6984[_0x1398('0x68')][_0x1398('0x68')],'OpenchannelAccountId':_0x47b2cf['id'],'OpenchannelInteractionId':_0x415f70['id'],'UserId':_0xe6984['user']['id'],'ContactId':_0x1b1acb['id']}))[_0x1398('0x36')](function(_0x5aaf79){_0x415f70[_0x1398('0xc2')]['Messages']=[];_0x415f70[_0x1398('0xc2')][_0x1398('0xc1')]['push'](_0x5aaf79[_0x1398('0xc2')]);return _0x415f70;});});}})['then'](respondWithResult(_0x468088,null))[_0x1398('0x59')](handleError(_0x468088,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 77e0d09..66d6988 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 _0x1be1=['OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x3d35a1,_0x18ea21){var _0x302dd1=function(_0x474578){while(--_0x474578){_0x3d35a1['push'](_0x3d35a1['shift']());}};_0x302dd1(++_0x18ea21);}(_0x1be1,0x192));var _0x11be=function(_0x3996f4,_0x81c7de){_0x3996f4=_0x3996f4-0x0;var _0x18b671=_0x1be1[_0x3996f4];return _0x18b671;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x11be('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x11be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x2'),'afterDestroy':_0x11be('0x3')};function emitEvent(_0x200b2a){return function(_0x318d41,_0x504d3a,_0x3ce56d){OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a+':'+_0x318d41['id'],_0x318d41);OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a,_0x318d41);_0x3ce56d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x11be('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x58f7ae,_0x5086c9){var _0x151519=function(_0x102e83){while(--_0x102e83){_0x58f7ae['push'](_0x58f7ae['shift']());}};_0x151519(++_0x5086c9);}(_0x13f6,0x124));var _0x613f=function(_0x276fae,_0x1424c1){_0x276fae=_0x276fae-0x0;var _0x132c7e=_0x13f6[_0x276fae];return _0x132c7e;};'use strict';var EventEmitter=require(_0x613f('0x0'));var OpenchannelAccount=require(_0x613f('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){OpenchannelAccountEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);OpenchannelAccountEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index c110612..b33f4a1 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(_0x1def21,_0xaebb5b){var _0x14062d=function(_0x19d180){while(--_0x19d180){_0x1def21['push'](_0x1def21['shift']());}};_0x14062d(++_0xaebb5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x48564c,_0x2fa4ba){var _0x3cfcf4=function(_0x13dc4b){while(--_0x13dc4b){_0x48564c['push'](_0x48564c['shift']());}};_0x3cfcf4(++_0x2fa4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 e377e16..9b76275 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 _0x2504=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s'];(function(_0x45792f,_0x2c180c){var _0x57bdb6=function(_0x2f87da){while(--_0x2f87da){_0x45792f['push'](_0x45792f['shift']());}};_0x57bdb6(++_0x2c180c);}(_0x2504,0xee));var _0x4250=function(_0x2203a6,_0x233ebb){_0x2203a6=_0x2203a6-0x0;var _0x4ace25=_0x2504[_0x2203a6];return _0x4ace25;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rs=require(_0x4250('0x4'));var fs=require('fs');var Redis=require(_0x4250('0x5'));var db=require(_0x4250('0x6'))['db'];var utils=require(_0x4250('0x7'));var logger=require(_0x4250('0x8'))(_0x4250('0x9'));var config=require(_0x4250('0xa'));var jayson=require(_0x4250('0xb'));var client=jayson['client'][_0x4250('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4250('0xd')],{'host':_0x4250('0xe'),'port':0x18eb});var socket=require(_0x4250('0xf'))(new Redis(config[_0x4250('0xd')]));require(_0x4250('0x10'))['register'](socket);function respondWithRpcPromise(_0x1016b9,_0x49bf26,_0x2de8a7){return new BPromise(function(_0x2ff5ca,_0x55a792){return client[_0x4250('0x11')](_0x1016b9,_0x2de8a7)['then'](function(_0x535015){logger[_0x4250('0x12')](_0x4250('0x13'),_0x49bf26,_0x4250('0x14'));logger[_0x4250('0x15')](_0x4250('0x16'),_0x49bf26,'request\x20sent',JSON[_0x4250('0x17')](_0x535015));if(_0x535015[_0x4250('0x18')]){if(_0x535015[_0x4250('0x18')][_0x4250('0x19')]===0x1f4){logger[_0x4250('0x18')](_0x4250('0x13'),_0x49bf26,_0x535015['error'][_0x4250('0x1a')]);return _0x55a792(_0x535015[_0x4250('0x18')][_0x4250('0x1a')]);}logger[_0x4250('0x18')](_0x4250('0x13'),_0x49bf26,_0x535015[_0x4250('0x18')][_0x4250('0x1a')]);return _0x2ff5ca(_0x535015['error'][_0x4250('0x1a')]);}else{logger[_0x4250('0x12')](_0x4250('0x13'),_0x49bf26,_0x4250('0x14'));_0x2ff5ca(_0x535015[_0x4250('0x1b')][_0x4250('0x1a')]);}})[_0x4250('0x1c')](function(_0x508bc3){logger[_0x4250('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x49bf26,_0x508bc3);_0x55a792(_0x508bc3);});});} \ No newline at end of file +var _0xbdb7=['http','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','error','code','message','OpenchannelAccount,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x10756d,_0x2f324b){var _0x50f5cb=function(_0x88b00){while(--_0x88b00){_0x10756d['push'](_0x10756d['shift']());}};_0x50f5cb(++_0x2f324b);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x8b0f43,_0x1c57b8){_0x8b0f43=_0x8b0f43-0x0;var _0x3f4425=_0xbdb7[_0x8b0f43];return _0x3f4425;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});config[_0x7bdb('0xb')]=_['defaults'](config['redis'],{'host':_0x7bdb('0xc'),'port':0x18eb});var socket=require(_0x7bdb('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x7bdb('0xe')](socket);function respondWithRpcPromise(_0x1a6b61,_0x2cb569,_0x2c328e){return new BPromise(function(_0x27297d,_0x144ff7){return client[_0x7bdb('0xf')](_0x1a6b61,_0x2c328e)[_0x7bdb('0x10')](function(_0x5462da){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2cb569,_0x7bdb('0x11'));logger[_0x7bdb('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2cb569,_0x7bdb('0x11'),JSON['stringify'](_0x5462da));if(_0x5462da['error']){if(_0x5462da[_0x7bdb('0x13')][_0x7bdb('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2cb569,_0x5462da['error'][_0x7bdb('0x15')]);return _0x144ff7(_0x5462da[_0x7bdb('0x13')][_0x7bdb('0x15')]);}logger[_0x7bdb('0x13')](_0x7bdb('0x16'),_0x2cb569,_0x5462da[_0x7bdb('0x13')][_0x7bdb('0x15')]);return _0x27297d(_0x5462da[_0x7bdb('0x13')]['message']);}else{logger[_0x7bdb('0x17')](_0x7bdb('0x16'),_0x2cb569,_0x7bdb('0x11'));_0x27297d(_0x5462da[_0x7bdb('0x18')]['message']);}})[_0x7bdb('0x19')](function(_0x23e9eb){logger['error'](_0x7bdb('0x16'),_0x2cb569,_0x23e9eb);_0x144ff7(_0x23e9eb);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 1796209..7b58ec5 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 _0x95c5=['register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener'];(function(_0x41f521,_0x3c05f8){var _0x2021e5=function(_0x2fc6cc){while(--_0x2fc6cc){_0x41f521['push'](_0x41f521['shift']());}};_0x2021e5(++_0x3c05f8);}(_0x95c5,0x153));var _0x595c=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x95c5[_0x5d72da];return _0x43ebe7;};'use strict';var OpenchannelAccountEvents=require(_0x595c('0x0'));var events=[_0x595c('0x1'),'remove',_0x595c('0x2')];function createListener(_0x22a23d,_0x36a7da){return function(_0x1da8dc){_0x36a7da[_0x595c('0x3')](_0x22a23d,_0x1da8dc);};}function removeListener(_0x218d7b,_0xf4369b){return function(){OpenchannelAccountEvents[_0x595c('0x4')](_0x218d7b,_0xf4369b);};}exports[_0x595c('0x5')]=function(_0x46be42){for(var _0x4ff80b=0x0,_0x49a115=events[_0x595c('0x6')];_0x4ff80b<_0x49a115;_0x4ff80b++){var _0xfcaf47=events[_0x4ff80b];var _0x218eca=createListener(_0x595c('0x7')+_0xfcaf47,_0x46be42);OpenchannelAccountEvents['on'](_0xfcaf47,_0x218eca);}}; \ No newline at end of file +var _0xfd3a=['save','remove','update','emit','removeListener','length','./openchannelAccount.events'];(function(_0x53c9cc,_0x1e3782){var _0x47b5f8=function(_0x4bc3f1){while(--_0x4bc3f1){_0x53c9cc['push'](_0x53c9cc['shift']());}};_0x47b5f8(++_0x1e3782);}(_0xfd3a,0x179));var _0xafd3=function(_0x4cdbca,_0x3841bd){_0x4cdbca=_0x4cdbca-0x0;var _0x8b114f=_0xfd3a[_0x4cdbca];return _0x8b114f;};'use strict';var OpenchannelAccountEvents=require(_0xafd3('0x0'));var events=[_0xafd3('0x1'),_0xafd3('0x2'),_0xafd3('0x3')];function createListener(_0x4ce05e,_0x488608){return function(_0x160b0d){_0x488608[_0xafd3('0x4')](_0x4ce05e,_0x160b0d);};}function removeListener(_0x328118,_0x415217){return function(){OpenchannelAccountEvents[_0xafd3('0x5')](_0x328118,_0x415217);};}exports['register']=function(_0x9db715){for(var _0x1a72eb=0x0,_0x1f7e16=events[_0xafd3('0x6')];_0x1a72eb<_0x1f7e16;_0x1a72eb++){var _0xd2d780=events[_0x1a72eb];var _0x4c4dcd=createListener('openchannelAccount:'+_0xd2d780,_0x9db715);OpenchannelAccountEvents['on'](_0xd2d780,_0x4c4dcd);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 6362359..eff5363 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 _0xb0b7=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x9101e2,_0x6ea8cf){var _0x4adc2c=function(_0x2cfcaa){while(--_0x2cfcaa){_0x9101e2['push'](_0x9101e2['shift']());}};_0x4adc2c(++_0x6ea8cf);}(_0xb0b7,0x94));var _0x7b0b=function(_0xbd4254,_0x31c08b){_0xbd4254=_0xbd4254-0x0;var _0x46c0f3=_0xb0b7[_0xbd4254];return _0x46c0f3;};'use strict';var multer=require('multer');var util=require(_0x7b0b('0x0'));var path=require(_0x7b0b('0x1'));var timeout=require(_0x7b0b('0x2'));var express=require(_0x7b0b('0x3'));var router=express[_0x7b0b('0x4')]();var fs_extra=require(_0x7b0b('0x5'));var auth=require(_0x7b0b('0x6'));var interaction=require(_0x7b0b('0x7'));var config=require(_0x7b0b('0x8'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xa')]);router[_0x7b0b('0xb')](_0x7b0b('0xc'),auth['isAuthenticated'](),controller[_0x7b0b('0xd')]);router[_0x7b0b('0xe')]('/',auth[_0x7b0b('0x9')](),controller[_0x7b0b('0xf')]);router[_0x7b0b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7b0b('0x11')]);router[_0x7b0b('0x12')](_0x7b0b('0xc'),auth[_0x7b0b('0x9')](),controller[_0x7b0b('0x13')]);module[_0x7b0b('0x14')]=router; \ No newline at end of file +var _0x1ef1=['./openchannelApplication.controller','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x553150,_0x589ff3){var _0x18193d=function(_0x3a5ae6){while(--_0x3a5ae6){_0x553150['push'](_0x553150['shift']());}};_0x18193d(++_0x589ff3);}(_0x1ef1,0x9b));var _0x11ef=function(_0x92db13,_0x76c91c){_0x92db13=_0x92db13-0x0;var _0x2c37e9=_0x1ef1[_0x92db13];return _0x2c37e9;};'use strict';var multer=require('multer');var util=require(_0x11ef('0x0'));var path=require('path');var timeout=require(_0x11ef('0x1'));var express=require(_0x11ef('0x2'));var router=express[_0x11ef('0x3')]();var fs_extra=require(_0x11ef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x11ef('0x5'));var config=require(_0x11ef('0x6'));var controller=require(_0x11ef('0x7'));router['get']('/',auth[_0x11ef('0x8')](),controller[_0x11ef('0x9')]);router['get'](_0x11ef('0xa'),auth[_0x11ef('0x8')](),controller[_0x11ef('0xb')]);router[_0x11ef('0xc')]('/',auth[_0x11ef('0x8')](),controller[_0x11ef('0xd')]);router[_0x11ef('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x11ef('0xf')]);router['delete'](_0x11ef('0xa'),auth[_0x11ef('0x8')](),controller[_0x11ef('0x10')]);module[_0x11ef('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 5df943b..7c70572 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 _0x2f2f=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2f283b,_0x245fa5){var _0x5e5342=function(_0x5a823c){while(--_0x5a823c){_0x2f283b['push'](_0x2f283b['shift']());}};_0x5e5342(++_0x245fa5);}(_0x2f2f,0x161));var _0xf2f2=function(_0x1c7a8e,_0x35037e){_0x1c7a8e=_0x1c7a8e-0x0;var _0x289a68=_0x2f2f[_0x1c7a8e];return _0x289a68;};'use strict';var Sequelize=require(_0xf2f2('0x0'));module[_0xf2f2('0x1')]={'priority':{'type':Sequelize[_0xf2f2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf2f2('0x3')],'allowNull':![],'defaultValue':_0xf2f2('0x4')},'appdata':{'type':Sequelize[_0xf2f2('0x5')]()},'description':{'type':Sequelize[_0xf2f2('0x3')]},'interval':{'type':Sequelize[_0xf2f2('0x3')],'defaultValue':_0xf2f2('0x6')}}; \ No newline at end of file +var _0xe644=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x51ba60,_0x285782){var _0x7c11bf=function(_0x2aa30a){while(--_0x2aa30a){_0x51ba60['push'](_0x51ba60['shift']());}};_0x7c11bf(++_0x285782);}(_0xe644,0x7f));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e64('0x0'));module[_0x4e64('0x1')]={'priority':{'type':Sequelize[_0x4e64('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4e64('0x3')],'allowNull':![],'defaultValue':_0x4e64('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4e64('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e5e663c..74bcb99 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 _0x81cb=['map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','rows','params','fields','include','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','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','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','name','send'];(function(_0x52de80,_0x522f5b){var _0x18c05a=function(_0x369435){while(--_0x369435){_0x52de80['push'](_0x52de80['shift']());}};_0x18c05a(++_0x522f5b);}(_0x81cb,0xb6));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb81c('0x0'));var rimraf=require(_0xb81c('0x1'));var zipdir=require(_0xb81c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb81c('0x3'));var moment=require(_0xb81c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb81c('0x5'));var path=require(_0xb81c('0x6'));var sox=require(_0xb81c('0x7'));var csv=require('to-csv');var ejs=require(_0xb81c('0x8'));var fs=require('fs');var fs_extra=require(_0xb81c('0x9'));var _=require('lodash');var squel=require(_0xb81c('0xa'));var crypto=require('crypto');var jsforce=require(_0xb81c('0xb'));var deskjs=require(_0xb81c('0xc'));var toCsv=require(_0xb81c('0xd'));var querystring=require(_0xb81c('0xe'));var Papa=require('papaparse');var Redis=require(_0xb81c('0xf'));var authService=require(_0xb81c('0x10'));var qs=require(_0xb81c('0x11'));var as=require(_0xb81c('0x12'));var hardwareService=require(_0xb81c('0x13'));var logger=require(_0xb81c('0x14'))(_0xb81c('0x15'));var utils=require(_0xb81c('0x16'));var config=require(_0xb81c('0x17'));var licenseUtil=require(_0xb81c('0x18'));var db=require(_0xb81c('0x19'))['db'];function respondWithStatusCode(_0x59857a,_0x59e50f){_0x59e50f=_0x59e50f||0xcc;return function(_0x891426){if(_0x891426){return _0x59857a[_0xb81c('0x1a')](_0x59e50f);}return _0x59857a[_0xb81c('0x1b')](_0x59e50f)['end']();};}function respondWithResult(_0x3a7a25,_0x2c4162){_0x2c4162=_0x2c4162||0xc8;return function(_0x5ed68b){if(_0x5ed68b){return _0x3a7a25[_0xb81c('0x1b')](_0x2c4162)[_0xb81c('0x1c')](_0x5ed68b);}};}function respondWithFilteredResult(_0x170bbe,_0x463a8b){return function(_0x46302d){if(_0x46302d){var _0x36edee=typeof _0x463a8b[_0xb81c('0x1d')]===_0xb81c('0x1e')&&typeof _0x463a8b[_0xb81c('0x1f')]===_0xb81c('0x1e');var _0x1f1938=_0x46302d['count'];var _0x2c23a6=_0x36edee?0x0:_0x463a8b[_0xb81c('0x1d')];var _0x52f020=_0x36edee?_0x46302d[_0xb81c('0x20')]:_0x463a8b[_0xb81c('0x1d')]+_0x463a8b[_0xb81c('0x1f')];var _0x4f2097;if(_0x52f020>=_0x1f1938){_0x52f020=_0x1f1938;_0x4f2097=0xc8;}else{_0x4f2097=0xce;}_0x170bbe['status'](_0x4f2097);return _0x170bbe[_0xb81c('0x21')]('Content-Range',_0x2c23a6+'-'+_0x52f020+'/'+_0x1f1938)[_0xb81c('0x1c')](_0x46302d);}return null;};}function patchUpdates(_0x509bde){return function(_0x45058c){try{jsonpatch[_0xb81c('0x22')](_0x45058c,_0x509bde,!![]);}catch(_0x4298d7){return BPromise[_0xb81c('0x23')](_0x4298d7);}return _0x45058c[_0xb81c('0x24')]();};}function saveUpdates(_0x4d4957,_0x229fd6){return function(_0x47d467){if(_0x47d467){return _0x47d467[_0xb81c('0x25')](_0x4d4957)[_0xb81c('0x26')](function(_0xa3914f){return _0xa3914f;});}return null;};}function removeEntity(_0x36aa99,_0x1553b3){return function(_0xd56bd8){if(_0xd56bd8){return _0xd56bd8['destroy']()[_0xb81c('0x26')](function(){_0x36aa99['status'](0xcc)[_0xb81c('0x27')]();});}};}function handleEntityNotFound(_0x1d2131,_0x2da250){return function(_0x440643){if(!_0x440643){_0x1d2131[_0xb81c('0x1a')](0x194);}return _0x440643;};}function handleError(_0x38736d,_0x5c4a1e){_0x5c4a1e=_0x5c4a1e||0x1f4;return function(_0x49ccd0){logger[_0xb81c('0x28')](_0x49ccd0['stack']);if(_0x49ccd0[_0xb81c('0x29')]){delete _0x49ccd0['name'];}_0x38736d[_0xb81c('0x1b')](_0x5c4a1e)[_0xb81c('0x2a')](_0x49ccd0);};}exports['index']=function(_0x3ab788,_0x46cac1){var _0x121ceb={},_0x2292e5={},_0x15aceb={'count':0x0,'rows':[]};var _0x5b04a1=_[_0xb81c('0x2b')](db[_0xb81c('0x2c')][_0xb81c('0x2d')],function(_0x4075a3){return{'name':_0x4075a3['fieldName'],'type':_0x4075a3[_0xb81c('0x2e')][_0xb81c('0x2f')]};});_0x2292e5[_0xb81c('0x30')]=_[_0xb81c('0x2b')](_0x5b04a1,_0xb81c('0x29'));_0x2292e5[_0xb81c('0x31')]=_[_0xb81c('0x32')](_0x3ab788[_0xb81c('0x31')]);_0x2292e5[_0xb81c('0x33')]=_['intersection'](_0x2292e5[_0xb81c('0x30')],_0x2292e5['query']);_0x121ceb['attributes']=_[_0xb81c('0x34')](_0x2292e5[_0xb81c('0x30')],qs['fields'](_0x3ab788[_0xb81c('0x31')]['fields']));_0x121ceb[_0xb81c('0x35')]=_0x121ceb[_0xb81c('0x35')][_0xb81c('0x36')]?_0x121ceb[_0xb81c('0x35')]:_0x2292e5[_0xb81c('0x30')];if(!_0x3ab788[_0xb81c('0x31')][_0xb81c('0x37')](_0xb81c('0x38'))){_0x121ceb[_0xb81c('0x1f')]=qs[_0xb81c('0x1f')](_0x3ab788[_0xb81c('0x31')][_0xb81c('0x1f')]);_0x121ceb[_0xb81c('0x1d')]=qs[_0xb81c('0x1d')](_0x3ab788[_0xb81c('0x31')][_0xb81c('0x1d')]);}_0x121ceb[_0xb81c('0x39')]=qs[_0xb81c('0x3a')](_0x3ab788['query'][_0xb81c('0x3a')]);_0x121ceb[_0xb81c('0x3b')]=qs[_0xb81c('0x33')](_[_0xb81c('0x3c')](_0x3ab788[_0xb81c('0x31')],_0x2292e5[_0xb81c('0x33')]),_0x5b04a1);if(_0x3ab788[_0xb81c('0x31')]['filter']){_0x121ceb[_0xb81c('0x3b')]=_['merge'](_0x121ceb[_0xb81c('0x3b')],{'$or':_[_0xb81c('0x2b')](_0x5b04a1,function(_0x37cffa){if(_0x37cffa[_0xb81c('0x2e')]!==_0xb81c('0x3d')){var _0x3ac74f={};_0x3ac74f[_0x37cffa[_0xb81c('0x29')]]={'$like':'%'+_0x3ab788[_0xb81c('0x31')][_0xb81c('0x3e')]+'%'};return _0x3ac74f;}})});}_0x121ceb=_[_0xb81c('0x3f')]({},_0x121ceb,_0x3ab788['options']);var _0x513343={'where':_0x121ceb[_0xb81c('0x3b')]};return db[_0xb81c('0x2c')][_0xb81c('0x20')](_0x513343)[_0xb81c('0x26')](function(_0x29469d){_0x15aceb['count']=_0x29469d;if(_0x3ab788[_0xb81c('0x31')][_0xb81c('0x40')]){_0x121ceb['include']=[{'all':!![]}];}return db[_0xb81c('0x2c')]['findAll'](_0x121ceb);})[_0xb81c('0x26')](function(_0x67f917){_0x15aceb[_0xb81c('0x41')]=_0x67f917;return _0x15aceb;})[_0xb81c('0x26')](respondWithFilteredResult(_0x46cac1,_0x121ceb))['catch'](handleError(_0x46cac1,null));};exports['show']=function(_0xbb2b89,_0x2ecd59){var _0x510765={'raw':!![],'where':{'id':_0xbb2b89[_0xb81c('0x42')]['id']}},_0x264bbd={};_0x264bbd[_0xb81c('0x30')]=_[_0xb81c('0x32')](db['OpenchannelApplication'][_0xb81c('0x2d')]);_0x264bbd['query']=_['keys'](_0xbb2b89[_0xb81c('0x31')]);_0x264bbd['filters']=_['intersection'](_0x264bbd[_0xb81c('0x30')],_0x264bbd[_0xb81c('0x31')]);_0x510765[_0xb81c('0x35')]=_[_0xb81c('0x34')](_0x264bbd[_0xb81c('0x30')],qs[_0xb81c('0x43')](_0xbb2b89[_0xb81c('0x31')][_0xb81c('0x43')]));_0x510765[_0xb81c('0x35')]=_0x510765[_0xb81c('0x35')]['length']?_0x510765[_0xb81c('0x35')]:_0x264bbd[_0xb81c('0x30')];if(_0xbb2b89['query']['includeAll']){_0x510765[_0xb81c('0x44')]=[{'all':!![]}];}_0x510765=_[_0xb81c('0x3f')]({},_0x510765,_0xbb2b89[_0xb81c('0x45')]);return db[_0xb81c('0x2c')][_0xb81c('0x46')](_0x510765)[_0xb81c('0x26')](handleEntityNotFound(_0x2ecd59,null))['then'](respondWithResult(_0x2ecd59,null))[_0xb81c('0x47')](handleError(_0x2ecd59,null));};exports['create']=function(_0x3f5d12,_0x3e17c0){return db[_0xb81c('0x2c')][_0xb81c('0x48')](_0x3f5d12['body'],{})[_0xb81c('0x26')](respondWithResult(_0x3e17c0,0xc9))[_0xb81c('0x47')](handleError(_0x3e17c0,null));};exports[_0xb81c('0x25')]=function(_0x1149ae,_0x2f0da8){if(_0x1149ae[_0xb81c('0x49')]['id']){delete _0x1149ae[_0xb81c('0x49')]['id'];}return db['OpenchannelApplication'][_0xb81c('0x46')]({'where':{'id':_0x1149ae['params']['id']}})[_0xb81c('0x26')](handleEntityNotFound(_0x2f0da8,null))['then'](saveUpdates(_0x1149ae['body'],null))[_0xb81c('0x26')](respondWithResult(_0x2f0da8,null))['catch'](handleError(_0x2f0da8,null));};exports[_0xb81c('0x4a')]=function(_0x60dcce,_0x4e594f){return db[_0xb81c('0x2c')][_0xb81c('0x46')]({'where':{'id':_0x60dcce[_0xb81c('0x42')]['id']}})[_0xb81c('0x26')](handleEntityNotFound(_0x4e594f,null))[_0xb81c('0x26')](removeEntity(_0x4e594f,null))[_0xb81c('0x47')](handleError(_0x4e594f,null));}; \ No newline at end of file +var _0xd57f=['send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','eml-format','zip-dir','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd57f,0x185));var _0xfd57=function(_0x550c79,_0x2f7801){_0x550c79=_0x550c79-0x0;var _0x53a2fe=_0xd57f[_0x550c79];return _0x53a2fe;};'use strict';var emlformat=require(_0xfd57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd57('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfd57('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfd57('0x3'));var util=require('util');var path=require(_0xfd57('0x4'));var sox=require(_0xfd57('0x5'));var csv=require(_0xfd57('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd57('0x7'));var _=require('lodash');var squel=require(_0xfd57('0x8'));var crypto=require(_0xfd57('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfd57('0xa'));var toCsv=require(_0xfd57('0x6'));var querystring=require(_0xfd57('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfd57('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd57('0xd'));var logger=require(_0xfd57('0xe'))(_0xfd57('0xf'));var utils=require(_0xfd57('0x10'));var config=require(_0xfd57('0x11'));var licenseUtil=require(_0xfd57('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x553841,_0x452989){_0x452989=_0x452989||0xcc;return function(_0x1779c8){if(_0x1779c8){return _0x553841[_0xfd57('0x13')](_0x452989);}return _0x553841[_0xfd57('0x14')](_0x452989)['end']();};}function respondWithResult(_0x31daf3,_0x38b70e){_0x38b70e=_0x38b70e||0xc8;return function(_0x301c3b){if(_0x301c3b){return _0x31daf3[_0xfd57('0x14')](_0x38b70e)[_0xfd57('0x15')](_0x301c3b);}};}function respondWithFilteredResult(_0x216d6b,_0x36789f){return function(_0x243839){if(_0x243839){var _0x1653eb=typeof _0x36789f[_0xfd57('0x16')]===_0xfd57('0x17')&&typeof _0x36789f[_0xfd57('0x18')]===_0xfd57('0x17');var _0x2e954e=_0x243839['count'];var _0x4db100=_0x1653eb?0x0:_0x36789f[_0xfd57('0x16')];var _0x5ffed6=_0x1653eb?_0x243839[_0xfd57('0x19')]:_0x36789f[_0xfd57('0x16')]+_0x36789f[_0xfd57('0x18')];var _0x24c8a8;if(_0x5ffed6>=_0x2e954e){_0x5ffed6=_0x2e954e;_0x24c8a8=0xc8;}else{_0x24c8a8=0xce;}_0x216d6b[_0xfd57('0x14')](_0x24c8a8);return _0x216d6b[_0xfd57('0x1a')](_0xfd57('0x1b'),_0x4db100+'-'+_0x5ffed6+'/'+_0x2e954e)[_0xfd57('0x15')](_0x243839);}return null;};}function patchUpdates(_0x13be89){return function(_0x1b0f0d){try{jsonpatch[_0xfd57('0x1c')](_0x1b0f0d,_0x13be89,!![]);}catch(_0x21f333){return BPromise[_0xfd57('0x1d')](_0x21f333);}return _0x1b0f0d[_0xfd57('0x1e')]();};}function saveUpdates(_0x397fd1,_0x52c190){return function(_0x40ff54){if(_0x40ff54){return _0x40ff54['update'](_0x397fd1)[_0xfd57('0x1f')](function(_0x27279f){return _0x27279f;});}return null;};}function removeEntity(_0x4e9bb4,_0xd5215c){return function(_0x4cf2c0){if(_0x4cf2c0){return _0x4cf2c0[_0xfd57('0x20')]()['then'](function(){_0x4e9bb4['status'](0xcc)[_0xfd57('0x21')]();});}};}function handleEntityNotFound(_0x143845,_0x5cc87c){return function(_0x411ae7){if(!_0x411ae7){_0x143845['sendStatus'](0x194);}return _0x411ae7;};}function handleError(_0x460d5d,_0x3cfd9d){_0x3cfd9d=_0x3cfd9d||0x1f4;return function(_0xb1c22d){logger[_0xfd57('0x22')](_0xb1c22d[_0xfd57('0x23')]);if(_0xb1c22d[_0xfd57('0x24')]){delete _0xb1c22d['name'];}_0x460d5d['status'](_0x3cfd9d)[_0xfd57('0x25')](_0xb1c22d);};}exports[_0xfd57('0x26')]=function(_0x2555a6,_0x43baca){var _0xa6e0fb={},_0x167b79={},_0x591254={'count':0x0,'rows':[]};var _0x485116=_[_0xfd57('0x27')](db[_0xfd57('0x28')][_0xfd57('0x29')],function(_0xdb18f3){return{'name':_0xdb18f3['fieldName'],'type':_0xdb18f3[_0xfd57('0x2a')][_0xfd57('0x2b')]};});_0x167b79[_0xfd57('0x2c')]=_[_0xfd57('0x27')](_0x485116,_0xfd57('0x24'));_0x167b79[_0xfd57('0x2d')]=_['keys'](_0x2555a6[_0xfd57('0x2d')]);_0x167b79[_0xfd57('0x2e')]=_[_0xfd57('0x2f')](_0x167b79['model'],_0x167b79[_0xfd57('0x2d')]);_0xa6e0fb[_0xfd57('0x30')]=_[_0xfd57('0x2f')](_0x167b79[_0xfd57('0x2c')],qs['fields'](_0x2555a6[_0xfd57('0x2d')][_0xfd57('0x31')]));_0xa6e0fb[_0xfd57('0x30')]=_0xa6e0fb[_0xfd57('0x30')][_0xfd57('0x32')]?_0xa6e0fb[_0xfd57('0x30')]:_0x167b79[_0xfd57('0x2c')];if(!_0x2555a6['query'][_0xfd57('0x33')]('nolimit')){_0xa6e0fb[_0xfd57('0x18')]=qs[_0xfd57('0x18')](_0x2555a6[_0xfd57('0x2d')][_0xfd57('0x18')]);_0xa6e0fb['offset']=qs[_0xfd57('0x16')](_0x2555a6['query'][_0xfd57('0x16')]);}_0xa6e0fb[_0xfd57('0x34')]=qs[_0xfd57('0x35')](_0x2555a6[_0xfd57('0x2d')][_0xfd57('0x35')]);_0xa6e0fb[_0xfd57('0x36')]=qs['filters'](_[_0xfd57('0x37')](_0x2555a6['query'],_0x167b79['filters']),_0x485116);if(_0x2555a6[_0xfd57('0x2d')]['filter']){_0xa6e0fb[_0xfd57('0x36')]=_[_0xfd57('0x38')](_0xa6e0fb[_0xfd57('0x36')],{'$or':_['map'](_0x485116,function(_0x1bc8ab){if(_0x1bc8ab[_0xfd57('0x2a')]!==_0xfd57('0x39')){var _0xd43e72={};_0xd43e72[_0x1bc8ab['name']]={'$like':'%'+_0x2555a6[_0xfd57('0x2d')][_0xfd57('0x3a')]+'%'};return _0xd43e72;}})});}_0xa6e0fb=_[_0xfd57('0x38')]({},_0xa6e0fb,_0x2555a6[_0xfd57('0x3b')]);var _0x3a0d57={'where':_0xa6e0fb[_0xfd57('0x36')]};return db[_0xfd57('0x28')][_0xfd57('0x19')](_0x3a0d57)[_0xfd57('0x1f')](function(_0x2a1334){_0x591254[_0xfd57('0x19')]=_0x2a1334;if(_0x2555a6[_0xfd57('0x2d')][_0xfd57('0x3c')]){_0xa6e0fb[_0xfd57('0x3d')]=[{'all':!![]}];}return db[_0xfd57('0x28')]['findAll'](_0xa6e0fb);})['then'](function(_0x23c803){_0x591254[_0xfd57('0x3e')]=_0x23c803;return _0x591254;})[_0xfd57('0x1f')](respondWithFilteredResult(_0x43baca,_0xa6e0fb))[_0xfd57('0x3f')](handleError(_0x43baca,null));};exports[_0xfd57('0x40')]=function(_0x25b3a7,_0x4206b1){var _0x46194d={'raw':!![],'where':{'id':_0x25b3a7[_0xfd57('0x41')]['id']}},_0x8cdcc0={};_0x8cdcc0[_0xfd57('0x2c')]=_[_0xfd57('0x42')](db[_0xfd57('0x28')]['rawAttributes']);_0x8cdcc0['query']=_[_0xfd57('0x42')](_0x25b3a7['query']);_0x8cdcc0[_0xfd57('0x2e')]=_[_0xfd57('0x2f')](_0x8cdcc0[_0xfd57('0x2c')],_0x8cdcc0[_0xfd57('0x2d')]);_0x46194d[_0xfd57('0x30')]=_[_0xfd57('0x2f')](_0x8cdcc0[_0xfd57('0x2c')],qs['fields'](_0x25b3a7[_0xfd57('0x2d')][_0xfd57('0x31')]));_0x46194d[_0xfd57('0x30')]=_0x46194d[_0xfd57('0x30')][_0xfd57('0x32')]?_0x46194d[_0xfd57('0x30')]:_0x8cdcc0['model'];if(_0x25b3a7[_0xfd57('0x2d')][_0xfd57('0x3c')]){_0x46194d[_0xfd57('0x3d')]=[{'all':!![]}];}_0x46194d=_['merge']({},_0x46194d,_0x25b3a7['options']);return db[_0xfd57('0x28')][_0xfd57('0x43')](_0x46194d)['then'](handleEntityNotFound(_0x4206b1,null))['then'](respondWithResult(_0x4206b1,null))[_0xfd57('0x3f')](handleError(_0x4206b1,null));};exports[_0xfd57('0x44')]=function(_0x19c08d,_0x26a7c4){return db['OpenchannelApplication'][_0xfd57('0x44')](_0x19c08d[_0xfd57('0x45')],{})[_0xfd57('0x1f')](respondWithResult(_0x26a7c4,0xc9))['catch'](handleError(_0x26a7c4,null));};exports[_0xfd57('0x46')]=function(_0x13b919,_0x37747f){if(_0x13b919[_0xfd57('0x45')]['id']){delete _0x13b919[_0xfd57('0x45')]['id'];}return db['OpenchannelApplication'][_0xfd57('0x43')]({'where':{'id':_0x13b919[_0xfd57('0x41')]['id']}})[_0xfd57('0x1f')](handleEntityNotFound(_0x37747f,null))[_0xfd57('0x1f')](saveUpdates(_0x13b919['body'],null))[_0xfd57('0x1f')](respondWithResult(_0x37747f,null))['catch'](handleError(_0x37747f,null));};exports[_0xfd57('0x20')]=function(_0x557f97,_0x3243ef){return db['OpenchannelApplication'][_0xfd57('0x43')]({'where':{'id':_0x557f97['params']['id']}})[_0xfd57('0x1f')](handleEntityNotFound(_0x3243ef,null))[_0xfd57('0x1f')](removeEntity(_0x3243ef,null))[_0xfd57('0x3f')](handleError(_0x3243ef,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c39b60e..1f37ef2 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 _0x9c9c=['OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define'];(function(_0x32fe02,_0x5e75b6){var _0xac08aa=function(_0x395b15){while(--_0x395b15){_0x32fe02['push'](_0x32fe02['shift']());}};_0xac08aa(++_0x5e75b6);}(_0x9c9c,0xc3));var _0xc9c9=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x9c9c[_0x2f0057];return _0x17f2c3;};'use strict';var _=require(_0xc9c9('0x0'));var util=require(_0xc9c9('0x1'));var logger=require(_0xc9c9('0x2'))(_0xc9c9('0x3'));var moment=require(_0xc9c9('0x4'));var BPromise=require(_0xc9c9('0x5'));var rp=require(_0xc9c9('0x6'));var fs=require('fs');var path=require(_0xc9c9('0x7'));var rimraf=require(_0xc9c9('0x8'));var config=require(_0xc9c9('0x9'));var attributes=require(_0xc9c9('0xa'));module[_0xc9c9('0xb')]=function(_0x3b9104,_0x230268){return _0x3b9104[_0xc9c9('0xc')](_0xc9c9('0xd'),attributes,{'tableName':_0xc9c9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc9c9('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x92c5=['request-promise','path','rimraf','./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x201b6e,_0x1452f5){var _0x35d54c=function(_0x1f291d){while(--_0x1f291d){_0x201b6e['push'](_0x201b6e['shift']());}};_0x35d54c(++_0x1452f5);}(_0x92c5,0x1a9));var _0x592c=function(_0x309bc8,_0x117ddc){_0x309bc8=_0x309bc8-0x0;var _0x4bd9e9=_0x92c5[_0x309bc8];return _0x4bd9e9;};'use strict';var _=require(_0x592c('0x0'));var util=require('util');var logger=require(_0x592c('0x1'))(_0x592c('0x2'));var moment=require(_0x592c('0x3'));var BPromise=require('bluebird');var rp=require(_0x592c('0x4'));var fs=require('fs');var path=require(_0x592c('0x5'));var rimraf=require(_0x592c('0x6'));var config=require('../../config/environment');var attributes=require(_0x592c('0x7'));module['exports']=function(_0x245931,_0x10b8be){return _0x245931['define'](_0x592c('0x8'),attributes,{'tableName':_0x592c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x592c('0xa')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 4c06a58..ceda664 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 _0x154c=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','stringify','lodash','util'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x154c,0xac));var _0xc154=function(_0x480ee3,_0x4ce5b6){_0x480ee3=_0x480ee3-0x0;var _0x378987=_0x154c[_0x480ee3];return _0x378987;};'use strict';var _=require(_0xc154('0x0'));var util=require(_0xc154('0x1'));var moment=require(_0xc154('0x2'));var BPromise=require(_0xc154('0x3'));var rs=require(_0xc154('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc154('0x5'));var logger=require('../../config/logger')(_0xc154('0x6'));var config=require(_0xc154('0x7'));var jayson=require(_0xc154('0x8'));var client=jayson[_0xc154('0x9')][_0xc154('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a5202,_0x5952a5,_0x32b301){return new BPromise(function(_0x34aa3b,_0x436a23){return client[_0xc154('0xb')](_0x5a5202,_0x32b301)[_0xc154('0xc')](function(_0x19f1ff){logger['info'](_0xc154('0xd'),_0x5952a5,_0xc154('0xe'));logger[_0xc154('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5952a5,'request\x20sent',JSON['stringify'](_0x19f1ff));if(_0x19f1ff[_0xc154('0x10')]){if(_0x19f1ff[_0xc154('0x10')]['code']===0x1f4){logger[_0xc154('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x5952a5,_0x19f1ff[_0xc154('0x10')]['message']);return _0x436a23(_0x19f1ff[_0xc154('0x10')]['message']);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x5952a5,_0x19f1ff[_0xc154('0x10')][_0xc154('0x11')]);return _0x34aa3b(_0x19f1ff['error'][_0xc154('0x11')]);}else{logger[_0xc154('0x12')](_0xc154('0xd'),_0x5952a5,_0xc154('0xe'));_0x34aa3b(_0x19f1ff['result'][_0xc154('0x11')]);}})[_0xc154('0x13')](function(_0x195f7f){logger[_0xc154('0x10')](_0xc154('0xd'),_0x5952a5,_0x195f7f);_0x436a23(_0x195f7f);});});}exports[_0xc154('0x14')]=function(_0x3c2bac){var _0x442e5d=this;return new Promise(function(_0x1ce567,_0x3a92de){return db[_0xc154('0x15')][_0xc154('0x16')](_0x3c2bac[_0xc154('0x17')],{'raw':_0x3c2bac[_0xc154('0x18')]?_0x3c2bac['options'][_0xc154('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c2bac[_0xc154('0x18')]?_0x3c2bac[_0xc154('0x18')]['where']||null:null,'attributes':_0x3c2bac[_0xc154('0x18')]?_0x3c2bac[_0xc154('0x18')][_0xc154('0x1a')]||null:null,'limit':_0x3c2bac[_0xc154('0x18')]?_0x3c2bac['options'][_0xc154('0x1b')]||null:null})['then'](function(_0x15a0bb){logger['info'](_0xc154('0x14'),_0x3c2bac);logger[_0xc154('0xf')]('UpdateOpenchannelApplication',_0x3c2bac,JSON[_0xc154('0x1c')](_0x15a0bb));_0x1ce567(_0x15a0bb);})['catch'](function(_0x27848b){logger[_0xc154('0x10')](_0xc154('0x14'),_0x27848b[_0xc154('0x11')],_0x3c2bac);_0x3a92de(_0x442e5d['error'](0x1f4,_0x27848b[_0xc154('0x11')]));});});}; \ No newline at end of file +var _0xeee2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','lodash'];(function(_0x250a70,_0x501d75){var _0x1d99b6=function(_0x5c30b4){while(--_0x5c30b4){_0x250a70['push'](_0x250a70['shift']());}};_0x1d99b6(++_0x501d75);}(_0xeee2,0x11f));var _0x2eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2eee('0x0'));var util=require('util');var moment=require(_0x2eee('0x1'));var BPromise=require(_0x2eee('0x2'));var rs=require(_0x2eee('0x3'));var fs=require('fs');var Redis=require(_0x2eee('0x4'));var db=require(_0x2eee('0x5'))['db'];var utils=require(_0x2eee('0x6'));var logger=require(_0x2eee('0x7'))('rpc');var config=require(_0x2eee('0x8'));var jayson=require(_0x2eee('0x9'));var client=jayson[_0x2eee('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c75e3,_0x48c0c6,_0x57206d){return new BPromise(function(_0x419ae2,_0x156705){return client[_0x2eee('0xb')](_0x2c75e3,_0x57206d)[_0x2eee('0xc')](function(_0x59989a){logger[_0x2eee('0xd')](_0x2eee('0xe'),_0x48c0c6,_0x2eee('0xf'));logger[_0x2eee('0x10')](_0x2eee('0x11'),_0x48c0c6,_0x2eee('0xf'),JSON[_0x2eee('0x12')](_0x59989a));if(_0x59989a[_0x2eee('0x13')]){if(_0x59989a['error'][_0x2eee('0x14')]===0x1f4){logger[_0x2eee('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x48c0c6,_0x59989a[_0x2eee('0x13')][_0x2eee('0x15')]);return _0x156705(_0x59989a[_0x2eee('0x13')][_0x2eee('0x15')]);}logger[_0x2eee('0x13')](_0x2eee('0xe'),_0x48c0c6,_0x59989a[_0x2eee('0x13')][_0x2eee('0x15')]);return _0x419ae2(_0x59989a[_0x2eee('0x13')]['message']);}else{logger[_0x2eee('0xd')](_0x2eee('0xe'),_0x48c0c6,'request\x20sent');_0x419ae2(_0x59989a[_0x2eee('0x16')][_0x2eee('0x15')]);}})[_0x2eee('0x17')](function(_0x73a159){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x48c0c6,_0x73a159);_0x156705(_0x73a159);});});}exports[_0x2eee('0x18')]=function(_0x2b8e91){var _0x5bf368=this;return new Promise(function(_0xa0f8ed,_0x1408a2){return db[_0x2eee('0x19')][_0x2eee('0x1a')](_0x2b8e91['body'],{'raw':_0x2b8e91[_0x2eee('0x1b')]?_0x2b8e91['options'][_0x2eee('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b8e91[_0x2eee('0x1b')]?_0x2b8e91[_0x2eee('0x1b')][_0x2eee('0x1d')]||null:null,'attributes':_0x2b8e91[_0x2eee('0x1b')]?_0x2b8e91[_0x2eee('0x1b')][_0x2eee('0x1e')]||null:null,'limit':_0x2b8e91[_0x2eee('0x1b')]?_0x2b8e91[_0x2eee('0x1b')][_0x2eee('0x1f')]||null:null})['then'](function(_0x4ef5ba){logger[_0x2eee('0xd')](_0x2eee('0x18'),_0x2b8e91);logger['debug']('UpdateOpenchannelApplication',_0x2b8e91,JSON['stringify'](_0x4ef5ba));_0xa0f8ed(_0x4ef5ba);})[_0x2eee('0x17')](function(_0x19c91d){logger[_0x2eee('0x13')]('UpdateOpenchannelApplication',_0x19c91d[_0x2eee('0x15')],_0x2b8e91);_0x1408a2(_0x5bf368[_0x2eee('0x13')](0x1f4,_0x19c91d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index f648d57..53c9a7d 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 _0xdafe=['/describe','describe','/:id/messages','/:id/download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','/:id','openchannelinteraction:destroy','removeTags','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated'];(function(_0x33bb07,_0x5b1849){var _0x481c81=function(_0x1709f0){while(--_0x1709f0){_0x33bb07['push'](_0x33bb07['shift']());}};_0x481c81(++_0x5b1849);}(_0xdafe,0x1ed));var _0xedaf=function(_0xea2bbc,_0x125927){_0xea2bbc=_0xea2bbc-0x0;var _0x2fa1d8=_0xdafe[_0xea2bbc];return _0x2fa1d8;};'use strict';var multer=require('multer');var util=require(_0xedaf('0x0'));var path=require(_0xedaf('0x1'));var timeout=require(_0xedaf('0x2'));var express=require(_0xedaf('0x3'));var router=express['Router']();var fs_extra=require(_0xedaf('0x4'));var auth=require(_0xedaf('0x5'));var interaction=require(_0xedaf('0x6'));var config=require(_0xedaf('0x7'));var controller=require(_0xedaf('0x8'));router[_0xedaf('0x9')]('/',auth[_0xedaf('0xa')](),controller['index']);router[_0xedaf('0x9')](_0xedaf('0xb'),auth[_0xedaf('0xa')](),controller[_0xedaf('0xc')]);router[_0xedaf('0x9')]('/:id',auth[_0xedaf('0xa')](),controller['show']);router[_0xedaf('0x9')](_0xedaf('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xedaf('0x9')](_0xedaf('0xe'),auth['isAuthenticated'](),controller['download']);router[_0xedaf('0xf')]('/',auth[_0xedaf('0xa')](),controller['create']);router[_0xedaf('0xf')](_0xedaf('0xd'),auth[_0xedaf('0xa')](),controller[_0xedaf('0x10')]);router[_0xedaf('0xf')](_0xedaf('0x11'),auth[_0xedaf('0xa')](),interaction[_0xedaf('0x12')](_0xedaf('0x13'),_0xedaf('0x14')),controller[_0xedaf('0x15')]);router[_0xedaf('0x16')]('/:id',auth[_0xedaf('0xa')](),interaction[_0xedaf('0x12')](_0xedaf('0x13'),_0xedaf('0x17')),controller['update']);router[_0xedaf('0x18')](_0xedaf('0x19'),auth[_0xedaf('0xa')](),interaction['tracked'](_0xedaf('0x13'),_0xedaf('0x1a')),controller['destroy']);router[_0xedaf('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0xedaf('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x40bb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannel','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router'];(function(_0x17bfc6,_0x57be27){var _0x19fedc=function(_0xafea29){while(--_0xafea29){_0x17bfc6['push'](_0x17bfc6['shift']());}};_0x19fedc(++_0x57be27);}(_0x40bb,0x12d));var _0xb40b=function(_0x42e9d9,_0x1da4f6){_0x42e9d9=_0x42e9d9-0x0;var _0x59c3e4=_0x40bb[_0x42e9d9];return _0x59c3e4;};'use strict';var multer=require('multer');var util=require(_0xb40b('0x0'));var path=require(_0xb40b('0x1'));var timeout=require(_0xb40b('0x2'));var express=require(_0xb40b('0x3'));var router=express[_0xb40b('0x4')]();var fs_extra=require(_0xb40b('0x5'));var auth=require(_0xb40b('0x6'));var interaction=require(_0xb40b('0x7'));var config=require(_0xb40b('0x8'));var controller=require(_0xb40b('0x9'));router[_0xb40b('0xa')]('/',auth[_0xb40b('0xb')](),controller[_0xb40b('0xc')]);router[_0xb40b('0xa')](_0xb40b('0xd'),auth['isAuthenticated'](),controller[_0xb40b('0xe')]);router[_0xb40b('0xa')](_0xb40b('0xf'),auth['isAuthenticated'](),controller[_0xb40b('0x10')]);router['get'](_0xb40b('0x11'),auth[_0xb40b('0xb')](),controller[_0xb40b('0x12')]);router[_0xb40b('0xa')](_0xb40b('0x13'),auth[_0xb40b('0xb')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xb40b('0x14')]);router[_0xb40b('0x15')](_0xb40b('0x11'),auth[_0xb40b('0xb')](),controller[_0xb40b('0x16')]);router['post'](_0xb40b('0x17'),auth[_0xb40b('0xb')](),interaction[_0xb40b('0x18')]('openchannel',_0xb40b('0x19')),controller[_0xb40b('0x1a')]);router['put'](_0xb40b('0xf'),auth[_0xb40b('0xb')](),interaction[_0xb40b('0x18')](_0xb40b('0x1b'),'openchannelinteraction:update'),controller[_0xb40b('0x1c')]);router[_0xb40b('0x1d')](_0xb40b('0xf'),auth[_0xb40b('0xb')](),interaction[_0xb40b('0x18')](_0xb40b('0x1b'),_0xb40b('0x1e')),controller[_0xb40b('0x1f')]);router['delete'](_0xb40b('0x17'),auth[_0xb40b('0xb')](),controller[_0xb40b('0x20')]);module[_0xb40b('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index fedbac3..79b9589 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 _0xdba6=['STRING','ENUM','INTEGER','sequelize','BOOLEAN','DATE'];(function(_0x3d2458,_0x369ae4){var _0x497934=function(_0xa99b0b){while(--_0xa99b0b){_0x3d2458['push'](_0x3d2458['shift']());}};_0x497934(++_0x369ae4);}(_0xdba6,0x14d));var _0x6dba=function(_0x52f0b5,_0x1e15ec){_0x52f0b5=_0x52f0b5-0x0;var _0x599695=_0xdba6[_0x52f0b5];return _0x599695;};'use strict';var Sequelize=require(_0x6dba('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6dba('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6dba('0x2')]},'disposition':{'type':Sequelize[_0x6dba('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6dba('0x3')]},'note':{'type':Sequelize[_0x6dba('0x3')]},'read1stAt':{'type':Sequelize[_0x6dba('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x6dba('0x3')]},'lastMsgAt':{'type':Sequelize[_0x6dba('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6dba('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6dba('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6dba('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x6dba('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6dba('0x5')]}}; \ No newline at end of file +var _0xc234=['DATE','out','exports','BOOLEAN','STRING'];(function(_0x5123a7,_0x2e10c9){var _0x21688b=function(_0x22fda6){while(--_0x22fda6){_0x5123a7['push'](_0x5123a7['shift']());}};_0x21688b(++_0x2e10c9);}(_0xc234,0x7f));var _0x4c23=function(_0x2222d9,_0x3293ff){_0x2222d9=_0x2222d9-0x0;var _0x3e08e3=_0xc234[_0x2222d9];return _0x3e08e3;};'use strict';var Sequelize=require('sequelize');module[_0x4c23('0x0')]={'closed':{'type':Sequelize[_0x4c23('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4c23('0x2')]},'secondDisposition':{'type':Sequelize[_0x4c23('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4c23('0x2')]},'note':{'type':Sequelize[_0x4c23('0x2')]},'read1stAt':{'type':Sequelize[_0x4c23('0x3')]},'threadId':{'type':Sequelize[_0x4c23('0x2')]},'externalUrl':{'type':Sequelize[_0x4c23('0x2')]},'lastMsgAt':{'type':Sequelize[_0x4c23('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4c23('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4c23('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4c23('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x4c23('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index c0283a2..b8f7ab0 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 _0x026a=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','color','emit','removeTags','find','download','unix','toString','join','root','files','tmp','attachments','User','fullname','push','firstName','lastName','Attachment','Messages','read','Account','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','createdAt','direction','out','System','Contact','secret','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','from','params','model','keys','filters','intersection','fields','attributes','length','merge','options','create','body','describe','addMessage','OpenchannelMessage','ids','omit','findOne','hasOwnProperty','sort','pick','where','OpenchannelInteractionId','filter'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x026a,0x138));var _0xa026=function(_0x1e4950,_0x5695b4){_0x1e4950=_0x1e4950-0x0;var _0x305ed4=_0x026a[_0x1e4950];return _0x305ed4;};'use strict';var rimraf=require(_0xa026('0x0'));var zipdir=require(_0xa026('0x1'));var moment=require(_0xa026('0x2'));var util=require(_0xa026('0x3'));var path=require('path');var ejs=require(_0xa026('0x4'));var fs=require('fs');var _=require(_0xa026('0x5'));var Redis=require(_0xa026('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xa026('0x7'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xa026('0x8'));var config=require('../../config/environment');var db=require(_0xa026('0x9'))['db'];config[_0xa026('0xa')]=_[_0xa026('0xb')](config[_0xa026('0xa')],{'host':_0xa026('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa026('0xa')]));require(_0xa026('0xd'))[_0xa026('0xe')](socket);function respondWithStatusCode(_0x2573b5,_0x141fb2){_0x141fb2=_0x141fb2||0xcc;return function(_0x5d69e9){if(_0x5d69e9){return _0x2573b5[_0xa026('0xf')](_0x141fb2);}return _0x2573b5[_0xa026('0x10')](_0x141fb2)[_0xa026('0x11')]();};}function respondWithResult(_0x10d01c,_0x32811c){_0x32811c=_0x32811c||0xc8;return function(_0x284fb7){if(_0x284fb7){return _0x10d01c[_0xa026('0x10')](_0x32811c)[_0xa026('0x12')](_0x284fb7);}};}function respondWithFilteredResult(_0x141544,_0x3e7a97){return function(_0x3ddf9a){if(_0x3ddf9a){var _0x3bcf78=typeof _0x3e7a97['offset']==='undefined'&&typeof _0x3e7a97[_0xa026('0x13')]==='undefined';var _0x26ede0=_0x3ddf9a[_0xa026('0x14')];var _0x35332f=_0x3bcf78?0x0:_0x3e7a97['offset'];var _0x343de2=_0x3bcf78?_0x3ddf9a[_0xa026('0x14')]:_0x3e7a97[_0xa026('0x15')]+_0x3e7a97[_0xa026('0x13')];var _0x5d400c;if(_0x343de2>=_0x26ede0){_0x343de2=_0x26ede0;_0x5d400c=0xc8;}else{_0x5d400c=0xce;}_0x141544[_0xa026('0x10')](_0x5d400c);return _0x141544[_0xa026('0x16')](_0xa026('0x17'),_0x35332f+'-'+_0x343de2+'/'+_0x26ede0)[_0xa026('0x12')](_0x3ddf9a);}return null;};}function saveUpdates(_0x1d109e){return function(_0x8ef943){if(_0x8ef943){return _0x8ef943[_0xa026('0x18')](_0x1d109e)[_0xa026('0x19')](function(_0x1014fc){return _0x1014fc;});}return null;};}function removeEntity(_0xb9beae){return function(_0x40c9d8){if(_0x40c9d8){return _0x40c9d8[_0xa026('0x1a')]()[_0xa026('0x19')](function(){_0xb9beae[_0xa026('0x10')](0xcc)[_0xa026('0x11')]();});}};}function handleEntityNotFound(_0x2aff11){return function(_0x2fb17d){if(!_0x2fb17d){_0x2aff11['sendStatus'](0x194);}return _0x2fb17d;};}function handleError(_0x4267b5,_0x3c73ef){_0x3c73ef=_0x3c73ef||0x1f4;return function(_0x1e33d2){logger[_0xa026('0x1b')](_0x1e33d2[_0xa026('0x1c')]);if(_0x1e33d2[_0xa026('0x1d')]){delete _0x1e33d2[_0xa026('0x1d')];}_0x4267b5[_0xa026('0x10')](_0x3c73ef)[_0xa026('0x1e')](_0x1e33d2);};}exports[_0xa026('0x1f')]=function(_0xca72a3,_0x39bbbb){var _0x3f5567={};var _0x34356d=_[_0xa026('0x20')](db[_0xa026('0x21')][_0xa026('0x22')],function(_0x3a673d){return{'name':_0x3a673d[_0xa026('0x23')],'type':_0x3a673d[_0xa026('0x24')][_0xa026('0x25')]};});_0x3f5567=qs[_0xa026('0x26')](_0x34356d,_0xca72a3);return interaction[_0xa026('0x27')](_0xa026('0x28'),_0xca72a3[_0xa026('0x29')],_0xca72a3[_0xa026('0x2a')],_0x3f5567,_0x34356d)['then'](respondWithFilteredResult(_0x39bbbb,_0x3f5567))[_0xa026('0x2b')](handleError(_0x39bbbb,null));};exports['show']=function(_0x37c2ca,_0x1a494e){var _0x53352a={};if(_0x37c2ca[_0xa026('0x29')][_0xa026('0x24')]&&_0x37c2ca[_0xa026('0x29')][_0xa026('0x24')]===_0xa026('0x2c')){_0x53352a[_0xa026('0x2c')]=_0x37c2ca['params']['id'];}else{_0x53352a['id']=_0x37c2ca[_0xa026('0x2d')]['id'];}var _0x49a64e={'raw':![],'where':_0x53352a},_0x4c4236={};_0x4c4236[_0xa026('0x2e')]=_[_0xa026('0x2f')](db[_0xa026('0x21')]['rawAttributes']);_0x4c4236[_0xa026('0x29')]=_['keys'](_0x37c2ca[_0xa026('0x29')]);_0x4c4236[_0xa026('0x30')]=_[_0xa026('0x31')](_0x4c4236[_0xa026('0x2e')],_0x4c4236[_0xa026('0x29')]);_0x49a64e['attributes']=_['intersection'](_0x4c4236[_0xa026('0x2e')],qs[_0xa026('0x32')](_0x37c2ca[_0xa026('0x29')]['fields']));_0x49a64e[_0xa026('0x33')]=_0x49a64e[_0xa026('0x33')][_0xa026('0x34')]?_0x49a64e[_0xa026('0x33')]:_0x4c4236[_0xa026('0x2e')];if(_0x37c2ca[_0xa026('0x29')]['includeAll']){_0x49a64e['include']=[{'all':!![]}];}_0x49a64e=_[_0xa026('0x35')]({},_0x49a64e,_0x37c2ca[_0xa026('0x36')]);return db[_0xa026('0x21')]['find'](_0x49a64e)[_0xa026('0x19')](handleEntityNotFound(_0x1a494e,null))[_0xa026('0x19')](respondWithResult(_0x1a494e,null))[_0xa026('0x2b')](handleError(_0x1a494e,null));};exports[_0xa026('0x37')]=function(_0x20f893,_0x35ede7){return db['OpenchannelInteraction']['create'](_0x20f893['body'],{})[_0xa026('0x19')](respondWithResult(_0x35ede7,0xc9))[_0xa026('0x2b')](handleError(_0x35ede7,null));};exports[_0xa026('0x18')]=function(_0x10e91e,_0x584292){if(_0x10e91e[_0xa026('0x38')]['id']){delete _0x10e91e[_0xa026('0x38')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x10e91e['params']['id']}})['then'](handleEntityNotFound(_0x584292,null))[_0xa026('0x19')](saveUpdates(_0x10e91e['body'],null))['then'](respondWithResult(_0x584292,null))[_0xa026('0x2b')](handleError(_0x584292,null));};exports[_0xa026('0x1a')]=function(_0x20c81b,_0x30af0d){return db[_0xa026('0x21')]['find']({'where':{'id':_0x20c81b[_0xa026('0x2d')]['id']}})[_0xa026('0x19')](handleEntityNotFound(_0x30af0d,null))[_0xa026('0x19')](removeEntity(_0x30af0d,null))[_0xa026('0x2b')](handleError(_0x30af0d,null));};exports[_0xa026('0x39')]=function(_0x579d20,_0xd9be){return db[_0xa026('0x21')][_0xa026('0x39')]()[_0xa026('0x19')](respondWithResult(_0xd9be,null))[_0xa026('0x2b')](handleError(_0xd9be,null));};exports[_0xa026('0x3a')]=function(_0x286e70,_0x2d904d){return db[_0xa026('0x3b')]['find']({'where':{'id':_0x286e70[_0xa026('0x2d')]['id']}})[_0xa026('0x19')](handleEntityNotFound(_0x2d904d,null))[_0xa026('0x19')](function(_0x2604b8){if(_0x2604b8){return _0x2604b8['addMessage'](_0x286e70['body'][_0xa026('0x3c')],_[_0xa026('0x3d')](_0x286e70[_0xa026('0x38')],['ids','id'])||{});}})['then'](respondWithResult(_0x2d904d,null))['catch'](handleError(_0x2d904d,null));};exports['getMessages']=function(_0x55aa6d,_0x3d68b8){var _0x539ce9={'raw':![],'where':{}};var _0x56de73={};var _0x149904={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xa026('0x3e')]({'where':{'id':_0x55aa6d[_0xa026('0x2d')]['id']}})[_0xa026('0x19')](handleEntityNotFound(_0x3d68b8,null))[_0xa026('0x19')](function(_0x3ba843){if(_0x3ba843){_0x56de73[_0xa026('0x2e')]=_['keys'](db[_0xa026('0x3b')][_0xa026('0x22')]);_0x56de73[_0xa026('0x29')]=_[_0xa026('0x2f')](_0x55aa6d[_0xa026('0x29')]);_0x56de73[_0xa026('0x30')]=_[_0xa026('0x31')](_0x56de73['model'],_0x56de73[_0xa026('0x29')]);_0x539ce9[_0xa026('0x33')]=_['intersection'](_0x56de73['model'],qs[_0xa026('0x32')](_0x55aa6d[_0xa026('0x29')][_0xa026('0x32')]));_0x539ce9[_0xa026('0x33')]=_0x539ce9[_0xa026('0x33')][_0xa026('0x34')]?_0x539ce9[_0xa026('0x33')]:_0x56de73[_0xa026('0x2e')];if(!_0x55aa6d[_0xa026('0x29')][_0xa026('0x3f')]('nolimit')){_0x539ce9['limit']=qs[_0xa026('0x13')](_0x55aa6d['query']['limit']);_0x539ce9['offset']=qs[_0xa026('0x15')](_0x55aa6d['query'][_0xa026('0x15')]);}_0x539ce9['order']=qs[_0xa026('0x40')](_0x55aa6d['query'][_0xa026('0x40')]);_0x539ce9['where']=qs[_0xa026('0x30')](_[_0xa026('0x41')](_0x55aa6d['query'],_0x56de73[_0xa026('0x30')]));_0x539ce9[_0xa026('0x42')][_0xa026('0x43')]=_0x3ba843['id'];if(_0x55aa6d['query'][_0xa026('0x44')]){_0x539ce9[_0xa026('0x42')]=_['merge'](_0x539ce9[_0xa026('0x42')],{'$or':_['map'](_0x539ce9[_0xa026('0x33')],function(_0x338432){var _0x1169c3={};_0x1169c3[_0x338432]={'$like':'%'+_0x55aa6d[_0xa026('0x29')][_0xa026('0x44')]+'%'};return _0x1169c3;})});}if(_0x55aa6d[_0xa026('0x29')][_0xa026('0x45')]){var _0x5c51fa=_0x55aa6d['query'][_0xa026('0x45')][_0xa026('0x46')](',');var _0x25df1a={};_0x25df1a[_0x5c51fa[0x0]]={'$gte':moment(_0x5c51fa[0x1])[_0xa026('0x47')](_0xa026('0x48'))};_0x539ce9[_0xa026('0x42')]=_[_0xa026('0x35')](_0x539ce9[_0xa026('0x42')],_0x25df1a);}_0x539ce9=_[_0xa026('0x35')]({},_0x539ce9,_0x55aa6d['options']);return db[_0xa026('0x3b')][_0xa026('0x14')]({'where':_0x539ce9[_0xa026('0x42')]})[_0xa026('0x19')](function(_0x3dd5a5){_0x149904[_0xa026('0x14')]=_0x3dd5a5;if(_0x55aa6d[_0xa026('0x29')][_0xa026('0x49')]){_0x539ce9['include']=[{'all':!![]}];}return db[_0xa026('0x3b')][_0xa026('0x27')](_0x539ce9);})[_0xa026('0x19')](function(_0x21a272){_0x149904[_0xa026('0x4a')]=_0x21a272;return _0x149904;});}})['then'](respondWithFilteredResult(_0x3d68b8,_0x539ce9))[_0xa026('0x2b')](handleError(_0x3d68b8,null));};exports[_0xa026('0x4b')]=function(_0x755dc3,_0x1f9f43){return db['OpenchannelInteraction']['find']({'where':{'id':_0x755dc3[_0xa026('0x2d')]['id']}})[_0xa026('0x19')](handleEntityNotFound(_0x1f9f43,null))['then'](function(_0x5cb58c){if(_0x5cb58c){return _0x5cb58c[_0xa026('0x4c')](_0x755dc3[_0xa026('0x38')][_0xa026('0x3c')],_['omit'](_0x755dc3[_0xa026('0x38')],['ids','id'])||{})[_0xa026('0x4d')](function(){return db[_0xa026('0x4e')]['findAll']({'attributes':['id','name',_0xa026('0x4f')],'where':{'id':_0x755dc3[_0xa026('0x38')][_0xa026('0x3c')]}});})[_0xa026('0x19')](function(_0x13318a){socket[_0xa026('0x50')]('openchannelInteractionTags:save',{'id':Number(_0x755dc3['params']['id']),'tags':_0x13318a||[]});return{'id':Number(_0x755dc3[_0xa026('0x2d')]['id']),'tags':_0x13318a||[]};});}})['then'](respondWithResult(_0x1f9f43,null))[_0xa026('0x2b')](handleError(_0x1f9f43,null));};exports[_0xa026('0x51')]=function(_0x44f359,_0x2171a7){return db[_0xa026('0x21')][_0xa026('0x52')]({'where':{'id':_0x44f359['params']['id']}})[_0xa026('0x19')](handleEntityNotFound(_0x2171a7,null))[_0xa026('0x19')](function(_0x5832d6){if(_0x5832d6){return _0x5832d6[_0xa026('0x51')](_0x44f359[_0xa026('0x29')][_0xa026('0x3c')]);}})['then'](respondWithStatusCode(_0x2171a7,null))[_0xa026('0x2b')](handleError(_0x2171a7,null));};exports[_0xa026('0x53')]=function(_0x392938,_0x3bee64){var _0x3dd6b2=moment()[_0xa026('0x54')]()[_0xa026('0x55')]();var _0x560ac3=path[_0xa026('0x56')](config[_0xa026('0x57')],'server',_0xa026('0x58'),_0xa026('0x59'));var _0xce9b1e=path[_0xa026('0x56')](config['root'],'server',_0xa026('0x58'),_0xa026('0x5a'));var _0x122e73=path['join'](_0x560ac3,_0x3dd6b2);var _0x568efe=util[_0xa026('0x47')]('transcript-%d-%s.zip',_0x392938['params']['id'],_0x3dd6b2);var _0x28d308=path[_0xa026('0x56')](_0x560ac3,_0x568efe);var _0x1a6842=[];_0x1a6842['push']({'model':db[_0xa026('0x5b')],'as':'User','attributes':['id',_0xa026('0x5c')],'raw':!![]});_0x1a6842[_0xa026('0x5d')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xa026('0x5e'),_0xa026('0x5f')],'raw':!![]});if(_0x392938[_0xa026('0x29')]['attachments']){_0x1a6842[_0xa026('0x5d')]({'model':db['Attachment'],'as':_0xa026('0x60'),'raw':!![]});}var _0x20c457=[{'model':db[_0xa026('0x3b')],'as':_0xa026('0x61'),'attributes':['id',_0xa026('0x38'),'createdAt','direction','secret',_0xa026('0x62')],'include':_0x1a6842}];_0x20c457[_0xa026('0x5d')]({'model':db['OpenchannelAccount'],'as':_0xa026('0x63'),'attributes':['id',_0xa026('0x1d')]});_0x20c457[_0xa026('0x5d')]({'model':db[_0xa026('0x5b')],'as':'Owner','attributes':['id',_0xa026('0x5c')]});return db[_0xa026('0x21')][_0xa026('0x52')]({'where':{'id':_0x392938[_0xa026('0x2d')]['id']},'include':_0x20c457})[_0xa026('0x19')](handleEntityNotFound(_0x3bee64,null))[_0xa026('0x19')](function(_0x8e6a73){if(_0x8e6a73){var _0x612b43=_0x8e6a73['get']({'plain':!![]});fs[_0xa026('0x64')](_0x122e73);var _0x5ac896={'channel':_0xa026('0x65'),'account':_0x612b43['Account']['name'],'agent':_0x612b43['Owner']?_0x612b43[_0xa026('0x66')][_0xa026('0x5c')]:_0xa026('0x67'),'createdAt':moment(_0x612b43['createdAt'])[_0xa026('0x47')](_0xa026('0x48'))[_0xa026('0x55')](),'closedAt':_0x612b43[_0xa026('0x68')]?moment(_0x612b43[_0xa026('0x69')])['format'](_0xa026('0x48'))['toString']():'','disposition':_0x612b43['disposition'],'visibility':_0x612b43[_0xa026('0x6a')]?'Public':_0xa026('0x6b'),'messages':_(_0x612b43[_0xa026('0x61')])[_0xa026('0x44')]({'secret':![]})[_0xa026('0x20')](function(_0x31cac7){if(_0x31cac7['Attachment']){var _0xc057b3=path[_0xa026('0x56')](_0xce9b1e,_0x31cac7[_0xa026('0x60')][_0xa026('0x6c')]);if(fs[_0xa026('0x6d')](_0xc057b3)){fs[_0xa026('0x6e')](_0xc057b3)[_0xa026('0x6f')](fs[_0xa026('0x70')](path['join'](_0x122e73,_0x31cac7[_0xa026('0x60')]['basename'])));}}return{'date':moment(_0x31cac7[_0xa026('0x71')])[_0xa026('0x47')](_0xa026('0x48'))[_0xa026('0x55')](),'sender':_0x31cac7[_0xa026('0x72')]===_0xa026('0x73')?_0x31cac7[_0xa026('0x5b')]?_0x31cac7[_0xa026('0x5b')][_0xa026('0x5c')]:_0xa026('0x74'):_0x31cac7['Contact'][_0xa026('0x5e')]+(_0x31cac7[_0xa026('0x75')]['lastName']?'\x20'+_0x31cac7[_0xa026('0x75')][_0xa026('0x5f')]:''),'body':_0x31cac7[_0xa026('0x60')]?_0x31cac7['Attachment'][_0xa026('0x6c')]:_0x31cac7[_0xa026('0x38')],'direction':_0x31cac7[_0xa026('0x72')]===_0xa026('0x73')?'A':'C','secret':_0x31cac7[_0xa026('0x76')],'read':_0x31cac7[_0xa026('0x62')],'attachment':_0x31cac7[_0xa026('0x60')]};})[_0xa026('0x77')]()};return ejs['renderFile'](path[_0xa026('0x56')](config['root'],'server',_0xa026('0x78'),_0xa026('0x79')),{'interaction':_0x5ac896})['then'](function(_0x5ac414){var _0x5a3676=path['join'](_0x122e73,_0xa026('0x7a')+_0x612b43['id']+'-'+_0x3dd6b2+_0xa026('0x7b'));var _0x157066={'path':_0x5a3676,'channel':_0xa026('0x65'),'interactionId':_0x612b43['id']};return pdf[_0xa026('0x7c')](_0x5ac414,_0x157066);})[_0xa026('0x19')](function(){return new Promise(function(_0x5039bc,_0x8d412d){zipdir(_0x122e73,{'saveTo':_0x28d308},function(_0x2d379c,_0x3f6ee1){if(_0x2d379c)return _0x8d412d(_0x2d379c);return _0x5039bc(_0x3f6ee1);});})[_0xa026('0x19')](function(){return new Promise(function(_0x15397c,_0x4056b5){rimraf(_0x122e73,function(_0x2aa7e4){if(_0x2aa7e4)_0x4056b5(_0x2aa7e4);return _0x15397c();});});})[_0xa026('0x19')](function(){return _0x3bee64[_0xa026('0x53')](_0x28d308,_0x568efe,function(_0x3fe853){if(_0x3fe853){logger['error'](_0xa026('0x7d'),_0x3fe853);}else{fs[_0xa026('0x7e')](_0x28d308);}});});});}else{return _0x3bee64[_0xa026('0xf')](0xc8);}})[_0xa026('0x2b')](handleError(_0x3bee64,null));}; \ No newline at end of file +var _0xcc6f=['destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','show','from','params','keys','intersection','attributes','model','fields','includeAll','include','options','catch','create','body','find','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','filters','length','hasOwnProperty','limit','sort','where','pick','OpenchannelInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','Tag','color','emit','openchannelInteractionTags:save','unix','toString','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','User','get','Openchannel','Account','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','System','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','end','status','json','offset','undefined','count','set','Content-Range','update','then'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0xcc6f,0x69));var _0xfcc6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xcc6f[_0x422905];return _0x33dc6c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xfcc6('0x0'));var moment=require(_0xfcc6('0x1'));var util=require(_0xfcc6('0x2'));var path=require(_0xfcc6('0x3'));var ejs=require(_0xfcc6('0x4'));var fs=require('fs');var _=require(_0xfcc6('0x5'));var Redis=require(_0xfcc6('0x6'));var interaction=require(_0xfcc6('0x7'));var qs=require(_0xfcc6('0x8'));var pdf=require(_0xfcc6('0x9'));var logger=require(_0xfcc6('0xa'))(_0xfcc6('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xfcc6('0xc')]=_[_0xfcc6('0xd')](config[_0xfcc6('0xc')],{'host':_0xfcc6('0xe'),'port':0x18eb});var socket=require(_0xfcc6('0xf'))(new Redis(config[_0xfcc6('0xc')]));require(_0xfcc6('0x10'))[_0xfcc6('0x11')](socket);function respondWithStatusCode(_0x5932d7,_0x57be5d){_0x57be5d=_0x57be5d||0xcc;return function(_0x29f241){if(_0x29f241){return _0x5932d7['sendStatus'](_0x57be5d);}return _0x5932d7['status'](_0x57be5d)[_0xfcc6('0x12')]();};}function respondWithResult(_0x2f8000,_0x4825e8){_0x4825e8=_0x4825e8||0xc8;return function(_0x1459c3){if(_0x1459c3){return _0x2f8000[_0xfcc6('0x13')](_0x4825e8)[_0xfcc6('0x14')](_0x1459c3);}};}function respondWithFilteredResult(_0x522f25,_0x3e2375){return function(_0x28f93b){if(_0x28f93b){var _0x2667c9=typeof _0x3e2375[_0xfcc6('0x15')]===_0xfcc6('0x16')&&typeof _0x3e2375['limit']==='undefined';var _0x4f7af4=_0x28f93b[_0xfcc6('0x17')];var _0x4e9c2c=_0x2667c9?0x0:_0x3e2375[_0xfcc6('0x15')];var _0x6cb11d=_0x2667c9?_0x28f93b[_0xfcc6('0x17')]:_0x3e2375['offset']+_0x3e2375['limit'];var _0x5be8a5;if(_0x6cb11d>=_0x4f7af4){_0x6cb11d=_0x4f7af4;_0x5be8a5=0xc8;}else{_0x5be8a5=0xce;}_0x522f25[_0xfcc6('0x13')](_0x5be8a5);return _0x522f25[_0xfcc6('0x18')](_0xfcc6('0x19'),_0x4e9c2c+'-'+_0x6cb11d+'/'+_0x4f7af4)[_0xfcc6('0x14')](_0x28f93b);}return null;};}function saveUpdates(_0x509d4c){return function(_0x567aac){if(_0x567aac){return _0x567aac[_0xfcc6('0x1a')](_0x509d4c)[_0xfcc6('0x1b')](function(_0x2e7714){return _0x2e7714;});}return null;};}function removeEntity(_0xf70c37){return function(_0x2023af){if(_0x2023af){return _0x2023af[_0xfcc6('0x1c')]()[_0xfcc6('0x1b')](function(){_0xf70c37[_0xfcc6('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12c310){return function(_0x5045d6){if(!_0x5045d6){_0x12c310['sendStatus'](0x194);}return _0x5045d6;};}function handleError(_0x38f80b,_0x5e3499){_0x5e3499=_0x5e3499||0x1f4;return function(_0x4a2a3c){logger[_0xfcc6('0x1d')](_0x4a2a3c[_0xfcc6('0x1e')]);if(_0x4a2a3c[_0xfcc6('0x1f')]){delete _0x4a2a3c[_0xfcc6('0x1f')];}_0x38f80b[_0xfcc6('0x13')](_0x5e3499)[_0xfcc6('0x20')](_0x4a2a3c);};}exports[_0xfcc6('0x21')]=function(_0x23347c,_0x52af7c){var _0x295c34={};var _0x3bfdab=_[_0xfcc6('0x22')](db[_0xfcc6('0x23')][_0xfcc6('0x24')],function(_0x2ddb4c){return{'name':_0x2ddb4c[_0xfcc6('0x25')],'type':_0x2ddb4c[_0xfcc6('0x26')][_0xfcc6('0x27')]};});_0x295c34=qs[_0xfcc6('0x28')](_0x3bfdab,_0x23347c);return interaction[_0xfcc6('0x29')](_0xfcc6('0x2a'),_0x23347c[_0xfcc6('0x2b')],_0x23347c[_0xfcc6('0x2c')],_0x295c34,_0x3bfdab)[_0xfcc6('0x1b')](respondWithFilteredResult(_0x52af7c,_0x295c34))['catch'](handleError(_0x52af7c,null));};exports[_0xfcc6('0x2d')]=function(_0x2c3424,_0x406b32){var _0xd01b51={};if(_0x2c3424[_0xfcc6('0x2b')][_0xfcc6('0x26')]&&_0x2c3424[_0xfcc6('0x2b')][_0xfcc6('0x26')]===_0xfcc6('0x2e')){_0xd01b51['from']=_0x2c3424[_0xfcc6('0x2f')]['id'];}else{_0xd01b51['id']=_0x2c3424[_0xfcc6('0x2f')]['id'];}var _0x222c4a={'raw':![],'where':_0xd01b51},_0x36cc35={};_0x36cc35['model']=_[_0xfcc6('0x30')](db[_0xfcc6('0x23')][_0xfcc6('0x24')]);_0x36cc35[_0xfcc6('0x2b')]=_['keys'](_0x2c3424['query']);_0x36cc35['filters']=_[_0xfcc6('0x31')](_0x36cc35['model'],_0x36cc35[_0xfcc6('0x2b')]);_0x222c4a[_0xfcc6('0x32')]=_[_0xfcc6('0x31')](_0x36cc35[_0xfcc6('0x33')],qs[_0xfcc6('0x34')](_0x2c3424[_0xfcc6('0x2b')][_0xfcc6('0x34')]));_0x222c4a[_0xfcc6('0x32')]=_0x222c4a[_0xfcc6('0x32')]['length']?_0x222c4a[_0xfcc6('0x32')]:_0x36cc35['model'];if(_0x2c3424[_0xfcc6('0x2b')][_0xfcc6('0x35')]){_0x222c4a[_0xfcc6('0x36')]=[{'all':!![]}];}_0x222c4a=_['merge']({},_0x222c4a,_0x2c3424[_0xfcc6('0x37')]);return db[_0xfcc6('0x23')]['find'](_0x222c4a)[_0xfcc6('0x1b')](handleEntityNotFound(_0x406b32,null))[_0xfcc6('0x1b')](respondWithResult(_0x406b32,null))[_0xfcc6('0x38')](handleError(_0x406b32,null));};exports['create']=function(_0x3295b0,_0x635cdd){return db[_0xfcc6('0x23')][_0xfcc6('0x39')](_0x3295b0['body'],{})[_0xfcc6('0x1b')](respondWithResult(_0x635cdd,0xc9))[_0xfcc6('0x38')](handleError(_0x635cdd,null));};exports[_0xfcc6('0x1a')]=function(_0x1fd527,_0x1ffdd2){if(_0x1fd527[_0xfcc6('0x3a')]['id']){delete _0x1fd527[_0xfcc6('0x3a')]['id'];}return db[_0xfcc6('0x23')]['find']({'where':{'id':_0x1fd527[_0xfcc6('0x2f')]['id']}})[_0xfcc6('0x1b')](handleEntityNotFound(_0x1ffdd2,null))[_0xfcc6('0x1b')](saveUpdates(_0x1fd527[_0xfcc6('0x3a')],null))['then'](respondWithResult(_0x1ffdd2,null))['catch'](handleError(_0x1ffdd2,null));};exports[_0xfcc6('0x1c')]=function(_0x5310db,_0x2e3d8f){return db[_0xfcc6('0x23')][_0xfcc6('0x3b')]({'where':{'id':_0x5310db[_0xfcc6('0x2f')]['id']}})[_0xfcc6('0x1b')](handleEntityNotFound(_0x2e3d8f,null))[_0xfcc6('0x1b')](removeEntity(_0x2e3d8f,null))[_0xfcc6('0x38')](handleError(_0x2e3d8f,null));};exports['describe']=function(_0x4fa793,_0x5b9dde){return db[_0xfcc6('0x23')][_0xfcc6('0x3c')]()[_0xfcc6('0x1b')](respondWithResult(_0x5b9dde,null))[_0xfcc6('0x38')](handleError(_0x5b9dde,null));};exports[_0xfcc6('0x3d')]=function(_0x383760,_0x1b8bef){return db['OpenchannelMessage'][_0xfcc6('0x3b')]({'where':{'id':_0x383760[_0xfcc6('0x2f')]['id']}})[_0xfcc6('0x1b')](handleEntityNotFound(_0x1b8bef,null))[_0xfcc6('0x1b')](function(_0x2dcdc8){if(_0x2dcdc8){return _0x2dcdc8[_0xfcc6('0x3d')](_0x383760[_0xfcc6('0x3a')][_0xfcc6('0x3e')],_['omit'](_0x383760[_0xfcc6('0x3a')],[_0xfcc6('0x3e'),'id'])||{});}})[_0xfcc6('0x1b')](respondWithResult(_0x1b8bef,null))[_0xfcc6('0x38')](handleError(_0x1b8bef,null));};exports[_0xfcc6('0x3f')]=function(_0x19d551,_0x331c33){var _0x5143a8={'raw':![],'where':{}};var _0x34515c={};var _0x5e34bc={'count':0x0,'rows':[]};return db[_0xfcc6('0x23')][_0xfcc6('0x40')]({'where':{'id':_0x19d551[_0xfcc6('0x2f')]['id']}})[_0xfcc6('0x1b')](handleEntityNotFound(_0x331c33,null))[_0xfcc6('0x1b')](function(_0x25057f){if(_0x25057f){_0x34515c[_0xfcc6('0x33')]=_['keys'](db[_0xfcc6('0x41')][_0xfcc6('0x24')]);_0x34515c[_0xfcc6('0x2b')]=_[_0xfcc6('0x30')](_0x19d551[_0xfcc6('0x2b')]);_0x34515c[_0xfcc6('0x42')]=_['intersection'](_0x34515c[_0xfcc6('0x33')],_0x34515c[_0xfcc6('0x2b')]);_0x5143a8[_0xfcc6('0x32')]=_[_0xfcc6('0x31')](_0x34515c[_0xfcc6('0x33')],qs[_0xfcc6('0x34')](_0x19d551['query'][_0xfcc6('0x34')]));_0x5143a8[_0xfcc6('0x32')]=_0x5143a8[_0xfcc6('0x32')][_0xfcc6('0x43')]?_0x5143a8['attributes']:_0x34515c[_0xfcc6('0x33')];if(!_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x44')]('nolimit')){_0x5143a8[_0xfcc6('0x45')]=qs[_0xfcc6('0x45')](_0x19d551['query'][_0xfcc6('0x45')]);_0x5143a8[_0xfcc6('0x15')]=qs[_0xfcc6('0x15')](_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x15')]);}_0x5143a8['order']=qs[_0xfcc6('0x46')](_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x46')]);_0x5143a8[_0xfcc6('0x47')]=qs[_0xfcc6('0x42')](_[_0xfcc6('0x48')](_0x19d551[_0xfcc6('0x2b')],_0x34515c[_0xfcc6('0x42')]));_0x5143a8['where'][_0xfcc6('0x49')]=_0x25057f['id'];if(_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x4a')]){_0x5143a8['where']=_[_0xfcc6('0x4b')](_0x5143a8['where'],{'$or':_['map'](_0x5143a8[_0xfcc6('0x32')],function(_0x1ab08b){var _0x3cdf6d={};_0x3cdf6d[_0x1ab08b]={'$like':'%'+_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x4a')]+'%'};return _0x3cdf6d;})});}if(_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x4c')]){var _0x52e9a0=_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x4c')][_0xfcc6('0x4d')](',');var _0x2728b2={};_0x2728b2[_0x52e9a0[0x0]]={'$gte':moment(_0x52e9a0[0x1])['format'](_0xfcc6('0x4e'))};_0x5143a8[_0xfcc6('0x47')]=_['merge'](_0x5143a8[_0xfcc6('0x47')],_0x2728b2);}_0x5143a8=_[_0xfcc6('0x4b')]({},_0x5143a8,_0x19d551[_0xfcc6('0x37')]);return db[_0xfcc6('0x41')][_0xfcc6('0x17')]({'where':_0x5143a8[_0xfcc6('0x47')]})[_0xfcc6('0x1b')](function(_0x33d70b){_0x5e34bc[_0xfcc6('0x17')]=_0x33d70b;if(_0x19d551[_0xfcc6('0x2b')][_0xfcc6('0x35')]){_0x5143a8[_0xfcc6('0x36')]=[{'all':!![]}];}return db[_0xfcc6('0x41')]['findAll'](_0x5143a8);})[_0xfcc6('0x1b')](function(_0x70f1e7){_0x5e34bc['rows']=_0x70f1e7;return _0x5e34bc;});}})[_0xfcc6('0x1b')](respondWithFilteredResult(_0x331c33,_0x5143a8))[_0xfcc6('0x38')](handleError(_0x331c33,null));};exports[_0xfcc6('0x4f')]=function(_0x244507,_0x31fb73){return db[_0xfcc6('0x23')]['find']({'where':{'id':_0x244507[_0xfcc6('0x2f')]['id']}})['then'](handleEntityNotFound(_0x31fb73,null))[_0xfcc6('0x1b')](function(_0x5c6524){if(_0x5c6524){return _0x5c6524[_0xfcc6('0x50')](_0x244507['body']['ids'],_[_0xfcc6('0x51')](_0x244507[_0xfcc6('0x3a')],[_0xfcc6('0x3e'),'id'])||{})[_0xfcc6('0x52')](function(){return db[_0xfcc6('0x53')][_0xfcc6('0x29')]({'attributes':['id','name',_0xfcc6('0x54')],'where':{'id':_0x244507[_0xfcc6('0x3a')][_0xfcc6('0x3e')]}});})[_0xfcc6('0x1b')](function(_0x2ab799){socket[_0xfcc6('0x55')](_0xfcc6('0x56'),{'id':Number(_0x244507[_0xfcc6('0x2f')]['id']),'tags':_0x2ab799||[]});return{'id':Number(_0x244507[_0xfcc6('0x2f')]['id']),'tags':_0x2ab799||[]};});}})[_0xfcc6('0x1b')](respondWithResult(_0x31fb73,null))[_0xfcc6('0x38')](handleError(_0x31fb73,null));};exports['removeTags']=function(_0x1fbffd,_0x21f011){return db[_0xfcc6('0x23')]['find']({'where':{'id':_0x1fbffd[_0xfcc6('0x2f')]['id']}})['then'](handleEntityNotFound(_0x21f011,null))['then'](function(_0x3ed5ac){if(_0x3ed5ac){return _0x3ed5ac['removeTags'](_0x1fbffd[_0xfcc6('0x2b')]['ids']);}})[_0xfcc6('0x1b')](respondWithStatusCode(_0x21f011,null))[_0xfcc6('0x38')](handleError(_0x21f011,null));};exports['download']=function(_0x45e031,_0x4a74ba){var _0x2e5025=moment()[_0xfcc6('0x57')]()[_0xfcc6('0x58')]();var _0x1ad8ed=path[_0xfcc6('0x59')](config[_0xfcc6('0x5a')],_0xfcc6('0x5b'),_0xfcc6('0x5c'),'tmp');var _0x439c19=path[_0xfcc6('0x59')](config[_0xfcc6('0x5a')],_0xfcc6('0x5b'),'files',_0xfcc6('0x5d'));var _0x58688b=path[_0xfcc6('0x59')](_0x1ad8ed,_0x2e5025);var _0x1dc7e3=util[_0xfcc6('0x5e')](_0xfcc6('0x5f'),_0x45e031[_0xfcc6('0x2f')]['id'],_0x2e5025);var _0xd7960=path['join'](_0x1ad8ed,_0x1dc7e3);var _0x13227a=[];_0x13227a[_0xfcc6('0x60')]({'model':db['User'],'as':'User','attributes':['id',_0xfcc6('0x61')],'raw':!![]});_0x13227a[_0xfcc6('0x60')]({'model':db[_0xfcc6('0x62')],'as':_0xfcc6('0x63'),'attributes':['id',_0xfcc6('0x64'),_0xfcc6('0x65')],'raw':!![]});if(_0x45e031[_0xfcc6('0x2b')][_0xfcc6('0x5d')]){_0x13227a[_0xfcc6('0x60')]({'model':db[_0xfcc6('0x66')],'as':_0xfcc6('0x66'),'raw':!![]});}var _0x2bfd8d=[{'model':db[_0xfcc6('0x41')],'as':'Messages','attributes':['id',_0xfcc6('0x3a'),_0xfcc6('0x67'),_0xfcc6('0x68'),_0xfcc6('0x69'),'read'],'include':_0x13227a}];_0x2bfd8d[_0xfcc6('0x60')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xfcc6('0x1f')]});_0x2bfd8d[_0xfcc6('0x60')]({'model':db[_0xfcc6('0x6a')],'as':'Owner','attributes':['id',_0xfcc6('0x61')]});return db[_0xfcc6('0x23')][_0xfcc6('0x3b')]({'where':{'id':_0x45e031[_0xfcc6('0x2f')]['id']},'include':_0x2bfd8d})[_0xfcc6('0x1b')](handleEntityNotFound(_0x4a74ba,null))[_0xfcc6('0x1b')](function(_0x1520b3){if(_0x1520b3){var _0xfe539=_0x1520b3[_0xfcc6('0x6b')]({'plain':!![]});fs['mkdirSync'](_0x58688b);var _0x268bfa={'channel':_0xfcc6('0x6c'),'account':_0xfe539[_0xfcc6('0x6d')][_0xfcc6('0x1f')],'agent':_0xfe539[_0xfcc6('0x6e')]?_0xfe539['Owner'][_0xfcc6('0x61')]:_0xfcc6('0x6f'),'createdAt':moment(_0xfe539[_0xfcc6('0x67')])[_0xfcc6('0x5e')](_0xfcc6('0x4e'))[_0xfcc6('0x58')](),'closedAt':_0xfe539[_0xfcc6('0x70')]?moment(_0xfe539[_0xfcc6('0x71')])[_0xfcc6('0x5e')](_0xfcc6('0x4e'))['toString']():'','disposition':_0xfe539[_0xfcc6('0x72')],'visibility':_0xfe539[_0xfcc6('0x73')]?_0xfcc6('0x74'):_0xfcc6('0x75'),'messages':_(_0xfe539['Messages'])['filter']({'secret':![]})[_0xfcc6('0x22')](function(_0x1ccc80){if(_0x1ccc80[_0xfcc6('0x66')]){var _0x264c24=path[_0xfcc6('0x59')](_0x439c19,_0x1ccc80[_0xfcc6('0x66')][_0xfcc6('0x76')]);if(fs[_0xfcc6('0x77')](_0x264c24)){fs[_0xfcc6('0x78')](_0x264c24)['pipe'](fs['createWriteStream'](path['join'](_0x58688b,_0x1ccc80[_0xfcc6('0x66')][_0xfcc6('0x76')])));}}return{'date':moment(_0x1ccc80['createdAt'])[_0xfcc6('0x5e')](_0xfcc6('0x4e'))[_0xfcc6('0x58')](),'sender':_0x1ccc80[_0xfcc6('0x68')]==='out'?_0x1ccc80[_0xfcc6('0x6a')]?_0x1ccc80[_0xfcc6('0x6a')][_0xfcc6('0x61')]:_0xfcc6('0x79'):_0x1ccc80['Contact'][_0xfcc6('0x64')]+(_0x1ccc80[_0xfcc6('0x63')]['lastName']?'\x20'+_0x1ccc80[_0xfcc6('0x63')][_0xfcc6('0x65')]:''),'body':_0x1ccc80[_0xfcc6('0x66')]?_0x1ccc80[_0xfcc6('0x66')][_0xfcc6('0x76')]:_0x1ccc80[_0xfcc6('0x3a')],'direction':_0x1ccc80[_0xfcc6('0x68')]===_0xfcc6('0x7a')?'A':'C','secret':_0x1ccc80[_0xfcc6('0x69')],'read':_0x1ccc80['read'],'attachment':_0x1ccc80[_0xfcc6('0x66')]};})[_0xfcc6('0x7b')]()};return ejs[_0xfcc6('0x7c')](path['join'](config[_0xfcc6('0x5a')],_0xfcc6('0x5b'),_0xfcc6('0x7d'),_0xfcc6('0x7e')),{'interaction':_0x268bfa})[_0xfcc6('0x1b')](function(_0x233005){var _0x400fe8=path[_0xfcc6('0x59')](_0x58688b,_0xfcc6('0x7f')+_0xfe539['id']+'-'+_0x2e5025+_0xfcc6('0x80'));var _0x54afee={'path':_0x400fe8,'channel':_0xfcc6('0x6c'),'interactionId':_0xfe539['id']};return pdf['createPdfFromHTML'](_0x233005,_0x54afee);})['then'](function(){return new Promise(function(_0x5cf1ea,_0x11fb4a){zipdir(_0x58688b,{'saveTo':_0xd7960},function(_0x3275b4,_0x3fe665){if(_0x3275b4)return _0x11fb4a(_0x3275b4);return _0x5cf1ea(_0x3fe665);});})[_0xfcc6('0x1b')](function(){return new Promise(function(_0x5adfde,_0x1bf479){rimraf(_0x58688b,function(_0x306f3e){if(_0x306f3e)_0x1bf479(_0x306f3e);return _0x5adfde();});});})[_0xfcc6('0x1b')](function(){return _0x4a74ba[_0xfcc6('0x81')](_0xd7960,_0x1dc7e3,function(_0x5bb84d){if(_0x5bb84d){logger[_0xfcc6('0x1d')](_0xfcc6('0x82'),_0x5bb84d);}else{fs[_0xfcc6('0x83')](_0xd7960);}});});});}else{return _0x4a74ba[_0xfcc6('0x84')](0xc8);}})['catch'](handleError(_0x4a74ba,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 0f644b8..5dead35 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 _0x1736=['length','emit','catch','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','unreadMessages'];(function(_0x57a12a,_0x251c6e){var _0x4d4ced=function(_0x1ba4ab){while(--_0x1ba4ab){_0x57a12a['push'](_0x57a12a['shift']());}};_0x4d4ced(++_0x251c6e);}(_0x1736,0x1bf));var _0x6173=function(_0x3be92a,_0x5b994e){_0x3be92a=_0x3be92a-0x0;var _0x2c13ab=_0x1736[_0x3be92a];return _0x2c13ab;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x6173('0x0'))['db'][_0x6173('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x6173('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6173('0x3')](0x0);var events={'afterCreate':_0x6173('0x4'),'afterUpdate':_0x6173('0x5'),'afterDestroy':_0x6173('0x6')};function emitEvent(_0xd771d8){return function(_0x4acd28,_0x3603d7,_0x2d92e3){_0x4acd28['getUsers']({'attributes':['id'],'raw':!![]})[_0x6173('0x7')](function(_0x160458){_0x4acd28[_0x6173('0x8')]('Users',_0x160458[_0x6173('0x9')](function(_0x4c6866){return{'id':_0x4c6866['id']};}));return OpenchannelMessage[_0x6173('0xa')]({'where':{'OpenchannelInteractionId':_0x4acd28['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6173('0x7')](function(_0x1424b0){_0x4acd28['setDataValue'](_0x6173('0xb'),_0x1424b0[_0x6173('0xc')]);OpenchannelInteractionEvents[_0x6173('0xd')](_0xd771d8+':'+_0x4acd28['id'],_0x4acd28);OpenchannelInteractionEvents[_0x6173('0xd')](_0xd771d8,_0x4acd28);_0x2d92e3(null);})[_0x6173('0xe')](_0x2d92e3(null));};}for(var e in events){if(events[_0x6173('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x6173('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x2818=['OpenchannelMessage','setMaxListeners','update','getUsers','Users','map','findAll','then','length','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction'];(function(_0x1bbfd4,_0x5cb9c4){var _0x34d2bb=function(_0x3d3e66){while(--_0x3d3e66){_0x1bbfd4['push'](_0x1bbfd4['shift']());}};_0x34d2bb(++_0x5cb9c4);}(_0x2818,0xb1));var _0x8281=function(_0x21ae82,_0x4902ed){_0x21ae82=_0x21ae82-0x0;var _0x11990b=_0x2818[_0x21ae82];return _0x11990b;};'use strict';var EventEmitter=require(_0x8281('0x0'));var OpenchannelInteraction=require(_0x8281('0x1'))['db'][_0x8281('0x2')];var OpenchannelMessage=require(_0x8281('0x1'))['db'][_0x8281('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8281('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8281('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3777f2){return function(_0x6885ce,_0x5aa838,_0x5ba489){_0x6885ce[_0x8281('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2d7a9b){_0x6885ce['setDataValue'](_0x8281('0x7'),_0x2d7a9b[_0x8281('0x8')](function(_0x230cb7){return{'id':_0x230cb7['id']};}));return OpenchannelMessage[_0x8281('0x9')]({'where':{'OpenchannelInteractionId':_0x6885ce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8281('0xa')](function(_0x4521d4){_0x6885ce['setDataValue']('unreadMessages',_0x4521d4[_0x8281('0xb')]);OpenchannelInteractionEvents['emit'](_0x3777f2+':'+_0x6885ce['id'],_0x6885ce);OpenchannelInteractionEvents['emit'](_0x3777f2,_0x6885ce);_0x5ba489(null);})[_0x8281('0xc')](_0x5ba489(null));};}for(var e in events){if(events[_0x8281('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x8281('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 8291b35..fc0bde2 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 _0x64cb=['utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','OpenchannelInteraction'];(function(_0x31ec84,_0x3635b8){var _0x38dac6=function(_0x59f15e){while(--_0x59f15e){_0x31ec84['push'](_0x31ec84['shift']());}};_0x38dac6(++_0x3635b8);}(_0x64cb,0x163));var _0xb64c=function(_0x2fef7c,_0x1e72c9){_0x2fef7c=_0x2fef7c-0x0;var _0x3a6212=_0x64cb[_0x2fef7c];return _0x3a6212;};'use strict';var _=require('lodash');var util=require(_0xb64c('0x0'));var logger=require(_0xb64c('0x1'))('api');var moment=require(_0xb64c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb64c('0x3'));var fs=require('fs');var path=require(_0xb64c('0x4'));var rimraf=require(_0xb64c('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xb64c('0x6')]=function(_0x50f00f,_0x4cb32c){return _0x50f00f[_0xb64c('0x7')](_0xb64c('0x8'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb64c('0x9'),'hooks':{'beforeUpdate':function(_0x2576f5,_0x21ec56,_0x45f76a){if(_0x2576f5['changed'](_0xb64c('0xa'))){_0x2576f5[_0xb64c('0xb')]=moment()[_0xb64c('0xc')](_0xb64c('0xd'));}_0x45f76a(null,_0x2576f5);}}});}; \ No newline at end of file +var _0x68aa=['exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x21da6a,_0x57d4e2){var _0x355c35=function(_0x3dbde6){while(--_0x3dbde6){_0x21da6a['push'](_0x21da6a['shift']());}};_0x355c35(++_0x57d4e2);}(_0x68aa,0x81));var _0xa68a=function(_0x49617a,_0x7ed6aa){_0x49617a=_0x49617a-0x0;var _0x3e8736=_0x68aa[_0x49617a];return _0x3e8736;};'use strict';var _=require('lodash');var util=require(_0xa68a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa68a('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa68a('0x2'));var rimraf=require(_0xa68a('0x3'));var config=require(_0xa68a('0x4'));var attributes=require(_0xa68a('0x5'));module[_0xa68a('0x6')]=function(_0x2d1ede,_0x23a1f2){return _0x2d1ede['define'](_0xa68a('0x7'),attributes,{'tableName':_0xa68a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa68a('0x9'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x35780a,_0x4113e1,_0x3969a0){if(_0x35780a[_0xa68a('0xa')](_0xa68a('0xb'))){_0x35780a[_0xa68a('0xc')]=moment()[_0xa68a('0xd')](_0xa68a('0xe'));}_0x3969a0(null,_0x35780a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e42349f..bcb622f 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 _0xf377=['addTags','ids','AddTags','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','where'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf377,0xb2));var _0x7f37=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf377[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0x7f37('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f37('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7f37('0x2'));var logger=require(_0x7f37('0x3'))(_0x7f37('0x4'));var config=require(_0x7f37('0x5'));var jayson=require(_0x7f37('0x6'));var client=jayson[_0x7f37('0x7')][_0x7f37('0x8')]({'port':0x232a});config[_0x7f37('0x9')]=_[_0x7f37('0xa')](config[_0x7f37('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f37('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x7f37('0xc')](socket);function respondWithRpcPromise(_0x6d36f2,_0x1157b9,_0x2122b7){return new BPromise(function(_0x5ab46f,_0x37032e){return client['request'](_0x6d36f2,_0x2122b7)[_0x7f37('0xd')](function(_0x230022){logger[_0x7f37('0xe')](_0x7f37('0xf'),_0x1157b9,_0x7f37('0x10'));logger[_0x7f37('0x11')](_0x7f37('0x12'),_0x1157b9,_0x7f37('0x10'),JSON[_0x7f37('0x13')](_0x230022));if(_0x230022[_0x7f37('0x14')]){if(_0x230022['error'][_0x7f37('0x15')]===0x1f4){logger[_0x7f37('0x14')](_0x7f37('0xf'),_0x1157b9,_0x230022['error']['message']);return _0x37032e(_0x230022[_0x7f37('0x14')][_0x7f37('0x16')]);}logger[_0x7f37('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1157b9,_0x230022[_0x7f37('0x14')][_0x7f37('0x16')]);return _0x5ab46f(_0x230022[_0x7f37('0x14')][_0x7f37('0x16')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1157b9,_0x7f37('0x10'));_0x5ab46f(_0x230022['result'][_0x7f37('0x16')]);}})[_0x7f37('0x17')](function(_0x4b3493){logger['error'](_0x7f37('0xf'),_0x1157b9,_0x4b3493);_0x37032e(_0x4b3493);});});}exports[_0x7f37('0x18')]=function(_0x58ff6d){var _0x21dc83=this;return new Promise(function(_0x14f7f9,_0x18330c){return db[_0x7f37('0x19')][_0x7f37('0x1a')](_0x58ff6d[_0x7f37('0x1b')],{'raw':_0x58ff6d[_0x7f37('0x1c')]?_0x58ff6d[_0x7f37('0x1c')][_0x7f37('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ff6d[_0x7f37('0x1c')]?_0x58ff6d[_0x7f37('0x1c')]['where']||null:null,'attributes':_0x58ff6d['options']?_0x58ff6d[_0x7f37('0x1c')]['attributes']||null:null,'limit':_0x58ff6d['options']?_0x58ff6d[_0x7f37('0x1c')][_0x7f37('0x1e')]||null:null})['then'](function(_0x33c1e4){logger[_0x7f37('0xe')](_0x7f37('0x18'),_0x58ff6d);logger['debug']('UpdateOpenchannelInteraction',_0x58ff6d,JSON[_0x7f37('0x13')](_0x33c1e4));_0x14f7f9(_0x33c1e4);})[_0x7f37('0x17')](function(_0x1ebf97){logger[_0x7f37('0x14')](_0x7f37('0x18'),_0x1ebf97['message'],_0x58ff6d);_0x18330c(_0x21dc83['error'](0x1f4,_0x1ebf97['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2ce12d){return new Promise(function(_0x5113df,_0x766e72){return db[_0x7f37('0x19')]['find']({'where':_0x2ce12d[_0x7f37('0x1c')]?_0x2ce12d[_0x7f37('0x1c')][_0x7f37('0x1f')]||null:null})['then'](function(_0x49c651){if(_0x49c651){return _0x49c651[_0x7f37('0x20')](_0x2ce12d[_0x7f37('0x1b')][_0x7f37('0x21')],_['omit'](_0x2ce12d[_0x7f37('0x1b')],['ids','id'])||{});}})['spread'](function(_0x1a3b73){logger[_0x7f37('0xe')](_0x7f37('0x22'),_0x2ce12d);logger[_0x7f37('0x11')](_0x7f37('0x22'),_0x2ce12d,JSON['stringify'](_0x1a3b73));_0x5113df(_0x1a3b73);})[_0x7f37('0x17')](function(_0x19da9a){logger[_0x7f37('0x14')](_0x7f37('0x22'),_0x19da9a[_0x7f37('0x16')],_0x2ce12d);_0x766e72(_this[_0x7f37('0x14')](0x1f4,_0x19da9a[_0x7f37('0x16')]));});});}; \ No newline at end of file +var _0x66d4=['options','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','raw'];(function(_0x2b18ba,_0x285c2c){var _0x5d1729=function(_0x5c3796){while(--_0x5c3796){_0x2b18ba['push'](_0x2b18ba['shift']());}};_0x5d1729(++_0x285c2c);}(_0x66d4,0x15a));var _0x466d=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x66d4[_0x28a5ad];return _0x176b8a;};'use strict';var _=require(_0x466d('0x0'));var util=require(_0x466d('0x1'));var moment=require('moment');var BPromise=require(_0x466d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x466d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x466d('0x4'))(_0x466d('0x5'));var config=require(_0x466d('0x6'));var jayson=require(_0x466d('0x7'));var client=jayson['client'][_0x466d('0x8')]({'port':0x232a});config[_0x466d('0x9')]=_[_0x466d('0xa')](config[_0x466d('0x9')],{'host':_0x466d('0xb'),'port':0x18eb});var socket=require(_0x466d('0xc'))(new Redis(config[_0x466d('0x9')]));require(_0x466d('0xd'))[_0x466d('0xe')](socket);function respondWithRpcPromise(_0x301572,_0x3b5c48,_0x4071eb){return new BPromise(function(_0x2aaea9,_0x406a5a){return client[_0x466d('0xf')](_0x301572,_0x4071eb)[_0x466d('0x10')](function(_0x43bc4d){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x3b5c48,_0x466d('0x11'));logger[_0x466d('0x12')](_0x466d('0x13'),_0x3b5c48,'request\x20sent',JSON[_0x466d('0x14')](_0x43bc4d));if(_0x43bc4d[_0x466d('0x15')]){if(_0x43bc4d[_0x466d('0x15')][_0x466d('0x16')]===0x1f4){logger[_0x466d('0x15')](_0x466d('0x17'),_0x3b5c48,_0x43bc4d[_0x466d('0x15')][_0x466d('0x18')]);return _0x406a5a(_0x43bc4d['error'][_0x466d('0x18')]);}logger[_0x466d('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3b5c48,_0x43bc4d[_0x466d('0x15')]['message']);return _0x2aaea9(_0x43bc4d[_0x466d('0x15')][_0x466d('0x18')]);}else{logger[_0x466d('0x19')](_0x466d('0x17'),_0x3b5c48,_0x466d('0x11'));_0x2aaea9(_0x43bc4d[_0x466d('0x1a')][_0x466d('0x18')]);}})['catch'](function(_0x59aab6){logger['error'](_0x466d('0x17'),_0x3b5c48,_0x59aab6);_0x406a5a(_0x59aab6);});});}exports[_0x466d('0x1b')]=function(_0xf8f2d4){var _0x103cc3=this;return new Promise(function(_0x549cbf,_0x26cbac){return db[_0x466d('0x1c')][_0x466d('0x1d')](_0xf8f2d4[_0x466d('0x1e')],{'raw':_0xf8f2d4['options']?_0xf8f2d4['options'][_0x466d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf8f2d4[_0x466d('0x20')]?_0xf8f2d4['options'][_0x466d('0x21')]||null:null,'attributes':_0xf8f2d4['options']?_0xf8f2d4['options'][_0x466d('0x22')]||null:null,'limit':_0xf8f2d4['options']?_0xf8f2d4[_0x466d('0x20')][_0x466d('0x23')]||null:null})[_0x466d('0x10')](function(_0x530c09){logger[_0x466d('0x19')](_0x466d('0x1b'),_0xf8f2d4);logger['debug']('UpdateOpenchannelInteraction',_0xf8f2d4,JSON[_0x466d('0x14')](_0x530c09));_0x549cbf(_0x530c09);})[_0x466d('0x24')](function(_0x20bfb9){logger[_0x466d('0x15')](_0x466d('0x1b'),_0x20bfb9[_0x466d('0x18')],_0xf8f2d4);_0x26cbac(_0x103cc3[_0x466d('0x15')](0x1f4,_0x20bfb9[_0x466d('0x18')]));});});};exports[_0x466d('0x25')]=function(_0xdd69b3){return new Promise(function(_0x3f2131,_0x3d5a92){return db[_0x466d('0x1c')]['find']({'where':_0xdd69b3[_0x466d('0x20')]?_0xdd69b3[_0x466d('0x20')][_0x466d('0x21')]||null:null})[_0x466d('0x10')](function(_0x3da47a){if(_0x3da47a){return _0x3da47a['addTags'](_0xdd69b3[_0x466d('0x1e')][_0x466d('0x26')],_[_0x466d('0x27')](_0xdd69b3['body'],[_0x466d('0x26'),'id'])||{});}})[_0x466d('0x28')](function(_0x20f5c8){logger[_0x466d('0x19')](_0x466d('0x29'),_0xdd69b3);logger[_0x466d('0x12')](_0x466d('0x29'),_0xdd69b3,JSON[_0x466d('0x14')](_0x20f5c8));_0x3f2131(_0x20f5c8);})['catch'](function(_0x5a34e2){logger[_0x466d('0x15')](_0x466d('0x29'),_0x5a34e2[_0x466d('0x18')],_0xdd69b3);_0x3d5a92(_this['error'](0x1f4,_0x5a34e2[_0x466d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e5cec8c..9c269d1 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 _0x07e1=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x231573,_0x1821e9){var _0x37a6df=function(_0x16b425){while(--_0x16b425){_0x231573['push'](_0x231573['shift']());}};_0x37a6df(++_0x1821e9);}(_0x07e1,0x143));var _0x107e=function(_0x419406,_0x4d7ce3){_0x419406=_0x419406-0x0;var _0x42dd47=_0x07e1[_0x419406];return _0x42dd47;};'use strict';var OpenchannelInteractionEvents=require(_0x107e('0x0'));var events=[_0x107e('0x1'),_0x107e('0x2'),_0x107e('0x3')];function createListener(_0xd44c0f,_0x5c966a){return function(_0x32fe8d){_0x5c966a[_0x107e('0x4')](_0xd44c0f,_0x32fe8d);};}function removeListener(_0x1f11f2,_0x2e2a64){return function(){OpenchannelInteractionEvents[_0x107e('0x5')](_0x1f11f2,_0x2e2a64);};}exports[_0x107e('0x6')]=function(_0x5d2407){for(var _0x317ee7=0x0,_0x2b1c8e=events['length'];_0x317ee7<_0x2b1c8e;_0x317ee7++){var _0x527891=events[_0x317ee7];var _0x23add9=createListener(_0x107e('0x7')+_0x527891,_0x5d2407);OpenchannelInteractionEvents['on'](_0x527891,_0x23add9);}}; \ No newline at end of file +var _0xde7a=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','emit'];(function(_0x3b5031,_0x38057f){var _0x57ad35=function(_0x1660cc){while(--_0x1660cc){_0x3b5031['push'](_0x3b5031['shift']());}};_0x57ad35(++_0x38057f);}(_0xde7a,0x17e));var _0xade7=function(_0x20c450,_0x524915){_0x20c450=_0x20c450-0x0;var _0x196655=_0xde7a[_0x20c450];return _0x196655;};'use strict';var OpenchannelInteractionEvents=require(_0xade7('0x0'));var events=[_0xade7('0x1'),'remove','update'];function createListener(_0x195c0c,_0x3b2d30){return function(_0x231589){_0x3b2d30[_0xade7('0x2')](_0x195c0c,_0x231589);};}function removeListener(_0x2783c8,_0x239c49){return function(){OpenchannelInteractionEvents[_0xade7('0x3')](_0x2783c8,_0x239c49);};}exports[_0xade7('0x4')]=function(_0x4aef1d){for(var _0x3907ea=0x0,_0x4d60af=events[_0xade7('0x5')];_0x3907ea<_0x4d60af;_0x3907ea++){var _0x3e0b4f=events[_0x3907ea];var _0x9d44a3=createListener(_0xade7('0x6')+_0x3e0b4f,_0x4aef1d);OpenchannelInteractionEvents['on'](_0x3e0b4f,_0x9d44a3);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 928dd79..6858226 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 _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(_0x35d672,_0x45d47e){var _0x7b5104=function(_0x602333){while(--_0x602333){_0x35d672['push'](_0x35d672['shift']());}};_0x7b5104(++_0x45d47e);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a9bfe,_0xa2b824){_0x5a9bfe=_0x5a9bfe-0x0;var _0x2a81f6=_0xedd9[_0x5a9bfe];return _0x2a81f6;};'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 +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x315d69,_0x1a9224){var _0x599dca=function(_0x51feeb){while(--_0x51feeb){_0x315d69['push'](_0x315d69['shift']());}};_0x599dca(++_0x1a9224);}(_0xe706,0xa3));var _0x6e70=function(_0x14e780,_0x3b07c6){_0x14e780=_0x14e780-0x0;var _0x5f884c=_0xe706[_0x14e780];return _0x5f884c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7b042b5..0596e15 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 _0xeb3b=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x63d380,_0x59cd88){var _0x283921=function(_0x2903f1){while(--_0x2903f1){_0x63d380['push'](_0x63d380['shift']());}};_0x283921(++_0x59cd88);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xeb3b[_0x4b4f24];return _0x1c13d4;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'body':{'type':Sequelize[_0xbeb3('0x2')](_0xbeb3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbeb3('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbeb3('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xbeb3('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbeb3('0x2')]}}; \ No newline at end of file +var _0x7269=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x7269,0x76));var _0x9726=function(_0x199259,_0x1bc8ff){_0x199259=_0x199259-0x0;var _0x227b64=_0x7269[_0x199259];return _0x227b64;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'body':{'type':Sequelize[_0x9726('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9726('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9726('0x4')]('in','out'),'defaultValue':_0x9726('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9726('0x6')]},'providerName':{'type':Sequelize[_0x9726('0x7')]},'providerResponse':{'type':Sequelize[_0x9726('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 47b9787..769f397 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 _0x2984=['describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','manual','interface','channel','motionChannel','EventManager','OpenchannelInteraction','RejectMessage','SELECT','email','internal','SIP/%s','event','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','send','index','map','OpenchannelMessage','fieldName','key','model','name','query','filters','intersection','attributes','fields','nolimit','order','pick','filter','merge','VIRTUAL','options','where','include','findAll','rows','show','params','keys','rawAttributes','length','includeAll','find','body'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0x2984,0xae));var _0x4298=function(_0x5ba353,_0x11fd8b){_0x5ba353=_0x5ba353-0x0;var _0x149f6b=_0x2984[_0x5ba353];return _0x149f6b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4298('0x0'));var zipdir=require(_0x4298('0x1'));var jsonpatch=require(_0x4298('0x2'));var rp=require('request-promise');var moment=require(_0x4298('0x3'));var BPromise=require(_0x4298('0x4'));var Mustache=require('mustache');var util=require(_0x4298('0x5'));var path=require(_0x4298('0x6'));var sox=require(_0x4298('0x7'));var csv=require(_0x4298('0x8'));var ejs=require(_0x4298('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4298('0xa'));var squel=require(_0x4298('0xb'));var crypto=require(_0x4298('0xc'));var jsforce=require(_0x4298('0xd'));var deskjs=require(_0x4298('0xe'));var toCsv=require(_0x4298('0x8'));var querystring=require(_0x4298('0xf'));var Papa=require(_0x4298('0x10'));var Redis=require('ioredis');var authService=require(_0x4298('0x11'));var qs=require(_0x4298('0x12'));var as=require(_0x4298('0x13'));var hardwareService=require(_0x4298('0x14'));var logger=require('../../config/logger')(_0x4298('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4298('0x16'))['db'];config['redis']=_[_0x4298('0x17')](config['redis'],{'host':_0x4298('0x18'),'port':0x18eb});var socket=require(_0x4298('0x19'))(new Redis(config[_0x4298('0x1a')]));require('./openchannelMessage.socket')[_0x4298('0x1b')](socket);var jayson=require(_0x4298('0x1c'));var client=jayson[_0x4298('0x1d')][_0x4298('0x1e')]({'port':0x232c});var client9002=jayson[_0x4298('0x1d')][_0x4298('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x486be4,_0x16ffa1,_0x48afb7,_0x36cc7e){return new BPromise(function(_0x287194,_0x54fc64){var _0x74ba7d=_0x36cc7e||client;return _0x74ba7d[_0x4298('0x1f')](_0x486be4,_0x48afb7)[_0x4298('0x20')](function(_0x23d765){logger[_0x4298('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x16ffa1,_0x4298('0x22'));logger[_0x4298('0x23')](_0x4298('0x24'),_0x16ffa1,'request\x20sent',JSON[_0x4298('0x25')](_0x23d765));if(_0x23d765['error']){if(_0x23d765[_0x4298('0x26')]['code']===0x1f4){logger[_0x4298('0x26')](_0x4298('0x27'),_0x16ffa1,_0x23d765['error']['message']);return _0x54fc64(_0x23d765['error'][_0x4298('0x28')]);}logger[_0x4298('0x26')](_0x4298('0x27'),_0x16ffa1,_0x23d765['error']['message']);return _0x287194(_0x23d765[_0x4298('0x26')]['message']);}else{logger[_0x4298('0x21')](_0x4298('0x27'),_0x16ffa1,_0x4298('0x22'));_0x287194(_0x23d765[_0x4298('0x29')]['message']);}})[_0x4298('0x2a')](function(_0x305008){logger[_0x4298('0x26')](_0x4298('0x27'),_0x16ffa1,_0x305008);_0x54fc64(_0x305008);});});}function respondWithStatusCode(_0x38e302,_0x2bc7e4){_0x2bc7e4=_0x2bc7e4||0xcc;return function(_0x169021){if(_0x169021){return _0x38e302[_0x4298('0x2b')](_0x2bc7e4);}return _0x38e302[_0x4298('0x2c')](_0x2bc7e4)[_0x4298('0x2d')]();};}function respondWithResult(_0x5ec6fd,_0x5c0eca){_0x5c0eca=_0x5c0eca||0xc8;return function(_0x2ca8d9){if(_0x2ca8d9){return _0x5ec6fd[_0x4298('0x2c')](_0x5c0eca)[_0x4298('0x2e')](_0x2ca8d9);}};}function respondWithFilteredResult(_0x2f7bb3,_0x171bd9){return function(_0x58466b){if(_0x58466b){var _0x3d5ffa=typeof _0x171bd9[_0x4298('0x2f')]===_0x4298('0x30')&&typeof _0x171bd9[_0x4298('0x31')]===_0x4298('0x30');var _0x3d590f=_0x58466b[_0x4298('0x32')];var _0x213235=_0x3d5ffa?0x0:_0x171bd9[_0x4298('0x2f')];var _0x53af63=_0x3d5ffa?_0x58466b[_0x4298('0x32')]:_0x171bd9[_0x4298('0x2f')]+_0x171bd9['limit'];var _0x16a7a6;if(_0x53af63>=_0x3d590f){_0x53af63=_0x3d590f;_0x16a7a6=0xc8;}else{_0x16a7a6=0xce;}_0x2f7bb3[_0x4298('0x2c')](_0x16a7a6);return _0x2f7bb3[_0x4298('0x33')](_0x4298('0x34'),_0x213235+'-'+_0x53af63+'/'+_0x3d590f)[_0x4298('0x2e')](_0x58466b);}return null;};}function patchUpdates(_0x1b5a10){return function(_0x4beabf){try{jsonpatch[_0x4298('0x35')](_0x4beabf,_0x1b5a10,!![]);}catch(_0x5362c2){return BPromise[_0x4298('0x36')](_0x5362c2);}return _0x4beabf['save']();};}function saveUpdates(_0x3964d8,_0x358c6b){return function(_0x4d63e8){if(_0x4d63e8){return _0x4d63e8[_0x4298('0x37')](_0x3964d8)[_0x4298('0x20')](function(_0x428550){return _0x428550;});}return null;};}function removeEntity(_0x3ff6d2,_0x2e4d11){return function(_0x191b15){if(_0x191b15){return _0x191b15[_0x4298('0x38')]()['then'](function(){_0x3ff6d2[_0x4298('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e7c22,_0x190dae){return function(_0x910fe1){if(!_0x910fe1){_0x2e7c22[_0x4298('0x2b')](0x194);}return _0x910fe1;};}function handleError(_0x20258e,_0x1408d9){_0x1408d9=_0x1408d9||0x1f4;return function(_0x1d6586){logger[_0x4298('0x26')](_0x1d6586[_0x4298('0x39')]);if(_0x1d6586['name']){delete _0x1d6586['name'];}_0x20258e[_0x4298('0x2c')](_0x1408d9)[_0x4298('0x3a')](_0x1d6586);};}exports[_0x4298('0x3b')]=function(_0x131665,_0x574950){var _0x175409={},_0x38fa2b={},_0x3785c4={'count':0x0,'rows':[]};var _0x2cb591=_[_0x4298('0x3c')](db[_0x4298('0x3d')]['rawAttributes'],function(_0x1a2a83){return{'name':_0x1a2a83[_0x4298('0x3e')],'type':_0x1a2a83['type'][_0x4298('0x3f')]};});_0x38fa2b[_0x4298('0x40')]=_['map'](_0x2cb591,_0x4298('0x41'));_0x38fa2b[_0x4298('0x42')]=_['keys'](_0x131665[_0x4298('0x42')]);_0x38fa2b[_0x4298('0x43')]=_[_0x4298('0x44')](_0x38fa2b[_0x4298('0x40')],_0x38fa2b[_0x4298('0x42')]);_0x175409[_0x4298('0x45')]=_['intersection'](_0x38fa2b[_0x4298('0x40')],qs[_0x4298('0x46')](_0x131665[_0x4298('0x42')][_0x4298('0x46')]));_0x175409[_0x4298('0x45')]=_0x175409[_0x4298('0x45')]['length']?_0x175409[_0x4298('0x45')]:_0x38fa2b['model'];if(!_0x131665[_0x4298('0x42')]['hasOwnProperty'](_0x4298('0x47'))){_0x175409[_0x4298('0x31')]=qs[_0x4298('0x31')](_0x131665['query']['limit']);_0x175409[_0x4298('0x2f')]=qs['offset'](_0x131665[_0x4298('0x42')][_0x4298('0x2f')]);}_0x175409[_0x4298('0x48')]=qs['sort'](_0x131665['query']['sort']);_0x175409['where']=qs['filters'](_[_0x4298('0x49')](_0x131665[_0x4298('0x42')],_0x38fa2b[_0x4298('0x43')]),_0x2cb591);if(_0x131665['query'][_0x4298('0x4a')]){_0x175409['where']=_[_0x4298('0x4b')](_0x175409['where'],{'$or':_[_0x4298('0x3c')](_0x2cb591,function(_0x3439ed){if(_0x3439ed['type']!==_0x4298('0x4c')){var _0x31df2c={};_0x31df2c[_0x3439ed['name']]={'$like':'%'+_0x131665[_0x4298('0x42')][_0x4298('0x4a')]+'%'};return _0x31df2c;}})});}_0x175409=_[_0x4298('0x4b')]({},_0x175409,_0x131665[_0x4298('0x4d')]);var _0x56ce89={'where':_0x175409[_0x4298('0x4e')]};return db['OpenchannelMessage'][_0x4298('0x32')](_0x56ce89)[_0x4298('0x20')](function(_0x5fc88e){_0x3785c4['count']=_0x5fc88e;if(_0x131665[_0x4298('0x42')]['includeAll']){_0x175409[_0x4298('0x4f')]=[{'all':!![]}];}return db[_0x4298('0x3d')][_0x4298('0x50')](_0x175409);})['then'](function(_0x5d9695){_0x3785c4[_0x4298('0x51')]=_0x5d9695;return _0x3785c4;})[_0x4298('0x20')](respondWithFilteredResult(_0x574950,_0x175409))[_0x4298('0x2a')](handleError(_0x574950,null));};exports[_0x4298('0x52')]=function(_0x1b921a,_0x1adfa7){var _0x2db631={'raw':!![],'where':{'id':_0x1b921a[_0x4298('0x53')]['id']}},_0x304637={};_0x304637[_0x4298('0x40')]=_[_0x4298('0x54')](db[_0x4298('0x3d')][_0x4298('0x55')]);_0x304637['query']=_['keys'](_0x1b921a[_0x4298('0x42')]);_0x304637[_0x4298('0x43')]=_[_0x4298('0x44')](_0x304637['model'],_0x304637[_0x4298('0x42')]);_0x2db631[_0x4298('0x45')]=_[_0x4298('0x44')](_0x304637['model'],qs['fields'](_0x1b921a[_0x4298('0x42')][_0x4298('0x46')]));_0x2db631[_0x4298('0x45')]=_0x2db631[_0x4298('0x45')][_0x4298('0x56')]?_0x2db631[_0x4298('0x45')]:_0x304637[_0x4298('0x40')];if(_0x1b921a[_0x4298('0x42')][_0x4298('0x57')]){_0x2db631['include']=[{'all':!![]}];}_0x2db631=_[_0x4298('0x4b')]({},_0x2db631,_0x1b921a[_0x4298('0x4d')]);return db[_0x4298('0x3d')][_0x4298('0x58')](_0x2db631)['then'](handleEntityNotFound(_0x1adfa7,null))['then'](respondWithResult(_0x1adfa7,null))[_0x4298('0x2a')](handleError(_0x1adfa7,null));};exports['create']=function(_0x3d4856,_0x35c830){return db[_0x4298('0x3d')]['create'](_0x3d4856[_0x4298('0x59')],{})[_0x4298('0x20')](respondWithResult(_0x35c830,0xc9))['catch'](handleError(_0x35c830,null));};exports[_0x4298('0x37')]=function(_0x5dfc7f,_0x5bdffc){if(_0x5dfc7f[_0x4298('0x59')]['id']){delete _0x5dfc7f[_0x4298('0x59')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x5dfc7f[_0x4298('0x53')]['id']}})[_0x4298('0x20')](handleEntityNotFound(_0x5bdffc,null))['then'](saveUpdates(_0x5dfc7f[_0x4298('0x59')],null))[_0x4298('0x20')](respondWithResult(_0x5bdffc,null))[_0x4298('0x2a')](handleError(_0x5bdffc,null));};exports[_0x4298('0x38')]=function(_0xac6b35,_0x585b7c){return db[_0x4298('0x3d')][_0x4298('0x58')]({'where':{'id':_0xac6b35['params']['id']}})[_0x4298('0x20')](handleEntityNotFound(_0x585b7c,null))[_0x4298('0x20')](removeEntity(_0x585b7c,null))[_0x4298('0x2a')](handleError(_0x585b7c,null));};exports[_0x4298('0x5a')]=function(_0x4b45ae,_0x195199){return db['OpenchannelMessage'][_0x4298('0x5a')]()[_0x4298('0x20')](respondWithResult(_0x195199,null))[_0x4298('0x2a')](handleError(_0x195199,null));};var interaction_log=require(_0x4298('0x5b'))(_0x4298('0x5c'));exports[_0x4298('0x5d')]=function(_0x322b47,_0x5e550a,_0x5da979){var _0x1d67c4={'agent':{},'channel':_0x4298('0x5e')};if(_0x322b47[_0x4298('0x59')]['id']){delete _0x322b47[_0x4298('0x59')]['id'];}_0x322b47[_0x4298('0x59')][_0x4298('0x5f')]=!![];_0x322b47['body'][_0x4298('0x60')]=moment()['format'](_0x4298('0x61'));_0x322b47[_0x4298('0x59')][_0x4298('0x62')]=_0x322b47[_0x4298('0x59')][_0x4298('0x62')]||_0x322b47['user']['id'];_0x1d67c4[_0x4298('0x63')]['id']=_0x322b47['body'][_0x4298('0x62')];return db[_0x4298('0x3d')][_0x4298('0x58')]({'where':{'id':_0x322b47[_0x4298('0x53')]['id'],'UserId':null}})[_0x4298('0x20')](handleEntityNotFound(_0x5e550a,null))['then'](saveUpdates(_0x322b47[_0x4298('0x59')],null))[_0x4298('0x20')](function(_0xb6171c){if(_0xb6171c){_0x1d67c4['message']=_0xb6171c[_0x4298('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x4298('0x58')]({'where':{'id':_0xb6171c[_0x4298('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5e550a,null))[_0x4298('0x20')](function(_0x4fb5ad){if(_0x4fb5ad){return _0x4fb5ad['update']({'UserId':_0x322b47['body'][_0x4298('0x62')],'read1stAt':_[_0x4298('0x66')](_0x4fb5ad[_0x4298('0x67')])?moment()[_0x4298('0x68')](_0x4298('0x61')):undefined});}return null;})[_0x4298('0x20')](function(_0x57f3fe){if(_0x57f3fe){_0x1d67c4[_0x4298('0x69')]=_0x57f3fe[_0x4298('0x64')]({'plain':!![]});interaction_log[_0x4298('0x21')](_0x4298('0x6a'),_0x322b47[_0x4298('0x6b')]['id'],_0x322b47[_0x4298('0x6b')][_0x4298('0x41')],_0x322b47[_0x4298('0x6b')][_0x4298('0x6c')],_0x1d67c4[_0x4298('0x69')]['id'],_0x322b47['body']?JSON[_0x4298('0x25')](_0x322b47[_0x4298('0x59')]):_0x4298('0x6d'));return respondWithRpcPromise(_0x4298('0x6e'),_0x4298('0x6f'),_0x1d67c4);}return null;})[_0x4298('0x20')](function(_0x474993){var _0x41d4ec=_0x4298('0x70')+_0x474993['message'][_0x4298('0x71')];return db[_0x4298('0x72')][_0x4298('0x42')](_0x41d4ec,{'type':db[_0x4298('0x73')][_0x4298('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x13f6b7){return _0x13f6b7;});})[_0x4298('0x20')](function(_0x4c9506){if(_0x4c9506){_0x1d67c4[_0x4298('0x28')][_0x4298('0x75')]=_0x4c9506[0x0];if(!_0x322b47[_0x4298('0x59')]['UserId'])return;return db[_0x4298('0x76')][_0x4298('0x58')]({'where':{'id':_0x322b47[_0x4298('0x59')][_0x4298('0x62')],'role':_0x4298('0x63')},'attributes':['id','name',_0x4298('0x77'),'email','internal'],'raw':!![]});}return null;})[_0x4298('0x20')](function(_0x178c62){if(!_0x178c62)return null;_0x1d67c4[_0x4298('0x28')][_0x4298('0x63')]=_0x178c62;return _0x1d67c4;})['then'](function(_0x25e4b7){if(_0x25e4b7){if(_0x322b47[_0x4298('0x59')][_0x4298('0x78')]){_0x1d67c4[_0x4298('0x28')][_0x4298('0x79')]=util[_0x4298('0x68')]('SIP/%s',_0x322b47[_0x4298('0x6b')][_0x4298('0x41')]);_0x1d67c4[_0x4298('0x28')][_0x4298('0x7a')]=_0x1d67c4[_0x4298('0x7a')];_0x1d67c4[_0x4298('0x28')][_0x4298('0x7b')]=_0x1d67c4['channel'];_0x1d67c4[_0x4298('0x28')]['event']=_0x4298('0x5d');return respondWithRpcPromise(_0x4298('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x1d67c4[_0x4298('0x28')]},client9002)[_0x4298('0x20')](function(){return _0x1d67c4;});}return _0x1d67c4;}return null;})[_0x4298('0x20')](respondWithResult(_0x5e550a,null))[_0x4298('0x2a')](handleError(_0x5e550a,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x4298('0x36')]=function(_0x656e16,_0x9f089b,_0x5accf1){var _0x1be0aa={'agent':{},'channel':_0x4298('0x5e')};if(_0x656e16['body']['id']){delete _0x656e16[_0x4298('0x59')]['id'];}_0x656e16['body'][_0x4298('0x62')]=_0x656e16[_0x4298('0x59')]['UserId']||_0x656e16[_0x4298('0x6b')]['id'];_0x1be0aa[_0x4298('0x63')]['id']=_0x656e16['body'][_0x4298('0x62')];return db[_0x4298('0x3d')]['find']({'where':{'id':_0x656e16['params']['id'],'UserId':null}})[_0x4298('0x20')](handleEntityNotFound(_0x9f089b,null))[_0x4298('0x20')](function(_0x15e921){if(_0x15e921){_0x1be0aa[_0x4298('0x28')]=_0x15e921[_0x4298('0x64')]({'plain':!![]});return db[_0x4298('0x7d')][_0x4298('0x58')]({'where':{'id':_0x15e921[_0x4298('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x9f089b,null))[_0x4298('0x20')](function(_0x335ec3){if(_0x335ec3){_0x1be0aa[_0x4298('0x69')]=_0x335ec3[_0x4298('0x64')]({'plain':!![]});interaction_log[_0x4298('0x21')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x656e16['user']['id'],_0x656e16[_0x4298('0x6b')]['name'],_0x656e16[_0x4298('0x6b')][_0x4298('0x6c')],_0x1be0aa['interaction']['id'],_0x656e16['body']?JSON[_0x4298('0x25')](_0x656e16['body']):'null');return respondWithRpcPromise(_0x4298('0x7e'),'rejectMessage',_0x1be0aa);}return null;})[_0x4298('0x20')](function(_0x2c48a1){var _0x1f4ac7=_0x4298('0x70')+_0x2c48a1[_0x4298('0x28')][_0x4298('0x71')];return db[_0x4298('0x72')][_0x4298('0x42')](_0x1f4ac7,{'type':db[_0x4298('0x73')][_0x4298('0x74')][_0x4298('0x7f')],'raw':!![]})[_0x4298('0x20')](function(_0x185c1c){return _0x185c1c;});})[_0x4298('0x20')](function(_0x3c7769){if(_0x3c7769){_0x1be0aa[_0x4298('0x28')][_0x4298('0x75')]=_0x3c7769[0x0];if(!_0x656e16[_0x4298('0x59')][_0x4298('0x62')])return;return db[_0x4298('0x76')][_0x4298('0x58')]({'where':{'id':_0x656e16[_0x4298('0x59')][_0x4298('0x62')],'role':'agent'},'attributes':['id',_0x4298('0x41'),_0x4298('0x77'),_0x4298('0x80'),_0x4298('0x81')],'raw':!![]});}return null;})[_0x4298('0x20')](function(_0x12d1fa){if(!_0x12d1fa)return null;_0x1be0aa[_0x4298('0x28')]['agent']=_0x12d1fa;return _0x1be0aa;})['then'](function(_0x5371e7){if(_0x5371e7){_0x5371e7['message'][_0x4298('0x79')]=util[_0x4298('0x68')](_0x4298('0x82'),_0x656e16[_0x4298('0x6b')]['name']);_0x5371e7[_0x4298('0x28')][_0x4298('0x7a')]=_0x1be0aa[_0x4298('0x7a')];_0x5371e7[_0x4298('0x28')]['motionChannel']=_0x1be0aa[_0x4298('0x7a')];_0x5371e7['message'][_0x4298('0x83')]=_0x4298('0x36');respondWithRpcPromise('EventManager',_0x4298('0x7c'),{'event':'rejectmessage','message':_0x5371e7['message']},client9002);return _0x1be0aa;}return null;})[_0x4298('0x20')](respondWithResult(_0x9f089b,null))[_0x4298('0x2a')](handleError(_0x9f089b,null));}; \ No newline at end of file +var _0xed08=['localhost','./openchannelMessage.socket','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','save','then','destroy','end','name','index','map','OpenchannelMessage','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','find','create','update','body','params','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x47dcc0,_0x42647e){var _0x1191cb=function(_0x2e4b82){while(--_0x2e4b82){_0x47dcc0['push'](_0x47dcc0['shift']());}};_0x1191cb(++_0x42647e);}(_0xed08,0x67));var _0x8ed0=function(_0x1f7ec0,_0xca1275){_0x1f7ec0=_0x1f7ec0-0x0;var _0x3f9992=_0xed08[_0x1f7ec0];return _0x3f9992;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed0('0x0'));var zipdir=require(_0x8ed0('0x1'));var jsonpatch=require(_0x8ed0('0x2'));var rp=require(_0x8ed0('0x3'));var moment=require(_0x8ed0('0x4'));var BPromise=require(_0x8ed0('0x5'));var Mustache=require(_0x8ed0('0x6'));var util=require(_0x8ed0('0x7'));var path=require(_0x8ed0('0x8'));var sox=require(_0x8ed0('0x9'));var csv=require(_0x8ed0('0xa'));var ejs=require(_0x8ed0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ed0('0xc'));var squel=require(_0x8ed0('0xd'));var crypto=require(_0x8ed0('0xe'));var jsforce=require(_0x8ed0('0xf'));var deskjs=require(_0x8ed0('0x10'));var toCsv=require(_0x8ed0('0xa'));var querystring=require(_0x8ed0('0x11'));var Papa=require('papaparse');var Redis=require(_0x8ed0('0x12'));var authService=require(_0x8ed0('0x13'));var qs=require(_0x8ed0('0x14'));var as=require(_0x8ed0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ed0('0x16'))(_0x8ed0('0x17'));var utils=require(_0x8ed0('0x18'));var config=require(_0x8ed0('0x19'));var licenseUtil=require(_0x8ed0('0x1a'));var db=require(_0x8ed0('0x1b'))['db'];config[_0x8ed0('0x1c')]=_[_0x8ed0('0x1d')](config[_0x8ed0('0x1c')],{'host':_0x8ed0('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ed0('0x1c')]));require(_0x8ed0('0x1f'))['register'](socket);var jayson=require(_0x8ed0('0x20'));var client=jayson[_0x8ed0('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x8ed0('0x21')][_0x8ed0('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5eda69,_0x72bf7a,_0x280676,_0x48b5a7){return new BPromise(function(_0x2792c8,_0x42afeb){var _0xb255c=_0x48b5a7||client;return _0xb255c['request'](_0x5eda69,_0x280676)['then'](function(_0x5ef89c){logger[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x72bf7a,_0x8ed0('0x25'));logger[_0x8ed0('0x26')](_0x8ed0('0x27'),_0x72bf7a,_0x8ed0('0x25'),JSON[_0x8ed0('0x28')](_0x5ef89c));if(_0x5ef89c[_0x8ed0('0x29')]){if(_0x5ef89c[_0x8ed0('0x29')]['code']===0x1f4){logger['error'](_0x8ed0('0x24'),_0x72bf7a,_0x5ef89c[_0x8ed0('0x29')]['message']);return _0x42afeb(_0x5ef89c[_0x8ed0('0x29')][_0x8ed0('0x2a')]);}logger[_0x8ed0('0x29')](_0x8ed0('0x24'),_0x72bf7a,_0x5ef89c['error'][_0x8ed0('0x2a')]);return _0x2792c8(_0x5ef89c[_0x8ed0('0x29')]['message']);}else{logger[_0x8ed0('0x23')](_0x8ed0('0x24'),_0x72bf7a,_0x8ed0('0x25'));_0x2792c8(_0x5ef89c[_0x8ed0('0x2b')][_0x8ed0('0x2a')]);}})[_0x8ed0('0x2c')](function(_0x551c91){logger['error'](_0x8ed0('0x24'),_0x72bf7a,_0x551c91);_0x42afeb(_0x551c91);});});}function respondWithStatusCode(_0x2674e9,_0x3a17d4){_0x3a17d4=_0x3a17d4||0xcc;return function(_0x158364){if(_0x158364){return _0x2674e9[_0x8ed0('0x2d')](_0x3a17d4);}return _0x2674e9[_0x8ed0('0x2e')](_0x3a17d4)['end']();};}function respondWithResult(_0xbfcca,_0x436e54){_0x436e54=_0x436e54||0xc8;return function(_0x4886f8){if(_0x4886f8){return _0xbfcca[_0x8ed0('0x2e')](_0x436e54)[_0x8ed0('0x2f')](_0x4886f8);}};}function respondWithFilteredResult(_0x29c986,_0x25617c){return function(_0x15eec2){if(_0x15eec2){var _0xec3bd2=typeof _0x25617c[_0x8ed0('0x30')]==='undefined'&&typeof _0x25617c['limit']==='undefined';var _0x5c2ff=_0x15eec2[_0x8ed0('0x31')];var _0x59a78a=_0xec3bd2?0x0:_0x25617c[_0x8ed0('0x30')];var _0x53c60c=_0xec3bd2?_0x15eec2[_0x8ed0('0x31')]:_0x25617c[_0x8ed0('0x30')]+_0x25617c['limit'];var _0x4a0c9e;if(_0x53c60c>=_0x5c2ff){_0x53c60c=_0x5c2ff;_0x4a0c9e=0xc8;}else{_0x4a0c9e=0xce;}_0x29c986[_0x8ed0('0x2e')](_0x4a0c9e);return _0x29c986[_0x8ed0('0x32')](_0x8ed0('0x33'),_0x59a78a+'-'+_0x53c60c+'/'+_0x5c2ff)['json'](_0x15eec2);}return null;};}function patchUpdates(_0x30aa44){return function(_0x4fa368){try{jsonpatch[_0x8ed0('0x34')](_0x4fa368,_0x30aa44,!![]);}catch(_0x2cca02){return BPromise[_0x8ed0('0x35')](_0x2cca02);}return _0x4fa368[_0x8ed0('0x36')]();};}function saveUpdates(_0x468683,_0x4a2fc0){return function(_0x27a3fb){if(_0x27a3fb){return _0x27a3fb['update'](_0x468683)[_0x8ed0('0x37')](function(_0x1c4642){return _0x1c4642;});}return null;};}function removeEntity(_0xa1483,_0x18b564){return function(_0x1cfd71){if(_0x1cfd71){return _0x1cfd71[_0x8ed0('0x38')]()[_0x8ed0('0x37')](function(){_0xa1483[_0x8ed0('0x2e')](0xcc)[_0x8ed0('0x39')]();});}};}function handleEntityNotFound(_0x152f3b,_0x1b7a94){return function(_0x15c206){if(!_0x15c206){_0x152f3b[_0x8ed0('0x2d')](0x194);}return _0x15c206;};}function handleError(_0x4b50d0,_0x3ddeb4){_0x3ddeb4=_0x3ddeb4||0x1f4;return function(_0x58b2b6){logger[_0x8ed0('0x29')](_0x58b2b6['stack']);if(_0x58b2b6[_0x8ed0('0x3a')]){delete _0x58b2b6[_0x8ed0('0x3a')];}_0x4b50d0[_0x8ed0('0x2e')](_0x3ddeb4)['send'](_0x58b2b6);};}exports[_0x8ed0('0x3b')]=function(_0xb58797,_0x19777e){var _0x573048={},_0x5847bd={},_0x399b1={'count':0x0,'rows':[]};var _0x2c155a=_[_0x8ed0('0x3c')](db[_0x8ed0('0x3d')]['rawAttributes'],function(_0x22257b){return{'name':_0x22257b['fieldName'],'type':_0x22257b[_0x8ed0('0x3e')][_0x8ed0('0x3f')]};});_0x5847bd['model']=_[_0x8ed0('0x3c')](_0x2c155a,_0x8ed0('0x3a'));_0x5847bd[_0x8ed0('0x40')]=_[_0x8ed0('0x41')](_0xb58797[_0x8ed0('0x40')]);_0x5847bd[_0x8ed0('0x42')]=_[_0x8ed0('0x43')](_0x5847bd['model'],_0x5847bd[_0x8ed0('0x40')]);_0x573048[_0x8ed0('0x44')]=_[_0x8ed0('0x43')](_0x5847bd[_0x8ed0('0x45')],qs[_0x8ed0('0x46')](_0xb58797[_0x8ed0('0x40')]['fields']));_0x573048[_0x8ed0('0x44')]=_0x573048[_0x8ed0('0x44')][_0x8ed0('0x47')]?_0x573048[_0x8ed0('0x44')]:_0x5847bd[_0x8ed0('0x45')];if(!_0xb58797[_0x8ed0('0x40')][_0x8ed0('0x48')](_0x8ed0('0x49'))){_0x573048[_0x8ed0('0x4a')]=qs[_0x8ed0('0x4a')](_0xb58797[_0x8ed0('0x40')][_0x8ed0('0x4a')]);_0x573048['offset']=qs[_0x8ed0('0x30')](_0xb58797['query'][_0x8ed0('0x30')]);}_0x573048[_0x8ed0('0x4b')]=qs['sort'](_0xb58797['query'][_0x8ed0('0x4c')]);_0x573048[_0x8ed0('0x4d')]=qs['filters'](_[_0x8ed0('0x4e')](_0xb58797[_0x8ed0('0x40')],_0x5847bd[_0x8ed0('0x42')]),_0x2c155a);if(_0xb58797[_0x8ed0('0x40')][_0x8ed0('0x4f')]){_0x573048[_0x8ed0('0x4d')]=_[_0x8ed0('0x50')](_0x573048['where'],{'$or':_[_0x8ed0('0x3c')](_0x2c155a,function(_0x3291dd){if(_0x3291dd[_0x8ed0('0x3e')]!==_0x8ed0('0x51')){var _0xf8851a={};_0xf8851a[_0x3291dd['name']]={'$like':'%'+_0xb58797[_0x8ed0('0x40')]['filter']+'%'};return _0xf8851a;}})});}_0x573048=_[_0x8ed0('0x50')]({},_0x573048,_0xb58797[_0x8ed0('0x52')]);var _0x3d8e4f={'where':_0x573048[_0x8ed0('0x4d')]};return db[_0x8ed0('0x3d')][_0x8ed0('0x31')](_0x3d8e4f)[_0x8ed0('0x37')](function(_0x484945){_0x399b1[_0x8ed0('0x31')]=_0x484945;if(_0xb58797[_0x8ed0('0x40')][_0x8ed0('0x53')]){_0x573048[_0x8ed0('0x54')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x8ed0('0x55')](_0x573048);})['then'](function(_0x9d8e2){_0x399b1['rows']=_0x9d8e2;return _0x399b1;})[_0x8ed0('0x37')](respondWithFilteredResult(_0x19777e,_0x573048))['catch'](handleError(_0x19777e,null));};exports[_0x8ed0('0x56')]=function(_0x55f1d7,_0x62701d){var _0x566ceb={'raw':!![],'where':{'id':_0x55f1d7['params']['id']}},_0x43643f={};_0x43643f['model']=_[_0x8ed0('0x41')](db[_0x8ed0('0x3d')][_0x8ed0('0x57')]);_0x43643f[_0x8ed0('0x40')]=_[_0x8ed0('0x41')](_0x55f1d7[_0x8ed0('0x40')]);_0x43643f[_0x8ed0('0x42')]=_['intersection'](_0x43643f[_0x8ed0('0x45')],_0x43643f[_0x8ed0('0x40')]);_0x566ceb[_0x8ed0('0x44')]=_[_0x8ed0('0x43')](_0x43643f['model'],qs[_0x8ed0('0x46')](_0x55f1d7['query']['fields']));_0x566ceb[_0x8ed0('0x44')]=_0x566ceb[_0x8ed0('0x44')][_0x8ed0('0x47')]?_0x566ceb[_0x8ed0('0x44')]:_0x43643f[_0x8ed0('0x45')];if(_0x55f1d7[_0x8ed0('0x40')][_0x8ed0('0x53')]){_0x566ceb['include']=[{'all':!![]}];}_0x566ceb=_[_0x8ed0('0x50')]({},_0x566ceb,_0x55f1d7[_0x8ed0('0x52')]);return db['OpenchannelMessage'][_0x8ed0('0x58')](_0x566ceb)[_0x8ed0('0x37')](handleEntityNotFound(_0x62701d,null))[_0x8ed0('0x37')](respondWithResult(_0x62701d,null))[_0x8ed0('0x2c')](handleError(_0x62701d,null));};exports[_0x8ed0('0x59')]=function(_0x410436,_0x3f90f4){return db[_0x8ed0('0x3d')][_0x8ed0('0x59')](_0x410436['body'],{})['then'](respondWithResult(_0x3f90f4,0xc9))[_0x8ed0('0x2c')](handleError(_0x3f90f4,null));};exports[_0x8ed0('0x5a')]=function(_0x2b9c32,_0x4183e4){if(_0x2b9c32[_0x8ed0('0x5b')]['id']){delete _0x2b9c32[_0x8ed0('0x5b')]['id'];}return db[_0x8ed0('0x3d')][_0x8ed0('0x58')]({'where':{'id':_0x2b9c32[_0x8ed0('0x5c')]['id']}})[_0x8ed0('0x37')](handleEntityNotFound(_0x4183e4,null))[_0x8ed0('0x37')](saveUpdates(_0x2b9c32[_0x8ed0('0x5b')],null))[_0x8ed0('0x37')](respondWithResult(_0x4183e4,null))[_0x8ed0('0x2c')](handleError(_0x4183e4,null));};exports[_0x8ed0('0x38')]=function(_0x3de2c9,_0x2b3865){return db['OpenchannelMessage'][_0x8ed0('0x58')]({'where':{'id':_0x3de2c9['params']['id']}})[_0x8ed0('0x37')](handleEntityNotFound(_0x2b3865,null))[_0x8ed0('0x37')](removeEntity(_0x2b3865,null))[_0x8ed0('0x2c')](handleError(_0x2b3865,null));};exports['describe']=function(_0x421031,_0x5aa7c8){return db[_0x8ed0('0x3d')]['describe']()[_0x8ed0('0x37')](respondWithResult(_0x5aa7c8,null))[_0x8ed0('0x2c')](handleError(_0x5aa7c8,null));};var interaction_log=require(_0x8ed0('0x16'))('openchannel-interactions');exports[_0x8ed0('0x5d')]=function(_0x1e610f,_0x2233e8,_0x3f5534){var _0x33e48d={'agent':{},'channel':_0x8ed0('0x5e')};if(_0x1e610f['body']['id']){delete _0x1e610f[_0x8ed0('0x5b')]['id'];}_0x1e610f[_0x8ed0('0x5b')][_0x8ed0('0x5f')]=!![];_0x1e610f[_0x8ed0('0x5b')]['readAt']=moment()['format'](_0x8ed0('0x60'));_0x1e610f[_0x8ed0('0x5b')]['UserId']=_0x1e610f['body'][_0x8ed0('0x61')]||_0x1e610f['user']['id'];_0x33e48d['agent']['id']=_0x1e610f['body'][_0x8ed0('0x61')];return db[_0x8ed0('0x3d')][_0x8ed0('0x58')]({'where':{'id':_0x1e610f[_0x8ed0('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2233e8,null))[_0x8ed0('0x37')](saveUpdates(_0x1e610f[_0x8ed0('0x5b')],null))[_0x8ed0('0x37')](function(_0x20ea44){if(_0x20ea44){_0x33e48d[_0x8ed0('0x2a')]=_0x20ea44[_0x8ed0('0x62')]({'plain':!![]});return db[_0x8ed0('0x63')][_0x8ed0('0x58')]({'where':{'id':_0x20ea44[_0x8ed0('0x64')]}});}return null;})[_0x8ed0('0x37')](handleEntityNotFound(_0x2233e8,null))['then'](function(_0x22d82a){if(_0x22d82a){return _0x22d82a[_0x8ed0('0x5a')]({'UserId':_0x1e610f['body'][_0x8ed0('0x61')],'read1stAt':_['isNil'](_0x22d82a[_0x8ed0('0x65')])?moment()[_0x8ed0('0x66')](_0x8ed0('0x60')):undefined});}return null;})[_0x8ed0('0x37')](function(_0x380111){if(_0x380111){_0x33e48d[_0x8ed0('0x67')]=_0x380111[_0x8ed0('0x62')]({'plain':!![]});interaction_log[_0x8ed0('0x23')](_0x8ed0('0x68'),_0x1e610f[_0x8ed0('0x69')]['id'],_0x1e610f[_0x8ed0('0x69')][_0x8ed0('0x3a')],_0x1e610f[_0x8ed0('0x69')][_0x8ed0('0x6a')],_0x33e48d[_0x8ed0('0x67')]['id'],_0x1e610f[_0x8ed0('0x5b')]?JSON[_0x8ed0('0x28')](_0x1e610f['body']):_0x8ed0('0x6b'));return respondWithRpcPromise(_0x8ed0('0x6c'),_0x8ed0('0x6d'),_0x33e48d);}return null;})[_0x8ed0('0x37')](function(_0x114a95){var _0xa22330=_0x8ed0('0x6e')+_0x114a95[_0x8ed0('0x2a')]['ContactId'];return db[_0x8ed0('0x6f')][_0x8ed0('0x40')](_0xa22330,{'type':db[_0x8ed0('0x70')][_0x8ed0('0x71')][_0x8ed0('0x72')],'raw':!![]})[_0x8ed0('0x37')](function(_0x485d10){return _0x485d10;});})[_0x8ed0('0x37')](function(_0x7b4a8d){if(_0x7b4a8d){_0x33e48d[_0x8ed0('0x2a')][_0x8ed0('0x73')]=_0x7b4a8d[0x0];if(!_0x1e610f['body'][_0x8ed0('0x61')])return;return db[_0x8ed0('0x74')][_0x8ed0('0x58')]({'where':{'id':_0x1e610f[_0x8ed0('0x5b')][_0x8ed0('0x61')],'role':'agent'},'attributes':['id','name',_0x8ed0('0x75'),_0x8ed0('0x76'),_0x8ed0('0x77')],'raw':!![]});}return null;})[_0x8ed0('0x37')](function(_0x1d19ac){if(!_0x1d19ac)return null;_0x33e48d[_0x8ed0('0x2a')]['agent']=_0x1d19ac;return _0x33e48d;})[_0x8ed0('0x37')](function(_0xe82ab5){if(_0xe82ab5){if(_0x1e610f[_0x8ed0('0x5b')]['manual']){_0x33e48d[_0x8ed0('0x2a')][_0x8ed0('0x78')]=util[_0x8ed0('0x66')](_0x8ed0('0x79'),_0x1e610f[_0x8ed0('0x69')][_0x8ed0('0x3a')]);_0x33e48d['message'][_0x8ed0('0x7a')]=_0x33e48d[_0x8ed0('0x7a')];_0x33e48d[_0x8ed0('0x2a')][_0x8ed0('0x7b')]=_0x33e48d['channel'];_0x33e48d[_0x8ed0('0x2a')][_0x8ed0('0x7c')]='accept';return respondWithRpcPromise(_0x8ed0('0x7d'),'EventManager',{'event':_0x8ed0('0x7e'),'message':_0x33e48d[_0x8ed0('0x2a')]},client9002)[_0x8ed0('0x37')](function(){return _0x33e48d;});}return _0x33e48d;}return null;})[_0x8ed0('0x37')](respondWithResult(_0x2233e8,null))['catch'](handleError(_0x2233e8,null));};var interaction_log=require(_0x8ed0('0x16'))(_0x8ed0('0x7f'));exports[_0x8ed0('0x35')]=function(_0x889d9,_0x41470b,_0x155a62){var _0xbaf6bf={'agent':{},'channel':'openchannel'};if(_0x889d9[_0x8ed0('0x5b')]['id']){delete _0x889d9['body']['id'];}_0x889d9['body']['UserId']=_0x889d9[_0x8ed0('0x5b')][_0x8ed0('0x61')]||_0x889d9[_0x8ed0('0x69')]['id'];_0xbaf6bf[_0x8ed0('0x80')]['id']=_0x889d9[_0x8ed0('0x5b')][_0x8ed0('0x61')];return db['OpenchannelMessage'][_0x8ed0('0x58')]({'where':{'id':_0x889d9['params']['id'],'UserId':null}})[_0x8ed0('0x37')](handleEntityNotFound(_0x41470b,null))[_0x8ed0('0x37')](function(_0x4fcb24){if(_0x4fcb24){_0xbaf6bf[_0x8ed0('0x2a')]=_0x4fcb24[_0x8ed0('0x62')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x4fcb24[_0x8ed0('0x64')]}});}return null;})[_0x8ed0('0x37')](handleEntityNotFound(_0x41470b,null))[_0x8ed0('0x37')](function(_0x3f0ff5){if(_0x3f0ff5){_0xbaf6bf['interaction']=_0x3f0ff5[_0x8ed0('0x62')]({'plain':!![]});interaction_log[_0x8ed0('0x23')](_0x8ed0('0x81'),_0x889d9[_0x8ed0('0x69')]['id'],_0x889d9[_0x8ed0('0x69')][_0x8ed0('0x3a')],_0x889d9[_0x8ed0('0x69')]['role'],_0xbaf6bf['interaction']['id'],_0x889d9[_0x8ed0('0x5b')]?JSON['stringify'](_0x889d9[_0x8ed0('0x5b')]):_0x8ed0('0x6b'));return respondWithRpcPromise('RejectMessage',_0x8ed0('0x82'),_0xbaf6bf);}return null;})['then'](function(_0x1a9e72){var _0x59d76f=_0x8ed0('0x6e')+_0x1a9e72[_0x8ed0('0x2a')][_0x8ed0('0x83')];return db[_0x8ed0('0x6f')][_0x8ed0('0x40')](_0x59d76f,{'type':db[_0x8ed0('0x70')][_0x8ed0('0x71')][_0x8ed0('0x72')],'raw':!![]})[_0x8ed0('0x37')](function(_0x573a1a){return _0x573a1a;});})['then'](function(_0x284c1d){if(_0x284c1d){_0xbaf6bf[_0x8ed0('0x2a')]['contact']=_0x284c1d[0x0];if(!_0x889d9[_0x8ed0('0x5b')][_0x8ed0('0x61')])return;return db[_0x8ed0('0x74')]['find']({'where':{'id':_0x889d9[_0x8ed0('0x5b')]['UserId'],'role':_0x8ed0('0x80')},'attributes':['id',_0x8ed0('0x3a'),_0x8ed0('0x75'),_0x8ed0('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1f2bb7){if(!_0x1f2bb7)return null;_0xbaf6bf[_0x8ed0('0x2a')][_0x8ed0('0x80')]=_0x1f2bb7;return _0xbaf6bf;})[_0x8ed0('0x37')](function(_0x582321){if(_0x582321){_0x582321[_0x8ed0('0x2a')]['interface']=util[_0x8ed0('0x66')](_0x8ed0('0x79'),_0x889d9['user'][_0x8ed0('0x3a')]);_0x582321[_0x8ed0('0x2a')][_0x8ed0('0x7a')]=_0xbaf6bf[_0x8ed0('0x7a')];_0x582321[_0x8ed0('0x2a')]['motionChannel']=_0xbaf6bf[_0x8ed0('0x7a')];_0x582321['message']['event']='reject';respondWithRpcPromise(_0x8ed0('0x7d'),_0x8ed0('0x7d'),{'event':_0x8ed0('0x84'),'message':_0x582321[_0x8ed0('0x2a')]},client9002);return _0xbaf6bf;}return null;})[_0x8ed0('0x37')](respondWithResult(_0x41470b,null))['catch'](handleError(_0x41470b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 2414450..b9b3ce6 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 _0x2c82=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','emit','hook','events'];(function(_0x5e9555,_0x212afc){var _0x50024c=function(_0x2c3e21){while(--_0x2c3e21){_0x5e9555['push'](_0x5e9555['shift']());}};_0x50024c(++_0x212afc);}(_0x2c82,0x12f));var _0x22c8=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x2c82[_0x5c468f];return _0x2136b0;};'use strict';var EventEmitter=require(_0x22c8('0x0'));var OpenchannelMessage=require(_0x22c8('0x1'))['db'][_0x22c8('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x22c8('0x3')](0x0);var events={'afterCreate':_0x22c8('0x4'),'afterUpdate':_0x22c8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x499ed3){return function(_0x4677d3,_0x120226,_0x1b36b5){OpenchannelMessageEvents[_0x22c8('0x6')](_0x499ed3+':'+_0x4677d3['id'],_0x4677d3);OpenchannelMessageEvents[_0x22c8('0x6')](_0x499ed3,_0x4677d3);_0x1b36b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x22c8('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xfd9d=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xdf0547,_0x3fede7){var _0x5d1804=function(_0x976802){while(--_0x976802){_0xdf0547['push'](_0xdf0547['shift']());}};_0x5d1804(++_0x3fede7);}(_0xfd9d,0x194));var _0xdfd9=function(_0x1265ed,_0x4b85e8){_0x1265ed=_0x1265ed-0x0;var _0x5ac459=_0xfd9d[_0x1265ed];return _0x5ac459;};'use strict';var EventEmitter=require(_0xdfd9('0x0'));var OpenchannelMessage=require(_0xdfd9('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xdfd9('0x2')](0x0);var events={'afterCreate':_0xdfd9('0x3'),'afterUpdate':_0xdfd9('0x4'),'afterDestroy':_0xdfd9('0x5')};function emitEvent(_0x49c767){return function(_0x104594,_0x36ac7d,_0x5e356a){OpenchannelMessageEvents[_0xdfd9('0x6')](_0x49c767+':'+_0x104594['id'],_0x104594);OpenchannelMessageEvents['emit'](_0x49c767,_0x104594);_0x5e356a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xdfd9('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 69ac956..5f33526 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 _0x0dbe=['find','OpenchannelAccountId','OpenchannelInteraction','Contact','keys','get','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','omit','GET','POST','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','isNil','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','secret','CmContact','OpenchannelAccount'];(function(_0x123de7,_0x3b4162){var _0x5de866=function(_0x478520){while(--_0x478520){_0x123de7['push'](_0x123de7['shift']());}};_0x5de866(++_0x3b4162);}(_0x0dbe,0xe3));var _0xe0db=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x0dbe[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0xe0db('0x0'));var util=require('util');var logger=require(_0xe0db('0x1'))(_0xe0db('0x2'));var moment=require('moment');var BPromise=require(_0xe0db('0x3'));var rp=require(_0xe0db('0x4'));var fs=require('fs');var path=require(_0xe0db('0x5'));var rimraf=require('rimraf');var config=require(_0xe0db('0x6'));var attributes=require(_0xe0db('0x7'));module[_0xe0db('0x8')]=function(_0x306c49,_0xab1c8){return _0x306c49[_0xe0db('0x9')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xe0db('0xa'),'fields':[_0xe0db('0xb')],'type':_0xe0db('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x363c19,_0x4df527,_0x273884){var _0x247f43=_0x306c49[_0xe0db('0xd')];var _0x2b04ba=_0x363c19['get']({'plain':!![]});if(_0x2b04ba[_0xe0db('0xe')][_0xe0db('0xf')]()==='in'||_0x2b04ba[_0xe0db('0xe')][_0xe0db('0xf')]()==='out'&&!_0x2b04ba['secret']&&!_[_0xe0db('0x10')](_0x2b04ba['UserId'])){_0x247f43['OpenchannelInteraction'][_0xe0db('0x11')]({'where':{'id':_0x2b04ba[_0xe0db('0x12')]}})[_0xe0db('0x13')](function(_0x1798c1){if(_0x1798c1){_0x1798c1[_0xe0db('0x14')]({'lastMsgAt':_0x2b04ba[_0xe0db('0x15')],'lastMsgDirection':_0x2b04ba[_0xe0db('0xe')][_0xe0db('0xf')]()});}})[_0xe0db('0x16')](function(_0x1746e6){console[_0xe0db('0x17')](_0x1746e6);});}if(_0x2b04ba[_0xe0db('0xe')]===_0xe0db('0x18')&&!_0x2b04ba[_0xe0db('0x19')]){var _0x18b9c7;_0x247f43[_0xe0db('0x1a')]['describe']()[_0xe0db('0x13')](function(_0x530649){return _0x247f43[_0xe0db('0x1b')][_0xe0db('0x1c')]({'where':{'id':_0x2b04ba[_0xe0db('0x1d')]},'include':[{'model':_0x247f43[_0xe0db('0x1e')],'as':'Interactions','where':{'id':_0x2b04ba[_0xe0db('0x12')]},'limit':0x1,'include':[{'model':_0x247f43['CmContact'],'as':_0xe0db('0x1f'),'attributes':_[_0xe0db('0x20')](_0x530649)}]}]});})['then'](function(_0x455aa0){_0x18b9c7=_0x455aa0[_0xe0db('0x21')]({'plain':!![]});if(_0x18b9c7&&_0x18b9c7['replyUri']){logger['info'](_0xe0db('0x22'),_0xe0db('0x23'),util['format'](_0xe0db('0x24'),_0x2b04ba['id'],_0x18b9c7[_0xe0db('0x25')]));if(_0x18b9c7['Interactions']&&_0x18b9c7[_0xe0db('0x26')][_0xe0db('0x27')]){_0x2b04ba['Interaction']=_[_0xe0db('0x28')](_0x18b9c7[_0xe0db('0x26')][0x0],_0xe0db('0x1f'));_0x2b04ba[_0xe0db('0x1f')]=_0x18b9c7['Interactions'][0x0]['Contact'];}var _0x4df527={'method':'POST','uri':encodeURI(_0x18b9c7[_0xe0db('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4df527['method']){case _0xe0db('0x29'):_0x4df527['qs']=_0x2b04ba;break;case _0xe0db('0x2a'):_0x4df527[_0xe0db('0xb')]=_0x2b04ba;break;}return rp(_0x4df527)[_0xe0db('0x13')](function(_0x4b9538){logger[_0xe0db('0x2b')](_0xe0db('0x22'),_0xe0db('0x23'),util['format'](_0xe0db('0x2c'),_0x2b04ba['id'],_0x18b9c7[_0xe0db('0x25')]));if(_0x4b9538[_0xe0db('0xb')][_0xe0db('0x2d')]&&_0x4b9538['body'][_0xe0db('0x2d')]!=_0x2b04ba['Interaction'][_0xe0db('0x2d')]){return _0x247f43[_0xe0db('0x1e')][_0xe0db('0x14')]({'threadId':_0x4b9538[_0xe0db('0xb')]['threadId']},{'where':{'id':_0x2b04ba[_0xe0db('0x2e')]['id']}});}else{return;}})['then'](function(){return _0x363c19[_0xe0db('0x14')]({'read':!![]});})['catch'](function(_0x2ba47f){logger['error'](_0xe0db('0x22'),'afterCreate',util[_0xe0db('0x2f')](_0x2ba47f,{'showHidden':![],'depth':null}));_0x273884();});}else{_0x273884();}})[_0xe0db('0x30')](function(){_0x273884();});}else{_0x273884();}}},'charset':_0xe0db('0x31'),'collate':_0xe0db('0x32')});}; \ No newline at end of file +var _0x6676=['finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','then','createdAt','error','describe','OpenchannelAccount','find','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','method','threadId','Interaction','update','catch','inspect'];(function(_0x98b464,_0x551d30){var _0x7b5672=function(_0x1b126f){while(--_0x1b126f){_0x98b464['push'](_0x98b464['shift']());}};_0x7b5672(++_0x551d30);}(_0x6676,0x1cd));var _0x6667=function(_0x7f7f7,_0x293acf){_0x7f7f7=_0x7f7f7-0x0;var _0x5c7f7e=_0x6676[_0x7f7f7];return _0x5c7f7e;};'use strict';var _=require(_0x6667('0x0'));var util=require(_0x6667('0x1'));var logger=require(_0x6667('0x2'))(_0x6667('0x3'));var moment=require(_0x6667('0x4'));var BPromise=require('bluebird');var rp=require(_0x6667('0x5'));var fs=require('fs');var path=require(_0x6667('0x6'));var rimraf=require(_0x6667('0x7'));var config=require(_0x6667('0x8'));var attributes=require(_0x6667('0x9'));module[_0x6667('0xa')]=function(_0x3b2897,_0xa4b724){return _0x3b2897['define'](_0x6667('0xb'),attributes,{'tableName':_0x6667('0xc'),'paranoid':![],'indexes':[{'name':_0x6667('0xd'),'fields':[_0x6667('0xe')],'type':_0x6667('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50f028,_0x17d62e,_0x1db46e){var _0x166bf6=_0x3b2897[_0x6667('0x10')];var _0x52ba5e=_0x50f028[_0x6667('0x11')]({'plain':!![]});if(_0x52ba5e[_0x6667('0x12')][_0x6667('0x13')]()==='in'||_0x52ba5e[_0x6667('0x12')][_0x6667('0x13')]()===_0x6667('0x14')&&!_0x52ba5e[_0x6667('0x15')]&&!_[_0x6667('0x16')](_0x52ba5e[_0x6667('0x17')])){_0x166bf6[_0x6667('0x18')]['findOne']({'where':{'id':_0x52ba5e['OpenchannelInteractionId']}})[_0x6667('0x19')](function(_0x27013e){if(_0x27013e){_0x27013e['update']({'lastMsgAt':_0x52ba5e[_0x6667('0x1a')],'lastMsgDirection':_0x52ba5e[_0x6667('0x12')]['toLowerCase']()});}})['catch'](function(_0x2617af){console[_0x6667('0x1b')](_0x2617af);});}if(_0x52ba5e[_0x6667('0x12')]===_0x6667('0x14')&&!_0x52ba5e['secret']){var _0x580774;_0x166bf6['CmContact'][_0x6667('0x1c')]()[_0x6667('0x19')](function(_0x45ed02){return _0x166bf6[_0x6667('0x1d')][_0x6667('0x1e')]({'where':{'id':_0x52ba5e['OpenchannelAccountId']},'include':[{'model':_0x166bf6['OpenchannelInteraction'],'as':_0x6667('0x1f'),'where':{'id':_0x52ba5e[_0x6667('0x20')]},'limit':0x1,'include':[{'model':_0x166bf6['CmContact'],'as':_0x6667('0x21'),'attributes':_[_0x6667('0x22')](_0x45ed02)}]}]});})[_0x6667('0x19')](function(_0x220898){_0x580774=_0x220898[_0x6667('0x11')]({'plain':!![]});if(_0x580774&&_0x580774[_0x6667('0x23')]){logger[_0x6667('0x24')](_0x6667('0x25'),_0x6667('0x26'),util[_0x6667('0x27')](_0x6667('0x28'),_0x52ba5e['id'],_0x580774[_0x6667('0x23')]));if(_0x580774[_0x6667('0x1f')]&&_0x580774['Interactions'][_0x6667('0x29')]){_0x52ba5e['Interaction']=_[_0x6667('0x2a')](_0x580774['Interactions'][0x0],'Contact');_0x52ba5e[_0x6667('0x21')]=_0x580774[_0x6667('0x1f')][0x0][_0x6667('0x21')];}var _0x17d62e={'method':'POST','uri':encodeURI(_0x580774[_0x6667('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x17d62e[_0x6667('0x2b')]){case'GET':_0x17d62e['qs']=_0x52ba5e;break;case'POST':_0x17d62e[_0x6667('0xe')]=_0x52ba5e;break;}return rp(_0x17d62e)[_0x6667('0x19')](function(_0x4020cd){logger[_0x6667('0x24')](_0x6667('0x25'),_0x6667('0x26'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x52ba5e['id'],_0x580774[_0x6667('0x23')]));if(_0x4020cd[_0x6667('0xe')][_0x6667('0x2c')]&&_0x4020cd['body'][_0x6667('0x2c')]!=_0x52ba5e[_0x6667('0x2d')][_0x6667('0x2c')]){return _0x166bf6['OpenchannelInteraction'][_0x6667('0x2e')]({'threadId':_0x4020cd[_0x6667('0xe')]['threadId']},{'where':{'id':_0x52ba5e[_0x6667('0x2d')]['id']}});}else{return;}})[_0x6667('0x19')](function(){return _0x50f028[_0x6667('0x2e')]({'read':!![]});})[_0x6667('0x2f')](function(_0x2b5cb2){logger[_0x6667('0x1b')](_0x6667('0x25'),_0x6667('0x26'),util[_0x6667('0x30')](_0x2b5cb2,{'showHidden':![],'depth':null}));_0x1db46e();});}else{_0x1db46e();}})[_0x6667('0x31')](function(){_0x1db46e();});}else{_0x1db46e();}}},'charset':'utf8mb4','collate':_0x6667('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index e6e150a..8b6ae36 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3e047f,_0x55ca3e){var _0x3446a5=function(_0x5b7abb){while(--_0x5b7abb){_0x3e047f['push'](_0x3e047f['shift']());}};_0x3446a5(++_0x55ca3e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x294fda,_0x474d4c){var _0x53da81=function(_0x5548a0){while(--_0x5548a0){_0x294fda['push'](_0x294fda['shift']());}};_0x53da81(++_0x474d4c);}(_0x2ef3,0xba));var _0x32ef=function(_0x45e707,_0x11911f){_0x45e707=_0x45e707-0x0;var _0xaa6abf=_0x2ef3[_0x45e707];return _0xaa6abf;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 6aebe75..8feb716 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 _0x7412=['update','openchannelMessage:','./openchannelMessage.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7412,0x161));var _0x2741=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x7412[_0x2e4e19];return _0x9ba20b;};'use strict';var OpenchannelMessageEvents=require(_0x2741('0x0'));var events=['save','remove',_0x2741('0x1')];function createListener(_0x5866ac,_0x3897d4){return function(_0x50a90f){_0x3897d4['emit'](_0x5866ac,_0x50a90f);};}function removeListener(_0x509ce6,_0x552836){return function(){OpenchannelMessageEvents['removeListener'](_0x509ce6,_0x552836);};}exports['register']=function(_0x23985b){for(var _0xcc6e28=0x0,_0x415623=events['length'];_0xcc6e28<_0x415623;_0xcc6e28++){var _0x1f1f0d=events[_0xcc6e28];var _0x1f1451=createListener(_0x2741('0x2')+_0x1f1f0d,_0x23985b);OpenchannelMessageEvents['on'](_0x1f1f0d,_0x1f1451);}}; \ No newline at end of file +var _0x8bea=['./openchannelMessage.events','save','remove','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x8bea,0xfc));var _0xa8be=function(_0x1fa5ac,_0x815a90){_0x1fa5ac=_0x1fa5ac-0x0;var _0x25cdf3=_0x8bea[_0x1fa5ac];return _0x25cdf3;};'use strict';var OpenchannelMessageEvents=require(_0xa8be('0x0'));var events=[_0xa8be('0x1'),_0xa8be('0x2'),_0xa8be('0x3')];function createListener(_0x2fe52e,_0x7b1d84){return function(_0x5ac9c1){_0x7b1d84[_0xa8be('0x4')](_0x2fe52e,_0x5ac9c1);};}function removeListener(_0x2ef761,_0x1fc3a0){return function(){OpenchannelMessageEvents[_0xa8be('0x5')](_0x2ef761,_0x1fc3a0);};}exports[_0xa8be('0x6')]=function(_0x39d97b){for(var _0x381ef6=0x0,_0x200872=events[_0xa8be('0x7')];_0x381ef6<_0x200872;_0x381ef6++){var _0x5e726d=events[_0x381ef6];var _0x20b355=createListener(_0xa8be('0x8')+_0x5e726d,_0x39d97b);OpenchannelMessageEvents['on'](_0x5e726d,_0x20b355);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5d0d38e..2e2beb0 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 _0xa11b=['post','create','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','getMembers','getTeams','/:id/users','getAgents'];(function(_0x3bec98,_0x27367f){var _0x11305c=function(_0x1b0fe1){while(--_0x1b0fe1){_0x3bec98['push'](_0x3bec98['shift']());}};_0x11305c(++_0x27367f);}(_0xa11b,0xfc));var _0xba11=function(_0x5a1552,_0x5478df){_0x5a1552=_0x5a1552-0x0;var _0x88e370=_0xa11b[_0x5a1552];return _0x88e370;};'use strict';var multer=require(_0xba11('0x0'));var util=require(_0xba11('0x1'));var path=require(_0xba11('0x2'));var timeout=require(_0xba11('0x3'));var express=require(_0xba11('0x4'));var router=express[_0xba11('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xba11('0x6'));var config=require(_0xba11('0x7'));var controller=require('./openchannelQueue.controller');router[_0xba11('0x8')]('/',auth[_0xba11('0x9')](),controller[_0xba11('0xa')]);router['get'](_0xba11('0xb'),auth[_0xba11('0x9')](),controller['describe']);router[_0xba11('0x8')](_0xba11('0xc'),auth['isAuthenticated'](),controller[_0xba11('0xd')]);router[_0xba11('0x8')]('/:id/members',auth[_0xba11('0x9')](),controller[_0xba11('0xe')]);router['get']('/:id/teams',auth[_0xba11('0x9')](),controller[_0xba11('0xf')]);router[_0xba11('0x8')](_0xba11('0x10'),auth[_0xba11('0x9')](),controller[_0xba11('0x11')]);router[_0xba11('0x12')]('/',auth[_0xba11('0x9')](),controller[_0xba11('0x13')]);router[_0xba11('0x12')](_0xba11('0x14'),auth[_0xba11('0x9')](),controller[_0xba11('0x15')]);router['post'](_0xba11('0x10'),auth[_0xba11('0x9')](),controller[_0xba11('0x16')]);router[_0xba11('0x17')](_0xba11('0xc'),auth['isAuthenticated'](),controller[_0xba11('0x18')]);router['delete']('/:id',auth[_0xba11('0x9')](),controller[_0xba11('0x19')]);router[_0xba11('0x1a')](_0xba11('0x14'),auth[_0xba11('0x9')](),controller[_0xba11('0x1b')]);router[_0xba11('0x1a')]('/:id/users',auth[_0xba11('0x9')](),controller[_0xba11('0x1c')]);module[_0xba11('0x1d')]=router; \ No newline at end of file +var _0xbe9d=['addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','describe','get','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xbe9d,0x1d8));var _0xdbe9=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xbe9d[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xdbe9('0x0'));var util=require(_0xdbe9('0x1'));var path=require(_0xdbe9('0x2'));var timeout=require(_0xdbe9('0x3'));var express=require(_0xdbe9('0x4'));var router=express[_0xdbe9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdbe9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdbe9('0x7'));var controller=require(_0xdbe9('0x8'));router['get']('/',auth[_0xdbe9('0x9')](),controller[_0xdbe9('0xa')]);router['get']('/describe',auth[_0xdbe9('0x9')](),controller[_0xdbe9('0xb')]);router[_0xdbe9('0xc')](_0xdbe9('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xdbe9('0xe'),auth[_0xdbe9('0x9')](),controller[_0xdbe9('0xf')]);router[_0xdbe9('0xc')](_0xdbe9('0x10'),auth[_0xdbe9('0x9')](),controller['getTeams']);router[_0xdbe9('0xc')](_0xdbe9('0x11'),auth[_0xdbe9('0x9')](),controller[_0xdbe9('0x12')]);router[_0xdbe9('0x13')]('/',auth[_0xdbe9('0x9')](),controller[_0xdbe9('0x14')]);router[_0xdbe9('0x13')](_0xdbe9('0x10'),auth[_0xdbe9('0x9')](),controller[_0xdbe9('0x15')]);router['post'](_0xdbe9('0x11'),auth[_0xdbe9('0x9')](),controller['addAgents']);router[_0xdbe9('0x16')](_0xdbe9('0xd'),auth[_0xdbe9('0x9')](),controller[_0xdbe9('0x17')]);router[_0xdbe9('0x18')](_0xdbe9('0xd'),auth[_0xdbe9('0x9')](),controller[_0xdbe9('0x19')]);router[_0xdbe9('0x18')](_0xdbe9('0x10'),auth[_0xdbe9('0x9')](),controller[_0xdbe9('0x1a')]);router[_0xdbe9('0x18')](_0xdbe9('0x11'),auth[_0xdbe9('0x9')](),controller[_0xdbe9('0x1b')]);module[_0xdbe9('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c90fb60..1c97c94 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 _0x97d8=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x6ceb53,_0x335a46){var _0x5ea9a8=function(_0x17456e){while(--_0x17456e){_0x6ceb53['push'](_0x6ceb53['shift']());}};_0x5ea9a8(++_0x335a46);}(_0x97d8,0x13b));var _0x897d=function(_0x447de2,_0x13fac5){_0x447de2=_0x447de2-0x0;var _0x532e99=_0x97d8[_0x447de2];return _0x532e99;};'use strict';var Sequelize=require(_0x897d('0x0'));module[_0x897d('0x1')]={'name':{'type':Sequelize[_0x897d('0x2')],'unique':_0x897d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x897d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x897d('0x5')](_0x897d('0x6'),'beepall',_0x897d('0x7'))}}; \ No newline at end of file +var _0x6dd7=['beepall','roundrobin','sequelize','STRING','ENUM','rrmemory'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6dd7,0x11c));var _0x76dd=function(_0x5af812,_0x43d252){_0x5af812=_0x5af812-0x0;var _0x1489f2=_0x6dd7[_0x5af812];return _0x1489f2;};'use strict';var Sequelize=require(_0x76dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x76dd('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x76dd('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x76dd('0x2')](_0x76dd('0x3'),_0x76dd('0x4'),_0x76dd('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 64e6bdd..4eeb321 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 _0x22ad=['order','sort','pick','OpenchannelQueueId','filter','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','findAll','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','field','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','toString','SELECT','TeamId','includes','all','union','ids','isEmpty','userOpenchannelQueue:remove','addAgents','emit','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','set','update','destroy','then','OpenchannelQueues','UserProfileResource','status','error','stack','name','send','map','OpenchannelQueue','rawAttributes','fieldName','type','key','where','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit'];(function(_0x130c7d,_0x155870){var _0xaaa03e=function(_0x553bd7){while(--_0x553bd7){_0x130c7d['push'](_0x130c7d['shift']());}};_0xaaa03e(++_0x155870);}(_0x22ad,0xa1));var _0xd22a=function(_0x160c6e,_0x5e2cd6){_0x160c6e=_0x160c6e-0x0;var _0x3759dc=_0x22ad[_0x160c6e];return _0x3759dc;};'use strict';var BPromise=require(_0xd22a('0x0'));var util=require(_0xd22a('0x1'));var _=require(_0xd22a('0x2'));var squel=require('squel');var Redis=require(_0xd22a('0x3'));var qs=require(_0xd22a('0x4'));var logger=require('../../config/logger')(_0xd22a('0x5'));var config=require(_0xd22a('0x6'));var db=require(_0xd22a('0x7'))['db'];config[_0xd22a('0x8')]=_[_0xd22a('0x9')](config[_0xd22a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd22a('0xa'))(new Redis(config['redis']));require(_0xd22a('0xb'))[_0xd22a('0xc')](socket);function respondWithStatusCode(_0x413fc9,_0x4337f8){_0x4337f8=_0x4337f8||0xcc;return function(_0x51d2b9){if(_0x51d2b9){return _0x413fc9[_0xd22a('0xd')](_0x4337f8);}return _0x413fc9['status'](_0x4337f8)[_0xd22a('0xe')]();};}function respondWithResult(_0x3a69a4,_0x3edccd){_0x3edccd=_0x3edccd||0xc8;return function(_0x41c077){if(_0x41c077){return _0x3a69a4['status'](_0x3edccd)[_0xd22a('0xf')](_0x41c077);}};}function respondWithFilteredResult(_0x44e813,_0xdc3cdb){return function(_0x63c2e1){if(_0x63c2e1){var _0x233687=typeof _0xdc3cdb[_0xd22a('0x10')]===_0xd22a('0x11')&&typeof _0xdc3cdb[_0xd22a('0x12')]===_0xd22a('0x11');var _0xee8e50=_0x63c2e1[_0xd22a('0x13')];var _0x4c2062=_0x233687?0x0:_0xdc3cdb['offset'];var _0x3a7bb1=_0x233687?_0x63c2e1[_0xd22a('0x13')]:_0xdc3cdb[_0xd22a('0x10')]+_0xdc3cdb[_0xd22a('0x12')];var _0x2ef7fd;if(_0x3a7bb1>=_0xee8e50){_0x3a7bb1=_0xee8e50;_0x2ef7fd=0xc8;}else{_0x2ef7fd=0xce;}_0x44e813['status'](_0x2ef7fd);return _0x44e813[_0xd22a('0x14')]('Content-Range',_0x4c2062+'-'+_0x3a7bb1+'/'+_0xee8e50)[_0xd22a('0xf')](_0x63c2e1);}return null;};}function saveUpdates(_0x2bb48c){return function(_0x1c2df2){if(_0x1c2df2){return _0x1c2df2[_0xd22a('0x15')](_0x2bb48c)['then'](function(_0x3d308b){return _0x3d308b;});}return null;};}function removeEntity(_0x1409c3){return function(_0x3ac651){if(_0x3ac651){return _0x3ac651[_0xd22a('0x16')]()[_0xd22a('0x17')](function(){var _0x14f10b=_0x3ac651['get']({'plain':!![]});var _0x357973=_0xd22a('0x18');return db[_0xd22a('0x19')]['destroy']({'where':{'type':_0x357973,'resourceId':_0x14f10b['id']}})['then'](function(){return _0x3ac651;});})[_0xd22a('0x17')](function(){_0x1409c3[_0xd22a('0x1a')](0xcc)[_0xd22a('0xe')]();});}};}function handleEntityNotFound(_0x297b21){return function(_0x2d52ff){if(!_0x2d52ff){_0x297b21[_0xd22a('0xd')](0x194);}return _0x2d52ff;};}function handleError(_0x279c77,_0x3fc416){_0x3fc416=_0x3fc416||0x1f4;return function(_0x99512a){logger[_0xd22a('0x1b')](_0x99512a[_0xd22a('0x1c')]);if(_0x99512a[_0xd22a('0x1d')]){delete _0x99512a['name'];}_0x279c77['status'](_0x3fc416)[_0xd22a('0x1e')](_0x99512a);};}exports['index']=function(_0x222dc9,_0x40616c){var _0x5f26f3={};var _0xf25f5d={'count':0x0,'rows':[]};var _0x1c2201=_[_0xd22a('0x1f')](db[_0xd22a('0x20')][_0xd22a('0x21')],function(_0x206276){return{'name':_0x206276[_0xd22a('0x22')],'type':_0x206276[_0xd22a('0x23')][_0xd22a('0x24')]};});_0x5f26f3=qs['getOptions'](_0x1c2201,_0x222dc9);var _0x5e28df={'where':_0x5f26f3[_0xd22a('0x25')]};return db[_0xd22a('0x20')][_0xd22a('0x13')](_0x5e28df)[_0xd22a('0x17')](function(_0x52e048){_0xf25f5d[_0xd22a('0x13')]=_0x52e048;_0x5f26f3[_0xd22a('0x26')]=qs['include'](_0x222dc9[_0xd22a('0x27')]);return db[_0xd22a('0x20')]['findAll'](_0x5f26f3);})[_0xd22a('0x17')](function(_0x43d4eb){_0xf25f5d[_0xd22a('0x28')]=_0x43d4eb;return _0xf25f5d;})[_0xd22a('0x17')](respondWithFilteredResult(_0x40616c,_0x5f26f3))[_0xd22a('0x29')](handleError(_0x40616c,null));};exports[_0xd22a('0x2a')]=function(_0x45f297,_0x3dbac2){var _0x181813={'raw':!![],'where':{'id':_0x45f297[_0xd22a('0x2b')]['id']}},_0x571209={};_0x571209[_0xd22a('0x2c')]=_['keys'](db[_0xd22a('0x20')][_0xd22a('0x21')]);_0x571209[_0xd22a('0x27')]=_[_0xd22a('0x2d')](_0x45f297[_0xd22a('0x27')]);_0x571209[_0xd22a('0x2e')]=_[_0xd22a('0x2f')](_0x571209[_0xd22a('0x2c')],_0x571209[_0xd22a('0x27')]);_0x181813[_0xd22a('0x30')]=_['intersection'](_0x571209[_0xd22a('0x2c')],qs[_0xd22a('0x31')](_0x45f297[_0xd22a('0x27')][_0xd22a('0x31')]));_0x181813['attributes']=_0x181813[_0xd22a('0x30')][_0xd22a('0x32')]?_0x181813[_0xd22a('0x30')]:_0x571209[_0xd22a('0x2c')];if(_0x45f297[_0xd22a('0x27')][_0xd22a('0x33')]){_0x181813[_0xd22a('0x26')]=[{'all':!![]}];}_0x181813=_[_0xd22a('0x34')]({},_0x181813,_0x45f297[_0xd22a('0x35')]);return db[_0xd22a('0x20')][_0xd22a('0x36')](_0x181813)['then'](handleEntityNotFound(_0x3dbac2,null))[_0xd22a('0x17')](respondWithResult(_0x3dbac2,null))[_0xd22a('0x29')](handleError(_0x3dbac2,null));};exports[_0xd22a('0x37')]=function(_0x1c22f2,_0x212ee0){return db['OpenchannelQueue'][_0xd22a('0x37')](_0x1c22f2[_0xd22a('0x38')],{})[_0xd22a('0x17')](function(_0x128623){var _0x721da1=_0x1c22f2[_0xd22a('0x39')]['get']({'plain':!![]});if(!_0x721da1)throw new Error(_0xd22a('0x3a'));if(_0x721da1[_0xd22a('0x3b')]===_0xd22a('0x39')){var _0x27ec80=_0x128623[_0xd22a('0x3c')]({'plain':!![]});var _0x25d552=_0xd22a('0x18');return db[_0xd22a('0x3d')][_0xd22a('0x36')]({'where':{'name':_0x25d552,'userProfileId':_0x721da1[_0xd22a('0x3e')]},'raw':!![]})['then'](function(_0x1c4cab){if(_0x1c4cab&&_0x1c4cab[_0xd22a('0x3f')]===0x0){return db[_0xd22a('0x19')][_0xd22a('0x37')]({'name':_0x27ec80[_0xd22a('0x1d')],'resourceId':_0x27ec80['id'],'type':_0x1c4cab[_0xd22a('0x1d')],'sectionId':_0x1c4cab['id']},{})[_0xd22a('0x17')](function(){return _0x128623;});}else{return _0x128623;}})[_0xd22a('0x29')](function(_0x2d0a7e){logger[_0xd22a('0x1b')](_0xd22a('0x40'),_0x2d0a7e);throw _0x2d0a7e;});}return _0x128623;})[_0xd22a('0x17')](respondWithResult(_0x212ee0,0xc9))['catch'](handleError(_0x212ee0,null));};exports['update']=function(_0x15b38d,_0x42fe7c){if(_0x15b38d[_0xd22a('0x38')]['id']){delete _0x15b38d[_0xd22a('0x38')]['id'];}return db[_0xd22a('0x20')][_0xd22a('0x36')]({'where':{'id':_0x15b38d[_0xd22a('0x2b')]['id']}})[_0xd22a('0x17')](handleEntityNotFound(_0x42fe7c,null))[_0xd22a('0x17')](saveUpdates(_0x15b38d[_0xd22a('0x38')],null))['then'](respondWithResult(_0x42fe7c,null))[_0xd22a('0x29')](handleError(_0x42fe7c,null));};exports[_0xd22a('0x16')]=function(_0x521b91,_0x4db897){return db[_0xd22a('0x20')][_0xd22a('0x36')]({'where':{'id':_0x521b91[_0xd22a('0x2b')]['id']}})[_0xd22a('0x17')](handleEntityNotFound(_0x4db897,null))[_0xd22a('0x17')](removeEntity(_0x4db897,null))['catch'](handleError(_0x4db897,null));};exports[_0xd22a('0x41')]=function(_0x139070,_0x1bb1c4){return db[_0xd22a('0x20')][_0xd22a('0x41')]()['then'](respondWithResult(_0x1bb1c4,null))[_0xd22a('0x29')](handleError(_0x1bb1c4,null));};exports[_0xd22a('0x42')]=function(_0x39bd7b,_0x529e34){var _0x3a7bc1={'raw':!![],'where':{}},_0x6c10a3={},_0x103929;return db[_0xd22a('0x20')][_0xd22a('0x43')]({'where':{'id':_0x39bd7b[_0xd22a('0x2b')]['id']}})[_0xd22a('0x17')](handleEntityNotFound(_0x529e34,null))[_0xd22a('0x17')](function(_0x48b8d7){if(_0x48b8d7){_0x103929=_0x48b8d7['get']({'plain':!![]});_0x6c10a3['model']=_[_0xd22a('0x2d')](db[_0xd22a('0x44')]['rawAttributes']);_0x6c10a3[_0xd22a('0x27')]=_[_0xd22a('0x2d')](_0x39bd7b[_0xd22a('0x27')]);_0x6c10a3['filters']=_[_0xd22a('0x2f')](_0x6c10a3['model'],_0x6c10a3[_0xd22a('0x27')]);_0x3a7bc1[_0xd22a('0x30')]=_[_0xd22a('0x2f')](_0x6c10a3[_0xd22a('0x2c')],qs[_0xd22a('0x31')](_0x39bd7b['query'][_0xd22a('0x31')]));_0x3a7bc1['attributes']=_0x3a7bc1[_0xd22a('0x30')][_0xd22a('0x32')]?_0x3a7bc1[_0xd22a('0x30')]:_0x6c10a3[_0xd22a('0x2c')];if(!_0x39bd7b[_0xd22a('0x27')][_0xd22a('0x45')](_0xd22a('0x46'))){_0x3a7bc1[_0xd22a('0x12')]=qs['limit'](_0x39bd7b[_0xd22a('0x27')][_0xd22a('0x12')]);_0x3a7bc1[_0xd22a('0x10')]=qs[_0xd22a('0x10')](_0x39bd7b[_0xd22a('0x27')]['offset']);}_0x3a7bc1[_0xd22a('0x47')]=qs[_0xd22a('0x48')](_0x39bd7b[_0xd22a('0x27')]['sort']);_0x3a7bc1['where']=qs[_0xd22a('0x2e')](_[_0xd22a('0x49')](_0x39bd7b['query'],_0x6c10a3['filters']));_0x3a7bc1[_0xd22a('0x25')][_0xd22a('0x4a')]=_0x48b8d7['id'];if(_0x39bd7b[_0xd22a('0x27')][_0xd22a('0x4b')]){_0x3a7bc1[_0xd22a('0x25')]=_[_0xd22a('0x34')](_0x3a7bc1['where'],{'$or':_[_0xd22a('0x1f')](_0x3a7bc1[_0xd22a('0x30')],function(_0x523b1){var _0x36a1bd={};_0x36a1bd[_0x523b1]={'$like':'%'+_0x39bd7b[_0xd22a('0x27')]['filter']+'%'};return _0x36a1bd;})});}_0x3a7bc1=_['merge']({},_0x3a7bc1,_0x39bd7b['options']);return db['UserOpenchannelQueue']['findAll'](_0x3a7bc1);}})[_0xd22a('0x17')](function(_0x16b133){if(_0x16b133){return db[_0xd22a('0x4c')][_0xd22a('0x4d')]({'where':{'id':_[_0xd22a('0x1f')](_0x16b133,_0xd22a('0x4e')),'role':'agent'},'attributes':['id','name','openchannelPause',_0xd22a('0x4f'),_0xd22a('0x50')]});}})[_0xd22a('0x17')](function(_0x4a80d3){if(_0x4a80d3){return{'count':_0x4a80d3['count'],'rows':_[_0xd22a('0x1f')](_0x4a80d3[_0xd22a('0x28')],function(_0x2b27af){return{'membername':_0x2b27af[_0xd22a('0x1d')],'UserId':_0x2b27af['id'],'queue_name':_0x103929[_0xd22a('0x1d')],'OpenchannelQueueId':_0x103929['id'],'interface':util[_0xd22a('0x51')](_0xd22a('0x52'),_0xd22a('0x53'),_0x2b27af[_0xd22a('0x1d')]),'penalty':0x0,'paused':_0x2b27af['openchannelPause'],'createdAt':_0x2b27af[_0xd22a('0x50')],'updatedAt':_0x2b27af[_0xd22a('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd22a('0x17')](respondWithFilteredResult(_0x529e34,_0x3a7bc1))['catch'](handleError(_0x529e34,null));};exports['getTeams']=function(_0x28931d,_0x335ab4){var _0x48e6eb={};var _0x5d57c4={};var _0x42a378;var _0xfdb906;return db[_0xd22a('0x20')][_0xd22a('0x43')]({'where':{'id':_0x28931d['params']['id']}})[_0xd22a('0x17')](handleEntityNotFound(_0x335ab4,null))[_0xd22a('0x17')](function(_0x5930b1){if(_0x5930b1){_0x42a378=_0x5930b1;_0x5d57c4['model']=_[_0xd22a('0x2d')](db['Team'][_0xd22a('0x21')]);_0x5d57c4[_0xd22a('0x27')]=_[_0xd22a('0x2d')](_0x28931d[_0xd22a('0x27')]);_0x5d57c4[_0xd22a('0x2e')]=_['intersection'](_0x5d57c4[_0xd22a('0x2c')],_0x5d57c4[_0xd22a('0x27')]);_0x48e6eb[_0xd22a('0x30')]=_[_0xd22a('0x2f')](_0x5d57c4['model'],qs[_0xd22a('0x31')](_0x28931d[_0xd22a('0x27')]['fields']));_0x48e6eb[_0xd22a('0x30')]=_0x48e6eb['attributes'][_0xd22a('0x32')]?_0x48e6eb[_0xd22a('0x30')]:_0x5d57c4['model'];_0x48e6eb[_0xd22a('0x47')]=qs[_0xd22a('0x48')](_0x28931d[_0xd22a('0x27')]['sort']);_0x48e6eb[_0xd22a('0x25')]=qs[_0xd22a('0x2e')](_['pick'](_0x28931d['query'],_0x5d57c4[_0xd22a('0x2e')]));if(_0x28931d[_0xd22a('0x27')][_0xd22a('0x4b')]){_0x48e6eb[_0xd22a('0x25')]=_[_0xd22a('0x34')](_0x48e6eb[_0xd22a('0x25')],{'$or':_[_0xd22a('0x1f')](_0x48e6eb[_0xd22a('0x30')],function(_0x618204){var _0x4ff3af={};_0x4ff3af[_0x618204]={'$like':'%'+_0x28931d['query']['filter']+'%'};return _0x4ff3af;})});}_0x48e6eb=_[_0xd22a('0x34')]({},_0x48e6eb,_0x28931d[_0xd22a('0x35')]);return _0x42a378['getTeams'](_0x48e6eb);}})[_0xd22a('0x17')](function(_0x3f9f3e){if(_0x3f9f3e){_0xfdb906=_0x3f9f3e[_0xd22a('0x32')];if(!_0x28931d[_0xd22a('0x27')][_0xd22a('0x45')]('nolimit')){_0x48e6eb[_0xd22a('0x12')]=qs[_0xd22a('0x12')](_0x28931d[_0xd22a('0x27')][_0xd22a('0x12')]);_0x48e6eb[_0xd22a('0x10')]=qs[_0xd22a('0x10')](_0x28931d[_0xd22a('0x27')]['offset']);}return _0x42a378[_0xd22a('0x54')](_0x48e6eb);}})[_0xd22a('0x17')](function(_0x28ca77){if(_0x28ca77){return _0x28ca77?{'count':_0xfdb906,'rows':_0x28ca77}:null;}})[_0xd22a('0x17')](respondWithResult(_0x335ab4,null))[_0xd22a('0x29')](handleError(_0x335ab4,null));};exports[_0xd22a('0x55')]=function(_0x69ccaf,_0x3546dd){var _0x38db69=_0x69ccaf[_0xd22a('0x38')]['ids'];return db[_0xd22a('0x56')][_0xd22a('0x57')]({'where':{'id':_0x38db69},'attributes':['id'],'include':[{'model':db[_0xd22a('0x4c')],'as':_0xd22a('0x58'),'attributes':['id',_0xd22a('0x1d'),'online',_0xd22a('0x59'),_0xd22a('0x5a')],'raw':!![]}]})[_0xd22a('0x17')](function(_0x560304){if(_0x560304){var _0x3af2d5=_[_0xd22a('0x5b')](_0x560304,function(_0x306dc8){var _0x58bcda=_0x306dc8['get']({'plain':!![]});return _0x58bcda[_0xd22a('0x58')];});return db[_0xd22a('0x20')][_0xd22a('0x36')]({'where':{'id':_0x69ccaf[_0xd22a('0x2b')]['id']}})[_0xd22a('0x17')](function(_0x4200a4){return db[_0xd22a('0x5c')][_0xd22a('0x5d')](function(_0x43fec2){return _0x4200a4['addTeams'](_0x38db69,{'transaction':_0x43fec2})[_0xd22a('0x17')](function(){return BPromise[_0xd22a('0x5e')](_0x3af2d5,function(_0x1967d0){return db[_0xd22a('0x44')][_0xd22a('0x5f')]({'where':{'UserId':_0x1967d0['id'],'OpenchannelQueueId':_0x69ccaf[_0xd22a('0x2b')]['id']},'transaction':_0x43fec2});});})[_0xd22a('0x17')](function(){_0x3af2d5[_0xd22a('0x60')](function(_0x5d6072){socket['emit'](_0xd22a('0x61'),{'UserId':_0x5d6072['id'],'OpenchannelQueueId':_0x4200a4['id']});});});});});}})['then'](respondWithStatusCode(_0x3546dd,null))[_0xd22a('0x29')](handleError(_0x3546dd,null));};exports[_0xd22a('0x62')]=function(_0x4d6d9b,_0x32e958){return db[_0xd22a('0x56')][_0xd22a('0x57')]({'where':{'id':_0x4d6d9b[_0xd22a('0x27')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd22a('0x4c')],'as':_0xd22a('0x58'),'attributes':['id'],'raw':!![]}]})[_0xd22a('0x17')](handleEntityNotFound(_0x32e958,null))[_0xd22a('0x17')](function(_0x4a36e1){var _0x4a9f5b=_['map'](_0x4a36e1,'id');var _0x3646dc=[];var _0x547e7c=[];var _0x1d1cc7=squel['select']();_0x1d1cc7[_0xd22a('0x63')]('tq.TeamId')[_0xd22a('0x64')](_0xd22a('0x65'),'tq')[_0xd22a('0x66')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd22a('0x25')](_0xd22a('0x67'),_0x4d6d9b['params']['id']);for(var _0x21bda4=0x0;_0x21bda4<_0x4a36e1[_0xd22a('0x32')];_0x21bda4+=0x1){let _0xef1715=_0x4a36e1[_0x21bda4];for(var _0x15ea05=0x0;_0x15ea05<_0xef1715[_0xd22a('0x58')][_0xd22a('0x32')];_0x15ea05+=0x1){let _0x104994=_0xef1715[_0xd22a('0x58')][_0x15ea05];var _0x2db410=_0x1d1cc7['clone']();_0x2db410[_0xd22a('0x25')]('ut.UserId\x20=\x20?',_0x104994['id']);_0x547e7c['push'](db[_0xd22a('0x5c')][_0xd22a('0x27')](_0x2db410[_0xd22a('0x68')](),{'type':db[_0xd22a('0x5c')]['QueryTypes'][_0xd22a('0x69')]})[_0xd22a('0x17')](function(_0x4ae8b1){if(_0x4ae8b1[_0xd22a('0x32')]===0x1){return _0x104994['id'];}else{var _0x2d4fd9=_['every'](_['map'](_0x4ae8b1,_0xd22a('0x6a')),function(_0x8f5ce6){return _[_0xd22a('0x6b')](_0x4a9f5b,_0x8f5ce6);});if(_0x2d4fd9){return _0x104994['id'];}}}));}}return BPromise[_0xd22a('0x6c')](_0x547e7c)[_0xd22a('0x17')](function(_0x36d2db){_0x3646dc=_(_0x3646dc)[_0xd22a('0x6d')](_0x36d2db)['compact']()['value']();return db['OpenchannelQueue'][_0xd22a('0x36')]({'where':{'id':_0x4d6d9b[_0xd22a('0x2b')]['id']}})[_0xd22a('0x17')](function(_0x30a90e){return db[_0xd22a('0x5c')][_0xd22a('0x5d')](function(_0x437db6){return _0x30a90e[_0xd22a('0x62')](_0x4d6d9b[_0xd22a('0x27')][_0xd22a('0x6e')],{'transaction':_0x437db6})[_0xd22a('0x17')](function(){if(!_[_0xd22a('0x6f')](_0x3646dc)){return _0x30a90e['removeAgents'](_0x3646dc,{'transaction':_0x437db6});}})['then'](function(){_0x3646dc[_0xd22a('0x60')](function(_0x48e6d3){socket['emit'](_0xd22a('0x70'),{'UserId':_0x48e6d3,'OpenchannelQueueId':_0x30a90e['id']});});});});});});})[_0xd22a('0x17')](respondWithStatusCode(_0x32e958,null))[_0xd22a('0x29')](handleError(_0x32e958,null));};exports[_0xd22a('0x71')]=function(_0x49ab89,_0x5da209){return db['OpenchannelQueue']['find']({'where':{'id':_0x49ab89[_0xd22a('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5da209,null))[_0xd22a('0x17')](function(_0x5ba0b0){if(_0x5ba0b0){return _0x5ba0b0[_0xd22a('0x71')](_0x49ab89[_0xd22a('0x38')][_0xd22a('0x6e')],_['omit'](_0x49ab89[_0xd22a('0x38')],['ids','id'])||{})['spread'](function(_0x791d03){for(var _0x59d92f=0x0;_0x59d92f<_0x49ab89['body'][_0xd22a('0x6e')][_0xd22a('0x32')];_0x59d92f+=0x1){socket['emit'](_0xd22a('0x61'),{'UserId':Number(_0x49ab89[_0xd22a('0x38')][_0xd22a('0x6e')][_0x59d92f]),'OpenchannelQueueId':Number(_0x49ab89[_0xd22a('0x2b')]['id'])});}return _0x791d03;});}})[_0xd22a('0x17')](respondWithResult(_0x5da209,null))[_0xd22a('0x29')](handleError(_0x5da209,null));};exports['removeAgents']=function(_0x429032,_0x1ca5cf){return db[_0xd22a('0x20')][_0xd22a('0x36')]({'where':{'id':_0x429032['params']['id']}})[_0xd22a('0x17')](handleEntityNotFound(_0x1ca5cf,null))[_0xd22a('0x17')](function(_0x433319){if(_0x433319){return _0x433319['removeAgents'](_0x429032['query'][_0xd22a('0x6e')])[_0xd22a('0x17')](function(){if(_['isArray'](_0x429032[_0xd22a('0x27')][_0xd22a('0x6e')])){for(var _0x3ac8c9=0x0;_0x3ac8c9<_0x429032['query'][_0xd22a('0x6e')][_0xd22a('0x32')];_0x3ac8c9+=0x1){socket[_0xd22a('0x72')](_0xd22a('0x70'),{'UserId':Number(_0x429032[_0xd22a('0x27')][_0xd22a('0x6e')][_0x3ac8c9]),'OpenchannelQueueId':Number(_0x429032['params']['id'])});}}else{socket[_0xd22a('0x72')](_0xd22a('0x70'),{'UserId':Number(_0x429032['query'][_0xd22a('0x6e')]),'OpenchannelQueueId':Number(_0x429032[_0xd22a('0x2b')]['id'])});}});}})[_0xd22a('0x17')](respondWithStatusCode(_0x1ca5cf,null))[_0xd22a('0x29')](handleError(_0x1ca5cf,null));};exports['getAgents']=function(_0x1693fc,_0x35f792){var _0x298a0e={};var _0x448ab7={};var _0x26c3dc;var _0x21ec03;return db[_0xd22a('0x20')][_0xd22a('0x43')]({'where':{'id':_0x1693fc[_0xd22a('0x2b')]['id']}})['then'](handleEntityNotFound(_0x35f792,null))[_0xd22a('0x17')](function(_0x410ae6){if(_0x410ae6){_0x26c3dc=_0x410ae6;_0x448ab7['model']=_[_0xd22a('0x2d')](db[_0xd22a('0x4c')]['rawAttributes']);_0x448ab7[_0xd22a('0x27')]=_['keys'](_0x1693fc[_0xd22a('0x27')]);_0x448ab7[_0xd22a('0x2e')]=_[_0xd22a('0x2f')](_0x448ab7[_0xd22a('0x2c')],_0x448ab7[_0xd22a('0x27')]);_0x298a0e['attributes']=_[_0xd22a('0x2f')](_0x448ab7[_0xd22a('0x2c')],qs['fields'](_0x1693fc[_0xd22a('0x27')][_0xd22a('0x31')]));_0x298a0e['attributes']=_0x298a0e['attributes'][_0xd22a('0x32')]?_0x298a0e['attributes']:_0x448ab7[_0xd22a('0x2c')];_0x298a0e[_0xd22a('0x47')]=qs[_0xd22a('0x48')](_0x1693fc['query'][_0xd22a('0x48')]);_0x298a0e['where']=qs[_0xd22a('0x2e')](_[_0xd22a('0x49')](_0x1693fc[_0xd22a('0x27')],_0x448ab7['filters']));if(_0x1693fc[_0xd22a('0x27')][_0xd22a('0x4b')]){_0x298a0e['where']=_['merge'](_0x298a0e[_0xd22a('0x25')],{'$or':_[_0xd22a('0x1f')](_0x298a0e[_0xd22a('0x30')],function(_0x21e164){var _0x7a42f2={};_0x7a42f2[_0x21e164]={'$like':'%'+_0x1693fc[_0xd22a('0x27')][_0xd22a('0x4b')]+'%'};return _0x7a42f2;})});}_0x298a0e=_[_0xd22a('0x34')]({},_0x298a0e,_0x1693fc[_0xd22a('0x35')]);return _0x26c3dc[_0xd22a('0x73')](_0x298a0e);}})[_0xd22a('0x17')](function(_0x2b944e){if(_0x2b944e){_0x21ec03=_0x2b944e[_0xd22a('0x32')];if(!_0x1693fc[_0xd22a('0x27')][_0xd22a('0x45')](_0xd22a('0x46'))){_0x298a0e[_0xd22a('0x12')]=qs[_0xd22a('0x12')](_0x1693fc['query']['limit']);_0x298a0e[_0xd22a('0x10')]=qs[_0xd22a('0x10')](_0x1693fc[_0xd22a('0x27')][_0xd22a('0x10')]);}return _0x26c3dc['getAgents'](_0x298a0e);}})['then'](function(_0x492187){if(_0x492187){return _0x492187?{'count':_0x21ec03,'rows':_0x492187}:null;}})[_0xd22a('0x17')](respondWithResult(_0x35f792,null))[_0xd22a('0x29')](handleError(_0x35f792,null));}; \ No newline at end of file +var _0xa8ee=['includes','union','value','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','spread','isArray','getAgents','bluebird','util','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','json','undefined','limit','count','offset','set','update','destroy','then','get','UserProfileResource','end','error','stack','name','index','OpenchannelQueue','fieldName','type','key','getOptions','include','query','show','params','model','keys','filters','attributes','intersection','fields','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelQueueId','filter','map','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','%s/%s','getTeams','Team','addTeams','ids','findAll','User','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xa8ee,0x16f));var _0xea8e=function(_0x1b78ae,_0x5b3cae){_0x1b78ae=_0x1b78ae-0x0;var _0x56bd98=_0xa8ee[_0x1b78ae];return _0x56bd98;};'use strict';var BPromise=require(_0xea8e('0x0'));var util=require(_0xea8e('0x1'));var _=require('lodash');var squel=require('squel');var Redis=require(_0xea8e('0x2'));var qs=require(_0xea8e('0x3'));var logger=require('../../config/logger')(_0xea8e('0x4'));var config=require(_0xea8e('0x5'));var db=require(_0xea8e('0x6'))['db'];config[_0xea8e('0x7')]=_['defaults'](config[_0xea8e('0x7')],{'host':_0xea8e('0x8'),'port':0x18eb});var socket=require(_0xea8e('0x9'))(new Redis(config['redis']));require(_0xea8e('0xa'))['register'](socket);function respondWithStatusCode(_0x4b12bc,_0x442e6e){_0x442e6e=_0x442e6e||0xcc;return function(_0x3f232b){if(_0x3f232b){return _0x4b12bc[_0xea8e('0xb')](_0x442e6e);}return _0x4b12bc[_0xea8e('0xc')](_0x442e6e)['end']();};}function respondWithResult(_0x495868,_0x554384){_0x554384=_0x554384||0xc8;return function(_0x5bc37f){if(_0x5bc37f){return _0x495868[_0xea8e('0xc')](_0x554384)[_0xea8e('0xd')](_0x5bc37f);}};}function respondWithFilteredResult(_0x50502c,_0x14a7be){return function(_0x22e82d){if(_0x22e82d){var _0x1ee042=typeof _0x14a7be['offset']===_0xea8e('0xe')&&typeof _0x14a7be[_0xea8e('0xf')]===_0xea8e('0xe');var _0x4bfeb7=_0x22e82d[_0xea8e('0x10')];var _0x194338=_0x1ee042?0x0:_0x14a7be['offset'];var _0x81c3e0=_0x1ee042?_0x22e82d[_0xea8e('0x10')]:_0x14a7be[_0xea8e('0x11')]+_0x14a7be['limit'];var _0x3f8a3f;if(_0x81c3e0>=_0x4bfeb7){_0x81c3e0=_0x4bfeb7;_0x3f8a3f=0xc8;}else{_0x3f8a3f=0xce;}_0x50502c[_0xea8e('0xc')](_0x3f8a3f);return _0x50502c[_0xea8e('0x12')]('Content-Range',_0x194338+'-'+_0x81c3e0+'/'+_0x4bfeb7)[_0xea8e('0xd')](_0x22e82d);}return null;};}function saveUpdates(_0x4c1ddc){return function(_0x10d52d){if(_0x10d52d){return _0x10d52d[_0xea8e('0x13')](_0x4c1ddc)['then'](function(_0x4df8a7){return _0x4df8a7;});}return null;};}function removeEntity(_0x281718){return function(_0x410931){if(_0x410931){return _0x410931[_0xea8e('0x14')]()[_0xea8e('0x15')](function(){var _0x315fea=_0x410931[_0xea8e('0x16')]({'plain':!![]});var _0x19152b='OpenchannelQueues';return db[_0xea8e('0x17')][_0xea8e('0x14')]({'where':{'type':_0x19152b,'resourceId':_0x315fea['id']}})['then'](function(){return _0x410931;});})[_0xea8e('0x15')](function(){_0x281718[_0xea8e('0xc')](0xcc)[_0xea8e('0x18')]();});}};}function handleEntityNotFound(_0x407c4b){return function(_0x13185d){if(!_0x13185d){_0x407c4b[_0xea8e('0xb')](0x194);}return _0x13185d;};}function handleError(_0xdc0bd1,_0x2924e8){_0x2924e8=_0x2924e8||0x1f4;return function(_0x44dfd7){logger[_0xea8e('0x19')](_0x44dfd7[_0xea8e('0x1a')]);if(_0x44dfd7[_0xea8e('0x1b')]){delete _0x44dfd7[_0xea8e('0x1b')];}_0xdc0bd1['status'](_0x2924e8)['send'](_0x44dfd7);};}exports[_0xea8e('0x1c')]=function(_0x209c59,_0x486fc0){var _0x3adab2={};var _0x67cb5a={'count':0x0,'rows':[]};var _0x4ba5a4=_['map'](db[_0xea8e('0x1d')]['rawAttributes'],function(_0x473829){return{'name':_0x473829[_0xea8e('0x1e')],'type':_0x473829[_0xea8e('0x1f')][_0xea8e('0x20')]};});_0x3adab2=qs[_0xea8e('0x21')](_0x4ba5a4,_0x209c59);var _0x4b7d11={'where':_0x3adab2['where']};return db[_0xea8e('0x1d')]['count'](_0x4b7d11)['then'](function(_0x293ab0){_0x67cb5a['count']=_0x293ab0;_0x3adab2[_0xea8e('0x22')]=qs['include'](_0x209c59[_0xea8e('0x23')]);return db[_0xea8e('0x1d')]['findAll'](_0x3adab2);})[_0xea8e('0x15')](function(_0x1bc863){_0x67cb5a['rows']=_0x1bc863;return _0x67cb5a;})[_0xea8e('0x15')](respondWithFilteredResult(_0x486fc0,_0x3adab2))['catch'](handleError(_0x486fc0,null));};exports[_0xea8e('0x24')]=function(_0x1f39f6,_0x531278){var _0xf4ab17={'raw':!![],'where':{'id':_0x1f39f6[_0xea8e('0x25')]['id']}},_0x32e88d={};_0x32e88d[_0xea8e('0x26')]=_[_0xea8e('0x27')](db[_0xea8e('0x1d')]['rawAttributes']);_0x32e88d[_0xea8e('0x23')]=_[_0xea8e('0x27')](_0x1f39f6[_0xea8e('0x23')]);_0x32e88d[_0xea8e('0x28')]=_['intersection'](_0x32e88d['model'],_0x32e88d[_0xea8e('0x23')]);_0xf4ab17[_0xea8e('0x29')]=_[_0xea8e('0x2a')](_0x32e88d[_0xea8e('0x26')],qs[_0xea8e('0x2b')](_0x1f39f6['query'][_0xea8e('0x2b')]));_0xf4ab17[_0xea8e('0x29')]=_0xf4ab17['attributes']['length']?_0xf4ab17[_0xea8e('0x29')]:_0x32e88d[_0xea8e('0x26')];if(_0x1f39f6[_0xea8e('0x23')][_0xea8e('0x2c')]){_0xf4ab17[_0xea8e('0x22')]=[{'all':!![]}];}_0xf4ab17=_[_0xea8e('0x2d')]({},_0xf4ab17,_0x1f39f6[_0xea8e('0x2e')]);return db['OpenchannelQueue']['find'](_0xf4ab17)[_0xea8e('0x15')](handleEntityNotFound(_0x531278,null))[_0xea8e('0x15')](respondWithResult(_0x531278,null))[_0xea8e('0x2f')](handleError(_0x531278,null));};exports[_0xea8e('0x30')]=function(_0x394384,_0x56e4a4){return db['OpenchannelQueue'][_0xea8e('0x30')](_0x394384[_0xea8e('0x31')],{})[_0xea8e('0x15')](function(_0x21b7b8){var _0x5785ab=_0x394384[_0xea8e('0x32')][_0xea8e('0x16')]({'plain':!![]});if(!_0x5785ab)throw new Error(_0xea8e('0x33'));if(_0x5785ab[_0xea8e('0x34')]===_0xea8e('0x32')){var _0x541883=_0x21b7b8['get']({'plain':!![]});var _0x59ebac=_0xea8e('0x35');return db[_0xea8e('0x36')]['find']({'where':{'name':_0x59ebac,'userProfileId':_0x5785ab['userProfileId']},'raw':!![]})[_0xea8e('0x15')](function(_0x12d342){if(_0x12d342&&_0x12d342['autoAssociation']===0x0){return db[_0xea8e('0x17')][_0xea8e('0x30')]({'name':_0x541883['name'],'resourceId':_0x541883['id'],'type':_0x12d342[_0xea8e('0x1b')],'sectionId':_0x12d342['id']},{})['then'](function(){return _0x21b7b8;});}else{return _0x21b7b8;}})[_0xea8e('0x2f')](function(_0x2ffd98){logger[_0xea8e('0x19')](_0xea8e('0x37'),_0x2ffd98);throw _0x2ffd98;});}return _0x21b7b8;})[_0xea8e('0x15')](respondWithResult(_0x56e4a4,0xc9))[_0xea8e('0x2f')](handleError(_0x56e4a4,null));};exports['update']=function(_0x48464f,_0x234fe6){if(_0x48464f[_0xea8e('0x31')]['id']){delete _0x48464f['body']['id'];}return db[_0xea8e('0x1d')]['find']({'where':{'id':_0x48464f[_0xea8e('0x25')]['id']}})['then'](handleEntityNotFound(_0x234fe6,null))[_0xea8e('0x15')](saveUpdates(_0x48464f[_0xea8e('0x31')],null))['then'](respondWithResult(_0x234fe6,null))[_0xea8e('0x2f')](handleError(_0x234fe6,null));};exports[_0xea8e('0x14')]=function(_0x5b477e,_0x6bceca){return db[_0xea8e('0x1d')][_0xea8e('0x38')]({'where':{'id':_0x5b477e[_0xea8e('0x25')]['id']}})['then'](handleEntityNotFound(_0x6bceca,null))[_0xea8e('0x15')](removeEntity(_0x6bceca,null))[_0xea8e('0x2f')](handleError(_0x6bceca,null));};exports[_0xea8e('0x39')]=function(_0x1a65e5,_0x389552){return db[_0xea8e('0x1d')][_0xea8e('0x39')]()[_0xea8e('0x15')](respondWithResult(_0x389552,null))[_0xea8e('0x2f')](handleError(_0x389552,null));};exports[_0xea8e('0x3a')]=function(_0x5736d9,_0x488222){var _0x37f4e0={'raw':!![],'where':{}},_0x4d8e4e={},_0x1b767c;return db[_0xea8e('0x1d')][_0xea8e('0x3b')]({'where':{'id':_0x5736d9[_0xea8e('0x25')]['id']}})['then'](handleEntityNotFound(_0x488222,null))[_0xea8e('0x15')](function(_0x4a2d38){if(_0x4a2d38){_0x1b767c=_0x4a2d38[_0xea8e('0x16')]({'plain':!![]});_0x4d8e4e['model']=_[_0xea8e('0x27')](db[_0xea8e('0x3c')]['rawAttributes']);_0x4d8e4e[_0xea8e('0x23')]=_[_0xea8e('0x27')](_0x5736d9[_0xea8e('0x23')]);_0x4d8e4e['filters']=_[_0xea8e('0x2a')](_0x4d8e4e[_0xea8e('0x26')],_0x4d8e4e[_0xea8e('0x23')]);_0x37f4e0[_0xea8e('0x29')]=_[_0xea8e('0x2a')](_0x4d8e4e[_0xea8e('0x26')],qs[_0xea8e('0x2b')](_0x5736d9[_0xea8e('0x23')][_0xea8e('0x2b')]));_0x37f4e0[_0xea8e('0x29')]=_0x37f4e0[_0xea8e('0x29')][_0xea8e('0x3d')]?_0x37f4e0[_0xea8e('0x29')]:_0x4d8e4e[_0xea8e('0x26')];if(!_0x5736d9[_0xea8e('0x23')][_0xea8e('0x3e')](_0xea8e('0x3f'))){_0x37f4e0[_0xea8e('0xf')]=qs[_0xea8e('0xf')](_0x5736d9[_0xea8e('0x23')][_0xea8e('0xf')]);_0x37f4e0[_0xea8e('0x11')]=qs['offset'](_0x5736d9['query'][_0xea8e('0x11')]);}_0x37f4e0[_0xea8e('0x40')]=qs[_0xea8e('0x41')](_0x5736d9[_0xea8e('0x23')][_0xea8e('0x41')]);_0x37f4e0[_0xea8e('0x42')]=qs[_0xea8e('0x28')](_[_0xea8e('0x43')](_0x5736d9['query'],_0x4d8e4e[_0xea8e('0x28')]));_0x37f4e0[_0xea8e('0x42')][_0xea8e('0x44')]=_0x4a2d38['id'];if(_0x5736d9[_0xea8e('0x23')][_0xea8e('0x45')]){_0x37f4e0['where']=_[_0xea8e('0x2d')](_0x37f4e0['where'],{'$or':_[_0xea8e('0x46')](_0x37f4e0['attributes'],function(_0x45b1f0){var _0x4e0776={};_0x4e0776[_0x45b1f0]={'$like':'%'+_0x5736d9[_0xea8e('0x23')][_0xea8e('0x45')]+'%'};return _0x4e0776;})});}_0x37f4e0=_[_0xea8e('0x2d')]({},_0x37f4e0,_0x5736d9[_0xea8e('0x2e')]);return db[_0xea8e('0x3c')]['findAll'](_0x37f4e0);}})[_0xea8e('0x15')](function(_0x31cad5){if(_0x31cad5){return db['User'][_0xea8e('0x47')]({'where':{'id':_['map'](_0x31cad5,_0xea8e('0x48')),'role':_0xea8e('0x49')},'attributes':['id',_0xea8e('0x1b'),_0xea8e('0x4a'),_0xea8e('0x4b'),_0xea8e('0x4c')]});}})['then'](function(_0x10d2e4){if(_0x10d2e4){return{'count':_0x10d2e4[_0xea8e('0x10')],'rows':_['map'](_0x10d2e4[_0xea8e('0x4d')],function(_0x31acc5){return{'membername':_0x31acc5[_0xea8e('0x1b')],'UserId':_0x31acc5['id'],'queue_name':_0x1b767c[_0xea8e('0x1b')],'OpenchannelQueueId':_0x1b767c['id'],'interface':util['format'](_0xea8e('0x4e'),'SIP',_0x31acc5[_0xea8e('0x1b')]),'penalty':0x0,'paused':_0x31acc5[_0xea8e('0x4a')],'createdAt':_0x31acc5[_0xea8e('0x4c')],'updatedAt':_0x31acc5[_0xea8e('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xea8e('0x15')](respondWithFilteredResult(_0x488222,_0x37f4e0))[_0xea8e('0x2f')](handleError(_0x488222,null));};exports[_0xea8e('0x4f')]=function(_0x27095d,_0x253ab5){var _0x4519e9={};var _0x2bba23={};var _0x3c0b00;var _0x3ebc83;return db[_0xea8e('0x1d')]['findOne']({'where':{'id':_0x27095d[_0xea8e('0x25')]['id']}})[_0xea8e('0x15')](handleEntityNotFound(_0x253ab5,null))[_0xea8e('0x15')](function(_0x4927c1){if(_0x4927c1){_0x3c0b00=_0x4927c1;_0x2bba23[_0xea8e('0x26')]=_[_0xea8e('0x27')](db[_0xea8e('0x50')]['rawAttributes']);_0x2bba23[_0xea8e('0x23')]=_[_0xea8e('0x27')](_0x27095d[_0xea8e('0x23')]);_0x2bba23['filters']=_[_0xea8e('0x2a')](_0x2bba23[_0xea8e('0x26')],_0x2bba23['query']);_0x4519e9[_0xea8e('0x29')]=_[_0xea8e('0x2a')](_0x2bba23['model'],qs[_0xea8e('0x2b')](_0x27095d[_0xea8e('0x23')][_0xea8e('0x2b')]));_0x4519e9[_0xea8e('0x29')]=_0x4519e9['attributes'][_0xea8e('0x3d')]?_0x4519e9[_0xea8e('0x29')]:_0x2bba23['model'];_0x4519e9[_0xea8e('0x40')]=qs[_0xea8e('0x41')](_0x27095d[_0xea8e('0x23')][_0xea8e('0x41')]);_0x4519e9['where']=qs[_0xea8e('0x28')](_[_0xea8e('0x43')](_0x27095d[_0xea8e('0x23')],_0x2bba23['filters']));if(_0x27095d[_0xea8e('0x23')][_0xea8e('0x45')]){_0x4519e9[_0xea8e('0x42')]=_[_0xea8e('0x2d')](_0x4519e9[_0xea8e('0x42')],{'$or':_[_0xea8e('0x46')](_0x4519e9[_0xea8e('0x29')],function(_0x476599){var _0xc0b088={};_0xc0b088[_0x476599]={'$like':'%'+_0x27095d[_0xea8e('0x23')][_0xea8e('0x45')]+'%'};return _0xc0b088;})});}_0x4519e9=_[_0xea8e('0x2d')]({},_0x4519e9,_0x27095d[_0xea8e('0x2e')]);return _0x3c0b00['getTeams'](_0x4519e9);}})[_0xea8e('0x15')](function(_0x43e3ac){if(_0x43e3ac){_0x3ebc83=_0x43e3ac[_0xea8e('0x3d')];if(!_0x27095d[_0xea8e('0x23')][_0xea8e('0x3e')]('nolimit')){_0x4519e9[_0xea8e('0xf')]=qs[_0xea8e('0xf')](_0x27095d[_0xea8e('0x23')][_0xea8e('0xf')]);_0x4519e9[_0xea8e('0x11')]=qs['offset'](_0x27095d[_0xea8e('0x23')]['offset']);}return _0x3c0b00['getTeams'](_0x4519e9);}})[_0xea8e('0x15')](function(_0x212d74){if(_0x212d74){return _0x212d74?{'count':_0x3ebc83,'rows':_0x212d74}:null;}})[_0xea8e('0x15')](respondWithResult(_0x253ab5,null))[_0xea8e('0x2f')](handleError(_0x253ab5,null));};exports[_0xea8e('0x51')]=function(_0xc55d0c,_0x303138){var _0x2b20b0=_0xc55d0c[_0xea8e('0x31')][_0xea8e('0x52')];return db['Team'][_0xea8e('0x53')]({'where':{'id':_0x2b20b0},'attributes':['id'],'include':[{'model':db[_0xea8e('0x54')],'as':'Agents','attributes':['id',_0xea8e('0x1b'),_0xea8e('0x55'),_0xea8e('0x56'),_0xea8e('0x57')],'raw':!![]}]})['then'](function(_0x20ae68){if(_0x20ae68){var _0x477382=_[_0xea8e('0x58')](_0x20ae68,function(_0x55b45d){var _0x205b86=_0x55b45d['get']({'plain':!![]});return _0x205b86['Agents'];});return db[_0xea8e('0x1d')][_0xea8e('0x38')]({'where':{'id':_0xc55d0c[_0xea8e('0x25')]['id']}})[_0xea8e('0x15')](function(_0x10c2ec){return db[_0xea8e('0x59')][_0xea8e('0x5a')](function(_0x1c0b51){return _0x10c2ec['addTeams'](_0x2b20b0,{'transaction':_0x1c0b51})[_0xea8e('0x15')](function(){return BPromise[_0xea8e('0x5b')](_0x477382,function(_0x1de65c){return db[_0xea8e('0x3c')]['findOrCreate']({'where':{'UserId':_0x1de65c['id'],'OpenchannelQueueId':_0xc55d0c[_0xea8e('0x25')]['id']},'transaction':_0x1c0b51});});})['then'](function(){_0x477382[_0xea8e('0x5c')](function(_0x54ff02){socket[_0xea8e('0x5d')](_0xea8e('0x5e'),{'UserId':_0x54ff02['id'],'OpenchannelQueueId':_0x10c2ec['id']});});});});});}})[_0xea8e('0x15')](respondWithStatusCode(_0x303138,null))[_0xea8e('0x2f')](handleError(_0x303138,null));};exports['removeTeams']=function(_0x257a3a,_0x256b72){return db[_0xea8e('0x50')][_0xea8e('0x53')]({'where':{'id':_0x257a3a[_0xea8e('0x23')][_0xea8e('0x52')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xea8e('0x15')](handleEntityNotFound(_0x256b72,null))['then'](function(_0x12b8aa){var _0x3ea511=_[_0xea8e('0x46')](_0x12b8aa,'id');var _0x407a81=[];var _0x3af1e3=[];var _0x3c507f=squel[_0xea8e('0x5f')]();_0x3c507f[_0xea8e('0x60')](_0xea8e('0x61'))[_0xea8e('0x62')]('team_has_openchannel_queues','tq')['join'](_0xea8e('0x63'),'ut',_0xea8e('0x64'))[_0xea8e('0x42')](_0xea8e('0x65'),_0x257a3a[_0xea8e('0x25')]['id']);for(var _0x25c715=0x0;_0x25c715<_0x12b8aa[_0xea8e('0x3d')];_0x25c715+=0x1){let _0x3734ed=_0x12b8aa[_0x25c715];for(var _0x427d92=0x0;_0x427d92<_0x3734ed[_0xea8e('0x66')][_0xea8e('0x3d')];_0x427d92+=0x1){let _0x5273a6=_0x3734ed[_0xea8e('0x66')][_0x427d92];var _0x163390=_0x3c507f[_0xea8e('0x67')]();_0x163390['where'](_0xea8e('0x68'),_0x5273a6['id']);_0x3af1e3['push'](db[_0xea8e('0x59')][_0xea8e('0x23')](_0x163390[_0xea8e('0x69')](),{'type':db[_0xea8e('0x59')][_0xea8e('0x6a')][_0xea8e('0x6b')]})[_0xea8e('0x15')](function(_0x4fb3b2){if(_0x4fb3b2[_0xea8e('0x3d')]===0x1){return _0x5273a6['id'];}else{var _0x1e30d6=_['every'](_[_0xea8e('0x46')](_0x4fb3b2,_0xea8e('0x6c')),function(_0x1e622e){return _[_0xea8e('0x6d')](_0x3ea511,_0x1e622e);});if(_0x1e30d6){return _0x5273a6['id'];}}}));}}return BPromise['all'](_0x3af1e3)[_0xea8e('0x15')](function(_0x1d9ab2){_0x407a81=_(_0x407a81)[_0xea8e('0x6e')](_0x1d9ab2)['compact']()[_0xea8e('0x6f')]();return db['OpenchannelQueue'][_0xea8e('0x38')]({'where':{'id':_0x257a3a[_0xea8e('0x25')]['id']}})[_0xea8e('0x15')](function(_0x10396f){return db[_0xea8e('0x59')][_0xea8e('0x5a')](function(_0x278a59){return _0x10396f[_0xea8e('0x70')](_0x257a3a[_0xea8e('0x23')]['ids'],{'transaction':_0x278a59})[_0xea8e('0x15')](function(){if(!_[_0xea8e('0x71')](_0x407a81)){return _0x10396f[_0xea8e('0x72')](_0x407a81,{'transaction':_0x278a59});}})['then'](function(){_0x407a81['forEach'](function(_0x9028c1){socket[_0xea8e('0x5d')](_0xea8e('0x73'),{'UserId':_0x9028c1,'OpenchannelQueueId':_0x10396f['id']});});});});});});})['then'](respondWithStatusCode(_0x256b72,null))[_0xea8e('0x2f')](handleError(_0x256b72,null));};exports['addAgents']=function(_0x5ac0ab,_0x5ebc45){return db[_0xea8e('0x1d')]['find']({'where':{'id':_0x5ac0ab[_0xea8e('0x25')]['id']}})[_0xea8e('0x15')](handleEntityNotFound(_0x5ebc45,null))[_0xea8e('0x15')](function(_0x54461c){if(_0x54461c){return _0x54461c['addAgents'](_0x5ac0ab[_0xea8e('0x31')][_0xea8e('0x52')],_['omit'](_0x5ac0ab[_0xea8e('0x31')],['ids','id'])||{})[_0xea8e('0x74')](function(_0x1d6828){for(var _0x451e4d=0x0;_0x451e4d<_0x5ac0ab[_0xea8e('0x31')]['ids'][_0xea8e('0x3d')];_0x451e4d+=0x1){socket[_0xea8e('0x5d')]('userOpenchannelQueue:save',{'UserId':Number(_0x5ac0ab[_0xea8e('0x31')][_0xea8e('0x52')][_0x451e4d]),'OpenchannelQueueId':Number(_0x5ac0ab[_0xea8e('0x25')]['id'])});}return _0x1d6828;});}})[_0xea8e('0x15')](respondWithResult(_0x5ebc45,null))['catch'](handleError(_0x5ebc45,null));};exports[_0xea8e('0x72')]=function(_0x4addb9,_0x1d5bc9){return db['OpenchannelQueue'][_0xea8e('0x38')]({'where':{'id':_0x4addb9['params']['id']}})[_0xea8e('0x15')](handleEntityNotFound(_0x1d5bc9,null))['then'](function(_0x3db176){if(_0x3db176){return _0x3db176[_0xea8e('0x72')](_0x4addb9[_0xea8e('0x23')][_0xea8e('0x52')])[_0xea8e('0x15')](function(){if(_[_0xea8e('0x75')](_0x4addb9[_0xea8e('0x23')]['ids'])){for(var _0x68d32c=0x0;_0x68d32c<_0x4addb9['query']['ids'][_0xea8e('0x3d')];_0x68d32c+=0x1){socket[_0xea8e('0x5d')](_0xea8e('0x73'),{'UserId':Number(_0x4addb9[_0xea8e('0x23')][_0xea8e('0x52')][_0x68d32c]),'OpenchannelQueueId':Number(_0x4addb9['params']['id'])});}}else{socket['emit'](_0xea8e('0x73'),{'UserId':Number(_0x4addb9[_0xea8e('0x23')][_0xea8e('0x52')]),'OpenchannelQueueId':Number(_0x4addb9[_0xea8e('0x25')]['id'])});}});}})[_0xea8e('0x15')](respondWithStatusCode(_0x1d5bc9,null))[_0xea8e('0x2f')](handleError(_0x1d5bc9,null));};exports[_0xea8e('0x76')]=function(_0x154bb6,_0x2a2ec2){var _0x311785={};var _0x30085b={};var _0x5b81e7;var _0x351007;return db[_0xea8e('0x1d')][_0xea8e('0x3b')]({'where':{'id':_0x154bb6['params']['id']}})[_0xea8e('0x15')](handleEntityNotFound(_0x2a2ec2,null))[_0xea8e('0x15')](function(_0x305291){if(_0x305291){_0x5b81e7=_0x305291;_0x30085b['model']=_[_0xea8e('0x27')](db[_0xea8e('0x54')]['rawAttributes']);_0x30085b[_0xea8e('0x23')]=_[_0xea8e('0x27')](_0x154bb6[_0xea8e('0x23')]);_0x30085b[_0xea8e('0x28')]=_['intersection'](_0x30085b['model'],_0x30085b[_0xea8e('0x23')]);_0x311785[_0xea8e('0x29')]=_['intersection'](_0x30085b[_0xea8e('0x26')],qs['fields'](_0x154bb6[_0xea8e('0x23')][_0xea8e('0x2b')]));_0x311785[_0xea8e('0x29')]=_0x311785[_0xea8e('0x29')][_0xea8e('0x3d')]?_0x311785['attributes']:_0x30085b[_0xea8e('0x26')];_0x311785['order']=qs[_0xea8e('0x41')](_0x154bb6[_0xea8e('0x23')]['sort']);_0x311785[_0xea8e('0x42')]=qs[_0xea8e('0x28')](_['pick'](_0x154bb6['query'],_0x30085b['filters']));if(_0x154bb6[_0xea8e('0x23')]['filter']){_0x311785[_0xea8e('0x42')]=_['merge'](_0x311785[_0xea8e('0x42')],{'$or':_[_0xea8e('0x46')](_0x311785[_0xea8e('0x29')],function(_0x52387e){var _0x265e0b={};_0x265e0b[_0x52387e]={'$like':'%'+_0x154bb6['query']['filter']+'%'};return _0x265e0b;})});}_0x311785=_[_0xea8e('0x2d')]({},_0x311785,_0x154bb6['options']);return _0x5b81e7[_0xea8e('0x76')](_0x311785);}})[_0xea8e('0x15')](function(_0x2e4d54){if(_0x2e4d54){_0x351007=_0x2e4d54[_0xea8e('0x3d')];if(!_0x154bb6[_0xea8e('0x23')]['hasOwnProperty'](_0xea8e('0x3f'))){_0x311785['limit']=qs[_0xea8e('0xf')](_0x154bb6[_0xea8e('0x23')][_0xea8e('0xf')]);_0x311785[_0xea8e('0x11')]=qs[_0xea8e('0x11')](_0x154bb6[_0xea8e('0x23')][_0xea8e('0x11')]);}return _0x5b81e7[_0xea8e('0x76')](_0x311785);}})['then'](function(_0x4da8b4){if(_0x4da8b4){return _0x4da8b4?{'count':_0x351007,'rows':_0x4da8b4}:null;}})[_0xea8e('0x15')](respondWithResult(_0x2a2ec2,null))[_0xea8e('0x2f')](handleError(_0x2a2ec2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6fd3d56..d1b38d7 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 _0x8583=['hasOwnProperty','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x24b657,_0x3b9209){var _0x120c60=function(_0x5f4f51){while(--_0x5f4f51){_0x24b657['push'](_0x24b657['shift']());}};_0x120c60(++_0x3b9209);}(_0x8583,0xc1));var _0x3858=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8583[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x3858('0x0'))['db'][_0x3858('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3858('0x2')](0x0);var events={'afterCreate':_0x3858('0x3'),'afterUpdate':_0x3858('0x4'),'afterDestroy':_0x3858('0x5')};function emitEvent(_0x162e2b){return function(_0x1660e3,_0x6d4b36,_0x155f75){OpenchannelQueueEvents['emit'](_0x162e2b+':'+_0x1660e3['id'],_0x1660e3);OpenchannelQueueEvents[_0x3858('0x6')](_0x162e2b,_0x1660e3);_0x155f75(null);};}for(var e in events){if(events[_0x3858('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x71e4=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x2be18f,_0x38d2e0){var _0x4d37ac=function(_0x5dbe84){while(--_0x5dbe84){_0x2be18f['push'](_0x2be18f['shift']());}};_0x4d37ac(++_0x38d2e0);}(_0x71e4,0x65));var _0x471e=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x71e4[_0x15ca1a];return _0x507626;};'use strict';var EventEmitter=require(_0x471e('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x471e('0x1')](0x0);var events={'afterCreate':_0x471e('0x2'),'afterUpdate':'update','afterDestroy':_0x471e('0x3')};function emitEvent(_0x488870){return function(_0x45715f,_0x43a1c4,_0x500cec){OpenchannelQueueEvents[_0x471e('0x4')](_0x488870+':'+_0x45715f['id'],_0x45715f);OpenchannelQueueEvents['emit'](_0x488870,_0x45715f);_0x500cec(null);};}for(var e in events){if(events[_0x471e('0x5')](e)){var event=events[e];OpenchannelQueue[_0x471e('0x6')](e,emitEvent(event));}}module[_0x471e('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6f8be52..9f80fe2 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 _0x9760=['OpenchannelQueue','openchannel_queues','lodash','util','moment','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x4ed362,_0x3d0f8b){var _0x358ffc=function(_0x42363b){while(--_0x42363b){_0x4ed362['push'](_0x4ed362['shift']());}};_0x358ffc(++_0x3d0f8b);}(_0x9760,0x8e));var _0x0976=function(_0x4aa2e9,_0x5578a8){_0x4aa2e9=_0x4aa2e9-0x0;var _0xeeb33=_0x9760[_0x4aa2e9];return _0xeeb33;};'use strict';var _=require(_0x0976('0x0'));var util=require(_0x0976('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0976('0x2'));var BPromise=require(_0x0976('0x3'));var rp=require(_0x0976('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0976('0x5'));var attributes=require('./openchannelQueue.attributes');module[_0x0976('0x6')]=function(_0x3998e0,_0x4bacca){return _0x3998e0[_0x0976('0x7')](_0x0976('0x8'),attributes,{'tableName':_0x0976('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77fa=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x77fa,0x164));var _0xa77f=function(_0x4e11b7,_0x39136c){_0x4e11b7=_0x4e11b7-0x0;var _0x1cc5c7=_0x77fa[_0x4e11b7];return _0x1cc5c7;};'use strict';var _=require(_0xa77f('0x0'));var util=require(_0xa77f('0x1'));var logger=require(_0xa77f('0x2'))(_0xa77f('0x3'));var moment=require(_0xa77f('0x4'));var BPromise=require('bluebird');var rp=require(_0xa77f('0x5'));var fs=require('fs');var path=require(_0xa77f('0x6'));var rimraf=require(_0xa77f('0x7'));var config=require(_0xa77f('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0xa77f('0x9')]=function(_0x39841e,_0x2a2da0){return _0x39841e[_0xa77f('0xa')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 577b779..dfbf7ec 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 _0x46d7=['./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','find','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x50a392,_0x1de809){var _0xc2f2bf=function(_0x16114c){while(--_0x16114c){_0x50a392['push'](_0x50a392['shift']());}};_0xc2f2bf(++_0x1de809);}(_0x46d7,0x1dc));var _0x746d=function(_0x160726,_0x52de3d){_0x160726=_0x160726-0x0;var _0x2cd581=_0x46d7[_0x160726];return _0x2cd581;};'use strict';var _=require(_0x746d('0x0'));var util=require('util');var moment=require(_0x746d('0x1'));var BPromise=require(_0x746d('0x2'));var rs=require(_0x746d('0x3'));var fs=require('fs');var Redis=require(_0x746d('0x4'));var db=require(_0x746d('0x5'))['db'];var utils=require(_0x746d('0x6'));var logger=require(_0x746d('0x7'))(_0x746d('0x8'));var config=require(_0x746d('0x9'));var jayson=require(_0x746d('0xa'));var client=jayson[_0x746d('0xb')]['http']({'port':0x232a});config[_0x746d('0xc')]=_[_0x746d('0xd')](config[_0x746d('0xc')],{'host':_0x746d('0xe'),'port':0x18eb});var socket=require(_0x746d('0xf'))(new Redis(config[_0x746d('0xc')]));require(_0x746d('0x10'))['register'](socket);function respondWithRpcPromise(_0x508afc,_0x37a08f,_0x54cf1d){return new BPromise(function(_0x1103bf,_0x82a3a0){return client['request'](_0x508afc,_0x54cf1d)[_0x746d('0x11')](function(_0xa85f64){logger[_0x746d('0x12')](_0x746d('0x13'),_0x37a08f,_0x746d('0x14'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x37a08f,'request\x20sent',JSON[_0x746d('0x15')](_0xa85f64));if(_0xa85f64[_0x746d('0x16')]){if(_0xa85f64[_0x746d('0x16')][_0x746d('0x17')]===0x1f4){logger[_0x746d('0x16')](_0x746d('0x13'),_0x37a08f,_0xa85f64[_0x746d('0x16')]['message']);return _0x82a3a0(_0xa85f64['error'][_0x746d('0x18')]);}logger[_0x746d('0x16')](_0x746d('0x13'),_0x37a08f,_0xa85f64[_0x746d('0x16')][_0x746d('0x18')]);return _0x1103bf(_0xa85f64[_0x746d('0x16')][_0x746d('0x18')]);}else{logger['info'](_0x746d('0x13'),_0x37a08f,'request\x20sent');_0x1103bf(_0xa85f64[_0x746d('0x19')][_0x746d('0x18')]);}})[_0x746d('0x1a')](function(_0x1b454a){logger[_0x746d('0x16')](_0x746d('0x13'),_0x37a08f,_0x1b454a);_0x82a3a0(_0x1b454a);});});}exports[_0x746d('0x1b')]=function(_0x549168){var _0x5a16d6=this;return new Promise(function(_0x22e3b3,_0x4b73ab){return db[_0x746d('0x1c')][_0x746d('0x1d')]({'raw':_0x549168[_0x746d('0x1e')]?_0x549168[_0x746d('0x1e')][_0x746d('0x1f')]===undefined?!![]:![]:!![],'where':_0x549168[_0x746d('0x1e')]?_0x549168[_0x746d('0x1e')][_0x746d('0x20')]||null:null,'attributes':_0x549168[_0x746d('0x1e')]?_0x549168[_0x746d('0x1e')][_0x746d('0x21')]||null:null,'limit':_0x549168[_0x746d('0x1e')]?_0x549168[_0x746d('0x1e')][_0x746d('0x22')]||null:null,'include':_0x549168['options']?_0x549168[_0x746d('0x1e')][_0x746d('0x23')]?_['map'](_0x549168[_0x746d('0x1e')]['include'],function(_0x349319){return{'model':db[_0x349319[_0x746d('0x24')]],'as':_0x349319['as'],'attributes':_0x349319[_0x746d('0x21')],'include':_0x349319['include']?_[_0x746d('0x25')](_0x349319['include'],function(_0x4c484e){return{'model':db[_0x4c484e['model']],'as':_0x4c484e['as'],'attributes':_0x4c484e[_0x746d('0x21')],'include':_0x4c484e[_0x746d('0x23')]?_[_0x746d('0x25')](_0x4c484e[_0x746d('0x23')],function(_0x184a92){return{'model':db[_0x184a92[_0x746d('0x24')]],'as':_0x184a92['as'],'attributes':_0x184a92[_0x746d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x746d('0x11')](function(_0x206f8c){logger[_0x746d('0x12')](_0x746d('0x1b'),_0x549168);logger[_0x746d('0x26')](_0x746d('0x1b'),_0x549168,JSON[_0x746d('0x15')](_0x206f8c));_0x22e3b3(_0x206f8c);})[_0x746d('0x1a')](function(_0x27c2c5){logger[_0x746d('0x16')](_0x746d('0x1b'),_0x27c2c5[_0x746d('0x18')],_0x549168);_0x4b73ab(_0x5a16d6['error'](0x1f4,_0x27c2c5[_0x746d('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x164359){var _0x739b44=this;return new Promise(function(_0x444cdf,_0x47dc6c){return db[_0x746d('0x1c')][_0x746d('0x27')]({'raw':_0x164359[_0x746d('0x1e')]?_0x164359['options'][_0x746d('0x1f')]===undefined?!![]:![]:!![],'where':_0x164359[_0x746d('0x1e')]?_0x164359['options']['where']||null:null,'attributes':_0x164359['options']?_0x164359['options']['attributes']||null:null,'include':_0x164359['options']?_0x164359[_0x746d('0x1e')]['include']?_[_0x746d('0x25')](_0x164359[_0x746d('0x1e')][_0x746d('0x23')],function(_0x159266){return{'model':db[_0x159266[_0x746d('0x24')]],'as':_0x159266['as'],'attributes':_0x159266[_0x746d('0x21')],'include':_0x159266[_0x746d('0x23')]?_[_0x746d('0x25')](_0x159266[_0x746d('0x23')],function(_0x508149){return{'model':db[_0x508149[_0x746d('0x24')]],'as':_0x508149['as'],'attributes':_0x508149['attributes'],'include':_0x508149['include']?_[_0x746d('0x25')](_0x508149[_0x746d('0x23')],function(_0x5c6666){return{'model':db[_0x5c6666['model']],'as':_0x5c6666['as'],'attributes':_0x5c6666[_0x746d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x746d('0x11')](function(_0x37e46d){logger['info'](_0x746d('0x28'),_0x164359);logger['debug'](_0x746d('0x28'),_0x164359,JSON['stringify'](_0x37e46d));_0x444cdf(_0x37e46d);})[_0x746d('0x1a')](function(_0x4592b6){logger['error'](_0x746d('0x28'),_0x4592b6[_0x746d('0x18')],_0x164359);_0x47dc6c(_0x739b44[_0x746d('0x16')](0x1f4,_0x4592b6[_0x746d('0x18')]));});});}; \ No newline at end of file +var _0xb08f=['info','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','ShowOpenchannelQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x597c16,_0x2292fe){var _0x30cc2c=function(_0x26cb58){while(--_0x26cb58){_0x597c16['push'](_0x597c16['shift']());}};_0x30cc2c(++_0x2292fe);}(_0xb08f,0xb7));var _0xfb08=function(_0xb062ee,_0x5e67a4){_0xb062ee=_0xb062ee-0x0;var _0x254d2e=_0xb08f[_0xb062ee];return _0x254d2e;};'use strict';var _=require(_0xfb08('0x0'));var util=require(_0xfb08('0x1'));var moment=require(_0xfb08('0x2'));var BPromise=require(_0xfb08('0x3'));var rs=require(_0xfb08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb08('0x5'))['db'];var utils=require(_0xfb08('0x6'));var logger=require(_0xfb08('0x7'))(_0xfb08('0x8'));var config=require(_0xfb08('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb08('0xa')][_0xfb08('0xb')]({'port':0x232a});config[_0xfb08('0xc')]=_[_0xfb08('0xd')](config['redis'],{'host':_0xfb08('0xe'),'port':0x18eb});var socket=require(_0xfb08('0xf'))(new Redis(config[_0xfb08('0xc')]));require(_0xfb08('0x10'))[_0xfb08('0x11')](socket);function respondWithRpcPromise(_0x2529d9,_0x6b25d5,_0x3000ae){return new BPromise(function(_0x939c87,_0x522403){return client[_0xfb08('0x12')](_0x2529d9,_0x3000ae)[_0xfb08('0x13')](function(_0x34cd91){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x6b25d5,_0xfb08('0x14'));logger[_0xfb08('0x15')](_0xfb08('0x16'),_0x6b25d5,_0xfb08('0x14'),JSON[_0xfb08('0x17')](_0x34cd91));if(_0x34cd91['error']){if(_0x34cd91[_0xfb08('0x18')]['code']===0x1f4){logger[_0xfb08('0x18')](_0xfb08('0x19'),_0x6b25d5,_0x34cd91[_0xfb08('0x18')][_0xfb08('0x1a')]);return _0x522403(_0x34cd91[_0xfb08('0x18')][_0xfb08('0x1a')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x6b25d5,_0x34cd91[_0xfb08('0x18')][_0xfb08('0x1a')]);return _0x939c87(_0x34cd91[_0xfb08('0x18')][_0xfb08('0x1a')]);}else{logger[_0xfb08('0x1b')](_0xfb08('0x19'),_0x6b25d5,_0xfb08('0x14'));_0x939c87(_0x34cd91['result']['message']);}})[_0xfb08('0x1c')](function(_0x55b78b){logger[_0xfb08('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x6b25d5,_0x55b78b);_0x522403(_0x55b78b);});});}exports[_0xfb08('0x1d')]=function(_0x26c059){var _0x13a190=this;return new Promise(function(_0xccd07a,_0x1d9f07){return db[_0xfb08('0x1e')][_0xfb08('0x1f')]({'raw':_0x26c059[_0xfb08('0x20')]?_0x26c059['options'][_0xfb08('0x21')]===undefined?!![]:![]:!![],'where':_0x26c059[_0xfb08('0x20')]?_0x26c059[_0xfb08('0x20')]['where']||null:null,'attributes':_0x26c059['options']?_0x26c059['options'][_0xfb08('0x22')]||null:null,'limit':_0x26c059[_0xfb08('0x20')]?_0x26c059[_0xfb08('0x20')][_0xfb08('0x23')]||null:null,'include':_0x26c059['options']?_0x26c059[_0xfb08('0x20')][_0xfb08('0x24')]?_[_0xfb08('0x25')](_0x26c059[_0xfb08('0x20')]['include'],function(_0x1d30b6){return{'model':db[_0x1d30b6[_0xfb08('0x26')]],'as':_0x1d30b6['as'],'attributes':_0x1d30b6[_0xfb08('0x22')],'include':_0x1d30b6[_0xfb08('0x24')]?_[_0xfb08('0x25')](_0x1d30b6[_0xfb08('0x24')],function(_0x752635){return{'model':db[_0x752635[_0xfb08('0x26')]],'as':_0x752635['as'],'attributes':_0x752635[_0xfb08('0x22')],'include':_0x752635[_0xfb08('0x24')]?_[_0xfb08('0x25')](_0x752635[_0xfb08('0x24')],function(_0x2251d0){return{'model':db[_0x2251d0['model']],'as':_0x2251d0['as'],'attributes':_0x2251d0[_0xfb08('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfb08('0x13')](function(_0x19d225){logger[_0xfb08('0x1b')]('GetOpenchannelQueue',_0x26c059);logger[_0xfb08('0x15')](_0xfb08('0x1d'),_0x26c059,JSON[_0xfb08('0x17')](_0x19d225));_0xccd07a(_0x19d225);})[_0xfb08('0x1c')](function(_0x3d7946){logger[_0xfb08('0x18')](_0xfb08('0x1d'),_0x3d7946[_0xfb08('0x1a')],_0x26c059);_0x1d9f07(_0x13a190[_0xfb08('0x18')](0x1f4,_0x3d7946[_0xfb08('0x1a')]));});});};exports[_0xfb08('0x27')]=function(_0x109b4b){var _0x1b4706=this;return new Promise(function(_0x3cc367,_0x431f4f){return db[_0xfb08('0x1e')][_0xfb08('0x28')]({'raw':_0x109b4b[_0xfb08('0x20')]?_0x109b4b[_0xfb08('0x20')][_0xfb08('0x21')]===undefined?!![]:![]:!![],'where':_0x109b4b[_0xfb08('0x20')]?_0x109b4b[_0xfb08('0x20')][_0xfb08('0x29')]||null:null,'attributes':_0x109b4b[_0xfb08('0x20')]?_0x109b4b['options'][_0xfb08('0x22')]||null:null,'include':_0x109b4b[_0xfb08('0x20')]?_0x109b4b[_0xfb08('0x20')][_0xfb08('0x24')]?_['map'](_0x109b4b['options'][_0xfb08('0x24')],function(_0x1ad18e){return{'model':db[_0x1ad18e[_0xfb08('0x26')]],'as':_0x1ad18e['as'],'attributes':_0x1ad18e[_0xfb08('0x22')],'include':_0x1ad18e[_0xfb08('0x24')]?_['map'](_0x1ad18e[_0xfb08('0x24')],function(_0x3b0bd5){return{'model':db[_0x3b0bd5[_0xfb08('0x26')]],'as':_0x3b0bd5['as'],'attributes':_0x3b0bd5[_0xfb08('0x22')],'include':_0x3b0bd5[_0xfb08('0x24')]?_[_0xfb08('0x25')](_0x3b0bd5['include'],function(_0x8fca47){return{'model':db[_0x8fca47['model']],'as':_0x8fca47['as'],'attributes':_0x8fca47[_0xfb08('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfb08('0x13')](function(_0x2986f1){logger[_0xfb08('0x1b')](_0xfb08('0x27'),_0x109b4b);logger[_0xfb08('0x15')]('ShowOpenchannelQueue',_0x109b4b,JSON[_0xfb08('0x17')](_0x2986f1));_0x3cc367(_0x2986f1);})[_0xfb08('0x1c')](function(_0xae43ce){logger['error'](_0xfb08('0x27'),_0xae43ce[_0xfb08('0x1a')],_0x109b4b);_0x431f4f(_0x1b4706[_0xfb08('0x18')](0x1f4,_0xae43ce[_0xfb08('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 7d898ae..caeee2b 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 _0x040d=['removeListener','register','openchannelQueue:','remove','update'];(function(_0x364b0d,_0x463fb8){var _0x55d8ef=function(_0x1cb5a3){while(--_0x1cb5a3){_0x364b0d['push'](_0x364b0d['shift']());}};_0x55d8ef(++_0x463fb8);}(_0x040d,0x1f2));var _0xd040=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x040d[_0x120376];return _0x28c529;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xd040('0x0'),_0xd040('0x1')];function createListener(_0x2c40ac,_0x26113f){return function(_0x2b9c33){_0x26113f['emit'](_0x2c40ac,_0x2b9c33);};}function removeListener(_0x4d4936,_0x39337a){return function(){OpenchannelQueueEvents[_0xd040('0x2')](_0x4d4936,_0x39337a);};}exports[_0xd040('0x3')]=function(_0x1dc4d2){for(var _0x3004b3=0x0,_0x23efb7=events['length'];_0x3004b3<_0x23efb7;_0x3004b3++){var _0x805a92=events[_0x3004b3];var _0xb504e7=createListener(_0xd040('0x4')+_0x805a92,_0x1dc4d2);OpenchannelQueueEvents['on'](_0x805a92,_0xb504e7);}}; \ No newline at end of file +var _0x8bca=['openchannelQueue:','./openchannelQueue.events','save','update','emit','removeListener','register','length'];(function(_0x2192ee,_0x35c95b){var _0x1f708f=function(_0x3ae1dc){while(--_0x3ae1dc){_0x2192ee['push'](_0x2192ee['shift']());}};_0x1f708f(++_0x35c95b);}(_0x8bca,0x191));var _0xa8bc=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x8bca[_0x4c12ec];return _0x3ae42c;};'use strict';var OpenchannelQueueEvents=require(_0xa8bc('0x0'));var events=[_0xa8bc('0x1'),'remove',_0xa8bc('0x2')];function createListener(_0x5079a4,_0x4d2eb1){return function(_0x2909e8){_0x4d2eb1[_0xa8bc('0x3')](_0x5079a4,_0x2909e8);};}function removeListener(_0x4f6f80,_0x83c2c8){return function(){OpenchannelQueueEvents[_0xa8bc('0x4')](_0x4f6f80,_0x83c2c8);};}exports[_0xa8bc('0x5')]=function(_0x111cd2){for(var _0x3339ea=0x0,_0x47f686=events[_0xa8bc('0x6')];_0x3339ea<_0x47f686;_0x3339ea++){var _0x23dfa9=events[_0x3339ea];var _0x52bd5c=createListener(_0xa8bc('0x7')+_0x23dfa9,_0x111cd2);OpenchannelQueueEvents['on'](_0x23dfa9,_0x52bd5c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a85d054..13b63c2 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 _0x5676=['isAuthenticated','show','post','create','put','/:id','update','destroy','multer','path','connect-timeout','Router','fs-extra','/describe','describe','get'];(function(_0x2d5805,_0x21954e){var _0x1cae4f=function(_0x53ff24){while(--_0x53ff24){_0x2d5805['push'](_0x2d5805['shift']());}};_0x1cae4f(++_0x21954e);}(_0x5676,0xf8));var _0x6567=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5676[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x6567('0x0'));var util=require('util');var path=require(_0x6567('0x1'));var timeout=require(_0x6567('0x2'));var express=require('express');var router=express[_0x6567('0x3')]();var fs_extra=require(_0x6567('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6567('0x5'),auth['isAuthenticated'](),controller[_0x6567('0x6')]);router[_0x6567('0x7')]('/:id',auth[_0x6567('0x8')](),controller[_0x6567('0x9')]);router[_0x6567('0xa')]('/',auth['isAuthenticated'](),controller[_0x6567('0xb')]);router[_0x6567('0xc')](_0x6567('0xd'),auth[_0x6567('0x8')](),controller[_0x6567('0xe')]);router['delete'](_0x6567('0xd'),auth['isAuthenticated'](),controller[_0x6567('0xf')]);module['exports']=router; \ No newline at end of file +var _0x561d=['/:id','post','create','update','destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x4d98ac,_0x5613ba){var _0x2f142c=function(_0x539687){while(--_0x539687){_0x4d98ac['push'](_0x4d98ac['shift']());}};_0x2f142c(++_0x5613ba);}(_0x561d,0xe5));var _0xd561=function(_0x342774,_0x4744bf){_0x342774=_0x342774-0x0;var _0x40e233=_0x561d[_0x342774];return _0x40e233;};'use strict';var multer=require(_0xd561('0x0'));var util=require('util');var path=require(_0xd561('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd561('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd561('0x3'));var interaction=require(_0xd561('0x4'));var config=require('../../config/environment');var controller=require(_0xd561('0x5'));router[_0xd561('0x6')]('/',auth['isAuthenticated'](),controller[_0xd561('0x7')]);router['get'](_0xd561('0x8'),auth[_0xd561('0x9')](),controller[_0xd561('0xa')]);router[_0xd561('0x6')](_0xd561('0xb'),auth[_0xd561('0x9')](),controller['show']);router[_0xd561('0xc')]('/',auth[_0xd561('0x9')](),controller[_0xd561('0xd')]);router['put'](_0xd561('0xb'),auth[_0xd561('0x9')](),controller[_0xd561('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd561('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e89f1a9..db532f8 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 _0xb879=['DATE','exports','STRING'];(function(_0x4ce382,_0x229f10){var _0x25ead5=function(_0x1abe4f){while(--_0x1abe4f){_0x4ce382['push'](_0x4ce382['shift']());}};_0x25ead5(++_0x229f10);}(_0xb879,0x15d));var _0x9b87=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb879[_0x4b369d];return _0x571a98;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9b87('0x0')]={'uniqueid':{'type':Sequelize[_0x9b87('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9b87('0x1')]},'joinAt':{'type':Sequelize[_0x9b87('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9b87('0x2')]},'exitAt':{'type':Sequelize[_0x9b87('0x2')]},'reason':{'type':Sequelize[_0x9b87('0x1')]}}; \ No newline at end of file +var _0x7058=['DATE','moment','sequelize','STRING'];(function(_0x8e5d10,_0x1ca5f0){var _0x489f57=function(_0x53c00b){while(--_0x53c00b){_0x8e5d10['push'](_0x8e5d10['shift']());}};_0x489f57(++_0x1ca5f0);}(_0x7058,0xc9));var _0x8705=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7058[_0x38537f];return _0x141e23;};'use strict';var moment=require(_0x8705('0x0'));var Sequelize=require(_0x8705('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8705('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8705('0x2')]},'joinAt':{'type':Sequelize[_0x8705('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8705('0x3')]},'exitAt':{'type':Sequelize[_0x8705('0x3')]},'reason':{'type':Sequelize[_0x8705('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6ca2dfe..30bb3aa 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 _0xd7cc=['undefined','limit','count','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x4e1550,_0x1d377f){var _0x8158db=function(_0x16cb4a){while(--_0x16cb4a){_0x4e1550['push'](_0x4e1550['shift']());}};_0x8158db(++_0x1d377f);}(_0xd7cc,0x15c));var _0xcd7c=function(_0x19d353,_0x4ae972){_0x19d353=_0x19d353-0x0;var _0x3be0c1=_0xd7cc[_0x19d353];return _0x3be0c1;};'use strict';var emlformat=require(_0xcd7c('0x0'));var rimraf=require(_0xcd7c('0x1'));var zipdir=require(_0xcd7c('0x2'));var jsonpatch=require(_0xcd7c('0x3'));var rp=require(_0xcd7c('0x4'));var moment=require(_0xcd7c('0x5'));var BPromise=require(_0xcd7c('0x6'));var Mustache=require(_0xcd7c('0x7'));var util=require(_0xcd7c('0x8'));var path=require(_0xcd7c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcd7c('0xa'));var fs=require('fs');var fs_extra=require(_0xcd7c('0xb'));var _=require('lodash');var squel=require(_0xcd7c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd7c('0xd'));var querystring=require(_0xcd7c('0xe'));var Papa=require(_0xcd7c('0xf'));var Redis=require('ioredis');var authService=require(_0xcd7c('0x10'));var qs=require(_0xcd7c('0x11'));var as=require(_0xcd7c('0x12'));var hardwareService=require(_0xcd7c('0x13'));var logger=require('../../config/logger')(_0xcd7c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcd7c('0x15'));var db=require(_0xcd7c('0x16'))['db'];function respondWithStatusCode(_0x5b072b,_0x3d721f){_0x3d721f=_0x3d721f||0xcc;return function(_0x39bb46){if(_0x39bb46){return _0x5b072b['sendStatus'](_0x3d721f);}return _0x5b072b[_0xcd7c('0x17')](_0x3d721f)[_0xcd7c('0x18')]();};}function respondWithResult(_0x4e30bb,_0x2863e9){_0x2863e9=_0x2863e9||0xc8;return function(_0x129a0f){if(_0x129a0f){return _0x4e30bb[_0xcd7c('0x17')](_0x2863e9)[_0xcd7c('0x19')](_0x129a0f);}};}function respondWithFilteredResult(_0x59ffa3,_0xa5c79f){return function(_0x418802){if(_0x418802){var _0x3411ad=typeof _0xa5c79f[_0xcd7c('0x1a')]===_0xcd7c('0x1b')&&typeof _0xa5c79f[_0xcd7c('0x1c')]===_0xcd7c('0x1b');var _0x114362=_0x418802[_0xcd7c('0x1d')];var _0x27c766=_0x3411ad?0x0:_0xa5c79f[_0xcd7c('0x1a')];var _0x368e60=_0x3411ad?_0x418802[_0xcd7c('0x1d')]:_0xa5c79f[_0xcd7c('0x1a')]+_0xa5c79f[_0xcd7c('0x1c')];var _0x286472;if(_0x368e60>=_0x114362){_0x368e60=_0x114362;_0x286472=0xc8;}else{_0x286472=0xce;}_0x59ffa3[_0xcd7c('0x17')](_0x286472);return _0x59ffa3['set'](_0xcd7c('0x1e'),_0x27c766+'-'+_0x368e60+'/'+_0x114362)[_0xcd7c('0x19')](_0x418802);}return null;};}function patchUpdates(_0x45da90){return function(_0x50c309){try{jsonpatch[_0xcd7c('0x1f')](_0x50c309,_0x45da90,!![]);}catch(_0x9bfddd){return BPromise[_0xcd7c('0x20')](_0x9bfddd);}return _0x50c309['save']();};}function saveUpdates(_0x4f5d29,_0x2dcf8e){return function(_0x23e8e2){if(_0x23e8e2){return _0x23e8e2[_0xcd7c('0x21')](_0x4f5d29)['then'](function(_0xf79846){return _0xf79846;});}return null;};}function removeEntity(_0x41ea2f,_0xb7c65e){return function(_0x30715f){if(_0x30715f){return _0x30715f[_0xcd7c('0x22')]()[_0xcd7c('0x23')](function(){_0x41ea2f[_0xcd7c('0x17')](0xcc)[_0xcd7c('0x18')]();});}};}function handleEntityNotFound(_0x1a3be0,_0x5908c6){return function(_0x44ae28){if(!_0x44ae28){_0x1a3be0[_0xcd7c('0x24')](0x194);}return _0x44ae28;};}function handleError(_0x5355f1,_0x556bdf){_0x556bdf=_0x556bdf||0x1f4;return function(_0x177930){logger[_0xcd7c('0x25')](_0x177930[_0xcd7c('0x26')]);if(_0x177930[_0xcd7c('0x27')]){delete _0x177930['name'];}_0x5355f1[_0xcd7c('0x17')](_0x556bdf)[_0xcd7c('0x28')](_0x177930);};}exports[_0xcd7c('0x29')]=function(_0x392ea3,_0x5932f4){var _0x43b773={},_0x8a03a7={},_0xd20a94={'count':0x0,'rows':[]};var _0x34f932=_[_0xcd7c('0x2a')](db['OpenchannelQueueReport'][_0xcd7c('0x2b')],function(_0x55729e){return{'name':_0x55729e['fieldName'],'type':_0x55729e[_0xcd7c('0x2c')][_0xcd7c('0x2d')]};});_0x8a03a7[_0xcd7c('0x2e')]=_['map'](_0x34f932,_0xcd7c('0x27'));_0x8a03a7[_0xcd7c('0x2f')]=_[_0xcd7c('0x30')](_0x392ea3['query']);_0x8a03a7[_0xcd7c('0x31')]=_['intersection'](_0x8a03a7[_0xcd7c('0x2e')],_0x8a03a7[_0xcd7c('0x2f')]);_0x43b773[_0xcd7c('0x32')]=_[_0xcd7c('0x33')](_0x8a03a7[_0xcd7c('0x2e')],qs[_0xcd7c('0x34')](_0x392ea3[_0xcd7c('0x2f')]['fields']));_0x43b773[_0xcd7c('0x32')]=_0x43b773[_0xcd7c('0x32')][_0xcd7c('0x35')]?_0x43b773[_0xcd7c('0x32')]:_0x8a03a7[_0xcd7c('0x2e')];if(!_0x392ea3[_0xcd7c('0x2f')][_0xcd7c('0x36')](_0xcd7c('0x37'))){_0x43b773[_0xcd7c('0x1c')]=qs[_0xcd7c('0x1c')](_0x392ea3[_0xcd7c('0x2f')]['limit']);_0x43b773[_0xcd7c('0x1a')]=qs['offset'](_0x392ea3['query']['offset']);}_0x43b773[_0xcd7c('0x38')]=qs[_0xcd7c('0x39')](_0x392ea3[_0xcd7c('0x2f')][_0xcd7c('0x39')]);_0x43b773[_0xcd7c('0x3a')]=qs[_0xcd7c('0x31')](_[_0xcd7c('0x3b')](_0x392ea3['query'],_0x8a03a7[_0xcd7c('0x31')]),_0x34f932);if(_0x392ea3[_0xcd7c('0x2f')][_0xcd7c('0x3c')]){_0x43b773[_0xcd7c('0x3a')]=_[_0xcd7c('0x3d')](_0x43b773[_0xcd7c('0x3a')],{'$or':_['map'](_0x34f932,function(_0x56ba4e){if(_0x56ba4e[_0xcd7c('0x2c')]!==_0xcd7c('0x3e')){var _0x2b83bc={};_0x2b83bc[_0x56ba4e['name']]={'$like':'%'+_0x392ea3[_0xcd7c('0x2f')][_0xcd7c('0x3c')]+'%'};return _0x2b83bc;}})});}_0x43b773=_['merge']({},_0x43b773,_0x392ea3[_0xcd7c('0x3f')]);var _0x133644={'where':_0x43b773['where']};return db[_0xcd7c('0x40')]['count'](_0x133644)[_0xcd7c('0x23')](function(_0x3d4884){_0xd20a94[_0xcd7c('0x1d')]=_0x3d4884;if(_0x392ea3[_0xcd7c('0x2f')][_0xcd7c('0x41')]){_0x43b773[_0xcd7c('0x42')]=[{'all':!![]}];}return db[_0xcd7c('0x40')][_0xcd7c('0x43')](_0x43b773);})[_0xcd7c('0x23')](function(_0x4a1e65){_0xd20a94[_0xcd7c('0x44')]=_0x4a1e65;return _0xd20a94;})[_0xcd7c('0x23')](respondWithFilteredResult(_0x5932f4,_0x43b773))[_0xcd7c('0x45')](handleError(_0x5932f4,null));};exports['show']=function(_0x4a3d0e,_0x27c478){var _0x2d65a9={'raw':!![],'where':{'id':_0x4a3d0e[_0xcd7c('0x46')]['id']}},_0x204951={};_0x204951[_0xcd7c('0x2e')]=_[_0xcd7c('0x30')](db['OpenchannelQueueReport'][_0xcd7c('0x2b')]);_0x204951['query']=_[_0xcd7c('0x30')](_0x4a3d0e[_0xcd7c('0x2f')]);_0x204951[_0xcd7c('0x31')]=_[_0xcd7c('0x33')](_0x204951[_0xcd7c('0x2e')],_0x204951[_0xcd7c('0x2f')]);_0x2d65a9['attributes']=_[_0xcd7c('0x33')](_0x204951[_0xcd7c('0x2e')],qs[_0xcd7c('0x34')](_0x4a3d0e[_0xcd7c('0x2f')][_0xcd7c('0x34')]));_0x2d65a9[_0xcd7c('0x32')]=_0x2d65a9['attributes'][_0xcd7c('0x35')]?_0x2d65a9['attributes']:_0x204951['model'];if(_0x4a3d0e['query'][_0xcd7c('0x41')]){_0x2d65a9[_0xcd7c('0x42')]=[{'all':!![]}];}_0x2d65a9=_[_0xcd7c('0x3d')]({},_0x2d65a9,_0x4a3d0e[_0xcd7c('0x3f')]);return db[_0xcd7c('0x40')][_0xcd7c('0x47')](_0x2d65a9)['then'](handleEntityNotFound(_0x27c478,null))[_0xcd7c('0x23')](respondWithResult(_0x27c478,null))[_0xcd7c('0x45')](handleError(_0x27c478,null));};exports[_0xcd7c('0x48')]=function(_0x252d18,_0x43aeb3){return db[_0xcd7c('0x40')][_0xcd7c('0x48')](_0x252d18[_0xcd7c('0x49')],{})[_0xcd7c('0x23')](respondWithResult(_0x43aeb3,0xc9))[_0xcd7c('0x45')](handleError(_0x43aeb3,null));};exports[_0xcd7c('0x21')]=function(_0x2336c8,_0x5dec04){if(_0x2336c8[_0xcd7c('0x49')]['id']){delete _0x2336c8['body']['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x2336c8[_0xcd7c('0x46')]['id']}})[_0xcd7c('0x23')](handleEntityNotFound(_0x5dec04,null))[_0xcd7c('0x23')](saveUpdates(_0x2336c8[_0xcd7c('0x49')],null))[_0xcd7c('0x23')](respondWithResult(_0x5dec04,null))[_0xcd7c('0x45')](handleError(_0x5dec04,null));};exports[_0xcd7c('0x22')]=function(_0x25a104,_0x451dc6){return db[_0xcd7c('0x40')]['find']({'where':{'id':_0x25a104['params']['id']}})[_0xcd7c('0x23')](handleEntityNotFound(_0x451dc6,null))[_0xcd7c('0x23')](removeEntity(_0x451dc6,null))[_0xcd7c('0x45')](handleError(_0x451dc6,null));};exports[_0xcd7c('0x4a')]=function(_0x36421d,_0x1552c6){return db['OpenchannelQueueReport'][_0xcd7c('0x4a')]()[_0xcd7c('0x23')](respondWithResult(_0x1552c6,null))[_0xcd7c('0x45')](handleError(_0x1552c6,null));}; \ No newline at end of file +var _0xb652=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','VIRTUAL','merge','options','where','OpenchannelQueueReport','include','findAll','rows','params','length','includeAll','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x35a72a,_0x57cbcf){var _0x2ac359=function(_0x30cc41){while(--_0x30cc41){_0x35a72a['push'](_0x35a72a['shift']());}};_0x2ac359(++_0x57cbcf);}(_0xb652,0x8e));var _0x2b65=function(_0x5e90f0,_0x5b0206){_0x5e90f0=_0x5e90f0-0x0;var _0x49e16a=_0xb652[_0x5e90f0];return _0x49e16a;};'use strict';var emlformat=require(_0x2b65('0x0'));var rimraf=require(_0x2b65('0x1'));var zipdir=require(_0x2b65('0x2'));var jsonpatch=require(_0x2b65('0x3'));var rp=require(_0x2b65('0x4'));var moment=require(_0x2b65('0x5'));var BPromise=require(_0x2b65('0x6'));var Mustache=require(_0x2b65('0x7'));var util=require(_0x2b65('0x8'));var path=require(_0x2b65('0x9'));var sox=require(_0x2b65('0xa'));var csv=require(_0x2b65('0xb'));var ejs=require(_0x2b65('0xc'));var fs=require('fs');var fs_extra=require(_0x2b65('0xd'));var _=require(_0x2b65('0xe'));var squel=require(_0x2b65('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2b65('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2b65('0x11'));var Papa=require(_0x2b65('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2b65('0x13'));var hardwareService=require(_0x2b65('0x14'));var logger=require('../../config/logger')(_0x2b65('0x15'));var utils=require(_0x2b65('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2b65('0x17'));var db=require(_0x2b65('0x18'))['db'];function respondWithStatusCode(_0x2ac81a,_0xe75e63){_0xe75e63=_0xe75e63||0xcc;return function(_0x2b8823){if(_0x2b8823){return _0x2ac81a[_0x2b65('0x19')](_0xe75e63);}return _0x2ac81a[_0x2b65('0x1a')](_0xe75e63)[_0x2b65('0x1b')]();};}function respondWithResult(_0x253547,_0x21a40b){_0x21a40b=_0x21a40b||0xc8;return function(_0x378e3c){if(_0x378e3c){return _0x253547['status'](_0x21a40b)[_0x2b65('0x1c')](_0x378e3c);}};}function respondWithFilteredResult(_0x5821f1,_0x44339f){return function(_0x28afd7){if(_0x28afd7){var _0x456078=typeof _0x44339f['offset']==='undefined'&&typeof _0x44339f[_0x2b65('0x1d')]===_0x2b65('0x1e');var _0x498780=_0x28afd7[_0x2b65('0x1f')];var _0x54847d=_0x456078?0x0:_0x44339f[_0x2b65('0x20')];var _0x1b4b7e=_0x456078?_0x28afd7[_0x2b65('0x1f')]:_0x44339f['offset']+_0x44339f['limit'];var _0x275fea;if(_0x1b4b7e>=_0x498780){_0x1b4b7e=_0x498780;_0x275fea=0xc8;}else{_0x275fea=0xce;}_0x5821f1[_0x2b65('0x1a')](_0x275fea);return _0x5821f1[_0x2b65('0x21')](_0x2b65('0x22'),_0x54847d+'-'+_0x1b4b7e+'/'+_0x498780)[_0x2b65('0x1c')](_0x28afd7);}return null;};}function patchUpdates(_0x5eb17b){return function(_0x111dd2){try{jsonpatch[_0x2b65('0x23')](_0x111dd2,_0x5eb17b,!![]);}catch(_0x5289f9){return BPromise[_0x2b65('0x24')](_0x5289f9);}return _0x111dd2['save']();};}function saveUpdates(_0x2e5535,_0x2cea1a){return function(_0x566e27){if(_0x566e27){return _0x566e27[_0x2b65('0x25')](_0x2e5535)[_0x2b65('0x26')](function(_0x5674e0){return _0x5674e0;});}return null;};}function removeEntity(_0x11e7bd,_0x4cf494){return function(_0x27e862){if(_0x27e862){return _0x27e862['destroy']()['then'](function(){_0x11e7bd['status'](0xcc)[_0x2b65('0x1b')]();});}};}function handleEntityNotFound(_0x48f3e5,_0x13d859){return function(_0x56b258){if(!_0x56b258){_0x48f3e5['sendStatus'](0x194);}return _0x56b258;};}function handleError(_0x238cf8,_0x4deac3){_0x4deac3=_0x4deac3||0x1f4;return function(_0x17904c){logger['error'](_0x17904c[_0x2b65('0x27')]);if(_0x17904c[_0x2b65('0x28')]){delete _0x17904c[_0x2b65('0x28')];}_0x238cf8[_0x2b65('0x1a')](_0x4deac3)[_0x2b65('0x29')](_0x17904c);};}exports['index']=function(_0x47cb42,_0x5ceb3f){var _0xce5dbd={},_0x54567b={},_0x4402d7={'count':0x0,'rows':[]};var _0x467985=_[_0x2b65('0x2a')](db['OpenchannelQueueReport'][_0x2b65('0x2b')],function(_0x3ddac7){return{'name':_0x3ddac7[_0x2b65('0x2c')],'type':_0x3ddac7[_0x2b65('0x2d')]['key']};});_0x54567b[_0x2b65('0x2e')]=_[_0x2b65('0x2a')](_0x467985,_0x2b65('0x28'));_0x54567b[_0x2b65('0x2f')]=_[_0x2b65('0x30')](_0x47cb42[_0x2b65('0x2f')]);_0x54567b[_0x2b65('0x31')]=_[_0x2b65('0x32')](_0x54567b[_0x2b65('0x2e')],_0x54567b[_0x2b65('0x2f')]);_0xce5dbd[_0x2b65('0x33')]=_[_0x2b65('0x32')](_0x54567b[_0x2b65('0x2e')],qs[_0x2b65('0x34')](_0x47cb42[_0x2b65('0x2f')]['fields']));_0xce5dbd[_0x2b65('0x33')]=_0xce5dbd[_0x2b65('0x33')]['length']?_0xce5dbd[_0x2b65('0x33')]:_0x54567b['model'];if(!_0x47cb42[_0x2b65('0x2f')][_0x2b65('0x35')](_0x2b65('0x36'))){_0xce5dbd[_0x2b65('0x1d')]=qs[_0x2b65('0x1d')](_0x47cb42[_0x2b65('0x2f')][_0x2b65('0x1d')]);_0xce5dbd[_0x2b65('0x20')]=qs['offset'](_0x47cb42['query'][_0x2b65('0x20')]);}_0xce5dbd[_0x2b65('0x37')]=qs['sort'](_0x47cb42[_0x2b65('0x2f')]['sort']);_0xce5dbd['where']=qs[_0x2b65('0x31')](_[_0x2b65('0x38')](_0x47cb42[_0x2b65('0x2f')],_0x54567b[_0x2b65('0x31')]),_0x467985);if(_0x47cb42[_0x2b65('0x2f')][_0x2b65('0x39')]){_0xce5dbd['where']=_['merge'](_0xce5dbd['where'],{'$or':_[_0x2b65('0x2a')](_0x467985,function(_0x3d70dc){if(_0x3d70dc[_0x2b65('0x2d')]!==_0x2b65('0x3a')){var _0x441e8e={};_0x441e8e[_0x3d70dc[_0x2b65('0x28')]]={'$like':'%'+_0x47cb42['query']['filter']+'%'};return _0x441e8e;}})});}_0xce5dbd=_[_0x2b65('0x3b')]({},_0xce5dbd,_0x47cb42[_0x2b65('0x3c')]);var _0x535e39={'where':_0xce5dbd[_0x2b65('0x3d')]};return db[_0x2b65('0x3e')][_0x2b65('0x1f')](_0x535e39)['then'](function(_0x575064){_0x4402d7[_0x2b65('0x1f')]=_0x575064;if(_0x47cb42['query']['includeAll']){_0xce5dbd[_0x2b65('0x3f')]=[{'all':!![]}];}return db[_0x2b65('0x3e')][_0x2b65('0x40')](_0xce5dbd);})[_0x2b65('0x26')](function(_0x556cdf){_0x4402d7[_0x2b65('0x41')]=_0x556cdf;return _0x4402d7;})['then'](respondWithFilteredResult(_0x5ceb3f,_0xce5dbd))['catch'](handleError(_0x5ceb3f,null));};exports['show']=function(_0x31bd15,_0x6ecc29){var _0x18ee5b={'raw':!![],'where':{'id':_0x31bd15[_0x2b65('0x42')]['id']}},_0x53030a={};_0x53030a['model']=_['keys'](db['OpenchannelQueueReport'][_0x2b65('0x2b')]);_0x53030a['query']=_[_0x2b65('0x30')](_0x31bd15[_0x2b65('0x2f')]);_0x53030a[_0x2b65('0x31')]=_[_0x2b65('0x32')](_0x53030a[_0x2b65('0x2e')],_0x53030a[_0x2b65('0x2f')]);_0x18ee5b[_0x2b65('0x33')]=_['intersection'](_0x53030a[_0x2b65('0x2e')],qs['fields'](_0x31bd15[_0x2b65('0x2f')][_0x2b65('0x34')]));_0x18ee5b['attributes']=_0x18ee5b[_0x2b65('0x33')][_0x2b65('0x43')]?_0x18ee5b['attributes']:_0x53030a[_0x2b65('0x2e')];if(_0x31bd15[_0x2b65('0x2f')][_0x2b65('0x44')]){_0x18ee5b['include']=[{'all':!![]}];}_0x18ee5b=_[_0x2b65('0x3b')]({},_0x18ee5b,_0x31bd15[_0x2b65('0x3c')]);return db[_0x2b65('0x3e')][_0x2b65('0x45')](_0x18ee5b)[_0x2b65('0x26')](handleEntityNotFound(_0x6ecc29,null))[_0x2b65('0x26')](respondWithResult(_0x6ecc29,null))[_0x2b65('0x46')](handleError(_0x6ecc29,null));};exports['create']=function(_0x45e5b2,_0xb06798){return db[_0x2b65('0x3e')][_0x2b65('0x47')](_0x45e5b2[_0x2b65('0x48')],{})[_0x2b65('0x26')](respondWithResult(_0xb06798,0xc9))[_0x2b65('0x46')](handleError(_0xb06798,null));};exports[_0x2b65('0x25')]=function(_0x1a1076,_0x5c7c42){if(_0x1a1076['body']['id']){delete _0x1a1076[_0x2b65('0x48')]['id'];}return db[_0x2b65('0x3e')][_0x2b65('0x45')]({'where':{'id':_0x1a1076['params']['id']}})['then'](handleEntityNotFound(_0x5c7c42,null))[_0x2b65('0x26')](saveUpdates(_0x1a1076['body'],null))[_0x2b65('0x26')](respondWithResult(_0x5c7c42,null))[_0x2b65('0x46')](handleError(_0x5c7c42,null));};exports[_0x2b65('0x49')]=function(_0xb8fdca,_0x4266c9){return db[_0x2b65('0x3e')][_0x2b65('0x45')]({'where':{'id':_0xb8fdca[_0x2b65('0x42')]['id']}})[_0x2b65('0x26')](handleEntityNotFound(_0x4266c9,null))[_0x2b65('0x26')](removeEntity(_0x4266c9,null))[_0x2b65('0x46')](handleError(_0x4266c9,null));};exports[_0x2b65('0x4a')]=function(_0x39a24b,_0x3a6cf4){return db[_0x2b65('0x3e')][_0x2b65('0x4a')]()['then'](respondWithResult(_0x3a6cf4,null))[_0x2b65('0x46')](handleError(_0x3a6cf4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 98e420b..059323b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x2a8c95,_0x2f5721){var _0x267c01=function(_0x3ae16d){while(--_0x3ae16d){_0x2a8c95['push'](_0x2a8c95['shift']());}};_0x267c01(++_0x2f5721);}(_0x1261,0x144));var _0x1126=function(_0x45ae0d,_0x1ea3b9){_0x45ae0d=_0x45ae0d-0x0;var _0x371826=_0x1261[_0x45ae0d];return _0x371826;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x814b,0x1a2));var _0xb814=function(_0x11bc40,_0x537bbc){_0x11bc40=_0x11bc40-0x0;var _0x2b7a99=_0x814b[_0x11bc40];return _0x2b7a99;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index f649ac7..ff16f08 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 _0x55f1=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x311df2,_0x5b6291){var _0x2d70d7=function(_0x11d81b){while(--_0x11d81b){_0x311df2['push'](_0x311df2['shift']());}};_0x2d70d7(++_0x5b6291);}(_0x55f1,0x9b));var _0x155f=function(_0x2d86c2,_0x4bf7e6){_0x2d86c2=_0x2d86c2-0x0;var _0x1a7124=_0x55f1[_0x2d86c2];return _0x1a7124;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e07f,_0x39b14d,_0x1bcf84){return new BPromise(function(_0x2a0a02,_0x9fc06e){return client[_0x155f('0xa')](_0x22e07f,_0x1bcf84)[_0x155f('0xb')](function(_0x100e9a){logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,_0x155f('0xe'));logger[_0x155f('0xf')](_0x155f('0x10'),_0x39b14d,_0x155f('0xe'),JSON[_0x155f('0x11')](_0x100e9a));if(_0x100e9a[_0x155f('0x12')]){if(_0x100e9a['error'][_0x155f('0x13')]===0x1f4){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a['error']['message']);return _0x9fc06e(_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);}logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);return _0x2a0a02(_0x100e9a[_0x155f('0x12')]['message']);}else{logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,'request\x20sent');_0x2a0a02(_0x100e9a[_0x155f('0x15')][_0x155f('0x14')]);}})[_0x155f('0x16')](function(_0x7ad1c2){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x7ad1c2);_0x9fc06e(_0x7ad1c2);});});}exports[_0x155f('0x17')]=function(_0x343a1e){var _0x2f5b83=this;return new Promise(function(_0x407e26,_0x2e248d){return db[_0x155f('0x18')][_0x155f('0x19')](_0x343a1e[_0x155f('0x1a')],{'raw':_0x343a1e[_0x155f('0x1b')]?_0x343a1e[_0x155f('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x155f('0xb')](function(_0x26a322){logger[_0x155f('0xc')](_0x155f('0x17'),_0x343a1e);logger['debug']('CreateOpenchannelQueueReport',_0x343a1e,JSON['stringify'](_0x26a322));_0x407e26(_0x26a322);})[_0x155f('0x16')](function(_0x3a40b4){logger[_0x155f('0x12')](_0x155f('0x17'),_0x3a40b4[_0x155f('0x14')],_0x343a1e);_0x2e248d(_0x2f5b83['error'](0x1f4,_0x3a40b4[_0x155f('0x14')]));});});};exports[_0x155f('0x1c')]=function(_0x172077){var _0x348240=this;return new Promise(function(_0xee4dbc,_0x2588f5){return db[_0x155f('0x18')][_0x155f('0x1d')](_0x172077[_0x155f('0x1a')],{'raw':_0x172077[_0x155f('0x1b')]?_0x172077[_0x155f('0x1b')][_0x155f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x172077['options']?_0x172077['options'][_0x155f('0x1f')]||null:null,'attributes':_0x172077[_0x155f('0x1b')]?_0x172077[_0x155f('0x1b')][_0x155f('0x20')]||null:null,'limit':_0x172077['options']?_0x172077[_0x155f('0x1b')][_0x155f('0x21')]||null:null})[_0x155f('0xb')](function(_0x29e9dd){logger[_0x155f('0xc')](_0x155f('0x1c'),_0x172077);logger[_0x155f('0xf')]('UpdateOpenchannelQueueReport',_0x172077,JSON[_0x155f('0x11')](_0x29e9dd));_0xee4dbc(_0x29e9dd);})[_0x155f('0x16')](function(_0x154158){logger[_0x155f('0x12')](_0x155f('0x1c'),_0x154158[_0x155f('0x14')],_0x172077);_0x2588f5(_0x348240[_0x155f('0x12')](0x1f4,_0x154158[_0x155f('0x14')]));});});}; \ No newline at end of file +var _0x5c3c=['../../config/environment','jayson/promise','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','update','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3f53b1,_0x1b73ab){var _0x1f310f=function(_0x39ec4b){while(--_0x39ec4b){_0x3f53b1['push'](_0x3f53b1['shift']());}};_0x1f310f(++_0x1b73ab);}(_0x5c3c,0x132));var _0xc5c3=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x5c3c[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')](_0x2ff158[_0xc5c3('0x1a')],{'raw':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1c')]===undefined?!![]:![]:!![]})[_0xc5c3('0xd')](function(_0x3cc612){logger[_0xc5c3('0x15')](_0xc5c3('0x17'),_0x2ff158);logger['debug'](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x3cc612));_0x28bae6(_0x3cc612);})[_0xc5c3('0x1d')](function(_0x2de266){logger[_0xc5c3('0x12')](_0xc5c3('0x17'),_0x2de266[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2de266['message']));});});};exports[_0xc5c3('0x1e')]=function(_0x38dd9e){var _0x53ab72=this;return new Promise(function(_0x5c7329,_0x23e2fb){return db[_0xc5c3('0x18')][_0xc5c3('0x1f')](_0x38dd9e['body'],{'raw':_0x38dd9e['options']?_0x38dd9e[_0xc5c3('0x1b')][_0xc5c3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38dd9e[_0xc5c3('0x1b')]?_0x38dd9e[_0xc5c3('0x1b')]['where']||null:null,'attributes':_0x38dd9e[_0xc5c3('0x1b')]?_0x38dd9e['options'][_0xc5c3('0x20')]||null:null,'limit':_0x38dd9e['options']?_0x38dd9e[_0xc5c3('0x1b')][_0xc5c3('0x21')]||null:null})[_0xc5c3('0xd')](function(_0x4773c5){logger[_0xc5c3('0x15')](_0xc5c3('0x1e'),_0x38dd9e);logger[_0xc5c3('0x22')]('UpdateOpenchannelQueueReport',_0x38dd9e,JSON[_0xc5c3('0x11')](_0x4773c5));_0x5c7329(_0x4773c5);})['catch'](function(_0xc4b134){logger[_0xc5c3('0x12')]('UpdateOpenchannelQueueReport',_0xc4b134['message'],_0x38dd9e);_0x23e2fb(_0x53ab72[_0xc5c3('0x12')](0x1f4,_0xc4b134[_0xc5c3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 4e1fa66..3bcb190 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 _0xfc9b=['create','put','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfc9b,0x134));var _0xbfc9=function(_0x4e0482,_0x5c44f3){_0x4e0482=_0x4e0482-0x0;var _0x36acf4=_0xfc9b[_0x4e0482];return _0x36acf4;};'use strict';var multer=require(_0xbfc9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbfc9('0x1'));var express=require(_0xbfc9('0x2'));var router=express[_0xbfc9('0x3')]();var fs_extra=require(_0xbfc9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbfc9('0x5'));var config=require(_0xbfc9('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0xbfc9('0x7')]('/',auth['isAuthenticated'](),controller[_0xbfc9('0x8')]);router[_0xbfc9('0x7')]('/describe',auth[_0xbfc9('0x9')](),controller[_0xbfc9('0xa')]);router[_0xbfc9('0x7')]('/:id',auth[_0xbfc9('0x9')](),controller[_0xbfc9('0xb')]);router['post']('/',auth[_0xbfc9('0x9')](),controller[_0xbfc9('0xc')]);router[_0xbfc9('0xd')]('/:id',auth[_0xbfc9('0x9')](),controller[_0xbfc9('0xe')]);router['delete']('/:id',auth[_0xbfc9('0x9')](),controller[_0xbfc9('0xf')]);module['exports']=router; \ No newline at end of file +var _0x68ff=['describe','post','put','/:id','update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','index','get','/describe','isAuthenticated'];(function(_0x2164ef,_0x9c542d){var _0x4cdf94=function(_0x1cdd7f){while(--_0x1cdd7f){_0x2164ef['push'](_0x2164ef['shift']());}};_0x4cdf94(++_0x9c542d);}(_0x68ff,0x79));var _0xf68f=function(_0x436dbd,_0x4290cc){_0x436dbd=_0x436dbd-0x0;var _0x2c9bc5=_0x68ff[_0x436dbd];return _0x2c9bc5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf68f('0x0'));var express=require(_0xf68f('0x1'));var router=express[_0xf68f('0x2')]();var fs_extra=require(_0xf68f('0x3'));var auth=require(_0xf68f('0x4'));var interaction=require(_0xf68f('0x5'));var config=require(_0xf68f('0x6'));var controller=require(_0xf68f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf68f('0x8')]);router[_0xf68f('0x9')](_0xf68f('0xa'),auth[_0xf68f('0xb')](),controller[_0xf68f('0xc')]);router[_0xf68f('0x9')]('/:id',auth[_0xf68f('0xb')](),controller['show']);router[_0xf68f('0xd')]('/',auth[_0xf68f('0xb')](),controller['create']);router[_0xf68f('0xe')](_0xf68f('0xf'),auth[_0xf68f('0xb')](),controller[_0xf68f('0x10')]);router[_0xf68f('0x11')]('/:id',auth[_0xf68f('0xb')](),controller['destroy']);module[_0xf68f('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 2e96c63..93e7e37 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4cae38,_0x1f7372){var _0x4fc0d6=function(_0x105335){while(--_0x105335){_0x4cae38['push'](_0x4cae38['shift']());}};_0x4fc0d6(++_0x1f7372);}(_0x54ef,0x112));var _0xf54e=function(_0x1ed648,_0x3cb21f){_0x1ed648=_0x1ed648-0x0;var _0x62adbf=_0x54ef[_0x1ed648];return _0x62adbf;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x16e56f,_0x3439a2){var _0x54ed56=function(_0x4241b8){while(--_0x4241b8){_0x16e56f['push'](_0x16e56f['shift']());}};_0x54ed56(++_0x3439a2);}(_0xe706,0xa3));var _0x6e70=function(_0x585276,_0x553f5a){_0x585276=_0x585276-0x0;var _0x4a7181=_0xe706[_0x585276];return _0x4a7181;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 97e3bcb..4261683 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 _0x596e=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','length','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','save','update','then','destroy','error','stack','name','send','OpenchannelTransferReport','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x317964,_0x57a40c){var _0x38b405=function(_0xd81ef8){while(--_0xd81ef8){_0x317964['push'](_0x317964['shift']());}};_0x38b405(++_0x57a40c);}(_0x596e,0xa4));var _0xe596=function(_0x348ebe,_0x172dea){_0x348ebe=_0x348ebe-0x0;var _0x3fd953=_0x596e[_0x348ebe];return _0x3fd953;};'use strict';var emlformat=require(_0xe596('0x0'));var rimraf=require(_0xe596('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe596('0x2'));var rp=require(_0xe596('0x3'));var moment=require('moment');var BPromise=require(_0xe596('0x4'));var Mustache=require(_0xe596('0x5'));var util=require(_0xe596('0x6'));var path=require(_0xe596('0x7'));var sox=require('sox');var csv=require(_0xe596('0x8'));var ejs=require(_0xe596('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe596('0xa'));var squel=require(_0xe596('0xb'));var crypto=require(_0xe596('0xc'));var jsforce=require(_0xe596('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe596('0x8'));var querystring=require(_0xe596('0xe'));var Papa=require('papaparse');var Redis=require(_0xe596('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe596('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe596('0x11'))(_0xe596('0x12'));var utils=require(_0xe596('0x13'));var config=require(_0xe596('0x14'));var licenseUtil=require(_0xe596('0x15'));var db=require(_0xe596('0x16'))['db'];function respondWithStatusCode(_0x49d822,_0xb222d0){_0xb222d0=_0xb222d0||0xcc;return function(_0x557ab7){if(_0x557ab7){return _0x49d822[_0xe596('0x17')](_0xb222d0);}return _0x49d822['status'](_0xb222d0)[_0xe596('0x18')]();};}function respondWithResult(_0xfe7d26,_0x36114e){_0x36114e=_0x36114e||0xc8;return function(_0x171a40){if(_0x171a40){return _0xfe7d26['status'](_0x36114e)[_0xe596('0x19')](_0x171a40);}};}function respondWithFilteredResult(_0x30a56e,_0x28b707){return function(_0x5ef5ae){if(_0x5ef5ae){var _0x428f02=typeof _0x28b707[_0xe596('0x1a')]==='undefined'&&typeof _0x28b707[_0xe596('0x1b')]===_0xe596('0x1c');var _0x3c88d4=_0x5ef5ae[_0xe596('0x1d')];var _0x5a9e66=_0x428f02?0x0:_0x28b707[_0xe596('0x1a')];var _0x20ca3c=_0x428f02?_0x5ef5ae['count']:_0x28b707['offset']+_0x28b707[_0xe596('0x1b')];var _0x486d61;if(_0x20ca3c>=_0x3c88d4){_0x20ca3c=_0x3c88d4;_0x486d61=0xc8;}else{_0x486d61=0xce;}_0x30a56e[_0xe596('0x1e')](_0x486d61);return _0x30a56e[_0xe596('0x1f')]('Content-Range',_0x5a9e66+'-'+_0x20ca3c+'/'+_0x3c88d4)[_0xe596('0x19')](_0x5ef5ae);}return null;};}function patchUpdates(_0x36cb3b){return function(_0x1fc479){try{jsonpatch[_0xe596('0x20')](_0x1fc479,_0x36cb3b,!![]);}catch(_0x160992){return BPromise['reject'](_0x160992);}return _0x1fc479[_0xe596('0x21')]();};}function saveUpdates(_0x544fd2,_0x39af70){return function(_0x1d3eb6){if(_0x1d3eb6){return _0x1d3eb6[_0xe596('0x22')](_0x544fd2)[_0xe596('0x23')](function(_0x1fc14c){return _0x1fc14c;});}return null;};}function removeEntity(_0x25a6aa,_0x17aaca){return function(_0x362c6f){if(_0x362c6f){return _0x362c6f[_0xe596('0x24')]()[_0xe596('0x23')](function(){_0x25a6aa[_0xe596('0x1e')](0xcc)[_0xe596('0x18')]();});}};}function handleEntityNotFound(_0x4954a3,_0x415ae9){return function(_0x25ac94){if(!_0x25ac94){_0x4954a3[_0xe596('0x17')](0x194);}return _0x25ac94;};}function handleError(_0x276b82,_0x6ce07b){_0x6ce07b=_0x6ce07b||0x1f4;return function(_0x29a9b1){logger[_0xe596('0x25')](_0x29a9b1[_0xe596('0x26')]);if(_0x29a9b1[_0xe596('0x27')]){delete _0x29a9b1[_0xe596('0x27')];}_0x276b82[_0xe596('0x1e')](_0x6ce07b)[_0xe596('0x28')](_0x29a9b1);};}exports['index']=function(_0x4eff08,_0xade37e){var _0x46f11c={},_0x26eb34={},_0x5922d7={'count':0x0,'rows':[]};var _0xe4a655=_['map'](db[_0xe596('0x29')]['rawAttributes'],function(_0x4a55cd){return{'name':_0x4a55cd[_0xe596('0x2a')],'type':_0x4a55cd[_0xe596('0x2b')][_0xe596('0x2c')]};});_0x26eb34[_0xe596('0x2d')]=_[_0xe596('0x2e')](_0xe4a655,_0xe596('0x27'));_0x26eb34[_0xe596('0x2f')]=_['keys'](_0x4eff08[_0xe596('0x2f')]);_0x26eb34[_0xe596('0x30')]=_[_0xe596('0x31')](_0x26eb34['model'],_0x26eb34[_0xe596('0x2f')]);_0x46f11c[_0xe596('0x32')]=_[_0xe596('0x31')](_0x26eb34[_0xe596('0x2d')],qs[_0xe596('0x33')](_0x4eff08['query']['fields']));_0x46f11c['attributes']=_0x46f11c[_0xe596('0x32')]['length']?_0x46f11c[_0xe596('0x32')]:_0x26eb34[_0xe596('0x2d')];if(!_0x4eff08[_0xe596('0x2f')][_0xe596('0x34')](_0xe596('0x35'))){_0x46f11c[_0xe596('0x1b')]=qs[_0xe596('0x1b')](_0x4eff08[_0xe596('0x2f')][_0xe596('0x1b')]);_0x46f11c[_0xe596('0x1a')]=qs[_0xe596('0x1a')](_0x4eff08[_0xe596('0x2f')][_0xe596('0x1a')]);}_0x46f11c['order']=qs['sort'](_0x4eff08[_0xe596('0x2f')][_0xe596('0x36')]);_0x46f11c[_0xe596('0x37')]=qs[_0xe596('0x30')](_[_0xe596('0x38')](_0x4eff08[_0xe596('0x2f')],_0x26eb34['filters']),_0xe4a655);if(_0x4eff08['query'][_0xe596('0x39')]){_0x46f11c[_0xe596('0x37')]=_[_0xe596('0x3a')](_0x46f11c['where'],{'$or':_[_0xe596('0x2e')](_0xe4a655,function(_0x2030eb){if(_0x2030eb[_0xe596('0x2b')]!==_0xe596('0x3b')){var _0x158ef1={};_0x158ef1[_0x2030eb[_0xe596('0x27')]]={'$like':'%'+_0x4eff08[_0xe596('0x2f')][_0xe596('0x39')]+'%'};return _0x158ef1;}})});}_0x46f11c=_[_0xe596('0x3a')]({},_0x46f11c,_0x4eff08[_0xe596('0x3c')]);var _0x3b21b7={'where':_0x46f11c[_0xe596('0x37')]};return db['OpenchannelTransferReport'][_0xe596('0x1d')](_0x3b21b7)[_0xe596('0x23')](function(_0x422055){_0x5922d7[_0xe596('0x1d')]=_0x422055;if(_0x4eff08['query'][_0xe596('0x3d')]){_0x46f11c[_0xe596('0x3e')]=[{'all':!![]}];}return db[_0xe596('0x29')]['findAll'](_0x46f11c);})['then'](function(_0x366998){_0x5922d7[_0xe596('0x3f')]=_0x366998;return _0x5922d7;})[_0xe596('0x23')](respondWithFilteredResult(_0xade37e,_0x46f11c))[_0xe596('0x40')](handleError(_0xade37e,null));};exports[_0xe596('0x41')]=function(_0x405793,_0x47acfe){var _0xbe0af4={'raw':!![],'where':{'id':_0x405793['params']['id']}},_0x549c1f={};_0x549c1f['model']=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x549c1f['query']=_[_0xe596('0x42')](_0x405793[_0xe596('0x2f')]);_0x549c1f[_0xe596('0x30')]=_[_0xe596('0x31')](_0x549c1f[_0xe596('0x2d')],_0x549c1f['query']);_0xbe0af4[_0xe596('0x32')]=_[_0xe596('0x31')](_0x549c1f[_0xe596('0x2d')],qs[_0xe596('0x33')](_0x405793[_0xe596('0x2f')][_0xe596('0x33')]));_0xbe0af4[_0xe596('0x32')]=_0xbe0af4['attributes'][_0xe596('0x43')]?_0xbe0af4[_0xe596('0x32')]:_0x549c1f[_0xe596('0x2d')];if(_0x405793['query'][_0xe596('0x3d')]){_0xbe0af4[_0xe596('0x3e')]=[{'all':!![]}];}_0xbe0af4=_[_0xe596('0x3a')]({},_0xbe0af4,_0x405793['options']);return db['OpenchannelTransferReport'][_0xe596('0x44')](_0xbe0af4)['then'](handleEntityNotFound(_0x47acfe,null))[_0xe596('0x23')](respondWithResult(_0x47acfe,null))[_0xe596('0x40')](handleError(_0x47acfe,null));};exports[_0xe596('0x45')]=function(_0x58e300,_0x21cdac){return db[_0xe596('0x29')][_0xe596('0x45')](_0x58e300[_0xe596('0x46')],{})['then'](respondWithResult(_0x21cdac,0xc9))[_0xe596('0x40')](handleError(_0x21cdac,null));};exports[_0xe596('0x22')]=function(_0x3993b0,_0x5bed99){if(_0x3993b0[_0xe596('0x46')]['id']){delete _0x3993b0[_0xe596('0x46')]['id'];}return db[_0xe596('0x29')]['find']({'where':{'id':_0x3993b0[_0xe596('0x47')]['id']}})[_0xe596('0x23')](handleEntityNotFound(_0x5bed99,null))[_0xe596('0x23')](saveUpdates(_0x3993b0[_0xe596('0x46')],null))[_0xe596('0x23')](respondWithResult(_0x5bed99,null))[_0xe596('0x40')](handleError(_0x5bed99,null));};exports[_0xe596('0x24')]=function(_0x4a42df,_0x1c70b3){return db[_0xe596('0x29')][_0xe596('0x44')]({'where':{'id':_0x4a42df['params']['id']}})['then'](handleEntityNotFound(_0x1c70b3,null))['then'](removeEntity(_0x1c70b3,null))[_0xe596('0x40')](handleError(_0x1c70b3,null));};exports[_0xe596('0x48')]=function(_0x72b85a,_0x4d340d){return db[_0xe596('0x29')][_0xe596('0x48')]()[_0xe596('0x23')](respondWithResult(_0x4d340d,null))['catch'](handleError(_0x4d340d,null));}; \ No newline at end of file +var _0x19d0=['end','error','name','send','map','OpenchannelTransferReport','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then'];(function(_0x552474,_0xb7958d){var _0x348d11=function(_0x5cd421){while(--_0x5cd421){_0x552474['push'](_0x552474['shift']());}};_0x348d11(++_0xb7958d);}(_0x19d0,0x14b));var _0x019d=function(_0x21e1dc,_0x2b148d){_0x21e1dc=_0x21e1dc-0x0;var _0x44cfb9=_0x19d0[_0x21e1dc];return _0x44cfb9;};'use strict';var emlformat=require(_0x019d('0x0'));var rimraf=require(_0x019d('0x1'));var zipdir=require(_0x019d('0x2'));var jsonpatch=require(_0x019d('0x3'));var rp=require(_0x019d('0x4'));var moment=require(_0x019d('0x5'));var BPromise=require(_0x019d('0x6'));var Mustache=require(_0x019d('0x7'));var util=require(_0x019d('0x8'));var path=require(_0x019d('0x9'));var sox=require('sox');var csv=require(_0x019d('0xa'));var ejs=require(_0x019d('0xb'));var fs=require('fs');var fs_extra=require(_0x019d('0xc'));var _=require(_0x019d('0xd'));var squel=require(_0x019d('0xe'));var crypto=require(_0x019d('0xf'));var jsforce=require(_0x019d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x019d('0xa'));var querystring=require(_0x019d('0x11'));var Papa=require('papaparse');var Redis=require(_0x019d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x019d('0x13'));var as=require(_0x019d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x019d('0x15'))('api');var utils=require(_0x019d('0x16'));var config=require(_0x019d('0x17'));var licenseUtil=require(_0x019d('0x18'));var db=require(_0x019d('0x19'))['db'];function respondWithStatusCode(_0x57b142,_0x472a83){_0x472a83=_0x472a83||0xcc;return function(_0x6b70b0){if(_0x6b70b0){return _0x57b142[_0x019d('0x1a')](_0x472a83);}return _0x57b142[_0x019d('0x1b')](_0x472a83)['end']();};}function respondWithResult(_0x59f736,_0x1a5674){_0x1a5674=_0x1a5674||0xc8;return function(_0x24c08b){if(_0x24c08b){return _0x59f736[_0x019d('0x1b')](_0x1a5674)[_0x019d('0x1c')](_0x24c08b);}};}function respondWithFilteredResult(_0x3cef19,_0x1f1a74){return function(_0x159620){if(_0x159620){var _0x4cad30=typeof _0x1f1a74[_0x019d('0x1d')]==='undefined'&&typeof _0x1f1a74[_0x019d('0x1e')]===_0x019d('0x1f');var _0x29c3f6=_0x159620[_0x019d('0x20')];var _0x7b8baf=_0x4cad30?0x0:_0x1f1a74['offset'];var _0x11862c=_0x4cad30?_0x159620[_0x019d('0x20')]:_0x1f1a74['offset']+_0x1f1a74[_0x019d('0x1e')];var _0x26d128;if(_0x11862c>=_0x29c3f6){_0x11862c=_0x29c3f6;_0x26d128=0xc8;}else{_0x26d128=0xce;}_0x3cef19[_0x019d('0x1b')](_0x26d128);return _0x3cef19[_0x019d('0x21')](_0x019d('0x22'),_0x7b8baf+'-'+_0x11862c+'/'+_0x29c3f6)[_0x019d('0x1c')](_0x159620);}return null;};}function patchUpdates(_0x1e0792){return function(_0x3dfe03){try{jsonpatch['apply'](_0x3dfe03,_0x1e0792,!![]);}catch(_0x3116cb){return BPromise[_0x019d('0x23')](_0x3116cb);}return _0x3dfe03[_0x019d('0x24')]();};}function saveUpdates(_0x232839,_0x5a93f9){return function(_0x5ea37e){if(_0x5ea37e){return _0x5ea37e[_0x019d('0x25')](_0x232839)[_0x019d('0x26')](function(_0x4f3690){return _0x4f3690;});}return null;};}function removeEntity(_0x3b5c98,_0x4f2139){return function(_0x2bb0ac){if(_0x2bb0ac){return _0x2bb0ac['destroy']()[_0x019d('0x26')](function(){_0x3b5c98[_0x019d('0x1b')](0xcc)[_0x019d('0x27')]();});}};}function handleEntityNotFound(_0x26fe8f,_0x3e49fc){return function(_0x3d6a8b){if(!_0x3d6a8b){_0x26fe8f[_0x019d('0x1a')](0x194);}return _0x3d6a8b;};}function handleError(_0x9029d4,_0x684ac9){_0x684ac9=_0x684ac9||0x1f4;return function(_0x16fa3c){logger[_0x019d('0x28')](_0x16fa3c['stack']);if(_0x16fa3c['name']){delete _0x16fa3c[_0x019d('0x29')];}_0x9029d4[_0x019d('0x1b')](_0x684ac9)[_0x019d('0x2a')](_0x16fa3c);};}exports['index']=function(_0xb6112a,_0x523a25){var _0x3fdf22={},_0x42a907={},_0x364764={'count':0x0,'rows':[]};var _0x4e4937=_[_0x019d('0x2b')](db[_0x019d('0x2c')]['rawAttributes'],function(_0x3f0149){return{'name':_0x3f0149['fieldName'],'type':_0x3f0149[_0x019d('0x2d')][_0x019d('0x2e')]};});_0x42a907['model']=_[_0x019d('0x2b')](_0x4e4937,_0x019d('0x29'));_0x42a907[_0x019d('0x2f')]=_[_0x019d('0x30')](_0xb6112a[_0x019d('0x2f')]);_0x42a907[_0x019d('0x31')]=_[_0x019d('0x32')](_0x42a907['model'],_0x42a907[_0x019d('0x2f')]);_0x3fdf22[_0x019d('0x33')]=_[_0x019d('0x32')](_0x42a907[_0x019d('0x34')],qs[_0x019d('0x35')](_0xb6112a[_0x019d('0x2f')][_0x019d('0x35')]));_0x3fdf22['attributes']=_0x3fdf22[_0x019d('0x33')]['length']?_0x3fdf22[_0x019d('0x33')]:_0x42a907[_0x019d('0x34')];if(!_0xb6112a[_0x019d('0x2f')][_0x019d('0x36')](_0x019d('0x37'))){_0x3fdf22[_0x019d('0x1e')]=qs[_0x019d('0x1e')](_0xb6112a[_0x019d('0x2f')]['limit']);_0x3fdf22[_0x019d('0x1d')]=qs[_0x019d('0x1d')](_0xb6112a[_0x019d('0x2f')][_0x019d('0x1d')]);}_0x3fdf22[_0x019d('0x38')]=qs[_0x019d('0x39')](_0xb6112a[_0x019d('0x2f')][_0x019d('0x39')]);_0x3fdf22['where']=qs[_0x019d('0x31')](_[_0x019d('0x3a')](_0xb6112a[_0x019d('0x2f')],_0x42a907[_0x019d('0x31')]),_0x4e4937);if(_0xb6112a['query'][_0x019d('0x3b')]){_0x3fdf22[_0x019d('0x3c')]=_['merge'](_0x3fdf22[_0x019d('0x3c')],{'$or':_[_0x019d('0x2b')](_0x4e4937,function(_0x5c4056){if(_0x5c4056[_0x019d('0x2d')]!=='VIRTUAL'){var _0xd1ddb1={};_0xd1ddb1[_0x5c4056[_0x019d('0x29')]]={'$like':'%'+_0xb6112a[_0x019d('0x2f')]['filter']+'%'};return _0xd1ddb1;}})});}_0x3fdf22=_[_0x019d('0x3d')]({},_0x3fdf22,_0xb6112a[_0x019d('0x3e')]);var _0x2e807b={'where':_0x3fdf22[_0x019d('0x3c')]};return db[_0x019d('0x2c')][_0x019d('0x20')](_0x2e807b)[_0x019d('0x26')](function(_0x46531c){_0x364764['count']=_0x46531c;if(_0xb6112a[_0x019d('0x2f')][_0x019d('0x3f')]){_0x3fdf22[_0x019d('0x40')]=[{'all':!![]}];}return db[_0x019d('0x2c')][_0x019d('0x41')](_0x3fdf22);})[_0x019d('0x26')](function(_0x3ccc74){_0x364764['rows']=_0x3ccc74;return _0x364764;})['then'](respondWithFilteredResult(_0x523a25,_0x3fdf22))[_0x019d('0x42')](handleError(_0x523a25,null));};exports['show']=function(_0x914a63,_0x32deda){var _0x14f7d8={'raw':!![],'where':{'id':_0x914a63[_0x019d('0x43')]['id']}},_0x3f1a3b={};_0x3f1a3b[_0x019d('0x34')]=_[_0x019d('0x30')](db['OpenchannelTransferReport'][_0x019d('0x44')]);_0x3f1a3b[_0x019d('0x2f')]=_[_0x019d('0x30')](_0x914a63[_0x019d('0x2f')]);_0x3f1a3b[_0x019d('0x31')]=_[_0x019d('0x32')](_0x3f1a3b[_0x019d('0x34')],_0x3f1a3b[_0x019d('0x2f')]);_0x14f7d8[_0x019d('0x33')]=_[_0x019d('0x32')](_0x3f1a3b[_0x019d('0x34')],qs[_0x019d('0x35')](_0x914a63['query'][_0x019d('0x35')]));_0x14f7d8[_0x019d('0x33')]=_0x14f7d8[_0x019d('0x33')]['length']?_0x14f7d8[_0x019d('0x33')]:_0x3f1a3b['model'];if(_0x914a63[_0x019d('0x2f')][_0x019d('0x3f')]){_0x14f7d8[_0x019d('0x40')]=[{'all':!![]}];}_0x14f7d8=_['merge']({},_0x14f7d8,_0x914a63['options']);return db[_0x019d('0x2c')][_0x019d('0x45')](_0x14f7d8)[_0x019d('0x26')](handleEntityNotFound(_0x32deda,null))['then'](respondWithResult(_0x32deda,null))[_0x019d('0x42')](handleError(_0x32deda,null));};exports[_0x019d('0x46')]=function(_0x2bd77c,_0x5bd72a){return db[_0x019d('0x2c')][_0x019d('0x46')](_0x2bd77c[_0x019d('0x47')],{})[_0x019d('0x26')](respondWithResult(_0x5bd72a,0xc9))[_0x019d('0x42')](handleError(_0x5bd72a,null));};exports['update']=function(_0x56fff1,_0x425209){if(_0x56fff1[_0x019d('0x47')]['id']){delete _0x56fff1[_0x019d('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x019d('0x45')]({'where':{'id':_0x56fff1['params']['id']}})[_0x019d('0x26')](handleEntityNotFound(_0x425209,null))['then'](saveUpdates(_0x56fff1[_0x019d('0x47')],null))['then'](respondWithResult(_0x425209,null))[_0x019d('0x42')](handleError(_0x425209,null));};exports[_0x019d('0x48')]=function(_0x1f0ae5,_0x4d9297){return db[_0x019d('0x2c')][_0x019d('0x45')]({'where':{'id':_0x1f0ae5[_0x019d('0x43')]['id']}})[_0x019d('0x26')](handleEntityNotFound(_0x4d9297,null))[_0x019d('0x26')](removeEntity(_0x4d9297,null))[_0x019d('0x42')](handleError(_0x4d9297,null));};exports[_0x019d('0x49')]=function(_0xe3e70e,_0x942c48){return db[_0x019d('0x2c')][_0x019d('0x49')]()[_0x019d('0x26')](respondWithResult(_0x942c48,null))['catch'](handleError(_0x942c48,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 31ed43d..ab7165f 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 _0x5248=['../../config/logger','api','bluebird','request-promise','rimraf','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x5248,0x172));var _0x8524=function(_0x851f1a,_0x550024){_0x851f1a=_0x851f1a-0x0;var _0x4465bb=_0x5248[_0x851f1a];return _0x4465bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8524('0x0'))(_0x8524('0x1'));var moment=require('moment');var BPromise=require(_0x8524('0x2'));var rp=require(_0x8524('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8524('0x4'));var config=require('../../config/environment');var attributes=require(_0x8524('0x5'));module[_0x8524('0x6')]=function(_0x5662f1,_0xda4714){return _0x5662f1[_0x8524('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0x8524('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8524('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf81e=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3a3822,_0x1e4fd1){var _0x2f9aca=function(_0x33fad6){while(--_0x33fad6){_0x3a3822['push'](_0x3a3822['shift']());}};_0x2f9aca(++_0x1e4fd1);}(_0xf81e,0x1f3));var _0xef81=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf81e[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xef81('0x0'));var util=require('util');var logger=require(_0xef81('0x1'))(_0xef81('0x2'));var moment=require(_0xef81('0x3'));var BPromise=require(_0xef81('0x4'));var rp=require(_0xef81('0x5'));var fs=require('fs');var path=require(_0xef81('0x6'));var rimraf=require('rimraf');var config=require(_0xef81('0x7'));var attributes=require(_0xef81('0x8'));module[_0xef81('0x9')]=function(_0x9524cc,_0x3cb0ae){return _0x9524cc[_0xef81('0xa')](_0xef81('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xef81('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index e798ac3..332b47b 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 _0x9fc5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment'];(function(_0x3897f6,_0x4ebde7){var _0x5b8072=function(_0x16bbaf){while(--_0x16bbaf){_0x3897f6['push'](_0x3897f6['shift']());}};_0x5b8072(++_0x4ebde7);}(_0x9fc5,0xb6));var _0x59fc=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x9fc5[_0x1385dc];return _0x2f6469;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var moment=require(_0x59fc('0x1'));var BPromise=require('bluebird');var rs=require(_0x59fc('0x2'));var fs=require('fs');var Redis=require(_0x59fc('0x3'));var db=require(_0x59fc('0x4'))['db'];var utils=require(_0x59fc('0x5'));var logger=require(_0x59fc('0x6'))(_0x59fc('0x7'));var config=require(_0x59fc('0x8'));var jayson=require(_0x59fc('0x9'));var client=jayson['client'][_0x59fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13897f,_0x2c47fb,_0x55fa6d){return new BPromise(function(_0xdd2bb9,_0x313063){return client[_0x59fc('0xb')](_0x13897f,_0x55fa6d)[_0x59fc('0xc')](function(_0x39bc72){logger[_0x59fc('0xd')](_0x59fc('0xe'),_0x2c47fb,'request\x20sent');logger[_0x59fc('0xf')](_0x59fc('0x10'),_0x2c47fb,_0x59fc('0x11'),JSON[_0x59fc('0x12')](_0x39bc72));if(_0x39bc72[_0x59fc('0x13')]){if(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x14')]===0x1f4){logger['error'](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0x313063(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0xdd2bb9(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}else{logger['info'](_0x59fc('0xe'),_0x2c47fb,_0x59fc('0x11'));_0xdd2bb9(_0x39bc72['result'][_0x59fc('0x15')]);}})[_0x59fc('0x16')](function(_0x4162c4){logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x4162c4);_0x313063(_0x4162c4);});});} \ No newline at end of file +var _0x0958=['moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util'];(function(_0x494093,_0x4f7e84){var _0x394add=function(_0x572565){while(--_0x572565){_0x494093['push'](_0x494093['shift']());}};_0x394add(++_0x4f7e84);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var moment=require(_0x8095('0x2'));var BPromise=require('bluebird');var rs=require(_0x8095('0x3'));var fs=require('fs');var Redis=require(_0x8095('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8095('0x5'))(_0x8095('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8095('0x7')][_0x8095('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x439ecc,_0x1dac39,_0x1fac84){return new BPromise(function(_0x4d5ee3,_0x5a19ef){return client[_0x8095('0x9')](_0x439ecc,_0x1fac84)[_0x8095('0xa')](function(_0x4967a5){logger['info'](_0x8095('0xb'),_0x1dac39,'request\x20sent');logger[_0x8095('0xc')](_0x8095('0xd'),_0x1dac39,_0x8095('0xe'),JSON[_0x8095('0xf')](_0x4967a5));if(_0x4967a5[_0x8095('0x10')]){if(_0x4967a5['error'][_0x8095('0x11')]===0x1f4){logger['error'](_0x8095('0xb'),_0x1dac39,_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);return _0x5a19ef(_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);}logger[_0x8095('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1dac39,_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);return _0x4d5ee3(_0x4967a5[_0x8095('0x10')]['message']);}else{logger[_0x8095('0x13')](_0x8095('0xb'),_0x1dac39,_0x8095('0xe'));_0x4d5ee3(_0x4967a5[_0x8095('0x14')][_0x8095('0x12')]);}})['catch'](function(_0x1b1ca3){logger[_0x8095('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1dac39,_0x1b1ca3);_0x5a19ef(_0x1b1ca3);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e890f86..63b4282 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 _0x8510=['multer','util','connect-timeout','fs-extra','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','show','create','put','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8510,0xe0));var _0x0851=function(_0x26b3be,_0x71dc78){_0x26b3be=_0x26b3be-0x0;var _0x12379e=_0x8510[_0x26b3be];return _0x12379e;};'use strict';var multer=require(_0x0851('0x0'));var util=require(_0x0851('0x1'));var path=require('path');var timeout=require(_0x0851('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0851('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0851('0x4'));var config=require('../../config/environment');var controller=require(_0x0851('0x5'));router[_0x0851('0x6')]('/',auth[_0x0851('0x7')](),controller[_0x0851('0x8')]);router[_0x0851('0x6')](_0x0851('0x9'),auth['isAuthenticated'](),controller[_0x0851('0xa')]);router['post']('/',auth[_0x0851('0x7')](),controller[_0x0851('0xb')]);router[_0x0851('0xc')](_0x0851('0x9'),auth[_0x0851('0x7')](),controller['update']);router['delete']('/:id',auth[_0x0851('0x7')](),controller[_0x0851('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd87f=['put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','index','get','/:id','show','isAuthenticated','create'];(function(_0x4d31d8,_0x27d635){var _0x339e06=function(_0x36a646){while(--_0x36a646){_0x4d31d8['push'](_0x4d31d8['shift']());}};_0x339e06(++_0x27d635);}(_0xd87f,0x1b9));var _0xfd87=function(_0x337317,_0x416433){_0x337317=_0x337317-0x0;var _0x1c5d49=_0xd87f[_0x337317];return _0x1c5d49;};'use strict';var multer=require(_0xfd87('0x0'));var util=require('util');var path=require(_0xfd87('0x1'));var timeout=require(_0xfd87('0x2'));var express=require('express');var router=express[_0xfd87('0x3')]();var fs_extra=require(_0xfd87('0x4'));var auth=require(_0xfd87('0x5'));var interaction=require(_0xfd87('0x6'));var config=require(_0xfd87('0x7'));var controller=require(_0xfd87('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfd87('0x9')]);router[_0xfd87('0xa')](_0xfd87('0xb'),auth['isAuthenticated'](),controller[_0xfd87('0xc')]);router['post']('/',auth[_0xfd87('0xd')](),controller[_0xfd87('0xe')]);router[_0xfd87('0xf')](_0xfd87('0xb'),auth['isAuthenticated'](),controller[_0xfd87('0x10')]);router[_0xfd87('0x11')]('/:id',auth[_0xfd87('0xd')](),controller['destroy']);module[_0xfd87('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 282e813..e07fe10 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 _0x518c=['STRING','name'];(function(_0x2225c8,_0x549f9e){var _0x3beabd=function(_0x423f6a){while(--_0x423f6a){_0x2225c8['push'](_0x2225c8['shift']());}};_0x3beabd(++_0x549f9e);}(_0x518c,0xf8));var _0xc518=function(_0x5b97cb,_0x48c823){_0x5b97cb=_0x5b97cb-0x0;var _0xff66cf=_0x518c[_0x5b97cb];return _0xff66cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc518('0x0')],'unique':_0xc518('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xc518('0x0')]}}; \ No newline at end of file +var _0xc474=['sequelize','STRING','name'];(function(_0x92a14b,_0x39c324){var _0x3e955e=function(_0x5d0369){while(--_0x5d0369){_0x92a14b['push'](_0x92a14b['shift']());}};_0x3e955e(++_0x39c324);}(_0xc474,0xd5));var _0x4c47=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xc474[_0x39096d];return _0x13da4f;};'use strict';var Sequelize=require(_0x4c47('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c47('0x1')],'unique':_0x4c47('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4c47('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index cc24356..1ecb7af 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 _0xbdf2=['Pauses','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x5f3fa8,_0x1f9720){var _0x602a44=function(_0x36a0d3){while(--_0x36a0d3){_0x5f3fa8['push'](_0x5f3fa8['shift']());}};_0x602a44(++_0x1f9720);}(_0xbdf2,0x195));var _0x2bdf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbdf2[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x2bdf('0x0'));var rimraf=require(_0x2bdf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2bdf('0x2'));var rp=require('request-promise');var moment=require(_0x2bdf('0x3'));var BPromise=require(_0x2bdf('0x4'));var Mustache=require(_0x2bdf('0x5'));var util=require(_0x2bdf('0x6'));var path=require(_0x2bdf('0x7'));var sox=require(_0x2bdf('0x8'));var csv=require(_0x2bdf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bdf('0xa'));var squel=require(_0x2bdf('0xb'));var crypto=require(_0x2bdf('0xc'));var jsforce=require(_0x2bdf('0xd'));var deskjs=require(_0x2bdf('0xe'));var toCsv=require(_0x2bdf('0x9'));var querystring=require(_0x2bdf('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2bdf('0x10'));var qs=require(_0x2bdf('0x11'));var as=require(_0x2bdf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bdf('0x13'))('api');var utils=require(_0x2bdf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2bdf('0x15'));var db=require(_0x2bdf('0x16'))['db'];function respondWithStatusCode(_0x52839f,_0x42a5d1){_0x42a5d1=_0x42a5d1||0xcc;return function(_0x229ecd){if(_0x229ecd){return _0x52839f['sendStatus'](_0x42a5d1);}return _0x52839f[_0x2bdf('0x17')](_0x42a5d1)[_0x2bdf('0x18')]();};}function respondWithResult(_0x5cd479,_0x2267be){_0x2267be=_0x2267be||0xc8;return function(_0x5ec6c4){if(_0x5ec6c4){return _0x5cd479[_0x2bdf('0x17')](_0x2267be)[_0x2bdf('0x19')](_0x5ec6c4);}};}function respondWithFilteredResult(_0x14301f,_0x275970){return function(_0x702d0c){if(_0x702d0c){var _0x3420d7=typeof _0x275970[_0x2bdf('0x1a')]===_0x2bdf('0x1b')&&typeof _0x275970['limit']===_0x2bdf('0x1b');var _0x4ce1e3=_0x702d0c[_0x2bdf('0x1c')];var _0x5de411=_0x3420d7?0x0:_0x275970[_0x2bdf('0x1a')];var _0x49c6fd=_0x3420d7?_0x702d0c[_0x2bdf('0x1c')]:_0x275970[_0x2bdf('0x1a')]+_0x275970[_0x2bdf('0x1d')];var _0x78eece;if(_0x49c6fd>=_0x4ce1e3){_0x49c6fd=_0x4ce1e3;_0x78eece=0xc8;}else{_0x78eece=0xce;}_0x14301f[_0x2bdf('0x17')](_0x78eece);return _0x14301f[_0x2bdf('0x1e')](_0x2bdf('0x1f'),_0x5de411+'-'+_0x49c6fd+'/'+_0x4ce1e3)[_0x2bdf('0x19')](_0x702d0c);}return null;};}function patchUpdates(_0x493923){return function(_0x1c56fa){try{jsonpatch[_0x2bdf('0x20')](_0x1c56fa,_0x493923,!![]);}catch(_0x152ef6){return BPromise['reject'](_0x152ef6);}return _0x1c56fa['save']();};}function saveUpdates(_0x2632d2,_0x358965){return function(_0x378b3f){if(_0x378b3f){return _0x378b3f[_0x2bdf('0x21')](_0x2632d2)[_0x2bdf('0x22')](function(_0x234ce3){return _0x234ce3;});}return null;};}function removeEntity(_0x3613a7,_0x3d3e15){return function(_0xa06301){if(_0xa06301){return _0xa06301[_0x2bdf('0x23')]()[_0x2bdf('0x22')](function(){var _0x38327b=_0xa06301[_0x2bdf('0x24')]({'plain':!![]});var _0x290b8d='Pauses';return db[_0x2bdf('0x25')][_0x2bdf('0x23')]({'where':{'type':_0x290b8d,'resourceId':_0x38327b['id']}})[_0x2bdf('0x22')](function(){return _0xa06301;});})[_0x2bdf('0x22')](function(){_0x3613a7['status'](0xcc)[_0x2bdf('0x18')]();});}};}function handleEntityNotFound(_0x57a9a6,_0x159945){return function(_0x4973c3){if(!_0x4973c3){_0x57a9a6[_0x2bdf('0x26')](0x194);}return _0x4973c3;};}function handleError(_0x5ef061,_0x875e60){_0x875e60=_0x875e60||0x1f4;return function(_0x1e9c61){logger['error'](_0x1e9c61[_0x2bdf('0x27')]);if(_0x1e9c61[_0x2bdf('0x28')]){delete _0x1e9c61[_0x2bdf('0x28')];}_0x5ef061[_0x2bdf('0x17')](_0x875e60)[_0x2bdf('0x29')](_0x1e9c61);};}exports[_0x2bdf('0x2a')]=function(_0x3c9ad5,_0x471f14){var _0x38558a={},_0x40f73d={},_0x3b8e35={'count':0x0,'rows':[]};var _0x2216c9=_[_0x2bdf('0x2b')](db[_0x2bdf('0x2c')][_0x2bdf('0x2d')],function(_0x1a7ecd){return{'name':_0x1a7ecd[_0x2bdf('0x2e')],'type':_0x1a7ecd['type']['key']};});_0x40f73d['model']=_[_0x2bdf('0x2b')](_0x2216c9,_0x2bdf('0x28'));_0x40f73d[_0x2bdf('0x2f')]=_[_0x2bdf('0x30')](_0x3c9ad5['query']);_0x40f73d[_0x2bdf('0x31')]=_['intersection'](_0x40f73d[_0x2bdf('0x32')],_0x40f73d[_0x2bdf('0x2f')]);_0x38558a[_0x2bdf('0x33')]=_[_0x2bdf('0x34')](_0x40f73d['model'],qs['fields'](_0x3c9ad5[_0x2bdf('0x2f')][_0x2bdf('0x35')]));_0x38558a[_0x2bdf('0x33')]=_0x38558a[_0x2bdf('0x33')][_0x2bdf('0x36')]?_0x38558a[_0x2bdf('0x33')]:_0x40f73d['model'];if(!_0x3c9ad5[_0x2bdf('0x2f')][_0x2bdf('0x37')](_0x2bdf('0x38'))){_0x38558a[_0x2bdf('0x1d')]=qs[_0x2bdf('0x1d')](_0x3c9ad5[_0x2bdf('0x2f')][_0x2bdf('0x1d')]);_0x38558a['offset']=qs[_0x2bdf('0x1a')](_0x3c9ad5['query'][_0x2bdf('0x1a')]);}_0x38558a['order']=qs[_0x2bdf('0x39')](_0x3c9ad5[_0x2bdf('0x2f')][_0x2bdf('0x39')]);_0x38558a['where']=qs['filters'](_['pick'](_0x3c9ad5[_0x2bdf('0x2f')],_0x40f73d[_0x2bdf('0x31')]),_0x2216c9);if(_0x3c9ad5[_0x2bdf('0x2f')]['filter']){_0x38558a[_0x2bdf('0x3a')]=_['merge'](_0x38558a[_0x2bdf('0x3a')],{'$or':_['map'](_0x2216c9,function(_0x1cc42a){if(_0x1cc42a['type']!==_0x2bdf('0x3b')){var _0x535627={};_0x535627[_0x1cc42a[_0x2bdf('0x28')]]={'$like':'%'+_0x3c9ad5['query'][_0x2bdf('0x3c')]+'%'};return _0x535627;}})});}_0x38558a=_['merge']({},_0x38558a,_0x3c9ad5[_0x2bdf('0x3d')]);var _0x59f705={'where':_0x38558a[_0x2bdf('0x3a')]};return db[_0x2bdf('0x2c')]['count'](_0x59f705)[_0x2bdf('0x22')](function(_0x3ac26e){_0x3b8e35[_0x2bdf('0x1c')]=_0x3ac26e;if(_0x3c9ad5[_0x2bdf('0x2f')][_0x2bdf('0x3e')]){_0x38558a[_0x2bdf('0x3f')]=[{'all':!![]}];}return db[_0x2bdf('0x2c')][_0x2bdf('0x40')](_0x38558a);})[_0x2bdf('0x22')](function(_0x4cc3d9){_0x3b8e35[_0x2bdf('0x41')]=_0x4cc3d9;return _0x3b8e35;})[_0x2bdf('0x22')](respondWithFilteredResult(_0x471f14,_0x38558a))[_0x2bdf('0x42')](handleError(_0x471f14,null));};exports[_0x2bdf('0x43')]=function(_0x55f119,_0x3a1930){var _0x1a5d33={'raw':!![],'where':{'id':_0x55f119[_0x2bdf('0x44')]['id']}},_0x27c9c1={};_0x27c9c1[_0x2bdf('0x32')]=_[_0x2bdf('0x30')](db[_0x2bdf('0x2c')][_0x2bdf('0x2d')]);_0x27c9c1[_0x2bdf('0x2f')]=_[_0x2bdf('0x30')](_0x55f119[_0x2bdf('0x2f')]);_0x27c9c1['filters']=_[_0x2bdf('0x34')](_0x27c9c1[_0x2bdf('0x32')],_0x27c9c1[_0x2bdf('0x2f')]);_0x1a5d33[_0x2bdf('0x33')]=_[_0x2bdf('0x34')](_0x27c9c1[_0x2bdf('0x32')],qs['fields'](_0x55f119[_0x2bdf('0x2f')][_0x2bdf('0x35')]));_0x1a5d33[_0x2bdf('0x33')]=_0x1a5d33[_0x2bdf('0x33')][_0x2bdf('0x36')]?_0x1a5d33[_0x2bdf('0x33')]:_0x27c9c1['model'];if(_0x55f119[_0x2bdf('0x2f')][_0x2bdf('0x3e')]){_0x1a5d33[_0x2bdf('0x3f')]=[{'all':!![]}];}_0x1a5d33=_[_0x2bdf('0x45')]({},_0x1a5d33,_0x55f119[_0x2bdf('0x3d')]);return db['Pause']['find'](_0x1a5d33)['then'](handleEntityNotFound(_0x3a1930,null))[_0x2bdf('0x22')](respondWithResult(_0x3a1930,null))['catch'](handleError(_0x3a1930,null));};exports[_0x2bdf('0x46')]=function(_0x2b5ca7,_0x5061c8){return db['Pause']['create'](_0x2b5ca7[_0x2bdf('0x47')],{})[_0x2bdf('0x22')](function(_0x2b5d4f){var _0x2368e0=_0x2b5ca7[_0x2bdf('0x48')][_0x2bdf('0x24')]({'plain':!![]});if(!_0x2368e0)throw new Error(_0x2bdf('0x49'));if(_0x2368e0[_0x2bdf('0x4a')]===_0x2bdf('0x48')){var _0x3b4059=_0x2b5d4f['get']({'plain':!![]});var _0x3eb62a=_0x2bdf('0x4b');return db[_0x2bdf('0x4c')][_0x2bdf('0x4d')]({'where':{'name':_0x3eb62a,'userProfileId':_0x2368e0[_0x2bdf('0x4e')]},'raw':!![]})[_0x2bdf('0x22')](function(_0x15e20){if(_0x15e20&&_0x15e20[_0x2bdf('0x4f')]===0x0){return db[_0x2bdf('0x25')][_0x2bdf('0x46')]({'name':_0x3b4059[_0x2bdf('0x28')],'resourceId':_0x3b4059['id'],'type':_0x15e20['name'],'sectionId':_0x15e20['id']},{})['then'](function(){return _0x2b5d4f;});}else{return _0x2b5d4f;}})[_0x2bdf('0x42')](function(_0x21819e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21819e);throw _0x21819e;});}return _0x2b5d4f;})[_0x2bdf('0x22')](respondWithResult(_0x5061c8,0xc9))[_0x2bdf('0x42')](handleError(_0x5061c8,null));};exports[_0x2bdf('0x21')]=function(_0x593197,_0x2e5ff6){if(_0x593197[_0x2bdf('0x47')]['id']){delete _0x593197['body']['id'];}return db['Pause'][_0x2bdf('0x4d')]({'where':{'id':_0x593197['params']['id']}})[_0x2bdf('0x22')](handleEntityNotFound(_0x2e5ff6,null))['then'](saveUpdates(_0x593197[_0x2bdf('0x47')],null))[_0x2bdf('0x22')](respondWithResult(_0x2e5ff6,null))[_0x2bdf('0x42')](handleError(_0x2e5ff6,null));};exports[_0x2bdf('0x23')]=function(_0x18446b,_0x5aca5b){return db[_0x2bdf('0x2c')][_0x2bdf('0x4d')]({'where':{'id':_0x18446b[_0x2bdf('0x44')]['id']}})[_0x2bdf('0x22')](handleEntityNotFound(_0x5aca5b,null))['then'](removeEntity(_0x5aca5b,null))[_0x2bdf('0x42')](handleError(_0x5aca5b,null));}; \ No newline at end of file +var _0x433b=['name','index','Pause','rawAttributes','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','update','destroy','Pauses','UserProfileResource','then','error','stack'];(function(_0x4cd31f,_0x326b8c){var _0x1fe932=function(_0x15f51a){while(--_0x15f51a){_0x4cd31f['push'](_0x4cd31f['shift']());}};_0x1fe932(++_0x326b8c);}(_0x433b,0x16c));var _0xb433=function(_0x1bf8cc,_0x118778){_0x1bf8cc=_0x1bf8cc-0x0;var _0x322d20=_0x433b[_0x1bf8cc];return _0x322d20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb433('0x0'));var zipdir=require(_0xb433('0x1'));var jsonpatch=require(_0xb433('0x2'));var rp=require(_0xb433('0x3'));var moment=require(_0xb433('0x4'));var BPromise=require(_0xb433('0x5'));var Mustache=require(_0xb433('0x6'));var util=require(_0xb433('0x7'));var path=require('path');var sox=require(_0xb433('0x8'));var csv=require(_0xb433('0x9'));var ejs=require(_0xb433('0xa'));var fs=require('fs');var fs_extra=require(_0xb433('0xb'));var _=require('lodash');var squel=require(_0xb433('0xc'));var crypto=require(_0xb433('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb433('0x9'));var querystring=require(_0xb433('0xe'));var Papa=require(_0xb433('0xf'));var Redis=require(_0xb433('0x10'));var authService=require(_0xb433('0x11'));var qs=require(_0xb433('0x12'));var as=require(_0xb433('0x13'));var hardwareService=require(_0xb433('0x14'));var logger=require('../../config/logger')(_0xb433('0x15'));var utils=require(_0xb433('0x16'));var config=require(_0xb433('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb433('0x18'))['db'];function respondWithStatusCode(_0x20651e,_0x2a3c8f){_0x2a3c8f=_0x2a3c8f||0xcc;return function(_0x23d43e){if(_0x23d43e){return _0x20651e[_0xb433('0x19')](_0x2a3c8f);}return _0x20651e['status'](_0x2a3c8f)[_0xb433('0x1a')]();};}function respondWithResult(_0x10b905,_0x7ab24a){_0x7ab24a=_0x7ab24a||0xc8;return function(_0x398b94){if(_0x398b94){return _0x10b905[_0xb433('0x1b')](_0x7ab24a)[_0xb433('0x1c')](_0x398b94);}};}function respondWithFilteredResult(_0x10966a,_0x109a26){return function(_0x504b87){if(_0x504b87){var _0x547be3=typeof _0x109a26[_0xb433('0x1d')]===_0xb433('0x1e')&&typeof _0x109a26[_0xb433('0x1f')]==='undefined';var _0xf78953=_0x504b87[_0xb433('0x20')];var _0x42fe11=_0x547be3?0x0:_0x109a26[_0xb433('0x1d')];var _0x47515a=_0x547be3?_0x504b87['count']:_0x109a26[_0xb433('0x1d')]+_0x109a26['limit'];var _0x5bb0e5;if(_0x47515a>=_0xf78953){_0x47515a=_0xf78953;_0x5bb0e5=0xc8;}else{_0x5bb0e5=0xce;}_0x10966a[_0xb433('0x1b')](_0x5bb0e5);return _0x10966a['set']('Content-Range',_0x42fe11+'-'+_0x47515a+'/'+_0xf78953)[_0xb433('0x1c')](_0x504b87);}return null;};}function patchUpdates(_0x2669ec){return function(_0x516c48){try{jsonpatch[_0xb433('0x21')](_0x516c48,_0x2669ec,!![]);}catch(_0x4285f6){return BPromise['reject'](_0x4285f6);}return _0x516c48['save']();};}function saveUpdates(_0x347171,_0x29b9cb){return function(_0x45cfe0){if(_0x45cfe0){return _0x45cfe0[_0xb433('0x22')](_0x347171)['then'](function(_0x24f9cb){return _0x24f9cb;});}return null;};}function removeEntity(_0x314fc6,_0x16d67a){return function(_0x418902){if(_0x418902){return _0x418902[_0xb433('0x23')]()['then'](function(){var _0x23d70c=_0x418902['get']({'plain':!![]});var _0xb80b86=_0xb433('0x24');return db[_0xb433('0x25')]['destroy']({'where':{'type':_0xb80b86,'resourceId':_0x23d70c['id']}})['then'](function(){return _0x418902;});})[_0xb433('0x26')](function(){_0x314fc6[_0xb433('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4365ee,_0x28fdda){return function(_0x5ddc07){if(!_0x5ddc07){_0x4365ee[_0xb433('0x19')](0x194);}return _0x5ddc07;};}function handleError(_0x506179,_0x12022f){_0x12022f=_0x12022f||0x1f4;return function(_0x4cb3a4){logger[_0xb433('0x27')](_0x4cb3a4[_0xb433('0x28')]);if(_0x4cb3a4[_0xb433('0x29')]){delete _0x4cb3a4[_0xb433('0x29')];}_0x506179[_0xb433('0x1b')](_0x12022f)['send'](_0x4cb3a4);};}exports[_0xb433('0x2a')]=function(_0x1417b5,_0x1fc7db){var _0x519153={},_0x377425={},_0x445ac1={'count':0x0,'rows':[]};var _0x1ed1ca=_['map'](db[_0xb433('0x2b')][_0xb433('0x2c')],function(_0xa0eed6){return{'name':_0xa0eed6['fieldName'],'type':_0xa0eed6[_0xb433('0x2d')][_0xb433('0x2e')]};});_0x377425['model']=_[_0xb433('0x2f')](_0x1ed1ca,_0xb433('0x29'));_0x377425[_0xb433('0x30')]=_[_0xb433('0x31')](_0x1417b5['query']);_0x377425['filters']=_[_0xb433('0x32')](_0x377425[_0xb433('0x33')],_0x377425[_0xb433('0x30')]);_0x519153['attributes']=_[_0xb433('0x32')](_0x377425[_0xb433('0x33')],qs[_0xb433('0x34')](_0x1417b5[_0xb433('0x30')][_0xb433('0x34')]));_0x519153[_0xb433('0x35')]=_0x519153[_0xb433('0x35')][_0xb433('0x36')]?_0x519153['attributes']:_0x377425[_0xb433('0x33')];if(!_0x1417b5['query'][_0xb433('0x37')](_0xb433('0x38'))){_0x519153['limit']=qs['limit'](_0x1417b5[_0xb433('0x30')][_0xb433('0x1f')]);_0x519153[_0xb433('0x1d')]=qs[_0xb433('0x1d')](_0x1417b5[_0xb433('0x30')][_0xb433('0x1d')]);}_0x519153[_0xb433('0x39')]=qs[_0xb433('0x3a')](_0x1417b5[_0xb433('0x30')][_0xb433('0x3a')]);_0x519153['where']=qs[_0xb433('0x3b')](_[_0xb433('0x3c')](_0x1417b5[_0xb433('0x30')],_0x377425[_0xb433('0x3b')]),_0x1ed1ca);if(_0x1417b5['query'][_0xb433('0x3d')]){_0x519153[_0xb433('0x3e')]=_['merge'](_0x519153['where'],{'$or':_[_0xb433('0x2f')](_0x1ed1ca,function(_0x2e00a3){if(_0x2e00a3[_0xb433('0x2d')]!==_0xb433('0x3f')){var _0x43f78d={};_0x43f78d[_0x2e00a3['name']]={'$like':'%'+_0x1417b5[_0xb433('0x30')]['filter']+'%'};return _0x43f78d;}})});}_0x519153=_[_0xb433('0x40')]({},_0x519153,_0x1417b5['options']);var _0x598799={'where':_0x519153[_0xb433('0x3e')]};return db[_0xb433('0x2b')][_0xb433('0x20')](_0x598799)[_0xb433('0x26')](function(_0x3ac827){_0x445ac1['count']=_0x3ac827;if(_0x1417b5['query'][_0xb433('0x41')]){_0x519153[_0xb433('0x42')]=[{'all':!![]}];}return db['Pause'][_0xb433('0x43')](_0x519153);})['then'](function(_0x4f3e42){_0x445ac1[_0xb433('0x44')]=_0x4f3e42;return _0x445ac1;})[_0xb433('0x26')](respondWithFilteredResult(_0x1fc7db,_0x519153))[_0xb433('0x45')](handleError(_0x1fc7db,null));};exports[_0xb433('0x46')]=function(_0x3e26b2,_0x36dc8c){var _0x336348={'raw':!![],'where':{'id':_0x3e26b2[_0xb433('0x47')]['id']}},_0x4f8758={};_0x4f8758['model']=_[_0xb433('0x31')](db[_0xb433('0x2b')][_0xb433('0x2c')]);_0x4f8758['query']=_[_0xb433('0x31')](_0x3e26b2[_0xb433('0x30')]);_0x4f8758['filters']=_[_0xb433('0x32')](_0x4f8758[_0xb433('0x33')],_0x4f8758['query']);_0x336348[_0xb433('0x35')]=_[_0xb433('0x32')](_0x4f8758[_0xb433('0x33')],qs[_0xb433('0x34')](_0x3e26b2[_0xb433('0x30')][_0xb433('0x34')]));_0x336348[_0xb433('0x35')]=_0x336348[_0xb433('0x35')][_0xb433('0x36')]?_0x336348[_0xb433('0x35')]:_0x4f8758[_0xb433('0x33')];if(_0x3e26b2[_0xb433('0x30')][_0xb433('0x41')]){_0x336348[_0xb433('0x42')]=[{'all':!![]}];}_0x336348=_[_0xb433('0x40')]({},_0x336348,_0x3e26b2[_0xb433('0x48')]);return db[_0xb433('0x2b')][_0xb433('0x49')](_0x336348)[_0xb433('0x26')](handleEntityNotFound(_0x36dc8c,null))[_0xb433('0x26')](respondWithResult(_0x36dc8c,null))[_0xb433('0x45')](handleError(_0x36dc8c,null));};exports[_0xb433('0x4a')]=function(_0xed61a6,_0x178846){return db[_0xb433('0x2b')]['create'](_0xed61a6[_0xb433('0x4b')],{})['then'](function(_0x589c08){var _0x5958f1=_0xed61a6['user'][_0xb433('0x4c')]({'plain':!![]});if(!_0x5958f1)throw new Error(_0xb433('0x4d'));if(_0x5958f1[_0xb433('0x4e')]==='user'){var _0x50214f=_0x589c08[_0xb433('0x4c')]({'plain':!![]});var _0x4a5a53='Pauses';return db[_0xb433('0x4f')][_0xb433('0x49')]({'where':{'name':_0x4a5a53,'userProfileId':_0x5958f1[_0xb433('0x50')]},'raw':!![]})[_0xb433('0x26')](function(_0x3440aa){if(_0x3440aa&&_0x3440aa['autoAssociation']===0x0){return db[_0xb433('0x25')][_0xb433('0x4a')]({'name':_0x50214f[_0xb433('0x29')],'resourceId':_0x50214f['id'],'type':_0x3440aa[_0xb433('0x29')],'sectionId':_0x3440aa['id']},{})[_0xb433('0x26')](function(){return _0x589c08;});}else{return _0x589c08;}})[_0xb433('0x45')](function(_0x7896f){logger[_0xb433('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7896f);throw _0x7896f;});}return _0x589c08;})[_0xb433('0x26')](respondWithResult(_0x178846,0xc9))[_0xb433('0x45')](handleError(_0x178846,null));};exports['update']=function(_0xa6b585,_0x5385f9){if(_0xa6b585['body']['id']){delete _0xa6b585[_0xb433('0x4b')]['id'];}return db[_0xb433('0x2b')][_0xb433('0x49')]({'where':{'id':_0xa6b585[_0xb433('0x47')]['id']}})['then'](handleEntityNotFound(_0x5385f9,null))[_0xb433('0x26')](saveUpdates(_0xa6b585[_0xb433('0x4b')],null))[_0xb433('0x26')](respondWithResult(_0x5385f9,null))[_0xb433('0x45')](handleError(_0x5385f9,null));};exports[_0xb433('0x23')]=function(_0x4c9445,_0x2b3926){return db['Pause'][_0xb433('0x49')]({'where':{'id':_0x4c9445[_0xb433('0x47')]['id']}})[_0xb433('0x26')](handleEntityNotFound(_0x2b3926,null))[_0xb433('0x26')](removeEntity(_0x2b3926,null))[_0xb433('0x45')](handleError(_0x2b3926,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 1925098..4b103ee 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x63dce,_0x3c42dc){var _0x4094a9=function(_0x3d4266){while(--_0x3d4266){_0x63dce['push'](_0x63dce['shift']());}};_0x4094a9(++_0x3c42dc);}(_0x1cb9,0x14e));var _0x91cb=function(_0x162198,_0x1dfd30){_0x162198=_0x162198-0x0;var _0x1ed945=_0x1cb9[_0x162198];return _0x1ed945;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x57b77f,_0xa15fd6){var _0x10c04a=function(_0x16fe61){while(--_0x16fe61){_0x57b77f['push'](_0x57b77f['shift']());}};_0x10c04a(++_0xa15fd6);}(_0x326f,0xd1));var _0xf326=function(_0x479b6a,_0x5ec09d){_0x479b6a=_0x479b6a-0x0;var _0x170c95=_0x326f[_0x479b6a];return _0x170c95;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 8128fae..98a2c73 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1ac340,_0x43a8d8){var _0x160415=function(_0x281208){while(--_0x281208){_0x1ac340['push'](_0x1ac340['shift']());}};_0x160415(++_0x43a8d8);}(_0x7a54,0x106));var _0x47a5=function(_0xae606c,_0x458140){_0xae606c=_0xae606c-0x0;var _0x50104a=_0x7a54[_0xae606c];return _0x50104a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4f192e,_0x4d1756){var _0x49294d=function(_0x580ab3){while(--_0x580ab3){_0x4f192e['push'](_0x4f192e['shift']());}};_0x49294d(++_0x4d1756);}(_0x7a54,0x106));var _0x47a5=function(_0xc8bb19,_0x20ebd9){_0xc8bb19=_0xc8bb19-0x0;var _0x330c80=_0x7a54[_0xc8bb19];return _0x330c80;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 5b9976f..fbacb1a 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 _0xd2ea=['./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','diskStorage','root','server/files/plugins','originalname','replace','extname','now','post','single','file','upload','webhookPost','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1c68d9,_0x1591f1){_0x1c68d9=_0x1c68d9-0x0;var _0x5a47f8=_0xd2ea[_0x1c68d9];return _0x5a47f8;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),controller[_0xad2e('0xd')]);router['get'](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['show']);router[_0xad2e('0xa')]('/:id/download',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);var upload=multer({'storage':multer[_0xad2e('0x10')]({'destination':function(_0x24c5da,_0x489f25,_0x7df3c6){_0x7df3c6(null,path['join'](config[_0xad2e('0x11')],_0xad2e('0x12')));},'filename':function(_0x433696,_0x42e2f2,_0x59a342){_0x42e2f2[_0xad2e('0x13')]=_0x42e2f2['originalname'][_0xad2e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59a342(null,util['format']('%s-%s%s',path['basename'](_0x42e2f2['originalname'],path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])),Date[_0xad2e('0x16')](),path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])));}})});router[_0xad2e('0x17')]('/',upload[_0xad2e('0x18')](_0xad2e('0x19')),controller[_0xad2e('0x1a')]);router[_0xad2e('0x17')](_0xad2e('0xc'),controller[_0xad2e('0x1b')]);router[_0xad2e('0x1c')](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['update']);router[_0xad2e('0x1d')](_0xad2e('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0xcb99=['originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download','diskStorage','join'];(function(_0x3d9a4a,_0x49cb5f){var _0x5c4b88=function(_0x3555e9){while(--_0x3555e9){_0x3d9a4a['push'](_0x3d9a4a['shift']());}};_0x5c4b88(++_0x49cb5f);}(_0xcb99,0x8b));var _0x9cb9=function(_0x57abf7,_0x11bb02){_0x57abf7=_0x57abf7-0x0;var _0x1c7779=_0xcb99[_0x57abf7];return _0x1c7779;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router[_0x9cb9('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);var upload=multer({'storage':multer[_0x9cb9('0xe')]({'destination':function(_0x1b4fa6,_0x5a0ac7,_0x3be02c){_0x3be02c(null,path[_0x9cb9('0xf')](config['root'],'server/files/plugins'));},'filename':function(_0x227d49,_0x2e687e,_0x3382c8){_0x2e687e[_0x9cb9('0x10')]=_0x2e687e['originalname'][_0x9cb9('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3382c8(null,util[_0x9cb9('0x12')](_0x9cb9('0x13'),path[_0x9cb9('0x14')](_0x2e687e[_0x9cb9('0x10')],path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])),Date[_0x9cb9('0x16')](),path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])));}})});router[_0x9cb9('0x17')]('/',upload[_0x9cb9('0x18')](_0x9cb9('0x19')),controller[_0x9cb9('0x1a')]);router[_0x9cb9('0x17')](_0x9cb9('0x9'),controller[_0x9cb9('0x1b')]);router[_0x9cb9('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1d')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1e')]);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 64e22cb..28d2a88 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 _0x66fb=['adminOnly','agentOnly','always','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x338a80,_0xc07b37){var _0x1885b9=function(_0x2a5c36){while(--_0x2a5c36){_0x338a80['push'](_0x338a80['shift']());}};_0x1885b9(++_0xc07b37);}(_0x66fb,0xc1));var _0xb66f=function(_0x24546b,_0x5e1726){_0x24546b=_0x24546b-0x0;var _0x3f90f4=_0x66fb[_0x24546b];return _0x3f90f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb66f('0x0')]},'type':{'type':Sequelize[_0xb66f('0x1')](_0xb66f('0x2'),_0xb66f('0x3'))},'description':{'type':Sequelize[_0xb66f('0x4')]},'version':{'type':Sequelize[_0xb66f('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0xb66f('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb66f('0x6')},'sidebar':{'type':Sequelize[_0xb66f('0x1')](_0xb66f('0x7'),_0xb66f('0x8'),_0xb66f('0x9'),'never'),'defaultValue':_0xb66f('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xb66f('0x0')]},'adminUrl':{'type':Sequelize[_0xb66f('0x0')]},'agentUrl':{'type':Sequelize[_0xb66f('0x0')]},'scriptName':{'type':Sequelize[_0xb66f('0x0')]},'scriptPath':{'type':Sequelize[_0xb66f('0x0')]}}; \ No newline at end of file +var _0x9995=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x2ef84a,_0x3515c5){var _0x2e871e=function(_0x30f2f9){while(--_0x30f2f9){_0x2ef84a['push'](_0x2ef84a['shift']());}};_0x2e871e(++_0x3515c5);}(_0x9995,0x9d));var _0x5999=function(_0x4aa5e4,_0x56f9b9){_0x4aa5e4=_0x4aa5e4-0x0;var _0x333336=_0x9995[_0x4aa5e4];return _0x333336;};'use strict';var Sequelize=require(_0x5999('0x0'));module[_0x5999('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5999('0x2')]('html',_0x5999('0x3'))},'description':{'type':Sequelize[_0x5999('0x4')]},'version':{'type':Sequelize[_0x5999('0x4')]},'path':{'type':Sequelize[_0x5999('0x5')],'comment':_0x5999('0x6')},'active':{'type':Sequelize[_0x5999('0x7')],'defaultValue':0x0,'comment':_0x5999('0x8')},'sidebar':{'type':Sequelize[_0x5999('0x2')](_0x5999('0x9'),_0x5999('0xa'),_0x5999('0xb'),_0x5999('0xc')),'defaultValue':_0x5999('0xb'),'comment':_0x5999('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x5999('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x5999('0x5')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 3de9812..615117a 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 _0x8b5e=['warning','code','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','length','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','scriptPath','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','headers','content-length','content-type','set','endsWith','statusCode','http://localhost:','%s%s','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','Plugins','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','Plugin','include','findAll','rows','catch','show','params','includeAll','options','find','download','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip'];(function(_0xad0e37,_0x34d6fc){var _0x29dba=function(_0x5ac236){while(--_0x5ac236){_0xad0e37['push'](_0xad0e37['shift']());}};_0x29dba(++_0x34d6fc);}(_0x8b5e,0x103));var _0xe8b5=function(_0x279064,_0x31f618){_0x279064=_0x279064-0x0;var _0x145c1f=_0x8b5e[_0x279064];return _0x145c1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe8b5('0x0'));var zipdir=require(_0xe8b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8b5('0x2'));var moment=require('moment');var BPromise=require(_0xe8b5('0x3'));var Mustache=require(_0xe8b5('0x4'));var util=require(_0xe8b5('0x5'));var path=require(_0xe8b5('0x6'));var sox=require(_0xe8b5('0x7'));var csv=require('to-csv');var ejs=require(_0xe8b5('0x8'));var fs=require('fs');var fs_extra=require(_0xe8b5('0x9'));var _=require(_0xe8b5('0xa'));var squel=require(_0xe8b5('0xb'));var crypto=require(_0xe8b5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe8b5('0xd'));var toCsv=require(_0xe8b5('0xe'));var querystring=require(_0xe8b5('0xf'));var Papa=require(_0xe8b5('0x10'));var extract=require(_0xe8b5('0x11'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0xe8b5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe8b5('0x13'));var as=require(_0xe8b5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8b5('0x15'))('api');var utils=require(_0xe8b5('0x16'));var config=require(_0xe8b5('0x17'));var licenseUtil=require(_0xe8b5('0x18'));var db=require(_0xe8b5('0x19'))['db'];config['redis']=_[_0xe8b5('0x1a')](config[_0xe8b5('0x1b')],{'host':_0xe8b5('0x1c'),'port':0x18eb});var socket=require(_0xe8b5('0x1d'))(new Redis(config[_0xe8b5('0x1b')]));require('./plugin.socket')[_0xe8b5('0x1e')](socket);function respondWithStatusCode(_0x725bcc,_0x1a02c6){_0x1a02c6=_0x1a02c6||0xcc;return function(_0x4b76f0){if(_0x4b76f0){return _0x725bcc[_0xe8b5('0x1f')](_0x1a02c6);}return _0x725bcc[_0xe8b5('0x20')](_0x1a02c6)[_0xe8b5('0x21')]();};}function respondWithResult(_0x14b645,_0x2edf28){_0x2edf28=_0x2edf28||0xc8;return function(_0x1ec09e){if(_0x1ec09e){return _0x14b645[_0xe8b5('0x20')](_0x2edf28)[_0xe8b5('0x22')](_0x1ec09e);}};}function respondWithFilteredResult(_0x595153,_0x45a582){return function(_0x23bc7d){if(_0x23bc7d){var _0x4a099e=typeof _0x45a582[_0xe8b5('0x23')]===_0xe8b5('0x24')&&typeof _0x45a582[_0xe8b5('0x25')]===_0xe8b5('0x24');var _0x53195b=_0x23bc7d[_0xe8b5('0x26')];var _0x3a5603=_0x4a099e?0x0:_0x45a582['offset'];var _0x371a98=_0x4a099e?_0x23bc7d[_0xe8b5('0x26')]:_0x45a582[_0xe8b5('0x23')]+_0x45a582[_0xe8b5('0x25')];var _0x1ce87b;if(_0x371a98>=_0x53195b){_0x371a98=_0x53195b;_0x1ce87b=0xc8;}else{_0x1ce87b=0xce;}_0x595153[_0xe8b5('0x20')](_0x1ce87b);return _0x595153['set']('Content-Range',_0x3a5603+'-'+_0x371a98+'/'+_0x53195b)[_0xe8b5('0x22')](_0x23bc7d);}return null;};}function patchUpdates(_0x2470e5){return function(_0x3fd6d9){try{jsonpatch[_0xe8b5('0x27')](_0x3fd6d9,_0x2470e5,!![]);}catch(_0x3d7532){return BPromise[_0xe8b5('0x28')](_0x3d7532);}return _0x3fd6d9['save']();};}function saveUpdates(_0x57ab52,_0x3db19e){return function(_0x4093df){if(_0x4093df){return _0x4093df[_0xe8b5('0x29')](_0x57ab52)[_0xe8b5('0x2a')](function(_0x16409e){return _0x16409e;});}return null;};}function removeEntity(_0x1ce6cc,_0x470f49){return function(_0x3a1a1b){if(_0x3a1a1b){return _0x3a1a1b[_0xe8b5('0x2b')]()[_0xe8b5('0x2a')](function(){var _0x1e394a=_0x3a1a1b['get']({'plain':!![]});var _0x46a8e8=_0xe8b5('0x2c');return db[_0xe8b5('0x2d')]['destroy']({'where':{'type':_0x46a8e8,'resourceId':_0x1e394a['id']}})[_0xe8b5('0x2a')](function(){return _0x3a1a1b;});})[_0xe8b5('0x2a')](function(){_0x1ce6cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c480b,_0x5d999d){return function(_0x201127){if(!_0x201127){_0x3c480b['sendStatus'](0x194);}return _0x201127;};}function handleError(_0xa10380,_0x263c8f){_0x263c8f=_0x263c8f||0x1f4;return function(_0x57da85){logger[_0xe8b5('0x2e')](_0x57da85[_0xe8b5('0x2f')]);if(_0x57da85[_0xe8b5('0x30')]){delete _0x57da85[_0xe8b5('0x30')];}_0xa10380[_0xe8b5('0x20')](_0x263c8f)[_0xe8b5('0x31')](_0x57da85);};}exports[_0xe8b5('0x32')]=function(_0x1c2e5f,_0xf52238){var _0x147f47={},_0x458c1a={},_0x185baf={'count':0x0,'rows':[]};var _0x5b8bcd=_[_0xe8b5('0x33')](db['Plugin'][_0xe8b5('0x34')],function(_0x3aa5a6){return{'name':_0x3aa5a6[_0xe8b5('0x35')],'type':_0x3aa5a6[_0xe8b5('0x36')][_0xe8b5('0x37')]};});_0x458c1a[_0xe8b5('0x38')]=_['map'](_0x5b8bcd,_0xe8b5('0x30'));_0x458c1a[_0xe8b5('0x39')]=_[_0xe8b5('0x3a')](_0x1c2e5f[_0xe8b5('0x39')]);_0x458c1a[_0xe8b5('0x3b')]=_[_0xe8b5('0x3c')](_0x458c1a[_0xe8b5('0x38')],_0x458c1a[_0xe8b5('0x39')]);_0x147f47['attributes']=_[_0xe8b5('0x3c')](_0x458c1a[_0xe8b5('0x38')],qs[_0xe8b5('0x3d')](_0x1c2e5f[_0xe8b5('0x39')]['fields']));_0x147f47[_0xe8b5('0x3e')]=_0x147f47['attributes']['length']?_0x147f47[_0xe8b5('0x3e')]:_0x458c1a['model'];if(!_0x1c2e5f[_0xe8b5('0x39')][_0xe8b5('0x3f')](_0xe8b5('0x40'))){_0x147f47[_0xe8b5('0x25')]=qs[_0xe8b5('0x25')](_0x1c2e5f[_0xe8b5('0x39')][_0xe8b5('0x25')]);_0x147f47['offset']=qs[_0xe8b5('0x23')](_0x1c2e5f[_0xe8b5('0x39')][_0xe8b5('0x23')]);}_0x147f47['order']=qs['sort'](_0x1c2e5f[_0xe8b5('0x39')][_0xe8b5('0x41')]);_0x147f47[_0xe8b5('0x42')]=qs[_0xe8b5('0x3b')](_[_0xe8b5('0x43')](_0x1c2e5f[_0xe8b5('0x39')],_0x458c1a[_0xe8b5('0x3b')]),_0x5b8bcd);if(_0x1c2e5f[_0xe8b5('0x39')]['filter']){_0x147f47[_0xe8b5('0x42')]=_[_0xe8b5('0x44')](_0x147f47[_0xe8b5('0x42')],{'$or':_[_0xe8b5('0x33')](_0x5b8bcd,function(_0x30cecc){if(_0x30cecc[_0xe8b5('0x36')]!==_0xe8b5('0x45')){var _0x23bd25={};_0x23bd25[_0x30cecc[_0xe8b5('0x30')]]={'$like':'%'+_0x1c2e5f['query'][_0xe8b5('0x46')]+'%'};return _0x23bd25;}})});}_0x147f47=_['merge']({},_0x147f47,_0x1c2e5f['options']);var _0xe33174={'where':_0x147f47[_0xe8b5('0x42')]};return db[_0xe8b5('0x47')][_0xe8b5('0x26')](_0xe33174)[_0xe8b5('0x2a')](function(_0x2b427e){_0x185baf[_0xe8b5('0x26')]=_0x2b427e;if(_0x1c2e5f[_0xe8b5('0x39')]['includeAll']){_0x147f47[_0xe8b5('0x48')]=[{'all':!![]}];}return db['Plugin'][_0xe8b5('0x49')](_0x147f47);})[_0xe8b5('0x2a')](function(_0x3ce050){_0x185baf[_0xe8b5('0x4a')]=_0x3ce050;return _0x185baf;})[_0xe8b5('0x2a')](respondWithFilteredResult(_0xf52238,_0x147f47))[_0xe8b5('0x4b')](handleError(_0xf52238,null));};exports[_0xe8b5('0x4c')]=function(_0x2a4ecf,_0x287043){var _0x55f65f={'raw':!![],'where':{'id':_0x2a4ecf[_0xe8b5('0x4d')]['id']}},_0x28ab31={};_0x28ab31[_0xe8b5('0x38')]=_[_0xe8b5('0x3a')](db[_0xe8b5('0x47')]['rawAttributes']);_0x28ab31[_0xe8b5('0x39')]=_[_0xe8b5('0x3a')](_0x2a4ecf[_0xe8b5('0x39')]);_0x28ab31[_0xe8b5('0x3b')]=_['intersection'](_0x28ab31[_0xe8b5('0x38')],_0x28ab31['query']);_0x55f65f[_0xe8b5('0x3e')]=_[_0xe8b5('0x3c')](_0x28ab31[_0xe8b5('0x38')],qs[_0xe8b5('0x3d')](_0x2a4ecf[_0xe8b5('0x39')][_0xe8b5('0x3d')]));_0x55f65f[_0xe8b5('0x3e')]=_0x55f65f[_0xe8b5('0x3e')]['length']?_0x55f65f[_0xe8b5('0x3e')]:_0x28ab31[_0xe8b5('0x38')];if(_0x2a4ecf[_0xe8b5('0x39')][_0xe8b5('0x4e')]){_0x55f65f[_0xe8b5('0x48')]=[{'all':!![]}];}_0x55f65f=_['merge']({},_0x55f65f,_0x2a4ecf[_0xe8b5('0x4f')]);return db['Plugin'][_0xe8b5('0x50')](_0x55f65f)[_0xe8b5('0x2a')](handleEntityNotFound(_0x287043,null))[_0xe8b5('0x2a')](respondWithResult(_0x287043,null))[_0xe8b5('0x4b')](handleError(_0x287043,null));};exports[_0xe8b5('0x51')]=function(_0x1ec1b2,_0x274969,_0x175ffc){return db['Plugin'][_0xe8b5('0x50')]({'where':{'id':_0x1ec1b2[_0xe8b5('0x4d')]['id']},'attributes':['name','path'],'raw':!![]})[_0xe8b5('0x2a')](handleEntityNotFound(_0x274969,null))[_0xe8b5('0x2a')](function(_0x88c1c7){if(_0x88c1c7){var _0x3ec4a7=path[_0xe8b5('0x52')](config['root'],_0xe8b5('0x53'),util[_0xe8b5('0x54')](_0xe8b5('0x55'),path[_0xe8b5('0x56')](_0x88c1c7['path'])));var _0x10abd8=fs[_0xe8b5('0x57')](_0x3ec4a7);var _0x114787=archiver(_0xe8b5('0x58'),{'zlib':{'level':0x9}});_0x114787['on'](_0xe8b5('0x59'),function(_0x1a44c7){if(_0x1a44c7[_0xe8b5('0x5a')]==='ENOENT'){logger[_0xe8b5('0x2e')](_0x1a44c7);}else{throw new db[(_0xe8b5('0x5b'))]['Error'](_0xe8b5('0x5c'));}});_0x114787['on'](_0xe8b5('0x2e'),function(_0x5c70d1){throw new db['Sequelize'][(_0xe8b5('0x5d'))](_0xe8b5('0x5c'));});_0x114787['pipe'](_0x10abd8);_0x114787[_0xe8b5('0x5e')](_0xe8b5('0x5f'),{'cwd':path[_0xe8b5('0x52')](config[_0xe8b5('0x60')],'server/files/plugins',path[_0xe8b5('0x61')](_0x88c1c7['path'])),'ignore':[path[_0xe8b5('0x52')](path[_0xe8b5('0x56')](_0x88c1c7[_0xe8b5('0x6')]),_0xe8b5('0x62')),path[_0xe8b5('0x52')](path['basename'](_0x88c1c7[_0xe8b5('0x6')]),_0xe8b5('0x63'))],'nodir':!![]})[_0xe8b5('0x64')]();_0x10abd8['on'](_0xe8b5('0x65'),function(){if(!fs['existsSync'](_0x3ec4a7)){throw new db[(_0xe8b5('0x5b'))][(_0xe8b5('0x5d'))]('Plugin\x20not\x20found');}return _0x274969['download'](_0x3ec4a7,util[_0xe8b5('0x54')](_0xe8b5('0x55'),path[_0xe8b5('0x56')](_0x88c1c7[_0xe8b5('0x6')])),function(_0x24b0bb){if(_0x24b0bb){throw new db[(_0xe8b5('0x5b'))][(_0xe8b5('0x5d'))](_0xe8b5('0x66'));}fs['unlinkSync'](_0x3ec4a7);logger[_0xe8b5('0x67')](_0xe8b5('0x68'));logger[_0xe8b5('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0xe8b5('0x4b')](handleError(_0x274969,null));};exports[_0xe8b5('0x69')]=function(_0x5346dc,_0xcc23a5,_0x208c30){var _0x475612=path[_0xe8b5('0x56')](_0x5346dc[_0xe8b5('0x6a')]['filename'],path['extname'](_0x5346dc['file'][_0xe8b5('0x6b')]));var _0x5adef8=path[_0xe8b5('0x52')](config[_0xe8b5('0x60')],_0xe8b5('0x53'),_0x5346dc[_0xe8b5('0x6a')]['filename']);var _0x512f1b=path[_0xe8b5('0x52')](config['root'],'server/files/plugins',_0x475612);logger[_0xe8b5('0x67')](_0xe8b5('0x6c'),_0x5adef8);logger[_0xe8b5('0x67')](_0xe8b5('0x6d'),_0x512f1b);try{fs['chmodSync'](_0x5adef8,parseInt(_0xe8b5('0x6e'),0x8));extract(_0x5adef8,{'dir':_0x512f1b},function(_0x43078d){if(_0x43078d){logger[_0xe8b5('0x2e')](_0x43078d);handleError(_0x43078d,!![]);};var _0x1c3c53=fs[_0xe8b5('0x6f')](_0x512f1b);if(_0x1c3c53[_0xe8b5('0x70')]>0x1){removeReferences(_0x5adef8,_0x512f1b);logger[_0xe8b5('0x2e')](_0xe8b5('0x71'));return _0x208c30(new Error(_0xe8b5('0x71')));}var _0x4bf342=fs[_0xe8b5('0x72')](path['join'](_0x512f1b,_0x1c3c53[0x0]));if(_0x4bf342[_0xe8b5('0x73')]()){removeReferences(_0x5adef8,_0x512f1b);logger['error'](_0xe8b5('0x71'));return _0x208c30(new Error(_0xe8b5('0x71')));}if(_0x4bf342[_0xe8b5('0x74')]()){var _0x1eb867=fs['readdirSync'](path[_0xe8b5('0x52')](_0x512f1b,_0x1c3c53[0x0]));if(_0x1eb867[_0xe8b5('0x70')]===0x0){removeReferences(_0x5adef8,_0x512f1b);logger[_0xe8b5('0x2e')](_0xe8b5('0x71'));return _0x208c30(new Error(_0xe8b5('0x71')));}var _0xf53b55=_0x1eb867[_0xe8b5('0x75')](function(_0x4885ec){return _0x4885ec==='manifest.json';});if(!_0xf53b55){return _0x208c30(new Error(_0xe8b5('0x76')));}var _0x55e50d=fs[_0xe8b5('0x77')](path['join'](_0x512f1b,_0x1c3c53[0x0],_0xe8b5('0x78')));var _0x345108=JSON['parse'](_0x55e50d);if(_0xe8b5('0x24')==typeof _0x345108[_0xe8b5('0x30')]){return _0x208c30(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xe8b5('0x24')==typeof _0x345108[_0xe8b5('0x36')]){return _0x208c30(new Error(_0xe8b5('0x79')));}if('undefined'==typeof _0x345108[_0xe8b5('0x7a')]){return _0x208c30(new Error(_0xe8b5('0x7b')));}if(_0xe8b5('0x24')==typeof _0x345108[_0xe8b5('0x7c')]){return _0x208c30(new Error(_0xe8b5('0x7d')));}if(_0x345108[_0xe8b5('0x36')]===_0xe8b5('0x7e')){if(_0xe8b5('0x24')==typeof _0x345108['parameters'][_0xe8b5('0x7f')]){return _0x208c30(new Error(_0xe8b5('0x80')));}if('undefined'==typeof _0x345108[_0xe8b5('0x7c')][_0xe8b5('0x7f')]['admin']&&'undefined'==typeof _0x345108[_0xe8b5('0x7c')][_0xe8b5('0x7f')]['agent']){return _0x208c30(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x345108[_0xe8b5('0x36')]===_0xe8b5('0x81')){if(_0xe8b5('0x24')==typeof _0x345108['parameters'][_0xe8b5('0x82')]){return _0x208c30(new Error(_0xe8b5('0x83')));}if(_0xe8b5('0x24')==typeof _0x345108[_0xe8b5('0x7c')]['scriptPath']){return _0x208c30(new Error(_0xe8b5('0x84')));}}else{return _0x208c30(new Error(_0xe8b5('0x85')));}var _0xe1bf81=_0x345108[_0xe8b5('0x30')];var _0x20dbef=_0x345108[_0xe8b5('0x86')];var _0x521c8e=_0x345108[_0xe8b5('0x36')];var _0x3d7c30=_0x345108[_0xe8b5('0x87')]?_0x345108[_0xe8b5('0x87')]:_0xe8b5('0x88');var _0x106590=_0x345108[_0xe8b5('0x89')]?_0x345108[_0xe8b5('0x89')]:_0xe8b5('0x8a');var _0x46cb7f='';var _0x2f5376='';var _0x2a9ba9='';var _0x4e3b30='';var _0x577622=_0x345108[_0xe8b5('0x7a')];if(_0x521c8e===_0xe8b5('0x7e')){if(_0xe8b5('0x24')!=typeof _0x345108[_0xe8b5('0x7c')]['views'][_0xe8b5('0x8b')]){var _0x47d948=_0x345108[_0xe8b5('0x7c')][_0xe8b5('0x7f')][_0xe8b5('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xe8b5('0x8c')](_0x47d948)){_0x46cb7f=path[_0xe8b5('0x52')](_0xe8b5('0x8d'),_0x475612,_0x1c3c53[0x0],_0x47d948);}else{_0x46cb7f=_0x47d948;}}else{logger['info'](_0xe8b5('0x8e'));}if('undefined'!=typeof _0x345108['parameters'][_0xe8b5('0x7f')][_0xe8b5('0x8f')]){var _0x1f5180=_0x345108[_0xe8b5('0x7c')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xe8b5('0x8c')](_0x1f5180)){_0x2f5376=path[_0xe8b5('0x52')]('plugins',_0x475612,_0x1c3c53[0x0],_0x1f5180);}else{_0x2f5376=_0x1f5180;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x521c8e===_0xe8b5('0x81')){_0x2a9ba9=_0x345108[_0xe8b5('0x7c')][_0xe8b5('0x82')];_0x4e3b30=_0x345108[_0xe8b5('0x7c')][_0xe8b5('0x90')];if(_0xe8b5('0x24')!=typeof _0x345108[_0xe8b5('0x7c')]['views']){if('undefined'!=typeof _0x345108[_0xe8b5('0x7c')]['views']['admin']){var _0x47d948=_0x345108['parameters'][_0xe8b5('0x7f')][_0xe8b5('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xe8b5('0x8c')](_0x47d948)){_0x46cb7f=path[_0xe8b5('0x52')](_0xe8b5('0x8d'),_0x475612,_0x1c3c53[0x0],_0x47d948);}else{_0x46cb7f=_0x47d948;}}if(_0xe8b5('0x24')!=typeof _0x345108[_0xe8b5('0x7c')][_0xe8b5('0x7f')]['agent']){var _0x1f5180=_0x345108['parameters']['views'][_0xe8b5('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xe8b5('0x8c')](_0x1f5180)){_0x2f5376=path[_0xe8b5('0x52')](_0xe8b5('0x8d'),_0x475612,_0x1c3c53[0x0],_0x1f5180);}else{_0x2f5376=_0x1f5180;}}}}var _0x2650db={'name':_0xe1bf81,'description':_0x20dbef,'path':path[_0xe8b5('0x52')](_0x475612,_0x1c3c53[0x0]),'type':_0x521c8e,'sidebar':_0x3d7c30,'icon':_0x106590,'adminUrl':_0x46cb7f,'agentUrl':_0x2f5376,'scriptName':_0x2a9ba9,'scriptPath':_0x4e3b30,'version':_0x577622};removeReferences(_0x5adef8,null);return db[_0xe8b5('0x47')]['create'](_0x2650db)[_0xe8b5('0x2a')](function(_0x3a1fd8){var _0x24fa1f={'role':_0x5346dc['body'][_0xe8b5('0x91')],'userProfileId':_0x5346dc[_0xe8b5('0x92')][_0xe8b5('0x93')]};if(!_0x24fa1f)throw new Error(_0xe8b5('0x94'));if(_0x24fa1f[_0xe8b5('0x91')]===_0xe8b5('0x95')){var _0x11d92e=_0x3a1fd8[_0xe8b5('0x96')]({'plain':!![]});return db[_0xe8b5('0x97')][_0xe8b5('0x50')]({'where':{'name':'Plugins','userProfileId':_0x24fa1f['userProfileId']},'raw':!![]})[_0xe8b5('0x2a')](function(_0x57aa35){if(_0x57aa35&&_0x57aa35[_0xe8b5('0x98')]===0x0){return db[_0xe8b5('0x2d')][_0xe8b5('0x99')]({'name':_0x11d92e[_0xe8b5('0x30')],'resourceId':_0x11d92e['id'],'type':_0x57aa35['name'],'sectionId':_0x57aa35['id']},{})[_0xe8b5('0x2a')](function(){return _0x3a1fd8;});}else{return _0x3a1fd8;}})['catch'](function(_0x2bdbdc){logger['error'](_0xe8b5('0x9a'),_0x2bdbdc);throw _0x2bdbdc;});}return _0x3a1fd8;})[_0xe8b5('0x2a')](respondWithResult(_0xcc23a5,null))[_0xe8b5('0x4b')](handleError(_0xcc23a5,null));}});}catch(_0x76d793){_0xcc23a5[_0xe8b5('0x20')](0x1f4)['send'](_0x76d793);}};function removeReferences(_0x39be6f,_0x2a1510){try{if(_0x39be6f){fs[_0xe8b5('0x9b')](_0x39be6f);logger['info'](_0xe8b5('0x9c'));}if(_0x2a1510){rimraf(_0x2a1510,function(){});logger[_0xe8b5('0x67')](_0xe8b5('0x9d'));}}catch(_0x1e3016){logger[_0xe8b5('0x2e')](_0x1e3016);}}exports['update']=function(_0x4213d5,_0xf2517b,_0x1b9863){return db[_0xe8b5('0x47')][_0xe8b5('0x50')]({'where':{'id':_0x4213d5['params']['id']}})[_0xe8b5('0x2a')](handleEntityNotFound(_0xf2517b,null))[_0xe8b5('0x2a')](saveUpdates(_0x4213d5[_0xe8b5('0x92')],null))[_0xe8b5('0x2a')](respondWithResult(_0xf2517b,null))['catch'](handleError(_0xf2517b,null));};exports[_0xe8b5('0x9e')]=function(_0x422866,_0x56c9d5,_0x3b9387){return db[_0xe8b5('0x47')]['find']({'where':{'id':_0x422866[_0xe8b5('0x4d')]['id']}})[_0xe8b5('0x2a')](function(_0x388989){if(_0x388989){return _0x388989[_0xe8b5('0x2b')]();}})[_0xe8b5('0x2a')](function(_0x1347b8){rimraf(path['join'](config[_0xe8b5('0x60')],'server/files/plugins',path['dirname'](_0x1347b8['path'])),function(){});return _0x1347b8;})[_0xe8b5('0x2a')](handleEntityNotFound(_0x56c9d5,null))[_0xe8b5('0x2a')](respondWithStatusCode(_0x56c9d5,null))[_0xe8b5('0x4b')](handleError(_0x56c9d5,null));};exports[_0xe8b5('0x9f')]=function(_0x474806,_0x2ec1e3,_0x5ef469){return BPromise[_0xe8b5('0xa0')]()[_0xe8b5('0x2a')](function(){if(!_0x474806[_0xe8b5('0x39')][_0xe8b5('0x6')]){throw new Error(_0xe8b5('0xa1'));}if(!_0x474806[_0xe8b5('0x39')][_0xe8b5('0xa2')]){throw new Error(_0xe8b5('0xa3'));}var _0xf0940f=_0x474806[_0xe8b5('0x39')][_0xe8b5('0xa4')]?_0x474806[_0xe8b5('0x39')][_0xe8b5('0xa4')]+':'+_0x474806[_0xe8b5('0x39')][_0xe8b5('0xa2')]:'http://localhost:'+_0x474806[_0xe8b5('0x39')][_0xe8b5('0xa2')];var _0x1cccd9=_0x474806[_0xe8b5('0x39')]['json']?_0x474806[_0xe8b5('0x39')][_0xe8b5('0x22')]:!![];var _0x3cd091=_0x474806[_0xe8b5('0x39')][_0xe8b5('0xa5')]?_0x474806['query'][_0xe8b5('0xa5')]:null;var _0x304c71={'method':_0x474806['method'],'uri':util[_0xe8b5('0x54')]('%s%s',_0xf0940f,_0x474806['query']['path']),'json':_0x1cccd9,'resolveWithFullResponse':!![],'encoding':_0x3cd091,'qs':_0x474806[_0xe8b5('0x39')]};if(_0x474806[_0xe8b5('0xa6')]){_0x304c71['headers']=_0x474806[_0xe8b5('0xa6')];if(_0x304c71[_0xe8b5('0xa6')][_0xe8b5('0xa7')]){delete _0x304c71[_0xe8b5('0xa6')][_0xe8b5('0xa7')];}}if(_0x304c71['headers'][_0xe8b5('0xa8')]){delete _0x304c71[_0xe8b5('0xa6')][_0xe8b5('0xa8')];}return rp(_0x304c71);})[_0xe8b5('0x2a')](function(_0x7ce905){if(_0x7ce905){_0x2ec1e3[_0xe8b5('0xa9')](_0x7ce905[_0xe8b5('0xa6')]);logger[_0xe8b5('0x67')](_0x7ce905[_0xe8b5('0x92')]);if(_[_0xe8b5('0xaa')](_0x474806[_0xe8b5('0x39')][_0xe8b5('0x6')],_0xe8b5('0x51'))&&_0x7ce905[_0xe8b5('0xab')]==0x1f4){return _0x2ec1e3[_0xe8b5('0x1f')](_0x7ce905['statusCode']);}else{return _0x2ec1e3[_0xe8b5('0x20')](_0x7ce905[_0xe8b5('0xab')])[_0xe8b5('0x31')](_0x7ce905[_0xe8b5('0x92')]);}}else{return _0x2ec1e3[_0xe8b5('0x1f')](0xc8);}})[_0xe8b5('0x4b')](handleError(_0x2ec1e3,null));};exports['webhookPost']=function(_0x379923,_0x43a09a,_0x1cbe63){return BPromise['resolve']()[_0xe8b5('0x2a')](function(){if(!_0x379923[_0xe8b5('0x39')][_0xe8b5('0x6')]){throw new Error(_0xe8b5('0xa1'));}if(!_0x379923[_0xe8b5('0x39')][_0xe8b5('0xa2')]){throw new Error(_0xe8b5('0xa3'));}var _0x3f320b=_0x379923['query'][_0xe8b5('0xa4')]?_0x379923['query'][_0xe8b5('0xa4')]+':'+_0x379923['query'][_0xe8b5('0xa2')]:_0xe8b5('0xac')+_0x379923['query']['port'];var _0x156405=_0x379923['query'][_0xe8b5('0x22')]?_0x379923[_0xe8b5('0x39')][_0xe8b5('0x22')]:!![];var _0x1429a5=_0x379923['query'][_0xe8b5('0xa5')]?_0x379923['query'][_0xe8b5('0xa5')]:null;var _0x4429df={'method':_0x379923['method'],'uri':util[_0xe8b5('0x54')](_0xe8b5('0xad'),_0x3f320b,_0x379923[_0xe8b5('0x39')]['path']),'json':_0x156405,'resolveWithFullResponse':!![],'encoding':_0x1429a5,'body':_0x379923[_0xe8b5('0x92')]};if(_0x379923[_0xe8b5('0xa6')]){_0x4429df['headers']=_0x379923[_0xe8b5('0xa6')];if(_0x4429df[_0xe8b5('0xa6')]['content-length']){delete _0x4429df['headers']['content-length'];}}if(_0x4429df[_0xe8b5('0xa6')]['content-type']){delete _0x4429df[_0xe8b5('0xa6')][_0xe8b5('0xa8')];}return rp(_0x4429df);})[_0xe8b5('0x2a')](function(_0x4f4af4){if(_0x4f4af4){_0x43a09a[_0xe8b5('0xa9')](_0x4f4af4[_0xe8b5('0xa6')]);logger[_0xe8b5('0x67')](_0x4f4af4[_0xe8b5('0x92')]);return _0x43a09a[_0xe8b5('0x20')](_0x4f4af4[_0xe8b5('0xab')])[_0xe8b5('0x31')](_0x4f4af4[_0xe8b5('0x92')]);}else{return _0x43a09a[_0xe8b5('0x1f')](0xc8);}})[_0xe8b5('0x4b')](handleError(_0x43a09a,null));}; \ No newline at end of file +var _0xb518=['format','basename','createWriteStream','zip','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','attachments/**/*','finalize','close','Plugin\x20not\x20found','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','0777','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','get','Plugins','UserProfileResource','stack','name','send','index','map','Plugin','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','keys','rawAttributes','include','find','download','params','join','root'];(function(_0x4f8250,_0x2519f3){var _0x4b2e3e=function(_0x18d297){while(--_0x18d297){_0x4f8250['push'](_0x4f8250['shift']());}};_0x4b2e3e(++_0x2519f3);}(_0xb518,0x1b4));var _0x8b51=function(_0x46fe02,_0x5f0e57){_0x46fe02=_0x46fe02-0x0;var _0x312a81=_0xb518[_0x46fe02];return _0x312a81;};'use strict';var emlformat=require(_0x8b51('0x0'));var rimraf=require(_0x8b51('0x1'));var zipdir=require(_0x8b51('0x2'));var jsonpatch=require(_0x8b51('0x3'));var rp=require(_0x8b51('0x4'));var moment=require(_0x8b51('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b51('0x6'));var util=require('util');var path=require(_0x8b51('0x7'));var sox=require(_0x8b51('0x8'));var csv=require(_0x8b51('0x9'));var ejs=require(_0x8b51('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b51('0xb'));var squel=require(_0x8b51('0xc'));var crypto=require(_0x8b51('0xd'));var jsforce=require(_0x8b51('0xe'));var deskjs=require(_0x8b51('0xf'));var toCsv=require(_0x8b51('0x9'));var querystring=require(_0x8b51('0x10'));var Papa=require('papaparse');var extract=require(_0x8b51('0x11'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x8b51('0x12'));var authService=require(_0x8b51('0x13'));var qs=require(_0x8b51('0x14'));var as=require(_0x8b51('0x15'));var hardwareService=require(_0x8b51('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x8b51('0x17'));var config=require(_0x8b51('0x18'));var licenseUtil=require(_0x8b51('0x19'));var db=require(_0x8b51('0x1a'))['db'];config[_0x8b51('0x1b')]=_['defaults'](config[_0x8b51('0x1b')],{'host':_0x8b51('0x1c'),'port':0x18eb});var socket=require(_0x8b51('0x1d'))(new Redis(config[_0x8b51('0x1b')]));require(_0x8b51('0x1e'))['register'](socket);function respondWithStatusCode(_0x4f83c4,_0x4388d6){_0x4388d6=_0x4388d6||0xcc;return function(_0x5c3c17){if(_0x5c3c17){return _0x4f83c4[_0x8b51('0x1f')](_0x4388d6);}return _0x4f83c4[_0x8b51('0x20')](_0x4388d6)[_0x8b51('0x21')]();};}function respondWithResult(_0x40bee8,_0x486b71){_0x486b71=_0x486b71||0xc8;return function(_0x1ddb16){if(_0x1ddb16){return _0x40bee8['status'](_0x486b71)[_0x8b51('0x22')](_0x1ddb16);}};}function respondWithFilteredResult(_0x4d231e,_0xa593ad){return function(_0x138cbc){if(_0x138cbc){var _0x51efe6=typeof _0xa593ad[_0x8b51('0x23')]===_0x8b51('0x24')&&typeof _0xa593ad['limit']==='undefined';var _0x5f3b51=_0x138cbc[_0x8b51('0x25')];var _0x4c81cb=_0x51efe6?0x0:_0xa593ad[_0x8b51('0x23')];var _0x2b5aed=_0x51efe6?_0x138cbc[_0x8b51('0x25')]:_0xa593ad['offset']+_0xa593ad[_0x8b51('0x26')];var _0x417dd8;if(_0x2b5aed>=_0x5f3b51){_0x2b5aed=_0x5f3b51;_0x417dd8=0xc8;}else{_0x417dd8=0xce;}_0x4d231e[_0x8b51('0x20')](_0x417dd8);return _0x4d231e[_0x8b51('0x27')]('Content-Range',_0x4c81cb+'-'+_0x2b5aed+'/'+_0x5f3b51)[_0x8b51('0x22')](_0x138cbc);}return null;};}function patchUpdates(_0x316019){return function(_0x55b891){try{jsonpatch['apply'](_0x55b891,_0x316019,!![]);}catch(_0x572819){return BPromise[_0x8b51('0x28')](_0x572819);}return _0x55b891[_0x8b51('0x29')]();};}function saveUpdates(_0x4c0f6f,_0x2003ff){return function(_0x15c270){if(_0x15c270){return _0x15c270[_0x8b51('0x2a')](_0x4c0f6f)['then'](function(_0x4e6a70){return _0x4e6a70;});}return null;};}function removeEntity(_0xfbf009,_0x1fea0a){return function(_0x3d79d7){if(_0x3d79d7){return _0x3d79d7[_0x8b51('0x2b')]()[_0x8b51('0x2c')](function(){var _0x445e64=_0x3d79d7[_0x8b51('0x2d')]({'plain':!![]});var _0x27fba1=_0x8b51('0x2e');return db[_0x8b51('0x2f')]['destroy']({'where':{'type':_0x27fba1,'resourceId':_0x445e64['id']}})[_0x8b51('0x2c')](function(){return _0x3d79d7;});})[_0x8b51('0x2c')](function(){_0xfbf009['status'](0xcc)[_0x8b51('0x21')]();});}};}function handleEntityNotFound(_0x2ae4fe,_0x3905c2){return function(_0x5ede53){if(!_0x5ede53){_0x2ae4fe[_0x8b51('0x1f')](0x194);}return _0x5ede53;};}function handleError(_0xb7ffdf,_0xc7318){_0xc7318=_0xc7318||0x1f4;return function(_0x254e69){logger['error'](_0x254e69[_0x8b51('0x30')]);if(_0x254e69[_0x8b51('0x31')]){delete _0x254e69[_0x8b51('0x31')];}_0xb7ffdf[_0x8b51('0x20')](_0xc7318)[_0x8b51('0x32')](_0x254e69);};}exports[_0x8b51('0x33')]=function(_0x412a51,_0x481971){var _0xfcf85d={},_0x4392ec={},_0x1e6c8d={'count':0x0,'rows':[]};var _0x3a4bd3=_[_0x8b51('0x34')](db[_0x8b51('0x35')]['rawAttributes'],function(_0x479ef2){return{'name':_0x479ef2[_0x8b51('0x36')],'type':_0x479ef2[_0x8b51('0x37')][_0x8b51('0x38')]};});_0x4392ec[_0x8b51('0x39')]=_['map'](_0x3a4bd3,_0x8b51('0x31'));_0x4392ec[_0x8b51('0x3a')]=_['keys'](_0x412a51['query']);_0x4392ec[_0x8b51('0x3b')]=_[_0x8b51('0x3c')](_0x4392ec[_0x8b51('0x39')],_0x4392ec[_0x8b51('0x3a')]);_0xfcf85d[_0x8b51('0x3d')]=_[_0x8b51('0x3c')](_0x4392ec[_0x8b51('0x39')],qs[_0x8b51('0x3e')](_0x412a51[_0x8b51('0x3a')][_0x8b51('0x3e')]));_0xfcf85d[_0x8b51('0x3d')]=_0xfcf85d[_0x8b51('0x3d')][_0x8b51('0x3f')]?_0xfcf85d['attributes']:_0x4392ec[_0x8b51('0x39')];if(!_0x412a51[_0x8b51('0x3a')]['hasOwnProperty'](_0x8b51('0x40'))){_0xfcf85d['limit']=qs[_0x8b51('0x26')](_0x412a51[_0x8b51('0x3a')]['limit']);_0xfcf85d['offset']=qs[_0x8b51('0x23')](_0x412a51['query'][_0x8b51('0x23')]);}_0xfcf85d['order']=qs['sort'](_0x412a51[_0x8b51('0x3a')]['sort']);_0xfcf85d[_0x8b51('0x41')]=qs[_0x8b51('0x3b')](_[_0x8b51('0x42')](_0x412a51['query'],_0x4392ec[_0x8b51('0x3b')]),_0x3a4bd3);if(_0x412a51['query'][_0x8b51('0x43')]){_0xfcf85d[_0x8b51('0x41')]=_[_0x8b51('0x44')](_0xfcf85d['where'],{'$or':_[_0x8b51('0x34')](_0x3a4bd3,function(_0x569a7b){if(_0x569a7b[_0x8b51('0x37')]!==_0x8b51('0x45')){var _0x372d6c={};_0x372d6c[_0x569a7b[_0x8b51('0x31')]]={'$like':'%'+_0x412a51[_0x8b51('0x3a')][_0x8b51('0x43')]+'%'};return _0x372d6c;}})});}_0xfcf85d=_[_0x8b51('0x44')]({},_0xfcf85d,_0x412a51[_0x8b51('0x46')]);var _0x5ed790={'where':_0xfcf85d[_0x8b51('0x41')]};return db['Plugin'][_0x8b51('0x25')](_0x5ed790)['then'](function(_0x1e3a68){_0x1e6c8d[_0x8b51('0x25')]=_0x1e3a68;if(_0x412a51['query'][_0x8b51('0x47')]){_0xfcf85d['include']=[{'all':!![]}];}return db[_0x8b51('0x35')][_0x8b51('0x48')](_0xfcf85d);})[_0x8b51('0x2c')](function(_0x10f936){_0x1e6c8d['rows']=_0x10f936;return _0x1e6c8d;})[_0x8b51('0x2c')](respondWithFilteredResult(_0x481971,_0xfcf85d))[_0x8b51('0x49')](handleError(_0x481971,null));};exports[_0x8b51('0x4a')]=function(_0x1aafb6,_0x1b1299){var _0x9831ca={'raw':!![],'where':{'id':_0x1aafb6['params']['id']}},_0x6d6a1e={};_0x6d6a1e[_0x8b51('0x39')]=_[_0x8b51('0x4b')](db[_0x8b51('0x35')][_0x8b51('0x4c')]);_0x6d6a1e['query']=_[_0x8b51('0x4b')](_0x1aafb6['query']);_0x6d6a1e[_0x8b51('0x3b')]=_[_0x8b51('0x3c')](_0x6d6a1e[_0x8b51('0x39')],_0x6d6a1e[_0x8b51('0x3a')]);_0x9831ca['attributes']=_['intersection'](_0x6d6a1e[_0x8b51('0x39')],qs[_0x8b51('0x3e')](_0x1aafb6[_0x8b51('0x3a')]['fields']));_0x9831ca[_0x8b51('0x3d')]=_0x9831ca['attributes'][_0x8b51('0x3f')]?_0x9831ca[_0x8b51('0x3d')]:_0x6d6a1e[_0x8b51('0x39')];if(_0x1aafb6['query']['includeAll']){_0x9831ca[_0x8b51('0x4d')]=[{'all':!![]}];}_0x9831ca=_[_0x8b51('0x44')]({},_0x9831ca,_0x1aafb6[_0x8b51('0x46')]);return db[_0x8b51('0x35')][_0x8b51('0x4e')](_0x9831ca)[_0x8b51('0x2c')](handleEntityNotFound(_0x1b1299,null))[_0x8b51('0x2c')](respondWithResult(_0x1b1299,null))[_0x8b51('0x49')](handleError(_0x1b1299,null));};exports[_0x8b51('0x4f')]=function(_0x2d8016,_0x2d4569,_0x23b0b4){return db[_0x8b51('0x35')][_0x8b51('0x4e')]({'where':{'id':_0x2d8016[_0x8b51('0x50')]['id']},'attributes':[_0x8b51('0x31'),_0x8b51('0x7')],'raw':!![]})[_0x8b51('0x2c')](handleEntityNotFound(_0x2d4569,null))[_0x8b51('0x2c')](function(_0x8b5809){if(_0x8b5809){var _0x2fb55e=path[_0x8b51('0x51')](config[_0x8b51('0x52')],'server/files/plugins',util[_0x8b51('0x53')]('%s.zip',path[_0x8b51('0x54')](_0x8b5809[_0x8b51('0x7')])));var _0x5aaad3=fs[_0x8b51('0x55')](_0x2fb55e);var _0x2f1c6c=archiver(_0x8b51('0x56'),{'zlib':{'level':0x9}});_0x2f1c6c['on'](_0x8b51('0x57'),function(_0x1e250d){if(_0x1e250d[_0x8b51('0x58')]===_0x8b51('0x59')){logger[_0x8b51('0x5a')](_0x1e250d);}else{throw new db['Sequelize'][(_0x8b51('0x5b'))](_0x8b51('0x5c'));}});_0x2f1c6c['on'](_0x8b51('0x5a'),function(_0x4ecca3){throw new db[(_0x8b51('0x5d'))][(_0x8b51('0x5b'))](_0x8b51('0x5c'));});_0x2f1c6c[_0x8b51('0x5e')](_0x5aaad3);_0x2f1c6c[_0x8b51('0x5f')](_0x8b51('0x60'),{'cwd':path[_0x8b51('0x51')](config[_0x8b51('0x52')],'server/files/plugins',path[_0x8b51('0x61')](_0x8b5809[_0x8b51('0x7')])),'ignore':[path['join'](path[_0x8b51('0x54')](_0x8b5809['path']),'node_modules/**/*'),path[_0x8b51('0x51')](path['basename'](_0x8b5809['path']),_0x8b51('0x62'))],'nodir':!![]})[_0x8b51('0x63')]();_0x5aaad3['on'](_0x8b51('0x64'),function(){if(!fs['existsSync'](_0x2fb55e)){throw new db['Sequelize'][(_0x8b51('0x5b'))](_0x8b51('0x65'));}return _0x2d4569['download'](_0x2fb55e,util[_0x8b51('0x53')](_0x8b51('0x66'),path[_0x8b51('0x54')](_0x8b5809['path'])),function(_0x1419d4){if(_0x1419d4){throw new db[(_0x8b51('0x5d'))][(_0x8b51('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x2fb55e);logger[_0x8b51('0x67')](_0x8b51('0x68'));logger['info'](_0x8b51('0x69'));});});}return null;})[_0x8b51('0x49')](handleError(_0x2d4569,null));};exports['upload']=function(_0x4aeaaa,_0x12a488,_0x203df3){var _0x57b299=path['basename'](_0x4aeaaa[_0x8b51('0x6a')][_0x8b51('0x6b')],path[_0x8b51('0x6c')](_0x4aeaaa[_0x8b51('0x6a')]['filename']));var _0x5e117b=path[_0x8b51('0x51')](config[_0x8b51('0x52')],_0x8b51('0x6d'),_0x4aeaaa['file'][_0x8b51('0x6b')]);var _0x3f75e0=path[_0x8b51('0x51')](config[_0x8b51('0x52')],_0x8b51('0x6d'),_0x57b299);logger[_0x8b51('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x5e117b);logger[_0x8b51('0x67')](_0x8b51('0x6e'),_0x3f75e0);try{fs['chmodSync'](_0x5e117b,parseInt(_0x8b51('0x6f'),0x8));extract(_0x5e117b,{'dir':_0x3f75e0},function(_0x2e3ed9){if(_0x2e3ed9){logger[_0x8b51('0x5a')](_0x2e3ed9);handleError(_0x2e3ed9,!![]);};var _0x217a36=fs['readdirSync'](_0x3f75e0);if(_0x217a36[_0x8b51('0x3f')]>0x1){removeReferences(_0x5e117b,_0x3f75e0);logger[_0x8b51('0x5a')]('Invalid\x20plugin\x20structure');return _0x203df3(new Error('Invalid\x20plugin\x20structure'));}var _0x23d57a=fs[_0x8b51('0x70')](path[_0x8b51('0x51')](_0x3f75e0,_0x217a36[0x0]));if(_0x23d57a[_0x8b51('0x71')]()){removeReferences(_0x5e117b,_0x3f75e0);logger[_0x8b51('0x5a')](_0x8b51('0x72'));return _0x203df3(new Error(_0x8b51('0x72')));}if(_0x23d57a[_0x8b51('0x73')]()){var _0x2d2591=fs['readdirSync'](path['join'](_0x3f75e0,_0x217a36[0x0]));if(_0x2d2591[_0x8b51('0x3f')]===0x0){removeReferences(_0x5e117b,_0x3f75e0);logger[_0x8b51('0x5a')](_0x8b51('0x72'));return _0x203df3(new Error('Invalid\x20plugin\x20structure'));}var _0x4dd710=_0x2d2591[_0x8b51('0x74')](function(_0x5cee8e){return _0x5cee8e===_0x8b51('0x75');});if(!_0x4dd710){return _0x203df3(new Error(_0x8b51('0x76')));}var _0x343fb5=fs[_0x8b51('0x77')](path[_0x8b51('0x51')](_0x3f75e0,_0x217a36[0x0],_0x8b51('0x75')));var _0x122ff7=JSON['parse'](_0x343fb5);if(_0x8b51('0x24')==typeof _0x122ff7['name']){return _0x203df3(new Error(_0x8b51('0x78')));}if(_0x8b51('0x24')==typeof _0x122ff7[_0x8b51('0x37')]){return _0x203df3(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x8b51('0x24')==typeof _0x122ff7['version']){return _0x203df3(new Error(_0x8b51('0x79')));}if(_0x8b51('0x24')==typeof _0x122ff7[_0x8b51('0x7a')]){return _0x203df3(new Error(_0x8b51('0x7b')));}if(_0x122ff7['type']===_0x8b51('0x7c')){if('undefined'==typeof _0x122ff7['parameters'][_0x8b51('0x7d')]){return _0x203df3(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x8b51('0x24')==typeof _0x122ff7['parameters'][_0x8b51('0x7d')][_0x8b51('0x7e')]&&_0x8b51('0x24')==typeof _0x122ff7[_0x8b51('0x7a')][_0x8b51('0x7d')]['agent']){return _0x203df3(new Error(_0x8b51('0x7f')));}}else if(_0x122ff7[_0x8b51('0x37')]===_0x8b51('0x80')){if(_0x8b51('0x24')==typeof _0x122ff7[_0x8b51('0x7a')][_0x8b51('0x81')]){return _0x203df3(new Error(_0x8b51('0x82')));}if(_0x8b51('0x24')==typeof _0x122ff7[_0x8b51('0x7a')][_0x8b51('0x83')]){return _0x203df3(new Error(_0x8b51('0x84')));}}else{return _0x203df3(new Error(_0x8b51('0x85')));}var _0xae9d9c=_0x122ff7[_0x8b51('0x31')];var _0x233330=_0x122ff7[_0x8b51('0x86')];var _0x1942bf=_0x122ff7[_0x8b51('0x37')];var _0x495c7f=_0x122ff7[_0x8b51('0x87')]?_0x122ff7[_0x8b51('0x87')]:_0x8b51('0x88');var _0x146098=_0x122ff7[_0x8b51('0x89')]?_0x122ff7[_0x8b51('0x89')]:_0x8b51('0x8a');var _0x410abe='';var _0x1c87a8='';var _0x492ff7='';var _0x44bea1='';var _0x2a4210=_0x122ff7[_0x8b51('0x8b')];if(_0x1942bf===_0x8b51('0x7c')){if('undefined'!=typeof _0x122ff7[_0x8b51('0x7a')][_0x8b51('0x7d')][_0x8b51('0x7e')]){var _0x3aab6a=_0x122ff7[_0x8b51('0x7a')]['views'][_0x8b51('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x8b51('0x8c')](_0x3aab6a)){_0x410abe=path[_0x8b51('0x51')](_0x8b51('0x8d'),_0x57b299,_0x217a36[0x0],_0x3aab6a);}else{_0x410abe=_0x3aab6a;}}else{logger[_0x8b51('0x67')](_0x8b51('0x8e'));}if(_0x8b51('0x24')!=typeof _0x122ff7[_0x8b51('0x7a')]['views'][_0x8b51('0x8f')]){var _0x4764ea=_0x122ff7['parameters']['views'][_0x8b51('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x8b51('0x8c')](_0x4764ea)){_0x1c87a8=path[_0x8b51('0x51')]('plugins',_0x57b299,_0x217a36[0x0],_0x4764ea);}else{_0x1c87a8=_0x4764ea;}}else{logger[_0x8b51('0x67')](_0x8b51('0x90'));}}else if(_0x1942bf===_0x8b51('0x80')){_0x492ff7=_0x122ff7['parameters'][_0x8b51('0x81')];_0x44bea1=_0x122ff7['parameters'][_0x8b51('0x83')];if(_0x8b51('0x24')!=typeof _0x122ff7['parameters'][_0x8b51('0x7d')]){if(_0x8b51('0x24')!=typeof _0x122ff7[_0x8b51('0x7a')][_0x8b51('0x7d')][_0x8b51('0x7e')]){var _0x3aab6a=_0x122ff7['parameters'][_0x8b51('0x7d')][_0x8b51('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x8b51('0x8c')](_0x3aab6a)){_0x410abe=path[_0x8b51('0x51')](_0x8b51('0x8d'),_0x57b299,_0x217a36[0x0],_0x3aab6a);}else{_0x410abe=_0x3aab6a;}}if(_0x8b51('0x24')!=typeof _0x122ff7[_0x8b51('0x7a')][_0x8b51('0x7d')][_0x8b51('0x8f')]){var _0x4764ea=_0x122ff7[_0x8b51('0x7a')][_0x8b51('0x7d')][_0x8b51('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x8b51('0x8c')](_0x4764ea)){_0x1c87a8=path[_0x8b51('0x51')](_0x8b51('0x8d'),_0x57b299,_0x217a36[0x0],_0x4764ea);}else{_0x1c87a8=_0x4764ea;}}}}var _0x4ffbd={'name':_0xae9d9c,'description':_0x233330,'path':path['join'](_0x57b299,_0x217a36[0x0]),'type':_0x1942bf,'sidebar':_0x495c7f,'icon':_0x146098,'adminUrl':_0x410abe,'agentUrl':_0x1c87a8,'scriptName':_0x492ff7,'scriptPath':_0x44bea1,'version':_0x2a4210};removeReferences(_0x5e117b,null);return db[_0x8b51('0x35')][_0x8b51('0x91')](_0x4ffbd)[_0x8b51('0x2c')](function(_0x51d312){var _0x1ea233={'role':_0x4aeaaa[_0x8b51('0x92')]['role'],'userProfileId':_0x4aeaaa[_0x8b51('0x92')]['userProfileId']};if(!_0x1ea233)throw new Error(_0x8b51('0x93'));if(_0x1ea233[_0x8b51('0x94')]==='user'){var _0x2bb5de=_0x51d312[_0x8b51('0x2d')]({'plain':!![]});return db[_0x8b51('0x95')][_0x8b51('0x4e')]({'where':{'name':_0x8b51('0x2e'),'userProfileId':_0x1ea233[_0x8b51('0x96')]},'raw':!![]})[_0x8b51('0x2c')](function(_0x5ed905){if(_0x5ed905&&_0x5ed905[_0x8b51('0x97')]===0x0){return db[_0x8b51('0x2f')][_0x8b51('0x91')]({'name':_0x2bb5de[_0x8b51('0x31')],'resourceId':_0x2bb5de['id'],'type':_0x5ed905[_0x8b51('0x31')],'sectionId':_0x5ed905['id']},{})[_0x8b51('0x2c')](function(){return _0x51d312;});}else{return _0x51d312;}})[_0x8b51('0x49')](function(_0x462ca1){logger[_0x8b51('0x5a')](_0x8b51('0x98'),_0x462ca1);throw _0x462ca1;});}return _0x51d312;})[_0x8b51('0x2c')](respondWithResult(_0x12a488,null))[_0x8b51('0x49')](handleError(_0x12a488,null));}});}catch(_0x47610b){_0x12a488['status'](0x1f4)[_0x8b51('0x32')](_0x47610b);}};function removeReferences(_0x5bf3e2,_0x3d106e){try{if(_0x5bf3e2){fs[_0x8b51('0x99')](_0x5bf3e2);logger['info'](_0x8b51('0x9a'));}if(_0x3d106e){rimraf(_0x3d106e,function(){});logger[_0x8b51('0x67')](_0x8b51('0x9b'));}}catch(_0x4c19ae){logger[_0x8b51('0x5a')](_0x4c19ae);}}exports[_0x8b51('0x2a')]=function(_0x1bee70,_0x555872,_0x433c03){return db[_0x8b51('0x35')][_0x8b51('0x4e')]({'where':{'id':_0x1bee70[_0x8b51('0x50')]['id']}})[_0x8b51('0x2c')](handleEntityNotFound(_0x555872,null))[_0x8b51('0x2c')](saveUpdates(_0x1bee70[_0x8b51('0x92')],null))[_0x8b51('0x2c')](respondWithResult(_0x555872,null))['catch'](handleError(_0x555872,null));};exports[_0x8b51('0x9c')]=function(_0x25abcb,_0x2f377e,_0x4e3a14){return db[_0x8b51('0x35')][_0x8b51('0x4e')]({'where':{'id':_0x25abcb[_0x8b51('0x50')]['id']}})[_0x8b51('0x2c')](function(_0x3ffebf){if(_0x3ffebf){return _0x3ffebf[_0x8b51('0x2b')]();}})[_0x8b51('0x2c')](function(_0x55c2e3){rimraf(path[_0x8b51('0x51')](config['root'],_0x8b51('0x6d'),path[_0x8b51('0x61')](_0x55c2e3[_0x8b51('0x7')])),function(){});return _0x55c2e3;})[_0x8b51('0x2c')](handleEntityNotFound(_0x2f377e,null))[_0x8b51('0x2c')](respondWithStatusCode(_0x2f377e,null))[_0x8b51('0x49')](handleError(_0x2f377e,null));};exports[_0x8b51('0x9d')]=function(_0x1072c6,_0x206ca1,_0x2f8a3d){return BPromise['resolve']()[_0x8b51('0x2c')](function(){if(!_0x1072c6[_0x8b51('0x3a')][_0x8b51('0x7')]){throw new Error(_0x8b51('0x9e'));}if(!_0x1072c6[_0x8b51('0x3a')][_0x8b51('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x496103=_0x1072c6[_0x8b51('0x3a')][_0x8b51('0xa0')]?_0x1072c6[_0x8b51('0x3a')][_0x8b51('0xa0')]+':'+_0x1072c6[_0x8b51('0x3a')][_0x8b51('0x9f')]:_0x8b51('0xa1')+_0x1072c6[_0x8b51('0x3a')][_0x8b51('0x9f')];var _0x460402=_0x1072c6[_0x8b51('0x3a')][_0x8b51('0x22')]?_0x1072c6['query'][_0x8b51('0x22')]:!![];var _0x26560b=_0x1072c6[_0x8b51('0x3a')][_0x8b51('0xa2')]?_0x1072c6[_0x8b51('0x3a')][_0x8b51('0xa2')]:null;var _0x513a0d={'method':_0x1072c6[_0x8b51('0xa3')],'uri':util['format'](_0x8b51('0xa4'),_0x496103,_0x1072c6[_0x8b51('0x3a')][_0x8b51('0x7')]),'json':_0x460402,'resolveWithFullResponse':!![],'encoding':_0x26560b,'qs':_0x1072c6[_0x8b51('0x3a')]};if(_0x1072c6[_0x8b51('0xa5')]){_0x513a0d[_0x8b51('0xa5')]=_0x1072c6[_0x8b51('0xa5')];if(_0x513a0d[_0x8b51('0xa5')]['content-length']){delete _0x513a0d[_0x8b51('0xa5')][_0x8b51('0xa6')];}}if(_0x513a0d[_0x8b51('0xa5')][_0x8b51('0xa7')]){delete _0x513a0d[_0x8b51('0xa5')][_0x8b51('0xa7')];}return rp(_0x513a0d);})[_0x8b51('0x2c')](function(_0x271d85){if(_0x271d85){_0x206ca1[_0x8b51('0x27')](_0x271d85[_0x8b51('0xa5')]);logger[_0x8b51('0x67')](_0x271d85['body']);if(_[_0x8b51('0xa8')](_0x1072c6['query'][_0x8b51('0x7')],'download')&&_0x271d85['statusCode']==0x1f4){return _0x206ca1[_0x8b51('0x1f')](_0x271d85[_0x8b51('0xa9')]);}else{return _0x206ca1[_0x8b51('0x20')](_0x271d85[_0x8b51('0xa9')])[_0x8b51('0x32')](_0x271d85['body']);}}else{return _0x206ca1[_0x8b51('0x1f')](0xc8);}})[_0x8b51('0x49')](handleError(_0x206ca1,null));};exports[_0x8b51('0xaa')]=function(_0x115346,_0x3ad3e5,_0x1e703a){return BPromise[_0x8b51('0xab')]()[_0x8b51('0x2c')](function(){if(!_0x115346[_0x8b51('0x3a')]['path']){throw new Error(_0x8b51('0x9e'));}if(!_0x115346[_0x8b51('0x3a')][_0x8b51('0x9f')]){throw new Error(_0x8b51('0xac'));}var _0x726cff=_0x115346[_0x8b51('0x3a')][_0x8b51('0xa0')]?_0x115346[_0x8b51('0x3a')][_0x8b51('0xa0')]+':'+_0x115346[_0x8b51('0x3a')][_0x8b51('0x9f')]:_0x8b51('0xa1')+_0x115346['query'][_0x8b51('0x9f')];var _0x2a51a9=_0x115346[_0x8b51('0x3a')]['json']?_0x115346[_0x8b51('0x3a')][_0x8b51('0x22')]:!![];var _0x263955=_0x115346[_0x8b51('0x3a')]['encoding']?_0x115346[_0x8b51('0x3a')][_0x8b51('0xa2')]:null;var _0x5a0dd4={'method':_0x115346['method'],'uri':util[_0x8b51('0x53')](_0x8b51('0xa4'),_0x726cff,_0x115346[_0x8b51('0x3a')][_0x8b51('0x7')]),'json':_0x2a51a9,'resolveWithFullResponse':!![],'encoding':_0x263955,'body':_0x115346[_0x8b51('0x92')]};if(_0x115346[_0x8b51('0xa5')]){_0x5a0dd4[_0x8b51('0xa5')]=_0x115346[_0x8b51('0xa5')];if(_0x5a0dd4[_0x8b51('0xa5')][_0x8b51('0xa6')]){delete _0x5a0dd4['headers'][_0x8b51('0xa6')];}}if(_0x5a0dd4['headers'][_0x8b51('0xa7')]){delete _0x5a0dd4[_0x8b51('0xa5')][_0x8b51('0xa7')];}return rp(_0x5a0dd4);})[_0x8b51('0x2c')](function(_0x5c4171){if(_0x5c4171){_0x3ad3e5[_0x8b51('0x27')](_0x5c4171[_0x8b51('0xa5')]);logger['info'](_0x5c4171[_0x8b51('0x92')]);return _0x3ad3e5[_0x8b51('0x20')](_0x5c4171[_0x8b51('0xa9')])['send'](_0x5c4171[_0x8b51('0x92')]);}else{return _0x3ad3e5['sendStatus'](0xc8);}})[_0x8b51('0x49')](handleError(_0x3ad3e5,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index eeb22f8..6470197 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 _0x5398=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x5398,0xe2));var _0x8539=function(_0x4efafa,_0x21c786){_0x4efafa=_0x4efafa-0x0;var _0x2c0007=_0x5398[_0x4efafa];return _0x2c0007;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x8539('0x0'))['db'][_0x8539('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x8539('0x2')](0x0);var events={'afterCreate':_0x8539('0x3'),'afterUpdate':_0x8539('0x4'),'afterDestroy':_0x8539('0x5')};function emitEvent(_0x27751){return function(_0x4e7787,_0x5ed870,_0x82ad80){PluginEvents[_0x8539('0x6')](_0x27751+':'+_0x4e7787['id'],_0x4e7787);PluginEvents[_0x8539('0x6')](_0x27751,_0x4e7787);_0x82ad80(null);};}for(var e in events){if(events[_0x8539('0x7')](e)){var event=events[e];Plugin[_0x8539('0x8')](e,emitEvent(event));}}module[_0x8539('0x9')]=PluginEvents; \ No newline at end of file +var _0x374c=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x20d8b4,_0x129cfc){var _0x4604d1=function(_0x2eefbd){while(--_0x2eefbd){_0x20d8b4['push'](_0x20d8b4['shift']());}};_0x4604d1(++_0x129cfc);}(_0x374c,0x1e3));var _0xc374=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x374c[_0x13ea00];return _0x1f7347;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xc374('0x0'))['db'][_0xc374('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xc374('0x2')](0x0);var events={'afterCreate':_0xc374('0x3'),'afterUpdate':_0xc374('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8d161e){return function(_0x534707,_0x1f68cf,_0x2561c0){PluginEvents['emit'](_0x8d161e+':'+_0x534707['id'],_0x534707);PluginEvents[_0xc374('0x5')](_0x8d161e,_0x534707);_0x2561c0(null);};}for(var e in events){if(events[_0xc374('0x6')](e)){var event=events[e];Plugin[_0xc374('0x7')](e,emitEvent(event));}}module[_0xc374('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9e44fc8..7d61847 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 _0xf583=['exports','define','plugins','lodash','util','api','request-promise','path','rimraf','./plugin.attributes'];(function(_0x1798cb,_0xe6a52c){var _0x275e17=function(_0x4f6b40){while(--_0x4f6b40){_0x1798cb['push'](_0x1798cb['shift']());}};_0x275e17(++_0xe6a52c);}(_0xf583,0x111));var _0x3f58=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xf583[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0x3f58('0x0'));var util=require(_0x3f58('0x1'));var logger=require('../../config/logger')(_0x3f58('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f58('0x3'));var fs=require('fs');var path=require(_0x3f58('0x4'));var rimraf=require(_0x3f58('0x5'));var config=require('../../config/environment');var attributes=require(_0x3f58('0x6'));module[_0x3f58('0x7')]=function(_0x250238,_0x23b4d7){return _0x250238[_0x3f58('0x8')]('Plugin',attributes,{'tableName':_0x3f58('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5af0=['moment','bluebird','request-promise','path','../../config/environment','exports','Plugin','lodash','util','../../config/logger','api'];(function(_0x554662,_0x4242b8){var _0x26621d=function(_0x593999){while(--_0x593999){_0x554662['push'](_0x554662['shift']());}};_0x26621d(++_0x4242b8);}(_0x5af0,0x1eb));var _0x05af=function(_0x1e0071,_0x195369){_0x1e0071=_0x1e0071-0x0;var _0x2f0418=_0x5af0[_0x1e0071];return _0x2f0418;};'use strict';var _=require(_0x05af('0x0'));var util=require(_0x05af('0x1'));var logger=require(_0x05af('0x2'))(_0x05af('0x3'));var moment=require(_0x05af('0x4'));var BPromise=require(_0x05af('0x5'));var rp=require(_0x05af('0x6'));var fs=require('fs');var path=require(_0x05af('0x7'));var rimraf=require('rimraf');var config=require(_0x05af('0x8'));var attributes=require('./plugin.attributes');module[_0x05af('0x9')]=function(_0x27a3e2,_0x2a8ef6){return _0x27a3e2['define'](_0x05af('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 46b4f82..ecb6cd5 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 _0xa724=['stringify','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','Plugin,\x20%s,\x20%s','message','catch','Plugin','create','options','raw','CreatePlugin'];(function(_0x5247f7,_0x1e8b71){var _0x5efb7a=function(_0x282db5){while(--_0x282db5){_0x5247f7['push'](_0x5247f7['shift']());}};_0x5efb7a(++_0x1e8b71);}(_0xa724,0xf1));var _0x4a72=function(_0x1a4d4a,_0x51aa24){_0x1a4d4a=_0x1a4d4a-0x0;var _0x2b753c=_0xa724[_0x1a4d4a];return _0x2b753c;};'use strict';var _=require(_0x4a72('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a72('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a72('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a72('0x3'));var logger=require(_0x4a72('0x4'))(_0x4a72('0x5'));var config=require(_0x4a72('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4a72('0x7')]['http']({'port':0x232a});config[_0x4a72('0x8')]=_[_0x4a72('0x9')](config[_0x4a72('0x8')],{'host':_0x4a72('0xa'),'port':0x18eb});var socket=require(_0x4a72('0xb'))(new Redis(config[_0x4a72('0x8')]));require(_0x4a72('0xc'))[_0x4a72('0xd')](socket);function respondWithRpcPromise(_0x31d686,_0x3e20a6,_0x327797){return new BPromise(function(_0x38d675,_0x569777){return client[_0x4a72('0xe')](_0x31d686,_0x327797)[_0x4a72('0xf')](function(_0x1105b5){logger[_0x4a72('0x10')]('Plugin,\x20%s,\x20%s',_0x3e20a6,_0x4a72('0x11'));logger[_0x4a72('0x12')](_0x4a72('0x13'),_0x3e20a6,_0x4a72('0x11'),JSON['stringify'](_0x1105b5));if(_0x1105b5['error']){if(_0x1105b5['error']['code']===0x1f4){logger[_0x4a72('0x14')](_0x4a72('0x15'),_0x3e20a6,_0x1105b5['error'][_0x4a72('0x16')]);return _0x569777(_0x1105b5[_0x4a72('0x14')]['message']);}logger[_0x4a72('0x14')](_0x4a72('0x15'),_0x3e20a6,_0x1105b5[_0x4a72('0x14')][_0x4a72('0x16')]);return _0x38d675(_0x1105b5[_0x4a72('0x14')][_0x4a72('0x16')]);}else{logger[_0x4a72('0x10')]('Plugin,\x20%s,\x20%s',_0x3e20a6,_0x4a72('0x11'));_0x38d675(_0x1105b5['result'][_0x4a72('0x16')]);}})[_0x4a72('0x17')](function(_0xf2bdd1){logger[_0x4a72('0x14')]('Plugin,\x20%s,\x20%s',_0x3e20a6,_0xf2bdd1);_0x569777(_0xf2bdd1);});});}exports['CreatePlugin']=function(_0x3b4676){var _0x155b3e=this;return new Promise(function(_0x22855d,_0x4acfec){return db[_0x4a72('0x18')][_0x4a72('0x19')](_0x3b4676['body'],{'raw':_0x3b4676[_0x4a72('0x1a')]?_0x3b4676[_0x4a72('0x1a')][_0x4a72('0x1b')]===undefined?!![]:![]:!![]})[_0x4a72('0xf')](function(_0x1f1ed1){logger[_0x4a72('0x10')](_0x4a72('0x1c'),_0x3b4676);logger['debug'](_0x4a72('0x1c'),_0x3b4676,JSON[_0x4a72('0x1d')](_0x1f1ed1));_0x22855d(_0x1f1ed1);})['catch'](function(_0xe891d7){logger[_0x4a72('0x14')](_0x4a72('0x1c'),_0xe891d7[_0x4a72('0x16')],_0x3b4676);_0x4acfec(_0x155b3e[_0x4a72('0x14')](0x1f4,_0xe891d7[_0x4a72('0x16')]));});});}; \ No newline at end of file +var _0xf55c=['error','message','result','catch','CreatePlugin','create','body','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','code'];(function(_0x46e9ed,_0x3c468a){var _0x591d3b=function(_0x758725){while(--_0x758725){_0x46e9ed['push'](_0x46e9ed['shift']());}};_0x591d3b(++_0x3c468a);}(_0xf55c,0x18a));var _0xcf55=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf55c[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xcf55('0x0'));var util=require(_0xcf55('0x1'));var moment=require(_0xcf55('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf55('0x3'));var fs=require('fs');var Redis=require(_0xcf55('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf55('0x5'));var logger=require('../../config/logger')(_0xcf55('0x6'));var config=require('../../config/environment');var jayson=require(_0xcf55('0x7'));var client=jayson[_0xcf55('0x8')][_0xcf55('0x9')]({'port':0x232a});config[_0xcf55('0xa')]=_[_0xcf55('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcf55('0xc'))(new Redis(config[_0xcf55('0xa')]));require(_0xcf55('0xd'))[_0xcf55('0xe')](socket);function respondWithRpcPromise(_0x6557ae,_0x2e4432,_0x33c0cd){return new BPromise(function(_0x399584,_0x33fe23){return client[_0xcf55('0xf')](_0x6557ae,_0x33c0cd)[_0xcf55('0x10')](function(_0x4adb69){logger[_0xcf55('0x11')](_0xcf55('0x12'),_0x2e4432,_0xcf55('0x13'));logger[_0xcf55('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x2e4432,_0xcf55('0x13'),JSON['stringify'](_0x4adb69));if(_0x4adb69['error']){if(_0x4adb69['error'][_0xcf55('0x15')]===0x1f4){logger[_0xcf55('0x16')](_0xcf55('0x12'),_0x2e4432,_0x4adb69['error'][_0xcf55('0x17')]);return _0x33fe23(_0x4adb69[_0xcf55('0x16')][_0xcf55('0x17')]);}logger[_0xcf55('0x16')](_0xcf55('0x12'),_0x2e4432,_0x4adb69['error'][_0xcf55('0x17')]);return _0x399584(_0x4adb69[_0xcf55('0x16')]['message']);}else{logger['info'](_0xcf55('0x12'),_0x2e4432,_0xcf55('0x13'));_0x399584(_0x4adb69[_0xcf55('0x18')][_0xcf55('0x17')]);}})[_0xcf55('0x19')](function(_0x374d2b){logger[_0xcf55('0x16')](_0xcf55('0x12'),_0x2e4432,_0x374d2b);_0x33fe23(_0x374d2b);});});}exports[_0xcf55('0x1a')]=function(_0x202b92){var _0x421369=this;return new Promise(function(_0x3c210e,_0x4ba0ad){return db['Plugin'][_0xcf55('0x1b')](_0x202b92[_0xcf55('0x1c')],{'raw':_0x202b92[_0xcf55('0x1d')]?_0x202b92['options'][_0xcf55('0x1e')]===undefined?!![]:![]:!![]})[_0xcf55('0x10')](function(_0x1364a3){logger[_0xcf55('0x11')](_0xcf55('0x1a'),_0x202b92);logger[_0xcf55('0x14')](_0xcf55('0x1a'),_0x202b92,JSON[_0xcf55('0x1f')](_0x1364a3));_0x3c210e(_0x1364a3);})[_0xcf55('0x19')](function(_0x556ad2){logger['error'](_0xcf55('0x1a'),_0x556ad2['message'],_0x202b92);_0x4ba0ad(_0x421369[_0xcf55('0x16')](0x1f4,_0x556ad2[_0xcf55('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 105b3f9..344843f 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 _0x6aba=['./plugin.events','save','remove','update','removeListener','register','plugin:'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x6aba,0x1ea));var _0xa6ab=function(_0x10e207,_0x5f3c52){_0x10e207=_0x10e207-0x0;var _0x439d5a=_0x6aba[_0x10e207];return _0x439d5a;};'use strict';var PluginEvents=require(_0xa6ab('0x0'));var events=[_0xa6ab('0x1'),_0xa6ab('0x2'),_0xa6ab('0x3')];function createListener(_0x4b6acb,_0x4ccf64){return function(_0x52a8d9){_0x4ccf64['emit'](_0x4b6acb,_0x52a8d9);};}function removeListener(_0x47a872,_0x3e6016){return function(){PluginEvents[_0xa6ab('0x4')](_0x47a872,_0x3e6016);};}exports[_0xa6ab('0x5')]=function(_0xf4624b){for(var _0x4055e0=0x0,_0x16d0d4=events['length'];_0x4055e0<_0x16d0d4;_0x4055e0++){var _0x5e8978=events[_0x4055e0];var _0x523929=createListener(_0xa6ab('0x6')+_0x5e8978,_0xf4624b);PluginEvents['on'](_0x5e8978,_0x523929);}}; \ No newline at end of file +var _0x8740=['plugin:','./plugin.events','save','remove','update','emit','removeListener','register'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x8740,0x171));var _0x0874=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x8740[_0x27af45];return _0x18df21;};'use strict';var PluginEvents=require(_0x0874('0x0'));var events=[_0x0874('0x1'),_0x0874('0x2'),_0x0874('0x3')];function createListener(_0x4cce85,_0x5b8b35){return function(_0x2e366d){_0x5b8b35[_0x0874('0x4')](_0x4cce85,_0x2e366d);};}function removeListener(_0x11656d,_0x1277c2){return function(){PluginEvents[_0x0874('0x5')](_0x11656d,_0x1277c2);};}exports[_0x0874('0x6')]=function(_0x40a6fb){for(var _0x1f98c0=0x0,_0x1cb052=events['length'];_0x1f98c0<_0x1cb052;_0x1f98c0++){var _0x9dc9b7=events[_0x1f98c0];var _0x575d01=createListener(_0x0874('0x7')+_0x9dc9b7,_0x40a6fb);PluginEvents['on'](_0x9dc9b7,_0x575d01);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 5b9fb38..07160f6 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(_0x448ec7,_0x5c3f72){var _0x234108=function(_0x451004){while(--_0x451004){_0x448ec7['push'](_0x448ec7['shift']());}};_0x234108(++_0x5c3f72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x7ea8c,_0x3e0bba){var _0x57117b=function(_0x3a4b53){while(--_0x3a4b53){_0x7ea8c['push'](_0x7ea8c['shift']());}};_0x57117b(++_0x3e0bba);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 c3d1a98..0471828 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 _0xe5b5=['../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','show','describe','catch','body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2'];(function(_0x419c75,_0x387ee3){var _0x4554f0=function(_0x17a03a){while(--_0x17a03a){_0x419c75['push'](_0x419c75['shift']());}};_0x4554f0(++_0x387ee3);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0xe5b5[_0x51e79c];return _0x2467be;};'use strict';var _=require(_0x5e5b('0x0'));var pm2=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var path=require(_0x5e5b('0x4'));var exec=require(_0x5e5b('0x5'))[_0x5e5b('0x6')];var BPromise=require(_0x5e5b('0x7'));function handleEntityNotFound(_0xf20c6a,_0x20a50c){return function(_0xdc6616){if(!_0xdc6616){_0xf20c6a[_0x5e5b('0x8')](0x194);;}return _0xdc6616;};}function respondWithResult(_0xf1fbe2,_0x11e0e0){_0x11e0e0=_0x11e0e0||0xc8;return function(_0x545eb3){if(_0x545eb3){return _0xf1fbe2[_0x5e5b('0x9')](_0x11e0e0)[_0x5e5b('0xa')](_0x545eb3);}return null;};}function handleError(_0xcbd478,_0x258414){_0x258414=_0x258414||0x1f4;return function(_0xb9d72b){logger[_0x5e5b('0xb')](_0xb9d72b[_0x5e5b('0xc')]);if(_0xb9d72b[_0x5e5b('0xd')]){delete _0xb9d72b['name'];}_0xcbd478[_0x5e5b('0x9')](_0x258414)['send'](_0xb9d72b);};}function execChildProcess(){return new BPromise(function(_0x108c34,_0x58185){exec(_0x5e5b('0xe'),function(_0x3f64b6,_0x55c974,_0x4a1424){logger['info'](_0x55c974);logger[_0x5e5b('0xf')](_0x4a1424);if(_0x3f64b6){logger[_0x5e5b('0xb')](_0x3f64b6);return _0x58185(_0x3f64b6);}return _0x108c34(_0x55c974);});});}exports[_0x5e5b('0x10')]=function(_0x1694ff,_0x13a01e){return pm2[_0x5e5b('0x11')]()[_0x5e5b('0x12')](function(_0x49edd0){if(_0x49edd0){var _0x2b37fa=_[_0x5e5b('0x13')](_0x49edd0,function(_0x4ff37b){return _0x4ff37b[_0x5e5b('0xd')]==='express'||_0x4ff37b['name']===_0x5e5b('0x14');});return{'rows':_0x2b37fa,'count':_0x2b37fa[_0x5e5b('0x15')]};}return null;})[_0x5e5b('0x12')](respondWithResult(_0x13a01e,null))['catch'](handleError(_0x13a01e,null));};exports[_0x5e5b('0x16')]=function(_0x4d490c,_0x1796af){return pm2[_0x5e5b('0x17')](_0x4d490c['params']['id'])[_0x5e5b('0x12')](respondWithResult(_0x1796af,null))[_0x5e5b('0x12')](handleEntityNotFound(_0x1796af,null))[_0x5e5b('0x18')](handleError(_0x1796af,null));};exports['create']=function(_0x2bf0b7,_0x3f1103){if(_0x2bf0b7['body'][_0x5e5b('0xd')]&&_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]){var _0x2d8252=path[_0x5e5b('0x1b')](__dirname,_0x5e5b('0x1c'),_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0x1a')]);var _0x4a78e3=process['cwd']();process[_0x5e5b('0x1d')](path[_0x5e5b('0x1e')](_0x2d8252));return execChildProcess()[_0x5e5b('0x12')](function(_0xe1c268){process[_0x5e5b('0x1d')](_0x4a78e3);return pm2[_0x5e5b('0x1f')]({'name':_0x2bf0b7[_0x5e5b('0x19')][_0x5e5b('0xd')],'script':_0x2d8252});})[_0x5e5b('0x12')](function(_0x26bc02){pm2[_0x5e5b('0x20')]();return _0x26bc02[0x0];})['then'](respondWithResult(_0x3f1103,0xc9))[_0x5e5b('0x18')](handleError(_0x3f1103,null));}else{return _0x3f1103[_0x5e5b('0x9')](0x1f4)[_0x5e5b('0x21')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5e5b('0x22')]=function(_0xdb2863,_0x5ee866){if(_0xdb2863[_0x5e5b('0x19')]['id']){delete _0xdb2863[_0x5e5b('0x19')]['id'];}var _0x39ce16={'online':_0x5e5b('0x23'),'stopped':_0x5e5b('0x24')};if(_0x39ce16[_0x5e5b('0x25')](_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')])){return pm2[_0x39ce16[_0xdb2863[_0x5e5b('0x19')][_0x5e5b('0x9')]]](_0xdb2863[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](respondWithResult(_0x5ee866,0xc8))['catch'](handleError(_0x5ee866,null));}else{return _0x5ee866['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x27')});}};exports[_0x5e5b('0x28')]=function(_0x3dcdab,_0x12f1ee){if(_0x3dcdab['body']['id']){delete _0x3dcdab[_0x5e5b('0x19')]['id'];}if(_0x3dcdab['params']['id']){return pm2[_0x5e5b('0x29')](_0x3dcdab[_0x5e5b('0x26')]['id'])[_0x5e5b('0x12')](function(_0xc2bc09){pm2['dump']();return _0xc2bc09[0x0];})[_0x5e5b('0x12')](respondWithResult(_0x12f1ee,null))[_0x5e5b('0x18')](handleError(_0x12f1ee,null));}else{return _0x12f1ee['status'](0x1f4)[_0x5e5b('0x21')]({'message':_0x5e5b('0x2a')});}}; \ No newline at end of file +var _0x55e0=['hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','name','status','send','info','index','then','reject','express','motion2','catch','show','params','body','script','join','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x55e0,0xdc));var _0x055e=function(_0xe886fa,_0x5a2f45){_0xe886fa=_0xe886fa-0x0;var _0xf40f=_0x55e0[_0xe886fa];return _0xf40f;};'use strict';var _=require(_0x055e('0x0'));var pm2=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var path=require('path');var exec=require('child_process')[_0x055e('0x4')];var BPromise=require(_0x055e('0x5'));function handleEntityNotFound(_0x33cd7b,_0x2773e4){return function(_0x157473){if(!_0x157473){_0x33cd7b[_0x055e('0x6')](0x194);;}return _0x157473;};}function respondWithResult(_0x490ee1,_0x5239f6){_0x5239f6=_0x5239f6||0xc8;return function(_0x4384ff){if(_0x4384ff){return _0x490ee1['status'](_0x5239f6)[_0x055e('0x7')](_0x4384ff);}return null;};}function handleError(_0x3c4cf,_0x376618){_0x376618=_0x376618||0x1f4;return function(_0x230c32){logger[_0x055e('0x8')](_0x230c32['stack']);if(_0x230c32[_0x055e('0x9')]){delete _0x230c32[_0x055e('0x9')];}_0x3c4cf[_0x055e('0xa')](_0x376618)[_0x055e('0xb')](_0x230c32);};}function execChildProcess(){return new BPromise(function(_0x238068,_0x5237d9){exec('npm\x20install',function(_0x187cce,_0x51c524,_0x3c44b2){logger[_0x055e('0xc')](_0x51c524);logger[_0x055e('0xc')](_0x3c44b2);if(_0x187cce){logger[_0x055e('0x8')](_0x187cce);return _0x5237d9(_0x187cce);}return _0x238068(_0x51c524);});});}exports[_0x055e('0xd')]=function(_0x31c649,_0x236a2b){return pm2['list']()[_0x055e('0xe')](function(_0xb80d83){if(_0xb80d83){var _0x3cfd14=_[_0x055e('0xf')](_0xb80d83,function(_0x222817){return _0x222817['name']===_0x055e('0x10')||_0x222817[_0x055e('0x9')]===_0x055e('0x11');});return{'rows':_0x3cfd14,'count':_0x3cfd14['length']};}return null;})[_0x055e('0xe')](respondWithResult(_0x236a2b,null))[_0x055e('0x12')](handleError(_0x236a2b,null));};exports[_0x055e('0x13')]=function(_0x2bad86,_0x2cc84e){return pm2['describe'](_0x2bad86[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x2cc84e,null))[_0x055e('0xe')](handleEntityNotFound(_0x2cc84e,null))[_0x055e('0x12')](handleError(_0x2cc84e,null));};exports['create']=function(_0x4004ce,_0x3cdd68){if(_0x4004ce['body'][_0x055e('0x9')]&&_0x4004ce[_0x055e('0x15')][_0x055e('0x16')]){var _0x124d86=path[_0x055e('0x17')](__dirname,_0x055e('0x18'),_0x4004ce['body'][_0x055e('0x16')]);var _0x2f0346=process[_0x055e('0x19')]();process['chdir'](path[_0x055e('0x1a')](_0x124d86));return execChildProcess()[_0x055e('0xe')](function(_0x32c64e){process[_0x055e('0x1b')](_0x2f0346);return pm2['start']({'name':_0x4004ce[_0x055e('0x15')]['name'],'script':_0x124d86});})[_0x055e('0xe')](function(_0x42a6aa){pm2[_0x055e('0x1c')]();return _0x42a6aa[0x0];})[_0x055e('0xe')](respondWithResult(_0x3cdd68,0xc9))[_0x055e('0x12')](handleError(_0x3cdd68,null));}else{return _0x3cdd68[_0x055e('0xa')](0x1f4)['send']({'message':_0x055e('0x1d')});}};exports[_0x055e('0x1e')]=function(_0x2a82f8,_0x4b5891){if(_0x2a82f8[_0x055e('0x15')]['id']){delete _0x2a82f8[_0x055e('0x15')]['id'];}var _0x42f2df={'online':_0x055e('0x1f'),'stopped':'stop'};if(_0x42f2df[_0x055e('0x20')](_0x2a82f8['body'][_0x055e('0xa')])){return pm2[_0x42f2df[_0x2a82f8[_0x055e('0x15')][_0x055e('0xa')]]](_0x2a82f8[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x4b5891,0xc8))['catch'](handleError(_0x4b5891,null));}else{return _0x4b5891[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':_0x055e('0x21')});}};exports[_0x055e('0x22')]=function(_0x36abb2,_0x225c88){if(_0x36abb2[_0x055e('0x15')]['id']){delete _0x36abb2[_0x055e('0x15')]['id'];}if(_0x36abb2['params']['id']){return pm2[_0x055e('0x23')](_0x36abb2[_0x055e('0x14')]['id'])['then'](function(_0xd9298d){pm2[_0x055e('0x1c')]();return _0xd9298d[0x0];})[_0x055e('0xe')](respondWithResult(_0x225c88,null))[_0x055e('0x12')](handleError(_0x225c88,null));}else{return _0x225c88[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index a042648..6085f9b 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 _0x7863=['get','getAgents','isAuthenticated','getQueues','exports','express','./realtime.controller'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7863,0x1e8));var _0x3786=function(_0x215863,_0x44609a){_0x215863=_0x215863-0x0;var _0x4d5f5c=_0x7863[_0x215863];return _0x4d5f5c;};'use strict';var express=require(_0x3786('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x3786('0x1'));router[_0x3786('0x2')]('/agents',auth['isAuthenticated'](),controller[_0x3786('0x3')]);router['get']('/queues',auth[_0x3786('0x4')](),controller[_0x3786('0x5')]);module[_0x3786('0x6')]=router; \ No newline at end of file +var _0xf69a=['getAgents','get','getQueues','Router','./realtime.controller','/agents','isAuthenticated'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf69a,0x106));var _0xaf69=function(_0x18b0a1,_0x535aac){_0x18b0a1=_0x18b0a1-0x0;var _0x55005a=_0xf69a[_0x18b0a1];return _0x55005a;};'use strict';var express=require('express');var router=express[_0xaf69('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xaf69('0x1'));router['get'](_0xaf69('0x2'),auth[_0xaf69('0x3')](),controller[_0xaf69('0x4')]);router[_0xaf69('0x5')]('/queues',auth[_0xaf69('0x3')](),controller[_0xaf69('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 9b50683..3384c69 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 _0x3176=['sort','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','map','agent','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','role','Agents','online','assign','findAndCountAll','find','filterAgentAttributes','merge','globalStatus','includes','voice','voiceStatus','talking','getRealtimeAgentsQueryFields','pick','catch','getQueues','startCase','Queue','rawAttributes','fieldName','type','key','name','outbound','dialMethod','QueueCampaigns','Queues','filter','UserProfile','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','undefined','limit','count','offset','status','set','Content-Range','json','getChannels','query','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase'];(function(_0x24333d,_0x41bfce){var _0x3bd2c3=function(_0x5d153c){while(--_0x5d153c){_0x24333d['push'](_0x24333d['shift']());}};_0x3bd2c3(++_0x41bfce);}(_0x3176,0xda));var _0x6317=function(_0x3d5eb2,_0x37408b){_0x3d5eb2=_0x3d5eb2-0x0;var _0x5eab27=_0x3176[_0x3d5eb2];return _0x5eab27;};'use strict';var _=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var rta=require(_0x6317('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0x6317('0x3'));var utils=require('../../config/utils');var db=require(_0x6317('0x4'))['db'];var APIBadRequestError=require(_0x6317('0x5'))[_0x6317('0x6')];var APIHandleError=require(_0x6317('0x5'))['handleError'];function respondWithFilteredResult(_0x11ce87,_0x3e7a66){return function(_0x468fb1){if(_0x468fb1){var _0x272522=typeof _0x3e7a66['offset']===_0x6317('0x7')&&typeof _0x3e7a66[_0x6317('0x8')]==='undefined';var _0x3e0015=_0x468fb1[_0x6317('0x9')];var _0x3be605=_0x272522?0x0:_0x3e7a66[_0x6317('0xa')];var _0x17d27f=_0x272522?_0x468fb1['count']:_0x3e7a66[_0x6317('0xa')]+_0x3e7a66[_0x6317('0x8')];var _0x572b2f;if(_0x17d27f>=_0x3e0015){_0x17d27f=_0x3e0015;_0x572b2f=0xc8;}else{_0x572b2f=0xce;}_0x11ce87[_0x6317('0xb')](_0x572b2f);return _0x11ce87[_0x6317('0xc')](_0x6317('0xd'),_0x3be605+'-'+_0x17d27f+'/'+_0x3e0015)[_0x6317('0xe')](_0x468fb1);}return null;};}exports['getAgents']=function(_0x1ac7c1,_0x22ec3d){var _0x3936f5={'count':0x0,'rows':[]};var _0x5ceae1={};var _0x352064;var _0x3b7dda=utils[_0x6317('0xf')]();var _0x18d00e;var _0x38d717;var _0x2b2334=_0x1ac7c1[_0x6317('0x10')]['globalQueueFilter'];var _0xd83142=_0x1ac7c1[_0x6317('0x10')][_0x6317('0x11')];var _0x598772=_0x1ac7c1[_0x6317('0x10')][_0x6317('0x12')];var _0x2ff138=_0xd83142===_0x6317('0x13')||_0xd83142===_0x6317('0x14')?!![]:![];var _0x8cd67d=[];var _0x147c5c;var _0x25c287;Promise[_0x6317('0x15')]()[_0x6317('0x16')](function(){if(_0x1ac7c1['query'][_0x6317('0x17')]){if(!utils[_0x6317('0x18')](_0x1ac7c1[_0x6317('0x10')][_0x6317('0x17')])){throw new APIBadRequestError(util[_0x6317('0x19')](_0x6317('0x1a'),_0x1ac7c1['query'][_0x6317('0x17')]));}_0x352064=_0x1ac7c1[_0x6317('0x10')][_0x6317('0x17')][_0x6317('0x1b')]();}if(!_0x1ac7c1[_0x6317('0x10')][_0x6317('0x1c')]||!_0x1ac7c1[_0x6317('0x10')][_0x6317('0x1c')]['includes']('globalStatus')){_0x1ac7c1[_0x6317('0x10')][_0x6317('0x1c')]=rta['validateSortParameter'](_0x1ac7c1['query']['sort']);return;}var _0x1eb7d2=rta[_0x6317('0x1d')](_0x1ac7c1['query'][_0x6317('0x1c')]);_0x1ac7c1[_0x6317('0x10')]['sort']=_0x1eb7d2[_0x6317('0x1e')][_0x6317('0x1f')](',');_0x147c5c=_0x1eb7d2[_0x6317('0x20')];})[_0x6317('0x16')](function(){if(!_0x2b2334){return[];}return rta[_0x6317('0x21')](_0x2b2334,_0x352064);})[_0x6317('0x16')](function(_0x16fac4){_0x8cd67d=_0x16fac4;return rta['getRealtimeAgents']();})[_0x6317('0x16')](function(_0x43eb69){_0x38d717=_0x43eb69[_0x6317('0x22')];if((!_0xd83142||_0x2ff138)&&!_0x147c5c){return _0x8cd67d;}if(_0x147c5c&&!_0xd83142){return rta[_0x6317('0x23')](_0x38d717,_0x8cd67d,_0x147c5c);}else{return rta['getAgentIdsByStatus'](_0x38d717,_0x8cd67d,_0xd83142);}})[_0x6317('0x16')](function(_0x323f78){_0x8cd67d=_0x323f78;var _0x5e19ff=![];if(_0x8cd67d[_0x6317('0x24')]===0x0){if(_0x2b2334||_0xd83142){_0x5e19ff=!![];}if(_0x2ff138){_0x5e19ff=![];}}if(_0x5e19ff){return _0x3936f5;}var _0xbf3b3e=_[_0x6317('0x25')](db['User']['rawAttributes'],function(_0x3ddfaf){return{'name':_0x3ddfaf['fieldName'],'type':_0x3ddfaf['type']['key']};});_0x1ac7c1[_0x6317('0x10')]['role']=_0x6317('0x26');_0x5ceae1=qs[_0x6317('0x27')](_0xbf3b3e,_0x1ac7c1);_0x5ceae1[_0x6317('0x28')]=!![];var _0x194c53=[];if(_0x8cd67d[_0x6317('0x24')]>0x0){_0x194c53[_0x6317('0x29')]({'id':{'$in':_0x8cd67d}});if(_0x147c5c&&!_0xd83142){_0x25c287=[db[_0x6317('0x2a')][_0x6317('0x2b')](_0x6317('0x2c')+_0x8cd67d+')')];_0x5ceae1[_0x6317('0x20')]=_0x25c287;}}if(_0x2ff138){_0x3b7dda['forEach'](function(_0x42d1fd){var _0x54edb1=!![];if(_0xd83142==='*pause'&&_0x352064!==_0x42d1fd){_0x54edb1=![];}_0x194c53['push']({[_0x42d1fd+'Pause']:_0x54edb1});});if(_0x598772){_0x194c53['push']({'pauseType':_0x598772});}}else if(_0xd83142){_0x3b7dda[_0x6317('0x2d')](function(_0x43396a){_0x194c53['push']({[_0x43396a+_0x6317('0x2e')]:![]});});}_0x5ceae1[_0x6317('0x2f')]=_['merge'](_0x5ceae1[_0x6317('0x2f')],{'$and':_0x194c53});if(_0x1ac7c1[_0x6317('0x30')][_0x6317('0x31')]===_0x6317('0x30')){var _0x48b348={'params':{'id':_0x1ac7c1['user']['userProfileId']},'query':{'section':_0x6317('0x32'),'role':_0x6317('0x26'),'raw':!![],'ids':_0x8cd67d,'customSorting':_0x25c287}};if(_0x1ac7c1[_0x6317('0x10')][_0x6317('0x33')]){_0x48b348[_0x6317('0x10')][_0x6317('0x33')]=!![];}if(_0x2ff138){_0x48b348[_0x6317('0x10')]['extraQueryConditions']=_0x194c53;}_0x48b348[_0x6317('0x10')]=Object[_0x6317('0x34')](_0x48b348[_0x6317('0x10')],_0x1ac7c1[_0x6317('0x10')]);return db['UserProfile']['getResources'](_0x48b348);}return db['User'][_0x6317('0x35')](_0x5ceae1);})['then'](function(_0x3c3558){_0x3936f5[_0x6317('0x9')]=_0x3c3558[_0x6317('0x9')];_0x18d00e=_0x3c3558['rows'];return _0x18d00e[_0x6317('0x25')](function(_0x86ba2d){var _0x53b020=_[_0x6317('0x36')](_0x38d717,['id',_0x86ba2d['id']]);if(_0x53b020){var _0x2c6208=rta[_0x6317('0x37')](_0x53b020);_[_0x6317('0x38')](_0x86ba2d,_0x2c6208);}_0x86ba2d['globalStatus']=rta['getAgentStatus'](_0x86ba2d);if(_0x86ba2d[_0x6317('0x39')][_0x6317('0x3a')]('pause')){_0x3b7dda[_0x6317('0x2d')](function(_0x37bba6){if(_0x86ba2d[_0x37bba6+_0x6317('0x2e')]){if(_0x37bba6===_0x6317('0x3b')){if(_0x86ba2d[_0x6317('0x3c')]!==_0x6317('0x3d')){_0x86ba2d[_0x6317('0x3c')]=_0x6317('0x13');}}else{_0x86ba2d[_0x37bba6+'Status']=_0x6317('0x13');}}});}return _0x86ba2d;});})['then'](function(_0x494394){if(!_0x147c5c||_0x25c287){return _0x494394;}return rta['sortAgentsByStatus'](_0x494394,_0x147c5c);})[_0x6317('0x16')](function(_0x27a1b5){var _0x3b43f3=rta[_0x6317('0x3e')]();_0x3936f5[_0x6317('0x22')]=_0x27a1b5['map'](function(_0x17f47e){return _[_0x6317('0x3f')](_0x17f47e,_0x3b43f3);});return _0x3936f5;})[_0x6317('0x16')](respondWithFilteredResult(_0x22ec3d,_0x5ceae1))[_0x6317('0x40')](APIHandleError(_0x22ec3d));};exports[_0x6317('0x41')]=function(_0x12f308,_0x100cfa){var _0x290414={'count':0x0,'rows':[]};var _0x57c593={};var _0x557ccd;var _0x1ed538;var _0x4ad427;Promise['resolve']()[_0x6317('0x16')](function(){if(_0x12f308[_0x6317('0x10')][_0x6317('0x17')]){if(!utils['isValidChannel'](_0x12f308['query'][_0x6317('0x17')])){throw new APIBadRequestError(util[_0x6317('0x19')](_0x6317('0x1a'),_0x12f308['query']['channel']));}_0x557ccd=_0x12f308['query'][_0x6317('0x17')][_0x6317('0x1b')]();}var _0x484a3a=_[_0x6317('0x42')](_0x557ccd)+_0x6317('0x43');var _0x10f6b1=_[_0x6317('0x25')](db[_0x484a3a][_0x6317('0x44')],function(_0x1e7ea8){return{'name':_0x1e7ea8[_0x6317('0x45')],'type':_0x1e7ea8[_0x6317('0x46')][_0x6317('0x47')]};});if(!_0x12f308[_0x6317('0x10')][_0x6317('0x1e')]){var _0x19619f=['id',_0x6317('0x48')];if(_0x557ccd===_0x6317('0x3b')){_0x19619f[_0x6317('0x29')](_0x6317('0x46'));if(_0x12f308[_0x6317('0x10')][_0x6317('0x46')]===_0x6317('0x49')){_0x19619f[_0x6317('0x29')](['dialActive',_0x6317('0x4a')]);}}_0x12f308['query'][_0x6317('0x1e')]=_0x19619f[_0x6317('0x1f')](',');}_0x57c593=qs['getOptions'](_0x10f6b1,_0x12f308);if(_0x12f308['user']['role']===_0x6317('0x30')){var _0x56bdc9={'params':{'id':_0x12f308[_0x6317('0x30')]['userProfileId']},'query':{'section':_0x557ccd==='voice'&&_0x12f308[_0x6317('0x10')][_0x6317('0x46')]===_0x6317('0x49')?_0x6317('0x4b'):_[_0x6317('0x42')](_0x557ccd)+_0x6317('0x4c'),'type':_0x12f308[_0x6317('0x10')][_0x6317('0x46')],'nolimit':!![],'sort':_0x6317('0x48'),'filter':_0x12f308['query'][_0x6317('0x4d')]}};_0x56bdc9[_0x6317('0x10')]=Object[_0x6317('0x34')](_0x56bdc9[_0x6317('0x10')],_0x12f308[_0x6317('0x10')]);delete _0x56bdc9['query']['id'];return db[_0x6317('0x4e')][_0x6317('0x4f')](_0x56bdc9);}return db[_0x484a3a][_0x6317('0x35')](_0x57c593);})[_0x6317('0x16')](function(_0x308c13){_0x290414[_0x6317('0x9')]=_0x308c13['count'];_0x1ed538=_0x308c13[_0x6317('0x22')];return rtq[_0x6317('0x50')](_0x12f308,_0x557ccd);})[_0x6317('0x16')](function(_0x92503a){_0x4ad427=_0x92503a[_0x6317('0x22')];return rtq[_0x6317('0x51')](_0x1ed538,_0x4ad427,_0x557ccd,_0x12f308[_0x6317('0x10')][_0x6317('0x46')]);})['then'](function(_0x5f5741){_0x290414['rows']=_0x5f5741;return _0x290414;})['then'](respondWithFilteredResult(_0x100cfa,_0x57c593))['catch'](APIHandleError(_0x100cfa));}; \ No newline at end of file +var _0x56d5=['getQueues','resolve','format','Channel\x20parameter\x20%s\x20is\x20invalid','Queue','rawAttributes','key','name','voice','dialMethod','join','QueueCampaigns','startCase','Queues','filter','UserProfile','getRealtimeQueues','initializeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','limit','undefined','offset','count','json','query','globalQueueFilter','globalStatusFilter','pause','*pause','then','channel','isValidChannel','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','fieldName','type','role','agent','getOptions','raw','length','push','sequelize','literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','getResources','findAndCountAll','rows','find','filterAgentAttributes','getAgentStatus','talking','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch'];(function(_0x51f42c,_0x35889f){var _0x13ef7d=function(_0x368796){while(--_0x368796){_0x51f42c['push'](_0x51f42c['shift']());}};_0x13ef7d(++_0x35889f);}(_0x56d5,0xbe));var _0x556d=function(_0x14b688,_0x54013a){_0x14b688=_0x14b688-0x0;var _0x57e00b=_0x56d5[_0x14b688];return _0x57e00b;};'use strict';var _=require(_0x556d('0x0'));var util=require('util');var rta=require(_0x556d('0x1'));var rtq=require(_0x556d('0x2'));var qs=require(_0x556d('0x3'));var utils=require(_0x556d('0x4'));var db=require(_0x556d('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0x556d('0x6')];var APIHandleError=require(_0x556d('0x7'))['handleError'];function respondWithFilteredResult(_0x538374,_0x58d6a7){return function(_0x2b7baf){if(_0x2b7baf){var _0x100178=typeof _0x58d6a7['offset']==='undefined'&&typeof _0x58d6a7[_0x556d('0x8')]===_0x556d('0x9');var _0x5bc37e=_0x2b7baf['count'];var _0x30b08f=_0x100178?0x0:_0x58d6a7[_0x556d('0xa')];var _0x305981=_0x100178?_0x2b7baf[_0x556d('0xb')]:_0x58d6a7[_0x556d('0xa')]+_0x58d6a7[_0x556d('0x8')];var _0x59c594;if(_0x305981>=_0x5bc37e){_0x305981=_0x5bc37e;_0x59c594=0xc8;}else{_0x59c594=0xce;}_0x538374['status'](_0x59c594);return _0x538374['set']('Content-Range',_0x30b08f+'-'+_0x305981+'/'+_0x5bc37e)[_0x556d('0xc')](_0x2b7baf);}return null;};}exports['getAgents']=function(_0x1a12dc,_0x1f9c37){var _0x2be02d={'count':0x0,'rows':[]};var _0x5e33c9={};var _0xed7e06;var _0x2ccf17=utils['getChannels']();var _0x17b273;var _0x2efbb9;var _0x22aaed=_0x1a12dc[_0x556d('0xd')][_0x556d('0xe')];var _0x224e91=_0x1a12dc[_0x556d('0xd')][_0x556d('0xf')];var _0x337e5a=_0x1a12dc[_0x556d('0xd')]['pauseTypeFilter'];var _0x999c40=_0x224e91===_0x556d('0x10')||_0x224e91===_0x556d('0x11')?!![]:![];var _0x37936f=[];var _0x5a8762;var _0x3dd2c9;Promise['resolve']()[_0x556d('0x12')](function(){if(_0x1a12dc[_0x556d('0xd')][_0x556d('0x13')]){if(!utils[_0x556d('0x14')](_0x1a12dc[_0x556d('0xd')][_0x556d('0x13')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1a12dc['query'][_0x556d('0x13')]));}_0xed7e06=_0x1a12dc[_0x556d('0xd')][_0x556d('0x13')][_0x556d('0x15')]();}if(!_0x1a12dc[_0x556d('0xd')][_0x556d('0x16')]||!_0x1a12dc[_0x556d('0xd')][_0x556d('0x16')][_0x556d('0x17')](_0x556d('0x18'))){_0x1a12dc[_0x556d('0xd')][_0x556d('0x16')]=rta[_0x556d('0x19')](_0x1a12dc['query'][_0x556d('0x16')]);return;}var _0x5927a4=rta[_0x556d('0x1a')](_0x1a12dc[_0x556d('0xd')][_0x556d('0x16')]);_0x1a12dc[_0x556d('0xd')]['sort']=_0x5927a4[_0x556d('0x1b')]['join'](',');_0x5a8762=_0x5927a4[_0x556d('0x1c')];})[_0x556d('0x12')](function(){if(!_0x22aaed){return[];}return rta[_0x556d('0x1d')](_0x22aaed,_0xed7e06);})[_0x556d('0x12')](function(_0x5cddb0){_0x37936f=_0x5cddb0;return rta['getRealtimeAgents']();})[_0x556d('0x12')](function(_0x34c7f9){_0x2efbb9=_0x34c7f9['rows'];if((!_0x224e91||_0x999c40)&&!_0x5a8762){return _0x37936f;}if(_0x5a8762&&!_0x224e91){return rta[_0x556d('0x1e')](_0x2efbb9,_0x37936f,_0x5a8762);}else{return rta[_0x556d('0x1f')](_0x2efbb9,_0x37936f,_0x224e91);}})[_0x556d('0x12')](function(_0x192257){_0x37936f=_0x192257;var _0x5895b4=![];if(_0x37936f['length']===0x0){if(_0x22aaed||_0x224e91){_0x5895b4=!![];}if(_0x999c40){_0x5895b4=![];}}if(_0x5895b4){return _0x2be02d;}var _0x19894d=_[_0x556d('0x20')](db[_0x556d('0x21')]['rawAttributes'],function(_0x3a93d1){return{'name':_0x3a93d1[_0x556d('0x22')],'type':_0x3a93d1[_0x556d('0x23')]['key']};});_0x1a12dc[_0x556d('0xd')][_0x556d('0x24')]=_0x556d('0x25');_0x5e33c9=qs[_0x556d('0x26')](_0x19894d,_0x1a12dc);_0x5e33c9[_0x556d('0x27')]=!![];var _0x3f099f=[];if(_0x37936f[_0x556d('0x28')]>0x0){_0x3f099f[_0x556d('0x29')]({'id':{'$in':_0x37936f}});if(_0x5a8762&&!_0x224e91){_0x3dd2c9=[db[_0x556d('0x2a')][_0x556d('0x2b')](_0x556d('0x2c')+_0x37936f+')')];_0x5e33c9[_0x556d('0x1c')]=_0x3dd2c9;}}if(_0x999c40){_0x2ccf17[_0x556d('0x2d')](function(_0x5f240b){var _0x1f3e8d=!![];if(_0x224e91===_0x556d('0x11')&&_0xed7e06!==_0x5f240b){_0x1f3e8d=![];}_0x3f099f[_0x556d('0x29')]({[_0x5f240b+_0x556d('0x2e')]:_0x1f3e8d});});if(_0x337e5a){_0x3f099f[_0x556d('0x29')]({'pauseType':_0x337e5a});}}else if(_0x224e91){_0x2ccf17['forEach'](function(_0x29e94a){_0x3f099f[_0x556d('0x29')]({[_0x29e94a+_0x556d('0x2e')]:![]});});}_0x5e33c9[_0x556d('0x2f')]=_[_0x556d('0x30')](_0x5e33c9[_0x556d('0x2f')],{'$and':_0x3f099f});if(_0x1a12dc['user'][_0x556d('0x24')]==='user'){var _0x403e9c={'params':{'id':_0x1a12dc[_0x556d('0x31')][_0x556d('0x32')]},'query':{'section':_0x556d('0x33'),'role':'agent','raw':!![],'ids':_0x37936f,'customSorting':_0x3dd2c9}};if(_0x1a12dc[_0x556d('0xd')][_0x556d('0x34')]){_0x403e9c[_0x556d('0xd')][_0x556d('0x34')]=!![];}if(_0x999c40){_0x403e9c['query'][_0x556d('0x35')]=_0x3f099f;}_0x403e9c[_0x556d('0xd')]=Object[_0x556d('0x36')](_0x403e9c['query'],_0x1a12dc[_0x556d('0xd')]);return db['UserProfile'][_0x556d('0x37')](_0x403e9c);}return db[_0x556d('0x21')][_0x556d('0x38')](_0x5e33c9);})[_0x556d('0x12')](function(_0x33bdd9){_0x2be02d[_0x556d('0xb')]=_0x33bdd9[_0x556d('0xb')];_0x17b273=_0x33bdd9[_0x556d('0x39')];return _0x17b273[_0x556d('0x20')](function(_0x285e39){var _0x3547f5=_[_0x556d('0x3a')](_0x2efbb9,['id',_0x285e39['id']]);if(_0x3547f5){var _0x3800b6=rta[_0x556d('0x3b')](_0x3547f5);_[_0x556d('0x30')](_0x285e39,_0x3800b6);}_0x285e39[_0x556d('0x18')]=rta[_0x556d('0x3c')](_0x285e39);if(_0x285e39[_0x556d('0x18')][_0x556d('0x17')]('pause')){_0x2ccf17[_0x556d('0x2d')](function(_0x338264){if(_0x285e39[_0x338264+_0x556d('0x2e')]){if(_0x338264==='voice'){if(_0x285e39['voiceStatus']!==_0x556d('0x3d')){_0x285e39[_0x556d('0x3e')]='pause';}}else{_0x285e39[_0x338264+_0x556d('0x3f')]='pause';}}});}return _0x285e39;});})[_0x556d('0x12')](function(_0x30d59c){if(!_0x5a8762||_0x3dd2c9){return _0x30d59c;}return rta[_0x556d('0x40')](_0x30d59c,_0x5a8762);})[_0x556d('0x12')](function(_0x3213e0){var _0x2ded53=rta[_0x556d('0x41')]();_0x2be02d[_0x556d('0x39')]=_0x3213e0[_0x556d('0x20')](function(_0x4e888d){return _[_0x556d('0x42')](_0x4e888d,_0x2ded53);});return _0x2be02d;})[_0x556d('0x12')](respondWithFilteredResult(_0x1f9c37,_0x5e33c9))[_0x556d('0x43')](APIHandleError(_0x1f9c37));};exports[_0x556d('0x44')]=function(_0x20ea45,_0x17e624){var _0xacef7b={'count':0x0,'rows':[]};var _0x42a416={};var _0x30fdfa;var _0x1a5f96;var _0x5d2911;Promise[_0x556d('0x45')]()[_0x556d('0x12')](function(){if(_0x20ea45[_0x556d('0xd')]['channel']){if(!utils['isValidChannel'](_0x20ea45['query'][_0x556d('0x13')])){throw new APIBadRequestError(util[_0x556d('0x46')](_0x556d('0x47'),_0x20ea45['query'][_0x556d('0x13')]));}_0x30fdfa=_0x20ea45[_0x556d('0xd')][_0x556d('0x13')]['toLowerCase']();}var _0x236c0b=_['startCase'](_0x30fdfa)+_0x556d('0x48');var _0x1b4299=_['map'](db[_0x236c0b][_0x556d('0x49')],function(_0x4cdde7){return{'name':_0x4cdde7['fieldName'],'type':_0x4cdde7[_0x556d('0x23')][_0x556d('0x4a')]};});if(!_0x20ea45['query'][_0x556d('0x1b')]){var _0x1f0cce=['id',_0x556d('0x4b')];if(_0x30fdfa===_0x556d('0x4c')){_0x1f0cce[_0x556d('0x29')](_0x556d('0x23'));if(_0x20ea45[_0x556d('0xd')][_0x556d('0x23')]==='outbound'){_0x1f0cce['push'](['dialActive',_0x556d('0x4d')]);}}_0x20ea45[_0x556d('0xd')][_0x556d('0x1b')]=_0x1f0cce[_0x556d('0x4e')](',');}_0x42a416=qs[_0x556d('0x26')](_0x1b4299,_0x20ea45);if(_0x20ea45[_0x556d('0x31')]['role']==='user'){var _0x4a1fb0={'params':{'id':_0x20ea45[_0x556d('0x31')]['userProfileId']},'query':{'section':_0x30fdfa==='voice'&&_0x20ea45[_0x556d('0xd')][_0x556d('0x23')]==='outbound'?_0x556d('0x4f'):_[_0x556d('0x50')](_0x30fdfa)+_0x556d('0x51'),'type':_0x20ea45['query'][_0x556d('0x23')],'nolimit':!![],'sort':_0x556d('0x4b'),'filter':_0x20ea45[_0x556d('0xd')][_0x556d('0x52')]}};_0x4a1fb0[_0x556d('0xd')]=Object[_0x556d('0x36')](_0x4a1fb0[_0x556d('0xd')],_0x20ea45[_0x556d('0xd')]);delete _0x4a1fb0[_0x556d('0xd')]['id'];return db[_0x556d('0x53')][_0x556d('0x37')](_0x4a1fb0);}return db[_0x236c0b][_0x556d('0x38')](_0x42a416);})[_0x556d('0x12')](function(_0x12dc11){_0xacef7b['count']=_0x12dc11['count'];_0x1a5f96=_0x12dc11[_0x556d('0x39')];return rtq[_0x556d('0x54')](_0x20ea45,_0x30fdfa);})[_0x556d('0x12')](function(_0x15a648){_0x5d2911=_0x15a648[_0x556d('0x39')];return rtq[_0x556d('0x55')](_0x1a5f96,_0x5d2911,_0x30fdfa,_0x20ea45[_0x556d('0xd')][_0x556d('0x23')]);})[_0x556d('0x12')](function(_0x3f8127){_0xacef7b[_0x556d('0x39')]=_0x3f8127;return _0xacef7b;})[_0x556d('0x12')](respondWithFilteredResult(_0x17e624,_0x42a416))[_0x556d('0x43')](APIHandleError(_0x17e624));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 44ed2ce..e4fcaff 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2bfc51,_0x33626b){var _0x15b3b2=function(_0x5cdbab){while(--_0x5cdbab){_0x2bfc51['push'](_0x2bfc51['shift']());}};_0x15b3b2(++_0x33626b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xcb91[_0x4c7935];return _0x30651d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1af612,_0x4678dc){var _0x1826ae=function(_0x5864fd){while(--_0x5864fd){_0x1af612['push'](_0x1af612['shift']());}};_0x1826ae(++_0x4678dc);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 7a48d67..e01471e 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 _0x444e=['sequelize','INTEGER','DATE','STRING'];(function(_0x45c0ac,_0x147c68){var _0x33f367=function(_0x4b9ede){while(--_0x4b9ede){_0x45c0ac['push'](_0x45c0ac['shift']());}};_0x33f367(++_0x147c68);}(_0x444e,0xe8));var _0xe444=function(_0x433a5a,_0x15f52a){_0x433a5a=_0x433a5a-0x0;var _0x5ccb10=_0x444e[_0x433a5a];return _0x5ccb10;};'use strict';var Sequelize=require(_0xe444('0x0'));module['exports']={'state':{'type':Sequelize[_0xe444('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe444('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe444('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe444('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe444('0x3')]},'campaigntype':{'type':Sequelize[_0xe444('0x3')]},'membername':{'type':Sequelize[_0xe444('0x3')]}}; \ No newline at end of file +var _0xbff5=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x36cc7b,_0x436d43){var _0x164425=function(_0x180473){while(--_0x180473){_0x36cc7b['push'](_0x36cc7b['shift']());}};_0x164425(++_0x436d43);}(_0xbff5,0x1bc));var _0x5bff=function(_0x13f6cd,_0x34689d){_0x13f6cd=_0x13f6cd-0x0;var _0x5cfb29=_0xbff5[_0x13f6cd];return _0x5cfb29;};'use strict';var Sequelize=require(_0x5bff('0x0'));module[_0x5bff('0x1')]={'state':{'type':Sequelize[_0x5bff('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5bff('0x3')]},'scheduledat':{'type':Sequelize[_0x5bff('0x4')]},'uniqueid':{'type':Sequelize[_0x5bff('0x3')]},'starttime':{'type':Sequelize[_0x5bff('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x5bff('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5bff('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 8e780ad..2c6c01a 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 _0xe5a2=['exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe5a2,0x1a4));var _0x2e5a=function(_0x5de392,_0x279ca7){_0x5de392=_0x5de392-0x0;var _0x39a1f1=_0xe5a2[_0x5de392];return _0x39a1f1;};'use strict';var _=require(_0x2e5a('0x0'));var util=require(_0x2e5a('0x1'));var logger=require(_0x2e5a('0x2'))('api');var moment=require(_0x2e5a('0x3'));var BPromise=require(_0x2e5a('0x4'));var rp=require(_0x2e5a('0x5'));var fs=require('fs');var path=require(_0x2e5a('0x6'));var rimraf=require(_0x2e5a('0x7'));var config=require(_0x2e5a('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x2e5a('0x9')]=function(_0x30d1dd,_0x1f8342){return _0x30d1dd[_0x2e5a('0xa')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac05=['rimraf','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x32bcbb,_0x2e37ae){var _0x157155=function(_0x2fb9ae){while(--_0x2fb9ae){_0x32bcbb['push'](_0x32bcbb['shift']());}};_0x157155(++_0x2e37ae);}(_0xac05,0x1f1));var _0x5ac0=function(_0x367922,_0x19f865){_0x367922=_0x367922-0x0;var _0xb2c86e=_0xac05[_0x367922];return _0xb2c86e;};'use strict';var _=require(_0x5ac0('0x0'));var util=require(_0x5ac0('0x1'));var logger=require('../../config/logger')(_0x5ac0('0x2'));var moment=require(_0x5ac0('0x3'));var BPromise=require(_0x5ac0('0x4'));var rp=require(_0x5ac0('0x5'));var fs=require('fs');var path=require(_0x5ac0('0x6'));var rimraf=require(_0x5ac0('0x7'));var config=require('../../config/environment');var attributes=require(_0x5ac0('0x8'));module[_0x5ac0('0x9')]=function(_0xcb4479,_0x1410e0){return _0xcb4479[_0x5ac0('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x5ac0('0xb'),'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 e37d239..b0fb352 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 _0x1c51=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','options','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0xedc556,_0x349c78){var _0x5bd654=function(_0x198049){while(--_0x198049){_0xedc556['push'](_0xedc556['shift']());}};_0x5bd654(++_0x349c78);}(_0x1c51,0x14c));var _0x11c5=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x1c51[_0x648163];return _0x199d4d;};'use strict';var _=require(_0x11c5('0x0'));var util=require('util');var moment=require(_0x11c5('0x1'));var BPromise=require(_0x11c5('0x2'));var rs=require(_0x11c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x11c5('0x4'));var logger=require(_0x11c5('0x5'))(_0x11c5('0x6'));var config=require(_0x11c5('0x7'));var jayson=require(_0x11c5('0x8'));var client=jayson[_0x11c5('0x9')][_0x11c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ab633,_0x4ef163,_0x537177){return new BPromise(function(_0xccc46c,_0xddc9c4){return client[_0x11c5('0xb')](_0x1ab633,_0x537177)[_0x11c5('0xc')](function(_0x32d07b){logger[_0x11c5('0xd')](_0x11c5('0xe'),_0x4ef163,_0x11c5('0xf'));logger[_0x11c5('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4ef163,'request\x20sent',JSON[_0x11c5('0x11')](_0x32d07b));if(_0x32d07b[_0x11c5('0x12')]){if(_0x32d07b['error'][_0x11c5('0x13')]===0x1f4){logger[_0x11c5('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ef163,_0x32d07b[_0x11c5('0x12')][_0x11c5('0x14')]);return _0xddc9c4(_0x32d07b[_0x11c5('0x12')][_0x11c5('0x14')]);}logger[_0x11c5('0x12')](_0x11c5('0xe'),_0x4ef163,_0x32d07b[_0x11c5('0x12')][_0x11c5('0x14')]);return _0xccc46c(_0x32d07b[_0x11c5('0x12')][_0x11c5('0x14')]);}else{logger[_0x11c5('0xd')](_0x11c5('0xe'),_0x4ef163,_0x11c5('0xf'));_0xccc46c(_0x32d07b[_0x11c5('0x15')][_0x11c5('0x14')]);}})[_0x11c5('0x16')](function(_0x100eb7){logger[_0x11c5('0x12')](_0x11c5('0xe'),_0x4ef163,_0x100eb7);_0xddc9c4(_0x100eb7);});});}exports[_0x11c5('0x17')]=function(_0x3d85b2){var _0x4e8024=this;return new Promise(function(_0x5377d8,_0x1a35ad){return db[_0x11c5('0x18')]['create'](_0x3d85b2['body'],{'raw':_0x3d85b2['options']?_0x3d85b2[_0x11c5('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x11c5('0xc')](function(_0x328e08){logger[_0x11c5('0xd')](_0x11c5('0x17'),_0x3d85b2);logger[_0x11c5('0x10')](_0x11c5('0x17'),_0x3d85b2,JSON['stringify'](_0x328e08));_0x5377d8(_0x328e08);})[_0x11c5('0x16')](function(_0x510470){logger['error'](_0x11c5('0x17'),_0x510470['message'],_0x3d85b2);_0x1a35ad(_0x4e8024['error'](0x1f4,_0x510470['message']));});});}; \ No newline at end of file +var _0x272b=['bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw','lodash','moment'];(function(_0x175756,_0x4450bc){var _0x3be0a6=function(_0x3fb180){while(--_0x3fb180){_0x175756['push'](_0x175756['shift']());}};_0x3be0a6(++_0x4450bc);}(_0x272b,0x136));var _0xb272=function(_0x152cb8,_0x2cd976){_0x152cb8=_0x152cb8-0x0;var _0x494c94=_0x272b[_0x152cb8];return _0x494c94;};'use strict';var _=require(_0xb272('0x0'));var util=require('util');var moment=require(_0xb272('0x1'));var BPromise=require(_0xb272('0x2'));var rs=require(_0xb272('0x3'));var fs=require('fs');var Redis=require(_0xb272('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb272('0x5'))(_0xb272('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb272('0x7')][_0xb272('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x99dd98,_0x520510,_0x4bf56a){return new BPromise(function(_0x2e31f9,_0x2dbe92){return client['request'](_0x99dd98,_0x4bf56a)['then'](function(_0x307beb){logger[_0xb272('0x9')](_0xb272('0xa'),_0x520510,_0xb272('0xb'));logger[_0xb272('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x520510,_0xb272('0xb'),JSON[_0xb272('0xd')](_0x307beb));if(_0x307beb[_0xb272('0xe')]){if(_0x307beb[_0xb272('0xe')][_0xb272('0xf')]===0x1f4){logger[_0xb272('0xe')](_0xb272('0xa'),_0x520510,_0x307beb[_0xb272('0xe')][_0xb272('0x10')]);return _0x2dbe92(_0x307beb[_0xb272('0xe')][_0xb272('0x10')]);}logger['error'](_0xb272('0xa'),_0x520510,_0x307beb[_0xb272('0xe')][_0xb272('0x10')]);return _0x2e31f9(_0x307beb[_0xb272('0xe')][_0xb272('0x10')]);}else{logger[_0xb272('0x9')](_0xb272('0xa'),_0x520510,_0xb272('0xb'));_0x2e31f9(_0x307beb[_0xb272('0x11')]['message']);}})[_0xb272('0x12')](function(_0x191653){logger[_0xb272('0xe')](_0xb272('0xa'),_0x520510,_0x191653);_0x2dbe92(_0x191653);});});}exports['CreateReportAgentPreview']=function(_0x3ed022){var _0x522443=this;return new Promise(function(_0x1b457d,_0x33d153){return db[_0xb272('0x13')][_0xb272('0x14')](_0x3ed022[_0xb272('0x15')],{'raw':_0x3ed022['options']?_0x3ed022[_0xb272('0x16')][_0xb272('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x255a9b){logger[_0xb272('0x9')]('CreateReportAgentPreview',_0x3ed022);logger['debug']('CreateReportAgentPreview',_0x3ed022,JSON[_0xb272('0xd')](_0x255a9b));_0x1b457d(_0x255a9b);})[_0xb272('0x12')](function(_0x595d1c){logger[_0xb272('0xe')]('CreateReportAgentPreview',_0x595d1c[_0xb272('0x10')],_0x3ed022);_0x33d153(_0x522443[_0xb272('0xe')](0x1f4,_0x595d1c[_0xb272('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 78d75b0..1ea53b2 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 _0x85b2=['voiceQueues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outboundChannels','agents','/agents/:id/capacity','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x85b2,0x181));var _0x285b=function(_0x449871,_0x2f45ab){_0x449871=_0x449871-0x0;var _0xbd50ee=_0x85b2[_0x449871];return _0xbd50ee;};'use strict';var multer=require(_0x285b('0x0'));var util=require(_0x285b('0x1'));var path=require(_0x285b('0x2'));var express=require(_0x285b('0x3'));var router=express[_0x285b('0x4')]();var auth=require(_0x285b('0x5'));var controller=require(_0x285b('0x6'));router['get'](_0x285b('0x7'),auth[_0x285b('0x8')](),controller[_0x285b('0x9')]);router[_0x285b('0xa')](_0x285b('0xb'),auth[_0x285b('0x8')](),controller[_0x285b('0xc')]);router[_0x285b('0xa')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x285b('0xd')]);router[_0x285b('0xa')](_0x285b('0xe'),auth[_0x285b('0x8')](),controller[_0x285b('0xf')]);router['get']('/chat/queues',auth[_0x285b('0x8')](),controller[_0x285b('0x10')]);router[_0x285b('0xa')]('/mail/queues',auth[_0x285b('0x8')](),controller[_0x285b('0x11')]);router[_0x285b('0xa')](_0x285b('0x12'),auth[_0x285b('0x8')](),controller[_0x285b('0x13')]);router[_0x285b('0xa')](_0x285b('0x14'),auth[_0x285b('0x8')](),controller[_0x285b('0x15')]);router['get'](_0x285b('0x16'),auth['isAuthenticated'](),controller[_0x285b('0x17')]);router[_0x285b('0xa')](_0x285b('0x18'),auth['isAuthenticated'](),controller[_0x285b('0x19')]);router['get'](_0x285b('0x1a'),auth['isAuthenticated'](),controller[_0x285b('0x1b')]);router[_0x285b('0xa')](_0x285b('0x1c'),auth[_0x285b('0x8')](),controller['voiceQueuesPreview']);router[_0x285b('0xa')]('/voice/queues/channels',auth[_0x285b('0x8')](),controller[_0x285b('0x1d')]);router[_0x285b('0xa')](_0x285b('0x1e'),auth[_0x285b('0x8')](),controller[_0x285b('0x1f')]);router['get'](_0x285b('0x20'),auth[_0x285b('0x8')](),controller[_0x285b('0x21')]);router[_0x285b('0xa')](_0x285b('0x22'),auth[_0x285b('0x8')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x285b('0x23'),auth[_0x285b('0x8')](),controller[_0x285b('0x24')]);router['put']('/voice/queues/:id',auth[_0x285b('0x8')](),controller[_0x285b('0x25')]);router[_0x285b('0xa')](_0x285b('0x26'),auth[_0x285b('0x8')](),controller['outbound']);router[_0x285b('0xa')]('/outbound/channels',auth[_0x285b('0x8')](),controller[_0x285b('0x27')]);router[_0x285b('0xa')]('/agents',auth[_0x285b('0x8')](),controller[_0x285b('0x28')]);router['put'](_0x285b('0x29'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x285b('0xa')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router['get'](_0x285b('0x2a'),auth['isAuthenticated'](),controller[_0x285b('0x2b')]);router[_0x285b('0xa')](_0x285b('0x2c'),auth[_0x285b('0x8')](),controller['campaigns']);router['get'](_0x285b('0x2d'),auth[_0x285b('0x8')](),controller[_0x285b('0x2e')]);router['get'](_0x285b('0x2f'),auth[_0x285b('0x8')](),controller[_0x285b('0x30')]);router['get'](_0x285b('0x31'),auth[_0x285b('0x8')](),controller[_0x285b('0x32')]);router['get'](_0x285b('0x33'),auth[_0x285b('0x8')](),controller[_0x285b('0x34')]);router['get'](_0x285b('0x35'),auth[_0x285b('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x285b('0xa')]('/sms/queues/waitinginteractions',auth[_0x285b('0x8')](),controller['smsQueuesWaitingInteractions']);router[_0x285b('0xa')]('/whatsapp/queues/waitinginteractions',auth[_0x285b('0x8')](),controller[_0x285b('0x36')]);router[_0x285b('0xa')]('/fax/queues/waitinginteractions',auth[_0x285b('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x285b('0x37')](_0x285b('0x38'),auth['isAuthenticated'](),controller['queueNotify'](_0x285b('0x39')));router[_0x285b('0xa')](_0x285b('0x3a'),auth[_0x285b('0x8')](),controller[_0x285b('0x3b')]);router[_0x285b('0x37')](_0x285b('0x3c'),auth['isAuthenticated'](),controller[_0x285b('0x3d')](_0x285b('0x3e')));router['get'](_0x285b('0x3f'),auth[_0x285b('0x8')](),controller[_0x285b('0x40')]);router['post']('/fax/queues/:id/notify',auth[_0x285b('0x8')](),controller[_0x285b('0x3d')]('fax'));router[_0x285b('0xa')](_0x285b('0x41'),auth[_0x285b('0x8')](),controller[_0x285b('0x42')]);router[_0x285b('0x37')](_0x285b('0x43'),auth[_0x285b('0x8')](),controller['queueNotify']('openchannel'));router[_0x285b('0xa')](_0x285b('0x44'),auth[_0x285b('0x8')](),controller['showOpenchannelQueues']);router[_0x285b('0x37')](_0x285b('0x45'),auth[_0x285b('0x8')](),controller[_0x285b('0x3d')](_0x285b('0x46')));router[_0x285b('0x37')](_0x285b('0x47'),auth[_0x285b('0x8')](),controller[_0x285b('0x3d')](_0x285b('0x48')));router[_0x285b('0xa')](_0x285b('0x49'),auth[_0x285b('0x8')](),controller[_0x285b('0x4a')]);router[_0x285b('0xa')](_0x285b('0x4b'),auth['isAuthenticated'](),controller[_0x285b('0x4c')]);router['post'](_0x285b('0x4d'),auth[_0x285b('0x8')](),controller[_0x285b('0x4e')]);module[_0x285b('0x4f')]=router; \ No newline at end of file +var _0x1f31=['updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put'];(function(_0x283ef3,_0x136ad1){var _0x1d4c24=function(_0x55b811){while(--_0x55b811){_0x283ef3['push'](_0x283ef3['shift']());}};_0x1d4c24(++_0x136ad1);}(_0x1f31,0x12d));var _0x11f3=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x1f31[_0x1e4150];return _0x1ce3ee;};'use strict';var multer=require(_0x11f3('0x0'));var util=require(_0x11f3('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0x11f3('0x2'));var controller=require(_0x11f3('0x3'));router[_0x11f3('0x4')](_0x11f3('0x5'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x7')]);router[_0x11f3('0x4')](_0x11f3('0x8'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x9')]);router[_0x11f3('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x11f3('0x4')](_0x11f3('0xa'),auth[_0x11f3('0x6')](),controller[_0x11f3('0xb')]);router[_0x11f3('0x4')](_0x11f3('0xc'),auth[_0x11f3('0x6')](),controller[_0x11f3('0xd')]);router[_0x11f3('0x4')](_0x11f3('0xe'),auth['isAuthenticated'](),controller[_0x11f3('0xf')]);router[_0x11f3('0x4')](_0x11f3('0x10'),auth[_0x11f3('0x6')](),controller['mailAccounts']);router['get'](_0x11f3('0x11'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x12')]);router['get'](_0x11f3('0x13'),auth[_0x11f3('0x6')](),controller['smsQueues']);router[_0x11f3('0x4')](_0x11f3('0x14'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x15')]);router[_0x11f3('0x4')]('/fax/queues',auth[_0x11f3('0x6')](),controller[_0x11f3('0x16')]);router['get']('/voice/queues/preview/:id',auth[_0x11f3('0x6')](),controller['voiceQueuesPreview']);router[_0x11f3('0x4')]('/voice/queues/channels',auth[_0x11f3('0x6')](),controller[_0x11f3('0x17')]);router[_0x11f3('0x4')](_0x11f3('0x18'),auth['isAuthenticated'](),controller[_0x11f3('0x19')]);router[_0x11f3('0x4')](_0x11f3('0x1a'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x1b')]);router[_0x11f3('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x11f3('0x6')](),controller['voiceQueuesChannelRedirect']);router[_0x11f3('0x4')](_0x11f3('0x1c'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x1d')]);router[_0x11f3('0x1e')]('/voice/queues/:id',auth[_0x11f3('0x6')](),controller[_0x11f3('0x1f')]);router[_0x11f3('0x4')]('/outbound',auth[_0x11f3('0x6')](),controller[_0x11f3('0x20')]);router[_0x11f3('0x4')](_0x11f3('0x21'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x22')]);router['get'](_0x11f3('0x23'),auth['isAuthenticated'](),controller[_0x11f3('0x24')]);router[_0x11f3('0x1e')](_0x11f3('0x25'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x26')]);router['get'](_0x11f3('0x27'),auth['isAuthenticated'](),controller[_0x11f3('0x28')]);router[_0x11f3('0x4')](_0x11f3('0x29'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x2a')]);router['get'](_0x11f3('0x2b'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x2c')]);router[_0x11f3('0x4')](_0x11f3('0x2d'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x2e')]);router[_0x11f3('0x4')]('/chat/queues/waitinginteractions',auth[_0x11f3('0x6')](),controller[_0x11f3('0x2f')]);router[_0x11f3('0x4')](_0x11f3('0x30'),auth['isAuthenticated'](),controller[_0x11f3('0x31')]);router[_0x11f3('0x4')]('/openchannel/queues/waitinginteractions',auth[_0x11f3('0x6')](),controller[_0x11f3('0x32')]);router[_0x11f3('0x4')](_0x11f3('0x33'),auth[_0x11f3('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x11f3('0x34'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x35')]);router['get'](_0x11f3('0x36'),auth[_0x11f3('0x6')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x11f3('0x37'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x38')]);router['post'](_0x11f3('0x39'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x3a')](_0x11f3('0x3b')));router[_0x11f3('0x4')](_0x11f3('0x3c'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x3d')]);router[_0x11f3('0x3e')](_0x11f3('0x3f'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x3a')](_0x11f3('0x40')));router['get'](_0x11f3('0x41'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x42')]);router[_0x11f3('0x3e')](_0x11f3('0x43'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x3a')](_0x11f3('0x44')));router['get'](_0x11f3('0x45'),auth['isAuthenticated'](),controller[_0x11f3('0x46')]);router[_0x11f3('0x3e')](_0x11f3('0x47'),auth['isAuthenticated'](),controller['queueNotify']('openchannel'));router[_0x11f3('0x4')](_0x11f3('0x48'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x49')]);router[_0x11f3('0x3e')](_0x11f3('0x4a'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x3a')](_0x11f3('0x4b')));router[_0x11f3('0x3e')](_0x11f3('0x4c'),auth[_0x11f3('0x6')](),controller[_0x11f3('0x3a')](_0x11f3('0x4d')));router['get'](_0x11f3('0x4e'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x11f3('0x4')](_0x11f3('0x4f'),auth[_0x11f3('0x6')](),controller['showWhatsappQueues']);router[_0x11f3('0x3e')](_0x11f3('0x50'),auth['isAuthenticated'](),controller[_0x11f3('0x51')]);module[_0x11f3('0x52')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index e83a345..906fc2e 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 _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x2078f6,_0x5c258e){var _0x46247f=function(_0x292a32){while(--_0x292a32){_0x2078f6['push'](_0x2078f6['shift']());}};_0x46247f(++_0x5c258e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x433444,_0x2bc2ba){var _0x5f4924=function(_0x9efc5d){while(--_0x9efc5d){_0x433444['push'](_0x433444['shift']());}};_0x5f4924(++_0x2bc2ba);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 9745882..db9a47e 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 _0xe994=['multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','show','/:id/run','run','post','create','update','delete','/:id','destroy','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xe994,0x190));var _0x4e99=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0xe994[_0x1f9503];return _0xaab94f;};'use strict';var multer=require(_0x4e99('0x0'));var util=require('util');var path=require(_0x4e99('0x1'));var timeout=require(_0x4e99('0x2'));var express=require(_0x4e99('0x3'));var router=express['Router']();var fs_extra=require(_0x4e99('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e99('0x5'));var config=require(_0x4e99('0x6'));var controller=require(_0x4e99('0x7'));router[_0x4e99('0x8')]('/',auth[_0x4e99('0x9')](),controller['index']);router[_0x4e99('0x8')]('/:id',auth[_0x4e99('0x9')](),controller[_0x4e99('0xa')]);router[_0x4e99('0x8')](_0x4e99('0xb'),auth['isAuthenticated'](),controller[_0x4e99('0xc')]);router[_0x4e99('0xd')]('/',auth[_0x4e99('0x9')](),controller[_0x4e99('0xe')]);router['put']('/:id',auth[_0x4e99('0x9')](),controller[_0x4e99('0xf')]);router[_0x4e99('0x10')](_0x4e99('0x11'),auth[_0x4e99('0x9')](),controller[_0x4e99('0x12')]);module[_0x4e99('0x13')]=router; \ No newline at end of file +var _0xb057=['isAuthenticated','show','/:id/run','put','/:id','update','delete','destroy','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index'];(function(_0x660b01,_0x4644b2){var _0x127d86=function(_0x45f4bb){while(--_0x45f4bb){_0x660b01['push'](_0x660b01['shift']());}};_0x127d86(++_0x4644b2);}(_0xb057,0x158));var _0x7b05=function(_0x204e8d,_0x268f00){_0x204e8d=_0x204e8d-0x0;var _0x31b006=_0xb057[_0x204e8d];return _0x31b006;};'use strict';var multer=require('multer');var util=require(_0x7b05('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7b05('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b05('0x2'));var interaction=require(_0x7b05('0x3'));var config=require(_0x7b05('0x4'));var controller=require(_0x7b05('0x5'));router[_0x7b05('0x6')]('/',auth['isAuthenticated'](),controller[_0x7b05('0x7')]);router[_0x7b05('0x6')]('/:id',auth[_0x7b05('0x8')](),controller[_0x7b05('0x9')]);router[_0x7b05('0x6')](_0x7b05('0xa'),auth[_0x7b05('0x8')](),controller['run']);router['post']('/',auth[_0x7b05('0x8')](),controller['create']);router[_0x7b05('0xb')](_0x7b05('0xc'),auth[_0x7b05('0x8')](),controller[_0x7b05('0xd')]);router[_0x7b05('0xe')](_0x7b05('0xc'),auth[_0x7b05('0x8')](),controller[_0x7b05('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index ae5c49e..f745d91 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 _0xa2b4=['0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','hours','minutes','csv','pdf','xlsx','custom','TEXT','exports','STRING','BOOLEAN'];(function(_0x21d0c5,_0x109072){var _0x1d5250=function(_0x432713){while(--_0x432713){_0x21d0c5['push'](_0x21d0c5['shift']());}};_0x1d5250(++_0x109072);}(_0xa2b4,0x140));var _0x4a2b=function(_0x1a14d0,_0x517f10){_0x1a14d0=_0x1a14d0-0x0;var _0x5b4da2=_0xa2b4[_0x1a14d0];return _0x5b4da2;};'use strict';var Sequelize=require('sequelize');module[_0x4a2b('0x0')]={'name':{'type':Sequelize[_0x4a2b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4a2b('0x1')]},'active':{'type':Sequelize[_0x4a2b('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4a2b('0x1')],'allowNull':![],'defaultValue':_0x4a2b('0x3')},'startAt':{'type':Sequelize[_0x4a2b('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4a2b('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4a2b('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x4a2b('0x6'),_0x4a2b('0x7'),_0x4a2b('0x8'),_0x4a2b('0x9'),'days',_0x4a2b('0xa'),_0x4a2b('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x4a2b('0xc'),_0x4a2b('0xd'),_0x4a2b('0xe')),'allowNull':![],'defaultValue':_0x4a2b('0xc')},'type':{'type':Sequelize['ENUM']('custom','default'),'allowNull':![],'defaultValue':_0x4a2b('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x4a2b('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x4a2b('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x4a2b('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5641=['csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','minutes'];(function(_0x25861b,_0x136582){var _0xbc22fc=function(_0x518486){while(--_0x518486){_0x25861b['push'](_0x25861b['shift']());}};_0xbc22fc(++_0x136582);}(_0x5641,0x16f));var _0x1564=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x5641[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require(_0x1564('0x0'));module[_0x1564('0x1')]={'name':{'type':Sequelize[_0x1564('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1564('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1564('0x2')],'allowNull':![],'defaultValue':_0x1564('0x4')},'startAt':{'type':Sequelize[_0x1564('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1564('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1564('0x7')](_0x1564('0x8'),_0x1564('0x9'),_0x1564('0xa'),'weeks',_0x1564('0xb'),'hours',_0x1564('0xc')),'allowNull':![],'defaultValue':_0x1564('0xb')},'output':{'type':Sequelize['ENUM'](_0x1564('0xd'),_0x1564('0xe'),_0x1564('0xf')),'allowNull':![],'defaultValue':_0x1564('0xd')},'type':{'type':Sequelize[_0x1564('0x7')](_0x1564('0x10'),_0x1564('0x11')),'allowNull':![],'defaultValue':_0x1564('0x10')},'sendMail':{'type':Sequelize[_0x1564('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1564('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x1564('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index fef8023..22ccaa5 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 _0xa1d0=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','name','map','Schedule','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xa1d0,0x13d));var _0x0a1d=function(_0x5a53cd,_0x400c97){_0x5a53cd=_0x5a53cd-0x0;var _0x1f3b8a=_0xa1d0[_0x5a53cd];return _0x1f3b8a;};'use strict';var emlformat=require(_0x0a1d('0x0'));var rimraf=require(_0x0a1d('0x1'));var zipdir=require(_0x0a1d('0x2'));var jsonpatch=require(_0x0a1d('0x3'));var rp=require(_0x0a1d('0x4'));var moment=require('moment');var BPromise=require(_0x0a1d('0x5'));var Mustache=require(_0x0a1d('0x6'));var util=require(_0x0a1d('0x7'));var path=require(_0x0a1d('0x8'));var sox=require(_0x0a1d('0x9'));var csv=require(_0x0a1d('0xa'));var ejs=require(_0x0a1d('0xb'));var fs=require('fs');var fs_extra=require(_0x0a1d('0xc'));var _=require(_0x0a1d('0xd'));var squel=require(_0x0a1d('0xe'));var crypto=require(_0x0a1d('0xf'));var jsforce=require(_0x0a1d('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0a1d('0x11'));var Papa=require('papaparse');var Redis=require(_0x0a1d('0x12'));var authService=require(_0x0a1d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a1d('0x14'));var logger=require(_0x0a1d('0x15'))(_0x0a1d('0x16'));var utils=require(_0x0a1d('0x17'));var config=require(_0x0a1d('0x18'));var licenseUtil=require(_0x0a1d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5db5fb,_0x126fcd){_0x126fcd=_0x126fcd||0xcc;return function(_0x2b024){if(_0x2b024){return _0x5db5fb[_0x0a1d('0x1a')](_0x126fcd);}return _0x5db5fb[_0x0a1d('0x1b')](_0x126fcd)['end']();};}function respondWithResult(_0x26ee0f,_0x5c7636){_0x5c7636=_0x5c7636||0xc8;return function(_0x14353a){if(_0x14353a){return _0x26ee0f[_0x0a1d('0x1b')](_0x5c7636)[_0x0a1d('0x1c')](_0x14353a);}};}function respondWithFilteredResult(_0x22b541,_0x38ad05){return function(_0x3dbb16){if(_0x3dbb16){var _0x269f49=typeof _0x38ad05[_0x0a1d('0x1d')]===_0x0a1d('0x1e')&&typeof _0x38ad05['limit']===_0x0a1d('0x1e');var _0x545fe0=_0x3dbb16[_0x0a1d('0x1f')];var _0x1f5509=_0x269f49?0x0:_0x38ad05[_0x0a1d('0x1d')];var _0x30720a=_0x269f49?_0x3dbb16[_0x0a1d('0x1f')]:_0x38ad05[_0x0a1d('0x1d')]+_0x38ad05['limit'];var _0x2a6c95;if(_0x30720a>=_0x545fe0){_0x30720a=_0x545fe0;_0x2a6c95=0xc8;}else{_0x2a6c95=0xce;}_0x22b541[_0x0a1d('0x1b')](_0x2a6c95);return _0x22b541['set'](_0x0a1d('0x20'),_0x1f5509+'-'+_0x30720a+'/'+_0x545fe0)[_0x0a1d('0x1c')](_0x3dbb16);}return null;};}function patchUpdates(_0x53f25a){return function(_0x594b90){try{jsonpatch[_0x0a1d('0x21')](_0x594b90,_0x53f25a,!![]);}catch(_0x5bffe3){return BPromise[_0x0a1d('0x22')](_0x5bffe3);}return _0x594b90[_0x0a1d('0x23')]();};}function saveUpdates(_0x126a1a,_0x4ba48e){return function(_0x3134c1){if(_0x3134c1){return _0x3134c1[_0x0a1d('0x24')](_0x126a1a)[_0x0a1d('0x25')](function(_0x571cdf){return _0x571cdf;});}return null;};}function removeEntity(_0x53b5aa,_0x2de405){return function(_0x25a05d){if(_0x25a05d){return _0x25a05d[_0x0a1d('0x26')]()[_0x0a1d('0x25')](function(){var _0x2e7e0f=_0x25a05d[_0x0a1d('0x27')]({'plain':!![]});var _0x161cac=_0x0a1d('0x28');return db[_0x0a1d('0x29')][_0x0a1d('0x26')]({'where':{'type':_0x161cac,'resourceId':_0x2e7e0f['id']}})[_0x0a1d('0x25')](function(){return _0x25a05d;});})[_0x0a1d('0x25')](function(){_0x53b5aa[_0x0a1d('0x1b')](0xcc)[_0x0a1d('0x2a')]();});}};}function handleEntityNotFound(_0x2bf76f,_0x2fe894){return function(_0x2d7fe2){if(!_0x2d7fe2){_0x2bf76f[_0x0a1d('0x1a')](0x194);}return _0x2d7fe2;};}function handleError(_0xa39298,_0x4384d1){_0x4384d1=_0x4384d1||0x1f4;return function(_0x4eb6e7){logger[_0x0a1d('0x2b')](_0x4eb6e7['stack']);if(_0x4eb6e7[_0x0a1d('0x2c')]){delete _0x4eb6e7['name'];}_0xa39298[_0x0a1d('0x1b')](_0x4384d1)['send'](_0x4eb6e7);};}exports['index']=function(_0x4ae7d1,_0xaea5be){var _0x3b4a45={},_0x11845e={},_0x5de424={'count':0x0,'rows':[]};var _0x3e2375=_[_0x0a1d('0x2d')](db[_0x0a1d('0x2e')]['rawAttributes'],function(_0x6a6db3){return{'name':_0x6a6db3[_0x0a1d('0x2f')],'type':_0x6a6db3['type'][_0x0a1d('0x30')]};});_0x11845e[_0x0a1d('0x31')]=_[_0x0a1d('0x2d')](_0x3e2375,'name');_0x11845e[_0x0a1d('0x32')]=_[_0x0a1d('0x33')](_0x4ae7d1['query']);_0x11845e[_0x0a1d('0x34')]=_[_0x0a1d('0x35')](_0x11845e[_0x0a1d('0x31')],_0x11845e[_0x0a1d('0x32')]);_0x3b4a45['attributes']=_[_0x0a1d('0x35')](_0x11845e[_0x0a1d('0x31')],qs[_0x0a1d('0x36')](_0x4ae7d1[_0x0a1d('0x32')][_0x0a1d('0x36')]));_0x3b4a45[_0x0a1d('0x37')]=_0x3b4a45['attributes'][_0x0a1d('0x38')]?_0x3b4a45[_0x0a1d('0x37')]:_0x11845e['model'];if(!_0x4ae7d1[_0x0a1d('0x32')]['hasOwnProperty'](_0x0a1d('0x39'))){_0x3b4a45['limit']=qs['limit'](_0x4ae7d1[_0x0a1d('0x32')][_0x0a1d('0x3a')]);_0x3b4a45['offset']=qs['offset'](_0x4ae7d1[_0x0a1d('0x32')][_0x0a1d('0x1d')]);}_0x3b4a45[_0x0a1d('0x3b')]=qs[_0x0a1d('0x3c')](_0x4ae7d1[_0x0a1d('0x32')][_0x0a1d('0x3c')]);_0x3b4a45[_0x0a1d('0x3d')]=qs[_0x0a1d('0x34')](_[_0x0a1d('0x3e')](_0x4ae7d1[_0x0a1d('0x32')],_0x11845e['filters']),_0x3e2375);if(_0x4ae7d1[_0x0a1d('0x32')][_0x0a1d('0x3f')]){_0x3b4a45['where']=_[_0x0a1d('0x40')](_0x3b4a45['where'],{'$or':_['map'](_0x3e2375,function(_0x4891ae){if(_0x4891ae[_0x0a1d('0x41')]!==_0x0a1d('0x42')){var _0x4cdc97={};_0x4cdc97[_0x4891ae[_0x0a1d('0x2c')]]={'$like':'%'+_0x4ae7d1[_0x0a1d('0x32')]['filter']+'%'};return _0x4cdc97;}})});}_0x3b4a45=_[_0x0a1d('0x40')]({},_0x3b4a45,_0x4ae7d1[_0x0a1d('0x43')]);var _0x555f0c={'where':_0x3b4a45[_0x0a1d('0x3d')]};return db['Schedule']['count'](_0x555f0c)['then'](function(_0x3c35a0){_0x5de424['count']=_0x3c35a0;if(_0x4ae7d1['query'][_0x0a1d('0x44')]){_0x3b4a45[_0x0a1d('0x45')]=[{'all':!![]}];}return db[_0x0a1d('0x2e')][_0x0a1d('0x46')](_0x3b4a45);})[_0x0a1d('0x25')](function(_0x23f2f4){_0x5de424[_0x0a1d('0x47')]=_0x23f2f4;return _0x5de424;})[_0x0a1d('0x25')](respondWithFilteredResult(_0xaea5be,_0x3b4a45))[_0x0a1d('0x48')](handleError(_0xaea5be,null));};exports[_0x0a1d('0x49')]=function(_0x361e54,_0x3471c5){var _0x5d88bc={'raw':![],'where':{'id':_0x361e54[_0x0a1d('0x4a')]['id']}},_0x17f50a={};_0x17f50a['model']=_[_0x0a1d('0x33')](db['Schedule'][_0x0a1d('0x4b')]);_0x17f50a[_0x0a1d('0x32')]=_[_0x0a1d('0x33')](_0x361e54[_0x0a1d('0x32')]);_0x17f50a['filters']=_[_0x0a1d('0x35')](_0x17f50a[_0x0a1d('0x31')],_0x17f50a[_0x0a1d('0x32')]);_0x5d88bc['attributes']=_[_0x0a1d('0x35')](_0x17f50a[_0x0a1d('0x31')],qs['fields'](_0x361e54[_0x0a1d('0x32')][_0x0a1d('0x36')]));_0x5d88bc[_0x0a1d('0x37')]=_0x5d88bc[_0x0a1d('0x37')]['length']?_0x5d88bc[_0x0a1d('0x37')]:_0x17f50a[_0x0a1d('0x31')];if(_0x361e54['query'][_0x0a1d('0x44')]){_0x5d88bc['include']=[{'all':!![]}];}_0x5d88bc=_[_0x0a1d('0x40')]({},_0x5d88bc,_0x361e54[_0x0a1d('0x43')]);return db['Schedule'][_0x0a1d('0x4c')](_0x5d88bc)[_0x0a1d('0x25')](handleEntityNotFound(_0x3471c5,null))['then'](respondWithResult(_0x3471c5,null))[_0x0a1d('0x48')](handleError(_0x3471c5,null));};exports[_0x0a1d('0x4d')]=function(_0x5db35d,_0x14aed6){return db[_0x0a1d('0x2e')][_0x0a1d('0x4d')](_0x5db35d[_0x0a1d('0x4e')],{})['then'](function(_0x49985a){var _0xe97d3f=_0x5db35d[_0x0a1d('0x4f')]['get']({'plain':!![]});if(!_0xe97d3f)throw new Error(_0x0a1d('0x50'));if(_0xe97d3f['role']===_0x0a1d('0x4f')){var _0x4ee724=_0x49985a['get']({'plain':!![]});var _0x2ff1c7=_0x0a1d('0x28');return db['UserProfileSection'][_0x0a1d('0x4c')]({'where':{'name':_0x2ff1c7,'userProfileId':_0xe97d3f['userProfileId']},'raw':!![]})[_0x0a1d('0x25')](function(_0x39cffb){if(_0x39cffb&&_0x39cffb[_0x0a1d('0x51')]===0x0){return db[_0x0a1d('0x29')]['create']({'name':_0x4ee724[_0x0a1d('0x2c')],'resourceId':_0x4ee724['id'],'type':_0x39cffb[_0x0a1d('0x2c')],'sectionId':_0x39cffb['id']},{})[_0x0a1d('0x25')](function(){return _0x49985a;});}else{return _0x49985a;}})[_0x0a1d('0x48')](function(_0x43b8ce){logger[_0x0a1d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43b8ce);throw _0x43b8ce;});}return _0x49985a;})['then'](respondWithResult(_0x14aed6,0xc9))[_0x0a1d('0x48')](handleError(_0x14aed6,null));};exports[_0x0a1d('0x24')]=function(_0x4f9c8e,_0x5d473e){if(_0x4f9c8e[_0x0a1d('0x4e')]['id']){delete _0x4f9c8e['body']['id'];}return db[_0x0a1d('0x2e')][_0x0a1d('0x4c')]({'where':{'id':_0x4f9c8e[_0x0a1d('0x4a')]['id']}})[_0x0a1d('0x25')](handleEntityNotFound(_0x5d473e,null))[_0x0a1d('0x25')](saveUpdates(_0x4f9c8e[_0x0a1d('0x4e')],null))[_0x0a1d('0x25')](respondWithResult(_0x5d473e,null))['catch'](handleError(_0x5d473e,null));};exports[_0x0a1d('0x26')]=function(_0x492300,_0x201b34){return db[_0x0a1d('0x2e')][_0x0a1d('0x4c')]({'where':{'id':_0x492300[_0x0a1d('0x4a')]['id']}})[_0x0a1d('0x25')](handleEntityNotFound(_0x201b34,null))['then'](removeEntity(_0x201b34,null))['catch'](handleError(_0x201b34,null));};exports[_0x0a1d('0x52')]=function(_0x732cd9,_0x6e60fd,_0x427bb7){var _0x26e15d=require(_0x0a1d('0x53'));return db['Schedule'][_0x0a1d('0x4c')]({'where':{'id':_0x732cd9[_0x0a1d('0x4a')]['id']},'raw':!![]})[_0x0a1d('0x25')](handleEntityNotFound(_0x6e60fd,null))[_0x0a1d('0x25')](function(){_0x26e15d['run'](_0x732cd9['params']['id']);})[_0x0a1d('0x25')](respondWithStatusCode(_0x6e60fd,null))[_0x0a1d('0x48')](handleError(_0x6e60fd,null));}; \ No newline at end of file +var _0x45d6=['undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Scheduler','UserProfileResource','then','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x45d6,0xf3));var _0x645d=function(_0x1289bc,_0x144483){_0x1289bc=_0x1289bc-0x0;var _0x4b7b61=_0x45d6[_0x1289bc];return _0x4b7b61;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x645d('0x0'));var jsonpatch=require(_0x645d('0x1'));var rp=require(_0x645d('0x2'));var moment=require(_0x645d('0x3'));var BPromise=require(_0x645d('0x4'));var Mustache=require(_0x645d('0x5'));var util=require(_0x645d('0x6'));var path=require(_0x645d('0x7'));var sox=require(_0x645d('0x8'));var csv=require(_0x645d('0x9'));var ejs=require(_0x645d('0xa'));var fs=require('fs');var fs_extra=require(_0x645d('0xb'));var _=require(_0x645d('0xc'));var squel=require(_0x645d('0xd'));var crypto=require(_0x645d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x645d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x645d('0x10'));var Papa=require(_0x645d('0x11'));var Redis=require(_0x645d('0x12'));var authService=require(_0x645d('0x13'));var qs=require(_0x645d('0x14'));var as=require(_0x645d('0x15'));var hardwareService=require(_0x645d('0x16'));var logger=require(_0x645d('0x17'))('api');var utils=require(_0x645d('0x18'));var config=require(_0x645d('0x19'));var licenseUtil=require(_0x645d('0x1a'));var db=require(_0x645d('0x1b'))['db'];function respondWithStatusCode(_0x5ad6d0,_0xdbe8f8){_0xdbe8f8=_0xdbe8f8||0xcc;return function(_0x1b5352){if(_0x1b5352){return _0x5ad6d0[_0x645d('0x1c')](_0xdbe8f8);}return _0x5ad6d0['status'](_0xdbe8f8)[_0x645d('0x1d')]();};}function respondWithResult(_0x581fa7,_0x1cfa25){_0x1cfa25=_0x1cfa25||0xc8;return function(_0x4cb198){if(_0x4cb198){return _0x581fa7[_0x645d('0x1e')](_0x1cfa25)[_0x645d('0x1f')](_0x4cb198);}};}function respondWithFilteredResult(_0x15199f,_0x5960b1){return function(_0x535910){if(_0x535910){var _0x100b8e=typeof _0x5960b1[_0x645d('0x20')]===_0x645d('0x21')&&typeof _0x5960b1[_0x645d('0x22')]===_0x645d('0x21');var _0x17b724=_0x535910[_0x645d('0x23')];var _0x4d966d=_0x100b8e?0x0:_0x5960b1[_0x645d('0x20')];var _0x38c36c=_0x100b8e?_0x535910[_0x645d('0x23')]:_0x5960b1['offset']+_0x5960b1['limit'];var _0x56b87f;if(_0x38c36c>=_0x17b724){_0x38c36c=_0x17b724;_0x56b87f=0xc8;}else{_0x56b87f=0xce;}_0x15199f[_0x645d('0x1e')](_0x56b87f);return _0x15199f[_0x645d('0x24')](_0x645d('0x25'),_0x4d966d+'-'+_0x38c36c+'/'+_0x17b724)[_0x645d('0x1f')](_0x535910);}return null;};}function patchUpdates(_0x366d71){return function(_0x4ac557){try{jsonpatch[_0x645d('0x26')](_0x4ac557,_0x366d71,!![]);}catch(_0x2a37e6){return BPromise[_0x645d('0x27')](_0x2a37e6);}return _0x4ac557[_0x645d('0x28')]();};}function saveUpdates(_0x1ccbd9,_0x1ea34d){return function(_0x178e45){if(_0x178e45){return _0x178e45[_0x645d('0x29')](_0x1ccbd9)['then'](function(_0x153ee7){return _0x153ee7;});}return null;};}function removeEntity(_0x3711c8,_0x45c9ed){return function(_0x180746){if(_0x180746){return _0x180746[_0x645d('0x2a')]()['then'](function(){var _0x159602=_0x180746[_0x645d('0x2b')]({'plain':!![]});var _0x43645c=_0x645d('0x2c');return db[_0x645d('0x2d')][_0x645d('0x2a')]({'where':{'type':_0x43645c,'resourceId':_0x159602['id']}})[_0x645d('0x2e')](function(){return _0x180746;});})[_0x645d('0x2e')](function(){_0x3711c8[_0x645d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f67f2,_0x4b914a){return function(_0x2a369a){if(!_0x2a369a){_0x4f67f2[_0x645d('0x1c')](0x194);}return _0x2a369a;};}function handleError(_0xb830bf,_0x457649){_0x457649=_0x457649||0x1f4;return function(_0xbcfdd7){logger[_0x645d('0x2f')](_0xbcfdd7[_0x645d('0x30')]);if(_0xbcfdd7[_0x645d('0x31')]){delete _0xbcfdd7['name'];}_0xb830bf[_0x645d('0x1e')](_0x457649)[_0x645d('0x32')](_0xbcfdd7);};}exports[_0x645d('0x33')]=function(_0x258119,_0x5dad7c){var _0x145710={},_0x47ab3e={},_0xd2cd43={'count':0x0,'rows':[]};var _0x415dce=_['map'](db[_0x645d('0x34')][_0x645d('0x35')],function(_0x4172d1){return{'name':_0x4172d1[_0x645d('0x36')],'type':_0x4172d1[_0x645d('0x37')][_0x645d('0x38')]};});_0x47ab3e[_0x645d('0x39')]=_[_0x645d('0x3a')](_0x415dce,_0x645d('0x31'));_0x47ab3e['query']=_['keys'](_0x258119[_0x645d('0x3b')]);_0x47ab3e['filters']=_['intersection'](_0x47ab3e[_0x645d('0x39')],_0x47ab3e['query']);_0x145710[_0x645d('0x3c')]=_[_0x645d('0x3d')](_0x47ab3e[_0x645d('0x39')],qs['fields'](_0x258119[_0x645d('0x3b')]['fields']));_0x145710['attributes']=_0x145710[_0x645d('0x3c')][_0x645d('0x3e')]?_0x145710[_0x645d('0x3c')]:_0x47ab3e[_0x645d('0x39')];if(!_0x258119[_0x645d('0x3b')][_0x645d('0x3f')](_0x645d('0x40'))){_0x145710[_0x645d('0x22')]=qs['limit'](_0x258119[_0x645d('0x3b')]['limit']);_0x145710[_0x645d('0x20')]=qs[_0x645d('0x20')](_0x258119[_0x645d('0x3b')]['offset']);}_0x145710[_0x645d('0x41')]=qs['sort'](_0x258119[_0x645d('0x3b')][_0x645d('0x42')]);_0x145710[_0x645d('0x43')]=qs['filters'](_[_0x645d('0x44')](_0x258119[_0x645d('0x3b')],_0x47ab3e[_0x645d('0x45')]),_0x415dce);if(_0x258119[_0x645d('0x3b')][_0x645d('0x46')]){_0x145710[_0x645d('0x43')]=_[_0x645d('0x47')](_0x145710[_0x645d('0x43')],{'$or':_[_0x645d('0x3a')](_0x415dce,function(_0x27dbfa){if(_0x27dbfa[_0x645d('0x37')]!==_0x645d('0x48')){var _0x59ba25={};_0x59ba25[_0x27dbfa['name']]={'$like':'%'+_0x258119[_0x645d('0x3b')][_0x645d('0x46')]+'%'};return _0x59ba25;}})});}_0x145710=_[_0x645d('0x47')]({},_0x145710,_0x258119[_0x645d('0x49')]);var _0x322a9c={'where':_0x145710['where']};return db['Schedule']['count'](_0x322a9c)[_0x645d('0x2e')](function(_0x19e66b){_0xd2cd43['count']=_0x19e66b;if(_0x258119[_0x645d('0x3b')][_0x645d('0x4a')]){_0x145710[_0x645d('0x4b')]=[{'all':!![]}];}return db[_0x645d('0x34')][_0x645d('0x4c')](_0x145710);})[_0x645d('0x2e')](function(_0x388794){_0xd2cd43[_0x645d('0x4d')]=_0x388794;return _0xd2cd43;})[_0x645d('0x2e')](respondWithFilteredResult(_0x5dad7c,_0x145710))[_0x645d('0x4e')](handleError(_0x5dad7c,null));};exports[_0x645d('0x4f')]=function(_0x19bb94,_0x5d290a){var _0x402119={'raw':![],'where':{'id':_0x19bb94[_0x645d('0x50')]['id']}},_0x5d3c87={};_0x5d3c87['model']=_[_0x645d('0x51')](db['Schedule'][_0x645d('0x35')]);_0x5d3c87[_0x645d('0x3b')]=_[_0x645d('0x51')](_0x19bb94[_0x645d('0x3b')]);_0x5d3c87[_0x645d('0x45')]=_['intersection'](_0x5d3c87[_0x645d('0x39')],_0x5d3c87[_0x645d('0x3b')]);_0x402119[_0x645d('0x3c')]=_[_0x645d('0x3d')](_0x5d3c87[_0x645d('0x39')],qs[_0x645d('0x52')](_0x19bb94[_0x645d('0x3b')][_0x645d('0x52')]));_0x402119[_0x645d('0x3c')]=_0x402119[_0x645d('0x3c')][_0x645d('0x3e')]?_0x402119['attributes']:_0x5d3c87['model'];if(_0x19bb94['query']['includeAll']){_0x402119[_0x645d('0x4b')]=[{'all':!![]}];}_0x402119=_[_0x645d('0x47')]({},_0x402119,_0x19bb94[_0x645d('0x49')]);return db[_0x645d('0x34')][_0x645d('0x53')](_0x402119)[_0x645d('0x2e')](handleEntityNotFound(_0x5d290a,null))[_0x645d('0x2e')](respondWithResult(_0x5d290a,null))['catch'](handleError(_0x5d290a,null));};exports['create']=function(_0x40fc7d,_0x5221d4){return db[_0x645d('0x34')][_0x645d('0x54')](_0x40fc7d[_0x645d('0x55')],{})[_0x645d('0x2e')](function(_0xd1476c){var _0x266c22=_0x40fc7d[_0x645d('0x56')]['get']({'plain':!![]});if(!_0x266c22)throw new Error(_0x645d('0x57'));if(_0x266c22['role']===_0x645d('0x56')){var _0x57899c=_0xd1476c[_0x645d('0x2b')]({'plain':!![]});var _0x3026a4=_0x645d('0x2c');return db['UserProfileSection'][_0x645d('0x53')]({'where':{'name':_0x3026a4,'userProfileId':_0x266c22['userProfileId']},'raw':!![]})[_0x645d('0x2e')](function(_0x1cf38c){if(_0x1cf38c&&_0x1cf38c[_0x645d('0x58')]===0x0){return db[_0x645d('0x2d')][_0x645d('0x54')]({'name':_0x57899c['name'],'resourceId':_0x57899c['id'],'type':_0x1cf38c['name'],'sectionId':_0x1cf38c['id']},{})[_0x645d('0x2e')](function(){return _0xd1476c;});}else{return _0xd1476c;}})[_0x645d('0x4e')](function(_0x46fe5f){logger[_0x645d('0x2f')](_0x645d('0x59'),_0x46fe5f);throw _0x46fe5f;});}return _0xd1476c;})['then'](respondWithResult(_0x5221d4,0xc9))[_0x645d('0x4e')](handleError(_0x5221d4,null));};exports['update']=function(_0x3cddcf,_0x42b724){if(_0x3cddcf[_0x645d('0x55')]['id']){delete _0x3cddcf[_0x645d('0x55')]['id'];}return db[_0x645d('0x34')][_0x645d('0x53')]({'where':{'id':_0x3cddcf[_0x645d('0x50')]['id']}})[_0x645d('0x2e')](handleEntityNotFound(_0x42b724,null))[_0x645d('0x2e')](saveUpdates(_0x3cddcf[_0x645d('0x55')],null))[_0x645d('0x2e')](respondWithResult(_0x42b724,null))['catch'](handleError(_0x42b724,null));};exports[_0x645d('0x2a')]=function(_0x5eaad2,_0x4e5ca0){return db[_0x645d('0x34')][_0x645d('0x53')]({'where':{'id':_0x5eaad2[_0x645d('0x50')]['id']}})[_0x645d('0x2e')](handleEntityNotFound(_0x4e5ca0,null))['then'](removeEntity(_0x4e5ca0,null))[_0x645d('0x4e')](handleError(_0x4e5ca0,null));};exports[_0x645d('0x5a')]=function(_0x3e761c,_0x308cd2,_0x33f7d9){var _0x2359de=require(_0x645d('0x5b'));return db[_0x645d('0x34')][_0x645d('0x53')]({'where':{'id':_0x3e761c['params']['id']},'raw':!![]})[_0x645d('0x2e')](handleEntityNotFound(_0x308cd2,null))[_0x645d('0x2e')](function(){_0x2359de['run'](_0x3e761c[_0x645d('0x50')]['id']);})[_0x645d('0x2e')](respondWithStatusCode(_0x308cd2,null))[_0x645d('0x4e')](handleError(_0x308cd2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 0c68a1a..9232ee5 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 _0x38f2=['moment','request-promise','path','../../config/environment','define','Schedule','tools_schedules','lodash','util','api'];(function(_0x134006,_0x4b91ec){var _0x4befdc=function(_0x1a42b1){while(--_0x1a42b1){_0x134006['push'](_0x134006['shift']());}};_0x4befdc(++_0x4b91ec);}(_0x38f2,0x89));var _0x238f=function(_0x8a8c28,_0x2d4a07){_0x8a8c28=_0x8a8c28-0x0;var _0x588b3a=_0x38f2[_0x8a8c28];return _0x588b3a;};'use strict';var _=require(_0x238f('0x0'));var util=require(_0x238f('0x1'));var logger=require('../../config/logger')(_0x238f('0x2'));var moment=require(_0x238f('0x3'));var BPromise=require('bluebird');var rp=require(_0x238f('0x4'));var fs=require('fs');var path=require(_0x238f('0x5'));var rimraf=require('rimraf');var config=require(_0x238f('0x6'));var attributes=require('./schedule.attributes');module['exports']=function(_0x3dd1f5,_0xac1975){return _0x3dd1f5[_0x238f('0x7')](_0x238f('0x8'),attributes,{'tableName':_0x238f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9aaa=['request-promise','./schedule.attributes','define','tools_schedules','lodash','util','../../config/logger','api','moment'];(function(_0x5e1248,_0x42b862){var _0x1b4201=function(_0x534a23){while(--_0x534a23){_0x5e1248['push'](_0x5e1248['shift']());}};_0x1b4201(++_0x42b862);}(_0x9aaa,0x199));var _0xa9aa=function(_0x4b65b5,_0x18464a){_0x4b65b5=_0x4b65b5-0x0;var _0x4b8d22=_0x9aaa[_0x4b65b5];return _0x4b8d22;};'use strict';var _=require(_0xa9aa('0x0'));var util=require(_0xa9aa('0x1'));var logger=require(_0xa9aa('0x2'))(_0xa9aa('0x3'));var moment=require(_0xa9aa('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9aa('0x6'));module['exports']=function(_0x13fd1c,_0x3b9f0c){return _0x13fd1c[_0xa9aa('0x7')]('Schedule',attributes,{'tableName':_0xa9aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 3673554..0c4a147 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 _0xaa5d=['client','http','request','then','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x183dd6,_0x488036){var _0x4b3be2=function(_0x24fc0c){while(--_0x24fc0c){_0x183dd6['push'](_0x183dd6['shift']());}};_0x4b3be2(++_0x488036);}(_0xaa5d,0x116));var _0xdaa5=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0xaa5d[_0x1ebb10];return _0x20d709;};'use strict';var _=require('lodash');var util=require(_0xdaa5('0x0'));var moment=require(_0xdaa5('0x1'));var BPromise=require(_0xdaa5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaa5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdaa5('0x4'))(_0xdaa5('0x5'));var config=require(_0xdaa5('0x6'));var jayson=require(_0xdaa5('0x7'));var client=jayson[_0xdaa5('0x8')][_0xdaa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35c9b9,_0xe3f931,_0x844846){return new BPromise(function(_0x4208e4,_0x16b11d){return client[_0xdaa5('0xa')](_0x35c9b9,_0x844846)[_0xdaa5('0xb')](function(_0x27b979){logger['info'](_0xdaa5('0xc'),_0xe3f931,'request\x20sent');logger[_0xdaa5('0xd')](_0xdaa5('0xe'),_0xe3f931,_0xdaa5('0xf'),JSON[_0xdaa5('0x10')](_0x27b979));if(_0x27b979[_0xdaa5('0x11')]){if(_0x27b979['error'][_0xdaa5('0x12')]===0x1f4){logger[_0xdaa5('0x11')](_0xdaa5('0xc'),_0xe3f931,_0x27b979['error'][_0xdaa5('0x13')]);return _0x16b11d(_0x27b979[_0xdaa5('0x11')][_0xdaa5('0x13')]);}logger[_0xdaa5('0x11')](_0xdaa5('0xc'),_0xe3f931,_0x27b979[_0xdaa5('0x11')][_0xdaa5('0x13')]);return _0x4208e4(_0x27b979['error'][_0xdaa5('0x13')]);}else{logger['info'](_0xdaa5('0xc'),_0xe3f931,'request\x20sent');_0x4208e4(_0x27b979[_0xdaa5('0x14')][_0xdaa5('0x13')]);}})[_0xdaa5('0x15')](function(_0x4145f7){logger[_0xdaa5('0x11')](_0xdaa5('0xc'),_0xe3f931,_0x4145f7);_0x16b11d(_0x4145f7);});});} \ No newline at end of file +var _0x72d6=['error','code','message','result','lodash','util','bluebird','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','stringify'];(function(_0x434d69,_0x194775){var _0x523fd0=function(_0x19f0b4){while(--_0x19f0b4){_0x434d69['push'](_0x434d69['shift']());}};_0x523fd0(++_0x194775);}(_0x72d6,0x13c));var _0x672d=function(_0x40d40d,_0x3a5baf){_0x40d40d=_0x40d40d-0x0;var _0x367eb3=_0x72d6[_0x40d40d];return _0x367eb3;};'use strict';var _=require(_0x672d('0x0'));var util=require(_0x672d('0x1'));var moment=require('moment');var BPromise=require(_0x672d('0x2'));var rs=require(_0x672d('0x3'));var fs=require('fs');var Redis=require(_0x672d('0x4'));var db=require(_0x672d('0x5'))['db'];var utils=require(_0x672d('0x6'));var logger=require(_0x672d('0x7'))(_0x672d('0x8'));var config=require('../../config/environment');var jayson=require(_0x672d('0x9'));var client=jayson[_0x672d('0xa')][_0x672d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x432c78,_0x5035db,_0x4553c8){return new BPromise(function(_0xe1dc25,_0x537000){return client[_0x672d('0xc')](_0x432c78,_0x4553c8)[_0x672d('0xd')](function(_0x156071){logger[_0x672d('0xe')](_0x672d('0xf'),_0x5035db,_0x672d('0x10'));logger[_0x672d('0x11')](_0x672d('0x12'),_0x5035db,_0x672d('0x10'),JSON[_0x672d('0x13')](_0x156071));if(_0x156071[_0x672d('0x14')]){if(_0x156071[_0x672d('0x14')][_0x672d('0x15')]===0x1f4){logger[_0x672d('0x14')](_0x672d('0xf'),_0x5035db,_0x156071[_0x672d('0x14')]['message']);return _0x537000(_0x156071[_0x672d('0x14')][_0x672d('0x16')]);}logger[_0x672d('0x14')](_0x672d('0xf'),_0x5035db,_0x156071[_0x672d('0x14')][_0x672d('0x16')]);return _0xe1dc25(_0x156071[_0x672d('0x14')]['message']);}else{logger[_0x672d('0xe')](_0x672d('0xf'),_0x5035db,_0x672d('0x10'));_0xe1dc25(_0x156071[_0x672d('0x17')][_0x672d('0x16')]);}})['catch'](function(_0x5c9440){logger[_0x672d('0x14')]('Schedule,\x20%s,\x20%s',_0x5035db,_0x5c9440);_0x537000(_0x5c9440);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 3571179..0419691 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 _0x5269=['multer','Router','fs-extra','../../components/auth/service','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports'];(function(_0x228fc7,_0x35f966){var _0x47394b=function(_0x9f6e41){while(--_0x9f6e41){_0x228fc7['push'](_0x228fc7['shift']());}};_0x47394b(++_0x35f966);}(_0x5269,0x150));var _0x9526=function(_0x22b258,_0x867f4a){_0x22b258=_0x22b258-0x0;var _0x2d1f38=_0x5269[_0x22b258];return _0x2d1f38;};'use strict';var multer=require(_0x9526('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9526('0x1')]();var fs_extra=require(_0x9526('0x2'));var auth=require(_0x9526('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9526('0x4'));router['get']('/',auth[_0x9526('0x5')](),controller[_0x9526('0x6')]);router[_0x9526('0x7')](_0x9526('0x8'),auth[_0x9526('0x5')](),controller[_0x9526('0x9')]);router[_0x9526('0x7')](_0x9526('0xa'),auth[_0x9526('0x5')](),controller[_0x9526('0xb')]);router[_0x9526('0x7')](_0x9526('0xc'),auth['isAuthenticated'](),controller[_0x9526('0xd')]);router[_0x9526('0xe')]('/',auth['isAuthenticated'](),controller[_0x9526('0xf')]);router[_0x9526('0x10')](_0x9526('0xa'),auth[_0x9526('0x5')](),controller[_0x9526('0x11')]);router[_0x9526('0x12')](_0x9526('0xa'),auth['isAuthenticated'](),controller[_0x9526('0x13')]);module[_0x9526('0x14')]=router; \ No newline at end of file +var _0xb31c=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','post','create','put','update'];(function(_0x4423fc,_0x386165){var _0x150146=function(_0x22efb9){while(--_0x22efb9){_0x4423fc['push'](_0x4423fc['shift']());}};_0x150146(++_0x386165);}(_0xb31c,0x10b));var _0xcb31=function(_0x58d3e4,_0x3bae7f){_0x58d3e4=_0x58d3e4-0x0;var _0x52ff5b=_0xb31c[_0x58d3e4];return _0x52ff5b;};'use strict';var multer=require('multer');var util=require(_0xcb31('0x0'));var path=require(_0xcb31('0x1'));var timeout=require(_0xcb31('0x2'));var express=require(_0xcb31('0x3'));var router=express[_0xcb31('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb31('0x5'));var interaction=require(_0xcb31('0x6'));var config=require(_0xcb31('0x7'));var controller=require('./screenRecording.controller');router[_0xcb31('0x8')]('/',auth['isAuthenticated'](),controller[_0xcb31('0x9')]);router['get'](_0xcb31('0xa'),auth[_0xcb31('0xb')](),controller[_0xcb31('0xc')]);router['get'](_0xcb31('0xd'),auth[_0xcb31('0xb')](),controller['show']);router['get'](_0xcb31('0xe'),auth[_0xcb31('0xb')](),controller['download']);router[_0xcb31('0xf')]('/',auth['isAuthenticated'](),controller[_0xcb31('0x10')]);router[_0xcb31('0x11')](_0xcb31('0xd'),auth[_0xcb31('0xb')](),controller[_0xcb31('0x12')]);router[_0xcb31('0x13')](_0xcb31('0xd'),auth['isAuthenticated'](),controller[_0xcb31('0x14')]);module[_0xcb31('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 20faa03..ec03613 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 _0xce62=['setDataValue','INTEGER','subtract','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING'];(function(_0x2f32b2,_0x1c0239){var _0x24a6f7=function(_0x3d04a0){while(--_0x3d04a0){_0x2f32b2['push'](_0x2f32b2['shift']());}};_0x24a6f7(++_0x1c0239);}(_0xce62,0x83));var _0x2ce6=function(_0xeff9a6,_0x3c0d63){_0xeff9a6=_0xeff9a6-0x0;var _0x303c24=_0xce62[_0xeff9a6];return _0x303c24;};'use strict';var Sequelize=require(_0x2ce6('0x0'));var moment=require(_0x2ce6('0x1'));var path=require('path');var config=require(_0x2ce6('0x2'));module[_0x2ce6('0x3')]={'format':{'type':Sequelize[_0x2ce6('0x4')],'get':function(){return this[_0x2ce6('0x5')](_0x2ce6('0x6'))?path[_0x2ce6('0x7')](this['getDataValue'](_0x2ce6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x2ce6('0x8')]},'channel':{'type':Sequelize[_0x2ce6('0x8')]},'value':{'type':Sequelize[_0x2ce6('0x8')],'set':function(_0xcf425){var _0x2c66c2=_0xcf425['replace'](/\\/g,'/');this[_0x2ce6('0x9')](_0x2ce6('0x6'),_0x2c66c2);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2ce6('0xa')],'set':function(_0x2e6eae){this[_0x2ce6('0x9')]('startedAt',moment()[_0x2ce6('0xb')](_0x2e6eae,'ms'));this['setDataValue']('closedAt',moment());this[_0x2ce6('0x9')]('duration',_0x2e6eae);}},'startedAt':{'type':Sequelize[_0x2ce6('0xc')],'get':function(){return moment(this['getDataValue'](_0x2ce6('0xd')))[_0x2ce6('0xe')](_0x2ce6('0xf'))[_0x2ce6('0x10')]();}},'closedAt':{'type':Sequelize[_0x2ce6('0xc')],'get':function(){return moment(this[_0x2ce6('0x5')](_0x2ce6('0x11')))[_0x2ce6('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x2ce6('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2ce6('0x5')](_0x2ce6('0x12')))[_0x2ce6('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x2ce6('0x10')]();}},'updatedAt':{'type':Sequelize[_0x2ce6('0xc')],'get':function(){return moment(this[_0x2ce6('0x5')](_0x2ce6('0x13')))[_0x2ce6('0xe')](_0x2ce6('0xf'))[_0x2ce6('0x10')]();}}}; \ No newline at end of file +var _0xc00b=['exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize'];(function(_0x31a7af,_0x507c09){var _0x2ea8a3=function(_0x16ee2d){while(--_0x16ee2d){_0x31a7af['push'](_0x31a7af['shift']());}};_0x2ea8a3(++_0x507c09);}(_0xc00b,0x1e5));var _0xbc00=function(_0xc8a02c,_0x4809d3){_0xc8a02c=_0xc8a02c-0x0;var _0x3d89da=_0xc00b[_0xc8a02c];return _0x3d89da;};'use strict';var Sequelize=require(_0xbc00('0x0'));var moment=require('moment');var path=require('path');var config=require('../../config/environment');module[_0xbc00('0x1')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbc00('0x2')](_0xbc00('0x3'))?path[_0xbc00('0x4')](this[_0xbc00('0x2')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xbc00('0x5')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xbc00('0x5')],'set':function(_0x5362c6){var _0x378982=_0x5362c6[_0xbc00('0x6')](/\\/g,'/');this[_0xbc00('0x7')](_0xbc00('0x3'),_0x378982);}},'rating':{'type':Sequelize[_0xbc00('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xbc00('0x8')],'set':function(_0x51a669){this[_0xbc00('0x7')]('startedAt',moment()[_0xbc00('0x9')](_0x51a669,'ms'));this[_0xbc00('0x7')](_0xbc00('0xa'),moment());this['setDataValue'](_0xbc00('0xb'),_0x51a669);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xbc00('0x2')]('startedAt'))[_0xbc00('0xc')](_0xbc00('0xd'))[_0xbc00('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xbc00('0x2')](_0xbc00('0xa')))[_0xbc00('0xc')]('MM-DD-YYYY\x20HH:mm')[_0xbc00('0xe')]();}},'createdAt':{'type':Sequelize[_0xbc00('0xf')],'get':function(){return moment(this['getDataValue'](_0xbc00('0x10')))[_0xbc00('0xc')](_0xbc00('0xd'))[_0xbc00('0xe')]();}},'updatedAt':{'type':Sequelize[_0xbc00('0xf')],'get':function(){return moment(this[_0xbc00('0x2')](_0xbc00('0x11')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b2468d1..284656f 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 _0x4b84=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','show','params','find','catch','create','body','duration','createdAt','closedAt','value','download','uniqueid','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','differenceBy','map','format'];(function(_0x38d10a,_0xbddab1){var _0x27b7c2=function(_0x567866){while(--_0x567866){_0x38d10a['push'](_0x38d10a['shift']());}};_0x27b7c2(++_0xbddab1);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x4b84[_0x3474ac];return _0x5345ec;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x22')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x23')]){delete _0x41d673[_0x44b8('0x23')];}_0x474f01[_0x44b8('0x14')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x24')]=function(_0x242342,_0x53d9c7){var _0x2e0174={},_0x4a182d={},_0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['ScreenRecording'][_0x44b8('0x25')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x26')],'type':_0x29b18d[_0x44b8('0x27')][_0x44b8('0x28')]};});_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x2a')](_[_0x44b8('0x2b')](_0x5a544c,_0x44b8('0x23')),[_0x44b8('0x2c')]);_0x4a182d[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x242342[_0x44b8('0x2d')]);_0x4a182d['filters']=_[_0x44b8('0x2f')](_0x4a182d['model'],_0x4a182d[_0x44b8('0x2d')]);_0x2e0174[_0x44b8('0x30')]=_[_0x44b8('0x2f')](_0x4a182d[_0x44b8('0x29')],qs[_0x44b8('0x31')](_0x242342['query'][_0x44b8('0x31')]));_0x2e0174[_0x44b8('0x30')]=_0x2e0174[_0x44b8('0x30')][_0x44b8('0x32')]?_0x2e0174[_0x44b8('0x30')]:_0x4a182d['model'];if(!_0x242342[_0x44b8('0x2d')][_0x44b8('0x33')](_0x44b8('0x34'))){_0x2e0174[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x17')]);_0x2e0174[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x19')]);}_0x2e0174[_0x44b8('0x35')]=qs[_0x44b8('0x36')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x36')]);_0x2e0174[_0x44b8('0x37')]=qs[_0x44b8('0x38')](_[_0x44b8('0x39')](_0x242342[_0x44b8('0x2d')],_0x4a182d[_0x44b8('0x38')]),_0x5a544c);if(_0x242342[_0x44b8('0x2d')][_0x44b8('0x3a')]){_0x2e0174['where']=_[_0x44b8('0x3b')](_0x2e0174[_0x44b8('0x37')],{'$or':_['map'](_0x5a544c,function(_0x25688b){if(_0x25688b[_0x44b8('0x27')]!==_0x44b8('0x3c')){var _0x332c2b={};_0x332c2b[_0x25688b['name']]={'$like':'%'+_0x242342[_0x44b8('0x2d')][_0x44b8('0x3a')]+'%'};return _0x332c2b;}})});}_0x2e0174=_[_0x44b8('0x3b')]({},_0x2e0174,_0x242342[_0x44b8('0x3d')]);var _0x9cb2a={'where':_0x2e0174[_0x44b8('0x37')]};return db[_0x44b8('0x3e')][_0x44b8('0x18')](_0x9cb2a)[_0x44b8('0x20')](function(_0x3d1be1){_0xfb0028[_0x44b8('0x18')]=_0x3d1be1;if(_0x242342[_0x44b8('0x2d')][_0x44b8('0x3f')]){_0x2e0174[_0x44b8('0x40')]=[{'all':!![]}];}return db[_0x44b8('0x3e')][_0x44b8('0x41')](_0x2e0174);})['then'](function(_0x12a0a4){_0xfb0028[_0x44b8('0x42')]=_0x12a0a4;return _0xfb0028;})[_0x44b8('0x20')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))['catch'](handleError(_0x53d9c7,null));};exports[_0x44b8('0x43')]=function(_0x1054c5,_0x229cc9){var _0x585a16={'raw':![],'where':{'id':_0x1054c5[_0x44b8('0x44')]['id']}},_0xbad4bb={};_0xbad4bb[_0x44b8('0x29')]=_[_0x44b8('0x2e')](db[_0x44b8('0x3e')]['rawAttributes']);_0xbad4bb['query']=_[_0x44b8('0x2e')](_0x1054c5[_0x44b8('0x2d')]);_0xbad4bb[_0x44b8('0x38')]=_[_0x44b8('0x2f')](_0xbad4bb[_0x44b8('0x29')],_0xbad4bb[_0x44b8('0x2d')]);_0x585a16[_0x44b8('0x30')]=_[_0x44b8('0x2f')](_0xbad4bb[_0x44b8('0x29')],qs[_0x44b8('0x31')](_0x1054c5[_0x44b8('0x2d')][_0x44b8('0x31')]));_0x585a16[_0x44b8('0x30')]=_0x585a16[_0x44b8('0x30')][_0x44b8('0x32')]?_0x585a16[_0x44b8('0x30')]:_0xbad4bb[_0x44b8('0x29')];if(_0x1054c5[_0x44b8('0x2d')][_0x44b8('0x3f')]){_0x585a16['include']=[{'all':!![]}];}_0x585a16=_['merge']({},_0x585a16,_0x1054c5[_0x44b8('0x3d')]);return db[_0x44b8('0x3e')][_0x44b8('0x45')](_0x585a16)[_0x44b8('0x20')](handleEntityNotFound(_0x229cc9,null))[_0x44b8('0x20')](respondWithResult(_0x229cc9,null))[_0x44b8('0x46')](handleError(_0x229cc9,null));};exports[_0x44b8('0x47')]=function(_0x4fe73f,_0x156070){return db['ScreenRecording'][_0x44b8('0x47')](_0x4fe73f[_0x44b8('0x48')],{})[_0x44b8('0x20')](respondWithResult(_0x156070,0xc9))[_0x44b8('0x46')](handleError(_0x156070,null));};exports[_0x44b8('0x1f')]=function(_0x35ca19,_0x491600){if(_0x35ca19[_0x44b8('0x48')]['id']){delete _0x35ca19[_0x44b8('0x48')]['id'];}delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x49')];delete _0x35ca19['body'][_0x44b8('0x4a')];delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x4b')];delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x4c')];return db[_0x44b8('0x3e')]['find']({'where':{'id':_0x35ca19[_0x44b8('0x44')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x491600,null))[_0x44b8('0x20')](saveUpdates(_0x35ca19[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x491600,null))['catch'](handleError(_0x491600,null));};exports['describe']=function(_0x2516fc,_0x4eb344){return db[_0x44b8('0x3e')]['describe']()[_0x44b8('0x20')](respondWithResult(_0x4eb344,null))[_0x44b8('0x46')](handleError(_0x4eb344,null));};exports[_0x44b8('0x4d')]=function(_0x15f4c6,_0x2fa6b4,_0x32f588){var _0xdc67e8=require('../../components/encryptor');var _0x3ad278=![];var _0x37b2c2={};if(_0x15f4c6[_0x44b8('0x2d')]['type']&&_0x15f4c6[_0x44b8('0x2d')][_0x44b8('0x27')]===_0x44b8('0x4e')){_0x37b2c2[_0x44b8('0x4e')]=_0x15f4c6['params']['id'];}else{_0x37b2c2['id']=_0x15f4c6[_0x44b8('0x44')]['id'];}return db[_0x44b8('0x3e')]['find']({'where':_0x37b2c2,'attributes':['id',_0x44b8('0x4c')],'raw':!![]})[_0x44b8('0x20')](handleEntityNotFound(_0x2fa6b4,null))[_0x44b8('0x20')](function(_0x3df6aa){if(_0x3df6aa){var _0xe86e34=path['join'](config['root'],_0x44b8('0x4f'),_0x3df6aa[_0x44b8('0x4c')]);var _0xa30834=util[_0x44b8('0x2c')](_0x44b8('0x50'),_0xe86e34);if(fs[_0x44b8('0x51')](_0xa30834)){_0x3ad278=!![];return _0xdc67e8[_0x44b8('0x52')](_0xa30834,_0xe86e34,config[_0x44b8('0x53')][_0x44b8('0x54')])[_0x44b8('0x20')](function(){return _0x3df6aa;});}return _0x3df6aa;}})[_0x44b8('0x20')](function(_0x3f7576){if(_0x3f7576){var _0x5af3e6=path[_0x44b8('0x55')](config[_0x44b8('0x56')],_0x44b8('0x4f'),_0x3f7576[_0x44b8('0x4c')]);if(!fs[_0x44b8('0x51')](_0x5af3e6)){throw new db[(_0x44b8('0x57'))][(_0x44b8('0x58'))](_0x44b8('0x59'));}if(_0x3f7576[_0x44b8('0x5a')]){return _0x2fa6b4[_0x44b8('0x4d')](_0x5af3e6,_0x3f7576[_0x44b8('0x5a')]+path[_0x44b8('0x5b')](_0x5af3e6),function(){if(_0x3ad278){fs[_0x44b8('0x5c')](_0x5af3e6);}});}else{return _0x2fa6b4[_0x44b8('0x4d')](_0x5af3e6,function(_0x2250bb){if(_0x3ad278){fs[_0x44b8('0x5c')](_0x5af3e6);}});}}})[_0x44b8('0x46')](function(_0x20e563){if(_0x20e563['message']===_0x44b8('0x59')){_0x2fa6b4[_0x44b8('0x14')](0x194)[_0x44b8('0x5d')](_0x44b8('0x5e'));}else{return handleError(_0x2fa6b4,null);}});};exports[_0x44b8('0x21')]=function(_0x29ed5d,_0x2ecf65){return db['ScreenRecording'][_0x44b8('0x45')]({'where':{'id':_0x29ed5d[_0x44b8('0x44')]['id']}})['then'](function(_0x2a95f6){if(_[_0x44b8('0x5f')](_0x2a95f6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2a95f6;})[_0x44b8('0x20')](function(_0x454fe6){var _0x370618=path['join'](config[_0x44b8('0x56')],'server/files/screen_recordings',_0x454fe6[_0x44b8('0x4c')]);logger['info'](_0x44b8('0x60'),_0x370618);if(!_[_0x44b8('0x5f')](_0x454fe6[_0x44b8('0x4c')])&&fs[_0x44b8('0x51')](_0x370618)){logger[_0x44b8('0x61')](_0x44b8('0x62')+_0x370618+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x44b8('0x63')](_0x370618);}_0x370618=_0x370618+'.cypher';if(!_[_0x44b8('0x5f')](_0x454fe6[_0x44b8('0x4c')])&&fs['existsSync'](_0x370618)){logger[_0x44b8('0x61')](_0x44b8('0x62')+_0x370618+_0x44b8('0x64'));fs[_0x44b8('0x63')](_0x370618);}return _0x454fe6;})[_0x44b8('0x20')](function(_0x3774fe){if(!_0x3774fe)throw new InternalError();return _0x3774fe[_0x44b8('0x21')]();})[_0x44b8('0x20')](function(){_0x2ecf65[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();})[_0x44b8('0x46')](handleError(_0x2ecf65,null));}; \ No newline at end of file +var _0x207c=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb'];(function(_0x58fd96,_0x57b2d1){var _0x57d274=function(_0x3b9fbb){while(--_0x3b9fbb){_0x58fd96['push'](_0x58fd96['shift']());}};_0x57d274(++_0x57b2d1);}(_0x207c,0x1e8));var _0xc207=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x207c[_0x3f3a47];return _0x57a682;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc207('0x0'));var zipdir=require(_0xc207('0x1'));var jsonpatch=require(_0xc207('0x2'));var rp=require(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var BPromise=require(_0xc207('0x5'));var Mustache=require(_0xc207('0x6'));var util=require('util');var path=require(_0xc207('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc207('0x8'));var _=require(_0xc207('0x9'));var squel=require(_0xc207('0xa'));var crypto=require('crypto');var jsforce=require(_0xc207('0xb'));var deskjs=require(_0xc207('0xc'));var toCsv=require(_0xc207('0xd'));var querystring=require('querystring');var Papa=require(_0xc207('0xe'));var Redis=require(_0xc207('0xf'));var authService=require(_0xc207('0x10'));var qs=require(_0xc207('0x11'));var as=require(_0xc207('0x12'));var hardwareService=require(_0xc207('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc207('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc207('0x15'))['db'];function respondWithStatusCode(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xcc;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0x16')](_0x59d401);}return _0x2782ce[_0xc207('0x17')](_0x59d401)[_0xc207('0x18')]();};}function respondWithResult(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0xc8;return function(_0xc62672){if(_0xc62672){return _0xe993a0[_0xc207('0x17')](_0x51e967)[_0xc207('0x19')](_0xc62672);}};}function respondWithFilteredResult(_0x4031ad,_0x4ef6c4){return function(_0x564cef){if(_0x564cef){var _0x554e5c=typeof _0x4ef6c4[_0xc207('0x1a')]===_0xc207('0x1b')&&typeof _0x4ef6c4[_0xc207('0x1c')]===_0xc207('0x1b');var _0x4b8f44=_0x564cef[_0xc207('0x1d')];var _0x282595=_0x554e5c?0x0:_0x4ef6c4[_0xc207('0x1a')];var _0x5f288e=_0x554e5c?_0x564cef[_0xc207('0x1d')]:_0x4ef6c4['offset']+_0x4ef6c4[_0xc207('0x1c')];var _0x33ddb1;if(_0x5f288e>=_0x4b8f44){_0x5f288e=_0x4b8f44;_0x33ddb1=0xc8;}else{_0x33ddb1=0xce;}_0x4031ad[_0xc207('0x17')](_0x33ddb1);return _0x4031ad[_0xc207('0x1e')](_0xc207('0x1f'),_0x282595+'-'+_0x5f288e+'/'+_0x4b8f44)[_0xc207('0x19')](_0x564cef);}return null;};}function patchUpdates(_0x35c0b0){return function(_0x464dea){try{jsonpatch[_0xc207('0x20')](_0x464dea,_0x35c0b0,!![]);}catch(_0x2bd2eb){return BPromise[_0xc207('0x21')](_0x2bd2eb);}return _0x464dea[_0xc207('0x22')]();};}function saveUpdates(_0x40de25,_0x4b52a7){return function(_0x163b36){if(_0x163b36){return _0x163b36['update'](_0x40de25)[_0xc207('0x23')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x1eabe8,_0x83253f){return function(_0x3539f4){if(_0x3539f4){return _0x3539f4[_0xc207('0x24')]()[_0xc207('0x23')](function(){_0x1eabe8[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();});}};}function handleEntityNotFound(_0x2385f7,_0x25c91e){return function(_0x27df03){if(!_0x27df03){_0x2385f7[_0xc207('0x16')](0x194);}return _0x27df03;};}function handleError(_0x138970,_0x1445d3){_0x1445d3=_0x1445d3||0x1f4;return function(_0x56a066){logger[_0xc207('0x25')](_0x56a066['stack']);if(_0x56a066['name']){delete _0x56a066[_0xc207('0x26')];}_0x138970[_0xc207('0x17')](_0x1445d3)[_0xc207('0x27')](_0x56a066);};}exports[_0xc207('0x28')]=function(_0x6a653d,_0x478af7){var _0xe5e848={},_0x463ac8={},_0x6223ef={'count':0x0,'rows':[]};var _0x1bec3f=_[_0xc207('0x29')](db[_0xc207('0x2a')][_0xc207('0x2b')],function(_0x27bc72){return{'name':_0x27bc72[_0xc207('0x2c')],'type':_0x27bc72[_0xc207('0x2d')][_0xc207('0x2e')]};});_0x463ac8[_0xc207('0x2f')]=_[_0xc207('0x30')](_['map'](_0x1bec3f,_0xc207('0x26')),[_0xc207('0x31')]);_0x463ac8[_0xc207('0x32')]=_[_0xc207('0x33')](_0x6a653d[_0xc207('0x32')]);_0x463ac8[_0xc207('0x34')]=_['intersection'](_0x463ac8[_0xc207('0x2f')],_0x463ac8[_0xc207('0x32')]);_0xe5e848[_0xc207('0x35')]=_[_0xc207('0x36')](_0x463ac8['model'],qs[_0xc207('0x37')](_0x6a653d[_0xc207('0x32')][_0xc207('0x37')]));_0xe5e848[_0xc207('0x35')]=_0xe5e848[_0xc207('0x35')][_0xc207('0x38')]?_0xe5e848[_0xc207('0x35')]:_0x463ac8[_0xc207('0x2f')];if(!_0x6a653d[_0xc207('0x32')]['hasOwnProperty']('nolimit')){_0xe5e848[_0xc207('0x1c')]=qs[_0xc207('0x1c')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1c')]);_0xe5e848['offset']=qs[_0xc207('0x1a')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1a')]);}_0xe5e848[_0xc207('0x39')]=qs[_0xc207('0x3a')](_0x6a653d['query'][_0xc207('0x3a')]);_0xe5e848[_0xc207('0x3b')]=qs['filters'](_[_0xc207('0x3c')](_0x6a653d['query'],_0x463ac8[_0xc207('0x34')]),_0x1bec3f);if(_0x6a653d[_0xc207('0x32')]['filter']){_0xe5e848[_0xc207('0x3b')]=_[_0xc207('0x3d')](_0xe5e848[_0xc207('0x3b')],{'$or':_['map'](_0x1bec3f,function(_0x5b3041){if(_0x5b3041[_0xc207('0x2d')]!==_0xc207('0x3e')){var _0x41d66c={};_0x41d66c[_0x5b3041[_0xc207('0x26')]]={'$like':'%'+_0x6a653d['query'][_0xc207('0x3f')]+'%'};return _0x41d66c;}})});}_0xe5e848=_['merge']({},_0xe5e848,_0x6a653d['options']);var _0x4c10ed={'where':_0xe5e848['where']};return db[_0xc207('0x2a')][_0xc207('0x1d')](_0x4c10ed)[_0xc207('0x23')](function(_0x487f98){_0x6223ef[_0xc207('0x1d')]=_0x487f98;if(_0x6a653d[_0xc207('0x32')][_0xc207('0x40')]){_0xe5e848[_0xc207('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc207('0x42')](_0xe5e848);})[_0xc207('0x23')](function(_0x123a46){_0x6223ef[_0xc207('0x43')]=_0x123a46;return _0x6223ef;})[_0xc207('0x23')](respondWithFilteredResult(_0x478af7,_0xe5e848))['catch'](handleError(_0x478af7,null));};exports[_0xc207('0x44')]=function(_0x19a67d,_0x3a935a){var _0x471a85={'raw':![],'where':{'id':_0x19a67d[_0xc207('0x45')]['id']}},_0x153490={};_0x153490[_0xc207('0x2f')]=_[_0xc207('0x33')](db[_0xc207('0x2a')]['rawAttributes']);_0x153490[_0xc207('0x32')]=_[_0xc207('0x33')](_0x19a67d['query']);_0x153490[_0xc207('0x34')]=_[_0xc207('0x36')](_0x153490[_0xc207('0x2f')],_0x153490[_0xc207('0x32')]);_0x471a85[_0xc207('0x35')]=_['intersection'](_0x153490[_0xc207('0x2f')],qs[_0xc207('0x37')](_0x19a67d[_0xc207('0x32')]['fields']));_0x471a85[_0xc207('0x35')]=_0x471a85[_0xc207('0x35')][_0xc207('0x38')]?_0x471a85[_0xc207('0x35')]:_0x153490['model'];if(_0x19a67d['query'][_0xc207('0x40')]){_0x471a85[_0xc207('0x41')]=[{'all':!![]}];}_0x471a85=_[_0xc207('0x3d')]({},_0x471a85,_0x19a67d[_0xc207('0x46')]);return db[_0xc207('0x2a')][_0xc207('0x47')](_0x471a85)[_0xc207('0x23')](handleEntityNotFound(_0x3a935a,null))[_0xc207('0x23')](respondWithResult(_0x3a935a,null))[_0xc207('0x48')](handleError(_0x3a935a,null));};exports[_0xc207('0x49')]=function(_0x2afcd1,_0x2fda4f){return db['ScreenRecording']['create'](_0x2afcd1[_0xc207('0x4a')],{})[_0xc207('0x23')](respondWithResult(_0x2fda4f,0xc9))[_0xc207('0x48')](handleError(_0x2fda4f,null));};exports['update']=function(_0x2b89e0,_0x3f712d){if(_0x2b89e0[_0xc207('0x4a')]['id']){delete _0x2b89e0[_0xc207('0x4a')]['id'];}delete _0x2b89e0['body'][_0xc207('0x4b')];delete _0x2b89e0['body'][_0xc207('0x4c')];delete _0x2b89e0['body']['closedAt'];delete _0x2b89e0[_0xc207('0x4a')][_0xc207('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x2b89e0['params']['id']}})[_0xc207('0x23')](handleEntityNotFound(_0x3f712d,null))[_0xc207('0x23')](saveUpdates(_0x2b89e0[_0xc207('0x4a')],null))[_0xc207('0x23')](respondWithResult(_0x3f712d,null))[_0xc207('0x48')](handleError(_0x3f712d,null));};exports[_0xc207('0x4e')]=function(_0x3dc457,_0x1dfdee){return db['ScreenRecording'][_0xc207('0x4e')]()[_0xc207('0x23')](respondWithResult(_0x1dfdee,null))['catch'](handleError(_0x1dfdee,null));};exports['download']=function(_0x362001,_0x47c630,_0x49a78b){var _0x2634d6=require(_0xc207('0x4f'));var _0x356c8c=![];var _0x3b2448={};if(_0x362001[_0xc207('0x32')][_0xc207('0x2d')]&&_0x362001[_0xc207('0x32')][_0xc207('0x2d')]===_0xc207('0x50')){_0x3b2448[_0xc207('0x50')]=_0x362001[_0xc207('0x45')]['id'];}else{_0x3b2448['id']=_0x362001['params']['id'];}return db['ScreenRecording'][_0xc207('0x47')]({'where':_0x3b2448,'attributes':['id',_0xc207('0x4d')],'raw':!![]})[_0xc207('0x23')](handleEntityNotFound(_0x47c630,null))[_0xc207('0x23')](function(_0xaff7a0){if(_0xaff7a0){var _0x21c12b=path[_0xc207('0x51')](config[_0xc207('0x52')],_0xc207('0x53'),_0xaff7a0['value']);var _0x1cc4e3=util[_0xc207('0x31')](_0xc207('0x54'),_0x21c12b);if(fs[_0xc207('0x55')](_0x1cc4e3)){_0x356c8c=!![];return _0x2634d6['decryptFile'](_0x1cc4e3,_0x21c12b,config[_0xc207('0x56')][_0xc207('0x57')])[_0xc207('0x23')](function(){return _0xaff7a0;});}return _0xaff7a0;}})[_0xc207('0x23')](function(_0x464263){if(_0x464263){var _0x45ad58=path[_0xc207('0x51')](config['root'],_0xc207('0x53'),_0x464263[_0xc207('0x4d')]);if(!fs[_0xc207('0x55')](_0x45ad58)){throw new db[(_0xc207('0x58'))]['ValidationError'](_0xc207('0x59'));}if(_0x464263['filename']){return _0x47c630['download'](_0x45ad58,_0x464263[_0xc207('0x5a')]+path[_0xc207('0x5b')](_0x45ad58),function(){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}else{return _0x47c630[_0xc207('0x5d')](_0x45ad58,function(_0x441d5f){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}}})[_0xc207('0x48')](function(_0x33c372){if(_0x33c372[_0xc207('0x5e')]===_0xc207('0x59')){_0x47c630[_0xc207('0x17')](0x194)[_0xc207('0x27')](_0xc207('0x5f'));}else{return handleError(_0x47c630,null);}});};exports[_0xc207('0x24')]=function(_0x282ae5,_0x501bca){return db[_0xc207('0x2a')]['find']({'where':{'id':_0x282ae5[_0xc207('0x45')]['id']}})[_0xc207('0x23')](function(_0x2ade23){if(_['isNil'](_0x2ade23)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2ade23;})[_0xc207('0x23')](function(_0x3ac0dd){var _0x2f18a2=path['join'](config[_0xc207('0x52')],_0xc207('0x53'),_0x3ac0dd[_0xc207('0x4d')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2f18a2);if(!_[_0xc207('0x60')](_0x3ac0dd['value'])&&fs[_0xc207('0x55')](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}_0x2f18a2=_0x2f18a2+_0xc207('0x65');if(!_[_0xc207('0x60')](_0x3ac0dd[_0xc207('0x4d')])&&fs['existsSync'](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}return _0x3ac0dd;})[_0xc207('0x23')](function(_0x14050a){if(!_0x14050a)throw new InternalError();return _0x14050a[_0xc207('0x24')]();})[_0xc207('0x23')](function(){_0x501bca[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();})[_0xc207('0x48')](handleError(_0x501bca,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 854323a..6307583 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 _0x6bb9=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','screen_recordings','interactionid','util','../../config/logger','api'];(function(_0x2aa009,_0x5a1f96){var _0x52d850=function(_0x4f7438){while(--_0x4f7438){_0x2aa009['push'](_0x2aa009['shift']());}};_0x52d850(++_0x5a1f96);}(_0x6bb9,0x8d));var _0x96bb=function(_0x4d8faf,_0x3db2d0){_0x4d8faf=_0x4d8faf-0x0;var _0x1585ad=_0x6bb9[_0x4d8faf];return _0x1585ad;};'use strict';var _=require('lodash');var util=require(_0x96bb('0x0'));var logger=require(_0x96bb('0x1'))(_0x96bb('0x2'));var moment=require('moment');var BPromise=require(_0x96bb('0x3'));var rp=require(_0x96bb('0x4'));var fs=require('fs');var path=require(_0x96bb('0x5'));var rimraf=require(_0x96bb('0x6'));var config=require(_0x96bb('0x7'));var attributes=require('./screenRecording.attributes');module[_0x96bb('0x8')]=function(_0x3e1e2d,_0x3de147){return _0x3e1e2d[_0x96bb('0x9')]('ScreenRecording',attributes,{'tableName':_0x96bb('0xa'),'paranoid':![],'indexes':[{'name':_0x96bb('0xb'),'fields':[_0x96bb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d6b=['screen_recordings','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x0d6b,0x1da));var _0xb0d6=function(_0x2ff19f,_0xbefc43){_0x2ff19f=_0x2ff19f-0x0;var _0x1983d4=_0x0d6b[_0x2ff19f];return _0x1983d4;};'use strict';var _=require(_0xb0d6('0x0'));var util=require('util');var logger=require(_0xb0d6('0x1'))('api');var moment=require(_0xb0d6('0x2'));var BPromise=require('bluebird');var rp=require(_0xb0d6('0x3'));var fs=require('fs');var path=require(_0xb0d6('0x4'));var rimraf=require(_0xb0d6('0x5'));var config=require(_0xb0d6('0x6'));var attributes=require(_0xb0d6('0x7'));module[_0xb0d6('0x8')]=function(_0x57fa93,_0x17f835){return _0x57fa93[_0xb0d6('0x9')]('ScreenRecording',attributes,{'tableName':_0xb0d6('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','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 a540033..73a30a5 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 _0x479c=['request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x226205,_0x1c6e68){var _0x228291=function(_0x38e838){while(--_0x38e838){_0x226205['push'](_0x226205['shift']());}};_0x228291(++_0x1c6e68);}(_0x479c,0x195));var _0xc479=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x479c[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xc479('0x0'));var util=require(_0xc479('0x1'));var moment=require(_0xc479('0x2'));var BPromise=require('bluebird');var rs=require(_0xc479('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc479('0x4'))['db'];var utils=require(_0xc479('0x5'));var logger=require('../../config/logger')(_0xc479('0x6'));var config=require(_0xc479('0x7'));var jayson=require(_0xc479('0x8'));var client=jayson[_0xc479('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b8ce2,_0x34b762,_0x316ed8){return new BPromise(function(_0x2cd2a4,_0x85a6bc){return client['request'](_0x2b8ce2,_0x316ed8)[_0xc479('0xa')](function(_0x3a0815){logger[_0xc479('0xb')](_0xc479('0xc'),_0x34b762,'request\x20sent');logger[_0xc479('0xd')](_0xc479('0xe'),_0x34b762,_0xc479('0xf'),JSON[_0xc479('0x10')](_0x3a0815));if(_0x3a0815[_0xc479('0x11')]){if(_0x3a0815['error'][_0xc479('0x12')]===0x1f4){logger[_0xc479('0x11')](_0xc479('0xc'),_0x34b762,_0x3a0815[_0xc479('0x11')][_0xc479('0x13')]);return _0x85a6bc(_0x3a0815[_0xc479('0x11')][_0xc479('0x13')]);}logger[_0xc479('0x11')](_0xc479('0xc'),_0x34b762,_0x3a0815[_0xc479('0x11')][_0xc479('0x13')]);return _0x2cd2a4(_0x3a0815[_0xc479('0x11')][_0xc479('0x13')]);}else{logger[_0xc479('0xb')](_0xc479('0xc'),_0x34b762,'request\x20sent');_0x2cd2a4(_0x3a0815['result'][_0xc479('0x13')]);}})[_0xc479('0x14')](function(_0x131fd3){logger[_0xc479('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x34b762,_0x131fd3);_0x85a6bc(_0x131fd3);});});} \ No newline at end of file +var _0x6665=['then','info','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x43b624,_0x18168d){var _0x29e970=function(_0x4a91e2){while(--_0x4a91e2){_0x43b624['push'](_0x43b624['shift']());}};_0x29e970(++_0x18168d);}(_0x6665,0xe4));var _0x5666=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x6665[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0x5666('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5666('0x1'));var rs=require(_0x5666('0x2'));var fs=require('fs');var Redis=require(_0x5666('0x3'));var db=require(_0x5666('0x4'))['db'];var utils=require(_0x5666('0x5'));var logger=require(_0x5666('0x6'))(_0x5666('0x7'));var config=require(_0x5666('0x8'));var jayson=require(_0x5666('0x9'));var client=jayson['client'][_0x5666('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x962ae1,_0xaa5776,_0x3dc893){return new BPromise(function(_0x5ca26d,_0x8a531c){return client[_0x5666('0xb')](_0x962ae1,_0x3dc893)[_0x5666('0xc')](function(_0x35ee45){logger[_0x5666('0xd')]('ScreenRecording,\x20%s,\x20%s',_0xaa5776,'request\x20sent');logger[_0x5666('0xe')](_0x5666('0xf'),_0xaa5776,_0x5666('0x10'),JSON[_0x5666('0x11')](_0x35ee45));if(_0x35ee45[_0x5666('0x12')]){if(_0x35ee45['error'][_0x5666('0x13')]===0x1f4){logger[_0x5666('0x12')]('ScreenRecording,\x20%s,\x20%s',_0xaa5776,_0x35ee45[_0x5666('0x12')][_0x5666('0x14')]);return _0x8a531c(_0x35ee45[_0x5666('0x12')][_0x5666('0x14')]);}logger[_0x5666('0x12')](_0x5666('0x15'),_0xaa5776,_0x35ee45[_0x5666('0x12')][_0x5666('0x14')]);return _0x5ca26d(_0x35ee45['error'][_0x5666('0x14')]);}else{logger['info'](_0x5666('0x15'),_0xaa5776,'request\x20sent');_0x5ca26d(_0x35ee45[_0x5666('0x16')][_0x5666('0x14')]);}})[_0x5666('0x17')](function(_0x5ef618){logger[_0x5666('0x12')](_0x5666('0x15'),_0xaa5776,_0x5ef618);_0x8a531c(_0x5ef618);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 20189c4..ec98c67 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 _0xe8f2=['fs-extra','../../config/environment','index','get','/now','getDate','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','post','/:id/logo','single','addLogo','format','logologin','extname','file','preferred','addPreferred','favicon','originalname','put','/:id','isAuthenticated','util','connect-timeout','express','Router'];(function(_0x936127,_0x53e88a){var _0x5f53ea=function(_0x1ee3ab){while(--_0x1ee3ab){_0x936127['push'](_0x936127['shift']());}};_0x5f53ea(++_0x53e88a);}(_0xe8f2,0x74));var _0x2e8f=function(_0x261f8c,_0x518fa7){_0x261f8c=_0x261f8c-0x0;var _0x498c3a=_0xe8f2[_0x261f8c];return _0x498c3a;};'use strict';var multer=require('multer');var util=require(_0x2e8f('0x0'));var path=require('path');var timeout=require(_0x2e8f('0x1'));var express=require(_0x2e8f('0x2'));var router=express[_0x2e8f('0x3')]();var fs_extra=require(_0x2e8f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2e8f('0x5'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2e8f('0x6')]);router[_0x2e8f('0x7')](_0x2e8f('0x8'),controller[_0x2e8f('0x9')]);router[_0x2e8f('0x7')]('/:id',controller[_0x2e8f('0xa')]);router[_0x2e8f('0x7')]('/:id/logo',controller[_0x2e8f('0xb')]);router[_0x2e8f('0x7')](_0x2e8f('0xc'),controller[_0x2e8f('0xd')]);router[_0x2e8f('0x7')](_0x2e8f('0xe'),controller[_0x2e8f('0xf')]);router[_0x2e8f('0x7')](_0x2e8f('0x10'),controller[_0x2e8f('0x11')]);router[_0x2e8f('0x7')](_0x2e8f('0x12'),controller[_0x2e8f('0x13')]);var upload=multer({'storage':multer[_0x2e8f('0x14')]({'destination':function(_0x489ac5,_0x5f4d10,_0x2a7b22){_0x2a7b22(null,path[_0x2e8f('0x15')](config[_0x2e8f('0x16')],_0x2e8f('0x17')));},'filename':function(_0x3dc04e,_0x58e891,_0x1e2d90){_0x1e2d90(null,util['format'](_0x2e8f('0x18'),'logo',path['extname'](_0x58e891['originalname'])));}})});router[_0x2e8f('0x19')](_0x2e8f('0x1a'),upload[_0x2e8f('0x1b')]('file'),controller[_0x2e8f('0x1c')]);var upload=multer({'storage':multer[_0x2e8f('0x14')]({'destination':function(_0x390b3d,_0x334973,_0x1ce432){_0x1ce432(null,path['join'](config[_0x2e8f('0x16')],_0x2e8f('0x17')));},'filename':function(_0x5b31c2,_0x48f33f,_0x121d75){_0x121d75(null,util[_0x2e8f('0x1d')](_0x2e8f('0x18'),_0x2e8f('0x1e'),path[_0x2e8f('0x1f')](_0x48f33f['originalname'])));}})});router[_0x2e8f('0x19')](_0x2e8f('0xc'),upload['single'](_0x2e8f('0x20')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x2e8f('0x14')]({'destination':function(_0x43d1f6,_0x624215,_0x495245){_0x495245(null,path[_0x2e8f('0x15')](config[_0x2e8f('0x16')],_0x2e8f('0x17')));},'filename':function(_0x892f77,_0x7fd44b,_0x57b93f){_0x57b93f(null,util[_0x2e8f('0x1d')](_0x2e8f('0x18'),_0x2e8f('0x21'),path['extname'](_0x7fd44b['originalname'])));}})});router[_0x2e8f('0x19')]('/:id/preferred',upload['single']('file'),controller[_0x2e8f('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9cf09a,_0x5336f8,_0x4ee933){_0x4ee933(null,path[_0x2e8f('0x15')](config[_0x2e8f('0x16')],_0x2e8f('0x17')));},'filename':function(_0x35ae65,_0x1a826d,_0x1bfbca){_0x1bfbca(null,util[_0x2e8f('0x1d')](_0x2e8f('0x18'),_0x2e8f('0x23'),path[_0x2e8f('0x1f')](_0x1a826d[_0x2e8f('0x24')])));}})});router[_0x2e8f('0x19')]('/:id/favicon',upload['single'](_0x2e8f('0x20')),controller['addFavicon']);router[_0x2e8f('0x25')](_0x2e8f('0x26'),auth[_0x2e8f('0x27')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xef3f=['single','addLogo','join','logologin','file','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xef3f,0x164));var _0xfef3=function(_0x264c23,_0x266966){_0x264c23=_0x264c23-0x0;var _0x3bc271=_0xef3f[_0x264c23];return _0x3bc271;};'use strict';var multer=require(_0xfef3('0x0'));var util=require('util');var path=require(_0xfef3('0x1'));var timeout=require('connect-timeout');var express=require(_0xfef3('0x2'));var router=express[_0xfef3('0x3')]();var fs_extra=require(_0xfef3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfef3('0x5'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xfef3('0x6')]('/',auth[_0xfef3('0x7')](),controller[_0xfef3('0x8')]);router['get'](_0xfef3('0x9'),controller[_0xfef3('0xa')]);router[_0xfef3('0x6')](_0xfef3('0xb'),controller[_0xfef3('0xc')]);router['get'](_0xfef3('0xd'),controller[_0xfef3('0xe')]);router[_0xfef3('0x6')](_0xfef3('0xf'),controller[_0xfef3('0x10')]);router[_0xfef3('0x6')]('/:id/gdpr',controller[_0xfef3('0x11')]);router[_0xfef3('0x6')](_0xfef3('0x12'),controller[_0xfef3('0x13')]);router[_0xfef3('0x6')](_0xfef3('0x14'),controller[_0xfef3('0x15')]);var upload=multer({'storage':multer[_0xfef3('0x16')]({'destination':function(_0x37251d,_0x4d5bbc,_0x4984ca){_0x4984ca(null,path['join'](config[_0xfef3('0x17')],_0xfef3('0x18')));},'filename':function(_0x2e6e60,_0x491a9c,_0x1705a9){_0x1705a9(null,util[_0xfef3('0x19')](_0xfef3('0x1a'),_0xfef3('0x1b'),path[_0xfef3('0x1c')](_0x491a9c[_0xfef3('0x1d')])));}})});router[_0xfef3('0x1e')](_0xfef3('0xd'),upload[_0xfef3('0x1f')]('file'),controller[_0xfef3('0x20')]);var upload=multer({'storage':multer[_0xfef3('0x16')]({'destination':function(_0x17ab6c,_0x28af3b,_0x2c831a){_0x2c831a(null,path[_0xfef3('0x21')](config[_0xfef3('0x17')],_0xfef3('0x18')));},'filename':function(_0x63cc0c,_0xe7ee9c,_0x337c77){_0x337c77(null,util[_0xfef3('0x19')](_0xfef3('0x1a'),_0xfef3('0x22'),path[_0xfef3('0x1c')](_0xe7ee9c[_0xfef3('0x1d')])));}})});router['post'](_0xfef3('0xf'),upload[_0xfef3('0x1f')](_0xfef3('0x23')),controller[_0xfef3('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x544cc2,_0x415f31,_0xd5cf8f){_0xd5cf8f(null,path[_0xfef3('0x21')](config[_0xfef3('0x17')],_0xfef3('0x18')));},'filename':function(_0x2bf6e1,_0x4ca2e8,_0xb05579){_0xb05579(null,util[_0xfef3('0x19')](_0xfef3('0x1a'),_0xfef3('0x25'),path[_0xfef3('0x1c')](_0x4ca2e8[_0xfef3('0x1d')])));}})});router[_0xfef3('0x1e')](_0xfef3('0x12'),upload[_0xfef3('0x1f')](_0xfef3('0x23')),controller[_0xfef3('0x26')]);var upload=multer({'storage':multer[_0xfef3('0x16')]({'destination':function(_0x88a18a,_0x358f95,_0x5a5732){_0x5a5732(null,path['join'](config['root'],_0xfef3('0x18')));},'filename':function(_0x3d2ae3,_0x4a857e,_0x3737b4){_0x3737b4(null,util[_0xfef3('0x19')](_0xfef3('0x1a'),_0xfef3('0x27'),path[_0xfef3('0x1c')](_0x4a857e[_0xfef3('0x1d')])));}})});router['post'](_0xfef3('0x14'),upload[_0xfef3('0x1f')](_0xfef3('0x23')),controller['addFavicon']);router[_0xfef3('0x28')](_0xfef3('0xb'),auth['isAuthenticated'](),controller[_0xfef3('0x29')]);module[_0xfef3('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 609f749..68d04f9 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 _0xeb3d=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x450407,_0x3793e2){var _0x23a187=function(_0x2e764c){while(--_0x2e764c){_0x450407['push'](_0x450407['shift']());}};_0x23a187(++_0x3793e2);}(_0xeb3d,0x1d6));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdeb3('0x0'));module[_0xdeb3('0x1')]={'min_internal':{'type':Sequelize[_0xdeb3('0x2')](0xb),'unique':_0xdeb3('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xdeb3('0x2')](0xb),'unique':_0xdeb3('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xdeb3('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xdeb3('0x5')],'defaultValue':_0xdeb3('0x6')},'logo':{'type':Sequelize[_0xdeb3('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xdeb3('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xdeb3('0x5')]},'turnaddr':{'type':Sequelize[_0xdeb3('0x5')]},'turnusername':{'type':Sequelize[_0xdeb3('0x5')]},'turnpassword':{'type':Sequelize[_0xdeb3('0x5')]},'pageTitle':{'type':Sequelize[_0xdeb3('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xdeb3('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xdeb3('0x5')],'defaultValue':_0xdeb3('0x8')},'enableEmailPreview':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xdeb3('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xdeb3('0x5')]},'defaultPreferred':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xdeb3('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xdeb3('0x5')]},'defaultFavicon':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xdeb3('0x2')]},'sentimentRegion':{'type':Sequelize[_0xdeb3('0x5')]},'language':{'type':Sequelize[_0xdeb3('0x5')]},'bucket':{'type':Sequelize[_0xdeb3('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xdeb3('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xdeb3('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xdeb3('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xdeb3('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xdeb3('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x3861=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED'];(function(_0x12f036,_0x27e401){var _0xf0be1b=function(_0x4084c){while(--_0x4084c){_0x12f036['push'](_0x12f036['shift']());}};_0xf0be1b(++_0x27e401);}(_0x3861,0x1c2));var _0x1386=function(_0x1d78bd,_0x55da95){_0x1d78bd=_0x1d78bd-0x0;var _0x51fc0e=_0x3861[_0x1d78bd];return _0x51fc0e;};'use strict';var Sequelize=require(_0x1386('0x0'));module[_0x1386('0x1')]={'min_internal':{'type':Sequelize[_0x1386('0x2')](0xb),'unique':_0x1386('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1386('0x2')](0xb),'unique':_0x1386('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1386('0x5')],'defaultValue':_0x1386('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1386('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1386('0x5')]},'turnaddr':{'type':Sequelize[_0x1386('0x5')]},'turnusername':{'type':Sequelize[_0x1386('0x5')]},'turnpassword':{'type':Sequelize[_0x1386('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1386('0x5')],'defaultValue':_0x1386('0x8')},'enableEmailPreview':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1386('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x1386('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1386('0x2')]},'transcribeRegion':{'type':Sequelize[_0x1386('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x1386('0x5')]},'language':{'type':Sequelize[_0x1386('0x5')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x1386('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1386('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1386('0x2')](0x2)[_0x1386('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x1386('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x1386('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x1386('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x1386('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c2cae96..c9e8f71 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 _0x0d23=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','custom','default_logo.svg','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','existsSync','default_loginLogo.svg','gdpr','getPreferred','default_preferred.png','Sequelize','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x0d23,0xe8));var _0x30d2=function(_0x5bee16,_0x4337bb){_0x5bee16=_0x5bee16-0x0;var _0x108fe7=_0x0d23[_0x5bee16];return _0x108fe7;};'use strict';var emlformat=require(_0x30d2('0x0'));var rimraf=require(_0x30d2('0x1'));var zipdir=require(_0x30d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x30d2('0x3'));var BPromise=require(_0x30d2('0x4'));var Mustache=require(_0x30d2('0x5'));var util=require(_0x30d2('0x6'));var path=require('path');var sox=require(_0x30d2('0x7'));var csv=require(_0x30d2('0x8'));var ejs=require(_0x30d2('0x9'));var fs=require('fs');var fs_extra=require(_0x30d2('0xa'));var _=require('lodash');var squel=require(_0x30d2('0xb'));var crypto=require(_0x30d2('0xc'));var jsforce=require(_0x30d2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x30d2('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x30d2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x30d2('0xf'));var hardwareService=require(_0x30d2('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x30d2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x30d2('0x12'));var db=require(_0x30d2('0x13'))['db'];var jayson=require(_0x30d2('0x14'));var client=jayson[_0x30d2('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x200e29,_0x37d9ed,_0x41b3b4,_0x3f3f15){return new BPromise(function(_0x1433ba,_0x180ca2){var _0x11f382=_0x3f3f15||client;return _0x11f382[_0x30d2('0x16')](_0x200e29,_0x41b3b4)[_0x30d2('0x17')](function(_0x3bc72b){logger[_0x30d2('0x18')]('Setting,\x20%s,\x20%s',_0x37d9ed,_0x30d2('0x19'));logger[_0x30d2('0x1a')](_0x30d2('0x1b'),_0x37d9ed,_0x30d2('0x19'),JSON[_0x30d2('0x1c')](_0x3bc72b));if(_0x3bc72b[_0x30d2('0x1d')]){if(_0x3bc72b[_0x30d2('0x1d')]['code']===0x1f4){logger[_0x30d2('0x1d')]('Setting,\x20%s,\x20%s',_0x37d9ed,_0x3bc72b['error']['message']);return _0x180ca2(_0x3bc72b['error'][_0x30d2('0x1e')]);}logger['error'](_0x30d2('0x1f'),_0x37d9ed,_0x3bc72b[_0x30d2('0x1d')]['message']);return _0x1433ba(_0x3bc72b[_0x30d2('0x1d')][_0x30d2('0x1e')]);}else{logger[_0x30d2('0x18')](_0x30d2('0x1f'),_0x37d9ed,_0x30d2('0x19'));_0x1433ba(_0x3bc72b[_0x30d2('0x20')][_0x30d2('0x1e')]);}})[_0x30d2('0x21')](function(_0x36d530){logger['error'](_0x30d2('0x1f'),_0x37d9ed,_0x36d530);_0x180ca2(_0x36d530);});});}function respondWithStatusCode(_0x2a715d,_0xa1b7c4){_0xa1b7c4=_0xa1b7c4||0xcc;return function(_0x16f979){if(_0x16f979){return _0x2a715d[_0x30d2('0x22')](_0xa1b7c4);}return _0x2a715d[_0x30d2('0x23')](_0xa1b7c4)[_0x30d2('0x24')]();};}function respondWithResult(_0x474700,_0x449364){_0x449364=_0x449364||0xc8;return function(_0x2a945b){if(_0x2a945b){return _0x474700['status'](_0x449364)[_0x30d2('0x25')](_0x2a945b);}};}function respondWithFilteredResult(_0x5359c4,_0x55fa18){return function(_0x3009bf){if(_0x3009bf){var _0x1a7da3=typeof _0x55fa18[_0x30d2('0x26')]===_0x30d2('0x27')&&typeof _0x55fa18[_0x30d2('0x28')]===_0x30d2('0x27');var _0x3d6d82=_0x3009bf[_0x30d2('0x29')];var _0x25fa8c=_0x1a7da3?0x0:_0x55fa18[_0x30d2('0x26')];var _0x2aecfb=_0x1a7da3?_0x3009bf[_0x30d2('0x29')]:_0x55fa18[_0x30d2('0x26')]+_0x55fa18[_0x30d2('0x28')];var _0x1aa412;if(_0x2aecfb>=_0x3d6d82){_0x2aecfb=_0x3d6d82;_0x1aa412=0xc8;}else{_0x1aa412=0xce;}_0x5359c4['status'](_0x1aa412);return _0x5359c4['set'](_0x30d2('0x2a'),_0x25fa8c+'-'+_0x2aecfb+'/'+_0x3d6d82)['json'](_0x3009bf);}return null;};}function patchUpdates(_0x15bb97){return function(_0x256b97){try{jsonpatch['apply'](_0x256b97,_0x15bb97,!![]);}catch(_0x337f35){return BPromise['reject'](_0x337f35);}return _0x256b97[_0x30d2('0x2b')]();};}function saveUpdates(_0x41a313,_0x38550c){return function(_0x2a4a6b){if(_0x2a4a6b){return _0x2a4a6b['update'](_0x41a313)[_0x30d2('0x17')](function(_0x2b643c){return _0x2b643c;});}return null;};}function removeEntity(_0x306c6c,_0x330e5c){return function(_0x26254f){if(_0x26254f){return _0x26254f['destroy']()[_0x30d2('0x17')](function(){_0x306c6c[_0x30d2('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a58e0,_0x49802e){return function(_0x5b049b){if(!_0x5b049b){_0x5a58e0[_0x30d2('0x22')](0x194);}return _0x5b049b;};}function handleError(_0xc4c7ae,_0x309dab){_0x309dab=_0x309dab||0x1f4;return function(_0x6a8ced){logger[_0x30d2('0x1d')](_0x6a8ced[_0x30d2('0x2c')]);if(_0x6a8ced[_0x30d2('0x2d')]){delete _0x6a8ced[_0x30d2('0x2d')];}_0xc4c7ae[_0x30d2('0x23')](_0x309dab)[_0x30d2('0x2e')](_0x6a8ced);};}exports[_0x30d2('0x2f')]=function(_0x4b453c,_0xdf1b38){var _0x146f6e={},_0x488ba6={},_0x539154={'count':0x0,'rows':[]};var _0x42cd55=_[_0x30d2('0x30')](db[_0x30d2('0x31')][_0x30d2('0x32')],function(_0x37e9a5){return{'name':_0x37e9a5[_0x30d2('0x33')],'type':_0x37e9a5[_0x30d2('0x34')][_0x30d2('0x35')]};});_0x488ba6[_0x30d2('0x36')]=_[_0x30d2('0x30')](_0x42cd55,'name');_0x488ba6['query']=_['keys'](_0x4b453c[_0x30d2('0x37')]);_0x488ba6[_0x30d2('0x38')]=_['intersection'](_0x488ba6['model'],_0x488ba6['query']);_0x146f6e[_0x30d2('0x39')]=_[_0x30d2('0x3a')](_0x488ba6['model'],qs['fields'](_0x4b453c['query'][_0x30d2('0x3b')]));_0x146f6e[_0x30d2('0x39')]=_0x146f6e[_0x30d2('0x39')][_0x30d2('0x3c')]?_0x146f6e[_0x30d2('0x39')]:_0x488ba6[_0x30d2('0x36')];if(!_0x4b453c[_0x30d2('0x37')]['hasOwnProperty'](_0x30d2('0x3d'))){_0x146f6e['limit']=qs[_0x30d2('0x28')](_0x4b453c[_0x30d2('0x37')][_0x30d2('0x28')]);_0x146f6e[_0x30d2('0x26')]=qs[_0x30d2('0x26')](_0x4b453c[_0x30d2('0x37')][_0x30d2('0x26')]);}_0x146f6e[_0x30d2('0x3e')]=qs[_0x30d2('0x3f')](_0x4b453c[_0x30d2('0x37')][_0x30d2('0x3f')]);_0x146f6e[_0x30d2('0x40')]=qs[_0x30d2('0x38')](_[_0x30d2('0x41')](_0x4b453c[_0x30d2('0x37')],_0x488ba6[_0x30d2('0x38')]),_0x42cd55);if(_0x4b453c['query'][_0x30d2('0x42')]){_0x146f6e['where']=_[_0x30d2('0x43')](_0x146f6e['where'],{'$or':_['map'](_0x42cd55,function(_0x3042e5){if(_0x3042e5[_0x30d2('0x34')]!=='VIRTUAL'){var _0x4e0e12={};_0x4e0e12[_0x3042e5[_0x30d2('0x2d')]]={'$like':'%'+_0x4b453c['query']['filter']+'%'};return _0x4e0e12;}})});}_0x146f6e=_[_0x30d2('0x43')]({},_0x146f6e,_0x4b453c[_0x30d2('0x44')]);var _0x30b7d9={'where':_0x146f6e['where']};return db['Setting'][_0x30d2('0x29')](_0x30b7d9)['then'](function(_0x2aa43a){_0x539154[_0x30d2('0x29')]=_0x2aa43a;if(_0x4b453c[_0x30d2('0x37')][_0x30d2('0x45')]){_0x146f6e[_0x30d2('0x46')]=[{'all':!![]}];}return db[_0x30d2('0x31')][_0x30d2('0x47')](_0x146f6e);})['then'](function(_0x218ffb){_0x539154['rows']=_0x218ffb;return _0x539154;})[_0x30d2('0x17')](respondWithFilteredResult(_0xdf1b38,_0x146f6e))[_0x30d2('0x21')](handleError(_0xdf1b38,null));};exports[_0x30d2('0x48')]=function(_0x5044cf,_0x4426d9){var _0x1456e6={'raw':![],'where':{'id':_0x5044cf[_0x30d2('0x49')]['id']}},_0x196faf={};_0x196faf[_0x30d2('0x36')]=_[_0x30d2('0x4a')](db['Setting'][_0x30d2('0x32')]);_0x196faf[_0x30d2('0x37')]=_['keys'](_0x5044cf['query']);_0x196faf[_0x30d2('0x38')]=_[_0x30d2('0x3a')](_0x196faf[_0x30d2('0x36')],_0x196faf['query']);_0x1456e6['attributes']=_['intersection'](_0x196faf[_0x30d2('0x36')],qs[_0x30d2('0x3b')](_0x5044cf[_0x30d2('0x37')][_0x30d2('0x3b')]));_0x1456e6[_0x30d2('0x39')]=_0x1456e6[_0x30d2('0x39')]['length']?_0x1456e6[_0x30d2('0x39')]:_0x196faf[_0x30d2('0x36')];if(_0x5044cf[_0x30d2('0x37')][_0x30d2('0x45')]){_0x1456e6[_0x30d2('0x46')]=[{'all':!![]}];}_0x1456e6=_[_0x30d2('0x43')]({},_0x1456e6,_0x5044cf['options']);return db[_0x30d2('0x31')][_0x30d2('0x4b')](_0x1456e6)[_0x30d2('0x17')](handleEntityNotFound(_0x4426d9,null))[_0x30d2('0x17')](respondWithResult(_0x4426d9,null))[_0x30d2('0x21')](handleError(_0x4426d9,null));};exports['update']=function(_0x1b58ec,_0x4f778f){if(_0x1b58ec[_0x30d2('0x4c')]['id']){delete _0x1b58ec[_0x30d2('0x4c')]['id'];}return db[_0x30d2('0x31')][_0x30d2('0x4b')]({'where':{'id':_0x1b58ec[_0x30d2('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f778f,null))[_0x30d2('0x17')](saveUpdates(_0x1b58ec[_0x30d2('0x4c')],null))['then'](respondWithResult(_0x4f778f,null))[_0x30d2('0x21')](handleError(_0x4f778f,null));};exports[_0x30d2('0x4d')]=function(_0x46e8e8,_0x1c4928,_0x26715e){if(_0x46e8e8[_0x30d2('0x4e')]&&_0x46e8e8['file'][_0x30d2('0x4f')]){_0x46e8e8[_0x30d2('0x4c')]['logo']=_0x46e8e8['file'][_0x30d2('0x4f')];}return db[_0x30d2('0x31')][_0x30d2('0x4b')]({'where':{'id':_0x46e8e8[_0x30d2('0x49')]['id']}})[_0x30d2('0x17')](handleEntityNotFound(_0x1c4928,null))['then'](saveUpdates(_0x46e8e8['body'],null))[_0x30d2('0x17')](respondWithResult(_0x1c4928,null))[_0x30d2('0x21')](handleError(_0x1c4928,null));};exports[_0x30d2('0x50')]=function(_0x34bd04,_0x55e52b,_0x18ffd9){if(_0x34bd04[_0x30d2('0x4e')]&&_0x34bd04['file'][_0x30d2('0x4f')]){_0x34bd04[_0x30d2('0x4c')][_0x30d2('0x51')]=_0x34bd04['file'][_0x30d2('0x4f')];}return db[_0x30d2('0x31')][_0x30d2('0x4b')]({'where':{'id':_0x34bd04[_0x30d2('0x49')]['id']}})['then'](handleEntityNotFound(_0x55e52b,null))[_0x30d2('0x17')](saveUpdates(_0x34bd04[_0x30d2('0x4c')],null))[_0x30d2('0x17')](respondWithResult(_0x55e52b,null))[_0x30d2('0x21')](handleError(_0x55e52b,null));};var utilLicense=require(_0x30d2('0x12'));exports[_0x30d2('0x52')]=function(_0x510696,_0x3040ed,_0xeb9b44){var _0x355a96=_0x30d2('0x53');var _0x9b6b4a={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x5578b1){if(_0x5578b1){_0x9b6b4a=_0x5578b1;}return db['Setting'][_0x30d2('0x4b')]({'where':{'id':_0x510696[_0x30d2('0x49')]['id']},'attributes':[_0x30d2('0x54'),_0x30d2('0x51'),_0x30d2('0x55'),_0x30d2('0x56'),_0x30d2('0x57'),_0x30d2('0x58'),_0x30d2('0x59'),_0x30d2('0x5a')],'raw':!![]});})[_0x30d2('0x17')](handleEntityNotFound(_0x3040ed,null))['then'](function(_0x9a842){if(_0x9a842){var _0x29a974=_0x9a842['logo']&&fs['existsSync'](path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x355a96,_[_0x30d2('0x5d')](_0x9a842[_0x30d2('0x54')])))?path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x355a96,_[_0x30d2('0x5d')](_0x9a842[_0x30d2('0x54')])):path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x355a96,_[_0x30d2('0x5d')]('default_logo.svg'));var _0x7d30de=_0x30d2('0x5e')+_[_0x30d2('0x5f')](_0x30d2('0x54'));if(_0x9a842[_0x7d30de]||!_0x9b6b4a[_0x30d2('0x60')]){_0x29a974=path['join'](config[_0x30d2('0x5c')],_0x355a96,_[_0x30d2('0x5d')](_0x30d2('0x61')));}if(!fs['existsSync'](_0x29a974)){throw new db['Sequelize'][(_0x30d2('0x62'))](_[_0x30d2('0x5f')]('logo')+_0x30d2('0x63'));}return _0x3040ed[_0x30d2('0x64')](_0x29a974);}})[_0x30d2('0x21')](handleError(_0x3040ed,null));};var utilLicense=require(_0x30d2('0x12'));exports[_0x30d2('0x65')]=function(_0x45375e,_0x2b2b35,_0x21d8ed){var _0xc8cc99=_0x30d2('0x53');var _0x15f87b={'custom':![]};return utilLicense[_0x30d2('0x66')]()[_0x30d2('0x17')](function(_0x434979){if(_0x434979){_0x15f87b=_0x434979;}return db['Setting'][_0x30d2('0x4b')]({'where':{'id':_0x45375e[_0x30d2('0x49')]['id']},'attributes':[_0x30d2('0x54'),'loginLogo','preferred',_0x30d2('0x56'),_0x30d2('0x57'),_0x30d2('0x58'),_0x30d2('0x59'),_0x30d2('0x5a')],'raw':!![]});})[_0x30d2('0x17')](handleEntityNotFound(_0x2b2b35,null))[_0x30d2('0x17')](function(_0x3b2a8e){if(_0x3b2a8e){var _0x4b0d18=_0x3b2a8e[_0x30d2('0x51')]&&fs[_0x30d2('0x67')](path['join'](config[_0x30d2('0x5c')],_0xc8cc99,_[_0x30d2('0x5d')](_0x3b2a8e[_0x30d2('0x51')])))?path['join'](config['root'],_0xc8cc99,_[_0x30d2('0x5d')](_0x3b2a8e[_0x30d2('0x51')])):path['join'](config[_0x30d2('0x5c')],_0xc8cc99,_[_0x30d2('0x5d')](_0x30d2('0x68')));var _0x4ff8d6=_0x30d2('0x5e')+_['upperFirst'](_0x30d2('0x51'));if(_0x3b2a8e[_0x4ff8d6]||!_0x15f87b['custom']){_0x4b0d18=path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0xc8cc99,_[_0x30d2('0x5d')](_0x30d2('0x68')));}if(!fs[_0x30d2('0x67')](_0x4b0d18)){throw new db['Sequelize'][(_0x30d2('0x62'))](_[_0x30d2('0x5f')]('loginLogo')+_0x30d2('0x63'));}return _0x2b2b35['download'](_0x4b0d18);}})[_0x30d2('0x21')](handleError(_0x2b2b35,null));};exports[_0x30d2('0x69')]=function(_0x4f058,_0x3913e0){return db[_0x30d2('0x31')]['find']({'where':{'id':_0x4f058[_0x30d2('0x49')]['id']},'attributes':['securePassword']})[_0x30d2('0x17')](respondWithResult(_0x3913e0,null))[_0x30d2('0x21')](handleError(_0x3913e0,null));};exports['addPreferred']=function(_0x4752cb,_0x52654a,_0x4bee01){if(_0x4752cb[_0x30d2('0x4e')]&&_0x4752cb['file'][_0x30d2('0x4f')]){_0x4752cb['body'][_0x30d2('0x55')]=_0x4752cb['file'][_0x30d2('0x4f')];}return db['Setting'][_0x30d2('0x4b')]({'where':{'id':_0x4752cb['params']['id']}})[_0x30d2('0x17')](handleEntityNotFound(_0x52654a,null))[_0x30d2('0x17')](saveUpdates(_0x4752cb[_0x30d2('0x4c')],null))[_0x30d2('0x17')](respondWithResult(_0x52654a,null))[_0x30d2('0x21')](handleError(_0x52654a,null));};var utilLicense=require(_0x30d2('0x12'));exports[_0x30d2('0x6a')]=function(_0x524887,_0x199185,_0x3ca2b9){var _0x3694d1=_0x30d2('0x53');var _0x54d4a5={'custom':![]};return utilLicense[_0x30d2('0x66')]()['then'](function(_0x2a0822){if(_0x2a0822){_0x54d4a5=_0x2a0822;}return db[_0x30d2('0x31')][_0x30d2('0x4b')]({'where':{'id':_0x524887[_0x30d2('0x49')]['id']},'attributes':['logo',_0x30d2('0x51'),_0x30d2('0x55'),_0x30d2('0x56'),'defaultLogo','defaultLoginLogo',_0x30d2('0x59'),_0x30d2('0x5a')],'raw':!![]});})[_0x30d2('0x17')](handleEntityNotFound(_0x199185,null))[_0x30d2('0x17')](function(_0x2c2ebc){if(_0x2c2ebc){var _0x1a882d=_0x2c2ebc[_0x30d2('0x55')]&&fs[_0x30d2('0x67')](path['join'](config['root'],_0x3694d1,_[_0x30d2('0x5d')](_0x2c2ebc[_0x30d2('0x55')])))?path['join'](config[_0x30d2('0x5c')],_0x3694d1,_[_0x30d2('0x5d')](_0x2c2ebc['preferred'])):path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x3694d1,_[_0x30d2('0x5d')](_0x30d2('0x6b')));var _0x1bdb3c='default'+_[_0x30d2('0x5f')](_0x30d2('0x55'));if(_0x2c2ebc[_0x1bdb3c]||!_0x54d4a5[_0x30d2('0x60')]||!_0x54d4a5['preferred']){_0x1a882d=path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x3694d1,_[_0x30d2('0x5d')]('default_preferred.png'));}if(!fs[_0x30d2('0x67')](_0x1a882d)){throw new db[(_0x30d2('0x6c'))]['ValidationError'](_['upperFirst']('preferred')+_0x30d2('0x63'));}return _0x199185[_0x30d2('0x64')](_0x1a882d);}})[_0x30d2('0x21')](handleError(_0x199185,null));};exports[_0x30d2('0x6d')]=function(_0xf3798b,_0x12feea,_0x341c8f){if(_0xf3798b[_0x30d2('0x4e')]&&_0xf3798b[_0x30d2('0x4e')][_0x30d2('0x4f')]){_0xf3798b['body'][_0x30d2('0x56')]=_0xf3798b[_0x30d2('0x4e')][_0x30d2('0x4f')];}return db[_0x30d2('0x31')][_0x30d2('0x4b')]({'where':{'id':_0xf3798b['params']['id']}})[_0x30d2('0x17')](handleEntityNotFound(_0x12feea,null))['then'](saveUpdates(_0xf3798b[_0x30d2('0x4c')],null))[_0x30d2('0x17')](respondWithResult(_0x12feea,null))[_0x30d2('0x21')](handleError(_0x12feea,null));};var utilLicense=require(_0x30d2('0x12'));exports['getFavicon']=function(_0x50a3f3,_0x1caa13,_0x2c7382){var _0x14b6b5=_0x30d2('0x53');var _0x3e164c={'custom':![]};return utilLicense['getLicense']()[_0x30d2('0x17')](function(_0x4dbfc5){if(_0x4dbfc5){_0x3e164c=_0x4dbfc5;}return db[_0x30d2('0x31')]['find']({'where':{'id':_0x50a3f3['params']['id']},'attributes':[_0x30d2('0x54'),_0x30d2('0x51'),_0x30d2('0x55'),_0x30d2('0x56'),'defaultLogo',_0x30d2('0x58'),_0x30d2('0x59'),_0x30d2('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x1caa13,null))['then'](function(_0x9ea65f){if(_0x9ea65f){var _0x1136f7=_0x9ea65f[_0x30d2('0x56')]&&fs['existsSync'](path[_0x30d2('0x5b')](config['root'],_0x14b6b5,_['toLower'](_0x9ea65f[_0x30d2('0x56')])))?path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x14b6b5,_[_0x30d2('0x5d')](_0x9ea65f[_0x30d2('0x56')])):path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x14b6b5,_[_0x30d2('0x5d')](_0x30d2('0x6e')));var _0x3652f9=_0x30d2('0x5e')+_[_0x30d2('0x5f')]('favicon');if(_0x9ea65f[_0x3652f9]||!_0x3e164c[_0x30d2('0x60')]){_0x1136f7=path[_0x30d2('0x5b')](config[_0x30d2('0x5c')],_0x14b6b5,_[_0x30d2('0x5d')]('default_favicon.ico'));}if(!fs[_0x30d2('0x67')](_0x1136f7)){throw new db[(_0x30d2('0x6c'))][(_0x30d2('0x62'))](_['upperFirst'](_0x30d2('0x56'))+_0x30d2('0x63'));}return _0x1caa13[_0x30d2('0x64')](_0x1136f7);}})['catch'](handleError(_0x1caa13,null));};exports[_0x30d2('0x6f')]=function(_0x3d365c,_0x19456a){var _0xa0ee27={'offset':moment()[_0x30d2('0x70')]()};_0xa0ee27[_0x30d2('0x71')]=moment()[_0x30d2('0x70')](_0xa0ee27['offset'])[_0x30d2('0x72')](_0x30d2('0x73'));return _0x19456a[_0x30d2('0x23')](0xc8)['send'](_0xa0ee27);}; \ No newline at end of file +var _0xcee0=['http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','body','find','file','filename','loginLogo','server/files/images/logos','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','custom','ValidationError','upperFirst','download','getLogoLogin','preferred','defaultPreferred','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','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','jayson/promise','client'];(function(_0x53c5cf,_0x3ef208){var _0x3261aa=function(_0x69b1d){while(--_0x69b1d){_0x53c5cf['push'](_0x53c5cf['shift']());}};_0x3261aa(++_0x3ef208);}(_0xcee0,0x1e1));var _0x0cee=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xcee0[_0x5235dd];return _0x13059d;};'use strict';var emlformat=require(_0x0cee('0x0'));var rimraf=require(_0x0cee('0x1'));var zipdir=require(_0x0cee('0x2'));var jsonpatch=require(_0x0cee('0x3'));var rp=require(_0x0cee('0x4'));var moment=require(_0x0cee('0x5'));var BPromise=require(_0x0cee('0x6'));var Mustache=require(_0x0cee('0x7'));var util=require(_0x0cee('0x8'));var path=require('path');var sox=require(_0x0cee('0x9'));var csv=require(_0x0cee('0xa'));var ejs=require(_0x0cee('0xb'));var fs=require('fs');var fs_extra=require(_0x0cee('0xc'));var _=require(_0x0cee('0xd'));var squel=require('squel');var crypto=require(_0x0cee('0xe'));var jsforce=require(_0x0cee('0xf'));var deskjs=require(_0x0cee('0x10'));var toCsv=require(_0x0cee('0xa'));var querystring=require(_0x0cee('0x11'));var Papa=require(_0x0cee('0x12'));var Redis=require(_0x0cee('0x13'));var authService=require(_0x0cee('0x14'));var qs=require(_0x0cee('0x15'));var as=require(_0x0cee('0x16'));var hardwareService=require(_0x0cee('0x17'));var logger=require(_0x0cee('0x18'))('api');var utils=require(_0x0cee('0x19'));var config=require(_0x0cee('0x1a'));var licenseUtil=require(_0x0cee('0x1b'));var db=require(_0x0cee('0x1c'))['db'];var jayson=require(_0x0cee('0x1d'));var client=jayson[_0x0cee('0x1e')][_0x0cee('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2eab47,_0x515803,_0x1ffbf7,_0x123543){return new BPromise(function(_0x35dbb1,_0xa21b9){var _0x2497ed=_0x123543||client;return _0x2497ed[_0x0cee('0x20')](_0x2eab47,_0x1ffbf7)[_0x0cee('0x21')](function(_0x1a51f3){logger['info'](_0x0cee('0x22'),_0x515803,_0x0cee('0x23'));logger[_0x0cee('0x24')](_0x0cee('0x25'),_0x515803,_0x0cee('0x23'),JSON[_0x0cee('0x26')](_0x1a51f3));if(_0x1a51f3[_0x0cee('0x27')]){if(_0x1a51f3[_0x0cee('0x27')][_0x0cee('0x28')]===0x1f4){logger['error'](_0x0cee('0x22'),_0x515803,_0x1a51f3['error'][_0x0cee('0x29')]);return _0xa21b9(_0x1a51f3[_0x0cee('0x27')]['message']);}logger[_0x0cee('0x27')](_0x0cee('0x22'),_0x515803,_0x1a51f3[_0x0cee('0x27')][_0x0cee('0x29')]);return _0x35dbb1(_0x1a51f3[_0x0cee('0x27')][_0x0cee('0x29')]);}else{logger[_0x0cee('0x2a')](_0x0cee('0x22'),_0x515803,_0x0cee('0x23'));_0x35dbb1(_0x1a51f3[_0x0cee('0x2b')][_0x0cee('0x29')]);}})[_0x0cee('0x2c')](function(_0x3bdfa9){logger['error'](_0x0cee('0x22'),_0x515803,_0x3bdfa9);_0xa21b9(_0x3bdfa9);});});}function respondWithStatusCode(_0x2fd696,_0x512cfc){_0x512cfc=_0x512cfc||0xcc;return function(_0x4dca3a){if(_0x4dca3a){return _0x2fd696[_0x0cee('0x2d')](_0x512cfc);}return _0x2fd696[_0x0cee('0x2e')](_0x512cfc)[_0x0cee('0x2f')]();};}function respondWithResult(_0x4d895f,_0x15e4ed){_0x15e4ed=_0x15e4ed||0xc8;return function(_0x3e4bca){if(_0x3e4bca){return _0x4d895f[_0x0cee('0x2e')](_0x15e4ed)[_0x0cee('0x30')](_0x3e4bca);}};}function respondWithFilteredResult(_0x31ac4d,_0x27e266){return function(_0x24739e){if(_0x24739e){var _0x288651=typeof _0x27e266[_0x0cee('0x31')]==='undefined'&&typeof _0x27e266[_0x0cee('0x32')]===_0x0cee('0x33');var _0x4c9a44=_0x24739e[_0x0cee('0x34')];var _0x3b59eb=_0x288651?0x0:_0x27e266[_0x0cee('0x31')];var _0x448d3f=_0x288651?_0x24739e['count']:_0x27e266[_0x0cee('0x31')]+_0x27e266[_0x0cee('0x32')];var _0x33cf6d;if(_0x448d3f>=_0x4c9a44){_0x448d3f=_0x4c9a44;_0x33cf6d=0xc8;}else{_0x33cf6d=0xce;}_0x31ac4d[_0x0cee('0x2e')](_0x33cf6d);return _0x31ac4d[_0x0cee('0x35')](_0x0cee('0x36'),_0x3b59eb+'-'+_0x448d3f+'/'+_0x4c9a44)['json'](_0x24739e);}return null;};}function patchUpdates(_0x5b836a){return function(_0x1dc587){try{jsonpatch['apply'](_0x1dc587,_0x5b836a,!![]);}catch(_0x5754d4){return BPromise['reject'](_0x5754d4);}return _0x1dc587[_0x0cee('0x37')]();};}function saveUpdates(_0x1fec41,_0x5c3c5e){return function(_0x4d5b3d){if(_0x4d5b3d){return _0x4d5b3d[_0x0cee('0x38')](_0x1fec41)[_0x0cee('0x21')](function(_0x1e960a){return _0x1e960a;});}return null;};}function removeEntity(_0x3429b0,_0x557653){return function(_0x19fd82){if(_0x19fd82){return _0x19fd82['destroy']()[_0x0cee('0x21')](function(){_0x3429b0[_0x0cee('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b7c98,_0x3c964e){return function(_0x573066){if(!_0x573066){_0x1b7c98[_0x0cee('0x2d')](0x194);}return _0x573066;};}function handleError(_0x2d403c,_0x33fb63){_0x33fb63=_0x33fb63||0x1f4;return function(_0x103ab3){logger['error'](_0x103ab3[_0x0cee('0x39')]);if(_0x103ab3[_0x0cee('0x3a')]){delete _0x103ab3[_0x0cee('0x3a')];}_0x2d403c[_0x0cee('0x2e')](_0x33fb63)[_0x0cee('0x3b')](_0x103ab3);};}exports[_0x0cee('0x3c')]=function(_0x53b319,_0x5d9208){var _0x56f7c3={},_0x3ba86e={},_0xb5ab5a={'count':0x0,'rows':[]};var _0x2d87e2=_[_0x0cee('0x3d')](db[_0x0cee('0x3e')][_0x0cee('0x3f')],function(_0x3a49f8){return{'name':_0x3a49f8[_0x0cee('0x40')],'type':_0x3a49f8[_0x0cee('0x41')][_0x0cee('0x42')]};});_0x3ba86e[_0x0cee('0x43')]=_[_0x0cee('0x3d')](_0x2d87e2,_0x0cee('0x3a'));_0x3ba86e['query']=_['keys'](_0x53b319['query']);_0x3ba86e[_0x0cee('0x44')]=_[_0x0cee('0x45')](_0x3ba86e[_0x0cee('0x43')],_0x3ba86e[_0x0cee('0x46')]);_0x56f7c3[_0x0cee('0x47')]=_[_0x0cee('0x45')](_0x3ba86e[_0x0cee('0x43')],qs[_0x0cee('0x48')](_0x53b319['query'][_0x0cee('0x48')]));_0x56f7c3[_0x0cee('0x47')]=_0x56f7c3[_0x0cee('0x47')][_0x0cee('0x49')]?_0x56f7c3['attributes']:_0x3ba86e[_0x0cee('0x43')];if(!_0x53b319[_0x0cee('0x46')][_0x0cee('0x4a')](_0x0cee('0x4b'))){_0x56f7c3[_0x0cee('0x32')]=qs[_0x0cee('0x32')](_0x53b319[_0x0cee('0x46')][_0x0cee('0x32')]);_0x56f7c3[_0x0cee('0x31')]=qs['offset'](_0x53b319[_0x0cee('0x46')][_0x0cee('0x31')]);}_0x56f7c3[_0x0cee('0x4c')]=qs[_0x0cee('0x4d')](_0x53b319[_0x0cee('0x46')]['sort']);_0x56f7c3[_0x0cee('0x4e')]=qs[_0x0cee('0x44')](_[_0x0cee('0x4f')](_0x53b319[_0x0cee('0x46')],_0x3ba86e[_0x0cee('0x44')]),_0x2d87e2);if(_0x53b319[_0x0cee('0x46')][_0x0cee('0x50')]){_0x56f7c3[_0x0cee('0x4e')]=_[_0x0cee('0x51')](_0x56f7c3[_0x0cee('0x4e')],{'$or':_[_0x0cee('0x3d')](_0x2d87e2,function(_0x8322d8){if(_0x8322d8['type']!==_0x0cee('0x52')){var _0x3548b1={};_0x3548b1[_0x8322d8[_0x0cee('0x3a')]]={'$like':'%'+_0x53b319[_0x0cee('0x46')]['filter']+'%'};return _0x3548b1;}})});}_0x56f7c3=_[_0x0cee('0x51')]({},_0x56f7c3,_0x53b319[_0x0cee('0x53')]);var _0x3e46af={'where':_0x56f7c3[_0x0cee('0x4e')]};return db[_0x0cee('0x3e')][_0x0cee('0x34')](_0x3e46af)['then'](function(_0x4b788f){_0xb5ab5a[_0x0cee('0x34')]=_0x4b788f;if(_0x53b319['query'][_0x0cee('0x54')]){_0x56f7c3[_0x0cee('0x55')]=[{'all':!![]}];}return db[_0x0cee('0x3e')][_0x0cee('0x56')](_0x56f7c3);})[_0x0cee('0x21')](function(_0x2c7649){_0xb5ab5a['rows']=_0x2c7649;return _0xb5ab5a;})['then'](respondWithFilteredResult(_0x5d9208,_0x56f7c3))[_0x0cee('0x2c')](handleError(_0x5d9208,null));};exports['show']=function(_0x53d935,_0x57e3aa){var _0x3721b6={'raw':![],'where':{'id':_0x53d935[_0x0cee('0x57')]['id']}},_0x18f19a={};_0x18f19a[_0x0cee('0x43')]=_[_0x0cee('0x58')](db[_0x0cee('0x3e')][_0x0cee('0x3f')]);_0x18f19a['query']=_[_0x0cee('0x58')](_0x53d935[_0x0cee('0x46')]);_0x18f19a[_0x0cee('0x44')]=_[_0x0cee('0x45')](_0x18f19a['model'],_0x18f19a[_0x0cee('0x46')]);_0x3721b6[_0x0cee('0x47')]=_['intersection'](_0x18f19a[_0x0cee('0x43')],qs[_0x0cee('0x48')](_0x53d935[_0x0cee('0x46')]['fields']));_0x3721b6[_0x0cee('0x47')]=_0x3721b6[_0x0cee('0x47')][_0x0cee('0x49')]?_0x3721b6[_0x0cee('0x47')]:_0x18f19a[_0x0cee('0x43')];if(_0x53d935['query']['includeAll']){_0x3721b6[_0x0cee('0x55')]=[{'all':!![]}];}_0x3721b6=_[_0x0cee('0x51')]({},_0x3721b6,_0x53d935[_0x0cee('0x53')]);return db['Setting']['find'](_0x3721b6)[_0x0cee('0x21')](handleEntityNotFound(_0x57e3aa,null))[_0x0cee('0x21')](respondWithResult(_0x57e3aa,null))[_0x0cee('0x2c')](handleError(_0x57e3aa,null));};exports[_0x0cee('0x38')]=function(_0xdafa8,_0x6aaa2d){if(_0xdafa8['body']['id']){delete _0xdafa8[_0x0cee('0x59')]['id'];}return db['Setting'][_0x0cee('0x5a')]({'where':{'id':_0xdafa8['params']['id']}})['then'](handleEntityNotFound(_0x6aaa2d,null))['then'](saveUpdates(_0xdafa8[_0x0cee('0x59')],null))['then'](respondWithResult(_0x6aaa2d,null))['catch'](handleError(_0x6aaa2d,null));};exports['addLogo']=function(_0x3d2017,_0x27842e,_0xb600a2){if(_0x3d2017[_0x0cee('0x5b')]&&_0x3d2017['file'][_0x0cee('0x5c')]){_0x3d2017[_0x0cee('0x59')]['logo']=_0x3d2017[_0x0cee('0x5b')][_0x0cee('0x5c')];}return db[_0x0cee('0x3e')]['find']({'where':{'id':_0x3d2017[_0x0cee('0x57')]['id']}})[_0x0cee('0x21')](handleEntityNotFound(_0x27842e,null))[_0x0cee('0x21')](saveUpdates(_0x3d2017[_0x0cee('0x59')],null))[_0x0cee('0x21')](respondWithResult(_0x27842e,null))[_0x0cee('0x2c')](handleError(_0x27842e,null));};exports['addLogoLogin']=function(_0x2013bf,_0x471ccb,_0x2189a8){if(_0x2013bf['file']&&_0x2013bf[_0x0cee('0x5b')][_0x0cee('0x5c')]){_0x2013bf[_0x0cee('0x59')][_0x0cee('0x5d')]=_0x2013bf[_0x0cee('0x5b')][_0x0cee('0x5c')];}return db[_0x0cee('0x3e')][_0x0cee('0x5a')]({'where':{'id':_0x2013bf[_0x0cee('0x57')]['id']}})['then'](handleEntityNotFound(_0x471ccb,null))[_0x0cee('0x21')](saveUpdates(_0x2013bf[_0x0cee('0x59')],null))['then'](respondWithResult(_0x471ccb,null))[_0x0cee('0x2c')](handleError(_0x471ccb,null));};var utilLicense=require(_0x0cee('0x1b'));exports['getLogo']=function(_0x917d58,_0x110bcf,_0x845c9e){var _0x14a30f=_0x0cee('0x5e');var _0x554a1b={'custom':![]};return utilLicense[_0x0cee('0x5f')]()[_0x0cee('0x21')](function(_0x89d020){if(_0x89d020){_0x554a1b=_0x89d020;}return db[_0x0cee('0x3e')][_0x0cee('0x5a')]({'where':{'id':_0x917d58[_0x0cee('0x57')]['id']},'attributes':[_0x0cee('0x60'),_0x0cee('0x5d'),'preferred',_0x0cee('0x61'),_0x0cee('0x62'),_0x0cee('0x63'),'defaultPreferred',_0x0cee('0x64')],'raw':!![]});})[_0x0cee('0x21')](handleEntityNotFound(_0x110bcf,null))[_0x0cee('0x21')](function(_0x3ca4b2){if(_0x3ca4b2){var _0x1d4ae3=_0x3ca4b2[_0x0cee('0x60')]&&fs[_0x0cee('0x65')](path[_0x0cee('0x66')](config['root'],_0x14a30f,_[_0x0cee('0x67')](_0x3ca4b2[_0x0cee('0x60')])))?path['join'](config[_0x0cee('0x68')],_0x14a30f,_[_0x0cee('0x67')](_0x3ca4b2[_0x0cee('0x60')])):path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x14a30f,_[_0x0cee('0x67')](_0x0cee('0x69')));var _0x3d92ea=_0x0cee('0x6a')+_['upperFirst'](_0x0cee('0x60'));if(_0x3ca4b2[_0x3d92ea]||!_0x554a1b[_0x0cee('0x6b')]){_0x1d4ae3=path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x14a30f,_[_0x0cee('0x67')](_0x0cee('0x69')));}if(!fs[_0x0cee('0x65')](_0x1d4ae3)){throw new db['Sequelize'][(_0x0cee('0x6c'))](_[_0x0cee('0x6d')](_0x0cee('0x60'))+'\x20not\x20found');}return _0x110bcf[_0x0cee('0x6e')](_0x1d4ae3);}})[_0x0cee('0x2c')](handleError(_0x110bcf,null));};var utilLicense=require(_0x0cee('0x1b'));exports[_0x0cee('0x6f')]=function(_0x52fa28,_0x5fcf6f,_0x566c77){var _0x23aee9='server/files/images/logos';var _0x579c43={'custom':![]};return utilLicense['getLicense']()[_0x0cee('0x21')](function(_0x1f495b){if(_0x1f495b){_0x579c43=_0x1f495b;}return db['Setting'][_0x0cee('0x5a')]({'where':{'id':_0x52fa28[_0x0cee('0x57')]['id']},'attributes':[_0x0cee('0x60'),'loginLogo',_0x0cee('0x70'),_0x0cee('0x61'),'defaultLogo',_0x0cee('0x63'),_0x0cee('0x71'),_0x0cee('0x64')],'raw':!![]});})[_0x0cee('0x21')](handleEntityNotFound(_0x5fcf6f,null))['then'](function(_0x11e132){if(_0x11e132){var _0x3f9f84=_0x11e132['loginLogo']&&fs[_0x0cee('0x65')](path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x23aee9,_[_0x0cee('0x67')](_0x11e132[_0x0cee('0x5d')])))?path[_0x0cee('0x66')](config['root'],_0x23aee9,_[_0x0cee('0x67')](_0x11e132[_0x0cee('0x5d')])):path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x23aee9,_[_0x0cee('0x67')](_0x0cee('0x72')));var _0x322611=_0x0cee('0x6a')+_[_0x0cee('0x6d')](_0x0cee('0x5d'));if(_0x11e132[_0x322611]||!_0x579c43[_0x0cee('0x6b')]){_0x3f9f84=path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x23aee9,_[_0x0cee('0x67')](_0x0cee('0x72')));}if(!fs[_0x0cee('0x65')](_0x3f9f84)){throw new db[(_0x0cee('0x73'))][(_0x0cee('0x6c'))](_[_0x0cee('0x6d')](_0x0cee('0x5d'))+'\x20not\x20found');}return _0x5fcf6f['download'](_0x3f9f84);}})['catch'](handleError(_0x5fcf6f,null));};exports[_0x0cee('0x74')]=function(_0x44dff4,_0x26e0e8){return db['Setting'][_0x0cee('0x5a')]({'where':{'id':_0x44dff4[_0x0cee('0x57')]['id']},'attributes':[_0x0cee('0x75')]})[_0x0cee('0x21')](respondWithResult(_0x26e0e8,null))['catch'](handleError(_0x26e0e8,null));};exports[_0x0cee('0x76')]=function(_0x31df55,_0x25443e,_0x1104c3){if(_0x31df55['file']&&_0x31df55[_0x0cee('0x5b')]['filename']){_0x31df55[_0x0cee('0x59')]['preferred']=_0x31df55[_0x0cee('0x5b')][_0x0cee('0x5c')];}return db[_0x0cee('0x3e')][_0x0cee('0x5a')]({'where':{'id':_0x31df55['params']['id']}})['then'](handleEntityNotFound(_0x25443e,null))[_0x0cee('0x21')](saveUpdates(_0x31df55[_0x0cee('0x59')],null))[_0x0cee('0x21')](respondWithResult(_0x25443e,null))[_0x0cee('0x2c')](handleError(_0x25443e,null));};var utilLicense=require(_0x0cee('0x1b'));exports[_0x0cee('0x77')]=function(_0x5a547f,_0x2212aa,_0x411bb1){var _0xc4d5fb='server/files/images/logos';var _0x56756c={'custom':![]};return utilLicense[_0x0cee('0x5f')]()[_0x0cee('0x21')](function(_0x43e9cf){if(_0x43e9cf){_0x56756c=_0x43e9cf;}return db[_0x0cee('0x3e')]['find']({'where':{'id':_0x5a547f['params']['id']},'attributes':[_0x0cee('0x60'),_0x0cee('0x5d'),_0x0cee('0x70'),_0x0cee('0x61'),_0x0cee('0x62'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x0cee('0x21')](handleEntityNotFound(_0x2212aa,null))[_0x0cee('0x21')](function(_0x13e845){if(_0x13e845){var _0xb9c646=_0x13e845[_0x0cee('0x70')]&&fs[_0x0cee('0x65')](path[_0x0cee('0x66')](config['root'],_0xc4d5fb,_[_0x0cee('0x67')](_0x13e845['preferred'])))?path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0xc4d5fb,_[_0x0cee('0x67')](_0x13e845['preferred'])):path[_0x0cee('0x66')](config['root'],_0xc4d5fb,_[_0x0cee('0x67')](_0x0cee('0x78')));var _0x429e1c='default'+_['upperFirst'](_0x0cee('0x70'));if(_0x13e845[_0x429e1c]||!_0x56756c['custom']||!_0x56756c[_0x0cee('0x70')]){_0xb9c646=path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0xc4d5fb,_[_0x0cee('0x67')](_0x0cee('0x78')));}if(!fs['existsSync'](_0xb9c646)){throw new db['Sequelize'][(_0x0cee('0x6c'))](_['upperFirst'](_0x0cee('0x70'))+_0x0cee('0x79'));}return _0x2212aa[_0x0cee('0x6e')](_0xb9c646);}})[_0x0cee('0x2c')](handleError(_0x2212aa,null));};exports[_0x0cee('0x7a')]=function(_0x526259,_0x41fcb5,_0x30c436){if(_0x526259['file']&&_0x526259[_0x0cee('0x5b')][_0x0cee('0x5c')]){_0x526259[_0x0cee('0x59')][_0x0cee('0x61')]=_0x526259[_0x0cee('0x5b')]['filename'];}return db['Setting'][_0x0cee('0x5a')]({'where':{'id':_0x526259['params']['id']}})[_0x0cee('0x21')](handleEntityNotFound(_0x41fcb5,null))[_0x0cee('0x21')](saveUpdates(_0x526259['body'],null))[_0x0cee('0x21')](respondWithResult(_0x41fcb5,null))[_0x0cee('0x2c')](handleError(_0x41fcb5,null));};var utilLicense=require(_0x0cee('0x1b'));exports[_0x0cee('0x7b')]=function(_0x54baf0,_0x8a1ed0,_0x3f28c1){var _0x303ccd=_0x0cee('0x5e');var _0x2f8185={'custom':![]};return utilLicense[_0x0cee('0x5f')]()[_0x0cee('0x21')](function(_0x1c1abd){if(_0x1c1abd){_0x2f8185=_0x1c1abd;}return db[_0x0cee('0x3e')]['find']({'where':{'id':_0x54baf0[_0x0cee('0x57')]['id']},'attributes':[_0x0cee('0x60'),'loginLogo','preferred',_0x0cee('0x61'),'defaultLogo',_0x0cee('0x63'),_0x0cee('0x71'),'defaultFavicon'],'raw':!![]});})[_0x0cee('0x21')](handleEntityNotFound(_0x8a1ed0,null))[_0x0cee('0x21')](function(_0x492333){if(_0x492333){var _0x40987b=_0x492333[_0x0cee('0x61')]&&fs[_0x0cee('0x65')](path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x303ccd,_['toLower'](_0x492333['favicon'])))?path[_0x0cee('0x66')](config['root'],_0x303ccd,_[_0x0cee('0x67')](_0x492333[_0x0cee('0x61')])):path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x303ccd,_[_0x0cee('0x67')](_0x0cee('0x7c')));var _0x2603e4=_0x0cee('0x6a')+_['upperFirst'](_0x0cee('0x61'));if(_0x492333[_0x2603e4]||!_0x2f8185[_0x0cee('0x6b')]){_0x40987b=path[_0x0cee('0x66')](config[_0x0cee('0x68')],_0x303ccd,_['toLower'](_0x0cee('0x7c')));}if(!fs[_0x0cee('0x65')](_0x40987b)){throw new db[(_0x0cee('0x73'))][(_0x0cee('0x6c'))](_[_0x0cee('0x6d')](_0x0cee('0x61'))+_0x0cee('0x79'));}return _0x8a1ed0[_0x0cee('0x6e')](_0x40987b);}})[_0x0cee('0x2c')](handleError(_0x8a1ed0,null));};exports[_0x0cee('0x7d')]=function(_0x105b9f,_0x270f32){var _0x32a5f1={'offset':moment()['utcOffset']()};_0x32a5f1['now']=moment()[_0x0cee('0x7e')](_0x32a5f1[_0x0cee('0x31')])[_0x0cee('0x7f')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x270f32[_0x0cee('0x2e')](0xc8)[_0x0cee('0x3b')](_0x32a5f1);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index a348d60..75c93b3 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x7217,0x19e));var _0x7721=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x7217[_0x1ddedd];return _0xa3e1ac;};'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 d716df4..68c093c 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 _0x4ccd=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSetting','Setting','find','options','raw','where','include','map','model','attributes','catch','lodash','util','moment','bluebird'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4ccd,0xe3));var _0xd4cc=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x4ccd[_0x1aba25];return _0x47d997;};'use strict';var _=require(_0xd4cc('0x0'));var util=require(_0xd4cc('0x1'));var moment=require(_0xd4cc('0x2'));var BPromise=require(_0xd4cc('0x3'));var rs=require(_0xd4cc('0x4'));var fs=require('fs');var Redis=require(_0xd4cc('0x5'));var db=require(_0xd4cc('0x6'))['db'];var utils=require(_0xd4cc('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd4cc('0x8'));var jayson=require(_0xd4cc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53cf4a,_0x14631f,_0x24193f){return new BPromise(function(_0x499df1,_0xeb211){return client[_0xd4cc('0xa')](_0x53cf4a,_0x24193f)[_0xd4cc('0xb')](function(_0x27e1d){logger[_0xd4cc('0xc')](_0xd4cc('0xd'),_0x14631f,_0xd4cc('0xe'));logger[_0xd4cc('0xf')](_0xd4cc('0x10'),_0x14631f,_0xd4cc('0xe'),JSON[_0xd4cc('0x11')](_0x27e1d));if(_0x27e1d[_0xd4cc('0x12')]){if(_0x27e1d[_0xd4cc('0x12')][_0xd4cc('0x13')]===0x1f4){logger['error'](_0xd4cc('0xd'),_0x14631f,_0x27e1d[_0xd4cc('0x12')][_0xd4cc('0x14')]);return _0xeb211(_0x27e1d['error'][_0xd4cc('0x14')]);}logger[_0xd4cc('0x12')](_0xd4cc('0xd'),_0x14631f,_0x27e1d[_0xd4cc('0x12')]['message']);return _0x499df1(_0x27e1d[_0xd4cc('0x12')][_0xd4cc('0x14')]);}else{logger[_0xd4cc('0xc')](_0xd4cc('0xd'),_0x14631f,_0xd4cc('0xe'));_0x499df1(_0x27e1d[_0xd4cc('0x15')][_0xd4cc('0x14')]);}})['catch'](function(_0x433713){logger['error'](_0xd4cc('0xd'),_0x14631f,_0x433713);_0xeb211(_0x433713);});});}exports[_0xd4cc('0x16')]=function(_0xab1ffc){var _0x5b8e70=this;return new Promise(function(_0x4ce1cb,_0x597fc5){return db[_0xd4cc('0x17')][_0xd4cc('0x18')]({'raw':_0xab1ffc['options']?_0xab1ffc[_0xd4cc('0x19')][_0xd4cc('0x1a')]===undefined?!![]:![]:!![],'where':_0xab1ffc[_0xd4cc('0x19')]?_0xab1ffc['options'][_0xd4cc('0x1b')]||null:null,'attributes':_0xab1ffc[_0xd4cc('0x19')]?_0xab1ffc[_0xd4cc('0x19')]['attributes']||null:null,'include':_0xab1ffc[_0xd4cc('0x19')]?_0xab1ffc[_0xd4cc('0x19')][_0xd4cc('0x1c')]?_[_0xd4cc('0x1d')](_0xab1ffc['options'][_0xd4cc('0x1c')],function(_0x10524a){return{'model':db[_0x10524a[_0xd4cc('0x1e')]],'as':_0x10524a['as'],'attributes':_0x10524a[_0xd4cc('0x1f')],'include':_0x10524a[_0xd4cc('0x1c')]?_[_0xd4cc('0x1d')](_0x10524a[_0xd4cc('0x1c')],function(_0x2403fe){return{'model':db[_0x2403fe['model']],'as':_0x2403fe['as'],'attributes':_0x2403fe[_0xd4cc('0x1f')],'include':_0x2403fe['include']?_[_0xd4cc('0x1d')](_0x2403fe[_0xd4cc('0x1c')],function(_0x40e724){return{'model':db[_0x40e724[_0xd4cc('0x1e')]],'as':_0x40e724['as'],'attributes':_0x40e724['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4cc('0xb')](function(_0x3ac553){logger[_0xd4cc('0xc')]('ShowSetting',_0xab1ffc);logger['debug']('ShowSetting',_0xab1ffc,JSON[_0xd4cc('0x11')](_0x3ac553));_0x4ce1cb(_0x3ac553);})[_0xd4cc('0x20')](function(_0x4c314c){logger[_0xd4cc('0x12')]('ShowSetting',_0x4c314c['message'],_0xab1ffc);_0x597fc5(_0x5b8e70['error'](0x1f4,_0x4c314c[_0xd4cc('0x14')]));});});}; \ No newline at end of file +var _0x2d96=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Setting,\x20%s,\x20%s','catch','find','options','raw','attributes','include','map','model','ShowSetting','stringify'];(function(_0x2cdff4,_0x161af6){var _0x22b2ab=function(_0x57064a){while(--_0x57064a){_0x2cdff4['push'](_0x2cdff4['shift']());}};_0x22b2ab(++_0x161af6);}(_0x2d96,0x134));var _0x62d9=function(_0x57f9ac,_0x57c899){_0x57f9ac=_0x57f9ac-0x0;var _0x57dba3=_0x2d96[_0x57f9ac];return _0x57dba3;};'use strict';var _=require(_0x62d9('0x0'));var util=require('util');var moment=require(_0x62d9('0x1'));var BPromise=require(_0x62d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62d9('0x3'));var db=require(_0x62d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x62d9('0x5'))(_0x62d9('0x6'));var config=require('../../config/environment');var jayson=require(_0x62d9('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1eafa9,_0x2b62d4,_0x238195){return new BPromise(function(_0x2e3952,_0x772697){return client[_0x62d9('0x8')](_0x1eafa9,_0x238195)[_0x62d9('0x9')](function(_0x7a0df1){logger[_0x62d9('0xa')]('Setting,\x20%s,\x20%s',_0x2b62d4,'request\x20sent');logger[_0x62d9('0xb')](_0x62d9('0xc'),_0x2b62d4,_0x62d9('0xd'),JSON['stringify'](_0x7a0df1));if(_0x7a0df1[_0x62d9('0xe')]){if(_0x7a0df1['error'][_0x62d9('0xf')]===0x1f4){logger[_0x62d9('0xe')]('Setting,\x20%s,\x20%s',_0x2b62d4,_0x7a0df1[_0x62d9('0xe')][_0x62d9('0x10')]);return _0x772697(_0x7a0df1[_0x62d9('0xe')][_0x62d9('0x10')]);}logger[_0x62d9('0xe')](_0x62d9('0x11'),_0x2b62d4,_0x7a0df1[_0x62d9('0xe')][_0x62d9('0x10')]);return _0x2e3952(_0x7a0df1['error'][_0x62d9('0x10')]);}else{logger[_0x62d9('0xa')](_0x62d9('0x11'),_0x2b62d4,_0x62d9('0xd'));_0x2e3952(_0x7a0df1['result'][_0x62d9('0x10')]);}})[_0x62d9('0x12')](function(_0x2dccb8){logger[_0x62d9('0xe')](_0x62d9('0x11'),_0x2b62d4,_0x2dccb8);_0x772697(_0x2dccb8);});});}exports['ShowSetting']=function(_0x4d31aa){var _0x2bd002=this;return new Promise(function(_0x3b9768,_0x5db206){return db['Setting'][_0x62d9('0x13')]({'raw':_0x4d31aa[_0x62d9('0x14')]?_0x4d31aa[_0x62d9('0x14')][_0x62d9('0x15')]===undefined?!![]:![]:!![],'where':_0x4d31aa[_0x62d9('0x14')]?_0x4d31aa[_0x62d9('0x14')]['where']||null:null,'attributes':_0x4d31aa[_0x62d9('0x14')]?_0x4d31aa[_0x62d9('0x14')][_0x62d9('0x16')]||null:null,'include':_0x4d31aa['options']?_0x4d31aa['options'][_0x62d9('0x17')]?_[_0x62d9('0x18')](_0x4d31aa[_0x62d9('0x14')][_0x62d9('0x17')],function(_0x10f522){return{'model':db[_0x10f522['model']],'as':_0x10f522['as'],'attributes':_0x10f522[_0x62d9('0x16')],'include':_0x10f522[_0x62d9('0x17')]?_['map'](_0x10f522['include'],function(_0x503440){return{'model':db[_0x503440[_0x62d9('0x19')]],'as':_0x503440['as'],'attributes':_0x503440[_0x62d9('0x16')],'include':_0x503440[_0x62d9('0x17')]?_['map'](_0x503440[_0x62d9('0x17')],function(_0x252bc0){return{'model':db[_0x252bc0[_0x62d9('0x19')]],'as':_0x252bc0['as'],'attributes':_0x252bc0[_0x62d9('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x571bbb){logger['info']('ShowSetting',_0x4d31aa);logger[_0x62d9('0xb')](_0x62d9('0x1a'),_0x4d31aa,JSON[_0x62d9('0x1b')](_0x571bbb));_0x3b9768(_0x571bbb);})[_0x62d9('0x12')](function(_0x2c5a42){logger[_0x62d9('0xe')](_0x62d9('0x1a'),_0x2c5a42[_0x62d9('0x10')],_0x4d31aa);_0x5db206(_0x2bd002[_0x62d9('0xe')](0x1f4,_0x2c5a42[_0x62d9('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 5d48059..1a4e5aa 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 _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x4c97b5,_0x45ad66){var _0x584166=function(_0x25f7ca){while(--_0x25f7ca){_0x4c97b5['push'](_0x4c97b5['shift']());}};_0x584166(++_0x45ad66);}(_0x7a54,0x106));var _0x47a5=function(_0x3c92de,_0x511153){_0x3c92de=_0x3c92de-0x0;var _0x22008a=_0x7a54[_0x3c92de];return _0x22008a;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0xa1586,_0x16eb51){var _0x19576e=function(_0x3906ea){while(--_0x3906ea){_0xa1586['push'](_0xa1586['shift']());}};_0x19576e(++_0x16eb51);}(_0x7a54,0x106));var _0x47a5=function(_0x3eaef2,_0x3c668c){_0x3eaef2=_0x3eaef2-0x0;var _0x48cb9a=_0x7a54[_0x3eaef2];return _0x48cb9a;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 5e19933..71f265b 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 _0x2465=['bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','twilio','skebby','connectel','clicksend','plivo','clickatell'];(function(_0x299187,_0x3ba3a4){var _0x574676=function(_0x22904b){while(--_0x22904b){_0x299187['push'](_0x299187['shift']());}};_0x574676(++_0x3ba3a4);}(_0x2465,0xef));var _0x5246=function(_0x356e90,_0x2b8094){_0x356e90=_0x356e90-0x0;var _0x205d3e=_0x2465[_0x356e90];return _0x205d3e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x5246('0x0'));module[_0x5246('0x1')]={'name':{'type':Sequelize[_0x5246('0x2')],'unique':_0x5246('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x5246('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x5246('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x5246('0x2')],'defaultValue':function(){return rs[_0x5246('0x4')]();}},'phone':{'type':Sequelize[_0x5246('0x2')]},'type':{'type':Sequelize['ENUM'](_0x5246('0x5'),_0x5246('0x6'),_0x5246('0x7'),_0x5246('0x8'),_0x5246('0x9'),_0x5246('0xa'),_0x5246('0xb'),_0x5246('0xc'),_0x5246('0xd'),_0x5246('0xe'))},'accountSid':{'type':Sequelize[_0x5246('0x2')]},'authId':{'type':Sequelize[_0x5246('0x2')]},'authToken':{'type':Sequelize[_0x5246('0x2')]},'smsMethod':{'type':Sequelize[_0x5246('0xf')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x5246('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x5246('0x2')]},'accountId':{'type':Sequelize[_0x5246('0x2')]},'senderString':{'type':Sequelize[_0x5246('0x2')]},'deliveryReport':{'type':Sequelize[_0x5246('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0x5246('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5246('0x11')],'defaultValue':function(){return _0x5246('0x12');}},'notificationSound':{'type':Sequelize[_0x5246('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5246('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5246('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5246('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5246('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5246('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5246('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5246('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5246('0x13')],'comment':_0x5246('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x5246('0x10')],'defaultValue':![],'comment':_0x5246('0x15'),'set':function(_0x456e30){if(!_0x456e30)this[_0x5246('0x16')](_0x5246('0x17'),null);this[_0x5246('0x16')](_0x5246('0x18'),_0x456e30);}}}; \ No newline at end of file +var _0xc506=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x1e20f4,_0x103413){var _0x7d34cd=function(_0x51f50f){while(--_0x51f50f){_0x1e20f4['push'](_0x1e20f4['shift']());}};_0x7d34cd(++_0x103413);}(_0xc506,0x131));var _0x6c50=function(_0x452ad3,_0x3e5ca8){_0x452ad3=_0x452ad3-0x0;var _0x349222=_0xc506[_0x452ad3];return _0x349222;};'use strict';var Sequelize=require(_0x6c50('0x0'));var rs=require(_0x6c50('0x1'));module[_0x6c50('0x2')]={'name':{'type':Sequelize[_0x6c50('0x3')],'unique':_0x6c50('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x6c50('0x3')],'defaultValue':function(){return rs[_0x6c50('0x5')]();}},'phone':{'type':Sequelize[_0x6c50('0x3')]},'type':{'type':Sequelize[_0x6c50('0x6')](_0x6c50('0x7'),_0x6c50('0x8'),_0x6c50('0x9'),'clicksend',_0x6c50('0xa'),_0x6c50('0xb'),'bandwidth','csc',_0x6c50('0xc'),_0x6c50('0xd'))},'accountSid':{'type':Sequelize[_0x6c50('0x3')]},'authId':{'type':Sequelize[_0x6c50('0x3')]},'authToken':{'type':Sequelize[_0x6c50('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6c50('0x3')]},'apiKey':{'type':Sequelize[_0x6c50('0x3')]},'applicationId':{'type':Sequelize[_0x6c50('0x3')]},'accountId':{'type':Sequelize[_0x6c50('0x3')]},'senderString':{'type':Sequelize[_0x6c50('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x6c50('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6c50('0xe')],'defaultValue':function(){return _0x6c50('0xf');}},'notificationSound':{'type':Sequelize[_0x6c50('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6c50('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6c50('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6c50('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6c50('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6c50('0x11')],'comment':_0x6c50('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x6c50('0x10')],'defaultValue':![],'comment':_0x6c50('0x13'),'set':function(_0x55dec9){if(!_0x55dec9)this['setDataValue'](_0x6c50('0x14'),null);this[_0x6c50('0x15')](_0x6c50('0x16'),_0x55dec9);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 76cbd66..f1708d1 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 _0xe683=['READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','status_code','groupName','redif','error_code','infobip','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','DELIVRD','ACCEPTD','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','show','params','includeAll','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','findOne','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','messageId','skebby','sender','connectel','clicksend','message_id','plivo','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','clickatell','bandwidth','refid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','ListId','Contacts','list','omit','contact','SmsInteraction','interaction','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS'];(function(_0x46b682,_0x3ecdda){var _0x323a7a=function(_0x46194a){while(--_0x46194a){_0x46b682['push'](_0x46b682['shift']());}};_0x323a7a(++_0x3ecdda);}(_0xe683,0x109));var _0x3e68=function(_0x1d200d,_0x59219d){_0x1d200d=_0x1d200d-0x0;var _0x505557=_0xe683[_0x1d200d];return _0x505557;};'use strict';var emlformat=require(_0x3e68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e68('0x1'));var jsonpatch=require(_0x3e68('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e68('0x3'));var Mustache=require(_0x3e68('0x4'));var util=require(_0x3e68('0x5'));var path=require(_0x3e68('0x6'));var sox=require(_0x3e68('0x7'));var csv=require(_0x3e68('0x8'));var ejs=require(_0x3e68('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3e68('0xa'));var crypto=require(_0x3e68('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3e68('0x8'));var querystring=require(_0x3e68('0xc'));var Papa=require(_0x3e68('0xd'));var Redis=require(_0x3e68('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3e68('0xf'));var as=require(_0x3e68('0x10'));var hardwareService=require(_0x3e68('0x11'));var logger=require('../../config/logger')(_0x3e68('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3e68('0x13'));var db=require(_0x3e68('0x14'))['db'];config[_0x3e68('0x15')]=_[_0x3e68('0x16')](config[_0x3e68('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e68('0x17'))(new Redis(config[_0x3e68('0x15')]));require('./smsAccount.socket')[_0x3e68('0x18')](socket);var jayson=require(_0x3e68('0x19'));var client=jayson['client'][_0x3e68('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x157c29,_0xe54cd0,_0x2954a5,_0x38b231){return new BPromise(function(_0x14f9b3,_0x4ea7a6){var _0x5f0840=_0x38b231||client;return _0x5f0840[_0x3e68('0x1b')](_0x157c29,_0x2954a5)[_0x3e68('0x1c')](function(_0x4d915f){logger[_0x3e68('0x1d')](_0x3e68('0x1e'),_0xe54cd0,_0x3e68('0x1f'));logger['debug'](_0x3e68('0x20'),_0xe54cd0,_0x3e68('0x1f'),JSON[_0x3e68('0x21')](_0x4d915f));if(_0x4d915f[_0x3e68('0x22')]){if(_0x4d915f[_0x3e68('0x22')][_0x3e68('0x23')]===0x1f4){logger['error'](_0x3e68('0x1e'),_0xe54cd0,_0x4d915f[_0x3e68('0x22')][_0x3e68('0x24')]);return _0x4ea7a6(_0x4d915f[_0x3e68('0x22')][_0x3e68('0x24')]);}logger[_0x3e68('0x22')]('SmsAccount,\x20%s,\x20%s',_0xe54cd0,_0x4d915f[_0x3e68('0x22')][_0x3e68('0x24')]);return _0x14f9b3(_0x4d915f['error']['message']);}else{logger[_0x3e68('0x1d')](_0x3e68('0x1e'),_0xe54cd0,_0x3e68('0x1f'));_0x14f9b3(_0x4d915f[_0x3e68('0x25')][_0x3e68('0x24')]);}})[_0x3e68('0x26')](function(_0x3203c3){logger[_0x3e68('0x22')](_0x3e68('0x1e'),_0xe54cd0,_0x3203c3);_0x4ea7a6(_0x3203c3);});});}function respondWithStatusCode(_0x469409,_0x3f2d33){_0x3f2d33=_0x3f2d33||0xcc;return function(_0x6c629a){if(_0x6c629a){return _0x469409[_0x3e68('0x27')](_0x3f2d33);}return _0x469409[_0x3e68('0x28')](_0x3f2d33)[_0x3e68('0x29')]();};}function respondWithResult(_0x689b96,_0x2a373e){_0x2a373e=_0x2a373e||0xc8;return function(_0x5c75f4){if(_0x5c75f4){return _0x689b96[_0x3e68('0x28')](_0x2a373e)[_0x3e68('0x2a')](_0x5c75f4);}};}function respondWithFilteredResult(_0x198012,_0x1ba45a){return function(_0x2ea4d8){if(_0x2ea4d8){var _0x55deaf=typeof _0x1ba45a[_0x3e68('0x2b')]===_0x3e68('0x2c')&&typeof _0x1ba45a[_0x3e68('0x2d')]===_0x3e68('0x2c');var _0x4f8db0=_0x2ea4d8[_0x3e68('0x2e')];var _0x2970ed=_0x55deaf?0x0:_0x1ba45a[_0x3e68('0x2b')];var _0x2cdfde=_0x55deaf?_0x2ea4d8[_0x3e68('0x2e')]:_0x1ba45a[_0x3e68('0x2b')]+_0x1ba45a[_0x3e68('0x2d')];var _0x383061;if(_0x2cdfde>=_0x4f8db0){_0x2cdfde=_0x4f8db0;_0x383061=0xc8;}else{_0x383061=0xce;}_0x198012[_0x3e68('0x28')](_0x383061);return _0x198012[_0x3e68('0x2f')](_0x3e68('0x30'),_0x2970ed+'-'+_0x2cdfde+'/'+_0x4f8db0)[_0x3e68('0x2a')](_0x2ea4d8);}return null;};}function patchUpdates(_0x406864){return function(_0x1bcfdf){try{jsonpatch[_0x3e68('0x31')](_0x1bcfdf,_0x406864,!![]);}catch(_0x4706d2){return BPromise[_0x3e68('0x32')](_0x4706d2);}return _0x1bcfdf[_0x3e68('0x33')]();};}function saveUpdates(_0x150793,_0x3dc942){return function(_0x489654){if(_0x489654){return _0x489654[_0x3e68('0x34')](_0x150793)[_0x3e68('0x1c')](function(_0x275de7){return _0x275de7;});}return null;};}function removeEntity(_0x8987e,_0x50efab){return function(_0x2177b1){if(_0x2177b1){return _0x2177b1[_0x3e68('0x35')]()['then'](function(){var _0x2ad3b1=_0x2177b1['get']({'plain':!![]});var _0x2fa9ca=_0x3e68('0x36');return db[_0x3e68('0x37')][_0x3e68('0x35')]({'where':{'type':_0x2fa9ca,'resourceId':_0x2ad3b1['id']}})[_0x3e68('0x1c')](function(){return _0x2177b1;});})[_0x3e68('0x1c')](function(){_0x8987e[_0x3e68('0x28')](0xcc)[_0x3e68('0x29')]();});}};}function handleEntityNotFound(_0x27c6dc,_0xc24e36){return function(_0x48997b){if(!_0x48997b){_0x27c6dc[_0x3e68('0x27')](0x194);}return _0x48997b;};}function handleError(_0x4d229b,_0x1c6c3a){_0x1c6c3a=_0x1c6c3a||0x1f4;return function(_0x314c80){logger[_0x3e68('0x22')](_0x314c80[_0x3e68('0x38')]);if(_0x314c80[_0x3e68('0x39')]){delete _0x314c80[_0x3e68('0x39')];}_0x4d229b[_0x3e68('0x28')](_0x1c6c3a)[_0x3e68('0x3a')](_0x314c80);};}exports['index']=function(_0x4fc83e,_0x4be025){var _0x38debf={'include':[{'model':db[_0x3e68('0x3b')],'as':_0x3e68('0x3c')}]},_0x1957b0={},_0x3a309a={'count':0x0,'rows':[]};var _0x4f036a=_[_0x3e68('0x3d')](db[_0x3e68('0x3e')][_0x3e68('0x3f')],function(_0x194c82){return{'name':_0x194c82[_0x3e68('0x40')],'type':_0x194c82[_0x3e68('0x41')][_0x3e68('0x42')]};});_0x1957b0[_0x3e68('0x43')]=_[_0x3e68('0x3d')](_0x4f036a,'name');_0x1957b0[_0x3e68('0x44')]=_[_0x3e68('0x45')](_0x4fc83e['query']);_0x1957b0[_0x3e68('0x46')]=_[_0x3e68('0x47')](_0x1957b0[_0x3e68('0x43')],_0x1957b0[_0x3e68('0x44')]);_0x38debf[_0x3e68('0x48')]=_[_0x3e68('0x47')](_0x1957b0[_0x3e68('0x43')],qs[_0x3e68('0x49')](_0x4fc83e['query'][_0x3e68('0x49')]));_0x38debf[_0x3e68('0x48')]=_0x38debf['attributes'][_0x3e68('0x4a')]?_0x38debf[_0x3e68('0x48')]:_0x1957b0[_0x3e68('0x43')];if(!_0x4fc83e[_0x3e68('0x44')][_0x3e68('0x4b')](_0x3e68('0x4c'))){_0x38debf['limit']=qs['limit'](_0x4fc83e['query'][_0x3e68('0x2d')]);_0x38debf[_0x3e68('0x2b')]=qs['offset'](_0x4fc83e['query'][_0x3e68('0x2b')]);}_0x38debf[_0x3e68('0x4d')]=qs[_0x3e68('0x4e')](_0x4fc83e[_0x3e68('0x44')][_0x3e68('0x4e')]);_0x38debf[_0x3e68('0x4f')]=qs[_0x3e68('0x46')](_[_0x3e68('0x50')](_0x4fc83e[_0x3e68('0x44')],_0x1957b0['filters']),_0x4f036a);if(_0x4fc83e['query'][_0x3e68('0x51')]){_0x38debf['where']=_[_0x3e68('0x52')](_0x38debf[_0x3e68('0x4f')],{'$or':_[_0x3e68('0x3d')](_0x4f036a,function(_0x1d3bf8){if(_0x1d3bf8['type']!=='VIRTUAL'){var _0x3a6bec={};_0x3a6bec[_0x1d3bf8['name']]={'$like':'%'+_0x4fc83e['query'][_0x3e68('0x51')]+'%'};return _0x3a6bec;}})});}_0x38debf=_[_0x3e68('0x52')]({},_0x38debf,_0x4fc83e['options']);var _0x3e8421={'where':_0x38debf[_0x3e68('0x4f')]};return db['SmsAccount'][_0x3e68('0x2e')](_0x3e8421)[_0x3e68('0x1c')](function(_0x528c54){_0x3a309a['count']=_0x528c54;if(_0x4fc83e['query']['includeAll']){_0x38debf[_0x3e68('0x53')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x38debf);})[_0x3e68('0x1c')](function(_0x2c5ae5){_0x3a309a[_0x3e68('0x54')]=_0x2c5ae5;return _0x3a309a;})['then'](respondWithFilteredResult(_0x4be025,_0x38debf))[_0x3e68('0x26')](handleError(_0x4be025,null));};exports[_0x3e68('0x55')]=function(_0x4a43f2,_0x30436d){var _0x1ff109={'raw':![],'where':{'id':_0x4a43f2[_0x3e68('0x56')]['id']},'include':[{'model':db[_0x3e68('0x3b')],'as':_0x3e68('0x3c')}]},_0xeec7e6={};_0xeec7e6[_0x3e68('0x43')]=_[_0x3e68('0x45')](db[_0x3e68('0x3e')][_0x3e68('0x3f')]);_0xeec7e6[_0x3e68('0x44')]=_[_0x3e68('0x45')](_0x4a43f2[_0x3e68('0x44')]);_0xeec7e6[_0x3e68('0x46')]=_[_0x3e68('0x47')](_0xeec7e6['model'],_0xeec7e6[_0x3e68('0x44')]);_0x1ff109[_0x3e68('0x48')]=_['intersection'](_0xeec7e6[_0x3e68('0x43')],qs[_0x3e68('0x49')](_0x4a43f2['query']['fields']));_0x1ff109[_0x3e68('0x48')]=_0x1ff109[_0x3e68('0x48')][_0x3e68('0x4a')]?_0x1ff109['attributes']:_0xeec7e6[_0x3e68('0x43')];if(_0x4a43f2[_0x3e68('0x44')][_0x3e68('0x57')]){_0x1ff109[_0x3e68('0x53')]=[{'all':!![]}];}_0x1ff109=_['merge']({},_0x1ff109,_0x4a43f2[_0x3e68('0x58')]);return db[_0x3e68('0x3e')][_0x3e68('0x59')](_0x1ff109)[_0x3e68('0x1c')](handleEntityNotFound(_0x30436d,null))['then'](respondWithResult(_0x30436d,null))[_0x3e68('0x26')](handleError(_0x30436d,null));};exports[_0x3e68('0x5a')]=function(_0x553f4f,_0x46975e){return db['SmsAccount'][_0x3e68('0x5a')](_0x553f4f['body'],{})['then'](function(_0x322f9e){var _0x2835d4=_0x553f4f['user'][_0x3e68('0x5b')]({'plain':!![]});if(!_0x2835d4)throw new Error(_0x3e68('0x5c'));if(_0x2835d4['role']===_0x3e68('0x5d')){var _0x3d5e30=_0x322f9e[_0x3e68('0x5b')]({'plain':!![]});var _0x492621=_0x3e68('0x36');return db[_0x3e68('0x5e')][_0x3e68('0x59')]({'where':{'name':_0x492621,'userProfileId':_0x2835d4[_0x3e68('0x5f')]},'raw':!![]})[_0x3e68('0x1c')](function(_0x306f90){if(_0x306f90&&_0x306f90[_0x3e68('0x60')]===0x0){return db[_0x3e68('0x37')][_0x3e68('0x5a')]({'name':_0x3d5e30[_0x3e68('0x39')],'resourceId':_0x3d5e30['id'],'type':_0x306f90[_0x3e68('0x39')],'sectionId':_0x306f90['id']},{})['then'](function(){return _0x322f9e;});}else{return _0x322f9e;}})[_0x3e68('0x26')](function(_0x68308d){logger[_0x3e68('0x22')](_0x3e68('0x61'),_0x68308d);throw _0x68308d;});}return _0x322f9e;})[_0x3e68('0x1c')](respondWithResult(_0x46975e,0xc9))[_0x3e68('0x26')](handleError(_0x46975e,null));};exports[_0x3e68('0x34')]=function(_0x4e7462,_0x2bba7f){if(_0x4e7462[_0x3e68('0x62')]['id']){delete _0x4e7462[_0x3e68('0x62')]['id'];}return db['SmsAccount'][_0x3e68('0x59')]({'where':{'id':_0x4e7462[_0x3e68('0x56')]['id']},'include':[{'model':db[_0x3e68('0x3b')],'as':_0x3e68('0x3c')}]})['then'](handleEntityNotFound(_0x2bba7f,null))['then'](saveUpdates(_0x4e7462['body'],null))['then'](respondWithResult(_0x2bba7f,null))[_0x3e68('0x26')](handleError(_0x2bba7f,null));};exports[_0x3e68('0x35')]=function(_0x231b3f,_0x3c64a5){return db[_0x3e68('0x3e')]['find']({'where':{'id':_0x231b3f[_0x3e68('0x56')]['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x3c64a5,null))[_0x3e68('0x1c')](removeEntity(_0x3c64a5,null))['catch'](handleError(_0x3c64a5,null));};exports[_0x3e68('0x63')]=function(_0x412c6c,_0x1451b2){return db['SmsAccount'][_0x3e68('0x63')]()[_0x3e68('0x1c')](respondWithResult(_0x1451b2,null))[_0x3e68('0x26')](handleError(_0x1451b2,null));};exports[_0x3e68('0x64')]=function(_0x1716db,_0x284705,_0x406fce){if(_0x1716db[_0x3e68('0x62')]['id']){delete _0x1716db[_0x3e68('0x62')]['id'];}return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x1716db['params']['id']}})['then'](handleEntityNotFound(_0x284705,null))[_0x3e68('0x1c')](function(_0x5de51a){if(_0x5de51a){_0x1716db[_0x3e68('0x62')][_0x3e68('0x65')]=_0x5de51a['id'];return db['Disposition'][_0x3e68('0x5a')](_0x1716db[_0x3e68('0x62')]);}})['then'](respondWithResult(_0x284705,null))[_0x3e68('0x26')](handleError(_0x284705,null));};exports['getDispositions']=function(_0xebda95,_0x22ea9a,_0x51ccf7){var _0x1e4ef0={'raw':![],'where':{}};var _0x2f2a5a={};var _0x4ec52a={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3e68('0x66')]({'where':{'id':_0xebda95[_0x3e68('0x56')]['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x22ea9a,null))[_0x3e68('0x1c')](function(_0x4c9bd8){if(_0x4c9bd8){_0x2f2a5a[_0x3e68('0x43')]=_['keys'](db['Disposition'][_0x3e68('0x3f')]);_0x2f2a5a[_0x3e68('0x44')]=_[_0x3e68('0x45')](_0xebda95[_0x3e68('0x44')]);_0x2f2a5a[_0x3e68('0x46')]=_[_0x3e68('0x47')](_0x2f2a5a[_0x3e68('0x43')],_0x2f2a5a[_0x3e68('0x44')]);_0x1e4ef0[_0x3e68('0x48')]=_[_0x3e68('0x47')](_0x2f2a5a[_0x3e68('0x43')],qs[_0x3e68('0x49')](_0xebda95[_0x3e68('0x44')][_0x3e68('0x49')]));_0x1e4ef0[_0x3e68('0x48')]=_0x1e4ef0[_0x3e68('0x48')][_0x3e68('0x4a')]?_0x1e4ef0['attributes']:_0x2f2a5a[_0x3e68('0x43')];if(!_0xebda95[_0x3e68('0x44')]['hasOwnProperty']('nolimit')){_0x1e4ef0['limit']=qs[_0x3e68('0x2d')](_0xebda95[_0x3e68('0x44')][_0x3e68('0x2d')]);_0x1e4ef0['offset']=qs['offset'](_0xebda95[_0x3e68('0x44')]['offset']);}_0x1e4ef0[_0x3e68('0x4d')]=qs['sort'](_0xebda95[_0x3e68('0x44')][_0x3e68('0x4e')]);_0x1e4ef0[_0x3e68('0x4f')]=qs[_0x3e68('0x46')](_[_0x3e68('0x50')](_0xebda95[_0x3e68('0x44')],_0x2f2a5a[_0x3e68('0x46')]));_0x1e4ef0[_0x3e68('0x4f')][_0x3e68('0x65')]=_0x4c9bd8['id'];if(_0xebda95[_0x3e68('0x44')][_0x3e68('0x51')]){_0x1e4ef0[_0x3e68('0x4f')]=_[_0x3e68('0x52')](_0x1e4ef0['where'],{'$or':_[_0x3e68('0x3d')](_0x1e4ef0[_0x3e68('0x48')],function(_0x181cad){var _0x5d595a={};_0x5d595a[_0x181cad]={'$like':'%'+_0xebda95[_0x3e68('0x44')]['filter']+'%'};return _0x5d595a;})});}_0x1e4ef0=_[_0x3e68('0x52')]({},_0x1e4ef0,_0xebda95[_0x3e68('0x58')]);return db[_0x3e68('0x67')][_0x3e68('0x2e')]({'where':_0x1e4ef0[_0x3e68('0x4f')]})[_0x3e68('0x1c')](function(_0x499de4){_0x4ec52a[_0x3e68('0x2e')]=_0x499de4;if(_0xebda95[_0x3e68('0x44')]['includeAll']){_0x1e4ef0['include']=[{'all':!![]}];}return db[_0x3e68('0x67')][_0x3e68('0x68')](_0x1e4ef0);})[_0x3e68('0x1c')](function(_0x3c42ba){_0x4ec52a[_0x3e68('0x54')]=_0x3c42ba;return _0x4ec52a;});}})['then'](respondWithFilteredResult(_0x22ea9a,_0x1e4ef0))[_0x3e68('0x26')](handleError(_0x22ea9a,null));};exports[_0x3e68('0x69')]=function(_0xc11faf,_0x10a92c,_0x4d457b){return db[_0x3e68('0x3e')]['find']({'where':{'id':_0xc11faf[_0x3e68('0x56')]['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x10a92c,null))['then'](function(_0x5a2fc0){if(_0x5a2fc0){return _0x5a2fc0[_0x3e68('0x69')](_0xc11faf['query'][_0x3e68('0x6a')]);}})[_0x3e68('0x1c')](respondWithStatusCode(_0x10a92c,null))['catch'](handleError(_0x10a92c,null));};exports[_0x3e68('0x6b')]=function(_0x52508b,_0x4bac9e,_0x960e29){if(_0x52508b[_0x3e68('0x62')]['id']){delete _0x52508b[_0x3e68('0x62')]['id'];}return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x52508b[_0x3e68('0x56')]['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x4bac9e,null))[_0x3e68('0x1c')](function(_0x8a2c68){if(_0x8a2c68){_0x52508b[_0x3e68('0x62')]['SmsAccountId']=_0x8a2c68['id'];return db[_0x3e68('0x6c')]['create'](_0x52508b[_0x3e68('0x62')]);}})['then'](respondWithResult(_0x4bac9e,null))[_0x3e68('0x26')](handleError(_0x4bac9e,null));};exports[_0x3e68('0x6d')]=function(_0x49094,_0x5dfd33,_0x490c6){var _0x55acd5={'raw':![],'where':{}};var _0xc33008={};var _0x1887ac={'count':0x0,'rows':[]};return db[_0x3e68('0x3e')][_0x3e68('0x66')]({'where':{'id':_0x49094[_0x3e68('0x56')]['id']}})['then'](handleEntityNotFound(_0x5dfd33,null))[_0x3e68('0x1c')](function(_0x4046c){if(_0x4046c){_0xc33008[_0x3e68('0x43')]=_[_0x3e68('0x45')](db[_0x3e68('0x6c')][_0x3e68('0x3f')]);_0xc33008[_0x3e68('0x44')]=_[_0x3e68('0x45')](_0x49094['query']);_0xc33008[_0x3e68('0x46')]=_[_0x3e68('0x47')](_0xc33008[_0x3e68('0x43')],_0xc33008[_0x3e68('0x44')]);_0x55acd5[_0x3e68('0x48')]=_['intersection'](_0xc33008[_0x3e68('0x43')],qs[_0x3e68('0x49')](_0x49094[_0x3e68('0x44')]['fields']));_0x55acd5[_0x3e68('0x48')]=_0x55acd5['attributes'][_0x3e68('0x4a')]?_0x55acd5[_0x3e68('0x48')]:_0xc33008[_0x3e68('0x43')];if(!_0x49094['query']['hasOwnProperty'](_0x3e68('0x4c'))){_0x55acd5[_0x3e68('0x2d')]=qs[_0x3e68('0x2d')](_0x49094[_0x3e68('0x44')][_0x3e68('0x2d')]);_0x55acd5[_0x3e68('0x2b')]=qs[_0x3e68('0x2b')](_0x49094[_0x3e68('0x44')][_0x3e68('0x2b')]);}_0x55acd5['order']=qs[_0x3e68('0x4e')](_0x49094[_0x3e68('0x44')][_0x3e68('0x4e')]);_0x55acd5[_0x3e68('0x4f')]=qs['filters'](_[_0x3e68('0x50')](_0x49094[_0x3e68('0x44')],_0xc33008[_0x3e68('0x46')]));_0x55acd5[_0x3e68('0x4f')][_0x3e68('0x65')]=_0x4046c['id'];if(_0x49094[_0x3e68('0x44')][_0x3e68('0x51')]){_0x55acd5['where']=_[_0x3e68('0x52')](_0x55acd5[_0x3e68('0x4f')],{'$or':_['map'](_0x55acd5['attributes'],function(_0x4df3ec){var _0x37dc5b={};_0x37dc5b[_0x4df3ec]={'$like':'%'+_0x49094[_0x3e68('0x44')][_0x3e68('0x51')]+'%'};return _0x37dc5b;})});}_0x55acd5=_[_0x3e68('0x52')]({},_0x55acd5,_0x49094[_0x3e68('0x58')]);return db[_0x3e68('0x6c')][_0x3e68('0x2e')]({'where':_0x55acd5['where']})['then'](function(_0x254548){_0x1887ac[_0x3e68('0x2e')]=_0x254548;if(_0x49094['query'][_0x3e68('0x57')]){_0x55acd5[_0x3e68('0x53')]=[{'all':!![]}];}return db[_0x3e68('0x6c')]['findAll'](_0x55acd5);})['then'](function(_0x268b45){_0x1887ac[_0x3e68('0x54')]=_0x268b45;return _0x1887ac;});}})['then'](respondWithFilteredResult(_0x5dfd33,_0x55acd5))[_0x3e68('0x26')](handleError(_0x5dfd33,null));};exports[_0x3e68('0x6e')]=function(_0x2dc1c2,_0x3703b3,_0x5592b8){return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x2dc1c2[_0x3e68('0x56')]['id']}})['then'](handleEntityNotFound(_0x3703b3,null))[_0x3e68('0x1c')](function(_0x132409){if(_0x132409){return _0x132409[_0x3e68('0x6e')](_0x2dc1c2[_0x3e68('0x44')]['ids']);}})[_0x3e68('0x1c')](respondWithStatusCode(_0x3703b3,null))['catch'](handleError(_0x3703b3,null));};exports[_0x3e68('0x6f')]=function(_0x43d81b,_0x4caf0f,_0x3b9f9e){var _0xd0fe14={'channel':_0x3e68('0x70')};var _0x3208b3=[];var _0x3bd8c4=[];var _0x3c2d0b={};return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x43d81b[_0x3e68('0x56')]['id']},'include':[{'model':db[_0x3e68('0x71')],'as':_0x3e68('0x72')}]})[_0x3e68('0x1c')](handleEntityNotFound(_0x4caf0f,null))[_0x3e68('0x1c')](function(_0x395f27){_0xd0fe14[_0x3e68('0x73')]=_0x395f27;_0xd0fe14[_0x3e68('0x74')]=_['orderBy'](_0x395f27['Applications'],[_0x3e68('0x75')],['asc']);if(_0xd0fe14[_0x3e68('0x73')]['Applications']){delete _0xd0fe14[_0x3e68('0x73')][_0x3e68('0x72')];}return db[_0x3e68('0x76')][_0x3e68('0x63')]();})['then'](function(_0x19d860){if(!_0x19d860){throw new db['Sequelize']['ValidationError'](_0x3e68('0x77'));}_0x3208b3=_['difference'](_[_0x3e68('0x45')](_0x19d860),[_0x3e68('0x78'),_0x3e68('0x79')]);_0x3bd8c4=_[_0x3e68('0x7a')](_[_0x3e68('0x45')](_0x19d860),[_0x3e68('0x78'),'updatedAt',_0x3e68('0x7b'),'ListId']);_0xd0fe14['body']={'mapKey':_0x3e68('0x7c')};if(_0xd0fe14['account'][_0x3e68('0x41')]){switch(_0xd0fe14[_0x3e68('0x73')][_0x3e68('0x41')]){case _0x3e68('0x7d'):_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x7f')];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')]['Body'];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x80')]=_0x43d81b[_0x3e68('0x62')]['MessageSid'];break;case _0x3e68('0x81'):_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')]='+'+_0x43d81b[_0x3e68('0x62')][_0x3e68('0x82')];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')]['text'];break;case _0x3e68('0x83'):_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')]=_0x43d81b[_0x3e68('0x62')]['from'];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x24')];break;case _0x3e68('0x84'):_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x7e')];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')]['body'];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x80')]=_0x43d81b['body'][_0x3e68('0x85')];break;case _0x3e68('0x86'):_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')]=_0x43d81b[_0x3e68('0x62')]['From'];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')]['Text'];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x80')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x87')];break;case'infobip':_0xd0fe14['body'][_0x3e68('0x7e')]='+'+_0x43d81b[_0x3e68('0x62')][_0x3e68('0x88')][0x0][_0x3e68('0x7e')];_0xd0fe14[_0x3e68('0x62')]['body']=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x88')][0x0][_0x3e68('0x89')];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x80')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x88')][0x0]['messageId'];break;case _0x3e68('0x8a'):_0xd0fe14['body'][_0x3e68('0x7e')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x8b')];_0xd0fe14['body'][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x8c')][_0x3e68('0x24')];break;case _0x3e68('0x8d'):_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')]=_0x43d81b['body']['fromNumber'];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x89')];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x80')]=_0x43d81b['body']['replyMessageId'];break;case _0x3e68('0x8e'):_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x80')]=_0x43d81b[_0x3e68('0x62')][0x0][_0x3e68('0x24')]['id'];_0xd0fe14[_0x3e68('0x62')]['from']=_0x43d81b[_0x3e68('0x62')][0x0][_0x3e68('0x24')][_0x3e68('0x7e')];_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')]=_0x43d81b[_0x3e68('0x62')][0x0][_0x3e68('0x24')][_0x3e68('0x89')];break;case'intelepeer':_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x7e')];_0xd0fe14[_0x3e68('0x62')]['body']=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x24')];_0xd0fe14['body'][_0x3e68('0x80')]=_0x43d81b[_0x3e68('0x62')][_0x3e68('0x8f')];break;}}if(_0xd0fe14[_0x3e68('0x62')]['id']){delete _0xd0fe14['body']['id'];}if(_[_0x3e68('0x90')](_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')])){throw new db[(_0x3e68('0x91'))][(_0x3e68('0x92'))](_0x3e68('0x93'));}if(_[_0x3e68('0x90')](_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x62')])||_0xd0fe14['body']['body']===''){throw new db[(_0x3e68('0x91'))][(_0x3e68('0x92'))](_0x3e68('0x94'));}if(_[_0x3e68('0x90')](_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x95')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3bd8c4);}if(!_[_0x3e68('0x96')](_0x3bd8c4,_0xd0fe14['body'][_0x3e68('0x95')])){throw new db['Sequelize'][(_0x3e68('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3bd8c4);}_0x3c2d0b[_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x95')]]=_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')];return db[_0x3e68('0x97')][_0x3e68('0x59')]({'where':{'id':_0xd0fe14[_0x3e68('0x73')][_0x3e68('0x98')]},'include':[{'model':db[_0x3e68('0x76')],'as':_0x3e68('0x99'),'where':_0x3c2d0b,'limit':0x1,'order':[[_0x3e68('0x79'),'DESC']]}]});})[_0x3e68('0x1c')](handleEntityNotFound(_0x4caf0f,null))[_0x3e68('0x1c')](function(_0x40cc03){if(_0x40cc03){_0xd0fe14[_0x3e68('0x9a')]=_[_0x3e68('0x9b')](_0x40cc03,[_0x3e68('0x99')]);if(_0x40cc03[_0x3e68('0x99')]['length']){return _0x40cc03[_0x3e68('0x99')][0x0];}var _0x2005f3=_[_0x3e68('0x16')](_0xd0fe14[_0x3e68('0x62')],{'firstName':_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')],'ListId':_0x40cc03['id']});_0x2005f3[_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x95')]]=_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')];return db[_0x3e68('0x76')][_0x3e68('0x5a')](_0x2005f3,{'fields':_0x3208b3,'raw':!![]});}})[_0x3e68('0x1c')](handleEntityNotFound(_0x4caf0f,null))['then'](function(_0x4c5b02){if(_0x4c5b02){_0xd0fe14[_0x3e68('0x9c')]=_0x4c5b02;var _0x43985a={'ContactId':_0x4c5b02['id'],'phone':_0xd0fe14[_0x3e68('0x62')]['from'],'SmsAccountId':_0x43d81b[_0x3e68('0x56')]['id']};var _0x360e91={'ContactId':_0x4c5b02['id'],'SmsAccountId':_0x43d81b['params']['id'],'closed':![]};return db[_0x3e68('0x9d')]['find']({'where':_0x360e91})[_0x3e68('0x1c')](function(_0x1d96fb){if(_0x1d96fb){return[_0x1d96fb,![]];}return db[_0x3e68('0x9d')][_0x3e68('0x5a')](_0x43985a)[_0x3e68('0x1c')](function(_0x3e9907){return[_0x3e9907,!![]];});});}})['spread'](function(_0x31aaca,_0x12180f){_0xd0fe14[_0x3e68('0x9e')]=_0x31aaca[_0x3e68('0x5b')]({'plain':!![]});_0xd0fe14[_0x3e68('0x9e')]['created']=![];if(_0x12180f){if(_0xd0fe14[_0x3e68('0x73')][_0x3e68('0x9f')]){_0xd0fe14[_0x3e68('0x74')][_0x3e68('0xa0')]({'id':0x0,'priority':_0xd0fe14[_0x3e68('0x74')][_0x3e68('0x4a')]+0x1,'app':_0x3e68('0xa1'),'appdata':'unmanaged','interval':_0x3e68('0xa2')});}_0xd0fe14[_0x3e68('0x9e')]['created']=!![];}return db[_0x3e68('0xa3')][_0x3e68('0x5a')]({'phone':_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x7e')],'messageId':_0xd0fe14[_0x3e68('0x62')][_0x3e68('0x80')],'body':_0xd0fe14['body']['body'],'SmsAccountId':_0x43d81b[_0x3e68('0x56')]['id'],'SmsInteractionId':_0x31aaca['id'],'direction':'in','ContactId':_0x31aaca[_0x3e68('0xa4')],'AttachmentId':_0xd0fe14[_0x3e68('0x62')][_0x3e68('0xa5')]});})[_0x3e68('0x1c')](function(_0x4c80e6){_0xd0fe14[_0x3e68('0x24')]=_0x4c80e6;if(!_0xd0fe14[_0x3e68('0x9e')][_0x3e68('0xa6')])return;return db[_0x3e68('0xa7')][_0x3e68('0x59')]({'attributes':['id',_0x3e68('0x39')],'where':{'id':_0xd0fe14[_0x3e68('0x9e')][_0x3e68('0xa6')]}});})[_0x3e68('0x1c')](function(_0x36d162){if(_0x36d162){_0xd0fe14['applications'][_0x3e68('0xa8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x36d162['name']+','+(_0xd0fe14[_0x3e68('0x73')][_0x3e68('0xa9')]||0xa),'interval':_0x3e68('0xa2')});}if(!_0xd0fe14['interaction'][_0x3e68('0xaa')])return;return db['SmsQueue'][_0x3e68('0x59')]({'attributes':['id',_0x3e68('0x39')],'where':{'id':_0xd0fe14[_0x3e68('0x9e')]['queueId']}});})[_0x3e68('0x1c')](function(_0xd38155){if(_0xd38155){_0xd0fe14['applications'][_0x3e68('0xa8')]({'id':0x0,'priority':0x1,'app':_0x3e68('0xab'),'appdata':_0xd38155[_0x3e68('0x39')]+','+(_0xd0fe14['account'][_0x3e68('0xac')]||0x12c),'interval':_0x3e68('0xa2')});}return respondWithRpcPromise(_0x3e68('0xad'),_0x3e68('0xae'),_0xd0fe14);})[_0x3e68('0x1c')](function(_0x3a7224){if(_0x3a7224){var _0x81778=0xc8;var _0x455c2b=_0x3e68('0xaf');logger['info'](_0x3e68('0x20'),_0x455c2b,_0x81778,_0x3e68('0xb0'));logger[_0x3e68('0xb1')](_0x3e68('0xb2'),_0x455c2b,_0x81778,_0x3e68('0xb0'),JSON['stringify'](_0x3a7224));if(_0xd0fe14['account'][_0x3e68('0x41')]===_0x3e68('0x7d')){return _0x4caf0f['status'](_0x81778)[_0x3e68('0x2f')]('Content-Type',_0x3e68('0xb3'))[_0x3e68('0x3a')](_0x3e68('0xb4'));}else{return _0x4caf0f[_0x3e68('0x28')](_0x81778)[_0x3e68('0x2a')](_0x3a7224);}}})[_0x3e68('0x26')](handleError(_0x4caf0f,null));};exports[_0x3e68('0xb5')]=function(_0x5158f5,_0x76f2b9){var _0xf62c4e=_0x5158f5[_0x3e68('0x56')]['id'];var _0x4761f2=_0x5158f5[_0x3e68('0x62')];var _0x1eb82f=0xc8;var _0x47496f=null;return db[_0x3e68('0xb6')]['transaction']({'isolationLevel':db[_0x3e68('0xb6')][_0x3e68('0xb7')][_0x3e68('0xb8')][_0x3e68('0xb9')]},function(_0x2d37fc){return db['SmsAccount'][_0x3e68('0x66')]({'where':{'id':_0xf62c4e},'transaction':_0x2d37fc})[_0x3e68('0x1c')](function(_0x4c43b9){if(_0x4c43b9){return db[_0x3e68('0x71')]['destroy']({'where':{'SmsAccountId':_0xf62c4e},'transaction':_0x2d37fc})['then'](function(){var _0x17be02=_[_0x3e68('0x3d')](_0x4761f2,function(_0x4c602d){_0x4c602d[_0x3e68('0x65')]=_0xf62c4e;return _0x4c602d;});return db[_0x3e68('0x71')][_0x3e68('0xba')](_0x17be02,{'transaction':_0x2d37fc});});}else{_0x1eb82f=0x194;_0x47496f=[];}});})['then'](function(){if(_0x1eb82f!==0x194){return db[_0x3e68('0x71')][_0x3e68('0xbb')]({'where':{'SmsAccountId':_0xf62c4e},'order':_0x3e68('0x75')})['then'](function(_0x1a007f){_0x47496f=_0x1a007f;});}})[_0x3e68('0x26')](function(_0x553be6){_0x1eb82f=0x1f4;logger[_0x3e68('0x22')](_0x553be6[_0x3e68('0x38')]);if(_0x553be6[_0x3e68('0x39')]){delete _0x553be6[_0x3e68('0x39')];}_0x47496f=_0x553be6;})[_0x3e68('0xbc')](function(){if(_0x47496f===null){_0x76f2b9['sendStatus'](_0x1eb82f);}else{if(_0x1eb82f===0x1f4){_0x76f2b9[_0x3e68('0x28')](_0x1eb82f)[_0x3e68('0x3a')](_0x47496f);}else{_0x76f2b9[_0x3e68('0x28')](_0x1eb82f)[_0x3e68('0x2a')](_0x47496f);}}});};exports[_0x3e68('0xbd')]=function(_0x7ea05,_0x981bea,_0x347213){var _0x2ca4dd={};var _0x5428d1={};var _0x276521;var _0xb324a;return db['SmsAccount'][_0x3e68('0x66')]({'where':{'id':_0x7ea05['params']['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x981bea,null))[_0x3e68('0x1c')](function(_0x835d45){if(_0x835d45){_0x276521=_0x835d45;_0x5428d1[_0x3e68('0x43')]=_['keys'](db[_0x3e68('0x71')][_0x3e68('0x3f')]);_0x5428d1[_0x3e68('0x44')]=_['keys'](_0x7ea05[_0x3e68('0x44')]);_0x5428d1[_0x3e68('0x46')]=_['intersection'](_0x5428d1['model'],_0x5428d1['query']);_0x2ca4dd[_0x3e68('0x48')]=_['intersection'](_0x5428d1[_0x3e68('0x43')],qs[_0x3e68('0x49')](_0x7ea05[_0x3e68('0x44')][_0x3e68('0x49')]));_0x2ca4dd[_0x3e68('0x48')]=_0x2ca4dd[_0x3e68('0x48')][_0x3e68('0x4a')]?_0x2ca4dd[_0x3e68('0x48')]:_0x5428d1[_0x3e68('0x43')];_0x2ca4dd[_0x3e68('0x4d')]=qs[_0x3e68('0x4e')](_0x7ea05[_0x3e68('0x44')][_0x3e68('0x4e')]);_0x2ca4dd[_0x3e68('0x4f')]=qs[_0x3e68('0x46')](_[_0x3e68('0x50')](_0x7ea05[_0x3e68('0x44')],_0x5428d1[_0x3e68('0x46')]));if(_0x7ea05[_0x3e68('0x44')]['filter']){_0x2ca4dd[_0x3e68('0x4f')]=_[_0x3e68('0x52')](_0x2ca4dd[_0x3e68('0x4f')],{'$or':_[_0x3e68('0x3d')](_0x2ca4dd[_0x3e68('0x48')],function(_0x176113){var _0x1d545d={};_0x1d545d[_0x176113]={'$like':'%'+_0x7ea05['query'][_0x3e68('0x51')]+'%'};return _0x1d545d;})});}_0x2ca4dd=_[_0x3e68('0x52')]({},_0x2ca4dd,_0x7ea05['options']);return _0x276521[_0x3e68('0xbd')](_0x2ca4dd);}})[_0x3e68('0x1c')](function(_0x524133){if(_0x524133){_0xb324a=_0x524133['length'];if(!_0x7ea05['query'][_0x3e68('0x4b')](_0x3e68('0x4c'))){_0x2ca4dd[_0x3e68('0x2d')]=qs[_0x3e68('0x2d')](_0x7ea05[_0x3e68('0x44')][_0x3e68('0x2d')]);_0x2ca4dd[_0x3e68('0x2b')]=qs['offset'](_0x7ea05[_0x3e68('0x44')][_0x3e68('0x2b')]);}return _0x276521[_0x3e68('0xbd')](_0x2ca4dd);}})[_0x3e68('0x1c')](function(_0x201832){if(_0x201832){return _0x201832?{'count':_0xb324a,'rows':_0x201832}:null;}})[_0x3e68('0x1c')](respondWithResult(_0x981bea,null))[_0x3e68('0x26')](handleError(_0x981bea,null));};exports['getInteractions']=function(_0x2082bc,_0x56f587,_0x40b4c8){var _0x522928={'raw':![],'where':{}};var _0x400ded={};var _0x52d92d={'count':0x0,'rows':[]};return db[_0x3e68('0x3e')]['findOne']({'where':{'id':_0x2082bc['params']['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x56f587,null))[_0x3e68('0x1c')](function(_0x5cd343){if(_0x5cd343){_0x400ded[_0x3e68('0x43')]=_[_0x3e68('0x45')](db[_0x3e68('0x9d')][_0x3e68('0x3f')]);_0x400ded[_0x3e68('0x44')]=_[_0x3e68('0x45')](_0x2082bc[_0x3e68('0x44')]);_0x400ded['filters']=_[_0x3e68('0x47')](_0x400ded[_0x3e68('0x43')],_0x400ded['query']);_0x522928[_0x3e68('0x48')]=_[_0x3e68('0x47')](_0x400ded[_0x3e68('0x43')],qs[_0x3e68('0x49')](_0x2082bc[_0x3e68('0x44')][_0x3e68('0x49')]));_0x522928['attributes']=_0x522928['attributes']['length']?_0x522928['attributes']:_0x400ded[_0x3e68('0x43')];if(!_0x2082bc['query'][_0x3e68('0x4b')](_0x3e68('0x4c'))){_0x522928[_0x3e68('0x2d')]=qs['limit'](_0x2082bc[_0x3e68('0x44')]['limit']);_0x522928[_0x3e68('0x2b')]=qs[_0x3e68('0x2b')](_0x2082bc[_0x3e68('0x44')][_0x3e68('0x2b')]);}_0x522928[_0x3e68('0x4d')]=qs[_0x3e68('0x4e')](_0x2082bc['query'][_0x3e68('0x4e')]);_0x522928[_0x3e68('0x4f')]=qs[_0x3e68('0x46')](_[_0x3e68('0x50')](_0x2082bc[_0x3e68('0x44')],_0x400ded[_0x3e68('0x46')]));_0x522928[_0x3e68('0x4f')][_0x3e68('0x65')]=_0x5cd343['id'];if(_0x2082bc[_0x3e68('0x44')][_0x3e68('0x51')]){_0x522928[_0x3e68('0x4f')]=_['merge'](_0x522928[_0x3e68('0x4f')],{'$or':_['map'](_0x522928[_0x3e68('0x48')],function(_0x13080d){var _0x458692={};_0x458692[_0x13080d]={'$like':'%'+_0x2082bc[_0x3e68('0x44')][_0x3e68('0x51')]+'%'};return _0x458692;})});}_0x522928=_[_0x3e68('0x52')]({},_0x522928,_0x2082bc[_0x3e68('0x58')]);return db['SmsInteraction'][_0x3e68('0x2e')]({'where':_0x522928[_0x3e68('0x4f')]})[_0x3e68('0x1c')](function(_0x3e4aee){_0x52d92d[_0x3e68('0x2e')]=_0x3e4aee;if(_0x2082bc[_0x3e68('0x44')]['includeAll']){_0x522928[_0x3e68('0x53')]=[{'model':db[_0x3e68('0x76')],'as':'Contact','required':![]},{'model':db[_0x3e68('0xa7')],'as':_0x3e68('0xbe'),'attributes':[_0x3e68('0x39'),'fullname',_0x3e68('0xbf')],'required':![]},{'model':db[_0x3e68('0xc0')],'as':_0x3e68('0xc1'),'attributes':['id',_0x3e68('0x39'),_0x3e68('0xc2')],'where':_0x2082bc[_0x3e68('0x44')][_0x3e68('0xc3')]?{'id':_0x2082bc[_0x3e68('0x44')][_0x3e68('0xc3')]}:undefined,'required':_0x2082bc[_0x3e68('0x44')][_0x3e68('0xc3')]?!![]:![]}];}return db['SmsInteraction'][_0x3e68('0x68')](_0x522928);})[_0x3e68('0x1c')](function(_0x1178e7){_0x52d92d[_0x3e68('0x54')]=_0x1178e7;return _0x52d92d;});}})['then'](respondWithFilteredResult(_0x56f587,_0x522928))[_0x3e68('0x26')](handleError(_0x56f587,null));};exports[_0x3e68('0x3a')]=function(_0x3f6f4f,_0x33f9db,_0x5376ad){var _0x40ffb0,_0x6fec41,_0x79b8;if(_[_0x3e68('0x90')](_0x3f6f4f[_0x3e68('0x62')][_0x3e68('0x62')])||_0x3f6f4f[_0x3e68('0x62')][_0x3e68('0x62')]===''){throw new db['Sequelize'][(_0x3e68('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3f6f4f[_0x3e68('0x62')]['to'])){throw new db['Sequelize'][(_0x3e68('0x92'))](_0x3e68('0xc4'));}_0x40ffb0=_0x3f6f4f['body']['to'];return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x3f6f4f['params']['id']},'include':[{'model':db['CmList'],'as':_0x3e68('0xc5'),'include':[{'model':db[_0x3e68('0x76')],'as':'Contacts','where':{'mobile':_0x40ffb0},'limit':0x1,'order':[[_0x3e68('0x79'),_0x3e68('0xc6')]]}]}]})[_0x3e68('0x1c')](handleEntityNotFound(_0x33f9db,null))[_0x3e68('0x1c')](function(_0x435d35){if(_0x435d35&&_0x435d35[_0x3e68('0xc5')]){_0x6fec41=_0x435d35[_0x3e68('0x5b')]({'plain':!![]});if(_0x6fec41['List']&&_0x6fec41[_0x3e68('0xc5')][_0x3e68('0x99')][_0x3e68('0x4a')]){return _0x6fec41[_0x3e68('0xc5')]['Contacts'][0x0];}return db[_0x3e68('0x76')][_0x3e68('0x5a')](_[_0x3e68('0x16')](_0x3f6f4f['body'],{'firstName':_0x40ffb0,'mobile':_0x40ffb0,'phone':_0x40ffb0,'ListId':_0x6fec41[_0x3e68('0x98')]}));}})['then'](handleEntityNotFound(_0x33f9db,null))[_0x3e68('0x1c')](function(_0xb1747c){if(_0xb1747c){_0x79b8=_0xb1747c;return db[_0x3e68('0x9d')][_0x3e68('0x59')]({'where':{'ContactId':_0x79b8['id'],'closed':![],'SmsAccountId':_0x6fec41['id']}})[_0x3e68('0x1c')](function(_0xccc9bf){if(_0xccc9bf){return[_0xccc9bf,![]];}return db[_0x3e68('0x9d')][_0x3e68('0x5a')]({'UserId':_0x3f6f4f['user']['id'],'ContactId':_0x79b8['id'],'SmsAccountId':_0x6fec41['id'],'phone':_0x40ffb0,'firstMsgDirection':_0x3e68('0xc7'),'Messages':[_[_0x3e68('0x52')](_0x3f6f4f[_0x3e68('0x62')],{'read':![],'body':_0x3f6f4f['body'][_0x3e68('0x62')],'phone':_0x40ffb0,'SmsAccountId':_0x6fec41['id'],'UserId':_0x3f6f4f[_0x3e68('0x5d')]['id'],'ContactId':_0x79b8['id']})]},{'include':[{'model':db[_0x3e68('0xa3')],'as':_0x3e68('0xc8')}]})[_0x3e68('0x1c')](function(_0x11938d){return[_0x11938d,!![]];});});}})['spread'](function(_0x2cb44c,_0x38c89d){if(_0x38c89d){return _0x2cb44c;}return db[_0x3e68('0xa3')][_0x3e68('0x5a')](_[_0x3e68('0x52')](_0x3f6f4f[_0x3e68('0x62')],{'read':![],'body':_0x3f6f4f[_0x3e68('0x62')][_0x3e68('0x62')],'phone':_0x40ffb0,'SmsAccountId':_0x6fec41['id'],'SmsInteractionId':_0x2cb44c['id'],'UserId':_0x3f6f4f['user']['id'],'ContactId':_0x79b8['id']}))[_0x3e68('0x1c')](function(_0x2d3ecd){_0x2cb44c[_0x3e68('0xc9')][_0x3e68('0xc8')]=[];_0x2cb44c[_0x3e68('0xc9')][_0x3e68('0xc8')][_0x3e68('0xa0')](_0x2d3ecd[_0x3e68('0xc9')]);return _0x2cb44c;});})['then'](respondWithResult(_0x33f9db,null))[_0x3e68('0x26')](handleError(_0x33f9db,null));};exports['status']=function(_0x4acbc1,_0x3e5b62,_0xb1bf97){if(_0x4acbc1[_0x3e68('0x62')]['id']){delete _0x4acbc1[_0x3e68('0x62')]['id'];}var _0x17fc5c,_0x2030b9,_0x48bdfc;return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x4acbc1[_0x3e68('0x56')]['id']}})['then'](handleEntityNotFound(_0x3e5b62,null))[_0x3e68('0x1c')](function(_0x29808a){if(_0x29808a){_0x48bdfc=_0x29808a;logger[_0x3e68('0xb1')](_0x3e68('0x20'),_0x3e68('0x28'),_0x3e68('0xca'),_0x29808a[_0x3e68('0x41')],util[_0x3e68('0xcb')](_0x4acbc1[_0x3e68('0x62')],{'showHidden':![],'depth':null}));switch(_0x29808a[_0x3e68('0x41')]){case _0x3e68('0x81'):if(_0x4acbc1[_0x3e68('0x62')]['skebby_dispatch_id']&&_0x4acbc1['body'][_0x3e68('0x28')]){_0x2030b9=_0x4acbc1[_0x3e68('0x62')]['status'];return db[_0x3e68('0xa3')]['find']({'where':{'messageId':_0x4acbc1[_0x3e68('0x62')][_0x3e68('0xcc')]}});}break;case'connectel':if(_0x4acbc1[_0x3e68('0x62')]['requestid']&&_0x4acbc1[_0x3e68('0x62')]['statusInt']){_0x2030b9=_0x4acbc1[_0x3e68('0x62')]['statusInt'];return db[_0x3e68('0xa3')]['find']({'where':{'messageId':_0x4acbc1[_0x3e68('0x62')]['requestid']}});}break;case _0x3e68('0x84'):if(_0x4acbc1[_0x3e68('0x62')][_0x3e68('0x85')]&&_0x4acbc1['body']['status_code']){_0x2030b9=_0x4acbc1[_0x3e68('0x62')][_0x3e68('0xcd')];return db[_0x3e68('0xa3')][_0x3e68('0x59')]({'where':{'messageId':_0x4acbc1[_0x3e68('0x62')][_0x3e68('0x85')]}});}break;case'infobip':var _0x459b44=_0x4acbc1[_0x3e68('0x62')]['results'][0x0];if(_0x459b44[_0x3e68('0x80')]&&_0x459b44['status'][_0x3e68('0xce')]==='DELIVERED'){_0x2030b9=_0x459b44[_0x3e68('0x28')][_0x3e68('0xce')];return db[_0x3e68('0xa3')][_0x3e68('0x59')]({'where':{'messageId':_0x459b44[_0x3e68('0x80')]}});}break;case _0x3e68('0x8d'):if(_0x4acbc1[_0x3e68('0x62')][_0x3e68('0x80')]&&_0x4acbc1[_0x3e68('0x62')][_0x3e68('0x28')]){_0x2030b9=_0x4acbc1['body'][_0x3e68('0x28')];return db[_0x3e68('0xa3')][_0x3e68('0x59')]({'where':{'messageId':_0x4acbc1[_0x3e68('0x62')][_0x3e68('0x80')]}});}break;case _0x3e68('0x8e'):if(_0x4acbc1[_0x3e68('0x62')][0x0][_0x3e68('0x24')]['id']){_0x2030b9=_0x4acbc1['body'][0x0][_0x3e68('0x41')];return db[_0x3e68('0xa3')]['find']({'where':{'messageId':_0x4acbc1[_0x3e68('0x62')][0x0][_0x3e68('0x24')]['id']}});}break;case'intelepeer':if(_0x4acbc1[_0x3e68('0x62')][_0x3e68('0xcf')]&&_0x4acbc1['body']['status']){_0x2030b9=_0x4acbc1[_0x3e68('0x62')][_0x3e68('0x28')];return db[_0x3e68('0xa3')][_0x3e68('0x59')]({'where':{'messageId':_0x4acbc1[_0x3e68('0x62')][_0x3e68('0xcf')]}});}break;}}})[_0x3e68('0x1c')](handleEntityNotFound(_0x3e5b62,null))[_0x3e68('0x1c')](function(_0x339c70){if(_0x339c70){_0x17fc5c=_0x339c70;switch(_0x48bdfc[_0x3e68('0x41')]){case _0x3e68('0x81'):if(_0x2030b9==='DELIVERED'){return _0x17fc5c[_0x3e68('0x34')]({'read':!![]});}else{logger[_0x3e68('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3e68('0x28'),_0x3e68('0x81'),util[_0x3e68('0xcb')](_0x4acbc1[_0x3e68('0x62')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x2030b9==='1'){return _0x17fc5c[_0x3e68('0x34')]({'read':!![]});}else{logger['error'](_0x3e68('0x20'),_0x3e68('0x28'),_0x3e68('0x81'),util[_0x3e68('0xcb')](_0x4acbc1['body'],{'showHidden':![],'depth':null}));}break;case _0x3e68('0x84'):if(!_0x4acbc1[_0x3e68('0x62')][_0x3e68('0xd0')]&&_0x2030b9>=0xc8&&_0x2030b9<=0xce){return _0x17fc5c[_0x3e68('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3e68('0x28'),_0x3e68('0x84'),util[_0x3e68('0xcb')](_0x4acbc1[_0x3e68('0x62')],{'showHidden':![],'depth':null}));}break;case _0x3e68('0xd1'):var _0x12df73=_0x4acbc1[_0x3e68('0x62')]['results'][0x0];if(_0x12df73[_0x3e68('0x28')]['groupName']===_0x3e68('0xd2')){return _0x17fc5c[_0x3e68('0x34')]({'read':!![]});}else{logger[_0x3e68('0x22')](_0x3e68('0x20'),_0x3e68('0x28'),_0x3e68('0xd1'),util[_0x3e68('0xcb')](_0x4acbc1['body'],{'showHidden':![],'depth':null}));}break;case _0x3e68('0x8d'):if(_0x2030b9==_0x3e68('0xd3')||_0x2030b9==_0x3e68('0xd4')){return _0x17fc5c[_0x3e68('0x34')]({'read':!![]});}else{logger['error'](_0x3e68('0x20'),_0x3e68('0x28'),_0x3e68('0x8d'),util[_0x3e68('0xcb')](_0x4acbc1['body'],{'showHidden':![],'depth':null}));}break;case _0x3e68('0x8e'):if(_0x2030b9==_0x3e68('0xd5')){return _0x17fc5c[_0x3e68('0x34')]({'read':!![]});}else{logger[_0x3e68('0x22')](_0x3e68('0x20'),_0x3e68('0x28'),_0x3e68('0x8e'),util[_0x3e68('0xcb')](_0x4acbc1[_0x3e68('0x62')],{'showHidden':![],'depth':null}));}break;case _0x3e68('0xd6'):if(_0x2030b9===_0x3e68('0xd7')||_0x2030b9===_0x3e68('0xd8')){return _0x17fc5c[_0x3e68('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3e68('0x28'),_0x3e68('0xd6'),util[_0x3e68('0xcb')](_0x4acbc1[_0x3e68('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x17fc5c;}})[_0x3e68('0x1c')](respondWithResult(_0x3e5b62,null))[_0x3e68('0x26')](handleError(_0x3e5b62,null));};exports['statusGet']=function(_0x397ef2,_0x21ed78,_0x375e19){var _0x774da9,_0x3da764,_0x1d8f65;return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x397ef2['params']['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x21ed78,null))[_0x3e68('0x1c')](function(_0x357484){if(_0x357484){_0x1d8f65=_0x357484;logger[_0x3e68('0xb1')](_0x3e68('0x20'),_0x3e68('0x28'),'received\x20delivery\x20report\x20from',_0x357484[_0x3e68('0x41')],util[_0x3e68('0xcb')](_0x397ef2[_0x3e68('0x44')],{'showHidden':![],'depth':null}));switch(_0x357484['type']){case _0x3e68('0x8a'):if(_0x397ef2[_0x3e68('0x44')]['message-id']&&_0x397ef2['query'][_0x3e68('0xd9')]){_0x3da764=_0x397ef2[_0x3e68('0x44')]['state'];return db['SmsMessage'][_0x3e68('0x59')]({'where':{'messageId':_0x397ef2[_0x3e68('0x44')][_0x3e68('0xda')]}});}break;}}})[_0x3e68('0x1c')](handleEntityNotFound(_0x21ed78,null))[_0x3e68('0x1c')](function(_0x31208f){if(_0x31208f){_0x774da9=_0x31208f;switch(_0x1d8f65[_0x3e68('0x41')]){case _0x3e68('0x8a'):if(_0x3da764==='2'||_0x3da764==='6'){return _0x774da9[_0x3e68('0x34')]({'read':!![]});}else{logger[_0x3e68('0x22')](_0x3e68('0x20'),_0x3e68('0x28'),_0x3e68('0x8a'),util[_0x3e68('0xcb')](_0x397ef2[_0x3e68('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x774da9;}})[_0x3e68('0x1c')](respondWithResult(_0x21ed78,null))['catch'](handleError(_0x21ed78,null));};exports[_0x3e68('0xdb')]=function(_0x4a8d2a,_0x5b5f72,_0x2b1d24){return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x4a8d2a['params']['id']}})[_0x3e68('0x1c')](handleEntityNotFound(_0x5b5f72,null))[_0x3e68('0x1c')](function(_0x199bd0){if(_0x199bd0){return _0x199bd0[_0x3e68('0xdb')](_0x4a8d2a[_0x3e68('0x62')][_0x3e68('0x6a')],_[_0x3e68('0x9b')](_0x4a8d2a[_0x3e68('0x62')],[_0x3e68('0x6a'),'id'])||{})['spread'](function(_0x3cb6ce){for(var _0x34a2e6=0x0;_0x34a2e6<_0x4a8d2a[_0x3e68('0x62')][_0x3e68('0x6a')][_0x3e68('0x4a')];_0x34a2e6+=0x1){socket[_0x3e68('0xdc')]('userSmsAccount:save',{'UserId':Number(_0x4a8d2a['body']['ids'][_0x34a2e6]),'SmsAccountId':Number(_0x4a8d2a[_0x3e68('0x56')]['id'])});}return _0x3cb6ce;});}})[_0x3e68('0x1c')](respondWithResult(_0x5b5f72,null))[_0x3e68('0x26')](handleError(_0x5b5f72,null));};exports[_0x3e68('0xdd')]=function(_0x285473,_0x4a9eed,_0x3fcbb0){return db[_0x3e68('0x3e')][_0x3e68('0x59')]({'where':{'id':_0x285473[_0x3e68('0x56')]['id']}})['then'](handleEntityNotFound(_0x4a9eed,null))['then'](function(_0x39b215){if(_0x39b215){return _0x39b215[_0x3e68('0xdd')](_0x285473[_0x3e68('0x44')]['ids'])['then'](function(){if(_[_0x3e68('0xde')](_0x285473[_0x3e68('0x44')][_0x3e68('0x6a')])){for(var _0x42498d=0x0;_0x42498d<_0x285473[_0x3e68('0x44')]['ids'][_0x3e68('0x4a')];_0x42498d+=0x1){socket[_0x3e68('0xdc')](_0x3e68('0xdf'),{'UserId':Number(_0x285473[_0x3e68('0x44')]['ids'][_0x42498d]),'SmsAccountId':Number(_0x285473[_0x3e68('0x56')]['id'])});}}else{socket[_0x3e68('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0x285473[_0x3e68('0x44')][_0x3e68('0x6a')]),'SmsAccountId':Number(_0x285473[_0x3e68('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a9eed,null))[_0x3e68('0x26')](handleError(_0x4a9eed,null));};exports[_0x3e68('0xe0')]=function(_0x8fc584,_0x1a7472,_0x3d8024){var _0x134ccf={};var _0x40102c={};var _0x5e9292;var _0x400ea0;return db[_0x3e68('0x3e')]['findOne']({'where':{'id':_0x8fc584['params']['id']}})['then'](handleEntityNotFound(_0x1a7472,null))[_0x3e68('0x1c')](function(_0x57d6fe){if(_0x57d6fe){_0x5e9292=_0x57d6fe;_0x40102c[_0x3e68('0x43')]=_[_0x3e68('0x45')](db[_0x3e68('0xa7')][_0x3e68('0x3f')]);_0x40102c[_0x3e68('0x44')]=_['keys'](_0x8fc584['query']);_0x40102c[_0x3e68('0x46')]=_['intersection'](_0x40102c[_0x3e68('0x43')],_0x40102c[_0x3e68('0x44')]);_0x134ccf[_0x3e68('0x48')]=_['intersection'](_0x40102c[_0x3e68('0x43')],qs[_0x3e68('0x49')](_0x8fc584[_0x3e68('0x44')][_0x3e68('0x49')]));_0x134ccf[_0x3e68('0x48')]=_0x134ccf['attributes'][_0x3e68('0x4a')]?_0x134ccf[_0x3e68('0x48')]:_0x40102c[_0x3e68('0x43')];_0x134ccf[_0x3e68('0x4d')]=qs[_0x3e68('0x4e')](_0x8fc584[_0x3e68('0x44')][_0x3e68('0x4e')]);_0x134ccf[_0x3e68('0x4f')]=qs[_0x3e68('0x46')](_[_0x3e68('0x50')](_0x8fc584[_0x3e68('0x44')],_0x40102c[_0x3e68('0x46')]));if(_0x8fc584[_0x3e68('0x44')][_0x3e68('0x51')]){_0x134ccf['where']=_['merge'](_0x134ccf[_0x3e68('0x4f')],{'$or':_['map'](_0x134ccf[_0x3e68('0x48')],function(_0x335389){var _0x5c7143={};_0x5c7143[_0x335389]={'$like':'%'+_0x8fc584[_0x3e68('0x44')][_0x3e68('0x51')]+'%'};return _0x5c7143;})});}_0x134ccf=_[_0x3e68('0x52')]({},_0x134ccf,_0x8fc584[_0x3e68('0x58')]);return _0x5e9292[_0x3e68('0xe0')](_0x134ccf);}})[_0x3e68('0x1c')](function(_0x3dcff1){if(_0x3dcff1){_0x400ea0=_0x3dcff1['length'];if(!_0x8fc584[_0x3e68('0x44')][_0x3e68('0x4b')](_0x3e68('0x4c'))){_0x134ccf[_0x3e68('0x2d')]=qs[_0x3e68('0x2d')](_0x8fc584[_0x3e68('0x44')][_0x3e68('0x2d')]);_0x134ccf[_0x3e68('0x2b')]=qs[_0x3e68('0x2b')](_0x8fc584[_0x3e68('0x44')][_0x3e68('0x2b')]);}return _0x5e9292[_0x3e68('0xe0')](_0x134ccf);}})[_0x3e68('0x1c')](function(_0x597741){if(_0x597741){return _0x597741?{'count':_0x400ea0,'rows':_0x597741}:null;}})[_0x3e68('0x1c')](respondWithResult(_0x1a7472,null))[_0x3e68('0x26')](handleError(_0x1a7472,null));}; \ No newline at end of file +var _0x5c52=['redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','then','info','request\x20sent','stringify','error','message','SmsAccount,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','describe','addDisposition','findOne','Disposition','sort','removeDispositions','ids','addAnswer','SmsAccountId','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','account','applications','Applications','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','mobile','from','From','Body','messageId','skebby','sender','text','clicksend','message_id','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','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','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','autoclose','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','*,*,*,*','receiveMessage','entity\x20found','debug','twilio','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Owner','fullname','Tag','Tags','tag','rows','List','defaults','ListId','out','Messages','dataValues','push','SmsAccount,\x20%s,\x20%s,\x20%s','connectel','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','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/logger','../../config/utils','../../config/license/util'];(function(_0x4b1531,_0x4bd920){var _0x1c944b=function(_0x1aafb0){while(--_0x1aafb0){_0x4b1531['push'](_0x4b1531['shift']());}};_0x1c944b(++_0x4bd920);}(_0x5c52,0xc7));var _0x25c5=function(_0x1b81d3,_0x345aa3){_0x1b81d3=_0x1b81d3-0x0;var _0x27ee7e=_0x5c52[_0x1b81d3];return _0x27ee7e;};'use strict';var emlformat=require(_0x25c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x25c5('0x1'));var jsonpatch=require(_0x25c5('0x2'));var rp=require(_0x25c5('0x3'));var moment=require(_0x25c5('0x4'));var BPromise=require(_0x25c5('0x5'));var Mustache=require(_0x25c5('0x6'));var util=require(_0x25c5('0x7'));var path=require(_0x25c5('0x8'));var sox=require(_0x25c5('0x9'));var csv=require('to-csv');var ejs=require(_0x25c5('0xa'));var fs=require('fs');var fs_extra=require(_0x25c5('0xb'));var _=require('lodash');var squel=require(_0x25c5('0xc'));var crypto=require(_0x25c5('0xd'));var jsforce=require(_0x25c5('0xe'));var deskjs=require(_0x25c5('0xf'));var toCsv=require(_0x25c5('0x10'));var querystring=require(_0x25c5('0x11'));var Papa=require(_0x25c5('0x12'));var Redis=require(_0x25c5('0x13'));var authService=require(_0x25c5('0x14'));var qs=require(_0x25c5('0x15'));var as=require(_0x25c5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25c5('0x17'))('api');var utils=require(_0x25c5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x25c5('0x19'));var db=require('../../mysqldb')['db'];config[_0x25c5('0x1a')]=_['defaults'](config[_0x25c5('0x1a')],{'host':_0x25c5('0x1b'),'port':0x18eb});var socket=require(_0x25c5('0x1c'))(new Redis(config[_0x25c5('0x1a')]));require(_0x25c5('0x1d'))[_0x25c5('0x1e')](socket);var jayson=require(_0x25c5('0x1f'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2a70b1,_0x1f4ac9,_0x51a0aa,_0x4051f4){return new BPromise(function(_0x31af39,_0x1a7a08){var _0x473f92=_0x4051f4||client;return _0x473f92['request'](_0x2a70b1,_0x51a0aa)[_0x25c5('0x20')](function(_0x305f79){logger[_0x25c5('0x21')]('SmsAccount,\x20%s,\x20%s',_0x1f4ac9,_0x25c5('0x22'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1f4ac9,_0x25c5('0x22'),JSON[_0x25c5('0x23')](_0x305f79));if(_0x305f79[_0x25c5('0x24')]){if(_0x305f79['error']['code']===0x1f4){logger[_0x25c5('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1f4ac9,_0x305f79[_0x25c5('0x24')][_0x25c5('0x25')]);return _0x1a7a08(_0x305f79[_0x25c5('0x24')][_0x25c5('0x25')]);}logger[_0x25c5('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1f4ac9,_0x305f79[_0x25c5('0x24')][_0x25c5('0x25')]);return _0x31af39(_0x305f79[_0x25c5('0x24')][_0x25c5('0x25')]);}else{logger['info'](_0x25c5('0x26'),_0x1f4ac9,_0x25c5('0x22'));_0x31af39(_0x305f79[_0x25c5('0x27')][_0x25c5('0x25')]);}})[_0x25c5('0x28')](function(_0x52358d){logger[_0x25c5('0x24')](_0x25c5('0x26'),_0x1f4ac9,_0x52358d);_0x1a7a08(_0x52358d);});});}function respondWithStatusCode(_0x17c4a3,_0x2b136e){_0x2b136e=_0x2b136e||0xcc;return function(_0x3c00ee){if(_0x3c00ee){return _0x17c4a3['sendStatus'](_0x2b136e);}return _0x17c4a3[_0x25c5('0x29')](_0x2b136e)[_0x25c5('0x2a')]();};}function respondWithResult(_0x2eb301,_0x264312){_0x264312=_0x264312||0xc8;return function(_0x557c00){if(_0x557c00){return _0x2eb301[_0x25c5('0x29')](_0x264312)[_0x25c5('0x2b')](_0x557c00);}};}function respondWithFilteredResult(_0x21aa22,_0x24bf82){return function(_0x21ff10){if(_0x21ff10){var _0x4743d5=typeof _0x24bf82[_0x25c5('0x2c')]===_0x25c5('0x2d')&&typeof _0x24bf82[_0x25c5('0x2e')]===_0x25c5('0x2d');var _0xfdb3f4=_0x21ff10[_0x25c5('0x2f')];var _0x289dc2=_0x4743d5?0x0:_0x24bf82[_0x25c5('0x2c')];var _0x2a9914=_0x4743d5?_0x21ff10[_0x25c5('0x2f')]:_0x24bf82[_0x25c5('0x2c')]+_0x24bf82[_0x25c5('0x2e')];var _0x30e8ea;if(_0x2a9914>=_0xfdb3f4){_0x2a9914=_0xfdb3f4;_0x30e8ea=0xc8;}else{_0x30e8ea=0xce;}_0x21aa22['status'](_0x30e8ea);return _0x21aa22['set'](_0x25c5('0x30'),_0x289dc2+'-'+_0x2a9914+'/'+_0xfdb3f4)[_0x25c5('0x2b')](_0x21ff10);}return null;};}function patchUpdates(_0x257879){return function(_0x598e76){try{jsonpatch[_0x25c5('0x31')](_0x598e76,_0x257879,!![]);}catch(_0x1f80a3){return BPromise[_0x25c5('0x32')](_0x1f80a3);}return _0x598e76[_0x25c5('0x33')]();};}function saveUpdates(_0x24fe7c,_0x516526){return function(_0x380f91){if(_0x380f91){return _0x380f91[_0x25c5('0x34')](_0x24fe7c)[_0x25c5('0x20')](function(_0x9ce908){return _0x9ce908;});}return null;};}function removeEntity(_0x1b8717,_0x539603){return function(_0x1d080a){if(_0x1d080a){return _0x1d080a[_0x25c5('0x35')]()[_0x25c5('0x20')](function(){var _0x495068=_0x1d080a[_0x25c5('0x36')]({'plain':!![]});var _0x5d3e77=_0x25c5('0x37');return db[_0x25c5('0x38')][_0x25c5('0x35')]({'where':{'type':_0x5d3e77,'resourceId':_0x495068['id']}})[_0x25c5('0x20')](function(){return _0x1d080a;});})[_0x25c5('0x20')](function(){_0x1b8717[_0x25c5('0x29')](0xcc)[_0x25c5('0x2a')]();});}};}function handleEntityNotFound(_0x48b495,_0xa642df){return function(_0x332db6){if(!_0x332db6){_0x48b495[_0x25c5('0x39')](0x194);}return _0x332db6;};}function handleError(_0x168d58,_0x532b1d){_0x532b1d=_0x532b1d||0x1f4;return function(_0x4a0bad){logger[_0x25c5('0x24')](_0x4a0bad[_0x25c5('0x3a')]);if(_0x4a0bad[_0x25c5('0x3b')]){delete _0x4a0bad[_0x25c5('0x3b')];}_0x168d58[_0x25c5('0x29')](_0x532b1d)[_0x25c5('0x3c')](_0x4a0bad);};}exports[_0x25c5('0x3d')]=function(_0xffec88,_0x149c5d){var _0x14e2f4={'include':[{'model':db[_0x25c5('0x3e')],'as':_0x25c5('0x3f')}]},_0x495775={},_0x1531e0={'count':0x0,'rows':[]};var _0x234660=_[_0x25c5('0x40')](db[_0x25c5('0x41')][_0x25c5('0x42')],function(_0x4ae5af){return{'name':_0x4ae5af['fieldName'],'type':_0x4ae5af[_0x25c5('0x43')][_0x25c5('0x44')]};});_0x495775['model']=_[_0x25c5('0x40')](_0x234660,'name');_0x495775[_0x25c5('0x45')]=_[_0x25c5('0x46')](_0xffec88['query']);_0x495775[_0x25c5('0x47')]=_['intersection'](_0x495775[_0x25c5('0x48')],_0x495775['query']);_0x14e2f4[_0x25c5('0x49')]=_[_0x25c5('0x4a')](_0x495775[_0x25c5('0x48')],qs[_0x25c5('0x4b')](_0xffec88['query'][_0x25c5('0x4b')]));_0x14e2f4[_0x25c5('0x49')]=_0x14e2f4[_0x25c5('0x49')][_0x25c5('0x4c')]?_0x14e2f4[_0x25c5('0x49')]:_0x495775[_0x25c5('0x48')];if(!_0xffec88[_0x25c5('0x45')][_0x25c5('0x4d')](_0x25c5('0x4e'))){_0x14e2f4[_0x25c5('0x2e')]=qs[_0x25c5('0x2e')](_0xffec88[_0x25c5('0x45')][_0x25c5('0x2e')]);_0x14e2f4[_0x25c5('0x2c')]=qs['offset'](_0xffec88[_0x25c5('0x45')]['offset']);}_0x14e2f4[_0x25c5('0x4f')]=qs['sort'](_0xffec88['query']['sort']);_0x14e2f4[_0x25c5('0x50')]=qs[_0x25c5('0x47')](_[_0x25c5('0x51')](_0xffec88[_0x25c5('0x45')],_0x495775[_0x25c5('0x47')]),_0x234660);if(_0xffec88[_0x25c5('0x45')][_0x25c5('0x52')]){_0x14e2f4['where']=_[_0x25c5('0x53')](_0x14e2f4[_0x25c5('0x50')],{'$or':_['map'](_0x234660,function(_0x1f52c8){if(_0x1f52c8['type']!==_0x25c5('0x54')){var _0x510f2b={};_0x510f2b[_0x1f52c8[_0x25c5('0x3b')]]={'$like':'%'+_0xffec88[_0x25c5('0x45')][_0x25c5('0x52')]+'%'};return _0x510f2b;}})});}_0x14e2f4=_['merge']({},_0x14e2f4,_0xffec88[_0x25c5('0x55')]);var _0xc5a300={'where':_0x14e2f4[_0x25c5('0x50')]};return db[_0x25c5('0x41')][_0x25c5('0x2f')](_0xc5a300)[_0x25c5('0x20')](function(_0x5883d6){_0x1531e0[_0x25c5('0x2f')]=_0x5883d6;if(_0xffec88[_0x25c5('0x45')]['includeAll']){_0x14e2f4[_0x25c5('0x56')]=[{'all':!![]}];}return db[_0x25c5('0x41')][_0x25c5('0x57')](_0x14e2f4);})['then'](function(_0x1d8de4){_0x1531e0['rows']=_0x1d8de4;return _0x1531e0;})['then'](respondWithFilteredResult(_0x149c5d,_0x14e2f4))[_0x25c5('0x28')](handleError(_0x149c5d,null));};exports[_0x25c5('0x58')]=function(_0x1b5a1f,_0x268893){var _0x241b0f={'raw':![],'where':{'id':_0x1b5a1f['params']['id']},'include':[{'model':db[_0x25c5('0x3e')],'as':'mandatoryDispositionPause'}]},_0x5467aa={};_0x5467aa[_0x25c5('0x48')]=_[_0x25c5('0x46')](db[_0x25c5('0x41')]['rawAttributes']);_0x5467aa[_0x25c5('0x45')]=_[_0x25c5('0x46')](_0x1b5a1f[_0x25c5('0x45')]);_0x5467aa[_0x25c5('0x47')]=_['intersection'](_0x5467aa[_0x25c5('0x48')],_0x5467aa[_0x25c5('0x45')]);_0x241b0f[_0x25c5('0x49')]=_[_0x25c5('0x4a')](_0x5467aa[_0x25c5('0x48')],qs[_0x25c5('0x4b')](_0x1b5a1f['query'][_0x25c5('0x4b')]));_0x241b0f[_0x25c5('0x49')]=_0x241b0f[_0x25c5('0x49')][_0x25c5('0x4c')]?_0x241b0f[_0x25c5('0x49')]:_0x5467aa[_0x25c5('0x48')];if(_0x1b5a1f[_0x25c5('0x45')][_0x25c5('0x59')]){_0x241b0f['include']=[{'all':!![]}];}_0x241b0f=_[_0x25c5('0x53')]({},_0x241b0f,_0x1b5a1f[_0x25c5('0x55')]);return db[_0x25c5('0x41')][_0x25c5('0x5a')](_0x241b0f)[_0x25c5('0x20')](handleEntityNotFound(_0x268893,null))[_0x25c5('0x20')](respondWithResult(_0x268893,null))[_0x25c5('0x28')](handleError(_0x268893,null));};exports[_0x25c5('0x5b')]=function(_0x3cecb0,_0x484404){return db[_0x25c5('0x41')][_0x25c5('0x5b')](_0x3cecb0[_0x25c5('0x5c')],{})['then'](function(_0x17696f){var _0x121399=_0x3cecb0[_0x25c5('0x5d')][_0x25c5('0x36')]({'plain':!![]});if(!_0x121399)throw new Error(_0x25c5('0x5e'));if(_0x121399['role']==='user'){var _0x1b3a76=_0x17696f[_0x25c5('0x36')]({'plain':!![]});var _0x5ca9c4=_0x25c5('0x37');return db[_0x25c5('0x5f')][_0x25c5('0x5a')]({'where':{'name':_0x5ca9c4,'userProfileId':_0x121399[_0x25c5('0x60')]},'raw':!![]})[_0x25c5('0x20')](function(_0x489ab5){if(_0x489ab5&&_0x489ab5[_0x25c5('0x61')]===0x0){return db[_0x25c5('0x38')]['create']({'name':_0x1b3a76[_0x25c5('0x3b')],'resourceId':_0x1b3a76['id'],'type':_0x489ab5['name'],'sectionId':_0x489ab5['id']},{})[_0x25c5('0x20')](function(){return _0x17696f;});}else{return _0x17696f;}})[_0x25c5('0x28')](function(_0x498488){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x498488);throw _0x498488;});}return _0x17696f;})[_0x25c5('0x20')](respondWithResult(_0x484404,0xc9))['catch'](handleError(_0x484404,null));};exports[_0x25c5('0x34')]=function(_0xee3453,_0x13522c){if(_0xee3453[_0x25c5('0x5c')]['id']){delete _0xee3453['body']['id'];}return db[_0x25c5('0x41')][_0x25c5('0x5a')]({'where':{'id':_0xee3453[_0x25c5('0x62')]['id']},'include':[{'model':db[_0x25c5('0x3e')],'as':_0x25c5('0x3f')}]})[_0x25c5('0x20')](handleEntityNotFound(_0x13522c,null))[_0x25c5('0x20')](saveUpdates(_0xee3453[_0x25c5('0x5c')],null))[_0x25c5('0x20')](respondWithResult(_0x13522c,null))['catch'](handleError(_0x13522c,null));};exports[_0x25c5('0x35')]=function(_0x99dbf7,_0x3e37c2){return db[_0x25c5('0x41')]['find']({'where':{'id':_0x99dbf7[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x3e37c2,null))[_0x25c5('0x20')](removeEntity(_0x3e37c2,null))['catch'](handleError(_0x3e37c2,null));};exports[_0x25c5('0x63')]=function(_0x3293be,_0x3e7fcc){return db[_0x25c5('0x41')][_0x25c5('0x63')]()[_0x25c5('0x20')](respondWithResult(_0x3e7fcc,null))[_0x25c5('0x28')](handleError(_0x3e7fcc,null));};exports[_0x25c5('0x64')]=function(_0x327e48,_0xe4f49a,_0x4f0fc0){if(_0x327e48[_0x25c5('0x5c')]['id']){delete _0x327e48['body']['id'];}return db[_0x25c5('0x41')][_0x25c5('0x5a')]({'where':{'id':_0x327e48[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0xe4f49a,null))[_0x25c5('0x20')](function(_0x5b6507){if(_0x5b6507){_0x327e48[_0x25c5('0x5c')]['SmsAccountId']=_0x5b6507['id'];return db['Disposition'][_0x25c5('0x5b')](_0x327e48[_0x25c5('0x5c')]);}})['then'](respondWithResult(_0xe4f49a,null))['catch'](handleError(_0xe4f49a,null));};exports['getDispositions']=function(_0x47df74,_0x5a9bd6,_0x5c7b6e){var _0xa58551={'raw':![],'where':{}};var _0x524aba={};var _0x2bf8e8={'count':0x0,'rows':[]};return db[_0x25c5('0x41')][_0x25c5('0x65')]({'where':{'id':_0x47df74[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x5a9bd6,null))[_0x25c5('0x20')](function(_0x560272){if(_0x560272){_0x524aba[_0x25c5('0x48')]=_['keys'](db[_0x25c5('0x66')][_0x25c5('0x42')]);_0x524aba['query']=_['keys'](_0x47df74[_0x25c5('0x45')]);_0x524aba[_0x25c5('0x47')]=_[_0x25c5('0x4a')](_0x524aba['model'],_0x524aba['query']);_0xa58551[_0x25c5('0x49')]=_['intersection'](_0x524aba['model'],qs[_0x25c5('0x4b')](_0x47df74['query'][_0x25c5('0x4b')]));_0xa58551[_0x25c5('0x49')]=_0xa58551[_0x25c5('0x49')][_0x25c5('0x4c')]?_0xa58551[_0x25c5('0x49')]:_0x524aba[_0x25c5('0x48')];if(!_0x47df74[_0x25c5('0x45')][_0x25c5('0x4d')](_0x25c5('0x4e'))){_0xa58551[_0x25c5('0x2e')]=qs[_0x25c5('0x2e')](_0x47df74[_0x25c5('0x45')][_0x25c5('0x2e')]);_0xa58551[_0x25c5('0x2c')]=qs[_0x25c5('0x2c')](_0x47df74[_0x25c5('0x45')]['offset']);}_0xa58551[_0x25c5('0x4f')]=qs['sort'](_0x47df74['query'][_0x25c5('0x67')]);_0xa58551['where']=qs[_0x25c5('0x47')](_['pick'](_0x47df74[_0x25c5('0x45')],_0x524aba[_0x25c5('0x47')]));_0xa58551[_0x25c5('0x50')]['SmsAccountId']=_0x560272['id'];if(_0x47df74['query'][_0x25c5('0x52')]){_0xa58551[_0x25c5('0x50')]=_[_0x25c5('0x53')](_0xa58551[_0x25c5('0x50')],{'$or':_['map'](_0xa58551['attributes'],function(_0x4b0a15){var _0x23fa2d={};_0x23fa2d[_0x4b0a15]={'$like':'%'+_0x47df74['query']['filter']+'%'};return _0x23fa2d;})});}_0xa58551=_[_0x25c5('0x53')]({},_0xa58551,_0x47df74[_0x25c5('0x55')]);return db['Disposition'][_0x25c5('0x2f')]({'where':_0xa58551[_0x25c5('0x50')]})[_0x25c5('0x20')](function(_0x17af87){_0x2bf8e8[_0x25c5('0x2f')]=_0x17af87;if(_0x47df74[_0x25c5('0x45')][_0x25c5('0x59')]){_0xa58551[_0x25c5('0x56')]=[{'all':!![]}];}return db[_0x25c5('0x66')]['findAll'](_0xa58551);})[_0x25c5('0x20')](function(_0x24b1b3){_0x2bf8e8['rows']=_0x24b1b3;return _0x2bf8e8;});}})[_0x25c5('0x20')](respondWithFilteredResult(_0x5a9bd6,_0xa58551))[_0x25c5('0x28')](handleError(_0x5a9bd6,null));};exports[_0x25c5('0x68')]=function(_0xa5bdb1,_0x624351,_0x34e1d9){return db['SmsAccount'][_0x25c5('0x5a')]({'where':{'id':_0xa5bdb1[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x624351,null))['then'](function(_0x2c7d0a){if(_0x2c7d0a){return _0x2c7d0a[_0x25c5('0x68')](_0xa5bdb1[_0x25c5('0x45')][_0x25c5('0x69')]);}})[_0x25c5('0x20')](respondWithStatusCode(_0x624351,null))['catch'](handleError(_0x624351,null));};exports[_0x25c5('0x6a')]=function(_0x4f701d,_0x2ee942,_0x514a62){if(_0x4f701d[_0x25c5('0x5c')]['id']){delete _0x4f701d[_0x25c5('0x5c')]['id'];}return db[_0x25c5('0x41')]['find']({'where':{'id':_0x4f701d[_0x25c5('0x62')]['id']}})['then'](handleEntityNotFound(_0x2ee942,null))['then'](function(_0x3f2604){if(_0x3f2604){_0x4f701d['body'][_0x25c5('0x6b')]=_0x3f2604['id'];return db['CannedAnswer'][_0x25c5('0x5b')](_0x4f701d[_0x25c5('0x5c')]);}})[_0x25c5('0x20')](respondWithResult(_0x2ee942,null))[_0x25c5('0x28')](handleError(_0x2ee942,null));};exports[_0x25c5('0x6c')]=function(_0x188a98,_0x4f115b,_0x5b2332){var _0x37884d={'raw':![],'where':{}};var _0x1ce718={};var _0x18bcb2={'count':0x0,'rows':[]};return db[_0x25c5('0x41')][_0x25c5('0x65')]({'where':{'id':_0x188a98[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x4f115b,null))[_0x25c5('0x20')](function(_0x23802a){if(_0x23802a){_0x1ce718[_0x25c5('0x48')]=_['keys'](db[_0x25c5('0x6d')][_0x25c5('0x42')]);_0x1ce718[_0x25c5('0x45')]=_['keys'](_0x188a98['query']);_0x1ce718[_0x25c5('0x47')]=_['intersection'](_0x1ce718[_0x25c5('0x48')],_0x1ce718[_0x25c5('0x45')]);_0x37884d[_0x25c5('0x49')]=_[_0x25c5('0x4a')](_0x1ce718[_0x25c5('0x48')],qs[_0x25c5('0x4b')](_0x188a98[_0x25c5('0x45')]['fields']));_0x37884d[_0x25c5('0x49')]=_0x37884d[_0x25c5('0x49')][_0x25c5('0x4c')]?_0x37884d['attributes']:_0x1ce718[_0x25c5('0x48')];if(!_0x188a98['query'][_0x25c5('0x4d')]('nolimit')){_0x37884d['limit']=qs['limit'](_0x188a98[_0x25c5('0x45')][_0x25c5('0x2e')]);_0x37884d[_0x25c5('0x2c')]=qs[_0x25c5('0x2c')](_0x188a98[_0x25c5('0x45')][_0x25c5('0x2c')]);}_0x37884d[_0x25c5('0x4f')]=qs['sort'](_0x188a98[_0x25c5('0x45')][_0x25c5('0x67')]);_0x37884d[_0x25c5('0x50')]=qs[_0x25c5('0x47')](_['pick'](_0x188a98[_0x25c5('0x45')],_0x1ce718[_0x25c5('0x47')]));_0x37884d['where'][_0x25c5('0x6b')]=_0x23802a['id'];if(_0x188a98[_0x25c5('0x45')][_0x25c5('0x52')]){_0x37884d[_0x25c5('0x50')]=_[_0x25c5('0x53')](_0x37884d['where'],{'$or':_[_0x25c5('0x40')](_0x37884d[_0x25c5('0x49')],function(_0x327e31){var _0x1eaa6e={};_0x1eaa6e[_0x327e31]={'$like':'%'+_0x188a98[_0x25c5('0x45')][_0x25c5('0x52')]+'%'};return _0x1eaa6e;})});}_0x37884d=_[_0x25c5('0x53')]({},_0x37884d,_0x188a98[_0x25c5('0x55')]);return db[_0x25c5('0x6d')][_0x25c5('0x2f')]({'where':_0x37884d[_0x25c5('0x50')]})[_0x25c5('0x20')](function(_0x4362fd){_0x18bcb2['count']=_0x4362fd;if(_0x188a98['query'][_0x25c5('0x59')]){_0x37884d[_0x25c5('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x37884d);})[_0x25c5('0x20')](function(_0x550371){_0x18bcb2['rows']=_0x550371;return _0x18bcb2;});}})['then'](respondWithFilteredResult(_0x4f115b,_0x37884d))[_0x25c5('0x28')](handleError(_0x4f115b,null));};exports['removeAnswers']=function(_0x4e263d,_0x10221e,_0x521485){return db['SmsAccount'][_0x25c5('0x5a')]({'where':{'id':_0x4e263d[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x10221e,null))[_0x25c5('0x20')](function(_0x227b87){if(_0x227b87){return _0x227b87[_0x25c5('0x6e')](_0x4e263d[_0x25c5('0x45')][_0x25c5('0x69')]);}})[_0x25c5('0x20')](respondWithStatusCode(_0x10221e,null))[_0x25c5('0x28')](handleError(_0x10221e,null));};exports[_0x25c5('0x6f')]=function(_0x18366a,_0x293b16,_0x30b5ce){var _0x5d1cb1={'channel':_0x25c5('0x70')};var _0x48f01c=[];var _0x6d8d03=[];var _0xe996ab={};return db[_0x25c5('0x41')]['find']({'where':{'id':_0x18366a['params']['id']},'include':[{'model':db[_0x25c5('0x71')],'as':'Applications'}]})[_0x25c5('0x20')](handleEntityNotFound(_0x293b16,null))[_0x25c5('0x20')](function(_0x89468c){_0x5d1cb1[_0x25c5('0x72')]=_0x89468c;_0x5d1cb1[_0x25c5('0x73')]=_['orderBy'](_0x89468c[_0x25c5('0x74')],[_0x25c5('0x75')],[_0x25c5('0x76')]);if(_0x5d1cb1[_0x25c5('0x72')][_0x25c5('0x74')]){delete _0x5d1cb1['account'][_0x25c5('0x74')];}return db[_0x25c5('0x77')][_0x25c5('0x63')]();})[_0x25c5('0x20')](function(_0x571160){if(!_0x571160){throw new db[(_0x25c5('0x78'))][(_0x25c5('0x79'))]('no\x20available\x20attributes');}_0x48f01c=_[_0x25c5('0x7a')](_[_0x25c5('0x46')](_0x571160),[_0x25c5('0x7b'),_0x25c5('0x7c')]);_0x6d8d03=_[_0x25c5('0x7a')](_[_0x25c5('0x46')](_0x571160),[_0x25c5('0x7b'),_0x25c5('0x7c'),_0x25c5('0x7d'),'ListId']);_0x5d1cb1[_0x25c5('0x5c')]={'mapKey':_0x25c5('0x7e')};if(_0x5d1cb1[_0x25c5('0x72')]['type']){switch(_0x5d1cb1[_0x25c5('0x72')][_0x25c5('0x43')]){case'twilio':_0x5d1cb1['body'][_0x25c5('0x7f')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x80')];_0x5d1cb1[_0x25c5('0x5c')]['body']=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x81')];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x82')]=_0x18366a[_0x25c5('0x5c')]['MessageSid'];break;case _0x25c5('0x83'):_0x5d1cb1['body']['from']='+'+_0x18366a[_0x25c5('0x5c')][_0x25c5('0x84')];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x5c')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x85')];break;case'connectel':_0x5d1cb1[_0x25c5('0x5c')]['from']=_0x18366a['body'][_0x25c5('0x7f')];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x5c')]=_0x18366a['body'][_0x25c5('0x25')];break;case _0x25c5('0x86'):_0x5d1cb1[_0x25c5('0x5c')]['from']=_0x18366a[_0x25c5('0x5c')]['from'];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x5c')]=_0x18366a['body'][_0x25c5('0x5c')];_0x5d1cb1['body'][_0x25c5('0x82')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x87')];break;case'plivo':_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x80')];_0x5d1cb1['body'][_0x25c5('0x5c')]=_0x18366a['body']['Text'];_0x5d1cb1[_0x25c5('0x5c')]['messageId']=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x88')];break;case _0x25c5('0x89'):_0x5d1cb1['body']['from']='+'+_0x18366a[_0x25c5('0x5c')][_0x25c5('0x8a')][0x0][_0x25c5('0x7f')];_0x5d1cb1[_0x25c5('0x5c')]['body']=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x8a')][0x0][_0x25c5('0x85')];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x82')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x8a')][0x0][_0x25c5('0x82')];break;case _0x25c5('0x8b'):_0x5d1cb1['body'][_0x25c5('0x7f')]=_0x18366a['body'][_0x25c5('0x8c')];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x5c')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x8d')][_0x25c5('0x25')];break;case'clickatell':_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x8e')];_0x5d1cb1['body']['body']=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x85')];_0x5d1cb1['body'][_0x25c5('0x82')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x8f')];break;case _0x25c5('0x90'):_0x5d1cb1['body']['messageId']=_0x18366a[_0x25c5('0x5c')][0x0][_0x25c5('0x25')]['id'];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')]=_0x18366a[_0x25c5('0x5c')][0x0][_0x25c5('0x25')][_0x25c5('0x7f')];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x5c')]=_0x18366a[_0x25c5('0x5c')][0x0]['message'][_0x25c5('0x85')];break;case _0x25c5('0x91'):_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')]=_0x18366a[_0x25c5('0x5c')]['from'];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x5c')]=_0x18366a[_0x25c5('0x5c')]['message'];_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x82')]=_0x18366a[_0x25c5('0x5c')][_0x25c5('0x92')];break;}}if(_0x5d1cb1[_0x25c5('0x5c')]['id']){delete _0x5d1cb1[_0x25c5('0x5c')]['id'];}if(_[_0x25c5('0x93')](_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')])){throw new db['Sequelize'][(_0x25c5('0x79'))]('from\x20is\x20mandatory');}if(_[_0x25c5('0x93')](_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x5c')])||_0x5d1cb1['body'][_0x25c5('0x5c')]===''){throw new db[(_0x25c5('0x78'))][(_0x25c5('0x79'))](_0x25c5('0x94'));}if(_[_0x25c5('0x93')](_0x5d1cb1['body'][_0x25c5('0x95')])){throw new db[(_0x25c5('0x78'))]['ValidationError'](_0x25c5('0x96')+_0x6d8d03);}if(!_['includes'](_0x6d8d03,_0x5d1cb1[_0x25c5('0x5c')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x25c5('0x97')+_0x6d8d03);}_0xe996ab[_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x95')]]=_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')];return db[_0x25c5('0x98')][_0x25c5('0x5a')]({'where':{'id':_0x5d1cb1[_0x25c5('0x72')]['ListId']},'include':[{'model':db[_0x25c5('0x77')],'as':'Contacts','where':_0xe996ab,'limit':0x1,'order':[[_0x25c5('0x7c'),_0x25c5('0x99')]]}]});})[_0x25c5('0x20')](handleEntityNotFound(_0x293b16,null))[_0x25c5('0x20')](function(_0x2d4809){if(_0x2d4809){_0x5d1cb1[_0x25c5('0x9a')]=_[_0x25c5('0x9b')](_0x2d4809,[_0x25c5('0x9c')]);if(_0x2d4809[_0x25c5('0x9c')][_0x25c5('0x4c')]){return _0x2d4809[_0x25c5('0x9c')][0x0];}var _0x2b5061=_['defaults'](_0x5d1cb1[_0x25c5('0x5c')],{'firstName':_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')],'ListId':_0x2d4809['id']});_0x2b5061[_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x95')]]=_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')];return db[_0x25c5('0x77')][_0x25c5('0x5b')](_0x2b5061,{'fields':_0x48f01c,'raw':!![]});}})['then'](handleEntityNotFound(_0x293b16,null))['then'](function(_0x7123f8){if(_0x7123f8){_0x5d1cb1[_0x25c5('0x9d')]=_0x7123f8;var _0x4c4234={'ContactId':_0x7123f8['id'],'phone':_0x5d1cb1[_0x25c5('0x5c')]['from'],'SmsAccountId':_0x18366a[_0x25c5('0x62')]['id']};var _0x26862c={'ContactId':_0x7123f8['id'],'SmsAccountId':_0x18366a[_0x25c5('0x62')]['id'],'closed':![]};return db['SmsInteraction'][_0x25c5('0x5a')]({'where':_0x26862c})[_0x25c5('0x20')](function(_0x35042b){if(_0x35042b){return[_0x35042b,![]];}return db[_0x25c5('0x9e')]['create'](_0x4c4234)[_0x25c5('0x20')](function(_0x2a7599){return[_0x2a7599,!![]];});});}})[_0x25c5('0x9f')](function(_0x20ae3c,_0x26c22f){_0x5d1cb1[_0x25c5('0xa0')]=_0x20ae3c[_0x25c5('0x36')]({'plain':!![]});_0x5d1cb1[_0x25c5('0xa0')]['created']=![];if(_0x26c22f){if(_0x5d1cb1[_0x25c5('0x72')][_0x25c5('0xa1')]){_0x5d1cb1[_0x25c5('0x73')]['push']({'id':0x0,'priority':_0x5d1cb1[_0x25c5('0x73')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x5d1cb1[_0x25c5('0xa0')]['created']=!![];}return db[_0x25c5('0xa2')]['create']({'phone':_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0x7f')],'messageId':_0x5d1cb1['body'][_0x25c5('0x82')],'body':_0x5d1cb1['body']['body'],'SmsAccountId':_0x18366a[_0x25c5('0x62')]['id'],'SmsInteractionId':_0x20ae3c['id'],'direction':'in','ContactId':_0x20ae3c[_0x25c5('0xa3')],'AttachmentId':_0x5d1cb1[_0x25c5('0x5c')][_0x25c5('0xa4')]});})[_0x25c5('0x20')](function(_0x4f1a1b){_0x5d1cb1['message']=_0x4f1a1b;if(!_0x5d1cb1['interaction']['UserId'])return;return db[_0x25c5('0xa5')][_0x25c5('0x5a')]({'attributes':['id',_0x25c5('0x3b')],'where':{'id':_0x5d1cb1['interaction'][_0x25c5('0xa6')]}});})[_0x25c5('0x20')](function(_0x44bfc1){if(_0x44bfc1){_0x5d1cb1[_0x25c5('0x73')][_0x25c5('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x44bfc1['name']+','+(_0x5d1cb1[_0x25c5('0x72')][_0x25c5('0xa8')]||0xa),'interval':'*,*,*,*'});}if(!_0x5d1cb1[_0x25c5('0xa0')][_0x25c5('0xa9')])return;return db['SmsQueue'][_0x25c5('0x5a')]({'attributes':['id',_0x25c5('0x3b')],'where':{'id':_0x5d1cb1[_0x25c5('0xa0')][_0x25c5('0xa9')]}});})[_0x25c5('0x20')](function(_0x3caccd){if(_0x3caccd){_0x5d1cb1[_0x25c5('0x73')]['unshift']({'id':0x0,'priority':0x1,'app':_0x25c5('0xaa'),'appdata':_0x3caccd[_0x25c5('0x3b')]+','+(_0x5d1cb1[_0x25c5('0x72')][_0x25c5('0xab')]||0x12c),'interval':_0x25c5('0xac')});}return respondWithRpcPromise('Start','startRouting',_0x5d1cb1);})[_0x25c5('0x20')](function(_0x489ae5){if(_0x489ae5){var _0x14a536=0xc8;var _0x4db95e=_0x25c5('0xad');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4db95e,_0x14a536,_0x25c5('0xae'));logger[_0x25c5('0xaf')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4db95e,_0x14a536,_0x25c5('0xae'),JSON[_0x25c5('0x23')](_0x489ae5));if(_0x5d1cb1[_0x25c5('0x72')][_0x25c5('0x43')]===_0x25c5('0xb0')){return _0x293b16[_0x25c5('0x29')](_0x14a536)['set'](_0x25c5('0xb1'),_0x25c5('0xb2'))[_0x25c5('0x3c')]('\x0a');}else{return _0x293b16[_0x25c5('0x29')](_0x14a536)[_0x25c5('0x2b')](_0x489ae5);}}})[_0x25c5('0x28')](handleError(_0x293b16,null));};exports[_0x25c5('0xb3')]=function(_0x385255,_0x2cb226){var _0x28de90=_0x385255[_0x25c5('0x62')]['id'];var _0x13cdea=_0x385255[_0x25c5('0x5c')];var _0x5a9f10=0xc8;var _0x1709d1=null;return db[_0x25c5('0xb4')][_0x25c5('0xb5')]({'isolationLevel':db[_0x25c5('0xb4')][_0x25c5('0xb6')][_0x25c5('0xb7')][_0x25c5('0xb8')]},function(_0x206ef){return db[_0x25c5('0x41')][_0x25c5('0x65')]({'where':{'id':_0x28de90},'transaction':_0x206ef})[_0x25c5('0x20')](function(_0x1ffb90){if(_0x1ffb90){return db[_0x25c5('0x71')][_0x25c5('0x35')]({'where':{'SmsAccountId':_0x28de90},'transaction':_0x206ef})['then'](function(){var _0x2226c3=_[_0x25c5('0x40')](_0x13cdea,function(_0x8aa95){_0x8aa95['SmsAccountId']=_0x28de90;return _0x8aa95;});return db[_0x25c5('0x71')][_0x25c5('0xb9')](_0x2226c3,{'transaction':_0x206ef});});}else{_0x5a9f10=0x194;_0x1709d1=[];}});})[_0x25c5('0x20')](function(){if(_0x5a9f10!==0x194){return db[_0x25c5('0x71')][_0x25c5('0xba')]({'where':{'SmsAccountId':_0x28de90},'order':_0x25c5('0x75')})[_0x25c5('0x20')](function(_0x13b507){_0x1709d1=_0x13b507;});}})[_0x25c5('0x28')](function(_0x6fbad4){_0x5a9f10=0x1f4;logger['error'](_0x6fbad4['stack']);if(_0x6fbad4[_0x25c5('0x3b')]){delete _0x6fbad4[_0x25c5('0x3b')];}_0x1709d1=_0x6fbad4;})[_0x25c5('0xbb')](function(){if(_0x1709d1===null){_0x2cb226[_0x25c5('0x39')](_0x5a9f10);}else{if(_0x5a9f10===0x1f4){_0x2cb226[_0x25c5('0x29')](_0x5a9f10)[_0x25c5('0x3c')](_0x1709d1);}else{_0x2cb226['status'](_0x5a9f10)[_0x25c5('0x2b')](_0x1709d1);}}});};exports[_0x25c5('0xbc')]=function(_0x39105d,_0xb13686,_0x27fa02){var _0x584da1={};var _0x56780b={};var _0x41f3ae;var _0x3d75df;return db['SmsAccount'][_0x25c5('0x65')]({'where':{'id':_0x39105d['params']['id']}})['then'](handleEntityNotFound(_0xb13686,null))['then'](function(_0x261df6){if(_0x261df6){_0x41f3ae=_0x261df6;_0x56780b[_0x25c5('0x48')]=_['keys'](db[_0x25c5('0x71')][_0x25c5('0x42')]);_0x56780b[_0x25c5('0x45')]=_['keys'](_0x39105d[_0x25c5('0x45')]);_0x56780b['filters']=_[_0x25c5('0x4a')](_0x56780b['model'],_0x56780b[_0x25c5('0x45')]);_0x584da1['attributes']=_['intersection'](_0x56780b[_0x25c5('0x48')],qs[_0x25c5('0x4b')](_0x39105d[_0x25c5('0x45')][_0x25c5('0x4b')]));_0x584da1['attributes']=_0x584da1[_0x25c5('0x49')][_0x25c5('0x4c')]?_0x584da1[_0x25c5('0x49')]:_0x56780b['model'];_0x584da1[_0x25c5('0x4f')]=qs[_0x25c5('0x67')](_0x39105d[_0x25c5('0x45')][_0x25c5('0x67')]);_0x584da1['where']=qs[_0x25c5('0x47')](_[_0x25c5('0x51')](_0x39105d['query'],_0x56780b[_0x25c5('0x47')]));if(_0x39105d['query'][_0x25c5('0x52')]){_0x584da1[_0x25c5('0x50')]=_['merge'](_0x584da1[_0x25c5('0x50')],{'$or':_[_0x25c5('0x40')](_0x584da1['attributes'],function(_0x41eeb6){var _0x4cd5d9={};_0x4cd5d9[_0x41eeb6]={'$like':'%'+_0x39105d[_0x25c5('0x45')]['filter']+'%'};return _0x4cd5d9;})});}_0x584da1=_['merge']({},_0x584da1,_0x39105d['options']);return _0x41f3ae['getApplications'](_0x584da1);}})['then'](function(_0x291690){if(_0x291690){_0x3d75df=_0x291690[_0x25c5('0x4c')];if(!_0x39105d['query']['hasOwnProperty'](_0x25c5('0x4e'))){_0x584da1[_0x25c5('0x2e')]=qs[_0x25c5('0x2e')](_0x39105d['query']['limit']);_0x584da1[_0x25c5('0x2c')]=qs['offset'](_0x39105d[_0x25c5('0x45')][_0x25c5('0x2c')]);}return _0x41f3ae[_0x25c5('0xbc')](_0x584da1);}})['then'](function(_0x1c1fda){if(_0x1c1fda){return _0x1c1fda?{'count':_0x3d75df,'rows':_0x1c1fda}:null;}})[_0x25c5('0x20')](respondWithResult(_0xb13686,null))[_0x25c5('0x28')](handleError(_0xb13686,null));};exports['getInteractions']=function(_0x2b71c7,_0x4baa44,_0x4df793){var _0xcbcda7={'raw':![],'where':{}};var _0x449c4f={};var _0x740e8b={'count':0x0,'rows':[]};return db[_0x25c5('0x41')]['findOne']({'where':{'id':_0x2b71c7['params']['id']}})['then'](handleEntityNotFound(_0x4baa44,null))['then'](function(_0x579fe5){if(_0x579fe5){_0x449c4f[_0x25c5('0x48')]=_[_0x25c5('0x46')](db[_0x25c5('0x9e')][_0x25c5('0x42')]);_0x449c4f[_0x25c5('0x45')]=_[_0x25c5('0x46')](_0x2b71c7[_0x25c5('0x45')]);_0x449c4f[_0x25c5('0x47')]=_[_0x25c5('0x4a')](_0x449c4f[_0x25c5('0x48')],_0x449c4f[_0x25c5('0x45')]);_0xcbcda7[_0x25c5('0x49')]=_['intersection'](_0x449c4f['model'],qs[_0x25c5('0x4b')](_0x2b71c7[_0x25c5('0x45')][_0x25c5('0x4b')]));_0xcbcda7[_0x25c5('0x49')]=_0xcbcda7['attributes'][_0x25c5('0x4c')]?_0xcbcda7['attributes']:_0x449c4f[_0x25c5('0x48')];if(!_0x2b71c7[_0x25c5('0x45')][_0x25c5('0x4d')](_0x25c5('0x4e'))){_0xcbcda7[_0x25c5('0x2e')]=qs['limit'](_0x2b71c7['query'][_0x25c5('0x2e')]);_0xcbcda7['offset']=qs[_0x25c5('0x2c')](_0x2b71c7[_0x25c5('0x45')][_0x25c5('0x2c')]);}_0xcbcda7[_0x25c5('0x4f')]=qs[_0x25c5('0x67')](_0x2b71c7[_0x25c5('0x45')][_0x25c5('0x67')]);_0xcbcda7[_0x25c5('0x50')]=qs[_0x25c5('0x47')](_[_0x25c5('0x51')](_0x2b71c7[_0x25c5('0x45')],_0x449c4f[_0x25c5('0x47')]));_0xcbcda7[_0x25c5('0x50')][_0x25c5('0x6b')]=_0x579fe5['id'];if(_0x2b71c7['query'][_0x25c5('0x52')]){_0xcbcda7[_0x25c5('0x50')]=_[_0x25c5('0x53')](_0xcbcda7[_0x25c5('0x50')],{'$or':_[_0x25c5('0x40')](_0xcbcda7['attributes'],function(_0x15acf8){var _0x1ea805={};_0x1ea805[_0x15acf8]={'$like':'%'+_0x2b71c7[_0x25c5('0x45')][_0x25c5('0x52')]+'%'};return _0x1ea805;})});}_0xcbcda7=_[_0x25c5('0x53')]({},_0xcbcda7,_0x2b71c7[_0x25c5('0x55')]);return db['SmsInteraction'][_0x25c5('0x2f')]({'where':_0xcbcda7[_0x25c5('0x50')]})['then'](function(_0x1316e1){_0x740e8b['count']=_0x1316e1;if(_0x2b71c7[_0x25c5('0x45')]['includeAll']){_0xcbcda7[_0x25c5('0x56')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x25c5('0xa5')],'as':_0x25c5('0xbd'),'attributes':[_0x25c5('0x3b'),_0x25c5('0xbe'),'internal'],'required':![]},{'model':db[_0x25c5('0xbf')],'as':_0x25c5('0xc0'),'attributes':['id',_0x25c5('0x3b'),'color'],'where':_0x2b71c7[_0x25c5('0x45')][_0x25c5('0xc1')]?{'id':_0x2b71c7['query']['tag']}:undefined,'required':_0x2b71c7[_0x25c5('0x45')][_0x25c5('0xc1')]?!![]:![]}];}return db['SmsInteraction'][_0x25c5('0x57')](_0xcbcda7);})['then'](function(_0x22d82a){_0x740e8b[_0x25c5('0xc2')]=_0x22d82a;return _0x740e8b;});}})['then'](respondWithFilteredResult(_0x4baa44,_0xcbcda7))[_0x25c5('0x28')](handleError(_0x4baa44,null));};exports[_0x25c5('0x3c')]=function(_0x1904bb,_0x31cb64,_0x5105ad){var _0x513364,_0x15970c,_0x41e76b;if(_[_0x25c5('0x93')](_0x1904bb[_0x25c5('0x5c')][_0x25c5('0x5c')])||_0x1904bb['body']['body']===''){throw new db[(_0x25c5('0x78'))][(_0x25c5('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1904bb[_0x25c5('0x5c')]['to'])){throw new db[(_0x25c5('0x78'))][(_0x25c5('0x79'))]('to\x20is\x20mandatory');}_0x513364=_0x1904bb[_0x25c5('0x5c')]['to'];return db[_0x25c5('0x41')]['find']({'where':{'id':_0x1904bb['params']['id']},'include':[{'model':db[_0x25c5('0x98')],'as':_0x25c5('0xc3'),'include':[{'model':db[_0x25c5('0x77')],'as':_0x25c5('0x9c'),'where':{'mobile':_0x513364},'limit':0x1,'order':[[_0x25c5('0x7c'),_0x25c5('0x99')]]}]}]})[_0x25c5('0x20')](handleEntityNotFound(_0x31cb64,null))[_0x25c5('0x20')](function(_0x312797){if(_0x312797&&_0x312797[_0x25c5('0xc3')]){_0x15970c=_0x312797[_0x25c5('0x36')]({'plain':!![]});if(_0x15970c[_0x25c5('0xc3')]&&_0x15970c[_0x25c5('0xc3')]['Contacts'][_0x25c5('0x4c')]){return _0x15970c['List'][_0x25c5('0x9c')][0x0];}return db['CmContact']['create'](_[_0x25c5('0xc4')](_0x1904bb[_0x25c5('0x5c')],{'firstName':_0x513364,'mobile':_0x513364,'phone':_0x513364,'ListId':_0x15970c[_0x25c5('0xc5')]}));}})[_0x25c5('0x20')](handleEntityNotFound(_0x31cb64,null))[_0x25c5('0x20')](function(_0x218710){if(_0x218710){_0x41e76b=_0x218710;return db[_0x25c5('0x9e')]['find']({'where':{'ContactId':_0x41e76b['id'],'closed':![],'SmsAccountId':_0x15970c['id']}})[_0x25c5('0x20')](function(_0x1e31bb){if(_0x1e31bb){return[_0x1e31bb,![]];}return db[_0x25c5('0x9e')]['create']({'UserId':_0x1904bb[_0x25c5('0x5d')]['id'],'ContactId':_0x41e76b['id'],'SmsAccountId':_0x15970c['id'],'phone':_0x513364,'firstMsgDirection':_0x25c5('0xc6'),'Messages':[_[_0x25c5('0x53')](_0x1904bb[_0x25c5('0x5c')],{'read':![],'body':_0x1904bb[_0x25c5('0x5c')][_0x25c5('0x5c')],'phone':_0x513364,'SmsAccountId':_0x15970c['id'],'UserId':_0x1904bb[_0x25c5('0x5d')]['id'],'ContactId':_0x41e76b['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x25c5('0xc7')}]})[_0x25c5('0x20')](function(_0x8dc6d1){return[_0x8dc6d1,!![]];});});}})[_0x25c5('0x9f')](function(_0x5f3517,_0x1785a2){if(_0x1785a2){return _0x5f3517;}return db[_0x25c5('0xa2')][_0x25c5('0x5b')](_[_0x25c5('0x53')](_0x1904bb[_0x25c5('0x5c')],{'read':![],'body':_0x1904bb['body']['body'],'phone':_0x513364,'SmsAccountId':_0x15970c['id'],'SmsInteractionId':_0x5f3517['id'],'UserId':_0x1904bb[_0x25c5('0x5d')]['id'],'ContactId':_0x41e76b['id']}))[_0x25c5('0x20')](function(_0x30ef23){_0x5f3517[_0x25c5('0xc8')]['Messages']=[];_0x5f3517[_0x25c5('0xc8')][_0x25c5('0xc7')][_0x25c5('0xc9')](_0x30ef23[_0x25c5('0xc8')]);return _0x5f3517;});})['then'](respondWithResult(_0x31cb64,null))[_0x25c5('0x28')](handleError(_0x31cb64,null));};exports[_0x25c5('0x29')]=function(_0x23b499,_0xad1876,_0x1478bc){if(_0x23b499[_0x25c5('0x5c')]['id']){delete _0x23b499[_0x25c5('0x5c')]['id'];}var _0x4308f1,_0x137f54,_0x24e65a;return db[_0x25c5('0x41')][_0x25c5('0x5a')]({'where':{'id':_0x23b499[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0xad1876,null))[_0x25c5('0x20')](function(_0x128fcd){if(_0x128fcd){_0x24e65a=_0x128fcd;logger[_0x25c5('0xaf')](_0x25c5('0xca'),_0x25c5('0x29'),'received\x20delivery\x20report\x20from',_0x128fcd[_0x25c5('0x43')],util['inspect'](_0x23b499[_0x25c5('0x5c')],{'showHidden':![],'depth':null}));switch(_0x128fcd[_0x25c5('0x43')]){case _0x25c5('0x83'):if(_0x23b499[_0x25c5('0x5c')]['skebby_dispatch_id']&&_0x23b499['body']['status']){_0x137f54=_0x23b499['body'][_0x25c5('0x29')];return db[_0x25c5('0xa2')][_0x25c5('0x5a')]({'where':{'messageId':_0x23b499['body']['skebby_dispatch_id']}});}break;case _0x25c5('0xcb'):if(_0x23b499[_0x25c5('0x5c')][_0x25c5('0xcc')]&&_0x23b499[_0x25c5('0x5c')]['statusInt']){_0x137f54=_0x23b499[_0x25c5('0x5c')][_0x25c5('0xcd')];return db[_0x25c5('0xa2')][_0x25c5('0x5a')]({'where':{'messageId':_0x23b499[_0x25c5('0x5c')][_0x25c5('0xcc')]}});}break;case _0x25c5('0x86'):if(_0x23b499['body'][_0x25c5('0x87')]&&_0x23b499[_0x25c5('0x5c')]['status_code']){_0x137f54=_0x23b499['body'][_0x25c5('0xce')];return db['SmsMessage'][_0x25c5('0x5a')]({'where':{'messageId':_0x23b499['body'][_0x25c5('0x87')]}});}break;case'infobip':var _0xa3c485=_0x23b499['body'][_0x25c5('0x8a')][0x0];if(_0xa3c485[_0x25c5('0x82')]&&_0xa3c485['status'][_0x25c5('0xcf')]===_0x25c5('0xd0')){_0x137f54=_0xa3c485['status'][_0x25c5('0xcf')];return db[_0x25c5('0xa2')][_0x25c5('0x5a')]({'where':{'messageId':_0xa3c485[_0x25c5('0x82')]}});}break;case _0x25c5('0xd1'):if(_0x23b499[_0x25c5('0x5c')]['messageId']&&_0x23b499[_0x25c5('0x5c')][_0x25c5('0x29')]){_0x137f54=_0x23b499[_0x25c5('0x5c')][_0x25c5('0x29')];return db[_0x25c5('0xa2')][_0x25c5('0x5a')]({'where':{'messageId':_0x23b499[_0x25c5('0x5c')][_0x25c5('0x82')]}});}break;case _0x25c5('0x90'):if(_0x23b499[_0x25c5('0x5c')][0x0][_0x25c5('0x25')]['id']){_0x137f54=_0x23b499[_0x25c5('0x5c')][0x0][_0x25c5('0x43')];return db['SmsMessage'][_0x25c5('0x5a')]({'where':{'messageId':_0x23b499[_0x25c5('0x5c')][0x0][_0x25c5('0x25')]['id']}});}break;case _0x25c5('0x91'):if(_0x23b499['body'][_0x25c5('0xd2')]&&_0x23b499[_0x25c5('0x5c')][_0x25c5('0x29')]){_0x137f54=_0x23b499['body'][_0x25c5('0x29')];return db[_0x25c5('0xa2')][_0x25c5('0x5a')]({'where':{'messageId':_0x23b499[_0x25c5('0x5c')]['redif']}});}break;}}})[_0x25c5('0x20')](handleEntityNotFound(_0xad1876,null))['then'](function(_0x11d089){if(_0x11d089){_0x4308f1=_0x11d089;switch(_0x24e65a[_0x25c5('0x43')]){case'skebby':if(_0x137f54===_0x25c5('0xd0')){return _0x4308f1['update']({'read':!![]});}else{logger[_0x25c5('0x24')](_0x25c5('0xca'),_0x25c5('0x29'),_0x25c5('0x83'),util[_0x25c5('0xd3')](_0x23b499['body'],{'showHidden':![],'depth':null}));}break;case _0x25c5('0xcb'):if(_0x137f54==='1'){return _0x4308f1[_0x25c5('0x34')]({'read':!![]});}else{logger[_0x25c5('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x25c5('0x29'),'skebby',util['inspect'](_0x23b499[_0x25c5('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x25c5('0x86'):if(!_0x23b499[_0x25c5('0x5c')][_0x25c5('0xd4')]&&_0x137f54>=0xc8&&_0x137f54<=0xce){return _0x4308f1[_0x25c5('0x34')]({'read':!![]});}else{logger[_0x25c5('0x24')](_0x25c5('0xca'),_0x25c5('0x29'),_0x25c5('0x86'),util[_0x25c5('0xd3')](_0x23b499[_0x25c5('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x25c5('0x89'):var _0x88549=_0x23b499[_0x25c5('0x5c')][_0x25c5('0x8a')][0x0];if(_0x88549['status'][_0x25c5('0xcf')]===_0x25c5('0xd0')){return _0x4308f1[_0x25c5('0x34')]({'read':!![]});}else{logger[_0x25c5('0x24')](_0x25c5('0xca'),'status',_0x25c5('0x89'),util[_0x25c5('0xd3')](_0x23b499['body'],{'showHidden':![],'depth':null}));}break;case _0x25c5('0xd1'):if(_0x137f54==_0x25c5('0xd5')||_0x137f54==_0x25c5('0xd6')){return _0x4308f1[_0x25c5('0x34')]({'read':!![]});}else{logger[_0x25c5('0x24')](_0x25c5('0xca'),_0x25c5('0x29'),_0x25c5('0xd1'),util[_0x25c5('0xd3')](_0x23b499[_0x25c5('0x5c')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x137f54==_0x25c5('0xd7')){return _0x4308f1['update']({'read':!![]});}else{logger[_0x25c5('0x24')](_0x25c5('0xca'),_0x25c5('0x29'),_0x25c5('0x90'),util[_0x25c5('0xd3')](_0x23b499['body'],{'showHidden':![],'depth':null}));}break;case _0x25c5('0x91'):if(_0x137f54===_0x25c5('0xd8')||_0x137f54==='ACCEPTD'){return _0x4308f1[_0x25c5('0x34')]({'read':!![]});}else{logger['error'](_0x25c5('0xca'),_0x25c5('0x29'),'intelepeer',util[_0x25c5('0xd3')](_0x23b499[_0x25c5('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x4308f1;}})[_0x25c5('0x20')](respondWithResult(_0xad1876,null))[_0x25c5('0x28')](handleError(_0xad1876,null));};exports['statusGet']=function(_0x5bab7e,_0x26bf0b,_0x42b9ce){var _0x3064d5,_0x12831b,_0x5cdbad;return db['SmsAccount'][_0x25c5('0x5a')]({'where':{'id':_0x5bab7e[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x26bf0b,null))['then'](function(_0x57bb10){if(_0x57bb10){_0x5cdbad=_0x57bb10;logger[_0x25c5('0xaf')](_0x25c5('0xca'),_0x25c5('0x29'),'received\x20delivery\x20report\x20from',_0x57bb10['type'],util[_0x25c5('0xd3')](_0x5bab7e[_0x25c5('0x45')],{'showHidden':![],'depth':null}));switch(_0x57bb10[_0x25c5('0x43')]){case _0x25c5('0x8b'):if(_0x5bab7e[_0x25c5('0x45')][_0x25c5('0xd9')]&&_0x5bab7e[_0x25c5('0x45')]['state']){_0x12831b=_0x5bab7e['query']['state'];return db[_0x25c5('0xa2')][_0x25c5('0x5a')]({'where':{'messageId':_0x5bab7e['query'][_0x25c5('0xd9')]}});}break;}}})['then'](handleEntityNotFound(_0x26bf0b,null))[_0x25c5('0x20')](function(_0x2f0cae){if(_0x2f0cae){_0x3064d5=_0x2f0cae;switch(_0x5cdbad[_0x25c5('0x43')]){case _0x25c5('0x8b'):if(_0x12831b==='2'||_0x12831b==='6'){return _0x3064d5['update']({'read':!![]});}else{logger[_0x25c5('0x24')](_0x25c5('0xca'),_0x25c5('0x29'),'csc',util[_0x25c5('0xd3')](_0x5bab7e['query'],{'showHidden':![],'depth':null}));};break;}return _0x3064d5;}})[_0x25c5('0x20')](respondWithResult(_0x26bf0b,null))[_0x25c5('0x28')](handleError(_0x26bf0b,null));};exports[_0x25c5('0xda')]=function(_0x5262d8,_0x20738f,_0x533d46){return db['SmsAccount']['find']({'where':{'id':_0x5262d8['params']['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x20738f,null))[_0x25c5('0x20')](function(_0x31878f){if(_0x31878f){return _0x31878f[_0x25c5('0xda')](_0x5262d8[_0x25c5('0x5c')][_0x25c5('0x69')],_[_0x25c5('0x9b')](_0x5262d8[_0x25c5('0x5c')],['ids','id'])||{})[_0x25c5('0x9f')](function(_0x223e31){for(var _0x18fc49=0x0;_0x18fc49<_0x5262d8[_0x25c5('0x5c')][_0x25c5('0x69')]['length'];_0x18fc49+=0x1){socket[_0x25c5('0xdb')](_0x25c5('0xdc'),{'UserId':Number(_0x5262d8['body'][_0x25c5('0x69')][_0x18fc49]),'SmsAccountId':Number(_0x5262d8[_0x25c5('0x62')]['id'])});}return _0x223e31;});}})['then'](respondWithResult(_0x20738f,null))[_0x25c5('0x28')](handleError(_0x20738f,null));};exports['removeAgents']=function(_0x275a47,_0x3d6881,_0x2c3046){return db[_0x25c5('0x41')]['find']({'where':{'id':_0x275a47[_0x25c5('0x62')]['id']}})['then'](handleEntityNotFound(_0x3d6881,null))['then'](function(_0x5dcc1e){if(_0x5dcc1e){return _0x5dcc1e[_0x25c5('0xdd')](_0x275a47[_0x25c5('0x45')]['ids'])[_0x25c5('0x20')](function(){if(_[_0x25c5('0xde')](_0x275a47['query'][_0x25c5('0x69')])){for(var _0x2ce6f0=0x0;_0x2ce6f0<_0x275a47[_0x25c5('0x45')][_0x25c5('0x69')][_0x25c5('0x4c')];_0x2ce6f0+=0x1){socket['emit'](_0x25c5('0xdf'),{'UserId':Number(_0x275a47[_0x25c5('0x45')][_0x25c5('0x69')][_0x2ce6f0]),'SmsAccountId':Number(_0x275a47[_0x25c5('0x62')]['id'])});}}else{socket[_0x25c5('0xdb')](_0x25c5('0xdf'),{'UserId':Number(_0x275a47[_0x25c5('0x45')][_0x25c5('0x69')]),'SmsAccountId':Number(_0x275a47['params']['id'])});}});}})[_0x25c5('0x20')](respondWithStatusCode(_0x3d6881,null))['catch'](handleError(_0x3d6881,null));};exports[_0x25c5('0xe0')]=function(_0x2267f2,_0x412653,_0xd318d7){var _0x6e9de9={};var _0x243116={};var _0x26875f;var _0x3e46b6;return db[_0x25c5('0x41')]['findOne']({'where':{'id':_0x2267f2[_0x25c5('0x62')]['id']}})[_0x25c5('0x20')](handleEntityNotFound(_0x412653,null))['then'](function(_0x2bbb22){if(_0x2bbb22){_0x26875f=_0x2bbb22;_0x243116['model']=_[_0x25c5('0x46')](db['User']['rawAttributes']);_0x243116[_0x25c5('0x45')]=_[_0x25c5('0x46')](_0x2267f2[_0x25c5('0x45')]);_0x243116[_0x25c5('0x47')]=_[_0x25c5('0x4a')](_0x243116[_0x25c5('0x48')],_0x243116[_0x25c5('0x45')]);_0x6e9de9['attributes']=_['intersection'](_0x243116[_0x25c5('0x48')],qs['fields'](_0x2267f2[_0x25c5('0x45')][_0x25c5('0x4b')]));_0x6e9de9[_0x25c5('0x49')]=_0x6e9de9[_0x25c5('0x49')]['length']?_0x6e9de9[_0x25c5('0x49')]:_0x243116[_0x25c5('0x48')];_0x6e9de9['order']=qs[_0x25c5('0x67')](_0x2267f2[_0x25c5('0x45')][_0x25c5('0x67')]);_0x6e9de9[_0x25c5('0x50')]=qs[_0x25c5('0x47')](_[_0x25c5('0x51')](_0x2267f2['query'],_0x243116[_0x25c5('0x47')]));if(_0x2267f2[_0x25c5('0x45')][_0x25c5('0x52')]){_0x6e9de9[_0x25c5('0x50')]=_[_0x25c5('0x53')](_0x6e9de9[_0x25c5('0x50')],{'$or':_[_0x25c5('0x40')](_0x6e9de9['attributes'],function(_0x68aea7){var _0x2bdbb1={};_0x2bdbb1[_0x68aea7]={'$like':'%'+_0x2267f2[_0x25c5('0x45')][_0x25c5('0x52')]+'%'};return _0x2bdbb1;})});}_0x6e9de9=_[_0x25c5('0x53')]({},_0x6e9de9,_0x2267f2['options']);return _0x26875f['getAgents'](_0x6e9de9);}})[_0x25c5('0x20')](function(_0x78e27e){if(_0x78e27e){_0x3e46b6=_0x78e27e['length'];if(!_0x2267f2[_0x25c5('0x45')][_0x25c5('0x4d')](_0x25c5('0x4e'))){_0x6e9de9['limit']=qs[_0x25c5('0x2e')](_0x2267f2[_0x25c5('0x45')]['limit']);_0x6e9de9[_0x25c5('0x2c')]=qs[_0x25c5('0x2c')](_0x2267f2[_0x25c5('0x45')][_0x25c5('0x2c')]);}return _0x26875f[_0x25c5('0xe0')](_0x6e9de9);}})[_0x25c5('0x20')](function(_0x1a7ff3){if(_0x1a7ff3){return _0x1a7ff3?{'count':_0x3e46b6,'rows':_0x1a7ff3}:null;}})[_0x25c5('0x20')](respondWithResult(_0x412653,null))[_0x25c5('0x28')](handleError(_0x412653,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 588ca2d..e70a062 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 _0x7020=['setMaxListeners','save','update','remove','emit','events','../../mysqldb','SmsAccount'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x7020,0x17d));var _0x0702=function(_0x50326a,_0x23a6d1){_0x50326a=_0x50326a-0x0;var _0x490446=_0x7020[_0x50326a];return _0x490446;};'use strict';var EventEmitter=require(_0x0702('0x0'));var SmsAccount=require(_0x0702('0x1'))['db'][_0x0702('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0702('0x3')](0x0);var events={'afterCreate':_0x0702('0x4'),'afterUpdate':_0x0702('0x5'),'afterDestroy':_0x0702('0x6')};function emitEvent(_0x32d619){return function(_0x760a23,_0x446132,_0x31d6a7){SmsAccountEvents[_0x0702('0x7')](_0x32d619+':'+_0x760a23['id'],_0x760a23);SmsAccountEvents['emit'](_0x32d619,_0x760a23);_0x31d6a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x0c09=['SmsAccount','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x356686,_0x205bb7){var _0x32bf54=function(_0x21f6d6){while(--_0x21f6d6){_0x356686['push'](_0x356686['shift']());}};_0x32bf54(++_0x205bb7);}(_0x0c09,0x68));var _0x90c0=function(_0x342497,_0x37cb26){_0x342497=_0x342497-0x0;var _0x2aca97=_0x0c09[_0x342497];return _0x2aca97;};'use strict';var EventEmitter=require(_0x90c0('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x90c0('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90c0('0x2'),'afterUpdate':'update','afterDestroy':_0x90c0('0x3')};function emitEvent(_0x5c30dc){return function(_0x2f10c9,_0x2ced4b,_0x31b45a){SmsAccountEvents[_0x90c0('0x4')](_0x5c30dc+':'+_0x2f10c9['id'],_0x2f10c9);SmsAccountEvents['emit'](_0x5c30dc,_0x2f10c9);_0x31b45a(null);};}for(var e in events){if(events[_0x90c0('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x90c0('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index f43d004..62f3b70 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 _0x70bb=['SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x1c919e,_0x42fc80){var _0x50a3bb=function(_0x47d64d){while(--_0x47d64d){_0x1c919e['push'](_0x1c919e['shift']());}};_0x50a3bb(++_0x42fc80);}(_0x70bb,0xb2));var _0xb70b=function(_0xaec935,_0x5f3d12){_0xaec935=_0xaec935-0x0;var _0x28a8e1=_0x70bb[_0xaec935];return _0x28a8e1;};'use strict';var _=require(_0xb70b('0x0'));var util=require(_0xb70b('0x1'));var logger=require(_0xb70b('0x2'))('api');var moment=require(_0xb70b('0x3'));var BPromise=require(_0xb70b('0x4'));var rp=require(_0xb70b('0x5'));var fs=require('fs');var path=require(_0xb70b('0x6'));var rimraf=require(_0xb70b('0x7'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xb70b('0x8')]=function(_0x4c345e,_0x16486e){return _0x4c345e['define'](_0xb70b('0x9'),attributes,{'tableName':_0xb70b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a4a=['SmsAccount','sms_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports'];(function(_0x580dfa,_0x426033){var _0x147b84=function(_0x107d94){while(--_0x107d94){_0x580dfa['push'](_0x580dfa['shift']());}};_0x147b84(++_0x426033);}(_0x1a4a,0xce));var _0xa1a4=function(_0x557841,_0x384c15){_0x557841=_0x557841-0x0;var _0x33f4f1=_0x1a4a[_0x557841];return _0x33f4f1;};'use strict';var _=require(_0xa1a4('0x0'));var util=require(_0xa1a4('0x1'));var logger=require('../../config/logger')(_0xa1a4('0x2'));var moment=require(_0xa1a4('0x3'));var BPromise=require(_0xa1a4('0x4'));var rp=require(_0xa1a4('0x5'));var fs=require('fs');var path=require(_0xa1a4('0x6'));var rimraf=require(_0xa1a4('0x7'));var config=require('../../config/environment');var attributes=require(_0xa1a4('0x8'));module[_0xa1a4('0x9')]=function(_0x5cc2e1,_0x1a8245){return _0x5cc2e1['define'](_0xa1a4('0xa'),attributes,{'tableName':_0xa1a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index d7d3c20..62071c1 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 _0xda5c=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','SmsAccount','find','options','attributes','include','map','model','then','ShowSmsAccount','lodash','util','moment'];(function(_0x4c7236,_0x383a92){var _0x1f72f7=function(_0x568d7a){while(--_0x568d7a){_0x4c7236['push'](_0x4c7236['shift']());}};_0x1f72f7(++_0x383a92);}(_0xda5c,0x141));var _0xcda5=function(_0x4ce80f,_0x3834cd){_0x4ce80f=_0x4ce80f-0x0;var _0x47af18=_0xda5c[_0x4ce80f];return _0x47af18;};'use strict';var _=require(_0xcda5('0x0'));var util=require(_0xcda5('0x1'));var moment=require(_0xcda5('0x2'));var BPromise=require('bluebird');var rs=require(_0xcda5('0x3'));var fs=require('fs');var Redis=require(_0xcda5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcda5('0x5'))(_0xcda5('0x6'));var config=require(_0xcda5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcda5('0x8')][_0xcda5('0x9')]({'port':0x232a});config[_0xcda5('0xa')]=_[_0xcda5('0xb')](config[_0xcda5('0xa')],{'host':_0xcda5('0xc'),'port':0x18eb});var socket=require(_0xcda5('0xd'))(new Redis(config[_0xcda5('0xa')]));require('./smsAccount.socket')[_0xcda5('0xe')](socket);function respondWithRpcPromise(_0x5e3dc9,_0x583e92,_0x1868b6){return new BPromise(function(_0x2b2141,_0x173196){return client[_0xcda5('0xf')](_0x5e3dc9,_0x1868b6)['then'](function(_0x19c171){logger[_0xcda5('0x10')]('SmsAccount,\x20%s,\x20%s',_0x583e92,_0xcda5('0x11'));logger[_0xcda5('0x12')](_0xcda5('0x13'),_0x583e92,_0xcda5('0x11'),JSON[_0xcda5('0x14')](_0x19c171));if(_0x19c171[_0xcda5('0x15')]){if(_0x19c171[_0xcda5('0x15')][_0xcda5('0x16')]===0x1f4){logger[_0xcda5('0x15')]('SmsAccount,\x20%s,\x20%s',_0x583e92,_0x19c171[_0xcda5('0x15')][_0xcda5('0x17')]);return _0x173196(_0x19c171[_0xcda5('0x15')][_0xcda5('0x17')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x583e92,_0x19c171['error']['message']);return _0x2b2141(_0x19c171[_0xcda5('0x15')][_0xcda5('0x17')]);}else{logger[_0xcda5('0x10')](_0xcda5('0x18'),_0x583e92,'request\x20sent');_0x2b2141(_0x19c171[_0xcda5('0x19')][_0xcda5('0x17')]);}})[_0xcda5('0x1a')](function(_0x4d9007){logger[_0xcda5('0x15')](_0xcda5('0x18'),_0x583e92,_0x4d9007);_0x173196(_0x4d9007);});});}exports['ShowSmsAccount']=function(_0x4477f6){var _0x1cafbb=this;return new Promise(function(_0x2ff87b,_0x330d72){return db[_0xcda5('0x1b')][_0xcda5('0x1c')]({'raw':_0x4477f6[_0xcda5('0x1d')]?_0x4477f6[_0xcda5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4477f6[_0xcda5('0x1d')]?_0x4477f6[_0xcda5('0x1d')]['where']||null:null,'attributes':_0x4477f6[_0xcda5('0x1d')]?_0x4477f6[_0xcda5('0x1d')][_0xcda5('0x1e')]||null:null,'include':_0x4477f6[_0xcda5('0x1d')]?_0x4477f6[_0xcda5('0x1d')][_0xcda5('0x1f')]?_[_0xcda5('0x20')](_0x4477f6[_0xcda5('0x1d')][_0xcda5('0x1f')],function(_0x2c64fa){return{'model':db[_0x2c64fa['model']],'as':_0x2c64fa['as'],'attributes':_0x2c64fa['attributes'],'include':_0x2c64fa[_0xcda5('0x1f')]?_[_0xcda5('0x20')](_0x2c64fa[_0xcda5('0x1f')],function(_0x103d18){return{'model':db[_0x103d18[_0xcda5('0x21')]],'as':_0x103d18['as'],'attributes':_0x103d18['attributes'],'include':_0x103d18[_0xcda5('0x1f')]?_[_0xcda5('0x20')](_0x103d18[_0xcda5('0x1f')],function(_0x2a341e){return{'model':db[_0x2a341e[_0xcda5('0x21')]],'as':_0x2a341e['as'],'attributes':_0x2a341e['attributes']};}):[]};}):[]};}):[]:[]})[_0xcda5('0x22')](function(_0x4906c7){logger[_0xcda5('0x10')](_0xcda5('0x23'),_0x4477f6);logger[_0xcda5('0x12')](_0xcda5('0x23'),_0x4477f6,JSON[_0xcda5('0x14')](_0x4906c7));_0x2ff87b(_0x4906c7);})['catch'](function(_0x3889db){logger[_0xcda5('0x15')]('ShowSmsAccount',_0x3889db[_0xcda5('0x17')],_0x4477f6);_0x330d72(_0x1cafbb[_0xcda5('0x15')](0x1f4,_0x3889db[_0xcda5('0x17')]));});});}; \ No newline at end of file +var _0x1dbf=['stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','info','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowSmsAccount','options','where','attributes','map','include','model','then','debug'];(function(_0x9010e3,_0x28b9b7){var _0x13865e=function(_0x75f8fb){while(--_0x75f8fb){_0x9010e3['push'](_0x9010e3['shift']());}};_0x13865e(++_0x28b9b7);}(_0x1dbf,0x18d));var _0xf1db=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0x1dbf[_0x2af053];return _0x4b4001;};'use strict';var _=require('lodash');var util=require(_0xf1db('0x0'));var moment=require(_0xf1db('0x1'));var BPromise=require(_0xf1db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1db('0x3'));var db=require(_0xf1db('0x4'))['db'];var utils=require(_0xf1db('0x5'));var logger=require(_0xf1db('0x6'))(_0xf1db('0x7'));var config=require(_0xf1db('0x8'));var jayson=require(_0xf1db('0x9'));var client=jayson[_0xf1db('0xa')][_0xf1db('0xb')]({'port':0x232a});config['redis']=_[_0xf1db('0xc')](config[_0xf1db('0xd')],{'host':_0xf1db('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1db('0xd')]));require('./smsAccount.socket')[_0xf1db('0xf')](socket);function respondWithRpcPromise(_0x4c7864,_0x3588ab,_0x1fb720){return new BPromise(function(_0x5991e8,_0x1e2582){return client[_0xf1db('0x10')](_0x4c7864,_0x1fb720)['then'](function(_0x177b1b){logger[_0xf1db('0x11')]('SmsAccount,\x20%s,\x20%s',_0x3588ab,'request\x20sent');logger['debug'](_0xf1db('0x12'),_0x3588ab,'request\x20sent',JSON['stringify'](_0x177b1b));if(_0x177b1b[_0xf1db('0x13')]){if(_0x177b1b[_0xf1db('0x13')][_0xf1db('0x14')]===0x1f4){logger[_0xf1db('0x13')](_0xf1db('0x15'),_0x3588ab,_0x177b1b[_0xf1db('0x13')][_0xf1db('0x16')]);return _0x1e2582(_0x177b1b[_0xf1db('0x13')][_0xf1db('0x16')]);}logger[_0xf1db('0x13')](_0xf1db('0x15'),_0x3588ab,_0x177b1b[_0xf1db('0x13')]['message']);return _0x5991e8(_0x177b1b[_0xf1db('0x13')]['message']);}else{logger[_0xf1db('0x11')](_0xf1db('0x15'),_0x3588ab,_0xf1db('0x17'));_0x5991e8(_0x177b1b[_0xf1db('0x18')][_0xf1db('0x16')]);}})[_0xf1db('0x19')](function(_0x2e14aa){logger[_0xf1db('0x13')](_0xf1db('0x15'),_0x3588ab,_0x2e14aa);_0x1e2582(_0x2e14aa);});});}exports[_0xf1db('0x1a')]=function(_0x3f821e){var _0x26bc7a=this;return new Promise(function(_0x559396,_0x1ed10e){return db['SmsAccount']['find']({'raw':_0x3f821e[_0xf1db('0x1b')]?_0x3f821e['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f821e[_0xf1db('0x1b')]?_0x3f821e[_0xf1db('0x1b')][_0xf1db('0x1c')]||null:null,'attributes':_0x3f821e[_0xf1db('0x1b')]?_0x3f821e['options'][_0xf1db('0x1d')]||null:null,'include':_0x3f821e['options']?_0x3f821e['options']['include']?_[_0xf1db('0x1e')](_0x3f821e['options'][_0xf1db('0x1f')],function(_0x2a758e){return{'model':db[_0x2a758e[_0xf1db('0x20')]],'as':_0x2a758e['as'],'attributes':_0x2a758e[_0xf1db('0x1d')],'include':_0x2a758e[_0xf1db('0x1f')]?_['map'](_0x2a758e[_0xf1db('0x1f')],function(_0x5d8452){return{'model':db[_0x5d8452[_0xf1db('0x20')]],'as':_0x5d8452['as'],'attributes':_0x5d8452['attributes'],'include':_0x5d8452[_0xf1db('0x1f')]?_[_0xf1db('0x1e')](_0x5d8452[_0xf1db('0x1f')],function(_0x29daf2){return{'model':db[_0x29daf2[_0xf1db('0x20')]],'as':_0x29daf2['as'],'attributes':_0x29daf2[_0xf1db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf1db('0x21')](function(_0x322ea8){logger[_0xf1db('0x11')](_0xf1db('0x1a'),_0x3f821e);logger[_0xf1db('0x22')](_0xf1db('0x1a'),_0x3f821e,JSON[_0xf1db('0x23')](_0x322ea8));_0x559396(_0x322ea8);})[_0xf1db('0x19')](function(_0x5f4702){logger[_0xf1db('0x13')]('ShowSmsAccount',_0x5f4702[_0xf1db('0x16')],_0x3f821e);_0x1ed10e(_0x26bc7a[_0xf1db('0x13')](0x1f4,_0x5f4702[_0xf1db('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 79a631e..ac4d0f2 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 0cf51d1..4c5307a 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _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(_0x4da572,_0x326408){var _0x378393=function(_0x1357e4){while(--_0x1357e4){_0x4da572['push'](_0x4da572['shift']());}};_0x378393(++_0x326408);}(_0x34e8,0x12c));var _0x834e=function(_0x8432da,_0xb2ec37){_0x8432da=_0x8432da-0x0;var _0xbc6d05=_0x34e8[_0x8432da];return _0xbc6d05;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 0c0b54a..2c4cfeb 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 _0xeb32=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x4fecf9,_0x3aa177){var _0x1b57ba=function(_0x5572a6){while(--_0x5572a6){_0x4fecf9['push'](_0x4fecf9['shift']());}};_0x1b57ba(++_0x3aa177);}(_0xeb32,0x19c));var _0x2eb3=function(_0x4ac7e9,_0x3bf99c){_0x4ac7e9=_0x4ac7e9-0x0;var _0x2401e4=_0xeb32[_0x4ac7e9];return _0x2401e4;};'use strict';var Sequelize=require(_0x2eb3('0x0'));module[_0x2eb3('0x1')]={'priority':{'type':Sequelize[_0x2eb3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2eb3('0x3')],'allowNull':![],'defaultValue':_0x2eb3('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2eb3('0x3')]},'interval':{'type':Sequelize[_0x2eb3('0x3')],'defaultValue':_0x2eb3('0x5')}}; \ No newline at end of file +var _0xe4ab=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x4dd149,_0x27746b){var _0x3402b1=function(_0x5e21bd){while(--_0x5e21bd){_0x4dd149['push'](_0x4dd149['shift']());}};_0x3402b1(++_0x27746b);}(_0xe4ab,0x91));var _0xbe4a=function(_0x40c4c5,_0x2f6fc0){_0x40c4c5=_0x40c4c5-0x0;var _0x3b3470=_0xe4ab[_0x40c4c5];return _0x3b3470;};'use strict';var Sequelize=require(_0xbe4a('0x0'));module[_0xbe4a('0x1')]={'priority':{'type':Sequelize[_0xbe4a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbe4a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbe4a('0x4')]()},'description':{'type':Sequelize[_0xbe4a('0x3')]},'interval':{'type':Sequelize[_0xbe4a('0x3')],'defaultValue':_0xbe4a('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index dca9f6b..17aa6aa 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 _0x4a65=['../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4a65,0xc6));var _0x54a6=function(_0x2914fa,_0x17af45){_0x2914fa=_0x2914fa-0x0;var _0x4d7514=_0x4a65[_0x2914fa];return _0x4d7514;};'use strict';var emlformat=require(_0x54a6('0x0'));var rimraf=require(_0x54a6('0x1'));var zipdir=require(_0x54a6('0x2'));var jsonpatch=require(_0x54a6('0x3'));var rp=require('request-promise');var moment=require(_0x54a6('0x4'));var BPromise=require(_0x54a6('0x5'));var Mustache=require(_0x54a6('0x6'));var util=require('util');var path=require(_0x54a6('0x7'));var sox=require(_0x54a6('0x8'));var csv=require(_0x54a6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54a6('0xa'));var _=require(_0x54a6('0xb'));var squel=require(_0x54a6('0xc'));var crypto=require(_0x54a6('0xd'));var jsforce=require(_0x54a6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x54a6('0x9'));var querystring=require(_0x54a6('0xf'));var Papa=require(_0x54a6('0x10'));var Redis=require(_0x54a6('0x11'));var authService=require(_0x54a6('0x12'));var qs=require(_0x54a6('0x13'));var as=require(_0x54a6('0x14'));var hardwareService=require(_0x54a6('0x15'));var logger=require('../../config/logger')(_0x54a6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x54a6('0x17'));var db=require(_0x54a6('0x18'))['db'];function respondWithStatusCode(_0x1053c7,_0x56eb2b){_0x56eb2b=_0x56eb2b||0xcc;return function(_0x267bf4){if(_0x267bf4){return _0x1053c7[_0x54a6('0x19')](_0x56eb2b);}return _0x1053c7['status'](_0x56eb2b)[_0x54a6('0x1a')]();};}function respondWithResult(_0x5bc344,_0x528f3b){_0x528f3b=_0x528f3b||0xc8;return function(_0x47c95f){if(_0x47c95f){return _0x5bc344[_0x54a6('0x1b')](_0x528f3b)[_0x54a6('0x1c')](_0x47c95f);}};}function respondWithFilteredResult(_0x49db55,_0x3e5c00){return function(_0x32aadd){if(_0x32aadd){var _0x3d160d=typeof _0x3e5c00[_0x54a6('0x1d')]===_0x54a6('0x1e')&&typeof _0x3e5c00[_0x54a6('0x1f')]==='undefined';var _0xd1406f=_0x32aadd[_0x54a6('0x20')];var _0x2c71ca=_0x3d160d?0x0:_0x3e5c00[_0x54a6('0x1d')];var _0x231cf6=_0x3d160d?_0x32aadd[_0x54a6('0x20')]:_0x3e5c00[_0x54a6('0x1d')]+_0x3e5c00[_0x54a6('0x1f')];var _0x168397;if(_0x231cf6>=_0xd1406f){_0x231cf6=_0xd1406f;_0x168397=0xc8;}else{_0x168397=0xce;}_0x49db55[_0x54a6('0x1b')](_0x168397);return _0x49db55[_0x54a6('0x21')](_0x54a6('0x22'),_0x2c71ca+'-'+_0x231cf6+'/'+_0xd1406f)[_0x54a6('0x1c')](_0x32aadd);}return null;};}function patchUpdates(_0x40ef30){return function(_0x4f5789){try{jsonpatch['apply'](_0x4f5789,_0x40ef30,!![]);}catch(_0x32e653){return BPromise['reject'](_0x32e653);}return _0x4f5789[_0x54a6('0x23')]();};}function saveUpdates(_0x179f26,_0x373e2a){return function(_0x471a93){if(_0x471a93){return _0x471a93[_0x54a6('0x24')](_0x179f26)[_0x54a6('0x25')](function(_0x597a1c){return _0x597a1c;});}return null;};}function removeEntity(_0x4f043a,_0x1a989b){return function(_0x4179cd){if(_0x4179cd){return _0x4179cd['destroy']()[_0x54a6('0x25')](function(){_0x4f043a['status'](0xcc)[_0x54a6('0x1a')]();});}};}function handleEntityNotFound(_0x40ba53,_0x3228c9){return function(_0x43c852){if(!_0x43c852){_0x40ba53['sendStatus'](0x194);}return _0x43c852;};}function handleError(_0x45d4f0,_0x22c2ac){_0x22c2ac=_0x22c2ac||0x1f4;return function(_0x46cc82){logger[_0x54a6('0x26')](_0x46cc82[_0x54a6('0x27')]);if(_0x46cc82[_0x54a6('0x28')]){delete _0x46cc82[_0x54a6('0x28')];}_0x45d4f0['status'](_0x22c2ac)[_0x54a6('0x29')](_0x46cc82);};}exports[_0x54a6('0x2a')]=function(_0x449682,_0x527885){var _0x33b06b={},_0x2aacac={},_0x5caec6={'count':0x0,'rows':[]};var _0x57dd5e=_[_0x54a6('0x2b')](db[_0x54a6('0x2c')][_0x54a6('0x2d')],function(_0x4e90a2){return{'name':_0x4e90a2[_0x54a6('0x2e')],'type':_0x4e90a2['type'][_0x54a6('0x2f')]};});_0x2aacac[_0x54a6('0x30')]=_[_0x54a6('0x2b')](_0x57dd5e,_0x54a6('0x28'));_0x2aacac[_0x54a6('0x31')]=_['keys'](_0x449682['query']);_0x2aacac[_0x54a6('0x32')]=_[_0x54a6('0x33')](_0x2aacac[_0x54a6('0x30')],_0x2aacac[_0x54a6('0x31')]);_0x33b06b['attributes']=_[_0x54a6('0x33')](_0x2aacac['model'],qs[_0x54a6('0x34')](_0x449682['query'][_0x54a6('0x34')]));_0x33b06b[_0x54a6('0x35')]=_0x33b06b['attributes'][_0x54a6('0x36')]?_0x33b06b[_0x54a6('0x35')]:_0x2aacac[_0x54a6('0x30')];if(!_0x449682[_0x54a6('0x31')][_0x54a6('0x37')]('nolimit')){_0x33b06b[_0x54a6('0x1f')]=qs[_0x54a6('0x1f')](_0x449682[_0x54a6('0x31')][_0x54a6('0x1f')]);_0x33b06b['offset']=qs[_0x54a6('0x1d')](_0x449682[_0x54a6('0x31')][_0x54a6('0x1d')]);}_0x33b06b['order']=qs[_0x54a6('0x38')](_0x449682['query'][_0x54a6('0x38')]);_0x33b06b[_0x54a6('0x39')]=qs['filters'](_['pick'](_0x449682[_0x54a6('0x31')],_0x2aacac[_0x54a6('0x32')]),_0x57dd5e);if(_0x449682['query'][_0x54a6('0x3a')]){_0x33b06b[_0x54a6('0x39')]=_[_0x54a6('0x3b')](_0x33b06b[_0x54a6('0x39')],{'$or':_[_0x54a6('0x2b')](_0x57dd5e,function(_0x231640){if(_0x231640[_0x54a6('0x3c')]!==_0x54a6('0x3d')){var _0x363406={};_0x363406[_0x231640[_0x54a6('0x28')]]={'$like':'%'+_0x449682[_0x54a6('0x31')][_0x54a6('0x3a')]+'%'};return _0x363406;}})});}_0x33b06b=_[_0x54a6('0x3b')]({},_0x33b06b,_0x449682[_0x54a6('0x3e')]);var _0x199571={'where':_0x33b06b[_0x54a6('0x39')]};return db[_0x54a6('0x2c')][_0x54a6('0x20')](_0x199571)[_0x54a6('0x25')](function(_0x8be8a1){_0x5caec6[_0x54a6('0x20')]=_0x8be8a1;if(_0x449682['query']['includeAll']){_0x33b06b['include']=[{'all':!![]}];}return db[_0x54a6('0x2c')][_0x54a6('0x3f')](_0x33b06b);})[_0x54a6('0x25')](function(_0x56b598){_0x5caec6[_0x54a6('0x40')]=_0x56b598;return _0x5caec6;})[_0x54a6('0x25')](respondWithFilteredResult(_0x527885,_0x33b06b))[_0x54a6('0x41')](handleError(_0x527885,null));};exports[_0x54a6('0x42')]=function(_0x447f90,_0xdf4674){var _0x1812cc={'raw':!![],'where':{'id':_0x447f90[_0x54a6('0x43')]['id']}},_0x222bc7={};_0x222bc7[_0x54a6('0x30')]=_['keys'](db[_0x54a6('0x2c')]['rawAttributes']);_0x222bc7[_0x54a6('0x31')]=_[_0x54a6('0x44')](_0x447f90[_0x54a6('0x31')]);_0x222bc7[_0x54a6('0x32')]=_[_0x54a6('0x33')](_0x222bc7[_0x54a6('0x30')],_0x222bc7[_0x54a6('0x31')]);_0x1812cc[_0x54a6('0x35')]=_[_0x54a6('0x33')](_0x222bc7[_0x54a6('0x30')],qs['fields'](_0x447f90[_0x54a6('0x31')]['fields']));_0x1812cc['attributes']=_0x1812cc[_0x54a6('0x35')]['length']?_0x1812cc[_0x54a6('0x35')]:_0x222bc7[_0x54a6('0x30')];if(_0x447f90[_0x54a6('0x31')]['includeAll']){_0x1812cc['include']=[{'all':!![]}];}_0x1812cc=_['merge']({},_0x1812cc,_0x447f90[_0x54a6('0x3e')]);return db['SmsApplication'][_0x54a6('0x45')](_0x1812cc)[_0x54a6('0x25')](handleEntityNotFound(_0xdf4674,null))[_0x54a6('0x25')](respondWithResult(_0xdf4674,null))[_0x54a6('0x41')](handleError(_0xdf4674,null));};exports[_0x54a6('0x46')]=function(_0x5e3703,_0xde2d12){return db[_0x54a6('0x2c')][_0x54a6('0x46')](_0x5e3703[_0x54a6('0x47')],{})['then'](respondWithResult(_0xde2d12,0xc9))[_0x54a6('0x41')](handleError(_0xde2d12,null));};exports[_0x54a6('0x24')]=function(_0x50f045,_0x537488){if(_0x50f045[_0x54a6('0x47')]['id']){delete _0x50f045['body']['id'];}return db[_0x54a6('0x2c')][_0x54a6('0x45')]({'where':{'id':_0x50f045[_0x54a6('0x43')]['id']}})[_0x54a6('0x25')](handleEntityNotFound(_0x537488,null))[_0x54a6('0x25')](saveUpdates(_0x50f045['body'],null))[_0x54a6('0x25')](respondWithResult(_0x537488,null))['catch'](handleError(_0x537488,null));};exports[_0x54a6('0x48')]=function(_0x5ec618,_0x4db138){return db[_0x54a6('0x2c')][_0x54a6('0x45')]({'where':{'id':_0x5ec618[_0x54a6('0x43')]['id']}})[_0x54a6('0x25')](handleEntityNotFound(_0x4db138,null))[_0x54a6('0x25')](removeEntity(_0x4db138,null))[_0x54a6('0x41')](handleError(_0x4db138,null));}; \ No newline at end of file +var _0x5896=['fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','update','destroy','sendStatus','error','stack','name','index','map','SmsApplication','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','then','rows','catch','show','params','keys','include','find','create','body','rimraf'];(function(_0x6609e6,_0x51e7db){var _0xcad9a6=function(_0x28a784){while(--_0x28a784){_0x6609e6['push'](_0x6609e6['shift']());}};_0xcad9a6(++_0x51e7db);}(_0x5896,0x91));var _0x6589=function(_0x33a5d7,_0x23475b){_0x33a5d7=_0x33a5d7-0x0;var _0x2169fc=_0x5896[_0x33a5d7];return _0x2169fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6589('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6589('0x1'));var rp=require('request-promise');var moment=require(_0x6589('0x2'));var BPromise=require(_0x6589('0x3'));var Mustache=require(_0x6589('0x4'));var util=require('util');var path=require(_0x6589('0x5'));var sox=require(_0x6589('0x6'));var csv=require(_0x6589('0x7'));var ejs=require(_0x6589('0x8'));var fs=require('fs');var fs_extra=require(_0x6589('0x9'));var _=require('lodash');var squel=require(_0x6589('0xa'));var crypto=require(_0x6589('0xb'));var jsforce=require(_0x6589('0xc'));var deskjs=require(_0x6589('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6589('0xe'));var Papa=require(_0x6589('0xf'));var Redis=require(_0x6589('0x10'));var authService=require(_0x6589('0x11'));var qs=require(_0x6589('0x12'));var as=require(_0x6589('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6589('0x14'))('api');var utils=require(_0x6589('0x15'));var config=require(_0x6589('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6589('0x17'))['db'];function respondWithStatusCode(_0x5089fe,_0x16dffe){_0x16dffe=_0x16dffe||0xcc;return function(_0x1a4735){if(_0x1a4735){return _0x5089fe['sendStatus'](_0x16dffe);}return _0x5089fe[_0x6589('0x18')](_0x16dffe)[_0x6589('0x19')]();};}function respondWithResult(_0x432af2,_0x24e812){_0x24e812=_0x24e812||0xc8;return function(_0x2a8694){if(_0x2a8694){return _0x432af2['status'](_0x24e812)['json'](_0x2a8694);}};}function respondWithFilteredResult(_0x42ac55,_0x1ba555){return function(_0x109e9d){if(_0x109e9d){var _0x28a763=typeof _0x1ba555['offset']===_0x6589('0x1a')&&typeof _0x1ba555[_0x6589('0x1b')]===_0x6589('0x1a');var _0x1f0e57=_0x109e9d[_0x6589('0x1c')];var _0x17c408=_0x28a763?0x0:_0x1ba555[_0x6589('0x1d')];var _0x1adb28=_0x28a763?_0x109e9d['count']:_0x1ba555[_0x6589('0x1d')]+_0x1ba555[_0x6589('0x1b')];var _0x528191;if(_0x1adb28>=_0x1f0e57){_0x1adb28=_0x1f0e57;_0x528191=0xc8;}else{_0x528191=0xce;}_0x42ac55[_0x6589('0x18')](_0x528191);return _0x42ac55[_0x6589('0x1e')](_0x6589('0x1f'),_0x17c408+'-'+_0x1adb28+'/'+_0x1f0e57)[_0x6589('0x20')](_0x109e9d);}return null;};}function patchUpdates(_0x950b3b){return function(_0x45e80b){try{jsonpatch['apply'](_0x45e80b,_0x950b3b,!![]);}catch(_0x329633){return BPromise[_0x6589('0x21')](_0x329633);}return _0x45e80b['save']();};}function saveUpdates(_0x391454,_0x3ad5d6){return function(_0x116fa3){if(_0x116fa3){return _0x116fa3[_0x6589('0x22')](_0x391454)['then'](function(_0x26ad25){return _0x26ad25;});}return null;};}function removeEntity(_0x249106,_0x2fbbe4){return function(_0x29cf6e){if(_0x29cf6e){return _0x29cf6e[_0x6589('0x23')]()['then'](function(){_0x249106[_0x6589('0x18')](0xcc)[_0x6589('0x19')]();});}};}function handleEntityNotFound(_0x524b23,_0x7262d1){return function(_0x482c2a){if(!_0x482c2a){_0x524b23[_0x6589('0x24')](0x194);}return _0x482c2a;};}function handleError(_0x42c380,_0x541d75){_0x541d75=_0x541d75||0x1f4;return function(_0x18b812){logger[_0x6589('0x25')](_0x18b812[_0x6589('0x26')]);if(_0x18b812[_0x6589('0x27')]){delete _0x18b812[_0x6589('0x27')];}_0x42c380['status'](_0x541d75)['send'](_0x18b812);};}exports[_0x6589('0x28')]=function(_0x5d2ad3,_0x21696c){var _0x2e4a41={},_0x3a5461={},_0x3b7617={'count':0x0,'rows':[]};var _0x2198e0=_[_0x6589('0x29')](db[_0x6589('0x2a')][_0x6589('0x2b')],function(_0xfaa95f){return{'name':_0xfaa95f['fieldName'],'type':_0xfaa95f[_0x6589('0x2c')][_0x6589('0x2d')]};});_0x3a5461[_0x6589('0x2e')]=_['map'](_0x2198e0,_0x6589('0x27'));_0x3a5461[_0x6589('0x2f')]=_['keys'](_0x5d2ad3[_0x6589('0x2f')]);_0x3a5461[_0x6589('0x30')]=_[_0x6589('0x31')](_0x3a5461[_0x6589('0x2e')],_0x3a5461[_0x6589('0x2f')]);_0x2e4a41['attributes']=_[_0x6589('0x31')](_0x3a5461['model'],qs[_0x6589('0x32')](_0x5d2ad3['query'][_0x6589('0x32')]));_0x2e4a41[_0x6589('0x33')]=_0x2e4a41[_0x6589('0x33')][_0x6589('0x34')]?_0x2e4a41[_0x6589('0x33')]:_0x3a5461[_0x6589('0x2e')];if(!_0x5d2ad3['query']['hasOwnProperty'](_0x6589('0x35'))){_0x2e4a41[_0x6589('0x1b')]=qs[_0x6589('0x1b')](_0x5d2ad3[_0x6589('0x2f')][_0x6589('0x1b')]);_0x2e4a41[_0x6589('0x1d')]=qs[_0x6589('0x1d')](_0x5d2ad3['query'][_0x6589('0x1d')]);}_0x2e4a41[_0x6589('0x36')]=qs[_0x6589('0x37')](_0x5d2ad3[_0x6589('0x2f')][_0x6589('0x37')]);_0x2e4a41['where']=qs['filters'](_[_0x6589('0x38')](_0x5d2ad3[_0x6589('0x2f')],_0x3a5461[_0x6589('0x30')]),_0x2198e0);if(_0x5d2ad3[_0x6589('0x2f')][_0x6589('0x39')]){_0x2e4a41[_0x6589('0x3a')]=_[_0x6589('0x3b')](_0x2e4a41[_0x6589('0x3a')],{'$or':_[_0x6589('0x29')](_0x2198e0,function(_0x20d4f9){if(_0x20d4f9[_0x6589('0x2c')]!==_0x6589('0x3c')){var _0xeea491={};_0xeea491[_0x20d4f9[_0x6589('0x27')]]={'$like':'%'+_0x5d2ad3[_0x6589('0x2f')][_0x6589('0x39')]+'%'};return _0xeea491;}})});}_0x2e4a41=_[_0x6589('0x3b')]({},_0x2e4a41,_0x5d2ad3[_0x6589('0x3d')]);var _0x2ead99={'where':_0x2e4a41[_0x6589('0x3a')]};return db['SmsApplication'][_0x6589('0x1c')](_0x2ead99)['then'](function(_0x523e38){_0x3b7617['count']=_0x523e38;if(_0x5d2ad3[_0x6589('0x2f')][_0x6589('0x3e')]){_0x2e4a41['include']=[{'all':!![]}];}return db[_0x6589('0x2a')]['findAll'](_0x2e4a41);})[_0x6589('0x3f')](function(_0xdd5ffd){_0x3b7617[_0x6589('0x40')]=_0xdd5ffd;return _0x3b7617;})[_0x6589('0x3f')](respondWithFilteredResult(_0x21696c,_0x2e4a41))[_0x6589('0x41')](handleError(_0x21696c,null));};exports[_0x6589('0x42')]=function(_0x4d9f41,_0x538756){var _0x3a32d5={'raw':!![],'where':{'id':_0x4d9f41[_0x6589('0x43')]['id']}},_0x3def1d={};_0x3def1d[_0x6589('0x2e')]=_[_0x6589('0x44')](db[_0x6589('0x2a')]['rawAttributes']);_0x3def1d[_0x6589('0x2f')]=_[_0x6589('0x44')](_0x4d9f41[_0x6589('0x2f')]);_0x3def1d[_0x6589('0x30')]=_[_0x6589('0x31')](_0x3def1d[_0x6589('0x2e')],_0x3def1d['query']);_0x3a32d5[_0x6589('0x33')]=_[_0x6589('0x31')](_0x3def1d['model'],qs[_0x6589('0x32')](_0x4d9f41[_0x6589('0x2f')][_0x6589('0x32')]));_0x3a32d5[_0x6589('0x33')]=_0x3a32d5[_0x6589('0x33')]['length']?_0x3a32d5[_0x6589('0x33')]:_0x3def1d[_0x6589('0x2e')];if(_0x4d9f41[_0x6589('0x2f')][_0x6589('0x3e')]){_0x3a32d5[_0x6589('0x45')]=[{'all':!![]}];}_0x3a32d5=_[_0x6589('0x3b')]({},_0x3a32d5,_0x4d9f41[_0x6589('0x3d')]);return db['SmsApplication'][_0x6589('0x46')](_0x3a32d5)[_0x6589('0x3f')](handleEntityNotFound(_0x538756,null))[_0x6589('0x3f')](respondWithResult(_0x538756,null))[_0x6589('0x41')](handleError(_0x538756,null));};exports[_0x6589('0x47')]=function(_0x3b8df9,_0x54151d){return db[_0x6589('0x2a')][_0x6589('0x47')](_0x3b8df9[_0x6589('0x48')],{})[_0x6589('0x3f')](respondWithResult(_0x54151d,0xc9))[_0x6589('0x41')](handleError(_0x54151d,null));};exports[_0x6589('0x22')]=function(_0x49f9e4,_0x5f1d79){if(_0x49f9e4[_0x6589('0x48')]['id']){delete _0x49f9e4[_0x6589('0x48')]['id'];}return db[_0x6589('0x2a')][_0x6589('0x46')]({'where':{'id':_0x49f9e4[_0x6589('0x43')]['id']}})[_0x6589('0x3f')](handleEntityNotFound(_0x5f1d79,null))[_0x6589('0x3f')](saveUpdates(_0x49f9e4[_0x6589('0x48')],null))[_0x6589('0x3f')](respondWithResult(_0x5f1d79,null))[_0x6589('0x41')](handleError(_0x5f1d79,null));};exports['destroy']=function(_0x2f9dc7,_0x3b7d08){return db[_0x6589('0x2a')][_0x6589('0x46')]({'where':{'id':_0x2f9dc7[_0x6589('0x43')]['id']}})[_0x6589('0x3f')](handleEntityNotFound(_0x3b7d08,null))[_0x6589('0x3f')](removeEntity(_0x3b7d08,null))['catch'](handleError(_0x3b7d08,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c277862..ef0360d 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 _0xe555=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path'];(function(_0x1d38d6,_0xc22f76){var _0x4daa28=function(_0x12f77c){while(--_0x12f77c){_0x1d38d6['push'](_0x1d38d6['shift']());}};_0x4daa28(++_0xc22f76);}(_0xe555,0x158));var _0x5e55=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0xe555[_0x47a5bd];return _0x5c2184;};'use strict';var _=require(_0x5e55('0x0'));var util=require(_0x5e55('0x1'));var logger=require('../../config/logger')(_0x5e55('0x2'));var moment=require(_0x5e55('0x3'));var BPromise=require('bluebird');var rp=require(_0x5e55('0x4'));var fs=require('fs');var path=require(_0x5e55('0x5'));var rimraf=require(_0x5e55('0x6'));var config=require(_0x5e55('0x7'));var attributes=require(_0x5e55('0x8'));module[_0x5e55('0x9')]=function(_0x292965,_0x114bc5){return _0x292965[_0x5e55('0xa')](_0x5e55('0xb'),attributes,{'tableName':_0x5e55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5e55('0xd')});}; \ No newline at end of file +var _0x31ee=['./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x17c216,_0x1eed2a){var _0x2b2b39=function(_0x26a65a){while(--_0x26a65a){_0x17c216['push'](_0x17c216['shift']());}};_0x2b2b39(++_0x1eed2a);}(_0x31ee,0xf4));var _0xe31e=function(_0x3bfe35,_0x244208){_0x3bfe35=_0x3bfe35-0x0;var _0x2121a7=_0x31ee[_0x3bfe35];return _0x2121a7;};'use strict';var _=require(_0xe31e('0x0'));var util=require(_0xe31e('0x1'));var logger=require(_0xe31e('0x2'))(_0xe31e('0x3'));var moment=require(_0xe31e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe31e('0x5'));var fs=require('fs');var path=require(_0xe31e('0x6'));var rimraf=require('rimraf');var config=require(_0xe31e('0x7'));var attributes=require(_0xe31e('0x8'));module[_0xe31e('0x9')]=function(_0x1483aa,_0x10de21){return _0x1483aa[_0xe31e('0xa')]('SmsApplication',attributes,{'tableName':_0xe31e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe31e('0xc'),'collate':_0xe31e('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index f797d96..26509c3 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 _0xc6d7=['rpc','../../config/environment','jayson/promise','client','http','request','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x109fb6,_0x5a3dcc){var _0xeab635=function(_0x2b6eb5){while(--_0x2b6eb5){_0x109fb6['push'](_0x109fb6['shift']());}};_0xeab635(++_0x5a3dcc);}(_0xc6d7,0x71));var _0x7c6d=function(_0x2c1652,_0x486126){_0x2c1652=_0x2c1652-0x0;var _0x538562=_0xc6d7[_0x2c1652];return _0x538562;};'use strict';var _=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var moment=require(_0x7c6d('0x2'));var BPromise=require(_0x7c6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x4'))['db'];var utils=require(_0x7c6d('0x5'));var logger=require(_0x7c6d('0x6'))(_0x7c6d('0x7'));var config=require(_0x7c6d('0x8'));var jayson=require(_0x7c6d('0x9'));var client=jayson[_0x7c6d('0xa')][_0x7c6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x446b68,_0x45713e,_0x338f94){return new BPromise(function(_0x1ad7e2,_0x22755d){return client[_0x7c6d('0xc')](_0x446b68,_0x338f94)['then'](function(_0x477a41){logger['info'](_0x7c6d('0xd'),_0x45713e,_0x7c6d('0xe'));logger[_0x7c6d('0xf')](_0x7c6d('0x10'),_0x45713e,'request\x20sent',JSON[_0x7c6d('0x11')](_0x477a41));if(_0x477a41[_0x7c6d('0x12')]){if(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x13')]===0x1f4){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')]['message']);return _0x22755d(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);return _0x1ad7e2(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}else{logger[_0x7c6d('0x15')]('SmsApplication,\x20%s,\x20%s',_0x45713e,_0x7c6d('0xe'));_0x1ad7e2(_0x477a41[_0x7c6d('0x16')]['message']);}})[_0x7c6d('0x17')](function(_0x220bae){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x220bae);_0x22755d(_0x220bae);});});} \ No newline at end of file +var _0xa282=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash'];(function(_0x1f80eb,_0x4fefa6){var _0xd2634f=function(_0x2cbcdf){while(--_0x2cbcdf){_0x1f80eb['push'](_0x1f80eb['shift']());}};_0xd2634f(++_0x4fefa6);}(_0xa282,0x1f3));var _0x2a28=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa282[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x2a28('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2a28('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a28('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a28('0x3'));var logger=require(_0x2a28('0x4'))(_0x2a28('0x5'));var config=require(_0x2a28('0x6'));var jayson=require(_0x2a28('0x7'));var client=jayson[_0x2a28('0x8')][_0x2a28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36635c,_0x3d379c,_0x84908){return new BPromise(function(_0x24c7f5,_0x91d789){return client[_0x2a28('0xa')](_0x36635c,_0x84908)['then'](function(_0x1e20b3){logger['info'](_0x2a28('0xb'),_0x3d379c,_0x2a28('0xc'));logger[_0x2a28('0xd')](_0x2a28('0xe'),_0x3d379c,_0x2a28('0xc'),JSON[_0x2a28('0xf')](_0x1e20b3));if(_0x1e20b3[_0x2a28('0x10')]){if(_0x1e20b3['error']['code']===0x1f4){logger[_0x2a28('0x10')]('SmsApplication,\x20%s,\x20%s',_0x3d379c,_0x1e20b3[_0x2a28('0x10')][_0x2a28('0x11')]);return _0x91d789(_0x1e20b3[_0x2a28('0x10')][_0x2a28('0x11')]);}logger[_0x2a28('0x10')]('SmsApplication,\x20%s,\x20%s',_0x3d379c,_0x1e20b3['error'][_0x2a28('0x11')]);return _0x24c7f5(_0x1e20b3[_0x2a28('0x10')]['message']);}else{logger[_0x2a28('0x12')](_0x2a28('0xb'),_0x3d379c,'request\x20sent');_0x24c7f5(_0x1e20b3['result'][_0x2a28('0x11')]);}})[_0x2a28('0x13')](function(_0x506493){logger[_0x2a28('0x10')](_0x2a28('0xb'),_0x3d379c,_0x506493);_0x91d789(_0x506493);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 827c5b7..6c1e007 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 _0x5eb8=['smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0xc44092,_0x54adf0){var _0x52253a=function(_0x243d00){while(--_0x243d00){_0xc44092['push'](_0xc44092['shift']());}};_0x52253a(++_0x54adf0);}(_0x5eb8,0xb0));var _0x85eb=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x5eb8[_0xd09668];return _0x68726;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x15')]);router[_0x85eb('0x14')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller['addMessage']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),interaction[_0x85eb('0x17')](_0x85eb('0x18'),_0x85eb('0x19')),controller[_0x85eb('0x1a')]);router[_0x85eb('0x1b')]('/:id',auth[_0x85eb('0xa')](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1c')),controller[_0x85eb('0x1d')]);router[_0x85eb('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1f')),controller[_0x85eb('0x20')]);router[_0x85eb('0x1e')](_0x85eb('0x16'),auth[_0x85eb('0xa')](),controller['removeTags']);module[_0x85eb('0x21')]=router; \ No newline at end of file +var _0x087b=['sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked'];(function(_0x2d3b0a,_0x21d953){var _0x363102=function(_0x5dddac){while(--_0x5dddac){_0x2d3b0a['push'](_0x2d3b0a['shift']());}};_0x363102(++_0x21d953);}(_0x087b,0x11a));var _0xb087=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x087b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/messages',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x12')]('/',auth['isAuthenticated'](),controller[_0xb087('0x13')]);router[_0xb087('0x12')](_0xb087('0x14'),auth['isAuthenticated'](),controller[_0xb087('0x15')]);router[_0xb087('0x12')](_0xb087('0x16'),auth[_0xb087('0x9')](),interaction[_0xb087('0x17')](_0xb087('0x18'),_0xb087('0x19')),controller[_0xb087('0x1a')]);router[_0xb087('0x1b')](_0xb087('0xd'),auth['isAuthenticated'](),interaction[_0xb087('0x17')](_0xb087('0x18'),'smsinteraction:update'),controller[_0xb087('0x1c')]);router[_0xb087('0x1d')](_0xb087('0xd'),auth['isAuthenticated'](),interaction[_0xb087('0x17')](_0xb087('0x18'),_0xb087('0x1e')),controller[_0xb087('0x1f')]);router['delete'](_0xb087('0x16'),auth[_0xb087('0x9')](),controller[_0xb087('0x20')]);module[_0xb087('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index c9a48ab..ecf18a6 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 _0x6888=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x32f776,_0x1bf7e6){var _0xa9f55=function(_0x3a1045){while(--_0x3a1045){_0x32f776['push'](_0x32f776['shift']());}};_0xa9f55(++_0x1bf7e6);}(_0x6888,0xd2));var _0x8688=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6888[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x8688('0x0'));var moment=require('moment');module[_0x8688('0x1')]={'closed':{'type':Sequelize[_0x8688('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8688('0x3')]},'disposition':{'type':Sequelize[_0x8688('0x4')]},'secondDisposition':{'type':Sequelize[_0x8688('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8688('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8688('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8688('0x5')]('in',_0x8688('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8688('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8688('0x5')]('in',_0x8688('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8688('0x7')]}}; \ No newline at end of file +var _0xdf4d=['ENUM','BOOLEAN','INTEGER','moment','exports','DATE','STRING','out'];(function(_0x49f72d,_0x315dc6){var _0x4e1123=function(_0x37464b){while(--_0x37464b){_0x49f72d['push'](_0x49f72d['shift']());}};_0x4e1123(++_0x315dc6);}(_0xdf4d,0xcb));var _0xddf4=function(_0x4e11f,_0x1522cc){_0x4e11f=_0x4e11f-0x0;var _0x4240c3=_0xdf4d[_0x4e11f];return _0x4240c3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xddf4('0x0'));module[_0xddf4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xddf4('0x2')]},'disposition':{'type':Sequelize[_0xddf4('0x3')]},'secondDisposition':{'type':Sequelize[_0xddf4('0x3')]},'thirdDisposition':{'type':Sequelize[_0xddf4('0x3')]},'note':{'type':Sequelize[_0xddf4('0x3')]},'phone':{'type':Sequelize[_0xddf4('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xddf4('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xddf4('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xddf4('0x5')]('in',_0xddf4('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xddf4('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xddf4('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 70f9343..7316038 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 _0xf213=['direction','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','err','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','create','body','describe','SmsMessage','addMessage','ids','getMessages','findOne','keys','filters','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','omit','Tag','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','transcript-%d-%s.zip','User','push','CmContact','Contact','lastName','createdAt','secret','read','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','Messages'];(function(_0x4e7d69,_0x52aba3){var _0x4e54b3=function(_0x4a2f9f){while(--_0x4a2f9f){_0x4e7d69['push'](_0x4e7d69['shift']());}};_0x4e54b3(++_0x52aba3);}(_0xf213,0xfa));var _0x3f21=function(_0x11fa5c,_0x2398c2){_0x11fa5c=_0x11fa5c-0x0;var _0x2b6588=_0xf213[_0x11fa5c];return _0x2b6588;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x3f21('0x0'));var BPromise=require('bluebird');var util=require(_0x3f21('0x1'));var path=require(_0x3f21('0x2'));var ejs=require(_0x3f21('0x3'));var fs=require('fs');var _=require(_0x3f21('0x4'));var Redis=require(_0x3f21('0x5'));var interaction=require(_0x3f21('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x3f21('0x7'))(_0x3f21('0x8'));var config=require(_0x3f21('0x9'));var db=require(_0x3f21('0xa'))['db'];config[_0x3f21('0xb')]=_[_0x3f21('0xc')](config[_0x3f21('0xb')],{'host':_0x3f21('0xd'),'port':0x18eb});var socket=require(_0x3f21('0xe'))(new Redis(config[_0x3f21('0xb')]));require('./smsInteraction.socket')[_0x3f21('0xf')](socket);function respondWithStatusCode(_0x4fd48e,_0x307a09){_0x307a09=_0x307a09||0xcc;return function(_0x2cd6d4){if(_0x2cd6d4){return _0x4fd48e[_0x3f21('0x10')](_0x307a09);}return _0x4fd48e[_0x3f21('0x11')](_0x307a09)[_0x3f21('0x12')]();};}function respondWithResult(_0x45cb99,_0x5779aa){_0x5779aa=_0x5779aa||0xc8;return function(_0xa72737){if(_0xa72737){return _0x45cb99[_0x3f21('0x11')](_0x5779aa)['json'](_0xa72737);}};}function respondWithFilteredResult(_0x70b648,_0xe61300){return function(_0x1401cd){if(_0x1401cd){var _0x1a8faf=typeof _0xe61300[_0x3f21('0x13')]===_0x3f21('0x14')&&typeof _0xe61300[_0x3f21('0x15')]===_0x3f21('0x14');var _0x4af787=_0x1401cd[_0x3f21('0x16')];var _0x2c7def=_0x1a8faf?0x0:_0xe61300[_0x3f21('0x13')];var _0x4f4889=_0x1a8faf?_0x1401cd[_0x3f21('0x16')]:_0xe61300['offset']+_0xe61300[_0x3f21('0x15')];var _0x517598;if(_0x4f4889>=_0x4af787){_0x4f4889=_0x4af787;_0x517598=0xc8;}else{_0x517598=0xce;}_0x70b648['status'](_0x517598);return _0x70b648[_0x3f21('0x17')](_0x3f21('0x18'),_0x2c7def+'-'+_0x4f4889+'/'+_0x4af787)[_0x3f21('0x19')](_0x1401cd);}return null;};}function saveUpdates(_0xceb612){return function(_0x1218d0){if(_0x1218d0){return _0x1218d0[_0x3f21('0x1a')](_0xceb612)['then'](function(_0x53a279){return _0x53a279;});}return null;};}function removeEntity(_0x3f1fb3){return function(_0x929a9b){if(_0x929a9b){return _0x929a9b[_0x3f21('0x1b')]()[_0x3f21('0x1c')](function(){_0x3f1fb3[_0x3f21('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x314343){return function(_0x1feeb2){if(!_0x1feeb2){_0x314343['sendStatus'](0x194);}return _0x1feeb2;};}function handleError(_0x500391,_0x5cb773){_0x5cb773=_0x5cb773||0x1f4;return function(_0x429d64){logger[_0x3f21('0x1d')](_0x429d64[_0x3f21('0x1e')]);if(_0x429d64[_0x3f21('0x1f')]){delete _0x429d64[_0x3f21('0x1f')];}_0x500391[_0x3f21('0x11')](_0x5cb773)[_0x3f21('0x20')](_0x429d64);};}exports[_0x3f21('0x21')]=function(_0x2614a6,_0x39d9f3){var _0x45997c={};var _0xc43490=_[_0x3f21('0x22')](db[_0x3f21('0x23')][_0x3f21('0x24')],function(_0x3e1bc6){return{'name':_0x3e1bc6[_0x3f21('0x25')],'type':_0x3e1bc6[_0x3f21('0x26')][_0x3f21('0x27')]};});_0x45997c=qs[_0x3f21('0x28')](_0xc43490,_0x2614a6);return interaction[_0x3f21('0x29')](_0x3f21('0x2a'),_0x2614a6[_0x3f21('0x2b')],_0x2614a6[_0x3f21('0x2c')],_0x45997c,_0xc43490)[_0x3f21('0x1c')](respondWithFilteredResult(_0x39d9f3,_0x45997c))[_0x3f21('0x2d')](handleError(_0x39d9f3,null));};exports[_0x3f21('0x2e')]=function(_0x3855c5,_0x18da11){var _0x42d382={'raw':![],'where':{'id':_0x3855c5[_0x3f21('0x2f')]['id']}},_0x5ba621={};_0x5ba621['model']=_['keys'](db[_0x3f21('0x23')][_0x3f21('0x24')]);_0x5ba621[_0x3f21('0x2b')]=_['keys'](_0x3855c5[_0x3f21('0x2b')]);_0x5ba621['filters']=_[_0x3f21('0x30')](_0x5ba621['model'],_0x5ba621[_0x3f21('0x2b')]);_0x42d382[_0x3f21('0x31')]=_[_0x3f21('0x30')](_0x5ba621[_0x3f21('0x32')],qs[_0x3f21('0x33')](_0x3855c5[_0x3f21('0x2b')]['fields']));_0x42d382['attributes']=_0x42d382[_0x3f21('0x31')][_0x3f21('0x34')]?_0x42d382['attributes']:_0x5ba621[_0x3f21('0x32')];if(_0x3855c5[_0x3f21('0x2b')][_0x3f21('0x35')]){_0x42d382[_0x3f21('0x36')]=[{'all':!![]}];}_0x42d382=_[_0x3f21('0x37')]({},_0x42d382,_0x3855c5[_0x3f21('0x38')]);return db[_0x3f21('0x23')][_0x3f21('0x39')](_0x42d382)[_0x3f21('0x1c')](handleEntityNotFound(_0x18da11,null))[_0x3f21('0x1c')](respondWithResult(_0x18da11,null))[_0x3f21('0x2d')](handleError(_0x18da11,null));};exports['create']=function(_0x231511,_0x2fd0cb){return db[_0x3f21('0x23')][_0x3f21('0x3a')](_0x231511[_0x3f21('0x3b')],{})[_0x3f21('0x1c')](respondWithResult(_0x2fd0cb,0xc9))[_0x3f21('0x2d')](handleError(_0x2fd0cb,null));};exports[_0x3f21('0x1a')]=function(_0x71fc34,_0x23f55b){if(_0x71fc34[_0x3f21('0x3b')]['id']){delete _0x71fc34[_0x3f21('0x3b')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x71fc34[_0x3f21('0x2f')]['id']}})[_0x3f21('0x1c')](handleEntityNotFound(_0x23f55b,null))[_0x3f21('0x1c')](saveUpdates(_0x71fc34['body'],null))[_0x3f21('0x1c')](respondWithResult(_0x23f55b,null))[_0x3f21('0x2d')](handleError(_0x23f55b,null));};exports[_0x3f21('0x1b')]=function(_0x3ff2cc,_0x413ed3){return db[_0x3f21('0x23')][_0x3f21('0x39')]({'where':{'id':_0x3ff2cc[_0x3f21('0x2f')]['id']}})[_0x3f21('0x1c')](handleEntityNotFound(_0x413ed3,null))['then'](removeEntity(_0x413ed3,null))[_0x3f21('0x2d')](handleError(_0x413ed3,null));};exports['describe']=function(_0x45ff11,_0x318edf){return db[_0x3f21('0x23')][_0x3f21('0x3c')]()[_0x3f21('0x1c')](respondWithResult(_0x318edf,null))[_0x3f21('0x2d')](handleError(_0x318edf,null));};exports['addMessage']=function(_0x247b25,_0x14f3ca){return db[_0x3f21('0x3d')][_0x3f21('0x39')]({'where':{'id':_0x247b25[_0x3f21('0x2f')]['id']}})[_0x3f21('0x1c')](handleEntityNotFound(_0x14f3ca,null))['then'](function(_0x3c158b){if(_0x3c158b){return _0x3c158b[_0x3f21('0x3e')](_0x247b25[_0x3f21('0x3b')][_0x3f21('0x3f')],_['omit'](_0x247b25['body'],[_0x3f21('0x3f'),'id'])||{});}})[_0x3f21('0x1c')](respondWithResult(_0x14f3ca,null))[_0x3f21('0x2d')](handleError(_0x14f3ca,null));};exports[_0x3f21('0x40')]=function(_0x505f6d,_0x213df7){var _0x5ae843={'raw':![],'where':{}};var _0x34378b={};var _0x3cebe5={'count':0x0,'rows':[]};return db[_0x3f21('0x23')][_0x3f21('0x41')]({'where':{'id':_0x505f6d[_0x3f21('0x2f')]['id']}})['then'](handleEntityNotFound(_0x213df7,null))[_0x3f21('0x1c')](function(_0x4a594f){if(_0x4a594f){_0x34378b[_0x3f21('0x32')]=_['keys'](db[_0x3f21('0x3d')][_0x3f21('0x24')]);_0x34378b[_0x3f21('0x2b')]=_[_0x3f21('0x42')](_0x505f6d[_0x3f21('0x2b')]);_0x34378b[_0x3f21('0x43')]=_[_0x3f21('0x30')](_0x34378b[_0x3f21('0x32')],_0x34378b['query']);_0x5ae843[_0x3f21('0x31')]=_[_0x3f21('0x30')](_0x34378b[_0x3f21('0x32')],qs[_0x3f21('0x33')](_0x505f6d['query'][_0x3f21('0x33')]));_0x5ae843[_0x3f21('0x31')]=_0x5ae843[_0x3f21('0x31')][_0x3f21('0x34')]?_0x5ae843[_0x3f21('0x31')]:_0x34378b['model'];if(!_0x505f6d['query'][_0x3f21('0x44')]('nolimit')){_0x5ae843[_0x3f21('0x15')]=qs['limit'](_0x505f6d['query'][_0x3f21('0x15')]);_0x5ae843[_0x3f21('0x13')]=qs[_0x3f21('0x13')](_0x505f6d[_0x3f21('0x2b')][_0x3f21('0x13')]);}_0x5ae843[_0x3f21('0x45')]=qs['sort'](_0x505f6d[_0x3f21('0x2b')][_0x3f21('0x46')]);_0x5ae843[_0x3f21('0x47')]=qs[_0x3f21('0x43')](_[_0x3f21('0x48')](_0x505f6d[_0x3f21('0x2b')],_0x34378b[_0x3f21('0x43')]));_0x5ae843['where'][_0x3f21('0x49')]=_0x4a594f['id'];if(_0x505f6d['query'][_0x3f21('0x4a')]){_0x5ae843[_0x3f21('0x47')]=_[_0x3f21('0x37')](_0x5ae843[_0x3f21('0x47')],{'$or':_['map'](_0x5ae843[_0x3f21('0x31')],function(_0xa8290c){var _0x5f0e89={};_0x5f0e89[_0xa8290c]={'$like':'%'+_0x505f6d[_0x3f21('0x2b')]['filter']+'%'};return _0x5f0e89;})});}if(_0x505f6d[_0x3f21('0x2b')][_0x3f21('0x4b')]){var _0x3b35cb=_0x505f6d[_0x3f21('0x2b')][_0x3f21('0x4b')][_0x3f21('0x4c')](',');var _0x472989={};_0x472989[_0x3b35cb[0x0]]={'$gte':moment(_0x3b35cb[0x1])[_0x3f21('0x4d')](_0x3f21('0x4e'))};_0x5ae843['where']=_[_0x3f21('0x37')](_0x5ae843['where'],_0x472989);}_0x5ae843=_[_0x3f21('0x37')]({},_0x5ae843,_0x505f6d[_0x3f21('0x38')]);return db['SmsMessage'][_0x3f21('0x16')]({'where':_0x5ae843[_0x3f21('0x47')]})[_0x3f21('0x1c')](function(_0x37f8dc){_0x3cebe5[_0x3f21('0x16')]=_0x37f8dc;if(_0x505f6d[_0x3f21('0x2b')][_0x3f21('0x35')]){_0x5ae843['include']=[{'all':!![]}];}return db[_0x3f21('0x3d')]['findAll'](_0x5ae843);})[_0x3f21('0x1c')](function(_0x177e0f){_0x3cebe5[_0x3f21('0x4f')]=_0x177e0f;return _0x3cebe5;});}})[_0x3f21('0x1c')](respondWithFilteredResult(_0x213df7,_0x5ae843))[_0x3f21('0x2d')](handleError(_0x213df7,null));};exports[_0x3f21('0x50')]=function(_0x401640,_0x557f91){return db[_0x3f21('0x23')][_0x3f21('0x39')]({'where':{'id':_0x401640[_0x3f21('0x2f')]['id']}})[_0x3f21('0x1c')](handleEntityNotFound(_0x557f91,null))[_0x3f21('0x1c')](function(_0x4be613){if(_0x4be613){return _0x4be613['setTags'](_0x401640['body'][_0x3f21('0x3f')],_[_0x3f21('0x51')](_0x401640[_0x3f21('0x3b')],[_0x3f21('0x3f'),'id'])||{})['spread'](function(){return db[_0x3f21('0x52')][_0x3f21('0x29')]({'attributes':['id',_0x3f21('0x1f'),'color'],'where':{'id':_0x401640[_0x3f21('0x3b')][_0x3f21('0x3f')]}});})[_0x3f21('0x1c')](function(_0x94981a){socket[_0x3f21('0x53')](_0x3f21('0x54'),{'id':Number(_0x401640['params']['id']),'tags':_0x94981a||[]});return{'id':Number(_0x401640[_0x3f21('0x2f')]['id']),'tags':_0x94981a||[]};});}})[_0x3f21('0x1c')](respondWithResult(_0x557f91,null))['catch'](handleError(_0x557f91,null));};exports[_0x3f21('0x55')]=function(_0x174fba,_0x4df15a){return db['SmsInteraction']['find']({'where':{'id':_0x174fba[_0x3f21('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4df15a,null))[_0x3f21('0x1c')](function(_0x10ebc2){if(_0x10ebc2){return _0x10ebc2[_0x3f21('0x55')](_0x174fba[_0x3f21('0x2b')][_0x3f21('0x3f')]);}})[_0x3f21('0x1c')](respondWithStatusCode(_0x4df15a,null))['catch'](handleError(_0x4df15a,null));};exports[_0x3f21('0x56')]=function(_0x4e7299,_0xdc42ca){var _0x34baa8=moment()[_0x3f21('0x57')]()[_0x3f21('0x58')]();var _0x1a45a0=path[_0x3f21('0x59')](config[_0x3f21('0x5a')],_0x3f21('0x5b'),'files',_0x3f21('0x5c'));var _0x34bee0=path['join'](_0x1a45a0,_0x34baa8);var _0x3dd6d3=util[_0x3f21('0x4d')](_0x3f21('0x5d'),_0x4e7299[_0x3f21('0x2f')]['id'],_0x34baa8);var _0x105a10=path[_0x3f21('0x59')](_0x1a45a0,_0x3dd6d3);var _0x2f8bf9=[];_0x2f8bf9['push']({'model':db[_0x3f21('0x5e')],'as':_0x3f21('0x5e'),'attributes':['id','fullname'],'raw':!![]});_0x2f8bf9[_0x3f21('0x5f')]({'model':db[_0x3f21('0x60')],'as':_0x3f21('0x61'),'attributes':['id','firstName',_0x3f21('0x62')],'raw':!![]});var _0x58715d=[{'model':db[_0x3f21('0x3d')],'as':'Messages','attributes':['id','body',_0x3f21('0x63'),'direction',_0x3f21('0x64'),_0x3f21('0x65')],'include':_0x2f8bf9}];_0x58715d['push']({'model':db[_0x3f21('0x66')],'as':_0x3f21('0x67'),'attributes':['id',_0x3f21('0x1f')]});_0x58715d['push']({'model':db[_0x3f21('0x5e')],'as':'Owner','attributes':['id',_0x3f21('0x68')]});return db[_0x3f21('0x23')][_0x3f21('0x39')]({'where':{'id':_0x4e7299['params']['id']},'include':_0x58715d})[_0x3f21('0x1c')](handleEntityNotFound(_0xdc42ca,null))[_0x3f21('0x1c')](function(_0x716c64){if(_0x716c64){var _0x145223=_0x716c64[_0x3f21('0x69')]({'plain':!![]});fs[_0x3f21('0x6a')](_0x34bee0);var _0x24f8ad={'channel':_0x3f21('0x6b'),'account':_0x145223[_0x3f21('0x67')][_0x3f21('0x1f')],'agent':_0x145223['Owner']?_0x145223[_0x3f21('0x6c')][_0x3f21('0x68')]:_0x3f21('0x6d'),'createdAt':moment(_0x145223[_0x3f21('0x63')])['format'](_0x3f21('0x4e'))['toString'](),'closedAt':_0x145223['closed']?moment(_0x145223[_0x3f21('0x6e')])[_0x3f21('0x4d')](_0x3f21('0x4e'))[_0x3f21('0x58')]():'','disposition':_0x145223[_0x3f21('0x6f')],'messages':_(_0x145223[_0x3f21('0x70')])[_0x3f21('0x4a')]({'secret':![]})[_0x3f21('0x22')](function(_0x531e2b){return{'date':moment(_0x531e2b['createdAt'])[_0x3f21('0x4d')](_0x3f21('0x4e'))[_0x3f21('0x58')](),'sender':_0x531e2b[_0x3f21('0x71')]==='out'?_0x531e2b[_0x3f21('0x5e')]?_0x531e2b[_0x3f21('0x5e')][_0x3f21('0x68')]:'System':_0x531e2b[_0x3f21('0x61')]['firstName']+(_0x531e2b[_0x3f21('0x61')][_0x3f21('0x62')]?'\x20'+_0x531e2b[_0x3f21('0x61')][_0x3f21('0x62')]:''),'body':_0x531e2b[_0x3f21('0x3b')],'direction':_0x531e2b[_0x3f21('0x71')]===_0x3f21('0x72')?'A':'C','secret':_0x531e2b[_0x3f21('0x64')],'read':_0x531e2b['read']};})['value']()};return ejs[_0x3f21('0x73')](path[_0x3f21('0x59')](config[_0x3f21('0x5a')],_0x3f21('0x5b'),'views',_0x3f21('0x74')),{'interaction':_0x24f8ad})['then'](function(_0x2a410f){var _0x163c8c=path['join'](_0x34bee0,_0x3f21('0x75')+_0x145223['id']+'-'+_0x34baa8+_0x3f21('0x76'));var _0xaadad5={'path':_0x163c8c,'channel':'Sms','interactionId':_0x145223['id']};return pdf['createPdfFromHTML'](_0x2a410f,_0xaadad5);})['then'](function(){return new BPromise(function(_0x564f9b,_0x41c78b){zipdir(_0x34bee0,{'saveTo':_0x105a10},function(_0x56eccb,_0x4a31bc){if(_0x56eccb)return _0x41c78b(_0x56eccb);return _0x564f9b(_0x4a31bc);});})[_0x3f21('0x1c')](function(){return new BPromise(function(_0x341952,_0x59758c){rimraf(_0x34bee0,function(_0x28e93e){if(_0x28e93e)_0x59758c(_0x28e93e);return _0x341952();});});})[_0x3f21('0x1c')](function(){return _0xdc42ca[_0x3f21('0x56')](_0x105a10,_0x3dd6d3,function(_0x529f69){if(_0x529f69){console[_0x3f21('0x77')](_0x3f21('0x78'),_0x529f69);}else{fs['unlinkSync'](_0x105a10);}});});});}else{return _0xdc42ca[_0x3f21('0x10')](0xc8);}})[_0x3f21('0x2d')](handleError(_0xdc42ca,null));}; \ No newline at end of file +var _0x62ca=['out','System','lastName','read','renderFile','server','views','downloadInteraction.ejs','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','catch','show','model','keys','attributes','intersection','fields','length','includeAll','include','merge','find','update','body','params','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','filters','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','tmp','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','secret','SmsAccount','Owner','mkdirSync','Account','N.A.','createdAt','closed','closedAt','disposition','Messages','direction'];(function(_0x314d90,_0x44b44e){var _0x2269c9=function(_0x360f06){while(--_0x360f06){_0x314d90['push'](_0x314d90['shift']());}};_0x2269c9(++_0x44b44e);}(_0x62ca,0x18b));var _0xa62c=function(_0x32fba1,_0x485363){_0x32fba1=_0x32fba1-0x0;var _0x32b2b2=_0x62ca[_0x32fba1];return _0x32b2b2;};'use strict';var rimraf=require(_0xa62c('0x0'));var zipdir=require(_0xa62c('0x1'));var moment=require('moment');var BPromise=require(_0xa62c('0x2'));var util=require(_0xa62c('0x3'));var path=require(_0xa62c('0x4'));var ejs=require(_0xa62c('0x5'));var fs=require('fs');var _=require(_0xa62c('0x6'));var Redis=require(_0xa62c('0x7'));var interaction=require(_0xa62c('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xa62c('0x9'));var logger=require(_0xa62c('0xa'))('api');var config=require(_0xa62c('0xb'));var db=require(_0xa62c('0xc'))['db'];config[_0xa62c('0xd')]=_[_0xa62c('0xe')](config['redis'],{'host':_0xa62c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa62c('0xd')]));require(_0xa62c('0x10'))[_0xa62c('0x11')](socket);function respondWithStatusCode(_0x1d52ba,_0x3ada2c){_0x3ada2c=_0x3ada2c||0xcc;return function(_0x5d8359){if(_0x5d8359){return _0x1d52ba[_0xa62c('0x12')](_0x3ada2c);}return _0x1d52ba[_0xa62c('0x13')](_0x3ada2c)[_0xa62c('0x14')]();};}function respondWithResult(_0x176f02,_0x8a8f9e){_0x8a8f9e=_0x8a8f9e||0xc8;return function(_0x357046){if(_0x357046){return _0x176f02[_0xa62c('0x13')](_0x8a8f9e)[_0xa62c('0x15')](_0x357046);}};}function respondWithFilteredResult(_0x3b115f,_0x47580d){return function(_0x1a67da){if(_0x1a67da){var _0x3b1ab1=typeof _0x47580d[_0xa62c('0x16')]===_0xa62c('0x17')&&typeof _0x47580d[_0xa62c('0x18')]===_0xa62c('0x17');var _0x2e465e=_0x1a67da['count'];var _0x58fa74=_0x3b1ab1?0x0:_0x47580d[_0xa62c('0x16')];var _0x1aab9=_0x3b1ab1?_0x1a67da[_0xa62c('0x19')]:_0x47580d['offset']+_0x47580d[_0xa62c('0x18')];var _0x5a59b5;if(_0x1aab9>=_0x2e465e){_0x1aab9=_0x2e465e;_0x5a59b5=0xc8;}else{_0x5a59b5=0xce;}_0x3b115f[_0xa62c('0x13')](_0x5a59b5);return _0x3b115f[_0xa62c('0x1a')](_0xa62c('0x1b'),_0x58fa74+'-'+_0x1aab9+'/'+_0x2e465e)[_0xa62c('0x15')](_0x1a67da);}return null;};}function saveUpdates(_0x13489d){return function(_0x51050a){if(_0x51050a){return _0x51050a['update'](_0x13489d)[_0xa62c('0x1c')](function(_0x2689b3){return _0x2689b3;});}return null;};}function removeEntity(_0x34f3ef){return function(_0x56e5c4){if(_0x56e5c4){return _0x56e5c4[_0xa62c('0x1d')]()['then'](function(){_0x34f3ef['status'](0xcc)[_0xa62c('0x14')]();});}};}function handleEntityNotFound(_0x2e7c43){return function(_0x599442){if(!_0x599442){_0x2e7c43[_0xa62c('0x12')](0x194);}return _0x599442;};}function handleError(_0x250d2d,_0x579419){_0x579419=_0x579419||0x1f4;return function(_0x25d72e){logger[_0xa62c('0x1e')](_0x25d72e[_0xa62c('0x1f')]);if(_0x25d72e[_0xa62c('0x20')]){delete _0x25d72e[_0xa62c('0x20')];}_0x250d2d[_0xa62c('0x13')](_0x579419)[_0xa62c('0x21')](_0x25d72e);};}exports[_0xa62c('0x22')]=function(_0x4f8b25,_0x6f2910){var _0x4c4c6c={};var _0x1a59a7=_[_0xa62c('0x23')](db[_0xa62c('0x24')][_0xa62c('0x25')],function(_0x1ac058){return{'name':_0x1ac058[_0xa62c('0x26')],'type':_0x1ac058[_0xa62c('0x27')][_0xa62c('0x28')]};});_0x4c4c6c=qs[_0xa62c('0x29')](_0x1a59a7,_0x4f8b25);return interaction[_0xa62c('0x2a')](_0xa62c('0x2b'),_0x4f8b25[_0xa62c('0x2c')],_0x4f8b25['user'],_0x4c4c6c,_0x1a59a7)['then'](respondWithFilteredResult(_0x6f2910,_0x4c4c6c))[_0xa62c('0x2d')](handleError(_0x6f2910,null));};exports[_0xa62c('0x2e')]=function(_0x5ac4c2,_0x5db71b){var _0x2aa824={'raw':![],'where':{'id':_0x5ac4c2['params']['id']}},_0x1e7402={};_0x1e7402[_0xa62c('0x2f')]=_[_0xa62c('0x30')](db[_0xa62c('0x24')][_0xa62c('0x25')]);_0x1e7402[_0xa62c('0x2c')]=_[_0xa62c('0x30')](_0x5ac4c2[_0xa62c('0x2c')]);_0x1e7402['filters']=_['intersection'](_0x1e7402[_0xa62c('0x2f')],_0x1e7402['query']);_0x2aa824[_0xa62c('0x31')]=_[_0xa62c('0x32')](_0x1e7402[_0xa62c('0x2f')],qs['fields'](_0x5ac4c2[_0xa62c('0x2c')][_0xa62c('0x33')]));_0x2aa824[_0xa62c('0x31')]=_0x2aa824['attributes'][_0xa62c('0x34')]?_0x2aa824[_0xa62c('0x31')]:_0x1e7402[_0xa62c('0x2f')];if(_0x5ac4c2[_0xa62c('0x2c')][_0xa62c('0x35')]){_0x2aa824[_0xa62c('0x36')]=[{'all':!![]}];}_0x2aa824=_[_0xa62c('0x37')]({},_0x2aa824,_0x5ac4c2['options']);return db[_0xa62c('0x24')][_0xa62c('0x38')](_0x2aa824)[_0xa62c('0x1c')](handleEntityNotFound(_0x5db71b,null))[_0xa62c('0x1c')](respondWithResult(_0x5db71b,null))[_0xa62c('0x2d')](handleError(_0x5db71b,null));};exports['create']=function(_0x120b81,_0x45746e){return db[_0xa62c('0x24')]['create'](_0x120b81['body'],{})[_0xa62c('0x1c')](respondWithResult(_0x45746e,0xc9))[_0xa62c('0x2d')](handleError(_0x45746e,null));};exports[_0xa62c('0x39')]=function(_0x5bdde5,_0x786f65){if(_0x5bdde5[_0xa62c('0x3a')]['id']){delete _0x5bdde5[_0xa62c('0x3a')]['id'];}return db[_0xa62c('0x24')][_0xa62c('0x38')]({'where':{'id':_0x5bdde5[_0xa62c('0x3b')]['id']}})[_0xa62c('0x1c')](handleEntityNotFound(_0x786f65,null))['then'](saveUpdates(_0x5bdde5['body'],null))['then'](respondWithResult(_0x786f65,null))[_0xa62c('0x2d')](handleError(_0x786f65,null));};exports[_0xa62c('0x1d')]=function(_0x345dcc,_0x230c02){return db[_0xa62c('0x24')][_0xa62c('0x38')]({'where':{'id':_0x345dcc[_0xa62c('0x3b')]['id']}})[_0xa62c('0x1c')](handleEntityNotFound(_0x230c02,null))[_0xa62c('0x1c')](removeEntity(_0x230c02,null))[_0xa62c('0x2d')](handleError(_0x230c02,null));};exports['describe']=function(_0x41e7c6,_0x34adef){return db[_0xa62c('0x24')][_0xa62c('0x3c')]()[_0xa62c('0x1c')](respondWithResult(_0x34adef,null))[_0xa62c('0x2d')](handleError(_0x34adef,null));};exports[_0xa62c('0x3d')]=function(_0x4fe5dc,_0x4da6f2){return db['SmsMessage'][_0xa62c('0x38')]({'where':{'id':_0x4fe5dc[_0xa62c('0x3b')]['id']}})[_0xa62c('0x1c')](handleEntityNotFound(_0x4da6f2,null))[_0xa62c('0x1c')](function(_0x4ecaec){if(_0x4ecaec){return _0x4ecaec[_0xa62c('0x3d')](_0x4fe5dc[_0xa62c('0x3a')][_0xa62c('0x3e')],_[_0xa62c('0x3f')](_0x4fe5dc[_0xa62c('0x3a')],[_0xa62c('0x3e'),'id'])||{});}})[_0xa62c('0x1c')](respondWithResult(_0x4da6f2,null))[_0xa62c('0x2d')](handleError(_0x4da6f2,null));};exports[_0xa62c('0x40')]=function(_0x55b543,_0xc367b8){var _0x11a1c5={'raw':![],'where':{}};var _0x36e8f5={};var _0x2d1cd8={'count':0x0,'rows':[]};return db[_0xa62c('0x24')][_0xa62c('0x41')]({'where':{'id':_0x55b543[_0xa62c('0x3b')]['id']}})[_0xa62c('0x1c')](handleEntityNotFound(_0xc367b8,null))[_0xa62c('0x1c')](function(_0x38d691){if(_0x38d691){_0x36e8f5['model']=_['keys'](db[_0xa62c('0x42')][_0xa62c('0x25')]);_0x36e8f5['query']=_[_0xa62c('0x30')](_0x55b543[_0xa62c('0x2c')]);_0x36e8f5[_0xa62c('0x43')]=_[_0xa62c('0x32')](_0x36e8f5[_0xa62c('0x2f')],_0x36e8f5[_0xa62c('0x2c')]);_0x11a1c5[_0xa62c('0x31')]=_[_0xa62c('0x32')](_0x36e8f5[_0xa62c('0x2f')],qs[_0xa62c('0x33')](_0x55b543[_0xa62c('0x2c')]['fields']));_0x11a1c5['attributes']=_0x11a1c5['attributes'][_0xa62c('0x34')]?_0x11a1c5[_0xa62c('0x31')]:_0x36e8f5['model'];if(!_0x55b543[_0xa62c('0x2c')][_0xa62c('0x44')](_0xa62c('0x45'))){_0x11a1c5['limit']=qs['limit'](_0x55b543[_0xa62c('0x2c')][_0xa62c('0x18')]);_0x11a1c5['offset']=qs[_0xa62c('0x16')](_0x55b543['query'][_0xa62c('0x16')]);}_0x11a1c5[_0xa62c('0x46')]=qs['sort'](_0x55b543[_0xa62c('0x2c')][_0xa62c('0x47')]);_0x11a1c5[_0xa62c('0x48')]=qs['filters'](_[_0xa62c('0x49')](_0x55b543[_0xa62c('0x2c')],_0x36e8f5[_0xa62c('0x43')]));_0x11a1c5['where'][_0xa62c('0x4a')]=_0x38d691['id'];if(_0x55b543[_0xa62c('0x2c')][_0xa62c('0x4b')]){_0x11a1c5[_0xa62c('0x48')]=_['merge'](_0x11a1c5['where'],{'$or':_[_0xa62c('0x23')](_0x11a1c5['attributes'],function(_0x40f784){var _0x303003={};_0x303003[_0x40f784]={'$like':'%'+_0x55b543[_0xa62c('0x2c')]['filter']+'%'};return _0x303003;})});}if(_0x55b543['query'][_0xa62c('0x4c')]){var _0x10e338=_0x55b543['query'][_0xa62c('0x4c')]['split'](',');var _0x3ab0d5={};_0x3ab0d5[_0x10e338[0x0]]={'$gte':moment(_0x10e338[0x1])['format'](_0xa62c('0x4d'))};_0x11a1c5[_0xa62c('0x48')]=_[_0xa62c('0x37')](_0x11a1c5['where'],_0x3ab0d5);}_0x11a1c5=_[_0xa62c('0x37')]({},_0x11a1c5,_0x55b543[_0xa62c('0x4e')]);return db['SmsMessage'][_0xa62c('0x19')]({'where':_0x11a1c5[_0xa62c('0x48')]})[_0xa62c('0x1c')](function(_0x17b6ec){_0x2d1cd8['count']=_0x17b6ec;if(_0x55b543[_0xa62c('0x2c')][_0xa62c('0x35')]){_0x11a1c5[_0xa62c('0x36')]=[{'all':!![]}];}return db[_0xa62c('0x42')]['findAll'](_0x11a1c5);})[_0xa62c('0x1c')](function(_0xe47a75){_0x2d1cd8[_0xa62c('0x4f')]=_0xe47a75;return _0x2d1cd8;});}})[_0xa62c('0x1c')](respondWithFilteredResult(_0xc367b8,_0x11a1c5))[_0xa62c('0x2d')](handleError(_0xc367b8,null));};exports[_0xa62c('0x50')]=function(_0x37ab0c,_0x49e65a){return db[_0xa62c('0x24')][_0xa62c('0x38')]({'where':{'id':_0x37ab0c['params']['id']}})[_0xa62c('0x1c')](handleEntityNotFound(_0x49e65a,null))[_0xa62c('0x1c')](function(_0x280458){if(_0x280458){return _0x280458[_0xa62c('0x51')](_0x37ab0c['body'][_0xa62c('0x3e')],_[_0xa62c('0x3f')](_0x37ab0c[_0xa62c('0x3a')],[_0xa62c('0x3e'),'id'])||{})[_0xa62c('0x52')](function(){return db[_0xa62c('0x53')][_0xa62c('0x2a')]({'attributes':['id','name',_0xa62c('0x54')],'where':{'id':_0x37ab0c[_0xa62c('0x3a')][_0xa62c('0x3e')]}});})[_0xa62c('0x1c')](function(_0x558417){socket[_0xa62c('0x55')](_0xa62c('0x56'),{'id':Number(_0x37ab0c[_0xa62c('0x3b')]['id']),'tags':_0x558417||[]});return{'id':Number(_0x37ab0c['params']['id']),'tags':_0x558417||[]};});}})['then'](respondWithResult(_0x49e65a,null))[_0xa62c('0x2d')](handleError(_0x49e65a,null));};exports[_0xa62c('0x57')]=function(_0x3a4edb,_0x210420){return db[_0xa62c('0x24')][_0xa62c('0x38')]({'where':{'id':_0x3a4edb['params']['id']}})[_0xa62c('0x1c')](handleEntityNotFound(_0x210420,null))[_0xa62c('0x1c')](function(_0x2e1009){if(_0x2e1009){return _0x2e1009[_0xa62c('0x57')](_0x3a4edb[_0xa62c('0x2c')][_0xa62c('0x3e')]);}})[_0xa62c('0x1c')](respondWithStatusCode(_0x210420,null))['catch'](handleError(_0x210420,null));};exports[_0xa62c('0x58')]=function(_0x15cfe7,_0x566416){var _0x212f92=moment()[_0xa62c('0x59')]()[_0xa62c('0x5a')]();var _0x36e543=path[_0xa62c('0x5b')](config[_0xa62c('0x5c')],'server','files',_0xa62c('0x5d'));var _0x522de0=path[_0xa62c('0x5b')](_0x36e543,_0x212f92);var _0x225a54=util[_0xa62c('0x5e')](_0xa62c('0x5f'),_0x15cfe7[_0xa62c('0x3b')]['id'],_0x212f92);var _0x18b00c=path[_0xa62c('0x5b')](_0x36e543,_0x225a54);var _0x503625=[];_0x503625[_0xa62c('0x60')]({'model':db[_0xa62c('0x61')],'as':_0xa62c('0x61'),'attributes':['id',_0xa62c('0x62')],'raw':!![]});_0x503625[_0xa62c('0x60')]({'model':db['CmContact'],'as':_0xa62c('0x63'),'attributes':['id',_0xa62c('0x64'),'lastName'],'raw':!![]});var _0x4bb3e9=[{'model':db[_0xa62c('0x42')],'as':'Messages','attributes':['id',_0xa62c('0x3a'),'createdAt','direction',_0xa62c('0x65'),'read'],'include':_0x503625}];_0x4bb3e9[_0xa62c('0x60')]({'model':db[_0xa62c('0x66')],'as':'Account','attributes':['id','name']});_0x4bb3e9[_0xa62c('0x60')]({'model':db['User'],'as':_0xa62c('0x67'),'attributes':['id',_0xa62c('0x62')]});return db[_0xa62c('0x24')][_0xa62c('0x38')]({'where':{'id':_0x15cfe7[_0xa62c('0x3b')]['id']},'include':_0x4bb3e9})[_0xa62c('0x1c')](handleEntityNotFound(_0x566416,null))[_0xa62c('0x1c')](function(_0x40d000){if(_0x40d000){var _0x27b02c=_0x40d000['get']({'plain':!![]});fs[_0xa62c('0x68')](_0x522de0);var _0x433d47={'channel':'Sms','account':_0x27b02c[_0xa62c('0x69')]['name'],'agent':_0x27b02c['Owner']?_0x27b02c[_0xa62c('0x67')][_0xa62c('0x62')]:_0xa62c('0x6a'),'createdAt':moment(_0x27b02c[_0xa62c('0x6b')])[_0xa62c('0x5e')](_0xa62c('0x4d'))[_0xa62c('0x5a')](),'closedAt':_0x27b02c[_0xa62c('0x6c')]?moment(_0x27b02c[_0xa62c('0x6d')])['format'](_0xa62c('0x4d'))[_0xa62c('0x5a')]():'','disposition':_0x27b02c[_0xa62c('0x6e')],'messages':_(_0x27b02c[_0xa62c('0x6f')])['filter']({'secret':![]})[_0xa62c('0x23')](function(_0x5d2e9b){return{'date':moment(_0x5d2e9b[_0xa62c('0x6b')])[_0xa62c('0x5e')](_0xa62c('0x4d'))[_0xa62c('0x5a')](),'sender':_0x5d2e9b[_0xa62c('0x70')]===_0xa62c('0x71')?_0x5d2e9b[_0xa62c('0x61')]?_0x5d2e9b[_0xa62c('0x61')]['fullname']:_0xa62c('0x72'):_0x5d2e9b[_0xa62c('0x63')][_0xa62c('0x64')]+(_0x5d2e9b[_0xa62c('0x63')]['lastName']?'\x20'+_0x5d2e9b[_0xa62c('0x63')][_0xa62c('0x73')]:''),'body':_0x5d2e9b[_0xa62c('0x3a')],'direction':_0x5d2e9b[_0xa62c('0x70')]==='out'?'A':'C','secret':_0x5d2e9b[_0xa62c('0x65')],'read':_0x5d2e9b[_0xa62c('0x74')]};})['value']()};return ejs[_0xa62c('0x75')](path[_0xa62c('0x5b')](config['root'],_0xa62c('0x76'),_0xa62c('0x77'),_0xa62c('0x78')),{'interaction':_0x433d47})[_0xa62c('0x1c')](function(_0x30d5ac){var _0x47b489=path[_0xa62c('0x5b')](_0x522de0,'transcript-'+_0x27b02c['id']+'-'+_0x212f92+_0xa62c('0x79'));var _0x2cbfc3={'path':_0x47b489,'channel':_0xa62c('0x7a'),'interactionId':_0x27b02c['id']};return pdf[_0xa62c('0x7b')](_0x30d5ac,_0x2cbfc3);})[_0xa62c('0x1c')](function(){return new BPromise(function(_0x390a78,_0x4856cd){zipdir(_0x522de0,{'saveTo':_0x18b00c},function(_0x1b5dc9,_0x579868){if(_0x1b5dc9)return _0x4856cd(_0x1b5dc9);return _0x390a78(_0x579868);});})[_0xa62c('0x1c')](function(){return new BPromise(function(_0x283770,_0x1a2b7e){rimraf(_0x522de0,function(_0x5503e7){if(_0x5503e7)_0x1a2b7e(_0x5503e7);return _0x283770();});});})['then'](function(){return _0x566416['download'](_0x18b00c,_0x225a54,function(_0x56daf3){if(_0x56daf3){console[_0xa62c('0x7c')](_0xa62c('0x7d'),_0x56daf3);}else{fs[_0xa62c('0x7e')](_0x18b00c);}});});});}else{return _0x566416['sendStatus'](0xc8);}})[_0xa62c('0x2d')](handleError(_0x566416,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 9121520..f5ec945 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 _0xea28=['Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xea28,0x13a));var _0x8ea2=function(_0x38b5f8,_0x43af2d){_0x38b5f8=_0x38b5f8-0x0;var _0x3cb4b8=_0xea28[_0x38b5f8];return _0x3cb4b8;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var SmsInteraction=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x2')];var SmsMessage=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8ea2('0x4')](0x0);var events={'afterCreate':_0x8ea2('0x5'),'afterUpdate':_0x8ea2('0x6'),'afterDestroy':'remove'};function emitEvent(_0x9b45ab){return function(_0x23aaf1,_0x1ccf12,_0x513a0d){_0x23aaf1[_0x8ea2('0x7')]({'attributes':['id'],'raw':!![]})[_0x8ea2('0x8')](function(_0xb7f278){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xa'),_0xb7f278[_0x8ea2('0xb')](function(_0x19bd6c){return{'id':_0x19bd6c['id']};}));return SmsMessage[_0x8ea2('0xc')]({'where':{'SmsInteractionId':_0x23aaf1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8ea2('0x8')](function(_0x3000f9){_0x23aaf1[_0x8ea2('0x9')](_0x8ea2('0xd'),_0x3000f9['length']);SmsInteractionEvents['emit'](_0x9b45ab+':'+_0x23aaf1['id'],_0x23aaf1);SmsInteractionEvents[_0x8ea2('0xe')](_0x9b45ab,_0x23aaf1);_0x513a0d(null);})[_0x8ea2('0xf')](_0x513a0d(null));};}for(var e in events){if(events[_0x8ea2('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x8ea2('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x36ee=['getUsers','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove'];(function(_0xb093b4,_0x2544c0){var _0x3a3c3b=function(_0x54580d){while(--_0x54580d){_0xb093b4['push'](_0xb093b4['shift']());}};_0x3a3c3b(++_0x2544c0);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xe36e('0x0')];var SmsMessage=require('../../mysqldb')['db'][_0xe36e('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe36e('0x2')](0x0);var events={'afterCreate':_0xe36e('0x3'),'afterUpdate':_0xe36e('0x4'),'afterDestroy':_0xe36e('0x5')};function emitEvent(_0x1118af){return function(_0x29e692,_0x3f29e1,_0x25a07d){_0x29e692[_0xe36e('0x6')]({'attributes':['id'],'raw':!![]})[_0xe36e('0x7')](function(_0x1aa596){_0x29e692['setDataValue'](_0xe36e('0x8'),_0x1aa596['map'](function(_0x2236e9){return{'id':_0x2236e9['id']};}));return SmsMessage[_0xe36e('0x9')]({'where':{'SmsInteractionId':_0x29e692['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe36e('0x7')](function(_0x47ce3a){_0x29e692[_0xe36e('0xa')]('unreadMessages',_0x47ce3a[_0xe36e('0xb')]);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af+':'+_0x29e692['id'],_0x29e692);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af,_0x29e692);_0x25a07d(null);})[_0xe36e('0xd')](_0x25a07d(null));};}for(var e in events){if(events[_0xe36e('0xe')](e)){var event=events[e];SmsInteraction[_0xe36e('0xf')](e,emitEvent(event));}}module[_0xe36e('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index a5bfcad..907531b 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 _0xb70c=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed'];(function(_0x41c300,_0x43a3ae){var _0x349680=function(_0x47d3c5){while(--_0x47d3c5){_0x41c300['push'](_0x41c300['shift']());}};_0x349680(++_0x43a3ae);}(_0xb70c,0x102));var _0xcb70=function(_0x414f67,_0x861aed){_0x414f67=_0x414f67-0x0;var _0x338537=_0xb70c[_0x414f67];return _0x338537;};'use strict';var _=require(_0xcb70('0x0'));var util=require(_0xcb70('0x1'));var logger=require(_0xcb70('0x2'))(_0xcb70('0x3'));var moment=require(_0xcb70('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb70('0x5'));var config=require('../../config/environment');var attributes=require(_0xcb70('0x6'));module[_0xcb70('0x7')]=function(_0x478c9d,_0x38f25e){return _0x478c9d[_0xcb70('0x8')](_0xcb70('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47218f,_0x32efdb,_0xc2733d){if(_0x47218f[_0xcb70('0xa')](_0xcb70('0xb'))){_0x47218f[_0xcb70('0xc')]=moment()[_0xcb70('0xd')](_0xcb70('0xe'));}_0xc2733d(null,_0x47218f);}}});}; \ No newline at end of file +var _0x2c04=['changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x2c04,0x129));var _0x42c0=function(_0x4ed49a,_0x51e6c2){_0x4ed49a=_0x4ed49a-0x0;var _0x4eded3=_0x2c04[_0x4ed49a];return _0x4eded3;};'use strict';var _=require(_0x42c0('0x0'));var util=require('util');var logger=require(_0x42c0('0x1'))('api');var moment=require(_0x42c0('0x2'));var BPromise=require(_0x42c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x42c0('0x4'));var config=require(_0x42c0('0x5'));var attributes=require(_0x42c0('0x6'));module[_0x42c0('0x7')]=function(_0x980366,_0x244b33){return _0x980366[_0x42c0('0x8')](_0x42c0('0x9'),attributes,{'tableName':_0x42c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30586d,_0x42a705,_0x1db2b8){if(_0x30586d[_0x42c0('0xb')]('closed')){_0x30586d[_0x42c0('0xc')]=moment()['format'](_0x42c0('0xd'));}_0x1db2b8(null,_0x30586d);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 431462c..a6c0d15 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 _0x1a62=['register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','SmsInteraction','addTags','body','omit','ids','spread','AddTags','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a62,0x11c));var _0x21a6=function(_0x126a6f,_0x5985d4){_0x126a6f=_0x126a6f-0x0;var _0x548b1b=_0x1a62[_0x126a6f];return _0x548b1b;};'use strict';var _=require(_0x21a6('0x0'));var util=require(_0x21a6('0x1'));var moment=require(_0x21a6('0x2'));var BPromise=require(_0x21a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x21a6('0x4'));var db=require(_0x21a6('0x5'))['db'];var utils=require(_0x21a6('0x6'));var logger=require('../../config/logger')(_0x21a6('0x7'));var config=require(_0x21a6('0x8'));var jayson=require(_0x21a6('0x9'));var client=jayson[_0x21a6('0xa')][_0x21a6('0xb')]({'port':0x232a});config[_0x21a6('0xc')]=_[_0x21a6('0xd')](config['redis'],{'host':_0x21a6('0xe'),'port':0x18eb});var socket=require(_0x21a6('0xf'))(new Redis(config[_0x21a6('0xc')]));require(_0x21a6('0x10'))[_0x21a6('0x11')](socket);function respondWithRpcPromise(_0x3f23e9,_0x806a51,_0x38675f){return new BPromise(function(_0x14f113,_0x285ad5){return client[_0x21a6('0x12')](_0x3f23e9,_0x38675f)[_0x21a6('0x13')](function(_0x583f7f){logger[_0x21a6('0x14')](_0x21a6('0x15'),_0x806a51,_0x21a6('0x16'));logger['debug'](_0x21a6('0x17'),_0x806a51,_0x21a6('0x16'),JSON[_0x21a6('0x18')](_0x583f7f));if(_0x583f7f[_0x21a6('0x19')]){if(_0x583f7f[_0x21a6('0x19')][_0x21a6('0x1a')]===0x1f4){logger[_0x21a6('0x19')](_0x21a6('0x15'),_0x806a51,_0x583f7f[_0x21a6('0x19')][_0x21a6('0x1b')]);return _0x285ad5(_0x583f7f[_0x21a6('0x19')][_0x21a6('0x1b')]);}logger[_0x21a6('0x19')](_0x21a6('0x15'),_0x806a51,_0x583f7f[_0x21a6('0x19')]['message']);return _0x14f113(_0x583f7f[_0x21a6('0x19')][_0x21a6('0x1b')]);}else{logger['info'](_0x21a6('0x15'),_0x806a51,_0x21a6('0x16'));_0x14f113(_0x583f7f[_0x21a6('0x1c')]['message']);}})[_0x21a6('0x1d')](function(_0x183e55){logger[_0x21a6('0x19')](_0x21a6('0x15'),_0x806a51,_0x183e55);_0x285ad5(_0x183e55);});});}exports['UpdateSmsInteraction']=function(_0x294372){var _0x3c300c=this;return new Promise(function(_0x1f6ba0,_0x258c1a){return db['SmsInteraction']['update'](_0x294372['body'],{'raw':_0x294372[_0x21a6('0x1e')]?_0x294372[_0x21a6('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x294372[_0x21a6('0x1e')]?_0x294372[_0x21a6('0x1e')]['where']||null:null,'attributes':_0x294372[_0x21a6('0x1e')]?_0x294372[_0x21a6('0x1e')][_0x21a6('0x1f')]||null:null,'limit':_0x294372[_0x21a6('0x1e')]?_0x294372[_0x21a6('0x1e')][_0x21a6('0x20')]||null:null})[_0x21a6('0x13')](function(_0x2584e5){logger[_0x21a6('0x14')](_0x21a6('0x21'),_0x294372);logger['debug'](_0x21a6('0x21'),_0x294372,JSON[_0x21a6('0x18')](_0x2584e5));_0x1f6ba0(_0x2584e5);})['catch'](function(_0x24d4fd){logger['error']('UpdateSmsInteraction',_0x24d4fd[_0x21a6('0x1b')],_0x294372);_0x258c1a(_0x3c300c['error'](0x1f4,_0x24d4fd[_0x21a6('0x1b')]));});});};exports[_0x21a6('0x22')]=function(_0x4985f1){return new Promise(function(_0x295769,_0x5a3264){return db[_0x21a6('0x23')]['find']({'where':_0x4985f1['options']?_0x4985f1[_0x21a6('0x1e')]['where']||null:null})[_0x21a6('0x13')](function(_0x2977d3){if(_0x2977d3){return _0x2977d3[_0x21a6('0x24')](_0x4985f1[_0x21a6('0x25')]['ids'],_[_0x21a6('0x26')](_0x4985f1[_0x21a6('0x25')],[_0x21a6('0x27'),'id'])||{});}})[_0x21a6('0x28')](function(_0x2d2293){logger[_0x21a6('0x14')](_0x21a6('0x29'),_0x4985f1);logger[_0x21a6('0x2a')](_0x21a6('0x29'),_0x4985f1,JSON[_0x21a6('0x18')](_0x2d2293));_0x295769(_0x2d2293);})['catch'](function(_0x3a74aa){logger[_0x21a6('0x19')](_0x21a6('0x29'),_0x3a74aa[_0x21a6('0x1b')],_0x4985f1);_0x5a3264(_this[_0x21a6('0x19')](0x1f4,_0x3a74aa[_0x21a6('0x1b')]));});});}; \ No newline at end of file +var _0x94ea=['stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x445203,_0x52e5dc){var _0x39db3a=function(_0x5b4d32){while(--_0x5b4d32){_0x445203['push'](_0x445203['shift']());}};_0x39db3a(++_0x52e5dc);}(_0x94ea,0xf7));var _0xa94e=function(_0x5b0d8a,_0xb8e38c){_0x5b0d8a=_0x5b0d8a-0x0;var _0x4cfe8d=_0x94ea[_0x5b0d8a];return _0x4cfe8d;};'use strict';var _=require('lodash');var util=require(_0xa94e('0x0'));var moment=require('moment');var BPromise=require(_0xa94e('0x1'));var rs=require(_0xa94e('0x2'));var fs=require('fs');var Redis=require(_0xa94e('0x3'));var db=require(_0xa94e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa94e('0x5'));var config=require('../../config/environment');var jayson=require(_0xa94e('0x6'));var client=jayson[_0xa94e('0x7')][_0xa94e('0x8')]({'port':0x232a});config[_0xa94e('0x9')]=_['defaults'](config[_0xa94e('0x9')],{'host':_0xa94e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa94e('0x9')]));require(_0xa94e('0xb'))[_0xa94e('0xc')](socket);function respondWithRpcPromise(_0x398dfc,_0x3dfc93,_0x8baa87){return new BPromise(function(_0x452b99,_0x4bee67){return client[_0xa94e('0xd')](_0x398dfc,_0x8baa87)[_0xa94e('0xe')](function(_0x53f9a8){logger[_0xa94e('0xf')](_0xa94e('0x10'),_0x3dfc93,_0xa94e('0x11'));logger[_0xa94e('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3dfc93,_0xa94e('0x11'),JSON[_0xa94e('0x13')](_0x53f9a8));if(_0x53f9a8[_0xa94e('0x14')]){if(_0x53f9a8[_0xa94e('0x14')][_0xa94e('0x15')]===0x1f4){logger['error'](_0xa94e('0x10'),_0x3dfc93,_0x53f9a8[_0xa94e('0x14')][_0xa94e('0x16')]);return _0x4bee67(_0x53f9a8['error'][_0xa94e('0x16')]);}logger[_0xa94e('0x14')](_0xa94e('0x10'),_0x3dfc93,_0x53f9a8[_0xa94e('0x14')][_0xa94e('0x16')]);return _0x452b99(_0x53f9a8[_0xa94e('0x14')][_0xa94e('0x16')]);}else{logger[_0xa94e('0xf')](_0xa94e('0x10'),_0x3dfc93,_0xa94e('0x11'));_0x452b99(_0x53f9a8[_0xa94e('0x17')]['message']);}})[_0xa94e('0x18')](function(_0xb7c15c){logger[_0xa94e('0x14')](_0xa94e('0x10'),_0x3dfc93,_0xb7c15c);_0x4bee67(_0xb7c15c);});});}exports[_0xa94e('0x19')]=function(_0x525d39){var _0x26e5db=this;return new Promise(function(_0x1ed287,_0xc2112a){return db[_0xa94e('0x1a')]['update'](_0x525d39[_0xa94e('0x1b')],{'raw':_0x525d39[_0xa94e('0x1c')]?_0x525d39['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525d39[_0xa94e('0x1c')]?_0x525d39[_0xa94e('0x1c')][_0xa94e('0x1d')]||null:null,'attributes':_0x525d39[_0xa94e('0x1c')]?_0x525d39[_0xa94e('0x1c')][_0xa94e('0x1e')]||null:null,'limit':_0x525d39[_0xa94e('0x1c')]?_0x525d39[_0xa94e('0x1c')][_0xa94e('0x1f')]||null:null})[_0xa94e('0xe')](function(_0x54285b){logger[_0xa94e('0xf')](_0xa94e('0x19'),_0x525d39);logger[_0xa94e('0x12')](_0xa94e('0x19'),_0x525d39,JSON['stringify'](_0x54285b));_0x1ed287(_0x54285b);})[_0xa94e('0x18')](function(_0x323353){logger[_0xa94e('0x14')](_0xa94e('0x19'),_0x323353[_0xa94e('0x16')],_0x525d39);_0xc2112a(_0x26e5db[_0xa94e('0x14')](0x1f4,_0x323353[_0xa94e('0x16')]));});});};exports[_0xa94e('0x20')]=function(_0x12eeab){return new Promise(function(_0x4c801a,_0x129d46){return db[_0xa94e('0x1a')][_0xa94e('0x21')]({'where':_0x12eeab['options']?_0x12eeab['options']['where']||null:null})[_0xa94e('0xe')](function(_0x575408){if(_0x575408){return _0x575408[_0xa94e('0x22')](_0x12eeab[_0xa94e('0x1b')]['ids'],_['omit'](_0x12eeab[_0xa94e('0x1b')],[_0xa94e('0x23'),'id'])||{});}})[_0xa94e('0x24')](function(_0x7258ec){logger[_0xa94e('0xf')](_0xa94e('0x25'),_0x12eeab);logger[_0xa94e('0x12')](_0xa94e('0x25'),_0x12eeab,JSON[_0xa94e('0x13')](_0x7258ec));_0x4c801a(_0x7258ec);})[_0xa94e('0x18')](function(_0x59d43f){logger[_0xa94e('0x14')](_0xa94e('0x25'),_0x59d43f[_0xa94e('0x16')],_0x12eeab);_0x129d46(_this[_0xa94e('0x14')](0x1f4,_0x59d43f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0a70b9a..5825ba5 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 _0x70f5=['smsInteraction:','./smsInteraction.events','save','remove','removeListener','register','length'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x70f5,0x71));var _0x570f=function(_0x398f3d,_0x15a094){_0x398f3d=_0x398f3d-0x0;var _0x46b3c7=_0x70f5[_0x398f3d];return _0x46b3c7;};'use strict';var SmsInteractionEvents=require(_0x570f('0x0'));var events=[_0x570f('0x1'),_0x570f('0x2'),'update'];function createListener(_0x4f923a,_0x2eff1b){return function(_0x2e9334){_0x2eff1b['emit'](_0x4f923a,_0x2e9334);};}function removeListener(_0x2fd36c,_0x214360){return function(){SmsInteractionEvents[_0x570f('0x3')](_0x2fd36c,_0x214360);};}exports[_0x570f('0x4')]=function(_0x2a5186){for(var _0x52e3cc=0x0,_0x525759=events[_0x570f('0x5')];_0x52e3cc<_0x525759;_0x52e3cc++){var _0x10eabe=events[_0x52e3cc];var _0x8e8904=createListener(_0x570f('0x6')+_0x10eabe,_0x2a5186);SmsInteractionEvents['on'](_0x10eabe,_0x8e8904);}}; \ No newline at end of file +var _0x19be=['save','remove','update','emit','removeListener','register','length','./smsInteraction.events'];(function(_0x4c35f9,_0x25fe48){var _0x10fda5=function(_0x413d18){while(--_0x413d18){_0x4c35f9['push'](_0x4c35f9['shift']());}};_0x10fda5(++_0x25fe48);}(_0x19be,0x187));var _0xe19b=function(_0x589e0b,_0x896bd6){_0x589e0b=_0x589e0b-0x0;var _0x15a105=_0x19be[_0x589e0b];return _0x15a105;};'use strict';var SmsInteractionEvents=require(_0xe19b('0x0'));var events=[_0xe19b('0x1'),_0xe19b('0x2'),_0xe19b('0x3')];function createListener(_0x3a7aaf,_0x4ab804){return function(_0x579376){_0x4ab804[_0xe19b('0x4')](_0x3a7aaf,_0x579376);};}function removeListener(_0x27c976,_0x2e667a){return function(){SmsInteractionEvents[_0xe19b('0x5')](_0x27c976,_0x2e667a);};}exports[_0xe19b('0x6')]=function(_0x219c1a){for(var _0x427457=0x0,_0x209c7f=events[_0xe19b('0x7')];_0x427457<_0x209c7f;_0x427457++){var _0x11f6f9=events[_0x427457];var _0x5a8bd6=createListener('smsInteraction:'+_0x11f6f9,_0x219c1a);SmsInteractionEvents['on'](_0x11f6f9,_0x5a8bd6);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 10d8018..a8a2298 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 _0xb9c1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','sms','smsmessage:create','create','status','put','update','/:id/accept','accept','reject','destroy','multer','path','connect-timeout'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb9c1,0xc1));var _0x1b9c=function(_0x3024b3,_0x43da59){_0x3024b3=_0x3024b3-0x0;var _0x1d337f=_0xb9c1[_0x3024b3];return _0x1d337f;};'use strict';var multer=require(_0x1b9c('0x0'));var util=require('util');var path=require(_0x1b9c('0x1'));var timeout=require(_0x1b9c('0x2'));var express=require(_0x1b9c('0x3'));var router=express[_0x1b9c('0x4')]();var fs_extra=require(_0x1b9c('0x5'));var auth=require(_0x1b9c('0x6'));var interaction=require(_0x1b9c('0x7'));var config=require(_0x1b9c('0x8'));var controller=require(_0x1b9c('0x9'));router['get']('/',auth[_0x1b9c('0xa')](),controller[_0x1b9c('0xb')]);router['get'](_0x1b9c('0xc'),auth[_0x1b9c('0xa')](),controller[_0x1b9c('0xd')]);router[_0x1b9c('0xe')](_0x1b9c('0xf'),auth[_0x1b9c('0xa')](),controller[_0x1b9c('0x10')]);router[_0x1b9c('0x11')]('/',auth[_0x1b9c('0xa')](),interaction['tracked'](_0x1b9c('0x12'),_0x1b9c('0x13')),controller[_0x1b9c('0x14')]);router['post']('/:id/status',controller[_0x1b9c('0x15')]);router[_0x1b9c('0x16')](_0x1b9c('0xf'),auth[_0x1b9c('0xa')](),controller[_0x1b9c('0x17')]);router['put'](_0x1b9c('0x18'),auth[_0x1b9c('0xa')](),controller[_0x1b9c('0x19')]);router['put']('/:id/reject',auth[_0x1b9c('0xa')](),controller[_0x1b9c('0x1a')]);router['delete'](_0x1b9c('0xf'),auth[_0x1b9c('0xa')](),controller[_0x1b9c('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x30a6=['smsmessage:create','create','/:id/status','status','put','update','accept','reject','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms'];(function(_0x2e7c1b,_0x232f79){var _0x42f565=function(_0x31ee5a){while(--_0x31ee5a){_0x2e7c1b['push'](_0x2e7c1b['shift']());}};_0x42f565(++_0x232f79);}(_0x30a6,0x1ab));var _0x630a=function(_0x343bd0,_0x1858a6){_0x343bd0=_0x343bd0-0x0;var _0x111a8d=_0x30a6[_0x343bd0];return _0x111a8d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x630a('0x0'));var timeout=require(_0x630a('0x1'));var express=require('express');var router=express[_0x630a('0x2')]();var fs_extra=require(_0x630a('0x3'));var auth=require(_0x630a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x630a('0x5')]('/',auth[_0x630a('0x6')](),controller[_0x630a('0x7')]);router[_0x630a('0x5')](_0x630a('0x8'),auth['isAuthenticated'](),controller[_0x630a('0x9')]);router['get'](_0x630a('0xa'),auth[_0x630a('0x6')](),controller[_0x630a('0xb')]);router[_0x630a('0xc')]('/',auth[_0x630a('0x6')](),interaction[_0x630a('0xd')](_0x630a('0xe'),_0x630a('0xf')),controller[_0x630a('0x10')]);router[_0x630a('0xc')](_0x630a('0x11'),controller[_0x630a('0x12')]);router[_0x630a('0x13')](_0x630a('0xa'),auth[_0x630a('0x6')](),controller[_0x630a('0x14')]);router[_0x630a('0x13')]('/:id/accept',auth[_0x630a('0x6')](),controller[_0x630a('0x15')]);router[_0x630a('0x13')]('/:id/reject',auth[_0x630a('0x6')](),controller[_0x630a('0x16')]);router[_0x630a('0x17')](_0x630a('0xa'),auth[_0x630a('0x6')](),controller[_0x630a('0x18')]);module[_0x630a('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d4b8ea2..f113014 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 _0x277f=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x19b3ac,_0x4a04ae){var _0x3756fa=function(_0x489881){while(--_0x489881){_0x19b3ac['push'](_0x19b3ac['shift']());}};_0x3756fa(++_0x4a04ae);}(_0x277f,0x17e));var _0xf277=function(_0x192e25,_0x51ca0b){_0x192e25=_0x192e25-0x0;var _0x36025b=_0x277f[_0x192e25];return _0x36025b;};'use strict';var Sequelize=require(_0xf277('0x0'));module[_0xf277('0x1')]={'body':{'type':Sequelize[_0xf277('0x2')](_0xf277('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf277('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf277('0x5')]('in',_0xf277('0x6')),'defaultValue':_0xf277('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf277('0x7')](0xbe)},'phone':{'type':Sequelize[_0xf277('0x7')]},'readAt':{'type':Sequelize[_0xf277('0x8')]},'secret':{'type':Sequelize[_0xf277('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf277('0x7')]},'providerResponse':{'type':Sequelize[_0xf277('0x2')]}}; \ No newline at end of file +var _0x6898=['TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize','exports'];(function(_0xaecde5,_0x59f4b5){var _0x2ed28c=function(_0x47c368){while(--_0x47c368){_0xaecde5['push'](_0xaecde5['shift']());}};_0x2ed28c(++_0x59f4b5);}(_0x6898,0x18e));var _0x8689=function(_0x24d164,_0x2a8d6f){_0x24d164=_0x24d164-0x0;var _0x24d2fc=_0x6898[_0x24d164];return _0x24d2fc;};'use strict';var Sequelize=require(_0x8689('0x0'));module[_0x8689('0x1')]={'body':{'type':Sequelize[_0x8689('0x2')](_0x8689('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8689('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8689('0x5')),'defaultValue':_0x8689('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8689('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8689('0x6')]},'readAt':{'type':Sequelize[_0x8689('0x7')]},'secret':{'type':Sequelize[_0x8689('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8689('0x6')]},'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 8372eb2..9d937ed 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 _0xffd6=['MessageUUID','indexOf','delivered','plivio','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','request','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','undefined','limit','count','offset','status','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','query','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','params','length','merge','create','body','find','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','User','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','QueryTypes','contact','interface','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2f47da,_0x50ca98){var _0x690628=function(_0x47c870){while(--_0x47c870){_0x2f47da['push'](_0x2f47da['shift']());}};_0x690628(++_0x50ca98);}(_0xffd6,0x97));var _0x6ffd=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xffd6[_0x576170];return _0x397c70;};'use strict';var emlformat=require(_0x6ffd('0x0'));var rimraf=require(_0x6ffd('0x1'));var zipdir=require(_0x6ffd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ffd('0x3'));var BPromise=require(_0x6ffd('0x4'));var Mustache=require(_0x6ffd('0x5'));var util=require('util');var path=require(_0x6ffd('0x6'));var sox=require(_0x6ffd('0x7'));var csv=require(_0x6ffd('0x8'));var ejs=require(_0x6ffd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ffd('0xa'));var squel=require(_0x6ffd('0xb'));var crypto=require(_0x6ffd('0xc'));var jsforce=require(_0x6ffd('0xd'));var deskjs=require(_0x6ffd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ffd('0xf'));var Papa=require(_0x6ffd('0x10'));var Redis=require('ioredis');var authService=require(_0x6ffd('0x11'));var qs=require(_0x6ffd('0x12'));var as=require(_0x6ffd('0x13'));var hardwareService=require(_0x6ffd('0x14'));var logger=require(_0x6ffd('0x15'))(_0x6ffd('0x16'));var utils=require(_0x6ffd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6ffd('0x18'));var db=require(_0x6ffd('0x19'))['db'];config['redis']=_[_0x6ffd('0x1a')](config[_0x6ffd('0x1b')],{'host':_0x6ffd('0x1c'),'port':0x18eb});var socket=require(_0x6ffd('0x1d'))(new Redis(config['redis']));require(_0x6ffd('0x1e'))['register'](socket);var jayson=require(_0x6ffd('0x1f'));var client=jayson['client'][_0x6ffd('0x20')]({'port':0x232c});var client9002=jayson[_0x6ffd('0x21')][_0x6ffd('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5d8aff,_0x15fca6,_0x9d2f93,_0x350c94){return new BPromise(function(_0x3394b2,_0x29293a){var _0x19a772=_0x350c94||client;return _0x19a772[_0x6ffd('0x22')](_0x5d8aff,_0x9d2f93)[_0x6ffd('0x23')](function(_0x545576){logger[_0x6ffd('0x24')]('SmsMessage,\x20%s,\x20%s',_0x15fca6,'request\x20sent');logger[_0x6ffd('0x25')](_0x6ffd('0x26'),_0x15fca6,'request\x20sent',JSON[_0x6ffd('0x27')](_0x545576));if(_0x545576[_0x6ffd('0x28')]){if(_0x545576['error']['code']===0x1f4){logger[_0x6ffd('0x28')](_0x6ffd('0x29'),_0x15fca6,_0x545576['error'][_0x6ffd('0x2a')]);return _0x29293a(_0x545576[_0x6ffd('0x28')][_0x6ffd('0x2a')]);}logger['error'](_0x6ffd('0x29'),_0x15fca6,_0x545576[_0x6ffd('0x28')]['message']);return _0x3394b2(_0x545576[_0x6ffd('0x28')][_0x6ffd('0x2a')]);}else{logger['info'](_0x6ffd('0x29'),_0x15fca6,_0x6ffd('0x2b'));_0x3394b2(_0x545576[_0x6ffd('0x2c')]['message']);}})[_0x6ffd('0x2d')](function(_0x3e5726){logger[_0x6ffd('0x28')]('SmsMessage,\x20%s,\x20%s',_0x15fca6,_0x3e5726);_0x29293a(_0x3e5726);});});}function respondWithStatusCode(_0x153364,_0x5a55e2){_0x5a55e2=_0x5a55e2||0xcc;return function(_0x41ab4a){if(_0x41ab4a){return _0x153364[_0x6ffd('0x2e')](_0x5a55e2);}return _0x153364['status'](_0x5a55e2)['end']();};}function respondWithResult(_0x252201,_0x2a0391){_0x2a0391=_0x2a0391||0xc8;return function(_0x1934d4){if(_0x1934d4){return _0x252201['status'](_0x2a0391)['json'](_0x1934d4);}};}function respondWithFilteredResult(_0x32c399,_0x48feb4){return function(_0x470021){if(_0x470021){var _0x20c007=typeof _0x48feb4['offset']===_0x6ffd('0x2f')&&typeof _0x48feb4[_0x6ffd('0x30')]===_0x6ffd('0x2f');var _0x11a5cb=_0x470021[_0x6ffd('0x31')];var _0x31c609=_0x20c007?0x0:_0x48feb4[_0x6ffd('0x32')];var _0xccb8c=_0x20c007?_0x470021[_0x6ffd('0x31')]:_0x48feb4[_0x6ffd('0x32')]+_0x48feb4[_0x6ffd('0x30')];var _0x352656;if(_0xccb8c>=_0x11a5cb){_0xccb8c=_0x11a5cb;_0x352656=0xc8;}else{_0x352656=0xce;}_0x32c399[_0x6ffd('0x33')](_0x352656);return _0x32c399['set']('Content-Range',_0x31c609+'-'+_0xccb8c+'/'+_0x11a5cb)['json'](_0x470021);}return null;};}function patchUpdates(_0x2bd692){return function(_0x2bbb6e){try{jsonpatch[_0x6ffd('0x34')](_0x2bbb6e,_0x2bd692,!![]);}catch(_0x528a3f){return BPromise[_0x6ffd('0x35')](_0x528a3f);}return _0x2bbb6e[_0x6ffd('0x36')]();};}function saveUpdates(_0x1cf1d0,_0x2b81de){return function(_0x403e72){if(_0x403e72){return _0x403e72[_0x6ffd('0x37')](_0x1cf1d0)[_0x6ffd('0x23')](function(_0x159bad){return _0x159bad;});}return null;};}function removeEntity(_0x43dc0c,_0x4efa12){return function(_0x46e447){if(_0x46e447){return _0x46e447[_0x6ffd('0x38')]()[_0x6ffd('0x23')](function(){_0x43dc0c[_0x6ffd('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221a28,_0x4cd93a){return function(_0x5b6f9b){if(!_0x5b6f9b){_0x221a28[_0x6ffd('0x2e')](0x194);}return _0x5b6f9b;};}function handleError(_0xec347a,_0x25bc7c){_0x25bc7c=_0x25bc7c||0x1f4;return function(_0x2ad43d){logger['error'](_0x2ad43d[_0x6ffd('0x39')]);if(_0x2ad43d['name']){delete _0x2ad43d[_0x6ffd('0x3a')];}_0xec347a[_0x6ffd('0x33')](_0x25bc7c)[_0x6ffd('0x3b')](_0x2ad43d);};}exports[_0x6ffd('0x3c')]=function(_0x23fae4,_0x5a24d0){var _0x5983c0={},_0x28042b={},_0x58e1f1={'count':0x0,'rows':[]};var _0x2a7278=_[_0x6ffd('0x3d')](db[_0x6ffd('0x3e')][_0x6ffd('0x3f')],function(_0x6ee6f0){return{'name':_0x6ee6f0[_0x6ffd('0x40')],'type':_0x6ee6f0['type'][_0x6ffd('0x41')]};});_0x28042b[_0x6ffd('0x42')]=_[_0x6ffd('0x3d')](_0x2a7278,_0x6ffd('0x3a'));_0x28042b['query']=_[_0x6ffd('0x43')](_0x23fae4['query']);_0x28042b[_0x6ffd('0x44')]=_[_0x6ffd('0x45')](_0x28042b[_0x6ffd('0x42')],_0x28042b['query']);_0x5983c0[_0x6ffd('0x46')]=_[_0x6ffd('0x45')](_0x28042b[_0x6ffd('0x42')],qs[_0x6ffd('0x47')](_0x23fae4[_0x6ffd('0x48')][_0x6ffd('0x47')]));_0x5983c0[_0x6ffd('0x46')]=_0x5983c0['attributes']['length']?_0x5983c0['attributes']:_0x28042b[_0x6ffd('0x42')];if(!_0x23fae4[_0x6ffd('0x48')]['hasOwnProperty'](_0x6ffd('0x49'))){_0x5983c0[_0x6ffd('0x30')]=qs[_0x6ffd('0x30')](_0x23fae4[_0x6ffd('0x48')]['limit']);_0x5983c0[_0x6ffd('0x32')]=qs[_0x6ffd('0x32')](_0x23fae4[_0x6ffd('0x48')][_0x6ffd('0x32')]);}_0x5983c0[_0x6ffd('0x4a')]=qs[_0x6ffd('0x4b')](_0x23fae4[_0x6ffd('0x48')][_0x6ffd('0x4b')]);_0x5983c0[_0x6ffd('0x4c')]=qs[_0x6ffd('0x44')](_[_0x6ffd('0x4d')](_0x23fae4['query'],_0x28042b['filters']),_0x2a7278);if(_0x23fae4['query'][_0x6ffd('0x4e')]){_0x5983c0[_0x6ffd('0x4c')]=_['merge'](_0x5983c0[_0x6ffd('0x4c')],{'$or':_[_0x6ffd('0x3d')](_0x2a7278,function(_0x22c1ba){if(_0x22c1ba[_0x6ffd('0x4f')]!==_0x6ffd('0x50')){var _0x57e547={};_0x57e547[_0x22c1ba[_0x6ffd('0x3a')]]={'$like':'%'+_0x23fae4[_0x6ffd('0x48')][_0x6ffd('0x4e')]+'%'};return _0x57e547;}})});}_0x5983c0=_['merge']({},_0x5983c0,_0x23fae4[_0x6ffd('0x51')]);var _0x15bc35={'where':_0x5983c0[_0x6ffd('0x4c')]};return db[_0x6ffd('0x3e')][_0x6ffd('0x31')](_0x15bc35)[_0x6ffd('0x23')](function(_0x563f20){_0x58e1f1[_0x6ffd('0x31')]=_0x563f20;if(_0x23fae4[_0x6ffd('0x48')][_0x6ffd('0x52')]){_0x5983c0[_0x6ffd('0x53')]=[{'all':!![]}];}return db[_0x6ffd('0x3e')][_0x6ffd('0x54')](_0x5983c0);})[_0x6ffd('0x23')](function(_0x4a6e0b){_0x58e1f1[_0x6ffd('0x55')]=_0x4a6e0b;return _0x58e1f1;})[_0x6ffd('0x23')](respondWithFilteredResult(_0x5a24d0,_0x5983c0))['catch'](handleError(_0x5a24d0,null));};exports['show']=function(_0x5aea31,_0x3362ba){var _0x58a3d5={'raw':!![],'where':{'id':_0x5aea31[_0x6ffd('0x56')]['id']}},_0x398fd5={};_0x398fd5[_0x6ffd('0x42')]=_[_0x6ffd('0x43')](db['SmsMessage'][_0x6ffd('0x3f')]);_0x398fd5[_0x6ffd('0x48')]=_[_0x6ffd('0x43')](_0x5aea31['query']);_0x398fd5[_0x6ffd('0x44')]=_[_0x6ffd('0x45')](_0x398fd5['model'],_0x398fd5['query']);_0x58a3d5[_0x6ffd('0x46')]=_[_0x6ffd('0x45')](_0x398fd5[_0x6ffd('0x42')],qs[_0x6ffd('0x47')](_0x5aea31[_0x6ffd('0x48')][_0x6ffd('0x47')]));_0x58a3d5[_0x6ffd('0x46')]=_0x58a3d5['attributes'][_0x6ffd('0x57')]?_0x58a3d5[_0x6ffd('0x46')]:_0x398fd5[_0x6ffd('0x42')];if(_0x5aea31['query']['includeAll']){_0x58a3d5[_0x6ffd('0x53')]=[{'all':!![]}];}_0x58a3d5=_[_0x6ffd('0x58')]({},_0x58a3d5,_0x5aea31[_0x6ffd('0x51')]);return db[_0x6ffd('0x3e')]['find'](_0x58a3d5)[_0x6ffd('0x23')](handleEntityNotFound(_0x3362ba,null))[_0x6ffd('0x23')](respondWithResult(_0x3362ba,null))[_0x6ffd('0x2d')](handleError(_0x3362ba,null));};exports[_0x6ffd('0x59')]=function(_0x24876b,_0x2a12f8){return db['SmsMessage'][_0x6ffd('0x59')](_0x24876b[_0x6ffd('0x5a')],{})[_0x6ffd('0x23')](respondWithResult(_0x2a12f8,0xc9))[_0x6ffd('0x2d')](handleError(_0x2a12f8,null));};exports[_0x6ffd('0x37')]=function(_0x4b87fc,_0x1f06c0){if(_0x4b87fc[_0x6ffd('0x5a')]['id']){delete _0x4b87fc[_0x6ffd('0x5a')]['id'];}return db[_0x6ffd('0x3e')][_0x6ffd('0x5b')]({'where':{'id':_0x4b87fc['params']['id']}})[_0x6ffd('0x23')](handleEntityNotFound(_0x1f06c0,null))[_0x6ffd('0x23')](saveUpdates(_0x4b87fc[_0x6ffd('0x5a')],null))['then'](respondWithResult(_0x1f06c0,null))[_0x6ffd('0x2d')](handleError(_0x1f06c0,null));};exports[_0x6ffd('0x38')]=function(_0x5284d5,_0x42ce2a){return db['SmsMessage'][_0x6ffd('0x5b')]({'where':{'id':_0x5284d5[_0x6ffd('0x56')]['id']}})['then'](handleEntityNotFound(_0x42ce2a,null))[_0x6ffd('0x23')](removeEntity(_0x42ce2a,null))['catch'](handleError(_0x42ce2a,null));};exports[_0x6ffd('0x5c')]=function(_0x186f1e,_0x196b4a){return db[_0x6ffd('0x3e')][_0x6ffd('0x5c')]()['then'](respondWithResult(_0x196b4a,null))[_0x6ffd('0x2d')](handleError(_0x196b4a,null));};var interaction_log=require(_0x6ffd('0x15'))(_0x6ffd('0x5d'));exports[_0x6ffd('0x5e')]=function(_0x4b34cf,_0x38a627,_0x183ac7){var _0x46f9bc={'agent':{},'channel':'sms'};if(_0x4b34cf[_0x6ffd('0x5a')]['id']){delete _0x4b34cf['body']['id'];}_0x4b34cf[_0x6ffd('0x5a')]['read']=!![];_0x4b34cf[_0x6ffd('0x5a')][_0x6ffd('0x5f')]=moment()[_0x6ffd('0x60')](_0x6ffd('0x61'));_0x4b34cf['body'][_0x6ffd('0x62')]=_0x4b34cf[_0x6ffd('0x5a')][_0x6ffd('0x62')]||_0x4b34cf[_0x6ffd('0x63')]['id'];_0x46f9bc[_0x6ffd('0x64')]['id']=_0x4b34cf[_0x6ffd('0x5a')][_0x6ffd('0x62')];return db[_0x6ffd('0x3e')][_0x6ffd('0x5b')]({'where':{'id':_0x4b34cf[_0x6ffd('0x56')]['id'],'UserId':null}})[_0x6ffd('0x23')](handleEntityNotFound(_0x38a627,null))[_0x6ffd('0x23')](saveUpdates(_0x4b34cf[_0x6ffd('0x5a')],null))[_0x6ffd('0x23')](function(_0x338f37){if(_0x338f37){_0x46f9bc[_0x6ffd('0x2a')]=_0x338f37[_0x6ffd('0x65')]({'plain':!![]});return db[_0x6ffd('0x66')][_0x6ffd('0x5b')]({'where':{'id':_0x338f37[_0x6ffd('0x67')]}});}return null;})[_0x6ffd('0x23')](handleEntityNotFound(_0x38a627,null))[_0x6ffd('0x23')](function(_0x2f9e47){if(_0x2f9e47){return _0x2f9e47[_0x6ffd('0x37')]({'UserId':_0x4b34cf[_0x6ffd('0x5a')]['UserId'],'read1stAt':_[_0x6ffd('0x68')](_0x2f9e47['read1stAt'])?moment()[_0x6ffd('0x60')](_0x6ffd('0x61')):undefined});}return null;})[_0x6ffd('0x23')](function(_0x39718e){if(_0x39718e){_0x46f9bc[_0x6ffd('0x69')]=_0x39718e[_0x6ffd('0x65')]({'plain':!![]});interaction_log[_0x6ffd('0x24')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b34cf[_0x6ffd('0x63')]['id'],_0x4b34cf[_0x6ffd('0x63')][_0x6ffd('0x3a')],_0x4b34cf[_0x6ffd('0x63')][_0x6ffd('0x6a')],_0x46f9bc[_0x6ffd('0x69')]['id'],_0x4b34cf[_0x6ffd('0x5a')]?JSON[_0x6ffd('0x27')](_0x4b34cf[_0x6ffd('0x5a')]):_0x6ffd('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x6ffd('0x6c'),_0x46f9bc);}return null;})[_0x6ffd('0x23')](function(_0x18ac12){var _0x3b546c=_0x6ffd('0x6d')+_0x18ac12[_0x6ffd('0x2a')]['ContactId'];return db['sequelize'][_0x6ffd('0x48')](_0x3b546c,{'type':db[_0x6ffd('0x6e')]['QueryTypes'][_0x6ffd('0x6f')],'raw':!![]})['then'](function(_0x2a385e){return _0x2a385e;});})['then'](function(_0x272e61){if(_0x272e61){_0x46f9bc[_0x6ffd('0x2a')]['contact']=_0x272e61[0x0];if(!_0x4b34cf[_0x6ffd('0x5a')]['UserId'])return;return db[_0x6ffd('0x70')][_0x6ffd('0x5b')]({'where':{'id':_0x4b34cf['body'][_0x6ffd('0x62')],'role':_0x6ffd('0x64')},'attributes':['id',_0x6ffd('0x3a'),'fullname',_0x6ffd('0x71'),_0x6ffd('0x72')],'raw':!![]});}return null;})[_0x6ffd('0x23')](function(_0x418b48){if(!_0x418b48)return null;_0x46f9bc[_0x6ffd('0x2a')][_0x6ffd('0x64')]=_0x418b48;return _0x46f9bc;})[_0x6ffd('0x23')](function(_0x463df2){if(_0x463df2){if(_0x4b34cf['body'][_0x6ffd('0x73')]){_0x46f9bc[_0x6ffd('0x2a')]['interface']=util['format']('SIP/%s',_0x4b34cf[_0x6ffd('0x63')][_0x6ffd('0x3a')]);_0x46f9bc[_0x6ffd('0x2a')][_0x6ffd('0x74')]=_0x46f9bc[_0x6ffd('0x74')];_0x46f9bc[_0x6ffd('0x2a')][_0x6ffd('0x75')]=_0x46f9bc[_0x6ffd('0x74')];_0x46f9bc['message'][_0x6ffd('0x76')]=_0x6ffd('0x5e');return respondWithRpcPromise('EventManager',_0x6ffd('0x77'),{'event':_0x6ffd('0x78'),'message':_0x46f9bc[_0x6ffd('0x2a')]},client9002)[_0x6ffd('0x23')](function(){return _0x46f9bc;});}return _0x46f9bc;}return null;})['then'](respondWithResult(_0x38a627,null))['catch'](handleError(_0x38a627,null));};var interaction_log=require(_0x6ffd('0x15'))('sms-interactions');exports['reject']=function(_0x3e89d6,_0x2f2e5d,_0x2e8b9f){var _0x976c59={'agent':{},'channel':_0x6ffd('0x79')};if(_0x3e89d6[_0x6ffd('0x5a')]['id']){delete _0x3e89d6[_0x6ffd('0x5a')]['id'];}_0x3e89d6[_0x6ffd('0x5a')][_0x6ffd('0x62')]=_0x3e89d6[_0x6ffd('0x5a')][_0x6ffd('0x62')]||_0x3e89d6[_0x6ffd('0x63')]['id'];_0x976c59['agent']['id']=_0x3e89d6['body'][_0x6ffd('0x62')];return db[_0x6ffd('0x3e')][_0x6ffd('0x5b')]({'where':{'id':_0x3e89d6[_0x6ffd('0x56')]['id'],'UserId':null}})[_0x6ffd('0x23')](handleEntityNotFound(_0x2f2e5d,null))['then'](function(_0x46a918){if(_0x46a918){_0x976c59[_0x6ffd('0x2a')]=_0x46a918[_0x6ffd('0x65')]({'plain':!![]});return db[_0x6ffd('0x66')]['find']({'where':{'id':_0x46a918[_0x6ffd('0x67')]}});}return null;})[_0x6ffd('0x23')](handleEntityNotFound(_0x2f2e5d,null))['then'](function(_0x11df58){if(_0x11df58){_0x976c59[_0x6ffd('0x69')]=_0x11df58[_0x6ffd('0x65')]({'plain':!![]});interaction_log[_0x6ffd('0x24')](_0x6ffd('0x7a'),_0x3e89d6[_0x6ffd('0x63')]['id'],_0x3e89d6['user'][_0x6ffd('0x3a')],_0x3e89d6['user']['role'],_0x976c59[_0x6ffd('0x69')]['id'],_0x3e89d6[_0x6ffd('0x5a')]?JSON['stringify'](_0x3e89d6[_0x6ffd('0x5a')]):_0x6ffd('0x6b'));return respondWithRpcPromise(_0x6ffd('0x7b'),_0x6ffd('0x7c'),_0x976c59);}return null;})[_0x6ffd('0x23')](function(_0x39e2fc){var _0x1112a0=_0x6ffd('0x6d')+_0x39e2fc[_0x6ffd('0x2a')][_0x6ffd('0x7d')];return db[_0x6ffd('0x7e')]['query'](_0x1112a0,{'type':db[_0x6ffd('0x6e')][_0x6ffd('0x7f')]['SELECT'],'raw':!![]})[_0x6ffd('0x23')](function(_0x21e84b){return _0x21e84b;});})[_0x6ffd('0x23')](function(_0x275eaa){if(_0x275eaa){_0x976c59['message'][_0x6ffd('0x80')]=_0x275eaa[0x0];if(!_0x3e89d6[_0x6ffd('0x5a')]['UserId'])return;return db[_0x6ffd('0x70')][_0x6ffd('0x5b')]({'where':{'id':_0x3e89d6['body']['UserId'],'role':_0x6ffd('0x64')},'attributes':['id',_0x6ffd('0x3a'),'fullname',_0x6ffd('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1ab496){if(!_0x1ab496)return null;_0x976c59[_0x6ffd('0x2a')]['agent']=_0x1ab496;return _0x976c59;})['then'](function(_0x55f4a4){if(_0x55f4a4){_0x55f4a4[_0x6ffd('0x2a')][_0x6ffd('0x81')]=util[_0x6ffd('0x60')]('SIP/%s',_0x3e89d6[_0x6ffd('0x63')][_0x6ffd('0x3a')]);_0x55f4a4[_0x6ffd('0x2a')][_0x6ffd('0x74')]=_0x976c59[_0x6ffd('0x74')];_0x55f4a4['message'][_0x6ffd('0x75')]=_0x976c59[_0x6ffd('0x74')];_0x55f4a4['message']['event']=_0x6ffd('0x35');respondWithRpcPromise(_0x6ffd('0x77'),_0x6ffd('0x77'),{'event':'rejectmessage','message':_0x55f4a4['message']},client9002);return _0x976c59;}return null;})[_0x6ffd('0x23')](respondWithResult(_0x2f2e5d,null))[_0x6ffd('0x2d')](handleError(_0x2f2e5d,null));};exports['status']=function(_0x155d5c,_0x40ea40,_0x3fad69){if(_0x155d5c['body']['id']){delete _0x155d5c[_0x6ffd('0x5a')]['id'];}var _0x3df19f;return db[_0x6ffd('0x3e')][_0x6ffd('0x5b')]({'where':{'id':_0x155d5c[_0x6ffd('0x56')]['id']}})[_0x6ffd('0x23')](handleEntityNotFound(_0x40ea40,null))[_0x6ffd('0x23')](function(_0x49bb61){if(_0x49bb61){_0x3df19f=_0x49bb61;return db[_0x6ffd('0x82')][_0x6ffd('0x5b')]({'where':{'id':_0x49bb61[_0x6ffd('0x83')]}});}})['then'](handleEntityNotFound(_0x40ea40,null))[_0x6ffd('0x23')](function(_0x56ac44){if(_0x56ac44){logger[_0x6ffd('0x25')](_0x6ffd('0x26'),_0x6ffd('0x33'),_0x6ffd('0x84'),_0x56ac44[_0x6ffd('0x4f')],util[_0x6ffd('0x85')](_0x155d5c['body'],{'showHidden':![],'depth':null}));switch(_0x56ac44[_0x6ffd('0x4f')]){case _0x6ffd('0x86'):if(_0x155d5c[_0x6ffd('0x5a')][_0x6ffd('0x87')]&&_0x155d5c[_0x6ffd('0x5a')][_0x6ffd('0x87')]===_0x3df19f['messageId']){return _0x3df19f[_0x6ffd('0x37')]({'read':!![]});}else{logger[_0x6ffd('0x28')](_0x6ffd('0x88'),_0x6ffd('0x33'),_0x6ffd('0x86'),util[_0x6ffd('0x85')](_0x155d5c['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x155d5c[_0x6ffd('0x5a')][_0x6ffd('0x89')]&&_0x155d5c['body'][_0x6ffd('0x89')]===_0x3df19f['messageId']&&_[_0x6ffd('0x8a')](['sent',_0x6ffd('0x8b')],_0x155d5c[_0x6ffd('0x5a')]['Status'])>=0x0){return _0x3df19f[_0x6ffd('0x37')]({'read':!![]});}else{logger[_0x6ffd('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x6ffd('0x8c'),util['inspect'](_0x155d5c[_0x6ffd('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4b0ddb=_0x155d5c[_0x6ffd('0x5a')]['results'][0x0];if(_0x4b0ddb[_0x6ffd('0x33')][_0x6ffd('0x8d')]===_0x6ffd('0x8e')){return _0x3df19f[_0x6ffd('0x37')]({'read':!![]});}else{logger[_0x6ffd('0x28')](_0x6ffd('0x88'),_0x6ffd('0x33'),_0x6ffd('0x8f'),util[_0x6ffd('0x85')](_0x155d5c['body'],{'showHidden':![],'depth':null}));}break;}return _0x3df19f;}})[_0x6ffd('0x23')](respondWithResult(_0x40ea40,null))[_0x6ffd('0x2d')](handleError(_0x40ea40,null));}; \ No newline at end of file +var _0x8e4f=['SmsAccountId','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','status','json','undefined','count','limit','Content-Range','apply','reject','save','end','stack','name','send','index','map','SmsMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','rawAttributes','options','catch','body','find','params','destroy','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','update','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','SmsAccount'];(function(_0x2cbeb1,_0x480a89){var _0x4d8240=function(_0x3b9f4c){while(--_0x3b9f4c){_0x2cbeb1['push'](_0x2cbeb1['shift']());}};_0x4d8240(++_0x480a89);}(_0x8e4f,0xa9));var _0xf8e4=function(_0x1dded2,_0x46dbbc){_0x1dded2=_0x1dded2-0x0;var _0x3dfe8c=_0x8e4f[_0x1dded2];return _0x3dfe8c;};'use strict';var emlformat=require(_0xf8e4('0x0'));var rimraf=require(_0xf8e4('0x1'));var zipdir=require(_0xf8e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e4('0x3'));var moment=require(_0xf8e4('0x4'));var BPromise=require(_0xf8e4('0x5'));var Mustache=require(_0xf8e4('0x6'));var util=require('util');var path=require(_0xf8e4('0x7'));var sox=require(_0xf8e4('0x8'));var csv=require(_0xf8e4('0x9'));var ejs=require(_0xf8e4('0xa'));var fs=require('fs');var fs_extra=require(_0xf8e4('0xb'));var _=require(_0xf8e4('0xc'));var squel=require(_0xf8e4('0xd'));var crypto=require(_0xf8e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf8e4('0xf'));var toCsv=require(_0xf8e4('0x9'));var querystring=require(_0xf8e4('0x10'));var Papa=require(_0xf8e4('0x11'));var Redis=require('ioredis');var authService=require(_0xf8e4('0x12'));var qs=require(_0xf8e4('0x13'));var as=require(_0xf8e4('0x14'));var hardwareService=require(_0xf8e4('0x15'));var logger=require(_0xf8e4('0x16'))(_0xf8e4('0x17'));var utils=require('../../config/utils');var config=require(_0xf8e4('0x18'));var licenseUtil=require(_0xf8e4('0x19'));var db=require('../../mysqldb')['db'];config[_0xf8e4('0x1a')]=_[_0xf8e4('0x1b')](config[_0xf8e4('0x1a')],{'host':_0xf8e4('0x1c'),'port':0x18eb});var socket=require(_0xf8e4('0x1d'))(new Redis(config[_0xf8e4('0x1a')]));require(_0xf8e4('0x1e'))[_0xf8e4('0x1f')](socket);var jayson=require(_0xf8e4('0x20'));var client=jayson[_0xf8e4('0x21')][_0xf8e4('0x22')]({'port':0x232c});var client9002=jayson[_0xf8e4('0x21')][_0xf8e4('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x490aa8,_0x524868,_0x58480a,_0x397836){return new BPromise(function(_0xbcf106,_0xb73593){var _0x56f510=_0x397836||client;return _0x56f510[_0xf8e4('0x23')](_0x490aa8,_0x58480a)[_0xf8e4('0x24')](function(_0x292a87){logger['info'](_0xf8e4('0x25'),_0x524868,'request\x20sent');logger[_0xf8e4('0x26')](_0xf8e4('0x27'),_0x524868,_0xf8e4('0x28'),JSON[_0xf8e4('0x29')](_0x292a87));if(_0x292a87[_0xf8e4('0x2a')]){if(_0x292a87[_0xf8e4('0x2a')]['code']===0x1f4){logger[_0xf8e4('0x2a')](_0xf8e4('0x25'),_0x524868,_0x292a87['error'][_0xf8e4('0x2b')]);return _0xb73593(_0x292a87[_0xf8e4('0x2a')][_0xf8e4('0x2b')]);}logger[_0xf8e4('0x2a')](_0xf8e4('0x25'),_0x524868,_0x292a87[_0xf8e4('0x2a')][_0xf8e4('0x2b')]);return _0xbcf106(_0x292a87[_0xf8e4('0x2a')][_0xf8e4('0x2b')]);}else{logger[_0xf8e4('0x2c')](_0xf8e4('0x25'),_0x524868,_0xf8e4('0x28'));_0xbcf106(_0x292a87[_0xf8e4('0x2d')]['message']);}})['catch'](function(_0x14fd03){logger[_0xf8e4('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x524868,_0x14fd03);_0xb73593(_0x14fd03);});});}function respondWithStatusCode(_0x562a89,_0xdd4f3d){_0xdd4f3d=_0xdd4f3d||0xcc;return function(_0x4f72dd){if(_0x4f72dd){return _0x562a89[_0xf8e4('0x2e')](_0xdd4f3d);}return _0x562a89['status'](_0xdd4f3d)['end']();};}function respondWithResult(_0x5f57ef,_0x189f83){_0x189f83=_0x189f83||0xc8;return function(_0xf8a545){if(_0xf8a545){return _0x5f57ef[_0xf8e4('0x2f')](_0x189f83)[_0xf8e4('0x30')](_0xf8a545);}};}function respondWithFilteredResult(_0xe2881a,_0x1532ef){return function(_0x3136a7){if(_0x3136a7){var _0x425c09=typeof _0x1532ef['offset']===_0xf8e4('0x31')&&typeof _0x1532ef['limit']==='undefined';var _0x2aa6b=_0x3136a7[_0xf8e4('0x32')];var _0x3712a7=_0x425c09?0x0:_0x1532ef['offset'];var _0x32a1ee=_0x425c09?_0x3136a7[_0xf8e4('0x32')]:_0x1532ef['offset']+_0x1532ef[_0xf8e4('0x33')];var _0x1ee805;if(_0x32a1ee>=_0x2aa6b){_0x32a1ee=_0x2aa6b;_0x1ee805=0xc8;}else{_0x1ee805=0xce;}_0xe2881a[_0xf8e4('0x2f')](_0x1ee805);return _0xe2881a['set'](_0xf8e4('0x34'),_0x3712a7+'-'+_0x32a1ee+'/'+_0x2aa6b)['json'](_0x3136a7);}return null;};}function patchUpdates(_0x361266){return function(_0x14be48){try{jsonpatch[_0xf8e4('0x35')](_0x14be48,_0x361266,!![]);}catch(_0x862ef7){return BPromise[_0xf8e4('0x36')](_0x862ef7);}return _0x14be48[_0xf8e4('0x37')]();};}function saveUpdates(_0x38dd4d,_0x3e01a1){return function(_0x3e7b9c){if(_0x3e7b9c){return _0x3e7b9c['update'](_0x38dd4d)[_0xf8e4('0x24')](function(_0xdb4dbb){return _0xdb4dbb;});}return null;};}function removeEntity(_0x2e0aa6,_0x27223c){return function(_0x1a88c9){if(_0x1a88c9){return _0x1a88c9['destroy']()[_0xf8e4('0x24')](function(){_0x2e0aa6[_0xf8e4('0x2f')](0xcc)[_0xf8e4('0x38')]();});}};}function handleEntityNotFound(_0x55c43d,_0x3041df){return function(_0x364065){if(!_0x364065){_0x55c43d[_0xf8e4('0x2e')](0x194);}return _0x364065;};}function handleError(_0x28cb1a,_0x301eca){_0x301eca=_0x301eca||0x1f4;return function(_0x597e16){logger['error'](_0x597e16[_0xf8e4('0x39')]);if(_0x597e16[_0xf8e4('0x3a')]){delete _0x597e16[_0xf8e4('0x3a')];}_0x28cb1a[_0xf8e4('0x2f')](_0x301eca)[_0xf8e4('0x3b')](_0x597e16);};}exports[_0xf8e4('0x3c')]=function(_0xe9ba50,_0x14fb39){var _0xf8af35={},_0x266e15={},_0x166d73={'count':0x0,'rows':[]};var _0x3f6712=_[_0xf8e4('0x3d')](db[_0xf8e4('0x3e')]['rawAttributes'],function(_0x513aba){return{'name':_0x513aba['fieldName'],'type':_0x513aba[_0xf8e4('0x3f')][_0xf8e4('0x40')]};});_0x266e15[_0xf8e4('0x41')]=_[_0xf8e4('0x3d')](_0x3f6712,_0xf8e4('0x3a'));_0x266e15[_0xf8e4('0x42')]=_[_0xf8e4('0x43')](_0xe9ba50[_0xf8e4('0x42')]);_0x266e15[_0xf8e4('0x44')]=_[_0xf8e4('0x45')](_0x266e15[_0xf8e4('0x41')],_0x266e15[_0xf8e4('0x42')]);_0xf8af35[_0xf8e4('0x46')]=_[_0xf8e4('0x45')](_0x266e15[_0xf8e4('0x41')],qs['fields'](_0xe9ba50[_0xf8e4('0x42')][_0xf8e4('0x47')]));_0xf8af35[_0xf8e4('0x46')]=_0xf8af35[_0xf8e4('0x46')][_0xf8e4('0x48')]?_0xf8af35[_0xf8e4('0x46')]:_0x266e15[_0xf8e4('0x41')];if(!_0xe9ba50[_0xf8e4('0x42')][_0xf8e4('0x49')](_0xf8e4('0x4a'))){_0xf8af35['limit']=qs[_0xf8e4('0x33')](_0xe9ba50[_0xf8e4('0x42')][_0xf8e4('0x33')]);_0xf8af35[_0xf8e4('0x4b')]=qs[_0xf8e4('0x4b')](_0xe9ba50['query'][_0xf8e4('0x4b')]);}_0xf8af35['order']=qs[_0xf8e4('0x4c')](_0xe9ba50[_0xf8e4('0x42')]['sort']);_0xf8af35['where']=qs['filters'](_[_0xf8e4('0x4d')](_0xe9ba50['query'],_0x266e15['filters']),_0x3f6712);if(_0xe9ba50[_0xf8e4('0x42')]['filter']){_0xf8af35[_0xf8e4('0x4e')]=_[_0xf8e4('0x4f')](_0xf8af35[_0xf8e4('0x4e')],{'$or':_['map'](_0x3f6712,function(_0x3e2308){if(_0x3e2308[_0xf8e4('0x3f')]!==_0xf8e4('0x50')){var _0x42ce7c={};_0x42ce7c[_0x3e2308[_0xf8e4('0x3a')]]={'$like':'%'+_0xe9ba50[_0xf8e4('0x42')][_0xf8e4('0x51')]+'%'};return _0x42ce7c;}})});}_0xf8af35=_[_0xf8e4('0x4f')]({},_0xf8af35,_0xe9ba50['options']);var _0x32ed6a={'where':_0xf8af35[_0xf8e4('0x4e')]};return db[_0xf8e4('0x3e')][_0xf8e4('0x32')](_0x32ed6a)[_0xf8e4('0x24')](function(_0x2376cf){_0x166d73[_0xf8e4('0x32')]=_0x2376cf;if(_0xe9ba50[_0xf8e4('0x42')][_0xf8e4('0x52')]){_0xf8af35[_0xf8e4('0x53')]=[{'all':!![]}];}return db['SmsMessage'][_0xf8e4('0x54')](_0xf8af35);})[_0xf8e4('0x24')](function(_0x4f3d57){_0x166d73[_0xf8e4('0x55')]=_0x4f3d57;return _0x166d73;})[_0xf8e4('0x24')](respondWithFilteredResult(_0x14fb39,_0xf8af35))['catch'](handleError(_0x14fb39,null));};exports['show']=function(_0x16585f,_0x1d9157){var _0x4a128c={'raw':!![],'where':{'id':_0x16585f['params']['id']}},_0x3e8a0d={};_0x3e8a0d[_0xf8e4('0x41')]=_['keys'](db[_0xf8e4('0x3e')][_0xf8e4('0x56')]);_0x3e8a0d[_0xf8e4('0x42')]=_[_0xf8e4('0x43')](_0x16585f[_0xf8e4('0x42')]);_0x3e8a0d[_0xf8e4('0x44')]=_['intersection'](_0x3e8a0d[_0xf8e4('0x41')],_0x3e8a0d[_0xf8e4('0x42')]);_0x4a128c[_0xf8e4('0x46')]=_[_0xf8e4('0x45')](_0x3e8a0d[_0xf8e4('0x41')],qs[_0xf8e4('0x47')](_0x16585f[_0xf8e4('0x42')][_0xf8e4('0x47')]));_0x4a128c[_0xf8e4('0x46')]=_0x4a128c[_0xf8e4('0x46')]['length']?_0x4a128c[_0xf8e4('0x46')]:_0x3e8a0d['model'];if(_0x16585f[_0xf8e4('0x42')][_0xf8e4('0x52')]){_0x4a128c[_0xf8e4('0x53')]=[{'all':!![]}];}_0x4a128c=_[_0xf8e4('0x4f')]({},_0x4a128c,_0x16585f[_0xf8e4('0x57')]);return db[_0xf8e4('0x3e')]['find'](_0x4a128c)[_0xf8e4('0x24')](handleEntityNotFound(_0x1d9157,null))[_0xf8e4('0x24')](respondWithResult(_0x1d9157,null))[_0xf8e4('0x58')](handleError(_0x1d9157,null));};exports['create']=function(_0x46c69a,_0x24653a){return db[_0xf8e4('0x3e')]['create'](_0x46c69a['body'],{})[_0xf8e4('0x24')](respondWithResult(_0x24653a,0xc9))[_0xf8e4('0x58')](handleError(_0x24653a,null));};exports['update']=function(_0x330c63,_0xa8a9a7){if(_0x330c63[_0xf8e4('0x59')]['id']){delete _0x330c63[_0xf8e4('0x59')]['id'];}return db[_0xf8e4('0x3e')][_0xf8e4('0x5a')]({'where':{'id':_0x330c63[_0xf8e4('0x5b')]['id']}})[_0xf8e4('0x24')](handleEntityNotFound(_0xa8a9a7,null))[_0xf8e4('0x24')](saveUpdates(_0x330c63['body'],null))['then'](respondWithResult(_0xa8a9a7,null))[_0xf8e4('0x58')](handleError(_0xa8a9a7,null));};exports[_0xf8e4('0x5c')]=function(_0xe2a7b1,_0x5553c3){return db[_0xf8e4('0x3e')][_0xf8e4('0x5a')]({'where':{'id':_0xe2a7b1[_0xf8e4('0x5b')]['id']}})[_0xf8e4('0x24')](handleEntityNotFound(_0x5553c3,null))[_0xf8e4('0x24')](removeEntity(_0x5553c3,null))[_0xf8e4('0x58')](handleError(_0x5553c3,null));};exports[_0xf8e4('0x5d')]=function(_0x41a6c3,_0x4a8df7){return db['SmsMessage'][_0xf8e4('0x5d')]()[_0xf8e4('0x24')](respondWithResult(_0x4a8df7,null))[_0xf8e4('0x58')](handleError(_0x4a8df7,null));};var interaction_log=require('../../config/logger')(_0xf8e4('0x5e'));exports['accept']=function(_0x1e42c1,_0x2f1ef9,_0x563971){var _0x2c5a93={'agent':{},'channel':_0xf8e4('0x5f')};if(_0x1e42c1[_0xf8e4('0x59')]['id']){delete _0x1e42c1[_0xf8e4('0x59')]['id'];}_0x1e42c1['body'][_0xf8e4('0x60')]=!![];_0x1e42c1[_0xf8e4('0x59')][_0xf8e4('0x61')]=moment()[_0xf8e4('0x62')](_0xf8e4('0x63'));_0x1e42c1[_0xf8e4('0x59')][_0xf8e4('0x64')]=_0x1e42c1[_0xf8e4('0x59')][_0xf8e4('0x64')]||_0x1e42c1[_0xf8e4('0x65')]['id'];_0x2c5a93[_0xf8e4('0x66')]['id']=_0x1e42c1['body'][_0xf8e4('0x64')];return db[_0xf8e4('0x3e')]['find']({'where':{'id':_0x1e42c1[_0xf8e4('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f1ef9,null))[_0xf8e4('0x24')](saveUpdates(_0x1e42c1[_0xf8e4('0x59')],null))[_0xf8e4('0x24')](function(_0x255d8e){if(_0x255d8e){_0x2c5a93['message']=_0x255d8e[_0xf8e4('0x67')]({'plain':!![]});return db['SmsInteraction'][_0xf8e4('0x5a')]({'where':{'id':_0x255d8e[_0xf8e4('0x68')]}});}return null;})[_0xf8e4('0x24')](handleEntityNotFound(_0x2f1ef9,null))[_0xf8e4('0x24')](function(_0x2830bb){if(_0x2830bb){return _0x2830bb[_0xf8e4('0x69')]({'UserId':_0x1e42c1[_0xf8e4('0x59')][_0xf8e4('0x64')],'read1stAt':_[_0xf8e4('0x6a')](_0x2830bb['read1stAt'])?moment()[_0xf8e4('0x62')](_0xf8e4('0x63')):undefined});}return null;})['then'](function(_0x484bc5){if(_0x484bc5){_0x2c5a93[_0xf8e4('0x6b')]=_0x484bc5[_0xf8e4('0x67')]({'plain':!![]});interaction_log['info'](_0xf8e4('0x6c'),_0x1e42c1[_0xf8e4('0x65')]['id'],_0x1e42c1[_0xf8e4('0x65')][_0xf8e4('0x3a')],_0x1e42c1['user'][_0xf8e4('0x6d')],_0x2c5a93['interaction']['id'],_0x1e42c1[_0xf8e4('0x59')]?JSON[_0xf8e4('0x29')](_0x1e42c1[_0xf8e4('0x59')]):_0xf8e4('0x6e'));return respondWithRpcPromise(_0xf8e4('0x6f'),_0xf8e4('0x70'),_0x2c5a93);}return null;})[_0xf8e4('0x24')](function(_0x174772){var _0x368af=_0xf8e4('0x71')+_0x174772[_0xf8e4('0x2b')]['ContactId'];return db[_0xf8e4('0x72')][_0xf8e4('0x42')](_0x368af,{'type':db[_0xf8e4('0x73')]['QueryTypes'][_0xf8e4('0x74')],'raw':!![]})[_0xf8e4('0x24')](function(_0x4a4d71){return _0x4a4d71;});})['then'](function(_0x17ca26){if(_0x17ca26){_0x2c5a93[_0xf8e4('0x2b')][_0xf8e4('0x75')]=_0x17ca26[0x0];if(!_0x1e42c1['body'][_0xf8e4('0x64')])return;return db[_0xf8e4('0x76')][_0xf8e4('0x5a')]({'where':{'id':_0x1e42c1[_0xf8e4('0x59')]['UserId'],'role':_0xf8e4('0x66')},'attributes':['id',_0xf8e4('0x3a'),_0xf8e4('0x77'),_0xf8e4('0x78'),_0xf8e4('0x79')],'raw':!![]});}return null;})['then'](function(_0xfbdd21){if(!_0xfbdd21)return null;_0x2c5a93[_0xf8e4('0x2b')][_0xf8e4('0x66')]=_0xfbdd21;return _0x2c5a93;})[_0xf8e4('0x24')](function(_0xdb0c9){if(_0xdb0c9){if(_0x1e42c1['body'][_0xf8e4('0x7a')]){_0x2c5a93[_0xf8e4('0x2b')][_0xf8e4('0x7b')]=util[_0xf8e4('0x62')]('SIP/%s',_0x1e42c1[_0xf8e4('0x65')]['name']);_0x2c5a93[_0xf8e4('0x2b')][_0xf8e4('0x7c')]=_0x2c5a93['channel'];_0x2c5a93[_0xf8e4('0x2b')][_0xf8e4('0x7d')]=_0x2c5a93[_0xf8e4('0x7c')];_0x2c5a93[_0xf8e4('0x2b')][_0xf8e4('0x7e')]=_0xf8e4('0x7f');return respondWithRpcPromise(_0xf8e4('0x80'),_0xf8e4('0x80'),{'event':_0xf8e4('0x81'),'message':_0x2c5a93[_0xf8e4('0x2b')]},client9002)[_0xf8e4('0x24')](function(){return _0x2c5a93;});}return _0x2c5a93;}return null;})[_0xf8e4('0x24')](respondWithResult(_0x2f1ef9,null))['catch'](handleError(_0x2f1ef9,null));};var interaction_log=require(_0xf8e4('0x16'))(_0xf8e4('0x5e'));exports['reject']=function(_0x1b6b61,_0x4d8d13,_0x7727f5){var _0x177bed={'agent':{},'channel':'sms'};if(_0x1b6b61[_0xf8e4('0x59')]['id']){delete _0x1b6b61[_0xf8e4('0x59')]['id'];}_0x1b6b61[_0xf8e4('0x59')]['UserId']=_0x1b6b61[_0xf8e4('0x59')]['UserId']||_0x1b6b61[_0xf8e4('0x65')]['id'];_0x177bed['agent']['id']=_0x1b6b61[_0xf8e4('0x59')]['UserId'];return db['SmsMessage'][_0xf8e4('0x5a')]({'where':{'id':_0x1b6b61['params']['id'],'UserId':null}})[_0xf8e4('0x24')](handleEntityNotFound(_0x4d8d13,null))[_0xf8e4('0x24')](function(_0x1abb97){if(_0x1abb97){_0x177bed[_0xf8e4('0x2b')]=_0x1abb97[_0xf8e4('0x67')]({'plain':!![]});return db[_0xf8e4('0x82')][_0xf8e4('0x5a')]({'where':{'id':_0x1abb97[_0xf8e4('0x68')]}});}return null;})[_0xf8e4('0x24')](handleEntityNotFound(_0x4d8d13,null))[_0xf8e4('0x24')](function(_0x234d67){if(_0x234d67){_0x177bed[_0xf8e4('0x6b')]=_0x234d67[_0xf8e4('0x67')]({'plain':!![]});interaction_log[_0xf8e4('0x2c')](_0xf8e4('0x83'),_0x1b6b61[_0xf8e4('0x65')]['id'],_0x1b6b61[_0xf8e4('0x65')][_0xf8e4('0x3a')],_0x1b6b61[_0xf8e4('0x65')]['role'],_0x177bed[_0xf8e4('0x6b')]['id'],_0x1b6b61[_0xf8e4('0x59')]?JSON[_0xf8e4('0x29')](_0x1b6b61[_0xf8e4('0x59')]):_0xf8e4('0x6e'));return respondWithRpcPromise(_0xf8e4('0x84'),_0xf8e4('0x85'),_0x177bed);}return null;})['then'](function(_0x36d9db){var _0x166d9f=_0xf8e4('0x71')+_0x36d9db[_0xf8e4('0x2b')][_0xf8e4('0x86')];return db['sequelize'][_0xf8e4('0x42')](_0x166d9f,{'type':db[_0xf8e4('0x73')][_0xf8e4('0x87')][_0xf8e4('0x74')],'raw':!![]})[_0xf8e4('0x24')](function(_0xcc5530){return _0xcc5530;});})[_0xf8e4('0x24')](function(_0x24c82c){if(_0x24c82c){_0x177bed[_0xf8e4('0x2b')][_0xf8e4('0x75')]=_0x24c82c[0x0];if(!_0x1b6b61[_0xf8e4('0x59')][_0xf8e4('0x64')])return;return db['User'][_0xf8e4('0x5a')]({'where':{'id':_0x1b6b61['body'][_0xf8e4('0x64')],'role':_0xf8e4('0x66')},'attributes':['id',_0xf8e4('0x3a'),_0xf8e4('0x77'),_0xf8e4('0x78'),_0xf8e4('0x79')],'raw':!![]});}return null;})['then'](function(_0x10972e){if(!_0x10972e)return null;_0x177bed[_0xf8e4('0x2b')][_0xf8e4('0x66')]=_0x10972e;return _0x177bed;})[_0xf8e4('0x24')](function(_0x20e568){if(_0x20e568){_0x20e568['message'][_0xf8e4('0x7b')]=util['format']('SIP/%s',_0x1b6b61[_0xf8e4('0x65')][_0xf8e4('0x3a')]);_0x20e568['message']['channel']=_0x177bed['channel'];_0x20e568[_0xf8e4('0x2b')][_0xf8e4('0x7d')]=_0x177bed['channel'];_0x20e568[_0xf8e4('0x2b')][_0xf8e4('0x7e')]=_0xf8e4('0x36');respondWithRpcPromise(_0xf8e4('0x80'),_0xf8e4('0x80'),{'event':'rejectmessage','message':_0x20e568[_0xf8e4('0x2b')]},client9002);return _0x177bed;}return null;})[_0xf8e4('0x24')](respondWithResult(_0x4d8d13,null))[_0xf8e4('0x58')](handleError(_0x4d8d13,null));};exports[_0xf8e4('0x2f')]=function(_0x53ce13,_0x456f86,_0x4796e7){if(_0x53ce13[_0xf8e4('0x59')]['id']){delete _0x53ce13[_0xf8e4('0x59')]['id'];}var _0x4b5684;return db[_0xf8e4('0x3e')][_0xf8e4('0x5a')]({'where':{'id':_0x53ce13[_0xf8e4('0x5b')]['id']}})[_0xf8e4('0x24')](handleEntityNotFound(_0x456f86,null))[_0xf8e4('0x24')](function(_0xaefa4){if(_0xaefa4){_0x4b5684=_0xaefa4;return db[_0xf8e4('0x88')][_0xf8e4('0x5a')]({'where':{'id':_0xaefa4[_0xf8e4('0x89')]}});}})[_0xf8e4('0x24')](handleEntityNotFound(_0x456f86,null))[_0xf8e4('0x24')](function(_0x28d7bc){if(_0x28d7bc){logger['debug'](_0xf8e4('0x27'),_0xf8e4('0x2f'),'received\x20delivery\x20report\x20from',_0x28d7bc['type'],util[_0xf8e4('0x8a')](_0x53ce13[_0xf8e4('0x59')],{'showHidden':![],'depth':null}));switch(_0x28d7bc['type']){case _0xf8e4('0x8b'):if(_0x53ce13[_0xf8e4('0x59')][_0xf8e4('0x8c')]&&_0x53ce13['body'][_0xf8e4('0x8c')]===_0x4b5684[_0xf8e4('0x8d')]){return _0x4b5684[_0xf8e4('0x69')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf8e4('0x2f'),_0xf8e4('0x8b'),util[_0xf8e4('0x8a')](_0x53ce13[_0xf8e4('0x59')],{'showHidden':![],'depth':null}));}break;case _0xf8e4('0x8e'):if(_0x53ce13[_0xf8e4('0x59')]['MessageUUID']&&_0x53ce13['body'][_0xf8e4('0x8f')]===_0x4b5684[_0xf8e4('0x8d')]&&_[_0xf8e4('0x90')](['sent',_0xf8e4('0x91')],_0x53ce13[_0xf8e4('0x59')][_0xf8e4('0x92')])>=0x0){return _0x4b5684['update']({'read':!![]});}else{logger[_0xf8e4('0x2a')](_0xf8e4('0x93'),_0xf8e4('0x2f'),_0xf8e4('0x94'),util['inspect'](_0x53ce13[_0xf8e4('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x257059=_0x53ce13[_0xf8e4('0x59')][_0xf8e4('0x95')][0x0];if(_0x257059['status'][_0xf8e4('0x96')]===_0xf8e4('0x97')){return _0x4b5684['update']({'read':!![]});}else{logger[_0xf8e4('0x2a')](_0xf8e4('0x93'),_0xf8e4('0x2f'),_0xf8e4('0x98'),util['inspect'](_0x53ce13[_0xf8e4('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x4b5684;}})['then'](respondWithResult(_0x456f86,null))['catch'](handleError(_0x456f86,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index a6f95d6..02f1d5c 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 _0xa5b1=['SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0xa5b1,0x1dc));var _0x1a5b=function(_0xa9d9c4,_0x2cfe0c){_0xa9d9c4=_0xa9d9c4-0x0;var _0x18d97e=_0xa5b1[_0xa9d9c4];return _0x18d97e;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x1a5b('0x0'))['db'][_0x1a5b('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1a5b('0x2')](0x0);var events={'afterCreate':_0x1a5b('0x3'),'afterUpdate':_0x1a5b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15ee7e){return function(_0x21e575,_0x211d2c,_0x46880d){SmsMessageEvents[_0x1a5b('0x5')](_0x15ee7e+':'+_0x21e575['id'],_0x21e575);SmsMessageEvents[_0x1a5b('0x5')](_0x15ee7e,_0x21e575);_0x46880d(null);};}for(var e in events){if(events[_0x1a5b('0x6')](e)){var event=events[e];SmsMessage[_0x1a5b('0x7')](e,emitEvent(event));}}module[_0x1a5b('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xbf91=['hook','exports','events','../../mysqldb','SmsMessage','save','update','remove','hasOwnProperty'];(function(_0x4012af,_0x4b4385){var _0x4dd469=function(_0x13ff5a){while(--_0x13ff5a){_0x4012af['push'](_0x4012af['shift']());}};_0x4dd469(++_0x4b4385);}(_0xbf91,0x14f));var _0x1bf9=function(_0x245e9c,_0x3846b6){_0x245e9c=_0x245e9c-0x0;var _0x423cb0=_0xbf91[_0x245e9c];return _0x423cb0;};'use strict';var EventEmitter=require(_0x1bf9('0x0'));var SmsMessage=require(_0x1bf9('0x1'))['db'][_0x1bf9('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1bf9('0x3'),'afterUpdate':_0x1bf9('0x4'),'afterDestroy':_0x1bf9('0x5')};function emitEvent(_0x12f0e0){return function(_0x173a11,_0x327231,_0x466e01){SmsMessageEvents['emit'](_0x12f0e0+':'+_0x173a11['id'],_0x173a11);SmsMessageEvents['emit'](_0x12f0e0,_0x173a11);_0x466e01(null);};}for(var e in events){if(events[_0x1bf9('0x6')](e)){var event=events[e];SmsMessage[_0x1bf9('0x7')](e,emitEvent(event));}}module[_0x1bf9('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 21c0e93..637af82 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 _0x7bf9=['Bearer\x20','message','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','models','get','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','createdAt','toLowerCase','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','token','sid','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','data','queued_count','head','messages','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','text','keys','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','uuid','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x7bf9,0x81));var _0x97bf=function(_0x225beb,_0xa3f3c4){_0x225beb=_0x225beb-0x0;var _0x1e7824=_0x7bf9[_0x225beb];return _0x1e7824;};'use strict';var _=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x97bf('0x2'));var BPromise=require('bluebird');var rp=require(_0x97bf('0x3'));var fs=require('fs');var path=require(_0x97bf('0x4'));var rimraf=require(_0x97bf('0x5'));var config=require(_0x97bf('0x6'));var attributes=require(_0x97bf('0x7'));module[_0x97bf('0x8')]=function(_0x2bbbe0,_0x1d284f){return _0x2bbbe0[_0x97bf('0x9')]('SmsMessage',attributes,{'tableName':_0x97bf('0xa'),'paranoid':![],'indexes':[{'name':_0x97bf('0xb'),'fields':[_0x97bf('0xb')]},{'name':_0x97bf('0xc'),'fields':[_0x97bf('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd74f66,_0x2e3048,_0x430e6b){var _0x3ec437=_0x2bbbe0[_0x97bf('0xe')];var _0x1f724c=_0xd74f66[_0x97bf('0xf')]({'plain':!![]});if(_0x1f724c[_0x97bf('0x10')]['toLowerCase']()==='in'||_0x1f724c['direction']['toLowerCase']()===_0x97bf('0x11')&&!_0x1f724c[_0x97bf('0x12')]&&!_[_0x97bf('0x13')](_0x1f724c[_0x97bf('0x14')])&&!_[_0x97bf('0x13')](_0x1f724c[_0x97bf('0x15')])){_0x3ec437[_0x97bf('0x16')]['findOne']({'where':{'id':_0x1f724c[_0x97bf('0x15')]}})[_0x97bf('0x17')](function(_0x160aca){if(_0x160aca){_0x160aca['update']({'lastMsgAt':_0x1f724c[_0x97bf('0x18')],'lastMsgDirection':_0x1f724c[_0x97bf('0x10')][_0x97bf('0x19')]()});}})['catch'](function(_0x4061a5){console[_0x97bf('0x1a')](_0x4061a5);});}if(_0x1f724c[_0x97bf('0x10')]===_0x97bf('0x11')&&!_0x1f724c[_0x97bf('0x12')]){var _0x321d0d;_0x3ec437[_0x97bf('0x1b')]['find']({'where':{'id':_0x1f724c[_0x97bf('0x1c')]},'raw':!![]})[_0x97bf('0x17')](function(_0x7faa35){_0x321d0d=_0x7faa35;if(_0x321d0d&&_0x321d0d[_0x97bf('0x1d')]){switch(_0x321d0d[_0x97bf('0x1d')]){case _0x97bf('0x1e'):var _0x1f01a4=require(_0x97bf('0x1e'));if(_0x321d0d[_0x97bf('0x1f')]&&_0x321d0d[_0x97bf('0x20')]&&_0x321d0d[_0x97bf('0x21')]){var _0x4d0a08=new _0x1f01a4(_0x321d0d[_0x97bf('0x1f')],_0x321d0d[_0x97bf('0x20')]);_0x4d0a08['messages'][_0x97bf('0x22')]({'body':_0x1f724c[_0x97bf('0xd')],'to':_0x1f724c[_0x97bf('0x21')],'from':_0x321d0d['phone'],'statusCallback':_0x321d0d[_0x97bf('0x23')]+_0x97bf('0x24')+_0x1f724c['id']+'/status?token='+_0x321d0d[_0x97bf('0x25')]})[_0x97bf('0x17')](function(_0x4ee1c3){if(_0x4ee1c3[_0x97bf('0x26')]){return _0xd74f66[_0x97bf('0x27')]({'messageId':_0x4ee1c3['sid']});}})[_0x97bf('0x28')](function(_0x2d137d){logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x1e'),util[_0x97bf('0x2b')](_0x2d137d,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),'twilio',_0x97bf('0x2c'));}break;case _0x97bf('0x2d'):var _0x414d46=_0x97bf('0x2e');if(_0x321d0d[_0x97bf('0x2f')]&&_0x321d0d[_0x97bf('0x30')]){var _0x3ec094={'recipient':[_0x1f724c['phone']],'message':_0x1f724c[_0x97bf('0xd')],'message_type':_0x321d0d[_0x97bf('0x31')]};if(_0x321d0d[_0x97bf('0x31')]&&_0x321d0d['smsMethod']!=='SI'){_0x3ec094[_0x97bf('0x32')]=_0x321d0d[_0x97bf('0x21')];}var _0x5544a3={'url':_0x414d46+_0x97bf('0x33')+_0x321d0d[_0x97bf('0x2f')]+'&password='+_0x321d0d[_0x97bf('0x30')],'method':'GET'};rp(_0x5544a3)[_0x97bf('0x17')](function(_0x444fe5){var _0x14d39e=_0x444fe5[_0x97bf('0x34')](';');var _0x2ad161={'user_key':_0x14d39e[0x0],'session_key':_0x14d39e[0x1]};_0x5544a3={'url':_0x414d46+_0x97bf('0x35'),'method':_0x97bf('0x36'),'headers':{'user_key':_0x2ad161[_0x97bf('0x37')],'Session_key':_0x2ad161[_0x97bf('0x38')]},'json':!![],'body':_0x3ec094};return rp(_0x5544a3);})[_0x97bf('0x17')](function(_0x37f94b){if(_0x37f94b[_0x97bf('0x39')]>=0x1){var _0x4b2035={'messageId':_0x37f94b[_0x97bf('0x3a')]};if(_0x321d0d[_0x97bf('0x31')]!=='GP'||!_0x321d0d[_0x97bf('0x3b')]){_0x4b2035[_0x97bf('0x3c')]=!![];}return _0xd74f66[_0x97bf('0x27')](_0x4b2035);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x97bf('0x2a'),_0x97bf('0x2d'),util[_0x97bf('0x2b')](_0x37f94b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4744e4){return logger[_0x97bf('0x1a')](_0x97bf('0x29'),'afterCreate','skebby',util[_0x97bf('0x2b')](_0x4744e4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x97bf('0x29'),_0x97bf('0x2a'),'skebby',_0x97bf('0x3d'));}break;case'connectel':if(_0x321d0d['authToken']){var _0x559dbb={'recipient':_0x1f724c['phone'],'message':_0x1f724c['body'],'sender':_0x321d0d[_0x97bf('0x3e')]||_0x321d0d[_0x97bf('0x21')],'authorization':_0x321d0d[_0x97bf('0x20')]};var _0x2e3048={'method':'POST','uri':_0x97bf('0x3f'),'body':_0x559dbb,'json':!![]};rp(_0x2e3048)['then'](function(_0xee631c){var _0x59ddc9={'messageId':_0xee631c[_0x97bf('0x40')]};if(!_0x321d0d[_0x97bf('0x3b')]){_0x59ddc9[_0x97bf('0x3c')]=!![];}return _0xd74f66[_0x97bf('0x27')](_0x59ddc9);})[_0x97bf('0x28')](function(_0x9c634d){logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x41'),util[_0x97bf('0x2b')](_0x9c634d,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),'afterCreate',_0x97bf('0x41'),_0x97bf('0x42'));}break;case _0x97bf('0x43'):if(_0x321d0d[_0x97bf('0x2f')]&&_0x321d0d[_0x97bf('0x30')]){var _0x559dbb={'messages':[{'source':'xCALLY\x20Motion','to':_0x1f724c['phone'],'body':_0x1f724c[_0x97bf('0xd')],'from':_0x321d0d['senderString']||_0x321d0d['phone']}]};var _0x1fec78=util[_0x97bf('0x44')](_0x97bf('0x45'),_0x321d0d[_0x97bf('0x2f')],_0x321d0d[_0x97bf('0x30')]);var _0x2e3048={'method':_0x97bf('0x36'),'uri':_0x97bf('0x46'),'body':_0x559dbb,'headers':{'Authorization':util['format'](_0x97bf('0x47'),new Buffer(_0x1fec78)[_0x97bf('0x48')](_0x97bf('0x49')))},'json':!![]};rp(_0x2e3048)[_0x97bf('0x17')](function(_0x1346b7){if(_0x1346b7['http_code']>=0xc8&&_0x1346b7['http_code']<=0xce){if(_0x1346b7[_0x97bf('0x4a')]&&_0x1346b7[_0x97bf('0x4a')][_0x97bf('0x4b')]>0x0){var _0x439dc8=_[_0x97bf('0x4c')](_0x1346b7[_0x97bf('0x4a')][_0x97bf('0x4d')]);var _0x1a8171={'messageId':_0x439dc8[_0x97bf('0x4e')]};if(!_0x321d0d['deliveryReport']){_0x1a8171['read']=!![];}return _0xd74f66['update'](_0x1a8171);}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x4f'),util[_0x97bf('0x2b')](_0x1346b7,{'showHidden':![],'depth':null}));}}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x4f'),util['inspect'](_0x1346b7,{'showHidden':![],'depth':null}));}})[_0x97bf('0x28')](function(_0x4c4218){logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x4f'),util['inspect'](_0x4c4218,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x97bf('0x2a'),_0x97bf('0x4f'),_0x97bf('0x3d'));}break;case _0x97bf('0x50'):if(_0x321d0d[_0x97bf('0x51')]&&_0x321d0d[_0x97bf('0x20')]){var _0x559dbb={'dst':_0x1f724c[_0x97bf('0x21')],'text':_0x1f724c['body'],'src':_0x321d0d[_0x97bf('0x3e')]||_0x321d0d['phone'],'url':_0x321d0d[_0x97bf('0x23')]+_0x97bf('0x24')+_0x1f724c['id']+_0x97bf('0x52')+_0x321d0d[_0x97bf('0x25')]};var _0x1fec78=util[_0x97bf('0x44')](_0x97bf('0x45'),_0x321d0d['authId'],_0x321d0d[_0x97bf('0x20')]);var _0x2e3048={'method':'POST','uri':util[_0x97bf('0x44')](_0x97bf('0x53'),_0x321d0d[_0x97bf('0x51')]),'body':_0x559dbb,'headers':{'Authorization':util[_0x97bf('0x44')](_0x97bf('0x47'),new Buffer(_0x1fec78)[_0x97bf('0x48')](_0x97bf('0x49')))},'json':!![]};rp(_0x2e3048)['then'](function(_0x54beab){var _0x22cf9b={'messageId':_0x54beab[_0x97bf('0x54')][0x0]};return _0xd74f66[_0x97bf('0x27')](_0x22cf9b);})[_0x97bf('0x28')](function(_0x114f5d){logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),'plivo',util[_0x97bf('0x2b')](_0x114f5d,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x50'),_0x97bf('0x55'));}break;case'infobip':if(_0x321d0d['username']&&_0x321d0d[_0x97bf('0x30')]){if(_0x321d0d[_0x97bf('0x56')]){var _0x33162e={'method':'POST','uri':_0x321d0d[_0x97bf('0x56')]+_0x97bf('0x57'),'body':{'username':_0x321d0d['username'],'password':_0x321d0d[_0x97bf('0x30')]},'json':!![]};return rp(_0x33162e)[_0x97bf('0x17')](function(_0xe7b6d){var _0x2deee5={'method':_0x97bf('0x36'),'uri':_0x321d0d['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x321d0d['phone'],'destinations':[{'to':_0x1f724c[_0x97bf('0x21')]}],'text':_0x1f724c[_0x97bf('0xd')],'notifyUrl':_0x321d0d[_0x97bf('0x23')]+_0x97bf('0x24')+_0x1f724c['id']+_0x97bf('0x52')+_0x321d0d['token'],'notifyContentType':_0x97bf('0x58'),'callbackData':_0x321d0d[_0x97bf('0x21')]+';'+_0x1f724c[_0x97bf('0xd')]}]},'headers':{'Authorization':_0x97bf('0x59')+_0xe7b6d[_0x97bf('0x25')]},'json':!![]};return rp(_0x2deee5)[_0x97bf('0x17')](function(_0x30000f){if(_0x30000f['messages']){var _0x4bf555={'messageId':_0x30000f[_0x97bf('0x4d')][0x0][_0x97bf('0xb')]};if(!_0x321d0d[_0x97bf('0x3b')]){_0x4bf555[_0x97bf('0x3c')]=!![];}return _0xd74f66['update'](_0x4bf555);}else{return logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x5a'),util['inspect'](_0x30000f,{'showHidden':![],'depth':null}));}});})[_0x97bf('0x28')](function(_0x28c643){return logger['error'](_0x97bf('0x29'),'afterCreate',_0x97bf('0x5a'),util['inspect'](_0x28c643,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),'afterCreate','infobip',_0x97bf('0x5b'));}}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),'infobip',_0x97bf('0x3d'));}break;case'csc':var _0x364d47=require(_0x97bf('0x5c'));if(_0x321d0d[_0x97bf('0x5d')]){var _0x32d82d={};_0x32d82d['login']=_0x321d0d[_0x97bf('0x2f')];_0x32d82d[_0x97bf('0x21')]=_0x1f724c['phone'];_0x32d82d['sender']=_0x321d0d[_0x97bf('0x21')];_0x32d82d[_0x97bf('0x5e')]=_0x1f724c[_0x97bf('0xd')];_0x32d82d['timestamp']=+new Date();var _0x1c59f6='';var _0x3df60c='';var _0x532c13=Object[_0x97bf('0x5f')](_0x32d82d);_0x532c13['sort']();for(var _0x5aea81=0x0;_0x5aea81<_0x532c13['length'];_0x5aea81++){if(_0x1c59f6!=''){_0x1c59f6+='&';}_0x1c59f6+=_0x532c13[_0x5aea81]+'='+encodeURIComponent(_0x32d82d[_0x532c13[_0x5aea81]]);_0x3df60c+=_0x32d82d[_0x532c13[_0x5aea81]];}_0x3df60c+=_0x321d0d[_0x97bf('0x5d')];_0x3df60c=_0x364d47['createHash'](_0x97bf('0x60'))[_0x97bf('0x27')](_0x3df60c)[_0x97bf('0x61')](_0x97bf('0x62'));if(_0x1c59f6!==''){_0x1c59f6+='&';}_0x1c59f6+=_0x97bf('0x63')+_0x3df60c;var _0x5544a3={'method':_0x97bf('0x64'),'uri':_0x321d0d[_0x97bf('0x56')]+_0x97bf('0x65')+_0x1c59f6,'json':!![]};return rp(_0x5544a3)[_0x97bf('0x17')](function(_0x443756){var _0x5e0cbf=Object['keys'](_0x443756);if(_0x443756[_0x5e0cbf[0x0]][_0x97bf('0x1a')]&&parseInt(_0x443756[_0x5e0cbf[0x0]][_0x97bf('0x1a')])===0x0){var _0x47c031={'messageId':_0x443756[_0x5e0cbf[0x0]][_0x97bf('0x66')]};if(!_0x321d0d[_0x97bf('0x3b')]){_0x47c031['read']=!![];}return _0xd74f66['update'](_0x47c031);}else{return logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),'csc',util[_0x97bf('0x2b')](_0x443756[_0x97bf('0x1a')],{'showHidden':![],'depth':null}));}})[_0x97bf('0x28')](function(_0x5e4d79){return logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x67'),util['inspect'](_0x5e4d79,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x67'),_0x97bf('0x68'));}break;case'clickatell':if(_0x321d0d[_0x97bf('0x5d')]){var _0x5bdd03={'method':_0x97bf('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x321d0d[_0x97bf('0x5d')]},'body':{'content':_0x1f724c[_0x97bf('0xd')],'to':[_0x1f724c[_0x97bf('0x21')]],'from':_0x321d0d[_0x97bf('0x21')],'binary':![],'clientMessageId':_0x97bf('0x69'),'charset':'UTF-8'},'json':!![]};rp(_0x5bdd03)[_0x97bf('0x17')](function(_0x43c9dc){if(!_0x43c9dc[_0x97bf('0x1a')]){var _0x133199={'messageId':_0x43c9dc['messages'][0x0]['apiMessageId']};if(!_0x321d0d[_0x97bf('0x3b')]){_0x133199['read']=!![];}return _0xd74f66['update'](_0x133199);}else{return logger['error'](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x6a'),util[_0x97bf('0x2b')](_0x43c9dc[_0x97bf('0x1a')],{'showHidden':![],'depth':null}));}})[_0x97bf('0x28')](function(_0xdfa5ce){return logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),_0x97bf('0x6a'),util['inspect'](_0xdfa5ce,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),'clickatell',_0x97bf('0x68'));}break;case'bandwidth':if(_0x321d0d[_0x97bf('0x2f')]&&_0x321d0d['password']){var _0x1fec78=util[_0x97bf('0x44')](_0x97bf('0x45'),_0x321d0d[_0x97bf('0x2f')],_0x321d0d[_0x97bf('0x30')]);var _0x2e3048={'method':'POST','uri':_0x97bf('0x6b')+_0x321d0d[_0x97bf('0x6c')]+_0x97bf('0x6d'),'body':{'to':[_0x1f724c[_0x97bf('0x21')]],'text':_0x1f724c[_0x97bf('0xd')],'from':_0x321d0d[_0x97bf('0x21')],'applicationId':_0x321d0d['applicationId']},'headers':{'Authorization':util['format'](_0x97bf('0x47'),new Buffer(_0x1fec78)[_0x97bf('0x48')](_0x97bf('0x49')))},'json':!![]};rp(_0x2e3048)[_0x97bf('0x17')](function(_0x38dcbd){if(_0x38dcbd['id']){var _0x167bb7={'messageId':_0x38dcbd['id']};return _0xd74f66['update'](_0x167bb7);}else{logger[_0x97bf('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x97bf('0x2a'),_0x97bf('0x6e'),util['inspect'](_0x38dcbd,{'showHidden':![],'depth':null}));}})[_0x97bf('0x28')](function(_0x607ba5){logger[_0x97bf('0x1a')](_0x97bf('0x29'),'afterCreate',_0x97bf('0x6e'),util[_0x97bf('0x2b')](_0x607ba5,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),'bandwidth',_0x97bf('0x3d'));}break;case _0x97bf('0x6f'):if(_0x321d0d['apiKey']){var _0x349da1={};var _0x5544a3={'method':_0x97bf('0x36'),'uri':_0x97bf('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x321d0d['apiKey'],'Content-Type':_0x97bf('0x58')},'body':{'from':_0x321d0d[_0x97bf('0x21')],'to':_0x1f724c[_0x97bf('0x21')],'text':_0x1f724c[_0x97bf('0xd')]},'json':!![]};return rp(_0x5544a3)[_0x97bf('0x17')](function(_0x55d28a){if(_0x55d28a[_0x97bf('0x71')]==0xca){_0x349da1['message']=_0x55d28a;var _0x393c8c={'method':_0x97bf('0x36'),'uri':_0x97bf('0x72'),'headers':{'Authorization':_0x97bf('0x73')+_0x321d0d['apiKey'],'Content-Type':_0x97bf('0x58')},'body':{'refid':_0x349da1[_0x97bf('0x74')][_0x97bf('0x75')]},'json':!![]};return rp(_0x393c8c)[_0x97bf('0x17')](function(_0x43212c){_0x349da1[_0x97bf('0x76')]=_0x43212c;var _0x54d7f9={'messageId':_0x349da1[_0x97bf('0x74')][_0x97bf('0x75')],'read':!![]};return _0xd74f66[_0x97bf('0x27')](_0x54d7f9);});}else{return logger[_0x97bf('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x97bf('0x6f'),util['inspect'](_0x55d28a,{'showHidden':![],'depth':null}));}})[_0x97bf('0x28')](function(_0x9de8eb){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x97bf('0x6f'),util[_0x97bf('0x2b')](_0x9de8eb,{'showHidden':![],'depth':null}));});}else{return logger[_0x97bf('0x1a')](_0x97bf('0x29'),_0x97bf('0x2a'),'intelepeer',_0x97bf('0x77'));}break;}}})[_0x97bf('0x78')](function(){_0x430e6b();});}else{_0x430e6b();}}},'charset':'utf8mb4','collate':_0x97bf('0x79')});}; \ No newline at end of file +var _0x2143=['find','SmsAccountId','type','twilio','accountSid','authToken','create','phone','remote','/api/sms/messages/','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','update','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','messages','message_id','clickSend','authId','/status?token=','token','format','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','sort','length','md5','digest','hex','signature=','/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','status','refid','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','error','secret','SmsAccount'];(function(_0x21817b,_0x597793){var _0x43368b=function(_0x4ca6b7){while(--_0x4ca6b7){_0x21817b['push'](_0x21817b['shift']());}};_0x43368b(++_0x597793);}(_0x2143,0x163));var _0x3214=function(_0x11b8ae,_0x485fa8){_0x11b8ae=_0x11b8ae-0x0;var _0x35a448=_0x2143[_0x11b8ae];return _0x35a448;};'use strict';var _=require('lodash');var util=require(_0x3214('0x0'));var logger=require(_0x3214('0x1'))('api');var moment=require(_0x3214('0x2'));var BPromise=require(_0x3214('0x3'));var rp=require(_0x3214('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3214('0x5'));var config=require(_0x3214('0x6'));var attributes=require(_0x3214('0x7'));module[_0x3214('0x8')]=function(_0x3976b1,_0x5a97c2){return _0x3976b1[_0x3214('0x9')](_0x3214('0xa'),attributes,{'tableName':_0x3214('0xb'),'paranoid':![],'indexes':[{'name':_0x3214('0xc'),'fields':[_0x3214('0xc')]},{'name':'fti_sms_messages','fields':[_0x3214('0xd')],'type':_0x3214('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d844a,_0x3901a0,_0x272d3c){var _0x2d015e=_0x3976b1[_0x3214('0xf')];var _0x5a7e78=_0x4d844a['get']({'plain':!![]});if(_0x5a7e78[_0x3214('0x10')][_0x3214('0x11')]()==='in'||_0x5a7e78[_0x3214('0x10')]['toLowerCase']()===_0x3214('0x12')&&!_0x5a7e78['secret']&&!_[_0x3214('0x13')](_0x5a7e78[_0x3214('0x14')])&&!_[_0x3214('0x13')](_0x5a7e78['SmsInteractionId'])){_0x2d015e[_0x3214('0x15')][_0x3214('0x16')]({'where':{'id':_0x5a7e78[_0x3214('0x17')]}})[_0x3214('0x18')](function(_0x3d91ce){if(_0x3d91ce){_0x3d91ce['update']({'lastMsgAt':_0x5a7e78[_0x3214('0x19')],'lastMsgDirection':_0x5a7e78[_0x3214('0x10')][_0x3214('0x11')]()});}})['catch'](function(_0x1b00fc){console[_0x3214('0x1a')](_0x1b00fc);});}if(_0x5a7e78[_0x3214('0x10')]==='out'&&!_0x5a7e78[_0x3214('0x1b')]){var _0x3c8c17;_0x2d015e[_0x3214('0x1c')][_0x3214('0x1d')]({'where':{'id':_0x5a7e78[_0x3214('0x1e')]},'raw':!![]})[_0x3214('0x18')](function(_0x22a8a6){_0x3c8c17=_0x22a8a6;if(_0x3c8c17&&_0x3c8c17[_0x3214('0x1f')]){switch(_0x3c8c17[_0x3214('0x1f')]){case _0x3214('0x20'):var _0x4d2456=require(_0x3214('0x20'));if(_0x3c8c17[_0x3214('0x21')]&&_0x3c8c17[_0x3214('0x22')]&&_0x3c8c17['phone']){var _0x50cb86=new _0x4d2456(_0x3c8c17[_0x3214('0x21')],_0x3c8c17['authToken']);_0x50cb86['messages'][_0x3214('0x23')]({'body':_0x5a7e78[_0x3214('0xd')],'to':_0x5a7e78[_0x3214('0x24')],'from':_0x3c8c17[_0x3214('0x24')],'statusCallback':_0x3c8c17[_0x3214('0x25')]+_0x3214('0x26')+_0x5a7e78['id']+'/status?token='+_0x3c8c17['token']})[_0x3214('0x18')](function(_0xfb4016){if(_0xfb4016[_0x3214('0x27')]){return _0x4d844a['update']({'messageId':_0xfb4016[_0x3214('0x27')]});}})[_0x3214('0x28')](function(_0x23f91a){logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x20'),util[_0x3214('0x2a')](_0x23f91a,{'showHidden':![],'depth':null}));});}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x3214('0x2c'):var _0x289267=_0x3214('0x2d');if(_0x3c8c17['username']&&_0x3c8c17[_0x3214('0x2e')]){var _0x826760={'recipient':[_0x5a7e78[_0x3214('0x24')]],'message':_0x5a7e78[_0x3214('0xd')],'message_type':_0x3c8c17['smsMethod']};if(_0x3c8c17['smsMethod']&&_0x3c8c17[_0x3214('0x2f')]!=='SI'){_0x826760[_0x3214('0x30')]=_0x3c8c17[_0x3214('0x24')];}var _0x503c0f={'url':_0x289267+_0x3214('0x31')+_0x3c8c17[_0x3214('0x32')]+_0x3214('0x33')+_0x3c8c17['password'],'method':_0x3214('0x34')};rp(_0x503c0f)['then'](function(_0x152686){var _0x384cbc=_0x152686[_0x3214('0x35')](';');var _0x52d708={'user_key':_0x384cbc[0x0],'session_key':_0x384cbc[0x1]};_0x503c0f={'url':_0x289267+_0x3214('0x36'),'method':_0x3214('0x37'),'headers':{'user_key':_0x52d708[_0x3214('0x38')],'Session_key':_0x52d708[_0x3214('0x39')]},'json':!![],'body':_0x826760};return rp(_0x503c0f);})[_0x3214('0x18')](function(_0x428b29){if(_0x428b29['total_sent']>=0x1){var _0x1be688={'messageId':_0x428b29[_0x3214('0x3a')]};if(_0x3c8c17[_0x3214('0x2f')]!=='GP'||!_0x3c8c17[_0x3214('0x3b')]){_0x1be688[_0x3214('0x3c')]=!![];}return _0x4d844a[_0x3214('0x3d')](_0x1be688);}else{return logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',util[_0x3214('0x2a')](_0x428b29,{'showHidden':![],'depth':null}));}})[_0x3214('0x28')](function(_0x12b046){return logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x2c'),util['inspect'](_0x12b046,{'showHidden':![],'depth':null}));});}else{logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x2c'),_0x3214('0x3e'));}break;case'connectel':if(_0x3c8c17[_0x3214('0x22')]){var _0x5147ef={'recipient':_0x5a7e78[_0x3214('0x24')],'message':_0x5a7e78[_0x3214('0xd')],'sender':_0x3c8c17['senderString']||_0x3c8c17[_0x3214('0x24')],'authorization':_0x3c8c17[_0x3214('0x22')]};var _0x3901a0={'method':_0x3214('0x37'),'uri':_0x3214('0x3f'),'body':_0x5147ef,'json':!![]};rp(_0x3901a0)['then'](function(_0x213c05){var _0x71e0d7={'messageId':_0x213c05[_0x3214('0x40')]};if(!_0x3c8c17[_0x3214('0x3b')]){_0x71e0d7[_0x3214('0x3c')]=!![];}return _0x4d844a[_0x3214('0x3d')](_0x71e0d7);})[_0x3214('0x28')](function(_0x57655f){logger['error'](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x41'),util['inspect'](_0x57655f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),'connectel',_0x3214('0x42'));}break;case'clicksend':if(_0x3c8c17[_0x3214('0x32')]&&_0x3c8c17[_0x3214('0x2e')]){var _0x5147ef={'messages':[{'source':_0x3214('0x43'),'to':_0x5a7e78[_0x3214('0x24')],'body':_0x5a7e78[_0x3214('0xd')],'from':_0x3c8c17[_0x3214('0x44')]||_0x3c8c17['phone']}]};var _0x27ea6a=util['format'](_0x3214('0x45'),_0x3c8c17[_0x3214('0x32')],_0x3c8c17['password']);var _0x3901a0={'method':_0x3214('0x37'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x5147ef,'headers':{'Authorization':util['format'](_0x3214('0x46'),new Buffer(_0x27ea6a)[_0x3214('0x47')](_0x3214('0x48')))},'json':!![]};rp(_0x3901a0)[_0x3214('0x18')](function(_0x4a30dd){if(_0x4a30dd['http_code']>=0xc8&&_0x4a30dd[_0x3214('0x49')]<=0xce){if(_0x4a30dd['data']&&_0x4a30dd[_0x3214('0x4a')][_0x3214('0x4b')]>0x0){var _0x29bc93=_['head'](_0x4a30dd['data'][_0x3214('0x4c')]);var _0x1fa4cf={'messageId':_0x29bc93[_0x3214('0x4d')]};if(!_0x3c8c17[_0x3214('0x3b')]){_0x1fa4cf[_0x3214('0x3c')]=!![];}return _0x4d844a[_0x3214('0x3d')](_0x1fa4cf);}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),'afterCreate','clickSend',util[_0x3214('0x2a')](_0x4a30dd,{'showHidden':![],'depth':null}));}}else{logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x4e'),util[_0x3214('0x2a')](_0x4a30dd,{'showHidden':![],'depth':null}));}})[_0x3214('0x28')](function(_0x29c11d){logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x4e'),util[_0x3214('0x2a')](_0x29c11d,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x3c8c17[_0x3214('0x4f')]&&_0x3c8c17[_0x3214('0x22')]){var _0x5147ef={'dst':_0x5a7e78[_0x3214('0x24')],'text':_0x5a7e78[_0x3214('0xd')],'src':_0x3c8c17[_0x3214('0x44')]||_0x3c8c17['phone'],'url':_0x3c8c17['remote']+_0x3214('0x26')+_0x5a7e78['id']+_0x3214('0x50')+_0x3c8c17[_0x3214('0x51')]};var _0x27ea6a=util[_0x3214('0x52')]('%s:%s',_0x3c8c17['authId'],_0x3c8c17[_0x3214('0x22')]);var _0x3901a0={'method':_0x3214('0x37'),'uri':util['format'](_0x3214('0x53'),_0x3c8c17[_0x3214('0x4f')]),'body':_0x5147ef,'headers':{'Authorization':util['format'](_0x3214('0x46'),new Buffer(_0x27ea6a)['toString'](_0x3214('0x48')))},'json':!![]};rp(_0x3901a0)[_0x3214('0x18')](function(_0x11180d){var _0x38f8d8={'messageId':_0x11180d[_0x3214('0x54')][0x0]};return _0x4d844a[_0x3214('0x3d')](_0x38f8d8);})[_0x3214('0x28')](function(_0x403cea){logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x55'),util[_0x3214('0x2a')](_0x403cea,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x55'),_0x3214('0x56'));}break;case _0x3214('0x57'):if(_0x3c8c17[_0x3214('0x32')]&&_0x3c8c17[_0x3214('0x2e')]){if(_0x3c8c17[_0x3214('0x58')]){var _0x2190f6={'method':_0x3214('0x37'),'uri':_0x3c8c17[_0x3214('0x58')]+_0x3214('0x59'),'body':{'username':_0x3c8c17[_0x3214('0x32')],'password':_0x3c8c17['password']},'json':!![]};return rp(_0x2190f6)[_0x3214('0x18')](function(_0x55958e){var _0x32f87e={'method':'POST','uri':_0x3c8c17[_0x3214('0x58')]+_0x3214('0x5a'),'body':{'messages':[{'from':_0x3c8c17['phone'],'destinations':[{'to':_0x5a7e78[_0x3214('0x24')]}],'text':_0x5a7e78[_0x3214('0xd')],'notifyUrl':_0x3c8c17[_0x3214('0x25')]+'/api/sms/messages/'+_0x5a7e78['id']+'/status?token='+_0x3c8c17[_0x3214('0x51')],'notifyContentType':'application/json','callbackData':_0x3c8c17[_0x3214('0x24')]+';'+_0x5a7e78[_0x3214('0xd')]}]},'headers':{'Authorization':_0x3214('0x5b')+_0x55958e[_0x3214('0x51')]},'json':!![]};return rp(_0x32f87e)[_0x3214('0x18')](function(_0x2e1acb){if(_0x2e1acb[_0x3214('0x4c')]){var _0x3d5a62={'messageId':_0x2e1acb[_0x3214('0x4c')][0x0][_0x3214('0xc')]};if(!_0x3c8c17[_0x3214('0x3b')]){_0x3d5a62[_0x3214('0x3c')]=!![];}return _0x4d844a['update'](_0x3d5a62);}else{return logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x57'),util[_0x3214('0x2a')](_0x2e1acb,{'showHidden':![],'depth':null}));}});})[_0x3214('0x28')](function(_0x17e3e5){return logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x57'),util['inspect'](_0x17e3e5,{'showHidden':![],'depth':null}));});}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),'infobip',_0x3214('0x5c'));}}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3214('0x5d'):var _0x1e5970=require('crypto');if(_0x3c8c17[_0x3214('0x5e')]){var _0x42cb1b={};_0x42cb1b[_0x3214('0x5f')]=_0x3c8c17['username'];_0x42cb1b[_0x3214('0x24')]=_0x5a7e78[_0x3214('0x24')];_0x42cb1b['sender']=_0x3c8c17[_0x3214('0x24')];_0x42cb1b[_0x3214('0x60')]=_0x5a7e78[_0x3214('0xd')];_0x42cb1b[_0x3214('0x61')]=+new Date();var _0xf30f74='';var _0x5f32fb='';var _0x25cc90=Object['keys'](_0x42cb1b);_0x25cc90[_0x3214('0x62')]();for(var _0xb16d39=0x0;_0xb16d39<_0x25cc90[_0x3214('0x63')];_0xb16d39++){if(_0xf30f74!=''){_0xf30f74+='&';}_0xf30f74+=_0x25cc90[_0xb16d39]+'='+encodeURIComponent(_0x42cb1b[_0x25cc90[_0xb16d39]]);_0x5f32fb+=_0x42cb1b[_0x25cc90[_0xb16d39]];}_0x5f32fb+=_0x3c8c17[_0x3214('0x5e')];_0x5f32fb=_0x1e5970['createHash'](_0x3214('0x64'))['update'](_0x5f32fb)[_0x3214('0x65')](_0x3214('0x66'));if(_0xf30f74!==''){_0xf30f74+='&';}_0xf30f74+=_0x3214('0x67')+_0x5f32fb;var _0x503c0f={'method':_0x3214('0x34'),'uri':_0x3c8c17[_0x3214('0x58')]+_0x3214('0x68')+_0xf30f74,'json':!![]};return rp(_0x503c0f)['then'](function(_0x4d44dc){var _0x11f2cf=Object[_0x3214('0x69')](_0x4d44dc);if(_0x4d44dc[_0x11f2cf[0x0]]['error']&&parseInt(_0x4d44dc[_0x11f2cf[0x0]][_0x3214('0x1a')])===0x0){var _0x122d5b={'messageId':_0x4d44dc[_0x11f2cf[0x0]]['id_sms']};if(!_0x3c8c17[_0x3214('0x3b')]){_0x122d5b['read']=!![];}return _0x4d844a[_0x3214('0x3d')](_0x122d5b);}else{return logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x5d'),util[_0x3214('0x2a')](_0x4d44dc['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x138bdc){return logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x5d'),util[_0x3214('0x2a')](_0x138bdc,{'showHidden':![],'depth':null}));});}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x5d'),_0x3214('0x6a'));}break;case _0x3214('0x6b'):if(_0x3c8c17[_0x3214('0x5e')]){var _0x128312={'method':'POST','uri':_0x3214('0x6c'),'headers':{'Authorization':_0x3c8c17[_0x3214('0x5e')]},'body':{'content':_0x5a7e78[_0x3214('0xd')],'to':[_0x5a7e78[_0x3214('0x24')]],'from':_0x3c8c17[_0x3214('0x24')],'binary':![],'clientMessageId':_0x3214('0x6d'),'charset':_0x3214('0x6e')},'json':!![]};rp(_0x128312)[_0x3214('0x18')](function(_0x43103e){if(!_0x43103e[_0x3214('0x1a')]){var _0x49559d={'messageId':_0x43103e[_0x3214('0x4c')][0x0][_0x3214('0x6f')]};if(!_0x3c8c17[_0x3214('0x3b')]){_0x49559d[_0x3214('0x3c')]=!![];}return _0x4d844a[_0x3214('0x3d')](_0x49559d);}else{return logger['error'](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x6b'),util[_0x3214('0x2a')](_0x43103e[_0x3214('0x1a')],{'showHidden':![],'depth':null}));}})[_0x3214('0x28')](function(_0x5752ee){return logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),'clickatell',util[_0x3214('0x2a')](_0x5752ee,{'showHidden':![],'depth':null}));});}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x6b'),_0x3214('0x6a'));}break;case _0x3214('0x70'):if(_0x3c8c17[_0x3214('0x32')]&&_0x3c8c17[_0x3214('0x2e')]){var _0x27ea6a=util[_0x3214('0x52')]('%s:%s',_0x3c8c17[_0x3214('0x32')],_0x3c8c17[_0x3214('0x2e')]);var _0x3901a0={'method':_0x3214('0x37'),'uri':_0x3214('0x71')+_0x3c8c17[_0x3214('0x72')]+_0x3214('0x73'),'body':{'to':[_0x5a7e78['phone']],'text':_0x5a7e78[_0x3214('0xd')],'from':_0x3c8c17[_0x3214('0x24')],'applicationId':_0x3c8c17[_0x3214('0x74')]},'headers':{'Authorization':util[_0x3214('0x52')]('Basic\x20%s',new Buffer(_0x27ea6a)[_0x3214('0x47')](_0x3214('0x48')))},'json':!![]};rp(_0x3901a0)[_0x3214('0x18')](function(_0x4c2f2f){if(_0x4c2f2f['id']){var _0x4f65e9={'messageId':_0x4c2f2f['id']};return _0x4d844a[_0x3214('0x3d')](_0x4f65e9);}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),_0x3214('0x70'),util[_0x3214('0x2a')](_0x4c2f2f,{'showHidden':![],'depth':null}));}})[_0x3214('0x28')](function(_0x20b955){logger[_0x3214('0x1a')](_0x3214('0x2b'),'afterCreate',_0x3214('0x70'),util[_0x3214('0x2a')](_0x20b955,{'showHidden':![],'depth':null}));});}else{logger[_0x3214('0x1a')](_0x3214('0x2b'),'afterCreate','bandwidth',_0x3214('0x3e'));}break;case'intelepeer':if(_0x3c8c17['apiKey']){var _0x2d21e4={};var _0x503c0f={'method':'POST','uri':_0x3214('0x75'),'headers':{'Authorization':_0x3214('0x76')+_0x3c8c17[_0x3214('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x3c8c17['phone'],'to':_0x5a7e78[_0x3214('0x24')],'text':_0x5a7e78[_0x3214('0xd')]},'json':!![]};return rp(_0x503c0f)[_0x3214('0x18')](function(_0x4b70eb){if(_0x4b70eb['code']==0xca){_0x2d21e4[_0x3214('0x77')]=_0x4b70eb;var _0x5e0b53={'method':_0x3214('0x37'),'uri':_0x3214('0x78'),'headers':{'Authorization':_0x3214('0x76')+_0x3c8c17[_0x3214('0x5e')],'Content-Type':_0x3214('0x79')},'body':{'refid':_0x2d21e4[_0x3214('0x77')]['refid']},'json':!![]};return rp(_0x5e0b53)[_0x3214('0x18')](function(_0x20f269){_0x2d21e4[_0x3214('0x7a')]=_0x20f269;var _0x712e63={'messageId':_0x2d21e4[_0x3214('0x77')][_0x3214('0x7b')],'read':!![]};return _0x4d844a['update'](_0x712e63);});}else{return logger[_0x3214('0x1a')](_0x3214('0x2b'),_0x3214('0x29'),'intelepeer',util['inspect'](_0x4b70eb,{'showHidden':![],'depth':null}));}})[_0x3214('0x28')](function(_0x4526a0){return logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x7c'),util['inspect'](_0x4526a0,{'showHidden':![],'depth':null}));});}else{return logger[_0x3214('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3214('0x29'),_0x3214('0x7c'),'Token\x20not\x20received');}break;}}})[_0x3214('0x7d')](function(){_0x272d3c();});}else{_0x272d3c();}}},'charset':_0x3214('0x7e'),'collate':_0x3214('0x7f')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 4e8f012..18bbdfd 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 _0x2e9f=['defaults','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x3ad8dc,_0x1b9b3e){var _0x21068e=function(_0x1c80f8){while(--_0x1c80f8){_0x3ad8dc['push'](_0x3ad8dc['shift']());}};_0x21068e(++_0x1b9b3e);}(_0x2e9f,0x114));var _0xf2e9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x2e9f[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xf2e9('0x0'));var util=require('util');var moment=require(_0xf2e9('0x1'));var BPromise=require(_0xf2e9('0x2'));var rs=require(_0xf2e9('0x3'));var fs=require('fs');var Redis=require(_0xf2e9('0x4'));var db=require(_0xf2e9('0x5'))['db'];var utils=require(_0xf2e9('0x6'));var logger=require(_0xf2e9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf2e9('0x8'));var client=jayson[_0xf2e9('0x9')][_0xf2e9('0xa')]({'port':0x232a});config[_0xf2e9('0xb')]=_[_0xf2e9('0xc')](config[_0xf2e9('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf2e9('0xd'))[_0xf2e9('0xe')](socket);function respondWithRpcPromise(_0x142f40,_0x349a0,_0x1ece65){return new BPromise(function(_0x3eb097,_0x3034c3){return client['request'](_0x142f40,_0x1ece65)[_0xf2e9('0xf')](function(_0x483084){logger[_0xf2e9('0x10')](_0xf2e9('0x11'),_0x349a0,_0xf2e9('0x12'));logger[_0xf2e9('0x13')](_0xf2e9('0x14'),_0x349a0,_0xf2e9('0x12'),JSON[_0xf2e9('0x15')](_0x483084));if(_0x483084[_0xf2e9('0x16')]){if(_0x483084['error'][_0xf2e9('0x17')]===0x1f4){logger[_0xf2e9('0x16')](_0xf2e9('0x11'),_0x349a0,_0x483084['error'][_0xf2e9('0x18')]);return _0x3034c3(_0x483084[_0xf2e9('0x16')][_0xf2e9('0x18')]);}logger[_0xf2e9('0x16')](_0xf2e9('0x11'),_0x349a0,_0x483084['error']['message']);return _0x3eb097(_0x483084[_0xf2e9('0x16')][_0xf2e9('0x18')]);}else{logger[_0xf2e9('0x10')]('SmsMessage,\x20%s,\x20%s',_0x349a0,_0xf2e9('0x12'));_0x3eb097(_0x483084['result'][_0xf2e9('0x18')]);}})[_0xf2e9('0x19')](function(_0x3edb56){logger[_0xf2e9('0x16')](_0xf2e9('0x11'),_0x349a0,_0x3edb56);_0x3034c3(_0x3edb56);});});}exports[_0xf2e9('0x1a')]=function(_0x2fcdfd){var _0x4c2c81=this;return new Promise(function(_0x21b88f,_0x3aad29){return db[_0xf2e9('0x1b')][_0xf2e9('0x1c')](_0x2fcdfd[_0xf2e9('0x1d')],{'raw':_0x2fcdfd[_0xf2e9('0x1e')]?_0x2fcdfd[_0xf2e9('0x1e')][_0xf2e9('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x25abe5){logger[_0xf2e9('0x10')](_0xf2e9('0x1a'),_0x2fcdfd);logger[_0xf2e9('0x13')](_0xf2e9('0x1a'),_0x2fcdfd,JSON['stringify'](_0x25abe5));_0x21b88f(_0x25abe5);})['catch'](function(_0x774a3a){logger[_0xf2e9('0x16')]('CreateSmsMessage',_0x774a3a[_0xf2e9('0x18')],_0x2fcdfd);_0x3aad29(_0x4c2c81[_0xf2e9('0x16')](0x1f4,_0x774a3a['message']));});});}; \ No newline at end of file +var _0x7eee=['redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xc32056,_0x3c8455){var _0x56e04f=function(_0x515a6a){while(--_0x515a6a){_0xc32056['push'](_0xc32056['shift']());}};_0x56e04f(++_0x3c8455);}(_0x7eee,0x13f));var _0xe7ee=function(_0x9b8427,_0x400bfc){_0x9b8427=_0x9b8427-0x0;var _0x4e3711=_0x7eee[_0x9b8427];return _0x4e3711;};'use strict';var _=require(_0xe7ee('0x0'));var util=require(_0xe7ee('0x1'));var moment=require('moment');var BPromise=require(_0xe7ee('0x2'));var rs=require(_0xe7ee('0x3'));var fs=require('fs');var Redis=require(_0xe7ee('0x4'));var db=require(_0xe7ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7ee('0x6'))(_0xe7ee('0x7'));var config=require(_0xe7ee('0x8'));var jayson=require(_0xe7ee('0x9'));var client=jayson['client'][_0xe7ee('0xa')]({'port':0x232a});config[_0xe7ee('0xb')]=_[_0xe7ee('0xc')](config[_0xe7ee('0xb')],{'host':_0xe7ee('0xd'),'port':0x18eb});var socket=require(_0xe7ee('0xe'))(new Redis(config[_0xe7ee('0xb')]));require(_0xe7ee('0xf'))['register'](socket);function respondWithRpcPromise(_0x444c3d,_0x61df02,_0x22e8b7){return new BPromise(function(_0x3a1294,_0x39d9ff){return client['request'](_0x444c3d,_0x22e8b7)[_0xe7ee('0x10')](function(_0x21f239){logger['info'](_0xe7ee('0x11'),_0x61df02,_0xe7ee('0x12'));logger[_0xe7ee('0x13')](_0xe7ee('0x14'),_0x61df02,_0xe7ee('0x12'),JSON[_0xe7ee('0x15')](_0x21f239));if(_0x21f239[_0xe7ee('0x16')]){if(_0x21f239[_0xe7ee('0x16')][_0xe7ee('0x17')]===0x1f4){logger[_0xe7ee('0x16')](_0xe7ee('0x11'),_0x61df02,_0x21f239[_0xe7ee('0x16')][_0xe7ee('0x18')]);return _0x39d9ff(_0x21f239['error'][_0xe7ee('0x18')]);}logger[_0xe7ee('0x16')](_0xe7ee('0x11'),_0x61df02,_0x21f239['error'][_0xe7ee('0x18')]);return _0x3a1294(_0x21f239['error'][_0xe7ee('0x18')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x61df02,_0xe7ee('0x12'));_0x3a1294(_0x21f239[_0xe7ee('0x19')][_0xe7ee('0x18')]);}})[_0xe7ee('0x1a')](function(_0x3f8da4){logger[_0xe7ee('0x16')]('SmsMessage,\x20%s,\x20%s',_0x61df02,_0x3f8da4);_0x39d9ff(_0x3f8da4);});});}exports[_0xe7ee('0x1b')]=function(_0x484b00){var _0x13b56f=this;return new Promise(function(_0x2c3f61,_0x7f5af1){return db[_0xe7ee('0x1c')][_0xe7ee('0x1d')](_0x484b00[_0xe7ee('0x1e')],{'raw':_0x484b00['options']?_0x484b00[_0xe7ee('0x1f')][_0xe7ee('0x20')]===undefined?!![]:![]:!![]})[_0xe7ee('0x10')](function(_0x262ba3){logger['info'](_0xe7ee('0x1b'),_0x484b00);logger[_0xe7ee('0x13')](_0xe7ee('0x1b'),_0x484b00,JSON[_0xe7ee('0x15')](_0x262ba3));_0x2c3f61(_0x262ba3);})[_0xe7ee('0x1a')](function(_0x4808b8){logger[_0xe7ee('0x16')](_0xe7ee('0x1b'),_0x4808b8[_0xe7ee('0x18')],_0x484b00);_0x7f5af1(_0x13b56f['error'](0x1f4,_0x4808b8['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 34790b1..fd1731f 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 _0x4fc3=['./smsMessage.events','save','remove','update','emit','removeListener','register','length','smsMessage:'];(function(_0x579cce,_0x31b8d4){var _0x2ea60a=function(_0x1561a9){while(--_0x1561a9){_0x579cce['push'](_0x579cce['shift']());}};_0x2ea60a(++_0x31b8d4);}(_0x4fc3,0x1d4));var _0x34fc=function(_0x5bd8b3,_0x26a7ac){_0x5bd8b3=_0x5bd8b3-0x0;var _0x323c25=_0x4fc3[_0x5bd8b3];return _0x323c25;};'use strict';var SmsMessageEvents=require(_0x34fc('0x0'));var events=[_0x34fc('0x1'),_0x34fc('0x2'),_0x34fc('0x3')];function createListener(_0x1f207b,_0x2b18fa){return function(_0x2cb481){_0x2b18fa[_0x34fc('0x4')](_0x1f207b,_0x2cb481);};}function removeListener(_0x5773ff,_0x70d0f2){return function(){SmsMessageEvents[_0x34fc('0x5')](_0x5773ff,_0x70d0f2);};}exports[_0x34fc('0x6')]=function(_0x5e71ad){for(var _0x130f5e=0x0,_0x378edb=events[_0x34fc('0x7')];_0x130f5e<_0x378edb;_0x130f5e++){var _0xda9d3b=events[_0x130f5e];var _0x4272a9=createListener(_0x34fc('0x8')+_0xda9d3b,_0x5e71ad);SmsMessageEvents['on'](_0xda9d3b,_0x4272a9);}}; \ No newline at end of file +var _0x4531=['remove','update','emit','removeListener','register','smsMessage:','./smsMessage.events','save'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4531,0xb6));var _0x1453=function(_0x262baa,_0x283058){_0x262baa=_0x262baa-0x0;var _0x4f2257=_0x4531[_0x262baa];return _0x4f2257;};'use strict';var SmsMessageEvents=require(_0x1453('0x0'));var events=[_0x1453('0x1'),_0x1453('0x2'),_0x1453('0x3')];function createListener(_0x211fd8,_0x14ee50){return function(_0x23b4d3){_0x14ee50[_0x1453('0x4')](_0x211fd8,_0x23b4d3);};}function removeListener(_0x5ae8df,_0x5c030e){return function(){SmsMessageEvents[_0x1453('0x5')](_0x5ae8df,_0x5c030e);};}exports[_0x1453('0x6')]=function(_0x3ef1f2){for(var _0x65cbfb=0x0,_0x2af141=events['length'];_0x65cbfb<_0x2af141;_0x65cbfb++){var _0x607c8c=events[_0x65cbfb];var _0x5ad976=createListener(_0x1453('0x7')+_0x607c8c,_0x3ef1f2);SmsMessageEvents['on'](_0x607c8c,_0x5ad976);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index bba88ac..fb4b813 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 _0xb3a0=['addAgents','/:id','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','index','/describe','describe','show','getMembers','/:id/teams','isAuthenticated','/:id/users','getAgents','post','create','addTeams'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb3a0,0x1d2));var _0x0b3a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb3a0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0b3a('0x0'));var util=require('util');var path=require(_0x0b3a('0x1'));var timeout=require(_0x0b3a('0x2'));var express=require('express');var router=express[_0x0b3a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0b3a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0b3a('0x5'));var controller=require(_0x0b3a('0x6'));router[_0x0b3a('0x7')]('/',auth['isAuthenticated'](),controller[_0x0b3a('0x8')]);router[_0x0b3a('0x7')](_0x0b3a('0x9'),auth['isAuthenticated'](),controller[_0x0b3a('0xa')]);router[_0x0b3a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0b3a('0xb')]);router[_0x0b3a('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x0b3a('0xc')]);router[_0x0b3a('0x7')](_0x0b3a('0xd'),auth[_0x0b3a('0xe')](),controller['getTeams']);router[_0x0b3a('0x7')](_0x0b3a('0xf'),auth[_0x0b3a('0xe')](),controller[_0x0b3a('0x10')]);router[_0x0b3a('0x11')]('/',auth['isAuthenticated'](),controller[_0x0b3a('0x12')]);router[_0x0b3a('0x11')](_0x0b3a('0xd'),auth[_0x0b3a('0xe')](),controller[_0x0b3a('0x13')]);router[_0x0b3a('0x11')]('/:id/users',auth[_0x0b3a('0xe')](),controller[_0x0b3a('0x14')]);router['put'](_0x0b3a('0x15'),auth[_0x0b3a('0xe')](),controller[_0x0b3a('0x16')]);router[_0x0b3a('0x17')](_0x0b3a('0x15'),auth[_0x0b3a('0xe')](),controller['destroy']);router[_0x0b3a('0x17')]('/:id/teams',auth[_0x0b3a('0xe')](),controller[_0x0b3a('0x18')]);router[_0x0b3a('0x17')](_0x0b3a('0xf'),auth[_0x0b3a('0xe')](),controller[_0x0b3a('0x19')]);module[_0x0b3a('0x1a')]=router; \ No newline at end of file +var _0x428b=['delete','destroy','removeTeams','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','put','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x428b,0xb2));var _0xb428=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x428b[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0xb428('0x0'));var path=require(_0xb428('0x1'));var timeout=require(_0xb428('0x2'));var express=require('express');var router=express[_0xb428('0x3')]();var fs_extra=require(_0xb428('0x4'));var auth=require(_0xb428('0x5'));var interaction=require(_0xb428('0x6'));var config=require(_0xb428('0x7'));var controller=require(_0xb428('0x8'));router[_0xb428('0x9')]('/',auth[_0xb428('0xa')](),controller[_0xb428('0xb')]);router[_0xb428('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb428('0xc')]);router['get'](_0xb428('0xd'),auth[_0xb428('0xa')](),controller['show']);router['get'](_0xb428('0xe'),auth[_0xb428('0xa')](),controller[_0xb428('0xf')]);router[_0xb428('0x9')](_0xb428('0x10'),auth[_0xb428('0xa')](),controller[_0xb428('0x11')]);router['get'](_0xb428('0x12'),auth[_0xb428('0xa')](),controller[_0xb428('0x13')]);router['post']('/',auth[_0xb428('0xa')](),controller[_0xb428('0x14')]);router['post'](_0xb428('0x10'),auth['isAuthenticated'](),controller[_0xb428('0x15')]);router[_0xb428('0x16')](_0xb428('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0xb428('0x17')](_0xb428('0xd'),auth[_0xb428('0xa')](),controller[_0xb428('0x18')]);router[_0xb428('0x19')](_0xb428('0xd'),auth[_0xb428('0xa')](),controller[_0xb428('0x1a')]);router[_0xb428('0x19')](_0xb428('0x10'),auth[_0xb428('0xa')](),controller[_0xb428('0x1b')]);router[_0xb428('0x19')](_0xb428('0x12'),auth[_0xb428('0xa')](),controller['removeAgents']);module[_0xb428('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 8960c77..686afca 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 _0xdbe1=['beepall','roundrobin','sequelize','exports'];(function(_0x23465b,_0x3480e8){var _0x57f30d=function(_0x311bfd){while(--_0x311bfd){_0x23465b['push'](_0x23465b['shift']());}};_0x57f30d(++_0x3480e8);}(_0xdbe1,0x1da));var _0x1dbe=function(_0x26a3ac,_0x4b01c7){_0x26a3ac=_0x26a3ac-0x0;var _0x246608=_0xdbe1[_0x26a3ac];return _0x246608;};'use strict';var Sequelize=require(_0x1dbe('0x0'));module[_0x1dbe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1dbe('0x2'),_0x1dbe('0x3'))}}; \ No newline at end of file +var _0x262a=['beepall','roundrobin','sequelize','STRING','ENUM','rrmemory'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x262a,0x1e2));var _0xa262=function(_0x15ddc9,_0x209223){_0x15ddc9=_0x15ddc9-0x0;var _0x2fc9e8=_0x262a[_0x15ddc9];return _0x2fc9e8;};'use strict';var Sequelize=require(_0xa262('0x0'));module['exports']={'name':{'type':Sequelize[_0xa262('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa262('0x2')](_0xa262('0x3'),_0xa262('0x4'),_0xa262('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 1ba58a6..b2f0f34 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 _0x2ef3=['intersection','attributes','model','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','describe','getMembers','findOne','UserSmsQueue','filters','hasOwnProperty','order','sort','pick','SmsQueueId','filter','User','findAndCountAll','agent','updatedAt','createdAt','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','flatMap','each','findOrCreate','removeTeams','Agents','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','TeamId','union','compact','value','transaction','isEmpty','emit','addAgents','spread','userSmsQueue:save','removeAgents','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','destroy','get','SmsQueues','UserProfileResource','name','map','SmsQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys'];(function(_0x11027f,_0xda81fc){var _0x30c508=function(_0x517f8b){while(--_0x517f8b){_0x11027f['push'](_0x11027f['shift']());}};_0x30c508(++_0xda81fc);}(_0x2ef3,0xba));var _0x32ef=function(_0x257087,_0x18e359){_0x257087=_0x257087-0x0;var _0x20141f=_0x2ef3[_0x257087];return _0x20141f;};'use strict';var BPromise=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));var squel=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var qs=require(_0x32ef('0x5'));var logger=require('../../config/logger')(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x8')]=_[_0x32ef('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x32ef('0xa'))(new Redis(config[_0x32ef('0x8')]));require(_0x32ef('0xb'))[_0x32ef('0xc')](socket);function respondWithStatusCode(_0x234863,_0x298066){_0x298066=_0x298066||0xcc;return function(_0x2484a0){if(_0x2484a0){return _0x234863[_0x32ef('0xd')](_0x298066);}return _0x234863[_0x32ef('0xe')](_0x298066)[_0x32ef('0xf')]();};}function respondWithResult(_0x56eb42,_0x5780e9){_0x5780e9=_0x5780e9||0xc8;return function(_0x401d0b){if(_0x401d0b){return _0x56eb42[_0x32ef('0xe')](_0x5780e9)[_0x32ef('0x10')](_0x401d0b);}};}function respondWithFilteredResult(_0x1499c2,_0x5af651){return function(_0x193714){if(_0x193714){var _0x5afcc2=typeof _0x5af651[_0x32ef('0x11')]==='undefined'&&typeof _0x5af651[_0x32ef('0x12')]===_0x32ef('0x13');var _0x5c3eb9=_0x193714['count'];var _0x19ce1=_0x5afcc2?0x0:_0x5af651['offset'];var _0x326fce=_0x5afcc2?_0x193714[_0x32ef('0x14')]:_0x5af651[_0x32ef('0x11')]+_0x5af651[_0x32ef('0x12')];var _0x57aff1;if(_0x326fce>=_0x5c3eb9){_0x326fce=_0x5c3eb9;_0x57aff1=0xc8;}else{_0x57aff1=0xce;}_0x1499c2['status'](_0x57aff1);return _0x1499c2['set'](_0x32ef('0x15'),_0x19ce1+'-'+_0x326fce+'/'+_0x5c3eb9)[_0x32ef('0x10')](_0x193714);}return null;};}function saveUpdates(_0xb5aed2){return function(_0x53a5ca){if(_0x53a5ca){return _0x53a5ca['update'](_0xb5aed2)[_0x32ef('0x16')](function(_0x1a9476){return _0x1a9476;});}return null;};}function removeEntity(_0x286bfb){return function(_0x57863c){if(_0x57863c){return _0x57863c[_0x32ef('0x17')]()[_0x32ef('0x16')](function(){var _0x4f4c98=_0x57863c[_0x32ef('0x18')]({'plain':!![]});var _0x314ef1=_0x32ef('0x19');return db[_0x32ef('0x1a')][_0x32ef('0x17')]({'where':{'type':_0x314ef1,'resourceId':_0x4f4c98['id']}})[_0x32ef('0x16')](function(){return _0x57863c;});})['then'](function(){_0x286bfb[_0x32ef('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309866){return function(_0x3a20ca){if(!_0x3a20ca){_0x309866['sendStatus'](0x194);}return _0x3a20ca;};}function handleError(_0x1af371,_0x97780){_0x97780=_0x97780||0x1f4;return function(_0x5e8898){logger['error'](_0x5e8898['stack']);if(_0x5e8898[_0x32ef('0x1b')]){delete _0x5e8898[_0x32ef('0x1b')];}_0x1af371[_0x32ef('0xe')](_0x97780)['send'](_0x5e8898);};}exports['index']=function(_0x19ea6,_0x4d584b){var _0x51a412={};var _0x278495={'count':0x0,'rows':[]};var _0x14d4b3=_[_0x32ef('0x1c')](db[_0x32ef('0x1d')][_0x32ef('0x1e')],function(_0x234175){return{'name':_0x234175[_0x32ef('0x1f')],'type':_0x234175[_0x32ef('0x20')][_0x32ef('0x21')]};});_0x51a412=qs[_0x32ef('0x22')](_0x14d4b3,_0x19ea6);var _0x1335e2={'where':_0x51a412[_0x32ef('0x23')]};return db['SmsQueue'][_0x32ef('0x14')](_0x1335e2)[_0x32ef('0x16')](function(_0x5a04cd){_0x278495[_0x32ef('0x14')]=_0x5a04cd;_0x51a412[_0x32ef('0x24')]=qs[_0x32ef('0x24')](_0x19ea6[_0x32ef('0x25')]);return db['SmsQueue'][_0x32ef('0x26')](_0x51a412);})[_0x32ef('0x16')](function(_0x31dbc3){_0x278495[_0x32ef('0x27')]=_0x31dbc3;return _0x278495;})[_0x32ef('0x16')](respondWithFilteredResult(_0x4d584b,_0x51a412))[_0x32ef('0x28')](handleError(_0x4d584b,null));};exports[_0x32ef('0x29')]=function(_0x575f3e,_0x36ac37){var _0x537214={'raw':!![],'where':{'id':_0x575f3e[_0x32ef('0x2a')]['id']}},_0x38bf73={};_0x38bf73['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x1d')][_0x32ef('0x1e')]);_0x38bf73[_0x32ef('0x25')]=_[_0x32ef('0x2b')](_0x575f3e['query']);_0x38bf73['filters']=_[_0x32ef('0x2c')](_0x38bf73['model'],_0x38bf73[_0x32ef('0x25')]);_0x537214[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x38bf73[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x575f3e[_0x32ef('0x25')]['fields']));_0x537214['attributes']=_0x537214['attributes'][_0x32ef('0x30')]?_0x537214[_0x32ef('0x2d')]:_0x38bf73[_0x32ef('0x2e')];if(_0x575f3e['query']['includeAll']){_0x537214[_0x32ef('0x24')]=[{'all':!![]}];}_0x537214=_[_0x32ef('0x31')]({},_0x537214,_0x575f3e[_0x32ef('0x32')]);return db['SmsQueue']['find'](_0x537214)[_0x32ef('0x16')](handleEntityNotFound(_0x36ac37,null))[_0x32ef('0x16')](respondWithResult(_0x36ac37,null))[_0x32ef('0x28')](handleError(_0x36ac37,null));};exports[_0x32ef('0x33')]=function(_0x3a7c49,_0x211c79){return db[_0x32ef('0x1d')][_0x32ef('0x33')](_0x3a7c49[_0x32ef('0x34')],{})['then'](function(_0x3a4a99){var _0x36e374=_0x3a7c49[_0x32ef('0x35')]['get']({'plain':!![]});if(!_0x36e374)throw new Error(_0x32ef('0x36'));if(_0x36e374[_0x32ef('0x37')]===_0x32ef('0x35')){var _0x393a89=_0x3a4a99[_0x32ef('0x18')]({'plain':!![]});var _0x33a0fb=_0x32ef('0x19');return db[_0x32ef('0x38')][_0x32ef('0x39')]({'where':{'name':_0x33a0fb,'userProfileId':_0x36e374[_0x32ef('0x3a')]},'raw':!![]})[_0x32ef('0x16')](function(_0x4615b4){if(_0x4615b4&&_0x4615b4['autoAssociation']===0x0){return db[_0x32ef('0x1a')][_0x32ef('0x33')]({'name':_0x393a89[_0x32ef('0x1b')],'resourceId':_0x393a89['id'],'type':_0x4615b4[_0x32ef('0x1b')],'sectionId':_0x4615b4['id']},{})[_0x32ef('0x16')](function(){return _0x3a4a99;});}else{return _0x3a4a99;}})[_0x32ef('0x28')](function(_0x3c0e44){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c0e44);throw _0x3c0e44;});}return _0x3a4a99;})[_0x32ef('0x16')](respondWithResult(_0x211c79,0xc9))[_0x32ef('0x28')](handleError(_0x211c79,null));};exports[_0x32ef('0x3b')]=function(_0x765c63,_0x5dca14){if(_0x765c63[_0x32ef('0x34')]['id']){delete _0x765c63[_0x32ef('0x34')]['id'];}return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0x765c63['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x16')](saveUpdates(_0x765c63[_0x32ef('0x34')],null))[_0x32ef('0x16')](respondWithResult(_0x5dca14,null))[_0x32ef('0x28')](handleError(_0x5dca14,null));};exports[_0x32ef('0x17')]=function(_0x321ef7,_0x3d35a1){return db[_0x32ef('0x1d')][_0x32ef('0x39')]({'where':{'id':_0x321ef7['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x3d35a1,null))['then'](removeEntity(_0x3d35a1,null))[_0x32ef('0x28')](handleError(_0x3d35a1,null));};exports[_0x32ef('0x3c')]=function(_0x2dd94f,_0x4d8393){return db[_0x32ef('0x1d')][_0x32ef('0x3c')]()[_0x32ef('0x16')](respondWithResult(_0x4d8393,null))[_0x32ef('0x28')](handleError(_0x4d8393,null));};exports[_0x32ef('0x3d')]=function(_0x40bf12,_0x12c9e6){var _0x47dbe1={'raw':!![],'where':{}},_0x5cb6fc={},_0x36252c;return db[_0x32ef('0x1d')][_0x32ef('0x3e')]({'where':{'id':_0x40bf12[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x12c9e6,null))[_0x32ef('0x16')](function(_0x44ad11){if(_0x44ad11){_0x36252c=_0x44ad11[_0x32ef('0x18')]({'plain':!![]});_0x5cb6fc[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x3f')][_0x32ef('0x1e')]);_0x5cb6fc[_0x32ef('0x25')]=_['keys'](_0x40bf12[_0x32ef('0x25')]);_0x5cb6fc[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],_0x5cb6fc[_0x32ef('0x25')]);_0x47dbe1[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5cb6fc[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x47dbe1[_0x32ef('0x2d')]=_0x47dbe1[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x47dbe1[_0x32ef('0x2d')]:_0x5cb6fc[_0x32ef('0x2e')];if(!_0x40bf12[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x47dbe1['limit']=qs[_0x32ef('0x12')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x12')]);_0x47dbe1[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x11')]);}_0x47dbe1[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x40bf12[_0x32ef('0x25')][_0x32ef('0x43')]);_0x47dbe1['where']=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x40bf12[_0x32ef('0x25')],_0x5cb6fc[_0x32ef('0x40')]));_0x47dbe1[_0x32ef('0x23')][_0x32ef('0x45')]=_0x44ad11['id'];if(_0x40bf12['query'][_0x32ef('0x46')]){_0x47dbe1[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x47dbe1['where'],{'$or':_[_0x32ef('0x1c')](_0x47dbe1['attributes'],function(_0x2ee3dd){var _0xbe35b={};_0xbe35b[_0x2ee3dd]={'$like':'%'+_0x40bf12['query'][_0x32ef('0x46')]+'%'};return _0xbe35b;})});}_0x47dbe1=_['merge']({},_0x47dbe1,_0x40bf12[_0x32ef('0x32')]);return db[_0x32ef('0x3f')][_0x32ef('0x26')](_0x47dbe1);}})[_0x32ef('0x16')](function(_0x2c7bee){if(_0x2c7bee){return db[_0x32ef('0x47')][_0x32ef('0x48')]({'where':{'id':_['map'](_0x2c7bee,'UserId'),'role':_0x32ef('0x49')},'attributes':['id','name','smsPause',_0x32ef('0x4a'),_0x32ef('0x4b')]});}})[_0x32ef('0x16')](function(_0x6aae59){if(_0x6aae59){return{'count':_0x6aae59[_0x32ef('0x14')],'rows':_[_0x32ef('0x1c')](_0x6aae59[_0x32ef('0x27')],function(_0x4249c3){return{'membername':_0x4249c3[_0x32ef('0x1b')],'UserId':_0x4249c3['id'],'queue_name':_0x36252c[_0x32ef('0x1b')],'SmsQueueId':_0x36252c['id'],'interface':util['format']('%s/%s',_0x32ef('0x4c'),_0x4249c3[_0x32ef('0x1b')]),'penalty':0x0,'paused':_0x4249c3['smsPause'],'createdAt':_0x4249c3[_0x32ef('0x4b')],'updatedAt':_0x4249c3[_0x32ef('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x32ef('0x16')](respondWithFilteredResult(_0x12c9e6,_0x47dbe1))['catch'](handleError(_0x12c9e6,null));};exports[_0x32ef('0x4d')]=function(_0x3c31d0,_0x20dcc5){var _0x52dfe0={};var _0x5e6030={};var _0x13ea1a;var _0x47d8bf;return db[_0x32ef('0x1d')]['findOne']({'where':{'id':_0x3c31d0['params']['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x20dcc5,null))[_0x32ef('0x16')](function(_0x10cb37){if(_0x10cb37){_0x13ea1a=_0x10cb37;_0x5e6030['model']=_[_0x32ef('0x2b')](db[_0x32ef('0x4e')][_0x32ef('0x1e')]);_0x5e6030['query']=_[_0x32ef('0x2b')](_0x3c31d0[_0x32ef('0x25')]);_0x5e6030['filters']=_['intersection'](_0x5e6030[_0x32ef('0x2e')],_0x5e6030[_0x32ef('0x25')]);_0x52dfe0[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x5e6030[_0x32ef('0x2e')],qs[_0x32ef('0x2f')](_0x3c31d0['query'][_0x32ef('0x2f')]));_0x52dfe0[_0x32ef('0x2d')]=_0x52dfe0[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x52dfe0[_0x32ef('0x2d')]:_0x5e6030[_0x32ef('0x2e')];_0x52dfe0[_0x32ef('0x42')]=qs[_0x32ef('0x43')](_0x3c31d0[_0x32ef('0x25')]['sort']);_0x52dfe0[_0x32ef('0x23')]=qs[_0x32ef('0x40')](_[_0x32ef('0x44')](_0x3c31d0[_0x32ef('0x25')],_0x5e6030[_0x32ef('0x40')]));if(_0x3c31d0['query']['filter']){_0x52dfe0[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x52dfe0[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x52dfe0[_0x32ef('0x2d')],function(_0x526fb1){var _0x3372d9={};_0x3372d9[_0x526fb1]={'$like':'%'+_0x3c31d0['query'][_0x32ef('0x46')]+'%'};return _0x3372d9;})});}_0x52dfe0=_[_0x32ef('0x31')]({},_0x52dfe0,_0x3c31d0['options']);return _0x13ea1a['getTeams'](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x1538d0){if(_0x1538d0){_0x47d8bf=_0x1538d0[_0x32ef('0x30')];if(!_0x3c31d0['query']['hasOwnProperty'](_0x32ef('0x4f'))){_0x52dfe0[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x3c31d0[_0x32ef('0x25')]['limit']);_0x52dfe0[_0x32ef('0x11')]=qs[_0x32ef('0x11')](_0x3c31d0[_0x32ef('0x25')][_0x32ef('0x11')]);}return _0x13ea1a[_0x32ef('0x4d')](_0x52dfe0);}})[_0x32ef('0x16')](function(_0x43b176){if(_0x43b176){return _0x43b176?{'count':_0x47d8bf,'rows':_0x43b176}:null;}})[_0x32ef('0x16')](respondWithResult(_0x20dcc5,null))[_0x32ef('0x28')](handleError(_0x20dcc5,null));};exports[_0x32ef('0x50')]=function(_0x132d9f,_0x3978cb){var _0x52b32f=_0x132d9f['body'][_0x32ef('0x51')];return db[_0x32ef('0x4e')]['findAll']({'where':{'id':_0x52b32f},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':'Agents','attributes':['id',_0x32ef('0x1b'),_0x32ef('0x52'),_0x32ef('0x53'),'interface'],'raw':!![]}]})[_0x32ef('0x16')](function(_0x4978a6){if(_0x4978a6){var _0x141fec=_[_0x32ef('0x54')](_0x4978a6,function(_0x47e3cc){var _0x4c70e0=_0x47e3cc[_0x32ef('0x18')]({'plain':!![]});return _0x4c70e0['Agents'];});return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x132d9f[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](function(_0x1adcb8){return db['sequelize']['transaction'](function(_0x4f1b94){return _0x1adcb8[_0x32ef('0x50')](_0x52b32f,{'transaction':_0x4f1b94})['then'](function(){return BPromise[_0x32ef('0x55')](_0x141fec,function(_0x13a374){return db[_0x32ef('0x3f')][_0x32ef('0x56')]({'where':{'UserId':_0x13a374['id'],'SmsQueueId':_0x132d9f[_0x32ef('0x2a')]['id']},'transaction':_0x4f1b94});});})[_0x32ef('0x16')](function(){_0x141fec['forEach'](function(_0x3d9245){socket['emit']('userSmsQueue:save',{'UserId':_0x3d9245['id'],'SmsQueueId':_0x1adcb8['id']});});});});});}})[_0x32ef('0x16')](respondWithStatusCode(_0x3978cb,null))['catch'](handleError(_0x3978cb,null));};exports[_0x32ef('0x57')]=function(_0x313798,_0x4d64ec){return db[_0x32ef('0x4e')][_0x32ef('0x26')]({'where':{'id':_0x313798[_0x32ef('0x25')][_0x32ef('0x51')]},'attributes':['id'],'include':[{'model':db[_0x32ef('0x47')],'as':_0x32ef('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d64ec,null))['then'](function(_0x35b10d){var _0x5e0b55=_[_0x32ef('0x1c')](_0x35b10d,'id');var _0x266688=[];var _0x114d8e=[];var _0x1782a5=squel[_0x32ef('0x59')]();_0x1782a5[_0x32ef('0x5a')]('tq.TeamId')[_0x32ef('0x5b')](_0x32ef('0x5c'),'tq')[_0x32ef('0x5d')](_0x32ef('0x5e'),'ut',_0x32ef('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x313798[_0x32ef('0x2a')]['id']);for(var _0x904a4f=0x0;_0x904a4f<_0x35b10d['length'];_0x904a4f+=0x1){let _0x211fb1=_0x35b10d[_0x904a4f];for(var _0x2e333d=0x0;_0x2e333d<_0x211fb1[_0x32ef('0x58')][_0x32ef('0x30')];_0x2e333d+=0x1){let _0xc3664d=_0x211fb1[_0x32ef('0x58')][_0x2e333d];var _0xfb4845=_0x1782a5[_0x32ef('0x60')]();_0xfb4845[_0x32ef('0x23')]('ut.UserId\x20=\x20?',_0xc3664d['id']);_0x114d8e[_0x32ef('0x61')](db[_0x32ef('0x62')]['query'](_0xfb4845[_0x32ef('0x63')](),{'type':db['sequelize'][_0x32ef('0x64')]['SELECT']})[_0x32ef('0x16')](function(_0x39300f){if(_0x39300f[_0x32ef('0x30')]===0x1){return _0xc3664d['id'];}else{var _0x3e000c=_['every'](_[_0x32ef('0x1c')](_0x39300f,_0x32ef('0x65')),function(_0x31f99f){return _['includes'](_0x5e0b55,_0x31f99f);});if(_0x3e000c){return _0xc3664d['id'];}}}));}}return BPromise['all'](_0x114d8e)['then'](function(_0x1aff33){_0x266688=_(_0x266688)[_0x32ef('0x66')](_0x1aff33)[_0x32ef('0x67')]()[_0x32ef('0x68')]();return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x313798[_0x32ef('0x2a')]['id']}})['then'](function(_0x471de6){return db[_0x32ef('0x62')][_0x32ef('0x69')](function(_0x4baa7a){return _0x471de6[_0x32ef('0x57')](_0x313798[_0x32ef('0x25')][_0x32ef('0x51')],{'transaction':_0x4baa7a})[_0x32ef('0x16')](function(){if(!_[_0x32ef('0x6a')](_0x266688)){return _0x471de6['removeAgents'](_0x266688,{'transaction':_0x4baa7a});}})[_0x32ef('0x16')](function(){_0x266688['forEach'](function(_0x4f0433){socket[_0x32ef('0x6b')]('userSmsQueue:remove',{'UserId':_0x4f0433,'SmsQueueId':_0x471de6['id']});});});});});});})['then'](respondWithStatusCode(_0x4d64ec,null))[_0x32ef('0x28')](handleError(_0x4d64ec,null));};exports[_0x32ef('0x6c')]=function(_0xf6bc02,_0x3b9896){return db['SmsQueue'][_0x32ef('0x39')]({'where':{'id':_0xf6bc02['params']['id']}})['then'](handleEntityNotFound(_0x3b9896,null))[_0x32ef('0x16')](function(_0x56aede){if(_0x56aede){return _0x56aede[_0x32ef('0x6c')](_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')],_['omit'](_0xf6bc02['body'],[_0x32ef('0x51'),'id'])||{})[_0x32ef('0x6d')](function(_0x2c4a3c){for(var _0x3741f8=0x0;_0x3741f8<_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x32ef('0x30')];_0x3741f8+=0x1){socket['emit'](_0x32ef('0x6e'),{'UserId':Number(_0xf6bc02[_0x32ef('0x34')][_0x32ef('0x51')][_0x3741f8]),'SmsQueueId':Number(_0xf6bc02[_0x32ef('0x2a')]['id'])});}return _0x2c4a3c;});}})['then'](respondWithResult(_0x3b9896,null))['catch'](handleError(_0x3b9896,null));};exports[_0x32ef('0x6f')]=function(_0x5eb320,_0x116951){return db[_0x32ef('0x1d')]['find']({'where':{'id':_0x5eb320['params']['id']}})['then'](handleEntityNotFound(_0x116951,null))[_0x32ef('0x16')](function(_0x33f6c3){if(_0x33f6c3){return _0x33f6c3[_0x32ef('0x6f')](_0x5eb320[_0x32ef('0x25')]['ids'])[_0x32ef('0x16')](function(){if(_[_0x32ef('0x70')](_0x5eb320[_0x32ef('0x25')]['ids'])){for(var _0x2895ad=0x0;_0x2895ad<_0x5eb320['query'][_0x32ef('0x51')][_0x32ef('0x30')];_0x2895ad+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')][_0x2895ad]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}}else{socket[_0x32ef('0x6b')](_0x32ef('0x71'),{'UserId':Number(_0x5eb320[_0x32ef('0x25')][_0x32ef('0x51')]),'SmsQueueId':Number(_0x5eb320[_0x32ef('0x2a')]['id'])});}});}})[_0x32ef('0x16')](respondWithStatusCode(_0x116951,null))['catch'](handleError(_0x116951,null));};exports[_0x32ef('0x72')]=function(_0x583290,_0x22d657){var _0x7e47b9={};var _0x1d9d57={};var _0x18cf5d;var _0x102f2f;return db['SmsQueue'][_0x32ef('0x3e')]({'where':{'id':_0x583290[_0x32ef('0x2a')]['id']}})[_0x32ef('0x16')](handleEntityNotFound(_0x22d657,null))[_0x32ef('0x16')](function(_0x1db74d){if(_0x1db74d){_0x18cf5d=_0x1db74d;_0x1d9d57[_0x32ef('0x2e')]=_[_0x32ef('0x2b')](db[_0x32ef('0x47')][_0x32ef('0x1e')]);_0x1d9d57['query']=_['keys'](_0x583290['query']);_0x1d9d57[_0x32ef('0x40')]=_[_0x32ef('0x2c')](_0x1d9d57['model'],_0x1d9d57[_0x32ef('0x25')]);_0x7e47b9['attributes']=_[_0x32ef('0x2c')](_0x1d9d57['model'],qs['fields'](_0x583290[_0x32ef('0x25')][_0x32ef('0x2f')]));_0x7e47b9[_0x32ef('0x2d')]=_0x7e47b9[_0x32ef('0x2d')][_0x32ef('0x30')]?_0x7e47b9['attributes']:_0x1d9d57[_0x32ef('0x2e')];_0x7e47b9['order']=qs[_0x32ef('0x43')](_0x583290['query']['sort']);_0x7e47b9['where']=qs['filters'](_['pick'](_0x583290[_0x32ef('0x25')],_0x1d9d57[_0x32ef('0x40')]));if(_0x583290['query'][_0x32ef('0x46')]){_0x7e47b9[_0x32ef('0x23')]=_[_0x32ef('0x31')](_0x7e47b9[_0x32ef('0x23')],{'$or':_[_0x32ef('0x1c')](_0x7e47b9[_0x32ef('0x2d')],function(_0x59f0aa){var _0x2ac861={};_0x2ac861[_0x59f0aa]={'$like':'%'+_0x583290['query'][_0x32ef('0x46')]+'%'};return _0x2ac861;})});}_0x7e47b9=_[_0x32ef('0x31')]({},_0x7e47b9,_0x583290['options']);return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})['then'](function(_0x4557b0){if(_0x4557b0){_0x102f2f=_0x4557b0[_0x32ef('0x30')];if(!_0x583290[_0x32ef('0x25')][_0x32ef('0x41')]('nolimit')){_0x7e47b9[_0x32ef('0x12')]=qs[_0x32ef('0x12')](_0x583290[_0x32ef('0x25')][_0x32ef('0x12')]);_0x7e47b9['offset']=qs[_0x32ef('0x11')](_0x583290['query'][_0x32ef('0x11')]);}return _0x18cf5d[_0x32ef('0x72')](_0x7e47b9);}})[_0x32ef('0x16')](function(_0x28ef17){if(_0x28ef17){return _0x28ef17?{'count':_0x102f2f,'rows':_0x28ef17}:null;}})[_0x32ef('0x16')](respondWithResult(_0x22d657,null))[_0x32ef('0x28')](handleError(_0x22d657,null));}; \ No newline at end of file +var _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0x0b0e[_0x47cfa0];return _0x386b1d;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 314a1b3..ddbd9c0 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 _0xd99b=['hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x595e7b,_0x32000d){var _0x330302=function(_0x1c8f61){while(--_0x1c8f61){_0x595e7b['push'](_0x595e7b['shift']());}};_0x330302(++_0x32000d);}(_0xd99b,0xab));var _0xbd99=function(_0x4d8a5e,_0x2ccf03){_0x4d8a5e=_0x4d8a5e-0x0;var _0x4e15ca=_0xd99b[_0x4d8a5e];return _0x4e15ca;};'use strict';var EventEmitter=require(_0xbd99('0x0'));var SmsQueue=require(_0xbd99('0x1'))['db'][_0xbd99('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbd99('0x3')](0x0);var events={'afterCreate':_0xbd99('0x4'),'afterUpdate':_0xbd99('0x5'),'afterDestroy':_0xbd99('0x6')};function emitEvent(_0x3c6063){return function(_0x5ea972,_0x1fbf05,_0x3ae2c6){SmsQueueEvents[_0xbd99('0x7')](_0x3c6063+':'+_0x5ea972['id'],_0x5ea972);SmsQueueEvents[_0xbd99('0x7')](_0x3c6063,_0x5ea972);_0x3ae2c6(null);};}for(var e in events){if(events[_0xbd99('0x8')](e)){var event=events[e];SmsQueue[_0xbd99('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x219e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0x219e,0x13a));var _0xe219=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x219e[_0x2112d4];return _0x434972;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xe219('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe219('0x1')](0x0);var events={'afterCreate':_0xe219('0x2'),'afterUpdate':_0xe219('0x3'),'afterDestroy':_0xe219('0x4')};function emitEvent(_0x4c84e6){return function(_0x3127bf,_0x23e162,_0x1e04e6){SmsQueueEvents[_0xe219('0x5')](_0x4c84e6+':'+_0x3127bf['id'],_0x3127bf);SmsQueueEvents[_0xe219('0x5')](_0x4c84e6,_0x3127bf);_0x1e04e6(null);};}for(var e in events){if(events[_0xe219('0x6')](e)){var event=events[e];SmsQueue[_0xe219('0x7')](e,emitEvent(event));}}module[_0xe219('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 7a3bfdc..31d09a8 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 _0xc79b=['rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','api','bluebird','path'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc79b,0x187));var _0xbc79=function(_0x3e215a,_0xd79132){_0x3e215a=_0x3e215a-0x0;var _0x5b4c9d=_0xc79b[_0x3e215a];return _0x5b4c9d;};'use strict';var _=require(_0xbc79('0x0'));var util=require(_0xbc79('0x1'));var logger=require('../../config/logger')(_0xbc79('0x2'));var moment=require('moment');var BPromise=require(_0xbc79('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc79('0x4'));var rimraf=require(_0xbc79('0x5'));var config=require(_0xbc79('0x6'));var attributes=require(_0xbc79('0x7'));module[_0xbc79('0x8')]=function(_0x518b05,_0x4d16c7){return _0x518b05[_0xbc79('0x9')](_0xbc79('0xa'),attributes,{'tableName':_0xbc79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc878=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc878,0x144));var _0x8c87=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0xc878[_0x557f5f];return _0x196eba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c87('0x0'))(_0x8c87('0x1'));var moment=require('moment');var BPromise=require(_0x8c87('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c87('0x3'));var rimraf=require(_0x8c87('0x4'));var config=require(_0x8c87('0x5'));var attributes=require(_0x8c87('0x6'));module[_0x8c87('0x7')]=function(_0x9babfb,_0x5a1957){return _0x9babfb['define'](_0x8c87('0x8'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 1db83a3..5fec377 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 _0x7254=['then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','map','include','model','ShowSmsQueue','find','raw','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request'];(function(_0x1c74b1,_0x1e8d70){var _0x29d8c4=function(_0x330548){while(--_0x330548){_0x1c74b1['push'](_0x1c74b1['shift']());}};_0x29d8c4(++_0x1e8d70);}(_0x7254,0x6b));var _0x4725=function(_0x3d3e5a,_0x2eb856){_0x3d3e5a=_0x3d3e5a-0x0;var _0x3e77cd=_0x7254[_0x3d3e5a];return _0x3e77cd;};'use strict';var _=require('lodash');var util=require(_0x4725('0x0'));var moment=require(_0x4725('0x1'));var BPromise=require(_0x4725('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4725('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4725('0x4'));var logger=require(_0x4725('0x5'))(_0x4725('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4725('0x7')][_0x4725('0x8')]({'port':0x232a});config['redis']=_[_0x4725('0x9')](config[_0x4725('0xa')],{'host':_0x4725('0xb'),'port':0x18eb});var socket=require(_0x4725('0xc'))(new Redis(config['redis']));require(_0x4725('0xd'))[_0x4725('0xe')](socket);function respondWithRpcPromise(_0x10c7b2,_0x4d3e52,_0x1639e2){return new BPromise(function(_0x11fddb,_0x138a0d){return client[_0x4725('0xf')](_0x10c7b2,_0x1639e2)[_0x4725('0x10')](function(_0xd6882e){logger[_0x4725('0x11')](_0x4725('0x12'),_0x4d3e52,_0x4725('0x13'));logger[_0x4725('0x14')](_0x4725('0x15'),_0x4d3e52,_0x4725('0x13'),JSON[_0x4725('0x16')](_0xd6882e));if(_0xd6882e['error']){if(_0xd6882e[_0x4725('0x17')][_0x4725('0x18')]===0x1f4){logger[_0x4725('0x17')](_0x4725('0x12'),_0x4d3e52,_0xd6882e[_0x4725('0x17')]['message']);return _0x138a0d(_0xd6882e[_0x4725('0x17')][_0x4725('0x19')]);}logger[_0x4725('0x17')](_0x4725('0x12'),_0x4d3e52,_0xd6882e[_0x4725('0x17')][_0x4725('0x19')]);return _0x11fddb(_0xd6882e[_0x4725('0x17')]['message']);}else{logger[_0x4725('0x11')]('SmsQueue,\x20%s,\x20%s',_0x4d3e52,_0x4725('0x13'));_0x11fddb(_0xd6882e[_0x4725('0x1a')]['message']);}})[_0x4725('0x1b')](function(_0x199525){logger[_0x4725('0x17')](_0x4725('0x12'),_0x4d3e52,_0x199525);_0x138a0d(_0x199525);});});}exports[_0x4725('0x1c')]=function(_0x33e0ad){var _0x2f710e=this;return new Promise(function(_0x250937,_0x55a146){return db[_0x4725('0x1d')][_0x4725('0x1e')]({'raw':_0x33e0ad['options']?_0x33e0ad[_0x4725('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x33e0ad[_0x4725('0x1f')]?_0x33e0ad[_0x4725('0x1f')][_0x4725('0x20')]||null:null,'attributes':_0x33e0ad['options']?_0x33e0ad[_0x4725('0x1f')][_0x4725('0x21')]||null:null,'limit':_0x33e0ad[_0x4725('0x1f')]?_0x33e0ad[_0x4725('0x1f')][_0x4725('0x22')]||null:null,'include':_0x33e0ad['options']?_0x33e0ad[_0x4725('0x1f')]['include']?_[_0x4725('0x23')](_0x33e0ad[_0x4725('0x1f')][_0x4725('0x24')],function(_0x4f3727){return{'model':db[_0x4f3727[_0x4725('0x25')]],'as':_0x4f3727['as'],'attributes':_0x4f3727[_0x4725('0x21')],'include':_0x4f3727[_0x4725('0x24')]?_[_0x4725('0x23')](_0x4f3727['include'],function(_0x301a6a){return{'model':db[_0x301a6a[_0x4725('0x25')]],'as':_0x301a6a['as'],'attributes':_0x301a6a[_0x4725('0x21')],'include':_0x301a6a[_0x4725('0x24')]?_['map'](_0x301a6a[_0x4725('0x24')],function(_0x491a56){return{'model':db[_0x491a56[_0x4725('0x25')]],'as':_0x491a56['as'],'attributes':_0x491a56[_0x4725('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4725('0x10')](function(_0x3a6081){logger[_0x4725('0x11')](_0x4725('0x1c'),_0x33e0ad);logger[_0x4725('0x14')](_0x4725('0x1c'),_0x33e0ad,JSON[_0x4725('0x16')](_0x3a6081));_0x250937(_0x3a6081);})[_0x4725('0x1b')](function(_0x628e96){logger['error']('GetSmsQueue',_0x628e96[_0x4725('0x19')],_0x33e0ad);_0x55a146(_0x2f710e[_0x4725('0x17')](0x1f4,_0x628e96[_0x4725('0x19')]));});});};exports[_0x4725('0x26')]=function(_0x258680){var _0x1d01be=this;return new Promise(function(_0x200d9d,_0x2588fc){return db[_0x4725('0x1d')][_0x4725('0x27')]({'raw':_0x258680['options']?_0x258680[_0x4725('0x1f')][_0x4725('0x28')]===undefined?!![]:![]:!![],'where':_0x258680[_0x4725('0x1f')]?_0x258680[_0x4725('0x1f')]['where']||null:null,'attributes':_0x258680[_0x4725('0x1f')]?_0x258680['options']['attributes']||null:null,'include':_0x258680['options']?_0x258680[_0x4725('0x1f')][_0x4725('0x24')]?_[_0x4725('0x23')](_0x258680[_0x4725('0x1f')][_0x4725('0x24')],function(_0x21a233){return{'model':db[_0x21a233['model']],'as':_0x21a233['as'],'attributes':_0x21a233[_0x4725('0x21')],'include':_0x21a233[_0x4725('0x24')]?_[_0x4725('0x23')](_0x21a233['include'],function(_0x534bff){return{'model':db[_0x534bff['model']],'as':_0x534bff['as'],'attributes':_0x534bff[_0x4725('0x21')],'include':_0x534bff['include']?_[_0x4725('0x23')](_0x534bff[_0x4725('0x24')],function(_0x10795c){return{'model':db[_0x10795c[_0x4725('0x25')]],'as':_0x10795c['as'],'attributes':_0x10795c[_0x4725('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x303dce){logger[_0x4725('0x11')](_0x4725('0x26'),_0x258680);logger[_0x4725('0x14')]('ShowSmsQueue',_0x258680,JSON[_0x4725('0x16')](_0x303dce));_0x200d9d(_0x303dce);})[_0x4725('0x1b')](function(_0x5a6dfd){logger[_0x4725('0x17')](_0x4725('0x26'),_0x5a6dfd[_0x4725('0x19')],_0x258680);_0x2588fc(_0x1d01be[_0x4725('0x17')](0x1f4,_0x5a6dfd['message']));});});}; \ No newline at end of file +var _0xf503=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','request','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','SmsQueue','options','raw','where','attributes','limit','include','map','model','then','info','GetSmsQueue','ShowSmsQueue','find','debug','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x195260,_0x20db57){var _0x330435=function(_0x22b2df){while(--_0x22b2df){_0x195260['push'](_0x195260['shift']());}};_0x330435(++_0x20db57);}(_0xf503,0x13b));var _0x3f50=function(_0x11ef2d,_0x4da792){_0x11ef2d=_0x11ef2d-0x0;var _0xc17ba0=_0xf503[_0x11ef2d];return _0xc17ba0;};'use strict';var _=require(_0x3f50('0x0'));var util=require('util');var moment=require(_0x3f50('0x1'));var BPromise=require(_0x3f50('0x2'));var rs=require(_0x3f50('0x3'));var fs=require('fs');var Redis=require(_0x3f50('0x4'));var db=require(_0x3f50('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3f50('0x6'));var config=require(_0x3f50('0x7'));var jayson=require(_0x3f50('0x8'));var client=jayson[_0x3f50('0x9')][_0x3f50('0xa')]({'port':0x232a});config[_0x3f50('0xb')]=_[_0x3f50('0xc')](config[_0x3f50('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f50('0xd'))(new Redis(config[_0x3f50('0xb')]));require(_0x3f50('0xe'))['register'](socket);function respondWithRpcPromise(_0x5e4a09,_0x2b1f5a,_0x4842fe){return new BPromise(function(_0x386949,_0x71fe46){return client[_0x3f50('0xf')](_0x5e4a09,_0x4842fe)['then'](function(_0x47e32d){logger['info']('SmsQueue,\x20%s,\x20%s',_0x2b1f5a,_0x3f50('0x10'));logger['debug'](_0x3f50('0x11'),_0x2b1f5a,_0x3f50('0x10'),JSON[_0x3f50('0x12')](_0x47e32d));if(_0x47e32d[_0x3f50('0x13')]){if(_0x47e32d['error'][_0x3f50('0x14')]===0x1f4){logger[_0x3f50('0x13')](_0x3f50('0x15'),_0x2b1f5a,_0x47e32d['error']['message']);return _0x71fe46(_0x47e32d[_0x3f50('0x13')][_0x3f50('0x16')]);}logger[_0x3f50('0x13')]('SmsQueue,\x20%s,\x20%s',_0x2b1f5a,_0x47e32d[_0x3f50('0x13')][_0x3f50('0x16')]);return _0x386949(_0x47e32d[_0x3f50('0x13')]['message']);}else{logger['info'](_0x3f50('0x15'),_0x2b1f5a,'request\x20sent');_0x386949(_0x47e32d[_0x3f50('0x17')][_0x3f50('0x16')]);}})[_0x3f50('0x18')](function(_0x52fd73){logger[_0x3f50('0x13')]('SmsQueue,\x20%s,\x20%s',_0x2b1f5a,_0x52fd73);_0x71fe46(_0x52fd73);});});}exports['GetSmsQueue']=function(_0x2b3a2b){var _0x4e3db5=this;return new Promise(function(_0x5dc45b,_0x47c83c){return db[_0x3f50('0x19')]['findAll']({'raw':_0x2b3a2b[_0x3f50('0x1a')]?_0x2b3a2b[_0x3f50('0x1a')][_0x3f50('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b3a2b[_0x3f50('0x1a')]?_0x2b3a2b['options'][_0x3f50('0x1c')]||null:null,'attributes':_0x2b3a2b[_0x3f50('0x1a')]?_0x2b3a2b[_0x3f50('0x1a')][_0x3f50('0x1d')]||null:null,'limit':_0x2b3a2b[_0x3f50('0x1a')]?_0x2b3a2b[_0x3f50('0x1a')][_0x3f50('0x1e')]||null:null,'include':_0x2b3a2b['options']?_0x2b3a2b[_0x3f50('0x1a')][_0x3f50('0x1f')]?_[_0x3f50('0x20')](_0x2b3a2b[_0x3f50('0x1a')][_0x3f50('0x1f')],function(_0x1195f4){return{'model':db[_0x1195f4[_0x3f50('0x21')]],'as':_0x1195f4['as'],'attributes':_0x1195f4[_0x3f50('0x1d')],'include':_0x1195f4[_0x3f50('0x1f')]?_[_0x3f50('0x20')](_0x1195f4[_0x3f50('0x1f')],function(_0x1bcab3){return{'model':db[_0x1bcab3['model']],'as':_0x1bcab3['as'],'attributes':_0x1bcab3[_0x3f50('0x1d')],'include':_0x1bcab3[_0x3f50('0x1f')]?_[_0x3f50('0x20')](_0x1bcab3[_0x3f50('0x1f')],function(_0x5e9249){return{'model':db[_0x5e9249[_0x3f50('0x21')]],'as':_0x5e9249['as'],'attributes':_0x5e9249[_0x3f50('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3f50('0x22')](function(_0x4109ba){logger[_0x3f50('0x23')](_0x3f50('0x24'),_0x2b3a2b);logger['debug'](_0x3f50('0x24'),_0x2b3a2b,JSON[_0x3f50('0x12')](_0x4109ba));_0x5dc45b(_0x4109ba);})[_0x3f50('0x18')](function(_0x5e3d12){logger['error']('GetSmsQueue',_0x5e3d12[_0x3f50('0x16')],_0x2b3a2b);_0x47c83c(_0x4e3db5[_0x3f50('0x13')](0x1f4,_0x5e3d12['message']));});});};exports[_0x3f50('0x25')]=function(_0x12a81a){var _0x277c15=this;return new Promise(function(_0x1f5f8c,_0x3dec6f){return db['SmsQueue'][_0x3f50('0x26')]({'raw':_0x12a81a[_0x3f50('0x1a')]?_0x12a81a[_0x3f50('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x12a81a[_0x3f50('0x1a')]?_0x12a81a[_0x3f50('0x1a')][_0x3f50('0x1c')]||null:null,'attributes':_0x12a81a['options']?_0x12a81a[_0x3f50('0x1a')][_0x3f50('0x1d')]||null:null,'include':_0x12a81a[_0x3f50('0x1a')]?_0x12a81a[_0x3f50('0x1a')][_0x3f50('0x1f')]?_[_0x3f50('0x20')](_0x12a81a[_0x3f50('0x1a')][_0x3f50('0x1f')],function(_0x46c51b){return{'model':db[_0x46c51b[_0x3f50('0x21')]],'as':_0x46c51b['as'],'attributes':_0x46c51b[_0x3f50('0x1d')],'include':_0x46c51b[_0x3f50('0x1f')]?_['map'](_0x46c51b['include'],function(_0x1c883a){return{'model':db[_0x1c883a[_0x3f50('0x21')]],'as':_0x1c883a['as'],'attributes':_0x1c883a[_0x3f50('0x1d')],'include':_0x1c883a[_0x3f50('0x1f')]?_[_0x3f50('0x20')](_0x1c883a['include'],function(_0x3a4325){return{'model':db[_0x3a4325[_0x3f50('0x21')]],'as':_0x3a4325['as'],'attributes':_0x3a4325[_0x3f50('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3f50('0x22')](function(_0x432fc1){logger['info'](_0x3f50('0x25'),_0x12a81a);logger[_0x3f50('0x27')](_0x3f50('0x25'),_0x12a81a,JSON[_0x3f50('0x12')](_0x432fc1));_0x1f5f8c(_0x432fc1);})['catch'](function(_0x23d434){logger[_0x3f50('0x13')](_0x3f50('0x25'),_0x23d434[_0x3f50('0x16')],_0x12a81a);_0x3dec6f(_0x277c15[_0x3f50('0x13')](0x1f4,_0x23d434[_0x3f50('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 8732a6c..36d2d08 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 _0x5c8d=['removeListener','register','length','save','update','emit'];(function(_0x43f8c8,_0x24e54a){var _0x444639=function(_0x175026){while(--_0x175026){_0x43f8c8['push'](_0x43f8c8['shift']());}};_0x444639(++_0x24e54a);}(_0x5c8d,0x135));var _0xd5c8=function(_0x1ea90b,_0x53df80){_0x1ea90b=_0x1ea90b-0x0;var _0x145e21=_0x5c8d[_0x1ea90b];return _0x145e21;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xd5c8('0x0'),'remove',_0xd5c8('0x1')];function createListener(_0x25461e,_0x56b7f2){return function(_0x43dbd7){_0x56b7f2[_0xd5c8('0x2')](_0x25461e,_0x43dbd7);};}function removeListener(_0x45f1c6,_0x1611dd){return function(){SmsQueueEvents[_0xd5c8('0x3')](_0x45f1c6,_0x1611dd);};}exports[_0xd5c8('0x4')]=function(_0x1448d5){for(var _0x444b83=0x0,_0x13446f=events[_0xd5c8('0x5')];_0x444b83<_0x13446f;_0x444b83++){var _0x19c87b=events[_0x444b83];var _0x27b51b=createListener('smsQueue:'+_0x19c87b,_0x1448d5);SmsQueueEvents['on'](_0x19c87b,_0x27b51b);}}; \ No newline at end of file +var _0xa46b=['length','smsQueue:','./smsQueue.events','remove','update','emit','register'];(function(_0x2d0ad1,_0x1daf0f){var _0x5c0220=function(_0x2afcbd){while(--_0x2afcbd){_0x2d0ad1['push'](_0x2d0ad1['shift']());}};_0x5c0220(++_0x1daf0f);}(_0xa46b,0x198));var _0xba46=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa46b[_0xa464c9];return _0x3d73c4;};'use strict';var SmsQueueEvents=require(_0xba46('0x0'));var events=['save',_0xba46('0x1'),_0xba46('0x2')];function createListener(_0x24ebd0,_0x566e41){return function(_0x48a1a4){_0x566e41[_0xba46('0x3')](_0x24ebd0,_0x48a1a4);};}function removeListener(_0x43e6f0,_0x22db07){return function(){SmsQueueEvents['removeListener'](_0x43e6f0,_0x22db07);};}exports[_0xba46('0x4')]=function(_0x67cbcc){for(var _0x1e0df9=0x0,_0x1ca9a4=events[_0xba46('0x5')];_0x1e0df9<_0x1ca9a4;_0x1e0df9++){var _0x257d76=events[_0x1e0df9];var _0x2e1456=createListener(_0xba46('0x6')+_0x257d76,_0x67cbcc);SmsQueueEvents['on'](_0x257d76,_0x2e1456);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1632717..71bccac 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 _0x4351=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util','path'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x4351,0x1b5));var _0x1435=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4351[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require(_0x1435('0x2'));var timeout=require(_0x1435('0x3'));var express=require(_0x1435('0x4'));var router=express[_0x1435('0x5')]();var fs_extra=require(_0x1435('0x6'));var auth=require(_0x1435('0x7'));var interaction=require(_0x1435('0x8'));var config=require(_0x1435('0x9'));var controller=require(_0x1435('0xa'));router[_0x1435('0xb')]('/',auth[_0x1435('0xc')](),controller[_0x1435('0xd')]);router[_0x1435('0xb')]('/describe',auth[_0x1435('0xc')](),controller['describe']);router['get'](_0x1435('0xe'),auth[_0x1435('0xc')](),controller[_0x1435('0xf')]);router[_0x1435('0x10')]('/',auth[_0x1435('0xc')](),controller['create']);router[_0x1435('0x11')](_0x1435('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1435('0x12')]('/:id',auth[_0x1435('0xc')](),controller['destroy']);module[_0x1435('0x13')]=router; \ No newline at end of file +var _0x8d0e=['/describe','isAuthenticated','describe','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','index','get'];(function(_0x394622,_0xbb2dd9){var _0x17be65=function(_0x1203ba){while(--_0x1203ba){_0x394622['push'](_0x394622['shift']());}};_0x17be65(++_0xbb2dd9);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1ee9f9,_0xfe4594){_0x1ee9f9=_0x1ee9f9-0x0;var _0x4a69c4=_0x8d0e[_0x1ee9f9];return _0x4a69c4;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0xe')]);router[_0xe8d0('0xb')](_0xe8d0('0xf'),auth[_0xe8d0('0xd')](),controller['show']);router[_0xe8d0('0x10')]('/',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x11')]);router['put']('/:id',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x12')]);router[_0xe8d0('0x13')](_0xe8d0('0xf'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 38a6c10..4862881 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 _0xbbfa=['exports','STRING','DATE','moment','sequelize'];(function(_0x5a0579,_0xc35f23){var _0x1e38f7=function(_0x5c02d0){while(--_0x5c02d0){_0x5a0579['push'](_0x5a0579['shift']());}};_0x1e38f7(++_0xc35f23);}(_0xbbfa,0x175));var _0xabbf=function(_0x2e5069,_0x3a1115){_0x2e5069=_0x2e5069-0x0;var _0x2f00ad=_0xbbfa[_0x2e5069];return _0x2f00ad;};'use strict';var moment=require(_0xabbf('0x0'));var Sequelize=require(_0xabbf('0x1'));module[_0xabbf('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xabbf('0x3')]},'joinAt':{'type':Sequelize[_0xabbf('0x4')]},'leaveAt':{'type':Sequelize[_0xabbf('0x4')]},'acceptAt':{'type':Sequelize[_0xabbf('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9ac9=['DATE','moment','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9ac9,0x1b9));var _0x99ac=function(_0x15dd89,_0x484c66){_0x15dd89=_0x15dd89-0x0;var _0x37565a=_0x9ac9[_0x15dd89];return _0x37565a;};'use strict';var moment=require(_0x99ac('0x0'));var Sequelize=require('sequelize');module[_0x99ac('0x1')]={'uniqueid':{'type':Sequelize[_0x99ac('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x99ac('0x2')]},'joinAt':{'type':Sequelize[_0x99ac('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x99ac('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x99ac('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index b5be546..565b02c 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 _0xf160=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x41a441,_0x5c7b90){var _0x919a56=function(_0x31ae64){while(--_0x31ae64){_0x41a441['push'](_0x41a441['shift']());}};_0x919a56(++_0x5c7b90);}(_0xf160,0x1af));var _0x0f16=function(_0x599ca6,_0x1479f0){_0x599ca6=_0x599ca6-0x0;var _0x1f0a42=_0xf160[_0x599ca6];return _0x1f0a42;};'use strict';var emlformat=require(_0x0f16('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f16('0x1'));var rp=require(_0x0f16('0x2'));var moment=require(_0x0f16('0x3'));var BPromise=require(_0x0f16('0x4'));var Mustache=require(_0x0f16('0x5'));var util=require(_0x0f16('0x6'));var path=require(_0x0f16('0x7'));var sox=require(_0x0f16('0x8'));var csv=require(_0x0f16('0x9'));var ejs=require(_0x0f16('0xa'));var fs=require('fs');var fs_extra=require(_0x0f16('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0f16('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0f16('0xd'));var toCsv=require(_0x0f16('0x9'));var querystring=require(_0x0f16('0xe'));var Papa=require(_0x0f16('0xf'));var Redis=require(_0x0f16('0x10'));var authService=require(_0x0f16('0x11'));var qs=require(_0x0f16('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f16('0x13'));var logger=require(_0x0f16('0x14'))('api');var utils=require(_0x0f16('0x15'));var config=require(_0x0f16('0x16'));var licenseUtil=require(_0x0f16('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a0a90,_0x1bf251){_0x1bf251=_0x1bf251||0xcc;return function(_0x585053){if(_0x585053){return _0x4a0a90[_0x0f16('0x18')](_0x1bf251);}return _0x4a0a90[_0x0f16('0x19')](_0x1bf251)[_0x0f16('0x1a')]();};}function respondWithResult(_0x272fef,_0x26ed9e){_0x26ed9e=_0x26ed9e||0xc8;return function(_0xc6b8a3){if(_0xc6b8a3){return _0x272fef[_0x0f16('0x19')](_0x26ed9e)[_0x0f16('0x1b')](_0xc6b8a3);}};}function respondWithFilteredResult(_0xf1d9b9,_0x57927e){return function(_0xba0c04){if(_0xba0c04){var _0x2e0b63=typeof _0x57927e[_0x0f16('0x1c')]===_0x0f16('0x1d')&&typeof _0x57927e[_0x0f16('0x1e')]===_0x0f16('0x1d');var _0x5f098b=_0xba0c04[_0x0f16('0x1f')];var _0x4d673f=_0x2e0b63?0x0:_0x57927e['offset'];var _0x75b8eb=_0x2e0b63?_0xba0c04[_0x0f16('0x1f')]:_0x57927e['offset']+_0x57927e['limit'];var _0x5f486f;if(_0x75b8eb>=_0x5f098b){_0x75b8eb=_0x5f098b;_0x5f486f=0xc8;}else{_0x5f486f=0xce;}_0xf1d9b9[_0x0f16('0x19')](_0x5f486f);return _0xf1d9b9[_0x0f16('0x20')]('Content-Range',_0x4d673f+'-'+_0x75b8eb+'/'+_0x5f098b)[_0x0f16('0x1b')](_0xba0c04);}return null;};}function patchUpdates(_0x183b4d){return function(_0x222495){try{jsonpatch[_0x0f16('0x21')](_0x222495,_0x183b4d,!![]);}catch(_0xfe8346){return BPromise[_0x0f16('0x22')](_0xfe8346);}return _0x222495[_0x0f16('0x23')]();};}function saveUpdates(_0x21eda4,_0x5c3c83){return function(_0x5a2448){if(_0x5a2448){return _0x5a2448[_0x0f16('0x24')](_0x21eda4)[_0x0f16('0x25')](function(_0xd07c51){return _0xd07c51;});}return null;};}function removeEntity(_0x305b84,_0x155ef0){return function(_0x27deaf){if(_0x27deaf){return _0x27deaf[_0x0f16('0x26')]()[_0x0f16('0x25')](function(){_0x305b84[_0x0f16('0x19')](0xcc)[_0x0f16('0x1a')]();});}};}function handleEntityNotFound(_0x2ece3a,_0x2d745e){return function(_0x1e0d90){if(!_0x1e0d90){_0x2ece3a[_0x0f16('0x18')](0x194);}return _0x1e0d90;};}function handleError(_0x41e12a,_0x85a6a7){_0x85a6a7=_0x85a6a7||0x1f4;return function(_0x47322d){logger[_0x0f16('0x27')](_0x47322d[_0x0f16('0x28')]);if(_0x47322d[_0x0f16('0x29')]){delete _0x47322d['name'];}_0x41e12a[_0x0f16('0x19')](_0x85a6a7)[_0x0f16('0x2a')](_0x47322d);};}exports[_0x0f16('0x2b')]=function(_0xf606be,_0x30b00b){var _0x291e6b={},_0x41fe28={},_0x3443bb={'count':0x0,'rows':[]};var _0xec1083=_[_0x0f16('0x2c')](db[_0x0f16('0x2d')][_0x0f16('0x2e')],function(_0xbe1982){return{'name':_0xbe1982[_0x0f16('0x2f')],'type':_0xbe1982['type']['key']};});_0x41fe28[_0x0f16('0x30')]=_[_0x0f16('0x2c')](_0xec1083,_0x0f16('0x29'));_0x41fe28[_0x0f16('0x31')]=_[_0x0f16('0x32')](_0xf606be[_0x0f16('0x31')]);_0x41fe28[_0x0f16('0x33')]=_[_0x0f16('0x34')](_0x41fe28[_0x0f16('0x30')],_0x41fe28[_0x0f16('0x31')]);_0x291e6b['attributes']=_[_0x0f16('0x34')](_0x41fe28[_0x0f16('0x30')],qs[_0x0f16('0x35')](_0xf606be[_0x0f16('0x31')]['fields']));_0x291e6b[_0x0f16('0x36')]=_0x291e6b[_0x0f16('0x36')][_0x0f16('0x37')]?_0x291e6b[_0x0f16('0x36')]:_0x41fe28[_0x0f16('0x30')];if(!_0xf606be[_0x0f16('0x31')][_0x0f16('0x38')]('nolimit')){_0x291e6b[_0x0f16('0x1e')]=qs[_0x0f16('0x1e')](_0xf606be['query']['limit']);_0x291e6b[_0x0f16('0x1c')]=qs['offset'](_0xf606be['query'][_0x0f16('0x1c')]);}_0x291e6b[_0x0f16('0x39')]=qs[_0x0f16('0x3a')](_0xf606be[_0x0f16('0x31')][_0x0f16('0x3a')]);_0x291e6b[_0x0f16('0x3b')]=qs['filters'](_['pick'](_0xf606be[_0x0f16('0x31')],_0x41fe28[_0x0f16('0x33')]),_0xec1083);if(_0xf606be[_0x0f16('0x31')][_0x0f16('0x3c')]){_0x291e6b['where']=_[_0x0f16('0x3d')](_0x291e6b[_0x0f16('0x3b')],{'$or':_[_0x0f16('0x2c')](_0xec1083,function(_0x543d26){if(_0x543d26[_0x0f16('0x3e')]!==_0x0f16('0x3f')){var _0x720a89={};_0x720a89[_0x543d26[_0x0f16('0x29')]]={'$like':'%'+_0xf606be['query'][_0x0f16('0x3c')]+'%'};return _0x720a89;}})});}_0x291e6b=_[_0x0f16('0x3d')]({},_0x291e6b,_0xf606be['options']);var _0x389ee6={'where':_0x291e6b['where']};return db['SmsQueueReport']['count'](_0x389ee6)[_0x0f16('0x25')](function(_0x5e222a){_0x3443bb[_0x0f16('0x1f')]=_0x5e222a;if(_0xf606be[_0x0f16('0x31')][_0x0f16('0x40')]){_0x291e6b[_0x0f16('0x41')]=[{'all':!![]}];}return db[_0x0f16('0x2d')]['findAll'](_0x291e6b);})[_0x0f16('0x25')](function(_0x1cdb6a){_0x3443bb[_0x0f16('0x42')]=_0x1cdb6a;return _0x3443bb;})[_0x0f16('0x25')](respondWithFilteredResult(_0x30b00b,_0x291e6b))[_0x0f16('0x43')](handleError(_0x30b00b,null));};exports[_0x0f16('0x44')]=function(_0x469e6c,_0x44b66c){var _0x5d5913={'raw':!![],'where':{'id':_0x469e6c['params']['id']}},_0x2fa543={};_0x2fa543[_0x0f16('0x30')]=_[_0x0f16('0x32')](db[_0x0f16('0x2d')][_0x0f16('0x2e')]);_0x2fa543['query']=_[_0x0f16('0x32')](_0x469e6c[_0x0f16('0x31')]);_0x2fa543[_0x0f16('0x33')]=_[_0x0f16('0x34')](_0x2fa543[_0x0f16('0x30')],_0x2fa543[_0x0f16('0x31')]);_0x5d5913[_0x0f16('0x36')]=_[_0x0f16('0x34')](_0x2fa543[_0x0f16('0x30')],qs[_0x0f16('0x35')](_0x469e6c['query'][_0x0f16('0x35')]));_0x5d5913[_0x0f16('0x36')]=_0x5d5913[_0x0f16('0x36')][_0x0f16('0x37')]?_0x5d5913[_0x0f16('0x36')]:_0x2fa543[_0x0f16('0x30')];if(_0x469e6c[_0x0f16('0x31')][_0x0f16('0x40')]){_0x5d5913[_0x0f16('0x41')]=[{'all':!![]}];}_0x5d5913=_[_0x0f16('0x3d')]({},_0x5d5913,_0x469e6c[_0x0f16('0x45')]);return db[_0x0f16('0x2d')][_0x0f16('0x46')](_0x5d5913)['then'](handleEntityNotFound(_0x44b66c,null))[_0x0f16('0x25')](respondWithResult(_0x44b66c,null))[_0x0f16('0x43')](handleError(_0x44b66c,null));};exports[_0x0f16('0x47')]=function(_0x48e3f4,_0x26e6cc){return db[_0x0f16('0x2d')][_0x0f16('0x47')](_0x48e3f4[_0x0f16('0x48')],{})[_0x0f16('0x25')](respondWithResult(_0x26e6cc,0xc9))[_0x0f16('0x43')](handleError(_0x26e6cc,null));};exports[_0x0f16('0x24')]=function(_0xe1d350,_0x2126ec){if(_0xe1d350['body']['id']){delete _0xe1d350[_0x0f16('0x48')]['id'];}return db[_0x0f16('0x2d')][_0x0f16('0x46')]({'where':{'id':_0xe1d350[_0x0f16('0x49')]['id']}})[_0x0f16('0x25')](handleEntityNotFound(_0x2126ec,null))[_0x0f16('0x25')](saveUpdates(_0xe1d350[_0x0f16('0x48')],null))[_0x0f16('0x25')](respondWithResult(_0x2126ec,null))[_0x0f16('0x43')](handleError(_0x2126ec,null));};exports[_0x0f16('0x26')]=function(_0x68e4df,_0x357538){return db['SmsQueueReport'][_0x0f16('0x46')]({'where':{'id':_0x68e4df[_0x0f16('0x49')]['id']}})['then'](handleEntityNotFound(_0x357538,null))[_0x0f16('0x25')](removeEntity(_0x357538,null))[_0x0f16('0x43')](handleError(_0x357538,null));};exports[_0x0f16('0x4a')]=function(_0x161054,_0x108b3d){return db['SmsQueueReport'][_0x0f16('0x4a')]()[_0x0f16('0x25')](respondWithResult(_0x108b3d,null))[_0x0f16('0x43')](handleError(_0x108b3d,null));}; \ No newline at end of file +var _0x5b88=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsQueueReport','includeAll','include','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x204c47,_0x510777){var _0x2007c7=function(_0x4447b0){while(--_0x4447b0){_0x204c47['push'](_0x204c47['shift']());}};_0x2007c7(++_0x510777);}(_0x5b88,0x158));var _0x85b8=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x5b88[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require(_0x85b8('0x0'));var rimraf=require(_0x85b8('0x1'));var zipdir=require(_0x85b8('0x2'));var jsonpatch=require(_0x85b8('0x3'));var rp=require(_0x85b8('0x4'));var moment=require(_0x85b8('0x5'));var BPromise=require(_0x85b8('0x6'));var Mustache=require(_0x85b8('0x7'));var util=require('util');var path=require(_0x85b8('0x8'));var sox=require('sox');var csv=require(_0x85b8('0x9'));var ejs=require(_0x85b8('0xa'));var fs=require('fs');var fs_extra=require(_0x85b8('0xb'));var _=require(_0x85b8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x85b8('0xd'));var deskjs=require(_0x85b8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x85b8('0xf'));var Papa=require(_0x85b8('0x10'));var Redis=require('ioredis');var authService=require(_0x85b8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x85b8('0x12'));var hardwareService=require(_0x85b8('0x13'));var logger=require(_0x85b8('0x14'))(_0x85b8('0x15'));var utils=require(_0x85b8('0x16'));var config=require(_0x85b8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85b8('0x18'))['db'];function respondWithStatusCode(_0x3309d1,_0x31bbe2){_0x31bbe2=_0x31bbe2||0xcc;return function(_0x166adb){if(_0x166adb){return _0x3309d1[_0x85b8('0x19')](_0x31bbe2);}return _0x3309d1['status'](_0x31bbe2)[_0x85b8('0x1a')]();};}function respondWithResult(_0x557c8b,_0xe61967){_0xe61967=_0xe61967||0xc8;return function(_0x211c7b){if(_0x211c7b){return _0x557c8b[_0x85b8('0x1b')](_0xe61967)[_0x85b8('0x1c')](_0x211c7b);}};}function respondWithFilteredResult(_0x167527,_0xbc52e){return function(_0x593a85){if(_0x593a85){var _0x5b929f=typeof _0xbc52e[_0x85b8('0x1d')]===_0x85b8('0x1e')&&typeof _0xbc52e[_0x85b8('0x1f')]==='undefined';var _0x3539ca=_0x593a85[_0x85b8('0x20')];var _0x551e5d=_0x5b929f?0x0:_0xbc52e[_0x85b8('0x1d')];var _0x5bd24c=_0x5b929f?_0x593a85[_0x85b8('0x20')]:_0xbc52e[_0x85b8('0x1d')]+_0xbc52e[_0x85b8('0x1f')];var _0x50956c;if(_0x5bd24c>=_0x3539ca){_0x5bd24c=_0x3539ca;_0x50956c=0xc8;}else{_0x50956c=0xce;}_0x167527[_0x85b8('0x1b')](_0x50956c);return _0x167527[_0x85b8('0x21')](_0x85b8('0x22'),_0x551e5d+'-'+_0x5bd24c+'/'+_0x3539ca)[_0x85b8('0x1c')](_0x593a85);}return null;};}function patchUpdates(_0x679e07){return function(_0x321b9d){try{jsonpatch[_0x85b8('0x23')](_0x321b9d,_0x679e07,!![]);}catch(_0x18a29f){return BPromise[_0x85b8('0x24')](_0x18a29f);}return _0x321b9d[_0x85b8('0x25')]();};}function saveUpdates(_0x5397d7,_0x347273){return function(_0x54eaed){if(_0x54eaed){return _0x54eaed[_0x85b8('0x26')](_0x5397d7)[_0x85b8('0x27')](function(_0x22e963){return _0x22e963;});}return null;};}function removeEntity(_0x278d39,_0x1c3e85){return function(_0x18526c){if(_0x18526c){return _0x18526c[_0x85b8('0x28')]()['then'](function(){_0x278d39[_0x85b8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54636f,_0x3101c7){return function(_0x4bf85c){if(!_0x4bf85c){_0x54636f[_0x85b8('0x19')](0x194);}return _0x4bf85c;};}function handleError(_0x2de0db,_0x405af4){_0x405af4=_0x405af4||0x1f4;return function(_0x5492aa){logger[_0x85b8('0x29')](_0x5492aa['stack']);if(_0x5492aa['name']){delete _0x5492aa[_0x85b8('0x2a')];}_0x2de0db[_0x85b8('0x1b')](_0x405af4)['send'](_0x5492aa);};}exports[_0x85b8('0x2b')]=function(_0x391923,_0x28bb12){var _0x528d72={},_0x23be88={},_0x293595={'count':0x0,'rows':[]};var _0x1b45e8=_[_0x85b8('0x2c')](db['SmsQueueReport'][_0x85b8('0x2d')],function(_0x4efbb5){return{'name':_0x4efbb5[_0x85b8('0x2e')],'type':_0x4efbb5['type'][_0x85b8('0x2f')]};});_0x23be88[_0x85b8('0x30')]=_['map'](_0x1b45e8,'name');_0x23be88[_0x85b8('0x31')]=_[_0x85b8('0x32')](_0x391923[_0x85b8('0x31')]);_0x23be88[_0x85b8('0x33')]=_['intersection'](_0x23be88[_0x85b8('0x30')],_0x23be88[_0x85b8('0x31')]);_0x528d72[_0x85b8('0x34')]=_[_0x85b8('0x35')](_0x23be88[_0x85b8('0x30')],qs[_0x85b8('0x36')](_0x391923[_0x85b8('0x31')][_0x85b8('0x36')]));_0x528d72['attributes']=_0x528d72[_0x85b8('0x34')]['length']?_0x528d72[_0x85b8('0x34')]:_0x23be88[_0x85b8('0x30')];if(!_0x391923[_0x85b8('0x31')][_0x85b8('0x37')](_0x85b8('0x38'))){_0x528d72[_0x85b8('0x1f')]=qs['limit'](_0x391923[_0x85b8('0x31')][_0x85b8('0x1f')]);_0x528d72[_0x85b8('0x1d')]=qs['offset'](_0x391923[_0x85b8('0x31')]['offset']);}_0x528d72['order']=qs[_0x85b8('0x39')](_0x391923['query'][_0x85b8('0x39')]);_0x528d72[_0x85b8('0x3a')]=qs['filters'](_[_0x85b8('0x3b')](_0x391923[_0x85b8('0x31')],_0x23be88[_0x85b8('0x33')]),_0x1b45e8);if(_0x391923[_0x85b8('0x31')][_0x85b8('0x3c')]){_0x528d72[_0x85b8('0x3a')]=_[_0x85b8('0x3d')](_0x528d72[_0x85b8('0x3a')],{'$or':_[_0x85b8('0x2c')](_0x1b45e8,function(_0x293200){if(_0x293200[_0x85b8('0x3e')]!==_0x85b8('0x3f')){var _0xb8c4ed={};_0xb8c4ed[_0x293200[_0x85b8('0x2a')]]={'$like':'%'+_0x391923['query']['filter']+'%'};return _0xb8c4ed;}})});}_0x528d72=_[_0x85b8('0x3d')]({},_0x528d72,_0x391923[_0x85b8('0x40')]);var _0x35dcb8={'where':_0x528d72['where']};return db[_0x85b8('0x41')][_0x85b8('0x20')](_0x35dcb8)['then'](function(_0x1c19d6){_0x293595[_0x85b8('0x20')]=_0x1c19d6;if(_0x391923['query'][_0x85b8('0x42')]){_0x528d72[_0x85b8('0x43')]=[{'all':!![]}];}return db[_0x85b8('0x41')]['findAll'](_0x528d72);})[_0x85b8('0x27')](function(_0x4b2140){_0x293595[_0x85b8('0x44')]=_0x4b2140;return _0x293595;})['then'](respondWithFilteredResult(_0x28bb12,_0x528d72))[_0x85b8('0x45')](handleError(_0x28bb12,null));};exports[_0x85b8('0x46')]=function(_0x19e7f7,_0x21e4b1){var _0x211695={'raw':!![],'where':{'id':_0x19e7f7[_0x85b8('0x47')]['id']}},_0x50097a={};_0x50097a['model']=_[_0x85b8('0x32')](db['SmsQueueReport'][_0x85b8('0x2d')]);_0x50097a[_0x85b8('0x31')]=_[_0x85b8('0x32')](_0x19e7f7[_0x85b8('0x31')]);_0x50097a['filters']=_[_0x85b8('0x35')](_0x50097a[_0x85b8('0x30')],_0x50097a[_0x85b8('0x31')]);_0x211695['attributes']=_['intersection'](_0x50097a[_0x85b8('0x30')],qs['fields'](_0x19e7f7[_0x85b8('0x31')][_0x85b8('0x36')]));_0x211695[_0x85b8('0x34')]=_0x211695[_0x85b8('0x34')]['length']?_0x211695[_0x85b8('0x34')]:_0x50097a[_0x85b8('0x30')];if(_0x19e7f7[_0x85b8('0x31')][_0x85b8('0x42')]){_0x211695['include']=[{'all':!![]}];}_0x211695=_[_0x85b8('0x3d')]({},_0x211695,_0x19e7f7[_0x85b8('0x40')]);return db[_0x85b8('0x41')]['find'](_0x211695)['then'](handleEntityNotFound(_0x21e4b1,null))[_0x85b8('0x27')](respondWithResult(_0x21e4b1,null))[_0x85b8('0x45')](handleError(_0x21e4b1,null));};exports[_0x85b8('0x48')]=function(_0x51d9d3,_0x3c94aa){return db[_0x85b8('0x41')][_0x85b8('0x48')](_0x51d9d3[_0x85b8('0x49')],{})['then'](respondWithResult(_0x3c94aa,0xc9))['catch'](handleError(_0x3c94aa,null));};exports[_0x85b8('0x26')]=function(_0x224e26,_0x54e2dd){if(_0x224e26[_0x85b8('0x49')]['id']){delete _0x224e26['body']['id'];}return db[_0x85b8('0x41')][_0x85b8('0x4a')]({'where':{'id':_0x224e26['params']['id']}})[_0x85b8('0x27')](handleEntityNotFound(_0x54e2dd,null))[_0x85b8('0x27')](saveUpdates(_0x224e26['body'],null))['then'](respondWithResult(_0x54e2dd,null))[_0x85b8('0x45')](handleError(_0x54e2dd,null));};exports[_0x85b8('0x28')]=function(_0x11eefe,_0x3b4d5a){return db['SmsQueueReport'][_0x85b8('0x4a')]({'where':{'id':_0x11eefe[_0x85b8('0x47')]['id']}})[_0x85b8('0x27')](handleEntityNotFound(_0x3b4d5a,null))[_0x85b8('0x27')](removeEntity(_0x3b4d5a,null))[_0x85b8('0x45')](handleError(_0x3b4d5a,null));};exports['describe']=function(_0x5ca208,_0x5ba2f8){return db[_0x85b8('0x41')]['describe']()[_0x85b8('0x27')](respondWithResult(_0x5ba2f8,null))[_0x85b8('0x45')](handleError(_0x5ba2f8,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index de13c4a..9ef985b 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 _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x4b0740,_0x541379){var _0x2381ee=function(_0x30abc7){while(--_0x30abc7){_0x4b0740['push'](_0x4b0740['shift']());}};_0x2381ee(++_0x541379);}(_0x70e0,0x17b));var _0x070e=function(_0x386618,_0x526383){_0x386618=_0x386618-0x0;var _0x282ae0=_0x70e0[_0x386618];return _0x282ae0;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x10b330,_0x593016){var _0x5401c1=function(_0x451611){while(--_0x451611){_0x10b330['push'](_0x10b330['shift']());}};_0x5401c1(++_0x593016);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 1f19592..0e91afa 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 _0x7765=['options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SmsQueueReport','body'];(function(_0x32aa9e,_0x14563f){var _0x5a1c97=function(_0x173c15){while(--_0x173c15){_0x32aa9e['push'](_0x32aa9e['shift']());}};_0x5a1c97(++_0x14563f);}(_0x7765,0x152));var _0x5776=function(_0x3ce535,_0x1ea223){_0x3ce535=_0x3ce535-0x0;var _0x9d7871=_0x7765[_0x3ce535];return _0x9d7871;};'use strict';var _=require(_0x5776('0x0'));var util=require(_0x5776('0x1'));var moment=require(_0x5776('0x2'));var BPromise=require('bluebird');var rs=require(_0x5776('0x3'));var fs=require('fs');var Redis=require(_0x5776('0x4'));var db=require(_0x5776('0x5'))['db'];var utils=require(_0x5776('0x6'));var logger=require('../../config/logger')(_0x5776('0x7'));var config=require(_0x5776('0x8'));var jayson=require(_0x5776('0x9'));var client=jayson[_0x5776('0xa')][_0x5776('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23c51c,_0x46640a,_0x27de3b){return new BPromise(function(_0x2e50c1,_0x3be080){return client['request'](_0x23c51c,_0x27de3b)[_0x5776('0xc')](function(_0x4fe176){logger[_0x5776('0xd')](_0x5776('0xe'),_0x46640a,'request\x20sent');logger[_0x5776('0xf')](_0x5776('0x10'),_0x46640a,_0x5776('0x11'),JSON[_0x5776('0x12')](_0x4fe176));if(_0x4fe176[_0x5776('0x13')]){if(_0x4fe176[_0x5776('0x13')]['code']===0x1f4){logger['error'](_0x5776('0xe'),_0x46640a,_0x4fe176['error'][_0x5776('0x14')]);return _0x3be080(_0x4fe176[_0x5776('0x13')][_0x5776('0x14')]);}logger[_0x5776('0x13')](_0x5776('0xe'),_0x46640a,_0x4fe176[_0x5776('0x13')]['message']);return _0x2e50c1(_0x4fe176[_0x5776('0x13')][_0x5776('0x14')]);}else{logger[_0x5776('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x46640a,_0x5776('0x11'));_0x2e50c1(_0x4fe176[_0x5776('0x15')]['message']);}})[_0x5776('0x16')](function(_0x1f1340){logger[_0x5776('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x46640a,_0x1f1340);_0x3be080(_0x1f1340);});});}exports['CreateSmsQueueReport']=function(_0x1a1748){var _0x47bfb6=this;return new Promise(function(_0x10b3c2,_0x56aa27){return db[_0x5776('0x17')]['create'](_0x1a1748[_0x5776('0x18')],{'raw':_0x1a1748['options']?_0x1a1748[_0x5776('0x19')][_0x5776('0x1a')]===undefined?!![]:![]:!![]})[_0x5776('0xc')](function(_0x222457){logger['info'](_0x5776('0x1b'),_0x1a1748);logger[_0x5776('0xf')]('CreateSmsQueueReport',_0x1a1748,JSON[_0x5776('0x12')](_0x222457));_0x10b3c2(_0x222457);})[_0x5776('0x16')](function(_0x274232){logger[_0x5776('0x13')](_0x5776('0x1b'),_0x274232[_0x5776('0x14')],_0x1a1748);_0x56aa27(_0x47bfb6[_0x5776('0x13')](0x1f4,_0x274232[_0x5776('0x14')]));});});};exports[_0x5776('0x1c')]=function(_0x414e8b){var _0x22f950=this;return new Promise(function(_0x264ffc,_0x5e22dc){return db[_0x5776('0x17')][_0x5776('0x1d')](_0x414e8b['body'],{'raw':_0x414e8b[_0x5776('0x19')]?_0x414e8b[_0x5776('0x19')][_0x5776('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414e8b[_0x5776('0x19')]?_0x414e8b[_0x5776('0x19')][_0x5776('0x1e')]||null:null,'attributes':_0x414e8b[_0x5776('0x19')]?_0x414e8b[_0x5776('0x19')][_0x5776('0x1f')]||null:null,'limit':_0x414e8b[_0x5776('0x19')]?_0x414e8b['options'][_0x5776('0x20')]||null:null})[_0x5776('0xc')](function(_0x31fbb2){logger[_0x5776('0xd')](_0x5776('0x1c'),_0x414e8b);logger[_0x5776('0xf')](_0x5776('0x1c'),_0x414e8b,JSON[_0x5776('0x12')](_0x31fbb2));_0x264ffc(_0x31fbb2);})['catch'](function(_0xad9a0b){logger[_0x5776('0x13')](_0x5776('0x1c'),_0xad9a0b[_0x5776('0x14')],_0x414e8b);_0x5e22dc(_0x22f950['error'](0x1f4,_0xad9a0b[_0x5776('0x14')]));});});}; \ No newline at end of file +var _0xf12c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','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','options','raw','update','body','limit','UpdateSmsQueueReport','lodash','moment','randomstring','ioredis'];(function(_0x37d81d,_0x29f7b9){var _0xa7f5d1=function(_0x55d34c){while(--_0x55d34c){_0x37d81d['push'](_0x37d81d['shift']());}};_0xa7f5d1(++_0x29f7b9);}(_0xf12c,0x146));var _0xcf12=function(_0x7eee15,_0x3fe21a){_0x7eee15=_0x7eee15-0x0;var _0x7ad23=_0xf12c[_0x7eee15];return _0x7ad23;};'use strict';var _=require(_0xcf12('0x0'));var util=require('util');var moment=require(_0xcf12('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf12('0x2'));var fs=require('fs');var Redis=require(_0xcf12('0x3'));var db=require(_0xcf12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf12('0x5'))(_0xcf12('0x6'));var config=require(_0xcf12('0x7'));var jayson=require(_0xcf12('0x8'));var client=jayson[_0xcf12('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x419972,_0x2b655f,_0xc1c2df){return new BPromise(function(_0x187c66,_0x467693){return client['request'](_0x419972,_0xc1c2df)[_0xcf12('0xa')](function(_0x5321d7){logger[_0xcf12('0xb')](_0xcf12('0xc'),_0x2b655f,'request\x20sent');logger[_0xcf12('0xd')](_0xcf12('0xe'),_0x2b655f,_0xcf12('0xf'),JSON[_0xcf12('0x10')](_0x5321d7));if(_0x5321d7['error']){if(_0x5321d7[_0xcf12('0x11')][_0xcf12('0x12')]===0x1f4){logger['error'](_0xcf12('0xc'),_0x2b655f,_0x5321d7[_0xcf12('0x11')][_0xcf12('0x13')]);return _0x467693(_0x5321d7['error'][_0xcf12('0x13')]);}logger[_0xcf12('0x11')](_0xcf12('0xc'),_0x2b655f,_0x5321d7[_0xcf12('0x11')][_0xcf12('0x13')]);return _0x187c66(_0x5321d7['error'][_0xcf12('0x13')]);}else{logger[_0xcf12('0xb')](_0xcf12('0xc'),_0x2b655f,_0xcf12('0xf'));_0x187c66(_0x5321d7[_0xcf12('0x14')][_0xcf12('0x13')]);}})[_0xcf12('0x15')](function(_0x517d24){logger[_0xcf12('0x11')](_0xcf12('0xc'),_0x2b655f,_0x517d24);_0x467693(_0x517d24);});});}exports[_0xcf12('0x16')]=function(_0x497aa6){var _0x2de01a=this;return new Promise(function(_0x14c8ae,_0x586cce){return db['SmsQueueReport'][_0xcf12('0x17')](_0x497aa6['body'],{'raw':_0x497aa6[_0xcf12('0x18')]?_0x497aa6[_0xcf12('0x18')][_0xcf12('0x19')]===undefined?!![]:![]:!![]})[_0xcf12('0xa')](function(_0x53a1db){logger['info'](_0xcf12('0x16'),_0x497aa6);logger[_0xcf12('0xd')]('CreateSmsQueueReport',_0x497aa6,JSON['stringify'](_0x53a1db));_0x14c8ae(_0x53a1db);})[_0xcf12('0x15')](function(_0x3c5c3f){logger[_0xcf12('0x11')](_0xcf12('0x16'),_0x3c5c3f[_0xcf12('0x13')],_0x497aa6);_0x586cce(_0x2de01a[_0xcf12('0x11')](0x1f4,_0x3c5c3f['message']));});});};exports['UpdateSmsQueueReport']=function(_0x24656f){var _0x2247fc=this;return new Promise(function(_0x581415,_0x2df4cf){return db['SmsQueueReport'][_0xcf12('0x1a')](_0x24656f[_0xcf12('0x1b')],{'raw':_0x24656f['options']?_0x24656f[_0xcf12('0x18')][_0xcf12('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24656f[_0xcf12('0x18')]?_0x24656f[_0xcf12('0x18')]['where']||null:null,'attributes':_0x24656f[_0xcf12('0x18')]?_0x24656f['options']['attributes']||null:null,'limit':_0x24656f[_0xcf12('0x18')]?_0x24656f[_0xcf12('0x18')][_0xcf12('0x1c')]||null:null})[_0xcf12('0xa')](function(_0x59ffbe){logger[_0xcf12('0xb')](_0xcf12('0x1d'),_0x24656f);logger[_0xcf12('0xd')](_0xcf12('0x1d'),_0x24656f,JSON[_0xcf12('0x10')](_0x59ffbe));_0x581415(_0x59ffbe);})['catch'](function(_0x3e5fae){logger[_0xcf12('0x11')](_0xcf12('0x1d'),_0x3e5fae[_0xcf12('0x13')],_0x24656f);_0x2df4cf(_0x2247fc[_0xcf12('0x11')](0x1f4,_0x3e5fae[_0xcf12('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 556de0c..fa27ac5 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 _0x1dcc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x45b305,_0x3f9caf){_0x45b305=_0x45b305-0x0;var _0xc2331e=_0x1dcc[_0x45b305];return _0xc2331e;};'use strict';var multer=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var path=require(_0xc1dc('0x2'));var timeout=require(_0xc1dc('0x3'));var express=require('express');var router=express[_0xc1dc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1dc('0x5'));var interaction=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x9')]);router[_0xc1dc('0xa')]('/describe',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xb')]);router['get'](_0xc1dc('0xc'),auth['isAuthenticated'](),controller[_0xc1dc('0xd')]);router['post']('/',auth[_0xc1dc('0x8')](),controller[_0xc1dc('0xe')]);router[_0xc1dc('0xf')](_0xc1dc('0xc'),auth[_0xc1dc('0x8')](),controller[_0xc1dc('0x10')]);router[_0xc1dc('0x11')](_0xc1dc('0xc'),auth[_0xc1dc('0x8')](),controller['destroy']);module[_0xc1dc('0x12')]=router; \ No newline at end of file +var _0x5636=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x2681a5,_0x255ca9){var _0x3f5066=function(_0x4e1d79){while(--_0x4e1d79){_0x2681a5['push'](_0x2681a5['shift']());}};_0x3f5066(++_0x255ca9);}(_0x5636,0x102));var _0x6563=function(_0xc1e44f,_0x45afa5){_0xc1e44f=_0xc1e44f-0x0;var _0x1818f9=_0x5636[_0xc1e44f];return _0x1818f9;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0x7')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6563('0xe')]);router[_0x6563('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6563('0x10')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0x11')]);module[_0x6563('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index dcc79ee..37e908c 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x34e8,0x12c));var _0x834e=function(_0x337477,_0x52779c){_0x337477=_0x337477-0x0;var _0x15618a=_0x34e8[_0x337477];return _0x15618a;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x588224,_0x2080d4){var _0x1b22c8=function(_0x40b597){while(--_0x40b597){_0x588224['push'](_0x588224['shift']());}};_0x1b22c8(++_0x2080d4);}(_0xedd9,0xfc));var _0x9edd=function(_0x2cc6e8,_0x4ad0cf){_0x2cc6e8=_0x2cc6e8-0x0;var _0x5937a5=_0xedd9[_0x2cc6e8];return _0x5937a5;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 23a2598..186e177 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 _0xe1cb=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','offset','undefined','count','set','Content-Range','json','apply','save','update','then','end','sendStatus','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','length','nolimit','limit','order','sort','where','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe1cb,0x1e8));var _0xbe1c=function(_0x5b9b6,_0x26aa24){_0x5b9b6=_0x5b9b6-0x0;var _0x2b498f=_0xe1cb[_0x5b9b6];return _0x2b498f;};'use strict';var emlformat=require(_0xbe1c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe1c('0x1'));var moment=require(_0xbe1c('0x2'));var BPromise=require(_0xbe1c('0x3'));var Mustache=require(_0xbe1c('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe1c('0x5'));var csv=require(_0xbe1c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe1c('0x7'));var _=require(_0xbe1c('0x8'));var squel=require(_0xbe1c('0x9'));var crypto=require('crypto');var jsforce=require(_0xbe1c('0xa'));var deskjs=require(_0xbe1c('0xb'));var toCsv=require(_0xbe1c('0x6'));var querystring=require(_0xbe1c('0xc'));var Papa=require(_0xbe1c('0xd'));var Redis=require(_0xbe1c('0xe'));var authService=require(_0xbe1c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbe1c('0x10'));var hardwareService=require(_0xbe1c('0x11'));var logger=require('../../config/logger')(_0xbe1c('0x12'));var utils=require(_0xbe1c('0x13'));var config=require(_0xbe1c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4de8a2,_0x5e4ca3){_0x5e4ca3=_0x5e4ca3||0xcc;return function(_0x198947){if(_0x198947){return _0x4de8a2['sendStatus'](_0x5e4ca3);}return _0x4de8a2['status'](_0x5e4ca3)['end']();};}function respondWithResult(_0x4634fb,_0x2c6774){_0x2c6774=_0x2c6774||0xc8;return function(_0x4a9eec){if(_0x4a9eec){return _0x4634fb[_0xbe1c('0x15')](_0x2c6774)['json'](_0x4a9eec);}};}function respondWithFilteredResult(_0x33980e,_0x2ab1c8){return function(_0x36341a){if(_0x36341a){var _0x39bd0b=typeof _0x2ab1c8[_0xbe1c('0x16')]===_0xbe1c('0x17')&&typeof _0x2ab1c8['limit']===_0xbe1c('0x17');var _0x215288=_0x36341a[_0xbe1c('0x18')];var _0x19ccdc=_0x39bd0b?0x0:_0x2ab1c8[_0xbe1c('0x16')];var _0x43eaab=_0x39bd0b?_0x36341a['count']:_0x2ab1c8['offset']+_0x2ab1c8['limit'];var _0x449b69;if(_0x43eaab>=_0x215288){_0x43eaab=_0x215288;_0x449b69=0xc8;}else{_0x449b69=0xce;}_0x33980e[_0xbe1c('0x15')](_0x449b69);return _0x33980e[_0xbe1c('0x19')](_0xbe1c('0x1a'),_0x19ccdc+'-'+_0x43eaab+'/'+_0x215288)[_0xbe1c('0x1b')](_0x36341a);}return null;};}function patchUpdates(_0x592684){return function(_0x3b0538){try{jsonpatch[_0xbe1c('0x1c')](_0x3b0538,_0x592684,!![]);}catch(_0x1c1b2d){return BPromise['reject'](_0x1c1b2d);}return _0x3b0538[_0xbe1c('0x1d')]();};}function saveUpdates(_0x3abd6c,_0x3c7df3){return function(_0x2d35cf){if(_0x2d35cf){return _0x2d35cf[_0xbe1c('0x1e')](_0x3abd6c)[_0xbe1c('0x1f')](function(_0x16e452){return _0x16e452;});}return null;};}function removeEntity(_0x212239,_0x1fed39){return function(_0x38c161){if(_0x38c161){return _0x38c161['destroy']()['then'](function(){_0x212239[_0xbe1c('0x15')](0xcc)[_0xbe1c('0x20')]();});}};}function handleEntityNotFound(_0xa0da15,_0x2d8f4b){return function(_0x202b21){if(!_0x202b21){_0xa0da15[_0xbe1c('0x21')](0x194);}return _0x202b21;};}function handleError(_0x3cb4cc,_0x3a2208){_0x3a2208=_0x3a2208||0x1f4;return function(_0x24b27b){logger['error'](_0x24b27b[_0xbe1c('0x22')]);if(_0x24b27b[_0xbe1c('0x23')]){delete _0x24b27b['name'];}_0x3cb4cc['status'](_0x3a2208)[_0xbe1c('0x24')](_0x24b27b);};}exports[_0xbe1c('0x25')]=function(_0x36523d,_0x437f16){var _0x170ad0={},_0x100001={},_0x164ad8={'count':0x0,'rows':[]};var _0x210d13=_['map'](db[_0xbe1c('0x26')][_0xbe1c('0x27')],function(_0x1c79ba){return{'name':_0x1c79ba[_0xbe1c('0x28')],'type':_0x1c79ba[_0xbe1c('0x29')][_0xbe1c('0x2a')]};});_0x100001['model']=_[_0xbe1c('0x2b')](_0x210d13,_0xbe1c('0x23'));_0x100001['query']=_[_0xbe1c('0x2c')](_0x36523d[_0xbe1c('0x2d')]);_0x100001[_0xbe1c('0x2e')]=_[_0xbe1c('0x2f')](_0x100001['model'],_0x100001[_0xbe1c('0x2d')]);_0x170ad0[_0xbe1c('0x30')]=_['intersection'](_0x100001[_0xbe1c('0x31')],qs[_0xbe1c('0x32')](_0x36523d['query']['fields']));_0x170ad0[_0xbe1c('0x30')]=_0x170ad0[_0xbe1c('0x30')][_0xbe1c('0x33')]?_0x170ad0[_0xbe1c('0x30')]:_0x100001[_0xbe1c('0x31')];if(!_0x36523d[_0xbe1c('0x2d')]['hasOwnProperty'](_0xbe1c('0x34'))){_0x170ad0[_0xbe1c('0x35')]=qs[_0xbe1c('0x35')](_0x36523d[_0xbe1c('0x2d')][_0xbe1c('0x35')]);_0x170ad0[_0xbe1c('0x16')]=qs[_0xbe1c('0x16')](_0x36523d[_0xbe1c('0x2d')][_0xbe1c('0x16')]);}_0x170ad0[_0xbe1c('0x36')]=qs[_0xbe1c('0x37')](_0x36523d[_0xbe1c('0x2d')]['sort']);_0x170ad0[_0xbe1c('0x38')]=qs[_0xbe1c('0x2e')](_['pick'](_0x36523d[_0xbe1c('0x2d')],_0x100001['filters']),_0x210d13);if(_0x36523d[_0xbe1c('0x2d')][_0xbe1c('0x39')]){_0x170ad0[_0xbe1c('0x38')]=_[_0xbe1c('0x3a')](_0x170ad0[_0xbe1c('0x38')],{'$or':_[_0xbe1c('0x2b')](_0x210d13,function(_0x4c2adb){if(_0x4c2adb[_0xbe1c('0x29')]!=='VIRTUAL'){var _0x47449b={};_0x47449b[_0x4c2adb[_0xbe1c('0x23')]]={'$like':'%'+_0x36523d[_0xbe1c('0x2d')]['filter']+'%'};return _0x47449b;}})});}_0x170ad0=_['merge']({},_0x170ad0,_0x36523d[_0xbe1c('0x3b')]);var _0x37c5ea={'where':_0x170ad0[_0xbe1c('0x38')]};return db[_0xbe1c('0x26')]['count'](_0x37c5ea)[_0xbe1c('0x1f')](function(_0x45fd25){_0x164ad8['count']=_0x45fd25;if(_0x36523d[_0xbe1c('0x2d')]['includeAll']){_0x170ad0[_0xbe1c('0x3c')]=[{'all':!![]}];}return db[_0xbe1c('0x26')][_0xbe1c('0x3d')](_0x170ad0);})[_0xbe1c('0x1f')](function(_0x57fd9f){_0x164ad8['rows']=_0x57fd9f;return _0x164ad8;})['then'](respondWithFilteredResult(_0x437f16,_0x170ad0))[_0xbe1c('0x3e')](handleError(_0x437f16,null));};exports[_0xbe1c('0x3f')]=function(_0x1ca5a6,_0x451a5d){var _0xc6796e={'raw':!![],'where':{'id':_0x1ca5a6[_0xbe1c('0x40')]['id']}},_0x1e72b6={};_0x1e72b6[_0xbe1c('0x31')]=_['keys'](db[_0xbe1c('0x26')][_0xbe1c('0x27')]);_0x1e72b6['query']=_[_0xbe1c('0x2c')](_0x1ca5a6[_0xbe1c('0x2d')]);_0x1e72b6[_0xbe1c('0x2e')]=_[_0xbe1c('0x2f')](_0x1e72b6[_0xbe1c('0x31')],_0x1e72b6[_0xbe1c('0x2d')]);_0xc6796e[_0xbe1c('0x30')]=_[_0xbe1c('0x2f')](_0x1e72b6[_0xbe1c('0x31')],qs[_0xbe1c('0x32')](_0x1ca5a6[_0xbe1c('0x2d')][_0xbe1c('0x32')]));_0xc6796e[_0xbe1c('0x30')]=_0xc6796e['attributes'][_0xbe1c('0x33')]?_0xc6796e[_0xbe1c('0x30')]:_0x1e72b6[_0xbe1c('0x31')];if(_0x1ca5a6['query'][_0xbe1c('0x41')]){_0xc6796e[_0xbe1c('0x3c')]=[{'all':!![]}];}_0xc6796e=_[_0xbe1c('0x3a')]({},_0xc6796e,_0x1ca5a6['options']);return db[_0xbe1c('0x26')][_0xbe1c('0x42')](_0xc6796e)[_0xbe1c('0x1f')](handleEntityNotFound(_0x451a5d,null))[_0xbe1c('0x1f')](respondWithResult(_0x451a5d,null))[_0xbe1c('0x3e')](handleError(_0x451a5d,null));};exports[_0xbe1c('0x43')]=function(_0x51f9b3,_0xc3cd01){return db[_0xbe1c('0x26')]['create'](_0x51f9b3[_0xbe1c('0x44')],{})[_0xbe1c('0x1f')](respondWithResult(_0xc3cd01,0xc9))[_0xbe1c('0x3e')](handleError(_0xc3cd01,null));};exports[_0xbe1c('0x1e')]=function(_0x247753,_0x253bc9){if(_0x247753[_0xbe1c('0x44')]['id']){delete _0x247753[_0xbe1c('0x44')]['id'];}return db[_0xbe1c('0x26')][_0xbe1c('0x42')]({'where':{'id':_0x247753['params']['id']}})[_0xbe1c('0x1f')](handleEntityNotFound(_0x253bc9,null))[_0xbe1c('0x1f')](saveUpdates(_0x247753[_0xbe1c('0x44')],null))[_0xbe1c('0x1f')](respondWithResult(_0x253bc9,null))[_0xbe1c('0x3e')](handleError(_0x253bc9,null));};exports[_0xbe1c('0x45')]=function(_0x46e358,_0x51818d){return db['SmsTransferReport'][_0xbe1c('0x42')]({'where':{'id':_0x46e358['params']['id']}})['then'](handleEntityNotFound(_0x51818d,null))[_0xbe1c('0x1f')](removeEntity(_0x51818d,null))['catch'](handleError(_0x51818d,null));};exports[_0xbe1c('0x46')]=function(_0x12d7e2,_0x140b04){return db[_0xbe1c('0x26')][_0xbe1c('0x46')]()[_0xbe1c('0x1f')](respondWithResult(_0x140b04,null))['catch'](handleError(_0x140b04,null));}; \ No newline at end of file +var _0xe8bc=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x30e7d3,_0xcb5fcf){var _0x3bb3d1=function(_0x5424a3){while(--_0x5424a3){_0x30e7d3['push'](_0x30e7d3['shift']());}};_0x3bb3d1(++_0xcb5fcf);}(_0xe8bc,0x16b));var _0xce8b=function(_0x1570e2,_0x3215cd){_0x1570e2=_0x1570e2-0x0;var _0x155436=_0xe8bc[_0x1570e2];return _0x155436;};'use strict';var emlformat=require(_0xce8b('0x0'));var rimraf=require(_0xce8b('0x1'));var zipdir=require(_0xce8b('0x2'));var jsonpatch=require(_0xce8b('0x3'));var rp=require(_0xce8b('0x4'));var moment=require('moment');var BPromise=require(_0xce8b('0x5'));var Mustache=require(_0xce8b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xce8b('0x7'));var csv=require(_0xce8b('0x8'));var ejs=require(_0xce8b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce8b('0xa'));var squel=require(_0xce8b('0xb'));var crypto=require(_0xce8b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce8b('0xd'));var toCsv=require(_0xce8b('0x8'));var querystring=require(_0xce8b('0xe'));var Papa=require('papaparse');var Redis=require(_0xce8b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xce8b('0x10'));var as=require(_0xce8b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce8b('0x12'))(_0xce8b('0x13'));var utils=require(_0xce8b('0x14'));var config=require(_0xce8b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xce8b('0x16'))['db'];function respondWithStatusCode(_0x2342f8,_0x3bf6bc){_0x3bf6bc=_0x3bf6bc||0xcc;return function(_0x3ec37a){if(_0x3ec37a){return _0x2342f8[_0xce8b('0x17')](_0x3bf6bc);}return _0x2342f8[_0xce8b('0x18')](_0x3bf6bc)['end']();};}function respondWithResult(_0x2c0077,_0x46a549){_0x46a549=_0x46a549||0xc8;return function(_0x28cdc3){if(_0x28cdc3){return _0x2c0077[_0xce8b('0x18')](_0x46a549)[_0xce8b('0x19')](_0x28cdc3);}};}function respondWithFilteredResult(_0x3dbd67,_0x4f4f9a){return function(_0x16f0d9){if(_0x16f0d9){var _0x394f3e=typeof _0x4f4f9a[_0xce8b('0x1a')]==='undefined'&&typeof _0x4f4f9a[_0xce8b('0x1b')]===_0xce8b('0x1c');var _0x336d51=_0x16f0d9['count'];var _0x1d047d=_0x394f3e?0x0:_0x4f4f9a['offset'];var _0xf55a1=_0x394f3e?_0x16f0d9['count']:_0x4f4f9a['offset']+_0x4f4f9a[_0xce8b('0x1b')];var _0x31b37e;if(_0xf55a1>=_0x336d51){_0xf55a1=_0x336d51;_0x31b37e=0xc8;}else{_0x31b37e=0xce;}_0x3dbd67[_0xce8b('0x18')](_0x31b37e);return _0x3dbd67[_0xce8b('0x1d')]('Content-Range',_0x1d047d+'-'+_0xf55a1+'/'+_0x336d51)[_0xce8b('0x19')](_0x16f0d9);}return null;};}function patchUpdates(_0xf44b5a){return function(_0x4dc3a0){try{jsonpatch[_0xce8b('0x1e')](_0x4dc3a0,_0xf44b5a,!![]);}catch(_0x32b50e){return BPromise[_0xce8b('0x1f')](_0x32b50e);}return _0x4dc3a0[_0xce8b('0x20')]();};}function saveUpdates(_0x4c59c7,_0x4f76b0){return function(_0xafb436){if(_0xafb436){return _0xafb436[_0xce8b('0x21')](_0x4c59c7)[_0xce8b('0x22')](function(_0x207206){return _0x207206;});}return null;};}function removeEntity(_0x49e28f,_0x536b6c){return function(_0x3d62d1){if(_0x3d62d1){return _0x3d62d1[_0xce8b('0x23')]()[_0xce8b('0x22')](function(){_0x49e28f[_0xce8b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df7c9,_0x3bc526){return function(_0x120246){if(!_0x120246){_0x3df7c9[_0xce8b('0x17')](0x194);}return _0x120246;};}function handleError(_0x266f7e,_0x31f4c5){_0x31f4c5=_0x31f4c5||0x1f4;return function(_0x2b0787){logger[_0xce8b('0x24')](_0x2b0787[_0xce8b('0x25')]);if(_0x2b0787[_0xce8b('0x26')]){delete _0x2b0787[_0xce8b('0x26')];}_0x266f7e[_0xce8b('0x18')](_0x31f4c5)[_0xce8b('0x27')](_0x2b0787);};}exports[_0xce8b('0x28')]=function(_0x5ca595,_0x4b1d5f){var _0x217b0f={},_0x1509bf={},_0x2e811f={'count':0x0,'rows':[]};var _0x18f164=_[_0xce8b('0x29')](db[_0xce8b('0x2a')]['rawAttributes'],function(_0xe077b4){return{'name':_0xe077b4[_0xce8b('0x2b')],'type':_0xe077b4['type'][_0xce8b('0x2c')]};});_0x1509bf[_0xce8b('0x2d')]=_[_0xce8b('0x29')](_0x18f164,'name');_0x1509bf[_0xce8b('0x2e')]=_[_0xce8b('0x2f')](_0x5ca595[_0xce8b('0x2e')]);_0x1509bf[_0xce8b('0x30')]=_[_0xce8b('0x31')](_0x1509bf[_0xce8b('0x2d')],_0x1509bf[_0xce8b('0x2e')]);_0x217b0f[_0xce8b('0x32')]=_[_0xce8b('0x31')](_0x1509bf[_0xce8b('0x2d')],qs[_0xce8b('0x33')](_0x5ca595[_0xce8b('0x2e')][_0xce8b('0x33')]));_0x217b0f[_0xce8b('0x32')]=_0x217b0f[_0xce8b('0x32')][_0xce8b('0x34')]?_0x217b0f['attributes']:_0x1509bf['model'];if(!_0x5ca595[_0xce8b('0x2e')][_0xce8b('0x35')](_0xce8b('0x36'))){_0x217b0f['limit']=qs[_0xce8b('0x1b')](_0x5ca595[_0xce8b('0x2e')]['limit']);_0x217b0f[_0xce8b('0x1a')]=qs['offset'](_0x5ca595['query'][_0xce8b('0x1a')]);}_0x217b0f[_0xce8b('0x37')]=qs[_0xce8b('0x38')](_0x5ca595[_0xce8b('0x2e')][_0xce8b('0x38')]);_0x217b0f['where']=qs['filters'](_[_0xce8b('0x39')](_0x5ca595[_0xce8b('0x2e')],_0x1509bf[_0xce8b('0x30')]),_0x18f164);if(_0x5ca595[_0xce8b('0x2e')][_0xce8b('0x3a')]){_0x217b0f[_0xce8b('0x3b')]=_[_0xce8b('0x3c')](_0x217b0f['where'],{'$or':_['map'](_0x18f164,function(_0x3f17fc){if(_0x3f17fc[_0xce8b('0x3d')]!==_0xce8b('0x3e')){var _0x318f5c={};_0x318f5c[_0x3f17fc[_0xce8b('0x26')]]={'$like':'%'+_0x5ca595[_0xce8b('0x2e')][_0xce8b('0x3a')]+'%'};return _0x318f5c;}})});}_0x217b0f=_[_0xce8b('0x3c')]({},_0x217b0f,_0x5ca595['options']);var _0x2d3236={'where':_0x217b0f[_0xce8b('0x3b')]};return db[_0xce8b('0x2a')][_0xce8b('0x3f')](_0x2d3236)[_0xce8b('0x22')](function(_0x4339ba){_0x2e811f[_0xce8b('0x3f')]=_0x4339ba;if(_0x5ca595[_0xce8b('0x2e')][_0xce8b('0x40')]){_0x217b0f[_0xce8b('0x41')]=[{'all':!![]}];}return db[_0xce8b('0x2a')][_0xce8b('0x42')](_0x217b0f);})[_0xce8b('0x22')](function(_0xb44a8a){_0x2e811f[_0xce8b('0x43')]=_0xb44a8a;return _0x2e811f;})[_0xce8b('0x22')](respondWithFilteredResult(_0x4b1d5f,_0x217b0f))[_0xce8b('0x44')](handleError(_0x4b1d5f,null));};exports[_0xce8b('0x45')]=function(_0x53fef7,_0x514a6e){var _0xa31b1e={'raw':!![],'where':{'id':_0x53fef7[_0xce8b('0x46')]['id']}},_0x2a7b20={};_0x2a7b20[_0xce8b('0x2d')]=_['keys'](db[_0xce8b('0x2a')][_0xce8b('0x47')]);_0x2a7b20[_0xce8b('0x2e')]=_[_0xce8b('0x2f')](_0x53fef7[_0xce8b('0x2e')]);_0x2a7b20[_0xce8b('0x30')]=_[_0xce8b('0x31')](_0x2a7b20[_0xce8b('0x2d')],_0x2a7b20[_0xce8b('0x2e')]);_0xa31b1e[_0xce8b('0x32')]=_['intersection'](_0x2a7b20['model'],qs[_0xce8b('0x33')](_0x53fef7[_0xce8b('0x2e')][_0xce8b('0x33')]));_0xa31b1e['attributes']=_0xa31b1e[_0xce8b('0x32')][_0xce8b('0x34')]?_0xa31b1e[_0xce8b('0x32')]:_0x2a7b20[_0xce8b('0x2d')];if(_0x53fef7[_0xce8b('0x2e')][_0xce8b('0x40')]){_0xa31b1e[_0xce8b('0x41')]=[{'all':!![]}];}_0xa31b1e=_[_0xce8b('0x3c')]({},_0xa31b1e,_0x53fef7['options']);return db[_0xce8b('0x2a')][_0xce8b('0x48')](_0xa31b1e)[_0xce8b('0x22')](handleEntityNotFound(_0x514a6e,null))[_0xce8b('0x22')](respondWithResult(_0x514a6e,null))[_0xce8b('0x44')](handleError(_0x514a6e,null));};exports['create']=function(_0x282708,_0x3675c7){return db[_0xce8b('0x2a')][_0xce8b('0x49')](_0x282708['body'],{})[_0xce8b('0x22')](respondWithResult(_0x3675c7,0xc9))['catch'](handleError(_0x3675c7,null));};exports['update']=function(_0x463609,_0x3391c9){if(_0x463609[_0xce8b('0x4a')]['id']){delete _0x463609['body']['id'];}return db[_0xce8b('0x2a')]['find']({'where':{'id':_0x463609[_0xce8b('0x46')]['id']}})[_0xce8b('0x22')](handleEntityNotFound(_0x3391c9,null))[_0xce8b('0x22')](saveUpdates(_0x463609['body'],null))[_0xce8b('0x22')](respondWithResult(_0x3391c9,null))[_0xce8b('0x44')](handleError(_0x3391c9,null));};exports['destroy']=function(_0xd29d01,_0x25326d){return db['SmsTransferReport'][_0xce8b('0x48')]({'where':{'id':_0xd29d01[_0xce8b('0x46')]['id']}})[_0xce8b('0x22')](handleEntityNotFound(_0x25326d,null))[_0xce8b('0x22')](removeEntity(_0x25326d,null))['catch'](handleError(_0x25326d,null));};exports['describe']=function(_0x1a3ccf,_0x419128){return db[_0xce8b('0x2a')][_0xce8b('0x4b')]()[_0xce8b('0x22')](respondWithResult(_0x419128,null))[_0xce8b('0x44')](handleError(_0x419128,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 7aace11..a96f0f6 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 _0xdee8=['rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','path'];(function(_0x19a562,_0x4b669f){var _0x3bd3f3=function(_0x482255){while(--_0x482255){_0x19a562['push'](_0x19a562['shift']());}};_0x3bd3f3(++_0x4b669f);}(_0xdee8,0x157));var _0x8dee=function(_0x55224f,_0x12c11c){_0x55224f=_0x55224f-0x0;var _0x23dfd3=_0xdee8[_0x55224f];return _0x23dfd3;};'use strict';var _=require(_0x8dee('0x0'));var util=require('util');var logger=require(_0x8dee('0x1'))('api');var moment=require(_0x8dee('0x2'));var BPromise=require(_0x8dee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dee('0x4'));var rimraf=require(_0x8dee('0x5'));var config=require(_0x8dee('0x6'));var attributes=require(_0x8dee('0x7'));module[_0x8dee('0x8')]=function(_0x2c766b,_0x36589f){return _0x2c766b['define'](_0x8dee('0x9'),attributes,{'tableName':_0x8dee('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8dee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33c5=['request-promise','path','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x33c5,0xe6));var _0x533c=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0x33c5[_0x1e6b59];return _0x40d7c5;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var logger=require(_0x533c('0x1'))('api');var moment=require(_0x533c('0x2'));var BPromise=require(_0x533c('0x3'));var rp=require(_0x533c('0x4'));var fs=require('fs');var path=require(_0x533c('0x5'));var rimraf=require(_0x533c('0x6'));var config=require('../../config/environment');var attributes=require(_0x533c('0x7'));module[_0x533c('0x8')]=function(_0x31d912,_0x151732){return _0x31d912[_0x533c('0x9')](_0x533c('0xa'),attributes,{'tableName':_0x533c('0xb'),'paranoid':![],'indexes':[{'name':_0x533c('0xc'),'fields':[_0x533c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 13e178d..69b3ddb 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 _0xdb94=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xdb94,0xe5));var _0x4db9=function(_0x16e3f6,_0x532bea){_0x16e3f6=_0x16e3f6-0x0;var _0x4c625d=_0xdb94[_0x16e3f6];return _0x4c625d;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var moment=require(_0x4db9('0x1'));var BPromise=require('bluebird');var rs=require(_0x4db9('0x2'));var fs=require('fs');var Redis=require(_0x4db9('0x3'));var db=require(_0x4db9('0x4'))['db'];var utils=require(_0x4db9('0x5'));var logger=require(_0x4db9('0x6'))('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4db9('0x8')][_0x4db9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dddb9,_0x3404f6,_0x42a857){return new BPromise(function(_0x57c701,_0x45d5a3){return client[_0x4db9('0xa')](_0x1dddb9,_0x42a857)[_0x4db9('0xb')](function(_0x3501f9){logger[_0x4db9('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x3404f6,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x3404f6,_0x4db9('0xd'),JSON[_0x4db9('0x10')](_0x3501f9));if(_0x3501f9[_0x4db9('0x11')]){if(_0x3501f9['error'][_0x4db9('0x12')]===0x1f4){logger[_0x4db9('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x3404f6,_0x3501f9['error'][_0x4db9('0x13')]);return _0x45d5a3(_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);}logger['error'](_0x4db9('0x14'),_0x3404f6,_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);return _0x57c701(_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);}else{logger['info'](_0x4db9('0x14'),_0x3404f6,_0x4db9('0xd'));_0x57c701(_0x3501f9['result'][_0x4db9('0x13')]);}})[_0x4db9('0x15')](function(_0x42fbb8){logger['error'](_0x4db9('0x14'),_0x3404f6,_0x42fbb8);_0x45d5a3(_0x42fbb8);});});} \ No newline at end of file +var _0x5243=['result','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5243,0x71));var _0x3524=function(_0xd413ab,_0x8595f7){_0xd413ab=_0xd413ab-0x0;var _0x22386c=_0x5243[_0xd413ab];return _0x22386c;};'use strict';var _=require(_0x3524('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3524('0x1'));var rs=require(_0x3524('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3524('0x3'));var logger=require(_0x3524('0x4'))('rpc');var config=require(_0x3524('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3524('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375729,_0x1217ec,_0x1e9bf9){return new BPromise(function(_0x371171,_0x28ba74){return client['request'](_0x375729,_0x1e9bf9)['then'](function(_0x291030){logger[_0x3524('0x7')](_0x3524('0x8'),_0x1217ec,_0x3524('0x9'));logger[_0x3524('0xa')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x1217ec,_0x3524('0x9'),JSON[_0x3524('0xb')](_0x291030));if(_0x291030['error']){if(_0x291030[_0x3524('0xc')][_0x3524('0xd')]===0x1f4){logger[_0x3524('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x1217ec,_0x291030['error']['message']);return _0x28ba74(_0x291030['error'][_0x3524('0xe')]);}logger[_0x3524('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x1217ec,_0x291030[_0x3524('0xc')][_0x3524('0xe')]);return _0x371171(_0x291030[_0x3524('0xc')][_0x3524('0xe')]);}else{logger[_0x3524('0x7')](_0x3524('0x8'),_0x1217ec,_0x3524('0x9'));_0x371171(_0x291030[_0x3524('0xf')][_0x3524('0xe')]);}})['catch'](function(_0x13e951){logger['error'](_0x3524('0x8'),_0x1217ec,_0x13e951);_0x28ba74(_0x13e951);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9cb80e3..2348fef 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 _0x4dd8=['extname','now','single','file','create','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','isAuthenticated','download','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4dd8,0xa4));var _0x84dd=function(_0x3cadb0,_0x2dc9e7){_0x3cadb0=_0x3cadb0-0x0;var _0x42f54c=_0x4dd8[_0x3cadb0];return _0x42f54c;};'use strict';var multer=require(_0x84dd('0x0'));var util=require(_0x84dd('0x1'));var path=require(_0x84dd('0x2'));var timeout=require(_0x84dd('0x3'));var express=require('express');var router=express[_0x84dd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x84dd('0x5'));var config=require(_0x84dd('0x6'));var controller=require(_0x84dd('0x7'));router[_0x84dd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84dd('0x8')](_0x84dd('0x9'),auth[_0x84dd('0xa')](),controller['show']);router[_0x84dd('0x8')]('/:id/download',auth[_0x84dd('0xa')](),controller[_0x84dd('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35dc0a,_0x5860f6,_0xef96eb){_0xef96eb(null,path['join'](config[_0x84dd('0xc')],_0x84dd('0xd')));},'filename':function(_0xfb6e70,_0x88a07a,_0x1d416d){_0x88a07a[_0x84dd('0xe')]=_0x88a07a['originalname'][_0x84dd('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d416d(null,util[_0x84dd('0x10')](_0x84dd('0x11'),path['basename'](_0x88a07a[_0x84dd('0xe')],path[_0x84dd('0x12')](_0x88a07a[_0x84dd('0xe')])),Date[_0x84dd('0x13')](),path['extname'](_0x88a07a['originalname'])));}})});router['post']('/',upload[_0x84dd('0x14')](_0x84dd('0x15')),controller[_0x84dd('0x16')]);router['put'](_0x84dd('0x9'),auth[_0x84dd('0xa')](),controller[_0x84dd('0x17')]);router[_0x84dd('0x18')]('/:id',auth[_0x84dd('0xa')](),controller[_0x84dd('0x18')]);module[_0x84dd('0x19')]=router; \ No newline at end of file +var _0xc4f4=['extname','post','file','create','put','update','delete','/:id','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','/:id/download','diskStorage','root','originalname','format','%s-%s%s','now'];(function(_0x1ea6eb,_0x1abf59){var _0x4654f1=function(_0x96dd60){while(--_0x96dd60){_0x1ea6eb['push'](_0x1ea6eb['shift']());}};_0x4654f1(++_0x1abf59);}(_0xc4f4,0x127));var _0x4c4f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc4f4[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x4c4f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c4f('0x1'));var router=express['Router']();var fs_extra=require(_0x4c4f('0x2'));var auth=require(_0x4c4f('0x3'));var interaction=require(_0x4c4f('0x4'));var config=require('../../config/environment');var controller=require(_0x4c4f('0x5'));router[_0x4c4f('0x6')]('/',auth[_0x4c4f('0x7')](),controller[_0x4c4f('0x8')]);router[_0x4c4f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4c4f('0x9')]);router[_0x4c4f('0x6')](_0x4c4f('0xa'),auth[_0x4c4f('0x7')](),controller['download']);var upload=multer({'storage':multer[_0x4c4f('0xb')]({'destination':function(_0x4f512e,_0x3c1a42,_0x86f423){_0x86f423(null,path['join'](config[_0x4c4f('0xc')],'server/files/sounds/original/'));},'filename':function(_0x5030b7,_0x217160,_0x93a162){_0x217160['originalname']=_0x217160[_0x4c4f('0xd')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x93a162(null,util[_0x4c4f('0xe')](_0x4c4f('0xf'),path['basename'](_0x217160[_0x4c4f('0xd')],path['extname'](_0x217160['originalname'])),Date[_0x4c4f('0x10')](),path[_0x4c4f('0x11')](_0x217160[_0x4c4f('0xd')])));}})});router[_0x4c4f('0x12')]('/',upload['single'](_0x4c4f('0x13')),controller[_0x4c4f('0x14')]);router[_0x4c4f('0x15')]('/:id',auth[_0x4c4f('0x7')](),controller[_0x4c4f('0x16')]);router[_0x4c4f('0x17')](_0x4c4f('0x18'),auth[_0x4c4f('0x7')](),controller['delete']);module[_0x4c4f('0x19')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 23d3e58..2d49735 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 _0xc649=['FLOAT','INTEGER','BIGINT','sequelize','exports','name','STRING'];(function(_0x30c1d6,_0x4de4ba){var _0x34433a=function(_0xb9761d){while(--_0xb9761d){_0x30c1d6['push'](_0x30c1d6['shift']());}};_0x34433a(++_0x4de4ba);}(_0xc649,0x1c3));var _0x9c64=function(_0x37dd86,_0x240720){_0x37dd86=_0x37dd86-0x0;var _0x392556=_0xc649[_0x37dd86];return _0x392556;};'use strict';var Sequelize=require(_0x9c64('0x0'));module[_0x9c64('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c64('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9c64('0x3')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x9c64('0x3')]},'original_format':{'type':Sequelize[_0x9c64('0x3')]},'original_duration':{'type':Sequelize[_0x9c64('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x9c64('0x5')]},'original_bitRate':{'type':Sequelize[_0x9c64('0x6')]},'original_sampleRate':{'type':Sequelize[_0x9c64('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x9c64('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x9c64('0x6')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x9c64('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6a49=['name','FLOAT','BIGINT','INTEGER','exports','STRING'];(function(_0x2953d5,_0x118e47){var _0x1da6eb=function(_0x33c2e8){while(--_0x33c2e8){_0x2953d5['push'](_0x2953d5['shift']());}};_0x1da6eb(++_0x118e47);}(_0x6a49,0x7c));var _0x96a4=function(_0x3cb0a9,_0x172b0a){_0x3cb0a9=_0x3cb0a9-0x0;var _0x5e45fc=_0x6a49[_0x3cb0a9];return _0x5e45fc;};'use strict';var Sequelize=require('sequelize');module[_0x96a4('0x0')]={'name':{'type':Sequelize[_0x96a4('0x1')],'unique':_0x96a4('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x96a4('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x96a4('0x1')]},'original_format':{'type':Sequelize[_0x96a4('0x1')]},'original_duration':{'type':Sequelize[_0x96a4('0x3')]},'original_sampleCount':{'type':Sequelize[_0x96a4('0x4')]},'original_channelCount':{'type':Sequelize[_0x96a4('0x5')]},'original_bitRate':{'type':Sequelize[_0x96a4('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x96a4('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x96a4('0x4')]},'converted_channelCount':{'type':Sequelize[_0x96a4('0x5')]},'converted_bitRate':{'type':Sequelize[_0x96a4('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x96a4('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index d2b6ce1..cd7ef92 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 _0x6b70=['lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','Sound','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','catch','find','save_name','converted_format','root','Sequelize','ValidationError','download','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','server/files/sounds/converted','info','Sound\x20upload\x20filepath:\x20%s','transcode','unlinkSync','send','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Sounds','autoAssociation','UserProfileResource','start','update','delete','original_format','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra'];(function(_0x4b4865,_0xb43449){var _0x190dc2=function(_0x2b41f7){while(--_0x2b41f7){_0x4b4865['push'](_0x4b4865['shift']());}};_0x190dc2(++_0xb43449);}(_0x6b70,0xec));var _0x06b7=function(_0x1840b1,_0x2d021e){_0x1840b1=_0x1840b1-0x0;var _0x54ee73=_0x6b70[_0x1840b1];return _0x54ee73;};'use strict';var emlformat=require(_0x06b7('0x0'));var rimraf=require(_0x06b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b7('0x2'));var rp=require('request-promise');var moment=require(_0x06b7('0x3'));var BPromise=require(_0x06b7('0x4'));var Mustache=require(_0x06b7('0x5'));var util=require(_0x06b7('0x6'));var path=require('path');var sox=require(_0x06b7('0x7'));var csv=require('to-csv');var ejs=require(_0x06b7('0x8'));var fs=require('fs');var fs_extra=require(_0x06b7('0x9'));var _=require(_0x06b7('0xa'));var squel=require(_0x06b7('0xb'));var crypto=require(_0x06b7('0xc'));var jsforce=require(_0x06b7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x06b7('0xe'));var querystring=require(_0x06b7('0xf'));var Papa=require(_0x06b7('0x10'));var Redis=require('ioredis');var authService=require(_0x06b7('0x11'));var qs=require(_0x06b7('0x12'));var as=require(_0x06b7('0x13'));var hardwareService=require(_0x06b7('0x14'));var logger=require(_0x06b7('0x15'))(_0x06b7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x06b7('0x17'));var db=require(_0x06b7('0x18'))['db'];function respondWithStatusCode(_0x3a77ab,_0x3bd2ea){_0x3bd2ea=_0x3bd2ea||0xcc;return function(_0x1d8232){if(_0x1d8232){return _0x3a77ab[_0x06b7('0x19')](_0x3bd2ea);}return _0x3a77ab['status'](_0x3bd2ea)[_0x06b7('0x1a')]();};}function respondWithResult(_0x3320a4,_0x6c404a){_0x6c404a=_0x6c404a||0xc8;return function(_0x2a9725){if(_0x2a9725){return _0x3320a4[_0x06b7('0x1b')](_0x6c404a)[_0x06b7('0x1c')](_0x2a9725);}};}function respondWithFilteredResult(_0x459181,_0x47fa2f){return function(_0x587b1d){if(_0x587b1d){var _0x3f169e=typeof _0x47fa2f[_0x06b7('0x1d')]===_0x06b7('0x1e')&&typeof _0x47fa2f[_0x06b7('0x1f')]===_0x06b7('0x1e');var _0x148700=_0x587b1d[_0x06b7('0x20')];var _0x4c9380=_0x3f169e?0x0:_0x47fa2f[_0x06b7('0x1d')];var _0x3cd808=_0x3f169e?_0x587b1d['count']:_0x47fa2f[_0x06b7('0x1d')]+_0x47fa2f[_0x06b7('0x1f')];var _0x111cef;if(_0x3cd808>=_0x148700){_0x3cd808=_0x148700;_0x111cef=0xc8;}else{_0x111cef=0xce;}_0x459181[_0x06b7('0x1b')](_0x111cef);return _0x459181[_0x06b7('0x21')](_0x06b7('0x22'),_0x4c9380+'-'+_0x3cd808+'/'+_0x148700)[_0x06b7('0x1c')](_0x587b1d);}return null;};}function patchUpdates(_0x372f64){return function(_0x2222a0){try{jsonpatch[_0x06b7('0x23')](_0x2222a0,_0x372f64,!![]);}catch(_0xc82ddc){return BPromise[_0x06b7('0x24')](_0xc82ddc);}return _0x2222a0[_0x06b7('0x25')]();};}function saveUpdates(_0x4c4c9c,_0x29b0cd){return function(_0x237afe){if(_0x237afe){return _0x237afe['update'](_0x4c4c9c)[_0x06b7('0x26')](function(_0x53d598){return _0x53d598;});}return null;};}function removeEntity(_0x5ef444,_0x8785f3){return function(_0x329b7d){if(_0x329b7d){return _0x329b7d[_0x06b7('0x27')]()[_0x06b7('0x26')](function(){var _0x3f614e=_0x329b7d['get']({'plain':!![]});var _0x1bbe1d='Sounds';return db['UserProfileResource'][_0x06b7('0x27')]({'where':{'type':_0x1bbe1d,'resourceId':_0x3f614e['id']}})[_0x06b7('0x26')](function(){return _0x329b7d;});})['then'](function(){_0x5ef444[_0x06b7('0x1b')](0xcc)[_0x06b7('0x1a')]();});}};}function handleEntityNotFound(_0x385f5b,_0x3f1fa2){return function(_0x303f31){if(!_0x303f31){_0x385f5b[_0x06b7('0x19')](0x194);}return _0x303f31;};}function handleError(_0x639b14,_0x3becc4){_0x3becc4=_0x3becc4||0x1f4;return function(_0x2c869d){logger[_0x06b7('0x28')](_0x2c869d[_0x06b7('0x29')]);if(_0x2c869d[_0x06b7('0x2a')]){delete _0x2c869d[_0x06b7('0x2a')];}_0x639b14[_0x06b7('0x1b')](_0x3becc4)['send'](_0x2c869d);};}exports[_0x06b7('0x2b')]=function(_0xc3649e,_0x21728f){var _0x2693c0={},_0x232f83={},_0x253266={'count':0x0,'rows':[]};var _0x20568e=_['map'](db[_0x06b7('0x2c')]['rawAttributes'],function(_0x22c761){return{'name':_0x22c761[_0x06b7('0x2d')],'type':_0x22c761[_0x06b7('0x2e')][_0x06b7('0x2f')]};});_0x232f83[_0x06b7('0x30')]=_[_0x06b7('0x31')](_0x20568e,_0x06b7('0x2a'));_0x232f83[_0x06b7('0x32')]=_[_0x06b7('0x33')](_0xc3649e[_0x06b7('0x32')]);_0x232f83[_0x06b7('0x34')]=_['intersection'](_0x232f83['model'],_0x232f83[_0x06b7('0x32')]);_0x2693c0[_0x06b7('0x35')]=_['intersection'](_0x232f83[_0x06b7('0x30')],qs[_0x06b7('0x36')](_0xc3649e[_0x06b7('0x32')][_0x06b7('0x36')]));_0x2693c0[_0x06b7('0x35')]=_0x2693c0[_0x06b7('0x35')][_0x06b7('0x37')]?_0x2693c0[_0x06b7('0x35')]:_0x232f83[_0x06b7('0x30')];if(!_0xc3649e['query']['hasOwnProperty']('nolimit')){_0x2693c0['limit']=qs[_0x06b7('0x1f')](_0xc3649e[_0x06b7('0x32')][_0x06b7('0x1f')]);_0x2693c0[_0x06b7('0x1d')]=qs[_0x06b7('0x1d')](_0xc3649e['query'][_0x06b7('0x1d')]);}_0x2693c0[_0x06b7('0x38')]=qs[_0x06b7('0x39')](_0xc3649e[_0x06b7('0x32')][_0x06b7('0x39')]);_0x2693c0[_0x06b7('0x3a')]=qs[_0x06b7('0x34')](_[_0x06b7('0x3b')](_0xc3649e[_0x06b7('0x32')],_0x232f83[_0x06b7('0x34')]),_0x20568e);if(_0xc3649e['query'][_0x06b7('0x3c')]){_0x2693c0['where']=_['merge'](_0x2693c0[_0x06b7('0x3a')],{'$or':_[_0x06b7('0x31')](_0x20568e,function(_0x3e57f5){if(_0x3e57f5['type']!==_0x06b7('0x3d')){var _0x1322f4={};_0x1322f4[_0x3e57f5[_0x06b7('0x2a')]]={'$like':'%'+_0xc3649e[_0x06b7('0x32')][_0x06b7('0x3c')]+'%'};return _0x1322f4;}})});}_0x2693c0=_[_0x06b7('0x3e')]({},_0x2693c0,_0xc3649e[_0x06b7('0x3f')]);var _0x41062e={'where':_0x2693c0[_0x06b7('0x3a')]};return db[_0x06b7('0x2c')][_0x06b7('0x20')](_0x41062e)[_0x06b7('0x26')](function(_0x66c2da){_0x253266[_0x06b7('0x20')]=_0x66c2da;if(_0xc3649e['query'][_0x06b7('0x40')]){_0x2693c0[_0x06b7('0x41')]=[{'all':!![]}];}return db['Sound'][_0x06b7('0x42')](_0x2693c0);})[_0x06b7('0x26')](function(_0x4d6751){_0x253266[_0x06b7('0x43')]=_0x4d6751;return _0x253266;})['then'](respondWithFilteredResult(_0x21728f,_0x2693c0))['catch'](handleError(_0x21728f,null));};exports[_0x06b7('0x44')]=function(_0x5b9a56,_0x3732e8){var _0x391b1f={'raw':!![],'where':{'id':_0x5b9a56[_0x06b7('0x45')]['id']}},_0x455c61={};_0x455c61[_0x06b7('0x30')]=_[_0x06b7('0x33')](db[_0x06b7('0x2c')][_0x06b7('0x46')]);_0x455c61[_0x06b7('0x32')]=_['keys'](_0x5b9a56['query']);_0x455c61[_0x06b7('0x34')]=_['intersection'](_0x455c61[_0x06b7('0x30')],_0x455c61[_0x06b7('0x32')]);_0x391b1f[_0x06b7('0x35')]=_[_0x06b7('0x47')](_0x455c61[_0x06b7('0x30')],qs[_0x06b7('0x36')](_0x5b9a56[_0x06b7('0x32')][_0x06b7('0x36')]));_0x391b1f[_0x06b7('0x35')]=_0x391b1f[_0x06b7('0x35')]['length']?_0x391b1f[_0x06b7('0x35')]:_0x455c61['model'];if(_0x5b9a56[_0x06b7('0x32')][_0x06b7('0x40')]){_0x391b1f['include']=[{'all':!![]}];}_0x391b1f=_['merge']({},_0x391b1f,_0x5b9a56[_0x06b7('0x3f')]);return db[_0x06b7('0x2c')]['find'](_0x391b1f)[_0x06b7('0x26')](handleEntityNotFound(_0x3732e8,null))[_0x06b7('0x26')](respondWithResult(_0x3732e8,null))[_0x06b7('0x48')](handleError(_0x3732e8,null));};exports['download']=function(_0x12421e,_0x58d24c,_0x3a07bb){return db[_0x06b7('0x2c')][_0x06b7('0x49')]({'where':{'id':_0x12421e[_0x06b7('0x45')]['id']},'attributes':[_0x06b7('0x2a'),_0x06b7('0x4a'),_0x06b7('0x4b')],'raw':!![]})[_0x06b7('0x26')](handleEntityNotFound(_0x58d24c,null))[_0x06b7('0x26')](function(_0x27f8eb){if(_0x27f8eb){if(!fs['existsSync'](path['join'](config[_0x06b7('0x4c')],'server/files/sounds/converted',_0x27f8eb[_0x06b7('0x4a')]+'.'+_0x27f8eb[_0x06b7('0x4b')]))){throw new db[(_0x06b7('0x4d'))][(_0x06b7('0x4e'))]('Sound\x20not\x20found');}return _0x58d24c[_0x06b7('0x4f')](path[_0x06b7('0x50')](config[_0x06b7('0x4c')],'server/files/sounds/converted',util[_0x06b7('0x51')](_0x06b7('0x52'),_0x27f8eb[_0x06b7('0x4a')],_0x27f8eb[_0x06b7('0x4b')])),util['format'](_0x06b7('0x52'),_0x27f8eb[_0x06b7('0x2a')],_0x27f8eb[_0x06b7('0x4b')]));}return null;})[_0x06b7('0x48')](handleError(_0x58d24c,null));};exports[_0x06b7('0x53')]=function(_0x518b08,_0x34e0b4,_0x1a8f20){var _0x157cbb={'name':path[_0x06b7('0x54')](_0x518b08[_0x06b7('0x55')][_0x06b7('0x56')],path['extname'](_0x518b08[_0x06b7('0x55')][_0x06b7('0x56')])),'save_name':path[_0x06b7('0x54')](_0x518b08[_0x06b7('0x55')]['filename'],path[_0x06b7('0x57')](_0x518b08[_0x06b7('0x55')][_0x06b7('0x58')])),'original_format':path[_0x06b7('0x57')](_0x518b08[_0x06b7('0x55')][_0x06b7('0x56')])[_0x06b7('0x59')](0x1),'converted_format':'wav'};var _0x22b68c=path[_0x06b7('0x50')](config[_0x06b7('0x4c')],_0x06b7('0x5a'),_0x518b08[_0x06b7('0x55')]['filename']);var _0x1f3033=path[_0x06b7('0x50')](config[_0x06b7('0x4c')],_0x06b7('0x5b'),util[_0x06b7('0x51')]('%s.%s',path[_0x06b7('0x54')](_0x518b08[_0x06b7('0x55')][_0x06b7('0x58')],path[_0x06b7('0x57')](_0x518b08['file'][_0x06b7('0x58')])),_0x157cbb[_0x06b7('0x4b')]));logger[_0x06b7('0x5c')](_0x06b7('0x5d'),_0x22b68c);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x1f3033);try{fs['chmodSync'](_0x22b68c,parseInt('0777',0x8));var _0x3caa5f=sox[_0x06b7('0x5e')](_0x22b68c,_0x1f3033,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3caa5f['on'](_0x06b7('0x28'),function(_0x4484c9){fs[_0x06b7('0x5f')](_0x22b68c);_0x34e0b4[_0x06b7('0x1b')](0x1f4)[_0x06b7('0x60')](_0x4484c9);});_0x3caa5f['on'](_0x06b7('0x61'),function(_0x770ba4){_0x157cbb['original_duration']=isNaN(_0x770ba4[_0x06b7('0x62')])?null:_0x770ba4['duration']*0x3e8;_0x157cbb['original_sampleCount']=isNaN(_0x770ba4[_0x06b7('0x63')])?null:_0x770ba4[_0x06b7('0x63')];_0x157cbb[_0x06b7('0x64')]=isNaN(_0x770ba4['channelCount'])?null:_0x770ba4[_0x06b7('0x65')];_0x157cbb[_0x06b7('0x66')]=isNaN(_0x770ba4[_0x06b7('0x67')])?null:_0x770ba4[_0x06b7('0x67')];_0x157cbb[_0x06b7('0x68')]=isNaN(_0x770ba4[_0x06b7('0x69')])?null:_0x770ba4['sampleRate'];});_0x3caa5f['on'](_0x06b7('0x6a'),function(_0x362066){_0x157cbb[_0x06b7('0x6b')]=isNaN(_0x362066['duration'])?null:_0x362066[_0x06b7('0x62')]*0x3e8;_0x157cbb[_0x06b7('0x6c')]=isNaN(_0x362066[_0x06b7('0x63')])?null:_0x362066['sampleCount'];_0x157cbb[_0x06b7('0x6d')]=isNaN(_0x362066[_0x06b7('0x65')])?null:_0x362066[_0x06b7('0x65')];_0x157cbb[_0x06b7('0x6e')]=isNaN(_0x362066[_0x06b7('0x67')])?null:_0x362066[_0x06b7('0x67')];_0x157cbb['converted_sampleRate']=isNaN(_0x362066[_0x06b7('0x69')])?null:_0x362066['sampleRate'];});_0x3caa5f['on']('end',function(){fs[_0x06b7('0x6f')](_0x1f3033,parseInt('0777',0x8));return db['Sound'][_0x06b7('0x53')](_0x157cbb)['then'](function(_0x1ecce4){var _0x4fa557={'role':_0x518b08[_0x06b7('0x70')]['role'],'userProfileId':_0x518b08[_0x06b7('0x70')][_0x06b7('0x71')]};if(!_0x4fa557)throw new Error(_0x06b7('0x72'));if(_0x4fa557['role']==='user'){var _0x392634=_0x1ecce4['get']({'plain':!![]});return db[_0x06b7('0x73')]['find']({'where':{'name':_0x06b7('0x74'),'userProfileId':_0x4fa557['userProfileId']},'raw':!![]})['then'](function(_0x59f166){if(_0x59f166&&_0x59f166[_0x06b7('0x75')]===0x0){return db[_0x06b7('0x76')][_0x06b7('0x53')]({'name':_0x392634['name'],'resourceId':_0x392634['id'],'type':_0x59f166[_0x06b7('0x2a')],'sectionId':_0x59f166['id']},{})[_0x06b7('0x26')](function(){return _0x1ecce4;});}else{return _0x1ecce4;}})[_0x06b7('0x48')](function(_0x3bb47f){logger[_0x06b7('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bb47f);throw _0x3bb47f;});}return _0x1ecce4;})[_0x06b7('0x26')](respondWithResult(_0x34e0b4,null))[_0x06b7('0x48')](handleError(_0x34e0b4,null));});_0x3caa5f[_0x06b7('0x77')]();}catch(_0x85efdd){_0x34e0b4[_0x06b7('0x1b')](0x1f4)[_0x06b7('0x60')](_0x85efdd);}};exports[_0x06b7('0x78')]=function(_0x82ba62,_0x45bfdc,_0xb094f1){return db[_0x06b7('0x2c')][_0x06b7('0x49')]({'where':{'id':_0x82ba62[_0x06b7('0x45')]['id']}})[_0x06b7('0x26')](handleEntityNotFound(_0x45bfdc,null))['then'](saveUpdates(_[_0x06b7('0x3b')](_0x82ba62[_0x06b7('0x70')],['name','description']),null))['then'](respondWithResult(_0x45bfdc,null))['catch'](handleError(_0x45bfdc,null));};exports[_0x06b7('0x79')]=function(_0x35af59,_0x1272c2,_0x428454){return db[_0x06b7('0x2c')][_0x06b7('0x49')]({'where':{'id':_0x35af59[_0x06b7('0x45')]['id']}})[_0x06b7('0x26')](function(_0x13cdc1){if(_0x13cdc1){return _0x13cdc1[_0x06b7('0x27')]();}})['then'](function(_0x492c09){var _0x12312f=path[_0x06b7('0x50')](config[_0x06b7('0x4c')],_0x06b7('0x5a'),util[_0x06b7('0x51')](_0x06b7('0x52'),_0x492c09['save_name'],_0x492c09[_0x06b7('0x7a')]));var _0xf29d47=path[_0x06b7('0x50')](config[_0x06b7('0x4c')],_0x06b7('0x5b'),util[_0x06b7('0x51')](_0x06b7('0x52'),_0x492c09['save_name'],_0x492c09[_0x06b7('0x4b')]));fs[_0x06b7('0x5f')](_0x12312f);fs[_0x06b7('0x5f')](_0xf29d47);return _0x492c09;})['then'](function(_0x4c0b6c){if(_0x4c0b6c){return _0x1272c2['status'](0xcc)[_0x06b7('0x1a')]();}})['then'](handleEntityNotFound(_0x1272c2,null))[_0x06b7('0x48')](handleError(_0x1272c2,null));}; \ No newline at end of file +var _0xd9fa=['keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','download','find','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','save_name','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','transcode','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','original_sampleRate','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','bitRate','converted_sampleRate','sampleRate','chmodSync','0777','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','original_format','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key'];(function(_0x2d598a,_0x1277fa){var _0x42d7f1=function(_0x82c665){while(--_0x82c665){_0x2d598a['push'](_0x2d598a['shift']());}};_0x42d7f1(++_0x1277fa);}(_0xd9fa,0xcd));var _0xad9f=function(_0x2df347,_0x2e8ebc){_0x2df347=_0x2df347-0x0;var _0x25e8d0=_0xd9fa[_0x2df347];return _0x25e8d0;};'use strict';var emlformat=require(_0xad9f('0x0'));var rimraf=require(_0xad9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xad9f('0x2'));var moment=require(_0xad9f('0x3'));var BPromise=require(_0xad9f('0x4'));var Mustache=require('mustache');var util=require(_0xad9f('0x5'));var path=require(_0xad9f('0x6'));var sox=require(_0xad9f('0x7'));var csv=require(_0xad9f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad9f('0x9'));var _=require('lodash');var squel=require(_0xad9f('0xa'));var crypto=require(_0xad9f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xad9f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xad9f('0xd'));var Papa=require(_0xad9f('0xe'));var Redis=require(_0xad9f('0xf'));var authService=require(_0xad9f('0x10'));var qs=require(_0xad9f('0x11'));var as=require(_0xad9f('0x12'));var hardwareService=require(_0xad9f('0x13'));var logger=require(_0xad9f('0x14'))(_0xad9f('0x15'));var utils=require(_0xad9f('0x16'));var config=require(_0xad9f('0x17'));var licenseUtil=require(_0xad9f('0x18'));var db=require(_0xad9f('0x19'))['db'];function respondWithStatusCode(_0x1cc176,_0x3e62d8){_0x3e62d8=_0x3e62d8||0xcc;return function(_0xbf8ba8){if(_0xbf8ba8){return _0x1cc176[_0xad9f('0x1a')](_0x3e62d8);}return _0x1cc176['status'](_0x3e62d8)[_0xad9f('0x1b')]();};}function respondWithResult(_0xff4e00,_0x3b9ca5){_0x3b9ca5=_0x3b9ca5||0xc8;return function(_0xf013e2){if(_0xf013e2){return _0xff4e00[_0xad9f('0x1c')](_0x3b9ca5)[_0xad9f('0x1d')](_0xf013e2);}};}function respondWithFilteredResult(_0x4dc0bf,_0x548a79){return function(_0x243429){if(_0x243429){var _0x36a26f=typeof _0x548a79[_0xad9f('0x1e')]===_0xad9f('0x1f')&&typeof _0x548a79[_0xad9f('0x20')]===_0xad9f('0x1f');var _0x2f16a9=_0x243429[_0xad9f('0x21')];var _0x2521ae=_0x36a26f?0x0:_0x548a79[_0xad9f('0x1e')];var _0x30601d=_0x36a26f?_0x243429[_0xad9f('0x21')]:_0x548a79[_0xad9f('0x1e')]+_0x548a79[_0xad9f('0x20')];var _0x50d6d7;if(_0x30601d>=_0x2f16a9){_0x30601d=_0x2f16a9;_0x50d6d7=0xc8;}else{_0x50d6d7=0xce;}_0x4dc0bf[_0xad9f('0x1c')](_0x50d6d7);return _0x4dc0bf['set']('Content-Range',_0x2521ae+'-'+_0x30601d+'/'+_0x2f16a9)['json'](_0x243429);}return null;};}function patchUpdates(_0x24bcc8){return function(_0x339dae){try{jsonpatch['apply'](_0x339dae,_0x24bcc8,!![]);}catch(_0x56677e){return BPromise[_0xad9f('0x22')](_0x56677e);}return _0x339dae[_0xad9f('0x23')]();};}function saveUpdates(_0x38a504,_0x20bbba){return function(_0x2104a6){if(_0x2104a6){return _0x2104a6[_0xad9f('0x24')](_0x38a504)[_0xad9f('0x25')](function(_0x3e80ba){return _0x3e80ba;});}return null;};}function removeEntity(_0x14b9b7,_0x44475d){return function(_0x42cbf7){if(_0x42cbf7){return _0x42cbf7[_0xad9f('0x26')]()[_0xad9f('0x25')](function(){var _0x171cc3=_0x42cbf7[_0xad9f('0x27')]({'plain':!![]});var _0x14d5a8=_0xad9f('0x28');return db[_0xad9f('0x29')]['destroy']({'where':{'type':_0x14d5a8,'resourceId':_0x171cc3['id']}})[_0xad9f('0x25')](function(){return _0x42cbf7;});})['then'](function(){_0x14b9b7['status'](0xcc)[_0xad9f('0x1b')]();});}};}function handleEntityNotFound(_0xa55573,_0x5be9cb){return function(_0x345a64){if(!_0x345a64){_0xa55573[_0xad9f('0x1a')](0x194);}return _0x345a64;};}function handleError(_0x462a5b,_0x28f710){_0x28f710=_0x28f710||0x1f4;return function(_0x3110bb){logger[_0xad9f('0x2a')](_0x3110bb[_0xad9f('0x2b')]);if(_0x3110bb[_0xad9f('0x2c')]){delete _0x3110bb[_0xad9f('0x2c')];}_0x462a5b[_0xad9f('0x1c')](_0x28f710)[_0xad9f('0x2d')](_0x3110bb);};}exports[_0xad9f('0x2e')]=function(_0x86fca8,_0x6e5d9a){var _0x557415={},_0x21d8e5={},_0x4e1822={'count':0x0,'rows':[]};var _0x21b2a1=_[_0xad9f('0x2f')](db[_0xad9f('0x30')][_0xad9f('0x31')],function(_0x4fe84c){return{'name':_0x4fe84c[_0xad9f('0x32')],'type':_0x4fe84c[_0xad9f('0x33')][_0xad9f('0x34')]};});_0x21d8e5['model']=_[_0xad9f('0x2f')](_0x21b2a1,'name');_0x21d8e5['query']=_[_0xad9f('0x35')](_0x86fca8[_0xad9f('0x36')]);_0x21d8e5['filters']=_[_0xad9f('0x37')](_0x21d8e5[_0xad9f('0x38')],_0x21d8e5[_0xad9f('0x36')]);_0x557415['attributes']=_[_0xad9f('0x37')](_0x21d8e5[_0xad9f('0x38')],qs['fields'](_0x86fca8[_0xad9f('0x36')][_0xad9f('0x39')]));_0x557415[_0xad9f('0x3a')]=_0x557415[_0xad9f('0x3a')][_0xad9f('0x3b')]?_0x557415[_0xad9f('0x3a')]:_0x21d8e5[_0xad9f('0x38')];if(!_0x86fca8[_0xad9f('0x36')][_0xad9f('0x3c')](_0xad9f('0x3d'))){_0x557415[_0xad9f('0x20')]=qs[_0xad9f('0x20')](_0x86fca8[_0xad9f('0x36')][_0xad9f('0x20')]);_0x557415[_0xad9f('0x1e')]=qs[_0xad9f('0x1e')](_0x86fca8[_0xad9f('0x36')]['offset']);}_0x557415[_0xad9f('0x3e')]=qs['sort'](_0x86fca8['query'][_0xad9f('0x3f')]);_0x557415[_0xad9f('0x40')]=qs['filters'](_[_0xad9f('0x41')](_0x86fca8[_0xad9f('0x36')],_0x21d8e5[_0xad9f('0x42')]),_0x21b2a1);if(_0x86fca8[_0xad9f('0x36')][_0xad9f('0x43')]){_0x557415[_0xad9f('0x40')]=_[_0xad9f('0x44')](_0x557415[_0xad9f('0x40')],{'$or':_[_0xad9f('0x2f')](_0x21b2a1,function(_0x1da3d1){if(_0x1da3d1[_0xad9f('0x33')]!==_0xad9f('0x45')){var _0x197ffb={};_0x197ffb[_0x1da3d1[_0xad9f('0x2c')]]={'$like':'%'+_0x86fca8['query']['filter']+'%'};return _0x197ffb;}})});}_0x557415=_[_0xad9f('0x44')]({},_0x557415,_0x86fca8['options']);var _0xf235b7={'where':_0x557415[_0xad9f('0x40')]};return db[_0xad9f('0x30')][_0xad9f('0x21')](_0xf235b7)[_0xad9f('0x25')](function(_0x3f530e){_0x4e1822[_0xad9f('0x21')]=_0x3f530e;if(_0x86fca8['query'][_0xad9f('0x46')]){_0x557415[_0xad9f('0x47')]=[{'all':!![]}];}return db[_0xad9f('0x30')][_0xad9f('0x48')](_0x557415);})[_0xad9f('0x25')](function(_0x4a1634){_0x4e1822[_0xad9f('0x49')]=_0x4a1634;return _0x4e1822;})['then'](respondWithFilteredResult(_0x6e5d9a,_0x557415))[_0xad9f('0x4a')](handleError(_0x6e5d9a,null));};exports[_0xad9f('0x4b')]=function(_0x13cff8,_0x2336b8){var _0x21fff2={'raw':!![],'where':{'id':_0x13cff8[_0xad9f('0x4c')]['id']}},_0x21f7ee={};_0x21f7ee['model']=_[_0xad9f('0x35')](db['Sound'][_0xad9f('0x31')]);_0x21f7ee[_0xad9f('0x36')]=_[_0xad9f('0x35')](_0x13cff8['query']);_0x21f7ee[_0xad9f('0x42')]=_['intersection'](_0x21f7ee['model'],_0x21f7ee['query']);_0x21fff2[_0xad9f('0x3a')]=_[_0xad9f('0x37')](_0x21f7ee['model'],qs['fields'](_0x13cff8[_0xad9f('0x36')][_0xad9f('0x39')]));_0x21fff2[_0xad9f('0x3a')]=_0x21fff2['attributes'][_0xad9f('0x3b')]?_0x21fff2['attributes']:_0x21f7ee[_0xad9f('0x38')];if(_0x13cff8['query'][_0xad9f('0x46')]){_0x21fff2[_0xad9f('0x47')]=[{'all':!![]}];}_0x21fff2=_[_0xad9f('0x44')]({},_0x21fff2,_0x13cff8[_0xad9f('0x4d')]);return db[_0xad9f('0x30')]['find'](_0x21fff2)['then'](handleEntityNotFound(_0x2336b8,null))[_0xad9f('0x25')](respondWithResult(_0x2336b8,null))[_0xad9f('0x4a')](handleError(_0x2336b8,null));};exports[_0xad9f('0x4e')]=function(_0x1289da,_0x1ad793,_0x4ce0ba){return db['Sound'][_0xad9f('0x4f')]({'where':{'id':_0x1289da[_0xad9f('0x4c')]['id']},'attributes':['name','save_name',_0xad9f('0x50')],'raw':!![]})[_0xad9f('0x25')](handleEntityNotFound(_0x1ad793,null))[_0xad9f('0x25')](function(_0x6f5eba){if(_0x6f5eba){if(!fs[_0xad9f('0x51')](path[_0xad9f('0x52')](config[_0xad9f('0x53')],_0xad9f('0x54'),_0x6f5eba['save_name']+'.'+_0x6f5eba[_0xad9f('0x50')]))){throw new db['Sequelize'][(_0xad9f('0x55'))](_0xad9f('0x56'));}return _0x1ad793[_0xad9f('0x4e')](path[_0xad9f('0x52')](config[_0xad9f('0x53')],_0xad9f('0x54'),util[_0xad9f('0x57')]('%s.%s',_0x6f5eba[_0xad9f('0x58')],_0x6f5eba['converted_format'])),util[_0xad9f('0x57')](_0xad9f('0x59'),_0x6f5eba[_0xad9f('0x2c')],_0x6f5eba[_0xad9f('0x50')]));}return null;})[_0xad9f('0x4a')](handleError(_0x1ad793,null));};exports[_0xad9f('0x5a')]=function(_0x9eee6f,_0x96a77e,_0x3e55c9){var _0x3b0f96={'name':path[_0xad9f('0x5b')](_0x9eee6f[_0xad9f('0x5c')][_0xad9f('0x5d')],path['extname'](_0x9eee6f[_0xad9f('0x5c')][_0xad9f('0x5d')])),'save_name':path[_0xad9f('0x5b')](_0x9eee6f[_0xad9f('0x5c')][_0xad9f('0x5e')],path['extname'](_0x9eee6f['file'][_0xad9f('0x5e')])),'original_format':path[_0xad9f('0x5f')](_0x9eee6f[_0xad9f('0x5c')]['originalname'])[_0xad9f('0x60')](0x1),'converted_format':_0xad9f('0x61')};var _0x3a1f91=path[_0xad9f('0x52')](config[_0xad9f('0x53')],_0xad9f('0x62'),_0x9eee6f[_0xad9f('0x5c')][_0xad9f('0x5e')]);var _0x126937=path[_0xad9f('0x52')](config['root'],_0xad9f('0x54'),util[_0xad9f('0x57')](_0xad9f('0x59'),path[_0xad9f('0x5b')](_0x9eee6f['file']['filename'],path[_0xad9f('0x5f')](_0x9eee6f[_0xad9f('0x5c')]['filename'])),_0x3b0f96[_0xad9f('0x50')]));logger['info'](_0xad9f('0x63'),_0x3a1f91);logger[_0xad9f('0x64')](_0xad9f('0x65'),_0x126937);try{fs['chmodSync'](_0x3a1f91,parseInt('0777',0x8));var _0x361383=sox[_0xad9f('0x66')](_0x3a1f91,_0x126937,{'sampleRate':0x1f40,'format':_0xad9f('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x361383['on'](_0xad9f('0x2a'),function(_0x14c246){fs['unlinkSync'](_0x3a1f91);_0x96a77e[_0xad9f('0x1c')](0x1f4)[_0xad9f('0x2d')](_0x14c246);});_0x361383['on']('src',function(_0xca1af8){_0x3b0f96[_0xad9f('0x67')]=isNaN(_0xca1af8['duration'])?null:_0xca1af8[_0xad9f('0x68')]*0x3e8;_0x3b0f96[_0xad9f('0x69')]=isNaN(_0xca1af8[_0xad9f('0x6a')])?null:_0xca1af8['sampleCount'];_0x3b0f96[_0xad9f('0x6b')]=isNaN(_0xca1af8['channelCount'])?null:_0xca1af8['channelCount'];_0x3b0f96[_0xad9f('0x6c')]=isNaN(_0xca1af8['bitRate'])?null:_0xca1af8['bitRate'];_0x3b0f96[_0xad9f('0x6d')]=isNaN(_0xca1af8['sampleRate'])?null:_0xca1af8['sampleRate'];});_0x361383['on']('dest',function(_0x1c59c1){_0x3b0f96['converted_duration']=isNaN(_0x1c59c1['duration'])?null:_0x1c59c1['duration']*0x3e8;_0x3b0f96[_0xad9f('0x6e')]=isNaN(_0x1c59c1['sampleCount'])?null:_0x1c59c1[_0xad9f('0x6a')];_0x3b0f96[_0xad9f('0x6f')]=isNaN(_0x1c59c1[_0xad9f('0x70')])?null:_0x1c59c1[_0xad9f('0x70')];_0x3b0f96[_0xad9f('0x71')]=isNaN(_0x1c59c1[_0xad9f('0x72')])?null:_0x1c59c1[_0xad9f('0x72')];_0x3b0f96[_0xad9f('0x73')]=isNaN(_0x1c59c1[_0xad9f('0x74')])?null:_0x1c59c1[_0xad9f('0x74')];});_0x361383['on']('end',function(){fs[_0xad9f('0x75')](_0x126937,parseInt(_0xad9f('0x76'),0x8));return db[_0xad9f('0x30')][_0xad9f('0x5a')](_0x3b0f96)[_0xad9f('0x25')](function(_0x14563f){var _0xd09f67={'role':_0x9eee6f[_0xad9f('0x77')][_0xad9f('0x78')],'userProfileId':_0x9eee6f['body'][_0xad9f('0x79')]};if(!_0xd09f67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd09f67[_0xad9f('0x78')]===_0xad9f('0x7a')){var _0x11925e=_0x14563f[_0xad9f('0x27')]({'plain':!![]});return db[_0xad9f('0x7b')][_0xad9f('0x4f')]({'where':{'name':'Sounds','userProfileId':_0xd09f67[_0xad9f('0x79')]},'raw':!![]})[_0xad9f('0x25')](function(_0x5c3eff){if(_0x5c3eff&&_0x5c3eff[_0xad9f('0x7c')]===0x0){return db['UserProfileResource'][_0xad9f('0x5a')]({'name':_0x11925e[_0xad9f('0x2c')],'resourceId':_0x11925e['id'],'type':_0x5c3eff[_0xad9f('0x2c')],'sectionId':_0x5c3eff['id']},{})[_0xad9f('0x25')](function(){return _0x14563f;});}else{return _0x14563f;}})['catch'](function(_0x59c317){logger['error'](_0xad9f('0x7d'),_0x59c317);throw _0x59c317;});}return _0x14563f;})[_0xad9f('0x25')](respondWithResult(_0x96a77e,null))[_0xad9f('0x4a')](handleError(_0x96a77e,null));});_0x361383[_0xad9f('0x7e')]();}catch(_0x45829f){_0x96a77e['status'](0x1f4)[_0xad9f('0x2d')](_0x45829f);}};exports[_0xad9f('0x24')]=function(_0x2229c1,_0x13bc7d,_0x1f7cd5){return db['Sound']['find']({'where':{'id':_0x2229c1[_0xad9f('0x4c')]['id']}})[_0xad9f('0x25')](handleEntityNotFound(_0x13bc7d,null))['then'](saveUpdates(_[_0xad9f('0x41')](_0x2229c1[_0xad9f('0x77')],[_0xad9f('0x2c'),'description']),null))[_0xad9f('0x25')](respondWithResult(_0x13bc7d,null))['catch'](handleError(_0x13bc7d,null));};exports['delete']=function(_0x19ec7e,_0x1bf56c,_0x189d69){return db[_0xad9f('0x30')]['find']({'where':{'id':_0x19ec7e[_0xad9f('0x4c')]['id']}})[_0xad9f('0x25')](function(_0x23003f){if(_0x23003f){return _0x23003f[_0xad9f('0x26')]();}})[_0xad9f('0x25')](function(_0x59cb65){var _0x8d1c6e=path['join'](config[_0xad9f('0x53')],_0xad9f('0x62'),util[_0xad9f('0x57')](_0xad9f('0x59'),_0x59cb65[_0xad9f('0x58')],_0x59cb65[_0xad9f('0x7f')]));var _0x3d4d01=path[_0xad9f('0x52')](config[_0xad9f('0x53')],_0xad9f('0x54'),util[_0xad9f('0x57')](_0xad9f('0x59'),_0x59cb65[_0xad9f('0x58')],_0x59cb65[_0xad9f('0x50')]));fs[_0xad9f('0x80')](_0x8d1c6e);fs[_0xad9f('0x80')](_0x3d4d01);return _0x59cb65;})[_0xad9f('0x25')](function(_0x4696a0){if(_0x4696a0){return _0x1bf56c[_0xad9f('0x1c')](0xcc)['end']();}})[_0xad9f('0x25')](handleEntityNotFound(_0x1bf56c,null))[_0xad9f('0x4a')](handleError(_0x1bf56c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index f7572e3..bbfeb7d 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 _0x2a1e=['lodash','util','api','bluebird','request-promise','rimraf','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x3a1289,_0x16a332){var _0x5e0095=function(_0x3f7990){while(--_0x3f7990){_0x3a1289['push'](_0x3a1289['shift']());}};_0x5e0095(++_0x16a332);}(_0x2a1e,0xe7));var _0xe2a1=function(_0x1e93c9,_0x2f85b0){_0x1e93c9=_0x1e93c9-0x0;var _0x346a87=_0x2a1e[_0x1e93c9];return _0x346a87;};'use strict';var _=require(_0xe2a1('0x0'));var util=require(_0xe2a1('0x1'));var logger=require('../../config/logger')(_0xe2a1('0x2'));var moment=require('moment');var BPromise=require(_0xe2a1('0x3'));var rp=require(_0xe2a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2a1('0x5'));var config=require('../../config/environment');var attributes=require(_0xe2a1('0x6'));module[_0xe2a1('0x7')]=function(_0x182b97,_0x163211){return _0x182b97[_0xe2a1('0x8')](_0xe2a1('0x9'),attributes,{'tableName':_0xe2a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c52=['define','tools_sounds','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x266d29,_0x2b6b29){var _0x33bbbd=function(_0x3b934d){while(--_0x3b934d){_0x266d29['push'](_0x266d29['shift']());}};_0x33bbbd(++_0x2b6b29);}(_0x7c52,0x1d6));var _0x27c5=function(_0x19c135,_0x2a9aba){_0x19c135=_0x19c135-0x0;var _0x52c8c8=_0x7c52[_0x19c135];return _0x52c8c8;};'use strict';var _=require(_0x27c5('0x0'));var util=require(_0x27c5('0x1'));var logger=require(_0x27c5('0x2'))(_0x27c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x27c5('0x4'));var fs=require('fs');var path=require(_0x27c5('0x5'));var rimraf=require(_0x27c5('0x6'));var config=require(_0x27c5('0x7'));var attributes=require(_0x27c5('0x8'));module[_0x27c5('0x9')]=function(_0x6497d8,_0x1af531){return _0x6497d8[_0x27c5('0xa')]('Sound',attributes,{'tableName':_0x27c5('0xb'),'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 acf4481..9982633 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 _0xe604=['include','model','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSound','Sound','options','where','attributes','map'];(function(_0x454ed4,_0x5cb877){var _0x2b9a06=function(_0x4d58e2){while(--_0x4d58e2){_0x454ed4['push'](_0x454ed4['shift']());}};_0x2b9a06(++_0x5cb877);}(_0xe604,0xfe));var _0x4e60=function(_0xb21f99,_0x30d1ab){_0xb21f99=_0xb21f99-0x0;var _0x53c60a=_0xe604[_0xb21f99];return _0x53c60a;};'use strict';var _=require(_0x4e60('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4e60('0x1'));var rs=require(_0x4e60('0x2'));var fs=require('fs');var Redis=require(_0x4e60('0x3'));var db=require(_0x4e60('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e60('0x5'))(_0x4e60('0x6'));var config=require(_0x4e60('0x7'));var jayson=require(_0x4e60('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x541a5a,_0xfbbf73,_0xa638d0){return new BPromise(function(_0x5d14be,_0x5226ac){return client[_0x4e60('0x9')](_0x541a5a,_0xa638d0)[_0x4e60('0xa')](function(_0x59d8cc){logger[_0x4e60('0xb')](_0x4e60('0xc'),_0xfbbf73,_0x4e60('0xd'));logger[_0x4e60('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0xfbbf73,_0x4e60('0xd'),JSON[_0x4e60('0xf')](_0x59d8cc));if(_0x59d8cc[_0x4e60('0x10')]){if(_0x59d8cc[_0x4e60('0x10')]['code']===0x1f4){logger[_0x4e60('0x10')](_0x4e60('0xc'),_0xfbbf73,_0x59d8cc[_0x4e60('0x10')][_0x4e60('0x11')]);return _0x5226ac(_0x59d8cc[_0x4e60('0x10')][_0x4e60('0x11')]);}logger[_0x4e60('0x10')](_0x4e60('0xc'),_0xfbbf73,_0x59d8cc[_0x4e60('0x10')][_0x4e60('0x11')]);return _0x5d14be(_0x59d8cc['error']['message']);}else{logger[_0x4e60('0xb')](_0x4e60('0xc'),_0xfbbf73,'request\x20sent');_0x5d14be(_0x59d8cc[_0x4e60('0x12')][_0x4e60('0x11')]);}})[_0x4e60('0x13')](function(_0x32f017){logger[_0x4e60('0x10')]('Sound,\x20%s,\x20%s',_0xfbbf73,_0x32f017);_0x5226ac(_0x32f017);});});}exports[_0x4e60('0x14')]=function(_0x2b1a00){var _0x4f5f1a=this;return new Promise(function(_0x429079,_0xcedb75){return db[_0x4e60('0x15')]['find']({'raw':_0x2b1a00[_0x4e60('0x16')]?_0x2b1a00[_0x4e60('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2b1a00['options']?_0x2b1a00[_0x4e60('0x16')][_0x4e60('0x17')]||null:null,'attributes':_0x2b1a00['options']?_0x2b1a00[_0x4e60('0x16')][_0x4e60('0x18')]||null:null,'include':_0x2b1a00[_0x4e60('0x16')]?_0x2b1a00[_0x4e60('0x16')]['include']?_[_0x4e60('0x19')](_0x2b1a00[_0x4e60('0x16')][_0x4e60('0x1a')],function(_0x58ff67){return{'model':db[_0x58ff67[_0x4e60('0x1b')]],'as':_0x58ff67['as'],'attributes':_0x58ff67[_0x4e60('0x18')],'include':_0x58ff67[_0x4e60('0x1a')]?_[_0x4e60('0x19')](_0x58ff67[_0x4e60('0x1a')],function(_0x4ad4c0){return{'model':db[_0x4ad4c0['model']],'as':_0x4ad4c0['as'],'attributes':_0x4ad4c0['attributes'],'include':_0x4ad4c0[_0x4e60('0x1a')]?_['map'](_0x4ad4c0[_0x4e60('0x1a')],function(_0x341cc0){return{'model':db[_0x341cc0[_0x4e60('0x1b')]],'as':_0x341cc0['as'],'attributes':_0x341cc0[_0x4e60('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d8fcd){logger[_0x4e60('0xb')](_0x4e60('0x14'),_0x2b1a00);logger[_0x4e60('0xe')](_0x4e60('0x14'),_0x2b1a00,JSON[_0x4e60('0xf')](_0x5d8fcd));_0x429079(_0x5d8fcd);})[_0x4e60('0x13')](function(_0x3c1a81){logger['error']('ShowSound',_0x3c1a81[_0x4e60('0x11')],_0x2b1a00);_0xcedb75(_0x4f5f1a[_0x4e60('0x10')](0x1f4,_0x3c1a81[_0x4e60('0x11')]));});});}; \ No newline at end of file +var _0xe117=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','stringify','error','code','Sound,\x20%s,\x20%s','message','info','request\x20sent','result','catch','Sound','find','options','where','attributes','include','map','model','ShowSound','moment','bluebird','randomstring'];(function(_0x107d3a,_0x27b1d9){var _0x146a39=function(_0x102388){while(--_0x102388){_0x107d3a['push'](_0x107d3a['shift']());}};_0x146a39(++_0x27b1d9);}(_0xe117,0xbd));var _0x7e11=function(_0x2ee949,_0x4e060f){_0x2ee949=_0x2ee949-0x0;var _0x4d80a4=_0xe117[_0x2ee949];return _0x4d80a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e11('0x0'));var BPromise=require(_0x7e11('0x1'));var rs=require(_0x7e11('0x2'));var fs=require('fs');var Redis=require(_0x7e11('0x3'));var db=require(_0x7e11('0x4'))['db'];var utils=require(_0x7e11('0x5'));var logger=require(_0x7e11('0x6'))(_0x7e11('0x7'));var config=require(_0x7e11('0x8'));var jayson=require(_0x7e11('0x9'));var client=jayson[_0x7e11('0xa')][_0x7e11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f78f0,_0x26feb6,_0x36d872){return new BPromise(function(_0x30f3a3,_0x29673a){return client['request'](_0x3f78f0,_0x36d872)[_0x7e11('0xc')](function(_0x577f08){logger['info']('Sound,\x20%s,\x20%s',_0x26feb6,'request\x20sent');logger[_0x7e11('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x26feb6,'request\x20sent',JSON[_0x7e11('0xe')](_0x577f08));if(_0x577f08[_0x7e11('0xf')]){if(_0x577f08['error'][_0x7e11('0x10')]===0x1f4){logger['error'](_0x7e11('0x11'),_0x26feb6,_0x577f08[_0x7e11('0xf')][_0x7e11('0x12')]);return _0x29673a(_0x577f08['error'][_0x7e11('0x12')]);}logger[_0x7e11('0xf')]('Sound,\x20%s,\x20%s',_0x26feb6,_0x577f08['error'][_0x7e11('0x12')]);return _0x30f3a3(_0x577f08[_0x7e11('0xf')][_0x7e11('0x12')]);}else{logger[_0x7e11('0x13')](_0x7e11('0x11'),_0x26feb6,_0x7e11('0x14'));_0x30f3a3(_0x577f08[_0x7e11('0x15')]['message']);}})[_0x7e11('0x16')](function(_0x25ba60){logger[_0x7e11('0xf')](_0x7e11('0x11'),_0x26feb6,_0x25ba60);_0x29673a(_0x25ba60);});});}exports['ShowSound']=function(_0x5a26bc){var _0xf8b5e4=this;return new Promise(function(_0x5227ad,_0x5d7fd2){return db[_0x7e11('0x17')][_0x7e11('0x18')]({'raw':_0x5a26bc[_0x7e11('0x19')]?_0x5a26bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a26bc['options']?_0x5a26bc[_0x7e11('0x19')][_0x7e11('0x1a')]||null:null,'attributes':_0x5a26bc[_0x7e11('0x19')]?_0x5a26bc[_0x7e11('0x19')][_0x7e11('0x1b')]||null:null,'include':_0x5a26bc[_0x7e11('0x19')]?_0x5a26bc[_0x7e11('0x19')][_0x7e11('0x1c')]?_[_0x7e11('0x1d')](_0x5a26bc[_0x7e11('0x19')]['include'],function(_0x6e534d){return{'model':db[_0x6e534d[_0x7e11('0x1e')]],'as':_0x6e534d['as'],'attributes':_0x6e534d[_0x7e11('0x1b')],'include':_0x6e534d[_0x7e11('0x1c')]?_[_0x7e11('0x1d')](_0x6e534d[_0x7e11('0x1c')],function(_0x2b28ae){return{'model':db[_0x2b28ae['model']],'as':_0x2b28ae['as'],'attributes':_0x2b28ae[_0x7e11('0x1b')],'include':_0x2b28ae[_0x7e11('0x1c')]?_[_0x7e11('0x1d')](_0x2b28ae[_0x7e11('0x1c')],function(_0x2d656f){return{'model':db[_0x2d656f[_0x7e11('0x1e')]],'as':_0x2d656f['as'],'attributes':_0x2d656f[_0x7e11('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7e11('0xc')](function(_0x67dd28){logger['info'](_0x7e11('0x1f'),_0x5a26bc);logger['debug'](_0x7e11('0x1f'),_0x5a26bc,JSON['stringify'](_0x67dd28));_0x5227ad(_0x67dd28);})['catch'](function(_0x640b60){logger[_0x7e11('0xf')](_0x7e11('0x1f'),_0x640b60[_0x7e11('0x12')],_0x5a26bc);_0x5d7fd2(_0xf8b5e4['error'](0x1f4,_0x640b60[_0x7e11('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e70d9eb..4cd9250 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a0c33,_0x5686bb){var _0x6488f9=function(_0x3bbd97){while(--_0x3bbd97){_0x4a0c33['push'](_0x4a0c33['shift']());}};_0x6488f9(++_0x5686bb);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0x0b0e[_0x5a4400];return _0xf9b532;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xda2d,0x102));var _0xdda2=function(_0x2fb7ea,_0x160bab){_0x2fb7ea=_0x2fb7ea-0x0;var _0x588903=_0xda2d[_0x2fb7ea];return _0x588903;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 843c8f4..a703419 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 _0x0d46=['exports','TEXT','medium','ENUM','out','STRING'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x0d46,0x8a));var _0x60d4=function(_0x4c608e,_0x2bb2bd){_0x4c608e=_0x4c608e-0x0;var _0x398b2c=_0x0d46[_0x4c608e];return _0x398b2c;};'use strict';var Sequelize=require('sequelize');module[_0x60d4('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x60d4('0x1')](_0x60d4('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x60d4('0x3')]('in',_0x60d4('0x4')),'defaultValue':_0x60d4('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x60d4('0x5')]},'providerResponse':{'type':Sequelize[_0x60d4('0x1')]}}; \ No newline at end of file +var _0x1313=['STRING','TEXT','ENUM','out','sequelize','exports'];(function(_0x1e7622,_0x2bb9cf){var _0x1c17a7=function(_0x35abb6){while(--_0x35abb6){_0x1e7622['push'](_0x1e7622['shift']());}};_0x1c17a7(++_0x2bb9cf);}(_0x1313,0xee));var _0x3131=function(_0x115696,_0x5ed701){_0x115696=_0x115696-0x0;var _0x393bbf=_0x1313[_0x115696];return _0x393bbf;};'use strict';var Sequelize=require(_0x3131('0x0'));module[_0x3131('0x1')]={'uniqueid':{'type':Sequelize[_0x3131('0x2')]},'body':{'type':Sequelize[_0x3131('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x3131('0x4')]('in',_0x3131('0x5')),'defaultValue':_0x3131('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3131('0x2')]},'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 6d3fa63..fb34721 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 _0x26fb=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','save','update','then','error','stack','name','send','index','map','SquareMessage','fieldName','key','model','query','keys'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x26fb,0x1f4));var _0xb26f=function(_0x722938,_0x36063f){_0x722938=_0x722938-0x0;var _0x168dbf=_0x26fb[_0x722938];return _0x168dbf;};'use strict';var emlformat=require(_0xb26f('0x0'));var rimraf=require(_0xb26f('0x1'));var zipdir=require(_0xb26f('0x2'));var jsonpatch=require(_0xb26f('0x3'));var rp=require(_0xb26f('0x4'));var moment=require(_0xb26f('0x5'));var BPromise=require(_0xb26f('0x6'));var Mustache=require(_0xb26f('0x7'));var util=require('util');var path=require(_0xb26f('0x8'));var sox=require(_0xb26f('0x9'));var csv=require(_0xb26f('0xa'));var ejs=require(_0xb26f('0xb'));var fs=require('fs');var fs_extra=require(_0xb26f('0xc'));var _=require('lodash');var squel=require(_0xb26f('0xd'));var crypto=require(_0xb26f('0xe'));var jsforce=require(_0xb26f('0xf'));var deskjs=require(_0xb26f('0x10'));var toCsv=require(_0xb26f('0xa'));var querystring=require('querystring');var Papa=require(_0xb26f('0x11'));var Redis=require(_0xb26f('0x12'));var authService=require(_0xb26f('0x13'));var qs=require(_0xb26f('0x14'));var as=require(_0xb26f('0x15'));var hardwareService=require(_0xb26f('0x16'));var logger=require(_0xb26f('0x17'))(_0xb26f('0x18'));var utils=require(_0xb26f('0x19'));var config=require(_0xb26f('0x1a'));var licenseUtil=require(_0xb26f('0x1b'));var db=require(_0xb26f('0x1c'))['db'];function respondWithStatusCode(_0x45a9ad,_0x39768d){_0x39768d=_0x39768d||0xcc;return function(_0x488c38){if(_0x488c38){return _0x45a9ad[_0xb26f('0x1d')](_0x39768d);}return _0x45a9ad[_0xb26f('0x1e')](_0x39768d)[_0xb26f('0x1f')]();};}function respondWithResult(_0x34282c,_0x105399){_0x105399=_0x105399||0xc8;return function(_0x141c8e){if(_0x141c8e){return _0x34282c[_0xb26f('0x1e')](_0x105399)['json'](_0x141c8e);}};}function respondWithFilteredResult(_0x50132c,_0x380b73){return function(_0x1fb286){if(_0x1fb286){var _0x1ae1c1=typeof _0x380b73[_0xb26f('0x20')]==='undefined'&&typeof _0x380b73[_0xb26f('0x21')]===_0xb26f('0x22');var _0x50676b=_0x1fb286['count'];var _0x233344=_0x1ae1c1?0x0:_0x380b73[_0xb26f('0x20')];var _0x50fd0b=_0x1ae1c1?_0x1fb286[_0xb26f('0x23')]:_0x380b73[_0xb26f('0x20')]+_0x380b73[_0xb26f('0x21')];var _0xebb0c1;if(_0x50fd0b>=_0x50676b){_0x50fd0b=_0x50676b;_0xebb0c1=0xc8;}else{_0xebb0c1=0xce;}_0x50132c['status'](_0xebb0c1);return _0x50132c[_0xb26f('0x24')]('Content-Range',_0x233344+'-'+_0x50fd0b+'/'+_0x50676b)[_0xb26f('0x25')](_0x1fb286);}return null;};}function patchUpdates(_0x2a6161){return function(_0x331e54){try{jsonpatch['apply'](_0x331e54,_0x2a6161,!![]);}catch(_0x13b988){return BPromise['reject'](_0x13b988);}return _0x331e54[_0xb26f('0x26')]();};}function saveUpdates(_0x592c3c,_0x17957f){return function(_0x23f28d){if(_0x23f28d){return _0x23f28d[_0xb26f('0x27')](_0x592c3c)['then'](function(_0x8566b0){return _0x8566b0;});}return null;};}function removeEntity(_0x26beaf,_0x147d84){return function(_0x2a5891){if(_0x2a5891){return _0x2a5891['destroy']()[_0xb26f('0x28')](function(){_0x26beaf[_0xb26f('0x1e')](0xcc)[_0xb26f('0x1f')]();});}};}function handleEntityNotFound(_0x2a2eaa,_0x2236e0){return function(_0x4ec0e9){if(!_0x4ec0e9){_0x2a2eaa[_0xb26f('0x1d')](0x194);}return _0x4ec0e9;};}function handleError(_0x975f56,_0x18e4b7){_0x18e4b7=_0x18e4b7||0x1f4;return function(_0x3a375f){logger[_0xb26f('0x29')](_0x3a375f[_0xb26f('0x2a')]);if(_0x3a375f[_0xb26f('0x2b')]){delete _0x3a375f[_0xb26f('0x2b')];}_0x975f56['status'](_0x18e4b7)[_0xb26f('0x2c')](_0x3a375f);};}exports[_0xb26f('0x2d')]=function(_0x415bff,_0x5f2a74){var _0x5ee0d5={},_0x36dd36={},_0xbf3c8b={'count':0x0,'rows':[]};var _0x7d2230=_[_0xb26f('0x2e')](db[_0xb26f('0x2f')]['rawAttributes'],function(_0x3e0faf){return{'name':_0x3e0faf[_0xb26f('0x30')],'type':_0x3e0faf['type'][_0xb26f('0x31')]};});_0x36dd36[_0xb26f('0x32')]=_[_0xb26f('0x2e')](_0x7d2230,'name');_0x36dd36[_0xb26f('0x33')]=_[_0xb26f('0x34')](_0x415bff[_0xb26f('0x33')]);_0x36dd36[_0xb26f('0x35')]=_[_0xb26f('0x36')](_0x36dd36[_0xb26f('0x32')],_0x36dd36[_0xb26f('0x33')]);_0x5ee0d5[_0xb26f('0x37')]=_[_0xb26f('0x36')](_0x36dd36[_0xb26f('0x32')],qs[_0xb26f('0x38')](_0x415bff[_0xb26f('0x33')][_0xb26f('0x38')]));_0x5ee0d5[_0xb26f('0x37')]=_0x5ee0d5['attributes'][_0xb26f('0x39')]?_0x5ee0d5[_0xb26f('0x37')]:_0x36dd36['model'];if(!_0x415bff[_0xb26f('0x33')][_0xb26f('0x3a')](_0xb26f('0x3b'))){_0x5ee0d5['limit']=qs['limit'](_0x415bff[_0xb26f('0x33')]['limit']);_0x5ee0d5[_0xb26f('0x20')]=qs[_0xb26f('0x20')](_0x415bff[_0xb26f('0x33')][_0xb26f('0x20')]);}_0x5ee0d5[_0xb26f('0x3c')]=qs[_0xb26f('0x3d')](_0x415bff['query']['sort']);_0x5ee0d5[_0xb26f('0x3e')]=qs[_0xb26f('0x35')](_[_0xb26f('0x3f')](_0x415bff[_0xb26f('0x33')],_0x36dd36['filters']),_0x7d2230);if(_0x415bff[_0xb26f('0x33')][_0xb26f('0x40')]){_0x5ee0d5[_0xb26f('0x3e')]=_[_0xb26f('0x41')](_0x5ee0d5[_0xb26f('0x3e')],{'$or':_[_0xb26f('0x2e')](_0x7d2230,function(_0x3f22c9){if(_0x3f22c9['type']!==_0xb26f('0x42')){var _0x5f4629={};_0x5f4629[_0x3f22c9[_0xb26f('0x2b')]]={'$like':'%'+_0x415bff[_0xb26f('0x33')][_0xb26f('0x40')]+'%'};return _0x5f4629;}})});}_0x5ee0d5=_[_0xb26f('0x41')]({},_0x5ee0d5,_0x415bff['options']);var _0x1bdc99={'where':_0x5ee0d5[_0xb26f('0x3e')]};return db['SquareMessage']['count'](_0x1bdc99)[_0xb26f('0x28')](function(_0x19c42c){_0xbf3c8b['count']=_0x19c42c;if(_0x415bff[_0xb26f('0x33')][_0xb26f('0x43')]){_0x5ee0d5[_0xb26f('0x44')]=[{'all':!![]}];}return db[_0xb26f('0x2f')][_0xb26f('0x45')](_0x5ee0d5);})['then'](function(_0xe70f91){_0xbf3c8b[_0xb26f('0x46')]=_0xe70f91;return _0xbf3c8b;})[_0xb26f('0x28')](respondWithFilteredResult(_0x5f2a74,_0x5ee0d5))[_0xb26f('0x47')](handleError(_0x5f2a74,null));};exports[_0xb26f('0x48')]=function(_0x3e673a,_0x4be1c0){var _0x5b56a1={'raw':!![],'where':{'id':_0x3e673a[_0xb26f('0x49')]['id']}},_0x2bfc27={};_0x2bfc27[_0xb26f('0x32')]=_['keys'](db[_0xb26f('0x2f')]['rawAttributes']);_0x2bfc27[_0xb26f('0x33')]=_[_0xb26f('0x34')](_0x3e673a[_0xb26f('0x33')]);_0x2bfc27['filters']=_[_0xb26f('0x36')](_0x2bfc27[_0xb26f('0x32')],_0x2bfc27['query']);_0x5b56a1['attributes']=_[_0xb26f('0x36')](_0x2bfc27[_0xb26f('0x32')],qs[_0xb26f('0x38')](_0x3e673a[_0xb26f('0x33')][_0xb26f('0x38')]));_0x5b56a1[_0xb26f('0x37')]=_0x5b56a1[_0xb26f('0x37')][_0xb26f('0x39')]?_0x5b56a1['attributes']:_0x2bfc27[_0xb26f('0x32')];if(_0x3e673a[_0xb26f('0x33')]['includeAll']){_0x5b56a1[_0xb26f('0x44')]=[{'all':!![]}];}_0x5b56a1=_[_0xb26f('0x41')]({},_0x5b56a1,_0x3e673a[_0xb26f('0x4a')]);return db[_0xb26f('0x2f')][_0xb26f('0x4b')](_0x5b56a1)[_0xb26f('0x28')](handleEntityNotFound(_0x4be1c0,null))['then'](respondWithResult(_0x4be1c0,null))[_0xb26f('0x47')](handleError(_0x4be1c0,null));};exports['create']=function(_0x58ff3d,_0x4f0647){return db[_0xb26f('0x2f')][_0xb26f('0x4c')](_0x58ff3d[_0xb26f('0x4d')],{})[_0xb26f('0x28')](respondWithResult(_0x4f0647,0xc9))[_0xb26f('0x47')](handleError(_0x4f0647,null));};exports[_0xb26f('0x27')]=function(_0xc0ef06,_0x459d15){if(_0xc0ef06['body']['id']){delete _0xc0ef06[_0xb26f('0x4d')]['id'];}return db[_0xb26f('0x2f')][_0xb26f('0x4b')]({'where':{'id':_0xc0ef06[_0xb26f('0x49')]['id']}})[_0xb26f('0x28')](handleEntityNotFound(_0x459d15,null))[_0xb26f('0x28')](saveUpdates(_0xc0ef06[_0xb26f('0x4d')],null))['then'](respondWithResult(_0x459d15,null))['catch'](handleError(_0x459d15,null));};exports[_0xb26f('0x4e')]=function(_0x52577b,_0x1446bd){return db[_0xb26f('0x2f')]['find']({'where':{'id':_0x52577b['params']['id']}})['then'](handleEntityNotFound(_0x1446bd,null))[_0xb26f('0x28')](removeEntity(_0x1446bd,null))[_0xb26f('0x47')](handleError(_0x1446bd,null));}; \ No newline at end of file +var _0xa3b7=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','SquareMessage','rows','show','params','find','catch','create','body','eml-format','zip-dir','request-promise','moment'];(function(_0x29b01f,_0x13e8bb){var _0xf7d6c3=function(_0x4e0af6){while(--_0x4e0af6){_0x29b01f['push'](_0x29b01f['shift']());}};_0xf7d6c3(++_0x13e8bb);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xa3b7[_0x4cc492];return _0x1f36b9;};'use strict';var emlformat=require(_0x7a3b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7a3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a3b('0x2'));var moment=require(_0x7a3b('0x3'));var BPromise=require(_0x7a3b('0x4'));var Mustache=require(_0x7a3b('0x5'));var util=require(_0x7a3b('0x6'));var path=require(_0x7a3b('0x7'));var sox=require(_0x7a3b('0x8'));var csv=require('to-csv');var ejs=require(_0x7a3b('0x9'));var fs=require('fs');var fs_extra=require(_0x7a3b('0xa'));var _=require(_0x7a3b('0xb'));var squel=require(_0x7a3b('0xc'));var crypto=require(_0x7a3b('0xd'));var jsforce=require(_0x7a3b('0xe'));var deskjs=require(_0x7a3b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7a3b('0x10'));var Papa=require(_0x7a3b('0x11'));var Redis=require(_0x7a3b('0x12'));var authService=require(_0x7a3b('0x13'));var qs=require(_0x7a3b('0x14'));var as=require(_0x7a3b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a3b('0x16'))(_0x7a3b('0x17'));var utils=require(_0x7a3b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7a3b('0x19'));var db=require(_0x7a3b('0x1a'))['db'];function respondWithStatusCode(_0x5a5897,_0x2110d9){_0x2110d9=_0x2110d9||0xcc;return function(_0x12b073){if(_0x12b073){return _0x5a5897[_0x7a3b('0x1b')](_0x2110d9);}return _0x5a5897['status'](_0x2110d9)[_0x7a3b('0x1c')]();};}function respondWithResult(_0x4167d0,_0x346609){_0x346609=_0x346609||0xc8;return function(_0x4e27a9){if(_0x4e27a9){return _0x4167d0[_0x7a3b('0x1d')](_0x346609)[_0x7a3b('0x1e')](_0x4e27a9);}};}function respondWithFilteredResult(_0x530172,_0x335a43){return function(_0x312be6){if(_0x312be6){var _0x3267c5=typeof _0x335a43['offset']===_0x7a3b('0x1f')&&typeof _0x335a43[_0x7a3b('0x20')]==='undefined';var _0x444129=_0x312be6['count'];var _0x6de066=_0x3267c5?0x0:_0x335a43['offset'];var _0x27d5a1=_0x3267c5?_0x312be6[_0x7a3b('0x21')]:_0x335a43[_0x7a3b('0x22')]+_0x335a43[_0x7a3b('0x20')];var _0x58bb3a;if(_0x27d5a1>=_0x444129){_0x27d5a1=_0x444129;_0x58bb3a=0xc8;}else{_0x58bb3a=0xce;}_0x530172[_0x7a3b('0x1d')](_0x58bb3a);return _0x530172[_0x7a3b('0x23')](_0x7a3b('0x24'),_0x6de066+'-'+_0x27d5a1+'/'+_0x444129)[_0x7a3b('0x1e')](_0x312be6);}return null;};}function patchUpdates(_0x329123){return function(_0x1492d8){try{jsonpatch[_0x7a3b('0x25')](_0x1492d8,_0x329123,!![]);}catch(_0x3259f2){return BPromise[_0x7a3b('0x26')](_0x3259f2);}return _0x1492d8[_0x7a3b('0x27')]();};}function saveUpdates(_0x4622d5,_0x4138dc){return function(_0x4cfc79){if(_0x4cfc79){return _0x4cfc79[_0x7a3b('0x28')](_0x4622d5)['then'](function(_0x16410e){return _0x16410e;});}return null;};}function removeEntity(_0xaff1c2,_0x53b165){return function(_0x11f60b){if(_0x11f60b){return _0x11f60b[_0x7a3b('0x29')]()[_0x7a3b('0x2a')](function(){_0xaff1c2['status'](0xcc)[_0x7a3b('0x1c')]();});}};}function handleEntityNotFound(_0x2b8ee5,_0x285b78){return function(_0x22f15b){if(!_0x22f15b){_0x2b8ee5['sendStatus'](0x194);}return _0x22f15b;};}function handleError(_0x1b8965,_0x5950a4){_0x5950a4=_0x5950a4||0x1f4;return function(_0x599389){logger[_0x7a3b('0x2b')](_0x599389[_0x7a3b('0x2c')]);if(_0x599389[_0x7a3b('0x2d')]){delete _0x599389[_0x7a3b('0x2d')];}_0x1b8965[_0x7a3b('0x1d')](_0x5950a4)[_0x7a3b('0x2e')](_0x599389);};}exports[_0x7a3b('0x2f')]=function(_0x447252,_0x2224ed){var _0x440f90={},_0xaf37af={},_0x43653c={'count':0x0,'rows':[]};var _0x4c8d74=_['map'](db['SquareMessage'][_0x7a3b('0x30')],function(_0x170464){return{'name':_0x170464[_0x7a3b('0x31')],'type':_0x170464[_0x7a3b('0x32')][_0x7a3b('0x33')]};});_0xaf37af[_0x7a3b('0x34')]=_[_0x7a3b('0x35')](_0x4c8d74,_0x7a3b('0x2d'));_0xaf37af[_0x7a3b('0x36')]=_[_0x7a3b('0x37')](_0x447252['query']);_0xaf37af[_0x7a3b('0x38')]=_[_0x7a3b('0x39')](_0xaf37af[_0x7a3b('0x34')],_0xaf37af['query']);_0x440f90[_0x7a3b('0x3a')]=_[_0x7a3b('0x39')](_0xaf37af[_0x7a3b('0x34')],qs[_0x7a3b('0x3b')](_0x447252[_0x7a3b('0x36')]['fields']));_0x440f90[_0x7a3b('0x3a')]=_0x440f90[_0x7a3b('0x3a')][_0x7a3b('0x3c')]?_0x440f90['attributes']:_0xaf37af[_0x7a3b('0x34')];if(!_0x447252[_0x7a3b('0x36')][_0x7a3b('0x3d')](_0x7a3b('0x3e'))){_0x440f90[_0x7a3b('0x20')]=qs[_0x7a3b('0x20')](_0x447252['query'][_0x7a3b('0x20')]);_0x440f90[_0x7a3b('0x22')]=qs[_0x7a3b('0x22')](_0x447252[_0x7a3b('0x36')]['offset']);}_0x440f90[_0x7a3b('0x3f')]=qs[_0x7a3b('0x40')](_0x447252[_0x7a3b('0x36')][_0x7a3b('0x40')]);_0x440f90[_0x7a3b('0x41')]=qs['filters'](_['pick'](_0x447252[_0x7a3b('0x36')],_0xaf37af['filters']),_0x4c8d74);if(_0x447252[_0x7a3b('0x36')][_0x7a3b('0x42')]){_0x440f90[_0x7a3b('0x41')]=_['merge'](_0x440f90['where'],{'$or':_[_0x7a3b('0x35')](_0x4c8d74,function(_0x556954){if(_0x556954[_0x7a3b('0x32')]!=='VIRTUAL'){var _0x3f68f1={};_0x3f68f1[_0x556954['name']]={'$like':'%'+_0x447252[_0x7a3b('0x36')][_0x7a3b('0x42')]+'%'};return _0x3f68f1;}})});}_0x440f90=_[_0x7a3b('0x43')]({},_0x440f90,_0x447252['options']);var _0x1c43b4={'where':_0x440f90[_0x7a3b('0x41')]};return db['SquareMessage'][_0x7a3b('0x21')](_0x1c43b4)[_0x7a3b('0x2a')](function(_0x358ca8){_0x43653c[_0x7a3b('0x21')]=_0x358ca8;if(_0x447252[_0x7a3b('0x36')][_0x7a3b('0x44')]){_0x440f90[_0x7a3b('0x45')]=[{'all':!![]}];}return db[_0x7a3b('0x46')]['findAll'](_0x440f90);})[_0x7a3b('0x2a')](function(_0x4f81e9){_0x43653c[_0x7a3b('0x47')]=_0x4f81e9;return _0x43653c;})[_0x7a3b('0x2a')](respondWithFilteredResult(_0x2224ed,_0x440f90))['catch'](handleError(_0x2224ed,null));};exports[_0x7a3b('0x48')]=function(_0x2e5165,_0x1d795f){var _0x34aa36={'raw':!![],'where':{'id':_0x2e5165[_0x7a3b('0x49')]['id']}},_0x2c1cec={};_0x2c1cec[_0x7a3b('0x34')]=_[_0x7a3b('0x37')](db[_0x7a3b('0x46')]['rawAttributes']);_0x2c1cec[_0x7a3b('0x36')]=_[_0x7a3b('0x37')](_0x2e5165[_0x7a3b('0x36')]);_0x2c1cec[_0x7a3b('0x38')]=_[_0x7a3b('0x39')](_0x2c1cec[_0x7a3b('0x34')],_0x2c1cec[_0x7a3b('0x36')]);_0x34aa36[_0x7a3b('0x3a')]=_[_0x7a3b('0x39')](_0x2c1cec['model'],qs[_0x7a3b('0x3b')](_0x2e5165['query'][_0x7a3b('0x3b')]));_0x34aa36[_0x7a3b('0x3a')]=_0x34aa36[_0x7a3b('0x3a')]['length']?_0x34aa36['attributes']:_0x2c1cec[_0x7a3b('0x34')];if(_0x2e5165[_0x7a3b('0x36')]['includeAll']){_0x34aa36[_0x7a3b('0x45')]=[{'all':!![]}];}_0x34aa36=_[_0x7a3b('0x43')]({},_0x34aa36,_0x2e5165['options']);return db[_0x7a3b('0x46')][_0x7a3b('0x4a')](_0x34aa36)['then'](handleEntityNotFound(_0x1d795f,null))[_0x7a3b('0x2a')](respondWithResult(_0x1d795f,null))[_0x7a3b('0x4b')](handleError(_0x1d795f,null));};exports[_0x7a3b('0x4c')]=function(_0x57b1f4,_0x2603be){return db[_0x7a3b('0x46')][_0x7a3b('0x4c')](_0x57b1f4['body'],{})['then'](respondWithResult(_0x2603be,0xc9))[_0x7a3b('0x4b')](handleError(_0x2603be,null));};exports['update']=function(_0x2b9183,_0x17259c){if(_0x2b9183[_0x7a3b('0x4d')]['id']){delete _0x2b9183[_0x7a3b('0x4d')]['id'];}return db['SquareMessage'][_0x7a3b('0x4a')]({'where':{'id':_0x2b9183[_0x7a3b('0x49')]['id']}})['then'](handleEntityNotFound(_0x17259c,null))['then'](saveUpdates(_0x2b9183[_0x7a3b('0x4d')],null))['then'](respondWithResult(_0x17259c,null))[_0x7a3b('0x4b')](handleError(_0x17259c,null));};exports[_0x7a3b('0x29')]=function(_0x501fbe,_0x580bfb){return db[_0x7a3b('0x46')]['find']({'where':{'id':_0x501fbe[_0x7a3b('0x49')]['id']}})[_0x7a3b('0x2a')](handleEntityNotFound(_0x580bfb,null))['then'](removeEntity(_0x580bfb,null))[_0x7a3b('0x4b')](handleError(_0x580bfb,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 75ad896..9caf4b9 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 _0x638f=['./squareMessage.attributes','define','SquareMessage','square_messages','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x638f,0x158));var _0xf638=function(_0x102914,_0x14a7fa){_0x102914=_0x102914-0x0;var _0x2dc143=_0x638f[_0x102914];return _0x2dc143;};'use strict';var _=require('lodash');var util=require(_0xf638('0x0'));var logger=require(_0xf638('0x1'))(_0xf638('0x2'));var moment=require(_0xf638('0x3'));var BPromise=require(_0xf638('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf638('0x5'));var attributes=require(_0xf638('0x6'));module['exports']=function(_0x5b7b42,_0x58ab47){return _0x5b7b42[_0xf638('0x7')](_0xf638('0x8'),attributes,{'tableName':_0xf638('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ea2=['../../config/environment','./squareMessage.attributes','define','SquareMessage','lodash','api','moment','request-promise','path','rimraf'];(function(_0x458746,_0x2b3d5c){var _0x3b46a9=function(_0x43c394){while(--_0x43c394){_0x458746['push'](_0x458746['shift']());}};_0x3b46a9(++_0x2b3d5c);}(_0x7ea2,0x14e));var _0x27ea=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x7ea2[_0x22dac7];return _0x3e6cfa;};'use strict';var _=require(_0x27ea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x27ea('0x1'));var moment=require(_0x27ea('0x2'));var BPromise=require('bluebird');var rp=require(_0x27ea('0x3'));var fs=require('fs');var path=require(_0x27ea('0x4'));var rimraf=require(_0x27ea('0x5'));var config=require(_0x27ea('0x6'));var attributes=require(_0x27ea('0x7'));module['exports']=function(_0x468081,_0x47bd56){return _0x468081[_0x27ea('0x8')](_0x27ea('0x9'),attributes,{'tableName':'square_messages','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 1904244..599a098 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 _0x8027=['rpc','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf44fe5,_0x2e3d10){var _0x2adfa1=function(_0x562db4){while(--_0x562db4){_0xf44fe5['push'](_0xf44fe5['shift']());}};_0x2adfa1(++_0x2e3d10);}(_0x8027,0xc9));var _0x7802=function(_0x35b5e3,_0xa50391){_0x35b5e3=_0x35b5e3-0x0;var _0x3a7cff=_0x8027[_0x35b5e3];return _0x3a7cff;};'use strict';var _=require(_0x7802('0x0'));var util=require(_0x7802('0x1'));var moment=require(_0x7802('0x2'));var BPromise=require(_0x7802('0x3'));var rs=require(_0x7802('0x4'));var fs=require('fs');var Redis=require(_0x7802('0x5'));var db=require(_0x7802('0x6'))['db'];var utils=require(_0x7802('0x7'));var logger=require(_0x7802('0x8'))(_0x7802('0x9'));var config=require(_0x7802('0xa'));var jayson=require(_0x7802('0xb'));var client=jayson['client'][_0x7802('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x314910,_0x458ca7,_0x5242ab){return new BPromise(function(_0x518239,_0x55dc72){return client[_0x7802('0xd')](_0x314910,_0x5242ab)[_0x7802('0xe')](function(_0x2f93af){logger[_0x7802('0xf')](_0x7802('0x10'),_0x458ca7,_0x7802('0x11'));logger[_0x7802('0x12')](_0x7802('0x13'),_0x458ca7,'request\x20sent',JSON['stringify'](_0x2f93af));if(_0x2f93af[_0x7802('0x14')]){if(_0x2f93af[_0x7802('0x14')][_0x7802('0x15')]===0x1f4){logger[_0x7802('0x14')](_0x7802('0x10'),_0x458ca7,_0x2f93af[_0x7802('0x14')][_0x7802('0x16')]);return _0x55dc72(_0x2f93af[_0x7802('0x14')][_0x7802('0x16')]);}logger[_0x7802('0x14')](_0x7802('0x10'),_0x458ca7,_0x2f93af['error']['message']);return _0x518239(_0x2f93af[_0x7802('0x14')][_0x7802('0x16')]);}else{logger[_0x7802('0xf')]('SquareMessage,\x20%s,\x20%s',_0x458ca7,_0x7802('0x11'));_0x518239(_0x2f93af['result'][_0x7802('0x16')]);}})[_0x7802('0x17')](function(_0x4bd8a6){logger['error'](_0x7802('0x10'),_0x458ca7,_0x4bd8a6);_0x55dc72(_0x4bd8a6);});});}exports[_0x7802('0x18')]=function(_0x5877d5){var _0x6e6719=this;return new Promise(function(_0xcb926f,_0x4b1525){return db['SquareMessage'][_0x7802('0x19')](_0x5877d5[_0x7802('0x1a')],{'raw':_0x5877d5[_0x7802('0x1b')]?_0x5877d5[_0x7802('0x1b')][_0x7802('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x451308){logger[_0x7802('0xf')]('CreateSquareMessage',_0x5877d5);logger[_0x7802('0x12')](_0x7802('0x18'),_0x5877d5,JSON[_0x7802('0x1d')](_0x451308));_0xcb926f(_0x451308);})['catch'](function(_0x40423f){logger['error'](_0x7802('0x18'),_0x40423f[_0x7802('0x16')],_0x5877d5);_0x4b1525(_0x6e6719[_0x7802('0x14')](0x1f4,_0x40423f[_0x7802('0x16')]));});});}; \ No newline at end of file +var _0x7a04=['jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','body','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0xbd4a6e,_0xc68eb6){var _0x1fe91d=function(_0x571615){while(--_0x571615){_0xbd4a6e['push'](_0xbd4a6e['shift']());}};_0x1fe91d(++_0xc68eb6);}(_0x7a04,0x89));var _0x47a0=function(_0x1a9b71,_0x351a1e){_0x1a9b71=_0x1a9b71-0x0;var _0x1119cf=_0x7a04[_0x1a9b71];return _0x1119cf;};'use strict';var _=require(_0x47a0('0x0'));var util=require(_0x47a0('0x1'));var moment=require('moment');var BPromise=require(_0x47a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x47a0('0x4'))(_0x47a0('0x5'));var config=require(_0x47a0('0x6'));var jayson=require(_0x47a0('0x7'));var client=jayson['client'][_0x47a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a3135,_0x231ff6,_0x1483f4){return new BPromise(function(_0x3c7af2,_0xea42a7){return client[_0x47a0('0x9')](_0x3a3135,_0x1483f4)[_0x47a0('0xa')](function(_0x5eaec9){logger[_0x47a0('0xb')](_0x47a0('0xc'),_0x231ff6,_0x47a0('0xd'));logger['debug'](_0x47a0('0xe'),_0x231ff6,'request\x20sent',JSON[_0x47a0('0xf')](_0x5eaec9));if(_0x5eaec9['error']){if(_0x5eaec9[_0x47a0('0x10')][_0x47a0('0x11')]===0x1f4){logger[_0x47a0('0x10')](_0x47a0('0xc'),_0x231ff6,_0x5eaec9[_0x47a0('0x10')][_0x47a0('0x12')]);return _0xea42a7(_0x5eaec9[_0x47a0('0x10')][_0x47a0('0x12')]);}logger[_0x47a0('0x10')]('SquareMessage,\x20%s,\x20%s',_0x231ff6,_0x5eaec9[_0x47a0('0x10')][_0x47a0('0x12')]);return _0x3c7af2(_0x5eaec9[_0x47a0('0x10')][_0x47a0('0x12')]);}else{logger[_0x47a0('0xb')](_0x47a0('0xc'),_0x231ff6,_0x47a0('0xd'));_0x3c7af2(_0x5eaec9[_0x47a0('0x13')][_0x47a0('0x12')]);}})[_0x47a0('0x14')](function(_0x20569c){logger[_0x47a0('0x10')](_0x47a0('0xc'),_0x231ff6,_0x20569c);_0xea42a7(_0x20569c);});});}exports[_0x47a0('0x15')]=function(_0x22aa9d){var _0x26242b=this;return new Promise(function(_0x433c9f,_0x317b24){return db[_0x47a0('0x16')]['create'](_0x22aa9d[_0x47a0('0x17')],{'raw':_0x22aa9d['options']?_0x22aa9d['options']['raw']===undefined?!![]:![]:!![]})[_0x47a0('0xa')](function(_0x56a3f2){logger[_0x47a0('0xb')](_0x47a0('0x15'),_0x22aa9d);logger['debug'](_0x47a0('0x15'),_0x22aa9d,JSON[_0x47a0('0xf')](_0x56a3f2));_0x433c9f(_0x56a3f2);})[_0x47a0('0x14')](function(_0x1e9f2e){logger[_0x47a0('0x10')](_0x47a0('0x15'),_0x1e9f2e[_0x47a0('0x12')],_0x22aa9d);_0x317b24(_0x26242b[_0x47a0('0x10')](0x1f4,_0x1e9f2e[_0x47a0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 82a64ae..e394e7d 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 _0xeeef=['get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0xeeef,0x9e));var _0xfeee=function(_0x3ae819,_0x44e568){_0x3ae819=_0x3ae819-0x0;var _0x34d4c4=_0xeeef[_0x3ae819];return _0x34d4c4;};'use strict';var multer=require(_0xfeee('0x0'));var util=require('util');var path=require(_0xfeee('0x1'));var timeout=require(_0xfeee('0x2'));var express=require(_0xfeee('0x3'));var router=express[_0xfeee('0x4')]();var fs_extra=require(_0xfeee('0x5'));var auth=require(_0xfeee('0x6'));var interaction=require(_0xfeee('0x7'));var config=require(_0xfeee('0x8'));var controller=require(_0xfeee('0x9'));router[_0xfeee('0xa')]('/',auth[_0xfeee('0xb')](),controller[_0xfeee('0xc')]);router[_0xfeee('0xa')](_0xfeee('0xd'),auth[_0xfeee('0xb')](),controller[_0xfeee('0xe')]);router[_0xfeee('0xa')](_0xfeee('0xf'),auth['isAuthenticated'](),timeout(_0xfeee('0x10')),controller[_0xfeee('0x11')]);router[_0xfeee('0x12')]('/',auth[_0xfeee('0xb')](),controller[_0xfeee('0x13')]);router[_0xfeee('0x14')](_0xfeee('0xd'),auth[_0xfeee('0xb')](),controller[_0xfeee('0x15')]);router['delete']('/:id',auth[_0xfeee('0xb')](),controller[_0xfeee('0x16')]);module[_0xfeee('0x17')]=router; \ No newline at end of file +var _0x679c=['post','create','put','update','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','15s','test'];(function(_0x163d42,_0x3cabea){var _0x59186c=function(_0x139ab9){while(--_0x139ab9){_0x163d42['push'](_0x163d42['shift']());}};_0x59186c(++_0x3cabea);}(_0x679c,0x94));var _0xc679=function(_0x2dd97b,_0x2fe831){_0x2dd97b=_0x2dd97b-0x0;var _0x466b2e=_0x679c[_0x2dd97b];return _0x466b2e;};'use strict';var multer=require(_0xc679('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc679('0x1'));var express=require('express');var router=express[_0xc679('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc679('0x3'));var config=require(_0xc679('0x4'));var controller=require(_0xc679('0x5'));router['get']('/',auth[_0xc679('0x6')](),controller[_0xc679('0x7')]);router[_0xc679('0x8')](_0xc679('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xc679('0x8')]('/:id/test',auth[_0xc679('0x6')](),timeout(_0xc679('0xa')),controller[_0xc679('0xb')]);router[_0xc679('0xc')]('/',auth[_0xc679('0x6')](),controller[_0xc679('0xd')]);router[_0xc679('0xe')](_0xc679('0x9'),auth[_0xc679('0x6')](),controller[_0xc679('0xf')]);router['delete']('/:id',auth[_0xc679('0x6')](),controller['destroy']);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 b03f8d9..2a77764 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 _0x47c3=['sequelize','STRING','name'];(function(_0xff8e6b,_0x5c8026){var _0x5a5dca=function(_0x350275){while(--_0x350275){_0xff8e6b['push'](_0xff8e6b['shift']());}};_0x5a5dca(++_0x5c8026);}(_0x47c3,0x132));var _0x347c=function(_0x2fff20,_0x11d4b7){_0x2fff20=_0x2fff20-0x0;var _0x124a21=_0x47c3[_0x2fff20];return _0x124a21;};'use strict';var Sequelize=require(_0x347c('0x0'));module['exports']={'name':{'type':Sequelize[_0x347c('0x1')],'unique':_0x347c('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb8fa=['exports','STRING','sequelize'];(function(_0x58af8b,_0x1071c6){var _0xc74d26=function(_0x232e4b){while(--_0x232e4b){_0x58af8b['push'](_0x58af8b['shift']());}};_0xc74d26(++_0x1071c6);}(_0xb8fa,0x17f));var _0xab8f=function(_0x25cc00,_0x374931){_0x25cc00=_0x25cc00-0x0;var _0x24e7b1=_0xb8fa[_0x25cc00];return _0x24e7b1;};'use strict';var Sequelize=require(_0xab8f('0x0'));module[_0xab8f('0x1')]={'name':{'type':Sequelize[_0xab8f('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xab8f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 92f4a80..e22deec 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 _0xe87e=['pick','filter','options','includeAll','findAll','show','length','include','merge','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','params','body','test','dsn','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','destroy','then','get','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','order','sort','where'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe87e,0x168));var _0xee87=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xe87e[_0x525af9];return _0x129fbf;};'use strict';var emlformat=require(_0xee87('0x0'));var rimraf=require(_0xee87('0x1'));var zipdir=require(_0xee87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee87('0x3'));var moment=require(_0xee87('0x4'));var BPromise=require(_0xee87('0x5'));var Mustache=require(_0xee87('0x6'));var util=require(_0xee87('0x7'));var path=require(_0xee87('0x8'));var sox=require('sox');var csv=require(_0xee87('0x9'));var ejs=require(_0xee87('0xa'));var fs=require('fs');var fs_extra=require(_0xee87('0xb'));var _=require(_0xee87('0xc'));var squel=require(_0xee87('0xd'));var crypto=require(_0xee87('0xe'));var jsforce=require(_0xee87('0xf'));var deskjs=require(_0xee87('0x10'));var toCsv=require(_0xee87('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xee87('0x11'));var authService=require(_0xee87('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xee87('0x13'));var hardwareService=require(_0xee87('0x14'));var logger=require(_0xee87('0x15'))(_0xee87('0x16'));var utils=require(_0xee87('0x17'));var config=require(_0xee87('0x18'));var licenseUtil=require(_0xee87('0x19'));var db=require(_0xee87('0x1a'))['db'];function respondWithStatusCode(_0xff19b,_0x280b79){_0x280b79=_0x280b79||0xcc;return function(_0x22c1d2){if(_0x22c1d2){return _0xff19b['sendStatus'](_0x280b79);}return _0xff19b[_0xee87('0x1b')](_0x280b79)[_0xee87('0x1c')]();};}function respondWithResult(_0x226eda,_0xfe2603){_0xfe2603=_0xfe2603||0xc8;return function(_0x65f65d){if(_0x65f65d){return _0x226eda['status'](_0xfe2603)[_0xee87('0x1d')](_0x65f65d);}};}function respondWithFilteredResult(_0x306441,_0x12b05b){return function(_0x138f16){if(_0x138f16){var _0x3a21c7=typeof _0x12b05b[_0xee87('0x1e')]===_0xee87('0x1f')&&typeof _0x12b05b[_0xee87('0x20')]===_0xee87('0x1f');var _0x1b087b=_0x138f16[_0xee87('0x21')];var _0x3f79ef=_0x3a21c7?0x0:_0x12b05b[_0xee87('0x1e')];var _0x5316b3=_0x3a21c7?_0x138f16[_0xee87('0x21')]:_0x12b05b['offset']+_0x12b05b['limit'];var _0x1fb6eb;if(_0x5316b3>=_0x1b087b){_0x5316b3=_0x1b087b;_0x1fb6eb=0xc8;}else{_0x1fb6eb=0xce;}_0x306441['status'](_0x1fb6eb);return _0x306441['set']('Content-Range',_0x3f79ef+'-'+_0x5316b3+'/'+_0x1b087b)['json'](_0x138f16);}return null;};}function patchUpdates(_0x43a6e6){return function(_0x40f0cd){try{jsonpatch[_0xee87('0x22')](_0x40f0cd,_0x43a6e6,!![]);}catch(_0xa55aa9){return BPromise['reject'](_0xa55aa9);}return _0x40f0cd['save']();};}function saveUpdates(_0x170042,_0x3e0dc8){return function(_0x189598){if(_0x189598){return _0x189598['update'](_0x170042)['then'](function(_0x451f80){return _0x451f80;});}return null;};}function removeEntity(_0x531470,_0x36bcba){return function(_0xec7a77){if(_0xec7a77){return _0xec7a77[_0xee87('0x23')]()[_0xee87('0x24')](function(){var _0x3d29e6=_0xec7a77[_0xee87('0x25')]({'plain':!![]});var _0x29a6d5=_0xee87('0x26');return db[_0xee87('0x27')][_0xee87('0x23')]({'where':{'type':_0x29a6d5,'resourceId':_0x3d29e6['id']}})[_0xee87('0x24')](function(){return _0xec7a77;});})['then'](function(){_0x531470[_0xee87('0x1b')](0xcc)[_0xee87('0x1c')]();});}};}function handleEntityNotFound(_0x249a3c,_0x22a73a){return function(_0x3f9a08){if(!_0x3f9a08){_0x249a3c['sendStatus'](0x194);}return _0x3f9a08;};}function handleError(_0x4b3564,_0x4a439d){_0x4a439d=_0x4a439d||0x1f4;return function(_0x3d2fe2){logger[_0xee87('0x28')](_0x3d2fe2[_0xee87('0x29')]);if(_0x3d2fe2[_0xee87('0x2a')]){delete _0x3d2fe2['name'];}_0x4b3564[_0xee87('0x1b')](_0x4a439d)[_0xee87('0x2b')](_0x3d2fe2);};}exports['index']=function(_0x3532a5,_0x41ca4a){var _0x55ddd7={},_0x3a140e={},_0x182241={'count':0x0,'rows':[]};var _0xa6ee1d=_[_0xee87('0x2c')](db[_0xee87('0x2d')][_0xee87('0x2e')],function(_0x3ed73f){return{'name':_0x3ed73f[_0xee87('0x2f')],'type':_0x3ed73f[_0xee87('0x30')][_0xee87('0x31')]};});_0x3a140e[_0xee87('0x32')]=_['map'](_0xa6ee1d,'name');_0x3a140e['query']=_[_0xee87('0x33')](_0x3532a5[_0xee87('0x34')]);_0x3a140e[_0xee87('0x35')]=_['intersection'](_0x3a140e['model'],_0x3a140e[_0xee87('0x34')]);_0x55ddd7[_0xee87('0x36')]=_[_0xee87('0x37')](_0x3a140e[_0xee87('0x32')],qs[_0xee87('0x38')](_0x3532a5[_0xee87('0x34')][_0xee87('0x38')]));_0x55ddd7[_0xee87('0x36')]=_0x55ddd7[_0xee87('0x36')]['length']?_0x55ddd7[_0xee87('0x36')]:_0x3a140e[_0xee87('0x32')];if(!_0x3532a5[_0xee87('0x34')]['hasOwnProperty']('nolimit')){_0x55ddd7[_0xee87('0x20')]=qs['limit'](_0x3532a5['query'][_0xee87('0x20')]);_0x55ddd7[_0xee87('0x1e')]=qs[_0xee87('0x1e')](_0x3532a5[_0xee87('0x34')][_0xee87('0x1e')]);}_0x55ddd7[_0xee87('0x39')]=qs[_0xee87('0x3a')](_0x3532a5[_0xee87('0x34')][_0xee87('0x3a')]);_0x55ddd7[_0xee87('0x3b')]=qs[_0xee87('0x35')](_[_0xee87('0x3c')](_0x3532a5[_0xee87('0x34')],_0x3a140e[_0xee87('0x35')]),_0xa6ee1d);if(_0x3532a5[_0xee87('0x34')][_0xee87('0x3d')]){_0x55ddd7[_0xee87('0x3b')]=_['merge'](_0x55ddd7['where'],{'$or':_[_0xee87('0x2c')](_0xa6ee1d,function(_0x967433){if(_0x967433[_0xee87('0x30')]!=='VIRTUAL'){var _0xa1a18a={};_0xa1a18a[_0x967433[_0xee87('0x2a')]]={'$like':'%'+_0x3532a5[_0xee87('0x34')][_0xee87('0x3d')]+'%'};return _0xa1a18a;}})});}_0x55ddd7=_['merge']({},_0x55ddd7,_0x3532a5[_0xee87('0x3e')]);var _0x140766={'where':_0x55ddd7['where']};return db[_0xee87('0x2d')][_0xee87('0x21')](_0x140766)['then'](function(_0x1c45b8){_0x182241[_0xee87('0x21')]=_0x1c45b8;if(_0x3532a5['query'][_0xee87('0x3f')]){_0x55ddd7['include']=[{'all':!![]}];}return db[_0xee87('0x2d')][_0xee87('0x40')](_0x55ddd7);})['then'](function(_0x30c012){_0x182241['rows']=_0x30c012;return _0x182241;})[_0xee87('0x24')](respondWithFilteredResult(_0x41ca4a,_0x55ddd7))['catch'](handleError(_0x41ca4a,null));};exports[_0xee87('0x41')]=function(_0x139747,_0x1e18c4){var _0x1543fb={'raw':!![],'where':{'id':_0x139747['params']['id']}},_0x5d7c45={};_0x5d7c45['model']=_[_0xee87('0x33')](db[_0xee87('0x2d')][_0xee87('0x2e')]);_0x5d7c45['query']=_[_0xee87('0x33')](_0x139747['query']);_0x5d7c45['filters']=_[_0xee87('0x37')](_0x5d7c45['model'],_0x5d7c45[_0xee87('0x34')]);_0x1543fb['attributes']=_[_0xee87('0x37')](_0x5d7c45[_0xee87('0x32')],qs[_0xee87('0x38')](_0x139747[_0xee87('0x34')][_0xee87('0x38')]));_0x1543fb[_0xee87('0x36')]=_0x1543fb['attributes'][_0xee87('0x42')]?_0x1543fb[_0xee87('0x36')]:_0x5d7c45[_0xee87('0x32')];if(_0x139747[_0xee87('0x34')][_0xee87('0x3f')]){_0x1543fb[_0xee87('0x43')]=[{'all':!![]}];}_0x1543fb=_[_0xee87('0x44')]({},_0x1543fb,_0x139747[_0xee87('0x3e')]);return db[_0xee87('0x2d')][_0xee87('0x45')](_0x1543fb)[_0xee87('0x24')](handleEntityNotFound(_0x1e18c4,null))[_0xee87('0x24')](respondWithResult(_0x1e18c4,null))['catch'](handleError(_0x1e18c4,null));};exports[_0xee87('0x46')]=function(_0x190b5e,_0x1ee60e){return db['SquareOdbc'][_0xee87('0x46')](_0x190b5e['body'],{})['then'](function(_0x11e4e9){var _0x32fdf1=_0x190b5e[_0xee87('0x47')][_0xee87('0x25')]({'plain':!![]});if(!_0x32fdf1)throw new Error(_0xee87('0x48'));if(_0x32fdf1[_0xee87('0x49')]===_0xee87('0x47')){var _0x2bcff1=_0x11e4e9['get']({'plain':!![]});var _0x44a48b=_0xee87('0x26');return db[_0xee87('0x4a')][_0xee87('0x45')]({'where':{'name':_0x44a48b,'userProfileId':_0x32fdf1[_0xee87('0x4b')]},'raw':!![]})['then'](function(_0x13402b){if(_0x13402b&&_0x13402b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2bcff1['name'],'resourceId':_0x2bcff1['id'],'type':_0x13402b[_0xee87('0x2a')],'sectionId':_0x13402b['id']},{})[_0xee87('0x24')](function(){return _0x11e4e9;});}else{return _0x11e4e9;}})[_0xee87('0x4c')](function(_0x3ba94e){logger['error'](_0xee87('0x4d'),_0x3ba94e);throw _0x3ba94e;});}return _0x11e4e9;})[_0xee87('0x24')](respondWithResult(_0x1ee60e,0xc9))['catch'](handleError(_0x1ee60e,null));};exports[_0xee87('0x4e')]=function(_0x294183,_0x147549){if(_0x294183['body']['id']){delete _0x294183['body']['id'];}return db[_0xee87('0x2d')][_0xee87('0x45')]({'where':{'id':_0x294183[_0xee87('0x4f')]['id']}})[_0xee87('0x24')](handleEntityNotFound(_0x147549,null))[_0xee87('0x24')](saveUpdates(_0x294183[_0xee87('0x50')],null))[_0xee87('0x24')](respondWithResult(_0x147549,null))[_0xee87('0x4c')](handleError(_0x147549,null));};exports[_0xee87('0x23')]=function(_0xa29f91,_0x4ecef5){return db[_0xee87('0x2d')][_0xee87('0x45')]({'where':{'id':_0xa29f91[_0xee87('0x4f')]['id']}})[_0xee87('0x24')](handleEntityNotFound(_0x4ecef5,null))[_0xee87('0x24')](removeEntity(_0x4ecef5,null))[_0xee87('0x4c')](handleError(_0x4ecef5,null));};exports[_0xee87('0x51')]=function(_0x5c6038,_0x2e6557,_0x5d3373){var _0x35b775;return db[_0xee87('0x2d')][_0xee87('0x45')]({'where':{'id':_0x5c6038[_0xee87('0x4f')]['id']},'attributes':['id',_0xee87('0x52')]})[_0xee87('0x24')](handleEntityNotFound(_0x2e6557,null))[_0xee87('0x24')](function(_0x11d9b7){if(_0x11d9b7){var _0xa87f1e=require('odbc')();_0xa87f1e['openSync'](_0x11d9b7[_0xee87('0x52')]);_0xa87f1e[_0xee87('0x53')]();return _0x11d9b7;}})[_0xee87('0x24')](respondWithResult(_0x2e6557,null))[_0xee87('0x4c')](handleError(_0x2e6557,null));}; \ No newline at end of file +var _0x99d2=['rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','dsn','odbc','openSync','closeSync','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc'];(function(_0x217286,_0x461070){var _0x186ff2=function(_0x397f0c){while(--_0x397f0c){_0x217286['push'](_0x217286['shift']());}};_0x186ff2(++_0x461070);}(_0x99d2,0xca));var _0x299d=function(_0x539592,_0x33f256){_0x539592=_0x539592-0x0;var _0x2793c3=_0x99d2[_0x539592];return _0x2793c3;};'use strict';var emlformat=require(_0x299d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x299d('0x1'));var moment=require(_0x299d('0x2'));var BPromise=require(_0x299d('0x3'));var Mustache=require(_0x299d('0x4'));var util=require(_0x299d('0x5'));var path=require(_0x299d('0x6'));var sox=require(_0x299d('0x7'));var csv=require(_0x299d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x299d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x299d('0xa'));var jsforce=require(_0x299d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x299d('0x8'));var querystring=require(_0x299d('0xc'));var Papa=require(_0x299d('0xd'));var Redis=require('ioredis');var authService=require(_0x299d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x299d('0xf'));var hardwareService=require(_0x299d('0x10'));var logger=require('../../config/logger')(_0x299d('0x11'));var utils=require(_0x299d('0x12'));var config=require(_0x299d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x299d('0x14'))['db'];function respondWithStatusCode(_0x596b38,_0x4f13d6){_0x4f13d6=_0x4f13d6||0xcc;return function(_0x255ee0){if(_0x255ee0){return _0x596b38['sendStatus'](_0x4f13d6);}return _0x596b38[_0x299d('0x15')](_0x4f13d6)[_0x299d('0x16')]();};}function respondWithResult(_0x2f8085,_0x3748db){_0x3748db=_0x3748db||0xc8;return function(_0x49f821){if(_0x49f821){return _0x2f8085['status'](_0x3748db)[_0x299d('0x17')](_0x49f821);}};}function respondWithFilteredResult(_0x4bec57,_0x1183af){return function(_0x1ae1dd){if(_0x1ae1dd){var _0x44b6a7=typeof _0x1183af[_0x299d('0x18')]===_0x299d('0x19')&&typeof _0x1183af['limit']===_0x299d('0x19');var _0x31cc3d=_0x1ae1dd['count'];var _0x589685=_0x44b6a7?0x0:_0x1183af['offset'];var _0xc384cc=_0x44b6a7?_0x1ae1dd[_0x299d('0x1a')]:_0x1183af[_0x299d('0x18')]+_0x1183af[_0x299d('0x1b')];var _0x43a48f;if(_0xc384cc>=_0x31cc3d){_0xc384cc=_0x31cc3d;_0x43a48f=0xc8;}else{_0x43a48f=0xce;}_0x4bec57['status'](_0x43a48f);return _0x4bec57[_0x299d('0x1c')](_0x299d('0x1d'),_0x589685+'-'+_0xc384cc+'/'+_0x31cc3d)[_0x299d('0x17')](_0x1ae1dd);}return null;};}function patchUpdates(_0x4f143d){return function(_0x4fc0d9){try{jsonpatch['apply'](_0x4fc0d9,_0x4f143d,!![]);}catch(_0xd7c761){return BPromise[_0x299d('0x1e')](_0xd7c761);}return _0x4fc0d9['save']();};}function saveUpdates(_0x89a230,_0x1c714c){return function(_0x2c4983){if(_0x2c4983){return _0x2c4983[_0x299d('0x1f')](_0x89a230)[_0x299d('0x20')](function(_0x8b1d69){return _0x8b1d69;});}return null;};}function removeEntity(_0x383eb2,_0x5f10a4){return function(_0x4c8139){if(_0x4c8139){return _0x4c8139[_0x299d('0x21')]()[_0x299d('0x20')](function(){var _0x5cfd90=_0x4c8139[_0x299d('0x22')]({'plain':!![]});var _0x5a4c04=_0x299d('0x23');return db[_0x299d('0x24')][_0x299d('0x21')]({'where':{'type':_0x5a4c04,'resourceId':_0x5cfd90['id']}})['then'](function(){return _0x4c8139;});})[_0x299d('0x20')](function(){_0x383eb2[_0x299d('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54ecc4,_0x5df8a9){return function(_0x1cbede){if(!_0x1cbede){_0x54ecc4['sendStatus'](0x194);}return _0x1cbede;};}function handleError(_0x1e27b9,_0x20fa0a){_0x20fa0a=_0x20fa0a||0x1f4;return function(_0x1da935){logger[_0x299d('0x25')](_0x1da935[_0x299d('0x26')]);if(_0x1da935['name']){delete _0x1da935[_0x299d('0x27')];}_0x1e27b9[_0x299d('0x15')](_0x20fa0a)[_0x299d('0x28')](_0x1da935);};}exports[_0x299d('0x29')]=function(_0x65b1e7,_0x2b121b){var _0xae6fc={},_0x16f60e={},_0x3c3dbd={'count':0x0,'rows':[]};var _0x59af26=_[_0x299d('0x2a')](db[_0x299d('0x2b')][_0x299d('0x2c')],function(_0x1b576c){return{'name':_0x1b576c[_0x299d('0x2d')],'type':_0x1b576c['type'][_0x299d('0x2e')]};});_0x16f60e[_0x299d('0x2f')]=_['map'](_0x59af26,_0x299d('0x27'));_0x16f60e['query']=_[_0x299d('0x30')](_0x65b1e7['query']);_0x16f60e[_0x299d('0x31')]=_[_0x299d('0x32')](_0x16f60e[_0x299d('0x2f')],_0x16f60e[_0x299d('0x33')]);_0xae6fc[_0x299d('0x34')]=_[_0x299d('0x32')](_0x16f60e[_0x299d('0x2f')],qs[_0x299d('0x35')](_0x65b1e7[_0x299d('0x33')][_0x299d('0x35')]));_0xae6fc[_0x299d('0x34')]=_0xae6fc[_0x299d('0x34')][_0x299d('0x36')]?_0xae6fc['attributes']:_0x16f60e[_0x299d('0x2f')];if(!_0x65b1e7[_0x299d('0x33')][_0x299d('0x37')](_0x299d('0x38'))){_0xae6fc[_0x299d('0x1b')]=qs[_0x299d('0x1b')](_0x65b1e7[_0x299d('0x33')][_0x299d('0x1b')]);_0xae6fc['offset']=qs[_0x299d('0x18')](_0x65b1e7['query'][_0x299d('0x18')]);}_0xae6fc[_0x299d('0x39')]=qs[_0x299d('0x3a')](_0x65b1e7['query'][_0x299d('0x3a')]);_0xae6fc[_0x299d('0x3b')]=qs[_0x299d('0x31')](_[_0x299d('0x3c')](_0x65b1e7[_0x299d('0x33')],_0x16f60e[_0x299d('0x31')]),_0x59af26);if(_0x65b1e7[_0x299d('0x33')][_0x299d('0x3d')]){_0xae6fc[_0x299d('0x3b')]=_[_0x299d('0x3e')](_0xae6fc['where'],{'$or':_['map'](_0x59af26,function(_0x579900){if(_0x579900[_0x299d('0x3f')]!==_0x299d('0x40')){var _0x56174e={};_0x56174e[_0x579900['name']]={'$like':'%'+_0x65b1e7[_0x299d('0x33')][_0x299d('0x3d')]+'%'};return _0x56174e;}})});}_0xae6fc=_[_0x299d('0x3e')]({},_0xae6fc,_0x65b1e7['options']);var _0x5b4354={'where':_0xae6fc[_0x299d('0x3b')]};return db[_0x299d('0x2b')][_0x299d('0x1a')](_0x5b4354)[_0x299d('0x20')](function(_0x3f2c53){_0x3c3dbd[_0x299d('0x1a')]=_0x3f2c53;if(_0x65b1e7['query'][_0x299d('0x41')]){_0xae6fc['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x299d('0x42')](_0xae6fc);})[_0x299d('0x20')](function(_0x5f1737){_0x3c3dbd[_0x299d('0x43')]=_0x5f1737;return _0x3c3dbd;})[_0x299d('0x20')](respondWithFilteredResult(_0x2b121b,_0xae6fc))['catch'](handleError(_0x2b121b,null));};exports['show']=function(_0xa9962b,_0x5229d8){var _0x341d2c={'raw':!![],'where':{'id':_0xa9962b['params']['id']}},_0x582250={};_0x582250[_0x299d('0x2f')]=_[_0x299d('0x30')](db[_0x299d('0x2b')][_0x299d('0x2c')]);_0x582250['query']=_[_0x299d('0x30')](_0xa9962b['query']);_0x582250['filters']=_['intersection'](_0x582250[_0x299d('0x2f')],_0x582250['query']);_0x341d2c[_0x299d('0x34')]=_[_0x299d('0x32')](_0x582250[_0x299d('0x2f')],qs[_0x299d('0x35')](_0xa9962b[_0x299d('0x33')][_0x299d('0x35')]));_0x341d2c[_0x299d('0x34')]=_0x341d2c[_0x299d('0x34')]['length']?_0x341d2c['attributes']:_0x582250[_0x299d('0x2f')];if(_0xa9962b[_0x299d('0x33')][_0x299d('0x41')]){_0x341d2c[_0x299d('0x44')]=[{'all':!![]}];}_0x341d2c=_[_0x299d('0x3e')]({},_0x341d2c,_0xa9962b['options']);return db['SquareOdbc'][_0x299d('0x45')](_0x341d2c)[_0x299d('0x20')](handleEntityNotFound(_0x5229d8,null))['then'](respondWithResult(_0x5229d8,null))[_0x299d('0x46')](handleError(_0x5229d8,null));};exports[_0x299d('0x47')]=function(_0x30153e,_0x509539){return db[_0x299d('0x2b')][_0x299d('0x47')](_0x30153e[_0x299d('0x48')],{})[_0x299d('0x20')](function(_0xcde939){var _0x4a3d23=_0x30153e['user']['get']({'plain':!![]});if(!_0x4a3d23)throw new Error(_0x299d('0x49'));if(_0x4a3d23['role']==='user'){var _0x2c178b=_0xcde939['get']({'plain':!![]});var _0x4d2744=_0x299d('0x23');return db[_0x299d('0x4a')][_0x299d('0x45')]({'where':{'name':_0x4d2744,'userProfileId':_0x4a3d23[_0x299d('0x4b')]},'raw':!![]})[_0x299d('0x20')](function(_0x256960){if(_0x256960&&_0x256960['autoAssociation']===0x0){return db[_0x299d('0x24')][_0x299d('0x47')]({'name':_0x2c178b[_0x299d('0x27')],'resourceId':_0x2c178b['id'],'type':_0x256960[_0x299d('0x27')],'sectionId':_0x256960['id']},{})[_0x299d('0x20')](function(){return _0xcde939;});}else{return _0xcde939;}})[_0x299d('0x46')](function(_0x3081d2){logger[_0x299d('0x25')](_0x299d('0x4c'),_0x3081d2);throw _0x3081d2;});}return _0xcde939;})[_0x299d('0x20')](respondWithResult(_0x509539,0xc9))[_0x299d('0x46')](handleError(_0x509539,null));};exports[_0x299d('0x1f')]=function(_0x569122,_0x3515c1){if(_0x569122['body']['id']){delete _0x569122[_0x299d('0x48')]['id'];}return db['SquareOdbc'][_0x299d('0x45')]({'where':{'id':_0x569122[_0x299d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3515c1,null))[_0x299d('0x20')](saveUpdates(_0x569122[_0x299d('0x48')],null))[_0x299d('0x20')](respondWithResult(_0x3515c1,null))['catch'](handleError(_0x3515c1,null));};exports[_0x299d('0x21')]=function(_0x575808,_0x3048fe){return db[_0x299d('0x2b')][_0x299d('0x45')]({'where':{'id':_0x575808[_0x299d('0x4d')]['id']}})[_0x299d('0x20')](handleEntityNotFound(_0x3048fe,null))['then'](removeEntity(_0x3048fe,null))[_0x299d('0x46')](handleError(_0x3048fe,null));};exports['test']=function(_0xb1b2b4,_0x36d98b,_0x130a2b){var _0x349e8e;return db[_0x299d('0x2b')]['find']({'where':{'id':_0xb1b2b4[_0x299d('0x4d')]['id']},'attributes':['id',_0x299d('0x4e')]})[_0x299d('0x20')](handleEntityNotFound(_0x36d98b,null))[_0x299d('0x20')](function(_0x41a372){if(_0x41a372){var _0x24486e=require(_0x299d('0x4f'))();_0x24486e[_0x299d('0x50')](_0x41a372[_0x299d('0x4e')]);_0x24486e[_0x299d('0x51')]();return _0x41a372;}})[_0x299d('0x20')](respondWithResult(_0x36d98b,null))[_0x299d('0x46')](handleError(_0x36d98b,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 69af800..a88fcc7 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 _0x523c=['define','SquareOdbc','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x523c,0x14c));var _0xc523=function(_0x4c8fa3,_0x107b97){_0x4c8fa3=_0x4c8fa3-0x0;var _0xded5f5=_0x523c[_0x4c8fa3];return _0xded5f5;};'use strict';var _=require(_0xc523('0x0'));var util=require(_0xc523('0x1'));var logger=require(_0xc523('0x2'))(_0xc523('0x3'));var moment=require(_0xc523('0x4'));var BPromise=require('bluebird');var rp=require(_0xc523('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc523('0x6'));var attributes=require(_0xc523('0x7'));module[_0xc523('0x8')]=function(_0xa91320,_0x5c7f4b){return _0xa91320[_0xc523('0x9')](_0xc523('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b07=['../../config/environment','define','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x288d3a,_0x3482ca){var _0x1c0b2d=function(_0x369150){while(--_0x369150){_0x288d3a['push'](_0x288d3a['shift']());}};_0x1c0b2d(++_0x3482ca);}(_0x8b07,0x6f));var _0x78b0=function(_0xd0d12a,_0x575683){_0xd0d12a=_0xd0d12a-0x0;var _0x514d07=_0x8b07[_0xd0d12a];return _0x514d07;};'use strict';var _=require(_0x78b0('0x0'));var util=require(_0x78b0('0x1'));var logger=require(_0x78b0('0x2'))(_0x78b0('0x3'));var moment=require(_0x78b0('0x4'));var BPromise=require(_0x78b0('0x5'));var rp=require(_0x78b0('0x6'));var fs=require('fs');var path=require(_0x78b0('0x7'));var rimraf=require(_0x78b0('0x8'));var config=require(_0x78b0('0x9'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x1cc8c5,_0x4ccaac){return _0x1cc8c5[_0x78b0('0xa')](_0x78b0('0xb'),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 12046ac..195c78c 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 _0x2f40=['error','message','result','catch','ShowSquareOdbc','find','options','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xfcdda0,_0x32479b){var _0x17ebe3=function(_0x5bfaa3){while(--_0x5bfaa3){_0xfcdda0['push'](_0xfcdda0['shift']());}};_0x17ebe3(++_0x32479b);}(_0x2f40,0x1e9));var _0x02f4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2f40[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x02f4('0x0'));var util=require(_0x02f4('0x1'));var moment=require(_0x02f4('0x2'));var BPromise=require(_0x02f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02f4('0x4'));var db=require(_0x02f4('0x5'))['db'];var utils=require(_0x02f4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x02f4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x02f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ba736,_0x2012f4,_0xf6264e){return new BPromise(function(_0x1d7f69,_0xe9f9d){return client['request'](_0x4ba736,_0xf6264e)[_0x02f4('0x9')](function(_0x25c45a){logger[_0x02f4('0xa')](_0x02f4('0xb'),_0x2012f4,'request\x20sent');logger[_0x02f4('0xc')](_0x02f4('0xd'),_0x2012f4,_0x02f4('0xe'),JSON['stringify'](_0x25c45a));if(_0x25c45a[_0x02f4('0xf')]){if(_0x25c45a[_0x02f4('0xf')]['code']===0x1f4){logger[_0x02f4('0xf')](_0x02f4('0xb'),_0x2012f4,_0x25c45a[_0x02f4('0xf')]['message']);return _0xe9f9d(_0x25c45a['error'][_0x02f4('0x10')]);}logger[_0x02f4('0xf')](_0x02f4('0xb'),_0x2012f4,_0x25c45a[_0x02f4('0xf')][_0x02f4('0x10')]);return _0x1d7f69(_0x25c45a[_0x02f4('0xf')][_0x02f4('0x10')]);}else{logger[_0x02f4('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x2012f4,_0x02f4('0xe'));_0x1d7f69(_0x25c45a[_0x02f4('0x11')][_0x02f4('0x10')]);}})[_0x02f4('0x12')](function(_0x543b90){logger[_0x02f4('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x2012f4,_0x543b90);_0xe9f9d(_0x543b90);});});}exports[_0x02f4('0x13')]=function(_0x19e073){var _0x358d84=this;return new Promise(function(_0x471e59,_0x4051be){return db['SquareOdbc'][_0x02f4('0x14')]({'raw':_0x19e073[_0x02f4('0x15')]?_0x19e073[_0x02f4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x19e073[_0x02f4('0x15')]?_0x19e073[_0x02f4('0x15')][_0x02f4('0x16')]||null:null,'attributes':_0x19e073[_0x02f4('0x15')]?_0x19e073[_0x02f4('0x15')][_0x02f4('0x17')]||null:null,'include':_0x19e073['options']?_0x19e073[_0x02f4('0x15')][_0x02f4('0x18')]?_['map'](_0x19e073[_0x02f4('0x15')]['include'],function(_0x26633b){return{'model':db[_0x26633b[_0x02f4('0x19')]],'as':_0x26633b['as'],'attributes':_0x26633b['attributes'],'include':_0x26633b[_0x02f4('0x18')]?_['map'](_0x26633b[_0x02f4('0x18')],function(_0x22a6c3){return{'model':db[_0x22a6c3['model']],'as':_0x22a6c3['as'],'attributes':_0x22a6c3[_0x02f4('0x17')],'include':_0x22a6c3[_0x02f4('0x18')]?_[_0x02f4('0x1a')](_0x22a6c3[_0x02f4('0x18')],function(_0x3e0994){return{'model':db[_0x3e0994[_0x02f4('0x19')]],'as':_0x3e0994['as'],'attributes':_0x3e0994['attributes']};}):[]};}):[]};}):[]:[]})[_0x02f4('0x9')](function(_0xe8fa9d){logger[_0x02f4('0xa')]('ShowSquareOdbc',_0x19e073);logger[_0x02f4('0xc')]('ShowSquareOdbc',_0x19e073,JSON[_0x02f4('0x1b')](_0xe8fa9d));_0x471e59(_0xe8fa9d);})[_0x02f4('0x12')](function(_0x2999d8){logger[_0x02f4('0xf')](_0x02f4('0x13'),_0x2999d8[_0x02f4('0x10')],_0x19e073);_0x4051be(_0x358d84[_0x02f4('0xf')](0x1f4,_0x2999d8[_0x02f4('0x10')]));});});}; \ No newline at end of file +var _0x9fd7=['message','result','ShowSquareOdbc','options','where','attributes','include','map','model','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x105080,_0x2a8b60){var _0x72b561=function(_0xefa285){while(--_0xefa285){_0x105080['push'](_0x105080['shift']());}};_0x72b561(++_0x2a8b60);}(_0x9fd7,0xd2));var _0x79fd=function(_0x2827a5,_0x287f24){_0x2827a5=_0x2827a5-0x0;var _0x5151d2=_0x9fd7[_0x2827a5];return _0x5151d2;};'use strict';var _=require(_0x79fd('0x0'));var util=require(_0x79fd('0x1'));var moment=require(_0x79fd('0x2'));var BPromise=require(_0x79fd('0x3'));var rs=require(_0x79fd('0x4'));var fs=require('fs');var Redis=require(_0x79fd('0x5'));var db=require(_0x79fd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x79fd('0x7'))(_0x79fd('0x8'));var config=require(_0x79fd('0x9'));var jayson=require(_0x79fd('0xa'));var client=jayson[_0x79fd('0xb')][_0x79fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x509bf3,_0x19972,_0x4bb145){return new BPromise(function(_0x556db0,_0x5ed701){return client[_0x79fd('0xd')](_0x509bf3,_0x4bb145)['then'](function(_0x2fb649){logger[_0x79fd('0xe')](_0x79fd('0xf'),_0x19972,_0x79fd('0x10'));logger['debug'](_0x79fd('0x11'),_0x19972,_0x79fd('0x10'),JSON[_0x79fd('0x12')](_0x2fb649));if(_0x2fb649[_0x79fd('0x13')]){if(_0x2fb649[_0x79fd('0x13')][_0x79fd('0x14')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x19972,_0x2fb649[_0x79fd('0x13')][_0x79fd('0x15')]);return _0x5ed701(_0x2fb649[_0x79fd('0x13')][_0x79fd('0x15')]);}logger[_0x79fd('0x13')](_0x79fd('0xf'),_0x19972,_0x2fb649[_0x79fd('0x13')][_0x79fd('0x15')]);return _0x556db0(_0x2fb649[_0x79fd('0x13')][_0x79fd('0x15')]);}else{logger['info'](_0x79fd('0xf'),_0x19972,_0x79fd('0x10'));_0x556db0(_0x2fb649[_0x79fd('0x16')][_0x79fd('0x15')]);}})['catch'](function(_0x184e77){logger[_0x79fd('0x13')](_0x79fd('0xf'),_0x19972,_0x184e77);_0x5ed701(_0x184e77);});});}exports[_0x79fd('0x17')]=function(_0x39cd94){var _0xc20f36=this;return new Promise(function(_0x1794dd,_0x1b54c0){return db['SquareOdbc']['find']({'raw':_0x39cd94[_0x79fd('0x18')]?_0x39cd94[_0x79fd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x39cd94['options']?_0x39cd94['options'][_0x79fd('0x19')]||null:null,'attributes':_0x39cd94['options']?_0x39cd94[_0x79fd('0x18')][_0x79fd('0x1a')]||null:null,'include':_0x39cd94[_0x79fd('0x18')]?_0x39cd94[_0x79fd('0x18')][_0x79fd('0x1b')]?_[_0x79fd('0x1c')](_0x39cd94['options'][_0x79fd('0x1b')],function(_0x5147dc){return{'model':db[_0x5147dc[_0x79fd('0x1d')]],'as':_0x5147dc['as'],'attributes':_0x5147dc[_0x79fd('0x1a')],'include':_0x5147dc['include']?_[_0x79fd('0x1c')](_0x5147dc[_0x79fd('0x1b')],function(_0x138c0c){return{'model':db[_0x138c0c[_0x79fd('0x1d')]],'as':_0x138c0c['as'],'attributes':_0x138c0c[_0x79fd('0x1a')],'include':_0x138c0c[_0x79fd('0x1b')]?_[_0x79fd('0x1c')](_0x138c0c[_0x79fd('0x1b')],function(_0x3ac324){return{'model':db[_0x3ac324[_0x79fd('0x1d')]],'as':_0x3ac324['as'],'attributes':_0x3ac324['attributes']};}):[]};}):[]};}):[]:[]})[_0x79fd('0x1e')](function(_0xe4d2cd){logger[_0x79fd('0xe')]('ShowSquareOdbc',_0x39cd94);logger[_0x79fd('0x1f')](_0x79fd('0x17'),_0x39cd94,JSON[_0x79fd('0x12')](_0xe4d2cd));_0x1794dd(_0xe4d2cd);})[_0x79fd('0x20')](function(_0x3a7b36){logger[_0x79fd('0x13')]('ShowSquareOdbc',_0x3a7b36[_0x79fd('0x15')],_0x39cd94);_0x1b54c0(_0xc20f36[_0x79fd('0x13')](0x1f4,_0x3a7b36[_0x79fd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 26999f3..3782914 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 _0x9947=['/:id','post','put','delete','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0x9947,0x104));var _0x7994=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0x9947[_0x513f27];return _0xa316b7;};'use strict';var multer=require('multer');var util=require(_0x7994('0x0'));var path=require(_0x7994('0x1'));var timeout=require('connect-timeout');var express=require(_0x7994('0x2'));var router=express[_0x7994('0x3')]();var fs_extra=require(_0x7994('0x4'));var auth=require(_0x7994('0x5'));var interaction=require(_0x7994('0x6'));var config=require(_0x7994('0x7'));var controller=require(_0x7994('0x8'));router[_0x7994('0x9')]('/',auth[_0x7994('0xa')](),controller[_0x7994('0xb')]);router['get'](_0x7994('0xc'),auth[_0x7994('0xa')](),controller['show']);router[_0x7994('0xd')]('/',auth[_0x7994('0xa')](),controller['create']);router[_0x7994('0xe')](_0x7994('0xc'),auth[_0x7994('0xa')](),controller['update']);router[_0x7994('0xf')](_0x7994('0xc'),auth[_0x7994('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x19c4=['index','/:id','show','post','create','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x19c4,0x181));var _0x419c=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x19c4[_0x2c5255];return _0x30d0ea;};'use strict';var multer=require(_0x419c('0x0'));var util=require('util');var path=require(_0x419c('0x1'));var timeout=require(_0x419c('0x2'));var express=require(_0x419c('0x3'));var router=express[_0x419c('0x4')]();var fs_extra=require(_0x419c('0x5'));var auth=require(_0x419c('0x6'));var interaction=require(_0x419c('0x7'));var config=require(_0x419c('0x8'));var controller=require(_0x419c('0x9'));router['get']('/',auth[_0x419c('0xa')](),controller[_0x419c('0xb')]);router['get'](_0x419c('0xc'),auth[_0x419c('0xa')](),controller[_0x419c('0xd')]);router[_0x419c('0xe')]('/',auth[_0x419c('0xa')](),controller[_0x419c('0xf')]);router['put'](_0x419c('0xc'),auth['isAuthenticated'](),controller[_0x419c('0x10')]);router[_0x419c('0x11')](_0x419c('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9c81638..f6dfc1d 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 _0x1bf3=['production','toString','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long','getDataValue','preproduction','utf8'];(function(_0x4f4193,_0x5ca91c){var _0x4364c8=function(_0x238d2c){while(--_0x238d2c){_0x4f4193['push'](_0x4f4193['shift']());}};_0x4364c8(++_0x5ca91c);}(_0x1bf3,0x16f));var _0x31bf=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1bf3[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x31bf('0x0'));module[_0x31bf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x31bf('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x31bf('0x3')]},'notes':{'type':Sequelize[_0x31bf('0x4')]},'preproduction':{'type':Sequelize[_0x31bf('0x5')](_0x31bf('0x6')),'get':function(){if(this[_0x31bf('0x7')](_0x31bf('0x8'))){return this[_0x31bf('0x7')]('preproduction')['toString'](_0x31bf('0x9'));}}},'production':{'type':Sequelize[_0x31bf('0x5')](_0x31bf('0x6')),'get':function(){if(this[_0x31bf('0x7')](_0x31bf('0xa'))){return this[_0x31bf('0x7')](_0x31bf('0xa'))[_0x31bf('0xb')](_0x31bf('0x9'));}}},'savedAt':{'type':Sequelize[_0x31bf('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x7753=['DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction','utf8','production','toString'];(function(_0x4522ce,_0x4a3a79){var _0x566414=function(_0x128f35){while(--_0x128f35){_0x4522ce['push'](_0x4522ce['shift']());}};_0x566414(++_0x4a3a79);}(_0x7753,0xfd));var _0x3775=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0x7753[_0x2ab365];return _0x49fef3;};'use strict';var Sequelize=require(_0x3775('0x0'));module[_0x3775('0x1')]={'name':{'type':Sequelize[_0x3775('0x2')],'unique':_0x3775('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3775('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x3775('0x4')](_0x3775('0x5')),'get':function(){if(this[_0x3775('0x6')]('preproduction')){return this[_0x3775('0x6')](_0x3775('0x7'))['toString'](_0x3775('0x8'));}}},'production':{'type':Sequelize[_0x3775('0x4')]('long'),'get':function(){if(this['getDataValue'](_0x3775('0x9'))){return this[_0x3775('0x6')](_0x3775('0x9'))[_0x3775('0xa')](_0x3775('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x3775('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 4e9d4f0..d127fa8 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 _0x3f06=['localhost','./squareProject.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','get','SquareProjects','agi','end','sendStatus','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','SquareProject','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','stringify','pick','production','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x22b2f0,_0x1c2e45){var _0x55d332=function(_0x5ae709){while(--_0x5ae709){_0x22b2f0['push'](_0x22b2f0['shift']());}};_0x55d332(++_0x1c2e45);}(_0x3f06,0x19c));var _0x63f0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3f06[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x63f0('0x0'));var Redis=require(_0x63f0('0x1'));var qs=require(_0x63f0('0x2'));var logger=require('../../config/logger')(_0x63f0('0x3'));var config=require(_0x63f0('0x4'));var db=require(_0x63f0('0x5'))['db'];config[_0x63f0('0x6')]=_[_0x63f0('0x7')](config[_0x63f0('0x6')],{'host':_0x63f0('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x63f0('0x9'))[_0x63f0('0xa')](socket);function respondWithResult(_0x46879f,_0x30ec1b){_0x30ec1b=_0x30ec1b||0xc8;return function(_0x5c4584){if(_0x5c4584){return _0x46879f[_0x63f0('0xb')](_0x30ec1b)[_0x63f0('0xc')](_0x5c4584);}};}function respondWithFilteredResult(_0x441a68,_0xc76230){return function(_0x2bcb42){if(_0x2bcb42){var _0x181e2e=typeof _0xc76230[_0x63f0('0xd')]==='undefined'&&typeof _0xc76230[_0x63f0('0xe')]===_0x63f0('0xf');var _0x407147=_0x2bcb42[_0x63f0('0x10')];var _0x4009ce=_0x181e2e?0x0:_0xc76230[_0x63f0('0xd')];var _0x152747=_0x181e2e?_0x2bcb42['count']:_0xc76230[_0x63f0('0xd')]+_0xc76230[_0x63f0('0xe')];var _0x9ae925;if(_0x152747>=_0x407147){_0x152747=_0x407147;_0x9ae925=0xc8;}else{_0x9ae925=0xce;}_0x441a68['status'](_0x9ae925);return _0x441a68[_0x63f0('0x11')](_0x63f0('0x12'),_0x4009ce+'-'+_0x152747+'/'+_0x407147)[_0x63f0('0xc')](_0x2bcb42);}return null;};}function saveUpdates(_0x5ad731){return function(_0x2df4ec){if(_0x2df4ec){return _0x2df4ec[_0x63f0('0x13')](_0x5ad731)[_0x63f0('0x14')](function(_0x133720){return _0x133720;});}return null;};}function removeEntity(_0x38602b){return function(_0x46d542){if(_0x46d542){return _0x46d542[_0x63f0('0x15')]()[_0x63f0('0x14')](function(){var _0x2bbf9d=_0x46d542[_0x63f0('0x16')]({'plain':!![]});var _0x2ea73a=_0x63f0('0x17');return db['UserProfileResource'][_0x63f0('0x15')]({'where':{'type':_0x2ea73a,'resourceId':_0x2bbf9d['id']}})['then'](function(){return _0x46d542;});})[_0x63f0('0x14')](function(){var _0x44deb8=new Redis(config[_0x63f0('0x6')]);_0x44deb8['publish'](_0x63f0('0x18'),JSON['stringify']({'id':_0x46d542['id'],'deleted':!![]}));})['then'](function(){_0x38602b[_0x63f0('0xb')](0xcc)[_0x63f0('0x19')]();});}};}function handleEntityNotFound(_0x21b978){return function(_0x257b0){if(!_0x257b0){_0x21b978[_0x63f0('0x1a')](0x194);}return _0x257b0;};}function handleError(_0x30f470,_0x784b94){_0x784b94=_0x784b94||0x1f4;return function(_0x269394){logger['error'](_0x269394[_0x63f0('0x1b')]);if(_0x269394['name']){delete _0x269394[_0x63f0('0x1c')];}_0x30f470[_0x63f0('0xb')](_0x784b94)['send'](_0x269394);};}exports[_0x63f0('0x1d')]=function(_0x577fee,_0x30b04e){var _0x11fac0={},_0x1bf97a={},_0x2fc15f={'count':0x0,'rows':[]};var _0xd3a5c9=_[_0x63f0('0x1e')](db['SquareProject']['rawAttributes'],function(_0x4701a0){return{'name':_0x4701a0[_0x63f0('0x1f')],'type':_0x4701a0[_0x63f0('0x20')][_0x63f0('0x21')]};});_0x1bf97a[_0x63f0('0x22')]=_[_0x63f0('0x1e')](_0xd3a5c9,_0x63f0('0x1c'));_0x1bf97a[_0x63f0('0x23')]=_['keys'](_0x577fee[_0x63f0('0x23')]);_0x1bf97a[_0x63f0('0x24')]=_[_0x63f0('0x25')](_0x1bf97a['model'],_0x1bf97a['query']);_0x11fac0[_0x63f0('0x26')]=_[_0x63f0('0x25')](_0x1bf97a['model'],qs[_0x63f0('0x27')](_0x577fee[_0x63f0('0x23')][_0x63f0('0x27')]));_0x11fac0[_0x63f0('0x26')]=_0x11fac0['attributes'][_0x63f0('0x28')]?_0x11fac0[_0x63f0('0x26')]:_0x1bf97a['model'];if(!_0x577fee[_0x63f0('0x23')][_0x63f0('0x29')]('nolimit')){_0x11fac0['limit']=qs['limit'](_0x577fee['query'][_0x63f0('0xe')]);_0x11fac0[_0x63f0('0xd')]=qs[_0x63f0('0xd')](_0x577fee[_0x63f0('0x23')][_0x63f0('0xd')]);}_0x11fac0['order']=qs[_0x63f0('0x2a')](_0x577fee[_0x63f0('0x23')][_0x63f0('0x2a')]);_0x11fac0[_0x63f0('0x2b')]=qs[_0x63f0('0x24')](_['pick'](_0x577fee[_0x63f0('0x23')],_0x1bf97a[_0x63f0('0x24')]),_0xd3a5c9);if(_0x577fee['query'][_0x63f0('0x2c')]){_0x11fac0[_0x63f0('0x2b')]=_[_0x63f0('0x2d')](_0x11fac0[_0x63f0('0x2b')],{'$or':_[_0x63f0('0x1e')](_0xd3a5c9,function(_0x64f4d1){if(_0x64f4d1['type']!==_0x63f0('0x2e')){var _0x1555ac={};_0x1555ac[_0x64f4d1['name']]={'$like':'%'+_0x577fee[_0x63f0('0x23')][_0x63f0('0x2c')]+'%'};return _0x1555ac;}})});}_0x11fac0=_['merge']({},_0x11fac0,_0x577fee[_0x63f0('0x2f')]);var _0xd27f78={'where':_0x11fac0['where']};return db[_0x63f0('0x30')][_0x63f0('0x10')](_0xd27f78)[_0x63f0('0x14')](function(_0x342dda){_0x2fc15f[_0x63f0('0x10')]=_0x342dda;if(_0x577fee[_0x63f0('0x23')]['includeAll']){_0x11fac0[_0x63f0('0x31')]=[{'all':!![]}];}return db[_0x63f0('0x30')][_0x63f0('0x32')](_0x11fac0);})['then'](function(_0x31b3d4){_0x2fc15f[_0x63f0('0x33')]=_0x31b3d4;return _0x2fc15f;})[_0x63f0('0x14')](respondWithFilteredResult(_0x30b04e,_0x11fac0))[_0x63f0('0x34')](handleError(_0x30b04e,null));};exports['show']=function(_0x4ca233,_0x5735d4){var _0xaef286={'raw':![],'where':{'id':_0x4ca233[_0x63f0('0x35')]['id']}},_0x1cd3de={};_0x1cd3de[_0x63f0('0x22')]=_['keys'](db['SquareProject'][_0x63f0('0x36')]);_0x1cd3de[_0x63f0('0x23')]=_['keys'](_0x4ca233[_0x63f0('0x23')]);_0x1cd3de[_0x63f0('0x24')]=_[_0x63f0('0x25')](_0x1cd3de[_0x63f0('0x22')],_0x1cd3de[_0x63f0('0x23')]);_0xaef286['attributes']=_[_0x63f0('0x25')](_0x1cd3de[_0x63f0('0x22')],qs['fields'](_0x4ca233[_0x63f0('0x23')]['fields']));_0xaef286[_0x63f0('0x26')]=_0xaef286[_0x63f0('0x26')][_0x63f0('0x28')]?_0xaef286['attributes']:_0x1cd3de['model'];if(_0x4ca233['query'][_0x63f0('0x37')]){_0xaef286[_0x63f0('0x31')]=[{'all':!![]}];}_0xaef286=_[_0x63f0('0x2d')]({},_0xaef286,_0x4ca233[_0x63f0('0x2f')]);return db[_0x63f0('0x30')][_0x63f0('0x38')](_0xaef286)[_0x63f0('0x14')](handleEntityNotFound(_0x5735d4,null))['then'](respondWithResult(_0x5735d4,null))[_0x63f0('0x34')](handleError(_0x5735d4,null));};exports['create']=function(_0x483e72,_0x1ae4e9){return db['SquareProject'][_0x63f0('0x39')](_0x483e72[_0x63f0('0x3a')],{})[_0x63f0('0x14')](function(_0x2050e8){var _0x3a6cdc=_0x483e72['user'][_0x63f0('0x16')]({'plain':!![]});if(!_0x3a6cdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a6cdc[_0x63f0('0x3b')]===_0x63f0('0x3c')){var _0x4af45c=_0x2050e8[_0x63f0('0x16')]({'plain':!![]});var _0x4f4c91=_0x63f0('0x17');return db[_0x63f0('0x3d')][_0x63f0('0x38')]({'where':{'name':_0x4f4c91,'userProfileId':_0x3a6cdc[_0x63f0('0x3e')]},'raw':!![]})[_0x63f0('0x14')](function(_0x29fc40){if(_0x29fc40&&_0x29fc40[_0x63f0('0x3f')]===0x0){return db['UserProfileResource'][_0x63f0('0x39')]({'name':_0x4af45c[_0x63f0('0x1c')],'resourceId':_0x4af45c['id'],'type':_0x29fc40[_0x63f0('0x1c')],'sectionId':_0x29fc40['id']},{})['then'](function(){return _0x2050e8;});}else{return _0x2050e8;}})[_0x63f0('0x34')](function(_0xaa7f62){logger[_0x63f0('0x40')](_0x63f0('0x41'),_0xaa7f62);throw _0xaa7f62;});}return _0x2050e8;})['then'](respondWithResult(_0x1ae4e9,0xc9))['catch'](handleError(_0x1ae4e9,null));};exports['update']=function(_0x48e362,_0x38dbc1){if(_0x48e362[_0x63f0('0x3a')]['id']){delete _0x48e362[_0x63f0('0x3a')]['id'];}return db[_0x63f0('0x30')][_0x63f0('0x38')]({'where':{'id':_0x48e362[_0x63f0('0x35')]['id']}})[_0x63f0('0x14')](handleEntityNotFound(_0x38dbc1,null))[_0x63f0('0x14')](saveUpdates(_0x48e362[_0x63f0('0x3a')],null))[_0x63f0('0x14')](function(_0x4086f1){if(!_0x4086f1)return;var _0x365047=_0x4086f1[_0x63f0('0x16')]({'plain':!![]});return _0x365047;})['then'](function(_0x4343ac){var _0x262d60=new Redis(config[_0x63f0('0x6')]);_0x262d60[_0x63f0('0x42')](_0x63f0('0x18'),JSON[_0x63f0('0x43')](_[_0x63f0('0x44')](_0x4343ac,['id',_0x63f0('0x1c'),_0x63f0('0x45')])));return _0x4343ac;})[_0x63f0('0x14')](respondWithResult(_0x38dbc1,null))[_0x63f0('0x34')](handleError(_0x38dbc1,null));};exports['destroy']=function(_0x4eafa4,_0x25b96d){return db[_0x63f0('0x30')][_0x63f0('0x38')]({'where':{'id':_0x4eafa4[_0x63f0('0x35')]['id']}})[_0x63f0('0x14')](handleEntityNotFound(_0x25b96d,null))['then'](removeEntity(_0x25b96d,null))[_0x63f0('0x34')](handleError(_0x25b96d,null));}; \ No newline at end of file +var _0x9dbf=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./squareProject.socket','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','status','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','SquareProject','includeAll','include','findAll','show','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3e9be1,_0x2fac9c){var _0x41518b=function(_0x5f19ed){while(--_0x5f19ed){_0x3e9be1['push'](_0x3e9be1['shift']());}};_0x41518b(++_0x2fac9c);}(_0x9dbf,0x11b));var _0xf9db=function(_0x4975b6,_0x530657){_0x4975b6=_0x4975b6-0x0;var _0x58e70a=_0x9dbf[_0x4975b6];return _0x58e70a;};'use strict';var _=require(_0xf9db('0x0'));var Redis=require(_0xf9db('0x1'));var qs=require(_0xf9db('0x2'));var logger=require(_0xf9db('0x3'))(_0xf9db('0x4'));var config=require(_0xf9db('0x5'));var db=require(_0xf9db('0x6'))['db'];config['redis']=_[_0xf9db('0x7')](config[_0xf9db('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9db('0x8')]));require(_0xf9db('0x9'))['register'](socket);function respondWithResult(_0x32804f,_0x1eaa72){_0x1eaa72=_0x1eaa72||0xc8;return function(_0x4dfa0b){if(_0x4dfa0b){return _0x32804f['status'](_0x1eaa72)[_0xf9db('0xa')](_0x4dfa0b);}};}function respondWithFilteredResult(_0xdf9f08,_0x1bc081){return function(_0x5b8f01){if(_0x5b8f01){var _0x3734b0=typeof _0x1bc081[_0xf9db('0xb')]===_0xf9db('0xc')&&typeof _0x1bc081[_0xf9db('0xd')]===_0xf9db('0xc');var _0x19dd42=_0x5b8f01[_0xf9db('0xe')];var _0xf81103=_0x3734b0?0x0:_0x1bc081[_0xf9db('0xb')];var _0x578549=_0x3734b0?_0x5b8f01[_0xf9db('0xe')]:_0x1bc081['offset']+_0x1bc081['limit'];var _0x518410;if(_0x578549>=_0x19dd42){_0x578549=_0x19dd42;_0x518410=0xc8;}else{_0x518410=0xce;}_0xdf9f08['status'](_0x518410);return _0xdf9f08[_0xf9db('0xf')](_0xf9db('0x10'),_0xf81103+'-'+_0x578549+'/'+_0x19dd42)['json'](_0x5b8f01);}return null;};}function saveUpdates(_0x492495){return function(_0x4e201c){if(_0x4e201c){return _0x4e201c[_0xf9db('0x11')](_0x492495)[_0xf9db('0x12')](function(_0x1afb86){return _0x1afb86;});}return null;};}function removeEntity(_0x26a7cf){return function(_0x3f11b8){if(_0x3f11b8){return _0x3f11b8[_0xf9db('0x13')]()[_0xf9db('0x12')](function(){var _0x42e94f=_0x3f11b8[_0xf9db('0x14')]({'plain':!![]});var _0x4fda89=_0xf9db('0x15');return db[_0xf9db('0x16')][_0xf9db('0x13')]({'where':{'type':_0x4fda89,'resourceId':_0x42e94f['id']}})[_0xf9db('0x12')](function(){return _0x3f11b8;});})[_0xf9db('0x12')](function(){var _0x3c935c=new Redis(config[_0xf9db('0x8')]);_0x3c935c[_0xf9db('0x17')](_0xf9db('0x18'),JSON[_0xf9db('0x19')]({'id':_0x3f11b8['id'],'deleted':!![]}));})[_0xf9db('0x12')](function(){_0x26a7cf['status'](0xcc)[_0xf9db('0x1a')]();});}};}function handleEntityNotFound(_0xc010ab){return function(_0x1af20c){if(!_0x1af20c){_0xc010ab[_0xf9db('0x1b')](0x194);}return _0x1af20c;};}function handleError(_0x1cefe7,_0xf0475a){_0xf0475a=_0xf0475a||0x1f4;return function(_0x204a63){logger[_0xf9db('0x1c')](_0x204a63[_0xf9db('0x1d')]);if(_0x204a63['name']){delete _0x204a63[_0xf9db('0x1e')];}_0x1cefe7[_0xf9db('0x1f')](_0xf0475a)[_0xf9db('0x20')](_0x204a63);};}exports[_0xf9db('0x21')]=function(_0x2afcb5,_0x2d909a){var _0x32c0f4={},_0x5f2d1b={},_0x4bdf7b={'count':0x0,'rows':[]};var _0x4c57d6=_[_0xf9db('0x22')](db['SquareProject'][_0xf9db('0x23')],function(_0x179f4){return{'name':_0x179f4[_0xf9db('0x24')],'type':_0x179f4['type']['key']};});_0x5f2d1b[_0xf9db('0x25')]=_[_0xf9db('0x22')](_0x4c57d6,_0xf9db('0x1e'));_0x5f2d1b[_0xf9db('0x26')]=_[_0xf9db('0x27')](_0x2afcb5[_0xf9db('0x26')]);_0x5f2d1b[_0xf9db('0x28')]=_[_0xf9db('0x29')](_0x5f2d1b['model'],_0x5f2d1b['query']);_0x32c0f4['attributes']=_[_0xf9db('0x29')](_0x5f2d1b[_0xf9db('0x25')],qs[_0xf9db('0x2a')](_0x2afcb5[_0xf9db('0x26')]['fields']));_0x32c0f4[_0xf9db('0x2b')]=_0x32c0f4['attributes'][_0xf9db('0x2c')]?_0x32c0f4[_0xf9db('0x2b')]:_0x5f2d1b[_0xf9db('0x25')];if(!_0x2afcb5[_0xf9db('0x26')][_0xf9db('0x2d')](_0xf9db('0x2e'))){_0x32c0f4[_0xf9db('0xd')]=qs[_0xf9db('0xd')](_0x2afcb5['query'][_0xf9db('0xd')]);_0x32c0f4[_0xf9db('0xb')]=qs['offset'](_0x2afcb5['query'][_0xf9db('0xb')]);}_0x32c0f4['order']=qs[_0xf9db('0x2f')](_0x2afcb5[_0xf9db('0x26')][_0xf9db('0x2f')]);_0x32c0f4[_0xf9db('0x30')]=qs[_0xf9db('0x28')](_[_0xf9db('0x31')](_0x2afcb5[_0xf9db('0x26')],_0x5f2d1b[_0xf9db('0x28')]),_0x4c57d6);if(_0x2afcb5['query'][_0xf9db('0x32')]){_0x32c0f4['where']=_[_0xf9db('0x33')](_0x32c0f4[_0xf9db('0x30')],{'$or':_[_0xf9db('0x22')](_0x4c57d6,function(_0x4da2ac){if(_0x4da2ac[_0xf9db('0x34')]!=='VIRTUAL'){var _0x3413eb={};_0x3413eb[_0x4da2ac['name']]={'$like':'%'+_0x2afcb5[_0xf9db('0x26')][_0xf9db('0x32')]+'%'};return _0x3413eb;}})});}_0x32c0f4=_['merge']({},_0x32c0f4,_0x2afcb5[_0xf9db('0x35')]);var _0x17c826={'where':_0x32c0f4['where']};return db[_0xf9db('0x36')][_0xf9db('0xe')](_0x17c826)[_0xf9db('0x12')](function(_0xb0abc7){_0x4bdf7b[_0xf9db('0xe')]=_0xb0abc7;if(_0x2afcb5[_0xf9db('0x26')][_0xf9db('0x37')]){_0x32c0f4[_0xf9db('0x38')]=[{'all':!![]}];}return db['SquareProject'][_0xf9db('0x39')](_0x32c0f4);})[_0xf9db('0x12')](function(_0x4c5db3){_0x4bdf7b['rows']=_0x4c5db3;return _0x4bdf7b;})[_0xf9db('0x12')](respondWithFilteredResult(_0x2d909a,_0x32c0f4))['catch'](handleError(_0x2d909a,null));};exports[_0xf9db('0x3a')]=function(_0x343ffa,_0x5202a0){var _0x5b9467={'raw':![],'where':{'id':_0x343ffa['params']['id']}},_0x3ce617={};_0x3ce617[_0xf9db('0x25')]=_[_0xf9db('0x27')](db['SquareProject'][_0xf9db('0x23')]);_0x3ce617['query']=_['keys'](_0x343ffa[_0xf9db('0x26')]);_0x3ce617[_0xf9db('0x28')]=_[_0xf9db('0x29')](_0x3ce617['model'],_0x3ce617['query']);_0x5b9467[_0xf9db('0x2b')]=_['intersection'](_0x3ce617[_0xf9db('0x25')],qs['fields'](_0x343ffa['query'][_0xf9db('0x2a')]));_0x5b9467[_0xf9db('0x2b')]=_0x5b9467['attributes']['length']?_0x5b9467[_0xf9db('0x2b')]:_0x3ce617[_0xf9db('0x25')];if(_0x343ffa[_0xf9db('0x26')][_0xf9db('0x37')]){_0x5b9467['include']=[{'all':!![]}];}_0x5b9467=_['merge']({},_0x5b9467,_0x343ffa[_0xf9db('0x35')]);return db[_0xf9db('0x36')][_0xf9db('0x3b')](_0x5b9467)[_0xf9db('0x12')](handleEntityNotFound(_0x5202a0,null))[_0xf9db('0x12')](respondWithResult(_0x5202a0,null))[_0xf9db('0x3c')](handleError(_0x5202a0,null));};exports['create']=function(_0x5cd84e,_0x587274){return db[_0xf9db('0x36')][_0xf9db('0x3d')](_0x5cd84e[_0xf9db('0x3e')],{})[_0xf9db('0x12')](function(_0x3c893e){var _0x6eb1ef=_0x5cd84e['user'][_0xf9db('0x14')]({'plain':!![]});if(!_0x6eb1ef)throw new Error(_0xf9db('0x3f'));if(_0x6eb1ef['role']==='user'){var _0x1c8a9c=_0x3c893e[_0xf9db('0x14')]({'plain':!![]});var _0x261a48=_0xf9db('0x15');return db[_0xf9db('0x40')][_0xf9db('0x3b')]({'where':{'name':_0x261a48,'userProfileId':_0x6eb1ef[_0xf9db('0x41')]},'raw':!![]})[_0xf9db('0x12')](function(_0x551306){if(_0x551306&&_0x551306[_0xf9db('0x42')]===0x0){return db[_0xf9db('0x16')][_0xf9db('0x3d')]({'name':_0x1c8a9c[_0xf9db('0x1e')],'resourceId':_0x1c8a9c['id'],'type':_0x551306[_0xf9db('0x1e')],'sectionId':_0x551306['id']},{})['then'](function(){return _0x3c893e;});}else{return _0x3c893e;}})[_0xf9db('0x3c')](function(_0x3d8932){logger[_0xf9db('0x1c')](_0xf9db('0x43'),_0x3d8932);throw _0x3d8932;});}return _0x3c893e;})[_0xf9db('0x12')](respondWithResult(_0x587274,0xc9))[_0xf9db('0x3c')](handleError(_0x587274,null));};exports[_0xf9db('0x11')]=function(_0x25b628,_0x5705f0){if(_0x25b628[_0xf9db('0x3e')]['id']){delete _0x25b628[_0xf9db('0x3e')]['id'];}return db[_0xf9db('0x36')]['find']({'where':{'id':_0x25b628[_0xf9db('0x44')]['id']}})[_0xf9db('0x12')](handleEntityNotFound(_0x5705f0,null))[_0xf9db('0x12')](saveUpdates(_0x25b628[_0xf9db('0x3e')],null))[_0xf9db('0x12')](function(_0x41955f){if(!_0x41955f)return;var _0x2d37f8=_0x41955f[_0xf9db('0x14')]({'plain':!![]});return _0x2d37f8;})['then'](function(_0x2831ae){var _0x230bc5=new Redis(config[_0xf9db('0x8')]);_0x230bc5['publish'](_0xf9db('0x18'),JSON[_0xf9db('0x19')](_['pick'](_0x2831ae,['id',_0xf9db('0x1e'),_0xf9db('0x45')])));return _0x2831ae;})[_0xf9db('0x12')](respondWithResult(_0x5705f0,null))[_0xf9db('0x3c')](handleError(_0x5705f0,null));};exports[_0xf9db('0x13')]=function(_0x454964,_0x421e62){return db[_0xf9db('0x36')][_0xf9db('0x3b')]({'where':{'id':_0x454964[_0xf9db('0x44')]['id']}})[_0xf9db('0x12')](handleEntityNotFound(_0x421e62,null))[_0xf9db('0x12')](removeEntity(_0x421e62,null))[_0xf9db('0x3c')](handleError(_0x421e62,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index cb37615..ed62445 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 _0xd339=['../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x2f7710,_0x5cd6b1){var _0xd50aad=function(_0x46cda2){while(--_0x46cda2){_0x2f7710['push'](_0x2f7710['shift']());}};_0xd50aad(++_0x5cd6b1);}(_0xd339,0x116));var _0x9d33=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd339[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x9d33('0x0'));var SquareProject=require(_0x9d33('0x1'))['db'][_0x9d33('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9d33('0x3'),'afterUpdate':_0x9d33('0x4'),'afterDestroy':_0x9d33('0x5')};function emitEvent(_0x41aa74){return function(_0x62bb33,_0x2bf28f,_0x1f67e1){SquareProjectEvents[_0x9d33('0x6')](_0x41aa74+':'+_0x62bb33['id'],_0x62bb33);SquareProjectEvents[_0x9d33('0x6')](_0x41aa74,_0x62bb33);_0x1f67e1(null);};}for(var e in events){if(events[_0x9d33('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x9d33('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x691b=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x691b,0x11e));var _0xb691=function(_0x59f5c1,_0x133fef){_0x59f5c1=_0x59f5c1-0x0;var _0x182112=_0x691b[_0x59f5c1];return _0x182112;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb691('0x0'))['db'][_0xb691('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb691('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb691('0x3'),'afterDestroy':_0xb691('0x4')};function emitEvent(_0x595380){return function(_0x3172c4,_0x39737e,_0x183ae3){SquareProjectEvents['emit'](_0x595380+':'+_0x3172c4['id'],_0x3172c4);SquareProjectEvents[_0xb691('0x5')](_0x595380,_0x3172c4);_0x183ae3(null);};}for(var e in events){if(events[_0xb691('0x6')](e)){var event=events[e];SquareProject[_0xb691('0x7')](e,emitEvent(event));}}module[_0xb691('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 f07f055..0e061bf 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 _0x2b20=['exports','SquareProject','square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed','publishedAt','format','lodash','util','api','path','rimraf'];(function(_0x574e14,_0x198a24){var _0x268fb2=function(_0x2213ba){while(--_0x2213ba){_0x574e14['push'](_0x574e14['shift']());}};_0x268fb2(++_0x198a24);}(_0x2b20,0x121));var _0x02b2=function(_0x6154a8,_0x1c1028){_0x6154a8=_0x6154a8-0x0;var _0x507942=_0x2b20[_0x6154a8];return _0x507942;};'use strict';var _=require(_0x02b2('0x0'));var util=require(_0x02b2('0x1'));var logger=require('../../config/logger')(_0x02b2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x02b2('0x3'));var rimraf=require(_0x02b2('0x4'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x02b2('0x5')]=function(_0x41d7d3,_0x3af5ab){return _0x41d7d3['define'](_0x02b2('0x6'),attributes,{'tableName':_0x02b2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5eb968,_0x3a6ecf,_0x30608b){if(_0x5eb968['changed'](_0x02b2('0x8'))){_0x5eb968[_0x02b2('0x9')]=moment()['format'](_0x02b2('0xa'));}if(_0x5eb968[_0x02b2('0xb')]('production')){_0x5eb968[_0x02b2('0xc')]=moment()[_0x02b2('0xd')](_0x02b2('0xa'));}_0x30608b(null,_0x5eb968);}}});}; \ No newline at end of file +var _0xef8a=['bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','YYYY-MM-DD\x20HH:mm:ss','format','lodash','../../config/logger','api','moment'];(function(_0x4b0ed6,_0x1a595e){var _0x1e7777=function(_0x19445c){while(--_0x19445c){_0x4b0ed6['push'](_0x4b0ed6['shift']());}};_0x1e7777(++_0x1a595e);}(_0xef8a,0xec));var _0xaef8=function(_0x2b9cf5,_0x2a7804){_0x2b9cf5=_0x2b9cf5-0x0;var _0xd0cf15=_0xef8a[_0x2b9cf5];return _0xd0cf15;};'use strict';var _=require(_0xaef8('0x0'));var util=require('util');var logger=require(_0xaef8('0x1'))(_0xaef8('0x2'));var moment=require(_0xaef8('0x3'));var BPromise=require(_0xaef8('0x4'));var rp=require(_0xaef8('0x5'));var fs=require('fs');var path=require(_0xaef8('0x6'));var rimraf=require('rimraf');var config=require(_0xaef8('0x7'));var attributes=require(_0xaef8('0x8'));module[_0xaef8('0x9')]=function(_0x519fa2,_0x3bdbe5){return _0x519fa2['define'](_0xaef8('0xa'),attributes,{'tableName':_0xaef8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc373cf,_0x37956b,_0x1710fd){if(_0xc373cf[_0xaef8('0xc')]('preproduction')){_0xc373cf['savedAt']=moment()['format'](_0xaef8('0xd'));}if(_0xc373cf[_0xaef8('0xc')]('production')){_0xc373cf['publishedAt']=moment()[_0xaef8('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1710fd(null,_0xc373cf);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index f3eacd4..f971035 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 _0xd00d=['options','raw','where','limit','include','map','attributes','model','then','info','debug','stringify','catch','error','message','ShowSquareProject','find','lodash','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll'];(function(_0x1bc762,_0x523eb3){var _0x40f70c=function(_0x3c206e){while(--_0x3c206e){_0x1bc762['push'](_0x1bc762['shift']());}};_0x40f70c(++_0x523eb3);}(_0xd00d,0x150));var _0xdd00=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xd00d[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xdd00('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xdd00('0x1'))('rpc');var config=require(_0xdd00('0x2'));config['redis']=_[_0xdd00('0x3')](config[_0xdd00('0x4')],{'host':_0xdd00('0x5'),'port':0x18eb});var socket=require(_0xdd00('0x6'))(new Redis(config['redis']));require(_0xdd00('0x7'))[_0xdd00('0x8')](socket);exports[_0xdd00('0x9')]=function(_0x1a3af4){var _0x4bb752=this;return new Promise(function(_0x243a18,_0x548c2e){return db[_0xdd00('0xa')][_0xdd00('0xb')]({'raw':_0x1a3af4[_0xdd00('0xc')]?_0x1a3af4[_0xdd00('0xc')][_0xdd00('0xd')]===undefined?!![]:![]:!![],'where':_0x1a3af4['options']?_0x1a3af4[_0xdd00('0xc')][_0xdd00('0xe')]||null:null,'attributes':_0x1a3af4[_0xdd00('0xc')]?_0x1a3af4[_0xdd00('0xc')]['attributes']||null:null,'limit':_0x1a3af4[_0xdd00('0xc')]?_0x1a3af4['options'][_0xdd00('0xf')]||null:null,'include':_0x1a3af4['options']?_0x1a3af4[_0xdd00('0xc')][_0xdd00('0x10')]?_[_0xdd00('0x11')](_0x1a3af4[_0xdd00('0xc')][_0xdd00('0x10')],function(_0x3f7445){return{'model':db[_0x3f7445['model']],'as':_0x3f7445['as'],'attributes':_0x3f7445[_0xdd00('0x12')],'include':_0x3f7445[_0xdd00('0x10')]?_['map'](_0x3f7445['include'],function(_0x5f2eff){return{'model':db[_0x5f2eff['model']],'as':_0x5f2eff['as'],'attributes':_0x5f2eff[_0xdd00('0x12')],'include':_0x5f2eff[_0xdd00('0x10')]?_['map'](_0x5f2eff[_0xdd00('0x10')],function(_0x4e5898){return{'model':db[_0x4e5898[_0xdd00('0x13')]],'as':_0x4e5898['as'],'attributes':_0x4e5898[_0xdd00('0x12')]};}):[]};}):[]};}):[]:[]})[_0xdd00('0x14')](function(_0x283bd5){logger[_0xdd00('0x15')](_0xdd00('0x9'),_0x1a3af4);logger[_0xdd00('0x16')](_0xdd00('0x9'),_0x1a3af4,JSON[_0xdd00('0x17')](_0x283bd5));_0x243a18(_0x283bd5);})[_0xdd00('0x18')](function(_0x3742d0){logger[_0xdd00('0x19')](_0xdd00('0x9'),_0x3742d0[_0xdd00('0x1a')],_0x1a3af4);_0x548c2e(_0x4bb752['error'](0x1f4,_0x3742d0[_0xdd00('0x1a')]));});});};exports[_0xdd00('0x1b')]=function(_0x1001fb){var _0x9383a4=this;return new Promise(function(_0x443d50,_0x2709e2){return db[_0xdd00('0xa')][_0xdd00('0x1c')]({'raw':_0x1001fb[_0xdd00('0xc')]?_0x1001fb['options'][_0xdd00('0xd')]===undefined?!![]:![]:!![],'where':_0x1001fb[_0xdd00('0xc')]?_0x1001fb[_0xdd00('0xc')][_0xdd00('0xe')]||null:null,'attributes':_0x1001fb['options']?_0x1001fb[_0xdd00('0xc')][_0xdd00('0x12')]||null:null,'include':_0x1001fb[_0xdd00('0xc')]?_0x1001fb[_0xdd00('0xc')][_0xdd00('0x10')]?_['map'](_0x1001fb[_0xdd00('0xc')]['include'],function(_0x3b8ff5){return{'model':db[_0x3b8ff5[_0xdd00('0x13')]],'as':_0x3b8ff5['as'],'attributes':_0x3b8ff5[_0xdd00('0x12')],'include':_0x3b8ff5[_0xdd00('0x10')]?_['map'](_0x3b8ff5[_0xdd00('0x10')],function(_0x456ab2){return{'model':db[_0x456ab2[_0xdd00('0x13')]],'as':_0x456ab2['as'],'attributes':_0x456ab2[_0xdd00('0x12')],'include':_0x456ab2[_0xdd00('0x10')]?_['map'](_0x456ab2[_0xdd00('0x10')],function(_0x1462c2){return{'model':db[_0x1462c2[_0xdd00('0x13')]],'as':_0x1462c2['as'],'attributes':_0x1462c2[_0xdd00('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c0997){logger[_0xdd00('0x15')](_0xdd00('0x1b'),_0x1001fb);logger['debug'](_0xdd00('0x1b'),_0x1001fb,JSON['stringify'](_0x3c0997));_0x443d50(_0x3c0997);})[_0xdd00('0x18')](function(_0x17408f){logger[_0xdd00('0x19')](_0xdd00('0x1b'),_0x17408f['message'],_0x1001fb);_0x2709e2(_0x9383a4[_0xdd00('0x19')](0x1f4,_0x17408f[_0xdd00('0x1a')]));});});}; \ No newline at end of file +var _0x3752=['../../mysqldb','rpc','../../config/environment','redis','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','limit','include','model','attributes','then','info','debug','stringify','catch','error','message','ShowSquareProject','find','map','lodash'];(function(_0x26e606,_0xf6d86e){var _0x4b346e=function(_0x397e25){while(--_0x397e25){_0x26e606['push'](_0x26e606['shift']());}};_0x4b346e(++_0xf6d86e);}(_0x3752,0x16b));var _0x2375=function(_0x14349b,_0x1eb24d){_0x14349b=_0x14349b-0x0;var _0x34f8cb=_0x3752[_0x14349b];return _0x34f8cb;};'use strict';var _=require(_0x2375('0x0'));var Redis=require('ioredis');var db=require(_0x2375('0x1'))['db'];var logger=require('../../config/logger')(_0x2375('0x2'));var config=require(_0x2375('0x3'));config['redis']=_['defaults'](config[_0x2375('0x4')],{'host':_0x2375('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2375('0x4')]));require(_0x2375('0x6'))[_0x2375('0x7')](socket);exports[_0x2375('0x8')]=function(_0x2e982e){var _0x4f22b8=this;return new Promise(function(_0x39dfac,_0x769a1f){return db[_0x2375('0x9')][_0x2375('0xa')]({'raw':_0x2e982e[_0x2375('0xb')]?_0x2e982e[_0x2375('0xb')][_0x2375('0xc')]===undefined?!![]:![]:!![],'where':_0x2e982e[_0x2375('0xb')]?_0x2e982e[_0x2375('0xb')][_0x2375('0xd')]||null:null,'attributes':_0x2e982e[_0x2375('0xb')]?_0x2e982e[_0x2375('0xb')]['attributes']||null:null,'limit':_0x2e982e[_0x2375('0xb')]?_0x2e982e[_0x2375('0xb')][_0x2375('0xe')]||null:null,'include':_0x2e982e[_0x2375('0xb')]?_0x2e982e['options']['include']?_['map'](_0x2e982e[_0x2375('0xb')][_0x2375('0xf')],function(_0x547591){return{'model':db[_0x547591[_0x2375('0x10')]],'as':_0x547591['as'],'attributes':_0x547591[_0x2375('0x11')],'include':_0x547591[_0x2375('0xf')]?_['map'](_0x547591[_0x2375('0xf')],function(_0x104d60){return{'model':db[_0x104d60[_0x2375('0x10')]],'as':_0x104d60['as'],'attributes':_0x104d60[_0x2375('0x11')],'include':_0x104d60[_0x2375('0xf')]?_['map'](_0x104d60[_0x2375('0xf')],function(_0xf54fad){return{'model':db[_0xf54fad[_0x2375('0x10')]],'as':_0xf54fad['as'],'attributes':_0xf54fad[_0x2375('0x11')]};}):[]};}):[]};}):[]:[]})[_0x2375('0x12')](function(_0x558545){logger[_0x2375('0x13')](_0x2375('0x8'),_0x2e982e);logger[_0x2375('0x14')](_0x2375('0x8'),_0x2e982e,JSON[_0x2375('0x15')](_0x558545));_0x39dfac(_0x558545);})[_0x2375('0x16')](function(_0x3ecffd){logger[_0x2375('0x17')](_0x2375('0x8'),_0x3ecffd[_0x2375('0x18')],_0x2e982e);_0x769a1f(_0x4f22b8['error'](0x1f4,_0x3ecffd[_0x2375('0x18')]));});});};exports[_0x2375('0x19')]=function(_0x5e767a){var _0x4047b7=this;return new Promise(function(_0x6d914e,_0x197a74){return db['SquareProject'][_0x2375('0x1a')]({'raw':_0x5e767a[_0x2375('0xb')]?_0x5e767a[_0x2375('0xb')][_0x2375('0xc')]===undefined?!![]:![]:!![],'where':_0x5e767a[_0x2375('0xb')]?_0x5e767a[_0x2375('0xb')][_0x2375('0xd')]||null:null,'attributes':_0x5e767a[_0x2375('0xb')]?_0x5e767a[_0x2375('0xb')][_0x2375('0x11')]||null:null,'include':_0x5e767a[_0x2375('0xb')]?_0x5e767a[_0x2375('0xb')][_0x2375('0xf')]?_[_0x2375('0x1b')](_0x5e767a[_0x2375('0xb')][_0x2375('0xf')],function(_0x3faa1c){return{'model':db[_0x3faa1c['model']],'as':_0x3faa1c['as'],'attributes':_0x3faa1c[_0x2375('0x11')],'include':_0x3faa1c['include']?_[_0x2375('0x1b')](_0x3faa1c[_0x2375('0xf')],function(_0x3b5dd4){return{'model':db[_0x3b5dd4['model']],'as':_0x3b5dd4['as'],'attributes':_0x3b5dd4[_0x2375('0x11')],'include':_0x3b5dd4[_0x2375('0xf')]?_[_0x2375('0x1b')](_0x3b5dd4[_0x2375('0xf')],function(_0x2e8046){return{'model':db[_0x2e8046[_0x2375('0x10')]],'as':_0x2e8046['as'],'attributes':_0x2e8046[_0x2375('0x11')]};}):[]};}):[]};}):[]:[]})[_0x2375('0x12')](function(_0x1e1ce9){logger['info'](_0x2375('0x19'),_0x5e767a);logger[_0x2375('0x14')](_0x2375('0x19'),_0x5e767a,JSON['stringify'](_0x1e1ce9));_0x6d914e(_0x1e1ce9);})[_0x2375('0x16')](function(_0x322440){logger[_0x2375('0x17')](_0x2375('0x19'),_0x322440[_0x2375('0x18')],_0x5e767a);_0x197a74(_0x4047b7[_0x2375('0x17')](0x1f4,_0x322440['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 66ef900..9552d5c 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 _0x2c46=['squareProject:','./squareProject.events','save','update','emit','removeListener','register','length'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x2c46,0xa1));var _0x62c4=function(_0x5ce69b,_0x3151e9){_0x5ce69b=_0x5ce69b-0x0;var _0x24404a=_0x2c46[_0x5ce69b];return _0x24404a;};'use strict';var SquareProjectEvents=require(_0x62c4('0x0'));var events=[_0x62c4('0x1'),'remove',_0x62c4('0x2')];function createListener(_0x89177c,_0x2c38eb){return function(_0x523e33){_0x2c38eb[_0x62c4('0x3')](_0x89177c,_0x523e33);};}function removeListener(_0x34b7fc,_0x259d46){return function(){SquareProjectEvents[_0x62c4('0x4')](_0x34b7fc,_0x259d46);};}exports[_0x62c4('0x5')]=function(_0x402015){for(var _0x1369b2=0x0,_0x48b2d7=events[_0x62c4('0x6')];_0x1369b2<_0x48b2d7;_0x1369b2++){var _0x546e24=events[_0x1369b2];var _0x4b9afc=createListener(_0x62c4('0x7')+_0x546e24,_0x402015);SquareProjectEvents['on'](_0x546e24,_0x4b9afc);}}; \ No newline at end of file +var _0xbf36=['./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0xbf36,0xd8));var _0x6bf3=function(_0x1a4440,_0x5b7f98){_0x1a4440=_0x1a4440-0x0;var _0x425d9d=_0xbf36[_0x1a4440];return _0x425d9d;};'use strict';var SquareProjectEvents=require(_0x6bf3('0x0'));var events=[_0x6bf3('0x1'),_0x6bf3('0x2'),_0x6bf3('0x3')];function createListener(_0x422536,_0x140820){return function(_0x1b8994){_0x140820[_0x6bf3('0x4')](_0x422536,_0x1b8994);};}function removeListener(_0x2dee5d,_0x351e9c){return function(){SquareProjectEvents[_0x6bf3('0x5')](_0x2dee5d,_0x351e9c);};}exports[_0x6bf3('0x6')]=function(_0x2cd922){for(var _0xe8de8b=0x0,_0x55753a=events[_0x6bf3('0x7')];_0xe8de8b<_0x55753a;_0xe8de8b++){var _0x3f8243=events[_0xe8de8b];var _0x44e5d1=createListener('squareProject:'+_0x3f8243,_0x2cd922);SquareProjectEvents['on'](_0x3f8243,_0x44e5d1);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index eb890e4..cb5cf25 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0xd07790,_0x3db009){var _0x32f10e=function(_0x1f4911){while(--_0x1f4911){_0xd07790['push'](_0xd07790['shift']());}};_0x32f10e(++_0x3db009);}(_0x326f,0xd1));var _0xf326=function(_0x1e266e,_0x186387){_0x1e266e=_0x1e266e-0x0;var _0x155222=_0x326f[_0x1e266e];return _0x155222;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x275fbb,_0x52bdd9){var _0x1a1699=function(_0x2ded23){while(--_0x2ded23){_0x275fbb['push'](_0x275fbb['shift']());}};_0x1a1699(++_0x52bdd9);}(_0x326f,0xd1));var _0xf326=function(_0x20e801,_0x3347ab){_0x20e801=_0x20e801-0x0;var _0x4eaa1d=_0x326f[_0x20e801];return _0x4eaa1d;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 547c674..7326c0c 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 _0x81bd=['STRING','VIRTUAL','getDataValue','substring','lastIndexOf','sequelize','exports'];(function(_0x506bc6,_0x2b925f){var _0x217a7c=function(_0x3d05a2){while(--_0x3d05a2){_0x506bc6['push'](_0x506bc6['shift']());}};_0x217a7c(++_0x2b925f);}(_0x81bd,0x7c));var _0xd81b=function(_0x91f539,_0x442a0c){_0x91f539=_0x91f539-0x0;var _0x2e3bdd=_0x81bd[_0x91f539];return _0x2e3bdd;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'uniqueid':{'type':Sequelize[_0xd81b('0x2')]},'callerid':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize[_0xd81b('0x2')]},'context':{'type':Sequelize[_0xd81b('0x2')]},'extension':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd81b('0x2')]},'dnid':{'type':Sequelize[_0xd81b('0x2')]},'projectName':{'type':Sequelize[_0xd81b('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xd81b('0x2')]},'savePath':{'type':Sequelize[_0xd81b('0x2')]},'format':{'type':Sequelize[_0xd81b('0x3')],'get':function(){var _0x562084='';var _0x5e14e8=this[_0xd81b('0x4')]('savePath');if(_0x5e14e8){_0x562084=_0x5e14e8[_0xd81b('0x5')](_0x5e14e8[_0xd81b('0x6')]('.'));}return _0x562084;}}}; \ No newline at end of file +var _0x31f0=['getDataValue','savePath','substring','sequelize','STRING','VIRTUAL'];(function(_0x328131,_0xbd77fd){var _0x217831=function(_0x1dbef1){while(--_0x1dbef1){_0x328131['push'](_0x328131['shift']());}};_0x217831(++_0xbd77fd);}(_0x31f0,0xb7));var _0x031f=function(_0x10b165,_0x49d9b5){_0x10b165=_0x10b165-0x0;var _0x56941d=_0x31f0[_0x10b165];return _0x56941d;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x031f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x031f('0x1')]},'context':{'type':Sequelize[_0x031f('0x1')]},'extension':{'type':Sequelize[_0x031f('0x1')]},'priority':{'type':Sequelize[_0x031f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x031f('0x1')]},'projectName':{'type':Sequelize[_0x031f('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x031f('0x2')],'get':function(){var _0x487e65='';var _0x365f59=this[_0x031f('0x3')](_0x031f('0x4'));if(_0x365f59){_0x487e65=_0x365f59[_0x031f('0x5')](_0x365f59['lastIndexOf']('.'));}return _0x487e65;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 956679e..b0730e7 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 _0x2fc9=['sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','destroy','then','end','name','index','map','fieldName','type','key','query','filters','model','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','SquareRecording','include','findAll','rows','catch','params','keys','rawAttributes','intersection','includeAll','options','find','create','body','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','send','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x44cff4,_0x1e37aa){var _0x1f6698=function(_0x379b9b){while(--_0x379b9b){_0x44cff4['push'](_0x44cff4['shift']());}};_0x1f6698(++_0x1e37aa);}(_0x2fc9,0xa2));var _0x92fc=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x2fc9[_0x301c34];return _0x1a8c5a;};'use strict';var emlformat=require(_0x92fc('0x0'));var rimraf=require(_0x92fc('0x1'));var zipdir=require(_0x92fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92fc('0x3'));var moment=require('moment');var BPromise=require(_0x92fc('0x4'));var Mustache=require('mustache');var util=require(_0x92fc('0x5'));var path=require('path');var sox=require(_0x92fc('0x6'));var csv=require(_0x92fc('0x7'));var ejs=require(_0x92fc('0x8'));var fs=require('fs');var fs_extra=require(_0x92fc('0x9'));var _=require(_0x92fc('0xa'));var squel=require(_0x92fc('0xb'));var crypto=require(_0x92fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x92fc('0xd'));var toCsv=require(_0x92fc('0x7'));var querystring=require(_0x92fc('0xe'));var Papa=require(_0x92fc('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x92fc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92fc('0x11'));var logger=require(_0x92fc('0x12'))(_0x92fc('0x13'));var utils=require('../../config/utils');var config=require(_0x92fc('0x14'));var licenseUtil=require(_0x92fc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a0dd4,_0x3509fb){_0x3509fb=_0x3509fb||0xcc;return function(_0x5eeb2d){if(_0x5eeb2d){return _0x4a0dd4[_0x92fc('0x16')](_0x3509fb);}return _0x4a0dd4[_0x92fc('0x17')](_0x3509fb)['end']();};}function respondWithResult(_0x5686ee,_0x4c85e5){_0x4c85e5=_0x4c85e5||0xc8;return function(_0x22a66e){if(_0x22a66e){return _0x5686ee['status'](_0x4c85e5)['json'](_0x22a66e);}};}function respondWithFilteredResult(_0x6b433b,_0x4b1448){return function(_0x38ed17){if(_0x38ed17){var _0x234d8b=typeof _0x4b1448[_0x92fc('0x18')]==='undefined'&&typeof _0x4b1448[_0x92fc('0x19')]===_0x92fc('0x1a');var _0x11672=_0x38ed17[_0x92fc('0x1b')];var _0x36cc06=_0x234d8b?0x0:_0x4b1448[_0x92fc('0x18')];var _0x3bbb5c=_0x234d8b?_0x38ed17[_0x92fc('0x1b')]:_0x4b1448[_0x92fc('0x18')]+_0x4b1448[_0x92fc('0x19')];var _0x5553c6;if(_0x3bbb5c>=_0x11672){_0x3bbb5c=_0x11672;_0x5553c6=0xc8;}else{_0x5553c6=0xce;}_0x6b433b[_0x92fc('0x17')](_0x5553c6);return _0x6b433b[_0x92fc('0x1c')](_0x92fc('0x1d'),_0x36cc06+'-'+_0x3bbb5c+'/'+_0x11672)[_0x92fc('0x1e')](_0x38ed17);}return null;};}function patchUpdates(_0x17ff12){return function(_0x17f9ed){try{jsonpatch[_0x92fc('0x1f')](_0x17f9ed,_0x17ff12,!![]);}catch(_0x40d663){return BPromise[_0x92fc('0x20')](_0x40d663);}return _0x17f9ed[_0x92fc('0x21')]();};}function saveUpdates(_0x1cc02f,_0x540517){return function(_0x3bf22a){if(_0x3bf22a){return _0x3bf22a['update'](_0x1cc02f)['then'](function(_0x5e5c5a){return _0x5e5c5a;});}return null;};}function removeEntity(_0x38c70b,_0x23acee){return function(_0x24fea6){if(_0x24fea6){return _0x24fea6[_0x92fc('0x22')]()[_0x92fc('0x23')](function(){_0x38c70b[_0x92fc('0x17')](0xcc)[_0x92fc('0x24')]();});}};}function handleEntityNotFound(_0x1c97a9,_0x45fbfb){return function(_0x3ee298){if(!_0x3ee298){_0x1c97a9[_0x92fc('0x16')](0x194);}return _0x3ee298;};}function handleError(_0x4db8cd,_0x11b071){_0x11b071=_0x11b071||0x1f4;return function(_0x2fe1a4){logger['error'](_0x2fe1a4['stack']);if(_0x2fe1a4[_0x92fc('0x25')]){delete _0x2fe1a4[_0x92fc('0x25')];}_0x4db8cd[_0x92fc('0x17')](_0x11b071)['send'](_0x2fe1a4);};}exports[_0x92fc('0x26')]=function(_0x11324f,_0x3e4f74){var _0x317d32={},_0x556409={},_0x47f512={'count':0x0,'rows':[]};var _0xd0aaba=_[_0x92fc('0x27')](db['SquareRecording']['rawAttributes'],function(_0x8b6f5a){return{'name':_0x8b6f5a[_0x92fc('0x28')],'type':_0x8b6f5a[_0x92fc('0x29')][_0x92fc('0x2a')]};});_0x556409['model']=_['map'](_0xd0aaba,_0x92fc('0x25'));_0x556409[_0x92fc('0x2b')]=_['keys'](_0x11324f[_0x92fc('0x2b')]);_0x556409[_0x92fc('0x2c')]=_['intersection'](_0x556409[_0x92fc('0x2d')],_0x556409[_0x92fc('0x2b')]);_0x317d32['attributes']=_['intersection'](_0x556409[_0x92fc('0x2d')],qs[_0x92fc('0x2e')](_0x11324f[_0x92fc('0x2b')][_0x92fc('0x2e')]));_0x317d32[_0x92fc('0x2f')]=_0x317d32['attributes'][_0x92fc('0x30')]?_0x317d32[_0x92fc('0x2f')]:_0x556409[_0x92fc('0x2d')];if(!_0x11324f[_0x92fc('0x2b')]['hasOwnProperty'](_0x92fc('0x31'))){_0x317d32[_0x92fc('0x19')]=qs[_0x92fc('0x19')](_0x11324f[_0x92fc('0x2b')][_0x92fc('0x19')]);_0x317d32[_0x92fc('0x18')]=qs[_0x92fc('0x18')](_0x11324f['query'][_0x92fc('0x18')]);}_0x317d32[_0x92fc('0x32')]=qs[_0x92fc('0x33')](_0x11324f['query'][_0x92fc('0x33')]);_0x317d32[_0x92fc('0x34')]=qs[_0x92fc('0x2c')](_['pick'](_0x11324f[_0x92fc('0x2b')],_0x556409[_0x92fc('0x2c')]),_0xd0aaba);if(_0x11324f[_0x92fc('0x2b')]['filter']){_0x317d32[_0x92fc('0x34')]=_[_0x92fc('0x35')](_0x317d32[_0x92fc('0x34')],{'$or':_[_0x92fc('0x27')](_0xd0aaba,function(_0x3a9edf){if(_0x3a9edf[_0x92fc('0x29')]!==_0x92fc('0x36')){var _0x5a6ea3={};_0x5a6ea3[_0x3a9edf[_0x92fc('0x25')]]={'$like':'%'+_0x11324f[_0x92fc('0x2b')][_0x92fc('0x37')]+'%'};return _0x5a6ea3;}})});}_0x317d32=_[_0x92fc('0x35')]({},_0x317d32,_0x11324f['options']);var _0x4fa5d1={'where':_0x317d32['where']};return db[_0x92fc('0x38')]['count'](_0x4fa5d1)['then'](function(_0x54f7c1){_0x47f512[_0x92fc('0x1b')]=_0x54f7c1;if(_0x11324f[_0x92fc('0x2b')]['includeAll']){_0x317d32[_0x92fc('0x39')]=[{'all':!![]}];}return db[_0x92fc('0x38')][_0x92fc('0x3a')](_0x317d32);})[_0x92fc('0x23')](function(_0x31a43b){_0x47f512[_0x92fc('0x3b')]=_0x31a43b;return _0x47f512;})[_0x92fc('0x23')](respondWithFilteredResult(_0x3e4f74,_0x317d32))[_0x92fc('0x3c')](handleError(_0x3e4f74,null));};exports['show']=function(_0x337da7,_0x59d34d){var _0x4967a2={'raw':!![],'where':{'id':_0x337da7[_0x92fc('0x3d')]['id']}},_0x52098e={};_0x52098e['model']=_[_0x92fc('0x3e')](db['SquareRecording'][_0x92fc('0x3f')]);_0x52098e[_0x92fc('0x2b')]=_[_0x92fc('0x3e')](_0x337da7[_0x92fc('0x2b')]);_0x52098e['filters']=_['intersection'](_0x52098e[_0x92fc('0x2d')],_0x52098e[_0x92fc('0x2b')]);_0x4967a2[_0x92fc('0x2f')]=_[_0x92fc('0x40')](_0x52098e[_0x92fc('0x2d')],qs[_0x92fc('0x2e')](_0x337da7[_0x92fc('0x2b')][_0x92fc('0x2e')]));_0x4967a2[_0x92fc('0x2f')]=_0x4967a2[_0x92fc('0x2f')]['length']?_0x4967a2[_0x92fc('0x2f')]:_0x52098e[_0x92fc('0x2d')];if(_0x337da7[_0x92fc('0x2b')][_0x92fc('0x41')]){_0x4967a2['include']=[{'all':!![]}];}_0x4967a2=_[_0x92fc('0x35')]({},_0x4967a2,_0x337da7[_0x92fc('0x42')]);return db['SquareRecording'][_0x92fc('0x43')](_0x4967a2)[_0x92fc('0x23')](handleEntityNotFound(_0x59d34d,null))[_0x92fc('0x23')](respondWithResult(_0x59d34d,null))[_0x92fc('0x3c')](handleError(_0x59d34d,null));};exports[_0x92fc('0x44')]=function(_0x351cd8,_0x30a317){return db[_0x92fc('0x38')]['create'](_0x351cd8[_0x92fc('0x45')],{})[_0x92fc('0x23')](respondWithResult(_0x30a317,0xc9))['catch'](handleError(_0x30a317,null));};exports['update']=function(_0x2ac87c,_0x2a9292){if(_0x2ac87c[_0x92fc('0x45')]['id']){delete _0x2ac87c[_0x92fc('0x45')]['id'];}return db[_0x92fc('0x38')]['find']({'where':{'id':_0x2ac87c['params']['id']}})[_0x92fc('0x23')](handleEntityNotFound(_0x2a9292,null))[_0x92fc('0x23')](saveUpdates(_0x2ac87c['body'],null))[_0x92fc('0x23')](respondWithResult(_0x2a9292,null))[_0x92fc('0x3c')](handleError(_0x2a9292,null));};exports[_0x92fc('0x46')]=function(_0x115cd6,_0x32293b,_0x23b5c1){var _0x249eb2=require('../../components/encryptor');var _0x2daeb5=![];var _0x54e695={};if(_0x115cd6[_0x92fc('0x2b')]['type']&&_0x115cd6[_0x92fc('0x2b')][_0x92fc('0x29')]===_0x92fc('0x47')){_0x54e695['uniqueid']=_0x115cd6[_0x92fc('0x3d')]['id'];}else{_0x54e695['id']=_0x115cd6[_0x92fc('0x3d')]['id'];}return db[_0x92fc('0x38')][_0x92fc('0x43')]({'where':_0x54e695,'attributes':['id',_0x92fc('0x48'),_0x92fc('0x49')],'raw':!![]})[_0x92fc('0x23')](handleEntityNotFound(_0x32293b,null))[_0x92fc('0x23')](function(_0xffbe41){if(_0xffbe41){var _0x53ee32=_0xffbe41[_0x92fc('0x48')];var _0x23beb2=util[_0x92fc('0x4a')](_0x92fc('0x4b'),_0x53ee32);if(fs[_0x92fc('0x4c')](_0x23beb2)){_0x2daeb5=!![];return _0x249eb2[_0x92fc('0x4d')](_0x23beb2,_0x53ee32,config[_0x92fc('0x4e')]['recording'])['then'](function(){return _0xffbe41;});}return _0xffbe41;}})[_0x92fc('0x23')](function(_0x1e03b9){if(_0x1e03b9){var _0x29c60e=_0x1e03b9[_0x92fc('0x48')];if(!fs[_0x92fc('0x4c')](_0x29c60e)){throw new db[(_0x92fc('0x4f'))][(_0x92fc('0x50'))]('SquareRecording\x20not\x20found');}if(_0x1e03b9[_0x92fc('0x49')]){return _0x32293b[_0x92fc('0x46')](_0x29c60e,_0x1e03b9[_0x92fc('0x49')]+path['extname'](_0x29c60e),function(){if(_0x2daeb5){fs['unlink'](_0x29c60e);}});}else{return _0x32293b[_0x92fc('0x46')](_0x29c60e,function(_0x234d03){if(_0x2daeb5){fs['unlink'](_0x29c60e);}});}}})[_0x92fc('0x3c')](function(_0x4898c8){if(_0x4898c8['message']===_0x92fc('0x51')){_0x32293b[_0x92fc('0x17')](0x194)[_0x92fc('0x52')](_0x92fc('0x53'));}else{return handleError(_0x32293b,null);}});};exports[_0x92fc('0x22')]=function(_0x10a06d,_0x142eb0){return db['SquareRecording']['find']({'where':{'id':_0x10a06d[_0x92fc('0x3d')]['id']}})[_0x92fc('0x23')](function(_0x1b68ac){if(_[_0x92fc('0x54')](_0x1b68ac)){throw new ReferenceError(_0x92fc('0x55'));}return _0x1b68ac;})[_0x92fc('0x23')](function(_0x2bb9fa){var _0x2dca57=_0x2bb9fa['savePath'];logger['info'](_0x92fc('0x56'),_0x2dca57);if(!_[_0x92fc('0x54')](_0x2bb9fa[_0x92fc('0x48')])&&fs[_0x92fc('0x4c')](_0x2dca57)){logger['info'](_0x92fc('0x57')+_0x2dca57+_0x92fc('0x58'));fs[_0x92fc('0x59')](_0x2dca57);}_0x2dca57=_0x2dca57+_0x92fc('0x5a');if(!_['isNil'](_0x2bb9fa[_0x92fc('0x48')])&&fs[_0x92fc('0x4c')](_0x2dca57)){logger[_0x92fc('0x5b')](_0x92fc('0x57')+_0x2dca57+_0x92fc('0x58'));fs[_0x92fc('0x59')](_0x2dca57);}return _0x2bb9fa;})['then'](function(_0x3b406e){if(!_0x3b406e)throw new InternalError();return _0x3b406e[_0x92fc('0x22')]();})[_0x92fc('0x23')](function(){_0x142eb0[_0x92fc('0x17')](0xcc)[_0x92fc('0x24')]();})['catch'](handleError(_0x142eb0,null));}; \ No newline at end of file +var _0xe221=['create','body','savePath','format','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','download','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','existsSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','keys','intersection','query','fields','attributes','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','filters','find'];(function(_0x4bf105,_0x4118a5){var _0x3da58e=function(_0x27a817){while(--_0x27a817){_0x4bf105['push'](_0x4bf105['shift']());}};_0x3da58e(++_0x4118a5);}(_0xe221,0x19d));var _0x1e22=function(_0x16a764,_0x439f24){_0x16a764=_0x16a764-0x0;var _0xa6b352=_0xe221[_0x16a764];return _0xa6b352;};'use strict';var emlformat=require(_0x1e22('0x0'));var rimraf=require(_0x1e22('0x1'));var zipdir=require(_0x1e22('0x2'));var jsonpatch=require(_0x1e22('0x3'));var rp=require(_0x1e22('0x4'));var moment=require(_0x1e22('0x5'));var BPromise=require(_0x1e22('0x6'));var Mustache=require(_0x1e22('0x7'));var util=require(_0x1e22('0x8'));var path=require(_0x1e22('0x9'));var sox=require(_0x1e22('0xa'));var csv=require('to-csv');var ejs=require(_0x1e22('0xb'));var fs=require('fs');var fs_extra=require(_0x1e22('0xc'));var _=require(_0x1e22('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e22('0xe'));var deskjs=require(_0x1e22('0xf'));var toCsv=require(_0x1e22('0x10'));var querystring=require(_0x1e22('0x11'));var Papa=require(_0x1e22('0x12'));var Redis=require(_0x1e22('0x13'));var authService=require(_0x1e22('0x14'));var qs=require(_0x1e22('0x15'));var as=require(_0x1e22('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e22('0x17'))(_0x1e22('0x18'));var utils=require(_0x1e22('0x19'));var config=require(_0x1e22('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f143b,_0x27e193){_0x27e193=_0x27e193||0xcc;return function(_0x12309c){if(_0x12309c){return _0x2f143b[_0x1e22('0x1b')](_0x27e193);}return _0x2f143b[_0x1e22('0x1c')](_0x27e193)[_0x1e22('0x1d')]();};}function respondWithResult(_0x4961b1,_0x271e9b){_0x271e9b=_0x271e9b||0xc8;return function(_0x17acbe){if(_0x17acbe){return _0x4961b1[_0x1e22('0x1c')](_0x271e9b)[_0x1e22('0x1e')](_0x17acbe);}};}function respondWithFilteredResult(_0x18a506,_0x1319a8){return function(_0x431bfe){if(_0x431bfe){var _0x338c69=typeof _0x1319a8[_0x1e22('0x1f')]===_0x1e22('0x20')&&typeof _0x1319a8[_0x1e22('0x21')]==='undefined';var _0x370b10=_0x431bfe[_0x1e22('0x22')];var _0x1a1905=_0x338c69?0x0:_0x1319a8[_0x1e22('0x1f')];var _0x6d23d6=_0x338c69?_0x431bfe[_0x1e22('0x22')]:_0x1319a8[_0x1e22('0x1f')]+_0x1319a8[_0x1e22('0x21')];var _0x2c0664;if(_0x6d23d6>=_0x370b10){_0x6d23d6=_0x370b10;_0x2c0664=0xc8;}else{_0x2c0664=0xce;}_0x18a506[_0x1e22('0x1c')](_0x2c0664);return _0x18a506[_0x1e22('0x23')](_0x1e22('0x24'),_0x1a1905+'-'+_0x6d23d6+'/'+_0x370b10)[_0x1e22('0x1e')](_0x431bfe);}return null;};}function patchUpdates(_0x44290b){return function(_0x4cd54f){try{jsonpatch['apply'](_0x4cd54f,_0x44290b,!![]);}catch(_0x539a1d){return BPromise[_0x1e22('0x25')](_0x539a1d);}return _0x4cd54f['save']();};}function saveUpdates(_0xb06aac,_0x5ce944){return function(_0x5d019f){if(_0x5d019f){return _0x5d019f[_0x1e22('0x26')](_0xb06aac)[_0x1e22('0x27')](function(_0x543a3e){return _0x543a3e;});}return null;};}function removeEntity(_0x4de034,_0x396e16){return function(_0x5b0d57){if(_0x5b0d57){return _0x5b0d57[_0x1e22('0x28')]()[_0x1e22('0x27')](function(){_0x4de034[_0x1e22('0x1c')](0xcc)[_0x1e22('0x1d')]();});}};}function handleEntityNotFound(_0x4def52,_0x2263d1){return function(_0x5b8671){if(!_0x5b8671){_0x4def52[_0x1e22('0x1b')](0x194);}return _0x5b8671;};}function handleError(_0x275936,_0xc23196){_0xc23196=_0xc23196||0x1f4;return function(_0x1638e9){logger[_0x1e22('0x29')](_0x1638e9[_0x1e22('0x2a')]);if(_0x1638e9['name']){delete _0x1638e9[_0x1e22('0x2b')];}_0x275936[_0x1e22('0x1c')](_0xc23196)[_0x1e22('0x2c')](_0x1638e9);};}exports[_0x1e22('0x2d')]=function(_0x2b6755,_0x39e94d){var _0x4b5161={},_0x9718a1={},_0x49eff7={'count':0x0,'rows':[]};var _0x232f25=_[_0x1e22('0x2e')](db[_0x1e22('0x2f')][_0x1e22('0x30')],function(_0x40a92a){return{'name':_0x40a92a['fieldName'],'type':_0x40a92a[_0x1e22('0x31')][_0x1e22('0x32')]};});_0x9718a1[_0x1e22('0x33')]=_[_0x1e22('0x2e')](_0x232f25,_0x1e22('0x2b'));_0x9718a1['query']=_[_0x1e22('0x34')](_0x2b6755['query']);_0x9718a1['filters']=_[_0x1e22('0x35')](_0x9718a1[_0x1e22('0x33')],_0x9718a1[_0x1e22('0x36')]);_0x4b5161['attributes']=_[_0x1e22('0x35')](_0x9718a1[_0x1e22('0x33')],qs['fields'](_0x2b6755['query'][_0x1e22('0x37')]));_0x4b5161[_0x1e22('0x38')]=_0x4b5161[_0x1e22('0x38')]['length']?_0x4b5161[_0x1e22('0x38')]:_0x9718a1['model'];if(!_0x2b6755[_0x1e22('0x36')]['hasOwnProperty']('nolimit')){_0x4b5161[_0x1e22('0x21')]=qs[_0x1e22('0x21')](_0x2b6755['query']['limit']);_0x4b5161[_0x1e22('0x1f')]=qs[_0x1e22('0x1f')](_0x2b6755[_0x1e22('0x36')][_0x1e22('0x1f')]);}_0x4b5161['order']=qs[_0x1e22('0x39')](_0x2b6755[_0x1e22('0x36')][_0x1e22('0x39')]);_0x4b5161[_0x1e22('0x3a')]=qs['filters'](_[_0x1e22('0x3b')](_0x2b6755[_0x1e22('0x36')],_0x9718a1['filters']),_0x232f25);if(_0x2b6755[_0x1e22('0x36')][_0x1e22('0x3c')]){_0x4b5161['where']=_['merge'](_0x4b5161[_0x1e22('0x3a')],{'$or':_[_0x1e22('0x2e')](_0x232f25,function(_0x559de8){if(_0x559de8[_0x1e22('0x31')]!==_0x1e22('0x3d')){var _0xeb6561={};_0xeb6561[_0x559de8['name']]={'$like':'%'+_0x2b6755[_0x1e22('0x36')]['filter']+'%'};return _0xeb6561;}})});}_0x4b5161=_['merge']({},_0x4b5161,_0x2b6755[_0x1e22('0x3e')]);var _0x38a849={'where':_0x4b5161['where']};return db[_0x1e22('0x2f')][_0x1e22('0x22')](_0x38a849)['then'](function(_0x3d1de4){_0x49eff7[_0x1e22('0x22')]=_0x3d1de4;if(_0x2b6755['query'][_0x1e22('0x3f')]){_0x4b5161[_0x1e22('0x40')]=[{'all':!![]}];}return db[_0x1e22('0x2f')][_0x1e22('0x41')](_0x4b5161);})['then'](function(_0x5766ba){_0x49eff7[_0x1e22('0x42')]=_0x5766ba;return _0x49eff7;})[_0x1e22('0x27')](respondWithFilteredResult(_0x39e94d,_0x4b5161))[_0x1e22('0x43')](handleError(_0x39e94d,null));};exports[_0x1e22('0x44')]=function(_0x326fc5,_0x491054){var _0x4fc0d2={'raw':!![],'where':{'id':_0x326fc5[_0x1e22('0x45')]['id']}},_0x5efc9d={};_0x5efc9d[_0x1e22('0x33')]=_[_0x1e22('0x34')](db['SquareRecording'][_0x1e22('0x30')]);_0x5efc9d[_0x1e22('0x36')]=_[_0x1e22('0x34')](_0x326fc5[_0x1e22('0x36')]);_0x5efc9d[_0x1e22('0x46')]=_['intersection'](_0x5efc9d[_0x1e22('0x33')],_0x5efc9d[_0x1e22('0x36')]);_0x4fc0d2[_0x1e22('0x38')]=_[_0x1e22('0x35')](_0x5efc9d[_0x1e22('0x33')],qs['fields'](_0x326fc5[_0x1e22('0x36')][_0x1e22('0x37')]));_0x4fc0d2[_0x1e22('0x38')]=_0x4fc0d2[_0x1e22('0x38')]['length']?_0x4fc0d2[_0x1e22('0x38')]:_0x5efc9d[_0x1e22('0x33')];if(_0x326fc5['query'][_0x1e22('0x3f')]){_0x4fc0d2[_0x1e22('0x40')]=[{'all':!![]}];}_0x4fc0d2=_['merge']({},_0x4fc0d2,_0x326fc5[_0x1e22('0x3e')]);return db[_0x1e22('0x2f')][_0x1e22('0x47')](_0x4fc0d2)[_0x1e22('0x27')](handleEntityNotFound(_0x491054,null))[_0x1e22('0x27')](respondWithResult(_0x491054,null))[_0x1e22('0x43')](handleError(_0x491054,null));};exports[_0x1e22('0x48')]=function(_0x300e9f,_0x1af827){return db[_0x1e22('0x2f')][_0x1e22('0x48')](_0x300e9f[_0x1e22('0x49')],{})[_0x1e22('0x27')](respondWithResult(_0x1af827,0xc9))[_0x1e22('0x43')](handleError(_0x1af827,null));};exports[_0x1e22('0x26')]=function(_0x5d4f23,_0x5e64c4){if(_0x5d4f23[_0x1e22('0x49')]['id']){delete _0x5d4f23[_0x1e22('0x49')]['id'];}return db[_0x1e22('0x2f')][_0x1e22('0x47')]({'where':{'id':_0x5d4f23[_0x1e22('0x45')]['id']}})[_0x1e22('0x27')](handleEntityNotFound(_0x5e64c4,null))[_0x1e22('0x27')](saveUpdates(_0x5d4f23[_0x1e22('0x49')],null))[_0x1e22('0x27')](respondWithResult(_0x5e64c4,null))['catch'](handleError(_0x5e64c4,null));};exports['download']=function(_0x24e89a,_0x1bc17d,_0x1fac69){var _0x2e502a=require('../../components/encryptor');var _0x430961=![];var _0x2b6fed={};if(_0x24e89a[_0x1e22('0x36')][_0x1e22('0x31')]&&_0x24e89a[_0x1e22('0x36')][_0x1e22('0x31')]==='uniqueid'){_0x2b6fed['uniqueid']=_0x24e89a[_0x1e22('0x45')]['id'];}else{_0x2b6fed['id']=_0x24e89a[_0x1e22('0x45')]['id'];}return db[_0x1e22('0x2f')]['find']({'where':_0x2b6fed,'attributes':['id',_0x1e22('0x4a'),'filename'],'raw':!![]})[_0x1e22('0x27')](handleEntityNotFound(_0x1bc17d,null))['then'](function(_0x3b4b9a){if(_0x3b4b9a){var _0x1065a9=_0x3b4b9a[_0x1e22('0x4a')];var _0x26ce5a=util[_0x1e22('0x4b')](_0x1e22('0x4c'),_0x1065a9);if(fs['existsSync'](_0x26ce5a)){_0x430961=!![];return _0x2e502a[_0x1e22('0x4d')](_0x26ce5a,_0x1065a9,config[_0x1e22('0x4e')]['recording'])['then'](function(){return _0x3b4b9a;});}return _0x3b4b9a;}})[_0x1e22('0x27')](function(_0x378962){if(_0x378962){var _0xe0f90c=_0x378962[_0x1e22('0x4a')];if(!fs['existsSync'](_0xe0f90c)){throw new db[(_0x1e22('0x4f'))][(_0x1e22('0x50'))](_0x1e22('0x51'));}if(_0x378962['filename']){return _0x1bc17d['download'](_0xe0f90c,_0x378962[_0x1e22('0x52')]+path[_0x1e22('0x53')](_0xe0f90c),function(){if(_0x430961){fs['unlink'](_0xe0f90c);}});}else{return _0x1bc17d[_0x1e22('0x54')](_0xe0f90c,function(_0x24bf28){if(_0x430961){fs[_0x1e22('0x55')](_0xe0f90c);}});}}})[_0x1e22('0x43')](function(_0x3863d8){if(_0x3863d8[_0x1e22('0x56')]===_0x1e22('0x51')){_0x1bc17d[_0x1e22('0x1c')](0x194)[_0x1e22('0x2c')](_0x1e22('0x57'));}else{return handleError(_0x1bc17d,null);}});};exports[_0x1e22('0x28')]=function(_0x285703,_0x25dfc2){return db[_0x1e22('0x2f')]['find']({'where':{'id':_0x285703[_0x1e22('0x45')]['id']}})['then'](function(_0x3f969e){if(_[_0x1e22('0x58')](_0x3f969e)){throw new ReferenceError(_0x1e22('0x59'));}return _0x3f969e;})[_0x1e22('0x27')](function(_0x5c4f1f){var _0x2166a0=_0x5c4f1f[_0x1e22('0x4a')];logger[_0x1e22('0x5a')](_0x1e22('0x5b'),_0x2166a0);if(!_[_0x1e22('0x58')](_0x5c4f1f[_0x1e22('0x4a')])&&fs['existsSync'](_0x2166a0)){logger[_0x1e22('0x5a')](_0x1e22('0x5c')+_0x2166a0+_0x1e22('0x5d'));fs[_0x1e22('0x5e')](_0x2166a0);}_0x2166a0=_0x2166a0+_0x1e22('0x5f');if(!_[_0x1e22('0x58')](_0x5c4f1f[_0x1e22('0x4a')])&&fs[_0x1e22('0x60')](_0x2166a0)){logger[_0x1e22('0x5a')](_0x1e22('0x5c')+_0x2166a0+_0x1e22('0x5d'));fs['unlinkSync'](_0x2166a0);}return _0x5c4f1f;})[_0x1e22('0x27')](function(_0x323a0e){if(!_0x323a0e)throw new InternalError();return _0x323a0e[_0x1e22('0x28')]();})[_0x1e22('0x27')](function(){_0x25dfc2[_0x1e22('0x1c')](0xcc)[_0x1e22('0x1d')]();})[_0x1e22('0x43')](handleError(_0x25dfc2,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 369ead9..d97a5ea 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 _0xed5c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareRecording','square_recordings','lodash'];(function(_0x29cb61,_0x494484){var _0x21d3e0=function(_0x3e0ac4){while(--_0x3e0ac4){_0x29cb61['push'](_0x29cb61['shift']());}};_0x21d3e0(++_0x494484);}(_0xed5c,0x81));var _0xced5=function(_0xa9fe05,_0xc559da){_0xa9fe05=_0xa9fe05-0x0;var _0x4ce538=_0xed5c[_0xa9fe05];return _0x4ce538;};'use strict';var _=require(_0xced5('0x0'));var util=require(_0xced5('0x1'));var logger=require(_0xced5('0x2'))(_0xced5('0x3'));var moment=require(_0xced5('0x4'));var BPromise=require(_0xced5('0x5'));var rp=require(_0xced5('0x6'));var fs=require('fs');var path=require(_0xced5('0x7'));var rimraf=require(_0xced5('0x8'));var config=require(_0xced5('0x9'));var attributes=require('./squareRecording.attributes');module[_0xced5('0xa')]=function(_0x20ff58,_0x4b7807){return _0x20ff58['define'](_0xced5('0xb'),attributes,{'tableName':_0xced5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4329=['./squareRecording.attributes','exports','SquareRecording','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7f045d,_0x2c81f0){var _0xf8e4cb=function(_0x256e8f){while(--_0x256e8f){_0x7f045d['push'](_0x7f045d['shift']());}};_0xf8e4cb(++_0x2c81f0);}(_0x4329,0x13b));var _0x9432=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4329[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var logger=require(_0x9432('0x2'))(_0x9432('0x3'));var moment=require(_0x9432('0x4'));var BPromise=require(_0x9432('0x5'));var rp=require(_0x9432('0x6'));var fs=require('fs');var path=require(_0x9432('0x7'));var rimraf=require(_0x9432('0x8'));var config=require(_0x9432('0x9'));var attributes=require(_0x9432('0xa'));module[_0x9432('0xb')]=function(_0x1ca7e0,_0x27edef){return _0x1ca7e0['define'](_0x9432('0xc'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 86214fa..25cae3b 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 _0x1f07=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording','create','body','options','raw','debug','CreateSquareRecording','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3a77ba,_0x4f1cca){var _0x14d7be=function(_0x451501){while(--_0x451501){_0x3a77ba['push'](_0x3a77ba['shift']());}};_0x14d7be(++_0x4f1cca);}(_0x1f07,0x11e));var _0x71f0=function(_0x53baac,_0x4304a2){_0x53baac=_0x53baac-0x0;var _0x3fdc35=_0x1f07[_0x53baac];return _0x3fdc35;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x71f0('0x0'));var BPromise=require(_0x71f0('0x1'));var rs=require(_0x71f0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71f0('0x3'))['db'];var utils=require(_0x71f0('0x4'));var logger=require(_0x71f0('0x5'))(_0x71f0('0x6'));var config=require(_0x71f0('0x7'));var jayson=require(_0x71f0('0x8'));var client=jayson[_0x71f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x94e60a,_0x6f0f46,_0x426370){return new BPromise(function(_0x5ba79a,_0x20e112){return client[_0x71f0('0xa')](_0x94e60a,_0x426370)[_0x71f0('0xb')](function(_0x192502){logger[_0x71f0('0xc')](_0x71f0('0xd'),_0x6f0f46,_0x71f0('0xe'));logger['debug'](_0x71f0('0xf'),_0x6f0f46,_0x71f0('0xe'),JSON[_0x71f0('0x10')](_0x192502));if(_0x192502[_0x71f0('0x11')]){if(_0x192502[_0x71f0('0x11')][_0x71f0('0x12')]===0x1f4){logger[_0x71f0('0x11')](_0x71f0('0xd'),_0x6f0f46,_0x192502[_0x71f0('0x11')]['message']);return _0x20e112(_0x192502[_0x71f0('0x11')][_0x71f0('0x13')]);}logger[_0x71f0('0x11')](_0x71f0('0xd'),_0x6f0f46,_0x192502[_0x71f0('0x11')][_0x71f0('0x13')]);return _0x5ba79a(_0x192502['error'][_0x71f0('0x13')]);}else{logger['info'](_0x71f0('0xd'),_0x6f0f46,_0x71f0('0xe'));_0x5ba79a(_0x192502[_0x71f0('0x14')][_0x71f0('0x13')]);}})[_0x71f0('0x15')](function(_0x3fe656){logger[_0x71f0('0x11')](_0x71f0('0xd'),_0x6f0f46,_0x3fe656);_0x20e112(_0x3fe656);});});}exports['CreateSquareRecording']=function(_0x271e06){var _0x41f892=this;return new Promise(function(_0x1e5d18,_0xa9e588){return db[_0x71f0('0x16')][_0x71f0('0x17')](_0x271e06[_0x71f0('0x18')],{'raw':_0x271e06['options']?_0x271e06[_0x71f0('0x19')][_0x71f0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x56a4b7){logger[_0x71f0('0xc')]('CreateSquareRecording',_0x271e06);logger[_0x71f0('0x1b')](_0x71f0('0x1c'),_0x271e06,JSON[_0x71f0('0x10')](_0x56a4b7));_0x1e5d18(_0x56a4b7);})['catch'](function(_0xec24f2){logger['error'](_0x71f0('0x1c'),_0xec24f2[_0x71f0('0x13')],_0x271e06);_0xa9e588(_0x41f892[_0x71f0('0x11')](0x1f4,_0xec24f2[_0x71f0('0x13')]));});});}; \ No newline at end of file +var _0x9128=['http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x321e99,_0x3a38b7){var _0x39cda4=function(_0x2697e9){while(--_0x2697e9){_0x321e99['push'](_0x321e99['shift']());}};_0x39cda4(++_0x3a38b7);}(_0x9128,0x152));var _0x8912=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x9128[_0x1c3b41];return _0x41e3fe;};'use strict';var _=require(_0x8912('0x0'));var util=require(_0x8912('0x1'));var moment=require(_0x8912('0x2'));var BPromise=require(_0x8912('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8912('0x4'));var db=require(_0x8912('0x5'))['db'];var utils=require(_0x8912('0x6'));var logger=require('../../config/logger')(_0x8912('0x7'));var config=require('../../config/environment');var jayson=require(_0x8912('0x8'));var client=jayson[_0x8912('0x9')][_0x8912('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457f94,_0x3cdd50,_0x3a1c90){return new BPromise(function(_0x2e0b02,_0x3195f0){return client[_0x8912('0xb')](_0x457f94,_0x3a1c90)['then'](function(_0x330286){logger[_0x8912('0xc')](_0x8912('0xd'),_0x3cdd50,_0x8912('0xe'));logger[_0x8912('0xf')](_0x8912('0x10'),_0x3cdd50,'request\x20sent',JSON[_0x8912('0x11')](_0x330286));if(_0x330286['error']){if(_0x330286[_0x8912('0x12')][_0x8912('0x13')]===0x1f4){logger[_0x8912('0x12')](_0x8912('0xd'),_0x3cdd50,_0x330286[_0x8912('0x12')][_0x8912('0x14')]);return _0x3195f0(_0x330286[_0x8912('0x12')]['message']);}logger[_0x8912('0x12')](_0x8912('0xd'),_0x3cdd50,_0x330286['error'][_0x8912('0x14')]);return _0x2e0b02(_0x330286[_0x8912('0x12')][_0x8912('0x14')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x3cdd50,'request\x20sent');_0x2e0b02(_0x330286[_0x8912('0x15')]['message']);}})[_0x8912('0x16')](function(_0x66724c){logger[_0x8912('0x12')]('SquareRecording,\x20%s,\x20%s',_0x3cdd50,_0x66724c);_0x3195f0(_0x66724c);});});}exports[_0x8912('0x17')]=function(_0x60c6ef){var _0x57fdee=this;return new Promise(function(_0x670b97,_0x1e1059){return db[_0x8912('0x18')]['create'](_0x60c6ef[_0x8912('0x19')],{'raw':_0x60c6ef[_0x8912('0x1a')]?_0x60c6ef['options'][_0x8912('0x1b')]===undefined?!![]:![]:!![]})[_0x8912('0x1c')](function(_0x15ff36){logger[_0x8912('0xc')](_0x8912('0x17'),_0x60c6ef);logger[_0x8912('0xf')]('CreateSquareRecording',_0x60c6ef,JSON[_0x8912('0x11')](_0x15ff36));_0x670b97(_0x15ff36);})[_0x8912('0x16')](function(_0x3b29a2){logger[_0x8912('0x12')](_0x8912('0x17'),_0x3b29a2[_0x8912('0x14')],_0x60c6ef);_0x1e1059(_0x57fdee[_0x8912('0x12')](0x1f4,_0x3b29a2[_0x8912('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index caaba1a..7b87f10 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 _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(_0x3b5530,_0x14fa87){var _0x1a74b5=function(_0x4f74be){while(--_0x4f74be){_0x3b5530['push'](_0x3b5530['shift']());}};_0x1a74b5(++_0x14fa87);}(_0xe706,0xa3));var _0x6e70=function(_0x56d0b2,_0x2f7c9e){_0x56d0b2=_0x56d0b2-0x0;var _0x37e421=_0xe706[_0x56d0b2];return _0x37e421;};'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 +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xf74275,_0x1d1760){var _0x35703e=function(_0x402da1){while(--_0x402da1){_0xf74275['push'](_0xf74275['shift']());}};_0x35703e(++_0x1d1760);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9d94314..d58d433 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 _0x1a8b=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1a8b,0xbd));var _0xb1a8=function(_0x169a35,_0x3a33a7){_0x169a35=_0x169a35-0x0;var _0x4aa55c=_0x1a8b[_0x169a35];return _0x4aa55c;};'use strict';var Sequelize=require(_0xb1a8('0x0'));module['exports']={'network':{'type':Sequelize[_0xb1a8('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xb1a8('0x1')]},'channel':{'type':Sequelize[_0xb1a8('0x1')]},'language':{'type':Sequelize[_0xb1a8('0x1')]},'type':{'type':Sequelize[_0xb1a8('0x1')]},'uniqueid':{'type':Sequelize[_0xb1a8('0x1')]},'version':{'type':Sequelize[_0xb1a8('0x1')]},'callerid':{'type':Sequelize[_0xb1a8('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xb1a8('0x1')]},'callingani2':{'type':Sequelize[_0xb1a8('0x1')]},'callington':{'type':Sequelize[_0xb1a8('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xb1a8('0x1')]},'context':{'type':Sequelize[_0xb1a8('0x1')]},'extension':{'type':Sequelize[_0xb1a8('0x1')]},'priority':{'type':Sequelize[_0xb1a8('0x1')]},'enhanced':{'type':Sequelize[_0xb1a8('0x1')]},'accountcode':{'type':Sequelize[_0xb1a8('0x1')]},'threadid':{'type':Sequelize[_0xb1a8('0x1')]},'project_name':{'type':Sequelize[_0xb1a8('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb1a8('0x2')]},'bot':{'type':Sequelize[_0xb1a8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2dca=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3a8d57,_0x2c429d){var _0x1c8686=function(_0x2510ad){while(--_0x2510ad){_0x3a8d57['push'](_0x3a8d57['shift']());}};_0x1c8686(++_0x2c429d);}(_0x2dca,0xdb));var _0xa2dc=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x2dca[_0x202c61];return _0x540691;};'use strict';var Sequelize=require(_0xa2dc('0x0'));module[_0xa2dc('0x1')]={'network':{'type':Sequelize[_0xa2dc('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xa2dc('0x2')]},'channel':{'type':Sequelize[_0xa2dc('0x2')]},'language':{'type':Sequelize[_0xa2dc('0x2')]},'type':{'type':Sequelize[_0xa2dc('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xa2dc('0x2')]},'callerid':{'type':Sequelize[_0xa2dc('0x2')]},'calleridname':{'type':Sequelize[_0xa2dc('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa2dc('0x2')]},'callington':{'type':Sequelize[_0xa2dc('0x2')]},'callingtns':{'type':Sequelize[_0xa2dc('0x2')]},'dnid':{'type':Sequelize[_0xa2dc('0x2')]},'rdnis':{'type':Sequelize[_0xa2dc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xa2dc('0x2')]},'accountcode':{'type':Sequelize[_0xa2dc('0x2')]},'threadid':{'type':Sequelize[_0xa2dc('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa2dc('0x3')]},'leaveAt':{'type':Sequelize[_0xa2dc('0x3')]},'bot':{'type':Sequelize[_0xa2dc('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index dead3cd..7c1c653 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 _0x2439=['nolimit','order','where','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','SquareReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xbe90aa,_0x4be8c6){var _0x13fed0=function(_0x1b6a28){while(--_0x1b6a28){_0xbe90aa['push'](_0xbe90aa['shift']());}};_0x13fed0(++_0x4be8c6);}(_0x2439,0x178));var _0x9243=function(_0x193a6e,_0x45dd00){_0x193a6e=_0x193a6e-0x0;var _0x599a9b=_0x2439[_0x193a6e];return _0x599a9b;};'use strict';var emlformat=require(_0x9243('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9243('0x1'));var jsonpatch=require(_0x9243('0x2'));var rp=require(_0x9243('0x3'));var moment=require(_0x9243('0x4'));var BPromise=require(_0x9243('0x5'));var Mustache=require(_0x9243('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9243('0x7'));var csv=require(_0x9243('0x8'));var ejs=require(_0x9243('0x9'));var fs=require('fs');var fs_extra=require(_0x9243('0xa'));var _=require(_0x9243('0xb'));var squel=require(_0x9243('0xc'));var crypto=require('crypto');var jsforce=require(_0x9243('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9243('0xe'));var Redis=require(_0x9243('0xf'));var authService=require(_0x9243('0x10'));var qs=require(_0x9243('0x11'));var as=require(_0x9243('0x12'));var hardwareService=require(_0x9243('0x13'));var logger=require(_0x9243('0x14'))(_0x9243('0x15'));var utils=require(_0x9243('0x16'));var config=require(_0x9243('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9243('0x18'))['db'];function respondWithStatusCode(_0x54a491,_0xec4653){_0xec4653=_0xec4653||0xcc;return function(_0xdcdb05){if(_0xdcdb05){return _0x54a491[_0x9243('0x19')](_0xec4653);}return _0x54a491[_0x9243('0x1a')](_0xec4653)[_0x9243('0x1b')]();};}function respondWithResult(_0x4a2bc5,_0x420898){_0x420898=_0x420898||0xc8;return function(_0xbeeabc){if(_0xbeeabc){return _0x4a2bc5[_0x9243('0x1a')](_0x420898)[_0x9243('0x1c')](_0xbeeabc);}};}function respondWithFilteredResult(_0x496d6a,_0x5f5d59){return function(_0x6ee461){if(_0x6ee461){var _0x18dd04=typeof _0x5f5d59[_0x9243('0x1d')]==='undefined'&&typeof _0x5f5d59[_0x9243('0x1e')]===_0x9243('0x1f');var _0x15ae9e=_0x6ee461[_0x9243('0x20')];var _0x263821=_0x18dd04?0x0:_0x5f5d59[_0x9243('0x1d')];var _0x1fd514=_0x18dd04?_0x6ee461['count']:_0x5f5d59[_0x9243('0x1d')]+_0x5f5d59[_0x9243('0x1e')];var _0x257a19;if(_0x1fd514>=_0x15ae9e){_0x1fd514=_0x15ae9e;_0x257a19=0xc8;}else{_0x257a19=0xce;}_0x496d6a[_0x9243('0x1a')](_0x257a19);return _0x496d6a[_0x9243('0x21')](_0x9243('0x22'),_0x263821+'-'+_0x1fd514+'/'+_0x15ae9e)['json'](_0x6ee461);}return null;};}function patchUpdates(_0x32beca){return function(_0x24d7b7){try{jsonpatch[_0x9243('0x23')](_0x24d7b7,_0x32beca,!![]);}catch(_0x25f93f){return BPromise[_0x9243('0x24')](_0x25f93f);}return _0x24d7b7[_0x9243('0x25')]();};}function saveUpdates(_0x11b5b2,_0x56be75){return function(_0x1d0c7a){if(_0x1d0c7a){return _0x1d0c7a['update'](_0x11b5b2)[_0x9243('0x26')](function(_0x50f581){return _0x50f581;});}return null;};}function removeEntity(_0x29d85f,_0x45f799){return function(_0x467fb3){if(_0x467fb3){return _0x467fb3[_0x9243('0x27')]()[_0x9243('0x26')](function(){_0x29d85f['status'](0xcc)[_0x9243('0x1b')]();});}};}function handleEntityNotFound(_0x29e842,_0xac6978){return function(_0x1fbe50){if(!_0x1fbe50){_0x29e842['sendStatus'](0x194);}return _0x1fbe50;};}function handleError(_0x326443,_0x2104de){_0x2104de=_0x2104de||0x1f4;return function(_0x1982f5){logger['error'](_0x1982f5[_0x9243('0x28')]);if(_0x1982f5[_0x9243('0x29')]){delete _0x1982f5[_0x9243('0x29')];}_0x326443['status'](_0x2104de)[_0x9243('0x2a')](_0x1982f5);};}exports['index']=function(_0x86ccd7,_0x4afe66){var _0x1cacbe={},_0x299c3d={},_0x1f5245={'count':0x0,'rows':[]};var _0x1c90a3=_[_0x9243('0x2b')](db[_0x9243('0x2c')]['rawAttributes'],function(_0x3f93e6){return{'name':_0x3f93e6[_0x9243('0x2d')],'type':_0x3f93e6[_0x9243('0x2e')]['key']};});_0x299c3d[_0x9243('0x2f')]=_[_0x9243('0x2b')](_0x1c90a3,_0x9243('0x29'));_0x299c3d[_0x9243('0x30')]=_[_0x9243('0x31')](_0x86ccd7[_0x9243('0x30')]);_0x299c3d[_0x9243('0x32')]=_[_0x9243('0x33')](_0x299c3d['model'],_0x299c3d[_0x9243('0x30')]);_0x1cacbe[_0x9243('0x34')]=_['intersection'](_0x299c3d[_0x9243('0x2f')],qs[_0x9243('0x35')](_0x86ccd7[_0x9243('0x30')][_0x9243('0x35')]));_0x1cacbe[_0x9243('0x34')]=_0x1cacbe[_0x9243('0x34')][_0x9243('0x36')]?_0x1cacbe[_0x9243('0x34')]:_0x299c3d[_0x9243('0x2f')];if(!_0x86ccd7[_0x9243('0x30')][_0x9243('0x37')](_0x9243('0x38'))){_0x1cacbe[_0x9243('0x1e')]=qs[_0x9243('0x1e')](_0x86ccd7[_0x9243('0x30')][_0x9243('0x1e')]);_0x1cacbe['offset']=qs[_0x9243('0x1d')](_0x86ccd7[_0x9243('0x30')][_0x9243('0x1d')]);}_0x1cacbe[_0x9243('0x39')]=qs['sort'](_0x86ccd7['query']['sort']);_0x1cacbe[_0x9243('0x3a')]=qs['filters'](_['pick'](_0x86ccd7[_0x9243('0x30')],_0x299c3d[_0x9243('0x32')]),_0x1c90a3);if(_0x86ccd7[_0x9243('0x30')][_0x9243('0x3b')]){_0x1cacbe[_0x9243('0x3a')]=_[_0x9243('0x3c')](_0x1cacbe['where'],{'$or':_[_0x9243('0x2b')](_0x1c90a3,function(_0x205350){if(_0x205350[_0x9243('0x2e')]!=='VIRTUAL'){var _0x1d3ad7={};_0x1d3ad7[_0x205350[_0x9243('0x29')]]={'$like':'%'+_0x86ccd7['query'][_0x9243('0x3b')]+'%'};return _0x1d3ad7;}})});}_0x1cacbe=_[_0x9243('0x3c')]({},_0x1cacbe,_0x86ccd7['options']);var _0x209e92={'where':_0x1cacbe[_0x9243('0x3a')]};return db['SquareReport'][_0x9243('0x20')](_0x209e92)['then'](function(_0x387ae5){_0x1f5245['count']=_0x387ae5;if(_0x86ccd7[_0x9243('0x30')][_0x9243('0x3d')]){_0x1cacbe[_0x9243('0x3e')]=[{'all':!![]}];}return db[_0x9243('0x2c')][_0x9243('0x3f')](_0x1cacbe);})[_0x9243('0x26')](function(_0xcb8e9a){_0x1f5245[_0x9243('0x40')]=_0xcb8e9a;return _0x1f5245;})['then'](respondWithFilteredResult(_0x4afe66,_0x1cacbe))[_0x9243('0x41')](handleError(_0x4afe66,null));};exports['show']=function(_0x50c5c4,_0x35754b){var _0x6ecd3f={'raw':!![],'where':{'id':_0x50c5c4[_0x9243('0x42')]['id']}},_0x2f9495={};_0x2f9495['model']=_[_0x9243('0x31')](db[_0x9243('0x2c')][_0x9243('0x43')]);_0x2f9495['query']=_[_0x9243('0x31')](_0x50c5c4[_0x9243('0x30')]);_0x2f9495[_0x9243('0x32')]=_[_0x9243('0x33')](_0x2f9495[_0x9243('0x2f')],_0x2f9495[_0x9243('0x30')]);_0x6ecd3f[_0x9243('0x34')]=_[_0x9243('0x33')](_0x2f9495[_0x9243('0x2f')],qs[_0x9243('0x35')](_0x50c5c4[_0x9243('0x30')][_0x9243('0x35')]));_0x6ecd3f[_0x9243('0x34')]=_0x6ecd3f[_0x9243('0x34')]['length']?_0x6ecd3f['attributes']:_0x2f9495[_0x9243('0x2f')];if(_0x50c5c4[_0x9243('0x30')][_0x9243('0x3d')]){_0x6ecd3f[_0x9243('0x3e')]=[{'all':!![]}];}_0x6ecd3f=_[_0x9243('0x3c')]({},_0x6ecd3f,_0x50c5c4['options']);return db[_0x9243('0x2c')][_0x9243('0x44')](_0x6ecd3f)['then'](handleEntityNotFound(_0x35754b,null))[_0x9243('0x26')](respondWithResult(_0x35754b,null))[_0x9243('0x41')](handleError(_0x35754b,null));};exports[_0x9243('0x45')]=function(_0x2f292f,_0x5b625e){return db[_0x9243('0x2c')]['create'](_0x2f292f[_0x9243('0x46')],{})[_0x9243('0x26')](respondWithResult(_0x5b625e,0xc9))['catch'](handleError(_0x5b625e,null));};exports['update']=function(_0x3b46ee,_0x2fd114){if(_0x3b46ee[_0x9243('0x46')]['id']){delete _0x3b46ee['body']['id'];}return db[_0x9243('0x2c')][_0x9243('0x44')]({'where':{'id':_0x3b46ee[_0x9243('0x42')]['id']}})[_0x9243('0x26')](handleEntityNotFound(_0x2fd114,null))[_0x9243('0x26')](saveUpdates(_0x3b46ee[_0x9243('0x46')],null))[_0x9243('0x26')](respondWithResult(_0x2fd114,null))[_0x9243('0x41')](handleError(_0x2fd114,null));};exports[_0x9243('0x27')]=function(_0x37cd1a,_0x17f0ee){return db[_0x9243('0x2c')]['find']({'where':{'id':_0x37cd1a['params']['id']}})[_0x9243('0x26')](handleEntityNotFound(_0x17f0ee,null))[_0x9243('0x26')](removeEntity(_0x17f0ee,null))[_0x9243('0x41')](handleError(_0x17f0ee,null));};exports['describe']=function(_0x455c29,_0x54dbe6){return db['SquareReport'][_0x9243('0x47')]()[_0x9243('0x26')](respondWithResult(_0x54dbe6,null))['catch'](handleError(_0x54dbe6,null));}; \ No newline at end of file +var _0x4be2=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SquareReport','fieldName','type'];(function(_0x596842,_0x5f3798){var _0x242a9e=function(_0xfaf2ce){while(--_0xfaf2ce){_0x596842['push'](_0x596842['shift']());}};_0x242a9e(++_0x5f3798);}(_0x4be2,0x14a));var _0x24be=function(_0x39fff0,_0x259d98){_0x39fff0=_0x39fff0-0x0;var _0x547163=_0x4be2[_0x39fff0];return _0x547163;};'use strict';var emlformat=require(_0x24be('0x0'));var rimraf=require(_0x24be('0x1'));var zipdir=require(_0x24be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x24be('0x3'));var BPromise=require(_0x24be('0x4'));var Mustache=require('mustache');var util=require(_0x24be('0x5'));var path=require(_0x24be('0x6'));var sox=require(_0x24be('0x7'));var csv=require(_0x24be('0x8'));var ejs=require(_0x24be('0x9'));var fs=require('fs');var fs_extra=require(_0x24be('0xa'));var _=require(_0x24be('0xb'));var squel=require(_0x24be('0xc'));var crypto=require(_0x24be('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x24be('0xe'));var toCsv=require(_0x24be('0x8'));var querystring=require(_0x24be('0xf'));var Papa=require('papaparse');var Redis=require(_0x24be('0x10'));var authService=require(_0x24be('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x24be('0x12'))(_0x24be('0x13'));var utils=require(_0x24be('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x24be('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b4d80,_0x58fb65){_0x58fb65=_0x58fb65||0xcc;return function(_0x107ef0){if(_0x107ef0){return _0x4b4d80['sendStatus'](_0x58fb65);}return _0x4b4d80['status'](_0x58fb65)[_0x24be('0x16')]();};}function respondWithResult(_0x5d237d,_0x1d3058){_0x1d3058=_0x1d3058||0xc8;return function(_0x4f6f99){if(_0x4f6f99){return _0x5d237d[_0x24be('0x17')](_0x1d3058)[_0x24be('0x18')](_0x4f6f99);}};}function respondWithFilteredResult(_0x36474d,_0x2258fe){return function(_0x9c9b0c){if(_0x9c9b0c){var _0x2a99a3=typeof _0x2258fe['offset']===_0x24be('0x19')&&typeof _0x2258fe[_0x24be('0x1a')]==='undefined';var _0x2bda12=_0x9c9b0c[_0x24be('0x1b')];var _0x30e34c=_0x2a99a3?0x0:_0x2258fe[_0x24be('0x1c')];var _0x203dc9=_0x2a99a3?_0x9c9b0c[_0x24be('0x1b')]:_0x2258fe['offset']+_0x2258fe[_0x24be('0x1a')];var _0x49d48b;if(_0x203dc9>=_0x2bda12){_0x203dc9=_0x2bda12;_0x49d48b=0xc8;}else{_0x49d48b=0xce;}_0x36474d[_0x24be('0x17')](_0x49d48b);return _0x36474d[_0x24be('0x1d')](_0x24be('0x1e'),_0x30e34c+'-'+_0x203dc9+'/'+_0x2bda12)[_0x24be('0x18')](_0x9c9b0c);}return null;};}function patchUpdates(_0x1efef6){return function(_0x3be6c5){try{jsonpatch[_0x24be('0x1f')](_0x3be6c5,_0x1efef6,!![]);}catch(_0x3db742){return BPromise[_0x24be('0x20')](_0x3db742);}return _0x3be6c5[_0x24be('0x21')]();};}function saveUpdates(_0x612a60,_0x3dd8b5){return function(_0x293f6e){if(_0x293f6e){return _0x293f6e[_0x24be('0x22')](_0x612a60)[_0x24be('0x23')](function(_0x50ef62){return _0x50ef62;});}return null;};}function removeEntity(_0x4d3312,_0x5de4b9){return function(_0x40a6be){if(_0x40a6be){return _0x40a6be[_0x24be('0x24')]()[_0x24be('0x23')](function(){_0x4d3312[_0x24be('0x17')](0xcc)[_0x24be('0x16')]();});}};}function handleEntityNotFound(_0x5279d9,_0x46a04a){return function(_0x2c8eda){if(!_0x2c8eda){_0x5279d9['sendStatus'](0x194);}return _0x2c8eda;};}function handleError(_0x404beb,_0xdaa9a4){_0xdaa9a4=_0xdaa9a4||0x1f4;return function(_0x24ec20){logger['error'](_0x24ec20[_0x24be('0x25')]);if(_0x24ec20[_0x24be('0x26')]){delete _0x24ec20['name'];}_0x404beb[_0x24be('0x17')](_0xdaa9a4)[_0x24be('0x27')](_0x24ec20);};}exports[_0x24be('0x28')]=function(_0x32c592,_0x1ebdcd){var _0x8ad75e={},_0x3e1ab1={},_0x3afd83={'count':0x0,'rows':[]};var _0x28ad68=_[_0x24be('0x29')](db[_0x24be('0x2a')]['rawAttributes'],function(_0x2e1abc){return{'name':_0x2e1abc[_0x24be('0x2b')],'type':_0x2e1abc[_0x24be('0x2c')][_0x24be('0x2d')]};});_0x3e1ab1[_0x24be('0x2e')]=_[_0x24be('0x29')](_0x28ad68,_0x24be('0x26'));_0x3e1ab1[_0x24be('0x2f')]=_[_0x24be('0x30')](_0x32c592['query']);_0x3e1ab1[_0x24be('0x31')]=_[_0x24be('0x32')](_0x3e1ab1[_0x24be('0x2e')],_0x3e1ab1['query']);_0x8ad75e[_0x24be('0x33')]=_[_0x24be('0x32')](_0x3e1ab1[_0x24be('0x2e')],qs[_0x24be('0x34')](_0x32c592['query']['fields']));_0x8ad75e['attributes']=_0x8ad75e['attributes'][_0x24be('0x35')]?_0x8ad75e['attributes']:_0x3e1ab1[_0x24be('0x2e')];if(!_0x32c592['query']['hasOwnProperty'](_0x24be('0x36'))){_0x8ad75e[_0x24be('0x1a')]=qs[_0x24be('0x1a')](_0x32c592['query'][_0x24be('0x1a')]);_0x8ad75e[_0x24be('0x1c')]=qs[_0x24be('0x1c')](_0x32c592[_0x24be('0x2f')][_0x24be('0x1c')]);}_0x8ad75e[_0x24be('0x37')]=qs['sort'](_0x32c592[_0x24be('0x2f')][_0x24be('0x38')]);_0x8ad75e['where']=qs['filters'](_[_0x24be('0x39')](_0x32c592['query'],_0x3e1ab1['filters']),_0x28ad68);if(_0x32c592[_0x24be('0x2f')][_0x24be('0x3a')]){_0x8ad75e[_0x24be('0x3b')]=_[_0x24be('0x3c')](_0x8ad75e[_0x24be('0x3b')],{'$or':_[_0x24be('0x29')](_0x28ad68,function(_0x5224f6){if(_0x5224f6[_0x24be('0x2c')]!==_0x24be('0x3d')){var _0xb2830f={};_0xb2830f[_0x5224f6[_0x24be('0x26')]]={'$like':'%'+_0x32c592[_0x24be('0x2f')][_0x24be('0x3a')]+'%'};return _0xb2830f;}})});}_0x8ad75e=_[_0x24be('0x3c')]({},_0x8ad75e,_0x32c592[_0x24be('0x3e')]);var _0x1c05c0={'where':_0x8ad75e['where']};return db['SquareReport'][_0x24be('0x1b')](_0x1c05c0)[_0x24be('0x23')](function(_0x12b6e1){_0x3afd83['count']=_0x12b6e1;if(_0x32c592['query'][_0x24be('0x3f')]){_0x8ad75e[_0x24be('0x40')]=[{'all':!![]}];}return db[_0x24be('0x2a')][_0x24be('0x41')](_0x8ad75e);})['then'](function(_0x4a2630){_0x3afd83[_0x24be('0x42')]=_0x4a2630;return _0x3afd83;})[_0x24be('0x23')](respondWithFilteredResult(_0x1ebdcd,_0x8ad75e))[_0x24be('0x43')](handleError(_0x1ebdcd,null));};exports[_0x24be('0x44')]=function(_0x1270e5,_0x4588db){var _0x26f0f9={'raw':!![],'where':{'id':_0x1270e5[_0x24be('0x45')]['id']}},_0x36e33b={};_0x36e33b[_0x24be('0x2e')]=_[_0x24be('0x30')](db['SquareReport'][_0x24be('0x46')]);_0x36e33b['query']=_[_0x24be('0x30')](_0x1270e5[_0x24be('0x2f')]);_0x36e33b['filters']=_[_0x24be('0x32')](_0x36e33b[_0x24be('0x2e')],_0x36e33b[_0x24be('0x2f')]);_0x26f0f9['attributes']=_[_0x24be('0x32')](_0x36e33b['model'],qs[_0x24be('0x34')](_0x1270e5[_0x24be('0x2f')][_0x24be('0x34')]));_0x26f0f9[_0x24be('0x33')]=_0x26f0f9[_0x24be('0x33')][_0x24be('0x35')]?_0x26f0f9['attributes']:_0x36e33b[_0x24be('0x2e')];if(_0x1270e5['query'][_0x24be('0x3f')]){_0x26f0f9[_0x24be('0x40')]=[{'all':!![]}];}_0x26f0f9=_[_0x24be('0x3c')]({},_0x26f0f9,_0x1270e5[_0x24be('0x3e')]);return db[_0x24be('0x2a')][_0x24be('0x47')](_0x26f0f9)['then'](handleEntityNotFound(_0x4588db,null))[_0x24be('0x23')](respondWithResult(_0x4588db,null))[_0x24be('0x43')](handleError(_0x4588db,null));};exports[_0x24be('0x48')]=function(_0x2a033e,_0x2c19cd){return db[_0x24be('0x2a')]['create'](_0x2a033e[_0x24be('0x49')],{})['then'](respondWithResult(_0x2c19cd,0xc9))['catch'](handleError(_0x2c19cd,null));};exports['update']=function(_0x22782e,_0x148d35){if(_0x22782e[_0x24be('0x49')]['id']){delete _0x22782e[_0x24be('0x49')]['id'];}return db[_0x24be('0x2a')][_0x24be('0x47')]({'where':{'id':_0x22782e[_0x24be('0x45')]['id']}})[_0x24be('0x23')](handleEntityNotFound(_0x148d35,null))[_0x24be('0x23')](saveUpdates(_0x22782e['body'],null))[_0x24be('0x23')](respondWithResult(_0x148d35,null))[_0x24be('0x43')](handleError(_0x148d35,null));};exports[_0x24be('0x24')]=function(_0x5710c5,_0x478839){return db['SquareReport']['find']({'where':{'id':_0x5710c5[_0x24be('0x45')]['id']}})[_0x24be('0x23')](handleEntityNotFound(_0x478839,null))['then'](removeEntity(_0x478839,null))[_0x24be('0x43')](handleError(_0x478839,null));};exports[_0x24be('0x4a')]=function(_0xceae4a,_0x2442fc){return db[_0x24be('0x2a')][_0x24be('0x4a')]()[_0x24be('0x23')](respondWithResult(_0x2442fc,null))[_0x24be('0x43')](handleError(_0x2442fc,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 1f0f03a..a4fde17 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 _0x6591=['SquareReport','report_square','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define'];(function(_0x3356de,_0x25cf76){var _0x51224f=function(_0x5f2c6b){while(--_0x5f2c6b){_0x3356de['push'](_0x3356de['shift']());}};_0x51224f(++_0x25cf76);}(_0x6591,0x6c));var _0x1659=function(_0x43747e,_0x13b832){_0x43747e=_0x43747e-0x0;var _0x7fb853=_0x6591[_0x43747e];return _0x7fb853;};'use strict';var _=require(_0x1659('0x0'));var util=require(_0x1659('0x1'));var logger=require(_0x1659('0x2'))(_0x1659('0x3'));var moment=require(_0x1659('0x4'));var BPromise=require(_0x1659('0x5'));var rp=require(_0x1659('0x6'));var fs=require('fs');var path=require(_0x1659('0x7'));var rimraf=require(_0x1659('0x8'));var config=require(_0x1659('0x9'));var attributes=require(_0x1659('0xa'));module['exports']=function(_0x5bfb11,_0x568afe){return _0x5bfb11[_0x1659('0xb')](_0x1659('0xc'),attributes,{'tableName':_0x1659('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':_0x1659('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e04=['exports','define','SquareReport','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0xe180b7,_0x5b678e){var _0xbc777c=function(_0x3e2958){while(--_0x3e2958){_0xe180b7['push'](_0xe180b7['shift']());}};_0xbc777c(++_0x5b678e);}(_0x3e04,0x1c7));var _0x43e0=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x3e04[_0x424501];return _0xb719af;};'use strict';var _=require(_0x43e0('0x0'));var util=require(_0x43e0('0x1'));var logger=require(_0x43e0('0x2'))(_0x43e0('0x3'));var moment=require(_0x43e0('0x4'));var BPromise=require(_0x43e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e0('0x6'));var rimraf=require(_0x43e0('0x7'));var config=require(_0x43e0('0x8'));var attributes=require(_0x43e0('0x9'));module[_0x43e0('0xa')]=function(_0xa86d6c,_0x2d417d){return _0xa86d6c[_0x43e0('0xb')](_0x43e0('0xc'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x43e0('0xd')]},{'name':'leaveAt','fields':[_0x43e0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 4da8c88..010b650 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 _0x9c2e=['SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','create','body','options','then','debug','UpdateSquareReport','SquareReport','update','where','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x361e49,_0x4fa909){var _0x176d42=function(_0x3c6b64){while(--_0x3c6b64){_0x361e49['push'](_0x361e49['shift']());}};_0x176d42(++_0x4fa909);}(_0x9c2e,0x159));var _0xe9c2=function(_0x159de8,_0x17b6ce){_0x159de8=_0x159de8-0x0;var _0x4bc95d=_0x9c2e[_0x159de8];return _0x4bc95d;};'use strict';var _=require('lodash');var util=require(_0xe9c2('0x0'));var moment=require('moment');var BPromise=require(_0xe9c2('0x1'));var rs=require(_0xe9c2('0x2'));var fs=require('fs');var Redis=require(_0xe9c2('0x3'));var db=require(_0xe9c2('0x4'))['db'];var utils=require(_0xe9c2('0x5'));var logger=require(_0xe9c2('0x6'))(_0xe9c2('0x7'));var config=require('../../config/environment');var jayson=require(_0xe9c2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24b0d1,_0x8e0f83,_0x454b12){return new BPromise(function(_0x2682e1,_0x47cc40){return client[_0xe9c2('0x9')](_0x24b0d1,_0x454b12)['then'](function(_0x4d0efe){logger[_0xe9c2('0xa')]('SquareReport,\x20%s,\x20%s',_0x8e0f83,_0xe9c2('0xb'));logger['debug'](_0xe9c2('0xc'),_0x8e0f83,_0xe9c2('0xb'),JSON[_0xe9c2('0xd')](_0x4d0efe));if(_0x4d0efe['error']){if(_0x4d0efe['error']['code']===0x1f4){logger[_0xe9c2('0xe')](_0xe9c2('0xf'),_0x8e0f83,_0x4d0efe[_0xe9c2('0xe')][_0xe9c2('0x10')]);return _0x47cc40(_0x4d0efe[_0xe9c2('0xe')][_0xe9c2('0x10')]);}logger[_0xe9c2('0xe')](_0xe9c2('0xf'),_0x8e0f83,_0x4d0efe[_0xe9c2('0xe')][_0xe9c2('0x10')]);return _0x2682e1(_0x4d0efe['error']['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x8e0f83,_0xe9c2('0xb'));_0x2682e1(_0x4d0efe[_0xe9c2('0x11')][_0xe9c2('0x10')]);}})[_0xe9c2('0x12')](function(_0x2793d6){logger[_0xe9c2('0xe')](_0xe9c2('0xf'),_0x8e0f83,_0x2793d6);_0x47cc40(_0x2793d6);});});}exports[_0xe9c2('0x13')]=function(_0x37e244){var _0x4d94fa=this;return new Promise(function(_0x4b553a,_0x5d5eb6){return db['SquareReport'][_0xe9c2('0x14')](_0x37e244[_0xe9c2('0x15')],{'raw':_0x37e244[_0xe9c2('0x16')]?_0x37e244[_0xe9c2('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xe9c2('0x17')](function(_0x378ba2){logger[_0xe9c2('0xa')](_0xe9c2('0x13'),_0x37e244);logger[_0xe9c2('0x18')](_0xe9c2('0x13'),_0x37e244,JSON[_0xe9c2('0xd')](_0x378ba2));_0x4b553a(_0x378ba2);})[_0xe9c2('0x12')](function(_0x295dd0){logger[_0xe9c2('0xe')]('CreateSquareReport',_0x295dd0['message'],_0x37e244);_0x5d5eb6(_0x4d94fa[_0xe9c2('0xe')](0x1f4,_0x295dd0[_0xe9c2('0x10')]));});});};exports[_0xe9c2('0x19')]=function(_0x1796dd){var _0x169715=this;return new Promise(function(_0x394360,_0xea44f7){return db[_0xe9c2('0x1a')][_0xe9c2('0x1b')](_0x1796dd[_0xe9c2('0x15')],{'raw':_0x1796dd[_0xe9c2('0x16')]?_0x1796dd[_0xe9c2('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1796dd[_0xe9c2('0x16')]?_0x1796dd[_0xe9c2('0x16')][_0xe9c2('0x1c')]||null:null,'attributes':_0x1796dd[_0xe9c2('0x16')]?_0x1796dd['options'][_0xe9c2('0x1d')]||null:null,'limit':_0x1796dd['options']?_0x1796dd[_0xe9c2('0x16')]['limit']||null:null})['then'](function(_0x3f4dd9){logger[_0xe9c2('0xa')](_0xe9c2('0x19'),_0x1796dd);logger[_0xe9c2('0x18')](_0xe9c2('0x19'),_0x1796dd,JSON[_0xe9c2('0xd')](_0x3f4dd9));_0x394360(_0x3f4dd9);})[_0xe9c2('0x12')](function(_0x335d1a){logger['error'](_0xe9c2('0x19'),_0x335d1a[_0xe9c2('0x10')],_0x1796dd);_0xea44f7(_0x169715[_0xe9c2('0xe')](0x1f4,_0x335d1a[_0xe9c2('0x10')]));});});}; \ No newline at end of file +var _0x2860=['raw','then','update','body','where','limit','UpdateSquareReport','lodash','util','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','create','options'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x2860,0xbb));var _0x0286=function(_0x3a6da2,_0x186033){_0x3a6da2=_0x3a6da2-0x0;var _0x594e2b=_0x2860[_0x3a6da2];return _0x594e2b;};'use strict';var _=require(_0x0286('0x0'));var util=require(_0x0286('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0286('0x2'));var fs=require('fs');var Redis=require(_0x0286('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0286('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0286('0x5'));var client=jayson[_0x0286('0x6')][_0x0286('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d7bb2,_0x2558a4,_0x4d7ea2){return new BPromise(function(_0x1d9c01,_0x365d18){return client[_0x0286('0x8')](_0x2d7bb2,_0x4d7ea2)['then'](function(_0x1e8f6f){logger[_0x0286('0x9')]('SquareReport,\x20%s,\x20%s',_0x2558a4,'request\x20sent');logger[_0x0286('0xa')](_0x0286('0xb'),_0x2558a4,_0x0286('0xc'),JSON[_0x0286('0xd')](_0x1e8f6f));if(_0x1e8f6f[_0x0286('0xe')]){if(_0x1e8f6f['error'][_0x0286('0xf')]===0x1f4){logger['error'](_0x0286('0x10'),_0x2558a4,_0x1e8f6f[_0x0286('0xe')]['message']);return _0x365d18(_0x1e8f6f[_0x0286('0xe')]['message']);}logger['error'](_0x0286('0x10'),_0x2558a4,_0x1e8f6f[_0x0286('0xe')][_0x0286('0x11')]);return _0x1d9c01(_0x1e8f6f[_0x0286('0xe')][_0x0286('0x11')]);}else{logger['info'](_0x0286('0x10'),_0x2558a4,_0x0286('0xc'));_0x1d9c01(_0x1e8f6f['result']['message']);}})[_0x0286('0x12')](function(_0x449477){logger[_0x0286('0xe')]('SquareReport,\x20%s,\x20%s',_0x2558a4,_0x449477);_0x365d18(_0x449477);});});}exports[_0x0286('0x13')]=function(_0x456abf){var _0x1eacb0=this;return new Promise(function(_0x5725a3,_0x1200ad){return db[_0x0286('0x14')][_0x0286('0x15')](_0x456abf['body'],{'raw':_0x456abf[_0x0286('0x16')]?_0x456abf[_0x0286('0x16')][_0x0286('0x17')]===undefined?!![]:![]:!![]})[_0x0286('0x18')](function(_0x4bc561){logger['info'](_0x0286('0x13'),_0x456abf);logger['debug'](_0x0286('0x13'),_0x456abf,JSON[_0x0286('0xd')](_0x4bc561));_0x5725a3(_0x4bc561);})['catch'](function(_0x3a10e9){logger[_0x0286('0xe')]('CreateSquareReport',_0x3a10e9[_0x0286('0x11')],_0x456abf);_0x1200ad(_0x1eacb0[_0x0286('0xe')](0x1f4,_0x3a10e9[_0x0286('0x11')]));});});};exports['UpdateSquareReport']=function(_0x836b37){var _0x18d6d1=this;return new Promise(function(_0x33f59f,_0x2dcf7f){return db[_0x0286('0x14')][_0x0286('0x19')](_0x836b37[_0x0286('0x1a')],{'raw':_0x836b37[_0x0286('0x16')]?_0x836b37[_0x0286('0x16')][_0x0286('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x836b37[_0x0286('0x16')]?_0x836b37[_0x0286('0x16')][_0x0286('0x1b')]||null:null,'attributes':_0x836b37[_0x0286('0x16')]?_0x836b37['options']['attributes']||null:null,'limit':_0x836b37['options']?_0x836b37[_0x0286('0x16')][_0x0286('0x1c')]||null:null})[_0x0286('0x18')](function(_0x8db14e){logger['info'](_0x0286('0x1d'),_0x836b37);logger[_0x0286('0xa')](_0x0286('0x1d'),_0x836b37,JSON[_0x0286('0xd')](_0x8db14e));_0x33f59f(_0x8db14e);})[_0x0286('0x12')](function(_0x2998ca){logger[_0x0286('0xe')](_0x0286('0x1d'),_0x2998ca[_0x0286('0x11')],_0x836b37);_0x2dcf7f(_0x18d6d1[_0x0286('0xe')](0x1f4,_0x2998ca[_0x0286('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index e07ec8c..1427cd2 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 _0x3f3f=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','multer','connect-timeout'];(function(_0x39d3aa,_0x41732c){var _0x29f445=function(_0x4bad39){while(--_0x4bad39){_0x39d3aa['push'](_0x39d3aa['shift']());}};_0x29f445(++_0x41732c);}(_0x3f3f,0x1ee));var _0xf3f3=function(_0x5f1b74,_0x498562){_0x5f1b74=_0x5f1b74-0x0;var _0x1fb5a0=_0x3f3f[_0x5f1b74];return _0x1fb5a0;};'use strict';var multer=require(_0xf3f3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf3f3('0x1'));var express=require(_0xf3f3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf3f3('0x3'));var interaction=require(_0xf3f3('0x4'));var config=require(_0xf3f3('0x5'));var controller=require('./squareReportDetail.controller');router[_0xf3f3('0x6')]('/',auth[_0xf3f3('0x7')](),controller[_0xf3f3('0x8')]);router[_0xf3f3('0x6')](_0xf3f3('0x9'),auth[_0xf3f3('0x7')](),controller[_0xf3f3('0xa')]);router[_0xf3f3('0x6')](_0xf3f3('0xb'),auth[_0xf3f3('0x7')](),controller[_0xf3f3('0xc')]);router[_0xf3f3('0xd')]('/',auth['isAuthenticated'](),controller[_0xf3f3('0xe')]);router[_0xf3f3('0xf')](_0xf3f3('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf3f3('0xb'),auth[_0xf3f3('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x21a7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','isAuthenticated','index','get','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5bf18d,_0x264c55){var _0x1d6cc0=function(_0x2d69d9){while(--_0x2d69d9){_0x5bf18d['push'](_0x5bf18d['shift']());}};_0x1d6cc0(++_0x264c55);}(_0x21a7,0x106));var _0x721a=function(_0x31e575,_0x3ce8cb){_0x31e575=_0x31e575-0x0;var _0x3253d9=_0x21a7[_0x31e575];return _0x3253d9;};'use strict';var multer=require(_0x721a('0x0'));var util=require(_0x721a('0x1'));var path=require(_0x721a('0x2'));var timeout=require(_0x721a('0x3'));var express=require(_0x721a('0x4'));var router=express[_0x721a('0x5')]();var fs_extra=require(_0x721a('0x6'));var auth=require(_0x721a('0x7'));var interaction=require(_0x721a('0x8'));var config=require('../../config/environment');var controller=require(_0x721a('0x9'));router['get']('/',auth[_0x721a('0xa')](),controller[_0x721a('0xb')]);router[_0x721a('0xc')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x721a('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x721a('0xd')]);router['put'](_0x721a('0xe'),auth[_0x721a('0xa')](),controller[_0x721a('0xf')]);router[_0x721a('0x10')](_0x721a('0xe'),auth['isAuthenticated'](),controller[_0x721a('0x11')]);module[_0x721a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 78f7d5c..7d3be9f 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 _0x9660=['TEXT','sequelize','STRING'];(function(_0x2625cf,_0xbb5600){var _0x308582=function(_0x3c3452){while(--_0x3c3452){_0x2625cf['push'](_0x2625cf['shift']());}};_0x308582(++_0xbb5600);}(_0x9660,0x163));var _0x0966=function(_0x3d563e,_0x33442f){_0x3d563e=_0x3d563e-0x0;var _0x5b6111=_0x9660[_0x3d563e];return _0x5b6111;};'use strict';var Sequelize=require(_0x0966('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0966('0x1')]},'node':{'type':Sequelize[_0x0966('0x1')]},'application':{'type':Sequelize[_0x0966('0x1')]},'data':{'type':Sequelize[_0x0966('0x2')]},'project_name':{'type':Sequelize[_0x0966('0x1')]},'callerid':{'type':Sequelize[_0x0966('0x1')]}}; \ No newline at end of file +var _0xb8ea=['STRING','TEXT','exports'];(function(_0x57b248,_0x2d5053){var _0x3a55f5=function(_0x145403){while(--_0x145403){_0x57b248['push'](_0x57b248['shift']());}};_0x3a55f5(++_0x2d5053);}(_0xb8ea,0x173));var _0xab8e=function(_0x446c46,_0x34d8ce){_0x446c46=_0x446c46-0x0;var _0x5f1327=_0xb8ea[_0x446c46];return _0x5f1327;};'use strict';var Sequelize=require('sequelize');module[_0xab8e('0x0')]={'uniqueid':{'type':Sequelize[_0xab8e('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xab8e('0x1')]},'data':{'type':Sequelize[_0xab8e('0x2')]},'project_name':{'type':Sequelize[_0xab8e('0x1')]},'callerid':{'type':Sequelize[_0xab8e('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index eff5769..6431415 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 _0xe860=['options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','SquareDetailsReport','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','name','merge'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xe860,0x188));var _0x0e86=function(_0x2d761e,_0x29832c){_0x2d761e=_0x2d761e-0x0;var _0x291add=_0xe860[_0x2d761e];return _0x291add;};'use strict';var emlformat=require(_0x0e86('0x0'));var rimraf=require(_0x0e86('0x1'));var zipdir=require(_0x0e86('0x2'));var jsonpatch=require(_0x0e86('0x3'));var rp=require('request-promise');var moment=require(_0x0e86('0x4'));var BPromise=require(_0x0e86('0x5'));var Mustache=require('mustache');var util=require(_0x0e86('0x6'));var path=require(_0x0e86('0x7'));var sox=require(_0x0e86('0x8'));var csv=require(_0x0e86('0x9'));var ejs=require(_0x0e86('0xa'));var fs=require('fs');var fs_extra=require(_0x0e86('0xb'));var _=require(_0x0e86('0xc'));var squel=require(_0x0e86('0xd'));var crypto=require(_0x0e86('0xe'));var jsforce=require(_0x0e86('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e86('0x9'));var querystring=require('querystring');var Papa=require(_0x0e86('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e86('0x11'));var logger=require('../../config/logger')(_0x0e86('0x12'));var utils=require(_0x0e86('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0e86('0x14'));var db=require(_0x0e86('0x15'))['db'];function respondWithStatusCode(_0x336308,_0x731e0b){_0x731e0b=_0x731e0b||0xcc;return function(_0x2ef563){if(_0x2ef563){return _0x336308[_0x0e86('0x16')](_0x731e0b);}return _0x336308[_0x0e86('0x17')](_0x731e0b)['end']();};}function respondWithResult(_0xee30a9,_0x27e093){_0x27e093=_0x27e093||0xc8;return function(_0xbd69f4){if(_0xbd69f4){return _0xee30a9[_0x0e86('0x17')](_0x27e093)[_0x0e86('0x18')](_0xbd69f4);}};}function respondWithFilteredResult(_0x39449f,_0x9964f7){return function(_0x3e4189){if(_0x3e4189){var _0x32cd00=typeof _0x9964f7[_0x0e86('0x19')]===_0x0e86('0x1a')&&typeof _0x9964f7[_0x0e86('0x1b')]===_0x0e86('0x1a');var _0x3b7933=_0x3e4189[_0x0e86('0x1c')];var _0xee60ba=_0x32cd00?0x0:_0x9964f7[_0x0e86('0x19')];var _0x1fbcd3=_0x32cd00?_0x3e4189[_0x0e86('0x1c')]:_0x9964f7['offset']+_0x9964f7['limit'];var _0x54579d;if(_0x1fbcd3>=_0x3b7933){_0x1fbcd3=_0x3b7933;_0x54579d=0xc8;}else{_0x54579d=0xce;}_0x39449f[_0x0e86('0x17')](_0x54579d);return _0x39449f[_0x0e86('0x1d')](_0x0e86('0x1e'),_0xee60ba+'-'+_0x1fbcd3+'/'+_0x3b7933)['json'](_0x3e4189);}return null;};}function patchUpdates(_0xe30ad9){return function(_0x53ceb1){try{jsonpatch[_0x0e86('0x1f')](_0x53ceb1,_0xe30ad9,!![]);}catch(_0x13008a){return BPromise[_0x0e86('0x20')](_0x13008a);}return _0x53ceb1[_0x0e86('0x21')]();};}function saveUpdates(_0x17edb4,_0x385530){return function(_0x538ef3){if(_0x538ef3){return _0x538ef3[_0x0e86('0x22')](_0x17edb4)[_0x0e86('0x23')](function(_0x340a93){return _0x340a93;});}return null;};}function removeEntity(_0x432253,_0xa24e68){return function(_0x185354){if(_0x185354){return _0x185354[_0x0e86('0x24')]()['then'](function(){_0x432253[_0x0e86('0x17')](0xcc)[_0x0e86('0x25')]();});}};}function handleEntityNotFound(_0x1ae6fe,_0x188e8c){return function(_0xf60b2e){if(!_0xf60b2e){_0x1ae6fe[_0x0e86('0x16')](0x194);}return _0xf60b2e;};}function handleError(_0x59d2d7,_0xc021ec){_0xc021ec=_0xc021ec||0x1f4;return function(_0x487afa){logger[_0x0e86('0x26')](_0x487afa[_0x0e86('0x27')]);if(_0x487afa['name']){delete _0x487afa['name'];}_0x59d2d7[_0x0e86('0x17')](_0xc021ec)[_0x0e86('0x28')](_0x487afa);};}exports[_0x0e86('0x29')]=function(_0x1a7f77,_0x57c6bb){var _0x49772c={},_0x3630a7={},_0x3ab90e={'count':0x0,'rows':[]};var _0x13f077=_[_0x0e86('0x2a')](db[_0x0e86('0x2b')]['rawAttributes'],function(_0x2194fd){return{'name':_0x2194fd[_0x0e86('0x2c')],'type':_0x2194fd[_0x0e86('0x2d')][_0x0e86('0x2e')]};});_0x3630a7['model']=_[_0x0e86('0x2a')](_0x13f077,'name');_0x3630a7[_0x0e86('0x2f')]=_[_0x0e86('0x30')](_0x1a7f77[_0x0e86('0x2f')]);_0x3630a7['filters']=_[_0x0e86('0x31')](_0x3630a7[_0x0e86('0x32')],_0x3630a7[_0x0e86('0x2f')]);_0x49772c[_0x0e86('0x33')]=_[_0x0e86('0x31')](_0x3630a7['model'],qs[_0x0e86('0x34')](_0x1a7f77[_0x0e86('0x2f')][_0x0e86('0x34')]));_0x49772c[_0x0e86('0x33')]=_0x49772c['attributes'][_0x0e86('0x35')]?_0x49772c['attributes']:_0x3630a7[_0x0e86('0x32')];if(!_0x1a7f77[_0x0e86('0x2f')][_0x0e86('0x36')](_0x0e86('0x37'))){_0x49772c[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x1a7f77[_0x0e86('0x2f')][_0x0e86('0x1b')]);_0x49772c['offset']=qs[_0x0e86('0x19')](_0x1a7f77[_0x0e86('0x2f')][_0x0e86('0x19')]);}_0x49772c['order']=qs['sort'](_0x1a7f77[_0x0e86('0x2f')][_0x0e86('0x38')]);_0x49772c[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_[_0x0e86('0x3b')](_0x1a7f77['query'],_0x3630a7[_0x0e86('0x3a')]),_0x13f077);if(_0x1a7f77['query'][_0x0e86('0x3c')]){_0x49772c[_0x0e86('0x39')]=_['merge'](_0x49772c[_0x0e86('0x39')],{'$or':_['map'](_0x13f077,function(_0x14ad6c){if(_0x14ad6c[_0x0e86('0x2d')]!==_0x0e86('0x3d')){var _0x4f9ccb={};_0x4f9ccb[_0x14ad6c[_0x0e86('0x3e')]]={'$like':'%'+_0x1a7f77[_0x0e86('0x2f')][_0x0e86('0x3c')]+'%'};return _0x4f9ccb;}})});}_0x49772c=_[_0x0e86('0x3f')]({},_0x49772c,_0x1a7f77[_0x0e86('0x40')]);var _0x261738={'where':_0x49772c[_0x0e86('0x39')]};return db[_0x0e86('0x2b')][_0x0e86('0x1c')](_0x261738)[_0x0e86('0x23')](function(_0x32ab85){_0x3ab90e['count']=_0x32ab85;if(_0x1a7f77[_0x0e86('0x2f')][_0x0e86('0x41')]){_0x49772c[_0x0e86('0x42')]=[{'all':!![]}];}return db[_0x0e86('0x2b')][_0x0e86('0x43')](_0x49772c);})[_0x0e86('0x23')](function(_0x5fa25f){_0x3ab90e['rows']=_0x5fa25f;return _0x3ab90e;})[_0x0e86('0x23')](respondWithFilteredResult(_0x57c6bb,_0x49772c))[_0x0e86('0x44')](handleError(_0x57c6bb,null));};exports[_0x0e86('0x45')]=function(_0x45282c,_0x58e966){var _0x1c3855={'raw':!![],'where':{'id':_0x45282c[_0x0e86('0x46')]['id']}},_0x4b4a2c={};_0x4b4a2c[_0x0e86('0x32')]=_[_0x0e86('0x30')](db[_0x0e86('0x2b')][_0x0e86('0x47')]);_0x4b4a2c[_0x0e86('0x2f')]=_[_0x0e86('0x30')](_0x45282c[_0x0e86('0x2f')]);_0x4b4a2c['filters']=_[_0x0e86('0x31')](_0x4b4a2c[_0x0e86('0x32')],_0x4b4a2c['query']);_0x1c3855[_0x0e86('0x33')]=_[_0x0e86('0x31')](_0x4b4a2c[_0x0e86('0x32')],qs[_0x0e86('0x34')](_0x45282c[_0x0e86('0x2f')][_0x0e86('0x34')]));_0x1c3855[_0x0e86('0x33')]=_0x1c3855[_0x0e86('0x33')][_0x0e86('0x35')]?_0x1c3855[_0x0e86('0x33')]:_0x4b4a2c[_0x0e86('0x32')];if(_0x45282c[_0x0e86('0x2f')][_0x0e86('0x41')]){_0x1c3855[_0x0e86('0x42')]=[{'all':!![]}];}_0x1c3855=_[_0x0e86('0x3f')]({},_0x1c3855,_0x45282c[_0x0e86('0x40')]);return db[_0x0e86('0x2b')][_0x0e86('0x48')](_0x1c3855)[_0x0e86('0x23')](handleEntityNotFound(_0x58e966,null))[_0x0e86('0x23')](respondWithResult(_0x58e966,null))[_0x0e86('0x44')](handleError(_0x58e966,null));};exports[_0x0e86('0x49')]=function(_0x44eaa5,_0x1f2a55){return db['SquareDetailsReport'][_0x0e86('0x49')](_0x44eaa5['body'],{})['then'](respondWithResult(_0x1f2a55,0xc9))[_0x0e86('0x44')](handleError(_0x1f2a55,null));};exports[_0x0e86('0x22')]=function(_0x33de57,_0x334cc2){if(_0x33de57['body']['id']){delete _0x33de57['body']['id'];}return db[_0x0e86('0x2b')][_0x0e86('0x48')]({'where':{'id':_0x33de57['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x334cc2,null))['then'](saveUpdates(_0x33de57[_0x0e86('0x4a')],null))[_0x0e86('0x23')](respondWithResult(_0x334cc2,null))[_0x0e86('0x44')](handleError(_0x334cc2,null));};exports[_0x0e86('0x24')]=function(_0x53e1b5,_0x56aba4){return db[_0x0e86('0x2b')]['find']({'where':{'id':_0x53e1b5[_0x0e86('0x46')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x56aba4,null))[_0x0e86('0x23')](removeEntity(_0x56aba4,null))['catch'](handleError(_0x56aba4,null));};exports[_0x0e86('0x4b')]=function(_0x391917,_0x558ef5){return db['SquareDetailsReport'][_0x0e86('0x4b')]()[_0x0e86('0x23')](respondWithResult(_0x558ef5,null))[_0x0e86('0x44')](handleError(_0x558ef5,null));}; \ No newline at end of file +var _0xb7cb=['squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x4dccee,_0xd548){var _0x3a8fd8=function(_0x354480){while(--_0x354480){_0x4dccee['push'](_0x4dccee['shift']());}};_0x3a8fd8(++_0xd548);}(_0xb7cb,0x157));var _0xbb7c=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0xb7cb[_0x13342f];return _0x2fc1fc;};'use strict';var emlformat=require(_0xbb7c('0x0'));var rimraf=require(_0xbb7c('0x1'));var zipdir=require(_0xbb7c('0x2'));var jsonpatch=require(_0xbb7c('0x3'));var rp=require(_0xbb7c('0x4'));var moment=require(_0xbb7c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbb7c('0x6'));var util=require(_0xbb7c('0x7'));var path=require(_0xbb7c('0x8'));var sox=require('sox');var csv=require(_0xbb7c('0x9'));var ejs=require(_0xbb7c('0xa'));var fs=require('fs');var fs_extra=require(_0xbb7c('0xb'));var _=require('lodash');var squel=require(_0xbb7c('0xc'));var crypto=require(_0xbb7c('0xd'));var jsforce=require(_0xbb7c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbb7c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbb7c('0x10'));var hardwareService=require(_0xbb7c('0x11'));var logger=require(_0xbb7c('0x12'))('api');var utils=require(_0xbb7c('0x13'));var config=require(_0xbb7c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb7c('0x15'))['db'];function respondWithStatusCode(_0x42846b,_0x37aa57){_0x37aa57=_0x37aa57||0xcc;return function(_0x423fda){if(_0x423fda){return _0x42846b[_0xbb7c('0x16')](_0x37aa57);}return _0x42846b[_0xbb7c('0x17')](_0x37aa57)[_0xbb7c('0x18')]();};}function respondWithResult(_0x1294ea,_0x5c0641){_0x5c0641=_0x5c0641||0xc8;return function(_0x11c3f6){if(_0x11c3f6){return _0x1294ea['status'](_0x5c0641)[_0xbb7c('0x19')](_0x11c3f6);}};}function respondWithFilteredResult(_0x5b6de6,_0x33d786){return function(_0x2dc185){if(_0x2dc185){var _0x692be=typeof _0x33d786['offset']===_0xbb7c('0x1a')&&typeof _0x33d786[_0xbb7c('0x1b')]==='undefined';var _0x29872a=_0x2dc185[_0xbb7c('0x1c')];var _0x4f25f9=_0x692be?0x0:_0x33d786[_0xbb7c('0x1d')];var _0x362590=_0x692be?_0x2dc185[_0xbb7c('0x1c')]:_0x33d786['offset']+_0x33d786[_0xbb7c('0x1b')];var _0x46f6aa;if(_0x362590>=_0x29872a){_0x362590=_0x29872a;_0x46f6aa=0xc8;}else{_0x46f6aa=0xce;}_0x5b6de6[_0xbb7c('0x17')](_0x46f6aa);return _0x5b6de6[_0xbb7c('0x1e')](_0xbb7c('0x1f'),_0x4f25f9+'-'+_0x362590+'/'+_0x29872a)[_0xbb7c('0x19')](_0x2dc185);}return null;};}function patchUpdates(_0x47fea9){return function(_0x291179){try{jsonpatch[_0xbb7c('0x20')](_0x291179,_0x47fea9,!![]);}catch(_0x4e0f4f){return BPromise['reject'](_0x4e0f4f);}return _0x291179[_0xbb7c('0x21')]();};}function saveUpdates(_0x5d4ee8,_0x59d512){return function(_0x14d786){if(_0x14d786){return _0x14d786[_0xbb7c('0x22')](_0x5d4ee8)[_0xbb7c('0x23')](function(_0x16dec7){return _0x16dec7;});}return null;};}function removeEntity(_0x40cf17,_0x2c56ae){return function(_0x148fdc){if(_0x148fdc){return _0x148fdc[_0xbb7c('0x24')]()['then'](function(){_0x40cf17[_0xbb7c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28fa78,_0x3f61a0){return function(_0x4be66a){if(!_0x4be66a){_0x28fa78['sendStatus'](0x194);}return _0x4be66a;};}function handleError(_0x870e21,_0x46eb3b){_0x46eb3b=_0x46eb3b||0x1f4;return function(_0x1e6377){logger['error'](_0x1e6377[_0xbb7c('0x25')]);if(_0x1e6377[_0xbb7c('0x26')]){delete _0x1e6377['name'];}_0x870e21[_0xbb7c('0x17')](_0x46eb3b)[_0xbb7c('0x27')](_0x1e6377);};}exports[_0xbb7c('0x28')]=function(_0x4c35ee,_0x531f99){var _0x3a7f82={},_0x53d2fc={},_0x46af8f={'count':0x0,'rows':[]};var _0x5996a5=_[_0xbb7c('0x29')](db[_0xbb7c('0x2a')][_0xbb7c('0x2b')],function(_0x1f32a7){return{'name':_0x1f32a7[_0xbb7c('0x2c')],'type':_0x1f32a7[_0xbb7c('0x2d')]['key']};});_0x53d2fc[_0xbb7c('0x2e')]=_['map'](_0x5996a5,_0xbb7c('0x26'));_0x53d2fc[_0xbb7c('0x2f')]=_[_0xbb7c('0x30')](_0x4c35ee['query']);_0x53d2fc[_0xbb7c('0x31')]=_[_0xbb7c('0x32')](_0x53d2fc['model'],_0x53d2fc[_0xbb7c('0x2f')]);_0x3a7f82[_0xbb7c('0x33')]=_[_0xbb7c('0x32')](_0x53d2fc['model'],qs[_0xbb7c('0x34')](_0x4c35ee[_0xbb7c('0x2f')]['fields']));_0x3a7f82[_0xbb7c('0x33')]=_0x3a7f82[_0xbb7c('0x33')][_0xbb7c('0x35')]?_0x3a7f82['attributes']:_0x53d2fc[_0xbb7c('0x2e')];if(!_0x4c35ee[_0xbb7c('0x2f')]['hasOwnProperty']('nolimit')){_0x3a7f82[_0xbb7c('0x1b')]=qs[_0xbb7c('0x1b')](_0x4c35ee['query'][_0xbb7c('0x1b')]);_0x3a7f82[_0xbb7c('0x1d')]=qs[_0xbb7c('0x1d')](_0x4c35ee[_0xbb7c('0x2f')][_0xbb7c('0x1d')]);}_0x3a7f82['order']=qs[_0xbb7c('0x36')](_0x4c35ee[_0xbb7c('0x2f')][_0xbb7c('0x36')]);_0x3a7f82['where']=qs[_0xbb7c('0x31')](_[_0xbb7c('0x37')](_0x4c35ee[_0xbb7c('0x2f')],_0x53d2fc[_0xbb7c('0x31')]),_0x5996a5);if(_0x4c35ee['query'][_0xbb7c('0x38')]){_0x3a7f82[_0xbb7c('0x39')]=_[_0xbb7c('0x3a')](_0x3a7f82['where'],{'$or':_['map'](_0x5996a5,function(_0x26b8fa){if(_0x26b8fa['type']!=='VIRTUAL'){var _0x50d33c={};_0x50d33c[_0x26b8fa[_0xbb7c('0x26')]]={'$like':'%'+_0x4c35ee[_0xbb7c('0x2f')]['filter']+'%'};return _0x50d33c;}})});}_0x3a7f82=_['merge']({},_0x3a7f82,_0x4c35ee[_0xbb7c('0x3b')]);var _0x487317={'where':_0x3a7f82['where']};return db[_0xbb7c('0x2a')]['count'](_0x487317)[_0xbb7c('0x23')](function(_0x271f2a){_0x46af8f[_0xbb7c('0x1c')]=_0x271f2a;if(_0x4c35ee[_0xbb7c('0x2f')][_0xbb7c('0x3c')]){_0x3a7f82['include']=[{'all':!![]}];}return db[_0xbb7c('0x2a')][_0xbb7c('0x3d')](_0x3a7f82);})[_0xbb7c('0x23')](function(_0x2c90cf){_0x46af8f[_0xbb7c('0x3e')]=_0x2c90cf;return _0x46af8f;})[_0xbb7c('0x23')](respondWithFilteredResult(_0x531f99,_0x3a7f82))[_0xbb7c('0x3f')](handleError(_0x531f99,null));};exports[_0xbb7c('0x40')]=function(_0x1fe8e7,_0x59e6fd){var _0x571abd={'raw':!![],'where':{'id':_0x1fe8e7[_0xbb7c('0x41')]['id']}},_0x1dd4ee={};_0x1dd4ee[_0xbb7c('0x2e')]=_['keys'](db[_0xbb7c('0x2a')][_0xbb7c('0x2b')]);_0x1dd4ee[_0xbb7c('0x2f')]=_[_0xbb7c('0x30')](_0x1fe8e7['query']);_0x1dd4ee[_0xbb7c('0x31')]=_[_0xbb7c('0x32')](_0x1dd4ee['model'],_0x1dd4ee[_0xbb7c('0x2f')]);_0x571abd[_0xbb7c('0x33')]=_[_0xbb7c('0x32')](_0x1dd4ee[_0xbb7c('0x2e')],qs['fields'](_0x1fe8e7[_0xbb7c('0x2f')][_0xbb7c('0x34')]));_0x571abd[_0xbb7c('0x33')]=_0x571abd[_0xbb7c('0x33')][_0xbb7c('0x35')]?_0x571abd[_0xbb7c('0x33')]:_0x1dd4ee[_0xbb7c('0x2e')];if(_0x1fe8e7[_0xbb7c('0x2f')]['includeAll']){_0x571abd[_0xbb7c('0x42')]=[{'all':!![]}];}_0x571abd=_['merge']({},_0x571abd,_0x1fe8e7[_0xbb7c('0x3b')]);return db[_0xbb7c('0x2a')][_0xbb7c('0x43')](_0x571abd)[_0xbb7c('0x23')](handleEntityNotFound(_0x59e6fd,null))[_0xbb7c('0x23')](respondWithResult(_0x59e6fd,null))[_0xbb7c('0x3f')](handleError(_0x59e6fd,null));};exports[_0xbb7c('0x44')]=function(_0x52b88a,_0x35a1a0){return db[_0xbb7c('0x2a')][_0xbb7c('0x44')](_0x52b88a[_0xbb7c('0x45')],{})[_0xbb7c('0x23')](respondWithResult(_0x35a1a0,0xc9))['catch'](handleError(_0x35a1a0,null));};exports[_0xbb7c('0x22')]=function(_0x1e4af6,_0x455976){if(_0x1e4af6[_0xbb7c('0x45')]['id']){delete _0x1e4af6[_0xbb7c('0x45')]['id'];}return db[_0xbb7c('0x2a')][_0xbb7c('0x43')]({'where':{'id':_0x1e4af6['params']['id']}})[_0xbb7c('0x23')](handleEntityNotFound(_0x455976,null))[_0xbb7c('0x23')](saveUpdates(_0x1e4af6[_0xbb7c('0x45')],null))[_0xbb7c('0x23')](respondWithResult(_0x455976,null))[_0xbb7c('0x3f')](handleError(_0x455976,null));};exports[_0xbb7c('0x24')]=function(_0x2682ac,_0x3d933f){return db[_0xbb7c('0x2a')][_0xbb7c('0x43')]({'where':{'id':_0x2682ac[_0xbb7c('0x41')]['id']}})[_0xbb7c('0x23')](handleEntityNotFound(_0x3d933f,null))[_0xbb7c('0x23')](removeEntity(_0x3d933f,null))[_0xbb7c('0x3f')](handleError(_0x3d933f,null));};exports[_0xbb7c('0x46')]=function(_0x2fd707,_0x16147e){return db[_0xbb7c('0x2a')][_0xbb7c('0x46')]()[_0xbb7c('0x23')](respondWithResult(_0x16147e,null))[_0xbb7c('0x3f')](handleError(_0x16147e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 6d0b70c..d290fc0 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 _0x814e=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports'];(function(_0x14bb88,_0x1413a3){var _0x58654c=function(_0x4ed1ac){while(--_0x4ed1ac){_0x14bb88['push'](_0x14bb88['shift']());}};_0x58654c(++_0x1413a3);}(_0x814e,0xbc));var _0xe814=function(_0x2ac93b,_0x111338){_0x2ac93b=_0x2ac93b-0x0;var _0xc70f72=_0x814e[_0x2ac93b];return _0xc70f72;};'use strict';var _=require(_0xe814('0x0'));var util=require(_0xe814('0x1'));var logger=require(_0xe814('0x2'))('api');var moment=require(_0xe814('0x3'));var BPromise=require(_0xe814('0x4'));var rp=require(_0xe814('0x5'));var fs=require('fs');var path=require(_0xe814('0x6'));var rimraf=require(_0xe814('0x7'));var config=require('../../config/environment');var attributes=require(_0xe814('0x8'));module[_0xe814('0x9')]=function(_0x52e13e,_0x39ff30){return _0x52e13e[_0xe814('0xa')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78a0=['exports','report_square_details','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./squareReportDetail.attributes'];(function(_0x88cea5,_0x1f7ad9){var _0x701927=function(_0x2c8d8e){while(--_0x2c8d8e){_0x88cea5['push'](_0x88cea5['shift']());}};_0x701927(++_0x1f7ad9);}(_0x78a0,0x98));var _0x078a=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x78a0[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0x078a('0x0'));var util=require('util');var logger=require(_0x078a('0x1'))(_0x078a('0x2'));var moment=require(_0x078a('0x3'));var BPromise=require('bluebird');var rp=require(_0x078a('0x4'));var fs=require('fs');var path=require(_0x078a('0x5'));var rimraf=require(_0x078a('0x6'));var config=require('../../config/environment');var attributes=require(_0x078a('0x7'));module[_0x078a('0x8')]=function(_0x3c55af,_0x52cee3){return _0x3c55af['define']('SquareDetailsReport',attributes,{'tableName':_0x078a('0x9'),'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 db1d221..7a45a11 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 _0x9348=['result','SquareDetailsReport','create','body','options','then','CreateSquareDetailsReport','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x4f9644,_0xfd24cb){var _0x45e179=function(_0x3e9163){while(--_0x3e9163){_0x4f9644['push'](_0x4f9644['shift']());}};_0x45e179(++_0xfd24cb);}(_0x9348,0x10d));var _0x8934=function(_0x4324e1,_0x55c2d8){_0x4324e1=_0x4324e1-0x0;var _0x44a26e=_0x9348[_0x4324e1];return _0x44a26e;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['CreateSquareDetailsReport']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')](_0x47f25e[_0x8934('0x18')],{'raw':_0x47f25e[_0x8934('0x19')]?_0x47f25e[_0x8934('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8934('0x1a')](function(_0x5ae49f){logger[_0x8934('0x14')](_0x8934('0x1b'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x1b'),_0x47f25e,JSON[_0x8934('0x10')](_0x5ae49f));_0x2ff9ce(_0x5ae49f);})[_0x8934('0x1c')](function(_0x36fe20){logger['error'](_0x8934('0x1b'),_0x36fe20[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed[_0x8934('0x11')](0x1f4,_0x36fe20[_0x8934('0x13')]));});});}; \ No newline at end of file +var _0x5b12=['../../config/utils','rpc','client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x362f6d,_0x59089a){var _0xde9ff1=function(_0x3aad76){while(--_0x3aad76){_0x362f6d['push'](_0x362f6d['shift']());}};_0xde9ff1(++_0x59089a);}(_0x5b12,0xa3));var _0x25b1=function(_0x427e0f,_0x123805){_0x427e0f=_0x427e0f-0x0;var _0x2531d9=_0x5b12[_0x427e0f];return _0x2531d9;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['create'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3bfd7d){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger['debug'](_0x25b1('0x14'),_0x27ccc9,JSON['stringify'](_0x3bfd7d));_0x2a7d14(_0x3bfd7d);})['catch'](function(_0x565cfd){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x565cfd['message'],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x565cfd[_0x25b1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3828113..3efa99e 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 _0x4eec=['get','killProcess','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x456b45,_0x273834){var _0xe3627d=function(_0x3a6f59){while(--_0x3a6f59){_0x456b45['push'](_0x456b45['shift']());}};_0xe3627d(++_0x273834);}(_0x4eec,0xeb));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc4ee('0x0'));var router=express[_0xc4ee('0x1')]();var auth=require(_0xc4ee('0x2'));var controller=require(_0xc4ee('0x3'));router['get']('/',auth[_0xc4ee('0x4')](),controller['index']);router[_0xc4ee('0x5')]('/process/:pid/kill',auth[_0xc4ee('0x4')](),controller[_0xc4ee('0x6')]);module[_0xc4ee('0x7')]=router; \ No newline at end of file +var _0xc05b=['isAuthenticated','/process/:pid/kill','exports','Router','../../components/auth/service','./system.controller','get'];(function(_0x1920d8,_0x140ccf){var _0x51965d=function(_0x5ab12b){while(--_0x5ab12b){_0x1920d8['push'](_0x1920d8['shift']());}};_0x51965d(++_0x140ccf);}(_0xc05b,0x14c));var _0xbc05=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0xc05b[_0x45313f];return _0x402910;};'use strict';var express=require('express');var router=express[_0xbc05('0x0')]();var auth=require(_0xbc05('0x1'));var controller=require(_0xbc05('0x2'));router[_0xbc05('0x3')]('/',auth[_0xbc05('0x4')](),controller['index']);router[_0xbc05('0x3')](_0xbc05('0x5'),auth[_0xbc05('0x4')](),controller['killProcess']);module[_0xbc05('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a47d631..5d110b2 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 _0x4cf5=['util','error','inspect','name','status','index','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4cf5,0x1e9));var _0x54cf=function(_0x50ad7b,_0x4f9139){_0x50ad7b=_0x50ad7b-0x0;var _0x444356=_0x4cf5[_0x50ad7b];return _0x444356;};'use strict';var info=require(_0x54cf('0x0'));var exec=require(_0x54cf('0x1'))[_0x54cf('0x2')];var logger=require(_0x54cf('0x3'))(_0x54cf('0x4'));var util=require(_0x54cf('0x5'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x116d0e,_0x109670,_0x41ce53){_0x109670=_0x109670||0x1f4;return function(_0x238125){logger[_0x54cf('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x41ce53,_0x109670,util[_0x54cf('0x7')](_0x238125,{'showHidden':![],'depth':null}));delete _0x238125[_0x54cf('0x8')];_0x116d0e[_0x54cf('0x9')](_0x109670)['send'](_0x238125);};}exports[_0x54cf('0xa')]=function(_0x3ab0b9,_0x597341){return info['getAllData']()[_0x54cf('0xb')](function(_0x17d13c){return _0x597341[_0x54cf('0x9')](0xc8)[_0x54cf('0xc')](_0x17d13c);})[_0x54cf('0xd')](function(_0x380196){return _0x597341[_0x54cf('0x9')](0x1f4)[_0x54cf('0xc')](_0x380196);});};exports[_0x54cf('0xe')]=function(_0x5bb59c,_0x7ebbe8){var _0x1a3e6b=[_0x54cf('0xf')];return new BPromise(function(_0x344de4,_0x3c722f){return exec(util[_0x54cf('0x10')](_0x54cf('0x11'),_0x5bb59c[_0x54cf('0x12')][_0x54cf('0x13')]),function(_0x383471,_0x42553a,_0x411331){if(_0x383471){return _0x3c722f(_0x383471);}return _0x344de4(_0x42553a);});})[_0x54cf('0xb')](function(_0x98135){var _0x39b9a9=![];var _0x1742cc=_0x98135['split'](/\n/);for(var _0x421974=0x0,_0x2e4c76=_0x1a3e6b[_0x54cf('0x14')];_0x421974<_0x2e4c76,_0x39b9a9===![];_0x421974+=0x1){if(_0x98135[_0x54cf('0x15')](_0x1a3e6b[_0x421974])>=0x0){_0x39b9a9=!![];}}if(!_0x39b9a9){throw new Error(util['format'](_0x54cf('0x16'),_0x5bb59c[_0x54cf('0x12')][_0x54cf('0x13')]));}process[_0x54cf('0x17')](_0x5bb59c['params'][_0x54cf('0x13')],_0x54cf('0x18'));return _0x7ebbe8[_0x54cf('0x9')](0xc8)[_0x54cf('0xc')]({'message':util[_0x54cf('0x10')](_0x54cf('0x19'),_0x5bb59c[_0x54cf('0x12')][_0x54cf('0x13')])});})[_0x54cf('0xd')](handleError(_0x7ebbe8,null,_0x54cf('0xe')));}; \ No newline at end of file +var _0xaa4f=['Process\x20with\x20pid\x20%s\x20not\x20found!','params','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','getAllData','then','status','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','format'];(function(_0x2c4e79,_0x2ecbf5){var _0x428d2a=function(_0x4b5793){while(--_0x4b5793){_0x2c4e79['push'](_0x2c4e79['shift']());}};_0x428d2a(++_0x2ecbf5);}(_0xaa4f,0x7b));var _0xfaa4=function(_0x2848be,_0x100627){_0x2848be=_0x2848be-0x0;var _0x2bf68d=_0xaa4f[_0x2848be];return _0x2bf68d;};'use strict';var info=require(_0xfaa4('0x0'));var exec=require('child_process')['exec'];var logger=require(_0xfaa4('0x1'))(_0xfaa4('0x2'));var util=require(_0xfaa4('0x3'));var BPromise=require(_0xfaa4('0x4'));var _=require(_0xfaa4('0x5'));function handleError(_0x384413,_0x7a612b,_0x5aa273){_0x7a612b=_0x7a612b||0x1f4;return function(_0x542253){logger[_0xfaa4('0x6')](_0xfaa4('0x7'),_0x5aa273,_0x7a612b,util[_0xfaa4('0x8')](_0x542253,{'showHidden':![],'depth':null}));delete _0x542253['name'];_0x384413['status'](_0x7a612b)['send'](_0x542253);};}exports['index']=function(_0x8139df,_0x51cacf){return info[_0xfaa4('0x9')]()[_0xfaa4('0xa')](function(_0x5e6c3d){return _0x51cacf[_0xfaa4('0xb')](0xc8)[_0xfaa4('0xc')](_0x5e6c3d);})[_0xfaa4('0xd')](function(_0x1f8077){return _0x51cacf[_0xfaa4('0xb')](0x1f4)[_0xfaa4('0xc')](_0x1f8077);});};exports[_0xfaa4('0xe')]=function(_0x2540e6,_0x164642){var _0x2820f4=[_0xfaa4('0xf')];return new BPromise(function(_0x187af7,_0x19a789){return exec(util['format'](_0xfaa4('0x10'),_0x2540e6['params'][_0xfaa4('0x11')]),function(_0x183238,_0x4c63d5,_0x5ddf84){if(_0x183238){return _0x19a789(_0x183238);}return _0x187af7(_0x4c63d5);});})[_0xfaa4('0xa')](function(_0x1f1d23){var _0x25c623=![];var _0x3defdb=_0x1f1d23[_0xfaa4('0x12')](/\n/);for(var _0x2ca6e6=0x0,_0x2f4722=_0x2820f4[_0xfaa4('0x13')];_0x2ca6e6<_0x2f4722,_0x25c623===![];_0x2ca6e6+=0x1){if(_0x1f1d23['indexOf'](_0x2820f4[_0x2ca6e6])>=0x0){_0x25c623=!![];}}if(!_0x25c623){throw new Error(util[_0xfaa4('0x14')](_0xfaa4('0x15'),_0x2540e6[_0xfaa4('0x16')]['pid']));}process['kill'](_0x2540e6[_0xfaa4('0x16')][_0xfaa4('0x11')],'SIGINT');return _0x164642[_0xfaa4('0xb')](0xc8)['json']({'message':util[_0xfaa4('0x14')](_0xfaa4('0x17'),_0x2540e6['params']['pid'])});})[_0xfaa4('0xd')](handleError(_0x164642,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index e345c03..a5b399f 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 _0x34e8=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x373799,_0x11a1c5){var _0xd14d20=function(_0x32e27a){while(--_0x32e27a){_0x373799['push'](_0x373799['shift']());}};_0xd14d20(++_0x11a1c5);}(_0x34e8,0x12c));var _0x834e=function(_0x1d1914,_0x52ca15){_0x1d1914=_0x1d1914-0x0;var _0x559fc4=_0x34e8[_0x1d1914];return _0x559fc4;};'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('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0x15')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x16')]=router; \ No newline at end of file +var _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','index','/describe','isAuthenticated'];(function(_0xb16c89,_0x330be9){var _0xbd6b13=function(_0x562649){while(--_0x562649){_0xb16c89['push'](_0xb16c89['shift']());}};_0xbd6b13(++_0x330be9);}(_0xbec5,0xe5));var _0x5bec=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0xbec5[_0x28e2cd];return _0x11fd46;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index e79c910..5802ad4 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 _0x19e1=['exports','STRING','name','sequelize'];(function(_0x614ef4,_0x28a060){var _0x35e8e2=function(_0x55e81b){while(--_0x55e81b){_0x614ef4['push'](_0x614ef4['shift']());}};_0x35e8e2(++_0x28a060);}(_0x19e1,0x163));var _0x119e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x19e1[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x119e('0x0'));module[_0x119e('0x1')]={'name':{'type':Sequelize[_0x119e('0x2')],'unique':_0x119e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x119e('0x2')]}}; \ No newline at end of file +var _0x3308=['name','#0091EA','sequelize','exports','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x3308,0x160));var _0x8330=function(_0x1b5620,_0x3f6bac){_0x1b5620=_0x1b5620-0x0;var _0x11cd02=_0x3308[_0x1b5620];return _0x11cd02;};'use strict';var Sequelize=require(_0x8330('0x0'));module[_0x8330('0x1')]={'name':{'type':Sequelize[_0x8330('0x2')],'unique':_0x8330('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8330('0x2')],'defaultValue':_0x8330('0x4')},'description':{'type':Sequelize[_0x8330('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index df69c3c..c4392ad 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 _0x70be=['../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','reject','update','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','index','Tag','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x1dd847,_0x1d943e){var _0x57ac0b=function(_0x66a36b){while(--_0x66a36b){_0x1dd847['push'](_0x1dd847['shift']());}};_0x57ac0b(++_0x1d943e);}(_0x70be,0x12d));var _0xe70b=function(_0x14f9d2,_0x5b8d29){_0x14f9d2=_0x14f9d2-0x0;var _0x2b8dc0=_0x70be[_0x14f9d2];return _0x2b8dc0;};'use strict';var emlformat=require(_0xe70b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe70b('0x1'));var jsonpatch=require(_0xe70b('0x2'));var rp=require(_0xe70b('0x3'));var moment=require(_0xe70b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe70b('0x5'));var util=require(_0xe70b('0x6'));var path=require(_0xe70b('0x7'));var sox=require(_0xe70b('0x8'));var csv=require(_0xe70b('0x9'));var ejs=require(_0xe70b('0xa'));var fs=require('fs');var fs_extra=require(_0xe70b('0xb'));var _=require(_0xe70b('0xc'));var squel=require(_0xe70b('0xd'));var crypto=require('crypto');var jsforce=require(_0xe70b('0xe'));var deskjs=require(_0xe70b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe70b('0x10'));var Redis=require(_0xe70b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe70b('0x12'));var hardwareService=require(_0xe70b('0x13'));var logger=require(_0xe70b('0x14'))(_0xe70b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe70b('0x16'));var db=require(_0xe70b('0x17'))['db'];function respondWithStatusCode(_0x55ea0b,_0x224b23){_0x224b23=_0x224b23||0xcc;return function(_0x536975){if(_0x536975){return _0x55ea0b[_0xe70b('0x18')](_0x224b23);}return _0x55ea0b[_0xe70b('0x19')](_0x224b23)['end']();};}function respondWithResult(_0x51beea,_0x112cff){_0x112cff=_0x112cff||0xc8;return function(_0xd4438a){if(_0xd4438a){return _0x51beea[_0xe70b('0x19')](_0x112cff)['json'](_0xd4438a);}};}function respondWithFilteredResult(_0x598e0a,_0x2a19bf){return function(_0x49a9eb){if(_0x49a9eb){var _0x3c8ecc=typeof _0x2a19bf[_0xe70b('0x1a')]===_0xe70b('0x1b')&&typeof _0x2a19bf[_0xe70b('0x1c')]==='undefined';var _0x1b10a2=_0x49a9eb[_0xe70b('0x1d')];var _0x31afca=_0x3c8ecc?0x0:_0x2a19bf[_0xe70b('0x1a')];var _0xb62724=_0x3c8ecc?_0x49a9eb[_0xe70b('0x1d')]:_0x2a19bf[_0xe70b('0x1a')]+_0x2a19bf['limit'];var _0x3b93c6;if(_0xb62724>=_0x1b10a2){_0xb62724=_0x1b10a2;_0x3b93c6=0xc8;}else{_0x3b93c6=0xce;}_0x598e0a[_0xe70b('0x19')](_0x3b93c6);return _0x598e0a['set'](_0xe70b('0x1e'),_0x31afca+'-'+_0xb62724+'/'+_0x1b10a2)['json'](_0x49a9eb);}return null;};}function patchUpdates(_0x376409){return function(_0x36ace1){try{jsonpatch['apply'](_0x36ace1,_0x376409,!![]);}catch(_0xba985d){return BPromise[_0xe70b('0x1f')](_0xba985d);}return _0x36ace1['save']();};}function saveUpdates(_0x37c5f,_0xd80f6){return function(_0x451f97){if(_0x451f97){return _0x451f97[_0xe70b('0x20')](_0x37c5f)[_0xe70b('0x21')](function(_0x27feae){return _0x27feae;});}return null;};}function removeEntity(_0x2b194c,_0x4abb5c){return function(_0x4ee14e){if(_0x4ee14e){return _0x4ee14e['destroy']()[_0xe70b('0x21')](function(){var _0x5350d6=_0x4ee14e[_0xe70b('0x22')]({'plain':!![]});var _0x12699a=_0xe70b('0x23');return db[_0xe70b('0x24')][_0xe70b('0x25')]({'where':{'type':_0x12699a,'resourceId':_0x5350d6['id']}})['then'](function(){return _0x4ee14e;});})[_0xe70b('0x21')](function(){_0x2b194c[_0xe70b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x537c71,_0x1705f){return function(_0x5339b6){if(!_0x5339b6){_0x537c71[_0xe70b('0x18')](0x194);}return _0x5339b6;};}function handleError(_0x13daef,_0x520a61){_0x520a61=_0x520a61||0x1f4;return function(_0x3a14b9){logger[_0xe70b('0x26')](_0x3a14b9[_0xe70b('0x27')]);if(_0x3a14b9[_0xe70b('0x28')]){delete _0x3a14b9['name'];}_0x13daef[_0xe70b('0x19')](_0x520a61)[_0xe70b('0x29')](_0x3a14b9);};}exports[_0xe70b('0x2a')]=function(_0x2c82f3,_0x596c07){var _0x2059ee={},_0x23c44d={},_0x2d76ca={'count':0x0,'rows':[]};var _0x43eb5d=_['map'](db[_0xe70b('0x2b')][_0xe70b('0x2c')],function(_0x494689){return{'name':_0x494689[_0xe70b('0x2d')],'type':_0x494689['type'][_0xe70b('0x2e')]};});_0x23c44d['model']=_[_0xe70b('0x2f')](_0x43eb5d,_0xe70b('0x28'));_0x23c44d[_0xe70b('0x30')]=_['keys'](_0x2c82f3[_0xe70b('0x30')]);_0x23c44d[_0xe70b('0x31')]=_[_0xe70b('0x32')](_0x23c44d[_0xe70b('0x33')],_0x23c44d[_0xe70b('0x30')]);_0x2059ee[_0xe70b('0x34')]=_[_0xe70b('0x32')](_0x23c44d['model'],qs[_0xe70b('0x35')](_0x2c82f3[_0xe70b('0x30')][_0xe70b('0x35')]));_0x2059ee[_0xe70b('0x34')]=_0x2059ee[_0xe70b('0x34')]['length']?_0x2059ee['attributes']:_0x23c44d['model'];if(!_0x2c82f3[_0xe70b('0x30')][_0xe70b('0x36')](_0xe70b('0x37'))){_0x2059ee[_0xe70b('0x1c')]=qs[_0xe70b('0x1c')](_0x2c82f3['query'][_0xe70b('0x1c')]);_0x2059ee[_0xe70b('0x1a')]=qs[_0xe70b('0x1a')](_0x2c82f3[_0xe70b('0x30')]['offset']);}_0x2059ee[_0xe70b('0x38')]=qs[_0xe70b('0x39')](_0x2c82f3[_0xe70b('0x30')][_0xe70b('0x39')]);_0x2059ee[_0xe70b('0x3a')]=qs['filters'](_['pick'](_0x2c82f3['query'],_0x23c44d[_0xe70b('0x31')]),_0x43eb5d);if(_0x2c82f3['query'][_0xe70b('0x3b')]){_0x2059ee['where']=_[_0xe70b('0x3c')](_0x2059ee[_0xe70b('0x3a')],{'$or':_[_0xe70b('0x2f')](_0x43eb5d,function(_0x21970f){if(_0x21970f['type']!=='VIRTUAL'){var _0x31401a={};_0x31401a[_0x21970f[_0xe70b('0x28')]]={'$like':'%'+_0x2c82f3['query'][_0xe70b('0x3b')]+'%'};return _0x31401a;}})});}_0x2059ee=_[_0xe70b('0x3c')]({},_0x2059ee,_0x2c82f3[_0xe70b('0x3d')]);var _0x37ebb9={'where':_0x2059ee[_0xe70b('0x3a')]};return db[_0xe70b('0x2b')][_0xe70b('0x1d')](_0x37ebb9)[_0xe70b('0x21')](function(_0x3fd1ca){_0x2d76ca[_0xe70b('0x1d')]=_0x3fd1ca;if(_0x2c82f3[_0xe70b('0x30')][_0xe70b('0x3e')]){_0x2059ee[_0xe70b('0x3f')]=[{'all':!![]}];}return db[_0xe70b('0x2b')][_0xe70b('0x40')](_0x2059ee);})[_0xe70b('0x21')](function(_0x5f39c0){_0x2d76ca[_0xe70b('0x41')]=_0x5f39c0;return _0x2d76ca;})[_0xe70b('0x21')](respondWithFilteredResult(_0x596c07,_0x2059ee))['catch'](handleError(_0x596c07,null));};exports[_0xe70b('0x42')]=function(_0x2bc776,_0x4fc28e){var _0x5cd57c={'raw':!![],'where':{'id':_0x2bc776[_0xe70b('0x43')]['id']}},_0x856f6d={};_0x856f6d['model']=_[_0xe70b('0x44')](db['Tag'][_0xe70b('0x2c')]);_0x856f6d[_0xe70b('0x30')]=_[_0xe70b('0x44')](_0x2bc776[_0xe70b('0x30')]);_0x856f6d[_0xe70b('0x31')]=_[_0xe70b('0x32')](_0x856f6d[_0xe70b('0x33')],_0x856f6d[_0xe70b('0x30')]);_0x5cd57c[_0xe70b('0x34')]=_[_0xe70b('0x32')](_0x856f6d[_0xe70b('0x33')],qs[_0xe70b('0x35')](_0x2bc776[_0xe70b('0x30')][_0xe70b('0x35')]));_0x5cd57c[_0xe70b('0x34')]=_0x5cd57c[_0xe70b('0x34')][_0xe70b('0x45')]?_0x5cd57c['attributes']:_0x856f6d[_0xe70b('0x33')];if(_0x2bc776[_0xe70b('0x30')]['includeAll']){_0x5cd57c[_0xe70b('0x3f')]=[{'all':!![]}];}_0x5cd57c=_[_0xe70b('0x3c')]({},_0x5cd57c,_0x2bc776[_0xe70b('0x3d')]);return db[_0xe70b('0x2b')][_0xe70b('0x46')](_0x5cd57c)[_0xe70b('0x21')](handleEntityNotFound(_0x4fc28e,null))[_0xe70b('0x21')](respondWithResult(_0x4fc28e,null))['catch'](handleError(_0x4fc28e,null));};exports[_0xe70b('0x47')]=function(_0x50c22e,_0xc55238){return db[_0xe70b('0x2b')]['create'](_0x50c22e[_0xe70b('0x48')],{})['then'](function(_0xfe20eb){var _0x5b4be9=_0x50c22e[_0xe70b('0x49')][_0xe70b('0x22')]({'plain':!![]});if(!_0x5b4be9)throw new Error(_0xe70b('0x4a'));if(_0x5b4be9[_0xe70b('0x4b')]===_0xe70b('0x49')){var _0x343377=_0xfe20eb['get']({'plain':!![]});var _0x1721a0=_0xe70b('0x23');return db[_0xe70b('0x4c')][_0xe70b('0x46')]({'where':{'name':_0x1721a0,'userProfileId':_0x5b4be9[_0xe70b('0x4d')]},'raw':!![]})[_0xe70b('0x21')](function(_0x369cd4){if(_0x369cd4&&_0x369cd4['autoAssociation']===0x0){return db['UserProfileResource'][_0xe70b('0x47')]({'name':_0x343377[_0xe70b('0x28')],'resourceId':_0x343377['id'],'type':_0x369cd4[_0xe70b('0x28')],'sectionId':_0x369cd4['id']},{})[_0xe70b('0x21')](function(){return _0xfe20eb;});}else{return _0xfe20eb;}})[_0xe70b('0x4e')](function(_0xd2ae1d){logger[_0xe70b('0x26')](_0xe70b('0x4f'),_0xd2ae1d);throw _0xd2ae1d;});}return _0xfe20eb;})[_0xe70b('0x21')](respondWithResult(_0xc55238,0xc9))[_0xe70b('0x4e')](handleError(_0xc55238,null));};exports[_0xe70b('0x20')]=function(_0x11f93b,_0x2e171a){if(_0x11f93b[_0xe70b('0x48')]['id']){delete _0x11f93b['body']['id'];}return db['Tag'][_0xe70b('0x46')]({'where':{'id':_0x11f93b[_0xe70b('0x43')]['id']}})[_0xe70b('0x21')](handleEntityNotFound(_0x2e171a,null))[_0xe70b('0x21')](saveUpdates(_0x11f93b['body'],null))[_0xe70b('0x21')](respondWithResult(_0x2e171a,null))['catch'](handleError(_0x2e171a,null));};exports[_0xe70b('0x25')]=function(_0x2f2234,_0x5a5083){return db['Tag'][_0xe70b('0x46')]({'where':{'id':_0x2f2234['params']['id']}})[_0xe70b('0x21')](handleEntityNotFound(_0x5a5083,null))[_0xe70b('0x21')](removeEntity(_0x5a5083,null))['catch'](handleError(_0x5a5083,null));};exports[_0xe70b('0x50')]=function(_0x2435f,_0x112358){return db['Tag']['describe']()[_0xe70b('0x21')](respondWithResult(_0x112358,null))['catch'](handleError(_0x112358,null));}; \ No newline at end of file +var _0xd022=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','reject','save','Tags','UserProfileResource','destroy','then','error','stack','name','send','index','map','rawAttributes','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Tag','count','includeAll','include','findAll','rows','catch','keys','find','create','body','user','get'];(function(_0x1e9347,_0x29a5d6){var _0xbd7bbb=function(_0x28c418){while(--_0x28c418){_0x1e9347['push'](_0x1e9347['shift']());}};_0xbd7bbb(++_0x29a5d6);}(_0xd022,0xa6));var _0x2d02=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd022[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x2d02('0x0'));var rimraf=require(_0x2d02('0x1'));var zipdir=require(_0x2d02('0x2'));var jsonpatch=require(_0x2d02('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2d02('0x4'));var Mustache=require(_0x2d02('0x5'));var util=require('util');var path=require(_0x2d02('0x6'));var sox=require(_0x2d02('0x7'));var csv=require(_0x2d02('0x8'));var ejs=require(_0x2d02('0x9'));var fs=require('fs');var fs_extra=require(_0x2d02('0xa'));var _=require(_0x2d02('0xb'));var squel=require('squel');var crypto=require(_0x2d02('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2d02('0x8'));var querystring=require(_0x2d02('0xd'));var Papa=require(_0x2d02('0xe'));var Redis=require('ioredis');var authService=require(_0x2d02('0xf'));var qs=require(_0x2d02('0x10'));var as=require(_0x2d02('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2d02('0x12'));var config=require(_0x2d02('0x13'));var licenseUtil=require(_0x2d02('0x14'));var db=require(_0x2d02('0x15'))['db'];function respondWithStatusCode(_0x41bd6a,_0x5bf254){_0x5bf254=_0x5bf254||0xcc;return function(_0x4b6745){if(_0x4b6745){return _0x41bd6a[_0x2d02('0x16')](_0x5bf254);}return _0x41bd6a[_0x2d02('0x17')](_0x5bf254)['end']();};}function respondWithResult(_0x1eae3f,_0x40e919){_0x40e919=_0x40e919||0xc8;return function(_0xee5791){if(_0xee5791){return _0x1eae3f[_0x2d02('0x17')](_0x40e919)[_0x2d02('0x18')](_0xee5791);}};}function respondWithFilteredResult(_0x3d9a08,_0x340661){return function(_0x2bcd77){if(_0x2bcd77){var _0x926b2b=typeof _0x340661[_0x2d02('0x19')]==='undefined'&&typeof _0x340661[_0x2d02('0x1a')]==='undefined';var _0x37fa19=_0x2bcd77['count'];var _0x3e308d=_0x926b2b?0x0:_0x340661['offset'];var _0x2d53b0=_0x926b2b?_0x2bcd77['count']:_0x340661['offset']+_0x340661[_0x2d02('0x1a')];var _0x991803;if(_0x2d53b0>=_0x37fa19){_0x2d53b0=_0x37fa19;_0x991803=0xc8;}else{_0x991803=0xce;}_0x3d9a08[_0x2d02('0x17')](_0x991803);return _0x3d9a08['set'](_0x2d02('0x1b'),_0x3e308d+'-'+_0x2d53b0+'/'+_0x37fa19)[_0x2d02('0x18')](_0x2bcd77);}return null;};}function patchUpdates(_0x26bf0f){return function(_0x3390f3){try{jsonpatch['apply'](_0x3390f3,_0x26bf0f,!![]);}catch(_0xc62499){return BPromise[_0x2d02('0x1c')](_0xc62499);}return _0x3390f3[_0x2d02('0x1d')]();};}function saveUpdates(_0x3ac116,_0x2c0425){return function(_0x507bb8){if(_0x507bb8){return _0x507bb8['update'](_0x3ac116)['then'](function(_0x5f469f){return _0x5f469f;});}return null;};}function removeEntity(_0x411523,_0x1c4e73){return function(_0x10529a){if(_0x10529a){return _0x10529a['destroy']()['then'](function(){var _0x4b30ca=_0x10529a['get']({'plain':!![]});var _0x437def=_0x2d02('0x1e');return db[_0x2d02('0x1f')][_0x2d02('0x20')]({'where':{'type':_0x437def,'resourceId':_0x4b30ca['id']}})['then'](function(){return _0x10529a;});})[_0x2d02('0x21')](function(){_0x411523[_0x2d02('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478650,_0x563b90){return function(_0x1418e6){if(!_0x1418e6){_0x478650[_0x2d02('0x16')](0x194);}return _0x1418e6;};}function handleError(_0x6fbf,_0x98e1b6){_0x98e1b6=_0x98e1b6||0x1f4;return function(_0x51430b){logger[_0x2d02('0x22')](_0x51430b[_0x2d02('0x23')]);if(_0x51430b[_0x2d02('0x24')]){delete _0x51430b[_0x2d02('0x24')];}_0x6fbf[_0x2d02('0x17')](_0x98e1b6)[_0x2d02('0x25')](_0x51430b);};}exports[_0x2d02('0x26')]=function(_0x28e0d6,_0x2ff166){var _0x295de9={},_0x37e3c5={},_0x197b3f={'count':0x0,'rows':[]};var _0x3a80b9=_[_0x2d02('0x27')](db['Tag'][_0x2d02('0x28')],function(_0x1fe69a){return{'name':_0x1fe69a['fieldName'],'type':_0x1fe69a[_0x2d02('0x29')]['key']};});_0x37e3c5['model']=_['map'](_0x3a80b9,'name');_0x37e3c5[_0x2d02('0x2a')]=_['keys'](_0x28e0d6[_0x2d02('0x2a')]);_0x37e3c5[_0x2d02('0x2b')]=_[_0x2d02('0x2c')](_0x37e3c5['model'],_0x37e3c5[_0x2d02('0x2a')]);_0x295de9[_0x2d02('0x2d')]=_[_0x2d02('0x2c')](_0x37e3c5[_0x2d02('0x2e')],qs[_0x2d02('0x2f')](_0x28e0d6[_0x2d02('0x2a')][_0x2d02('0x2f')]));_0x295de9[_0x2d02('0x2d')]=_0x295de9[_0x2d02('0x2d')][_0x2d02('0x30')]?_0x295de9['attributes']:_0x37e3c5[_0x2d02('0x2e')];if(!_0x28e0d6[_0x2d02('0x2a')]['hasOwnProperty'](_0x2d02('0x31'))){_0x295de9[_0x2d02('0x1a')]=qs[_0x2d02('0x1a')](_0x28e0d6['query'][_0x2d02('0x1a')]);_0x295de9['offset']=qs[_0x2d02('0x19')](_0x28e0d6[_0x2d02('0x2a')][_0x2d02('0x19')]);}_0x295de9[_0x2d02('0x32')]=qs['sort'](_0x28e0d6[_0x2d02('0x2a')][_0x2d02('0x33')]);_0x295de9['where']=qs[_0x2d02('0x2b')](_[_0x2d02('0x34')](_0x28e0d6['query'],_0x37e3c5['filters']),_0x3a80b9);if(_0x28e0d6['query']['filter']){_0x295de9['where']=_[_0x2d02('0x35')](_0x295de9[_0x2d02('0x36')],{'$or':_[_0x2d02('0x27')](_0x3a80b9,function(_0x1cf557){if(_0x1cf557[_0x2d02('0x29')]!==_0x2d02('0x37')){var _0x558633={};_0x558633[_0x1cf557[_0x2d02('0x24')]]={'$like':'%'+_0x28e0d6['query'][_0x2d02('0x38')]+'%'};return _0x558633;}})});}_0x295de9=_['merge']({},_0x295de9,_0x28e0d6[_0x2d02('0x39')]);var _0x5421bb={'where':_0x295de9[_0x2d02('0x36')]};return db[_0x2d02('0x3a')]['count'](_0x5421bb)[_0x2d02('0x21')](function(_0x5ccc42){_0x197b3f[_0x2d02('0x3b')]=_0x5ccc42;if(_0x28e0d6[_0x2d02('0x2a')][_0x2d02('0x3c')]){_0x295de9[_0x2d02('0x3d')]=[{'all':!![]}];}return db[_0x2d02('0x3a')][_0x2d02('0x3e')](_0x295de9);})[_0x2d02('0x21')](function(_0x5d0d24){_0x197b3f[_0x2d02('0x3f')]=_0x5d0d24;return _0x197b3f;})[_0x2d02('0x21')](respondWithFilteredResult(_0x2ff166,_0x295de9))[_0x2d02('0x40')](handleError(_0x2ff166,null));};exports['show']=function(_0x221345,_0x337330){var _0x44a010={'raw':!![],'where':{'id':_0x221345['params']['id']}},_0x291bf4={};_0x291bf4[_0x2d02('0x2e')]=_[_0x2d02('0x41')](db[_0x2d02('0x3a')][_0x2d02('0x28')]);_0x291bf4['query']=_[_0x2d02('0x41')](_0x221345['query']);_0x291bf4[_0x2d02('0x2b')]=_['intersection'](_0x291bf4[_0x2d02('0x2e')],_0x291bf4[_0x2d02('0x2a')]);_0x44a010['attributes']=_[_0x2d02('0x2c')](_0x291bf4[_0x2d02('0x2e')],qs[_0x2d02('0x2f')](_0x221345['query']['fields']));_0x44a010[_0x2d02('0x2d')]=_0x44a010[_0x2d02('0x2d')][_0x2d02('0x30')]?_0x44a010[_0x2d02('0x2d')]:_0x291bf4[_0x2d02('0x2e')];if(_0x221345[_0x2d02('0x2a')][_0x2d02('0x3c')]){_0x44a010[_0x2d02('0x3d')]=[{'all':!![]}];}_0x44a010=_[_0x2d02('0x35')]({},_0x44a010,_0x221345[_0x2d02('0x39')]);return db['Tag'][_0x2d02('0x42')](_0x44a010)[_0x2d02('0x21')](handleEntityNotFound(_0x337330,null))[_0x2d02('0x21')](respondWithResult(_0x337330,null))[_0x2d02('0x40')](handleError(_0x337330,null));};exports[_0x2d02('0x43')]=function(_0x2ee879,_0x291a3f){return db['Tag'][_0x2d02('0x43')](_0x2ee879[_0x2d02('0x44')],{})[_0x2d02('0x21')](function(_0x20b23a){var _0x43fb58=_0x2ee879[_0x2d02('0x45')][_0x2d02('0x46')]({'plain':!![]});if(!_0x43fb58)throw new Error(_0x2d02('0x47'));if(_0x43fb58[_0x2d02('0x48')]===_0x2d02('0x45')){var _0x29c8dd=_0x20b23a[_0x2d02('0x46')]({'plain':!![]});var _0x3be0d0='Tags';return db[_0x2d02('0x49')][_0x2d02('0x42')]({'where':{'name':_0x3be0d0,'userProfileId':_0x43fb58[_0x2d02('0x4a')]},'raw':!![]})[_0x2d02('0x21')](function(_0x2e4e70){if(_0x2e4e70&&_0x2e4e70[_0x2d02('0x4b')]===0x0){return db[_0x2d02('0x1f')][_0x2d02('0x43')]({'name':_0x29c8dd[_0x2d02('0x24')],'resourceId':_0x29c8dd['id'],'type':_0x2e4e70[_0x2d02('0x24')],'sectionId':_0x2e4e70['id']},{})[_0x2d02('0x21')](function(){return _0x20b23a;});}else{return _0x20b23a;}})[_0x2d02('0x40')](function(_0x233ec0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233ec0);throw _0x233ec0;});}return _0x20b23a;})['then'](respondWithResult(_0x291a3f,0xc9))[_0x2d02('0x40')](handleError(_0x291a3f,null));};exports[_0x2d02('0x4c')]=function(_0x358739,_0x3c8405){if(_0x358739[_0x2d02('0x44')]['id']){delete _0x358739[_0x2d02('0x44')]['id'];}return db['Tag'][_0x2d02('0x42')]({'where':{'id':_0x358739[_0x2d02('0x4d')]['id']}})[_0x2d02('0x21')](handleEntityNotFound(_0x3c8405,null))[_0x2d02('0x21')](saveUpdates(_0x358739[_0x2d02('0x44')],null))[_0x2d02('0x21')](respondWithResult(_0x3c8405,null))[_0x2d02('0x40')](handleError(_0x3c8405,null));};exports[_0x2d02('0x20')]=function(_0x28da58,_0xeeb7f7){return db['Tag'][_0x2d02('0x42')]({'where':{'id':_0x28da58[_0x2d02('0x4d')]['id']}})[_0x2d02('0x21')](handleEntityNotFound(_0xeeb7f7,null))[_0x2d02('0x21')](removeEntity(_0xeeb7f7,null))[_0x2d02('0x40')](handleError(_0xeeb7f7,null));};exports[_0x2d02('0x4e')]=function(_0x3310e9,_0x591982){return db[_0x2d02('0x3a')][_0x2d02('0x4e')]()[_0x2d02('0x21')](respondWithResult(_0x591982,null))[_0x2d02('0x40')](handleError(_0x591982,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index f5d85ae..2ec5f09 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 _0xc775=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path','./tag.attributes','define'];(function(_0x4b8980,_0x2559d8){var _0x2e93b4=function(_0x1e11e1){while(--_0x1e11e1){_0x4b8980['push'](_0x4b8980['shift']());}};_0x2e93b4(++_0x2559d8);}(_0xc775,0x183));var _0x5c77=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc775[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x5c77('0x0'));var util=require(_0x5c77('0x1'));var logger=require(_0x5c77('0x2'))(_0x5c77('0x3'));var moment=require(_0x5c77('0x4'));var BPromise=require(_0x5c77('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c77('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5c77('0x7'));module['exports']=function(_0x13971d,_0x224603){return _0x13971d[_0x5c77('0x8')](_0x5c77('0x9'),attributes,{'tableName':_0x5c77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ccd=['../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','api','moment','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ccd,0x1e6));var _0xd2cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2ccd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd2cc('0x0'));var util=require(_0xd2cc('0x1'));var logger=require('../../config/logger')(_0xd2cc('0x2'));var moment=require(_0xd2cc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2cc('0x4'));var rimraf=require(_0xd2cc('0x5'));var config=require(_0xd2cc('0x6'));var attributes=require(_0xd2cc('0x7'));module[_0xd2cc('0x8')]=function(_0x242674,_0x8f4e39){return _0x242674[_0xd2cc('0x9')](_0xd2cc('0xa'),attributes,{'tableName':_0xd2cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7f1472b..b85b8ce 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 _0x1306=['client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x245ce7,_0x579c0a){var _0x5f3c6e=function(_0x7a21ac){while(--_0x7a21ac){_0x245ce7['push'](_0x245ce7['shift']());}};_0x5f3c6e(++_0x579c0a);}(_0x1306,0x17a));var _0x6130=function(_0x4705f9,_0x952e56){_0x4705f9=_0x4705f9-0x0;var _0x4ab59b=_0x1306[_0x4705f9];return _0x4ab59b;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('Tag,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});} \ No newline at end of file +var _0xbd50=['Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd50,0x196));var _0x0bd5=function(_0x1729c5,_0x3e8797){_0x1729c5=_0x1729c5-0x0;var _0x5b3d6c=_0xbd50[_0x1729c5];return _0x5b3d6c;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index df809f7..1a2f0ee 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_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['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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 1ce4a9a..987f42b 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(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe706,0xa3));var _0x6e70=function(_0x3b6f58,_0x5870de){_0x3b6f58=_0x3b6f58-0x0;var _0x987c61=_0xe706[_0x3b6f58];return _0x987c61;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index a154646..3a42f55 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 _0x47ae=['options','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','get','role','Teams','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','Queues','addQueues','Unknown\x20channel','add','ids','removeQueues','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','upsert','format','SIP/%s','all','removeAgents','Queue:remove','QueueId','UserVoiceQueueRt','UserVoicePrefix','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','status','end','json','offset','undefined','limit','apply','reject','save','update','then','sendStatus','error','stack','name','send','Team','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge'];(function(_0x2b8870,_0x4c8785){var _0x90fd6f=function(_0x524212){while(--_0x524212){_0x2b8870['push'](_0x2b8870['shift']());}};_0x90fd6f(++_0x4c8785);}(_0x47ae,0x192));var _0xe47a=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x47ae[_0x231dda];return _0x3f88cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe47a('0x0'));var zipdir=require(_0xe47a('0x1'));var jsonpatch=require(_0xe47a('0x2'));var rp=require(_0xe47a('0x3'));var moment=require(_0xe47a('0x4'));var BPromise=require(_0xe47a('0x5'));var Mustache=require(_0xe47a('0x6'));var util=require('util');var path=require(_0xe47a('0x7'));var sox=require(_0xe47a('0x8'));var csv=require(_0xe47a('0x9'));var ejs=require(_0xe47a('0xa'));var fs=require('fs');var fs_extra=require(_0xe47a('0xb'));var _=require(_0xe47a('0xc'));var squel=require(_0xe47a('0xd'));var crypto=require(_0xe47a('0xe'));var jsforce=require(_0xe47a('0xf'));var deskjs=require(_0xe47a('0x10'));var toCsv=require(_0xe47a('0x9'));var querystring=require(_0xe47a('0x11'));var Papa=require(_0xe47a('0x12'));var Redis=require(_0xe47a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe47a('0x14'))(_0xe47a('0x15'));var utils=require(_0xe47a('0x16'));var config=require(_0xe47a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe47a('0x18'))['db'];config[_0xe47a('0x19')]=_[_0xe47a('0x1a')](config[_0xe47a('0x19')],{'host':_0xe47a('0x1b'),'port':0x18eb});var socket=require(_0xe47a('0x1c'))(new Redis(config[_0xe47a('0x19')]));require(_0xe47a('0x1d'))['register'](socket);function respondWithStatusCode(_0x2e739a,_0x556ba5){_0x556ba5=_0x556ba5||0xcc;return function(_0x654592){if(_0x654592){return _0x2e739a['sendStatus'](_0x556ba5);}return _0x2e739a[_0xe47a('0x1e')](_0x556ba5)[_0xe47a('0x1f')]();};}function respondWithResult(_0x54c26f,_0x3e44ed){_0x3e44ed=_0x3e44ed||0xc8;return function(_0x26fe26){if(_0x26fe26){return _0x54c26f[_0xe47a('0x1e')](_0x3e44ed)[_0xe47a('0x20')](_0x26fe26);}};}function respondWithFilteredResult(_0x417470,_0x276704){return function(_0x2457d2){if(_0x2457d2){var _0x1812e0=typeof _0x276704[_0xe47a('0x21')]===_0xe47a('0x22')&&typeof _0x276704[_0xe47a('0x23')]===_0xe47a('0x22');var _0x269a19=_0x2457d2['count'];var _0x4589f6=_0x1812e0?0x0:_0x276704['offset'];var _0x51f865=_0x1812e0?_0x2457d2['count']:_0x276704[_0xe47a('0x21')]+_0x276704['limit'];var _0x527091;if(_0x51f865>=_0x269a19){_0x51f865=_0x269a19;_0x527091=0xc8;}else{_0x527091=0xce;}_0x417470['status'](_0x527091);return _0x417470['set']('Content-Range',_0x4589f6+'-'+_0x51f865+'/'+_0x269a19)[_0xe47a('0x20')](_0x2457d2);}return null;};}function patchUpdates(_0x2a45f0){return function(_0x168a8b){try{jsonpatch[_0xe47a('0x24')](_0x168a8b,_0x2a45f0,!![]);}catch(_0x4ee8fc){return BPromise[_0xe47a('0x25')](_0x4ee8fc);}return _0x168a8b[_0xe47a('0x26')]();};}function saveUpdates(_0x4a7685,_0x1dfbf6){return function(_0x44c117){if(_0x44c117){return _0x44c117[_0xe47a('0x27')](_0x4a7685)[_0xe47a('0x28')](function(_0xdcb2d8){return _0xdcb2d8;});}return null;};}function handleEntityNotFound(_0x273a3e,_0x245fa0){return function(_0x248885){if(!_0x248885){_0x273a3e[_0xe47a('0x29')](0x194);}return _0x248885;};}function handleError(_0x33f239,_0x303a06){_0x303a06=_0x303a06||0x1f4;return function(_0x57042d){logger[_0xe47a('0x2a')](_0x57042d[_0xe47a('0x2b')]);if(_0x57042d[_0xe47a('0x2c')]){delete _0x57042d[_0xe47a('0x2c')];}_0x33f239['status'](_0x303a06)[_0xe47a('0x2d')](_0x57042d);};}exports['index']=function(_0x4d2acc,_0x5f0c4b){var _0x16d821={},_0x4229ca={},_0x2ef953={'count':0x0,'rows':[]};var _0x57f797=_['map'](db[_0xe47a('0x2e')][_0xe47a('0x2f')],function(_0x40c712){return{'name':_0x40c712[_0xe47a('0x30')],'type':_0x40c712[_0xe47a('0x31')][_0xe47a('0x32')]};});_0x4229ca[_0xe47a('0x33')]=_[_0xe47a('0x34')](_0x57f797,_0xe47a('0x2c'));_0x4229ca[_0xe47a('0x35')]=_[_0xe47a('0x36')](_0x4d2acc[_0xe47a('0x35')]);_0x4229ca['filters']=_[_0xe47a('0x37')](_0x4229ca[_0xe47a('0x33')],_0x4229ca['query']);_0x16d821[_0xe47a('0x38')]=_['intersection'](_0x4229ca[_0xe47a('0x33')],qs[_0xe47a('0x39')](_0x4d2acc[_0xe47a('0x35')][_0xe47a('0x39')]));_0x16d821[_0xe47a('0x38')]=_0x16d821[_0xe47a('0x38')][_0xe47a('0x3a')]?_0x16d821[_0xe47a('0x38')]:_0x4229ca['model'];if(!_0x4d2acc['query'][_0xe47a('0x3b')](_0xe47a('0x3c'))){_0x16d821['limit']=qs[_0xe47a('0x23')](_0x4d2acc[_0xe47a('0x35')][_0xe47a('0x23')]);_0x16d821[_0xe47a('0x21')]=qs[_0xe47a('0x21')](_0x4d2acc['query'][_0xe47a('0x21')]);}_0x16d821[_0xe47a('0x3d')]=qs['sort'](_0x4d2acc[_0xe47a('0x35')][_0xe47a('0x3e')]);_0x16d821[_0xe47a('0x3f')]=qs[_0xe47a('0x40')](_[_0xe47a('0x41')](_0x4d2acc[_0xe47a('0x35')],_0x4229ca[_0xe47a('0x40')]),_0x57f797);if(_0x4d2acc[_0xe47a('0x35')][_0xe47a('0x42')]){_0x16d821[_0xe47a('0x3f')]=_['merge'](_0x16d821[_0xe47a('0x3f')],{'$or':_[_0xe47a('0x34')](_0x57f797,function(_0xa71228){if(_0xa71228[_0xe47a('0x31')]!==_0xe47a('0x43')){var _0x2c0d65={};_0x2c0d65[_0xa71228[_0xe47a('0x2c')]]={'$like':'%'+_0x4d2acc['query'][_0xe47a('0x42')]+'%'};return _0x2c0d65;}})});}_0x16d821=_[_0xe47a('0x44')]({},_0x16d821,_0x4d2acc[_0xe47a('0x45')]);var _0x313b78={'where':_0x16d821['where']};return db[_0xe47a('0x2e')]['count'](_0x313b78)[_0xe47a('0x28')](function(_0x5dd26f){_0x2ef953['count']=_0x5dd26f;if(_0x4d2acc[_0xe47a('0x35')]['includeAll']){_0x16d821['include']=[{'all':!![]}];}return db[_0xe47a('0x2e')][_0xe47a('0x46')](_0x16d821);})['then'](function(_0x197147){_0x2ef953[_0xe47a('0x47')]=_0x197147;return _0x2ef953;})[_0xe47a('0x28')](respondWithFilteredResult(_0x5f0c4b,_0x16d821))[_0xe47a('0x48')](handleError(_0x5f0c4b,null));};exports[_0xe47a('0x49')]=function(_0x555460,_0x3e325b){var _0x6ffee7={'raw':![],'where':{'id':_0x555460[_0xe47a('0x4a')]['id']}},_0x2b2451={};_0x2b2451[_0xe47a('0x33')]=_[_0xe47a('0x36')](db['Team'][_0xe47a('0x2f')]);_0x2b2451['query']=_[_0xe47a('0x36')](_0x555460[_0xe47a('0x35')]);_0x2b2451[_0xe47a('0x40')]=_[_0xe47a('0x37')](_0x2b2451[_0xe47a('0x33')],_0x2b2451[_0xe47a('0x35')]);_0x6ffee7['attributes']=_[_0xe47a('0x37')](_0x2b2451[_0xe47a('0x33')],qs['fields'](_0x555460[_0xe47a('0x35')]['fields']));_0x6ffee7[_0xe47a('0x38')]=_0x6ffee7[_0xe47a('0x38')]['length']?_0x6ffee7[_0xe47a('0x38')]:_0x2b2451[_0xe47a('0x33')];if(_0x555460[_0xe47a('0x35')][_0xe47a('0x4b')]){_0x6ffee7[_0xe47a('0x4c')]=[{'all':!![]}];}_0x6ffee7=_[_0xe47a('0x44')]({},_0x6ffee7,_0x555460[_0xe47a('0x45')]);return db['Team'][_0xe47a('0x4d')](_0x6ffee7)[_0xe47a('0x28')](handleEntityNotFound(_0x3e325b,null))[_0xe47a('0x28')](respondWithResult(_0x3e325b,null))[_0xe47a('0x48')](handleError(_0x3e325b,null));};exports['create']=function(_0x55891a,_0x35a05c){return db[_0xe47a('0x2e')][_0xe47a('0x4e')](_0x55891a[_0xe47a('0x4f')],{})[_0xe47a('0x28')](function(_0x48d3e4){var _0x100f17=_0x55891a[_0xe47a('0x50')][_0xe47a('0x51')]({'plain':!![]});if(!_0x100f17)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x100f17[_0xe47a('0x52')]===_0xe47a('0x50')){var _0x2e6c7f=_0x48d3e4[_0xe47a('0x51')]({'plain':!![]});var _0x78fffa=_0xe47a('0x53');return db['UserProfileSection'][_0xe47a('0x4d')]({'where':{'name':_0x78fffa,'userProfileId':_0x100f17[_0xe47a('0x54')]},'raw':!![]})[_0xe47a('0x28')](function(_0x194623){if(_0x194623&&_0x194623['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2e6c7f[_0xe47a('0x2c')],'resourceId':_0x2e6c7f['id'],'type':_0x194623[_0xe47a('0x2c')],'sectionId':_0x194623['id']},{})[_0xe47a('0x28')](function(){return _0x48d3e4;});}else{return _0x48d3e4;}})[_0xe47a('0x48')](function(_0x2bc7f5){logger['error'](_0xe47a('0x55'),_0x2bc7f5);throw _0x2bc7f5;});}return _0x48d3e4;})['then'](respondWithResult(_0x35a05c,0xc9))[_0xe47a('0x48')](handleError(_0x35a05c,null));};exports['update']=function(_0x5e67b2,_0x377b69){if(_0x5e67b2[_0xe47a('0x4f')]['id']){delete _0x5e67b2['body']['id'];}return db[_0xe47a('0x2e')][_0xe47a('0x4d')]({'where':{'id':_0x5e67b2[_0xe47a('0x4a')]['id']}})[_0xe47a('0x28')](handleEntityNotFound(_0x377b69,null))[_0xe47a('0x28')](saveUpdates(_0x5e67b2[_0xe47a('0x4f')],null))['then'](respondWithResult(_0x377b69,null))[_0xe47a('0x48')](handleError(_0x377b69,null));};exports[_0xe47a('0x56')]=function(_0x423470,_0x56199c){var _0x449047=_0x423470[_0xe47a('0x4a')]['id'];var _0x56456b=[];return db[_0xe47a('0x57')][_0xe47a('0x58')](function(_0x14cf83){var _0x214b6a=_0xe47a('0x59')+_0x449047;return db[_0xe47a('0x57')][_0xe47a('0x35')](_0x214b6a,{'type':db[_0xe47a('0x5a')][_0xe47a('0x5b')][_0xe47a('0x5c')],'raw':!![],'transaction':_0x14cf83})[_0xe47a('0x28')](function(_0x2d56e6){_0x56456b=_[_0xe47a('0x34')](_0x2d56e6,function(_0x402a90){return Number(_0x402a90[_0xe47a('0x5d')]);});})[_0xe47a('0x28')](function(){var _0xba556c=_0xe47a('0x5e')+_0x449047;return db[_0xe47a('0x57')]['query'](_0xba556c,{'type':db[_0xe47a('0x5a')][_0xe47a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x14300f){var _0x4dd136=_[_0xe47a('0x34')](_0x14300f,function(_0x4a13ab){return Number(_0x4a13ab['VoiceQueueId']);});return db[_0xe47a('0x5f')][_0xe47a('0x56')]({'where':{'UserId':{'$in':_0x56456b},'VoiceQueueId':{'$in':_0x4dd136}},'transaction':_0x14cf83});})[_0xe47a('0x28')](function(){var _0x2b2aae=_0xe47a('0x60')+_0x449047;return db[_0xe47a('0x57')][_0xe47a('0x35')](_0x2b2aae,{'type':db['Sequelize'][_0xe47a('0x5b')][_0xe47a('0x5c')],'raw':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x306aa9){var _0x24be29=_[_0xe47a('0x34')](_0x306aa9,function(_0x587c04){return Number(_0x587c04[_0xe47a('0x61')]);});return db[_0xe47a('0x62')][_0xe47a('0x56')]({'where':{'UserId':{'$in':_0x56456b},'MailQueueId':{'$in':_0x24be29}},'transaction':_0x14cf83});})['then'](function(){var _0x44d60d=_0xe47a('0x63')+_0x449047;return db[_0xe47a('0x57')][_0xe47a('0x35')](_0x44d60d,{'type':db['Sequelize'][_0xe47a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x2fc8fc){var _0x2d535d=_['map'](_0x2fc8fc,function(_0x37483f){return Number(_0x37483f[_0xe47a('0x64')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x56456b},'SmsQueueId':{'$in':_0x2d535d}},'transaction':_0x14cf83});})[_0xe47a('0x28')](function(){var _0x32b2eb=_0xe47a('0x65')+_0x449047;return db[_0xe47a('0x57')][_0xe47a('0x35')](_0x32b2eb,{'type':db[_0xe47a('0x5a')][_0xe47a('0x5b')][_0xe47a('0x5c')],'raw':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x6fd0f4){var _0x39d0a2=_[_0xe47a('0x34')](_0x6fd0f4,function(_0x2993b8){return Number(_0x2993b8[_0xe47a('0x66')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x56456b},'ChatQueueId':{'$in':_0x39d0a2}},'transaction':_0x14cf83});})[_0xe47a('0x28')](function(){var _0x3c7be9=_0xe47a('0x67')+_0x449047;return db[_0xe47a('0x57')][_0xe47a('0x35')](_0x3c7be9,{'type':db[_0xe47a('0x5a')]['QueryTypes'][_0xe47a('0x5c')],'raw':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x2e2354){var _0x28d925=_[_0xe47a('0x34')](_0x2e2354,function(_0x1c13f3){return Number(_0x1c13f3[_0xe47a('0x68')]);});return db[_0xe47a('0x69')][_0xe47a('0x56')]({'where':{'UserId':{'$in':_0x56456b},'FaxQueueId':{'$in':_0x28d925}},'transaction':_0x14cf83});})[_0xe47a('0x28')](function(){var _0x3eec97=_0xe47a('0x6a')+_0x449047;return db[_0xe47a('0x57')][_0xe47a('0x35')](_0x3eec97,{'type':db['Sequelize'][_0xe47a('0x5b')][_0xe47a('0x5c')],'raw':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x5a2296){var _0x522bd0=_[_0xe47a('0x34')](_0x5a2296,function(_0xabb2bc){return Number(_0xabb2bc[_0xe47a('0x6b')]);});return db[_0xe47a('0x6c')][_0xe47a('0x56')]({'where':{'UserId':{'$in':_0x56456b},'OpenchannelQueueId':{'$in':_0x522bd0}},'transaction':_0x14cf83});})[_0xe47a('0x28')](function(){var _0xd5c587='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x449047;return db['sequelize']['query'](_0xd5c587,{'type':db['Sequelize']['QueryTypes'][_0xe47a('0x5c')],'raw':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x3a4707){var _0x4bb6df=_[_0xe47a('0x34')](_0x3a4707,function(_0x25e827){return Number(_0x25e827[_0xe47a('0x6d')]);});return db[_0xe47a('0x6e')][_0xe47a('0x56')]({'where':{'UserId':{'$in':_0x56456b},'WhatsappQueueId':{'$in':_0x4bb6df}},'transaction':_0x14cf83});})[_0xe47a('0x28')](function(){return db[_0xe47a('0x6f')][_0xe47a('0x4d')]({'where':{'TeamId':_0x449047}});})[_0xe47a('0x28')](function(_0x44910f){if(_0x44910f===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x56456b},'VoicePrefixId':_0x44910f[_0xe47a('0x70')]},'transaction':_0x14cf83});})[_0xe47a('0x28')](function(){return db['Team']['destroy']({'where':{'id':_0x449047},'cascade':!![],'transaction':_0x14cf83});})[_0xe47a('0x28')](function(_0x3f3ecd){if(_0x3f3ecd===0x0){_0x56199c['sendStatus'](0x194);}else{return db[_0xe47a('0x71')][_0xe47a('0x56')]({'where':{'type':'Teams','resourceId':_0x449047},'cascade':!![],'transaction':_0x14cf83})['then'](function(){_0x56199c['status'](0xcc)[_0xe47a('0x1f')]();});}})[_0xe47a('0x48')](function(_0x915c97){_0x56199c[_0xe47a('0x1e')](0x1f4)['send'](_0x915c97);});});};exports[_0xe47a('0x72')]=function(_0x5ab4b9,_0x232025,_0x4e98d5){return db[_0xe47a('0x2e')][_0xe47a('0x73')]({'where':{'id':_0x5ab4b9['params']['id']}})[_0xe47a('0x28')](handleEntityNotFound(_0x232025,null))[_0xe47a('0x28')](function(_0x2834dc){if(!_0x5ab4b9['query'][_0xe47a('0x74')]||!utils[_0xe47a('0x75')](_0x5ab4b9[_0xe47a('0x35')][_0xe47a('0x74')])){throw new db['Sequelize'][(_0xe47a('0x76'))]('Unknown\x20channel');}var _0x24925b={};var _0x5790f8={};_0x5790f8[_0xe47a('0x33')]=_['keys'](db[_[_0xe47a('0x77')](_0x5ab4b9[_0xe47a('0x35')][_0xe47a('0x74')][_0xe47a('0x78')]())+_0xe47a('0x79')]['rawAttributes']);_0x5790f8[_0xe47a('0x35')]=_[_0xe47a('0x36')](_0x5ab4b9[_0xe47a('0x35')]);_0x5790f8[_0xe47a('0x40')]=_[_0xe47a('0x37')](_0x5790f8[_0xe47a('0x33')],_0x5790f8['query']);_0x24925b[_0xe47a('0x38')]=_['intersection'](_0x5790f8[_0xe47a('0x33')],qs['fields'](_0x5ab4b9[_0xe47a('0x35')][_0xe47a('0x39')]));_0x24925b[_0xe47a('0x38')]=_0x24925b[_0xe47a('0x38')][_0xe47a('0x3a')]?_0x24925b[_0xe47a('0x38')]:_0x5790f8[_0xe47a('0x33')];_0x24925b[_0xe47a('0x23')]=qs[_0xe47a('0x23')](_0x5ab4b9['query'][_0xe47a('0x23')]);_0x24925b[_0xe47a('0x21')]=qs[_0xe47a('0x21')](_0x5ab4b9[_0xe47a('0x35')][_0xe47a('0x21')]);_0x24925b[_0xe47a('0x3d')]=qs[_0xe47a('0x3e')](_0x5ab4b9['query'][_0xe47a('0x3e')]);_0x24925b[_0xe47a('0x3f')]=qs[_0xe47a('0x40')](_[_0xe47a('0x41')](_0x5ab4b9['query'],_0x5790f8['filters']));_0x24925b=_[_0xe47a('0x44')]({},_0x24925b,_0x5ab4b9[_0xe47a('0x45')]);return _0x2834dc['get'+_[_0xe47a('0x77')](_0x5ab4b9['query']['channel'][_0xe47a('0x78')]())+_0xe47a('0x7a')](_0x24925b);})[_0xe47a('0x28')](respondWithResult(_0x232025,null))['catch'](handleError(_0x232025,null));};exports[_0xe47a('0x7b')]=function(_0x2e32c1,_0x2f5838,_0x458783){return db[_0xe47a('0x2e')][_0xe47a('0x73')]({'where':{'id':_0x2e32c1[_0xe47a('0x4a')]['id']}})['then'](function(_0x52c61d){if(_0x52c61d){if(!_0x2e32c1[_0xe47a('0x4f')][_0xe47a('0x74')]||!utils['isValidChannel'](_0x2e32c1['body'][_0xe47a('0x74')])){throw new db[(_0xe47a('0x5a'))][(_0xe47a('0x76'))](_0xe47a('0x7c'));}return _0x52c61d[_0xe47a('0x7d')+_[_0xe47a('0x77')](_0x2e32c1[_0xe47a('0x4f')][_0xe47a('0x74')]['toLowerCase']())+_0xe47a('0x7a')](_0x2e32c1[_0xe47a('0x4f')][_0xe47a('0x7e')]);}return null;})[_0xe47a('0x28')](handleEntityNotFound(_0x2f5838,null))[_0xe47a('0x28')](respondWithStatusCode(_0x2f5838,null))[_0xe47a('0x48')](handleError(_0x2f5838,null));};exports[_0xe47a('0x7f')]=function(_0x36d976,_0x2a52a9,_0x3f3d12){return db['Team'][_0xe47a('0x73')]({'where':{'id':_0x36d976['params']['id']}})[_0xe47a('0x28')](function(_0x3e2bb1){if(_0x3e2bb1){if(!_0x36d976[_0xe47a('0x35')][_0xe47a('0x74')]||!utils[_0xe47a('0x75')](_0x36d976[_0xe47a('0x35')][_0xe47a('0x74')])){throw new db[(_0xe47a('0x5a'))]['ValidationError'](_0xe47a('0x7c'));}return _0x3e2bb1['remove'+_['capitalize'](_0x36d976[_0xe47a('0x35')][_0xe47a('0x74')][_0xe47a('0x78')]())+_0xe47a('0x7a')](_0x36d976[_0xe47a('0x35')]['ids']);}return null;})[_0xe47a('0x28')](handleEntityNotFound(_0x2a52a9,null))[_0xe47a('0x28')](respondWithStatusCode(_0x2a52a9,null))[_0xe47a('0x48')](handleError(_0x2a52a9,null));};exports[_0xe47a('0x80')]=function(_0x46fc6d,_0x5d9082){var _0x171b46=_[_0xe47a('0x81')](_0x46fc6d[_0xe47a('0x4f')][_0xe47a('0x7e')])?_0x46fc6d[_0xe47a('0x4f')][_0xe47a('0x7e')]:[_0x46fc6d[_0xe47a('0x4f')][_0xe47a('0x7e')]];var _0x281b58=_0x46fc6d[_0xe47a('0x4a')]['id'];return db[_0xe47a('0x2e')][_0xe47a('0x4d')]({'where':{'id':_0x281b58}})[_0xe47a('0x28')](handleEntityNotFound(_0x5d9082,null))[_0xe47a('0x28')](function(_0x4dc26a){if(_0x4dc26a){var _0x9bbebd=[_0xe47a('0x82'),_0xe47a('0x83'),_0xe47a('0x84'),_0xe47a('0x85'),_0xe47a('0x86'),_0xe47a('0x87'),_0xe47a('0x88')];return db['sequelize'][_0xe47a('0x58')](function(_0x4cc8ea){var _0x3df4a5=_[_0xe47a('0x34')](_0x9bbebd,function(_0x119964){var _0x174269={'attributes':['id',_0xe47a('0x2c')]};if(_0x119964===_0xe47a('0x82')){_0x174269[_0xe47a('0x89')]={'attributes':[_0xe47a('0x8a')]};}return _0x4dc26a['get'+_0x119964+_0xe47a('0x7a')](_0x174269)['then'](function(_0x341815){var _0x4f4566=_[_0xe47a('0x34')](_0x341815,function(_0x1246da){var _0x292eeb=_[_0xe47a('0x34')](_0x171b46,function(_0x3311e8){var _0x344522={'where':{'UserId':_0x3311e8,[_0x119964+'QueueId']:_0x1246da['id']},'transaction':_0x4cc8ea};if(_0x119964===_0xe47a('0x82')){_0x344522[_0xe47a('0x1a')]={'penalty':_0x1246da[_0xe47a('0x8b')][_0xe47a('0x8a')]};}return db[_0xe47a('0x8c')+_0x119964+_0xe47a('0x79')][_0xe47a('0x8d')](_0x344522)['then'](function(){socket[_0xe47a('0x8e')](_0xe47a('0x50')+_0x119964+_0xe47a('0x8f'),{'UserId':_0x3311e8,[_0x119964+'QueueId']:_0x1246da['id']});if(_0x119964!==_0xe47a('0x82')){return;}return db[_0xe47a('0x8c')][_0xe47a('0x46')]({'where':{'id':_0x171b46,'online':0x1},'attributes':['id',_0xe47a('0x2c'),_0xe47a('0x90'),_0xe47a('0x91'),_0xe47a('0x92')],'raw':!![]})[_0xe47a('0x28')](function(_0xb08628){var _0x1d27ea=_[_0xe47a('0x34')](_0xb08628,function(_0x3ac112){return db['UserVoiceQueueRt'][_0xe47a('0x93')]({'membername':_0x3ac112['name'],'UserId':_0x3ac112['id'],'queue_name':_0x1246da['name'],'VoiceQueueId':_0x1246da['id'],'interface':_['isNil'](_0x3ac112[_0xe47a('0x92')])?util[_0xe47a('0x94')](_0xe47a('0x95'),_0x3ac112[_0xe47a('0x2c')]):_0x3ac112[_0xe47a('0x92')],'paused':_0x3ac112['voicePause']||![],'penalty':_0x1246da[_0xe47a('0x8b')]['penalty']},{'transaction':_0x4cc8ea});});return Promise[_0xe47a('0x96')](_0x1d27ea);});});});return Promise[_0xe47a('0x96')](_0x292eeb);});return Promise['all'](_0x4f4566);})['then'](function(){return db['TeamVoicePrefix'][_0xe47a('0x73')]({'where':{'teamId':_0x281b58}})[_0xe47a('0x28')](function(_0x17c9f7){if(_0x17c9f7){var _0x16c0f8=_[_0xe47a('0x34')](_0x171b46,function(_0x4f115d){db['UserVoicePrefix']['upsert']({'UserId':_0x4f115d,'VoicePrefixId':_0x17c9f7['VoicePrefixId']});});return Promise['all'](_0x16c0f8);}});});});return Promise[_0xe47a('0x96')](_0x3df4a5)[_0xe47a('0x28')](function(){return _0x4dc26a[_0xe47a('0x80')](_0x171b46,{'transaction':_0x4cc8ea})['spread'](function(_0x213391){return _0x213391;});});});}})[_0xe47a('0x28')](respondWithResult(_0x5d9082,null))[_0xe47a('0x48')](handleError(_0x5d9082,null));};exports[_0xe47a('0x97')]=function(_0x3da7a4,_0x3f0663){var _0x25885c=_[_0xe47a('0x81')](_0x3da7a4[_0xe47a('0x35')][_0xe47a('0x7e')])?_0x3da7a4['query'][_0xe47a('0x7e')]:[_0x3da7a4[_0xe47a('0x35')][_0xe47a('0x7e')]];var _0x108354=_0x3da7a4[_0xe47a('0x4a')]['id'];return db['Team'][_0xe47a('0x4d')]({'where':{'id':_0x108354}})[_0xe47a('0x28')](handleEntityNotFound(_0x3f0663,null))['then'](function(_0x19715c){if(_0x19715c){var _0x2d14ed=[_0xe47a('0x82'),_0xe47a('0x83'),_0xe47a('0x84'),_0xe47a('0x85'),'Fax','Openchannel',_0xe47a('0x88')];return db['sequelize'][_0xe47a('0x58')](function(_0xd69381){var _0x192bcf=_[_0xe47a('0x34')](_0x2d14ed,function(_0xac8859){var _0x2e9af8={'attributes':['id',_0xe47a('0x2c')]};return _0x19715c[_0xe47a('0x51')+_0xac8859+'Queues'](_0x2e9af8)[_0xe47a('0x28')](function(_0x1cc2b3){var _0x3640f6=_['map'](_0x1cc2b3,function(_0x45e539){return _0x45e539[_0xe47a('0x97')](_0x25885c,{'transaction':_0xd69381})[_0xe47a('0x28')](function(){var _0x5ebd11=_['map'](_0x25885c,function(_0x17317f){socket[_0xe47a('0x8e')](_0xe47a('0x50')+_0xac8859+_0xe47a('0x98'),{'UserId':Number(_0x17317f),[_0xac8859+_0xe47a('0x99')]:_0x45e539['id']});if(_0xac8859!==_0xe47a('0x82')){return;}return db[_0xe47a('0x9a')]['destroy']({'where':{'VoiceQueueId':_0x45e539['id'],'UserId':_0x17317f},'transaction':_0xd69381});});return Promise[_0xe47a('0x96')](_0x5ebd11);});});return Promise[_0xe47a('0x96')](_0x3640f6);});});return Promise[_0xe47a('0x96')](_0x192bcf)[_0xe47a('0x28')](function(){return _0x19715c[_0xe47a('0x97')](_0x25885c,{'transaction':_0xd69381});})[_0xe47a('0x28')](function(){return db[_0xe47a('0x6f')][_0xe47a('0x73')]({'where':{'teamId':_0x108354}})['then'](function(_0x2c2c08){if(_0x2c2c08){var _0x15b034=_[_0xe47a('0x34')](_0x25885c,function(_0x5d7dce){db[_0xe47a('0x9b')][_0xe47a('0x56')]({'where':{'UserId':_0x5d7dce,'VoicePrefixId':_0x2c2c08[_0xe47a('0x70')]}});});return Promise[_0xe47a('0x96')](_0x15b034);}});});});}})[_0xe47a('0x28')](respondWithStatusCode(_0x3f0663,null))['catch'](handleError(_0x3f0663,null));};exports[_0xe47a('0x9c')]=function(_0x24321f,_0xa7d733,_0x5c0654){var _0x97f608={};var _0x5d51e8={};var _0x39e2f4;var _0x37070b;return db[_0xe47a('0x2e')][_0xe47a('0x73')]({'where':{'id':_0x24321f['params']['id']}})['then'](handleEntityNotFound(_0xa7d733,null))['then'](function(_0x2633a7){if(_0x2633a7){_0x39e2f4=_0x2633a7;_0x5d51e8[_0xe47a('0x33')]=_['keys'](db['User'][_0xe47a('0x2f')]);_0x5d51e8[_0xe47a('0x35')]=_['keys'](_0x24321f[_0xe47a('0x35')]);_0x5d51e8[_0xe47a('0x40')]=_[_0xe47a('0x37')](_0x5d51e8[_0xe47a('0x33')],_0x5d51e8[_0xe47a('0x35')]);_0x97f608[_0xe47a('0x38')]=_['intersection'](_0x5d51e8[_0xe47a('0x33')],qs[_0xe47a('0x39')](_0x24321f['query']['fields']));_0x97f608['attributes']=_0x97f608[_0xe47a('0x38')][_0xe47a('0x3a')]?_0x97f608[_0xe47a('0x38')]:_0x5d51e8[_0xe47a('0x33')];_0x97f608[_0xe47a('0x3d')]=qs[_0xe47a('0x3e')](_0x24321f['query'][_0xe47a('0x3e')]);_0x97f608[_0xe47a('0x3f')]=qs[_0xe47a('0x40')](_[_0xe47a('0x41')](_0x24321f[_0xe47a('0x35')],_0x5d51e8[_0xe47a('0x40')]));if(_0x24321f[_0xe47a('0x35')][_0xe47a('0x42')]){_0x97f608['where']=_['merge'](_0x97f608[_0xe47a('0x3f')],{'$or':_[_0xe47a('0x34')](_0x97f608[_0xe47a('0x38')],function(_0xe8d3c2){var _0x410ef2={};_0x410ef2[_0xe8d3c2]={'$like':'%'+_0x24321f[_0xe47a('0x35')]['filter']+'%'};return _0x410ef2;})});}_0x97f608=_[_0xe47a('0x44')]({},_0x97f608,_0x24321f['options']);return _0x39e2f4['getAgents'](_0x97f608);}})[_0xe47a('0x28')](function(_0x3fdcbb){if(_0x3fdcbb){_0x37070b=_0x3fdcbb[_0xe47a('0x3a')];if(!_0x24321f[_0xe47a('0x35')][_0xe47a('0x3b')](_0xe47a('0x3c'))){_0x97f608['limit']=qs[_0xe47a('0x23')](_0x24321f[_0xe47a('0x35')]['limit']);_0x97f608['offset']=qs[_0xe47a('0x21')](_0x24321f[_0xe47a('0x35')][_0xe47a('0x21')]);}return _0x39e2f4[_0xe47a('0x9c')](_0x97f608);}})[_0xe47a('0x28')](function(_0x4d2031){if(_0x4d2031){return _0x4d2031?{'count':_0x37070b,'rows':_0x4d2031}:null;}})[_0xe47a('0x28')](respondWithResult(_0xa7d733,null))['catch'](handleError(_0xa7d733,null));}; \ No newline at end of file +var _0x1d79=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Team','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Teams','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','pick','Queues','addQueues','findOne','add','ids','removeQueues','remove','addAgents','isArray','Voice','Sms','Openchannel','Whatsapp','transaction','through','TeamVoiceQueue','penalty','User','findOrCreate','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','upsert','spread','removeAgents','Chat','Mail','Fax','Queue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x3fcf30,_0xe3a49e){var _0x2ed4b0=function(_0x306e68){while(--_0x306e68){_0x3fcf30['push'](_0x3fcf30['shift']());}};_0x2ed4b0(++_0xe3a49e);}(_0x1d79,0x128));var _0x91d7=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1d79[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0x91d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91d7('0x1'));var jsonpatch=require(_0x91d7('0x2'));var rp=require(_0x91d7('0x3'));var moment=require(_0x91d7('0x4'));var BPromise=require(_0x91d7('0x5'));var Mustache=require(_0x91d7('0x6'));var util=require(_0x91d7('0x7'));var path=require(_0x91d7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x91d7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91d7('0xa'));var squel=require('squel');var crypto=require(_0x91d7('0xb'));var jsforce=require(_0x91d7('0xc'));var deskjs=require(_0x91d7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x91d7('0xe'));var Redis=require(_0x91d7('0xf'));var authService=require(_0x91d7('0x10'));var qs=require(_0x91d7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91d7('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x91d7('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x91d7('0x14'))['db'];config[_0x91d7('0x15')]=_[_0x91d7('0x16')](config[_0x91d7('0x15')],{'host':_0x91d7('0x17'),'port':0x18eb});var socket=require(_0x91d7('0x18'))(new Redis(config[_0x91d7('0x15')]));require(_0x91d7('0x19'))[_0x91d7('0x1a')](socket);function respondWithStatusCode(_0x59966b,_0x569b19){_0x569b19=_0x569b19||0xcc;return function(_0x134517){if(_0x134517){return _0x59966b[_0x91d7('0x1b')](_0x569b19);}return _0x59966b['status'](_0x569b19)[_0x91d7('0x1c')]();};}function respondWithResult(_0x482caf,_0x524466){_0x524466=_0x524466||0xc8;return function(_0x2a73e6){if(_0x2a73e6){return _0x482caf[_0x91d7('0x1d')](_0x524466)[_0x91d7('0x1e')](_0x2a73e6);}};}function respondWithFilteredResult(_0x595693,_0x31c3d9){return function(_0x47f913){if(_0x47f913){var _0x4c4ad3=typeof _0x31c3d9[_0x91d7('0x1f')]===_0x91d7('0x20')&&typeof _0x31c3d9[_0x91d7('0x21')]==='undefined';var _0x1ddb42=_0x47f913[_0x91d7('0x22')];var _0x5c74e5=_0x4c4ad3?0x0:_0x31c3d9[_0x91d7('0x1f')];var _0xc69207=_0x4c4ad3?_0x47f913['count']:_0x31c3d9[_0x91d7('0x1f')]+_0x31c3d9[_0x91d7('0x21')];var _0x41d41f;if(_0xc69207>=_0x1ddb42){_0xc69207=_0x1ddb42;_0x41d41f=0xc8;}else{_0x41d41f=0xce;}_0x595693[_0x91d7('0x1d')](_0x41d41f);return _0x595693[_0x91d7('0x23')](_0x91d7('0x24'),_0x5c74e5+'-'+_0xc69207+'/'+_0x1ddb42)[_0x91d7('0x1e')](_0x47f913);}return null;};}function patchUpdates(_0x3a399b){return function(_0x43526a){try{jsonpatch[_0x91d7('0x25')](_0x43526a,_0x3a399b,!![]);}catch(_0x427cb0){return BPromise[_0x91d7('0x26')](_0x427cb0);}return _0x43526a[_0x91d7('0x27')]();};}function saveUpdates(_0x3677b3,_0x7e7bdb){return function(_0x3948ed){if(_0x3948ed){return _0x3948ed[_0x91d7('0x28')](_0x3677b3)[_0x91d7('0x29')](function(_0x57b464){return _0x57b464;});}return null;};}function handleEntityNotFound(_0x419ee8,_0x3d6c3c){return function(_0x2523b7){if(!_0x2523b7){_0x419ee8[_0x91d7('0x1b')](0x194);}return _0x2523b7;};}function handleError(_0xbda44f,_0x177730){_0x177730=_0x177730||0x1f4;return function(_0x2753fc){logger[_0x91d7('0x2a')](_0x2753fc['stack']);if(_0x2753fc[_0x91d7('0x2b')]){delete _0x2753fc[_0x91d7('0x2b')];}_0xbda44f[_0x91d7('0x1d')](_0x177730)[_0x91d7('0x2c')](_0x2753fc);};}exports[_0x91d7('0x2d')]=function(_0x3247cc,_0x12ec6c){var _0x3b5fe5={},_0x3f76cf={},_0x249347={'count':0x0,'rows':[]};var _0x4820e9=_[_0x91d7('0x2e')](db[_0x91d7('0x2f')]['rawAttributes'],function(_0x55de06){return{'name':_0x55de06[_0x91d7('0x30')],'type':_0x55de06[_0x91d7('0x31')][_0x91d7('0x32')]};});_0x3f76cf[_0x91d7('0x33')]=_[_0x91d7('0x2e')](_0x4820e9,_0x91d7('0x2b'));_0x3f76cf[_0x91d7('0x34')]=_[_0x91d7('0x35')](_0x3247cc[_0x91d7('0x34')]);_0x3f76cf['filters']=_[_0x91d7('0x36')](_0x3f76cf['model'],_0x3f76cf[_0x91d7('0x34')]);_0x3b5fe5[_0x91d7('0x37')]=_[_0x91d7('0x36')](_0x3f76cf['model'],qs[_0x91d7('0x38')](_0x3247cc[_0x91d7('0x34')][_0x91d7('0x38')]));_0x3b5fe5[_0x91d7('0x37')]=_0x3b5fe5[_0x91d7('0x37')]['length']?_0x3b5fe5[_0x91d7('0x37')]:_0x3f76cf[_0x91d7('0x33')];if(!_0x3247cc[_0x91d7('0x34')]['hasOwnProperty'](_0x91d7('0x39'))){_0x3b5fe5[_0x91d7('0x21')]=qs['limit'](_0x3247cc[_0x91d7('0x34')][_0x91d7('0x21')]);_0x3b5fe5[_0x91d7('0x1f')]=qs[_0x91d7('0x1f')](_0x3247cc[_0x91d7('0x34')][_0x91d7('0x1f')]);}_0x3b5fe5[_0x91d7('0x3a')]=qs[_0x91d7('0x3b')](_0x3247cc['query'][_0x91d7('0x3b')]);_0x3b5fe5[_0x91d7('0x3c')]=qs[_0x91d7('0x3d')](_['pick'](_0x3247cc['query'],_0x3f76cf[_0x91d7('0x3d')]),_0x4820e9);if(_0x3247cc[_0x91d7('0x34')]['filter']){_0x3b5fe5['where']=_['merge'](_0x3b5fe5[_0x91d7('0x3c')],{'$or':_[_0x91d7('0x2e')](_0x4820e9,function(_0x59c909){if(_0x59c909['type']!==_0x91d7('0x3e')){var _0x47f050={};_0x47f050[_0x59c909[_0x91d7('0x2b')]]={'$like':'%'+_0x3247cc[_0x91d7('0x34')][_0x91d7('0x3f')]+'%'};return _0x47f050;}})});}_0x3b5fe5=_[_0x91d7('0x40')]({},_0x3b5fe5,_0x3247cc[_0x91d7('0x41')]);var _0x47cd1d={'where':_0x3b5fe5[_0x91d7('0x3c')]};return db['Team']['count'](_0x47cd1d)[_0x91d7('0x29')](function(_0x17f6d7){_0x249347[_0x91d7('0x22')]=_0x17f6d7;if(_0x3247cc[_0x91d7('0x34')]['includeAll']){_0x3b5fe5[_0x91d7('0x42')]=[{'all':!![]}];}return db[_0x91d7('0x2f')][_0x91d7('0x43')](_0x3b5fe5);})['then'](function(_0x537106){_0x249347[_0x91d7('0x44')]=_0x537106;return _0x249347;})[_0x91d7('0x29')](respondWithFilteredResult(_0x12ec6c,_0x3b5fe5))[_0x91d7('0x45')](handleError(_0x12ec6c,null));};exports[_0x91d7('0x46')]=function(_0x23c089,_0x499d86){var _0x43a7c0={'raw':![],'where':{'id':_0x23c089['params']['id']}},_0x2169f3={};_0x2169f3['model']=_[_0x91d7('0x35')](db[_0x91d7('0x2f')][_0x91d7('0x47')]);_0x2169f3[_0x91d7('0x34')]=_[_0x91d7('0x35')](_0x23c089[_0x91d7('0x34')]);_0x2169f3[_0x91d7('0x3d')]=_[_0x91d7('0x36')](_0x2169f3[_0x91d7('0x33')],_0x2169f3[_0x91d7('0x34')]);_0x43a7c0['attributes']=_[_0x91d7('0x36')](_0x2169f3['model'],qs[_0x91d7('0x38')](_0x23c089[_0x91d7('0x34')]['fields']));_0x43a7c0[_0x91d7('0x37')]=_0x43a7c0[_0x91d7('0x37')][_0x91d7('0x48')]?_0x43a7c0['attributes']:_0x2169f3[_0x91d7('0x33')];if(_0x23c089[_0x91d7('0x34')][_0x91d7('0x49')]){_0x43a7c0['include']=[{'all':!![]}];}_0x43a7c0=_['merge']({},_0x43a7c0,_0x23c089[_0x91d7('0x41')]);return db['Team'][_0x91d7('0x4a')](_0x43a7c0)[_0x91d7('0x29')](handleEntityNotFound(_0x499d86,null))[_0x91d7('0x29')](respondWithResult(_0x499d86,null))['catch'](handleError(_0x499d86,null));};exports[_0x91d7('0x4b')]=function(_0x2cc756,_0x178701){return db[_0x91d7('0x2f')][_0x91d7('0x4b')](_0x2cc756[_0x91d7('0x4c')],{})[_0x91d7('0x29')](function(_0x47602){var _0x4c0a5e=_0x2cc756[_0x91d7('0x4d')]['get']({'plain':!![]});if(!_0x4c0a5e)throw new Error(_0x91d7('0x4e'));if(_0x4c0a5e['role']===_0x91d7('0x4d')){var _0x5d4dfa=_0x47602[_0x91d7('0x4f')]({'plain':!![]});var _0x1c0672=_0x91d7('0x50');return db[_0x91d7('0x51')][_0x91d7('0x4a')]({'where':{'name':_0x1c0672,'userProfileId':_0x4c0a5e['userProfileId']},'raw':!![]})[_0x91d7('0x29')](function(_0x5a51a7){if(_0x5a51a7&&_0x5a51a7['autoAssociation']===0x0){return db[_0x91d7('0x52')]['create']({'name':_0x5d4dfa['name'],'resourceId':_0x5d4dfa['id'],'type':_0x5a51a7['name'],'sectionId':_0x5a51a7['id']},{})['then'](function(){return _0x47602;});}else{return _0x47602;}})[_0x91d7('0x45')](function(_0x1e1ca7){logger[_0x91d7('0x2a')](_0x91d7('0x53'),_0x1e1ca7);throw _0x1e1ca7;});}return _0x47602;})[_0x91d7('0x29')](respondWithResult(_0x178701,0xc9))[_0x91d7('0x45')](handleError(_0x178701,null));};exports['update']=function(_0x4e8e16,_0x405c3f){if(_0x4e8e16[_0x91d7('0x4c')]['id']){delete _0x4e8e16[_0x91d7('0x4c')]['id'];}return db[_0x91d7('0x2f')][_0x91d7('0x4a')]({'where':{'id':_0x4e8e16[_0x91d7('0x54')]['id']}})[_0x91d7('0x29')](handleEntityNotFound(_0x405c3f,null))['then'](saveUpdates(_0x4e8e16[_0x91d7('0x4c')],null))[_0x91d7('0x29')](respondWithResult(_0x405c3f,null))[_0x91d7('0x45')](handleError(_0x405c3f,null));};exports[_0x91d7('0x55')]=function(_0x2cfd02,_0x1cc210){var _0x3e897a=_0x2cfd02[_0x91d7('0x54')]['id'];var _0x49eea2=[];return db[_0x91d7('0x56')]['transaction'](function(_0x53f3f6){var _0x161e07='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x3e897a;return db[_0x91d7('0x56')]['query'](_0x161e07,{'type':db[_0x91d7('0x57')][_0x91d7('0x58')]['SELECT'],'raw':!![],'transaction':_0x53f3f6})[_0x91d7('0x29')](function(_0x3108b5){_0x49eea2=_['map'](_0x3108b5,function(_0x5428fb){return Number(_0x5428fb[_0x91d7('0x59')]);});})['then'](function(){var _0x15db85=_0x91d7('0x5a')+_0x3e897a;return db[_0x91d7('0x56')]['query'](_0x15db85,{'type':db['Sequelize'][_0x91d7('0x58')][_0x91d7('0x5b')],'raw':!![],'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(_0x386d3d){var _0x15b1e9=_[_0x91d7('0x2e')](_0x386d3d,function(_0x42edad){return Number(_0x42edad[_0x91d7('0x5c')]);});return db['UserVoiceQueue'][_0x91d7('0x55')]({'where':{'UserId':{'$in':_0x49eea2},'VoiceQueueId':{'$in':_0x15b1e9}},'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(){var _0x2457a4=_0x91d7('0x5d')+_0x3e897a;return db[_0x91d7('0x56')][_0x91d7('0x34')](_0x2457a4,{'type':db[_0x91d7('0x57')][_0x91d7('0x58')][_0x91d7('0x5b')],'raw':!![],'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(_0x4b1bc3){var _0x24b505=_[_0x91d7('0x2e')](_0x4b1bc3,function(_0x30f90a){return Number(_0x30f90a['MailQueueId']);});return db[_0x91d7('0x5e')][_0x91d7('0x55')]({'where':{'UserId':{'$in':_0x49eea2},'MailQueueId':{'$in':_0x24b505}},'transaction':_0x53f3f6});})['then'](function(){var _0x5be5b3=_0x91d7('0x5f')+_0x3e897a;return db[_0x91d7('0x56')][_0x91d7('0x34')](_0x5be5b3,{'type':db[_0x91d7('0x57')][_0x91d7('0x58')][_0x91d7('0x5b')],'raw':!![],'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(_0x24b2a7){var _0x58d350=_[_0x91d7('0x2e')](_0x24b2a7,function(_0x537d7f){return Number(_0x537d7f[_0x91d7('0x60')]);});return db[_0x91d7('0x61')][_0x91d7('0x55')]({'where':{'UserId':{'$in':_0x49eea2},'SmsQueueId':{'$in':_0x58d350}},'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(){var _0x14d41b='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3e897a;return db[_0x91d7('0x56')]['query'](_0x14d41b,{'type':db[_0x91d7('0x57')][_0x91d7('0x58')][_0x91d7('0x5b')],'raw':!![],'transaction':_0x53f3f6});})['then'](function(_0x24ec08){var _0x275474=_['map'](_0x24ec08,function(_0x3366b5){return Number(_0x3366b5[_0x91d7('0x62')]);});return db[_0x91d7('0x63')][_0x91d7('0x55')]({'where':{'UserId':{'$in':_0x49eea2},'ChatQueueId':{'$in':_0x275474}},'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(){var _0x29357c=_0x91d7('0x64')+_0x3e897a;return db['sequelize'][_0x91d7('0x34')](_0x29357c,{'type':db[_0x91d7('0x57')]['QueryTypes'][_0x91d7('0x5b')],'raw':!![],'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(_0xa36702){var _0xfa25d=_['map'](_0xa36702,function(_0x26e5a5){return Number(_0x26e5a5[_0x91d7('0x65')]);});return db[_0x91d7('0x66')][_0x91d7('0x55')]({'where':{'UserId':{'$in':_0x49eea2},'FaxQueueId':{'$in':_0xfa25d}},'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(){var _0x55b398=_0x91d7('0x67')+_0x3e897a;return db['sequelize'][_0x91d7('0x34')](_0x55b398,{'type':db['Sequelize'][_0x91d7('0x58')][_0x91d7('0x5b')],'raw':!![],'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(_0x47727c){var _0x589b29=_[_0x91d7('0x2e')](_0x47727c,function(_0x165da8){return Number(_0x165da8[_0x91d7('0x68')]);});return db[_0x91d7('0x69')]['destroy']({'where':{'UserId':{'$in':_0x49eea2},'OpenchannelQueueId':{'$in':_0x589b29}},'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(){var _0x21307d=_0x91d7('0x6a')+_0x3e897a;return db['sequelize'][_0x91d7('0x34')](_0x21307d,{'type':db[_0x91d7('0x57')][_0x91d7('0x58')][_0x91d7('0x5b')],'raw':!![],'transaction':_0x53f3f6});})['then'](function(_0x47fe9b){var _0x1dcdfd=_[_0x91d7('0x2e')](_0x47fe9b,function(_0x1ac760){return Number(_0x1ac760['WhatsappQueueId']);});return db[_0x91d7('0x6b')][_0x91d7('0x55')]({'where':{'UserId':{'$in':_0x49eea2},'WhatsappQueueId':{'$in':_0x1dcdfd}},'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(){return db[_0x91d7('0x6c')][_0x91d7('0x4a')]({'where':{'TeamId':_0x3e897a}});})[_0x91d7('0x29')](function(_0x46fbe0){if(_0x46fbe0===null){return;}return db[_0x91d7('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x49eea2},'VoicePrefixId':_0x46fbe0[_0x91d7('0x6e')]},'transaction':_0x53f3f6});})['then'](function(){return db[_0x91d7('0x2f')]['destroy']({'where':{'id':_0x3e897a},'cascade':!![],'transaction':_0x53f3f6});})[_0x91d7('0x29')](function(_0x574a16){if(_0x574a16===0x0){_0x1cc210[_0x91d7('0x1b')](0x194);}else{return db[_0x91d7('0x52')]['destroy']({'where':{'type':_0x91d7('0x50'),'resourceId':_0x3e897a},'cascade':!![],'transaction':_0x53f3f6})['then'](function(){_0x1cc210['status'](0xcc)[_0x91d7('0x1c')]();});}})[_0x91d7('0x45')](function(_0x100249){_0x1cc210[_0x91d7('0x1d')](0x1f4)[_0x91d7('0x2c')](_0x100249);});});};exports[_0x91d7('0x6f')]=function(_0x3ef0da,_0x2e6c57,_0x167a37){return db[_0x91d7('0x2f')]['findOne']({'where':{'id':_0x3ef0da[_0x91d7('0x54')]['id']}})[_0x91d7('0x29')](handleEntityNotFound(_0x2e6c57,null))[_0x91d7('0x29')](function(_0x297f58){if(!_0x3ef0da[_0x91d7('0x34')][_0x91d7('0x70')]||!utils[_0x91d7('0x71')](_0x3ef0da[_0x91d7('0x34')][_0x91d7('0x70')])){throw new db[(_0x91d7('0x57'))][(_0x91d7('0x72'))](_0x91d7('0x73'));}var _0x1a2e56={};var _0x49d9bc={};_0x49d9bc['model']=_['keys'](db[_[_0x91d7('0x74')](_0x3ef0da[_0x91d7('0x34')][_0x91d7('0x70')][_0x91d7('0x75')]())+'Queue']['rawAttributes']);_0x49d9bc['query']=_['keys'](_0x3ef0da[_0x91d7('0x34')]);_0x49d9bc[_0x91d7('0x3d')]=_[_0x91d7('0x36')](_0x49d9bc[_0x91d7('0x33')],_0x49d9bc['query']);_0x1a2e56['attributes']=_[_0x91d7('0x36')](_0x49d9bc[_0x91d7('0x33')],qs['fields'](_0x3ef0da['query'][_0x91d7('0x38')]));_0x1a2e56['attributes']=_0x1a2e56[_0x91d7('0x37')][_0x91d7('0x48')]?_0x1a2e56[_0x91d7('0x37')]:_0x49d9bc['model'];_0x1a2e56[_0x91d7('0x21')]=qs[_0x91d7('0x21')](_0x3ef0da[_0x91d7('0x34')][_0x91d7('0x21')]);_0x1a2e56['offset']=qs['offset'](_0x3ef0da[_0x91d7('0x34')][_0x91d7('0x1f')]);_0x1a2e56['order']=qs[_0x91d7('0x3b')](_0x3ef0da['query'][_0x91d7('0x3b')]);_0x1a2e56[_0x91d7('0x3c')]=qs[_0x91d7('0x3d')](_[_0x91d7('0x76')](_0x3ef0da[_0x91d7('0x34')],_0x49d9bc[_0x91d7('0x3d')]));_0x1a2e56=_[_0x91d7('0x40')]({},_0x1a2e56,_0x3ef0da[_0x91d7('0x41')]);return _0x297f58[_0x91d7('0x4f')+_['capitalize'](_0x3ef0da['query'][_0x91d7('0x70')][_0x91d7('0x75')]())+_0x91d7('0x77')](_0x1a2e56);})[_0x91d7('0x29')](respondWithResult(_0x2e6c57,null))['catch'](handleError(_0x2e6c57,null));};exports[_0x91d7('0x78')]=function(_0x472ded,_0x3c9703,_0x361c81){return db[_0x91d7('0x2f')][_0x91d7('0x79')]({'where':{'id':_0x472ded[_0x91d7('0x54')]['id']}})['then'](function(_0x4ebeaa){if(_0x4ebeaa){if(!_0x472ded['body'][_0x91d7('0x70')]||!utils['isValidChannel'](_0x472ded[_0x91d7('0x4c')][_0x91d7('0x70')])){throw new db[(_0x91d7('0x57'))][(_0x91d7('0x72'))]('Unknown\x20channel');}return _0x4ebeaa[_0x91d7('0x7a')+_[_0x91d7('0x74')](_0x472ded[_0x91d7('0x4c')][_0x91d7('0x70')][_0x91d7('0x75')]())+'Queues'](_0x472ded[_0x91d7('0x4c')][_0x91d7('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x3c9703,null))['then'](respondWithStatusCode(_0x3c9703,null))[_0x91d7('0x45')](handleError(_0x3c9703,null));};exports[_0x91d7('0x7c')]=function(_0x39a865,_0x480146,_0x10c1a9){return db[_0x91d7('0x2f')][_0x91d7('0x79')]({'where':{'id':_0x39a865[_0x91d7('0x54')]['id']}})[_0x91d7('0x29')](function(_0x38892d){if(_0x38892d){if(!_0x39a865['query'][_0x91d7('0x70')]||!utils[_0x91d7('0x71')](_0x39a865[_0x91d7('0x34')][_0x91d7('0x70')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x38892d[_0x91d7('0x7d')+_[_0x91d7('0x74')](_0x39a865[_0x91d7('0x34')][_0x91d7('0x70')][_0x91d7('0x75')]())+_0x91d7('0x77')](_0x39a865[_0x91d7('0x34')][_0x91d7('0x7b')]);}return null;})[_0x91d7('0x29')](handleEntityNotFound(_0x480146,null))[_0x91d7('0x29')](respondWithStatusCode(_0x480146,null))[_0x91d7('0x45')](handleError(_0x480146,null));};exports[_0x91d7('0x7e')]=function(_0x1821e5,_0x3a3917){var _0x594f8e=_[_0x91d7('0x7f')](_0x1821e5['body'][_0x91d7('0x7b')])?_0x1821e5['body'][_0x91d7('0x7b')]:[_0x1821e5[_0x91d7('0x4c')][_0x91d7('0x7b')]];var _0x350767=_0x1821e5[_0x91d7('0x54')]['id'];return db[_0x91d7('0x2f')][_0x91d7('0x4a')]({'where':{'id':_0x350767}})['then'](handleEntityNotFound(_0x3a3917,null))[_0x91d7('0x29')](function(_0x593231){if(_0x593231){var _0x39c4d4=[_0x91d7('0x80'),'Chat','Mail',_0x91d7('0x81'),'Fax',_0x91d7('0x82'),_0x91d7('0x83')];return db[_0x91d7('0x56')][_0x91d7('0x84')](function(_0x187be3){var _0x364812=_[_0x91d7('0x2e')](_0x39c4d4,function(_0x1339c4){var _0x1bc4de={'attributes':['id','name']};if(_0x1339c4==='Voice'){_0x1bc4de[_0x91d7('0x85')]={'attributes':['penalty']};}return _0x593231['get'+_0x1339c4+_0x91d7('0x77')](_0x1bc4de)[_0x91d7('0x29')](function(_0x1973a0){var _0x2a5b4b=_[_0x91d7('0x2e')](_0x1973a0,function(_0x19c544){var _0x28d9c7=_['map'](_0x594f8e,function(_0x2ff462){var _0x3665e4={'where':{'UserId':_0x2ff462,[_0x1339c4+'QueueId']:_0x19c544['id']},'transaction':_0x187be3};if(_0x1339c4===_0x91d7('0x80')){_0x3665e4['defaults']={'penalty':_0x19c544[_0x91d7('0x86')][_0x91d7('0x87')]};}return db[_0x91d7('0x88')+_0x1339c4+'Queue'][_0x91d7('0x89')](_0x3665e4)['then'](function(){socket['emit'](_0x91d7('0x4d')+_0x1339c4+_0x91d7('0x8a'),{'UserId':_0x2ff462,[_0x1339c4+_0x91d7('0x8b')]:_0x19c544['id']});if(_0x1339c4!=='Voice'){return;}return db[_0x91d7('0x88')][_0x91d7('0x43')]({'where':{'id':_0x594f8e,'online':0x1},'attributes':['id','name',_0x91d7('0x8c'),_0x91d7('0x8d'),_0x91d7('0x8e')],'raw':!![]})[_0x91d7('0x29')](function(_0x1c364b){var _0x5c0e7b=_[_0x91d7('0x2e')](_0x1c364b,function(_0x4a4fd9){return db[_0x91d7('0x8f')]['upsert']({'membername':_0x4a4fd9[_0x91d7('0x2b')],'UserId':_0x4a4fd9['id'],'queue_name':_0x19c544[_0x91d7('0x2b')],'VoiceQueueId':_0x19c544['id'],'interface':_[_0x91d7('0x90')](_0x4a4fd9[_0x91d7('0x8e')])?util[_0x91d7('0x91')](_0x91d7('0x92'),_0x4a4fd9[_0x91d7('0x2b')]):_0x4a4fd9[_0x91d7('0x8e')],'paused':_0x4a4fd9['voicePause']||![],'penalty':_0x19c544[_0x91d7('0x86')][_0x91d7('0x87')]},{'transaction':_0x187be3});});return Promise[_0x91d7('0x93')](_0x5c0e7b);});});});return Promise[_0x91d7('0x93')](_0x28d9c7);});return Promise[_0x91d7('0x93')](_0x2a5b4b);})[_0x91d7('0x29')](function(){return db['TeamVoicePrefix'][_0x91d7('0x79')]({'where':{'teamId':_0x350767}})[_0x91d7('0x29')](function(_0x2f9727){if(_0x2f9727){var _0x1f2b48=_[_0x91d7('0x2e')](_0x594f8e,function(_0x3f6d85){db[_0x91d7('0x6d')][_0x91d7('0x94')]({'UserId':_0x3f6d85,'VoicePrefixId':_0x2f9727['VoicePrefixId']});});return Promise[_0x91d7('0x93')](_0x1f2b48);}});});});return Promise[_0x91d7('0x93')](_0x364812)[_0x91d7('0x29')](function(){return _0x593231[_0x91d7('0x7e')](_0x594f8e,{'transaction':_0x187be3})[_0x91d7('0x95')](function(_0x1fb70b){return _0x1fb70b;});});});}})['then'](respondWithResult(_0x3a3917,null))[_0x91d7('0x45')](handleError(_0x3a3917,null));};exports[_0x91d7('0x96')]=function(_0x37cde6,_0x3957c0){var _0x26a80d=_['isArray'](_0x37cde6[_0x91d7('0x34')][_0x91d7('0x7b')])?_0x37cde6[_0x91d7('0x34')][_0x91d7('0x7b')]:[_0x37cde6['query'][_0x91d7('0x7b')]];var _0x241b98=_0x37cde6['params']['id'];return db['Team'][_0x91d7('0x4a')]({'where':{'id':_0x241b98}})[_0x91d7('0x29')](handleEntityNotFound(_0x3957c0,null))[_0x91d7('0x29')](function(_0x2c3e10){if(_0x2c3e10){var _0x5b040a=[_0x91d7('0x80'),_0x91d7('0x97'),_0x91d7('0x98'),'Sms',_0x91d7('0x99'),_0x91d7('0x82'),_0x91d7('0x83')];return db[_0x91d7('0x56')][_0x91d7('0x84')](function(_0x421d9c){var _0x5c843b=_[_0x91d7('0x2e')](_0x5b040a,function(_0x176833){var _0x5ca93c={'attributes':['id',_0x91d7('0x2b')]};return _0x2c3e10['get'+_0x176833+'Queues'](_0x5ca93c)[_0x91d7('0x29')](function(_0x380c1c){var _0x25c7f6=_[_0x91d7('0x2e')](_0x380c1c,function(_0x1d0d7e){return _0x1d0d7e[_0x91d7('0x96')](_0x26a80d,{'transaction':_0x421d9c})[_0x91d7('0x29')](function(){var _0x365bac=_[_0x91d7('0x2e')](_0x26a80d,function(_0x3fd0ba){socket['emit'](_0x91d7('0x4d')+_0x176833+_0x91d7('0x9a'),{'UserId':Number(_0x3fd0ba),[_0x176833+_0x91d7('0x8b')]:_0x1d0d7e['id']});if(_0x176833!==_0x91d7('0x80')){return;}return db[_0x91d7('0x8f')]['destroy']({'where':{'VoiceQueueId':_0x1d0d7e['id'],'UserId':_0x3fd0ba},'transaction':_0x421d9c});});return Promise[_0x91d7('0x93')](_0x365bac);});});return Promise[_0x91d7('0x93')](_0x25c7f6);});});return Promise['all'](_0x5c843b)[_0x91d7('0x29')](function(){return _0x2c3e10['removeAgents'](_0x26a80d,{'transaction':_0x421d9c});})[_0x91d7('0x29')](function(){return db[_0x91d7('0x6c')][_0x91d7('0x79')]({'where':{'teamId':_0x241b98}})[_0x91d7('0x29')](function(_0x347b65){if(_0x347b65){var _0x155dbe=_[_0x91d7('0x2e')](_0x26a80d,function(_0x42ef6c){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x42ef6c,'VoicePrefixId':_0x347b65[_0x91d7('0x6e')]}});});return Promise[_0x91d7('0x93')](_0x155dbe);}});});});}})['then'](respondWithStatusCode(_0x3957c0,null))['catch'](handleError(_0x3957c0,null));};exports[_0x91d7('0x9b')]=function(_0x28e879,_0x55866c,_0x4205e1){var _0x1b2bda={};var _0x230bde={};var _0x439071;var _0x14542f;return db[_0x91d7('0x2f')][_0x91d7('0x79')]({'where':{'id':_0x28e879[_0x91d7('0x54')]['id']}})[_0x91d7('0x29')](handleEntityNotFound(_0x55866c,null))[_0x91d7('0x29')](function(_0x45df6e){if(_0x45df6e){_0x439071=_0x45df6e;_0x230bde[_0x91d7('0x33')]=_[_0x91d7('0x35')](db[_0x91d7('0x88')][_0x91d7('0x47')]);_0x230bde[_0x91d7('0x34')]=_[_0x91d7('0x35')](_0x28e879[_0x91d7('0x34')]);_0x230bde['filters']=_['intersection'](_0x230bde[_0x91d7('0x33')],_0x230bde['query']);_0x1b2bda[_0x91d7('0x37')]=_[_0x91d7('0x36')](_0x230bde[_0x91d7('0x33')],qs[_0x91d7('0x38')](_0x28e879[_0x91d7('0x34')][_0x91d7('0x38')]));_0x1b2bda['attributes']=_0x1b2bda[_0x91d7('0x37')][_0x91d7('0x48')]?_0x1b2bda[_0x91d7('0x37')]:_0x230bde[_0x91d7('0x33')];_0x1b2bda[_0x91d7('0x3a')]=qs['sort'](_0x28e879[_0x91d7('0x34')][_0x91d7('0x3b')]);_0x1b2bda[_0x91d7('0x3c')]=qs[_0x91d7('0x3d')](_[_0x91d7('0x76')](_0x28e879[_0x91d7('0x34')],_0x230bde[_0x91d7('0x3d')]));if(_0x28e879[_0x91d7('0x34')][_0x91d7('0x3f')]){_0x1b2bda[_0x91d7('0x3c')]=_[_0x91d7('0x40')](_0x1b2bda[_0x91d7('0x3c')],{'$or':_[_0x91d7('0x2e')](_0x1b2bda['attributes'],function(_0x3f5877){var _0x464a6d={};_0x464a6d[_0x3f5877]={'$like':'%'+_0x28e879['query']['filter']+'%'};return _0x464a6d;})});}_0x1b2bda=_[_0x91d7('0x40')]({},_0x1b2bda,_0x28e879[_0x91d7('0x41')]);return _0x439071['getAgents'](_0x1b2bda);}})[_0x91d7('0x29')](function(_0x7b9208){if(_0x7b9208){_0x14542f=_0x7b9208[_0x91d7('0x48')];if(!_0x28e879[_0x91d7('0x34')]['hasOwnProperty'](_0x91d7('0x39'))){_0x1b2bda[_0x91d7('0x21')]=qs['limit'](_0x28e879[_0x91d7('0x34')]['limit']);_0x1b2bda[_0x91d7('0x1f')]=qs[_0x91d7('0x1f')](_0x28e879[_0x91d7('0x34')][_0x91d7('0x1f')]);}return _0x439071[_0x91d7('0x9b')](_0x1b2bda);}})[_0x91d7('0x29')](function(_0x5c2d70){if(_0x5c2d70){return _0x5c2d70?{'count':_0x14542f,'rows':_0x5c2d70}:null;}})['then'](respondWithResult(_0x55866c,null))[_0x91d7('0x45')](handleError(_0x55866c,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 65b9705..23850b8 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 _0x875b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x146860,_0x3187fb){var _0x5373a3=function(_0x2f734e){while(--_0x2f734e){_0x146860['push'](_0x146860['shift']());}};_0x5373a3(++_0x3187fb);}(_0x875b,0x11b));var _0xb875=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x875b[_0x22377a];return _0x36f105;};'use strict';var EventEmitter=require(_0xb875('0x0'));var Team=require(_0xb875('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xb875('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb875('0x3'),'afterDestroy':_0xb875('0x4')};function emitEvent(_0x11611c){return function(_0xf3b42f,_0x55778d,_0x498396){TeamEvents[_0xb875('0x5')](_0x11611c+':'+_0xf3b42f['id'],_0xf3b42f);TeamEvents[_0xb875('0x5')](_0x11611c,_0xf3b42f);_0x498396(null);};}for(var e in events){if(events[_0xb875('0x6')](e)){var event=events[e];Team[_0xb875('0x7')](e,emitEvent(event));}}module[_0xb875('0x8')]=TeamEvents; \ No newline at end of file +var _0x25fe=['../../mysqldb','setMaxListeners','remove','emit','hook','events'];(function(_0x4d8554,_0x547575){var _0x1c75a8=function(_0x5a4bb1){while(--_0x5a4bb1){_0x4d8554['push'](_0x4d8554['shift']());}};_0x1c75a8(++_0x547575);}(_0x25fe,0xfb));var _0xe25f=function(_0x256422,_0x367394){_0x256422=_0x256422-0x0;var _0x55dddc=_0x25fe[_0x256422];return _0x55dddc;};'use strict';var EventEmitter=require(_0xe25f('0x0'));var Team=require(_0xe25f('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xe25f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe25f('0x3')};function emitEvent(_0x1231b1){return function(_0x23d55e,_0x18e947,_0x1eb02f){TeamEvents['emit'](_0x1231b1+':'+_0x23d55e['id'],_0x23d55e);TeamEvents[_0xe25f('0x4')](_0x1231b1,_0x23d55e);_0x1eb02f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xe25f('0x5')](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 645a1fe..b018dd0 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 _0x7495=['catch','define','Team','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','all','Queues','then','map','setDataValue','channel'];(function(_0x34ed28,_0x2a1eab){var _0x176f07=function(_0x1c6ff0){while(--_0x1c6ff0){_0x34ed28['push'](_0x34ed28['shift']());}};_0x176f07(++_0x2a1eab);}(_0x7495,0xcd));var _0x5749=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0x7495[_0x1dbaf7];return _0x593f05;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x3d7baa,_0xccfa2e){var _0x2fb88f='get'+_0xccfa2e+_0x5749('0x0');return _0x3d7baa[_0x2fb88f]()[_0x5749('0x1')](function(_0x4577df){return _[_0x5749('0x2')](_0x4577df,function(_0x153cc9){_0x153cc9[_0x5749('0x3')](_0x5749('0x4'),_0xccfa2e);return _0x153cc9;});})[_0x5749('0x5')](function(_0x265cc2){throw _0x265cc2;});}module['exports']=function(_0x1ce2ca){return _0x1ce2ca[_0x5749('0x6')](_0x5749('0x7'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x118820=this;var _0x31b823=['Chat',_0x5749('0x8'),_0x5749('0x9'),_0x5749('0xa'),_0x5749('0xb'),_0x5749('0xc'),_0x5749('0xd')];return Promise['resolve']()['then'](function(){var _0x3c3934=_[_0x5749('0x2')](_0x31b823,function(_0x207e02){return getQueuesByChannel(_0x118820,_0x207e02);});return Promise[_0x5749('0xe')](_0x3c3934);})[_0x5749('0x5')](function(_0x16425a){throw _0x16425a;});}}});}; \ No newline at end of file +var _0xc5b3=['Fax','Sms','Voice','all','lodash','Queues','then','map','setDataValue','channel','exports','define','Team','teams'];(function(_0x1450c6,_0x4d4610){var _0x45bd8f=function(_0x4bb4cc){while(--_0x4bb4cc){_0x1450c6['push'](_0x1450c6['shift']());}};_0x45bd8f(++_0x4d4610);}(_0xc5b3,0xba));var _0x3c5b=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xc5b3[_0x2ddfd9];return _0x2668f0;};'use strict';var _=require(_0x3c5b('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x2ea175,_0x13c0e1){var _0x5601f0='get'+_0x13c0e1+_0x3c5b('0x1');return _0x2ea175[_0x5601f0]()[_0x3c5b('0x2')](function(_0x31f2a1){return _[_0x3c5b('0x3')](_0x31f2a1,function(_0x2c0f6a){_0x2c0f6a[_0x3c5b('0x4')](_0x3c5b('0x5'),_0x13c0e1);return _0x2c0f6a;});})['catch'](function(_0x4ff998){throw _0x4ff998;});}module[_0x3c5b('0x6')]=function(_0x58b548){return _0x58b548[_0x3c5b('0x7')](_0x3c5b('0x8'),attributes,{'tableName':_0x3c5b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x85071=this;var _0x5be7e3=['Chat',_0x3c5b('0xa'),'Mail','Openchannel',_0x3c5b('0xb'),_0x3c5b('0xc'),'Whatsapp'];return Promise['resolve']()[_0x3c5b('0x2')](function(){var _0x3b066e=_[_0x3c5b('0x3')](_0x5be7e3,function(_0x2d4b11){return getQueuesByChannel(_0x85071,_0x2d4b11);});return Promise[_0x3c5b('0xd')](_0x3b066e);})['catch'](function(_0x3675b0){throw _0x3675b0;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 59aec81..f6d3c82 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 _0x64b2=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x354f00,_0x5d791c){var _0x50d14f=function(_0x42fb49){while(--_0x42fb49){_0x354f00['push'](_0x354f00['shift']());}};_0x50d14f(++_0x5d791c);}(_0x64b2,0x12f));var _0x264b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x64b2[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x264b('0x0'));var util=require(_0x264b('0x1'));var moment=require(_0x264b('0x2'));var BPromise=require(_0x264b('0x3'));var rs=require(_0x264b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x264b('0x5'))('rpc');var config=require(_0x264b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x264b('0x7')][_0x264b('0x8')]({'port':0x232a});config[_0x264b('0x9')]=_[_0x264b('0xa')](config[_0x264b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x264b('0xb'))(new Redis(config[_0x264b('0x9')]));require(_0x264b('0xc'))[_0x264b('0xd')](socket);function respondWithRpcPromise(_0x409c22,_0x3c9fd2,_0x26f9c2){return new BPromise(function(_0x395d27,_0x10e93c){return client[_0x264b('0xe')](_0x409c22,_0x26f9c2)[_0x264b('0xf')](function(_0x23b028){logger['info'](_0x264b('0x10'),_0x3c9fd2,'request\x20sent');logger[_0x264b('0x11')](_0x264b('0x12'),_0x3c9fd2,_0x264b('0x13'),JSON[_0x264b('0x14')](_0x23b028));if(_0x23b028[_0x264b('0x15')]){if(_0x23b028[_0x264b('0x15')][_0x264b('0x16')]===0x1f4){logger[_0x264b('0x15')](_0x264b('0x10'),_0x3c9fd2,_0x23b028[_0x264b('0x15')][_0x264b('0x17')]);return _0x10e93c(_0x23b028[_0x264b('0x15')][_0x264b('0x17')]);}logger[_0x264b('0x15')](_0x264b('0x10'),_0x3c9fd2,_0x23b028[_0x264b('0x15')][_0x264b('0x17')]);return _0x395d27(_0x23b028[_0x264b('0x15')]['message']);}else{logger[_0x264b('0x18')](_0x264b('0x10'),_0x3c9fd2,_0x264b('0x13'));_0x395d27(_0x23b028[_0x264b('0x19')][_0x264b('0x17')]);}})[_0x264b('0x1a')](function(_0x4580ff){logger[_0x264b('0x15')]('Team,\x20%s,\x20%s',_0x3c9fd2,_0x4580ff);_0x10e93c(_0x4580ff);});});} \ No newline at end of file +var _0x2403=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0x2403,0x1b3));var _0x3240=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2403[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3240('0x0'));var util=require(_0x3240('0x1'));var moment=require(_0x3240('0x2'));var BPromise=require(_0x3240('0x3'));var rs=require(_0x3240('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3240('0x5'));var logger=require(_0x3240('0x6'))(_0x3240('0x7'));var config=require(_0x3240('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3240('0x9')][_0x3240('0xa')]({'port':0x232a});config[_0x3240('0xb')]=_[_0x3240('0xc')](config[_0x3240('0xb')],{'host':_0x3240('0xd'),'port':0x18eb});var socket=require(_0x3240('0xe'))(new Redis(config[_0x3240('0xb')]));require(_0x3240('0xf'))[_0x3240('0x10')](socket);function respondWithRpcPromise(_0x5ebe0d,_0x33be41,_0x56f1b0){return new BPromise(function(_0xa84059,_0x308e08){return client[_0x3240('0x11')](_0x5ebe0d,_0x56f1b0)[_0x3240('0x12')](function(_0x5cdd98){logger[_0x3240('0x13')](_0x3240('0x14'),_0x33be41,_0x3240('0x15'));logger[_0x3240('0x16')](_0x3240('0x17'),_0x33be41,'request\x20sent',JSON[_0x3240('0x18')](_0x5cdd98));if(_0x5cdd98['error']){if(_0x5cdd98[_0x3240('0x19')][_0x3240('0x1a')]===0x1f4){logger[_0x3240('0x19')](_0x3240('0x14'),_0x33be41,_0x5cdd98[_0x3240('0x19')][_0x3240('0x1b')]);return _0x308e08(_0x5cdd98[_0x3240('0x19')][_0x3240('0x1b')]);}logger[_0x3240('0x19')](_0x3240('0x14'),_0x33be41,_0x5cdd98[_0x3240('0x19')]['message']);return _0xa84059(_0x5cdd98[_0x3240('0x19')]['message']);}else{logger[_0x3240('0x13')](_0x3240('0x14'),_0x33be41,'request\x20sent');_0xa84059(_0x5cdd98['result'][_0x3240('0x1b')]);}})[_0x3240('0x1c')](function(_0x20d95c){logger[_0x3240('0x19')](_0x3240('0x14'),_0x33be41,_0x20d95c);_0x308e08(_0x20d95c);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index dec7149..d588677 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 _0x1be9=['save','remove','update','emit','removeListener','length','team:','./team.events'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1be9,0x77));var _0x91be=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1be9[_0x1cc8fe];return _0x230054;};'use strict';var TeamEvents=require(_0x91be('0x0'));var events=[_0x91be('0x1'),_0x91be('0x2'),_0x91be('0x3')];function createListener(_0x4a3d2f,_0xe91864){return function(_0x5f0520){_0xe91864[_0x91be('0x4')](_0x4a3d2f,_0x5f0520);};}function removeListener(_0x31df61,_0x309418){return function(){TeamEvents[_0x91be('0x5')](_0x31df61,_0x309418);};}exports['register']=function(_0x5ead38){for(var _0x301977=0x0,_0x4ce6fe=events[_0x91be('0x6')];_0x301977<_0x4ce6fe;_0x301977++){var _0x34c132=events[_0x301977];var _0x5b06ee=createListener(_0x91be('0x7')+_0x34c132,_0x5ead38);TeamEvents['on'](_0x34c132,_0x5b06ee);}}; \ No newline at end of file +var _0xc36a=['./team.events','save','update','register'];(function(_0x3083a0,_0x2462cb){var _0x168244=function(_0x62a88e){while(--_0x62a88e){_0x3083a0['push'](_0x3083a0['shift']());}};_0x168244(++_0x2462cb);}(_0xc36a,0x180));var _0xac36=function(_0x24f9f4,_0x860120){_0x24f9f4=_0x24f9f4-0x0;var _0x5e9a19=_0xc36a[_0x24f9f4];return _0x5e9a19;};'use strict';var TeamEvents=require(_0xac36('0x0'));var events=[_0xac36('0x1'),'remove',_0xac36('0x2')];function createListener(_0x480745,_0x14ab53){return function(_0x27911c){_0x14ab53['emit'](_0x480745,_0x27911c);};}function removeListener(_0x4f5294,_0x4fc41e){return function(){TeamEvents['removeListener'](_0x4f5294,_0x4fc41e);};}exports[_0xac36('0x3')]=function(_0xf828e9){for(var _0x42d539=0x0,_0xa2f50e=events['length'];_0x42d539<_0xa2f50e;_0x42d539++){var _0x5b8700=events[_0x42d539];var _0xe6d230=createListener('team:'+_0x5b8700,_0xf828e9);TeamEvents['on'](_0x5b8700,_0xe6d230);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 56c1437..6e29e66 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 _0x252b=['sequelize','exports','INTEGER'];(function(_0x3a50b3,_0x172be0){var _0x3b0c85=function(_0x1594f0){while(--_0x1594f0){_0x3a50b3['push'](_0x3a50b3['shift']());}};_0x3b0c85(++_0x172be0);}(_0x252b,0x117));var _0xb252=function(_0x22730b,_0x3aafcd){_0x22730b=_0x22730b-0x0;var _0x20af64=_0x252b[_0x22730b];return _0x20af64;};'use strict';var Sequelize=require(_0xb252('0x0'));module[_0xb252('0x1')]={'TeamId':{'type':Sequelize[_0xb252('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3d76=['INTEGER','sequelize','exports'];(function(_0x5130aa,_0x441b77){var _0x125ec6=function(_0x4d3bf2){while(--_0x4d3bf2){_0x5130aa['push'](_0x5130aa['shift']());}};_0x125ec6(++_0x441b77);}(_0x3d76,0x13c));var _0x63d7=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x3d76[_0x3f5dca];return _0x5b833a;};'use strict';var Sequelize=require(_0x63d7('0x0'));module[_0x63d7('0x1')]={'TeamId':{'type':Sequelize[_0x63d7('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x63d7('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 13b8f4b..e0c9dcd 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 _0x92d7=['team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix'];(function(_0x29b4d4,_0x3b50d1){var _0x3e77e0=function(_0x36603c){while(--_0x36603c){_0x29b4d4['push'](_0x29b4d4['shift']());}};_0x3e77e0(++_0x3b50d1);}(_0x92d7,0x17b));var _0x792d=function(_0x188eba,_0x4ddb03){_0x188eba=_0x188eba-0x0;var _0x47ba53=_0x92d7[_0x188eba];return _0x47ba53;};'use strict';var _=require(_0x792d('0x0'));var util=require('util');var logger=require(_0x792d('0x1'))(_0x792d('0x2'));var moment=require(_0x792d('0x3'));var BPromise=require(_0x792d('0x4'));var rp=require(_0x792d('0x5'));var fs=require('fs');var path=require(_0x792d('0x6'));var rimraf=require(_0x792d('0x7'));var config=require(_0x792d('0x8'));var attributes=require(_0x792d('0x9'));module[_0x792d('0xa')]=function(_0x54374f,_0x3e95c4){return _0x54374f[_0x792d('0xb')](_0x792d('0xc'),attributes,{'tableName':_0x792d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f4d=['moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','define','TeamVoicePrefix','lodash','util','../../config/logger','api'];(function(_0x157363,_0x43e87b){var _0x25dd68=function(_0xfc7f6c){while(--_0xfc7f6c){_0x157363['push'](_0x157363['shift']());}};_0x25dd68(++_0x43e87b);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x177cc9,_0x3f6fdd){_0x177cc9=_0x177cc9-0x0;var _0x2fe577=_0x9f4d[_0x177cc9];return _0x2fe577;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var logger=require(_0xd9f4('0x2'))(_0xd9f4('0x3'));var moment=require(_0xd9f4('0x4'));var BPromise=require(_0xd9f4('0x5'));var rp=require(_0xd9f4('0x6'));var fs=require('fs');var path=require(_0xd9f4('0x7'));var rimraf=require(_0xd9f4('0x8'));var config=require('../../config/environment');var attributes=require(_0xd9f4('0x9'));module['exports']=function(_0x3d521d,_0x3ebf1b){return _0x3d521d[_0xd9f4('0xa')](_0xd9f4('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ad6aee2..a42d5ea 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x42c069,_0xdfa0f9){var _0x4f0740=function(_0x4c9fd9){while(--_0x4c9fd9){_0x42c069['push'](_0x42c069['shift']());}};_0x4f0740(++_0xdfa0f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3fc942,_0x528909){var _0x29e4c4=function(_0x5c7dee){while(--_0x5c7dee){_0x3fc942['push'](_0x3fc942['shift']());}};_0x29e4c4(++_0x528909);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0xcb91[_0x3aaf0a];return _0x33e6bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index ba4b1eb..4599fe1 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 _0x73da=['INTEGER','sequelize','exports'];(function(_0x1a7c5b,_0x4f7bed){var _0x2b3d29=function(_0x3e1818){while(--_0x3e1818){_0x1a7c5b['push'](_0x1a7c5b['shift']());}};_0x2b3d29(++_0x4f7bed);}(_0x73da,0x136));var _0xa73d=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x73da[_0x4709c8];return _0x478cdd;};'use strict';var Sequelize=require(_0xa73d('0x0'));module[_0xa73d('0x1')]={'penalty':{'type':Sequelize[_0xa73d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd90b=['sequelize'];(function(_0x16168a,_0x47974c){var _0x35316d=function(_0x3ad457){while(--_0x3ad457){_0x16168a['push'](_0x16168a['shift']());}};_0x35316d(++_0x47974c);}(_0xd90b,0xbd));var _0xbd90=function(_0x364b9d,_0x2b8682){_0x364b9d=_0x364b9d-0x0;var _0x490404=_0xd90b[_0x364b9d];return _0x490404;};'use strict';var Sequelize=require(_0xbd90('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 65d3e68..5bd015c 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 _0x49c4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x49c4,0x9b));var _0x449c=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x49c4[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x449c('0x0'));var util=require('util');var logger=require(_0x449c('0x1'))(_0x449c('0x2'));var moment=require(_0x449c('0x3'));var BPromise=require(_0x449c('0x4'));var rp=require(_0x449c('0x5'));var fs=require('fs');var path=require(_0x449c('0x6'));var rimraf=require(_0x449c('0x7'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0x449c('0x8')]=function(_0x442e56,_0x12586c){return _0x442e56[_0x449c('0x9')](_0x449c('0xa'),attributes,{'tableName':_0x449c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f5d=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0x135dc0,_0x5ac0e2){var _0x469cb1=function(_0x4bd018){while(--_0x4bd018){_0x135dc0['push'](_0x135dc0['shift']());}};_0x469cb1(++_0x5ac0e2);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4f5d[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var logger=require(_0xd4f5('0x2'))(_0xd4f5('0x3'));var moment=require(_0xd4f5('0x4'));var BPromise=require(_0xd4f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f5('0x6'));var rimraf=require(_0xd4f5('0x7'));var config=require(_0xd4f5('0x8'));var attributes=require(_0xd4f5('0x9'));module[_0xd4f5('0xa')]=function(_0x2c44bb,_0x121bfd){return _0x2c44bb[_0xd4f5('0xb')](_0xd4f5('0xc'),attributes,{'tableName':_0xd4f5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1bb1de2..cf16e94 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 _0x56ce=['error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x26c7c4,_0x1de075){var _0x1258e8=function(_0x1fe520){while(--_0x1fe520){_0x26c7c4['push'](_0x26c7c4['shift']());}};_0x1258e8(++_0x1de075);}(_0x56ce,0x1e9));var _0xe56c=function(_0x3f946f,_0x12e19f){_0x3f946f=_0x3f946f-0x0;var _0x5ef3fd=_0x56ce[_0x3f946f];return _0x5ef3fd;};'use strict';var _=require(_0xe56c('0x0'));var util=require('util');var moment=require(_0xe56c('0x1'));var BPromise=require(_0xe56c('0x2'));var rs=require(_0xe56c('0x3'));var fs=require('fs');var Redis=require(_0xe56c('0x4'));var db=require(_0xe56c('0x5'))['db'];var utils=require(_0xe56c('0x6'));var logger=require(_0xe56c('0x7'))(_0xe56c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe56c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12dac0,_0xb90391,_0x375508){return new BPromise(function(_0x29fc69,_0x3cfb95){return client[_0xe56c('0xa')](_0x12dac0,_0x375508)[_0xe56c('0xb')](function(_0x263812){logger[_0xe56c('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0xb90391,'request\x20sent');logger[_0xe56c('0xd')](_0xe56c('0xe'),_0xb90391,_0xe56c('0xf'),JSON[_0xe56c('0x10')](_0x263812));if(_0x263812[_0xe56c('0x11')]){if(_0x263812[_0xe56c('0x11')][_0xe56c('0x12')]===0x1f4){logger[_0xe56c('0x11')](_0xe56c('0x13'),_0xb90391,_0x263812[_0xe56c('0x11')][_0xe56c('0x14')]);return _0x3cfb95(_0x263812[_0xe56c('0x11')][_0xe56c('0x14')]);}logger[_0xe56c('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0xb90391,_0x263812['error'][_0xe56c('0x14')]);return _0x29fc69(_0x263812[_0xe56c('0x11')][_0xe56c('0x14')]);}else{logger[_0xe56c('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0xb90391,'request\x20sent');_0x29fc69(_0x263812[_0xe56c('0x15')]['message']);}})[_0xe56c('0x16')](function(_0x499f8a){logger['error'](_0xe56c('0x13'),_0xb90391,_0x499f8a);_0x3cfb95(_0x499f8a);});});} \ No newline at end of file +var _0xa461=['jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1546c2,_0x22e822){var _0x24583c=function(_0x3906f8){while(--_0x3906f8){_0x1546c2['push'](_0x1546c2['shift']());}};_0x24583c(++_0x22e822);}(_0xa461,0x1f2));var _0x1a46=function(_0x81121,_0x11bf0a){_0x81121=_0x81121-0x0;var _0x2cbc97=_0xa461[_0x81121];return _0x2cbc97;};'use strict';var _=require(_0x1a46('0x0'));var util=require(_0x1a46('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1a46('0x2'));var fs=require('fs');var Redis=require(_0x1a46('0x3'));var db=require(_0x1a46('0x4'))['db'];var utils=require(_0x1a46('0x5'));var logger=require(_0x1a46('0x6'))(_0x1a46('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a46('0x8'));var client=jayson[_0x1a46('0x9')][_0x1a46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1328a2,_0x408d4a,_0x31747e){return new BPromise(function(_0x5a2abe,_0x4a8c5a){return client[_0x1a46('0xb')](_0x1328a2,_0x31747e)[_0x1a46('0xc')](function(_0x153bc2){logger[_0x1a46('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x408d4a,_0x1a46('0xe'));logger[_0x1a46('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x408d4a,'request\x20sent',JSON[_0x1a46('0x10')](_0x153bc2));if(_0x153bc2[_0x1a46('0x11')]){if(_0x153bc2['error'][_0x1a46('0x12')]===0x1f4){logger[_0x1a46('0x11')](_0x1a46('0x13'),_0x408d4a,_0x153bc2[_0x1a46('0x11')]['message']);return _0x4a8c5a(_0x153bc2[_0x1a46('0x11')][_0x1a46('0x14')]);}logger[_0x1a46('0x11')](_0x1a46('0x13'),_0x408d4a,_0x153bc2[_0x1a46('0x11')]['message']);return _0x5a2abe(_0x153bc2['error'][_0x1a46('0x14')]);}else{logger[_0x1a46('0xd')](_0x1a46('0x13'),_0x408d4a,_0x1a46('0xe'));_0x5a2abe(_0x153bc2[_0x1a46('0x15')][_0x1a46('0x14')]);}})[_0x1a46('0x16')](function(_0x3cac57){logger[_0x1a46('0x11')](_0x1a46('0x13'),_0x408d4a,_0x3cac57);_0x4a8c5a(_0x3cac57);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 1b01388..386893c 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 _0x6a55=['index','/:id','show','post','create','put','update','delete','destroy','multer','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x2b9d5c,_0x173518){var _0x37bb93=function(_0x5515cd){while(--_0x5515cd){_0x2b9d5c['push'](_0x2b9d5c['shift']());}};_0x37bb93(++_0x173518);}(_0x6a55,0xdb));var _0x56a5=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x6a55[_0x5f3f88];return _0xd08119;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x56a5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x56a5('0x3'));var controller=require('./template.controller');router[_0x56a5('0x4')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x6')]);router[_0x56a5('0x4')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x56a5('0xa')]);router[_0x56a5('0xb')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xc')]);router[_0x56a5('0xd')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3646=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x6d5061,_0x3ea5be){var _0x598ad1=function(_0x3afa66){while(--_0x3afa66){_0x6d5061['push'](_0x6d5061['shift']());}};_0x598ad1(++_0x3ea5be);}(_0x3646,0x15f));var _0x6364=function(_0x361bcd,_0x1833a2){_0x361bcd=_0x361bcd-0x0;var _0x10e6da=_0x3646[_0x361bcd];return _0x10e6da;};'use strict';var multer=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var path=require(_0x6364('0x2'));var timeout=require(_0x6364('0x3'));var express=require('express');var router=express[_0x6364('0x4')]();var fs_extra=require(_0x6364('0x5'));var auth=require(_0x6364('0x6'));var interaction=require(_0x6364('0x7'));var config=require(_0x6364('0x8'));var controller=require(_0x6364('0x9'));router[_0x6364('0xa')]('/',auth[_0x6364('0xb')](),controller[_0x6364('0xc')]);router[_0x6364('0xa')](_0x6364('0xd'),auth['isAuthenticated'](),controller[_0x6364('0xe')]);router[_0x6364('0xf')]('/',auth[_0x6364('0xb')](),controller[_0x6364('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6364('0x11')]);router[_0x6364('0x12')](_0x6364('0xd'),auth[_0x6364('0xb')](),controller[_0x6364('0x13')]);module[_0x6364('0x14')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index a7f37cc..4604ae1 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 _0xf608=['exports','STRING','TEXT','sequelize'];(function(_0xbfaa92,_0x30ed74){var _0x10ac1f=function(_0x35617e){while(--_0x35617e){_0xbfaa92['push'](_0xbfaa92['shift']());}};_0x10ac1f(++_0x30ed74);}(_0xf608,0xdb));var _0x8f60=function(_0x384691,_0x1f4e03){_0x384691=_0x384691-0x0;var _0x28b395=_0xf608[_0x384691];return _0x28b395;};'use strict';var Sequelize=require(_0x8f60('0x0'));module[_0x8f60('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8f60('0x2')]},'html':{'type':Sequelize[_0x8f60('0x3')]}}; \ No newline at end of file +var _0xc641=['sequelize','exports','STRING'];(function(_0x37c97d,_0x3205f0){var _0x3add5c=function(_0x15c15c){while(--_0x15c15c){_0x37c97d['push'](_0x37c97d['shift']());}};_0x3add5c(++_0x3205f0);}(_0xc641,0x15f));var _0x1c64=function(_0x44f012,_0x32d5d2){_0x44f012=_0x44f012-0x0;var _0x30973e=_0xc641[_0x44f012];return _0x30973e;};'use strict';var Sequelize=require(_0x1c64('0x0'));module[_0x1c64('0x1')]={'name':{'type':Sequelize[_0x1c64('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 6184b88..21de389 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 _0xa0c3=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','fields','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Templates','UserProfileResource','destroy','error','stack','name','send','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit'];(function(_0x4ba365,_0x52781b){var _0x9bcd6a=function(_0x4b7078){while(--_0x4b7078){_0x4ba365['push'](_0x4ba365['shift']());}};_0x9bcd6a(++_0x52781b);}(_0xa0c3,0x6d));var _0x3a0c=function(_0x482fa9,_0xb1e732){_0x482fa9=_0x482fa9-0x0;var _0x3f1d63=_0xa0c3[_0x482fa9];return _0x3f1d63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a0c('0x0'));var zipdir=require(_0x3a0c('0x1'));var jsonpatch=require(_0x3a0c('0x2'));var rp=require(_0x3a0c('0x3'));var moment=require('moment');var BPromise=require(_0x3a0c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a0c('0x5'));var sox=require('sox');var csv=require(_0x3a0c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a0c('0x7'));var _=require(_0x3a0c('0x8'));var squel=require(_0x3a0c('0x9'));var crypto=require('crypto');var jsforce=require(_0x3a0c('0xa'));var deskjs=require(_0x3a0c('0xb'));var toCsv=require(_0x3a0c('0x6'));var querystring=require(_0x3a0c('0xc'));var Papa=require(_0x3a0c('0xd'));var Redis=require(_0x3a0c('0xe'));var authService=require(_0x3a0c('0xf'));var qs=require(_0x3a0c('0x10'));var as=require(_0x3a0c('0x11'));var hardwareService=require(_0x3a0c('0x12'));var logger=require(_0x3a0c('0x13'))(_0x3a0c('0x14'));var utils=require(_0x3a0c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3a0c('0x16'))['db'];function respondWithStatusCode(_0x55c10c,_0xd61d18){_0xd61d18=_0xd61d18||0xcc;return function(_0x2ca0da){if(_0x2ca0da){return _0x55c10c[_0x3a0c('0x17')](_0xd61d18);}return _0x55c10c[_0x3a0c('0x18')](_0xd61d18)[_0x3a0c('0x19')]();};}function respondWithResult(_0x546c42,_0x57022d){_0x57022d=_0x57022d||0xc8;return function(_0x4b1cbd){if(_0x4b1cbd){return _0x546c42[_0x3a0c('0x18')](_0x57022d)[_0x3a0c('0x1a')](_0x4b1cbd);}};}function respondWithFilteredResult(_0x359895,_0xee53a6){return function(_0x4a4f68){if(_0x4a4f68){var _0x27eccf=typeof _0xee53a6[_0x3a0c('0x1b')]===_0x3a0c('0x1c')&&typeof _0xee53a6[_0x3a0c('0x1d')]==='undefined';var _0x5a8078=_0x4a4f68[_0x3a0c('0x1e')];var _0x35bab2=_0x27eccf?0x0:_0xee53a6[_0x3a0c('0x1b')];var _0x2d4f04=_0x27eccf?_0x4a4f68['count']:_0xee53a6[_0x3a0c('0x1b')]+_0xee53a6[_0x3a0c('0x1d')];var _0x368c51;if(_0x2d4f04>=_0x5a8078){_0x2d4f04=_0x5a8078;_0x368c51=0xc8;}else{_0x368c51=0xce;}_0x359895[_0x3a0c('0x18')](_0x368c51);return _0x359895[_0x3a0c('0x1f')](_0x3a0c('0x20'),_0x35bab2+'-'+_0x2d4f04+'/'+_0x5a8078)['json'](_0x4a4f68);}return null;};}function patchUpdates(_0x5b05ec){return function(_0x12dd93){try{jsonpatch[_0x3a0c('0x21')](_0x12dd93,_0x5b05ec,!![]);}catch(_0x276123){return BPromise['reject'](_0x276123);}return _0x12dd93[_0x3a0c('0x22')]();};}function saveUpdates(_0x239ed9,_0x1465c1){return function(_0x21f959){if(_0x21f959){return _0x21f959[_0x3a0c('0x23')](_0x239ed9)[_0x3a0c('0x24')](function(_0x157941){return _0x157941;});}return null;};}function removeEntity(_0x25278a,_0x3b9f05){return function(_0x505145){if(_0x505145){return _0x505145['destroy']()[_0x3a0c('0x24')](function(){var _0x559093=_0x505145[_0x3a0c('0x25')]({'plain':!![]});var _0x34dd82=_0x3a0c('0x26');return db[_0x3a0c('0x27')][_0x3a0c('0x28')]({'where':{'type':_0x34dd82,'resourceId':_0x559093['id']}})['then'](function(){return _0x505145;});})[_0x3a0c('0x24')](function(){_0x25278a[_0x3a0c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e1a8,_0x37b5b6){return function(_0xc40dc4){if(!_0xc40dc4){_0x45e1a8[_0x3a0c('0x17')](0x194);}return _0xc40dc4;};}function handleError(_0x161cb2,_0x4c3607){_0x4c3607=_0x4c3607||0x1f4;return function(_0x3998fb){logger[_0x3a0c('0x29')](_0x3998fb[_0x3a0c('0x2a')]);if(_0x3998fb['name']){delete _0x3998fb[_0x3a0c('0x2b')];}_0x161cb2['status'](_0x4c3607)[_0x3a0c('0x2c')](_0x3998fb);};}exports['index']=function(_0x5a62b6,_0x9012ce){var _0x54c9cb={},_0x5f2e48={},_0x332ce4={'count':0x0,'rows':[]};var _0x29b7bf=_[_0x3a0c('0x2d')](db[_0x3a0c('0x2e')][_0x3a0c('0x2f')],function(_0x341cca){return{'name':_0x341cca[_0x3a0c('0x30')],'type':_0x341cca[_0x3a0c('0x31')][_0x3a0c('0x32')]};});_0x5f2e48['model']=_[_0x3a0c('0x2d')](_0x29b7bf,_0x3a0c('0x2b'));_0x5f2e48[_0x3a0c('0x33')]=_[_0x3a0c('0x34')](_0x5a62b6[_0x3a0c('0x33')]);_0x5f2e48[_0x3a0c('0x35')]=_[_0x3a0c('0x36')](_0x5f2e48[_0x3a0c('0x37')],_0x5f2e48[_0x3a0c('0x33')]);_0x54c9cb[_0x3a0c('0x38')]=_[_0x3a0c('0x36')](_0x5f2e48[_0x3a0c('0x37')],qs['fields'](_0x5a62b6[_0x3a0c('0x33')]['fields']));_0x54c9cb[_0x3a0c('0x38')]=_0x54c9cb[_0x3a0c('0x38')]['length']?_0x54c9cb[_0x3a0c('0x38')]:_0x5f2e48[_0x3a0c('0x37')];if(!_0x5a62b6[_0x3a0c('0x33')][_0x3a0c('0x39')](_0x3a0c('0x3a'))){_0x54c9cb['limit']=qs['limit'](_0x5a62b6[_0x3a0c('0x33')][_0x3a0c('0x1d')]);_0x54c9cb[_0x3a0c('0x1b')]=qs[_0x3a0c('0x1b')](_0x5a62b6[_0x3a0c('0x33')][_0x3a0c('0x1b')]);}_0x54c9cb[_0x3a0c('0x3b')]=qs[_0x3a0c('0x3c')](_0x5a62b6[_0x3a0c('0x33')][_0x3a0c('0x3c')]);_0x54c9cb[_0x3a0c('0x3d')]=qs[_0x3a0c('0x35')](_[_0x3a0c('0x3e')](_0x5a62b6[_0x3a0c('0x33')],_0x5f2e48[_0x3a0c('0x35')]),_0x29b7bf);if(_0x5a62b6[_0x3a0c('0x33')][_0x3a0c('0x3f')]){_0x54c9cb['where']=_[_0x3a0c('0x40')](_0x54c9cb['where'],{'$or':_[_0x3a0c('0x2d')](_0x29b7bf,function(_0x41ac2d){if(_0x41ac2d[_0x3a0c('0x31')]!==_0x3a0c('0x41')){var _0x1796d7={};_0x1796d7[_0x41ac2d[_0x3a0c('0x2b')]]={'$like':'%'+_0x5a62b6[_0x3a0c('0x33')][_0x3a0c('0x3f')]+'%'};return _0x1796d7;}})});}_0x54c9cb=_['merge']({},_0x54c9cb,_0x5a62b6[_0x3a0c('0x42')]);var _0x5ef405={'where':_0x54c9cb[_0x3a0c('0x3d')]};return db[_0x3a0c('0x2e')][_0x3a0c('0x1e')](_0x5ef405)['then'](function(_0x36f866){_0x332ce4[_0x3a0c('0x1e')]=_0x36f866;if(_0x5a62b6['query'][_0x3a0c('0x43')]){_0x54c9cb[_0x3a0c('0x44')]=[{'all':!![]}];}return db['Template'][_0x3a0c('0x45')](_0x54c9cb);})[_0x3a0c('0x24')](function(_0x2a8b4a){_0x332ce4[_0x3a0c('0x46')]=_0x2a8b4a;return _0x332ce4;})[_0x3a0c('0x24')](respondWithFilteredResult(_0x9012ce,_0x54c9cb))['catch'](handleError(_0x9012ce,null));};exports['show']=function(_0x4c2508,_0x5d4ae3){var _0x3515e3={'raw':!![],'where':{'id':_0x4c2508['params']['id']}},_0x3bf8e0={};_0x3bf8e0[_0x3a0c('0x37')]=_[_0x3a0c('0x34')](db[_0x3a0c('0x2e')][_0x3a0c('0x2f')]);_0x3bf8e0['query']=_[_0x3a0c('0x34')](_0x4c2508['query']);_0x3bf8e0[_0x3a0c('0x35')]=_[_0x3a0c('0x36')](_0x3bf8e0[_0x3a0c('0x37')],_0x3bf8e0['query']);_0x3515e3[_0x3a0c('0x38')]=_[_0x3a0c('0x36')](_0x3bf8e0[_0x3a0c('0x37')],qs['fields'](_0x4c2508[_0x3a0c('0x33')][_0x3a0c('0x47')]));_0x3515e3[_0x3a0c('0x38')]=_0x3515e3[_0x3a0c('0x38')][_0x3a0c('0x48')]?_0x3515e3['attributes']:_0x3bf8e0[_0x3a0c('0x37')];if(_0x4c2508[_0x3a0c('0x33')][_0x3a0c('0x43')]){_0x3515e3[_0x3a0c('0x44')]=[{'all':!![]}];}_0x3515e3=_[_0x3a0c('0x40')]({},_0x3515e3,_0x4c2508[_0x3a0c('0x42')]);return db[_0x3a0c('0x2e')][_0x3a0c('0x49')](_0x3515e3)['then'](handleEntityNotFound(_0x5d4ae3,null))['then'](respondWithResult(_0x5d4ae3,null))[_0x3a0c('0x4a')](handleError(_0x5d4ae3,null));};exports['create']=function(_0x51a29c,_0x501261){return db['Template'][_0x3a0c('0x4b')](_0x51a29c[_0x3a0c('0x4c')],{})['then'](function(_0x3033b9){var _0x319c81=_0x51a29c[_0x3a0c('0x4d')][_0x3a0c('0x25')]({'plain':!![]});if(!_0x319c81)throw new Error(_0x3a0c('0x4e'));if(_0x319c81[_0x3a0c('0x4f')]==='user'){var _0x415e60=_0x3033b9['get']({'plain':!![]});var _0x10e91c=_0x3a0c('0x26');return db[_0x3a0c('0x50')][_0x3a0c('0x49')]({'where':{'name':_0x10e91c,'userProfileId':_0x319c81[_0x3a0c('0x51')]},'raw':!![]})[_0x3a0c('0x24')](function(_0x267945){if(_0x267945&&_0x267945[_0x3a0c('0x52')]===0x0){return db['UserProfileResource'][_0x3a0c('0x4b')]({'name':_0x415e60[_0x3a0c('0x2b')],'resourceId':_0x415e60['id'],'type':_0x267945['name'],'sectionId':_0x267945['id']},{})[_0x3a0c('0x24')](function(){return _0x3033b9;});}else{return _0x3033b9;}})[_0x3a0c('0x4a')](function(_0x4245ff){logger[_0x3a0c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4245ff);throw _0x4245ff;});}return _0x3033b9;})[_0x3a0c('0x24')](respondWithResult(_0x501261,0xc9))['catch'](handleError(_0x501261,null));};exports['update']=function(_0x3f2d02,_0xc59bcd){if(_0x3f2d02[_0x3a0c('0x4c')]['id']){delete _0x3f2d02['body']['id'];}return db[_0x3a0c('0x2e')][_0x3a0c('0x49')]({'where':{'id':_0x3f2d02['params']['id']}})[_0x3a0c('0x24')](handleEntityNotFound(_0xc59bcd,null))[_0x3a0c('0x24')](saveUpdates(_0x3f2d02[_0x3a0c('0x4c')],null))[_0x3a0c('0x24')](respondWithResult(_0xc59bcd,null))['catch'](handleError(_0xc59bcd,null));};exports['destroy']=function(_0x4ed96f,_0x20f729){return db[_0x3a0c('0x2e')][_0x3a0c('0x49')]({'where':{'id':_0x4ed96f[_0x3a0c('0x53')]['id']}})['then'](handleEntityNotFound(_0x20f729,null))[_0x3a0c('0x24')](removeEntity(_0x20f729,null))[_0x3a0c('0x4a')](handleError(_0x20f729,null));}; \ No newline at end of file +var _0x323f=['includeAll','include','catch','show','params','filters','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','Templates','UserProfileResource','destroy','error','stack','name','send','index','Template','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x52f363,_0xea6ad4){var _0x300612=function(_0x41b305){while(--_0x41b305){_0x52f363['push'](_0x52f363['shift']());}};_0x300612(++_0xea6ad4);}(_0x323f,0xba));var _0xf323=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x323f[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xf323('0x0'));var rimraf=require(_0xf323('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf323('0x2'));var rp=require(_0xf323('0x3'));var moment=require(_0xf323('0x4'));var BPromise=require('bluebird');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('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf323('0xa'));var squel=require(_0xf323('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf323('0xc'));var toCsv=require(_0xf323('0x9'));var querystring=require(_0xf323('0xd'));var Papa=require(_0xf323('0xe'));var Redis=require('ioredis');var authService=require(_0xf323('0xf'));var qs=require(_0xf323('0x10'));var as=require(_0xf323('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf323('0x12'))('api');var utils=require(_0xf323('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf323('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x604868,_0x1f15bb){_0x1f15bb=_0x1f15bb||0xcc;return function(_0x294dd2){if(_0x294dd2){return _0x604868[_0xf323('0x15')](_0x1f15bb);}return _0x604868[_0xf323('0x16')](_0x1f15bb)[_0xf323('0x17')]();};}function respondWithResult(_0x5a6530,_0x4616e2){_0x4616e2=_0x4616e2||0xc8;return function(_0x38215c){if(_0x38215c){return _0x5a6530[_0xf323('0x16')](_0x4616e2)['json'](_0x38215c);}};}function respondWithFilteredResult(_0x45d4f5,_0x462932){return function(_0x5d4895){if(_0x5d4895){var _0x381285=typeof _0x462932['offset']==='undefined'&&typeof _0x462932[_0xf323('0x18')]===_0xf323('0x19');var _0x10eb83=_0x5d4895[_0xf323('0x1a')];var _0xb2459b=_0x381285?0x0:_0x462932[_0xf323('0x1b')];var _0x16cd16=_0x381285?_0x5d4895[_0xf323('0x1a')]:_0x462932['offset']+_0x462932[_0xf323('0x18')];var _0x1dc76a;if(_0x16cd16>=_0x10eb83){_0x16cd16=_0x10eb83;_0x1dc76a=0xc8;}else{_0x1dc76a=0xce;}_0x45d4f5[_0xf323('0x16')](_0x1dc76a);return _0x45d4f5[_0xf323('0x1c')](_0xf323('0x1d'),_0xb2459b+'-'+_0x16cd16+'/'+_0x10eb83)[_0xf323('0x1e')](_0x5d4895);}return null;};}function patchUpdates(_0x472a0d){return function(_0x7e7f13){try{jsonpatch[_0xf323('0x1f')](_0x7e7f13,_0x472a0d,!![]);}catch(_0x14452f){return BPromise[_0xf323('0x20')](_0x14452f);}return _0x7e7f13[_0xf323('0x21')]();};}function saveUpdates(_0x493289,_0x531ab4){return function(_0x261847){if(_0x261847){return _0x261847[_0xf323('0x22')](_0x493289)[_0xf323('0x23')](function(_0x1aed38){return _0x1aed38;});}return null;};}function removeEntity(_0x41ce4a,_0x3e9be1){return function(_0x5d9e5c){if(_0x5d9e5c){return _0x5d9e5c['destroy']()['then'](function(){var _0x3581bb=_0x5d9e5c[_0xf323('0x24')]({'plain':!![]});var _0x53b047=_0xf323('0x25');return db[_0xf323('0x26')][_0xf323('0x27')]({'where':{'type':_0x53b047,'resourceId':_0x3581bb['id']}})[_0xf323('0x23')](function(){return _0x5d9e5c;});})[_0xf323('0x23')](function(){_0x41ce4a[_0xf323('0x16')](0xcc)[_0xf323('0x17')]();});}};}function handleEntityNotFound(_0x25f1c2,_0x8596f2){return function(_0x246dbb){if(!_0x246dbb){_0x25f1c2['sendStatus'](0x194);}return _0x246dbb;};}function handleError(_0x21a6a3,_0xec357){_0xec357=_0xec357||0x1f4;return function(_0x376945){logger[_0xf323('0x28')](_0x376945[_0xf323('0x29')]);if(_0x376945[_0xf323('0x2a')]){delete _0x376945['name'];}_0x21a6a3[_0xf323('0x16')](_0xec357)[_0xf323('0x2b')](_0x376945);};}exports[_0xf323('0x2c')]=function(_0x27fa97,_0x109ddb){var _0xf66ddc={},_0x301b00={},_0x5a6a40={'count':0x0,'rows':[]};var _0x1e761a=_['map'](db[_0xf323('0x2d')][_0xf323('0x2e')],function(_0x38bfc5){return{'name':_0x38bfc5[_0xf323('0x2f')],'type':_0x38bfc5['type'][_0xf323('0x30')]};});_0x301b00['model']=_[_0xf323('0x31')](_0x1e761a,_0xf323('0x2a'));_0x301b00[_0xf323('0x32')]=_[_0xf323('0x33')](_0x27fa97[_0xf323('0x32')]);_0x301b00['filters']=_[_0xf323('0x34')](_0x301b00[_0xf323('0x35')],_0x301b00['query']);_0xf66ddc['attributes']=_['intersection'](_0x301b00[_0xf323('0x35')],qs[_0xf323('0x36')](_0x27fa97[_0xf323('0x32')][_0xf323('0x36')]));_0xf66ddc[_0xf323('0x37')]=_0xf66ddc[_0xf323('0x37')]['length']?_0xf66ddc['attributes']:_0x301b00[_0xf323('0x35')];if(!_0x27fa97[_0xf323('0x32')][_0xf323('0x38')](_0xf323('0x39'))){_0xf66ddc['limit']=qs[_0xf323('0x18')](_0x27fa97[_0xf323('0x32')]['limit']);_0xf66ddc[_0xf323('0x1b')]=qs[_0xf323('0x1b')](_0x27fa97[_0xf323('0x32')][_0xf323('0x1b')]);}_0xf66ddc[_0xf323('0x3a')]=qs[_0xf323('0x3b')](_0x27fa97[_0xf323('0x32')][_0xf323('0x3b')]);_0xf66ddc[_0xf323('0x3c')]=qs['filters'](_[_0xf323('0x3d')](_0x27fa97['query'],_0x301b00['filters']),_0x1e761a);if(_0x27fa97[_0xf323('0x32')][_0xf323('0x3e')]){_0xf66ddc[_0xf323('0x3c')]=_[_0xf323('0x3f')](_0xf66ddc[_0xf323('0x3c')],{'$or':_['map'](_0x1e761a,function(_0x3b9e8b){if(_0x3b9e8b[_0xf323('0x40')]!==_0xf323('0x41')){var _0x3257c6={};_0x3257c6[_0x3b9e8b['name']]={'$like':'%'+_0x27fa97[_0xf323('0x32')][_0xf323('0x3e')]+'%'};return _0x3257c6;}})});}_0xf66ddc=_[_0xf323('0x3f')]({},_0xf66ddc,_0x27fa97['options']);var _0x49a7a5={'where':_0xf66ddc['where']};return db['Template']['count'](_0x49a7a5)['then'](function(_0x2827f5){_0x5a6a40[_0xf323('0x1a')]=_0x2827f5;if(_0x27fa97['query'][_0xf323('0x42')]){_0xf66ddc[_0xf323('0x43')]=[{'all':!![]}];}return db[_0xf323('0x2d')]['findAll'](_0xf66ddc);})[_0xf323('0x23')](function(_0x26973f){_0x5a6a40['rows']=_0x26973f;return _0x5a6a40;})['then'](respondWithFilteredResult(_0x109ddb,_0xf66ddc))[_0xf323('0x44')](handleError(_0x109ddb,null));};exports[_0xf323('0x45')]=function(_0x495407,_0x2223ad){var _0x28d873={'raw':!![],'where':{'id':_0x495407[_0xf323('0x46')]['id']}},_0x37688c={};_0x37688c[_0xf323('0x35')]=_[_0xf323('0x33')](db[_0xf323('0x2d')][_0xf323('0x2e')]);_0x37688c[_0xf323('0x32')]=_[_0xf323('0x33')](_0x495407[_0xf323('0x32')]);_0x37688c[_0xf323('0x47')]=_[_0xf323('0x34')](_0x37688c[_0xf323('0x35')],_0x37688c[_0xf323('0x32')]);_0x28d873[_0xf323('0x37')]=_[_0xf323('0x34')](_0x37688c['model'],qs[_0xf323('0x36')](_0x495407[_0xf323('0x32')][_0xf323('0x36')]));_0x28d873['attributes']=_0x28d873[_0xf323('0x37')][_0xf323('0x48')]?_0x28d873[_0xf323('0x37')]:_0x37688c[_0xf323('0x35')];if(_0x495407['query'][_0xf323('0x42')]){_0x28d873[_0xf323('0x43')]=[{'all':!![]}];}_0x28d873=_[_0xf323('0x3f')]({},_0x28d873,_0x495407[_0xf323('0x49')]);return db[_0xf323('0x2d')][_0xf323('0x4a')](_0x28d873)['then'](handleEntityNotFound(_0x2223ad,null))[_0xf323('0x23')](respondWithResult(_0x2223ad,null))[_0xf323('0x44')](handleError(_0x2223ad,null));};exports[_0xf323('0x4b')]=function(_0x4b5799,_0x5e8b09){return db[_0xf323('0x2d')]['create'](_0x4b5799[_0xf323('0x4c')],{})[_0xf323('0x23')](function(_0x2bc68e){var _0x192f6f=_0x4b5799[_0xf323('0x4d')][_0xf323('0x24')]({'plain':!![]});if(!_0x192f6f)throw new Error(_0xf323('0x4e'));if(_0x192f6f[_0xf323('0x4f')]===_0xf323('0x4d')){var _0x4c8825=_0x2bc68e[_0xf323('0x24')]({'plain':!![]});var _0x178e09=_0xf323('0x25');return db[_0xf323('0x50')][_0xf323('0x4a')]({'where':{'name':_0x178e09,'userProfileId':_0x192f6f[_0xf323('0x51')]},'raw':!![]})['then'](function(_0x50e9d7){if(_0x50e9d7&&_0x50e9d7[_0xf323('0x52')]===0x0){return db[_0xf323('0x26')][_0xf323('0x4b')]({'name':_0x4c8825['name'],'resourceId':_0x4c8825['id'],'type':_0x50e9d7['name'],'sectionId':_0x50e9d7['id']},{})[_0xf323('0x23')](function(){return _0x2bc68e;});}else{return _0x2bc68e;}})[_0xf323('0x44')](function(_0x8f91d5){logger['error'](_0xf323('0x53'),_0x8f91d5);throw _0x8f91d5;});}return _0x2bc68e;})[_0xf323('0x23')](respondWithResult(_0x5e8b09,0xc9))[_0xf323('0x44')](handleError(_0x5e8b09,null));};exports['update']=function(_0x2c0f18,_0x37c521){if(_0x2c0f18[_0xf323('0x4c')]['id']){delete _0x2c0f18[_0xf323('0x4c')]['id'];}return db[_0xf323('0x2d')][_0xf323('0x4a')]({'where':{'id':_0x2c0f18['params']['id']}})['then'](handleEntityNotFound(_0x37c521,null))[_0xf323('0x23')](saveUpdates(_0x2c0f18['body'],null))['then'](respondWithResult(_0x37c521,null))[_0xf323('0x44')](handleError(_0x37c521,null));};exports['destroy']=function(_0x1b30a3,_0x3d7379){return db[_0xf323('0x2d')][_0xf323('0x4a')]({'where':{'id':_0x1b30a3[_0xf323('0x46')]['id']}})[_0xf323('0x23')](handleEntityNotFound(_0x3d7379,null))[_0xf323('0x23')](removeEntity(_0x3d7379,null))[_0xf323('0x44')](handleError(_0x3d7379,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index ecfb0ec..08f38d5 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 _0xbaa7=['path','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42e801,_0x31dd96){var _0x399986=function(_0x438d1d){while(--_0x438d1d){_0x42e801['push'](_0x42e801['shift']());}};_0x399986(++_0x31dd96);}(_0xbaa7,0x125));var _0x7baa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbaa7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7baa('0x0'));var util=require(_0x7baa('0x1'));var logger=require(_0x7baa('0x2'))(_0x7baa('0x3'));var moment=require(_0x7baa('0x4'));var BPromise=require(_0x7baa('0x5'));var rp=require(_0x7baa('0x6'));var fs=require('fs');var path=require(_0x7baa('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7baa('0x8'));module['exports']=function(_0x88866a,_0x1bd332){return _0x88866a[_0x7baa('0x9')](_0x7baa('0xa'),attributes,{'tableName':_0x7baa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3f6=['Template','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x565569,_0x5c0375){var _0x1ac5da=function(_0x1f052b){while(--_0x1f052b){_0x565569['push'](_0x565569['shift']());}};_0x1ac5da(++_0x5c0375);}(_0xc3f6,0x160));var _0x6c3f=function(_0xd389d6,_0x26c1d7){_0xd389d6=_0xd389d6-0x0;var _0x304dd2=_0xc3f6[_0xd389d6];return _0x304dd2;};'use strict';var _=require(_0x6c3f('0x0'));var util=require(_0x6c3f('0x1'));var logger=require(_0x6c3f('0x2'))(_0x6c3f('0x3'));var moment=require(_0x6c3f('0x4'));var BPromise=require(_0x6c3f('0x5'));var rp=require(_0x6c3f('0x6'));var fs=require('fs');var path=require(_0x6c3f('0x7'));var rimraf=require(_0x6c3f('0x8'));var config=require(_0x6c3f('0x9'));var attributes=require('./template.attributes');module[_0x6c3f('0xa')]=function(_0x3d25f7,_0xeb3909){return _0x3d25f7[_0x6c3f('0xb')](_0x6c3f('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 1b6cc50..b5f9a2a 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 _0x2695=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','lodash','util'];(function(_0x97f2cd,_0xced1ba){var _0x519d26=function(_0xffa28){while(--_0xffa28){_0x97f2cd['push'](_0x97f2cd['shift']());}};_0x519d26(++_0xced1ba);}(_0x2695,0x7e));var _0x5269=function(_0x43297e,_0x560e55){_0x43297e=_0x43297e-0x0;var _0x308493=_0x2695[_0x43297e];return _0x308493;};'use strict';var _=require(_0x5269('0x0'));var util=require(_0x5269('0x1'));var moment=require(_0x5269('0x2'));var BPromise=require(_0x5269('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5269('0x4'))['db'];var utils=require(_0x5269('0x5'));var logger=require(_0x5269('0x6'))(_0x5269('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5269('0x8')][_0x5269('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5902b2,_0x32ad4c,_0x4c6d7a){return new BPromise(function(_0x2fc60a,_0x275240){return client['request'](_0x5902b2,_0x4c6d7a)[_0x5269('0xa')](function(_0x28242e){logger[_0x5269('0xb')](_0x5269('0xc'),_0x32ad4c,'request\x20sent');logger[_0x5269('0xd')](_0x5269('0xe'),_0x32ad4c,_0x5269('0xf'),JSON[_0x5269('0x10')](_0x28242e));if(_0x28242e[_0x5269('0x11')]){if(_0x28242e[_0x5269('0x11')][_0x5269('0x12')]===0x1f4){logger[_0x5269('0x11')](_0x5269('0xc'),_0x32ad4c,_0x28242e[_0x5269('0x11')]['message']);return _0x275240(_0x28242e[_0x5269('0x11')][_0x5269('0x13')]);}logger[_0x5269('0x11')]('Template,\x20%s,\x20%s',_0x32ad4c,_0x28242e[_0x5269('0x11')]['message']);return _0x2fc60a(_0x28242e['error'][_0x5269('0x13')]);}else{logger[_0x5269('0xb')](_0x5269('0xc'),_0x32ad4c,_0x5269('0xf'));_0x2fc60a(_0x28242e[_0x5269('0x14')]['message']);}})[_0x5269('0x15')](function(_0x43f347){logger[_0x5269('0x11')](_0x5269('0xc'),_0x32ad4c,_0x43f347);_0x275240(_0x43f347);});});}exports[_0x5269('0x16')]=function(_0x4ac8d1){var _0x26dcc1=this;return new Promise(function(_0x26f150,_0x3a2664){return db[_0x5269('0x17')][_0x5269('0x18')]({'raw':_0x4ac8d1[_0x5269('0x19')]?_0x4ac8d1[_0x5269('0x19')][_0x5269('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ac8d1[_0x5269('0x19')]?_0x4ac8d1['options']['where']||null:null,'attributes':_0x4ac8d1[_0x5269('0x19')]?_0x4ac8d1['options'][_0x5269('0x1b')]||null:null,'limit':_0x4ac8d1[_0x5269('0x19')]?_0x4ac8d1[_0x5269('0x19')][_0x5269('0x1c')]||null:null,'include':_0x4ac8d1[_0x5269('0x19')]?_0x4ac8d1[_0x5269('0x19')][_0x5269('0x1d')]?_[_0x5269('0x1e')](_0x4ac8d1[_0x5269('0x19')][_0x5269('0x1d')],function(_0x561490){return{'model':db[_0x561490['model']],'as':_0x561490['as'],'attributes':_0x561490['attributes'],'include':_0x561490['include']?_[_0x5269('0x1e')](_0x561490[_0x5269('0x1d')],function(_0x14eeae){return{'model':db[_0x14eeae[_0x5269('0x1f')]],'as':_0x14eeae['as'],'attributes':_0x14eeae[_0x5269('0x1b')],'include':_0x14eeae[_0x5269('0x1d')]?_[_0x5269('0x1e')](_0x14eeae[_0x5269('0x1d')],function(_0xa3687e){return{'model':db[_0xa3687e[_0x5269('0x1f')]],'as':_0xa3687e['as'],'attributes':_0xa3687e[_0x5269('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd3aaaf){logger['info']('GetTemplate',_0x4ac8d1);logger['debug'](_0x5269('0x16'),_0x4ac8d1,JSON[_0x5269('0x10')](_0xd3aaaf));_0x26f150(_0xd3aaaf);})[_0x5269('0x15')](function(_0x3d5729){logger[_0x5269('0x11')](_0x5269('0x16'),_0x3d5729[_0x5269('0x13')],_0x4ac8d1);_0x3a2664(_0x26dcc1[_0x5269('0x11')](0x1f4,_0x3d5729[_0x5269('0x13')]));});});}; \ No newline at end of file +var _0xba6f=['catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetTemplate','Template','findAll','raw','options','attributes','include','model','map'];(function(_0xccb4e7,_0x418ce4){var _0x1ab90c=function(_0x19cc83){while(--_0x19cc83){_0xccb4e7['push'](_0xccb4e7['shift']());}};_0x1ab90c(++_0x418ce4);}(_0xba6f,0xb5));var _0xfba6=function(_0x25b854,_0x2e19ff){_0x25b854=_0x25b854-0x0;var _0x35bcd8=_0xba6f[_0x25b854];return _0x35bcd8;};'use strict';var _=require(_0xfba6('0x0'));var util=require(_0xfba6('0x1'));var moment=require(_0xfba6('0x2'));var BPromise=require(_0xfba6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfba6('0x4'));var logger=require(_0xfba6('0x5'))('rpc');var config=require(_0xfba6('0x6'));var jayson=require(_0xfba6('0x7'));var client=jayson[_0xfba6('0x8')][_0xfba6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23a8fc,_0x343847,_0x125e02){return new BPromise(function(_0x54f268,_0x1937f4){return client['request'](_0x23a8fc,_0x125e02)[_0xfba6('0xa')](function(_0x53fcdc){logger[_0xfba6('0xb')](_0xfba6('0xc'),_0x343847,_0xfba6('0xd'));logger[_0xfba6('0xe')](_0xfba6('0xf'),_0x343847,_0xfba6('0xd'),JSON[_0xfba6('0x10')](_0x53fcdc));if(_0x53fcdc[_0xfba6('0x11')]){if(_0x53fcdc[_0xfba6('0x11')]['code']===0x1f4){logger[_0xfba6('0x11')](_0xfba6('0xc'),_0x343847,_0x53fcdc[_0xfba6('0x11')][_0xfba6('0x12')]);return _0x1937f4(_0x53fcdc[_0xfba6('0x11')]['message']);}logger[_0xfba6('0x11')](_0xfba6('0xc'),_0x343847,_0x53fcdc[_0xfba6('0x11')][_0xfba6('0x12')]);return _0x54f268(_0x53fcdc['error'][_0xfba6('0x12')]);}else{logger[_0xfba6('0xb')](_0xfba6('0xc'),_0x343847,_0xfba6('0xd'));_0x54f268(_0x53fcdc[_0xfba6('0x13')][_0xfba6('0x12')]);}})['catch'](function(_0x47350e){logger[_0xfba6('0x11')](_0xfba6('0xc'),_0x343847,_0x47350e);_0x1937f4(_0x47350e);});});}exports[_0xfba6('0x14')]=function(_0x471f38){var _0x2a75ed=this;return new Promise(function(_0x4e56eb,_0x470fa0){return db[_0xfba6('0x15')][_0xfba6('0x16')]({'raw':_0x471f38['options']?_0x471f38['options'][_0xfba6('0x17')]===undefined?!![]:![]:!![],'where':_0x471f38[_0xfba6('0x18')]?_0x471f38[_0xfba6('0x18')]['where']||null:null,'attributes':_0x471f38[_0xfba6('0x18')]?_0x471f38[_0xfba6('0x18')][_0xfba6('0x19')]||null:null,'limit':_0x471f38[_0xfba6('0x18')]?_0x471f38[_0xfba6('0x18')]['limit']||null:null,'include':_0x471f38[_0xfba6('0x18')]?_0x471f38[_0xfba6('0x18')]['include']?_['map'](_0x471f38[_0xfba6('0x18')][_0xfba6('0x1a')],function(_0x52885e){return{'model':db[_0x52885e[_0xfba6('0x1b')]],'as':_0x52885e['as'],'attributes':_0x52885e[_0xfba6('0x19')],'include':_0x52885e[_0xfba6('0x1a')]?_[_0xfba6('0x1c')](_0x52885e[_0xfba6('0x1a')],function(_0x357a1d){return{'model':db[_0x357a1d[_0xfba6('0x1b')]],'as':_0x357a1d['as'],'attributes':_0x357a1d[_0xfba6('0x19')],'include':_0x357a1d['include']?_[_0xfba6('0x1c')](_0x357a1d['include'],function(_0x363aa2){return{'model':db[_0x363aa2['model']],'as':_0x363aa2['as'],'attributes':_0x363aa2[_0xfba6('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfba6('0xa')](function(_0x26f2af){logger[_0xfba6('0xb')]('GetTemplate',_0x471f38);logger[_0xfba6('0xe')]('GetTemplate',_0x471f38,JSON[_0xfba6('0x10')](_0x26f2af));_0x4e56eb(_0x26f2af);})[_0xfba6('0x1d')](function(_0x5f08fd){logger[_0xfba6('0x11')]('GetTemplate',_0x5f08fd[_0xfba6('0x12')],_0x471f38);_0x470fa0(_0x2a75ed[_0xfba6('0x11')](0x1f4,_0x5f08fd['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 14d4b17..1435f56 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 _0xd01c=['post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0xd01c,0xfb));var _0xcd01=function(_0xc398a7,_0x5ad7e2){_0xc398a7=_0xc398a7-0x0;var _0x5a7f06=_0xd01c[_0xc398a7];return _0x5a7f06;};'use strict';var multer=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var path=require(_0xcd01('0x2'));var timeout=require(_0xcd01('0x3'));var express=require(_0xcd01('0x4'));var router=express['Router']();var fs_extra=require(_0xcd01('0x5'));var auth=require(_0xcd01('0x6'));var interaction=require(_0xcd01('0x7'));var config=require('../../config/environment');var controller=require(_0xcd01('0x8'));router[_0xcd01('0x9')]('/',auth[_0xcd01('0xa')](),controller[_0xcd01('0xb')]);router['get'](_0xcd01('0xc'),auth[_0xcd01('0xa')](),controller[_0xcd01('0xd')]);router[_0xcd01('0x9')](_0xcd01('0xe'),auth['isAuthenticated'](),controller[_0xcd01('0xf')]);router[_0xcd01('0x9')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xcd01('0x10')]);router[_0xcd01('0x9')](_0xcd01('0x11'),auth['isAuthenticated'](),controller[_0xcd01('0x12')]);router[_0xcd01('0x13')]('/',auth[_0xcd01('0xa')](),controller[_0xcd01('0x14')]);router['post'](_0xcd01('0xe'),auth[_0xcd01('0xa')](),controller[_0xcd01('0x15')]);router[_0xcd01('0x13')](_0xcd01('0x16'),auth['isAuthenticated'](),controller[_0xcd01('0x17')]);router[_0xcd01('0x13')]('/:id/actions',auth['isAuthenticated'](),controller[_0xcd01('0x18')]);router['put'](_0xcd01('0xc'),auth['isAuthenticated'](),controller[_0xcd01('0x19')]);router['delete'](_0xcd01('0xc'),auth[_0xcd01('0xa')](),controller['destroy']);module[_0xcd01('0x1a')]=router; \ No newline at end of file +var _0x3cde=['/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','addAllCondition','post','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','index','get','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions'];(function(_0x48855b,_0x215fd6){var _0x4b527e=function(_0x3ed36c){while(--_0x3ed36c){_0x48855b['push'](_0x48855b['shift']());}};_0x4b527e(++_0x215fd6);}(_0x3cde,0x1d5));var _0xe3cd=function(_0x27f32f,_0x3e3104){_0x27f32f=_0x27f32f-0x0;var _0x5a9a59=_0x3cde[_0x27f32f];return _0x5a9a59;};'use strict';var multer=require(_0xe3cd('0x0'));var util=require(_0xe3cd('0x1'));var path=require(_0xe3cd('0x2'));var timeout=require(_0xe3cd('0x3'));var express=require('express');var router=express[_0xe3cd('0x4')]();var fs_extra=require(_0xe3cd('0x5'));var auth=require(_0xe3cd('0x6'));var interaction=require(_0xe3cd('0x7'));var config=require(_0xe3cd('0x8'));var controller=require(_0xe3cd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe3cd('0xa')]);router[_0xe3cd('0xb')](_0xe3cd('0xc'),auth[_0xe3cd('0xd')](),controller[_0xe3cd('0xe')]);router['get'](_0xe3cd('0xf'),auth[_0xe3cd('0xd')](),controller[_0xe3cd('0x10')]);router[_0xe3cd('0xb')](_0xe3cd('0x11'),auth[_0xe3cd('0xd')](),controller[_0xe3cd('0x12')]);router['get'](_0xe3cd('0x13'),auth['isAuthenticated'](),controller[_0xe3cd('0x14')]);router['post']('/',auth[_0xe3cd('0xd')](),controller[_0xe3cd('0x15')]);router['post']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xe3cd('0x16')]);router[_0xe3cd('0x17')](_0xe3cd('0x11'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xe3cd('0x17')]('/:id/actions',auth[_0xe3cd('0xd')](),controller['addAction']);router['put'](_0xe3cd('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe3cd('0x18')](_0xe3cd('0xc'),auth[_0xe3cd('0xd')](),controller[_0xe3cd('0x19')]);module[_0xe3cd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 50137c7..d0d44e9 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 _0x474b=['sequelize','STRING'];(function(_0x136a01,_0x3e0f10){var _0x39ccee=function(_0x1fa530){while(--_0x1fa530){_0x136a01['push'](_0x136a01['shift']());}};_0x39ccee(++_0x3e0f10);}(_0x474b,0x9e));var _0xb474=function(_0x22fe76,_0x51a83c){_0x22fe76=_0x22fe76-0x0;var _0x153397=_0x474b[_0x22fe76];return _0x153397;};'use strict';var Sequelize=require(_0xb474('0x0'));module['exports']={'name':{'type':Sequelize[_0xb474('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x07b2=['sequelize','STRING','BOOLEAN'];(function(_0x41e507,_0x694b79){var _0x3bbe37=function(_0x2df851){while(--_0x2df851){_0x41e507['push'](_0x41e507['shift']());}};_0x3bbe37(++_0x694b79);}(_0x07b2,0x84));var _0x207b=function(_0x2d55c6,_0x1eb4a2){_0x2d55c6=_0x2d55c6-0x0;var _0x15f981=_0x07b2[_0x2d55c6];return _0x15f981;};'use strict';var Sequelize=require(_0x207b('0x0'));module['exports']={'name':{'type':Sequelize[_0x207b('0x1')]},'channel':{'type':Sequelize[_0x207b('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x207b('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 52fa187..7409f1c 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 _0xe3d7=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','Trigger','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','options','getAllConditions','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring'];(function(_0x53aefd,_0x4c20f0){var _0x45a8b8=function(_0x3eecb8){while(--_0x3eecb8){_0x53aefd['push'](_0x53aefd['shift']());}};_0x45a8b8(++_0x4c20f0);}(_0xe3d7,0x110));var _0x7e3d=function(_0x234073,_0x32ac52){_0x234073=_0x234073-0x0;var _0x54e57b=_0xe3d7[_0x234073];return _0x54e57b;};'use strict';var emlformat=require(_0x7e3d('0x0'));var rimraf=require(_0x7e3d('0x1'));var zipdir=require(_0x7e3d('0x2'));var jsonpatch=require(_0x7e3d('0x3'));var rp=require(_0x7e3d('0x4'));var moment=require(_0x7e3d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7e3d('0x6'));var util=require(_0x7e3d('0x7'));var path=require(_0x7e3d('0x8'));var sox=require(_0x7e3d('0x9'));var csv=require(_0x7e3d('0xa'));var ejs=require(_0x7e3d('0xb'));var fs=require('fs');var fs_extra=require(_0x7e3d('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7e3d('0xd'));var jsforce=require(_0x7e3d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7e3d('0xa'));var querystring=require(_0x7e3d('0xf'));var Papa=require(_0x7e3d('0x10'));var Redis=require(_0x7e3d('0x11'));var authService=require(_0x7e3d('0x12'));var qs=require(_0x7e3d('0x13'));var as=require(_0x7e3d('0x14'));var hardwareService=require(_0x7e3d('0x15'));var logger=require('../../config/logger')(_0x7e3d('0x16'));var utils=require('../../config/utils');var config=require(_0x7e3d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e3d('0x18'))['db'];function respondWithStatusCode(_0x1b8ebb,_0x13dc66){_0x13dc66=_0x13dc66||0xcc;return function(_0x247b0e){if(_0x247b0e){return _0x1b8ebb[_0x7e3d('0x19')](_0x13dc66);}return _0x1b8ebb['status'](_0x13dc66)[_0x7e3d('0x1a')]();};}function respondWithResult(_0x33c1e8,_0x598c4b){_0x598c4b=_0x598c4b||0xc8;return function(_0x29d3f3){if(_0x29d3f3){return _0x33c1e8['status'](_0x598c4b)[_0x7e3d('0x1b')](_0x29d3f3);}};}function respondWithFilteredResult(_0x164b95,_0x1c8434){return function(_0x1519ae){if(_0x1519ae){var _0x409575=typeof _0x1c8434[_0x7e3d('0x1c')]===_0x7e3d('0x1d')&&typeof _0x1c8434['limit']===_0x7e3d('0x1d');var _0x1d4bad=_0x1519ae[_0x7e3d('0x1e')];var _0x234710=_0x409575?0x0:_0x1c8434[_0x7e3d('0x1c')];var _0x32ae45=_0x409575?_0x1519ae['count']:_0x1c8434[_0x7e3d('0x1c')]+_0x1c8434[_0x7e3d('0x1f')];var _0x29c700;if(_0x32ae45>=_0x1d4bad){_0x32ae45=_0x1d4bad;_0x29c700=0xc8;}else{_0x29c700=0xce;}_0x164b95[_0x7e3d('0x20')](_0x29c700);return _0x164b95[_0x7e3d('0x21')](_0x7e3d('0x22'),_0x234710+'-'+_0x32ae45+'/'+_0x1d4bad)[_0x7e3d('0x1b')](_0x1519ae);}return null;};}function patchUpdates(_0x380465){return function(_0x40ab75){try{jsonpatch[_0x7e3d('0x23')](_0x40ab75,_0x380465,!![]);}catch(_0x569d06){return BPromise[_0x7e3d('0x24')](_0x569d06);}return _0x40ab75['save']();};}function saveUpdates(_0x71d143,_0x54e9a9){return function(_0x509dd8){if(_0x509dd8){return _0x509dd8[_0x7e3d('0x25')](_0x71d143)[_0x7e3d('0x26')](function(_0x2a1c05){return _0x2a1c05;});}return null;};}function removeEntity(_0x19a36a,_0x3523a3){return function(_0x134669){if(_0x134669){return _0x134669[_0x7e3d('0x27')]()[_0x7e3d('0x26')](function(){var _0x46df60=_0x134669[_0x7e3d('0x28')]({'plain':!![]});var _0x4933ef=_0x7e3d('0x29');return db[_0x7e3d('0x2a')][_0x7e3d('0x27')]({'where':{'type':_0x4933ef,'resourceId':_0x46df60['id']}})[_0x7e3d('0x26')](function(){return _0x134669;});})[_0x7e3d('0x26')](function(){_0x19a36a[_0x7e3d('0x20')](0xcc)[_0x7e3d('0x1a')]();});}};}function handleEntityNotFound(_0x39e12d,_0x3cc889){return function(_0x27e745){if(!_0x27e745){_0x39e12d[_0x7e3d('0x19')](0x194);}return _0x27e745;};}function handleError(_0x591bf7,_0x45de25){_0x45de25=_0x45de25||0x1f4;return function(_0x3ebba7){logger[_0x7e3d('0x2b')](_0x3ebba7[_0x7e3d('0x2c')]);if(_0x3ebba7[_0x7e3d('0x2d')]){delete _0x3ebba7[_0x7e3d('0x2d')];}_0x591bf7['status'](_0x45de25)[_0x7e3d('0x2e')](_0x3ebba7);};}exports['index']=function(_0x21d250,_0x554bee){var _0x234a5f={},_0x4da462={},_0x1147bd={'count':0x0,'rows':[]};var _0x2a00c5=_['map'](db[_0x7e3d('0x2f')]['rawAttributes'],function(_0x2e572b){return{'name':_0x2e572b[_0x7e3d('0x30')],'type':_0x2e572b[_0x7e3d('0x31')][_0x7e3d('0x32')]};});_0x4da462['model']=_[_0x7e3d('0x33')](_0x2a00c5,_0x7e3d('0x2d'));_0x4da462[_0x7e3d('0x34')]=_[_0x7e3d('0x35')](_0x21d250[_0x7e3d('0x34')]);_0x4da462[_0x7e3d('0x36')]=_[_0x7e3d('0x37')](_0x4da462['model'],_0x4da462[_0x7e3d('0x34')]);_0x234a5f['attributes']=_[_0x7e3d('0x37')](_0x4da462[_0x7e3d('0x38')],qs[_0x7e3d('0x39')](_0x21d250[_0x7e3d('0x34')]['fields']));_0x234a5f[_0x7e3d('0x3a')]=_0x234a5f[_0x7e3d('0x3a')][_0x7e3d('0x3b')]?_0x234a5f['attributes']:_0x4da462['model'];if(!_0x21d250[_0x7e3d('0x34')]['hasOwnProperty'](_0x7e3d('0x3c'))){_0x234a5f[_0x7e3d('0x1f')]=qs[_0x7e3d('0x1f')](_0x21d250[_0x7e3d('0x34')][_0x7e3d('0x1f')]);_0x234a5f[_0x7e3d('0x1c')]=qs['offset'](_0x21d250[_0x7e3d('0x34')][_0x7e3d('0x1c')]);}_0x234a5f[_0x7e3d('0x3d')]=qs['sort'](_0x21d250[_0x7e3d('0x34')][_0x7e3d('0x3e')]);_0x234a5f[_0x7e3d('0x3f')]=qs['filters'](_[_0x7e3d('0x40')](_0x21d250[_0x7e3d('0x34')],_0x4da462['filters']),_0x2a00c5);if(_0x21d250[_0x7e3d('0x34')][_0x7e3d('0x41')]){_0x234a5f[_0x7e3d('0x3f')]=_[_0x7e3d('0x42')](_0x234a5f[_0x7e3d('0x3f')],{'$or':_['map'](_0x2a00c5,function(_0x2543cc){if(_0x2543cc[_0x7e3d('0x31')]!==_0x7e3d('0x43')){var _0x240ea1={};_0x240ea1[_0x2543cc[_0x7e3d('0x2d')]]={'$like':'%'+_0x21d250[_0x7e3d('0x34')]['filter']+'%'};return _0x240ea1;}})});}_0x234a5f=_[_0x7e3d('0x42')]({},_0x234a5f,_0x21d250['options']);var _0x5ee0ff={'where':_0x234a5f[_0x7e3d('0x3f')]};return db['Trigger'][_0x7e3d('0x1e')](_0x5ee0ff)[_0x7e3d('0x26')](function(_0x4f6f25){_0x1147bd[_0x7e3d('0x1e')]=_0x4f6f25;if(_0x21d250[_0x7e3d('0x34')][_0x7e3d('0x44')]){_0x234a5f['include']=[{'all':!![]}];}return db['Trigger'][_0x7e3d('0x45')](_0x234a5f);})[_0x7e3d('0x26')](function(_0x1c410d){_0x1147bd['rows']=_0x1c410d;return _0x1147bd;})['then'](respondWithFilteredResult(_0x554bee,_0x234a5f))[_0x7e3d('0x46')](handleError(_0x554bee,null));};exports[_0x7e3d('0x47')]=function(_0x4842c5,_0x37c7e0){var _0x48e1e1={'raw':![],'where':{'id':_0x4842c5['params']['id']}},_0x1b47d7={};_0x1b47d7[_0x7e3d('0x38')]=_[_0x7e3d('0x35')](db[_0x7e3d('0x2f')][_0x7e3d('0x48')]);_0x1b47d7[_0x7e3d('0x34')]=_[_0x7e3d('0x35')](_0x4842c5[_0x7e3d('0x34')]);_0x1b47d7['filters']=_[_0x7e3d('0x37')](_0x1b47d7[_0x7e3d('0x38')],_0x1b47d7['query']);_0x48e1e1['attributes']=_[_0x7e3d('0x37')](_0x1b47d7['model'],qs[_0x7e3d('0x39')](_0x4842c5[_0x7e3d('0x34')]['fields']));_0x48e1e1[_0x7e3d('0x3a')]=_0x48e1e1[_0x7e3d('0x3a')][_0x7e3d('0x3b')]?_0x48e1e1[_0x7e3d('0x3a')]:_0x1b47d7[_0x7e3d('0x38')];if(_0x4842c5['query']['includeAll']){_0x48e1e1['include']=[{'all':!![]}];}_0x48e1e1=_[_0x7e3d('0x42')]({},_0x48e1e1,_0x4842c5['options']);return db['Trigger'][_0x7e3d('0x49')](_0x48e1e1)[_0x7e3d('0x26')](handleEntityNotFound(_0x37c7e0,null))[_0x7e3d('0x26')](respondWithResult(_0x37c7e0,null))['catch'](handleError(_0x37c7e0,null));};exports[_0x7e3d('0x4a')]=function(_0x59bd25,_0x513a06){return db[_0x7e3d('0x2f')][_0x7e3d('0x4a')](_0x59bd25[_0x7e3d('0x4b')],{})[_0x7e3d('0x26')](function(_0x58c367){var _0x27818e=_0x59bd25[_0x7e3d('0x4c')][_0x7e3d('0x28')]({'plain':!![]});if(!_0x27818e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27818e[_0x7e3d('0x4d')]===_0x7e3d('0x4c')){var _0x36d0eb=_0x58c367[_0x7e3d('0x28')]({'plain':!![]});var _0x6398c1=_0x7e3d('0x29');return db['UserProfileSection'][_0x7e3d('0x49')]({'where':{'name':_0x6398c1,'userProfileId':_0x27818e[_0x7e3d('0x4e')]},'raw':!![]})[_0x7e3d('0x26')](function(_0x563f41){if(_0x563f41&&_0x563f41[_0x7e3d('0x4f')]===0x0){return db[_0x7e3d('0x2a')]['create']({'name':_0x36d0eb[_0x7e3d('0x2d')],'resourceId':_0x36d0eb['id'],'type':_0x563f41[_0x7e3d('0x2d')],'sectionId':_0x563f41['id']},{})[_0x7e3d('0x26')](function(){return _0x58c367;});}else{return _0x58c367;}})[_0x7e3d('0x46')](function(_0x111df4){logger[_0x7e3d('0x2b')](_0x7e3d('0x50'),_0x111df4);throw _0x111df4;});}return _0x58c367;})[_0x7e3d('0x26')](respondWithResult(_0x513a06,0xc9))['catch'](handleError(_0x513a06,null));};exports[_0x7e3d('0x25')]=function(_0x4f6e9b,_0x4d10f2){if(_0x4f6e9b['body']['id']){delete _0x4f6e9b[_0x7e3d('0x4b')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4f6e9b[_0x7e3d('0x51')]['id']}})[_0x7e3d('0x26')](handleEntityNotFound(_0x4d10f2,null))[_0x7e3d('0x26')](saveUpdates(_0x4f6e9b[_0x7e3d('0x4b')],null))['then'](respondWithResult(_0x4d10f2,null))[_0x7e3d('0x46')](handleError(_0x4d10f2,null));};exports[_0x7e3d('0x27')]=function(_0x47c7cd,_0x38a014){return db[_0x7e3d('0x2f')][_0x7e3d('0x49')]({'where':{'id':_0x47c7cd[_0x7e3d('0x51')]['id']}})[_0x7e3d('0x26')](handleEntityNotFound(_0x38a014,null))[_0x7e3d('0x26')](removeEntity(_0x38a014,null))[_0x7e3d('0x46')](handleError(_0x38a014,null));};exports[_0x7e3d('0x52')]=function(_0x4d58b5,_0x443aea,_0x163606){if(_0x4d58b5[_0x7e3d('0x4b')]['id']){delete _0x4d58b5[_0x7e3d('0x4b')]['id'];}return db[_0x7e3d('0x2f')][_0x7e3d('0x49')]({'where':{'id':_0x4d58b5[_0x7e3d('0x51')]['id']}})[_0x7e3d('0x26')](handleEntityNotFound(_0x443aea,null))['then'](function(_0x475d21){if(_0x475d21){_0x4d58b5[_0x7e3d('0x4b')][_0x7e3d('0x53')]=_0x475d21['id'];return db[_0x7e3d('0x54')][_0x7e3d('0x4a')](_0x4d58b5['body']);}})[_0x7e3d('0x26')](respondWithResult(_0x443aea,null))['catch'](handleError(_0x443aea,null));};exports[_0x7e3d('0x55')]=function(_0x57e56a,_0x422f68,_0x53d1dc){if(_0x57e56a['body']['id']){delete _0x57e56a['body']['id'];}return db['Trigger'][_0x7e3d('0x49')]({'where':{'id':_0x57e56a[_0x7e3d('0x51')]['id']}})['then'](handleEntityNotFound(_0x422f68,null))['then'](function(_0x444163){if(_0x444163){_0x57e56a['body'][_0x7e3d('0x56')]=_0x444163['id'];return db[_0x7e3d('0x54')][_0x7e3d('0x4a')](_0x57e56a[_0x7e3d('0x4b')]);}})[_0x7e3d('0x26')](respondWithResult(_0x422f68,null))[_0x7e3d('0x46')](handleError(_0x422f68,null));};exports['getAllConditions']=function(_0x5f5684,_0x2ac8ce,_0x2f5bba){var _0x2107e4={};var _0x2ec29e={};var _0x987cdb;var _0x12cad6;return db[_0x7e3d('0x2f')][_0x7e3d('0x57')]({'where':{'id':_0x5f5684[_0x7e3d('0x51')]['id']}})[_0x7e3d('0x26')](handleEntityNotFound(_0x2ac8ce,null))['then'](function(_0xbc240d){if(_0xbc240d){_0x987cdb=_0xbc240d;_0x2ec29e[_0x7e3d('0x38')]=_[_0x7e3d('0x35')](db['Condition']['rawAttributes']);_0x2ec29e['query']=_[_0x7e3d('0x35')](_0x5f5684['query']);_0x2ec29e['filters']=_[_0x7e3d('0x37')](_0x2ec29e[_0x7e3d('0x38')],_0x2ec29e[_0x7e3d('0x34')]);_0x2107e4[_0x7e3d('0x3a')]=_[_0x7e3d('0x37')](_0x2ec29e[_0x7e3d('0x38')],qs[_0x7e3d('0x39')](_0x5f5684[_0x7e3d('0x34')][_0x7e3d('0x39')]));_0x2107e4['attributes']=_0x2107e4[_0x7e3d('0x3a')]['length']?_0x2107e4[_0x7e3d('0x3a')]:_0x2ec29e['model'];_0x2107e4[_0x7e3d('0x3d')]=qs['sort'](_0x5f5684[_0x7e3d('0x34')][_0x7e3d('0x3e')]);_0x2107e4[_0x7e3d('0x3f')]=qs['filters'](_[_0x7e3d('0x40')](_0x5f5684[_0x7e3d('0x34')],_0x2ec29e[_0x7e3d('0x36')]));if(_0x5f5684[_0x7e3d('0x34')][_0x7e3d('0x41')]){_0x2107e4[_0x7e3d('0x3f')]=_['merge'](_0x2107e4[_0x7e3d('0x3f')],{'$or':_[_0x7e3d('0x33')](_0x2107e4[_0x7e3d('0x3a')],function(_0x52309c){var _0xf981f5={};_0xf981f5[_0x52309c]={'$like':'%'+_0x5f5684['query'][_0x7e3d('0x41')]+'%'};return _0xf981f5;})});}_0x2107e4=_[_0x7e3d('0x42')]({},_0x2107e4,_0x5f5684[_0x7e3d('0x58')]);return _0x987cdb[_0x7e3d('0x59')](_0x2107e4);}})[_0x7e3d('0x26')](function(_0x54dfb6){if(_0x54dfb6){_0x12cad6=_0x54dfb6['length'];if(!_0x5f5684['query'][_0x7e3d('0x5a')]('nolimit')){_0x2107e4[_0x7e3d('0x1f')]=qs[_0x7e3d('0x1f')](_0x5f5684[_0x7e3d('0x34')][_0x7e3d('0x1f')]);_0x2107e4[_0x7e3d('0x1c')]=qs[_0x7e3d('0x1c')](_0x5f5684[_0x7e3d('0x34')]['offset']);}return _0x987cdb[_0x7e3d('0x59')](_0x2107e4);}})['then'](function(_0xfb5cd4){if(_0xfb5cd4){return _0xfb5cd4?{'count':_0x12cad6,'rows':_0xfb5cd4}:null;}})[_0x7e3d('0x26')](respondWithResult(_0x2ac8ce,null))['catch'](handleError(_0x2ac8ce,null));};exports['getAnyConditions']=function(_0x57f43a,_0xccefd3,_0x1e46a5){var _0x182222={};var _0x587cef={};var _0x442eeb;var _0x4cf9fd;return db[_0x7e3d('0x2f')][_0x7e3d('0x57')]({'where':{'id':_0x57f43a[_0x7e3d('0x51')]['id']}})['then'](handleEntityNotFound(_0xccefd3,null))[_0x7e3d('0x26')](function(_0x41376b){if(_0x41376b){_0x442eeb=_0x41376b;_0x587cef[_0x7e3d('0x38')]=_[_0x7e3d('0x35')](db[_0x7e3d('0x54')][_0x7e3d('0x48')]);_0x587cef['query']=_[_0x7e3d('0x35')](_0x57f43a['query']);_0x587cef[_0x7e3d('0x36')]=_[_0x7e3d('0x37')](_0x587cef['model'],_0x587cef[_0x7e3d('0x34')]);_0x182222[_0x7e3d('0x3a')]=_[_0x7e3d('0x37')](_0x587cef['model'],qs['fields'](_0x57f43a[_0x7e3d('0x34')][_0x7e3d('0x39')]));_0x182222[_0x7e3d('0x3a')]=_0x182222[_0x7e3d('0x3a')][_0x7e3d('0x3b')]?_0x182222[_0x7e3d('0x3a')]:_0x587cef[_0x7e3d('0x38')];_0x182222[_0x7e3d('0x3d')]=qs['sort'](_0x57f43a[_0x7e3d('0x34')][_0x7e3d('0x3e')]);_0x182222['where']=qs['filters'](_[_0x7e3d('0x40')](_0x57f43a[_0x7e3d('0x34')],_0x587cef[_0x7e3d('0x36')]));if(_0x57f43a[_0x7e3d('0x34')][_0x7e3d('0x41')]){_0x182222[_0x7e3d('0x3f')]=_[_0x7e3d('0x42')](_0x182222[_0x7e3d('0x3f')],{'$or':_[_0x7e3d('0x33')](_0x182222[_0x7e3d('0x3a')],function(_0x86a5f1){var _0x5d30fc={};_0x5d30fc[_0x86a5f1]={'$like':'%'+_0x57f43a[_0x7e3d('0x34')]['filter']+'%'};return _0x5d30fc;})});}_0x182222=_[_0x7e3d('0x42')]({},_0x182222,_0x57f43a[_0x7e3d('0x58')]);return _0x442eeb[_0x7e3d('0x5b')](_0x182222);}})[_0x7e3d('0x26')](function(_0x3acba4){if(_0x3acba4){_0x4cf9fd=_0x3acba4[_0x7e3d('0x3b')];if(!_0x57f43a[_0x7e3d('0x34')][_0x7e3d('0x5a')](_0x7e3d('0x3c'))){_0x182222[_0x7e3d('0x1f')]=qs[_0x7e3d('0x1f')](_0x57f43a[_0x7e3d('0x34')][_0x7e3d('0x1f')]);_0x182222[_0x7e3d('0x1c')]=qs[_0x7e3d('0x1c')](_0x57f43a[_0x7e3d('0x34')]['offset']);}return _0x442eeb[_0x7e3d('0x5b')](_0x182222);}})[_0x7e3d('0x26')](function(_0x206464){if(_0x206464){return _0x206464?{'count':_0x4cf9fd,'rows':_0x206464}:null;}})[_0x7e3d('0x26')](respondWithResult(_0xccefd3,null))[_0x7e3d('0x46')](handleError(_0xccefd3,null));};exports[_0x7e3d('0x5c')]=function(_0x2b8931,_0x275d1c,_0x5b10b2){if(_0x2b8931[_0x7e3d('0x4b')]['id']){delete _0x2b8931[_0x7e3d('0x4b')]['id'];}return db[_0x7e3d('0x2f')]['find']({'where':{'id':_0x2b8931[_0x7e3d('0x51')]['id']}})[_0x7e3d('0x26')](handleEntityNotFound(_0x275d1c,null))[_0x7e3d('0x26')](function(_0x600c07){if(_0x600c07){_0x2b8931[_0x7e3d('0x4b')][_0x7e3d('0x5d')]=_0x600c07['id'];return db[_0x7e3d('0x5e')][_0x7e3d('0x4a')](_0x2b8931['body']);}})[_0x7e3d('0x26')](respondWithResult(_0x275d1c,null))['catch'](handleError(_0x275d1c,null));};exports[_0x7e3d('0x5f')]=function(_0x3497d9,_0x3650a2,_0x393269){var _0x22eda8={};var _0xcabcf1={};var _0x1d8340;var _0x1d47a7;return db[_0x7e3d('0x2f')][_0x7e3d('0x57')]({'where':{'id':_0x3497d9[_0x7e3d('0x51')]['id']}})[_0x7e3d('0x26')](handleEntityNotFound(_0x3650a2,null))[_0x7e3d('0x26')](function(_0x3e34a8){if(_0x3e34a8){_0x1d8340=_0x3e34a8;_0xcabcf1[_0x7e3d('0x38')]=_['keys'](db['Action'][_0x7e3d('0x48')]);_0xcabcf1['query']=_[_0x7e3d('0x35')](_0x3497d9[_0x7e3d('0x34')]);_0xcabcf1[_0x7e3d('0x36')]=_[_0x7e3d('0x37')](_0xcabcf1[_0x7e3d('0x38')],_0xcabcf1['query']);_0x22eda8[_0x7e3d('0x3a')]=_['intersection'](_0xcabcf1[_0x7e3d('0x38')],qs[_0x7e3d('0x39')](_0x3497d9['query'][_0x7e3d('0x39')]));_0x22eda8[_0x7e3d('0x3a')]=_0x22eda8['attributes'][_0x7e3d('0x3b')]?_0x22eda8[_0x7e3d('0x3a')]:_0xcabcf1[_0x7e3d('0x38')];_0x22eda8['order']=qs[_0x7e3d('0x3e')](_0x3497d9['query'][_0x7e3d('0x3e')]);_0x22eda8[_0x7e3d('0x3f')]=qs[_0x7e3d('0x36')](_[_0x7e3d('0x40')](_0x3497d9[_0x7e3d('0x34')],_0xcabcf1[_0x7e3d('0x36')]));if(_0x3497d9[_0x7e3d('0x34')][_0x7e3d('0x41')]){_0x22eda8[_0x7e3d('0x3f')]=_[_0x7e3d('0x42')](_0x22eda8[_0x7e3d('0x3f')],{'$or':_['map'](_0x22eda8[_0x7e3d('0x3a')],function(_0x3e5df9){var _0x192530={};_0x192530[_0x3e5df9]={'$like':'%'+_0x3497d9[_0x7e3d('0x34')]['filter']+'%'};return _0x192530;})});}_0x22eda8=_[_0x7e3d('0x42')]({},_0x22eda8,_0x3497d9[_0x7e3d('0x58')]);return _0x1d8340[_0x7e3d('0x5f')](_0x22eda8);}})[_0x7e3d('0x26')](function(_0x574954){if(_0x574954){_0x1d47a7=_0x574954['length'];if(!_0x3497d9[_0x7e3d('0x34')][_0x7e3d('0x5a')]('nolimit')){_0x22eda8[_0x7e3d('0x1f')]=qs['limit'](_0x3497d9[_0x7e3d('0x34')][_0x7e3d('0x1f')]);_0x22eda8[_0x7e3d('0x1c')]=qs[_0x7e3d('0x1c')](_0x3497d9[_0x7e3d('0x34')]['offset']);}return _0x1d8340[_0x7e3d('0x5f')](_0x22eda8);}})[_0x7e3d('0x26')](function(_0x3a9409){if(_0x3a9409){return _0x3a9409?{'count':_0x1d47a7,'rows':_0x3a9409}:null;}})[_0x7e3d('0x26')](respondWithResult(_0x3650a2,null))[_0x7e3d('0x46')](handleError(_0x3650a2,null));}; \ No newline at end of file +var _0x03ba=['merge','options','findAll','rows','catch','show','params','includeAll','create','user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addAllCondition','addAnyCondition','Condition','getAllConditions','findOne','length','nolimit','getAnyConditions','TriggerId','Action','getActions','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x3c1b2d,_0x23b1b9){var _0x412475=function(_0x1245ad){while(--_0x1245ad){_0x3c1b2d['push'](_0x3c1b2d['shift']());}};_0x412475(++_0x23b1b9);}(_0x03ba,0xd3));var _0xa03b=function(_0x43ac41,_0x487048){_0x43ac41=_0x43ac41-0x0;var _0x56a62f=_0x03ba[_0x43ac41];return _0x56a62f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa03b('0x0'));var jsonpatch=require(_0xa03b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa03b('0x2'));var Mustache=require(_0xa03b('0x3'));var util=require(_0xa03b('0x4'));var path=require(_0xa03b('0x5'));var sox=require(_0xa03b('0x6'));var csv=require(_0xa03b('0x7'));var ejs=require(_0xa03b('0x8'));var fs=require('fs');var fs_extra=require(_0xa03b('0x9'));var _=require(_0xa03b('0xa'));var squel=require('squel');var crypto=require(_0xa03b('0xb'));var jsforce=require(_0xa03b('0xc'));var deskjs=require(_0xa03b('0xd'));var toCsv=require(_0xa03b('0x7'));var querystring=require(_0xa03b('0xe'));var Papa=require(_0xa03b('0xf'));var Redis=require(_0xa03b('0x10'));var authService=require(_0xa03b('0x11'));var qs=require(_0xa03b('0x12'));var as=require(_0xa03b('0x13'));var hardwareService=require(_0xa03b('0x14'));var logger=require(_0xa03b('0x15'))('api');var utils=require(_0xa03b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa03b('0x17'))['db'];function respondWithStatusCode(_0x152021,_0x83b2eb){_0x83b2eb=_0x83b2eb||0xcc;return function(_0x576ecd){if(_0x576ecd){return _0x152021['sendStatus'](_0x83b2eb);}return _0x152021[_0xa03b('0x18')](_0x83b2eb)[_0xa03b('0x19')]();};}function respondWithResult(_0x4bb58e,_0x315fba){_0x315fba=_0x315fba||0xc8;return function(_0x3220ee){if(_0x3220ee){return _0x4bb58e[_0xa03b('0x18')](_0x315fba)['json'](_0x3220ee);}};}function respondWithFilteredResult(_0xfbebfa,_0x315f9d){return function(_0x476c91){if(_0x476c91){var _0x236b33=typeof _0x315f9d['offset']===_0xa03b('0x1a')&&typeof _0x315f9d[_0xa03b('0x1b')]===_0xa03b('0x1a');var _0x4ac88f=_0x476c91[_0xa03b('0x1c')];var _0x457c21=_0x236b33?0x0:_0x315f9d[_0xa03b('0x1d')];var _0x349c2f=_0x236b33?_0x476c91[_0xa03b('0x1c')]:_0x315f9d['offset']+_0x315f9d[_0xa03b('0x1b')];var _0x2e5a89;if(_0x349c2f>=_0x4ac88f){_0x349c2f=_0x4ac88f;_0x2e5a89=0xc8;}else{_0x2e5a89=0xce;}_0xfbebfa[_0xa03b('0x18')](_0x2e5a89);return _0xfbebfa['set'](_0xa03b('0x1e'),_0x457c21+'-'+_0x349c2f+'/'+_0x4ac88f)[_0xa03b('0x1f')](_0x476c91);}return null;};}function patchUpdates(_0x51161d){return function(_0x424b39){try{jsonpatch[_0xa03b('0x20')](_0x424b39,_0x51161d,!![]);}catch(_0x100235){return BPromise[_0xa03b('0x21')](_0x100235);}return _0x424b39[_0xa03b('0x22')]();};}function saveUpdates(_0x1d626e,_0x2a35ec){return function(_0x12876c){if(_0x12876c){return _0x12876c['update'](_0x1d626e)[_0xa03b('0x23')](function(_0xfd8546){return _0xfd8546;});}return null;};}function removeEntity(_0xc2558c,_0x24dc5b){return function(_0x470735){if(_0x470735){return _0x470735[_0xa03b('0x24')]()['then'](function(){var _0x20b890=_0x470735[_0xa03b('0x25')]({'plain':!![]});var _0x1a3c86=_0xa03b('0x26');return db[_0xa03b('0x27')][_0xa03b('0x24')]({'where':{'type':_0x1a3c86,'resourceId':_0x20b890['id']}})[_0xa03b('0x23')](function(){return _0x470735;});})[_0xa03b('0x23')](function(){_0xc2558c[_0xa03b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf49422,_0x1f1ec8){return function(_0x5c2e00){if(!_0x5c2e00){_0xf49422['sendStatus'](0x194);}return _0x5c2e00;};}function handleError(_0x332389,_0x12a5f7){_0x12a5f7=_0x12a5f7||0x1f4;return function(_0x59752e){logger['error'](_0x59752e[_0xa03b('0x28')]);if(_0x59752e[_0xa03b('0x29')]){delete _0x59752e[_0xa03b('0x29')];}_0x332389[_0xa03b('0x18')](_0x12a5f7)[_0xa03b('0x2a')](_0x59752e);};}exports[_0xa03b('0x2b')]=function(_0x3f51ae,_0x68ac5e){var _0x17bcb1={},_0x52a882={},_0x414feb={'count':0x0,'rows':[]};var _0x5b0a1c=_[_0xa03b('0x2c')](db[_0xa03b('0x2d')][_0xa03b('0x2e')],function(_0x5ec1e7){return{'name':_0x5ec1e7[_0xa03b('0x2f')],'type':_0x5ec1e7[_0xa03b('0x30')]['key']};});_0x52a882['model']=_[_0xa03b('0x2c')](_0x5b0a1c,_0xa03b('0x29'));_0x52a882[_0xa03b('0x31')]=_[_0xa03b('0x32')](_0x3f51ae['query']);_0x52a882[_0xa03b('0x33')]=_[_0xa03b('0x34')](_0x52a882[_0xa03b('0x35')],_0x52a882[_0xa03b('0x31')]);_0x17bcb1[_0xa03b('0x36')]=_[_0xa03b('0x34')](_0x52a882['model'],qs[_0xa03b('0x37')](_0x3f51ae[_0xa03b('0x31')][_0xa03b('0x37')]));_0x17bcb1[_0xa03b('0x36')]=_0x17bcb1[_0xa03b('0x36')]['length']?_0x17bcb1[_0xa03b('0x36')]:_0x52a882[_0xa03b('0x35')];if(!_0x3f51ae[_0xa03b('0x31')][_0xa03b('0x38')]('nolimit')){_0x17bcb1[_0xa03b('0x1b')]=qs[_0xa03b('0x1b')](_0x3f51ae[_0xa03b('0x31')][_0xa03b('0x1b')]);_0x17bcb1[_0xa03b('0x1d')]=qs[_0xa03b('0x1d')](_0x3f51ae['query']['offset']);}_0x17bcb1[_0xa03b('0x39')]=qs[_0xa03b('0x3a')](_0x3f51ae[_0xa03b('0x31')][_0xa03b('0x3a')]);_0x17bcb1['where']=qs[_0xa03b('0x33')](_[_0xa03b('0x3b')](_0x3f51ae[_0xa03b('0x31')],_0x52a882[_0xa03b('0x33')]),_0x5b0a1c);if(_0x3f51ae['query'][_0xa03b('0x3c')]){_0x17bcb1['where']=_['merge'](_0x17bcb1[_0xa03b('0x3d')],{'$or':_[_0xa03b('0x2c')](_0x5b0a1c,function(_0x5107cd){if(_0x5107cd['type']!=='VIRTUAL'){var _0x18cd92={};_0x18cd92[_0x5107cd[_0xa03b('0x29')]]={'$like':'%'+_0x3f51ae['query'][_0xa03b('0x3c')]+'%'};return _0x18cd92;}})});}_0x17bcb1=_[_0xa03b('0x3e')]({},_0x17bcb1,_0x3f51ae[_0xa03b('0x3f')]);var _0x2f6048={'where':_0x17bcb1['where']};return db['Trigger'][_0xa03b('0x1c')](_0x2f6048)[_0xa03b('0x23')](function(_0x5f42d8){_0x414feb[_0xa03b('0x1c')]=_0x5f42d8;if(_0x3f51ae[_0xa03b('0x31')]['includeAll']){_0x17bcb1['include']=[{'all':!![]}];}return db['Trigger'][_0xa03b('0x40')](_0x17bcb1);})[_0xa03b('0x23')](function(_0x21ad44){_0x414feb[_0xa03b('0x41')]=_0x21ad44;return _0x414feb;})['then'](respondWithFilteredResult(_0x68ac5e,_0x17bcb1))[_0xa03b('0x42')](handleError(_0x68ac5e,null));};exports[_0xa03b('0x43')]=function(_0x121b33,_0xb49185){var _0x173609={'raw':![],'where':{'id':_0x121b33[_0xa03b('0x44')]['id']}},_0x136fda={};_0x136fda['model']=_[_0xa03b('0x32')](db[_0xa03b('0x2d')][_0xa03b('0x2e')]);_0x136fda['query']=_[_0xa03b('0x32')](_0x121b33[_0xa03b('0x31')]);_0x136fda[_0xa03b('0x33')]=_['intersection'](_0x136fda[_0xa03b('0x35')],_0x136fda['query']);_0x173609[_0xa03b('0x36')]=_['intersection'](_0x136fda['model'],qs['fields'](_0x121b33[_0xa03b('0x31')][_0xa03b('0x37')]));_0x173609['attributes']=_0x173609[_0xa03b('0x36')]['length']?_0x173609[_0xa03b('0x36')]:_0x136fda['model'];if(_0x121b33['query'][_0xa03b('0x45')]){_0x173609['include']=[{'all':!![]}];}_0x173609=_[_0xa03b('0x3e')]({},_0x173609,_0x121b33[_0xa03b('0x3f')]);return db[_0xa03b('0x2d')]['find'](_0x173609)['then'](handleEntityNotFound(_0xb49185,null))[_0xa03b('0x23')](respondWithResult(_0xb49185,null))[_0xa03b('0x42')](handleError(_0xb49185,null));};exports[_0xa03b('0x46')]=function(_0x4afcb3,_0x460605){return db[_0xa03b('0x2d')][_0xa03b('0x46')](_0x4afcb3['body'],{})['then'](function(_0x4dea0a){var _0x55c048=_0x4afcb3[_0xa03b('0x47')]['get']({'plain':!![]});if(!_0x55c048)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55c048[_0xa03b('0x48')]===_0xa03b('0x47')){var _0x1c6bb5=_0x4dea0a['get']({'plain':!![]});var _0x22fe03=_0xa03b('0x26');return db['UserProfileSection'][_0xa03b('0x49')]({'where':{'name':_0x22fe03,'userProfileId':_0x55c048[_0xa03b('0x4a')]},'raw':!![]})['then'](function(_0x274036){if(_0x274036&&_0x274036[_0xa03b('0x4b')]===0x0){return db['UserProfileResource'][_0xa03b('0x46')]({'name':_0x1c6bb5[_0xa03b('0x29')],'resourceId':_0x1c6bb5['id'],'type':_0x274036[_0xa03b('0x29')],'sectionId':_0x274036['id']},{})['then'](function(){return _0x4dea0a;});}else{return _0x4dea0a;}})['catch'](function(_0x98477e){logger[_0xa03b('0x4c')](_0xa03b('0x4d'),_0x98477e);throw _0x98477e;});}return _0x4dea0a;})[_0xa03b('0x23')](respondWithResult(_0x460605,0xc9))['catch'](handleError(_0x460605,null));};exports[_0xa03b('0x4e')]=function(_0x1fa5b1,_0x5c3bcd){if(_0x1fa5b1[_0xa03b('0x4f')]['id']){delete _0x1fa5b1[_0xa03b('0x4f')]['id'];}return db['Trigger']['find']({'where':{'id':_0x1fa5b1['params']['id']}})[_0xa03b('0x23')](handleEntityNotFound(_0x5c3bcd,null))[_0xa03b('0x23')](saveUpdates(_0x1fa5b1[_0xa03b('0x4f')],null))[_0xa03b('0x23')](respondWithResult(_0x5c3bcd,null))['catch'](handleError(_0x5c3bcd,null));};exports[_0xa03b('0x24')]=function(_0x59c56d,_0x2c6a14){return db[_0xa03b('0x2d')][_0xa03b('0x49')]({'where':{'id':_0x59c56d[_0xa03b('0x44')]['id']}})[_0xa03b('0x23')](handleEntityNotFound(_0x2c6a14,null))[_0xa03b('0x23')](removeEntity(_0x2c6a14,null))[_0xa03b('0x42')](handleError(_0x2c6a14,null));};exports[_0xa03b('0x50')]=function(_0x252167,_0x39ed08,_0x576be5){if(_0x252167[_0xa03b('0x4f')]['id']){delete _0x252167[_0xa03b('0x4f')]['id'];}return db[_0xa03b('0x2d')][_0xa03b('0x49')]({'where':{'id':_0x252167[_0xa03b('0x44')]['id']}})['then'](handleEntityNotFound(_0x39ed08,null))['then'](function(_0x54e3c9){if(_0x54e3c9){_0x252167[_0xa03b('0x4f')]['TriggerAllId']=_0x54e3c9['id'];return db['Condition'][_0xa03b('0x46')](_0x252167[_0xa03b('0x4f')]);}})[_0xa03b('0x23')](respondWithResult(_0x39ed08,null))[_0xa03b('0x42')](handleError(_0x39ed08,null));};exports[_0xa03b('0x51')]=function(_0x13efd3,_0x1702a2,_0x4ee3d5){if(_0x13efd3[_0xa03b('0x4f')]['id']){delete _0x13efd3[_0xa03b('0x4f')]['id'];}return db['Trigger'][_0xa03b('0x49')]({'where':{'id':_0x13efd3[_0xa03b('0x44')]['id']}})['then'](handleEntityNotFound(_0x1702a2,null))[_0xa03b('0x23')](function(_0xf750d0){if(_0xf750d0){_0x13efd3[_0xa03b('0x4f')]['TriggerAnyId']=_0xf750d0['id'];return db[_0xa03b('0x52')][_0xa03b('0x46')](_0x13efd3[_0xa03b('0x4f')]);}})[_0xa03b('0x23')](respondWithResult(_0x1702a2,null))[_0xa03b('0x42')](handleError(_0x1702a2,null));};exports[_0xa03b('0x53')]=function(_0x5ce313,_0x4085ff,_0x57faff){var _0x88d6d5={};var _0x326fba={};var _0x3d3372;var _0x5746b4;return db['Trigger'][_0xa03b('0x54')]({'where':{'id':_0x5ce313['params']['id']}})[_0xa03b('0x23')](handleEntityNotFound(_0x4085ff,null))[_0xa03b('0x23')](function(_0x14e5f7){if(_0x14e5f7){_0x3d3372=_0x14e5f7;_0x326fba[_0xa03b('0x35')]=_[_0xa03b('0x32')](db[_0xa03b('0x52')][_0xa03b('0x2e')]);_0x326fba[_0xa03b('0x31')]=_[_0xa03b('0x32')](_0x5ce313[_0xa03b('0x31')]);_0x326fba[_0xa03b('0x33')]=_[_0xa03b('0x34')](_0x326fba[_0xa03b('0x35')],_0x326fba['query']);_0x88d6d5[_0xa03b('0x36')]=_['intersection'](_0x326fba['model'],qs[_0xa03b('0x37')](_0x5ce313[_0xa03b('0x31')][_0xa03b('0x37')]));_0x88d6d5[_0xa03b('0x36')]=_0x88d6d5[_0xa03b('0x36')][_0xa03b('0x55')]?_0x88d6d5[_0xa03b('0x36')]:_0x326fba[_0xa03b('0x35')];_0x88d6d5[_0xa03b('0x39')]=qs[_0xa03b('0x3a')](_0x5ce313[_0xa03b('0x31')][_0xa03b('0x3a')]);_0x88d6d5[_0xa03b('0x3d')]=qs['filters'](_[_0xa03b('0x3b')](_0x5ce313['query'],_0x326fba[_0xa03b('0x33')]));if(_0x5ce313[_0xa03b('0x31')]['filter']){_0x88d6d5['where']=_['merge'](_0x88d6d5[_0xa03b('0x3d')],{'$or':_[_0xa03b('0x2c')](_0x88d6d5[_0xa03b('0x36')],function(_0x12ee8e){var _0x2d4195={};_0x2d4195[_0x12ee8e]={'$like':'%'+_0x5ce313[_0xa03b('0x31')][_0xa03b('0x3c')]+'%'};return _0x2d4195;})});}_0x88d6d5=_['merge']({},_0x88d6d5,_0x5ce313['options']);return _0x3d3372[_0xa03b('0x53')](_0x88d6d5);}})[_0xa03b('0x23')](function(_0x46b32d){if(_0x46b32d){_0x5746b4=_0x46b32d['length'];if(!_0x5ce313[_0xa03b('0x31')]['hasOwnProperty'](_0xa03b('0x56'))){_0x88d6d5[_0xa03b('0x1b')]=qs['limit'](_0x5ce313[_0xa03b('0x31')][_0xa03b('0x1b')]);_0x88d6d5['offset']=qs[_0xa03b('0x1d')](_0x5ce313[_0xa03b('0x31')]['offset']);}return _0x3d3372[_0xa03b('0x53')](_0x88d6d5);}})['then'](function(_0x197bf6){if(_0x197bf6){return _0x197bf6?{'count':_0x5746b4,'rows':_0x197bf6}:null;}})[_0xa03b('0x23')](respondWithResult(_0x4085ff,null))[_0xa03b('0x42')](handleError(_0x4085ff,null));};exports[_0xa03b('0x57')]=function(_0x2defb6,_0x28ae45,_0x140e65){var _0x3b9de4={};var _0x544f32={};var _0x1a75ef;var _0x33bd73;return db['Trigger'][_0xa03b('0x54')]({'where':{'id':_0x2defb6['params']['id']}})[_0xa03b('0x23')](handleEntityNotFound(_0x28ae45,null))[_0xa03b('0x23')](function(_0x578158){if(_0x578158){_0x1a75ef=_0x578158;_0x544f32[_0xa03b('0x35')]=_['keys'](db[_0xa03b('0x52')]['rawAttributes']);_0x544f32[_0xa03b('0x31')]=_[_0xa03b('0x32')](_0x2defb6['query']);_0x544f32['filters']=_[_0xa03b('0x34')](_0x544f32['model'],_0x544f32[_0xa03b('0x31')]);_0x3b9de4[_0xa03b('0x36')]=_[_0xa03b('0x34')](_0x544f32['model'],qs['fields'](_0x2defb6[_0xa03b('0x31')][_0xa03b('0x37')]));_0x3b9de4[_0xa03b('0x36')]=_0x3b9de4[_0xa03b('0x36')][_0xa03b('0x55')]?_0x3b9de4[_0xa03b('0x36')]:_0x544f32[_0xa03b('0x35')];_0x3b9de4[_0xa03b('0x39')]=qs[_0xa03b('0x3a')](_0x2defb6[_0xa03b('0x31')][_0xa03b('0x3a')]);_0x3b9de4[_0xa03b('0x3d')]=qs['filters'](_[_0xa03b('0x3b')](_0x2defb6[_0xa03b('0x31')],_0x544f32[_0xa03b('0x33')]));if(_0x2defb6[_0xa03b('0x31')][_0xa03b('0x3c')]){_0x3b9de4[_0xa03b('0x3d')]=_[_0xa03b('0x3e')](_0x3b9de4['where'],{'$or':_['map'](_0x3b9de4['attributes'],function(_0x552ea1){var _0x43f51e={};_0x43f51e[_0x552ea1]={'$like':'%'+_0x2defb6[_0xa03b('0x31')][_0xa03b('0x3c')]+'%'};return _0x43f51e;})});}_0x3b9de4=_['merge']({},_0x3b9de4,_0x2defb6[_0xa03b('0x3f')]);return _0x1a75ef['getAnyConditions'](_0x3b9de4);}})['then'](function(_0x56862d){if(_0x56862d){_0x33bd73=_0x56862d[_0xa03b('0x55')];if(!_0x2defb6['query'][_0xa03b('0x38')](_0xa03b('0x56'))){_0x3b9de4['limit']=qs['limit'](_0x2defb6['query'][_0xa03b('0x1b')]);_0x3b9de4[_0xa03b('0x1d')]=qs[_0xa03b('0x1d')](_0x2defb6[_0xa03b('0x31')]['offset']);}return _0x1a75ef[_0xa03b('0x57')](_0x3b9de4);}})['then'](function(_0x592830){if(_0x592830){return _0x592830?{'count':_0x33bd73,'rows':_0x592830}:null;}})[_0xa03b('0x23')](respondWithResult(_0x28ae45,null))[_0xa03b('0x42')](handleError(_0x28ae45,null));};exports['addAction']=function(_0xbf6057,_0x3f125c,_0x31ce2a){if(_0xbf6057[_0xa03b('0x4f')]['id']){delete _0xbf6057[_0xa03b('0x4f')]['id'];}return db[_0xa03b('0x2d')][_0xa03b('0x49')]({'where':{'id':_0xbf6057['params']['id']}})[_0xa03b('0x23')](handleEntityNotFound(_0x3f125c,null))[_0xa03b('0x23')](function(_0x13bd04){if(_0x13bd04){_0xbf6057[_0xa03b('0x4f')][_0xa03b('0x58')]=_0x13bd04['id'];return db[_0xa03b('0x59')][_0xa03b('0x46')](_0xbf6057[_0xa03b('0x4f')]);}})['then'](respondWithResult(_0x3f125c,null))['catch'](handleError(_0x3f125c,null));};exports['getActions']=function(_0x247cc2,_0x343b63,_0x417da4){var _0x23a5a7={};var _0x5a38e6={};var _0x5ce31e;var _0xbbc657;return db[_0xa03b('0x2d')][_0xa03b('0x54')]({'where':{'id':_0x247cc2[_0xa03b('0x44')]['id']}})[_0xa03b('0x23')](handleEntityNotFound(_0x343b63,null))[_0xa03b('0x23')](function(_0x38417){if(_0x38417){_0x5ce31e=_0x38417;_0x5a38e6[_0xa03b('0x35')]=_['keys'](db[_0xa03b('0x59')][_0xa03b('0x2e')]);_0x5a38e6[_0xa03b('0x31')]=_['keys'](_0x247cc2['query']);_0x5a38e6[_0xa03b('0x33')]=_['intersection'](_0x5a38e6[_0xa03b('0x35')],_0x5a38e6[_0xa03b('0x31')]);_0x23a5a7['attributes']=_[_0xa03b('0x34')](_0x5a38e6['model'],qs[_0xa03b('0x37')](_0x247cc2[_0xa03b('0x31')][_0xa03b('0x37')]));_0x23a5a7[_0xa03b('0x36')]=_0x23a5a7[_0xa03b('0x36')][_0xa03b('0x55')]?_0x23a5a7[_0xa03b('0x36')]:_0x5a38e6[_0xa03b('0x35')];_0x23a5a7[_0xa03b('0x39')]=qs[_0xa03b('0x3a')](_0x247cc2[_0xa03b('0x31')][_0xa03b('0x3a')]);_0x23a5a7['where']=qs[_0xa03b('0x33')](_[_0xa03b('0x3b')](_0x247cc2['query'],_0x5a38e6[_0xa03b('0x33')]));if(_0x247cc2[_0xa03b('0x31')]['filter']){_0x23a5a7[_0xa03b('0x3d')]=_['merge'](_0x23a5a7[_0xa03b('0x3d')],{'$or':_['map'](_0x23a5a7['attributes'],function(_0x4068ad){var _0x5494b0={};_0x5494b0[_0x4068ad]={'$like':'%'+_0x247cc2[_0xa03b('0x31')][_0xa03b('0x3c')]+'%'};return _0x5494b0;})});}_0x23a5a7=_[_0xa03b('0x3e')]({},_0x23a5a7,_0x247cc2[_0xa03b('0x3f')]);return _0x5ce31e['getActions'](_0x23a5a7);}})['then'](function(_0x1f5e58){if(_0x1f5e58){_0xbbc657=_0x1f5e58['length'];if(!_0x247cc2[_0xa03b('0x31')][_0xa03b('0x38')](_0xa03b('0x56'))){_0x23a5a7['limit']=qs[_0xa03b('0x1b')](_0x247cc2[_0xa03b('0x31')][_0xa03b('0x1b')]);_0x23a5a7['offset']=qs['offset'](_0x247cc2['query'][_0xa03b('0x1d')]);}return _0x5ce31e[_0xa03b('0x5a')](_0x23a5a7);}})['then'](function(_0x411a78){if(_0x411a78){return _0x411a78?{'count':_0xbbc657,'rows':_0x411a78}:null;}})[_0xa03b('0x23')](respondWithResult(_0x343b63,null))[_0xa03b('0x42')](handleError(_0x343b63,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 18b653f..ba9e187 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 _0x8558=['request-promise','path','../../config/environment','exports','define','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird'];(function(_0x585d3c,_0x468871){var _0x23d7ac=function(_0x24ec94){while(--_0x24ec94){_0x585d3c['push'](_0x585d3c['shift']());}};_0x23d7ac(++_0x468871);}(_0x8558,0x103));var _0x8855=function(_0x47e616,_0x5972b4){_0x47e616=_0x47e616-0x0;var _0x35db91=_0x8558[_0x47e616];return _0x35db91;};'use strict';var _=require('lodash');var util=require(_0x8855('0x0'));var logger=require(_0x8855('0x1'))(_0x8855('0x2'));var moment=require(_0x8855('0x3'));var BPromise=require(_0x8855('0x4'));var rp=require(_0x8855('0x5'));var fs=require('fs');var path=require(_0x8855('0x6'));var rimraf=require('rimraf');var config=require(_0x8855('0x7'));var attributes=require('./trigger.attributes');module[_0x8855('0x8')]=function(_0x4ed0e8,_0x276ee5){return _0x4ed0e8[_0x8855('0x9')](_0x8855('0xa'),attributes,{'tableName':_0x8855('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde50=['../../config/logger','api','moment','bluebird','path','../../config/environment','define','Trigger'];(function(_0x4e1a50,_0x39adc7){var _0x30c219=function(_0x249fe4){while(--_0x249fe4){_0x4e1a50['push'](_0x4e1a50['shift']());}};_0x30c219(++_0x39adc7);}(_0xde50,0x140));var _0x0de5=function(_0x33719a,_0x1b9e9f){_0x33719a=_0x33719a-0x0;var _0x2d1391=_0xde50[_0x33719a];return _0x2d1391;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0de5('0x0'))(_0x0de5('0x1'));var moment=require(_0x0de5('0x2'));var BPromise=require(_0x0de5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0de5('0x4'));var rimraf=require('rimraf');var config=require(_0x0de5('0x5'));var attributes=require('./trigger.attributes');module['exports']=function(_0x5f05a1,_0x444955){return _0x5f05a1[_0x0de5('0x6')](_0x0de5('0x7'),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 5c9796a..082b4a0 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 _0x0291=['catch','Trigger','options','where','limit','map','include','model','GetTrigger','ShowTrigger','find','attributes','then','lodash','util','bluebird','ioredis','../../config/utils','../../config/environment','client','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x0291,0x162));var _0x1029=function(_0x59adc7,_0xafe729){_0x59adc7=_0x59adc7-0x0;var _0x441027=_0x0291[_0x59adc7];return _0x441027;};'use strict';var _=require(_0x1029('0x0'));var util=require(_0x1029('0x1'));var moment=require('moment');var BPromise=require(_0x1029('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1029('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1029('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1029('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1029('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6af5,_0x2a4e6a,_0x77e70e){return new BPromise(function(_0x17bcb5,_0x514374){return client[_0x1029('0x7')](_0x1f6af5,_0x77e70e)['then'](function(_0x3ccb9e){logger['info'](_0x1029('0x8'),_0x2a4e6a,_0x1029('0x9'));logger[_0x1029('0xa')](_0x1029('0xb'),_0x2a4e6a,_0x1029('0x9'),JSON[_0x1029('0xc')](_0x3ccb9e));if(_0x3ccb9e['error']){if(_0x3ccb9e[_0x1029('0xd')][_0x1029('0xe')]===0x1f4){logger[_0x1029('0xd')](_0x1029('0x8'),_0x2a4e6a,_0x3ccb9e['error'][_0x1029('0xf')]);return _0x514374(_0x3ccb9e[_0x1029('0xd')][_0x1029('0xf')]);}logger[_0x1029('0xd')]('Trigger,\x20%s,\x20%s',_0x2a4e6a,_0x3ccb9e[_0x1029('0xd')][_0x1029('0xf')]);return _0x17bcb5(_0x3ccb9e[_0x1029('0xd')][_0x1029('0xf')]);}else{logger[_0x1029('0x10')]('Trigger,\x20%s,\x20%s',_0x2a4e6a,_0x1029('0x9'));_0x17bcb5(_0x3ccb9e[_0x1029('0x11')]['message']);}})[_0x1029('0x12')](function(_0x26e817){logger[_0x1029('0xd')]('Trigger,\x20%s,\x20%s',_0x2a4e6a,_0x26e817);_0x514374(_0x26e817);});});}exports['GetTrigger']=function(_0x14fc5c){var _0x58947d=this;return new Promise(function(_0x5dee4f,_0x2c8591){return db[_0x1029('0x13')]['findAll']({'raw':_0x14fc5c[_0x1029('0x14')]?_0x14fc5c[_0x1029('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x14fc5c[_0x1029('0x14')]?_0x14fc5c[_0x1029('0x14')][_0x1029('0x15')]||null:null,'attributes':_0x14fc5c[_0x1029('0x14')]?_0x14fc5c[_0x1029('0x14')]['attributes']||null:null,'limit':_0x14fc5c[_0x1029('0x14')]?_0x14fc5c[_0x1029('0x14')][_0x1029('0x16')]||null:null,'include':_0x14fc5c[_0x1029('0x14')]?_0x14fc5c[_0x1029('0x14')]['include']?_[_0x1029('0x17')](_0x14fc5c['options'][_0x1029('0x18')],function(_0x36083b){return{'model':db[_0x36083b['model']],'as':_0x36083b['as'],'attributes':_0x36083b['attributes'],'include':_0x36083b['include']?_[_0x1029('0x17')](_0x36083b[_0x1029('0x18')],function(_0x431fa0){return{'model':db[_0x431fa0[_0x1029('0x19')]],'as':_0x431fa0['as'],'attributes':_0x431fa0['attributes'],'include':_0x431fa0[_0x1029('0x18')]?_[_0x1029('0x17')](_0x431fa0[_0x1029('0x18')],function(_0x9c9d7a){return{'model':db[_0x9c9d7a[_0x1029('0x19')]],'as':_0x9c9d7a['as'],'attributes':_0x9c9d7a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a1b6c){logger['info'](_0x1029('0x1a'),_0x14fc5c);logger[_0x1029('0xa')](_0x1029('0x1a'),_0x14fc5c,JSON[_0x1029('0xc')](_0x5a1b6c));_0x5dee4f(_0x5a1b6c);})[_0x1029('0x12')](function(_0x502b2a){logger[_0x1029('0xd')](_0x1029('0x1a'),_0x502b2a[_0x1029('0xf')],_0x14fc5c);_0x2c8591(_0x58947d[_0x1029('0xd')](0x1f4,_0x502b2a[_0x1029('0xf')]));});});};exports[_0x1029('0x1b')]=function(_0x4cc35a){var _0x3adaeb=this;return new Promise(function(_0x2d75d0,_0x484704){return db[_0x1029('0x13')][_0x1029('0x1c')]({'raw':_0x4cc35a[_0x1029('0x14')]?_0x4cc35a[_0x1029('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4cc35a[_0x1029('0x14')]?_0x4cc35a['options'][_0x1029('0x15')]||null:null,'attributes':_0x4cc35a[_0x1029('0x14')]?_0x4cc35a[_0x1029('0x14')][_0x1029('0x1d')]||null:null,'include':_0x4cc35a['options']?_0x4cc35a[_0x1029('0x14')][_0x1029('0x18')]?_[_0x1029('0x17')](_0x4cc35a[_0x1029('0x14')][_0x1029('0x18')],function(_0x1142a6){return{'model':db[_0x1142a6[_0x1029('0x19')]],'as':_0x1142a6['as'],'attributes':_0x1142a6[_0x1029('0x1d')],'include':_0x1142a6['include']?_[_0x1029('0x17')](_0x1142a6['include'],function(_0x1f4ab4){return{'model':db[_0x1f4ab4['model']],'as':_0x1f4ab4['as'],'attributes':_0x1f4ab4[_0x1029('0x1d')],'include':_0x1f4ab4[_0x1029('0x18')]?_[_0x1029('0x17')](_0x1f4ab4[_0x1029('0x18')],function(_0x55357d){return{'model':db[_0x55357d[_0x1029('0x19')]],'as':_0x55357d['as'],'attributes':_0x55357d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1029('0x1e')](function(_0x16e9a1){logger[_0x1029('0x10')](_0x1029('0x1b'),_0x4cc35a);logger[_0x1029('0xa')](_0x1029('0x1b'),_0x4cc35a,JSON[_0x1029('0xc')](_0x16e9a1));_0x2d75d0(_0x16e9a1);})[_0x1029('0x12')](function(_0x1a0bf0){logger[_0x1029('0xd')]('ShowTrigger',_0x1a0bf0['message'],_0x4cc35a);_0x484704(_0x3adaeb[_0x1029('0xd')](0x1f4,_0x1a0bf0[_0x1029('0xf')]));});});}; \ No newline at end of file +var _0x21bd=['rpc','client','http','request','then','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','info','result','catch','findAll','options','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x160219,_0x44d746){var _0x3fa18d=function(_0x12f93c){while(--_0x12f93c){_0x160219['push'](_0x160219['shift']());}};_0x3fa18d(++_0x44d746);}(_0x21bd,0x157));var _0xd21b=function(_0x638529,_0x33415d){_0x638529=_0x638529-0x0;var _0x1c5a97=_0x21bd[_0x638529];return _0x1c5a97;};'use strict';var _=require(_0xd21b('0x0'));var util=require(_0xd21b('0x1'));var moment=require(_0xd21b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd21b('0x3'));var fs=require('fs');var Redis=require(_0xd21b('0x4'));var db=require(_0xd21b('0x5'))['db'];var utils=require(_0xd21b('0x6'));var logger=require('../../config/logger')(_0xd21b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd21b('0x8')][_0xd21b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55bf09,_0x3faa25,_0x4034a5){return new BPromise(function(_0x2eeabb,_0x59154d){return client[_0xd21b('0xa')](_0x55bf09,_0x4034a5)[_0xd21b('0xb')](function(_0x20702d){logger['info']('Trigger,\x20%s,\x20%s',_0x3faa25,_0xd21b('0xc'));logger[_0xd21b('0xd')](_0xd21b('0xe'),_0x3faa25,'request\x20sent',JSON[_0xd21b('0xf')](_0x20702d));if(_0x20702d['error']){if(_0x20702d[_0xd21b('0x10')][_0xd21b('0x11')]===0x1f4){logger[_0xd21b('0x10')](_0xd21b('0x12'),_0x3faa25,_0x20702d[_0xd21b('0x10')][_0xd21b('0x13')]);return _0x59154d(_0x20702d[_0xd21b('0x10')]['message']);}logger[_0xd21b('0x10')](_0xd21b('0x12'),_0x3faa25,_0x20702d[_0xd21b('0x10')][_0xd21b('0x13')]);return _0x2eeabb(_0x20702d['error'][_0xd21b('0x13')]);}else{logger[_0xd21b('0x14')](_0xd21b('0x12'),_0x3faa25,_0xd21b('0xc'));_0x2eeabb(_0x20702d[_0xd21b('0x15')][_0xd21b('0x13')]);}})[_0xd21b('0x16')](function(_0x43e12e){logger['error'](_0xd21b('0x12'),_0x3faa25,_0x43e12e);_0x59154d(_0x43e12e);});});}exports['GetTrigger']=function(_0x4fe2e2){var _0x242c61=this;return new Promise(function(_0x1a6607,_0x3ab047){return db['Trigger'][_0xd21b('0x17')]({'raw':_0x4fe2e2[_0xd21b('0x18')]?_0x4fe2e2[_0xd21b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4fe2e2[_0xd21b('0x18')]?_0x4fe2e2[_0xd21b('0x18')][_0xd21b('0x19')]||null:null,'attributes':_0x4fe2e2[_0xd21b('0x18')]?_0x4fe2e2['options'][_0xd21b('0x1a')]||null:null,'limit':_0x4fe2e2[_0xd21b('0x18')]?_0x4fe2e2['options'][_0xd21b('0x1b')]||null:null,'include':_0x4fe2e2[_0xd21b('0x18')]?_0x4fe2e2[_0xd21b('0x18')][_0xd21b('0x1c')]?_[_0xd21b('0x1d')](_0x4fe2e2[_0xd21b('0x18')][_0xd21b('0x1c')],function(_0x5c4893){return{'model':db[_0x5c4893['model']],'as':_0x5c4893['as'],'attributes':_0x5c4893[_0xd21b('0x1a')],'include':_0x5c4893[_0xd21b('0x1c')]?_['map'](_0x5c4893[_0xd21b('0x1c')],function(_0x5ac946){return{'model':db[_0x5ac946['model']],'as':_0x5ac946['as'],'attributes':_0x5ac946[_0xd21b('0x1a')],'include':_0x5ac946[_0xd21b('0x1c')]?_[_0xd21b('0x1d')](_0x5ac946['include'],function(_0x29a7d3){return{'model':db[_0x29a7d3[_0xd21b('0x1e')]],'as':_0x29a7d3['as'],'attributes':_0x29a7d3['attributes']};}):[]};}):[]};}):[]:[]})[_0xd21b('0xb')](function(_0x3b5abd){logger[_0xd21b('0x14')](_0xd21b('0x1f'),_0x4fe2e2);logger['debug'](_0xd21b('0x1f'),_0x4fe2e2,JSON[_0xd21b('0xf')](_0x3b5abd));_0x1a6607(_0x3b5abd);})[_0xd21b('0x16')](function(_0x96c788){logger['error'](_0xd21b('0x1f'),_0x96c788[_0xd21b('0x13')],_0x4fe2e2);_0x3ab047(_0x242c61['error'](0x1f4,_0x96c788[_0xd21b('0x13')]));});});};exports[_0xd21b('0x20')]=function(_0x19dfdb){var _0x17b981=this;return new Promise(function(_0x26c2f9,_0x22d94f){return db['Trigger'][_0xd21b('0x21')]({'raw':_0x19dfdb[_0xd21b('0x18')]?_0x19dfdb['options'][_0xd21b('0x22')]===undefined?!![]:![]:!![],'where':_0x19dfdb['options']?_0x19dfdb[_0xd21b('0x18')][_0xd21b('0x19')]||null:null,'attributes':_0x19dfdb[_0xd21b('0x18')]?_0x19dfdb['options'][_0xd21b('0x1a')]||null:null,'include':_0x19dfdb[_0xd21b('0x18')]?_0x19dfdb[_0xd21b('0x18')][_0xd21b('0x1c')]?_[_0xd21b('0x1d')](_0x19dfdb[_0xd21b('0x18')][_0xd21b('0x1c')],function(_0x139d32){return{'model':db[_0x139d32[_0xd21b('0x1e')]],'as':_0x139d32['as'],'attributes':_0x139d32[_0xd21b('0x1a')],'include':_0x139d32[_0xd21b('0x1c')]?_[_0xd21b('0x1d')](_0x139d32[_0xd21b('0x1c')],function(_0x4023b0){return{'model':db[_0x4023b0[_0xd21b('0x1e')]],'as':_0x4023b0['as'],'attributes':_0x4023b0[_0xd21b('0x1a')],'include':_0x4023b0[_0xd21b('0x1c')]?_[_0xd21b('0x1d')](_0x4023b0[_0xd21b('0x1c')],function(_0x2f09bd){return{'model':db[_0x2f09bd[_0xd21b('0x1e')]],'as':_0x2f09bd['as'],'attributes':_0x2f09bd[_0xd21b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd21b('0xb')](function(_0x53816c){logger[_0xd21b('0x14')](_0xd21b('0x20'),_0x19dfdb);logger[_0xd21b('0xd')](_0xd21b('0x20'),_0x19dfdb,JSON[_0xd21b('0xf')](_0x53816c));_0x26c2f9(_0x53816c);})[_0xd21b('0x16')](function(_0x34167c){logger['error']('ShowTrigger',_0x34167c[_0xd21b('0x13')],_0x19dfdb);_0x22d94f(_0x17b981['error'](0x1f4,_0x34167c[_0xd21b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 08055ba..2e69af2 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 _0x475f=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','put','update','delete'];(function(_0x1cc90a,_0x594704){var _0x248658=function(_0x36ed05){while(--_0x36ed05){_0x1cc90a['push'](_0x1cc90a['shift']());}};_0x248658(++_0x594704);}(_0x475f,0x189));var _0xf475=function(_0x2062e5,_0x20051e){_0x2062e5=_0x2062e5-0x0;var _0x3bcf3d=_0x475f[_0x2062e5];return _0x3bcf3d;};'use strict';var multer=require(_0xf475('0x0'));var util=require(_0xf475('0x1'));var path=require(_0xf475('0x2'));var timeout=require(_0xf475('0x3'));var express=require(_0xf475('0x4'));var router=express[_0xf475('0x5')]();var fs_extra=require(_0xf475('0x6'));var auth=require(_0xf475('0x7'));var interaction=require(_0xf475('0x8'));var config=require('../../config/environment');var controller=require(_0xf475('0x9'));router[_0xf475('0xa')]('/',auth[_0xf475('0xb')](),controller[_0xf475('0xc')]);router[_0xf475('0xa')](_0xf475('0xd'),auth[_0xf475('0xb')](),controller[_0xf475('0xe')]);router[_0xf475('0xf')](_0xf475('0x10'),auth[_0xf475('0xb')](),controller[_0xf475('0x11')]);router[_0xf475('0xf')]('/',auth[_0xf475('0xb')](),controller['create']);router[_0xf475('0x12')]('/:id',auth[_0xf475('0xb')](),controller[_0xf475('0x13')]);router[_0xf475('0x14')](_0xf475('0xd'),auth['isAuthenticated'](),controller[_0xf475('0x15')]);module[_0xf475('0x16')]=router; \ No newline at end of file +var _0x0396=['../../components/auth/service','./trunk.controller','get','isAuthenticated','/:id','show','/:id/clone','clone','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x37dbbb,_0x1909de){var _0x10068f=function(_0x2464b0){while(--_0x2464b0){_0x37dbbb['push'](_0x37dbbb['shift']());}};_0x10068f(++_0x1909de);}(_0x0396,0x19d));var _0x6039=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x0396[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x6039('0x0'));var util=require(_0x6039('0x1'));var path=require(_0x6039('0x2'));var timeout=require(_0x6039('0x3'));var express=require(_0x6039('0x4'));var router=express[_0x6039('0x5')]();var fs_extra=require(_0x6039('0x6'));var auth=require(_0x6039('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6039('0x8'));router[_0x6039('0x9')]('/',auth[_0x6039('0xa')](),controller['index']);router[_0x6039('0x9')](_0x6039('0xb'),auth[_0x6039('0xa')](),controller[_0x6039('0xc')]);router['post'](_0x6039('0xd'),auth[_0x6039('0xa')](),controller[_0x6039('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6039('0xf')]);router[_0x6039('0x10')](_0x6039('0xb'),auth[_0x6039('0xa')](),controller['update']);router[_0x6039('0x11')]('/:id',auth[_0x6039('0xa')](),controller[_0x6039('0x12')]);module[_0x6039('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 46f9cb2..76e679c 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 _0x3c53=['fingerprint','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uas','pai'];(function(_0x573fe9,_0x5358a3){var _0x49889e=function(_0x302d26){while(--_0x302d26){_0x573fe9['push'](_0x573fe9['shift']());}};_0x49889e(++_0x5358a3);}(_0x3c53,0x1e4));var _0x33c5=function(_0x30df37,_0x48ad64){_0x30df37=_0x30df37-0x0;var _0x41ab55=_0x3c53[_0x30df37];return _0x41ab55;};'use strict';var Sequelize=require(_0x33c5('0x0'));module[_0x33c5('0x1')]={'name':{'type':Sequelize[_0x33c5('0x2')],'allowNull':![],'unique':_0x33c5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x33c5('0x4')]('friend',_0x33c5('0x5'),_0x33c5('0x6')),'allowNull':![],'defaultValue':_0x33c5('0x7')},'context':{'type':Sequelize[_0x33c5('0x2')],'allowNull':![],'defaultValue':_0x33c5('0x8')},'callingpres':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x9'),_0x33c5('0xa'),_0x33c5('0xb'),'ALLOWED',_0x33c5('0xc'),'PROHIB_PASSED_SCREEN',_0x33c5('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0x33c5('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x33c5('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x33c5('0x2')]},'transport':{'type':Sequelize[_0x33c5('0x2')],'defaultValue':_0x33c5('0xe'),'set':function(_0x51b9a4){this['setDataValue'](_0x33c5('0xf'),_0x51b9a4?_0x51b9a4[_0x33c5('0x10')](','):null);},'get':function(){return this[_0x33c5('0x11')]('transport')?this[_0x33c5('0x11')](_0x33c5('0xf'))['split'](','):null;},'comment':_0x33c5('0x12')},'dtmfmode':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x13'),'info',_0x33c5('0x14'),_0x33c5('0x15'),_0x33c5('0x16')),'defaultValue':_0x33c5('0x13')},'directmedia':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no',_0x33c5('0x18'),_0x33c5('0x19'),_0x33c5('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x33c5('0x2')]},'directmediadeny':{'type':Sequelize[_0x33c5('0x2')]},'nat':{'type':Sequelize[_0x33c5('0x2')],'defaultValue':_0x33c5('0x1b'),'set':function(_0x753e37){this[_0x33c5('0x1c')](_0x33c5('0x1d'),_0x753e37?_0x753e37[_0x33c5('0x10')](','):null);},'get':function(){return this[_0x33c5('0x11')](_0x33c5('0x1d'))?this[_0x33c5('0x11')](_0x33c5('0x1d'))[_0x33c5('0x1e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x33c5('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x33c5('0x2')]},'language':{'type':Sequelize[_0x33c5('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x33c5('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x33c5('0x1f')},'allow':{'type':Sequelize[_0x33c5('0x2')],'allowNull':![],'defaultValue':_0x33c5('0x20'),'set':function(_0x4fd30a){this[_0x33c5('0x1c')]('allow',_0x4fd30a?_0x4fd30a['join'](';'):_0x33c5('0x20'));},'get':function(){return this['getDataValue'](_0x33c5('0x21'))?this[_0x33c5('0x11')](_0x33c5('0x21'))['split'](';'):null;},'comment':_0x33c5('0x22')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x33c5('0x2')],'defaultValue':_0x33c5('0x23'),'set':function(_0x5f0da7){this[_0x33c5('0x1c')](_0x33c5('0x24'),_0x5f0da7?_0x5f0da7['join'](','):null);},'get':function(){return this['getDataValue'](_0x33c5('0x24'))?this[_0x33c5('0x11')]('insecure')[_0x33c5('0x1e')](','):null;},'comment':_0x33c5('0x25')},'trustrpid':{'type':Sequelize[_0x33c5('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x33c5('0x26'))},'promiscredir':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x33c5('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x33c5('0x2')]},'callerid':{'type':Sequelize[_0x33c5('0x2')],'defaultValue':_0x33c5('0x27')},'amaflags':{'type':Sequelize[_0x33c5('0x2')]},'callcounter':{'type':Sequelize[_0x33c5('0x4')]('yes','no'),'defaultValue':_0x33c5('0x17')},'busylevel':{'type':Sequelize[_0x33c5('0x28')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x33c5('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x33c5('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x33c5('0x2')]},'videosupport':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no',_0x33c5('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x33c5('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x33c5('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x33c5('0x2a'),'refuse',_0x33c5('0x2b'))},'session_expires':{'type':Sequelize[_0x33c5('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x33c5('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x33c5('0x4')]('uac',_0x33c5('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x33c5('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x33c5('0x2')]},'fromuser':{'type':Sequelize[_0x33c5('0x2')]},'port':{'type':Sequelize[_0x33c5('0x28')](0x5)},'qualify':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no'),'defaultValue':_0x33c5('0x17')},'keepalive':{'type':Sequelize[_0x33c5('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x33c5('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x33c5('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x33c5('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x33c5('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no',_0x33c5('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x33c5('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x33c5('0x28')](0xb)},'timerb':{'type':Sequelize[_0x33c5('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x33c5('0x2')]},'contactdeny':{'type':Sequelize[_0x33c5('0x2')]},'contactacl':{'type':Sequelize[_0x33c5('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x33c5('0x2')]},'use_q850_reason':{'type':Sequelize[_0x33c5('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x33c5('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'force_avp':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'icesupport':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x33c5('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no',_0x33c5('0x2e'),_0x33c5('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x33c5('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x33c5('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x33c5('0x2')]},'dtlscipher':{'type':Sequelize[_0x33c5('0x2')]},'dtlscafile':{'type':Sequelize[_0x33c5('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x33c5('0x4')]('active',_0x33c5('0x30'),_0x33c5('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x33c5('0x2')]},'usereqphone':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x33c5('0x2')]},'recordofffeature':{'type':Sequelize[_0x33c5('0x2')]},'call_limit':{'type':Sequelize[_0x33c5('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x33c5('0x4')](_0x33c5('0x17'),'no')},'vmexten':{'type':Sequelize[_0x33c5('0x2')]},'mohinterpret':{'type':Sequelize[_0x33c5('0x2')]},'mohsuggest':{'type':Sequelize[_0x33c5('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x33c5('0x2')]},'host':{'type':Sequelize[_0x33c5('0x2')],'defaultValue':_0x33c5('0x32')},'canreinvite':{'type':Sequelize[_0x33c5('0x4')]('yes','no',_0x33c5('0x18'),'update',_0x33c5('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x33c5('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x33c5('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xd146=['info','inband','nonat','update','yes','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833'];(function(_0x20993e,_0x5aa54b){var _0x7c8bc2=function(_0x3b6be7){while(--_0x3b6be7){_0x20993e['push'](_0x20993e['shift']());}};_0x7c8bc2(++_0x5aa54b);}(_0xd146,0xb5));var _0x6d14=function(_0x197dda,_0x26cb2a){_0x197dda=_0x197dda-0x0;var _0x524804=_0xd146[_0x197dda];return _0x524804;};'use strict';var Sequelize=require(_0x6d14('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d14('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x3'),_0x6d14('0x4'),_0x6d14('0x5')),'allowNull':![],'defaultValue':_0x6d14('0x3')},'context':{'type':Sequelize[_0x6d14('0x1')],'allowNull':![],'defaultValue':_0x6d14('0x6')},'callingpres':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x7'),_0x6d14('0x8'),_0x6d14('0x9'),_0x6d14('0xa'),_0x6d14('0xb'),_0x6d14('0xc'),_0x6d14('0xd'),_0x6d14('0xe'))},'deny':{'type':Sequelize[_0x6d14('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x6d14('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x6d14('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x6d14('0xf'),'set':function(_0x3251c6){this[_0x6d14('0x10')](_0x6d14('0x11'),_0x3251c6?_0x3251c6[_0x6d14('0x12')](','):null);},'get':function(){return this[_0x6d14('0x13')](_0x6d14('0x11'))?this[_0x6d14('0x13')](_0x6d14('0x11'))[_0x6d14('0x14')](','):null;},'comment':_0x6d14('0x15')},'dtmfmode':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x16'),_0x6d14('0x17'),'shortinfo',_0x6d14('0x18'),'auto'),'defaultValue':_0x6d14('0x16')},'directmedia':{'type':Sequelize[_0x6d14('0x2')]('yes','no',_0x6d14('0x19'),_0x6d14('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6d14('0x1')]},'directmediadeny':{'type':Sequelize[_0x6d14('0x1')]},'nat':{'type':Sequelize[_0x6d14('0x1')],'defaultValue':_0x6d14('0x1c'),'set':function(_0x5cce5e){this[_0x6d14('0x10')](_0x6d14('0x1d'),_0x5cce5e?_0x5cce5e[_0x6d14('0x12')](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue']('nat')[_0x6d14('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x6d14('0x1')]},'namedcallgroup':{'type':Sequelize[_0x6d14('0x1')]},'pickupgroup':{'type':Sequelize[_0x6d14('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6d14('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6d14('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6d14('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6d14('0x1e'),'set':function(_0x1dec57){this[_0x6d14('0x10')](_0x6d14('0x1f'),_0x1dec57?_0x1dec57[_0x6d14('0x12')](';'):_0x6d14('0x1e'));},'get':function(){return this[_0x6d14('0x13')](_0x6d14('0x1f'))?this[_0x6d14('0x13')](_0x6d14('0x1f'))['split'](';'):null;},'comment':_0x6d14('0x20')},'autoframing':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no')},'insecure':{'type':Sequelize[_0x6d14('0x1')],'defaultValue':_0x6d14('0x21'),'set':function(_0x1e3aa7){this[_0x6d14('0x10')](_0x6d14('0x22'),_0x1e3aa7?_0x1e3aa7[_0x6d14('0x12')](','):null);},'get':function(){return this[_0x6d14('0x13')](_0x6d14('0x22'))?this[_0x6d14('0x13')](_0x6d14('0x22'))[_0x6d14('0x14')](','):null;},'comment':_0x6d14('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x6d14('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6d14('0x2')]('yes','no',_0x6d14('0x24'))},'promiscredir':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x6d14('0x2')]('yes','no')},'accountcode':{'type':Sequelize[_0x6d14('0x25')](0xb)},'setvar':{'type':Sequelize[_0x6d14('0x1')]},'callerid':{'type':Sequelize[_0x6d14('0x1')],'defaultValue':_0x6d14('0x26')},'amaflags':{'type':Sequelize[_0x6d14('0x1')]},'callcounter':{'type':Sequelize[_0x6d14('0x2')]('yes','no'),'defaultValue':_0x6d14('0x1b')},'busylevel':{'type':Sequelize[_0x6d14('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x6d14('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0x6d14('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x6d14('0x1')]},'template':{'type':Sequelize[_0x6d14('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x6d14('0x1b'),'no',_0x6d14('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6d14('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x6d14('0x1')]},'session_timers':{'type':Sequelize[_0x6d14('0x2')]('accept','refuse',_0x6d14('0x28'))},'session_expires':{'type':Sequelize[_0x6d14('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x6d14('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x29'),_0x6d14('0x2a')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x6d14('0x1')]},'fromuser':{'type':Sequelize[_0x6d14('0x1')]},'port':{'type':Sequelize[_0x6d14('0x25')](0x5)},'qualify':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x6d14('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6d14('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6d14('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no',_0x6d14('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6d14('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x6d14('0x25')](0xb)},'timerb':{'type':Sequelize[_0x6d14('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x6d14('0x1')]},'contactdeny':{'type':Sequelize[_0x6d14('0x1')]},'contactacl':{'type':Sequelize[_0x6d14('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x6d14('0x1')]},'use_q850_reason':{'type':Sequelize[_0x6d14('0x1')]},'maxforwards':{'type':Sequelize[_0x6d14('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x6d14('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6d14('0x2')]('yes','no')},'force_avp':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x6d14('0x1b'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x6d14('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x6d14('0x1b'),'no',_0x6d14('0x2c'),_0x6d14('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x6d14('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6d14('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x6d14('0x1')]},'dtlscipher':{'type':Sequelize[_0x6d14('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x2e'),_0x6d14('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6d14('0x1')]},'usereqphone':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6d14('0x1')]},'recordofffeature':{'type':Sequelize[_0x6d14('0x1')]},'call_limit':{'type':Sequelize[_0x6d14('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x6d14('0x2')](_0x6d14('0x1b'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x6d14('0x1')]},'mohsuggest':{'type':Sequelize[_0x6d14('0x1')]},'parkinglot':{'type':Sequelize[_0x6d14('0x1')]},'description':{'type':Sequelize[_0x6d14('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x6d14('0x30')},'canreinvite':{'type':Sequelize[_0x6d14('0x2')]('yes','no','nonat',_0x6d14('0x1a'),_0x6d14('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6d14('0x1')]},'otherFields':{'type':Sequelize[_0x6d14('0x1')]},'active':{'type':Sequelize[_0x6d14('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index accff70..586f156 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x572ec3,_0xaf6fba){var _0x1a8dde=function(_0x545921){while(--_0x545921){_0x572ec3['push'](_0x572ec3['shift']());}};_0x1a8dde(++_0xaf6fba);}(_0xbec5,0xe5));var _0x5bec=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xbec5[_0x35fb56];return _0x2fd52c;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file +var _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','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','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x3d53e7,_0x402859){var _0x53b9c6=function(_0x578ac5){while(--_0x578ac5){_0x3d53e7['push'](_0x3d53e7['shift']());}};_0x53b9c6(++_0x402859);}(_0xedd9,0xfc));var _0x9edd=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0xedd9[_0x56e0e8];return _0x2dab50;};'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'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index f63bbea..61bcd34 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 _0x64a0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash'];(function(_0x359cc0,_0x2cd167){var _0x55d51a=function(_0x399251){while(--_0x399251){_0x359cc0['push'](_0x359cc0['shift']());}};_0x55d51a(++_0x2cd167);}(_0x64a0,0xa7));var _0x064a=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x64a0[_0x47e549];return _0x251374;};'use strict';var _=require(_0x064a('0x0'));var util=require('util');var logger=require(_0x064a('0x1'))(_0x064a('0x2'));var moment=require(_0x064a('0x3'));var BPromise=require(_0x064a('0x4'));var rp=require(_0x064a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x064a('0x6'));var config=require(_0x064a('0x7'));var attributes=require(_0x064a('0x8'));module[_0x064a('0x9')]=function(_0x2c8923,_0x274691){return _0x2c8923[_0x064a('0xa')]('Trunk',attributes,{'tableName':_0x064a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcef6=['bluebird','request-promise','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xcef6,0x1b4));var _0x6cef=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0xcef6[_0xfc406a];return _0x395473;};'use strict';var _=require(_0x6cef('0x0'));var util=require(_0x6cef('0x1'));var logger=require(_0x6cef('0x2'))('api');var moment=require(_0x6cef('0x3'));var BPromise=require(_0x6cef('0x4'));var rp=require(_0x6cef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6cef('0x6'));module[_0x6cef('0x7')]=function(_0x10502d,_0x4fcde3){return _0x10502d[_0x6cef('0x8')](_0x6cef('0x9'),attributes,{'tableName':_0x6cef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 975b4ba..1e9dcb9 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 _0x51e7=['bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowTrunk','lodash','util','moment'];(function(_0x3a85a6,_0x206848){var _0x5614bb=function(_0x4e1166){while(--_0x4e1166){_0x3a85a6['push'](_0x3a85a6['shift']());}};_0x5614bb(++_0x206848);}(_0x51e7,0x17e));var _0x751e=function(_0x5dd13a,_0x26a9c2){_0x5dd13a=_0x5dd13a-0x0;var _0x34b015=_0x51e7[_0x5dd13a];return _0x34b015;};'use strict';var _=require(_0x751e('0x0'));var util=require(_0x751e('0x1'));var moment=require(_0x751e('0x2'));var BPromise=require(_0x751e('0x3'));var rs=require(_0x751e('0x4'));var fs=require('fs');var Redis=require(_0x751e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x751e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x751e('0x7'));var jayson=require(_0x751e('0x8'));var client=jayson['client'][_0x751e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39f691,_0x3927e0,_0x246938){return new BPromise(function(_0x280aed,_0x3b74db){return client[_0x751e('0xa')](_0x39f691,_0x246938)[_0x751e('0xb')](function(_0x553df3){logger[_0x751e('0xc')](_0x751e('0xd'),_0x3927e0,_0x751e('0xe'));logger[_0x751e('0xf')](_0x751e('0x10'),_0x3927e0,'request\x20sent',JSON[_0x751e('0x11')](_0x553df3));if(_0x553df3[_0x751e('0x12')]){if(_0x553df3[_0x751e('0x12')]['code']===0x1f4){logger['error'](_0x751e('0xd'),_0x3927e0,_0x553df3[_0x751e('0x12')][_0x751e('0x13')]);return _0x3b74db(_0x553df3[_0x751e('0x12')][_0x751e('0x13')]);}logger[_0x751e('0x12')](_0x751e('0xd'),_0x3927e0,_0x553df3[_0x751e('0x12')][_0x751e('0x13')]);return _0x280aed(_0x553df3['error'][_0x751e('0x13')]);}else{logger[_0x751e('0xc')](_0x751e('0xd'),_0x3927e0,_0x751e('0xe'));_0x280aed(_0x553df3[_0x751e('0x14')][_0x751e('0x13')]);}})[_0x751e('0x15')](function(_0x5d377c){logger[_0x751e('0x12')](_0x751e('0xd'),_0x3927e0,_0x5d377c);_0x3b74db(_0x5d377c);});});}exports[_0x751e('0x16')]=function(_0x5007bc){var _0x2a7979=this;return new Promise(function(_0xbcf659,_0x418c33){return db[_0x751e('0x17')][_0x751e('0x18')]({'raw':_0x5007bc[_0x751e('0x19')]?_0x5007bc[_0x751e('0x19')][_0x751e('0x1a')]===undefined?!![]:![]:!![],'where':_0x5007bc[_0x751e('0x19')]?_0x5007bc[_0x751e('0x19')][_0x751e('0x1b')]||null:null,'attributes':_0x5007bc[_0x751e('0x19')]?_0x5007bc[_0x751e('0x19')]['attributes']||null:null,'limit':_0x5007bc[_0x751e('0x19')]?_0x5007bc['options'][_0x751e('0x1c')]||null:null,'include':_0x5007bc[_0x751e('0x19')]?_0x5007bc['options'][_0x751e('0x1d')]?_[_0x751e('0x1e')](_0x5007bc[_0x751e('0x19')][_0x751e('0x1d')],function(_0x36bfba){return{'model':db[_0x36bfba[_0x751e('0x1f')]],'as':_0x36bfba['as'],'attributes':_0x36bfba[_0x751e('0x20')],'include':_0x36bfba[_0x751e('0x1d')]?_[_0x751e('0x1e')](_0x36bfba[_0x751e('0x1d')],function(_0x198c00){return{'model':db[_0x198c00[_0x751e('0x1f')]],'as':_0x198c00['as'],'attributes':_0x198c00[_0x751e('0x20')],'include':_0x198c00[_0x751e('0x1d')]?_[_0x751e('0x1e')](_0x198c00[_0x751e('0x1d')],function(_0x559acf){return{'model':db[_0x559acf['model']],'as':_0x559acf['as'],'attributes':_0x559acf[_0x751e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x751e('0xb')](function(_0x2f0ba1){logger['info'](_0x751e('0x16'),_0x5007bc);logger[_0x751e('0xf')](_0x751e('0x16'),_0x5007bc,JSON[_0x751e('0x11')](_0x2f0ba1));_0xbcf659(_0x2f0ba1);})[_0x751e('0x15')](function(_0x3dc59f){logger[_0x751e('0x12')](_0x751e('0x16'),_0x3dc59f['message'],_0x5007bc);_0x418c33(_0x2a7979[_0x751e('0x12')](0x1f4,_0x3dc59f[_0x751e('0x13')]));});});};exports['ShowTrunk']=function(_0x10494a){var _0x5256cd=this;return new Promise(function(_0x46c706,_0x36f51c){return db[_0x751e('0x17')][_0x751e('0x21')]({'raw':_0x10494a[_0x751e('0x19')]?_0x10494a[_0x751e('0x19')][_0x751e('0x1a')]===undefined?!![]:![]:!![],'where':_0x10494a[_0x751e('0x19')]?_0x10494a[_0x751e('0x19')][_0x751e('0x1b')]||null:null,'attributes':_0x10494a[_0x751e('0x19')]?_0x10494a[_0x751e('0x19')][_0x751e('0x20')]||null:null,'include':_0x10494a[_0x751e('0x19')]?_0x10494a[_0x751e('0x19')][_0x751e('0x1d')]?_[_0x751e('0x1e')](_0x10494a[_0x751e('0x19')][_0x751e('0x1d')],function(_0x372d52){return{'model':db[_0x372d52[_0x751e('0x1f')]],'as':_0x372d52['as'],'attributes':_0x372d52['attributes'],'include':_0x372d52[_0x751e('0x1d')]?_[_0x751e('0x1e')](_0x372d52[_0x751e('0x1d')],function(_0x3ab809){return{'model':db[_0x3ab809[_0x751e('0x1f')]],'as':_0x3ab809['as'],'attributes':_0x3ab809[_0x751e('0x20')],'include':_0x3ab809[_0x751e('0x1d')]?_[_0x751e('0x1e')](_0x3ab809[_0x751e('0x1d')],function(_0x1095f8){return{'model':db[_0x1095f8['model']],'as':_0x1095f8['as'],'attributes':_0x1095f8[_0x751e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18caca){logger[_0x751e('0xc')](_0x751e('0x22'),_0x10494a);logger['debug']('ShowTrunk',_0x10494a,JSON[_0x751e('0x11')](_0x18caca));_0x46c706(_0x18caca);})[_0x751e('0x15')](function(_0x1cdc1f){logger[_0x751e('0x12')]('ShowTrunk',_0x1cdc1f[_0x751e('0x13')],_0x10494a);_0x36f51c(_0x5256cd['error'](0x1f4,_0x1cdc1f[_0x751e('0x13')]));});});}; \ No newline at end of file +var _0x045a=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','include','map','model','attributes','ShowTrunk','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x193ff3,_0x35c303){var _0x4aba18=function(_0x542f45){while(--_0x542f45){_0x193ff3['push'](_0x193ff3['shift']());}};_0x4aba18(++_0x35c303);}(_0x045a,0xf1));var _0xa045=function(_0x2d4877,_0x59b057){_0x2d4877=_0x2d4877-0x0;var _0x2d4fec=_0x045a[_0x2d4877];return _0x2d4fec;};'use strict';var _=require(_0xa045('0x0'));var util=require(_0xa045('0x1'));var moment=require('moment');var BPromise=require(_0xa045('0x2'));var rs=require(_0xa045('0x3'));var fs=require('fs');var Redis=require(_0xa045('0x4'));var db=require(_0xa045('0x5'))['db'];var utils=require(_0xa045('0x6'));var logger=require(_0xa045('0x7'))(_0xa045('0x8'));var config=require(_0xa045('0x9'));var jayson=require(_0xa045('0xa'));var client=jayson[_0xa045('0xb')][_0xa045('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ad609,_0x5dfed5,_0x420027){return new BPromise(function(_0x4cc7e1,_0x577218){return client['request'](_0x3ad609,_0x420027)[_0xa045('0xd')](function(_0x584b32){logger[_0xa045('0xe')](_0xa045('0xf'),_0x5dfed5,_0xa045('0x10'));logger[_0xa045('0x11')](_0xa045('0x12'),_0x5dfed5,'request\x20sent',JSON[_0xa045('0x13')](_0x584b32));if(_0x584b32['error']){if(_0x584b32[_0xa045('0x14')][_0xa045('0x15')]===0x1f4){logger['error'](_0xa045('0xf'),_0x5dfed5,_0x584b32['error'][_0xa045('0x16')]);return _0x577218(_0x584b32[_0xa045('0x14')][_0xa045('0x16')]);}logger[_0xa045('0x14')](_0xa045('0xf'),_0x5dfed5,_0x584b32[_0xa045('0x14')]['message']);return _0x4cc7e1(_0x584b32[_0xa045('0x14')][_0xa045('0x16')]);}else{logger[_0xa045('0xe')](_0xa045('0xf'),_0x5dfed5,'request\x20sent');_0x4cc7e1(_0x584b32[_0xa045('0x17')]['message']);}})[_0xa045('0x18')](function(_0x1e2505){logger[_0xa045('0x14')]('Trunk,\x20%s,\x20%s',_0x5dfed5,_0x1e2505);_0x577218(_0x1e2505);});});}exports[_0xa045('0x19')]=function(_0xcf33d9){var _0x2961eb=this;return new Promise(function(_0x14df1c,_0x261db5){return db[_0xa045('0x1a')][_0xa045('0x1b')]({'raw':_0xcf33d9[_0xa045('0x1c')]?_0xcf33d9[_0xa045('0x1c')][_0xa045('0x1d')]===undefined?!![]:![]:!![],'where':_0xcf33d9[_0xa045('0x1c')]?_0xcf33d9['options'][_0xa045('0x1e')]||null:null,'attributes':_0xcf33d9['options']?_0xcf33d9[_0xa045('0x1c')]['attributes']||null:null,'limit':_0xcf33d9[_0xa045('0x1c')]?_0xcf33d9[_0xa045('0x1c')]['limit']||null:null,'include':_0xcf33d9[_0xa045('0x1c')]?_0xcf33d9[_0xa045('0x1c')][_0xa045('0x1f')]?_[_0xa045('0x20')](_0xcf33d9[_0xa045('0x1c')][_0xa045('0x1f')],function(_0x2d780f){return{'model':db[_0x2d780f[_0xa045('0x21')]],'as':_0x2d780f['as'],'attributes':_0x2d780f[_0xa045('0x22')],'include':_0x2d780f[_0xa045('0x1f')]?_[_0xa045('0x20')](_0x2d780f[_0xa045('0x1f')],function(_0x1a4c0b){return{'model':db[_0x1a4c0b[_0xa045('0x21')]],'as':_0x1a4c0b['as'],'attributes':_0x1a4c0b[_0xa045('0x22')],'include':_0x1a4c0b[_0xa045('0x1f')]?_['map'](_0x1a4c0b[_0xa045('0x1f')],function(_0x4d06ef){return{'model':db[_0x4d06ef[_0xa045('0x21')]],'as':_0x4d06ef['as'],'attributes':_0x4d06ef['attributes']};}):[]};}):[]};}):[]:[]})[_0xa045('0xd')](function(_0x402676){logger[_0xa045('0xe')]('GetTrunk',_0xcf33d9);logger[_0xa045('0x11')](_0xa045('0x19'),_0xcf33d9,JSON[_0xa045('0x13')](_0x402676));_0x14df1c(_0x402676);})['catch'](function(_0x6c12f4){logger['error'](_0xa045('0x19'),_0x6c12f4[_0xa045('0x16')],_0xcf33d9);_0x261db5(_0x2961eb[_0xa045('0x14')](0x1f4,_0x6c12f4['message']));});});};exports[_0xa045('0x23')]=function(_0x1cbbdc){var _0x1e2eea=this;return new Promise(function(_0x464903,_0x307b7f){return db[_0xa045('0x1a')][_0xa045('0x24')]({'raw':_0x1cbbdc[_0xa045('0x1c')]?_0x1cbbdc['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cbbdc[_0xa045('0x1c')]?_0x1cbbdc[_0xa045('0x1c')]['where']||null:null,'attributes':_0x1cbbdc[_0xa045('0x1c')]?_0x1cbbdc[_0xa045('0x1c')]['attributes']||null:null,'include':_0x1cbbdc[_0xa045('0x1c')]?_0x1cbbdc[_0xa045('0x1c')][_0xa045('0x1f')]?_[_0xa045('0x20')](_0x1cbbdc[_0xa045('0x1c')]['include'],function(_0x2c6dd0){return{'model':db[_0x2c6dd0[_0xa045('0x21')]],'as':_0x2c6dd0['as'],'attributes':_0x2c6dd0['attributes'],'include':_0x2c6dd0['include']?_['map'](_0x2c6dd0[_0xa045('0x1f')],function(_0x5a7a41){return{'model':db[_0x5a7a41[_0xa045('0x21')]],'as':_0x5a7a41['as'],'attributes':_0x5a7a41['attributes'],'include':_0x5a7a41[_0xa045('0x1f')]?_[_0xa045('0x20')](_0x5a7a41[_0xa045('0x1f')],function(_0x4b1ea2){return{'model':db[_0x4b1ea2[_0xa045('0x21')]],'as':_0x4b1ea2['as'],'attributes':_0x4b1ea2[_0xa045('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa045('0xd')](function(_0x129f18){logger[_0xa045('0xe')](_0xa045('0x23'),_0x1cbbdc);logger[_0xa045('0x11')](_0xa045('0x23'),_0x1cbbdc,JSON[_0xa045('0x13')](_0x129f18));_0x464903(_0x129f18);})[_0xa045('0x18')](function(_0x5554ae){logger['error']('ShowTrunk',_0x5554ae[_0xa045('0x16')],_0x1cbbdc);_0x307b7f(_0x1e2eea['error'](0x1f4,_0x5554ae[_0xa045('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index e3b8ff8..d912efb 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 _0xbc05=['exports','Router','../../components/auth/service','./user-setting.controller'];(function(_0x89fb2a,_0x29586a){var _0x400a12=function(_0x475eee){while(--_0x475eee){_0x89fb2a['push'](_0x89fb2a['shift']());}};_0x400a12(++_0x29586a);}(_0xbc05,0xad));var _0x5bc0=function(_0xcb6b2f,_0x4b4246){_0xcb6b2f=_0xcb6b2f-0x0;var _0x15d913=_0xbc05[_0xcb6b2f];return _0x15d913;};'use strict';var express=require('express');var router=express[_0x5bc0('0x0')]();var auth=require(_0x5bc0('0x1'));var controller=require(_0x5bc0('0x2'));router['put']('/:id',auth['isAuthenticated'](),controller['update']);module[_0x5bc0('0x3')]=router; \ No newline at end of file +var _0x3bbd=['put','/:id','update','exports','express','Router','../../components/auth/service','./user-setting.controller'];(function(_0x27f491,_0x1b74f4){var _0x86f9de=function(_0x449a37){while(--_0x449a37){_0x27f491['push'](_0x27f491['shift']());}};_0x86f9de(++_0x1b74f4);}(_0x3bbd,0x16c));var _0xd3bb=function(_0x3f20ce,_0x4cd4b2){_0x3f20ce=_0x3f20ce-0x0;var _0x18ca5b=_0x3bbd[_0x3f20ce];return _0x18ca5b;};'use strict';var express=require(_0xd3bb('0x0'));var router=express[_0xd3bb('0x1')]();var auth=require(_0xd3bb('0x2'));var controller=require(_0xd3bb('0x3'));router[_0xd3bb('0x4')](_0xd3bb('0x5'),auth['isAuthenticated'](),controller[_0xd3bb('0x6')]);module[_0xd3bb('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 acbcc0c..3b6d598 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 _0x0c95=['ENUM','BOOLEAN','TEXT','DATE','UserId','sequelize','error','warning','debug','exports'];(function(_0x5ae39b,_0x14846f){var _0x322a68=function(_0x359fb7){while(--_0x359fb7){_0x5ae39b['push'](_0x5ae39b['shift']());}};_0x322a68(++_0x14846f);}(_0x0c95,0x159));var _0x50c9=function(_0x1bda09,_0x1d8be5){_0x1bda09=_0x1bda09-0x0;var _0x17be2d=_0x0c95[_0x1bda09];return _0x17be2d;};'use strict';var Sequelize=require(_0x50c9('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x50c9('0x1'),_0x50c9('0x2'),'info',_0x50c9('0x3')];module[_0x50c9('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x50c9('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x50c9('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x50c9('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x50c9('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x50c9('0x9')}}; \ No newline at end of file +var _0xa558=['INTEGER','UserId','sequelize','warning','info','debug','exports','ENUM','error','BOOLEAN','TEXT'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xa558,0x199));var _0x8a55=function(_0x2b8e06,_0x58db70){_0x2b8e06=_0x2b8e06-0x0;var _0x123184=_0xa558[_0x2b8e06];return _0x123184;};'use strict';var Sequelize=require(_0x8a55('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x8a55('0x1'),_0x8a55('0x2'),_0x8a55('0x3')];module[_0x8a55('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x8a55('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x8a55('0x6'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8a55('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x8a55('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x8a55('0x9')],'unique':_0x8a55('0xa')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 29c68cd..def0426 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 _0xc9f5=['params','Invalid\x20user\x20setting\x20id','UserSetting','find','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','register','defaults','localhost','status','json','update','then','sendStatus','stack','name','send','user','role','admin','Unauthorized'];(function(_0x3c7b09,_0x3e1273){var _0x562758=function(_0x2e014a){while(--_0x2e014a){_0x3c7b09['push'](_0x3c7b09['shift']());}};_0x562758(++_0x3e1273);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0xc9f5[_0x4fbb86];return _0xb141fe;};'use strict';var _=require('lodash');var Redis=require(_0x5c9f('0x0'));var logger=require(_0x5c9f('0x1'))('api');var config=require(_0x5c9f('0x2'));var db=require(_0x5c9f('0x3'))['db'];var socket=require(_0x5c9f('0x4'))(new Redis(config['redis']));require('./user-setting.socket')[_0x5c9f('0x5')](socket);config['redis']=_[_0x5c9f('0x6')](config['redis'],{'host':_0x5c9f('0x7'),'port':0x18eb});function respondWithResult(_0x3a3cc8,_0x420a0c){_0x420a0c=_0x420a0c||0xc8;return function(_0x11e390){if(_0x11e390){return _0x3a3cc8[_0x5c9f('0x8')](_0x420a0c)[_0x5c9f('0x9')](_0x11e390);}};}function saveUpdates(_0x216f5a){return function(_0x258fe5){if(_0x258fe5){return _0x258fe5[_0x5c9f('0xa')](_0x216f5a)[_0x5c9f('0xb')](function(_0x397c29){return _0x397c29;});}return null;};}function handleEntityNotFound(_0x46ab02){return function(_0xd735fd){if(!_0xd735fd){_0x46ab02[_0x5c9f('0xc')](0x194);}return _0xd735fd;};}function handleError(_0x1c0690,_0x313173){_0x313173=_0x313173||0x1f4;return function(_0x1d6ef1){logger['error'](_0x1d6ef1[_0x5c9f('0xd')]);if(_0x1d6ef1[_0x5c9f('0xe')]){delete _0x1d6ef1[_0x5c9f('0xe')];}_0x1c0690[_0x5c9f('0x8')](_0x313173)[_0x5c9f('0xf')](_0x1d6ef1);};}exports[_0x5c9f('0xa')]=function(_0x5d8309,_0x29e02b){if(_0x5d8309[_0x5c9f('0x10')][_0x5c9f('0x11')]!==_0x5c9f('0x12'))throw new Error(_0x5c9f('0x13'));if(isNaN(Number(_0x5d8309[_0x5c9f('0x14')]['id'])))throw new Error(_0x5c9f('0x15'));return db[_0x5c9f('0x16')][_0x5c9f('0x17')]({'where':{'id':_0x5d8309['params']['id']}})['then'](handleEntityNotFound(_0x29e02b,null))['then'](saveUpdates(_0x5d8309['body'],null))['then'](respondWithResult(_0x29e02b,null))['catch'](handleError(_0x29e02b,null));}; \ No newline at end of file +var _0xd1d4=['ioredis','api','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','then','sendStatus','error','stack','name','status','update','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','lodash'];(function(_0x60e609,_0x24a1a4){var _0x18584f=function(_0x40c7ac){while(--_0x40c7ac){_0x60e609['push'](_0x60e609['shift']());}};_0x18584f(++_0x24a1a4);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd1d4[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x4d1d('0x0'));var Redis=require(_0x4d1d('0x1'));var logger=require('../../config/logger')(_0x4d1d('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x4d1d('0x3'))(new Redis(config[_0x4d1d('0x4')]));require(_0x4d1d('0x5'))[_0x4d1d('0x6')](socket);config[_0x4d1d('0x4')]=_[_0x4d1d('0x7')](config[_0x4d1d('0x4')],{'host':_0x4d1d('0x8'),'port':0x18eb});function respondWithResult(_0x1547d5,_0x1e0694){_0x1e0694=_0x1e0694||0xc8;return function(_0x23f6c4){if(_0x23f6c4){return _0x1547d5['status'](_0x1e0694)['json'](_0x23f6c4);}};}function saveUpdates(_0x26fbcf){return function(_0x371de3){if(_0x371de3){return _0x371de3['update'](_0x26fbcf)[_0x4d1d('0x9')](function(_0x33d8a7){return _0x33d8a7;});}return null;};}function handleEntityNotFound(_0x3551f4){return function(_0x248db3){if(!_0x248db3){_0x3551f4[_0x4d1d('0xa')](0x194);}return _0x248db3;};}function handleError(_0x1d8ca8,_0x7cd852){_0x7cd852=_0x7cd852||0x1f4;return function(_0x19a888){logger[_0x4d1d('0xb')](_0x19a888[_0x4d1d('0xc')]);if(_0x19a888[_0x4d1d('0xd')]){delete _0x19a888[_0x4d1d('0xd')];}_0x1d8ca8[_0x4d1d('0xe')](_0x7cd852)['send'](_0x19a888);};}exports[_0x4d1d('0xf')]=function(_0x2e00f8,_0x4383ae){if(_0x2e00f8[_0x4d1d('0x10')]['role']!=='admin')throw new Error(_0x4d1d('0x11'));if(isNaN(Number(_0x2e00f8[_0x4d1d('0x12')]['id'])))throw new Error(_0x4d1d('0x13'));return db['UserSetting'][_0x4d1d('0x14')]({'where':{'id':_0x2e00f8[_0x4d1d('0x12')]['id']}})[_0x4d1d('0x9')](handleEntityNotFound(_0x4383ae,null))[_0x4d1d('0x9')](saveUpdates(_0x2e00f8['body'],null))['then'](respondWithResult(_0x4383ae,null))['catch'](handleError(_0x4383ae,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 1172265..d9f0e8f 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 _0xe952=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe952,0x12d));var _0x2e95=function(_0x18a6d8,_0x123fff){_0x18a6d8=_0x18a6d8-0x0;var _0x12248b=_0xe952[_0x18a6d8];return _0x12248b;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x2e95('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x2e95('0x1')](0x0);var events={'afterCreate':_0x2e95('0x2'),'afterUpdate':_0x2e95('0x3'),'afterDestroy':_0x2e95('0x4')};function emitEvent(_0x517ed3){return function(_0x5b46ce,_0x282283,_0x1b2231){UserSettingEvents[_0x2e95('0x5')](_0x517ed3+':'+_0x5b46ce['id'],_0x5b46ce);UserSettingEvents[_0x2e95('0x5')](_0x517ed3,_0x5b46ce);_0x1b2231(null);};}for(var e in events){if(events[_0x2e95('0x6')](e)){var event=events[e];UserSetting[_0x2e95('0x7')](e,emitEvent(event));}}module[_0x2e95('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x032c=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1e25aa,_0x491457){var _0x1e49d6=function(_0x3fd8b5){while(--_0x3fd8b5){_0x1e25aa['push'](_0x1e25aa['shift']());}};_0x1e49d6(++_0x491457);}(_0x032c,0xff));var _0xc032=function(_0x1a78f0,_0x398b53){_0x1a78f0=_0x1a78f0-0x0;var _0x3704e5=_0x032c[_0x1a78f0];return _0x3704e5;};'use strict';var EventEmitter=require(_0xc032('0x0'));var UserSetting=require(_0xc032('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc032('0x2')](0x0);var events={'afterCreate':_0xc032('0x3'),'afterUpdate':_0xc032('0x4'),'afterDestroy':_0xc032('0x5')};function emitEvent(_0x169c66){return function(_0x28bac3,_0x2c796e,_0x5cb19d){UserSettingEvents[_0xc032('0x6')](_0x169c66+':'+_0x28bac3['id'],_0x28bac3);UserSettingEvents[_0xc032('0x6')](_0x169c66,_0x28bac3);_0x5cb19d(null);};}for(var e in events){if(events[_0xc032('0x7')](e)){var event=events[e];UserSetting[_0xc032('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 2b81877..fe279b6 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 _0xf69c=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','user_settings'];(function(_0x59981f,_0x555884){var _0x7a2501=function(_0x3ac388){while(--_0x3ac388){_0x59981f['push'](_0x59981f['shift']());}};_0x7a2501(++_0x555884);}(_0xf69c,0x1e2));var _0xcf69=function(_0x32f776,_0x1bf7e6){_0x32f776=_0x32f776-0x0;var _0xa9f55=_0xf69c[_0x32f776];return _0xa9f55;};'use strict';var attributes=require(_0xcf69('0x0'));module[_0xcf69('0x1')]=function(_0x478546){return _0x478546[_0xcf69('0x2')]('UserSetting',attributes,{'tableName':_0xcf69('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x465240){if(!_0x465240[_0xcf69('0x4')])_0x465240['clientSideLoggingEnabledSince']=null;else if(_0x465240[_0xcf69('0x5')]===null)_0x465240[_0xcf69('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x6b24=['UserSetting','clientSideLoggingEnabledSince','exports','define'];(function(_0x4adad3,_0x202bba){var _0x52dae4=function(_0x562ccb){while(--_0x562ccb){_0x4adad3['push'](_0x4adad3['shift']());}};_0x52dae4(++_0x202bba);}(_0x6b24,0x1ce));var _0x46b2=function(_0xca2488,_0x14de01){_0xca2488=_0xca2488-0x0;var _0xa77bb9=_0x6b24[_0xca2488];return _0xa77bb9;};'use strict';var attributes=require('./user-setting.attributes');module[_0x46b2('0x0')]=function(_0x1e72c7){return _0x1e72c7[_0x46b2('0x1')](_0x46b2('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x529a0c){if(!_0x529a0c['clientSideLoggingEnabled'])_0x529a0c[_0x46b2('0x3')]=null;else if(_0x529a0c['clientSideLoggingEnabledSince']===null)_0x529a0c[_0x46b2('0x3')]=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 ca0422d..3ff4bf7 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 _0x9d78=['remove','emit','register','length','user-setting:','./user-setting.events','save'];(function(_0x333fed,_0x3d2122){var _0x12cac2=function(_0x41d9af){while(--_0x41d9af){_0x333fed['push'](_0x333fed['shift']());}};_0x12cac2(++_0x3d2122);}(_0x9d78,0xde));var _0x89d7=function(_0x2140ae,_0x276645){_0x2140ae=_0x2140ae-0x0;var _0x33ccc7=_0x9d78[_0x2140ae];return _0x33ccc7;};'use strict';var UserSettingEvents=require(_0x89d7('0x0'));var events=[_0x89d7('0x1'),_0x89d7('0x2'),'update'];function createListener(_0x18eeb8,_0x4d20bb){return function(_0x507d0c){_0x4d20bb['emit'](_0x18eeb8,_0x507d0c);if(_0x18eeb8==='user-setting:update'){_0x4d20bb[_0x89d7('0x3')]('user-setting:update:user-'+_0x507d0c['UserId'],_0x507d0c);}};}exports[_0x89d7('0x4')]=function(_0x2dfa20){for(var _0x3e7df0=0x0,_0x45d6a7=events[_0x89d7('0x5')];_0x3e7df0<_0x45d6a7;_0x3e7df0++){var _0x3b8dec=events[_0x3e7df0];var _0x46bcfe=createListener(_0x89d7('0x6')+_0x3b8dec,_0x2dfa20);UserSettingEvents['on'](_0x3b8dec,_0x46bcfe);}}; \ No newline at end of file +var _0xafb2=['register','length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xafb2,0xd4));var _0x2afb=function(_0x18e094,_0x5d233a){_0x18e094=_0x18e094-0x0;var _0x56368f=_0xafb2[_0x18e094];return _0x56368f;};'use strict';var UserSettingEvents=require(_0x2afb('0x0'));var events=[_0x2afb('0x1'),_0x2afb('0x2'),_0x2afb('0x3')];function createListener(_0x3ce07e,_0x331c26){return function(_0x593d3b){_0x331c26[_0x2afb('0x4')](_0x3ce07e,_0x593d3b);if(_0x3ce07e===_0x2afb('0x5')){_0x331c26[_0x2afb('0x4')](_0x2afb('0x6')+_0x593d3b[_0x2afb('0x7')],_0x593d3b);}};}exports[_0x2afb('0x8')]=function(_0x3a5211){for(var _0x422e36=0x0,_0x453668=events[_0x2afb('0x9')];_0x422e36<_0x453668;_0x422e36++){var _0x250e33=events[_0x422e36];var _0x2ef58f=createListener(_0x2afb('0xa')+_0x250e33,_0x3a5211);UserSettingEvents['on'](_0x250e33,_0x2ef58f);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index e4b45d3..43d7182 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 _0xc366=['file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','addSmsAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','messengerSoundNotification','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','post','addContacts','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single'];(function(_0x9213a5,_0x5aeddb){var _0x31353c=function(_0x50eaa6){while(--_0x50eaa6){_0x9213a5['push'](_0x9213a5['shift']());}};_0x31353c(++_0x5aeddb);}(_0xc366,0x10d));var _0x6c36=function(_0x3e2a16,_0x2bdf89){_0x3e2a16=_0x3e2a16-0x0;var _0x226dfc=_0xc366[_0x3e2a16];return _0x226dfc;};'use strict';var multer=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var path=require(_0x6c36('0x2'));var timeout=require(_0x6c36('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6c36('0x4'));var interaction=require(_0x6c36('0x5'));var config=require(_0x6c36('0x6'));var controller=require('./user.controller');router[_0x6c36('0x7')]('/',auth[_0x6c36('0x8')](),controller['index']);router[_0x6c36('0x7')](_0x6c36('0x9'),auth[_0x6c36('0x8')](),controller['describe']);router[_0x6c36('0x7')](_0x6c36('0xa'),auth[_0x6c36('0x8')](),controller[_0x6c36('0xb')]);router[_0x6c36('0x7')](_0x6c36('0xc'),auth[_0x6c36('0x8')](),controller[_0x6c36('0xd')]);router[_0x6c36('0x7')](_0x6c36('0xe'),auth[_0x6c36('0x8')](),controller[_0x6c36('0xf')]);router[_0x6c36('0x7')](_0x6c36('0x10'),controller['getAvatar']);router['get'](_0x6c36('0x11'),auth[_0x6c36('0x8')](),controller['getOpenTabs']);router[_0x6c36('0x7')](_0x6c36('0x12'),auth['isAuthenticated'](),controller[_0x6c36('0x13')]);router[_0x6c36('0x7')](_0x6c36('0x14'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x15')]);router['get'](_0x6c36('0x16'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x17')]);router[_0x6c36('0x7')]('/:id/groups',auth[_0x6c36('0x8')](),controller[_0x6c36('0x18')]);router[_0x6c36('0x7')](_0x6c36('0x19'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x1a')]);router['get']('/:id/screen_recordings',auth[_0x6c36('0x8')](),controller[_0x6c36('0x1b')]);router['get'](_0x6c36('0x1c'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x1d')]);router['get'](_0x6c36('0x1e'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x1f')]);router[_0x6c36('0x7')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x6c36('0x20')]);router[_0x6c36('0x7')](_0x6c36('0x21'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x22')]);router[_0x6c36('0x7')](_0x6c36('0x23'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x24')]);router[_0x6c36('0x7')](_0x6c36('0x25'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x26')]);router[_0x6c36('0x7')](_0x6c36('0x27'),auth[_0x6c36('0x8')](),controller['getTeams']);router[_0x6c36('0x7')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router['get'](_0x6c36('0x28'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x29')]);router['get']('/:id/prefixes',auth[_0x6c36('0x8')](),controller[_0x6c36('0x2a')]);router[_0x6c36('0x7')](_0x6c36('0x2b'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x2c')]);router['get'](_0x6c36('0x2d'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x2e')]);router[_0x6c36('0x7')]('/:id/openchannel_accounts',auth[_0x6c36('0x8')](),controller[_0x6c36('0x2f')]);router['get']('/:id/sms_accounts',auth[_0x6c36('0x8')](),controller[_0x6c36('0x30')]);router[_0x6c36('0x7')](_0x6c36('0x31'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x6c36('0x7')](_0x6c36('0x32'),auth['isAuthenticated'](),controller[_0x6c36('0x33')]);router['get'](_0x6c36('0x34'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x6c36('0x7')](_0x6c36('0x35'),auth[_0x6c36('0x8')](),controller['getApiKey']);router[_0x6c36('0x36')](_0x6c36('0x12'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x37')]);router['post']('/',auth[_0x6c36('0x8')](),controller['create']);router[_0x6c36('0x36')](_0x6c36('0x38'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x39')]);router[_0x6c36('0x36')](_0x6c36('0x14'),auth[_0x6c36('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0x6c36('0x3a')]({'destination':function(_0x47f8b5,_0x56346c,_0x5ed6d0){_0x5ed6d0(null,path[_0x6c36('0x3b')](config[_0x6c36('0x3c')],_0x6c36('0x3d')));},'filename':function(_0x2aa1b4,_0x3c43ed,_0x4699c2){_0x4699c2(null,util[_0x6c36('0x3e')](_0x6c36('0x3f'),Date[_0x6c36('0x40')](),_0x3c43ed[_0x6c36('0x41')]));}})});router['post']('/:id/avatar',upload[_0x6c36('0x42')](_0x6c36('0x43')),controller[_0x6c36('0x44')]);router[_0x6c36('0x36')](_0x6c36('0x45'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x46')]);router['post'](_0x6c36('0x47'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x48')]);router[_0x6c36('0x36')](_0x6c36('0x49'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x4a')]);router[_0x6c36('0x36')](_0x6c36('0x4b'),auth[_0x6c36('0x8')](),controller['unpause']);router[_0x6c36('0x36')](_0x6c36('0x27'),auth[_0x6c36('0x8')](),controller['addTeams']);router['post'](_0x6c36('0x4c'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x4d')]);router[_0x6c36('0x36')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x6c36('0x4e')]);router[_0x6c36('0x36')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x6c36('0x4f')]);router['post'](_0x6c36('0x50'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x51')]);router[_0x6c36('0x36')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x6c36('0x52')]);router[_0x6c36('0x36')](_0x6c36('0x53'),auth[_0x6c36('0x8')](),controller['addWhatsappInteractions']);router['post'](_0x6c36('0x2b'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x54')]);router[_0x6c36('0x36')](_0x6c36('0x2d'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x55')]);router[_0x6c36('0x36')](_0x6c36('0x56'),auth[_0x6c36('0x8')](),controller['addOpenchannelAccounts']);router[_0x6c36('0x36')](_0x6c36('0x57'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x58')]);router[_0x6c36('0x36')](_0x6c36('0x31'),auth[_0x6c36('0x8')](),controller['addChatWebsites']);router['post'](_0x6c36('0x32'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x6c36('0x36')]('/:id/api_key',auth[_0x6c36('0x8')](),controller[_0x6c36('0x59')]);router[_0x6c36('0x5a')](_0x6c36('0xe'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x5b')]);router[_0x6c36('0x5a')](_0x6c36('0x5c'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x5d')]);router[_0x6c36('0x5e')](_0x6c36('0x14'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x5f')]);router[_0x6c36('0x5e')](_0x6c36('0x27'),auth['isAuthenticated'](),controller[_0x6c36('0x60')]);router[_0x6c36('0x5e')](_0x6c36('0xe'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x61')]);router[_0x6c36('0x5e')](_0x6c36('0x4c'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x62')]);router['delete']('/:id/mail_interactions',auth[_0x6c36('0x8')](),controller['removeMailInteractions']);router[_0x6c36('0x5e')](_0x6c36('0x63'),auth['isAuthenticated'](),controller[_0x6c36('0x64')]);router[_0x6c36('0x5e')]('/:id/sms_interactions',auth[_0x6c36('0x8')](),controller[_0x6c36('0x65')]);router[_0x6c36('0x5e')](_0x6c36('0x66'),auth['isAuthenticated'](),controller[_0x6c36('0x67')]);router[_0x6c36('0x5e')](_0x6c36('0x53'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x68')]);router[_0x6c36('0x5e')]('/:id/fax_accounts',auth[_0x6c36('0x8')](),controller['removeFaxAccounts']);router['delete'](_0x6c36('0x2d'),auth['isAuthenticated'](),controller[_0x6c36('0x69')]);router['delete'](_0x6c36('0x56'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x6a')]);router[_0x6c36('0x5e')](_0x6c36('0x57'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x6b')]);router[_0x6c36('0x5e')](_0x6c36('0x31'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x6c')]);router[_0x6c36('0x5e')](_0x6c36('0x32'),auth[_0x6c36('0x8')](),controller['removeWhatsappAccounts']);router[_0x6c36('0x5e')](_0x6c36('0x35'),auth[_0x6c36('0x8')](),controller[_0x6c36('0x6d')]);router[_0x6c36('0x36')]('/:id/messengerSoundNotification',auth[_0x6c36('0x8')](),controller[_0x6c36('0x6e')]);module[_0x6c36('0x6f')]=router; \ No newline at end of file +var _0x73ab=['getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','diskStorage','join','server/files/images/','format','now','originalname','single','addAvatar','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addSmsAccounts','put','/:id/password','delete','removeQueues','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions'];(function(_0x53c578,_0x56e28e){var _0x22fd45=function(_0x588068){while(--_0x588068){_0x53c578['push'](_0x53c578['shift']());}};_0x22fd45(++_0x56e28e);}(_0x73ab,0x182));var _0xb73a=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x73ab[_0x4c7d8b];return _0x187158;};'use strict';var multer=require(_0xb73a('0x0'));var util=require(_0xb73a('0x1'));var path=require(_0xb73a('0x2'));var timeout=require(_0xb73a('0x3'));var express=require(_0xb73a('0x4'));var router=express[_0xb73a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb73a('0x6'));var config=require(_0xb73a('0x7'));var controller=require('./user.controller');router[_0xb73a('0x8')]('/',auth[_0xb73a('0x9')](),controller['index']);router[_0xb73a('0x8')]('/describe',auth[_0xb73a('0x9')](),controller[_0xb73a('0xa')]);router[_0xb73a('0x8')]('/whoami',auth['isAuthenticated'](),controller[_0xb73a('0xb')]);router[_0xb73a('0x8')](_0xb73a('0xc'),auth[_0xb73a('0x9')](),controller[_0xb73a('0xd')]);router['get'](_0xb73a('0xe'),auth[_0xb73a('0x9')](),controller[_0xb73a('0xf')]);router[_0xb73a('0x8')](_0xb73a('0x10'),controller[_0xb73a('0x11')]);router[_0xb73a('0x8')](_0xb73a('0x12'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x13')]);router[_0xb73a('0x8')](_0xb73a('0x14'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x15')]);router[_0xb73a('0x8')](_0xb73a('0x16'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x17')]);router['get'](_0xb73a('0x18'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x19')]);router['get'](_0xb73a('0x1a'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x1b')]);router[_0xb73a('0x8')]('/:id/recordings',auth[_0xb73a('0x9')](),controller[_0xb73a('0x1c')]);router[_0xb73a('0x8')](_0xb73a('0x1d'),auth['isAuthenticated'](),controller[_0xb73a('0x1e')]);router['get'](_0xb73a('0x1f'),auth[_0xb73a('0x9')](),controller['getChatInteractions']);router['get'](_0xb73a('0x20'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x21')]);router[_0xb73a('0x8')]('/:id/mail/interactions',auth[_0xb73a('0x9')](),controller[_0xb73a('0x22')]);router[_0xb73a('0x8')]('/:id/sms/interactions',auth[_0xb73a('0x9')](),controller['getSmsInteractions']);router[_0xb73a('0x8')](_0xb73a('0x23'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x24')]);router[_0xb73a('0x8')](_0xb73a('0x25'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0xb73a('0x8')]('/:id/teams',auth[_0xb73a('0x9')](),controller['getTeams']);router['get'](_0xb73a('0x26'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x27')]);router['get'](_0xb73a('0x28'),auth['isAuthenticated'](),controller[_0xb73a('0x29')]);router[_0xb73a('0x8')]('/:id/prefixes',auth[_0xb73a('0x9')](),controller[_0xb73a('0x2a')]);router['get']('/:id/fax_accounts',auth[_0xb73a('0x9')](),controller[_0xb73a('0x2b')]);router['get'](_0xb73a('0x2c'),auth['isAuthenticated'](),controller[_0xb73a('0x2d')]);router[_0xb73a('0x8')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xb73a('0x2e')]);router[_0xb73a('0x8')](_0xb73a('0x2f'),auth['isAuthenticated'](),controller[_0xb73a('0x30')]);router[_0xb73a('0x8')](_0xb73a('0x31'),auth['isAuthenticated'](),controller[_0xb73a('0x32')]);router[_0xb73a('0x8')](_0xb73a('0x33'),auth[_0xb73a('0x9')](),controller['getWhatsappAccounts']);router[_0xb73a('0x8')](_0xb73a('0x34'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x35')]);router['get'](_0xb73a('0x36'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x37')]);router[_0xb73a('0x38')](_0xb73a('0x14'),auth[_0xb73a('0x9')](),controller['addContacts']);router['post']('/',auth[_0xb73a('0x9')](),controller[_0xb73a('0x39')]);router[_0xb73a('0x38')]('/create_many',auth[_0xb73a('0x9')](),controller[_0xb73a('0x3a')]);router['post']('/:id/queues',auth[_0xb73a('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0xb73a('0x3b')]({'destination':function(_0x54d9c5,_0x477196,_0x351125){_0x351125(null,path[_0xb73a('0x3c')](config['root'],_0xb73a('0x3d')));},'filename':function(_0x290eb4,_0x27af7e,_0x2caf6a){_0x2caf6a(null,util[_0xb73a('0x3e')]('%s-%s',Date[_0xb73a('0x3f')](),_0x27af7e[_0xb73a('0x40')]));}})});router[_0xb73a('0x38')](_0xb73a('0x10'),upload[_0xb73a('0x41')]('file'),controller[_0xb73a('0x42')]);router[_0xb73a('0x38')]('/:id/login',auth[_0xb73a('0x9')](),controller['login']);router[_0xb73a('0x38')](_0xb73a('0x43'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x44')]);router[_0xb73a('0x38')](_0xb73a('0x45'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x46')]);router[_0xb73a('0x38')](_0xb73a('0x47'),auth[_0xb73a('0x9')](),controller['unpause']);router[_0xb73a('0x38')]('/:id/teams',auth[_0xb73a('0x9')](),controller[_0xb73a('0x48')]);router[_0xb73a('0x38')](_0xb73a('0x49'),auth[_0xb73a('0x9')](),controller['addChatInteractions']);router[_0xb73a('0x38')](_0xb73a('0x4a'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x4b')]);router['post'](_0xb73a('0x4c'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x4d')]);router[_0xb73a('0x38')](_0xb73a('0x4e'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0xb73a('0x38')](_0xb73a('0x4f'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x50')]);router[_0xb73a('0x38')](_0xb73a('0x51'),auth['isAuthenticated'](),controller[_0xb73a('0x52')]);router['post'](_0xb73a('0x53'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x54')]);router[_0xb73a('0x38')](_0xb73a('0x2c'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x55')]);router[_0xb73a('0x38')](_0xb73a('0x56'),auth[_0xb73a('0x9')](),controller['addOpenchannelAccounts']);router[_0xb73a('0x38')](_0xb73a('0x2f'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x57')]);router['post'](_0xb73a('0x31'),auth['isAuthenticated'](),controller['addChatWebsites']);router['post']('/:id/whatsapp_accounts',auth[_0xb73a('0x9')](),controller['addWhatsappAccounts']);router[_0xb73a('0x38')](_0xb73a('0x36'),auth[_0xb73a('0x9')](),controller['createApiKey']);router[_0xb73a('0x58')](_0xb73a('0xe'),auth[_0xb73a('0x9')](),controller['update']);router[_0xb73a('0x58')](_0xb73a('0x59'),auth[_0xb73a('0x9')](),controller['changePassword']);router[_0xb73a('0x5a')](_0xb73a('0x16'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x5b')]);router[_0xb73a('0x5a')]('/:id/teams',auth[_0xb73a('0x9')](),controller['removeTeams']);router['delete'](_0xb73a('0xe'),auth['isAuthenticated'](),controller[_0xb73a('0x5c')]);router[_0xb73a('0x5a')](_0xb73a('0x49'),auth['isAuthenticated'](),controller[_0xb73a('0x5d')]);router['delete']('/:id/mail_interactions',auth[_0xb73a('0x9')](),controller['removeMailInteractions']);router[_0xb73a('0x5a')](_0xb73a('0x4c'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x5e')]);router[_0xb73a('0x5a')](_0xb73a('0x4e'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x5f')]);router[_0xb73a('0x5a')](_0xb73a('0x4f'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x60')]);router[_0xb73a('0x5a')](_0xb73a('0x51'),auth[_0xb73a('0x9')](),controller['removeWhatsappInteractions']);router[_0xb73a('0x5a')](_0xb73a('0x53'),auth['isAuthenticated'](),controller[_0xb73a('0x61')]);router[_0xb73a('0x5a')](_0xb73a('0x2c'),auth[_0xb73a('0x9')](),controller[_0xb73a('0x62')]);router[_0xb73a('0x5a')](_0xb73a('0x56'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0xb73a('0x5a')](_0xb73a('0x2f'),auth['isAuthenticated'](),controller[_0xb73a('0x63')]);router[_0xb73a('0x5a')](_0xb73a('0x31'),auth['isAuthenticated'](),controller[_0xb73a('0x64')]);router[_0xb73a('0x5a')](_0xb73a('0x33'),auth['isAuthenticated'](),controller[_0xb73a('0x65')]);router[_0xb73a('0x5a')](_0xb73a('0x36'),auth[_0xb73a('0x9')](),controller['removeApiKey']);router[_0xb73a('0x38')](_0xb73a('0x66'),auth['isAuthenticated'](),controller[_0xb73a('0x67')]);module[_0xb73a('0x68')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 1a3cc3e..8c6c440 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 _0x7983=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','active','actpass','TEXT','get','wss','encryption','dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','screenrecording','blocked','blockedAt','sequelize','lodash','exports','name','The\x20name\x20of\x20the\x20user','setDataValue','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','toLowerCase','admin','user','agent','local','INTEGER','accountcode','callerid','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','rfc2833','yes','update','outgoing','force_rport,comedia','nat'];(function(_0x1bc087,_0x4cc755){var _0x2176a4=function(_0x67bf64){while(--_0x67bf64){_0x1bc087['push'](_0x1bc087['shift']());}};_0x2176a4(++_0x4cc755);}(_0x7983,0x171));var _0x3798=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7983[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x3798('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x3798('0x1'));module[_0x3798('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3798('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47b853){this['setDataValue']('name',_0x47b853);this['setDataValue']('defaultuser',_0x47b853);},'comment':_0x3798('0x4')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3476ed){this[_0x3798('0x5')](_0x3798('0x6'),_0x3476ed);this[_0x3798('0x5')]('callerid',util[_0x3798('0x7')](_0x3798('0x8'),_0x3476ed,this[_0x3798('0x9')](_0x3798('0xa'))));}},'alias':{'type':Sequelize[_0x3798('0xb')]},'email':{'type':Sequelize[_0x3798('0xb')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x599c7f){if(_0x599c7f){this['setDataValue']('email',_0x599c7f[_0x3798('0xc')]());}}},'role':{'type':Sequelize['ENUM'](_0x3798('0xd'),_0x3798('0xe'),_0x3798('0xf'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x3798('0xb')],'defaultValue':_0x3798('0x10')},'internal':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':![],'unique':'internal','set':function(_0x69b40){this[_0x3798('0x5')](_0x3798('0xa'),_0x69b40);this[_0x3798('0x5')](_0x3798('0x12'),_0x69b40);this[_0x3798('0x5')](_0x3798('0x13'),util[_0x3798('0x7')]('\x22%s\x22\x20<%s>',this[_0x3798('0x9')]('fullname'),_0x69b40));}},'salt':{'type':Sequelize[_0x3798('0xb')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x3798('0xb')]},'zipcode':{'type':Sequelize[_0x3798('0xb')]},'userpic':{'type':Sequelize[_0x3798('0xb')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3798('0xb')]},'online':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x3798('0x15')]},'voicePause':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x3798('0x15')]},'chatCapacity':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x3798('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3798('0x16')},'ipaddr':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'port':{'type':Sequelize[_0x3798('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x18'),_0x3798('0xe'),_0x3798('0x19')),'allowNull':!![],'defaultValue':_0x3798('0x18')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3798('0x1a')},'callingpres':{'type':Sequelize[_0x3798('0x17')]('ALLOWED_NOT_SCREENED',_0x3798('0x1b'),_0x3798('0x1c'),_0x3798('0x1d'),_0x3798('0x1e'),_0x3798('0x1f'),'PROHIB_FAILED_SCREEN',_0x3798('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'permit':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'secret':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'transport':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![],'defaultValue':_0x3798('0x21'),'set':function(_0x144cc3){this[_0x3798('0x5')](_0x3798('0x22'),_0x144cc3?_0x144cc3[_0x3798('0x23')](','):null);},'get':function(){return this[_0x3798('0x9')](_0x3798('0x22'))?this['getDataValue']('transport')[_0x3798('0x24')](','):null;},'comment':_0x3798('0x25')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x3798('0x26'),_0x3798('0x27'),'auto'),'allowNull':!![],'defaultValue':_0x3798('0x28')},'directmedia':{'type':Sequelize['ENUM'](_0x3798('0x29'),'no','nonat',_0x3798('0x2a'),_0x3798('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'nat':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![],'defaultValue':_0x3798('0x2c'),'set':function(_0x3f506f){this[_0x3798('0x5')](_0x3798('0x2d'),_0x3f506f?_0x3f506f[_0x3798('0x23')](','):null);},'get':function(){return this['getDataValue'](_0x3798('0x2d'))?this[_0x3798('0x9')]('nat')[_0x3798('0x24')](','):null;},'comment':_0x3798('0x2e')},'callgroup':{'type':Sequelize[_0x3798('0xb')]},'namedcallgroup':{'type':Sequelize[_0x3798('0xb')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x3798('0xb')]},'language':{'type':Sequelize[_0x3798('0xb')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3798('0xb')]},'disallow':{'type':Sequelize[_0x3798('0xb')],'allowNull':![],'defaultValue':_0x3798('0x2f')},'allow':{'type':Sequelize[_0x3798('0xb')],'allowNull':![],'defaultValue':_0x3798('0x30'),'set':function(_0x273a39){this[_0x3798('0x5')](_0x3798('0x31'),_0x273a39?_0x273a39[_0x3798('0x23')](';'):_0x3798('0x30'));},'get':function(){return this[_0x3798('0x9')](_0x3798('0x31'))?this[_0x3798('0x9')](_0x3798('0x31'))[_0x3798('0x24')](';'):null;},'comment':_0x3798('0x32')},'autoframing':{'type':Sequelize[_0x3798('0x17')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x1ad1f3){this[_0x3798('0x5')](_0x3798('0x33'),_0x1ad1f3?_0x1ad1f3[_0x3798('0x23')](','):null);},'get':function(){return this['getDataValue'](_0x3798('0x33'))?this[_0x3798('0x9')]('insecure')[_0x3798('0x24')](','):null;},'comment':_0x3798('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x3798('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no',_0x3798('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x3798('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3798('0x36')},'amaflags':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![],'defaultValue':_0x3798('0x29')},'busylevel':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x3798('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'template':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x3798('0x29'),'no',_0x3798('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3798('0x17')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x38'),_0x3798('0x39'),_0x3798('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x3b'),_0x3798('0x3c')),'allowNull':!![],'defaultValue':_0x3798('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x3798('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x3798('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3798('0x17')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x3d'),'passive',_0x3798('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x3798('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no','nonat','update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x3798('0x15')]},'passwordResetAt':{'type':Sequelize[_0x3798('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x3798('0x3f')]},'showWebBar':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0,'set':function(_0x15a0e5){this[_0x3798('0x5')]('showWebBar',_0x15a0e5);var _0x3dda99=this[_0x3798('0x40')]({'plain':!![]});switch(_0x15a0e5){case 0x0:case 0x1:var _0xf7384=_0x3dda99[_0x3798('0x22')]?_['isArray'](_0x3dda99['transport'])?_0x3dda99['transport'][_0x3798('0x23')]():_0x3dda99[_0x3798('0x22')]:_0x3798('0x21');if(_0xf7384===_0x3798('0x41')){_0xf7384=_0x3798('0x21');}this[_0x3798('0x5')](_0x3798('0x22'),_0xf7384);this[_0x3798('0x5')](_0x3798('0x42'),'no');this['setDataValue']('avpf',null);this['setDataValue']('force_avp',null);this[_0x3798('0x5')]('icesupport',null);this[_0x3798('0x5')]('dtlsenable',null);this[_0x3798('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this[_0x3798('0x5')](_0x3798('0x43'),null);this[_0x3798('0x5')](_0x3798('0x44'),null);this[_0x3798('0x5')](_0x3798('0x45'),'no');break;case 0x2:this[_0x3798('0x5')](_0x3798('0x22'),_0x3798('0x41'));this['setDataValue'](_0x3798('0x42'),_0x3798('0x29'));this[_0x3798('0x5')](_0x3798('0x46'),_0x3798('0x29'));this[_0x3798('0x5')](_0x3798('0x47'),_0x3798('0x29'));this[_0x3798('0x5')](_0x3798('0x48'),'yes');this['setDataValue'](_0x3798('0x49'),_0x3798('0x29'));this[_0x3798('0x5')](_0x3798('0x4a'),'no');this[_0x3798('0x5')](_0x3798('0x4b'),'actpass');this[_0x3798('0x5')](_0x3798('0x43'),_0x3dda99[_0x3798('0x43')]||'/etc/pki/tls/certs/motion.crt');this[_0x3798('0x5')](_0x3798('0x44'),_0x3dda99['dtlsprivatekey']||_0x3798('0x4c'));this[_0x3798('0x5')](_0x3798('0x45'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x3798('0x3f')],'set':function(_0x23bd37){this[_0x3798('0x5')](_0x3798('0x4d'),_0x23bd37?_0x23bd37[_0x3798('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x3798('0x9')](_0x3798('0x4d'))[_0x3798('0x24')](','),function(_0x5ee520){return parseInt(_0x5ee520,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3798('0xb')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x3798('0xb')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x3798('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x3798('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x3798('0xb')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3798('0x17')](_0x3798('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x3798('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3798('0x4e')],'get':function(){return this[_0x3798('0x9')](_0x3798('0x4f'))?this[_0x3798('0x9')](_0x3798('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x3798('0xb')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x3798('0xb')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![],'set':function(_0x3d6447){if(typeof _0x3d6447==='string'){var _0x24cffc=_0x3d6447==='1'?!![]:_0x3d6447==='0'?![]:_0x3d6447==='true'?!![]:_0x3d6447==='false'?![]:![];this[_0x3798('0x5')](_0x3798('0x50'),_0x24cffc);}else{this['setDataValue'](_0x3798('0x50'),_0x3d6447);}}},'blocked':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![],'set':function(_0x509da9){this[_0x3798('0x5')](_0x3798('0x51'),_0x509da9);if(_0x509da9===!![]){this[_0x3798('0x5')](_0x3798('0x52'),moment());this[_0x3798('0x5')]('loginAttempts',0x0);}else{this[_0x3798('0x5')](_0x3798('0x52'),null);}}},'blockedAt':{'type':Sequelize[_0x3798('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x3798('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x3798('0x11')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3798('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x3798('0x11')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x3798('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0xdc3d=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','accept','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','isArray','udp','wss','encryption','avpf','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','dtlsenable','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','UNSIGNED','sequelize','moment','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','internal','email','toLowerCase','ENUM','user','agent','telephone','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','dynamic','peer','friend','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdc3d,0x90));var _0xddc3=function(_0x53ff45,_0x513ca9){_0x53ff45=_0x53ff45-0x0;var _0x26507f=_0xdc3d[_0x53ff45];return _0x26507f;};'use strict';var Sequelize=require(_0xddc3('0x0'));var moment=require(_0xddc3('0x1'));var util=require('util');var _=require(_0xddc3('0x2'));module[_0xddc3('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x34d3f1){this['setDataValue'](_0xddc3('0x4'),_0x34d3f1);this[_0xddc3('0x5')](_0xddc3('0x6'),_0x34d3f1);},'comment':_0xddc3('0x7')},'fullname':{'type':Sequelize[_0xddc3('0x8')],'allowNull':![],'set':function(_0xdde59f){this[_0xddc3('0x5')](_0xddc3('0x9'),_0xdde59f);this['setDataValue'](_0xddc3('0xa'),util[_0xddc3('0xb')]('\x22%s\x22\x20<%s>',_0xdde59f,this['getDataValue'](_0xddc3('0xc'))));}},'alias':{'type':Sequelize[_0xddc3('0x8')]},'email':{'type':Sequelize[_0xddc3('0x8')],'allowNull':![],'unique':_0xddc3('0xd'),'validate':{'isEmail':!![]},'set':function(_0x31ce0a){if(_0x31ce0a){this[_0xddc3('0x5')](_0xddc3('0xd'),_0x31ce0a[_0xddc3('0xe')]());}}},'role':{'type':Sequelize[_0xddc3('0xf')]('admin',_0xddc3('0x10'),_0xddc3('0x11'),_0xddc3('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xddc3('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xddc3('0x8')],'defaultValue':_0xddc3('0x13')},'internal':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':![],'unique':_0xddc3('0xc'),'set':function(_0x2b3d86){this['setDataValue'](_0xddc3('0xc'),_0x2b3d86);this[_0xddc3('0x5')](_0xddc3('0x15'),_0x2b3d86);this[_0xddc3('0x5')](_0xddc3('0xa'),util[_0xddc3('0xb')](_0xddc3('0x16'),this[_0xddc3('0x17')](_0xddc3('0x9')),_0x2b3d86));}},'salt':{'type':Sequelize[_0xddc3('0x8')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xddc3('0x8')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xddc3('0x8')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xddc3('0x8')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xddc3('0x19')]},'chatCapacity':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xddc3('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xddc3('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'host':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![],'defaultValue':_0xddc3('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xddc3('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend',_0xddc3('0x10'),_0xddc3('0x1b')),'allowNull':!![],'defaultValue':_0xddc3('0x1c')},'context':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xddc3('0xf')]('ALLOWED_NOT_SCREENED',_0xddc3('0x1d'),_0xddc3('0x1e'),_0xddc3('0x1f'),_0xddc3('0x20'),_0xddc3('0x21'),_0xddc3('0x22'),_0xddc3('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'permit':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'secret':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'transport':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![],'defaultValue':'udp','set':function(_0x770b1c){this['setDataValue'](_0xddc3('0x24'),_0x770b1c?_0x770b1c[_0xddc3('0x25')](','):null);},'get':function(){return this[_0xddc3('0x17')](_0xddc3('0x24'))?this[_0xddc3('0x17')](_0xddc3('0x24'))[_0xddc3('0x26')](','):null;},'comment':_0xddc3('0x27')},'dtmfmode':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x28'),_0xddc3('0x29'),_0xddc3('0x2a'),_0xddc3('0x2b'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no',_0xddc3('0x2d'),_0xddc3('0x2e'),_0xddc3('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xddc3('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![],'defaultValue':_0xddc3('0x30'),'set':function(_0x348815){this[_0xddc3('0x5')]('nat',_0x348815?_0x348815[_0xddc3('0x25')](','):null);},'get':function(){return this[_0xddc3('0x17')](_0xddc3('0x31'))?this['getDataValue'](_0xddc3('0x31'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xddc3('0x8')]},'namedcallgroup':{'type':Sequelize[_0xddc3('0x8')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xddc3('0x8')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xddc3('0x8')]},'disallow':{'type':Sequelize[_0xddc3('0x8')],'allowNull':![],'defaultValue':_0xddc3('0x32')},'allow':{'type':Sequelize[_0xddc3('0x8')],'allowNull':![],'defaultValue':_0xddc3('0x33'),'set':function(_0xc61838){this[_0xddc3('0x5')]('allow',_0xc61838?_0xc61838[_0xddc3('0x25')](';'):_0xddc3('0x33'));},'get':function(){return this[_0xddc3('0x17')]('allow')?this['getDataValue'](_0xddc3('0x34'))[_0xddc3('0x26')](';'):null;},'comment':_0xddc3('0x35')},'autoframing':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![],'set':function(_0x3f5076){this[_0xddc3('0x5')](_0xddc3('0x36'),_0x3f5076?_0x3f5076[_0xddc3('0x25')](','):null);},'get':function(){return this[_0xddc3('0x17')](_0xddc3('0x36'))?this[_0xddc3('0x17')](_0xddc3('0x36'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xddc3('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xddc3('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xddc3('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xddc3('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xddc3('0x38')},'amaflags':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xddc3('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xddc3('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xddc3('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xddc3('0x39'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xddc3('0x3a'),_0xddc3('0x3b')),'allowNull':!![],'defaultValue':_0xddc3('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xddc3('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xddc3('0x2c')},'keepalive':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xddc3('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xddc3('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no',_0xddc3('0x3c'),_0xddc3('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xddc3('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x3e'),_0xddc3('0x3f'),_0xddc3('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xddc3('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xddc3('0xf')]('yes','no',_0xddc3('0x2d'),'update',_0xddc3('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xddc3('0x19')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0,'set':function(_0x2bc300){this[_0xddc3('0x5')](_0xddc3('0x42'),_0x2bc300);var _0x3a9753=this[_0xddc3('0x43')]({'plain':!![]});switch(_0x2bc300){case 0x0:case 0x1:var _0x5c166e=_0x3a9753[_0xddc3('0x24')]?_[_0xddc3('0x44')](_0x3a9753[_0xddc3('0x24')])?_0x3a9753[_0xddc3('0x24')][_0xddc3('0x25')]():_0x3a9753[_0xddc3('0x24')]:_0xddc3('0x45');if(_0x5c166e===_0xddc3('0x46')){_0x5c166e=_0xddc3('0x45');}this[_0xddc3('0x5')](_0xddc3('0x24'),_0x5c166e);this[_0xddc3('0x5')](_0xddc3('0x47'),'no');this[_0xddc3('0x5')](_0xddc3('0x48'),null);this['setDataValue']('force_avp',null);this[_0xddc3('0x5')](_0xddc3('0x49'),null);this[_0xddc3('0x5')]('dtlsenable',null);this['setDataValue'](_0xddc3('0x4a'),null);this[_0xddc3('0x5')](_0xddc3('0x4b'),null);this[_0xddc3('0x5')](_0xddc3('0x4c'),null);this['setDataValue'](_0xddc3('0x4d'),null);this[_0xddc3('0x5')](_0xddc3('0x4e'),'no');break;case 0x2:this[_0xddc3('0x5')](_0xddc3('0x24'),'wss');this[_0xddc3('0x5')](_0xddc3('0x47'),_0xddc3('0x2c'));this[_0xddc3('0x5')](_0xddc3('0x48'),_0xddc3('0x2c'));this[_0xddc3('0x5')](_0xddc3('0x4f'),'yes');this['setDataValue'](_0xddc3('0x49'),'yes');this[_0xddc3('0x5')](_0xddc3('0x50'),'yes');this[_0xddc3('0x5')](_0xddc3('0x4a'),'no');this[_0xddc3('0x5')](_0xddc3('0x4b'),_0xddc3('0x40'));this[_0xddc3('0x5')](_0xddc3('0x4c'),_0x3a9753['dtlscertfile']||_0xddc3('0x51'));this[_0xddc3('0x5')]('dtlsprivatekey',_0x3a9753[_0xddc3('0x4d')]||_0xddc3('0x52'));this[_0xddc3('0x5')](_0xddc3('0x4e'),_0xddc3('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x293af2){this[_0xddc3('0x5')](_0xddc3('0x53'),_0x293af2?_0x293af2[_0xddc3('0x25')](','):[]);},'get':function(){return this[_0xddc3('0x17')](_0xddc3('0x53'))?_[_0xddc3('0x54')](this[_0xddc3('0x17')](_0xddc3('0x53'))[_0xddc3('0x26')](','),function(_0x18c400){return parseInt(_0x18c400,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xddc3('0x8')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xddc3('0x8')]},'phoneBarUnconditional':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xddc3('0xf')](_0xddc3('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xddc3('0x8')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xddc3('0x17')](_0xddc3('0x55'))?this[_0xddc3('0x17')](_0xddc3('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0xddc3('0x8')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xddc3('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![],'set':function(_0x5e0739){if(typeof _0x5e0739===_0xddc3('0x56')){var _0x5a66fd=_0x5e0739==='1'?!![]:_0x5e0739==='0'?![]:_0x5e0739==='true'?!![]:_0x5e0739===_0xddc3('0x57')?![]:![];this['setDataValue'](_0xddc3('0x58'),_0x5a66fd);}else{this[_0xddc3('0x5')]('screenrecording',_0x5e0739);}}},'blocked':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![],'set':function(_0xbbf2d){this[_0xddc3('0x5')](_0xddc3('0x59'),_0xbbf2d);if(_0xbbf2d===!![]){this[_0xddc3('0x5')]('blockedAt',moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0xddc3('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xddc3('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xddc3('0x14')](0x5)[_0xddc3('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xddc3('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xddc3('0x18')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 78d4959..ee7d8b7 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 _0x633f=['ValidationError','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','updatePasswordsHistory','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','spread','capitalize','Queue:save','VoiceQueue','voice','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','userpic','file','getAvatar','join','root','download','existsSync','server/files/images/','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','User\x20with\x20id\x20%s\x20not\x20found','describe','CmList','Tag','Tags','tag','getQueues','model','keys','filters','intersection','fields','sort','merge','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','hasOwnProperty','order','pick','getGroups','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','ChatInteraction','getChatInteractions','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','loginInPause','format','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','PAUSE','bulkCreate','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','smsPause','lastPauseAt','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','getDataValue','Voice','VoicePrefixId','QueueId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','TeamVoicePrefix','UserVoicePrefix','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','omit','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contains','$any','firstName','lastName','CmContact','Contact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','idle','ringing','queues','inbound','flatten','toString','lower','col','asc','desc','getRealtimeAgents','offline','voiceStatus','unavailable','busy','charAt','toUpperCase','slice','select','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','util','lodash','squel','jayson/promise','../../components/contacts','../../components/realtime/agents','../../config/logger','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','APIForbiddenrror','handleError','../../mysqldb','register','defaults','redis','localhost','http','sendStatus','status','json','offset','undefined','count','limit','set','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','user','Telephones','telephone','map','value','includes','find','name','UserProfileResource','end','send','User','rawAttributes','fieldName','type','key','filter','password','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','index','where','query','includeAll','include','userSetting','attributes','push','openTabs','true','rows','length','dataValues','sms','fax','mail','catch','show','params','getOptions','UserSetting','options','chat','openchannel','whatsapp','body','addContacts','ids','internal','Setting','findById','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','fullname','email','permissions','102','103','113','110','104','105','109','100','111','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','settingsEnabled','userProfileId','UserProfileSection','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','all','some','findAll','compact','changePassword','oldPassword','newPassword'];(function(_0x12b13d,_0x58b9c0){var _0x2935f3=function(_0x506fb2){while(--_0x506fb2){_0x12b13d['push'](_0x12b13d['shift']());}};_0x2935f3(++_0x58b9c0);}(_0x633f,0xf9));var _0xf633=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x633f[_0x6a0266];return _0x309e00;};'use strict';var moment=require('moment');var util=require(_0xf633('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xf633('0x1'));var squel=require(_0xf633('0x2'));var Redis=require('ioredis');var jayson=require(_0xf633('0x3'));var authService=require('../../components/auth/service');var contacts=require(_0xf633('0x4'));var qs=require('../../components/parsers/qs');var rta=require(_0xf633('0x5'));var logger=require(_0xf633('0x6'))('api');var utils=require(_0xf633('0x7'));var config=require('../../config/environment');var licenseUtil=require(_0xf633('0x8'));var APIBadRequestError=require(_0xf633('0x9'))[_0xf633('0xa')];var APINotFoundError=require(_0xf633('0x9'))[_0xf633('0xb')];var APIForbiddenError=require(_0xf633('0x9'))[_0xf633('0xc')];var APIHandleError=require('../../errors/api')[_0xf633('0xd')];var db=require(_0xf633('0xe'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0xf633('0xf')](socket);config['redis']=_[_0xf633('0x10')](config[_0xf633('0x11')],{'host':_0xf633('0x12'),'port':0x18eb});var amiClient=jayson['client'][_0xf633('0x13')]({'port':0x232a});var values;function respondWithStatusCode(_0x47b4c9,_0x1f6504){_0x1f6504=_0x1f6504||0xcc;return function(_0x4067b2){if(_0x4067b2){return _0x47b4c9[_0xf633('0x14')](_0x1f6504);}return _0x47b4c9[_0xf633('0x15')](_0x1f6504)['end']();};}function respondWithResult(_0x4635ad,_0x2263a1){_0x2263a1=_0x2263a1||0xc8;return function(_0x1f57a3){if(_0x1f57a3){return _0x4635ad['status'](_0x2263a1)[_0xf633('0x16')](_0x1f57a3);}};}function respondWithFilteredResult(_0x19bbc2,_0x1f16bf){return function(_0x1e49aa){if(_0x1e49aa){var _0x54b52c=typeof _0x1f16bf[_0xf633('0x17')]==='undefined'&&typeof _0x1f16bf['limit']===_0xf633('0x18');var _0x112ce6=_0x1e49aa[_0xf633('0x19')];var _0x54f8c6=_0x54b52c?0x0:_0x1f16bf[_0xf633('0x17')];var _0x328ee6=_0x54b52c?_0x1e49aa[_0xf633('0x19')]:_0x1f16bf['offset']+_0x1f16bf[_0xf633('0x1a')];var _0x3efcfc;if(_0x328ee6>=_0x112ce6){_0x328ee6=_0x112ce6;_0x3efcfc=0xc8;}else{_0x3efcfc=0xce;}_0x19bbc2['status'](_0x3efcfc);return _0x19bbc2[_0xf633('0x1b')]('Content-Range',_0x54f8c6+'-'+_0x328ee6+'/'+_0x112ce6)[_0xf633('0x16')](_0x1e49aa);}return null;};}function respondWithRpcPromise(_0x5709ea,_0x16e718,_0x528ed8,_0x235edf){return new Promise(function(_0x41a4b0,_0x4d5007){var _0x32b8e0=_0x235edf||amiClient;return _0x32b8e0[_0xf633('0x1c')](_0x5709ea,_0x528ed8)[_0xf633('0x1d')](function(_0x298a0d){logger[_0xf633('0x1e')](_0xf633('0x1f'),_0x16e718,_0xf633('0x20'));logger['debug'](_0xf633('0x21'),_0x16e718,_0xf633('0x20'),JSON[_0xf633('0x22')](_0x298a0d));if(_0x298a0d[_0xf633('0x23')]){if(_0x298a0d[_0xf633('0x23')][_0xf633('0x24')]===0x1f4){logger['error'](_0xf633('0x1f'),_0x16e718,_0x298a0d['error']['message']);return _0x4d5007(_0x298a0d['error'][_0xf633('0x25')]);}logger[_0xf633('0x23')]('User,\x20%s,\x20%s',_0x16e718,_0x298a0d[_0xf633('0x23')][_0xf633('0x25')]);return _0x41a4b0(_0x298a0d[_0xf633('0x23')][_0xf633('0x25')]);}else{logger[_0xf633('0x1e')](_0xf633('0x1f'),_0x16e718,_0xf633('0x20'));_0x41a4b0(_0x298a0d['result'][_0xf633('0x25')]);}})['catch'](function(_0x383815){logger[_0xf633('0x23')](_0xf633('0x1f'),_0x16e718,_0x383815);_0x4d5007(_0x383815);});});}function saveUpdates(_0xf2f111){return function(_0x335b6f){if(_0x335b6f){return _0x335b6f[_0xf633('0x26')](_0xf2f111)[_0xf633('0x1d')](function(_0x280692){if(_0x280692[_0xf633('0x27')]===_0xf633('0x28')){socket[_0xf633('0x29')](_0xf633('0x2a')+_0x280692['id'],_0x280692);}return _0x280692;});}return null;};}function removeEntity(_0x5833af,_0xbadc8b){return function(_0x3f049d){if(_0x3f049d){return _0x3f049d[_0xf633('0x2b')]({'transaction':_0xbadc8b})[_0xf633('0x1d')](function(){var _0x168773=_0x3f049d[_0xf633('0x2c')]({'plain':!![]});if(_0x168773[_0xf633('0x27')]===_0xf633('0x2d'))return;var _0x30a9d9=[{'name':'Users','value':_0xf633('0x2e'),'ignore':!![]},{'name':'Agents','value':_0xf633('0x28'),'ignore':![]},{'name':_0xf633('0x2f'),'value':_0xf633('0x30'),'ignore':![]}];var _0x3fdac7=_(_0x30a9d9)['filter']('ignore')[_0xf633('0x31')](_0xf633('0x32'))[_0xf633('0x32')]();if(_[_0xf633('0x33')](_0x3fdac7,_0x168773[_0xf633('0x27')])){return;}var _0x4ba9ef=_[_0xf633('0x34')](_0x30a9d9,[_0xf633('0x32'),_0x168773[_0xf633('0x27')]])[_0xf633('0x35')];return db[_0xf633('0x36')][_0xf633('0x2b')]({'where':{'type':_0x4ba9ef,'resourceId':_0x168773['id']},'transaction':_0xbadc8b})['then'](function(){return _0x3f049d;});})[_0xf633('0x1d')](function(){_0x5833af[_0xf633('0x15')](0xcc)[_0xf633('0x37')]();});}};}function handleEntityNotFound(_0x9bff7d){return function(_0x557cde){if(!_0x557cde){_0x9bff7d[_0xf633('0x14')](0x194);}return _0x557cde;};}function handleError(_0x173214,_0x150f6d){_0x150f6d=_0x150f6d||0x1f4;return function(_0x115305){logger['error'](_0x115305['stack']);if(_0x115305[_0xf633('0x35')]){delete _0x115305[_0xf633('0x35')];}_0x173214['status'](_0x150f6d)[_0xf633('0x38')](_0x115305);};}function getUserAttributes(){return _(db[_0xf633('0x39')][_0xf633('0x3a')])[_0xf633('0x31')](function(_0x57bc19){return{'name':_0x57bc19[_0xf633('0x3b')],'type':_0x57bc19[_0xf633('0x3c')][_0xf633('0x3d')]};})[_0xf633('0x3e')](function(_0xfd56de){return![_0xf633('0x3f'),'salt',_0xf633('0x40'),_0xf633('0x41'),_0xf633('0x42'),_0xf633('0x43')][_0xf633('0x33')](_0xfd56de['name']);})[_0xf633('0x32')]();}exports[_0xf633('0x44')]=function(_0x17cdf3,_0x4b941a){var _0xbe1adb={},_0x45b1d2={'count':0x0,'rows':[]};var _0x174131=getUserAttributes();_0xbe1adb=qs['getOptions'](_0x174131,_0x17cdf3);var _0x1935b0={'where':_0xbe1adb[_0xf633('0x45')]};return db['User']['count'](_0x1935b0)[_0xf633('0x1d')](function(_0x22c48d){_0x45b1d2[_0xf633('0x19')]=_0x22c48d;if(_0x17cdf3[_0xf633('0x46')][_0xf633('0x47')]){_0xbe1adb[_0xf633('0x48')]=[{'all':!![]}];}if(_0x17cdf3[_0xf633('0x46')]['userSetting']==='true'){_0xbe1adb['include']=[{'model':db['UserSetting'],'as':_0xf633('0x49')}];}if(!_[_0xf633('0x33')](_0xbe1adb[_0xf633('0x4a')],'id')){_0xbe1adb[_0xf633('0x4a')][_0xf633('0x4b')]('id');}return db[_0xf633('0x39')]['findAll'](_0xbe1adb);})['then'](function(_0x5388f9){_0x45b1d2['rows']=_0x5388f9;if(_0x17cdf3['query'][_0xf633('0x4c')]===_0xf633('0x4d')){var _0x147ab1=[];for(var _0x3bfdb1=0x0;_0x3bfdb1<_0x45b1d2[_0xf633('0x4e')][_0xf633('0x4f')];_0x3bfdb1++){_0x147ab1['push'](get_open_tabs('chat',_0x45b1d2[_0xf633('0x4e')][_0x3bfdb1][_0xf633('0x50')]));_0x147ab1['push'](get_open_tabs(_0xf633('0x51'),_0x45b1d2['rows'][_0x3bfdb1][_0xf633('0x50')]));_0x147ab1['push'](get_open_tabs(_0xf633('0x52'),_0x45b1d2[_0xf633('0x4e')][_0x3bfdb1][_0xf633('0x50')]));_0x147ab1[_0xf633('0x4b')](get_open_tabs(_0xf633('0x53'),_0x45b1d2['rows'][_0x3bfdb1]['dataValues']));_0x147ab1[_0xf633('0x4b')](get_open_tabs('openchannel',_0x45b1d2[_0xf633('0x4e')][_0x3bfdb1][_0xf633('0x50')]));_0x147ab1['push'](get_open_tabs('whatsapp',_0x45b1d2[_0xf633('0x4e')][_0x3bfdb1][_0xf633('0x50')]));}return Promise['all'](_0x147ab1)[_0xf633('0x1d')](function(){return _0x45b1d2;});}else{return _0x45b1d2;}})['then'](respondWithFilteredResult(_0x4b941a,_0xbe1adb))[_0xf633('0x54')](handleError(_0x4b941a,null));};exports[_0xf633('0x55')]=function(_0x83e764,_0x346f4){var _0x1c6375=getUserAttributes();_0x83e764[_0xf633('0x46')]['id']=_0x83e764[_0xf633('0x56')]['id'];var _0x1eac67=qs[_0xf633('0x57')](_0x1c6375,_0x83e764);if(_0x83e764[_0xf633('0x46')][_0xf633('0x47')]){_0x1eac67['include']=[{'all':!![]}];}if(_0x83e764[_0xf633('0x46')]['userSetting']==='true'){_0x1eac67['include']=[{'model':db[_0xf633('0x58')],'as':_0xf633('0x49')}];}_0x1eac67=_['merge']({},_0x1eac67,_0x83e764[_0xf633('0x59')]);if(!_['includes'](_0x1eac67[_0xf633('0x4a')],'id')){_0x1eac67['attributes']['push']('id');}return db[_0xf633('0x39')][_0xf633('0x34')](_0x1eac67)[_0xf633('0x1d')](handleEntityNotFound(_0x346f4,null))[_0xf633('0x1d')](function(_0x84be37){var _0x14ad45=[];values=_0x84be37;if(_0x83e764[_0xf633('0x46')][_0xf633('0x4c')]===_0xf633('0x4d')){_0x14ad45[_0xf633('0x4b')](get_open_tabs(_0xf633('0x5a'),_0x84be37[_0xf633('0x50')]));_0x14ad45[_0xf633('0x4b')](get_open_tabs(_0xf633('0x51'),_0x84be37[_0xf633('0x50')]));_0x14ad45[_0xf633('0x4b')](get_open_tabs(_0xf633('0x5b'),_0x84be37[_0xf633('0x50')]));_0x14ad45[_0xf633('0x4b')](get_open_tabs(_0xf633('0x5c'),_0x84be37[_0xf633('0x50')]));_0x14ad45[_0xf633('0x4b')](get_open_tabs('fax',_0x84be37['dataValues']));_0x14ad45[_0xf633('0x4b')](get_open_tabs(_0xf633('0x53'),_0x84be37[_0xf633('0x50')]));return Promise['all'](_0x14ad45);}else{return values;}})[_0xf633('0x1d')](function(){return values;})[_0xf633('0x1d')](respondWithResult(_0x346f4,null))[_0xf633('0x54')](handleError(_0x346f4,null));};exports['update']=function(_0x2bc762,_0x1491f9){if(_0x2bc762[_0xf633('0x5d')]['id']){delete _0x2bc762[_0xf633('0x5d')]['id'];}delete _0x2bc762[_0xf633('0x5d')][_0xf633('0x27')];return db[_0xf633('0x39')][_0xf633('0x34')]({'where':{'id':_0x2bc762[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x1491f9,null))['then'](saveUpdates(_0x2bc762[_0xf633('0x5d')],null))['then'](respondWithResult(_0x1491f9,null))[_0xf633('0x54')](handleError(_0x1491f9,null));};exports['describe']=function(_0x10cd93,_0x182ff8){return db[_0xf633('0x39')]['describe']()[_0xf633('0x1d')](respondWithResult(_0x182ff8,null))['catch'](handleError(_0x182ff8,null));};exports[_0xf633('0x5e')]=function(_0x92aac7,_0x18c6a6){return db[_0xf633('0x39')][_0xf633('0x34')]({'where':{'id':_0x92aac7[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x18c6a6,null))['then'](function(_0x32d638){if(_0x32d638){return _0x32d638[_0xf633('0x5e')](_0x92aac7[_0xf633('0x5d')][_0xf633('0x5f')],_['omit'](_0x92aac7['body'],['ids','id'])||{});}})[_0xf633('0x1d')](respondWithResult(_0x18c6a6,null))[_0xf633('0x54')](handleError(_0x18c6a6,null));};function validateUser(_0x1db0ba){return new Promise(function(_0x2b02c8,_0x22b5a6){if(_0x1db0ba[_0xf633('0x60')])return _0x2b02c8(_0x1db0ba);return db[_0xf633('0x61')][_0xf633('0x62')](0x1)[_0xf633('0x1d')](function(_0x2dba3b){if(_0x2dba3b[_0xf633('0x63')])authService[_0xf633('0x64')](_0x1db0ba[_0xf633('0x3f')]);db['User'][_0xf633('0x65')]('internal')[_0xf633('0x1d')](function(_0x13b8ec){if(_['isNil'](_0x13b8ec)){_0x1db0ba[_0xf633('0x60')]=_0x2dba3b[_0xf633('0x66')]||0x1;return;}if(_[_0xf633('0x67')](_0x2dba3b[_0xf633('0x66')])||_0x2dba3b['min_internal']===_0x13b8ec){_0x1db0ba[_0xf633('0x60')]=_0x13b8ec+0x1;return;}if(_0x2dba3b['min_internal']>_0x13b8ec){_0x1db0ba[_0xf633('0x60')]=_0x2dba3b[_0xf633('0x66')];return;}return db[_0xf633('0x68')][_0xf633('0x46')](_0xf633('0x69'),{'type':db[_0xf633('0x68')][_0xf633('0x6a')][_0xf633('0x6b')]})[_0xf633('0x1d')](function(_0x327741){if(_0x327741&&_0x327741['length']){for(var _0xc0c36=0x0,_0x10d6e2=_0x327741[_0xf633('0x4f')];_0xc0c36<_0x10d6e2&&_[_0xf633('0x67')](_0x1db0ba[_0xf633('0x60')]);_0xc0c36++){if(_0x2dba3b['min_internal']<=_0x327741[_0xc0c36][_0xf633('0x6c')]){_0x1db0ba['internal']=_0x327741[_0xc0c36][_0xf633('0x6c')];}else if(_0x2dba3b['min_internal']>_0x327741[_0xc0c36]['from']&&_0x2dba3b[_0xf633('0x66')]<=_0x327741[_0xc0c36]['to']){_0x1db0ba[_0xf633('0x60')]=_0x2dba3b[_0xf633('0x66')];}}}if(_['isNil'](_0x1db0ba[_0xf633('0x60')])){_0x1db0ba[_0xf633('0x60')]=_0x13b8ec+0x1;}return _0x2b02c8(_0x1db0ba);});});})[_0xf633('0x54')](function(_0x40d054){_0x22b5a6(_0x40d054);});});}function updateUser(_0x12667c){return new Promise(function(_0x534515,_0x57d0dd){try{if(_0x12667c[_0xf633('0x6d')]){_0x12667c[_0xf633('0x6e')]=_0x12667c['internal'];_0x12667c[_0xf633('0x6f')]={'mailbox':_0x12667c[_0xf633('0x60')],'password':_0x12667c[_0xf633('0x3f')],'fullname':_0x12667c[_0xf633('0x70')],'email':_0x12667c[_0xf633('0x71')]};}if(_0x12667c[_0xf633('0x27')]===_0xf633('0x28')){if(!_0x12667c[_0xf633('0x72')])_0x12667c[_0xf633('0x72')]=['101',_0xf633('0x73'),_0xf633('0x74'),_0xf633('0x75'),_0xf633('0x76'),_0xf633('0x77'),_0xf633('0x78'),'106','107','108',_0xf633('0x79'),_0xf633('0x7a'),_0xf633('0x7b'),'114','115'];}_0x534515(_0x12667c);}catch(_0x5aeff7){_0x57d0dd(_0x5aeff7);}});}exports[_0xf633('0x7c')]=function(_0x4e276b,_0x335710){if(_0x4e276b[_0xf633('0x2e')][_0xf633('0x27')]===_0xf633('0x28'))throw new Error(_0xf633('0x7d'));if(_0x4e276b['body'][_0xf633('0x27')]===_0xf633('0x2e')&&_0x4e276b[_0xf633('0x2e')][_0xf633('0x27')]!==_0xf633('0x2d')){throw new Error(_0xf633('0x7e'));}if(_0x4e276b['body'][_0xf633('0x27')]===_0xf633('0x2d')&&_0x4e276b[_0xf633('0x2e')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x4e276b['body']])[_0xf633('0x1d')](function(){return validateUser(_0x4e276b[_0xf633('0x5d')]);})[_0xf633('0x1d')](function(_0x3f1085){return updateUser(_0x3f1085)[_0xf633('0x1d')](function(_0x32bff8){if(_0x32bff8[_0xf633('0x27')]==='admin'){_0x32bff8[_0xf633('0x7f')]=_0x4e276b[_0xf633('0x2e')]['settingsEnabled'];delete _0x32bff8[_0xf633('0x80')];}return _0x32bff8;});})[_0xf633('0x1d')](function(_0x5b148a){return db[_0xf633('0x39')]['create'](_0x5b148a,{'include':[{'model':db[_0xf633('0x6f')],'as':_0xf633('0x6f')}]});})[_0xf633('0x1d')](function(_0x290cb7){if(_0x4e276b[_0xf633('0x5d')]['role']===_0xf633('0x2e'))return _0x290cb7;if(_0x4e276b['user'][_0xf633('0x27')]!==_0xf633('0x2e'))return _0x290cb7;return db[_0xf633('0x81')][_0xf633('0x34')]({'where':{'name':_0x290cb7['role']==='agent'?_0xf633('0x82'):_0xf633('0x2f'),'userProfileId':_0x4e276b['user'][_0xf633('0x80')]},'raw':!![]})[_0xf633('0x1d')](function(_0x1ea92b){if(!_0x1ea92b||_0x1ea92b[_0xf633('0x83')]!=0x0)return _0x290cb7;return db['UserProfileResource'][_0xf633('0x7c')]({'name':_0x290cb7[_0xf633('0x35')],'resourceId':_0x290cb7['id'],'type':_0x1ea92b[_0xf633('0x35')],'sectionId':_0x1ea92b['id']},{})[_0xf633('0x1d')](function(){return _0x290cb7;});})[_0xf633('0x54')](function(_0x4d11a7){logger[_0xf633('0x23')](_0xf633('0x84'),_0x4d11a7);throw _0x4d11a7;});})[_0xf633('0x1d')](respondWithResult(_0x335710,0xc9))['catch'](handleError(_0x335710,null));};exports['bulkCreate']=function(_0x34d569,_0x3f941e){var _0x597502=_0x34d569['body'];var _0x3ac520=[];if(_0x34d569[_0xf633('0x2e')]['role']===_0xf633('0x28'))throw new Error(_0xf633('0x7d'));if(_['some'](_0x597502,[_0xf633('0x27'),_0xf633('0x2e')])&&_0x34d569[_0xf633('0x2e')][_0xf633('0x27')]!==_0xf633('0x2d')){throw new Error(_0xf633('0x7e'));}if(_['some'](_0x597502,[_0xf633('0x27'),'admin'])&&_0x34d569[_0xf633('0x2e')][_0xf633('0x27')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x597502)['then'](function(){return validateUser(_0x597502[0x0]);})[_0xf633('0x1d')](function(){for(var _0x557b14=0x1;_0x557b14<_0x597502[_0xf633('0x4f')];_0x557b14++){var _0xacd265=_0x597502[_0x557b14-0x1][_0xf633('0x60')];if(!_0x597502[_0x557b14][_0xf633('0x60')])_0x597502[_0x557b14][_0xf633('0x60')]=_0xacd265+0x1;_0x3ac520[_0xf633('0x4b')](validateUser(_0x597502[_0x557b14]));}return Promise[_0xf633('0x85')](_0x3ac520);})[_0xf633('0x1d')](function(){_0x3ac520=[];for(var _0x2398e2=0x0;_0x2398e2<_0x597502['length'];_0x2398e2++){_0x3ac520[_0xf633('0x4b')](updateUser(_0x597502[_0x2398e2]));}return Promise[_0xf633('0x85')](_0x3ac520);})['then'](function(){_0x3ac520=_0x597502[_0xf633('0x31')](function(_0x57f984){return db['User'][_0xf633('0x7c')](_0x57f984,{'include':[{'model':db[_0xf633('0x6f')],'as':'VoiceMail'}]})[_0xf633('0x1d')](function(_0x48e791){_0x57f984['id']=_0x48e791['id'];return _0x57f984;});});return Promise[_0xf633('0x85')](_0x3ac520);})[_0xf633('0x1d')](function(_0xee8207){if(_0x34d569['body'][_0xf633('0x27')]==='user')return _0xee8207;if(_0x34d569['user']['role']!==_0xf633('0x2e'))return _0xee8207;var _0x330ff4=_[_0xf633('0x86')](_0xee8207,function(_0x68e776){return _0x68e776[_0xf633('0x27')]==='agent'||_0x68e776['role']===_0xf633('0x30');});if(!_0x330ff4)return _0xee8207;return db[_0xf633('0x81')][_0xf633('0x87')]({'where':{'name':{'$or':[_0xf633('0x82'),'Telephones']},'userProfileId':_0x34d569['user'][_0xf633('0x80')]},'raw':!![]})['then'](function(_0x315bd9){if(_['isEmpty'](_0x315bd9)||!_[_0xf633('0x86')](_0x315bd9,['autoAssociation',0x0]))return _0xee8207;_0x3ac520=[];var _0x5aee52=_(_0x315bd9)[_0xf633('0x31')](function(_0x985833){if(_0x985833[_0xf633('0x83')]===0x1)return;return _0x985833[_0xf633('0x35')]===_0xf633('0x82')?_0xf633('0x28'):'telephone';})[_0xf633('0x88')]()[_0xf633('0x32')]();for(var _0x15253f=0x0;_0x15253f<_0xee8207[_0xf633('0x4f')];_0x15253f++){if(!_[_0xf633('0x33')](_0x5aee52,_0xee8207[_0x15253f]['role']))return;var _0x2196a8=_0xee8207[_0x15253f]['role']===_0xf633('0x28')?_0xf633('0x82'):_0xf633('0x2f');_0x3ac520['push'](db['UserProfileResource'][_0xf633('0x7c')]({'name':_0xee8207[_0x15253f][_0xf633('0x35')],'resourceId':_0xee8207[_0x15253f]['id'],'type':_0x2196a8,'sectionId':_[_0xf633('0x34')](_0x315bd9,[_0xf633('0x35'),_0x2196a8])['id']},{}));}return Promise[_0xf633('0x85')](_0x3ac520);});})[_0xf633('0x1d')](respondWithResult(_0x3f941e,0xc9))['catch'](handleError(_0x3f941e,null));};exports[_0xf633('0x89')]=function(_0x2e7cad,_0x309f88){if(_0x2e7cad[_0xf633('0x5d')]['id']){delete _0x2e7cad['body']['id'];}return db[_0xf633('0x39')][_0xf633('0x34')]({'where':{'id':_0x2e7cad[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](function(_0x47db03){if(!_0x47db03)return null;if(_0x47db03['id']===_0x2e7cad[_0xf633('0x2e')]['id']){if(!_0x2e7cad['body'][_0xf633('0x8a')]||!_0x2e7cad[_0xf633('0x5d')][_0xf633('0x8b')]){throw new db['Sequelize'][(_0xf633('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x47db03[_0xf633('0x8d')](_0x2e7cad[_0xf633('0x5d')][_0xf633('0x8a')])){throw new db[(_0xf633('0x8e'))][(_0xf633('0x8c'))](_0xf633('0x8f'));}if(_0x2e7cad['body'][_0xf633('0x8a')]===_0x2e7cad[_0xf633('0x5d')]['newPassword']){throw new db[(_0xf633('0x8e'))]['ValidationError'](_0xf633('0x90'));}}else if(_0x2e7cad[_0xf633('0x2e')][_0xf633('0x27')]===_0xf633('0x2d')){if(!_0x2e7cad['body'][_0xf633('0x8b')]){throw new db[(_0xf633('0x8e'))][(_0xf633('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x2e7cad[_0xf633('0x2e')]['role']==='user'){if(!_0x2e7cad[_0xf633('0x5d')]['newPassword']){throw new db[(_0xf633('0x8e'))][(_0xf633('0x8c'))](_0xf633('0x91'));}if(_0x47db03[_0xf633('0x27')]!==_0xf633('0x28')){throw new db['Sequelize']['ValidationError'](_0xf633('0x7d'));}}else{throw new db[(_0xf633('0x8e'))][(_0xf633('0x8c'))](_0xf633('0x7d'));}return _0x47db03;})[_0xf633('0x1d')](handleEntityNotFound(_0x309f88,null))[_0xf633('0x1d')](function(_0x1c82c2){return db[_0xf633('0x61')][_0xf633('0x92')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xf633('0x93')]})[_0xf633('0x1d')](function(_0x2f8443){if(_0x2f8443[_0xf633('0x63')])authService['validatePasswordPattern'](_0x2e7cad[_0xf633('0x5d')][_0xf633('0x8b')]);if(!_0x2f8443[_0xf633('0x94')]||!_0x1c82c2['previousPasswords'])return _0x1c82c2;authService[_0xf633('0x95')](_0x2e7cad[_0xf633('0x5d')][_0xf633('0x8b')],_0x1c82c2['previousPasswords'],_0x2f8443[_0xf633('0x93')]);return _0x1c82c2;})[_0xf633('0x1d')](saveUpdates({'password':_0x2e7cad[_0xf633('0x5d')][_0xf633('0x8b')],'passwordResetAt':_0x2e7cad[_0xf633('0x2e')]['id']==_0x2e7cad[_0xf633('0x56')]['id']?moment():null,'previousPasswords':authService[_0xf633('0x96')](_0x2e7cad[_0xf633('0x5d')][_0xf633('0x8b')],_0x1c82c2[_0xf633('0x40')])},null));})[_0xf633('0x1d')](respondWithResult(_0x309f88,null))['catch'](handleError(_0x309f88,null));};exports['addQueues']=function(_0x1ef697,_0x3ced8c){var _0x2cb2d0=_0x1ef697['body'][_0xf633('0x97')];return db['User'][_0xf633('0x34')]({'where':{'id':_0x1ef697['params']['id']},'attributes':['id',_0xf633('0x35'),_0xf633('0x27'),_0xf633('0x98'),'loginInPause',_0xf633('0x99'),_0xf633('0x9a')]})['then'](handleEntityNotFound(_0x3ced8c,null))[_0xf633('0x1d')](function(_0x1f1b5f){if(_0x1f1b5f){if(!utils[_0xf633('0x9b')](_0x2cb2d0)){throw new db[(_0xf633('0x8e'))]['ValidationError'](_0xf633('0x9c'));}return _0x1f1b5f[_0xf633('0x9d')+_['capitalize'](_0x2cb2d0[_0xf633('0x9e')]())+_0xf633('0x9f')](_0x1ef697[_0xf633('0x5d')][_0xf633('0x5f')],{'penalty':_0x1ef697[_0xf633('0x5d')]['penalty']||0x0})[_0xf633('0xa0')](function(_0x5ec763){for(var _0x53c406=0x0;_0x53c406<_0x1ef697['body']['ids'][_0xf633('0x4f')];_0x53c406+=0x1){var _0x31403d={'UserId':Number(_0x1ef697['params']['id'])};_0x31403d[_['capitalize'](_0x2cb2d0['toLowerCase']())+'QueueId']=Number(_0x1ef697[_0xf633('0x5d')][_0xf633('0x5f')][_0x53c406]);socket[_0xf633('0x29')](_0xf633('0x2e')+_[_0xf633('0xa1')](_0x2cb2d0[_0xf633('0x9e')]())+_0xf633('0xa2'),_0x31403d);}return _0x5ec763;})['then'](function(){if(_0x2cb2d0==='voice'){return db[_0xf633('0xa3')][_0xf633('0x87')]({'where':{'id':_0x1ef697[_0xf633('0x5d')][_0xf633('0x5f')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xf633('0x1d')](function(_0x5751f9){var _0x29e90e=_0x1f1b5f[_0xf633('0x2c')]({'plain':!![]});var _0x54b7ae=[];if(_0x2cb2d0===_0xf633('0xa4')&&_0x29e90e[_0xf633('0x27')]===_0xf633('0x28')&&_0x29e90e[_0xf633('0x98')]){for(let _0x1a1da4=0x0;_0x1a1da4<_0x5751f9[_0xf633('0x4f')];_0x1a1da4+=0x1){_0x54b7ae[_0xf633('0x4b')]({'membername':_0x29e90e[_0xf633('0x35')],'UserId':_0x29e90e['id'],'queue_name':_0x5751f9[_0x1a1da4][_0xf633('0x35')],'VoiceQueueId':_0x5751f9[_0x1a1da4]['id'],'interface':_['isNil'](_0x29e90e['interface'])?util['format'](_0xf633('0xa5'),_0x29e90e['name']):_0x29e90e['interface'],'paused':_0x29e90e[_0xf633('0x99')]||![],'penalty':_0x1ef697[_0xf633('0x5d')][_0xf633('0xa6')]||0x0});}return Promise[_0xf633('0x85')](_0x54b7ae[_0xf633('0x31')](function(_0x4526b6){return db[_0xf633('0xa7')][_0xf633('0xa8')](_0x4526b6);}));}return _0x1f1b5f;});}})[_0xf633('0x1d')](respondWithStatusCode(_0x3ced8c,null))['catch'](handleError(_0x3ced8c,null));};exports[_0xf633('0xa9')]=function(_0x177a60,_0x28e875){var _0x51e918,_0x397654;return db['User'][_0xf633('0x34')]({'where':{'id':_0x177a60[_0xf633('0x56')]['id']},'attributes':['id',_0xf633('0x35'),_0xf633('0x27')]})[_0xf633('0x1d')](handleEntityNotFound(_0x28e875,null))['then'](function(_0x2f7174){if(_0x2f7174){_0x51e918=_0x2f7174;if(!_0x177a60[_0xf633('0x46')]['channel']||!utils['isValidChannel'](_0x177a60[_0xf633('0x46')][_0xf633('0x97')])){throw new db[(_0xf633('0x8e'))][(_0xf633('0x8c'))](_0xf633('0x9c'));}return _0x2f7174[_0xf633('0xaa')+_[_0xf633('0xa1')](_0x177a60[_0xf633('0x46')][_0xf633('0x97')][_0xf633('0x9e')]())+_0xf633('0x9f')](_0x177a60[_0xf633('0x46')][_0xf633('0x5f')]);}})[_0xf633('0x1d')](function(_0x42439e){if(_[_0xf633('0xab')](_0x177a60[_0xf633('0x46')][_0xf633('0x5f')])){for(var _0x55cc2c=0x0;_0x55cc2c<_0x177a60[_0xf633('0x46')][_0xf633('0x5f')][_0xf633('0x4f')];_0x55cc2c+=0x1){_0x397654={'UserId':Number(_0x177a60[_0xf633('0x56')]['id'])};_0x397654[_[_0xf633('0xa1')](_0x177a60[_0xf633('0x46')][_0xf633('0x97')][_0xf633('0x9e')]())+'QueueId']=Number(_0x177a60[_0xf633('0x46')]['ids'][_0x55cc2c]);socket['emit'](_0xf633('0x2e')+_[_0xf633('0xa1')](_0x177a60[_0xf633('0x46')][_0xf633('0x97')]['toLowerCase']())+_0xf633('0xac'),_0x397654);}}else{_0x397654={'UserId':Number(_0x177a60[_0xf633('0x56')]['id'])};_0x397654[_[_0xf633('0xa1')](_0x177a60[_0xf633('0x46')][_0xf633('0x97')][_0xf633('0x9e')]())+'QueueId']=Number(_0x177a60['query']['ids']);socket[_0xf633('0x29')](_0xf633('0x2e')+_[_0xf633('0xa1')](_0x177a60[_0xf633('0x46')][_0xf633('0x97')][_0xf633('0x9e')]())+_0xf633('0xac'),_0x397654);}return _0x42439e;})[_0xf633('0x1d')](function(){if(_0x177a60['query']['channel']==='voice'){return db[_0xf633('0xa7')][_0xf633('0x2b')]({'where':{'UserId':_0x177a60['params']['id'],'VoiceQueueId':_0x177a60[_0xf633('0x46')][_0xf633('0x5f')]},'individualHooks':!![]})['then'](function(){return _0x51e918;});}return _0x51e918;})[_0xf633('0x1d')](respondWithStatusCode(_0x28e875,null))[_0xf633('0x54')](handleError(_0x28e875,null));};exports['addAvatar']=function(_0x27e70f,_0x34a00e){_0x27e70f['body'][_0xf633('0xad')]=_0x27e70f[_0xf633('0xae')]['filename'];return db[_0xf633('0x39')]['find']({'where':{'id':_0x27e70f[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x34a00e,null))[_0xf633('0x1d')](saveUpdates(_0x27e70f[_0xf633('0x5d')],null))[_0xf633('0x1d')](respondWithResult(_0x34a00e,null))['catch'](handleError(_0x34a00e,null));};exports[_0xf633('0xaf')]=function(_0x23697d,_0x4b368b){var _0x2ac050=path[_0xf633('0xb0')](config[_0xf633('0xb1')],'server/files/images/logos/default_profile.png');return db[_0xf633('0x39')][_0xf633('0x34')]({'where':{'id':_0x23697d[_0xf633('0x56')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xf633('0x1d')](handleEntityNotFound(_0x4b368b,null))[_0xf633('0x1d')](function(_0x2ff493){if(_0x2ff493){if(_[_0xf633('0x67')](_0x2ff493[_0xf633('0xad')])){return _0x4b368b[_0xf633('0xb2')](_0x2ac050);}else{if(!fs[_0xf633('0xb3')](path['join'](config[_0xf633('0xb1')],_0xf633('0xb4'),_0x2ff493[_0xf633('0xad')]))){return _0x4b368b[_0xf633('0xb2')](_0x2ac050);}return _0x4b368b[_0xf633('0xb2')](path['join'](config[_0xf633('0xb1')],_0xf633('0xb4'),_0x2ff493['userpic']));}}})[_0xf633('0x54')](handleError(_0x4b368b,null));};exports[_0xf633('0xb5')]=function(_0x4d6b5f,_0x2d8ce3){return db[_0xf633('0x39')][_0xf633('0x34')]({'where':{'id':_0x4d6b5f[_0xf633('0x56')]['id']},'attributes':['id']})[_0xf633('0x1d')](handleEntityNotFound(_0x2d8ce3,null))['then'](function(_0x58b145){var _0x3b6713=[];values=_0x58b145[_0xf633('0x50')];_0x3b6713[_0xf633('0x4b')](get_open_tabs(_0xf633('0x5a'),_0x58b145[_0xf633('0x50')]));_0x3b6713[_0xf633('0x4b')](get_open_tabs(_0xf633('0x51'),_0x58b145['dataValues']));_0x3b6713['push'](get_open_tabs(_0xf633('0x5b'),_0x58b145[_0xf633('0x50')]));_0x3b6713[_0xf633('0x4b')](get_open_tabs('whatsapp',_0x58b145[_0xf633('0x50')]));_0x3b6713[_0xf633('0x4b')](get_open_tabs(_0xf633('0x52'),_0x58b145[_0xf633('0x50')]));_0x3b6713[_0xf633('0x4b')](get_open_tabs('mail',_0x58b145[_0xf633('0x50')]));return Promise[_0xf633('0x85')](_0x3b6713);})[_0xf633('0x1d')](function(_0x135b84){if(_0x135b84){var _0xf92eb=_['map'](values['ChatOpenTabs'],function(_0x38c70f){return{'channel':_0xf633('0xb6'),'id':_0x38c70f['id'],'createdAt':_0x38c70f[_0xf633('0xb7')]};});var _0x2d2bd8=_[_0xf633('0x31')](values[_0xf633('0xb8')],function(_0x2ecd06){return{'channel':_0xf633('0xb9'),'id':_0x2ecd06['id'],'createdAt':_0x2ecd06[_0xf633('0xb7')]};});var _0x3b4da0=_[_0xf633('0x31')](values[_0xf633('0xba')],function(_0x126cb4){return{'channel':_0xf633('0xbb'),'id':_0x126cb4['id'],'createdAt':_0x126cb4[_0xf633('0xb7')]};});var _0x12fa79=_[_0xf633('0x31')](values[_0xf633('0xbc')],function(_0xc13900){return{'channel':_0xf633('0xbd'),'id':_0xc13900['id'],'createdAt':_0xc13900[_0xf633('0xb7')]};});var _0x493ea2=_[_0xf633('0x31')](values[_0xf633('0xbe')],function(_0x101a77){return{'channel':_0xf633('0xbf'),'id':_0x101a77['id'],'createdAt':_0x101a77['createdAt']};});var _0x49baa1=_[_0xf633('0x31')](values[_0xf633('0xc0')],function(_0x5b4b94){return{'channel':_0xf633('0xc1'),'id':_0x5b4b94['id'],'createdAt':_0x5b4b94[_0xf633('0xb7')]};});var _0x467a3a=_[_0xf633('0xc2')](_0xf92eb,_0x2d2bd8,_0x3b4da0,_0x12fa79,_0x493ea2,_0x49baa1);var _0x5005e7={'count':_0x467a3a['length'],'rows':_0x467a3a};return _0x5005e7;}else return null;})[_0xf633('0x1d')](respondWithResult(_0x2d8ce3,null))[_0xf633('0x54')](handleError(_0x2d8ce3,null));};exports['getContacts']=function(_0x2b88e4,_0x3b51b2){var _0xc4e41={};return db['User'][_0xf633('0x92')]({'where':{'id':_0x2b88e4['params']['id']}})['then'](function(_0xdca6af){if(!_0xdca6af){throw new APINotFoundError(util['format'](_0xf633('0xc3'),_0x2b88e4[_0xf633('0x56')]['id']));}return contacts[_0xf633('0xc4')]();})['then'](function(_0x270091){_0x2b88e4['query'][_0xf633('0x39')]=_0x2b88e4[_0xf633('0x56')]['id'];_0xc4e41=qs[_0xf633('0x57')](_0x270091,_0x2b88e4);if(_0x2b88e4[_0xf633('0x46')]['hasOwnProperty']('includeAll')){_0xc4e41[_0xf633('0x48')]=[{'model':db[_0xf633('0xc5')],'as':'List','required':![]},{'model':db[_0xf633('0xc6')],'as':_0xf633('0xc7'),'attributes':['id','name','color'],'where':_0x2b88e4['query']['tag']?{'id':_0x2b88e4['query']['tag']}:undefined,'required':_0x2b88e4[_0xf633('0x46')][_0xf633('0xc8')]?!![]:![]}];}return contacts['findAll'](_0x2b88e4['query'],_0x2b88e4[_0xf633('0x2e')],_0xc4e41,_0x270091);})['then'](respondWithFilteredResult(_0x3b51b2,_0xc4e41))['catch'](APIHandleError(_0x3b51b2));};exports[_0xf633('0xc9')]=function(_0x245c6c,_0x2e7ca2){var _0x1ccc27;var _0x21835b={};var _0x108182;return db[_0xf633('0x39')][_0xf633('0x92')]({'where':{'id':_0x245c6c[_0xf633('0x56')]['id']},'attributes':['id',_0xf633('0x35'),_0xf633('0x27')]})[_0xf633('0x1d')](handleEntityNotFound(_0x2e7ca2,null))[_0xf633('0x1d')](function(_0x5acc27){if(!utils[_0xf633('0x9b')](_0x245c6c[_0xf633('0x46')]['channel'])){throw new db[(_0xf633('0x8e'))][(_0xf633('0x8c'))](_0xf633('0x9c'));}_0x1ccc27=_0x5acc27;var _0x412dfd={};_0x412dfd[_0xf633('0xca')]=_[_0xf633('0xcb')](db[_['capitalize'](_0x245c6c[_0xf633('0x46')][_0xf633('0x97')])+'Queue']['rawAttributes']);_0x412dfd[_0xf633('0x46')]=_[_0xf633('0xcb')](_0x245c6c[_0xf633('0x46')]);_0x412dfd[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x412dfd[_0xf633('0xca')],_0x412dfd[_0xf633('0x46')]);_0x21835b['attributes']=_[_0xf633('0xcd')](_0x412dfd['model'],qs[_0xf633('0xce')](_0x245c6c[_0xf633('0x46')][_0xf633('0xce')]));_0x21835b[_0xf633('0x4a')]=_0x21835b[_0xf633('0x4a')][_0xf633('0x4f')]?_0x21835b[_0xf633('0x4a')]:_0x412dfd[_0xf633('0xca')];_0x21835b['order']=qs[_0xf633('0xcf')](_0x245c6c['query'][_0xf633('0xcf')]);_0x21835b[_0xf633('0x45')]=qs['filters'](_['pick'](_0x245c6c['query'],_0x412dfd[_0xf633('0xcc')]));if(_0x245c6c[_0xf633('0x46')][_0xf633('0x3e')]){_0x21835b['where']=_[_0xf633('0xd0')](_0x21835b[_0xf633('0x45')],{'$or':_[_0xf633('0x31')](_0x21835b[_0xf633('0x4a')],function(_0x3d4cb2){var _0x19d203={};_0x19d203[_0x3d4cb2]={'$like':'%'+_0x245c6c[_0xf633('0x46')][_0xf633('0x3e')]+'%'};return _0x19d203;})});}_0x21835b=_[_0xf633('0xd0')]({},_0x21835b,_0x245c6c[_0xf633('0x59')]);switch(_0x1ccc27['role']){case'admin':return db[_[_0xf633('0xa1')](_0x245c6c[_0xf633('0x46')][_0xf633('0x97')])+_0xf633('0xd1')]['findAll'](_0x21835b);case'user':case _0xf633('0x28'):return _0x1ccc27[_0xf633('0x2c')+_[_0xf633('0xa1')](_0x245c6c[_0xf633('0x46')][_0xf633('0x97')])+_0xf633('0x9f')](_0x21835b);default:throw new db['Sequelize'][(_0xf633('0x8c'))](_0xf633('0xd2'));}})[_0xf633('0x1d')](function(_0x5974b3){_0x108182=_0x5974b3['length'];if(!_0x245c6c[_0xf633('0x46')]['hasOwnProperty'](_0xf633('0xd3'))){_0x21835b[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x245c6c[_0xf633('0x46')][_0xf633('0x1a')]);_0x21835b[_0xf633('0x17')]=qs[_0xf633('0x17')](_0x245c6c['query'][_0xf633('0x17')]);}switch(_0x1ccc27[_0xf633('0x27')]){case _0xf633('0x2d'):return db[_[_0xf633('0xa1')](_0x245c6c['query']['channel'])+_0xf633('0xd1')][_0xf633('0x87')](_0x21835b);case _0xf633('0x2e'):case _0xf633('0x28'):return _0x1ccc27[_0xf633('0x2c')+_['capitalize'](_0x245c6c['query'][_0xf633('0x97')])+_0xf633('0x9f')](_0x21835b);}})[_0xf633('0x1d')](function(_0x7d2c9e){return{'count':_0x108182,'rows':_0x7d2c9e};})[_0xf633('0x1d')](respondWithResult(_0x2e7ca2,null))[_0xf633('0x54')](handleError(_0x2e7ca2,null));};exports[_0xf633('0xd4')]=function(_0x3bf577,_0x546171){var _0x360d1b={};var _0x232798={};var _0x5478cb;var _0x4a1c73;return db['User']['findOne']({'where':{'id':_0x3bf577['params']['id']}})['then'](handleEntityNotFound(_0x546171,null))[_0xf633('0x1d')](function(_0x108091){if(_0x108091){_0x5478cb=_0x108091;_0x232798[_0xf633('0xca')]=_['keys'](db['UserVoiceQueueRt'][_0xf633('0x3a')]);_0x232798[_0xf633('0x46')]=_['keys'](_0x3bf577[_0xf633('0x46')]);_0x232798[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x232798[_0xf633('0xca')],_0x232798[_0xf633('0x46')]);_0x360d1b['attributes']=_['intersection'](_0x232798[_0xf633('0xca')],qs[_0xf633('0xce')](_0x3bf577[_0xf633('0x46')][_0xf633('0xce')]));_0x360d1b[_0xf633('0x4a')]=_0x360d1b[_0xf633('0x4a')][_0xf633('0x4f')]?_0x360d1b[_0xf633('0x4a')]:_0x232798[_0xf633('0xca')];_0x360d1b['order']=qs[_0xf633('0xcf')](_0x3bf577[_0xf633('0x46')][_0xf633('0xcf')]);_0x360d1b[_0xf633('0x45')]=qs[_0xf633('0xcc')](_['pick'](_0x3bf577[_0xf633('0x46')],_0x232798[_0xf633('0xcc')]));if(_0x3bf577[_0xf633('0x46')][_0xf633('0x3e')]){_0x360d1b[_0xf633('0x45')]=_['merge'](_0x360d1b['where'],{'$or':_[_0xf633('0x31')](_0x360d1b['attributes'],function(_0x1d250d){var _0x2d279a={};_0x2d279a[_0x1d250d]={'$like':'%'+_0x3bf577[_0xf633('0x46')]['filter']+'%'};return _0x2d279a;})});}_0x360d1b=_['merge']({},_0x360d1b,_0x3bf577[_0xf633('0x59')]);return _0x5478cb['getVoiceQueuesRt'](_0x360d1b);}})[_0xf633('0x1d')](function(_0x4b4870){if(_0x4b4870){_0x4a1c73=_0x4b4870[_0xf633('0x4f')];if(!_0x3bf577[_0xf633('0x46')][_0xf633('0xd5')]('nolimit')){_0x360d1b[_0xf633('0x1a')]=qs['limit'](_0x3bf577['query'][_0xf633('0x1a')]);_0x360d1b[_0xf633('0x17')]=qs[_0xf633('0x17')](_0x3bf577[_0xf633('0x46')][_0xf633('0x17')]);}return _0x5478cb[_0xf633('0xd4')](_0x360d1b);}})[_0xf633('0x1d')](function(_0x121da5){if(_0x121da5){return _0x121da5?{'count':_0x4a1c73,'rows':_0x121da5}:null;}})['then'](respondWithResult(_0x546171,null))[_0xf633('0x54')](handleError(_0x546171,null));};exports['getGroups']=function(_0x7151dd,_0x3f71c3){var _0x2075b0={};var _0x55693d={};var _0x32e08d;var _0x2b5e84;return db['User']['findOne']({'where':{'id':_0x7151dd[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x3f71c3,null))[_0xf633('0x1d')](function(_0x15abee){if(_0x15abee){_0x32e08d=_0x15abee;_0x55693d[_0xf633('0xca')]=_[_0xf633('0xcb')](db['ChatGroup'][_0xf633('0x3a')]);_0x55693d[_0xf633('0x46')]=_[_0xf633('0xcb')](_0x7151dd['query']);_0x55693d['filters']=_[_0xf633('0xcd')](_0x55693d[_0xf633('0xca')],_0x55693d[_0xf633('0x46')]);_0x2075b0['attributes']=_['intersection'](_0x55693d[_0xf633('0xca')],qs[_0xf633('0xce')](_0x7151dd[_0xf633('0x46')][_0xf633('0xce')]));_0x2075b0[_0xf633('0x4a')]=_0x2075b0['attributes'][_0xf633('0x4f')]?_0x2075b0[_0xf633('0x4a')]:_0x55693d[_0xf633('0xca')];_0x2075b0[_0xf633('0xd6')]=qs[_0xf633('0xcf')](_0x7151dd['query'][_0xf633('0xcf')]);_0x2075b0[_0xf633('0x45')]=qs[_0xf633('0xcc')](_[_0xf633('0xd7')](_0x7151dd[_0xf633('0x46')],_0x55693d[_0xf633('0xcc')]));if(_0x7151dd[_0xf633('0x46')][_0xf633('0x3e')]){_0x2075b0[_0xf633('0x45')]=_[_0xf633('0xd0')](_0x2075b0[_0xf633('0x45')],{'$or':_[_0xf633('0x31')](_0x2075b0['attributes'],function(_0x584c0c){var _0x1923f0={};_0x1923f0[_0x584c0c]={'$like':'%'+_0x7151dd[_0xf633('0x46')]['filter']+'%'};return _0x1923f0;})});}_0x2075b0=_[_0xf633('0xd0')]({},_0x2075b0,_0x7151dd['options']);return _0x32e08d[_0xf633('0xd8')](_0x2075b0);}})[_0xf633('0x1d')](function(_0x20332b){if(_0x20332b){_0x2b5e84=_0x20332b['length'];if(!_0x7151dd['query']['hasOwnProperty'](_0xf633('0xd3'))){_0x2075b0[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x7151dd[_0xf633('0x46')]['limit']);_0x2075b0['offset']=qs[_0xf633('0x17')](_0x7151dd[_0xf633('0x46')]['offset']);}return _0x32e08d['getGroups'](_0x2075b0);}})[_0xf633('0x1d')](function(_0x9a3e50){if(_0x9a3e50){return _0x9a3e50?{'count':_0x2b5e84,'rows':_0x9a3e50}:null;}})[_0xf633('0x1d')](respondWithResult(_0x3f71c3,null))['catch'](handleError(_0x3f71c3,null));};exports['getRecordings']=function(_0x2326fd,_0x561674){var _0x315198={'raw':!![],'where':{}};var _0x1c798b={};var _0x14c922={'count':0x0,'rows':[]};return db[_0xf633('0x39')]['findOne']({'where':{'id':_0x2326fd[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x561674,null))[_0xf633('0x1d')](function(_0x16081d){if(_0x16081d){_0x1c798b[_0xf633('0xca')]=_[_0xf633('0xcb')](db[_0xf633('0xd9')][_0xf633('0x3a')]);_0x1c798b[_0xf633('0x46')]=_[_0xf633('0xcb')](_0x2326fd[_0xf633('0x46')]);_0x1c798b[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x1c798b[_0xf633('0xca')],_0x1c798b[_0xf633('0x46')]);_0x315198[_0xf633('0x4a')]=_[_0xf633('0xcd')](_0x1c798b[_0xf633('0xca')],qs[_0xf633('0xce')](_0x2326fd[_0xf633('0x46')][_0xf633('0xce')]));_0x315198[_0xf633('0x4a')]=_0x315198[_0xf633('0x4a')][_0xf633('0x4f')]?_0x315198[_0xf633('0x4a')]:_0x1c798b[_0xf633('0xca')];if(!_0x2326fd[_0xf633('0x46')][_0xf633('0xd5')]('nolimit')){_0x315198[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x2326fd['query']['limit']);_0x315198[_0xf633('0x17')]=qs[_0xf633('0x17')](_0x2326fd[_0xf633('0x46')][_0xf633('0x17')]);}_0x315198[_0xf633('0xd6')]=qs['sort'](_0x2326fd[_0xf633('0x46')]['sort']);_0x315198[_0xf633('0x45')]=qs[_0xf633('0xcc')](_[_0xf633('0xd7')](_0x2326fd[_0xf633('0x46')],_0x1c798b[_0xf633('0xcc')]));_0x315198[_0xf633('0x45')]['UserId']=_0x16081d['id'];if(_0x2326fd[_0xf633('0x46')][_0xf633('0x3e')]){_0x315198[_0xf633('0x45')]=_[_0xf633('0xd0')](_0x315198['where'],{'$or':_[_0xf633('0x31')](_0x315198[_0xf633('0x4a')],function(_0x4cb913){var _0x4d4d3e={};_0x4d4d3e[_0x4cb913]={'$like':'%'+_0x2326fd['query']['filter']+'%'};return _0x4d4d3e;})});}_0x315198=_[_0xf633('0xd0')]({},_0x315198,_0x2326fd[_0xf633('0x59')]);return db['VoiceRecording'][_0xf633('0x19')]({'where':_0x315198[_0xf633('0x45')]})[_0xf633('0x1d')](function(_0x4ff1a5){_0x14c922['count']=_0x4ff1a5;if(_0x2326fd['query'][_0xf633('0x47')]){_0x315198['include']=[{'all':!![]}];}return db[_0xf633('0xd9')][_0xf633('0x87')](_0x315198);})[_0xf633('0x1d')](function(_0x550d18){_0x14c922[_0xf633('0x4e')]=_0x550d18;return _0x14c922;});}})[_0xf633('0x1d')](respondWithFilteredResult(_0x561674,_0x315198))[_0xf633('0x54')](handleError(_0x561674,null));};exports[_0xf633('0xda')]=function(_0x5d5163,_0x2d8864){var _0x46494d={'raw':!![],'where':{}};var _0x2c2946={};var _0x36dc9a={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x5d5163['params']['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x2d8864,null))[_0xf633('0x1d')](function(_0x2e6c6f){if(_0x2e6c6f){_0x2c2946[_0xf633('0xca')]=_[_0xf633('0xcb')](db[_0xf633('0xdb')][_0xf633('0x3a')]);_0x2c2946['query']=_[_0xf633('0xcb')](_0x5d5163[_0xf633('0x46')]);_0x2c2946[_0xf633('0xcc')]=_['intersection'](_0x2c2946[_0xf633('0xca')],_0x2c2946[_0xf633('0x46')]);_0x46494d[_0xf633('0x4a')]=_[_0xf633('0xcd')](_0x2c2946[_0xf633('0xca')],qs[_0xf633('0xce')](_0x5d5163[_0xf633('0x46')][_0xf633('0xce')]));_0x46494d['attributes']=_0x46494d[_0xf633('0x4a')][_0xf633('0x4f')]?_0x46494d[_0xf633('0x4a')]:_0x2c2946[_0xf633('0xca')];if(!_0x5d5163[_0xf633('0x46')][_0xf633('0xd5')](_0xf633('0xd3'))){_0x46494d[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x5d5163[_0xf633('0x46')]['limit']);_0x46494d[_0xf633('0x17')]=qs[_0xf633('0x17')](_0x5d5163[_0xf633('0x46')]['offset']);}_0x46494d['order']=qs[_0xf633('0xcf')](_0x5d5163[_0xf633('0x46')]['sort']);_0x46494d[_0xf633('0x45')]=qs[_0xf633('0xcc')](_[_0xf633('0xd7')](_0x5d5163[_0xf633('0x46')],_0x2c2946[_0xf633('0xcc')]));_0x46494d['where'][_0xf633('0xdc')]=_0x2e6c6f['id'];if(_0x5d5163['query'][_0xf633('0x3e')]){_0x46494d['where']=_['merge'](_0x46494d[_0xf633('0x45')],{'$or':_[_0xf633('0x31')](_0x46494d[_0xf633('0x4a')],function(_0x4baaf9){var _0x4ae4a7={};_0x4ae4a7[_0x4baaf9]={'$like':'%'+_0x5d5163[_0xf633('0x46')][_0xf633('0x3e')]+'%'};return _0x4ae4a7;})});}_0x46494d=_[_0xf633('0xd0')]({},_0x46494d,_0x5d5163['options']);return db[_0xf633('0xdb')]['count']({'where':_0x46494d[_0xf633('0x45')]})[_0xf633('0x1d')](function(_0x3c8e58){_0x36dc9a['count']=_0x3c8e58;if(_0x5d5163[_0xf633('0x46')]['includeAll']){_0x46494d[_0xf633('0x48')]=[{'all':!![]}];}return db[_0xf633('0xdb')][_0xf633('0x87')](_0x46494d);})[_0xf633('0x1d')](function(_0x2b2caf){_0x36dc9a[_0xf633('0x4e')]=_0x2b2caf;return _0x36dc9a;});}})[_0xf633('0x1d')](respondWithFilteredResult(_0x2d8864,_0x46494d))[_0xf633('0x54')](handleError(_0x2d8864,null));};exports['getChatInteractions']=function(_0x29a061,_0xaab9cd){var _0x219f02={};var _0x1bc373={};var _0xb5fbf0;var _0x323cf5;return db[_0xf633('0x39')]['findOne']({'where':{'id':_0x29a061[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0xaab9cd,null))[_0xf633('0x1d')](function(_0x471c11){if(_0x471c11){_0xb5fbf0=_0x471c11;_0x1bc373[_0xf633('0xca')]=_[_0xf633('0xcb')](db[_0xf633('0xdd')][_0xf633('0x3a')]);_0x1bc373[_0xf633('0x46')]=_[_0xf633('0xcb')](_0x29a061[_0xf633('0x46')]);_0x1bc373[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x1bc373[_0xf633('0xca')],_0x1bc373[_0xf633('0x46')]);_0x219f02[_0xf633('0x4a')]=_['intersection'](_0x1bc373[_0xf633('0xca')],qs[_0xf633('0xce')](_0x29a061['query'][_0xf633('0xce')]));_0x219f02['attributes']=_0x219f02[_0xf633('0x4a')][_0xf633('0x4f')]?_0x219f02[_0xf633('0x4a')]:_0x1bc373[_0xf633('0xca')];_0x219f02[_0xf633('0xd6')]=qs[_0xf633('0xcf')](_0x29a061[_0xf633('0x46')][_0xf633('0xcf')]);_0x219f02['where']=qs['filters'](_[_0xf633('0xd7')](_0x29a061[_0xf633('0x46')],_0x1bc373[_0xf633('0xcc')]));if(_0x29a061['query'][_0xf633('0x3e')]){_0x219f02[_0xf633('0x45')]=_['merge'](_0x219f02[_0xf633('0x45')],{'$or':_[_0xf633('0x31')](_0x219f02[_0xf633('0x4a')],function(_0xb18bf8){var _0x1fcada={};_0x1fcada[_0xb18bf8]={'$like':'%'+_0x29a061[_0xf633('0x46')][_0xf633('0x3e')]+'%'};return _0x1fcada;})});}_0x219f02=_[_0xf633('0xd0')]({},_0x219f02,_0x29a061[_0xf633('0x59')]);return _0xb5fbf0[_0xf633('0xde')](_0x219f02);}})[_0xf633('0x1d')](function(_0x118106){if(_0x118106){_0x323cf5=_0x118106[_0xf633('0x4f')];if(!_0x29a061['query']['hasOwnProperty'](_0xf633('0xd3'))){_0x219f02[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x29a061[_0xf633('0x46')][_0xf633('0x1a')]);_0x219f02[_0xf633('0x17')]=qs['offset'](_0x29a061[_0xf633('0x46')][_0xf633('0x17')]);}return _0xb5fbf0[_0xf633('0xde')](_0x219f02);}})[_0xf633('0x1d')](function(_0x362377){if(_0x362377){return _0x362377?{'count':_0x323cf5,'rows':_0x362377}:null;}})[_0xf633('0x1d')](respondWithResult(_0xaab9cd,null))['catch'](handleError(_0xaab9cd,null));};exports[_0xf633('0xdf')]=function(_0x34e83,_0x462e5e){var _0x5df609={};var _0x1cf396={};var _0x2a68e0;var _0x1fc7ed;return db[_0xf633('0x39')]['findOne']({'where':{'id':_0x34e83[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x462e5e,null))['then'](function(_0x37a681){if(_0x37a681){_0x2a68e0=_0x37a681;_0x1cf396['model']=_['keys'](db['OpenchannelInteraction'][_0xf633('0x3a')]);_0x1cf396[_0xf633('0x46')]=_['keys'](_0x34e83[_0xf633('0x46')]);_0x1cf396[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x1cf396[_0xf633('0xca')],_0x1cf396['query']);_0x5df609['attributes']=_['intersection'](_0x1cf396[_0xf633('0xca')],qs[_0xf633('0xce')](_0x34e83[_0xf633('0x46')][_0xf633('0xce')]));_0x5df609[_0xf633('0x4a')]=_0x5df609[_0xf633('0x4a')][_0xf633('0x4f')]?_0x5df609[_0xf633('0x4a')]:_0x1cf396[_0xf633('0xca')];_0x5df609[_0xf633('0xd6')]=qs['sort'](_0x34e83['query'][_0xf633('0xcf')]);_0x5df609[_0xf633('0x45')]=qs[_0xf633('0xcc')](_['pick'](_0x34e83['query'],_0x1cf396[_0xf633('0xcc')]));if(_0x34e83['query'][_0xf633('0x3e')]){_0x5df609[_0xf633('0x45')]=_[_0xf633('0xd0')](_0x5df609[_0xf633('0x45')],{'$or':_['map'](_0x5df609[_0xf633('0x4a')],function(_0x217514){var _0x277e61={};_0x277e61[_0x217514]={'$like':'%'+_0x34e83[_0xf633('0x46')][_0xf633('0x3e')]+'%'};return _0x277e61;})});}_0x5df609=_[_0xf633('0xd0')]({},_0x5df609,_0x34e83[_0xf633('0x59')]);return _0x2a68e0[_0xf633('0xdf')](_0x5df609);}})[_0xf633('0x1d')](function(_0x5da7bc){if(_0x5da7bc){_0x1fc7ed=_0x5da7bc[_0xf633('0x4f')];if(!_0x34e83[_0xf633('0x46')]['hasOwnProperty'](_0xf633('0xd3'))){_0x5df609[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x34e83[_0xf633('0x46')][_0xf633('0x1a')]);_0x5df609[_0xf633('0x17')]=qs[_0xf633('0x17')](_0x34e83[_0xf633('0x46')][_0xf633('0x17')]);}return _0x2a68e0[_0xf633('0xdf')](_0x5df609);}})[_0xf633('0x1d')](function(_0x50b096){if(_0x50b096){return _0x50b096?{'count':_0x1fc7ed,'rows':_0x50b096}:null;}})['then'](respondWithResult(_0x462e5e,null))[_0xf633('0x54')](handleError(_0x462e5e,null));};exports['getMailInteractions']=function(_0x1073f7,_0x99000e){var _0x23e840={'raw':!![],'where':{}};var _0x16d8cb={};var _0xd85b0a={'count':0x0,'rows':[]};return db[_0xf633('0x39')]['findOne']({'where':{'id':_0x1073f7[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x99000e,null))['then'](function(_0x4dbf44){if(_0x4dbf44){_0x16d8cb[_0xf633('0xca')]=_[_0xf633('0xcb')](db[_0xf633('0xe0')][_0xf633('0x3a')]);_0x16d8cb['query']=_[_0xf633('0xcb')](_0x1073f7[_0xf633('0x46')]);_0x16d8cb[_0xf633('0xcc')]=_['intersection'](_0x16d8cb['model'],_0x16d8cb[_0xf633('0x46')]);_0x23e840['attributes']=_[_0xf633('0xcd')](_0x16d8cb[_0xf633('0xca')],qs[_0xf633('0xce')](_0x1073f7['query'][_0xf633('0xce')]));_0x23e840[_0xf633('0x4a')]=_0x23e840[_0xf633('0x4a')][_0xf633('0x4f')]?_0x23e840[_0xf633('0x4a')]:_0x16d8cb['model'];if(!_0x1073f7[_0xf633('0x46')]['hasOwnProperty'](_0xf633('0xd3'))){_0x23e840[_0xf633('0x1a')]=qs['limit'](_0x1073f7[_0xf633('0x46')][_0xf633('0x1a')]);_0x23e840[_0xf633('0x17')]=qs[_0xf633('0x17')](_0x1073f7[_0xf633('0x46')][_0xf633('0x17')]);}_0x23e840[_0xf633('0xd6')]=qs[_0xf633('0xcf')](_0x1073f7[_0xf633('0x46')][_0xf633('0xcf')]);_0x23e840[_0xf633('0x45')]=qs[_0xf633('0xcc')](_[_0xf633('0xd7')](_0x1073f7['query'],_0x16d8cb[_0xf633('0xcc')]));_0x23e840[_0xf633('0x45')][_0xf633('0xdc')]=_0x4dbf44['id'];if(_0x1073f7['query']['filter']){_0x23e840['where']=_[_0xf633('0xd0')](_0x23e840[_0xf633('0x45')],{'$or':_['map'](_0x23e840[_0xf633('0x4a')],function(_0x340054){var _0x27a6ca={};_0x27a6ca[_0x340054]={'$like':'%'+_0x1073f7['query'][_0xf633('0x3e')]+'%'};return _0x27a6ca;})});}_0x23e840=_['merge']({},_0x23e840,_0x1073f7['options']);return db[_0xf633('0xe0')]['count']({'where':_0x23e840[_0xf633('0x45')]})[_0xf633('0x1d')](function(_0x2539a6){_0xd85b0a[_0xf633('0x19')]=_0x2539a6;if(_0x1073f7[_0xf633('0x46')][_0xf633('0x47')]){_0x23e840['include']=[{'all':!![]}];}return db[_0xf633('0xe0')][_0xf633('0x87')](_0x23e840);})[_0xf633('0x1d')](function(_0x169c3f){_0xd85b0a[_0xf633('0x4e')]=_0x169c3f;return _0xd85b0a;});}})['then'](respondWithFilteredResult(_0x99000e,_0x23e840))[_0xf633('0x54')](handleError(_0x99000e,null));};exports[_0xf633('0xe1')]=function(_0x465eb8,_0x5ee8e5){var _0x2292d2={};var _0x156c2e={};var _0x91a050;var _0x51651d;return db[_0xf633('0x39')][_0xf633('0x92')]({'where':{'id':_0x465eb8[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x5ee8e5,null))[_0xf633('0x1d')](function(_0x18f1fb){if(_0x18f1fb){_0x91a050=_0x18f1fb;_0x156c2e['model']=_['keys'](db[_0xf633('0xe2')][_0xf633('0x3a')]);_0x156c2e['query']=_[_0xf633('0xcb')](_0x465eb8['query']);_0x156c2e[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x156c2e['model'],_0x156c2e[_0xf633('0x46')]);_0x2292d2['attributes']=_[_0xf633('0xcd')](_0x156c2e[_0xf633('0xca')],qs[_0xf633('0xce')](_0x465eb8[_0xf633('0x46')][_0xf633('0xce')]));_0x2292d2[_0xf633('0x4a')]=_0x2292d2[_0xf633('0x4a')][_0xf633('0x4f')]?_0x2292d2[_0xf633('0x4a')]:_0x156c2e[_0xf633('0xca')];_0x2292d2[_0xf633('0xd6')]=qs['sort'](_0x465eb8[_0xf633('0x46')][_0xf633('0xcf')]);_0x2292d2['where']=qs[_0xf633('0xcc')](_['pick'](_0x465eb8[_0xf633('0x46')],_0x156c2e[_0xf633('0xcc')]));if(_0x465eb8['query'][_0xf633('0x3e')]){_0x2292d2[_0xf633('0x45')]=_[_0xf633('0xd0')](_0x2292d2[_0xf633('0x45')],{'$or':_['map'](_0x2292d2[_0xf633('0x4a')],function(_0x368240){var _0x4058ea={};_0x4058ea[_0x368240]={'$like':'%'+_0x465eb8['query'][_0xf633('0x3e')]+'%'};return _0x4058ea;})});}_0x2292d2=_['merge']({},_0x2292d2,_0x465eb8['options']);return _0x91a050[_0xf633('0xe1')](_0x2292d2);}})[_0xf633('0x1d')](function(_0x1e1a8a){if(_0x1e1a8a){_0x51651d=_0x1e1a8a[_0xf633('0x4f')];if(!_0x465eb8[_0xf633('0x46')][_0xf633('0xd5')](_0xf633('0xd3'))){_0x2292d2['limit']=qs['limit'](_0x465eb8[_0xf633('0x46')][_0xf633('0x1a')]);_0x2292d2[_0xf633('0x17')]=qs['offset'](_0x465eb8[_0xf633('0x46')][_0xf633('0x17')]);}return _0x91a050[_0xf633('0xe1')](_0x2292d2);}})[_0xf633('0x1d')](function(_0x30dbfb){if(_0x30dbfb){return _0x30dbfb?{'count':_0x51651d,'rows':_0x30dbfb}:null;}})[_0xf633('0x1d')](respondWithResult(_0x5ee8e5,null))[_0xf633('0x54')](handleError(_0x5ee8e5,null));};exports[_0xf633('0xe3')]=function(_0x1b9cbd,_0x3a9525){var _0x539c97={};var _0x396938={};var _0x2c44ba;var _0x5b4a8e;return db['User'][_0xf633('0x92')]({'where':{'id':_0x1b9cbd[_0xf633('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a9525,null))[_0xf633('0x1d')](function(_0x340e33){if(_0x340e33){_0x2c44ba=_0x340e33;_0x396938[_0xf633('0xca')]=_['keys'](db[_0xf633('0xe4')][_0xf633('0x3a')]);_0x396938[_0xf633('0x46')]=_[_0xf633('0xcb')](_0x1b9cbd[_0xf633('0x46')]);_0x396938[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x396938[_0xf633('0xca')],_0x396938[_0xf633('0x46')]);_0x539c97[_0xf633('0x4a')]=_['intersection'](_0x396938[_0xf633('0xca')],qs[_0xf633('0xce')](_0x1b9cbd[_0xf633('0x46')][_0xf633('0xce')]));_0x539c97[_0xf633('0x4a')]=_0x539c97[_0xf633('0x4a')][_0xf633('0x4f')]?_0x539c97[_0xf633('0x4a')]:_0x396938[_0xf633('0xca')];_0x539c97[_0xf633('0xd6')]=qs['sort'](_0x1b9cbd[_0xf633('0x46')]['sort']);_0x539c97['where']=qs[_0xf633('0xcc')](_[_0xf633('0xd7')](_0x1b9cbd[_0xf633('0x46')],_0x396938[_0xf633('0xcc')]));if(_0x1b9cbd[_0xf633('0x46')][_0xf633('0x3e')]){_0x539c97[_0xf633('0x45')]=_['merge'](_0x539c97['where'],{'$or':_[_0xf633('0x31')](_0x539c97[_0xf633('0x4a')],function(_0x5d71d0){var _0x41d885={};_0x41d885[_0x5d71d0]={'$like':'%'+_0x1b9cbd['query'][_0xf633('0x3e')]+'%'};return _0x41d885;})});}_0x539c97=_['merge']({},_0x539c97,_0x1b9cbd[_0xf633('0x59')]);return _0x2c44ba['getFaxInteractions'](_0x539c97);}})[_0xf633('0x1d')](function(_0x2c0684){if(_0x2c0684){_0x5b4a8e=_0x2c0684[_0xf633('0x4f')];if(!_0x1b9cbd['query'][_0xf633('0xd5')]('nolimit')){_0x539c97[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x1b9cbd[_0xf633('0x46')][_0xf633('0x1a')]);_0x539c97[_0xf633('0x17')]=qs['offset'](_0x1b9cbd[_0xf633('0x46')][_0xf633('0x17')]);}return _0x2c44ba[_0xf633('0xe3')](_0x539c97);}})[_0xf633('0x1d')](function(_0x1818ff){if(_0x1818ff){return _0x1818ff?{'count':_0x5b4a8e,'rows':_0x1818ff}:null;}})[_0xf633('0x1d')](respondWithResult(_0x3a9525,null))['catch'](handleError(_0x3a9525,null));};exports[_0xf633('0xe5')]=function(_0xb467b4,_0x36353a){var _0x320316={};var _0x46fdbc={};var _0x18da7a;var _0x3ce69c;return db[_0xf633('0x39')][_0xf633('0x92')]({'where':{'id':_0xb467b4['params']['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x36353a,null))[_0xf633('0x1d')](function(_0x424de0){if(_0x424de0){_0x18da7a=_0x424de0;_0x46fdbc[_0xf633('0xca')]=_[_0xf633('0xcb')](db[_0xf633('0xe6')][_0xf633('0x3a')]);_0x46fdbc[_0xf633('0x46')]=_['keys'](_0xb467b4[_0xf633('0x46')]);_0x46fdbc[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x46fdbc[_0xf633('0xca')],_0x46fdbc['query']);_0x320316[_0xf633('0x4a')]=_['intersection'](_0x46fdbc[_0xf633('0xca')],qs[_0xf633('0xce')](_0xb467b4[_0xf633('0x46')][_0xf633('0xce')]));_0x320316[_0xf633('0x4a')]=_0x320316[_0xf633('0x4a')]['length']?_0x320316[_0xf633('0x4a')]:_0x46fdbc[_0xf633('0xca')];_0x320316[_0xf633('0xd6')]=qs['sort'](_0xb467b4[_0xf633('0x46')]['sort']);_0x320316['where']=qs[_0xf633('0xcc')](_[_0xf633('0xd7')](_0xb467b4[_0xf633('0x46')],_0x46fdbc['filters']));if(_0xb467b4[_0xf633('0x46')]['filter']){_0x320316['where']=_[_0xf633('0xd0')](_0x320316['where'],{'$or':_[_0xf633('0x31')](_0x320316[_0xf633('0x4a')],function(_0x505d9d){var _0x476c44={};_0x476c44[_0x505d9d]={'$like':'%'+_0xb467b4[_0xf633('0x46')][_0xf633('0x3e')]+'%'};return _0x476c44;})});}_0x320316=_[_0xf633('0xd0')]({},_0x320316,_0xb467b4[_0xf633('0x59')]);return _0x18da7a['getWhatsappInteractions'](_0x320316);}})['then'](function(_0x2f04d0){if(_0x2f04d0){_0x3ce69c=_0x2f04d0[_0xf633('0x4f')];if(!_0xb467b4[_0xf633('0x46')][_0xf633('0xd5')](_0xf633('0xd3'))){_0x320316['limit']=qs[_0xf633('0x1a')](_0xb467b4[_0xf633('0x46')]['limit']);_0x320316['offset']=qs[_0xf633('0x17')](_0xb467b4[_0xf633('0x46')]['offset']);}return _0x18da7a['getWhatsappInteractions'](_0x320316);}})[_0xf633('0x1d')](function(_0x239525){if(_0x239525){return _0x239525?{'count':_0x3ce69c,'rows':_0x239525}:null;}})[_0xf633('0x1d')](respondWithResult(_0x36353a,null))['catch'](handleError(_0x36353a,null));};exports[_0xf633('0xe7')]=function(_0x4d5cd9,_0x509bb3,_0x4bd41d){var _0x42a4f3;var _0x466a2a;var _0x5d360c;var _0x2f2d60=!_[_0xf633('0x67')](_0x4d5cd9[_0xf633('0x56')]['id'])?_0x4d5cd9['params']['id']:!_['isNil'](_0x4d5cd9[_0xf633('0x2e')]['id'])?_0x4d5cd9[_0xf633('0x2e')]['id']:null;return db[_0xf633('0x39')]['find']({'where':{'id':_0x2f2d60,'role':{'$or':[_0xf633('0x2d'),_0xf633('0x2e'),_0xf633('0x28')]}},'attributes':['id',_0xf633('0x35'),_0xf633('0xe8'),_0xf633('0xe9'),_0xf633('0x27'),_0xf633('0x60'),_0xf633('0xea')]})[_0xf633('0x1d')](function(_0x1e0e72){if(_0x1e0e72){if(_0x1e0e72['role']===_0xf633('0x28')){_0x42a4f3=_0x1e0e72;if(_0x4d5cd9[_0xf633('0x5d')][_0xf633('0x9a')]){_0x5d360c=util[_0xf633('0xeb')](_0xf633('0xec'),_0x42a4f3[_0x4d5cd9['body'][_0xf633('0x9a')]]);}else if(_0x4d5cd9[_0xf633('0x5d')]['intrf']){_0x5d360c=util[_0xf633('0xeb')]('SIP/%s',_0x4d5cd9[_0xf633('0x5d')][_0xf633('0xed')]);}else{_0x5d360c=util['format']('SIP/%s',_0x42a4f3['name']);}socket['to'](util[_0xf633('0xeb')](_0xf633('0xee'),_0x42a4f3[_0xf633('0x35')]))[_0xf633('0x29')]('user:forcelogout',{'user':{'id':_0x42a4f3['id'],'name':_0x42a4f3[_0xf633('0x35')]},'ip':_0x4d5cd9[_0xf633('0xef')][_0xf633('0xf0')]||_0x4d5cd9[_0xf633('0xf1')][_0xf633('0xf2')]||_0x4d5cd9[_0xf633('0xf3')][_0xf633('0xf2')]||_0x4d5cd9['connection']['socket']['remoteAddress']});return db[_0xf633('0xa7')][_0xf633('0x2b')]({'where':{'membername':_0x42a4f3[_0xf633('0x35')]},'individualHooks':!![]});}}else{throw new db[(_0xf633('0x8e'))][(_0xf633('0x8c'))](_0xf633('0xf4'));}})[_0xf633('0x1d')](function(){if(_0x42a4f3){return _0x42a4f3[_0xf633('0xf5')]({'raw':!![]});}})['then'](function(_0x6a09c2){if(_0x42a4f3){if(_0x6a09c2){_0x466a2a=_0x6a09c2;if(_0x466a2a[_0xf633('0x4f')]){var _0x3ab870=_0x466a2a[_0xf633('0x31')](function(_0x40dae1){var _0x591705={'membername':_0x42a4f3['name'],'UserId':_0x42a4f3['id'],'queue_name':_0x40dae1[_0xf633('0x35')],'VoiceQueueId':_0x40dae1['id'],'interface':_0x5d360c,'paused':_0x42a4f3[_0xf633('0xea')]||![],'penalty':_0x40dae1[_0xf633('0xf6')]||0x0};return db[_0xf633('0xa7')][_0xf633('0xa8')](_0x591705);});return Promise[_0xf633('0x85')](_0x3ab870);}}}})[_0xf633('0x1d')](function(){if(_0x42a4f3){return db[_0xf633('0xf7')][_0xf633('0x87')]({'where':{'membername':_0x42a4f3['name'],'exitAt':null}});}})[_0xf633('0x1d')](function(_0x21db1d){if(_0x42a4f3){var _0x277731=[];_0x21db1d['forEach'](function(_0x5363dc){_0x277731[_0xf633('0x4b')](_0x5363dc[_0xf633('0x26')]({'exitAt':moment()[_0xf633('0xeb')](_0xf633('0xf8'))}));});return Promise[_0xf633('0x85')](_0x277731);}})[_0xf633('0x1d')](function(){if(_0x42a4f3){var _0x424672=[];var _0x2c574a=[];var _0x31a075=utils[_0xf633('0xf9')]();var _0x558f2a={'membername':_0x42a4f3[_0xf633('0x35')],'interface':_0x5d360c,'enterAt':moment()[_0xf633('0xeb')](_0xf633('0xf8')),'role':_0x42a4f3[_0xf633('0x27')],'internal':_0x42a4f3[_0xf633('0x60')]};_0x31a075[_0xf633('0xfa')](function(_0x1ebd48){_0x424672[_0xf633('0x4b')](_['merge']({'channel':_0x1ebd48,'type':'LOGIN','data1':_0x4d5cd9['body']['device'],'data2':_0x5d360c},_0x558f2a));if(_0x42a4f3['loginInPause']){_0x2c574a[_0xf633('0x4b')](_['merge']({'channel':_0x1ebd48,'type':_0xf633('0xfb'),'data1':'LOGININPAUSE'},_0x558f2a));}});return db[_0xf633('0xf7')][_0xf633('0xfc')](_0x424672[_0xf633('0xc2')](_0x2c574a),{'individualHooks':!![]});}})[_0xf633('0x1d')](function(){if(_0x42a4f3){return _0x42a4f3['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x42a4f3[_0xf633('0xea')]||![],'mailPause':_0x42a4f3['loginInPause']||![],'chatPause':_0x42a4f3[_0xf633('0xea')]||![],'faxPause':_0x42a4f3['loginInPause']||![],'smsPause':_0x42a4f3[_0xf633('0xea')]||![],'openchannelPause':_0x42a4f3['loginInPause']||![],'whatsappPause':_0x42a4f3[_0xf633('0xea')]||![],'pauseType':_0x42a4f3[_0xf633('0xea')]?_0xf633('0xfd'):null,'interface':_0x5d360c,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xf633('0x1d')](function(_0x10339e){if(_0x4d5cd9[_0xf633('0xfe')]){return _0x4bd41d();}else{return Promise[_0xf633('0xff')](_0x10339e)['then'](respondWithResult(_0x509bb3,null));}})['catch'](handleError(_0x509bb3,null));};exports[_0xf633('0x100')]=function(_0x5c3144,_0x2e8b7e){var _0x305797;return db[_0xf633('0x39')][_0xf633('0x34')]({'where':{'id':_0x5c3144[_0xf633('0x56')]['id'],'role':_0xf633('0x28')},'attributes':['id',_0xf633('0x35'),_0xf633('0x27')]})[_0xf633('0x1d')](handleEntityNotFound(_0x2e8b7e,null))[_0xf633('0x1d')](function(_0x48d8ff){if(_0x48d8ff){_0x305797=_0x48d8ff;return db[_0xf633('0xa7')][_0xf633('0x2b')]({'where':{'membername':_0x305797[_0xf633('0x35')]},'individualHooks':!![]});}})[_0xf633('0x1d')](function(){return db[_0xf633('0xf7')][_0xf633('0x87')]({'where':{'membername':_0x305797['name'],'exitAt':null}});})[_0xf633('0x1d')](function(_0x43f165){var _0x34b51d=[];_0x43f165[_0xf633('0xfa')](function(_0x2397ff){_0x34b51d['push'](_0x2397ff['update']({'exitAt':moment()['format'](_0xf633('0xf8'))}));});return Promise[_0xf633('0x85')](_0x34b51d);})[_0xf633('0x1d')](function(){return _0x305797[_0xf633('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xf633('0x1d')](respondWithResult(_0x2e8b7e,null))[_0xf633('0x54')](handleError(_0x2e8b7e,null));};exports[_0xf633('0x101')]=function(_0xf51fcf,_0xf4a6ef){var _0x3cea7b;return db['UserVoiceQueueRt'][_0xf633('0x26')]({'paused':0x1},{'where':{'UserId':_0xf51fcf[_0xf633('0x56')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0xf633('0x34')]({'where':{'id':_0xf51fcf['params']['id'],'role':_0xf633('0x28')},'attributes':['id',_0xf633('0x35'),_0xf633('0x27'),_0xf633('0x60'),'interface',_0xf633('0x98')]});})[_0xf633('0x1d')](handleEntityNotFound(_0xf4a6ef,null))[_0xf633('0x1d')](function(_0x31a6bb){if(_0x31a6bb){_0x3cea7b=_0x31a6bb;return respondWithRpcPromise(_0xf633('0x102'),_0xf633('0x101'),{'id':_0x3cea7b['id'],'name':_0x3cea7b[_0xf633('0x35')],'pause':!![]});}})['then'](function(){if(_0x3cea7b){return db[_0xf633('0xf7')]['findAll']({'where':{'membername':_0x3cea7b[_0xf633('0x35')],'type':_0xf633('0xfb'),'exitAt':null}});}})[_0xf633('0x1d')](function(_0x31addd){if(_0x31addd[_0xf633('0x4f')]){var _0x29f6b3=moment()[_0xf633('0xeb')](_0xf633('0xf8'));for(var _0x4886c3=0x0,_0x4ebb37=_0x31addd['length'];_0x4886c3<_0x4ebb37;_0x4886c3++){_0x31addd[_0x4886c3][_0xf633('0x103')]({'exitAt':_0x29f6b3});}}})[_0xf633('0x1d')](function(){var _0x2a75fa=[];var _0x4b6ff0=utils[_0xf633('0xf9')]();_0x4b6ff0[_0xf633('0xfa')](function(_0x2f3820){_0x2a75fa[_0xf633('0x4b')]({'channel':_0x2f3820,'membername':_0x3cea7b[_0xf633('0x35')],'interface':_[_0xf633('0x67')](_0x3cea7b['interface'])?util[_0xf633('0xeb')](_0xf633('0xa5'),_0x3cea7b[_0xf633('0x35')]):_0x3cea7b['interface'],'type':_0xf633('0xfb'),'enterAt':moment()[_0xf633('0xeb')](_0xf633('0xf8')),'data1':_0xf51fcf[_0xf633('0x5d')][_0xf633('0x3c')]||_0xf633('0x104'),'role':_0x3cea7b[_0xf633('0x27')],'internal':_0x3cea7b[_0xf633('0x60')]});});return db[_0xf633('0xf7')][_0xf633('0xfc')](_0x2a75fa,{'individualHooks':!![]});})['then'](function(){return _0x3cea7b[_0xf633('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xf51fcf[_0xf633('0x5d')][_0xf633('0x3c')]||_0xf633('0x104'),'lastPauseAt':moment()[_0xf633('0xeb')](_0xf633('0xf8'))});})[_0xf633('0x1d')](respondWithResult(_0xf4a6ef,null))['catch'](handleError(_0xf4a6ef,null));};exports[_0xf633('0x105')]=function(_0x2c4744,_0x3d8d83){if(_0x2c4744[_0xf633('0x5d')]['channel']&&!utils['isValidChannel'](_0x2c4744[_0xf633('0x5d')]['channel'])){throw new APIBadRequestError(util[_0xf633('0xeb')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2c4744[_0xf633('0x5d')][_0xf633('0x97')]));}return db[_0xf633('0x39')][_0xf633('0x34')]({'where':{'id':_0x2c4744[_0xf633('0x56')]['id']},'attributes':['id',_0xf633('0x35'),'role',_0xf633('0x60'),_0xf633('0x9a'),_0xf633('0x98'),'voicePause','mailPause',_0xf633('0x106'),_0xf633('0x107'),'openchannelPause',_0xf633('0x108'),'whatsappPause','pauseType',_0xf633('0x109')]})[_0xf633('0x1d')](function(_0xafc1db){if(!_0xafc1db){throw new APINotFoundError(util[_0xf633('0xeb')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2c4744[_0xf633('0x56')]['id']));}return _0xafc1db[_0xf633('0x105')](_0x2c4744[_0xf633('0x5d')][_0xf633('0x97')]);})[_0xf633('0x1d')](respondWithResult(_0x3d8d83,null))[_0xf633('0x54')](APIHandleError(_0x3d8d83));};exports[_0xf633('0x10a')]=function(_0x3e379c,_0x40bbe5){var _0x4806ea={};var _0x2afb89={};var _0x126451;var _0x13aeab;return db[_0xf633('0x39')][_0xf633('0x92')]({'where':{'id':_0x3e379c[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x40bbe5,null))['then'](function(_0x311673){if(_0x311673){_0x126451=_0x311673;_0x2afb89['model']=_[_0xf633('0xcb')](db[_0xf633('0x10b')][_0xf633('0x3a')]);_0x2afb89[_0xf633('0x46')]=_['keys'](_0x3e379c[_0xf633('0x46')]);_0x2afb89[_0xf633('0xcc')]=_[_0xf633('0xcd')](_0x2afb89[_0xf633('0xca')],_0x2afb89[_0xf633('0x46')]);_0x4806ea[_0xf633('0x4a')]=_[_0xf633('0xcd')](_0x2afb89[_0xf633('0xca')],qs[_0xf633('0xce')](_0x3e379c['query'][_0xf633('0xce')]));_0x4806ea[_0xf633('0x4a')]=_0x4806ea[_0xf633('0x4a')][_0xf633('0x4f')]?_0x4806ea[_0xf633('0x4a')]:_0x2afb89[_0xf633('0xca')];_0x4806ea[_0xf633('0xd6')]=qs[_0xf633('0xcf')](_0x3e379c['query']['sort']);_0x4806ea[_0xf633('0x45')]=qs['filters'](_[_0xf633('0xd7')](_0x3e379c[_0xf633('0x46')],_0x2afb89[_0xf633('0xcc')]));if(_0x3e379c[_0xf633('0x46')][_0xf633('0x3e')]){_0x4806ea[_0xf633('0x45')]=_[_0xf633('0xd0')](_0x4806ea[_0xf633('0x45')],{'$or':_[_0xf633('0x31')](_0x4806ea[_0xf633('0x4a')],function(_0x24a5d8){var _0x39ceb4={};_0x39ceb4[_0x24a5d8]={'$like':'%'+_0x3e379c[_0xf633('0x46')][_0xf633('0x3e')]+'%'};return _0x39ceb4;})});}_0x4806ea=_[_0xf633('0xd0')]({},_0x4806ea,_0x3e379c[_0xf633('0x59')]);return _0x126451[_0xf633('0x10a')](_0x4806ea);}})[_0xf633('0x1d')](function(_0x5f1fec){if(_0x5f1fec){_0x13aeab=_0x5f1fec['length'];if(!_0x3e379c[_0xf633('0x46')][_0xf633('0xd5')](_0xf633('0xd3'))){_0x4806ea[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x3e379c[_0xf633('0x46')][_0xf633('0x1a')]);_0x4806ea[_0xf633('0x17')]=qs['offset'](_0x3e379c[_0xf633('0x46')]['offset']);}return _0x126451[_0xf633('0x10a')](_0x4806ea);}})['then'](function(_0x19796b){if(_0x19796b){return _0x19796b?{'count':_0x13aeab,'rows':_0x19796b}:null;}})[_0xf633('0x1d')](respondWithResult(_0x40bbe5,null))[_0xf633('0x54')](handleError(_0x40bbe5,null));};exports[_0xf633('0x10c')]=function(_0x41519d,_0x34af2c){var _0xa021af=_0x41519d[_0xf633('0x56')]['id'];var _0xf14553=_0x41519d[_0xf633('0x5d')]?_0x41519d[_0xf633('0x5d')][_0xf633('0x5f')]:null;var _0x1ff0c9=[];return Promise[_0xf633('0xff')]()[_0xf633('0x1d')](function(){if(!_0xf14553)throw new APIBadRequestError(_0xf633('0x10d'));})[_0xf633('0x1d')](function(){return db[_0xf633('0x39')][_0xf633('0x92')]({'where':{'id':_0xa021af}});})[_0xf633('0x1d')](function(_0x462ed6){if(!_0x462ed6)throw new APINotFoundError(util[_0xf633('0xeb')]('User\x20with\x20id\x20%s\x20not\x20found',_0x41519d[_0xf633('0x56')]['id']));return db[_0xf633('0x68')][_0xf633('0x10e')](function(_0x3ef42e){return _0x462ed6[_0xf633('0x10c')](_0xf14553,{'transaction':_0x3ef42e})[_0xf633('0x1d')](function(){return db[_0xf633('0x10b')][_0xf633('0x87')]({'where':{'id':{'$in':_0xf14553}}});})[_0xf633('0x1d')](function(_0x23b913){var _0x18c855=_['map'](_0x23b913,function(_0xbed244){return _0xbed244['getAssociatedQueues']();});return Promise[_0xf633('0x85')](_0x18c855);})['then'](function(_0x47980c){_0x1ff0c9=_[_0xf633('0x10f')](_0x47980c);var _0x1ee8fa=_['map'](_0x1ff0c9,function(_0x34dfb8){return _0x34dfb8['addAgent'](_0x462ed6['id'],{'transaction':_0x3ef42e});});return Promise[_0xf633('0x85')](_0x1ee8fa);})[_0xf633('0x1d')](function(){if(!_0x462ed6[_0xf633('0x98')])return;var _0x3314bb=_['filter'](_0x1ff0c9,function(_0x49c74c){return _0x49c74c[_0xf633('0x110')](_0xf633('0x97'))===_0xf633('0x111');});var _0xe512d7=_[_0xf633('0x31')](_0x3314bb,function(_0x2678e2){return db[_0xf633('0xa7')]['upsert']({'membername':_0x462ed6['name'],'UserId':_0x462ed6['id'],'queue_name':_0x2678e2[_0xf633('0x35')],'VoiceQueueId':_0x2678e2['id'],'interface':_[_0xf633('0x67')](_0x462ed6[_0xf633('0x9a')])?util[_0xf633('0xeb')](_0xf633('0xa5'),_0x462ed6['name']):_0x462ed6[_0xf633('0x9a')],'paused':_0x462ed6['voicePause']||![],'penalty':_0x462ed6[_0xf633('0xa6')]},{'transaction':_0x3ef42e});});return Promise[_0xf633('0x85')](_0xe512d7);})[_0xf633('0x1d')](function(){return db['TeamVoicePrefix'][_0xf633('0x87')]({'where':{'teamId':{'$in':_0xf14553}}});})['then'](function(_0x31aa8f){var _0x2f6b79=_['map'](_0x31aa8f,function(_0x9a5b46){return db['UserVoicePrefix'][_0xf633('0x7c')]({'UserId':_0x462ed6['id'],'VoicePrefixId':_0x9a5b46[_0xf633('0x112')]},{'transaction':_0x3ef42e});});return Promise['all'](_0x2f6b79);});});})[_0xf633('0x1d')](function(){for(var _0x191d44=0x0;_0x191d44<_0x1ff0c9['length'];_0x191d44++){var _0x2b4462=_0x1ff0c9[_0x191d44][_0xf633('0x110')](_0xf633('0x97'));var _0x293c72=_0x2b4462+_0xf633('0x113');socket[_0xf633('0x29')](_0xf633('0x2e')+_0x2b4462+_0xf633('0xa2'),{'UserId':_0xa021af,['queueField']:_0x1ff0c9[_0x191d44]['id']});}})[_0xf633('0x1d')](respondWithStatusCode(_0x34af2c,null))['catch'](APIHandleError(_0x34af2c));};exports[_0xf633('0x114')]=function(_0x6f12e9,_0x244bba){var _0x415fc4=_0x6f12e9[_0xf633('0x56')]['id'];var _0x1dd670=null;if(_0x6f12e9[_0xf633('0x46')]['ids']){_0x1dd670=_[_0xf633('0xab')](_0x6f12e9[_0xf633('0x46')][_0xf633('0x5f')])?_0x6f12e9[_0xf633('0x46')]['ids']:[_0x6f12e9[_0xf633('0x46')][_0xf633('0x5f')]];}var _0x494b57=[];return Promise[_0xf633('0xff')]()['then'](function(){if(!_0x1dd670)throw new APIBadRequestError(_0xf633('0x115'));})[_0xf633('0x1d')](function(){return db['User'][_0xf633('0x92')]({'where':{'id':_0x415fc4}});})[_0xf633('0x1d')](function(_0x2fb787){if(!_0x2fb787)throw new APINotFoundError(util[_0xf633('0xeb')](_0xf633('0xc3'),_0x6f12e9[_0xf633('0x56')]['id']));return db['sequelize']['transaction'](function(_0x4230af){return _0x2fb787[_0xf633('0x114')](_0x1dd670,{'transaction':_0x4230af})[_0xf633('0x1d')](function(){return db[_0xf633('0x10b')][_0xf633('0x87')]({'where':{'id':{'$in':_0x1dd670}}});})['then'](function(_0x2a1f35){var _0x3e7e71=_[_0xf633('0x31')](_0x2a1f35,function(_0x433d90){return _0x433d90['getAssociatedQueues']();});return Promise[_0xf633('0x85')](_0x3e7e71);})[_0xf633('0x1d')](function(_0x457ddb){_0x494b57=_[_0xf633('0x10f')](_0x457ddb);var _0x48d4d6=_[_0xf633('0x31')](_0x494b57,function(_0x33b784){return _0x33b784[_0xf633('0x116')](_0x2fb787['id'],{'transaction':_0x4230af});});return Promise[_0xf633('0x85')](_0x48d4d6);})[_0xf633('0x1d')](function(){if(!_0x2fb787[_0xf633('0x98')])return;var _0x4774e1=_[_0xf633('0x3e')](_0x494b57,function(_0x23afbc){return _0x23afbc[_0xf633('0x110')](_0xf633('0x97'))===_0xf633('0x111');});var _0x6e7cd8=_[_0xf633('0x31')](_0x4774e1,function(_0x5c7e5e){return db[_0xf633('0xa7')][_0xf633('0x2b')]({'where':{'VoiceQueueId':_0x5c7e5e['id'],'UserId':_0x2fb787['id']},'transaction':_0x4230af});});return Promise[_0xf633('0x85')](_0x6e7cd8);})['then'](function(){return db[_0xf633('0x117')][_0xf633('0x87')]({'where':{'teamId':{'$in':_0x1dd670}}});})[_0xf633('0x1d')](function(_0x3b5c91){var _0x46430f=_[_0xf633('0x31')](_0x3b5c91,function(_0x63a258){return db[_0xf633('0x118')][_0xf633('0x2b')]({'where':{'UserId':_0x2fb787['id'],'VoicePrefixId':_0x63a258['VoicePrefixId']}},{'transaction':_0x4230af});});return Promise[_0xf633('0x85')](_0x46430f);});});})[_0xf633('0x1d')](function(){for(var _0x28fff1=0x0;_0x28fff1<_0x494b57[_0xf633('0x4f')];_0x28fff1++){var _0x306e7b=_0x494b57[_0x28fff1][_0xf633('0x110')](_0xf633('0x97'));var _0x35c1f3=_0x306e7b+_0xf633('0x113');socket[_0xf633('0x29')](_0xf633('0x2e')+_0x306e7b+'Queue:remove',{'UserId':_0x415fc4,['queueField']:_0x494b57[_0x28fff1]['id']});}})[_0xf633('0x1d')](respondWithStatusCode(_0x244bba,null))[_0xf633('0x54')](APIHandleError(_0x244bba));};exports[_0xf633('0x119')]=function(_0x56c63e,_0x179196){var _0x3be4db={};var _0x4a6c5a={};var _0x2709f5;var _0x3421db;return db['User'][_0xf633('0x92')]({'where':{'id':_0x56c63e[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x179196,null))[_0xf633('0x1d')](function(_0x50b8fa){if(_0x50b8fa){_0x2709f5=_0x50b8fa;_0x4a6c5a[_0xf633('0xca')]=_[_0xf633('0xcb')](db[_0xf633('0xc5')][_0xf633('0x3a')]);_0x4a6c5a[_0xf633('0x46')]=_[_0xf633('0xcb')](_0x56c63e[_0xf633('0x46')]);_0x4a6c5a[_0xf633('0xcc')]=_['intersection'](_0x4a6c5a['model'],_0x4a6c5a[_0xf633('0x46')]);_0x3be4db[_0xf633('0x4a')]=_[_0xf633('0xcd')](_0x4a6c5a['model'],qs[_0xf633('0xce')](_0x56c63e[_0xf633('0x46')][_0xf633('0xce')]));_0x3be4db[_0xf633('0x4a')]=_0x3be4db['attributes']['length']?_0x3be4db['attributes']:_0x4a6c5a[_0xf633('0xca')];_0x3be4db[_0xf633('0xd6')]=qs[_0xf633('0xcf')](_0x56c63e[_0xf633('0x46')][_0xf633('0xcf')]);_0x3be4db['where']=qs['filters'](_[_0xf633('0xd7')](_0x56c63e[_0xf633('0x46')],_0x4a6c5a['filters']));if(_0x56c63e[_0xf633('0x46')][_0xf633('0x3e')]){_0x3be4db[_0xf633('0x45')]=_[_0xf633('0xd0')](_0x3be4db['where'],{'$or':_[_0xf633('0x31')](_0x3be4db[_0xf633('0x4a')],function(_0x356527){var _0x2e20fc={};_0x2e20fc[_0x356527]={'$like':'%'+_0x56c63e['query'][_0xf633('0x3e')]+'%'};return _0x2e20fc;})});}_0x3be4db=_[_0xf633('0xd0')]({},_0x3be4db,_0x56c63e[_0xf633('0x59')]);return _0x2709f5[_0xf633('0x119')](_0x3be4db);}})[_0xf633('0x1d')](function(_0x491a04){if(_0x491a04){_0x3421db=_0x491a04[_0xf633('0x4f')];if(!_0x56c63e['query'][_0xf633('0xd5')](_0xf633('0xd3'))){_0x3be4db[_0xf633('0x1a')]=qs[_0xf633('0x1a')](_0x56c63e[_0xf633('0x46')][_0xf633('0x1a')]);_0x3be4db[_0xf633('0x17')]=qs[_0xf633('0x17')](_0x56c63e[_0xf633('0x46')][_0xf633('0x17')]);}return _0x2709f5['getLists'](_0x3be4db);}})[_0xf633('0x1d')](function(_0x31e755){if(_0x31e755){return _0x31e755?{'count':_0x3421db,'rows':_0x31e755}:null;}})[_0xf633('0x1d')](respondWithResult(_0x179196,null))[_0xf633('0x54')](handleError(_0x179196,null));};exports[_0xf633('0x11a')]=function(_0x2aa46a,_0x2b7097){var _0x253491={};var _0x42ce42={};var _0x5264f1;return db['User'][_0xf633('0x92')]({'where':{'id':_0x2aa46a[_0xf633('0x56')]['id']}})[_0xf633('0x1d')](handleEntityNotFound(_0x2b7097,null))['then'](function(_0x7bd1de){if(_0x7bd1de){_0x5264f1=_0x7bd1de;_0x42ce42['model']=_[_0xf633('0xcb')](db[_0xf633('0x39')][_0xf633('0x3a')]);_0x42ce42['query']=_['keys'](_0x2aa46a[_0xf633('0x46')]);_0x42ce42[_0xf633('0xcc')]=_['intersection'](_0x42ce42[_0xf633('0xca')],_0x42ce42[_0xf633('0x46')]);_0x253491[_0xf633('0x4a')]=_[_0xf633('0xcd')](_0x42ce42[_0xf633('0xca')],qs[_0xf633('0xce')](_0x2aa46a[_0xf633('0x46')][_0xf633('0xce')]));_0x253491[_0xf633('0x4a')]=_0x253491[_0xf633('0x4a')][_0xf633('0x4f')]?_0x253491[_0xf633('0x4a')]:_0x42ce42[_0xf633('0xca')];_0x253491[_0xf633('0xd6')]=qs['sort'](_0x2aa46a[_0xf633('0x46')][_0xf633('0xcf')]);_0x253491['where']=qs[_0xf633('0xcc')](_[_0xf633('0xd7')](_0x2aa46a[_0xf633('0x46')],_0x42ce42[_0xf633('0xcc')]));if(_0x2aa46a['query'][_0xf633('0x3e')]){_0x253491[_0xf633('0x45')]=_[_0xf633('0xd0')](_0x253491[_0xf633('0x45')],{'$or':_[_0xf633('0x31')](_0x253491[_0xf633('0x4a')],function(_0x195c34){var _0x1409db={};_0x1409db[_0x195c34]={'$like':'%'+_0x2aa46a[_0xf633('0x46')][_0xf633('0x3e')]+'%'};return _0x1409db;})});}_0x253491[_0xf633('0xca')]=db['User'];_0x253491['as']=_0xf633('0x82');_0x253491=_[_0xf633('0xd0')]({},_0x253491,_0x2aa46a['options']);return _0x5264f1['getVoiceQueues']({'include':[_0x253491]});}})['then'](function(_0x7dfd56){if(_0x7dfd56){var _0x4a5271={},_0x1f4659=[];for(var _0x4b2919=0x0;_0x4b2919<_0x7dfd56['length'];_0x4b2919+=0x1){for(var _0x1560bc=0x0,_0xcc787c;_0x1560bc<_0x7dfd56[_0x4b2919][_0xf633('0x82')]['length'];_0x1560bc+=0x1){_0xcc787c=_0x7dfd56[_0x4b2919][_0xf633('0x82')][_0x1560bc][_0xf633('0x2c')]({'plain':!![]});_0x4a5271[_0xcc787c['id']]=_0xcc787c;}}_0x4a5271=_['values'](_0x4a5271);for(var _0x553ef9=qs['offset'](_0x2aa46a[_0xf633('0x46')][_0xf633('0x17')]);_0x553ef9<_0x4a5271[_0xf633('0x4f')]&&_0x1f4659['length']=_0x2274a9){_0x2b7f2f=_0x2274a9;_0x1958a8=0xc8;}else{_0x1958a8=0xce;}_0x1f4c66[_0x2979('0x16')](_0x1958a8);return _0x1f4c66[_0x2979('0x1b')](_0x2979('0x1c'),_0x54a284+'-'+_0x2b7f2f+'/'+_0x2274a9)[_0x2979('0x1d')](_0x2c3fda);}return null;};}function respondWithRpcPromise(_0x5ee422,_0x5ae4fb,_0x3c8009,_0x12b80a){return new Promise(function(_0x5409df,_0xb425b4){var _0x29b176=_0x12b80a||amiClient;return _0x29b176[_0x2979('0x1e')](_0x5ee422,_0x3c8009)[_0x2979('0x1f')](function(_0x139d95){logger[_0x2979('0x20')](_0x2979('0x21'),_0x5ae4fb,_0x2979('0x22'));logger['debug'](_0x2979('0x23'),_0x5ae4fb,_0x2979('0x22'),JSON[_0x2979('0x24')](_0x139d95));if(_0x139d95[_0x2979('0x25')]){if(_0x139d95[_0x2979('0x25')][_0x2979('0x26')]===0x1f4){logger[_0x2979('0x25')]('User,\x20%s,\x20%s',_0x5ae4fb,_0x139d95[_0x2979('0x25')][_0x2979('0x27')]);return _0xb425b4(_0x139d95[_0x2979('0x25')][_0x2979('0x27')]);}logger[_0x2979('0x25')]('User,\x20%s,\x20%s',_0x5ae4fb,_0x139d95[_0x2979('0x25')]['message']);return _0x5409df(_0x139d95[_0x2979('0x25')][_0x2979('0x27')]);}else{logger[_0x2979('0x20')]('User,\x20%s,\x20%s',_0x5ae4fb,'request\x20sent');_0x5409df(_0x139d95[_0x2979('0x28')]['message']);}})[_0x2979('0x29')](function(_0x5a520a){logger[_0x2979('0x25')](_0x2979('0x21'),_0x5ae4fb,_0x5a520a);_0xb425b4(_0x5a520a);});});}function saveUpdates(_0x800c44){return function(_0x463021){if(_0x463021){return _0x463021[_0x2979('0x2a')](_0x800c44)[_0x2979('0x1f')](function(_0x177c71){if(_0x177c71[_0x2979('0x2b')]===_0x2979('0x2c')){socket[_0x2979('0x2d')](_0x2979('0x2e')+_0x177c71['id'],_0x177c71);}return _0x177c71;});}return null;};}function removeEntity(_0x20a8f0,_0x36426a){return function(_0x4e685a){if(_0x4e685a){return _0x4e685a['destroy']({'transaction':_0x36426a})['then'](function(){var _0x1173de=_0x4e685a[_0x2979('0x2f')]({'plain':!![]});if(_0x1173de[_0x2979('0x2b')]===_0x2979('0x30'))return;var _0x227590=[{'name':_0x2979('0x31'),'value':_0x2979('0x32'),'ignore':!![]},{'name':_0x2979('0x33'),'value':_0x2979('0x2c'),'ignore':![]},{'name':_0x2979('0x34'),'value':'telephone','ignore':![]}];var _0x471f2a=_(_0x227590)[_0x2979('0x35')](_0x2979('0x36'))[_0x2979('0x37')]('value')[_0x2979('0x38')]();if(_['includes'](_0x471f2a,_0x1173de['role'])){return;}var _0x5ba675=_[_0x2979('0x39')](_0x227590,[_0x2979('0x38'),_0x1173de[_0x2979('0x2b')]])['name'];return db[_0x2979('0x3a')][_0x2979('0x3b')]({'where':{'type':_0x5ba675,'resourceId':_0x1173de['id']},'transaction':_0x36426a})['then'](function(){return _0x4e685a;});})[_0x2979('0x1f')](function(){_0x20a8f0['status'](0xcc)[_0x2979('0x3c')]();});}};}function handleEntityNotFound(_0x32da5d){return function(_0x59a024){if(!_0x59a024){_0x32da5d[_0x2979('0x15')](0x194);}return _0x59a024;};}function handleError(_0x5d9ba8,_0x39df6e){_0x39df6e=_0x39df6e||0x1f4;return function(_0x587d75){logger[_0x2979('0x25')](_0x587d75[_0x2979('0x3d')]);if(_0x587d75['name']){delete _0x587d75[_0x2979('0x3e')];}_0x5d9ba8[_0x2979('0x16')](_0x39df6e)['send'](_0x587d75);};}function getUserAttributes(){return _(db['User'][_0x2979('0x3f')])['map'](function(_0x41a846){return{'name':_0x41a846[_0x2979('0x40')],'type':_0x41a846[_0x2979('0x41')][_0x2979('0x42')]};})[_0x2979('0x35')](function(_0x5b216b){return!['password','salt',_0x2979('0x43'),_0x2979('0x44'),_0x2979('0x45'),'md5secret']['includes'](_0x5b216b[_0x2979('0x3e')]);})[_0x2979('0x38')]();}exports[_0x2979('0x46')]=function(_0x22079e,_0x1dc3e8){var _0xbc3356={},_0x143e95={'count':0x0,'rows':[]};var _0x3bbead=getUserAttributes();_0xbc3356=qs[_0x2979('0x47')](_0x3bbead,_0x22079e);var _0x1ce9ff={'where':_0xbc3356[_0x2979('0x48')]};return db[_0x2979('0x49')]['count'](_0x1ce9ff)[_0x2979('0x1f')](function(_0x50340a){_0x143e95['count']=_0x50340a;if(_0x22079e[_0x2979('0x4a')][_0x2979('0x4b')]){_0xbc3356[_0x2979('0x4c')]=[{'all':!![]}];}if(_0x22079e[_0x2979('0x4a')]['userSetting']===_0x2979('0x4d')){_0xbc3356[_0x2979('0x4c')]=[{'model':db['UserSetting'],'as':_0x2979('0x4e')}];}if(!_['includes'](_0xbc3356[_0x2979('0x4f')],'id')){_0xbc3356[_0x2979('0x4f')][_0x2979('0x50')]('id');}return db['User'][_0x2979('0x51')](_0xbc3356);})['then'](function(_0x1830f1){_0x143e95['rows']=_0x1830f1;if(_0x22079e[_0x2979('0x4a')][_0x2979('0x52')]===_0x2979('0x4d')){var _0x3211bf=[];for(var _0x1ef0d9=0x0;_0x1ef0d9<_0x143e95[_0x2979('0x53')]['length'];_0x1ef0d9++){_0x3211bf[_0x2979('0x50')](get_open_tabs(_0x2979('0x54'),_0x143e95[_0x2979('0x53')][_0x1ef0d9][_0x2979('0x55')]));_0x3211bf[_0x2979('0x50')](get_open_tabs(_0x2979('0x56'),_0x143e95[_0x2979('0x53')][_0x1ef0d9][_0x2979('0x55')]));_0x3211bf[_0x2979('0x50')](get_open_tabs(_0x2979('0x57'),_0x143e95['rows'][_0x1ef0d9][_0x2979('0x55')]));_0x3211bf[_0x2979('0x50')](get_open_tabs(_0x2979('0x58'),_0x143e95[_0x2979('0x53')][_0x1ef0d9]['dataValues']));_0x3211bf[_0x2979('0x50')](get_open_tabs(_0x2979('0x59'),_0x143e95[_0x2979('0x53')][_0x1ef0d9][_0x2979('0x55')]));_0x3211bf[_0x2979('0x50')](get_open_tabs(_0x2979('0x5a'),_0x143e95[_0x2979('0x53')][_0x1ef0d9][_0x2979('0x55')]));}return Promise[_0x2979('0x5b')](_0x3211bf)[_0x2979('0x1f')](function(){return _0x143e95;});}else{return _0x143e95;}})[_0x2979('0x1f')](respondWithFilteredResult(_0x1dc3e8,_0xbc3356))['catch'](handleError(_0x1dc3e8,null));};exports[_0x2979('0x5c')]=function(_0xa4feb5,_0x51ddd4){var _0x34d886=getUserAttributes();_0xa4feb5[_0x2979('0x4a')]['id']=_0xa4feb5[_0x2979('0x5d')]['id'];var _0x153a78=qs[_0x2979('0x47')](_0x34d886,_0xa4feb5);if(_0xa4feb5[_0x2979('0x4a')][_0x2979('0x4b')]){_0x153a78[_0x2979('0x4c')]=[{'all':!![]}];}if(_0xa4feb5[_0x2979('0x4a')][_0x2979('0x4e')]===_0x2979('0x4d')){_0x153a78['include']=[{'model':db['UserSetting'],'as':_0x2979('0x4e')}];}_0x153a78=_[_0x2979('0x5e')]({},_0x153a78,_0xa4feb5[_0x2979('0x5f')]);if(!_[_0x2979('0x60')](_0x153a78['attributes'],'id')){_0x153a78[_0x2979('0x4f')][_0x2979('0x50')]('id');}return db[_0x2979('0x49')][_0x2979('0x39')](_0x153a78)[_0x2979('0x1f')](handleEntityNotFound(_0x51ddd4,null))[_0x2979('0x1f')](function(_0x228f64){var _0x3c1e6c=[];values=_0x228f64;if(_0xa4feb5['query']['openTabs']==='true'){_0x3c1e6c[_0x2979('0x50')](get_open_tabs('chat',_0x228f64[_0x2979('0x55')]));_0x3c1e6c[_0x2979('0x50')](get_open_tabs(_0x2979('0x56'),_0x228f64[_0x2979('0x55')]));_0x3c1e6c[_0x2979('0x50')](get_open_tabs(_0x2979('0x59'),_0x228f64[_0x2979('0x55')]));_0x3c1e6c['push'](get_open_tabs(_0x2979('0x5a'),_0x228f64[_0x2979('0x55')]));_0x3c1e6c[_0x2979('0x50')](get_open_tabs(_0x2979('0x57'),_0x228f64[_0x2979('0x55')]));_0x3c1e6c[_0x2979('0x50')](get_open_tabs(_0x2979('0x58'),_0x228f64['dataValues']));return Promise[_0x2979('0x5b')](_0x3c1e6c);}else{return values;}})['then'](function(){return values;})[_0x2979('0x1f')](respondWithResult(_0x51ddd4,null))[_0x2979('0x29')](handleError(_0x51ddd4,null));};exports[_0x2979('0x2a')]=function(_0x32e040,_0x361cf1){if(_0x32e040['body']['id']){delete _0x32e040[_0x2979('0x61')]['id'];}delete _0x32e040['body'][_0x2979('0x2b')];return db[_0x2979('0x49')][_0x2979('0x39')]({'where':{'id':_0x32e040['params']['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x361cf1,null))['then'](saveUpdates(_0x32e040[_0x2979('0x61')],null))[_0x2979('0x1f')](respondWithResult(_0x361cf1,null))[_0x2979('0x29')](handleError(_0x361cf1,null));};exports[_0x2979('0x62')]=function(_0x2ed327,_0x456a7e){return db[_0x2979('0x49')][_0x2979('0x62')]()[_0x2979('0x1f')](respondWithResult(_0x456a7e,null))[_0x2979('0x29')](handleError(_0x456a7e,null));};exports[_0x2979('0x63')]=function(_0x367d14,_0xcd7e37){return db[_0x2979('0x49')]['find']({'where':{'id':_0x367d14[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0xcd7e37,null))[_0x2979('0x1f')](function(_0x12c6de){if(_0x12c6de){return _0x12c6de[_0x2979('0x63')](_0x367d14[_0x2979('0x61')][_0x2979('0x64')],_[_0x2979('0x65')](_0x367d14[_0x2979('0x61')],[_0x2979('0x64'),'id'])||{});}})['then'](respondWithResult(_0xcd7e37,null))[_0x2979('0x29')](handleError(_0xcd7e37,null));};function validateUser(_0x3a40b3){return new Promise(function(_0x496f9e,_0x1c265b){if(_0x3a40b3['internal'])return _0x496f9e(_0x3a40b3);return db[_0x2979('0x66')][_0x2979('0x67')](0x1)[_0x2979('0x1f')](function(_0x10a14e){if(_0x10a14e['securePassword'])authService['validatePasswordPattern'](_0x3a40b3['password']);db[_0x2979('0x49')][_0x2979('0x68')](_0x2979('0x69'))[_0x2979('0x1f')](function(_0x45b132){if(_[_0x2979('0x6a')](_0x45b132)){_0x3a40b3[_0x2979('0x69')]=_0x10a14e[_0x2979('0x6b')]||0x1;return;}if(_[_0x2979('0x6a')](_0x10a14e[_0x2979('0x6b')])||_0x10a14e['min_internal']===_0x45b132){_0x3a40b3['internal']=_0x45b132+0x1;return;}if(_0x10a14e[_0x2979('0x6b')]>_0x45b132){_0x3a40b3[_0x2979('0x69')]=_0x10a14e['min_internal'];return;}return db['sequelize'][_0x2979('0x4a')](_0x2979('0x6c'),{'type':db[_0x2979('0x6d')][_0x2979('0x6e')]['SELECT']})[_0x2979('0x1f')](function(_0x2d1e44){if(_0x2d1e44&&_0x2d1e44[_0x2979('0x6f')]){for(var _0x52c24a=0x0,_0x10e68d=_0x2d1e44[_0x2979('0x6f')];_0x52c24a<_0x10e68d&&_[_0x2979('0x6a')](_0x3a40b3[_0x2979('0x69')]);_0x52c24a++){if(_0x10a14e[_0x2979('0x6b')]<=_0x2d1e44[_0x52c24a][_0x2979('0x70')]){_0x3a40b3[_0x2979('0x69')]=_0x2d1e44[_0x52c24a][_0x2979('0x70')];}else if(_0x10a14e[_0x2979('0x6b')]>_0x2d1e44[_0x52c24a][_0x2979('0x70')]&&_0x10a14e[_0x2979('0x6b')]<=_0x2d1e44[_0x52c24a]['to']){_0x3a40b3[_0x2979('0x69')]=_0x10a14e['min_internal'];}}}if(_[_0x2979('0x6a')](_0x3a40b3[_0x2979('0x69')])){_0x3a40b3['internal']=_0x45b132+0x1;}return _0x496f9e(_0x3a40b3);});});})[_0x2979('0x29')](function(_0x221d74){_0x1c265b(_0x221d74);});});}function updateUser(_0x8e98a4){return new Promise(function(_0x34e590,_0x1b7d5d){try{if(_0x8e98a4[_0x2979('0x71')]){_0x8e98a4['mailbox']=_0x8e98a4[_0x2979('0x69')];_0x8e98a4[_0x2979('0x72')]={'mailbox':_0x8e98a4[_0x2979('0x69')],'password':_0x8e98a4['password'],'fullname':_0x8e98a4[_0x2979('0x73')],'email':_0x8e98a4[_0x2979('0x74')]};}if(_0x8e98a4[_0x2979('0x2b')]===_0x2979('0x2c')){if(!_0x8e98a4['permissions'])_0x8e98a4[_0x2979('0x75')]=[_0x2979('0x76'),_0x2979('0x77'),_0x2979('0x78'),_0x2979('0x79'),_0x2979('0x7a'),_0x2979('0x7b'),_0x2979('0x7c'),'106',_0x2979('0x7d'),_0x2979('0x7e'),_0x2979('0x7f'),_0x2979('0x80'),_0x2979('0x81'),_0x2979('0x82'),_0x2979('0x83')];}_0x34e590(_0x8e98a4);}catch(_0x45d58e){_0x1b7d5d(_0x45d58e);}});}exports[_0x2979('0x84')]=function(_0x1213e0,_0x36a8a1){if(_0x1213e0[_0x2979('0x32')][_0x2979('0x2b')]===_0x2979('0x2c'))throw new Error(_0x2979('0x85'));if(_0x1213e0['body'][_0x2979('0x2b')]===_0x2979('0x32')&&_0x1213e0['user'][_0x2979('0x2b')]!==_0x2979('0x30')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x1213e0[_0x2979('0x61')][_0x2979('0x2b')]===_0x2979('0x30')&&_0x1213e0[_0x2979('0x32')][_0x2979('0x2b')]!==_0x2979('0x30')){throw new Error(_0x2979('0x86'));}return licenseUtil['checkUserLimits']([_0x1213e0[_0x2979('0x61')]])['then'](function(){return validateUser(_0x1213e0[_0x2979('0x61')]);})[_0x2979('0x1f')](function(_0x11728b){return updateUser(_0x11728b)[_0x2979('0x1f')](function(_0x39caf5){if(_0x39caf5[_0x2979('0x2b')]===_0x2979('0x30')){_0x39caf5['settingsEnabled']=_0x1213e0[_0x2979('0x32')][_0x2979('0x87')];delete _0x39caf5['userProfileId'];}return _0x39caf5;});})[_0x2979('0x1f')](function(_0x328dde){return db[_0x2979('0x49')][_0x2979('0x84')](_0x328dde,{'include':[{'model':db[_0x2979('0x72')],'as':'VoiceMail'}]});})[_0x2979('0x1f')](function(_0xff889e){if(_0x1213e0[_0x2979('0x61')]['role']===_0x2979('0x32'))return _0xff889e;if(_0x1213e0[_0x2979('0x32')]['role']!==_0x2979('0x32'))return _0xff889e;return db[_0x2979('0x88')][_0x2979('0x39')]({'where':{'name':_0xff889e['role']===_0x2979('0x2c')?'Agents':_0x2979('0x34'),'userProfileId':_0x1213e0[_0x2979('0x32')][_0x2979('0x89')]},'raw':!![]})[_0x2979('0x1f')](function(_0x5ca15a){if(!_0x5ca15a||_0x5ca15a[_0x2979('0x8a')]!=0x0)return _0xff889e;return db[_0x2979('0x3a')][_0x2979('0x84')]({'name':_0xff889e['name'],'resourceId':_0xff889e['id'],'type':_0x5ca15a[_0x2979('0x3e')],'sectionId':_0x5ca15a['id']},{})['then'](function(){return _0xff889e;});})[_0x2979('0x29')](function(_0x47b877){logger[_0x2979('0x25')](_0x2979('0x8b'),_0x47b877);throw _0x47b877;});})[_0x2979('0x1f')](respondWithResult(_0x36a8a1,0xc9))[_0x2979('0x29')](handleError(_0x36a8a1,null));};exports[_0x2979('0x8c')]=function(_0x192ae6,_0x55472c){var _0x8d8e1d=_0x192ae6['body'];var _0x320178=[];if(_0x192ae6[_0x2979('0x32')][_0x2979('0x2b')]==='agent')throw new Error('Unauthorized');if(_[_0x2979('0x8d')](_0x8d8e1d,[_0x2979('0x2b'),_0x2979('0x32')])&&_0x192ae6[_0x2979('0x32')]['role']!==_0x2979('0x30')){throw new Error(_0x2979('0x8e'));}if(_[_0x2979('0x8d')](_0x8d8e1d,[_0x2979('0x2b'),_0x2979('0x30')])&&_0x192ae6[_0x2979('0x32')][_0x2979('0x2b')]!==_0x2979('0x30')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x8d8e1d)['then'](function(){return validateUser(_0x8d8e1d[0x0]);})['then'](function(){for(var _0x12cb45=0x1;_0x12cb45<_0x8d8e1d[_0x2979('0x6f')];_0x12cb45++){var _0x46827f=_0x8d8e1d[_0x12cb45-0x1][_0x2979('0x69')];if(!_0x8d8e1d[_0x12cb45][_0x2979('0x69')])_0x8d8e1d[_0x12cb45][_0x2979('0x69')]=_0x46827f+0x1;_0x320178[_0x2979('0x50')](validateUser(_0x8d8e1d[_0x12cb45]));}return Promise[_0x2979('0x5b')](_0x320178);})[_0x2979('0x1f')](function(){_0x320178=[];for(var _0x44b0c9=0x0;_0x44b0c9<_0x8d8e1d[_0x2979('0x6f')];_0x44b0c9++){_0x320178[_0x2979('0x50')](updateUser(_0x8d8e1d[_0x44b0c9]));}return Promise[_0x2979('0x5b')](_0x320178);})['then'](function(){_0x320178=_0x8d8e1d['map'](function(_0x4ace16){return db[_0x2979('0x49')]['create'](_0x4ace16,{'include':[{'model':db[_0x2979('0x72')],'as':_0x2979('0x72')}]})['then'](function(_0x1e7e3d){_0x4ace16['id']=_0x1e7e3d['id'];return _0x4ace16;});});return Promise['all'](_0x320178);})[_0x2979('0x1f')](function(_0x186797){if(_0x192ae6[_0x2979('0x61')][_0x2979('0x2b')]===_0x2979('0x32'))return _0x186797;if(_0x192ae6[_0x2979('0x32')]['role']!=='user')return _0x186797;var _0x217ab1=_['some'](_0x186797,function(_0x4d76f5){return _0x4d76f5[_0x2979('0x2b')]==='agent'||_0x4d76f5[_0x2979('0x2b')]===_0x2979('0x8f');});if(!_0x217ab1)return _0x186797;return db[_0x2979('0x88')][_0x2979('0x51')]({'where':{'name':{'$or':[_0x2979('0x33'),_0x2979('0x34')]},'userProfileId':_0x192ae6[_0x2979('0x32')][_0x2979('0x89')]},'raw':!![]})[_0x2979('0x1f')](function(_0x2f424d){if(_[_0x2979('0x90')](_0x2f424d)||!_[_0x2979('0x8d')](_0x2f424d,[_0x2979('0x8a'),0x0]))return _0x186797;_0x320178=[];var _0x245f11=_(_0x2f424d)[_0x2979('0x37')](function(_0x15e477){if(_0x15e477[_0x2979('0x8a')]===0x1)return;return _0x15e477[_0x2979('0x3e')]===_0x2979('0x33')?_0x2979('0x2c'):_0x2979('0x8f');})['compact']()['value']();for(var _0x328f3e=0x0;_0x328f3e<_0x186797['length'];_0x328f3e++){if(!_['includes'](_0x245f11,_0x186797[_0x328f3e][_0x2979('0x2b')]))return;var _0x21069f=_0x186797[_0x328f3e][_0x2979('0x2b')]===_0x2979('0x2c')?_0x2979('0x33'):_0x2979('0x34');_0x320178['push'](db['UserProfileResource'][_0x2979('0x84')]({'name':_0x186797[_0x328f3e][_0x2979('0x3e')],'resourceId':_0x186797[_0x328f3e]['id'],'type':_0x21069f,'sectionId':_[_0x2979('0x39')](_0x2f424d,['name',_0x21069f])['id']},{}));}return Promise['all'](_0x320178);});})['then'](respondWithResult(_0x55472c,0xc9))['catch'](handleError(_0x55472c,null));};exports['changePassword']=function(_0x288a08,_0x5ee17b){if(_0x288a08[_0x2979('0x61')]['id']){delete _0x288a08[_0x2979('0x61')]['id'];}return db[_0x2979('0x49')][_0x2979('0x39')]({'where':{'id':_0x288a08['params']['id']}})[_0x2979('0x1f')](function(_0x13bcc4){if(!_0x13bcc4)return null;if(_0x13bcc4['id']===_0x288a08[_0x2979('0x32')]['id']){if(!_0x288a08[_0x2979('0x61')][_0x2979('0x91')]||!_0x288a08['body']['newPassword']){throw new db[(_0x2979('0x92'))]['ValidationError'](_0x2979('0x93'));}if(!_0x13bcc4[_0x2979('0x94')](_0x288a08[_0x2979('0x61')]['oldPassword'])){throw new db[(_0x2979('0x92'))][(_0x2979('0x95'))](_0x2979('0x96'));}if(_0x288a08['body'][_0x2979('0x91')]===_0x288a08[_0x2979('0x61')][_0x2979('0x97')]){throw new db[(_0x2979('0x92'))][(_0x2979('0x95'))](_0x2979('0x98'));}}else if(_0x288a08[_0x2979('0x32')][_0x2979('0x2b')]===_0x2979('0x30')){if(!_0x288a08['body']['newPassword']){throw new db[(_0x2979('0x92'))][(_0x2979('0x95'))](_0x2979('0x99'));}}else if(_0x288a08['user'][_0x2979('0x2b')]===_0x2979('0x32')){if(!_0x288a08[_0x2979('0x61')][_0x2979('0x97')]){throw new db['Sequelize'][(_0x2979('0x95'))](_0x2979('0x99'));}if(_0x13bcc4[_0x2979('0x2b')]!==_0x2979('0x2c')){throw new db[(_0x2979('0x92'))]['ValidationError'](_0x2979('0x85'));}}else{throw new db['Sequelize'][(_0x2979('0x95'))]('Unauthorized');}return _0x13bcc4;})['then'](handleEntityNotFound(_0x5ee17b,null))[_0x2979('0x1f')](function(_0x245b01){return db[_0x2979('0x66')]['findOne']({'attributes':['id',_0x2979('0x9a'),'enforcePasswordHistory',_0x2979('0x9b')]})[_0x2979('0x1f')](function(_0xc76d53){if(_0xc76d53[_0x2979('0x9a')])authService['validatePasswordPattern'](_0x288a08['body'][_0x2979('0x97')]);if(!_0xc76d53[_0x2979('0x9c')]||!_0x245b01[_0x2979('0x43')])return _0x245b01;authService['validatePasswordHistory'](_0x288a08[_0x2979('0x61')][_0x2979('0x97')],_0x245b01[_0x2979('0x43')],_0xc76d53[_0x2979('0x9b')]);return _0x245b01;})['then'](saveUpdates({'password':_0x288a08[_0x2979('0x61')][_0x2979('0x97')],'passwordResetAt':_0x288a08['user']['id']==_0x288a08[_0x2979('0x5d')]['id']?moment():null,'previousPasswords':authService[_0x2979('0x9d')](_0x288a08['body'][_0x2979('0x97')],_0x245b01[_0x2979('0x43')])},null));})['then'](respondWithResult(_0x5ee17b,null))['catch'](handleError(_0x5ee17b,null));};exports[_0x2979('0x9e')]=function(_0xd88fff,_0x5a95b0){var _0xe40ec4=_0xd88fff[_0x2979('0x61')]['channel'];return db[_0x2979('0x49')]['find']({'where':{'id':_0xd88fff[_0x2979('0x5d')]['id']},'attributes':['id',_0x2979('0x3e'),_0x2979('0x2b'),_0x2979('0x9f'),'loginInPause',_0x2979('0xa0'),_0x2979('0xa1')]})[_0x2979('0x1f')](handleEntityNotFound(_0x5a95b0,null))[_0x2979('0x1f')](function(_0x3ac880){if(_0x3ac880){if(!utils[_0x2979('0xa2')](_0xe40ec4)){throw new db[(_0x2979('0x92'))][(_0x2979('0x95'))](_0x2979('0xa3'));}return _0x3ac880['add'+_[_0x2979('0xa4')](_0xe40ec4[_0x2979('0xa5')]())+'Queues'](_0xd88fff['body'][_0x2979('0x64')],{'penalty':_0xd88fff['body'][_0x2979('0xa6')]||0x0})['spread'](function(_0x498bfe){for(var _0x57a8a9=0x0;_0x57a8a9<_0xd88fff[_0x2979('0x61')][_0x2979('0x64')][_0x2979('0x6f')];_0x57a8a9+=0x1){var _0x4b6c3d={'UserId':Number(_0xd88fff[_0x2979('0x5d')]['id'])};_0x4b6c3d[_[_0x2979('0xa4')](_0xe40ec4[_0x2979('0xa5')]())+_0x2979('0xa7')]=Number(_0xd88fff[_0x2979('0x61')][_0x2979('0x64')][_0x57a8a9]);socket[_0x2979('0x2d')](_0x2979('0x32')+_[_0x2979('0xa4')](_0xe40ec4[_0x2979('0xa5')]())+_0x2979('0xa8'),_0x4b6c3d);}return _0x498bfe;})[_0x2979('0x1f')](function(){if(_0xe40ec4===_0x2979('0xa9')){return db['VoiceQueue'][_0x2979('0x51')]({'where':{'id':_0xd88fff[_0x2979('0x61')][_0x2979('0x64')]||[]},'raw':!![],'attributes':['id',_0x2979('0x3e')]});}})[_0x2979('0x1f')](function(_0xe0c4b){var _0x339fdf=_0x3ac880[_0x2979('0x2f')]({'plain':!![]});var _0x5e6841=[];if(_0xe40ec4===_0x2979('0xa9')&&_0x339fdf[_0x2979('0x2b')]==='agent'&&_0x339fdf['online']){for(let _0x81716b=0x0;_0x81716b<_0xe0c4b[_0x2979('0x6f')];_0x81716b+=0x1){_0x5e6841[_0x2979('0x50')]({'membername':_0x339fdf[_0x2979('0x3e')],'UserId':_0x339fdf['id'],'queue_name':_0xe0c4b[_0x81716b]['name'],'VoiceQueueId':_0xe0c4b[_0x81716b]['id'],'interface':_['isNil'](_0x339fdf['interface'])?util['format'](_0x2979('0xaa'),_0x339fdf[_0x2979('0x3e')]):_0x339fdf[_0x2979('0xa1')],'paused':_0x339fdf['voicePause']||![],'penalty':_0xd88fff[_0x2979('0x61')][_0x2979('0xa6')]||0x0});}return Promise[_0x2979('0x5b')](_0x5e6841[_0x2979('0x37')](function(_0x5c12c9){return db[_0x2979('0xab')][_0x2979('0xac')](_0x5c12c9);}));}return _0x3ac880;});}})[_0x2979('0x1f')](respondWithStatusCode(_0x5a95b0,null))[_0x2979('0x29')](handleError(_0x5a95b0,null));};exports['removeQueues']=function(_0xe3bdfd,_0x1cf398){var _0x5bb772,_0x21cfe2;return db[_0x2979('0x49')][_0x2979('0x39')]({'where':{'id':_0xe3bdfd[_0x2979('0x5d')]['id']},'attributes':['id',_0x2979('0x3e'),_0x2979('0x2b')]})['then'](handleEntityNotFound(_0x1cf398,null))[_0x2979('0x1f')](function(_0x12f035){if(_0x12f035){_0x5bb772=_0x12f035;if(!_0xe3bdfd[_0x2979('0x4a')][_0x2979('0xad')]||!utils[_0x2979('0xa2')](_0xe3bdfd[_0x2979('0x4a')][_0x2979('0xad')])){throw new db[(_0x2979('0x92'))][(_0x2979('0x95'))](_0x2979('0xa3'));}return _0x12f035['remove'+_[_0x2979('0xa4')](_0xe3bdfd[_0x2979('0x4a')][_0x2979('0xad')][_0x2979('0xa5')]())+_0x2979('0xae')](_0xe3bdfd[_0x2979('0x4a')][_0x2979('0x64')]);}})['then'](function(_0xa82729){if(_['isArray'](_0xe3bdfd['query'][_0x2979('0x64')])){for(var _0x5231a5=0x0;_0x5231a5<_0xe3bdfd[_0x2979('0x4a')][_0x2979('0x64')]['length'];_0x5231a5+=0x1){_0x21cfe2={'UserId':Number(_0xe3bdfd['params']['id'])};_0x21cfe2[_[_0x2979('0xa4')](_0xe3bdfd[_0x2979('0x4a')]['channel'][_0x2979('0xa5')]())+_0x2979('0xa7')]=Number(_0xe3bdfd[_0x2979('0x4a')][_0x2979('0x64')][_0x5231a5]);socket[_0x2979('0x2d')]('user'+_['capitalize'](_0xe3bdfd[_0x2979('0x4a')]['channel'][_0x2979('0xa5')]())+_0x2979('0xaf'),_0x21cfe2);}}else{_0x21cfe2={'UserId':Number(_0xe3bdfd[_0x2979('0x5d')]['id'])};_0x21cfe2[_['capitalize'](_0xe3bdfd['query'][_0x2979('0xad')][_0x2979('0xa5')]())+_0x2979('0xa7')]=Number(_0xe3bdfd[_0x2979('0x4a')][_0x2979('0x64')]);socket[_0x2979('0x2d')](_0x2979('0x32')+_[_0x2979('0xa4')](_0xe3bdfd['query'][_0x2979('0xad')][_0x2979('0xa5')]())+'Queue:remove',_0x21cfe2);}return _0xa82729;})[_0x2979('0x1f')](function(){if(_0xe3bdfd[_0x2979('0x4a')][_0x2979('0xad')]===_0x2979('0xa9')){return db[_0x2979('0xab')]['destroy']({'where':{'UserId':_0xe3bdfd[_0x2979('0x5d')]['id'],'VoiceQueueId':_0xe3bdfd[_0x2979('0x4a')]['ids']},'individualHooks':!![]})[_0x2979('0x1f')](function(){return _0x5bb772;});}return _0x5bb772;})[_0x2979('0x1f')](respondWithStatusCode(_0x1cf398,null))[_0x2979('0x29')](handleError(_0x1cf398,null));};exports[_0x2979('0xb0')]=function(_0x3d607a,_0x11f2c9){_0x3d607a['body']['userpic']=_0x3d607a[_0x2979('0xb1')][_0x2979('0xb2')];return db[_0x2979('0x49')][_0x2979('0x39')]({'where':{'id':_0x3d607a['params']['id']}})['then'](handleEntityNotFound(_0x11f2c9,null))[_0x2979('0x1f')](saveUpdates(_0x3d607a['body'],null))[_0x2979('0x1f')](respondWithResult(_0x11f2c9,null))['catch'](handleError(_0x11f2c9,null));};exports['getAvatar']=function(_0x1fb530,_0x6cefb8){var _0x2c1bdf=path[_0x2979('0xb3')](config[_0x2979('0xb4')],_0x2979('0xb5'));return db['User'][_0x2979('0x39')]({'where':{'id':_0x1fb530[_0x2979('0x5d')]['id']},'attributes':['id',_0x2979('0xb6')],'raw':!![]})['then'](handleEntityNotFound(_0x6cefb8,null))[_0x2979('0x1f')](function(_0x5cd981){if(_0x5cd981){if(_['isNil'](_0x5cd981[_0x2979('0xb6')])){return _0x6cefb8['download'](_0x2c1bdf);}else{if(!fs[_0x2979('0xb7')](path[_0x2979('0xb3')](config[_0x2979('0xb4')],'server/files/images/',_0x5cd981[_0x2979('0xb6')]))){return _0x6cefb8[_0x2979('0xb8')](_0x2c1bdf);}return _0x6cefb8[_0x2979('0xb8')](path[_0x2979('0xb3')](config[_0x2979('0xb4')],_0x2979('0xb9'),_0x5cd981[_0x2979('0xb6')]));}}})[_0x2979('0x29')](handleError(_0x6cefb8,null));};exports[_0x2979('0xba')]=function(_0x43c609,_0xe9a8c){return db[_0x2979('0x49')]['find']({'where':{'id':_0x43c609[_0x2979('0x5d')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0xe9a8c,null))['then'](function(_0x2e231b){var _0x3b88bd=[];values=_0x2e231b[_0x2979('0x55')];_0x3b88bd[_0x2979('0x50')](get_open_tabs(_0x2979('0x54'),_0x2e231b[_0x2979('0x55')]));_0x3b88bd['push'](get_open_tabs(_0x2979('0x56'),_0x2e231b[_0x2979('0x55')]));_0x3b88bd[_0x2979('0x50')](get_open_tabs(_0x2979('0x59'),_0x2e231b[_0x2979('0x55')]));_0x3b88bd[_0x2979('0x50')](get_open_tabs(_0x2979('0x5a'),_0x2e231b['dataValues']));_0x3b88bd[_0x2979('0x50')](get_open_tabs(_0x2979('0x57'),_0x2e231b['dataValues']));_0x3b88bd[_0x2979('0x50')](get_open_tabs(_0x2979('0x58'),_0x2e231b[_0x2979('0x55')]));return Promise['all'](_0x3b88bd);})[_0x2979('0x1f')](function(_0x426efd){if(_0x426efd){var _0x2b134d=_[_0x2979('0x37')](values['ChatOpenTabs'],function(_0x45f8c7){return{'channel':_0x2979('0xbb'),'id':_0x45f8c7['id'],'createdAt':_0x45f8c7[_0x2979('0xbc')]};});var _0x34219d=_[_0x2979('0x37')](values[_0x2979('0xbd')],function(_0x18c4d4){return{'channel':'FAX','id':_0x18c4d4['id'],'createdAt':_0x18c4d4[_0x2979('0xbc')]};});var _0x30a65f=_['map'](values[_0x2979('0xbe')],function(_0x5e50f5){return{'channel':_0x2979('0xbf'),'id':_0x5e50f5['id'],'createdAt':_0x5e50f5['createdAt']};});var _0x83f4eb=_[_0x2979('0x37')](values[_0x2979('0xc0')],function(_0x28d665){return{'channel':_0x2979('0xc1'),'id':_0x28d665['id'],'createdAt':_0x28d665[_0x2979('0xbc')]};});var _0x4a44b6=_['map'](values[_0x2979('0xc2')],function(_0x4307bc){return{'channel':'SMS','id':_0x4307bc['id'],'createdAt':_0x4307bc[_0x2979('0xbc')]};});var _0x4aa127=_['map'](values[_0x2979('0xc3')],function(_0x48aff6){return{'channel':_0x2979('0xc4'),'id':_0x48aff6['id'],'createdAt':_0x48aff6[_0x2979('0xbc')]};});var _0x289e80=_['concat'](_0x2b134d,_0x34219d,_0x30a65f,_0x83f4eb,_0x4a44b6,_0x4aa127);var _0x2cc657={'count':_0x289e80[_0x2979('0x6f')],'rows':_0x289e80};return _0x2cc657;}else return null;})[_0x2979('0x1f')](respondWithResult(_0xe9a8c,null))['catch'](handleError(_0xe9a8c,null));};exports[_0x2979('0xc5')]=function(_0xdbd888,_0x69768b){var _0x30e273={};return db[_0x2979('0x49')]['findOne']({'where':{'id':_0xdbd888[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](function(_0x48109e){if(!_0x48109e){throw new APINotFoundError(util[_0x2979('0xc6')](_0x2979('0xc7'),_0xdbd888['params']['id']));}return contacts[_0x2979('0x62')]();})[_0x2979('0x1f')](function(_0x1f39e7){_0xdbd888[_0x2979('0x4a')][_0x2979('0x49')]=_0xdbd888[_0x2979('0x5d')]['id'];_0x30e273=qs[_0x2979('0x47')](_0x1f39e7,_0xdbd888);if(_0xdbd888['query'][_0x2979('0xc8')]('includeAll')){_0x30e273[_0x2979('0x4c')]=[{'model':db[_0x2979('0xc9')],'as':_0x2979('0xca'),'required':![]},{'model':db[_0x2979('0xcb')],'as':_0x2979('0xcc'),'attributes':['id',_0x2979('0x3e'),_0x2979('0xcd')],'where':_0xdbd888[_0x2979('0x4a')][_0x2979('0xce')]?{'id':_0xdbd888['query'][_0x2979('0xce')]}:undefined,'required':_0xdbd888[_0x2979('0x4a')][_0x2979('0xce')]?!![]:![]}];}return contacts['findAll'](_0xdbd888[_0x2979('0x4a')],_0xdbd888['user'],_0x30e273,_0x1f39e7);})['then'](respondWithFilteredResult(_0x69768b,_0x30e273))[_0x2979('0x29')](APIHandleError(_0x69768b));};exports[_0x2979('0xcf')]=function(_0x4ec634,_0x5933ec){var _0x36c68a;var _0x892429={};var _0x47184a;return db[_0x2979('0x49')]['findOne']({'where':{'id':_0x4ec634['params']['id']},'attributes':['id',_0x2979('0x3e'),_0x2979('0x2b')]})[_0x2979('0x1f')](handleEntityNotFound(_0x5933ec,null))['then'](function(_0x364b0c){if(!utils[_0x2979('0xa2')](_0x4ec634[_0x2979('0x4a')][_0x2979('0xad')])){throw new db[(_0x2979('0x92'))]['ValidationError'](_0x2979('0xa3'));}_0x36c68a=_0x364b0c;var _0x53b6b3={};_0x53b6b3[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_[_0x2979('0xa4')](_0x4ec634[_0x2979('0x4a')][_0x2979('0xad')])+_0x2979('0xd2')][_0x2979('0x3f')]);_0x53b6b3[_0x2979('0x4a')]=_[_0x2979('0xd1')](_0x4ec634['query']);_0x53b6b3[_0x2979('0xd3')]=_[_0x2979('0xd4')](_0x53b6b3[_0x2979('0xd0')],_0x53b6b3[_0x2979('0x4a')]);_0x892429[_0x2979('0x4f')]=_['intersection'](_0x53b6b3['model'],qs[_0x2979('0xd5')](_0x4ec634['query']['fields']));_0x892429['attributes']=_0x892429[_0x2979('0x4f')][_0x2979('0x6f')]?_0x892429['attributes']:_0x53b6b3[_0x2979('0xd0')];_0x892429[_0x2979('0xd6')]=qs[_0x2979('0xd7')](_0x4ec634[_0x2979('0x4a')][_0x2979('0xd7')]);_0x892429['where']=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x4ec634[_0x2979('0x4a')],_0x53b6b3[_0x2979('0xd3')]));if(_0x4ec634[_0x2979('0x4a')]['filter']){_0x892429[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x892429['where'],{'$or':_[_0x2979('0x37')](_0x892429['attributes'],function(_0x2a67c1){var _0xdcdca8={};_0xdcdca8[_0x2a67c1]={'$like':'%'+_0x4ec634['query'][_0x2979('0x35')]+'%'};return _0xdcdca8;})});}_0x892429=_[_0x2979('0x5e')]({},_0x892429,_0x4ec634[_0x2979('0x5f')]);switch(_0x36c68a[_0x2979('0x2b')]){case _0x2979('0x30'):return db[_[_0x2979('0xa4')](_0x4ec634[_0x2979('0x4a')][_0x2979('0xad')])+_0x2979('0xd2')][_0x2979('0x51')](_0x892429);case _0x2979('0x32'):case _0x2979('0x2c'):return _0x36c68a[_0x2979('0x2f')+_[_0x2979('0xa4')](_0x4ec634[_0x2979('0x4a')][_0x2979('0xad')])+'Queues'](_0x892429);default:throw new db[(_0x2979('0x92'))][(_0x2979('0x95'))]('Unknown\x20role');}})['then'](function(_0x8b438a){_0x47184a=_0x8b438a[_0x2979('0x6f')];if(!_0x4ec634['query'][_0x2979('0xc8')](_0x2979('0xd9'))){_0x892429[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x4ec634['query'][_0x2979('0x18')]);_0x892429[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x4ec634[_0x2979('0x4a')][_0x2979('0x17')]);}switch(_0x36c68a['role']){case'admin':return db[_['capitalize'](_0x4ec634['query']['channel'])+_0x2979('0xd2')][_0x2979('0x51')](_0x892429);case _0x2979('0x32'):case _0x2979('0x2c'):return _0x36c68a[_0x2979('0x2f')+_[_0x2979('0xa4')](_0x4ec634[_0x2979('0x4a')][_0x2979('0xad')])+'Queues'](_0x892429);}})[_0x2979('0x1f')](function(_0x1f2740){return{'count':_0x47184a,'rows':_0x1f2740};})[_0x2979('0x1f')](respondWithResult(_0x5933ec,null))[_0x2979('0x29')](handleError(_0x5933ec,null));};exports[_0x2979('0xda')]=function(_0x1c2d9d,_0x230eb1){var _0x1548ef={};var _0x398798={};var _0x37c5e4;var _0x57b485;return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x1c2d9d['params']['id']}})['then'](handleEntityNotFound(_0x230eb1,null))[_0x2979('0x1f')](function(_0x1fdf6a){if(_0x1fdf6a){_0x37c5e4=_0x1fdf6a;_0x398798[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0xab')]['rawAttributes']);_0x398798['query']=_['keys'](_0x1c2d9d[_0x2979('0x4a')]);_0x398798['filters']=_[_0x2979('0xd4')](_0x398798[_0x2979('0xd0')],_0x398798[_0x2979('0x4a')]);_0x1548ef['attributes']=_['intersection'](_0x398798[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x1c2d9d[_0x2979('0x4a')][_0x2979('0xd5')]));_0x1548ef[_0x2979('0x4f')]=_0x1548ef[_0x2979('0x4f')]['length']?_0x1548ef[_0x2979('0x4f')]:_0x398798[_0x2979('0xd0')];_0x1548ef[_0x2979('0xd6')]=qs['sort'](_0x1c2d9d['query']['sort']);_0x1548ef[_0x2979('0x48')]=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x1c2d9d['query'],_0x398798['filters']));if(_0x1c2d9d[_0x2979('0x4a')][_0x2979('0x35')]){_0x1548ef[_0x2979('0x48')]=_['merge'](_0x1548ef[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x1548ef[_0x2979('0x4f')],function(_0x2e243e){var _0x785d8={};_0x785d8[_0x2e243e]={'$like':'%'+_0x1c2d9d[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x785d8;})});}_0x1548ef=_[_0x2979('0x5e')]({},_0x1548ef,_0x1c2d9d['options']);return _0x37c5e4[_0x2979('0xda')](_0x1548ef);}})[_0x2979('0x1f')](function(_0x34a051){if(_0x34a051){_0x57b485=_0x34a051[_0x2979('0x6f')];if(!_0x1c2d9d['query'][_0x2979('0xc8')](_0x2979('0xd9'))){_0x1548ef[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x1c2d9d['query'][_0x2979('0x18')]);_0x1548ef['offset']=qs[_0x2979('0x17')](_0x1c2d9d[_0x2979('0x4a')][_0x2979('0x17')]);}return _0x37c5e4[_0x2979('0xda')](_0x1548ef);}})[_0x2979('0x1f')](function(_0x4fe600){if(_0x4fe600){return _0x4fe600?{'count':_0x57b485,'rows':_0x4fe600}:null;}})['then'](respondWithResult(_0x230eb1,null))['catch'](handleError(_0x230eb1,null));};exports[_0x2979('0xdc')]=function(_0x1518e1,_0x43d23c){var _0x3cc2a1={};var _0x101146={};var _0x45b0d8;var _0x279232;return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x1518e1[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x43d23c,null))[_0x2979('0x1f')](function(_0x16730e){if(_0x16730e){_0x45b0d8=_0x16730e;_0x101146[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0xdd')][_0x2979('0x3f')]);_0x101146[_0x2979('0x4a')]=_[_0x2979('0xd1')](_0x1518e1[_0x2979('0x4a')]);_0x101146[_0x2979('0xd3')]=_[_0x2979('0xd4')](_0x101146[_0x2979('0xd0')],_0x101146['query']);_0x3cc2a1[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0x101146[_0x2979('0xd0')],qs['fields'](_0x1518e1[_0x2979('0x4a')][_0x2979('0xd5')]));_0x3cc2a1[_0x2979('0x4f')]=_0x3cc2a1[_0x2979('0x4f')][_0x2979('0x6f')]?_0x3cc2a1[_0x2979('0x4f')]:_0x101146[_0x2979('0xd0')];_0x3cc2a1['order']=qs['sort'](_0x1518e1[_0x2979('0x4a')][_0x2979('0xd7')]);_0x3cc2a1['where']=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x1518e1[_0x2979('0x4a')],_0x101146[_0x2979('0xd3')]));if(_0x1518e1['query'][_0x2979('0x35')]){_0x3cc2a1[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x3cc2a1['where'],{'$or':_[_0x2979('0x37')](_0x3cc2a1['attributes'],function(_0x542725){var _0x376881={};_0x376881[_0x542725]={'$like':'%'+_0x1518e1[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x376881;})});}_0x3cc2a1=_[_0x2979('0x5e')]({},_0x3cc2a1,_0x1518e1[_0x2979('0x5f')]);return _0x45b0d8[_0x2979('0xdc')](_0x3cc2a1);}})[_0x2979('0x1f')](function(_0x10d7b7){if(_0x10d7b7){_0x279232=_0x10d7b7[_0x2979('0x6f')];if(!_0x1518e1[_0x2979('0x4a')][_0x2979('0xc8')]('nolimit')){_0x3cc2a1['limit']=qs[_0x2979('0x18')](_0x1518e1[_0x2979('0x4a')][_0x2979('0x18')]);_0x3cc2a1['offset']=qs[_0x2979('0x17')](_0x1518e1[_0x2979('0x4a')][_0x2979('0x17')]);}return _0x45b0d8[_0x2979('0xdc')](_0x3cc2a1);}})[_0x2979('0x1f')](function(_0x21e4bc){if(_0x21e4bc){return _0x21e4bc?{'count':_0x279232,'rows':_0x21e4bc}:null;}})['then'](respondWithResult(_0x43d23c,null))[_0x2979('0x29')](handleError(_0x43d23c,null));};exports['getRecordings']=function(_0x3c0b21,_0x5eb990){var _0x3b24e7={'raw':!![],'where':{}};var _0x34ddde={};var _0x4cd35b={'count':0x0,'rows':[]};return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x3c0b21['params']['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x5eb990,null))[_0x2979('0x1f')](function(_0x1d3297){if(_0x1d3297){_0x34ddde[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0xde')]['rawAttributes']);_0x34ddde[_0x2979('0x4a')]=_[_0x2979('0xd1')](_0x3c0b21['query']);_0x34ddde[_0x2979('0xd3')]=_['intersection'](_0x34ddde[_0x2979('0xd0')],_0x34ddde['query']);_0x3b24e7[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0x34ddde[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x3c0b21[_0x2979('0x4a')][_0x2979('0xd5')]));_0x3b24e7[_0x2979('0x4f')]=_0x3b24e7[_0x2979('0x4f')]['length']?_0x3b24e7[_0x2979('0x4f')]:_0x34ddde['model'];if(!_0x3c0b21['query'][_0x2979('0xc8')](_0x2979('0xd9'))){_0x3b24e7[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x3c0b21['query'][_0x2979('0x18')]);_0x3b24e7[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x3c0b21['query'][_0x2979('0x17')]);}_0x3b24e7[_0x2979('0xd6')]=qs[_0x2979('0xd7')](_0x3c0b21['query'][_0x2979('0xd7')]);_0x3b24e7['where']=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x3c0b21[_0x2979('0x4a')],_0x34ddde[_0x2979('0xd3')]));_0x3b24e7[_0x2979('0x48')][_0x2979('0xdf')]=_0x1d3297['id'];if(_0x3c0b21['query']['filter']){_0x3b24e7[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x3b24e7[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x3b24e7[_0x2979('0x4f')],function(_0x45b8dc){var _0x4da894={};_0x4da894[_0x45b8dc]={'$like':'%'+_0x3c0b21[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x4da894;})});}_0x3b24e7=_[_0x2979('0x5e')]({},_0x3b24e7,_0x3c0b21[_0x2979('0x5f')]);return db['VoiceRecording']['count']({'where':_0x3b24e7[_0x2979('0x48')]})[_0x2979('0x1f')](function(_0x453c7a){_0x4cd35b[_0x2979('0x1a')]=_0x453c7a;if(_0x3c0b21[_0x2979('0x4a')][_0x2979('0x4b')]){_0x3b24e7[_0x2979('0x4c')]=[{'all':!![]}];}return db[_0x2979('0xde')][_0x2979('0x51')](_0x3b24e7);})[_0x2979('0x1f')](function(_0x83d5b2){_0x4cd35b['rows']=_0x83d5b2;return _0x4cd35b;});}})[_0x2979('0x1f')](respondWithFilteredResult(_0x5eb990,_0x3b24e7))[_0x2979('0x29')](handleError(_0x5eb990,null));};exports[_0x2979('0xe0')]=function(_0x347d15,_0x15c2b9){var _0x34b266={'raw':!![],'where':{}};var _0xd4d061={};var _0x189eb4={'count':0x0,'rows':[]};return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x347d15[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x15c2b9,null))[_0x2979('0x1f')](function(_0x5108b7){if(_0x5108b7){_0xd4d061['model']=_[_0x2979('0xd1')](db[_0x2979('0xe1')][_0x2979('0x3f')]);_0xd4d061[_0x2979('0x4a')]=_[_0x2979('0xd1')](_0x347d15['query']);_0xd4d061[_0x2979('0xd3')]=_[_0x2979('0xd4')](_0xd4d061[_0x2979('0xd0')],_0xd4d061[_0x2979('0x4a')]);_0x34b266[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0xd4d061['model'],qs[_0x2979('0xd5')](_0x347d15[_0x2979('0x4a')]['fields']));_0x34b266[_0x2979('0x4f')]=_0x34b266[_0x2979('0x4f')][_0x2979('0x6f')]?_0x34b266[_0x2979('0x4f')]:_0xd4d061[_0x2979('0xd0')];if(!_0x347d15[_0x2979('0x4a')][_0x2979('0xc8')](_0x2979('0xd9'))){_0x34b266[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x347d15['query'][_0x2979('0x18')]);_0x34b266[_0x2979('0x17')]=qs['offset'](_0x347d15[_0x2979('0x4a')][_0x2979('0x17')]);}_0x34b266[_0x2979('0xd6')]=qs[_0x2979('0xd7')](_0x347d15[_0x2979('0x4a')]['sort']);_0x34b266[_0x2979('0x48')]=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x347d15['query'],_0xd4d061[_0x2979('0xd3')]));_0x34b266[_0x2979('0x48')]['UserId']=_0x5108b7['id'];if(_0x347d15[_0x2979('0x4a')][_0x2979('0x35')]){_0x34b266['where']=_['merge'](_0x34b266[_0x2979('0x48')],{'$or':_['map'](_0x34b266[_0x2979('0x4f')],function(_0xc2bc2f){var _0x54068d={};_0x54068d[_0xc2bc2f]={'$like':'%'+_0x347d15[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x54068d;})});}_0x34b266=_[_0x2979('0x5e')]({},_0x34b266,_0x347d15[_0x2979('0x5f')]);return db[_0x2979('0xe1')][_0x2979('0x1a')]({'where':_0x34b266[_0x2979('0x48')]})['then'](function(_0x388a54){_0x189eb4[_0x2979('0x1a')]=_0x388a54;if(_0x347d15['query']['includeAll']){_0x34b266[_0x2979('0x4c')]=[{'all':!![]}];}return db[_0x2979('0xe1')]['findAll'](_0x34b266);})[_0x2979('0x1f')](function(_0x1b6551){_0x189eb4[_0x2979('0x53')]=_0x1b6551;return _0x189eb4;});}})[_0x2979('0x1f')](respondWithFilteredResult(_0x15c2b9,_0x34b266))['catch'](handleError(_0x15c2b9,null));};exports['getChatInteractions']=function(_0x105807,_0x40310a){var _0x49fec5={};var _0x5a1d24={};var _0x14d138;var _0x27b2d8;return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x105807[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x40310a,null))[_0x2979('0x1f')](function(_0x545285){if(_0x545285){_0x14d138=_0x545285;_0x5a1d24[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0xe2')]['rawAttributes']);_0x5a1d24[_0x2979('0x4a')]=_[_0x2979('0xd1')](_0x105807[_0x2979('0x4a')]);_0x5a1d24['filters']=_[_0x2979('0xd4')](_0x5a1d24[_0x2979('0xd0')],_0x5a1d24[_0x2979('0x4a')]);_0x49fec5[_0x2979('0x4f')]=_['intersection'](_0x5a1d24[_0x2979('0xd0')],qs['fields'](_0x105807[_0x2979('0x4a')][_0x2979('0xd5')]));_0x49fec5[_0x2979('0x4f')]=_0x49fec5['attributes']['length']?_0x49fec5[_0x2979('0x4f')]:_0x5a1d24[_0x2979('0xd0')];_0x49fec5[_0x2979('0xd6')]=qs[_0x2979('0xd7')](_0x105807[_0x2979('0x4a')]['sort']);_0x49fec5[_0x2979('0x48')]=qs[_0x2979('0xd3')](_['pick'](_0x105807['query'],_0x5a1d24[_0x2979('0xd3')]));if(_0x105807[_0x2979('0x4a')][_0x2979('0x35')]){_0x49fec5[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x49fec5[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x49fec5[_0x2979('0x4f')],function(_0xf865b8){var _0xfa0165={};_0xfa0165[_0xf865b8]={'$like':'%'+_0x105807[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0xfa0165;})});}_0x49fec5=_[_0x2979('0x5e')]({},_0x49fec5,_0x105807[_0x2979('0x5f')]);return _0x14d138[_0x2979('0xe3')](_0x49fec5);}})[_0x2979('0x1f')](function(_0x592d39){if(_0x592d39){_0x27b2d8=_0x592d39[_0x2979('0x6f')];if(!_0x105807[_0x2979('0x4a')][_0x2979('0xc8')](_0x2979('0xd9'))){_0x49fec5[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x105807[_0x2979('0x4a')][_0x2979('0x18')]);_0x49fec5[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x105807[_0x2979('0x4a')][_0x2979('0x17')]);}return _0x14d138[_0x2979('0xe3')](_0x49fec5);}})['then'](function(_0x589bab){if(_0x589bab){return _0x589bab?{'count':_0x27b2d8,'rows':_0x589bab}:null;}})[_0x2979('0x1f')](respondWithResult(_0x40310a,null))[_0x2979('0x29')](handleError(_0x40310a,null));};exports['getOpenchannelInteractions']=function(_0x5557ce,_0x190572){var _0x3dce10={};var _0x201915={};var _0xf88bf7;var _0x4e2e1f;return db['User'][_0x2979('0xdb')]({'where':{'id':_0x5557ce[_0x2979('0x5d')]['id']}})['then'](handleEntityNotFound(_0x190572,null))[_0x2979('0x1f')](function(_0x393d76){if(_0x393d76){_0xf88bf7=_0x393d76;_0x201915[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0xe4')][_0x2979('0x3f')]);_0x201915['query']=_[_0x2979('0xd1')](_0x5557ce[_0x2979('0x4a')]);_0x201915['filters']=_[_0x2979('0xd4')](_0x201915[_0x2979('0xd0')],_0x201915['query']);_0x3dce10[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0x201915[_0x2979('0xd0')],qs['fields'](_0x5557ce[_0x2979('0x4a')]['fields']));_0x3dce10['attributes']=_0x3dce10[_0x2979('0x4f')][_0x2979('0x6f')]?_0x3dce10[_0x2979('0x4f')]:_0x201915[_0x2979('0xd0')];_0x3dce10[_0x2979('0xd6')]=qs['sort'](_0x5557ce[_0x2979('0x4a')][_0x2979('0xd7')]);_0x3dce10[_0x2979('0x48')]=qs['filters'](_['pick'](_0x5557ce[_0x2979('0x4a')],_0x201915['filters']));if(_0x5557ce[_0x2979('0x4a')][_0x2979('0x35')]){_0x3dce10['where']=_[_0x2979('0x5e')](_0x3dce10[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x3dce10['attributes'],function(_0x7cffc4){var _0x46d1af={};_0x46d1af[_0x7cffc4]={'$like':'%'+_0x5557ce['query']['filter']+'%'};return _0x46d1af;})});}_0x3dce10=_[_0x2979('0x5e')]({},_0x3dce10,_0x5557ce[_0x2979('0x5f')]);return _0xf88bf7[_0x2979('0xe5')](_0x3dce10);}})['then'](function(_0x20ad1d){if(_0x20ad1d){_0x4e2e1f=_0x20ad1d[_0x2979('0x6f')];if(!_0x5557ce[_0x2979('0x4a')][_0x2979('0xc8')](_0x2979('0xd9'))){_0x3dce10['limit']=qs[_0x2979('0x18')](_0x5557ce[_0x2979('0x4a')][_0x2979('0x18')]);_0x3dce10[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x5557ce[_0x2979('0x4a')]['offset']);}return _0xf88bf7[_0x2979('0xe5')](_0x3dce10);}})['then'](function(_0x1c79c5){if(_0x1c79c5){return _0x1c79c5?{'count':_0x4e2e1f,'rows':_0x1c79c5}:null;}})[_0x2979('0x1f')](respondWithResult(_0x190572,null))[_0x2979('0x29')](handleError(_0x190572,null));};exports[_0x2979('0xe6')]=function(_0x18adb0,_0x2bb342){var _0x1fd347={'raw':!![],'where':{}};var _0x54616e={};var _0x59ac01={'count':0x0,'rows':[]};return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x18adb0[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x2bb342,null))[_0x2979('0x1f')](function(_0x1c11d6){if(_0x1c11d6){_0x54616e[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0xe7')][_0x2979('0x3f')]);_0x54616e[_0x2979('0x4a')]=_['keys'](_0x18adb0[_0x2979('0x4a')]);_0x54616e['filters']=_[_0x2979('0xd4')](_0x54616e['model'],_0x54616e[_0x2979('0x4a')]);_0x1fd347[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0x54616e[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x18adb0[_0x2979('0x4a')][_0x2979('0xd5')]));_0x1fd347['attributes']=_0x1fd347[_0x2979('0x4f')][_0x2979('0x6f')]?_0x1fd347['attributes']:_0x54616e[_0x2979('0xd0')];if(!_0x18adb0[_0x2979('0x4a')]['hasOwnProperty']('nolimit')){_0x1fd347[_0x2979('0x18')]=qs['limit'](_0x18adb0[_0x2979('0x4a')][_0x2979('0x18')]);_0x1fd347[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x18adb0[_0x2979('0x4a')][_0x2979('0x17')]);}_0x1fd347[_0x2979('0xd6')]=qs[_0x2979('0xd7')](_0x18adb0['query']['sort']);_0x1fd347['where']=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x18adb0[_0x2979('0x4a')],_0x54616e['filters']));_0x1fd347[_0x2979('0x48')][_0x2979('0xdf')]=_0x1c11d6['id'];if(_0x18adb0[_0x2979('0x4a')][_0x2979('0x35')]){_0x1fd347[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x1fd347[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x1fd347[_0x2979('0x4f')],function(_0x5e33cb){var _0x1417a2={};_0x1417a2[_0x5e33cb]={'$like':'%'+_0x18adb0[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x1417a2;})});}_0x1fd347=_[_0x2979('0x5e')]({},_0x1fd347,_0x18adb0['options']);return db[_0x2979('0xe7')]['count']({'where':_0x1fd347[_0x2979('0x48')]})[_0x2979('0x1f')](function(_0x23ac88){_0x59ac01[_0x2979('0x1a')]=_0x23ac88;if(_0x18adb0[_0x2979('0x4a')][_0x2979('0x4b')]){_0x1fd347[_0x2979('0x4c')]=[{'all':!![]}];}return db[_0x2979('0xe7')][_0x2979('0x51')](_0x1fd347);})[_0x2979('0x1f')](function(_0x5a165f){_0x59ac01[_0x2979('0x53')]=_0x5a165f;return _0x59ac01;});}})[_0x2979('0x1f')](respondWithFilteredResult(_0x2bb342,_0x1fd347))[_0x2979('0x29')](handleError(_0x2bb342,null));};exports['getSmsInteractions']=function(_0x3245f1,_0x4f986f){var _0x5bf788={};var _0x2edb08={};var _0x239d04;var _0x2b5821;return db['User']['findOne']({'where':{'id':_0x3245f1[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x4f986f,null))[_0x2979('0x1f')](function(_0x1c80c9){if(_0x1c80c9){_0x239d04=_0x1c80c9;_0x2edb08['model']=_[_0x2979('0xd1')](db['SmsInteraction'][_0x2979('0x3f')]);_0x2edb08['query']=_[_0x2979('0xd1')](_0x3245f1['query']);_0x2edb08[_0x2979('0xd3')]=_[_0x2979('0xd4')](_0x2edb08['model'],_0x2edb08['query']);_0x5bf788[_0x2979('0x4f')]=_['intersection'](_0x2edb08['model'],qs[_0x2979('0xd5')](_0x3245f1['query'][_0x2979('0xd5')]));_0x5bf788['attributes']=_0x5bf788[_0x2979('0x4f')][_0x2979('0x6f')]?_0x5bf788[_0x2979('0x4f')]:_0x2edb08['model'];_0x5bf788[_0x2979('0xd6')]=qs[_0x2979('0xd7')](_0x3245f1[_0x2979('0x4a')][_0x2979('0xd7')]);_0x5bf788[_0x2979('0x48')]=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x3245f1[_0x2979('0x4a')],_0x2edb08[_0x2979('0xd3')]));if(_0x3245f1['query'][_0x2979('0x35')]){_0x5bf788[_0x2979('0x48')]=_['merge'](_0x5bf788[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x5bf788[_0x2979('0x4f')],function(_0x487604){var _0x136f91={};_0x136f91[_0x487604]={'$like':'%'+_0x3245f1[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x136f91;})});}_0x5bf788=_['merge']({},_0x5bf788,_0x3245f1[_0x2979('0x5f')]);return _0x239d04['getSmsInteractions'](_0x5bf788);}})[_0x2979('0x1f')](function(_0x359e8c){if(_0x359e8c){_0x2b5821=_0x359e8c[_0x2979('0x6f')];if(!_0x3245f1['query'][_0x2979('0xc8')](_0x2979('0xd9'))){_0x5bf788[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x3245f1['query'][_0x2979('0x18')]);_0x5bf788[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x3245f1[_0x2979('0x4a')][_0x2979('0x17')]);}return _0x239d04[_0x2979('0xe8')](_0x5bf788);}})[_0x2979('0x1f')](function(_0x218553){if(_0x218553){return _0x218553?{'count':_0x2b5821,'rows':_0x218553}:null;}})[_0x2979('0x1f')](respondWithResult(_0x4f986f,null))['catch'](handleError(_0x4f986f,null));};exports['getFaxInteractions']=function(_0x5d9ac7,_0x25dcdb){var _0x5bf7ec={};var _0x4bbf35={};var _0x524cd2;var _0x23f156;return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x5d9ac7[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x25dcdb,null))[_0x2979('0x1f')](function(_0x2fbf12){if(_0x2fbf12){_0x524cd2=_0x2fbf12;_0x4bbf35[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0xe9')]['rawAttributes']);_0x4bbf35['query']=_[_0x2979('0xd1')](_0x5d9ac7[_0x2979('0x4a')]);_0x4bbf35['filters']=_[_0x2979('0xd4')](_0x4bbf35[_0x2979('0xd0')],_0x4bbf35['query']);_0x5bf7ec[_0x2979('0x4f')]=_['intersection'](_0x4bbf35[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x5d9ac7[_0x2979('0x4a')][_0x2979('0xd5')]));_0x5bf7ec[_0x2979('0x4f')]=_0x5bf7ec[_0x2979('0x4f')]['length']?_0x5bf7ec[_0x2979('0x4f')]:_0x4bbf35[_0x2979('0xd0')];_0x5bf7ec[_0x2979('0xd6')]=qs[_0x2979('0xd7')](_0x5d9ac7['query'][_0x2979('0xd7')]);_0x5bf7ec[_0x2979('0x48')]=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x5d9ac7['query'],_0x4bbf35[_0x2979('0xd3')]));if(_0x5d9ac7[_0x2979('0x4a')][_0x2979('0x35')]){_0x5bf7ec['where']=_[_0x2979('0x5e')](_0x5bf7ec[_0x2979('0x48')],{'$or':_['map'](_0x5bf7ec['attributes'],function(_0x3317a5){var _0x52b8dc={};_0x52b8dc[_0x3317a5]={'$like':'%'+_0x5d9ac7[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x52b8dc;})});}_0x5bf7ec=_[_0x2979('0x5e')]({},_0x5bf7ec,_0x5d9ac7['options']);return _0x524cd2['getFaxInteractions'](_0x5bf7ec);}})[_0x2979('0x1f')](function(_0xdee47f){if(_0xdee47f){_0x23f156=_0xdee47f[_0x2979('0x6f')];if(!_0x5d9ac7[_0x2979('0x4a')][_0x2979('0xc8')](_0x2979('0xd9'))){_0x5bf7ec[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x5d9ac7[_0x2979('0x4a')][_0x2979('0x18')]);_0x5bf7ec['offset']=qs[_0x2979('0x17')](_0x5d9ac7[_0x2979('0x4a')][_0x2979('0x17')]);}return _0x524cd2[_0x2979('0xea')](_0x5bf7ec);}})[_0x2979('0x1f')](function(_0xd5457f){if(_0xd5457f){return _0xd5457f?{'count':_0x23f156,'rows':_0xd5457f}:null;}})[_0x2979('0x1f')](respondWithResult(_0x25dcdb,null))['catch'](handleError(_0x25dcdb,null));};exports[_0x2979('0xeb')]=function(_0x207c97,_0x423959){var _0x3e1843={};var _0x7c6ca3={};var _0xb0a6c5;var _0x4e1ff3;return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x207c97[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x423959,null))['then'](function(_0x5bf28b){if(_0x5bf28b){_0xb0a6c5=_0x5bf28b;_0x7c6ca3['model']=_[_0x2979('0xd1')](db[_0x2979('0xec')]['rawAttributes']);_0x7c6ca3[_0x2979('0x4a')]=_[_0x2979('0xd1')](_0x207c97[_0x2979('0x4a')]);_0x7c6ca3[_0x2979('0xd3')]=_[_0x2979('0xd4')](_0x7c6ca3[_0x2979('0xd0')],_0x7c6ca3[_0x2979('0x4a')]);_0x3e1843[_0x2979('0x4f')]=_['intersection'](_0x7c6ca3[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x207c97[_0x2979('0x4a')][_0x2979('0xd5')]));_0x3e1843[_0x2979('0x4f')]=_0x3e1843[_0x2979('0x4f')][_0x2979('0x6f')]?_0x3e1843[_0x2979('0x4f')]:_0x7c6ca3[_0x2979('0xd0')];_0x3e1843['order']=qs['sort'](_0x207c97[_0x2979('0x4a')]['sort']);_0x3e1843[_0x2979('0x48')]=qs['filters'](_[_0x2979('0xd8')](_0x207c97[_0x2979('0x4a')],_0x7c6ca3[_0x2979('0xd3')]));if(_0x207c97['query'][_0x2979('0x35')]){_0x3e1843[_0x2979('0x48')]=_['merge'](_0x3e1843[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x3e1843[_0x2979('0x4f')],function(_0x1d76c0){var _0x15d1d1={};_0x15d1d1[_0x1d76c0]={'$like':'%'+_0x207c97[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x15d1d1;})});}_0x3e1843=_[_0x2979('0x5e')]({},_0x3e1843,_0x207c97[_0x2979('0x5f')]);return _0xb0a6c5['getWhatsappInteractions'](_0x3e1843);}})[_0x2979('0x1f')](function(_0x276aeb){if(_0x276aeb){_0x4e1ff3=_0x276aeb[_0x2979('0x6f')];if(!_0x207c97[_0x2979('0x4a')]['hasOwnProperty'](_0x2979('0xd9'))){_0x3e1843[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x207c97[_0x2979('0x4a')][_0x2979('0x18')]);_0x3e1843[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x207c97[_0x2979('0x4a')][_0x2979('0x17')]);}return _0xb0a6c5[_0x2979('0xeb')](_0x3e1843);}})[_0x2979('0x1f')](function(_0x1dd333){if(_0x1dd333){return _0x1dd333?{'count':_0x4e1ff3,'rows':_0x1dd333}:null;}})['then'](respondWithResult(_0x423959,null))['catch'](handleError(_0x423959,null));};exports['login']=function(_0x3a4c33,_0x305836,_0x4f66a8){var _0x56eb8e;var _0x13a909;var _0x20d276;var _0x568870=!_[_0x2979('0x6a')](_0x3a4c33[_0x2979('0x5d')]['id'])?_0x3a4c33[_0x2979('0x5d')]['id']:!_[_0x2979('0x6a')](_0x3a4c33[_0x2979('0x32')]['id'])?_0x3a4c33[_0x2979('0x32')]['id']:null;return db[_0x2979('0x49')][_0x2979('0x39')]({'where':{'id':_0x568870,'role':{'$or':[_0x2979('0x30'),_0x2979('0x32'),'agent']}},'attributes':['id',_0x2979('0x3e'),_0x2979('0xed'),_0x2979('0xee'),'role',_0x2979('0x69'),_0x2979('0xef')]})['then'](function(_0x1c0072){if(_0x1c0072){if(_0x1c0072['role']===_0x2979('0x2c')){_0x56eb8e=_0x1c0072;if(_0x3a4c33['body']['interface']){_0x20d276=util['format'](_0x2979('0xf0'),_0x56eb8e[_0x3a4c33[_0x2979('0x61')][_0x2979('0xa1')]]);}else if(_0x3a4c33[_0x2979('0x61')][_0x2979('0xf1')]){_0x20d276=util[_0x2979('0xc6')](_0x2979('0xaa'),_0x3a4c33[_0x2979('0x61')]['intrf']);}else{_0x20d276=util[_0x2979('0xc6')](_0x2979('0xaa'),_0x56eb8e[_0x2979('0x3e')]);}socket['to'](util['format']('user:%s',_0x56eb8e[_0x2979('0x3e')]))['emit']('user:forcelogout',{'user':{'id':_0x56eb8e['id'],'name':_0x56eb8e[_0x2979('0x3e')]},'ip':_0x3a4c33['headers'][_0x2979('0xf2')]||_0x3a4c33[_0x2979('0xf3')][_0x2979('0xf4')]||_0x3a4c33['socket'][_0x2979('0xf4')]||_0x3a4c33[_0x2979('0xf3')][_0x2979('0xf5')][_0x2979('0xf4')]});return db[_0x2979('0xab')][_0x2979('0x3b')]({'where':{'membername':_0x56eb8e[_0x2979('0x3e')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x2979('0x95'))](_0x2979('0xf6'));}})[_0x2979('0x1f')](function(){if(_0x56eb8e){return _0x56eb8e[_0x2979('0xf7')]({'raw':!![]});}})[_0x2979('0x1f')](function(_0x2a9577){if(_0x56eb8e){if(_0x2a9577){_0x13a909=_0x2a9577;if(_0x13a909['length']){var _0x404d04=_0x13a909[_0x2979('0x37')](function(_0x32a6f1){var _0x2120f3={'membername':_0x56eb8e[_0x2979('0x3e')],'UserId':_0x56eb8e['id'],'queue_name':_0x32a6f1[_0x2979('0x3e')],'VoiceQueueId':_0x32a6f1['id'],'interface':_0x20d276,'paused':_0x56eb8e[_0x2979('0xef')]||![],'penalty':_0x32a6f1[_0x2979('0xf8')]||0x0};return db[_0x2979('0xab')]['upsert'](_0x2120f3);});return Promise['all'](_0x404d04);}}}})['then'](function(){if(_0x56eb8e){return db[_0x2979('0xf9')][_0x2979('0x51')]({'where':{'membername':_0x56eb8e['name'],'exitAt':null}});}})[_0x2979('0x1f')](function(_0x2dce4f){if(_0x56eb8e){var _0x25d545=[];_0x2dce4f[_0x2979('0xfa')](function(_0x5367f7){_0x25d545[_0x2979('0x50')](_0x5367f7[_0x2979('0x2a')]({'exitAt':moment()[_0x2979('0xc6')](_0x2979('0xfb'))}));});return Promise['all'](_0x25d545);}})[_0x2979('0x1f')](function(){if(_0x56eb8e){var _0x5f522f=[];var _0x27ff36=[];var _0x3aca11=utils[_0x2979('0xfc')]();var _0x2c00db={'membername':_0x56eb8e[_0x2979('0x3e')],'interface':_0x20d276,'enterAt':moment()[_0x2979('0xc6')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x56eb8e[_0x2979('0x2b')],'internal':_0x56eb8e['internal']};_0x3aca11['forEach'](function(_0x264620){_0x5f522f[_0x2979('0x50')](_['merge']({'channel':_0x264620,'type':_0x2979('0xfd'),'data1':_0x3a4c33[_0x2979('0x61')][_0x2979('0xfe')],'data2':_0x20d276},_0x2c00db));if(_0x56eb8e[_0x2979('0xef')]){_0x27ff36[_0x2979('0x50')](_['merge']({'channel':_0x264620,'type':_0x2979('0xff'),'data1':_0x2979('0x100')},_0x2c00db));}});return db['MemberReport']['bulkCreate'](_0x5f522f[_0x2979('0x101')](_0x27ff36),{'individualHooks':!![]});}})['then'](function(){if(_0x56eb8e){return _0x56eb8e[_0x2979('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x2979('0xc6')](_0x2979('0xfb')),'voicePause':_0x56eb8e[_0x2979('0xef')]||![],'mailPause':_0x56eb8e[_0x2979('0xef')]||![],'chatPause':_0x56eb8e[_0x2979('0xef')]||![],'faxPause':_0x56eb8e[_0x2979('0xef')]||![],'smsPause':_0x56eb8e[_0x2979('0xef')]||![],'openchannelPause':_0x56eb8e[_0x2979('0xef')]||![],'whatsappPause':_0x56eb8e[_0x2979('0xef')]||![],'pauseType':_0x56eb8e['loginInPause']?_0x2979('0x100'):null,'interface':_0x20d276,'lastPauseAt':moment()[_0x2979('0xc6')](_0x2979('0xfb'))});}})[_0x2979('0x1f')](function(_0xcf1d5c){if(_0x3a4c33[_0x2979('0x102')]){return _0x4f66a8();}else{return Promise[_0x2979('0x103')](_0xcf1d5c)[_0x2979('0x1f')](respondWithResult(_0x305836,null));}})[_0x2979('0x29')](handleError(_0x305836,null));};exports[_0x2979('0x104')]=function(_0x38a6a9,_0x510d98){var _0x10a420;return db[_0x2979('0x49')][_0x2979('0x39')]({'where':{'id':_0x38a6a9[_0x2979('0x5d')]['id'],'role':_0x2979('0x2c')},'attributes':['id','name',_0x2979('0x2b')]})[_0x2979('0x1f')](handleEntityNotFound(_0x510d98,null))['then'](function(_0xa3e3d4){if(_0xa3e3d4){_0x10a420=_0xa3e3d4;return db[_0x2979('0xab')][_0x2979('0x3b')]({'where':{'membername':_0x10a420['name']},'individualHooks':!![]});}})[_0x2979('0x1f')](function(){return db['MemberReport'][_0x2979('0x51')]({'where':{'membername':_0x10a420['name'],'exitAt':null}});})[_0x2979('0x1f')](function(_0xf1710c){var _0x2f7495=[];_0xf1710c['forEach'](function(_0x29bb6b){_0x2f7495['push'](_0x29bb6b[_0x2979('0x2a')]({'exitAt':moment()['format'](_0x2979('0xfb'))}));});return Promise[_0x2979('0x5b')](_0x2f7495);})[_0x2979('0x1f')](function(){return _0x10a420[_0x2979('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2979('0x1f')](respondWithResult(_0x510d98,null))[_0x2979('0x29')](handleError(_0x510d98,null));};exports[_0x2979('0x105')]=function(_0x41b137,_0x36fad1){var _0x3aeb9f;return db[_0x2979('0xab')][_0x2979('0x2a')]({'paused':0x1},{'where':{'UserId':_0x41b137['params']['id']},'individualHooks':!![]})[_0x2979('0x1f')](function(){return db[_0x2979('0x49')]['find']({'where':{'id':_0x41b137[_0x2979('0x5d')]['id'],'role':_0x2979('0x2c')},'attributes':['id',_0x2979('0x3e'),_0x2979('0x2b'),_0x2979('0x69'),_0x2979('0xa1'),_0x2979('0x9f')]});})[_0x2979('0x1f')](handleEntityNotFound(_0x36fad1,null))[_0x2979('0x1f')](function(_0x199e05){if(_0x199e05){_0x3aeb9f=_0x199e05;return respondWithRpcPromise(_0x2979('0x106'),_0x2979('0x105'),{'id':_0x3aeb9f['id'],'name':_0x3aeb9f[_0x2979('0x3e')],'pause':!![]});}})[_0x2979('0x1f')](function(){if(_0x3aeb9f){return db[_0x2979('0xf9')][_0x2979('0x51')]({'where':{'membername':_0x3aeb9f[_0x2979('0x3e')],'type':'PAUSE','exitAt':null}});}})[_0x2979('0x1f')](function(_0x368c1d){if(_0x368c1d[_0x2979('0x6f')]){var _0x5a240a=moment()[_0x2979('0xc6')](_0x2979('0xfb'));for(var _0x2cd2bb=0x0,_0x1629b2=_0x368c1d[_0x2979('0x6f')];_0x2cd2bb<_0x1629b2;_0x2cd2bb++){_0x368c1d[_0x2cd2bb][_0x2979('0x107')]({'exitAt':_0x5a240a});}}})[_0x2979('0x1f')](function(){var _0xf47cb7=[];var _0x331e7d=utils[_0x2979('0xfc')]();_0x331e7d[_0x2979('0xfa')](function(_0x1ec90d){_0xf47cb7[_0x2979('0x50')]({'channel':_0x1ec90d,'membername':_0x3aeb9f['name'],'interface':_[_0x2979('0x6a')](_0x3aeb9f[_0x2979('0xa1')])?util['format'](_0x2979('0xaa'),_0x3aeb9f['name']):_0x3aeb9f['interface'],'type':'PAUSE','enterAt':moment()[_0x2979('0xc6')](_0x2979('0xfb')),'data1':_0x41b137[_0x2979('0x61')][_0x2979('0x41')]||_0x2979('0x108'),'role':_0x3aeb9f['role'],'internal':_0x3aeb9f['internal']});});return db['MemberReport'][_0x2979('0x8c')](_0xf47cb7,{'individualHooks':!![]});})['then'](function(){return _0x3aeb9f[_0x2979('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x41b137[_0x2979('0x61')]['type']||_0x2979('0x108'),'lastPauseAt':moment()[_0x2979('0xc6')](_0x2979('0xfb'))});})[_0x2979('0x1f')](respondWithResult(_0x36fad1,null))[_0x2979('0x29')](handleError(_0x36fad1,null));};exports[_0x2979('0x109')]=function(_0x56da1b,_0x40f1d6){if(_0x56da1b[_0x2979('0x61')][_0x2979('0xad')]&&!utils['isValidChannel'](_0x56da1b['body']['channel'])){throw new APIBadRequestError(util[_0x2979('0xc6')](_0x2979('0x10a'),_0x56da1b[_0x2979('0x61')][_0x2979('0xad')]));}return db[_0x2979('0x49')][_0x2979('0x39')]({'where':{'id':_0x56da1b[_0x2979('0x5d')]['id']},'attributes':['id',_0x2979('0x3e'),'role',_0x2979('0x69'),_0x2979('0xa1'),_0x2979('0x9f'),_0x2979('0xa0'),'mailPause',_0x2979('0x10b'),_0x2979('0x10c'),_0x2979('0x10d'),_0x2979('0x10e'),_0x2979('0x10f'),_0x2979('0x110'),'lastPauseAt']})[_0x2979('0x1f')](function(_0x4339c9){if(!_0x4339c9){throw new APINotFoundError(util['format'](_0x2979('0xc7'),_0x56da1b[_0x2979('0x5d')]['id']));}return _0x4339c9['unpause'](_0x56da1b[_0x2979('0x61')][_0x2979('0xad')]);})[_0x2979('0x1f')](respondWithResult(_0x40f1d6,null))['catch'](APIHandleError(_0x40f1d6));};exports[_0x2979('0x111')]=function(_0x502493,_0xe7bf79){var _0x1b4e0e={};var _0x28e484={};var _0x190574;var _0x79c77e;return db['User'][_0x2979('0xdb')]({'where':{'id':_0x502493[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0xe7bf79,null))['then'](function(_0x5d757e){if(_0x5d757e){_0x190574=_0x5d757e;_0x28e484[_0x2979('0xd0')]=_['keys'](db[_0x2979('0x112')]['rawAttributes']);_0x28e484['query']=_['keys'](_0x502493[_0x2979('0x4a')]);_0x28e484['filters']=_['intersection'](_0x28e484['model'],_0x28e484['query']);_0x1b4e0e[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0x28e484[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x502493[_0x2979('0x4a')]['fields']));_0x1b4e0e[_0x2979('0x4f')]=_0x1b4e0e[_0x2979('0x4f')][_0x2979('0x6f')]?_0x1b4e0e[_0x2979('0x4f')]:_0x28e484[_0x2979('0xd0')];_0x1b4e0e['order']=qs['sort'](_0x502493[_0x2979('0x4a')][_0x2979('0xd7')]);_0x1b4e0e[_0x2979('0x48')]=qs[_0x2979('0xd3')](_['pick'](_0x502493[_0x2979('0x4a')],_0x28e484['filters']));if(_0x502493[_0x2979('0x4a')][_0x2979('0x35')]){_0x1b4e0e[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x1b4e0e[_0x2979('0x48')],{'$or':_[_0x2979('0x37')](_0x1b4e0e[_0x2979('0x4f')],function(_0x50ddf5){var _0x517c2a={};_0x517c2a[_0x50ddf5]={'$like':'%'+_0x502493[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x517c2a;})});}_0x1b4e0e=_[_0x2979('0x5e')]({},_0x1b4e0e,_0x502493[_0x2979('0x5f')]);return _0x190574['getTeams'](_0x1b4e0e);}})[_0x2979('0x1f')](function(_0x271ceb){if(_0x271ceb){_0x79c77e=_0x271ceb['length'];if(!_0x502493['query'][_0x2979('0xc8')](_0x2979('0xd9'))){_0x1b4e0e[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x502493[_0x2979('0x4a')][_0x2979('0x18')]);_0x1b4e0e[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x502493[_0x2979('0x4a')]['offset']);}return _0x190574[_0x2979('0x111')](_0x1b4e0e);}})['then'](function(_0x5a10a3){if(_0x5a10a3){return _0x5a10a3?{'count':_0x79c77e,'rows':_0x5a10a3}:null;}})[_0x2979('0x1f')](respondWithResult(_0xe7bf79,null))['catch'](handleError(_0xe7bf79,null));};exports['addTeams']=function(_0x1c6604,_0x57c969){var _0x41c799=_0x1c6604[_0x2979('0x5d')]['id'];var _0x51fbec=_0x1c6604[_0x2979('0x61')]?_0x1c6604[_0x2979('0x61')][_0x2979('0x64')]:null;var _0x40133b=[];return Promise[_0x2979('0x103')]()[_0x2979('0x1f')](function(){if(!_0x51fbec)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db['User'][_0x2979('0xdb')]({'where':{'id':_0x41c799}});})[_0x2979('0x1f')](function(_0x23e7cc){if(!_0x23e7cc)throw new APINotFoundError(util[_0x2979('0xc6')](_0x2979('0xc7'),_0x1c6604[_0x2979('0x5d')]['id']));return db[_0x2979('0x6d')][_0x2979('0x113')](function(_0x13314c){return _0x23e7cc[_0x2979('0x114')](_0x51fbec,{'transaction':_0x13314c})['then'](function(){return db[_0x2979('0x112')][_0x2979('0x51')]({'where':{'id':{'$in':_0x51fbec}}});})[_0x2979('0x1f')](function(_0x34b1bf){var _0x1e8483=_[_0x2979('0x37')](_0x34b1bf,function(_0x1b53b7){return _0x1b53b7[_0x2979('0x115')]();});return Promise[_0x2979('0x5b')](_0x1e8483);})[_0x2979('0x1f')](function(_0xbd36b6){_0x40133b=_[_0x2979('0x116')](_0xbd36b6);var _0x11e11a=_[_0x2979('0x37')](_0x40133b,function(_0x4593de){return _0x4593de['addAgent'](_0x23e7cc['id'],{'transaction':_0x13314c});});return Promise[_0x2979('0x5b')](_0x11e11a);})['then'](function(){if(!_0x23e7cc[_0x2979('0x9f')])return;var _0x4e4bc7=_[_0x2979('0x35')](_0x40133b,function(_0x14ba52){return _0x14ba52[_0x2979('0x117')](_0x2979('0xad'))===_0x2979('0x118');});var _0x468371=_[_0x2979('0x37')](_0x4e4bc7,function(_0x208cfc){return db['UserVoiceQueueRt'][_0x2979('0xac')]({'membername':_0x23e7cc[_0x2979('0x3e')],'UserId':_0x23e7cc['id'],'queue_name':_0x208cfc[_0x2979('0x3e')],'VoiceQueueId':_0x208cfc['id'],'interface':_[_0x2979('0x6a')](_0x23e7cc[_0x2979('0xa1')])?util['format']('SIP/%s',_0x23e7cc[_0x2979('0x3e')]):_0x23e7cc['interface'],'paused':_0x23e7cc['voicePause']||![],'penalty':_0x23e7cc['penalty']},{'transaction':_0x13314c});});return Promise[_0x2979('0x5b')](_0x468371);})[_0x2979('0x1f')](function(){return db[_0x2979('0x119')][_0x2979('0x51')]({'where':{'teamId':{'$in':_0x51fbec}}});})[_0x2979('0x1f')](function(_0x41753d){var _0x2b337b=_[_0x2979('0x37')](_0x41753d,function(_0x39cc87){return db[_0x2979('0x11a')][_0x2979('0x84')]({'UserId':_0x23e7cc['id'],'VoicePrefixId':_0x39cc87[_0x2979('0x11b')]},{'transaction':_0x13314c});});return Promise[_0x2979('0x5b')](_0x2b337b);});});})['then'](function(){for(var _0x1e48b0=0x0;_0x1e48b0<_0x40133b['length'];_0x1e48b0++){var _0x188738=_0x40133b[_0x1e48b0][_0x2979('0x117')](_0x2979('0xad'));var _0x226e08=_0x188738+_0x2979('0xa7');socket[_0x2979('0x2d')](_0x2979('0x32')+_0x188738+'Queue:save',{'UserId':_0x41c799,['queueField']:_0x40133b[_0x1e48b0]['id']});}})[_0x2979('0x1f')](respondWithStatusCode(_0x57c969,null))['catch'](APIHandleError(_0x57c969));};exports[_0x2979('0x11c')]=function(_0xb8bbf5,_0x3636ba){var _0x53f343=_0xb8bbf5[_0x2979('0x5d')]['id'];var _0x5e5041=null;if(_0xb8bbf5[_0x2979('0x4a')]['ids']){_0x5e5041=_[_0x2979('0x11d')](_0xb8bbf5[_0x2979('0x4a')][_0x2979('0x64')])?_0xb8bbf5[_0x2979('0x4a')][_0x2979('0x64')]:[_0xb8bbf5['query'][_0x2979('0x64')]];}var _0x40166a=[];return Promise[_0x2979('0x103')]()[_0x2979('0x1f')](function(){if(!_0x5e5041)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x2979('0x1f')](function(){return db[_0x2979('0x49')]['findOne']({'where':{'id':_0x53f343}});})[_0x2979('0x1f')](function(_0x5a9687){if(!_0x5a9687)throw new APINotFoundError(util[_0x2979('0xc6')]('User\x20with\x20id\x20%s\x20not\x20found',_0xb8bbf5[_0x2979('0x5d')]['id']));return db[_0x2979('0x6d')][_0x2979('0x113')](function(_0x59553c){return _0x5a9687[_0x2979('0x11c')](_0x5e5041,{'transaction':_0x59553c})[_0x2979('0x1f')](function(){return db[_0x2979('0x112')][_0x2979('0x51')]({'where':{'id':{'$in':_0x5e5041}}});})[_0x2979('0x1f')](function(_0x4701c9){var _0x493316=_[_0x2979('0x37')](_0x4701c9,function(_0x39eb15){return _0x39eb15[_0x2979('0x115')]();});return Promise[_0x2979('0x5b')](_0x493316);})[_0x2979('0x1f')](function(_0x41cc10){_0x40166a=_['flattenDeep'](_0x41cc10);var _0x5b4b55=_['map'](_0x40166a,function(_0x5976e6){return _0x5976e6[_0x2979('0x11e')](_0x5a9687['id'],{'transaction':_0x59553c});});return Promise[_0x2979('0x5b')](_0x5b4b55);})[_0x2979('0x1f')](function(){if(!_0x5a9687[_0x2979('0x9f')])return;var _0x3e5bbc=_[_0x2979('0x35')](_0x40166a,function(_0x2d657b){return _0x2d657b[_0x2979('0x117')](_0x2979('0xad'))===_0x2979('0x118');});var _0x1dc261=_[_0x2979('0x37')](_0x3e5bbc,function(_0x37eb65){return db[_0x2979('0xab')][_0x2979('0x3b')]({'where':{'VoiceQueueId':_0x37eb65['id'],'UserId':_0x5a9687['id']},'transaction':_0x59553c});});return Promise[_0x2979('0x5b')](_0x1dc261);})['then'](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x5e5041}}});})[_0x2979('0x1f')](function(_0x1eff99){var _0x1e67f4=_[_0x2979('0x37')](_0x1eff99,function(_0x3e0599){return db[_0x2979('0x11a')][_0x2979('0x3b')]({'where':{'UserId':_0x5a9687['id'],'VoicePrefixId':_0x3e0599[_0x2979('0x11b')]}},{'transaction':_0x59553c});});return Promise['all'](_0x1e67f4);});});})['then'](function(){for(var _0x4d4260=0x0;_0x4d4260<_0x40166a[_0x2979('0x6f')];_0x4d4260++){var _0x1cc88e=_0x40166a[_0x4d4260][_0x2979('0x117')](_0x2979('0xad'));var _0x1e0ea9=_0x1cc88e+_0x2979('0xa7');socket[_0x2979('0x2d')](_0x2979('0x32')+_0x1cc88e+'Queue:remove',{'UserId':_0x53f343,['queueField']:_0x40166a[_0x4d4260]['id']});}})['then'](respondWithStatusCode(_0x3636ba,null))[_0x2979('0x29')](APIHandleError(_0x3636ba));};exports[_0x2979('0x11f')]=function(_0x526375,_0x313028){var _0x406512={};var _0xadd814={};var _0x1d0cd8;var _0x3fc6f8;return db[_0x2979('0x49')]['findOne']({'where':{'id':_0x526375[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x313028,null))[_0x2979('0x1f')](function(_0x41cf92){if(_0x41cf92){_0x1d0cd8=_0x41cf92;_0xadd814['model']=_['keys'](db[_0x2979('0xc9')][_0x2979('0x3f')]);_0xadd814[_0x2979('0x4a')]=_['keys'](_0x526375[_0x2979('0x4a')]);_0xadd814[_0x2979('0xd3')]=_[_0x2979('0xd4')](_0xadd814[_0x2979('0xd0')],_0xadd814[_0x2979('0x4a')]);_0x406512[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0xadd814[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x526375[_0x2979('0x4a')][_0x2979('0xd5')]));_0x406512[_0x2979('0x4f')]=_0x406512['attributes']['length']?_0x406512[_0x2979('0x4f')]:_0xadd814['model'];_0x406512[_0x2979('0xd6')]=qs['sort'](_0x526375['query'][_0x2979('0xd7')]);_0x406512[_0x2979('0x48')]=qs['filters'](_[_0x2979('0xd8')](_0x526375['query'],_0xadd814[_0x2979('0xd3')]));if(_0x526375['query'][_0x2979('0x35')]){_0x406512[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x406512[_0x2979('0x48')],{'$or':_['map'](_0x406512[_0x2979('0x4f')],function(_0x3ef947){var _0x271751={};_0x271751[_0x3ef947]={'$like':'%'+_0x526375[_0x2979('0x4a')][_0x2979('0x35')]+'%'};return _0x271751;})});}_0x406512=_[_0x2979('0x5e')]({},_0x406512,_0x526375['options']);return _0x1d0cd8[_0x2979('0x11f')](_0x406512);}})[_0x2979('0x1f')](function(_0x4cdbba){if(_0x4cdbba){_0x3fc6f8=_0x4cdbba[_0x2979('0x6f')];if(!_0x526375[_0x2979('0x4a')][_0x2979('0xc8')](_0x2979('0xd9'))){_0x406512[_0x2979('0x18')]=qs[_0x2979('0x18')](_0x526375[_0x2979('0x4a')][_0x2979('0x18')]);_0x406512[_0x2979('0x17')]=qs[_0x2979('0x17')](_0x526375[_0x2979('0x4a')][_0x2979('0x17')]);}return _0x1d0cd8[_0x2979('0x11f')](_0x406512);}})[_0x2979('0x1f')](function(_0x350678){if(_0x350678){return _0x350678?{'count':_0x3fc6f8,'rows':_0x350678}:null;}})[_0x2979('0x1f')](respondWithResult(_0x313028,null))[_0x2979('0x29')](handleError(_0x313028,null));};exports[_0x2979('0x120')]=function(_0x34ac04,_0x3dc46a){var _0x5b501b={};var _0x404efc={};var _0x1f9ab6;return db[_0x2979('0x49')][_0x2979('0xdb')]({'where':{'id':_0x34ac04[_0x2979('0x5d')]['id']}})[_0x2979('0x1f')](handleEntityNotFound(_0x3dc46a,null))[_0x2979('0x1f')](function(_0x1aa70f){if(_0x1aa70f){_0x1f9ab6=_0x1aa70f;_0x404efc[_0x2979('0xd0')]=_[_0x2979('0xd1')](db[_0x2979('0x49')][_0x2979('0x3f')]);_0x404efc[_0x2979('0x4a')]=_[_0x2979('0xd1')](_0x34ac04[_0x2979('0x4a')]);_0x404efc['filters']=_['intersection'](_0x404efc['model'],_0x404efc[_0x2979('0x4a')]);_0x5b501b[_0x2979('0x4f')]=_[_0x2979('0xd4')](_0x404efc[_0x2979('0xd0')],qs[_0x2979('0xd5')](_0x34ac04['query']['fields']));_0x5b501b[_0x2979('0x4f')]=_0x5b501b['attributes'][_0x2979('0x6f')]?_0x5b501b[_0x2979('0x4f')]:_0x404efc[_0x2979('0xd0')];_0x5b501b[_0x2979('0xd6')]=qs['sort'](_0x34ac04[_0x2979('0x4a')][_0x2979('0xd7')]);_0x5b501b[_0x2979('0x48')]=qs[_0x2979('0xd3')](_[_0x2979('0xd8')](_0x34ac04[_0x2979('0x4a')],_0x404efc[_0x2979('0xd3')]));if(_0x34ac04[_0x2979('0x4a')][_0x2979('0x35')]){_0x5b501b[_0x2979('0x48')]=_[_0x2979('0x5e')](_0x5b501b['where'],{'$or':_['map'](_0x5b501b[_0x2979('0x4f')],function(_0x2aa24f){var _0x2b2ff5={};_0x2b2ff5[_0x2aa24f]={'$like':'%'+_0x34ac04[_0x2979('0x4a')]['filter']+'%'};return _0x2b2ff5;})});}_0x5b501b['model']=db['User'];_0x5b501b['as']=_0x2979('0x33');_0x5b501b=_['merge']({},_0x5b501b,_0x34ac04[_0x2979('0x5f')]);return _0x1f9ab6[_0x2979('0xf7')]({'include':[_0x5b501b]});}})[_0x2979('0x1f')](function(_0x53efe2){if(_0x53efe2){var _0x3a1c36={},_0x3a68af=[];for(var _0x404c4f=0x0;_0x404c4f<_0x53efe2[_0x2979('0x6f')];_0x404c4f+=0x1){for(var _0x4c6705=0x0,_0x203edd;_0x4c6705<_0x53efe2[_0x404c4f][_0x2979('0x33')]['length'];_0x4c6705+=0x1){_0x203edd=_0x53efe2[_0x404c4f][_0x2979('0x33')][_0x4c6705][_0x2979('0x2f')]({'plain':!![]});_0x3a1c36[_0x203edd['id']]=_0x203edd;}}_0x3a1c36=_[_0x2979('0x121')](_0x3a1c36);for(var _0x20a40f=qs['offset'](_0x34ac04[_0x2979('0x4a')][_0x2979('0x17')]);_0x20a40f<_0x3a1c36[_0x2979('0x6f')]&&_0x3a68af[_0x2979('0x6f')]=_0x266182[_0x5726('0x4a')]){throw new Error(_0x5726('0x4b'));}})['then'](function(){if(_0x4d8db7){return db[_0x5726('0x23')][_0x5726('0x41')]({'where':{'membername':_0x4d8db7['name']},'individualHooks':!![]});}})[_0x5726('0x13')](function(){if(_0x4d8db7){return _0x4d8db7[_0x5726('0x4c')]({'raw':!![]});}})[_0x5726('0x13')](function(_0x27c49c){if(_0x4d8db7){if(_0x27c49c){var _0x3d080e=[];_0x59c2e0=_0x27c49c;if(_0x59c2e0[_0x5726('0x26')]){for(var _0x4f8eb4=0x0;_0x4f8eb4<_0x59c2e0[_0x5726('0x26')];_0x4f8eb4++){_0x3d080e[_0x5726('0x2a')](db[_0x5726('0x23')][_0x5726('0x4d')]({'membername':_0x4d8db7['name'],'UserId':_0x4d8db7['id'],'queue_name':_0x59c2e0[_0x4f8eb4][_0x5726('0x1d')],'VoiceQueueId':_0x59c2e0[_0x4f8eb4]['id'],'interface':_0x35abab,'paused':_0x4d8db7[_0x5726('0x46')]||![],'penalty':_0x59c2e0[_0x4f8eb4][_0x5726('0x4e')]||0x0}));}return BPromise[_0x5726('0x43')](_0x3d080e);}}}})['then'](function(){if(_0x4d8db7){return db[_0x5726('0x42')][_0x5726('0xb')]({'where':{'membername':_0x4d8db7[_0x5726('0x1d')],'exitAt':null}});}})[_0x5726('0x13')](function(_0x52057f){if(_0x4d8db7){if(_0x52057f&&_0x52057f[_0x5726('0x26')]){var _0x4fee3b=[];_0x52057f[_0x5726('0x29')](function(_0x3b341e){_0x4fee3b[_0x5726('0x2a')](_0x3b341e[_0x5726('0x24')]({'exitAt':moment()[_0x5726('0x21')](_0x5726('0x27'))}));});return BPromise[_0x5726('0x43')](_0x4fee3b);}}})[_0x5726('0x13')](function(){if(_0x4d8db7){var _0x2b8710=[];var _0x5435e1=[];var _0x2ddd74=utils[_0x5726('0x4f')]();var _0x5e4213={'membername':_0x4d8db7[_0x5726('0x1d')],'interface':_0x35abab,'enterAt':moment()['format'](_0x5726('0x27')),'role':_0x4d8db7['role'],'internal':_0x4d8db7[_0x5726('0x1f')]};_0x2ddd74[_0x5726('0x29')](function(_0x3871b3){_0x2b8710['push'](_[_0x5726('0x50')]({'channel':_0x3871b3,'type':'LOGIN','data1':_0x5726('0x51'),'data2':_0x35abab},_0x5e4213));if(_0x4d8db7[_0x5726('0x46')]){_0x5435e1[_0x5726('0x2a')](_['merge']({'channel':_0x3871b3,'type':_0x5726('0x25'),'data1':_0x5726('0x52')},_0x5e4213));}});return db[_0x5726('0x42')][_0x5726('0x53')](_0x2b8710[_0x5726('0x54')](_0x5435e1),{'individualHooks':!![]});}})['then'](function(){if(_0x4d8db7){return _0x4d8db7[_0x5726('0x24')]({'online':!![],'lastLoginAt':moment()[_0x5726('0x21')](_0x5726('0x27')),'voicePause':_0x4d8db7[_0x5726('0x46')]||![],'mailPause':_0x4d8db7[_0x5726('0x46')]||![],'chatPause':_0x4d8db7[_0x5726('0x46')]||![],'faxPause':_0x4d8db7[_0x5726('0x46')]||![],'smsPause':_0x4d8db7[_0x5726('0x46')]||![],'openchannelPause':_0x4d8db7[_0x5726('0x46')]||![],'pauseType':_0x4d8db7[_0x5726('0x46')]?_0x5726('0x52'):null,'lastPauseAt':moment()[_0x5726('0x21')](_0x5726('0x27')),'interface':_0x35abab});}})[_0x5726('0x13')](function(_0x4c0f06){_0x3267a2(_0x4c0f06);})[_0x5726('0x1a')](function(_0x55848b){_0x4922d6(_0x46c6dc['error'](0x1f4,_0x55848b[_0x5726('0x16')]));});});}; \ No newline at end of file +var _0x7b87=['then','info','stringify','catch','error','message','ShowUser','find','debug','PauseUser','name','User\x20with\x20id\x20%s\x20not\x20found','params','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','interface','body','role','uniqueid','bulkCreate','type','UnpauseUser','resolve','channel','findOne','internal','online','voicePause','mailPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','unpause','UserVoiceQueueRt','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','update','all','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x178236,_0x5a0873){var _0xdcf7b8=function(_0x7ba7fe){while(--_0x7ba7fe){_0x178236['push'](_0x178236['shift']());}};_0xdcf7b8(++_0x5a0873);}(_0x7b87,0x14a));var _0x77b8=function(_0x45a945,_0x2e8b66){_0x45a945=_0x45a945-0x0;var _0x403af5=_0x7b87[_0x45a945];return _0x403af5;};'use strict';var _=require(_0x77b8('0x0'));var util=require(_0x77b8('0x1'));var moment=require(_0x77b8('0x2'));var BPromise=require(_0x77b8('0x3'));var Redis=require(_0x77b8('0x4'));var db=require(_0x77b8('0x5'))['db'];var utils=require(_0x77b8('0x6'));var logger=require(_0x77b8('0x7'))(_0x77b8('0x8'));var config=require(_0x77b8('0x9'));config['redis']=_[_0x77b8('0xa')](config[_0x77b8('0xb')],{'host':_0x77b8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77b8('0xb')]));require(_0x77b8('0xd'))[_0x77b8('0xe')](socket);exports[_0x77b8('0xf')]=function(_0x17bc13){var _0x3c982d=this;return new Promise(function(_0x22dfbf,_0x11533b){return db[_0x77b8('0x10')][_0x77b8('0x11')]({'raw':_0x17bc13[_0x77b8('0x12')]?_0x17bc13[_0x77b8('0x12')][_0x77b8('0x13')]===undefined?!![]:![]:!![],'where':_0x17bc13[_0x77b8('0x12')]?_0x17bc13[_0x77b8('0x12')][_0x77b8('0x14')]||null:null,'attributes':_0x17bc13[_0x77b8('0x12')]?_0x17bc13[_0x77b8('0x12')][_0x77b8('0x15')]||null:null,'limit':_0x17bc13[_0x77b8('0x12')]?_0x17bc13[_0x77b8('0x12')][_0x77b8('0x16')]||null:null,'include':_0x17bc13['options']?_0x17bc13[_0x77b8('0x12')][_0x77b8('0x17')]?_['map'](_0x17bc13[_0x77b8('0x12')]['include'],function(_0x1c3b5a){return{'model':db[_0x1c3b5a['model']],'as':_0x1c3b5a['as'],'attributes':_0x1c3b5a[_0x77b8('0x15')],'include':_0x1c3b5a[_0x77b8('0x17')]?_['map'](_0x1c3b5a[_0x77b8('0x17')],function(_0x28be4d){return{'model':db[_0x28be4d[_0x77b8('0x18')]],'as':_0x28be4d['as'],'attributes':_0x28be4d['attributes'],'include':_0x28be4d['include']?_[_0x77b8('0x19')](_0x28be4d[_0x77b8('0x17')],function(_0x58787d){return{'model':db[_0x58787d[_0x77b8('0x18')]],'as':_0x58787d['as'],'attributes':_0x58787d[_0x77b8('0x15')]};}):[]};}):[]};}):[]:[]})[_0x77b8('0x1a')](function(_0x43b893){logger[_0x77b8('0x1b')](_0x77b8('0xf'),_0x17bc13);logger['debug'](_0x77b8('0xf'),_0x17bc13,JSON[_0x77b8('0x1c')](_0x43b893));_0x22dfbf(_0x43b893);})[_0x77b8('0x1d')](function(_0x1b7fe3){logger[_0x77b8('0x1e')]('GetUser',_0x1b7fe3['message'],_0x17bc13);_0x11533b(_0x3c982d[_0x77b8('0x1e')](0x1f4,_0x1b7fe3[_0x77b8('0x1f')]));});});};exports[_0x77b8('0x20')]=function(_0x58c5a0){var _0x6ae879=this;return new Promise(function(_0x243a4f,_0x491424){return db[_0x77b8('0x10')][_0x77b8('0x21')]({'raw':_0x58c5a0[_0x77b8('0x12')]?_0x58c5a0[_0x77b8('0x12')][_0x77b8('0x13')]===undefined?!![]:![]:!![],'where':_0x58c5a0[_0x77b8('0x12')]?_0x58c5a0[_0x77b8('0x12')][_0x77b8('0x14')]||null:null,'attributes':_0x58c5a0[_0x77b8('0x12')]?_0x58c5a0[_0x77b8('0x12')][_0x77b8('0x15')]||null:null,'include':_0x58c5a0['options']?_0x58c5a0[_0x77b8('0x12')][_0x77b8('0x17')]?_[_0x77b8('0x19')](_0x58c5a0[_0x77b8('0x12')][_0x77b8('0x17')],function(_0x59ce23){return{'model':db[_0x59ce23[_0x77b8('0x18')]],'as':_0x59ce23['as'],'attributes':_0x59ce23[_0x77b8('0x15')],'include':_0x59ce23[_0x77b8('0x17')]?_[_0x77b8('0x19')](_0x59ce23[_0x77b8('0x17')],function(_0x2de1bf){return{'model':db[_0x2de1bf[_0x77b8('0x18')]],'as':_0x2de1bf['as'],'attributes':_0x2de1bf[_0x77b8('0x15')],'include':_0x2de1bf[_0x77b8('0x17')]?_[_0x77b8('0x19')](_0x2de1bf[_0x77b8('0x17')],function(_0x49ede1){return{'model':db[_0x49ede1[_0x77b8('0x18')]],'as':_0x49ede1['as'],'attributes':_0x49ede1[_0x77b8('0x15')]};}):[]};}):[]};}):[]:[]})[_0x77b8('0x1a')](function(_0x46cdf5){logger['info']('ShowUser',_0x58c5a0);logger[_0x77b8('0x22')](_0x77b8('0x20'),_0x58c5a0,JSON[_0x77b8('0x1c')](_0x46cdf5));_0x243a4f(_0x46cdf5);})[_0x77b8('0x1d')](function(_0x2bc82f){logger[_0x77b8('0x1e')](_0x77b8('0x20'),_0x2bc82f['message'],_0x58c5a0);_0x491424(_0x6ae879[_0x77b8('0x1e')](0x1f4,_0x2bc82f[_0x77b8('0x1f')]));});});};exports[_0x77b8('0x23')]=function(_0x424ec6){var _0x526891;return db['User']['find']({'where':_0x424ec6['options'][_0x77b8('0x14')]||{},'attributes':['id',_0x77b8('0x24'),'role','internal','interface']})[_0x77b8('0x1a')](function(_0x43a168){if(!_0x43a168){throw new Error(util['format'](_0x77b8('0x25'),_0x424ec6[_0x77b8('0x26')]['id']));}_0x526891=_0x43a168;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x526891['id']},'individualHooks':!![]});})[_0x77b8('0x1a')](function(){return db[_0x77b8('0x27')]['findAll']({'where':{'membername':_0x526891[_0x77b8('0x24')],'type':_0x77b8('0x28'),'exitAt':null}});})[_0x77b8('0x1a')](function(_0x25816b){if(_0x25816b&&_0x25816b[_0x77b8('0x29')]){var _0x549fb4=moment()[_0x77b8('0x2a')](_0x77b8('0x2b'));for(var _0x703d26=0x0,_0x528b30=_0x25816b[_0x77b8('0x29')];_0x703d26<_0x528b30;_0x703d26++){_0x25816b[_0x703d26][_0x77b8('0x2c')]({'exitAt':_0x549fb4});}}})[_0x77b8('0x1a')](function(){var _0x52d63b=[];var _0x2ba196=utils[_0x77b8('0x2d')]();_0x2ba196[_0x77b8('0x2e')](function(_0x5d70e6){_0x52d63b[_0x77b8('0x2f')]({'channel':_0x5d70e6,'membername':_0x526891[_0x77b8('0x24')],'interface':_[_0x77b8('0x30')](_0x526891['interface'])?util['format'](_0x77b8('0x31'),_0x526891['name']):_0x526891[_0x77b8('0x32')],'type':'PAUSE','enterAt':moment()[_0x77b8('0x2a')](_0x77b8('0x2b')),'data1':_0x424ec6[_0x77b8('0x33')]['type']||'DEFAULT\x20PAUSE','role':_0x526891[_0x77b8('0x34')],'internal':_0x526891['internal'],'uniqueid':_0x424ec6[_0x77b8('0x33')][_0x77b8('0x35')]||null});});return db[_0x77b8('0x27')][_0x77b8('0x36')](_0x52d63b,{'individualHooks':!![]});})[_0x77b8('0x1a')](function(){return _0x526891['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x424ec6[_0x77b8('0x33')][_0x77b8('0x37')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x77b8('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x4115ae){throw _0x4115ae;});};exports[_0x77b8('0x38')]=function(_0xf8c64f){return Promise[_0x77b8('0x39')]()[_0x77b8('0x1a')](function(){if(_0xf8c64f[_0x77b8('0x33')]['channel']&&!utils['isValidChannel'](_0xf8c64f[_0x77b8('0x33')]['channel'])){throw new Error(util[_0x77b8('0x2a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xf8c64f[_0x77b8('0x33')][_0x77b8('0x3a')]));}return db['User'][_0x77b8('0x3b')]({'where':_0xf8c64f[_0x77b8('0x12')][_0x77b8('0x14')]||{},'attributes':['id',_0x77b8('0x24'),_0x77b8('0x34'),_0x77b8('0x3c'),_0x77b8('0x32'),_0x77b8('0x3d'),_0x77b8('0x3e'),_0x77b8('0x3f'),'chatPause','faxPause',_0x77b8('0x40'),_0x77b8('0x41'),_0x77b8('0x42'),'pauseType',_0x77b8('0x43')]});})[_0x77b8('0x1a')](function(_0x20d5b3){if(!_0x20d5b3){throw new Error(util[_0x77b8('0x2a')](_0x77b8('0x25'),_0xf8c64f[_0x77b8('0x26')]['id']));}return _0x20d5b3[_0x77b8('0x44')](_0xf8c64f['body']['channel'],'system');})['catch'](function(_0x379381){throw _0x379381;});};exports['LogoutUser']=function(_0x4340b8){var _0x41ae8c=this;return new Promise(function(_0x369312,_0x33ba1c){var _0x34a725;return db[_0x77b8('0x10')][_0x77b8('0x3b')]({'where':_0x4340b8[_0x77b8('0x12')][_0x77b8('0x14')]||{},'attributes':['id',_0x77b8('0x24')]})[_0x77b8('0x1a')](function(_0x25c043){if(_0x25c043){_0x34a725=_0x25c043;return db[_0x77b8('0x45')][_0x77b8('0x46')]({'where':{'membername':_0x34a725[_0x77b8('0x24')]},'individualHooks':!![]});}})[_0x77b8('0x1a')](function(){if(_0x34a725){return db[_0x77b8('0x27')][_0x77b8('0x11')]({'where':{'membername':_0x34a725['name'],'exitAt':null}});}})[_0x77b8('0x1a')](function(_0x2a9fa5){if(_0x34a725){if(_0x2a9fa5&&_0x2a9fa5[_0x77b8('0x29')]){var _0x4ba471=[];_0x2a9fa5[_0x77b8('0x2e')](function(_0x88af17){_0x4ba471['push'](_0x88af17['update']({'exitAt':moment()[_0x77b8('0x2a')](_0x77b8('0x2b'))}));});return BPromise['all'](_0x4ba471);}}})[_0x77b8('0x1a')](function(){if(_0x34a725){return _0x34a725['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x77b8('0x1a')](function(_0x598e95){_0x369312(_0x598e95);})[_0x77b8('0x1d')](function(_0x5c849b){_0x33ba1c(_0x41ae8c[_0x77b8('0x1e')](0x1f4,_0x5c849b[_0x77b8('0x1f')]));});});};exports[_0x77b8('0x47')]=function(_0x491a30){var _0x174dc9=this;return new Promise(function(_0x1f817b,_0x414c7b){var _0x248365;var _0x1637b1;var _0x1b2f65;var _0x425f0d;return db[_0x77b8('0x10')][_0x77b8('0x3b')]({'where':_0x491a30[_0x77b8('0x12')][_0x77b8('0x14')]||{},'attributes':['id',_0x77b8('0x24'),_0x77b8('0x34'),_0x77b8('0x48'),_0x77b8('0x49'),'internal',_0x77b8('0x4a'),_0x77b8('0x32')]})[_0x77b8('0x1a')](function(_0x697eb1){if(_0x697eb1){_0x248365=_0x697eb1;_0x425f0d=_0x491a30[_0x77b8('0x33')]['interface']?_0x491a30['body'][_0x77b8('0x32')]:util['format'](_0x77b8('0x31'),_0x248365[_0x77b8('0x24')]);return db['User'][_0x77b8('0x4b')]({'where':{'role':_0x77b8('0x4c'),'online':!![],'id':{'$ne':_0x248365['id']}}});}})[_0x77b8('0x1a')](function(_0x5779c5){if(_0x5779c5){_0x1b2f65=_0x5779c5;return require(_0x77b8('0x4d'))['getLicense']();}})[_0x77b8('0x1a')](function(_0x3a3a4c){if(_0x3a3a4c&&_0x3a3a4c['agents']&&_0x1b2f65>=_0x3a3a4c[_0x77b8('0x4e')]){throw new Error(_0x77b8('0x4f'));}})['then'](function(){if(_0x248365){return db[_0x77b8('0x45')][_0x77b8('0x46')]({'where':{'membername':_0x248365[_0x77b8('0x24')]},'individualHooks':!![]});}})[_0x77b8('0x1a')](function(){if(_0x248365){return _0x248365[_0x77b8('0x50')]({'raw':!![]});}})[_0x77b8('0x1a')](function(_0x451c7f){if(_0x248365){if(_0x451c7f){var _0x421bfb=[];_0x1637b1=_0x451c7f;if(_0x1637b1[_0x77b8('0x29')]){for(var _0x3b8acf=0x0;_0x3b8acf<_0x1637b1[_0x77b8('0x29')];_0x3b8acf++){_0x421bfb[_0x77b8('0x2f')](db[_0x77b8('0x45')]['upsert']({'membername':_0x248365[_0x77b8('0x24')],'UserId':_0x248365['id'],'queue_name':_0x1637b1[_0x3b8acf][_0x77b8('0x24')],'VoiceQueueId':_0x1637b1[_0x3b8acf]['id'],'interface':_0x425f0d,'paused':_0x248365[_0x77b8('0x4a')]||![],'penalty':_0x1637b1[_0x3b8acf][_0x77b8('0x51')]||0x0}));}return BPromise['all'](_0x421bfb);}}}})[_0x77b8('0x1a')](function(){if(_0x248365){return db[_0x77b8('0x27')]['findAll']({'where':{'membername':_0x248365['name'],'exitAt':null}});}})[_0x77b8('0x1a')](function(_0x52220e){if(_0x248365){if(_0x52220e&&_0x52220e['length']){var _0x4d2a75=[];_0x52220e[_0x77b8('0x2e')](function(_0x5832d3){_0x4d2a75[_0x77b8('0x2f')](_0x5832d3[_0x77b8('0x52')]({'exitAt':moment()[_0x77b8('0x2a')](_0x77b8('0x2b'))}));});return BPromise[_0x77b8('0x53')](_0x4d2a75);}}})['then'](function(){if(_0x248365){var _0x16eac0=[];var _0x15c598=[];var _0x1aea3b=utils[_0x77b8('0x2d')]();var _0x3574f6={'membername':_0x248365['name'],'interface':_0x425f0d,'enterAt':moment()['format'](_0x77b8('0x2b')),'role':_0x248365['role'],'internal':_0x248365[_0x77b8('0x3c')]};_0x1aea3b[_0x77b8('0x2e')](function(_0x2cb8e0){_0x16eac0[_0x77b8('0x2f')](_[_0x77b8('0x54')]({'channel':_0x2cb8e0,'type':_0x77b8('0x55'),'data1':_0x77b8('0x56'),'data2':_0x425f0d},_0x3574f6));if(_0x248365[_0x77b8('0x4a')]){_0x15c598[_0x77b8('0x2f')](_[_0x77b8('0x54')]({'channel':_0x2cb8e0,'type':'PAUSE','data1':_0x77b8('0x57')},_0x3574f6));}});return db['MemberReport'][_0x77b8('0x36')](_0x16eac0[_0x77b8('0x58')](_0x15c598),{'individualHooks':!![]});}})[_0x77b8('0x1a')](function(){if(_0x248365){return _0x248365[_0x77b8('0x52')]({'online':!![],'lastLoginAt':moment()[_0x77b8('0x2a')](_0x77b8('0x2b')),'voicePause':_0x248365['loginInPause']||![],'mailPause':_0x248365['loginInPause']||![],'chatPause':_0x248365[_0x77b8('0x4a')]||![],'faxPause':_0x248365['loginInPause']||![],'smsPause':_0x248365[_0x77b8('0x4a')]||![],'openchannelPause':_0x248365[_0x77b8('0x4a')]||![],'pauseType':_0x248365[_0x77b8('0x4a')]?_0x77b8('0x57'):null,'lastPauseAt':moment()['format'](_0x77b8('0x2b')),'interface':_0x425f0d});}})[_0x77b8('0x1a')](function(_0x16bc2e){_0x1f817b(_0x16bc2e);})[_0x77b8('0x1d')](function(_0x27d01a){_0x414c7b(_0x174dc9[_0x77b8('0x1e')](0x1f4,_0x27d01a[_0x77b8('0x1f')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index add82ef..1c1aa20 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 _0x570c=['register','./user.events','remove','update','emit'];(function(_0x4e26b8,_0x1a3c12){var _0x10a6f0=function(_0x119948){while(--_0x119948){_0x4e26b8['push'](_0x4e26b8['shift']());}};_0x10a6f0(++_0x1a3c12);}(_0x570c,0xd3));var _0xc570=function(_0x3dcba4,_0x37dc6c){_0x3dcba4=_0x3dcba4-0x0;var _0x25bca3=_0x570c[_0x3dcba4];return _0x25bca3;};'use strict';var UserEvents=require(_0xc570('0x0'));var events=['save',_0xc570('0x1'),_0xc570('0x2')];function createListener(_0x1f8401,_0x37502b){return function(_0x22cc2c){_0x37502b[_0xc570('0x3')](_0x1f8401,_0x22cc2c);};}function removeListener(_0x2edba0,_0x52ae83){return function(){UserEvents['removeListener'](_0x2edba0,_0x52ae83);};}exports[_0xc570('0x4')]=function(_0x2da1f6){for(var _0x340390=0x0,_0x991d1b=events['length'];_0x340390<_0x991d1b;_0x340390++){var _0x54d595=events[_0x340390];var _0x3182cc=createListener('user:'+_0x54d595,_0x2da1f6);UserEvents['on'](_0x54d595,_0x3182cc);}}; \ No newline at end of file +var _0x348c=['emit','removeListener','register','user:','./user.events','remove'];(function(_0x48bea1,_0x5f124f){var _0x3628bf=function(_0x4ae26b){while(--_0x4ae26b){_0x48bea1['push'](_0x48bea1['shift']());}};_0x3628bf(++_0x5f124f);}(_0x348c,0xd6));var _0xc348=function(_0x5d9e90,_0xd0db6b){_0x5d9e90=_0x5d9e90-0x0;var _0x20651e=_0x348c[_0x5d9e90];return _0x20651e;};'use strict';var UserEvents=require(_0xc348('0x0'));var events=['save',_0xc348('0x1'),'update'];function createListener(_0x821cbe,_0x416bc5){return function(_0x52f52f){_0x416bc5[_0xc348('0x2')](_0x821cbe,_0x52f52f);};}function removeListener(_0x2b5ec,_0x590d2d){return function(){UserEvents[_0xc348('0x3')](_0x2b5ec,_0x590d2d);};}exports[_0xc348('0x4')]=function(_0x427de0){for(var _0x380161=0x0,_0x1c6ea8=events['length'];_0x380161<_0x1c6ea8;_0x380161++){var _0x2bad05=events[_0x380161];var _0x239461=createListener(_0xc348('0x5')+_0x2bad05,_0x427de0);UserEvents['on'](_0x2bad05,_0x239461);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 0e1e941..dbc6069 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4e085a,_0x5d7b89){var _0xc7b039=function(_0xa36574){while(--_0xa36574){_0x4e085a['push'](_0x4e085a['shift']());}};_0xc7b039(++_0x5d7b89);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0xcb91[_0x18e52b];return _0x3d3062;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x57d11b,_0x2a4299){var _0x63ad6e=function(_0x54b02d){while(--_0x54b02d){_0x57d11b['push'](_0x57d11b['shift']());}};_0x63ad6e(++_0x2a4299);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index f41dc75..4441587 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 _0xbccb=['INTEGER','sequelize','exports'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xbccb,0x157));var _0xbbcc=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0xbccb[_0x2e4cbf];return _0x52840f;};'use strict';var Sequelize=require(_0xbbcc('0x0'));module[_0xbbcc('0x1')]={'penalty':{'type':Sequelize[_0xbbcc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe4c0=['exports'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0xe4c0,0x1ca));var _0x0e4c=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0xe4c0[_0x5515a7];return _0x43f4bf;};'use strict';var Sequelize=require('sequelize');module[_0x0e4c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 53f97ce..a6f48b5 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 _0xf081=['moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','api'];(function(_0x44ebc5,_0x404253){var _0x59fe28=function(_0x236370){while(--_0x236370){_0x44ebc5['push'](_0x44ebc5['shift']());}};_0x59fe28(++_0x404253);}(_0xf081,0x12a));var _0x1f08=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xf081[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x1f08('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1f08('0x1'));var moment=require(_0x1f08('0x2'));var BPromise=require(_0x1f08('0x3'));var rp=require(_0x1f08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f08('0x5'));var config=require(_0x1f08('0x6'));var attributes=require(_0x1f08('0x7'));module[_0x1f08('0x8')]=function(_0x2971c5,_0x331d43){return _0x2971c5[_0x1f08('0x9')](_0x1f08('0xa'),attributes,{'tableName':_0x1f08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe614=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x58e4c4,_0x29efe8){var _0x4ff125=function(_0x5c712a){while(--_0x5c712a){_0x58e4c4['push'](_0x58e4c4['shift']());}};_0x4ff125(++_0x29efe8);}(_0xe614,0xd2));var _0x4e61=function(_0x30cf5e,_0x27d666){_0x30cf5e=_0x30cf5e-0x0;var _0x64e361=_0xe614[_0x30cf5e];return _0x64e361;};'use strict';var _=require(_0x4e61('0x0'));var util=require(_0x4e61('0x1'));var logger=require(_0x4e61('0x2'))('api');var moment=require(_0x4e61('0x3'));var BPromise=require(_0x4e61('0x4'));var rp=require(_0x4e61('0x5'));var fs=require('fs');var path=require(_0x4e61('0x6'));var rimraf=require(_0x4e61('0x7'));var config=require(_0x4e61('0x8'));var attributes=require(_0x4e61('0x9'));module[_0x4e61('0xa')]=function(_0x4b0c83,_0x42c9ac){return _0x4b0c83[_0x4e61('0xb')](_0x4e61('0xc'),attributes,{'tableName':_0x4e61('0xd'),'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 134f68e..ec46ea4 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 _0x41d4=['request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x41d4,0x170));var _0x441d=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0x41d4[_0x500785];return _0x1f8bcc;};'use strict';var _=require(_0x441d('0x0'));var util=require(_0x441d('0x1'));var moment=require('moment');var BPromise=require(_0x441d('0x2'));var rs=require(_0x441d('0x3'));var fs=require('fs');var Redis=require(_0x441d('0x4'));var db=require(_0x441d('0x5'))['db'];var utils=require(_0x441d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x441d('0x7'));var jayson=require(_0x441d('0x8'));var client=jayson[_0x441d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34f854,_0x202549,_0x12f85f){return new BPromise(function(_0x198a14,_0x3cdf11){return client[_0x441d('0xa')](_0x34f854,_0x12f85f)[_0x441d('0xb')](function(_0x1e2b1e){logger[_0x441d('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x202549,_0x441d('0xd'));logger[_0x441d('0xe')](_0x441d('0xf'),_0x202549,_0x441d('0xd'),JSON[_0x441d('0x10')](_0x1e2b1e));if(_0x1e2b1e[_0x441d('0x11')]){if(_0x1e2b1e['error'][_0x441d('0x12')]===0x1f4){logger[_0x441d('0x11')](_0x441d('0x13'),_0x202549,_0x1e2b1e[_0x441d('0x11')][_0x441d('0x14')]);return _0x3cdf11(_0x1e2b1e['error'][_0x441d('0x14')]);}logger[_0x441d('0x11')](_0x441d('0x13'),_0x202549,_0x1e2b1e['error']['message']);return _0x198a14(_0x1e2b1e[_0x441d('0x11')][_0x441d('0x14')]);}else{logger['info'](_0x441d('0x13'),_0x202549,'request\x20sent');_0x198a14(_0x1e2b1e['result'][_0x441d('0x14')]);}})['catch'](function(_0x225aa3){logger[_0x441d('0x11')](_0x441d('0x13'),_0x202549,_0x225aa3);_0x3cdf11(_0x225aa3);});});} \ No newline at end of file +var _0x77f5=['code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2d0fff,_0x128adc){var _0x40c5b1=function(_0x2bbb86){while(--_0x2bbb86){_0x2d0fff['push'](_0x2d0fff['shift']());}};_0x40c5b1(++_0x128adc);}(_0x77f5,0xae));var _0x577f=function(_0x1e5017,_0x652070){_0x1e5017=_0x1e5017-0x0;var _0x56e3bd=_0x77f5[_0x1e5017];return _0x56e3bd;};'use strict';var _=require('lodash');var util=require(_0x577f('0x0'));var moment=require('moment');var BPromise=require(_0x577f('0x1'));var rs=require(_0x577f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x577f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x577f('0x4'))(_0x577f('0x5'));var config=require(_0x577f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x577f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5561a0,_0x2cea82,_0xed71b9){return new BPromise(function(_0x110ac8,_0x21253b){return client[_0x577f('0x8')](_0x5561a0,_0xed71b9)[_0x577f('0x9')](function(_0x102310){logger[_0x577f('0xa')](_0x577f('0xb'),_0x2cea82,_0x577f('0xc'));logger['debug'](_0x577f('0xd'),_0x2cea82,_0x577f('0xc'),JSON[_0x577f('0xe')](_0x102310));if(_0x102310[_0x577f('0xf')]){if(_0x102310[_0x577f('0xf')][_0x577f('0x10')]===0x1f4){logger[_0x577f('0xf')](_0x577f('0xb'),_0x2cea82,_0x102310[_0x577f('0xf')][_0x577f('0x11')]);return _0x21253b(_0x102310[_0x577f('0xf')][_0x577f('0x11')]);}logger['error'](_0x577f('0xb'),_0x2cea82,_0x102310['error']['message']);return _0x110ac8(_0x102310[_0x577f('0xf')][_0x577f('0x11')]);}else{logger[_0x577f('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x2cea82,_0x577f('0xc'));_0x110ac8(_0x102310['result'][_0x577f('0x11')]);}})[_0x577f('0x12')](function(_0x253692){logger['error'](_0x577f('0xb'),_0x2cea82,_0x253692);_0x21253b(_0x253692);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 054bfa5..1bce770 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2713d5,_0x2dde3a){var _0x2d224a=function(_0x115494){while(--_0x115494){_0x2713d5['push'](_0x2713d5['shift']());}};_0x2d224a(++_0x2dde3a);}(_0xe706,0xa3));var _0x6e70=function(_0x5bef0a,_0x1fb747){_0x5bef0a=_0x5bef0a-0x0;var _0x1a02ea=_0xe706[_0x5bef0a];return _0x1a02ea;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x50b854,_0x37d8ba){var _0x2c30c4=function(_0x328bef){while(--_0x328bef){_0x50b854['push'](_0x50b854['shift']());}};_0x2c30c4(++_0x37d8ba);}(_0xe706,0xa3));var _0x6e70=function(_0x173fdf,_0x1ba573){_0x173fdf=_0x173fdf-0x0;var _0x147b6d=_0xe706[_0x173fdf];return _0x147b6d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 6510c6a..059901a 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 _0x27bf=['sequelize','exports','INTEGER','STRING'];(function(_0x185941,_0x5d2a50){var _0x1fa2f3=function(_0xf1f827){while(--_0xf1f827){_0x185941['push'](_0x185941['shift']());}};_0x1fa2f3(++_0x5d2a50);}(_0x27bf,0x17c));var _0xf27b=function(_0x44ccd7,_0x7a180b){_0x44ccd7=_0x44ccd7-0x0;var _0x2c86e7=_0x27bf[_0x44ccd7];return _0x2c86e7;};'use strict';var Sequelize=require(_0xf27b('0x0'));module[_0xf27b('0x1')]={'penalty':{'type':Sequelize[_0xf27b('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf27b('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf27b('0x3')]}}; \ No newline at end of file +var _0xbecb=['INTEGER','STRING'];(function(_0x5c9fbf,_0x2a3ae3){var _0x2e6678=function(_0x298e4b){while(--_0x298e4b){_0x5c9fbf['push'](_0x5c9fbf['shift']());}};_0x2e6678(++_0x2a3ae3);}(_0xbecb,0x14c));var _0xbbec=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xbecb[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xbbec('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xbbec('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 046eaa7..173ec1d 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 _0xadf2=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x28d2b2,_0x3b3e62){var _0x78a471=function(_0x25cea2){while(--_0x25cea2){_0x28d2b2['push'](_0x28d2b2['shift']());}};_0x78a471(++_0x3b3e62);}(_0xadf2,0x19d));var _0x2adf=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xadf2[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x2adf('0x0'));var util=require(_0x2adf('0x1'));var logger=require(_0x2adf('0x2'))(_0x2adf('0x3'));var moment=require(_0x2adf('0x4'));var BPromise=require(_0x2adf('0x5'));var rp=require(_0x2adf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2adf('0x7'));var config=require(_0x2adf('0x8'));var attributes=require(_0x2adf('0x9'));module[_0x2adf('0xa')]=function(_0x34dc48,_0x2d8b08){return _0x34dc48[_0x2adf('0xb')]('UserFaxQueue',attributes,{'tableName':_0x2adf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x525b=['UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x525b,0x12d));var _0xb525=function(_0xdbdb5f,_0x10f18b){_0xdbdb5f=_0xdbdb5f-0x0;var _0x4dfa9d=_0x525b[_0xdbdb5f];return _0x4dfa9d;};'use strict';var _=require(_0xb525('0x0'));var util=require(_0xb525('0x1'));var logger=require(_0xb525('0x2'))(_0xb525('0x3'));var moment=require(_0xb525('0x4'));var BPromise=require(_0xb525('0x5'));var rp=require(_0xb525('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb525('0x7'));var config=require(_0xb525('0x8'));var attributes=require(_0xb525('0x9'));module[_0xb525('0xa')]=function(_0x469750,_0x3bd374){return _0x469750['define'](_0xb525('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index c089732..4200ddf 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 _0xc005=['info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc005,0x170));var _0x5c00=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xc005[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c00('0x0'));var BPromise=require(_0x5c00('0x1'));var rs=require(_0x5c00('0x2'));var fs=require('fs');var Redis=require(_0x5c00('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c00('0x4'));var logger=require(_0x5c00('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5c00('0x6'));var client=jayson[_0x5c00('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf4f53d,_0x2bb064,_0x556e9e){return new BPromise(function(_0x2bbf55,_0x5b239f){return client[_0x5c00('0x8')](_0xf4f53d,_0x556e9e)[_0x5c00('0x9')](function(_0x45cdb4){logger[_0x5c00('0xa')](_0x5c00('0xb'),_0x2bb064,'request\x20sent');logger['debug'](_0x5c00('0xc'),_0x2bb064,_0x5c00('0xd'),JSON[_0x5c00('0xe')](_0x45cdb4));if(_0x45cdb4[_0x5c00('0xf')]){if(_0x45cdb4[_0x5c00('0xf')][_0x5c00('0x10')]===0x1f4){logger[_0x5c00('0xf')](_0x5c00('0xb'),_0x2bb064,_0x45cdb4[_0x5c00('0xf')]['message']);return _0x5b239f(_0x45cdb4[_0x5c00('0xf')][_0x5c00('0x11')]);}logger[_0x5c00('0xf')](_0x5c00('0xb'),_0x2bb064,_0x45cdb4['error']['message']);return _0x2bbf55(_0x45cdb4[_0x5c00('0xf')][_0x5c00('0x11')]);}else{logger[_0x5c00('0xa')](_0x5c00('0xb'),_0x2bb064,_0x5c00('0xd'));_0x2bbf55(_0x45cdb4['result']['message']);}})['catch'](function(_0x1cc838){logger[_0x5c00('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x2bb064,_0x1cc838);_0x5b239f(_0x1cc838);});});} \ No newline at end of file +var _0xa15a=['request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xa15a,0x160));var _0xaa15=function(_0x451650,_0x3b2028){_0x451650=_0x451650-0x0;var _0x47c984=_0xa15a[_0x451650];return _0x47c984;};'use strict';var _=require('lodash');var util=require(_0xaa15('0x0'));var moment=require('moment');var BPromise=require(_0xaa15('0x1'));var rs=require(_0xaa15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa15('0x3'));var logger=require('../../config/logger')(_0xaa15('0x4'));var config=require(_0xaa15('0x5'));var jayson=require(_0xaa15('0x6'));var client=jayson[_0xaa15('0x7')][_0xaa15('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cb4f1,_0x4c14a0,_0x31dfd9){return new BPromise(function(_0x2f71bd,_0x1f78ca){return client[_0xaa15('0x9')](_0x5cb4f1,_0x31dfd9)[_0xaa15('0xa')](function(_0x274338){logger[_0xaa15('0xb')](_0xaa15('0xc'),_0x4c14a0,_0xaa15('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4c14a0,'request\x20sent',JSON['stringify'](_0x274338));if(_0x274338[_0xaa15('0xe')]){if(_0x274338[_0xaa15('0xe')][_0xaa15('0xf')]===0x1f4){logger[_0xaa15('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4c14a0,_0x274338[_0xaa15('0xe')][_0xaa15('0x10')]);return _0x1f78ca(_0x274338[_0xaa15('0xe')][_0xaa15('0x10')]);}logger[_0xaa15('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4c14a0,_0x274338[_0xaa15('0xe')][_0xaa15('0x10')]);return _0x2f71bd(_0x274338['error'][_0xaa15('0x10')]);}else{logger[_0xaa15('0xb')](_0xaa15('0xc'),_0x4c14a0,_0xaa15('0xd'));_0x2f71bd(_0x274338[_0xaa15('0x11')][_0xaa15('0x10')]);}})[_0xaa15('0x12')](function(_0x26201b){logger[_0xaa15('0xe')](_0xaa15('0xc'),_0x4c14a0,_0x26201b);_0x1f78ca(_0x26201b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8570521..1bbdc46 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xa16ef8,_0x40cc48){var _0x40ab63=function(_0x2fb788){while(--_0x2fb788){_0xa16ef8['push'](_0xa16ef8['shift']());}};_0x40ab63(++_0x40cc48);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x701c5d,_0x47a566){var _0x617b08=function(_0x41409f){while(--_0x41409f){_0x701c5d['push'](_0x701c5d['shift']());}};_0x617b08(++_0x47a566);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index d3f31a4..43e2ec8 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 _0x4dd1=['sequelize','INTEGER'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x4dd1,0xb0));var _0x14dd=function(_0x53c373,_0x26bec3){_0x53c373=_0x53c373-0x0;var _0x1b8961=_0x4dd1[_0x53c373];return _0x1b8961;};'use strict';var Sequelize=require(_0x14dd('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x14dd('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd943=['sequelize','exports','INTEGER'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd943,0x14a));var _0x3d94=function(_0x289f13,_0x584981){_0x289f13=_0x289f13-0x0;var _0x39fa0a=_0xd943[_0x289f13];return _0x39fa0a;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'penalty':{'type':Sequelize[_0x3d94('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index f306319..a148353 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 _0xbeb3=['bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','lodash','util','api','moment'];(function(_0x17fb9e,_0x3c3ff0){var _0x7ce22a=function(_0x270007){while(--_0x270007){_0x17fb9e['push'](_0x17fb9e['shift']());}};_0x7ce22a(++_0x3c3ff0);}(_0xbeb3,0xd4));var _0x3beb=function(_0x2ba9ac,_0xa1fdc4){_0x2ba9ac=_0x2ba9ac-0x0;var _0x1b0fc9=_0xbeb3[_0x2ba9ac];return _0x1b0fc9;};'use strict';var _=require(_0x3beb('0x0'));var util=require(_0x3beb('0x1'));var logger=require('../../config/logger')(_0x3beb('0x2'));var moment=require(_0x3beb('0x3'));var BPromise=require(_0x3beb('0x4'));var rp=require(_0x3beb('0x5'));var fs=require('fs');var path=require(_0x3beb('0x6'));var rimraf=require(_0x3beb('0x7'));var config=require(_0x3beb('0x8'));var attributes=require(_0x3beb('0x9'));module['exports']=function(_0x47a9e6,_0x1cdaa2){return _0x47a9e6['define'](_0x3beb('0xa'),attributes,{'tableName':_0x3beb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5cb=['path','rimraf','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13fbbe,_0x255069){var _0x39fa58=function(_0x4406c0){while(--_0x4406c0){_0x13fbbe['push'](_0x13fbbe['shift']());}};_0x39fa58(++_0x255069);}(_0xb5cb,0x1cd));var _0xbb5c=function(_0x576757,_0x175ba6){_0x576757=_0x576757-0x0;var _0x7b4412=_0xb5cb[_0x576757];return _0x7b4412;};'use strict';var _=require(_0xbb5c('0x0'));var util=require(_0xbb5c('0x1'));var logger=require(_0xbb5c('0x2'))(_0xbb5c('0x3'));var moment=require(_0xbb5c('0x4'));var BPromise=require(_0xbb5c('0x5'));var rp=require(_0xbb5c('0x6'));var fs=require('fs');var path=require(_0xbb5c('0x7'));var rimraf=require(_0xbb5c('0x8'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xbb5c('0x9')]=function(_0x5c48db,_0x2942b7){return _0x5c48db[_0xbb5c('0xa')](_0xbb5c('0xb'),attributes,{'tableName':_0xbb5c('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 2a324b6..e060a15 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1aa6e8,_0x20a35e){var _0x1d39e3=function(_0x2daf19){while(--_0x2daf19){_0x1aa6e8['push'](_0x1aa6e8['shift']());}};_0x1d39e3(++_0x20a35e);}(_0xa41a,0x6b));var _0xaa41=function(_0x454650,_0x399ede){_0x454650=_0x454650-0x0;var _0x5cfdfc=_0xa41a[_0x454650];return _0x5cfdfc;};'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);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3d2821,_0x4f777f){var _0x791c2c=function(_0x7c3f15){while(--_0x7c3f15){_0x3d2821['push'](_0x3d2821['shift']());}};_0x791c2c(++_0x4f777f);}(_0x8ef6,0xf2));var _0x68ef=function(_0x296f8d,_0x1f7a9a){_0x296f8d=_0x296f8d-0x0;var _0x19c6aa=_0x8ef6[_0x296f8d];return _0x19c6aa;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index edbf225..9e65e05 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 _0x4e16=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification'];(function(_0x5dfbac,_0x4d926a){var _0x21ea84=function(_0x4b41d3){while(--_0x4b41d3){_0x5dfbac['push'](_0x5dfbac['shift']());}};_0x21ea84(++_0x4d926a);}(_0x4e16,0x180));var _0x64e1=function(_0x88d72b,_0x161055){_0x88d72b=_0x88d72b-0x0;var _0x15a298=_0x4e16[_0x88d72b];return _0x15a298;};'use strict';var multer=require(_0x64e1('0x0'));var util=require(_0x64e1('0x1'));var path=require(_0x64e1('0x2'));var timeout=require(_0x64e1('0x3'));var express=require('express');var router=express[_0x64e1('0x4')]();var fs_extra=require(_0x64e1('0x5'));var auth=require(_0x64e1('0x6'));var interaction=require(_0x64e1('0x7'));var config=require(_0x64e1('0x8'));var controller=require(_0x64e1('0x9'));router[_0x64e1('0xa')]('/',auth['isAuthenticated'](),controller[_0x64e1('0xb')]);module['exports']=router; \ No newline at end of file +var _0x9c54=['../../components/interaction/service','post','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xfc8faf,_0x86244a){var _0x48c40b=function(_0x107c22){while(--_0x107c22){_0xfc8faf['push'](_0xfc8faf['shift']());}};_0x48c40b(++_0x86244a);}(_0x9c54,0x14a));var _0x49c5=function(_0x2d2236,_0xa04eee){_0x2d2236=_0x2d2236-0x0;var _0x7eb261=_0x9c54[_0x2d2236];return _0x7eb261;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c5('0x0'));var timeout=require(_0x49c5('0x1'));var express=require(_0x49c5('0x2'));var router=express[_0x49c5('0x3')]();var fs_extra=require(_0x49c5('0x4'));var auth=require(_0x49c5('0x5'));var interaction=require(_0x49c5('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x49c5('0x7')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 010465f..ac10490 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 _0x7fed=['sequelize','BOOLEAN'];(function(_0x387ec2,_0xd1fc9b){var _0x50f581=function(_0x3098b4){while(--_0x3098b4){_0x387ec2['push'](_0x387ec2['shift']());}};_0x50f581(++_0xd1fc9b);}(_0x7fed,0x1a8));var _0xd7fe=function(_0x38a6d7,_0x8fd624){_0x38a6d7=_0x38a6d7-0x0;var _0x951006=_0x7fed[_0x38a6d7];return _0x951006;};'use strict';var Sequelize=require(_0xd7fe('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xd7fe('0x1')]}}; \ No newline at end of file +var _0xf4dd=['STRING','TEXT','BOOLEAN','exports'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xf4dd,0x16f));var _0xdf4d=function(_0x3bd233,_0x2674d7){_0x3bd233=_0x3bd233-0x0;var _0x26c36a=_0xf4dd[_0x3bd233];return _0x26c36a;};'use strict';var Sequelize=require('sequelize');module[_0xdf4d('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xdf4d('0x1')]},'recipientsId':{'type':Sequelize[_0xdf4d('0x2')]},'recipientsDescription':{'type':Sequelize[_0xdf4d('0x1')]},'beep':{'type':Sequelize[_0xdf4d('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 46136d8..f9f0182 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 _0xac6f=['Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','text','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','model','User','union','ids','queue','replace','Queue','push','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','toLowerCase'];(function(_0x1d3490,_0xc570ce){var _0x2eb33b=function(_0x310c2e){while(--_0x310c2e){_0x1d3490['push'](_0x1d3490['shift']());}};_0x2eb33b(++_0xc570ce);}(_0xac6f,0x1ec));var _0xfac6=function(_0xb68695,_0x1881a4){_0xb68695=_0xb68695-0x0;var _0x15a817=_0xac6f[_0xb68695];return _0x15a817;};'use strict';var emlformat=require(_0xfac6('0x0'));var rimraf=require(_0xfac6('0x1'));var zipdir=require(_0xfac6('0x2'));var jsonpatch=require(_0xfac6('0x3'));var rp=require(_0xfac6('0x4'));var moment=require(_0xfac6('0x5'));var BPromise=require(_0xfac6('0x6'));var Mustache=require(_0xfac6('0x7'));var util=require(_0xfac6('0x8'));var path=require(_0xfac6('0x9'));var sox=require('sox');var csv=require(_0xfac6('0xa'));var ejs=require(_0xfac6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfac6('0xc'));var squel=require(_0xfac6('0xd'));var crypto=require('crypto');var jsforce=require(_0xfac6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfac6('0xa'));var querystring=require('querystring');var Papa=require(_0xfac6('0xf'));var Redis=require(_0xfac6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfac6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xfac6('0x12'));var config=require(_0xfac6('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfac6('0x14')]=_[_0xfac6('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfac6('0x16'))(new Redis(config[_0xfac6('0x14')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0xe809c6,_0x29d8e4){_0x29d8e4=_0x29d8e4||0xcc;return function(_0x3320da){if(_0x3320da){return _0xe809c6[_0xfac6('0x17')](_0x29d8e4);}return _0xe809c6[_0xfac6('0x18')](_0x29d8e4)['end']();};}function respondWithResult(_0x3ac979,_0xf7faad){_0xf7faad=_0xf7faad||0xc8;return function(_0x5a6493){if(_0x5a6493){return _0x3ac979[_0xfac6('0x18')](_0xf7faad)['json'](_0x5a6493);}};}function respondWithFilteredResult(_0x319ec0,_0xefffd5){return function(_0x4a999d){if(_0x4a999d){var _0x2f1189=typeof _0xefffd5[_0xfac6('0x19')]===_0xfac6('0x1a')&&typeof _0xefffd5[_0xfac6('0x1b')]===_0xfac6('0x1a');var _0xd15af=_0x4a999d[_0xfac6('0x1c')];var _0x322823=_0x2f1189?0x0:_0xefffd5[_0xfac6('0x19')];var _0x310ce3=_0x2f1189?_0x4a999d[_0xfac6('0x1c')]:_0xefffd5[_0xfac6('0x19')]+_0xefffd5[_0xfac6('0x1b')];var _0x250d56;if(_0x310ce3>=_0xd15af){_0x310ce3=_0xd15af;_0x250d56=0xc8;}else{_0x250d56=0xce;}_0x319ec0[_0xfac6('0x18')](_0x250d56);return _0x319ec0['set'](_0xfac6('0x1d'),_0x322823+'-'+_0x310ce3+'/'+_0xd15af)['json'](_0x4a999d);}return null;};}function patchUpdates(_0x4ae645){return function(_0x3ba3cd){try{jsonpatch[_0xfac6('0x1e')](_0x3ba3cd,_0x4ae645,!![]);}catch(_0x4ff05f){return BPromise[_0xfac6('0x1f')](_0x4ff05f);}return _0x3ba3cd[_0xfac6('0x20')]();};}function saveUpdates(_0x4a8c2a,_0x55ebef){return function(_0x5258b7){if(_0x5258b7){return _0x5258b7['update'](_0x4a8c2a)[_0xfac6('0x21')](function(_0x2ca8c8){return _0x2ca8c8;});}return null;};}function removeEntity(_0x419f25,_0x35d3d8){return function(_0x33d1d2){if(_0x33d1d2){return _0x33d1d2[_0xfac6('0x22')]()[_0xfac6('0x21')](function(){_0x419f25[_0xfac6('0x18')](0xcc)[_0xfac6('0x23')]();});}};}function handleEntityNotFound(_0x505b80,_0x55e052){return function(_0x4b7974){if(!_0x4b7974){_0x505b80[_0xfac6('0x17')](0x194);}return _0x4b7974;};}function handleError(_0xea727,_0x5246b5){_0x5246b5=_0x5246b5||0x1f4;return function(_0x24772d){logger['error'](_0x24772d['stack']);if(_0x24772d['name']){delete _0x24772d[_0xfac6('0x24')];}_0xea727[_0xfac6('0x18')](_0x5246b5)[_0xfac6('0x25')](_0x24772d);};}exports[_0xfac6('0x26')]=function(_0x5a5e18,_0xd47d0a,_0x5951a8){if(!_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x28')]('text')&&!_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x28')](_0xfac6('0x29'))){throw new db['Sequelize'][(_0xfac6('0x2a'))](_0xfac6('0x2b'));}else{if(_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x28')](_0xfac6('0x29'))&&!_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x28')](_0xfac6('0x2c'))){throw new db[(_0xfac6('0x2d'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x28')](_0xfac6('0x2e'))){throw new db[(_0xfac6('0x2d'))][(_0xfac6('0x2a'))](_0xfac6('0x2f'));}else{try{var _0x13c7d7=JSON[_0xfac6('0x30')](_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x2e')]);}catch(_0x4109c4){logger[_0xfac6('0x31')](_0x4109c4);throw new db[(_0xfac6('0x2d'))][(_0xfac6('0x2a'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x379081=[_0xfac6('0x32'),_0xfac6('0x33'),_0xfac6('0x34'),'openchannelqueue',_0xfac6('0x35'),_0xfac6('0x36'),_0xfac6('0x37'),'team',_0xfac6('0x38')];if(_[_0xfac6('0x39')](_0x13c7d7,function(_0xaa0eed){return!_[_0xfac6('0x3a')](_0x379081,_0xaa0eed['model'][_0xfac6('0x3b')]());})){throw new db[(_0xfac6('0x2d'))][(_0xfac6('0x2a'))](_0xfac6('0x3c'));}}}var _0x221b48={};_0x221b48['senderName']=_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x28')](_0xfac6('0x3d'))?_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x3d')]:_0x5a5e18[_0xfac6('0x38')][_0xfac6('0x3e')];_0x221b48[_0xfac6('0x3f')]=_[_0xfac6('0x40')](_0x5a5e18[_0xfac6('0x27')][_0xfac6('0x3f')])?null:_0x5a5e18[_0xfac6('0x27')]['recipientsDescription'];_0x221b48[_0xfac6('0x41')]=_0x5a5e18[_0xfac6('0x27')]['beep']||![];_0x221b48[_0xfac6('0x42')]=_0x5a5e18[_0xfac6('0x38')]['id'];return getContent(_0x5a5e18['body'])[_0xfac6('0x21')](function(_0x354979){_0x221b48['body']=_0x354979;return getRecipients(_0x13c7d7);})[_0xfac6('0x21')](function(_0x3165b7){_0x221b48[_0xfac6('0x43')]=_['sortBy'](_0x3165b7)['join'](',');return db[_0xfac6('0x44')][_0xfac6('0x45')](function(_0x5aca6a){return db[_0xfac6('0x46')]['create'](_0x221b48,{'raw':!![],'transaction':_0x5aca6a})[_0xfac6('0x21')](function(_0x1c0f79){var _0x5d6314={'sender':_0x221b48[_0xfac6('0x3d')],'description':_0x221b48[_0xfac6('0x3f')],'content':_0x221b48[_0xfac6('0x27')],'beep':_0x221b48[_0xfac6('0x41')]};_0x3165b7[_0xfac6('0x47')](function(_0x2f0e5d){_0x5d6314[_0xfac6('0x48')]=_0x2f0e5d;socket[_0xfac6('0x49')](_0xfac6('0x4a'),_0x5d6314);});return _0x1c0f79;});});})[_0xfac6('0x21')](respondWithResult(_0xd47d0a,0xc9))[_0xfac6('0x4b')](handleError(_0xd47d0a,null));};function getContent(_0x33ec6d){return new BPromise(function(_0x38d69f,_0x246c22){if(_0x33ec6d[_0xfac6('0x4c')]){_0x38d69f(_0x33ec6d[_0xfac6('0x4c')]);return;}return db[_0xfac6('0x4d')]['findOne']({'attributes':['html'],'where':{'id':_0x33ec6d['TemplateId']},'raw':!![]})['then'](function(_0x40b037){if(!_0x40b037)throw new db[(_0xfac6('0x2d'))][(_0xfac6('0x2a'))](_0xfac6('0x4e'));var _0x337f14=Mustache[_0xfac6('0x4f')](_0x40b037[_0xfac6('0x50')],_0x33ec6d[_0xfac6('0x2c')]);_0x38d69f(_0x337f14);})[_0xfac6('0x4b')](function(_0x3df6d5){_0x246c22(_0x3df6d5);});});}function getRecipients(_0x245099){return new BPromise(function(_0x4cd5d8,_0x34d955){var _0x51ce60=[];var _0x40e7e6=[];_0x245099[_0xfac6('0x47')](function(_0x519b4b){var _0xfe2b16=_['startCase'](_0x519b4b[_0xfac6('0x51')]['toLowerCase']());if(_0xfe2b16===_0xfac6('0x52')){_0x51ce60=_[_0xfac6('0x53')](_0x51ce60,_0x519b4b[_0xfac6('0x54')]);}else{if(_[_0xfac6('0x3a')](_0xfe2b16,_0xfac6('0x55')))_0xfe2b16=_0xfe2b16[_0xfac6('0x56')](_0xfac6('0x55'),_0xfac6('0x57'));_0x519b4b['ids']['forEach'](function(_0x7ee6b5){_0x40e7e6[_0xfac6('0x58')](getAgents(_0xfe2b16,_0x7ee6b5));});}});return BPromise['all'](_0x40e7e6)[_0xfac6('0x21')](function(_0x4d75c7){_0x51ce60=_[_0xfac6('0x53')](_0x51ce60,_['flatten'](_0x4d75c7));_0x4cd5d8(_0x51ce60);})[_0xfac6('0x4b')](function(_0x54527d){_0x34d955(_0x54527d);});});}function getAgents(_0x1a92b1,_0x3de1be){return new BPromise(function(_0x4e1c63,_0x25c233){return db[_0x1a92b1][_0xfac6('0x59')]({'where':{'id':_0x3de1be}})['then'](function(_0x977f84){return _0x977f84[_0xfac6('0x5a')]({'attributes':['id'],'raw':!![]})['then'](function(_0xba5d77){var _0x3ef81a=_[_0xfac6('0x5b')](_0xba5d77,'id');_0x4e1c63(_0x3ef81a);});})[_0xfac6('0x4b')](function(_0x12be75){_0x25c233(_0x12be75);});});} \ No newline at end of file +var _0x977e=['ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','Sequelize','Missing\x20\x27recipients\x27\x20parameter','recipients','chatqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','transaction','UserNotification','forEach','recipient','userNotification:send','catch','Template','findOne','render','startCase','ids','queue','Queue','flatten','map','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv'];(function(_0x3c3a2e,_0x1c91a6){var _0x20bd91=function(_0x5f5bc0){while(--_0x5f5bc0){_0x3c3a2e['push'](_0x3c3a2e['shift']());}};_0x20bd91(++_0x1c91a6);}(_0x977e,0x1b0));var _0xe977=function(_0x376968,_0x13b18c){_0x376968=_0x376968-0x0;var _0x4249e6=_0x977e[_0x376968];return _0x4249e6;};'use strict';var emlformat=require(_0xe977('0x0'));var rimraf=require(_0xe977('0x1'));var zipdir=require(_0xe977('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe977('0x3'));var moment=require('moment');var BPromise=require(_0xe977('0x4'));var Mustache=require(_0xe977('0x5'));var util=require('util');var path=require(_0xe977('0x6'));var sox=require('sox');var csv=require(_0xe977('0x7'));var ejs=require(_0xe977('0x8'));var fs=require('fs');var fs_extra=require(_0xe977('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe977('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe977('0xb'));var toCsv=require(_0xe977('0x7'));var querystring=require(_0xe977('0xc'));var Papa=require(_0xe977('0xd'));var Redis=require('ioredis');var authService=require(_0xe977('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe977('0xf'));var hardwareService=require(_0xe977('0x10'));var logger=require(_0xe977('0x11'))(_0xe977('0x12'));var utils=require('../../config/utils');var config=require(_0xe977('0x13'));var licenseUtil=require(_0xe977('0x14'));var db=require('../../mysqldb')['db'];config[_0xe977('0x15')]=_[_0xe977('0x16')](config['redis'],{'host':_0xe977('0x17'),'port':0x18eb});var socket=require(_0xe977('0x18'))(new Redis(config[_0xe977('0x15')]));require('./userNotification.socket')[_0xe977('0x19')](socket);function respondWithStatusCode(_0x4d9120,_0x2dd65b){_0x2dd65b=_0x2dd65b||0xcc;return function(_0x27fd54){if(_0x27fd54){return _0x4d9120[_0xe977('0x1a')](_0x2dd65b);}return _0x4d9120['status'](_0x2dd65b)[_0xe977('0x1b')]();};}function respondWithResult(_0x33d4ce,_0x12a884){_0x12a884=_0x12a884||0xc8;return function(_0x59c555){if(_0x59c555){return _0x33d4ce[_0xe977('0x1c')](_0x12a884)[_0xe977('0x1d')](_0x59c555);}};}function respondWithFilteredResult(_0x168602,_0x5e435f){return function(_0x4dd851){if(_0x4dd851){var _0x43f060=typeof _0x5e435f[_0xe977('0x1e')]===_0xe977('0x1f')&&typeof _0x5e435f[_0xe977('0x20')]===_0xe977('0x1f');var _0x343164=_0x4dd851[_0xe977('0x21')];var _0x32ec8f=_0x43f060?0x0:_0x5e435f[_0xe977('0x1e')];var _0x3b2054=_0x43f060?_0x4dd851['count']:_0x5e435f['offset']+_0x5e435f['limit'];var _0x50fe79;if(_0x3b2054>=_0x343164){_0x3b2054=_0x343164;_0x50fe79=0xc8;}else{_0x50fe79=0xce;}_0x168602['status'](_0x50fe79);return _0x168602[_0xe977('0x22')](_0xe977('0x23'),_0x32ec8f+'-'+_0x3b2054+'/'+_0x343164)[_0xe977('0x1d')](_0x4dd851);}return null;};}function patchUpdates(_0x2ecce2){return function(_0x4c499b){try{jsonpatch[_0xe977('0x24')](_0x4c499b,_0x2ecce2,!![]);}catch(_0x451ca1){return BPromise[_0xe977('0x25')](_0x451ca1);}return _0x4c499b[_0xe977('0x26')]();};}function saveUpdates(_0x26571f,_0xe4f2f0){return function(_0x366b1f){if(_0x366b1f){return _0x366b1f['update'](_0x26571f)[_0xe977('0x27')](function(_0x3e19f3){return _0x3e19f3;});}return null;};}function removeEntity(_0x57ac90,_0x1cd6c1){return function(_0x481177){if(_0x481177){return _0x481177['destroy']()[_0xe977('0x27')](function(){_0x57ac90[_0xe977('0x1c')](0xcc)[_0xe977('0x1b')]();});}};}function handleEntityNotFound(_0x14bb5e,_0x478870){return function(_0x251972){if(!_0x251972){_0x14bb5e[_0xe977('0x1a')](0x194);}return _0x251972;};}function handleError(_0x3caff7,_0x5b3e74){_0x5b3e74=_0x5b3e74||0x1f4;return function(_0x42c4af){logger[_0xe977('0x28')](_0x42c4af['stack']);if(_0x42c4af[_0xe977('0x29')]){delete _0x42c4af[_0xe977('0x29')];}_0x3caff7[_0xe977('0x1c')](_0x5b3e74)[_0xe977('0x2a')](_0x42c4af);};}exports['sendUserNotification']=function(_0x577058,_0x21b237,_0x270e2e){if(!_0x577058[_0xe977('0x2b')][_0xe977('0x2c')](_0xe977('0x2d'))&&!_0x577058[_0xe977('0x2b')]['hasOwnProperty'](_0xe977('0x2e'))){throw new db['Sequelize'][(_0xe977('0x2f'))](_0xe977('0x30'));}else{if(_0x577058['body'][_0xe977('0x2c')](_0xe977('0x2e'))&&!_0x577058['body'][_0xe977('0x2c')](_0xe977('0x31'))){throw new db['Sequelize'][(_0xe977('0x2f'))](_0xe977('0x32'));}if(!_0x577058['body'][_0xe977('0x2c')]('recipients')){throw new db[(_0xe977('0x33'))][(_0xe977('0x2f'))](_0xe977('0x34'));}else{try{var _0x519ec5=JSON['parse'](_0x577058[_0xe977('0x2b')][_0xe977('0x35')]);}catch(_0x4c5ebf){logger[_0xe977('0x28')](_0x4c5ebf);throw new db['Sequelize'][(_0xe977('0x2f'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x498df1=[_0xe977('0x36'),'faxqueue','mailqueue',_0xe977('0x37'),_0xe977('0x38'),_0xe977('0x39'),_0xe977('0x3a'),_0xe977('0x3b'),_0xe977('0x3c')];if(_[_0xe977('0x3d')](_0x519ec5,function(_0x1483c0){return!_[_0xe977('0x3e')](_0x498df1,_0x1483c0[_0xe977('0x3f')][_0xe977('0x40')]());})){throw new db['Sequelize'][(_0xe977('0x2f'))](_0xe977('0x41'));}}}var _0x1399f8={};_0x1399f8['senderName']=_0x577058[_0xe977('0x2b')][_0xe977('0x2c')](_0xe977('0x42'))?_0x577058[_0xe977('0x2b')][_0xe977('0x42')]:_0x577058[_0xe977('0x3c')][_0xe977('0x43')];_0x1399f8['recipientsDescription']=_[_0xe977('0x44')](_0x577058['body'][_0xe977('0x45')])?null:_0x577058[_0xe977('0x2b')][_0xe977('0x45')];_0x1399f8['beep']=_0x577058['body'][_0xe977('0x46')]||![];_0x1399f8[_0xe977('0x47')]=_0x577058['user']['id'];return getContent(_0x577058[_0xe977('0x2b')])['then'](function(_0x4936b4){_0x1399f8[_0xe977('0x2b')]=_0x4936b4;return getRecipients(_0x519ec5);})['then'](function(_0x2af828){_0x1399f8[_0xe977('0x48')]=_['sortBy'](_0x2af828)['join'](',');return db['sequelize'][_0xe977('0x49')](function(_0x2108eb){return db[_0xe977('0x4a')]['create'](_0x1399f8,{'raw':!![],'transaction':_0x2108eb})['then'](function(_0x270cd1){var _0x5b908c={'sender':_0x1399f8['senderName'],'description':_0x1399f8[_0xe977('0x45')],'content':_0x1399f8[_0xe977('0x2b')],'beep':_0x1399f8[_0xe977('0x46')]};_0x2af828[_0xe977('0x4b')](function(_0x338f3f){_0x5b908c[_0xe977('0x4c')]=_0x338f3f;socket['emit'](_0xe977('0x4d'),_0x5b908c);});return _0x270cd1;});});})[_0xe977('0x27')](respondWithResult(_0x21b237,0xc9))[_0xe977('0x4e')](handleError(_0x21b237,null));};function getContent(_0x52618f){return new BPromise(function(_0x510c84,_0x135724){if(_0x52618f[_0xe977('0x2d')]){_0x510c84(_0x52618f[_0xe977('0x2d')]);return;}return db[_0xe977('0x4f')][_0xe977('0x50')]({'attributes':['html'],'where':{'id':_0x52618f[_0xe977('0x2e')]},'raw':!![]})[_0xe977('0x27')](function(_0x16195d){if(!_0x16195d)throw new db[(_0xe977('0x33'))][(_0xe977('0x2f'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x514768=Mustache[_0xe977('0x51')](_0x16195d['html'],_0x52618f['view']);_0x510c84(_0x514768);})['catch'](function(_0x1a0b7e){_0x135724(_0x1a0b7e);});});}function getRecipients(_0x3ea847){return new BPromise(function(_0x25d326,_0x468f32){var _0x413ea8=[];var _0x1f3eb9=[];_0x3ea847[_0xe977('0x4b')](function(_0xae1dcb){var _0x1ec40e=_[_0xe977('0x52')](_0xae1dcb[_0xe977('0x3f')][_0xe977('0x40')]());if(_0x1ec40e==='User'){_0x413ea8=_['union'](_0x413ea8,_0xae1dcb[_0xe977('0x53')]);}else{if(_[_0xe977('0x3e')](_0x1ec40e,'queue'))_0x1ec40e=_0x1ec40e['replace'](_0xe977('0x54'),_0xe977('0x55'));_0xae1dcb[_0xe977('0x53')]['forEach'](function(_0x21d868){_0x1f3eb9['push'](getAgents(_0x1ec40e,_0x21d868));});}});return BPromise['all'](_0x1f3eb9)['then'](function(_0x3c6910){_0x413ea8=_['union'](_0x413ea8,_[_0xe977('0x56')](_0x3c6910));_0x25d326(_0x413ea8);})[_0xe977('0x4e')](function(_0xb37e53){_0x468f32(_0xb37e53);});});}function getAgents(_0x43fd49,_0x5535ca){return new BPromise(function(_0x250cfd,_0x41535e){return db[_0x43fd49][_0xe977('0x50')]({'where':{'id':_0x5535ca}})[_0xe977('0x27')](function(_0x487314){return _0x487314['getAgents']({'attributes':['id'],'raw':!![]})[_0xe977('0x27')](function(_0x182e66){var _0x1f02f0=_[_0xe977('0x57')](_0x182e66,'id');_0x250cfd(_0x1f02f0);});})[_0xe977('0x4e')](function(_0x1bef02){_0x41535e(_0x1bef02);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index c04b507..31da891 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 _0x5891=['hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x5891,0x1e8));var _0x1589=function(_0x3c3644,_0x278988){_0x3c3644=_0x3c3644-0x0;var _0x164b5b=_0x5891[_0x3c3644];return _0x164b5b;};'use strict';var EventEmitter=require(_0x1589('0x0'));var UserNotification=require(_0x1589('0x1'))['db'][_0x1589('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1589('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1589('0x4'),'afterDestroy':_0x1589('0x5')};function emitEvent(_0x43d3ab){return function(_0x53a04f,_0x1b59ab,_0x227989){UserNotificationEvents['emit'](_0x43d3ab+':'+_0x53a04f['id'],_0x53a04f);UserNotificationEvents[_0x1589('0x6')](_0x43d3ab,_0x53a04f);_0x227989(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x1589('0x7')](e,emitEvent(event));}}module[_0x1589('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x67ca=['save','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x3ec6b3,_0x6619b2){var _0x5cf6c4=function(_0x28358c){while(--_0x28358c){_0x3ec6b3['push'](_0x3ec6b3['shift']());}};_0x5cf6c4(++_0x6619b2);}(_0x67ca,0x1ac));var _0xa67c=function(_0x1f4c73,_0x5b8b94){_0x1f4c73=_0x1f4c73-0x0;var _0xb812a8=_0x67ca[_0x1f4c73];return _0xb812a8;};'use strict';var EventEmitter=require(_0xa67c('0x0'));var UserNotification=require(_0xa67c('0x1'))['db'][_0xa67c('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa67c('0x3')](0x0);var events={'afterCreate':_0xa67c('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21100b){return function(_0x55a3c4,_0x1e799f,_0x5d6b17){UserNotificationEvents[_0xa67c('0x5')](_0x21100b+':'+_0x55a3c4['id'],_0x55a3c4);UserNotificationEvents['emit'](_0x21100b,_0x55a3c4);_0x5d6b17(null);};}for(var e in events){if(events[_0xa67c('0x6')](e)){var event=events[e];UserNotification[_0xa67c('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 417c3e8..c8dbe73 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 _0x8a56=['api','moment','request-promise','path','rimraf','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x513cda,_0x4f2099){var _0x4d113c=function(_0x30b77b){while(--_0x30b77b){_0x513cda['push'](_0x513cda['shift']());}};_0x4d113c(++_0x4f2099);}(_0x8a56,0x131));var _0x68a5=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x8a56[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0x68a5('0x0'));var util=require(_0x68a5('0x1'));var logger=require(_0x68a5('0x2'))(_0x68a5('0x3'));var moment=require(_0x68a5('0x4'));var BPromise=require('bluebird');var rp=require(_0x68a5('0x5'));var fs=require('fs');var path=require(_0x68a5('0x6'));var rimraf=require(_0x68a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x68a5('0x8'));module[_0x68a5('0x9')]=function(_0x3010a7,_0x254eaa){return _0x3010a7['define'](_0x68a5('0xa'),attributes,{'tableName':_0x68a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x68a5('0xc'),'collate':_0x68a5('0xd')});}; \ No newline at end of file +var _0x623f=['../../config/logger','bluebird','path','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0x623f,0x16a));var _0xf623=function(_0x1291f4,_0xb21792){_0x1291f4=_0x1291f4-0x0;var _0x40f568=_0x623f[_0x1291f4];return _0x40f568;};'use strict';var _=require(_0xf623('0x0'));var util=require(_0xf623('0x1'));var logger=require(_0xf623('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf623('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf623('0x4'));var rimraf=require(_0xf623('0x5'));var config=require('../../config/environment');var attributes=require(_0xf623('0x6'));module[_0xf623('0x7')]=function(_0xa14ead,_0x48758e){return _0xa14ead[_0xf623('0x8')](_0xf623('0x9'),attributes,{'tableName':_0xf623('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf623('0xb'),'collate':_0xf623('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 37ffb7b..83e011c 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 _0x4c2d=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','error'];(function(_0x1a48a0,_0x3c95f5){var _0x269714=function(_0x33d9e3){while(--_0x33d9e3){_0x1a48a0['push'](_0x1a48a0['shift']());}};_0x269714(++_0x3c95f5);}(_0x4c2d,0x98));var _0xd4c2=function(_0x1ce20d,_0x1c98dc){_0x1ce20d=_0x1ce20d-0x0;var _0x113406=_0x4c2d[_0x1ce20d];return _0x113406;};'use strict';var _=require(_0xd4c2('0x0'));var util=require(_0xd4c2('0x1'));var moment=require('moment');var BPromise=require(_0xd4c2('0x2'));var rs=require(_0xd4c2('0x3'));var fs=require('fs');var Redis=require(_0xd4c2('0x4'));var db=require(_0xd4c2('0x5'))['db'];var utils=require(_0xd4c2('0x6'));var logger=require('../../config/logger')(_0xd4c2('0x7'));var config=require(_0xd4c2('0x8'));var jayson=require(_0xd4c2('0x9'));var client=jayson['client'][_0xd4c2('0xa')]({'port':0x232a});config['redis']=_[_0xd4c2('0xb')](config[_0xd4c2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd4c2('0xd'))(new Redis(config[_0xd4c2('0xc')]));require(_0xd4c2('0xe'))[_0xd4c2('0xf')](socket);function respondWithRpcPromise(_0x209aca,_0x5627a9,_0x398513){return new BPromise(function(_0x39fa37,_0x4168a2){return client[_0xd4c2('0x10')](_0x209aca,_0x398513)[_0xd4c2('0x11')](function(_0x203ee2){logger[_0xd4c2('0x12')](_0xd4c2('0x13'),_0x5627a9,'request\x20sent');logger[_0xd4c2('0x14')](_0xd4c2('0x15'),_0x5627a9,'request\x20sent',JSON['stringify'](_0x203ee2));if(_0x203ee2[_0xd4c2('0x16')]){if(_0x203ee2['error']['code']===0x1f4){logger[_0xd4c2('0x16')](_0xd4c2('0x13'),_0x5627a9,_0x203ee2['error'][_0xd4c2('0x17')]);return _0x4168a2(_0x203ee2[_0xd4c2('0x16')]['message']);}logger[_0xd4c2('0x16')](_0xd4c2('0x13'),_0x5627a9,_0x203ee2[_0xd4c2('0x16')][_0xd4c2('0x17')]);return _0x39fa37(_0x203ee2[_0xd4c2('0x16')]['message']);}else{logger[_0xd4c2('0x12')](_0xd4c2('0x13'),_0x5627a9,'request\x20sent');_0x39fa37(_0x203ee2['result'][_0xd4c2('0x17')]);}})[_0xd4c2('0x18')](function(_0x9eccbd){logger[_0xd4c2('0x16')]('UserNotification,\x20%s,\x20%s',_0x5627a9,_0x9eccbd);_0x4168a2(_0x9eccbd);});});} \ No newline at end of file +var _0xa628=['../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0xa628,0x9c));var _0x8a62=function(_0x6e51f1,_0x11371a){_0x6e51f1=_0x6e51f1-0x0;var _0x141b4c=_0xa628[_0x6e51f1];return _0x141b4c;};'use strict';var _=require(_0x8a62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a62('0x1'));var rs=require(_0x8a62('0x2'));var fs=require('fs');var Redis=require(_0x8a62('0x3'));var db=require(_0x8a62('0x4'))['db'];var utils=require(_0x8a62('0x5'));var logger=require(_0x8a62('0x6'))(_0x8a62('0x7'));var config=require(_0x8a62('0x8'));var jayson=require(_0x8a62('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8a62('0xa')]=_[_0x8a62('0xb')](config[_0x8a62('0xa')],{'host':_0x8a62('0xc'),'port':0x18eb});var socket=require(_0x8a62('0xd'))(new Redis(config[_0x8a62('0xa')]));require(_0x8a62('0xe'))[_0x8a62('0xf')](socket);function respondWithRpcPromise(_0x416d49,_0x4ef1ad,_0x2ca30f){return new BPromise(function(_0x59863e,_0x1279ed){return client['request'](_0x416d49,_0x2ca30f)[_0x8a62('0x10')](function(_0x3b0550){logger['info'](_0x8a62('0x11'),_0x4ef1ad,_0x8a62('0x12'));logger[_0x8a62('0x13')](_0x8a62('0x14'),_0x4ef1ad,_0x8a62('0x12'),JSON['stringify'](_0x3b0550));if(_0x3b0550[_0x8a62('0x15')]){if(_0x3b0550[_0x8a62('0x15')][_0x8a62('0x16')]===0x1f4){logger[_0x8a62('0x15')](_0x8a62('0x11'),_0x4ef1ad,_0x3b0550[_0x8a62('0x15')][_0x8a62('0x17')]);return _0x1279ed(_0x3b0550[_0x8a62('0x15')][_0x8a62('0x17')]);}logger['error'](_0x8a62('0x11'),_0x4ef1ad,_0x3b0550[_0x8a62('0x15')][_0x8a62('0x17')]);return _0x59863e(_0x3b0550['error'][_0x8a62('0x17')]);}else{logger[_0x8a62('0x18')](_0x8a62('0x11'),_0x4ef1ad,'request\x20sent');_0x59863e(_0x3b0550[_0x8a62('0x19')][_0x8a62('0x17')]);}})[_0x8a62('0x1a')](function(_0x41b886){logger['error'](_0x8a62('0x11'),_0x4ef1ad,_0x41b886);_0x1279ed(_0x41b886);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 87240b9..168aa5f 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 _0xcb9b=['userNotification:','./userNotification.events','save','remove','update','emit'];(function(_0x2a7fa8,_0x413c0e){var _0xf7e306=function(_0x9af322){while(--_0x9af322){_0x2a7fa8['push'](_0x2a7fa8['shift']());}};_0xf7e306(++_0x413c0e);}(_0xcb9b,0x1c3));var _0xbcb9=function(_0x91a646,_0x392902){_0x91a646=_0x91a646-0x0;var _0x5d469d=_0xcb9b[_0x91a646];return _0x5d469d;};'use strict';var UserNotificationEvents=require(_0xbcb9('0x0'));var events=[_0xbcb9('0x1'),_0xbcb9('0x2'),_0xbcb9('0x3')];function createListener(_0x72d1c5,_0x38f756){return function(_0x12be2d){_0x38f756[_0xbcb9('0x4')](_0x72d1c5,_0x12be2d);};}function removeListener(_0x3e10ad,_0x463cb1){return function(){UserNotificationEvents['removeListener'](_0x3e10ad,_0x463cb1);};}exports['register']=function(_0xf04440){for(var _0x463d33=0x0,_0x5dc5a9=events['length'];_0x463d33<_0x5dc5a9;_0x463d33++){var _0x5741c4=events[_0x463d33];var _0x264e3d=createListener(_0xbcb9('0x5')+_0x5741c4,_0xf04440);UserNotificationEvents['on'](_0x5741c4,_0x264e3d);}}; \ No newline at end of file +var _0x66e6=['length','./userNotification.events','remove','update','removeListener','register'];(function(_0x26a9dd,_0x22505e){var _0x907423=function(_0x383920){while(--_0x383920){_0x26a9dd['push'](_0x26a9dd['shift']());}};_0x907423(++_0x22505e);}(_0x66e6,0xb5));var _0x666e=function(_0x370bf0,_0x2ce146){_0x370bf0=_0x370bf0-0x0;var _0x1c9ff2=_0x66e6[_0x370bf0];return _0x1c9ff2;};'use strict';var UserNotificationEvents=require(_0x666e('0x0'));var events=['save',_0x666e('0x1'),_0x666e('0x2')];function createListener(_0x2e9bcc,_0x88ed12){return function(_0x470c56){_0x88ed12['emit'](_0x2e9bcc,_0x470c56);};}function removeListener(_0x4bb665,_0x557ad2){return function(){UserNotificationEvents[_0x666e('0x3')](_0x4bb665,_0x557ad2);};}exports[_0x666e('0x4')]=function(_0x5b230e){for(var _0x1eeeee=0x0,_0x269154=events[_0x666e('0x5')];_0x1eeeee<_0x269154;_0x1eeeee++){var _0x56a6be=events[_0x1eeeee];var _0x54d4f7=createListener('userNotification:'+_0x56a6be,_0x5b230e);UserNotificationEvents['on'](_0x56a6be,_0x54d4f7);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index c2bacc6..4c7ade6 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x23fd42,_0x2550f2){var _0x4edf64=function(_0x4a1f83){while(--_0x4a1f83){_0x23fd42['push'](_0x23fd42['shift']());}};_0x4edf64(++_0x2550f2);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2b5c60,_0xddad37){var _0x40ef50=function(_0x103b03){while(--_0x103b03){_0x2b5c60['push'](_0x2b5c60['shift']());}};_0x40ef50(++_0xddad37);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d776b69..7899ce7 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 _0x9167=['exports'];(function(_0x2c4420,_0x79e62){var _0x5f43da=function(_0x4df432){while(--_0x4df432){_0x2c4420['push'](_0x2c4420['shift']());}};_0x5f43da(++_0x79e62);}(_0x9167,0x1b3));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7916('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4e6c=['sequelize','exports','INTEGER'];(function(_0x343b35,_0xe7c1f9){var _0x26db79=function(_0x4bc0c8){while(--_0x4bc0c8){_0x343b35['push'](_0x343b35['shift']());}};_0x26db79(++_0xe7c1f9);}(_0x4e6c,0x8d));var _0xc4e6=function(_0x30a30e,_0x4ac764){_0x30a30e=_0x30a30e-0x0;var _0x3d25c3=_0x4e6c[_0x30a30e];return _0x3d25c3;};'use strict';var Sequelize=require(_0xc4e6('0x0'));module[_0xc4e6('0x1')]={'penalty':{'type':Sequelize[_0xc4e6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index f39e2c0..4a686eb 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 _0xec6b=['request-promise','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x116deb,_0x3b353f){var _0x4c30fc=function(_0x3c9c41){while(--_0x3c9c41){_0x116deb['push'](_0x116deb['shift']());}};_0x4c30fc(++_0x3b353f);}(_0xec6b,0x96));var _0xbec6=function(_0xf3f392,_0x56c8de){_0xf3f392=_0xf3f392-0x0;var _0x46af9f=_0xec6b[_0xf3f392];return _0x46af9f;};'use strict';var _=require(_0xbec6('0x0'));var util=require(_0xbec6('0x1'));var logger=require(_0xbec6('0x2'))(_0xbec6('0x3'));var moment=require(_0xbec6('0x4'));var BPromise=require(_0xbec6('0x5'));var rp=require(_0xbec6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbec6('0x7'));var config=require(_0xbec6('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xbec6('0x9')]=function(_0x2a9d29,_0x2ee3a7){return _0x2a9d29[_0xbec6('0xa')](_0xbec6('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x613c=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues','lodash','api','moment','bluebird','request-promise'];(function(_0x31295c,_0x2f2b82){var _0x2c150e=function(_0x957f1){while(--_0x957f1){_0x31295c['push'](_0x31295c['shift']());}};_0x2c150e(++_0x2f2b82);}(_0x613c,0xc1));var _0xc613=function(_0x463032,_0xcd7a34){_0x463032=_0x463032-0x0;var _0x2a7932=_0x613c[_0x463032];return _0x2a7932;};'use strict';var _=require(_0xc613('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc613('0x1'));var moment=require(_0xc613('0x2'));var BPromise=require(_0xc613('0x3'));var rp=require(_0xc613('0x4'));var fs=require('fs');var path=require(_0xc613('0x5'));var rimraf=require(_0xc613('0x6'));var config=require(_0xc613('0x7'));var attributes=require(_0xc613('0x8'));module[_0xc613('0x9')]=function(_0x3761ec,_0x1bf5f8){return _0x3761ec['define']('UserOpenchannelQueue',attributes,{'tableName':_0xc613('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 820434d..eb43bdc 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 _0x149d=['info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0x149d,0x7b));var _0xd149=function(_0xbeb908,_0x4f501e){_0xbeb908=_0xbeb908-0x0;var _0xa77621=_0x149d[_0xbeb908];return _0xa77621;};'use strict';var _=require(_0xd149('0x0'));var util=require('util');var moment=require(_0xd149('0x1'));var BPromise=require(_0xd149('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd149('0x3'))['db'];var utils=require(_0xd149('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd149('0x5'));var jayson=require(_0xd149('0x6'));var client=jayson[_0xd149('0x7')][_0xd149('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x417080,_0x5709f2,_0x271604){return new BPromise(function(_0x439e9d,_0x4a94c2){return client['request'](_0x417080,_0x271604)[_0xd149('0x9')](function(_0x17a81c){logger[_0xd149('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5709f2,_0xd149('0xb'));logger['debug'](_0xd149('0xc'),_0x5709f2,_0xd149('0xb'),JSON[_0xd149('0xd')](_0x17a81c));if(_0x17a81c[_0xd149('0xe')]){if(_0x17a81c[_0xd149('0xe')][_0xd149('0xf')]===0x1f4){logger[_0xd149('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5709f2,_0x17a81c[_0xd149('0xe')]['message']);return _0x4a94c2(_0x17a81c[_0xd149('0xe')][_0xd149('0x10')]);}logger['error'](_0xd149('0x11'),_0x5709f2,_0x17a81c['error']['message']);return _0x439e9d(_0x17a81c['error']['message']);}else{logger[_0xd149('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5709f2,'request\x20sent');_0x439e9d(_0x17a81c[_0xd149('0x12')][_0xd149('0x10')]);}})['catch'](function(_0x27bda4){logger[_0xd149('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5709f2,_0x27bda4);_0x4a94c2(_0x27bda4);});});} \ No newline at end of file +var _0x50c0=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x50c0,0xd0));var _0x050c=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x50c0[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x050c('0x0'));var util=require('util');var moment=require(_0x050c('0x1'));var BPromise=require(_0x050c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x050c('0x3'));var db=require(_0x050c('0x4'))['db'];var utils=require(_0x050c('0x5'));var logger=require(_0x050c('0x6'))(_0x050c('0x7'));var config=require(_0x050c('0x8'));var jayson=require(_0x050c('0x9'));var client=jayson[_0x050c('0xa')][_0x050c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e38eb,_0x28954b,_0x33995f){return new BPromise(function(_0x1ceb64,_0x5bb9e9){return client[_0x050c('0xc')](_0x5e38eb,_0x33995f)['then'](function(_0xa93feb){logger[_0x050c('0xd')](_0x050c('0xe'),_0x28954b,'request\x20sent');logger[_0x050c('0xf')](_0x050c('0x10'),_0x28954b,_0x050c('0x11'),JSON[_0x050c('0x12')](_0xa93feb));if(_0xa93feb[_0x050c('0x13')]){if(_0xa93feb[_0x050c('0x13')]['code']===0x1f4){logger[_0x050c('0x13')](_0x050c('0xe'),_0x28954b,_0xa93feb[_0x050c('0x13')][_0x050c('0x14')]);return _0x5bb9e9(_0xa93feb[_0x050c('0x13')]['message']);}logger[_0x050c('0x13')](_0x050c('0xe'),_0x28954b,_0xa93feb['error'][_0x050c('0x14')]);return _0x1ceb64(_0xa93feb[_0x050c('0x13')]['message']);}else{logger[_0x050c('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x28954b,'request\x20sent');_0x1ceb64(_0xa93feb[_0x050c('0x15')][_0x050c('0x14')]);}})[_0x050c('0x16')](function(_0x5d1033){logger[_0x050c('0x13')](_0x050c('0xe'),_0x28954b,_0x5d1033);_0x5bb9e9(_0x5d1033);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 23bdc93..e77e98a 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 _0x6ed3=['delete','destroy','removeResources','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/sections','getSections','getResources','post','create','clone','/:id/resources','addResources','put','update'];(function(_0x2f56ff,_0x2515cf){var _0x269e80=function(_0x309763){while(--_0x309763){_0x2f56ff['push'](_0x2f56ff['shift']());}};_0x269e80(++_0x2515cf);}(_0x6ed3,0xec));var _0x36ed=function(_0x507a18,_0x1323ee){_0x507a18=_0x507a18-0x0;var _0x1e9de4=_0x6ed3[_0x507a18];return _0x1e9de4;};'use strict';var multer=require(_0x36ed('0x0'));var util=require(_0x36ed('0x1'));var path=require(_0x36ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x36ed('0x3'));var router=express[_0x36ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x36ed('0x5'));var interaction=require(_0x36ed('0x6'));var config=require('../../config/environment');var controller=require(_0x36ed('0x7'));router[_0x36ed('0x8')]('/',auth['isAuthenticated'](),controller[_0x36ed('0x9')]);router['get'](_0x36ed('0xa'),auth[_0x36ed('0xb')](),controller[_0x36ed('0xc')]);router['get'](_0x36ed('0xd'),auth[_0x36ed('0xb')](),controller[_0x36ed('0xe')]);router[_0x36ed('0x8')](_0x36ed('0xf'),auth[_0x36ed('0xb')](),controller[_0x36ed('0x10')]);router[_0x36ed('0x8')]('/:id/resources',auth['isAuthenticated'](),controller[_0x36ed('0x11')]);router[_0x36ed('0x12')]('/',auth[_0x36ed('0xb')](),controller[_0x36ed('0x13')]);router[_0x36ed('0x12')]('/:id/clone',auth['isAuthenticated'](),controller[_0x36ed('0x14')]);router[_0x36ed('0x12')](_0x36ed('0xf'),auth['isAuthenticated'](),controller['addSections']);router[_0x36ed('0x12')](_0x36ed('0x15'),auth[_0x36ed('0xb')](),controller[_0x36ed('0x16')]);router[_0x36ed('0x17')](_0x36ed('0xd'),auth[_0x36ed('0xb')](),controller[_0x36ed('0x18')]);router[_0x36ed('0x19')](_0x36ed('0xd'),auth[_0x36ed('0xb')](),controller[_0x36ed('0x1a')]);router[_0x36ed('0x19')](_0x36ed('0xf'),auth['isAuthenticated'](),controller['removeSections']);router[_0x36ed('0x19')](_0x36ed('0x15'),auth[_0x36ed('0xb')](),controller[_0x36ed('0x1b')]);module[_0x36ed('0x1c')]=router; \ No newline at end of file +var _0x7aaa=['get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','/:id/clone','clone','addSections','post','destroy','delete','removeSections','removeResources','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller'];(function(_0x10a6db,_0x42b766){var _0x5a1ee2=function(_0x30cf98){while(--_0x30cf98){_0x10a6db['push'](_0x10a6db['shift']());}};_0x5a1ee2(++_0x42b766);}(_0x7aaa,0x164));var _0xa7aa=function(_0x36a94f,_0x3fcc6c){_0x36a94f=_0x36a94f-0x0;var _0x4ba69f=_0x7aaa[_0x36a94f];return _0x4ba69f;};'use strict';var multer=require(_0xa7aa('0x0'));var util=require('util');var path=require(_0xa7aa('0x1'));var timeout=require(_0xa7aa('0x2'));var express=require(_0xa7aa('0x3'));var router=express['Router']();var fs_extra=require(_0xa7aa('0x4'));var auth=require(_0xa7aa('0x5'));var interaction=require(_0xa7aa('0x6'));var config=require('../../config/environment');var controller=require(_0xa7aa('0x7'));router[_0xa7aa('0x8')]('/',auth[_0xa7aa('0x9')](),controller[_0xa7aa('0xa')]);router[_0xa7aa('0x8')](_0xa7aa('0xb'),auth['isAuthenticated'](),controller[_0xa7aa('0xc')]);router[_0xa7aa('0x8')](_0xa7aa('0xd'),auth[_0xa7aa('0x9')](),controller['show']);router['get'](_0xa7aa('0xe'),auth[_0xa7aa('0x9')](),controller[_0xa7aa('0xf')]);router[_0xa7aa('0x8')](_0xa7aa('0x10'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth[_0xa7aa('0x9')](),controller['create']);router['post'](_0xa7aa('0x11'),auth[_0xa7aa('0x9')](),controller[_0xa7aa('0x12')]);router['post'](_0xa7aa('0xe'),auth['isAuthenticated'](),controller[_0xa7aa('0x13')]);router[_0xa7aa('0x14')](_0xa7aa('0x10'),auth[_0xa7aa('0x9')](),controller['addResources']);router['put'](_0xa7aa('0xd'),auth[_0xa7aa('0x9')](),controller['update']);router['delete'](_0xa7aa('0xd'),auth[_0xa7aa('0x9')](),controller[_0xa7aa('0x15')]);router[_0xa7aa('0x16')](_0xa7aa('0xe'),auth[_0xa7aa('0x9')](),controller[_0xa7aa('0x17')]);router[_0xa7aa('0x16')]('/:id/resources',auth[_0xa7aa('0x9')](),controller[_0xa7aa('0x18')]);module[_0xa7aa('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 732d5ea..6c83885 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 _0xb2e8=['name','crudPermissions','join','getDataValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x2971e6,_0x4a962e){var _0x5e6392=function(_0x16e6cf){while(--_0x16e6cf){_0x2971e6['push'](_0x2971e6['shift']());}};_0x5e6392(++_0x4a962e);}(_0xb2e8,0x156));var _0x8b2e=function(_0x584da0,_0x3c324c){_0x584da0=_0x584da0-0x0;var _0x3a9030=_0xb2e8[_0x584da0];return _0x3a9030;};'use strict';var Sequelize=require(_0x8b2e('0x0'));module[_0x8b2e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8b2e('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x15a098){this['setDataValue'](_0x8b2e('0x3'),_0x15a098?_0x15a098[_0x8b2e('0x4')](''):[]);},'get':function(){return this[_0x8b2e('0x5')](_0x8b2e('0x3'))?this['getDataValue'](_0x8b2e('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8b2e('0x6')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8b2e('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8b2e('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8b2e('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8b2e('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8b2e('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8b2e('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8b2e('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa73e=['sequelize','exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','BOOLEAN'];(function(_0x2f13dc,_0x266e44){var _0x497a86=function(_0xbb19ed){while(--_0xbb19ed){_0x2f13dc['push'](_0x2f13dc['shift']());}};_0x497a86(++_0x266e44);}(_0xa73e,0xf3));var _0xea73=function(_0x594b69,_0x3a5d13){_0x594b69=_0x594b69-0x0;var _0x25b7e3=_0xa73e[_0x594b69];return _0x25b7e3;};'use strict';var Sequelize=require(_0xea73('0x0'));module[_0xea73('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xea73('0x2')},'crudPermissions':{'type':Sequelize[_0xea73('0x3')],'set':function(_0x11ea7e){this[_0xea73('0x4')](_0xea73('0x5'),_0x11ea7e?_0x11ea7e[_0xea73('0x6')](''):[]);},'get':function(){return this[_0xea73('0x7')](_0xea73('0x5'))?this[_0xea73('0x7')](_0xea73('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xea73('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xea73('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xea73('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xea73('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xea73('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xea73('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xea73('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xea73('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 9987882..69b34ef 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 _0x3dc1=['intersection','attributes','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','find','create','body','clone','params','length','omit','createdAt','updatedAt','crudPermissions','sequelize','get','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','destroy','describe','addSections','transaction','Resources','push','removeSections','ids','getSections','includes','isEmpty','enabled','subsections','filter','findOne','forEach','resourceId','bulkCreate','removeResources','getResources','section','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x49fa98,_0x11accf){var _0x1698f1=function(_0x22f95f){while(--_0x22f95f){_0x49fa98['push'](_0x49fa98['shift']());}};_0x1698f1(++_0x11accf);}(_0x3dc1,0xa6));var _0x13dc=function(_0x97e82,_0x223043){_0x97e82=_0x97e82-0x0;var _0x477921=_0x3dc1[_0x97e82];return _0x477921;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x13dc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x13dc('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x13dc('0x2'));var util=require(_0x13dc('0x3'));var path=require(_0x13dc('0x4'));var sox=require(_0x13dc('0x5'));var csv=require(_0x13dc('0x6'));var ejs=require(_0x13dc('0x7'));var fs=require('fs');var fs_extra=require(_0x13dc('0x8'));var _=require(_0x13dc('0x9'));var squel=require(_0x13dc('0xa'));var crypto=require(_0x13dc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x13dc('0xc'));var toCsv=require(_0x13dc('0x6'));var querystring=require('querystring');var Papa=require(_0x13dc('0xd'));var Redis=require(_0x13dc('0xe'));var authService=require(_0x13dc('0xf'));var qs=require(_0x13dc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13dc('0x11'));var logger=require(_0x13dc('0x12'))(_0x13dc('0x13'));var utils=require(_0x13dc('0x14'));var config=require(_0x13dc('0x15'));var licenseUtil=require(_0x13dc('0x16'));var db=require('../../mysqldb')['db'];config[_0x13dc('0x17')]=_[_0x13dc('0x18')](config[_0x13dc('0x17')],{'host':_0x13dc('0x19'),'port':0x18eb});var socket=require(_0x13dc('0x1a'))(new Redis(config['redis']));require(_0x13dc('0x1b'))[_0x13dc('0x1c')](socket);function respondWithStatusCode(_0x5034cc,_0x2120fb){_0x2120fb=_0x2120fb||0xcc;return function(_0x191ee0){if(_0x191ee0){return _0x5034cc['sendStatus'](_0x2120fb);}return _0x5034cc[_0x13dc('0x1d')](_0x2120fb)[_0x13dc('0x1e')]();};}function respondWithResult(_0x36bd0b,_0x563adc){_0x563adc=_0x563adc||0xc8;return function(_0x518340){if(_0x518340){return _0x36bd0b['status'](_0x563adc)[_0x13dc('0x1f')](_0x518340);}};}function respondWithFilteredResult(_0x390592,_0xdfa2c0){return function(_0x581c13){if(_0x581c13){var _0x331161=typeof _0xdfa2c0[_0x13dc('0x20')]==='undefined'&&typeof _0xdfa2c0[_0x13dc('0x21')]==='undefined';var _0x2c60b2=_0x581c13[_0x13dc('0x22')];var _0x5eab98=_0x331161?0x0:_0xdfa2c0[_0x13dc('0x20')];var _0x2f17b3=_0x331161?_0x581c13['count']:_0xdfa2c0[_0x13dc('0x20')]+_0xdfa2c0[_0x13dc('0x21')];var _0xc86a10;if(_0x2f17b3>=_0x2c60b2){_0x2f17b3=_0x2c60b2;_0xc86a10=0xc8;}else{_0xc86a10=0xce;}_0x390592[_0x13dc('0x1d')](_0xc86a10);return _0x390592[_0x13dc('0x23')](_0x13dc('0x24'),_0x5eab98+'-'+_0x2f17b3+'/'+_0x2c60b2)['json'](_0x581c13);}return null;};}function patchUpdates(_0x42c846){return function(_0x1d4a0f){try{jsonpatch[_0x13dc('0x25')](_0x1d4a0f,_0x42c846,!![]);}catch(_0x542953){return BPromise[_0x13dc('0x26')](_0x542953);}return _0x1d4a0f[_0x13dc('0x27')]();};}function saveUpdates(_0x48e66e,_0x4522b3){return function(_0x378586){if(_0x378586){return _0x378586[_0x13dc('0x28')](_0x48e66e)['then'](function(_0x14532c){return _0x14532c;});}return null;};}function removeEntity(_0x33ba1b,_0x22de24){return function(_0x503608){if(_0x503608){return _0x503608['destroy']()[_0x13dc('0x29')](function(){_0x33ba1b[_0x13dc('0x1d')](0xcc)[_0x13dc('0x1e')]();});}};}function handleEntityNotFound(_0xa3cab9,_0x3c65b7){return function(_0x5159c6){if(!_0x5159c6){_0xa3cab9[_0x13dc('0x2a')](0x194);}return _0x5159c6;};}function handleError(_0x559035,_0x3dd61a){_0x3dd61a=_0x3dd61a||0x1f4;return function(_0xb170a2){logger[_0x13dc('0x2b')](_0xb170a2[_0x13dc('0x2c')]);if(_0xb170a2[_0x13dc('0x2d')]){delete _0xb170a2[_0x13dc('0x2d')];}_0x559035['status'](_0x3dd61a)[_0x13dc('0x2e')](_0xb170a2);};}exports['index']=function(_0x1077cb,_0x540edc){var _0xcd527e={},_0x5968a2={},_0x42d54f={'count':0x0,'rows':[]};var _0x3ab918=_[_0x13dc('0x2f')](db[_0x13dc('0x30')][_0x13dc('0x31')],function(_0x2b3fa8){return{'name':_0x2b3fa8[_0x13dc('0x32')],'type':_0x2b3fa8[_0x13dc('0x33')]['key']};});_0x5968a2[_0x13dc('0x34')]=_[_0x13dc('0x2f')](_0x3ab918,_0x13dc('0x2d'));_0x5968a2[_0x13dc('0x35')]=_[_0x13dc('0x36')](_0x1077cb['query']);_0x5968a2[_0x13dc('0x37')]=_[_0x13dc('0x38')](_0x5968a2[_0x13dc('0x34')],_0x5968a2[_0x13dc('0x35')]);_0xcd527e[_0x13dc('0x39')]=_[_0x13dc('0x38')](_0x5968a2[_0x13dc('0x34')],qs[_0x13dc('0x3a')](_0x1077cb['query'][_0x13dc('0x3a')]));_0xcd527e['attributes']=_0xcd527e[_0x13dc('0x39')]['length']?_0xcd527e[_0x13dc('0x39')]:_0x5968a2[_0x13dc('0x34')];if(!_0x1077cb['query']['hasOwnProperty'](_0x13dc('0x3b'))){_0xcd527e[_0x13dc('0x21')]=qs[_0x13dc('0x21')](_0x1077cb[_0x13dc('0x35')][_0x13dc('0x21')]);_0xcd527e['offset']=qs['offset'](_0x1077cb[_0x13dc('0x35')][_0x13dc('0x20')]);}_0xcd527e[_0x13dc('0x3c')]=qs[_0x13dc('0x3d')](_0x1077cb[_0x13dc('0x35')]['sort']);_0xcd527e[_0x13dc('0x3e')]=qs[_0x13dc('0x37')](_[_0x13dc('0x3f')](_0x1077cb['query'],_0x5968a2[_0x13dc('0x37')]),_0x3ab918);if(_0x1077cb[_0x13dc('0x35')]['filter']){_0xcd527e[_0x13dc('0x3e')]=_[_0x13dc('0x40')](_0xcd527e[_0x13dc('0x3e')],{'$or':_[_0x13dc('0x2f')](_0x3ab918,function(_0x30c02b){if(_0x30c02b[_0x13dc('0x33')]!=='VIRTUAL'){var _0x5af782={};_0x5af782[_0x30c02b[_0x13dc('0x2d')]]={'$like':'%'+_0x1077cb['query']['filter']+'%'};return _0x5af782;}})});}_0xcd527e=_[_0x13dc('0x40')]({},_0xcd527e,_0x1077cb[_0x13dc('0x41')]);var _0x43f3fc={'where':_0xcd527e[_0x13dc('0x3e')]};return db[_0x13dc('0x30')][_0x13dc('0x22')](_0x43f3fc)[_0x13dc('0x29')](function(_0x377612){_0x42d54f[_0x13dc('0x22')]=_0x377612;if(_0x1077cb[_0x13dc('0x35')][_0x13dc('0x42')]){_0xcd527e[_0x13dc('0x43')]=[{'all':!![]}];}return db[_0x13dc('0x30')][_0x13dc('0x44')](_0xcd527e);})[_0x13dc('0x29')](function(_0x21e048){_0x42d54f[_0x13dc('0x45')]=_0x21e048;return _0x42d54f;})[_0x13dc('0x29')](respondWithFilteredResult(_0x540edc,_0xcd527e))[_0x13dc('0x46')](handleError(_0x540edc,null));};exports['show']=function(_0x2ef7b2,_0x3196bc){var _0x2fe94a={'raw':![],'where':{'id':_0x2ef7b2['params']['id']}},_0x1e2bfd={};_0x1e2bfd['model']=_['keys'](db[_0x13dc('0x30')]['rawAttributes']);_0x1e2bfd[_0x13dc('0x35')]=_['keys'](_0x2ef7b2[_0x13dc('0x35')]);_0x1e2bfd[_0x13dc('0x37')]=_[_0x13dc('0x38')](_0x1e2bfd[_0x13dc('0x34')],_0x1e2bfd[_0x13dc('0x35')]);_0x2fe94a[_0x13dc('0x39')]=_[_0x13dc('0x38')](_0x1e2bfd[_0x13dc('0x34')],qs[_0x13dc('0x3a')](_0x2ef7b2[_0x13dc('0x35')]['fields']));_0x2fe94a[_0x13dc('0x39')]=_0x2fe94a[_0x13dc('0x39')]['length']?_0x2fe94a[_0x13dc('0x39')]:_0x1e2bfd['model'];if(_0x2ef7b2[_0x13dc('0x35')][_0x13dc('0x42')]){_0x2fe94a['include']=[{'all':!![]}];}_0x2fe94a=_[_0x13dc('0x40')]({},_0x2fe94a,_0x2ef7b2[_0x13dc('0x41')]);return db[_0x13dc('0x30')][_0x13dc('0x47')](_0x2fe94a)[_0x13dc('0x29')](handleEntityNotFound(_0x3196bc,null))['then'](respondWithResult(_0x3196bc,null))[_0x13dc('0x46')](handleError(_0x3196bc,null));};exports[_0x13dc('0x48')]=function(_0x500130,_0x46708e){return db[_0x13dc('0x30')][_0x13dc('0x48')](_0x500130[_0x13dc('0x49')],{})['then'](respondWithResult(_0x46708e,0xc9))[_0x13dc('0x46')](handleError(_0x46708e,null));};exports[_0x13dc('0x4a')]=function(_0x378e2a,_0x46d792){var _0x23c8db={'where':{'id':_0x378e2a[_0x13dc('0x4b')]['id']}},_0x598930={};_0x598930['model']=_['keys'](db['UserProfile'][_0x13dc('0x31')]);_0x23c8db['attributes']=_[_0x13dc('0x38')](_0x598930[_0x13dc('0x34')],qs[_0x13dc('0x3a')](_0x378e2a['query'][_0x13dc('0x3a')]));_0x23c8db[_0x13dc('0x39')]=_0x23c8db['attributes'][_0x13dc('0x4c')]?_0x23c8db[_0x13dc('0x39')]:_0x598930['model'];if(_0x378e2a[_0x13dc('0x35')][_0x13dc('0x42')]){_0x23c8db['include']=[{'all':!![]}];}_0x23c8db=_[_0x13dc('0x40')]({},_0x23c8db,_0x378e2a[_0x13dc('0x41')]);return db[_0x13dc('0x30')][_0x13dc('0x47')](_0x23c8db)[_0x13dc('0x29')](handleEntityNotFound(_0x46d792,null))[_0x13dc('0x29')](function(_0x528c98){if(_0x528c98){var _0x10e70a=_0x528c98['get']({'plain':!![]});_0x10e70a=qs[_0x13dc('0x4d')](_0x10e70a,['id',_0x13dc('0x4e'),_0x13dc('0x4f'),_0x13dc('0x50')]);_0x378e2a['body']=_[_0x13dc('0x4d')](_0x378e2a[_0x13dc('0x49')],['id',_0x13dc('0x4e'),'updatedAt']);return db[_0x13dc('0x51')]['transaction'](function(_0x3e34e4){return db[_0x13dc('0x30')][_0x13dc('0x48')](_[_0x13dc('0x40')](_0x10e70a,_0x378e2a[_0x13dc('0x49')]),{'include':_0x378e2a[_0x13dc('0x35')][_0x13dc('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x3e34e4})[_0x13dc('0x29')](function(_0x187e44){var _0x5d9e15=_0x187e44[_0x13dc('0x52')]({'plain':!![]});return db[_0x13dc('0x53')][_0x13dc('0x44')]({'where':{'userProfileId':_0x378e2a[_0x13dc('0x4b')]['id']},'raw':!![]})['then'](function(_0x555200){if(_0x555200){return BPromise['each'](_0x555200,function(_0x702ba4){return new BPromise(function(_0x872537,_0x5e05a1){if(_0x702ba4[_0x13dc('0x54')]===null||_0x702ba4['autoAssociation']===0x1)_0x872537(null);return db[_0x13dc('0x55')][_0x13dc('0x44')]({'where':{'sectionId':_0x702ba4['id']},'raw':!![]})['then'](function(_0x24b7e4){var _0x46f784=_['map'](_0x24b7e4,function(_0x4c2809){return qs['omit'](_0x4c2809,['id','createdAt',_0x13dc('0x4f'),_0x13dc('0x56')]);});_0x872537(_0x46f784);})[_0x13dc('0x46')](function(_0x1e6a72){_0x5e05a1(_0x1e6a72);});})[_0x13dc('0x29')](function(_0x431bce){var _0x8bcf35=qs[_0x13dc('0x4d')](_0x702ba4,['id',_0x13dc('0x4e'),'updatedAt']);_0x8bcf35[_0x13dc('0x57')]=_0x5d9e15['id'];if(_0x431bce)_0x8bcf35['Resources']=_0x431bce;return _0x8bcf35;})['then'](function(_0x1c654b){return db[_0x13dc('0x53')][_0x13dc('0x48')](_0x1c654b,{'include':[{'model':db[_0x13dc('0x55')],'as':'Resources'}],'raw':!![],'transaction':_0x3e34e4});});})['then'](function(){return _0x5d9e15;});}});});});}})[_0x13dc('0x29')](respondWithResult(_0x46d792,0xc9))[_0x13dc('0x46')](handleError(_0x46d792,null));};exports[_0x13dc('0x28')]=function(_0x5f086f,_0x103df0){if(_0x5f086f[_0x13dc('0x49')]['id']){delete _0x5f086f[_0x13dc('0x49')]['id'];}return db[_0x13dc('0x30')][_0x13dc('0x47')]({'where':{'id':_0x5f086f['params']['id']}})[_0x13dc('0x29')](handleEntityNotFound(_0x103df0,null))[_0x13dc('0x29')](saveUpdates(_0x5f086f[_0x13dc('0x49')],null))['then'](respondWithResult(_0x103df0,null))[_0x13dc('0x46')](handleError(_0x103df0,null));};exports[_0x13dc('0x58')]=function(_0x3d64d8,_0x518dfd){return db[_0x13dc('0x30')][_0x13dc('0x47')]({'where':{'id':_0x3d64d8[_0x13dc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x518dfd,null))[_0x13dc('0x29')](removeEntity(_0x518dfd,null))[_0x13dc('0x46')](handleError(_0x518dfd,null));};exports[_0x13dc('0x59')]=function(_0x592384,_0x48a13f){return db[_0x13dc('0x30')]['describe']()[_0x13dc('0x29')](respondWithResult(_0x48a13f,null))['catch'](handleError(_0x48a13f,null));};exports[_0x13dc('0x5a')]=function(_0x4da2af,_0x3ffac4){var _0x385afe=_0x4da2af[_0x13dc('0x49')];return db['UserProfile'][_0x13dc('0x47')]({'where':{'id':_0x4da2af[_0x13dc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ffac4,null))[_0x13dc('0x29')](function(_0x3dda97){if(_0x3dda97){return db[_0x13dc('0x51')][_0x13dc('0x5b')](function(_0x17050b){return db[_0x13dc('0x53')][_0x13dc('0x58')]({'where':{'userProfileId':_0x4da2af[_0x13dc('0x4b')]['id'],'sectionId':_[_0x13dc('0x2f')](_0x385afe,function(_0x3b2748){return _0x3b2748[_0x13dc('0x56')];})},'transaction':_0x17050b})[_0x13dc('0x29')](function(){var _0x4a09d8=_[_0x13dc('0x2f')](_0x385afe,function(_0x51683b){_0x51683b['userProfileId']=_0x4da2af[_0x13dc('0x4b')]['id'];return _0x51683b;});var _0x1d4518=[];return BPromise['each'](_0x4a09d8,function(_0x13f2db){return db[_0x13dc('0x53')][_0x13dc('0x48')](_0x13f2db,{'include':[{'model':db[_0x13dc('0x55')],'as':_0x13dc('0x5c')}],'raw':!![],'transaction':_0x17050b})['then'](function(_0x5712cb){_0x1d4518[_0x13dc('0x5d')](_0x5712cb[_0x13dc('0x52')]({'plain':!![]}));});})[_0x13dc('0x29')](function(){return _0x1d4518;});});});}})[_0x13dc('0x29')](function(_0x58a4ff){return _0x58a4ff;})[_0x13dc('0x29')](respondWithResult(_0x3ffac4,null))['catch'](handleError(_0x3ffac4,null));};exports[_0x13dc('0x5e')]=function(_0x54087c,_0x4076e3){var _0x526692;return db[_0x13dc('0x30')]['find']({'where':{'id':_0x54087c[_0x13dc('0x4b')]['id']},'attributes':['id',_0x13dc('0x2d')]})[_0x13dc('0x29')](handleEntityNotFound(_0x4076e3,null))[_0x13dc('0x29')](function(_0x56a27c){if(_0x56a27c){_0x526692=_0x56a27c;return db[_0x13dc('0x53')][_0x13dc('0x58')]({'where':{'userProfileId':_0x54087c['params']['id'],'sectionId':_0x54087c['query'][_0x13dc('0x5f')]}});}})['then'](function(){return _0x526692;})['then'](respondWithStatusCode(_0x4076e3,null))[_0x13dc('0x46')](handleError(_0x4076e3,null));};exports[_0x13dc('0x60')]=function(_0x329cb0,_0x48d84c){var _0x14f1ca=[];var _0x2443d1=[];return db[_0x13dc('0x53')][_0x13dc('0x44')]({'where':{'userProfileId':_0x329cb0[_0x13dc('0x4b')]['id']},'raw':!![]})['then'](function(_0x19c726){_0x14f1ca=_['filter'](_0x19c726,function(_0x3012df){return _0x3012df['enabled']===0x1||_[_0x13dc('0x61')]([0x3eb,0x709],_0x3012df[_0x13dc('0x56')]);});if(!_[_0x13dc('0x62')](_0x14f1ca)){return _[_0x13dc('0x2f')](_0x14f1ca,function(_0x44c9f6){return _0x44c9f6[_0x13dc('0x56')];});}else{return;}})[_0x13dc('0x29')](function(_0x253a06){if(_0x253a06)_0x2443d1=_0x253a06;if(_[_0x13dc('0x61')](_0x2443d1,0x64)){var _0x3d6594=_[_0x13dc('0x47')](_0x14f1ca,{'sectionId':0x64});return hasDefaultDashboard(_0x3d6594)[_0x13dc('0x29')](function(_0x4e91e7){return _['map'](_0x14f1ca,function(_0x4ba73a){if(_0x4ba73a[_0x13dc('0x56')]===0x64){_0x4ba73a['subsections']=_0x4e91e7;}return _0x4ba73a;});});}else{return;}})['then'](function(_0x2f591b){if(_0x2f591b)_0x14f1ca=_0x2f591b;if(_['includes'](_0x2443d1,0x3eb)){var _0x39aa44=_[_0x13dc('0x47')](_0x14f1ca,{'sectionId':0x3eb});return getCustomDashboards(_0x39aa44)[_0x13dc('0x29')](function(_0x3df8e5){return _[_0x13dc('0x2f')](_0x14f1ca,function(_0x38bcb0){if(_0x39aa44[_0x13dc('0x63')]){if(_0x38bcb0[_0x13dc('0x56')]===0x3eb){_0x38bcb0[_0x13dc('0x64')]=_0x3df8e5;}}else{if(_0x38bcb0[_0x13dc('0x56')]===0x64){if(!_0x38bcb0[_0x13dc('0x64')]){_0x38bcb0[_0x13dc('0x64')]=[];}_0x38bcb0[_0x13dc('0x64')]=_0x38bcb0[_0x13dc('0x64')]['concat'](_0x3df8e5);}}return _0x38bcb0;});});}else{return;}})['then'](function(_0x104763){if(_0x104763)_0x14f1ca=_0x104763;if(_[_0x13dc('0x61')](_0x2443d1,0x709)){var _0x1892be=_[_0x13dc('0x47')](_0x14f1ca,{'sectionId':0x709});return getPlugins(_0x1892be)['then'](function(_0x32b302){if(_0x1892be['enabled']){return _[_0x13dc('0x2f')](_0x14f1ca,function(_0x37da02){if(_0x37da02[_0x13dc('0x56')]===0x709){_0x37da02['subsections']=_0x32b302;}return _0x37da02;});}else{var _0x20f383={'sectionId':0x76c,'enabled':0x1,'subsections':_0x32b302};var _0x42ea76=_[_0x13dc('0x2f')](_0x14f1ca);_0x42ea76[_0x13dc('0x5d')](_0x20f383);return _0x42ea76;}});}else{return;}})[_0x13dc('0x29')](function(_0x2a2aea){if(_0x2a2aea)_0x14f1ca=_0x2a2aea;return _[_0x13dc('0x65')](_0x14f1ca,[_0x13dc('0x63'),0x1]);})['then'](respondWithResult(_0x48d84c,null))[_0x13dc('0x46')](handleError(_0x48d84c,null));};function hasDefaultDashboard(_0x4d97a5){var _0x227de4=[0x65];return new BPromise(function(_0x2aa3e3,_0x24ef0c){try{if(_0x4d97a5['autoAssociation']){_0x2aa3e3(_0x227de4);}else{return db[_0x13dc('0x55')][_0x13dc('0x66')]({'where':{'sectionId':_0x4d97a5['id']},'raw':!![]})[_0x13dc('0x29')](function(_0x3bb020){_0x3bb020?_0x2aa3e3(_0x227de4):_0x2aa3e3();});}}catch(_0x1e0040){_0x24ef0c(_0x1e0040);}});}function getCustomDashboards(_0x2a63dd){var _0x43d997=[];return new BPromise(function(_0x560a6d,_0x37016f){try{if(_0x2a63dd[_0x13dc('0x54')]){return db['Dashboard'][_0x13dc('0x44')]({'raw':!![]})[_0x13dc('0x29')](function(_0x328573){_0x328573['forEach'](function(_0x36de14){_0x43d997['push'](_0x36de14['id']+0x1869f);});_0x560a6d(_0x43d997);});}else{return db[_0x13dc('0x55')][_0x13dc('0x44')]({'where':{'sectionId':_0x2a63dd['id']},'raw':!![]})[_0x13dc('0x29')](function(_0x3f64db){_0x3f64db[_0x13dc('0x67')](function(_0x5321f4){_0x43d997[_0x13dc('0x5d')](_0x5321f4[_0x13dc('0x68')]+0x1869f);});_0x560a6d(_0x43d997);});}}catch(_0x1d42bf){_0x37016f(_0x1d42bf);}});}function getPlugins(_0x337f1e){var _0x2b6390=[];return new BPromise(function(_0x5b0ae3,_0x3b1104){try{if(_0x337f1e['autoAssociation']){return db['Plugin'][_0x13dc('0x44')]({'raw':!![]})[_0x13dc('0x29')](function(_0x3b1aef){_0x3b1aef[_0x13dc('0x67')](function(_0x34b67b){_0x2b6390[_0x13dc('0x5d')](_0x34b67b['id']+0x15b38);});_0x5b0ae3(_0x2b6390);});}else{return db[_0x13dc('0x55')][_0x13dc('0x44')]({'where':{'sectionId':_0x337f1e['id']},'raw':!![]})[_0x13dc('0x29')](function(_0x3f72a9){_0x3f72a9[_0x13dc('0x67')](function(_0x2794c4){_0x2b6390[_0x13dc('0x5d')](_0x2794c4[_0x13dc('0x68')]+0x15b38);});_0x5b0ae3(_0x2b6390);});}}catch(_0x48e06c){_0x3b1104(_0x48e06c);}});}exports['addResources']=function(_0x3edf19,_0x232003){return db[_0x13dc('0x30')][_0x13dc('0x47')]({'where':{'id':_0x3edf19['params']['id']}})[_0x13dc('0x29')](handleEntityNotFound(_0x232003,null))['then'](function(_0x2046f1){if(_0x2046f1){return db[_0x13dc('0x51')][_0x13dc('0x5b')](function(_0x573021){return db[_0x13dc('0x53')]['findAll']({'where':{'userProfileId':_0x3edf19[_0x13dc('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0x13dc('0x29')](function(_0x241302){if(_0x241302){return db['UserProfileSection'][_0x13dc('0x58')]({'where':{'userProfileId':_0x3edf19['params']['id'],'id':_[_0x13dc('0x2f')](_0x241302,function(_0x590e01){return _0x590e01['id'];})},'transaction':_0x573021});}})['then'](function(_0x80419b){var _0x290c6b=_[_0x13dc('0x2f')](_0x3edf19[_0x13dc('0x49')],function(_0x58eaad){_0x58eaad[_0x13dc('0x57')]=_0x3edf19[_0x13dc('0x4b')]['id'];return _0x58eaad;});return db[_0x13dc('0x53')]['bulkCreate'](_0x290c6b,{'raw':!![],'transaction':_0x573021});})['then'](function(_0x167d5c){var _0x2557bd=_['filter'](_[_0x13dc('0x2f')](_0x167d5c,function(_0x1fb169){return _0x1fb169['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2557bd){return db[_0x13dc('0x53')][_0x13dc('0x44')]({'where':{'userProfileId':_0x3edf19['params']['id'],'sectionId':_[_0x13dc('0x2f')](_0x2557bd,function(_0x2374d5){return _0x2374d5[_0x13dc('0x56')];})},'attributes':['id',_0x13dc('0x56')],'raw':!![]})['then'](function(_0x255f9a){var _0x45c0e1=_[_0x13dc('0x2f')](_0x3edf19[_0x13dc('0x49')],function(_0x869535){_0x869535[_0x13dc('0x57')]=_0x3edf19[_0x13dc('0x4b')]['id'];return _0x869535;});return db['UserProfileResource'][_0x13dc('0x69')](_0x45c0e1,{'raw':!![],'transaction':_0x573021});});}})[_0x13dc('0x46')](handleError(_0x232003,null));});}})[_0x13dc('0x29')](function(_0x4e87bf){var _0x38f63d=_[_0x13dc('0x2f')](_0x4e87bf,function(_0x4d3891){return _0x4d3891[_0x13dc('0x52')]({'plain':!![]});});})[_0x13dc('0x29')](respondWithResult(_0x232003,null))[_0x13dc('0x46')](handleError(_0x232003,null));};exports[_0x13dc('0x6a')]=function(_0x13a017,_0x1f0c05,_0x24f259){return db[_0x13dc('0x30')]['find']({'where':{'id':_0x13a017[_0x13dc('0x4b')]['id']}})[_0x13dc('0x29')](handleEntityNotFound(_0x1f0c05,null))[_0x13dc('0x29')](function(_0xf2fa83){if(_0xf2fa83){return _0xf2fa83['removeResources'](_0x13a017[_0x13dc('0x35')]['ids']);}})[_0x13dc('0x29')](respondWithStatusCode(_0x1f0c05,null))[_0x13dc('0x46')](handleError(_0x1f0c05,null));};exports[_0x13dc('0x6b')]=function(_0x210ce6,_0x4c33ab){var _0x181c0b={};if(!_0x210ce6[_0x13dc('0x35')][_0x13dc('0x6c')])throw new Error('Missing\x20section\x20parameter');if(!_0x210ce6[_0x13dc('0x35')][_0x13dc('0x6d')](_0x13dc('0x3b'))){_0x181c0b[_0x13dc('0x21')]=qs[_0x13dc('0x21')](_0x210ce6[_0x13dc('0x35')]['limit']);_0x181c0b[_0x13dc('0x20')]=qs[_0x13dc('0x20')](_0x210ce6[_0x13dc('0x35')][_0x13dc('0x20')]);}return db['UserProfile'][_0x13dc('0x47')]({'where':{'id':_0x210ce6[_0x13dc('0x4b')]['id']}})[_0x13dc('0x29')](function(_0x5c1c8d){if(!_0x5c1c8d)throw new Error(_0x13dc('0x6e')+_0x210ce6['params']['id']);return db[_0x13dc('0x30')][_0x13dc('0x6b')](_0x210ce6);})['then'](respondWithFilteredResult(_0x4c33ab,_0x181c0b))[_0x13dc('0x46')](handleError(_0x4c33ab,null));}; \ No newline at end of file +var _0xc97f=['Dashboard','forEach','resourceId','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filters','filter','options','includeAll','include','rows','catch','params','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','merge','each','autoAssociation','findAll','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','destroy','describe','push','ids','getSections','enabled','includes','isEmpty','subsections','concat'];(function(_0x25aa4c,_0x5b671f){var _0x332bcd=function(_0x193764){while(--_0x193764){_0x25aa4c['push'](_0x25aa4c['shift']());}};_0x332bcd(++_0x5b671f);}(_0xc97f,0x147));var _0xfc97=function(_0x1d35a3,_0x18d2ee){_0x1d35a3=_0x1d35a3-0x0;var _0x5acd09=_0xc97f[_0x1d35a3];return _0x5acd09;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfc97('0x0'));var jsonpatch=require(_0xfc97('0x1'));var rp=require(_0xfc97('0x2'));var moment=require(_0xfc97('0x3'));var BPromise=require(_0xfc97('0x4'));var Mustache=require(_0xfc97('0x5'));var util=require(_0xfc97('0x6'));var path=require(_0xfc97('0x7'));var sox=require(_0xfc97('0x8'));var csv=require(_0xfc97('0x9'));var ejs=require(_0xfc97('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc97('0xb'));var squel=require(_0xfc97('0xc'));var crypto=require(_0xfc97('0xd'));var jsforce=require(_0xfc97('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfc97('0x9'));var querystring=require('querystring');var Papa=require(_0xfc97('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfc97('0x10'));var as=require(_0xfc97('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc97('0x12'))('api');var utils=require(_0xfc97('0x13'));var config=require(_0xfc97('0x14'));var licenseUtil=require(_0xfc97('0x15'));var db=require('../../mysqldb')['db'];config[_0xfc97('0x16')]=_[_0xfc97('0x17')](config[_0xfc97('0x16')],{'host':_0xfc97('0x18'),'port':0x18eb});var socket=require(_0xfc97('0x19'))(new Redis(config[_0xfc97('0x16')]));require(_0xfc97('0x1a'))[_0xfc97('0x1b')](socket);function respondWithStatusCode(_0x5776bc,_0x27016e){_0x27016e=_0x27016e||0xcc;return function(_0x5d5d53){if(_0x5d5d53){return _0x5776bc[_0xfc97('0x1c')](_0x27016e);}return _0x5776bc['status'](_0x27016e)[_0xfc97('0x1d')]();};}function respondWithResult(_0x5741a0,_0x15f7cc){_0x15f7cc=_0x15f7cc||0xc8;return function(_0x17c2d1){if(_0x17c2d1){return _0x5741a0[_0xfc97('0x1e')](_0x15f7cc)[_0xfc97('0x1f')](_0x17c2d1);}};}function respondWithFilteredResult(_0x3c0a50,_0x4284b1){return function(_0x467b6d){if(_0x467b6d){var _0x27fd47=typeof _0x4284b1[_0xfc97('0x20')]==='undefined'&&typeof _0x4284b1[_0xfc97('0x21')]===_0xfc97('0x22');var _0x292f3a=_0x467b6d['count'];var _0x354936=_0x27fd47?0x0:_0x4284b1[_0xfc97('0x20')];var _0x166bfa=_0x27fd47?_0x467b6d[_0xfc97('0x23')]:_0x4284b1[_0xfc97('0x20')]+_0x4284b1[_0xfc97('0x21')];var _0x2ca80c;if(_0x166bfa>=_0x292f3a){_0x166bfa=_0x292f3a;_0x2ca80c=0xc8;}else{_0x2ca80c=0xce;}_0x3c0a50['status'](_0x2ca80c);return _0x3c0a50['set'](_0xfc97('0x24'),_0x354936+'-'+_0x166bfa+'/'+_0x292f3a)['json'](_0x467b6d);}return null;};}function patchUpdates(_0x430b85){return function(_0x21526f){try{jsonpatch['apply'](_0x21526f,_0x430b85,!![]);}catch(_0x386b54){return BPromise[_0xfc97('0x25')](_0x386b54);}return _0x21526f['save']();};}function saveUpdates(_0x3f6d73,_0x5e61d8){return function(_0x303189){if(_0x303189){return _0x303189[_0xfc97('0x26')](_0x3f6d73)[_0xfc97('0x27')](function(_0x3cb072){return _0x3cb072;});}return null;};}function removeEntity(_0xace455,_0x2562eb){return function(_0x232ed7){if(_0x232ed7){return _0x232ed7['destroy']()[_0xfc97('0x27')](function(){_0xace455[_0xfc97('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f19e,_0x269cc9){return function(_0x251260){if(!_0x251260){_0x19f19e[_0xfc97('0x1c')](0x194);}return _0x251260;};}function handleError(_0x54dd43,_0x2410ac){_0x2410ac=_0x2410ac||0x1f4;return function(_0x56d970){logger[_0xfc97('0x28')](_0x56d970[_0xfc97('0x29')]);if(_0x56d970[_0xfc97('0x2a')]){delete _0x56d970[_0xfc97('0x2a')];}_0x54dd43['status'](_0x2410ac)[_0xfc97('0x2b')](_0x56d970);};}exports[_0xfc97('0x2c')]=function(_0x515797,_0x13540e){var _0x547436={},_0x56167f={},_0x3f59c5={'count':0x0,'rows':[]};var _0x7f096f=_[_0xfc97('0x2d')](db[_0xfc97('0x2e')][_0xfc97('0x2f')],function(_0xf04fa6){return{'name':_0xf04fa6['fieldName'],'type':_0xf04fa6['type'][_0xfc97('0x30')]};});_0x56167f[_0xfc97('0x31')]=_[_0xfc97('0x2d')](_0x7f096f,'name');_0x56167f['query']=_[_0xfc97('0x32')](_0x515797[_0xfc97('0x33')]);_0x56167f['filters']=_[_0xfc97('0x34')](_0x56167f[_0xfc97('0x31')],_0x56167f[_0xfc97('0x33')]);_0x547436['attributes']=_['intersection'](_0x56167f[_0xfc97('0x31')],qs['fields'](_0x515797[_0xfc97('0x33')][_0xfc97('0x35')]));_0x547436[_0xfc97('0x36')]=_0x547436[_0xfc97('0x36')][_0xfc97('0x37')]?_0x547436['attributes']:_0x56167f[_0xfc97('0x31')];if(!_0x515797[_0xfc97('0x33')][_0xfc97('0x38')]('nolimit')){_0x547436['limit']=qs[_0xfc97('0x21')](_0x515797[_0xfc97('0x33')]['limit']);_0x547436[_0xfc97('0x20')]=qs[_0xfc97('0x20')](_0x515797[_0xfc97('0x33')][_0xfc97('0x20')]);}_0x547436[_0xfc97('0x39')]=qs['sort'](_0x515797[_0xfc97('0x33')]['sort']);_0x547436[_0xfc97('0x3a')]=qs['filters'](_[_0xfc97('0x3b')](_0x515797[_0xfc97('0x33')],_0x56167f[_0xfc97('0x3c')]),_0x7f096f);if(_0x515797[_0xfc97('0x33')][_0xfc97('0x3d')]){_0x547436[_0xfc97('0x3a')]=_['merge'](_0x547436[_0xfc97('0x3a')],{'$or':_['map'](_0x7f096f,function(_0x456e66){if(_0x456e66['type']!=='VIRTUAL'){var _0x4f8fcc={};_0x4f8fcc[_0x456e66['name']]={'$like':'%'+_0x515797[_0xfc97('0x33')]['filter']+'%'};return _0x4f8fcc;}})});}_0x547436=_['merge']({},_0x547436,_0x515797[_0xfc97('0x3e')]);var _0x209843={'where':_0x547436[_0xfc97('0x3a')]};return db[_0xfc97('0x2e')][_0xfc97('0x23')](_0x209843)[_0xfc97('0x27')](function(_0x437034){_0x3f59c5[_0xfc97('0x23')]=_0x437034;if(_0x515797[_0xfc97('0x33')][_0xfc97('0x3f')]){_0x547436[_0xfc97('0x40')]=[{'all':!![]}];}return db[_0xfc97('0x2e')]['findAll'](_0x547436);})['then'](function(_0x700a36){_0x3f59c5[_0xfc97('0x41')]=_0x700a36;return _0x3f59c5;})[_0xfc97('0x27')](respondWithFilteredResult(_0x13540e,_0x547436))[_0xfc97('0x42')](handleError(_0x13540e,null));};exports['show']=function(_0x2ff1d7,_0x595be5){var _0x1b0b23={'raw':![],'where':{'id':_0x2ff1d7[_0xfc97('0x43')]['id']}},_0x4b2b89={};_0x4b2b89[_0xfc97('0x31')]=_[_0xfc97('0x32')](db['UserProfile'][_0xfc97('0x2f')]);_0x4b2b89[_0xfc97('0x33')]=_['keys'](_0x2ff1d7[_0xfc97('0x33')]);_0x4b2b89[_0xfc97('0x3c')]=_[_0xfc97('0x34')](_0x4b2b89[_0xfc97('0x31')],_0x4b2b89[_0xfc97('0x33')]);_0x1b0b23['attributes']=_[_0xfc97('0x34')](_0x4b2b89['model'],qs[_0xfc97('0x35')](_0x2ff1d7['query'][_0xfc97('0x35')]));_0x1b0b23[_0xfc97('0x36')]=_0x1b0b23[_0xfc97('0x36')][_0xfc97('0x37')]?_0x1b0b23[_0xfc97('0x36')]:_0x4b2b89[_0xfc97('0x31')];if(_0x2ff1d7[_0xfc97('0x33')][_0xfc97('0x3f')]){_0x1b0b23[_0xfc97('0x40')]=[{'all':!![]}];}_0x1b0b23=_['merge']({},_0x1b0b23,_0x2ff1d7['options']);return db[_0xfc97('0x2e')][_0xfc97('0x44')](_0x1b0b23)[_0xfc97('0x27')](handleEntityNotFound(_0x595be5,null))[_0xfc97('0x27')](respondWithResult(_0x595be5,null))[_0xfc97('0x42')](handleError(_0x595be5,null));};exports[_0xfc97('0x45')]=function(_0x1151bb,_0x54bf57){return db[_0xfc97('0x2e')]['create'](_0x1151bb[_0xfc97('0x46')],{})['then'](respondWithResult(_0x54bf57,0xc9))[_0xfc97('0x42')](handleError(_0x54bf57,null));};exports['clone']=function(_0x31bae5,_0x28926d){var _0x3aefdc={'where':{'id':_0x31bae5[_0xfc97('0x43')]['id']}},_0x33d286={};_0x33d286[_0xfc97('0x31')]=_[_0xfc97('0x32')](db[_0xfc97('0x2e')][_0xfc97('0x2f')]);_0x3aefdc['attributes']=_['intersection'](_0x33d286[_0xfc97('0x31')],qs['fields'](_0x31bae5['query'][_0xfc97('0x35')]));_0x3aefdc[_0xfc97('0x36')]=_0x3aefdc['attributes'][_0xfc97('0x37')]?_0x3aefdc['attributes']:_0x33d286[_0xfc97('0x31')];if(_0x31bae5['query'][_0xfc97('0x3f')]){_0x3aefdc[_0xfc97('0x40')]=[{'all':!![]}];}_0x3aefdc=_['merge']({},_0x3aefdc,_0x31bae5[_0xfc97('0x3e')]);return db['UserProfile'][_0xfc97('0x44')](_0x3aefdc)['then'](handleEntityNotFound(_0x28926d,null))[_0xfc97('0x27')](function(_0x18087f){if(_0x18087f){var _0x29636a=_0x18087f[_0xfc97('0x47')]({'plain':!![]});_0x29636a=qs[_0xfc97('0x48')](_0x29636a,['id',_0xfc97('0x49'),_0xfc97('0x4a'),_0xfc97('0x4b')]);_0x31bae5[_0xfc97('0x46')]=_[_0xfc97('0x48')](_0x31bae5[_0xfc97('0x46')],['id','createdAt',_0xfc97('0x4a')]);return db[_0xfc97('0x4c')][_0xfc97('0x4d')](function(_0x25d6dc){return db['UserProfile'][_0xfc97('0x45')](_[_0xfc97('0x4e')](_0x29636a,_0x31bae5[_0xfc97('0x46')]),{'include':_0x31bae5[_0xfc97('0x33')][_0xfc97('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x25d6dc})[_0xfc97('0x27')](function(_0x9763b3){var _0x395ad0=_0x9763b3['get']({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x31bae5[_0xfc97('0x43')]['id']},'raw':!![]})[_0xfc97('0x27')](function(_0x2bdf67){if(_0x2bdf67){return BPromise[_0xfc97('0x4f')](_0x2bdf67,function(_0x33395a){return new BPromise(function(_0x577f8d,_0x3ecb9a){if(_0x33395a[_0xfc97('0x50')]===null||_0x33395a['autoAssociation']===0x1)_0x577f8d(null);return db['UserProfileResource'][_0xfc97('0x51')]({'where':{'sectionId':_0x33395a['id']},'raw':!![]})[_0xfc97('0x27')](function(_0x2d1e5f){var _0x4d505d=_[_0xfc97('0x2d')](_0x2d1e5f,function(_0x4b4cb9){return qs[_0xfc97('0x48')](_0x4b4cb9,['id',_0xfc97('0x49'),_0xfc97('0x4a'),_0xfc97('0x52')]);});_0x577f8d(_0x4d505d);})[_0xfc97('0x42')](function(_0x40762d){_0x3ecb9a(_0x40762d);});})[_0xfc97('0x27')](function(_0x29abd6){var _0x27bac9=qs[_0xfc97('0x48')](_0x33395a,['id',_0xfc97('0x49'),_0xfc97('0x4a')]);_0x27bac9[_0xfc97('0x53')]=_0x395ad0['id'];if(_0x29abd6)_0x27bac9[_0xfc97('0x54')]=_0x29abd6;return _0x27bac9;})[_0xfc97('0x27')](function(_0x5c0d9b){return db[_0xfc97('0x55')][_0xfc97('0x45')](_0x5c0d9b,{'include':[{'model':db[_0xfc97('0x56')],'as':_0xfc97('0x54')}],'raw':!![],'transaction':_0x25d6dc});});})[_0xfc97('0x27')](function(){return _0x395ad0;});}});});});}})[_0xfc97('0x27')](respondWithResult(_0x28926d,0xc9))[_0xfc97('0x42')](handleError(_0x28926d,null));};exports[_0xfc97('0x26')]=function(_0x2e22cf,_0xf9b3ab){if(_0x2e22cf[_0xfc97('0x46')]['id']){delete _0x2e22cf['body']['id'];}return db[_0xfc97('0x2e')][_0xfc97('0x44')]({'where':{'id':_0x2e22cf[_0xfc97('0x43')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0xf9b3ab,null))[_0xfc97('0x27')](saveUpdates(_0x2e22cf[_0xfc97('0x46')],null))[_0xfc97('0x27')](respondWithResult(_0xf9b3ab,null))['catch'](handleError(_0xf9b3ab,null));};exports[_0xfc97('0x57')]=function(_0xa895f1,_0x316fb3){return db[_0xfc97('0x2e')][_0xfc97('0x44')]({'where':{'id':_0xa895f1[_0xfc97('0x43')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x316fb3,null))[_0xfc97('0x27')](removeEntity(_0x316fb3,null))[_0xfc97('0x42')](handleError(_0x316fb3,null));};exports['describe']=function(_0x49dbbc,_0x562e0e){return db[_0xfc97('0x2e')][_0xfc97('0x58')]()[_0xfc97('0x27')](respondWithResult(_0x562e0e,null))['catch'](handleError(_0x562e0e,null));};exports['addSections']=function(_0x30eb0c,_0x3a9250){var _0x11e30b=_0x30eb0c['body'];return db['UserProfile'][_0xfc97('0x44')]({'where':{'id':_0x30eb0c[_0xfc97('0x43')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x3a9250,null))[_0xfc97('0x27')](function(_0x3067d5){if(_0x3067d5){return db[_0xfc97('0x4c')]['transaction'](function(_0x10e371){return db['UserProfileSection'][_0xfc97('0x57')]({'where':{'userProfileId':_0x30eb0c[_0xfc97('0x43')]['id'],'sectionId':_[_0xfc97('0x2d')](_0x11e30b,function(_0x5587ae){return _0x5587ae['sectionId'];})},'transaction':_0x10e371})[_0xfc97('0x27')](function(){var _0x2b042b=_[_0xfc97('0x2d')](_0x11e30b,function(_0x5b9bf4){_0x5b9bf4[_0xfc97('0x53')]=_0x30eb0c[_0xfc97('0x43')]['id'];return _0x5b9bf4;});var _0x2123a0=[];return BPromise['each'](_0x2b042b,function(_0xbc93c7){return db[_0xfc97('0x55')][_0xfc97('0x45')](_0xbc93c7,{'include':[{'model':db[_0xfc97('0x56')],'as':_0xfc97('0x54')}],'raw':!![],'transaction':_0x10e371})[_0xfc97('0x27')](function(_0x41be6d){_0x2123a0[_0xfc97('0x59')](_0x41be6d[_0xfc97('0x47')]({'plain':!![]}));});})[_0xfc97('0x27')](function(){return _0x2123a0;});});});}})[_0xfc97('0x27')](function(_0x12509d){return _0x12509d;})[_0xfc97('0x27')](respondWithResult(_0x3a9250,null))['catch'](handleError(_0x3a9250,null));};exports['removeSections']=function(_0x158354,_0x3f6692){var _0x41af09;return db['UserProfile'][_0xfc97('0x44')]({'where':{'id':_0x158354[_0xfc97('0x43')]['id']},'attributes':['id',_0xfc97('0x2a')]})[_0xfc97('0x27')](handleEntityNotFound(_0x3f6692,null))[_0xfc97('0x27')](function(_0x516be2){if(_0x516be2){_0x41af09=_0x516be2;return db[_0xfc97('0x55')][_0xfc97('0x57')]({'where':{'userProfileId':_0x158354[_0xfc97('0x43')]['id'],'sectionId':_0x158354[_0xfc97('0x33')][_0xfc97('0x5a')]}});}})[_0xfc97('0x27')](function(){return _0x41af09;})[_0xfc97('0x27')](respondWithStatusCode(_0x3f6692,null))['catch'](handleError(_0x3f6692,null));};exports[_0xfc97('0x5b')]=function(_0xf8f0e,_0x3f5192){var _0x4e8cf3=[];var _0x5a5ad0=[];return db[_0xfc97('0x55')][_0xfc97('0x51')]({'where':{'userProfileId':_0xf8f0e[_0xfc97('0x43')]['id']},'raw':!![]})['then'](function(_0x2e40cb){_0x4e8cf3=_[_0xfc97('0x3d')](_0x2e40cb,function(_0x4cd3ea){return _0x4cd3ea[_0xfc97('0x5c')]===0x1||_[_0xfc97('0x5d')]([0x3eb,0x709],_0x4cd3ea[_0xfc97('0x52')]);});if(!_[_0xfc97('0x5e')](_0x4e8cf3)){return _[_0xfc97('0x2d')](_0x4e8cf3,function(_0x13667e){return _0x13667e[_0xfc97('0x52')];});}else{return;}})['then'](function(_0x4b754f){if(_0x4b754f)_0x5a5ad0=_0x4b754f;if(_[_0xfc97('0x5d')](_0x5a5ad0,0x64)){var _0x11b6f8=_['find'](_0x4e8cf3,{'sectionId':0x64});return hasDefaultDashboard(_0x11b6f8)[_0xfc97('0x27')](function(_0x42fa83){return _[_0xfc97('0x2d')](_0x4e8cf3,function(_0x441998){if(_0x441998[_0xfc97('0x52')]===0x64){_0x441998['subsections']=_0x42fa83;}return _0x441998;});});}else{return;}})[_0xfc97('0x27')](function(_0x1314b8){if(_0x1314b8)_0x4e8cf3=_0x1314b8;if(_[_0xfc97('0x5d')](_0x5a5ad0,0x3eb)){var _0x4d5f8=_[_0xfc97('0x44')](_0x4e8cf3,{'sectionId':0x3eb});return getCustomDashboards(_0x4d5f8)[_0xfc97('0x27')](function(_0x4f0cb7){return _['map'](_0x4e8cf3,function(_0x469921){if(_0x4d5f8[_0xfc97('0x5c')]){if(_0x469921[_0xfc97('0x52')]===0x3eb){_0x469921[_0xfc97('0x5f')]=_0x4f0cb7;}}else{if(_0x469921[_0xfc97('0x52')]===0x64){if(!_0x469921[_0xfc97('0x5f')]){_0x469921['subsections']=[];}_0x469921[_0xfc97('0x5f')]=_0x469921[_0xfc97('0x5f')][_0xfc97('0x60')](_0x4f0cb7);}}return _0x469921;});});}else{return;}})[_0xfc97('0x27')](function(_0x43db13){if(_0x43db13)_0x4e8cf3=_0x43db13;if(_[_0xfc97('0x5d')](_0x5a5ad0,0x709)){var _0x3952e6=_[_0xfc97('0x44')](_0x4e8cf3,{'sectionId':0x709});return getPlugins(_0x3952e6)[_0xfc97('0x27')](function(_0x5e22b6){if(_0x3952e6['enabled']){return _[_0xfc97('0x2d')](_0x4e8cf3,function(_0x57f824){if(_0x57f824[_0xfc97('0x52')]===0x709){_0x57f824['subsections']=_0x5e22b6;}return _0x57f824;});}else{var _0x261983={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5e22b6};var _0x154e37=_[_0xfc97('0x2d')](_0x4e8cf3);_0x154e37[_0xfc97('0x59')](_0x261983);return _0x154e37;}});}else{return;}})[_0xfc97('0x27')](function(_0x5d9dc2){if(_0x5d9dc2)_0x4e8cf3=_0x5d9dc2;return _[_0xfc97('0x3d')](_0x4e8cf3,[_0xfc97('0x5c'),0x1]);})[_0xfc97('0x27')](respondWithResult(_0x3f5192,null))['catch'](handleError(_0x3f5192,null));};function hasDefaultDashboard(_0x603b0){var _0x47c5ed=[0x65];return new BPromise(function(_0x2a817c,_0x51e647){try{if(_0x603b0[_0xfc97('0x50')]){_0x2a817c(_0x47c5ed);}else{return db[_0xfc97('0x56')]['findOne']({'where':{'sectionId':_0x603b0['id']},'raw':!![]})[_0xfc97('0x27')](function(_0x161178){_0x161178?_0x2a817c(_0x47c5ed):_0x2a817c();});}}catch(_0x2bb628){_0x51e647(_0x2bb628);}});}function getCustomDashboards(_0x24178d){var _0x22451d=[];return new BPromise(function(_0x14aaf8,_0x242020){try{if(_0x24178d[_0xfc97('0x50')]){return db[_0xfc97('0x61')][_0xfc97('0x51')]({'raw':!![]})[_0xfc97('0x27')](function(_0x932788){_0x932788[_0xfc97('0x62')](function(_0x49cc44){_0x22451d['push'](_0x49cc44['id']+0x1869f);});_0x14aaf8(_0x22451d);});}else{return db[_0xfc97('0x56')][_0xfc97('0x51')]({'where':{'sectionId':_0x24178d['id']},'raw':!![]})[_0xfc97('0x27')](function(_0x552363){_0x552363[_0xfc97('0x62')](function(_0xf6ee12){_0x22451d[_0xfc97('0x59')](_0xf6ee12[_0xfc97('0x63')]+0x1869f);});_0x14aaf8(_0x22451d);});}}catch(_0xb31eea){_0x242020(_0xb31eea);}});}function getPlugins(_0x4603d5){var _0x2f888e=[];return new BPromise(function(_0x563b75,_0x26384e){try{if(_0x4603d5[_0xfc97('0x50')]){return db['Plugin'][_0xfc97('0x51')]({'raw':!![]})['then'](function(_0x3bff25){_0x3bff25['forEach'](function(_0x6fa0d0){_0x2f888e[_0xfc97('0x59')](_0x6fa0d0['id']+0x15b38);});_0x563b75(_0x2f888e);});}else{return db[_0xfc97('0x56')][_0xfc97('0x51')]({'where':{'sectionId':_0x4603d5['id']},'raw':!![]})[_0xfc97('0x27')](function(_0x308f2e){_0x308f2e[_0xfc97('0x62')](function(_0x20ab8b){_0x2f888e[_0xfc97('0x59')](_0x20ab8b[_0xfc97('0x63')]+0x15b38);});_0x563b75(_0x2f888e);});}}catch(_0x2a4b84){_0x26384e(_0x2a4b84);}});}exports['addResources']=function(_0xccbd0e,_0x1c1b98){return db['UserProfile'][_0xfc97('0x44')]({'where':{'id':_0xccbd0e[_0xfc97('0x43')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x1c1b98,null))[_0xfc97('0x27')](function(_0x43ffc8){if(_0x43ffc8){return db[_0xfc97('0x4c')][_0xfc97('0x4d')](function(_0x5db63f){return db['UserProfileSection'][_0xfc97('0x51')]({'where':{'userProfileId':_0xccbd0e[_0xfc97('0x43')]['id']},'attributes':['id'],'raw':!![]})[_0xfc97('0x27')](function(_0x51287d){if(_0x51287d){return db[_0xfc97('0x55')][_0xfc97('0x57')]({'where':{'userProfileId':_0xccbd0e[_0xfc97('0x43')]['id'],'id':_[_0xfc97('0x2d')](_0x51287d,function(_0x36477e){return _0x36477e['id'];})},'transaction':_0x5db63f});}})[_0xfc97('0x27')](function(_0x2ecbac){var _0x54205c=_[_0xfc97('0x2d')](_0xccbd0e['body'],function(_0x2e644c){_0x2e644c[_0xfc97('0x53')]=_0xccbd0e[_0xfc97('0x43')]['id'];return _0x2e644c;});return db[_0xfc97('0x55')][_0xfc97('0x64')](_0x54205c,{'raw':!![],'transaction':_0x5db63f});})[_0xfc97('0x27')](function(_0xcae1d3){var _0x32bdcb=_[_0xfc97('0x3d')](_[_0xfc97('0x2d')](_0xcae1d3,function(_0x57da59){return _0x57da59['get']({'plain':!![]});}),{'includeAll':![]});if(_0x32bdcb){return db[_0xfc97('0x55')]['findAll']({'where':{'userProfileId':_0xccbd0e[_0xfc97('0x43')]['id'],'sectionId':_[_0xfc97('0x2d')](_0x32bdcb,function(_0x292531){return _0x292531[_0xfc97('0x52')];})},'attributes':['id',_0xfc97('0x52')],'raw':!![]})[_0xfc97('0x27')](function(_0x52054e){var _0x46a6b5=_[_0xfc97('0x2d')](_0xccbd0e[_0xfc97('0x46')],function(_0x19c911){_0x19c911['userProfileId']=_0xccbd0e['params']['id'];return _0x19c911;});return db[_0xfc97('0x56')]['bulkCreate'](_0x46a6b5,{'raw':!![],'transaction':_0x5db63f});});}})['catch'](handleError(_0x1c1b98,null));});}})['then'](function(_0x266898){var _0x595362=_[_0xfc97('0x2d')](_0x266898,function(_0x1786e9){return _0x1786e9[_0xfc97('0x47')]({'plain':!![]});});})[_0xfc97('0x27')](respondWithResult(_0x1c1b98,null))[_0xfc97('0x42')](handleError(_0x1c1b98,null));};exports[_0xfc97('0x65')]=function(_0x16f1cd,_0x412e24,_0x3840a9){return db[_0xfc97('0x2e')][_0xfc97('0x44')]({'where':{'id':_0x16f1cd[_0xfc97('0x43')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x412e24,null))[_0xfc97('0x27')](function(_0x4538b1){if(_0x4538b1){return _0x4538b1[_0xfc97('0x65')](_0x16f1cd['query'][_0xfc97('0x5a')]);}})[_0xfc97('0x27')](respondWithStatusCode(_0x412e24,null))['catch'](handleError(_0x412e24,null));};exports[_0xfc97('0x66')]=function(_0x4ad791,_0x52f091){var _0x3ec8a1={};if(!_0x4ad791[_0xfc97('0x33')]['section'])throw new Error(_0xfc97('0x67'));if(!_0x4ad791[_0xfc97('0x33')][_0xfc97('0x38')](_0xfc97('0x68'))){_0x3ec8a1[_0xfc97('0x21')]=qs[_0xfc97('0x21')](_0x4ad791['query'][_0xfc97('0x21')]);_0x3ec8a1['offset']=qs[_0xfc97('0x20')](_0x4ad791[_0xfc97('0x33')][_0xfc97('0x20')]);}return db[_0xfc97('0x2e')][_0xfc97('0x44')]({'where':{'id':_0x4ad791[_0xfc97('0x43')]['id']}})['then'](function(_0x4ce635){if(!_0x4ce635)throw new Error(_0xfc97('0x69')+_0x4ad791['params']['id']);return db[_0xfc97('0x2e')][_0xfc97('0x66')](_0x4ad791);})['then'](respondWithFilteredResult(_0x52f091,_0x3ec8a1))['catch'](handleError(_0x52f091,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index ccc1fdb..b78bfbc 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 _0xc43c=['hook','exports','events','../../mysqldb','UserProfile','remove','emit'];(function(_0xe24841,_0x2c0f66){var _0x2e41b3=function(_0xd50fbe){while(--_0xd50fbe){_0xe24841['push'](_0xe24841['shift']());}};_0x2e41b3(++_0x2c0f66);}(_0xc43c,0xd4));var _0xcc43=function(_0x2fad03,_0x490c10){_0x2fad03=_0x2fad03-0x0;var _0x29c27d=_0xc43c[_0x2fad03];return _0x29c27d;};'use strict';var EventEmitter=require(_0xcc43('0x0'));var UserProfile=require(_0xcc43('0x1'))['db'][_0xcc43('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcc43('0x3')};function emitEvent(_0x482ebc){return function(_0x484b53,_0x4c59cc,_0x37e84f){UserProfileEvents[_0xcc43('0x4')](_0x482ebc+':'+_0x484b53['id'],_0x484b53);UserProfileEvents[_0xcc43('0x4')](_0x482ebc,_0x484b53);_0x37e84f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xcc43('0x5')](e,emitEvent(event));}}module[_0xcc43('0x6')]=UserProfileEvents; \ No newline at end of file +var _0xffd6=['../../mysqldb','UserProfile','update','remove','emit','hook','exports','events'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0xffd6,0x97));var _0x6ffd=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xffd6[_0x13b8f3];return _0x1a6d06;};'use strict';var EventEmitter=require(_0x6ffd('0x0'));var UserProfile=require(_0x6ffd('0x1'))['db'][_0x6ffd('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ffd('0x3'),'afterDestroy':_0x6ffd('0x4')};function emitEvent(_0x39fd49){return function(_0x560afa,_0x1d12e3,_0x173979){UserProfileEvents[_0x6ffd('0x5')](_0x39fd49+':'+_0x560afa['id'],_0x560afa);UserProfileEvents[_0x6ffd('0x5')](_0x39fd49,_0x560afa);_0x173979(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6ffd('0x6')](e,emitEvent(event));}}module[_0x6ffd('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 1cd2a18..f3567a1 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 _0x1e99=['Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','params','ignore','isEmpty','union','autoAssociation','push','model','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','key','foreignKey','forEach','merge','options','include','reportType','default','reportId','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','ThroughTags','Agents','openTabs','true','chat','dataValues','sms','fax','mail','whatsapp','./userProfile.attributes','exports','models','filter','field','findAll','associatedResources','map','catch','then','name','resolve','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','pauses','Pause','scheduler','Schedule','sounds'];(function(_0x402cfa,_0x54f074){var _0x3ba2b1=function(_0x8d472e){while(--_0x8d472e){_0x402cfa['push'](_0x402cfa['shift']());}};_0x3ba2b1(++_0x54f074);}(_0x1e99,0x1db));var _0x91e9=function(_0x24082b,_0x495382){_0x24082b=_0x24082b-0x0;var _0x223b78=_0x1e99[_0x24082b];return _0x223b78;};'use strict';var _=require('lodash');var attributes=require(_0x91e9('0x0'));var squel=require('squel');module[_0x91e9('0x1')]=function(_0x5e9daf){var _0x37d95e=_0x5e9daf[_0x91e9('0x2')];function _0xe81b25(_0x49ba5d,_0x3fa784){return new Promise(function(_0x262a0,_0x49bf40){if(!_0x3fa784)return _0x262a0(null);var _0x2bcc8b=_0x3fa784[_0x91e9('0x3')]?{[_0x3fa784['filter'][_0x91e9('0x4')]]:_0x3fa784[_0x91e9('0x3')]['value']}:undefined;return _0x37d95e[_0x49ba5d][_0x91e9('0x5')]({'where':_0x2bcc8b,'raw':!![]})['then'](function(_0x5abbed){_0x3fa784[_0x91e9('0x6')]=_[_0x91e9('0x7')](_0x5abbed,'id');_0x262a0(_0x3fa784);})[_0x91e9('0x8')](function(_0x1b0413){_0x49bf40(_0x1b0413);});});}function _0x412e4e(_0x476030,_0x3af8e4){return new Promise(function(_0x178f84,_0x530e9e){var _0x33bba5=_0x476030[_0x91e9('0x3')]?{[_0x476030[_0x91e9('0x3')][_0x91e9('0x4')]]:_0x476030[_0x91e9('0x3')]['value']}:undefined;return _0x37d95e[_0x476030['model']]['findAll']({'where':_0x33bba5,'raw':!![]})[_0x91e9('0x9')](function(_0xbff871){_0x3af8e4['associatedResources']=_[_0x91e9('0x7')](_0xbff871,function(_0xf128f9){return _0xf128f9[_0x91e9('0xa')];});_0x178f84(_0x3af8e4);})[_0x91e9('0x8')](function(_0x571be6){_0x530e9e(_0x571be6);});});}function _0xcf0253(_0xfa1fe1,_0x10d225,_0x3abf14){if(!_0x10d225)return Promise[_0x91e9('0xb')](null);return new Promise(function(_0x5622d6,_0xdebd64){return _0x37d95e['UserProfileResource']['findAll']({'where':{'sectionId':_0x10d225['id']},'raw':!![]})[_0x91e9('0x9')](function(_0x2426b4){if(_0xfa1fe1[_0x91e9('0x4')]&&_0xfa1fe1['field']!=='id'){_0x10d225[_0x91e9('0x6')]=_[_0x91e9('0x7')](_0x2426b4,function(_0x1b62a7){return _0x1b62a7[_0xfa1fe1['field']];});}else{if(_0x3abf14===_0x91e9('0xc')){_0x10d225['associatedResources']=_['map'](_0x2426b4,function(_0x3439ff){return{'id':_0x3439ff['resourceId'],'type':_0x3439ff[_0x91e9('0xd')]};});}else{_0x10d225[_0x91e9('0x6')]=_[_0x91e9('0x7')](_0x2426b4,function(_0x5d8223){return _0x5d8223[_0x91e9('0xe')];});}}_0x5622d6(_0x10d225);})['catch'](function(_0x258d58){_0xdebd64(_0x258d58);});});}function _0x3aa485(_0x3682af,_0x94f172){var _0x8d2471={'parentSections':[]};switch(_0x3682af[_0x91e9('0xf')]()){case _0x91e9('0x10'):_0x8d2471['childModel']='SquareProject';break;case _0x91e9('0x11'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x13');break;case _0x91e9('0x14'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x15');_0x8d2471[_0x91e9('0x16')]=[{'name':_0x91e9('0x17'),'field':_0x91e9('0xa'),'foreignKey':_0x91e9('0x18')}];break;case'projects':_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x19');break;case _0x91e9('0x1a'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x1b');_0x8d2471[_0x91e9('0x16')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x91e9('0x1c'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x1d');break;case _0x91e9('0x1e'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x1f');break;case _0x91e9('0x20'):_0x8d2471['childModel']=_0x91e9('0x21');break;case _0x91e9('0x22'):_0x8d2471['childModel']=_0x91e9('0x23');break;case _0x91e9('0x24'):_0x8d2471['childModel']=_0x91e9('0x25');break;case _0x91e9('0x26'):_0x8d2471['childModel']=_0x91e9('0x27');break;case _0x91e9('0x28'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x29');break;case _0x91e9('0x2a'):case _0x91e9('0x2b'):case'outboundroutes':_0x8d2471['childModel']=_0x91e9('0x2c');break;case _0x91e9('0x2d'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x2e');break;case _0x91e9('0x2f'):_0x8d2471['childModel']='VoiceMail';break;case _0x91e9('0x30'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x31');_0x8d2471[_0x91e9('0x16')]=[{'name':'Agents','field':_0x91e9('0xa'),'foreignKey':_0x91e9('0x32'),'model':_0x91e9('0x33'),'filter':{'field':_0x91e9('0x34'),'value':[_0x91e9('0x35')]}},{'name':_0x91e9('0x36'),'field':_0x91e9('0xa'),'foreignKey':_0x91e9('0x32'),'model':_0x91e9('0x33'),'filter':{'field':'role','value':[_0x91e9('0x37')]}},{'name':_0x91e9('0x38'),'field':_0x91e9('0xa'),'foreignKey':_0x91e9('0x39'),'model':_0x91e9('0x3a'),'filter':{'field':_0x91e9('0xd'),'value':[_0x91e9('0x3b')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x91e9('0x39'),'model':'VoiceQueue','filter':{'field':_0x91e9('0xd'),'value':[_0x91e9('0x3c')]}}];break;case _0x91e9('0x3d'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x3e');break;case _0x91e9('0x3f'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x40');break;case _0x91e9('0x41'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x42');break;case _0x91e9('0x43'):_0x8d2471['childModel']=_0x91e9('0x44');break;case'mailqueues':_0x8d2471[_0x91e9('0x12')]='MailQueue';break;case _0x91e9('0x45'):_0x8d2471[_0x91e9('0x12')]='MailAccount';break;case _0x91e9('0x46'):_0x8d2471[_0x91e9('0x12')]='MailSubstatus';break;case _0x91e9('0x47'):_0x8d2471['childModel']='OpenchannelQueue';break;case _0x91e9('0x48'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x49');break;case'smsqueues':_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x4a');break;case _0x91e9('0x4b'):_0x8d2471['childModel']=_0x91e9('0x4c');break;case _0x91e9('0x4d'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x4e');break;case _0x91e9('0x4f'):_0x8d2471['childModel']='WhatsappAccount';break;case'teams':_0x8d2471['childModel']=_0x91e9('0x50');break;case _0x91e9('0x51'):case _0x91e9('0x52'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x3a');if(_0x94f172){_0x8d2471[_0x91e9('0x16')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x91e9('0x53'):case _0x91e9('0x54'):case _0x91e9('0x55'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x33');if(_0x94f172){_0x8d2471[_0x91e9('0x16')]=[{'name':_0x91e9('0x56'),'filter':{'field':_0x91e9('0x34'),'value':[_0x91e9('0x57'),_0x91e9('0x58')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x91e9('0x59'):_0x8d2471[_0x91e9('0x12')]='ZendeskAccount';break;case _0x91e9('0x5a'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x5b');break;case _0x91e9('0x5c'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x5d');break;case _0x91e9('0x5e'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x5f');break;case _0x91e9('0x60'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x61');break;case'zohoaccounts':_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x62');break;case _0x91e9('0x63'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x33');break;case _0x91e9('0x64'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x65');break;case _0x91e9('0x66'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x67');break;case _0x91e9('0x68'):_0x8d2471[_0x91e9('0x12')]='Dashboard';break;case'intervals':_0x8d2471['childModel']='Interval';break;case _0x91e9('0x69'):_0x8d2471['childModel']=_0x91e9('0x6a');break;case _0x91e9('0x6b'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x6c');break;case _0x91e9('0x6d'):_0x8d2471['childModel']=_0x91e9('0x6e');break;case _0x91e9('0x6f'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x70');break;case _0x91e9('0x71'):_0x8d2471[_0x91e9('0x12')]='Template';break;case _0x91e9('0x72'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x73');break;case _0x91e9('0x74'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x75');break;case _0x91e9('0x76'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0x77');break;case'plugins':_0x8d2471['childModel']=_0x91e9('0x78');break;case _0x91e9('0x79'):_0x8d2471[_0x91e9('0x12')]=_0x91e9('0xc');_0x8d2471[_0x91e9('0x16')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case'metrics':_0x8d2471[_0x91e9('0x12')]='AnalyticMetric';break;}return _0x8d2471;}function _0x322c94(_0x4a055b,_0x2b62ff){var _0x1eb868=_0x4a055b['charAt'](0x0)[_0x91e9('0x7a')]()+_0x4a055b[_0x91e9('0x7b')](0x1);var _0x58a1ad={'type':_0x37d95e[_0x91e9('0x7c')][_0x91e9('0x7d')][_0x91e9('0x7e')],'raw':!![]};return new Promise(function(_0x2cd069,_0x3ea7ea){var _0x115369=squel[_0x91e9('0x7f')]()[_0x91e9('0x4')](_0x91e9('0x80')+_0x1eb868+'InteractionId','id')[_0x91e9('0x4')](_0x91e9('0x81'))['from'](_0x91e9('0x82')+_0x4a055b+_0x91e9('0x83'),'ui')[_0x91e9('0x84')]('ui.UserId\x20=\x20?',_0x2b62ff['id']);return _0x37d95e[_0x91e9('0x85')][_0x91e9('0x86')](_0x115369[_0x91e9('0x87')](),_0x58a1ad)[_0x91e9('0x9')](function(_0x583980){_0x2b62ff[_0x1eb868+_0x91e9('0x88')]=_0x583980;_0x2cd069(_0x583980);})[_0x91e9('0x8')](function(_0x521cf4){_0x3ea7ea(_0x521cf4);});});}return _0x5e9daf[_0x91e9('0x89')](_0x91e9('0x8a'),attributes,{'tableName':_0x91e9('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x53e6b3){var _0x263f2a=require(_0x91e9('0x8c'));var _0x4d011e={'raw':_0x53e6b3[_0x91e9('0x86')][_0x91e9('0x8d')],'where':{}};var _0x53cb42={};var _0x17b48d={'count':0x0,'rows':[]};var _0x48dc1b=_0x53e6b3[_0x91e9('0x86')][_0x91e9('0x8e')];var _0x4f802a=_0x53e6b3[_0x91e9('0x86')][_0x91e9('0x8f')]||![];var _0x42009e=_0x3aa485(_0x48dc1b,_0x4f802a);if(!_0x42009e[_0x91e9('0x12')])throw new Error(_0x91e9('0x90')+_0x48dc1b+'\x27');var _0x2dc0f0=[{'name':_0x48dc1b}];if(!_['isEmpty'](_0x42009e[_0x91e9('0x16')]))_0x2dc0f0=_0x42009e['parentSections'];var _0x333507=[];for(var _0x486999=0x0;_0x486999<_0x2dc0f0[_0x91e9('0x91')];_0x486999++){_0x333507['push'](_0x37d95e[_0x91e9('0x92')][_0x91e9('0x93')]({'where':{'userProfileId':_0x53e6b3[_0x91e9('0x94')]['id'],'name':_0x2dc0f0[_0x486999]['name']},'raw':!![]}));}return Promise['all'](_0x333507)[_0x91e9('0x9')](function(_0x2de431){var _0x46ea71=_['filter'](_0x2de431,function(_0x3ddbf9){return _0x3ddbf9?_0x3ddbf9:undefined;});var _0x303bd5=_[_0x91e9('0x3')](_0x2dc0f0,[_0x91e9('0x95'),!![]]);var _0x570f61=_[_0x91e9('0x96')](_0x46ea71)&&_[_0x91e9('0x96')](_0x303bd5)?null:_[_0x91e9('0x97')](_0x303bd5,_0x46ea71);if(!_0x570f61)return null;var _0x5e47e0=[];for(var _0x27104a=0x0;_0x27104a<_0x570f61[_0x91e9('0x91')];_0x27104a++){var _0x40ca04=_[_0x91e9('0x93')](_0x2dc0f0,function(_0x540ecc){return _0x570f61[_0x27104a]?_0x540ecc[_0x91e9('0xa')]===_0x570f61[_0x27104a][_0x91e9('0xa')]:null;});if(_0x40ca04){if(_0x570f61[_0x27104a][_0x91e9('0x95')]){_0x5e47e0['push'](_0xe81b25(_0x42009e[_0x91e9('0x12')],_0x570f61[_0x27104a]));}else{if(!_0x570f61[_0x27104a][_0x91e9('0x98')]){_0x5e47e0[_0x91e9('0x99')](_0xcf0253(_0x40ca04,_0x570f61[_0x27104a],_0x42009e[_0x91e9('0x12')]));}else{if(_0x40ca04[_0x91e9('0x9a')]){_0x5e47e0[_0x91e9('0x99')](_0x412e4e(_0x40ca04,_0x570f61[_0x27104a]));}}}}}return Promise[_0x91e9('0x9b')](_0x5e47e0);})[_0x91e9('0x9')](function(_0x45b225){var _0x1ebfb6=_0x45b225;var _0x5eac45=null;if(_0x1ebfb6){_0x5eac45=_0x1ebfb6[_0x91e9('0x91')]===0x1?_0x1ebfb6[0x0]:null;}if(!_0x5eac45&&!_0x1ebfb6)return _0x17b48d;var _0x446f16=_0x37d95e[_0x42009e[_0x91e9('0x12')]][_0x91e9('0x9c')];_0x53cb42[_0x91e9('0x9a')]=_[_0x91e9('0x9d')](_0x446f16);_0x53cb42['query']=_['keys'](_0x53e6b3[_0x91e9('0x86')]);_0x53cb42[_0x91e9('0x9e')]=_[_0x91e9('0x9f')](_0x53cb42[_0x91e9('0x9a')],_0x53cb42[_0x91e9('0x86')]);_0x4d011e[_0x91e9('0xa0')]=_[_0x91e9('0x9f')](_0x53cb42[_0x91e9('0x9a')],_0x263f2a[_0x91e9('0xa1')](_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xa1')]));_0x4d011e[_0x91e9('0xa0')]=_0x4d011e[_0x91e9('0xa0')][_0x91e9('0x91')]?_0x4d011e[_0x91e9('0xa0')]:_0x53cb42[_0x91e9('0x9a')];if(!_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xa2')]('nolimit')){_0x4d011e['limit']=_0x263f2a['limit'](_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xa3')]);_0x4d011e['offset']=_0x263f2a[_0x91e9('0xa4')](_0x53e6b3['query']['offset']);}_0x4d011e[_0x91e9('0xa5')]=_0x263f2a['sort'](_0x53e6b3[_0x91e9('0x86')]['sort']);_0x4d011e[_0x91e9('0x84')]=_0x263f2a[_0x91e9('0x9e')](_['pick'](_0x53e6b3[_0x91e9('0x86')],_0x53cb42['filters']));if(_0x53e6b3[_0x91e9('0x86')]['filter']){_0x4d011e[_0x91e9('0x84')]=_['merge'](_0x4d011e[_0x91e9('0x84')],{'$or':_[_0x91e9('0x7')](_0x446f16,function(_0x183ec9){if(_0x183ec9[_0x91e9('0xd')][_0x91e9('0xa6')]!=='VIRTUAL'){var _0x31aab1={};_0x31aab1[_0x183ec9[_0x91e9('0x4')]]={'$like':'%'+_0x53e6b3['query'][_0x91e9('0x3')]+'%'};return _0x31aab1;}})});}var _0x2dfb9f=[];var _0x409e40=null;var _0x9d1829={};if(_0x5eac45){_0x409e40=_[_0x91e9('0x93')](_0x2dc0f0,['name',_0x5eac45[_0x91e9('0xa')]]);if(_0x409e40[_0x91e9('0x4')]){_0x9d1829={};if(_0x42009e[_0x91e9('0x12')]===_0x91e9('0xc')){_0x9d1829[_0x409e40[_0x91e9('0xa7')]]=_[_0x91e9('0x7')](_0x5eac45['associatedResources'],'id');}else{_0x9d1829[_0x409e40[_0x91e9('0xa7')]]=_0x5eac45[_0x91e9('0x6')];}_0x2dfb9f[_0x91e9('0x99')](_0x9d1829);}else{_0x4d011e['where']['id']=_0x5eac45['associatedResources'];}}else{for(var _0x3225bc=0x0;_0x3225bc<_0x1ebfb6[_0x91e9('0x91')];_0x3225bc++){_0x409e40=_['find'](_0x2dc0f0,['name',_0x1ebfb6[_0x3225bc]['name']]);if(_0x409e40[_0x91e9('0x4')]){_0x9d1829={};_0x9d1829[_0x409e40[_0x91e9('0xa7')]]=_0x1ebfb6[_0x3225bc][_0x91e9('0x6')];_0x2dfb9f[_0x91e9('0x99')](_0x9d1829);}else{if(!_0x4d011e[_0x91e9('0x84')]['id'])_0x4d011e[_0x91e9('0x84')]['id']=[];_0x1ebfb6[_0x3225bc][_0x91e9('0x6')][_0x91e9('0xa8')](function(_0x43db09){_0x4d011e['where']['id']['push'](_0x43db09);});}}}if(!_[_0x91e9('0x96')](_0x2dfb9f)){_0x4d011e[_0x91e9('0x84')]=_[_0x91e9('0xa9')](_0x4d011e[_0x91e9('0x84')],{'$and':{'$or':_0x2dfb9f}});}_0x4d011e=_[_0x91e9('0xa9')]({},_0x4d011e,_0x53e6b3[_0x91e9('0xaa')]);if(_0x5eac45&&!_0x5eac45[_0x91e9('0x98')]&&_0x42009e[_0x91e9('0x12')]===_0x91e9('0xc')){if(_0x53e6b3[_0x91e9('0x86')]['includeAll']){_0x4d011e[_0x91e9('0xab')]=[{'all':!![]}];}return _0x37d95e[_0x42009e['childModel']][_0x91e9('0x5')](_0x4d011e)[_0x91e9('0x9')](function(_0x3a84c0){var _0x5508d6=[];_0x3a84c0[_0x91e9('0xa8')](function(_0x54902d){var _0x5bd0f5;switch(_0x54902d[_0x91e9('0xac')]){case _0x91e9('0xad'):_0x5bd0f5=_[_0x91e9('0x93')](_0x5eac45['associatedResources'],function(_0x4db89c){return _0x4db89c['id']===_0x54902d[_0x91e9('0xae')]&&_0x4db89c[_0x91e9('0xd')]==='DefaultReports';});break;case _0x91e9('0xaf'):_0x5bd0f5=_['find'](_0x5eac45['associatedResources'],function(_0x3b9b72){return _0x3b9b72['id']===_0x54902d[_0x91e9('0xae')]&&_0x3b9b72[_0x91e9('0xd')]===_0x91e9('0xb0');});break;}if(_0x5bd0f5)_0x5508d6['push'](_0x54902d);});_0x17b48d[_0x91e9('0xb1')]=_0x5508d6['length'];_0x17b48d[_0x91e9('0xb2')]=_0x5508d6;return _0x17b48d;});}else{if(!_[_0x91e9('0x96')](_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xb3')])){_0x4d011e['where']['id']=_0x4d011e[_0x91e9('0x84')]['id']?_[_0x91e9('0x9f')](_0x4d011e['where']['id'],_0x53e6b3['query'][_0x91e9('0xb3')]):_0x53e6b3['query']['ids'];if(_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xb4')]){_0x4d011e[_0x91e9('0xa5')]=_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xb4')];}}if(_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xb5')]){_0x4d011e[_0x91e9('0x84')]=_[_0x91e9('0xa9')](_0x4d011e['where'],{'$and':_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xb5')]});}return _0x37d95e[_0x42009e[_0x91e9('0x12')]][_0x91e9('0xb1')]({'where':_0x4d011e[_0x91e9('0x84')]})[_0x91e9('0x9')](function(_0x8ed82a){_0x17b48d[_0x91e9('0xb1')]=_0x8ed82a;if(_0x53e6b3[_0x91e9('0x86')]['includeAll']){if(_0x42009e[_0x91e9('0x12')]==='CmContact'){_0x4d011e[_0x91e9('0xab')]=[{'model':_0x37d95e[_0x91e9('0x70')],'as':_0x91e9('0xb6'),'attributes':['id',_0x91e9('0xa'),_0x91e9('0xb7')],'required':_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xb8')]?!![]:![]},{'model':_0x37d95e[_0x91e9('0x70')],'as':_0x91e9('0xb9'),'attributes':['id',_0x91e9('0xa'),_0x91e9('0xb7')],'through':_0x53e6b3['query'][_0x91e9('0xb8')]?{'attributes':[],'where':{'TagId':_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xb8')]||undefined}}:{},'required':_0x53e6b3['query'][_0x91e9('0xb8')]?!![]:![]}];}else{_0x4d011e[_0x91e9('0xab')]=[{'all':!![]}];}}return _0x37d95e[_0x42009e[_0x91e9('0x12')]][_0x91e9('0x5')](_0x4d011e);})['then'](function(_0xbad4f9){_0x17b48d[_0x91e9('0xb2')]=_0xbad4f9;if(_0x48dc1b===_0x91e9('0xba')&&_0x53e6b3[_0x91e9('0x86')][_0x91e9('0xbb')]===_0x91e9('0xbc')){var _0x3ebd79=[];for(var _0x100fad=0x0;_0x100fad<_0x17b48d[_0x91e9('0xb2')]['length'];_0x100fad++){_0x3ebd79['push'](_0x322c94(_0x91e9('0xbd'),_0x17b48d[_0x91e9('0xb2')][_0x100fad][_0x91e9('0xbe')]));_0x3ebd79[_0x91e9('0x99')](_0x322c94(_0x91e9('0xbf'),_0x17b48d[_0x91e9('0xb2')][_0x100fad][_0x91e9('0xbe')]));_0x3ebd79['push'](_0x322c94(_0x91e9('0xc0'),_0x17b48d['rows'][_0x100fad][_0x91e9('0xbe')]));_0x3ebd79[_0x91e9('0x99')](_0x322c94(_0x91e9('0xc1'),_0x17b48d[_0x91e9('0xb2')][_0x100fad][_0x91e9('0xbe')]));_0x3ebd79[_0x91e9('0x99')](_0x322c94('openchannel',_0x17b48d['rows'][_0x100fad][_0x91e9('0xbe')]));_0x3ebd79[_0x91e9('0x99')](_0x322c94(_0x91e9('0xc2'),_0x17b48d['rows'][_0x100fad][_0x91e9('0xbe')]));}return Promise[_0x91e9('0x9b')](_0x3ebd79)['then'](function(){return _0x17b48d;});}return _0x17b48d;});}});}}});}; \ No newline at end of file +var _0x89fe=['field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceRecording','membername','User','role','agent','Telephones','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','openchannelqueues','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','Team','voicequeues','queuecampaigns','parentSections','agents','telephones','Users','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','Template','triggers','Trigger','Trunk','Variable','plugins','Plugin','extractedreports','Reports','reportId','charAt','slice','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','where','sequelize','toString','OpenTabs','UserProfile','../../components/parsers/qs','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','union','autoAssociation','all','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','key','VIRTUAL','foreignKey','forEach','merge','include','DefaultReports','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','fax','mail','lodash','squel','models','filter'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x89fe,0x162));var _0xe89f=function(_0xc91845,_0xe67795){_0xc91845=_0xc91845-0x0;var _0x5a1332=_0x89fe[_0xc91845];return _0x5a1332;};'use strict';var _=require(_0xe89f('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0xe89f('0x1'));module['exports']=function(_0x28a763){var _0x404186=_0x28a763[_0xe89f('0x2')];function _0x235106(_0x360c0e,_0x3e1235){return new Promise(function(_0x497bf8,_0xcf8e47){if(!_0x3e1235)return _0x497bf8(null);var _0x3ae749=_0x3e1235[_0xe89f('0x3')]?{[_0x3e1235[_0xe89f('0x3')][_0xe89f('0x4')]]:_0x3e1235[_0xe89f('0x3')][_0xe89f('0x5')]}:undefined;return _0x404186[_0x360c0e][_0xe89f('0x6')]({'where':_0x3ae749,'raw':!![]})[_0xe89f('0x7')](function(_0xb44cbb){_0x3e1235[_0xe89f('0x8')]=_[_0xe89f('0x9')](_0xb44cbb,'id');_0x497bf8(_0x3e1235);})[_0xe89f('0xa')](function(_0x4ef2d8){_0xcf8e47(_0x4ef2d8);});});}function _0xd351c2(_0x1e2468,_0x6b1497){return new Promise(function(_0x5e14a6,_0x5837db){var _0x509bbf=_0x1e2468[_0xe89f('0x3')]?{[_0x1e2468[_0xe89f('0x3')][_0xe89f('0x4')]]:_0x1e2468['filter']['value']}:undefined;return _0x404186[_0x1e2468[_0xe89f('0xb')]][_0xe89f('0x6')]({'where':_0x509bbf,'raw':!![]})[_0xe89f('0x7')](function(_0x5448f3){_0x6b1497[_0xe89f('0x8')]=_[_0xe89f('0x9')](_0x5448f3,function(_0x12f0a0){return _0x12f0a0[_0xe89f('0xc')];});_0x5e14a6(_0x6b1497);})[_0xe89f('0xa')](function(_0x3d3005){_0x5837db(_0x3d3005);});});}function _0x360c98(_0x11b090,_0x1a963b,_0x433fe8){if(!_0x1a963b)return Promise[_0xe89f('0xd')](null);return new Promise(function(_0x575ce9,_0x5c9743){return _0x404186[_0xe89f('0xe')][_0xe89f('0x6')]({'where':{'sectionId':_0x1a963b['id']},'raw':!![]})[_0xe89f('0x7')](function(_0x3bdf09){if(_0x11b090[_0xe89f('0x4')]&&_0x11b090['field']!=='id'){_0x1a963b[_0xe89f('0x8')]=_[_0xe89f('0x9')](_0x3bdf09,function(_0x2b6c7b){return _0x2b6c7b[_0x11b090[_0xe89f('0x4')]];});}else{if(_0x433fe8===_0xe89f('0xf')){_0x1a963b[_0xe89f('0x8')]=_['map'](_0x3bdf09,function(_0x58801b){return{'id':_0x58801b[_0xe89f('0x10')],'type':_0x58801b['type']};});}else{_0x1a963b[_0xe89f('0x8')]=_[_0xe89f('0x9')](_0x3bdf09,function(_0x1fdf46){return _0x1fdf46['resourceId'];});}}_0x575ce9(_0x1a963b);})[_0xe89f('0xa')](function(_0x55b09f){_0x5c9743(_0x55b09f);});});}function _0x1b24b8(_0xdada28,_0xdcef94){var _0x1ccd3a={'parentSections':[]};switch(_0xdada28[_0xe89f('0x11')]()){case _0xe89f('0x12'):_0x1ccd3a[_0xe89f('0x13')]='SquareProject';break;case _0xe89f('0x14'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x15');break;case _0xe89f('0x16'):_0x1ccd3a['childModel']=_0xe89f('0x17');_0x1ccd3a['parentSections']=[{'name':'SquareProjects','field':_0xe89f('0xc'),'foreignKey':_0xe89f('0x18')}];break;case'projects':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x19');break;case _0xe89f('0x1a'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x1b');_0x1ccd3a['parentSections']=[{'name':_0xe89f('0x1c'),'field':'id','foreignKey':_0xe89f('0x1d')}];break;case'lists':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x1e');break;case'companies':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x1f');break;case _0xe89f('0x20'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x21');break;case _0xe89f('0x22'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x23');break;case _0xe89f('0x24'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x25');break;case _0xe89f('0x26'):_0x1ccd3a['childModel']=_0xe89f('0x27');break;case _0xe89f('0x28'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x29');break;case _0xe89f('0x2a'):case _0xe89f('0x2b'):case _0xe89f('0x2c'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x2d');break;case _0xe89f('0x2e'):_0x1ccd3a[_0xe89f('0x13')]='VoiceContext';break;case'voicemails':_0x1ccd3a['childModel']='VoiceMail';break;case'voicerecordings':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x2f');_0x1ccd3a['parentSections']=[{'name':'Agents','field':_0xe89f('0xc'),'foreignKey':_0xe89f('0x30'),'model':_0xe89f('0x31'),'filter':{'field':_0xe89f('0x32'),'value':[_0xe89f('0x33')]}},{'name':_0xe89f('0x34'),'field':_0xe89f('0xc'),'foreignKey':_0xe89f('0x30'),'model':_0xe89f('0x31'),'filter':{'field':_0xe89f('0x32'),'value':['telephone']}},{'name':_0xe89f('0x35'),'field':_0xe89f('0xc'),'foreignKey':'queue','model':_0xe89f('0x36'),'filter':{'field':_0xe89f('0x37'),'value':[_0xe89f('0x38')]}},{'name':_0xe89f('0x39'),'field':_0xe89f('0xc'),'foreignKey':_0xe89f('0x3a'),'model':_0xe89f('0x36'),'filter':{'field':'type','value':[_0xe89f('0x3b')]}}];break;case'musiconholds':_0x1ccd3a[_0xe89f('0x13')]='VoiceMusicOnHold';break;case _0xe89f('0x3c'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x3d');break;case'voiceprefixes':_0x1ccd3a['childModel']=_0xe89f('0x3e');break;case _0xe89f('0x3f'):_0x1ccd3a['childModel']=_0xe89f('0x40');break;case _0xe89f('0x41'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x42');break;case _0xe89f('0x43'):_0x1ccd3a[_0xe89f('0x13')]='MailAccount';break;case'mailsubstatuses':_0x1ccd3a['childModel']='MailSubstatus';break;case _0xe89f('0x44'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x45');break;case'openchannelaccounts':_0x1ccd3a[_0xe89f('0x13')]='OpenchannelAccount';break;case _0xe89f('0x46'):_0x1ccd3a[_0xe89f('0x13')]='SmsQueue';break;case _0xe89f('0x47'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x48');break;case _0xe89f('0x49'):_0x1ccd3a['childModel']=_0xe89f('0x4a');break;case'whatsappaccounts':_0x1ccd3a[_0xe89f('0x13')]='WhatsappAccount';break;case'teams':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x4b');break;case _0xe89f('0x4c'):case _0xe89f('0x4d'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x36');if(_0xdcef94){_0x1ccd3a[_0xe89f('0x4e')]=[{'name':_0xe89f('0x35')},{'name':_0xe89f('0x39')}];}break;case'users':case _0xe89f('0x4f'):case _0xe89f('0x50'):_0x1ccd3a['childModel']=_0xe89f('0x31');if(_0xdcef94){_0x1ccd3a[_0xe89f('0x4e')]=[{'name':_0xe89f('0x51'),'filter':{'field':'role','value':['admin',_0xe89f('0x52')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x53');break;case'salesforceaccounts':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x54');break;case _0xe89f('0x55'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x56');break;case'sugarcrmaccounts':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x57');break;case _0xe89f('0x58'):_0x1ccd3a[_0xe89f('0x13')]='DeskAccount';break;case _0xe89f('0x59'):_0x1ccd3a['childModel']=_0xe89f('0x5a');break;case _0xe89f('0x5b'):_0x1ccd3a[_0xe89f('0x13')]='User';break;case _0xe89f('0x5c'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x5d');break;case _0xe89f('0x5e'):_0x1ccd3a[_0xe89f('0x13')]='Disposition';break;case _0xe89f('0x5f'):_0x1ccd3a['childModel']=_0xe89f('0x60');break;case'intervals':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x61');break;case _0xe89f('0x62'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x63');break;case'scheduler':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x64');break;case _0xe89f('0x65'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x66');break;case _0xe89f('0x67'):_0x1ccd3a['childModel']=_0xe89f('0x68');break;case'templates':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x69');break;case _0xe89f('0x6a'):_0x1ccd3a['childModel']=_0xe89f('0x6b');break;case'trunks':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x6c');break;case'variables':_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x6d');break;case _0xe89f('0x6e'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0x6f');break;case _0xe89f('0x70'):_0x1ccd3a[_0xe89f('0x13')]=_0xe89f('0xf');_0x1ccd3a[_0xe89f('0x4e')]=[{'name':_0xe89f('0x71'),'field':'id','foreignKey':_0xe89f('0x72')}];break;case'metrics':_0x1ccd3a[_0xe89f('0x13')]='AnalyticMetric';break;}return _0x1ccd3a;}function _0x4ef5c7(_0x2bab11,_0x3422d1){var _0x307744=_0x2bab11[_0xe89f('0x73')](0x0)['toUpperCase']()+_0x2bab11[_0xe89f('0x74')](0x1);var _0x14cd75={'type':_0x404186['Sequelize'][_0xe89f('0x75')][_0xe89f('0x76')],'raw':!![]};return new Promise(function(_0x5a4098,_0x225f9a){var _0x5637e0=squel[_0xe89f('0x77')]()[_0xe89f('0x4')]('ui.'+_0x307744+'InteractionId','id')[_0xe89f('0x4')](_0xe89f('0x78'))[_0xe89f('0x79')](_0xe89f('0x7a')+_0x2bab11+_0xe89f('0x7b'),'ui')[_0xe89f('0x7c')]('ui.UserId\x20=\x20?',_0x3422d1['id']);return _0x404186[_0xe89f('0x7d')]['query'](_0x5637e0[_0xe89f('0x7e')](),_0x14cd75)[_0xe89f('0x7')](function(_0x346ca6){_0x3422d1[_0x307744+_0xe89f('0x7f')]=_0x346ca6;_0x5a4098(_0x346ca6);})['catch'](function(_0x1b1acf){_0x225f9a(_0x1b1acf);});});}return _0x28a763['define'](_0xe89f('0x80'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5a439e){var _0x293ab0=require(_0xe89f('0x81'));var _0x167c51={'raw':_0x5a439e[_0xe89f('0x82')][_0xe89f('0x83')],'where':{}};var _0x1eaa6a={};var _0x1f2227={'count':0x0,'rows':[]};var _0x1a1bd9=_0x5a439e[_0xe89f('0x82')][_0xe89f('0x84')];var _0x162a8c=_0x5a439e[_0xe89f('0x82')][_0xe89f('0x85')]||![];var _0x9fbd3c=_0x1b24b8(_0x1a1bd9,_0x162a8c);if(!_0x9fbd3c[_0xe89f('0x13')])throw new Error(_0xe89f('0x86')+_0x1a1bd9+'\x27');var _0x343829=[{'name':_0x1a1bd9}];if(!_[_0xe89f('0x87')](_0x9fbd3c['parentSections']))_0x343829=_0x9fbd3c[_0xe89f('0x4e')];var _0x811b4f=[];for(var _0x5cc5d9=0x0;_0x5cc5d9<_0x343829[_0xe89f('0x88')];_0x5cc5d9++){_0x811b4f[_0xe89f('0x89')](_0x404186[_0xe89f('0x8a')][_0xe89f('0x8b')]({'where':{'userProfileId':_0x5a439e[_0xe89f('0x8c')]['id'],'name':_0x343829[_0x5cc5d9]['name']},'raw':!![]}));}return Promise['all'](_0x811b4f)[_0xe89f('0x7')](function(_0x3faf32){var _0x4ee602=_[_0xe89f('0x3')](_0x3faf32,function(_0x539cc4){return _0x539cc4?_0x539cc4:undefined;});var _0x5b22c0=_[_0xe89f('0x3')](_0x343829,[_0xe89f('0x8d'),!![]]);var _0x325607=_['isEmpty'](_0x4ee602)&&_[_0xe89f('0x87')](_0x5b22c0)?null:_[_0xe89f('0x8e')](_0x5b22c0,_0x4ee602);if(!_0x325607)return null;var _0x863adb=[];for(var _0x36f2b3=0x0;_0x36f2b3<_0x325607[_0xe89f('0x88')];_0x36f2b3++){var _0x4bb945=_['find'](_0x343829,function(_0x369802){return _0x325607[_0x36f2b3]?_0x369802[_0xe89f('0xc')]===_0x325607[_0x36f2b3][_0xe89f('0xc')]:null;});if(_0x4bb945){if(_0x325607[_0x36f2b3][_0xe89f('0x8d')]){_0x863adb[_0xe89f('0x89')](_0x235106(_0x9fbd3c[_0xe89f('0x13')],_0x325607[_0x36f2b3]));}else{if(!_0x325607[_0x36f2b3][_0xe89f('0x8f')]){_0x863adb['push'](_0x360c98(_0x4bb945,_0x325607[_0x36f2b3],_0x9fbd3c[_0xe89f('0x13')]));}else{if(_0x4bb945[_0xe89f('0xb')]){_0x863adb['push'](_0xd351c2(_0x4bb945,_0x325607[_0x36f2b3]));}}}}}return Promise[_0xe89f('0x90')](_0x863adb);})[_0xe89f('0x7')](function(_0xf8deec){var _0x51eb12=_0xf8deec;var _0x1d05cd=null;if(_0x51eb12){_0x1d05cd=_0x51eb12[_0xe89f('0x88')]===0x1?_0x51eb12[0x0]:null;}if(!_0x1d05cd&&!_0x51eb12)return _0x1f2227;var _0x1abfec=_0x404186[_0x9fbd3c[_0xe89f('0x13')]]['rawAttributes'];_0x1eaa6a[_0xe89f('0xb')]=_[_0xe89f('0x91')](_0x1abfec);_0x1eaa6a[_0xe89f('0x82')]=_[_0xe89f('0x91')](_0x5a439e[_0xe89f('0x82')]);_0x1eaa6a[_0xe89f('0x92')]=_[_0xe89f('0x93')](_0x1eaa6a[_0xe89f('0xb')],_0x1eaa6a[_0xe89f('0x82')]);_0x167c51[_0xe89f('0x94')]=_[_0xe89f('0x93')](_0x1eaa6a[_0xe89f('0xb')],_0x293ab0[_0xe89f('0x95')](_0x5a439e[_0xe89f('0x82')][_0xe89f('0x95')]));_0x167c51[_0xe89f('0x94')]=_0x167c51[_0xe89f('0x94')][_0xe89f('0x88')]?_0x167c51[_0xe89f('0x94')]:_0x1eaa6a['model'];if(!_0x5a439e[_0xe89f('0x82')][_0xe89f('0x96')](_0xe89f('0x97'))){_0x167c51[_0xe89f('0x98')]=_0x293ab0[_0xe89f('0x98')](_0x5a439e[_0xe89f('0x82')][_0xe89f('0x98')]);_0x167c51[_0xe89f('0x99')]=_0x293ab0[_0xe89f('0x99')](_0x5a439e['query'][_0xe89f('0x99')]);}_0x167c51[_0xe89f('0x9a')]=_0x293ab0['sort'](_0x5a439e[_0xe89f('0x82')]['sort']);_0x167c51['where']=_0x293ab0[_0xe89f('0x92')](_['pick'](_0x5a439e[_0xe89f('0x82')],_0x1eaa6a[_0xe89f('0x92')]));if(_0x5a439e['query']['filter']){_0x167c51[_0xe89f('0x7c')]=_['merge'](_0x167c51[_0xe89f('0x7c')],{'$or':_[_0xe89f('0x9')](_0x1abfec,function(_0x550f98){if(_0x550f98[_0xe89f('0x37')][_0xe89f('0x9b')]!==_0xe89f('0x9c')){var _0x1470d7={};_0x1470d7[_0x550f98['field']]={'$like':'%'+_0x5a439e[_0xe89f('0x82')][_0xe89f('0x3')]+'%'};return _0x1470d7;}})});}var _0x5d9758=[];var _0x25358c=null;var _0x5853f={};if(_0x1d05cd){_0x25358c=_[_0xe89f('0x8b')](_0x343829,[_0xe89f('0xc'),_0x1d05cd[_0xe89f('0xc')]]);if(_0x25358c['field']){_0x5853f={};if(_0x9fbd3c['childModel']===_0xe89f('0xf')){_0x5853f[_0x25358c[_0xe89f('0x9d')]]=_[_0xe89f('0x9')](_0x1d05cd['associatedResources'],'id');}else{_0x5853f[_0x25358c['foreignKey']]=_0x1d05cd[_0xe89f('0x8')];}_0x5d9758[_0xe89f('0x89')](_0x5853f);}else{_0x167c51['where']['id']=_0x1d05cd[_0xe89f('0x8')];}}else{for(var _0x14fde2=0x0;_0x14fde2<_0x51eb12['length'];_0x14fde2++){_0x25358c=_[_0xe89f('0x8b')](_0x343829,[_0xe89f('0xc'),_0x51eb12[_0x14fde2][_0xe89f('0xc')]]);if(_0x25358c[_0xe89f('0x4')]){_0x5853f={};_0x5853f[_0x25358c[_0xe89f('0x9d')]]=_0x51eb12[_0x14fde2]['associatedResources'];_0x5d9758[_0xe89f('0x89')](_0x5853f);}else{if(!_0x167c51['where']['id'])_0x167c51[_0xe89f('0x7c')]['id']=[];_0x51eb12[_0x14fde2][_0xe89f('0x8')][_0xe89f('0x9e')](function(_0x5ad7a5){_0x167c51[_0xe89f('0x7c')]['id']['push'](_0x5ad7a5);});}}}if(!_[_0xe89f('0x87')](_0x5d9758)){_0x167c51['where']=_[_0xe89f('0x9f')](_0x167c51[_0xe89f('0x7c')],{'$and':{'$or':_0x5d9758}});}_0x167c51=_['merge']({},_0x167c51,_0x5a439e['options']);if(_0x1d05cd&&!_0x1d05cd[_0xe89f('0x8f')]&&_0x9fbd3c[_0xe89f('0x13')]===_0xe89f('0xf')){if(_0x5a439e[_0xe89f('0x82')]['includeAll']){_0x167c51[_0xe89f('0xa0')]=[{'all':!![]}];}return _0x404186[_0x9fbd3c['childModel']][_0xe89f('0x6')](_0x167c51)[_0xe89f('0x7')](function(_0x1e6a60){var _0x18462d=[];_0x1e6a60[_0xe89f('0x9e')](function(_0x129a0e){var _0x3dacad;switch(_0x129a0e['reportType']){case'default':_0x3dacad=_[_0xe89f('0x8b')](_0x1d05cd[_0xe89f('0x8')],function(_0x2e9cfe){return _0x2e9cfe['id']===_0x129a0e[_0xe89f('0x72')]&&_0x2e9cfe[_0xe89f('0x37')]===_0xe89f('0xa1');});break;case'custom':_0x3dacad=_[_0xe89f('0x8b')](_0x1d05cd[_0xe89f('0x8')],function(_0x13afb0){return _0x13afb0['id']===_0x129a0e['reportId']&&_0x13afb0[_0xe89f('0x37')]===_0xe89f('0xa2');});break;}if(_0x3dacad)_0x18462d[_0xe89f('0x89')](_0x129a0e);});_0x1f2227[_0xe89f('0xa3')]=_0x18462d['length'];_0x1f2227[_0xe89f('0xa4')]=_0x18462d;return _0x1f2227;});}else{if(!_[_0xe89f('0x87')](_0x5a439e[_0xe89f('0x82')][_0xe89f('0xa5')])){_0x167c51[_0xe89f('0x7c')]['id']=_0x167c51['where']['id']?_[_0xe89f('0x93')](_0x167c51['where']['id'],_0x5a439e[_0xe89f('0x82')][_0xe89f('0xa5')]):_0x5a439e[_0xe89f('0x82')]['ids'];if(_0x5a439e['query'][_0xe89f('0xa6')]){_0x167c51[_0xe89f('0x9a')]=_0x5a439e[_0xe89f('0x82')][_0xe89f('0xa6')];}}if(_0x5a439e[_0xe89f('0x82')]['extraQueryConditions']){_0x167c51['where']=_[_0xe89f('0x9f')](_0x167c51['where'],{'$and':_0x5a439e[_0xe89f('0x82')][_0xe89f('0xa7')]});}return _0x404186[_0x9fbd3c[_0xe89f('0x13')]][_0xe89f('0xa3')]({'where':_0x167c51[_0xe89f('0x7c')]})[_0xe89f('0x7')](function(_0x1b1750){_0x1f2227['count']=_0x1b1750;if(_0x5a439e[_0xe89f('0x82')][_0xe89f('0xa8')]){if(_0x9fbd3c['childModel']===_0xe89f('0x1b')){_0x167c51[_0xe89f('0xa0')]=[{'model':_0x404186['Tag'],'as':_0xe89f('0xa9'),'attributes':['id',_0xe89f('0xc'),_0xe89f('0xaa')],'required':_0x5a439e[_0xe89f('0x82')]['tag']?!![]:![]},{'model':_0x404186[_0xe89f('0x68')],'as':_0xe89f('0xab'),'attributes':['id',_0xe89f('0xc'),_0xe89f('0xaa')],'through':_0x5a439e['query'][_0xe89f('0xac')]?{'attributes':[],'where':{'TagId':_0x5a439e[_0xe89f('0x82')]['tag']||undefined}}:{},'required':_0x5a439e[_0xe89f('0x82')][_0xe89f('0xac')]?!![]:![]}];}else{_0x167c51[_0xe89f('0xa0')]=[{'all':!![]}];}}return _0x404186[_0x9fbd3c[_0xe89f('0x13')]][_0xe89f('0x6')](_0x167c51);})[_0xe89f('0x7')](function(_0x17772c){_0x1f2227[_0xe89f('0xa4')]=_0x17772c;if(_0x1a1bd9==='Agents'&&_0x5a439e['query'][_0xe89f('0xad')]===_0xe89f('0xae')){var _0x24ba47=[];for(var _0x444c17=0x0;_0x444c17<_0x1f2227[_0xe89f('0xa4')]['length'];_0x444c17++){_0x24ba47[_0xe89f('0x89')](_0x4ef5c7(_0xe89f('0xaf'),_0x1f2227[_0xe89f('0xa4')][_0x444c17][_0xe89f('0xb0')]));_0x24ba47[_0xe89f('0x89')](_0x4ef5c7('sms',_0x1f2227['rows'][_0x444c17][_0xe89f('0xb0')]));_0x24ba47[_0xe89f('0x89')](_0x4ef5c7(_0xe89f('0xb1'),_0x1f2227[_0xe89f('0xa4')][_0x444c17][_0xe89f('0xb0')]));_0x24ba47[_0xe89f('0x89')](_0x4ef5c7(_0xe89f('0xb2'),_0x1f2227[_0xe89f('0xa4')][_0x444c17][_0xe89f('0xb0')]));_0x24ba47['push'](_0x4ef5c7('openchannel',_0x1f2227[_0xe89f('0xa4')][_0x444c17][_0xe89f('0xb0')]));_0x24ba47[_0xe89f('0x89')](_0x4ef5c7('whatsapp',_0x1f2227[_0xe89f('0xa4')][_0x444c17][_0xe89f('0xb0')]));}return Promise[_0xe89f('0x90')](_0x24ba47)[_0xe89f('0x7')](function(){return _0x1f2227;});}return _0x1f2227;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index bf4e123..b565a81 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 _0x598a=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0x598a,0xfb));var _0xa598=function(_0x1d7630,_0x59b732){_0x1d7630=_0x1d7630-0x0;var _0x3bc022=_0x598a[_0x1d7630];return _0x3bc022;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var moment=require(_0xa598('0x2'));var BPromise=require(_0xa598('0x3'));var rs=require(_0xa598('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa598('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa598('0x6'));var jayson=require(_0xa598('0x7'));var client=jayson[_0xa598('0x8')][_0xa598('0x9')]({'port':0x232a});config[_0xa598('0xa')]=_['defaults'](config['redis'],{'host':_0xa598('0xb'),'port':0x18eb});var socket=require(_0xa598('0xc'))(new Redis(config[_0xa598('0xa')]));require(_0xa598('0xd'))[_0xa598('0xe')](socket);function respondWithRpcPromise(_0x387afc,_0x5207d5,_0x5871a3){return new BPromise(function(_0x3ea1e4,_0x3cb7b8){return client[_0xa598('0xf')](_0x387afc,_0x5871a3)[_0xa598('0x10')](function(_0xa1c53){logger['info'](_0xa598('0x11'),_0x5207d5,_0xa598('0x12'));logger[_0xa598('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x5207d5,_0xa598('0x12'),JSON['stringify'](_0xa1c53));if(_0xa1c53[_0xa598('0x14')]){if(_0xa1c53[_0xa598('0x14')][_0xa598('0x15')]===0x1f4){logger[_0xa598('0x14')](_0xa598('0x11'),_0x5207d5,_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);return _0x3cb7b8(_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);}logger['error'](_0xa598('0x11'),_0x5207d5,_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);return _0x3ea1e4(_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);}else{logger[_0xa598('0x17')](_0xa598('0x11'),_0x5207d5,_0xa598('0x12'));_0x3ea1e4(_0xa1c53[_0xa598('0x18')][_0xa598('0x16')]);}})['catch'](function(_0x1ed03f){logger[_0xa598('0x14')](_0xa598('0x11'),_0x5207d5,_0x1ed03f);_0x3cb7b8(_0x1ed03f);});});} \ No newline at end of file +var _0x8561=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','localhost','then','info','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','util','moment','randomstring'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8561,0x1b2));var _0x1856=function(_0x49e264,_0x142dd1){_0x49e264=_0x49e264-0x0;var _0x109309=_0x8561[_0x49e264];return _0x109309;};'use strict';var _=require('lodash');var util=require(_0x1856('0x0'));var moment=require(_0x1856('0x1'));var BPromise=require('bluebird');var rs=require(_0x1856('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1856('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1856('0x4'))('rpc');var config=require(_0x1856('0x5'));var jayson=require(_0x1856('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x1856('0x7')]=_['defaults'](config['redis'],{'host':_0x1856('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x1bfad8,_0x3e47b3,_0x510505){return new BPromise(function(_0x55fe85,_0x97f276){return client['request'](_0x1bfad8,_0x510505)[_0x1856('0x9')](function(_0x584a8e){logger[_0x1856('0xa')]('UserProfile,\x20%s,\x20%s',_0x3e47b3,_0x1856('0xb'));logger[_0x1856('0xc')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3e47b3,_0x1856('0xb'),JSON[_0x1856('0xd')](_0x584a8e));if(_0x584a8e[_0x1856('0xe')]){if(_0x584a8e['error'][_0x1856('0xf')]===0x1f4){logger[_0x1856('0xe')](_0x1856('0x10'),_0x3e47b3,_0x584a8e['error'][_0x1856('0x11')]);return _0x97f276(_0x584a8e[_0x1856('0xe')][_0x1856('0x11')]);}logger[_0x1856('0xe')](_0x1856('0x10'),_0x3e47b3,_0x584a8e[_0x1856('0xe')][_0x1856('0x11')]);return _0x55fe85(_0x584a8e['error']['message']);}else{logger[_0x1856('0xa')]('UserProfile,\x20%s,\x20%s',_0x3e47b3,'request\x20sent');_0x55fe85(_0x584a8e[_0x1856('0x12')][_0x1856('0x11')]);}})['catch'](function(_0x4f5381){logger[_0x1856('0xe')](_0x1856('0x10'),_0x3e47b3,_0x4f5381);_0x97f276(_0x4f5381);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 49fd03f..fed3f08 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 _0x2202=['emit','removeListener','userProfile:','./userProfile.events','remove','update'];(function(_0x3490ac,_0x52cbfd){var _0x56962c=function(_0x440571){while(--_0x440571){_0x3490ac['push'](_0x3490ac['shift']());}};_0x56962c(++_0x52cbfd);}(_0x2202,0x1cb));var _0x2220=function(_0x1e4ac8,_0x4260bd){_0x1e4ac8=_0x1e4ac8-0x0;var _0x1b85db=_0x2202[_0x1e4ac8];return _0x1b85db;};'use strict';var UserProfileEvents=require(_0x2220('0x0'));var events=['save',_0x2220('0x1'),_0x2220('0x2')];function createListener(_0xcc9ed6,_0x3c3812){return function(_0x748d75){_0x3c3812[_0x2220('0x3')](_0xcc9ed6,_0x748d75);};}function removeListener(_0x33e361,_0x424e25){return function(){UserProfileEvents[_0x2220('0x4')](_0x33e361,_0x424e25);};}exports['register']=function(_0x1540a4){for(var _0x1e52eb=0x0,_0xc7d2fd=events['length'];_0x1e52eb<_0xc7d2fd;_0x1e52eb++){var _0x2b6f9e=events[_0x1e52eb];var _0x2e2e83=createListener(_0x2220('0x5')+_0x2b6f9e,_0x1540a4);UserProfileEvents['on'](_0x2b6f9e,_0x2e2e83);}}; \ No newline at end of file +var _0xf090=['register','length','userProfile:','./userProfile.events','remove','removeListener'];(function(_0x54e205,_0x3cf352){var _0x156650=function(_0x24b1d6){while(--_0x24b1d6){_0x54e205['push'](_0x54e205['shift']());}};_0x156650(++_0x3cf352);}(_0xf090,0x1ad));var _0x0f09=function(_0x25a928,_0x2d6d48){_0x25a928=_0x25a928-0x0;var _0x3c5e1c=_0xf090[_0x25a928];return _0x3c5e1c;};'use strict';var UserProfileEvents=require(_0x0f09('0x0'));var events=['save',_0x0f09('0x1'),'update'];function createListener(_0x4847aa,_0x487899){return function(_0x46a6c0){_0x487899['emit'](_0x4847aa,_0x46a6c0);};}function removeListener(_0x9b0017,_0x3ccde5){return function(){UserProfileEvents[_0x0f09('0x2')](_0x9b0017,_0x3ccde5);};}exports[_0x0f09('0x3')]=function(_0x3120b3){for(var _0xafb47c=0x0,_0x4bae5b=events[_0x0f09('0x4')];_0xafb47c<_0x4bae5b;_0xafb47c++){var _0x4563a8=events[_0xafb47c];var _0x44763f=createListener(_0x0f09('0x5')+_0x4563a8,_0x3120b3);UserProfileEvents['on'](_0x4563a8,_0x44763f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 238cca8..bb9b839 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 _0x9cda=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9cda,0x118));var _0xa9cd=function(_0x14ad39,_0x400acb){_0x14ad39=_0x14ad39-0x0;var _0x481fde=_0x9cda[_0x14ad39];return _0x481fde;};'use strict';var multer=require('multer');var util=require(_0xa9cd('0x0'));var path=require(_0xa9cd('0x1'));var timeout=require(_0xa9cd('0x2'));var express=require(_0xa9cd('0x3'));var router=express[_0xa9cd('0x4')]();var fs_extra=require(_0xa9cd('0x5'));var auth=require(_0xa9cd('0x6'));var interaction=require(_0xa9cd('0x7'));var config=require(_0xa9cd('0x8'));var controller=require(_0xa9cd('0x9'));router['get']('/',auth[_0xa9cd('0xa')](),controller[_0xa9cd('0xb')]);router[_0xa9cd('0xc')](_0xa9cd('0xd'),auth['isAuthenticated'](),controller[_0xa9cd('0xe')]);router['get'](_0xa9cd('0xf'),auth['isAuthenticated'](),controller[_0xa9cd('0x10')]);router[_0xa9cd('0x11')]('/',auth[_0xa9cd('0xa')](),controller[_0xa9cd('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa9cd('0x13')]);router[_0xa9cd('0x14')](_0xa9cd('0xf'),auth['isAuthenticated'](),controller[_0xa9cd('0x15')]);module[_0xa9cd('0x16')]=router; \ No newline at end of file +var _0x2b03=['../../config/environment','./userProfileResource.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x364a3a,_0x5b4fe4){var _0x17fef8=function(_0x1e7ef9){while(--_0x1e7ef9){_0x364a3a['push'](_0x364a3a['shift']());}};_0x17fef8(++_0x5b4fe4);}(_0x2b03,0x196));var _0x32b0=function(_0x332c43,_0x545e88){_0x332c43=_0x332c43-0x0;var _0x20468e=_0x2b03[_0x332c43];return _0x20468e;};'use strict';var multer=require(_0x32b0('0x0'));var util=require(_0x32b0('0x1'));var path=require(_0x32b0('0x2'));var timeout=require(_0x32b0('0x3'));var express=require(_0x32b0('0x4'));var router=express[_0x32b0('0x5')]();var fs_extra=require(_0x32b0('0x6'));var auth=require(_0x32b0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x32b0('0x8'));var controller=require(_0x32b0('0x9'));router[_0x32b0('0xa')]('/',auth['isAuthenticated'](),controller[_0x32b0('0xb')]);router[_0x32b0('0xa')](_0x32b0('0xc'),auth['isAuthenticated'](),controller[_0x32b0('0xd')]);router[_0x32b0('0xa')](_0x32b0('0xe'),auth[_0x32b0('0xf')](),controller[_0x32b0('0x10')]);router['post']('/',auth[_0x32b0('0xf')](),controller[_0x32b0('0x11')]);router[_0x32b0('0x12')](_0x32b0('0xe'),auth[_0x32b0('0xf')](),controller[_0x32b0('0x13')]);router[_0x32b0('0x14')](_0x32b0('0xe'),auth[_0x32b0('0xf')](),controller[_0x32b0('0x15')]);module[_0x32b0('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5e5d206..f5e0cbf 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 _0x4f27=['exports','STRING','INTEGER'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4f27,0x11a));var _0x74f2=function(_0x6deaa8,_0x56a27f){_0x6deaa8=_0x6deaa8-0x0;var _0x3342e1=_0x4f27[_0x6deaa8];return _0x3342e1;};'use strict';var Sequelize=require('sequelize');module[_0x74f2('0x0')]={'name':{'type':Sequelize[_0x74f2('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x74f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x74f2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa6d9=['INTEGER','sequelize'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa6d9,0x91));var _0x9a6d=function(_0x2dedfa,_0x42ac98){_0x2dedfa=_0x2dedfa-0x0;var _0x16d8e4=_0xa6d9[_0x2dedfa];return _0x16d8e4;};'use strict';var Sequelize=require(_0x9a6d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a6d('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 304bfe2..776bf5e 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 _0xdb28=['index','UserProfileResource','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','describe','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'];(function(_0x1d5677,_0x342d27){var _0x274227=function(_0x5ead9c){while(--_0x5ead9c){_0x1d5677['push'](_0x1d5677['shift']());}};_0x274227(++_0x342d27);}(_0xdb28,0x106));var _0x8db2=function(_0x4fcf7f,_0xe5568){_0x4fcf7f=_0x4fcf7f-0x0;var _0x38b93f=_0xdb28[_0x4fcf7f];return _0x38b93f;};'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']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};exports[_0x8db2('0x4b')]=function(_0x426ae0,_0x3bc632){return db[_0x8db2('0x2b')][_0x8db2('0x4b')]()[_0x8db2('0x24')](respondWithResult(_0x3bc632,null))[_0x8db2('0x42')](handleError(_0x3bc632,null));}; \ No newline at end of file +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(_0x1873cc,_0x5433ff){var _0x4c8fbf=function(_0x1ebf6d){while(--_0x1ebf6d){_0x1873cc['push'](_0x1873cc['shift']());}};_0x4c8fbf(++_0x5433ff);}(_0xd117,0x182));var _0x7d11=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0xd117[_0x5519a9];return _0x32f2cc;};'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 diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 34a575c..cf75ae8 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 _0x5ee7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x5ee7,0x17b));var _0x75ee=function(_0x56825c,_0x1a3086){_0x56825c=_0x56825c-0x0;var _0x5b61e9=_0x5ee7[_0x56825c];return _0x5b61e9;};'use strict';var _=require(_0x75ee('0x0'));var util=require(_0x75ee('0x1'));var logger=require(_0x75ee('0x2'))(_0x75ee('0x3'));var moment=require(_0x75ee('0x4'));var BPromise=require(_0x75ee('0x5'));var rp=require(_0x75ee('0x6'));var fs=require('fs');var path=require(_0x75ee('0x7'));var rimraf=require(_0x75ee('0x8'));var config=require(_0x75ee('0x9'));var attributes=require('./userProfileResource.attributes');module[_0x75ee('0xa')]=function(_0x1543ed,_0x1c3aa6){return _0x1543ed[_0x75ee('0xb')](_0x75ee('0xc'),attributes,{'tableName':_0x75ee('0xd'),'paranoid':![],'indexes':[{'name':_0x75ee('0xe'),'fields':['resourceId',_0x75ee('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d03=['./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','resourceId','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x7a3d6b,_0x58af42){var _0x2df0b5=function(_0x54391d){while(--_0x54391d){_0x7a3d6b['push'](_0x7a3d6b['shift']());}};_0x2df0b5(++_0x58af42);}(_0x7d03,0x156));var _0x37d0=function(_0x1f46bf,_0x4ebb1f){_0x1f46bf=_0x1f46bf-0x0;var _0x4076ab=_0x7d03[_0x1f46bf];return _0x4076ab;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x37d0('0x0'));var moment=require(_0x37d0('0x1'));var BPromise=require(_0x37d0('0x2'));var rp=require(_0x37d0('0x3'));var fs=require('fs');var path=require(_0x37d0('0x4'));var rimraf=require(_0x37d0('0x5'));var config=require('../../config/environment');var attributes=require(_0x37d0('0x6'));module[_0x37d0('0x7')]=function(_0x318b02,_0x371b78){return _0x318b02[_0x37d0('0x8')](_0x37d0('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x37d0('0xa'),'fields':[_0x37d0('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 4ddf024..bf3af82 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 _0x120a=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x120a,0xa4));var _0xa120=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x120a[_0x52666e];return _0x515330;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa120('0x0'));var rs=require(_0xa120('0x1'));var fs=require('fs');var Redis=require(_0xa120('0x2'));var db=require(_0xa120('0x3'))['db'];var utils=require(_0xa120('0x4'));var logger=require(_0xa120('0x5'))('rpc');var config=require(_0xa120('0x6'));var jayson=require(_0xa120('0x7'));var client=jayson['client'][_0xa120('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x568d0e,_0x5e1aa4,_0x3a2c75){return new BPromise(function(_0x2c4789,_0x308fb7){return client[_0xa120('0x9')](_0x568d0e,_0x3a2c75)[_0xa120('0xa')](function(_0x2690df){logger[_0xa120('0xb')](_0xa120('0xc'),_0x5e1aa4,_0xa120('0xd'));logger[_0xa120('0xe')](_0xa120('0xf'),_0x5e1aa4,'request\x20sent',JSON[_0xa120('0x10')](_0x2690df));if(_0x2690df[_0xa120('0x11')]){if(_0x2690df[_0xa120('0x11')][_0xa120('0x12')]===0x1f4){logger[_0xa120('0x11')](_0xa120('0xc'),_0x5e1aa4,_0x2690df['error'][_0xa120('0x13')]);return _0x308fb7(_0x2690df[_0xa120('0x11')]['message']);}logger[_0xa120('0x11')](_0xa120('0xc'),_0x5e1aa4,_0x2690df['error']['message']);return _0x2c4789(_0x2690df[_0xa120('0x11')][_0xa120('0x13')]);}else{logger[_0xa120('0xb')](_0xa120('0xc'),_0x5e1aa4,_0xa120('0xd'));_0x2c4789(_0x2690df[_0xa120('0x14')]['message']);}})['catch'](function(_0xe81f66){logger[_0xa120('0x11')](_0xa120('0xc'),_0x5e1aa4,_0xe81f66);_0x308fb7(_0xe81f66);});});} \ No newline at end of file +var _0x7de2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x64edb0,_0x4dd13c){var _0x580a4b=function(_0x3e6636){while(--_0x3e6636){_0x64edb0['push'](_0x64edb0['shift']());}};_0x580a4b(++_0x4dd13c);}(_0x7de2,0xe5));var _0x27de=function(_0x42cd8c,_0x95ab6d){_0x42cd8c=_0x42cd8c-0x0;var _0x2c0798=_0x7de2[_0x42cd8c];return _0x2c0798;};'use strict';var _=require(_0x27de('0x0'));var util=require(_0x27de('0x1'));var moment=require(_0x27de('0x2'));var BPromise=require(_0x27de('0x3'));var rs=require(_0x27de('0x4'));var fs=require('fs');var Redis=require(_0x27de('0x5'));var db=require(_0x27de('0x6'))['db'];var utils=require(_0x27de('0x7'));var logger=require(_0x27de('0x8'))(_0x27de('0x9'));var config=require(_0x27de('0xa'));var jayson=require(_0x27de('0xb'));var client=jayson[_0x27de('0xc')][_0x27de('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3d80c3,_0xe18a70,_0x5679d6){return new BPromise(function(_0x521fb2,_0xd61485){return client['request'](_0x3d80c3,_0x5679d6)[_0x27de('0xe')](function(_0x38fd64){logger[_0x27de('0xf')](_0x27de('0x10'),_0xe18a70,_0x27de('0x11'));logger[_0x27de('0x12')](_0x27de('0x13'),_0xe18a70,_0x27de('0x11'),JSON[_0x27de('0x14')](_0x38fd64));if(_0x38fd64['error']){if(_0x38fd64['error'][_0x27de('0x15')]===0x1f4){logger[_0x27de('0x16')](_0x27de('0x10'),_0xe18a70,_0x38fd64[_0x27de('0x16')][_0x27de('0x17')]);return _0xd61485(_0x38fd64[_0x27de('0x16')][_0x27de('0x17')]);}logger[_0x27de('0x16')]('UserProfileResource,\x20%s,\x20%s',_0xe18a70,_0x38fd64['error'][_0x27de('0x17')]);return _0x521fb2(_0x38fd64['error'][_0x27de('0x17')]);}else{logger[_0x27de('0xf')](_0x27de('0x10'),_0xe18a70,_0x27de('0x11'));_0x521fb2(_0x38fd64[_0x27de('0x18')][_0x27de('0x17')]);}})[_0x27de('0x19')](function(_0x5cfd0e){logger['error'](_0x27de('0x10'),_0xe18a70,_0x5cfd0e);_0xd61485(_0x5cfd0e);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 5eed89f..0dffe62 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 _0x7929=['update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','post','create','put'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x7929,0x1cb));var _0x9792=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x7929[_0x5c5c52];return _0x4229ff;};'use strict';var multer=require(_0x9792('0x0'));var util=require(_0x9792('0x1'));var path=require('path');var timeout=require(_0x9792('0x2'));var express=require(_0x9792('0x3'));var router=express[_0x9792('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9792('0x5'));var interaction=require(_0x9792('0x6'));var config=require('../../config/environment');var controller=require(_0x9792('0x7'));router[_0x9792('0x8')]('/',auth[_0x9792('0x9')](),controller[_0x9792('0xa')]);router[_0x9792('0x8')]('/describe',auth[_0x9792('0x9')](),controller[_0x9792('0xb')]);router['get'](_0x9792('0xc'),auth[_0x9792('0x9')](),controller['show']);router[_0x9792('0xd')]('/',auth[_0x9792('0x9')](),controller[_0x9792('0xe')]);router[_0x9792('0xf')](_0x9792('0xc'),auth[_0x9792('0x9')](),controller[_0x9792('0x10')]);router[_0x9792('0x11')](_0x9792('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x9792('0x12')]=router; \ No newline at end of file +var _0x8c12=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','create'];(function(_0x317bf0,_0x277c03){var _0x225932=function(_0x2c280e){while(--_0x2c280e){_0x317bf0['push'](_0x317bf0['shift']());}};_0x225932(++_0x277c03);}(_0x8c12,0x64));var _0x28c1=function(_0x5809dc,_0x367ea7){_0x5809dc=_0x5809dc-0x0;var _0x5c9b25=_0x8c12[_0x5809dc];return _0x5c9b25;};'use strict';var multer=require(_0x28c1('0x0'));var util=require(_0x28c1('0x1'));var path=require('path');var timeout=require(_0x28c1('0x2'));var express=require(_0x28c1('0x3'));var router=express['Router']();var fs_extra=require(_0x28c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x28c1('0x5'));var config=require(_0x28c1('0x6'));var controller=require(_0x28c1('0x7'));router[_0x28c1('0x8')]('/',auth[_0x28c1('0x9')](),controller['index']);router[_0x28c1('0x8')](_0x28c1('0xa'),auth[_0x28c1('0x9')](),controller[_0x28c1('0xb')]);router['get'](_0x28c1('0xc'),auth[_0x28c1('0x9')](),controller['show']);router['post']('/',auth[_0x28c1('0x9')](),controller[_0x28c1('0xd')]);router[_0x28c1('0xe')](_0x28c1('0xc'),auth[_0x28c1('0x9')](),controller[_0x28c1('0xf')]);router[_0x28c1('0x10')]('/:id',auth[_0x28c1('0x9')](),controller[_0x28c1('0x11')]);module[_0x28c1('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 339da72..933b096 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 _0x4483=['BOOLEAN','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x488163,_0x51204f){var _0x1ba13b=function(_0x269a5d){while(--_0x269a5d){_0x488163['push'](_0x488163['shift']());}};_0x1ba13b(++_0x51204f);}(_0x4483,0x1a3));var _0x3448=function(_0x5d396a,_0x2dfbf4){_0x5d396a=_0x5d396a-0x0;var _0xc137c2=_0x4483[_0x5d396a];return _0xc137c2;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'name':{'type':Sequelize[_0x3448('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3448('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3448('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3448('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3448('0x2')],'set':function(_0xef1a93){this['setDataValue'](_0x3448('0x5'),_0xef1a93?_0xef1a93[_0x3448('0x6')](''):[]);},'get':function(){return this[_0x3448('0x7')](_0x3448('0x5'))?this[_0x3448('0x7')](_0x3448('0x5'))[_0x3448('0x8')](''):[];}}}; \ No newline at end of file +var _0xa5fa=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x38a6c6,_0x4062ca){var _0x142f0a=function(_0x1531ce){while(--_0x1531ce){_0x38a6c6['push'](_0x38a6c6['shift']());}};_0x142f0a(++_0x4062ca);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x34df56,_0x52a58f){_0x34df56=_0x34df56-0x0;var _0x520f88=_0xa5fa[_0x34df56];return _0x520f88;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'name':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa5f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa5f('0x1')],'set':function(_0x4d1c8b){this[_0xaa5f('0x4')](_0xaa5f('0x5'),_0x4d1c8b?_0x4d1c8b[_0xaa5f('0x6')](''):[]);},'get':function(){return this[_0xaa5f('0x7')](_0xaa5f('0x5'))?this[_0xaa5f('0x7')](_0xaa5f('0x5'))[_0xaa5f('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c03e3c4..6c12e7e 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 _0x63fc=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','UserProfileSection','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','where','VIRTUAL','filter','options','include','findAll','show','keys','rawAttributes','includeAll','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x3974ec,_0x1afaef){var _0x13f9a8=function(_0xf35262){while(--_0xf35262){_0x3974ec['push'](_0x3974ec['shift']());}};_0x13f9a8(++_0x1afaef);}(_0x63fc,0x1b7));var _0xc63f=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x63fc[_0x51c819];return _0x15c5d2;};'use strict';var emlformat=require(_0xc63f('0x0'));var rimraf=require(_0xc63f('0x1'));var zipdir=require(_0xc63f('0x2'));var jsonpatch=require(_0xc63f('0x3'));var rp=require(_0xc63f('0x4'));var moment=require(_0xc63f('0x5'));var BPromise=require(_0xc63f('0x6'));var Mustache=require(_0xc63f('0x7'));var util=require('util');var path=require(_0xc63f('0x8'));var sox=require(_0xc63f('0x9'));var csv=require('to-csv');var ejs=require(_0xc63f('0xa'));var fs=require('fs');var fs_extra=require(_0xc63f('0xb'));var _=require('lodash');var squel=require(_0xc63f('0xc'));var crypto=require(_0xc63f('0xd'));var jsforce=require(_0xc63f('0xe'));var deskjs=require(_0xc63f('0xf'));var toCsv=require(_0xc63f('0x10'));var querystring=require(_0xc63f('0x11'));var Papa=require(_0xc63f('0x12'));var Redis=require(_0xc63f('0x13'));var authService=require(_0xc63f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc63f('0x15'));var hardwareService=require(_0xc63f('0x16'));var logger=require(_0xc63f('0x17'))('api');var utils=require(_0xc63f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc63f('0x19'));var db=require(_0xc63f('0x1a'))['db'];function respondWithStatusCode(_0x31f1b9,_0x36a6a9){_0x36a6a9=_0x36a6a9||0xcc;return function(_0xb7ce4b){if(_0xb7ce4b){return _0x31f1b9['sendStatus'](_0x36a6a9);}return _0x31f1b9[_0xc63f('0x1b')](_0x36a6a9)[_0xc63f('0x1c')]();};}function respondWithResult(_0x14b08d,_0xaef332){_0xaef332=_0xaef332||0xc8;return function(_0x598257){if(_0x598257){return _0x14b08d[_0xc63f('0x1b')](_0xaef332)[_0xc63f('0x1d')](_0x598257);}};}function respondWithFilteredResult(_0x52b834,_0x1e648c){return function(_0x29d8f4){if(_0x29d8f4){var _0x411fd9=typeof _0x1e648c[_0xc63f('0x1e')]==='undefined'&&typeof _0x1e648c['limit']===_0xc63f('0x1f');var _0x27825=_0x29d8f4[_0xc63f('0x20')];var _0x5ca405=_0x411fd9?0x0:_0x1e648c[_0xc63f('0x1e')];var _0x486cea=_0x411fd9?_0x29d8f4[_0xc63f('0x20')]:_0x1e648c[_0xc63f('0x1e')]+_0x1e648c[_0xc63f('0x21')];var _0x36ba47;if(_0x486cea>=_0x27825){_0x486cea=_0x27825;_0x36ba47=0xc8;}else{_0x36ba47=0xce;}_0x52b834[_0xc63f('0x1b')](_0x36ba47);return _0x52b834[_0xc63f('0x22')](_0xc63f('0x23'),_0x5ca405+'-'+_0x486cea+'/'+_0x27825)[_0xc63f('0x1d')](_0x29d8f4);}return null;};}function patchUpdates(_0x2f123b){return function(_0x4a0995){try{jsonpatch[_0xc63f('0x24')](_0x4a0995,_0x2f123b,!![]);}catch(_0xa2cacf){return BPromise['reject'](_0xa2cacf);}return _0x4a0995[_0xc63f('0x25')]();};}function saveUpdates(_0x1d1e4a,_0x5bd7f9){return function(_0x5b1442){if(_0x5b1442){return _0x5b1442[_0xc63f('0x26')](_0x1d1e4a)['then'](function(_0x4006d2){return _0x4006d2;});}return null;};}function removeEntity(_0x23ca2b,_0x1927cd){return function(_0x4e5e22){if(_0x4e5e22){return _0x4e5e22[_0xc63f('0x27')]()[_0xc63f('0x28')](function(){_0x23ca2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x360c19,_0x36c76b){return function(_0x3870a){if(!_0x3870a){_0x360c19['sendStatus'](0x194);}return _0x3870a;};}function handleError(_0x564f39,_0x485211){_0x485211=_0x485211||0x1f4;return function(_0x2e5d3f){logger[_0xc63f('0x29')](_0x2e5d3f[_0xc63f('0x2a')]);if(_0x2e5d3f[_0xc63f('0x2b')]){delete _0x2e5d3f[_0xc63f('0x2b')];}_0x564f39[_0xc63f('0x1b')](_0x485211)[_0xc63f('0x2c')](_0x2e5d3f);};}exports[_0xc63f('0x2d')]=function(_0x3d01a5,_0x48cebe){var _0x41d40d={},_0x213cce={},_0x4a24d4={'count':0x0,'rows':[]};var _0x3aa7ca=_['map'](db[_0xc63f('0x2e')]['rawAttributes'],function(_0x155d53){return{'name':_0x155d53[_0xc63f('0x2f')],'type':_0x155d53[_0xc63f('0x30')]['key']};});_0x213cce[_0xc63f('0x31')]=_[_0xc63f('0x32')](_0x3aa7ca,'name');_0x213cce[_0xc63f('0x33')]=_['keys'](_0x3d01a5['query']);_0x213cce['filters']=_[_0xc63f('0x34')](_0x213cce[_0xc63f('0x31')],_0x213cce['query']);_0x41d40d[_0xc63f('0x35')]=_[_0xc63f('0x34')](_0x213cce[_0xc63f('0x31')],qs[_0xc63f('0x36')](_0x3d01a5[_0xc63f('0x33')]['fields']));_0x41d40d['attributes']=_0x41d40d[_0xc63f('0x35')][_0xc63f('0x37')]?_0x41d40d[_0xc63f('0x35')]:_0x213cce[_0xc63f('0x31')];if(!_0x3d01a5[_0xc63f('0x33')][_0xc63f('0x38')]('nolimit')){_0x41d40d[_0xc63f('0x21')]=qs[_0xc63f('0x21')](_0x3d01a5['query']['limit']);_0x41d40d[_0xc63f('0x1e')]=qs[_0xc63f('0x1e')](_0x3d01a5[_0xc63f('0x33')]['offset']);}_0x41d40d['order']=qs[_0xc63f('0x39')](_0x3d01a5[_0xc63f('0x33')][_0xc63f('0x39')]);_0x41d40d['where']=qs[_0xc63f('0x3a')](_[_0xc63f('0x3b')](_0x3d01a5[_0xc63f('0x33')],_0x213cce[_0xc63f('0x3a')]),_0x3aa7ca);if(_0x3d01a5[_0xc63f('0x33')]['filter']){_0x41d40d[_0xc63f('0x3c')]=_['merge'](_0x41d40d[_0xc63f('0x3c')],{'$or':_[_0xc63f('0x32')](_0x3aa7ca,function(_0x5a061f){if(_0x5a061f[_0xc63f('0x30')]!==_0xc63f('0x3d')){var _0x5a4c2c={};_0x5a4c2c[_0x5a061f[_0xc63f('0x2b')]]={'$like':'%'+_0x3d01a5[_0xc63f('0x33')][_0xc63f('0x3e')]+'%'};return _0x5a4c2c;}})});}_0x41d40d=_['merge']({},_0x41d40d,_0x3d01a5[_0xc63f('0x3f')]);var _0x294bd1={'where':_0x41d40d[_0xc63f('0x3c')]};return db[_0xc63f('0x2e')][_0xc63f('0x20')](_0x294bd1)['then'](function(_0x3a9fe6){_0x4a24d4[_0xc63f('0x20')]=_0x3a9fe6;if(_0x3d01a5[_0xc63f('0x33')]['includeAll']){_0x41d40d[_0xc63f('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0xc63f('0x41')](_0x41d40d);})[_0xc63f('0x28')](function(_0x1d0ff5){_0x4a24d4['rows']=_0x1d0ff5;return _0x4a24d4;})['then'](respondWithFilteredResult(_0x48cebe,_0x41d40d))['catch'](handleError(_0x48cebe,null));};exports[_0xc63f('0x42')]=function(_0x7431d3,_0x350a7a){var _0x4777ee={'raw':![],'where':{'id':_0x7431d3['params']['id']}},_0x8479eb={};_0x8479eb['model']=_[_0xc63f('0x43')](db[_0xc63f('0x2e')][_0xc63f('0x44')]);_0x8479eb['query']=_['keys'](_0x7431d3[_0xc63f('0x33')]);_0x8479eb[_0xc63f('0x3a')]=_['intersection'](_0x8479eb[_0xc63f('0x31')],_0x8479eb[_0xc63f('0x33')]);_0x4777ee[_0xc63f('0x35')]=_[_0xc63f('0x34')](_0x8479eb['model'],qs[_0xc63f('0x36')](_0x7431d3[_0xc63f('0x33')]['fields']));_0x4777ee[_0xc63f('0x35')]=_0x4777ee['attributes'][_0xc63f('0x37')]?_0x4777ee[_0xc63f('0x35')]:_0x8479eb[_0xc63f('0x31')];if(_0x7431d3[_0xc63f('0x33')][_0xc63f('0x45')]){_0x4777ee['include']=[{'all':!![]}];}_0x4777ee=_[_0xc63f('0x46')]({},_0x4777ee,_0x7431d3[_0xc63f('0x3f')]);return db[_0xc63f('0x2e')][_0xc63f('0x47')](_0x4777ee)['then'](handleEntityNotFound(_0x350a7a,null))['then'](respondWithResult(_0x350a7a,null))[_0xc63f('0x48')](handleError(_0x350a7a,null));};exports[_0xc63f('0x49')]=function(_0x461541,_0x5f5d1e){return db[_0xc63f('0x2e')][_0xc63f('0x49')](_0x461541['body'],{})[_0xc63f('0x28')](respondWithResult(_0x5f5d1e,0xc9))[_0xc63f('0x48')](handleError(_0x5f5d1e,null));};exports['update']=function(_0x3985f9,_0x10d532){if(_0x3985f9[_0xc63f('0x4a')]['id']){delete _0x3985f9[_0xc63f('0x4a')]['id'];}return db['UserProfileSection'][_0xc63f('0x47')]({'where':{'id':_0x3985f9['params']['id']}})[_0xc63f('0x28')](handleEntityNotFound(_0x10d532,null))[_0xc63f('0x28')](saveUpdates(_0x3985f9[_0xc63f('0x4a')],null))['then'](respondWithResult(_0x10d532,null))['catch'](handleError(_0x10d532,null));};exports[_0xc63f('0x27')]=function(_0x4bd280,_0x562469){return db[_0xc63f('0x2e')][_0xc63f('0x47')]({'where':{'id':_0x4bd280[_0xc63f('0x4b')]['id']}})[_0xc63f('0x28')](handleEntityNotFound(_0x562469,null))['then'](removeEntity(_0x562469,null))[_0xc63f('0x48')](handleError(_0x562469,null));};exports['describe']=function(_0x49c179,_0xd87cc9){return db['UserProfileSection']['describe']()[_0xc63f('0x28')](respondWithResult(_0xd87cc9,null))[_0xc63f('0x48')](handleError(_0xd87cc9,null));}; \ No newline at end of file +var _0xb33c=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields'];(function(_0x5cd386,_0x420f9c){var _0x260c4d=function(_0x5264fc){while(--_0x5264fc){_0x5cd386['push'](_0x5cd386['shift']());}};_0x260c4d(++_0x420f9c);}(_0xb33c,0x102));var _0xcb33=function(_0x3d13f5,_0xcc65fa){_0x3d13f5=_0x3d13f5-0x0;var _0x3f98a1=_0xb33c[_0x3d13f5];return _0x3f98a1;};'use strict';var emlformat=require(_0xcb33('0x0'));var rimraf=require(_0xcb33('0x1'));var zipdir=require(_0xcb33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb33('0x3'));var BPromise=require(_0xcb33('0x4'));var Mustache=require('mustache');var util=require(_0xcb33('0x5'));var path=require(_0xcb33('0x6'));var sox=require(_0xcb33('0x7'));var csv=require('to-csv');var ejs=require(_0xcb33('0x8'));var fs=require('fs');var fs_extra=require(_0xcb33('0x9'));var _=require(_0xcb33('0xa'));var squel=require(_0xcb33('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb33('0xc'));var deskjs=require(_0xcb33('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb33('0xe'));var Papa=require(_0xcb33('0xf'));var Redis=require(_0xcb33('0x10'));var authService=require(_0xcb33('0x11'));var qs=require(_0xcb33('0x12'));var as=require(_0xcb33('0x13'));var hardwareService=require(_0xcb33('0x14'));var logger=require(_0xcb33('0x15'))(_0xcb33('0x16'));var utils=require('../../config/utils');var config=require(_0xcb33('0x17'));var licenseUtil=require(_0xcb33('0x18'));var db=require(_0xcb33('0x19'))['db'];function respondWithStatusCode(_0x21c74d,_0x43cc62){_0x43cc62=_0x43cc62||0xcc;return function(_0x343ad4){if(_0x343ad4){return _0x21c74d[_0xcb33('0x1a')](_0x43cc62);}return _0x21c74d[_0xcb33('0x1b')](_0x43cc62)[_0xcb33('0x1c')]();};}function respondWithResult(_0x3d7953,_0x1e746f){_0x1e746f=_0x1e746f||0xc8;return function(_0x29fce0){if(_0x29fce0){return _0x3d7953[_0xcb33('0x1b')](_0x1e746f)[_0xcb33('0x1d')](_0x29fce0);}};}function respondWithFilteredResult(_0x526f63,_0x58d071){return function(_0x49c6a5){if(_0x49c6a5){var _0x18f63a=typeof _0x58d071[_0xcb33('0x1e')]===_0xcb33('0x1f')&&typeof _0x58d071[_0xcb33('0x20')]===_0xcb33('0x1f');var _0x1b152e=_0x49c6a5[_0xcb33('0x21')];var _0x19f8e6=_0x18f63a?0x0:_0x58d071['offset'];var _0x4e0584=_0x18f63a?_0x49c6a5[_0xcb33('0x21')]:_0x58d071['offset']+_0x58d071['limit'];var _0x444dd2;if(_0x4e0584>=_0x1b152e){_0x4e0584=_0x1b152e;_0x444dd2=0xc8;}else{_0x444dd2=0xce;}_0x526f63[_0xcb33('0x1b')](_0x444dd2);return _0x526f63[_0xcb33('0x22')](_0xcb33('0x23'),_0x19f8e6+'-'+_0x4e0584+'/'+_0x1b152e)['json'](_0x49c6a5);}return null;};}function patchUpdates(_0x4a8b1f){return function(_0x589e70){try{jsonpatch[_0xcb33('0x24')](_0x589e70,_0x4a8b1f,!![]);}catch(_0x180742){return BPromise[_0xcb33('0x25')](_0x180742);}return _0x589e70[_0xcb33('0x26')]();};}function saveUpdates(_0x39f752,_0x71024a){return function(_0x51160e){if(_0x51160e){return _0x51160e['update'](_0x39f752)[_0xcb33('0x27')](function(_0x322552){return _0x322552;});}return null;};}function removeEntity(_0x371eda,_0x43974a){return function(_0x29a642){if(_0x29a642){return _0x29a642[_0xcb33('0x28')]()[_0xcb33('0x27')](function(){_0x371eda[_0xcb33('0x1b')](0xcc)[_0xcb33('0x1c')]();});}};}function handleEntityNotFound(_0x184f53,_0x1e82b7){return function(_0x122c48){if(!_0x122c48){_0x184f53[_0xcb33('0x1a')](0x194);}return _0x122c48;};}function handleError(_0x4edd5e,_0x1e1e3a){_0x1e1e3a=_0x1e1e3a||0x1f4;return function(_0x5a470b){logger['error'](_0x5a470b[_0xcb33('0x29')]);if(_0x5a470b['name']){delete _0x5a470b[_0xcb33('0x2a')];}_0x4edd5e[_0xcb33('0x1b')](_0x1e1e3a)[_0xcb33('0x2b')](_0x5a470b);};}exports[_0xcb33('0x2c')]=function(_0x48c354,_0x21cc96){var _0x3ac1ae={},_0x32ea08={},_0x33840d={'count':0x0,'rows':[]};var _0xe0a4a0=_['map'](db[_0xcb33('0x2d')][_0xcb33('0x2e')],function(_0x54e0f8){return{'name':_0x54e0f8[_0xcb33('0x2f')],'type':_0x54e0f8[_0xcb33('0x30')][_0xcb33('0x31')]};});_0x32ea08['model']=_[_0xcb33('0x32')](_0xe0a4a0,_0xcb33('0x2a'));_0x32ea08[_0xcb33('0x33')]=_[_0xcb33('0x34')](_0x48c354['query']);_0x32ea08[_0xcb33('0x35')]=_[_0xcb33('0x36')](_0x32ea08[_0xcb33('0x37')],_0x32ea08[_0xcb33('0x33')]);_0x3ac1ae[_0xcb33('0x38')]=_[_0xcb33('0x36')](_0x32ea08['model'],qs[_0xcb33('0x39')](_0x48c354['query'][_0xcb33('0x39')]));_0x3ac1ae[_0xcb33('0x38')]=_0x3ac1ae[_0xcb33('0x38')][_0xcb33('0x3a')]?_0x3ac1ae[_0xcb33('0x38')]:_0x32ea08[_0xcb33('0x37')];if(!_0x48c354['query'][_0xcb33('0x3b')](_0xcb33('0x3c'))){_0x3ac1ae[_0xcb33('0x20')]=qs[_0xcb33('0x20')](_0x48c354[_0xcb33('0x33')]['limit']);_0x3ac1ae[_0xcb33('0x1e')]=qs[_0xcb33('0x1e')](_0x48c354[_0xcb33('0x33')][_0xcb33('0x1e')]);}_0x3ac1ae['order']=qs[_0xcb33('0x3d')](_0x48c354[_0xcb33('0x33')][_0xcb33('0x3d')]);_0x3ac1ae[_0xcb33('0x3e')]=qs['filters'](_[_0xcb33('0x3f')](_0x48c354[_0xcb33('0x33')],_0x32ea08[_0xcb33('0x35')]),_0xe0a4a0);if(_0x48c354[_0xcb33('0x33')][_0xcb33('0x40')]){_0x3ac1ae[_0xcb33('0x3e')]=_[_0xcb33('0x41')](_0x3ac1ae[_0xcb33('0x3e')],{'$or':_[_0xcb33('0x32')](_0xe0a4a0,function(_0x306ce5){if(_0x306ce5['type']!==_0xcb33('0x42')){var _0x5c2626={};_0x5c2626[_0x306ce5[_0xcb33('0x2a')]]={'$like':'%'+_0x48c354['query']['filter']+'%'};return _0x5c2626;}})});}_0x3ac1ae=_[_0xcb33('0x41')]({},_0x3ac1ae,_0x48c354[_0xcb33('0x43')]);var _0x4c9735={'where':_0x3ac1ae[_0xcb33('0x3e')]};return db[_0xcb33('0x2d')][_0xcb33('0x21')](_0x4c9735)[_0xcb33('0x27')](function(_0x38c805){_0x33840d[_0xcb33('0x21')]=_0x38c805;if(_0x48c354[_0xcb33('0x33')][_0xcb33('0x44')]){_0x3ac1ae[_0xcb33('0x45')]=[{'all':!![]}];}return db['UserProfileSection'][_0xcb33('0x46')](_0x3ac1ae);})[_0xcb33('0x27')](function(_0xfcbe63){_0x33840d[_0xcb33('0x47')]=_0xfcbe63;return _0x33840d;})[_0xcb33('0x27')](respondWithFilteredResult(_0x21cc96,_0x3ac1ae))[_0xcb33('0x48')](handleError(_0x21cc96,null));};exports[_0xcb33('0x49')]=function(_0x2ef133,_0x6d708e){var _0x2eb946={'raw':![],'where':{'id':_0x2ef133['params']['id']}},_0x25dd1={};_0x25dd1['model']=_[_0xcb33('0x34')](db[_0xcb33('0x2d')]['rawAttributes']);_0x25dd1[_0xcb33('0x33')]=_[_0xcb33('0x34')](_0x2ef133[_0xcb33('0x33')]);_0x25dd1[_0xcb33('0x35')]=_['intersection'](_0x25dd1[_0xcb33('0x37')],_0x25dd1[_0xcb33('0x33')]);_0x2eb946['attributes']=_[_0xcb33('0x36')](_0x25dd1['model'],qs[_0xcb33('0x39')](_0x2ef133[_0xcb33('0x33')][_0xcb33('0x39')]));_0x2eb946[_0xcb33('0x38')]=_0x2eb946['attributes'][_0xcb33('0x3a')]?_0x2eb946[_0xcb33('0x38')]:_0x25dd1[_0xcb33('0x37')];if(_0x2ef133[_0xcb33('0x33')]['includeAll']){_0x2eb946[_0xcb33('0x45')]=[{'all':!![]}];}_0x2eb946=_['merge']({},_0x2eb946,_0x2ef133[_0xcb33('0x43')]);return db[_0xcb33('0x2d')][_0xcb33('0x4a')](_0x2eb946)['then'](handleEntityNotFound(_0x6d708e,null))[_0xcb33('0x27')](respondWithResult(_0x6d708e,null))['catch'](handleError(_0x6d708e,null));};exports[_0xcb33('0x4b')]=function(_0x4e5e7a,_0x58e43c){return db[_0xcb33('0x2d')]['create'](_0x4e5e7a[_0xcb33('0x4c')],{})[_0xcb33('0x27')](respondWithResult(_0x58e43c,0xc9))['catch'](handleError(_0x58e43c,null));};exports['update']=function(_0x4fa1bf,_0x3a18ee){if(_0x4fa1bf['body']['id']){delete _0x4fa1bf[_0xcb33('0x4c')]['id'];}return db[_0xcb33('0x2d')][_0xcb33('0x4a')]({'where':{'id':_0x4fa1bf[_0xcb33('0x4d')]['id']}})[_0xcb33('0x27')](handleEntityNotFound(_0x3a18ee,null))['then'](saveUpdates(_0x4fa1bf[_0xcb33('0x4c')],null))[_0xcb33('0x27')](respondWithResult(_0x3a18ee,null))[_0xcb33('0x48')](handleError(_0x3a18ee,null));};exports[_0xcb33('0x28')]=function(_0x3f499e,_0x22ad49){return db[_0xcb33('0x2d')][_0xcb33('0x4a')]({'where':{'id':_0x3f499e['params']['id']}})[_0xcb33('0x27')](handleEntityNotFound(_0x22ad49,null))[_0xcb33('0x27')](removeEntity(_0x22ad49,null))[_0xcb33('0x48')](handleError(_0x22ad49,null));};exports[_0xcb33('0x4e')]=function(_0x5609bb,_0x1666f7){return db[_0xcb33('0x2d')][_0xcb33('0x4e')]()['then'](respondWithResult(_0x1666f7,null))[_0xcb33('0x48')](handleError(_0x1666f7,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 84ccd86..7f7a1b2 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 _0x29a8=['moment','bluebird','path','rimraf','../../config/environment','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger'];(function(_0x2b03ee,_0x407363){var _0x50b1e5=function(_0x267cad){while(--_0x267cad){_0x2b03ee['push'](_0x2b03ee['shift']());}};_0x50b1e5(++_0x407363);}(_0x29a8,0x185));var _0x829a=function(_0x533927,_0x289652){_0x533927=_0x533927-0x0;var _0x3aa9a6=_0x29a8[_0x533927];return _0x3aa9a6;};'use strict';var _=require(_0x829a('0x0'));var util=require(_0x829a('0x1'));var logger=require(_0x829a('0x2'))('api');var moment=require(_0x829a('0x3'));var BPromise=require(_0x829a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x829a('0x5'));var rimraf=require(_0x829a('0x6'));var config=require(_0x829a('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x9c05,_0x3d8f5a){return _0x9c05[_0x829a('0x8')](_0x829a('0x9'),attributes,{'tableName':_0x829a('0xa'),'paranoid':![],'indexes':[{'name':_0x829a('0xb'),'fields':[_0x829a('0xc'),_0x829a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x43ef=['sectionId','userProfileId','lodash','util','moment','bluebird','request-promise','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x43ef,0xc6));var _0xf43e=function(_0x17a6b0,_0x1abb71){_0x17a6b0=_0x17a6b0-0x0;var _0x343821=_0x43ef[_0x17a6b0];return _0x343821;};'use strict';var _=require(_0xf43e('0x0'));var util=require(_0xf43e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf43e('0x2'));var BPromise=require(_0xf43e('0x3'));var rp=require(_0xf43e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf43e('0x5'));var config=require('../../config/environment');var attributes=require(_0xf43e('0x6'));module[_0xf43e('0x7')]=function(_0x46b967,_0x2d984a){return _0x46b967[_0xf43e('0x8')](_0xf43e('0x9'),attributes,{'tableName':_0xf43e('0xa'),'paranoid':![],'indexes':[{'name':_0xf43e('0xb'),'fields':[_0xf43e('0xc'),_0xf43e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index bc8a269..33e14f6 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 _0x3ecb=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2126f6,_0xbaa59a){var _0x1ea72a=function(_0x4b6b74){while(--_0x4b6b74){_0x2126f6['push'](_0x2126f6['shift']());}};_0x1ea72a(++_0xbaa59a);}(_0x3ecb,0x181));var _0xb3ec=function(_0xab3958,_0x2aff3e){_0xab3958=_0xab3958-0x0;var _0x309147=_0x3ecb[_0xab3958];return _0x309147;};'use strict';var _=require(_0xb3ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb3ec('0x1'));var rs=require(_0xb3ec('0x2'));var fs=require('fs');var Redis=require(_0xb3ec('0x3'));var db=require(_0xb3ec('0x4'))['db'];var utils=require(_0xb3ec('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb3ec('0x6'));var jayson=require(_0xb3ec('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbc9c6f,_0x3b20c4,_0x1f7821){return new BPromise(function(_0x1a6ffb,_0x33d6ae){return client[_0xb3ec('0x8')](_0xbc9c6f,_0x1f7821)[_0xb3ec('0x9')](function(_0x4ac19b){logger['info'](_0xb3ec('0xa'),_0x3b20c4,_0xb3ec('0xb'));logger[_0xb3ec('0xc')](_0xb3ec('0xd'),_0x3b20c4,'request\x20sent',JSON[_0xb3ec('0xe')](_0x4ac19b));if(_0x4ac19b[_0xb3ec('0xf')]){if(_0x4ac19b[_0xb3ec('0xf')][_0xb3ec('0x10')]===0x1f4){logger[_0xb3ec('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x3b20c4,_0x4ac19b['error'][_0xb3ec('0x11')]);return _0x33d6ae(_0x4ac19b[_0xb3ec('0xf')][_0xb3ec('0x11')]);}logger[_0xb3ec('0xf')](_0xb3ec('0xa'),_0x3b20c4,_0x4ac19b[_0xb3ec('0xf')][_0xb3ec('0x11')]);return _0x1a6ffb(_0x4ac19b[_0xb3ec('0xf')]['message']);}else{logger['info'](_0xb3ec('0xa'),_0x3b20c4,_0xb3ec('0xb'));_0x1a6ffb(_0x4ac19b[_0xb3ec('0x12')][_0xb3ec('0x11')]);}})[_0xb3ec('0x13')](function(_0x134a2a){logger[_0xb3ec('0xf')](_0xb3ec('0xa'),_0x3b20c4,_0x134a2a);_0x33d6ae(_0x134a2a);});});} \ No newline at end of file +var _0x0d92=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0d92,0x1d1));var _0x20d9=function(_0x27ebb0,_0x1d8df6){_0x27ebb0=_0x27ebb0-0x0;var _0x29a4ba=_0x0d92[_0x27ebb0];return _0x29a4ba;};'use strict';var _=require(_0x20d9('0x0'));var util=require(_0x20d9('0x1'));var moment=require(_0x20d9('0x2'));var BPromise=require(_0x20d9('0x3'));var rs=require(_0x20d9('0x4'));var fs=require('fs');var Redis=require(_0x20d9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x20d9('0x6'));var logger=require(_0x20d9('0x7'))(_0x20d9('0x8'));var config=require('../../config/environment');var jayson=require(_0x20d9('0x9'));var client=jayson[_0x20d9('0xa')][_0x20d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eb0f2,_0x76ccf1,_0x37b705){return new BPromise(function(_0x4286da,_0x31b933){return client['request'](_0x5eb0f2,_0x37b705)[_0x20d9('0xc')](function(_0x4e6711){logger[_0x20d9('0xd')](_0x20d9('0xe'),_0x76ccf1,'request\x20sent');logger[_0x20d9('0xf')](_0x20d9('0x10'),_0x76ccf1,_0x20d9('0x11'),JSON['stringify'](_0x4e6711));if(_0x4e6711[_0x20d9('0x12')]){if(_0x4e6711['error'][_0x20d9('0x13')]===0x1f4){logger[_0x20d9('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x76ccf1,_0x4e6711[_0x20d9('0x12')]['message']);return _0x31b933(_0x4e6711[_0x20d9('0x12')][_0x20d9('0x14')]);}logger[_0x20d9('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x76ccf1,_0x4e6711['error'][_0x20d9('0x14')]);return _0x4286da(_0x4e6711['error'][_0x20d9('0x14')]);}else{logger[_0x20d9('0xd')](_0x20d9('0xe'),_0x76ccf1,'request\x20sent');_0x4286da(_0x4e6711[_0x20d9('0x15')][_0x20d9('0x14')]);}})['catch'](function(_0x545942){logger[_0x20d9('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x76ccf1,_0x545942);_0x31b933(_0x545942);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 6de46bd..f697ef4 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xa2ab64,_0x4593f1){var _0x4ac6c6=function(_0x9dc2f4){while(--_0x9dc2f4){_0xa2ab64['push'](_0xa2ab64['shift']());}};_0x4ac6c6(++_0x4593f1);}(_0xedd9,0xfc));var _0x9edd=function(_0x18a84d,_0x50edb8){_0x18a84d=_0x18a84d-0x0;var _0x4f0d94=_0xedd9[_0x18a84d];return _0x4f0d94;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4f98bd,_0x5a478d){var _0x143a7d=function(_0xb4e744){while(--_0xb4e744){_0x4f98bd['push'](_0x4f98bd['shift']());}};_0x143a7d(++_0x5a478d);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4cc7084..67b9e29 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 _0xc53a=['INTEGER','sequelize','exports'];(function(_0x2349ef,_0x2cf831){var _0x13e295=function(_0x186196){while(--_0x186196){_0x2349ef['push'](_0x2349ef['shift']());}};_0x13e295(++_0x2cf831);}(_0xc53a,0xd6));var _0xac53=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc53a[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xac53('0x0'));module[_0xac53('0x1')]={'penalty':{'type':Sequelize[_0xac53('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3442=['exports','INTEGER','sequelize'];(function(_0x49368d,_0xa36d84){var _0x528010=function(_0x16967e){while(--_0x16967e){_0x49368d['push'](_0x49368d['shift']());}};_0x528010(++_0xa36d84);}(_0x3442,0x194));var _0x2344=function(_0xbdf188,_0x40071a){_0xbdf188=_0xbdf188-0x0;var _0x3a536c=_0x3442[_0xbdf188];return _0x3a536c;};'use strict';var Sequelize=require(_0x2344('0x0'));module[_0x2344('0x1')]={'penalty':{'type':Sequelize[_0x2344('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 29f4472..51d7d99 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 _0x9582=['bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x7700a3,_0x33805f){var _0x1f7d55=function(_0x78f20c){while(--_0x78f20c){_0x7700a3['push'](_0x7700a3['shift']());}};_0x1f7d55(++_0x33805f);}(_0x9582,0x95));var _0x2958=function(_0x199ad3,_0x19d7ba){_0x199ad3=_0x199ad3-0x0;var _0x58bc8e=_0x9582[_0x199ad3];return _0x58bc8e;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var logger=require(_0x2958('0x2'))(_0x2958('0x3'));var moment=require(_0x2958('0x4'));var BPromise=require(_0x2958('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2958('0x6'));var rimraf=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var attributes=require(_0x2958('0x9'));module[_0x2958('0xa')]=function(_0xbde128,_0x88ffaa){return _0xbde128[_0x2958('0xb')](_0x2958('0xc'),attributes,{'tableName':_0x2958('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90ec=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0x90ec,0x1d4));var _0xc90e=function(_0x4e9bf9,_0x235043){_0x4e9bf9=_0x4e9bf9-0x0;var _0x5685e2=_0x90ec[_0x4e9bf9];return _0x5685e2;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var logger=require('../../config/logger')(_0xc90e('0x2'));var moment=require(_0xc90e('0x3'));var BPromise=require(_0xc90e('0x4'));var rp=require(_0xc90e('0x5'));var fs=require('fs');var path=require(_0xc90e('0x6'));var rimraf=require('rimraf');var config=require(_0xc90e('0x7'));var attributes=require(_0xc90e('0x8'));module[_0xc90e('0x9')]=function(_0x54a0a8,_0x259c62){return _0x54a0a8['define'](_0xc90e('0xa'),attributes,{'tableName':_0xc90e('0xb'),'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 a641dc4..cd37d00 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 _0x7ab5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','lodash','util','moment'];(function(_0x4f0317,_0xb2e5a1){var _0x4e24e3=function(_0x5070a3){while(--_0x5070a3){_0x4f0317['push'](_0x4f0317['shift']());}};_0x4e24e3(++_0xb2e5a1);}(_0x7ab5,0x1e0));var _0x57ab=function(_0x3245ef,_0x28b64d){_0x3245ef=_0x3245ef-0x0;var _0x37c1b8=_0x7ab5[_0x3245ef];return _0x37c1b8;};'use strict';var _=require(_0x57ab('0x0'));var util=require(_0x57ab('0x1'));var moment=require(_0x57ab('0x2'));var BPromise=require(_0x57ab('0x3'));var rs=require(_0x57ab('0x4'));var fs=require('fs');var Redis=require(_0x57ab('0x5'));var db=require(_0x57ab('0x6'))['db'];var utils=require(_0x57ab('0x7'));var logger=require(_0x57ab('0x8'))(_0x57ab('0x9'));var config=require(_0x57ab('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x57ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x284168,_0x1f3e4d,_0x11752d){return new BPromise(function(_0x3b32cf,_0x317ff5){return client[_0x57ab('0xc')](_0x284168,_0x11752d)['then'](function(_0x44b04f){logger['info'](_0x57ab('0xd'),_0x1f3e4d,'request\x20sent');logger[_0x57ab('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1f3e4d,_0x57ab('0xf'),JSON['stringify'](_0x44b04f));if(_0x44b04f['error']){if(_0x44b04f[_0x57ab('0x10')][_0x57ab('0x11')]===0x1f4){logger[_0x57ab('0x10')](_0x57ab('0xd'),_0x1f3e4d,_0x44b04f[_0x57ab('0x10')][_0x57ab('0x12')]);return _0x317ff5(_0x44b04f[_0x57ab('0x10')]['message']);}logger['error'](_0x57ab('0xd'),_0x1f3e4d,_0x44b04f[_0x57ab('0x10')]['message']);return _0x3b32cf(_0x44b04f[_0x57ab('0x10')][_0x57ab('0x12')]);}else{logger[_0x57ab('0x13')](_0x57ab('0xd'),_0x1f3e4d,_0x57ab('0xf'));_0x3b32cf(_0x44b04f['result'][_0x57ab('0x12')]);}})[_0x57ab('0x14')](function(_0x518b86){logger[_0x57ab('0x10')](_0x57ab('0xd'),_0x1f3e4d,_0x518b86);_0x317ff5(_0x518b86);});});} \ No newline at end of file +var _0xe81c=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x17d349,_0x150471){var _0x1e9a52=function(_0x2351ee){while(--_0x2351ee){_0x17d349['push'](_0x17d349['shift']());}};_0x1e9a52(++_0x150471);}(_0xe81c,0xa6));var _0xce81=function(_0x5f2098,_0x47308b){_0x5f2098=_0x5f2098-0x0;var _0x18af32=_0xe81c[_0x5f2098];return _0x18af32;};'use strict';var _=require(_0xce81('0x0'));var util=require(_0xce81('0x1'));var moment=require(_0xce81('0x2'));var BPromise=require(_0xce81('0x3'));var rs=require(_0xce81('0x4'));var fs=require('fs');var Redis=require(_0xce81('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce81('0x6'));var logger=require(_0xce81('0x7'))(_0xce81('0x8'));var config=require('../../config/environment');var jayson=require(_0xce81('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cc1a6,_0x4310e1,_0x1fb974){return new BPromise(function(_0x5d07b0,_0x172cde){return client[_0xce81('0xa')](_0x5cc1a6,_0x1fb974)['then'](function(_0x1360c5){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x4310e1,_0xce81('0xb'));logger[_0xce81('0xc')](_0xce81('0xd'),_0x4310e1,_0xce81('0xb'),JSON[_0xce81('0xe')](_0x1360c5));if(_0x1360c5['error']){if(_0x1360c5[_0xce81('0xf')][_0xce81('0x10')]===0x1f4){logger[_0xce81('0xf')](_0xce81('0x11'),_0x4310e1,_0x1360c5[_0xce81('0xf')][_0xce81('0x12')]);return _0x172cde(_0x1360c5[_0xce81('0xf')][_0xce81('0x12')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4310e1,_0x1360c5[_0xce81('0xf')][_0xce81('0x12')]);return _0x5d07b0(_0x1360c5['error'][_0xce81('0x12')]);}else{logger[_0xce81('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x4310e1,'request\x20sent');_0x5d07b0(_0x1360c5['result'][_0xce81('0x12')]);}})[_0xce81('0x14')](function(_0x1b421f){logger[_0xce81('0xf')](_0xce81('0x11'),_0x4310e1,_0x1b421f);_0x172cde(_0x1b421f);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index f247ce5..9db71c2 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 _0x7ab7=['INTEGER','exports'];(function(_0x2976d5,_0x394a5e){var _0x4b57e0=function(_0x3c9508){while(--_0x3c9508){_0x2976d5['push'](_0x2976d5['shift']());}};_0x4b57e0(++_0x394a5e);}(_0x7ab7,0xb7));var _0x77ab=function(_0xba6785,_0x171798){_0xba6785=_0xba6785-0x0;var _0x23c7c1=_0x7ab7[_0xba6785];return _0x23c7c1;};'use strict';var Sequelize=require('sequelize');module[_0x77ab('0x0')]={'UserId':{'type':Sequelize[_0x77ab('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x77ab('0x1')]}}; \ No newline at end of file +var _0x6190=['exports','INTEGER'];(function(_0x3ddd13,_0x30f93c){var _0x4d1771=function(_0x13c6a9){while(--_0x13c6a9){_0x3ddd13['push'](_0x3ddd13['shift']());}};_0x4d1771(++_0x30f93c);}(_0x6190,0x1a2));var _0x0619=function(_0x1d8891,_0x578c2d){_0x1d8891=_0x1d8891-0x0;var _0x5c90fa=_0x6190[_0x1d8891];return _0x5c90fa;};'use strict';var Sequelize=require('sequelize');module[_0x0619('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x0619('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index ed55e82..37d3b0e 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(_0x204aa0,_0x1e28f3){var _0x1a8209=function(_0x501862){while(--_0x501862){_0x204aa0['push'](_0x204aa0['shift']());}};_0x1a8209(++_0x1e28f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x437cc1,_0x4cbd63){var _0x2f6c5a=function(_0x53bf9a){while(--_0x53bf9a){_0x437cc1['push'](_0x437cc1['shift']());}};_0x2f6c5a(++_0x4cbd63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 cfbd17c..d848482 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x384c01,_0x1e0dc5){var _0x300793=function(_0x32bb86){while(--_0x32bb86){_0x384c01['push'](_0x384c01['shift']());}};_0x300793(++_0x1e0dc5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x56d096,_0x3486bc){var _0x473110=function(_0x1e664b){while(--_0x1e664b){_0x56d096['push'](_0x56d096['shift']());}};_0x473110(++_0x3486bc);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 5068385..b60125c 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 _0xb5a7=['exports','INTEGER','sequelize'];(function(_0x12651a,_0x3d04ba){var _0x4ebaf5=function(_0x4ad424){while(--_0x4ad424){_0x12651a['push'](_0x12651a['shift']());}};_0x4ebaf5(++_0x3d04ba);}(_0xb5a7,0x146));var _0x7b5a=function(_0x2483b5,_0x1d09af){_0x2483b5=_0x2483b5-0x0;var _0x2a7e94=_0xb5a7[_0x2483b5];return _0x2a7e94;};'use strict';var Sequelize=require(_0x7b5a('0x0'));module[_0x7b5a('0x1')]={'penalty':{'type':Sequelize[_0x7b5a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2bfa=['exports','INTEGER'];(function(_0x20c434,_0x9b5b7e){var _0x24d74f=function(_0x485d8b){while(--_0x485d8b){_0x20c434['push'](_0x20c434['shift']());}};_0x24d74f(++_0x9b5b7e);}(_0x2bfa,0x7c));var _0xa2bf=function(_0x1ab0aa,_0x1c7246){_0x1ab0aa=_0x1ab0aa-0x0;var _0x441801=_0x2bfa[_0x1ab0aa];return _0x441801;};'use strict';var Sequelize=require('sequelize');module[_0xa2bf('0x0')]={'penalty':{'type':Sequelize[_0xa2bf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index f7951bf..cf77182 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 _0xd9fc=['../../config/logger','api','moment','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x529fc6,_0x4cf2d3){var _0x4b565f=function(_0x1b6430){while(--_0x1b6430){_0x529fc6['push'](_0x529fc6['shift']());}};_0x4b565f(++_0x4cf2d3);}(_0xd9fc,0x177));var _0xcd9f=function(_0x4ff56d,_0x12bcbb){_0x4ff56d=_0x4ff56d-0x0;var _0x2480a0=_0xd9fc[_0x4ff56d];return _0x2480a0;};'use strict';var _=require(_0xcd9f('0x0'));var util=require(_0xcd9f('0x1'));var logger=require(_0xcd9f('0x2'))(_0xcd9f('0x3'));var moment=require(_0xcd9f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd9f('0x5'));var rimraf=require(_0xcd9f('0x6'));var config=require(_0xcd9f('0x7'));var attributes=require(_0xcd9f('0x8'));module[_0xcd9f('0x9')]=function(_0x1d4699,_0x587daf){return _0x1d4699[_0xcd9f('0xa')](_0xcd9f('0xb'),attributes,{'tableName':_0xcd9f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc144=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','util'];(function(_0x2ad613,_0x2d8648){var _0x5bd8f3=function(_0x157379){while(--_0x157379){_0x2ad613['push'](_0x2ad613['shift']());}};_0x5bd8f3(++_0x2d8648);}(_0xc144,0x19f));var _0x4c14=function(_0x2a9cc6,_0x25e508){_0x2a9cc6=_0x2a9cc6-0x0;var _0x2043d3=_0xc144[_0x2a9cc6];return _0x2043d3;};'use strict';var _=require('lodash');var util=require(_0x4c14('0x0'));var logger=require(_0x4c14('0x1'))(_0x4c14('0x2'));var moment=require('moment');var BPromise=require(_0x4c14('0x3'));var rp=require(_0x4c14('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c14('0x5'));var config=require(_0x4c14('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x4c14('0x7')]=function(_0x2f8f0d,_0x525485){return _0x2f8f0d['define']('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index a01d7d5..284ccfe 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 _0x3ebd=['../../config/logger','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ebd,0x1f3));var _0xd3eb=function(_0x231691,_0x32e0ee){_0x231691=_0x231691-0x0;var _0x3675e0=_0x3ebd[_0x231691];return _0x3675e0;};'use strict';var _=require(_0xd3eb('0x0'));var util=require(_0xd3eb('0x1'));var moment=require(_0xd3eb('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3eb('0x3'));var fs=require('fs');var Redis=require(_0xd3eb('0x4'));var db=require(_0xd3eb('0x5'))['db'];var utils=require(_0xd3eb('0x6'));var logger=require(_0xd3eb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd3eb('0x8'));var client=jayson[_0xd3eb('0x9')][_0xd3eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x295ba8,_0x6abee5,_0x103bff){return new BPromise(function(_0x28b345,_0x4eda58){return client[_0xd3eb('0xb')](_0x295ba8,_0x103bff)[_0xd3eb('0xc')](function(_0xe05467){logger[_0xd3eb('0xd')](_0xd3eb('0xe'),_0x6abee5,_0xd3eb('0xf'));logger[_0xd3eb('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x6abee5,_0xd3eb('0xf'),JSON[_0xd3eb('0x11')](_0xe05467));if(_0xe05467[_0xd3eb('0x12')]){if(_0xe05467[_0xd3eb('0x12')][_0xd3eb('0x13')]===0x1f4){logger['error'](_0xd3eb('0xe'),_0x6abee5,_0xe05467['error'][_0xd3eb('0x14')]);return _0x4eda58(_0xe05467[_0xd3eb('0x12')][_0xd3eb('0x14')]);}logger['error'](_0xd3eb('0xe'),_0x6abee5,_0xe05467[_0xd3eb('0x12')]['message']);return _0x28b345(_0xe05467[_0xd3eb('0x12')][_0xd3eb('0x14')]);}else{logger[_0xd3eb('0xd')](_0xd3eb('0xe'),_0x6abee5,_0xd3eb('0xf'));_0x28b345(_0xe05467['result']['message']);}})[_0xd3eb('0x15')](function(_0x458af4){logger[_0xd3eb('0x12')](_0xd3eb('0xe'),_0x6abee5,_0x458af4);_0x4eda58(_0x458af4);});});} \ No newline at end of file +var _0xb727=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x17bc6a,_0x308586){var _0x4e629d=function(_0x19d7b3){while(--_0x19d7b3){_0x17bc6a['push'](_0x17bc6a['shift']());}};_0x4e629d(++_0x308586);}(_0xb727,0x17f));var _0x7b72=function(_0x370c0b,_0x1a2326){_0x370c0b=_0x370c0b-0x0;var _0xae0254=_0xb727[_0x370c0b];return _0xae0254;};'use strict';var _=require('lodash');var util=require(_0x7b72('0x0'));var moment=require(_0x7b72('0x1'));var BPromise=require(_0x7b72('0x2'));var rs=require(_0x7b72('0x3'));var fs=require('fs');var Redis=require(_0x7b72('0x4'));var db=require(_0x7b72('0x5'))['db'];var utils=require(_0x7b72('0x6'));var logger=require('../../config/logger')(_0x7b72('0x7'));var config=require(_0x7b72('0x8'));var jayson=require(_0x7b72('0x9'));var client=jayson['client'][_0x7b72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457d4e,_0x34512a,_0x4c642c){return new BPromise(function(_0x32feef,_0x303707){return client[_0x7b72('0xb')](_0x457d4e,_0x4c642c)[_0x7b72('0xc')](function(_0x447b25){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x34512a,_0x7b72('0xd'));logger[_0x7b72('0xe')](_0x7b72('0xf'),_0x34512a,_0x7b72('0xd'),JSON[_0x7b72('0x10')](_0x447b25));if(_0x447b25[_0x7b72('0x11')]){if(_0x447b25['error']['code']===0x1f4){logger[_0x7b72('0x11')](_0x7b72('0x12'),_0x34512a,_0x447b25['error'][_0x7b72('0x13')]);return _0x303707(_0x447b25['error'][_0x7b72('0x13')]);}logger[_0x7b72('0x11')](_0x7b72('0x12'),_0x34512a,_0x447b25['error'][_0x7b72('0x13')]);return _0x32feef(_0x447b25[_0x7b72('0x11')][_0x7b72('0x13')]);}else{logger['info'](_0x7b72('0x12'),_0x34512a,'request\x20sent');_0x32feef(_0x447b25[_0x7b72('0x14')][_0x7b72('0x13')]);}})[_0x7b72('0x15')](function(_0x275c23){logger['error'](_0x7b72('0x12'),_0x34512a,_0x275c23);_0x303707(_0x275c23);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ad1a3b4..4a2afd3 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(_0x2c6aed,_0x25db1f){var _0x5f44b1=function(_0x46d8b2){while(--_0x46d8b2){_0x2c6aed['push'](_0x2c6aed['shift']());}};_0x5f44b1(++_0x25db1f);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x36b5be,_0x25cbb9){var _0x186b09=function(_0x559d03){while(--_0x559d03){_0x36b5be['push'](_0x36b5be['shift']());}};_0x186b09(++_0x25cbb9);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 347368e..49de4eb 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 _0x0dba=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x0dba,0xc7));var _0xa0db=function(_0x4f0b72,_0x4e8b49){_0x4f0b72=_0x4f0b72-0x0;var _0x537a6e=_0x0dba[_0x4f0b72];return _0x537a6e;};'use strict';var Sequelize=require(_0xa0db('0x0'));module[_0xa0db('0x1')]={'uniqueid':{'type':Sequelize[_0xa0db('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa0db('0x3')},'membername':{'type':Sequelize[_0xa0db('0x4')],'allowNull':![],'comment':_0xa0db('0x3')},'UserId':{'type':Sequelize[_0xa0db('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa0db('0x4')],'allowNull':![],'unique':_0xa0db('0x5'),'comment':_0xa0db('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa0db('0x5'),'comment':_0xa0db('0x3')},'penalty':{'type':Sequelize[_0xa0db('0x2')](0xb),'defaultValue':0x0,'comment':_0xa0db('0x3')},'paused':{'type':Sequelize[_0xa0db('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x127f=['Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER','STRING'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x127f,0xbc));var _0xf127=function(_0x224b1c,_0x5c242f){_0x224b1c=_0x224b1c-0x0;var _0x205659=_0x127f[_0x224b1c];return _0x205659;};'use strict';var Sequelize=require(_0xf127('0x0'));module[_0xf127('0x1')]={'uniqueid':{'type':Sequelize[_0xf127('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xf127('0x3')],'allowNull':![],'comment':_0xf127('0x4')},'UserId':{'type':Sequelize[_0xf127('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf127('0x3')],'allowNull':![],'unique':_0xf127('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xf127('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xf127('0x4')},'penalty':{'type':Sequelize[_0xf127('0x2')](0xb),'defaultValue':0x0,'comment':_0xf127('0x4')},'paused':{'type':Sequelize[_0xf127('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ccfe35b..2758aad 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 _0x5bcd=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1d2955,_0x4991e9){var _0x5ab8cf=function(_0x1ff636){while(--_0x1ff636){_0x1d2955['push'](_0x1d2955['shift']());}};_0x5ab8cf(++_0x4991e9);}(_0x5bcd,0xa0));var _0xd5bc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x5bcd[_0x5c3c0b];return _0x52ecd2;};'use strict';var EventEmitter=require(_0xd5bc('0x0'));var UserVoiceQueueRt=require(_0xd5bc('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd5bc('0x2')](0x0);var events={'afterCreate':_0xd5bc('0x3'),'afterUpdate':_0xd5bc('0x4'),'afterDestroy':_0xd5bc('0x5')};function emitEvent(_0x2ed887){return function(_0x54ede5,_0x21b21d,_0x52e82e){UserVoiceQueueRtEvents[_0xd5bc('0x6')](_0x2ed887+':'+_0x54ede5['id'],_0x54ede5);UserVoiceQueueRtEvents[_0xd5bc('0x6')](_0x2ed887,_0x54ede5);_0x52e82e(null);};}for(var e in events){if(events[_0xd5bc('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xd5bc('0x8')](e,emitEvent(event));}}module[_0xd5bc('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xf813=['UserVoiceQueueRt','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5e3e74,_0x98304){var _0x104728=function(_0x4b135b){while(--_0x4b135b){_0x5e3e74['push'](_0x5e3e74['shift']());}};_0x104728(++_0x98304);}(_0xf813,0x194));var _0x3f81=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0xf813[_0x287059];return _0x225c79;};'use strict';var EventEmitter=require(_0x3f81('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x3f81('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3f81('0x2')](0x0);var events={'afterCreate':_0x3f81('0x3'),'afterUpdate':_0x3f81('0x4'),'afterDestroy':'remove'};function emitEvent(_0x54b67d){return function(_0x382f2c,_0x42b280,_0x2fb419){UserVoiceQueueRtEvents[_0x3f81('0x5')](_0x54b67d+':'+_0x382f2c['id'],_0x382f2c);UserVoiceQueueRtEvents[_0x3f81('0x5')](_0x54b67d,_0x382f2c);_0x2fb419(null);};}for(var e in events){if(events[_0x3f81('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x3f81('0x7')](e,emitEvent(event));}}module[_0x3f81('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 76cc491..9dd93bd 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 _0x5587=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x443f79,_0x33e446){var _0x3847e4=function(_0x42fa01){while(--_0x42fa01){_0x443f79['push'](_0x443f79['shift']());}};_0x3847e4(++_0x33e446);}(_0x5587,0x180));var _0x7558=function(_0x53c9ba,_0xc262bf){_0x53c9ba=_0x53c9ba-0x0;var _0x15507c=_0x5587[_0x53c9ba];return _0x15507c;};'use strict';var _=require(_0x7558('0x0'));var util=require(_0x7558('0x1'));var logger=require(_0x7558('0x2'))(_0x7558('0x3'));var moment=require(_0x7558('0x4'));var BPromise=require(_0x7558('0x5'));var rp=require(_0x7558('0x6'));var fs=require('fs');var path=require(_0x7558('0x7'));var rimraf=require(_0x7558('0x8'));var config=require(_0x7558('0x9'));var attributes=require(_0x7558('0xa'));module[_0x7558('0xb')]=function(_0x2d9f98,_0x23d16a){return _0x2d9f98[_0x7558('0xc')](_0x7558('0xd'),attributes,{'tableName':_0x7558('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1155=['moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api'];(function(_0x16b67a,_0x445915){var _0x108f56=function(_0x2fd4ed){while(--_0x2fd4ed){_0x16b67a['push'](_0x16b67a['shift']());}};_0x108f56(++_0x445915);}(_0x1155,0x99));var _0x5115=function(_0x5d7417,_0x88d7ca){_0x5d7417=_0x5d7417-0x0;var _0x139270=_0x1155[_0x5d7417];return _0x139270;};'use strict';var _=require('lodash');var util=require(_0x5115('0x0'));var logger=require(_0x5115('0x1'))(_0x5115('0x2'));var moment=require(_0x5115('0x3'));var BPromise=require(_0x5115('0x4'));var rp=require(_0x5115('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5115('0x6'));var config=require(_0x5115('0x7'));var attributes=require(_0x5115('0x8'));module[_0x5115('0x9')]=function(_0x27e4e9,_0x31db53){return _0x27e4e9[_0x5115('0xa')](_0x5115('0xb'),attributes,{'tableName':_0x5115('0xc'),'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 71bbf70..eb9f99e 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 _0xc366=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0xe4854b,_0x414b50){var _0x1c3d72=function(_0x266317){while(--_0x266317){_0xe4854b['push'](_0xe4854b['shift']());}};_0x1c3d72(++_0x414b50);}(_0xc366,0x6c));var _0x6c36=function(_0x4566c3,_0x10bb8f){_0x4566c3=_0x4566c3-0x0;var _0x476ae3=_0xc366[_0x4566c3];return _0x476ae3;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var moment=require(_0x6c36('0x2'));var BPromise=require(_0x6c36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c36('0x4'));var db=require(_0x6c36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c36('0x6'))(_0x6c36('0x7'));var config=require(_0x6c36('0x8'));var jayson=require(_0x6c36('0x9'));var client=jayson[_0x6c36('0xa')][_0x6c36('0xb')]({'port':0x232a});config[_0x6c36('0xc')]=_['defaults'](config[_0x6c36('0xc')],{'host':_0x6c36('0xd'),'port':0x18eb});var socket=require(_0x6c36('0xe'))(new Redis(config[_0x6c36('0xc')]));require(_0x6c36('0xf'))[_0x6c36('0x10')](socket);function respondWithRpcPromise(_0x296bc2,_0x4082da,_0x18f568){return new BPromise(function(_0x40499f,_0x581851){return client['request'](_0x296bc2,_0x18f568)[_0x6c36('0x11')](function(_0x4cc4a0){logger[_0x6c36('0x12')](_0x6c36('0x13'),_0x4082da,'request\x20sent');logger[_0x6c36('0x14')](_0x6c36('0x15'),_0x4082da,'request\x20sent',JSON[_0x6c36('0x16')](_0x4cc4a0));if(_0x4cc4a0[_0x6c36('0x17')]){if(_0x4cc4a0[_0x6c36('0x17')][_0x6c36('0x18')]===0x1f4){logger[_0x6c36('0x17')](_0x6c36('0x13'),_0x4082da,_0x4cc4a0[_0x6c36('0x17')][_0x6c36('0x19')]);return _0x581851(_0x4cc4a0[_0x6c36('0x17')][_0x6c36('0x19')]);}logger[_0x6c36('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4082da,_0x4cc4a0[_0x6c36('0x17')][_0x6c36('0x19')]);return _0x40499f(_0x4cc4a0[_0x6c36('0x17')][_0x6c36('0x19')]);}else{logger[_0x6c36('0x12')](_0x6c36('0x13'),_0x4082da,'request\x20sent');_0x40499f(_0x4cc4a0['result']['message']);}})['catch'](function(_0x23e4b6){logger[_0x6c36('0x17')](_0x6c36('0x13'),_0x4082da,_0x23e4b6);_0x581851(_0x23e4b6);});});}exports[_0x6c36('0x1a')]=function(_0xe731b){var _0x5325b4=this;return new Promise(function(_0x4c8eb8,_0x529c07){return db['UserVoiceQueueRt'][_0x6c36('0x1b')]({'raw':_0xe731b[_0x6c36('0x1c')]?_0xe731b['options'][_0x6c36('0x1d')]===undefined?!![]:![]:!![],'where':_0xe731b[_0x6c36('0x1c')]?_0xe731b[_0x6c36('0x1c')][_0x6c36('0x1e')]||null:null,'attributes':[[db[_0x6c36('0x1f')]['fn'](_0x6c36('0x20'),db[_0x6c36('0x1f')]['fn']('IF',db[_0x6c36('0x1f')][_0x6c36('0x21')](_0x6c36('0x22')))),_0x6c36('0x23')]]})[_0x6c36('0x11')](function(_0x567ac5){logger[_0x6c36('0x12')]('GetVoiceQueueRtPauses',_0xe731b);logger[_0x6c36('0x14')](_0x6c36('0x1a'),_0xe731b,JSON[_0x6c36('0x16')](_0x567ac5));_0x4c8eb8(_0x567ac5);})['catch'](function(_0x205ac7){logger[_0x6c36('0x17')](_0x6c36('0x1a'),_0x205ac7[_0x6c36('0x19')],_0xe731b);_0x529c07(_0x5325b4[_0x6c36('0x17')](0x1f4,_0x205ac7[_0x6c36('0x19')]));});});}; \ No newline at end of file +var _0x3ecf=['jayson/promise','http','defaults','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UserVoiceQueueRt','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x59d7dd,_0x75a98d){var _0x53f598=function(_0x5044a4){while(--_0x5044a4){_0x59d7dd['push'](_0x59d7dd['shift']());}};_0x53f598(++_0x75a98d);}(_0x3ecf,0x1d4));var _0xf3ec=function(_0x3b8347,_0x142dc2){_0x3b8347=_0x3b8347-0x0;var _0x21777e=_0x3ecf[_0x3b8347];return _0x21777e;};'use strict';var _=require(_0xf3ec('0x0'));var util=require(_0xf3ec('0x1'));var moment=require(_0xf3ec('0x2'));var BPromise=require(_0xf3ec('0x3'));var rs=require(_0xf3ec('0x4'));var fs=require('fs');var Redis=require(_0xf3ec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3ec('0x6'));var logger=require(_0xf3ec('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf3ec('0x8'));var client=jayson['client'][_0xf3ec('0x9')]({'port':0x232a});config['redis']=_[_0xf3ec('0xa')](config[_0xf3ec('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf3ec('0xc'))(new Redis(config[_0xf3ec('0xb')]));require(_0xf3ec('0xd'))[_0xf3ec('0xe')](socket);function respondWithRpcPromise(_0x24a5bd,_0x386847,_0x19444f){return new BPromise(function(_0x48042b,_0x42db99){return client[_0xf3ec('0xf')](_0x24a5bd,_0x19444f)['then'](function(_0x903af9){logger[_0xf3ec('0x10')](_0xf3ec('0x11'),_0x386847,_0xf3ec('0x12'));logger['debug'](_0xf3ec('0x13'),_0x386847,_0xf3ec('0x12'),JSON[_0xf3ec('0x14')](_0x903af9));if(_0x903af9[_0xf3ec('0x15')]){if(_0x903af9[_0xf3ec('0x15')]['code']===0x1f4){logger[_0xf3ec('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x386847,_0x903af9['error'][_0xf3ec('0x16')]);return _0x42db99(_0x903af9[_0xf3ec('0x15')][_0xf3ec('0x16')]);}logger['error'](_0xf3ec('0x11'),_0x386847,_0x903af9[_0xf3ec('0x15')][_0xf3ec('0x16')]);return _0x48042b(_0x903af9[_0xf3ec('0x15')][_0xf3ec('0x16')]);}else{logger[_0xf3ec('0x10')](_0xf3ec('0x11'),_0x386847,_0xf3ec('0x12'));_0x48042b(_0x903af9[_0xf3ec('0x17')][_0xf3ec('0x16')]);}})['catch'](function(_0x3f0a3a){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x386847,_0x3f0a3a);_0x42db99(_0x3f0a3a);});});}exports['GetVoiceQueueRtPauses']=function(_0x26baac){var _0x51f91a=this;return new Promise(function(_0x1d6036,_0x55f25c){return db[_0xf3ec('0x18')][_0xf3ec('0x19')]({'raw':_0x26baac[_0xf3ec('0x1a')]?_0x26baac['options'][_0xf3ec('0x1b')]===undefined?!![]:![]:!![],'where':_0x26baac['options']?_0x26baac['options']['where']||null:null,'attributes':[[db[_0xf3ec('0x1c')]['fn']('COUNT',db[_0xf3ec('0x1c')]['fn']('IF',db[_0xf3ec('0x1c')][_0xf3ec('0x1d')](_0xf3ec('0x1e')))),_0xf3ec('0x1f')]]})[_0xf3ec('0x20')](function(_0x360523){logger[_0xf3ec('0x10')]('GetVoiceQueueRtPauses',_0x26baac);logger['debug'](_0xf3ec('0x21'),_0x26baac,JSON[_0xf3ec('0x14')](_0x360523));_0x1d6036(_0x360523);})['catch'](function(_0x4c0248){logger[_0xf3ec('0x15')](_0xf3ec('0x21'),_0x4c0248[_0xf3ec('0x16')],_0x26baac);_0x55f25c(_0x51f91a[_0xf3ec('0x15')](0x1f4,_0x4c0248['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c026d5a..bda53d6 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 _0x3981=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x3981,0x144));var _0x1398=function(_0xd25a09,_0x34ee98){_0xd25a09=_0xd25a09-0x0;var _0x563f30=_0x3981[_0xd25a09];return _0x563f30;};'use strict';var UserVoiceQueueRtEvents=require(_0x1398('0x0'));var events=['save',_0x1398('0x1'),_0x1398('0x2')];function createListener(_0x8739be,_0x1be1d9){return function(_0x1d39c3){_0x1be1d9[_0x1398('0x3')](_0x8739be,_0x1d39c3);};}function removeListener(_0x37fb2f,_0x2860af){return function(){UserVoiceQueueRtEvents[_0x1398('0x4')](_0x37fb2f,_0x2860af);};}exports[_0x1398('0x5')]=function(_0x199a50){for(var _0x5c5fe0=0x0,_0x216064=events[_0x1398('0x6')];_0x5c5fe0<_0x216064;_0x5c5fe0++){var _0x40e860=events[_0x5c5fe0];var _0x51dd7f=createListener(_0x1398('0x7')+_0x40e860,_0x199a50);UserVoiceQueueRtEvents['on'](_0x40e860,_0x51dd7f);}}; \ No newline at end of file +var _0x6bac=['./userVoiceQueueRt.events','remove','update','removeListener','length'];(function(_0x159af1,_0x5f23ce){var _0xc7aa7=function(_0x54d214){while(--_0x54d214){_0x159af1['push'](_0x159af1['shift']());}};_0xc7aa7(++_0x5f23ce);}(_0x6bac,0xa5));var _0xc6ba=function(_0x322024,_0x1340fb){_0x322024=_0x322024-0x0;var _0x4ffc7a=_0x6bac[_0x322024];return _0x4ffc7a;};'use strict';var UserVoiceQueueRtEvents=require(_0xc6ba('0x0'));var events=['save',_0xc6ba('0x1'),_0xc6ba('0x2')];function createListener(_0xf479c,_0x1869a3){return function(_0x489037){_0x1869a3['emit'](_0xf479c,_0x489037);};}function removeListener(_0x487ef1,_0x378f3d){return function(){UserVoiceQueueRtEvents[_0xc6ba('0x3')](_0x487ef1,_0x378f3d);};}exports['register']=function(_0x222f20){for(var _0x2a16af=0x0,_0x33167e=events[_0xc6ba('0x4')];_0x2a16af<_0x33167e;_0x2a16af++){var _0x12d6e9=events[_0x2a16af];var _0x1fa2a8=createListener('userVoiceQueueRt:'+_0x12d6e9,_0x222f20);UserVoiceQueueRtEvents['on'](_0x12d6e9,_0x1fa2a8);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3e5a449..517109a 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1b5e26,_0x453ef6){var _0x246191=function(_0x54a89e){while(--_0x54a89e){_0x1b5e26['push'](_0x1b5e26['shift']());}};_0x246191(++_0x453ef6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x182648,_0x2a7b01){var _0x10d106=function(_0x343645){while(--_0x343645){_0x182648['push'](_0x182648['shift']());}};_0x10d106(++_0x2a7b01);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 69bd88c..9006424 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 _0xe8bc=['exports','INTEGER','sequelize'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xe8bc,0x14c));var _0xce8b=function(_0x1d6e19,_0x1085f4){_0x1d6e19=_0x1d6e19-0x0;var _0x2413d6=_0xe8bc[_0x1d6e19];return _0x2413d6;};'use strict';var Sequelize=require(_0xce8b('0x0'));module[_0xce8b('0x1')]={'penalty':{'type':Sequelize[_0xce8b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'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 178c948..26ac1ad 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 _0x3a26=['exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','moment','request-promise','path','../../config/environment'];(function(_0x27be92,_0x4836ea){var _0x1a1262=function(_0x7629d7){while(--_0x7629d7){_0x27be92['push'](_0x27be92['shift']());}};_0x1a1262(++_0x4836ea);}(_0x3a26,0x1a2));var _0x63a2=function(_0x24e509,_0x25db6a){_0x24e509=_0x24e509-0x0;var _0x414e34=_0x3a26[_0x24e509];return _0x414e34;};'use strict';var _=require(_0x63a2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x63a2('0x1'));var BPromise=require('bluebird');var rp=require(_0x63a2('0x2'));var fs=require('fs');var path=require(_0x63a2('0x3'));var rimraf=require('rimraf');var config=require(_0x63a2('0x4'));var attributes=require('./userWhatsappQueue.attributes');module[_0x63a2('0x5')]=function(_0x441f36,_0x4fab03){return _0x441f36[_0x63a2('0x6')](_0x63a2('0x7'),attributes,{'tableName':_0x63a2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba62=['../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x28feec,_0x30514f){var _0x495efc=function(_0x4d6068){while(--_0x4d6068){_0x28feec['push'](_0x28feec['shift']());}};_0x495efc(++_0x30514f);}(_0xba62,0x126));var _0x2ba6=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0xba62[_0x5f584a];return _0x3788d9;};'use strict';var _=require(_0x2ba6('0x0'));var util=require('util');var logger=require(_0x2ba6('0x1'))(_0x2ba6('0x2'));var moment=require('moment');var BPromise=require(_0x2ba6('0x3'));var rp=require(_0x2ba6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ba6('0x5'));var config=require(_0x2ba6('0x6'));var attributes=require(_0x2ba6('0x7'));module['exports']=function(_0x205c82,_0x268033){return _0x205c82['define'](_0x2ba6('0x8'),attributes,{'tableName':_0x2ba6('0x9'),'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 5b5ba97..bf02582 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 _0xadbb=['message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5332b1,_0x192941){var _0x129b49=function(_0x469fd0){while(--_0x469fd0){_0x5332b1['push'](_0x5332b1['shift']());}};_0x129b49(++_0x192941);}(_0xadbb,0x189));var _0xbadb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xadbb[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xbadb('0x0'));var util=require('util');var moment=require(_0xbadb('0x1'));var BPromise=require('bluebird');var rs=require(_0xbadb('0x2'));var fs=require('fs');var Redis=require(_0xbadb('0x3'));var db=require(_0xbadb('0x4'))['db'];var utils=require(_0xbadb('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbadb('0x6')][_0xbadb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5329b4,_0x1233d8,_0xd054e7){return new BPromise(function(_0x25f07b,_0xaa7376){return client[_0xbadb('0x8')](_0x5329b4,_0xd054e7)['then'](function(_0xf6c8e3){logger[_0xbadb('0x9')](_0xbadb('0xa'),_0x1233d8,_0xbadb('0xb'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1233d8,_0xbadb('0xb'),JSON[_0xbadb('0xc')](_0xf6c8e3));if(_0xf6c8e3[_0xbadb('0xd')]){if(_0xf6c8e3[_0xbadb('0xd')][_0xbadb('0xe')]===0x1f4){logger[_0xbadb('0xd')](_0xbadb('0xa'),_0x1233d8,_0xf6c8e3[_0xbadb('0xd')][_0xbadb('0xf')]);return _0xaa7376(_0xf6c8e3[_0xbadb('0xd')]['message']);}logger['error'](_0xbadb('0xa'),_0x1233d8,_0xf6c8e3[_0xbadb('0xd')][_0xbadb('0xf')]);return _0x25f07b(_0xf6c8e3[_0xbadb('0xd')][_0xbadb('0xf')]);}else{logger['info'](_0xbadb('0xa'),_0x1233d8,'request\x20sent');_0x25f07b(_0xf6c8e3['result'][_0xbadb('0xf')]);}})[_0xbadb('0x10')](function(_0x30bfe4){logger[_0xbadb('0xd')](_0xbadb('0xa'),_0x1233d8,_0x30bfe4);_0xaa7376(_0x30bfe4);});});} \ No newline at end of file +var _0x4413=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x4413,0x1da));var _0x3441=function(_0x568715,_0x3bdfcb){_0x568715=_0x568715-0x0;var _0xa6cfc8=_0x4413[_0x568715];return _0xa6cfc8;};'use strict';var _=require(_0x3441('0x0'));var util=require('util');var moment=require(_0x3441('0x1'));var BPromise=require(_0x3441('0x2'));var rs=require(_0x3441('0x3'));var fs=require('fs');var Redis=require(_0x3441('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3441('0x5'));var logger=require('../../config/logger')(_0x3441('0x6'));var config=require('../../config/environment');var jayson=require(_0x3441('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd85f9,_0x433a97,_0x19584f){return new BPromise(function(_0x16bc4b,_0x46b010){return client[_0x3441('0x8')](_0xd85f9,_0x19584f)[_0x3441('0x9')](function(_0x3b10a9){logger[_0x3441('0xa')](_0x3441('0xb'),_0x433a97,_0x3441('0xc'));logger['debug'](_0x3441('0xd'),_0x433a97,_0x3441('0xc'),JSON['stringify'](_0x3b10a9));if(_0x3b10a9[_0x3441('0xe')]){if(_0x3b10a9[_0x3441('0xe')][_0x3441('0xf')]===0x1f4){logger[_0x3441('0xe')](_0x3441('0xb'),_0x433a97,_0x3b10a9[_0x3441('0xe')][_0x3441('0x10')]);return _0x46b010(_0x3b10a9[_0x3441('0xe')][_0x3441('0x10')]);}logger[_0x3441('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x433a97,_0x3b10a9[_0x3441('0xe')][_0x3441('0x10')]);return _0x16bc4b(_0x3b10a9[_0x3441('0xe')][_0x3441('0x10')]);}else{logger[_0x3441('0xa')](_0x3441('0xb'),_0x433a97,_0x3441('0xc'));_0x16bc4b(_0x3b10a9[_0x3441('0x11')][_0x3441('0x10')]);}})[_0x3441('0x12')](function(_0x5ca7d8){logger[_0x3441('0xe')](_0x3441('0xb'),_0x433a97,_0x5ca7d8);_0x46b010(_0x5ca7d8);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index b9b5e90..d1bb3ec 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 _0x093a=['destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x23e3b0,_0x5f2901){var _0x13c675=function(_0x4be356){while(--_0x4be356){_0x23e3b0['push'](_0x23e3b0['shift']());}};_0x13c675(++_0x5f2901);}(_0x093a,0x16a));var _0xa093=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0x093a[_0x3f2d02];return _0x54092b;};'use strict';var multer=require('multer');var util=require(_0xa093('0x0'));var path=require(_0xa093('0x1'));var timeout=require(_0xa093('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa093('0x3'));var auth=require(_0xa093('0x4'));var interaction=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var controller=require(_0xa093('0x7'));router[_0xa093('0x8')]('/',auth[_0xa093('0x9')](),controller[_0xa093('0xa')]);router[_0xa093('0x8')](_0xa093('0xb'),auth[_0xa093('0x9')](),controller[_0xa093('0xc')]);router[_0xa093('0xd')]('/',auth[_0xa093('0x9')](),controller[_0xa093('0xe')]);router[_0xa093('0xf')](_0xa093('0xb'),auth[_0xa093('0x9')](),controller[_0xa093('0x10')]);router[_0xa093('0x11')](_0xa093('0xb'),auth['isAuthenticated'](),controller[_0xa093('0x12')]);module[_0xa093('0x13')]=router; \ No newline at end of file +var _0x2bbb=['/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index'];(function(_0x59ce4d,_0x29bddc){var _0x42e64c=function(_0x7717c0){while(--_0x7717c0){_0x59ce4d['push'](_0x59ce4d['shift']());}};_0x42e64c(++_0x29bddc);}(_0x2bbb,0x85));var _0xb2bb=function(_0x2a1cab,_0x50e162){_0x2a1cab=_0x2a1cab-0x0;var _0x13000f=_0x2bbb[_0x2a1cab];return _0x13000f;};'use strict';var multer=require('multer');var util=require(_0xb2bb('0x0'));var path=require(_0xb2bb('0x1'));var timeout=require(_0xb2bb('0x2'));var express=require('express');var router=express[_0xb2bb('0x3')]();var fs_extra=require(_0xb2bb('0x4'));var auth=require(_0xb2bb('0x5'));var interaction=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var controller=require(_0xb2bb('0x8'));router['get']('/',auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xa')]);router['get'](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xc')]);router[_0xb2bb('0xd')]('/',auth['isAuthenticated'](),controller[_0xb2bb('0xe')]);router['put'](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xf')]);router[_0xb2bb('0x10')](_0xb2bb('0xb'),auth['isAuthenticated'](),controller[_0xb2bb('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b545637..d21af6a 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 _0x96bb=['STRING','name','exports'];(function(_0x217856,_0x630a9b){var _0x2e1442=function(_0x1e28b2){while(--_0x1e28b2){_0x217856['push'](_0x217856['shift']());}};_0x2e1442(++_0x630a9b);}(_0x96bb,0x1be));var _0xb96b=function(_0x11f418,_0x16283a){_0x11f418=_0x11f418-0x0;var _0x5d7f70=_0x96bb[_0x11f418];return _0x5d7f70;};'use strict';var Sequelize=require('sequelize');module[_0xb96b('0x0')]={'name':{'type':Sequelize[_0xb96b('0x1')],'unique':_0xb96b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb96b('0x1')]}}; \ No newline at end of file +var _0x20fd=['exports','STRING','sequelize'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x20fd,0x125));var _0xd20f=function(_0x384b81,_0x514dfb){_0x384b81=_0x384b81-0x0;var _0x4b1e43=_0x20fd[_0x384b81];return _0x4b1e43;};'use strict';var Sequelize=require(_0xd20f('0x0'));module[_0xd20f('0x1')]={'name':{'type':Sequelize[_0xd20f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd20f('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c358880..b19df7e 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 _0x1f93=['count','limit','Content-Range','apply','save','destroy','then','get','Variables','error','name','send','index','map','Variable','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x1f93,0x124));var _0x31f9=function(_0x47d64e,_0x544d7e){_0x47d64e=_0x47d64e-0x0;var _0x1cf2cb=_0x1f93[_0x47d64e];return _0x1cf2cb;};'use strict';var emlformat=require(_0x31f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31f9('0x1'));var jsonpatch=require(_0x31f9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x31f9('0x3'));var util=require(_0x31f9('0x4'));var path=require(_0x31f9('0x5'));var sox=require(_0x31f9('0x6'));var csv=require(_0x31f9('0x7'));var ejs=require(_0x31f9('0x8'));var fs=require('fs');var fs_extra=require(_0x31f9('0x9'));var _=require('lodash');var squel=require(_0x31f9('0xa'));var crypto=require(_0x31f9('0xb'));var jsforce=require(_0x31f9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x31f9('0x7'));var querystring=require(_0x31f9('0xd'));var Papa=require(_0x31f9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x31f9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31f9('0x10'));var logger=require(_0x31f9('0x11'))(_0x31f9('0x12'));var utils=require(_0x31f9('0x13'));var config=require(_0x31f9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x31f9('0x15'))['db'];function respondWithStatusCode(_0x4c331d,_0x2072cd){_0x2072cd=_0x2072cd||0xcc;return function(_0xe78a5){if(_0xe78a5){return _0x4c331d[_0x31f9('0x16')](_0x2072cd);}return _0x4c331d['status'](_0x2072cd)[_0x31f9('0x17')]();};}function respondWithResult(_0x53407e,_0x31a5a6){_0x31a5a6=_0x31a5a6||0xc8;return function(_0x24508e){if(_0x24508e){return _0x53407e[_0x31f9('0x18')](_0x31a5a6)[_0x31f9('0x19')](_0x24508e);}};}function respondWithFilteredResult(_0x3f40eb,_0x306085){return function(_0x18c676){if(_0x18c676){var _0x457c49=typeof _0x306085[_0x31f9('0x1a')]===_0x31f9('0x1b')&&typeof _0x306085['limit']==='undefined';var _0x52f7d4=_0x18c676[_0x31f9('0x1c')];var _0x59bfb8=_0x457c49?0x0:_0x306085[_0x31f9('0x1a')];var _0x36bc51=_0x457c49?_0x18c676[_0x31f9('0x1c')]:_0x306085[_0x31f9('0x1a')]+_0x306085[_0x31f9('0x1d')];var _0x20aea3;if(_0x36bc51>=_0x52f7d4){_0x36bc51=_0x52f7d4;_0x20aea3=0xc8;}else{_0x20aea3=0xce;}_0x3f40eb[_0x31f9('0x18')](_0x20aea3);return _0x3f40eb['set'](_0x31f9('0x1e'),_0x59bfb8+'-'+_0x36bc51+'/'+_0x52f7d4)['json'](_0x18c676);}return null;};}function patchUpdates(_0x51e4b7){return function(_0x2571a2){try{jsonpatch[_0x31f9('0x1f')](_0x2571a2,_0x51e4b7,!![]);}catch(_0x4c16dd){return BPromise['reject'](_0x4c16dd);}return _0x2571a2[_0x31f9('0x20')]();};}function saveUpdates(_0x540042,_0x33eeef){return function(_0x50d819){if(_0x50d819){return _0x50d819['update'](_0x540042)['then'](function(_0x4ec10b){return _0x4ec10b;});}return null;};}function removeEntity(_0x4edc55,_0x3c4253){return function(_0x240d23){if(_0x240d23){return _0x240d23[_0x31f9('0x21')]()[_0x31f9('0x22')](function(){var _0xd57c22=_0x240d23[_0x31f9('0x23')]({'plain':!![]});var _0x193412=_0x31f9('0x24');return db['UserProfileResource'][_0x31f9('0x21')]({'where':{'type':_0x193412,'resourceId':_0xd57c22['id']}})[_0x31f9('0x22')](function(){return _0x240d23;});})['then'](function(){_0x4edc55[_0x31f9('0x18')](0xcc)[_0x31f9('0x17')]();});}};}function handleEntityNotFound(_0x579c38,_0x378e4f){return function(_0x348033){if(!_0x348033){_0x579c38[_0x31f9('0x16')](0x194);}return _0x348033;};}function handleError(_0x3e8508,_0x290b70){_0x290b70=_0x290b70||0x1f4;return function(_0x33e3d2){logger[_0x31f9('0x25')](_0x33e3d2['stack']);if(_0x33e3d2[_0x31f9('0x26')]){delete _0x33e3d2['name'];}_0x3e8508[_0x31f9('0x18')](_0x290b70)[_0x31f9('0x27')](_0x33e3d2);};}exports[_0x31f9('0x28')]=function(_0x26bbfc,_0x1ad1b1){var _0x107a76={},_0x5ef29e={},_0x1c6dd3={'count':0x0,'rows':[]};var _0x5baba4=_[_0x31f9('0x29')](db[_0x31f9('0x2a')][_0x31f9('0x2b')],function(_0x1febc0){return{'name':_0x1febc0['fieldName'],'type':_0x1febc0[_0x31f9('0x2c')][_0x31f9('0x2d')]};});_0x5ef29e[_0x31f9('0x2e')]=_[_0x31f9('0x29')](_0x5baba4,'name');_0x5ef29e['query']=_[_0x31f9('0x2f')](_0x26bbfc['query']);_0x5ef29e[_0x31f9('0x30')]=_[_0x31f9('0x31')](_0x5ef29e[_0x31f9('0x2e')],_0x5ef29e['query']);_0x107a76[_0x31f9('0x32')]=_[_0x31f9('0x31')](_0x5ef29e['model'],qs[_0x31f9('0x33')](_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x33')]));_0x107a76[_0x31f9('0x32')]=_0x107a76['attributes'][_0x31f9('0x35')]?_0x107a76[_0x31f9('0x32')]:_0x5ef29e[_0x31f9('0x2e')];if(!_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x36')](_0x31f9('0x37'))){_0x107a76[_0x31f9('0x1d')]=qs[_0x31f9('0x1d')](_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x1d')]);_0x107a76[_0x31f9('0x1a')]=qs['offset'](_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x1a')]);}_0x107a76['order']=qs['sort'](_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x38')]);_0x107a76[_0x31f9('0x39')]=qs['filters'](_[_0x31f9('0x3a')](_0x26bbfc[_0x31f9('0x34')],_0x5ef29e[_0x31f9('0x30')]),_0x5baba4);if(_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x3b')]){_0x107a76['where']=_[_0x31f9('0x3c')](_0x107a76[_0x31f9('0x39')],{'$or':_['map'](_0x5baba4,function(_0x48a3dd){if(_0x48a3dd[_0x31f9('0x2c')]!==_0x31f9('0x3d')){var _0x16de8e={};_0x16de8e[_0x48a3dd[_0x31f9('0x26')]]={'$like':'%'+_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x3b')]+'%'};return _0x16de8e;}})});}_0x107a76=_[_0x31f9('0x3c')]({},_0x107a76,_0x26bbfc[_0x31f9('0x3e')]);var _0x568fc1={'where':_0x107a76[_0x31f9('0x39')]};return db[_0x31f9('0x2a')][_0x31f9('0x1c')](_0x568fc1)[_0x31f9('0x22')](function(_0x4151d1){_0x1c6dd3[_0x31f9('0x1c')]=_0x4151d1;if(_0x26bbfc[_0x31f9('0x34')][_0x31f9('0x3f')]){_0x107a76['include']=[{'all':!![]}];}return db['Variable'][_0x31f9('0x40')](_0x107a76);})[_0x31f9('0x22')](function(_0x2edbc8){_0x1c6dd3[_0x31f9('0x41')]=_0x2edbc8;return _0x1c6dd3;})[_0x31f9('0x22')](respondWithFilteredResult(_0x1ad1b1,_0x107a76))[_0x31f9('0x42')](handleError(_0x1ad1b1,null));};exports[_0x31f9('0x43')]=function(_0xdbb2a8,_0x2741fe){var _0x3834e5={'raw':!![],'where':{'id':_0xdbb2a8[_0x31f9('0x44')]['id']}},_0x2bab9d={};_0x2bab9d[_0x31f9('0x2e')]=_[_0x31f9('0x2f')](db['Variable']['rawAttributes']);_0x2bab9d[_0x31f9('0x34')]=_[_0x31f9('0x2f')](_0xdbb2a8[_0x31f9('0x34')]);_0x2bab9d[_0x31f9('0x30')]=_[_0x31f9('0x31')](_0x2bab9d['model'],_0x2bab9d[_0x31f9('0x34')]);_0x3834e5[_0x31f9('0x32')]=_['intersection'](_0x2bab9d[_0x31f9('0x2e')],qs[_0x31f9('0x33')](_0xdbb2a8[_0x31f9('0x34')]['fields']));_0x3834e5[_0x31f9('0x32')]=_0x3834e5[_0x31f9('0x32')]['length']?_0x3834e5['attributes']:_0x2bab9d['model'];if(_0xdbb2a8[_0x31f9('0x34')][_0x31f9('0x3f')]){_0x3834e5[_0x31f9('0x45')]=[{'all':!![]}];}_0x3834e5=_[_0x31f9('0x3c')]({},_0x3834e5,_0xdbb2a8['options']);return db[_0x31f9('0x2a')][_0x31f9('0x46')](_0x3834e5)[_0x31f9('0x22')](handleEntityNotFound(_0x2741fe,null))['then'](respondWithResult(_0x2741fe,null))[_0x31f9('0x42')](handleError(_0x2741fe,null));};exports[_0x31f9('0x47')]=function(_0x3d80fc,_0x20d7e9){return db['Variable'][_0x31f9('0x47')](_0x3d80fc[_0x31f9('0x48')],{})[_0x31f9('0x22')](function(_0x4969bf){var _0x2b1762=_0x3d80fc[_0x31f9('0x49')][_0x31f9('0x23')]({'plain':!![]});if(!_0x2b1762)throw new Error(_0x31f9('0x4a'));if(_0x2b1762['role']===_0x31f9('0x49')){var _0x2d36e0=_0x4969bf['get']({'plain':!![]});var _0x3ff651=_0x31f9('0x24');return db[_0x31f9('0x4b')][_0x31f9('0x46')]({'where':{'name':_0x3ff651,'userProfileId':_0x2b1762[_0x31f9('0x4c')]},'raw':!![]})[_0x31f9('0x22')](function(_0x3fc9a3){if(_0x3fc9a3&&_0x3fc9a3['autoAssociation']===0x0){return db[_0x31f9('0x4d')][_0x31f9('0x47')]({'name':_0x2d36e0[_0x31f9('0x26')],'resourceId':_0x2d36e0['id'],'type':_0x3fc9a3[_0x31f9('0x26')],'sectionId':_0x3fc9a3['id']},{})[_0x31f9('0x22')](function(){return _0x4969bf;});}else{return _0x4969bf;}})['catch'](function(_0x10b2d0){logger[_0x31f9('0x25')](_0x31f9('0x4e'),_0x10b2d0);throw _0x10b2d0;});}return _0x4969bf;})[_0x31f9('0x22')](respondWithResult(_0x20d7e9,0xc9))['catch'](handleError(_0x20d7e9,null));};exports[_0x31f9('0x4f')]=function(_0x23679f,_0x4ebd59){if(_0x23679f[_0x31f9('0x48')]['id']){delete _0x23679f[_0x31f9('0x48')]['id'];}return db[_0x31f9('0x2a')][_0x31f9('0x46')]({'where':{'id':_0x23679f[_0x31f9('0x44')]['id']}})[_0x31f9('0x22')](handleEntityNotFound(_0x4ebd59,null))[_0x31f9('0x22')](saveUpdates(_0x23679f['body'],null))[_0x31f9('0x22')](respondWithResult(_0x4ebd59,null))[_0x31f9('0x42')](handleError(_0x4ebd59,null));};exports[_0x31f9('0x21')]=function(_0x88d350,_0x238707){return db['Variable'][_0x31f9('0x46')]({'where':{'id':_0x88d350['params']['id']}})[_0x31f9('0x22')](handleEntityNotFound(_0x238707,null))[_0x31f9('0x22')](removeEntity(_0x238707,null))[_0x31f9('0x42')](handleError(_0x238707,null));}; \ No newline at end of file +var _0x9975=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','json','apply','reject','update','then','get','Variables','UserProfileResource','destroy','name','send','index','Variable','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x244745,_0xf9d957){var _0xf67728=function(_0x176722){while(--_0x176722){_0x244745['push'](_0x244745['shift']());}};_0xf67728(++_0xf9d957);}(_0x9975,0x89));var _0x5997=function(_0x1ebead,_0x362755){_0x1ebead=_0x1ebead-0x0;var _0x2445cc=_0x9975[_0x1ebead];return _0x2445cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5997('0x0'));var zipdir=require(_0x5997('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5997('0x2'));var BPromise=require(_0x5997('0x3'));var Mustache=require(_0x5997('0x4'));var util=require(_0x5997('0x5'));var path=require(_0x5997('0x6'));var sox=require(_0x5997('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5997('0x8'));var _=require(_0x5997('0x9'));var squel=require(_0x5997('0xa'));var crypto=require(_0x5997('0xb'));var jsforce=require(_0x5997('0xc'));var deskjs=require(_0x5997('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5997('0xe'));var Papa=require(_0x5997('0xf'));var Redis=require(_0x5997('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5997('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5997('0x12'));var logger=require('../../config/logger')(_0x5997('0x13'));var utils=require('../../config/utils');var config=require(_0x5997('0x14'));var licenseUtil=require(_0x5997('0x15'));var db=require(_0x5997('0x16'))['db'];function respondWithStatusCode(_0xda5f30,_0x213f70){_0x213f70=_0x213f70||0xcc;return function(_0x3b7fdc){if(_0x3b7fdc){return _0xda5f30[_0x5997('0x17')](_0x213f70);}return _0xda5f30['status'](_0x213f70)[_0x5997('0x18')]();};}function respondWithResult(_0x78ff5f,_0x6a58e0){_0x6a58e0=_0x6a58e0||0xc8;return function(_0x1f0714){if(_0x1f0714){return _0x78ff5f['status'](_0x6a58e0)['json'](_0x1f0714);}};}function respondWithFilteredResult(_0x5672fe,_0x318a81){return function(_0x35a1bd){if(_0x35a1bd){var _0x44fb50=typeof _0x318a81[_0x5997('0x19')]===_0x5997('0x1a')&&typeof _0x318a81[_0x5997('0x1b')]===_0x5997('0x1a');var _0x4a905c=_0x35a1bd[_0x5997('0x1c')];var _0x5312f4=_0x44fb50?0x0:_0x318a81[_0x5997('0x19')];var _0x5b1f9d=_0x44fb50?_0x35a1bd['count']:_0x318a81[_0x5997('0x19')]+_0x318a81[_0x5997('0x1b')];var _0x44fc2a;if(_0x5b1f9d>=_0x4a905c){_0x5b1f9d=_0x4a905c;_0x44fc2a=0xc8;}else{_0x44fc2a=0xce;}_0x5672fe[_0x5997('0x1d')](_0x44fc2a);return _0x5672fe[_0x5997('0x1e')]('Content-Range',_0x5312f4+'-'+_0x5b1f9d+'/'+_0x4a905c)[_0x5997('0x1f')](_0x35a1bd);}return null;};}function patchUpdates(_0x394f70){return function(_0x107923){try{jsonpatch[_0x5997('0x20')](_0x107923,_0x394f70,!![]);}catch(_0x11d1b1){return BPromise[_0x5997('0x21')](_0x11d1b1);}return _0x107923['save']();};}function saveUpdates(_0x11bad8,_0x1dd3fc){return function(_0xe9ca9d){if(_0xe9ca9d){return _0xe9ca9d[_0x5997('0x22')](_0x11bad8)[_0x5997('0x23')](function(_0x1ce13f){return _0x1ce13f;});}return null;};}function removeEntity(_0x124e8f,_0x4167da){return function(_0x46dd7d){if(_0x46dd7d){return _0x46dd7d['destroy']()[_0x5997('0x23')](function(){var _0x4d6b61=_0x46dd7d[_0x5997('0x24')]({'plain':!![]});var _0x26b276=_0x5997('0x25');return db[_0x5997('0x26')][_0x5997('0x27')]({'where':{'type':_0x26b276,'resourceId':_0x4d6b61['id']}})[_0x5997('0x23')](function(){return _0x46dd7d;});})[_0x5997('0x23')](function(){_0x124e8f[_0x5997('0x1d')](0xcc)[_0x5997('0x18')]();});}};}function handleEntityNotFound(_0xc632b7,_0x5578b0){return function(_0x248fcc){if(!_0x248fcc){_0xc632b7['sendStatus'](0x194);}return _0x248fcc;};}function handleError(_0x5b4e53,_0x4b82b2){_0x4b82b2=_0x4b82b2||0x1f4;return function(_0x3e5d01){logger['error'](_0x3e5d01['stack']);if(_0x3e5d01[_0x5997('0x28')]){delete _0x3e5d01[_0x5997('0x28')];}_0x5b4e53[_0x5997('0x1d')](_0x4b82b2)[_0x5997('0x29')](_0x3e5d01);};}exports[_0x5997('0x2a')]=function(_0x3bd253,_0x4f92a8){var _0x398ab9={},_0x19d4bf={},_0x45958d={'count':0x0,'rows':[]};var _0x46aef9=_['map'](db[_0x5997('0x2b')]['rawAttributes'],function(_0xd4b59){return{'name':_0xd4b59[_0x5997('0x2c')],'type':_0xd4b59['type'][_0x5997('0x2d')]};});_0x19d4bf['model']=_[_0x5997('0x2e')](_0x46aef9,_0x5997('0x28'));_0x19d4bf[_0x5997('0x2f')]=_[_0x5997('0x30')](_0x3bd253[_0x5997('0x2f')]);_0x19d4bf[_0x5997('0x31')]=_[_0x5997('0x32')](_0x19d4bf[_0x5997('0x33')],_0x19d4bf[_0x5997('0x2f')]);_0x398ab9[_0x5997('0x34')]=_[_0x5997('0x32')](_0x19d4bf[_0x5997('0x33')],qs['fields'](_0x3bd253[_0x5997('0x2f')][_0x5997('0x35')]));_0x398ab9[_0x5997('0x34')]=_0x398ab9[_0x5997('0x34')][_0x5997('0x36')]?_0x398ab9[_0x5997('0x34')]:_0x19d4bf['model'];if(!_0x3bd253['query'][_0x5997('0x37')]('nolimit')){_0x398ab9['limit']=qs['limit'](_0x3bd253[_0x5997('0x2f')][_0x5997('0x1b')]);_0x398ab9['offset']=qs[_0x5997('0x19')](_0x3bd253[_0x5997('0x2f')][_0x5997('0x19')]);}_0x398ab9[_0x5997('0x38')]=qs['sort'](_0x3bd253['query'][_0x5997('0x39')]);_0x398ab9[_0x5997('0x3a')]=qs['filters'](_['pick'](_0x3bd253[_0x5997('0x2f')],_0x19d4bf[_0x5997('0x31')]),_0x46aef9);if(_0x3bd253['query'][_0x5997('0x3b')]){_0x398ab9[_0x5997('0x3a')]=_[_0x5997('0x3c')](_0x398ab9[_0x5997('0x3a')],{'$or':_[_0x5997('0x2e')](_0x46aef9,function(_0x547aa5){if(_0x547aa5['type']!=='VIRTUAL'){var _0x4fb1b5={};_0x4fb1b5[_0x547aa5[_0x5997('0x28')]]={'$like':'%'+_0x3bd253[_0x5997('0x2f')][_0x5997('0x3b')]+'%'};return _0x4fb1b5;}})});}_0x398ab9=_[_0x5997('0x3c')]({},_0x398ab9,_0x3bd253['options']);var _0x257b05={'where':_0x398ab9['where']};return db[_0x5997('0x2b')][_0x5997('0x1c')](_0x257b05)['then'](function(_0x4e0210){_0x45958d[_0x5997('0x1c')]=_0x4e0210;if(_0x3bd253[_0x5997('0x2f')][_0x5997('0x3d')]){_0x398ab9[_0x5997('0x3e')]=[{'all':!![]}];}return db[_0x5997('0x2b')][_0x5997('0x3f')](_0x398ab9);})['then'](function(_0x50fac6){_0x45958d[_0x5997('0x40')]=_0x50fac6;return _0x45958d;})[_0x5997('0x23')](respondWithFilteredResult(_0x4f92a8,_0x398ab9))['catch'](handleError(_0x4f92a8,null));};exports[_0x5997('0x41')]=function(_0x355b64,_0x5a6786){var _0x2b3790={'raw':!![],'where':{'id':_0x355b64[_0x5997('0x42')]['id']}},_0x4fdb25={};_0x4fdb25[_0x5997('0x33')]=_[_0x5997('0x30')](db[_0x5997('0x2b')][_0x5997('0x43')]);_0x4fdb25[_0x5997('0x2f')]=_[_0x5997('0x30')](_0x355b64['query']);_0x4fdb25[_0x5997('0x31')]=_[_0x5997('0x32')](_0x4fdb25[_0x5997('0x33')],_0x4fdb25['query']);_0x2b3790[_0x5997('0x34')]=_[_0x5997('0x32')](_0x4fdb25[_0x5997('0x33')],qs[_0x5997('0x35')](_0x355b64[_0x5997('0x2f')][_0x5997('0x35')]));_0x2b3790[_0x5997('0x34')]=_0x2b3790[_0x5997('0x34')][_0x5997('0x36')]?_0x2b3790[_0x5997('0x34')]:_0x4fdb25[_0x5997('0x33')];if(_0x355b64[_0x5997('0x2f')][_0x5997('0x3d')]){_0x2b3790[_0x5997('0x3e')]=[{'all':!![]}];}_0x2b3790=_[_0x5997('0x3c')]({},_0x2b3790,_0x355b64['options']);return db[_0x5997('0x2b')][_0x5997('0x44')](_0x2b3790)['then'](handleEntityNotFound(_0x5a6786,null))[_0x5997('0x23')](respondWithResult(_0x5a6786,null))[_0x5997('0x45')](handleError(_0x5a6786,null));};exports[_0x5997('0x46')]=function(_0x116d14,_0x17c7cf){return db[_0x5997('0x2b')][_0x5997('0x46')](_0x116d14['body'],{})[_0x5997('0x23')](function(_0x297151){var _0xeeee12=_0x116d14[_0x5997('0x47')][_0x5997('0x24')]({'plain':!![]});if(!_0xeeee12)throw new Error(_0x5997('0x48'));if(_0xeeee12[_0x5997('0x49')]===_0x5997('0x47')){var _0x5b5b91=_0x297151[_0x5997('0x24')]({'plain':!![]});var _0x452add='Variables';return db[_0x5997('0x4a')]['find']({'where':{'name':_0x452add,'userProfileId':_0xeeee12[_0x5997('0x4b')]},'raw':!![]})[_0x5997('0x23')](function(_0x2cd9f0){if(_0x2cd9f0&&_0x2cd9f0[_0x5997('0x4c')]===0x0){return db['UserProfileResource'][_0x5997('0x46')]({'name':_0x5b5b91[_0x5997('0x28')],'resourceId':_0x5b5b91['id'],'type':_0x2cd9f0[_0x5997('0x28')],'sectionId':_0x2cd9f0['id']},{})[_0x5997('0x23')](function(){return _0x297151;});}else{return _0x297151;}})[_0x5997('0x45')](function(_0xf3fb77){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf3fb77);throw _0xf3fb77;});}return _0x297151;})[_0x5997('0x23')](respondWithResult(_0x17c7cf,0xc9))['catch'](handleError(_0x17c7cf,null));};exports[_0x5997('0x22')]=function(_0x348787,_0x53da4a){if(_0x348787[_0x5997('0x4d')]['id']){delete _0x348787[_0x5997('0x4d')]['id'];}return db['Variable'][_0x5997('0x44')]({'where':{'id':_0x348787[_0x5997('0x42')]['id']}})['then'](handleEntityNotFound(_0x53da4a,null))[_0x5997('0x23')](saveUpdates(_0x348787[_0x5997('0x4d')],null))[_0x5997('0x23')](respondWithResult(_0x53da4a,null))[_0x5997('0x45')](handleError(_0x53da4a,null));};exports[_0x5997('0x27')]=function(_0x1dc544,_0x3eb365){return db[_0x5997('0x2b')][_0x5997('0x44')]({'where':{'id':_0x1dc544[_0x5997('0x42')]['id']}})[_0x5997('0x23')](handleEntityNotFound(_0x3eb365,null))[_0x5997('0x23')](removeEntity(_0x3eb365,null))['catch'](handleError(_0x3eb365,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 0b7a19b..5860265 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 _0xb92e=['define','Variable','tools_variables','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0xb92e,0x65));var _0xeb92=function(_0x3260eb,_0x284ae0){_0x3260eb=_0x3260eb-0x0;var _0x4c28d9=_0xb92e[_0x3260eb];return _0x4c28d9;};'use strict';var _=require(_0xeb92('0x0'));var util=require(_0xeb92('0x1'));var logger=require('../../config/logger')(_0xeb92('0x2'));var moment=require(_0xeb92('0x3'));var BPromise=require(_0xeb92('0x4'));var rp=require(_0xeb92('0x5'));var fs=require('fs');var path=require(_0xeb92('0x6'));var rimraf=require(_0xeb92('0x7'));var config=require(_0xeb92('0x8'));var attributes=require(_0xeb92('0x9'));module[_0xeb92('0xa')]=function(_0x3c3c67,_0xffe961){return _0x3c3c67[_0xeb92('0xb')](_0xeb92('0xc'),attributes,{'tableName':_0xeb92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8eb3=['exports','define','Variable','tools_variables','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes'];(function(_0x156d4e,_0x1d222f){var _0x57edcc=function(_0x225adc){while(--_0x225adc){_0x156d4e['push'](_0x156d4e['shift']());}};_0x57edcc(++_0x1d222f);}(_0x8eb3,0x1d8));var _0x38eb=function(_0x3770dd,_0x28ec84){_0x3770dd=_0x3770dd-0x0;var _0x36c521=_0x8eb3[_0x3770dd];return _0x36c521;};'use strict';var _=require('lodash');var util=require(_0x38eb('0x0'));var logger=require(_0x38eb('0x1'))(_0x38eb('0x2'));var moment=require(_0x38eb('0x3'));var BPromise=require(_0x38eb('0x4'));var rp=require(_0x38eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38eb('0x6'));var config=require(_0x38eb('0x7'));var attributes=require(_0x38eb('0x8'));module[_0x38eb('0x9')]=function(_0x17d275,_0x4e9f49){return _0x17d275[_0x38eb('0xa')](_0x38eb('0xb'),attributes,{'tableName':_0x38eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index a1692f3..6c0459d 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(_0x1266f9,_0xbba76f){var _0x282acb=function(_0x3237f9){while(--_0x3237f9){_0x1266f9['push'](_0x1266f9['shift']());}};_0x282acb(++_0xbba76f);}(_0x55ca,0x126));var _0xa55c=function(_0x4a8fea,_0x4603f4){_0x4a8fea=_0x4a8fea-0x0;var _0x5e23a4=_0x55ca[_0x4a8fea];return _0x5e23a4;};'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 _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(_0x489d7c,_0x22cd8d){var _0x1af217=function(_0x52144e){while(--_0x52144e){_0x489d7c['push'](_0x489d7c['shift']());}};_0x1af217(++_0x22cd8d);}(_0x55ca,0x126));var _0xa55c=function(_0xb65ffb,_0x2cc0af){_0xb65ffb=_0xb65ffb-0x0;var _0x58f55c=_0x55ca[_0xb65ffb];return _0x58f55c;};'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 diff --git a/server/api/version/index.js b/server/api/version/index.js index 094291a..8b0fc9d 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 _0x8b86=['/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','restart'];(function(_0x3041e3,_0x1112ce){var _0x48d446=function(_0xf6f42b){while(--_0xf6f42b){_0x3041e3['push'](_0x3041e3['shift']());}};_0x48d446(++_0x1112ce);}(_0x8b86,0xc3));var _0x68b8=function(_0x4daa0d,_0x3a82b8){_0x4daa0d=_0x4daa0d-0x0;var _0x38d4f3=_0x8b86[_0x4daa0d];return _0x38d4f3;};'use strict';var express=require('express');var router=express[_0x68b8('0x0')]();var auth=require(_0x68b8('0x1'));var controller=require(_0x68b8('0x2'));router[_0x68b8('0x3')]('/',controller[_0x68b8('0x4')]);router[_0x68b8('0x3')]('/fetch',auth[_0x68b8('0x5')](),auth[_0x68b8('0x6')](),controller[_0x68b8('0x7')]);router[_0x68b8('0x3')](_0x68b8('0x8'),auth[_0x68b8('0x5')](),auth[_0x68b8('0x6')](),controller[_0x68b8('0x9')]);router[_0x68b8('0x3')](_0x68b8('0xa'),auth[_0x68b8('0x5')](),auth['canUpdate'](),controller[_0x68b8('0xb')]);router[_0x68b8('0x3')]('/restart',auth[_0x68b8('0x5')](),controller[_0x68b8('0xc')]);router[_0x68b8('0x3')](_0x68b8('0xd'),controller[_0x68b8('0xe')]);module[_0x68b8('0xf')]=router; \ No newline at end of file +var _0xed17=['reset','/pull','/migrations','migrations','Router','../../components/auth/service','get','/fetch','isAuthenticated','canUpdate','fetch','/reset'];(function(_0x40fa87,_0x3a3196){var _0x1d4cc1=function(_0x182903){while(--_0x182903){_0x40fa87['push'](_0x40fa87['shift']());}};_0x1d4cc1(++_0x3a3196);}(_0xed17,0x70));var _0x7ed1=function(_0x24693e,_0x2ba888){_0x24693e=_0x24693e-0x0;var _0x53e672=_0xed17[_0x24693e];return _0x53e672;};'use strict';var express=require('express');var router=express[_0x7ed1('0x0')]();var auth=require(_0x7ed1('0x1'));var controller=require('./version.controller');router['get']('/',controller['index']);router[_0x7ed1('0x2')](_0x7ed1('0x3'),auth[_0x7ed1('0x4')](),auth[_0x7ed1('0x5')](),controller[_0x7ed1('0x6')]);router[_0x7ed1('0x2')](_0x7ed1('0x7'),auth[_0x7ed1('0x4')](),auth[_0x7ed1('0x5')](),controller[_0x7ed1('0x8')]);router[_0x7ed1('0x2')](_0x7ed1('0x9'),auth[_0x7ed1('0x4')](),auth[_0x7ed1('0x5')](),controller['pull']);router[_0x7ed1('0x2')]('/restart',auth['isAuthenticated'](),controller['restart']);router[_0x7ed1('0x2')](_0x7ed1('0xa'),controller[_0x7ed1('0xb')]);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 ad46c88..0319004 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 _0x29ca=['sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','master','error','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','replace','.js','push','length','sort'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x29ca,0x113));var _0xa29c=function(_0x395a03,_0x362943){_0x395a03=_0x395a03-0x0;var _0x8de6f=_0x29ca[_0x395a03];return _0x8de6f;};'use strict';var Umzug=require('umzug');var path=require(_0xa29c('0x0'));var fs=require('fs');var _=require(_0xa29c('0x1'));var pkginfo=require(_0xa29c('0x2'))(module,_0xa29c('0x3'));var compareVersions=require(_0xa29c('0x4'));var exec=require(_0xa29c('0x5'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0xa29c('0x6'));var pm2=require(_0xa29c('0x7'));var logger=require(_0xa29c('0x8'))(_0xa29c('0x9'));var git=require(_0xa29c('0xa'))(config[_0xa29c('0xb')]);exports[_0xa29c('0xc')]=function(_0x50ab33,_0x5caeb6){var _0x54105c={'current':module[_0xa29c('0xd')]['version'],'phonebar':0x2};if(_0x50ab33[_0xa29c('0xe')]&&_0x50ab33[_0xa29c('0xe')][_0xa29c('0xf')]){return git[_0xa29c('0x10')]()[_0xa29c('0x11')](function(_0x1fba0f,_0x2cfcfa){_0x54105c[_0xa29c('0xf')]=(_0x1fba0f?module[_0xa29c('0xd')]['version']:_0x2cfcfa[_0xa29c('0xf')])||_0xa29c('0x12');return _0x5caeb6[_0xa29c('0x13')](0xc8)['json'](_0x54105c);});}else{return _0x5caeb6['status'](0xc8)[_0xa29c('0x14')](_0x54105c);}};exports['fetch']=function(_0x46f055,_0x1af685){return git['fetch'](['origin',_0xa29c('0x15')],function(_0x4e0097){if(_0x4e0097){logger[_0xa29c('0x16')](_0x4e0097);return _0x1af685['status'](0x1f4)[_0xa29c('0x14')](_0x4e0097);}logger['info'](_0xa29c('0x17'));return _0x1af685['status'](0xc8)[_0xa29c('0x14')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0xdb73c9,_0x5488e4){return git[_0xa29c('0x18')](['--hard',_0xa29c('0x19')],function(_0x250bf5){if(_0x250bf5){logger[_0xa29c('0x16')](_0x250bf5);return _0x5488e4['status'](0x1f4)[_0xa29c('0x14')](_0x250bf5);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5488e4['status'](0xc8)[_0xa29c('0x14')]({'output':_0xa29c('0x1a')});});};exports[_0xa29c('0x1b')]=function(_0x149f77,_0x2ba632){exec('npm\x20install\x20--production',function(_0x2171af,_0x22aa66,_0x2b418a){logger['info'](_0x22aa66);logger[_0xa29c('0x1c')](_0x2b418a);if(_0x2171af){logger[_0xa29c('0x16')](_0x2171af);return _0x2ba632[_0xa29c('0x13')](0x1f4)[_0xa29c('0x14')](_0x2171af);}return _0x2ba632['status'](0xc8)[_0xa29c('0x14')]({'output':_0x22aa66});});};exports[_0xa29c('0x1d')]=function(_0x1cf912,_0x1e6e1f){return pm2[_0xa29c('0x1d')](_0xa29c('0x1e'))[_0xa29c('0x1f')](function(_0xfc4755){logger['info'](_0xa29c('0x20'),_0xfc4755);return _0x1e6e1f[_0xa29c('0x13')](0xc8)[_0xa29c('0x14')]({'output':_0xa29c('0x21')});})[_0xa29c('0x22')](function(_0x25aefa){logger[_0xa29c('0x16')](_0x25aefa);return _0x1e6e1f['status'](0x1f4)[_0xa29c('0x14')](_0x25aefa);});};exports[_0xa29c('0x23')]=function(_0x301a5f,_0x2af8e1){var _0x1e4c50=fs[_0xa29c('0x24')](path['join'](config[_0xa29c('0xb')],_0xa29c('0x25'),_0xa29c('0x23')));var _0x3a9c7b=[];for(var _0xbb37c=0x0;_0xbb37c<_0x1e4c50['length'];_0xbb37c++){var _0x21f150=_0x1e4c50[_0xbb37c][_0xa29c('0x26')](_0xa29c('0x27'),'');if(compareVersions(module[_0xa29c('0xd')][_0xa29c('0x3')],_0x21f150)===-0x1){_0x3a9c7b[_0xa29c('0x28')](_0x21f150);}}if(_0x3a9c7b[_0xa29c('0x29')]){var _0x4a0970=_0x3a9c7b[_0xa29c('0x2a')](compareVersions);var _0x3d2dd2=new Umzug({'storage':_0xa29c('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0xa29c('0x2c'),'columnName':_0xa29c('0x3')},'migrations':{'params':[db['sequelize'][_0xa29c('0x2d')](),db[_0xa29c('0x2b')][_0xa29c('0x2e')],function(){throw new Error(_0xa29c('0x2f'));}],'path':path[_0xa29c('0x30')](config[_0xa29c('0xb')],'server',_0xa29c('0x23')),'pattern':/\.js$/}});_0x3d2dd2['up']({'migrations':_['map'](_0x4a0970,function(_0x41f3f8){return _0x41f3f8+_0xa29c('0x27');})})[_0xa29c('0x1f')](function(){return _0x2af8e1[_0xa29c('0x13')](0xc8)[_0xa29c('0x14')]({'output':_0xa29c('0x31')+module[_0xa29c('0xd')][_0xa29c('0x3')]+_0xa29c('0x32')+_[_0xa29c('0x33')](_0x4a0970),'migrations':_[_0xa29c('0x30')](_0x4a0970)});})[_0xa29c('0x22')](function(_0x56dda8){if(_0x56dda8 instanceof db[_0xa29c('0x2b')]['UniqueConstraintError']){return _0x2af8e1['status'](0xc8)[_0xa29c('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x2af8e1['status'](0x1f4)[_0xa29c('0x14')](_0x56dda8);}});}else{return _0x2af8e1[_0xa29c('0x13')](0xc8)['json']({'output':_0xa29c('0x34')});}}; \ No newline at end of file +var _0x4897=['latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','root','server','length','replace','push','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','index','exports','query'];(function(_0x4dbef6,_0x2cbe40){var _0xcd4fa0=function(_0x1b01b0){while(--_0x1b01b0){_0x4dbef6['push'](_0x4dbef6['shift']());}};_0xcd4fa0(++_0x2cbe40);}(_0x4897,0x12f));var _0x7489=function(_0x55d1ad,_0x2fd8d6){_0x55d1ad=_0x55d1ad-0x0;var _0xbd4aa5=_0x4897[_0x55d1ad];return _0xbd4aa5;};'use strict';var Umzug=require(_0x7489('0x0'));var path=require(_0x7489('0x1'));var fs=require('fs');var _=require(_0x7489('0x2'));var pkginfo=require(_0x7489('0x3'))(module,_0x7489('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x7489('0x5'))[_0x7489('0x6')];var db=require(_0x7489('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x7489('0x8'));var logger=require(_0x7489('0x9'))(_0x7489('0xa'));var git=require(_0x7489('0xb'))(config['root']);exports[_0x7489('0xc')]=function(_0x5b2bc0,_0xd58709){var _0x44718d={'current':module[_0x7489('0xd')][_0x7489('0x4')],'phonebar':0x2};if(_0x5b2bc0[_0x7489('0xe')]&&_0x5b2bc0[_0x7489('0xe')][_0x7489('0xf')]){return git[_0x7489('0x10')]()[_0x7489('0x11')](function(_0x21b2d3,_0x580535){_0x44718d[_0x7489('0xf')]=(_0x21b2d3?module[_0x7489('0xd')][_0x7489('0x4')]:_0x580535[_0x7489('0xf')])||_0x7489('0x12');return _0xd58709[_0x7489('0x13')](0xc8)[_0x7489('0x14')](_0x44718d);});}else{return _0xd58709['status'](0xc8)[_0x7489('0x14')](_0x44718d);}};exports[_0x7489('0x10')]=function(_0x1a89f7,_0x4802fb){return git['fetch']([_0x7489('0x15'),_0x7489('0x16')],function(_0x2d0875){if(_0x2d0875){logger[_0x7489('0x17')](_0x2d0875);return _0x4802fb[_0x7489('0x13')](0x1f4)[_0x7489('0x14')](_0x2d0875);}logger[_0x7489('0x18')]('git\x20fetch');return _0x4802fb[_0x7489('0x13')](0xc8)['json']({'output':_0x7489('0x19')});});};exports[_0x7489('0x1a')]=function(_0x5b312a,_0x5106fc){return git[_0x7489('0x1a')](['--hard','FETCH_HEAD'],function(_0x216a7c){if(_0x216a7c){logger[_0x7489('0x17')](_0x216a7c);return _0x5106fc[_0x7489('0x13')](0x1f4)[_0x7489('0x14')](_0x216a7c);}logger[_0x7489('0x18')](_0x7489('0x1b'));return _0x5106fc[_0x7489('0x13')](0xc8)['json']({'output':_0x7489('0x1c')});});};exports[_0x7489('0x1d')]=function(_0x178f34,_0x11b8d8){exec(_0x7489('0x1e'),function(_0x2b07c7,_0x29016c,_0x42d449){logger[_0x7489('0x18')](_0x29016c);logger['info'](_0x42d449);if(_0x2b07c7){logger[_0x7489('0x17')](_0x2b07c7);return _0x11b8d8[_0x7489('0x13')](0x1f4)[_0x7489('0x14')](_0x2b07c7);}return _0x11b8d8['status'](0xc8)['json']({'output':_0x29016c});});};exports[_0x7489('0x1f')]=function(_0x3da99b,_0x51bffe){return pm2[_0x7489('0x1f')](_0x7489('0x20'))['then'](function(_0x2a31df){logger[_0x7489('0x18')](_0x7489('0x21'),_0x2a31df);return _0x51bffe[_0x7489('0x13')](0xc8)[_0x7489('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7489('0x22')](function(_0x4c9a47){logger['error'](_0x4c9a47);return _0x51bffe[_0x7489('0x13')](0x1f4)[_0x7489('0x14')](_0x4c9a47);});};exports[_0x7489('0x23')]=function(_0x1acb90,_0x2e5ece){var _0x2fe50c=fs[_0x7489('0x24')](path['join'](config[_0x7489('0x25')],_0x7489('0x26'),_0x7489('0x23')));var _0x495359=[];for(var _0x21a470=0x0;_0x21a470<_0x2fe50c[_0x7489('0x27')];_0x21a470++){var _0x4c29bc=_0x2fe50c[_0x21a470][_0x7489('0x28')]('.js','');if(compareVersions(module[_0x7489('0xd')]['version'],_0x4c29bc)===-0x1){_0x495359[_0x7489('0x29')](_0x4c29bc);}}if(_0x495359[_0x7489('0x27')]){var _0x155cbb=_0x495359['sort'](compareVersions);var _0x406dcf=new Umzug({'storage':_0x7489('0x2a'),'storageOptions':{'model':db[_0x7489('0x2b')],'modelName':_0x7489('0x2b'),'columnName':_0x7489('0x4')},'migrations':{'params':[db[_0x7489('0x2a')]['getQueryInterface'](),db[_0x7489('0x2a')][_0x7489('0x2c')],function(){throw new Error(_0x7489('0x2d'));}],'path':path['join'](config[_0x7489('0x25')],_0x7489('0x26'),_0x7489('0x23')),'pattern':/\.js$/}});_0x406dcf['up']({'migrations':_[_0x7489('0x2e')](_0x155cbb,function(_0x4ac4b1){return _0x4ac4b1+'.js';})})[_0x7489('0x2f')](function(){return _0x2e5ece[_0x7489('0x13')](0xc8)[_0x7489('0x14')]({'output':_0x7489('0x30')+module[_0x7489('0xd')][_0x7489('0x4')]+'\x20to\x20'+_[_0x7489('0x31')](_0x155cbb),'migrations':_[_0x7489('0x32')](_0x155cbb)});})[_0x7489('0x22')](function(_0x4aa9bc){if(_0x4aa9bc instanceof db['sequelize'][_0x7489('0x33')]){return _0x2e5ece[_0x7489('0x13')](0xc8)['json']({'output':_0x7489('0x34')});}else{return _0x2e5ece[_0x7489('0x13')](0x1f4)[_0x7489('0x14')](_0x4aa9bc);}});}else{return _0x2e5ece['status'](0xc8)[_0x7489('0x14')]({'output':_0x7489('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ee87e2d..7bc96bf 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 _0x9f61=['./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x12f7b2,_0x38046f){var _0x100d18=function(_0x4769a4){while(--_0x4769a4){_0x12f7b2['push'](_0x12f7b2['shift']());}};_0x100d18(++_0x38046f);}(_0x9f61,0x15e));var _0x19f6=function(_0x32c7c3,_0x21694e){_0x32c7c3=_0x32c7c3-0x0;var _0xdf5778=_0x9f61[_0x32c7c3];return _0xdf5778;};'use strict';var multer=require('multer');var util=require(_0x19f6('0x0'));var path=require(_0x19f6('0x1'));var timeout=require(_0x19f6('0x2'));var express=require(_0x19f6('0x3'));var router=express[_0x19f6('0x4')]();var fs_extra=require(_0x19f6('0x5'));var auth=require(_0x19f6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x19f6('0x7'));router[_0x19f6('0x8')]('/',auth[_0x19f6('0x9')](),controller['index']);router[_0x19f6('0x8')](_0x19f6('0xa'),auth[_0x19f6('0x9')](),controller[_0x19f6('0xb')]);router[_0x19f6('0x8')](_0x19f6('0xc'),auth[_0x19f6('0x9')](),controller[_0x19f6('0xd')]);router[_0x19f6('0xe')]('/',auth[_0x19f6('0x9')](),controller[_0x19f6('0xf')]);router[_0x19f6('0x10')](_0x19f6('0xc'),auth[_0x19f6('0x9')](),controller[_0x19f6('0x11')]);router[_0x19f6('0x12')](_0x19f6('0xc'),auth[_0x19f6('0x9')](),controller[_0x19f6('0x13')]);module[_0x19f6('0x14')]=router; \ No newline at end of file +var _0x57b3=['fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2a1626,_0x2fec30){var _0x4bd03a=function(_0x1387eb){while(--_0x1387eb){_0x2a1626['push'](_0x2a1626['shift']());}};_0x4bd03a(++_0x2fec30);}(_0x57b3,0x10e));var _0x357b=function(_0x2bfc2c,_0x48ffd9){_0x2bfc2c=_0x2bfc2c-0x0;var _0x53f8d0=_0x57b3[_0x2bfc2c];return _0x53f8d0;};'use strict';var multer=require(_0x357b('0x0'));var util=require(_0x357b('0x1'));var path=require(_0x357b('0x2'));var timeout=require(_0x357b('0x3'));var express=require(_0x357b('0x4'));var router=express[_0x357b('0x5')]();var fs_extra=require(_0x357b('0x6'));var auth=require(_0x357b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x357b('0x8'));var controller=require(_0x357b('0x9'));router[_0x357b('0xa')]('/',auth[_0x357b('0xb')](),controller[_0x357b('0xc')]);router[_0x357b('0xa')](_0x357b('0xd'),auth[_0x357b('0xb')](),controller[_0x357b('0xe')]);router[_0x357b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x357b('0xf')]);router['post']('/',auth[_0x357b('0xb')](),controller[_0x357b('0x10')]);router[_0x357b('0x11')](_0x357b('0x12'),auth['isAuthenticated'](),controller[_0x357b('0x13')]);router[_0x357b('0x14')]('/:id',auth[_0x357b('0xb')](),controller[_0x357b('0x15')]);module[_0x357b('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index ebc11ab..d5ff11a 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 _0xd509=['FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5b9fa1,_0x4dd147){var _0x4caa03=function(_0x2c0bf9){while(--_0x2c0bf9){_0x5b9fa1['push'](_0x5b9fa1['shift']());}};_0x4caa03(++_0x4dd147);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9d50('0x0')]},'uniqueid':{'type':Sequelize[_0x9d50('0x0')]},'calleridnum':{'type':Sequelize[_0x9d50('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9d50('0x0')]},'membername':{'type':Sequelize[_0x9d50('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9d50('0x1')]},'agentcompleteAt':{'type':Sequelize[_0x9d50('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0x9d50('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9d50('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9d50('0x2')]},'agentacw':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9d50('0x2')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x9d50('0x0')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9d50('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9d50('0x0')]},'language':{'type':Sequelize[_0x9d50('0x0')]},'accountcode':{'type':Sequelize[_0x9d50('0x0')]},'context':{'type':Sequelize[_0x9d50('0x0')]},'exten':{'type':Sequelize[_0x9d50('0x0')]},'priority':{'type':Sequelize[_0x9d50('0x0')]},'destchannel':{'type':Sequelize[_0x9d50('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9d50('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9d50('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x9d50('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x9d50('0x0')]},'destlanguage':{'type':Sequelize[_0x9d50('0x0')]},'destaccountcode':{'type':Sequelize[_0x9d50('0x0')]},'destcontext':{'type':Sequelize[_0x9d50('0x0')]},'destexten':{'type':Sequelize[_0x9d50('0x0')]},'destpriority':{'type':Sequelize[_0x9d50('0x0')]},'destuniqueid':{'type':Sequelize[_0x9d50('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9d50('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x9d50('0x0')]},'transfer':{'type':Sequelize[_0x9d50('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9d50('0x4')},'transferexten':{'type':Sequelize[_0x9d50('0x0')]},'transferuniqueid':{'type':Sequelize[_0x9d50('0x0')]},'agententerreason':{'type':Sequelize[_0x9d50('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x79d7=['BOOLEAN','sequelize','STRING','DATE','INTEGER'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x79d7,0x9c));var _0x779d=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x79d7[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x779d('0x0'));module['exports']={'type':{'type':Sequelize[_0x779d('0x1')]},'uniqueid':{'type':Sequelize[_0x779d('0x1')]},'calleridnum':{'type':Sequelize[_0x779d('0x1')]},'calleridname':{'type':Sequelize[_0x779d('0x1')]},'queue':{'type':Sequelize[_0x779d('0x1')]},'interface':{'type':Sequelize[_0x779d('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x779d('0x2')]},'agentconnectAt':{'type':Sequelize[_0x779d('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x779d('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x779d('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x779d('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x779d('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x779d('0x1')]},'channel':{'type':Sequelize[_0x779d('0x1')]},'channelstate':{'type':Sequelize[_0x779d('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x779d('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x779d('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x779d('0x1')]},'exten':{'type':Sequelize[_0x779d('0x1')]},'priority':{'type':Sequelize[_0x779d('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x779d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x779d('0x1')]},'destcalleridnum':{'type':Sequelize[_0x779d('0x1')]},'destcalleridname':{'type':Sequelize[_0x779d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x779d('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x779d('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x779d('0x1')]},'destcontext':{'type':Sequelize[_0x779d('0x1')]},'destexten':{'type':Sequelize[_0x779d('0x1')]},'destpriority':{'type':Sequelize[_0x779d('0x1')]},'destuniqueid':{'type':Sequelize[_0x779d('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x779d('0x1')]},'transfer':{'type':Sequelize[_0x779d('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x779d('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x779d('0x1')]},'transferuniqueid':{'type':Sequelize[_0x779d('0x1')]},'agententerreason':{'type':Sequelize[_0x779d('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 6457ff4..5a0f906 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 61a090c..f856984 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 _0x078c=['../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x078c,0x19f));var _0xc078=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0x078c[_0x3d78d7];return _0x4b6784;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var logger=require(_0xc078('0x1'))(_0xc078('0x2'));var moment=require('moment');var BPromise=require(_0xc078('0x3'));var rp=require(_0xc078('0x4'));var fs=require('fs');var path=require(_0xc078('0x5'));var rimraf=require(_0xc078('0x6'));var config=require('../../config/environment');var attributes=require(_0xc078('0x7'));module[_0xc078('0x8')]=function(_0x394068,_0x24b241){return _0x394068[_0xc078('0x9')](_0xc078('0xa'),attributes,{'tableName':_0xc078('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc078('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x28a2=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var logger=require(_0x228a('0x2'))(_0x228a('0x3'));var moment=require(_0x228a('0x4'));var BPromise=require(_0x228a('0x5'));var rp=require(_0x228a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x228a('0x7'));var config=require('../../config/environment');var attributes=require(_0x228a('0x8'));module[_0x228a('0x9')]=function(_0x17727b,_0xf86d1d){return _0x17727b[_0x228a('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x228a('0xb'),'paranoid':![],'indexes':[{'fields':[_0x228a('0xc'),_0x228a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 9130be4..02090b8 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 _0x960d=['limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','update','where','attributes'];(function(_0x1ccb8b,_0xbc005c){var _0x31e66f=function(_0x192c27){while(--_0x192c27){_0x1ccb8b['push'](_0x1ccb8b['shift']());}};_0x31e66f(++_0xbc005c);}(_0x960d,0x195));var _0xd960=function(_0xe4b69f,_0x29d8b6){_0xe4b69f=_0xe4b69f-0x0;var _0x503377=_0x960d[_0xe4b69f];return _0x503377;};'use strict';var _=require(_0xd960('0x0'));var util=require(_0xd960('0x1'));var moment=require(_0xd960('0x2'));var BPromise=require(_0xd960('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd960('0x4'));var db=require(_0xd960('0x5'))['db'];var utils=require(_0xd960('0x6'));var logger=require(_0xd960('0x7'))(_0xd960('0x8'));var config=require('../../config/environment');var jayson=require(_0xd960('0x9'));var client=jayson[_0xd960('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0d79,_0x1f1d5f,_0x495b27){return new BPromise(function(_0x2b95b6,_0x5accdd){return client['request'](_0x4a0d79,_0x495b27)[_0xd960('0xb')](function(_0x5829ec){logger[_0xd960('0xc')](_0xd960('0xd'),_0x1f1d5f,_0xd960('0xe'));logger[_0xd960('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1f1d5f,'request\x20sent',JSON[_0xd960('0x10')](_0x5829ec));if(_0x5829ec[_0xd960('0x11')]){if(_0x5829ec['error']['code']===0x1f4){logger[_0xd960('0x11')](_0xd960('0xd'),_0x1f1d5f,_0x5829ec['error'][_0xd960('0x12')]);return _0x5accdd(_0x5829ec['error'][_0xd960('0x12')]);}logger[_0xd960('0x11')](_0xd960('0xd'),_0x1f1d5f,_0x5829ec[_0xd960('0x11')][_0xd960('0x12')]);return _0x2b95b6(_0x5829ec[_0xd960('0x11')][_0xd960('0x12')]);}else{logger[_0xd960('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x1f1d5f,'request\x20sent');_0x2b95b6(_0x5829ec[_0xd960('0x13')][_0xd960('0x12')]);}})[_0xd960('0x14')](function(_0x2a386a){logger['error'](_0xd960('0xd'),_0x1f1d5f,_0x2a386a);_0x5accdd(_0x2a386a);});});}exports[_0xd960('0x15')]=function(_0x48d09d){var _0x4be7e5=this;return new Promise(function(_0x4d04ca,_0x149d5b){return db[_0xd960('0x16')]['create'](_0x48d09d[_0xd960('0x17')],{'raw':_0x48d09d['options']?_0x48d09d[_0xd960('0x18')][_0xd960('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x26774c){logger['info'](_0xd960('0x15'),_0x48d09d);logger[_0xd960('0xf')](_0xd960('0x15'),_0x48d09d,JSON['stringify'](_0x26774c));_0x4d04ca(_0x26774c);})['catch'](function(_0x424eee){logger[_0xd960('0x11')](_0xd960('0x15'),_0x424eee[_0xd960('0x12')],_0x48d09d);_0x149d5b(_0x4be7e5[_0xd960('0x11')](0x1f4,_0x424eee['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x20b6a1){var _0x2f582c=this;return new Promise(function(_0x4f092b,_0x46c3d0){return db[_0xd960('0x16')][_0xd960('0x1a')](_0x20b6a1[_0xd960('0x17')],{'raw':_0x20b6a1[_0xd960('0x18')]?_0x20b6a1['options'][_0xd960('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b6a1['options']?_0x20b6a1['options'][_0xd960('0x1b')]||null:null,'attributes':_0x20b6a1['options']?_0x20b6a1[_0xd960('0x18')][_0xd960('0x1c')]||null:null,'limit':_0x20b6a1[_0xd960('0x18')]?_0x20b6a1[_0xd960('0x18')][_0xd960('0x1d')]||null:null})[_0xd960('0xb')](function(_0x20f3b2){logger['info']('UpdateVoiceAgentReport',_0x20b6a1);logger[_0xd960('0xf')](_0xd960('0x1e'),_0x20b6a1,JSON[_0xd960('0x10')](_0x20f3b2));_0x4f092b(_0x20f3b2);})['catch'](function(_0x1e5e22){logger[_0xd960('0x11')](_0xd960('0x1e'),_0x1e5e22[_0xd960('0x12')],_0x20b6a1);_0x46c3d0(_0x2f582c['error'](0x1f4,_0x1e5e22[_0xd960('0x12')]));});});}; \ No newline at end of file +var _0x1983=['util','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','update','where','then','lodash'];(function(_0x4113a5,_0x16e42f){var _0xae70e=function(_0x154efc){while(--_0x154efc){_0x4113a5['push'](_0x4113a5['shift']());}};_0xae70e(++_0x16e42f);}(_0x1983,0xd7));var _0x3198=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x1983[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x3198('0x0'));var util=require(_0x3198('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3198('0x2'));var db=require(_0x3198('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3198('0x4'))('rpc');var config=require(_0x3198('0x5'));var jayson=require(_0x3198('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7b416f,_0xaa407a,_0x243829){return new BPromise(function(_0x4f806c,_0x16fd10){return client['request'](_0x7b416f,_0x243829)['then'](function(_0x16162e){logger['info'](_0x3198('0x7'),_0xaa407a,_0x3198('0x8'));logger[_0x3198('0x9')](_0x3198('0xa'),_0xaa407a,'request\x20sent',JSON['stringify'](_0x16162e));if(_0x16162e[_0x3198('0xb')]){if(_0x16162e[_0x3198('0xb')]['code']===0x1f4){logger[_0x3198('0xb')](_0x3198('0x7'),_0xaa407a,_0x16162e[_0x3198('0xb')][_0x3198('0xc')]);return _0x16fd10(_0x16162e[_0x3198('0xb')][_0x3198('0xc')]);}logger[_0x3198('0xb')](_0x3198('0x7'),_0xaa407a,_0x16162e[_0x3198('0xb')][_0x3198('0xc')]);return _0x4f806c(_0x16162e['error'][_0x3198('0xc')]);}else{logger[_0x3198('0xd')](_0x3198('0x7'),_0xaa407a,_0x3198('0x8'));_0x4f806c(_0x16162e[_0x3198('0xe')][_0x3198('0xc')]);}})[_0x3198('0xf')](function(_0x376e7c){logger[_0x3198('0xb')](_0x3198('0x7'),_0xaa407a,_0x376e7c);_0x16fd10(_0x376e7c);});});}exports[_0x3198('0x10')]=function(_0x41875c){var _0x5e5045=this;return new Promise(function(_0x2bdad4,_0x30e0e7){return db[_0x3198('0x11')][_0x3198('0x12')](_0x41875c[_0x3198('0x13')],{'raw':_0x41875c[_0x3198('0x14')]?_0x41875c[_0x3198('0x14')][_0x3198('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x4b324c){logger[_0x3198('0xd')](_0x3198('0x10'),_0x41875c);logger[_0x3198('0x9')]('CreateVoiceAgentReport',_0x41875c,JSON[_0x3198('0x16')](_0x4b324c));_0x2bdad4(_0x4b324c);})[_0x3198('0xf')](function(_0x3c6ab3){logger['error'](_0x3198('0x10'),_0x3c6ab3['message'],_0x41875c);_0x30e0e7(_0x5e5045[_0x3198('0xb')](0x1f4,_0x3c6ab3[_0x3198('0xc')]));});});};exports[_0x3198('0x17')]=function(_0x310b77){var _0x57e0b3=this;return new Promise(function(_0x3ef793,_0x598b87){return db[_0x3198('0x11')][_0x3198('0x18')](_0x310b77[_0x3198('0x13')],{'raw':_0x310b77[_0x3198('0x14')]?_0x310b77['options'][_0x3198('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310b77[_0x3198('0x14')]?_0x310b77[_0x3198('0x14')][_0x3198('0x19')]||null:null,'attributes':_0x310b77[_0x3198('0x14')]?_0x310b77[_0x3198('0x14')]['attributes']||null:null,'limit':_0x310b77[_0x3198('0x14')]?_0x310b77[_0x3198('0x14')]['limit']||null:null})[_0x3198('0x1a')](function(_0x23fd37){logger[_0x3198('0xd')](_0x3198('0x17'),_0x310b77);logger[_0x3198('0x9')](_0x3198('0x17'),_0x310b77,JSON[_0x3198('0x16')](_0x23fd37));_0x3ef793(_0x23fd37);})[_0x3198('0xf')](function(_0x3c4856){logger[_0x3198('0xb')](_0x3198('0x17'),_0x3c4856[_0x3198('0xc')],_0x310b77);_0x598b87(_0x57e0b3[_0x3198('0xb')](0x1f4,_0x3c4856[_0x3198('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 05d091a..61ebc24 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 _0xb4c7=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x5188a4,_0x50ec05){var _0x18ec8e=function(_0x24f7f2){while(--_0x24f7f2){_0x5188a4['push'](_0x5188a4['shift']());}};_0x18ec8e(++_0x50ec05);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x19733f,_0x4ef5a9){_0x19733f=_0x19733f-0x0;var _0xfd1906=_0xb4c7[_0x19733f];return _0xfd1906;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0x10')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router['delete']('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x14')]);module[_0x7b4c('0x15')]=router; \ No newline at end of file +var _0xd13e=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x443b1e,_0xf7ffe9){var _0x3beb6f=function(_0x1cd133){while(--_0x1cd133){_0x443b1e['push'](_0x443b1e['shift']());}};_0x3beb6f(++_0xf7ffe9);}(_0xd13e,0x193));var _0xed13=function(_0x5f500a,_0x52590e){_0x5f500a=_0x5f500a-0x0;var _0xa425ab=_0xd13e[_0x5f500a];return _0xa425ab;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),auth[_0xed13('0xa')](),controller[_0xed13('0xb')]);router[_0xed13('0x8')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0xd')]);router[_0xed13('0xe')]('/',auth['isAuthenticated'](),controller[_0xed13('0xf')]);router[_0xed13('0x10')](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x11')]);router['delete'](_0xed13('0xc'),auth[_0xed13('0xa')](),controller[_0xed13('0x12')]);module[_0xed13('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 805f610..99ef398 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 _0x552c=['STRING','ENUM','inbound','TEXT','DATE','INTEGER','exports'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x552c,0xa0));var _0xc552=function(_0x1e84ff,_0x354f81){_0x1e84ff=_0x1e84ff-0x0;var _0x244512=_0x552c[_0x1e84ff];return _0x244512;};'use strict';var Sequelize=require('sequelize');module[_0xc552('0x0')]={'uniqueid':{'type':Sequelize[_0xc552('0x1')]},'type':{'type':Sequelize[_0xc552('0x2')](_0xc552('0x3'),'internal','outbound','inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0xc552('0x1')]},'accountcode':{'type':Sequelize[_0xc552('0x1')]},'source':{'type':Sequelize[_0xc552('0x1')]},'destination':{'type':Sequelize[_0xc552('0x1')]},'destinationcontext':{'type':Sequelize[_0xc552('0x1')]},'callerid':{'type':Sequelize[_0xc552('0x1')]},'channel':{'type':Sequelize[_0xc552('0x1')]},'destinationchannel':{'type':Sequelize[_0xc552('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc552('0x4')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xc552('0x5')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc552('0x5')]},'duration':{'type':Sequelize[_0xc552('0x6')]},'billableseconds':{'type':Sequelize[_0xc552('0x6')]},'mohtime':{'type':Sequelize[_0xc552('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc552('0x1')]},'userfield':{'type':Sequelize[_0xc552('0x1')]},'userDisposition':{'type':Sequelize[_0xc552('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xc552('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc552('0x1')]},'prefix':{'type':Sequelize[_0xc552('0x1')]},'routeid':{'type':Sequelize[_0xc552('0x6')]},'sipcallid':{'type':Sequelize[_0xc552('0x1')]}}; \ No newline at end of file +var _0xa064=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','inbound-fax','dialer','TEXT'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xa064,0x192));var _0x4a06=function(_0x395af7,_0x32901c){_0x395af7=_0x395af7-0x0;var _0x3d15cb=_0xa064[_0x395af7];return _0x3d15cb;};'use strict';var Sequelize=require(_0x4a06('0x0'));module[_0x4a06('0x1')]={'uniqueid':{'type':Sequelize[_0x4a06('0x2')]},'type':{'type':Sequelize[_0x4a06('0x3')](_0x4a06('0x4'),'internal','outbound',_0x4a06('0x5'),'outbound-fax',_0x4a06('0x6'))},'tag':{'type':Sequelize[_0x4a06('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x4a06('0x2')]},'destination':{'type':Sequelize[_0x4a06('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4a06('0x2')]},'channel':{'type':Sequelize[_0x4a06('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x4a06('0x7')]},'starttime':{'type':Sequelize[_0x4a06('0x8')]},'systemanswertime':{'type':Sequelize[_0x4a06('0x8')]},'answertime':{'type':Sequelize[_0x4a06('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x4a06('0x9')]},'billableseconds':{'type':Sequelize[_0x4a06('0x9')]},'mohtime':{'type':Sequelize[_0x4a06('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4a06('0x2')]},'amaflags':{'type':Sequelize[_0x4a06('0x2')]},'userfield':{'type':Sequelize[_0x4a06('0x2')]},'userDisposition':{'type':Sequelize[_0x4a06('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x4a06('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x4a06('0x2')]},'routeid':{'type':Sequelize[_0x4a06('0x9')]},'sipcallid':{'type':Sequelize[_0x4a06('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 1d9aa68..7f46eda 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x385eb1,_0x497a94){var _0x5d40eb=function(_0x159029){while(--_0x159029){_0x385eb1['push'](_0x385eb1['shift']());}};_0x5d40eb(++_0x497a94);}(_0x5f2f,0x73));var _0xf5f2=function(_0x24a86a,_0x25b8d0){_0x24a86a=_0x24a86a-0x0;var _0x4aa95f=_0x5f2f[_0x24a86a];return _0x4aa95f;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x304395,_0x5016d9){var _0x28a4ac=function(_0x11923e){while(--_0x11923e){_0x304395['push'](_0x304395['shift']());}};_0x28a4ac(++_0x5016d9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3eceb2,_0x509ff8){_0x3eceb2=_0x3eceb2-0x0;var _0x818bc4=_0xb10b[_0x3eceb2];return _0x818bc4;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index b25204b..a2bfecc 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 _0x04d6=['path','rimraf','../../config/environment','exports','uniqueid','lodash','../../config/logger','moment','request-promise'];(function(_0x46df7c,_0x2c6536){var _0x4a81a5=function(_0x4ae79a){while(--_0x4ae79a){_0x46df7c['push'](_0x46df7c['shift']());}};_0x4a81a5(++_0x2c6536);}(_0x04d6,0x137));var _0x604d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x04d6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x604d('0x0'));var util=require('util');var logger=require(_0x604d('0x1'))('api');var moment=require(_0x604d('0x2'));var BPromise=require('bluebird');var rp=require(_0x604d('0x3'));var fs=require('fs');var path=require(_0x604d('0x4'));var rimraf=require(_0x604d('0x5'));var config=require(_0x604d('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x604d('0x7')]=function(_0x40ef4b,_0x5418cb){return _0x40ef4b['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x604d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa049=['report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa049,0x136));var _0x9a04=function(_0x47cd62,_0x19bbf3){_0x47cd62=_0x47cd62-0x0;var _0x7923b9=_0xa049[_0x47cd62];return _0x7923b9;};'use strict';var _=require('lodash');var util=require(_0x9a04('0x0'));var logger=require(_0x9a04('0x1'))(_0x9a04('0x2'));var moment=require(_0x9a04('0x3'));var BPromise=require(_0x9a04('0x4'));var rp=require(_0x9a04('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a04('0x6'));var config=require(_0x9a04('0x7'));var attributes=require(_0x9a04('0x8'));module[_0x9a04('0x9')]=function(_0x376afc,_0x15d14a){return _0x376afc[_0x9a04('0xa')](_0x9a04('0xb'),attributes,{'tableName':_0x9a04('0xc'),'paranoid':![],'indexes':[{'fields':[_0x9a04('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1e0c9cc..790a50b 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 _0xcf74=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','GetVoiceCallReport','stringify','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','lodash','moment'];(function(_0x1221eb,_0x5324be){var _0x39cc1b=function(_0x32a03b){while(--_0x32a03b){_0x1221eb['push'](_0x1221eb['shift']());}};_0x39cc1b(++_0x5324be);}(_0xcf74,0x76));var _0x4cf7=function(_0x2cee78,_0x3e5c4a){_0x2cee78=_0x2cee78-0x0;var _0x44b96f=_0xcf74[_0x2cee78];return _0x44b96f;};'use strict';var _=require(_0x4cf7('0x0'));var util=require('util');var moment=require(_0x4cf7('0x1'));var BPromise=require(_0x4cf7('0x2'));var rs=require(_0x4cf7('0x3'));var fs=require('fs');var Redis=require(_0x4cf7('0x4'));var db=require(_0x4cf7('0x5'))['db'];var utils=require(_0x4cf7('0x6'));var logger=require(_0x4cf7('0x7'))(_0x4cf7('0x8'));var config=require(_0x4cf7('0x9'));var jayson=require(_0x4cf7('0xa'));var client=jayson[_0x4cf7('0xb')][_0x4cf7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e50d4,_0x5f5b66,_0x471819){return new BPromise(function(_0x5026a6,_0x4ec6e1){return client[_0x4cf7('0xd')](_0x4e50d4,_0x471819)[_0x4cf7('0xe')](function(_0x51854b){logger['info'](_0x4cf7('0xf'),_0x5f5b66,_0x4cf7('0x10'));logger['debug'](_0x4cf7('0x11'),_0x5f5b66,_0x4cf7('0x10'),JSON['stringify'](_0x51854b));if(_0x51854b['error']){if(_0x51854b[_0x4cf7('0x12')][_0x4cf7('0x13')]===0x1f4){logger[_0x4cf7('0x12')](_0x4cf7('0xf'),_0x5f5b66,_0x51854b['error'][_0x4cf7('0x14')]);return _0x4ec6e1(_0x51854b[_0x4cf7('0x12')][_0x4cf7('0x14')]);}logger[_0x4cf7('0x12')](_0x4cf7('0xf'),_0x5f5b66,_0x51854b['error']['message']);return _0x5026a6(_0x51854b['error'][_0x4cf7('0x14')]);}else{logger[_0x4cf7('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x5f5b66,'request\x20sent');_0x5026a6(_0x51854b['result'][_0x4cf7('0x14')]);}})[_0x4cf7('0x16')](function(_0x17d554){logger[_0x4cf7('0x12')](_0x4cf7('0xf'),_0x5f5b66,_0x17d554);_0x4ec6e1(_0x17d554);});});}exports['GetVoiceCallReport']=function(_0x3f0b78){var _0x5b36c1=this;return new Promise(function(_0x5a75d6,_0x596e36){return db[_0x4cf7('0x17')][_0x4cf7('0x18')]({'raw':_0x3f0b78[_0x4cf7('0x19')]?_0x3f0b78[_0x4cf7('0x19')][_0x4cf7('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f0b78[_0x4cf7('0x19')]?_0x3f0b78[_0x4cf7('0x19')][_0x4cf7('0x1b')]||null:null,'attributes':_0x3f0b78[_0x4cf7('0x19')]?_0x3f0b78[_0x4cf7('0x19')][_0x4cf7('0x1c')]||null:null,'limit':_0x3f0b78[_0x4cf7('0x19')]?_0x3f0b78['options'][_0x4cf7('0x1d')]||null:null,'include':_0x3f0b78[_0x4cf7('0x19')]?_0x3f0b78['options']['include']?_['map'](_0x3f0b78[_0x4cf7('0x19')][_0x4cf7('0x1e')],function(_0x16d255){return{'model':db[_0x16d255[_0x4cf7('0x1f')]],'as':_0x16d255['as'],'attributes':_0x16d255[_0x4cf7('0x1c')],'include':_0x16d255[_0x4cf7('0x1e')]?_[_0x4cf7('0x20')](_0x16d255[_0x4cf7('0x1e')],function(_0x22bbc3){return{'model':db[_0x22bbc3[_0x4cf7('0x1f')]],'as':_0x22bbc3['as'],'attributes':_0x22bbc3[_0x4cf7('0x1c')],'include':_0x22bbc3['include']?_[_0x4cf7('0x20')](_0x22bbc3[_0x4cf7('0x1e')],function(_0x2aace0){return{'model':db[_0x2aace0[_0x4cf7('0x1f')]],'as':_0x2aace0['as'],'attributes':_0x2aace0['attributes']};}):[]};}):[]};}):[]:[]})[_0x4cf7('0xe')](function(_0x46e908){logger[_0x4cf7('0x15')]('GetVoiceCallReport',_0x3f0b78);logger['debug'](_0x4cf7('0x21'),_0x3f0b78,JSON[_0x4cf7('0x22')](_0x46e908));_0x5a75d6(_0x46e908);})[_0x4cf7('0x16')](function(_0x142f71){logger[_0x4cf7('0x12')]('GetVoiceCallReport',_0x142f71[_0x4cf7('0x14')],_0x3f0b78);_0x596e36(_0x5b36c1[_0x4cf7('0x12')](0x1f4,_0x142f71[_0x4cf7('0x14')]));});});};exports[_0x4cf7('0x23')]=function(_0x431b44){var _0x313708=this;return new Promise(function(_0x460bca,_0x37fac4){return db['VoiceCallReport'][_0x4cf7('0x24')](_0x431b44['body'],{'raw':_0x431b44[_0x4cf7('0x19')]?_0x431b44[_0x4cf7('0x19')][_0x4cf7('0x1a')]===undefined?!![]:![]:!![]})[_0x4cf7('0xe')](function(_0x262f42){logger['info'](_0x4cf7('0x23'),_0x431b44);logger['debug'](_0x4cf7('0x23'),_0x431b44,JSON[_0x4cf7('0x22')](_0x262f42));_0x460bca(_0x262f42);})[_0x4cf7('0x16')](function(_0xe9b9d8){logger[_0x4cf7('0x12')](_0x4cf7('0x23'),_0xe9b9d8[_0x4cf7('0x14')],_0x431b44);_0x37fac4(_0x313708['error'](0x1f4,_0xe9b9d8[_0x4cf7('0x14')]));});});};exports[_0x4cf7('0x25')]=function(_0x42256e){var _0xb5c3f4=this;return new Promise(function(_0x3625c8,_0x36a0f3){return db['VoiceCallReport'][_0x4cf7('0x26')](_0x42256e[_0x4cf7('0x27')],{'raw':_0x42256e[_0x4cf7('0x19')]?_0x42256e[_0x4cf7('0x19')][_0x4cf7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42256e['options']?_0x42256e[_0x4cf7('0x19')][_0x4cf7('0x1b')]||null:null,'attributes':_0x42256e[_0x4cf7('0x19')]?_0x42256e[_0x4cf7('0x19')][_0x4cf7('0x1c')]||null:null,'limit':_0x42256e[_0x4cf7('0x19')]?_0x42256e[_0x4cf7('0x19')][_0x4cf7('0x1d')]||null:null})[_0x4cf7('0xe')](function(_0x38872b){logger[_0x4cf7('0x15')]('UpdateVoiceCallReport',_0x42256e);logger['debug'](_0x4cf7('0x25'),_0x42256e,JSON[_0x4cf7('0x22')](_0x38872b));_0x3625c8(_0x38872b);})[_0x4cf7('0x16')](function(_0x5cc63c){logger[_0x4cf7('0x12')](_0x4cf7('0x25'),_0x5cc63c[_0x4cf7('0x14')],_0x42256e);_0x36a0f3(_0xb5c3f4[_0x4cf7('0x12')](0x1f4,_0x5cc63c['message']));});});}; \ No newline at end of file +var _0xf8d7=['findAll','options','raw','where','attributes','limit','model','include','map','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport'];(function(_0x2000fe,_0x286bb5){var _0x569732=function(_0x53255c){while(--_0x53255c){_0x2000fe['push'](_0x2000fe['shift']());}};_0x569732(++_0x286bb5);}(_0xf8d7,0x86));var _0x7f8d=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0xf8d7[_0x179b53];return _0x38a146;};'use strict';var _=require('lodash');var util=require(_0x7f8d('0x0'));var moment=require(_0x7f8d('0x1'));var BPromise=require(_0x7f8d('0x2'));var rs=require(_0x7f8d('0x3'));var fs=require('fs');var Redis=require(_0x7f8d('0x4'));var db=require(_0x7f8d('0x5'))['db'];var utils=require(_0x7f8d('0x6'));var logger=require(_0x7f8d('0x7'))(_0x7f8d('0x8'));var config=require('../../config/environment');var jayson=require(_0x7f8d('0x9'));var client=jayson[_0x7f8d('0xa')][_0x7f8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44b72e,_0x179e77,_0x5b4f4c){return new BPromise(function(_0x22adcb,_0x2e171a){return client['request'](_0x44b72e,_0x5b4f4c)[_0x7f8d('0xc')](function(_0xbc8a70){logger[_0x7f8d('0xd')](_0x7f8d('0xe'),_0x179e77,'request\x20sent');logger[_0x7f8d('0xf')](_0x7f8d('0x10'),_0x179e77,_0x7f8d('0x11'),JSON[_0x7f8d('0x12')](_0xbc8a70));if(_0xbc8a70[_0x7f8d('0x13')]){if(_0xbc8a70[_0x7f8d('0x13')][_0x7f8d('0x14')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x179e77,_0xbc8a70[_0x7f8d('0x13')][_0x7f8d('0x15')]);return _0x2e171a(_0xbc8a70['error'][_0x7f8d('0x15')]);}logger[_0x7f8d('0x13')](_0x7f8d('0xe'),_0x179e77,_0xbc8a70['error'][_0x7f8d('0x15')]);return _0x22adcb(_0xbc8a70[_0x7f8d('0x13')][_0x7f8d('0x15')]);}else{logger['info'](_0x7f8d('0xe'),_0x179e77,'request\x20sent');_0x22adcb(_0xbc8a70[_0x7f8d('0x16')]['message']);}})[_0x7f8d('0x17')](function(_0x5aeac9){logger[_0x7f8d('0x13')](_0x7f8d('0xe'),_0x179e77,_0x5aeac9);_0x2e171a(_0x5aeac9);});});}exports[_0x7f8d('0x18')]=function(_0x1e484a){var _0x2abaf1=this;return new Promise(function(_0x383231,_0x5c4cf9){return db[_0x7f8d('0x19')][_0x7f8d('0x1a')]({'raw':_0x1e484a['options']?_0x1e484a[_0x7f8d('0x1b')][_0x7f8d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e484a['options']?_0x1e484a[_0x7f8d('0x1b')][_0x7f8d('0x1d')]||null:null,'attributes':_0x1e484a[_0x7f8d('0x1b')]?_0x1e484a['options'][_0x7f8d('0x1e')]||null:null,'limit':_0x1e484a['options']?_0x1e484a['options'][_0x7f8d('0x1f')]||null:null,'include':_0x1e484a[_0x7f8d('0x1b')]?_0x1e484a[_0x7f8d('0x1b')]['include']?_['map'](_0x1e484a[_0x7f8d('0x1b')]['include'],function(_0x5e3ced){return{'model':db[_0x5e3ced[_0x7f8d('0x20')]],'as':_0x5e3ced['as'],'attributes':_0x5e3ced[_0x7f8d('0x1e')],'include':_0x5e3ced[_0x7f8d('0x21')]?_[_0x7f8d('0x22')](_0x5e3ced[_0x7f8d('0x21')],function(_0x5e4d8a){return{'model':db[_0x5e4d8a[_0x7f8d('0x20')]],'as':_0x5e4d8a['as'],'attributes':_0x5e4d8a[_0x7f8d('0x1e')],'include':_0x5e4d8a['include']?_[_0x7f8d('0x22')](_0x5e4d8a[_0x7f8d('0x21')],function(_0x254832){return{'model':db[_0x254832['model']],'as':_0x254832['as'],'attributes':_0x254832[_0x7f8d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14db78){logger['info']('GetVoiceCallReport',_0x1e484a);logger[_0x7f8d('0xf')](_0x7f8d('0x18'),_0x1e484a,JSON[_0x7f8d('0x12')](_0x14db78));_0x383231(_0x14db78);})[_0x7f8d('0x17')](function(_0x1a6df5){logger[_0x7f8d('0x13')]('GetVoiceCallReport',_0x1a6df5[_0x7f8d('0x15')],_0x1e484a);_0x5c4cf9(_0x2abaf1[_0x7f8d('0x13')](0x1f4,_0x1a6df5['message']));});});};exports[_0x7f8d('0x23')]=function(_0x2d0ec5){var _0x3c7e15=this;return new Promise(function(_0x482b93,_0x5d1fe8){return db[_0x7f8d('0x19')][_0x7f8d('0x24')](_0x2d0ec5[_0x7f8d('0x25')],{'raw':_0x2d0ec5['options']?_0x2d0ec5['options']['raw']===undefined?!![]:![]:!![]})[_0x7f8d('0xc')](function(_0x13b6b8){logger['info'](_0x7f8d('0x23'),_0x2d0ec5);logger[_0x7f8d('0xf')](_0x7f8d('0x23'),_0x2d0ec5,JSON[_0x7f8d('0x12')](_0x13b6b8));_0x482b93(_0x13b6b8);})['catch'](function(_0x3d5848){logger[_0x7f8d('0x13')](_0x7f8d('0x23'),_0x3d5848['message'],_0x2d0ec5);_0x5d1fe8(_0x3c7e15['error'](0x1f4,_0x3d5848[_0x7f8d('0x15')]));});});};exports[_0x7f8d('0x26')]=function(_0x408010){var _0x4f9f1b=this;return new Promise(function(_0x479d53,_0x27ccad){return db[_0x7f8d('0x19')][_0x7f8d('0x27')](_0x408010[_0x7f8d('0x25')],{'raw':_0x408010[_0x7f8d('0x1b')]?_0x408010[_0x7f8d('0x1b')][_0x7f8d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x408010['options']?_0x408010[_0x7f8d('0x1b')][_0x7f8d('0x1d')]||null:null,'attributes':_0x408010[_0x7f8d('0x1b')]?_0x408010[_0x7f8d('0x1b')]['attributes']||null:null,'limit':_0x408010[_0x7f8d('0x1b')]?_0x408010[_0x7f8d('0x1b')][_0x7f8d('0x1f')]||null:null})[_0x7f8d('0xc')](function(_0x336c17){logger[_0x7f8d('0xd')](_0x7f8d('0x26'),_0x408010);logger[_0x7f8d('0xf')](_0x7f8d('0x26'),_0x408010,JSON['stringify'](_0x336c17));_0x479d53(_0x336c17);})[_0x7f8d('0x17')](function(_0x4b42a4){logger[_0x7f8d('0x13')](_0x7f8d('0x26'),_0x4b42a4[_0x7f8d('0x15')],_0x408010);_0x27ccad(_0x4f9f1b[_0x7f8d('0x13')](0x1f4,_0x4b42a4[_0x7f8d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d8a36a6..8441f39 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 _0x22eb=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22eb,0x1cc));var _0xb22e=function(_0x4c473e,_0x3389ce){_0x4c473e=_0x4c473e-0x0;var _0x48e6f2=_0x22eb[_0x4c473e];return _0x48e6f2;};'use strict';var multer=require(_0xb22e('0x0'));var util=require(_0xb22e('0x1'));var path=require(_0xb22e('0x2'));var timeout=require(_0xb22e('0x3'));var express=require(_0xb22e('0x4'));var router=express[_0xb22e('0x5')]();var fs_extra=require(_0xb22e('0x6'));var auth=require(_0xb22e('0x7'));var interaction=require(_0xb22e('0x8'));var config=require('../../config/environment');var controller=require(_0xb22e('0x9'));router[_0xb22e('0xa')]('/',auth[_0xb22e('0xb')](),controller[_0xb22e('0xc')]);router[_0xb22e('0xa')](_0xb22e('0xd'),auth[_0xb22e('0xb')](),controller[_0xb22e('0xe')]);router[_0xb22e('0xf')]('/',auth[_0xb22e('0xb')](),controller['create']);router[_0xb22e('0x10')](_0xb22e('0xd'),auth[_0xb22e('0xb')](),controller[_0xb22e('0x11')]);router[_0xb22e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb22e('0x13')]);module[_0xb22e('0x14')]=router; \ No newline at end of file +var _0x561a=['/:id','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','put'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x561a,0x157));var _0xa561=function(_0x1432a6,_0x5846c5){_0x1432a6=_0x1432a6-0x0;var _0x3eab00=_0x561a[_0x1432a6];return _0x3eab00;};'use strict';var multer=require(_0xa561('0x0'));var util=require(_0xa561('0x1'));var path=require('path');var timeout=require(_0xa561('0x2'));var express=require(_0xa561('0x3'));var router=express[_0xa561('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa561('0x5'));var interaction=require(_0xa561('0x6'));var config=require(_0xa561('0x7'));var controller=require(_0xa561('0x8'));router[_0xa561('0x9')]('/',auth[_0xa561('0xa')](),controller[_0xa561('0xb')]);router[_0xa561('0x9')]('/:id',auth[_0xa561('0xa')](),controller[_0xa561('0xc')]);router['post']('/',auth[_0xa561('0xa')](),controller['create']);router[_0xa561('0xd')](_0xa561('0xe'),auth[_0xa561('0xa')](),controller[_0xa561('0xf')]);router[_0xa561('0x10')](_0xa561('0xe'),auth[_0xa561('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 4720044..c7e6e1c 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 _0x87c6=['exports','STRING','setDataValue','options','getDataValue','split','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87c6,0x67));var _0x687c=function(_0x575a6d,_0x290284){_0x575a6d=_0x575a6d-0x0;var _0x38212a=_0x87c6[_0x575a6d];return _0x38212a;};'use strict';var Sequelize=require(_0x687c('0x0'));module[_0x687c('0x1')]={'name':{'type':Sequelize[_0x687c('0x2')]},'prefix':{'type':Sequelize[_0x687c('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x687c('0x2')],'set':function(_0x2caa36){this[_0x687c('0x3')](_0x687c('0x4'),_0x2caa36?_0x2caa36['join'](''):[]);},'get':function(){return this[_0x687c('0x5')](_0x687c('0x4'))?this[_0x687c('0x5')](_0x687c('0x4'))[_0x687c('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x687c('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x687c('0x2')]},'description':{'type':Sequelize[_0x687c('0x2')]}}; \ No newline at end of file +var _0xdb6b=['setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb6b,0x15a));var _0xbdb6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdb6b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xbdb6('0x0'));module[_0xbdb6('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xbdb6('0x2')],'unique':_0xbdb6('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x41ed2f){this[_0xbdb6('0x4')](_0xbdb6('0x5'),_0x41ed2f?_0x41ed2f[_0xbdb6('0x6')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0xbdb6('0x7')](_0xbdb6('0x5'))[_0xbdb6('0x8')](''):[];}},'auth':{'type':Sequelize[_0xbdb6('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xbdb6('0x2')]},'record':{'type':Sequelize[_0xbdb6('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbdb6('0x2')]},'description':{'type':Sequelize[_0xbdb6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index f34aabf..c375813 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 _0x5d31=['merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','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/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','update','destroy','then','get','ChanSpies','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x423549,_0x242e63){var _0xdcb104=function(_0x6bff59){while(--_0x6bff59){_0x423549['push'](_0x423549['shift']());}};_0xdcb104(++_0x242e63);}(_0x5d31,0xb7));var _0x15d3=function(_0x1726e1,_0x1cc1f4){_0x1726e1=_0x1726e1-0x0;var _0x44eccc=_0x5d31[_0x1726e1];return _0x44eccc;};'use strict';var emlformat=require(_0x15d3('0x0'));var rimraf=require(_0x15d3('0x1'));var zipdir=require(_0x15d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15d3('0x3'));var moment=require(_0x15d3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x15d3('0x5'));var util=require('util');var path=require('path');var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require(_0x15d3('0x8'));var fs=require('fs');var fs_extra=require(_0x15d3('0x9'));var _=require(_0x15d3('0xa'));var squel=require(_0x15d3('0xb'));var crypto=require('crypto');var jsforce=require(_0x15d3('0xc'));var deskjs=require(_0x15d3('0xd'));var toCsv=require(_0x15d3('0x7'));var querystring=require('querystring');var Papa=require(_0x15d3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15d3('0xf'));var as=require(_0x15d3('0x10'));var hardwareService=require(_0x15d3('0x11'));var logger=require(_0x15d3('0x12'))(_0x15d3('0x13'));var utils=require(_0x15d3('0x14'));var config=require(_0x15d3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x15d3('0x16'))['db'];function respondWithStatusCode(_0xd6309a,_0x2b4409){_0x2b4409=_0x2b4409||0xcc;return function(_0x3721fc){if(_0x3721fc){return _0xd6309a[_0x15d3('0x17')](_0x2b4409);}return _0xd6309a[_0x15d3('0x18')](_0x2b4409)['end']();};}function respondWithResult(_0x25da22,_0x3ce80d){_0x3ce80d=_0x3ce80d||0xc8;return function(_0x466f82){if(_0x466f82){return _0x25da22['status'](_0x3ce80d)['json'](_0x466f82);}};}function respondWithFilteredResult(_0x1503cc,_0x5aa531){return function(_0x514875){if(_0x514875){var _0xcbfd71=typeof _0x5aa531[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x5aa531['limit']===_0x15d3('0x1a');var _0x121692=_0x514875[_0x15d3('0x1b')];var _0x42940f=_0xcbfd71?0x0:_0x5aa531[_0x15d3('0x19')];var _0x1778fd=_0xcbfd71?_0x514875[_0x15d3('0x1b')]:_0x5aa531['offset']+_0x5aa531[_0x15d3('0x1c')];var _0x3225a4;if(_0x1778fd>=_0x121692){_0x1778fd=_0x121692;_0x3225a4=0xc8;}else{_0x3225a4=0xce;}_0x1503cc[_0x15d3('0x18')](_0x3225a4);return _0x1503cc['set']('Content-Range',_0x42940f+'-'+_0x1778fd+'/'+_0x121692)[_0x15d3('0x1d')](_0x514875);}return null;};}function patchUpdates(_0x25cfdb){return function(_0x1d251e){try{jsonpatch[_0x15d3('0x1e')](_0x1d251e,_0x25cfdb,!![]);}catch(_0x148c40){return BPromise['reject'](_0x148c40);}return _0x1d251e['save']();};}function saveUpdates(_0x184236,_0x7c9603){return function(_0x28af7b){if(_0x28af7b){return _0x28af7b[_0x15d3('0x1f')](_0x184236)['then'](function(_0x1b7174){return _0x1b7174;});}return null;};}function removeEntity(_0x9eb2b5,_0x10ae1b){return function(_0x5178e1){if(_0x5178e1){return _0x5178e1[_0x15d3('0x20')]()[_0x15d3('0x21')](function(){var _0x3301c3=_0x5178e1[_0x15d3('0x22')]({'plain':!![]});var _0x426932=_0x15d3('0x23');return db[_0x15d3('0x24')][_0x15d3('0x20')]({'where':{'type':_0x426932,'resourceId':_0x3301c3['id']}})['then'](function(){return _0x5178e1;});})['then'](function(){_0x9eb2b5['status'](0xcc)[_0x15d3('0x25')]();});}};}function handleEntityNotFound(_0x5867fe,_0x57e2b9){return function(_0x2c8cee){if(!_0x2c8cee){_0x5867fe['sendStatus'](0x194);}return _0x2c8cee;};}function handleError(_0x44776a,_0x173194){_0x173194=_0x173194||0x1f4;return function(_0x1e895e){logger[_0x15d3('0x26')](_0x1e895e[_0x15d3('0x27')]);if(_0x1e895e[_0x15d3('0x28')]){delete _0x1e895e['name'];}_0x44776a[_0x15d3('0x18')](_0x173194)[_0x15d3('0x29')](_0x1e895e);};}exports['index']=function(_0x15a591,_0x1dfc0c){var _0x41e76a={},_0x48f790={},_0x462d15={'count':0x0,'rows':[]};var _0x4062e8=_[_0x15d3('0x2a')](db['VoiceChanSpy'][_0x15d3('0x2b')],function(_0x3841a0){return{'name':_0x3841a0[_0x15d3('0x2c')],'type':_0x3841a0[_0x15d3('0x2d')][_0x15d3('0x2e')]};});_0x48f790[_0x15d3('0x2f')]=_['map'](_0x4062e8,_0x15d3('0x28'));_0x48f790[_0x15d3('0x30')]=_['keys'](_0x15a591[_0x15d3('0x30')]);_0x48f790[_0x15d3('0x31')]=_[_0x15d3('0x32')](_0x48f790[_0x15d3('0x2f')],_0x48f790[_0x15d3('0x30')]);_0x41e76a['attributes']=_[_0x15d3('0x32')](_0x48f790[_0x15d3('0x2f')],qs[_0x15d3('0x33')](_0x15a591[_0x15d3('0x30')][_0x15d3('0x33')]));_0x41e76a['attributes']=_0x41e76a[_0x15d3('0x34')][_0x15d3('0x35')]?_0x41e76a[_0x15d3('0x34')]:_0x48f790[_0x15d3('0x2f')];if(!_0x15a591[_0x15d3('0x30')][_0x15d3('0x36')]('nolimit')){_0x41e76a[_0x15d3('0x1c')]=qs['limit'](_0x15a591[_0x15d3('0x30')][_0x15d3('0x1c')]);_0x41e76a[_0x15d3('0x19')]=qs[_0x15d3('0x19')](_0x15a591[_0x15d3('0x30')][_0x15d3('0x19')]);}_0x41e76a[_0x15d3('0x37')]=qs[_0x15d3('0x38')](_0x15a591[_0x15d3('0x30')][_0x15d3('0x38')]);_0x41e76a['where']=qs['filters'](_[_0x15d3('0x39')](_0x15a591[_0x15d3('0x30')],_0x48f790['filters']),_0x4062e8);if(_0x15a591[_0x15d3('0x30')][_0x15d3('0x3a')]){_0x41e76a[_0x15d3('0x3b')]=_[_0x15d3('0x3c')](_0x41e76a['where'],{'$or':_[_0x15d3('0x2a')](_0x4062e8,function(_0x3cf35b){if(_0x3cf35b[_0x15d3('0x2d')]!==_0x15d3('0x3d')){var _0x45b2d9={};_0x45b2d9[_0x3cf35b[_0x15d3('0x28')]]={'$like':'%'+_0x15a591[_0x15d3('0x30')][_0x15d3('0x3a')]+'%'};return _0x45b2d9;}})});}_0x41e76a=_['merge']({},_0x41e76a,_0x15a591[_0x15d3('0x3e')]);var _0x1fc1e4={'where':_0x41e76a[_0x15d3('0x3b')]};return db[_0x15d3('0x3f')][_0x15d3('0x1b')](_0x1fc1e4)['then'](function(_0x361fb5){_0x462d15[_0x15d3('0x1b')]=_0x361fb5;if(_0x15a591[_0x15d3('0x30')][_0x15d3('0x40')]){_0x41e76a[_0x15d3('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x15d3('0x42')](_0x41e76a);})[_0x15d3('0x21')](function(_0x409ebb){_0x462d15[_0x15d3('0x43')]=_0x409ebb;return _0x462d15;})[_0x15d3('0x21')](respondWithFilteredResult(_0x1dfc0c,_0x41e76a))[_0x15d3('0x44')](handleError(_0x1dfc0c,null));};exports[_0x15d3('0x45')]=function(_0x52551c,_0xa27d2e){var _0x2e7117={'raw':![],'where':{'id':_0x52551c[_0x15d3('0x46')]['id']}},_0x2386fa={};_0x2386fa[_0x15d3('0x2f')]=_[_0x15d3('0x47')](db['VoiceChanSpy'][_0x15d3('0x2b')]);_0x2386fa['query']=_[_0x15d3('0x47')](_0x52551c['query']);_0x2386fa['filters']=_[_0x15d3('0x32')](_0x2386fa[_0x15d3('0x2f')],_0x2386fa[_0x15d3('0x30')]);_0x2e7117['attributes']=_[_0x15d3('0x32')](_0x2386fa[_0x15d3('0x2f')],qs[_0x15d3('0x33')](_0x52551c[_0x15d3('0x30')][_0x15d3('0x33')]));_0x2e7117['attributes']=_0x2e7117[_0x15d3('0x34')][_0x15d3('0x35')]?_0x2e7117[_0x15d3('0x34')]:_0x2386fa[_0x15d3('0x2f')];if(_0x52551c[_0x15d3('0x30')]['includeAll']){_0x2e7117[_0x15d3('0x41')]=[{'all':!![]}];}_0x2e7117=_[_0x15d3('0x3c')]({},_0x2e7117,_0x52551c[_0x15d3('0x3e')]);return db[_0x15d3('0x3f')][_0x15d3('0x48')](_0x2e7117)['then'](handleEntityNotFound(_0xa27d2e,null))[_0x15d3('0x21')](respondWithResult(_0xa27d2e,null))[_0x15d3('0x44')](handleError(_0xa27d2e,null));};exports[_0x15d3('0x49')]=function(_0x239c03,_0x1105fa){return db[_0x15d3('0x3f')][_0x15d3('0x49')](_0x239c03[_0x15d3('0x4a')],{})[_0x15d3('0x21')](function(_0x43a122){var _0x58dd2d=_0x239c03[_0x15d3('0x4b')][_0x15d3('0x22')]({'plain':!![]});if(!_0x58dd2d)throw new Error(_0x15d3('0x4c'));if(_0x58dd2d[_0x15d3('0x4d')]===_0x15d3('0x4b')){var _0x28aa12=_0x43a122[_0x15d3('0x22')]({'plain':!![]});var _0x1c8546=_0x15d3('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1c8546,'userProfileId':_0x58dd2d[_0x15d3('0x4e')]},'raw':!![]})[_0x15d3('0x21')](function(_0x5bdd0f){if(_0x5bdd0f&&_0x5bdd0f[_0x15d3('0x4f')]===0x0){return db[_0x15d3('0x24')]['create']({'name':_0x28aa12[_0x15d3('0x28')],'resourceId':_0x28aa12['id'],'type':_0x5bdd0f['name'],'sectionId':_0x5bdd0f['id']},{})[_0x15d3('0x21')](function(){return _0x43a122;});}else{return _0x43a122;}})[_0x15d3('0x44')](function(_0x4b08f7){logger[_0x15d3('0x26')](_0x15d3('0x50'),_0x4b08f7);throw _0x4b08f7;});}return _0x43a122;})['then'](respondWithResult(_0x1105fa,0xc9))['catch'](handleError(_0x1105fa,null));};exports[_0x15d3('0x1f')]=function(_0x27d907,_0x5a4f01){if(_0x27d907[_0x15d3('0x4a')]['id']){delete _0x27d907[_0x15d3('0x4a')]['id'];}return db['VoiceChanSpy'][_0x15d3('0x48')]({'where':{'id':_0x27d907[_0x15d3('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a4f01,null))[_0x15d3('0x21')](saveUpdates(_0x27d907[_0x15d3('0x4a')],null))[_0x15d3('0x21')](respondWithResult(_0x5a4f01,null))[_0x15d3('0x44')](handleError(_0x5a4f01,null));};exports[_0x15d3('0x20')]=function(_0x4832d1,_0x85f13){return db[_0x15d3('0x3f')][_0x15d3('0x48')]({'where':{'id':_0x4832d1[_0x15d3('0x46')]['id']}})['then'](handleEntityNotFound(_0x85f13,null))[_0x15d3('0x21')](removeEntity(_0x85f13,null))[_0x15d3('0x44')](handleError(_0x85f13,null));}; \ No newline at end of file +var _0x3ef0=['findAll','rows','catch','show','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x22f9c0,_0x35410c){var _0x1883fe=function(_0x5a5601){while(--_0x5a5601){_0x22f9c0['push'](_0x22f9c0['shift']());}};_0x1883fe(++_0x35410c);}(_0x3ef0,0x19a));var _0x03ef=function(_0x38de04,_0x535552){_0x38de04=_0x38de04-0x0;var _0x57c01e=_0x3ef0[_0x38de04];return _0x57c01e;};'use strict';var emlformat=require(_0x03ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ef('0x2'));var moment=require('moment');var BPromise=require(_0x03ef('0x3'));var Mustache=require(_0x03ef('0x4'));var util=require(_0x03ef('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x03ef('0x6'));var ejs=require(_0x03ef('0x7'));var fs=require('fs');var fs_extra=require(_0x03ef('0x8'));var _=require('lodash');var squel=require(_0x03ef('0x9'));var crypto=require(_0x03ef('0xa'));var jsforce=require(_0x03ef('0xb'));var deskjs=require(_0x03ef('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03ef('0xd'));var Redis=require(_0x03ef('0xe'));var authService=require(_0x03ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03ef('0x10'));var hardwareService=require(_0x03ef('0x11'));var logger=require('../../config/logger')(_0x03ef('0x12'));var utils=require(_0x03ef('0x13'));var config=require(_0x03ef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ef('0x15'))['db'];function respondWithStatusCode(_0x8f3fb,_0x390cc2){_0x390cc2=_0x390cc2||0xcc;return function(_0x1e138e){if(_0x1e138e){return _0x8f3fb[_0x03ef('0x16')](_0x390cc2);}return _0x8f3fb[_0x03ef('0x17')](_0x390cc2)[_0x03ef('0x18')]();};}function respondWithResult(_0x39ed69,_0x1702a0){_0x1702a0=_0x1702a0||0xc8;return function(_0x3390ae){if(_0x3390ae){return _0x39ed69[_0x03ef('0x17')](_0x1702a0)['json'](_0x3390ae);}};}function respondWithFilteredResult(_0x531025,_0x16282b){return function(_0x17b6ec){if(_0x17b6ec){var _0x1a0113=typeof _0x16282b[_0x03ef('0x19')]===_0x03ef('0x1a')&&typeof _0x16282b['limit']==='undefined';var _0x343bf0=_0x17b6ec[_0x03ef('0x1b')];var _0x501d87=_0x1a0113?0x0:_0x16282b['offset'];var _0x277f0d=_0x1a0113?_0x17b6ec[_0x03ef('0x1b')]:_0x16282b[_0x03ef('0x19')]+_0x16282b[_0x03ef('0x1c')];var _0x1776d8;if(_0x277f0d>=_0x343bf0){_0x277f0d=_0x343bf0;_0x1776d8=0xc8;}else{_0x1776d8=0xce;}_0x531025['status'](_0x1776d8);return _0x531025[_0x03ef('0x1d')](_0x03ef('0x1e'),_0x501d87+'-'+_0x277f0d+'/'+_0x343bf0)['json'](_0x17b6ec);}return null;};}function patchUpdates(_0xb663d){return function(_0x39f693){try{jsonpatch[_0x03ef('0x1f')](_0x39f693,_0xb663d,!![]);}catch(_0xde0e02){return BPromise[_0x03ef('0x20')](_0xde0e02);}return _0x39f693['save']();};}function saveUpdates(_0x5cddb6,_0x41d7d7){return function(_0x5d56e1){if(_0x5d56e1){return _0x5d56e1[_0x03ef('0x21')](_0x5cddb6)['then'](function(_0x5c1a36){return _0x5c1a36;});}return null;};}function removeEntity(_0x13b033,_0x27ac0d){return function(_0x5efaf0){if(_0x5efaf0){return _0x5efaf0['destroy']()[_0x03ef('0x22')](function(){var _0x38a7c5=_0x5efaf0['get']({'plain':!![]});var _0x305829=_0x03ef('0x23');return db[_0x03ef('0x24')]['destroy']({'where':{'type':_0x305829,'resourceId':_0x38a7c5['id']}})[_0x03ef('0x22')](function(){return _0x5efaf0;});})[_0x03ef('0x22')](function(){_0x13b033[_0x03ef('0x17')](0xcc)[_0x03ef('0x18')]();});}};}function handleEntityNotFound(_0x1d1a51,_0x1b766b){return function(_0x538a5d){if(!_0x538a5d){_0x1d1a51['sendStatus'](0x194);}return _0x538a5d;};}function handleError(_0x29c965,_0x5a2bd5){_0x5a2bd5=_0x5a2bd5||0x1f4;return function(_0x39f762){logger[_0x03ef('0x25')](_0x39f762[_0x03ef('0x26')]);if(_0x39f762['name']){delete _0x39f762[_0x03ef('0x27')];}_0x29c965[_0x03ef('0x17')](_0x5a2bd5)[_0x03ef('0x28')](_0x39f762);};}exports[_0x03ef('0x29')]=function(_0x53658c,_0x4711df){var _0x2cd00c={},_0xf38b61={},_0x154c6f={'count':0x0,'rows':[]};var _0x54c07e=_[_0x03ef('0x2a')](db[_0x03ef('0x2b')][_0x03ef('0x2c')],function(_0x4ba338){return{'name':_0x4ba338[_0x03ef('0x2d')],'type':_0x4ba338[_0x03ef('0x2e')][_0x03ef('0x2f')]};});_0xf38b61[_0x03ef('0x30')]=_[_0x03ef('0x2a')](_0x54c07e,'name');_0xf38b61[_0x03ef('0x31')]=_[_0x03ef('0x32')](_0x53658c[_0x03ef('0x31')]);_0xf38b61[_0x03ef('0x33')]=_[_0x03ef('0x34')](_0xf38b61['model'],_0xf38b61[_0x03ef('0x31')]);_0x2cd00c[_0x03ef('0x35')]=_[_0x03ef('0x34')](_0xf38b61[_0x03ef('0x30')],qs[_0x03ef('0x36')](_0x53658c['query']['fields']));_0x2cd00c[_0x03ef('0x35')]=_0x2cd00c[_0x03ef('0x35')]['length']?_0x2cd00c[_0x03ef('0x35')]:_0xf38b61['model'];if(!_0x53658c[_0x03ef('0x31')][_0x03ef('0x37')]('nolimit')){_0x2cd00c[_0x03ef('0x1c')]=qs['limit'](_0x53658c[_0x03ef('0x31')][_0x03ef('0x1c')]);_0x2cd00c['offset']=qs['offset'](_0x53658c[_0x03ef('0x31')][_0x03ef('0x19')]);}_0x2cd00c['order']=qs[_0x03ef('0x38')](_0x53658c[_0x03ef('0x31')][_0x03ef('0x38')]);_0x2cd00c[_0x03ef('0x39')]=qs[_0x03ef('0x33')](_[_0x03ef('0x3a')](_0x53658c[_0x03ef('0x31')],_0xf38b61[_0x03ef('0x33')]),_0x54c07e);if(_0x53658c['query'][_0x03ef('0x3b')]){_0x2cd00c[_0x03ef('0x39')]=_[_0x03ef('0x3c')](_0x2cd00c['where'],{'$or':_[_0x03ef('0x2a')](_0x54c07e,function(_0x473dfe){if(_0x473dfe[_0x03ef('0x2e')]!==_0x03ef('0x3d')){var _0x4b2f62={};_0x4b2f62[_0x473dfe[_0x03ef('0x27')]]={'$like':'%'+_0x53658c[_0x03ef('0x31')][_0x03ef('0x3b')]+'%'};return _0x4b2f62;}})});}_0x2cd00c=_[_0x03ef('0x3c')]({},_0x2cd00c,_0x53658c['options']);var _0x286555={'where':_0x2cd00c[_0x03ef('0x39')]};return db[_0x03ef('0x2b')][_0x03ef('0x1b')](_0x286555)[_0x03ef('0x22')](function(_0x177e8b){_0x154c6f[_0x03ef('0x1b')]=_0x177e8b;if(_0x53658c[_0x03ef('0x31')][_0x03ef('0x3e')]){_0x2cd00c[_0x03ef('0x3f')]=[{'all':!![]}];}return db[_0x03ef('0x2b')][_0x03ef('0x40')](_0x2cd00c);})[_0x03ef('0x22')](function(_0x8f7f42){_0x154c6f[_0x03ef('0x41')]=_0x8f7f42;return _0x154c6f;})[_0x03ef('0x22')](respondWithFilteredResult(_0x4711df,_0x2cd00c))[_0x03ef('0x42')](handleError(_0x4711df,null));};exports[_0x03ef('0x43')]=function(_0x1152d3,_0xd37ba6){var _0x3f5a8b={'raw':![],'where':{'id':_0x1152d3['params']['id']}},_0xeaffb0={};_0xeaffb0[_0x03ef('0x30')]=_[_0x03ef('0x32')](db[_0x03ef('0x2b')][_0x03ef('0x2c')]);_0xeaffb0[_0x03ef('0x31')]=_[_0x03ef('0x32')](_0x1152d3[_0x03ef('0x31')]);_0xeaffb0[_0x03ef('0x33')]=_[_0x03ef('0x34')](_0xeaffb0[_0x03ef('0x30')],_0xeaffb0[_0x03ef('0x31')]);_0x3f5a8b[_0x03ef('0x35')]=_['intersection'](_0xeaffb0[_0x03ef('0x30')],qs[_0x03ef('0x36')](_0x1152d3['query'][_0x03ef('0x36')]));_0x3f5a8b[_0x03ef('0x35')]=_0x3f5a8b['attributes'][_0x03ef('0x44')]?_0x3f5a8b[_0x03ef('0x35')]:_0xeaffb0[_0x03ef('0x30')];if(_0x1152d3['query'][_0x03ef('0x3e')]){_0x3f5a8b[_0x03ef('0x3f')]=[{'all':!![]}];}_0x3f5a8b=_['merge']({},_0x3f5a8b,_0x1152d3['options']);return db[_0x03ef('0x2b')][_0x03ef('0x45')](_0x3f5a8b)[_0x03ef('0x22')](handleEntityNotFound(_0xd37ba6,null))[_0x03ef('0x22')](respondWithResult(_0xd37ba6,null))[_0x03ef('0x42')](handleError(_0xd37ba6,null));};exports[_0x03ef('0x46')]=function(_0x27c6ca,_0x2e3145){return db[_0x03ef('0x2b')]['create'](_0x27c6ca[_0x03ef('0x47')],{})['then'](function(_0x83afeb){var _0x159f2f=_0x27c6ca['user'][_0x03ef('0x48')]({'plain':!![]});if(!_0x159f2f)throw new Error(_0x03ef('0x49'));if(_0x159f2f[_0x03ef('0x4a')]===_0x03ef('0x4b')){var _0x390483=_0x83afeb['get']({'plain':!![]});var _0x1b7e2f=_0x03ef('0x23');return db['UserProfileSection'][_0x03ef('0x45')]({'where':{'name':_0x1b7e2f,'userProfileId':_0x159f2f[_0x03ef('0x4c')]},'raw':!![]})['then'](function(_0x6efa41){if(_0x6efa41&&_0x6efa41['autoAssociation']===0x0){return db['UserProfileResource'][_0x03ef('0x46')]({'name':_0x390483[_0x03ef('0x27')],'resourceId':_0x390483['id'],'type':_0x6efa41['name'],'sectionId':_0x6efa41['id']},{})['then'](function(){return _0x83afeb;});}else{return _0x83afeb;}})[_0x03ef('0x42')](function(_0x5a5533){logger[_0x03ef('0x25')](_0x03ef('0x4d'),_0x5a5533);throw _0x5a5533;});}return _0x83afeb;})[_0x03ef('0x22')](respondWithResult(_0x2e3145,0xc9))[_0x03ef('0x42')](handleError(_0x2e3145,null));};exports[_0x03ef('0x21')]=function(_0x492b1d,_0x45723f){if(_0x492b1d['body']['id']){delete _0x492b1d[_0x03ef('0x47')]['id'];}return db[_0x03ef('0x2b')][_0x03ef('0x45')]({'where':{'id':_0x492b1d[_0x03ef('0x4e')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x45723f,null))[_0x03ef('0x22')](saveUpdates(_0x492b1d[_0x03ef('0x47')],null))[_0x03ef('0x22')](respondWithResult(_0x45723f,null))[_0x03ef('0x42')](handleError(_0x45723f,null));};exports['destroy']=function(_0x5b46a8,_0x152bb5){return db[_0x03ef('0x2b')][_0x03ef('0x45')]({'where':{'id':_0x5b46a8[_0x03ef('0x4e')]['id']}})['then'](handleEntityNotFound(_0x152bb5,null))[_0x03ef('0x22')](removeEntity(_0x152bb5,null))[_0x03ef('0x42')](handleError(_0x152bb5,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 58207a5..c305e5c 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 _0xa650=['merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','bluebird','context','from-sip','format','%s%s','prefix','system','push'];(function(_0x26fc81,_0x31705b){var _0x3cd54d=function(_0x2e2706){while(--_0x2e2706){_0x26fc81['push'](_0x26fc81['shift']());}};_0x3cd54d(++_0x31705b);}(_0xa650,0x69));var _0x0a65=function(_0x30c2af,_0x33a2fc){_0x30c2af=_0x30c2af-0x0;var _0x3bd21b=_0xa650[_0x30c2af];return _0x3bd21b;};'use strict';var _=require(_0x0a65('0x0'));var util=require('util');var BPromise=require(_0x0a65('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0xf85c73,_0x191160,_0x3b6795){var _0x4ccdf9=0x1;var _0x1d7d48=[];var _0x3060bc={'context':_0x191160[_0x0a65('0x2')]||_0x0a65('0x3'),'exten':util[_0x0a65('0x4')](_0x0a65('0x5'),_0xf85c73[_0x0a65('0x6')],_0x3b6795),'type':_0x0a65('0x7'),'isApp':![],'ChanSpyId':_0xf85c73['id'],'UserId':_0x191160['id']};_0x1d7d48[_0x0a65('0x8')](_[_0x0a65('0x9')]({'app':_0x0a65('0xa'),'appdata':util['format']('CDR(type)=%s',_0x0a65('0xb')),'priority':_0x4ccdf9++},_0x3060bc));if(_0xf85c73[_0x0a65('0xc')]){_0x1d7d48['push'](_[_0x0a65('0x9')]({'app':_0x0a65('0xd'),'appdata':util['format'](_0x0a65('0xe'),_0xf85c73['recordingFormat']),'priority':_0x4ccdf9++},_0x3060bc));}if(_0xf85c73['auth']){_0x1d7d48[_0x0a65('0x8')](_['merge']({'app':_0x0a65('0xf'),'appdata':_0xf85c73[_0x0a65('0x10')],'priority':_0x4ccdf9++},_0x3060bc));}_0x1d7d48[_0x0a65('0x8')](_[_0x0a65('0x9')]({'app':_0x0a65('0x11'),'appdata':util['format'](_0x0a65('0x12'),_0x191160[_0x0a65('0x13')],_0xf85c73['options']?_0xf85c73[_0x0a65('0x14')][_0x0a65('0x15')](''):''),'priority':_0x4ccdf9++},_0x3060bc));if(_0xf85c73[_0x0a65('0xc')]){_0x1d7d48[_0x0a65('0x8')](_['merge']({'app':_0x0a65('0x16'),'priority':_0x4ccdf9++},_0x3060bc));}return _0x1d7d48;};var getChanSpyApplications=function(_0x130f2e,_0x28d975){var _0x2abd4b=[];for(var _0x1a067f=0x0,_0x2195c0=0x1;_0x1a067f<_0x28d975[_0x0a65('0x17')];_0x1a067f++,_0x2195c0=0x1){_0x2abd4b=_0x2abd4b[_0x0a65('0x18')](getUserApplications(_0x130f2e,_0x28d975[_0x1a067f],_0x28d975[_0x1a067f][_0x0a65('0x19')]));if(_0x28d975[_0x1a067f]['internal']!=_0x28d975[_0x1a067f][_0x0a65('0x13')]){_0x2abd4b=_0x2abd4b[_0x0a65('0x18')](getUserApplications(_0x130f2e,_0x28d975[_0x1a067f],_0x28d975[_0x1a067f][_0x0a65('0x13')]));}}return _0x2abd4b;};var getChanSpyPromise=function(_0x220509,_0x1a3754){return new BPromise(function(_0x441da7,_0xd39116){return _0x220509[_0x0a65('0x1a')][_0x0a65('0x1b')]({'attributes':['id','name',_0x0a65('0x19')],'where':{'role':_0x0a65('0x1c'),'chanspy':!![]},'raw':!![]})[_0x0a65('0x1d')](function(_0x3917a4){if(_0x3917a4){return _0x441da7(getChanSpyApplications(_0x1a3754,_0x3917a4));}return _0x441da7([]);})[_0x0a65('0x1e')](function(_0x285676){_0xd39116(_0x285676);});});};module[_0x0a65('0x1f')]=function(_0xfadbb7,_0x40a12c){var _0x107618=_0xfadbb7[_0x0a65('0x20')];return _0xfadbb7[_0x0a65('0x21')]('VoiceChanSpy',attributes,{'tableName':_0x0a65('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c7893,_0x335dce,_0x1af792){return getChanSpyPromise(_0x107618,_0x1c7893)[_0x0a65('0x1d')](function(_0x2a0061){if(_0x2a0061&&_0x2a0061[_0x0a65('0x17')]){return _0x107618['VoiceExtension'][_0x0a65('0x23')](_0x2a0061);}})[_0x0a65('0x1d')](function(){_0x1af792();})[_0x0a65('0x1e')](function(_0x107177){_0x1af792(_0x107177);});},'afterUpdate':function(_0x339d84,_0x376642,_0x56df6e){return _0x107618[_0x0a65('0x24')][_0x0a65('0x25')]({'where':{'ChanSpyId':_0x339d84['id']}})[_0x0a65('0x1d')](function(){return getChanSpyPromise(_0x107618,_0x339d84);})[_0x0a65('0x1d')](function(_0x49b610){if(_0x49b610&&_0x49b610[_0x0a65('0x17')]){return _0x107618[_0x0a65('0x24')][_0x0a65('0x23')](_0x49b610);}})[_0x0a65('0x1d')](function(){_0x56df6e();})[_0x0a65('0x1e')](function(_0x4d6382){_0x56df6e(_0x4d6382);});},'afterDestroy':function(_0x315d85,_0x5d8345,_0x5de75a){return _0x107618[_0x0a65('0x24')][_0x0a65('0x25')]({'where':{'ChanSpyId':_0x315d85['id']}})[_0x0a65('0x1d')](function(){_0x5de75a();})[_0x0a65('0x1e')](function(_0x46bd63){_0x5de75a(_0x46bd63);});}}});}; \ No newline at end of file +var _0xbcda=['./voiceChanSpy.attributes','context','%s%s','system','push','merge','format','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','record','StopMixMonitor','length','concat','internal','User','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','lodash','util','bluebird'];(function(_0x3d3575,_0x50b3ab){var _0x482b9f=function(_0x5581e7){while(--_0x5581e7){_0x3d3575['push'](_0x3d3575['shift']());}};_0x482b9f(++_0x50b3ab);}(_0xbcda,0x1e7));var _0xabcd=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xbcda[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xabcd('0x0'));var util=require(_0xabcd('0x1'));var BPromise=require(_0xabcd('0x2'));var attributes=require(_0xabcd('0x3'));var getUserApplications=function(_0x186fb3,_0x590e49,_0x21a7d3){var _0x1586e5=0x1;var _0x3b21e1=[];var _0x524e0a={'context':_0x590e49[_0xabcd('0x4')]||'from-sip','exten':util['format'](_0xabcd('0x5'),_0x186fb3['prefix'],_0x21a7d3),'type':_0xabcd('0x6'),'isApp':![],'ChanSpyId':_0x186fb3['id'],'UserId':_0x590e49['id']};_0x3b21e1[_0xabcd('0x7')](_[_0xabcd('0x8')]({'app':'Set','appdata':util[_0xabcd('0x9')]('CDR(type)=%s',_0xabcd('0xa')),'priority':_0x1586e5++},_0x524e0a));if(_0x186fb3['record']){_0x3b21e1[_0xabcd('0x7')](_[_0xabcd('0x8')]({'app':_0xabcd('0xb'),'appdata':util[_0xabcd('0x9')](_0xabcd('0xc'),_0x186fb3[_0xabcd('0xd')]),'priority':_0x1586e5++},_0x524e0a));}if(_0x186fb3[_0xabcd('0xe')]){_0x3b21e1[_0xabcd('0x7')](_[_0xabcd('0x8')]({'app':_0xabcd('0xf'),'appdata':_0x186fb3[_0xabcd('0x10')],'priority':_0x1586e5++},_0x524e0a));}_0x3b21e1[_0xabcd('0x7')](_[_0xabcd('0x8')]({'app':'ChanSpy','appdata':util[_0xabcd('0x9')](_0xabcd('0x11'),_0x590e49[_0xabcd('0x12')],_0x186fb3[_0xabcd('0x13')]?_0x186fb3[_0xabcd('0x13')]['join'](''):''),'priority':_0x1586e5++},_0x524e0a));if(_0x186fb3[_0xabcd('0x14')]){_0x3b21e1['push'](_[_0xabcd('0x8')]({'app':_0xabcd('0x15'),'priority':_0x1586e5++},_0x524e0a));}return _0x3b21e1;};var getChanSpyApplications=function(_0x5c4caa,_0x5b5fc1){var _0x166dbb=[];for(var _0x2d144c=0x0,_0x3b9fc2=0x1;_0x2d144c<_0x5b5fc1[_0xabcd('0x16')];_0x2d144c++,_0x3b9fc2=0x1){_0x166dbb=_0x166dbb[_0xabcd('0x17')](getUserApplications(_0x5c4caa,_0x5b5fc1[_0x2d144c],_0x5b5fc1[_0x2d144c][_0xabcd('0x18')]));if(_0x5b5fc1[_0x2d144c][_0xabcd('0x18')]!=_0x5b5fc1[_0x2d144c][_0xabcd('0x12')]){_0x166dbb=_0x166dbb[_0xabcd('0x17')](getUserApplications(_0x5c4caa,_0x5b5fc1[_0x2d144c],_0x5b5fc1[_0x2d144c][_0xabcd('0x12')]));}}return _0x166dbb;};var getChanSpyPromise=function(_0x175c83,_0x4bc1f3){return new BPromise(function(_0x2364de,_0x48d31f){return _0x175c83[_0xabcd('0x19')]['findAll']({'attributes':['id',_0xabcd('0x12'),_0xabcd('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xabcd('0x1a')](function(_0x35c307){if(_0x35c307){return _0x2364de(getChanSpyApplications(_0x4bc1f3,_0x35c307));}return _0x2364de([]);})[_0xabcd('0x1b')](function(_0x59e337){_0x48d31f(_0x59e337);});});};module[_0xabcd('0x1c')]=function(_0x13d466,_0x101abe){var _0x35024d=_0x13d466[_0xabcd('0x1d')];return _0x13d466[_0xabcd('0x1e')](_0xabcd('0x1f'),attributes,{'tableName':_0xabcd('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b9fc8,_0x86092e,_0x39eb16){return getChanSpyPromise(_0x35024d,_0x2b9fc8)[_0xabcd('0x1a')](function(_0x3ada88){if(_0x3ada88&&_0x3ada88[_0xabcd('0x16')]){return _0x35024d['VoiceExtension'][_0xabcd('0x21')](_0x3ada88);}})[_0xabcd('0x1a')](function(){_0x39eb16();})[_0xabcd('0x1b')](function(_0x2b138b){_0x39eb16(_0x2b138b);});},'afterUpdate':function(_0x387fc2,_0x4e3271,_0x4e5927){return _0x35024d[_0xabcd('0x22')]['destroy']({'where':{'ChanSpyId':_0x387fc2['id']}})[_0xabcd('0x1a')](function(){return getChanSpyPromise(_0x35024d,_0x387fc2);})[_0xabcd('0x1a')](function(_0x28a4d7){if(_0x28a4d7&&_0x28a4d7['length']){return _0x35024d[_0xabcd('0x22')][_0xabcd('0x21')](_0x28a4d7);}})[_0xabcd('0x1a')](function(){_0x4e5927();})[_0xabcd('0x1b')](function(_0x578782){_0x4e5927(_0x578782);});},'afterDestroy':function(_0x25c3b6,_0x7f07ba,_0x51045c){return _0x35024d[_0xabcd('0x22')]['destroy']({'where':{'ChanSpyId':_0x25c3b6['id']}})[_0xabcd('0x1a')](function(){_0x51045c();})[_0xabcd('0x1b')](function(_0x37fb3e){_0x51045c(_0x37fb3e);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 0d0bc59..5616107 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 _0x878f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x57618b,_0x312845){var _0x48e7ca=function(_0x5d2a16){while(--_0x5d2a16){_0x57618b['push'](_0x57618b['shift']());}};_0x48e7ca(++_0x312845);}(_0x878f,0x173));var _0xf878=function(_0x5e0786,_0x14117e){_0x5e0786=_0x5e0786-0x0;var _0x4cff34=_0x878f[_0x5e0786];return _0x4cff34;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5f5c,_0x62b420,_0x59e564){return new BPromise(function(_0x52851e,_0x530767){return client[_0xf878('0xb')](_0x3c5f5c,_0x59e564)['then'](function(_0x4a9d79){logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));logger['debug'](_0xf878('0xf'),_0x62b420,_0xf878('0xe'),JSON['stringify'](_0x4a9d79));if(_0x4a9d79[_0xf878('0x10')]){if(_0x4a9d79['error'][_0xf878('0x11')]===0x1f4){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x4a9d79['error'][_0xf878('0x12')]);return _0x530767(_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);}logger['error'](_0xf878('0xd'),_0x62b420,_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);return _0x52851e(_0x4a9d79['error']['message']);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));_0x52851e(_0x4a9d79[_0xf878('0x13')][_0xf878('0x12')]);}})[_0xf878('0x14')](function(_0x415056){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x415056);_0x530767(_0x415056);});});} \ No newline at end of file +var _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x147c7a,_0x455a08){var _0x58fe0d=function(_0x37d2b8){while(--_0x37d2b8){_0x147c7a['push'](_0x147c7a['shift']());}};_0x58fe0d(++_0x455a08);}(_0x702d,0x147));var _0xd702=function(_0x4e9484,_0x1acc3f){_0x4e9484=_0x4e9484-0x0;var _0x5a1533=_0x702d[_0x4e9484];return _0x5a1533;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 552f191..d0a2ce8 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 _0x52ab=['express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','/:id','show','post','create','put','update','exports','util','path'];(function(_0x72800e,_0x13db4f){var _0x55f6ce=function(_0x3f8ffd){while(--_0x3f8ffd){_0x72800e['push'](_0x72800e['shift']());}};_0x55f6ce(++_0x13db4f);}(_0x52ab,0xfd));var _0xb52a=function(_0x42f075,_0x1bd525){_0x42f075=_0x42f075-0x0;var _0x532c33=_0x52ab[_0x42f075];return _0x532c33;};'use strict';var multer=require('multer');var util=require(_0xb52a('0x0'));var path=require(_0xb52a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb52a('0x2'));var router=express[_0xb52a('0x3')]();var fs_extra=require(_0xb52a('0x4'));var auth=require(_0xb52a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth[_0xb52a('0x6')](),controller[_0xb52a('0x7')]);router['get'](_0xb52a('0x8'),auth[_0xb52a('0x6')](),controller[_0xb52a('0x9')]);router[_0xb52a('0xa')]('/',auth[_0xb52a('0x6')](),controller[_0xb52a('0xb')]);router[_0xb52a('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xb52a('0xd')]);router['delete'](_0xb52a('0x8'),auth[_0xb52a('0x6')](),controller['destroy']);module[_0xb52a('0xe')]=router; \ No newline at end of file +var _0x1a55=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','index'];(function(_0x2c7fb4,_0x31f52b){var _0x22ea18=function(_0x5a8457){while(--_0x5a8457){_0x2c7fb4['push'](_0x2c7fb4['shift']());}};_0x22ea18(++_0x31f52b);}(_0x1a55,0x160));var _0x51a5=function(_0x4950ff,_0x1111e6){_0x4950ff=_0x4950ff-0x0;var _0x426b9d=_0x1a55[_0x4950ff];return _0x426b9d;};'use strict';var multer=require('multer');var util=require(_0x51a5('0x0'));var path=require('path');var timeout=require(_0x51a5('0x1'));var express=require('express');var router=express[_0x51a5('0x2')]();var fs_extra=require(_0x51a5('0x3'));var auth=require(_0x51a5('0x4'));var interaction=require(_0x51a5('0x5'));var config=require(_0x51a5('0x6'));var controller=require(_0x51a5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x51a5('0x8')]);router[_0x51a5('0x9')](_0x51a5('0xa'),auth[_0x51a5('0xb')](),controller[_0x51a5('0xc')]);router[_0x51a5('0xd')]('/',auth['isAuthenticated'](),controller[_0x51a5('0xe')]);router[_0x51a5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x51a5('0x10')]);router[_0x51a5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x51a5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index bacf7b8..257ddf9 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 _0xbe1c=['sequelize','exports','STRING','name'];(function(_0x3c977e,_0x3767ee){var _0x543a88=function(_0x17884b){while(--_0x17884b){_0x3c977e['push'](_0x3c977e['shift']());}};_0x543a88(++_0x3767ee);}(_0xbe1c,0x188));var _0xcbe1=function(_0x3a4b7f,_0x5b9726){_0x3a4b7f=_0x3a4b7f-0x0;var _0x542e8a=_0xbe1c[_0x3a4b7f];return _0x542e8a;};'use strict';var Sequelize=require(_0xcbe1('0x0'));module[_0xcbe1('0x1')]={'name':{'type':Sequelize[_0xcbe1('0x2')],'unique':_0xcbe1('0x3')},'description':{'type':Sequelize[_0xcbe1('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x09bf=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4c65f2,_0x50f860){var _0x2c97e2=function(_0x442a24){while(--_0x442a24){_0x4c65f2['push'](_0x4c65f2['shift']());}};_0x2c97e2(++_0x50f860);}(_0x09bf,0x80));var _0xf09b=function(_0x370bbf,_0x3d3175){_0x370bbf=_0x370bbf-0x0;var _0x13ea0b=_0x09bf[_0x370bbf];return _0x13ea0b;};'use strict';var Sequelize=require(_0xf09b('0x0'));module[_0xf09b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xf09b('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf09b('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index e9253b2..a897a97 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 _0x1c79=['api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Contexts','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','model','intersection','fields','attributes','length','nolimit','order','filters','pick','filter','merge','where','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','show','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','root','writeFileSync','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x3b43b2,_0x2fea89){var _0x1e8ead=function(_0x1f6220){while(--_0x1f6220){_0x3b43b2['push'](_0x3b43b2['shift']());}};_0x1e8ead(++_0x2fea89);}(_0x1c79,0x196));var _0x91c7=function(_0x8106c4,_0x2800ad){_0x8106c4=_0x8106c4-0x0;var _0x59a36e=_0x1c79[_0x8106c4];return _0x59a36e;};'use strict';var emlformat=require(_0x91c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91c7('0x1'));var jsonpatch=require(_0x91c7('0x2'));var rp=require(_0x91c7('0x3'));var moment=require(_0x91c7('0x4'));var BPromise=require(_0x91c7('0x5'));var Mustache=require(_0x91c7('0x6'));var util=require(_0x91c7('0x7'));var path=require(_0x91c7('0x8'));var sox=require(_0x91c7('0x9'));var csv=require(_0x91c7('0xa'));var ejs=require(_0x91c7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x91c7('0xc'));var crypto=require(_0x91c7('0xd'));var jsforce=require(_0x91c7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x91c7('0xa'));var querystring=require(_0x91c7('0xf'));var Papa=require(_0x91c7('0x10'));var Redis=require(_0x91c7('0x11'));var authService=require(_0x91c7('0x12'));var qs=require(_0x91c7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91c7('0x14'));var logger=require(_0x91c7('0x15'))(_0x91c7('0x16'));var utils=require('../../config/utils');var config=require(_0x91c7('0x17'));var licenseUtil=require(_0x91c7('0x18'));var db=require(_0x91c7('0x19'))['db'];var jayson=require(_0x91c7('0x1a'));var client=jayson[_0x91c7('0x1b')][_0x91c7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x439d68,_0x431216,_0x47e8f4,_0x5d05af){return new BPromise(function(_0x3d5cb1,_0x1d1512){var _0x190c95=_0x5d05af||client;return _0x190c95[_0x91c7('0x1d')](_0x439d68,_0x47e8f4)['then'](function(_0x51c05e){logger[_0x91c7('0x1e')](_0x91c7('0x1f'),_0x431216,_0x91c7('0x20'));logger[_0x91c7('0x21')](_0x91c7('0x22'),_0x431216,_0x91c7('0x20'),JSON[_0x91c7('0x23')](_0x51c05e));if(_0x51c05e[_0x91c7('0x24')]){if(_0x51c05e[_0x91c7('0x24')][_0x91c7('0x25')]===0x1f4){logger[_0x91c7('0x24')]('VoiceContext,\x20%s,\x20%s',_0x431216,_0x51c05e['error']['message']);return _0x1d1512(_0x51c05e['error']['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x431216,_0x51c05e[_0x91c7('0x24')][_0x91c7('0x26')]);return _0x3d5cb1(_0x51c05e[_0x91c7('0x24')][_0x91c7('0x26')]);}else{logger[_0x91c7('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x431216,_0x91c7('0x20'));_0x3d5cb1(_0x51c05e['result'][_0x91c7('0x26')]);}})[_0x91c7('0x27')](function(_0xf9ad04){logger[_0x91c7('0x24')]('VoiceContext,\x20%s,\x20%s',_0x431216,_0xf9ad04);_0x1d1512(_0xf9ad04);});});}function respondWithStatusCode(_0xc76da0,_0x4cad78){_0x4cad78=_0x4cad78||0xcc;return function(_0x22e178){if(_0x22e178){return _0xc76da0['sendStatus'](_0x4cad78);}return _0xc76da0[_0x91c7('0x28')](_0x4cad78)[_0x91c7('0x29')]();};}function respondWithResult(_0x122534,_0x18675b){_0x18675b=_0x18675b||0xc8;return function(_0x529295){if(_0x529295){return _0x122534[_0x91c7('0x28')](_0x18675b)[_0x91c7('0x2a')](_0x529295);}};}function respondWithFilteredResult(_0x1a8ed1,_0xd5fdb7){return function(_0x3e5cdf){if(_0x3e5cdf){var _0x55270d=typeof _0xd5fdb7[_0x91c7('0x2b')]===_0x91c7('0x2c')&&typeof _0xd5fdb7[_0x91c7('0x2d')]==='undefined';var _0x1a0b7c=_0x3e5cdf[_0x91c7('0x2e')];var _0x24c14f=_0x55270d?0x0:_0xd5fdb7[_0x91c7('0x2b')];var _0x488592=_0x55270d?_0x3e5cdf[_0x91c7('0x2e')]:_0xd5fdb7[_0x91c7('0x2b')]+_0xd5fdb7[_0x91c7('0x2d')];var _0xf3e74e;if(_0x488592>=_0x1a0b7c){_0x488592=_0x1a0b7c;_0xf3e74e=0xc8;}else{_0xf3e74e=0xce;}_0x1a8ed1[_0x91c7('0x28')](_0xf3e74e);return _0x1a8ed1['set'](_0x91c7('0x2f'),_0x24c14f+'-'+_0x488592+'/'+_0x1a0b7c)[_0x91c7('0x2a')](_0x3e5cdf);}return null;};}function patchUpdates(_0x4ec2f7){return function(_0x45cb1a){try{jsonpatch[_0x91c7('0x30')](_0x45cb1a,_0x4ec2f7,!![]);}catch(_0x10ff39){return BPromise[_0x91c7('0x31')](_0x10ff39);}return _0x45cb1a[_0x91c7('0x32')]();};}function saveUpdates(_0x8ea786,_0x19e3af){return function(_0x3732cf){if(_0x3732cf){return _0x3732cf[_0x91c7('0x33')](_0x8ea786)[_0x91c7('0x34')](function(_0x52d4b8){return _0x52d4b8;});}return null;};}function removeEntity(_0xd85c1d,_0x30dacd){return function(_0x1e7cf6){if(_0x1e7cf6){return _0x1e7cf6[_0x91c7('0x35')]()[_0x91c7('0x34')](function(){var _0x50a647=_0x1e7cf6[_0x91c7('0x36')]({'plain':!![]});var _0x402556=_0x91c7('0x37');return db[_0x91c7('0x38')][_0x91c7('0x35')]({'where':{'type':_0x402556,'resourceId':_0x50a647['id']}})[_0x91c7('0x34')](function(){return _0x1e7cf6;});})[_0x91c7('0x34')](function(){_0xd85c1d[_0x91c7('0x28')](0xcc)[_0x91c7('0x29')]();});}};}function handleEntityNotFound(_0x3e4616,_0xbff749){return function(_0x581521){if(!_0x581521){_0x3e4616['sendStatus'](0x194);}return _0x581521;};}function handleError(_0x8a38f8,_0x251b8c){_0x251b8c=_0x251b8c||0x1f4;return function(_0x1c37e9){logger[_0x91c7('0x24')](_0x1c37e9['stack']);if(_0x1c37e9[_0x91c7('0x39')]){delete _0x1c37e9[_0x91c7('0x39')];}_0x8a38f8['status'](_0x251b8c)[_0x91c7('0x3a')](_0x1c37e9);};}exports[_0x91c7('0x3b')]=function(_0x297bfd,_0x4b99ca){var _0x55d000={},_0x4d3461={},_0x119b02={'count':0x0,'rows':[]};var _0x182702=_['map'](db['VoiceContext'][_0x91c7('0x3c')],function(_0x37380a){return{'name':_0x37380a[_0x91c7('0x3d')],'type':_0x37380a[_0x91c7('0x3e')][_0x91c7('0x3f')]};});_0x4d3461['model']=_[_0x91c7('0x40')](_0x182702,_0x91c7('0x39'));_0x4d3461[_0x91c7('0x41')]=_[_0x91c7('0x42')](_0x297bfd['query']);_0x4d3461['filters']=_['intersection'](_0x4d3461[_0x91c7('0x43')],_0x4d3461[_0x91c7('0x41')]);_0x55d000['attributes']=_[_0x91c7('0x44')](_0x4d3461[_0x91c7('0x43')],qs[_0x91c7('0x45')](_0x297bfd[_0x91c7('0x41')]['fields']));_0x55d000[_0x91c7('0x46')]=_0x55d000[_0x91c7('0x46')][_0x91c7('0x47')]?_0x55d000[_0x91c7('0x46')]:_0x4d3461[_0x91c7('0x43')];if(!_0x297bfd[_0x91c7('0x41')]['hasOwnProperty'](_0x91c7('0x48'))){_0x55d000[_0x91c7('0x2d')]=qs[_0x91c7('0x2d')](_0x297bfd[_0x91c7('0x41')][_0x91c7('0x2d')]);_0x55d000['offset']=qs[_0x91c7('0x2b')](_0x297bfd[_0x91c7('0x41')][_0x91c7('0x2b')]);}_0x55d000[_0x91c7('0x49')]=qs['sort'](_0x297bfd[_0x91c7('0x41')]['sort']);_0x55d000['where']=qs[_0x91c7('0x4a')](_[_0x91c7('0x4b')](_0x297bfd[_0x91c7('0x41')],_0x4d3461['filters']),_0x182702);if(_0x297bfd[_0x91c7('0x41')][_0x91c7('0x4c')]){_0x55d000['where']=_[_0x91c7('0x4d')](_0x55d000[_0x91c7('0x4e')],{'$or':_[_0x91c7('0x40')](_0x182702,function(_0x161e4f){if(_0x161e4f[_0x91c7('0x3e')]!==_0x91c7('0x4f')){var _0x2938e7={};_0x2938e7[_0x161e4f[_0x91c7('0x39')]]={'$like':'%'+_0x297bfd['query'][_0x91c7('0x4c')]+'%'};return _0x2938e7;}})});}_0x55d000=_[_0x91c7('0x4d')]({},_0x55d000,_0x297bfd[_0x91c7('0x50')]);var _0x12ca68={'where':_0x55d000[_0x91c7('0x4e')]};return db[_0x91c7('0x51')]['count'](_0x12ca68)[_0x91c7('0x34')](function(_0x1383a8){_0x119b02[_0x91c7('0x2e')]=_0x1383a8;if(_0x297bfd[_0x91c7('0x41')][_0x91c7('0x52')]){_0x55d000[_0x91c7('0x53')]=[{'all':!![]}];}return db[_0x91c7('0x51')][_0x91c7('0x54')](_0x55d000);})[_0x91c7('0x34')](function(_0xbbe72c){_0x119b02[_0x91c7('0x55')]=_0xbbe72c;return _0x119b02;})[_0x91c7('0x34')](respondWithFilteredResult(_0x4b99ca,_0x55d000))[_0x91c7('0x27')](handleError(_0x4b99ca,null));};exports[_0x91c7('0x56')]=function(_0x599c5f,_0x2b8caf){var _0x4d37ad={'raw':![],'where':{'id':_0x599c5f['params']['id']}},_0x4c0fcc={};_0x4c0fcc[_0x91c7('0x43')]=_['keys'](db[_0x91c7('0x51')][_0x91c7('0x3c')]);_0x4c0fcc[_0x91c7('0x41')]=_['keys'](_0x599c5f[_0x91c7('0x41')]);_0x4c0fcc[_0x91c7('0x4a')]=_[_0x91c7('0x44')](_0x4c0fcc[_0x91c7('0x43')],_0x4c0fcc[_0x91c7('0x41')]);_0x4d37ad[_0x91c7('0x46')]=_[_0x91c7('0x44')](_0x4c0fcc[_0x91c7('0x43')],qs[_0x91c7('0x45')](_0x599c5f['query'][_0x91c7('0x45')]));_0x4d37ad[_0x91c7('0x46')]=_0x4d37ad['attributes'][_0x91c7('0x47')]?_0x4d37ad['attributes']:_0x4c0fcc[_0x91c7('0x43')];if(_0x599c5f[_0x91c7('0x41')][_0x91c7('0x52')]){_0x4d37ad[_0x91c7('0x53')]=[{'all':!![]}];}_0x4d37ad=_[_0x91c7('0x4d')]({},_0x4d37ad,_0x599c5f['options']);return db[_0x91c7('0x51')][_0x91c7('0x57')](_0x4d37ad)[_0x91c7('0x34')](handleEntityNotFound(_0x2b8caf,null))[_0x91c7('0x34')](respondWithResult(_0x2b8caf,null))['catch'](handleError(_0x2b8caf,null));};exports[_0x91c7('0x58')]=function(_0xfece7e,_0x44dd6a,_0x54b93){var _0x1c3c1b;return db[_0x91c7('0x51')][_0x91c7('0x58')](_0xfece7e[_0x91c7('0x59')],{'raw':!![]})[_0x91c7('0x34')](function(_0x2f761a){_0x1c3c1b=_0x2f761a;return db['VoiceContext'][_0x91c7('0x54')]({'raw':!![]});})[_0x91c7('0x34')](function(_0x4c008e){var _0x1dbc3f=fs[_0x91c7('0x5a')](path[_0x91c7('0x5b')](config['root'],_0x91c7('0x5c')),_0x91c7('0x5d'));var _0x394c51=ejs[_0x91c7('0x5e')](_0x1dbc3f,{'contexts':_0x4c008e||[]});fs['writeFileSync'](_0x91c7('0x5f'),_0x394c51);})[_0x91c7('0x34')](function(){return respondWithRpcPromise(_0x91c7('0x60'),'create',{'module':_0x91c7('0x61')});})[_0x91c7('0x34')](function(){var _0x1e6949=_0xfece7e['user']['get']({'plain':!![]});if(!_0x1e6949)throw new Error(_0x91c7('0x62'));if(_0x1e6949[_0x91c7('0x63')]===_0x91c7('0x64')){var _0x16c04a=_0x1c3c1b[_0x91c7('0x36')]({'plain':!![]});return db[_0x91c7('0x65')][_0x91c7('0x57')]({'where':{'name':_0x91c7('0x37'),'userProfileId':_0x1e6949[_0x91c7('0x66')]},'raw':!![]})[_0x91c7('0x34')](function(_0x4c0cbc){if(_0x4c0cbc&&_0x4c0cbc[_0x91c7('0x67')]===0x0){return db[_0x91c7('0x38')][_0x91c7('0x58')]({'name':_0x16c04a[_0x91c7('0x39')],'resourceId':_0x16c04a['id'],'type':_0x4c0cbc[_0x91c7('0x39')],'sectionId':_0x4c0cbc['id']},{})[_0x91c7('0x34')](function(){return _0x1c3c1b;});}else{return _0x1c3c1b;}})[_0x91c7('0x27')](function(_0x23955e){logger[_0x91c7('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23955e);throw _0x23955e;});}return _0x1c3c1b;})['then'](respondWithResult(_0x44dd6a,0xc9))[_0x91c7('0x27')](handleError(_0x44dd6a,null));};exports[_0x91c7('0x33')]=function(_0x214447,_0x41cd1d,_0x6a3273){var _0x518067;return db[_0x91c7('0x51')][_0x91c7('0x57')]({'where':{'id':_0x214447['params']['id']}})[_0x91c7('0x34')](handleEntityNotFound(_0x41cd1d,null))['then'](saveUpdates(_0x214447[_0x91c7('0x59')],null))['then'](function(_0x2520d2){if(_0x2520d2){_0x518067=_0x2520d2;return db[_0x91c7('0x51')][_0x91c7('0x54')]({'raw':!![]});}})['then'](function(_0x2c9e42){var _0x326c77=fs[_0x91c7('0x5a')](path[_0x91c7('0x5b')](config[_0x91c7('0x68')],_0x91c7('0x5c')),'utf8');var _0x4d3577=ejs[_0x91c7('0x5e')](_0x326c77,{'contexts':_0x2c9e42||[]});fs[_0x91c7('0x69')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4d3577);})['then'](function(){return respondWithRpcPromise(_0x91c7('0x60'),_0x91c7('0x33'),{'module':'chan_sip.so'});})['then'](function(){return _0x518067;})['then'](respondWithResult(_0x41cd1d,null))[_0x91c7('0x27')](handleError(_0x41cd1d,null));};exports[_0x91c7('0x35')]=function(_0x2fbcbe,_0x2e42e9,_0x31664d){var _0x4d817c;return db[_0x91c7('0x51')][_0x91c7('0x57')]({'where':{'id':_0x2fbcbe[_0x91c7('0x6a')]['id']}})['then'](handleEntityNotFound(_0x2e42e9,null))[_0x91c7('0x34')](removeEntity(_0x2e42e9,null))[_0x91c7('0x34')](function(){return db['VoiceContext'][_0x91c7('0x54')]({'raw':!![]});})[_0x91c7('0x34')](function(_0x3d69a1){var _0x1ad7a5=fs[_0x91c7('0x5a')](path[_0x91c7('0x5b')](config[_0x91c7('0x68')],'server/files/templates/context.ejs'),_0x91c7('0x5d'));var _0x3af62b=ejs[_0x91c7('0x5e')](_0x1ad7a5,{'contexts':_0x3d69a1});fs[_0x91c7('0x69')](_0x91c7('0x5f'),_0x3af62b);return respondWithRpcPromise(_0x91c7('0x60'),_0x91c7('0x35'),{'module':_0x91c7('0x61')});})[_0x91c7('0x27')](handleError(_0x2e42e9,null));}; \ No newline at end of file +var _0x3bd8=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','stack','name','send','VoiceContext','rawAttributes','fieldName','map','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','chan_sip.so','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','client','http','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3bd8,0xa6));var _0x83bd=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x3bd8[_0x420513];return _0x1b44ec;};'use strict';var emlformat=require(_0x83bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83bd('0x1'));var jsonpatch=require(_0x83bd('0x2'));var rp=require(_0x83bd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83bd('0x4'));var util=require(_0x83bd('0x5'));var path=require(_0x83bd('0x6'));var sox=require(_0x83bd('0x7'));var csv=require('to-csv');var ejs=require(_0x83bd('0x8'));var fs=require('fs');var fs_extra=require(_0x83bd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x83bd('0xa'));var jsforce=require(_0x83bd('0xb'));var deskjs=require(_0x83bd('0xc'));var toCsv=require(_0x83bd('0xd'));var querystring=require('querystring');var Papa=require(_0x83bd('0xe'));var Redis=require(_0x83bd('0xf'));var authService=require(_0x83bd('0x10'));var qs=require(_0x83bd('0x11'));var as=require(_0x83bd('0x12'));var hardwareService=require(_0x83bd('0x13'));var logger=require(_0x83bd('0x14'))('api');var utils=require(_0x83bd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x83bd('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x83bd('0x17')][_0x83bd('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4472ce,_0x4a92c3,_0x4e2b43,_0x44a30a){return new BPromise(function(_0xc44c2e,_0x3809e7){var _0x52ad83=_0x44a30a||client;return _0x52ad83['request'](_0x4472ce,_0x4e2b43)[_0x83bd('0x19')](function(_0x3fbc44){logger[_0x83bd('0x1a')](_0x83bd('0x1b'),_0x4a92c3,'request\x20sent');logger[_0x83bd('0x1c')](_0x83bd('0x1d'),_0x4a92c3,_0x83bd('0x1e'),JSON[_0x83bd('0x1f')](_0x3fbc44));if(_0x3fbc44[_0x83bd('0x20')]){if(_0x3fbc44[_0x83bd('0x20')]['code']===0x1f4){logger[_0x83bd('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4a92c3,_0x3fbc44['error']['message']);return _0x3809e7(_0x3fbc44[_0x83bd('0x20')][_0x83bd('0x21')]);}logger[_0x83bd('0x20')](_0x83bd('0x1b'),_0x4a92c3,_0x3fbc44[_0x83bd('0x20')][_0x83bd('0x21')]);return _0xc44c2e(_0x3fbc44[_0x83bd('0x20')][_0x83bd('0x21')]);}else{logger[_0x83bd('0x1a')](_0x83bd('0x1b'),_0x4a92c3,'request\x20sent');_0xc44c2e(_0x3fbc44['result']['message']);}})[_0x83bd('0x22')](function(_0x5155f9){logger[_0x83bd('0x20')](_0x83bd('0x1b'),_0x4a92c3,_0x5155f9);_0x3809e7(_0x5155f9);});});}function respondWithStatusCode(_0x4a47f8,_0x3ef358){_0x3ef358=_0x3ef358||0xcc;return function(_0x17f53f){if(_0x17f53f){return _0x4a47f8[_0x83bd('0x23')](_0x3ef358);}return _0x4a47f8[_0x83bd('0x24')](_0x3ef358)[_0x83bd('0x25')]();};}function respondWithResult(_0x4dc74b,_0x2ff936){_0x2ff936=_0x2ff936||0xc8;return function(_0x439b58){if(_0x439b58){return _0x4dc74b[_0x83bd('0x24')](_0x2ff936)[_0x83bd('0x26')](_0x439b58);}};}function respondWithFilteredResult(_0x5b47c8,_0x41ec58){return function(_0x1f0182){if(_0x1f0182){var _0x401a3c=typeof _0x41ec58[_0x83bd('0x27')]===_0x83bd('0x28')&&typeof _0x41ec58[_0x83bd('0x29')]==='undefined';var _0x577852=_0x1f0182[_0x83bd('0x2a')];var _0xc1e2c8=_0x401a3c?0x0:_0x41ec58[_0x83bd('0x27')];var _0x4c8044=_0x401a3c?_0x1f0182['count']:_0x41ec58[_0x83bd('0x27')]+_0x41ec58[_0x83bd('0x29')];var _0x43c767;if(_0x4c8044>=_0x577852){_0x4c8044=_0x577852;_0x43c767=0xc8;}else{_0x43c767=0xce;}_0x5b47c8[_0x83bd('0x24')](_0x43c767);return _0x5b47c8[_0x83bd('0x2b')](_0x83bd('0x2c'),_0xc1e2c8+'-'+_0x4c8044+'/'+_0x577852)['json'](_0x1f0182);}return null;};}function patchUpdates(_0xeef9d3){return function(_0x2f32ed){try{jsonpatch[_0x83bd('0x2d')](_0x2f32ed,_0xeef9d3,!![]);}catch(_0x1b9177){return BPromise[_0x83bd('0x2e')](_0x1b9177);}return _0x2f32ed[_0x83bd('0x2f')]();};}function saveUpdates(_0x18221b,_0x3dc5eb){return function(_0x561334){if(_0x561334){return _0x561334[_0x83bd('0x30')](_0x18221b)['then'](function(_0xb8e3eb){return _0xb8e3eb;});}return null;};}function removeEntity(_0x217135,_0x13b12){return function(_0x3d4ba6){if(_0x3d4ba6){return _0x3d4ba6[_0x83bd('0x31')]()[_0x83bd('0x19')](function(){var _0x3ef3e3=_0x3d4ba6[_0x83bd('0x32')]({'plain':!![]});var _0x3511c6=_0x83bd('0x33');return db['UserProfileResource'][_0x83bd('0x31')]({'where':{'type':_0x3511c6,'resourceId':_0x3ef3e3['id']}})['then'](function(){return _0x3d4ba6;});})[_0x83bd('0x19')](function(){_0x217135[_0x83bd('0x24')](0xcc)[_0x83bd('0x25')]();});}};}function handleEntityNotFound(_0x494496,_0x2303c2){return function(_0x37c416){if(!_0x37c416){_0x494496['sendStatus'](0x194);}return _0x37c416;};}function handleError(_0x375fc4,_0x28b92a){_0x28b92a=_0x28b92a||0x1f4;return function(_0x417a83){logger[_0x83bd('0x20')](_0x417a83[_0x83bd('0x34')]);if(_0x417a83[_0x83bd('0x35')]){delete _0x417a83['name'];}_0x375fc4['status'](_0x28b92a)[_0x83bd('0x36')](_0x417a83);};}exports['index']=function(_0x27785,_0x46e69d){var _0x4a2eee={},_0x2c8090={},_0x24c80a={'count':0x0,'rows':[]};var _0x494d42=_['map'](db[_0x83bd('0x37')][_0x83bd('0x38')],function(_0x4d92d8){return{'name':_0x4d92d8[_0x83bd('0x39')],'type':_0x4d92d8['type']['key']};});_0x2c8090['model']=_[_0x83bd('0x3a')](_0x494d42,_0x83bd('0x35'));_0x2c8090[_0x83bd('0x3b')]=_[_0x83bd('0x3c')](_0x27785[_0x83bd('0x3b')]);_0x2c8090['filters']=_['intersection'](_0x2c8090[_0x83bd('0x3d')],_0x2c8090['query']);_0x4a2eee[_0x83bd('0x3e')]=_['intersection'](_0x2c8090[_0x83bd('0x3d')],qs[_0x83bd('0x3f')](_0x27785['query']['fields']));_0x4a2eee[_0x83bd('0x3e')]=_0x4a2eee[_0x83bd('0x3e')][_0x83bd('0x40')]?_0x4a2eee[_0x83bd('0x3e')]:_0x2c8090[_0x83bd('0x3d')];if(!_0x27785[_0x83bd('0x3b')][_0x83bd('0x41')](_0x83bd('0x42'))){_0x4a2eee[_0x83bd('0x29')]=qs[_0x83bd('0x29')](_0x27785[_0x83bd('0x3b')]['limit']);_0x4a2eee[_0x83bd('0x27')]=qs[_0x83bd('0x27')](_0x27785['query'][_0x83bd('0x27')]);}_0x4a2eee[_0x83bd('0x43')]=qs[_0x83bd('0x44')](_0x27785[_0x83bd('0x3b')][_0x83bd('0x44')]);_0x4a2eee[_0x83bd('0x45')]=qs[_0x83bd('0x46')](_[_0x83bd('0x47')](_0x27785['query'],_0x2c8090[_0x83bd('0x46')]),_0x494d42);if(_0x27785[_0x83bd('0x3b')][_0x83bd('0x48')]){_0x4a2eee[_0x83bd('0x45')]=_[_0x83bd('0x49')](_0x4a2eee[_0x83bd('0x45')],{'$or':_[_0x83bd('0x3a')](_0x494d42,function(_0x5b1538){if(_0x5b1538['type']!==_0x83bd('0x4a')){var _0x5e73f7={};_0x5e73f7[_0x5b1538[_0x83bd('0x35')]]={'$like':'%'+_0x27785[_0x83bd('0x3b')][_0x83bd('0x48')]+'%'};return _0x5e73f7;}})});}_0x4a2eee=_[_0x83bd('0x49')]({},_0x4a2eee,_0x27785[_0x83bd('0x4b')]);var _0x1a74aa={'where':_0x4a2eee[_0x83bd('0x45')]};return db[_0x83bd('0x37')][_0x83bd('0x2a')](_0x1a74aa)[_0x83bd('0x19')](function(_0x26be26){_0x24c80a[_0x83bd('0x2a')]=_0x26be26;if(_0x27785[_0x83bd('0x3b')][_0x83bd('0x4c')]){_0x4a2eee[_0x83bd('0x4d')]=[{'all':!![]}];}return db[_0x83bd('0x37')][_0x83bd('0x4e')](_0x4a2eee);})[_0x83bd('0x19')](function(_0x25a73c){_0x24c80a[_0x83bd('0x4f')]=_0x25a73c;return _0x24c80a;})['then'](respondWithFilteredResult(_0x46e69d,_0x4a2eee))[_0x83bd('0x22')](handleError(_0x46e69d,null));};exports[_0x83bd('0x50')]=function(_0x282880,_0x585e6d){var _0x4bc40f={'raw':![],'where':{'id':_0x282880['params']['id']}},_0x3962ab={};_0x3962ab[_0x83bd('0x3d')]=_['keys'](db[_0x83bd('0x37')][_0x83bd('0x38')]);_0x3962ab[_0x83bd('0x3b')]=_['keys'](_0x282880[_0x83bd('0x3b')]);_0x3962ab['filters']=_[_0x83bd('0x51')](_0x3962ab['model'],_0x3962ab['query']);_0x4bc40f[_0x83bd('0x3e')]=_[_0x83bd('0x51')](_0x3962ab[_0x83bd('0x3d')],qs['fields'](_0x282880['query'][_0x83bd('0x3f')]));_0x4bc40f[_0x83bd('0x3e')]=_0x4bc40f[_0x83bd('0x3e')][_0x83bd('0x40')]?_0x4bc40f[_0x83bd('0x3e')]:_0x3962ab[_0x83bd('0x3d')];if(_0x282880['query']['includeAll']){_0x4bc40f[_0x83bd('0x4d')]=[{'all':!![]}];}_0x4bc40f=_['merge']({},_0x4bc40f,_0x282880[_0x83bd('0x4b')]);return db[_0x83bd('0x37')][_0x83bd('0x52')](_0x4bc40f)[_0x83bd('0x19')](handleEntityNotFound(_0x585e6d,null))['then'](respondWithResult(_0x585e6d,null))[_0x83bd('0x22')](handleError(_0x585e6d,null));};exports[_0x83bd('0x53')]=function(_0x5f1fbb,_0xa79a7a,_0x59cd2b){var _0x31cc68;return db[_0x83bd('0x37')]['create'](_0x5f1fbb[_0x83bd('0x54')],{'raw':!![]})[_0x83bd('0x19')](function(_0x361222){_0x31cc68=_0x361222;return db['VoiceContext'][_0x83bd('0x4e')]({'raw':!![]});})[_0x83bd('0x19')](function(_0x545684){var _0x250f1d=fs[_0x83bd('0x55')](path['join'](config[_0x83bd('0x56')],_0x83bd('0x57')),_0x83bd('0x58'));var _0x598d09=ejs[_0x83bd('0x59')](_0x250f1d,{'contexts':_0x545684||[]});fs[_0x83bd('0x5a')](_0x83bd('0x5b'),_0x598d09);})['then'](function(){return respondWithRpcPromise(_0x83bd('0x5c'),'create',{'module':'chan_sip.so'});})[_0x83bd('0x19')](function(){var _0xb76b0d=_0x5f1fbb[_0x83bd('0x5d')]['get']({'plain':!![]});if(!_0xb76b0d)throw new Error(_0x83bd('0x5e'));if(_0xb76b0d[_0x83bd('0x5f')]==='user'){var _0xcf07dc=_0x31cc68['get']({'plain':!![]});return db[_0x83bd('0x60')][_0x83bd('0x52')]({'where':{'name':_0x83bd('0x33'),'userProfileId':_0xb76b0d[_0x83bd('0x61')]},'raw':!![]})[_0x83bd('0x19')](function(_0x1d8a91){if(_0x1d8a91&&_0x1d8a91['autoAssociation']===0x0){return db['UserProfileResource'][_0x83bd('0x53')]({'name':_0xcf07dc['name'],'resourceId':_0xcf07dc['id'],'type':_0x1d8a91['name'],'sectionId':_0x1d8a91['id']},{})['then'](function(){return _0x31cc68;});}else{return _0x31cc68;}})[_0x83bd('0x22')](function(_0xdadb4b){logger[_0x83bd('0x20')](_0x83bd('0x62'),_0xdadb4b);throw _0xdadb4b;});}return _0x31cc68;})['then'](respondWithResult(_0xa79a7a,0xc9))['catch'](handleError(_0xa79a7a,null));};exports[_0x83bd('0x30')]=function(_0x21ae5d,_0x3d76d8,_0x410e31){var _0x46f77f;return db['VoiceContext'][_0x83bd('0x52')]({'where':{'id':_0x21ae5d[_0x83bd('0x63')]['id']}})['then'](handleEntityNotFound(_0x3d76d8,null))[_0x83bd('0x19')](saveUpdates(_0x21ae5d[_0x83bd('0x54')],null))[_0x83bd('0x19')](function(_0x51b1f7){if(_0x51b1f7){_0x46f77f=_0x51b1f7;return db[_0x83bd('0x37')]['findAll']({'raw':!![]});}})['then'](function(_0x29369d){var _0x1a4323=fs[_0x83bd('0x55')](path[_0x83bd('0x64')](config[_0x83bd('0x56')],_0x83bd('0x57')),_0x83bd('0x58'));var _0x36cfc3=ejs['render'](_0x1a4323,{'contexts':_0x29369d||[]});fs[_0x83bd('0x5a')](_0x83bd('0x5b'),_0x36cfc3);})[_0x83bd('0x19')](function(){return respondWithRpcPromise(_0x83bd('0x5c'),_0x83bd('0x30'),{'module':_0x83bd('0x65')});})[_0x83bd('0x19')](function(){return _0x46f77f;})['then'](respondWithResult(_0x3d76d8,null))['catch'](handleError(_0x3d76d8,null));};exports[_0x83bd('0x31')]=function(_0x3ee993,_0x561f77,_0x4ee9d4){var _0x516943;return db['VoiceContext'][_0x83bd('0x52')]({'where':{'id':_0x3ee993[_0x83bd('0x63')]['id']}})[_0x83bd('0x19')](handleEntityNotFound(_0x561f77,null))['then'](removeEntity(_0x561f77,null))[_0x83bd('0x19')](function(){return db['VoiceContext'][_0x83bd('0x4e')]({'raw':!![]});})[_0x83bd('0x19')](function(_0x282800){var _0x2d5d8f=fs[_0x83bd('0x55')](path[_0x83bd('0x64')](config[_0x83bd('0x56')],_0x83bd('0x57')),_0x83bd('0x58'));var _0x17c8c8=ejs[_0x83bd('0x59')](_0x2d5d8f,{'contexts':_0x282800});fs[_0x83bd('0x5a')](_0x83bd('0x5b'),_0x17c8c8);return respondWithRpcPromise(_0x83bd('0x5c'),_0x83bd('0x31'),{'module':_0x83bd('0x65')});})[_0x83bd('0x22')](handleError(_0x561f77,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 17ffc8a..83a1170 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 _0x945e=['rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x945e,0xca));var _0xe945=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x945e[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xe945('0x0'));var util=require(_0xe945('0x1'));var logger=require(_0xe945('0x2'))(_0xe945('0x3'));var moment=require(_0xe945('0x4'));var BPromise=require(_0xe945('0x5'));var rp=require(_0xe945('0x6'));var fs=require('fs');var path=require(_0xe945('0x7'));var rimraf=require(_0xe945('0x8'));var config=require('../../config/environment');var attributes=require(_0xe945('0x9'));module[_0xe945('0xa')]=function(_0x14d36f,_0x30d2a0){return _0x14d36f[_0xe945('0xb')](_0xe945('0xc'),attributes,{'tableName':_0xe945('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd20c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','voice_contexts','lodash','util','api'];(function(_0x3b371a,_0x1f4dec){var _0x421339=function(_0x5800d2){while(--_0x5800d2){_0x3b371a['push'](_0x3b371a['shift']());}};_0x421339(++_0x1f4dec);}(_0xd20c,0x97));var _0xcd20=function(_0x277bd8,_0x4bd5bc){_0x277bd8=_0x277bd8-0x0;var _0x3bc497=_0xd20c[_0x277bd8];return _0x3bc497;};'use strict';var _=require(_0xcd20('0x0'));var util=require(_0xcd20('0x1'));var logger=require('../../config/logger')(_0xcd20('0x2'));var moment=require(_0xcd20('0x3'));var BPromise=require(_0xcd20('0x4'));var rp=require(_0xcd20('0x5'));var fs=require('fs');var path=require(_0xcd20('0x6'));var rimraf=require(_0xcd20('0x7'));var config=require(_0xcd20('0x8'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x2eb463,_0x22a0c1){return _0x2eb463[_0xcd20('0x9')]('VoiceContext',attributes,{'tableName':_0xcd20('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 8cf6999..c6daab8 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 _0xd027=['then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7d02('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d02('0x1'));var fs=require('fs');var Redis=require(_0x7d02('0x2'));var db=require(_0x7d02('0x3'))['db'];var utils=require(_0x7d02('0x4'));var logger=require(_0x7d02('0x5'))(_0x7d02('0x6'));var config=require(_0x7d02('0x7'));var jayson=require(_0x7d02('0x8'));var client=jayson['client'][_0x7d02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19a3b4,_0x2f59e2,_0x4442c5){return new BPromise(function(_0x10647b,_0x310426){return client[_0x7d02('0xa')](_0x19a3b4,_0x4442c5)[_0x7d02('0xb')](function(_0x10af16){logger[_0x7d02('0xc')](_0x7d02('0xd'),_0x2f59e2,_0x7d02('0xe'));logger[_0x7d02('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2f59e2,_0x7d02('0xe'),JSON[_0x7d02('0x10')](_0x10af16));if(_0x10af16['error']){if(_0x10af16[_0x7d02('0x11')][_0x7d02('0x12')]===0x1f4){logger[_0x7d02('0x11')](_0x7d02('0xd'),_0x2f59e2,_0x10af16['error'][_0x7d02('0x13')]);return _0x310426(_0x10af16['error'][_0x7d02('0x13')]);}logger[_0x7d02('0x11')]('VoiceContext,\x20%s,\x20%s',_0x2f59e2,_0x10af16[_0x7d02('0x11')][_0x7d02('0x13')]);return _0x10647b(_0x10af16['error'][_0x7d02('0x13')]);}else{logger[_0x7d02('0xc')](_0x7d02('0xd'),_0x2f59e2,'request\x20sent');_0x10647b(_0x10af16[_0x7d02('0x14')][_0x7d02('0x13')]);}})[_0x7d02('0x15')](function(_0x2017f0){logger[_0x7d02('0x11')](_0x7d02('0xd'),_0x2f59e2,_0x2017f0);_0x310426(_0x2017f0);});});} \ No newline at end of file +var _0xa509=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0xa509,0x12f));var _0x9a50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa509[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9a50('0x0'));var util=require(_0x9a50('0x1'));var moment=require(_0x9a50('0x2'));var BPromise=require(_0x9a50('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a50('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a50('0x5'));var logger=require(_0x9a50('0x6'))(_0x9a50('0x7'));var config=require(_0x9a50('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9a50('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f6789,_0x4f28b0,_0x5cf0b9){return new BPromise(function(_0x5e83e8,_0x55ec13){return client[_0x9a50('0xa')](_0x3f6789,_0x5cf0b9)[_0x9a50('0xb')](function(_0x169179){logger[_0x9a50('0xc')](_0x9a50('0xd'),_0x4f28b0,_0x9a50('0xe'));logger[_0x9a50('0xf')](_0x9a50('0x10'),_0x4f28b0,_0x9a50('0xe'),JSON[_0x9a50('0x11')](_0x169179));if(_0x169179[_0x9a50('0x12')]){if(_0x169179[_0x9a50('0x12')][_0x9a50('0x13')]===0x1f4){logger[_0x9a50('0x12')](_0x9a50('0xd'),_0x4f28b0,_0x169179[_0x9a50('0x12')][_0x9a50('0x14')]);return _0x55ec13(_0x169179['error']['message']);}logger[_0x9a50('0x12')](_0x9a50('0xd'),_0x4f28b0,_0x169179[_0x9a50('0x12')]['message']);return _0x5e83e8(_0x169179[_0x9a50('0x12')]['message']);}else{logger[_0x9a50('0xc')](_0x9a50('0xd'),_0x4f28b0,'request\x20sent');_0x5e83e8(_0x169179[_0x9a50('0x15')]['message']);}})[_0x9a50('0x16')](function(_0x9c0cc7){logger['error'](_0x9a50('0xd'),_0x4f28b0,_0x9c0cc7);_0x55ec13(_0x9c0cc7);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index efcf30f..6ff1895 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 _0x2fdd=['isAuthenticated','describe','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe'];(function(_0x5d160,_0xa4838e){var _0x1d180d=function(_0x543237){while(--_0x543237){_0x5d160['push'](_0x5d160['shift']());}};_0x1d180d(++_0xa4838e);}(_0x2fdd,0x158));var _0xd2fd=function(_0x1721c3,_0xbb5251){_0x1721c3=_0x1721c3-0x0;var _0x25d23d=_0x2fdd[_0x1721c3];return _0x25d23d;};'use strict';var multer=require(_0xd2fd('0x0'));var util=require(_0xd2fd('0x1'));var path=require(_0xd2fd('0x2'));var timeout=require(_0xd2fd('0x3'));var express=require('express');var router=express[_0xd2fd('0x4')]();var fs_extra=require(_0xd2fd('0x5'));var auth=require(_0xd2fd('0x6'));var interaction=require(_0xd2fd('0x7'));var config=require(_0xd2fd('0x8'));var controller=require(_0xd2fd('0x9'));router[_0xd2fd('0xa')]('/',auth['isAuthenticated'](),controller[_0xd2fd('0xb')]);router[_0xd2fd('0xa')](_0xd2fd('0xc'),auth[_0xd2fd('0xd')](),controller[_0xd2fd('0xe')]);router[_0xd2fd('0xa')](_0xd2fd('0xf'),auth[_0xd2fd('0xd')](),controller[_0xd2fd('0x10')]);router[_0xd2fd('0x11')]('/',auth[_0xd2fd('0xd')](),controller[_0xd2fd('0x12')]);router[_0xd2fd('0x13')](_0xd2fd('0xf'),auth[_0xd2fd('0xd')](),controller['update']);router['delete'](_0xd2fd('0xf'),auth[_0xd2fd('0xd')](),controller['destroy']);module[_0xd2fd('0x14')]=router; \ No newline at end of file +var _0x4860=['./voiceDialReport.controller','get','index','isAuthenticated','describe','show','post','put','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xa44f,_0x246aa2){var _0x46f93b=function(_0xccbe2a){while(--_0xccbe2a){_0xa44f['push'](_0xa44f['shift']());}};_0x46f93b(++_0x246aa2);}(_0x4860,0x197));var _0x0486=function(_0x26c3e9,_0x22f120){_0x26c3e9=_0x26c3e9-0x0;var _0x318365=_0x4860[_0x26c3e9];return _0x318365;};'use strict';var multer=require(_0x0486('0x0'));var util=require(_0x0486('0x1'));var path=require(_0x0486('0x2'));var timeout=require('connect-timeout');var express=require(_0x0486('0x3'));var router=express['Router']();var fs_extra=require(_0x0486('0x4'));var auth=require(_0x0486('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0486('0x6'));var controller=require(_0x0486('0x7'));router[_0x0486('0x8')]('/',auth['isAuthenticated'](),controller[_0x0486('0x9')]);router[_0x0486('0x8')]('/describe',auth[_0x0486('0xa')](),controller[_0x0486('0xb')]);router[_0x0486('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0486('0xc')]);router[_0x0486('0xd')]('/',auth[_0x0486('0xa')](),controller['create']);router[_0x0486('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0486('0xf'),auth[_0x0486('0xa')](),controller[_0x0486('0x10')]);module[_0x0486('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 5c27ca2..fed9c61 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 _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3e74,0x175));var _0x43e7=function(_0xe47405,_0x161707){_0xe47405=_0xe47405-0x0;var _0x3be329=_0x3e74[_0xe47405];return _0x3be329;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x3e74,0x175));var _0x43e7=function(_0x5348d9,_0x359769){_0x5348d9=_0x5348d9-0x0;var _0x456f7a=_0x3e74[_0x5348d9];return _0x456f7a;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8486361..400f00e 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 _0x4291=['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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','reject','save','update','then','status','end','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4291,0x13c));var _0x1429=function(_0x163d8a,_0x5307a5){_0x163d8a=_0x163d8a-0x0;var _0x5129b9=_0x4291[_0x163d8a];return _0x5129b9;};'use strict';var emlformat=require(_0x1429('0x0'));var rimraf=require(_0x1429('0x1'));var zipdir=require(_0x1429('0x2'));var jsonpatch=require(_0x1429('0x3'));var rp=require(_0x1429('0x4'));var moment=require(_0x1429('0x5'));var BPromise=require(_0x1429('0x6'));var Mustache=require(_0x1429('0x7'));var util=require('util');var path=require(_0x1429('0x8'));var sox=require(_0x1429('0x9'));var csv=require(_0x1429('0xa'));var ejs=require(_0x1429('0xb'));var fs=require('fs');var fs_extra=require(_0x1429('0xc'));var _=require(_0x1429('0xd'));var squel=require(_0x1429('0xe'));var crypto=require(_0x1429('0xf'));var jsforce=require(_0x1429('0x10'));var deskjs=require(_0x1429('0x11'));var toCsv=require(_0x1429('0xa'));var querystring=require('querystring');var Papa=require(_0x1429('0x12'));var Redis=require(_0x1429('0x13'));var authService=require(_0x1429('0x14'));var qs=require(_0x1429('0x15'));var as=require(_0x1429('0x16'));var hardwareService=require(_0x1429('0x17'));var logger=require(_0x1429('0x18'))('api');var utils=require(_0x1429('0x19'));var config=require(_0x1429('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x1429('0x1b'))['db'];function respondWithStatusCode(_0x1ce9b8,_0x54d07a){_0x54d07a=_0x54d07a||0xcc;return function(_0x16e1fc){if(_0x16e1fc){return _0x1ce9b8[_0x1429('0x1c')](_0x54d07a);}return _0x1ce9b8['status'](_0x54d07a)['end']();};}function respondWithResult(_0x5495e0,_0x4d16df){_0x4d16df=_0x4d16df||0xc8;return function(_0x3518df){if(_0x3518df){return _0x5495e0['status'](_0x4d16df)[_0x1429('0x1d')](_0x3518df);}};}function respondWithFilteredResult(_0x4eb846,_0x5a97f6){return function(_0x2119ef){if(_0x2119ef){var _0x512500=typeof _0x5a97f6[_0x1429('0x1e')]===_0x1429('0x1f')&&typeof _0x5a97f6[_0x1429('0x20')]===_0x1429('0x1f');var _0x2fd2bd=_0x2119ef[_0x1429('0x21')];var _0x2d755c=_0x512500?0x0:_0x5a97f6[_0x1429('0x1e')];var _0x27a26e=_0x512500?_0x2119ef[_0x1429('0x21')]:_0x5a97f6['offset']+_0x5a97f6[_0x1429('0x20')];var _0x1bb551;if(_0x27a26e>=_0x2fd2bd){_0x27a26e=_0x2fd2bd;_0x1bb551=0xc8;}else{_0x1bb551=0xce;}_0x4eb846['status'](_0x1bb551);return _0x4eb846[_0x1429('0x22')]('Content-Range',_0x2d755c+'-'+_0x27a26e+'/'+_0x2fd2bd)['json'](_0x2119ef);}return null;};}function patchUpdates(_0x102b2c){return function(_0x1e68dc){try{jsonpatch['apply'](_0x1e68dc,_0x102b2c,!![]);}catch(_0x352d4a){return BPromise[_0x1429('0x23')](_0x352d4a);}return _0x1e68dc[_0x1429('0x24')]();};}function saveUpdates(_0x49b2d5,_0x5b35c5){return function(_0x645f9b){if(_0x645f9b){return _0x645f9b[_0x1429('0x25')](_0x49b2d5)[_0x1429('0x26')](function(_0xdc25fe){return _0xdc25fe;});}return null;};}function removeEntity(_0xc91003,_0x61c454){return function(_0xb74a00){if(_0xb74a00){return _0xb74a00['destroy']()['then'](function(){_0xc91003[_0x1429('0x27')](0xcc)[_0x1429('0x28')]();});}};}function handleEntityNotFound(_0x15b020,_0x37d47b){return function(_0x5c472c){if(!_0x5c472c){_0x15b020[_0x1429('0x1c')](0x194);}return _0x5c472c;};}function handleError(_0x359e12,_0x1ec903){_0x1ec903=_0x1ec903||0x1f4;return function(_0x3bf021){logger[_0x1429('0x29')](_0x3bf021[_0x1429('0x2a')]);if(_0x3bf021['name']){delete _0x3bf021[_0x1429('0x2b')];}_0x359e12[_0x1429('0x27')](_0x1ec903)[_0x1429('0x2c')](_0x3bf021);};}exports[_0x1429('0x2d')]=function(_0x2fa90e,_0x1f4fb7){var _0x14fa93={},_0xa2e929={},_0x4917d9={'count':0x0,'rows':[]};var _0x263752=_[_0x1429('0x2e')](db[_0x1429('0x2f')][_0x1429('0x30')],function(_0x4d9c79){return{'name':_0x4d9c79[_0x1429('0x31')],'type':_0x4d9c79[_0x1429('0x32')][_0x1429('0x33')]};});_0xa2e929[_0x1429('0x34')]=_[_0x1429('0x2e')](_0x263752,_0x1429('0x2b'));_0xa2e929[_0x1429('0x35')]=_['keys'](_0x2fa90e[_0x1429('0x35')]);_0xa2e929[_0x1429('0x36')]=_[_0x1429('0x37')](_0xa2e929[_0x1429('0x34')],_0xa2e929[_0x1429('0x35')]);_0x14fa93[_0x1429('0x38')]=_[_0x1429('0x37')](_0xa2e929[_0x1429('0x34')],qs[_0x1429('0x39')](_0x2fa90e['query'][_0x1429('0x39')]));_0x14fa93[_0x1429('0x38')]=_0x14fa93[_0x1429('0x38')][_0x1429('0x3a')]?_0x14fa93[_0x1429('0x38')]:_0xa2e929[_0x1429('0x34')];if(!_0x2fa90e[_0x1429('0x35')][_0x1429('0x3b')](_0x1429('0x3c'))){_0x14fa93['limit']=qs['limit'](_0x2fa90e[_0x1429('0x35')][_0x1429('0x20')]);_0x14fa93[_0x1429('0x1e')]=qs[_0x1429('0x1e')](_0x2fa90e['query'][_0x1429('0x1e')]);}_0x14fa93[_0x1429('0x3d')]=qs[_0x1429('0x3e')](_0x2fa90e['query']['sort']);_0x14fa93['where']=qs['filters'](_[_0x1429('0x3f')](_0x2fa90e[_0x1429('0x35')],_0xa2e929[_0x1429('0x36')]),_0x263752);if(_0x2fa90e['query'][_0x1429('0x40')]){_0x14fa93[_0x1429('0x41')]=_[_0x1429('0x42')](_0x14fa93[_0x1429('0x41')],{'$or':_[_0x1429('0x2e')](_0x263752,function(_0x3f8e76){if(_0x3f8e76[_0x1429('0x32')]!==_0x1429('0x43')){var _0x10e3e1={};_0x10e3e1[_0x3f8e76['name']]={'$like':'%'+_0x2fa90e[_0x1429('0x35')][_0x1429('0x40')]+'%'};return _0x10e3e1;}})});}_0x14fa93=_[_0x1429('0x42')]({},_0x14fa93,_0x2fa90e[_0x1429('0x44')]);var _0x1cf727={'where':_0x14fa93['where']};return db[_0x1429('0x2f')][_0x1429('0x21')](_0x1cf727)['then'](function(_0x31836c){_0x4917d9[_0x1429('0x21')]=_0x31836c;if(_0x2fa90e['query'][_0x1429('0x45')]){_0x14fa93[_0x1429('0x46')]=[{'all':!![]}];}return db[_0x1429('0x2f')][_0x1429('0x47')](_0x14fa93);})[_0x1429('0x26')](function(_0x5dd5d9){_0x4917d9[_0x1429('0x48')]=_0x5dd5d9;return _0x4917d9;})[_0x1429('0x26')](respondWithFilteredResult(_0x1f4fb7,_0x14fa93))[_0x1429('0x49')](handleError(_0x1f4fb7,null));};exports['show']=function(_0x1bdb09,_0x491e9f){var _0x5b650f={'raw':!![],'where':{'id':_0x1bdb09[_0x1429('0x4a')]['id']}},_0x5263ac={};_0x5263ac[_0x1429('0x34')]=_[_0x1429('0x4b')](db[_0x1429('0x2f')]['rawAttributes']);_0x5263ac[_0x1429('0x35')]=_[_0x1429('0x4b')](_0x1bdb09[_0x1429('0x35')]);_0x5263ac[_0x1429('0x36')]=_[_0x1429('0x37')](_0x5263ac[_0x1429('0x34')],_0x5263ac[_0x1429('0x35')]);_0x5b650f['attributes']=_[_0x1429('0x37')](_0x5263ac['model'],qs[_0x1429('0x39')](_0x1bdb09[_0x1429('0x35')][_0x1429('0x39')]));_0x5b650f['attributes']=_0x5b650f['attributes'][_0x1429('0x3a')]?_0x5b650f[_0x1429('0x38')]:_0x5263ac[_0x1429('0x34')];if(_0x1bdb09[_0x1429('0x35')][_0x1429('0x45')]){_0x5b650f[_0x1429('0x46')]=[{'all':!![]}];}_0x5b650f=_['merge']({},_0x5b650f,_0x1bdb09[_0x1429('0x44')]);return db[_0x1429('0x2f')][_0x1429('0x4c')](_0x5b650f)[_0x1429('0x26')](handleEntityNotFound(_0x491e9f,null))['then'](respondWithResult(_0x491e9f,null))[_0x1429('0x49')](handleError(_0x491e9f,null));};exports[_0x1429('0x4d')]=function(_0x59a7b0,_0x548ad0){return db['VoiceDialReport'][_0x1429('0x4d')](_0x59a7b0['body'],{})[_0x1429('0x26')](respondWithResult(_0x548ad0,0xc9))[_0x1429('0x49')](handleError(_0x548ad0,null));};exports['update']=function(_0x461832,_0x2ae0bf){if(_0x461832['body']['id']){delete _0x461832[_0x1429('0x4e')]['id'];}return db['VoiceDialReport'][_0x1429('0x4c')]({'where':{'id':_0x461832[_0x1429('0x4a')]['id']}})[_0x1429('0x26')](handleEntityNotFound(_0x2ae0bf,null))['then'](saveUpdates(_0x461832[_0x1429('0x4e')],null))[_0x1429('0x26')](respondWithResult(_0x2ae0bf,null))['catch'](handleError(_0x2ae0bf,null));};exports[_0x1429('0x4f')]=function(_0x1bee52,_0x1c01a4){return db[_0x1429('0x2f')]['find']({'where':{'id':_0x1bee52[_0x1429('0x4a')]['id']}})[_0x1429('0x26')](handleEntityNotFound(_0x1c01a4,null))[_0x1429('0x26')](removeEntity(_0x1c01a4,null))[_0x1429('0x49')](handleError(_0x1c01a4,null));};exports[_0x1429('0x50')]=function(_0x5603d9,_0x37a5f0){return db[_0x1429('0x2f')][_0x1429('0x50')]()['then'](respondWithResult(_0x37a5f0,null))[_0x1429('0x49')](handleError(_0x37a5f0,null));}; \ No newline at end of file +var _0xbec9=['keys','length','include','find','catch','create','body','update','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','stack','name','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','show'];(function(_0x31a156,_0x51af0e){var _0x1d73d1=function(_0x1db470){while(--_0x1db470){_0x31a156['push'](_0x31a156['shift']());}};_0x1d73d1(++_0x51af0e);}(_0xbec9,0x99));var _0x9bec=function(_0x3cdc6f,_0x482f37){_0x3cdc6f=_0x3cdc6f-0x0;var _0x3c42f6=_0xbec9[_0x3cdc6f];return _0x3c42f6;};'use strict';var emlformat=require(_0x9bec('0x0'));var rimraf=require(_0x9bec('0x1'));var zipdir=require(_0x9bec('0x2'));var jsonpatch=require(_0x9bec('0x3'));var rp=require(_0x9bec('0x4'));var moment=require('moment');var BPromise=require(_0x9bec('0x5'));var Mustache=require(_0x9bec('0x6'));var util=require(_0x9bec('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9bec('0x8'));var ejs=require(_0x9bec('0x9'));var fs=require('fs');var fs_extra=require(_0x9bec('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9bec('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9bec('0xc'));var toCsv=require(_0x9bec('0x8'));var querystring=require(_0x9bec('0xd'));var Papa=require(_0x9bec('0xe'));var Redis=require(_0x9bec('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9bec('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bec('0x11'));var logger=require('../../config/logger')(_0x9bec('0x12'));var utils=require(_0x9bec('0x13'));var config=require(_0x9bec('0x14'));var licenseUtil=require(_0x9bec('0x15'));var db=require(_0x9bec('0x16'))['db'];function respondWithStatusCode(_0x52419a,_0x4273a0){_0x4273a0=_0x4273a0||0xcc;return function(_0x5d6f5c){if(_0x5d6f5c){return _0x52419a[_0x9bec('0x17')](_0x4273a0);}return _0x52419a[_0x9bec('0x18')](_0x4273a0)[_0x9bec('0x19')]();};}function respondWithResult(_0x5a1b2b,_0x397583){_0x397583=_0x397583||0xc8;return function(_0x2fd668){if(_0x2fd668){return _0x5a1b2b[_0x9bec('0x18')](_0x397583)[_0x9bec('0x1a')](_0x2fd668);}};}function respondWithFilteredResult(_0x266efd,_0x6684f4){return function(_0xa0e99){if(_0xa0e99){var _0x44343a=typeof _0x6684f4[_0x9bec('0x1b')]===_0x9bec('0x1c')&&typeof _0x6684f4[_0x9bec('0x1d')]===_0x9bec('0x1c');var _0x641a8=_0xa0e99['count'];var _0x154ad3=_0x44343a?0x0:_0x6684f4[_0x9bec('0x1b')];var _0x5edc2e=_0x44343a?_0xa0e99[_0x9bec('0x1e')]:_0x6684f4[_0x9bec('0x1b')]+_0x6684f4[_0x9bec('0x1d')];var _0x3aefcb;if(_0x5edc2e>=_0x641a8){_0x5edc2e=_0x641a8;_0x3aefcb=0xc8;}else{_0x3aefcb=0xce;}_0x266efd[_0x9bec('0x18')](_0x3aefcb);return _0x266efd[_0x9bec('0x1f')](_0x9bec('0x20'),_0x154ad3+'-'+_0x5edc2e+'/'+_0x641a8)[_0x9bec('0x1a')](_0xa0e99);}return null;};}function patchUpdates(_0x1cef40){return function(_0x1d5bdb){try{jsonpatch['apply'](_0x1d5bdb,_0x1cef40,!![]);}catch(_0x412fc0){return BPromise[_0x9bec('0x21')](_0x412fc0);}return _0x1d5bdb['save']();};}function saveUpdates(_0x28ee3d,_0x5078d7){return function(_0x196225){if(_0x196225){return _0x196225['update'](_0x28ee3d)[_0x9bec('0x22')](function(_0x4227b8){return _0x4227b8;});}return null;};}function removeEntity(_0x560527,_0x41ef40){return function(_0x556ecd){if(_0x556ecd){return _0x556ecd['destroy']()[_0x9bec('0x22')](function(){_0x560527[_0x9bec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xba72d,_0x4aa01c){return function(_0x1e2c38){if(!_0x1e2c38){_0xba72d[_0x9bec('0x17')](0x194);}return _0x1e2c38;};}function handleError(_0x2b2a2c,_0xaae3b7){_0xaae3b7=_0xaae3b7||0x1f4;return function(_0x1221a1){logger['error'](_0x1221a1[_0x9bec('0x23')]);if(_0x1221a1[_0x9bec('0x24')]){delete _0x1221a1['name'];}_0x2b2a2c[_0x9bec('0x18')](_0xaae3b7)['send'](_0x1221a1);};}exports[_0x9bec('0x25')]=function(_0x47cff1,_0x2cff0b){var _0x59dd93={},_0x31a551={},_0x2d0c67={'count':0x0,'rows':[]};var _0x15ae1c=_['map'](db[_0x9bec('0x26')][_0x9bec('0x27')],function(_0x49989a){return{'name':_0x49989a[_0x9bec('0x28')],'type':_0x49989a[_0x9bec('0x29')][_0x9bec('0x2a')]};});_0x31a551[_0x9bec('0x2b')]=_[_0x9bec('0x2c')](_0x15ae1c,_0x9bec('0x24'));_0x31a551[_0x9bec('0x2d')]=_['keys'](_0x47cff1['query']);_0x31a551[_0x9bec('0x2e')]=_[_0x9bec('0x2f')](_0x31a551[_0x9bec('0x2b')],_0x31a551[_0x9bec('0x2d')]);_0x59dd93['attributes']=_[_0x9bec('0x2f')](_0x31a551[_0x9bec('0x2b')],qs[_0x9bec('0x30')](_0x47cff1[_0x9bec('0x2d')]['fields']));_0x59dd93[_0x9bec('0x31')]=_0x59dd93['attributes']['length']?_0x59dd93[_0x9bec('0x31')]:_0x31a551[_0x9bec('0x2b')];if(!_0x47cff1[_0x9bec('0x2d')][_0x9bec('0x32')](_0x9bec('0x33'))){_0x59dd93['limit']=qs[_0x9bec('0x1d')](_0x47cff1[_0x9bec('0x2d')][_0x9bec('0x1d')]);_0x59dd93[_0x9bec('0x1b')]=qs[_0x9bec('0x1b')](_0x47cff1['query'][_0x9bec('0x1b')]);}_0x59dd93['order']=qs['sort'](_0x47cff1[_0x9bec('0x2d')][_0x9bec('0x34')]);_0x59dd93[_0x9bec('0x35')]=qs[_0x9bec('0x2e')](_[_0x9bec('0x36')](_0x47cff1['query'],_0x31a551['filters']),_0x15ae1c);if(_0x47cff1[_0x9bec('0x2d')]['filter']){_0x59dd93[_0x9bec('0x35')]=_[_0x9bec('0x37')](_0x59dd93[_0x9bec('0x35')],{'$or':_['map'](_0x15ae1c,function(_0x1ac559){if(_0x1ac559[_0x9bec('0x29')]!==_0x9bec('0x38')){var _0x5bad17={};_0x5bad17[_0x1ac559[_0x9bec('0x24')]]={'$like':'%'+_0x47cff1[_0x9bec('0x2d')][_0x9bec('0x39')]+'%'};return _0x5bad17;}})});}_0x59dd93=_[_0x9bec('0x37')]({},_0x59dd93,_0x47cff1['options']);var _0x4a73ef={'where':_0x59dd93['where']};return db['VoiceDialReport'][_0x9bec('0x1e')](_0x4a73ef)['then'](function(_0x160ffc){_0x2d0c67[_0x9bec('0x1e')]=_0x160ffc;if(_0x47cff1[_0x9bec('0x2d')][_0x9bec('0x3a')]){_0x59dd93['include']=[{'all':!![]}];}return db[_0x9bec('0x26')]['findAll'](_0x59dd93);})[_0x9bec('0x22')](function(_0x49f81d){_0x2d0c67['rows']=_0x49f81d;return _0x2d0c67;})['then'](respondWithFilteredResult(_0x2cff0b,_0x59dd93))['catch'](handleError(_0x2cff0b,null));};exports[_0x9bec('0x3b')]=function(_0x308a5c,_0x4331c9){var _0x1346d6={'raw':!![],'where':{'id':_0x308a5c['params']['id']}},_0x1be790={};_0x1be790[_0x9bec('0x2b')]=_[_0x9bec('0x3c')](db[_0x9bec('0x26')]['rawAttributes']);_0x1be790[_0x9bec('0x2d')]=_[_0x9bec('0x3c')](_0x308a5c['query']);_0x1be790[_0x9bec('0x2e')]=_[_0x9bec('0x2f')](_0x1be790[_0x9bec('0x2b')],_0x1be790[_0x9bec('0x2d')]);_0x1346d6['attributes']=_[_0x9bec('0x2f')](_0x1be790[_0x9bec('0x2b')],qs[_0x9bec('0x30')](_0x308a5c[_0x9bec('0x2d')]['fields']));_0x1346d6[_0x9bec('0x31')]=_0x1346d6[_0x9bec('0x31')][_0x9bec('0x3d')]?_0x1346d6[_0x9bec('0x31')]:_0x1be790[_0x9bec('0x2b')];if(_0x308a5c[_0x9bec('0x2d')][_0x9bec('0x3a')]){_0x1346d6[_0x9bec('0x3e')]=[{'all':!![]}];}_0x1346d6=_[_0x9bec('0x37')]({},_0x1346d6,_0x308a5c['options']);return db[_0x9bec('0x26')][_0x9bec('0x3f')](_0x1346d6)[_0x9bec('0x22')](handleEntityNotFound(_0x4331c9,null))[_0x9bec('0x22')](respondWithResult(_0x4331c9,null))[_0x9bec('0x40')](handleError(_0x4331c9,null));};exports[_0x9bec('0x41')]=function(_0x5b8ccc,_0x3a63b8){return db['VoiceDialReport'][_0x9bec('0x41')](_0x5b8ccc[_0x9bec('0x42')],{})[_0x9bec('0x22')](respondWithResult(_0x3a63b8,0xc9))['catch'](handleError(_0x3a63b8,null));};exports[_0x9bec('0x43')]=function(_0x5ac7d2,_0x54ce89){if(_0x5ac7d2['body']['id']){delete _0x5ac7d2[_0x9bec('0x42')]['id'];}return db[_0x9bec('0x26')][_0x9bec('0x3f')]({'where':{'id':_0x5ac7d2['params']['id']}})[_0x9bec('0x22')](handleEntityNotFound(_0x54ce89,null))[_0x9bec('0x22')](saveUpdates(_0x5ac7d2[_0x9bec('0x42')],null))[_0x9bec('0x22')](respondWithResult(_0x54ce89,null))[_0x9bec('0x40')](handleError(_0x54ce89,null));};exports[_0x9bec('0x44')]=function(_0x1027bf,_0x3d3a2c){return db[_0x9bec('0x26')][_0x9bec('0x3f')]({'where':{'id':_0x1027bf[_0x9bec('0x45')]['id']}})[_0x9bec('0x22')](handleEntityNotFound(_0x3d3a2c,null))['then'](removeEntity(_0x3d3a2c,null))['catch'](handleError(_0x3d3a2c,null));};exports[_0x9bec('0x46')]=function(_0x2ca523,_0x549fc1){return db['VoiceDialReport']['describe']()[_0x9bec('0x22')](respondWithResult(_0x549fc1,null))['catch'](handleError(_0x549fc1,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c2fcffa..e47a71f 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 _0xe5ff=['../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2bbbad,_0x25d621){var _0x996090=function(_0x8b5294){while(--_0x8b5294){_0x2bbbad['push'](_0x2bbbad['shift']());}};_0x996090(++_0x25d621);}(_0xe5ff,0xf7));var _0xfe5f=function(_0x3f4770,_0xa5714e){_0x3f4770=_0x3f4770-0x0;var _0x373b9a=_0xe5ff[_0x3f4770];return _0x373b9a;};'use strict';var _=require(_0xfe5f('0x0'));var util=require(_0xfe5f('0x1'));var logger=require('../../config/logger')(_0xfe5f('0x2'));var moment=require(_0xfe5f('0x3'));var BPromise=require(_0xfe5f('0x4'));var rp=require(_0xfe5f('0x5'));var fs=require('fs');var path=require(_0xfe5f('0x6'));var rimraf=require(_0xfe5f('0x7'));var config=require(_0xfe5f('0x8'));var attributes=require(_0xfe5f('0x9'));module[_0xfe5f('0xa')]=function(_0x4169d9,_0x2b01c4){return _0x4169d9[_0xfe5f('0xb')](_0xfe5f('0xc'),attributes,{'tableName':_0xfe5f('0xd'),'paranoid':![],'indexes':[{'fields':[_0xfe5f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe64b=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe64b,0x188));var _0xbe64=function(_0x4a6eaf,_0x3ada68){_0x4a6eaf=_0x4a6eaf-0x0;var _0x46299d=_0xe64b[_0x4a6eaf];return _0x46299d;};'use strict';var _=require(_0xbe64('0x0'));var util=require(_0xbe64('0x1'));var logger=require(_0xbe64('0x2'))(_0xbe64('0x3'));var moment=require(_0xbe64('0x4'));var BPromise=require(_0xbe64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe64('0x6'));var rimraf=require('rimraf');var config=require(_0xbe64('0x7'));var attributes=require(_0xbe64('0x8'));module[_0xbe64('0x9')]=function(_0x231846,_0x280f8c){return _0x231846[_0xbe64('0xa')](_0xbe64('0xb'),attributes,{'tableName':_0xbe64('0xc'),'paranoid':![],'indexes':[{'fields':[_0xbe64('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 8d8919a..549b138 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 _0x12e1=['info','catch','VoiceDialReport','create','body','raw','then','CreateVoiceDialReport','options','where','limit','UpdateVoiceDialReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4b04f0,_0x1704a8){var _0x34e406=function(_0x4c38fc){while(--_0x4c38fc){_0x4b04f0['push'](_0x4b04f0['shift']());}};_0x34e406(++_0x1704a8);}(_0x12e1,0x178));var _0x112e=function(_0x3eb1ec,_0xadb83f){_0x3eb1ec=_0x3eb1ec-0x0;var _0x4520af=_0x12e1[_0x3eb1ec];return _0x4520af;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x112e('0x0'));var BPromise=require(_0x112e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x112e('0x2'));var db=require(_0x112e('0x3'))['db'];var utils=require(_0x112e('0x4'));var logger=require(_0x112e('0x5'))(_0x112e('0x6'));var config=require(_0x112e('0x7'));var jayson=require(_0x112e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5406cc,_0x548af9,_0x484e60){return new BPromise(function(_0x157bc6,_0x4aaf90){return client['request'](_0x5406cc,_0x484e60)['then'](function(_0x37b5f4){logger['info'](_0x112e('0x9'),_0x548af9,_0x112e('0xa'));logger[_0x112e('0xb')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x548af9,_0x112e('0xa'),JSON[_0x112e('0xc')](_0x37b5f4));if(_0x37b5f4[_0x112e('0xd')]){if(_0x37b5f4[_0x112e('0xd')][_0x112e('0xe')]===0x1f4){logger[_0x112e('0xd')](_0x112e('0x9'),_0x548af9,_0x37b5f4[_0x112e('0xd')]['message']);return _0x4aaf90(_0x37b5f4[_0x112e('0xd')][_0x112e('0xf')]);}logger[_0x112e('0xd')](_0x112e('0x9'),_0x548af9,_0x37b5f4[_0x112e('0xd')][_0x112e('0xf')]);return _0x157bc6(_0x37b5f4[_0x112e('0xd')]['message']);}else{logger[_0x112e('0x10')](_0x112e('0x9'),_0x548af9,_0x112e('0xa'));_0x157bc6(_0x37b5f4['result'][_0x112e('0xf')]);}})[_0x112e('0x11')](function(_0x30cec0){logger[_0x112e('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x548af9,_0x30cec0);_0x4aaf90(_0x30cec0);});});}exports['CreateVoiceDialReport']=function(_0x2fd54a){var _0x3a5021=this;return new Promise(function(_0x32e350,_0x2ce2ad){return db[_0x112e('0x12')][_0x112e('0x13')](_0x2fd54a[_0x112e('0x14')],{'raw':_0x2fd54a['options']?_0x2fd54a['options'][_0x112e('0x15')]===undefined?!![]:![]:!![]})[_0x112e('0x16')](function(_0x469040){logger['info']('CreateVoiceDialReport',_0x2fd54a);logger[_0x112e('0xb')](_0x112e('0x17'),_0x2fd54a,JSON[_0x112e('0xc')](_0x469040));_0x32e350(_0x469040);})[_0x112e('0x11')](function(_0x13bdf9){logger[_0x112e('0xd')](_0x112e('0x17'),_0x13bdf9[_0x112e('0xf')],_0x2fd54a);_0x2ce2ad(_0x3a5021[_0x112e('0xd')](0x1f4,_0x13bdf9['message']));});});};exports['UpdateVoiceDialReport']=function(_0x27d74a){var _0x317164=this;return new Promise(function(_0x4b5815,_0x5cd1f6){return db[_0x112e('0x12')]['update'](_0x27d74a[_0x112e('0x14')],{'raw':_0x27d74a[_0x112e('0x18')]?_0x27d74a[_0x112e('0x18')][_0x112e('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27d74a[_0x112e('0x18')]?_0x27d74a[_0x112e('0x18')][_0x112e('0x19')]||null:null,'attributes':_0x27d74a[_0x112e('0x18')]?_0x27d74a[_0x112e('0x18')]['attributes']||null:null,'limit':_0x27d74a[_0x112e('0x18')]?_0x27d74a['options'][_0x112e('0x1a')]||null:null})[_0x112e('0x16')](function(_0x52a37b){logger[_0x112e('0x10')](_0x112e('0x1b'),_0x27d74a);logger['debug'](_0x112e('0x1b'),_0x27d74a,JSON[_0x112e('0xc')](_0x52a37b));_0x4b5815(_0x52a37b);})['catch'](function(_0x4c4919){logger[_0x112e('0xd')](_0x112e('0x1b'),_0x4c4919[_0x112e('0xf')],_0x27d74a);_0x5cd1f6(_0x317164[_0x112e('0xd')](0x1f4,_0x4c4919['message']));});});}; \ No newline at end of file +var _0x2f97=['../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceDialReport','create','options','raw','debug','VoiceDialReport','body','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f97,0x1c6));var _0x72f9=function(_0x41f9ff,_0x560607){_0x41f9ff=_0x41f9ff-0x0;var _0x55c95d=_0x2f97[_0x41f9ff];return _0x55c95d;};'use strict';var _=require(_0x72f9('0x0'));var util=require(_0x72f9('0x1'));var moment=require(_0x72f9('0x2'));var BPromise=require(_0x72f9('0x3'));var rs=require(_0x72f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72f9('0x5'))['db'];var utils=require(_0x72f9('0x6'));var logger=require(_0x72f9('0x7'))('rpc');var config=require(_0x72f9('0x8'));var jayson=require(_0x72f9('0x9'));var client=jayson[_0x72f9('0xa')][_0x72f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2386c8,_0x17ae5e,_0xf4b692){return new BPromise(function(_0x143ed9,_0x539ac8){return client['request'](_0x2386c8,_0xf4b692)[_0x72f9('0xc')](function(_0x2be026){logger[_0x72f9('0xd')](_0x72f9('0xe'),_0x17ae5e,'request\x20sent');logger['debug'](_0x72f9('0xf'),_0x17ae5e,_0x72f9('0x10'),JSON[_0x72f9('0x11')](_0x2be026));if(_0x2be026[_0x72f9('0x12')]){if(_0x2be026[_0x72f9('0x12')]['code']===0x1f4){logger['error'](_0x72f9('0xe'),_0x17ae5e,_0x2be026[_0x72f9('0x12')][_0x72f9('0x13')]);return _0x539ac8(_0x2be026['error']['message']);}logger[_0x72f9('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x17ae5e,_0x2be026[_0x72f9('0x12')]['message']);return _0x143ed9(_0x2be026[_0x72f9('0x12')][_0x72f9('0x13')]);}else{logger[_0x72f9('0xd')](_0x72f9('0xe'),_0x17ae5e,_0x72f9('0x10'));_0x143ed9(_0x2be026[_0x72f9('0x14')][_0x72f9('0x13')]);}})[_0x72f9('0x15')](function(_0x31459f){logger[_0x72f9('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x17ae5e,_0x31459f);_0x539ac8(_0x31459f);});});}exports[_0x72f9('0x16')]=function(_0xd54543){var _0x4621bb=this;return new Promise(function(_0x294613,_0x1e8afe){return db['VoiceDialReport'][_0x72f9('0x17')](_0xd54543['body'],{'raw':_0xd54543[_0x72f9('0x18')]?_0xd54543[_0x72f9('0x18')][_0x72f9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f5a4f){logger[_0x72f9('0xd')](_0x72f9('0x16'),_0xd54543);logger[_0x72f9('0x1a')](_0x72f9('0x16'),_0xd54543,JSON[_0x72f9('0x11')](_0x4f5a4f));_0x294613(_0x4f5a4f);})[_0x72f9('0x15')](function(_0x1ef423){logger[_0x72f9('0x12')](_0x72f9('0x16'),_0x1ef423[_0x72f9('0x13')],_0xd54543);_0x1e8afe(_0x4621bb[_0x72f9('0x12')](0x1f4,_0x1ef423[_0x72f9('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x1fef19){var _0x38b61a=this;return new Promise(function(_0xe6f9ad,_0x4ee9b5){return db[_0x72f9('0x1b')]['update'](_0x1fef19[_0x72f9('0x1c')],{'raw':_0x1fef19[_0x72f9('0x18')]?_0x1fef19[_0x72f9('0x18')][_0x72f9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fef19['options']?_0x1fef19[_0x72f9('0x18')][_0x72f9('0x1d')]||null:null,'attributes':_0x1fef19[_0x72f9('0x18')]?_0x1fef19['options'][_0x72f9('0x1e')]||null:null,'limit':_0x1fef19[_0x72f9('0x18')]?_0x1fef19[_0x72f9('0x18')][_0x72f9('0x1f')]||null:null})[_0x72f9('0xc')](function(_0x1ca674){logger[_0x72f9('0xd')](_0x72f9('0x20'),_0x1fef19);logger[_0x72f9('0x1a')](_0x72f9('0x20'),_0x1fef19,JSON[_0x72f9('0x11')](_0x1ca674));_0xe6f9ad(_0x1ca674);})[_0x72f9('0x15')](function(_0x1fb306){logger[_0x72f9('0x12')](_0x72f9('0x20'),_0x1fb306[_0x72f9('0x13')],_0x1fef19);_0x4ee9b5(_0x38b61a[_0x72f9('0x12')](0x1f4,_0x1fb306[_0x72f9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 4cb122a..2ab4352 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 _0xb9f0=['update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','post','/:id/applications','addApplications','put'];(function(_0x2269c5,_0x5eef08){var _0x248d92=function(_0x5c8fcf){while(--_0x5c8fcf){_0x2269c5['push'](_0x2269c5['shift']());}};_0x248d92(++_0x5eef08);}(_0xb9f0,0x121));var _0x0b9f=function(_0x1de641,_0x44d464){_0x1de641=_0x1de641-0x0;var _0xccacbc=_0xb9f0[_0x1de641];return _0xccacbc;};'use strict';var multer=require(_0x0b9f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0b9f('0x1'));var express=require(_0x0b9f('0x2'));var router=express['Router']();var fs_extra=require(_0x0b9f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0b9f('0x4'));var controller=require(_0x0b9f('0x5'));router['get']('/',auth[_0x0b9f('0x6')](),controller[_0x0b9f('0x7')]);router[_0x0b9f('0x8')](_0x0b9f('0x9'),auth[_0x0b9f('0x6')](),controller[_0x0b9f('0xa')]);router[_0x0b9f('0xb')]('/',auth[_0x0b9f('0x6')](),controller['create']);router[_0x0b9f('0xb')](_0x0b9f('0xc'),auth[_0x0b9f('0x6')](),controller[_0x0b9f('0xd')]);router[_0x0b9f('0xe')](_0x0b9f('0x9'),auth[_0x0b9f('0x6')](),controller[_0x0b9f('0xf')]);router[_0x0b9f('0x10')](_0x0b9f('0x9'),auth[_0x0b9f('0x6')](),controller[_0x0b9f('0x11')]);module[_0x0b9f('0x12')]=router; \ No newline at end of file +var _0xe6f2=['post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show'];(function(_0x33925b,_0x95cfc6){var _0x375e21=function(_0x57c759){while(--_0x57c759){_0x33925b['push'](_0x33925b['shift']());}};_0x375e21(++_0x95cfc6);}(_0xe6f2,0x7c));var _0x2e6f=function(_0x587a49,_0x45b78c){_0x587a49=_0x587a49-0x0;var _0x557103=_0xe6f2[_0x587a49];return _0x557103;};'use strict';var multer=require(_0x2e6f('0x0'));var util=require(_0x2e6f('0x1'));var path=require(_0x2e6f('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e6f('0x3'));var router=express[_0x2e6f('0x4')]();var fs_extra=require(_0x2e6f('0x5'));var auth=require(_0x2e6f('0x6'));var interaction=require(_0x2e6f('0x7'));var config=require(_0x2e6f('0x8'));var controller=require(_0x2e6f('0x9'));router[_0x2e6f('0xa')]('/',auth[_0x2e6f('0xb')](),controller['index']);router[_0x2e6f('0xa')](_0x2e6f('0xc'),auth[_0x2e6f('0xb')](),controller[_0x2e6f('0xd')]);router[_0x2e6f('0xe')]('/',auth[_0x2e6f('0xb')](),controller[_0x2e6f('0xf')]);router['post'](_0x2e6f('0x10'),auth[_0x2e6f('0xb')](),controller[_0x2e6f('0x11')]);router[_0x2e6f('0x12')](_0x2e6f('0xc'),auth[_0x2e6f('0xb')](),controller[_0x2e6f('0x13')]);router[_0x2e6f('0x14')](_0x2e6f('0xc'),auth[_0x2e6f('0xb')](),controller[_0x2e6f('0x15')]);module[_0x2e6f('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c0a96ea..fbdef1e 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 _0xbd3e=['internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound'];(function(_0x540c06,_0x461ad3){var _0x3fa246=function(_0x4c5221){while(--_0x4c5221){_0x540c06['push'](_0x540c06['shift']());}};_0x3fa246(++_0x461ad3);}(_0xbd3e,0x1c4));var _0xebd3=function(_0x3c46f5,_0x130858){_0x3c46f5=_0x3c46f5-0x0;var _0x1edb84=_0xbd3e[_0x3c46f5];return _0x1edb84;};'use strict';var Sequelize=require(_0xebd3('0x0'));module[_0xebd3('0x1')]={'context':{'type':Sequelize[_0xebd3('0x2')],'allowNull':![],'unique':_0xebd3('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xebd3('0x3')},'priority':{'type':Sequelize[_0xebd3('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xebd3('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xebd3('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xebd3('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xebd3('0x4')](_0xebd3('0x5'),_0xebd3('0x6'),_0xebd3('0x7'),'inbound-fax',_0xebd3('0x8'),_0xebd3('0x9'),_0xebd3('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xebd3('0x2')],'allowNull':![],'defaultValue':_0xebd3('0xb')},'IntervalId':{'type':Sequelize[_0xebd3('0xc')]},'isApp':{'type':Sequelize[_0xebd3('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xebd3('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xebd3('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xebd3('0xc')]},'recordingFormat':{'type':Sequelize[_0xebd3('0x2')],'defaultValue':_0xebd3('0xe')},'answer':{'type':Sequelize[_0xebd3('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xebd3('0xf')],'get':function(_0x4ee731){return this['getDataValue'](_0xebd3('0x10'));}},'alias':{'type':Sequelize[_0xebd3('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x3854=['NoOp','ENUM','inbound','outbound','outbound-fax','system','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex'];(function(_0x5d7caa,_0x468c97){var _0x53e8f0=function(_0x726fc8){while(--_0x726fc8){_0x5d7caa['push'](_0x5d7caa['shift']());}};_0x53e8f0(++_0x468c97);}(_0x3854,0x183));var _0x4385=function(_0x2c1a16,_0x2e0cb4){_0x2c1a16=_0x2c1a16-0x0;var _0x51c0cf=_0x3854[_0x2c1a16];return _0x51c0cf;};'use strict';var Sequelize=require(_0x4385('0x0'));module[_0x4385('0x1')]={'context':{'type':Sequelize[_0x4385('0x2')],'allowNull':![],'unique':_0x4385('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4385('0x2')],'allowNull':![],'unique':_0x4385('0x3')},'priority':{'type':Sequelize[_0x4385('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4385('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4385('0x2')],'allowNull':![],'defaultValue':_0x4385('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4385('0x5')](_0x4385('0x6'),_0x4385('0x7'),'internal','inbound-fax',_0x4385('0x8'),_0x4385('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x4385('0x2')]},'interval':{'type':Sequelize[_0x4385('0x2')],'allowNull':![],'defaultValue':_0x4385('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x4385('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4385('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4385('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4385('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4385('0xc')]},'recordingFormat':{'type':Sequelize[_0x4385('0x2')],'defaultValue':_0x4385('0xd')},'answer':{'type':Sequelize[_0x4385('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4385('0xe')],'get':function(_0x42ebd2){return this[_0x4385('0xf')](_0x4385('0x10'));}},'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 1b79542..1c737c5 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 _0xfe79=['autoAssociation','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','map','value','includes','find','type','name','UserProfileResource','error','stack','send','index','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','options','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InternalRoutes','UserProfileSection','userProfileId'];(function(_0x39fb6c,_0x48a40e){var _0x405245=function(_0x4d9429){while(--_0x4d9429){_0x39fb6c['push'](_0x39fb6c['shift']());}};_0x405245(++_0x48a40e);}(_0xfe79,0x139));var _0x9fe7=function(_0x4e9274,_0x49576e){_0x4e9274=_0x4e9274-0x0;var _0x8b474c=_0xfe79[_0x4e9274];return _0x8b474c;};'use strict';var _=require(_0x9fe7('0x0'));var Redis=require('ioredis');var qs=require(_0x9fe7('0x1'));var logger=require('../../config/logger')(_0x9fe7('0x2'));var config=require(_0x9fe7('0x3'));var db=require(_0x9fe7('0x4'))['db'];config[_0x9fe7('0x5')]=_[_0x9fe7('0x6')](config[_0x9fe7('0x5')],{'host':_0x9fe7('0x7'),'port':0x18eb});var socket=require(_0x9fe7('0x8'))(new Redis(config['redis']));require(_0x9fe7('0x9'))[_0x9fe7('0xa')](socket);function respondWithStatusCode(_0x39f83a,_0x1802f3){_0x1802f3=_0x1802f3||0xcc;return function(_0x282b01){if(_0x282b01){return _0x39f83a[_0x9fe7('0xb')](_0x1802f3);}return _0x39f83a[_0x9fe7('0xc')](_0x1802f3)[_0x9fe7('0xd')]();};}function respondWithResult(_0x1ba305,_0x19d183){_0x19d183=_0x19d183||0xc8;return function(_0x15d981){if(_0x15d981){return _0x1ba305['status'](_0x19d183)[_0x9fe7('0xe')](_0x15d981);}};}function respondWithFilteredResult(_0x1a381a,_0x394136){return function(_0x4f7c85){if(_0x4f7c85){var _0x2cb1ff=typeof _0x394136[_0x9fe7('0xf')]===_0x9fe7('0x10')&&typeof _0x394136[_0x9fe7('0x11')]===_0x9fe7('0x10');var _0x431611=_0x4f7c85[_0x9fe7('0x12')];var _0x1b1b55=_0x2cb1ff?0x0:_0x394136[_0x9fe7('0xf')];var _0x5ec19c=_0x2cb1ff?_0x4f7c85['count']:_0x394136[_0x9fe7('0xf')]+_0x394136['limit'];var _0x3af230;if(_0x5ec19c>=_0x431611){_0x5ec19c=_0x431611;_0x3af230=0xc8;}else{_0x3af230=0xce;}_0x1a381a[_0x9fe7('0xc')](_0x3af230);return _0x1a381a[_0x9fe7('0x13')](_0x9fe7('0x14'),_0x1b1b55+'-'+_0x5ec19c+'/'+_0x431611)['json'](_0x4f7c85);}return null;};}function removeEntity(_0x33daff){return function(_0x22193a){if(_0x22193a){return _0x22193a[_0x9fe7('0x15')]()[_0x9fe7('0x16')](function(){var _0xd1dc72=_0x22193a[_0x9fe7('0x17')]({'plain':!![]});var _0x17bd76=[{'name':_0x9fe7('0x18'),'value':_0x9fe7('0x19'),'ignore':![]},{'name':_0x9fe7('0x1a'),'value':_0x9fe7('0x1b'),'ignore':![]},{'name':'InternalRoutes','value':_0x9fe7('0x1c'),'ignore':![]}];var _0x42b829=_(_0x17bd76)['filter']('ignore')[_0x9fe7('0x1d')](_0x9fe7('0x1e'))['value']();if(_[_0x9fe7('0x1f')](_0x42b829,_0xd1dc72['type'])){return;}var _0x46be8b=_[_0x9fe7('0x20')](_0x17bd76,[_0x9fe7('0x1e'),_0xd1dc72[_0x9fe7('0x21')]])[_0x9fe7('0x22')];return db[_0x9fe7('0x23')][_0x9fe7('0x15')]({'where':{'type':_0x46be8b,'resourceId':_0xd1dc72['id']}})[_0x9fe7('0x16')](function(){return _0x22193a;});})[_0x9fe7('0x16')](function(){_0x33daff[_0x9fe7('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x449602){return function(_0x5afd9f){if(!_0x5afd9f){_0x449602[_0x9fe7('0xb')](0x194);}return _0x5afd9f;};}function handleError(_0x41e1bf,_0x5e8ab4){_0x5e8ab4=_0x5e8ab4||0x1f4;return function(_0x58e611){logger[_0x9fe7('0x24')](_0x58e611[_0x9fe7('0x25')]);if(_0x58e611['name']){delete _0x58e611[_0x9fe7('0x22')];}_0x41e1bf[_0x9fe7('0xc')](_0x5e8ab4)[_0x9fe7('0x26')](_0x58e611);};}exports[_0x9fe7('0x27')]=function(_0xe196a5,_0x12528c){var _0x4e4e67={},_0x3b7789={},_0x3ebfd6={'count':0x0,'rows':[]};var _0x331e2c=_[_0x9fe7('0x1d')](db['VoiceExtension']['rawAttributes'],function(_0x47a39e){return{'name':_0x47a39e[_0x9fe7('0x28')],'type':_0x47a39e[_0x9fe7('0x21')][_0x9fe7('0x29')]};});_0x3b7789['model']=_['map'](_0x331e2c,_0x9fe7('0x22'));_0x3b7789[_0x9fe7('0x2a')]=_[_0x9fe7('0x2b')](_0xe196a5[_0x9fe7('0x2a')]);_0x3b7789['filters']=_[_0x9fe7('0x2c')](_0x3b7789[_0x9fe7('0x2d')],_0x3b7789[_0x9fe7('0x2a')]);_0x4e4e67['attributes']=_[_0x9fe7('0x2c')](_0x3b7789['model'],qs[_0x9fe7('0x2e')](_0xe196a5[_0x9fe7('0x2a')][_0x9fe7('0x2e')]));_0x4e4e67['attributes']=_0x4e4e67[_0x9fe7('0x2f')][_0x9fe7('0x30')]?_0x4e4e67[_0x9fe7('0x2f')]:_0x3b7789[_0x9fe7('0x2d')];if(!_0xe196a5[_0x9fe7('0x2a')][_0x9fe7('0x31')](_0x9fe7('0x32'))){_0x4e4e67[_0x9fe7('0x11')]=qs[_0x9fe7('0x11')](_0xe196a5[_0x9fe7('0x2a')][_0x9fe7('0x11')]);_0x4e4e67[_0x9fe7('0xf')]=qs['offset'](_0xe196a5['query'][_0x9fe7('0xf')]);}_0x4e4e67[_0x9fe7('0x33')]=qs[_0x9fe7('0x34')](_0xe196a5[_0x9fe7('0x2a')]['sort']);_0x4e4e67[_0x9fe7('0x35')]=qs[_0x9fe7('0x36')](_[_0x9fe7('0x37')](_0xe196a5[_0x9fe7('0x2a')],_0x3b7789[_0x9fe7('0x36')]),_0x331e2c);if(_0xe196a5[_0x9fe7('0x2a')][_0x9fe7('0x38')]){_0x4e4e67[_0x9fe7('0x35')]=_['merge'](_0x4e4e67['where'],{'$or':_[_0x9fe7('0x1d')](_0x331e2c,function(_0x446f1f){if(_0x446f1f['type']!==_0x9fe7('0x39')){var _0x226bd0={};_0x226bd0[_0x446f1f[_0x9fe7('0x22')]]={'$like':'%'+_0xe196a5[_0x9fe7('0x2a')][_0x9fe7('0x38')]+'%'};return _0x226bd0;}})});}_0x4e4e67=_['merge']({},_0x4e4e67,_0xe196a5['options']);var _0x3e8866={'where':_0x4e4e67[_0x9fe7('0x35')]};return db[_0x9fe7('0x3a')][_0x9fe7('0x12')](_0x3e8866)[_0x9fe7('0x16')](function(_0x5051fd){_0x3ebfd6[_0x9fe7('0x12')]=_0x5051fd;if(_0xe196a5[_0x9fe7('0x2a')][_0x9fe7('0x3b')]){_0x4e4e67[_0x9fe7('0x3c')]=[{'all':!![]}];}return db['VoiceExtension'][_0x9fe7('0x3d')](_0x4e4e67);})['then'](function(_0x17951f){_0x3ebfd6[_0x9fe7('0x3e')]=_0x17951f;return _0x3ebfd6;})[_0x9fe7('0x16')](respondWithFilteredResult(_0x12528c,_0x4e4e67))[_0x9fe7('0x3f')](handleError(_0x12528c,null));};exports[_0x9fe7('0x40')]=function(_0x477513,_0x147131){var _0x5e7e44={'raw':![],'where':{'id':_0x477513[_0x9fe7('0x41')]['id']}},_0x5cb643={};_0x5cb643[_0x9fe7('0x2d')]=_[_0x9fe7('0x2b')](db[_0x9fe7('0x3a')][_0x9fe7('0x42')]);_0x5cb643[_0x9fe7('0x2a')]=_[_0x9fe7('0x2b')](_0x477513[_0x9fe7('0x2a')]);_0x5cb643[_0x9fe7('0x36')]=_['intersection'](_0x5cb643['model'],_0x5cb643[_0x9fe7('0x2a')]);_0x5e7e44[_0x9fe7('0x2f')]=_[_0x9fe7('0x2c')](_0x5cb643[_0x9fe7('0x2d')],qs[_0x9fe7('0x2e')](_0x477513[_0x9fe7('0x2a')][_0x9fe7('0x2e')]));_0x5e7e44[_0x9fe7('0x2f')]=_0x5e7e44[_0x9fe7('0x2f')][_0x9fe7('0x30')]?_0x5e7e44[_0x9fe7('0x2f')]:_0x5cb643[_0x9fe7('0x2d')];if(_0x477513['query'][_0x9fe7('0x3b')]){_0x5e7e44['include']=[{'all':!![]}];}_0x5e7e44=_[_0x9fe7('0x43')]({},_0x5e7e44,_0x477513[_0x9fe7('0x44')]);return db[_0x9fe7('0x3a')][_0x9fe7('0x20')](_0x5e7e44)[_0x9fe7('0x16')](handleEntityNotFound(_0x147131,null))[_0x9fe7('0x16')](respondWithResult(_0x147131,null))['catch'](handleError(_0x147131,null));};exports[_0x9fe7('0x15')]=function(_0x23aff5,_0x3b728e){return db[_0x9fe7('0x3a')]['find']({'where':{'id':_0x23aff5['params']['id']}})[_0x9fe7('0x16')](handleEntityNotFound(_0x3b728e,null))[_0x9fe7('0x16')](removeEntity(_0x3b728e,null))[_0x9fe7('0x3f')](handleError(_0x3b728e,null));};exports[_0x9fe7('0x45')]=function(_0x26d0e8,_0x4aa6a3){if(_0x26d0e8[_0x9fe7('0x46')]['type']===_0x9fe7('0x1b')&&!_[_0x9fe7('0x47')](_0x26d0e8[_0x9fe7('0x46')][_0x9fe7('0x48')],'_')){_0x26d0e8[_0x9fe7('0x46')][_0x9fe7('0x48')]='_'[_0x9fe7('0x49')](_0x26d0e8[_0x9fe7('0x46')][_0x9fe7('0x48')]);}return db[_0x9fe7('0x3a')][_0x9fe7('0x45')](_0x26d0e8[_0x9fe7('0x46')],{'raw':![]})[_0x9fe7('0x16')](function(_0x3a54ed){var _0x21b93f=_0x26d0e8[_0x9fe7('0x4a')][_0x9fe7('0x17')]({'plain':!![]});if(!_0x21b93f)throw new Error(_0x9fe7('0x4b'));if(_0x21b93f['role']==='user'){var _0xf2841d=_0x3a54ed[_0x9fe7('0x17')]({'plain':!![]});var _0x2af314=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x9fe7('0x1a'),'value':_0x9fe7('0x1b')},{'name':_0x9fe7('0x4c'),'value':_0x9fe7('0x1c')}];var _0xfc9b8=_[_0x9fe7('0x20')](_0x2af314,[_0x9fe7('0x1e'),_0xf2841d[_0x9fe7('0x21')]])[_0x9fe7('0x22')];return db[_0x9fe7('0x4d')][_0x9fe7('0x20')]({'where':{'name':_0xfc9b8,'userProfileId':_0x21b93f[_0x9fe7('0x4e')]},'raw':!![]})[_0x9fe7('0x16')](function(_0x2d7d58){if(_0x2d7d58&&_0x2d7d58[_0x9fe7('0x4f')]===0x0){return db['UserProfileResource'][_0x9fe7('0x45')]({'name':_0xf2841d[_0x9fe7('0x22')],'resourceId':_0xf2841d['id'],'type':_0x2d7d58[_0x9fe7('0x22')],'sectionId':_0x2d7d58['id']},{})[_0x9fe7('0x16')](function(){return _0x3a54ed;});}else{return _0x3a54ed;}})[_0x9fe7('0x3f')](function(_0x5ed37c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ed37c);throw _0x5ed37c;});}return _0x3a54ed;})[_0x9fe7('0x16')](respondWithResult(_0x4aa6a3,0xc9))[_0x9fe7('0x3f')](handleError(_0x4aa6a3,null));};exports[_0x9fe7('0x50')]=function(_0x2289e2,_0x36d2cb){if(_0x2289e2[_0x9fe7('0x46')]['id']){delete _0x2289e2['body']['id'];}return db['VoiceExtension'][_0x9fe7('0x20')]({'where':{'id':_0x2289e2[_0x9fe7('0x41')]['id']}})[_0x9fe7('0x16')](handleEntityNotFound(_0x36d2cb,null))[_0x9fe7('0x16')](function(_0x595d7a){if(_0x595d7a){return db[_0x9fe7('0x3a')][_0x9fe7('0x50')](_[_0x9fe7('0x37')](_0x2289e2[_0x9fe7('0x46')],[_0x9fe7('0x48'),_0x9fe7('0x51'),_0x9fe7('0x52'),_0x9fe7('0x53'),_0x9fe7('0x54'),_0x9fe7('0x55'),'alias']),{'where':{'context':_0x595d7a[_0x9fe7('0x51')],'exten':_0x595d7a[_0x9fe7('0x48')]},'individualHooks':!![]})['then'](function(_0x529f45){return _0x529f45;});}return null;})[_0x9fe7('0x16')](respondWithStatusCode(_0x36d2cb,null))[_0x9fe7('0x3f')](handleError(_0x36d2cb,null));};exports[_0x9fe7('0x56')]=function(_0x5f4f02,_0x1d084e){var _0x53c373=_0x5f4f02[_0x9fe7('0x41')]['id'];var _0x3417c8=_0x5f4f02[_0x9fe7('0x46')];var _0x24c4b1=0xc8;var _0x47847a=null;return db['sequelize'][_0x9fe7('0x57')]({'isolationLevel':db[_0x9fe7('0x58')][_0x9fe7('0x59')][_0x9fe7('0x5a')][_0x9fe7('0x5b')]},function(_0x5f50bc){return db[_0x9fe7('0x3a')][_0x9fe7('0x5c')]({'where':{'id':_0x53c373},'transaction':_0x5f50bc})['then'](function(_0x29bf8a){if(_0x29bf8a){return db[_0x9fe7('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x53c373},'transaction':_0x5f50bc})[_0x9fe7('0x16')](function(){var _0x16f743=_[_0x9fe7('0x1d')](_0x3417c8,function(_0x4fe6aa){_0x4fe6aa[_0x9fe7('0x5d')]=_0x53c373;_0x4fe6aa[_0x9fe7('0x5e')]=!![];return _0x4fe6aa;});return _0x29bf8a[_0x9fe7('0x5f')](_0x16f743);})[_0x9fe7('0x16')](function(_0x33d01b){return db[_0x9fe7('0x3a')][_0x9fe7('0x60')](_0x33d01b,{'transaction':_0x5f50bc});});}else{_0x24c4b1=0x194;_0x47847a=[];}});})[_0x9fe7('0x16')](function(){if(_0x24c4b1!==0x194){return db[_0x9fe7('0x3a')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x53c373},'order':_0x9fe7('0x61')})['then'](function(_0x29a8f4){_0x47847a=_0x29a8f4;});}})[_0x9fe7('0x3f')](function(_0x1bef1e){_0x24c4b1=0x1f4;logger['error'](_0x1bef1e['stack']);if(_0x1bef1e[_0x9fe7('0x22')]){delete _0x1bef1e[_0x9fe7('0x22')];}_0x47847a=_0x1bef1e;})['finally'](function(){if(_0x47847a===null){_0x1d084e[_0x9fe7('0xb')](_0x24c4b1);}else{if(_0x24c4b1===0x1f4){_0x1d084e['status'](_0x24c4b1)[_0x9fe7('0x26')](_0x47847a);}else{_0x1d084e[_0x9fe7('0xc')](_0x24c4b1)[_0x9fe7('0xe')](_0x47847a);}}});}; \ No newline at end of file +var _0x965f=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','Content-Range','destroy','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','filter','ignore','map','includes','type','find','name','UserProfileResource','then','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','VIRTUAL','includeAll','findAll','catch','show','params','include','merge','options','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','value','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','sendStatus','send','lodash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x965f,0xbb));var _0xf965=function(_0xdd1a5f,_0x2b181a){_0xdd1a5f=_0xdd1a5f-0x0;var _0x4df958=_0x965f[_0xdd1a5f];return _0x4df958;};'use strict';var _=require(_0xf965('0x0'));var Redis=require(_0xf965('0x1'));var qs=require(_0xf965('0x2'));var logger=require(_0xf965('0x3'))(_0xf965('0x4'));var config=require(_0xf965('0x5'));var db=require(_0xf965('0x6'))['db'];config[_0xf965('0x7')]=_['defaults'](config['redis'],{'host':_0xf965('0x8'),'port':0x18eb});var socket=require(_0xf965('0x9'))(new Redis(config[_0xf965('0x7')]));require('./voiceExtension.socket')[_0xf965('0xa')](socket);function respondWithStatusCode(_0x20e348,_0x22b4c7){_0x22b4c7=_0x22b4c7||0xcc;return function(_0x53b904){if(_0x53b904){return _0x20e348['sendStatus'](_0x22b4c7);}return _0x20e348[_0xf965('0xb')](_0x22b4c7)[_0xf965('0xc')]();};}function respondWithResult(_0x68146a,_0x18a676){_0x18a676=_0x18a676||0xc8;return function(_0x51bd4a){if(_0x51bd4a){return _0x68146a[_0xf965('0xb')](_0x18a676)[_0xf965('0xd')](_0x51bd4a);}};}function respondWithFilteredResult(_0x36f1d2,_0x1a9c7a){return function(_0x17c24e){if(_0x17c24e){var _0x17a1eb=typeof _0x1a9c7a[_0xf965('0xe')]===_0xf965('0xf')&&typeof _0x1a9c7a[_0xf965('0x10')]===_0xf965('0xf');var _0x114f98=_0x17c24e[_0xf965('0x11')];var _0x59e73b=_0x17a1eb?0x0:_0x1a9c7a[_0xf965('0xe')];var _0x276a20=_0x17a1eb?_0x17c24e['count']:_0x1a9c7a[_0xf965('0xe')]+_0x1a9c7a[_0xf965('0x10')];var _0x1bab0b;if(_0x276a20>=_0x114f98){_0x276a20=_0x114f98;_0x1bab0b=0xc8;}else{_0x1bab0b=0xce;}_0x36f1d2['status'](_0x1bab0b);return _0x36f1d2['set'](_0xf965('0x12'),_0x59e73b+'-'+_0x276a20+'/'+_0x114f98)[_0xf965('0xd')](_0x17c24e);}return null;};}function removeEntity(_0xc4974b){return function(_0x1b342c){if(_0x1b342c){return _0x1b342c[_0xf965('0x13')]()['then'](function(){var _0x292f93=_0x1b342c[_0xf965('0x14')]({'plain':!![]});var _0x289f1d=[{'name':_0xf965('0x15'),'value':_0xf965('0x16'),'ignore':![]},{'name':_0xf965('0x17'),'value':'outbound','ignore':![]},{'name':_0xf965('0x18'),'value':'internal','ignore':![]}];var _0x55aeac=_(_0x289f1d)[_0xf965('0x19')](_0xf965('0x1a'))[_0xf965('0x1b')]('value')['value']();if(_[_0xf965('0x1c')](_0x55aeac,_0x292f93[_0xf965('0x1d')])){return;}var _0x32813a=_[_0xf965('0x1e')](_0x289f1d,['value',_0x292f93[_0xf965('0x1d')]])[_0xf965('0x1f')];return db[_0xf965('0x20')][_0xf965('0x13')]({'where':{'type':_0x32813a,'resourceId':_0x292f93['id']}})[_0xf965('0x21')](function(){return _0x1b342c;});})[_0xf965('0x21')](function(){_0xc4974b['status'](0xcc)[_0xf965('0xc')]();});}};}function handleEntityNotFound(_0x334e4a){return function(_0x2f14b2){if(!_0x2f14b2){_0x334e4a['sendStatus'](0x194);}return _0x2f14b2;};}function handleError(_0x31da42,_0x66facf){_0x66facf=_0x66facf||0x1f4;return function(_0x351860){logger[_0xf965('0x22')](_0x351860[_0xf965('0x23')]);if(_0x351860[_0xf965('0x1f')]){delete _0x351860[_0xf965('0x1f')];}_0x31da42['status'](_0x66facf)['send'](_0x351860);};}exports[_0xf965('0x24')]=function(_0x2520c1,_0x5b8b4e){var _0x29a86a={},_0x153094={},_0x30f26e={'count':0x0,'rows':[]};var _0x2cc0ab=_[_0xf965('0x1b')](db[_0xf965('0x25')][_0xf965('0x26')],function(_0x226923){return{'name':_0x226923[_0xf965('0x27')],'type':_0x226923[_0xf965('0x1d')][_0xf965('0x28')]};});_0x153094[_0xf965('0x29')]=_[_0xf965('0x1b')](_0x2cc0ab,_0xf965('0x1f'));_0x153094[_0xf965('0x2a')]=_[_0xf965('0x2b')](_0x2520c1[_0xf965('0x2a')]);_0x153094[_0xf965('0x2c')]=_['intersection'](_0x153094['model'],_0x153094[_0xf965('0x2a')]);_0x29a86a['attributes']=_[_0xf965('0x2d')](_0x153094[_0xf965('0x29')],qs[_0xf965('0x2e')](_0x2520c1[_0xf965('0x2a')][_0xf965('0x2e')]));_0x29a86a[_0xf965('0x2f')]=_0x29a86a[_0xf965('0x2f')][_0xf965('0x30')]?_0x29a86a[_0xf965('0x2f')]:_0x153094[_0xf965('0x29')];if(!_0x2520c1[_0xf965('0x2a')]['hasOwnProperty']('nolimit')){_0x29a86a[_0xf965('0x10')]=qs[_0xf965('0x10')](_0x2520c1[_0xf965('0x2a')]['limit']);_0x29a86a[_0xf965('0xe')]=qs[_0xf965('0xe')](_0x2520c1[_0xf965('0x2a')][_0xf965('0xe')]);}_0x29a86a[_0xf965('0x31')]=qs[_0xf965('0x32')](_0x2520c1[_0xf965('0x2a')][_0xf965('0x32')]);_0x29a86a[_0xf965('0x33')]=qs[_0xf965('0x2c')](_['pick'](_0x2520c1[_0xf965('0x2a')],_0x153094['filters']),_0x2cc0ab);if(_0x2520c1['query'][_0xf965('0x19')]){_0x29a86a[_0xf965('0x33')]=_['merge'](_0x29a86a['where'],{'$or':_[_0xf965('0x1b')](_0x2cc0ab,function(_0x2f7c7e){if(_0x2f7c7e[_0xf965('0x1d')]!==_0xf965('0x34')){var _0x5533af={};_0x5533af[_0x2f7c7e['name']]={'$like':'%'+_0x2520c1['query']['filter']+'%'};return _0x5533af;}})});}_0x29a86a=_['merge']({},_0x29a86a,_0x2520c1['options']);var _0x419711={'where':_0x29a86a['where']};return db[_0xf965('0x25')][_0xf965('0x11')](_0x419711)[_0xf965('0x21')](function(_0x48c030){_0x30f26e[_0xf965('0x11')]=_0x48c030;if(_0x2520c1[_0xf965('0x2a')][_0xf965('0x35')]){_0x29a86a['include']=[{'all':!![]}];}return db['VoiceExtension'][_0xf965('0x36')](_0x29a86a);})[_0xf965('0x21')](function(_0x548dc1){_0x30f26e['rows']=_0x548dc1;return _0x30f26e;})[_0xf965('0x21')](respondWithFilteredResult(_0x5b8b4e,_0x29a86a))[_0xf965('0x37')](handleError(_0x5b8b4e,null));};exports[_0xf965('0x38')]=function(_0x3b7534,_0x4ded26){var _0x10abc1={'raw':![],'where':{'id':_0x3b7534[_0xf965('0x39')]['id']}},_0x4e2e7a={};_0x4e2e7a[_0xf965('0x29')]=_[_0xf965('0x2b')](db[_0xf965('0x25')][_0xf965('0x26')]);_0x4e2e7a[_0xf965('0x2a')]=_[_0xf965('0x2b')](_0x3b7534['query']);_0x4e2e7a[_0xf965('0x2c')]=_['intersection'](_0x4e2e7a[_0xf965('0x29')],_0x4e2e7a[_0xf965('0x2a')]);_0x10abc1[_0xf965('0x2f')]=_['intersection'](_0x4e2e7a['model'],qs[_0xf965('0x2e')](_0x3b7534[_0xf965('0x2a')][_0xf965('0x2e')]));_0x10abc1['attributes']=_0x10abc1[_0xf965('0x2f')][_0xf965('0x30')]?_0x10abc1[_0xf965('0x2f')]:_0x4e2e7a[_0xf965('0x29')];if(_0x3b7534['query'][_0xf965('0x35')]){_0x10abc1[_0xf965('0x3a')]=[{'all':!![]}];}_0x10abc1=_[_0xf965('0x3b')]({},_0x10abc1,_0x3b7534[_0xf965('0x3c')]);return db[_0xf965('0x25')][_0xf965('0x1e')](_0x10abc1)[_0xf965('0x21')](handleEntityNotFound(_0x4ded26,null))[_0xf965('0x21')](respondWithResult(_0x4ded26,null))[_0xf965('0x37')](handleError(_0x4ded26,null));};exports['destroy']=function(_0x3da8da,_0x1be48f){return db[_0xf965('0x25')]['find']({'where':{'id':_0x3da8da[_0xf965('0x39')]['id']}})['then'](handleEntityNotFound(_0x1be48f,null))[_0xf965('0x21')](removeEntity(_0x1be48f,null))[_0xf965('0x37')](handleError(_0x1be48f,null));};exports[_0xf965('0x3d')]=function(_0x5c2cca,_0x41497d){if(_0x5c2cca[_0xf965('0x3e')][_0xf965('0x1d')]===_0xf965('0x3f')&&!_[_0xf965('0x40')](_0x5c2cca['body']['exten'],'_')){_0x5c2cca['body'][_0xf965('0x41')]='_'[_0xf965('0x42')](_0x5c2cca[_0xf965('0x3e')][_0xf965('0x41')]);}return db['VoiceExtension']['create'](_0x5c2cca[_0xf965('0x3e')],{'raw':![]})['then'](function(_0x1806bb){var _0x4b0634=_0x5c2cca[_0xf965('0x43')][_0xf965('0x14')]({'plain':!![]});if(!_0x4b0634)throw new Error(_0xf965('0x44'));if(_0x4b0634[_0xf965('0x45')]===_0xf965('0x43')){var _0x2d60f1=_0x1806bb[_0xf965('0x14')]({'plain':!![]});var _0x49627d=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xf965('0x17'),'value':'outbound'},{'name':_0xf965('0x18'),'value':_0xf965('0x46')}];var _0x3c7d18=_['find'](_0x49627d,[_0xf965('0x47'),_0x2d60f1[_0xf965('0x1d')]])[_0xf965('0x1f')];return db['UserProfileSection'][_0xf965('0x1e')]({'where':{'name':_0x3c7d18,'userProfileId':_0x4b0634['userProfileId']},'raw':!![]})[_0xf965('0x21')](function(_0x1ce18c){if(_0x1ce18c&&_0x1ce18c[_0xf965('0x48')]===0x0){return db[_0xf965('0x20')]['create']({'name':_0x2d60f1[_0xf965('0x1f')],'resourceId':_0x2d60f1['id'],'type':_0x1ce18c['name'],'sectionId':_0x1ce18c['id']},{})[_0xf965('0x21')](function(){return _0x1806bb;});}else{return _0x1806bb;}})[_0xf965('0x37')](function(_0x42ca4e){logger[_0xf965('0x22')](_0xf965('0x49'),_0x42ca4e);throw _0x42ca4e;});}return _0x1806bb;})[_0xf965('0x21')](respondWithResult(_0x41497d,0xc9))[_0xf965('0x37')](handleError(_0x41497d,null));};exports[_0xf965('0x4a')]=function(_0x1cbdd2,_0x28efbd){if(_0x1cbdd2['body']['id']){delete _0x1cbdd2['body']['id'];}return db[_0xf965('0x25')][_0xf965('0x1e')]({'where':{'id':_0x1cbdd2[_0xf965('0x39')]['id']}})['then'](handleEntityNotFound(_0x28efbd,null))[_0xf965('0x21')](function(_0x117d5f){if(_0x117d5f){return db[_0xf965('0x25')]['update'](_[_0xf965('0x4b')](_0x1cbdd2['body'],[_0xf965('0x41'),_0xf965('0x4c'),'description',_0xf965('0x4d'),_0xf965('0x4e'),'mandatoryDisposition','alias']),{'where':{'context':_0x117d5f[_0xf965('0x4c')],'exten':_0x117d5f[_0xf965('0x41')]},'individualHooks':!![]})[_0xf965('0x21')](function(_0x459c5b){return _0x459c5b;});}return null;})[_0xf965('0x21')](respondWithStatusCode(_0x28efbd,null))[_0xf965('0x37')](handleError(_0x28efbd,null));};exports[_0xf965('0x4f')]=function(_0x46efe6,_0x93bb1d){var _0x1b6e7e=_0x46efe6[_0xf965('0x39')]['id'];var _0x1f400b=_0x46efe6[_0xf965('0x3e')];var _0x109a40=0xc8;var _0x129bec=null;return db['sequelize'][_0xf965('0x50')]({'isolationLevel':db[_0xf965('0x51')]['Transaction'][_0xf965('0x52')][_0xf965('0x53')]},function(_0x5d0d2b){return db[_0xf965('0x25')][_0xf965('0x54')]({'where':{'id':_0x1b6e7e},'transaction':_0x5d0d2b})[_0xf965('0x21')](function(_0x489ee5){if(_0x489ee5){return db[_0xf965('0x25')]['destroy']({'where':{'VoiceExtensionId':_0x1b6e7e},'transaction':_0x5d0d2b})[_0xf965('0x21')](function(){var _0x3b22b3=_[_0xf965('0x1b')](_0x1f400b,function(_0xedae2d){_0xedae2d[_0xf965('0x55')]=_0x1b6e7e;_0xedae2d[_0xf965('0x56')]=!![];return _0xedae2d;});return _0x489ee5[_0xf965('0x57')](_0x3b22b3);})[_0xf965('0x21')](function(_0x4c7d73){return db['VoiceExtension'][_0xf965('0x58')](_0x4c7d73,{'transaction':_0x5d0d2b});});}else{_0x109a40=0x194;_0x129bec=[];}});})[_0xf965('0x21')](function(){if(_0x109a40!==0x194){return db[_0xf965('0x25')][_0xf965('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1b6e7e},'order':_0xf965('0x5a')})[_0xf965('0x21')](function(_0x49a71e){_0x129bec=_0x49a71e;});}})[_0xf965('0x37')](function(_0x13fb3a){_0x109a40=0x1f4;logger[_0xf965('0x22')](_0x13fb3a[_0xf965('0x23')]);if(_0x13fb3a['name']){delete _0x13fb3a[_0xf965('0x1f')];}_0x129bec=_0x13fb3a;})[_0xf965('0x5b')](function(){if(_0x129bec===null){_0x93bb1d[_0xf965('0x5c')](_0x109a40);}else{if(_0x109a40===0x1f4){_0x93bb1d[_0xf965('0xb')](_0x109a40)[_0xf965('0x5d')](_0x129bec);}else{_0x93bb1d[_0xf965('0xb')](_0x109a40)[_0xf965('0xd')](_0x129bec);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index e2e58fb..ee20bd6 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 _0x5b35=['VoiceExtension','save','emit','hasOwnProperty','hook','events'];(function(_0x458a30,_0x43e5be){var _0x43d60c=function(_0x6be6e7){while(--_0x6be6e7){_0x458a30['push'](_0x458a30['shift']());}};_0x43d60c(++_0x43e5be);}(_0x5b35,0x1c7));var _0x55b3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b35[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x55b3('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x55b3('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x55b3('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2215b9){return function(_0x37ffb1,_0x15ce4c,_0xc422ce){VoiceExtensionEvents[_0x55b3('0x3')](_0x2215b9+':'+_0x37ffb1['id'],_0x37ffb1);VoiceExtensionEvents[_0x55b3('0x3')](_0x2215b9,_0x37ffb1);_0xc422ce(null);};}for(var e in events){if(events[_0x55b3('0x4')](e)){var event=events[e];VoiceExtension[_0x55b3('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xf9b9=['emit','hasOwnProperty','hook','exports','../../mysqldb','update','remove'];(function(_0x18efb0,_0x402155){var _0x463641=function(_0x7f44b1){while(--_0x7f44b1){_0x18efb0['push'](_0x18efb0['shift']());}};_0x463641(++_0x402155);}(_0xf9b9,0x169));var _0x9f9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9b9[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x9f9b('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f9b('0x1'),'afterDestroy':_0x9f9b('0x2')};function emitEvent(_0x477297){return function(_0x3efc7f,_0x4f5957,_0x3609c1){VoiceExtensionEvents[_0x9f9b('0x3')](_0x477297+':'+_0x3efc7f['id'],_0x3efc7f);VoiceExtensionEvents['emit'](_0x477297,_0x3efc7f);_0x3609c1(null);};}for(var e in events){if(events[_0x9f9b('0x4')](e)){var event=events[e];VoiceExtension[_0x9f9b('0x5')](e,emitEvent(event));}}module[_0x9f9b('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index eeb57b3..2e49269 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 _0xf2cc=['options','indexOf','U(xcally-mixmonitor-context)','replace','join','Interval','interval','intervals','IntervalId','map','filter','hasOwnProperty','tag','toLowerCase','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','lodash','exports','models','type','Set','context','exten','alias','inbound','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','param','phone','prefix','SIP'];(function(_0x561797,_0x489fe0){var _0x52d7b2=function(_0x55e464){while(--_0x55e464){_0x561797['push'](_0x561797['shift']());}};_0x52d7b2(++_0x489fe0);}(_0xf2cc,0x112));var _0xcf2c=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xf2cc[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0xcf2c('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xcf2c('0x1')]=function(_0x5caf6d){var _0x5bb244=_0x5caf6d[_0xcf2c('0x2')];function _0x289b64(_0x1c0457){var _0x1859f2=0x2;var _0x529059=[{'type':_0x1c0457[_0xcf2c('0x3')],'app':_0xcf2c('0x4'),'appdata':'CDR(type)='+_0x1c0457[_0xcf2c('0x3')],'context':_0x1c0457[_0xcf2c('0x5')],'exten':_0x1c0457[_0xcf2c('0x6')],'priority':_0x1859f2++,'VoiceExtensionId':_0x1c0457['id']},{'type':_0x1c0457[_0xcf2c('0x3')],'app':_0x1c0457[_0xcf2c('0x7')]?_0xcf2c('0x4'):'NoOp','appdata':_0x1c0457[_0xcf2c('0x7')]?'CDR(routeAlias)='+_0x1c0457['alias']:'No\x20alias\x20set','context':_0x1c0457[_0xcf2c('0x5')],'exten':_0x1c0457['exten'],'priority':_0x1859f2++,'VoiceExtensionId':_0x1c0457['id']}];if(_0x1c0457[_0xcf2c('0x3')]===_0xcf2c('0x8')){_0x529059[_0xcf2c('0x9')]({'type':'inbound','app':_0xcf2c('0x4'),'appdata':'CDR(routeid)='+_0x1c0457['id'],'context':_0x1c0457[_0xcf2c('0x5')],'exten':_0x1c0457[_0xcf2c('0x6')],'priority':_0x1859f2++,'VoiceExtensionId':_0x1c0457['id']});}_0x529059['push']({'type':_0x1c0457[_0xcf2c('0x3')],'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0xa'),'context':_0x1c0457['context'],'exten':_0x1c0457['exten'],'priority':_0x1859f2++,'VoiceExtensionId':_0x1c0457['id']},{'type':_0x1c0457[_0xcf2c('0x3')],'app':_0xcf2c('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1c0457[_0xcf2c('0x5')],'exten':_0x1c0457[_0xcf2c('0x6')],'priority':_0x1859f2++,'VoiceExtensionId':_0x1c0457['id']},{'type':_0x1c0457['type'],'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0xb'),'context':_0x1c0457[_0xcf2c('0x5')],'exten':_0x1c0457['exten'],'priority':_0x1859f2++,'VoiceExtensionId':_0x1c0457['id']});return _0x529059;}function _0x2b64fd(_0x59db18){var _0x38140a=0x2;var _0xbc676a=[{'type':_0xcf2c('0xc'),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0xd'),'context':_0x59db18['context'],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':_0x59db18[_0xcf2c('0x7')]?_0xcf2c('0x4'):'NoOp','appdata':_0x59db18[_0xcf2c('0x7')]?_0xcf2c('0xe')+_0x59db18['alias']:_0xcf2c('0xf'),'context':_0x59db18['context'],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':'outbound','app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x10')+(_0x59db18[_0xcf2c('0x11')]?_0xcf2c('0x12')+_0x59db18['cutdigits']+'}':'${EXTEN}'),'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':_0xcf2c('0x4'),'appdata':'CDR(routeid)='+_0x59db18['id'],'context':_0x59db18['context'],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':'ExecIf','appdata':_0xcf2c('0x13')+(_0x38140a+0x2)+_0xcf2c('0x14')+(_0x38140a+0x1)+')','context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18['exten'],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':_0xcf2c('0x4'),'appdata':_0x59db18[_0xcf2c('0x11')]?'CDR(prefix)=${EXTEN:0:'+_0x59db18[_0xcf2c('0x11')]+'}':_0xcf2c('0x15'),'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0xa'),'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':'outbound','app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x16'),'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0xb'),'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x17')+_0x59db18['id'],'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18[_0xcf2c('0x6')],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']}];if(_0x59db18['hasOwnProperty'](_0xcf2c('0x18'))&&_0x59db18[_0xcf2c('0x18')]!==_0xcf2c('0x19')){_0xbc676a[_0xcf2c('0x9')]({'type':'outbound','app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x1a'),'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18['exten'],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']},{'type':_0xcf2c('0xc'),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x1b')+_0x59db18[_0xcf2c('0x18')]||_0xcf2c('0x1c'),'context':_0x59db18[_0xcf2c('0x5')],'exten':_0x59db18['exten'],'priority':_0x38140a++,'VoiceExtensionId':_0x59db18['id']});}return _0xbc676a;}function _0x4a34fa(_0x378f00,_0x4f77ba){var _0x48a725=[{'name':_0xcf2c('0x1d'),'param':0x0},{'name':_0xcf2c('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0xcf2c('0x1f'),'param':0x3}];var _0x20b64f={};var _0x2658af=_0x4f77ba[_0xcf2c('0x20')](',');var _0x14798f=[];for(var _0x4f616b=0x0;_0x4f616b<_0x48a725[_0xcf2c('0x21')];_0x4f616b++){switch(_0x48a725[_0x4f616b]['name']){case'trunk':_0x20b64f[_0xcf2c('0x1d')]=_0x2658af[_0x48a725[_0x4f616b][_0xcf2c('0x22')]][_0xcf2c('0x20')]('/')[0x1];_0x20b64f['phone']=_0x2658af[_0x48a725[_0x4f616b][_0xcf2c('0x22')]]['split']('/')[0x2];_0x20b64f['prefix']=_0x20b64f[_0xcf2c('0x23')]?_0x20b64f['phone']['split']('$')[0x0]:undefined;_0x20b64f[_0xcf2c('0x23')]=_0x378f00[_0xcf2c('0x11')]?(_0x20b64f[_0xcf2c('0x24')]||'')+'${EXTEN:'+_0x378f00[_0xcf2c('0x11')]+'}':(_0x20b64f[_0xcf2c('0x24')]||'')+'${EXTEN}';_0x14798f[_0x48a725[_0x4f616b][_0xcf2c('0x22')]]=[_0xcf2c('0x25'),_0x20b64f[_0xcf2c('0x1d')],_0x20b64f['phone']]['join']('/');break;case _0xcf2c('0x26'):_0x20b64f['options']=_0x2658af[_0x48a725[_0x4f616b][_0xcf2c('0x22')]];if(_0x378f00[_0xcf2c('0x18')]!=='none'){if(_0x20b64f['options'][_0xcf2c('0x27')](_0xcf2c('0x28'))<0x0){_0x20b64f[_0xcf2c('0x26')]+=_0xcf2c('0x28');}}else{_0x20b64f[_0xcf2c('0x26')]=_0x20b64f[_0xcf2c('0x26')][_0xcf2c('0x29')](_0xcf2c('0x28'),'');}_0x14798f[_0x48a725[_0x4f616b][_0xcf2c('0x22')]]=_0x20b64f[_0xcf2c('0x26')];break;default:_0x14798f[_0x48a725[_0x4f616b][_0xcf2c('0x22')]]=_0x2658af[_0x48a725[_0x4f616b][_0xcf2c('0x22')]];}}return _0x14798f[_0xcf2c('0x2a')](',');}function _0x44e3fa(_0xbc8930,_0x47b33d,_0x3e93d2){return new Promise(function(_0x53843e,_0x316d80){var _0x106f7f=[];if(_['isEmpty'](_0x47b33d))return _0x53843e(_0x106f7f);_0x5bb244[_0xcf2c('0x2b')]['findAll']({'attributes':['id',_0xcf2c('0x2c'),'IntervalId'],'raw':!![]})['then'](function(_0x26691e){for(var _0x569e71=0x0,_0x14655c=0x0;_0x569e71<_0x47b33d[_0xcf2c('0x21')];_0x569e71++,_0x14655c=0x0){var _0x1401bc=_0x47b33d[_0x569e71];var _0x4379ac=[];var _0xc402c8=[];delete _0x1401bc['id'];if(_0x1401bc['interval']!=='*,*,*,*'){_0x1401bc[_0xcf2c('0x2d')]=[_0x1401bc[_0xcf2c('0x2c')]];}else{_0x1401bc[_0xcf2c('0x2d')]=_0x1401bc[_0xcf2c('0x2e')]?_[_0xcf2c('0x2f')](_[_0xcf2c('0x30')](_0x26691e,{'IntervalId':_0x1401bc[_0xcf2c('0x2e')]}),_0xcf2c('0x2c')):[];}_0x1401bc[_0xcf2c('0x5')]=_0xbc8930[_0xcf2c('0x5')];_0x1401bc[_0xcf2c('0x6')]=_0xbc8930['exten'];if(_0x1401bc[_0xcf2c('0x3')])_0x1401bc[_0xcf2c('0x3')]=_0x1401bc[_0xcf2c('0x3')]['toLowerCase']();if(_0xbc8930[_0xcf2c('0x3')]===_0xcf2c('0xc')){if(_0x1401bc[_0xcf2c('0x31')](_0xcf2c('0x32'))&&_0x1401bc[_0xcf2c('0x32')]&&_0x1401bc['tag']!=='--'){_0x4379ac[_0xcf2c('0x9')]({'type':_0x1401bc[_0xcf2c('0x3')][_0xcf2c('0x33')](),'app':_0xcf2c('0x4'),'appdata':'CDR(tag)='+_0x1401bc[_0xcf2c('0x32')],'context':_0xbc8930[_0xcf2c('0x5')],'exten':_0xbc8930['exten'],'priority':_0x1401bc[_0xcf2c('0x2d')][_0xcf2c('0x21')]+_0x3e93d2+_0x14655c++,'VoiceExtensionId':_0xbc8930['id']});}_0x4379ac['push']({'type':_0x1401bc[_0xcf2c('0x3')][_0xcf2c('0x33')](),'app':_0xcf2c('0x34'),'appdata':_0xcf2c('0x35')+(_0x1401bc['callerID']?_0xcf2c('0x36')+_0x1401bc[_0xcf2c('0x37')]+')':'NoOp(No\x20number\x20available)'),'context':_0xbc8930[_0xcf2c('0x5')],'exten':_0xbc8930['exten'],'priority':_0x1401bc[_0xcf2c('0x2d')][_0xcf2c('0x21')]+_0x3e93d2+_0x14655c++,'VoiceExtensionId':_0xbc8930['id']});}else{if(_0x1401bc[_0xcf2c('0x31')](_0xcf2c('0x38'))){if([_0xcf2c('0x39'),_0xcf2c('0x3a')]['includes'](_0x1401bc[_0xcf2c('0x3b')]['toLowerCase']())&&_0x1401bc[_0xcf2c('0x3c')]!==_0xcf2c('0x3d')){if(_0x1401bc[_0xcf2c('0x38')]){_0x4379ac['push']({'type':_0x1401bc[_0xcf2c('0x3')]['toLowerCase'](),'app':_0xcf2c('0x34'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xbc8930[_0xcf2c('0x5')],'exten':_0xbc8930[_0xcf2c('0x6')],'priority':_0x1401bc['intervals'][_0xcf2c('0x21')]+_0x3e93d2+_0x14655c++,'VoiceExtensionId':_0xbc8930['id']});_0x4379ac[_0xcf2c('0x9')]({'type':_0x1401bc[_0xcf2c('0x3')]['toLowerCase'](),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x3e'),'context':_0xbc8930['context'],'exten':_0xbc8930[_0xcf2c('0x6')],'priority':_0x1401bc[_0xcf2c('0x2d')][_0xcf2c('0x21')]+_0x3e93d2+_0x14655c++,'VoiceExtensionId':_0xbc8930['id']});}else{_0x4379ac[_0xcf2c('0x9')]({'type':_0x1401bc[_0xcf2c('0x3')][_0xcf2c('0x33')](),'app':_0xcf2c('0x34'),'appdata':_0xcf2c('0x3f'),'context':_0xbc8930[_0xcf2c('0x5')],'exten':_0xbc8930[_0xcf2c('0x6')],'priority':_0x1401bc[_0xcf2c('0x2d')][_0xcf2c('0x21')]+_0x3e93d2+_0x14655c++,'VoiceExtensionId':_0xbc8930['id']});_0x4379ac[_0xcf2c('0x9')]({'type':_0x1401bc[_0xcf2c('0x3')][_0xcf2c('0x33')](),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x40'),'context':_0xbc8930['context'],'exten':_0xbc8930[_0xcf2c('0x6')],'priority':_0x1401bc['intervals'][_0xcf2c('0x21')]+_0x3e93d2+_0x14655c++,'VoiceExtensionId':_0xbc8930['id']});}}}}for(var _0x41d26b=0x0;_0x41d26b<_0x1401bc[_0xcf2c('0x2d')][_0xcf2c('0x21')];_0x41d26b++){var _0x31a7e6=_0x3e93d2+_0x1401bc[_0xcf2c('0x2d')][_0xcf2c('0x21')];var _0x296535=_0x41d26b===_0x1401bc[_0xcf2c('0x2d')]['length']-0x1?_0x3e93d2+_0x4379ac['length']+_0xc402c8['length']+0x2:_0x3e93d2+_0x41d26b+0x1;_0x4379ac['splice'](_0x41d26b,0x0,{'type':_0xbc8930['type'],'app':_0xcf2c('0x41'),'appdata':_0x1401bc['intervals'][_0x41d26b]+'?'+_0xbc8930[_0xcf2c('0x5')]+_0xcf2c('0x42')+_0x31a7e6+':'+_0xbc8930[_0xcf2c('0x5')]+_0xcf2c('0x42')+_0x296535,'exten':_0xbc8930[_0xcf2c('0x6')],'context':_0xbc8930[_0xcf2c('0x5')],'priority':_0x3e93d2+_0x41d26b,'VoiceExtensionId':_0xbc8930['id']});}if(_0x1401bc[_0xcf2c('0x3c')]==='outboundDial'){_0x1401bc[_0xcf2c('0x43')]=_0x4a34fa(_0xbc8930,_0x1401bc[_0xcf2c('0x43')]);}if(_0x1401bc[_0xcf2c('0x3c')]===_0xcf2c('0x44')){_0x4379ac[_0xcf2c('0x9')]({'type':_0x1401bc[_0xcf2c('0x3')][_0xcf2c('0x33')](),'app':_0xcf2c('0x4'),'appdata':_0xcf2c('0x45'),'context':_0xbc8930[_0xcf2c('0x5')],'exten':_0xbc8930[_0xcf2c('0x6')],'priority':_0x1401bc[_0xcf2c('0x2d')][_0xcf2c('0x21')]+_0x3e93d2+_0x14655c++,'VoiceExtensionId':_0xbc8930['id']});}_0x1401bc[_0xcf2c('0x46')]=_0x4379ac[_0xcf2c('0x21')]?_[_0xcf2c('0x47')](_0x4379ac)['priority']+0x1:_0x3e93d2;_0x106f7f=_[_0xcf2c('0x48')](_0x106f7f,_0x4379ac,[_0x1401bc],_0xc402c8);_0x3e93d2=_[_0xcf2c('0x47')](_0x106f7f)[_0xcf2c('0x46')]+0x1;}return _0x53843e(_0x106f7f);})[_0xcf2c('0x49')](function(_0x2fe1cc){_0x316d80(_0x2fe1cc);});});}return _0x5caf6d[_0xcf2c('0x4a')](_0xcf2c('0x4b'),attributes,{'tableName':_0xcf2c('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1610fc){var _0xdbff09=this[_0xcf2c('0x4d')]({'plain':!![]});var _0x5a8b8a=_0xdbff09[_0xcf2c('0x3')]==='outbound'?_0x2b64fd(_0xdbff09):_0x289b64(_0xdbff09);return _0x44e3fa(_0xdbff09,_0x1610fc,_[_0xcf2c('0x47')](_0x5a8b8a)[_0xcf2c('0x46')]+0x1)['then'](function(_0x195895){var _0x1b406e=_['concat'](_0x5a8b8a,_0x195895);_0x1b406e[_0xcf2c('0x9')]({'type':_0xdbff09[_0xcf2c('0x3')],'app':'Hangup','exten':_0xdbff09[_0xcf2c('0x6')],'context':_0xdbff09['context'],'priority':_[_0xcf2c('0x47')](_0x1b406e)[_0xcf2c('0x46')]+0x1,'VoiceExtensionId':_0xdbff09['id']});return _0x1b406e;});}}});}; \ No newline at end of file +var _0x3f14=['${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','then','*,*,*,*','intervals','IntervalId','map','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','priority','last','catch','VoiceExtension','get','concat','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits'];(function(_0x522883,_0x4cf904){var _0x1c52ea=function(_0x316a2a){while(--_0x316a2a){_0x522883['push'](_0x522883['shift']());}};_0x1c52ea(++_0x4cf904);}(_0x3f14,0x87));var _0x43f1=function(_0x39ef3c,_0x51e30a){_0x39ef3c=_0x39ef3c-0x0;var _0x4e95df=_0x3f14[_0x39ef3c];return _0x4e95df;};'use strict';var _=require(_0x43f1('0x0'));var attributes=require(_0x43f1('0x1'));module[_0x43f1('0x2')]=function(_0x14085a){var _0x36c8d=_0x14085a[_0x43f1('0x3')];function _0x1dbd9c(_0xd86078){var _0xeb051e=0x2;var _0x4a08f0=[{'type':_0xd86078[_0x43f1('0x4')],'app':_0x43f1('0x5'),'appdata':_0x43f1('0x6')+_0xd86078[_0x43f1('0x4')],'context':_0xd86078[_0x43f1('0x7')],'exten':_0xd86078[_0x43f1('0x8')],'priority':_0xeb051e++,'VoiceExtensionId':_0xd86078['id']},{'type':_0xd86078['type'],'app':_0xd86078[_0x43f1('0x9')]?_0x43f1('0x5'):_0x43f1('0xa'),'appdata':_0xd86078['alias']?'CDR(routeAlias)='+_0xd86078[_0x43f1('0x9')]:_0x43f1('0xb'),'context':_0xd86078['context'],'exten':_0xd86078[_0x43f1('0x8')],'priority':_0xeb051e++,'VoiceExtensionId':_0xd86078['id']}];if(_0xd86078[_0x43f1('0x4')]===_0x43f1('0xc')){_0x4a08f0[_0x43f1('0xd')]({'type':_0x43f1('0xc'),'app':_0x43f1('0x5'),'appdata':_0x43f1('0xe')+_0xd86078['id'],'context':_0xd86078[_0x43f1('0x7')],'exten':_0xd86078[_0x43f1('0x8')],'priority':_0xeb051e++,'VoiceExtensionId':_0xd86078['id']});}_0x4a08f0['push']({'type':_0xd86078[_0x43f1('0x4')],'app':_0x43f1('0x5'),'appdata':_0x43f1('0xf'),'context':_0xd86078[_0x43f1('0x7')],'exten':_0xd86078[_0x43f1('0x8')],'priority':_0xeb051e++,'VoiceExtensionId':_0xd86078['id']},{'type':_0xd86078['type'],'app':_0x43f1('0x5'),'appdata':_0x43f1('0x10'),'context':_0xd86078[_0x43f1('0x7')],'exten':_0xd86078[_0x43f1('0x8')],'priority':_0xeb051e++,'VoiceExtensionId':_0xd86078['id']},{'type':_0xd86078[_0x43f1('0x4')],'app':_0x43f1('0x5'),'appdata':_0x43f1('0x11'),'context':_0xd86078[_0x43f1('0x7')],'exten':_0xd86078[_0x43f1('0x8')],'priority':_0xeb051e++,'VoiceExtensionId':_0xd86078['id']});return _0x4a08f0;}function _0x273c67(_0x530349){var _0x3e5e59=0x2;var _0x34b973=[{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':_0x43f1('0x13'),'context':_0x530349[_0x43f1('0x7')],'exten':_0x530349['exten'],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x530349[_0x43f1('0x9')]?'Set':_0x43f1('0xa'),'appdata':_0x530349[_0x43f1('0x9')]?_0x43f1('0x14')+_0x530349[_0x43f1('0x9')]:_0x43f1('0xb'),'context':_0x530349['context'],'exten':_0x530349['exten'],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':_0x43f1('0x15')+(_0x530349[_0x43f1('0x16')]?_0x43f1('0x17')+_0x530349[_0x43f1('0x16')]+'}':_0x43f1('0x18')),'context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':_0x43f1('0xe')+_0x530349['id'],'context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x19'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3e5e59+0x2)+_0x43f1('0x1a')+(_0x3e5e59+0x1)+')','context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':'outbound','app':_0x43f1('0x5'),'appdata':_0x530349[_0x43f1('0x16')]?_0x43f1('0x1b')+_0x530349[_0x43f1('0x16')]+'}':_0x43f1('0x1c'),'context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':_0x43f1('0xf'),'context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':_0x43f1('0x10'),'context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':'outboundrouteid='+_0x530349['id'],'context':_0x530349[_0x43f1('0x7')],'exten':_0x530349[_0x43f1('0x8')],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']}];if(_0x530349[_0x43f1('0x1d')](_0x43f1('0x1e'))&&_0x530349[_0x43f1('0x1e')]!==_0x43f1('0x1f')){_0x34b973['push']({'type':_0x43f1('0x12'),'app':'Set','appdata':_0x43f1('0x20'),'context':_0x530349['context'],'exten':_0x530349['exten'],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']},{'type':_0x43f1('0x12'),'app':_0x43f1('0x5'),'appdata':_0x43f1('0x21')+_0x530349[_0x43f1('0x1e')]||'wav','context':_0x530349['context'],'exten':_0x530349['exten'],'priority':_0x3e5e59++,'VoiceExtensionId':_0x530349['id']});}return _0x34b973;}function _0x30d27a(_0x74dfef,_0x2940ab){var _0x31aee0=[{'name':_0x43f1('0x22'),'param':0x0},{'name':_0x43f1('0x23'),'param':0x1},{'name':_0x43f1('0x24'),'param':0x2},{'name':'url','param':0x3}];var _0x186879={};var _0x558dee=_0x2940ab[_0x43f1('0x25')](',');var _0x2ba4ce=[];for(var _0x31ec83=0x0;_0x31ec83<_0x31aee0[_0x43f1('0x26')];_0x31ec83++){switch(_0x31aee0[_0x31ec83][_0x43f1('0x27')]){case'trunk':_0x186879[_0x43f1('0x22')]=_0x558dee[_0x31aee0[_0x31ec83][_0x43f1('0x28')]][_0x43f1('0x25')]('/')[0x1];_0x186879[_0x43f1('0x29')]=_0x558dee[_0x31aee0[_0x31ec83][_0x43f1('0x28')]][_0x43f1('0x25')]('/')[0x2];_0x186879['prefix']=_0x186879[_0x43f1('0x29')]?_0x186879['phone']['split']('$')[0x0]:undefined;_0x186879[_0x43f1('0x29')]=_0x74dfef[_0x43f1('0x16')]?(_0x186879[_0x43f1('0x2a')]||'')+_0x43f1('0x17')+_0x74dfef[_0x43f1('0x16')]+'}':(_0x186879['prefix']||'')+_0x43f1('0x18');_0x2ba4ce[_0x31aee0[_0x31ec83][_0x43f1('0x28')]]=[_0x43f1('0x2b'),_0x186879[_0x43f1('0x22')],_0x186879[_0x43f1('0x29')]][_0x43f1('0x2c')]('/');break;case _0x43f1('0x24'):_0x186879[_0x43f1('0x24')]=_0x558dee[_0x31aee0[_0x31ec83]['param']];if(_0x74dfef[_0x43f1('0x1e')]!=='none'){if(_0x186879['options'][_0x43f1('0x2d')](_0x43f1('0x2e'))<0x0){_0x186879['options']+=_0x43f1('0x2e');}}else{_0x186879[_0x43f1('0x24')]=_0x186879[_0x43f1('0x24')][_0x43f1('0x2f')]('U(xcally-mixmonitor-context)','');}_0x2ba4ce[_0x31aee0[_0x31ec83]['param']]=_0x186879[_0x43f1('0x24')];break;default:_0x2ba4ce[_0x31aee0[_0x31ec83]['param']]=_0x558dee[_0x31aee0[_0x31ec83][_0x43f1('0x28')]];}}return _0x2ba4ce['join'](',');}function _0x52f49d(_0x2c91aa,_0x31908c,_0x28f443){return new Promise(function(_0x5c06f2,_0xf02543){var _0x6b50bb=[];if(_['isEmpty'](_0x31908c))return _0x5c06f2(_0x6b50bb);_0x36c8d[_0x43f1('0x30')]['findAll']({'attributes':['id',_0x43f1('0x31'),'IntervalId'],'raw':!![]})[_0x43f1('0x32')](function(_0x482e4f){for(var _0x4a4891=0x0,_0x24726b=0x0;_0x4a4891<_0x31908c[_0x43f1('0x26')];_0x4a4891++,_0x24726b=0x0){var _0xc801f7=_0x31908c[_0x4a4891];var _0x2c1e70=[];var _0x4c05c3=[];delete _0xc801f7['id'];if(_0xc801f7[_0x43f1('0x31')]!==_0x43f1('0x33')){_0xc801f7[_0x43f1('0x34')]=[_0xc801f7[_0x43f1('0x31')]];}else{_0xc801f7[_0x43f1('0x34')]=_0xc801f7[_0x43f1('0x35')]?_[_0x43f1('0x36')](_['filter'](_0x482e4f,{'IntervalId':_0xc801f7[_0x43f1('0x35')]}),'interval'):[];}_0xc801f7[_0x43f1('0x7')]=_0x2c91aa[_0x43f1('0x7')];_0xc801f7['exten']=_0x2c91aa[_0x43f1('0x8')];if(_0xc801f7[_0x43f1('0x4')])_0xc801f7[_0x43f1('0x4')]=_0xc801f7[_0x43f1('0x4')][_0x43f1('0x37')]();if(_0x2c91aa['type']==='outbound'){if(_0xc801f7[_0x43f1('0x1d')](_0x43f1('0x38'))&&_0xc801f7['tag']&&_0xc801f7['tag']!=='--'){_0x2c1e70['push']({'type':_0xc801f7['type'][_0x43f1('0x37')](),'app':_0x43f1('0x5'),'appdata':_0x43f1('0x39')+_0xc801f7[_0x43f1('0x38')],'context':_0x2c91aa[_0x43f1('0x7')],'exten':_0x2c91aa['exten'],'priority':_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')]+_0x28f443+_0x24726b++,'VoiceExtensionId':_0x2c91aa['id']});}_0x2c1e70[_0x43f1('0xd')]({'type':_0xc801f7[_0x43f1('0x4')][_0x43f1('0x37')](),'app':_0x43f1('0x19'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0xc801f7[_0x43f1('0x3a')]?_0x43f1('0x3b')+_0xc801f7[_0x43f1('0x3a')]+')':_0x43f1('0x3c')),'context':_0x2c91aa[_0x43f1('0x7')],'exten':_0x2c91aa[_0x43f1('0x8')],'priority':_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')]+_0x28f443+_0x24726b++,'VoiceExtensionId':_0x2c91aa['id']});}else{if(_0xc801f7[_0x43f1('0x1d')](_0x43f1('0x3d'))){if(['queue','playback'][_0x43f1('0x3e')](_0xc801f7[_0x43f1('0x3f')][_0x43f1('0x37')]())&&_0xc801f7['appType']!==_0x43f1('0x40')){if(_0xc801f7[_0x43f1('0x3d')]){_0x2c1e70['push']({'type':_0xc801f7['type'][_0x43f1('0x37')](),'app':_0x43f1('0x19'),'appdata':_0x43f1('0x41'),'context':_0x2c91aa[_0x43f1('0x7')],'exten':_0x2c91aa[_0x43f1('0x8')],'priority':_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')]+_0x28f443+_0x24726b++,'VoiceExtensionId':_0x2c91aa['id']});_0x2c1e70['push']({'type':_0xc801f7['type']['toLowerCase'](),'app':_0x43f1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2c91aa[_0x43f1('0x7')],'exten':_0x2c91aa[_0x43f1('0x8')],'priority':_0xc801f7['intervals'][_0x43f1('0x26')]+_0x28f443+_0x24726b++,'VoiceExtensionId':_0x2c91aa['id']});}else{_0x2c1e70['push']({'type':_0xc801f7[_0x43f1('0x4')][_0x43f1('0x37')](),'app':_0x43f1('0x19'),'appdata':_0x43f1('0x42'),'context':_0x2c91aa[_0x43f1('0x7')],'exten':_0x2c91aa['exten'],'priority':_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')]+_0x28f443+_0x24726b++,'VoiceExtensionId':_0x2c91aa['id']});_0x2c1e70['push']({'type':_0xc801f7[_0x43f1('0x4')][_0x43f1('0x37')](),'app':_0x43f1('0x5'),'appdata':_0x43f1('0x43'),'context':_0x2c91aa['context'],'exten':_0x2c91aa['exten'],'priority':_0xc801f7[_0x43f1('0x34')]['length']+_0x28f443+_0x24726b++,'VoiceExtensionId':_0x2c91aa['id']});}}}}for(var _0x3ae9a5=0x0;_0x3ae9a5<_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')];_0x3ae9a5++){var _0x29efa8=_0x28f443+_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')];var _0x49e560=_0x3ae9a5===_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')]-0x1?_0x28f443+_0x2c1e70[_0x43f1('0x26')]+_0x4c05c3['length']+0x2:_0x28f443+_0x3ae9a5+0x1;_0x2c1e70[_0x43f1('0x44')](_0x3ae9a5,0x0,{'type':_0x2c91aa[_0x43f1('0x4')],'app':'GotoIfTime','appdata':_0xc801f7[_0x43f1('0x34')][_0x3ae9a5]+'?'+_0x2c91aa[_0x43f1('0x7')]+_0x43f1('0x45')+_0x29efa8+':'+_0x2c91aa[_0x43f1('0x7')]+_0x43f1('0x45')+_0x49e560,'exten':_0x2c91aa[_0x43f1('0x8')],'context':_0x2c91aa['context'],'priority':_0x28f443+_0x3ae9a5,'VoiceExtensionId':_0x2c91aa['id']});}if(_0xc801f7[_0x43f1('0x46')]===_0x43f1('0x47')){_0xc801f7[_0x43f1('0x48')]=_0x30d27a(_0x2c91aa,_0xc801f7[_0x43f1('0x48')]);}if(_0xc801f7[_0x43f1('0x46')]==='agi'){_0x2c1e70['push']({'type':_0xc801f7[_0x43f1('0x4')][_0x43f1('0x37')](),'app':_0x43f1('0x5'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x2c91aa[_0x43f1('0x7')],'exten':_0x2c91aa[_0x43f1('0x8')],'priority':_0xc801f7[_0x43f1('0x34')][_0x43f1('0x26')]+_0x28f443+_0x24726b++,'VoiceExtensionId':_0x2c91aa['id']});}_0xc801f7[_0x43f1('0x49')]=_0x2c1e70[_0x43f1('0x26')]?_[_0x43f1('0x4a')](_0x2c1e70)[_0x43f1('0x49')]+0x1:_0x28f443;_0x6b50bb=_['concat'](_0x6b50bb,_0x2c1e70,[_0xc801f7],_0x4c05c3);_0x28f443=_[_0x43f1('0x4a')](_0x6b50bb)[_0x43f1('0x49')]+0x1;}return _0x5c06f2(_0x6b50bb);})[_0x43f1('0x4b')](function(_0x1fb827){_0xf02543(_0x1fb827);});});}return _0x14085a['define'](_0x43f1('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4e5565){var _0xa848ee=this[_0x43f1('0x4d')]({'plain':!![]});var _0x1a3ab3=_0xa848ee[_0x43f1('0x4')]===_0x43f1('0x12')?_0x273c67(_0xa848ee):_0x1dbd9c(_0xa848ee);return _0x52f49d(_0xa848ee,_0x4e5565,_[_0x43f1('0x4a')](_0x1a3ab3)[_0x43f1('0x49')]+0x1)[_0x43f1('0x32')](function(_0x1a25ab){var _0x2cafc0=_[_0x43f1('0x4e')](_0x1a3ab3,_0x1a25ab);_0x2cafc0[_0x43f1('0xd')]({'type':_0xa848ee[_0x43f1('0x4')],'app':'Hangup','exten':_0xa848ee['exten'],'context':_0xa848ee[_0x43f1('0x7')],'priority':_[_0x43f1('0x4a')](_0x2cafc0)[_0x43f1('0x49')]+0x1,'VoiceExtensionId':_0xa848ee['id']});return _0x2cafc0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 4f9ea24..922351c 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 _0xed08=['localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x17ecd8,_0x3da37b){var _0x4ebf71=function(_0x212f13){while(--_0x212f13){_0x17ecd8['push'](_0x17ecd8['shift']());}};_0x4ebf71(++_0x3da37b);}(_0xed08,0x67));var _0x8ed0=function(_0x5e4c8d,_0x91ef5f){_0x5e4c8d=_0x5e4c8d-0x0;var _0x3417a6=_0xed08[_0x5e4c8d];return _0x3417a6;};'use strict';var _=require('lodash');var util=require(_0x8ed0('0x0'));var moment=require(_0x8ed0('0x1'));var BPromise=require(_0x8ed0('0x2'));var rs=require(_0x8ed0('0x3'));var fs=require('fs');var Redis=require(_0x8ed0('0x4'));var db=require(_0x8ed0('0x5'))['db'];var utils=require(_0x8ed0('0x6'));var logger=require(_0x8ed0('0x7'))(_0x8ed0('0x8'));var config=require(_0x8ed0('0x9'));var jayson=require(_0x8ed0('0xa'));var client=jayson[_0x8ed0('0xb')]['http']({'port':0x232a});config[_0x8ed0('0xc')]=_[_0x8ed0('0xd')](config[_0x8ed0('0xc')],{'host':_0x8ed0('0xe'),'port':0x18eb});var socket=require(_0x8ed0('0xf'))(new Redis(config[_0x8ed0('0xc')]));require(_0x8ed0('0x10'))['register'](socket);function respondWithRpcPromise(_0x35d92c,_0x1b5adc,_0x2d2f99){return new BPromise(function(_0x289a09,_0x5cab3f){return client[_0x8ed0('0x11')](_0x35d92c,_0x2d2f99)[_0x8ed0('0x12')](function(_0x1ab513){logger[_0x8ed0('0x13')](_0x8ed0('0x14'),_0x1b5adc,_0x8ed0('0x15'));logger[_0x8ed0('0x16')](_0x8ed0('0x17'),_0x1b5adc,_0x8ed0('0x15'),JSON[_0x8ed0('0x18')](_0x1ab513));if(_0x1ab513['error']){if(_0x1ab513[_0x8ed0('0x19')][_0x8ed0('0x1a')]===0x1f4){logger['error'](_0x8ed0('0x14'),_0x1b5adc,_0x1ab513[_0x8ed0('0x19')]['message']);return _0x5cab3f(_0x1ab513[_0x8ed0('0x19')][_0x8ed0('0x1b')]);}logger['error'](_0x8ed0('0x14'),_0x1b5adc,_0x1ab513[_0x8ed0('0x19')]['message']);return _0x289a09(_0x1ab513[_0x8ed0('0x19')][_0x8ed0('0x1b')]);}else{logger[_0x8ed0('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x1b5adc,'request\x20sent');_0x289a09(_0x1ab513['result'][_0x8ed0('0x1b')]);}})[_0x8ed0('0x1c')](function(_0x32977d){logger[_0x8ed0('0x19')](_0x8ed0('0x14'),_0x1b5adc,_0x32977d);_0x5cab3f(_0x32977d);});});}exports[_0x8ed0('0x1d')]=function(_0x3331f6){var _0xf75b82=this;return new Promise(function(_0x27fbe4,_0x5b8dcb){return db['VoiceExtension'][_0x8ed0('0x1e')]({'raw':_0x3331f6[_0x8ed0('0x1f')]?_0x3331f6['options'][_0x8ed0('0x20')]===undefined?!![]:![]:!![],'where':_0x3331f6[_0x8ed0('0x1f')]?_0x3331f6[_0x8ed0('0x1f')][_0x8ed0('0x21')]||null:null,'attributes':_0x3331f6['options']?_0x3331f6[_0x8ed0('0x1f')][_0x8ed0('0x22')]||null:null,'limit':_0x3331f6['options']?_0x3331f6[_0x8ed0('0x1f')][_0x8ed0('0x23')]||null:null,'include':_0x3331f6[_0x8ed0('0x1f')]?_0x3331f6[_0x8ed0('0x1f')][_0x8ed0('0x24')]?_[_0x8ed0('0x25')](_0x3331f6['options']['include'],function(_0x2a35b1){return{'model':db[_0x2a35b1[_0x8ed0('0x26')]],'as':_0x2a35b1['as'],'attributes':_0x2a35b1[_0x8ed0('0x22')],'include':_0x2a35b1[_0x8ed0('0x24')]?_[_0x8ed0('0x25')](_0x2a35b1[_0x8ed0('0x24')],function(_0x5c404a){return{'model':db[_0x5c404a[_0x8ed0('0x26')]],'as':_0x5c404a['as'],'attributes':_0x5c404a[_0x8ed0('0x22')],'include':_0x5c404a['include']?_[_0x8ed0('0x25')](_0x5c404a[_0x8ed0('0x24')],function(_0x29c986){return{'model':db[_0x29c986[_0x8ed0('0x26')]],'as':_0x29c986['as'],'attributes':_0x29c986[_0x8ed0('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8ed0('0x12')](function(_0x1fbca0){logger['info']('GetVoiceExtension',_0x3331f6);logger['debug'](_0x8ed0('0x1d'),_0x3331f6,JSON[_0x8ed0('0x18')](_0x1fbca0));_0x27fbe4(_0x1fbca0);})['catch'](function(_0x3065c4){logger['error'](_0x8ed0('0x1d'),_0x3065c4[_0x8ed0('0x1b')],_0x3331f6);_0x5b8dcb(_0xf75b82['error'](0x1f4,_0x3065c4['message']));});});}; \ No newline at end of file +var _0x4312=['defaults','localhost','socket.io-emitter','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceExtension','findAll','options','where','limit','map','include','model','attributes','GetVoiceExtension','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x4312,0xaf));var _0x2431=function(_0x50fe15,_0x4c1401){_0x50fe15=_0x50fe15-0x0;var _0x59299b=_0x4312[_0x50fe15];return _0x59299b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2431('0x0'));var BPromise=require(_0x2431('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2431('0x2'));var db=require(_0x2431('0x3'))['db'];var utils=require(_0x2431('0x4'));var logger=require(_0x2431('0x5'))(_0x2431('0x6'));var config=require(_0x2431('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2431('0x8')]['http']({'port':0x232a});config[_0x2431('0x9')]=_[_0x2431('0xa')](config['redis'],{'host':_0x2431('0xb'),'port':0x18eb});var socket=require(_0x2431('0xc'))(new Redis(config[_0x2431('0x9')]));require('./voiceExtension.socket')[_0x2431('0xd')](socket);function respondWithRpcPromise(_0x26b223,_0xb751e,_0x568a96){return new BPromise(function(_0x12615b,_0x4a71f2){return client[_0x2431('0xe')](_0x26b223,_0x568a96)[_0x2431('0xf')](function(_0x384711){logger['info'](_0x2431('0x10'),_0xb751e,_0x2431('0x11'));logger[_0x2431('0x12')](_0x2431('0x13'),_0xb751e,'request\x20sent',JSON[_0x2431('0x14')](_0x384711));if(_0x384711[_0x2431('0x15')]){if(_0x384711[_0x2431('0x15')][_0x2431('0x16')]===0x1f4){logger[_0x2431('0x15')](_0x2431('0x10'),_0xb751e,_0x384711[_0x2431('0x15')][_0x2431('0x17')]);return _0x4a71f2(_0x384711[_0x2431('0x15')]['message']);}logger[_0x2431('0x15')](_0x2431('0x10'),_0xb751e,_0x384711[_0x2431('0x15')][_0x2431('0x17')]);return _0x12615b(_0x384711[_0x2431('0x15')][_0x2431('0x17')]);}else{logger[_0x2431('0x18')](_0x2431('0x10'),_0xb751e,_0x2431('0x11'));_0x12615b(_0x384711[_0x2431('0x19')][_0x2431('0x17')]);}})[_0x2431('0x1a')](function(_0x3b1776){logger[_0x2431('0x15')]('VoiceExtension,\x20%s,\x20%s',_0xb751e,_0x3b1776);_0x4a71f2(_0x3b1776);});});}exports['GetVoiceExtension']=function(_0x3b4fa0){var _0x41b5df=this;return new Promise(function(_0x2e6b2b,_0x51d1ef){return db[_0x2431('0x1b')][_0x2431('0x1c')]({'raw':_0x3b4fa0['options']?_0x3b4fa0['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b4fa0['options']?_0x3b4fa0[_0x2431('0x1d')][_0x2431('0x1e')]||null:null,'attributes':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0[_0x2431('0x1d')]['attributes']||null:null,'limit':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0['options'][_0x2431('0x1f')]||null:null,'include':_0x3b4fa0[_0x2431('0x1d')]?_0x3b4fa0[_0x2431('0x1d')]['include']?_[_0x2431('0x20')](_0x3b4fa0[_0x2431('0x1d')][_0x2431('0x21')],function(_0x55914b){return{'model':db[_0x55914b['model']],'as':_0x55914b['as'],'attributes':_0x55914b['attributes'],'include':_0x55914b[_0x2431('0x21')]?_['map'](_0x55914b[_0x2431('0x21')],function(_0xf7afb5){return{'model':db[_0xf7afb5[_0x2431('0x22')]],'as':_0xf7afb5['as'],'attributes':_0xf7afb5[_0x2431('0x23')],'include':_0xf7afb5['include']?_['map'](_0xf7afb5[_0x2431('0x21')],function(_0x3954cc){return{'model':db[_0x3954cc['model']],'as':_0x3954cc['as'],'attributes':_0x3954cc[_0x2431('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2431('0xf')](function(_0x5842fb){logger[_0x2431('0x18')](_0x2431('0x24'),_0x3b4fa0);logger['debug'](_0x2431('0x24'),_0x3b4fa0,JSON[_0x2431('0x14')](_0x5842fb));_0x2e6b2b(_0x5842fb);})[_0x2431('0x1a')](function(_0x141478){logger[_0x2431('0x15')](_0x2431('0x24'),_0x141478[_0x2431('0x17')],_0x3b4fa0);_0x51d1ef(_0x41b5df[_0x2431('0x15')](0x1f4,_0x141478[_0x2431('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b50b29c..c9c18b6 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x3f1eb7,_0x115219){var _0x522767=function(_0x3efe91){while(--_0x3efe91){_0x3f1eb7['push'](_0x3f1eb7['shift']());}};_0x522767(++_0x115219);}(_0xabce,0x103));var _0xeabc=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xabce[_0x134c2e];return _0x2825db;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x4b6a6f,_0x3cefe1){var _0xd0c0fe=function(_0x5e83fe){while(--_0x5e83fe){_0x4b6a6f['push'](_0x4b6a6f['shift']());}};_0xd0c0fe(++_0x3cefe1);}(_0xe14b,0x93));var _0xbe14=function(_0x4e4509,_0x1eb039){_0x4e4509=_0x4e4509-0x0;var _0x783c02=_0xe14b[_0x4e4509];return _0x783c02;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f8ec05a..182d7c1 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 _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0xa39fa1,_0x37a0f4){var _0x26835a=function(_0x3eefab){while(--_0x3eefab){_0xa39fa1['push'](_0xa39fa1['shift']());}};_0x26835a(++_0x37a0f4);}(_0xd046,0x129));var _0x6d04=function(_0x5aee3c,_0x21e0c2){_0x5aee3c=_0x5aee3c-0x0;var _0x359474=_0xd046[_0x5aee3c];return _0x359474;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('0xf')]=router; \ No newline at end of file +var _0xc1c6=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','getMessages','create','put','update','delete','destroy','exports'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x5a7959,_0x89571f){_0x5a7959=_0x5a7959-0x0;var _0x11121a=_0xc1c6[_0x5a7959];return _0x11121a;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id/messages',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['post']('/',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xd')]);router[_0x6c1c('0xe')](_0x6c1c('0x9'),auth['isAuthenticated'](),controller[_0x6c1c('0xf')]);router[_0x6c1c('0x10')](_0x6c1c('0x9'),auth['isAuthenticated'](),controller[_0x6c1c('0x11')]);module[_0x6c1c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a1c82b3..e9f39dc 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 _0x10bf=['sequelize','exports','STRING','contest_mailbox','email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','getDataValue','fullname','mailbox'];(function(_0x9f359a,_0xbb0cdd){var _0x275821=function(_0x598796){while(--_0x598796){_0x9f359a['push'](_0x9f359a['shift']());}};_0x275821(++_0xbb0cdd);}(_0x10bf,0x1e0));var _0xf10b=function(_0x176308,_0x5b4d58){_0x176308=_0x176308-0x0;var _0x545160=_0x10bf[_0x176308];return _0x545160;};'use strict';var Sequelize=require(_0xf10b('0x0'));module[_0xf10b('0x1')]={'customer_id':{'type':Sequelize[_0xf10b('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xf10b('0x2')],'defaultValue':'','allowNull':![],'unique':_0xf10b('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xf10b('0x2')]},'email':{'type':Sequelize[_0xf10b('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4edb21){this['setDataValue'](_0xf10b('0x4'),typeof _0x4edb21===_0xf10b('0x5')&&_0x4edb21[_0xf10b('0x6')]()?_0x4edb21['trim']():null);}},'pager':{'type':Sequelize[_0xf10b('0x2')]},'tz':{'type':Sequelize[_0xf10b('0x2')],'defaultValue':_0xf10b('0x7')},'attach':{'type':Sequelize['ENUM'](_0xf10b('0x8'),'no'),'defaultValue':_0xf10b('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf10b('0x9')]('yes','no'),'defaultValue':_0xf10b('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf10b('0x2')]},'callback':{'type':Sequelize[_0xf10b('0x2')]},'review':{'type':Sequelize[_0xf10b('0x9')](_0xf10b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf10b('0x9')](_0xf10b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xf10b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf10b('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf10b('0x9')](_0xf10b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf10b('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf10b('0x9')](_0xf10b('0x8'),'no'),'defaultValue':_0xf10b('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xf10b('0x9')](_0xf10b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf10b('0x9')](_0xf10b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf10b('0x9')](_0xf10b('0x8'),'no'),'defaultValue':_0xf10b('0x8'),'allowNull':![]},'stamp':{'type':_0xf10b('0xa')},'emailsubject':{'type':Sequelize[_0xf10b('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xf10b('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf10b('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf10b('0xc')](_0xf10b('0xd'))+'\x20-\x20'+this[_0xf10b('0xc')](_0xf10b('0xe'));}}}; \ No newline at end of file +var _0xfd90=['INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfd90,0xfd));var _0x0fd9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfd90[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x0fd9('0x0'));module[_0x0fd9('0x1')]={'customer_id':{'type':Sequelize[_0x0fd9('0x2')]},'context':{'type':Sequelize[_0x0fd9('0x2')],'defaultValue':_0x0fd9('0x3'),'unique':_0x0fd9('0x4')},'mailbox':{'type':Sequelize[_0x0fd9('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x0fd9('0x2')]},'fullname':{'type':Sequelize[_0x0fd9('0x2')]},'email':{'type':Sequelize[_0x0fd9('0x2')],'validate':{'isEmail':!![]},'set':function(_0x326a50){this[_0x0fd9('0x5')](_0x0fd9('0x6'),typeof _0x326a50==='string'&&_0x326a50[_0x0fd9('0x7')]()?_0x326a50[_0x0fd9('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0x8')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0fd9('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0fd9('0xa')]('yes','no'),'defaultValue':_0x0fd9('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0fd9('0x2')]},'callback':{'type':Sequelize[_0x0fd9('0x2')]},'review':{'type':Sequelize[_0x0fd9('0xa')](_0x0fd9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0fd9('0xa')](_0x0fd9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0fd9('0xa')](_0x0fd9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0fd9('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0fd9('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0fd9('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x0fd9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0fd9('0xa')](_0x0fd9('0x9'),'no'),'defaultValue':_0x0fd9('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0fd9('0xa')](_0x0fd9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0fd9('0xa')](_0x0fd9('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0fd9('0xa')](_0x0fd9('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x0fd9('0xc')},'emailsubject':{'type':Sequelize[_0x0fd9('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x0fd9('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0fd9('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0fd9('0xe')],'get':function(){return this['getDataValue'](_0x0fd9('0xf'))+_0x0fd9('0x10')+this[_0x0fd9('0x11')](_0x0fd9('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 8bda993..f5e25e4 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 _0x757a=['../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','get','Voicemails','UserProfileResource','destroy','end','error','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','findAndCountAll','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x11e7ca,_0x587b61){var _0x13c05c=function(_0x2cb6c8){while(--_0x2cb6c8){_0x11e7ca['push'](_0x11e7ca['shift']());}};_0x13c05c(++_0x587b61);}(_0x757a,0xde));var _0xa757=function(_0xe4dd6d,_0x3f809d){_0xe4dd6d=_0xe4dd6d-0x0;var _0x2720e4=_0x757a[_0xe4dd6d];return _0x2720e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){var _0x59e9d4=_0x2bf276[_0xa757('0x1f')]({'plain':!![]});var _0x47903b=_0xa757('0x20');return db[_0xa757('0x21')][_0xa757('0x22')]({'where':{'type':_0x47903b,'resourceId':_0x59e9d4['id']}})['then'](function(){return _0x2bf276;});})[_0xa757('0x1e')](function(){_0x2ca10d[_0xa757('0x15')](0xcc)[_0xa757('0x23')]();});}};}function handleEntityNotFound(_0x3bf7f3,_0x5b4779){return function(_0x449a7d){if(!_0x449a7d){_0x3bf7f3['sendStatus'](0x194);}return _0x449a7d;};}function handleError(_0x5a5664,_0x54b75e){_0x54b75e=_0x54b75e||0x1f4;return function(_0x4f8de2){logger[_0xa757('0x24')](_0x4f8de2['stack']);if(_0x4f8de2[_0xa757('0x25')]){delete _0x4f8de2[_0xa757('0x25')];}_0x5a5664['status'](_0x54b75e)[_0xa757('0x26')](_0x4f8de2);};}exports['index']=function(_0x2c4823,_0xa6d0f6){var _0x5307c3={},_0x235e54={},_0x5ade7b={'count':0x0,'rows':[]};var _0x3a4a66=_[_0xa757('0x27')](db[_0xa757('0x28')][_0xa757('0x29')],function(_0xcc87c0){return{'name':_0xcc87c0[_0xa757('0x2a')],'type':_0xcc87c0[_0xa757('0x2b')][_0xa757('0x2c')]};});_0x235e54[_0xa757('0x2d')]=_[_0xa757('0x27')](_0x3a4a66,_0xa757('0x25'));_0x235e54[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x2c4823[_0xa757('0x2e')]);_0x235e54[_0xa757('0x30')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],_0x235e54[_0xa757('0x2e')]);_0x5307c3[_0xa757('0x32')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],qs[_0xa757('0x33')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x33')]));_0x5307c3['attributes']=_0x5307c3[_0xa757('0x32')][_0xa757('0x34')]?_0x5307c3[_0xa757('0x32')]:_0x235e54[_0xa757('0x2d')];if(!_0x2c4823[_0xa757('0x2e')]['hasOwnProperty'](_0xa757('0x35'))){_0x5307c3[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x1a')]);_0x5307c3[_0xa757('0x17')]=qs['offset'](_0x2c4823[_0xa757('0x2e')][_0xa757('0x17')]);}_0x5307c3[_0xa757('0x36')]=qs[_0xa757('0x37')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x37')]);_0x5307c3[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x2c4823['query'],_0x235e54[_0xa757('0x30')]),_0x3a4a66);if(_0x2c4823[_0xa757('0x2e')][_0xa757('0x3a')]){_0x5307c3[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x5307c3[_0xa757('0x38')],{'$or':_['map'](_0x3a4a66,function(_0x10d3fd){if(_0x10d3fd[_0xa757('0x2b')]!=='VIRTUAL'){var _0x5eae0b={};_0x5eae0b[_0x10d3fd[_0xa757('0x25')]]={'$like':'%'+_0x2c4823[_0xa757('0x2e')]['filter']+'%'};return _0x5eae0b;}})});}_0x5307c3=_['merge']({},_0x5307c3,_0x2c4823[_0xa757('0x3c')]);var _0x1725a2={'where':_0x5307c3[_0xa757('0x38')]};return db['VoiceMail'][_0xa757('0x19')](_0x1725a2)[_0xa757('0x1e')](function(_0x26802c){_0x5ade7b[_0xa757('0x19')]=_0x26802c;if(_0x2c4823[_0xa757('0x2e')]['includeAll']){_0x5307c3[_0xa757('0x3d')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x5307c3);})[_0xa757('0x1e')](function(_0x57298b){_0x5ade7b[_0xa757('0x3e')]=_0x57298b;return _0x5ade7b;})[_0xa757('0x1e')](respondWithFilteredResult(_0xa6d0f6,_0x5307c3))[_0xa757('0x3f')](handleError(_0xa6d0f6,null));};exports['show']=function(_0x5d25bb,_0x11e141){var _0x129d77={'raw':!![],'where':{'id':_0x5d25bb[_0xa757('0x40')]['id']}},_0x2b171c={};_0x2b171c[_0xa757('0x2d')]=_[_0xa757('0x2f')](db['VoiceMail'][_0xa757('0x29')]);_0x2b171c[_0xa757('0x2e')]=_['keys'](_0x5d25bb[_0xa757('0x2e')]);_0x2b171c['filters']=_[_0xa757('0x31')](_0x2b171c[_0xa757('0x2d')],_0x2b171c['query']);_0x129d77[_0xa757('0x32')]=_[_0xa757('0x31')](_0x2b171c['model'],qs[_0xa757('0x33')](_0x5d25bb[_0xa757('0x2e')][_0xa757('0x33')]));_0x129d77[_0xa757('0x32')]=_0x129d77['attributes'][_0xa757('0x34')]?_0x129d77[_0xa757('0x32')]:_0x2b171c[_0xa757('0x2d')];if(_0x5d25bb[_0xa757('0x2e')]['includeAll']){_0x129d77[_0xa757('0x3d')]=[{'all':!![]}];}_0x129d77=_['merge']({},_0x129d77,_0x5d25bb['options']);return db[_0xa757('0x28')][_0xa757('0x41')](_0x129d77)[_0xa757('0x1e')](handleEntityNotFound(_0x11e141,null))['then'](respondWithResult(_0x11e141,null))[_0xa757('0x3f')](handleError(_0x11e141,null));};exports['create']=function(_0x2ed63f,_0x151cc3){return db[_0xa757('0x28')][_0xa757('0x42')](_0x2ed63f[_0xa757('0x43')],{})[_0xa757('0x1e')](function(_0x57bf73){var _0x505cd=_0x2ed63f['user'][_0xa757('0x1f')]({'plain':!![]});if(!_0x505cd)throw new Error(_0xa757('0x44'));if(_0x505cd[_0xa757('0x45')]===_0xa757('0x46')){var _0x319988=_0x57bf73[_0xa757('0x1f')]({'plain':!![]});var _0x15bad7=_0xa757('0x20');return db[_0xa757('0x47')][_0xa757('0x41')]({'where':{'name':_0x15bad7,'userProfileId':_0x505cd[_0xa757('0x48')]},'raw':!![]})[_0xa757('0x1e')](function(_0x2367c7){if(_0x2367c7&&_0x2367c7[_0xa757('0x49')]===0x0){return db[_0xa757('0x21')][_0xa757('0x42')]({'name':_0x319988['name'],'resourceId':_0x319988['id'],'type':_0x2367c7[_0xa757('0x25')],'sectionId':_0x2367c7['id']},{})['then'](function(){return _0x57bf73;});}else{return _0x57bf73;}})[_0xa757('0x3f')](function(_0x311c25){logger[_0xa757('0x24')](_0xa757('0x4a'),_0x311c25);throw _0x311c25;});}return _0x57bf73;})['then'](respondWithResult(_0x151cc3,0xc9))[_0xa757('0x3f')](handleError(_0x151cc3,null));};exports[_0xa757('0x1d')]=function(_0x8614f9,_0x980e1){if(_0x8614f9['body']['id']){delete _0x8614f9[_0xa757('0x43')]['id'];}return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x8614f9[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x980e1,null))[_0xa757('0x1e')](saveUpdates(_0x8614f9['body'],null))['then'](respondWithResult(_0x980e1,null))['catch'](handleError(_0x980e1,null));};exports['destroy']=function(_0x1d8742,_0x9b3779){return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x1d8742[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x9b3779,null))['then'](removeEntity(_0x9b3779,null))[_0xa757('0x3f')](handleError(_0x9b3779,null));};exports[_0xa757('0x4b')]=function(_0x34e03f,_0x29b2f5,_0x48b578){return db[_0xa757('0x28')][_0xa757('0x4c')]({'where':{'id':_0x34e03f['params']['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x29b2f5,null))['then'](function(_0x211980){var _0x5d375c;var _0x51be6e={},_0x58633a={};_0x58633a['model']=_[_0xa757('0x2f')](db[_0xa757('0x4d')][_0xa757('0x29')]);_0x58633a[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x34e03f[_0xa757('0x2e')]);_0x58633a['filters']=_['intersection'](_0x58633a[_0xa757('0x2d')],_0x58633a[_0xa757('0x2e')]);_0x51be6e[_0xa757('0x32')]=_['intersection'](_0x58633a['model'],qs[_0xa757('0x33')](_0x34e03f[_0xa757('0x2e')][_0xa757('0x33')]));_0x51be6e[_0xa757('0x32')]=_0x51be6e[_0xa757('0x32')][_0xa757('0x34')]?_0x51be6e['attributes']:_0x58633a[_0xa757('0x2d')];if(!_0x34e03f[_0xa757('0x2e')][_0xa757('0x4e')](_0xa757('0x35'))){_0x51be6e[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x34e03f[_0xa757('0x2e')][_0xa757('0x1a')]);_0x51be6e[_0xa757('0x17')]=qs[_0xa757('0x17')](_0x34e03f['query'][_0xa757('0x17')]);}_0x51be6e['order']=qs['sort'](_0x34e03f[_0xa757('0x2e')][_0xa757('0x37')]);_0x51be6e[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x34e03f[_0xa757('0x2e')],_0x58633a[_0xa757('0x30')]));if(_0x34e03f[_0xa757('0x2e')][_0xa757('0x3a')]){_0x51be6e[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x51be6e['where'],{'$or':_[_0xa757('0x27')](_0x51be6e[_0xa757('0x32')],function(_0x5f0b71){var _0x11ebb3={};_0x11ebb3[_0x5f0b71]={'$like':'%'+_0x34e03f[_0xa757('0x2e')][_0xa757('0x3a')]+'%'};return _0x11ebb3;})});}_0x51be6e[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x51be6e[_0xa757('0x38')],{'mailboxuser':_0x211980['mailbox']});_0x51be6e=_[_0xa757('0x3b')]({},_0x51be6e,_0x34e03f['options']);return db[_0xa757('0x4d')][_0xa757('0x4f')](_0x51be6e)[_0xa757('0x1e')](respondWithFilteredResult(_0x29b2f5,_0x51be6e));})[_0xa757('0x3f')](handleError(_0x29b2f5,null));}; \ No newline at end of file +var _0x0102=['rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','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','end','status','json','offset','undefined','limit','count','set','apply','reject','save','get','Voicemails','destroy','then','sendStatus','stack','name','send','index','VoiceMail'];(function(_0x4a6970,_0x291aa1){var _0x4b36c5=function(_0x2d8363){while(--_0x2d8363){_0x4a6970['push'](_0x4a6970['shift']());}};_0x4b36c5(++_0x291aa1);}(_0x0102,0x186));var _0x2010=function(_0x26c2b6,_0x3fdc0d){_0x26c2b6=_0x26c2b6-0x0;var _0x261a50=_0x0102[_0x26c2b6];return _0x261a50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){var _0xdb57be=_0x277dcc[_0x2010('0x23')]({'plain':!![]});var _0x52b4fe=_0x2010('0x24');return db['UserProfileResource'][_0x2010('0x25')]({'where':{'type':_0x52b4fe,'resourceId':_0xdb57be['id']}})[_0x2010('0x26')](function(){return _0x277dcc;});})[_0x2010('0x26')](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x2f63bb,_0x981b65){return function(_0x3eb4dc){if(!_0x3eb4dc){_0x2f63bb[_0x2010('0x27')](0x194);}return _0x3eb4dc;};}function handleError(_0x103460,_0x122ee3){_0x122ee3=_0x122ee3||0x1f4;return function(_0x2ebdbb){logger['error'](_0x2ebdbb[_0x2010('0x28')]);if(_0x2ebdbb['name']){delete _0x2ebdbb[_0x2010('0x29')];}_0x103460[_0x2010('0x19')](_0x122ee3)[_0x2010('0x2a')](_0x2ebdbb);};}exports[_0x2010('0x2b')]=function(_0x564a64,_0x554f66){var _0x136d5f={},_0x48d9f2={},_0x2839f2={'count':0x0,'rows':[]};var _0x1d5d7a=_['map'](db[_0x2010('0x2c')][_0x2010('0x2d')],function(_0x2b1ff7){return{'name':_0x2b1ff7[_0x2010('0x2e')],'type':_0x2b1ff7[_0x2010('0x2f')]['key']};});_0x48d9f2[_0x2010('0x30')]=_[_0x2010('0x31')](_0x1d5d7a,_0x2010('0x29'));_0x48d9f2['query']=_['keys'](_0x564a64[_0x2010('0x32')]);_0x48d9f2[_0x2010('0x33')]=_[_0x2010('0x34')](_0x48d9f2['model'],_0x48d9f2['query']);_0x136d5f[_0x2010('0x35')]=_[_0x2010('0x34')](_0x48d9f2[_0x2010('0x30')],qs[_0x2010('0x36')](_0x564a64[_0x2010('0x32')]['fields']));_0x136d5f['attributes']=_0x136d5f['attributes'][_0x2010('0x37')]?_0x136d5f[_0x2010('0x35')]:_0x48d9f2[_0x2010('0x30')];if(!_0x564a64['query'][_0x2010('0x38')](_0x2010('0x39'))){_0x136d5f[_0x2010('0x1d')]=qs[_0x2010('0x1d')](_0x564a64['query'][_0x2010('0x1d')]);_0x136d5f[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x564a64['query'][_0x2010('0x1b')]);}_0x136d5f['order']=qs[_0x2010('0x3a')](_0x564a64[_0x2010('0x32')][_0x2010('0x3a')]);_0x136d5f[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x564a64['query'],_0x48d9f2[_0x2010('0x33')]),_0x1d5d7a);if(_0x564a64['query'][_0x2010('0x3d')]){_0x136d5f[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x136d5f[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x1d5d7a,function(_0x1f053c){if(_0x1f053c[_0x2010('0x2f')]!==_0x2010('0x3f')){var _0x2fcaef={};_0x2fcaef[_0x1f053c[_0x2010('0x29')]]={'$like':'%'+_0x564a64[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x2fcaef;}})});}_0x136d5f=_[_0x2010('0x3e')]({},_0x136d5f,_0x564a64[_0x2010('0x40')]);var _0x4b6251={'where':_0x136d5f['where']};return db[_0x2010('0x2c')][_0x2010('0x1e')](_0x4b6251)[_0x2010('0x26')](function(_0x35d631){_0x2839f2[_0x2010('0x1e')]=_0x35d631;if(_0x564a64[_0x2010('0x32')][_0x2010('0x41')]){_0x136d5f['include']=[{'all':!![]}];}return db[_0x2010('0x2c')]['findAll'](_0x136d5f);})[_0x2010('0x26')](function(_0x3ff496){_0x2839f2[_0x2010('0x42')]=_0x3ff496;return _0x2839f2;})[_0x2010('0x26')](respondWithFilteredResult(_0x554f66,_0x136d5f))[_0x2010('0x43')](handleError(_0x554f66,null));};exports['show']=function(_0x364338,_0x71eb35){var _0x3dd83c={'raw':!![],'where':{'id':_0x364338['params']['id']}},_0x41b3b5={};_0x41b3b5[_0x2010('0x30')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x41b3b5[_0x2010('0x32')]=_[_0x2010('0x44')](_0x364338[_0x2010('0x32')]);_0x41b3b5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],_0x41b3b5['query']);_0x3dd83c[_0x2010('0x35')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],qs['fields'](_0x364338['query'][_0x2010('0x36')]));_0x3dd83c['attributes']=_0x3dd83c[_0x2010('0x35')][_0x2010('0x37')]?_0x3dd83c[_0x2010('0x35')]:_0x41b3b5[_0x2010('0x30')];if(_0x364338['query'][_0x2010('0x41')]){_0x3dd83c[_0x2010('0x45')]=[{'all':!![]}];}_0x3dd83c=_[_0x2010('0x3e')]({},_0x3dd83c,_0x364338[_0x2010('0x40')]);return db[_0x2010('0x2c')][_0x2010('0x46')](_0x3dd83c)['then'](handleEntityNotFound(_0x71eb35,null))[_0x2010('0x26')](respondWithResult(_0x71eb35,null))[_0x2010('0x43')](handleError(_0x71eb35,null));};exports[_0x2010('0x47')]=function(_0x4dc0cf,_0x30e5d0){return db[_0x2010('0x2c')]['create'](_0x4dc0cf[_0x2010('0x48')],{})[_0x2010('0x26')](function(_0x110791){var _0x242274=_0x4dc0cf[_0x2010('0x49')][_0x2010('0x23')]({'plain':!![]});if(!_0x242274)throw new Error(_0x2010('0x4a'));if(_0x242274[_0x2010('0x4b')]==='user'){var _0x5258b9=_0x110791[_0x2010('0x23')]({'plain':!![]});var _0xe1721f='Voicemails';return db[_0x2010('0x4c')][_0x2010('0x46')]({'where':{'name':_0xe1721f,'userProfileId':_0x242274[_0x2010('0x4d')]},'raw':!![]})[_0x2010('0x26')](function(_0x1f1a59){if(_0x1f1a59&&_0x1f1a59['autoAssociation']===0x0){return db['UserProfileResource'][_0x2010('0x47')]({'name':_0x5258b9[_0x2010('0x29')],'resourceId':_0x5258b9['id'],'type':_0x1f1a59[_0x2010('0x29')],'sectionId':_0x1f1a59['id']},{})[_0x2010('0x26')](function(){return _0x110791;});}else{return _0x110791;}})[_0x2010('0x43')](function(_0x2d8164){logger[_0x2010('0x4e')](_0x2010('0x4f'),_0x2d8164);throw _0x2d8164;});}return _0x110791;})[_0x2010('0x26')](respondWithResult(_0x30e5d0,0xc9))[_0x2010('0x43')](handleError(_0x30e5d0,null));};exports[_0x2010('0x50')]=function(_0x5313b5,_0x24421a){if(_0x5313b5[_0x2010('0x48')]['id']){delete _0x5313b5['body']['id'];}return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x5313b5[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x24421a,null))[_0x2010('0x26')](saveUpdates(_0x5313b5[_0x2010('0x48')],null))[_0x2010('0x26')](respondWithResult(_0x24421a,null))[_0x2010('0x43')](handleError(_0x24421a,null));};exports[_0x2010('0x25')]=function(_0x2dbc2c,_0x1c0b2d){return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x2dbc2c[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x1c0b2d,null))[_0x2010('0x26')](removeEntity(_0x1c0b2d,null))[_0x2010('0x43')](handleError(_0x1c0b2d,null));};exports[_0x2010('0x52')]=function(_0x2d7765,_0x6f8565,_0x21ee87){return db[_0x2010('0x2c')][_0x2010('0x53')]({'where':{'id':_0x2d7765['params']['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x6f8565,null))['then'](function(_0x5253d5){var _0x1225d7;var _0x13f33d={},_0x4fb5d5={};_0x4fb5d5[_0x2010('0x30')]=_[_0x2010('0x44')](db[_0x2010('0x54')][_0x2010('0x2d')]);_0x4fb5d5['query']=_[_0x2010('0x44')](_0x2d7765[_0x2010('0x32')]);_0x4fb5d5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x4fb5d5['model'],_0x4fb5d5[_0x2010('0x32')]);_0x13f33d['attributes']=_[_0x2010('0x34')](_0x4fb5d5[_0x2010('0x30')],qs[_0x2010('0x36')](_0x2d7765[_0x2010('0x32')]['fields']));_0x13f33d['attributes']=_0x13f33d[_0x2010('0x35')][_0x2010('0x37')]?_0x13f33d['attributes']:_0x4fb5d5['model'];if(!_0x2d7765[_0x2010('0x32')][_0x2010('0x38')](_0x2010('0x39'))){_0x13f33d[_0x2010('0x1d')]=qs['limit'](_0x2d7765[_0x2010('0x32')]['limit']);_0x13f33d[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x2d7765[_0x2010('0x32')][_0x2010('0x1b')]);}_0x13f33d['order']=qs[_0x2010('0x3a')](_0x2d7765[_0x2010('0x32')]['sort']);_0x13f33d[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x2d7765[_0x2010('0x32')],_0x4fb5d5[_0x2010('0x33')]));if(_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]){_0x13f33d[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x13f33d[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x13f33d[_0x2010('0x35')],function(_0x4ebdca){var _0x3ca7b3={};_0x3ca7b3[_0x4ebdca]={'$like':'%'+_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x3ca7b3;})});}_0x13f33d['where']=_['merge'](_0x13f33d[_0x2010('0x3b')],{'mailboxuser':_0x5253d5[_0x2010('0x55')]});_0x13f33d=_[_0x2010('0x3e')]({},_0x13f33d,_0x2d7765[_0x2010('0x40')]);return db[_0x2010('0x54')][_0x2010('0x56')](_0x13f33d)['then'](respondWithFilteredResult(_0x6f8565,_0x13f33d));})[_0x2010('0x43')](handleError(_0x6f8565,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f92ce79..f2a5931 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 _0x06fd=['voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceMail.attributes','define','VoiceMail'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x06fd,0x137));var _0xd06f=function(_0x4c1eec,_0x515aa1){_0x4c1eec=_0x4c1eec-0x0;var _0x5d8475=_0x06fd[_0x4c1eec];return _0x5d8475;};'use strict';var _=require(_0xd06f('0x0'));var util=require(_0xd06f('0x1'));var logger=require(_0xd06f('0x2'))(_0xd06f('0x3'));var moment=require(_0xd06f('0x4'));var BPromise=require(_0xd06f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd06f('0x6'));var rimraf=require('rimraf');var config=require(_0xd06f('0x7'));var attributes=require(_0xd06f('0x8'));module['exports']=function(_0x43339f,_0x5748ea){return _0x43339f[_0xd06f('0x9')](_0xd06f('0xa'),attributes,{'tableName':_0xd06f('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xd06f('0xc'),_0xd06f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c0=['rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','../../config/logger','moment','bluebird','path'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xc2c0,0xe0));var _0x0c2c=function(_0x141d53,_0x31fd6e){_0x141d53=_0x141d53-0x0;var _0x2c3450=_0xc2c0[_0x141d53];return _0x2c3450;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c2c('0x0'))('api');var moment=require(_0x0c2c('0x1'));var BPromise=require(_0x0c2c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c2c('0x3'));var rimraf=require(_0x0c2c('0x4'));var config=require('../../config/environment');var attributes=require(_0x0c2c('0x5'));module[_0x0c2c('0x6')]=function(_0x4bc139,_0x35963d){return _0x4bc139[_0x0c2c('0x7')](_0x0c2c('0x8'),attributes,{'tableName':_0x0c2c('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x0c2c('0xa'),_0x0c2c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 6cf59b6..4b9a8c0 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 _0x4491=['request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s'];(function(_0x393e78,_0x385f54){var _0x4aba47=function(_0x3e9e8b){while(--_0x3e9e8b){_0x393e78['push'](_0x393e78['shift']());}};_0x4aba47(++_0x385f54);}(_0x4491,0x177));var _0x1449=function(_0x3c0249,_0xd45659){_0x3c0249=_0x3c0249-0x0;var _0x2502f9=_0x4491[_0x3c0249];return _0x2502f9;};'use strict';var _=require(_0x1449('0x0'));var util=require(_0x1449('0x1'));var moment=require(_0x1449('0x2'));var BPromise=require(_0x1449('0x3'));var rs=require(_0x1449('0x4'));var fs=require('fs');var Redis=require(_0x1449('0x5'));var db=require(_0x1449('0x6'))['db'];var utils=require(_0x1449('0x7'));var logger=require(_0x1449('0x8'))(_0x1449('0x9'));var config=require(_0x1449('0xa'));var jayson=require(_0x1449('0xb'));var client=jayson['client'][_0x1449('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x576fa4,_0xa01f13,_0x425b8c){return new BPromise(function(_0x218db9,_0x31248a){return client[_0x1449('0xd')](_0x576fa4,_0x425b8c)[_0x1449('0xe')](function(_0x16d3a9){logger['info'](_0x1449('0xf'),_0xa01f13,_0x1449('0x10'));logger['debug'](_0x1449('0x11'),_0xa01f13,_0x1449('0x10'),JSON[_0x1449('0x12')](_0x16d3a9));if(_0x16d3a9[_0x1449('0x13')]){if(_0x16d3a9[_0x1449('0x13')]['code']===0x1f4){logger[_0x1449('0x13')](_0x1449('0xf'),_0xa01f13,_0x16d3a9[_0x1449('0x13')][_0x1449('0x14')]);return _0x31248a(_0x16d3a9['error'][_0x1449('0x14')]);}logger[_0x1449('0x13')](_0x1449('0xf'),_0xa01f13,_0x16d3a9[_0x1449('0x13')][_0x1449('0x14')]);return _0x218db9(_0x16d3a9[_0x1449('0x13')][_0x1449('0x14')]);}else{logger[_0x1449('0x15')](_0x1449('0xf'),_0xa01f13,'request\x20sent');_0x218db9(_0x16d3a9['result']['message']);}})[_0x1449('0x16')](function(_0x48c9d1){logger[_0x1449('0x13')](_0x1449('0xf'),_0xa01f13,_0x48c9d1);_0x31248a(_0x48c9d1);});});} \ No newline at end of file +var _0x28f2=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x163742,_0x488a5f){var _0xb0726c=function(_0x74cadb){while(--_0x74cadb){_0x163742['push'](_0x163742['shift']());}};_0xb0726c(++_0x488a5f);}(_0x28f2,0xaa));var _0x228f=function(_0x4dc88f,_0x2d2c2b){_0x4dc88f=_0x4dc88f-0x0;var _0x4e9790=_0x28f2[_0x4dc88f];return _0x4e9790;};'use strict';var _=require(_0x228f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x228f('0x1'));var rs=require(_0x228f('0x2'));var fs=require('fs');var Redis=require(_0x228f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x228f('0x4'));var config=require(_0x228f('0x5'));var jayson=require(_0x228f('0x6'));var client=jayson[_0x228f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34fa5e,_0x5a2d33,_0x37757){return new BPromise(function(_0x5de01e,_0x33a309){return client[_0x228f('0x8')](_0x34fa5e,_0x37757)[_0x228f('0x9')](function(_0x39739d){logger[_0x228f('0xa')](_0x228f('0xb'),_0x5a2d33,_0x228f('0xc'));logger[_0x228f('0xd')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5a2d33,_0x228f('0xc'),JSON[_0x228f('0xe')](_0x39739d));if(_0x39739d['error']){if(_0x39739d[_0x228f('0xf')]['code']===0x1f4){logger[_0x228f('0xf')]('VoiceMail,\x20%s,\x20%s',_0x5a2d33,_0x39739d[_0x228f('0xf')][_0x228f('0x10')]);return _0x33a309(_0x39739d['error'][_0x228f('0x10')]);}logger[_0x228f('0xf')](_0x228f('0xb'),_0x5a2d33,_0x39739d[_0x228f('0xf')][_0x228f('0x10')]);return _0x5de01e(_0x39739d['error']['message']);}else{logger[_0x228f('0xa')]('VoiceMail,\x20%s,\x20%s',_0x5a2d33,_0x228f('0xc'));_0x5de01e(_0x39739d[_0x228f('0x11')]['message']);}})[_0x228f('0x12')](function(_0x3ce2ab){logger[_0x228f('0xf')](_0x228f('0xb'),_0x5a2d33,_0x3ce2ab);_0x33a309(_0x3ce2ab);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 80ca739..6a99df5 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 _0x8447=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports'];(function(_0x3bda86,_0x3c45e5){var _0x4d7ffa=function(_0x15185d){while(--_0x15185d){_0x3bda86['push'](_0x3bda86['shift']());}};_0x4d7ffa(++_0x3c45e5);}(_0x8447,0x1c8));var _0x7844=function(_0x3eb9e9,_0x50272d){_0x3eb9e9=_0x3eb9e9-0x0;var _0x47a67b=_0x8447[_0x3eb9e9];return _0x47a67b;};'use strict';var multer=require(_0x7844('0x0'));var util=require(_0x7844('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7844('0x2'));var router=express[_0x7844('0x3')]();var fs_extra=require(_0x7844('0x4'));var auth=require(_0x7844('0x5'));var interaction=require(_0x7844('0x6'));var config=require(_0x7844('0x7'));var controller=require(_0x7844('0x8'));router[_0x7844('0x9')]('/',auth['isAuthenticated'](),controller[_0x7844('0xa')]);router['get'](_0x7844('0xb'),auth[_0x7844('0xc')](),controller[_0x7844('0xd')]);router[_0x7844('0x9')]('/:id/download',auth[_0x7844('0xc')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x7844('0xe')]);router[_0x7844('0xf')](_0x7844('0xb'),auth['isAuthenticated'](),controller[_0x7844('0x10')]);router['delete'](_0x7844('0xb'),auth['isAuthenticated'](),controller[_0x7844('0x11')]);module[_0x7844('0x12')]=router; \ No newline at end of file +var _0x9fcc=['get','show','/:id/download','download','post','create','put','/:id','update','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated'];(function(_0x533155,_0x33ad7e){var _0x24ab44=function(_0x3015c9){while(--_0x3015c9){_0x533155['push'](_0x533155['shift']());}};_0x24ab44(++_0x33ad7e);}(_0x9fcc,0x8f));var _0xc9fc=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9fcc[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xc9fc('0x0'));var util=require(_0xc9fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc9fc('0x2')]();var fs_extra=require(_0xc9fc('0x3'));var auth=require(_0xc9fc('0x4'));var interaction=require(_0xc9fc('0x5'));var config=require(_0xc9fc('0x6'));var controller=require(_0xc9fc('0x7'));router['get']('/',auth[_0xc9fc('0x8')](),controller['index']);router[_0xc9fc('0x9')]('/:id',auth[_0xc9fc('0x8')](),controller[_0xc9fc('0xa')]);router[_0xc9fc('0x9')](_0xc9fc('0xb'),auth['isAuthenticated'](),controller[_0xc9fc('0xc')]);router[_0xc9fc('0xd')]('/',auth['isAuthenticated'](),controller[_0xc9fc('0xe')]);router[_0xc9fc('0xf')](_0xc9fc('0x10'),auth['isAuthenticated'](),controller[_0xc9fc('0x11')]);router['delete']('/:id',auth[_0xc9fc('0x8')](),controller['destroy']);module[_0xc9fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index b320ec5..d4271f9 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 _0xb5e8=['VIRTUAL','STRING','BLOB','literal','sequelize','exports'];(function(_0xafc39,_0x47b645){var _0x137594=function(_0x3c287f){while(--_0x3c287f){_0xafc39['push'](_0xafc39['shift']());}};_0x137594(++_0x47b645);}(_0xb5e8,0x1cc));var _0x8b5e=function(_0x58c978,_0x1455b2){_0x58c978=_0x58c978-0x0;var _0x4ca7fe=_0xb5e8[_0x58c978];return _0x4ca7fe;};'use strict';var Sequelize=require(_0x8b5e('0x0'));module[_0x8b5e('0x1')]={'name':{'type':Sequelize[_0x8b5e('0x2')],'get':function(_0x398189){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8b5e('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x8b5e('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x8b5e('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8b5e('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8b5e('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x8b5e('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x8b5e('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8b5e('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x8b5e('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xc931=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x3638fc,_0xe0418b){var _0x28de82=function(_0x513980){while(--_0x513980){_0x3638fc['push'](_0x3638fc['shift']());}};_0x28de82(++_0xe0418b);}(_0xc931,0xd0));var _0x1c93=function(_0x119e76,_0x2dabb0){_0x119e76=_0x119e76-0x0;var _0x29b4bf=_0xc931[_0x119e76];return _0x29b4bf;};'use strict';var Sequelize=require('sequelize');module[_0x1c93('0x0')]={'name':{'type':Sequelize[_0x1c93('0x1')],'get':function(_0x592003){return this[_0x1c93('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x1c93('0x4')](_0x1c93('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':''},'stamp':{'type':_0x1c93('0x6'),'defaultValue':Sequelize[_0x1c93('0x7')](_0x1c93('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 77fe89f..dbbf5fc 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 _0xb6e6=['end','error','name','send','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMailMessage','includeAll','findAll','rows','catch','show','find','create','body','params','download','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','msg_id','.wav\x22','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xb6e6,0x170));var _0x6b6e=function(_0x541010,_0x5a3ac3){_0x541010=_0x541010-0x0;var _0x55c6c5=_0xb6e6[_0x541010];return _0x55c6c5;};'use strict';var emlformat=require(_0x6b6e('0x0'));var rimraf=require(_0x6b6e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b6e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6b6e('0x3'));var Mustache=require(_0x6b6e('0x4'));var util=require(_0x6b6e('0x5'));var path=require('path');var sox=require(_0x6b6e('0x6'));var csv=require(_0x6b6e('0x7'));var ejs=require(_0x6b6e('0x8'));var fs=require('fs');var fs_extra=require(_0x6b6e('0x9'));var _=require(_0x6b6e('0xa'));var squel=require(_0x6b6e('0xb'));var crypto=require(_0x6b6e('0xc'));var jsforce=require(_0x6b6e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6b6e('0x7'));var querystring=require(_0x6b6e('0xe'));var Papa=require(_0x6b6e('0xf'));var Redis=require(_0x6b6e('0x10'));var authService=require(_0x6b6e('0x11'));var qs=require(_0x6b6e('0x12'));var as=require(_0x6b6e('0x13'));var hardwareService=require(_0x6b6e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x6b6e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6b6e('0x16'));var db=require(_0x6b6e('0x17'))['db'];function respondWithStatusCode(_0x57ca04,_0xaab694){_0xaab694=_0xaab694||0xcc;return function(_0x1fc29d){if(_0x1fc29d){return _0x57ca04[_0x6b6e('0x18')](_0xaab694);}return _0x57ca04[_0x6b6e('0x19')](_0xaab694)['end']();};}function respondWithResult(_0x515e0a,_0x3990f0){_0x3990f0=_0x3990f0||0xc8;return function(_0x5ca7fa){if(_0x5ca7fa){return _0x515e0a[_0x6b6e('0x19')](_0x3990f0)[_0x6b6e('0x1a')](_0x5ca7fa);}};}function respondWithFilteredResult(_0x29cae4,_0x4a6424){return function(_0x447afc){if(_0x447afc){var _0x303a50=typeof _0x4a6424[_0x6b6e('0x1b')]===_0x6b6e('0x1c')&&typeof _0x4a6424[_0x6b6e('0x1d')]===_0x6b6e('0x1c');var _0x174c00=_0x447afc['count'];var _0x1b8c45=_0x303a50?0x0:_0x4a6424[_0x6b6e('0x1b')];var _0x47a3e2=_0x303a50?_0x447afc['count']:_0x4a6424[_0x6b6e('0x1b')]+_0x4a6424['limit'];var _0x5a08bd;if(_0x47a3e2>=_0x174c00){_0x47a3e2=_0x174c00;_0x5a08bd=0xc8;}else{_0x5a08bd=0xce;}_0x29cae4[_0x6b6e('0x19')](_0x5a08bd);return _0x29cae4[_0x6b6e('0x1e')]('Content-Range',_0x1b8c45+'-'+_0x47a3e2+'/'+_0x174c00)[_0x6b6e('0x1a')](_0x447afc);}return null;};}function patchUpdates(_0x1bf1f6){return function(_0x48d713){try{jsonpatch[_0x6b6e('0x1f')](_0x48d713,_0x1bf1f6,!![]);}catch(_0x32dde7){return BPromise[_0x6b6e('0x20')](_0x32dde7);}return _0x48d713[_0x6b6e('0x21')]();};}function saveUpdates(_0x3a6bc1,_0x473a5e){return function(_0x5045e3){if(_0x5045e3){return _0x5045e3[_0x6b6e('0x22')](_0x3a6bc1)[_0x6b6e('0x23')](function(_0x29b66c){return _0x29b66c;});}return null;};}function removeEntity(_0xc5784a,_0x52ee04){return function(_0x655123){if(_0x655123){return _0x655123[_0x6b6e('0x24')]()[_0x6b6e('0x23')](function(){_0xc5784a[_0x6b6e('0x19')](0xcc)[_0x6b6e('0x25')]();});}};}function handleEntityNotFound(_0x4052cf,_0x1aa3ba){return function(_0x4ffa6f){if(!_0x4ffa6f){_0x4052cf[_0x6b6e('0x18')](0x194);}return _0x4ffa6f;};}function handleError(_0x1c2fcd,_0xc86505){_0xc86505=_0xc86505||0x1f4;return function(_0x49a8a0){logger[_0x6b6e('0x26')](_0x49a8a0['stack']);if(_0x49a8a0[_0x6b6e('0x27')]){delete _0x49a8a0[_0x6b6e('0x27')];}_0x1c2fcd[_0x6b6e('0x19')](_0xc86505)[_0x6b6e('0x28')](_0x49a8a0);};}exports['index']=function(_0x37da55,_0x5d5026){var _0x4487bb={},_0xb1d26e={},_0x4b3dae={'count':0x0,'rows':[]};var _0x57ab6a=_['map'](db['VoiceMailMessage'][_0x6b6e('0x29')],function(_0x346f57){return{'name':_0x346f57['fieldName'],'type':_0x346f57[_0x6b6e('0x2a')][_0x6b6e('0x2b')]};});_0xb1d26e[_0x6b6e('0x2c')]=_['differenceBy'](_['map'](_0x57ab6a,_0x6b6e('0x27')),[_0x6b6e('0x27')]);_0xb1d26e['query']=_[_0x6b6e('0x2d')](_0x37da55[_0x6b6e('0x2e')]);_0xb1d26e[_0x6b6e('0x2f')]=_[_0x6b6e('0x30')](_0xb1d26e[_0x6b6e('0x2c')],_0xb1d26e['query']);_0x4487bb[_0x6b6e('0x31')]=_['intersection'](_0xb1d26e[_0x6b6e('0x2c')],qs['fields'](_0x37da55[_0x6b6e('0x2e')][_0x6b6e('0x32')]));_0x4487bb[_0x6b6e('0x31')]=_0x4487bb[_0x6b6e('0x31')][_0x6b6e('0x33')]?_0x4487bb[_0x6b6e('0x31')]:_0xb1d26e['model'];if(!_0x37da55[_0x6b6e('0x2e')][_0x6b6e('0x34')]('nolimit')){_0x4487bb[_0x6b6e('0x1d')]=qs[_0x6b6e('0x1d')](_0x37da55['query'][_0x6b6e('0x1d')]);_0x4487bb[_0x6b6e('0x1b')]=qs[_0x6b6e('0x1b')](_0x37da55[_0x6b6e('0x2e')]['offset']);}_0x4487bb[_0x6b6e('0x35')]=qs[_0x6b6e('0x36')](_0x37da55[_0x6b6e('0x2e')][_0x6b6e('0x36')]);_0x4487bb[_0x6b6e('0x37')]=qs['filters'](_[_0x6b6e('0x38')](_0x37da55['query'],_0xb1d26e[_0x6b6e('0x2f')]),_0x57ab6a);if(_0x37da55[_0x6b6e('0x2e')][_0x6b6e('0x39')]){_0x4487bb[_0x6b6e('0x37')]=_[_0x6b6e('0x3a')](_0x4487bb['where'],{'$or':_['map'](_0x57ab6a,function(_0x301292){if(_0x301292['type']!==_0x6b6e('0x3b')){var _0x338665={};_0x338665[_0x301292['name']]={'$like':'%'+_0x37da55[_0x6b6e('0x2e')]['filter']+'%'};return _0x338665;}})});}_0x4487bb=_[_0x6b6e('0x3a')]({},_0x4487bb,_0x37da55[_0x6b6e('0x3c')]);var _0x43c3fe={'where':_0x4487bb[_0x6b6e('0x37')]};return db[_0x6b6e('0x3d')]['count'](_0x43c3fe)[_0x6b6e('0x23')](function(_0x1b462d){_0x4b3dae['count']=_0x1b462d;if(_0x37da55[_0x6b6e('0x2e')][_0x6b6e('0x3e')]){_0x4487bb['include']=[{'all':!![]}];}return db[_0x6b6e('0x3d')][_0x6b6e('0x3f')](_0x4487bb);})[_0x6b6e('0x23')](function(_0x174af7){_0x4b3dae[_0x6b6e('0x40')]=_0x174af7;return _0x4b3dae;})[_0x6b6e('0x23')](respondWithFilteredResult(_0x5d5026,_0x4487bb))[_0x6b6e('0x41')](handleError(_0x5d5026,null));};exports[_0x6b6e('0x42')]=function(_0x468c28,_0x566c06){var _0x1ddeb1={'raw':!![],'where':{'id':_0x468c28['params']['id']}},_0x52e0f3={};_0x52e0f3[_0x6b6e('0x2c')]=_[_0x6b6e('0x2d')](db[_0x6b6e('0x3d')][_0x6b6e('0x29')]);_0x52e0f3[_0x6b6e('0x2e')]=_['keys'](_0x468c28[_0x6b6e('0x2e')]);_0x52e0f3[_0x6b6e('0x2f')]=_[_0x6b6e('0x30')](_0x52e0f3[_0x6b6e('0x2c')],_0x52e0f3[_0x6b6e('0x2e')]);_0x1ddeb1[_0x6b6e('0x31')]=_[_0x6b6e('0x30')](_0x52e0f3[_0x6b6e('0x2c')],qs['fields'](_0x468c28['query'][_0x6b6e('0x32')]));_0x1ddeb1[_0x6b6e('0x31')]=_0x1ddeb1[_0x6b6e('0x31')][_0x6b6e('0x33')]?_0x1ddeb1[_0x6b6e('0x31')]:_0x52e0f3[_0x6b6e('0x2c')];if(_0x468c28[_0x6b6e('0x2e')][_0x6b6e('0x3e')]){_0x1ddeb1['include']=[{'all':!![]}];}_0x1ddeb1=_['merge']({},_0x1ddeb1,_0x468c28['options']);return db[_0x6b6e('0x3d')][_0x6b6e('0x43')](_0x1ddeb1)['then'](handleEntityNotFound(_0x566c06,null))[_0x6b6e('0x23')](respondWithResult(_0x566c06,null))[_0x6b6e('0x41')](handleError(_0x566c06,null));};exports['create']=function(_0x3a7bd2,_0x5db307){return db[_0x6b6e('0x3d')][_0x6b6e('0x44')](_0x3a7bd2[_0x6b6e('0x45')],{})[_0x6b6e('0x23')](respondWithResult(_0x5db307,0xc9))[_0x6b6e('0x41')](handleError(_0x5db307,null));};exports[_0x6b6e('0x22')]=function(_0x13eda0,_0x2a5473){if(_0x13eda0[_0x6b6e('0x45')]['id']){delete _0x13eda0['body']['id'];}return db[_0x6b6e('0x3d')][_0x6b6e('0x43')]({'where':{'id':_0x13eda0[_0x6b6e('0x46')]['id']}})[_0x6b6e('0x23')](handleEntityNotFound(_0x2a5473,null))[_0x6b6e('0x23')](saveUpdates(_0x13eda0['body'],null))[_0x6b6e('0x23')](respondWithResult(_0x2a5473,null))[_0x6b6e('0x41')](handleError(_0x2a5473,null));};exports[_0x6b6e('0x24')]=function(_0x513988,_0x3db8cd){return db[_0x6b6e('0x3d')][_0x6b6e('0x43')]({'where':{'id':_0x513988['params']['id']}})[_0x6b6e('0x23')](handleEntityNotFound(_0x3db8cd,null))[_0x6b6e('0x23')](removeEntity(_0x3db8cd,null))[_0x6b6e('0x41')](handleError(_0x3db8cd,null));};exports[_0x6b6e('0x47')]=function(_0x3f7612,_0x23fbc3,_0x7600c6){return db['VoiceMailMessage'][_0x6b6e('0x43')]({'where':{'id':_0x3f7612['params']['id']},'attributes':['id','recording','msg_id']})[_0x6b6e('0x23')](handleEntityNotFound(_0x23fbc3,null))[_0x6b6e('0x23')](function(_0x47f1f1){if(_0x47f1f1){if(!_0x47f1f1['recording']){throw new db[(_0x6b6e('0x48'))][(_0x6b6e('0x49'))](_0x6b6e('0x4a'));}var _0x26445d={'Content-Type':_0x6b6e('0x4b'),'Content-Disposition':_0x6b6e('0x4c')};if(_0x47f1f1['msg_id']){_0x26445d[_0x6b6e('0x4d')]=_0x6b6e('0x4e')+_0x47f1f1[_0x6b6e('0x4f')]+_0x6b6e('0x50');}_0x23fbc3[_0x6b6e('0x1e')](_0x26445d);return _0x23fbc3['send'](new Buffer(_0x47f1f1['recording']));}})[_0x6b6e('0x41')](handleError(_0x23fbc3,null));}; \ No newline at end of file +var _0x32d4=['count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','.wav\x22','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x480614,_0x3bbaeb){var _0x4ea6eb=function(_0x1413b8){while(--_0x1413b8){_0x480614['push'](_0x480614['shift']());}};_0x4ea6eb(++_0x3bbaeb);}(_0x32d4,0x14c));var _0x432d=function(_0x15b55b,_0x4e0b5b){_0x15b55b=_0x15b55b-0x0;var _0x5786e7=_0x32d4[_0x15b55b];return _0x5786e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x432d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x432d('0x1'));var rp=require(_0x432d('0x2'));var moment=require(_0x432d('0x3'));var BPromise=require(_0x432d('0x4'));var Mustache=require('mustache');var util=require(_0x432d('0x5'));var path=require(_0x432d('0x6'));var sox=require(_0x432d('0x7'));var csv=require('to-csv');var ejs=require(_0x432d('0x8'));var fs=require('fs');var fs_extra=require(_0x432d('0x9'));var _=require(_0x432d('0xa'));var squel=require(_0x432d('0xb'));var crypto=require(_0x432d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x432d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x432d('0xe'));var Papa=require(_0x432d('0xf'));var Redis=require(_0x432d('0x10'));var authService=require(_0x432d('0x11'));var qs=require(_0x432d('0x12'));var as=require(_0x432d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x432d('0x14'))(_0x432d('0x15'));var utils=require(_0x432d('0x16'));var config=require(_0x432d('0x17'));var licenseUtil=require(_0x432d('0x18'));var db=require(_0x432d('0x19'))['db'];function respondWithStatusCode(_0x56a5a9,_0x453951){_0x453951=_0x453951||0xcc;return function(_0x3c7e7b){if(_0x3c7e7b){return _0x56a5a9[_0x432d('0x1a')](_0x453951);}return _0x56a5a9[_0x432d('0x1b')](_0x453951)[_0x432d('0x1c')]();};}function respondWithResult(_0xe9107,_0x190ce6){_0x190ce6=_0x190ce6||0xc8;return function(_0x377c6d){if(_0x377c6d){return _0xe9107[_0x432d('0x1b')](_0x190ce6)[_0x432d('0x1d')](_0x377c6d);}};}function respondWithFilteredResult(_0x5ac062,_0x5683af){return function(_0x1f5975){if(_0x1f5975){var _0x422a67=typeof _0x5683af[_0x432d('0x1e')]===_0x432d('0x1f')&&typeof _0x5683af['limit']===_0x432d('0x1f');var _0x8fc773=_0x1f5975[_0x432d('0x20')];var _0x3dc177=_0x422a67?0x0:_0x5683af[_0x432d('0x1e')];var _0xb9dcc7=_0x422a67?_0x1f5975[_0x432d('0x20')]:_0x5683af[_0x432d('0x1e')]+_0x5683af[_0x432d('0x21')];var _0x506a67;if(_0xb9dcc7>=_0x8fc773){_0xb9dcc7=_0x8fc773;_0x506a67=0xc8;}else{_0x506a67=0xce;}_0x5ac062[_0x432d('0x1b')](_0x506a67);return _0x5ac062[_0x432d('0x22')](_0x432d('0x23'),_0x3dc177+'-'+_0xb9dcc7+'/'+_0x8fc773)['json'](_0x1f5975);}return null;};}function patchUpdates(_0x476062){return function(_0xe49b84){try{jsonpatch[_0x432d('0x24')](_0xe49b84,_0x476062,!![]);}catch(_0x1a289f){return BPromise[_0x432d('0x25')](_0x1a289f);}return _0xe49b84[_0x432d('0x26')]();};}function saveUpdates(_0x413093,_0x59f376){return function(_0x35157b){if(_0x35157b){return _0x35157b[_0x432d('0x27')](_0x413093)[_0x432d('0x28')](function(_0x44f320){return _0x44f320;});}return null;};}function removeEntity(_0x38ac9f,_0x3b107b){return function(_0x39ab58){if(_0x39ab58){return _0x39ab58['destroy']()[_0x432d('0x28')](function(){_0x38ac9f[_0x432d('0x1b')](0xcc)[_0x432d('0x1c')]();});}};}function handleEntityNotFound(_0x33ce5b,_0x55dad0){return function(_0x134b36){if(!_0x134b36){_0x33ce5b[_0x432d('0x1a')](0x194);}return _0x134b36;};}function handleError(_0x149415,_0x407981){_0x407981=_0x407981||0x1f4;return function(_0xee913d){logger[_0x432d('0x29')](_0xee913d[_0x432d('0x2a')]);if(_0xee913d[_0x432d('0x2b')]){delete _0xee913d[_0x432d('0x2b')];}_0x149415[_0x432d('0x1b')](_0x407981)[_0x432d('0x2c')](_0xee913d);};}exports[_0x432d('0x2d')]=function(_0x41ad3c,_0xe3115f){var _0x201ed4={},_0x2769e1={},_0x53b9f7={'count':0x0,'rows':[]};var _0x1f73ed=_[_0x432d('0x2e')](db['VoiceMailMessage']['rawAttributes'],function(_0x1c4fdd){return{'name':_0x1c4fdd[_0x432d('0x2f')],'type':_0x1c4fdd['type'][_0x432d('0x30')]};});_0x2769e1[_0x432d('0x31')]=_[_0x432d('0x32')](_[_0x432d('0x2e')](_0x1f73ed,_0x432d('0x2b')),['name']);_0x2769e1['query']=_[_0x432d('0x33')](_0x41ad3c[_0x432d('0x34')]);_0x2769e1[_0x432d('0x35')]=_[_0x432d('0x36')](_0x2769e1[_0x432d('0x31')],_0x2769e1[_0x432d('0x34')]);_0x201ed4['attributes']=_[_0x432d('0x36')](_0x2769e1[_0x432d('0x31')],qs[_0x432d('0x37')](_0x41ad3c['query']['fields']));_0x201ed4[_0x432d('0x38')]=_0x201ed4[_0x432d('0x38')][_0x432d('0x39')]?_0x201ed4[_0x432d('0x38')]:_0x2769e1[_0x432d('0x31')];if(!_0x41ad3c['query'][_0x432d('0x3a')](_0x432d('0x3b'))){_0x201ed4[_0x432d('0x21')]=qs[_0x432d('0x21')](_0x41ad3c[_0x432d('0x34')][_0x432d('0x21')]);_0x201ed4[_0x432d('0x1e')]=qs[_0x432d('0x1e')](_0x41ad3c[_0x432d('0x34')][_0x432d('0x1e')]);}_0x201ed4[_0x432d('0x3c')]=qs['sort'](_0x41ad3c[_0x432d('0x34')][_0x432d('0x3d')]);_0x201ed4[_0x432d('0x3e')]=qs[_0x432d('0x35')](_[_0x432d('0x3f')](_0x41ad3c['query'],_0x2769e1[_0x432d('0x35')]),_0x1f73ed);if(_0x41ad3c[_0x432d('0x34')]['filter']){_0x201ed4[_0x432d('0x3e')]=_['merge'](_0x201ed4[_0x432d('0x3e')],{'$or':_[_0x432d('0x2e')](_0x1f73ed,function(_0x259e3d){if(_0x259e3d[_0x432d('0x40')]!==_0x432d('0x41')){var _0x4d4a35={};_0x4d4a35[_0x259e3d[_0x432d('0x2b')]]={'$like':'%'+_0x41ad3c[_0x432d('0x34')][_0x432d('0x42')]+'%'};return _0x4d4a35;}})});}_0x201ed4=_[_0x432d('0x43')]({},_0x201ed4,_0x41ad3c[_0x432d('0x44')]);var _0x4bbd9d={'where':_0x201ed4['where']};return db[_0x432d('0x45')][_0x432d('0x20')](_0x4bbd9d)[_0x432d('0x28')](function(_0xecf495){_0x53b9f7[_0x432d('0x20')]=_0xecf495;if(_0x41ad3c[_0x432d('0x34')][_0x432d('0x46')]){_0x201ed4[_0x432d('0x47')]=[{'all':!![]}];}return db[_0x432d('0x45')][_0x432d('0x48')](_0x201ed4);})[_0x432d('0x28')](function(_0x58be96){_0x53b9f7[_0x432d('0x49')]=_0x58be96;return _0x53b9f7;})['then'](respondWithFilteredResult(_0xe3115f,_0x201ed4))[_0x432d('0x4a')](handleError(_0xe3115f,null));};exports[_0x432d('0x4b')]=function(_0x188732,_0x1c39f6){var _0x38b12c={'raw':!![],'where':{'id':_0x188732[_0x432d('0x4c')]['id']}},_0x2e8f46={};_0x2e8f46[_0x432d('0x31')]=_[_0x432d('0x33')](db[_0x432d('0x45')][_0x432d('0x4d')]);_0x2e8f46['query']=_['keys'](_0x188732[_0x432d('0x34')]);_0x2e8f46[_0x432d('0x35')]=_['intersection'](_0x2e8f46['model'],_0x2e8f46[_0x432d('0x34')]);_0x38b12c[_0x432d('0x38')]=_[_0x432d('0x36')](_0x2e8f46[_0x432d('0x31')],qs[_0x432d('0x37')](_0x188732[_0x432d('0x34')][_0x432d('0x37')]));_0x38b12c[_0x432d('0x38')]=_0x38b12c['attributes'][_0x432d('0x39')]?_0x38b12c[_0x432d('0x38')]:_0x2e8f46['model'];if(_0x188732[_0x432d('0x34')]['includeAll']){_0x38b12c[_0x432d('0x47')]=[{'all':!![]}];}_0x38b12c=_['merge']({},_0x38b12c,_0x188732[_0x432d('0x44')]);return db[_0x432d('0x45')][_0x432d('0x4e')](_0x38b12c)['then'](handleEntityNotFound(_0x1c39f6,null))[_0x432d('0x28')](respondWithResult(_0x1c39f6,null))['catch'](handleError(_0x1c39f6,null));};exports[_0x432d('0x4f')]=function(_0x348dcf,_0x2415e8){return db[_0x432d('0x45')][_0x432d('0x4f')](_0x348dcf['body'],{})[_0x432d('0x28')](respondWithResult(_0x2415e8,0xc9))['catch'](handleError(_0x2415e8,null));};exports[_0x432d('0x27')]=function(_0x4bde23,_0x3d3132){if(_0x4bde23[_0x432d('0x50')]['id']){delete _0x4bde23['body']['id'];}return db[_0x432d('0x45')][_0x432d('0x4e')]({'where':{'id':_0x4bde23[_0x432d('0x4c')]['id']}})[_0x432d('0x28')](handleEntityNotFound(_0x3d3132,null))[_0x432d('0x28')](saveUpdates(_0x4bde23[_0x432d('0x50')],null))[_0x432d('0x28')](respondWithResult(_0x3d3132,null))[_0x432d('0x4a')](handleError(_0x3d3132,null));};exports[_0x432d('0x51')]=function(_0x5e3b8e,_0x1cb87b){return db['VoiceMailMessage'][_0x432d('0x4e')]({'where':{'id':_0x5e3b8e['params']['id']}})[_0x432d('0x28')](handleEntityNotFound(_0x1cb87b,null))[_0x432d('0x28')](removeEntity(_0x1cb87b,null))[_0x432d('0x4a')](handleError(_0x1cb87b,null));};exports[_0x432d('0x52')]=function(_0x40e780,_0x5769d3,_0x1258d0){return db[_0x432d('0x45')][_0x432d('0x4e')]({'where':{'id':_0x40e780['params']['id']},'attributes':['id',_0x432d('0x53'),_0x432d('0x54')]})[_0x432d('0x28')](handleEntityNotFound(_0x5769d3,null))[_0x432d('0x28')](function(_0x127422){if(_0x127422){if(!_0x127422['recording']){throw new db[(_0x432d('0x55'))][(_0x432d('0x56'))](_0x432d('0x57'));}var _0x1317d9={'Content-Type':'audio/wav','Content-Disposition':_0x432d('0x58')};if(_0x127422[_0x432d('0x54')]){_0x1317d9['Content-Disposition']=_0x432d('0x59')+_0x127422['msg_id']+_0x432d('0x5a');}_0x5769d3[_0x432d('0x22')](_0x1317d9);return _0x5769d3['send'](new Buffer(_0x127422[_0x432d('0x53')]));}})[_0x432d('0x4a')](handleError(_0x5769d3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a40e6db..7c928fd 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 _0xd46c=['bluebird','path','rimraf','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment'];(function(_0x3b7160,_0x36c1ba){var _0x40b48a=function(_0x156567){while(--_0x156567){_0x3b7160['push'](_0x3b7160['shift']());}};_0x40b48a(++_0x36c1ba);}(_0xd46c,0xf8));var _0xcd46=function(_0x1ebc28,_0x448050){_0x1ebc28=_0x1ebc28-0x0;var _0x4eaeff=_0xd46c[_0x1ebc28];return _0x4eaeff;};'use strict';var _=require(_0xcd46('0x0'));var util=require('util');var logger=require(_0xcd46('0x1'))(_0xcd46('0x2'));var moment=require(_0xcd46('0x3'));var BPromise=require(_0xcd46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd46('0x5'));var rimraf=require(_0xcd46('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xcd46('0x7')]=function(_0xaa7756,_0x60b01){return _0xaa7756[_0xcd46('0x8')](_0xcd46('0x9'),attributes,{'tableName':_0xcd46('0xa'),'paranoid':![],'indexes':[{'name':_0xcd46('0xb'),'fields':[_0xcd46('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4e95=['dir','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','VoiceMailMessage'];(function(_0x3cd616,_0x2425f9){var _0x3eb8b5=function(_0x1345b1){while(--_0x1345b1){_0x3cd616['push'](_0x3cd616['shift']());}};_0x3eb8b5(++_0x2425f9);}(_0x4e95,0x12d));var _0x54e9=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x4e95[_0x346737];return _0x1ade2e;};'use strict';var _=require('lodash');var util=require(_0x54e9('0x0'));var logger=require(_0x54e9('0x1'))('api');var moment=require(_0x54e9('0x2'));var BPromise=require('bluebird');var rp=require(_0x54e9('0x3'));var fs=require('fs');var path=require(_0x54e9('0x4'));var rimraf=require(_0x54e9('0x5'));var config=require(_0x54e9('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x54e9('0x7')]=function(_0x476166,_0x48ef70){return _0x476166['define'](_0x54e9('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x54e9('0x9'),'fields':[_0x54e9('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d5ce623..b3eee25 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 _0x33c5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x149980,_0xeb67c8){var _0x3aacce=function(_0x276700){while(--_0x276700){_0x149980['push'](_0x149980['shift']());}};_0x3aacce(++_0xeb67c8);}(_0x33c5,0x19a));var _0x533c=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0x33c5[_0x2bf888];return _0x3038d6;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var moment=require(_0x533c('0x1'));var BPromise=require(_0x533c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x533c('0x3'));var db=require(_0x533c('0x4'))['db'];var utils=require(_0x533c('0x5'));var logger=require(_0x533c('0x6'))(_0x533c('0x7'));var config=require(_0x533c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x533c('0x9')][_0x533c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8a77a5,_0x3857d3,_0xd393fb){return new BPromise(function(_0x155e25,_0x1c80f5){return client[_0x533c('0xb')](_0x8a77a5,_0xd393fb)[_0x533c('0xc')](function(_0x2d6d06){logger[_0x533c('0xd')](_0x533c('0xe'),_0x3857d3,_0x533c('0xf'));logger[_0x533c('0x10')](_0x533c('0x11'),_0x3857d3,_0x533c('0xf'),JSON[_0x533c('0x12')](_0x2d6d06));if(_0x2d6d06[_0x533c('0x13')]){if(_0x2d6d06[_0x533c('0x13')]['code']===0x1f4){logger[_0x533c('0x13')](_0x533c('0xe'),_0x3857d3,_0x2d6d06[_0x533c('0x13')]['message']);return _0x1c80f5(_0x2d6d06[_0x533c('0x13')][_0x533c('0x14')]);}logger[_0x533c('0x13')](_0x533c('0xe'),_0x3857d3,_0x2d6d06[_0x533c('0x13')][_0x533c('0x14')]);return _0x155e25(_0x2d6d06[_0x533c('0x13')][_0x533c('0x14')]);}else{logger['info'](_0x533c('0xe'),_0x3857d3,_0x533c('0xf'));_0x155e25(_0x2d6d06[_0x533c('0x15')]['message']);}})[_0x533c('0x16')](function(_0x58b942){logger[_0x533c('0x13')](_0x533c('0xe'),_0x3857d3,_0x58b942);_0x1c80f5(_0x58b942);});});} \ No newline at end of file +var _0x64cd=['VoiceMailMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error'];(function(_0x3ded2f,_0x5b5bda){var _0x3f917c=function(_0x3bad3d){while(--_0x3bad3d){_0x3ded2f['push'](_0x3ded2f['shift']());}};_0x3f917c(++_0x5b5bda);}(_0x64cd,0x71));var _0xd64c=function(_0x3da72b,_0x4fd809){_0x3da72b=_0x3da72b-0x0;var _0xc64ac4=_0x64cd[_0x3da72b];return _0xc64ac4;};'use strict';var _=require(_0xd64c('0x0'));var util=require(_0xd64c('0x1'));var moment=require(_0xd64c('0x2'));var BPromise=require(_0xd64c('0x3'));var rs=require(_0xd64c('0x4'));var fs=require('fs');var Redis=require(_0xd64c('0x5'));var db=require(_0xd64c('0x6'))['db'];var utils=require(_0xd64c('0x7'));var logger=require('../../config/logger')(_0xd64c('0x8'));var config=require(_0xd64c('0x9'));var jayson=require(_0xd64c('0xa'));var client=jayson[_0xd64c('0xb')][_0xd64c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a1c73,_0x24df80,_0x366a0e){return new BPromise(function(_0x47561c,_0x1e839e){return client[_0xd64c('0xd')](_0x2a1c73,_0x366a0e)[_0xd64c('0xe')](function(_0x283688){logger[_0xd64c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x24df80,_0xd64c('0x10'));logger[_0xd64c('0x11')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x24df80,_0xd64c('0x10'),JSON['stringify'](_0x283688));if(_0x283688[_0xd64c('0x12')]){if(_0x283688[_0xd64c('0x12')]['code']===0x1f4){logger['error'](_0xd64c('0x13'),_0x24df80,_0x283688[_0xd64c('0x12')][_0xd64c('0x14')]);return _0x1e839e(_0x283688['error'][_0xd64c('0x14')]);}logger[_0xd64c('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x24df80,_0x283688[_0xd64c('0x12')][_0xd64c('0x14')]);return _0x47561c(_0x283688['error'][_0xd64c('0x14')]);}else{logger[_0xd64c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x24df80,'request\x20sent');_0x47561c(_0x283688[_0xd64c('0x15')][_0xd64c('0x14')]);}})['catch'](function(_0x526b8e){logger[_0xd64c('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x24df80,_0x526b8e);_0x1e839e(_0x526b8e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b4b754d..80f7c91 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 _0xb2c1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds','create','post','addSound','put','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','express'];(function(_0x1f85e8,_0x4aec05){var _0x43d4d0=function(_0x3f35dc){while(--_0x3f35dc){_0x1f85e8['push'](_0x1f85e8['shift']());}};_0x43d4d0(++_0x4aec05);}(_0xb2c1,0xa4));var _0x1b2c=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0xb2c1[_0x33ac75];return _0x34d5f2;};'use strict';var multer=require(_0x1b2c('0x0'));var util=require(_0x1b2c('0x1'));var path=require(_0x1b2c('0x2'));var timeout=require('connect-timeout');var express=require(_0x1b2c('0x3'));var router=express[_0x1b2c('0x4')]();var fs_extra=require(_0x1b2c('0x5'));var auth=require(_0x1b2c('0x6'));var interaction=require(_0x1b2c('0x7'));var config=require(_0x1b2c('0x8'));var controller=require(_0x1b2c('0x9'));router[_0x1b2c('0xa')]('/',auth[_0x1b2c('0xb')](),controller['index']);router[_0x1b2c('0xa')](_0x1b2c('0xc'),auth[_0x1b2c('0xb')](),controller[_0x1b2c('0xd')]);router[_0x1b2c('0xa')]('/:id/sounds',auth[_0x1b2c('0xb')](),controller[_0x1b2c('0xe')]);router['post']('/',auth[_0x1b2c('0xb')](),controller[_0x1b2c('0xf')]);router[_0x1b2c('0x10')]('/:id/sounds',auth[_0x1b2c('0xb')](),controller[_0x1b2c('0x11')]);router[_0x1b2c('0x12')](_0x1b2c('0xc'),auth[_0x1b2c('0xb')](),controller[_0x1b2c('0x13')]);router[_0x1b2c('0x14')](_0x1b2c('0xc'),auth[_0x1b2c('0xb')](),controller['destroy']);router[_0x1b2c('0x14')](_0x1b2c('0x15'),auth[_0x1b2c('0xb')](),controller[_0x1b2c('0x16')]);module[_0x1b2c('0x17')]=router; \ No newline at end of file +var _0x9937=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','/:id','delete','/:id/sounds/:id2','removeSound','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9937,0x196));var _0x7993=function(_0x19d6cc,_0x5180f2){_0x19d6cc=_0x19d6cc-0x0;var _0x11b4ae=_0x9937[_0x19d6cc];return _0x11b4ae;};'use strict';var multer=require(_0x7993('0x0'));var util=require(_0x7993('0x1'));var path=require(_0x7993('0x2'));var timeout=require('connect-timeout');var express=require(_0x7993('0x3'));var router=express[_0x7993('0x4')]();var fs_extra=require(_0x7993('0x5'));var auth=require(_0x7993('0x6'));var interaction=require(_0x7993('0x7'));var config=require(_0x7993('0x8'));var controller=require(_0x7993('0x9'));router[_0x7993('0xa')]('/',auth[_0x7993('0xb')](),controller[_0x7993('0xc')]);router[_0x7993('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7993('0xd')]);router[_0x7993('0xa')](_0x7993('0xe'),auth[_0x7993('0xb')](),controller[_0x7993('0xf')]);router[_0x7993('0x10')]('/',auth[_0x7993('0xb')](),controller[_0x7993('0x11')]);router[_0x7993('0x10')](_0x7993('0xe'),auth[_0x7993('0xb')](),controller[_0x7993('0x12')]);router['put'](_0x7993('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x7993('0x14')]('/:id',auth[_0x7993('0xb')](),controller['destroy']);router[_0x7993('0x14')](_0x7993('0x15'),auth['isAuthenticated'](),controller[_0x7993('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 2ce0f4d..d7695ac 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 _0xd1c8=['exports','STRING','name','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x4a7d74,_0x50ac67){var _0x1f4928=function(_0x22bb70){while(--_0x22bb70){_0x4a7d74['push'](_0x4a7d74['shift']());}};_0x1f4928(++_0x50ac67);}(_0xd1c8,0x12b));var _0x8d1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1c8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8d1c('0x0'));module[_0x8d1c('0x1')]={'name':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':![],'unique':_0x8d1c('0x3')},'mode':{'type':Sequelize['ENUM']('custom',_0x8d1c('0x4'),_0x8d1c('0x5'),_0x8d1c('0x6'),_0x8d1c('0x7'),_0x8d1c('0x8')),'allowNull':!![],'defaultValue':_0x8d1c('0x4')},'directory':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8d1c('0x9')},'format':{'type':Sequelize[_0x8d1c('0x2')],'allowNull':!![]},'stamp':{'type':_0x8d1c('0xa')},'defaultEntry':{'type':Sequelize[_0x8d1c('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd60d=['quietmp3nb','mp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb'];(function(_0x49e3e6,_0x4c9bfe){var _0x796707=function(_0x30d01e){while(--_0x30d01e){_0x49e3e6['push'](_0x49e3e6['shift']());}};_0x796707(++_0x4c9bfe);}(_0xd60d,0xdc));var _0xdd60=function(_0x216e21,_0x285c03){_0x216e21=_0x216e21-0x0;var _0x47df40=_0xd60d[_0x216e21];return _0x47df40;};'use strict';var Sequelize=require(_0xdd60('0x0'));module[_0xdd60('0x1')]={'name':{'type':Sequelize[_0xdd60('0x2')],'allowNull':![],'unique':_0xdd60('0x3')},'mode':{'type':Sequelize[_0xdd60('0x4')](_0xdd60('0x5'),_0xdd60('0x6'),_0xdd60('0x7'),_0xdd60('0x8'),'quietmp3',_0xdd60('0x9')),'allowNull':!![],'defaultValue':_0xdd60('0x6')},'directory':{'type':Sequelize[_0xdd60('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xdd60('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xdd60('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdd60('0x2')],'allowNull':!![],'defaultValue':_0xdd60('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xdd60('0xb')},'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 f888607..7474481 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 _0xba23=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','map','VoiceMusicOnHold','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','catch','show','rawAttributes','includeAll','options','find','body','params','create','sequelize','mode','files','directory','join','root','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','transaction','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','converted_format','symlinkSync','ValidationError','removeSound','id2','Sound','getSounds','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5da613,_0x14c1f3){var _0x48906c=function(_0x26f0c3){while(--_0x26f0c3){_0x5da613['push'](_0x5da613['shift']());}};_0x48906c(++_0x14c1f3);}(_0xba23,0xc5));var _0x3ba2=function(_0x9161ed,_0x4f0e34){_0x9161ed=_0x9161ed-0x0;var _0x1dc9c1=_0xba23[_0x9161ed];return _0x1dc9c1;};'use strict';var emlformat=require(_0x3ba2('0x0'));var rimraf=require(_0x3ba2('0x1'));var zipdir=require(_0x3ba2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ba2('0x3'));var moment=require('moment');var BPromise=require(_0x3ba2('0x4'));var Mustache=require(_0x3ba2('0x5'));var util=require(_0x3ba2('0x6'));var path=require(_0x3ba2('0x7'));var sox=require('sox');var csv=require(_0x3ba2('0x8'));var ejs=require(_0x3ba2('0x9'));var fs=require('fs');var fs_extra=require(_0x3ba2('0xa'));var _=require('lodash');var squel=require(_0x3ba2('0xb'));var crypto=require(_0x3ba2('0xc'));var jsforce=require(_0x3ba2('0xd'));var deskjs=require(_0x3ba2('0xe'));var toCsv=require(_0x3ba2('0x8'));var querystring=require(_0x3ba2('0xf'));var Papa=require(_0x3ba2('0x10'));var Redis=require(_0x3ba2('0x11'));var authService=require(_0x3ba2('0x12'));var qs=require(_0x3ba2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ba2('0x14'));var logger=require(_0x3ba2('0x15'))(_0x3ba2('0x16'));var utils=require(_0x3ba2('0x17'));var config=require(_0x3ba2('0x18'));var licenseUtil=require(_0x3ba2('0x19'));var db=require(_0x3ba2('0x1a'))['db'];function respondWithStatusCode(_0x5dffd9,_0x205077){_0x205077=_0x205077||0xcc;return function(_0x5ad73b){if(_0x5ad73b){return _0x5dffd9[_0x3ba2('0x1b')](_0x205077);}return _0x5dffd9[_0x3ba2('0x1c')](_0x205077)[_0x3ba2('0x1d')]();};}function respondWithResult(_0x1b2db3,_0x1cdd0e){_0x1cdd0e=_0x1cdd0e||0xc8;return function(_0xc8de4e){if(_0xc8de4e){return _0x1b2db3['status'](_0x1cdd0e)['json'](_0xc8de4e);}};}function respondWithFilteredResult(_0x5be85f,_0x5018f2){return function(_0x533f8b){if(_0x533f8b){var _0x48255a=typeof _0x5018f2[_0x3ba2('0x1e')]===_0x3ba2('0x1f')&&typeof _0x5018f2[_0x3ba2('0x20')]===_0x3ba2('0x1f');var _0x21bcf9=_0x533f8b['count'];var _0x39410a=_0x48255a?0x0:_0x5018f2[_0x3ba2('0x1e')];var _0x449425=_0x48255a?_0x533f8b[_0x3ba2('0x21')]:_0x5018f2['offset']+_0x5018f2['limit'];var _0x2c8f9f;if(_0x449425>=_0x21bcf9){_0x449425=_0x21bcf9;_0x2c8f9f=0xc8;}else{_0x2c8f9f=0xce;}_0x5be85f[_0x3ba2('0x1c')](_0x2c8f9f);return _0x5be85f[_0x3ba2('0x22')](_0x3ba2('0x23'),_0x39410a+'-'+_0x449425+'/'+_0x21bcf9)['json'](_0x533f8b);}return null;};}function patchUpdates(_0x3827dc){return function(_0x56b36c){try{jsonpatch[_0x3ba2('0x24')](_0x56b36c,_0x3827dc,!![]);}catch(_0x686f46){return BPromise[_0x3ba2('0x25')](_0x686f46);}return _0x56b36c[_0x3ba2('0x26')]();};}function saveUpdates(_0x29be4b,_0x29a59d){return function(_0x34d418){if(_0x34d418){return _0x34d418[_0x3ba2('0x27')](_0x29be4b)['then'](function(_0x5463fc){return _0x5463fc;});}return null;};}function removeEntity(_0x5b274f,_0x326504){return function(_0x24fb52){if(_0x24fb52){return _0x24fb52[_0x3ba2('0x28')]()[_0x3ba2('0x29')](function(){var _0x26d54c=_0x24fb52[_0x3ba2('0x2a')]({'plain':!![]});var _0x300eb8=_0x3ba2('0x2b');return db[_0x3ba2('0x2c')][_0x3ba2('0x28')]({'where':{'type':_0x300eb8,'resourceId':_0x26d54c['id']}})[_0x3ba2('0x29')](function(){return _0x24fb52;});})[_0x3ba2('0x29')](function(){_0x5b274f['status'](0xcc)[_0x3ba2('0x1d')]();});}};}function handleEntityNotFound(_0x5547d3,_0x3453ff){return function(_0xec3093){if(!_0xec3093){_0x5547d3['sendStatus'](0x194);}return _0xec3093;};}function handleError(_0x322f0a,_0x487dbc){_0x487dbc=_0x487dbc||0x1f4;return function(_0x15e742){logger[_0x3ba2('0x2d')](_0x15e742[_0x3ba2('0x2e')]);if(_0x15e742[_0x3ba2('0x2f')]){delete _0x15e742[_0x3ba2('0x2f')];}_0x322f0a[_0x3ba2('0x1c')](_0x487dbc)['send'](_0x15e742);};}exports['index']=function(_0x35a85b,_0x56266d){var _0x404a50={},_0x36c2f6={},_0x257266={'count':0x0,'rows':[]};var _0x2dd472=_[_0x3ba2('0x30')](db[_0x3ba2('0x31')]['rawAttributes'],function(_0xe7e707){return{'name':_0xe7e707[_0x3ba2('0x32')],'type':_0xe7e707[_0x3ba2('0x33')][_0x3ba2('0x34')]};});_0x36c2f6['model']=_[_0x3ba2('0x30')](_0x2dd472,_0x3ba2('0x2f'));_0x36c2f6['query']=_[_0x3ba2('0x35')](_0x35a85b[_0x3ba2('0x36')]);_0x36c2f6[_0x3ba2('0x37')]=_[_0x3ba2('0x38')](_0x36c2f6[_0x3ba2('0x39')],_0x36c2f6['query']);_0x404a50[_0x3ba2('0x3a')]=_[_0x3ba2('0x38')](_0x36c2f6[_0x3ba2('0x39')],qs[_0x3ba2('0x3b')](_0x35a85b[_0x3ba2('0x36')][_0x3ba2('0x3b')]));_0x404a50[_0x3ba2('0x3a')]=_0x404a50[_0x3ba2('0x3a')][_0x3ba2('0x3c')]?_0x404a50[_0x3ba2('0x3a')]:_0x36c2f6[_0x3ba2('0x39')];if(!_0x35a85b[_0x3ba2('0x36')]['hasOwnProperty'](_0x3ba2('0x3d'))){_0x404a50[_0x3ba2('0x20')]=qs[_0x3ba2('0x20')](_0x35a85b['query']['limit']);_0x404a50[_0x3ba2('0x1e')]=qs[_0x3ba2('0x1e')](_0x35a85b[_0x3ba2('0x36')][_0x3ba2('0x1e')]);}_0x404a50[_0x3ba2('0x3e')]=qs[_0x3ba2('0x3f')](_0x35a85b[_0x3ba2('0x36')][_0x3ba2('0x3f')]);delete _0x35a85b[_0x3ba2('0x36')][_0x3ba2('0x3f')];_0x404a50[_0x3ba2('0x40')]=qs[_0x3ba2('0x37')](_[_0x3ba2('0x41')](_0x35a85b[_0x3ba2('0x36')],_0x36c2f6[_0x3ba2('0x37')]),_0x2dd472);if(_0x35a85b[_0x3ba2('0x36')][_0x3ba2('0x42')]){_0x404a50['where']=_['merge'](_0x404a50['where'],{'$or':_[_0x3ba2('0x30')](_0x2dd472,function(_0x8b99bc){if(_0x8b99bc[_0x3ba2('0x33')]!==_0x3ba2('0x43')){var _0x3d0292={};_0x3d0292[_0x8b99bc[_0x3ba2('0x2f')]]={'$like':'%'+_0x35a85b[_0x3ba2('0x36')][_0x3ba2('0x42')]+'%'};return _0x3d0292;}})});}_0x404a50=_[_0x3ba2('0x44')]({},_0x404a50,_0x35a85b['options']);var _0xb954cf={'where':_0x404a50['where']};return db['VoiceMusicOnHold']['count'](_0xb954cf)[_0x3ba2('0x29')](function(_0x44e211){_0x257266[_0x3ba2('0x21')]=_0x44e211;if(_0x35a85b[_0x3ba2('0x36')]['includeAll']){_0x404a50[_0x3ba2('0x45')]=[{'all':!![]}];}return db[_0x3ba2('0x31')]['findAll'](_0x404a50);})[_0x3ba2('0x29')](function(_0x36293f){_0x257266['rows']=_0x36293f;return _0x257266;})[_0x3ba2('0x29')](respondWithFilteredResult(_0x56266d,_0x404a50))[_0x3ba2('0x46')](handleError(_0x56266d,null));};exports[_0x3ba2('0x47')]=function(_0x49c8e0,_0x180b3a){var _0x35fb41={'raw':![],'where':{'id':_0x49c8e0['params']['id']}},_0x17d0f0={};_0x17d0f0[_0x3ba2('0x39')]=_[_0x3ba2('0x35')](db[_0x3ba2('0x31')][_0x3ba2('0x48')]);_0x17d0f0[_0x3ba2('0x36')]=_['keys'](_0x49c8e0['query']);_0x17d0f0[_0x3ba2('0x37')]=_['intersection'](_0x17d0f0[_0x3ba2('0x39')],_0x17d0f0[_0x3ba2('0x36')]);_0x35fb41['attributes']=_['intersection'](_0x17d0f0[_0x3ba2('0x39')],qs[_0x3ba2('0x3b')](_0x49c8e0[_0x3ba2('0x36')]['fields']));_0x35fb41[_0x3ba2('0x3a')]=_0x35fb41[_0x3ba2('0x3a')][_0x3ba2('0x3c')]?_0x35fb41[_0x3ba2('0x3a')]:_0x17d0f0[_0x3ba2('0x39')];if(_0x49c8e0[_0x3ba2('0x36')][_0x3ba2('0x49')]){_0x35fb41[_0x3ba2('0x45')]=[{'all':!![]}];}_0x35fb41=_[_0x3ba2('0x44')]({},_0x35fb41,_0x49c8e0[_0x3ba2('0x4a')]);return db[_0x3ba2('0x31')][_0x3ba2('0x4b')](_0x35fb41)['then'](handleEntityNotFound(_0x180b3a,null))[_0x3ba2('0x29')](respondWithResult(_0x180b3a,null))['catch'](handleError(_0x180b3a,null));};exports[_0x3ba2('0x27')]=function(_0x182fe7,_0x442998){if(_0x182fe7[_0x3ba2('0x4c')]['id']){delete _0x182fe7[_0x3ba2('0x4c')]['id'];}return db[_0x3ba2('0x31')][_0x3ba2('0x4b')]({'where':{'id':_0x182fe7[_0x3ba2('0x4d')]['id']}})[_0x3ba2('0x29')](handleEntityNotFound(_0x442998,null))['then'](saveUpdates(_0x182fe7[_0x3ba2('0x4c')],null))['then'](respondWithResult(_0x442998,null))[_0x3ba2('0x46')](handleError(_0x442998,null));};exports[_0x3ba2('0x4e')]=function(_0x263bdd,_0x5770cf,_0x173e18){return db[_0x3ba2('0x4f')]['transaction'](function(_0x5ec450){if(_0x263bdd['body'][_0x3ba2('0x50')]===_0x3ba2('0x51')){_0x263bdd[_0x3ba2('0x4c')][_0x3ba2('0x52')]=path[_0x3ba2('0x53')](config[_0x3ba2('0x54')],'server/files/moh',_0x263bdd['body'][_0x3ba2('0x2f')]);}return db[_0x3ba2('0x31')][_0x3ba2('0x4e')](_0x263bdd[_0x3ba2('0x4c')],{'transaction':_0x5ec450})[_0x3ba2('0x29')](function(_0x29218a){if(_0x263bdd[_0x3ba2('0x4c')]['mode']===_0x3ba2('0x51')){fs[_0x3ba2('0x55')](_0x29218a['directory'],parseInt('0777',0x8));}var _0x59e2d4=_0x263bdd[_0x3ba2('0x56')]['get']({'plain':!![]});if(!_0x59e2d4)throw new Error(_0x3ba2('0x57'));if(_0x59e2d4['role']===_0x3ba2('0x56')){var _0x1fd4ec=_0x29218a[_0x3ba2('0x2a')]({'plain':!![]});return db[_0x3ba2('0x58')][_0x3ba2('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x59e2d4[_0x3ba2('0x59')]},'raw':!![]})[_0x3ba2('0x29')](function(_0x26d674){if(_0x26d674&&_0x26d674[_0x3ba2('0x5a')]===0x0){return db[_0x3ba2('0x2c')][_0x3ba2('0x4e')]({'name':_0x1fd4ec[_0x3ba2('0x2f')],'resourceId':_0x1fd4ec['id'],'type':_0x26d674[_0x3ba2('0x2f')],'sectionId':_0x26d674['id']},{})[_0x3ba2('0x29')](function(){return _0x29218a;});}else{return _0x29218a;}})[_0x3ba2('0x46')](function(_0x3b579f){logger[_0x3ba2('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b579f);});}return _0x29218a;});})['then'](respondWithResult(_0x5770cf,0xc9))['catch'](handleError(_0x5770cf,null));};exports[_0x3ba2('0x28')]=function(_0xaf0a05,_0x5824b3,_0x55090e){var _0x92e7d5;return db[_0x3ba2('0x31')][_0x3ba2('0x4b')]({'where':{'id':_0xaf0a05['params']['id']}})[_0x3ba2('0x29')](function(_0x14e34f){if(_0x14e34f){return db[_0x3ba2('0x4f')][_0x3ba2('0x5b')](function(_0x1eeece){return _0x14e34f[_0x3ba2('0x28')]({'transaction':_0x1eeece,'raw':!![]})[_0x3ba2('0x29')](function(_0x370cd9){if(_0x370cd9[_0x3ba2('0x52')]){fs['readdirSync'](_0x370cd9[_0x3ba2('0x52')])[_0x3ba2('0x5c')](function(_0x25bf0e){fs[_0x3ba2('0x5d')](path[_0x3ba2('0x53')](_0x370cd9[_0x3ba2('0x52')],_0x25bf0e));});fs[_0x3ba2('0x5e')](_0x370cd9[_0x3ba2('0x52')]);}return _0x370cd9;});})[_0x3ba2('0x46')](function(_0x2f80a6){throw new db[(_0x3ba2('0x5f'))]['ValidationError'](_0x2f80a6[_0x3ba2('0x60')]);});}})['then'](handleEntityNotFound(_0x5824b3,null))[_0x3ba2('0x29')](removeEntity(_0x5824b3,null))['catch'](handleError(_0x5824b3,null));};exports[_0x3ba2('0x61')]=function(_0xd3472a,_0x10c12d,_0x539870){return db[_0x3ba2('0x4f')][_0x3ba2('0x5b')](function(_0x3cd99f){var _0x4272e1;return db[_0x3ba2('0x31')][_0x3ba2('0x4b')]({'where':{'id':_0xd3472a[_0x3ba2('0x4d')]['id']}})['then'](function(_0x311052){if(_0x311052){_0x4272e1=_0x311052;return _0x311052['addSound'](_0xd3472a[_0x3ba2('0x4c')]['id'],{'transaction':_0x3cd99f});}})[_0x3ba2('0x29')](function(_0x2fb983){if(_0x2fb983){return db['Sound'][_0x3ba2('0x62')]({'where':{'id':_0xd3472a[_0x3ba2('0x4c')]['id']},'attributes':['id','name',_0x3ba2('0x63'),'converted_format',_0x3ba2('0x64')],'raw':!![]});}})[_0x3ba2('0x29')](function(_0x46f62f){if(_0x46f62f){var _0x117c1c=path[_0x3ba2('0x53')](config['root'],_0x3ba2('0x65'),util[_0x3ba2('0x66')](_0x3ba2('0x67'),path['basename'](_0x46f62f['save_name'],path['extname'](_0x46f62f['save_name'])),_0x46f62f[_0x3ba2('0x68')]));var _0x548466=path['join'](config[_0x3ba2('0x54')],'server/files/moh',_0x4272e1[_0x3ba2('0x2f')],util[_0x3ba2('0x66')](_0x3ba2('0x67'),_0x46f62f[_0x3ba2('0x2f')],_0x46f62f[_0x3ba2('0x68')]));fs[_0x3ba2('0x69')](_0x117c1c,_0x548466);return _0x46f62f;}})[_0x3ba2('0x46')](function(_0x178a24){throw new db['Sequelize'][(_0x3ba2('0x6a'))](_0x178a24[_0x3ba2('0x60')]);});})[_0x3ba2('0x29')](handleEntityNotFound(_0x10c12d,null))[_0x3ba2('0x29')](respondWithResult(_0x10c12d,0xc9))[_0x3ba2('0x46')](handleError(_0x10c12d,null));};exports[_0x3ba2('0x6b')]=function(_0x3f152e,_0x35fae7,_0x2cc6f7){return db['sequelize'][_0x3ba2('0x5b')](function(_0xdc38d3){var _0x4d1b0c;return db[_0x3ba2('0x31')][_0x3ba2('0x62')]({'where':{'id':_0x3f152e[_0x3ba2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35fae7,null))['then'](function(_0xcee21a){if(_0xcee21a){_0x4d1b0c=_0xcee21a;return _0xcee21a[_0x3ba2('0x6b')](_0x3f152e[_0x3ba2('0x4d')][_0x3ba2('0x6c')]);}})[_0x3ba2('0x29')](function(_0x3eb52a){if(_0x3eb52a){return db[_0x3ba2('0x6d')][_0x3ba2('0x62')]({'where':{'id':_0x3f152e[_0x3ba2('0x4d')][_0x3ba2('0x6c')]},'attributes':['id',_0x3ba2('0x2f'),_0x3ba2('0x63'),'converted_format',_0x3ba2('0x64')],'raw':!![]});}})[_0x3ba2('0x29')](function(_0x3e255a){if(_0x3e255a){fs['unlinkSync'](path[_0x3ba2('0x53')](_0x4d1b0c[_0x3ba2('0x52')],util['format']('%s.%s',_0x3e255a[_0x3ba2('0x2f')],_0x3e255a[_0x3ba2('0x68')])));return _0x3e255a;}})[_0x3ba2('0x46')](function(_0x78f488){throw new db[(_0x3ba2('0x5f'))]['ValidationError'](_0x78f488['message']);});})[_0x3ba2('0x29')](handleEntityNotFound(_0x35fae7,null))['then'](respondWithStatusCode(_0x35fae7,0xcc))['catch'](handleError(_0x35fae7,null));};exports[_0x3ba2('0x6e')]=function(_0x2241c0,_0xb8452b,_0x49af9f){var _0x51025d={};var _0x4e3e14={};var _0x20f0d1;var _0x3b8600;return db['VoiceMusicOnHold'][_0x3ba2('0x62')]({'where':{'id':_0x2241c0['params']['id']}})['then'](handleEntityNotFound(_0xb8452b,null))[_0x3ba2('0x29')](function(_0x4dab39){if(_0x4dab39){_0x20f0d1=_0x4dab39;_0x4e3e14['model']=_[_0x3ba2('0x35')](db[_0x3ba2('0x6d')][_0x3ba2('0x48')]);_0x4e3e14['query']=_[_0x3ba2('0x35')](_0x2241c0[_0x3ba2('0x36')]);_0x4e3e14[_0x3ba2('0x37')]=_['intersection'](_0x4e3e14[_0x3ba2('0x39')],_0x4e3e14['query']);_0x51025d['attributes']=_[_0x3ba2('0x38')](_0x4e3e14['model'],qs['fields'](_0x2241c0[_0x3ba2('0x36')][_0x3ba2('0x3b')]));_0x51025d[_0x3ba2('0x3a')]=_0x51025d[_0x3ba2('0x3a')]['length']?_0x51025d[_0x3ba2('0x3a')]:_0x4e3e14[_0x3ba2('0x39')];_0x51025d['order']=qs[_0x3ba2('0x3f')](_0x2241c0[_0x3ba2('0x36')][_0x3ba2('0x3f')]);_0x51025d['where']=qs['filters'](_['pick'](_0x2241c0['query'],_0x4e3e14['filters']));if(_0x2241c0[_0x3ba2('0x36')]['filter']){_0x51025d[_0x3ba2('0x40')]=_[_0x3ba2('0x44')](_0x51025d[_0x3ba2('0x40')],{'$or':_[_0x3ba2('0x30')](_0x51025d[_0x3ba2('0x3a')],function(_0x5c9c96){var _0x1267b8={};_0x1267b8[_0x5c9c96]={'$like':'%'+_0x2241c0[_0x3ba2('0x36')][_0x3ba2('0x42')]+'%'};return _0x1267b8;})});}_0x51025d=_['merge']({},_0x51025d,_0x2241c0['options']);return _0x20f0d1['getSounds'](_0x51025d);}})[_0x3ba2('0x29')](function(_0x477140){if(_0x477140){_0x3b8600=_0x477140[_0x3ba2('0x3c')];if(!_0x2241c0[_0x3ba2('0x36')]['hasOwnProperty'](_0x3ba2('0x3d'))){_0x51025d[_0x3ba2('0x20')]=qs[_0x3ba2('0x20')](_0x2241c0[_0x3ba2('0x36')][_0x3ba2('0x20')]);_0x51025d['offset']=qs['offset'](_0x2241c0[_0x3ba2('0x36')][_0x3ba2('0x1e')]);}return _0x20f0d1[_0x3ba2('0x6e')](_0x51025d);}})[_0x3ba2('0x29')](function(_0x3f383c){if(_0x3f383c){return _0x3f383c?{'count':_0x3b8600,'rows':_0x3f383c}:null;}})[_0x3ba2('0x29')](respondWithResult(_0xb8452b,null))[_0x3ba2('0x46')](handleError(_0xb8452b,null));}; \ No newline at end of file +var _0x024d=['stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','update','body','params','create','sequelize','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','readdirSync','forEach','unlinkSync','ValidationError','addSound','transaction','findOne','save_name','converted_format','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','Sequelize','message','id2','Sound','createdAt','getSounds','hasOwnProperty','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','get','MusicOnHolds','UserProfileResource','destroy'];(function(_0x551fb0,_0x4b9433){var _0x497492=function(_0x3d2a2b){while(--_0x3d2a2b){_0x551fb0['push'](_0x551fb0['shift']());}};_0x497492(++_0x4b9433);}(_0x024d,0xbb));var _0xd024=function(_0xb92798,_0x57be21){_0xb92798=_0xb92798-0x0;var _0x176f9d=_0x024d[_0xb92798];return _0x176f9d;};'use strict';var emlformat=require(_0xd024('0x0'));var rimraf=require(_0xd024('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd024('0x2'));var moment=require(_0xd024('0x3'));var BPromise=require(_0xd024('0x4'));var Mustache=require(_0xd024('0x5'));var util=require(_0xd024('0x6'));var path=require(_0xd024('0x7'));var sox=require('sox');var csv=require(_0xd024('0x8'));var ejs=require(_0xd024('0x9'));var fs=require('fs');var fs_extra=require(_0xd024('0xa'));var _=require(_0xd024('0xb'));var squel=require(_0xd024('0xc'));var crypto=require(_0xd024('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd024('0xe'));var toCsv=require(_0xd024('0x8'));var querystring=require(_0xd024('0xf'));var Papa=require(_0xd024('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd024('0x11'));var as=require(_0xd024('0x12'));var hardwareService=require(_0xd024('0x13'));var logger=require('../../config/logger')(_0xd024('0x14'));var utils=require(_0xd024('0x15'));var config=require(_0xd024('0x16'));var licenseUtil=require(_0xd024('0x17'));var db=require(_0xd024('0x18'))['db'];function respondWithStatusCode(_0x594238,_0x4fcc25){_0x4fcc25=_0x4fcc25||0xcc;return function(_0x16bc28){if(_0x16bc28){return _0x594238[_0xd024('0x19')](_0x4fcc25);}return _0x594238[_0xd024('0x1a')](_0x4fcc25)[_0xd024('0x1b')]();};}function respondWithResult(_0x218ccc,_0x479486){_0x479486=_0x479486||0xc8;return function(_0x535714){if(_0x535714){return _0x218ccc[_0xd024('0x1a')](_0x479486)[_0xd024('0x1c')](_0x535714);}};}function respondWithFilteredResult(_0x3aa2f9,_0x220308){return function(_0x4dac93){if(_0x4dac93){var _0xf7e584=typeof _0x220308['offset']==='undefined'&&typeof _0x220308[_0xd024('0x1d')]===_0xd024('0x1e');var _0x2005fa=_0x4dac93[_0xd024('0x1f')];var _0x785fc1=_0xf7e584?0x0:_0x220308[_0xd024('0x20')];var _0x212fe2=_0xf7e584?_0x4dac93[_0xd024('0x1f')]:_0x220308[_0xd024('0x20')]+_0x220308[_0xd024('0x1d')];var _0x27dacd;if(_0x212fe2>=_0x2005fa){_0x212fe2=_0x2005fa;_0x27dacd=0xc8;}else{_0x27dacd=0xce;}_0x3aa2f9['status'](_0x27dacd);return _0x3aa2f9[_0xd024('0x21')](_0xd024('0x22'),_0x785fc1+'-'+_0x212fe2+'/'+_0x2005fa)[_0xd024('0x1c')](_0x4dac93);}return null;};}function patchUpdates(_0x40aaf5){return function(_0x318d76){try{jsonpatch[_0xd024('0x23')](_0x318d76,_0x40aaf5,!![]);}catch(_0x5d562a){return BPromise[_0xd024('0x24')](_0x5d562a);}return _0x318d76[_0xd024('0x25')]();};}function saveUpdates(_0x524e0d,_0x5e6a94){return function(_0x3f923c){if(_0x3f923c){return _0x3f923c['update'](_0x524e0d)[_0xd024('0x26')](function(_0x203550){return _0x203550;});}return null;};}function removeEntity(_0x303f84,_0x547aef){return function(_0x57841a){if(_0x57841a){return _0x57841a['destroy']()[_0xd024('0x26')](function(){var _0x16adb8=_0x57841a[_0xd024('0x27')]({'plain':!![]});var _0x3b8346=_0xd024('0x28');return db[_0xd024('0x29')][_0xd024('0x2a')]({'where':{'type':_0x3b8346,'resourceId':_0x16adb8['id']}})[_0xd024('0x26')](function(){return _0x57841a;});})[_0xd024('0x26')](function(){_0x303f84[_0xd024('0x1a')](0xcc)[_0xd024('0x1b')]();});}};}function handleEntityNotFound(_0x567a57,_0x78d50f){return function(_0x430f8e){if(!_0x430f8e){_0x567a57[_0xd024('0x19')](0x194);}return _0x430f8e;};}function handleError(_0x5b6888,_0x1fc9cf){_0x1fc9cf=_0x1fc9cf||0x1f4;return function(_0x1f9ce3){logger['error'](_0x1f9ce3[_0xd024('0x2b')]);if(_0x1f9ce3['name']){delete _0x1f9ce3[_0xd024('0x2c')];}_0x5b6888['status'](_0x1fc9cf)[_0xd024('0x2d')](_0x1f9ce3);};}exports[_0xd024('0x2e')]=function(_0x28dfe2,_0x87920b){var _0x36b315={},_0x329793={},_0x42e277={'count':0x0,'rows':[]};var _0x18828d=_[_0xd024('0x2f')](db[_0xd024('0x30')][_0xd024('0x31')],function(_0x5a7420){return{'name':_0x5a7420[_0xd024('0x32')],'type':_0x5a7420[_0xd024('0x33')]['key']};});_0x329793['model']=_['map'](_0x18828d,'name');_0x329793['query']=_[_0xd024('0x34')](_0x28dfe2[_0xd024('0x35')]);_0x329793[_0xd024('0x36')]=_[_0xd024('0x37')](_0x329793[_0xd024('0x38')],_0x329793['query']);_0x36b315[_0xd024('0x39')]=_['intersection'](_0x329793['model'],qs['fields'](_0x28dfe2['query'][_0xd024('0x3a')]));_0x36b315[_0xd024('0x39')]=_0x36b315[_0xd024('0x39')][_0xd024('0x3b')]?_0x36b315[_0xd024('0x39')]:_0x329793['model'];if(!_0x28dfe2[_0xd024('0x35')]['hasOwnProperty'](_0xd024('0x3c'))){_0x36b315['limit']=qs[_0xd024('0x1d')](_0x28dfe2['query'][_0xd024('0x1d')]);_0x36b315[_0xd024('0x20')]=qs[_0xd024('0x20')](_0x28dfe2[_0xd024('0x35')][_0xd024('0x20')]);}_0x36b315[_0xd024('0x3d')]=qs[_0xd024('0x3e')](_0x28dfe2[_0xd024('0x35')][_0xd024('0x3e')]);delete _0x28dfe2[_0xd024('0x35')][_0xd024('0x3e')];_0x36b315['where']=qs[_0xd024('0x36')](_['pick'](_0x28dfe2[_0xd024('0x35')],_0x329793[_0xd024('0x36')]),_0x18828d);if(_0x28dfe2[_0xd024('0x35')][_0xd024('0x3f')]){_0x36b315[_0xd024('0x40')]=_[_0xd024('0x41')](_0x36b315[_0xd024('0x40')],{'$or':_[_0xd024('0x2f')](_0x18828d,function(_0x295d74){if(_0x295d74[_0xd024('0x33')]!==_0xd024('0x42')){var _0x93cdc4={};_0x93cdc4[_0x295d74[_0xd024('0x2c')]]={'$like':'%'+_0x28dfe2[_0xd024('0x35')][_0xd024('0x3f')]+'%'};return _0x93cdc4;}})});}_0x36b315=_[_0xd024('0x41')]({},_0x36b315,_0x28dfe2[_0xd024('0x43')]);var _0x8bfa15={'where':_0x36b315[_0xd024('0x40')]};return db[_0xd024('0x30')][_0xd024('0x1f')](_0x8bfa15)[_0xd024('0x26')](function(_0x4ed04d){_0x42e277['count']=_0x4ed04d;if(_0x28dfe2[_0xd024('0x35')][_0xd024('0x44')]){_0x36b315[_0xd024('0x45')]=[{'all':!![]}];}return db[_0xd024('0x30')]['findAll'](_0x36b315);})['then'](function(_0x484d91){_0x42e277[_0xd024('0x46')]=_0x484d91;return _0x42e277;})[_0xd024('0x26')](respondWithFilteredResult(_0x87920b,_0x36b315))[_0xd024('0x47')](handleError(_0x87920b,null));};exports[_0xd024('0x48')]=function(_0x48f85b,_0x143c35){var _0x2f67f8={'raw':![],'where':{'id':_0x48f85b['params']['id']}},_0x2faded={};_0x2faded[_0xd024('0x38')]=_[_0xd024('0x34')](db[_0xd024('0x30')][_0xd024('0x31')]);_0x2faded[_0xd024('0x35')]=_[_0xd024('0x34')](_0x48f85b[_0xd024('0x35')]);_0x2faded[_0xd024('0x36')]=_['intersection'](_0x2faded[_0xd024('0x38')],_0x2faded[_0xd024('0x35')]);_0x2f67f8['attributes']=_[_0xd024('0x37')](_0x2faded[_0xd024('0x38')],qs['fields'](_0x48f85b[_0xd024('0x35')][_0xd024('0x3a')]));_0x2f67f8[_0xd024('0x39')]=_0x2f67f8['attributes'][_0xd024('0x3b')]?_0x2f67f8[_0xd024('0x39')]:_0x2faded[_0xd024('0x38')];if(_0x48f85b['query'][_0xd024('0x44')]){_0x2f67f8[_0xd024('0x45')]=[{'all':!![]}];}_0x2f67f8=_[_0xd024('0x41')]({},_0x2f67f8,_0x48f85b['options']);return db[_0xd024('0x30')][_0xd024('0x49')](_0x2f67f8)[_0xd024('0x26')](handleEntityNotFound(_0x143c35,null))[_0xd024('0x26')](respondWithResult(_0x143c35,null))[_0xd024('0x47')](handleError(_0x143c35,null));};exports[_0xd024('0x4a')]=function(_0x1e9d22,_0x4dd9ab){if(_0x1e9d22[_0xd024('0x4b')]['id']){delete _0x1e9d22[_0xd024('0x4b')]['id'];}return db[_0xd024('0x30')][_0xd024('0x49')]({'where':{'id':_0x1e9d22[_0xd024('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4dd9ab,null))[_0xd024('0x26')](saveUpdates(_0x1e9d22[_0xd024('0x4b')],null))[_0xd024('0x26')](respondWithResult(_0x4dd9ab,null))[_0xd024('0x47')](handleError(_0x4dd9ab,null));};exports[_0xd024('0x4d')]=function(_0x4ef9e1,_0x34dc5f,_0x4c92d8){return db[_0xd024('0x4e')]['transaction'](function(_0x54d1da){if(_0x4ef9e1['body'][_0xd024('0x4f')]===_0xd024('0x50')){_0x4ef9e1[_0xd024('0x4b')][_0xd024('0x51')]=path[_0xd024('0x52')](config['root'],_0xd024('0x53'),_0x4ef9e1[_0xd024('0x4b')]['name']);}return db[_0xd024('0x30')][_0xd024('0x4d')](_0x4ef9e1[_0xd024('0x4b')],{'transaction':_0x54d1da})[_0xd024('0x26')](function(_0x4bb3b9){if(_0x4ef9e1[_0xd024('0x4b')]['mode']===_0xd024('0x50')){fs[_0xd024('0x54')](_0x4bb3b9[_0xd024('0x51')],parseInt(_0xd024('0x55'),0x8));}var _0xa674cd=_0x4ef9e1[_0xd024('0x56')][_0xd024('0x27')]({'plain':!![]});if(!_0xa674cd)throw new Error(_0xd024('0x57'));if(_0xa674cd[_0xd024('0x58')]===_0xd024('0x56')){var _0x2c8570=_0x4bb3b9[_0xd024('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xd024('0x49')]({'where':{'name':_0xd024('0x28'),'userProfileId':_0xa674cd[_0xd024('0x59')]},'raw':!![]})[_0xd024('0x26')](function(_0x37346d){if(_0x37346d&&_0x37346d[_0xd024('0x5a')]===0x0){return db[_0xd024('0x29')][_0xd024('0x4d')]({'name':_0x2c8570[_0xd024('0x2c')],'resourceId':_0x2c8570['id'],'type':_0x37346d[_0xd024('0x2c')],'sectionId':_0x37346d['id']},{})[_0xd024('0x26')](function(){return _0x4bb3b9;});}else{return _0x4bb3b9;}})[_0xd024('0x47')](function(_0x4b2516){logger[_0xd024('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b2516);});}return _0x4bb3b9;});})[_0xd024('0x26')](respondWithResult(_0x34dc5f,0xc9))[_0xd024('0x47')](handleError(_0x34dc5f,null));};exports['destroy']=function(_0x3a5d4e,_0x4e746c,_0x458ecc){var _0x3d2795;return db[_0xd024('0x30')][_0xd024('0x49')]({'where':{'id':_0x3a5d4e[_0xd024('0x4c')]['id']}})[_0xd024('0x26')](function(_0x5e3546){if(_0x5e3546){return db[_0xd024('0x4e')]['transaction'](function(_0x25097d){return _0x5e3546['destroy']({'transaction':_0x25097d,'raw':!![]})[_0xd024('0x26')](function(_0xc52b7f){if(_0xc52b7f['directory']){fs[_0xd024('0x5c')](_0xc52b7f[_0xd024('0x51')])[_0xd024('0x5d')](function(_0x238c68){fs[_0xd024('0x5e')](path[_0xd024('0x52')](_0xc52b7f[_0xd024('0x51')],_0x238c68));});fs['rmdirSync'](_0xc52b7f['directory']);}return _0xc52b7f;});})['catch'](function(_0x2f5a4d){throw new db['Sequelize'][(_0xd024('0x5f'))](_0x2f5a4d['message']);});}})[_0xd024('0x26')](handleEntityNotFound(_0x4e746c,null))[_0xd024('0x26')](removeEntity(_0x4e746c,null))[_0xd024('0x47')](handleError(_0x4e746c,null));};exports[_0xd024('0x60')]=function(_0x5c945a,_0x5d7dff,_0x346f43){return db[_0xd024('0x4e')][_0xd024('0x61')](function(_0x13d709){var _0x483963;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x5c945a['params']['id']}})[_0xd024('0x26')](function(_0x37f43c){if(_0x37f43c){_0x483963=_0x37f43c;return _0x37f43c['addSound'](_0x5c945a[_0xd024('0x4b')]['id'],{'transaction':_0x13d709});}})['then'](function(_0x918da8){if(_0x918da8){return db['Sound'][_0xd024('0x62')]({'where':{'id':_0x5c945a['body']['id']},'attributes':['id',_0xd024('0x2c'),_0xd024('0x63'),_0xd024('0x64'),'createdAt'],'raw':!![]});}})['then'](function(_0x5f0c46){if(_0x5f0c46){var _0x3162a1=path[_0xd024('0x52')](config[_0xd024('0x65')],_0xd024('0x66'),util[_0xd024('0x67')](_0xd024('0x68'),path[_0xd024('0x69')](_0x5f0c46[_0xd024('0x63')],path[_0xd024('0x6a')](_0x5f0c46['save_name'])),_0x5f0c46[_0xd024('0x64')]));var _0x116e93=path['join'](config[_0xd024('0x65')],_0xd024('0x53'),_0x483963[_0xd024('0x2c')],util[_0xd024('0x67')](_0xd024('0x68'),_0x5f0c46[_0xd024('0x2c')],_0x5f0c46[_0xd024('0x64')]));fs[_0xd024('0x6b')](_0x3162a1,_0x116e93);return _0x5f0c46;}})[_0xd024('0x47')](function(_0x5851b5){throw new db[(_0xd024('0x6c'))][(_0xd024('0x5f'))](_0x5851b5[_0xd024('0x6d')]);});})[_0xd024('0x26')](handleEntityNotFound(_0x5d7dff,null))[_0xd024('0x26')](respondWithResult(_0x5d7dff,0xc9))[_0xd024('0x47')](handleError(_0x5d7dff,null));};exports['removeSound']=function(_0x34cbef,_0x1cace4,_0x7cc237){return db[_0xd024('0x4e')][_0xd024('0x61')](function(_0x5ecb1c){var _0x3b5d7d;return db['VoiceMusicOnHold'][_0xd024('0x62')]({'where':{'id':_0x34cbef[_0xd024('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1cace4,null))[_0xd024('0x26')](function(_0xd22104){if(_0xd22104){_0x3b5d7d=_0xd22104;return _0xd22104['removeSound'](_0x34cbef[_0xd024('0x4c')][_0xd024('0x6e')]);}})[_0xd024('0x26')](function(_0x13270b){if(_0x13270b){return db[_0xd024('0x6f')][_0xd024('0x62')]({'where':{'id':_0x34cbef[_0xd024('0x4c')][_0xd024('0x6e')]},'attributes':['id','name','save_name',_0xd024('0x64'),_0xd024('0x70')],'raw':!![]});}})[_0xd024('0x26')](function(_0x3177cc){if(_0x3177cc){fs['unlinkSync'](path['join'](_0x3b5d7d['directory'],util[_0xd024('0x67')](_0xd024('0x68'),_0x3177cc[_0xd024('0x2c')],_0x3177cc['converted_format'])));return _0x3177cc;}})[_0xd024('0x47')](function(_0x2854fb){throw new db['Sequelize'][(_0xd024('0x5f'))](_0x2854fb[_0xd024('0x6d')]);});})[_0xd024('0x26')](handleEntityNotFound(_0x1cace4,null))[_0xd024('0x26')](respondWithStatusCode(_0x1cace4,0xcc))[_0xd024('0x47')](handleError(_0x1cace4,null));};exports[_0xd024('0x71')]=function(_0x55d867,_0x470def,_0x30560f){var _0x391c24={};var _0x1105b0={};var _0x321176;var _0x545887;return db[_0xd024('0x30')]['findOne']({'where':{'id':_0x55d867['params']['id']}})[_0xd024('0x26')](handleEntityNotFound(_0x470def,null))[_0xd024('0x26')](function(_0x2b3d73){if(_0x2b3d73){_0x321176=_0x2b3d73;_0x1105b0[_0xd024('0x38')]=_[_0xd024('0x34')](db[_0xd024('0x6f')][_0xd024('0x31')]);_0x1105b0[_0xd024('0x35')]=_[_0xd024('0x34')](_0x55d867[_0xd024('0x35')]);_0x1105b0[_0xd024('0x36')]=_[_0xd024('0x37')](_0x1105b0['model'],_0x1105b0['query']);_0x391c24[_0xd024('0x39')]=_[_0xd024('0x37')](_0x1105b0[_0xd024('0x38')],qs[_0xd024('0x3a')](_0x55d867[_0xd024('0x35')][_0xd024('0x3a')]));_0x391c24[_0xd024('0x39')]=_0x391c24[_0xd024('0x39')][_0xd024('0x3b')]?_0x391c24[_0xd024('0x39')]:_0x1105b0[_0xd024('0x38')];_0x391c24[_0xd024('0x3d')]=qs[_0xd024('0x3e')](_0x55d867[_0xd024('0x35')][_0xd024('0x3e')]);_0x391c24['where']=qs[_0xd024('0x36')](_['pick'](_0x55d867[_0xd024('0x35')],_0x1105b0[_0xd024('0x36')]));if(_0x55d867['query'][_0xd024('0x3f')]){_0x391c24[_0xd024('0x40')]=_['merge'](_0x391c24[_0xd024('0x40')],{'$or':_[_0xd024('0x2f')](_0x391c24[_0xd024('0x39')],function(_0x10220f){var _0x204313={};_0x204313[_0x10220f]={'$like':'%'+_0x55d867[_0xd024('0x35')][_0xd024('0x3f')]+'%'};return _0x204313;})});}_0x391c24=_['merge']({},_0x391c24,_0x55d867['options']);return _0x321176['getSounds'](_0x391c24);}})[_0xd024('0x26')](function(_0x2f4f93){if(_0x2f4f93){_0x545887=_0x2f4f93[_0xd024('0x3b')];if(!_0x55d867[_0xd024('0x35')][_0xd024('0x72')]('nolimit')){_0x391c24[_0xd024('0x1d')]=qs[_0xd024('0x1d')](_0x55d867[_0xd024('0x35')][_0xd024('0x1d')]);_0x391c24[_0xd024('0x20')]=qs[_0xd024('0x20')](_0x55d867[_0xd024('0x35')][_0xd024('0x20')]);}return _0x321176['getSounds'](_0x391c24);}})[_0xd024('0x26')](function(_0x24074c){if(_0x24074c){return _0x24074c?{'count':_0x545887,'rows':_0x24074c}:null;}})[_0xd024('0x26')](respondWithResult(_0x470def,null))[_0xd024('0x47')](handleError(_0x470def,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0b48ae3..deb5e9e 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 _0xcf1a=['define','VoiceMusicOnHold','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x10946e,_0x46039c){var _0x370572=function(_0x3757e4){while(--_0x3757e4){_0x10946e['push'](_0x10946e['shift']());}};_0x370572(++_0x46039c);}(_0xcf1a,0xa7));var _0xacf1=function(_0x21b831,_0x2de10a){_0x21b831=_0x21b831-0x0;var _0x31354f=_0xcf1a[_0x21b831];return _0x31354f;};'use strict';var _=require('lodash');var util=require(_0xacf1('0x0'));var logger=require(_0xacf1('0x1'))('api');var moment=require(_0xacf1('0x2'));var BPromise=require(_0xacf1('0x3'));var rp=require(_0xacf1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacf1('0x5'));var config=require(_0xacf1('0x6'));var attributes=require(_0xacf1('0x7'));module[_0xacf1('0x8')]=function(_0xd61035,_0x3433d8){return _0xd61035[_0xacf1('0x9')](_0xacf1('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b23=['voice_musiconhold','lodash','util','moment','request-promise','path','rimraf','./voiceMusicOnHold.attributes','VoiceMusicOnHold'];(function(_0x5d2ea0,_0x139918){var _0x45c004=function(_0x502aed){while(--_0x502aed){_0x5d2ea0['push'](_0x5d2ea0['shift']());}};_0x45c004(++_0x139918);}(_0x4b23,0xeb));var _0x34b2=function(_0x2cb1bd,_0x42b64c){_0x2cb1bd=_0x2cb1bd-0x0;var _0x393fdf=_0x4b23[_0x2cb1bd];return _0x393fdf;};'use strict';var _=require(_0x34b2('0x0'));var util=require(_0x34b2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x34b2('0x2'));var BPromise=require('bluebird');var rp=require(_0x34b2('0x3'));var fs=require('fs');var path=require(_0x34b2('0x4'));var rimraf=require(_0x34b2('0x5'));var config=require('../../config/environment');var attributes=require(_0x34b2('0x6'));module['exports']=function(_0x3adf21,_0x2bae41){return _0x3adf21['define'](_0x34b2('0x7'),attributes,{'tableName':_0x34b2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index ae93a37..8b37df1 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x36a44a,_0x234200){var _0x2b0e4b=function(_0x41f614){while(--_0x41f614){_0x36a44a['push'](_0x36a44a['shift']());}};_0x2b0e4b(++_0x234200);}(_0x70e0,0x17b));var _0x070e=function(_0x1b657b,_0x401e9e){_0x1b657b=_0x1b657b-0x0;var _0x26a71e=_0x70e0[_0x1b657b];return _0x26a71e;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +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(_0x2f9c44,_0x46a7bf){var _0x80d9db=function(_0x5b1af4){while(--_0x5b1af4){_0x2f9c44['push'](_0x2f9c44['shift']());}};_0x80d9db(++_0x46a7bf);}(_0x34e8,0x12c));var _0x834e=function(_0x27f6be,_0x1e3448){_0x27f6be=_0x27f6be-0x0;var _0x18c174=_0x34e8[_0x27f6be];return _0x18c174;};'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 a7cc67f..5128337 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 _0xdb5c=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','update','destroy','removeAgents','delete','removeTeams','exports','multer','util','path'];(function(_0x25149b,_0x2f00bf){var _0x160a26=function(_0x38458c){while(--_0x38458c){_0x25149b['push'](_0x25149b['shift']());}};_0x160a26(++_0x2f00bf);}(_0xdb5c,0x169));var _0xcdb5=function(_0x5c1817,_0x42374e){_0x5c1817=_0x5c1817-0x0;var _0x1fa480=_0xdb5c[_0x5c1817];return _0x1fa480;};'use strict';var multer=require(_0xcdb5('0x0'));var util=require(_0xcdb5('0x1'));var path=require(_0xcdb5('0x2'));var timeout=require(_0xcdb5('0x3'));var express=require(_0xcdb5('0x4'));var router=express['Router']();var fs_extra=require(_0xcdb5('0x5'));var auth=require(_0xcdb5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcdb5('0x7'));var controller=require(_0xcdb5('0x8'));router[_0xcdb5('0x9')]('/',auth[_0xcdb5('0xa')](),controller[_0xcdb5('0xb')]);router[_0xcdb5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xcdb5('0xc')]);router[_0xcdb5('0x9')](_0xcdb5('0xd'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0xe')]);router['get'](_0xcdb5('0xf'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x10')]);router['get'](_0xcdb5('0x11'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x12')]);router[_0xcdb5('0x13')]('/',auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x14')]);router[_0xcdb5('0x13')](_0xcdb5('0xf'),auth[_0xcdb5('0xa')](),controller['addAgents']);router[_0xcdb5('0x13')](_0xcdb5('0x11'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x15')]);router['put'](_0xcdb5('0xd'),auth['isAuthenticated'](),controller[_0xcdb5('0x16')]);router['delete'](_0xcdb5('0xd'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x17')]);router['delete']('/:id/users',auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x18')]);router[_0xcdb5('0x19')](_0xcdb5('0x11'),auth[_0xcdb5('0xa')](),controller[_0xcdb5('0x1a')]);module[_0xcdb5('0x1b')]=router; \ No newline at end of file +var _0xea89=['post','addTeams','put','delete','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams'];(function(_0x656c05,_0x1d4b18){var _0x28475a=function(_0x21ef6a){while(--_0x21ef6a){_0x656c05['push'](_0x656c05['shift']());}};_0x28475a(++_0x1d4b18);}(_0xea89,0x1e2));var _0x9ea8=function(_0x18a1f6,_0x5356c4){_0x18a1f6=_0x18a1f6-0x0;var _0x493551=_0xea89[_0x18a1f6];return _0x493551;};'use strict';var multer=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var path=require(_0x9ea8('0x2'));var timeout=require(_0x9ea8('0x3'));var express=require(_0x9ea8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ea8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ea8('0x6'));var config=require('../../config/environment');var controller=require(_0x9ea8('0x7'));router[_0x9ea8('0x8')]('/',auth[_0x9ea8('0x9')](),controller[_0x9ea8('0xa')]);router[_0x9ea8('0x8')](_0x9ea8('0xb'),auth[_0x9ea8('0x9')](),controller['describe']);router[_0x9ea8('0x8')](_0x9ea8('0xc'),auth['isAuthenticated'](),controller[_0x9ea8('0xd')]);router[_0x9ea8('0x8')](_0x9ea8('0xe'),auth['isAuthenticated'](),controller[_0x9ea8('0xf')]);router[_0x9ea8('0x8')](_0x9ea8('0x10'),auth[_0x9ea8('0x9')](),controller[_0x9ea8('0x11')]);router[_0x9ea8('0x12')]('/',auth[_0x9ea8('0x9')](),controller['create']);router[_0x9ea8('0x12')](_0x9ea8('0xe'),auth[_0x9ea8('0x9')](),controller['addAgents']);router[_0x9ea8('0x12')](_0x9ea8('0x10'),auth[_0x9ea8('0x9')](),controller[_0x9ea8('0x13')]);router[_0x9ea8('0x14')](_0x9ea8('0xc'),auth[_0x9ea8('0x9')](),controller['update']);router[_0x9ea8('0x15')](_0x9ea8('0xc'),auth[_0x9ea8('0x9')](),controller['destroy']);router[_0x9ea8('0x15')]('/:id/users',auth[_0x9ea8('0x9')](),controller[_0x9ea8('0x16')]);router[_0x9ea8('0x15')](_0x9ea8('0x10'),auth[_0x9ea8('0x9')](),controller[_0x9ea8('0x17')]);module[_0x9ea8('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 805992f..11c56ed 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 _0x456f=['INTEGER','sequelize','exports','STRING','VIRTUAL','system-'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x456f,0x91));var _0xf456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x456f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf456('0x0'));module[_0xf456('0x1')]={'name':{'type':Sequelize[_0xf456('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xf456('0x3')],'get':function(_0x259d00){return _0xf456('0x4')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0xf456('0x2')]},'callerIdAll':{'type':Sequelize[_0xf456('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xf456('0x5')]}}; \ No newline at end of file +var _0xe57d=['INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x2a3382,_0x3ed2e4){var _0x507f4a=function(_0x42a6cd){while(--_0x42a6cd){_0x2a3382['push'](_0x2a3382['shift']());}};_0x507f4a(++_0x3ed2e4);}(_0xe57d,0x15f));var _0xde57=function(_0x29a7ec,_0x4e3a9c){_0x29a7ec=_0x29a7ec-0x0;var _0x38ad00=_0xe57d[_0x29a7ec];return _0x38ad00;};'use strict';var Sequelize=require(_0xde57('0x0'));module[_0xde57('0x1')]={'name':{'type':Sequelize[_0xde57('0x2')],'allowNull':![],'unique':_0xde57('0x3')},'prefix':{'type':Sequelize[_0xde57('0x4')],'get':function(_0x4bd796){return _0xde57('0x5')+this['getDataValue'](_0xde57('0x3'))+'-';}},'description':{'type':Sequelize[_0xde57('0x2')]},'callerIdAll':{'type':Sequelize[_0xde57('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xde57('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 3a11649..6936c59 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 _0x3266=['index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','emit','userVoicePrefix:save','ids','removeAgents','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','getTeams','Team','interface','Agents','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x31ead7,_0x2e9a7c){var _0x3516f0=function(_0x47fa36){while(--_0x47fa36){_0x31ead7['push'](_0x31ead7['shift']());}};_0x3516f0(++_0x2e9a7c);}(_0x3266,0x6a));var _0x6326=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x3266[_0x35007a];return _0x574f68;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];config[_0x6326('0x1c')]=_['defaults'](config['redis'],{'host':_0x6326('0x1d'),'port':0x18eb});var socket=require(_0x6326('0x1e'))(new Redis(config['redis']));require(_0x6326('0x1f'))['register'](socket);function respondWithStatusCode(_0x2d2d9b,_0x20dcc6){_0x20dcc6=_0x20dcc6||0xcc;return function(_0x3d6ac0){if(_0x3d6ac0){return _0x2d2d9b[_0x6326('0x20')](_0x20dcc6);}return _0x2d2d9b[_0x6326('0x21')](_0x20dcc6)[_0x6326('0x22')]();};}function respondWithResult(_0x55923a,_0x1104c5){_0x1104c5=_0x1104c5||0xc8;return function(_0x518e6f){if(_0x518e6f){return _0x55923a['status'](_0x1104c5)['json'](_0x518e6f);}};}function respondWithFilteredResult(_0x51e7b9,_0x5d402d){return function(_0x58e960){if(_0x58e960){var _0xdf5ced=typeof _0x5d402d[_0x6326('0x23')]===_0x6326('0x24')&&typeof _0x5d402d['limit']==='undefined';var _0x954ed5=_0x58e960[_0x6326('0x25')];var _0x272b5c=_0xdf5ced?0x0:_0x5d402d[_0x6326('0x23')];var _0x3c08db=_0xdf5ced?_0x58e960[_0x6326('0x25')]:_0x5d402d[_0x6326('0x23')]+_0x5d402d['limit'];var _0x22307f;if(_0x3c08db>=_0x954ed5){_0x3c08db=_0x954ed5;_0x22307f=0xc8;}else{_0x22307f=0xce;}_0x51e7b9['status'](_0x22307f);return _0x51e7b9[_0x6326('0x26')](_0x6326('0x27'),_0x272b5c+'-'+_0x3c08db+'/'+_0x954ed5)[_0x6326('0x28')](_0x58e960);}return null;};}function patchUpdates(_0x24fb78){return function(_0x43cdfc){try{jsonpatch[_0x6326('0x29')](_0x43cdfc,_0x24fb78,!![]);}catch(_0x225555){return BPromise[_0x6326('0x2a')](_0x225555);}return _0x43cdfc[_0x6326('0x2b')]();};}function saveUpdates(_0x2d0d00,_0x34954b){return function(_0x4933e1){if(_0x4933e1){return _0x4933e1[_0x6326('0x2c')](_0x2d0d00)[_0x6326('0x2d')](function(_0x575701){return _0x575701;});}return null;};}function removeEntity(_0x4e272b,_0x4d28fd){return function(_0x405474){if(_0x405474){return _0x405474['destroy']()[_0x6326('0x2d')](function(){var _0x1a48da=_0x405474['get']({'plain':!![]});var _0x15e33d=_0x6326('0x2e');return db[_0x6326('0x2f')][_0x6326('0x30')]({'where':{'type':_0x15e33d,'resourceId':_0x1a48da['id']}})[_0x6326('0x2d')](function(){return _0x405474;});})[_0x6326('0x2d')](function(){_0x4e272b[_0x6326('0x21')](0xcc)[_0x6326('0x22')]();});}};}function handleEntityNotFound(_0x461e0f,_0x127744){return function(_0x4980f6){if(!_0x4980f6){_0x461e0f[_0x6326('0x20')](0x194);}return _0x4980f6;};}function handleError(_0x331772,_0x134524){_0x134524=_0x134524||0x1f4;return function(_0x2e0445){logger[_0x6326('0x31')](_0x2e0445['stack']);if(_0x2e0445[_0x6326('0x32')]){delete _0x2e0445[_0x6326('0x32')];}_0x331772[_0x6326('0x21')](_0x134524)['send'](_0x2e0445);};}exports[_0x6326('0x33')]=function(_0x4d7807,_0x4e703a){var _0xfb6b62={},_0x7ac8d9={},_0x160a12={'count':0x0,'rows':[]};var _0x103b1c=_[_0x6326('0x34')](db[_0x6326('0x35')][_0x6326('0x36')],function(_0x46c803){return{'name':_0x46c803[_0x6326('0x37')],'type':_0x46c803[_0x6326('0x38')][_0x6326('0x39')]};});_0x7ac8d9[_0x6326('0x3a')]=_['map'](_0x103b1c,_0x6326('0x32'));_0x7ac8d9[_0x6326('0x3b')]=_['keys'](_0x4d7807[_0x6326('0x3b')]);_0x7ac8d9[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x7ac8d9['model'],_0x7ac8d9[_0x6326('0x3b')]);_0xfb6b62['attributes']=_['intersection'](_0x7ac8d9[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x4d7807[_0x6326('0x3b')]['fields']));_0xfb6b62[_0x6326('0x3f')]=_0xfb6b62['attributes'][_0x6326('0x40')]?_0xfb6b62['attributes']:_0x7ac8d9[_0x6326('0x3a')];if(!_0x4d7807[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0xfb6b62[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x4d7807['query'][_0x6326('0x43')]);_0xfb6b62[_0x6326('0x23')]=qs['offset'](_0x4d7807[_0x6326('0x3b')]['offset']);}_0xfb6b62['order']=qs[_0x6326('0x44')](_0x4d7807[_0x6326('0x3b')][_0x6326('0x44')]);_0xfb6b62[_0x6326('0x45')]=qs[_0x6326('0x3c')](_[_0x6326('0x46')](_0x4d7807['query'],_0x7ac8d9['filters']),_0x103b1c);if(_0x4d7807[_0x6326('0x3b')]['filter']){_0xfb6b62[_0x6326('0x45')]=_['merge'](_0xfb6b62[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x103b1c,function(_0x335feb){if(_0x335feb[_0x6326('0x38')]!==_0x6326('0x47')){var _0x1b754d={};_0x1b754d[_0x335feb[_0x6326('0x32')]]={'$like':'%'+_0x4d7807[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x1b754d;}})});}_0xfb6b62=_[_0x6326('0x49')]({},_0xfb6b62,_0x4d7807[_0x6326('0x4a')]);var _0x5d36b1={'where':_0xfb6b62[_0x6326('0x45')]};return db['VoicePrefix'][_0x6326('0x25')](_0x5d36b1)[_0x6326('0x2d')](function(_0x16fc33){_0x160a12[_0x6326('0x25')]=_0x16fc33;if(_0x4d7807['query'][_0x6326('0x4b')]){_0xfb6b62[_0x6326('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6326('0x4d')](_0xfb6b62);})[_0x6326('0x2d')](function(_0x7a5057){_0x160a12[_0x6326('0x4e')]=_0x7a5057;return _0x160a12;})['then'](respondWithFilteredResult(_0x4e703a,_0xfb6b62))[_0x6326('0x4f')](handleError(_0x4e703a,null));};exports[_0x6326('0x50')]=function(_0x231e15,_0x28504f){var _0x44d852={'raw':![],'where':{'id':_0x231e15[_0x6326('0x51')]['id']}},_0x165953={};_0x165953['model']=_[_0x6326('0x52')](db[_0x6326('0x35')][_0x6326('0x36')]);_0x165953[_0x6326('0x3b')]=_['keys'](_0x231e15[_0x6326('0x3b')]);_0x165953['filters']=_[_0x6326('0x3d')](_0x165953[_0x6326('0x3a')],_0x165953[_0x6326('0x3b')]);_0x44d852[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x165953['model'],qs[_0x6326('0x3e')](_0x231e15['query']['fields']));_0x44d852[_0x6326('0x3f')]=_0x44d852[_0x6326('0x3f')]['length']?_0x44d852[_0x6326('0x3f')]:_0x165953[_0x6326('0x3a')];if(_0x231e15[_0x6326('0x3b')][_0x6326('0x4b')]){_0x44d852[_0x6326('0x4c')]=[{'all':!![]}];}_0x44d852=_['merge']({},_0x44d852,_0x231e15['options']);return db[_0x6326('0x35')][_0x6326('0x53')](_0x44d852)[_0x6326('0x2d')](handleEntityNotFound(_0x28504f,null))[_0x6326('0x2d')](respondWithResult(_0x28504f,null))[_0x6326('0x4f')](handleError(_0x28504f,null));};exports[_0x6326('0x30')]=function(_0xdc4522,_0x55bcd6){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0xdc4522[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x55bcd6,null))[_0x6326('0x2d')](removeEntity(_0x55bcd6,null))['catch'](handleError(_0x55bcd6,null));};exports[_0x6326('0x54')]=function(_0x55537a,_0x216972){return db[_0x6326('0x35')]['describe']()[_0x6326('0x2d')](respondWithResult(_0x216972,null))['catch'](handleError(_0x216972,null));};exports[_0x6326('0x55')]=function(_0x202fd3,_0x2ee8df){var _0x35400e;return db['sequelize'][_0x6326('0x56')](function(_0xbe6b3e){return db['VoicePrefix'][_0x6326('0x55')](_0x202fd3[_0x6326('0x57')],{'transaction':_0xbe6b3e})[_0x6326('0x2d')](function(_0x4a42ae){_0x35400e=_0x4a42ae[_0x6326('0x58')]({'plain':!![]});return db[_0x6326('0x59')]['find']({'where':{'id':_0x35400e[_0x6326('0x5a')]},'raw':!![]})['then'](function(_0x1f1463){return createVoicePrefixExtensions(_0x35400e,_0x1f1463,_0xbe6b3e);});});})[_0x6326('0x2d')](function(){var _0x3e9825=_0x202fd3[_0x6326('0x5b')][_0x6326('0x58')]({'plain':!![]});if(!_0x3e9825)throw new Error(_0x6326('0x5c'));if(_0x3e9825[_0x6326('0x5d')]==='user'){var _0x51adce=_0x35400e;return db['UserProfileSection'][_0x6326('0x53')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9825[_0x6326('0x5e')]},'raw':!![]})[_0x6326('0x2d')](function(_0xcae454){if(_0xcae454&&_0xcae454[_0x6326('0x5f')]===0x0){return db[_0x6326('0x2f')]['create']({'name':_0x51adce[_0x6326('0x32')],'resourceId':_0x51adce['id'],'type':_0xcae454[_0x6326('0x32')],'sectionId':_0xcae454['id']},{})['then'](function(){return _0x35400e;});}else{return _0x35400e;}})[_0x6326('0x4f')](function(_0xdeba28){logger[_0x6326('0x31')](_0x6326('0x60'),_0xdeba28);throw _0xdeba28;});}return _0x35400e;})[_0x6326('0x2d')](respondWithResult(_0x2ee8df,null))[_0x6326('0x4f')](handleError(_0x2ee8df,null));};function Extension(_0x320d43,_0x2f624f,_0x2c7a8d,_0x37506f){this['context']=_0x6326('0x61');this[_0x6326('0x62')]=_0x320d43;this[_0x6326('0x63')]=_0x2c7a8d;this[_0x6326('0x38')]='system';this['description']=_0x6326('0x64');this[_0x6326('0x65')]=_0x2f624f;this[_0x6326('0x66')]=_0x37506f;}function createVoicePrefixExtensions(_0x10f54b,_0x3ac39d,_0x54a9eb){return new BPromise(function(_0x4cec50,_0x13fc10){var _0x447b34=new Extension(formatPrefixName(_0x10f54b[_0x6326('0x67')]),0x1,_0x6326('0x68'),'Voice\x20Prefix');_0x447b34[_0x6326('0x69')]=_0x10f54b['id'];return db[_0x6326('0x59')][_0x6326('0x55')](_0x447b34,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x4197d6){var _0xc8f404=_0x4197d6['get']({'plain':!![]});var _0x2bc08a=_['map'](addVoicePrefixExtensions(_0x10f54b,_0x3ac39d),function(_0x4877c8){_0x4877c8[_0x6326('0x5a')]=_0xc8f404['id'];_0x4877c8['VoicePrefixId']=_0x10f54b['id'];return _0x4877c8;});return db[_0x6326('0x59')][_0x6326('0x6a')](_0x2bc08a,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x3b6de7){if(!_0x3b6de7){return _0x13fc10(_0x6326('0x6b'));}else{return _0x4cec50(_0x3b6de7);}})[_0x6326('0x4f')](function(_0x1e8d86){return _0x13fc10(_0x1e8d86);});});;});};function addVoicePrefixExtensions(_0x75e3a7,_0xa2928e){var _0x3f5e2e=[];var _0x53ff60=formatPrefixName(_0x75e3a7[_0x6326('0x67')]);_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x2,_0x6326('0x6d'),_0x6326('0x6e')+_0x75e3a7[_0x6326('0x32')]));if(_0x75e3a7['callerIdAll']){_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,_0x6326('0x6d'),_0x6326('0x6f')+_0x75e3a7[_0x6326('0x70')]));}else{_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,'NoOp',_0x6326('0x71')));}_0x3f5e2e['push'](new Extension(_0x53ff60,0x4,'goto',_0xa2928e[_0x6326('0x72')]+','+_0x6326('0x73')+(0x8+_0x75e3a7[_0x6326('0x32')][_0x6326('0x40')])+'}'+','+0x1));return _0x3f5e2e;}function formatPrefixName(_0x4fd921){var _0x4fbede='_';for(var _0x5cadb2=0x0;_0x5cadb2<_0x4fd921['length'];_0x5cadb2++){if(_0x4fd921[_0x6326('0x74')](_0x5cadb2)=='-'){_0x4fbede+=_0x4fd921['charAt'](_0x5cadb2);}else{_0x4fbede+='['+_0x4fd921[_0x6326('0x74')](_0x5cadb2)+']';}}_0x4fbede+='.';return _0x4fbede;}exports[_0x6326('0x2c')]=function(_0x54730e,_0x4c1d7e,_0x5401cf){var _0x5e86bc=_0x54730e['body'];_0x5e86bc[_0x6326('0x67')]='system-'+_0x5e86bc['name']+'-';return db['sequelize']['transaction'](function(_0x19916e){return db['VoicePrefix'][_0x6326('0x2c')](_0x5e86bc,{'where':{'id':_0x5e86bc['id']},'transaction':_0x19916e})[_0x6326('0x2d')](function(){return db['VoiceExtension'][_0x6326('0x30')]({'where':{'VoicePrefixId':_0x5e86bc['id']},'transaction':_0x19916e})['then'](function(){return db[_0x6326('0x59')][_0x6326('0x53')]({'where':{'id':_0x5e86bc[_0x6326('0x5a')]},'raw':!![]})[_0x6326('0x2d')](function(_0x339838){return createVoicePrefixExtensions(_0x5e86bc,_0x339838,_0x19916e);});});});})[_0x6326('0x2d')](function(){return db[_0x6326('0x35')][_0x6326('0x75')](_0x5e86bc['id']);})[_0x6326('0x2d')](respondWithResult(_0x4c1d7e,null))[_0x6326('0x4f')](handleError(_0x4c1d7e,null));};exports[_0x6326('0x76')]=function(_0x19cc2b,_0x3bc5f3,_0x27a505){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0x19cc2b[_0x6326('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bc5f3,null))['then'](function(_0x543792){if(_0x543792){return _0x543792['addAgents'](_0x19cc2b[_0x6326('0x57')]['ids'],_['omit'](_0x19cc2b['body'],['ids','id'])||{})['spread'](function(_0x5a1a9f){for(var _0xe845d6=0x0;_0xe845d6<_0x19cc2b[_0x6326('0x57')]['ids'][_0x6326('0x40')];_0xe845d6+=0x1){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':Number(_0x19cc2b['body'][_0x6326('0x79')][_0xe845d6]),'VoicePrefixId':Number(_0x19cc2b[_0x6326('0x51')]['id'])});}return _0x5a1a9f;});}})[_0x6326('0x2d')](respondWithResult(_0x3bc5f3,null))[_0x6326('0x4f')](handleError(_0x3bc5f3,null));};exports[_0x6326('0x7a')]=function(_0x483813,_0x3bff09,_0x4aec22){return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x483813['params']['id']}})['then'](handleEntityNotFound(_0x3bff09,null))['then'](function(_0x491f2e){if(_0x491f2e){return _0x491f2e['removeAgents'](_0x483813['query']['ids'])[_0x6326('0x2d')](function(){if(_[_0x6326('0x7b')](_0x483813[_0x6326('0x3b')][_0x6326('0x79')])){for(var _0x590e06=0x0;_0x590e06<_0x483813['query']['ids'][_0x6326('0x40')];_0x590e06+=0x1){socket[_0x6326('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x483813[_0x6326('0x3b')]['ids'][_0x590e06]),'VoicePrefixId':Number(_0x483813['params']['id'])});}}else{socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':Number(_0x483813[_0x6326('0x3b')][_0x6326('0x79')]),'VoicePrefixId':Number(_0x483813[_0x6326('0x51')]['id'])});}});}})[_0x6326('0x2d')](respondWithStatusCode(_0x3bff09,null))[_0x6326('0x4f')](handleError(_0x3bff09,null));};exports['getAgents']=function(_0x5afd24,_0x4c8bde,_0x1ec0ef){var _0x5223f4={};var _0x48631a={};var _0xaea64f;var _0x429c41;return db['VoicePrefix'][_0x6326('0x7d')]({'where':{'id':_0x5afd24['params']['id']}})['then'](handleEntityNotFound(_0x4c8bde,null))[_0x6326('0x2d')](function(_0xbca686){if(_0xbca686){_0xaea64f=_0xbca686;_0x48631a['model']=_['keys'](db[_0x6326('0x7e')][_0x6326('0x36')]);_0x48631a[_0x6326('0x3b')]=_[_0x6326('0x52')](_0x5afd24['query']);_0x48631a['filters']=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],_0x48631a[_0x6326('0x3b')]);_0x5223f4[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x5afd24[_0x6326('0x3b')]['fields']));_0x5223f4[_0x6326('0x3f')]=_0x5223f4['attributes'][_0x6326('0x40')]?_0x5223f4[_0x6326('0x3f')]:_0x48631a[_0x6326('0x3a')];_0x5223f4[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x5afd24[_0x6326('0x3b')]['sort']);_0x5223f4[_0x6326('0x45')]=qs[_0x6326('0x3c')](_['pick'](_0x5afd24[_0x6326('0x3b')],_0x48631a[_0x6326('0x3c')]));if(_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]){_0x5223f4[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5223f4[_0x6326('0x45')],{'$or':_['map'](_0x5223f4[_0x6326('0x3f')],function(_0x21ccbf){var _0x458a7e={};_0x458a7e[_0x21ccbf]={'$like':'%'+_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x458a7e;})});}_0x5223f4=_['merge']({},_0x5223f4,_0x5afd24[_0x6326('0x4a')]);return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})['then'](function(_0x411fe5){if(_0x411fe5){_0x429c41=_0x411fe5[_0x6326('0x40')];if(!_0x5afd24[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5223f4[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x5afd24[_0x6326('0x3b')]['limit']);_0x5223f4[_0x6326('0x23')]=qs[_0x6326('0x23')](_0x5afd24[_0x6326('0x3b')][_0x6326('0x23')]);}return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})[_0x6326('0x2d')](function(_0xcb5683){if(_0xcb5683){return _0xcb5683?{'count':_0x429c41,'rows':_0xcb5683}:null;}})['then'](respondWithResult(_0x4c8bde,null))[_0x6326('0x4f')](handleError(_0x4c8bde,null));};exports['getTeams']=function(_0x44cea5,_0x57e6ad,_0x3a9312){var _0x5b251f={};var _0x2b885b={};var _0xda3005;var _0x29682b;return db[_0x6326('0x35')][_0x6326('0x7d')]({'where':{'id':_0x44cea5[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x57e6ad,null))['then'](function(_0x1da431){if(_0x1da431){_0xda3005=_0x1da431;_0x2b885b[_0x6326('0x3a')]=_[_0x6326('0x52')](db['Team'][_0x6326('0x36')]);_0x2b885b['query']=_[_0x6326('0x52')](_0x44cea5[_0x6326('0x3b')]);_0x2b885b[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x2b885b[_0x6326('0x3a')],_0x2b885b[_0x6326('0x3b')]);_0x5b251f[_0x6326('0x3f')]=_['intersection'](_0x2b885b[_0x6326('0x3a')],qs['fields'](_0x44cea5[_0x6326('0x3b')][_0x6326('0x3e')]));_0x5b251f[_0x6326('0x3f')]=_0x5b251f[_0x6326('0x3f')]['length']?_0x5b251f['attributes']:_0x2b885b[_0x6326('0x3a')];_0x5b251f[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x44cea5[_0x6326('0x3b')]['sort']);_0x5b251f[_0x6326('0x45')]=qs['filters'](_['pick'](_0x44cea5[_0x6326('0x3b')],_0x2b885b[_0x6326('0x3c')]));if(_0x44cea5[_0x6326('0x3b')][_0x6326('0x48')]){_0x5b251f[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5b251f[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x5b251f[_0x6326('0x3f')],function(_0x3884db){var _0x5ccb35={};_0x5ccb35[_0x3884db]={'$like':'%'+_0x44cea5['query'][_0x6326('0x48')]+'%'};return _0x5ccb35;})});}_0x5b251f=_['merge']({},_0x5b251f,_0x44cea5[_0x6326('0x4a')]);return _0xda3005['getTeams'](_0x5b251f);}})['then'](function(_0x10d3c6){if(_0x10d3c6){_0x29682b=_0x10d3c6[_0x6326('0x40')];if(!_0x44cea5[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5b251f[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x44cea5[_0x6326('0x3b')]['limit']);_0x5b251f['offset']=qs[_0x6326('0x23')](_0x44cea5['query'][_0x6326('0x23')]);}return _0xda3005[_0x6326('0x81')](_0x5b251f);}})['then'](function(_0x5c57e5){if(_0x5c57e5){return _0x5c57e5?{'count':_0x29682b,'rows':_0x5c57e5}:null;}})[_0x6326('0x2d')](respondWithResult(_0x57e6ad,null))['catch'](handleError(_0x57e6ad,null));};exports['addTeams']=function(_0x50d766,_0x4f45a6,_0x3a9a9e){var _0x22c60d=_0x50d766[_0x6326('0x57')][_0x6326('0x79')];var _0x26f784;return db[_0x6326('0x82')]['findAll']({'where':{'id':_0x22c60d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0x6326('0x83')],'raw':!![]}]})[_0x6326('0x2d')](function(_0x215db1){if(_0x215db1){_0x26f784=_0x215db1;var _0x2a9f5c=_['flatMap'](_0x215db1,function(_0x20f5ea){var _0x293f72=_0x20f5ea['get']({'plain':!![]});return _0x293f72[_0x6326('0x84')];});return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x50d766[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](function(_0x5d4b0a){return db['sequelize'][_0x6326('0x56')](function(_0xf912fe){return _0x5d4b0a[_0x6326('0x85')](_0x22c60d,{'transaction':_0xf912fe})['then'](function(){return BPromise[_0x6326('0x86')](_0x26f784,function(_0x464914){return db[_0x6326('0x87')]['upsert']({'TeamId':_0x464914['id'],'VoicePrefixId':_0x50d766[_0x6326('0x51')]['id']},{'transaction':_0xf912fe});});})['then'](function(){return BPromise[_0x6326('0x86')](_0x2a9f5c,function(_0x5a7b49){return db[_0x6326('0x88')][_0x6326('0x89')]({'where':{'UserId':_0x5a7b49['id'],'VoicePrefixId':_0x50d766['params']['id']},'transaction':_0xf912fe});});})[_0x6326('0x2d')](function(){_0x2a9f5c[_0x6326('0x8a')](function(_0x38d8c8){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':_0x38d8c8['id'],'VoicePrefixId':_0x5d4b0a['id']});});});});});}})[_0x6326('0x2d')](respondWithStatusCode(_0x4f45a6,null))[_0x6326('0x4f')](handleError(_0x4f45a6,null));};exports[_0x6326('0x8b')]=function(_0x43dc1e,_0x26ea69,_0x1a4b94){return db[_0x6326('0x82')][_0x6326('0x4d')]({'where':{'id':_0x43dc1e['query'][_0x6326('0x79')]},'attributes':['id'],'include':[{'model':db[_0x6326('0x7e')],'as':_0x6326('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x26ea69,null))['then'](function(_0x489226){var _0x5db6b3=_[_0x6326('0x34')](_0x489226,'id');var _0x5135df=[];var _0x4c15d2=[];var _0xd9c385=squel['select']();_0xd9c385['field'](_0x6326('0x8c'))['from'](_0x6326('0x8d'),'tq')[_0x6326('0x8e')](_0x6326('0x8f'),'ut',_0x6326('0x90'))[_0x6326('0x45')](_0x6326('0x91'),_0x43dc1e[_0x6326('0x51')]['id']);for(var _0x26391c=0x0;_0x26391c<_0x489226[_0x6326('0x40')];_0x26391c+=0x1){let _0x1adcbc=_0x489226[_0x26391c];for(var _0x46bece=0x0;_0x46bece<_0x1adcbc[_0x6326('0x84')][_0x6326('0x40')];_0x46bece+=0x1){let _0x30d31a=_0x1adcbc[_0x6326('0x84')][_0x46bece];var _0x3ec241=_0xd9c385[_0x6326('0x92')]();_0x3ec241[_0x6326('0x45')](_0x6326('0x93'),_0x30d31a['id']);_0x4c15d2[_0x6326('0x6c')](db['sequelize'][_0x6326('0x3b')](_0x3ec241[_0x6326('0x94')](),{'type':db[_0x6326('0x95')][_0x6326('0x96')][_0x6326('0x97')]})[_0x6326('0x2d')](function(_0x292657){if(_0x292657[_0x6326('0x40')]===0x1){return _0x30d31a['id'];}else{var _0x909cce=_[_0x6326('0x98')](_['map'](_0x292657,_0x6326('0x99')),function(_0x4b493a){return _[_0x6326('0x9a')](_0x5db6b3,_0x4b493a);});if(_0x909cce){return _0x30d31a['id'];}}}));}}return BPromise[_0x6326('0x9b')](_0x4c15d2)['then'](function(_0x2b98a4){_0x5135df=_(_0x5135df)[_0x6326('0x9c')](_0x2b98a4)['compact']()['value']();return db[_0x6326('0x35')]['find']({'where':{'id':_0x43dc1e[_0x6326('0x51')]['id']}})['then'](function(_0x4a470e){return db[_0x6326('0x95')][_0x6326('0x56')](function(_0x298a11){return _0x4a470e[_0x6326('0x8b')](_0x43dc1e[_0x6326('0x3b')][_0x6326('0x79')],{'transaction':_0x298a11})[_0x6326('0x2d')](function(){if(!_['isEmpty'](_0x5135df)){return _0x4a470e['removeAgents'](_0x5135df,{'transaction':_0x298a11});}})[_0x6326('0x2d')](function(){_0x5135df[_0x6326('0x8a')](function(_0x42d1db){socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':_0x42d1db,'VoicePrefixId':_0x4a470e['id']});});});});});});})['then'](respondWithStatusCode(_0x26ea69,null))[_0x6326('0x4f')](handleError(_0x26ea69,null));}; \ No newline at end of file +var _0x5b12=['QueryTypes','SELECT','TeamId','includes','all','union','compact','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','fields','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','context','from-sip','exten','app','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','merge','getTeams','Team','User','online','flatMap','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b12,0xa3));var _0x25b1=function(_0x45190b,_0x3e8326){_0x45190b=_0x45190b-0x0;var _0x1731d9=_0x5b12[_0x45190b];return _0x1731d9;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];config[_0x25b1('0x19')]=_[_0x25b1('0x1a')](config[_0x25b1('0x19')],{'host':_0x25b1('0x1b'),'port':0x18eb});var socket=require(_0x25b1('0x1c'))(new Redis(config[_0x25b1('0x19')]));require(_0x25b1('0x1d'))['register'](socket);function respondWithStatusCode(_0x2c337a,_0x2559a1){_0x2559a1=_0x2559a1||0xcc;return function(_0x4de13f){if(_0x4de13f){return _0x2c337a[_0x25b1('0x1e')](_0x2559a1);}return _0x2c337a[_0x25b1('0x1f')](_0x2559a1)[_0x25b1('0x20')]();};}function respondWithResult(_0x4a5a58,_0x593165){_0x593165=_0x593165||0xc8;return function(_0x7b50ab){if(_0x7b50ab){return _0x4a5a58['status'](_0x593165)[_0x25b1('0x21')](_0x7b50ab);}};}function respondWithFilteredResult(_0x2ca567,_0x1be2d8){return function(_0x27ccc9){if(_0x27ccc9){var _0x1f78c2=typeof _0x1be2d8[_0x25b1('0x22')]===_0x25b1('0x23')&&typeof _0x1be2d8[_0x25b1('0x24')]==='undefined';var _0x4ecff1=_0x27ccc9[_0x25b1('0x25')];var _0x501dc8=_0x1f78c2?0x0:_0x1be2d8[_0x25b1('0x22')];var _0x50ae0f=_0x1f78c2?_0x27ccc9[_0x25b1('0x25')]:_0x1be2d8['offset']+_0x1be2d8[_0x25b1('0x24')];var _0x529310;if(_0x50ae0f>=_0x4ecff1){_0x50ae0f=_0x4ecff1;_0x529310=0xc8;}else{_0x529310=0xce;}_0x2ca567[_0x25b1('0x1f')](_0x529310);return _0x2ca567['set']('Content-Range',_0x501dc8+'-'+_0x50ae0f+'/'+_0x4ecff1)['json'](_0x27ccc9);}return null;};}function patchUpdates(_0x3bca9f){return function(_0x150436){try{jsonpatch['apply'](_0x150436,_0x3bca9f,!![]);}catch(_0x19bab8){return BPromise[_0x25b1('0x26')](_0x19bab8);}return _0x150436[_0x25b1('0x27')]();};}function saveUpdates(_0x246acd,_0x1aabbb){return function(_0x5e6b6b){if(_0x5e6b6b){return _0x5e6b6b[_0x25b1('0x28')](_0x246acd)[_0x25b1('0x29')](function(_0xd22469){return _0xd22469;});}return null;};}function removeEntity(_0x282187,_0x1f37ed){return function(_0x1292bf){if(_0x1292bf){return _0x1292bf['destroy']()[_0x25b1('0x29')](function(){var _0x27dd68=_0x1292bf[_0x25b1('0x2a')]({'plain':!![]});var _0x5bc8fc=_0x25b1('0x2b');return db[_0x25b1('0x2c')][_0x25b1('0x2d')]({'where':{'type':_0x5bc8fc,'resourceId':_0x27dd68['id']}})['then'](function(){return _0x1292bf;});})[_0x25b1('0x29')](function(){_0x282187['status'](0xcc)[_0x25b1('0x20')]();});}};}function handleEntityNotFound(_0x3febb8,_0x3a4475){return function(_0x293413){if(!_0x293413){_0x3febb8[_0x25b1('0x1e')](0x194);}return _0x293413;};}function handleError(_0x300a14,_0x46e429){_0x46e429=_0x46e429||0x1f4;return function(_0x4cd825){logger[_0x25b1('0x2e')](_0x4cd825[_0x25b1('0x2f')]);if(_0x4cd825[_0x25b1('0x30')]){delete _0x4cd825[_0x25b1('0x30')];}_0x300a14[_0x25b1('0x1f')](_0x46e429)['send'](_0x4cd825);};}exports[_0x25b1('0x31')]=function(_0x548dd0,_0x42441d){var _0x1622e8={},_0x1e1796={},_0x5a4234={'count':0x0,'rows':[]};var _0x5cbde5=_[_0x25b1('0x32')](db['VoicePrefix'][_0x25b1('0x33')],function(_0x391713){return{'name':_0x391713[_0x25b1('0x34')],'type':_0x391713['type']['key']};});_0x1e1796[_0x25b1('0x35')]=_[_0x25b1('0x32')](_0x5cbde5,_0x25b1('0x30'));_0x1e1796['query']=_[_0x25b1('0x36')](_0x548dd0[_0x25b1('0x37')]);_0x1e1796[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x1e1796['model'],_0x1e1796[_0x25b1('0x37')]);_0x1622e8[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1e1796['model'],qs['fields'](_0x548dd0[_0x25b1('0x37')]['fields']));_0x1622e8[_0x25b1('0x3a')]=_0x1622e8[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x1622e8[_0x25b1('0x3a')]:_0x1e1796[_0x25b1('0x35')];if(!_0x548dd0[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x1622e8[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x548dd0[_0x25b1('0x37')][_0x25b1('0x24')]);_0x1622e8[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x548dd0[_0x25b1('0x37')]['offset']);}_0x1622e8[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x548dd0['query'][_0x25b1('0x3f')]);_0x1622e8[_0x25b1('0x40')]=qs[_0x25b1('0x38')](_[_0x25b1('0x41')](_0x548dd0[_0x25b1('0x37')],_0x1e1796['filters']),_0x5cbde5);if(_0x548dd0[_0x25b1('0x37')]['filter']){_0x1622e8[_0x25b1('0x40')]=_['merge'](_0x1622e8[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x5cbde5,function(_0x1b354e){if(_0x1b354e[_0x25b1('0x42')]!==_0x25b1('0x43')){var _0x45713f={};_0x45713f[_0x1b354e[_0x25b1('0x30')]]={'$like':'%'+_0x548dd0[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x45713f;}})});}_0x1622e8=_['merge']({},_0x1622e8,_0x548dd0[_0x25b1('0x45')]);var _0x585c37={'where':_0x1622e8[_0x25b1('0x40')]};return db[_0x25b1('0x46')]['count'](_0x585c37)[_0x25b1('0x29')](function(_0x39b4c7){_0x5a4234[_0x25b1('0x25')]=_0x39b4c7;if(_0x548dd0[_0x25b1('0x37')][_0x25b1('0x47')]){_0x1622e8[_0x25b1('0x48')]=[{'all':!![]}];}return db[_0x25b1('0x46')][_0x25b1('0x49')](_0x1622e8);})[_0x25b1('0x29')](function(_0x453352){_0x5a4234[_0x25b1('0x4a')]=_0x453352;return _0x5a4234;})[_0x25b1('0x29')](respondWithFilteredResult(_0x42441d,_0x1622e8))[_0x25b1('0x4b')](handleError(_0x42441d,null));};exports[_0x25b1('0x4c')]=function(_0x21242a,_0x210cef){var _0x103953={'raw':![],'where':{'id':_0x21242a['params']['id']}},_0x210a13={};_0x210a13['model']=_['keys'](db[_0x25b1('0x46')]['rawAttributes']);_0x210a13[_0x25b1('0x37')]=_['keys'](_0x21242a[_0x25b1('0x37')]);_0x210a13[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x210a13[_0x25b1('0x35')],_0x210a13[_0x25b1('0x37')]);_0x103953[_0x25b1('0x3a')]=_['intersection'](_0x210a13[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x21242a[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x103953['attributes']=_0x103953[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x103953[_0x25b1('0x3a')]:_0x210a13['model'];if(_0x21242a[_0x25b1('0x37')]['includeAll']){_0x103953[_0x25b1('0x48')]=[{'all':!![]}];}_0x103953=_['merge']({},_0x103953,_0x21242a['options']);return db[_0x25b1('0x46')][_0x25b1('0x4e')](_0x103953)[_0x25b1('0x29')](handleEntityNotFound(_0x210cef,null))[_0x25b1('0x29')](respondWithResult(_0x210cef,null))['catch'](handleError(_0x210cef,null));};exports[_0x25b1('0x2d')]=function(_0x58e612,_0x7c30da){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x58e612[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x7c30da,null))['then'](removeEntity(_0x7c30da,null))[_0x25b1('0x4b')](handleError(_0x7c30da,null));};exports[_0x25b1('0x50')]=function(_0x354294,_0xf38a9e){return db[_0x25b1('0x46')][_0x25b1('0x50')]()['then'](respondWithResult(_0xf38a9e,null))[_0x25b1('0x4b')](handleError(_0xf38a9e,null));};exports[_0x25b1('0x51')]=function(_0x168931,_0x2311da){var _0x5e367;return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x40d574){return db[_0x25b1('0x46')][_0x25b1('0x51')](_0x168931[_0x25b1('0x54')],{'transaction':_0x40d574})[_0x25b1('0x29')](function(_0x4190a1){_0x5e367=_0x4190a1[_0x25b1('0x2a')]({'plain':!![]});return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x5e367[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5732a1){return createVoicePrefixExtensions(_0x5e367,_0x5732a1,_0x40d574);});});})[_0x25b1('0x29')](function(){var _0x16e61e=_0x168931[_0x25b1('0x57')][_0x25b1('0x2a')]({'plain':!![]});if(!_0x16e61e)throw new Error(_0x25b1('0x58'));if(_0x16e61e[_0x25b1('0x59')]==='user'){var _0x105587=_0x5e367;return db[_0x25b1('0x5a')][_0x25b1('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x16e61e[_0x25b1('0x5b')]},'raw':!![]})['then'](function(_0x5bd36b){if(_0x5bd36b&&_0x5bd36b['autoAssociation']===0x0){return db['UserProfileResource'][_0x25b1('0x51')]({'name':_0x105587['name'],'resourceId':_0x105587['id'],'type':_0x5bd36b[_0x25b1('0x30')],'sectionId':_0x5bd36b['id']},{})[_0x25b1('0x29')](function(){return _0x5e367;});}else{return _0x5e367;}})[_0x25b1('0x4b')](function(_0x439bab){logger[_0x25b1('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439bab);throw _0x439bab;});}return _0x5e367;})[_0x25b1('0x29')](respondWithResult(_0x2311da,null))[_0x25b1('0x4b')](handleError(_0x2311da,null));};function Extension(_0x37b58d,_0x400ec9,_0x5ecc36,_0xcca343){this[_0x25b1('0x5c')]=_0x25b1('0x5d');this[_0x25b1('0x5e')]=_0x37b58d;this[_0x25b1('0x5f')]=_0x5ecc36;this[_0x25b1('0x42')]='system';this[_0x25b1('0x60')]='Voice\x20Prefix\x20Extension';this[_0x25b1('0x61')]=_0x400ec9;this[_0x25b1('0x62')]=_0xcca343;}function createVoicePrefixExtensions(_0x49052b,_0x42a81f,_0x3d8d33){return new BPromise(function(_0x551bed,_0x1351ea){var _0x303049=new Extension(formatPrefixName(_0x49052b[_0x25b1('0x63')]),0x1,_0x25b1('0x64'),_0x25b1('0x65'));_0x303049[_0x25b1('0x66')]=_0x49052b['id'];return db[_0x25b1('0x55')][_0x25b1('0x51')](_0x303049,{'transaction':_0x3d8d33})['then'](function(_0x6f1b1f){var _0x1e2dcb=_0x6f1b1f[_0x25b1('0x2a')]({'plain':!![]});var _0x1da588=_[_0x25b1('0x32')](addVoicePrefixExtensions(_0x49052b,_0x42a81f),function(_0x2b9223){_0x2b9223[_0x25b1('0x56')]=_0x1e2dcb['id'];_0x2b9223[_0x25b1('0x66')]=_0x49052b['id'];return _0x2b9223;});return db['VoiceExtension'][_0x25b1('0x67')](_0x1da588,{'transaction':_0x3d8d33})[_0x25b1('0x29')](function(_0x51f922){if(!_0x51f922){return _0x1351ea(_0x25b1('0x68'));}else{return _0x551bed(_0x51f922);}})[_0x25b1('0x4b')](function(_0x5b71e5){return _0x1351ea(_0x5b71e5);});});;});};function addVoicePrefixExtensions(_0x26e90c,_0x498aca){var _0x44aa87=[];var _0x4e62b5=formatPrefixName(_0x26e90c[_0x25b1('0x63')]);_0x44aa87['push'](new Extension(_0x4e62b5,0x2,_0x25b1('0x69'),_0x25b1('0x6a')+_0x26e90c[_0x25b1('0x30')]));if(_0x26e90c['callerIdAll']){_0x44aa87['push'](new Extension(_0x4e62b5,0x3,_0x25b1('0x69'),_0x25b1('0x6b')+_0x26e90c[_0x25b1('0x6c')]));}else{_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x3,_0x25b1('0x64'),_0x25b1('0x6e')));}_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x4,_0x25b1('0x6f'),_0x498aca[_0x25b1('0x5c')]+','+_0x25b1('0x70')+(0x8+_0x26e90c[_0x25b1('0x30')][_0x25b1('0x3b')])+'}'+','+0x1));return _0x44aa87;}function formatPrefixName(_0x3d06ab){var _0x975b85='_';for(var _0x1c22c4=0x0;_0x1c22c4<_0x3d06ab[_0x25b1('0x3b')];_0x1c22c4++){if(_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)=='-'){_0x975b85+=_0x3d06ab[_0x25b1('0x71')](_0x1c22c4);}else{_0x975b85+='['+_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)+']';}}_0x975b85+='.';return _0x975b85;}exports[_0x25b1('0x28')]=function(_0x15272b,_0x2fe4a5,_0x584499){var _0x1a3368=_0x15272b['body'];_0x1a3368[_0x25b1('0x63')]=_0x25b1('0x72')+_0x1a3368[_0x25b1('0x30')]+'-';return db['sequelize']['transaction'](function(_0x3f9ca7){return db[_0x25b1('0x46')]['update'](_0x1a3368,{'where':{'id':_0x1a3368['id']},'transaction':_0x3f9ca7})[_0x25b1('0x29')](function(){return db[_0x25b1('0x55')][_0x25b1('0x2d')]({'where':{'VoicePrefixId':_0x1a3368['id']},'transaction':_0x3f9ca7})['then'](function(){return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x1a3368[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5f1fef){return createVoicePrefixExtensions(_0x1a3368,_0x5f1fef,_0x3f9ca7);});});});})[_0x25b1('0x29')](function(){return db[_0x25b1('0x46')][_0x25b1('0x73')](_0x1a3368['id']);})[_0x25b1('0x29')](respondWithResult(_0x2fe4a5,null))[_0x25b1('0x4b')](handleError(_0x2fe4a5,null));};exports[_0x25b1('0x74')]=function(_0x4a9fbf,_0x40400e,_0x3f77e0){return db['VoicePrefix']['find']({'where':{'id':_0x4a9fbf[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x40400e,null))[_0x25b1('0x29')](function(_0x3ff99d){if(_0x3ff99d){return _0x3ff99d[_0x25b1('0x74')](_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')],_['omit'](_0x4a9fbf[_0x25b1('0x54')],[_0x25b1('0x75'),'id'])||{})[_0x25b1('0x76')](function(_0x49fac2){for(var _0x1bbb9b=0x0;_0x1bbb9b<_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')]['length'];_0x1bbb9b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x78'),{'UserId':Number(_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')][_0x1bbb9b]),'VoicePrefixId':Number(_0x4a9fbf[_0x25b1('0x4f')]['id'])});}return _0x49fac2;});}})[_0x25b1('0x29')](respondWithResult(_0x40400e,null))[_0x25b1('0x4b')](handleError(_0x40400e,null));};exports[_0x25b1('0x79')]=function(_0x1a07cb,_0x18021f,_0x20b43f){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x1a07cb[_0x25b1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18021f,null))[_0x25b1('0x29')](function(_0x45804b){if(_0x45804b){return _0x45804b[_0x25b1('0x79')](_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')])['then'](function(){if(_['isArray'](_0x1a07cb[_0x25b1('0x37')]['ids'])){for(var _0x3e7f2b=0x0;_0x3e7f2b<_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')][_0x25b1('0x3b')];_0x3e7f2b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query'][_0x25b1('0x75')][_0x3e7f2b]),'VoicePrefixId':Number(_0x1a07cb[_0x25b1('0x4f')]['id'])});}}else{socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query']['ids']),'VoicePrefixId':Number(_0x1a07cb['params']['id'])});}});}})[_0x25b1('0x29')](respondWithStatusCode(_0x18021f,null))[_0x25b1('0x4b')](handleError(_0x18021f,null));};exports['getAgents']=function(_0x49c2d3,_0x271837,_0x102b85){var _0x6bbd44={};var _0x67a4b7={};var _0x54e1a6;var _0x10409f;return db[_0x25b1('0x46')][_0x25b1('0x7b')]({'where':{'id':_0x49c2d3[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x271837,null))[_0x25b1('0x29')](function(_0x175c72){if(_0x175c72){_0x54e1a6=_0x175c72;_0x67a4b7[_0x25b1('0x35')]=_['keys'](db['User'][_0x25b1('0x33')]);_0x67a4b7[_0x25b1('0x37')]=_['keys'](_0x49c2d3['query']);_0x67a4b7[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x67a4b7['model'],_0x67a4b7[_0x25b1('0x37')]);_0x6bbd44[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x67a4b7[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x6bbd44['attributes']=_0x6bbd44[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x6bbd44[_0x25b1('0x3a')]:_0x67a4b7['model'];_0x6bbd44['order']=qs['sort'](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x6bbd44[_0x25b1('0x40')]=qs['filters'](_['pick'](_0x49c2d3[_0x25b1('0x37')],_0x67a4b7[_0x25b1('0x38')]));if(_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x44')]){_0x6bbd44[_0x25b1('0x40')]=_[_0x25b1('0x7c')](_0x6bbd44[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x6bbd44[_0x25b1('0x3a')],function(_0x4c74f8){var _0xb7494b={};_0xb7494b[_0x4c74f8]={'$like':'%'+_0x49c2d3[_0x25b1('0x37')]['filter']+'%'};return _0xb7494b;})});}_0x6bbd44=_['merge']({},_0x6bbd44,_0x49c2d3[_0x25b1('0x45')]);return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x133a5d){if(_0x133a5d){_0x10409f=_0x133a5d[_0x25b1('0x3b')];if(!_0x49c2d3['query']['hasOwnProperty']('nolimit')){_0x6bbd44[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x49c2d3['query'][_0x25b1('0x24')]);_0x6bbd44[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x22')]);}return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x954de5){if(_0x954de5){return _0x954de5?{'count':_0x10409f,'rows':_0x954de5}:null;}})['then'](respondWithResult(_0x271837,null))[_0x25b1('0x4b')](handleError(_0x271837,null));};exports['getTeams']=function(_0x198561,_0x4c2b9f,_0x5c7849){var _0x92b5d6={};var _0x1958c0={};var _0x4428d2;var _0x12e63d;return db[_0x25b1('0x46')]['findOne']({'where':{'id':_0x198561['params']['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x4c2b9f,null))['then'](function(_0x2890c1){if(_0x2890c1){_0x4428d2=_0x2890c1;_0x1958c0[_0x25b1('0x35')]=_[_0x25b1('0x36')](db['Team'][_0x25b1('0x33')]);_0x1958c0['query']=_['keys'](_0x198561['query']);_0x1958c0[_0x25b1('0x38')]=_['intersection'](_0x1958c0[_0x25b1('0x35')],_0x1958c0[_0x25b1('0x37')]);_0x92b5d6[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1958c0[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x198561[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x92b5d6[_0x25b1('0x3a')]=_0x92b5d6[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x92b5d6[_0x25b1('0x3a')]:_0x1958c0[_0x25b1('0x35')];_0x92b5d6[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x198561[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x92b5d6['where']=qs[_0x25b1('0x38')](_['pick'](_0x198561[_0x25b1('0x37')],_0x1958c0[_0x25b1('0x38')]));if(_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]){_0x92b5d6[_0x25b1('0x40')]=_['merge'](_0x92b5d6[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x92b5d6[_0x25b1('0x3a')],function(_0x5af2b6){var _0x339e82={};_0x339e82[_0x5af2b6]={'$like':'%'+_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x339e82;})});}_0x92b5d6=_[_0x25b1('0x7c')]({},_0x92b5d6,_0x198561['options']);return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x270f00){if(_0x270f00){_0x12e63d=_0x270f00['length'];if(!_0x198561[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x92b5d6['limit']=qs[_0x25b1('0x24')](_0x198561[_0x25b1('0x37')]['limit']);_0x92b5d6[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x198561['query'][_0x25b1('0x22')]);}return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x14b909){if(_0x14b909){return _0x14b909?{'count':_0x12e63d,'rows':_0x14b909}:null;}})[_0x25b1('0x29')](respondWithResult(_0x4c2b9f,null))[_0x25b1('0x4b')](handleError(_0x4c2b9f,null));};exports['addTeams']=function(_0x3496a9,_0x30f1e9,_0x18211a){var _0x3038be=_0x3496a9[_0x25b1('0x54')][_0x25b1('0x75')];var _0x310a32;return db[_0x25b1('0x7e')][_0x25b1('0x49')]({'where':{'id':_0x3038be},'attributes':['id'],'include':[{'model':db[_0x25b1('0x7f')],'as':'Agents','attributes':['id',_0x25b1('0x30'),_0x25b1('0x80'),'voicePause','interface'],'raw':!![]}]})[_0x25b1('0x29')](function(_0x96a1b0){if(_0x96a1b0){_0x310a32=_0x96a1b0;var _0x2db4a9=_[_0x25b1('0x81')](_0x96a1b0,function(_0x58e166){var _0x4c6181=_0x58e166['get']({'plain':!![]});return _0x4c6181[_0x25b1('0x82')];});return db[_0x25b1('0x46')][_0x25b1('0x4e')]({'where':{'id':_0x3496a9['params']['id']}})['then'](function(_0x16702d){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x55f740){return _0x16702d[_0x25b1('0x83')](_0x3038be,{'transaction':_0x55f740})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x310a32,function(_0x2da0d9){return db[_0x25b1('0x85')][_0x25b1('0x86')]({'TeamId':_0x2da0d9['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},{'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x2db4a9,function(_0x5c515b){return db[_0x25b1('0x87')][_0x25b1('0x88')]({'where':{'UserId':_0x5c515b['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){_0x2db4a9[_0x25b1('0x89')](function(_0x3c8c4e){socket[_0x25b1('0x77')]('userVoicePrefix:save',{'UserId':_0x3c8c4e['id'],'VoicePrefixId':_0x16702d['id']});});});});});}})[_0x25b1('0x29')](respondWithStatusCode(_0x30f1e9,null))['catch'](handleError(_0x30f1e9,null));};exports[_0x25b1('0x8a')]=function(_0x469405,_0x1010c4,_0x22d3e4){return db['Team']['findAll']({'where':{'id':_0x469405[_0x25b1('0x37')][_0x25b1('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1010c4,null))[_0x25b1('0x29')](function(_0xd05872){var _0x25c07f=_[_0x25b1('0x32')](_0xd05872,'id');var _0x1041d1=[];var _0x1f1160=[];var _0x29d8fe=squel[_0x25b1('0x8b')]();_0x29d8fe[_0x25b1('0x8c')](_0x25b1('0x8d'))[_0x25b1('0x8e')](_0x25b1('0x8f'),'tq')['join'](_0x25b1('0x90'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x25b1('0x40')](_0x25b1('0x91'),_0x469405[_0x25b1('0x4f')]['id']);for(var _0x1354c3=0x0;_0x1354c3<_0xd05872[_0x25b1('0x3b')];_0x1354c3+=0x1){let _0x3ccdab=_0xd05872[_0x1354c3];for(var _0x381a62=0x0;_0x381a62<_0x3ccdab[_0x25b1('0x82')]['length'];_0x381a62+=0x1){let _0x330ae7=_0x3ccdab[_0x25b1('0x82')][_0x381a62];var _0xbe6572=_0x29d8fe[_0x25b1('0x92')]();_0xbe6572[_0x25b1('0x40')](_0x25b1('0x93'),_0x330ae7['id']);_0x1f1160[_0x25b1('0x6d')](db['sequelize'][_0x25b1('0x37')](_0xbe6572[_0x25b1('0x94')](),{'type':db[_0x25b1('0x52')][_0x25b1('0x95')][_0x25b1('0x96')]})['then'](function(_0x4edb48){if(_0x4edb48[_0x25b1('0x3b')]===0x1){return _0x330ae7['id'];}else{var _0x2e924b=_['every'](_['map'](_0x4edb48,_0x25b1('0x97')),function(_0x16d969){return _[_0x25b1('0x98')](_0x25c07f,_0x16d969);});if(_0x2e924b){return _0x330ae7['id'];}}}));}}return BPromise[_0x25b1('0x99')](_0x1f1160)[_0x25b1('0x29')](function(_0x3128bd){_0x1041d1=_(_0x1041d1)[_0x25b1('0x9a')](_0x3128bd)[_0x25b1('0x9b')]()['value']();return db[_0x25b1('0x46')]['find']({'where':{'id':_0x469405['params']['id']}})[_0x25b1('0x29')](function(_0x4cf3e6){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x2c0147){return _0x4cf3e6[_0x25b1('0x8a')](_0x469405[_0x25b1('0x37')][_0x25b1('0x75')],{'transaction':_0x2c0147})[_0x25b1('0x29')](function(){if(!_['isEmpty'](_0x1041d1)){return _0x4cf3e6[_0x25b1('0x79')](_0x1041d1,{'transaction':_0x2c0147});}})[_0x25b1('0x29')](function(){_0x1041d1[_0x25b1('0x89')](function(_0x220f92){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':_0x220f92,'VoicePrefixId':_0x4cf3e6['id']});});});});});});})[_0x25b1('0x29')](respondWithStatusCode(_0x1010c4,null))[_0x25b1('0x4b')](handleError(_0x1010c4,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 2fd4750..0d47267 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 _0x4324=['hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x3a2cb3,_0x5a41da){var _0x5d0994=function(_0x1d24be){while(--_0x1d24be){_0x3a2cb3['push'](_0x3a2cb3['shift']());}};_0x5d0994(++_0x5a41da);}(_0x4324,0x66));var _0x4432=function(_0x4b9806,_0x1517c0){_0x4b9806=_0x4b9806-0x0;var _0x12f4d4=_0x4324[_0x4b9806];return _0x12f4d4;};'use strict';var EventEmitter=require(_0x4432('0x0'));var VoicePrefix=require(_0x4432('0x1'))['db'][_0x4432('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4432('0x3')](0x0);var events={'afterCreate':_0x4432('0x4'),'afterUpdate':_0x4432('0x5'),'afterDestroy':_0x4432('0x6')};function emitEvent(_0x993825){return function(_0x4b68ac,_0x3726cb,_0x21d3a0){VoicePrefixEvents[_0x4432('0x7')](_0x993825+':'+_0x4b68ac['id'],_0x4b68ac);VoicePrefixEvents[_0x4432('0x7')](_0x993825,_0x4b68ac);_0x21d3a0(null);};}for(var e in events){if(events[_0x4432('0x8')](e)){var event=events[e];VoicePrefix[_0x4432('0x9')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x0153=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1f9c1a,_0x20c211){var _0x15cef0=function(_0x4e936f){while(--_0x4e936f){_0x1f9c1a['push'](_0x1f9c1a['shift']());}};_0x15cef0(++_0x20c211);}(_0x0153,0x117));var _0x3015=function(_0x3edc24,_0x35775a){_0x3edc24=_0x3edc24-0x0;var _0x253a3b=_0x0153[_0x3edc24];return _0x253a3b;};'use strict';var EventEmitter=require(_0x3015('0x0'));var VoicePrefix=require(_0x3015('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3015('0x2')](0x0);var events={'afterCreate':_0x3015('0x3'),'afterUpdate':_0x3015('0x4'),'afterDestroy':'remove'};function emitEvent(_0x503e85){return function(_0x593f1a,_0x5741dd,_0x1d07b3){VoicePrefixEvents[_0x3015('0x5')](_0x503e85+':'+_0x593f1a['id'],_0x593f1a);VoicePrefixEvents[_0x3015('0x5')](_0x503e85,_0x593f1a);_0x1d07b3(null);};}for(var e in events){if(events[_0x3015('0x6')](e)){var event=events[e];VoicePrefix[_0x3015('0x7')](e,emitEvent(event));}}module[_0x3015('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ba0dfdc..fbf80b0 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 _0xe252=['../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0xe252,0xe2));var _0x2e25=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xe252[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x2e25('0x0'));var util=require(_0x2e25('0x1'));var logger=require(_0x2e25('0x2'))(_0x2e25('0x3'));var moment=require('moment');var BPromise=require(_0x2e25('0x4'));var rp=require(_0x2e25('0x5'));var fs=require('fs');var path=require(_0x2e25('0x6'));var rimraf=require(_0x2e25('0x7'));var config=require(_0x2e25('0x8'));var attributes=require(_0x2e25('0x9'));module['exports']=function(_0x5025f4,_0x265ca7){return _0x5025f4[_0x2e25('0xa')](_0x2e25('0xb'),attributes,{'tableName':_0x2e25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8efc=['request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5975ce,_0x1174ab){var _0x5b1f80=function(_0x27019e){while(--_0x27019e){_0x5975ce['push'](_0x5975ce['shift']());}};_0x5b1f80(++_0x1174ab);}(_0x8efc,0xf7));var _0xc8ef=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x8efc[_0x54bac5];return _0xc15971;};'use strict';var _=require(_0xc8ef('0x0'));var util=require('util');var logger=require(_0xc8ef('0x1'))(_0xc8ef('0x2'));var moment=require(_0xc8ef('0x3'));var BPromise=require(_0xc8ef('0x4'));var rp=require(_0xc8ef('0x5'));var fs=require('fs');var path=require(_0xc8ef('0x6'));var rimraf=require(_0xc8ef('0x7'));var config=require(_0xc8ef('0x8'));var attributes=require(_0xc8ef('0x9'));module[_0xc8ef('0xa')]=function(_0x44816d,_0x360fd1){return _0x44816d[_0xc8ef('0xb')](_0xc8ef('0xc'),attributes,{'tableName':_0xc8ef('0xd'),'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 79ca04e..b0a90ea 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 _0x639a=['then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x639a,0x1e8));var _0xa639=function(_0x18d399,_0x10dd09){_0x18d399=_0x18d399-0x0;var _0x5735fb=_0x639a[_0x18d399];return _0x5735fb;};'use strict';var _=require(_0xa639('0x0'));var util=require(_0xa639('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa639('0x2'));var fs=require('fs');var Redis=require(_0xa639('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa639('0x4'));var logger=require(_0xa639('0x5'))(_0xa639('0x6'));var config=require(_0xa639('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa639('0x8')]['http']({'port':0x232a});config[_0xa639('0x9')]=_[_0xa639('0xa')](config[_0xa639('0x9')],{'host':_0xa639('0xb'),'port':0x18eb});var socket=require(_0xa639('0xc'))(new Redis(config['redis']));require(_0xa639('0xd'))[_0xa639('0xe')](socket);function respondWithRpcPromise(_0x11aea9,_0x5c03b5,_0x35f0dc){return new BPromise(function(_0x19d8c6,_0x5a96fb){return client[_0xa639('0xf')](_0x11aea9,_0x35f0dc)[_0xa639('0x10')](function(_0x489c05){logger[_0xa639('0x11')](_0xa639('0x12'),_0x5c03b5,'request\x20sent');logger[_0xa639('0x13')](_0xa639('0x14'),_0x5c03b5,_0xa639('0x15'),JSON[_0xa639('0x16')](_0x489c05));if(_0x489c05[_0xa639('0x17')]){if(_0x489c05[_0xa639('0x17')][_0xa639('0x18')]===0x1f4){logger['error'](_0xa639('0x12'),_0x5c03b5,_0x489c05[_0xa639('0x17')][_0xa639('0x19')]);return _0x5a96fb(_0x489c05[_0xa639('0x17')][_0xa639('0x19')]);}logger[_0xa639('0x17')](_0xa639('0x12'),_0x5c03b5,_0x489c05[_0xa639('0x17')][_0xa639('0x19')]);return _0x19d8c6(_0x489c05['error'][_0xa639('0x19')]);}else{logger[_0xa639('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x5c03b5,_0xa639('0x15'));_0x19d8c6(_0x489c05[_0xa639('0x1a')][_0xa639('0x19')]);}})[_0xa639('0x1b')](function(_0x4a8bd2){logger[_0xa639('0x17')](_0xa639('0x12'),_0x5c03b5,_0x4a8bd2);_0x5a96fb(_0x4a8bd2);});});} \ No newline at end of file +var _0x85de=['../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x46428c,_0x20ab75){var _0x16a677=function(_0x2b0817){while(--_0x2b0817){_0x46428c['push'](_0x46428c['shift']());}};_0x16a677(++_0x20ab75);}(_0x85de,0x65));var _0xe85d=function(_0x1796e3,_0x33fd53){_0x1796e3=_0x1796e3-0x0;var _0x48fc92=_0x85de[_0x1796e3];return _0x48fc92;};'use strict';var _=require(_0xe85d('0x0'));var util=require(_0xe85d('0x1'));var moment=require(_0xe85d('0x2'));var BPromise=require(_0xe85d('0x3'));var rs=require(_0xe85d('0x4'));var fs=require('fs');var Redis=require(_0xe85d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe85d('0x6'));var logger=require(_0xe85d('0x7'))(_0xe85d('0x8'));var config=require(_0xe85d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe85d('0xa')]({'port':0x232a});config[_0xe85d('0xb')]=_[_0xe85d('0xc')](config[_0xe85d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe85d('0xd'))(new Redis(config[_0xe85d('0xb')]));require(_0xe85d('0xe'))[_0xe85d('0xf')](socket);function respondWithRpcPromise(_0x46cedc,_0x3c08f7,_0x59bbfb){return new BPromise(function(_0x327be8,_0x16b693){return client[_0xe85d('0x10')](_0x46cedc,_0x59bbfb)[_0xe85d('0x11')](function(_0x3884a2){logger[_0xe85d('0x12')](_0xe85d('0x13'),_0x3c08f7,_0xe85d('0x14'));logger[_0xe85d('0x15')](_0xe85d('0x16'),_0x3c08f7,'request\x20sent',JSON['stringify'](_0x3884a2));if(_0x3884a2[_0xe85d('0x17')]){if(_0x3884a2[_0xe85d('0x17')][_0xe85d('0x18')]===0x1f4){logger[_0xe85d('0x17')](_0xe85d('0x13'),_0x3c08f7,_0x3884a2[_0xe85d('0x17')][_0xe85d('0x19')]);return _0x16b693(_0x3884a2['error']['message']);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x3c08f7,_0x3884a2[_0xe85d('0x17')][_0xe85d('0x19')]);return _0x327be8(_0x3884a2['error'][_0xe85d('0x19')]);}else{logger[_0xe85d('0x12')](_0xe85d('0x13'),_0x3c08f7,'request\x20sent');_0x327be8(_0x3884a2[_0xe85d('0x1a')][_0xe85d('0x19')]);}})['catch'](function(_0x234ed0){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x3c08f7,_0x234ed0);_0x16b693(_0x234ed0);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index e1e3251..4db14de 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 _0x5b02=['register','length','./voicePrefix.events','save','remove','update','removeListener'];(function(_0x518b37,_0x1c562b){var _0x473f55=function(_0x1f75eb){while(--_0x1f75eb){_0x518b37['push'](_0x518b37['shift']());}};_0x473f55(++_0x1c562b);}(_0x5b02,0xe9));var _0x25b0=function(_0x3287a1,_0x3855c8){_0x3287a1=_0x3287a1-0x0;var _0x1ddfbd=_0x5b02[_0x3287a1];return _0x1ddfbd;};'use strict';var VoicePrefixEvents=require(_0x25b0('0x0'));var events=[_0x25b0('0x1'),_0x25b0('0x2'),_0x25b0('0x3')];function createListener(_0x4ef71c,_0x4cb227){return function(_0x2b5f2d){_0x4cb227['emit'](_0x4ef71c,_0x2b5f2d);};}function removeListener(_0x3e1d20,_0x31c9c2){return function(){VoicePrefixEvents[_0x25b0('0x4')](_0x3e1d20,_0x31c9c2);};}exports[_0x25b0('0x5')]=function(_0x2d84a9){for(var _0x4eea55=0x0,_0x1d82c6=events[_0x25b0('0x6')];_0x4eea55<_0x1d82c6;_0x4eea55++){var _0x49ef3a=events[_0x4eea55];var _0x412954=createListener('voicePrefix:'+_0x49ef3a,_0x2d84a9);VoicePrefixEvents['on'](_0x49ef3a,_0x412954);}}; \ No newline at end of file +var _0xeea4=['./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xeea4,0x19e));var _0x4eea=function(_0x7d0bed,_0x166181){_0x7d0bed=_0x7d0bed-0x0;var _0x1527ab=_0xeea4[_0x7d0bed];return _0x1527ab;};'use strict';var VoicePrefixEvents=require(_0x4eea('0x0'));var events=[_0x4eea('0x1'),_0x4eea('0x2'),_0x4eea('0x3')];function createListener(_0x28e57e,_0x38a9e8){return function(_0x2a47d5){_0x38a9e8[_0x4eea('0x4')](_0x28e57e,_0x2a47d5);};}function removeListener(_0x27997a,_0x5c02db){return function(){VoicePrefixEvents[_0x4eea('0x5')](_0x27997a,_0x5c02db);};}exports['register']=function(_0x2df4ae){for(var _0x383566=0x0,_0x3d5aa8=events['length'];_0x383566<_0x3d5aa8;_0x383566++){var _0x1a2e5e=events[_0x383566];var _0x44116a=createListener('voicePrefix:'+_0x1a2e5e,_0x2df4ae);VoicePrefixEvents['on'](_0x1a2e5e,_0x44116a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index ab81f28..0d5e440 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(_0x5838e2,_0x12b08b){var _0x501bc7=function(_0x157a70){while(--_0x157a70){_0x5838e2['push'](_0x5838e2['shift']());}};_0x501bc7(++_0x12b08b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x28e96c,_0x2d75ed){var _0x1db3d5=function(_0x101ebd){while(--_0x101ebd){_0x28e96c['push'](_0x28e96c['shift']());}};_0x1db3d5(++_0x2d75ed);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b635a,_0x8d01b2){_0x4b635a=_0x4b635a-0x0;var _0x3de488=_0xb10b[_0x4b635a];return _0x3de488;};'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 3ddb13a..bf71780 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 _0x25f7=['Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\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','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','name','ENUM','inbound','STRING','default','ringall','fewestcalls','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','outbound','preview','booked','includes','INTEGER','yes','all','TEXT','periodic_announce','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x25f7,0x74));var _0x725f=function(_0x3ec926,_0x5ef474){_0x3ec926=_0x3ec926-0x0;var _0x2c2ea1=_0x25f7[_0x3ec926];return _0x2c2ea1;};'use strict';var Sequelize=require(_0x725f('0x0'));module[_0x725f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x725f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x725f('0x5')],'defaultValue':_0x725f('0x6')},'announce':{'type':Sequelize[_0x725f('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x725f('0x3')]('rr',_0x725f('0x7'),'leastrecent',_0x725f('0x8'),_0x725f('0x9'),_0x725f('0xa'),'linear',_0x725f('0xb'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x2fe19d){this[_0x725f('0xc')](_0x725f('0xd'),_0x2fe19d?_0x2fe19d:_0x725f('0xa'));},'get':function(){var _0x42d19d=this[_0x725f('0xe')](_0x725f('0xf'));var _0x3d7c19=this[_0x725f('0xe')](_0x725f('0x10'));var _0x40618f=this[_0x725f('0xe')]('strategy');if(_0x42d19d===_0x725f('0x11')){if(_0x3d7c19===_0x725f('0x12')){return null;}if(_0x3d7c19===_0x725f('0x13')&&![_0x725f('0xa'),'roundrobin'][_0x725f('0x14')](_0x40618f)){this[_0x725f('0xc')]('strategy',_0x725f('0xa'));}}return _0x40618f;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x725f('0x15')](0xb)},'timeout':{'type':Sequelize[_0x725f('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x725f('0x5')]},'weight':{'type':Sequelize[_0x725f('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x725f('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x725f('0x16'),'no'),'defaultValue':_0x725f('0x16')},'autopause':{'type':Sequelize[_0x725f('0x3')]('yes','no',_0x725f('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x725f('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x725f('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x725f('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x725f('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x725f('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x725f('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x725f('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x725f('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x725f('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x725f('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x725f('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x725f('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x725f('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x725f('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x725f('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x725f('0x5')]},'queue_quantity1':{'type':Sequelize[_0x725f('0x5')]},'queue_quantity2':{'type':Sequelize[_0x725f('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x725f('0x5')]},'queue_less_than':{'type':Sequelize[_0x725f('0x5')]},'periodic_announce':{'type':Sequelize[_0x725f('0x18')],'set':function(_0xd6db83){this[_0x725f('0xc')](_0x725f('0x19'),_0xd6db83?_0xd6db83[_0x725f('0x1a')](','):[]);},'get':function(){return this[_0x725f('0xe')](_0x725f('0x19'))?this['getDataValue']('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x725f('0x16'),'set':function(_0x3cb75e){this[_0x725f('0xc')](_0x725f('0x1b'),_0x3cb75e?_0x3cb75e[_0x725f('0x1a')](','):undefined);},'get':function(){return this[_0x725f('0xe')](_0x725f('0x1b'))?this[_0x725f('0xe')](_0x725f('0x1b'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x725f('0x5')],'defaultValue':'no','set':function(_0x21c74f){this[_0x725f('0xc')]('leavewhenempty',_0x21c74f?_0x21c74f['join'](','):undefined);},'get':function(){return this[_0x725f('0xe')](_0x725f('0x1c'))?this[_0x725f('0xe')](_0x725f('0x1c'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x725f('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x725f('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x725f('0x5')]},'description':{'type':Sequelize[_0x725f('0x5')]},'acw':{'type':Sequelize[_0x725f('0x1d')],'defaultValue':0x0,'set':function(_0x3f6b44){this[_0x725f('0xc')](_0x725f('0x1e'),_0x3f6b44);if(_0x3f6b44){if(this[_0x725f('0xe')](_0x725f('0x1f'))<0x2){this[_0x725f('0xc')](_0x725f('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x725f('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x725f('0x1d')],'defaultValue':0x0,'comment':_0x725f('0x20')},'dialMethod':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x12'),_0x725f('0x21'),_0x725f('0x22'),_0x725f('0x23'),'booked'),'defaultValue':_0x725f('0x21'),'comment':_0x725f('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x725f('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x725f('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x725f('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x725f('0x27')},'dialPowerLevel':{'type':Sequelize[_0x725f('0x28')](0x2)[_0x725f('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x725f('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x725f('0x2a'),_0x725f('0x2b')),'defaultValue':_0x725f('0x2b'),'comment':_0x725f('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x725f('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x725f('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x725f('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x725f('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x725f('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x725f('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x725f('0x5')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x725f('0x5')],'comment':_0x725f('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x725f('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x725f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x725f('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x725f('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x725f('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x3,'comment':_0x725f('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x725f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x725f('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x725f('0x36')},'dialTimezone':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x725f('0x5')],'defaultValue':_0x725f('0x37')},'dialPrefix':{'type':Sequelize[_0x725f('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x38'),_0x725f('0x39'),_0x725f('0x3a')),'defaultValue':_0x725f('0x38')},'dialAMDActive':{'type':Sequelize[_0x725f('0x1d')],'defaultValue':0x0,'comment':_0x725f('0x3b')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x725f('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x725f('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x725f('0x15')](0x9)[_0x725f('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x725f('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x725f('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x725f('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x725f('0x15')](0x9)[_0x725f('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x725f('0x15')](0x9)[_0x725f('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x725f('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x725f('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x725f('0x15')](0x9)[_0x725f('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x725f('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x725f('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x725f('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x725f('0x15')](0x9)[_0x725f('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x725f('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x725f('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x725f('0x1d')],'defaultValue':0x0,'comment':_0x725f('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x725f('0x3')](_0x725f('0x45'),'ASC'),'defaultValue':_0x725f('0x45')},'dialQueueProject2':{'type':Sequelize[_0x725f('0x5')],'comment':_0x725f('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x725f('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x725f('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x725f('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x725f('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x725f('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x725f('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x725f('0x15')](0x5)[_0x725f('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x725f('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x725f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x725f('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x725f('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x725f('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x725f('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x725f('0x15')],'allowNull':!![],'comment':_0x725f('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x725f('0x1d')],'defaultValue':![],'comment':_0x725f('0x4e'),'set':function(_0x53dea6){if(!_0x53dea6)this['setDataValue'](_0x725f('0x4f'),null);this[_0x725f('0xc')]('mandatoryDisposition',_0x53dea6);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x725f('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x725f('0x15')](0x3)[_0x725f('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x659b=['sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','random','rrmemory','linear','type','dialMethod','strategy','preview','booked','roundrobin','includes','setDataValue','INTEGER','yes','once','TEXT','join','getDataValue','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','power','progressive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId'];(function(_0xed49aa,_0x4b69ff){var _0x55c1c6=function(_0x4dbe65){while(--_0x4dbe65){_0xed49aa['push'](_0xed49aa['shift']());}};_0x55c1c6(++_0x4b69ff);}(_0x659b,0x1e0));var _0xb659=function(_0x428df4,_0x44e5a5){_0x428df4=_0x428df4-0x0;var _0x58b721=_0x659b[_0x428df4];return _0x58b721;};'use strict';var Sequelize=require(_0xb659('0x0'));module[_0xb659('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb659('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x4'),_0xb659('0x5')),'allowNull':![],'defaultValue':_0xb659('0x4')},'musiconhold':{'type':Sequelize[_0xb659('0x6')],'defaultValue':_0xb659('0x7')},'announce':{'type':Sequelize[_0xb659('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb659('0x3')]('rr',_0xb659('0x8'),_0xb659('0x9'),'fewestcalls',_0xb659('0xa'),_0xb659('0xb'),_0xb659('0xc'),'wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x19e708){this['setDataValue']('strategy',_0x19e708?_0x19e708:_0xb659('0xb'));},'get':function(){var _0x1d5a04=this['getDataValue'](_0xb659('0xd'));var _0x388e15=this['getDataValue'](_0xb659('0xe'));var _0x1a1682=this['getDataValue'](_0xb659('0xf'));if(_0x1d5a04===_0xb659('0x5')){if(_0x388e15===_0xb659('0x10')){return null;}if(_0x388e15===_0xb659('0x11')&&![_0xb659('0xb'),_0xb659('0x12')][_0xb659('0x13')](_0x1a1682)){this[_0xb659('0x14')]('strategy','rrmemory');}}return _0x1a1682;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb659('0x6')]},'weight':{'type':Sequelize[_0xb659('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb659('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb659('0x3')]('yes','no'),'defaultValue':_0xb659('0x16')},'autopause':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xb659('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb659('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xb659('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xb659('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb659('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb659('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb659('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb659('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb659('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xb659('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xb659('0x16'),'no'),'defaultValue':_0xb659('0x16')},'announce_holdtime':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no',_0xb659('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb659('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb659('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb659('0x6')]},'queue_youarenext':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb659('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb659('0x6')]},'queue_quantity1':{'type':Sequelize[_0xb659('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xb659('0x18')],'set':function(_0x1c9764){this[_0xb659('0x14')]('periodic_announce',_0x1c9764?_0x1c9764[_0xb659('0x19')](','):[]);},'get':function(){return this[_0xb659('0x1a')](_0xb659('0x1b'))?this['getDataValue'](_0xb659('0x1b'))[_0xb659('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xb659('0x6')],'defaultValue':_0xb659('0x16'),'set':function(_0x18d315){this[_0xb659('0x14')](_0xb659('0x1d'),_0x18d315?_0x18d315[_0xb659('0x19')](','):undefined);},'get':function(){return this[_0xb659('0x1a')](_0xb659('0x1d'))?this['getDataValue']('joinempty')[_0xb659('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb659('0x6')],'defaultValue':'no','set':function(_0x565cf1){this[_0xb659('0x14')](_0xb659('0x1e'),_0x565cf1?_0x565cf1[_0xb659('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xb659('0x1e'))?this[_0xb659('0x1a')](_0xb659('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb659('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xb659('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb659('0x6')]},'description':{'type':Sequelize[_0xb659('0x6')]},'acw':{'type':Sequelize[_0xb659('0x1f')],'defaultValue':0x0,'set':function(_0x137076){this[_0xb659('0x14')]('acw',_0x137076);if(_0x137076){if(this[_0xb659('0x1a')](_0xb659('0x20'))<0x2){this[_0xb659('0x14')](_0xb659('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb659('0x21')},'dialMethod':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x10'),'progressive',_0xb659('0x22'),'predictive','booked'),'defaultValue':_0xb659('0x23'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xb659('0x15')](0x4)[_0xb659('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb659('0x25')},'dialLimitQueue':{'type':Sequelize[_0xb659('0x15')](0x4)[_0xb659('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb659('0x26')},'dialPowerLevel':{'type':Sequelize[_0xb659('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xb659('0x28'),_0xb659('0x29')),'defaultValue':_0xb659('0x29'),'comment':_0xb659('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xb659('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb659('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xb659('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb659('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb659('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb659('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xb659('0x6')],'defaultValue':_0xb659('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x2f')},'dialQueueProject':{'type':Sequelize[_0xb659('0x6')],'comment':_0xb659('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb659('0x15')](0x5)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb659('0x15')](0x5)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x3,'comment':_0xb659('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb659('0x15')](0x5)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb659('0x34')},'dialTimezone':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb659('0x6')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xb659('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb659('0x3')](_0xb659('0x35'),_0xb659('0x36'),_0xb659('0x37')),'defaultValue':_0xb659('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb659('0x38')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb659('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb659('0x39')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xb659('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb659('0x15')](0x9)[_0xb659('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb659('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xb659('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb659('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0xb659('0x15')](0x9)[_0xb659('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb659('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb659('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb659('0x15')](0x9)[_0xb659('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb659('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xb659('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb659('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb659('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xb659('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb659('0x3f')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb659('0x40')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xb659('0x41'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xb659('0x6')],'comment':_0xb659('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb659('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb659('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xb659('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb659('0x42')},'dialCutDigit':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb659('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb659('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb659('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0xb659('0x15')](0x5)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb659('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb659('0x15')](0x5)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb659('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb659('0x15')](0x5)[_0xb659('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb659('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb659('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb659('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb659('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xb659('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x553379){if(!_0x553379)this[_0xb659('0x14')](_0xb659('0x4f'),null);this[_0xb659('0x14')]('mandatoryDisposition',_0x553379);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xb659('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xb659('0x15')](0x3)[_0xb659('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xb659('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 a7f607f..91ac5ff 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 _0xa41a=['createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','filters','nolimit','order','sort','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','inbound','QueueCampaigns','filter','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','rawAttributes','key','where','include','VoiceQueue','findAll','rows','catch','params','model','query','keys','attributes','intersection','fields','length','merge','options','create','body','user','role','VoiceQueues','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit'];(function(_0x61c47c,_0x3f9767){var _0x4491f4=function(_0x4d760e){while(--_0x4d760e){_0x61c47c['push'](_0x61c47c['shift']());}};_0x4491f4(++_0x3f9767);}(_0xa41a,0x6b));var _0xaa41=function(_0x524a57,_0x2b943c){_0x524a57=_0x524a57-0x0;var _0x237eef=_0xa41a[_0x524a57];return _0x237eef;};'use strict';var moment=require(_0xaa41('0x0'));var BPromise=require(_0xaa41('0x1'));var util=require('util');var _=require(_0xaa41('0x2'));var squel=require(_0xaa41('0x3'));var Redis=require(_0xaa41('0x4'));var qs=require(_0xaa41('0x5'));var logger=require(_0xaa41('0x6'))(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var db=require(_0xaa41('0x9'))['db'];config['redis']=_[_0xaa41('0xa')](config[_0xaa41('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xb')]));require(_0xaa41('0xc'))['register'](socket);function respondWithStatusCode(_0x31df43,_0x33f66b){_0x33f66b=_0x33f66b||0xcc;return function(_0x409dab){if(_0x409dab){return _0x31df43[_0xaa41('0xd')](_0x33f66b);}return _0x31df43[_0xaa41('0xe')](_0x33f66b)[_0xaa41('0xf')]();};}function respondWithResult(_0x806f08,_0x423a19){_0x423a19=_0x423a19||0xc8;return function(_0x1c291e){if(_0x1c291e){return _0x806f08['status'](_0x423a19)[_0xaa41('0x10')](_0x1c291e);}};}function respondWithFilteredResult(_0x10cda9,_0x524cab){return function(_0x54827c){if(_0x54827c){var _0x1d0a54=typeof _0x524cab['offset']===_0xaa41('0x11')&&typeof _0x524cab[_0xaa41('0x12')]===_0xaa41('0x11');var _0x889d44=_0x54827c[_0xaa41('0x13')];var _0x4eaf81=_0x1d0a54?0x0:_0x524cab[_0xaa41('0x14')];var _0x178170=_0x1d0a54?_0x54827c[_0xaa41('0x13')]:_0x524cab[_0xaa41('0x14')]+_0x524cab[_0xaa41('0x12')];var _0x2005ae;if(_0x178170>=_0x889d44){_0x178170=_0x889d44;_0x2005ae=0xc8;}else{_0x2005ae=0xce;}_0x10cda9[_0xaa41('0xe')](_0x2005ae);return _0x10cda9['set'](_0xaa41('0x15'),_0x4eaf81+'-'+_0x178170+'/'+_0x889d44)[_0xaa41('0x10')](_0x54827c);}return null;};}function saveUpdates(_0x4210fa){return function(_0x391b01){if(_0x391b01){return _0x391b01[_0xaa41('0x16')](_0x4210fa)[_0xaa41('0x17')](function(_0x29efe5){return _0x29efe5;});}return null;};}function removeEntity(_0x46e6d3){return function(_0x150ddf){if(_0x150ddf){return _0x150ddf['destroy']()['then'](function(){var _0x1f502a=_0x150ddf[_0xaa41('0x18')]({'plain':!![]});var _0x35c753=[{'name':'VoiceQueues','value':_0xaa41('0x19'),'ignore':![]},{'name':_0xaa41('0x1a'),'value':'outbound','ignore':![]}];var _0x513c61=_(_0x35c753)[_0xaa41('0x1b')]('ignore')[_0xaa41('0x1c')](_0xaa41('0x1d'))[_0xaa41('0x1d')]();if(_[_0xaa41('0x1e')](_0x513c61,_0x1f502a[_0xaa41('0x1f')])){return;}var _0x4eb01f=_[_0xaa41('0x20')](_0x35c753,[_0xaa41('0x1d'),_0x1f502a[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x22')][_0xaa41('0x23')]({'where':{'type':_0x4eb01f,'resourceId':_0x1f502a['id']}})['then'](function(){return _0x150ddf;});})['then'](function(){_0x46e6d3[_0xaa41('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493a10){return function(_0x12e362){if(!_0x12e362){_0x493a10['sendStatus'](0x194);}return _0x12e362;};}function handleError(_0x536bed,_0x2d0ac0){_0x2d0ac0=_0x2d0ac0||0x1f4;return function(_0x9c8c21){logger[_0xaa41('0x24')](_0x9c8c21[_0xaa41('0x25')]);if(_0x9c8c21[_0xaa41('0x21')]){delete _0x9c8c21[_0xaa41('0x21')];}_0x536bed['status'](_0x2d0ac0)[_0xaa41('0x26')](_0x9c8c21);};}exports[_0xaa41('0x27')]=function(_0x63c18c,_0x9a16e3){var _0x1d8c2b={};var _0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x1c')](db['VoiceQueue'][_0xaa41('0x28')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x1f')][_0xaa41('0x29')]};});_0x1d8c2b=qs['getOptions'](_0x30f88e,_0x63c18c);var _0x392b5d={'where':_0x1d8c2b[_0xaa41('0x2a')]};return db['VoiceQueue']['count'](_0x392b5d)['then'](function(_0x1cf3da){_0x4466a3[_0xaa41('0x13')]=_0x1cf3da;_0x1d8c2b[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x63c18c['query']);return db[_0xaa41('0x2c')][_0xaa41('0x2d')](_0x1d8c2b);})[_0xaa41('0x17')](function(_0x4de770){_0x4466a3[_0xaa41('0x2e')]=_0x4de770;return _0x4466a3;})[_0xaa41('0x17')](respondWithFilteredResult(_0x9a16e3,_0x1d8c2b))[_0xaa41('0x2f')](handleError(_0x9a16e3,null));};exports['show']=function(_0x252c62,_0x374117){var _0x57fe1d={'raw':![],'where':{'id':_0x252c62[_0xaa41('0x30')]['id']}},_0x23eb50={};_0x23eb50[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x2c')]['rawAttributes']);_0x23eb50[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x252c62[_0xaa41('0x32')]);_0x23eb50['filters']=_['intersection'](_0x23eb50['model'],_0x23eb50[_0xaa41('0x32')]);_0x57fe1d[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x23eb50[_0xaa41('0x31')],qs['fields'](_0x252c62['query'][_0xaa41('0x36')]));_0x57fe1d[_0xaa41('0x34')]=_0x57fe1d[_0xaa41('0x34')][_0xaa41('0x37')]?_0x57fe1d[_0xaa41('0x34')]:_0x23eb50[_0xaa41('0x31')];if(_0x252c62[_0xaa41('0x32')]['includeAll']){_0x57fe1d[_0xaa41('0x2b')]=[{'all':!![]}];}_0x57fe1d=_[_0xaa41('0x38')]({},_0x57fe1d,_0x252c62[_0xaa41('0x39')]);return db[_0xaa41('0x2c')]['find'](_0x57fe1d)['then'](handleEntityNotFound(_0x374117,null))[_0xaa41('0x17')](respondWithResult(_0x374117,null))[_0xaa41('0x2f')](handleError(_0x374117,null));};exports['create']=function(_0x4101ab,_0x563687){return db[_0xaa41('0x2c')][_0xaa41('0x3a')](_0x4101ab[_0xaa41('0x3b')],{})[_0xaa41('0x17')](function(_0x3e6cac){var _0x12ba1a=_0x4101ab[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x12ba1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ba1a[_0xaa41('0x3d')]===_0xaa41('0x3c')){var _0x35c685=_0x3e6cac[_0xaa41('0x18')]({'plain':!![]});var _0xc84fb8=[{'name':_0xaa41('0x3e'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0x4f9086=_[_0xaa41('0x20')](_0xc84fb8,[_0xaa41('0x1d'),_0x35c685[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db[_0xaa41('0x40')][_0xaa41('0x20')]({'where':{'name':_0x4f9086,'userProfileId':_0x12ba1a[_0xaa41('0x41')]},'raw':!![]})['then'](function(_0x124992){if(_0x124992&&_0x124992['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x3a')]({'name':_0x35c685['name'],'resourceId':_0x35c685['id'],'type':_0x124992['name'],'sectionId':_0x124992['id']},{})['then'](function(){return _0x3e6cac;});}else{return _0x3e6cac;}})[_0xaa41('0x2f')](function(_0x525b09){logger[_0xaa41('0x24')](_0xaa41('0x42'),_0x525b09);throw _0x525b09;});}return _0x3e6cac;})['then'](respondWithResult(_0x563687,0xc9))['catch'](handleError(_0x563687,null));};exports[_0xaa41('0x43')]=function(_0x1b7b97,_0x1bb973){var _0x2af8ba={'where':{'id':_0x1b7b97[_0xaa41('0x30')]['id']}},_0x3fe1a9={};_0x3fe1a9[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x2c')]['rawAttributes']);_0x2af8ba[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x3fe1a9[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x36')]));_0x2af8ba['attributes']=_0x2af8ba[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2af8ba[_0xaa41('0x34')]:_0x3fe1a9[_0xaa41('0x31')];if(_0x1b7b97['query'][_0xaa41('0x44')]){_0x2af8ba['include']=[{'all':!![]}];}_0x2af8ba=_['merge']({},_0x2af8ba,_0x1b7b97[_0xaa41('0x39')]);return db[_0xaa41('0x2c')][_0xaa41('0x20')](_0x2af8ba)['then'](handleEntityNotFound(_0x1bb973,null))[_0xaa41('0x17')](function(_0x3e1a73){if(_0x3e1a73){var _0x853ccb=_0x3e1a73['get']({'plain':!![]});_0x853ccb=qs[_0xaa41('0x45')](_0x853ccb,['id',_0xaa41('0x46'),_0xaa41('0x47')]);_0x1b7b97[_0xaa41('0x3b')]=_[_0xaa41('0x45')](_0x1b7b97[_0xaa41('0x3b')],['id',_0xaa41('0x46'),_0xaa41('0x47')]);return db['VoiceQueue'][_0xaa41('0x3a')](_['merge'](_0x853ccb,_0x1b7b97['body']),{'include':_0x1b7b97[_0xaa41('0x32')][_0xaa41('0x44')]?[{'all':!![]}]:undefined})[_0xaa41('0x17')](function(_0x11f7d9){var _0x14aab0=_0x1b7b97[_0xaa41('0x3c')][_0xaa41('0x18')]({'plain':!![]});if(!_0x14aab0)throw new Error(_0xaa41('0x48'));if(_0x14aab0['role']===_0xaa41('0x3c')){var _0x14b0f0=_0x11f7d9[_0xaa41('0x18')]({'plain':!![]});var _0x4f9e92=[{'name':_0xaa41('0x3e'),'value':_0xaa41('0x19')},{'name':'QueueCampaigns','value':_0xaa41('0x3f')}];var _0xd36d1a=_[_0xaa41('0x20')](_0x4f9e92,['value',_0x14b0f0[_0xaa41('0x1f')]])[_0xaa41('0x21')];return db['UserProfileSection']['find']({'where':{'name':_0xd36d1a,'userProfileId':_0x14aab0[_0xaa41('0x41')]},'raw':!![]})[_0xaa41('0x17')](function(_0x3a29d2){if(_0x3a29d2&&_0x3a29d2['autoAssociation']===0x0){return db[_0xaa41('0x22')][_0xaa41('0x3a')]({'name':_0x14b0f0[_0xaa41('0x21')],'resourceId':_0x14b0f0['id'],'type':_0x3a29d2[_0xaa41('0x21')],'sectionId':_0x3a29d2['id']},{})[_0xaa41('0x17')](function(){return _0x11f7d9;});}else{return _0x11f7d9;}})['catch'](function(_0x2ae70c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ae70c);throw _0x2ae70c;});}return _0x11f7d9;});}})[_0xaa41('0x17')](respondWithResult(_0x1bb973,0xc9))['catch'](handleError(_0x1bb973,null));};exports[_0xaa41('0x16')]=function(_0xbbf261,_0x169ddf){if(_0xbbf261['body']['id']){delete _0xbbf261[_0xaa41('0x3b')]['id'];}return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0xbbf261[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x169ddf,null))[_0xaa41('0x17')](saveUpdates(_0xbbf261[_0xaa41('0x3b')],null))[_0xaa41('0x17')](respondWithResult(_0x169ddf,null))[_0xaa41('0x2f')](handleError(_0x169ddf,null));};exports['destroy']=function(_0x35a09e,_0x40cdfc){return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x35a09e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x40cdfc,null))[_0xaa41('0x17')](removeEntity(_0x40cdfc,null))[_0xaa41('0x2f')](handleError(_0x40cdfc,null));};exports[_0xaa41('0x49')]=function(_0xfbe748,_0x320ce7){var _0x5ea056={'raw':![],'where':{}};var _0x55a85c={};var _0x5cb34d={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xfbe748['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x320ce7,null))['then'](function(_0x576e6e){if(_0x576e6e){_0x55a85c[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x4a')][_0xaa41('0x28')]);_0x55a85c['query']=_[_0xaa41('0x33')](_0xfbe748[_0xaa41('0x32')]);_0x55a85c[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],_0x55a85c[_0xaa41('0x32')]);_0x5ea056[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x55a85c[_0xaa41('0x31')],qs['fields'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5ea056['attributes']=_0x5ea056['attributes']['length']?_0x5ea056[_0xaa41('0x34')]:_0x55a85c['model'];if(!_0xfbe748[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x5ea056[_0xaa41('0x12')]=qs['limit'](_0xfbe748[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5ea056[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xfbe748['query']['offset']);}_0x5ea056[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfbe748['query']['sort']);_0x5ea056[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfbe748[_0xaa41('0x32')],_0x55a85c[_0xaa41('0x4b')]));_0x5ea056['where'][_0xaa41('0x50')]=_0x576e6e['id'];if(_0xfbe748['query']['filter']){_0x5ea056['where']=_[_0xaa41('0x38')](_0x5ea056[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5ea056['attributes'],function(_0x229297){var _0x2adf93={};_0x2adf93[_0x229297]={'$like':'%'+_0xfbe748[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x2adf93;})});}_0x5ea056=_[_0xaa41('0x38')]({},_0x5ea056,_0xfbe748[_0xaa41('0x39')]);return db[_0xaa41('0x4a')]['count']({'where':_0x5ea056[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x40b47c){_0x5cb34d[_0xaa41('0x13')]=_0x40b47c;if(_0xfbe748['query'][_0xaa41('0x44')]){_0x5ea056['include']=[{'all':!![]}];}return db[_0xaa41('0x4a')][_0xaa41('0x2d')](_0x5ea056);})[_0xaa41('0x17')](function(_0x143ef0){_0x5cb34d['rows']=_0x143ef0;return _0x5cb34d;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x320ce7,_0x5ea056))[_0xaa41('0x2f')](handleError(_0x320ce7,null));};exports[_0xaa41('0x51')]=function(_0x304aad,_0x59052d){var _0x140d78={'raw':!![],'where':{}};var _0x50197b={};var _0x55d380={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x304aad[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x59052d,null))[_0xaa41('0x17')](function(_0x582d79){if(_0x582d79){_0x50197b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x52')][_0xaa41('0x28')]);_0x50197b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x304aad[_0xaa41('0x32')]);_0x50197b['filters']=_[_0xaa41('0x35')](_0x50197b[_0xaa41('0x31')],_0x50197b[_0xaa41('0x32')]);_0x140d78['attributes']=_['intersection'](_0x50197b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x304aad['query'][_0xaa41('0x36')]));_0x140d78[_0xaa41('0x34')]=_0x140d78['attributes'][_0xaa41('0x37')]?_0x140d78[_0xaa41('0x34')]:_0x50197b[_0xaa41('0x31')];if(!_0x304aad[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x140d78[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x304aad['query']['limit']);_0x140d78[_0xaa41('0x14')]=qs['offset'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x140d78[_0xaa41('0x4d')]=qs['sort'](_0x304aad[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x140d78[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x304aad[_0xaa41('0x32')],_0x50197b['filters']));_0x140d78[_0xaa41('0x2a')]['VoiceQueueId']=_0x582d79['id'];if(_0x304aad['query'][_0xaa41('0x1b')]){_0x140d78[_0xaa41('0x2a')]=_['merge'](_0x140d78['where'],{'$or':_[_0xaa41('0x1c')](_0x140d78[_0xaa41('0x34')],function(_0x3c189d){var _0x447183={};_0x447183[_0x3c189d]={'$like':'%'+_0x304aad['query'][_0xaa41('0x1b')]+'%'};return _0x447183;})});}_0x140d78=_[_0xaa41('0x38')]({},_0x140d78,_0x304aad[_0xaa41('0x39')]);return db['CmHopperHistory'][_0xaa41('0x13')]({'where':_0x140d78[_0xaa41('0x2a')]})[_0xaa41('0x17')](function(_0x5697b6){_0x55d380[_0xaa41('0x13')]=_0x5697b6;if(_0x304aad['query']['includeAll']){_0x140d78[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x52')]['findAll'](_0x140d78);})[_0xaa41('0x17')](function(_0x9e8ebb){_0x55d380[_0xaa41('0x2e')]=_0x9e8ebb;return _0x55d380;});}})['then'](respondWithFilteredResult(_0x59052d,_0x140d78))[_0xaa41('0x2f')](handleError(_0x59052d,null));};exports[_0xaa41('0x54')]=function(_0x1a2deb,_0x16dcac){var _0x38f5d0={'raw':!![],'where':{}};var _0x4e087d={};var _0x24eb2e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x1a2deb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x16dcac,null))[_0xaa41('0x17')](function(_0x33ec81){if(_0x33ec81){_0x4e087d[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x56')][_0xaa41('0x28')]);_0x4e087d[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x1a2deb['query']);_0x4e087d[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x4e087d['model'],_0x4e087d[_0xaa41('0x32')]);_0x38f5d0['attributes']=_[_0xaa41('0x35')](_0x4e087d[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x36')]));_0x38f5d0[_0xaa41('0x34')]=_0x38f5d0[_0xaa41('0x34')]['length']?_0x38f5d0[_0xaa41('0x34')]:_0x4e087d[_0xaa41('0x31')];if(!_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x38f5d0[_0xaa41('0x12')]=qs['limit'](_0x1a2deb[_0xaa41('0x32')][_0xaa41('0x12')]);_0x38f5d0[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x1a2deb[_0xaa41('0x32')]['offset']);}_0x38f5d0[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x1a2deb['query'][_0xaa41('0x4e')]);_0x38f5d0[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x1a2deb[_0xaa41('0x32')],_0x4e087d[_0xaa41('0x4b')]));_0x38f5d0[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x33ec81['id'];if(_0x1a2deb['query'][_0xaa41('0x1b')]){_0x38f5d0[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x38f5d0[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x38f5d0[_0xaa41('0x34')],function(_0x5489be){var _0x56f5ff={};_0x56f5ff[_0x5489be]={'$like':'%'+_0x1a2deb['query'][_0xaa41('0x1b')]+'%'};return _0x56f5ff;})});}_0x38f5d0=_[_0xaa41('0x38')]({},_0x38f5d0,_0x1a2deb['options']);return db[_0xaa41('0x56')][_0xaa41('0x13')]({'where':_0x38f5d0['where']})[_0xaa41('0x17')](function(_0x1da898){_0x24eb2e[_0xaa41('0x13')]=_0x1da898;if(_0x1a2deb[_0xaa41('0x32')]['includeAll']){_0x38f5d0[_0xaa41('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xaa41('0x2d')](_0x38f5d0);})[_0xaa41('0x17')](function(_0x374873){_0x24eb2e[_0xaa41('0x2e')]=_0x374873;return _0x24eb2e;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x16dcac,_0x38f5d0))[_0xaa41('0x2f')](handleError(_0x16dcac,null));};exports[_0xaa41('0x57')]=function(_0x27363e,_0x25cac8){var _0x5381d5={'raw':!![],'where':{}};var _0x276013={};var _0x3135c3={'count':0x0,'rows':[]};return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0x27363e[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25cac8,null))[_0xaa41('0x17')](function(_0x408d95){if(_0x408d95){_0x276013[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x58')][_0xaa41('0x28')]);_0x276013[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x27363e[_0xaa41('0x32')]);_0x276013['filters']=_[_0xaa41('0x35')](_0x276013[_0xaa41('0x31')],_0x276013[_0xaa41('0x32')]);_0x5381d5[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x276013['model'],qs['fields'](_0x27363e[_0xaa41('0x32')][_0xaa41('0x36')]));_0x5381d5['attributes']=_0x5381d5[_0xaa41('0x34')][_0xaa41('0x37')]?_0x5381d5['attributes']:_0x276013['model'];if(!_0x27363e['query'][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x5381d5[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x12')]);_0x5381d5[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x27363e[_0xaa41('0x32')][_0xaa41('0x14')]);}_0x5381d5[_0xaa41('0x4d')]=qs['sort'](_0x27363e['query'][_0xaa41('0x4e')]);_0x5381d5[_0xaa41('0x2a')]=qs['filters'](_[_0xaa41('0x4f')](_0x27363e['query'],_0x276013[_0xaa41('0x4b')]));_0x5381d5[_0xaa41('0x2a')][_0xaa41('0x50')]=_0x408d95['id'];if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x5381d5[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x5381d5[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x5381d5['attributes'],function(_0x56bd21){var _0x56661a={};_0x56661a[_0x56bd21]={'$like':'%'+_0x27363e[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x56661a;})});}_0x5381d5=_['merge']({},_0x5381d5,_0x27363e['options']);return db[_0xaa41('0x58')][_0xaa41('0x13')]({'where':_0x5381d5['where']})['then'](function(_0xf651b7){_0x3135c3['count']=_0xf651b7;if(_0x27363e[_0xaa41('0x32')][_0xaa41('0x44')]){_0x5381d5[_0xaa41('0x2b')]=[{'all':!![]}];}return db[_0xaa41('0x58')][_0xaa41('0x2d')](_0x5381d5);})[_0xaa41('0x17')](function(_0x211455){_0x3135c3[_0xaa41('0x2e')]=_0x211455;return _0x3135c3;});}})[_0xaa41('0x17')](respondWithFilteredResult(_0x25cac8,_0x5381d5))['catch'](handleError(_0x25cac8,null));};exports['getTeams']=function(_0x38884d,_0x25d938){var _0x337655={};var _0x415705={};var _0x3efb43;var _0xae746;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x38884d[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x25d938,null))[_0xaa41('0x17')](function(_0x17442e){if(_0x17442e){_0x3efb43=_0x17442e;_0x415705[_0xaa41('0x31')]=_[_0xaa41('0x33')](db[_0xaa41('0x59')]['rawAttributes']);_0x415705[_0xaa41('0x32')]=_['keys'](_0x38884d[_0xaa41('0x32')]);_0x415705[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],_0x415705[_0xaa41('0x32')]);_0x337655[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x415705[_0xaa41('0x31')],qs['fields'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x36')]));_0x337655[_0xaa41('0x34')]=_0x337655[_0xaa41('0x34')][_0xaa41('0x37')]?_0x337655[_0xaa41('0x34')]:_0x415705[_0xaa41('0x31')];_0x337655[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x38884d[_0xaa41('0x32')]['sort']);_0x337655['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x38884d[_0xaa41('0x32')],_0x415705[_0xaa41('0x4b')]));if(_0x38884d[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x337655[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x337655[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x337655['attributes'],function(_0x49b468){var _0x17018e={};_0x17018e[_0x49b468]={'$like':'%'+_0x38884d[_0xaa41('0x32')]['filter']+'%'};return _0x17018e;})});}_0x337655=_[_0xaa41('0x38')]({},_0x337655,_0x38884d['options']);return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x50e03d){if(_0x50e03d){_0xae746=_0x50e03d['length'];if(!_0x38884d[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x337655['limit']=qs['limit'](_0x38884d[_0xaa41('0x32')]['limit']);_0x337655[_0xaa41('0x14')]=qs['offset'](_0x38884d[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x3efb43[_0xaa41('0x5a')](_0x337655);}})[_0xaa41('0x17')](function(_0x182b0b){if(_0x182b0b){return _0x182b0b?{'count':_0xae746,'rows':_0x182b0b}:null;}})[_0xaa41('0x17')](respondWithResult(_0x25d938,null))[_0xaa41('0x2f')](handleError(_0x25d938,null));};exports['addTeams']=function(_0x4363b5,_0x1fa1f5){var _0x50883c=_0x4363b5[_0xaa41('0x3b')][_0xaa41('0x5b')];var _0x1c3d7f=_[_0xaa41('0x1c')](_0x50883c,'id');return db['Team'][_0xaa41('0x2d')]({'where':{'id':_0x1c3d7f},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]}]})[_0xaa41('0x17')](function(_0xe2574a){if(_0xe2574a){var _0x4d83ce=_['flatMap'](_0xe2574a,function(_0x214ebe){var _0x2df75c=_0x214ebe[_0xaa41('0x18')]({'plain':!![]});_0x2df75c[_0xaa41('0x5d')][_0xaa41('0x61')](function(_0x401586){_0x401586['penalty']=_[_0xaa41('0x20')](_0x50883c,{'id':_0x2df75c['id']})[_0xaa41('0x62')];});return _0x2df75c[_0xaa41('0x5d')];});return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x4363b5[_0xaa41('0x30')]['id']}})['then'](function(_0xe8076e){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4cf0c5){return _0xe8076e[_0xaa41('0x65')](_0x1c3d7f,{'transaction':_0x4cf0c5})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x50883c,function(_0x255e76){return db[_0xaa41('0x67')][_0xaa41('0x68')]({'TeamId':_0x255e76['id'],'VoiceQueueId':_0x4363b5[_0xaa41('0x30')]['id'],'penalty':_0x255e76[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_0x4d83ce,function(_0x19a42c){return db[_0xaa41('0x69')][_0xaa41('0x6a')]({'where':{'UserId':_0x19a42c['id'],'VoiceQueueId':_0x4363b5['params']['id']},'defaults':{'penalty':_0x19a42c['penalty']},'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){return BPromise[_0xaa41('0x66')](_[_0xaa41('0x1b')](_0x4d83ce,{'online':!![]}),function(_0x2c4595){return db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x2c4595[_0xaa41('0x21')],'UserId':_0x2c4595['id'],'queue_name':_0xe8076e['name'],'VoiceQueueId':_0xe8076e['id'],'interface':_[_0xaa41('0x6c')](_0x2c4595[_0xaa41('0x60')])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x2c4595[_0xaa41('0x21')]):_0x2c4595[_0xaa41('0x60')],'paused':_0x2c4595[_0xaa41('0x5f')]||![],'penalty':_0x2c4595[_0xaa41('0x62')]},{'transaction':_0x4cf0c5});});})[_0xaa41('0x17')](function(){_0x4d83ce[_0xaa41('0x61')](function(_0x3f2dbb){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':_0x3f2dbb['id'],'VoiceQueueId':_0xe8076e['id']});});});});});}})[_0xaa41('0x17')](respondWithStatusCode(_0x1fa1f5,null))[_0xaa41('0x2f')](handleError(_0x1fa1f5,null));};exports['removeTeams']=function(_0x33f008,_0x1489fe){return db[_0xaa41('0x59')][_0xaa41('0x2d')]({'where':{'id':_0x33f008['query'][_0xaa41('0x70')]},'attributes':['id'],'include':[{'model':db[_0xaa41('0x5c')],'as':_0xaa41('0x5d'),'attributes':['id'],'raw':!![]}]})[_0xaa41('0x17')](handleEntityNotFound(_0x1489fe,null))[_0xaa41('0x17')](function(_0x4baae3){var _0xc59a12=_['map'](_0x4baae3,'id');var _0x50a526=[];var _0x3dd3fa=[];var _0x552493=squel['select']();_0x552493[_0xaa41('0x71')](_0xaa41('0x72'))[_0xaa41('0x73')]('team_has_voice_queues','tq')[_0xaa41('0x74')](_0xaa41('0x75'),'ut',_0xaa41('0x76'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x33f008[_0xaa41('0x30')]['id']);for(var _0x29d34a=0x0;_0x29d34a<_0x4baae3[_0xaa41('0x37')];_0x29d34a+=0x1){let _0x48e2cf=_0x4baae3[_0x29d34a];for(var _0x410d6e=0x0;_0x410d6e<_0x48e2cf[_0xaa41('0x5d')][_0xaa41('0x37')];_0x410d6e+=0x1){let _0x3361f5=_0x48e2cf[_0xaa41('0x5d')][_0x410d6e];var _0x4f1bcb=_0x552493['clone']();_0x4f1bcb[_0xaa41('0x2a')](_0xaa41('0x78'),_0x3361f5['id']);_0x3dd3fa[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x4f1bcb[_0xaa41('0x7a')](),{'type':db['sequelize'][_0xaa41('0x7b')][_0xaa41('0x7c')]})['then'](function(_0x40f4ce){if(_0x40f4ce[_0xaa41('0x37')]===0x1){return _0x3361f5['id'];}else{var _0x95300a=_[_0xaa41('0x7d')](_[_0xaa41('0x1c')](_0x40f4ce,_0xaa41('0x7e')),function(_0x1926bd){return _['includes'](_0xc59a12,_0x1926bd);});if(_0x95300a){return _0x3361f5['id'];}}}));}}return BPromise[_0xaa41('0x7f')](_0x3dd3fa)[_0xaa41('0x17')](function(_0x5404cd){_0x50a526=_(_0x50a526)[_0xaa41('0x80')](_0x5404cd)[_0xaa41('0x81')]()[_0xaa41('0x1d')]();return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x33f008[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(_0x339537){return db[_0xaa41('0x63')][_0xaa41('0x64')](function(_0x4b84bc){return _0x339537[_0xaa41('0x82')](_0x33f008[_0xaa41('0x32')]['ids'],{'transaction':_0x4b84bc})['then'](function(){if(!_[_0xaa41('0x83')](_0x50a526)){return _0x339537[_0xaa41('0x84')](_0x50a526,{'transaction':_0x4b84bc})[_0xaa41('0x17')](function(){return db[_0xaa41('0x6b')][_0xaa41('0x23')]({'where':{'VoiceQueueId':_0x33f008[_0xaa41('0x30')]['id'],'UserId':_0x50a526},'transaction':_0x4b84bc});});}})['then'](function(){_0x50a526['forEach'](function(_0x395323){socket[_0xaa41('0x6f')]('userVoiceQueue:remove',{'UserId':_0x395323,'VoiceQueueId':_0x339537['id']});});});});});});})['then'](respondWithStatusCode(_0x1489fe,null))[_0xaa41('0x2f')](handleError(_0x1489fe,null));};exports[_0xaa41('0x85')]=function(_0x2fe50f,_0x520b50){var _0x50122d,_0x1d609e;return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2fe50f['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x520b50,null))[_0xaa41('0x17')](function(_0x5a0791){if(_0x5a0791){_0x1d609e=_0x5a0791;return _0x5a0791['addAgents'](_0x2fe50f[_0xaa41('0x3b')]['ids'],_[_0xaa41('0x45')](_0x2fe50f[_0xaa41('0x3b')],[_0xaa41('0x70'),'id'])||{})[_0xaa41('0x86')](function(_0x1d7c2e){for(var _0xdc0493=0x0;_0xdc0493<_0x2fe50f[_0xaa41('0x3b')]['ids'][_0xaa41('0x37')];_0xdc0493+=0x1){socket[_0xaa41('0x6f')]('userVoiceQueue:save',{'UserId':Number(_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')][_0xdc0493]),'VoiceQueueId':Number(_0x2fe50f[_0xaa41('0x30')]['id'])});}return _0x1d7c2e;});}})[_0xaa41('0x17')](function(_0x2af16e){_0x50122d=_0x2af16e||[];if(_0x1d609e){return db[_0xaa41('0x5c')]['findAll']({'where':{'id':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x70')]},'attributes':['id',_0xaa41('0x21'),_0xaa41('0x5e'),_0xaa41('0x5f'),_0xaa41('0x60')],'raw':!![]});}})[_0xaa41('0x17')](function(_0x5083ff){if(!_[_0xaa41('0x83')](_0x5083ff)){var _0x3c4e89=[];for(var _0x415acc=0x0;_0x415acc<_0x5083ff['length'];_0x415acc++){if(_0x5083ff[_0x415acc]['online']){_0x3c4e89['push'](db[_0xaa41('0x6b')][_0xaa41('0x68')]({'membername':_0x5083ff[_0x415acc][_0xaa41('0x21')],'UserId':_0x5083ff[_0x415acc]['id'],'queue_name':_0x1d609e[_0xaa41('0x21')],'VoiceQueueId':_0x1d609e['id'],'interface':_[_0xaa41('0x6c')](_0x5083ff[_0x415acc]['interface'])?util[_0xaa41('0x6d')](_0xaa41('0x6e'),_0x5083ff[_0x415acc][_0xaa41('0x21')]):_0x5083ff[_0x415acc][_0xaa41('0x60')],'paused':_0x5083ff[_0x415acc][_0xaa41('0x5f')]||![],'penalty':_0x2fe50f[_0xaa41('0x3b')][_0xaa41('0x62')]||0x0}));}}return BPromise['all'](_0x3c4e89);}})[_0xaa41('0x17')](function(){return _0x50122d;})[_0xaa41('0x17')](respondWithResult(_0x520b50,null))[_0xaa41('0x2f')](handleError(_0x520b50,null));};exports['removeAgents']=function(_0x16a173,_0x53a519){return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x16a173['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x53a519,null))[_0xaa41('0x17')](function(_0x366705){if(_0x366705){return _0x366705[_0xaa41('0x84')](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])[_0xaa41('0x17')](function(){if(_['isArray'](_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')])){for(var _0x3ee9e3=0x0;_0x3ee9e3<_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0xaa41('0x37')];_0x3ee9e3+=0x1){socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')][_0x3ee9e3]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}}else{socket[_0xaa41('0x6f')](_0xaa41('0x87'),{'UserId':Number(_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]),'VoiceQueueId':Number(_0x16a173[_0xaa41('0x30')]['id'])});}});}})['then'](function(_0x29b27e){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x16a173['params']['id'],'UserId':_0x16a173[_0xaa41('0x32')][_0xaa41('0x70')]}})['then'](function(){return _0x29b27e;});})[_0xaa41('0x17')](respondWithStatusCode(_0x53a519,null))[_0xaa41('0x2f')](handleError(_0x53a519,null));};exports[_0xaa41('0x88')]=function(_0x15bb60,_0x232732){var _0x34d857={};var _0x239f1b={};var _0x445925;var _0x1e8591;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0x15bb60[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x232732,null))[_0xaa41('0x17')](function(_0x7bae82){if(_0x7bae82){_0x445925=_0x7bae82;_0x239f1b[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['User'][_0xaa41('0x28')]);_0x239f1b[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x15bb60[_0xaa41('0x32')]);_0x239f1b['filters']=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],_0x239f1b['query']);_0x34d857[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x239f1b[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x36')]));_0x34d857[_0xaa41('0x34')]=_0x34d857[_0xaa41('0x34')][_0xaa41('0x37')]?_0x34d857[_0xaa41('0x34')]:_0x239f1b['model'];_0x34d857[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x15bb60[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x34d857[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_['pick'](_0x15bb60[_0xaa41('0x32')],_0x239f1b['filters']));if(_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x34d857[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0x34d857[_0xaa41('0x2a')],{'$or':_['map'](_0x34d857[_0xaa41('0x34')],function(_0x345002){var _0x5f39b4={};_0x5f39b4[_0x345002]={'$like':'%'+_0x15bb60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x5f39b4;})});}_0x34d857=_[_0xaa41('0x38')]({},_0x34d857,_0x15bb60[_0xaa41('0x39')]);return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0x38b3be){if(_0x38b3be){_0x1e8591=_0x38b3be[_0xaa41('0x37')];if(!_0x15bb60[_0xaa41('0x32')][_0xaa41('0x53')]('nolimit')){_0x34d857[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0x15bb60[_0xaa41('0x32')]['limit']);_0x34d857['offset']=qs[_0xaa41('0x14')](_0x15bb60['query']['offset']);}return _0x445925[_0xaa41('0x88')](_0x34d857);}})[_0xaa41('0x17')](function(_0xa4dbd3){if(_0xa4dbd3){return _0xa4dbd3?{'count':_0x1e8591,'rows':_0xa4dbd3}:null;}})[_0xaa41('0x17')](respondWithResult(_0x232732,null))['catch'](handleError(_0x232732,null));};exports['getMembers']=function(_0xa63e60,_0xf4f13f){var _0xef0e44={};var _0x46d37f={};var _0x6a6081;var _0x5e3bb2;return db[_0xaa41('0x2c')][_0xaa41('0x55')]({'where':{'id':_0xa63e60['params']['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0xf4f13f,null))[_0xaa41('0x17')](function(_0x4b4a4a){if(_0x4b4a4a){_0x6a6081=_0x4b4a4a;_0x46d37f[_0xaa41('0x31')]=_[_0xaa41('0x33')](db['UserVoiceQueueRt'][_0xaa41('0x28')]);_0x46d37f[_0xaa41('0x32')]=_['keys'](_0xa63e60[_0xaa41('0x32')]);_0x46d37f['filters']=_['intersection'](_0x46d37f[_0xaa41('0x31')],_0x46d37f[_0xaa41('0x32')]);_0xef0e44[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x46d37f[_0xaa41('0x31')],qs['fields'](_0xa63e60[_0xaa41('0x32')]['fields']));_0xef0e44['attributes']=_0xef0e44[_0xaa41('0x34')][_0xaa41('0x37')]?_0xef0e44[_0xaa41('0x34')]:_0x46d37f[_0xaa41('0x31')];_0xef0e44[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xa63e60[_0xaa41('0x32')]['sort']);_0xef0e44[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xa63e60[_0xaa41('0x32')],_0x46d37f[_0xaa41('0x4b')]));if(_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]){_0xef0e44[_0xaa41('0x2a')]=_[_0xaa41('0x38')](_0xef0e44[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0xef0e44[_0xaa41('0x34')],function(_0x5a2ba0){var _0x4fc7d6={};_0x4fc7d6[_0x5a2ba0]={'$like':'%'+_0xa63e60[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x4fc7d6;})});}_0xef0e44=_[_0xaa41('0x38')]({},_0xef0e44,_0xa63e60['options']);return _0x6a6081[_0xaa41('0x89')](_0xef0e44);}})[_0xaa41('0x17')](function(_0x15bc15){if(_0x15bc15){_0x5e3bb2=_0x15bc15[_0xaa41('0x37')];if(!_0xa63e60[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0xef0e44[_0xaa41('0x12')]=qs[_0xaa41('0x12')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x12')]);_0xef0e44[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0xa63e60[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x6a6081['getMembers'](_0xef0e44);}})[_0xaa41('0x17')](function(_0x28c109){return _0x28c109?{'count':_0x5e3bb2,'rows':_0x28c109}:null;})[_0xaa41('0x17')](respondWithResult(_0xf4f13f,null))['catch'](handleError(_0xf4f13f,null));};exports[_0xaa41('0x8a')]=function(_0xfc1e24,_0x35c48f){var _0x2b0bf9={};var _0x21c0c6={};var _0x1138d0;var _0x394987;return db[_0xaa41('0x2c')]['findOne']({'where':{'id':_0xfc1e24[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x35c48f,null))[_0xaa41('0x17')](function(_0x2fc4b1){if(_0x2fc4b1){_0x1138d0=_0x2fc4b1;_0x21c0c6[_0xaa41('0x31')]=_['keys'](db[_0xaa41('0x8b')]['rawAttributes']);_0x21c0c6[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0xfc1e24[_0xaa41('0x32')]);_0x21c0c6[_0xaa41('0x4b')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],_0x21c0c6[_0xaa41('0x32')]);_0x2b0bf9[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x21c0c6[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0xfc1e24[_0xaa41('0x32')]['fields']));_0x2b0bf9['attributes']=_0x2b0bf9[_0xaa41('0x34')][_0xaa41('0x37')]?_0x2b0bf9[_0xaa41('0x34')]:_0x21c0c6[_0xaa41('0x31')];_0x2b0bf9[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0xfc1e24['query'][_0xaa41('0x4e')]);_0x2b0bf9['where']=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0xfc1e24[_0xaa41('0x32')],_0x21c0c6[_0xaa41('0x4b')]));if(_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]){_0x2b0bf9['where']=_['merge'](_0x2b0bf9[_0xaa41('0x2a')],{'$or':_['map'](_0x2b0bf9[_0xaa41('0x34')],function(_0x3f8296){var _0x438fcf={};_0x438fcf[_0x3f8296]={'$like':'%'+_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x438fcf;})});}_0x2b0bf9=_[_0xaa41('0x38')]({},_0x2b0bf9,_0xfc1e24[_0xaa41('0x39')]);return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x2667bd){if(_0x2667bd){_0x394987=_0x2667bd[_0xaa41('0x37')];if(!_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x53')](_0xaa41('0x4c'))){_0x2b0bf9['limit']=qs[_0xaa41('0x12')](_0xfc1e24['query'][_0xaa41('0x12')]);_0x2b0bf9['offset']=qs[_0xaa41('0x14')](_0xfc1e24[_0xaa41('0x32')][_0xaa41('0x14')]);}return _0x1138d0[_0xaa41('0x8a')](_0x2b0bf9);}})[_0xaa41('0x17')](function(_0x3dafc6){if(_0x3dafc6){return _0x3dafc6?{'count':_0x394987,'rows':_0x3dafc6}:null;}})[_0xaa41('0x17')](respondWithResult(_0x35c48f,null))['catch'](handleError(_0x35c48f,null));};exports[_0xaa41('0x8c')]=function(_0x533f4b,_0x47ca9d){var _0xd1f9ba=moment()[_0xaa41('0x6d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2c4930,_0x1285ed;return db['VoiceQueue'][_0xaa41('0x20')]({'where':{'id':_0x533f4b[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x47ca9d,null))['then'](function(_0x3ecde6){if(_0x3ecde6){_0x1285ed=_0x3ecde6;return _0x3ecde6['addLists'](_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x533f4b[_0xaa41('0x3b')],['ids','id'])||{});}return null;})[_0xaa41('0x86')](function(_0x32a07e){var _0x2b8b73;_0x2c4930=_0x32a07e||[];var _0x49e4a5=[];if(_0x32a07e){for(var _0xda8e73=0x0;_0xda8e73<_0x32a07e[_0xaa41('0x37')];_0xda8e73+=0x1){var _0x25f5ba=_0x32a07e[_0xda8e73][_0xaa41('0x18')]({'plain':!![]});_0x1285ed[_0xaa41('0x8d')]=_0x533f4b[_0xaa41('0x3b')][_0xaa41('0x8d')]?_0x533f4b[_0xaa41('0x3b')]['dialCheckDuplicateType']:_0x1285ed[_0xaa41('0x8d')];switch(_0x1285ed['dialCheckDuplicateType']){case _0xaa41('0x8e'):_0x2b8b73=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0x91'))[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),'ListId')[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')]['toString']())[_0xaa41('0x2a')](_0xaa41('0x9b'))['where'](_0xaa41('0x9c'),squel['select']()[_0xaa41('0x71')](_0xaa41('0x9d'))[_0xaa41('0x73')](_0xaa41('0x9e'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]()))[_0xaa41('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xaa41('0x71')](_0xaa41('0x9f'))['from'](_0xaa41('0x91'))[_0xaa41('0x2a')](_0xaa41('0x77'),_0x533f4b['params']['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;case _0xaa41('0xa0'):_0x2b8b73=squel['insert']()[_0xaa41('0x90')](_0xaa41('0x91'))['fromQuery'](['phone',_0xaa41('0x94'),_0xaa41('0x95'),_0xaa41('0x96'),_0xaa41('0x50'),'createdAt',_0xaa41('0x47')],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))['field']('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27','createdAt')[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')]('deletedAt\x20IS\x20NULL')[_0xaa41('0x2a')]('ListId\x20=\x20?',_0x25f5ba[_0xaa41('0x98')]['toString']())['where'](_0xaa41('0x9b'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xaa41('0x97')]()[_0xaa41('0x71')](_0xaa41('0x9f'))[_0xaa41('0x73')](_0xaa41('0x91'))[_0xaa41('0x2a')]('VoiceQueueId\x20=\x20?',_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')]())))[_0xaa41('0x7a')]();break;default:_0x2b8b73=squel['insert']()[_0xaa41('0x90')]('cm_hopper')[_0xaa41('0x92')]([_0xaa41('0x93'),_0xaa41('0x94'),_0xaa41('0x95'),'ListId','VoiceQueueId',_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x94'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x25f5ba[_0xaa41('0x98')]['toString'](),_0xaa41('0x96'))[_0xaa41('0x71')](_0x533f4b[_0xaa41('0x30')]['id'][_0xaa41('0x7a')](),_0xaa41('0x50'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x47'))['from'](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))['where'](_0xaa41('0x9a'),_0x25f5ba[_0xaa41('0x98')][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))[_0xaa41('0x7a')]();}_0x49e4a5[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x2b8b73));}return BPromise[_0xaa41('0x7f')](_0x49e4a5);}})['then'](function(){var _0x58f009=[];var _0x405eba=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')]('cm_hopper_additional_phones')[_0xaa41('0x92')]([_0xaa41('0xa2'),_0xaa41('0x93'),_0xaa41('0xa3'),_0xaa41('0x46'),_0xaa41('0x47')],squel['select']()[_0xaa41('0x71')](_0xaa41('0xa4'))[_0xaa41('0x71')](_0xaa41('0xa5'))['field'](_0xaa41('0xa6'))[_0xaa41('0x71')]('\x27'+_0xd1f9ba+'\x27',_0xaa41('0x46'))['field']('\x27'+_0xd1f9ba+'\x27','updatedAt')[_0xaa41('0x73')](_0xaa41('0xa7'),'ci')[_0xaa41('0x74')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0xaa41('0x2a')](_0xaa41('0xa8'),_0xd1f9ba)[_0xaa41('0x2a')](_0xaa41('0xa9'),_0xaa41('0xaa')))[_0xaa41('0x7a')]();_0x58f009['push'](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x405eba));return BPromise[_0xaa41('0x7f')](_0x58f009);})[_0xaa41('0x17')](function(){return _0x2c4930;})[_0xaa41('0x17')](respondWithResult(_0x47ca9d,null))[_0xaa41('0x2f')](handleError(_0x47ca9d,null));};exports[_0xaa41('0xab')]=function(_0x718a84,_0x151c5f){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x718a84['params']['id']}})['then'](handleEntityNotFound(_0x151c5f,null))[_0xaa41('0x17')](function(_0x293a1d){if(_0x293a1d){return _0x293a1d['removeLists'](_0x718a84[_0xaa41('0x32')][_0xaa41('0x70')]);}})['then'](function(_0x490a6c){if(_0x490a6c){return db[_0xaa41('0x4a')][_0xaa41('0x23')]({'where':{'ListId':_0x718a84[_0xaa41('0x32')]['ids'],'VoiceQueueId':_0x718a84[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x490a6c;});}})['then'](respondWithStatusCode(_0x151c5f,null))[_0xaa41('0x2f')](handleError(_0x151c5f,null));};exports[_0xaa41('0xac')]=function(_0x536cdb,_0x431b75){var _0x18499f={};var _0x49cbd7={};var _0x515f91;var _0x4b5953;return db['VoiceQueue'][_0xaa41('0x55')]({'where':{'id':_0x536cdb[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x431b75,null))[_0xaa41('0x17')](function(_0x4ca8f7){if(_0x4ca8f7){_0x515f91=_0x4ca8f7;_0x49cbd7['model']=_[_0xaa41('0x33')](db['CmList'][_0xaa41('0x28')]);_0x49cbd7[_0xaa41('0x32')]=_[_0xaa41('0x33')](_0x536cdb[_0xaa41('0x32')]);_0x49cbd7['filters']=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],_0x49cbd7[_0xaa41('0x32')]);_0x18499f[_0xaa41('0x34')]=_[_0xaa41('0x35')](_0x49cbd7[_0xaa41('0x31')],qs[_0xaa41('0x36')](_0x536cdb[_0xaa41('0x32')]['fields']));_0x18499f['attributes']=_0x18499f[_0xaa41('0x34')][_0xaa41('0x37')]?_0x18499f[_0xaa41('0x34')]:_0x49cbd7[_0xaa41('0x31')];_0x18499f[_0xaa41('0x4d')]=qs[_0xaa41('0x4e')](_0x536cdb[_0xaa41('0x32')][_0xaa41('0x4e')]);_0x18499f[_0xaa41('0x2a')]=qs[_0xaa41('0x4b')](_[_0xaa41('0x4f')](_0x536cdb[_0xaa41('0x32')],_0x49cbd7[_0xaa41('0x4b')]));if(_0x536cdb['query'][_0xaa41('0x1b')]){_0x18499f[_0xaa41('0x2a')]=_['merge'](_0x18499f[_0xaa41('0x2a')],{'$or':_[_0xaa41('0x1c')](_0x18499f[_0xaa41('0x34')],function(_0x5cd79d){var _0x558583={};_0x558583[_0x5cd79d]={'$like':'%'+_0x536cdb[_0xaa41('0x32')][_0xaa41('0x1b')]+'%'};return _0x558583;})});}_0x18499f=_['merge']({},_0x18499f,_0x536cdb['options']);return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x117841){if(_0x117841){_0x4b5953=_0x117841[_0xaa41('0x37')];if(!_0x536cdb[_0xaa41('0x32')]['hasOwnProperty'](_0xaa41('0x4c'))){_0x18499f[_0xaa41('0x12')]=qs['limit'](_0x536cdb['query'][_0xaa41('0x12')]);_0x18499f[_0xaa41('0x14')]=qs[_0xaa41('0x14')](_0x536cdb[_0xaa41('0x32')]['offset']);}return _0x515f91[_0xaa41('0xac')](_0x18499f);}})[_0xaa41('0x17')](function(_0x1be3c1){if(_0x1be3c1){return _0x1be3c1?{'count':_0x4b5953,'rows':_0x1be3c1}:null;}})[_0xaa41('0x17')](respondWithResult(_0x431b75,null))[_0xaa41('0x2f')](handleError(_0x431b75,null));};exports[_0xaa41('0xad')]=function(_0x42ae0c,_0x4fa4ca){var _0x1e41b5;return db[_0xaa41('0x2c')]['find']({'where':{'id':_0x42ae0c[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4fa4ca,null))[_0xaa41('0x17')](function(_0x135f31){if(_0x135f31){return _0x135f31[_0xaa41('0xad')](_0x42ae0c[_0xaa41('0x3b')][_0xaa41('0x70')],_[_0xaa41('0x45')](_0x42ae0c['body'],[_0xaa41('0x70'),'id'])||{});}return null;})['spread'](function(_0x5eac30){var _0x3e28b7;_0x1e41b5=_0x5eac30||[];var _0x1ac854=[];if(_0x5eac30){for(var _0x187bf9=0x0;_0x187bf9<_0x5eac30['length'];_0x187bf9+=0x1){var _0x50fa22=_0x5eac30[_0x187bf9][_0xaa41('0x18')]({'plain':!![]});_0x3e28b7=squel[_0xaa41('0x8f')]()[_0xaa41('0x90')](_0xaa41('0xae'))['fromQuery']([_0xaa41('0x93'),'ContactId',_0xaa41('0x96'),_0xaa41('0x50'),_0xaa41('0x46'),'updatedAt'],squel[_0xaa41('0x97')]()['field'](_0xaa41('0x93'),_0xaa41('0x93'))[_0xaa41('0x71')]('id',_0xaa41('0x95'))[_0xaa41('0x71')](_0x50fa22['CmListId'][_0xaa41('0x7a')](),'ListId')['field'](_0x42ae0c['params']['id'][_0xaa41('0x7a')](),'VoiceQueueId')[_0xaa41('0x71')]('NOW()','createdAt')[_0xaa41('0x71')](_0xaa41('0xaf'),_0xaa41('0x47'))[_0xaa41('0x73')](_0xaa41('0x99'))[_0xaa41('0x2a')](_0xaa41('0xa1'))[_0xaa41('0x2a')](_0xaa41('0x9a'),_0x50fa22['CmListId'][_0xaa41('0x7a')]())[_0xaa41('0x2a')](_0xaa41('0x9b')))['toString']();_0x1ac854[_0xaa41('0x79')](db[_0xaa41('0x63')][_0xaa41('0x32')](_0x3e28b7));}return BPromise['all'](_0x1ac854);}})[_0xaa41('0x17')](function(){return _0x1e41b5;})[_0xaa41('0x17')](respondWithResult(_0x4fa4ca,null))['catch'](handleError(_0x4fa4ca,null));};exports[_0xaa41('0xb0')]=function(_0x2edb93,_0x4e34c2){return db[_0xaa41('0x2c')][_0xaa41('0x20')]({'where':{'id':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](handleEntityNotFound(_0x4e34c2,null))[_0xaa41('0x17')](function(_0x17b359){if(_0x17b359){return _0x17b359['removeBlackLists'](_0x2edb93['query']['ids']);}})['then'](function(_0x5b820b){if(_0x5b820b){return db[_0xaa41('0x58')][_0xaa41('0x23')]({'where':{'ListId':_0x2edb93[_0xaa41('0x32')][_0xaa41('0x70')],'VoiceQueueId':_0x2edb93[_0xaa41('0x30')]['id']}})[_0xaa41('0x17')](function(){return _0x5b820b;});}})[_0xaa41('0x17')](respondWithStatusCode(_0x4e34c2,null))[_0xaa41('0x2f')](handleError(_0x4e34c2,null));}; \ No newline at end of file +var _0xf3cd=['CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getTeams','addTeams','User','online','flatMap','Agents','penalty','transaction','each','TeamVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','voicePause','forEach','emit','removeTeams','Team','ids','select','field','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','all','union','removeAgents','userVoiceQueue:remove','addAgents','spread','isEmpty','getAgents','getMembers','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','name','UserProfileResource','VoiceQueue','fieldName','key','where','include','query','findAll','rows','catch','params','keys','filters','intersection','attributes','model','fields','length','includeAll','options','find','create','body','user','role','outbound','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','merge','omit','updatedAt','createdAt','getHoppers','findOne','hasOwnProperty','order','sort','pick','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals'];(function(_0x3938cc,_0x31bec8){var _0x5c1233=function(_0x4b889b){while(--_0x4b889b){_0x3938cc['push'](_0x3938cc['shift']());}};_0x5c1233(++_0x31bec8);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x435fa1,_0x58550a){_0x435fa1=_0x435fa1-0x0;var _0x845f9f=_0xf3cd[_0x435fa1];return _0x845f9f;};'use strict';var moment=require(_0xdf3c('0x0'));var BPromise=require(_0xdf3c('0x1'));var util=require(_0xdf3c('0x2'));var _=require(_0xdf3c('0x3'));var squel=require(_0xdf3c('0x4'));var Redis=require(_0xdf3c('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xdf3c('0x6'))(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var db=require('../../mysqldb')['db'];config[_0xdf3c('0x9')]=_[_0xdf3c('0xa')](config[_0xdf3c('0x9')],{'host':_0xdf3c('0xb'),'port':0x18eb});var socket=require(_0xdf3c('0xc'))(new Redis(config[_0xdf3c('0x9')]));require('./voiceQueue.socket')[_0xdf3c('0xd')](socket);function respondWithStatusCode(_0x52cf30,_0x52f855){_0x52f855=_0x52f855||0xcc;return function(_0x22d8ae){if(_0x22d8ae){return _0x52cf30[_0xdf3c('0xe')](_0x52f855);}return _0x52cf30['status'](_0x52f855)[_0xdf3c('0xf')]();};}function respondWithResult(_0x205f33,_0x2d420c){_0x2d420c=_0x2d420c||0xc8;return function(_0x21a6e5){if(_0x21a6e5){return _0x205f33[_0xdf3c('0x10')](_0x2d420c)[_0xdf3c('0x11')](_0x21a6e5);}};}function respondWithFilteredResult(_0xf7da9d,_0x32d2db){return function(_0x5e8925){if(_0x5e8925){var _0x1d483c=typeof _0x32d2db[_0xdf3c('0x12')]===_0xdf3c('0x13')&&typeof _0x32d2db[_0xdf3c('0x14')]==='undefined';var _0x2ae4ad=_0x5e8925[_0xdf3c('0x15')];var _0x13ea5f=_0x1d483c?0x0:_0x32d2db['offset'];var _0x18aafa=_0x1d483c?_0x5e8925[_0xdf3c('0x15')]:_0x32d2db[_0xdf3c('0x12')]+_0x32d2db[_0xdf3c('0x14')];var _0x21e587;if(_0x18aafa>=_0x2ae4ad){_0x18aafa=_0x2ae4ad;_0x21e587=0xc8;}else{_0x21e587=0xce;}_0xf7da9d[_0xdf3c('0x10')](_0x21e587);return _0xf7da9d[_0xdf3c('0x16')](_0xdf3c('0x17'),_0x13ea5f+'-'+_0x18aafa+'/'+_0x2ae4ad)[_0xdf3c('0x11')](_0x5e8925);}return null;};}function saveUpdates(_0x5d3991){return function(_0x54cdd4){if(_0x54cdd4){return _0x54cdd4[_0xdf3c('0x18')](_0x5d3991)[_0xdf3c('0x19')](function(_0xf1da1f){return _0xf1da1f;});}return null;};}function removeEntity(_0x18d4ec){return function(_0x1e2690){if(_0x1e2690){return _0x1e2690[_0xdf3c('0x1a')]()[_0xdf3c('0x19')](function(){var _0x3ee0af=_0x1e2690[_0xdf3c('0x1b')]({'plain':!![]});var _0x18fb5f=[{'name':_0xdf3c('0x1c'),'value':_0xdf3c('0x1d'),'ignore':![]},{'name':_0xdf3c('0x1e'),'value':'outbound','ignore':![]}];var _0x4d620f=_(_0x18fb5f)[_0xdf3c('0x1f')]('ignore')[_0xdf3c('0x20')](_0xdf3c('0x21'))[_0xdf3c('0x21')]();if(_[_0xdf3c('0x22')](_0x4d620f,_0x3ee0af[_0xdf3c('0x23')])){return;}var _0x36ba1c=_['find'](_0x18fb5f,[_0xdf3c('0x21'),_0x3ee0af[_0xdf3c('0x23')]])[_0xdf3c('0x24')];return db[_0xdf3c('0x25')][_0xdf3c('0x1a')]({'where':{'type':_0x36ba1c,'resourceId':_0x3ee0af['id']}})[_0xdf3c('0x19')](function(){return _0x1e2690;});})[_0xdf3c('0x19')](function(){_0x18d4ec[_0xdf3c('0x10')](0xcc)[_0xdf3c('0xf')]();});}};}function handleEntityNotFound(_0x1adee4){return function(_0x4c076c){if(!_0x4c076c){_0x1adee4[_0xdf3c('0xe')](0x194);}return _0x4c076c;};}function handleError(_0x153daa,_0x4b57a4){_0x4b57a4=_0x4b57a4||0x1f4;return function(_0xdc8962){logger['error'](_0xdc8962['stack']);if(_0xdc8962['name']){delete _0xdc8962[_0xdf3c('0x24')];}_0x153daa[_0xdf3c('0x10')](_0x4b57a4)['send'](_0xdc8962);};}exports['index']=function(_0x37ecfd,_0x1f2ce4){var _0xd3cfcb={};var _0x1ccdd4={'count':0x0,'rows':[]};var _0x5c98a2=_[_0xdf3c('0x20')](db[_0xdf3c('0x26')]['rawAttributes'],function(_0x51e0a4){return{'name':_0x51e0a4[_0xdf3c('0x27')],'type':_0x51e0a4[_0xdf3c('0x23')][_0xdf3c('0x28')]};});_0xd3cfcb=qs['getOptions'](_0x5c98a2,_0x37ecfd);var _0x2355f6={'where':_0xd3cfcb[_0xdf3c('0x29')]};return db[_0xdf3c('0x26')][_0xdf3c('0x15')](_0x2355f6)['then'](function(_0xda0de0){_0x1ccdd4[_0xdf3c('0x15')]=_0xda0de0;_0xd3cfcb['include']=qs[_0xdf3c('0x2a')](_0x37ecfd[_0xdf3c('0x2b')]);return db[_0xdf3c('0x26')][_0xdf3c('0x2c')](_0xd3cfcb);})['then'](function(_0x33632f){_0x1ccdd4[_0xdf3c('0x2d')]=_0x33632f;return _0x1ccdd4;})[_0xdf3c('0x19')](respondWithFilteredResult(_0x1f2ce4,_0xd3cfcb))[_0xdf3c('0x2e')](handleError(_0x1f2ce4,null));};exports['show']=function(_0x474564,_0x3e7a4b){var _0x5ddd21={'raw':![],'where':{'id':_0x474564[_0xdf3c('0x2f')]['id']}},_0x4f68f9={};_0x4f68f9['model']=_[_0xdf3c('0x30')](db['VoiceQueue']['rawAttributes']);_0x4f68f9['query']=_[_0xdf3c('0x30')](_0x474564[_0xdf3c('0x2b')]);_0x4f68f9[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x4f68f9['model'],_0x4f68f9['query']);_0x5ddd21[_0xdf3c('0x33')]=_['intersection'](_0x4f68f9[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0x474564[_0xdf3c('0x2b')][_0xdf3c('0x35')]));_0x5ddd21[_0xdf3c('0x33')]=_0x5ddd21[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x5ddd21[_0xdf3c('0x33')]:_0x4f68f9[_0xdf3c('0x34')];if(_0x474564['query'][_0xdf3c('0x37')]){_0x5ddd21['include']=[{'all':!![]}];}_0x5ddd21=_['merge']({},_0x5ddd21,_0x474564[_0xdf3c('0x38')]);return db['VoiceQueue'][_0xdf3c('0x39')](_0x5ddd21)['then'](handleEntityNotFound(_0x3e7a4b,null))[_0xdf3c('0x19')](respondWithResult(_0x3e7a4b,null))[_0xdf3c('0x2e')](handleError(_0x3e7a4b,null));};exports[_0xdf3c('0x3a')]=function(_0x1349a4,_0x3098cb){return db[_0xdf3c('0x26')][_0xdf3c('0x3a')](_0x1349a4[_0xdf3c('0x3b')],{})[_0xdf3c('0x19')](function(_0xa65478){var _0x424acf=_0x1349a4[_0xdf3c('0x3c')]['get']({'plain':!![]});if(!_0x424acf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x424acf[_0xdf3c('0x3d')]==='user'){var _0x3a6527=_0xa65478[_0xdf3c('0x1b')]({'plain':!![]});var _0x46194d=[{'name':_0xdf3c('0x1c'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xdf3c('0x3e')}];var _0x33edab=_[_0xdf3c('0x39')](_0x46194d,['value',_0x3a6527[_0xdf3c('0x23')]])[_0xdf3c('0x24')];return db[_0xdf3c('0x3f')][_0xdf3c('0x39')]({'where':{'name':_0x33edab,'userProfileId':_0x424acf['userProfileId']},'raw':!![]})[_0xdf3c('0x19')](function(_0x3e9be9){if(_0x3e9be9&&_0x3e9be9[_0xdf3c('0x40')]===0x0){return db[_0xdf3c('0x25')][_0xdf3c('0x3a')]({'name':_0x3a6527['name'],'resourceId':_0x3a6527['id'],'type':_0x3e9be9[_0xdf3c('0x24')],'sectionId':_0x3e9be9['id']},{})[_0xdf3c('0x19')](function(){return _0xa65478;});}else{return _0xa65478;}})[_0xdf3c('0x2e')](function(_0x2456cf){logger[_0xdf3c('0x41')](_0xdf3c('0x42'),_0x2456cf);throw _0x2456cf;});}return _0xa65478;})['then'](respondWithResult(_0x3098cb,0xc9))['catch'](handleError(_0x3098cb,null));};exports[_0xdf3c('0x43')]=function(_0x2be86d,_0x5a4443){var _0x5c9885={'where':{'id':_0x2be86d[_0xdf3c('0x2f')]['id']}},_0x269723={};_0x269723[_0xdf3c('0x34')]=_[_0xdf3c('0x30')](db[_0xdf3c('0x26')][_0xdf3c('0x44')]);_0x5c9885[_0xdf3c('0x33')]=_[_0xdf3c('0x32')](_0x269723[_0xdf3c('0x34')],qs['fields'](_0x2be86d[_0xdf3c('0x2b')][_0xdf3c('0x35')]));_0x5c9885[_0xdf3c('0x33')]=_0x5c9885[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x5c9885[_0xdf3c('0x33')]:_0x269723[_0xdf3c('0x34')];if(_0x2be86d['query'][_0xdf3c('0x37')]){_0x5c9885['include']=[{'all':!![]}];}_0x5c9885=_[_0xdf3c('0x45')]({},_0x5c9885,_0x2be86d['options']);return db[_0xdf3c('0x26')][_0xdf3c('0x39')](_0x5c9885)[_0xdf3c('0x19')](handleEntityNotFound(_0x5a4443,null))[_0xdf3c('0x19')](function(_0x5eef94){if(_0x5eef94){var _0x55da0f=_0x5eef94['get']({'plain':!![]});_0x55da0f=qs[_0xdf3c('0x46')](_0x55da0f,['id','createdAt',_0xdf3c('0x47')]);_0x2be86d[_0xdf3c('0x3b')]=_[_0xdf3c('0x46')](_0x2be86d[_0xdf3c('0x3b')],['id',_0xdf3c('0x48'),'updatedAt']);return db['VoiceQueue'][_0xdf3c('0x3a')](_[_0xdf3c('0x45')](_0x55da0f,_0x2be86d['body']),{'include':_0x2be86d[_0xdf3c('0x2b')][_0xdf3c('0x37')]?[{'all':!![]}]:undefined})[_0xdf3c('0x19')](function(_0x3fda0a){var _0x38de63=_0x2be86d[_0xdf3c('0x3c')][_0xdf3c('0x1b')]({'plain':!![]});if(!_0x38de63)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38de63['role']===_0xdf3c('0x3c')){var _0x28030e=_0x3fda0a[_0xdf3c('0x1b')]({'plain':!![]});var _0x1ad771=[{'name':_0xdf3c('0x1c'),'value':_0xdf3c('0x1d')},{'name':_0xdf3c('0x1e'),'value':_0xdf3c('0x3e')}];var _0x143d01=_[_0xdf3c('0x39')](_0x1ad771,[_0xdf3c('0x21'),_0x28030e['type']])[_0xdf3c('0x24')];return db['UserProfileSection']['find']({'where':{'name':_0x143d01,'userProfileId':_0x38de63['userProfileId']},'raw':!![]})['then'](function(_0x541c57){if(_0x541c57&&_0x541c57[_0xdf3c('0x40')]===0x0){return db[_0xdf3c('0x25')]['create']({'name':_0x28030e[_0xdf3c('0x24')],'resourceId':_0x28030e['id'],'type':_0x541c57[_0xdf3c('0x24')],'sectionId':_0x541c57['id']},{})['then'](function(){return _0x3fda0a;});}else{return _0x3fda0a;}})[_0xdf3c('0x2e')](function(_0x28f935){logger[_0xdf3c('0x41')](_0xdf3c('0x42'),_0x28f935);throw _0x28f935;});}return _0x3fda0a;});}})[_0xdf3c('0x19')](respondWithResult(_0x5a4443,0xc9))[_0xdf3c('0x2e')](handleError(_0x5a4443,null));};exports[_0xdf3c('0x18')]=function(_0xdc859,_0x42efa2){if(_0xdc859[_0xdf3c('0x3b')]['id']){delete _0xdc859[_0xdf3c('0x3b')]['id'];}return db['VoiceQueue'][_0xdf3c('0x39')]({'where':{'id':_0xdc859[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x42efa2,null))['then'](saveUpdates(_0xdc859[_0xdf3c('0x3b')],null))[_0xdf3c('0x19')](respondWithResult(_0x42efa2,null))[_0xdf3c('0x2e')](handleError(_0x42efa2,null));};exports['destroy']=function(_0x1effdb,_0x13bf69){return db['VoiceQueue'][_0xdf3c('0x39')]({'where':{'id':_0x1effdb['params']['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x13bf69,null))[_0xdf3c('0x19')](removeEntity(_0x13bf69,null))[_0xdf3c('0x2e')](handleError(_0x13bf69,null));};exports[_0xdf3c('0x49')]=function(_0xed2a78,_0x30e6e1){var _0x3fca95={'raw':![],'where':{}};var _0x2a1559={};var _0x2922d8={'count':0x0,'rows':[]};return db[_0xdf3c('0x26')][_0xdf3c('0x4a')]({'where':{'id':_0xed2a78[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x30e6e1,null))[_0xdf3c('0x19')](function(_0x204110){if(_0x204110){_0x2a1559[_0xdf3c('0x34')]=_[_0xdf3c('0x30')](db['CmHopper']['rawAttributes']);_0x2a1559[_0xdf3c('0x2b')]=_[_0xdf3c('0x30')](_0xed2a78[_0xdf3c('0x2b')]);_0x2a1559['filters']=_[_0xdf3c('0x32')](_0x2a1559['model'],_0x2a1559['query']);_0x3fca95[_0xdf3c('0x33')]=_[_0xdf3c('0x32')](_0x2a1559[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0xed2a78[_0xdf3c('0x2b')][_0xdf3c('0x35')]));_0x3fca95[_0xdf3c('0x33')]=_0x3fca95[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x3fca95[_0xdf3c('0x33')]:_0x2a1559[_0xdf3c('0x34')];if(!_0xed2a78[_0xdf3c('0x2b')][_0xdf3c('0x4b')]('nolimit')){_0x3fca95[_0xdf3c('0x14')]=qs[_0xdf3c('0x14')](_0xed2a78[_0xdf3c('0x2b')][_0xdf3c('0x14')]);_0x3fca95[_0xdf3c('0x12')]=qs['offset'](_0xed2a78[_0xdf3c('0x2b')][_0xdf3c('0x12')]);}_0x3fca95[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_0xed2a78[_0xdf3c('0x2b')][_0xdf3c('0x4d')]);_0x3fca95[_0xdf3c('0x29')]=qs[_0xdf3c('0x31')](_[_0xdf3c('0x4e')](_0xed2a78[_0xdf3c('0x2b')],_0x2a1559['filters']));_0x3fca95[_0xdf3c('0x29')][_0xdf3c('0x4f')]=_0x204110['id'];if(_0xed2a78[_0xdf3c('0x2b')][_0xdf3c('0x1f')]){_0x3fca95[_0xdf3c('0x29')]=_[_0xdf3c('0x45')](_0x3fca95[_0xdf3c('0x29')],{'$or':_['map'](_0x3fca95[_0xdf3c('0x33')],function(_0x662fd5){var _0x4e1b77={};_0x4e1b77[_0x662fd5]={'$like':'%'+_0xed2a78['query'][_0xdf3c('0x1f')]+'%'};return _0x4e1b77;})});}_0x3fca95=_[_0xdf3c('0x45')]({},_0x3fca95,_0xed2a78[_0xdf3c('0x38')]);return db[_0xdf3c('0x50')][_0xdf3c('0x15')]({'where':_0x3fca95[_0xdf3c('0x29')]})[_0xdf3c('0x19')](function(_0x38af90){_0x2922d8['count']=_0x38af90;if(_0xed2a78[_0xdf3c('0x2b')][_0xdf3c('0x37')]){_0x3fca95[_0xdf3c('0x2a')]=[{'all':!![]}];}return db['CmHopper'][_0xdf3c('0x2c')](_0x3fca95);})[_0xdf3c('0x19')](function(_0x43d299){_0x2922d8['rows']=_0x43d299;return _0x2922d8;});}})[_0xdf3c('0x19')](respondWithFilteredResult(_0x30e6e1,_0x3fca95))[_0xdf3c('0x2e')](handleError(_0x30e6e1,null));};exports[_0xdf3c('0x51')]=function(_0x1b279f,_0xe01538){var _0x12f737={'raw':!![],'where':{}};var _0x560348={};var _0x50753f={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x1b279f['params']['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0xe01538,null))[_0xdf3c('0x19')](function(_0xf66fae){if(_0xf66fae){_0x560348['model']=_[_0xdf3c('0x30')](db[_0xdf3c('0x52')][_0xdf3c('0x44')]);_0x560348['query']=_['keys'](_0x1b279f[_0xdf3c('0x2b')]);_0x560348['filters']=_[_0xdf3c('0x32')](_0x560348['model'],_0x560348[_0xdf3c('0x2b')]);_0x12f737[_0xdf3c('0x33')]=_[_0xdf3c('0x32')](_0x560348[_0xdf3c('0x34')],qs['fields'](_0x1b279f['query'][_0xdf3c('0x35')]));_0x12f737[_0xdf3c('0x33')]=_0x12f737[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x12f737[_0xdf3c('0x33')]:_0x560348[_0xdf3c('0x34')];if(!_0x1b279f['query'][_0xdf3c('0x4b')]('nolimit')){_0x12f737[_0xdf3c('0x14')]=qs[_0xdf3c('0x14')](_0x1b279f[_0xdf3c('0x2b')][_0xdf3c('0x14')]);_0x12f737[_0xdf3c('0x12')]=qs['offset'](_0x1b279f[_0xdf3c('0x2b')][_0xdf3c('0x12')]);}_0x12f737[_0xdf3c('0x4c')]=qs['sort'](_0x1b279f['query']['sort']);_0x12f737['where']=qs[_0xdf3c('0x31')](_[_0xdf3c('0x4e')](_0x1b279f[_0xdf3c('0x2b')],_0x560348[_0xdf3c('0x31')]));_0x12f737[_0xdf3c('0x29')][_0xdf3c('0x4f')]=_0xf66fae['id'];if(_0x1b279f['query'][_0xdf3c('0x1f')]){_0x12f737['where']=_[_0xdf3c('0x45')](_0x12f737[_0xdf3c('0x29')],{'$or':_[_0xdf3c('0x20')](_0x12f737[_0xdf3c('0x33')],function(_0x320452){var _0x3a221d={};_0x3a221d[_0x320452]={'$like':'%'+_0x1b279f[_0xdf3c('0x2b')][_0xdf3c('0x1f')]+'%'};return _0x3a221d;})});}_0x12f737=_[_0xdf3c('0x45')]({},_0x12f737,_0x1b279f[_0xdf3c('0x38')]);return db[_0xdf3c('0x52')][_0xdf3c('0x15')]({'where':_0x12f737[_0xdf3c('0x29')]})[_0xdf3c('0x19')](function(_0x55fd73){_0x50753f[_0xdf3c('0x15')]=_0x55fd73;if(_0x1b279f[_0xdf3c('0x2b')][_0xdf3c('0x37')]){_0x12f737[_0xdf3c('0x2a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xdf3c('0x2c')](_0x12f737);})[_0xdf3c('0x19')](function(_0x54b7b8){_0x50753f['rows']=_0x54b7b8;return _0x50753f;});}})[_0xdf3c('0x19')](respondWithFilteredResult(_0xe01538,_0x12f737))[_0xdf3c('0x2e')](handleError(_0xe01538,null));};exports[_0xdf3c('0x53')]=function(_0x1aaf8b,_0x44dd2a){var _0x56fc77={'raw':!![],'where':{}};var _0x50105b={};var _0x471d8f={'count':0x0,'rows':[]};return db[_0xdf3c('0x26')][_0xdf3c('0x4a')]({'where':{'id':_0x1aaf8b[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x44dd2a,null))['then'](function(_0x30235e){if(_0x30235e){_0x50105b[_0xdf3c('0x34')]=_[_0xdf3c('0x30')](db[_0xdf3c('0x54')][_0xdf3c('0x44')]);_0x50105b['query']=_['keys'](_0x1aaf8b['query']);_0x50105b[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x50105b[_0xdf3c('0x34')],_0x50105b[_0xdf3c('0x2b')]);_0x56fc77[_0xdf3c('0x33')]=_[_0xdf3c('0x32')](_0x50105b[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0x1aaf8b['query'][_0xdf3c('0x35')]));_0x56fc77[_0xdf3c('0x33')]=_0x56fc77[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x56fc77[_0xdf3c('0x33')]:_0x50105b[_0xdf3c('0x34')];if(!_0x1aaf8b['query'][_0xdf3c('0x4b')](_0xdf3c('0x55'))){_0x56fc77['limit']=qs['limit'](_0x1aaf8b[_0xdf3c('0x2b')]['limit']);_0x56fc77[_0xdf3c('0x12')]=qs[_0xdf3c('0x12')](_0x1aaf8b['query'][_0xdf3c('0x12')]);}_0x56fc77[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_0x1aaf8b[_0xdf3c('0x2b')][_0xdf3c('0x4d')]);_0x56fc77[_0xdf3c('0x29')]=qs['filters'](_[_0xdf3c('0x4e')](_0x1aaf8b[_0xdf3c('0x2b')],_0x50105b[_0xdf3c('0x31')]));_0x56fc77[_0xdf3c('0x29')][_0xdf3c('0x4f')]=_0x30235e['id'];if(_0x1aaf8b[_0xdf3c('0x2b')][_0xdf3c('0x1f')]){_0x56fc77['where']=_['merge'](_0x56fc77[_0xdf3c('0x29')],{'$or':_[_0xdf3c('0x20')](_0x56fc77[_0xdf3c('0x33')],function(_0x5b6419){var _0x38c374={};_0x38c374[_0x5b6419]={'$like':'%'+_0x1aaf8b['query']['filter']+'%'};return _0x38c374;})});}_0x56fc77=_[_0xdf3c('0x45')]({},_0x56fc77,_0x1aaf8b[_0xdf3c('0x38')]);return db['CmHopperFinal'][_0xdf3c('0x15')]({'where':_0x56fc77['where']})[_0xdf3c('0x19')](function(_0x4b35ff){_0x471d8f[_0xdf3c('0x15')]=_0x4b35ff;if(_0x1aaf8b[_0xdf3c('0x2b')][_0xdf3c('0x37')]){_0x56fc77[_0xdf3c('0x2a')]=[{'all':!![]}];}return db[_0xdf3c('0x54')][_0xdf3c('0x2c')](_0x56fc77);})[_0xdf3c('0x19')](function(_0x2dc0d2){_0x471d8f[_0xdf3c('0x2d')]=_0x2dc0d2;return _0x471d8f;});}})[_0xdf3c('0x19')](respondWithFilteredResult(_0x44dd2a,_0x56fc77))[_0xdf3c('0x2e')](handleError(_0x44dd2a,null));};exports[_0xdf3c('0x56')]=function(_0x10528d,_0x1acc47){var _0x5b3aa5={'raw':!![],'where':{}};var _0x3cf465={};var _0x22bacf={'count':0x0,'rows':[]};return db[_0xdf3c('0x26')]['findOne']({'where':{'id':_0x10528d[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x1acc47,null))[_0xdf3c('0x19')](function(_0x6e1899){if(_0x6e1899){_0x3cf465[_0xdf3c('0x34')]=_[_0xdf3c('0x30')](db[_0xdf3c('0x57')][_0xdf3c('0x44')]);_0x3cf465[_0xdf3c('0x2b')]=_[_0xdf3c('0x30')](_0x10528d[_0xdf3c('0x2b')]);_0x3cf465['filters']=_[_0xdf3c('0x32')](_0x3cf465[_0xdf3c('0x34')],_0x3cf465[_0xdf3c('0x2b')]);_0x5b3aa5[_0xdf3c('0x33')]=_[_0xdf3c('0x32')](_0x3cf465[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0x10528d[_0xdf3c('0x2b')][_0xdf3c('0x35')]));_0x5b3aa5[_0xdf3c('0x33')]=_0x5b3aa5[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x5b3aa5['attributes']:_0x3cf465[_0xdf3c('0x34')];if(!_0x10528d[_0xdf3c('0x2b')][_0xdf3c('0x4b')](_0xdf3c('0x55'))){_0x5b3aa5[_0xdf3c('0x14')]=qs[_0xdf3c('0x14')](_0x10528d[_0xdf3c('0x2b')]['limit']);_0x5b3aa5[_0xdf3c('0x12')]=qs[_0xdf3c('0x12')](_0x10528d[_0xdf3c('0x2b')][_0xdf3c('0x12')]);}_0x5b3aa5['order']=qs[_0xdf3c('0x4d')](_0x10528d[_0xdf3c('0x2b')]['sort']);_0x5b3aa5[_0xdf3c('0x29')]=qs['filters'](_[_0xdf3c('0x4e')](_0x10528d[_0xdf3c('0x2b')],_0x3cf465['filters']));_0x5b3aa5[_0xdf3c('0x29')][_0xdf3c('0x4f')]=_0x6e1899['id'];if(_0x10528d[_0xdf3c('0x2b')]['filter']){_0x5b3aa5['where']=_[_0xdf3c('0x45')](_0x5b3aa5['where'],{'$or':_[_0xdf3c('0x20')](_0x5b3aa5[_0xdf3c('0x33')],function(_0x161604){var _0x91dd6e={};_0x91dd6e[_0x161604]={'$like':'%'+_0x10528d['query'][_0xdf3c('0x1f')]+'%'};return _0x91dd6e;})});}_0x5b3aa5=_[_0xdf3c('0x45')]({},_0x5b3aa5,_0x10528d['options']);return db[_0xdf3c('0x57')]['count']({'where':_0x5b3aa5[_0xdf3c('0x29')]})[_0xdf3c('0x19')](function(_0x5429b6){_0x22bacf['count']=_0x5429b6;if(_0x10528d[_0xdf3c('0x2b')]['includeAll']){_0x5b3aa5[_0xdf3c('0x2a')]=[{'all':!![]}];}return db[_0xdf3c('0x57')][_0xdf3c('0x2c')](_0x5b3aa5);})[_0xdf3c('0x19')](function(_0x19a723){_0x22bacf[_0xdf3c('0x2d')]=_0x19a723;return _0x22bacf;});}})[_0xdf3c('0x19')](respondWithFilteredResult(_0x1acc47,_0x5b3aa5))[_0xdf3c('0x2e')](handleError(_0x1acc47,null));};exports[_0xdf3c('0x58')]=function(_0x3d8ff0,_0x2a2f03){var _0x55975e={};var _0x4299d1={};var _0x132c27;var _0x52a641;return db[_0xdf3c('0x26')][_0xdf3c('0x4a')]({'where':{'id':_0x3d8ff0[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x2a2f03,null))[_0xdf3c('0x19')](function(_0x12576e){if(_0x12576e){_0x132c27=_0x12576e;_0x4299d1['model']=_[_0xdf3c('0x30')](db['Team'][_0xdf3c('0x44')]);_0x4299d1[_0xdf3c('0x2b')]=_[_0xdf3c('0x30')](_0x3d8ff0[_0xdf3c('0x2b')]);_0x4299d1[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x4299d1['model'],_0x4299d1[_0xdf3c('0x2b')]);_0x55975e[_0xdf3c('0x33')]=_['intersection'](_0x4299d1[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0x3d8ff0[_0xdf3c('0x2b')][_0xdf3c('0x35')]));_0x55975e[_0xdf3c('0x33')]=_0x55975e[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x55975e[_0xdf3c('0x33')]:_0x4299d1['model'];_0x55975e['order']=qs[_0xdf3c('0x4d')](_0x3d8ff0[_0xdf3c('0x2b')][_0xdf3c('0x4d')]);_0x55975e[_0xdf3c('0x29')]=qs['filters'](_['pick'](_0x3d8ff0[_0xdf3c('0x2b')],_0x4299d1['filters']));if(_0x3d8ff0[_0xdf3c('0x2b')]['filter']){_0x55975e[_0xdf3c('0x29')]=_[_0xdf3c('0x45')](_0x55975e[_0xdf3c('0x29')],{'$or':_['map'](_0x55975e[_0xdf3c('0x33')],function(_0x142cd0){var _0x5bf9a9={};_0x5bf9a9[_0x142cd0]={'$like':'%'+_0x3d8ff0['query'][_0xdf3c('0x1f')]+'%'};return _0x5bf9a9;})});}_0x55975e=_[_0xdf3c('0x45')]({},_0x55975e,_0x3d8ff0[_0xdf3c('0x38')]);return _0x132c27[_0xdf3c('0x58')](_0x55975e);}})[_0xdf3c('0x19')](function(_0x294682){if(_0x294682){_0x52a641=_0x294682[_0xdf3c('0x36')];if(!_0x3d8ff0['query']['hasOwnProperty'](_0xdf3c('0x55'))){_0x55975e[_0xdf3c('0x14')]=qs[_0xdf3c('0x14')](_0x3d8ff0[_0xdf3c('0x2b')][_0xdf3c('0x14')]);_0x55975e[_0xdf3c('0x12')]=qs[_0xdf3c('0x12')](_0x3d8ff0[_0xdf3c('0x2b')][_0xdf3c('0x12')]);}return _0x132c27[_0xdf3c('0x58')](_0x55975e);}})[_0xdf3c('0x19')](function(_0x322cf5){if(_0x322cf5){return _0x322cf5?{'count':_0x52a641,'rows':_0x322cf5}:null;}})[_0xdf3c('0x19')](respondWithResult(_0x2a2f03,null))[_0xdf3c('0x2e')](handleError(_0x2a2f03,null));};exports[_0xdf3c('0x59')]=function(_0x199ff0,_0x244bf0){var _0x1a0d61=_0x199ff0[_0xdf3c('0x3b')]['teams'];var _0x4c6615=_[_0xdf3c('0x20')](_0x1a0d61,'id');return db['Team']['findAll']({'where':{'id':_0x4c6615},'attributes':['id'],'include':[{'model':db[_0xdf3c('0x5a')],'as':'Agents','attributes':['id',_0xdf3c('0x24'),_0xdf3c('0x5b'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1c7b50){if(_0x1c7b50){var _0x3e0a0f=_[_0xdf3c('0x5c')](_0x1c7b50,function(_0x4d5216){var _0x197b8a=_0x4d5216['get']({'plain':!![]});_0x197b8a[_0xdf3c('0x5d')]['forEach'](function(_0x5b0101){_0x5b0101[_0xdf3c('0x5e')]=_[_0xdf3c('0x39')](_0x1a0d61,{'id':_0x197b8a['id']})[_0xdf3c('0x5e')];});return _0x197b8a[_0xdf3c('0x5d')];});return db[_0xdf3c('0x26')][_0xdf3c('0x39')]({'where':{'id':_0x199ff0['params']['id']}})['then'](function(_0x128a4e){return db['sequelize'][_0xdf3c('0x5f')](function(_0x14244a){return _0x128a4e[_0xdf3c('0x59')](_0x4c6615,{'transaction':_0x14244a})[_0xdf3c('0x19')](function(){return BPromise[_0xdf3c('0x60')](_0x1a0d61,function(_0x619c66){return db[_0xdf3c('0x61')]['upsert']({'TeamId':_0x619c66['id'],'VoiceQueueId':_0x199ff0['params']['id'],'penalty':_0x619c66[_0xdf3c('0x5e')]},{'transaction':_0x14244a});});})[_0xdf3c('0x19')](function(){return BPromise[_0xdf3c('0x60')](_0x3e0a0f,function(_0x13a882){return db['UserVoiceQueue'][_0xdf3c('0x62')]({'where':{'UserId':_0x13a882['id'],'VoiceQueueId':_0x199ff0[_0xdf3c('0x2f')]['id']},'defaults':{'penalty':_0x13a882[_0xdf3c('0x5e')]},'transaction':_0x14244a});});})[_0xdf3c('0x19')](function(){return BPromise[_0xdf3c('0x60')](_[_0xdf3c('0x1f')](_0x3e0a0f,{'online':!![]}),function(_0x524482){return db[_0xdf3c('0x63')][_0xdf3c('0x64')]({'membername':_0x524482['name'],'UserId':_0x524482['id'],'queue_name':_0x128a4e[_0xdf3c('0x24')],'VoiceQueueId':_0x128a4e['id'],'interface':_[_0xdf3c('0x65')](_0x524482[_0xdf3c('0x66')])?util['format'](_0xdf3c('0x67'),_0x524482[_0xdf3c('0x24')]):_0x524482[_0xdf3c('0x66')],'paused':_0x524482[_0xdf3c('0x68')]||![],'penalty':_0x524482[_0xdf3c('0x5e')]},{'transaction':_0x14244a});});})[_0xdf3c('0x19')](function(){_0x3e0a0f[_0xdf3c('0x69')](function(_0x12ffd3){socket[_0xdf3c('0x6a')]('userVoiceQueue:save',{'UserId':_0x12ffd3['id'],'VoiceQueueId':_0x128a4e['id']});});});});});}})[_0xdf3c('0x19')](respondWithStatusCode(_0x244bf0,null))['catch'](handleError(_0x244bf0,null));};exports[_0xdf3c('0x6b')]=function(_0x160568,_0xfcf42f){return db[_0xdf3c('0x6c')][_0xdf3c('0x2c')]({'where':{'id':_0x160568[_0xdf3c('0x2b')][_0xdf3c('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xdf3c('0x5a')],'as':_0xdf3c('0x5d'),'attributes':['id'],'raw':!![]}]})[_0xdf3c('0x19')](handleEntityNotFound(_0xfcf42f,null))[_0xdf3c('0x19')](function(_0x5f09a0){var _0x379996=_[_0xdf3c('0x20')](_0x5f09a0,'id');var _0x5f1b51=[];var _0x323058=[];var _0x8fd9e4=squel[_0xdf3c('0x6e')]();_0x8fd9e4[_0xdf3c('0x6f')]('tq.TeamId')[_0xdf3c('0x70')](_0xdf3c('0x71'),'tq')[_0xdf3c('0x72')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xdf3c('0x73'),_0x160568[_0xdf3c('0x2f')]['id']);for(var _0x403ac5=0x0;_0x403ac5<_0x5f09a0[_0xdf3c('0x36')];_0x403ac5+=0x1){let _0x44d862=_0x5f09a0[_0x403ac5];for(var _0x33132b=0x0;_0x33132b<_0x44d862[_0xdf3c('0x5d')][_0xdf3c('0x36')];_0x33132b+=0x1){let _0x49c29e=_0x44d862[_0xdf3c('0x5d')][_0x33132b];var _0x5e868a=_0x8fd9e4[_0xdf3c('0x43')]();_0x5e868a[_0xdf3c('0x29')](_0xdf3c('0x74'),_0x49c29e['id']);_0x323058[_0xdf3c('0x75')](db[_0xdf3c('0x76')][_0xdf3c('0x2b')](_0x5e868a['toString'](),{'type':db[_0xdf3c('0x76')][_0xdf3c('0x77')]['SELECT']})[_0xdf3c('0x19')](function(_0x270353){if(_0x270353[_0xdf3c('0x36')]===0x1){return _0x49c29e['id'];}else{var _0x3f6df9=_['every'](_[_0xdf3c('0x20')](_0x270353,'TeamId'),function(_0x7d9a0f){return _[_0xdf3c('0x22')](_0x379996,_0x7d9a0f);});if(_0x3f6df9){return _0x49c29e['id'];}}}));}}return BPromise[_0xdf3c('0x78')](_0x323058)[_0xdf3c('0x19')](function(_0x17669f){_0x5f1b51=_(_0x5f1b51)[_0xdf3c('0x79')](_0x17669f)['compact']()['value']();return db['VoiceQueue'][_0xdf3c('0x39')]({'where':{'id':_0x160568[_0xdf3c('0x2f')]['id']}})['then'](function(_0x528c97){return db[_0xdf3c('0x76')]['transaction'](function(_0x58a2d8){return _0x528c97['removeTeams'](_0x160568[_0xdf3c('0x2b')][_0xdf3c('0x6d')],{'transaction':_0x58a2d8})[_0xdf3c('0x19')](function(){if(!_['isEmpty'](_0x5f1b51)){return _0x528c97[_0xdf3c('0x7a')](_0x5f1b51,{'transaction':_0x58a2d8})['then'](function(){return db[_0xdf3c('0x63')][_0xdf3c('0x1a')]({'where':{'VoiceQueueId':_0x160568[_0xdf3c('0x2f')]['id'],'UserId':_0x5f1b51},'transaction':_0x58a2d8});});}})[_0xdf3c('0x19')](function(){_0x5f1b51[_0xdf3c('0x69')](function(_0x467090){socket[_0xdf3c('0x6a')](_0xdf3c('0x7b'),{'UserId':_0x467090,'VoiceQueueId':_0x528c97['id']});});});});});});})[_0xdf3c('0x19')](respondWithStatusCode(_0xfcf42f,null))['catch'](handleError(_0xfcf42f,null));};exports[_0xdf3c('0x7c')]=function(_0x4652af,_0x5e08bc){var _0x2702ca,_0x1e8646;return db['VoiceQueue'][_0xdf3c('0x39')]({'where':{'id':_0x4652af['params']['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x5e08bc,null))[_0xdf3c('0x19')](function(_0x3ea47d){if(_0x3ea47d){_0x1e8646=_0x3ea47d;return _0x3ea47d[_0xdf3c('0x7c')](_0x4652af[_0xdf3c('0x3b')][_0xdf3c('0x6d')],_[_0xdf3c('0x46')](_0x4652af[_0xdf3c('0x3b')],[_0xdf3c('0x6d'),'id'])||{})[_0xdf3c('0x7d')](function(_0xfdb4e2){for(var _0x1c31ee=0x0;_0x1c31ee<_0x4652af[_0xdf3c('0x3b')][_0xdf3c('0x6d')][_0xdf3c('0x36')];_0x1c31ee+=0x1){socket[_0xdf3c('0x6a')]('userVoiceQueue:save',{'UserId':Number(_0x4652af[_0xdf3c('0x3b')][_0xdf3c('0x6d')][_0x1c31ee]),'VoiceQueueId':Number(_0x4652af['params']['id'])});}return _0xfdb4e2;});}})[_0xdf3c('0x19')](function(_0xf39067){_0x2702ca=_0xf39067||[];if(_0x1e8646){return db[_0xdf3c('0x5a')][_0xdf3c('0x2c')]({'where':{'id':_0x4652af['body'][_0xdf3c('0x6d')]},'attributes':['id',_0xdf3c('0x24'),'online',_0xdf3c('0x68'),_0xdf3c('0x66')],'raw':!![]});}})['then'](function(_0x59c8f9){if(!_[_0xdf3c('0x7e')](_0x59c8f9)){var _0x388f8d=[];for(var _0x1c4964=0x0;_0x1c4964<_0x59c8f9['length'];_0x1c4964++){if(_0x59c8f9[_0x1c4964][_0xdf3c('0x5b')]){_0x388f8d['push'](db[_0xdf3c('0x63')][_0xdf3c('0x64')]({'membername':_0x59c8f9[_0x1c4964][_0xdf3c('0x24')],'UserId':_0x59c8f9[_0x1c4964]['id'],'queue_name':_0x1e8646[_0xdf3c('0x24')],'VoiceQueueId':_0x1e8646['id'],'interface':_[_0xdf3c('0x65')](_0x59c8f9[_0x1c4964][_0xdf3c('0x66')])?util['format'](_0xdf3c('0x67'),_0x59c8f9[_0x1c4964]['name']):_0x59c8f9[_0x1c4964][_0xdf3c('0x66')],'paused':_0x59c8f9[_0x1c4964][_0xdf3c('0x68')]||![],'penalty':_0x4652af[_0xdf3c('0x3b')]['penalty']||0x0}));}}return BPromise[_0xdf3c('0x78')](_0x388f8d);}})['then'](function(){return _0x2702ca;})[_0xdf3c('0x19')](respondWithResult(_0x5e08bc,null))[_0xdf3c('0x2e')](handleError(_0x5e08bc,null));};exports['removeAgents']=function(_0x153bce,_0x4185f0){return db[_0xdf3c('0x26')][_0xdf3c('0x39')]({'where':{'id':_0x153bce['params']['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x4185f0,null))[_0xdf3c('0x19')](function(_0xa61c3f){if(_0xa61c3f){return _0xa61c3f[_0xdf3c('0x7a')](_0x153bce[_0xdf3c('0x2b')][_0xdf3c('0x6d')])[_0xdf3c('0x19')](function(){if(_['isArray'](_0x153bce[_0xdf3c('0x2b')][_0xdf3c('0x6d')])){for(var _0x26251d=0x0;_0x26251d<_0x153bce[_0xdf3c('0x2b')][_0xdf3c('0x6d')][_0xdf3c('0x36')];_0x26251d+=0x1){socket[_0xdf3c('0x6a')](_0xdf3c('0x7b'),{'UserId':Number(_0x153bce[_0xdf3c('0x2b')][_0xdf3c('0x6d')][_0x26251d]),'VoiceQueueId':Number(_0x153bce[_0xdf3c('0x2f')]['id'])});}}else{socket['emit'](_0xdf3c('0x7b'),{'UserId':Number(_0x153bce[_0xdf3c('0x2b')][_0xdf3c('0x6d')]),'VoiceQueueId':Number(_0x153bce['params']['id'])});}});}})[_0xdf3c('0x19')](function(_0x109153){return db[_0xdf3c('0x63')][_0xdf3c('0x1a')]({'where':{'VoiceQueueId':_0x153bce[_0xdf3c('0x2f')]['id'],'UserId':_0x153bce['query'][_0xdf3c('0x6d')]}})[_0xdf3c('0x19')](function(){return _0x109153;});})['then'](respondWithStatusCode(_0x4185f0,null))[_0xdf3c('0x2e')](handleError(_0x4185f0,null));};exports[_0xdf3c('0x7f')]=function(_0x38c6f3,_0xb39cc){var _0xcc2f18={};var _0x13ee9b={};var _0x8d7c0c;var _0x3d9041;return db[_0xdf3c('0x26')]['findOne']({'where':{'id':_0x38c6f3[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0xb39cc,null))['then'](function(_0x39bc51){if(_0x39bc51){_0x8d7c0c=_0x39bc51;_0x13ee9b[_0xdf3c('0x34')]=_['keys'](db['User'][_0xdf3c('0x44')]);_0x13ee9b[_0xdf3c('0x2b')]=_[_0xdf3c('0x30')](_0x38c6f3[_0xdf3c('0x2b')]);_0x13ee9b[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x13ee9b[_0xdf3c('0x34')],_0x13ee9b[_0xdf3c('0x2b')]);_0xcc2f18['attributes']=_[_0xdf3c('0x32')](_0x13ee9b[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0x38c6f3[_0xdf3c('0x2b')]['fields']));_0xcc2f18[_0xdf3c('0x33')]=_0xcc2f18[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0xcc2f18[_0xdf3c('0x33')]:_0x13ee9b['model'];_0xcc2f18[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_0x38c6f3[_0xdf3c('0x2b')]['sort']);_0xcc2f18['where']=qs[_0xdf3c('0x31')](_[_0xdf3c('0x4e')](_0x38c6f3[_0xdf3c('0x2b')],_0x13ee9b['filters']));if(_0x38c6f3[_0xdf3c('0x2b')][_0xdf3c('0x1f')]){_0xcc2f18[_0xdf3c('0x29')]=_[_0xdf3c('0x45')](_0xcc2f18[_0xdf3c('0x29')],{'$or':_['map'](_0xcc2f18['attributes'],function(_0x1cd1a7){var _0x48141c={};_0x48141c[_0x1cd1a7]={'$like':'%'+_0x38c6f3[_0xdf3c('0x2b')][_0xdf3c('0x1f')]+'%'};return _0x48141c;})});}_0xcc2f18=_[_0xdf3c('0x45')]({},_0xcc2f18,_0x38c6f3[_0xdf3c('0x38')]);return _0x8d7c0c[_0xdf3c('0x7f')](_0xcc2f18);}})[_0xdf3c('0x19')](function(_0x5a56b5){if(_0x5a56b5){_0x3d9041=_0x5a56b5[_0xdf3c('0x36')];if(!_0x38c6f3[_0xdf3c('0x2b')][_0xdf3c('0x4b')](_0xdf3c('0x55'))){_0xcc2f18['limit']=qs[_0xdf3c('0x14')](_0x38c6f3[_0xdf3c('0x2b')][_0xdf3c('0x14')]);_0xcc2f18['offset']=qs['offset'](_0x38c6f3[_0xdf3c('0x2b')][_0xdf3c('0x12')]);}return _0x8d7c0c['getAgents'](_0xcc2f18);}})[_0xdf3c('0x19')](function(_0x5eebe3){if(_0x5eebe3){return _0x5eebe3?{'count':_0x3d9041,'rows':_0x5eebe3}:null;}})[_0xdf3c('0x19')](respondWithResult(_0xb39cc,null))[_0xdf3c('0x2e')](handleError(_0xb39cc,null));};exports[_0xdf3c('0x80')]=function(_0x1961cd,_0x30659d){var _0x27f25a={};var _0x5e5dad={};var _0x19ce27;var _0x2c24b7;return db[_0xdf3c('0x26')][_0xdf3c('0x4a')]({'where':{'id':_0x1961cd[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x30659d,null))[_0xdf3c('0x19')](function(_0x1dee13){if(_0x1dee13){_0x19ce27=_0x1dee13;_0x5e5dad[_0xdf3c('0x34')]=_[_0xdf3c('0x30')](db[_0xdf3c('0x63')]['rawAttributes']);_0x5e5dad[_0xdf3c('0x2b')]=_[_0xdf3c('0x30')](_0x1961cd['query']);_0x5e5dad[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x5e5dad[_0xdf3c('0x34')],_0x5e5dad[_0xdf3c('0x2b')]);_0x27f25a[_0xdf3c('0x33')]=_['intersection'](_0x5e5dad[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0x1961cd[_0xdf3c('0x2b')][_0xdf3c('0x35')]));_0x27f25a[_0xdf3c('0x33')]=_0x27f25a[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x27f25a[_0xdf3c('0x33')]:_0x5e5dad[_0xdf3c('0x34')];_0x27f25a[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_0x1961cd[_0xdf3c('0x2b')][_0xdf3c('0x4d')]);_0x27f25a['where']=qs[_0xdf3c('0x31')](_[_0xdf3c('0x4e')](_0x1961cd['query'],_0x5e5dad[_0xdf3c('0x31')]));if(_0x1961cd[_0xdf3c('0x2b')][_0xdf3c('0x1f')]){_0x27f25a[_0xdf3c('0x29')]=_[_0xdf3c('0x45')](_0x27f25a[_0xdf3c('0x29')],{'$or':_[_0xdf3c('0x20')](_0x27f25a[_0xdf3c('0x33')],function(_0xc3b6a1){var _0x3d9a1e={};_0x3d9a1e[_0xc3b6a1]={'$like':'%'+_0x1961cd['query'][_0xdf3c('0x1f')]+'%'};return _0x3d9a1e;})});}_0x27f25a=_[_0xdf3c('0x45')]({},_0x27f25a,_0x1961cd['options']);return _0x19ce27[_0xdf3c('0x80')](_0x27f25a);}})['then'](function(_0x330ee0){if(_0x330ee0){_0x2c24b7=_0x330ee0['length'];if(!_0x1961cd[_0xdf3c('0x2b')]['hasOwnProperty'](_0xdf3c('0x55'))){_0x27f25a[_0xdf3c('0x14')]=qs[_0xdf3c('0x14')](_0x1961cd[_0xdf3c('0x2b')][_0xdf3c('0x14')]);_0x27f25a[_0xdf3c('0x12')]=qs[_0xdf3c('0x12')](_0x1961cd[_0xdf3c('0x2b')]['offset']);}return _0x19ce27[_0xdf3c('0x80')](_0x27f25a);}})[_0xdf3c('0x19')](function(_0x1b3daa){return _0x1b3daa?{'count':_0x2c24b7,'rows':_0x1b3daa}:null;})['then'](respondWithResult(_0x30659d,null))[_0xdf3c('0x2e')](handleError(_0x30659d,null));};exports[_0xdf3c('0x81')]=function(_0x30e5ab,_0x465c59){var _0x571f14={};var _0x55a4fa={};var _0x4f7b39;var _0x5e5af3;return db[_0xdf3c('0x26')][_0xdf3c('0x4a')]({'where':{'id':_0x30e5ab[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x465c59,null))[_0xdf3c('0x19')](function(_0x323d9b){if(_0x323d9b){_0x4f7b39=_0x323d9b;_0x55a4fa[_0xdf3c('0x34')]=_['keys'](db[_0xdf3c('0x82')]['rawAttributes']);_0x55a4fa[_0xdf3c('0x2b')]=_[_0xdf3c('0x30')](_0x30e5ab[_0xdf3c('0x2b')]);_0x55a4fa[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x55a4fa[_0xdf3c('0x34')],_0x55a4fa[_0xdf3c('0x2b')]);_0x571f14[_0xdf3c('0x33')]=_['intersection'](_0x55a4fa[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0x30e5ab[_0xdf3c('0x2b')][_0xdf3c('0x35')]));_0x571f14[_0xdf3c('0x33')]=_0x571f14['attributes']['length']?_0x571f14[_0xdf3c('0x33')]:_0x55a4fa[_0xdf3c('0x34')];_0x571f14[_0xdf3c('0x4c')]=qs[_0xdf3c('0x4d')](_0x30e5ab[_0xdf3c('0x2b')][_0xdf3c('0x4d')]);_0x571f14[_0xdf3c('0x29')]=qs[_0xdf3c('0x31')](_[_0xdf3c('0x4e')](_0x30e5ab[_0xdf3c('0x2b')],_0x55a4fa[_0xdf3c('0x31')]));if(_0x30e5ab['query'][_0xdf3c('0x1f')]){_0x571f14[_0xdf3c('0x29')]=_[_0xdf3c('0x45')](_0x571f14[_0xdf3c('0x29')],{'$or':_[_0xdf3c('0x20')](_0x571f14[_0xdf3c('0x33')],function(_0x184a55){var _0x4e8ad8={};_0x4e8ad8[_0x184a55]={'$like':'%'+_0x30e5ab[_0xdf3c('0x2b')]['filter']+'%'};return _0x4e8ad8;})});}_0x571f14=_[_0xdf3c('0x45')]({},_0x571f14,_0x30e5ab['options']);return _0x4f7b39[_0xdf3c('0x81')](_0x571f14);}})[_0xdf3c('0x19')](function(_0x54d975){if(_0x54d975){_0x5e5af3=_0x54d975['length'];if(!_0x30e5ab[_0xdf3c('0x2b')][_0xdf3c('0x4b')](_0xdf3c('0x55'))){_0x571f14[_0xdf3c('0x14')]=qs[_0xdf3c('0x14')](_0x30e5ab['query'][_0xdf3c('0x14')]);_0x571f14[_0xdf3c('0x12')]=qs[_0xdf3c('0x12')](_0x30e5ab[_0xdf3c('0x2b')][_0xdf3c('0x12')]);}return _0x4f7b39['getLists'](_0x571f14);}})[_0xdf3c('0x19')](function(_0x55a593){if(_0x55a593){return _0x55a593?{'count':_0x5e5af3,'rows':_0x55a593}:null;}})[_0xdf3c('0x19')](respondWithResult(_0x465c59,null))['catch'](handleError(_0x465c59,null));};exports['addLists']=function(_0x42d720,_0x2da908){var _0x3e2a89=moment()[_0xdf3c('0x83')](_0xdf3c('0x84'));var _0x4f4afd,_0xd3d760;return db[_0xdf3c('0x26')]['find']({'where':{'id':_0x42d720[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x2da908,null))[_0xdf3c('0x19')](function(_0x386a3b){if(_0x386a3b){_0xd3d760=_0x386a3b;return _0x386a3b[_0xdf3c('0x85')](_0x42d720['body'][_0xdf3c('0x6d')],_[_0xdf3c('0x46')](_0x42d720[_0xdf3c('0x3b')],[_0xdf3c('0x6d'),'id'])||{});}return null;})[_0xdf3c('0x7d')](function(_0x511630){var _0x2cf46;_0x4f4afd=_0x511630||[];var _0x43fc55=[];if(_0x511630){for(var _0x81b8dd=0x0;_0x81b8dd<_0x511630[_0xdf3c('0x36')];_0x81b8dd+=0x1){var _0xb852c5=_0x511630[_0x81b8dd][_0xdf3c('0x1b')]({'plain':!![]});_0xd3d760[_0xdf3c('0x86')]=_0x42d720[_0xdf3c('0x3b')][_0xdf3c('0x86')]?_0x42d720[_0xdf3c('0x3b')][_0xdf3c('0x86')]:_0xd3d760[_0xdf3c('0x86')];switch(_0xd3d760[_0xdf3c('0x86')]){case _0xdf3c('0x87'):_0x2cf46=squel[_0xdf3c('0x88')]()[_0xdf3c('0x89')](_0xdf3c('0x8a'))[_0xdf3c('0x8b')](['phone',_0xdf3c('0x8c'),_0xdf3c('0x8d'),_0xdf3c('0x8e'),'VoiceQueueId',_0xdf3c('0x48'),'updatedAt'],squel[_0xdf3c('0x6e')]()['field'](_0xdf3c('0x8f'),_0xdf3c('0x8f'))[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x8c'))[_0xdf3c('0x6f')]('id',_0xdf3c('0x8d'))[_0xdf3c('0x6f')](_0xb852c5[_0xdf3c('0x90')][_0xdf3c('0x91')](),'ListId')[_0xdf3c('0x6f')](_0x42d720[_0xdf3c('0x2f')]['id'][_0xdf3c('0x91')](),_0xdf3c('0x4f'))['field']('\x27'+_0x3e2a89+'\x27','createdAt')[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x47'))[_0xdf3c('0x70')](_0xdf3c('0x92'))['where'](_0xdf3c('0x93'))['where']('ListId\x20=\x20?',_0xb852c5[_0xdf3c('0x90')][_0xdf3c('0x91')]())['where'](_0xdf3c('0x94'))[_0xdf3c('0x29')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdf3c('0x6e')]()[_0xdf3c('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0xdf3c('0x70')](_0xdf3c('0x95'))[_0xdf3c('0x29')](_0xdf3c('0x73'),_0x42d720[_0xdf3c('0x2f')]['id'][_0xdf3c('0x91')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdf3c('0x6e')]()[_0xdf3c('0x6f')](_0xdf3c('0x96'))[_0xdf3c('0x70')](_0xdf3c('0x8a'))[_0xdf3c('0x29')]('VoiceQueueId\x20=\x20?',_0x42d720[_0xdf3c('0x2f')]['id'][_0xdf3c('0x91')]())))[_0xdf3c('0x91')]();break;case _0xdf3c('0x97'):_0x2cf46=squel['insert']()[_0xdf3c('0x89')](_0xdf3c('0x8a'))['fromQuery']([_0xdf3c('0x8f'),_0xdf3c('0x8c'),_0xdf3c('0x8d'),_0xdf3c('0x8e'),'VoiceQueueId',_0xdf3c('0x48'),_0xdf3c('0x47')],squel[_0xdf3c('0x6e')]()[_0xdf3c('0x6f')]('phone','phone')[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x8c'))[_0xdf3c('0x6f')]('id',_0xdf3c('0x8d'))[_0xdf3c('0x6f')](_0xb852c5[_0xdf3c('0x90')][_0xdf3c('0x91')](),_0xdf3c('0x8e'))['field'](_0x42d720[_0xdf3c('0x2f')]['id'][_0xdf3c('0x91')](),'VoiceQueueId')[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x48'))['field']('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x47'))['from'](_0xdf3c('0x92'))[_0xdf3c('0x29')](_0xdf3c('0x93'))[_0xdf3c('0x29')]('ListId\x20=\x20?',_0xb852c5['CmListId']['toString']())[_0xdf3c('0x29')](_0xdf3c('0x94'))[_0xdf3c('0x29')](_0xdf3c('0x98'),squel[_0xdf3c('0x6e')]()[_0xdf3c('0x6f')](_0xdf3c('0x96'))['from'](_0xdf3c('0x8a'))[_0xdf3c('0x29')]('VoiceQueueId\x20=\x20?',_0x42d720[_0xdf3c('0x2f')]['id']['toString']())))[_0xdf3c('0x91')]();break;default:_0x2cf46=squel[_0xdf3c('0x88')]()[_0xdf3c('0x89')]('cm_hopper')[_0xdf3c('0x8b')]([_0xdf3c('0x8f'),_0xdf3c('0x8c'),_0xdf3c('0x8d'),_0xdf3c('0x8e'),'VoiceQueueId',_0xdf3c('0x48'),_0xdf3c('0x47')],squel[_0xdf3c('0x6e')]()[_0xdf3c('0x6f')](_0xdf3c('0x8f'),_0xdf3c('0x8f'))[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27','scheduledAt')[_0xdf3c('0x6f')]('id',_0xdf3c('0x8d'))[_0xdf3c('0x6f')](_0xb852c5['CmListId'][_0xdf3c('0x91')](),'ListId')[_0xdf3c('0x6f')](_0x42d720[_0xdf3c('0x2f')]['id']['toString'](),_0xdf3c('0x4f'))[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x48'))[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x47'))[_0xdf3c('0x70')](_0xdf3c('0x92'))[_0xdf3c('0x29')](_0xdf3c('0x93'))[_0xdf3c('0x29')](_0xdf3c('0x99'),_0xb852c5[_0xdf3c('0x90')]['toString']())[_0xdf3c('0x29')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x43fc55['push'](db['sequelize'][_0xdf3c('0x2b')](_0x2cf46));}return BPromise[_0xdf3c('0x78')](_0x43fc55);}})[_0xdf3c('0x19')](function(){var _0x1eb736=[];var _0x321ff1=squel[_0xdf3c('0x88')]()['into'](_0xdf3c('0x9a'))['fromQuery']([_0xdf3c('0x9b'),_0xdf3c('0x8f'),_0xdf3c('0x9c'),_0xdf3c('0x48'),_0xdf3c('0x47')],squel[_0xdf3c('0x6e')]()[_0xdf3c('0x6f')](_0xdf3c('0x9d'))[_0xdf3c('0x6f')]('ci.item')[_0xdf3c('0x6f')](_0xdf3c('0x9e'))[_0xdf3c('0x6f')]('\x27'+_0x3e2a89+'\x27',_0xdf3c('0x48'))['field']('\x27'+_0x3e2a89+'\x27','updatedAt')[_0xdf3c('0x70')](_0xdf3c('0x9f'),'ci')[_0xdf3c('0x72')](_0xdf3c('0x8a'),'h','h.ContactId=ci.CmContactId')[_0xdf3c('0x29')](_0xdf3c('0xa0'),_0x3e2a89)[_0xdf3c('0x29')](_0xdf3c('0xa1'),_0xdf3c('0xa2')))[_0xdf3c('0x91')]();_0x1eb736[_0xdf3c('0x75')](db['sequelize'][_0xdf3c('0x2b')](_0x321ff1));return BPromise[_0xdf3c('0x78')](_0x1eb736);})[_0xdf3c('0x19')](function(){return _0x4f4afd;})[_0xdf3c('0x19')](respondWithResult(_0x2da908,null))[_0xdf3c('0x2e')](handleError(_0x2da908,null));};exports[_0xdf3c('0xa3')]=function(_0x51404d,_0x4cfc67){return db[_0xdf3c('0x26')][_0xdf3c('0x39')]({'where':{'id':_0x51404d[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x4cfc67,null))[_0xdf3c('0x19')](function(_0x5e06a2){if(_0x5e06a2){return _0x5e06a2[_0xdf3c('0xa3')](_0x51404d[_0xdf3c('0x2b')][_0xdf3c('0x6d')]);}})[_0xdf3c('0x19')](function(_0x2cab31){if(_0x2cab31){return db[_0xdf3c('0x50')]['destroy']({'where':{'ListId':_0x51404d[_0xdf3c('0x2b')][_0xdf3c('0x6d')],'VoiceQueueId':_0x51404d['params']['id']}})[_0xdf3c('0x19')](function(){return _0x2cab31;});}})['then'](respondWithStatusCode(_0x4cfc67,null))[_0xdf3c('0x2e')](handleError(_0x4cfc67,null));};exports[_0xdf3c('0xa4')]=function(_0xa6fa19,_0x16b173){var _0x578e41={};var _0x4815ee={};var _0xa523c8;var _0x52ae27;return db[_0xdf3c('0x26')][_0xdf3c('0x4a')]({'where':{'id':_0xa6fa19[_0xdf3c('0x2f')]['id']}})['then'](handleEntityNotFound(_0x16b173,null))[_0xdf3c('0x19')](function(_0x148785){if(_0x148785){_0xa523c8=_0x148785;_0x4815ee[_0xdf3c('0x34')]=_[_0xdf3c('0x30')](db['CmList']['rawAttributes']);_0x4815ee[_0xdf3c('0x2b')]=_['keys'](_0xa6fa19[_0xdf3c('0x2b')]);_0x4815ee[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x4815ee[_0xdf3c('0x34')],_0x4815ee[_0xdf3c('0x2b')]);_0x578e41['attributes']=_[_0xdf3c('0x32')](_0x4815ee[_0xdf3c('0x34')],qs[_0xdf3c('0x35')](_0xa6fa19['query'][_0xdf3c('0x35')]));_0x578e41[_0xdf3c('0x33')]=_0x578e41[_0xdf3c('0x33')][_0xdf3c('0x36')]?_0x578e41[_0xdf3c('0x33')]:_0x4815ee[_0xdf3c('0x34')];_0x578e41[_0xdf3c('0x4c')]=qs['sort'](_0xa6fa19['query'][_0xdf3c('0x4d')]);_0x578e41['where']=qs[_0xdf3c('0x31')](_[_0xdf3c('0x4e')](_0xa6fa19[_0xdf3c('0x2b')],_0x4815ee[_0xdf3c('0x31')]));if(_0xa6fa19['query'][_0xdf3c('0x1f')]){_0x578e41['where']=_[_0xdf3c('0x45')](_0x578e41['where'],{'$or':_[_0xdf3c('0x20')](_0x578e41[_0xdf3c('0x33')],function(_0x36fb96){var _0x2ac2ca={};_0x2ac2ca[_0x36fb96]={'$like':'%'+_0xa6fa19[_0xdf3c('0x2b')][_0xdf3c('0x1f')]+'%'};return _0x2ac2ca;})});}_0x578e41=_[_0xdf3c('0x45')]({},_0x578e41,_0xa6fa19['options']);return _0xa523c8[_0xdf3c('0xa4')](_0x578e41);}})[_0xdf3c('0x19')](function(_0x25d312){if(_0x25d312){_0x52ae27=_0x25d312[_0xdf3c('0x36')];if(!_0xa6fa19['query'][_0xdf3c('0x4b')](_0xdf3c('0x55'))){_0x578e41[_0xdf3c('0x14')]=qs[_0xdf3c('0x14')](_0xa6fa19[_0xdf3c('0x2b')]['limit']);_0x578e41['offset']=qs['offset'](_0xa6fa19[_0xdf3c('0x2b')]['offset']);}return _0xa523c8[_0xdf3c('0xa4')](_0x578e41);}})['then'](function(_0xbbc217){if(_0xbbc217){return _0xbbc217?{'count':_0x52ae27,'rows':_0xbbc217}:null;}})[_0xdf3c('0x19')](respondWithResult(_0x16b173,null))[_0xdf3c('0x2e')](handleError(_0x16b173,null));};exports['addBlackLists']=function(_0x47d44e,_0x4dd133){var _0x2b8425;return db[_0xdf3c('0x26')]['find']({'where':{'id':_0x47d44e[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x4dd133,null))[_0xdf3c('0x19')](function(_0x4009e0){if(_0x4009e0){return _0x4009e0[_0xdf3c('0xa5')](_0x47d44e[_0xdf3c('0x3b')][_0xdf3c('0x6d')],_[_0xdf3c('0x46')](_0x47d44e['body'],[_0xdf3c('0x6d'),'id'])||{});}return null;})[_0xdf3c('0x7d')](function(_0x37e578){var _0x11436f;_0x2b8425=_0x37e578||[];var _0x1d66b6=[];if(_0x37e578){for(var _0x4b4bab=0x0;_0x4b4bab<_0x37e578[_0xdf3c('0x36')];_0x4b4bab+=0x1){var _0x290778=_0x37e578[_0x4b4bab][_0xdf3c('0x1b')]({'plain':!![]});_0x11436f=squel[_0xdf3c('0x88')]()[_0xdf3c('0x89')](_0xdf3c('0xa6'))['fromQuery']([_0xdf3c('0x8f'),'ContactId',_0xdf3c('0x8e'),_0xdf3c('0x4f'),_0xdf3c('0x48'),_0xdf3c('0x47')],squel[_0xdf3c('0x6e')]()[_0xdf3c('0x6f')](_0xdf3c('0x8f'),_0xdf3c('0x8f'))[_0xdf3c('0x6f')]('id','ContactId')[_0xdf3c('0x6f')](_0x290778[_0xdf3c('0x90')][_0xdf3c('0x91')](),'ListId')[_0xdf3c('0x6f')](_0x47d44e['params']['id'][_0xdf3c('0x91')](),_0xdf3c('0x4f'))[_0xdf3c('0x6f')](_0xdf3c('0xa7'),_0xdf3c('0x48'))[_0xdf3c('0x6f')](_0xdf3c('0xa7'),_0xdf3c('0x47'))[_0xdf3c('0x70')](_0xdf3c('0x92'))[_0xdf3c('0x29')](_0xdf3c('0x93'))['where']('ListId\x20=\x20?',_0x290778['CmListId'][_0xdf3c('0x91')]())[_0xdf3c('0x29')](_0xdf3c('0x94')))[_0xdf3c('0x91')]();_0x1d66b6[_0xdf3c('0x75')](db[_0xdf3c('0x76')][_0xdf3c('0x2b')](_0x11436f));}return BPromise[_0xdf3c('0x78')](_0x1d66b6);}})[_0xdf3c('0x19')](function(){return _0x2b8425;})[_0xdf3c('0x19')](respondWithResult(_0x4dd133,null))[_0xdf3c('0x2e')](handleError(_0x4dd133,null));};exports[_0xdf3c('0xa8')]=function(_0xc5ac78,_0x567748){return db['VoiceQueue'][_0xdf3c('0x39')]({'where':{'id':_0xc5ac78[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](handleEntityNotFound(_0x567748,null))['then'](function(_0x290a39){if(_0x290a39){return _0x290a39['removeBlackLists'](_0xc5ac78[_0xdf3c('0x2b')][_0xdf3c('0x6d')]);}})['then'](function(_0xabf05c){if(_0xabf05c){return db[_0xdf3c('0x57')][_0xdf3c('0x1a')]({'where':{'ListId':_0xc5ac78[_0xdf3c('0x2b')][_0xdf3c('0x6d')],'VoiceQueueId':_0xc5ac78[_0xdf3c('0x2f')]['id']}})[_0xdf3c('0x19')](function(){return _0xabf05c;});}})[_0xdf3c('0x19')](respondWithStatusCode(_0x567748,null))['catch'](handleError(_0x567748,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index bbec9a1..19335b6 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 _0x0f10=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0xcf611d,_0x451c75){var _0xe1a7d2=function(_0x5b77e1){while(--_0x5b77e1){_0xcf611d['push'](_0xcf611d['shift']());}};_0xe1a7d2(++_0x451c75);}(_0x0f10,0x1bf));var _0x00f1=function(_0x4650eb,_0x51c8b7){_0x4650eb=_0x4650eb-0x0;var _0x8c775b=_0x0f10[_0x4650eb];return _0x8c775b;};'use strict';var EventEmitter=require(_0x00f1('0x0'));var VoiceQueue=require(_0x00f1('0x1'))['db'][_0x00f1('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x00f1('0x3'),'afterUpdate':_0x00f1('0x4'),'afterDestroy':_0x00f1('0x5')};function emitEvent(_0x3a9f80){return function(_0x4affa5,_0x562ea6,_0x406f2d){VoiceQueueEvents[_0x00f1('0x6')](_0x3a9f80+':'+_0x4affa5['id'],_0x4affa5);VoiceQueueEvents[_0x00f1('0x6')](_0x3a9f80,_0x4affa5);_0x406f2d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x00f1('0x7')](e,emitEvent(event));}}module[_0x00f1('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xad78=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x19a028,_0x161bbc){var _0x2822b0=function(_0x3596e6){while(--_0x3596e6){_0x19a028['push'](_0x19a028['shift']());}};_0x2822b0(++_0x161bbc);}(_0xad78,0x178));var _0x8ad7=function(_0x2bba22,_0x280899){_0x2bba22=_0x2bba22-0x0;var _0x20db8c=_0xad78[_0x2bba22];return _0x20db8c;};'use strict';var EventEmitter=require(_0x8ad7('0x0'));var VoiceQueue=require(_0x8ad7('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8ad7('0x2')](0x0);var events={'afterCreate':_0x8ad7('0x3'),'afterUpdate':_0x8ad7('0x4'),'afterDestroy':_0x8ad7('0x5')};function emitEvent(_0x47b302){return function(_0x200862,_0x15cbdf,_0x2d4d91){VoiceQueueEvents[_0x8ad7('0x6')](_0x47b302+':'+_0x200862['id'],_0x200862);VoiceQueueEvents[_0x8ad7('0x6')](_0x47b302,_0x200862);_0x2d4d91(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x8ad7('0x7')](e,emitEvent(event));}}module[_0x8ad7('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 4d42acd..b0e22d1 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x3a87a9,_0xfcd825){var _0x193752=function(_0x56c9b7){while(--_0x56c9b7){_0x3a87a9['push'](_0x3a87a9['shift']());}};_0x193752(++_0xfcd825);}(_0xedd9,0xfc));var _0x9edd=function(_0x249ca3,_0x4de015){_0x249ca3=_0x249ca3-0x0;var _0x37ad4=_0xedd9[_0x249ca3];return _0x37ad4;};'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 +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x238b73,_0x5df76f){var _0x5966d9=function(_0x57802d){while(--_0x57802d){_0x238b73['push'](_0x238b73['shift']());}};_0x5966d9(++_0x5df76f);}(_0x70e0,0x17b));var _0x070e=function(_0x5f2ed4,_0x4c1f14){_0x5f2ed4=_0x5f2ed4-0x0;var _0x2ba8e3=_0x70e0[_0x5f2ed4];return _0x2ba8e3;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 0ff2c7f..764f85d 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 _0x125f=['redis','localhost','./voiceQueue.socket','register','then','info','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','findAll','options','raw','limit','map','include','model','attributes','GetVoiceQueue','debug','find','where','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x1f612d,_0x243c0d){var _0xc6089b=function(_0x3e7b47){while(--_0x3e7b47){_0x1f612d['push'](_0x1f612d['shift']());}};_0xc6089b(++_0x243c0d);}(_0x125f,0xf3));var _0xf125=function(_0x3c1fe0,_0xf10a95){_0x3c1fe0=_0x3c1fe0-0x0;var _0x2ef3e=_0x125f[_0x3c1fe0];return _0x2ef3e;};'use strict';var _=require(_0xf125('0x0'));var util=require(_0xf125('0x1'));var moment=require(_0xf125('0x2'));var BPromise=require(_0xf125('0x3'));var rs=require(_0xf125('0x4'));var fs=require('fs');var Redis=require(_0xf125('0x5'));var db=require(_0xf125('0x6'))['db'];var utils=require(_0xf125('0x7'));var logger=require(_0xf125('0x8'))(_0xf125('0x9'));var config=require(_0xf125('0xa'));var jayson=require(_0xf125('0xb'));var client=jayson[_0xf125('0xc')][_0xf125('0xd')]({'port':0x232a});config['redis']=_[_0xf125('0xe')](config[_0xf125('0xf')],{'host':_0xf125('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf125('0xf')]));require(_0xf125('0x11'))[_0xf125('0x12')](socket);function respondWithRpcPromise(_0x57165f,_0x45fdf0,_0xcb60ce){return new BPromise(function(_0x2f7767,_0x5c1075){return client['request'](_0x57165f,_0xcb60ce)[_0xf125('0x13')](function(_0x5c3b69){logger[_0xf125('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x45fdf0,_0xf125('0x15'));logger['debug'](_0xf125('0x16'),_0x45fdf0,_0xf125('0x15'),JSON[_0xf125('0x17')](_0x5c3b69));if(_0x5c3b69[_0xf125('0x18')]){if(_0x5c3b69[_0xf125('0x18')][_0xf125('0x19')]===0x1f4){logger[_0xf125('0x18')](_0xf125('0x1a'),_0x45fdf0,_0x5c3b69[_0xf125('0x18')][_0xf125('0x1b')]);return _0x5c1075(_0x5c3b69[_0xf125('0x18')][_0xf125('0x1b')]);}logger[_0xf125('0x18')](_0xf125('0x1a'),_0x45fdf0,_0x5c3b69[_0xf125('0x18')][_0xf125('0x1b')]);return _0x2f7767(_0x5c3b69[_0xf125('0x18')]['message']);}else{logger[_0xf125('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x45fdf0,_0xf125('0x15'));_0x2f7767(_0x5c3b69[_0xf125('0x1c')]['message']);}})[_0xf125('0x1d')](function(_0x1293ab){logger[_0xf125('0x18')](_0xf125('0x1a'),_0x45fdf0,_0x1293ab);_0x5c1075(_0x1293ab);});});}exports['GetVoiceQueue']=function(_0x2c719b){var _0x5a5eff=this;return new Promise(function(_0x2725f7,_0x1cda3e){return db['VoiceQueue'][_0xf125('0x1e')]({'raw':_0x2c719b[_0xf125('0x1f')]?_0x2c719b[_0xf125('0x1f')][_0xf125('0x20')]===undefined?!![]:![]:!![],'where':_0x2c719b[_0xf125('0x1f')]?_0x2c719b[_0xf125('0x1f')]['where']||null:null,'attributes':_0x2c719b['options']?_0x2c719b[_0xf125('0x1f')]['attributes']||null:null,'limit':_0x2c719b[_0xf125('0x1f')]?_0x2c719b['options'][_0xf125('0x21')]||null:null,'include':_0x2c719b['options']?_0x2c719b[_0xf125('0x1f')]['include']?_[_0xf125('0x22')](_0x2c719b[_0xf125('0x1f')][_0xf125('0x23')],function(_0xa740d6){return{'model':db[_0xa740d6[_0xf125('0x24')]],'as':_0xa740d6['as'],'attributes':_0xa740d6['attributes'],'include':_0xa740d6[_0xf125('0x23')]?_['map'](_0xa740d6['include'],function(_0x38f2da){return{'model':db[_0x38f2da['model']],'as':_0x38f2da['as'],'attributes':_0x38f2da[_0xf125('0x25')],'include':_0x38f2da[_0xf125('0x23')]?_[_0xf125('0x22')](_0x38f2da[_0xf125('0x23')],function(_0x306e1c){return{'model':db[_0x306e1c[_0xf125('0x24')]],'as':_0x306e1c['as'],'attributes':_0x306e1c['attributes']};}):[]};}):[]};}):[]:[]})[_0xf125('0x13')](function(_0x3ab0de){logger[_0xf125('0x14')](_0xf125('0x26'),_0x2c719b);logger[_0xf125('0x27')](_0xf125('0x26'),_0x2c719b,JSON[_0xf125('0x17')](_0x3ab0de));_0x2725f7(_0x3ab0de);})[_0xf125('0x1d')](function(_0x307b07){logger[_0xf125('0x18')]('GetVoiceQueue',_0x307b07[_0xf125('0x1b')],_0x2c719b);_0x1cda3e(_0x5a5eff['error'](0x1f4,_0x307b07['message']));});});};exports['ShowVoiceQueue']=function(_0x54bf30){var _0x135f63=this;return new Promise(function(_0x30ba49,_0x493b00){return db['VoiceQueue'][_0xf125('0x28')]({'raw':_0x54bf30[_0xf125('0x1f')]?_0x54bf30[_0xf125('0x1f')][_0xf125('0x20')]===undefined?!![]:![]:!![],'where':_0x54bf30['options']?_0x54bf30[_0xf125('0x1f')][_0xf125('0x29')]||null:null,'attributes':_0x54bf30[_0xf125('0x1f')]?_0x54bf30[_0xf125('0x1f')]['attributes']||null:null,'include':_0x54bf30[_0xf125('0x1f')]?_0x54bf30['options'][_0xf125('0x23')]?_[_0xf125('0x22')](_0x54bf30['options']['include'],function(_0x3b277a){return{'model':db[_0x3b277a[_0xf125('0x24')]],'as':_0x3b277a['as'],'attributes':_0x3b277a[_0xf125('0x25')],'include':_0x3b277a[_0xf125('0x23')]?_['map'](_0x3b277a['include'],function(_0x1d18d1){return{'model':db[_0x1d18d1[_0xf125('0x24')]],'as':_0x1d18d1['as'],'attributes':_0x1d18d1[_0xf125('0x25')],'include':_0x1d18d1[_0xf125('0x23')]?_[_0xf125('0x22')](_0x1d18d1[_0xf125('0x23')],function(_0x61f31c){return{'model':db[_0x61f31c[_0xf125('0x24')]],'as':_0x61f31c['as'],'attributes':_0x61f31c['attributes']};}):[]};}):[]};}):[]:[]})[_0xf125('0x13')](function(_0x4952fa){logger['info']('ShowVoiceQueue',_0x54bf30);logger['debug']('ShowVoiceQueue',_0x54bf30,JSON[_0xf125('0x17')](_0x4952fa));_0x30ba49(_0x4952fa);})['catch'](function(_0x3fcead){logger['error'](_0xf125('0x2a'),_0x3fcead['message'],_0x54bf30);_0x493b00(_0x135f63['error'](0x1f4,_0x3fcead['message']));});});}; \ No newline at end of file +var _0x40e6=['debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceQueue','findAll','options','where','include','map','model','attributes','info','GetVoiceQueue','ShowVoiceQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x87bfdc,_0x320656){var _0x15b3ed=function(_0x221b60){while(--_0x221b60){_0x87bfdc['push'](_0x87bfdc['shift']());}};_0x15b3ed(++_0x320656);}(_0x40e6,0xdc));var _0x640e=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x40e6[_0x179b53];return _0x38a146;};'use strict';var _=require(_0x640e('0x0'));var util=require(_0x640e('0x1'));var moment=require(_0x640e('0x2'));var BPromise=require('bluebird');var rs=require(_0x640e('0x3'));var fs=require('fs');var Redis=require(_0x640e('0x4'));var db=require(_0x640e('0x5'))['db'];var utils=require(_0x640e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x640e('0x7'));var jayson=require(_0x640e('0x8'));var client=jayson[_0x640e('0x9')][_0x640e('0xa')]({'port':0x232a});config[_0x640e('0xb')]=_[_0x640e('0xc')](config[_0x640e('0xb')],{'host':_0x640e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x640e('0xb')]));require(_0x640e('0xe'))[_0x640e('0xf')](socket);function respondWithRpcPromise(_0xbc74d,_0x57debe,_0x34b652){return new BPromise(function(_0x264454,_0x3185c1){return client[_0x640e('0x10')](_0xbc74d,_0x34b652)[_0x640e('0x11')](function(_0xa71ace){logger['info'](_0x640e('0x12'),_0x57debe,_0x640e('0x13'));logger[_0x640e('0x14')](_0x640e('0x15'),_0x57debe,'request\x20sent',JSON['stringify'](_0xa71ace));if(_0xa71ace[_0x640e('0x16')]){if(_0xa71ace['error'][_0x640e('0x17')]===0x1f4){logger[_0x640e('0x16')](_0x640e('0x12'),_0x57debe,_0xa71ace[_0x640e('0x16')]['message']);return _0x3185c1(_0xa71ace[_0x640e('0x16')][_0x640e('0x18')]);}logger[_0x640e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x57debe,_0xa71ace[_0x640e('0x16')]['message']);return _0x264454(_0xa71ace[_0x640e('0x16')][_0x640e('0x18')]);}else{logger['info'](_0x640e('0x12'),_0x57debe,_0x640e('0x13'));_0x264454(_0xa71ace[_0x640e('0x19')][_0x640e('0x18')]);}})[_0x640e('0x1a')](function(_0x383383){logger['error'](_0x640e('0x12'),_0x57debe,_0x383383);_0x3185c1(_0x383383);});});}exports['GetVoiceQueue']=function(_0x4bc5a0){var _0x2108a3=this;return new Promise(function(_0x3dbcae,_0x34a120){return db[_0x640e('0x1b')][_0x640e('0x1c')]({'raw':_0x4bc5a0[_0x640e('0x1d')]?_0x4bc5a0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bc5a0[_0x640e('0x1d')]?_0x4bc5a0[_0x640e('0x1d')][_0x640e('0x1e')]||null:null,'attributes':_0x4bc5a0[_0x640e('0x1d')]?_0x4bc5a0[_0x640e('0x1d')]['attributes']||null:null,'limit':_0x4bc5a0[_0x640e('0x1d')]?_0x4bc5a0[_0x640e('0x1d')]['limit']||null:null,'include':_0x4bc5a0[_0x640e('0x1d')]?_0x4bc5a0[_0x640e('0x1d')][_0x640e('0x1f')]?_[_0x640e('0x20')](_0x4bc5a0[_0x640e('0x1d')][_0x640e('0x1f')],function(_0x451a4e){return{'model':db[_0x451a4e[_0x640e('0x21')]],'as':_0x451a4e['as'],'attributes':_0x451a4e[_0x640e('0x22')],'include':_0x451a4e[_0x640e('0x1f')]?_['map'](_0x451a4e[_0x640e('0x1f')],function(_0x51bc84){return{'model':db[_0x51bc84[_0x640e('0x21')]],'as':_0x51bc84['as'],'attributes':_0x51bc84['attributes'],'include':_0x51bc84[_0x640e('0x1f')]?_[_0x640e('0x20')](_0x51bc84[_0x640e('0x1f')],function(_0x414400){return{'model':db[_0x414400[_0x640e('0x21')]],'as':_0x414400['as'],'attributes':_0x414400[_0x640e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x640e('0x11')](function(_0x4b882d){logger[_0x640e('0x23')]('GetVoiceQueue',_0x4bc5a0);logger['debug'](_0x640e('0x24'),_0x4bc5a0,JSON['stringify'](_0x4b882d));_0x3dbcae(_0x4b882d);})[_0x640e('0x1a')](function(_0x3efde7){logger[_0x640e('0x16')](_0x640e('0x24'),_0x3efde7['message'],_0x4bc5a0);_0x34a120(_0x2108a3['error'](0x1f4,_0x3efde7['message']));});});};exports[_0x640e('0x25')]=function(_0x3ed08a){var _0x2e55c5=this;return new Promise(function(_0xb7066f,_0x427195){return db[_0x640e('0x1b')][_0x640e('0x26')]({'raw':_0x3ed08a['options']?_0x3ed08a[_0x640e('0x1d')][_0x640e('0x27')]===undefined?!![]:![]:!![],'where':_0x3ed08a[_0x640e('0x1d')]?_0x3ed08a[_0x640e('0x1d')]['where']||null:null,'attributes':_0x3ed08a[_0x640e('0x1d')]?_0x3ed08a['options'][_0x640e('0x22')]||null:null,'include':_0x3ed08a[_0x640e('0x1d')]?_0x3ed08a[_0x640e('0x1d')][_0x640e('0x1f')]?_[_0x640e('0x20')](_0x3ed08a[_0x640e('0x1d')][_0x640e('0x1f')],function(_0x71dac1){return{'model':db[_0x71dac1[_0x640e('0x21')]],'as':_0x71dac1['as'],'attributes':_0x71dac1[_0x640e('0x22')],'include':_0x71dac1[_0x640e('0x1f')]?_[_0x640e('0x20')](_0x71dac1['include'],function(_0x3fca20){return{'model':db[_0x3fca20[_0x640e('0x21')]],'as':_0x3fca20['as'],'attributes':_0x3fca20['attributes'],'include':_0x3fca20['include']?_[_0x640e('0x20')](_0x3fca20[_0x640e('0x1f')],function(_0x20ef26){return{'model':db[_0x20ef26['model']],'as':_0x20ef26['as'],'attributes':_0x20ef26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfcd903){logger[_0x640e('0x23')]('ShowVoiceQueue',_0x3ed08a);logger[_0x640e('0x14')]('ShowVoiceQueue',_0x3ed08a,JSON['stringify'](_0xfcd903));_0xb7066f(_0xfcd903);})['catch'](function(_0x298e2e){logger[_0x640e('0x16')](_0x640e('0x25'),_0x298e2e[_0x640e('0x18')],_0x3ed08a);_0x427195(_0x2e55c5[_0x640e('0x16')](0x1f4,_0x298e2e[_0x640e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c6a4f70..ebbbb14 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 _0x1125=['length','voiceQueue:','./voiceQueue.events','save','register'];(function(_0x141dc3,_0x59eb84){var _0x166c1d=function(_0x516dc8){while(--_0x516dc8){_0x141dc3['push'](_0x141dc3['shift']());}};_0x166c1d(++_0x59eb84);}(_0x1125,0xb1));var _0x5112=function(_0x5c2bef,_0x16806e){_0x5c2bef=_0x5c2bef-0x0;var _0xd60cc1=_0x1125[_0x5c2bef];return _0xd60cc1;};'use strict';var VoiceQueueEvents=require(_0x5112('0x0'));var events=[_0x5112('0x1'),'remove','update'];function createListener(_0x56a827,_0x2c1b59){return function(_0x107663){_0x2c1b59['emit'](_0x56a827,_0x107663);};}function removeListener(_0x1fc488,_0x30d36b){return function(){VoiceQueueEvents['removeListener'](_0x1fc488,_0x30d36b);};}exports[_0x5112('0x2')]=function(_0x171fdd){for(var _0x7c7691=0x0,_0x17d4fb=events[_0x5112('0x3')];_0x7c7691<_0x17d4fb;_0x7c7691++){var _0x1d9fe5=events[_0x7c7691];var _0xa02135=createListener(_0x5112('0x4')+_0x1d9fe5,_0x171fdd);VoiceQueueEvents['on'](_0x1d9fe5,_0xa02135);}}; \ No newline at end of file +var _0xaa01=['voiceQueue:','save','update','removeListener','register','length'];(function(_0x4f59e5,_0x3e4d09){var _0x76a75=function(_0x3fd58d){while(--_0x3fd58d){_0x4f59e5['push'](_0x4f59e5['shift']());}};_0x76a75(++_0x3e4d09);}(_0xaa01,0x121));var _0x1aa0=function(_0x288139,_0x4fc04f){_0x288139=_0x288139-0x0;var _0x398b1e=_0xaa01[_0x288139];return _0x398b1e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x1aa0('0x0'),'remove',_0x1aa0('0x1')];function createListener(_0x109c09,_0x501427){return function(_0xd4f687){_0x501427['emit'](_0x109c09,_0xd4f687);};}function removeListener(_0x443a08,_0x10da72){return function(){VoiceQueueEvents[_0x1aa0('0x2')](_0x443a08,_0x10da72);};}exports[_0x1aa0('0x3')]=function(_0xf5571b){for(var _0x4ddb59=0x0,_0x5f2683=events[_0x1aa0('0x4')];_0x4ddb59<_0x5f2683;_0x4ddb59++){var _0x11e3aa=events[_0x4ddb59];var _0x45a62f=createListener(_0x1aa0('0x5')+_0x11e3aa,_0xf5571b);VoiceQueueEvents['on'](_0x11e3aa,_0x45a62f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 0fa9600..bb15e62 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 _0xf751=['destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','post','create','put','update'];(function(_0x227964,_0x3841e4){var _0x53e87f=function(_0x478f49){while(--_0x478f49){_0x227964['push'](_0x227964['shift']());}};_0x53e87f(++_0x3841e4);}(_0xf751,0x85));var _0x1f75=function(_0x122a8f,_0x3c2200){_0x122a8f=_0x122a8f-0x0;var _0x1ff9f7=_0xf751[_0x122a8f];return _0x1ff9f7;};'use strict';var multer=require(_0x1f75('0x0'));var util=require('util');var path=require(_0x1f75('0x1'));var timeout=require(_0x1f75('0x2'));var express=require('express');var router=express[_0x1f75('0x3')]();var fs_extra=require(_0x1f75('0x4'));var auth=require(_0x1f75('0x5'));var interaction=require(_0x1f75('0x6'));var config=require(_0x1f75('0x7'));var controller=require(_0x1f75('0x8'));router[_0x1f75('0x9')]('/',auth[_0x1f75('0xa')](),controller[_0x1f75('0xb')]);router[_0x1f75('0x9')](_0x1f75('0xc'),auth[_0x1f75('0xa')](),controller[_0x1f75('0xd')]);router[_0x1f75('0x9')](_0x1f75('0xe'),auth['isAuthenticated'](),controller[_0x1f75('0xf')]);router[_0x1f75('0x9')](_0x1f75('0x10'),auth[_0x1f75('0xa')](),controller['show']);router[_0x1f75('0x11')]('/',auth[_0x1f75('0xa')](),controller[_0x1f75('0x12')]);router[_0x1f75('0x13')](_0x1f75('0x10'),auth[_0x1f75('0xa')](),controller[_0x1f75('0x14')]);router['delete'](_0x1f75('0x10'),auth[_0x1f75('0xa')](),controller[_0x1f75('0x15')]);module['exports']=router; \ No newline at end of file +var _0xb636=['isAuthenticated','index','get','/describe','describe','/index','/:id','show','post','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0xb636,0x198));var _0x6b63=function(_0x946b8d,_0x12f215){_0x946b8d=_0x946b8d-0x0;var _0x94b470=_0xb636[_0x946b8d];return _0x94b470;};'use strict';var multer=require(_0x6b63('0x0'));var util=require(_0x6b63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b63('0x2'));var router=express['Router']();var fs_extra=require(_0x6b63('0x3'));var auth=require(_0x6b63('0x4'));var interaction=require(_0x6b63('0x5'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x6b63('0x6')](),controller[_0x6b63('0x7')]);router[_0x6b63('0x8')](_0x6b63('0x9'),auth[_0x6b63('0x6')](),controller[_0x6b63('0xa')]);router['get'](_0x6b63('0xb'),auth[_0x6b63('0x6')](),controller['getVoiceQueuesReport']);router[_0x6b63('0x8')](_0x6b63('0xc'),auth[_0x6b63('0x6')](),controller[_0x6b63('0xd')]);router[_0x6b63('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6b63('0xc'),auth[_0x6b63('0x6')](),controller['update']);router[_0x6b63('0xf')](_0x6b63('0xc'),auth['isAuthenticated'](),controller[_0x6b63('0x10')]);module[_0x6b63('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 2779aa0..d5e1ef6 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 _0xbf16=['seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','exports','STRING','DATE','getDataValue','queuecallerjoinAt','diff'];(function(_0x32ea65,_0x1e05e6){var _0x2e7671=function(_0x42cb6b){while(--_0x42cb6b){_0x32ea65['push'](_0x32ea65['shift']());}};_0x2e7671(++_0x1e05e6);}(_0xbf16,0x1c8));var _0x6bf1=function(_0x304de6,_0x312e00){_0x304de6=_0x304de6-0x0;var _0x1be206=_0xbf16[_0x304de6];return _0x1be206;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x6bf1('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6bf1('0x1')]},'calleridnum':{'type':Sequelize[_0x6bf1('0x1')]},'calleridname':{'type':Sequelize[_0x6bf1('0x1')]},'queue':{'type':Sequelize[_0x6bf1('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x6bf1('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x6bf1('0x2')],'set':function(_0x4ddb2a){var _0x2e76ab=moment(_0x4ddb2a);var _0x39392d=moment(this[_0x6bf1('0x3')](_0x6bf1('0x4')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x24fccd=_0x2e76ab[_0x6bf1('0x5')](_0x39392d,_0x6bf1('0x6'));this[_0x6bf1('0x7')]('queuecallerleaveAt',_0x4ddb2a);this[_0x6bf1('0x7')]('holdtime',_0x24fccd||null);}},'position':{'type':Sequelize[_0x6bf1('0x8')]},'count':{'type':Sequelize[_0x6bf1('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x6bf1('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6bf1('0x2')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6bf1('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6bf1('0x1')],'comment':_0x6bf1('0xa')},'originalposition':{'type':Sequelize[_0x6bf1('0x8')]},'channel':{'type':Sequelize[_0x6bf1('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6bf1('0x1')]},'accountcode':{'type':Sequelize[_0x6bf1('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6bf1('0x1')]},'priority':{'type':Sequelize[_0x6bf1('0x1')]},'holdtime':{'type':Sequelize[_0x6bf1('0x8')]},'mohtime':{'type':Sequelize[_0x6bf1('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6bf1('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6bf1('0x1')]},'transfer':{'type':Sequelize[_0x6bf1('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6bf1('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x6bf1('0x1')]},'transferuniqueid':{'type':Sequelize[_0x6bf1('0x1')]},'disposition':{'type':Sequelize[_0x6bf1('0x1')]},'secondDisposition':{'type':Sequelize[_0x6bf1('0x1')]},'thirdDisposition':{'type':Sequelize[_0x6bf1('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x6bf1('0x8')],'defaultValue':0x0},'note':{'type':Sequelize[_0x6bf1('0x1')]}}; \ No newline at end of file +var _0x97d0=['diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x47cf36,_0x3c2288){var _0x10c485=function(_0x8999e9){while(--_0x8999e9){_0x47cf36['push'](_0x47cf36['shift']());}};_0x10c485(++_0x3c2288);}(_0x97d0,0x118));var _0x097d=function(_0x58170c,_0x19598e){_0x58170c=_0x58170c-0x0;var _0x45fb70=_0x97d0[_0x58170c];return _0x45fb70;};'use strict';var Sequelize=require(_0x097d('0x0'));var moment=require(_0x097d('0x1'));module[_0x097d('0x2')]={'type':{'type':Sequelize[_0x097d('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x097d('0x3')]},'calleridname':{'type':Sequelize[_0x097d('0x3')]},'queue':{'type':Sequelize[_0x097d('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x097d('0x4')],'set':function(_0x54c624){var _0x142b7c=moment(_0x54c624);var _0x287661=moment(this[_0x097d('0x5')](_0x097d('0x6')))[_0x097d('0x7')](_0x097d('0x8'));var _0x2a1daf=_0x142b7c[_0x097d('0x9')](_0x287661,_0x097d('0xa'));this[_0x097d('0xb')](_0x097d('0xc'),_0x54c624);this[_0x097d('0xb')](_0x097d('0xd'),_0x2a1daf||null);}},'position':{'type':Sequelize[_0x097d('0xe')]},'count':{'type':Sequelize[_0x097d('0xe')]},'queuecallerabandon':{'type':Sequelize[_0x097d('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x097d('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x097d('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x097d('0x4')]},'queuecallerexit':{'type':Sequelize[_0x097d('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x097d('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x097d('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x097d('0xe')]},'channel':{'type':Sequelize[_0x097d('0x3')]},'connectedlinenum':{'type':Sequelize[_0x097d('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x097d('0x3')]},'exten':{'type':Sequelize[_0x097d('0x3')]},'priority':{'type':Sequelize[_0x097d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x097d('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x097d('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x097d('0x3')]},'transfer':{'type':Sequelize[_0x097d('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x097d('0x3')],'comment':_0x097d('0x10')},'transferexten':{'type':Sequelize[_0x097d('0x3')]},'transferuniqueid':{'type':Sequelize[_0x097d('0x3')]},'disposition':{'type':Sequelize[_0x097d('0x3')]},'secondDisposition':{'type':Sequelize[_0x097d('0x3')]},'thirdDisposition':{'type':Sequelize[_0x097d('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x097d('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index fb46f40..6c7c2ba 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 _0xa1e3=['../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','end','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','fields','includeAll','find','create','body','destroy','params','describe','getVoiceQueuesReport','hasOwnProperty','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x2ba55f,_0x35d6a5){var _0xe07e8=function(_0x42372b){while(--_0x42372b){_0x2ba55f['push'](_0x2ba55f['shift']());}};_0xe07e8(++_0x35d6a5);}(_0xa1e3,0x12d));var _0x3a1e=function(_0x276eed,_0x339694){_0x276eed=_0x276eed-0x0;var _0x2fc3d6=_0xa1e3[_0x276eed];return _0x2fc3d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a1e('0x0'));var zipdir=require(_0x3a1e('0x1'));var jsonpatch=require(_0x3a1e('0x2'));var rp=require(_0x3a1e('0x3'));var moment=require(_0x3a1e('0x4'));var BPromise=require(_0x3a1e('0x5'));var Mustache=require('mustache');var util=require(_0x3a1e('0x6'));var path=require(_0x3a1e('0x7'));var sox=require(_0x3a1e('0x8'));var csv=require(_0x3a1e('0x9'));var ejs=require(_0x3a1e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a1e('0xb'));var squel=require(_0x3a1e('0xc'));var crypto=require(_0x3a1e('0xd'));var jsforce=require(_0x3a1e('0xe'));var deskjs=require(_0x3a1e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3a1e('0x10'));var Redis=require(_0x3a1e('0x11'));var authService=require(_0x3a1e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3a1e('0x13'));var hardwareService=require(_0x3a1e('0x14'));var logger=require(_0x3a1e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3a1e('0x16'));var licenseUtil=require(_0x3a1e('0x17'));var db=require(_0x3a1e('0x18'))['db'];config[_0x3a1e('0x19')]=_[_0x3a1e('0x1a')](config[_0x3a1e('0x19')],{'host':_0x3a1e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a1e('0x19')]));require('./voiceQueueReport.socket')[_0x3a1e('0x1c')](socket);function respondWithStatusCode(_0x2d89e2,_0x805314){_0x805314=_0x805314||0xcc;return function(_0x5a26a8){if(_0x5a26a8){return _0x2d89e2[_0x3a1e('0x1d')](_0x805314);}return _0x2d89e2[_0x3a1e('0x1e')](_0x805314)['end']();};}function respondWithResult(_0x1c18c6,_0x12e508){_0x12e508=_0x12e508||0xc8;return function(_0x5528b5){if(_0x5528b5){return _0x1c18c6['status'](_0x12e508)['json'](_0x5528b5);}};}function respondWithFilteredResult(_0x2638f6,_0x37e268){return function(_0x51be90){if(_0x51be90){var _0x800322=typeof _0x37e268[_0x3a1e('0x1f')]===_0x3a1e('0x20')&&typeof _0x37e268['limit']===_0x3a1e('0x20');var _0x1e3af3=_0x51be90[_0x3a1e('0x21')];var _0x3a7c53=_0x800322?0x0:_0x37e268['offset'];var _0x4377a8=_0x800322?_0x51be90[_0x3a1e('0x21')]:_0x37e268[_0x3a1e('0x1f')]+_0x37e268[_0x3a1e('0x22')];var _0x3abc53;if(_0x4377a8>=_0x1e3af3){_0x4377a8=_0x1e3af3;_0x3abc53=0xc8;}else{_0x3abc53=0xce;}_0x2638f6[_0x3a1e('0x1e')](_0x3abc53);return _0x2638f6[_0x3a1e('0x23')](_0x3a1e('0x24'),_0x3a7c53+'-'+_0x4377a8+'/'+_0x1e3af3)[_0x3a1e('0x25')](_0x51be90);}return null;};}function patchUpdates(_0x4be305){return function(_0x2ef714){try{jsonpatch[_0x3a1e('0x26')](_0x2ef714,_0x4be305,!![]);}catch(_0x90d1e5){return BPromise['reject'](_0x90d1e5);}return _0x2ef714[_0x3a1e('0x27')]();};}function saveUpdates(_0x540439,_0x3b8994){return function(_0x42d79b){if(_0x42d79b){return _0x42d79b[_0x3a1e('0x28')](_0x540439)['then'](function(_0x248850){return _0x248850;});}return null;};}function removeEntity(_0x56cb4f,_0x10d351){return function(_0x500e77){if(_0x500e77){return _0x500e77['destroy']()[_0x3a1e('0x29')](function(){_0x56cb4f[_0x3a1e('0x1e')](0xcc)[_0x3a1e('0x2a')]();});}};}function handleEntityNotFound(_0x28c7e3,_0x311e22){return function(_0x4f74ca){if(!_0x4f74ca){_0x28c7e3[_0x3a1e('0x1d')](0x194);}return _0x4f74ca;};}function handleError(_0x52817b,_0x8d6ca0){_0x8d6ca0=_0x8d6ca0||0x1f4;return function(_0x5abce6){logger['error'](_0x5abce6['stack']);if(_0x5abce6[_0x3a1e('0x2b')]){delete _0x5abce6[_0x3a1e('0x2b')];}_0x52817b[_0x3a1e('0x1e')](_0x8d6ca0)[_0x3a1e('0x2c')](_0x5abce6);};}exports[_0x3a1e('0x2d')]=function(_0x25f32b,_0x781eb6){var _0x3ac35f={},_0x571931={},_0x4f579d={'count':0x0,'rows':[]};var _0x2b9e25=_[_0x3a1e('0x2e')](db[_0x3a1e('0x2f')][_0x3a1e('0x30')],function(_0x522b86){return{'name':_0x522b86[_0x3a1e('0x31')],'type':_0x522b86[_0x3a1e('0x32')][_0x3a1e('0x33')]};});_0x571931[_0x3a1e('0x34')]=_[_0x3a1e('0x2e')](_0x2b9e25,_0x3a1e('0x2b'));_0x571931[_0x3a1e('0x35')]=_[_0x3a1e('0x36')](_0x25f32b[_0x3a1e('0x35')]);_0x571931[_0x3a1e('0x37')]=_['intersection'](_0x571931['model'],_0x571931[_0x3a1e('0x35')]);_0x3ac35f[_0x3a1e('0x38')]=_[_0x3a1e('0x39')](_0x571931['model'],qs['fields'](_0x25f32b[_0x3a1e('0x35')]['fields']));_0x3ac35f[_0x3a1e('0x38')]=_0x3ac35f[_0x3a1e('0x38')][_0x3a1e('0x3a')]?_0x3ac35f[_0x3a1e('0x38')]:_0x571931[_0x3a1e('0x34')];if(!_0x25f32b['query']['hasOwnProperty']('nolimit')){_0x3ac35f[_0x3a1e('0x22')]=qs[_0x3a1e('0x22')](_0x25f32b[_0x3a1e('0x35')]['limit']);_0x3ac35f[_0x3a1e('0x1f')]=qs[_0x3a1e('0x1f')](_0x25f32b['query'][_0x3a1e('0x1f')]);}_0x3ac35f[_0x3a1e('0x3b')]=qs[_0x3a1e('0x3c')](_0x25f32b[_0x3a1e('0x35')][_0x3a1e('0x3c')]);_0x3ac35f[_0x3a1e('0x3d')]=qs[_0x3a1e('0x37')](_[_0x3a1e('0x3e')](_0x25f32b[_0x3a1e('0x35')],_0x571931['filters']),_0x2b9e25);if(_0x25f32b[_0x3a1e('0x35')][_0x3a1e('0x3f')]){_0x3ac35f[_0x3a1e('0x3d')]=_[_0x3a1e('0x40')](_0x3ac35f[_0x3a1e('0x3d')],{'$or':_['map'](_0x2b9e25,function(_0x494da9){if(_0x494da9['type']!=='VIRTUAL'){var _0x12efcc={};_0x12efcc[_0x494da9[_0x3a1e('0x2b')]]={'$like':'%'+_0x25f32b['query'][_0x3a1e('0x3f')]+'%'};return _0x12efcc;}})});}_0x3ac35f=_[_0x3a1e('0x40')]({},_0x3ac35f,_0x25f32b[_0x3a1e('0x41')]);var _0x7f42fe={'where':_0x3ac35f[_0x3a1e('0x3d')]};return db[_0x3a1e('0x2f')][_0x3a1e('0x21')](_0x7f42fe)[_0x3a1e('0x29')](function(_0x28eb2f){_0x4f579d[_0x3a1e('0x21')]=_0x28eb2f;if(_0x25f32b[_0x3a1e('0x35')]['includeAll']){_0x3ac35f[_0x3a1e('0x42')]=[{'all':!![]}];}return db[_0x3a1e('0x2f')][_0x3a1e('0x43')](_0x3ac35f);})[_0x3a1e('0x29')](function(_0xac148e){_0x4f579d[_0x3a1e('0x44')]=_0xac148e;return _0x4f579d;})[_0x3a1e('0x29')](respondWithFilteredResult(_0x781eb6,_0x3ac35f))[_0x3a1e('0x45')](handleError(_0x781eb6,null));};exports['show']=function(_0x4e3bbc,_0x2080cd){var _0x4bcc8a={'raw':![],'where':{'id':_0x4e3bbc['params']['id']}},_0x372256={};_0x372256[_0x3a1e('0x34')]=_[_0x3a1e('0x36')](db[_0x3a1e('0x2f')]['rawAttributes']);_0x372256[_0x3a1e('0x35')]=_[_0x3a1e('0x36')](_0x4e3bbc[_0x3a1e('0x35')]);_0x372256['filters']=_[_0x3a1e('0x39')](_0x372256[_0x3a1e('0x34')],_0x372256[_0x3a1e('0x35')]);_0x4bcc8a['attributes']=_[_0x3a1e('0x39')](_0x372256['model'],qs[_0x3a1e('0x46')](_0x4e3bbc[_0x3a1e('0x35')][_0x3a1e('0x46')]));_0x4bcc8a[_0x3a1e('0x38')]=_0x4bcc8a[_0x3a1e('0x38')]['length']?_0x4bcc8a[_0x3a1e('0x38')]:_0x372256['model'];if(_0x4e3bbc['query'][_0x3a1e('0x47')]){_0x4bcc8a[_0x3a1e('0x42')]=[{'all':!![]}];}_0x4bcc8a=_['merge']({},_0x4bcc8a,_0x4e3bbc[_0x3a1e('0x41')]);return db[_0x3a1e('0x2f')][_0x3a1e('0x48')](_0x4bcc8a)['then'](handleEntityNotFound(_0x2080cd,null))[_0x3a1e('0x29')](respondWithResult(_0x2080cd,null))['catch'](handleError(_0x2080cd,null));};exports[_0x3a1e('0x49')]=function(_0x3c1117,_0x4b791c){return db['VoiceQueueReport'][_0x3a1e('0x49')](_0x3c1117[_0x3a1e('0x4a')],{})[_0x3a1e('0x29')](respondWithResult(_0x4b791c,0xc9))[_0x3a1e('0x45')](handleError(_0x4b791c,null));};exports['update']=function(_0x357419,_0x27932a){if(_0x357419[_0x3a1e('0x4a')]['id']){delete _0x357419[_0x3a1e('0x4a')]['id'];}return db[_0x3a1e('0x2f')][_0x3a1e('0x48')]({'where':{'id':_0x357419['params']['id']}})[_0x3a1e('0x29')](handleEntityNotFound(_0x27932a,null))[_0x3a1e('0x29')](saveUpdates(_0x357419[_0x3a1e('0x4a')],null))[_0x3a1e('0x29')](respondWithResult(_0x27932a,null))[_0x3a1e('0x45')](handleError(_0x27932a,null));};exports[_0x3a1e('0x4b')]=function(_0x3a4377,_0x47b1dd){return db[_0x3a1e('0x2f')][_0x3a1e('0x48')]({'where':{'id':_0x3a4377[_0x3a1e('0x4c')]['id']}})[_0x3a1e('0x29')](handleEntityNotFound(_0x47b1dd,null))[_0x3a1e('0x29')](removeEntity(_0x47b1dd,null))[_0x3a1e('0x45')](handleError(_0x47b1dd,null));};exports[_0x3a1e('0x4d')]=function(_0x39210b,_0x558274){return db['VoiceQueueReport'][_0x3a1e('0x4d')]()['then'](respondWithResult(_0x558274,null))['catch'](handleError(_0x558274,null));};exports[_0x3a1e('0x4e')]=function(_0x15e30c,_0x15ba1e){var _0x1a4b01={},_0x52ccec={},_0x4086a1={'count':0x0,'rows':[]};_0x52ccec[_0x3a1e('0x34')]=_[_0x3a1e('0x36')](db[_0x3a1e('0x2f')]['rawAttributes']);_0x52ccec[_0x3a1e('0x35')]=_[_0x3a1e('0x36')](_0x15e30c[_0x3a1e('0x35')]);_0x52ccec[_0x3a1e('0x37')]=_[_0x3a1e('0x39')](_0x52ccec[_0x3a1e('0x34')],_0x52ccec['query']);_0x1a4b01['attributes']=_[_0x3a1e('0x39')](_0x52ccec['model'],qs[_0x3a1e('0x46')](_0x15e30c['query'][_0x3a1e('0x46')]));_0x1a4b01[_0x3a1e('0x38')]=_0x1a4b01[_0x3a1e('0x38')]['length']?_0x1a4b01[_0x3a1e('0x38')]:_0x52ccec[_0x3a1e('0x34')];if(!_0x15e30c['query'][_0x3a1e('0x4f')](_0x3a1e('0x50'))){_0x1a4b01[_0x3a1e('0x22')]=qs[_0x3a1e('0x22')](_0x15e30c[_0x3a1e('0x35')]['limit']);_0x1a4b01[_0x3a1e('0x1f')]=qs[_0x3a1e('0x1f')](_0x15e30c['query'][_0x3a1e('0x1f')]);}_0x1a4b01[_0x3a1e('0x3b')]=qs['sort'](_0x15e30c[_0x3a1e('0x35')][_0x3a1e('0x3c')]);_0x1a4b01['where']=qs[_0x3a1e('0x37')](_[_0x3a1e('0x3e')](_0x15e30c[_0x3a1e('0x35')],_0x52ccec[_0x3a1e('0x37')]));if(_0x15e30c[_0x3a1e('0x35')][_0x3a1e('0x3f')]){_0x1a4b01[_0x3a1e('0x3d')]=_[_0x3a1e('0x40')](_0x1a4b01[_0x3a1e('0x3d')],{'$or':_[_0x3a1e('0x2e')](_0x1a4b01[_0x3a1e('0x38')],function(_0x2a83f7){var _0x32197e={};_0x32197e[_0x2a83f7]={'$like':'%'+_0x15e30c[_0x3a1e('0x35')][_0x3a1e('0x3f')]+'%'};return _0x32197e;})});}_0x1a4b01=_[_0x3a1e('0x40')]({},_0x1a4b01,_0x15e30c[_0x3a1e('0x41')]);var _0xa5c927={'where':_0x1a4b01[_0x3a1e('0x3d')]};return db[_0x3a1e('0x2f')]['count'](_0xa5c927)[_0x3a1e('0x29')](function(_0x2d242f){_0x4086a1[_0x3a1e('0x21')]=_0x2d242f;if(_0x15e30c[_0x3a1e('0x35')][_0x3a1e('0x47')]){_0x1a4b01['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3a1e('0x43')](_0x1a4b01);})[_0x3a1e('0x29')](function(_0x59efff){_0x4086a1[_0x3a1e('0x44')]=_0x59efff;return _0x4086a1;})[_0x3a1e('0x29')](respondWithFilteredResult(_0x15ba1e,_0x1a4b01,'getVoiceQueuesReport'))[_0x3a1e('0x45')](handleError(_0x15ba1e,null,_0x3a1e('0x4e')));}; \ No newline at end of file +var _0x4b03=['./voiceQueueReport.socket','register','sendStatus','end','json','undefined','count','offset','status','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0x4b03,0x130));var _0x34b0=function(_0xd03892,_0x4f5416){_0xd03892=_0xd03892-0x0;var _0x2bae0d=_0x4b03[_0xd03892];return _0x2bae0d;};'use strict';var emlformat=require(_0x34b0('0x0'));var rimraf=require(_0x34b0('0x1'));var zipdir=require(_0x34b0('0x2'));var jsonpatch=require(_0x34b0('0x3'));var rp=require('request-promise');var moment=require(_0x34b0('0x4'));var BPromise=require(_0x34b0('0x5'));var Mustache=require(_0x34b0('0x6'));var util=require(_0x34b0('0x7'));var path=require(_0x34b0('0x8'));var sox=require('sox');var csv=require(_0x34b0('0x9'));var ejs=require(_0x34b0('0xa'));var fs=require('fs');var fs_extra=require(_0x34b0('0xb'));var _=require('lodash');var squel=require(_0x34b0('0xc'));var crypto=require(_0x34b0('0xd'));var jsforce=require(_0x34b0('0xe'));var deskjs=require(_0x34b0('0xf'));var toCsv=require(_0x34b0('0x9'));var querystring=require('querystring');var Papa=require(_0x34b0('0x10'));var Redis=require('ioredis');var authService=require(_0x34b0('0x11'));var qs=require(_0x34b0('0x12'));var as=require(_0x34b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x34b0('0x14'));var utils=require('../../config/utils');var config=require(_0x34b0('0x15'));var licenseUtil=require(_0x34b0('0x16'));var db=require(_0x34b0('0x17'))['db'];config[_0x34b0('0x18')]=_[_0x34b0('0x19')](config[_0x34b0('0x18')],{'host':_0x34b0('0x1a'),'port':0x18eb});var socket=require(_0x34b0('0x1b'))(new Redis(config['redis']));require(_0x34b0('0x1c'))[_0x34b0('0x1d')](socket);function respondWithStatusCode(_0x4b1130,_0x5d90d3){_0x5d90d3=_0x5d90d3||0xcc;return function(_0x165ffc){if(_0x165ffc){return _0x4b1130[_0x34b0('0x1e')](_0x5d90d3);}return _0x4b1130['status'](_0x5d90d3)[_0x34b0('0x1f')]();};}function respondWithResult(_0x9b0932,_0x3a3352){_0x3a3352=_0x3a3352||0xc8;return function(_0x126291){if(_0x126291){return _0x9b0932['status'](_0x3a3352)[_0x34b0('0x20')](_0x126291);}};}function respondWithFilteredResult(_0x19f377,_0x396783){return function(_0x595acd){if(_0x595acd){var _0x427cd1=typeof _0x396783['offset']===_0x34b0('0x21')&&typeof _0x396783['limit']===_0x34b0('0x21');var _0x3984a8=_0x595acd[_0x34b0('0x22')];var _0x4a03c4=_0x427cd1?0x0:_0x396783[_0x34b0('0x23')];var _0x4db9f3=_0x427cd1?_0x595acd[_0x34b0('0x22')]:_0x396783['offset']+_0x396783['limit'];var _0x243f75;if(_0x4db9f3>=_0x3984a8){_0x4db9f3=_0x3984a8;_0x243f75=0xc8;}else{_0x243f75=0xce;}_0x19f377[_0x34b0('0x24')](_0x243f75);return _0x19f377[_0x34b0('0x25')](_0x34b0('0x26'),_0x4a03c4+'-'+_0x4db9f3+'/'+_0x3984a8)['json'](_0x595acd);}return null;};}function patchUpdates(_0x2d8a39){return function(_0x2e62d6){try{jsonpatch[_0x34b0('0x27')](_0x2e62d6,_0x2d8a39,!![]);}catch(_0x4e369d){return BPromise['reject'](_0x4e369d);}return _0x2e62d6[_0x34b0('0x28')]();};}function saveUpdates(_0x5e31f7,_0x4ccd07){return function(_0x56a95b){if(_0x56a95b){return _0x56a95b['update'](_0x5e31f7)[_0x34b0('0x29')](function(_0x590441){return _0x590441;});}return null;};}function removeEntity(_0x46ef94,_0xb41444){return function(_0x505572){if(_0x505572){return _0x505572[_0x34b0('0x2a')]()[_0x34b0('0x29')](function(){_0x46ef94[_0x34b0('0x24')](0xcc)[_0x34b0('0x1f')]();});}};}function handleEntityNotFound(_0x769de6,_0x34e06e){return function(_0x4c45e7){if(!_0x4c45e7){_0x769de6[_0x34b0('0x1e')](0x194);}return _0x4c45e7;};}function handleError(_0x3905cb,_0x1124f4){_0x1124f4=_0x1124f4||0x1f4;return function(_0x437ba6){logger[_0x34b0('0x2b')](_0x437ba6[_0x34b0('0x2c')]);if(_0x437ba6[_0x34b0('0x2d')]){delete _0x437ba6['name'];}_0x3905cb[_0x34b0('0x24')](_0x1124f4)[_0x34b0('0x2e')](_0x437ba6);};}exports[_0x34b0('0x2f')]=function(_0x385184,_0x54d660){var _0x493455={},_0x5a2053={},_0x592a95={'count':0x0,'rows':[]};var _0x12d0f7=_[_0x34b0('0x30')](db[_0x34b0('0x31')][_0x34b0('0x32')],function(_0x22fa99){return{'name':_0x22fa99[_0x34b0('0x33')],'type':_0x22fa99['type']['key']};});_0x5a2053[_0x34b0('0x34')]=_['map'](_0x12d0f7,_0x34b0('0x2d'));_0x5a2053[_0x34b0('0x35')]=_[_0x34b0('0x36')](_0x385184['query']);_0x5a2053['filters']=_['intersection'](_0x5a2053[_0x34b0('0x34')],_0x5a2053[_0x34b0('0x35')]);_0x493455[_0x34b0('0x37')]=_[_0x34b0('0x38')](_0x5a2053[_0x34b0('0x34')],qs[_0x34b0('0x39')](_0x385184[_0x34b0('0x35')]['fields']));_0x493455['attributes']=_0x493455[_0x34b0('0x37')][_0x34b0('0x3a')]?_0x493455[_0x34b0('0x37')]:_0x5a2053[_0x34b0('0x34')];if(!_0x385184[_0x34b0('0x35')][_0x34b0('0x3b')]('nolimit')){_0x493455[_0x34b0('0x3c')]=qs[_0x34b0('0x3c')](_0x385184['query']['limit']);_0x493455[_0x34b0('0x23')]=qs[_0x34b0('0x23')](_0x385184[_0x34b0('0x35')][_0x34b0('0x23')]);}_0x493455[_0x34b0('0x3d')]=qs[_0x34b0('0x3e')](_0x385184[_0x34b0('0x35')][_0x34b0('0x3e')]);_0x493455['where']=qs[_0x34b0('0x3f')](_[_0x34b0('0x40')](_0x385184[_0x34b0('0x35')],_0x5a2053['filters']),_0x12d0f7);if(_0x385184[_0x34b0('0x35')][_0x34b0('0x41')]){_0x493455[_0x34b0('0x42')]=_[_0x34b0('0x43')](_0x493455[_0x34b0('0x42')],{'$or':_[_0x34b0('0x30')](_0x12d0f7,function(_0x4abd7a){if(_0x4abd7a[_0x34b0('0x44')]!==_0x34b0('0x45')){var _0x2eaf9c={};_0x2eaf9c[_0x4abd7a[_0x34b0('0x2d')]]={'$like':'%'+_0x385184[_0x34b0('0x35')][_0x34b0('0x41')]+'%'};return _0x2eaf9c;}})});}_0x493455=_[_0x34b0('0x43')]({},_0x493455,_0x385184[_0x34b0('0x46')]);var _0xa0bb73={'where':_0x493455['where']};return db[_0x34b0('0x31')][_0x34b0('0x22')](_0xa0bb73)[_0x34b0('0x29')](function(_0xda6755){_0x592a95[_0x34b0('0x22')]=_0xda6755;if(_0x385184[_0x34b0('0x35')]['includeAll']){_0x493455[_0x34b0('0x47')]=[{'all':!![]}];}return db[_0x34b0('0x31')][_0x34b0('0x48')](_0x493455);})[_0x34b0('0x29')](function(_0x3dc8cc){_0x592a95[_0x34b0('0x49')]=_0x3dc8cc;return _0x592a95;})[_0x34b0('0x29')](respondWithFilteredResult(_0x54d660,_0x493455))[_0x34b0('0x4a')](handleError(_0x54d660,null));};exports[_0x34b0('0x4b')]=function(_0x356d02,_0x2875cb){var _0x114421={'raw':![],'where':{'id':_0x356d02['params']['id']}},_0x44f42a={};_0x44f42a[_0x34b0('0x34')]=_[_0x34b0('0x36')](db[_0x34b0('0x31')]['rawAttributes']);_0x44f42a[_0x34b0('0x35')]=_[_0x34b0('0x36')](_0x356d02['query']);_0x44f42a[_0x34b0('0x3f')]=_[_0x34b0('0x38')](_0x44f42a[_0x34b0('0x34')],_0x44f42a[_0x34b0('0x35')]);_0x114421[_0x34b0('0x37')]=_['intersection'](_0x44f42a['model'],qs[_0x34b0('0x39')](_0x356d02[_0x34b0('0x35')]['fields']));_0x114421[_0x34b0('0x37')]=_0x114421[_0x34b0('0x37')]['length']?_0x114421[_0x34b0('0x37')]:_0x44f42a[_0x34b0('0x34')];if(_0x356d02['query'][_0x34b0('0x4c')]){_0x114421[_0x34b0('0x47')]=[{'all':!![]}];}_0x114421=_['merge']({},_0x114421,_0x356d02[_0x34b0('0x46')]);return db[_0x34b0('0x31')][_0x34b0('0x4d')](_0x114421)['then'](handleEntityNotFound(_0x2875cb,null))[_0x34b0('0x29')](respondWithResult(_0x2875cb,null))[_0x34b0('0x4a')](handleError(_0x2875cb,null));};exports[_0x34b0('0x4e')]=function(_0x2eb27f,_0x197be2){return db[_0x34b0('0x31')][_0x34b0('0x4e')](_0x2eb27f['body'],{})[_0x34b0('0x29')](respondWithResult(_0x197be2,0xc9))[_0x34b0('0x4a')](handleError(_0x197be2,null));};exports['update']=function(_0x56431a,_0x39f7c1){if(_0x56431a[_0x34b0('0x4f')]['id']){delete _0x56431a['body']['id'];}return db[_0x34b0('0x31')][_0x34b0('0x4d')]({'where':{'id':_0x56431a['params']['id']}})[_0x34b0('0x29')](handleEntityNotFound(_0x39f7c1,null))[_0x34b0('0x29')](saveUpdates(_0x56431a[_0x34b0('0x4f')],null))[_0x34b0('0x29')](respondWithResult(_0x39f7c1,null))[_0x34b0('0x4a')](handleError(_0x39f7c1,null));};exports['destroy']=function(_0x13658a,_0x3c8089){return db['VoiceQueueReport'][_0x34b0('0x4d')]({'where':{'id':_0x13658a[_0x34b0('0x50')]['id']}})[_0x34b0('0x29')](handleEntityNotFound(_0x3c8089,null))['then'](removeEntity(_0x3c8089,null))[_0x34b0('0x4a')](handleError(_0x3c8089,null));};exports[_0x34b0('0x51')]=function(_0x37fc20,_0x379c8e){return db[_0x34b0('0x31')]['describe']()[_0x34b0('0x29')](respondWithResult(_0x379c8e,null))[_0x34b0('0x4a')](handleError(_0x379c8e,null));};exports[_0x34b0('0x52')]=function(_0x45ec17,_0xaf904f){var _0x45cb2c={},_0x457cba={},_0x48a9e3={'count':0x0,'rows':[]};_0x457cba[_0x34b0('0x34')]=_[_0x34b0('0x36')](db[_0x34b0('0x31')][_0x34b0('0x32')]);_0x457cba[_0x34b0('0x35')]=_['keys'](_0x45ec17['query']);_0x457cba[_0x34b0('0x3f')]=_['intersection'](_0x457cba[_0x34b0('0x34')],_0x457cba['query']);_0x45cb2c[_0x34b0('0x37')]=_['intersection'](_0x457cba[_0x34b0('0x34')],qs[_0x34b0('0x39')](_0x45ec17['query'][_0x34b0('0x39')]));_0x45cb2c[_0x34b0('0x37')]=_0x45cb2c[_0x34b0('0x37')]['length']?_0x45cb2c[_0x34b0('0x37')]:_0x457cba[_0x34b0('0x34')];if(!_0x45ec17[_0x34b0('0x35')][_0x34b0('0x3b')]('nolimit')){_0x45cb2c[_0x34b0('0x3c')]=qs['limit'](_0x45ec17['query'][_0x34b0('0x3c')]);_0x45cb2c['offset']=qs['offset'](_0x45ec17['query'][_0x34b0('0x23')]);}_0x45cb2c[_0x34b0('0x3d')]=qs['sort'](_0x45ec17[_0x34b0('0x35')]['sort']);_0x45cb2c[_0x34b0('0x42')]=qs[_0x34b0('0x3f')](_[_0x34b0('0x40')](_0x45ec17[_0x34b0('0x35')],_0x457cba[_0x34b0('0x3f')]));if(_0x45ec17[_0x34b0('0x35')]['filter']){_0x45cb2c['where']=_[_0x34b0('0x43')](_0x45cb2c[_0x34b0('0x42')],{'$or':_[_0x34b0('0x30')](_0x45cb2c[_0x34b0('0x37')],function(_0x23d261){var _0x3d09bd={};_0x3d09bd[_0x23d261]={'$like':'%'+_0x45ec17[_0x34b0('0x35')][_0x34b0('0x41')]+'%'};return _0x3d09bd;})});}_0x45cb2c=_[_0x34b0('0x43')]({},_0x45cb2c,_0x45ec17[_0x34b0('0x46')]);var _0x445c05={'where':_0x45cb2c[_0x34b0('0x42')]};return db['VoiceQueueReport'][_0x34b0('0x22')](_0x445c05)[_0x34b0('0x29')](function(_0x2ed8cf){_0x48a9e3[_0x34b0('0x22')]=_0x2ed8cf;if(_0x45ec17['query'][_0x34b0('0x4c')]){_0x45cb2c[_0x34b0('0x47')]=[{'all':!![]}];}return db[_0x34b0('0x31')][_0x34b0('0x48')](_0x45cb2c);})[_0x34b0('0x29')](function(_0x551902){_0x48a9e3[_0x34b0('0x49')]=_0x551902;return _0x48a9e3;})[_0x34b0('0x29')](respondWithFilteredResult(_0xaf904f,_0x45cb2c,_0x34b0('0x52')))[_0x34b0('0x4a')](handleError(_0xaf904f,null,_0x34b0('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index ee24ff7..e9e1cf9 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 _0xf58f=['hook','exports','VoiceQueueReport','setMaxListeners','update','remove','emit'];(function(_0xce59d4,_0x581188){var _0x19d226=function(_0x16e5fa){while(--_0x16e5fa){_0xce59d4['push'](_0xce59d4['shift']());}};_0x19d226(++_0x581188);}(_0xf58f,0x1d7));var _0xff58=function(_0x477d9f,_0xcbe847){_0x477d9f=_0x477d9f-0x0;var _0xd0ba14=_0xf58f[_0x477d9f];return _0xd0ba14;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0xff58('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xff58('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xff58('0x2'),'afterDestroy':_0xff58('0x3')};function emitEvent(_0x40c20d){return function(_0x5457ee,_0x46d725,_0x1e3580){VoiceQueueReportEvents[_0xff58('0x4')](_0x40c20d+':'+_0x5457ee['id'],_0x5457ee);VoiceQueueReportEvents[_0xff58('0x4')](_0x40c20d,_0x5457ee);_0x1e3580(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xff58('0x5')](e,emitEvent(event));}}module[_0xff58('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x465f=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x465f,0x1e3));var _0xf465=function(_0xd562d6,_0x6c72ec){_0xd562d6=_0xd562d6-0x0;var _0x1b36be=_0x465f[_0xd562d6];return _0x1b36be;};'use strict';var EventEmitter=require(_0xf465('0x0'));var VoiceQueueReport=require(_0xf465('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf465('0x2')](0x0);var events={'afterCreate':_0xf465('0x3'),'afterUpdate':_0xf465('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1dad73){return function(_0x367a4a,_0x1ab571,_0x177e55){VoiceQueueReportEvents[_0xf465('0x5')](_0x1dad73+':'+_0x367a4a['id'],_0x367a4a);VoiceQueueReportEvents[_0xf465('0x5')](_0x1dad73,_0x367a4a);_0x177e55(null);};}for(var e in events){if(events[_0xf465('0x6')](e)){var event=events[e];VoiceQueueReport[_0xf465('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0cff2b0..ee178f8 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 _0x9964=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util'];(function(_0x269b97,_0x10d133){var _0x120efa=function(_0xef252d){while(--_0xef252d){_0x269b97['push'](_0x269b97['shift']());}};_0x120efa(++_0x10d133);}(_0x9964,0x85));var _0x4996=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x9964[_0x263f9d];return _0x4c4efa;};'use strict';var _=require(_0x4996('0x0'));var util=require(_0x4996('0x1'));var logger=require('../../config/logger')(_0x4996('0x2'));var moment=require(_0x4996('0x3'));var BPromise=require(_0x4996('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4996('0x5'));var rimraf=require(_0x4996('0x6'));var config=require(_0x4996('0x7'));var attributes=require(_0x4996('0x8'));module[_0x4996('0x9')]=function(_0x18151e,_0x3d983b){return _0x18151e[_0x4996('0xa')](_0x4996('0xb'),attributes,{'tableName':_0x4996('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4996('0xd')]},{'fields':[_0x4996('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8962=['calleridnum','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x8962,0x1e2));var _0x2896=function(_0x19c0c5,_0x1e5de4){_0x19c0c5=_0x19c0c5-0x0;var _0x2ab557=_0x8962[_0x19c0c5];return _0x2ab557;};'use strict';var _=require('lodash');var util=require(_0x2896('0x0'));var logger=require(_0x2896('0x1'))(_0x2896('0x2'));var moment=require(_0x2896('0x3'));var BPromise=require('bluebird');var rp=require(_0x2896('0x4'));var fs=require('fs');var path=require(_0x2896('0x5'));var rimraf=require(_0x2896('0x6'));var config=require(_0x2896('0x7'));var attributes=require(_0x2896('0x8'));module[_0x2896('0x9')]=function(_0x59ca56,_0x2e052b){return _0x59ca56[_0x2896('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x2896('0xb')]},{'fields':[_0x2896('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 95afe30..48183f3 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 _0xd861=['create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','limit','include','model','map','attributes','info','debug','stringify'];(function(_0x438578,_0xeccb24){var _0x55f90b=function(_0x2ef1fd){while(--_0x2ef1fd){_0x438578['push'](_0x438578['shift']());}};_0x55f90b(++_0xeccb24);}(_0xd861,0x114));var _0x1d86=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd861[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x1d86('0x0'));var util=require(_0x1d86('0x1'));var moment=require(_0x1d86('0x2'));var BPromise=require(_0x1d86('0x3'));var rs=require(_0x1d86('0x4'));var fs=require('fs');var Redis=require(_0x1d86('0x5'));var db=require(_0x1d86('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d86('0x7'))(_0x1d86('0x8'));var config=require(_0x1d86('0x9'));var jayson=require(_0x1d86('0xa'));var client=jayson[_0x1d86('0xb')]['http']({'port':0x232a});config['redis']=_[_0x1d86('0xc')](config[_0x1d86('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d86('0xe'))(new Redis(config['redis']));require(_0x1d86('0xf'))[_0x1d86('0x10')](socket);function respondWithRpcPromise(_0x4f532d,_0x5cb2ec,_0x1b681f){return new BPromise(function(_0x21b3f2,_0x5dfc5b){return client[_0x1d86('0x11')](_0x4f532d,_0x1b681f)[_0x1d86('0x12')](function(_0x2166ab){logger['info'](_0x1d86('0x13'),_0x5cb2ec,_0x1d86('0x14'));logger['debug'](_0x1d86('0x15'),_0x5cb2ec,_0x1d86('0x14'),JSON['stringify'](_0x2166ab));if(_0x2166ab['error']){if(_0x2166ab[_0x1d86('0x16')][_0x1d86('0x17')]===0x1f4){logger[_0x1d86('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x5cb2ec,_0x2166ab[_0x1d86('0x16')][_0x1d86('0x18')]);return _0x5dfc5b(_0x2166ab[_0x1d86('0x16')][_0x1d86('0x18')]);}logger[_0x1d86('0x16')](_0x1d86('0x13'),_0x5cb2ec,_0x2166ab[_0x1d86('0x16')][_0x1d86('0x18')]);return _0x21b3f2(_0x2166ab[_0x1d86('0x16')][_0x1d86('0x18')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x5cb2ec,_0x1d86('0x14'));_0x21b3f2(_0x2166ab[_0x1d86('0x19')][_0x1d86('0x18')]);}})[_0x1d86('0x1a')](function(_0x448ccf){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5cb2ec,_0x448ccf);_0x5dfc5b(_0x448ccf);});});}exports[_0x1d86('0x1b')]=function(_0x4e59c1){var _0x26e57b=this;return new Promise(function(_0x522bda,_0x1543dc){return db[_0x1d86('0x1c')]['findAll']({'raw':_0x4e59c1['options']?_0x4e59c1[_0x1d86('0x1d')][_0x1d86('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e59c1['options']?_0x4e59c1['options']['where']||null:null,'attributes':_0x4e59c1[_0x1d86('0x1d')]?_0x4e59c1[_0x1d86('0x1d')]['attributes']||null:null,'limit':_0x4e59c1[_0x1d86('0x1d')]?_0x4e59c1['options'][_0x1d86('0x1f')]||null:null,'include':_0x4e59c1['options']?_0x4e59c1[_0x1d86('0x1d')]['include']?_['map'](_0x4e59c1[_0x1d86('0x1d')][_0x1d86('0x20')],function(_0x394d2a){return{'model':db[_0x394d2a[_0x1d86('0x21')]],'as':_0x394d2a['as'],'attributes':_0x394d2a['attributes'],'include':_0x394d2a[_0x1d86('0x20')]?_[_0x1d86('0x22')](_0x394d2a[_0x1d86('0x20')],function(_0x39b69a){return{'model':db[_0x39b69a[_0x1d86('0x21')]],'as':_0x39b69a['as'],'attributes':_0x39b69a[_0x1d86('0x23')],'include':_0x39b69a[_0x1d86('0x20')]?_['map'](_0x39b69a[_0x1d86('0x20')],function(_0x5eccb7){return{'model':db[_0x5eccb7['model']],'as':_0x5eccb7['as'],'attributes':_0x5eccb7[_0x1d86('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa69268){logger[_0x1d86('0x24')]('GetVoiceQueueReport',_0x4e59c1);logger[_0x1d86('0x25')](_0x1d86('0x1b'),_0x4e59c1,JSON[_0x1d86('0x26')](_0xa69268));_0x522bda(_0xa69268);})[_0x1d86('0x1a')](function(_0x525d4b){logger['error'](_0x1d86('0x1b'),_0x525d4b['message'],_0x4e59c1);_0x1543dc(_0x26e57b[_0x1d86('0x16')](0x1f4,_0x525d4b['message']));});});};exports['CreateVoiceQueueReport']=function(_0x4f5b52){var _0x411795=this;return new Promise(function(_0x2f7f9c,_0x561a98){return db[_0x1d86('0x1c')][_0x1d86('0x27')](_0x4f5b52[_0x1d86('0x28')],{'raw':_0x4f5b52[_0x1d86('0x1d')]?_0x4f5b52['options']['raw']===undefined?!![]:![]:!![]})[_0x1d86('0x12')](function(_0x6f6d17){logger['info'](_0x1d86('0x29'),_0x4f5b52);logger[_0x1d86('0x25')]('CreateVoiceQueueReport',_0x4f5b52,JSON['stringify'](_0x6f6d17));_0x2f7f9c(_0x6f6d17);})['catch'](function(_0x1a4d28){logger[_0x1d86('0x16')]('CreateVoiceQueueReport',_0x1a4d28[_0x1d86('0x18')],_0x4f5b52);_0x561a98(_0x411795[_0x1d86('0x16')](0x1f4,_0x1a4d28[_0x1d86('0x18')]));});});};exports[_0x1d86('0x2a')]=function(_0x46d80b){var _0x2e6154=this;return new Promise(function(_0x3b957f,_0x421389){return db['VoiceQueueReport'][_0x1d86('0x2b')](_0x46d80b[_0x1d86('0x28')],{'raw':_0x46d80b[_0x1d86('0x1d')]?_0x46d80b[_0x1d86('0x1d')][_0x1d86('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46d80b[_0x1d86('0x1d')]?_0x46d80b[_0x1d86('0x1d')][_0x1d86('0x2c')]||null:null,'attributes':_0x46d80b[_0x1d86('0x1d')]?_0x46d80b['options'][_0x1d86('0x23')]||null:null,'limit':_0x46d80b['options']?_0x46d80b[_0x1d86('0x1d')][_0x1d86('0x1f')]||null:null})[_0x1d86('0x12')](function(_0x19b49f){logger[_0x1d86('0x24')](_0x1d86('0x2a'),_0x46d80b);logger['debug'](_0x1d86('0x2a'),_0x46d80b,JSON[_0x1d86('0x26')](_0x19b49f));_0x3b957f(_0x19b49f);})[_0x1d86('0x1a')](function(_0x90e66b){logger[_0x1d86('0x16')]('UpdateVoiceQueueReport',_0x90e66b[_0x1d86('0x18')],_0x46d80b);_0x421389(_0x2e6154[_0x1d86('0x16')](0x1f4,_0x90e66b[_0x1d86('0x18')]));});});}; \ No newline at end of file +var _0x04df=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','stringify','update','UpdateVoiceQueueReport','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f4074,_0x1441cb){var _0x30b009=function(_0x617d9b){while(--_0x617d9b){_0x1f4074['push'](_0x1f4074['shift']());}};_0x30b009(++_0x1441cb);}(_0x04df,0x133));var _0xf04d=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x04df[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0xf04d('0x0'));var util=require(_0xf04d('0x1'));var moment=require(_0xf04d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf04d('0x3'));var db=require(_0xf04d('0x4'))['db'];var utils=require(_0xf04d('0x5'));var logger=require(_0xf04d('0x6'))(_0xf04d('0x7'));var config=require(_0xf04d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf04d('0x9')][_0xf04d('0xa')]({'port':0x232a});config[_0xf04d('0xb')]=_[_0xf04d('0xc')](config[_0xf04d('0xb')],{'host':_0xf04d('0xd'),'port':0x18eb});var socket=require(_0xf04d('0xe'))(new Redis(config[_0xf04d('0xb')]));require(_0xf04d('0xf'))[_0xf04d('0x10')](socket);function respondWithRpcPromise(_0x3de58a,_0x53ecdf,_0x5ae266){return new BPromise(function(_0x1fd361,_0x3bd5eb){return client[_0xf04d('0x11')](_0x3de58a,_0x5ae266)[_0xf04d('0x12')](function(_0x57cbdd){logger[_0xf04d('0x13')](_0xf04d('0x14'),_0x53ecdf,_0xf04d('0x15'));logger[_0xf04d('0x16')](_0xf04d('0x17'),_0x53ecdf,_0xf04d('0x15'),JSON['stringify'](_0x57cbdd));if(_0x57cbdd['error']){if(_0x57cbdd[_0xf04d('0x18')][_0xf04d('0x19')]===0x1f4){logger[_0xf04d('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x53ecdf,_0x57cbdd[_0xf04d('0x18')][_0xf04d('0x1a')]);return _0x3bd5eb(_0x57cbdd[_0xf04d('0x18')][_0xf04d('0x1a')]);}logger['error'](_0xf04d('0x14'),_0x53ecdf,_0x57cbdd[_0xf04d('0x18')]['message']);return _0x1fd361(_0x57cbdd[_0xf04d('0x18')][_0xf04d('0x1a')]);}else{logger[_0xf04d('0x13')](_0xf04d('0x14'),_0x53ecdf,_0xf04d('0x15'));_0x1fd361(_0x57cbdd[_0xf04d('0x1b')][_0xf04d('0x1a')]);}})[_0xf04d('0x1c')](function(_0xcfc42e){logger[_0xf04d('0x18')](_0xf04d('0x14'),_0x53ecdf,_0xcfc42e);_0x3bd5eb(_0xcfc42e);});});}exports[_0xf04d('0x1d')]=function(_0x2ce69c){var _0x36e5d4=this;return new Promise(function(_0x43375b,_0x1cf23d){return db[_0xf04d('0x1e')][_0xf04d('0x1f')]({'raw':_0x2ce69c[_0xf04d('0x20')]?_0x2ce69c[_0xf04d('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2ce69c['options']?_0x2ce69c['options'][_0xf04d('0x21')]||null:null,'attributes':_0x2ce69c[_0xf04d('0x20')]?_0x2ce69c['options'][_0xf04d('0x22')]||null:null,'limit':_0x2ce69c[_0xf04d('0x20')]?_0x2ce69c[_0xf04d('0x20')][_0xf04d('0x23')]||null:null,'include':_0x2ce69c['options']?_0x2ce69c[_0xf04d('0x20')][_0xf04d('0x24')]?_[_0xf04d('0x25')](_0x2ce69c[_0xf04d('0x20')][_0xf04d('0x24')],function(_0x48cb2d){return{'model':db[_0x48cb2d[_0xf04d('0x26')]],'as':_0x48cb2d['as'],'attributes':_0x48cb2d[_0xf04d('0x22')],'include':_0x48cb2d[_0xf04d('0x24')]?_[_0xf04d('0x25')](_0x48cb2d['include'],function(_0x469981){return{'model':db[_0x469981['model']],'as':_0x469981['as'],'attributes':_0x469981['attributes'],'include':_0x469981[_0xf04d('0x24')]?_['map'](_0x469981['include'],function(_0x5883e0){return{'model':db[_0x5883e0['model']],'as':_0x5883e0['as'],'attributes':_0x5883e0[_0xf04d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf04d('0x12')](function(_0x1a2987){logger[_0xf04d('0x13')](_0xf04d('0x1d'),_0x2ce69c);logger[_0xf04d('0x16')](_0xf04d('0x1d'),_0x2ce69c,JSON['stringify'](_0x1a2987));_0x43375b(_0x1a2987);})['catch'](function(_0x2b1c64){logger[_0xf04d('0x18')]('GetVoiceQueueReport',_0x2b1c64[_0xf04d('0x1a')],_0x2ce69c);_0x1cf23d(_0x36e5d4[_0xf04d('0x18')](0x1f4,_0x2b1c64[_0xf04d('0x1a')]));});});};exports[_0xf04d('0x27')]=function(_0x5e0875){var _0x18b785=this;return new Promise(function(_0x413f22,_0x2335a9){return db['VoiceQueueReport'][_0xf04d('0x28')](_0x5e0875[_0xf04d('0x29')],{'raw':_0x5e0875['options']?_0x5e0875['options']['raw']===undefined?!![]:![]:!![]})[_0xf04d('0x12')](function(_0xa42966){logger['info'](_0xf04d('0x27'),_0x5e0875);logger[_0xf04d('0x16')](_0xf04d('0x27'),_0x5e0875,JSON[_0xf04d('0x2a')](_0xa42966));_0x413f22(_0xa42966);})['catch'](function(_0x529f81){logger[_0xf04d('0x18')](_0xf04d('0x27'),_0x529f81[_0xf04d('0x1a')],_0x5e0875);_0x2335a9(_0x18b785[_0xf04d('0x18')](0x1f4,_0x529f81['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x222879){var _0x5ad692=this;return new Promise(function(_0x1f0cda,_0x9dee9){return db[_0xf04d('0x1e')][_0xf04d('0x2b')](_0x222879[_0xf04d('0x29')],{'raw':_0x222879[_0xf04d('0x20')]?_0x222879[_0xf04d('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222879['options']?_0x222879['options'][_0xf04d('0x21')]||null:null,'attributes':_0x222879[_0xf04d('0x20')]?_0x222879['options']['attributes']||null:null,'limit':_0x222879[_0xf04d('0x20')]?_0x222879[_0xf04d('0x20')]['limit']||null:null})['then'](function(_0x4dfa7e){logger['info']('UpdateVoiceQueueReport',_0x222879);logger[_0xf04d('0x16')](_0xf04d('0x2c'),_0x222879,JSON['stringify'](_0x4dfa7e));_0x1f0cda(_0x4dfa7e);})['catch'](function(_0x408d38){logger[_0xf04d('0x18')](_0xf04d('0x2c'),_0x408d38[_0xf04d('0x1a')],_0x222879);_0x9dee9(_0x5ad692[_0xf04d('0x18')](0x1f4,_0x408d38[_0xf04d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index d9fae16..28e17c0 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 _0x5f7d=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x140a7c,_0x44db44){var _0x38b5ab=function(_0x46b1bf){while(--_0x46b1bf){_0x140a7c['push'](_0x140a7c['shift']());}};_0x38b5ab(++_0x44db44);}(_0x5f7d,0x6d));var _0xd5f7=function(_0x1cf0b2,_0x28a5a7){_0x1cf0b2=_0x1cf0b2-0x0;var _0x55d20e=_0x5f7d[_0x1cf0b2];return _0x55d20e;};'use strict';var VoiceQueueReportEvents=require(_0xd5f7('0x0'));var events=[_0xd5f7('0x1'),_0xd5f7('0x2'),_0xd5f7('0x3')];function createListener(_0x540828,_0x2c0fe0){return function(_0x2e0aad){_0x2c0fe0[_0xd5f7('0x4')](_0x540828,_0x2e0aad);};}function removeListener(_0x2fd574,_0x31fe1f){return function(){VoiceQueueReportEvents['removeListener'](_0x2fd574,_0x31fe1f);};}exports['register']=function(_0x269dc9){for(var _0x4dd30e=0x0,_0x346365=events['length'];_0x4dd30e<_0x346365;_0x4dd30e++){var _0x32e81c=events[_0x4dd30e];var _0x4f365d=createListener(_0xd5f7('0x5')+_0x32e81c,_0x269dc9);VoiceQueueReportEvents['on'](_0x32e81c,_0x4f365d);}}; \ No newline at end of file +var _0x14d8=['./voiceQueueReport.events','save','update','emit','register','length','voiceQueueReport:'];(function(_0x326f34,_0x15a0f0){var _0x5dfc1e=function(_0x4cee3e){while(--_0x4cee3e){_0x326f34['push'](_0x326f34['shift']());}};_0x5dfc1e(++_0x15a0f0);}(_0x14d8,0x19d));var _0x814d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x14d8[_0x465028];return _0xb783d4;};'use strict';var VoiceQueueReportEvents=require(_0x814d('0x0'));var events=[_0x814d('0x1'),'remove',_0x814d('0x2')];function createListener(_0x4e8753,_0xfff5ac){return function(_0x43d8df){_0xfff5ac[_0x814d('0x3')](_0x4e8753,_0x43d8df);};}function removeListener(_0x3e07cd,_0x18917c){return function(){VoiceQueueReportEvents['removeListener'](_0x3e07cd,_0x18917c);};}exports[_0x814d('0x4')]=function(_0x2e1be8){for(var _0x1268c9=0x0,_0x214b1b=events[_0x814d('0x5')];_0x1268c9<_0x214b1b;_0x1268c9++){var _0x3e40f3=events[_0x1268c9];var _0x434320=createListener(_0x814d('0x6')+_0x3e40f3,_0x2e1be8);VoiceQueueReportEvents['on'](_0x3e40f3,_0x434320);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index cf07165..c290e69 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 _0x066a=['delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','create','update'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x066a,0x9b));var _0xa066=function(_0x2ee92d,_0x33de85){_0x2ee92d=_0x2ee92d-0x0;var _0x10e9f1=_0x066a[_0x2ee92d];return _0x10e9f1;};'use strict';var multer=require(_0xa066('0x0'));var util=require(_0xa066('0x1'));var path=require(_0xa066('0x2'));var timeout=require('connect-timeout');var express=require(_0xa066('0x3'));var router=express[_0xa066('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa066('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa066('0x6'));var controller=require(_0xa066('0x7'));router[_0xa066('0x8')]('/',auth['isAuthenticated'](),controller[_0xa066('0x9')]);router[_0xa066('0x8')](_0xa066('0xa'),auth[_0xa066('0xb')](),controller[_0xa066('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa066('0xd')]);router['put'](_0xa066('0xa'),auth[_0xa066('0xb')](),controller[_0xa066('0xe')]);router[_0xa066('0xf')](_0xa066('0xa'),auth[_0xa066('0xb')](),controller[_0xa066('0x10')]);module['exports']=router; \ No newline at end of file +var _0x65a6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x2e4145,_0x490264){var _0x470893=function(_0x30e099){while(--_0x30e099){_0x2e4145['push'](_0x2e4145['shift']());}};_0x470893(++_0x490264);}(_0x65a6,0x19e));var _0x665a=function(_0x3239f5,_0x50e77c){_0x3239f5=_0x3239f5-0x0;var _0x3559c8=_0x65a6[_0x3239f5];return _0x3559c8;};'use strict';var multer=require(_0x665a('0x0'));var util=require(_0x665a('0x1'));var path=require('path');var timeout=require(_0x665a('0x2'));var express=require('express');var router=express[_0x665a('0x3')]();var fs_extra=require(_0x665a('0x4'));var auth=require(_0x665a('0x5'));var interaction=require(_0x665a('0x6'));var config=require(_0x665a('0x7'));var controller=require(_0x665a('0x8'));router[_0x665a('0x9')]('/',auth[_0x665a('0xa')](),controller[_0x665a('0xb')]);router[_0x665a('0x9')](_0x665a('0xc'),auth[_0x665a('0xa')](),controller[_0x665a('0xd')]);router[_0x665a('0xe')]('/',auth[_0x665a('0xa')](),controller['create']);router[_0x665a('0xf')](_0x665a('0xc'),auth[_0x665a('0xa')](),controller[_0x665a('0x10')]);router['delete'](_0x665a('0xc'),auth[_0x665a('0xa')](),controller[_0x665a('0x11')]);module[_0x665a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index bcff12f..4b84374 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 _0x00dd=['STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x33654f,_0x1313a8){var _0x1e01b4=function(_0x162879){while(--_0x162879){_0x33654f['push'](_0x33654f['shift']());}};_0x1e01b4(++_0x1313a8);}(_0x00dd,0xf3));var _0xd00d=function(_0x75aebf,_0xb132d7){_0x75aebf=_0x75aebf-0x0;var _0x148756=_0x00dd[_0x75aebf];return _0x148756;};'use strict';var Sequelize=require(_0xd00d('0x0'));var moment=require(_0xd00d('0x1'));module[_0xd00d('0x2')]={'time':{'type':Sequelize[_0xd00d('0x3')]},'callid':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd00d('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xd00d('0x4')](_0xd00d('0x5'))}}; \ No newline at end of file +var _0xcc8c=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x535dcd,_0x209c52){var _0x4d42d6=function(_0x8c19d5){while(--_0x8c19d5){_0x535dcd['push'](_0x535dcd['shift']());}};_0x4d42d6(++_0x209c52);}(_0xcc8c,0x136));var _0xccc8=function(_0x45598f,_0x1649ec){_0x45598f=_0x45598f-0x0;var _0x517e2b=_0xcc8c[_0x45598f];return _0x517e2b;};'use strict';var Sequelize=require(_0xccc8('0x0'));var moment=require(_0xccc8('0x1'));module['exports']={'time':{'type':Sequelize[_0xccc8('0x2')]},'callid':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xccc8('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xccc8('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xccc8('0x4')](_0xccc8('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a3c1453..28c040f 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 _0xf83b=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','VoiceQueuesLog','fieldName','type','key','map','query','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0xf83b,0x1b2));var _0xbf83=function(_0x56eb81,_0x356366){_0x56eb81=_0x56eb81-0x0;var _0xee518d=_0xf83b[_0x56eb81];return _0xee518d;};'use strict';var emlformat=require(_0xbf83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf83('0x1'));var jsonpatch=require(_0xbf83('0x2'));var rp=require('request-promise');var moment=require(_0xbf83('0x3'));var BPromise=require(_0xbf83('0x4'));var Mustache=require(_0xbf83('0x5'));var util=require(_0xbf83('0x6'));var path=require(_0xbf83('0x7'));var sox=require('sox');var csv=require(_0xbf83('0x8'));var ejs=require(_0xbf83('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf83('0xa'));var squel=require(_0xbf83('0xb'));var crypto=require(_0xbf83('0xc'));var jsforce=require(_0xbf83('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf83('0x8'));var querystring=require(_0xbf83('0xe'));var Papa=require('papaparse');var Redis=require(_0xbf83('0xf'));var authService=require(_0xbf83('0x10'));var qs=require(_0xbf83('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf83('0x12'));var logger=require(_0xbf83('0x13'))(_0xbf83('0x14'));var utils=require(_0xbf83('0x15'));var config=require(_0xbf83('0x16'));var licenseUtil=require(_0xbf83('0x17'));var db=require(_0xbf83('0x18'))['db'];function respondWithStatusCode(_0x31a92d,_0x1fd6f5){_0x1fd6f5=_0x1fd6f5||0xcc;return function(_0x4dfcb5){if(_0x4dfcb5){return _0x31a92d[_0xbf83('0x19')](_0x1fd6f5);}return _0x31a92d[_0xbf83('0x1a')](_0x1fd6f5)[_0xbf83('0x1b')]();};}function respondWithResult(_0x3efc73,_0x483091){_0x483091=_0x483091||0xc8;return function(_0x3afb6d){if(_0x3afb6d){return _0x3efc73['status'](_0x483091)[_0xbf83('0x1c')](_0x3afb6d);}};}function respondWithFilteredResult(_0x1b962b,_0x30b1b3){return function(_0x284852){if(_0x284852){var _0x5d0836=typeof _0x30b1b3[_0xbf83('0x1d')]===_0xbf83('0x1e')&&typeof _0x30b1b3[_0xbf83('0x1f')]===_0xbf83('0x1e');var _0x17b3f8=_0x284852[_0xbf83('0x20')];var _0x32756c=_0x5d0836?0x0:_0x30b1b3[_0xbf83('0x1d')];var _0x47d23d=_0x5d0836?_0x284852[_0xbf83('0x20')]:_0x30b1b3[_0xbf83('0x1d')]+_0x30b1b3['limit'];var _0x4552d4;if(_0x47d23d>=_0x17b3f8){_0x47d23d=_0x17b3f8;_0x4552d4=0xc8;}else{_0x4552d4=0xce;}_0x1b962b[_0xbf83('0x1a')](_0x4552d4);return _0x1b962b[_0xbf83('0x21')](_0xbf83('0x22'),_0x32756c+'-'+_0x47d23d+'/'+_0x17b3f8)[_0xbf83('0x1c')](_0x284852);}return null;};}function patchUpdates(_0x239cb5){return function(_0x716d4d){try{jsonpatch['apply'](_0x716d4d,_0x239cb5,!![]);}catch(_0x5ac7b4){return BPromise[_0xbf83('0x23')](_0x5ac7b4);}return _0x716d4d[_0xbf83('0x24')]();};}function saveUpdates(_0xef26c5,_0x2f8186){return function(_0x470c01){if(_0x470c01){return _0x470c01[_0xbf83('0x25')](_0xef26c5)[_0xbf83('0x26')](function(_0x19b6ed){return _0x19b6ed;});}return null;};}function removeEntity(_0x45e84e,_0x12e26d){return function(_0x500db2){if(_0x500db2){return _0x500db2[_0xbf83('0x27')]()[_0xbf83('0x26')](function(){_0x45e84e[_0xbf83('0x1a')](0xcc)[_0xbf83('0x1b')]();});}};}function handleEntityNotFound(_0x1a0af5,_0x11fc26){return function(_0x342e72){if(!_0x342e72){_0x1a0af5['sendStatus'](0x194);}return _0x342e72;};}function handleError(_0x2fba3b,_0xc6eca7){_0xc6eca7=_0xc6eca7||0x1f4;return function(_0x7c34d7){logger['error'](_0x7c34d7['stack']);if(_0x7c34d7[_0xbf83('0x28')]){delete _0x7c34d7[_0xbf83('0x28')];}_0x2fba3b[_0xbf83('0x1a')](_0xc6eca7)[_0xbf83('0x29')](_0x7c34d7);};}exports[_0xbf83('0x2a')]=function(_0x31f8d3,_0x3edcc2){var _0x3a21ef={},_0x232bcc={},_0x93a38a={'count':0x0,'rows':[]};var _0x286ab0=_['map'](db[_0xbf83('0x2b')]['rawAttributes'],function(_0x4f397f){return{'name':_0x4f397f[_0xbf83('0x2c')],'type':_0x4f397f[_0xbf83('0x2d')][_0xbf83('0x2e')]};});_0x232bcc['model']=_[_0xbf83('0x2f')](_0x286ab0,_0xbf83('0x28'));_0x232bcc[_0xbf83('0x30')]=_['keys'](_0x31f8d3[_0xbf83('0x30')]);_0x232bcc[_0xbf83('0x31')]=_[_0xbf83('0x32')](_0x232bcc['model'],_0x232bcc[_0xbf83('0x30')]);_0x3a21ef['attributes']=_[_0xbf83('0x32')](_0x232bcc['model'],qs[_0xbf83('0x33')](_0x31f8d3['query'][_0xbf83('0x33')]));_0x3a21ef[_0xbf83('0x34')]=_0x3a21ef[_0xbf83('0x34')]['length']?_0x3a21ef[_0xbf83('0x34')]:_0x232bcc[_0xbf83('0x35')];if(!_0x31f8d3[_0xbf83('0x30')][_0xbf83('0x36')](_0xbf83('0x37'))){_0x3a21ef['limit']=qs[_0xbf83('0x1f')](_0x31f8d3[_0xbf83('0x30')][_0xbf83('0x1f')]);_0x3a21ef[_0xbf83('0x1d')]=qs[_0xbf83('0x1d')](_0x31f8d3[_0xbf83('0x30')][_0xbf83('0x1d')]);}_0x3a21ef[_0xbf83('0x38')]=qs[_0xbf83('0x39')](_0x31f8d3[_0xbf83('0x30')][_0xbf83('0x39')]);_0x3a21ef[_0xbf83('0x3a')]=qs[_0xbf83('0x31')](_[_0xbf83('0x3b')](_0x31f8d3[_0xbf83('0x30')],_0x232bcc[_0xbf83('0x31')]),_0x286ab0);if(_0x31f8d3[_0xbf83('0x30')][_0xbf83('0x3c')]){_0x3a21ef['where']=_[_0xbf83('0x3d')](_0x3a21ef[_0xbf83('0x3a')],{'$or':_['map'](_0x286ab0,function(_0xb567b6){if(_0xb567b6[_0xbf83('0x2d')]!==_0xbf83('0x3e')){var _0xb50523={};_0xb50523[_0xb567b6[_0xbf83('0x28')]]={'$like':'%'+_0x31f8d3[_0xbf83('0x30')][_0xbf83('0x3c')]+'%'};return _0xb50523;}})});}_0x3a21ef=_[_0xbf83('0x3d')]({},_0x3a21ef,_0x31f8d3[_0xbf83('0x3f')]);var _0x374ef4={'where':_0x3a21ef[_0xbf83('0x3a')]};return db[_0xbf83('0x2b')][_0xbf83('0x20')](_0x374ef4)['then'](function(_0x10b506){_0x93a38a[_0xbf83('0x20')]=_0x10b506;if(_0x31f8d3['query'][_0xbf83('0x40')]){_0x3a21ef[_0xbf83('0x41')]=[{'all':!![]}];}return db[_0xbf83('0x2b')][_0xbf83('0x42')](_0x3a21ef);})[_0xbf83('0x26')](function(_0x571a56){_0x93a38a[_0xbf83('0x43')]=_0x571a56;return _0x93a38a;})[_0xbf83('0x26')](respondWithFilteredResult(_0x3edcc2,_0x3a21ef))[_0xbf83('0x44')](handleError(_0x3edcc2,null));};exports[_0xbf83('0x45')]=function(_0x1f37f1,_0x1f1311){var _0x46e461={'raw':!![],'where':{'id':_0x1f37f1[_0xbf83('0x46')]['id']}},_0x1ff4e9={};_0x1ff4e9['model']=_[_0xbf83('0x47')](db[_0xbf83('0x2b')][_0xbf83('0x48')]);_0x1ff4e9[_0xbf83('0x30')]=_[_0xbf83('0x47')](_0x1f37f1[_0xbf83('0x30')]);_0x1ff4e9['filters']=_[_0xbf83('0x32')](_0x1ff4e9[_0xbf83('0x35')],_0x1ff4e9[_0xbf83('0x30')]);_0x46e461[_0xbf83('0x34')]=_['intersection'](_0x1ff4e9[_0xbf83('0x35')],qs['fields'](_0x1f37f1[_0xbf83('0x30')][_0xbf83('0x33')]));_0x46e461[_0xbf83('0x34')]=_0x46e461[_0xbf83('0x34')][_0xbf83('0x49')]?_0x46e461['attributes']:_0x1ff4e9['model'];if(_0x1f37f1[_0xbf83('0x30')][_0xbf83('0x40')]){_0x46e461[_0xbf83('0x41')]=[{'all':!![]}];}_0x46e461=_['merge']({},_0x46e461,_0x1f37f1[_0xbf83('0x3f')]);return db[_0xbf83('0x2b')][_0xbf83('0x4a')](_0x46e461)[_0xbf83('0x26')](handleEntityNotFound(_0x1f1311,null))['then'](respondWithResult(_0x1f1311,null))[_0xbf83('0x44')](handleError(_0x1f1311,null));};exports[_0xbf83('0x4b')]=function(_0x35d116,_0x5c789b){return db[_0xbf83('0x2b')]['create'](_0x35d116[_0xbf83('0x4c')],{})['then'](respondWithResult(_0x5c789b,0xc9))[_0xbf83('0x44')](handleError(_0x5c789b,null));};exports[_0xbf83('0x25')]=function(_0x80ffcf,_0x319633){if(_0x80ffcf['body']['id']){delete _0x80ffcf[_0xbf83('0x4c')]['id'];}return db[_0xbf83('0x2b')][_0xbf83('0x4a')]({'where':{'id':_0x80ffcf[_0xbf83('0x46')]['id']}})[_0xbf83('0x26')](handleEntityNotFound(_0x319633,null))[_0xbf83('0x26')](saveUpdates(_0x80ffcf[_0xbf83('0x4c')],null))[_0xbf83('0x26')](respondWithResult(_0x319633,null))['catch'](handleError(_0x319633,null));};exports[_0xbf83('0x27')]=function(_0x12baa3,_0x50fcbe){return db[_0xbf83('0x2b')][_0xbf83('0x4a')]({'where':{'id':_0x12baa3[_0xbf83('0x46')]['id']}})['then'](handleEntityNotFound(_0x50fcbe,null))[_0xbf83('0x26')](removeEntity(_0x50fcbe,null))['catch'](handleError(_0x50fcbe,null));}; \ No newline at end of file +var _0x359f=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','sendStatus','stack','send','index','VoiceQueuesLog','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x359f,0xf0));var _0xf359=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x359f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xf359('0x0'));var rimraf=require(_0xf359('0x1'));var zipdir=require(_0xf359('0x2'));var jsonpatch=require(_0xf359('0x3'));var rp=require(_0xf359('0x4'));var moment=require('moment');var BPromise=require(_0xf359('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf359('0x6'));var sox=require('sox');var csv=require(_0xf359('0x7'));var ejs=require(_0xf359('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf359('0x9'));var crypto=require(_0xf359('0xa'));var jsforce=require(_0xf359('0xb'));var deskjs=require(_0xf359('0xc'));var toCsv=require(_0xf359('0x7'));var querystring=require(_0xf359('0xd'));var Papa=require(_0xf359('0xe'));var Redis=require(_0xf359('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf359('0x10'));var as=require(_0xf359('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf359('0x12'))(_0xf359('0x13'));var utils=require('../../config/utils');var config=require(_0xf359('0x14'));var licenseUtil=require(_0xf359('0x15'));var db=require(_0xf359('0x16'))['db'];function respondWithStatusCode(_0x1552e6,_0x3916fd){_0x3916fd=_0x3916fd||0xcc;return function(_0x392503){if(_0x392503){return _0x1552e6['sendStatus'](_0x3916fd);}return _0x1552e6[_0xf359('0x17')](_0x3916fd)[_0xf359('0x18')]();};}function respondWithResult(_0x1c1691,_0x3beb70){_0x3beb70=_0x3beb70||0xc8;return function(_0xfd2e02){if(_0xfd2e02){return _0x1c1691[_0xf359('0x17')](_0x3beb70)[_0xf359('0x19')](_0xfd2e02);}};}function respondWithFilteredResult(_0x15a215,_0x5d37a1){return function(_0xc33a77){if(_0xc33a77){var _0xf0c48d=typeof _0x5d37a1['offset']===_0xf359('0x1a')&&typeof _0x5d37a1[_0xf359('0x1b')]==='undefined';var _0x36b990=_0xc33a77[_0xf359('0x1c')];var _0x17be0a=_0xf0c48d?0x0:_0x5d37a1[_0xf359('0x1d')];var _0x2b4eb6=_0xf0c48d?_0xc33a77[_0xf359('0x1c')]:_0x5d37a1[_0xf359('0x1d')]+_0x5d37a1['limit'];var _0x12aef4;if(_0x2b4eb6>=_0x36b990){_0x2b4eb6=_0x36b990;_0x12aef4=0xc8;}else{_0x12aef4=0xce;}_0x15a215[_0xf359('0x17')](_0x12aef4);return _0x15a215[_0xf359('0x1e')](_0xf359('0x1f'),_0x17be0a+'-'+_0x2b4eb6+'/'+_0x36b990)[_0xf359('0x19')](_0xc33a77);}return null;};}function patchUpdates(_0x21bf51){return function(_0x4d6997){try{jsonpatch['apply'](_0x4d6997,_0x21bf51,!![]);}catch(_0x5d4ea2){return BPromise['reject'](_0x5d4ea2);}return _0x4d6997[_0xf359('0x20')]();};}function saveUpdates(_0x18ad87,_0x478b4f){return function(_0x2f0ef8){if(_0x2f0ef8){return _0x2f0ef8[_0xf359('0x21')](_0x18ad87)[_0xf359('0x22')](function(_0x4f2178){return _0x4f2178;});}return null;};}function removeEntity(_0x5eba3c,_0x58947a){return function(_0x5be8c0){if(_0x5be8c0){return _0x5be8c0['destroy']()[_0xf359('0x22')](function(){_0x5eba3c[_0xf359('0x17')](0xcc)[_0xf359('0x18')]();});}};}function handleEntityNotFound(_0x34e706,_0x352de4){return function(_0x44d117){if(!_0x44d117){_0x34e706[_0xf359('0x23')](0x194);}return _0x44d117;};}function handleError(_0x1c28f6,_0x54d8be){_0x54d8be=_0x54d8be||0x1f4;return function(_0x1185ce){logger['error'](_0x1185ce[_0xf359('0x24')]);if(_0x1185ce['name']){delete _0x1185ce['name'];}_0x1c28f6[_0xf359('0x17')](_0x54d8be)[_0xf359('0x25')](_0x1185ce);};}exports[_0xf359('0x26')]=function(_0x90678f,_0x2f428d){var _0x1fd6e0={},_0x4ad118={},_0x51fa54={'count':0x0,'rows':[]};var _0x14cf8c=_['map'](db[_0xf359('0x27')][_0xf359('0x28')],function(_0x5e3665){return{'name':_0x5e3665['fieldName'],'type':_0x5e3665[_0xf359('0x29')][_0xf359('0x2a')]};});_0x4ad118[_0xf359('0x2b')]=_[_0xf359('0x2c')](_0x14cf8c,_0xf359('0x2d'));_0x4ad118[_0xf359('0x2e')]=_[_0xf359('0x2f')](_0x90678f[_0xf359('0x2e')]);_0x4ad118[_0xf359('0x30')]=_[_0xf359('0x31')](_0x4ad118[_0xf359('0x2b')],_0x4ad118[_0xf359('0x2e')]);_0x1fd6e0['attributes']=_[_0xf359('0x31')](_0x4ad118['model'],qs[_0xf359('0x32')](_0x90678f[_0xf359('0x2e')][_0xf359('0x32')]));_0x1fd6e0['attributes']=_0x1fd6e0[_0xf359('0x33')]['length']?_0x1fd6e0['attributes']:_0x4ad118[_0xf359('0x2b')];if(!_0x90678f['query'][_0xf359('0x34')](_0xf359('0x35'))){_0x1fd6e0[_0xf359('0x1b')]=qs['limit'](_0x90678f[_0xf359('0x2e')][_0xf359('0x1b')]);_0x1fd6e0[_0xf359('0x1d')]=qs['offset'](_0x90678f['query']['offset']);}_0x1fd6e0[_0xf359('0x36')]=qs[_0xf359('0x37')](_0x90678f[_0xf359('0x2e')][_0xf359('0x37')]);_0x1fd6e0[_0xf359('0x38')]=qs[_0xf359('0x30')](_[_0xf359('0x39')](_0x90678f[_0xf359('0x2e')],_0x4ad118['filters']),_0x14cf8c);if(_0x90678f[_0xf359('0x2e')][_0xf359('0x3a')]){_0x1fd6e0[_0xf359('0x38')]=_[_0xf359('0x3b')](_0x1fd6e0[_0xf359('0x38')],{'$or':_['map'](_0x14cf8c,function(_0x17327d){if(_0x17327d[_0xf359('0x29')]!==_0xf359('0x3c')){var _0x510f8d={};_0x510f8d[_0x17327d[_0xf359('0x2d')]]={'$like':'%'+_0x90678f[_0xf359('0x2e')][_0xf359('0x3a')]+'%'};return _0x510f8d;}})});}_0x1fd6e0=_['merge']({},_0x1fd6e0,_0x90678f[_0xf359('0x3d')]);var _0x1685d1={'where':_0x1fd6e0[_0xf359('0x38')]};return db['VoiceQueuesLog'][_0xf359('0x1c')](_0x1685d1)[_0xf359('0x22')](function(_0x2f7cec){_0x51fa54[_0xf359('0x1c')]=_0x2f7cec;if(_0x90678f['query'][_0xf359('0x3e')]){_0x1fd6e0['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xf359('0x3f')](_0x1fd6e0);})['then'](function(_0x342989){_0x51fa54[_0xf359('0x40')]=_0x342989;return _0x51fa54;})['then'](respondWithFilteredResult(_0x2f428d,_0x1fd6e0))[_0xf359('0x41')](handleError(_0x2f428d,null));};exports['show']=function(_0xe2480b,_0x102509){var _0x5d8d7c={'raw':!![],'where':{'id':_0xe2480b[_0xf359('0x42')]['id']}},_0x258a75={};_0x258a75[_0xf359('0x2b')]=_[_0xf359('0x2f')](db[_0xf359('0x27')][_0xf359('0x28')]);_0x258a75[_0xf359('0x2e')]=_[_0xf359('0x2f')](_0xe2480b['query']);_0x258a75['filters']=_[_0xf359('0x31')](_0x258a75[_0xf359('0x2b')],_0x258a75['query']);_0x5d8d7c[_0xf359('0x33')]=_[_0xf359('0x31')](_0x258a75['model'],qs[_0xf359('0x32')](_0xe2480b[_0xf359('0x2e')][_0xf359('0x32')]));_0x5d8d7c[_0xf359('0x33')]=_0x5d8d7c['attributes'][_0xf359('0x43')]?_0x5d8d7c[_0xf359('0x33')]:_0x258a75[_0xf359('0x2b')];if(_0xe2480b[_0xf359('0x2e')][_0xf359('0x3e')]){_0x5d8d7c[_0xf359('0x44')]=[{'all':!![]}];}_0x5d8d7c=_[_0xf359('0x3b')]({},_0x5d8d7c,_0xe2480b['options']);return db[_0xf359('0x27')][_0xf359('0x45')](_0x5d8d7c)[_0xf359('0x22')](handleEntityNotFound(_0x102509,null))[_0xf359('0x22')](respondWithResult(_0x102509,null))['catch'](handleError(_0x102509,null));};exports[_0xf359('0x46')]=function(_0x1673e2,_0x5842b8){return db[_0xf359('0x27')][_0xf359('0x46')](_0x1673e2[_0xf359('0x47')],{})[_0xf359('0x22')](respondWithResult(_0x5842b8,0xc9))['catch'](handleError(_0x5842b8,null));};exports[_0xf359('0x21')]=function(_0x2095c3,_0x30957a){if(_0x2095c3[_0xf359('0x47')]['id']){delete _0x2095c3[_0xf359('0x47')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x2095c3['params']['id']}})[_0xf359('0x22')](handleEntityNotFound(_0x30957a,null))[_0xf359('0x22')](saveUpdates(_0x2095c3['body'],null))[_0xf359('0x22')](respondWithResult(_0x30957a,null))[_0xf359('0x41')](handleError(_0x30957a,null));};exports[_0xf359('0x48')]=function(_0x1300b0,_0x2adc40){return db[_0xf359('0x27')][_0xf359('0x45')]({'where':{'id':_0x1300b0['params']['id']}})[_0xf359('0x22')](handleEntityNotFound(_0x2adc40,null))['then'](removeEntity(_0x2adc40,null))[_0xf359('0x41')](handleError(_0x2adc40,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 086a373..7f9eb22 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 _0xc577=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','dtm','lodash','api'];(function(_0x2f1cde,_0x2b10c6){var _0x574444=function(_0x356356){while(--_0x356356){_0x2f1cde['push'](_0x2f1cde['shift']());}};_0x574444(++_0x2b10c6);}(_0xc577,0x172));var _0x7c57=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc577[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x7c57('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7c57('0x1'));var moment=require(_0x7c57('0x2'));var BPromise=require(_0x7c57('0x3'));var rp=require(_0x7c57('0x4'));var fs=require('fs');var path=require(_0x7c57('0x5'));var rimraf=require(_0x7c57('0x6'));var config=require(_0x7c57('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x7c57('0x8')]=function(_0x1339b3,_0xf50a9f){return _0x1339b3[_0x7c57('0x9')](_0x7c57('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x7c57('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xdfbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','util','api'];(function(_0x5e3c25,_0x3e8711){var _0x4bdb0a=function(_0x1b82d1){while(--_0x1b82d1){_0x5e3c25['push'](_0x5e3c25['shift']());}};_0x4bdb0a(++_0x3e8711);}(_0xdfbe,0x1ab));var _0xedfb=function(_0x206677,_0x5d3dfb){_0x206677=_0x206677-0x0;var _0x46a858=_0xdfbe[_0x206677];return _0x46a858;};'use strict';var _=require('lodash');var util=require(_0xedfb('0x0'));var logger=require('../../config/logger')(_0xedfb('0x1'));var moment=require(_0xedfb('0x2'));var BPromise=require(_0xedfb('0x3'));var rp=require(_0xedfb('0x4'));var fs=require('fs');var path=require(_0xedfb('0x5'));var rimraf=require(_0xedfb('0x6'));var config=require(_0xedfb('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0xedfb('0x8')]=function(_0x1962cd,_0x7c3a2c){return _0x1962cd['define'](_0xedfb('0x9'),attributes,{'tableName':_0xedfb('0xa'),'paranoid':![],'indexes':[{'name':_0xedfb('0xb'),'fields':[_0xedfb('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 544d8b6..0c6357b 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 _0x0298=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x5717df,_0x145007){var _0x25c425=function(_0x5b53f4){while(--_0x5b53f4){_0x5717df['push'](_0x5717df['shift']());}};_0x25c425(++_0x145007);}(_0x0298,0x74));var _0x8029=function(_0x5316d3,_0x5cba98){_0x5316d3=_0x5316d3-0x0;var _0x27d9fa=_0x0298[_0x5316d3];return _0x27d9fa;};'use strict';var _=require(_0x8029('0x0'));var util=require(_0x8029('0x1'));var moment=require('moment');var BPromise=require(_0x8029('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8029('0x3'));var db=require(_0x8029('0x4'))['db'];var utils=require(_0x8029('0x5'));var logger=require(_0x8029('0x6'))(_0x8029('0x7'));var config=require(_0x8029('0x8'));var jayson=require(_0x8029('0x9'));var client=jayson[_0x8029('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd7497e,_0x24ddfa,_0x1ac95a){return new BPromise(function(_0xc61637,_0x29688f){return client[_0x8029('0xb')](_0xd7497e,_0x1ac95a)[_0x8029('0xc')](function(_0x5a0ddc){logger[_0x8029('0xd')](_0x8029('0xe'),_0x24ddfa,_0x8029('0xf'));logger[_0x8029('0x10')](_0x8029('0x11'),_0x24ddfa,_0x8029('0xf'),JSON[_0x8029('0x12')](_0x5a0ddc));if(_0x5a0ddc[_0x8029('0x13')]){if(_0x5a0ddc['error'][_0x8029('0x14')]===0x1f4){logger[_0x8029('0x13')](_0x8029('0xe'),_0x24ddfa,_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);return _0x29688f(_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x24ddfa,_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);return _0xc61637(_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);}else{logger['info'](_0x8029('0xe'),_0x24ddfa,_0x8029('0xf'));_0xc61637(_0x5a0ddc['result'][_0x8029('0x15')]);}})['catch'](function(_0xaa28da){logger[_0x8029('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x24ddfa,_0xaa28da);_0x29688f(_0xaa28da);});});} \ No newline at end of file +var _0x50ab=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x30ec7d,_0x349afb){var _0xe2e575=function(_0x54a94e){while(--_0x54a94e){_0x30ec7d['push'](_0x30ec7d['shift']());}};_0xe2e575(++_0x349afb);}(_0x50ab,0xf1));var _0xb50a=function(_0x464d42,_0x4f1d09){_0x464d42=_0x464d42-0x0;var _0x1483d3=_0x50ab[_0x464d42];return _0x1483d3;};'use strict';var _=require('lodash');var util=require(_0xb50a('0x0'));var moment=require(_0xb50a('0x1'));var BPromise=require(_0xb50a('0x2'));var rs=require(_0xb50a('0x3'));var fs=require('fs');var Redis=require(_0xb50a('0x4'));var db=require(_0xb50a('0x5'))['db'];var utils=require(_0xb50a('0x6'));var logger=require('../../config/logger')(_0xb50a('0x7'));var config=require(_0xb50a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb50a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x482e92,_0x51302c,_0x3a0e10){return new BPromise(function(_0x1831ae,_0x48acbb){return client[_0xb50a('0xa')](_0x482e92,_0x3a0e10)['then'](function(_0x4b6622){logger['info'](_0xb50a('0xb'),_0x51302c,_0xb50a('0xc'));logger['debug'](_0xb50a('0xd'),_0x51302c,_0xb50a('0xc'),JSON[_0xb50a('0xe')](_0x4b6622));if(_0x4b6622[_0xb50a('0xf')]){if(_0x4b6622['error'][_0xb50a('0x10')]===0x1f4){logger[_0xb50a('0xf')](_0xb50a('0xb'),_0x51302c,_0x4b6622[_0xb50a('0xf')][_0xb50a('0x11')]);return _0x48acbb(_0x4b6622[_0xb50a('0xf')][_0xb50a('0x11')]);}logger[_0xb50a('0xf')](_0xb50a('0xb'),_0x51302c,_0x4b6622['error'][_0xb50a('0x11')]);return _0x1831ae(_0x4b6622[_0xb50a('0xf')][_0xb50a('0x11')]);}else{logger[_0xb50a('0x12')](_0xb50a('0xb'),_0x51302c,'request\x20sent');_0x1831ae(_0x4b6622['result'][_0xb50a('0x11')]);}})[_0xb50a('0x13')](function(_0x1c606a){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x51302c,_0x1c606a);_0x48acbb(_0x1c606a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d3f3d4a..ea4aa4d 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 _0xf828=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x479904,_0x70604c){var _0x160af4=function(_0x56b2c5){while(--_0x56b2c5){_0x479904['push'](_0x479904['shift']());}};_0x160af4(++_0x70604c);}(_0xf828,0x12d));var _0x8f82=function(_0x2cb2f9,_0x18ccab){_0x2cb2f9=_0x2cb2f9-0x0;var _0x57fec6=_0xf828[_0x2cb2f9];return _0x57fec6;};'use strict';var multer=require(_0x8f82('0x0'));var util=require(_0x8f82('0x1'));var path=require(_0x8f82('0x2'));var timeout=require(_0x8f82('0x3'));var express=require(_0x8f82('0x4'));var router=express[_0x8f82('0x5')]();var fs_extra=require(_0x8f82('0x6'));var auth=require(_0x8f82('0x7'));var interaction=require(_0x8f82('0x8'));var config=require(_0x8f82('0x9'));var controller=require('./voiceRecording.controller');router[_0x8f82('0xa')]('/',auth['isAuthenticated'](),controller[_0x8f82('0xb')]);router['get'](_0x8f82('0xc'),auth[_0x8f82('0xd')](),controller[_0x8f82('0xe')]);router[_0x8f82('0xa')](_0x8f82('0xf'),auth[_0x8f82('0xd')](),controller[_0x8f82('0x10')]);router[_0x8f82('0xa')](_0x8f82('0x11'),auth[_0x8f82('0xd')](),controller[_0x8f82('0x12')]);router['get'](_0x8f82('0x13'),controller['downloads']);router[_0x8f82('0xa')](_0x8f82('0x14'),auth[_0x8f82('0xd')](),controller[_0x8f82('0x15')]);router[_0x8f82('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8f82('0x16')](_0x8f82('0x14'),auth['isAuthenticated'](),controller[_0x8f82('0x17')]);router['put'](_0x8f82('0xf'),auth['isAuthenticated'](),controller[_0x8f82('0x18')]);router[_0x8f82('0x19')]('/:id',auth[_0x8f82('0xd')](),controller[_0x8f82('0x1a')]);module[_0x8f82('0x1b')]=router; \ No newline at end of file +var _0xd188=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','download','/:id/downloads','downloads','/:id/transcribe','post','create','delete','destroy','exports','multer','path','express','Router'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xd188,0x1b5));var _0x8d18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd188[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8d18('0x0'));var util=require('util');var path=require(_0x8d18('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d18('0x2'));var router=express[_0x8d18('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8d18('0x4'));var config=require(_0x8d18('0x5'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x8d18('0x6')](),controller[_0x8d18('0x7')]);router[_0x8d18('0x8')](_0x8d18('0x9'),auth[_0x8d18('0x6')](),controller['describe']);router['get'](_0x8d18('0xa'),auth[_0x8d18('0x6')](),controller[_0x8d18('0xb')]);router['get']('/:id/download',auth[_0x8d18('0x6')](),controller[_0x8d18('0xc')]);router[_0x8d18('0x8')](_0x8d18('0xd'),controller[_0x8d18('0xe')]);router[_0x8d18('0x8')](_0x8d18('0xf'),auth[_0x8d18('0x6')](),controller['downloadTranscribe']);router[_0x8d18('0x10')]('/',auth[_0x8d18('0x6')](),controller[_0x8d18('0x11')]);router[_0x8d18('0x10')]('/:id/transcribe',auth[_0x8d18('0x6')](),controller['runTranscribe']);router['put']('/:id',auth[_0x8d18('0x6')](),controller['update']);router[_0x8d18('0x12')](_0x8d18('0xa'),auth['isAuthenticated'](),controller[_0x8d18('0x13')]);module[_0x8d18('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 302d566..c208431 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(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 51490e1..7969e7d 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 _0x3768=['sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','update','then','name','send','index','map','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','VoiceRecording','find','create','body','describe','catch','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','VoiceRecording\x20not\x20found','filename','extname','unlink','message','../../components/encryptor','sequelize','MD5','col','push','$and','Sequelize','ValidationError','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3768,0x1d5));var _0x8376=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x3768[_0x215dc8];return _0x583ea3;};'use strict';var emlformat=require(_0x8376('0x0'));var rimraf=require(_0x8376('0x1'));var zipdir=require(_0x8376('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8376('0x3'));var moment=require(_0x8376('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8376('0x5'));var path=require('path');var sox=require(_0x8376('0x6'));var csv=require(_0x8376('0x7'));var ejs=require(_0x8376('0x8'));var fs=require('fs');var fs_extra=require(_0x8376('0x9'));var _=require('lodash');var squel=require(_0x8376('0xa'));var crypto=require(_0x8376('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8376('0xc'));var toCsv=require(_0x8376('0x7'));var querystring=require(_0x8376('0xd'));var Papa=require('papaparse');var AWS=require(_0x8376('0xe'));var uuidv4=require(_0x8376('0xf'));var Redis=require('ioredis');var authService=require(_0x8376('0x10'));var qs=require(_0x8376('0x11'));var as=require(_0x8376('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8376('0x13'))(_0x8376('0x14'));var utils=require(_0x8376('0x15'));var config=require(_0x8376('0x16'));var licenseUtil=require(_0x8376('0x17'));var db=require(_0x8376('0x18'))['db'];function respondWithStatusCode(_0x5ee991,_0x42828c){_0x42828c=_0x42828c||0xcc;return function(_0x412dc0){if(_0x412dc0){return _0x5ee991[_0x8376('0x19')](_0x42828c);}return _0x5ee991[_0x8376('0x1a')](_0x42828c)[_0x8376('0x1b')]();};}function respondWithResult(_0x3e1ddd,_0x268d23){_0x268d23=_0x268d23||0xc8;return function(_0x24fc6c){if(_0x24fc6c){return _0x3e1ddd[_0x8376('0x1a')](_0x268d23)[_0x8376('0x1c')](_0x24fc6c);}};}function respondWithFilteredResult(_0x1e1897,_0x377951){return function(_0x1182fc){if(_0x1182fc){var _0x166194=typeof _0x377951[_0x8376('0x1d')]==='undefined'&&typeof _0x377951[_0x8376('0x1e')]==='undefined';var _0x489b8e=_0x1182fc['count'];var _0x7a66af=_0x166194?0x0:_0x377951[_0x8376('0x1d')];var _0x40e456=_0x166194?_0x1182fc[_0x8376('0x1f')]:_0x377951['offset']+_0x377951[_0x8376('0x1e')];var _0x16077b;if(_0x40e456>=_0x489b8e){_0x40e456=_0x489b8e;_0x16077b=0xc8;}else{_0x16077b=0xce;}_0x1e1897[_0x8376('0x1a')](_0x16077b);return _0x1e1897[_0x8376('0x20')]('Content-Range',_0x7a66af+'-'+_0x40e456+'/'+_0x489b8e)[_0x8376('0x1c')](_0x1182fc);}return null;};}function patchUpdates(_0x4b5f0f){return function(_0x1c0496){try{jsonpatch[_0x8376('0x21')](_0x1c0496,_0x4b5f0f,!![]);}catch(_0x5e25e8){return BPromise[_0x8376('0x22')](_0x5e25e8);}return _0x1c0496['save']();};}function saveUpdates(_0x3f8c15,_0x3811fd){return function(_0x22cd1c){if(_0x22cd1c){return _0x22cd1c[_0x8376('0x23')](_0x3f8c15)[_0x8376('0x24')](function(_0x4a5037){return _0x4a5037;});}return null;};}function removeEntity(_0x18d9d6,_0x35c699){return function(_0x1e3f45){if(_0x1e3f45){return _0x1e3f45['destroy']()[_0x8376('0x24')](function(){_0x18d9d6['status'](0xcc)[_0x8376('0x1b')]();});}};}function handleEntityNotFound(_0x1b30fb,_0x5bb617){return function(_0xceab07){if(!_0xceab07){_0x1b30fb[_0x8376('0x19')](0x194);}return _0xceab07;};}function handleError(_0x19acfc,_0x3a9e6c){_0x3a9e6c=_0x3a9e6c||0x1f4;return function(_0x17dbb5){logger['error'](_0x17dbb5['stack']);if(_0x17dbb5['name']){delete _0x17dbb5[_0x8376('0x25')];}_0x19acfc[_0x8376('0x1a')](_0x3a9e6c)[_0x8376('0x26')](_0x17dbb5);};}exports[_0x8376('0x27')]=function(_0x4c644d,_0x5bbd2b){var _0x1441f2={},_0x54fdbe={},_0x3dcee7={'count':0x0,'rows':[]};var _0x185723=_[_0x8376('0x28')](db['VoiceRecording'][_0x8376('0x29')],function(_0x1adca9){return{'name':_0x1adca9[_0x8376('0x2a')],'type':_0x1adca9[_0x8376('0x2b')][_0x8376('0x2c')]};});_0x54fdbe['model']=_[_0x8376('0x2d')](_[_0x8376('0x28')](_0x185723,_0x8376('0x25')),[_0x8376('0x2e')]);_0x54fdbe[_0x8376('0x2f')]=_[_0x8376('0x30')](_0x4c644d[_0x8376('0x2f')]);_0x54fdbe[_0x8376('0x31')]=_[_0x8376('0x32')](_0x54fdbe[_0x8376('0x33')],_0x54fdbe['query']);_0x1441f2['attributes']=_[_0x8376('0x32')](_0x54fdbe['model'],qs[_0x8376('0x34')](_0x4c644d[_0x8376('0x2f')]['fields']));_0x1441f2[_0x8376('0x35')]=_0x1441f2[_0x8376('0x35')][_0x8376('0x36')]?_0x1441f2[_0x8376('0x35')]:_0x54fdbe[_0x8376('0x33')];if(!_0x4c644d['query'][_0x8376('0x37')](_0x8376('0x38'))){_0x1441f2[_0x8376('0x1e')]=qs['limit'](_0x4c644d['query'][_0x8376('0x1e')]);_0x1441f2[_0x8376('0x1d')]=qs[_0x8376('0x1d')](_0x4c644d['query'][_0x8376('0x1d')]);}_0x1441f2['order']=qs[_0x8376('0x39')](_0x4c644d[_0x8376('0x2f')][_0x8376('0x39')]);_0x1441f2['where']=qs[_0x8376('0x31')](_[_0x8376('0x3a')](_0x4c644d[_0x8376('0x2f')],_0x54fdbe[_0x8376('0x31')]),_0x185723);if(_0x4c644d['query'][_0x8376('0x3b')]){_0x1441f2[_0x8376('0x3c')]=_[_0x8376('0x3d')](_0x1441f2[_0x8376('0x3c')],{'$or':_[_0x8376('0x28')](_0x185723,function(_0x217a1d){if(_0x217a1d[_0x8376('0x2b')]!==_0x8376('0x3e')){var _0x26e581={};_0x26e581[_0x217a1d[_0x8376('0x25')]]={'$like':'%'+_0x4c644d[_0x8376('0x2f')][_0x8376('0x3b')]+'%'};return _0x26e581;}})});}_0x1441f2=_[_0x8376('0x3d')]({},_0x1441f2,_0x4c644d[_0x8376('0x3f')]);var _0xf70ba6={'where':_0x1441f2[_0x8376('0x3c')]};return db['VoiceRecording']['count'](_0xf70ba6)[_0x8376('0x24')](function(_0x5bc563){_0x3dcee7[_0x8376('0x1f')]=_0x5bc563;if(_0x4c644d[_0x8376('0x2f')][_0x8376('0x40')]){_0x1441f2[_0x8376('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8376('0x42')](_0x1441f2);})[_0x8376('0x24')](function(_0x17c3ad){_0x3dcee7[_0x8376('0x43')]=_0x17c3ad;return _0x3dcee7;})[_0x8376('0x24')](respondWithFilteredResult(_0x5bbd2b,_0x1441f2))['catch'](handleError(_0x5bbd2b,null));};exports[_0x8376('0x44')]=function(_0x4ea9fa,_0x5bd052){var _0x35d4a8={'raw':![],'where':{'id':_0x4ea9fa[_0x8376('0x45')]['id']}},_0xfc5dfc={};_0xfc5dfc[_0x8376('0x33')]=_[_0x8376('0x30')](db[_0x8376('0x46')]['rawAttributes']);_0xfc5dfc[_0x8376('0x2f')]=_['keys'](_0x4ea9fa[_0x8376('0x2f')]);_0xfc5dfc[_0x8376('0x31')]=_[_0x8376('0x32')](_0xfc5dfc[_0x8376('0x33')],_0xfc5dfc[_0x8376('0x2f')]);_0x35d4a8['attributes']=_[_0x8376('0x32')](_0xfc5dfc['model'],qs['fields'](_0x4ea9fa[_0x8376('0x2f')][_0x8376('0x34')]));_0x35d4a8['attributes']=_0x35d4a8[_0x8376('0x35')][_0x8376('0x36')]?_0x35d4a8[_0x8376('0x35')]:_0xfc5dfc['model'];if(_0x4ea9fa[_0x8376('0x2f')][_0x8376('0x40')]){_0x35d4a8[_0x8376('0x41')]=[{'all':!![]}];}_0x35d4a8=_[_0x8376('0x3d')]({},_0x35d4a8,_0x4ea9fa['options']);return db[_0x8376('0x46')][_0x8376('0x47')](_0x35d4a8)[_0x8376('0x24')](handleEntityNotFound(_0x5bd052,null))[_0x8376('0x24')](respondWithResult(_0x5bd052,null))['catch'](handleError(_0x5bd052,null));};exports[_0x8376('0x48')]=function(_0x5a1b59,_0x185d25){return db[_0x8376('0x46')]['create'](_0x5a1b59['body'],{})[_0x8376('0x24')](respondWithResult(_0x185d25,0xc9))['catch'](handleError(_0x185d25,null));};exports['update']=function(_0x30114b,_0x539390){if(_0x30114b[_0x8376('0x49')]['id']){delete _0x30114b['body']['id'];}return db[_0x8376('0x46')][_0x8376('0x47')]({'where':{'id':_0x30114b['params']['id']}})[_0x8376('0x24')](handleEntityNotFound(_0x539390,null))[_0x8376('0x24')](saveUpdates(_0x30114b[_0x8376('0x49')],null))[_0x8376('0x24')](respondWithResult(_0x539390,null))['catch'](handleError(_0x539390,null));};exports[_0x8376('0x4a')]=function(_0x1d05d5,_0x3ff034){return db['VoiceRecording'][_0x8376('0x4a')]()['then'](respondWithResult(_0x3ff034,null))[_0x8376('0x4b')](handleError(_0x3ff034,null));};exports[_0x8376('0x4c')]=function(_0x5b767d,_0x376c4e,_0x4a600d){var _0x5ef841=require('../../components/encryptor');var _0x2d16d5=![];var _0x214756={};if(_0x5b767d[_0x8376('0x2f')]['type']&&_0x5b767d[_0x8376('0x2f')]['type']===_0x8376('0x4d')){_0x214756[_0x8376('0x4d')]=_0x5b767d[_0x8376('0x45')]['id'];}else{_0x214756['id']=_0x5b767d[_0x8376('0x45')]['id'];}return db[_0x8376('0x46')]['find']({'where':_0x214756,'attributes':['id',_0x8376('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x376c4e,null))[_0x8376('0x24')](function(_0x531597){if(_0x531597){var _0x1ae414=_0x531597[_0x8376('0x4e')];var _0x445b0a=util[_0x8376('0x2e')](_0x8376('0x4f'),_0x1ae414);if(fs[_0x8376('0x50')](_0x445b0a)){_0x2d16d5=!![];return _0x5ef841[_0x8376('0x51')](_0x445b0a,_0x1ae414,config[_0x8376('0x52')][_0x8376('0x53')])[_0x8376('0x24')](function(){return _0x531597;});}return _0x531597;}})[_0x8376('0x24')](function(_0x3f5ba5){if(_0x3f5ba5){var _0x1949c2=_0x3f5ba5[_0x8376('0x4e')];if(!fs[_0x8376('0x50')](_0x1949c2)){throw new db['Sequelize']['ValidationError'](_0x8376('0x54'));}if(_0x3f5ba5[_0x8376('0x55')]){return _0x376c4e['download'](_0x1949c2,_0x3f5ba5[_0x8376('0x55')]+path[_0x8376('0x56')](_0x1949c2),function(){if(_0x2d16d5){fs[_0x8376('0x57')](_0x1949c2);}});}else{return _0x376c4e['download'](_0x1949c2,function(_0x3ad11b){if(_0x2d16d5){fs['unlink'](_0x1949c2);}});}}})[_0x8376('0x4b')](function(_0x8e202f){if(_0x8e202f[_0x8376('0x58')]===_0x8376('0x54')){_0x376c4e[_0x8376('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x376c4e,null);}});};exports['downloads']=function(_0x83a809,_0xb1064e,_0x175ef5){var _0x1802e7=require(_0x8376('0x59'));var _0x1f2f4c=![];var _0x4e9589={'$and':[db[_0x8376('0x5a')][_0x8376('0x3c')](db[_0x8376('0x5a')]['fn'](_0x8376('0x5b'),db[_0x8376('0x5a')][_0x8376('0x5c')]('uniqueid')),_0x83a809[_0x8376('0x2f')]['token'])]};if(_0x83a809[_0x8376('0x2f')]['type']&&_0x83a809[_0x8376('0x2f')][_0x8376('0x2b')]===_0x8376('0x4d')){_0x4e9589['$and'][_0x8376('0x5d')]({'uniqueid':_0x83a809[_0x8376('0x45')]['id']});}else{_0x4e9589[_0x8376('0x5e')][_0x8376('0x5d')]({'id':_0x83a809[_0x8376('0x45')]['id']});}return db['VoiceRecording'][_0x8376('0x47')]({'where':_0x4e9589,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0xb1064e,null))[_0x8376('0x24')](function(_0x212fe2){if(_0x212fe2){var _0x3fcc5f=util['format'](_0x8376('0x4f'),_0x212fe2['value']);if(fs['existsSync'](_0x3fcc5f)){_0x1f2f4c=!![];return _0x1802e7[_0x8376('0x51')](_0x3fcc5f,_0x212fe2[_0x8376('0x4e')],config[_0x8376('0x52')]['recording'])['then'](function(){return _0x212fe2;});}return _0x212fe2;}})[_0x8376('0x24')](function(_0x41ee81){if(_0x41ee81){if(!fs[_0x8376('0x50')](_0x41ee81[_0x8376('0x4e')])){throw new db[(_0x8376('0x5f'))][(_0x8376('0x60'))](_0x8376('0x54'));}if(_0x41ee81['filename']){return _0xb1064e[_0x8376('0x4c')](_0x41ee81['value'],_0x41ee81[_0x8376('0x55')]+path[_0x8376('0x56')](_0x41ee81[_0x8376('0x4e')]),function(){if(_0x1f2f4c){fs[_0x8376('0x57')](_0x41ee81[_0x8376('0x4e')]);}});}else{return _0xb1064e['download'](_0x41ee81[_0x8376('0x4e')],function(_0x297b2e){if(_0x1f2f4c){fs['unlink'](_0x41ee81[_0x8376('0x4e')]);}});}}})[_0x8376('0x4b')](handleError(_0xb1064e,null));};exports[_0x8376('0x61')]=function(_0x5e3012,_0x17aef8){return db['VoiceRecording']['find']({'where':{'id':_0x5e3012['params']['id']}})['then'](function(_0x598ec7){if(_[_0x8376('0x62')](_0x598ec7)){throw new ReferenceError(_0x8376('0x63'));}return _0x598ec7;})[_0x8376('0x24')](function(_0x35e5b4){var _0x34d1d8=_0x35e5b4[_0x8376('0x4e')];logger[_0x8376('0x64')](_0x8376('0x65'),_0x34d1d8);if(!_['isNil'](_0x35e5b4[_0x8376('0x4e')])&&fs[_0x8376('0x50')](_0x34d1d8)){logger[_0x8376('0x64')](_0x8376('0x66')+_0x34d1d8+_0x8376('0x67'));fs[_0x8376('0x68')](_0x34d1d8);}_0x34d1d8=_0x34d1d8+_0x8376('0x69');if(!_[_0x8376('0x62')](_0x35e5b4[_0x8376('0x4e')])&&fs[_0x8376('0x50')](_0x34d1d8)){logger[_0x8376('0x64')]('File:\x20\x22'+_0x34d1d8+_0x8376('0x67'));fs[_0x8376('0x68')](_0x34d1d8);}return _0x35e5b4;})['then'](function(_0xe0af69){if(!_0xe0af69)throw new InternalError();return _0xe0af69[_0x8376('0x61')]();})['then'](function(){_0x17aef8['status'](0xcc)[_0x8376('0x1b')]();})[_0x8376('0x4b')](handleError(_0x17aef8,null));};function getBucketslist(_0x3aede2,_0x413b32,_0xead1a1){return new Promise(function(_0x559d74,_0xcd6f8e){var _0x40bd7d=new AWS['S3']({'accessKeyId':_0x413b32,'secretAccessKey':_0x3aede2,'region':_0xead1a1});_0x40bd7d[_0x8376('0x6a')]({},function(_0x2c1596,_0x51de2e){if(_0x2c1596){return _0xcd6f8e(_0x2c1596);}else{return _0x559d74(_0x51de2e);}});});}function createBucket(_0x2d53c4,_0x1b9dc0,_0xf9dfbe,_0x53a3b4){return new Promise(function(_0xeff9a5,_0x309945){var _0x17485e=new AWS['S3']({'accessKeyId':_0x1b9dc0,'secretAccessKey':_0x2d53c4,'region':_0xf9dfbe});_0x17485e['createBucket']({'Bucket':_0x53a3b4},function(_0x3311b8,_0x97adf1){if(_0x3311b8){return _0x309945(_0x3311b8);}else{return _0xeff9a5(_0x97adf1);}});});}function uploadFile(_0x4c2143,_0xf5aa89,_0x328546,_0x2c4bb4,_0x3987ee,_0x1a0de9){return new Promise(function(_0x931efb,_0x248ba4){var _0x41fc2e=new AWS['S3']({'accessKeyId':_0xf5aa89,'secretAccessKey':_0x4c2143,'region':_0x328546});_0x41fc2e[_0x8376('0x6b')]({'Bucket':_0x2c4bb4,'Key':_0x3987ee,'Body':_0x1a0de9},function(_0x50b350,_0xdec1f1){if(_0x50b350){return _0x248ba4(_0x50b350);}else{return _0x931efb(_0xdec1f1);}});});}function startTranscribe(_0x553071,_0x1312b3,_0x5a9ee9,_0x268174,_0x250b89,_0x35b04f){return new Promise(function(_0x33ffd4,_0x43fdc2){var _0x4f017b=new AWS['TranscribeService']({'accessKeyId':_0x1312b3,'secretAccessKey':_0x553071,'region':_0x5a9ee9});_0x4f017b[_0x8376('0x6c')]({'TranscriptionJobName':_0x268174,'LanguageCode':_0x250b89,'Media':{'MediaFileUri':_0x35b04f}},function(_0x18b4b4,_0x5cccc2){if(_0x18b4b4){return _0x43fdc2(_0x18b4b4);}else{return _0x33ffd4(_0x5cccc2);}});});}function transcribe(_0x55d0bb,_0x4081c6,_0x11e7f4,_0x4b2021,_0xfe68e6,_0x555ab3,_0x1d8db4){return new Promise(function(_0x57cd97,_0x1348cc){var _0x14beae={};logger['info'](util[_0x8376('0x2e')](_0x8376('0x6d'),_0x55d0bb,_0xfe68e6));return uploadFile(_0x4081c6,_0x11e7f4,_0x4b2021,_0xfe68e6,path[_0x8376('0x6e')](_0x555ab3),fs[_0x8376('0x6f')](_0x555ab3))['then'](function(_0x340cba){logger[_0x8376('0x64')](util[_0x8376('0x2e')](_0x8376('0x70'),_0x55d0bb,_0xfe68e6,_0x340cba[_0x8376('0x71')]));_0x14beae[_0x8376('0x72')]=_0x340cba[_0x8376('0x73')];_0x14beae['location']=_0x340cba[_0x8376('0x71')];logger[_0x8376('0x64')](util[_0x8376('0x2e')](_0x8376('0x74'),_0x55d0bb));return startTranscribe(_0x4081c6,_0x11e7f4,_0x4b2021,uuidv4(),_0x1d8db4,_0x340cba[_0x8376('0x71')]);})[_0x8376('0x24')](function(_0x1e81be){logger[_0x8376('0x64')](util[_0x8376('0x2e')](_0x8376('0x75'),_0x55d0bb,_0x1e81be[_0x8376('0x76')][_0x8376('0x77')]));_0x14beae['transcribeName']=_0x1e81be[_0x8376('0x76')][_0x8376('0x77')];_0x14beae[_0x8376('0x78')]=_0x1e81be['TranscriptionJob']['TranscriptionJobStatus'];return _0x57cd97(_0x14beae);})['catch'](function(_0x7653c5){return _0x1348cc(_0x7653c5);});});}exports[_0x8376('0x79')]=function(_0x1c8be5,_0x3388d0,_0x550e04){var _0x3071ea;var _0x92abc5;var _0x1134e6;var _0x297a2c=require(_0x8376('0x59'));return db['VoiceRecording'][_0x8376('0x7a')]({'where':{'id':_0x1c8be5['params']['id']}})[_0x8376('0x24')](function(_0x3fb1d7){if(_0x3fb1d7){var _0xb0ff76=util[_0x8376('0x2e')](_0x8376('0x4f'),_0x3fb1d7['value']);if(fs[_0x8376('0x50')](_0xb0ff76)){cypher=!![];return _0x297a2c['decryptFile'](_0xb0ff76,_0x3fb1d7['value'],config[_0x8376('0x52')][_0x8376('0x53')])['then'](function(){return _0x3fb1d7;});}return _0x3fb1d7;}})[_0x8376('0x24')](function(_0x49068d){if(!_0x49068d){throw new db[(_0x8376('0x5f'))][(_0x8376('0x60'))]('Voice\x20Recording\x20not\x20found');}_0x92abc5=_0x49068d;return db['Setting'][_0x8376('0x7a')]({'where':{'id':0x1}});})[_0x8376('0x24')](handleEntityNotFound(_0x3388d0,null))['then'](function(_0x5acf9c){if(_0x5acf9c){_0x3071ea=_0x5acf9c;if(!_0x3071ea[_0x8376('0x7b')]||!_0x3071ea[_0x8376('0x7c')]||!_0x3071ea[_0x8376('0x7d')]||!_0x3071ea[_0x8376('0x7e')]||!_0x3071ea['bucket']){throw new db[(_0x8376('0x5f'))][(_0x8376('0x60'))](_0x8376('0x7f'));}if(_0x1c8be5[_0x8376('0x49')][_0x8376('0x80')]&&(!_0x3071ea[_0x8376('0x81')]||!_0x3071ea[_0x8376('0x82')]||!_0x3071ea[_0x8376('0x83')]||!_0x3071ea[_0x8376('0x7e')]||!_0x3071ea[_0x8376('0x72')])){throw new db[(_0x8376('0x5f'))][(_0x8376('0x60'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x8376('0x84')]['findOne']({'where':{'id':_0x3071ea['transcribeAccountId']}});}})[_0x8376('0x24')](function(_0x3d54c3){if(!_0x3d54c3){throw new db['Sequelize'][(_0x8376('0x60'))](_0x8376('0x85'));}if(!_0x3d54c3[_0x8376('0x86')]||!_0x3d54c3[_0x8376('0x87')]){throw new db['Sequelize'][(_0x8376('0x60'))](_0x8376('0x88'));}_0x1134e6=_0x3d54c3;return getBucketslist(_0x1134e6['data1'],_0x1134e6['data2'],_0x3071ea[_0x8376('0x7d')]);})['then'](function(_0x3d3ff7){if(_0x3d3ff7&&_0x3d3ff7[_0x8376('0x89')]){var _0x23b726=_[_0x8376('0x47')](_0x3d3ff7['Buckets'],function(_0xed0e6c){return _0xed0e6c['Name']===_0x3071ea[_0x8376('0x72')];});if(!_0x23b726){logger[_0x8376('0x64')](util[_0x8376('0x2e')](_0x8376('0x8a'),_0x1c8be5[_0x8376('0x45')]['id'],_0x3071ea[_0x8376('0x72')]));return createBucket(_0x1134e6[_0x8376('0x86')],_0x1134e6['data2'],_0x3071ea[_0x8376('0x7d')],_0x3071ea['bucket']);}logger[_0x8376('0x64')](util[_0x8376('0x2e')](_0x8376('0x8b'),_0x1c8be5['params']['id'],_0x3071ea[_0x8376('0x72')]));return;}})[_0x8376('0x24')](function(_0x5a9080){if(_0x92abc5['transcribeStatus']===_0x8376('0x8c')){return transcribe(_0x1c8be5[_0x8376('0x45')]['id'],_0x1134e6[_0x8376('0x86')],_0x1134e6[_0x8376('0x87')],_0x3071ea[_0x8376('0x7d')],_0x3071ea[_0x8376('0x72')],_0x92abc5['value'],_0x3071ea[_0x8376('0x7e')]);}else{logger[_0x8376('0x64')](util[_0x8376('0x2e')](_0x8376('0x8d'),_0x1c8be5[_0x8376('0x45')]['id']));return{'transcribeStatus':_0x8376('0x8e')};}})['then'](function(_0x368655){if(_0x368655){_0x368655[_0x8376('0x8f')]=_0x1c8be5[_0x8376('0x49')][_0x8376('0x80')];return _0x92abc5[_0x8376('0x90')](_0x368655);}})[_0x8376('0x24')](respondWithResult(_0x3388d0,null))[_0x8376('0x4b')](handleError(_0x3388d0,null));};function writeFile(_0x364ba2,_0x10631a){return new Promise(function(_0x286c84,_0x585bfe){fs['writeFile'](_0x10631a,_0x364ba2,function(_0xbf11ad,_0x477dff){if(_0xbf11ad){return _0x585bfe(_0xbf11ad);}else{return _0x286c84(_0x477dff);}});});}exports[_0x8376('0x91')]=function(_0x4acfa5,_0x3c16bf,_0x440d3d){return db[_0x8376('0x46')][_0x8376('0x7a')]({'where':{'id':_0x4acfa5[_0x8376('0x45')]['id']}})[_0x8376('0x24')](handleEntityNotFound(_0x3c16bf))[_0x8376('0x24')](function(_0x12c44f){if(_0x12c44f&&_0x12c44f['fileText']){var _0x589e6a=_0x12c44f[_0x8376('0x92')];var _0x114d0c=config[_0x8376('0x93')]+'/server/files/transcribes/transcribe_'+_0x12c44f['id']+_0x8376('0x94');if(fs['existsSync'](_0x114d0c)){return _0x114d0c;}return writeFile(_0x589e6a,_0x114d0c)[_0x8376('0x24')](function(){return _0x114d0c;});}else{throw new db[(_0x8376('0x5f'))]['ValidationError'](_0x8376('0x95'));}})[_0x8376('0x24')](function(_0x2059b2){return _0x3c16bf[_0x8376('0x4c')](_0x2059b2);})[_0x8376('0x4b')](handleError(_0x3c16bf));}; \ No newline at end of file +var _0xb001=['TranscriptionJob','transcribeStatus','findOne','Voice\x20Recording\x20not\x20found','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','key','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','VoiceRecording','includeAll','include','findAll','catch','params','keys','options','find','create','body','update','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token','$and','push','existsSync','recording','ValidationError','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','listBuckets','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0xb001,0x14b));var _0x1b00=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb001[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b00('0x0'));var zipdir=require(_0x1b00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b00('0x2'));var moment=require(_0x1b00('0x3'));var BPromise=require(_0x1b00('0x4'));var Mustache=require(_0x1b00('0x5'));var util=require(_0x1b00('0x6'));var path=require(_0x1b00('0x7'));var sox=require('sox');var csv=require(_0x1b00('0x8'));var ejs=require(_0x1b00('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b00('0xa'));var squel=require(_0x1b00('0xb'));var crypto=require(_0x1b00('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1b00('0xd'));var toCsv=require(_0x1b00('0x8'));var querystring=require(_0x1b00('0xe'));var Papa=require(_0x1b00('0xf'));var AWS=require('aws-sdk');var uuidv4=require(_0x1b00('0x10'));var Redis=require(_0x1b00('0x11'));var authService=require(_0x1b00('0x12'));var qs=require(_0x1b00('0x13'));var as=require(_0x1b00('0x14'));var hardwareService=require(_0x1b00('0x15'));var logger=require('../../config/logger')(_0x1b00('0x16'));var utils=require(_0x1b00('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1b00('0x18'));var db=require(_0x1b00('0x19'))['db'];function respondWithStatusCode(_0x6d281,_0x3351b5){_0x3351b5=_0x3351b5||0xcc;return function(_0x5d13b5){if(_0x5d13b5){return _0x6d281['sendStatus'](_0x3351b5);}return _0x6d281[_0x1b00('0x1a')](_0x3351b5)[_0x1b00('0x1b')]();};}function respondWithResult(_0x124193,_0x3ab258){_0x3ab258=_0x3ab258||0xc8;return function(_0x29f649){if(_0x29f649){return _0x124193[_0x1b00('0x1a')](_0x3ab258)[_0x1b00('0x1c')](_0x29f649);}};}function respondWithFilteredResult(_0x46a4bd,_0x1c63d7){return function(_0x3a0e06){if(_0x3a0e06){var _0x2e5488=typeof _0x1c63d7[_0x1b00('0x1d')]===_0x1b00('0x1e')&&typeof _0x1c63d7['limit']==='undefined';var _0x4abc76=_0x3a0e06[_0x1b00('0x1f')];var _0x3b3f40=_0x2e5488?0x0:_0x1c63d7[_0x1b00('0x1d')];var _0x27b541=_0x2e5488?_0x3a0e06['count']:_0x1c63d7[_0x1b00('0x1d')]+_0x1c63d7[_0x1b00('0x20')];var _0x1a01ae;if(_0x27b541>=_0x4abc76){_0x27b541=_0x4abc76;_0x1a01ae=0xc8;}else{_0x1a01ae=0xce;}_0x46a4bd[_0x1b00('0x1a')](_0x1a01ae);return _0x46a4bd[_0x1b00('0x21')](_0x1b00('0x22'),_0x3b3f40+'-'+_0x27b541+'/'+_0x4abc76)[_0x1b00('0x1c')](_0x3a0e06);}return null;};}function patchUpdates(_0x3d2b9){return function(_0xf5443e){try{jsonpatch[_0x1b00('0x23')](_0xf5443e,_0x3d2b9,!![]);}catch(_0xad2b58){return BPromise[_0x1b00('0x24')](_0xad2b58);}return _0xf5443e[_0x1b00('0x25')]();};}function saveUpdates(_0x5a5c0d,_0x258aa2){return function(_0x1da7eb){if(_0x1da7eb){return _0x1da7eb['update'](_0x5a5c0d)[_0x1b00('0x26')](function(_0x265d42){return _0x265d42;});}return null;};}function removeEntity(_0x2f7a66,_0x2bec7a){return function(_0x572a96){if(_0x572a96){return _0x572a96['destroy']()[_0x1b00('0x26')](function(){_0x2f7a66[_0x1b00('0x1a')](0xcc)[_0x1b00('0x1b')]();});}};}function handleEntityNotFound(_0x43120e,_0x2f2af8){return function(_0x52e0c9){if(!_0x52e0c9){_0x43120e['sendStatus'](0x194);}return _0x52e0c9;};}function handleError(_0x5b4caa,_0x631650){_0x631650=_0x631650||0x1f4;return function(_0x3b97da){logger[_0x1b00('0x27')](_0x3b97da[_0x1b00('0x28')]);if(_0x3b97da[_0x1b00('0x29')]){delete _0x3b97da['name'];}_0x5b4caa['status'](_0x631650)[_0x1b00('0x2a')](_0x3b97da);};}exports['index']=function(_0x50e4c7,_0x2b7953){var _0x4d77b6={},_0x2987e9={},_0x492da9={'count':0x0,'rows':[]};var _0x48b5b2=_[_0x1b00('0x2b')](db['VoiceRecording']['rawAttributes'],function(_0x4eab6a){return{'name':_0x4eab6a['fieldName'],'type':_0x4eab6a['type'][_0x1b00('0x2c')]};});_0x2987e9[_0x1b00('0x2d')]=_[_0x1b00('0x2e')](_['map'](_0x48b5b2,'name'),[_0x1b00('0x2f')]);_0x2987e9['query']=_['keys'](_0x50e4c7[_0x1b00('0x30')]);_0x2987e9[_0x1b00('0x31')]=_[_0x1b00('0x32')](_0x2987e9[_0x1b00('0x2d')],_0x2987e9['query']);_0x4d77b6[_0x1b00('0x33')]=_[_0x1b00('0x32')](_0x2987e9['model'],qs[_0x1b00('0x34')](_0x50e4c7[_0x1b00('0x30')][_0x1b00('0x34')]));_0x4d77b6['attributes']=_0x4d77b6[_0x1b00('0x33')][_0x1b00('0x35')]?_0x4d77b6[_0x1b00('0x33')]:_0x2987e9[_0x1b00('0x2d')];if(!_0x50e4c7[_0x1b00('0x30')][_0x1b00('0x36')](_0x1b00('0x37'))){_0x4d77b6[_0x1b00('0x20')]=qs['limit'](_0x50e4c7[_0x1b00('0x30')][_0x1b00('0x20')]);_0x4d77b6[_0x1b00('0x1d')]=qs[_0x1b00('0x1d')](_0x50e4c7[_0x1b00('0x30')][_0x1b00('0x1d')]);}_0x4d77b6[_0x1b00('0x38')]=qs[_0x1b00('0x39')](_0x50e4c7[_0x1b00('0x30')][_0x1b00('0x39')]);_0x4d77b6['where']=qs[_0x1b00('0x31')](_[_0x1b00('0x3a')](_0x50e4c7['query'],_0x2987e9[_0x1b00('0x31')]),_0x48b5b2);if(_0x50e4c7[_0x1b00('0x30')][_0x1b00('0x3b')]){_0x4d77b6[_0x1b00('0x3c')]=_['merge'](_0x4d77b6[_0x1b00('0x3c')],{'$or':_[_0x1b00('0x2b')](_0x48b5b2,function(_0x15bbd8){if(_0x15bbd8[_0x1b00('0x3d')]!==_0x1b00('0x3e')){var _0x51daa5={};_0x51daa5[_0x15bbd8[_0x1b00('0x29')]]={'$like':'%'+_0x50e4c7[_0x1b00('0x30')][_0x1b00('0x3b')]+'%'};return _0x51daa5;}})});}_0x4d77b6=_['merge']({},_0x4d77b6,_0x50e4c7['options']);var _0x10f088={'where':_0x4d77b6[_0x1b00('0x3c')]};return db[_0x1b00('0x3f')][_0x1b00('0x1f')](_0x10f088)[_0x1b00('0x26')](function(_0xc9e1a0){_0x492da9[_0x1b00('0x1f')]=_0xc9e1a0;if(_0x50e4c7['query'][_0x1b00('0x40')]){_0x4d77b6[_0x1b00('0x41')]=[{'all':!![]}];}return db[_0x1b00('0x3f')][_0x1b00('0x42')](_0x4d77b6);})[_0x1b00('0x26')](function(_0x49e7b7){_0x492da9['rows']=_0x49e7b7;return _0x492da9;})[_0x1b00('0x26')](respondWithFilteredResult(_0x2b7953,_0x4d77b6))[_0x1b00('0x43')](handleError(_0x2b7953,null));};exports['show']=function(_0x1a5113,_0x273129){var _0x1b8dd1={'raw':![],'where':{'id':_0x1a5113[_0x1b00('0x44')]['id']}},_0x1c6a75={};_0x1c6a75[_0x1b00('0x2d')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x1c6a75['query']=_[_0x1b00('0x45')](_0x1a5113[_0x1b00('0x30')]);_0x1c6a75['filters']=_[_0x1b00('0x32')](_0x1c6a75[_0x1b00('0x2d')],_0x1c6a75[_0x1b00('0x30')]);_0x1b8dd1[_0x1b00('0x33')]=_['intersection'](_0x1c6a75[_0x1b00('0x2d')],qs[_0x1b00('0x34')](_0x1a5113[_0x1b00('0x30')][_0x1b00('0x34')]));_0x1b8dd1[_0x1b00('0x33')]=_0x1b8dd1['attributes'][_0x1b00('0x35')]?_0x1b8dd1[_0x1b00('0x33')]:_0x1c6a75['model'];if(_0x1a5113[_0x1b00('0x30')][_0x1b00('0x40')]){_0x1b8dd1['include']=[{'all':!![]}];}_0x1b8dd1=_['merge']({},_0x1b8dd1,_0x1a5113[_0x1b00('0x46')]);return db[_0x1b00('0x3f')][_0x1b00('0x47')](_0x1b8dd1)[_0x1b00('0x26')](handleEntityNotFound(_0x273129,null))['then'](respondWithResult(_0x273129,null))['catch'](handleError(_0x273129,null));};exports[_0x1b00('0x48')]=function(_0xcda57b,_0xfb1591){return db['VoiceRecording']['create'](_0xcda57b[_0x1b00('0x49')],{})[_0x1b00('0x26')](respondWithResult(_0xfb1591,0xc9))[_0x1b00('0x43')](handleError(_0xfb1591,null));};exports[_0x1b00('0x4a')]=function(_0x12e91b,_0x5d564a){if(_0x12e91b['body']['id']){delete _0x12e91b['body']['id'];}return db[_0x1b00('0x3f')][_0x1b00('0x47')]({'where':{'id':_0x12e91b['params']['id']}})[_0x1b00('0x26')](handleEntityNotFound(_0x5d564a,null))[_0x1b00('0x26')](saveUpdates(_0x12e91b[_0x1b00('0x49')],null))[_0x1b00('0x26')](respondWithResult(_0x5d564a,null))[_0x1b00('0x43')](handleError(_0x5d564a,null));};exports[_0x1b00('0x4b')]=function(_0x1dd0ff,_0x57f2a7){return db['VoiceRecording'][_0x1b00('0x4b')]()['then'](respondWithResult(_0x57f2a7,null))[_0x1b00('0x43')](handleError(_0x57f2a7,null));};exports[_0x1b00('0x4c')]=function(_0x5e7ee2,_0x36e196,_0x3adb72){var _0x372a9e=require(_0x1b00('0x4d'));var _0x4a0b3c=![];var _0x43bdad={};if(_0x5e7ee2[_0x1b00('0x30')][_0x1b00('0x3d')]&&_0x5e7ee2[_0x1b00('0x30')]['type']===_0x1b00('0x4e')){_0x43bdad[_0x1b00('0x4e')]=_0x5e7ee2[_0x1b00('0x44')]['id'];}else{_0x43bdad['id']=_0x5e7ee2[_0x1b00('0x44')]['id'];}return db[_0x1b00('0x3f')][_0x1b00('0x47')]({'where':_0x43bdad,'attributes':['id','value'],'raw':!![]})[_0x1b00('0x26')](handleEntityNotFound(_0x36e196,null))['then'](function(_0x4c51a8){if(_0x4c51a8){var _0x67c1fb=_0x4c51a8[_0x1b00('0x4f')];var _0x2a034e=util[_0x1b00('0x2f')](_0x1b00('0x50'),_0x67c1fb);if(fs['existsSync'](_0x2a034e)){_0x4a0b3c=!![];return _0x372a9e[_0x1b00('0x51')](_0x2a034e,_0x67c1fb,config[_0x1b00('0x52')]['recording'])['then'](function(){return _0x4c51a8;});}return _0x4c51a8;}})[_0x1b00('0x26')](function(_0x5c72ed){if(_0x5c72ed){var _0x1c587a=_0x5c72ed['value'];if(!fs['existsSync'](_0x1c587a)){throw new db[(_0x1b00('0x53'))]['ValidationError'](_0x1b00('0x54'));}if(_0x5c72ed[_0x1b00('0x55')]){return _0x36e196[_0x1b00('0x4c')](_0x1c587a,_0x5c72ed[_0x1b00('0x55')]+path[_0x1b00('0x56')](_0x1c587a),function(){if(_0x4a0b3c){fs[_0x1b00('0x57')](_0x1c587a);}});}else{return _0x36e196[_0x1b00('0x4c')](_0x1c587a,function(_0x1927ef){if(_0x4a0b3c){fs[_0x1b00('0x57')](_0x1c587a);}});}}})[_0x1b00('0x43')](function(_0x59fccd){if(_0x59fccd[_0x1b00('0x58')]==='VoiceRecording\x20not\x20found'){_0x36e196[_0x1b00('0x1a')](0x194)[_0x1b00('0x2a')]('Not\x20found');}else{return handleError(_0x36e196,null);}});};exports[_0x1b00('0x59')]=function(_0x36fc88,_0x166cdb,_0x448095){var _0x2e8e37=require(_0x1b00('0x4d'));var _0x54a0e9=![];var _0x39d608={'$and':[db[_0x1b00('0x5a')][_0x1b00('0x3c')](db['sequelize']['fn'](_0x1b00('0x5b'),db['sequelize'][_0x1b00('0x5c')](_0x1b00('0x4e'))),_0x36fc88['query'][_0x1b00('0x5d')])]};if(_0x36fc88['query'][_0x1b00('0x3d')]&&_0x36fc88['query'][_0x1b00('0x3d')]===_0x1b00('0x4e')){_0x39d608[_0x1b00('0x5e')][_0x1b00('0x5f')]({'uniqueid':_0x36fc88['params']['id']});}else{_0x39d608[_0x1b00('0x5e')][_0x1b00('0x5f')]({'id':_0x36fc88[_0x1b00('0x44')]['id']});}return db[_0x1b00('0x3f')]['find']({'where':_0x39d608,'attributes':['id',_0x1b00('0x4f')],'raw':!![]})[_0x1b00('0x26')](handleEntityNotFound(_0x166cdb,null))['then'](function(_0x58cb9f){if(_0x58cb9f){var _0x28a846=util[_0x1b00('0x2f')](_0x1b00('0x50'),_0x58cb9f['value']);if(fs[_0x1b00('0x60')](_0x28a846)){_0x54a0e9=!![];return _0x2e8e37['decryptFile'](_0x28a846,_0x58cb9f[_0x1b00('0x4f')],config[_0x1b00('0x52')][_0x1b00('0x61')])[_0x1b00('0x26')](function(){return _0x58cb9f;});}return _0x58cb9f;}})[_0x1b00('0x26')](function(_0x2260ec){if(_0x2260ec){if(!fs['existsSync'](_0x2260ec[_0x1b00('0x4f')])){throw new db[(_0x1b00('0x53'))][(_0x1b00('0x62'))](_0x1b00('0x54'));}if(_0x2260ec[_0x1b00('0x55')]){return _0x166cdb[_0x1b00('0x4c')](_0x2260ec['value'],_0x2260ec[_0x1b00('0x55')]+path[_0x1b00('0x56')](_0x2260ec[_0x1b00('0x4f')]),function(){if(_0x54a0e9){fs[_0x1b00('0x57')](_0x2260ec['value']);}});}else{return _0x166cdb[_0x1b00('0x4c')](_0x2260ec[_0x1b00('0x4f')],function(_0x5d53a4){if(_0x54a0e9){fs[_0x1b00('0x57')](_0x2260ec['value']);}});}}})[_0x1b00('0x43')](handleError(_0x166cdb,null));};exports[_0x1b00('0x63')]=function(_0x296eaf,_0x53f931){return db['VoiceRecording'][_0x1b00('0x47')]({'where':{'id':_0x296eaf[_0x1b00('0x44')]['id']}})[_0x1b00('0x26')](function(_0x38ba85){if(_[_0x1b00('0x64')](_0x38ba85)){throw new ReferenceError(_0x1b00('0x65'));}return _0x38ba85;})[_0x1b00('0x26')](function(_0x237302){var _0x950fdb=_0x237302['value'];logger[_0x1b00('0x66')](_0x1b00('0x67'),_0x950fdb);if(!_[_0x1b00('0x64')](_0x237302[_0x1b00('0x4f')])&&fs['existsSync'](_0x950fdb)){logger['info'](_0x1b00('0x68')+_0x950fdb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x950fdb);}_0x950fdb=_0x950fdb+_0x1b00('0x69');if(!_['isNil'](_0x237302[_0x1b00('0x4f')])&&fs['existsSync'](_0x950fdb)){logger[_0x1b00('0x66')](_0x1b00('0x68')+_0x950fdb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x950fdb);}return _0x237302;})['then'](function(_0x24aecf){if(!_0x24aecf)throw new InternalError();return _0x24aecf[_0x1b00('0x63')]();})[_0x1b00('0x26')](function(){_0x53f931[_0x1b00('0x1a')](0xcc)['end']();})['catch'](handleError(_0x53f931,null));};function getBucketslist(_0x290740,_0x53e2cf,_0x413fdf){return new Promise(function(_0x3c054d,_0x1ad1c9){var _0x409c9b=new AWS['S3']({'accessKeyId':_0x53e2cf,'secretAccessKey':_0x290740,'region':_0x413fdf});_0x409c9b[_0x1b00('0x6a')]({},function(_0x291164,_0x494f6e){if(_0x291164){return _0x1ad1c9(_0x291164);}else{return _0x3c054d(_0x494f6e);}});});}function createBucket(_0x5363fa,_0x256097,_0xad9d06,_0x3a5543){return new Promise(function(_0x263381,_0x1a3fd6){var _0x30a1c6=new AWS['S3']({'accessKeyId':_0x256097,'secretAccessKey':_0x5363fa,'region':_0xad9d06});_0x30a1c6['createBucket']({'Bucket':_0x3a5543},function(_0x39029c,_0x4f4440){if(_0x39029c){return _0x1a3fd6(_0x39029c);}else{return _0x263381(_0x4f4440);}});});}function uploadFile(_0x3349c1,_0x168e77,_0x517804,_0x3549d5,_0x470aaf,_0x5841cf){return new Promise(function(_0x55a87d,_0x1bbafd){var _0x226178=new AWS['S3']({'accessKeyId':_0x168e77,'secretAccessKey':_0x3349c1,'region':_0x517804});_0x226178[_0x1b00('0x6b')]({'Bucket':_0x3549d5,'Key':_0x470aaf,'Body':_0x5841cf},function(_0x461a8b,_0x1dbdff){if(_0x461a8b){return _0x1bbafd(_0x461a8b);}else{return _0x55a87d(_0x1dbdff);}});});}function startTranscribe(_0x7604e4,_0x2b89aa,_0x161654,_0x4042b4,_0x2ce1b0,_0x38d5c9){return new Promise(function(_0x2996ca,_0xaa0312){var _0xe4ab1=new AWS[(_0x1b00('0x6c'))]({'accessKeyId':_0x2b89aa,'secretAccessKey':_0x7604e4,'region':_0x161654});_0xe4ab1['startTranscriptionJob']({'TranscriptionJobName':_0x4042b4,'LanguageCode':_0x2ce1b0,'Media':{'MediaFileUri':_0x38d5c9}},function(_0x1b9ca0,_0x3783cc){if(_0x1b9ca0){return _0xaa0312(_0x1b9ca0);}else{return _0x2996ca(_0x3783cc);}});});}function transcribe(_0x51c078,_0x2ff3bb,_0x352cc1,_0x593733,_0x30b867,_0x335bc7,_0x1b2439){return new Promise(function(_0xa981c7,_0x4dd898){var _0x5de283={};logger[_0x1b00('0x66')](util['format'](_0x1b00('0x6d'),_0x51c078,_0x30b867));return uploadFile(_0x2ff3bb,_0x352cc1,_0x593733,_0x30b867,path['basename'](_0x335bc7),fs[_0x1b00('0x6e')](_0x335bc7))[_0x1b00('0x26')](function(_0x4d200e){logger[_0x1b00('0x66')](util['format'](_0x1b00('0x6f'),_0x51c078,_0x30b867,_0x4d200e[_0x1b00('0x70')]));_0x5de283['bucket']=_0x4d200e[_0x1b00('0x71')];_0x5de283[_0x1b00('0x72')]=_0x4d200e['Location'];logger[_0x1b00('0x66')](util[_0x1b00('0x2f')](_0x1b00('0x73'),_0x51c078));return startTranscribe(_0x2ff3bb,_0x352cc1,_0x593733,uuidv4(),_0x1b2439,_0x4d200e[_0x1b00('0x70')]);})['then'](function(_0x324dad){logger[_0x1b00('0x66')](util[_0x1b00('0x2f')](_0x1b00('0x74'),_0x51c078,_0x324dad['TranscriptionJob'][_0x1b00('0x75')]));_0x5de283[_0x1b00('0x76')]=_0x324dad[_0x1b00('0x77')][_0x1b00('0x75')];_0x5de283[_0x1b00('0x78')]=_0x324dad[_0x1b00('0x77')]['TranscriptionJobStatus'];return _0xa981c7(_0x5de283);})[_0x1b00('0x43')](function(_0x2a1018){return _0x4dd898(_0x2a1018);});});}exports['runTranscribe']=function(_0x12b3d9,_0xa6e2ea,_0x50f9bd){var _0x13ab6f;var _0x40698e;var _0x3cb38a;var _0x2b76c5=require(_0x1b00('0x4d'));return db[_0x1b00('0x3f')][_0x1b00('0x79')]({'where':{'id':_0x12b3d9['params']['id']}})[_0x1b00('0x26')](function(_0x474b82){if(_0x474b82){var _0x33a6ba=util[_0x1b00('0x2f')](_0x1b00('0x50'),_0x474b82[_0x1b00('0x4f')]);if(fs[_0x1b00('0x60')](_0x33a6ba)){cypher=!![];return _0x2b76c5[_0x1b00('0x51')](_0x33a6ba,_0x474b82[_0x1b00('0x4f')],config[_0x1b00('0x52')][_0x1b00('0x61')])[_0x1b00('0x26')](function(){return _0x474b82;});}return _0x474b82;}})[_0x1b00('0x26')](function(_0x59f3f7){if(!_0x59f3f7){throw new db[(_0x1b00('0x53'))][(_0x1b00('0x62'))](_0x1b00('0x7a'));}_0x40698e=_0x59f3f7;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0xa6e2ea,null))[_0x1b00('0x26')](function(_0x249778){if(_0x249778){_0x13ab6f=_0x249778;if(!_0x13ab6f['transcribe']||!_0x13ab6f['transcribeAccountId']||!_0x13ab6f['transcribeRegion']||!_0x13ab6f[_0x1b00('0x7b')]||!_0x13ab6f[_0x1b00('0x7c')]){throw new db[(_0x1b00('0x53'))]['ValidationError'](_0x1b00('0x7d'));}if(_0x12b3d9[_0x1b00('0x49')][_0x1b00('0x7e')]&&(!_0x13ab6f[_0x1b00('0x7f')]||!_0x13ab6f[_0x1b00('0x80')]||!_0x13ab6f['sentimentRegion']||!_0x13ab6f[_0x1b00('0x7b')]||!_0x13ab6f[_0x1b00('0x7c')])){throw new db[(_0x1b00('0x53'))][(_0x1b00('0x62'))](_0x1b00('0x81'));}return db[_0x1b00('0x82')][_0x1b00('0x79')]({'where':{'id':_0x13ab6f[_0x1b00('0x83')]}});}})[_0x1b00('0x26')](function(_0x49f48b){if(!_0x49f48b){throw new db['Sequelize'][(_0x1b00('0x62'))](_0x1b00('0x84'));}if(!_0x49f48b[_0x1b00('0x85')]||!_0x49f48b[_0x1b00('0x86')]){throw new db[(_0x1b00('0x53'))]['ValidationError'](_0x1b00('0x87'));}_0x3cb38a=_0x49f48b;return getBucketslist(_0x3cb38a[_0x1b00('0x85')],_0x3cb38a[_0x1b00('0x86')],_0x13ab6f['transcribeRegion']);})[_0x1b00('0x26')](function(_0x41105c){if(_0x41105c&&_0x41105c[_0x1b00('0x88')]){var _0x1abec5=_[_0x1b00('0x47')](_0x41105c['Buckets'],function(_0x2de5a0){return _0x2de5a0[_0x1b00('0x89')]===_0x13ab6f[_0x1b00('0x7c')];});if(!_0x1abec5){logger[_0x1b00('0x66')](util[_0x1b00('0x2f')](_0x1b00('0x8a'),_0x12b3d9['params']['id'],_0x13ab6f['bucket']));return createBucket(_0x3cb38a[_0x1b00('0x85')],_0x3cb38a[_0x1b00('0x86')],_0x13ab6f[_0x1b00('0x8b')],_0x13ab6f['bucket']);}logger[_0x1b00('0x66')](util[_0x1b00('0x2f')](_0x1b00('0x8c'),_0x12b3d9[_0x1b00('0x44')]['id'],_0x13ab6f['bucket']));return;}})[_0x1b00('0x26')](function(_0x249486){if(_0x40698e[_0x1b00('0x78')]===_0x1b00('0x8d')){return transcribe(_0x12b3d9[_0x1b00('0x44')]['id'],_0x3cb38a[_0x1b00('0x85')],_0x3cb38a[_0x1b00('0x86')],_0x13ab6f[_0x1b00('0x8b')],_0x13ab6f[_0x1b00('0x7c')],_0x40698e['value'],_0x13ab6f['language']);}else{logger[_0x1b00('0x66')](util[_0x1b00('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x12b3d9[_0x1b00('0x44')]['id']));return{'transcribeStatus':_0x1b00('0x8e')};}})[_0x1b00('0x26')](function(_0xaafbb1){if(_0xaafbb1){_0xaafbb1[_0x1b00('0x8f')]=_0x12b3d9[_0x1b00('0x49')][_0x1b00('0x7e')];return _0x40698e[_0x1b00('0x90')](_0xaafbb1);}})[_0x1b00('0x26')](respondWithResult(_0xa6e2ea,null))['catch'](handleError(_0xa6e2ea,null));};function writeFile(_0x2cd29e,_0x1cfce1){return new Promise(function(_0x1de26d,_0x3c680e){fs[_0x1b00('0x91')](_0x1cfce1,_0x2cd29e,function(_0xb1e6f7,_0x5c1481){if(_0xb1e6f7){return _0x3c680e(_0xb1e6f7);}else{return _0x1de26d(_0x5c1481);}});});}exports['downloadTranscribe']=function(_0x2f28c8,_0x57a27b,_0x30b902){return db[_0x1b00('0x3f')]['findOne']({'where':{'id':_0x2f28c8[_0x1b00('0x44')]['id']}})[_0x1b00('0x26')](handleEntityNotFound(_0x57a27b))[_0x1b00('0x26')](function(_0x5a0416){if(_0x5a0416&&_0x5a0416[_0x1b00('0x92')]){var _0x3c0f39=_0x5a0416[_0x1b00('0x92')];var _0x1b78dc=config[_0x1b00('0x93')]+_0x1b00('0x94')+_0x5a0416['id']+_0x1b00('0x95');if(fs['existsSync'](_0x1b78dc)){return _0x1b78dc;}return writeFile(_0x3c0f39,_0x1b78dc)[_0x1b00('0x26')](function(){return _0x1b78dc;});}else{throw new db[(_0x1b00('0x53'))]['ValidationError']('Transcript\x20not\x20available');}})[_0x1b00('0x26')](function(_0x31fa95){return _0x57a27b['download'](_0x31fa95);})['catch'](handleError(_0x57a27b));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 455c0de..2be898a 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 _0x3613=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0x2a990c,_0x241e85){var _0x47d328=function(_0xdad74){while(--_0xdad74){_0x2a990c['push'](_0x2a990c['shift']());}};_0x47d328(++_0x241e85);}(_0x3613,0x198));var _0x3361=function(_0x5aac37,_0x19cbc1){_0x5aac37=_0x5aac37-0x0;var _0x187fc1=_0x3613[_0x5aac37];return _0x187fc1;};'use strict';var attributes=require(_0x3361('0x0'));module[_0x3361('0x1')]=function(_0x2469ba,_0x1ae539){return _0x2469ba[_0x3361('0x2')](_0x3361('0x3'),attributes,{'tableName':_0x3361('0x4'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3361('0x5')]},{'name':'transcribeStatus','fields':[_0x3361('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x207d=['exports','VoiceRecording','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x207d,0x10d));var _0xd207=function(_0x14f487,_0x38564e){_0x14f487=_0x14f487-0x0;var _0x546284=_0x207d[_0x14f487];return _0x546284;};'use strict';var attributes=require(_0xd207('0x0'));module[_0xd207('0x1')]=function(_0x302062,_0x27a1dc){return _0x302062['define'](_0xd207('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xd207('0x3'),'fields':[_0xd207('0x3')]},{'name':'transcribeStatus','fields':[_0xd207('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 04d7830..c557b87 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 _0x9f0e=['format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x9f0e,0x116));var _0xe9f0=function(_0x8990a4,_0x513e7c){_0x8990a4=_0x8990a4-0x0;var _0x1302d1=_0x9f0e[_0x8990a4];return _0x1302d1;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0x2ab12b['body'],{'raw':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options']['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0xb')](function(_0x316cdf){logger[_0xe9f0('0xc')]('UpdateVoiceRecording',_0x2ab12b);logger[_0xe9f0('0xf')](_0xe9f0('0x16'),_0x2ab12b,JSON[_0xe9f0('0x11')](_0x316cdf));_0x59bf5a(_0x316cdf);})[_0xe9f0('0x15')](function(_0x3ca991){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x3ca991[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x3ca991[_0xe9f0('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x371095){var _0x27541f=this;return new Promise(function(_0x2ddfba,_0x1a8478){var _0x4cf1b1=require(_0xe9f0('0x1d'));var _0x2613fd;return db[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'attributes':['id',_0xe9f0('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x130f96){_0x2613fd=_0x130f96;return db[_0xe9f0('0x17')][_0xe9f0('0x21')](_0x371095[_0xe9f0('0x22')]);})[_0xe9f0('0xb')](function(_0xd19788){if(_0x2613fd[_0xe9f0('0x20')]&&fs[_0xe9f0('0x23')](_0xd19788[_0xe9f0('0x24')])){var _0x3dbe49=util[_0xe9f0('0x25')](_0xe9f0('0x26'),_0xd19788[_0xe9f0('0x24')]);return _0x4cf1b1[_0xe9f0('0x27')](_0xd19788[_0xe9f0('0x24')],_0x3dbe49,config[_0xe9f0('0x28')][_0xe9f0('0x29')])[_0xe9f0('0xb')](function(){fs[_0xe9f0('0x2a')](_0xd19788[_0xe9f0('0x24')]);logger[_0xe9f0('0xc')](_0xe9f0('0x2b'));return _0xd19788;});}return _0xd19788;})[_0xe9f0('0xb')](function(_0x3611c0){logger['info']('CreateVoiceRecording',_0x371095);logger['debug'](_0xe9f0('0x2c'),_0x371095,JSON['stringify'](_0x3611c0));_0x2ddfba(_0x3611c0);})[_0xe9f0('0x15')](function(_0xc5fa13){logger['error'](_0xe9f0('0x2c'),_0xc5fa13['message'],_0x371095);_0x1a8478(_0x27541f['error'](0x1f4,_0xc5fa13['message']));});});}; \ No newline at end of file +var _0xc6ac=['Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','stringify','catch','CreateVoiceRecording','../../components/encryptor'];(function(_0x5a7587,_0xfb43d7){var _0x32a565=function(_0x22bca4){while(--_0x22bca4){_0x5a7587['push'](_0x5a7587['shift']());}};_0x32a565(++_0xfb43d7);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5db361,_0x341c6b){_0x5db361=_0x5db361-0x0;var _0x52b2e0=_0xc6ac[_0x5db361];return _0x52b2e0;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});}exports[_0xcc6a('0x18')]=function(_0x33079c){var _0x12ef33=this;return new Promise(function(_0x2d9585,_0x412bc7){return db[_0xcc6a('0x19')][_0xcc6a('0x1a')](_0x33079c[_0xcc6a('0x1b')],{'raw':_0x33079c['options']?_0x33079c[_0xcc6a('0x1c')][_0xcc6a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33079c[_0xcc6a('0x1c')]?_0x33079c[_0xcc6a('0x1c')][_0xcc6a('0x1e')]||null:null,'attributes':_0x33079c[_0xcc6a('0x1c')]?_0x33079c[_0xcc6a('0x1c')][_0xcc6a('0x1f')]||null:null,'limit':_0x33079c[_0xcc6a('0x1c')]?_0x33079c[_0xcc6a('0x1c')][_0xcc6a('0x20')]||null:null})[_0xcc6a('0xf')](function(_0x51be9a){logger[_0xcc6a('0x10')](_0xcc6a('0x18'),_0x33079c);logger[_0xcc6a('0x12')]('UpdateVoiceRecording',_0x33079c,JSON[_0xcc6a('0x21')](_0x51be9a));_0x2d9585(_0x51be9a);})[_0xcc6a('0x22')](function(_0x3a00e5){logger[_0xcc6a('0x15')](_0xcc6a('0x18'),_0x3a00e5[_0xcc6a('0x17')],_0x33079c);_0x412bc7(_0x12ef33['error'](0x1f4,_0x3a00e5[_0xcc6a('0x17')]));});});};exports[_0xcc6a('0x23')]=function(_0x3514f3){var _0x5f27e5=this;return new Promise(function(_0x3afb3a,_0x3dad72){var _0x4da301=require(_0xcc6a('0x24'));var _0x8b1b2b;return db[_0xcc6a('0x25')][_0xcc6a('0x26')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xcc6a('0xf')](function(_0x3cf14c){_0x8b1b2b=_0x3cf14c;return db[_0xcc6a('0x19')]['create'](_0x3514f3[_0xcc6a('0x1b')]);})['then'](function(_0x4f67d3){if(_0x8b1b2b[_0xcc6a('0x27')]&&fs[_0xcc6a('0x28')](_0x4f67d3[_0xcc6a('0x29')])){var _0x11b481=util[_0xcc6a('0x2a')](_0xcc6a('0x2b'),_0x4f67d3['value']);return _0x4da301[_0xcc6a('0x2c')](_0x4f67d3[_0xcc6a('0x29')],_0x11b481,config[_0xcc6a('0x2d')][_0xcc6a('0x2e')])[_0xcc6a('0xf')](function(){fs[_0xcc6a('0x2f')](_0x4f67d3[_0xcc6a('0x29')]);logger[_0xcc6a('0x10')]('CreateVoiceRecording\x20file\x20encrypted');return _0x4f67d3;});}return _0x4f67d3;})[_0xcc6a('0xf')](function(_0xc8c90c){logger[_0xcc6a('0x10')](_0xcc6a('0x23'),_0x3514f3);logger[_0xcc6a('0x12')](_0xcc6a('0x23'),_0x3514f3,JSON[_0xcc6a('0x21')](_0xc8c90c));_0x3afb3a(_0xc8c90c);})['catch'](function(_0x5d2287){logger['error']('CreateVoiceRecording',_0x5d2287['message'],_0x3514f3);_0x3dad72(_0x5f27e5[_0xcc6a('0x15')](0x1f4,_0x5d2287[_0xcc6a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 8df20fe..7f92ffb 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 _0x7e97=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','post','create','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7e97,0xe0));var _0x77e9=function(_0x56d881,_0x38b79f){_0x56d881=_0x56d881-0x0;var _0x203ad4=_0x7e97[_0x56d881];return _0x203ad4;};'use strict';var multer=require(_0x77e9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x77e9('0x1'));var express=require(_0x77e9('0x2'));var router=express[_0x77e9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x77e9('0x4'));var interaction=require(_0x77e9('0x5'));var config=require(_0x77e9('0x6'));var controller=require(_0x77e9('0x7'));router[_0x77e9('0x8')]('/',auth[_0x77e9('0x9')](),controller[_0x77e9('0xa')]);router[_0x77e9('0x8')](_0x77e9('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x77e9('0x8')]('/:id',auth[_0x77e9('0x9')](),controller['show']);router[_0x77e9('0xc')]('/',auth['isAuthenticated'](),controller[_0x77e9('0xd')]);router['put'](_0x77e9('0xe'),auth[_0x77e9('0x9')](),controller[_0x77e9('0xf')]);router[_0x77e9('0x10')](_0x77e9('0xe'),auth[_0x77e9('0x9')](),controller[_0x77e9('0x11')]);module[_0x77e9('0x12')]=router; \ No newline at end of file +var _0x2ee7=['index','/describe','describe','show','create','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x4f6c67,_0x2f0e92){var _0x27c8b2=function(_0x2a9bb6){while(--_0x2a9bb6){_0x4f6c67['push'](_0x4f6c67['shift']());}};_0x27c8b2(++_0x2f0e92);}(_0x2ee7,0x75));var _0x72ee=function(_0x522b51,_0x36da00){_0x522b51=_0x522b51-0x0;var _0x3314f9=_0x2ee7[_0x522b51];return _0x3314f9;};'use strict';var multer=require(_0x72ee('0x0'));var util=require('util');var path=require(_0x72ee('0x1'));var timeout=require(_0x72ee('0x2'));var express=require(_0x72ee('0x3'));var router=express[_0x72ee('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x72ee('0x5'));var config=require('../../config/environment');var controller=require(_0x72ee('0x6'));router[_0x72ee('0x7')]('/',auth[_0x72ee('0x8')](),controller[_0x72ee('0x9')]);router[_0x72ee('0x7')](_0x72ee('0xa'),auth[_0x72ee('0x8')](),controller[_0x72ee('0xb')]);router[_0x72ee('0x7')]('/:id',auth[_0x72ee('0x8')](),controller[_0x72ee('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x72ee('0xd')]);router['put'](_0x72ee('0xe'),auth[_0x72ee('0x8')](),controller[_0x72ee('0xf')]);router[_0x72ee('0x10')](_0x72ee('0xe'),auth[_0x72ee('0x8')](),controller[_0x72ee('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 9d95d3f..05fc5b4 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 _0x2230=['Yes','moment','ENUM','blind','attended','STRING'];(function(_0x3128ff,_0x42606f){var _0x4781df=function(_0x1a4dab){while(--_0x1a4dab){_0x3128ff['push'](_0x3128ff['shift']());}};_0x4781df(++_0x42606f);}(_0x2230,0x85));var _0x0223=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2230[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0223('0x0'));module['exports']={'type':{'type':Sequelize[_0x0223('0x1')](_0x0223('0x2'),_0x0223('0x3'))},'result':{'type':Sequelize[_0x0223('0x4')]},'transfererchannel':{'type':Sequelize[_0x0223('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x0223('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x0223('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x0223('0x4')]},'transfererexten':{'type':Sequelize[_0x0223('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x0223('0x4')]},'transfereechannel':{'type':Sequelize[_0x0223('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x0223('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x0223('0x4')]},'transfereeexten':{'type':Sequelize[_0x0223('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x0223('0x4')]},'isexternal':{'type':Sequelize[_0x0223('0x1')](_0x0223('0x5'),'No')},'context':{'type':Sequelize[_0x0223('0x4')]},'extension':{'type':Sequelize[_0x0223('0x4')]}}; \ No newline at end of file +var _0x8954=['attended','STRING','Yes','sequelize','exports','blind'];(function(_0x35ac48,_0x24d60b){var _0x3dcfd7=function(_0x217089){while(--_0x217089){_0x35ac48['push'](_0x35ac48['shift']());}};_0x3dcfd7(++_0x24d60b);}(_0x8954,0x93));var _0x4895=function(_0x443e5f,_0x2d733b){_0x443e5f=_0x443e5f-0x0;var _0x16aab7=_0x8954[_0x443e5f];return _0x16aab7;};'use strict';var Sequelize=require(_0x4895('0x0'));var moment=require('moment');module[_0x4895('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4895('0x2'),_0x4895('0x3'))},'result':{'type':Sequelize[_0x4895('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x4895('0x4')]},'transferercalleridname':{'type':Sequelize[_0x4895('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x4895('0x4')]},'transfererexten':{'type':Sequelize[_0x4895('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x4895('0x4')]},'transfereechannel':{'type':Sequelize[_0x4895('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x4895('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x4895('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x4895('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x4895('0x4')]},'transfereeexten':{'type':Sequelize[_0x4895('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x4895('0x5'),'No')},'context':{'type':Sequelize[_0x4895('0x4')]},'extension':{'type':Sequelize[_0x4895('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 163822c..3b06963 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 _0xfa0d=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','length','options','catch','create','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x265286,_0xca5eb1){var _0x5046bc=function(_0x313aaf){while(--_0x313aaf){_0x265286['push'](_0x265286['shift']());}};_0x5046bc(++_0xca5eb1);}(_0xfa0d,0x182));var _0xdfa0=function(_0x39c86b,_0x29246c){_0x39c86b=_0x39c86b-0x0;var _0x179042=_0xfa0d[_0x39c86b];return _0x179042;};'use strict';var emlformat=require(_0xdfa0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdfa0('0x1'));var moment=require(_0xdfa0('0x2'));var BPromise=require(_0xdfa0('0x3'));var Mustache=require(_0xdfa0('0x4'));var util=require(_0xdfa0('0x5'));var path=require(_0xdfa0('0x6'));var sox=require('sox');var csv=require(_0xdfa0('0x7'));var ejs=require(_0xdfa0('0x8'));var fs=require('fs');var fs_extra=require(_0xdfa0('0x9'));var _=require('lodash');var squel=require(_0xdfa0('0xa'));var crypto=require(_0xdfa0('0xb'));var jsforce=require(_0xdfa0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdfa0('0x7'));var querystring=require(_0xdfa0('0xd'));var Papa=require(_0xdfa0('0xe'));var Redis=require(_0xdfa0('0xf'));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(_0xdfa0('0x10'))(_0xdfa0('0x11'));var utils=require(_0xdfa0('0x12'));var config=require(_0xdfa0('0x13'));var licenseUtil=require(_0xdfa0('0x14'));var db=require(_0xdfa0('0x15'))['db'];function respondWithStatusCode(_0x2756d9,_0x446484){_0x446484=_0x446484||0xcc;return function(_0x8a4ff6){if(_0x8a4ff6){return _0x2756d9[_0xdfa0('0x16')](_0x446484);}return _0x2756d9[_0xdfa0('0x17')](_0x446484)[_0xdfa0('0x18')]();};}function respondWithResult(_0x429c51,_0xd71168){_0xd71168=_0xd71168||0xc8;return function(_0x5efc46){if(_0x5efc46){return _0x429c51[_0xdfa0('0x17')](_0xd71168)['json'](_0x5efc46);}};}function respondWithFilteredResult(_0x4fe376,_0x5e9f55){return function(_0x3003ee){if(_0x3003ee){var _0x4c4a18=typeof _0x5e9f55[_0xdfa0('0x19')]===_0xdfa0('0x1a')&&typeof _0x5e9f55[_0xdfa0('0x1b')]===_0xdfa0('0x1a');var _0x42c5f9=_0x3003ee[_0xdfa0('0x1c')];var _0x156a05=_0x4c4a18?0x0:_0x5e9f55[_0xdfa0('0x19')];var _0x2dc5e8=_0x4c4a18?_0x3003ee[_0xdfa0('0x1c')]:_0x5e9f55[_0xdfa0('0x19')]+_0x5e9f55[_0xdfa0('0x1b')];var _0x5a780b;if(_0x2dc5e8>=_0x42c5f9){_0x2dc5e8=_0x42c5f9;_0x5a780b=0xc8;}else{_0x5a780b=0xce;}_0x4fe376[_0xdfa0('0x17')](_0x5a780b);return _0x4fe376[_0xdfa0('0x1d')]('Content-Range',_0x156a05+'-'+_0x2dc5e8+'/'+_0x42c5f9)[_0xdfa0('0x1e')](_0x3003ee);}return null;};}function patchUpdates(_0x3ba0f6){return function(_0x42aa2a){try{jsonpatch[_0xdfa0('0x1f')](_0x42aa2a,_0x3ba0f6,!![]);}catch(_0x2849e3){return BPromise[_0xdfa0('0x20')](_0x2849e3);}return _0x42aa2a[_0xdfa0('0x21')]();};}function saveUpdates(_0x30bb18,_0x343afc){return function(_0x4e7aae){if(_0x4e7aae){return _0x4e7aae[_0xdfa0('0x22')](_0x30bb18)[_0xdfa0('0x23')](function(_0x3ee0b1){return _0x3ee0b1;});}return null;};}function removeEntity(_0x269b68,_0x4037f9){return function(_0x2cf881){if(_0x2cf881){return _0x2cf881[_0xdfa0('0x24')]()[_0xdfa0('0x23')](function(){_0x269b68['status'](0xcc)[_0xdfa0('0x18')]();});}};}function handleEntityNotFound(_0x1e7331,_0x45de97){return function(_0xe3d009){if(!_0xe3d009){_0x1e7331[_0xdfa0('0x16')](0x194);}return _0xe3d009;};}function handleError(_0x15a5ae,_0x125359){_0x125359=_0x125359||0x1f4;return function(_0x22f163){logger[_0xdfa0('0x25')](_0x22f163['stack']);if(_0x22f163['name']){delete _0x22f163[_0xdfa0('0x26')];}_0x15a5ae[_0xdfa0('0x17')](_0x125359)[_0xdfa0('0x27')](_0x22f163);};}exports['index']=function(_0x5eec87,_0xc68cab){var _0x3dba05={},_0x3ca08f={},_0x2d8f65={'count':0x0,'rows':[]};var _0x36f8a2=_[_0xdfa0('0x28')](db[_0xdfa0('0x29')][_0xdfa0('0x2a')],function(_0x4609e2){return{'name':_0x4609e2[_0xdfa0('0x2b')],'type':_0x4609e2[_0xdfa0('0x2c')][_0xdfa0('0x2d')]};});_0x3ca08f[_0xdfa0('0x2e')]=_[_0xdfa0('0x28')](_0x36f8a2,_0xdfa0('0x26'));_0x3ca08f[_0xdfa0('0x2f')]=_['keys'](_0x5eec87[_0xdfa0('0x2f')]);_0x3ca08f[_0xdfa0('0x30')]=_[_0xdfa0('0x31')](_0x3ca08f[_0xdfa0('0x2e')],_0x3ca08f[_0xdfa0('0x2f')]);_0x3dba05[_0xdfa0('0x32')]=_[_0xdfa0('0x31')](_0x3ca08f[_0xdfa0('0x2e')],qs['fields'](_0x5eec87['query'][_0xdfa0('0x33')]));_0x3dba05[_0xdfa0('0x32')]=_0x3dba05[_0xdfa0('0x32')]['length']?_0x3dba05[_0xdfa0('0x32')]:_0x3ca08f[_0xdfa0('0x2e')];if(!_0x5eec87['query'][_0xdfa0('0x34')]('nolimit')){_0x3dba05[_0xdfa0('0x1b')]=qs['limit'](_0x5eec87[_0xdfa0('0x2f')][_0xdfa0('0x1b')]);_0x3dba05[_0xdfa0('0x19')]=qs[_0xdfa0('0x19')](_0x5eec87['query'][_0xdfa0('0x19')]);}_0x3dba05[_0xdfa0('0x35')]=qs[_0xdfa0('0x36')](_0x5eec87[_0xdfa0('0x2f')][_0xdfa0('0x36')]);_0x3dba05[_0xdfa0('0x37')]=qs[_0xdfa0('0x30')](_[_0xdfa0('0x38')](_0x5eec87['query'],_0x3ca08f[_0xdfa0('0x30')]),_0x36f8a2);if(_0x5eec87[_0xdfa0('0x2f')][_0xdfa0('0x39')]){_0x3dba05['where']=_[_0xdfa0('0x3a')](_0x3dba05[_0xdfa0('0x37')],{'$or':_[_0xdfa0('0x28')](_0x36f8a2,function(_0x1e23e6){if(_0x1e23e6[_0xdfa0('0x2c')]!==_0xdfa0('0x3b')){var _0x2da1b3={};_0x2da1b3[_0x1e23e6['name']]={'$like':'%'+_0x5eec87[_0xdfa0('0x2f')]['filter']+'%'};return _0x2da1b3;}})});}_0x3dba05=_[_0xdfa0('0x3a')]({},_0x3dba05,_0x5eec87['options']);var _0x56d1b7={'where':_0x3dba05[_0xdfa0('0x37')]};return db['VoiceTransferReport'][_0xdfa0('0x1c')](_0x56d1b7)[_0xdfa0('0x23')](function(_0x1f162e){_0x2d8f65['count']=_0x1f162e;if(_0x5eec87['query'][_0xdfa0('0x3c')]){_0x3dba05[_0xdfa0('0x3d')]=[{'all':!![]}];}return db[_0xdfa0('0x29')]['findAll'](_0x3dba05);})[_0xdfa0('0x23')](function(_0x1c8379){_0x2d8f65[_0xdfa0('0x3e')]=_0x1c8379;return _0x2d8f65;})[_0xdfa0('0x23')](respondWithFilteredResult(_0xc68cab,_0x3dba05))['catch'](handleError(_0xc68cab,null));};exports[_0xdfa0('0x3f')]=function(_0x47cc84,_0x520878){var _0x5af378={'raw':!![],'where':{'id':_0x47cc84[_0xdfa0('0x40')]['id']}},_0x725f75={};_0x725f75[_0xdfa0('0x2e')]=_['keys'](db['VoiceTransferReport'][_0xdfa0('0x2a')]);_0x725f75['query']=_[_0xdfa0('0x41')](_0x47cc84['query']);_0x725f75[_0xdfa0('0x30')]=_[_0xdfa0('0x31')](_0x725f75[_0xdfa0('0x2e')],_0x725f75[_0xdfa0('0x2f')]);_0x5af378[_0xdfa0('0x32')]=_[_0xdfa0('0x31')](_0x725f75[_0xdfa0('0x2e')],qs[_0xdfa0('0x33')](_0x47cc84[_0xdfa0('0x2f')][_0xdfa0('0x33')]));_0x5af378['attributes']=_0x5af378[_0xdfa0('0x32')][_0xdfa0('0x42')]?_0x5af378[_0xdfa0('0x32')]:_0x725f75['model'];if(_0x47cc84[_0xdfa0('0x2f')][_0xdfa0('0x3c')]){_0x5af378[_0xdfa0('0x3d')]=[{'all':!![]}];}_0x5af378=_['merge']({},_0x5af378,_0x47cc84[_0xdfa0('0x43')]);return db[_0xdfa0('0x29')]['find'](_0x5af378)['then'](handleEntityNotFound(_0x520878,null))[_0xdfa0('0x23')](respondWithResult(_0x520878,null))[_0xdfa0('0x44')](handleError(_0x520878,null));};exports[_0xdfa0('0x45')]=function(_0x1ebca7,_0xd42f91){return db[_0xdfa0('0x29')][_0xdfa0('0x45')](_0x1ebca7[_0xdfa0('0x46')],{})[_0xdfa0('0x23')](respondWithResult(_0xd42f91,0xc9))[_0xdfa0('0x44')](handleError(_0xd42f91,null));};exports[_0xdfa0('0x22')]=function(_0x23c437,_0x14d975){if(_0x23c437['body']['id']){delete _0x23c437[_0xdfa0('0x46')]['id'];}return db['VoiceTransferReport'][_0xdfa0('0x47')]({'where':{'id':_0x23c437['params']['id']}})[_0xdfa0('0x23')](handleEntityNotFound(_0x14d975,null))['then'](saveUpdates(_0x23c437[_0xdfa0('0x46')],null))[_0xdfa0('0x23')](respondWithResult(_0x14d975,null))[_0xdfa0('0x44')](handleError(_0x14d975,null));};exports[_0xdfa0('0x24')]=function(_0x554dde,_0x49ae69){return db[_0xdfa0('0x29')]['find']({'where':{'id':_0x554dde[_0xdfa0('0x40')]['id']}})[_0xdfa0('0x23')](handleEntityNotFound(_0x49ae69,null))[_0xdfa0('0x23')](removeEntity(_0x49ae69,null))['catch'](handleError(_0x49ae69,null));};exports[_0xdfa0('0x48')]=function(_0xb6b6b2,_0x5c4e57){return db[_0xdfa0('0x29')][_0xdfa0('0x48')]()[_0xdfa0('0x23')](respondWithResult(_0x5c4e57,null))['catch'](handleError(_0x5c4e57,null));}; \ No newline at end of file +var _0x94a0=['../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','status','sendStatus','stack','name','index','VoiceTransferReport','rawAttributes','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','params','keys','length','includeAll','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94a0,0x107));var _0x094a=function(_0x5223f0,_0x12c73c){_0x5223f0=_0x5223f0-0x0;var _0x55dd06=_0x94a0[_0x5223f0];return _0x55dd06;};'use strict';var emlformat=require(_0x094a('0x0'));var rimraf=require(_0x094a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x094a('0x2'));var rp=require(_0x094a('0x3'));var moment=require(_0x094a('0x4'));var BPromise=require(_0x094a('0x5'));var Mustache=require(_0x094a('0x6'));var util=require(_0x094a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x094a('0x8'));var ejs=require(_0x094a('0x9'));var fs=require('fs');var fs_extra=require(_0x094a('0xa'));var _=require(_0x094a('0xb'));var squel=require('squel');var crypto=require(_0x094a('0xc'));var jsforce=require(_0x094a('0xd'));var deskjs=require(_0x094a('0xe'));var toCsv=require(_0x094a('0x8'));var querystring=require(_0x094a('0xf'));var Papa=require(_0x094a('0x10'));var Redis=require('ioredis');var authService=require(_0x094a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x094a('0x12'));var hardwareService=require(_0x094a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x094a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x094a('0x15'));var db=require(_0x094a('0x16'))['db'];function respondWithStatusCode(_0x35cb9c,_0x47eec8){_0x47eec8=_0x47eec8||0xcc;return function(_0x2d03fa){if(_0x2d03fa){return _0x35cb9c['sendStatus'](_0x47eec8);}return _0x35cb9c['status'](_0x47eec8)['end']();};}function respondWithResult(_0x11187e,_0x37d169){_0x37d169=_0x37d169||0xc8;return function(_0x11ebf0){if(_0x11ebf0){return _0x11187e['status'](_0x37d169)[_0x094a('0x17')](_0x11ebf0);}};}function respondWithFilteredResult(_0x5748ca,_0x5c1fb2){return function(_0x5f0601){if(_0x5f0601){var _0x2bc250=typeof _0x5c1fb2[_0x094a('0x18')]===_0x094a('0x19')&&typeof _0x5c1fb2[_0x094a('0x1a')]==='undefined';var _0x529123=_0x5f0601[_0x094a('0x1b')];var _0xcc98c3=_0x2bc250?0x0:_0x5c1fb2[_0x094a('0x18')];var _0x4d708e=_0x2bc250?_0x5f0601[_0x094a('0x1b')]:_0x5c1fb2[_0x094a('0x18')]+_0x5c1fb2['limit'];var _0x33997f;if(_0x4d708e>=_0x529123){_0x4d708e=_0x529123;_0x33997f=0xc8;}else{_0x33997f=0xce;}_0x5748ca['status'](_0x33997f);return _0x5748ca[_0x094a('0x1c')]('Content-Range',_0xcc98c3+'-'+_0x4d708e+'/'+_0x529123)['json'](_0x5f0601);}return null;};}function patchUpdates(_0x15268f){return function(_0x320fab){try{jsonpatch[_0x094a('0x1d')](_0x320fab,_0x15268f,!![]);}catch(_0x3ec291){return BPromise['reject'](_0x3ec291);}return _0x320fab[_0x094a('0x1e')]();};}function saveUpdates(_0xd5538d,_0xd0014d){return function(_0x1fcb6f){if(_0x1fcb6f){return _0x1fcb6f[_0x094a('0x1f')](_0xd5538d)[_0x094a('0x20')](function(_0x5ab2c8){return _0x5ab2c8;});}return null;};}function removeEntity(_0xca2c09,_0x46b9b1){return function(_0x1e68fd){if(_0x1e68fd){return _0x1e68fd[_0x094a('0x21')]()[_0x094a('0x20')](function(){_0xca2c09[_0x094a('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x837a38,_0x5e5b14){return function(_0x443b26){if(!_0x443b26){_0x837a38[_0x094a('0x23')](0x194);}return _0x443b26;};}function handleError(_0x554e7c,_0x27828e){_0x27828e=_0x27828e||0x1f4;return function(_0x45d4a8){logger['error'](_0x45d4a8[_0x094a('0x24')]);if(_0x45d4a8[_0x094a('0x25')]){delete _0x45d4a8[_0x094a('0x25')];}_0x554e7c[_0x094a('0x22')](_0x27828e)['send'](_0x45d4a8);};}exports[_0x094a('0x26')]=function(_0x8206f0,_0x226ea3){var _0x4f3734={},_0x40b8ef={},_0x4217f1={'count':0x0,'rows':[]};var _0x588eac=_['map'](db[_0x094a('0x27')][_0x094a('0x28')],function(_0x17b7c5){return{'name':_0x17b7c5['fieldName'],'type':_0x17b7c5[_0x094a('0x29')][_0x094a('0x2a')]};});_0x40b8ef[_0x094a('0x2b')]=_['map'](_0x588eac,_0x094a('0x25'));_0x40b8ef['query']=_['keys'](_0x8206f0[_0x094a('0x2c')]);_0x40b8ef['filters']=_[_0x094a('0x2d')](_0x40b8ef['model'],_0x40b8ef[_0x094a('0x2c')]);_0x4f3734['attributes']=_[_0x094a('0x2d')](_0x40b8ef[_0x094a('0x2b')],qs[_0x094a('0x2e')](_0x8206f0[_0x094a('0x2c')]['fields']));_0x4f3734[_0x094a('0x2f')]=_0x4f3734['attributes']['length']?_0x4f3734['attributes']:_0x40b8ef['model'];if(!_0x8206f0[_0x094a('0x2c')][_0x094a('0x30')](_0x094a('0x31'))){_0x4f3734[_0x094a('0x1a')]=qs[_0x094a('0x1a')](_0x8206f0[_0x094a('0x2c')][_0x094a('0x1a')]);_0x4f3734['offset']=qs[_0x094a('0x18')](_0x8206f0[_0x094a('0x2c')]['offset']);}_0x4f3734['order']=qs[_0x094a('0x32')](_0x8206f0[_0x094a('0x2c')][_0x094a('0x32')]);_0x4f3734[_0x094a('0x33')]=qs[_0x094a('0x34')](_[_0x094a('0x35')](_0x8206f0['query'],_0x40b8ef[_0x094a('0x34')]),_0x588eac);if(_0x8206f0[_0x094a('0x2c')][_0x094a('0x36')]){_0x4f3734['where']=_[_0x094a('0x37')](_0x4f3734[_0x094a('0x33')],{'$or':_[_0x094a('0x38')](_0x588eac,function(_0x368c06){if(_0x368c06[_0x094a('0x29')]!==_0x094a('0x39')){var _0x54ea03={};_0x54ea03[_0x368c06['name']]={'$like':'%'+_0x8206f0[_0x094a('0x2c')][_0x094a('0x36')]+'%'};return _0x54ea03;}})});}_0x4f3734=_[_0x094a('0x37')]({},_0x4f3734,_0x8206f0['options']);var _0x5581b0={'where':_0x4f3734[_0x094a('0x33')]};return db[_0x094a('0x27')]['count'](_0x5581b0)[_0x094a('0x20')](function(_0x515a7a){_0x4217f1['count']=_0x515a7a;if(_0x8206f0[_0x094a('0x2c')]['includeAll']){_0x4f3734[_0x094a('0x3a')]=[{'all':!![]}];}return db[_0x094a('0x27')][_0x094a('0x3b')](_0x4f3734);})['then'](function(_0x4bb547){_0x4217f1[_0x094a('0x3c')]=_0x4bb547;return _0x4217f1;})['then'](respondWithFilteredResult(_0x226ea3,_0x4f3734))[_0x094a('0x3d')](handleError(_0x226ea3,null));};exports[_0x094a('0x3e')]=function(_0x594946,_0x45080d){var _0x17a3e5={'raw':!![],'where':{'id':_0x594946[_0x094a('0x3f')]['id']}},_0x1c3bac={};_0x1c3bac[_0x094a('0x2b')]=_[_0x094a('0x40')](db['VoiceTransferReport'][_0x094a('0x28')]);_0x1c3bac[_0x094a('0x2c')]=_['keys'](_0x594946['query']);_0x1c3bac[_0x094a('0x34')]=_[_0x094a('0x2d')](_0x1c3bac['model'],_0x1c3bac[_0x094a('0x2c')]);_0x17a3e5['attributes']=_['intersection'](_0x1c3bac[_0x094a('0x2b')],qs['fields'](_0x594946[_0x094a('0x2c')][_0x094a('0x2e')]));_0x17a3e5[_0x094a('0x2f')]=_0x17a3e5['attributes'][_0x094a('0x41')]?_0x17a3e5[_0x094a('0x2f')]:_0x1c3bac[_0x094a('0x2b')];if(_0x594946[_0x094a('0x2c')][_0x094a('0x42')]){_0x17a3e5[_0x094a('0x3a')]=[{'all':!![]}];}_0x17a3e5=_[_0x094a('0x37')]({},_0x17a3e5,_0x594946[_0x094a('0x43')]);return db[_0x094a('0x27')][_0x094a('0x44')](_0x17a3e5)[_0x094a('0x20')](handleEntityNotFound(_0x45080d,null))[_0x094a('0x20')](respondWithResult(_0x45080d,null))[_0x094a('0x3d')](handleError(_0x45080d,null));};exports[_0x094a('0x45')]=function(_0x399ddc,_0x135030){return db[_0x094a('0x27')][_0x094a('0x45')](_0x399ddc[_0x094a('0x46')],{})[_0x094a('0x20')](respondWithResult(_0x135030,0xc9))[_0x094a('0x3d')](handleError(_0x135030,null));};exports[_0x094a('0x1f')]=function(_0x423911,_0x244290){if(_0x423911[_0x094a('0x46')]['id']){delete _0x423911[_0x094a('0x46')]['id'];}return db[_0x094a('0x27')][_0x094a('0x44')]({'where':{'id':_0x423911[_0x094a('0x3f')]['id']}})[_0x094a('0x20')](handleEntityNotFound(_0x244290,null))['then'](saveUpdates(_0x423911['body'],null))[_0x094a('0x20')](respondWithResult(_0x244290,null))[_0x094a('0x3d')](handleError(_0x244290,null));};exports['destroy']=function(_0x14e6c1,_0x2c45a5){return db['VoiceTransferReport'][_0x094a('0x44')]({'where':{'id':_0x14e6c1[_0x094a('0x3f')]['id']}})[_0x094a('0x20')](handleEntityNotFound(_0x2c45a5,null))['then'](removeEntity(_0x2c45a5,null))[_0x094a('0x3d')](handleError(_0x2c45a5,null));};exports['describe']=function(_0x19fd54,_0x46abe7){return db[_0x094a('0x27')]['describe']()[_0x094a('0x20')](respondWithResult(_0x46abe7,null))['catch'](handleError(_0x46abe7,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index a9de8de..6309c6d 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 _0x415c=['path','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5253c8,_0x4697be){var _0x553d58=function(_0x540976){while(--_0x540976){_0x5253c8['push'](_0x5253c8['shift']());}};_0x553d58(++_0x4697be);}(_0x415c,0x89));var _0xc415=function(_0x2b2a57,_0xbd2b24){_0x2b2a57=_0x2b2a57-0x0;var _0x1cfdd2=_0x415c[_0x2b2a57];return _0x1cfdd2;};'use strict';var _=require(_0xc415('0x0'));var util=require(_0xc415('0x1'));var logger=require(_0xc415('0x2'))(_0xc415('0x3'));var moment=require(_0xc415('0x4'));var BPromise=require(_0xc415('0x5'));var rp=require(_0xc415('0x6'));var fs=require('fs');var path=require(_0xc415('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc415('0x8'));module[_0xc415('0x9')]=function(_0x193d46,_0x913429){return _0x193d46['define'](_0xc415('0xa'),attributes,{'tableName':_0xc415('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59e6=['VoiceTransferReport','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define'];(function(_0x676e18,_0x10b8c0){var _0x4c10c9=function(_0x8731f3){while(--_0x8731f3){_0x676e18['push'](_0x676e18['shift']());}};_0x4c10c9(++_0x10b8c0);}(_0x59e6,0x1f0));var _0x659e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x59e6[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x659e('0x0'));var util=require('util');var logger=require(_0x659e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x659e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x659e('0x3'));var rimraf=require(_0x659e('0x4'));var config=require(_0x659e('0x5'));var attributes=require(_0x659e('0x6'));module['exports']=function(_0x5eb499,_0x2afd12){return _0x5eb499[_0x659e('0x7')](_0x659e('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 1b27e0d..ffb0452 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 _0x9ef8=['http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','stringify','lodash','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ef8,0x16b));var _0x89ef=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x9ef8[_0x257b0e];return _0x27ac2a;};'use strict';var _=require(_0x89ef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x89ef('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x89ef('0x2'));var jayson=require(_0x89ef('0x3'));var client=jayson[_0x89ef('0x4')][_0x89ef('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5d1e32,_0x39bcc6,_0x24712f){return new BPromise(function(_0xdca63d,_0x494f2c){return client[_0x89ef('0x6')](_0x5d1e32,_0x24712f)['then'](function(_0x320bd6){logger[_0x89ef('0x7')](_0x89ef('0x8'),_0x39bcc6,_0x89ef('0x9'));logger[_0x89ef('0xa')](_0x89ef('0xb'),_0x39bcc6,_0x89ef('0x9'),JSON['stringify'](_0x320bd6));if(_0x320bd6[_0x89ef('0xc')]){if(_0x320bd6[_0x89ef('0xc')][_0x89ef('0xd')]===0x1f4){logger[_0x89ef('0xc')](_0x89ef('0x8'),_0x39bcc6,_0x320bd6[_0x89ef('0xc')][_0x89ef('0xe')]);return _0x494f2c(_0x320bd6[_0x89ef('0xc')][_0x89ef('0xe')]);}logger[_0x89ef('0xc')](_0x89ef('0x8'),_0x39bcc6,_0x320bd6[_0x89ef('0xc')][_0x89ef('0xe')]);return _0xdca63d(_0x320bd6['error'][_0x89ef('0xe')]);}else{logger[_0x89ef('0x7')](_0x89ef('0x8'),_0x39bcc6,'request\x20sent');_0xdca63d(_0x320bd6[_0x89ef('0xf')][_0x89ef('0xe')]);}})[_0x89ef('0x10')](function(_0x43d4f9){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x39bcc6,_0x43d4f9);_0x494f2c(_0x43d4f9);});});}exports[_0x89ef('0x11')]=function(_0x10a090){var _0x37ae76=this;return new Promise(function(_0x10dc21,_0x2f5bf5){return db[_0x89ef('0x12')][_0x89ef('0x13')](_0x10a090[_0x89ef('0x14')],{'raw':_0x10a090[_0x89ef('0x15')]?_0x10a090[_0x89ef('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x34521f){logger[_0x89ef('0x7')]('CreateVoiceTransferReport',_0x10a090);logger[_0x89ef('0xa')](_0x89ef('0x11'),_0x10a090,JSON[_0x89ef('0x16')](_0x34521f));_0x10dc21(_0x34521f);})[_0x89ef('0x10')](function(_0x285380){logger[_0x89ef('0xc')](_0x89ef('0x11'),_0x285380[_0x89ef('0xe')],_0x10a090);_0x2f5bf5(_0x37ae76[_0x89ef('0xc')](0x1f4,_0x285380[_0x89ef('0xe')]));});});}; \ No newline at end of file +var _0x7386=['code','message','result','VoiceTransferReport','create','body','options','raw','info','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7386,0xe3));var _0x6738=function(_0x559d6c,_0x124742){_0x559d6c=_0x559d6c-0x0;var _0x40efda=_0x7386[_0x559d6c];return _0x40efda;};'use strict';var _=require(_0x6738('0x0'));var util=require(_0x6738('0x1'));var moment=require(_0x6738('0x2'));var BPromise=require(_0x6738('0x3'));var rs=require(_0x6738('0x4'));var fs=require('fs');var Redis=require(_0x6738('0x5'));var db=require(_0x6738('0x6'))['db'];var utils=require(_0x6738('0x7'));var logger=require(_0x6738('0x8'))(_0x6738('0x9'));var config=require('../../config/environment');var jayson=require(_0x6738('0xa'));var client=jayson[_0x6738('0xb')][_0x6738('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c3db6,_0x1c9506,_0x352b10){return new BPromise(function(_0x96ccef,_0x2ca10c){return client[_0x6738('0xd')](_0x1c3db6,_0x352b10)[_0x6738('0xe')](function(_0x3ac59a){logger['info'](_0x6738('0xf'),_0x1c9506,'request\x20sent');logger[_0x6738('0x10')](_0x6738('0x11'),_0x1c9506,_0x6738('0x12'),JSON[_0x6738('0x13')](_0x3ac59a));if(_0x3ac59a[_0x6738('0x14')]){if(_0x3ac59a['error'][_0x6738('0x15')]===0x1f4){logger['error'](_0x6738('0xf'),_0x1c9506,_0x3ac59a[_0x6738('0x14')]['message']);return _0x2ca10c(_0x3ac59a[_0x6738('0x14')][_0x6738('0x16')]);}logger[_0x6738('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x1c9506,_0x3ac59a[_0x6738('0x14')][_0x6738('0x16')]);return _0x96ccef(_0x3ac59a[_0x6738('0x14')][_0x6738('0x16')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1c9506,'request\x20sent');_0x96ccef(_0x3ac59a[_0x6738('0x17')][_0x6738('0x16')]);}})['catch'](function(_0x417a81){logger[_0x6738('0x14')](_0x6738('0xf'),_0x1c9506,_0x417a81);_0x2ca10c(_0x417a81);});});}exports['CreateVoiceTransferReport']=function(_0x77586b){var _0x55a1b8=this;return new Promise(function(_0x5f0258,_0x41ef78){return db[_0x6738('0x18')][_0x6738('0x19')](_0x77586b[_0x6738('0x1a')],{'raw':_0x77586b[_0x6738('0x1b')]?_0x77586b[_0x6738('0x1b')][_0x6738('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4c4b73){logger[_0x6738('0x1d')](_0x6738('0x1e'),_0x77586b);logger[_0x6738('0x10')](_0x6738('0x1e'),_0x77586b,JSON['stringify'](_0x4c4b73));_0x5f0258(_0x4c4b73);})['catch'](function(_0x17e671){logger[_0x6738('0x14')](_0x6738('0x1e'),_0x17e671['message'],_0x77586b);_0x41ef78(_0x55a1b8[_0x6738('0x14')](0x1f4,_0x17e671[_0x6738('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 8a473b9..8814b54 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 _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x585e84,_0x1d8489){var _0x39f3c4=function(_0x1855a3){while(--_0x1855a3){_0x585e84['push'](_0x585e84['shift']());}};_0x39f3c4(++_0x1d8489);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1558b8,_0x4fe768){_0x1558b8=_0x1558b8-0x0;var _0x16a596=_0xe5b3[_0x1558b8];return _0x16a596;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x1f78f1,_0x999b5){var _0x37f1da=function(_0xcaeb2b){while(--_0xcaeb2b){_0x1f78f1['push'](_0x1f78f1['shift']());}};_0x37f1da(++_0x999b5);}(_0xdace,0xc5));var _0xedac=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xdace[_0x1b5aea];return _0x15cfc6;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index c45db59..e77d514 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 _0x3685=['UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','stack','send','name','NotFound','request','then','error','code','message','result','catch','findOne','agent','VoiceChannels','all','filter','rows','sessionId','length','sessionId\x20','originate','body','status','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x3685,0xf8));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var path=require(_0x5368('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x5368('0x1'))['db'];var config=require(_0x5368('0x2'));var util=require(_0x5368('0x3'));var BPromise=require(_0x5368('0x4'));var jayson=require(_0x5368('0x5'));var amiClient=jayson[_0x5368('0x6')][_0x5368('0x7')]({'port':0x232a});var logger=require(_0x5368('0x8'))(_0x5368('0x9'));var Redis=require(_0x5368('0xa'));config['redis']=_[_0x5368('0xb')](config[_0x5368('0xc')],{'host':_0x5368('0xd'),'port':0x18eb});var io=require(_0x5368('0xe'))(new Redis(config['redis']));var Schema=require(_0x5368('0xf'));var originateValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'callNumber':{'type':_0x5368('0x12'),'required':[!![],_0x5368('0x13')]},'callerId':{'type':_0x5368('0x12')},'callbackUrl':{'type':_0x5368('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5368('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x5368('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':_0x5368('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':_0x5368('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x41ce0e,_0x183041,_0x59c422){logger[_0x5368('0x15')](_0x41ce0e,_0x183041,JSON[_0x5368('0x16')](_0x59c422));io['to'](_0x41ce0e)[_0x5368('0x17')](_0x183041,_0x59c422);}function handleError(_0x24a4b3){return function(_0x5b10e9){console[_0x5368('0x18')]('handleError:',_0x5b10e9,_0x5b10e9 instanceof RangeError);logger['error'](_0x5b10e9[_0x5368('0x19')]);if(_0x5b10e9 instanceof RangeError){if(_0x5b10e9['name']){delete _0x5b10e9['name'];}_0x24a4b3['status'](0x194)[_0x5368('0x1a')](_0x5b10e9);}else{if(_0x5b10e9[_0x5368('0x1b')]){delete _0x5b10e9[_0x5368('0x1b')];}_0x24a4b3['status'](0x1f4)['send'](_0x5b10e9);}};}function checkError(){return function(_0x2f21fc){if(!_0x2f21fc){throw new RangeError(_0x5368('0x1c'));}return _0x2f21fc;};}function respondWithRpcPromise(_0x14b6bd,_0x38f367){return new BPromise(function(_0x1c2fcd,_0x1093e2){var _0x4885d0=amiClient;return _0x4885d0[_0x5368('0x1d')](_0x14b6bd,_0x38f367)[_0x5368('0x1e')](function(_0x4705f2){if(_0x4705f2['error']){if(_0x4705f2[_0x5368('0x1f')][_0x5368('0x20')]===0x1f4){return _0x1093e2(_0x4705f2[_0x5368('0x1f')][_0x5368('0x21')]);}return _0x1c2fcd(_0x4705f2[_0x5368('0x1f')][_0x5368('0x21')]);}else{_0x1c2fcd(_0x4705f2[_0x5368('0x22')]);}})[_0x5368('0x23')](function(_0x47c30f){_0x1093e2(_0x47c30f);});});}function getAgent(_0x569d81){return db['User'][_0x5368('0x24')]({'where':{'id':_0x569d81,'role':_0x5368('0x25')}})[_0x5368('0x1e')](checkError());}function getAgentCheckSession(_0x452c81,_0x131722){return new BPromise(function(_0x4b94cd,_0x725f8e){var _0x200ad0=respondWithRpcPromise(_0x5368('0x26'));var _0x2bcf41=getAgent(_0x452c81);Promise[_0x5368('0x27')]([_0x200ad0,_0x2bcf41])[_0x5368('0x1e')](function(_0x3d40de){var _0x2963a6=_0x3d40de[0x0];var _0x3681e6=_0x3d40de[0x1];var _0x3c8ae1=_[_0x5368('0x28')](_0x2963a6[_0x5368('0x29')],function(_0x7449cd){return _0x7449cd['UserId']==_0x3681e6['id']&&_0x7449cd[_0x5368('0x2a')]==_0x131722;});if(_0x3c8ae1[_0x5368('0x2b')]==0x1){_0x4b94cd(_0x3681e6);}else{_0x725f8e(new RangeError(_0x5368('0x2c')+_0x131722+'\x20not\x20found!'));}});});}exports[_0x5368('0x2d')]=function(_0x50131a,_0x26fc48){logger[_0x5368('0x15')]('originate\x20fired:',_0x50131a[_0x5368('0x2e')]);var _0x1ce386=originateValidation['validate'](_0x50131a['body']);if(_0x1ce386[_0x5368('0x2b')]>0x0){return _0x26fc48[_0x5368('0x2f')](0x190)['json'](_0x1ce386);}var _0x46169e=_0x50131a[_0x5368('0x2e')][_0x5368('0x30')];var _0x4dc0ee=_0x50131a[_0x5368('0x2e')]['callNumber'];var _0x22b489=_0x50131a[_0x5368('0x2e')][_0x5368('0x31')];var _0x5f44d2=_0x50131a[_0x5368('0x2e')][_0x5368('0x32')];return getAgent(_0x46169e)[_0x5368('0x1e')](function(_0x2a3bed){logger['info'](_0x5368('0x33'),_0x2a3bed['name']);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x2a3bed['name']),_0x5368('0x36'),{'callNumber':_0x4dc0ee,'callerId':_0x22b489,'callbackUrl':_0x5f44d2});return _0x26fc48[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':_0x5368('0x38')});})['catch'](handleError(_0x26fc48));};exports[_0x5368('0x39')]=function(_0x19de44,_0x7b30ae){logger[_0x5368('0x15')](_0x5368('0x3a'),_0x19de44['body']);var _0x1183a1=hangupValidation[_0x5368('0xf')](_0x19de44['body']);if(_0x1183a1[_0x5368('0x2b')]>0x0){return _0x7b30ae[_0x5368('0x2f')](0x190)[_0x5368('0x37')](_0x1183a1);}var _0x5e796f=_0x19de44[_0x5368('0x2e')][_0x5368('0x30')];var _0x1f23cc=_0x19de44[_0x5368('0x2e')]['sessionId'];return getAgent(_0x5e796f)['then'](function(_0x1be46a){logger[_0x5368('0x15')](_0x5368('0x33'),_0x1be46a['name']);emit(util['format'](_0x5368('0x35'),_0x1be46a['name']),_0x5368('0x3b'),{'sessionId':_0x1f23cc});return _0x7b30ae[_0x5368('0x2f')](0xc8)['json']({'error':![],'message':_0x5368('0x3c')});})[_0x5368('0x23')](handleError(_0x7b30ae));};exports[_0x5368('0x3d')]=function(_0xed1792,_0x2e1acc){logger[_0x5368('0x15')](_0x5368('0x3e'),_0xed1792[_0x5368('0x2e')]);var _0x48c86=answerValidation[_0x5368('0xf')](_0xed1792[_0x5368('0x2e')]);if(_0x48c86[_0x5368('0x2b')]>0x0){return _0x2e1acc['status'](0x190)[_0x5368('0x37')](_0x48c86);}var _0x61b1a1=_0xed1792[_0x5368('0x2e')]['userId'];var _0x1b66a1=_0xed1792[_0x5368('0x2e')]['sessionId'];return getAgent(_0x61b1a1)[_0x5368('0x1e')](function(_0x6f6dc4){logger[_0x5368('0x15')](_0x5368('0x33'),_0x6f6dc4[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x6f6dc4[_0x5368('0x1b')]),_0x5368('0x3f'),{'sessionId':_0x1b66a1});return _0x2e1acc[_0x5368('0x2f')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x5368('0x23')](handleError(_0x2e1acc));};exports[_0x5368('0x40')]=function(_0x3eb1d0,_0x20f041){logger['info']('hold\x20fired:',_0x3eb1d0[_0x5368('0x2e')]);var _0x5577b3=holdValidation[_0x5368('0xf')](_0x3eb1d0['body']);if(_0x5577b3[_0x5368('0x2b')]>0x0){return _0x20f041['status'](0x190)[_0x5368('0x37')](_0x5577b3);}var _0x244724=_0x3eb1d0['body']['userId'];var _0x3e9ac0=_0x3eb1d0['body'][_0x5368('0x2a')];return getAgent(_0x244724)[_0x5368('0x1e')](function(_0x2ee00b){logger[_0x5368('0x15')]('entityFound:',_0x2ee00b[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x2ee00b[_0x5368('0x1b')]),_0x5368('0x41'),{'sessionId':_0x3e9ac0});return _0x20f041[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x20f041));};exports[_0x5368('0x42')]=function(_0x7d7a5,_0x367a7d){logger['info'](_0x5368('0x43'),_0x7d7a5[_0x5368('0x2e')]);var _0x1791d4=unholdValidation[_0x5368('0xf')](_0x7d7a5[_0x5368('0x2e')]);if(_0x1791d4[_0x5368('0x2b')]>0x0){return _0x367a7d[_0x5368('0x2f')](0x190)[_0x5368('0x37')](_0x1791d4);}var _0x539911=_0x7d7a5[_0x5368('0x2e')][_0x5368('0x30')];var _0x32aa43=_0x7d7a5[_0x5368('0x2e')]['sessionId'];return getAgent(_0x539911)[_0x5368('0x1e')](function(_0x9775f8){logger[_0x5368('0x15')](_0x5368('0x33'),_0x9775f8[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x9775f8[_0x5368('0x1b')]),_0x5368('0x44'),{'sessionId':_0x32aa43});return _0x367a7d[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':_0x5368('0x45')});})[_0x5368('0x23')](handleError(_0x367a7d));};exports[_0x5368('0x46')]=function(_0x5adefd,_0x1ea85e){logger[_0x5368('0x15')](_0x5368('0x47'),_0x1ea85e[_0x5368('0x2e')]);var _0x2688a9=callsValidation[_0x5368('0xf')](_0x5adefd['body']);if(_0x2688a9[_0x5368('0x2b')]>0x0){return _0x1ea85e['status'](0x190)[_0x5368('0x37')](_0x2688a9);}var _0x139b0d=_0x5adefd[_0x5368('0x2e')][_0x5368('0x30')];var _0xe348e1=respondWithRpcPromise(_0x5368('0x26'));var _0x170ecd=getAgent(_0x139b0d);return Promise['all']([_0xe348e1,_0x170ecd])[_0x5368('0x1e')](function(_0xcec819){var _0x45bba1=_0xcec819[0x0];var _0x3822ff=_0xcec819[0x1];var _0xf127d0=_[_0x5368('0x28')](_0x45bba1[_0x5368('0x29')],function(_0x128812){return _0x128812[_0x5368('0x48')]==_0x3822ff['id'];});return _0x1ea85e[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'count':_0xf127d0[_0x5368('0x2b')],'rows':_0xf127d0});})[_0x5368('0x23')](handleError(_0x1ea85e));};exports['conference']=function(_0x4fa56e,_0x5b741a){logger[_0x5368('0x15')](_0x5368('0x49'),_0x4fa56e[_0x5368('0x2e')]);var _0x2b7fa9=conferenceValidation['validate'](_0x4fa56e['body']);if(_0x2b7fa9[_0x5368('0x2b')]>0x0){return _0x5b741a[_0x5368('0x2f')](0x190)[_0x5368('0x37')](_0x2b7fa9);}var _0x4d1793=_0x4fa56e[_0x5368('0x2e')]['userId'];return getAgent(_0x4d1793)[_0x5368('0x1e')](function(_0x449972){logger[_0x5368('0x15')](_0x5368('0x33'),_0x449972[_0x5368('0x1b')]);emit(util['format'](_0x5368('0x35'),_0x449972[_0x5368('0x1b')]),_0x5368('0x4a'));return _0x5b741a['status'](0xc8)['json']({'error':![],'message':_0x5368('0x4b')});})[_0x5368('0x23')](handleError(_0x5b741a));};exports['transfer']=function(_0x591c07,_0x26d09c){logger[_0x5368('0x15')](_0x5368('0x4c'),_0x591c07[_0x5368('0x2e')]);var _0x2b5cb3=transferValidation[_0x5368('0xf')](_0x591c07[_0x5368('0x2e')]);if(_0x2b5cb3[_0x5368('0x2b')]>0x0){return _0x26d09c['status'](0x190)[_0x5368('0x37')](_0x2b5cb3);}var _0x5a70f4=_0x591c07[_0x5368('0x2e')][_0x5368('0x30')];var _0x1c2da8=_0x591c07['body'][_0x5368('0x2a')];var _0x242a9a=_0x591c07[_0x5368('0x2e')][_0x5368('0x4d')];return getAgent(_0x5a70f4)[_0x5368('0x1e')](function(_0x3f10b2){logger[_0x5368('0x15')](_0x5368('0x33'),_0x3f10b2[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x3f10b2[_0x5368('0x1b')]),_0x5368('0x4e'),{'sessionId':_0x1c2da8,'transferNumber':_0x242a9a});return _0x26d09c[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':_0x5368('0x4f')});})[_0x5368('0x23')](handleError(_0x26d09c));}; \ No newline at end of file +var _0xe28e=['../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','handleError:','stack','name','send','status','NotFound','request','error','code','message','result','catch','findOne','VoiceChannels','all','then','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','body','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','originate\x20executed!','hangup','hangup\x20fired:','userId','format','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','webbar:unhold','calls','rows','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','transferNumber','path','lodash'];(function(_0x422047,_0x412f46){var _0x2667dc=function(_0x405211){while(--_0x405211){_0x422047['push'](_0x422047['shift']());}};_0x2667dc(++_0x412f46);}(_0xe28e,0x1ba));var _0xee28=function(_0x5ae511,_0x1a0a2e){_0x5ae511=_0x5ae511-0x0;var _0x533a39=_0xe28e[_0x5ae511];return _0x533a39;};'use strict';var path=require(_0xee28('0x0'));var fs=require('fs');var _=require(_0xee28('0x1'));var db=require(_0xee28('0x2'))['db'];var config=require(_0xee28('0x3'));var util=require(_0xee28('0x4'));var BPromise=require(_0xee28('0x5'));var jayson=require(_0xee28('0x6'));var amiClient=jayson[_0xee28('0x7')][_0xee28('0x8')]({'port':0x232a});var logger=require(_0xee28('0x9'))(_0xee28('0xa'));var Redis=require(_0xee28('0xb'));config[_0xee28('0xc')]=_['defaults'](config[_0xee28('0xc')],{'host':_0xee28('0xd'),'port':0x18eb});var io=require(_0xee28('0xe'))(new Redis(config[_0xee28('0xc')]));var Schema=require(_0xee28('0xf'));var originateValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0xee28('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':[!![],_0xee28('0x13')]},'transferNumber':{'type':_0xee28('0x12'),'required':[!![],_0xee28('0x14')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]},'sessionId':{'type':_0xee28('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xee28('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xee28('0x10'),'required':[!![],_0xee28('0x11')]}});function emit(_0x343358,_0x1ff99e,_0x11c95d){logger['info'](_0x343358,_0x1ff99e,JSON[_0xee28('0x15')](_0x11c95d));io['to'](_0x343358)['emit'](_0x1ff99e,_0x11c95d);}function handleError(_0x37e429){return function(_0x19472a){console['log'](_0xee28('0x16'),_0x19472a,_0x19472a instanceof RangeError);logger['error'](_0x19472a[_0xee28('0x17')]);if(_0x19472a instanceof RangeError){if(_0x19472a['name']){delete _0x19472a[_0xee28('0x18')];}_0x37e429['status'](0x194)[_0xee28('0x19')](_0x19472a);}else{if(_0x19472a['name']){delete _0x19472a[_0xee28('0x18')];}_0x37e429[_0xee28('0x1a')](0x1f4)[_0xee28('0x19')](_0x19472a);}};}function checkError(){return function(_0x3674c7){if(!_0x3674c7){throw new RangeError(_0xee28('0x1b'));}return _0x3674c7;};}function respondWithRpcPromise(_0x1280f5,_0x2dbd49){return new BPromise(function(_0x4bda53,_0x342798){var _0x44d7ff=amiClient;return _0x44d7ff[_0xee28('0x1c')](_0x1280f5,_0x2dbd49)['then'](function(_0x5b500b){if(_0x5b500b[_0xee28('0x1d')]){if(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1e')]===0x1f4){return _0x342798(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1f')]);}return _0x4bda53(_0x5b500b[_0xee28('0x1d')][_0xee28('0x1f')]);}else{_0x4bda53(_0x5b500b[_0xee28('0x20')]);}})[_0xee28('0x21')](function(_0x733ca8){_0x342798(_0x733ca8);});});}function getAgent(_0x281c8a){return db['User'][_0xee28('0x22')]({'where':{'id':_0x281c8a,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x54528b,_0x587aac){return new BPromise(function(_0x51eae7,_0x8373a7){var _0x884e7d=respondWithRpcPromise(_0xee28('0x23'));var _0x469889=getAgent(_0x54528b);Promise[_0xee28('0x24')]([_0x884e7d,_0x469889])[_0xee28('0x25')](function(_0xbafd67){var _0x4fcc8f=_0xbafd67[0x0];var _0x84e0ba=_0xbafd67[0x1];var _0x7390dc=_[_0xee28('0x26')](_0x4fcc8f['rows'],function(_0x14f7c4){return _0x14f7c4[_0xee28('0x27')]==_0x84e0ba['id']&&_0x14f7c4[_0xee28('0x28')]==_0x587aac;});if(_0x7390dc[_0xee28('0x29')]==0x1){_0x51eae7(_0x84e0ba);}else{_0x8373a7(new RangeError(_0xee28('0x2a')+_0x587aac+_0xee28('0x2b')));}});});}exports[_0xee28('0x2c')]=function(_0x5d2a9d,_0x15f294){logger[_0xee28('0x2d')]('originate\x20fired:',_0x5d2a9d[_0xee28('0x2e')]);var _0x34dd11=originateValidation[_0xee28('0xf')](_0x5d2a9d[_0xee28('0x2e')]);if(_0x34dd11[_0xee28('0x29')]>0x0){return _0x15f294[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x34dd11);}var _0x5a4f48=_0x5d2a9d['body']['userId'];var _0x1a8ef0=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x30')];var _0x3402ce=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x31')];var _0x5b0c20=_0x5d2a9d[_0xee28('0x2e')][_0xee28('0x32')];return getAgent(_0x5a4f48)['then'](function(_0x51b28d){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x51b28d['name']);emit(util['format'](_0xee28('0x34'),_0x51b28d[_0xee28('0x18')]),'webbar:originate',{'callNumber':_0x1a8ef0,'callerId':_0x3402ce,'callbackUrl':_0x5b0c20});return _0x15f294[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x35')});})[_0xee28('0x21')](handleError(_0x15f294));};exports[_0xee28('0x36')]=function(_0x594116,_0x2a5d06){logger[_0xee28('0x2d')](_0xee28('0x37'),_0x594116[_0xee28('0x2e')]);var _0x43b587=hangupValidation[_0xee28('0xf')](_0x594116['body']);if(_0x43b587[_0xee28('0x29')]>0x0){return _0x2a5d06['status'](0x190)['json'](_0x43b587);}var _0x265ae5=_0x594116['body'][_0xee28('0x38')];var _0x5c5f08=_0x594116[_0xee28('0x2e')]['sessionId'];return getAgent(_0x265ae5)[_0xee28('0x25')](function(_0x211345){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x211345['name']);emit(util[_0xee28('0x39')]('user:%s',_0x211345[_0xee28('0x18')]),_0xee28('0x3a'),{'sessionId':_0x5c5f08});return _0x2a5d06[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x3b')});})[_0xee28('0x21')](handleError(_0x2a5d06));};exports[_0xee28('0x3c')]=function(_0x5a4b9c,_0x4d9d21){logger[_0xee28('0x2d')]('answer\x20fired:',_0x5a4b9c['body']);var _0x4064cf=answerValidation[_0xee28('0xf')](_0x5a4b9c['body']);if(_0x4064cf[_0xee28('0x29')]>0x0){return _0x4d9d21[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x4064cf);}var _0x24cfaa=_0x5a4b9c[_0xee28('0x2e')][_0xee28('0x38')];var _0x1735a9=_0x5a4b9c['body'][_0xee28('0x28')];return getAgent(_0x24cfaa)[_0xee28('0x25')](function(_0x2dd024){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x2dd024['name']);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x2dd024['name']),_0xee28('0x3d'),{'sessionId':_0x1735a9});return _0x4d9d21[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x3e')});})[_0xee28('0x21')](handleError(_0x4d9d21));};exports[_0xee28('0x3f')]=function(_0x54ab7b,_0x36e5bb){logger['info']('hold\x20fired:',_0x54ab7b[_0xee28('0x2e')]);var _0x2f240f=holdValidation['validate'](_0x54ab7b[_0xee28('0x2e')]);if(_0x2f240f[_0xee28('0x29')]>0x0){return _0x36e5bb[_0xee28('0x1a')](0x190)['json'](_0x2f240f);}var _0x57e57e=_0x54ab7b[_0xee28('0x2e')][_0xee28('0x38')];var _0x1bb1ac=_0x54ab7b[_0xee28('0x2e')][_0xee28('0x28')];return getAgent(_0x57e57e)[_0xee28('0x25')](function(_0x2574c5){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x2574c5[_0xee28('0x18')]);emit(util['format'](_0xee28('0x34'),_0x2574c5['name']),_0xee28('0x40'),{'sessionId':_0x1bb1ac});return _0x36e5bb[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':_0xee28('0x41')});})[_0xee28('0x21')](handleError(_0x36e5bb));};exports['unhold']=function(_0x5247fe,_0x5ca018){logger[_0xee28('0x2d')]('unhold\x20fired:',_0x5247fe['body']);var _0x659fc4=unholdValidation['validate'](_0x5247fe[_0xee28('0x2e')]);if(_0x659fc4[_0xee28('0x29')]>0x0){return _0x5ca018[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x659fc4);}var _0x398120=_0x5247fe[_0xee28('0x2e')][_0xee28('0x38')];var _0xc1bdba=_0x5247fe[_0xee28('0x2e')][_0xee28('0x28')];return getAgent(_0x398120)['then'](function(_0x1f3680){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x1f3680['name']);emit(util['format']('user:%s',_0x1f3680['name']),_0xee28('0x42'),{'sessionId':_0xc1bdba});return _0x5ca018[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':'unhold\x20executed!'});})[_0xee28('0x21')](handleError(_0x5ca018));};exports[_0xee28('0x43')]=function(_0x204bbe,_0x39b228){logger[_0xee28('0x2d')]('calls\x20fired:',_0x39b228[_0xee28('0x2e')]);var _0x1c6696=callsValidation[_0xee28('0xf')](_0x204bbe['body']);if(_0x1c6696[_0xee28('0x29')]>0x0){return _0x39b228[_0xee28('0x1a')](0x190)[_0xee28('0x2f')](_0x1c6696);}var _0x47794a=_0x204bbe[_0xee28('0x2e')][_0xee28('0x38')];var _0xfcca7e=respondWithRpcPromise('VoiceChannels');var _0x161394=getAgent(_0x47794a);return Promise['all']([_0xfcca7e,_0x161394])['then'](function(_0x5b7292){var _0x333d7e=_0x5b7292[0x0];var _0x7c51d5=_0x5b7292[0x1];var _0x3cad0a=_[_0xee28('0x26')](_0x333d7e[_0xee28('0x44')],function(_0x27d96d){return _0x27d96d[_0xee28('0x27')]==_0x7c51d5['id'];});return _0x39b228[_0xee28('0x1a')](0xc8)['json']({'count':_0x3cad0a[_0xee28('0x29')],'rows':_0x3cad0a});})[_0xee28('0x21')](handleError(_0x39b228));};exports[_0xee28('0x45')]=function(_0x2b8252,_0x209c3e){logger[_0xee28('0x2d')](_0xee28('0x46'),_0x2b8252['body']);var _0x438943=conferenceValidation['validate'](_0x2b8252[_0xee28('0x2e')]);if(_0x438943[_0xee28('0x29')]>0x0){return _0x209c3e['status'](0x190)[_0xee28('0x2f')](_0x438943);}var _0x2a5fa7=_0x2b8252[_0xee28('0x2e')][_0xee28('0x38')];return getAgent(_0x2a5fa7)['then'](function(_0x209d6d){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x209d6d[_0xee28('0x18')]);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x209d6d[_0xee28('0x18')]),'webbar:conference');return _0x209c3e[_0xee28('0x1a')](0xc8)['json']({'error':![],'message':_0xee28('0x47')});})[_0xee28('0x21')](handleError(_0x209c3e));};exports['transfer']=function(_0x4b222a,_0x14bc7a){logger['info'](_0xee28('0x48'),_0x4b222a[_0xee28('0x2e')]);var _0x19f81a=transferValidation[_0xee28('0xf')](_0x4b222a[_0xee28('0x2e')]);if(_0x19f81a[_0xee28('0x29')]>0x0){return _0x14bc7a[_0xee28('0x1a')](0x190)['json'](_0x19f81a);}var _0x179ce6=_0x4b222a[_0xee28('0x2e')][_0xee28('0x38')];var _0x57ded5=_0x4b222a[_0xee28('0x2e')][_0xee28('0x28')];var _0x1e190f=_0x4b222a[_0xee28('0x2e')][_0xee28('0x49')];return getAgent(_0x179ce6)[_0xee28('0x25')](function(_0x5dc31e){logger[_0xee28('0x2d')](_0xee28('0x33'),_0x5dc31e[_0xee28('0x18')]);emit(util[_0xee28('0x39')](_0xee28('0x34'),_0x5dc31e[_0xee28('0x18')]),'webbar:transfer',{'sessionId':_0x57ded5,'transferNumber':_0x1e190f});return _0x14bc7a[_0xee28('0x1a')](0xc8)[_0xee28('0x2f')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x14bc7a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index cc841d1..cc39df5 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 _0xcf00=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','put','destroy','delete','removeDispositions','exports','multer','util','connect-timeout','express','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x2e9b52,_0xa78f14){var _0x3af4e9=function(_0xa6b2d4){while(--_0xa6b2d4){_0x2e9b52['push'](_0x2e9b52['shift']());}};_0x3af4e9(++_0xa78f14);}(_0xcf00,0x133));var _0x0cf0=function(_0x2eade5,_0x5593b8){_0x2eade5=_0x2eade5-0x0;var _0x1e9966=_0xcf00[_0x2eade5];return _0x1e9966;};'use strict';var multer=require(_0x0cf0('0x0'));var util=require(_0x0cf0('0x1'));var path=require('path');var timeout=require(_0x0cf0('0x2'));var express=require(_0x0cf0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cf0('0x4'));var controller=require(_0x0cf0('0x5'));router[_0x0cf0('0x6')]('/',auth[_0x0cf0('0x7')](),controller['index']);router['get'](_0x0cf0('0x8'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x9')]);router['get'](_0x0cf0('0xa'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0xb')]);router[_0x0cf0('0x6')](_0x0cf0('0xc'),auth[_0x0cf0('0x7')](),controller['getDispositions']);router[_0x0cf0('0x6')](_0x0cf0('0xd'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0xe')]);router[_0x0cf0('0x6')](_0x0cf0('0xf'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x10')]);router['get'](_0x0cf0('0x11'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x12')]);router[_0x0cf0('0x13')]('/',auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x14')]);router[_0x0cf0('0x13')]('/:id/dispositions',auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x15')]);router[_0x0cf0('0x13')](_0x0cf0('0xd'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x16')]);router[_0x0cf0('0x13')](_0x0cf0('0xf'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x17')]);router[_0x0cf0('0x13')](_0x0cf0('0x11'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x18')]);router['post'](_0x0cf0('0x19'),controller[_0x0cf0('0x1a')]);router[_0x0cf0('0x13')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x0cf0('0x1b')](_0x0cf0('0xa'),auth[_0x0cf0('0x7')](),controller['update']);router['delete']('/:id',auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x1c')]);router[_0x0cf0('0x1d')](_0x0cf0('0xc'),auth[_0x0cf0('0x7')](),controller[_0x0cf0('0x1e')]);router['delete'](_0x0cf0('0xd'),auth[_0x0cf0('0x7')](),controller['removeAnswers']);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x0cf0('0x1f')]=router; \ No newline at end of file +var _0xb3be=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','getApplications','post','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','get','/:id'];(function(_0x17aa06,_0x245bf9){var _0x5b61f4=function(_0x13e9ef){while(--_0x13e9ef){_0x17aa06['push'](_0x17aa06['shift']());}};_0x5b61f4(++_0x245bf9);}(_0xb3be,0x137));var _0xeb3b=function(_0x1c86e0,_0x30b6af){_0x1c86e0=_0x1c86e0-0x0;var _0x14a1b5=_0xb3be[_0x1c86e0];return _0x14a1b5;};'use strict';var multer=require(_0xeb3b('0x0'));var util=require(_0xeb3b('0x1'));var path=require(_0xeb3b('0x2'));var timeout=require(_0xeb3b('0x3'));var express=require(_0xeb3b('0x4'));var router=express[_0xeb3b('0x5')]();var fs_extra=require(_0xeb3b('0x6'));var auth=require(_0xeb3b('0x7'));var interaction=require(_0xeb3b('0x8'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xeb3b('0x9')](),controller['index']);router['get'](_0xeb3b('0xa'),auth[_0xeb3b('0x9')](),controller['describe']);router[_0xeb3b('0xb')](_0xeb3b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xeb3b('0xb')](_0xeb3b('0xd'),auth['isAuthenticated'](),controller[_0xeb3b('0xe')]);router['get'](_0xeb3b('0xf'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x10')]);router['get'](_0xeb3b('0x11'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x12')]);router[_0xeb3b('0xb')]('/:id/applications',auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x13')]);router[_0xeb3b('0x14')]('/',auth[_0xeb3b('0x9')](),controller['create']);router[_0xeb3b('0x14')](_0xeb3b('0xd'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x15')]);router[_0xeb3b('0x14')](_0xeb3b('0xf'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x16')]);router['post'](_0xeb3b('0x11'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x17')]);router[_0xeb3b('0x14')](_0xeb3b('0x18'),auth['isAuthenticated'](),controller[_0xeb3b('0x19')]);router[_0xeb3b('0x14')](_0xeb3b('0x1a'),controller[_0xeb3b('0x1b')]);router[_0xeb3b('0x14')](_0xeb3b('0x1c'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x1d')]);router[_0xeb3b('0x1e')](_0xeb3b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xeb3b('0x1f')](_0xeb3b('0xc'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x20')]);router[_0xeb3b('0x1f')](_0xeb3b('0xd'),auth[_0xeb3b('0x9')](),controller[_0xeb3b('0x21')]);router[_0xeb3b('0x1f')](_0xeb3b('0xf'),auth['isAuthenticated'](),controller[_0xeb3b('0x22')]);router[_0xeb3b('0x1f')](_0xeb3b('0x11'),auth[_0xeb3b('0x9')](),controller['removeAgents']);module[_0xeb3b('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 1427a54..7d841ca 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 _0x5924=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','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'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x5924,0xb6));var _0x4592=function(_0x2d1cf4,_0x2ea9ee){_0x2d1cf4=_0x2d1cf4-0x0;var _0x554a7c=_0x5924[_0x2d1cf4];return _0x554a7c;};'use strict';var Sequelize=require(_0x4592('0x0'));var rs=require('randomstring');module[_0x4592('0x1')]={'name':{'type':Sequelize[_0x4592('0x2')],'unique':_0x4592('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x4592('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x4592('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x4592('0x2')],'defaultValue':function(){return rs[_0x4592('0x4')]();}},'phone':{'type':Sequelize[_0x4592('0x2')]},'type':{'type':Sequelize[_0x4592('0x5')](_0x4592('0x6'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4592('0x7')],'defaultValue':function(){return _0x4592('0x8');}},'notificationSound':{'type':Sequelize[_0x4592('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4592('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4592('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4592('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4592('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4592('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4592('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4592('0xa')],'comment':_0x4592('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x4592('0x9')],'defaultValue':![],'comment':_0x4592('0xc'),'set':function(_0x5be030){if(!_0x5be030){this['setDataValue'](_0x4592('0xd'),null);}this['setDataValue'](_0x4592('0xe'),_0x5be030);}},'description':{'type':Sequelize[_0x4592('0x2')]}}; \ No newline at end of file +var _0xc9c7=['randomstring','STRING','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xc9c7,0x150));var _0x7c9c=function(_0x30aedf,_0x3e274d){_0x30aedf=_0x30aedf-0x0;var _0x44757e=_0xc9c7[_0x30aedf];return _0x44757e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x7c9c('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c9c('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x7c9c('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x7c9c('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x7c9c('0x1')]},'type':{'type':Sequelize[_0x7c9c('0x2')](_0x7c9c('0x3'),_0x7c9c('0x4'))},'accountSid':{'type':Sequelize[_0x7c9c('0x1')]},'baseUrl':{'type':Sequelize[_0x7c9c('0x1')]},'authToken':{'type':Sequelize[_0x7c9c('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7c9c('0x5');}},'notificationSound':{'type':Sequelize[_0x7c9c('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7c9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7c9c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7c9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c9c('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7c9c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7c9c('0x6')],'defaultValue':![],'comment':_0x7c9c('0x9'),'set':function(_0x313077){if(!_0x313077){this['setDataValue'](_0x7c9c('0xa'),null);}this[_0x7c9c('0xb')]('mandatoryDisposition',_0x313077);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 2f296ec..555bf60 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 _0x30e4=['http','request','then','info','request\x20sent','error','message','WhatsappAccount,\x20%s,\x20%s','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','index','Pause','WhatsappAccount','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','findAndCountAll','finally','send','json','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','WhatsappInteraction','interaction','autoclose','applications','push','close','unmanaged','created','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','waitForTheAssignedQueue','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','client'];(function(_0x36cd93,_0x593481){var _0x10f6cd=function(_0x1c3aa3){while(--_0x1c3aa3){_0x36cd93['push'](_0x36cd93['shift']());}};_0x10f6cd(++_0x593481);}(_0x30e4,0xa7));var _0x430e=function(_0xc7a90c,_0x5e32ef){_0xc7a90c=_0xc7a90c-0x0;var _0x3a6fc0=_0x30e4[_0xc7a90c];return _0x3a6fc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x430e('0x0'));var zipdir=require(_0x430e('0x1'));var jsonpatch=require(_0x430e('0x2'));var rp=require('request-promise');var moment=require(_0x430e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x430e('0x4'));var util=require(_0x430e('0x5'));var path=require(_0x430e('0x6'));var sox=require(_0x430e('0x7'));var csv=require(_0x430e('0x8'));var ejs=require(_0x430e('0x9'));var fs=require('fs');var fs_extra=require(_0x430e('0xa'));var _=require(_0x430e('0xb'));var squel=require(_0x430e('0xc'));var crypto=require(_0x430e('0xd'));var jsforce=require(_0x430e('0xe'));var deskjs=require(_0x430e('0xf'));var toCsv=require(_0x430e('0x8'));var querystring=require(_0x430e('0x10'));var Papa=require(_0x430e('0x11'));var Redis=require(_0x430e('0x12'));var authService=require(_0x430e('0x13'));var qs=require(_0x430e('0x14'));var as=require(_0x430e('0x15'));var hardwareService=require(_0x430e('0x16'));var logger=require(_0x430e('0x17'))(_0x430e('0x18'));var utils=require(_0x430e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x430e('0x1a'))['db'];config[_0x430e('0x1b')]=_[_0x430e('0x1c')](config['redis'],{'host':_0x430e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x430e('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x430e('0x1f')][_0x430e('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5e9cdc,_0x1d210e,_0x35ae52,_0x15c426){return new BPromise(function(_0x1a0a42,_0x3c7340){var _0x579228=_0x15c426||client;return _0x579228[_0x430e('0x21')](_0x5e9cdc,_0x35ae52)[_0x430e('0x22')](function(_0x1135a7){logger[_0x430e('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x1d210e,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1d210e,_0x430e('0x24'),JSON['stringify'](_0x1135a7));if(_0x1135a7[_0x430e('0x25')]){if(_0x1135a7[_0x430e('0x25')]['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x1d210e,_0x1135a7[_0x430e('0x25')]['message']);return _0x3c7340(_0x1135a7[_0x430e('0x25')][_0x430e('0x26')]);}logger[_0x430e('0x25')](_0x430e('0x27'),_0x1d210e,_0x1135a7[_0x430e('0x25')][_0x430e('0x26')]);return _0x1a0a42(_0x1135a7[_0x430e('0x25')][_0x430e('0x26')]);}else{logger[_0x430e('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x1d210e,_0x430e('0x24'));_0x1a0a42(_0x1135a7['result'][_0x430e('0x26')]);}})[_0x430e('0x28')](function(_0x5487bd){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x1d210e,_0x5487bd);_0x3c7340(_0x5487bd);});});}function respondWithStatusCode(_0x5a5aa0,_0x960666){_0x960666=_0x960666||0xcc;return function(_0x3651a1){if(_0x3651a1){return _0x5a5aa0[_0x430e('0x29')](_0x960666);}return _0x5a5aa0[_0x430e('0x2a')](_0x960666)[_0x430e('0x2b')]();};}function respondWithResult(_0xfcd9b8,_0x48f972){_0x48f972=_0x48f972||0xc8;return function(_0x5c87d3){if(_0x5c87d3){return _0xfcd9b8[_0x430e('0x2a')](_0x48f972)['json'](_0x5c87d3);}};}function respondWithFilteredResult(_0x3b22ff,_0x147017){return function(_0x5124c5){if(_0x5124c5){var _0x1bc8b8=typeof _0x147017[_0x430e('0x2c')]===_0x430e('0x2d')&&typeof _0x147017[_0x430e('0x2e')]===_0x430e('0x2d');var _0x274874=_0x5124c5[_0x430e('0x2f')];var _0x3606a3=_0x1bc8b8?0x0:_0x147017[_0x430e('0x2c')];var _0x59aeb6=_0x1bc8b8?_0x5124c5[_0x430e('0x2f')]:_0x147017[_0x430e('0x2c')]+_0x147017[_0x430e('0x2e')];var _0x5e5cbf;if(_0x59aeb6>=_0x274874){_0x59aeb6=_0x274874;_0x5e5cbf=0xc8;}else{_0x5e5cbf=0xce;}_0x3b22ff[_0x430e('0x2a')](_0x5e5cbf);return _0x3b22ff[_0x430e('0x30')](_0x430e('0x31'),_0x3606a3+'-'+_0x59aeb6+'/'+_0x274874)['json'](_0x5124c5);}return null;};}function patchUpdates(_0x943734){return function(_0x2bf2f5){try{jsonpatch[_0x430e('0x32')](_0x2bf2f5,_0x943734,!![]);}catch(_0x1717e2){return BPromise[_0x430e('0x33')](_0x1717e2);}return _0x2bf2f5[_0x430e('0x34')]();};}function saveUpdates(_0x4ccd56,_0x59cec8){return function(_0x340cf0){if(_0x340cf0){return _0x340cf0[_0x430e('0x35')](_0x4ccd56)[_0x430e('0x22')](function(_0x8d42de){return _0x8d42de;});}return null;};}function removeEntity(_0x3ab5f7,_0x3a2c63){return function(_0xee16a9){if(_0xee16a9){return _0xee16a9[_0x430e('0x36')]()['then'](function(){var _0xa82144=_0xee16a9[_0x430e('0x37')]({'plain':!![]});var _0x13fdad='WhatsappAccounts';return db[_0x430e('0x38')][_0x430e('0x36')]({'where':{'type':_0x13fdad,'resourceId':_0xa82144['id']}})[_0x430e('0x22')](function(){return _0xee16a9;});})['then'](function(){_0x3ab5f7[_0x430e('0x2a')](0xcc)[_0x430e('0x2b')]();});}};}function handleEntityNotFound(_0x49df3b,_0x4ca7ec){return function(_0x7841d2){if(!_0x7841d2){_0x49df3b['sendStatus'](0x194);}return _0x7841d2;};}function handleError(_0x58a407,_0x2718e9){_0x2718e9=_0x2718e9||0x1f4;return function(_0x49bad5){logger['error'](_0x49bad5[_0x430e('0x39')]);if(_0x49bad5['name']){delete _0x49bad5[_0x430e('0x3a')];}_0x58a407[_0x430e('0x2a')](_0x2718e9)['send'](_0x49bad5);};}exports[_0x430e('0x3b')]=function(_0x5702eb,_0x36af5b){var _0x421f4d={'include':[{'model':db[_0x430e('0x3c')],'as':'mandatoryDispositionPause'}]},_0x2176d6={},_0x584f85={'count':0x0,'rows':[]};var _0x4e5a97=_['map'](db[_0x430e('0x3d')][_0x430e('0x3e')],function(_0x1efae4){return{'name':_0x1efae4['fieldName'],'type':_0x1efae4[_0x430e('0x3f')]['key']};});_0x2176d6[_0x430e('0x40')]=_[_0x430e('0x41')](_0x4e5a97,_0x430e('0x3a'));_0x2176d6[_0x430e('0x42')]=_[_0x430e('0x43')](_0x5702eb['query']);_0x2176d6[_0x430e('0x44')]=_[_0x430e('0x45')](_0x2176d6[_0x430e('0x40')],_0x2176d6[_0x430e('0x42')]);_0x421f4d[_0x430e('0x46')]=_[_0x430e('0x45')](_0x2176d6['model'],qs[_0x430e('0x47')](_0x5702eb[_0x430e('0x42')][_0x430e('0x47')]));_0x421f4d[_0x430e('0x46')]=_0x421f4d[_0x430e('0x46')][_0x430e('0x48')]?_0x421f4d['attributes']:_0x2176d6[_0x430e('0x40')];if(!_0x5702eb[_0x430e('0x42')][_0x430e('0x49')]('nolimit')){_0x421f4d[_0x430e('0x2e')]=qs[_0x430e('0x2e')](_0x5702eb[_0x430e('0x42')][_0x430e('0x2e')]);_0x421f4d['offset']=qs[_0x430e('0x2c')](_0x5702eb['query'][_0x430e('0x2c')]);}_0x421f4d[_0x430e('0x4a')]=qs[_0x430e('0x4b')](_0x5702eb[_0x430e('0x42')][_0x430e('0x4b')]);_0x421f4d[_0x430e('0x4c')]=qs[_0x430e('0x44')](_[_0x430e('0x4d')](_0x5702eb[_0x430e('0x42')],_0x2176d6[_0x430e('0x44')]),_0x4e5a97);if(_0x5702eb['query'][_0x430e('0x4e')]){_0x421f4d['where']=_[_0x430e('0x4f')](_0x421f4d[_0x430e('0x4c')],{'$or':_[_0x430e('0x41')](_0x4e5a97,function(_0x211c1f){if(_0x211c1f[_0x430e('0x3f')]!==_0x430e('0x50')){var _0x3a90af={};_0x3a90af[_0x211c1f[_0x430e('0x3a')]]={'$like':'%'+_0x5702eb[_0x430e('0x42')][_0x430e('0x4e')]+'%'};return _0x3a90af;}})});}_0x421f4d=_['merge']({},_0x421f4d,_0x5702eb['options']);var _0x29b818={'where':_0x421f4d['where']};return db[_0x430e('0x3d')][_0x430e('0x2f')](_0x29b818)['then'](function(_0x78fc0){_0x584f85['count']=_0x78fc0;if(_0x5702eb[_0x430e('0x42')][_0x430e('0x51')]){_0x421f4d[_0x430e('0x52')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x430e('0x53')](_0x421f4d);})[_0x430e('0x22')](function(_0x2e4265){_0x584f85[_0x430e('0x54')]=_0x2e4265;return _0x584f85;})[_0x430e('0x22')](respondWithFilteredResult(_0x36af5b,_0x421f4d))[_0x430e('0x28')](handleError(_0x36af5b,null));};exports['show']=function(_0x57b198,_0x158017){var _0x364a49={'raw':![],'where':{'id':_0x57b198[_0x430e('0x55')]['id']},'include':[{'model':db[_0x430e('0x3c')],'as':'mandatoryDispositionPause'}]},_0x594c89={};_0x594c89[_0x430e('0x40')]=_[_0x430e('0x43')](db[_0x430e('0x3d')][_0x430e('0x3e')]);_0x594c89[_0x430e('0x42')]=_[_0x430e('0x43')](_0x57b198[_0x430e('0x42')]);_0x594c89[_0x430e('0x44')]=_['intersection'](_0x594c89[_0x430e('0x40')],_0x594c89['query']);_0x364a49[_0x430e('0x46')]=_[_0x430e('0x45')](_0x594c89['model'],qs[_0x430e('0x47')](_0x57b198['query'][_0x430e('0x47')]));_0x364a49[_0x430e('0x46')]=_0x364a49[_0x430e('0x46')][_0x430e('0x48')]?_0x364a49[_0x430e('0x46')]:_0x594c89[_0x430e('0x40')];if(_0x57b198[_0x430e('0x42')][_0x430e('0x51')]){_0x364a49[_0x430e('0x52')]=[{'all':!![]}];}_0x364a49=_[_0x430e('0x4f')]({},_0x364a49,_0x57b198[_0x430e('0x56')]);return db[_0x430e('0x3d')][_0x430e('0x57')](_0x364a49)[_0x430e('0x22')](handleEntityNotFound(_0x158017,null))['then'](respondWithResult(_0x158017,null))[_0x430e('0x28')](handleError(_0x158017,null));};exports[_0x430e('0x58')]=function(_0x4fc458,_0x3251f8){return db['WhatsappAccount'][_0x430e('0x58')](_0x4fc458[_0x430e('0x59')],{})[_0x430e('0x22')](function(_0x2c7fbe){var _0x3f97b5=_0x4fc458[_0x430e('0x5a')][_0x430e('0x37')]({'plain':!![]});if(!_0x3f97b5)throw new Error(_0x430e('0x5b'));if(_0x3f97b5[_0x430e('0x5c')]===_0x430e('0x5a')){var _0x1bc398=_0x2c7fbe['get']({'plain':!![]});var _0x426f0f=_0x430e('0x5d');return db[_0x430e('0x5e')]['find']({'where':{'name':_0x426f0f,'userProfileId':_0x3f97b5['userProfileId']},'raw':!![]})['then'](function(_0x7905cb){if(_0x7905cb&&_0x7905cb[_0x430e('0x5f')]===0x0){return db[_0x430e('0x38')][_0x430e('0x58')]({'name':_0x1bc398[_0x430e('0x3a')],'resourceId':_0x1bc398['id'],'type':_0x7905cb[_0x430e('0x3a')],'sectionId':_0x7905cb['id']},{})[_0x430e('0x22')](function(){return _0x2c7fbe;});}else{return _0x2c7fbe;}})[_0x430e('0x28')](function(_0x2ba670){logger[_0x430e('0x25')](_0x430e('0x60'),_0x2ba670);throw _0x2ba670;});}return _0x2c7fbe;})[_0x430e('0x22')](respondWithResult(_0x3251f8,0xc9))[_0x430e('0x28')](handleError(_0x3251f8,null));};exports[_0x430e('0x35')]=function(_0xae43b7,_0xe87987){if(_0xae43b7['body']['id']){delete _0xae43b7[_0x430e('0x59')]['id'];}return db[_0x430e('0x3d')][_0x430e('0x57')]({'where':{'id':_0xae43b7[_0x430e('0x55')]['id']},'include':[{'model':db[_0x430e('0x3c')],'as':_0x430e('0x61')}]})['then'](handleEntityNotFound(_0xe87987,null))[_0x430e('0x22')](saveUpdates(_0xae43b7[_0x430e('0x59')],null))['then'](respondWithResult(_0xe87987,null))[_0x430e('0x28')](handleError(_0xe87987,null));};exports[_0x430e('0x36')]=function(_0x27e33b,_0x10f44a){return db['WhatsappAccount'][_0x430e('0x57')]({'where':{'id':_0x27e33b[_0x430e('0x55')]['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x10f44a,null))[_0x430e('0x22')](removeEntity(_0x10f44a,null))['catch'](handleError(_0x10f44a,null));};exports[_0x430e('0x62')]=function(_0x39813d,_0xac6025){return db[_0x430e('0x3d')][_0x430e('0x62')]()['then'](respondWithResult(_0xac6025,null))[_0x430e('0x28')](handleError(_0xac6025,null));};exports[_0x430e('0x63')]=function(_0x2b512f,_0x4a8838,_0x52b9ff){if(_0x2b512f[_0x430e('0x59')]['id']){delete _0x2b512f[_0x430e('0x59')]['id'];}return db[_0x430e('0x3d')][_0x430e('0x57')]({'where':{'id':_0x2b512f[_0x430e('0x55')]['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x4a8838,null))['then'](function(_0x557077){if(_0x557077){_0x2b512f['body'][_0x430e('0x64')]=_0x557077['id'];return db[_0x430e('0x65')][_0x430e('0x58')](_0x2b512f[_0x430e('0x59')]);}})['then'](respondWithResult(_0x4a8838,null))['catch'](handleError(_0x4a8838,null));};exports[_0x430e('0x66')]=function(_0x547aaa,_0x41bf60,_0x3ec7bc){var _0xa7d7d={'raw':![],'where':{}};var _0x16706={};var _0x51f9ff={'count':0x0,'rows':[]};return db[_0x430e('0x3d')][_0x430e('0x67')]({'where':{'id':_0x547aaa[_0x430e('0x55')]['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x41bf60,null))[_0x430e('0x22')](function(_0x4298cd){if(_0x4298cd){_0x16706[_0x430e('0x40')]=_[_0x430e('0x43')](db['Disposition'][_0x430e('0x3e')]);_0x16706[_0x430e('0x42')]=_[_0x430e('0x43')](_0x547aaa[_0x430e('0x42')]);_0x16706[_0x430e('0x44')]=_[_0x430e('0x45')](_0x16706[_0x430e('0x40')],_0x16706[_0x430e('0x42')]);_0xa7d7d[_0x430e('0x46')]=_[_0x430e('0x45')](_0x16706[_0x430e('0x40')],qs[_0x430e('0x47')](_0x547aaa['query'][_0x430e('0x47')]));_0xa7d7d['attributes']=_0xa7d7d[_0x430e('0x46')]['length']?_0xa7d7d[_0x430e('0x46')]:_0x16706['model'];if(!_0x547aaa['query'][_0x430e('0x49')](_0x430e('0x68'))){_0xa7d7d['limit']=qs['limit'](_0x547aaa[_0x430e('0x42')][_0x430e('0x2e')]);_0xa7d7d[_0x430e('0x2c')]=qs[_0x430e('0x2c')](_0x547aaa[_0x430e('0x42')][_0x430e('0x2c')]);}_0xa7d7d['order']=qs[_0x430e('0x4b')](_0x547aaa[_0x430e('0x42')][_0x430e('0x4b')]);_0xa7d7d[_0x430e('0x4c')]=qs[_0x430e('0x44')](_[_0x430e('0x4d')](_0x547aaa[_0x430e('0x42')],_0x16706[_0x430e('0x44')]));_0xa7d7d[_0x430e('0x4c')][_0x430e('0x64')]=_0x4298cd['id'];if(_0x547aaa[_0x430e('0x42')][_0x430e('0x4e')]){_0xa7d7d[_0x430e('0x4c')]=_[_0x430e('0x4f')](_0xa7d7d[_0x430e('0x4c')],{'$or':_['map'](_0xa7d7d[_0x430e('0x46')],function(_0x3b4663){var _0x3c3a1b={};_0x3c3a1b[_0x3b4663]={'$like':'%'+_0x547aaa[_0x430e('0x42')][_0x430e('0x4e')]+'%'};return _0x3c3a1b;})});}_0xa7d7d=_[_0x430e('0x4f')]({},_0xa7d7d,_0x547aaa[_0x430e('0x56')]);return db[_0x430e('0x65')][_0x430e('0x2f')]({'where':_0xa7d7d['where']})['then'](function(_0x3c2f8f){_0x51f9ff[_0x430e('0x2f')]=_0x3c2f8f;if(_0x547aaa[_0x430e('0x42')][_0x430e('0x51')]){_0xa7d7d['include']=[{'all':!![]}];}return db[_0x430e('0x65')][_0x430e('0x53')](_0xa7d7d);})['then'](function(_0x4d5ef4){_0x51f9ff['rows']=_0x4d5ef4;return _0x51f9ff;});}})[_0x430e('0x22')](respondWithFilteredResult(_0x41bf60,_0xa7d7d))[_0x430e('0x28')](handleError(_0x41bf60,null));};exports[_0x430e('0x69')]=function(_0x453dbb,_0x39bde0,_0xfe3ff9){return db[_0x430e('0x3d')][_0x430e('0x57')]({'where':{'id':_0x453dbb['params']['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x39bde0,null))[_0x430e('0x22')](function(_0x33791e){if(_0x33791e){return _0x33791e[_0x430e('0x69')](_0x453dbb[_0x430e('0x42')][_0x430e('0x6a')]);}})[_0x430e('0x22')](respondWithStatusCode(_0x39bde0,null))[_0x430e('0x28')](handleError(_0x39bde0,null));};exports['addAnswer']=function(_0x35a2fc,_0x1e3b20,_0x2ba5b9){if(_0x35a2fc[_0x430e('0x59')]['id']){delete _0x35a2fc[_0x430e('0x59')]['id'];}return db[_0x430e('0x3d')][_0x430e('0x57')]({'where':{'id':_0x35a2fc[_0x430e('0x55')]['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x1e3b20,null))[_0x430e('0x22')](function(_0x42c399){if(_0x42c399){_0x35a2fc['body'][_0x430e('0x64')]=_0x42c399['id'];return db[_0x430e('0x6b')][_0x430e('0x58')](_0x35a2fc['body']);}})[_0x430e('0x22')](respondWithResult(_0x1e3b20,null))[_0x430e('0x28')](handleError(_0x1e3b20,null));};exports[_0x430e('0x6c')]=function(_0x733d18,_0x4c763c,_0xb9cca7){var _0xfe559b={'raw':![],'where':{}};var _0x3b26bb={};var _0x1b2783={'count':0x0,'rows':[]};return db[_0x430e('0x3d')][_0x430e('0x67')]({'where':{'id':_0x733d18['params']['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x4c763c,null))[_0x430e('0x22')](function(_0x416664){if(_0x416664){_0x3b26bb[_0x430e('0x40')]=_[_0x430e('0x43')](db[_0x430e('0x6b')][_0x430e('0x3e')]);_0x3b26bb['query']=_[_0x430e('0x43')](_0x733d18[_0x430e('0x42')]);_0x3b26bb[_0x430e('0x44')]=_[_0x430e('0x45')](_0x3b26bb['model'],_0x3b26bb[_0x430e('0x42')]);_0xfe559b['attributes']=_[_0x430e('0x45')](_0x3b26bb[_0x430e('0x40')],qs['fields'](_0x733d18['query'][_0x430e('0x47')]));_0xfe559b['attributes']=_0xfe559b[_0x430e('0x46')]['length']?_0xfe559b['attributes']:_0x3b26bb['model'];if(!_0x733d18[_0x430e('0x42')][_0x430e('0x49')]('nolimit')){_0xfe559b[_0x430e('0x2e')]=qs[_0x430e('0x2e')](_0x733d18['query']['limit']);_0xfe559b[_0x430e('0x2c')]=qs['offset'](_0x733d18[_0x430e('0x42')][_0x430e('0x2c')]);}_0xfe559b[_0x430e('0x4a')]=qs[_0x430e('0x4b')](_0x733d18['query'][_0x430e('0x4b')]);_0xfe559b[_0x430e('0x4c')]=qs[_0x430e('0x44')](_[_0x430e('0x4d')](_0x733d18[_0x430e('0x42')],_0x3b26bb['filters']));_0xfe559b[_0x430e('0x4c')][_0x430e('0x64')]=_0x416664['id'];if(_0x733d18[_0x430e('0x42')][_0x430e('0x4e')]){_0xfe559b['where']=_[_0x430e('0x4f')](_0xfe559b[_0x430e('0x4c')],{'$or':_['map'](_0xfe559b[_0x430e('0x46')],function(_0x129e2f){var _0x527ab0={};_0x527ab0[_0x129e2f]={'$like':'%'+_0x733d18[_0x430e('0x42')]['filter']+'%'};return _0x527ab0;})});}_0xfe559b=_['merge']({},_0xfe559b,_0x733d18['options']);return db[_0x430e('0x6b')][_0x430e('0x2f')]({'where':_0xfe559b['where']})['then'](function(_0x520300){_0x1b2783[_0x430e('0x2f')]=_0x520300;if(_0x733d18['query']['includeAll']){_0xfe559b['include']=[{'all':!![]}];}return db[_0x430e('0x6b')][_0x430e('0x53')](_0xfe559b);})[_0x430e('0x22')](function(_0x3a1fa0){_0x1b2783[_0x430e('0x54')]=_0x3a1fa0;return _0x1b2783;});}})[_0x430e('0x22')](respondWithFilteredResult(_0x4c763c,_0xfe559b))[_0x430e('0x28')](handleError(_0x4c763c,null));};exports['removeAnswers']=function(_0x51b984,_0x56055d,_0x3fdcef){return db['WhatsappAccount'][_0x430e('0x57')]({'where':{'id':_0x51b984[_0x430e('0x55')]['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x56055d,null))['then'](function(_0x29a2f3){if(_0x29a2f3){return _0x29a2f3[_0x430e('0x6d')](_0x51b984['query'][_0x430e('0x6a')]);}})[_0x430e('0x22')](respondWithStatusCode(_0x56055d,null))['catch'](handleError(_0x56055d,null));};exports['addAgents']=function(_0x29587b,_0x4a9db0,_0x572354){return db[_0x430e('0x3d')][_0x430e('0x57')]({'where':{'id':_0x29587b['params']['id']}})['then'](handleEntityNotFound(_0x4a9db0,null))[_0x430e('0x22')](function(_0x57cf39){if(_0x57cf39){return _0x57cf39[_0x430e('0x6e')](_0x29587b[_0x430e('0x59')][_0x430e('0x6a')],_[_0x430e('0x6f')](_0x29587b['body'],[_0x430e('0x6a'),'id'])||{})[_0x430e('0x70')](function(_0x3c24bd){for(var _0x4f5019=0x0;_0x4f5019<_0x29587b['body'][_0x430e('0x6a')]['length'];_0x4f5019+=0x1){socket[_0x430e('0x71')](_0x430e('0x72'),{'UserId':Number(_0x29587b[_0x430e('0x59')][_0x430e('0x6a')][_0x4f5019]),'WhatsappAccountId':Number(_0x29587b[_0x430e('0x55')]['id'])});}return _0x3c24bd;});}})[_0x430e('0x22')](respondWithResult(_0x4a9db0,null))[_0x430e('0x28')](handleError(_0x4a9db0,null));};exports[_0x430e('0x73')]=function(_0x554685,_0x4d974f,_0x2bf4a8){return db['WhatsappAccount'][_0x430e('0x57')]({'where':{'id':_0x554685['params']['id']}})[_0x430e('0x22')](handleEntityNotFound(_0x4d974f,null))['then'](function(_0x1c084b){if(_0x1c084b){return _0x1c084b['removeAgents'](_0x554685['query']['ids'])[_0x430e('0x22')](function(){if(_[_0x430e('0x74')](_0x554685[_0x430e('0x42')][_0x430e('0x6a')])){for(var _0x18529f=0x0;_0x18529f<_0x554685['query'][_0x430e('0x6a')][_0x430e('0x48')];_0x18529f+=0x1){socket[_0x430e('0x71')](_0x430e('0x75'),{'UserId':Number(_0x554685[_0x430e('0x42')]['ids'][_0x18529f]),'WhatsappAccountId':Number(_0x554685['params']['id'])});}}else{socket[_0x430e('0x71')](_0x430e('0x75'),{'UserId':Number(_0x554685[_0x430e('0x42')]['ids']),'WhatsappAccountId':Number(_0x554685['params']['id'])});}});}})[_0x430e('0x22')](respondWithStatusCode(_0x4d974f,null))[_0x430e('0x28')](handleError(_0x4d974f,null));};exports[_0x430e('0x76')]=function(_0x59a5e4,_0x22bffc,_0x592dc9){var _0x22a331={};var _0xdc4c7d={};var _0x528740;var _0x1c857f;return db[_0x430e('0x3d')]['findOne']({'where':{'id':_0x59a5e4[_0x430e('0x55')]['id']}})['then'](handleEntityNotFound(_0x22bffc,null))[_0x430e('0x22')](function(_0x25d35d){if(_0x25d35d){_0x528740=_0x25d35d;_0xdc4c7d[_0x430e('0x40')]=_[_0x430e('0x43')](db['User'][_0x430e('0x3e')]);_0xdc4c7d[_0x430e('0x42')]=_[_0x430e('0x43')](_0x59a5e4[_0x430e('0x42')]);_0xdc4c7d[_0x430e('0x44')]=_[_0x430e('0x45')](_0xdc4c7d[_0x430e('0x40')],_0xdc4c7d[_0x430e('0x42')]);_0x22a331[_0x430e('0x46')]=_[_0x430e('0x45')](_0xdc4c7d['model'],qs['fields'](_0x59a5e4[_0x430e('0x42')]['fields']));_0x22a331[_0x430e('0x46')]=_0x22a331['attributes'][_0x430e('0x48')]?_0x22a331['attributes']:_0xdc4c7d[_0x430e('0x40')];_0x22a331[_0x430e('0x4a')]=qs[_0x430e('0x4b')](_0x59a5e4[_0x430e('0x42')][_0x430e('0x4b')]);_0x22a331[_0x430e('0x4c')]=qs['filters'](_[_0x430e('0x4d')](_0x59a5e4[_0x430e('0x42')],_0xdc4c7d[_0x430e('0x44')]));if(_0x59a5e4[_0x430e('0x42')][_0x430e('0x4e')]){_0x22a331[_0x430e('0x4c')]=_[_0x430e('0x4f')](_0x22a331['where'],{'$or':_[_0x430e('0x41')](_0x22a331[_0x430e('0x46')],function(_0x2988d3){var _0x399c4c={};_0x399c4c[_0x2988d3]={'$like':'%'+_0x59a5e4[_0x430e('0x42')][_0x430e('0x4e')]+'%'};return _0x399c4c;})});}_0x22a331=_['merge']({},_0x22a331,_0x59a5e4[_0x430e('0x56')]);return _0x528740['getAgents'](_0x22a331);}})[_0x430e('0x22')](function(_0x493292){if(_0x493292){_0x1c857f=_0x493292[_0x430e('0x48')];if(!_0x59a5e4[_0x430e('0x42')][_0x430e('0x49')](_0x430e('0x68'))){_0x22a331[_0x430e('0x2e')]=qs['limit'](_0x59a5e4[_0x430e('0x42')][_0x430e('0x2e')]);_0x22a331[_0x430e('0x2c')]=qs[_0x430e('0x2c')](_0x59a5e4[_0x430e('0x42')][_0x430e('0x2c')]);}return _0x528740[_0x430e('0x76')](_0x22a331);}})[_0x430e('0x22')](function(_0x57c976){if(_0x57c976){return _0x57c976?{'count':_0x1c857f,'rows':_0x57c976}:null;}})[_0x430e('0x22')](respondWithResult(_0x22bffc,null))[_0x430e('0x28')](handleError(_0x22bffc,null));};exports[_0x430e('0x77')]=function(_0x4474b4,_0x12d1ca){var _0x2db747=_0x4474b4[_0x430e('0x55')]['id'];var _0x1bb72c=_0x4474b4[_0x430e('0x59')];var _0x761b4=0xc8;var _0x483644=null;return db[_0x430e('0x78')][_0x430e('0x79')]({'isolationLevel':db[_0x430e('0x78')][_0x430e('0x7a')][_0x430e('0x7b')]['READ_COMMITTED']},function(_0x3a6bdc){return db['WhatsappAccount'][_0x430e('0x67')]({'where':{'id':_0x2db747},'transaction':_0x3a6bdc})['then'](function(_0x566c74){if(_0x566c74){return db[_0x430e('0x7c')]['destroy']({'where':{'WhatsappAccountId':_0x2db747},'transaction':_0x3a6bdc})[_0x430e('0x22')](function(){var _0x22af6f=_['map'](_0x1bb72c,function(_0x205359){_0x205359[_0x430e('0x64')]=_0x2db747;return _0x205359;});return db[_0x430e('0x7c')]['bulkCreate'](_0x22af6f,{'transaction':_0x3a6bdc});});}else{_0x761b4=0x194;_0x483644=[];}});})['then'](function(){if(_0x761b4!==0x194){return db[_0x430e('0x7c')][_0x430e('0x7d')]({'where':{'WhatsappAccountId':_0x2db747},'order':'priority'})[_0x430e('0x22')](function(_0x25db6b){_0x483644=_0x25db6b;});}})['catch'](function(_0x1ff955){_0x761b4=0x1f4;logger[_0x430e('0x25')](_0x1ff955[_0x430e('0x39')]);if(_0x1ff955[_0x430e('0x3a')]){delete _0x1ff955[_0x430e('0x3a')];}_0x483644=_0x1ff955;})[_0x430e('0x7e')](function(){if(_0x483644===null){_0x12d1ca[_0x430e('0x29')](_0x761b4);}else{if(_0x761b4===0x1f4){_0x12d1ca[_0x430e('0x2a')](_0x761b4)[_0x430e('0x7f')](_0x483644);}else{_0x12d1ca[_0x430e('0x2a')](_0x761b4)[_0x430e('0x80')](_0x483644);}}});};exports[_0x430e('0x81')]=function(_0x308a19,_0x2035a0,_0x1b277f){var _0x22dbb5={};var _0x35517c={};var _0x1daff3;var _0x53a111;return db['WhatsappAccount']['findOne']({'where':{'id':_0x308a19[_0x430e('0x55')]['id']}})['then'](handleEntityNotFound(_0x2035a0,null))['then'](function(_0x14f88a){if(_0x14f88a){_0x1daff3=_0x14f88a;_0x35517c['model']=_[_0x430e('0x43')](db[_0x430e('0x7c')][_0x430e('0x3e')]);_0x35517c[_0x430e('0x42')]=_['keys'](_0x308a19[_0x430e('0x42')]);_0x35517c[_0x430e('0x44')]=_[_0x430e('0x45')](_0x35517c[_0x430e('0x40')],_0x35517c['query']);_0x22dbb5[_0x430e('0x46')]=_[_0x430e('0x45')](_0x35517c[_0x430e('0x40')],qs['fields'](_0x308a19['query'][_0x430e('0x47')]));_0x22dbb5['attributes']=_0x22dbb5[_0x430e('0x46')][_0x430e('0x48')]?_0x22dbb5['attributes']:_0x35517c['model'];_0x22dbb5[_0x430e('0x4a')]=qs[_0x430e('0x4b')](_0x308a19['query']['sort']);_0x22dbb5['where']=qs[_0x430e('0x44')](_[_0x430e('0x4d')](_0x308a19[_0x430e('0x42')],_0x35517c[_0x430e('0x44')]));if(_0x308a19['query']['filter']){_0x22dbb5[_0x430e('0x4c')]=_[_0x430e('0x4f')](_0x22dbb5[_0x430e('0x4c')],{'$or':_[_0x430e('0x41')](_0x22dbb5['attributes'],function(_0x1df251){var _0x3941d6={};_0x3941d6[_0x1df251]={'$like':'%'+_0x308a19['query'][_0x430e('0x4e')]+'%'};return _0x3941d6;})});}_0x22dbb5=_[_0x430e('0x4f')]({},_0x22dbb5,_0x308a19[_0x430e('0x56')]);return _0x1daff3[_0x430e('0x81')](_0x22dbb5);}})[_0x430e('0x22')](function(_0x1db578){if(_0x1db578){_0x53a111=_0x1db578['length'];if(!_0x308a19[_0x430e('0x42')][_0x430e('0x49')](_0x430e('0x68'))){_0x22dbb5[_0x430e('0x2e')]=qs[_0x430e('0x2e')](_0x308a19[_0x430e('0x42')][_0x430e('0x2e')]);_0x22dbb5[_0x430e('0x2c')]=qs['offset'](_0x308a19[_0x430e('0x42')][_0x430e('0x2c')]);}return _0x1daff3[_0x430e('0x81')](_0x22dbb5);}})[_0x430e('0x22')](function(_0x19a369){if(_0x19a369){return _0x19a369?{'count':_0x53a111,'rows':_0x19a369}:null;}})[_0x430e('0x22')](respondWithResult(_0x2035a0,null))[_0x430e('0x28')](handleError(_0x2035a0,null));};exports[_0x430e('0x82')]=function(_0x1b6163,_0x31d62a,_0x55bcec){var _0x3eab8d={'channel':_0x430e('0x83')};var _0x4ffbba=[];var _0x361ca7=[];var _0x4bcf7b={};return db[_0x430e('0x3d')][_0x430e('0x57')]({'where':{'id':_0x1b6163[_0x430e('0x55')]['id']},'include':[{'model':db[_0x430e('0x7c')],'as':_0x430e('0x84')}]})[_0x430e('0x22')](handleEntityNotFound(_0x31d62a,null))[_0x430e('0x22')](function(_0xcbcb2d){_0x3eab8d[_0x430e('0x85')]=_0xcbcb2d;if(_0x3eab8d['account']&&_0x3eab8d[_0x430e('0x85')][_0x430e('0x3f')]===_0x430e('0x86')&&_0x1b6163[_0x430e('0x59')][_0x430e('0x87')]){if(_0x1b6163[_0x430e('0x59')][_0x430e('0x87')]['length']===0x0)return;if(_0x1b6163[_0x430e('0x59')][_0x430e('0x87')][0x0][_0x430e('0x88')]!==_0x430e('0x89'))return;return db[_0x430e('0x8a')][_0x430e('0x35')]({'read':!![],'readAt':_0x1b6163['body'][_0x430e('0x87')][0x0]['timestamp']},{'where':{'messageId':_0x1b6163[_0x430e('0x59')][_0x430e('0x87')][0x0][_0x430e('0x8b')]},'individualHooks':!![]})[_0x430e('0x22')](function(_0x115995){return _0x31d62a['status'](0xc8)[_0x430e('0x80')](_0x115995);});}_0x3eab8d['applications']=_[_0x430e('0x8c')](_0xcbcb2d[_0x430e('0x84')],[_0x430e('0x8d')],[_0x430e('0x8e')]);if(_0x3eab8d['account'][_0x430e('0x84')]){delete _0x3eab8d[_0x430e('0x85')][_0x430e('0x84')];}return db[_0x430e('0x8f')][_0x430e('0x62')]()['then'](function(_0x3d0235){if(!_0x3d0235){throw new db[(_0x430e('0x90'))][(_0x430e('0x91'))]('no\x20available\x20attributes');}_0x4ffbba=_[_0x430e('0x92')](_['keys'](_0x3d0235),[_0x430e('0x93'),'updatedAt']);_0x361ca7=_['difference'](_[_0x430e('0x43')](_0x3d0235),[_0x430e('0x93'),_0x430e('0x94'),_0x430e('0x95'),_0x430e('0x96')]);_0x3eab8d[_0x430e('0x59')]={'mapKey':_0x430e('0x97')};if(_0x3eab8d[_0x430e('0x85')]&&_0x3eab8d['account']['type']===_0x430e('0x98')){_0x3eab8d[_0x430e('0x59')][_0x430e('0x99')]=_0x1b6163[_0x430e('0x59')][_0x430e('0x9a')][_0x430e('0x9b')](_0x430e('0x9c'),'');_0x3eab8d[_0x430e('0x59')][_0x430e('0x59')]=_0x1b6163[_0x430e('0x59')][_0x430e('0x9d')];_0x3eab8d[_0x430e('0x59')][_0x430e('0x9e')]=_0x1b6163[_0x430e('0x59')][_0x430e('0x9f')];}if(_0x3eab8d['account']&&_0x3eab8d[_0x430e('0x85')][_0x430e('0x3f')]===_0x430e('0x86')){_0x3eab8d['body']['from']=_0x1b6163[_0x430e('0x59')][_0x430e('0xa0')][0x0]['from'];_0x3eab8d[_0x430e('0x59')][_0x430e('0x59')]=_0x1b6163[_0x430e('0x59')][_0x430e('0xa0')][0x0][_0x430e('0x26')]['body'];_0x3eab8d['body']['messageId']=_0x1b6163[_0x430e('0x59')][_0x430e('0xa0')][0x0]['message_id'];}if(_0x3eab8d[_0x430e('0x59')]['id']){delete _0x3eab8d[_0x430e('0x59')]['id'];}if(_[_0x430e('0xa1')](_0x3eab8d[_0x430e('0x59')][_0x430e('0x99')])){throw new db[(_0x430e('0x90'))][(_0x430e('0x91'))]('from\x20is\x20mandatory');}if(_[_0x430e('0xa1')](_0x3eab8d[_0x430e('0x59')][_0x430e('0x59')])||_0x3eab8d[_0x430e('0x59')]['body']===''){throw new db[(_0x430e('0x90'))][(_0x430e('0x91'))](_0x430e('0xa2'));}if(_[_0x430e('0xa1')](_0x3eab8d[_0x430e('0x59')]['mapKey'])){throw new db[(_0x430e('0x90'))][(_0x430e('0x91'))](_0x430e('0xa3')+_0x361ca7);}if(!_['includes'](_0x361ca7,_0x3eab8d['body']['mapKey'])){throw new db[(_0x430e('0x90'))][(_0x430e('0x91'))](_0x430e('0xa4')+_0x361ca7);}_0x4bcf7b[_0x3eab8d[_0x430e('0x59')][_0x430e('0xa5')]]=_0x3eab8d['body'][_0x430e('0x99')];return db[_0x430e('0xa6')][_0x430e('0x57')]({'where':{'id':_0x3eab8d['account'][_0x430e('0x96')]},'include':[{'model':db[_0x430e('0x8f')],'as':_0x430e('0xa7'),'where':_0x4bcf7b,'limit':0x1,'order':[['updatedAt',_0x430e('0xa8')]]}]});})['then'](handleEntityNotFound(_0x31d62a,null))[_0x430e('0x22')](function(_0x576d22){if(_0x576d22){_0x3eab8d[_0x430e('0xa9')]=_[_0x430e('0x6f')](_0x576d22,[_0x430e('0xa7')]);if(_0x576d22[_0x430e('0xa7')][_0x430e('0x48')]){return _0x576d22['Contacts'][0x0];}var _0xed127=_[_0x430e('0x1c')](_0x3eab8d[_0x430e('0x59')],{'firstName':_0x3eab8d['body'][_0x430e('0x99')],'ListId':_0x576d22['id']});_0xed127[_0x3eab8d[_0x430e('0x59')][_0x430e('0xa5')]]=_0x3eab8d[_0x430e('0x59')][_0x430e('0x99')];return db['CmContact'][_0x430e('0x58')](_0xed127,{'fields':_0x4ffbba,'raw':!![]});}})['then'](handleEntityNotFound(_0x31d62a,null))[_0x430e('0x22')](function(_0xf47d26){if(_0xf47d26){_0x3eab8d['contact']=_0xf47d26;var _0x284534={'ContactId':_0xf47d26['id'],'phone':_0x3eab8d[_0x430e('0x59')][_0x430e('0x99')],'WhatsappAccountId':_0x1b6163[_0x430e('0x55')]['id']};var _0x26a163={'ContactId':_0xf47d26['id'],'WhatsappAccountId':_0x1b6163[_0x430e('0x55')]['id'],'closed':![]};return db[_0x430e('0xaa')]['find']({'where':_0x26a163})[_0x430e('0x22')](function(_0x100993){if(_0x100993){return[_0x100993,![]];}return db[_0x430e('0xaa')][_0x430e('0x58')](_0x284534)[_0x430e('0x22')](function(_0x55046c){return[_0x55046c,!![]];});});}})['spread'](function(_0x16cb5a,_0x287854){_0x3eab8d['interaction']=_0x16cb5a[_0x430e('0x37')]({'plain':!![]});_0x3eab8d[_0x430e('0xab')]['created']=![];if(_0x287854){if(_0x3eab8d[_0x430e('0x85')][_0x430e('0xac')]){_0x3eab8d[_0x430e('0xad')][_0x430e('0xae')]({'id':0x0,'priority':_0x3eab8d[_0x430e('0xad')][_0x430e('0x48')]+0x1,'app':_0x430e('0xaf'),'appdata':_0x430e('0xb0'),'interval':'*,*,*,*'});}_0x3eab8d['interaction'][_0x430e('0xb1')]=!![];}return db[_0x430e('0x8a')]['create']({'phone':_0x3eab8d[_0x430e('0x59')][_0x430e('0x99')],'messageId':_0x3eab8d[_0x430e('0x59')][_0x430e('0x9e')],'body':_0x3eab8d[_0x430e('0x59')][_0x430e('0x59')],'WhatsappAccountId':_0x1b6163[_0x430e('0x55')]['id'],'WhatsappInteractionId':_0x16cb5a['id'],'direction':'in','ContactId':_0x16cb5a['ContactId'],'AttachmentId':_0x3eab8d[_0x430e('0x59')][_0x430e('0xb2')]});})[_0x430e('0x22')](function(_0x62a42a){_0x3eab8d[_0x430e('0x26')]=_0x62a42a;if(!_0x3eab8d['interaction'][_0x430e('0xb3')])return;return db[_0x430e('0xb4')][_0x430e('0x57')]({'attributes':['id',_0x430e('0x3a')],'where':{'id':_0x3eab8d[_0x430e('0xab')]['UserId']}});})[_0x430e('0x22')](function(_0x22038d){if(_0x22038d){_0x3eab8d[_0x430e('0xad')][_0x430e('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x22038d['name']+','+(_0x3eab8d[_0x430e('0x85')][_0x430e('0xb6')]||0xa),'interval':_0x430e('0xb7')});}if(!_0x3eab8d[_0x430e('0xab')][_0x430e('0xb8')])return;return db[_0x430e('0xb9')]['find']({'attributes':['id',_0x430e('0x3a')],'where':{'id':_0x3eab8d['interaction']['queueId']}});})[_0x430e('0x22')](function(_0x170f9f){if(_0x170f9f){_0x3eab8d[_0x430e('0xad')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x170f9f[_0x430e('0x3a')]+','+(_0x3eab8d[_0x430e('0x85')][_0x430e('0xba')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x430e('0xbb'),_0x3eab8d);})['then'](function(_0x930fa6){if(_0x930fa6){var _0x59a0c7=0xc8;var _0x5a2b91='receiveMessage';logger[_0x430e('0x23')](_0x430e('0xbc'),_0x5a2b91,_0x59a0c7,_0x430e('0xbd'));logger['debug'](_0x430e('0xbe'),_0x5a2b91,_0x59a0c7,'entity\x20found',JSON[_0x430e('0xbf')](_0x930fa6));if(_0x3eab8d['account']['type']==='twilio'){return _0x31d62a[_0x430e('0x2a')](_0x59a0c7)['set']('Content-Type',_0x430e('0xc0'))[_0x430e('0x7f')](_0x430e('0xc1'));}else{return _0x31d62a[_0x430e('0x2a')](_0x59a0c7)[_0x430e('0x80')](_0x930fa6);}}});})[_0x430e('0x28')](handleError(_0x31d62a,null));};exports['send']=function(_0x5212c7,_0x36e2c1,_0x5a42c0){var _0x109245,_0x5b0852,_0x5f44a1;if(_[_0x430e('0xa1')](_0x5212c7['body'][_0x430e('0x59')])||_0x5212c7[_0x430e('0x59')][_0x430e('0x59')]===''){throw new db[(_0x430e('0x90'))]['ValidationError'](_0x430e('0xa2'));}if(_[_0x430e('0xa1')](_0x5212c7[_0x430e('0x59')]['to'])){throw new db[(_0x430e('0x90'))][(_0x430e('0x91'))](_0x430e('0xc2'));}_0x109245=_0x5212c7[_0x430e('0x59')]['to'];return db['WhatsappAccount'][_0x430e('0x57')]({'where':{'id':_0x5212c7[_0x430e('0x55')]['id']},'include':[{'model':db[_0x430e('0xa6')],'as':_0x430e('0xc3'),'include':[{'model':db[_0x430e('0x8f')],'as':'Contacts','where':{'mobile':_0x109245},'limit':0x1,'order':[[_0x430e('0x94'),_0x430e('0xa8')]]}]}]})[_0x430e('0x22')](handleEntityNotFound(_0x36e2c1,null))[_0x430e('0x22')](function(_0x22e9ad){if(_0x22e9ad&&_0x22e9ad[_0x430e('0xc3')]){_0x5b0852=_0x22e9ad[_0x430e('0x37')]({'plain':!![]});if(_0x5b0852[_0x430e('0xc3')]&&_0x5b0852['List']['Contacts'][_0x430e('0x48')]){return _0x5b0852['List'][_0x430e('0xa7')][0x0];}return db[_0x430e('0x8f')][_0x430e('0x58')](_['defaults'](_0x5212c7['body'],{'firstName':_0x109245,'mobile':_0x109245,'phone':_0x109245,'ListId':_0x5b0852[_0x430e('0x96')]}));}})['then'](handleEntityNotFound(_0x36e2c1,null))[_0x430e('0x22')](function(_0x35dee2){if(_0x35dee2){_0x5f44a1=_0x35dee2;return db[_0x430e('0xaa')][_0x430e('0x57')]({'where':{'ContactId':_0x5f44a1['id'],'closed':![],'WhatsappAccountId':_0x5b0852['id']}})[_0x430e('0x22')](function(_0xfeb50){if(_0xfeb50){return[_0xfeb50,![]];}return db[_0x430e('0xaa')]['create']({'UserId':_0x5212c7['user']['id'],'ContactId':_0x5f44a1['id'],'WhatsappAccountId':_0x5b0852['id'],'phone':_0x109245,'firstMsgDirection':_0x430e('0xc4'),'Messages':[_[_0x430e('0x4f')](_0x5212c7[_0x430e('0x59')],{'read':![],'body':_0x5212c7[_0x430e('0x59')]['body'],'phone':_0x109245,'WhatsappAccountId':_0x5b0852['id'],'UserId':_0x5212c7[_0x430e('0x5a')]['id'],'ContactId':_0x5f44a1['id']})]},{'include':[{'model':db[_0x430e('0x8a')],'as':_0x430e('0xc5')}]})[_0x430e('0x22')](function(_0x513c2a){return[_0x513c2a,!![]];});});}})[_0x430e('0x70')](function(_0x2f33fa,_0x2430e9){if(_0x2430e9){return _0x2f33fa;}return db[_0x430e('0x8a')][_0x430e('0x58')](_['merge'](_0x5212c7['body'],{'read':![],'body':_0x5212c7[_0x430e('0x59')][_0x430e('0x59')],'phone':_0x109245,'WhatsappAccountId':_0x5b0852['id'],'WhatsappInteractionId':_0x2f33fa['id'],'UserId':_0x5212c7[_0x430e('0x5a')]['id'],'ContactId':_0x5f44a1['id']}))[_0x430e('0x22')](function(_0x54b26f){_0x2f33fa['dataValues'][_0x430e('0xc5')]=[];_0x2f33fa[_0x430e('0xc6')][_0x430e('0xc5')][_0x430e('0xae')](_0x54b26f[_0x430e('0xc6')]);return _0x2f33fa;});})[_0x430e('0x22')](respondWithResult(_0x36e2c1,null))[_0x430e('0x28')](handleError(_0x36e2c1,null));}; \ No newline at end of file +var _0x32de=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','WhatsappAccount','includeAll','include','rows','show','params','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','emit','getAgents','User','addApplications','transaction','sequelize','Transaction','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','Applications','account','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','whatsapp:','Body','messageId','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','Contacts','list','omit','defaults','contact','WhatsappInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','error','code','request\x20sent','message','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x32de,0x7d));var _0xe32d=function(_0x55fc38,_0x19bc7d){_0x55fc38=_0x55fc38-0x0;var _0x3cd5e4=_0x32de[_0x55fc38];return _0x3cd5e4;};'use strict';var emlformat=require(_0xe32d('0x0'));var rimraf=require(_0xe32d('0x1'));var zipdir=require(_0xe32d('0x2'));var jsonpatch=require(_0xe32d('0x3'));var rp=require('request-promise');var moment=require(_0xe32d('0x4'));var BPromise=require(_0xe32d('0x5'));var Mustache=require(_0xe32d('0x6'));var util=require(_0xe32d('0x7'));var path=require('path');var sox=require(_0xe32d('0x8'));var csv=require(_0xe32d('0x9'));var ejs=require(_0xe32d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe32d('0xb'));var squel=require('squel');var crypto=require(_0xe32d('0xc'));var jsforce=require(_0xe32d('0xd'));var deskjs=require(_0xe32d('0xe'));var toCsv=require(_0xe32d('0x9'));var querystring=require(_0xe32d('0xf'));var Papa=require(_0xe32d('0x10'));var Redis=require(_0xe32d('0x11'));var authService=require(_0xe32d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe32d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe32d('0x14'));var utils=require(_0xe32d('0x15'));var config=require(_0xe32d('0x16'));var licenseUtil=require(_0xe32d('0x17'));var db=require(_0xe32d('0x18'))['db'];config[_0xe32d('0x19')]=_['defaults'](config['redis'],{'host':_0xe32d('0x1a'),'port':0x18eb});var socket=require(_0xe32d('0x1b'))(new Redis(config[_0xe32d('0x19')]));require(_0xe32d('0x1c'))[_0xe32d('0x1d')](socket);var jayson=require(_0xe32d('0x1e'));var client=jayson[_0xe32d('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x128709,_0x10e86f,_0x162083,_0x2ff65e){return new BPromise(function(_0x500248,_0x4dc6c3){var _0x75452a=_0x2ff65e||client;return _0x75452a[_0xe32d('0x20')](_0x128709,_0x162083)[_0xe32d('0x21')](function(_0x38b65d){logger[_0xe32d('0x22')](_0xe32d('0x23'),_0x10e86f,'request\x20sent');logger[_0xe32d('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x10e86f,'request\x20sent',JSON['stringify'](_0x38b65d));if(_0x38b65d[_0xe32d('0x25')]){if(_0x38b65d[_0xe32d('0x25')][_0xe32d('0x26')]===0x1f4){logger[_0xe32d('0x25')](_0xe32d('0x23'),_0x10e86f,_0x38b65d[_0xe32d('0x25')]['message']);return _0x4dc6c3(_0x38b65d[_0xe32d('0x25')]['message']);}logger['error'](_0xe32d('0x23'),_0x10e86f,_0x38b65d[_0xe32d('0x25')]['message']);return _0x500248(_0x38b65d[_0xe32d('0x25')]['message']);}else{logger[_0xe32d('0x22')](_0xe32d('0x23'),_0x10e86f,_0xe32d('0x27'));_0x500248(_0x38b65d['result'][_0xe32d('0x28')]);}})[_0xe32d('0x29')](function(_0x24201a){logger[_0xe32d('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x10e86f,_0x24201a);_0x4dc6c3(_0x24201a);});});}function respondWithStatusCode(_0x355566,_0xf938c9){_0xf938c9=_0xf938c9||0xcc;return function(_0x542e0b){if(_0x542e0b){return _0x355566['sendStatus'](_0xf938c9);}return _0x355566[_0xe32d('0x2a')](_0xf938c9)[_0xe32d('0x2b')]();};}function respondWithResult(_0x46a5ab,_0x4fe0cc){_0x4fe0cc=_0x4fe0cc||0xc8;return function(_0xd2118c){if(_0xd2118c){return _0x46a5ab[_0xe32d('0x2a')](_0x4fe0cc)[_0xe32d('0x2c')](_0xd2118c);}};}function respondWithFilteredResult(_0x407422,_0x4f1fc6){return function(_0x5376c6){if(_0x5376c6){var _0x434c79=typeof _0x4f1fc6[_0xe32d('0x2d')]===_0xe32d('0x2e')&&typeof _0x4f1fc6[_0xe32d('0x2f')]===_0xe32d('0x2e');var _0x569f5b=_0x5376c6[_0xe32d('0x30')];var _0x37e77d=_0x434c79?0x0:_0x4f1fc6[_0xe32d('0x2d')];var _0x1b47a4=_0x434c79?_0x5376c6[_0xe32d('0x30')]:_0x4f1fc6['offset']+_0x4f1fc6[_0xe32d('0x2f')];var _0x30646d;if(_0x1b47a4>=_0x569f5b){_0x1b47a4=_0x569f5b;_0x30646d=0xc8;}else{_0x30646d=0xce;}_0x407422[_0xe32d('0x2a')](_0x30646d);return _0x407422[_0xe32d('0x31')]('Content-Range',_0x37e77d+'-'+_0x1b47a4+'/'+_0x569f5b)[_0xe32d('0x2c')](_0x5376c6);}return null;};}function patchUpdates(_0x4bf9f3){return function(_0x15e5e3){try{jsonpatch[_0xe32d('0x32')](_0x15e5e3,_0x4bf9f3,!![]);}catch(_0x460eca){return BPromise[_0xe32d('0x33')](_0x460eca);}return _0x15e5e3[_0xe32d('0x34')]();};}function saveUpdates(_0x594642,_0x4cc5be){return function(_0xa27c22){if(_0xa27c22){return _0xa27c22[_0xe32d('0x35')](_0x594642)[_0xe32d('0x21')](function(_0x24567a){return _0x24567a;});}return null;};}function removeEntity(_0x2e1cbf,_0x211be8){return function(_0xe06dc9){if(_0xe06dc9){return _0xe06dc9[_0xe32d('0x36')]()[_0xe32d('0x21')](function(){var _0x2b6852=_0xe06dc9[_0xe32d('0x37')]({'plain':!![]});var _0x47efa6=_0xe32d('0x38');return db[_0xe32d('0x39')]['destroy']({'where':{'type':_0x47efa6,'resourceId':_0x2b6852['id']}})[_0xe32d('0x21')](function(){return _0xe06dc9;});})[_0xe32d('0x21')](function(){_0x2e1cbf[_0xe32d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x108154,_0x25bb06){return function(_0x26bceb){if(!_0x26bceb){_0x108154[_0xe32d('0x3a')](0x194);}return _0x26bceb;};}function handleError(_0x82d1e0,_0x54a3ba){_0x54a3ba=_0x54a3ba||0x1f4;return function(_0xc83410){logger[_0xe32d('0x25')](_0xc83410[_0xe32d('0x3b')]);if(_0xc83410[_0xe32d('0x3c')]){delete _0xc83410['name'];}_0x82d1e0[_0xe32d('0x2a')](_0x54a3ba)[_0xe32d('0x3d')](_0xc83410);};}exports[_0xe32d('0x3e')]=function(_0x1b1234,_0x6ead98){var _0x4cd5f4={'include':[{'model':db[_0xe32d('0x3f')],'as':_0xe32d('0x40')}]},_0x5c7d55={},_0x464bae={'count':0x0,'rows':[]};var _0x1e0210=_[_0xe32d('0x41')](db['WhatsappAccount'][_0xe32d('0x42')],function(_0x1e2d00){return{'name':_0x1e2d00[_0xe32d('0x43')],'type':_0x1e2d00[_0xe32d('0x44')][_0xe32d('0x45')]};});_0x5c7d55[_0xe32d('0x46')]=_[_0xe32d('0x41')](_0x1e0210,_0xe32d('0x3c'));_0x5c7d55[_0xe32d('0x47')]=_[_0xe32d('0x48')](_0x1b1234[_0xe32d('0x47')]);_0x5c7d55[_0xe32d('0x49')]=_[_0xe32d('0x4a')](_0x5c7d55['model'],_0x5c7d55['query']);_0x4cd5f4[_0xe32d('0x4b')]=_[_0xe32d('0x4a')](_0x5c7d55[_0xe32d('0x46')],qs['fields'](_0x1b1234[_0xe32d('0x47')][_0xe32d('0x4c')]));_0x4cd5f4[_0xe32d('0x4b')]=_0x4cd5f4['attributes'][_0xe32d('0x4d')]?_0x4cd5f4[_0xe32d('0x4b')]:_0x5c7d55[_0xe32d('0x46')];if(!_0x1b1234['query']['hasOwnProperty'](_0xe32d('0x4e'))){_0x4cd5f4['limit']=qs[_0xe32d('0x2f')](_0x1b1234[_0xe32d('0x47')][_0xe32d('0x2f')]);_0x4cd5f4[_0xe32d('0x2d')]=qs[_0xe32d('0x2d')](_0x1b1234[_0xe32d('0x47')]['offset']);}_0x4cd5f4[_0xe32d('0x4f')]=qs[_0xe32d('0x50')](_0x1b1234['query'][_0xe32d('0x50')]);_0x4cd5f4['where']=qs[_0xe32d('0x49')](_[_0xe32d('0x51')](_0x1b1234[_0xe32d('0x47')],_0x5c7d55[_0xe32d('0x49')]),_0x1e0210);if(_0x1b1234[_0xe32d('0x47')][_0xe32d('0x52')]){_0x4cd5f4[_0xe32d('0x53')]=_['merge'](_0x4cd5f4[_0xe32d('0x53')],{'$or':_[_0xe32d('0x41')](_0x1e0210,function(_0x41e4d5){if(_0x41e4d5[_0xe32d('0x44')]!=='VIRTUAL'){var _0x1e9f2e={};_0x1e9f2e[_0x41e4d5[_0xe32d('0x3c')]]={'$like':'%'+_0x1b1234['query'][_0xe32d('0x52')]+'%'};return _0x1e9f2e;}})});}_0x4cd5f4=_['merge']({},_0x4cd5f4,_0x1b1234['options']);var _0x54133a={'where':_0x4cd5f4[_0xe32d('0x53')]};return db[_0xe32d('0x54')][_0xe32d('0x30')](_0x54133a)[_0xe32d('0x21')](function(_0x216442){_0x464bae['count']=_0x216442;if(_0x1b1234[_0xe32d('0x47')][_0xe32d('0x55')]){_0x4cd5f4[_0xe32d('0x56')]=[{'all':!![]}];}return db[_0xe32d('0x54')]['findAll'](_0x4cd5f4);})['then'](function(_0x129701){_0x464bae[_0xe32d('0x57')]=_0x129701;return _0x464bae;})[_0xe32d('0x21')](respondWithFilteredResult(_0x6ead98,_0x4cd5f4))[_0xe32d('0x29')](handleError(_0x6ead98,null));};exports[_0xe32d('0x58')]=function(_0x3d0673,_0x5b9700){var _0x3432fe={'raw':![],'where':{'id':_0x3d0673[_0xe32d('0x59')]['id']},'include':[{'model':db[_0xe32d('0x3f')],'as':_0xe32d('0x40')}]},_0x3805b6={};_0x3805b6['model']=_[_0xe32d('0x48')](db[_0xe32d('0x54')][_0xe32d('0x42')]);_0x3805b6['query']=_[_0xe32d('0x48')](_0x3d0673[_0xe32d('0x47')]);_0x3805b6[_0xe32d('0x49')]=_['intersection'](_0x3805b6[_0xe32d('0x46')],_0x3805b6[_0xe32d('0x47')]);_0x3432fe[_0xe32d('0x4b')]=_[_0xe32d('0x4a')](_0x3805b6[_0xe32d('0x46')],qs[_0xe32d('0x4c')](_0x3d0673['query']['fields']));_0x3432fe['attributes']=_0x3432fe[_0xe32d('0x4b')]['length']?_0x3432fe[_0xe32d('0x4b')]:_0x3805b6[_0xe32d('0x46')];if(_0x3d0673[_0xe32d('0x47')][_0xe32d('0x55')]){_0x3432fe[_0xe32d('0x56')]=[{'all':!![]}];}_0x3432fe=_[_0xe32d('0x5a')]({},_0x3432fe,_0x3d0673[_0xe32d('0x5b')]);return db['WhatsappAccount'][_0xe32d('0x5c')](_0x3432fe)['then'](handleEntityNotFound(_0x5b9700,null))[_0xe32d('0x21')](respondWithResult(_0x5b9700,null))[_0xe32d('0x29')](handleError(_0x5b9700,null));};exports[_0xe32d('0x5d')]=function(_0x37d24b,_0x156d76){return db[_0xe32d('0x54')][_0xe32d('0x5d')](_0x37d24b[_0xe32d('0x5e')],{})[_0xe32d('0x21')](function(_0x229919){var _0x5ab19b=_0x37d24b[_0xe32d('0x5f')]['get']({'plain':!![]});if(!_0x5ab19b)throw new Error(_0xe32d('0x60'));if(_0x5ab19b[_0xe32d('0x61')]==='user'){var _0x29e190=_0x229919[_0xe32d('0x37')]({'plain':!![]});var _0x52a692=_0xe32d('0x38');return db['UserProfileSection'][_0xe32d('0x5c')]({'where':{'name':_0x52a692,'userProfileId':_0x5ab19b[_0xe32d('0x62')]},'raw':!![]})[_0xe32d('0x21')](function(_0x4bf85a){if(_0x4bf85a&&_0x4bf85a['autoAssociation']===0x0){return db['UserProfileResource'][_0xe32d('0x5d')]({'name':_0x29e190[_0xe32d('0x3c')],'resourceId':_0x29e190['id'],'type':_0x4bf85a['name'],'sectionId':_0x4bf85a['id']},{})[_0xe32d('0x21')](function(){return _0x229919;});}else{return _0x229919;}})[_0xe32d('0x29')](function(_0x2434ec){logger[_0xe32d('0x25')](_0xe32d('0x63'),_0x2434ec);throw _0x2434ec;});}return _0x229919;})[_0xe32d('0x21')](respondWithResult(_0x156d76,0xc9))[_0xe32d('0x29')](handleError(_0x156d76,null));};exports[_0xe32d('0x35')]=function(_0x54e8c6,_0x3e78cc){if(_0x54e8c6[_0xe32d('0x5e')]['id']){delete _0x54e8c6['body']['id'];}return db[_0xe32d('0x54')][_0xe32d('0x5c')]({'where':{'id':_0x54e8c6[_0xe32d('0x59')]['id']},'include':[{'model':db[_0xe32d('0x3f')],'as':_0xe32d('0x40')}]})['then'](handleEntityNotFound(_0x3e78cc,null))[_0xe32d('0x21')](saveUpdates(_0x54e8c6[_0xe32d('0x5e')],null))[_0xe32d('0x21')](respondWithResult(_0x3e78cc,null))['catch'](handleError(_0x3e78cc,null));};exports[_0xe32d('0x36')]=function(_0x36317b,_0x53a5c1){return db[_0xe32d('0x54')][_0xe32d('0x5c')]({'where':{'id':_0x36317b[_0xe32d('0x59')]['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x53a5c1,null))[_0xe32d('0x21')](removeEntity(_0x53a5c1,null))[_0xe32d('0x29')](handleError(_0x53a5c1,null));};exports['describe']=function(_0x22fedc,_0x3f1a13){return db[_0xe32d('0x54')][_0xe32d('0x64')]()[_0xe32d('0x21')](respondWithResult(_0x3f1a13,null))[_0xe32d('0x29')](handleError(_0x3f1a13,null));};exports[_0xe32d('0x65')]=function(_0x485d0f,_0x3622f8,_0x47c073){if(_0x485d0f[_0xe32d('0x5e')]['id']){delete _0x485d0f[_0xe32d('0x5e')]['id'];}return db[_0xe32d('0x54')][_0xe32d('0x5c')]({'where':{'id':_0x485d0f[_0xe32d('0x59')]['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x3622f8,null))[_0xe32d('0x21')](function(_0x395ea0){if(_0x395ea0){_0x485d0f['body'][_0xe32d('0x66')]=_0x395ea0['id'];return db[_0xe32d('0x67')][_0xe32d('0x5d')](_0x485d0f[_0xe32d('0x5e')]);}})[_0xe32d('0x21')](respondWithResult(_0x3622f8,null))[_0xe32d('0x29')](handleError(_0x3622f8,null));};exports[_0xe32d('0x68')]=function(_0x44eb4d,_0x11e90f,_0x4360ce){var _0x23fae8={'raw':![],'where':{}};var _0x3a2bad={};var _0x195f2b={'count':0x0,'rows':[]};return db[_0xe32d('0x54')][_0xe32d('0x69')]({'where':{'id':_0x44eb4d[_0xe32d('0x59')]['id']}})['then'](handleEntityNotFound(_0x11e90f,null))['then'](function(_0x2f4209){if(_0x2f4209){_0x3a2bad['model']=_[_0xe32d('0x48')](db[_0xe32d('0x67')][_0xe32d('0x42')]);_0x3a2bad[_0xe32d('0x47')]=_[_0xe32d('0x48')](_0x44eb4d['query']);_0x3a2bad[_0xe32d('0x49')]=_['intersection'](_0x3a2bad[_0xe32d('0x46')],_0x3a2bad['query']);_0x23fae8[_0xe32d('0x4b')]=_[_0xe32d('0x4a')](_0x3a2bad[_0xe32d('0x46')],qs[_0xe32d('0x4c')](_0x44eb4d[_0xe32d('0x47')][_0xe32d('0x4c')]));_0x23fae8['attributes']=_0x23fae8[_0xe32d('0x4b')][_0xe32d('0x4d')]?_0x23fae8[_0xe32d('0x4b')]:_0x3a2bad[_0xe32d('0x46')];if(!_0x44eb4d[_0xe32d('0x47')][_0xe32d('0x6a')](_0xe32d('0x4e'))){_0x23fae8[_0xe32d('0x2f')]=qs[_0xe32d('0x2f')](_0x44eb4d['query'][_0xe32d('0x2f')]);_0x23fae8[_0xe32d('0x2d')]=qs['offset'](_0x44eb4d[_0xe32d('0x47')][_0xe32d('0x2d')]);}_0x23fae8['order']=qs[_0xe32d('0x50')](_0x44eb4d[_0xe32d('0x47')][_0xe32d('0x50')]);_0x23fae8[_0xe32d('0x53')]=qs[_0xe32d('0x49')](_[_0xe32d('0x51')](_0x44eb4d['query'],_0x3a2bad['filters']));_0x23fae8['where'][_0xe32d('0x66')]=_0x2f4209['id'];if(_0x44eb4d[_0xe32d('0x47')]['filter']){_0x23fae8[_0xe32d('0x53')]=_[_0xe32d('0x5a')](_0x23fae8[_0xe32d('0x53')],{'$or':_[_0xe32d('0x41')](_0x23fae8[_0xe32d('0x4b')],function(_0x2a11b2){var _0x499e1e={};_0x499e1e[_0x2a11b2]={'$like':'%'+_0x44eb4d['query'][_0xe32d('0x52')]+'%'};return _0x499e1e;})});}_0x23fae8=_['merge']({},_0x23fae8,_0x44eb4d['options']);return db[_0xe32d('0x67')][_0xe32d('0x30')]({'where':_0x23fae8[_0xe32d('0x53')]})['then'](function(_0x10cd36){_0x195f2b['count']=_0x10cd36;if(_0x44eb4d[_0xe32d('0x47')][_0xe32d('0x55')]){_0x23fae8[_0xe32d('0x56')]=[{'all':!![]}];}return db['Disposition'][_0xe32d('0x6b')](_0x23fae8);})[_0xe32d('0x21')](function(_0x4d129f){_0x195f2b[_0xe32d('0x57')]=_0x4d129f;return _0x195f2b;});}})[_0xe32d('0x21')](respondWithFilteredResult(_0x11e90f,_0x23fae8))[_0xe32d('0x29')](handleError(_0x11e90f,null));};exports[_0xe32d('0x6c')]=function(_0x1ecebf,_0x35ec8d,_0x51406c){return db['WhatsappAccount']['find']({'where':{'id':_0x1ecebf[_0xe32d('0x59')]['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x35ec8d,null))[_0xe32d('0x21')](function(_0x449c7e){if(_0x449c7e){return _0x449c7e[_0xe32d('0x6c')](_0x1ecebf['query'][_0xe32d('0x6d')]);}})['then'](respondWithStatusCode(_0x35ec8d,null))[_0xe32d('0x29')](handleError(_0x35ec8d,null));};exports[_0xe32d('0x6e')]=function(_0x4a0785,_0x5118d9,_0x555a09){if(_0x4a0785[_0xe32d('0x5e')]['id']){delete _0x4a0785['body']['id'];}return db[_0xe32d('0x54')]['find']({'where':{'id':_0x4a0785[_0xe32d('0x59')]['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x5118d9,null))[_0xe32d('0x21')](function(_0x2e96fa){if(_0x2e96fa){_0x4a0785['body'][_0xe32d('0x66')]=_0x2e96fa['id'];return db['CannedAnswer'][_0xe32d('0x5d')](_0x4a0785[_0xe32d('0x5e')]);}})['then'](respondWithResult(_0x5118d9,null))['catch'](handleError(_0x5118d9,null));};exports[_0xe32d('0x6f')]=function(_0x4b147c,_0x56278b,_0x57692e){var _0x25a1b8={'raw':![],'where':{}};var _0x4ab290={};var _0x2d3cc1={'count':0x0,'rows':[]};return db[_0xe32d('0x54')]['findOne']({'where':{'id':_0x4b147c[_0xe32d('0x59')]['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x56278b,null))[_0xe32d('0x21')](function(_0x25483e){if(_0x25483e){_0x4ab290[_0xe32d('0x46')]=_['keys'](db[_0xe32d('0x70')][_0xe32d('0x42')]);_0x4ab290[_0xe32d('0x47')]=_['keys'](_0x4b147c[_0xe32d('0x47')]);_0x4ab290[_0xe32d('0x49')]=_[_0xe32d('0x4a')](_0x4ab290[_0xe32d('0x46')],_0x4ab290[_0xe32d('0x47')]);_0x25a1b8['attributes']=_[_0xe32d('0x4a')](_0x4ab290[_0xe32d('0x46')],qs[_0xe32d('0x4c')](_0x4b147c[_0xe32d('0x47')][_0xe32d('0x4c')]));_0x25a1b8[_0xe32d('0x4b')]=_0x25a1b8[_0xe32d('0x4b')]['length']?_0x25a1b8[_0xe32d('0x4b')]:_0x4ab290[_0xe32d('0x46')];if(!_0x4b147c[_0xe32d('0x47')][_0xe32d('0x6a')]('nolimit')){_0x25a1b8[_0xe32d('0x2f')]=qs[_0xe32d('0x2f')](_0x4b147c[_0xe32d('0x47')][_0xe32d('0x2f')]);_0x25a1b8[_0xe32d('0x2d')]=qs['offset'](_0x4b147c[_0xe32d('0x47')]['offset']);}_0x25a1b8[_0xe32d('0x4f')]=qs[_0xe32d('0x50')](_0x4b147c['query'][_0xe32d('0x50')]);_0x25a1b8[_0xe32d('0x53')]=qs[_0xe32d('0x49')](_[_0xe32d('0x51')](_0x4b147c['query'],_0x4ab290['filters']));_0x25a1b8[_0xe32d('0x53')][_0xe32d('0x66')]=_0x25483e['id'];if(_0x4b147c[_0xe32d('0x47')][_0xe32d('0x52')]){_0x25a1b8[_0xe32d('0x53')]=_['merge'](_0x25a1b8['where'],{'$or':_[_0xe32d('0x41')](_0x25a1b8[_0xe32d('0x4b')],function(_0x3fb662){var _0x1062b8={};_0x1062b8[_0x3fb662]={'$like':'%'+_0x4b147c[_0xe32d('0x47')]['filter']+'%'};return _0x1062b8;})});}_0x25a1b8=_['merge']({},_0x25a1b8,_0x4b147c[_0xe32d('0x5b')]);return db[_0xe32d('0x70')][_0xe32d('0x30')]({'where':_0x25a1b8[_0xe32d('0x53')]})[_0xe32d('0x21')](function(_0x2f794a){_0x2d3cc1[_0xe32d('0x30')]=_0x2f794a;if(_0x4b147c[_0xe32d('0x47')]['includeAll']){_0x25a1b8[_0xe32d('0x56')]=[{'all':!![]}];}return db[_0xe32d('0x70')]['findAll'](_0x25a1b8);})[_0xe32d('0x21')](function(_0x4457a6){_0x2d3cc1[_0xe32d('0x57')]=_0x4457a6;return _0x2d3cc1;});}})[_0xe32d('0x21')](respondWithFilteredResult(_0x56278b,_0x25a1b8))[_0xe32d('0x29')](handleError(_0x56278b,null));};exports[_0xe32d('0x71')]=function(_0x4f6995,_0x233894,_0x38ee01){return db[_0xe32d('0x54')][_0xe32d('0x5c')]({'where':{'id':_0x4f6995['params']['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x233894,null))[_0xe32d('0x21')](function(_0x1e00c9){if(_0x1e00c9){return _0x1e00c9['removeAnswers'](_0x4f6995['query']['ids']);}})[_0xe32d('0x21')](respondWithStatusCode(_0x233894,null))[_0xe32d('0x29')](handleError(_0x233894,null));};exports[_0xe32d('0x72')]=function(_0x32d689,_0x5abcf6,_0x3ce1bc){return db[_0xe32d('0x54')][_0xe32d('0x5c')]({'where':{'id':_0x32d689['params']['id']}})['then'](handleEntityNotFound(_0x5abcf6,null))[_0xe32d('0x21')](function(_0x3a28a7){if(_0x3a28a7){return _0x3a28a7[_0xe32d('0x72')](_0x32d689['body'][_0xe32d('0x6d')],_['omit'](_0x32d689['body'],[_0xe32d('0x6d'),'id'])||{})[_0xe32d('0x73')](function(_0x2a6b84){for(var _0x3a1d2c=0x0;_0x3a1d2c<_0x32d689[_0xe32d('0x5e')][_0xe32d('0x6d')][_0xe32d('0x4d')];_0x3a1d2c+=0x1){socket['emit'](_0xe32d('0x74'),{'UserId':Number(_0x32d689['body'][_0xe32d('0x6d')][_0x3a1d2c]),'WhatsappAccountId':Number(_0x32d689[_0xe32d('0x59')]['id'])});}return _0x2a6b84;});}})[_0xe32d('0x21')](respondWithResult(_0x5abcf6,null))[_0xe32d('0x29')](handleError(_0x5abcf6,null));};exports[_0xe32d('0x75')]=function(_0x842c81,_0x13fbe7,_0xfa4c03){return db[_0xe32d('0x54')]['find']({'where':{'id':_0x842c81[_0xe32d('0x59')]['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x13fbe7,null))[_0xe32d('0x21')](function(_0x74c6b0){if(_0x74c6b0){return _0x74c6b0[_0xe32d('0x75')](_0x842c81[_0xe32d('0x47')][_0xe32d('0x6d')])['then'](function(){if(_['isArray'](_0x842c81['query']['ids'])){for(var _0xe8c106=0x0;_0xe8c106<_0x842c81[_0xe32d('0x47')][_0xe32d('0x6d')][_0xe32d('0x4d')];_0xe8c106+=0x1){socket[_0xe32d('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x842c81[_0xe32d('0x47')][_0xe32d('0x6d')][_0xe8c106]),'WhatsappAccountId':Number(_0x842c81[_0xe32d('0x59')]['id'])});}}else{socket[_0xe32d('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x842c81[_0xe32d('0x47')][_0xe32d('0x6d')]),'WhatsappAccountId':Number(_0x842c81[_0xe32d('0x59')]['id'])});}});}})[_0xe32d('0x21')](respondWithStatusCode(_0x13fbe7,null))[_0xe32d('0x29')](handleError(_0x13fbe7,null));};exports[_0xe32d('0x77')]=function(_0x119923,_0x54e71a,_0x316fbf){var _0x41b723={};var _0x2ae12d={};var _0x4c4377;var _0x10979c;return db[_0xe32d('0x54')][_0xe32d('0x69')]({'where':{'id':_0x119923['params']['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x54e71a,null))[_0xe32d('0x21')](function(_0x1fd6c5){if(_0x1fd6c5){_0x4c4377=_0x1fd6c5;_0x2ae12d['model']=_[_0xe32d('0x48')](db[_0xe32d('0x78')][_0xe32d('0x42')]);_0x2ae12d[_0xe32d('0x47')]=_[_0xe32d('0x48')](_0x119923[_0xe32d('0x47')]);_0x2ae12d['filters']=_['intersection'](_0x2ae12d['model'],_0x2ae12d[_0xe32d('0x47')]);_0x41b723['attributes']=_[_0xe32d('0x4a')](_0x2ae12d['model'],qs[_0xe32d('0x4c')](_0x119923[_0xe32d('0x47')][_0xe32d('0x4c')]));_0x41b723[_0xe32d('0x4b')]=_0x41b723[_0xe32d('0x4b')][_0xe32d('0x4d')]?_0x41b723[_0xe32d('0x4b')]:_0x2ae12d[_0xe32d('0x46')];_0x41b723[_0xe32d('0x4f')]=qs[_0xe32d('0x50')](_0x119923[_0xe32d('0x47')][_0xe32d('0x50')]);_0x41b723[_0xe32d('0x53')]=qs[_0xe32d('0x49')](_[_0xe32d('0x51')](_0x119923['query'],_0x2ae12d[_0xe32d('0x49')]));if(_0x119923[_0xe32d('0x47')][_0xe32d('0x52')]){_0x41b723[_0xe32d('0x53')]=_[_0xe32d('0x5a')](_0x41b723[_0xe32d('0x53')],{'$or':_[_0xe32d('0x41')](_0x41b723[_0xe32d('0x4b')],function(_0x731e91){var _0x47cc1b={};_0x47cc1b[_0x731e91]={'$like':'%'+_0x119923[_0xe32d('0x47')][_0xe32d('0x52')]+'%'};return _0x47cc1b;})});}_0x41b723=_[_0xe32d('0x5a')]({},_0x41b723,_0x119923[_0xe32d('0x5b')]);return _0x4c4377[_0xe32d('0x77')](_0x41b723);}})[_0xe32d('0x21')](function(_0x209bdd){if(_0x209bdd){_0x10979c=_0x209bdd[_0xe32d('0x4d')];if(!_0x119923[_0xe32d('0x47')][_0xe32d('0x6a')]('nolimit')){_0x41b723[_0xe32d('0x2f')]=qs[_0xe32d('0x2f')](_0x119923[_0xe32d('0x47')]['limit']);_0x41b723['offset']=qs[_0xe32d('0x2d')](_0x119923[_0xe32d('0x47')][_0xe32d('0x2d')]);}return _0x4c4377['getAgents'](_0x41b723);}})[_0xe32d('0x21')](function(_0x257bcb){if(_0x257bcb){return _0x257bcb?{'count':_0x10979c,'rows':_0x257bcb}:null;}})['then'](respondWithResult(_0x54e71a,null))[_0xe32d('0x29')](handleError(_0x54e71a,null));};exports[_0xe32d('0x79')]=function(_0x2d97a5,_0x1b312b){var _0x414d0c=_0x2d97a5['params']['id'];var _0x35f160=_0x2d97a5[_0xe32d('0x5e')];var _0x38c467=0xc8;var _0x31eaff=null;return db['sequelize'][_0xe32d('0x7a')]({'isolationLevel':db[_0xe32d('0x7b')][_0xe32d('0x7c')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3be65d){return db['WhatsappAccount']['findOne']({'where':{'id':_0x414d0c},'transaction':_0x3be65d})[_0xe32d('0x21')](function(_0x4a5a4f){if(_0x4a5a4f){return db[_0xe32d('0x7d')][_0xe32d('0x36')]({'where':{'WhatsappAccountId':_0x414d0c},'transaction':_0x3be65d})[_0xe32d('0x21')](function(){var _0x1d08f5=_[_0xe32d('0x41')](_0x35f160,function(_0x1f0b39){_0x1f0b39['WhatsappAccountId']=_0x414d0c;return _0x1f0b39;});return db[_0xe32d('0x7d')]['bulkCreate'](_0x1d08f5,{'transaction':_0x3be65d});});}else{_0x38c467=0x194;_0x31eaff=[];}});})[_0xe32d('0x21')](function(){if(_0x38c467!==0x194){return db[_0xe32d('0x7d')][_0xe32d('0x7e')]({'where':{'WhatsappAccountId':_0x414d0c},'order':_0xe32d('0x7f')})[_0xe32d('0x21')](function(_0x3953ff){_0x31eaff=_0x3953ff;});}})['catch'](function(_0x526f3e){_0x38c467=0x1f4;logger[_0xe32d('0x25')](_0x526f3e[_0xe32d('0x3b')]);if(_0x526f3e[_0xe32d('0x3c')]){delete _0x526f3e[_0xe32d('0x3c')];}_0x31eaff=_0x526f3e;})[_0xe32d('0x80')](function(){if(_0x31eaff===null){_0x1b312b[_0xe32d('0x3a')](_0x38c467);}else{if(_0x38c467===0x1f4){_0x1b312b[_0xe32d('0x2a')](_0x38c467)[_0xe32d('0x3d')](_0x31eaff);}else{_0x1b312b['status'](_0x38c467)[_0xe32d('0x2c')](_0x31eaff);}}});};exports[_0xe32d('0x81')]=function(_0x53da07,_0x24043a,_0x3a4779){var _0x2e7374={};var _0x4d6271={};var _0x4e2beb;var _0x100f39;return db[_0xe32d('0x54')]['findOne']({'where':{'id':_0x53da07[_0xe32d('0x59')]['id']}})[_0xe32d('0x21')](handleEntityNotFound(_0x24043a,null))[_0xe32d('0x21')](function(_0x387cae){if(_0x387cae){_0x4e2beb=_0x387cae;_0x4d6271[_0xe32d('0x46')]=_['keys'](db[_0xe32d('0x7d')][_0xe32d('0x42')]);_0x4d6271['query']=_[_0xe32d('0x48')](_0x53da07[_0xe32d('0x47')]);_0x4d6271[_0xe32d('0x49')]=_[_0xe32d('0x4a')](_0x4d6271['model'],_0x4d6271[_0xe32d('0x47')]);_0x2e7374[_0xe32d('0x4b')]=_['intersection'](_0x4d6271[_0xe32d('0x46')],qs['fields'](_0x53da07[_0xe32d('0x47')][_0xe32d('0x4c')]));_0x2e7374[_0xe32d('0x4b')]=_0x2e7374['attributes']['length']?_0x2e7374[_0xe32d('0x4b')]:_0x4d6271['model'];_0x2e7374[_0xe32d('0x4f')]=qs[_0xe32d('0x50')](_0x53da07[_0xe32d('0x47')][_0xe32d('0x50')]);_0x2e7374[_0xe32d('0x53')]=qs['filters'](_[_0xe32d('0x51')](_0x53da07['query'],_0x4d6271[_0xe32d('0x49')]));if(_0x53da07[_0xe32d('0x47')][_0xe32d('0x52')]){_0x2e7374[_0xe32d('0x53')]=_[_0xe32d('0x5a')](_0x2e7374[_0xe32d('0x53')],{'$or':_[_0xe32d('0x41')](_0x2e7374[_0xe32d('0x4b')],function(_0x177baa){var _0x5103d7={};_0x5103d7[_0x177baa]={'$like':'%'+_0x53da07[_0xe32d('0x47')][_0xe32d('0x52')]+'%'};return _0x5103d7;})});}_0x2e7374=_[_0xe32d('0x5a')]({},_0x2e7374,_0x53da07[_0xe32d('0x5b')]);return _0x4e2beb[_0xe32d('0x81')](_0x2e7374);}})[_0xe32d('0x21')](function(_0x2eea6c){if(_0x2eea6c){_0x100f39=_0x2eea6c[_0xe32d('0x4d')];if(!_0x53da07[_0xe32d('0x47')][_0xe32d('0x6a')](_0xe32d('0x4e'))){_0x2e7374[_0xe32d('0x2f')]=qs[_0xe32d('0x2f')](_0x53da07['query'][_0xe32d('0x2f')]);_0x2e7374[_0xe32d('0x2d')]=qs[_0xe32d('0x2d')](_0x53da07[_0xe32d('0x47')][_0xe32d('0x2d')]);}return _0x4e2beb[_0xe32d('0x81')](_0x2e7374);}})['then'](function(_0xef69b8){if(_0xef69b8){return _0xef69b8?{'count':_0x100f39,'rows':_0xef69b8}:null;}})[_0xe32d('0x21')](respondWithResult(_0x24043a,null))[_0xe32d('0x29')](handleError(_0x24043a,null));};exports[_0xe32d('0x82')]=function(_0x23c99a,_0x35e951,_0x2af2b9){var _0x2f8a80={'channel':'whatsapp'};var _0x2e8e44=[];var _0x4f3e9e=[];var _0x3a8464={};return db[_0xe32d('0x54')][_0xe32d('0x5c')]({'where':{'id':_0x23c99a['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xe32d('0x83')}]})[_0xe32d('0x21')](handleEntityNotFound(_0x35e951,null))['then'](function(_0x35ed6d){_0x2f8a80[_0xe32d('0x84')]=_0x35ed6d;if(_0x2f8a80['account']&&_0x2f8a80['account'][_0xe32d('0x44')]==='sinch'&&_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x85')]){if(_0x23c99a[_0xe32d('0x5e')]['statuses'][_0xe32d('0x4d')]===0x0)return;if(_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x85')][0x0][_0xe32d('0x86')]!==_0xe32d('0x87'))return;return db[_0xe32d('0x88')][_0xe32d('0x35')]({'read':!![],'readAt':_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x85')][0x0]['timestamp']},{'where':{'messageId':_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x85')][0x0][_0xe32d('0x89')]},'individualHooks':!![]})['then'](function(_0x2b04ef){return _0x35e951[_0xe32d('0x2a')](0xc8)[_0xe32d('0x2c')](_0x2b04ef);});}_0x2f8a80[_0xe32d('0x8a')]=_[_0xe32d('0x8b')](_0x35ed6d[_0xe32d('0x83')],[_0xe32d('0x7f')],[_0xe32d('0x8c')]);if(_0x2f8a80[_0xe32d('0x84')][_0xe32d('0x83')]){delete _0x2f8a80[_0xe32d('0x84')][_0xe32d('0x83')];}return db[_0xe32d('0x8d')][_0xe32d('0x64')]()[_0xe32d('0x21')](function(_0x3c3cab){if(!_0x3c3cab){throw new db[(_0xe32d('0x8e'))][(_0xe32d('0x8f'))](_0xe32d('0x90'));}_0x2e8e44=_[_0xe32d('0x91')](_[_0xe32d('0x48')](_0x3c3cab),[_0xe32d('0x92'),_0xe32d('0x93')]);_0x4f3e9e=_[_0xe32d('0x91')](_[_0xe32d('0x48')](_0x3c3cab),[_0xe32d('0x92'),'updatedAt','CompanyId',_0xe32d('0x94')]);_0x2f8a80['body']={'mapKey':_0xe32d('0x95')};if(_0x2f8a80[_0xe32d('0x84')]&&_0x2f8a80[_0xe32d('0x84')]['type']===_0xe32d('0x96')){_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x97')]=_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x98')]['replace'](_0xe32d('0x99'),'');_0x2f8a80[_0xe32d('0x5e')]['body']=_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x9a')];_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x9b')]=_0x23c99a[_0xe32d('0x5e')]['MessageSid'];}if(_0x2f8a80['account']&&_0x2f8a80[_0xe32d('0x84')][_0xe32d('0x44')]===_0xe32d('0x9c')){_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x97')]=_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x9d')][0x0][_0xe32d('0x97')];_0x2f8a80[_0xe32d('0x5e')]['body']=_0x23c99a[_0xe32d('0x5e')]['notifications'][0x0]['message']['body'];_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x9b')]=_0x23c99a[_0xe32d('0x5e')][_0xe32d('0x9d')][0x0]['message_id'];}if(_0x2f8a80[_0xe32d('0x5e')]['id']){delete _0x2f8a80[_0xe32d('0x5e')]['id'];}if(_[_0xe32d('0x9e')](_0x2f8a80[_0xe32d('0x5e')]['from'])){throw new db[(_0xe32d('0x8e'))][(_0xe32d('0x8f'))](_0xe32d('0x9f'));}if(_['isNil'](_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x5e')])||_0x2f8a80[_0xe32d('0x5e')]['body']===''){throw new db[(_0xe32d('0x8e'))][(_0xe32d('0x8f'))](_0xe32d('0xa0'));}if(_[_0xe32d('0x9e')](_0x2f8a80['body'][_0xe32d('0xa1')])){throw new db['Sequelize'][(_0xe32d('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f3e9e);}if(!_[_0xe32d('0xa2')](_0x4f3e9e,_0x2f8a80['body']['mapKey'])){throw new db[(_0xe32d('0x8e'))][(_0xe32d('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f3e9e);}_0x3a8464[_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0xa1')]]=_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x97')];return db['CmList']['find']({'where':{'id':_0x2f8a80[_0xe32d('0x84')][_0xe32d('0x94')]},'include':[{'model':db[_0xe32d('0x8d')],'as':_0xe32d('0xa3'),'where':_0x3a8464,'limit':0x1,'order':[[_0xe32d('0x93'),'DESC']]}]});})[_0xe32d('0x21')](handleEntityNotFound(_0x35e951,null))[_0xe32d('0x21')](function(_0x1457d4){if(_0x1457d4){_0x2f8a80[_0xe32d('0xa4')]=_[_0xe32d('0xa5')](_0x1457d4,[_0xe32d('0xa3')]);if(_0x1457d4[_0xe32d('0xa3')][_0xe32d('0x4d')]){return _0x1457d4[_0xe32d('0xa3')][0x0];}var _0x37b590=_[_0xe32d('0xa6')](_0x2f8a80['body'],{'firstName':_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x97')],'ListId':_0x1457d4['id']});_0x37b590[_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0xa1')]]=_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x97')];return db[_0xe32d('0x8d')][_0xe32d('0x5d')](_0x37b590,{'fields':_0x2e8e44,'raw':!![]});}})[_0xe32d('0x21')](handleEntityNotFound(_0x35e951,null))[_0xe32d('0x21')](function(_0x399e73){if(_0x399e73){_0x2f8a80[_0xe32d('0xa7')]=_0x399e73;var _0x887ed2={'ContactId':_0x399e73['id'],'phone':_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x97')],'WhatsappAccountId':_0x23c99a['params']['id']};var _0x3f0bcd={'ContactId':_0x399e73['id'],'WhatsappAccountId':_0x23c99a[_0xe32d('0x59')]['id'],'closed':![]};return db[_0xe32d('0xa8')][_0xe32d('0x5c')]({'where':_0x3f0bcd})[_0xe32d('0x21')](function(_0x52c247){if(_0x52c247){return[_0x52c247,![]];}return db[_0xe32d('0xa8')][_0xe32d('0x5d')](_0x887ed2)['then'](function(_0xe35620){return[_0xe35620,!![]];});});}})[_0xe32d('0x73')](function(_0x52f833,_0x36e270){_0x2f8a80[_0xe32d('0xa9')]=_0x52f833[_0xe32d('0x37')]({'plain':!![]});_0x2f8a80['interaction'][_0xe32d('0xaa')]=![];if(_0x36e270){if(_0x2f8a80['account'][_0xe32d('0xab')]){_0x2f8a80[_0xe32d('0x8a')]['push']({'id':0x0,'priority':_0x2f8a80['applications'][_0xe32d('0x4d')]+0x1,'app':'close','appdata':_0xe32d('0xac'),'interval':_0xe32d('0xad')});}_0x2f8a80[_0xe32d('0xa9')][_0xe32d('0xaa')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x97')],'messageId':_0x2f8a80['body'][_0xe32d('0x9b')],'body':_0x2f8a80[_0xe32d('0x5e')][_0xe32d('0x5e')],'WhatsappAccountId':_0x23c99a[_0xe32d('0x59')]['id'],'WhatsappInteractionId':_0x52f833['id'],'direction':'in','ContactId':_0x52f833['ContactId'],'AttachmentId':_0x2f8a80['body'][_0xe32d('0xae')]});})[_0xe32d('0x21')](function(_0x1395c4){_0x2f8a80[_0xe32d('0x28')]=_0x1395c4;if(!_0x2f8a80['interaction'][_0xe32d('0xaf')])return;return db[_0xe32d('0x78')][_0xe32d('0x5c')]({'attributes':['id','name'],'where':{'id':_0x2f8a80[_0xe32d('0xa9')]['UserId']}});})['then'](function(_0x5eb757){if(_0x5eb757){_0x2f8a80[_0xe32d('0x8a')][_0xe32d('0xb0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5eb757[_0xe32d('0x3c')]+','+(_0x2f8a80[_0xe32d('0x84')]['waitForTheAssignedAgent']||0xa),'interval':_0xe32d('0xad')});}if(!_0x2f8a80[_0xe32d('0xa9')][_0xe32d('0xb1')])return;return db['WhatsappQueue'][_0xe32d('0x5c')]({'attributes':['id','name'],'where':{'id':_0x2f8a80[_0xe32d('0xa9')][_0xe32d('0xb1')]}});})[_0xe32d('0x21')](function(_0x5deb46){if(_0x5deb46){_0x2f8a80[_0xe32d('0x8a')][_0xe32d('0xb0')]({'id':0x0,'priority':0x1,'app':_0xe32d('0xb2'),'appdata':_0x5deb46[_0xe32d('0x3c')]+','+(_0x2f8a80[_0xe32d('0x84')][_0xe32d('0xb3')]||0x12c),'interval':_0xe32d('0xad')});}return respondWithRpcPromise(_0xe32d('0xb4'),_0xe32d('0xb5'),_0x2f8a80);})[_0xe32d('0x21')](function(_0x461f98){if(_0x461f98){var _0x3101e8=0xc8;var _0x166fc8=_0xe32d('0xb6');logger['info'](_0xe32d('0xb7'),_0x166fc8,_0x3101e8,_0xe32d('0xb8'));logger[_0xe32d('0x24')](_0xe32d('0xb9'),_0x166fc8,_0x3101e8,_0xe32d('0xb8'),JSON['stringify'](_0x461f98));if(_0x2f8a80['account'][_0xe32d('0x44')]==='twilio'){return _0x35e951[_0xe32d('0x2a')](_0x3101e8)[_0xe32d('0x31')](_0xe32d('0xba'),'text/xml')[_0xe32d('0x3d')](_0xe32d('0xbb'));}else{return _0x35e951[_0xe32d('0x2a')](_0x3101e8)[_0xe32d('0x2c')](_0x461f98);}}});})[_0xe32d('0x29')](handleError(_0x35e951,null));};exports[_0xe32d('0x3d')]=function(_0x328990,_0x4fa6cf,_0x42114f){var _0x568f58,_0x239a89,_0x4bd5cb;if(_[_0xe32d('0x9e')](_0x328990[_0xe32d('0x5e')]['body'])||_0x328990[_0xe32d('0x5e')][_0xe32d('0x5e')]===''){throw new db[(_0xe32d('0x8e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x328990[_0xe32d('0x5e')]['to'])){throw new db['Sequelize'][(_0xe32d('0x8f'))](_0xe32d('0xbc'));}_0x568f58=_0x328990[_0xe32d('0x5e')]['to'];return db[_0xe32d('0x54')][_0xe32d('0x5c')]({'where':{'id':_0x328990[_0xe32d('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xe32d('0xbd'),'include':[{'model':db[_0xe32d('0x8d')],'as':_0xe32d('0xa3'),'where':{'mobile':_0x568f58},'limit':0x1,'order':[['updatedAt',_0xe32d('0xbe')]]}]}]})[_0xe32d('0x21')](handleEntityNotFound(_0x4fa6cf,null))[_0xe32d('0x21')](function(_0x7eee82){if(_0x7eee82&&_0x7eee82[_0xe32d('0xbd')]){_0x239a89=_0x7eee82['get']({'plain':!![]});if(_0x239a89[_0xe32d('0xbd')]&&_0x239a89[_0xe32d('0xbd')][_0xe32d('0xa3')][_0xe32d('0x4d')]){return _0x239a89[_0xe32d('0xbd')][_0xe32d('0xa3')][0x0];}return db[_0xe32d('0x8d')]['create'](_[_0xe32d('0xa6')](_0x328990[_0xe32d('0x5e')],{'firstName':_0x568f58,'mobile':_0x568f58,'phone':_0x568f58,'ListId':_0x239a89[_0xe32d('0x94')]}));}})[_0xe32d('0x21')](handleEntityNotFound(_0x4fa6cf,null))[_0xe32d('0x21')](function(_0x9ace26){if(_0x9ace26){_0x4bd5cb=_0x9ace26;return db[_0xe32d('0xa8')][_0xe32d('0x5c')]({'where':{'ContactId':_0x4bd5cb['id'],'closed':![],'WhatsappAccountId':_0x239a89['id']}})[_0xe32d('0x21')](function(_0x509c98){if(_0x509c98){return[_0x509c98,![]];}return db[_0xe32d('0xa8')][_0xe32d('0x5d')]({'UserId':_0x328990[_0xe32d('0x5f')]['id'],'ContactId':_0x4bd5cb['id'],'WhatsappAccountId':_0x239a89['id'],'phone':_0x568f58,'firstMsgDirection':_0xe32d('0xbf'),'Messages':[_['merge'](_0x328990[_0xe32d('0x5e')],{'read':![],'body':_0x328990['body'][_0xe32d('0x5e')],'phone':_0x568f58,'WhatsappAccountId':_0x239a89['id'],'UserId':_0x328990[_0xe32d('0x5f')]['id'],'ContactId':_0x4bd5cb['id']})]},{'include':[{'model':db[_0xe32d('0x88')],'as':_0xe32d('0xc0')}]})[_0xe32d('0x21')](function(_0x3542f8){return[_0x3542f8,!![]];});});}})[_0xe32d('0x73')](function(_0x1cb75e,_0x55a696){if(_0x55a696){return _0x1cb75e;}return db[_0xe32d('0x88')][_0xe32d('0x5d')](_[_0xe32d('0x5a')](_0x328990['body'],{'read':![],'body':_0x328990[_0xe32d('0x5e')]['body'],'phone':_0x568f58,'WhatsappAccountId':_0x239a89['id'],'WhatsappInteractionId':_0x1cb75e['id'],'UserId':_0x328990[_0xe32d('0x5f')]['id'],'ContactId':_0x4bd5cb['id']}))[_0xe32d('0x21')](function(_0x339458){_0x1cb75e[_0xe32d('0xc1')][_0xe32d('0xc0')]=[];_0x1cb75e[_0xe32d('0xc1')][_0xe32d('0xc0')]['push'](_0x339458[_0xe32d('0xc1')]);return _0x1cb75e;});})[_0xe32d('0x21')](respondWithResult(_0x4fa6cf,null))['catch'](handleError(_0x4fa6cf,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index d8b5eac..29ec943 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 _0xb306=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb306,0xb0));var _0x6b30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb306[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6b30('0x0'));var WhatsappAccount=require(_0x6b30('0x1'))['db'][_0x6b30('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6b30('0x3')](0x0);var events={'afterCreate':_0x6b30('0x4'),'afterUpdate':_0x6b30('0x5'),'afterDestroy':'remove'};function emitEvent(_0x313dd7){return function(_0x4daead,_0x523eda,_0x1e7dea){WhatsappAccountEvents['emit'](_0x313dd7+':'+_0x4daead['id'],_0x4daead);WhatsappAccountEvents[_0x6b30('0x6')](_0x313dd7,_0x4daead);_0x1e7dea(null);};}for(var e in events){if(events[_0x6b30('0x7')](e)){var event=events[e];WhatsappAccount[_0x6b30('0x8')](e,emitEvent(event));}}module[_0x6b30('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xcf35=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit'];(function(_0x2b8d9e,_0x38f52a){var _0x380e14=function(_0xfc9680){while(--_0xfc9680){_0x2b8d9e['push'](_0x2b8d9e['shift']());}};_0x380e14(++_0x38f52a);}(_0xcf35,0x17f));var _0x5cf3=function(_0x40348a,_0x5c0bb3){_0x40348a=_0x40348a-0x0;var _0x290d46=_0xcf35[_0x40348a];return _0x290d46;};'use strict';var EventEmitter=require(_0x5cf3('0x0'));var WhatsappAccount=require(_0x5cf3('0x1'))['db'][_0x5cf3('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5cf3('0x3')](0x0);var events={'afterCreate':_0x5cf3('0x4'),'afterUpdate':'update','afterDestroy':_0x5cf3('0x5')};function emitEvent(_0x537837){return function(_0x5b5d71,_0x5a43a5,_0x429ca5){WhatsappAccountEvents[_0x5cf3('0x6')](_0x537837+':'+_0x5b5d71['id'],_0x5b5d71);WhatsappAccountEvents[_0x5cf3('0x6')](_0x537837,_0x5b5d71);_0x429ca5(null);};}for(var e in events){if(events[_0x5cf3('0x7')](e)){var event=events[e];WhatsappAccount[_0x5cf3('0x8')](e,emitEvent(event));}}module[_0x5cf3('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 511c8de..9defdbe 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 _0xca5d=['../../config/environment','./whatsappAccount.attributes','exports','whatsapp_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xca5d,0xbf));var _0xdca5=function(_0xc7957,_0x296a02){_0xc7957=_0xc7957-0x0;var _0x30ae70=_0xca5d[_0xc7957];return _0x30ae70;};'use strict';var _=require(_0xdca5('0x0'));var util=require(_0xdca5('0x1'));var logger=require(_0xdca5('0x2'))(_0xdca5('0x3'));var moment=require('moment');var BPromise=require(_0xdca5('0x4'));var rp=require(_0xdca5('0x5'));var fs=require('fs');var path=require(_0xdca5('0x6'));var rimraf=require('rimraf');var config=require(_0xdca5('0x7'));var attributes=require(_0xdca5('0x8'));module[_0xdca5('0x9')]=function(_0x1d5e16,_0x4b6644){return _0x1d5e16['define']('WhatsappAccount',attributes,{'tableName':_0xdca5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03c3=['bluebird','path','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','lodash','util','../../config/logger','api','moment'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x03c3,0x1b3));var _0x303c=function(_0x25a4ab,_0x3cee85){_0x25a4ab=_0x25a4ab-0x0;var _0x1742eb=_0x03c3[_0x25a4ab];return _0x1742eb;};'use strict';var _=require(_0x303c('0x0'));var util=require(_0x303c('0x1'));var logger=require(_0x303c('0x2'))(_0x303c('0x3'));var moment=require(_0x303c('0x4'));var BPromise=require(_0x303c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x303c('0x6'));var rimraf=require(_0x303c('0x7'));var config=require('../../config/environment');var attributes=require(_0x303c('0x8'));module['exports']=function(_0x5c933b,_0x28c026){return _0x5c933b[_0x303c('0x9')](_0x303c('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index abdc6cf..eb15cb7 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 _0x898c=['attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where'];(function(_0x3b7966,_0x405e6f){var _0x11830a=function(_0x5e8689){while(--_0x5e8689){_0x3b7966['push'](_0x3b7966['shift']());}};_0x11830a(++_0x405e6f);}(_0x898c,0x73));var _0xc898=function(_0x10b1bb,_0x2a5815){_0x10b1bb=_0x10b1bb-0x0;var _0x2d4e05=_0x898c[_0x10b1bb];return _0x2d4e05;};'use strict';var _=require(_0xc898('0x0'));var util=require(_0xc898('0x1'));var moment=require(_0xc898('0x2'));var BPromise=require(_0xc898('0x3'));var rs=require(_0xc898('0x4'));var fs=require('fs');var Redis=require(_0xc898('0x5'));var db=require(_0xc898('0x6'))['db'];var utils=require(_0xc898('0x7'));var logger=require(_0xc898('0x8'))('rpc');var config=require(_0xc898('0x9'));var jayson=require(_0xc898('0xa'));var client=jayson[_0xc898('0xb')][_0xc898('0xc')]({'port':0x232a});config[_0xc898('0xd')]=_['defaults'](config[_0xc898('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc898('0xe'))(new Redis(config[_0xc898('0xd')]));require(_0xc898('0xf'))[_0xc898('0x10')](socket);function respondWithRpcPromise(_0x286cae,_0x1433cb,_0x168211){return new BPromise(function(_0x3ceaff,_0x4a9561){return client[_0xc898('0x11')](_0x286cae,_0x168211)[_0xc898('0x12')](function(_0x3f8e5b){logger['info'](_0xc898('0x13'),_0x1433cb,_0xc898('0x14'));logger[_0xc898('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1433cb,_0xc898('0x14'),JSON[_0xc898('0x16')](_0x3f8e5b));if(_0x3f8e5b[_0xc898('0x17')]){if(_0x3f8e5b[_0xc898('0x17')][_0xc898('0x18')]===0x1f4){logger[_0xc898('0x17')](_0xc898('0x13'),_0x1433cb,_0x3f8e5b[_0xc898('0x17')][_0xc898('0x19')]);return _0x4a9561(_0x3f8e5b[_0xc898('0x17')][_0xc898('0x19')]);}logger[_0xc898('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x1433cb,_0x3f8e5b[_0xc898('0x17')][_0xc898('0x19')]);return _0x3ceaff(_0x3f8e5b['error'][_0xc898('0x19')]);}else{logger[_0xc898('0x1a')](_0xc898('0x13'),_0x1433cb,'request\x20sent');_0x3ceaff(_0x3f8e5b['result'][_0xc898('0x19')]);}})[_0xc898('0x1b')](function(_0x5e8c44){logger['error'](_0xc898('0x13'),_0x1433cb,_0x5e8c44);_0x4a9561(_0x5e8c44);});});}exports[_0xc898('0x1c')]=function(_0x2e8876){var _0x5b78a5=this;return new Promise(function(_0x212632,_0x30fe6f){return db[_0xc898('0x1d')][_0xc898('0x1e')]({'raw':_0x2e8876['options']?_0x2e8876[_0xc898('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2e8876[_0xc898('0x1f')]?_0x2e8876[_0xc898('0x1f')][_0xc898('0x20')]||null:null,'attributes':_0x2e8876[_0xc898('0x1f')]?_0x2e8876[_0xc898('0x1f')][_0xc898('0x21')]||null:null,'include':_0x2e8876[_0xc898('0x1f')]?_0x2e8876[_0xc898('0x1f')][_0xc898('0x22')]?_[_0xc898('0x23')](_0x2e8876[_0xc898('0x1f')][_0xc898('0x22')],function(_0x4ef579){return{'model':db[_0x4ef579[_0xc898('0x24')]],'as':_0x4ef579['as'],'attributes':_0x4ef579[_0xc898('0x21')],'include':_0x4ef579[_0xc898('0x22')]?_[_0xc898('0x23')](_0x4ef579[_0xc898('0x22')],function(_0x3fa90e){return{'model':db[_0x3fa90e['model']],'as':_0x3fa90e['as'],'attributes':_0x3fa90e['attributes'],'include':_0x3fa90e['include']?_[_0xc898('0x23')](_0x3fa90e[_0xc898('0x22')],function(_0x3b6db5){return{'model':db[_0x3b6db5[_0xc898('0x24')]],'as':_0x3b6db5['as'],'attributes':_0x3b6db5[_0xc898('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc898('0x12')](function(_0xf3c3ff){logger[_0xc898('0x1a')](_0xc898('0x1c'),_0x2e8876);logger[_0xc898('0x15')](_0xc898('0x1c'),_0x2e8876,JSON['stringify'](_0xf3c3ff));_0x212632(_0xf3c3ff);})['catch'](function(_0x448d1d){logger['error']('ShowWhatsappAccount',_0x448d1d['message'],_0x2e8876);_0x30fe6f(_0x5b78a5[_0xc898('0x17')](0x1f4,_0x448d1d[_0xc898('0x19')]));});});}; \ No newline at end of file +var _0x991d=['WhatsappAccount','options','raw','attributes','include','map','model','ShowWhatsappAccount','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x358cfd,_0x396384){var _0x8de686=function(_0x282fba){while(--_0x282fba){_0x358cfd['push'](_0x358cfd['shift']());}};_0x8de686(++_0x396384);}(_0x991d,0x189));var _0xd991=function(_0xbc464e,_0x558e8e){_0xbc464e=_0xbc464e-0x0;var _0x4ce2ee=_0x991d[_0xbc464e];return _0x4ce2ee;};'use strict';var _=require('lodash');var util=require(_0xd991('0x0'));var moment=require(_0xd991('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd991('0x2'));var db=require(_0xd991('0x3'))['db'];var utils=require(_0xd991('0x4'));var logger=require(_0xd991('0x5'))(_0xd991('0x6'));var config=require(_0xd991('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd991('0x8')]({'port':0x232a});config[_0xd991('0x9')]=_[_0xd991('0xa')](config[_0xd991('0x9')],{'host':_0xd991('0xb'),'port':0x18eb});var socket=require(_0xd991('0xc'))(new Redis(config[_0xd991('0x9')]));require(_0xd991('0xd'))[_0xd991('0xe')](socket);function respondWithRpcPromise(_0x3c76be,_0x4218d8,_0x1c4fbe){return new BPromise(function(_0x23954,_0xaeb6ee){return client[_0xd991('0xf')](_0x3c76be,_0x1c4fbe)[_0xd991('0x10')](function(_0x4f0135){logger[_0xd991('0x11')](_0xd991('0x12'),_0x4218d8,_0xd991('0x13'));logger['debug'](_0xd991('0x14'),_0x4218d8,'request\x20sent',JSON[_0xd991('0x15')](_0x4f0135));if(_0x4f0135[_0xd991('0x16')]){if(_0x4f0135['error'][_0xd991('0x17')]===0x1f4){logger[_0xd991('0x16')](_0xd991('0x12'),_0x4218d8,_0x4f0135[_0xd991('0x16')][_0xd991('0x18')]);return _0xaeb6ee(_0x4f0135[_0xd991('0x16')][_0xd991('0x18')]);}logger[_0xd991('0x16')](_0xd991('0x12'),_0x4218d8,_0x4f0135[_0xd991('0x16')][_0xd991('0x18')]);return _0x23954(_0x4f0135[_0xd991('0x16')][_0xd991('0x18')]);}else{logger[_0xd991('0x11')](_0xd991('0x12'),_0x4218d8,_0xd991('0x13'));_0x23954(_0x4f0135[_0xd991('0x19')]['message']);}})[_0xd991('0x1a')](function(_0x544d67){logger[_0xd991('0x16')](_0xd991('0x12'),_0x4218d8,_0x544d67);_0xaeb6ee(_0x544d67);});});}exports['ShowWhatsappAccount']=function(_0x428dfd){var _0x5abd8c=this;return new Promise(function(_0x590bf1,_0x29b036){return db[_0xd991('0x1b')]['find']({'raw':_0x428dfd[_0xd991('0x1c')]?_0x428dfd['options'][_0xd991('0x1d')]===undefined?!![]:![]:!![],'where':_0x428dfd['options']?_0x428dfd[_0xd991('0x1c')]['where']||null:null,'attributes':_0x428dfd[_0xd991('0x1c')]?_0x428dfd[_0xd991('0x1c')][_0xd991('0x1e')]||null:null,'include':_0x428dfd[_0xd991('0x1c')]?_0x428dfd[_0xd991('0x1c')][_0xd991('0x1f')]?_[_0xd991('0x20')](_0x428dfd[_0xd991('0x1c')][_0xd991('0x1f')],function(_0x22620f){return{'model':db[_0x22620f[_0xd991('0x21')]],'as':_0x22620f['as'],'attributes':_0x22620f[_0xd991('0x1e')],'include':_0x22620f[_0xd991('0x1f')]?_['map'](_0x22620f[_0xd991('0x1f')],function(_0x41f650){return{'model':db[_0x41f650[_0xd991('0x21')]],'as':_0x41f650['as'],'attributes':_0x41f650['attributes'],'include':_0x41f650['include']?_['map'](_0x41f650[_0xd991('0x1f')],function(_0x2bc9a4){return{'model':db[_0x2bc9a4[_0xd991('0x21')]],'as':_0x2bc9a4['as'],'attributes':_0x2bc9a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd991('0x10')](function(_0x4492d9){logger[_0xd991('0x11')]('ShowWhatsappAccount',_0x428dfd);logger['debug']('ShowWhatsappAccount',_0x428dfd,JSON[_0xd991('0x15')](_0x4492d9));_0x590bf1(_0x4492d9);})[_0xd991('0x1a')](function(_0x1883ef){logger['error'](_0xd991('0x22'),_0x1883ef[_0xd991('0x18')],_0x428dfd);_0x29b036(_0x5abd8c[_0xd991('0x16')](0x1f4,_0x1883ef[_0xd991('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 8db2402..d2ab6aa 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 _0x5e48=['save','update','removeListener','register','length','whatsappAccount:'];(function(_0x3d465c,_0x56c113){var _0x12342a=function(_0x2e6616){while(--_0x2e6616){_0x3d465c['push'](_0x3d465c['shift']());}};_0x12342a(++_0x56c113);}(_0x5e48,0x1aa));var _0x85e4=function(_0x583b14,_0x59fe86){_0x583b14=_0x583b14-0x0;var _0x8214dc=_0x5e48[_0x583b14];return _0x8214dc;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x85e4('0x0'),'remove',_0x85e4('0x1')];function createListener(_0x1ec765,_0x42bb0b){return function(_0x986f8b){_0x42bb0b['emit'](_0x1ec765,_0x986f8b);};}function removeListener(_0x3f538e,_0x216a64){return function(){WhatsappAccountEvents[_0x85e4('0x2')](_0x3f538e,_0x216a64);};}exports[_0x85e4('0x3')]=function(_0x57b280){for(var _0xc23afe=0x0,_0x1e5d04=events[_0x85e4('0x4')];_0xc23afe<_0x1e5d04;_0xc23afe++){var _0xb81ad=events[_0xc23afe];var _0x5e939e=createListener(_0x85e4('0x5')+_0xb81ad,_0x57b280);WhatsappAccountEvents['on'](_0xb81ad,_0x5e939e);}}; \ No newline at end of file +var _0x8f31=['removeListener','register','length','whatsappAccount:','remove','update','emit'];(function(_0x30e3ad,_0x2f4323){var _0x1ca439=function(_0x4dbed8){while(--_0x4dbed8){_0x30e3ad['push'](_0x30e3ad['shift']());}};_0x1ca439(++_0x2f4323);}(_0x8f31,0x19a));var _0x18f3=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x8f31[_0x427352];return _0x23e0e6;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x18f3('0x0'),_0x18f3('0x1')];function createListener(_0x515ac7,_0x12c9b5){return function(_0x2309ab){_0x12c9b5[_0x18f3('0x2')](_0x515ac7,_0x2309ab);};}function removeListener(_0x5a6f95,_0x2257d3){return function(){WhatsappAccountEvents[_0x18f3('0x3')](_0x5a6f95,_0x2257d3);};}exports[_0x18f3('0x4')]=function(_0x2934b8){for(var _0x570aa3=0x0,_0x4e048a=events[_0x18f3('0x5')];_0x570aa3<_0x4e048a;_0x570aa3++){var _0x588a9d=events[_0x570aa3];var _0x31aad7=createListener(_0x18f3('0x6')+_0x588a9d,_0x2934b8);WhatsappAccountEvents['on'](_0x588a9d,_0x31aad7);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index d1da187..c42127b 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 _0xf672=['../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5830cd,_0x5b360d){var _0x2de5e3=function(_0x476ce1){while(--_0x476ce1){_0x5830cd['push'](_0x5830cd['shift']());}};_0x2de5e3(++_0x5b360d);}(_0xf672,0x173));var _0x2f67=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf672[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x2f67('0x0'));var util=require('util');var path=require(_0x2f67('0x1'));var timeout=require(_0x2f67('0x2'));var express=require('express');var router=express[_0x2f67('0x3')]();var fs_extra=require(_0x2f67('0x4'));var auth=require(_0x2f67('0x5'));var interaction=require(_0x2f67('0x6'));var config=require(_0x2f67('0x7'));var controller=require(_0x2f67('0x8'));router[_0x2f67('0x9')]('/',auth[_0x2f67('0xa')](),controller[_0x2f67('0xb')]);router['get'](_0x2f67('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2f67('0xd')]('/',auth['isAuthenticated'](),controller[_0x2f67('0xe')]);router['put']('/:id',auth[_0x2f67('0xa')](),controller[_0x2f67('0xf')]);router[_0x2f67('0x10')](_0x2f67('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2f67('0x11')]=router; \ No newline at end of file +var _0xc119=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xc119,0xde));var _0x9c11=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0xc119[_0xd21fe7];return _0x14d570;};'use strict';var multer=require('multer');var util=require(_0x9c11('0x0'));var path=require(_0x9c11('0x1'));var timeout=require(_0x9c11('0x2'));var express=require(_0x9c11('0x3'));var router=express[_0x9c11('0x4')]();var fs_extra=require(_0x9c11('0x5'));var auth=require(_0x9c11('0x6'));var interaction=require(_0x9c11('0x7'));var config=require(_0x9c11('0x8'));var controller=require(_0x9c11('0x9'));router[_0x9c11('0xa')]('/',auth[_0x9c11('0xb')](),controller[_0x9c11('0xc')]);router[_0x9c11('0xa')](_0x9c11('0xd'),auth['isAuthenticated'](),controller[_0x9c11('0xe')]);router[_0x9c11('0xf')]('/',auth[_0x9c11('0xb')](),controller['create']);router[_0x9c11('0x10')](_0x9c11('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9c11('0xd'),auth[_0x9c11('0xb')](),controller[_0x9c11('0x11')]);module[_0x9c11('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index d321c85..72fc45e 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 _0xb32b=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb32b,0x157));var _0xbb32=function(_0x3b0aec,_0x3f8ed6){_0x3b0aec=_0x3b0aec-0x0;var _0x456b78=_0xb32b[_0x3b0aec];return _0x456b78;};'use strict';var Sequelize=require(_0xbb32('0x0'));module[_0xbb32('0x1')]={'priority':{'type':Sequelize[_0xbb32('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbb32('0x3')],'allowNull':![],'defaultValue':_0xbb32('0x4')},'appdata':{'type':Sequelize[_0xbb32('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbb32('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4b67=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x2efd78,_0x2d980c){var _0x1559a5=function(_0x392b08){while(--_0x392b08){_0x2efd78['push'](_0x2efd78['shift']());}};_0x1559a5(++_0x2d980c);}(_0x4b67,0x14b));var _0x74b6=function(_0x53ee47,_0x1444a6){_0x53ee47=_0x53ee47-0x0;var _0xf57b09=_0x4b67[_0x53ee47];return _0xf57b09;};'use strict';var Sequelize=require(_0x74b6('0x0'));module[_0x74b6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x74b6('0x2')],'allowNull':![],'defaultValue':_0x74b6('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x74b6('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x74b6('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 32714ab..71b4fca 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 _0x8af6=['update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','findAll','catch','show','params','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x10eca9,_0x147bf8){var _0x17d5cf=function(_0x659541){while(--_0x659541){_0x10eca9['push'](_0x10eca9['shift']());}};_0x17d5cf(++_0x147bf8);}(_0x8af6,0x76));var _0x68af=function(_0x117edd,_0x16764a){_0x117edd=_0x117edd-0x0;var _0x1605ed=_0x8af6[_0x117edd];return _0x1605ed;};'use strict';var emlformat=require(_0x68af('0x0'));var rimraf=require(_0x68af('0x1'));var zipdir=require(_0x68af('0x2'));var jsonpatch=require(_0x68af('0x3'));var rp=require(_0x68af('0x4'));var moment=require(_0x68af('0x5'));var BPromise=require(_0x68af('0x6'));var Mustache=require(_0x68af('0x7'));var util=require(_0x68af('0x8'));var path=require(_0x68af('0x9'));var sox=require('sox');var csv=require(_0x68af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68af('0xb'));var _=require(_0x68af('0xc'));var squel=require(_0x68af('0xd'));var crypto=require(_0x68af('0xe'));var jsforce=require(_0x68af('0xf'));var deskjs=require(_0x68af('0x10'));var toCsv=require(_0x68af('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x68af('0x11'));var authService=require(_0x68af('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x68af('0x13'));var hardwareService=require(_0x68af('0x14'));var logger=require(_0x68af('0x15'))(_0x68af('0x16'));var utils=require(_0x68af('0x17'));var config=require(_0x68af('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b66bc,_0x48a21d){_0x48a21d=_0x48a21d||0xcc;return function(_0x5cfc81){if(_0x5cfc81){return _0x2b66bc[_0x68af('0x19')](_0x48a21d);}return _0x2b66bc[_0x68af('0x1a')](_0x48a21d)[_0x68af('0x1b')]();};}function respondWithResult(_0x5d8a97,_0x1ab12a){_0x1ab12a=_0x1ab12a||0xc8;return function(_0x50f1ea){if(_0x50f1ea){return _0x5d8a97[_0x68af('0x1a')](_0x1ab12a)[_0x68af('0x1c')](_0x50f1ea);}};}function respondWithFilteredResult(_0x23fc49,_0x2e7e1e){return function(_0x45c41c){if(_0x45c41c){var _0x58764e=typeof _0x2e7e1e[_0x68af('0x1d')]===_0x68af('0x1e')&&typeof _0x2e7e1e[_0x68af('0x1f')]===_0x68af('0x1e');var _0x59d7f3=_0x45c41c['count'];var _0x3aa998=_0x58764e?0x0:_0x2e7e1e[_0x68af('0x1d')];var _0x4e1c41=_0x58764e?_0x45c41c[_0x68af('0x20')]:_0x2e7e1e[_0x68af('0x1d')]+_0x2e7e1e[_0x68af('0x1f')];var _0x1a82f0;if(_0x4e1c41>=_0x59d7f3){_0x4e1c41=_0x59d7f3;_0x1a82f0=0xc8;}else{_0x1a82f0=0xce;}_0x23fc49['status'](_0x1a82f0);return _0x23fc49[_0x68af('0x21')](_0x68af('0x22'),_0x3aa998+'-'+_0x4e1c41+'/'+_0x59d7f3)['json'](_0x45c41c);}return null;};}function patchUpdates(_0x5ad458){return function(_0x257545){try{jsonpatch[_0x68af('0x23')](_0x257545,_0x5ad458,!![]);}catch(_0x14b930){return BPromise[_0x68af('0x24')](_0x14b930);}return _0x257545[_0x68af('0x25')]();};}function saveUpdates(_0x34906b,_0x484fac){return function(_0x25a210){if(_0x25a210){return _0x25a210[_0x68af('0x26')](_0x34906b)['then'](function(_0x3ebd57){return _0x3ebd57;});}return null;};}function removeEntity(_0x539bc0,_0x13af7b){return function(_0x1f0d0e){if(_0x1f0d0e){return _0x1f0d0e[_0x68af('0x27')]()[_0x68af('0x28')](function(){_0x539bc0[_0x68af('0x1a')](0xcc)[_0x68af('0x1b')]();});}};}function handleEntityNotFound(_0x5851b9,_0x514ebc){return function(_0x29f003){if(!_0x29f003){_0x5851b9[_0x68af('0x19')](0x194);}return _0x29f003;};}function handleError(_0x351909,_0x1651de){_0x1651de=_0x1651de||0x1f4;return function(_0x375d38){logger[_0x68af('0x29')](_0x375d38[_0x68af('0x2a')]);if(_0x375d38[_0x68af('0x2b')]){delete _0x375d38['name'];}_0x351909[_0x68af('0x1a')](_0x1651de)[_0x68af('0x2c')](_0x375d38);};}exports[_0x68af('0x2d')]=function(_0x3d1303,_0x4c3b67){var _0x524310={},_0x128d5d={},_0x22f1c7={'count':0x0,'rows':[]};var _0x1cb7c5=_['map'](db['WhatsappApplication'][_0x68af('0x2e')],function(_0x135dc1){return{'name':_0x135dc1['fieldName'],'type':_0x135dc1[_0x68af('0x2f')][_0x68af('0x30')]};});_0x128d5d[_0x68af('0x31')]=_[_0x68af('0x32')](_0x1cb7c5,_0x68af('0x2b'));_0x128d5d[_0x68af('0x33')]=_[_0x68af('0x34')](_0x3d1303['query']);_0x128d5d[_0x68af('0x35')]=_[_0x68af('0x36')](_0x128d5d[_0x68af('0x31')],_0x128d5d['query']);_0x524310[_0x68af('0x37')]=_[_0x68af('0x36')](_0x128d5d['model'],qs[_0x68af('0x38')](_0x3d1303[_0x68af('0x33')]['fields']));_0x524310[_0x68af('0x37')]=_0x524310['attributes']['length']?_0x524310[_0x68af('0x37')]:_0x128d5d[_0x68af('0x31')];if(!_0x3d1303[_0x68af('0x33')][_0x68af('0x39')](_0x68af('0x3a'))){_0x524310[_0x68af('0x1f')]=qs['limit'](_0x3d1303['query']['limit']);_0x524310[_0x68af('0x1d')]=qs[_0x68af('0x1d')](_0x3d1303['query'][_0x68af('0x1d')]);}_0x524310[_0x68af('0x3b')]=qs[_0x68af('0x3c')](_0x3d1303['query'][_0x68af('0x3c')]);_0x524310[_0x68af('0x3d')]=qs[_0x68af('0x35')](_[_0x68af('0x3e')](_0x3d1303[_0x68af('0x33')],_0x128d5d['filters']),_0x1cb7c5);if(_0x3d1303[_0x68af('0x33')][_0x68af('0x3f')]){_0x524310[_0x68af('0x3d')]=_[_0x68af('0x40')](_0x524310[_0x68af('0x3d')],{'$or':_[_0x68af('0x32')](_0x1cb7c5,function(_0x1b4096){if(_0x1b4096[_0x68af('0x2f')]!==_0x68af('0x41')){var _0x3110c4={};_0x3110c4[_0x1b4096['name']]={'$like':'%'+_0x3d1303[_0x68af('0x33')][_0x68af('0x3f')]+'%'};return _0x3110c4;}})});}_0x524310=_['merge']({},_0x524310,_0x3d1303[_0x68af('0x42')]);var _0xfc32e8={'where':_0x524310[_0x68af('0x3d')]};return db[_0x68af('0x43')][_0x68af('0x20')](_0xfc32e8)['then'](function(_0x509177){_0x22f1c7['count']=_0x509177;if(_0x3d1303[_0x68af('0x33')][_0x68af('0x44')]){_0x524310['include']=[{'all':!![]}];}return db[_0x68af('0x43')][_0x68af('0x45')](_0x524310);})[_0x68af('0x28')](function(_0x3bb630){_0x22f1c7['rows']=_0x3bb630;return _0x22f1c7;})[_0x68af('0x28')](respondWithFilteredResult(_0x4c3b67,_0x524310))[_0x68af('0x46')](handleError(_0x4c3b67,null));};exports[_0x68af('0x47')]=function(_0x1f477b,_0x356567){var _0x3b5f44={'raw':!![],'where':{'id':_0x1f477b[_0x68af('0x48')]['id']}},_0x3b0953={};_0x3b0953[_0x68af('0x31')]=_[_0x68af('0x34')](db['WhatsappApplication']['rawAttributes']);_0x3b0953[_0x68af('0x33')]=_[_0x68af('0x34')](_0x1f477b[_0x68af('0x33')]);_0x3b0953[_0x68af('0x35')]=_[_0x68af('0x36')](_0x3b0953['model'],_0x3b0953[_0x68af('0x33')]);_0x3b5f44[_0x68af('0x37')]=_[_0x68af('0x36')](_0x3b0953['model'],qs[_0x68af('0x38')](_0x1f477b[_0x68af('0x33')][_0x68af('0x38')]));_0x3b5f44[_0x68af('0x37')]=_0x3b5f44[_0x68af('0x37')][_0x68af('0x49')]?_0x3b5f44[_0x68af('0x37')]:_0x3b0953['model'];if(_0x1f477b[_0x68af('0x33')][_0x68af('0x44')]){_0x3b5f44[_0x68af('0x4a')]=[{'all':!![]}];}_0x3b5f44=_[_0x68af('0x40')]({},_0x3b5f44,_0x1f477b['options']);return db[_0x68af('0x43')][_0x68af('0x4b')](_0x3b5f44)['then'](handleEntityNotFound(_0x356567,null))[_0x68af('0x28')](respondWithResult(_0x356567,null))['catch'](handleError(_0x356567,null));};exports[_0x68af('0x4c')]=function(_0x5bab92,_0xbec158){return db[_0x68af('0x43')][_0x68af('0x4c')](_0x5bab92[_0x68af('0x4d')],{})[_0x68af('0x28')](respondWithResult(_0xbec158,0xc9))[_0x68af('0x46')](handleError(_0xbec158,null));};exports[_0x68af('0x26')]=function(_0x3b43a6,_0x3544d5){if(_0x3b43a6[_0x68af('0x4d')]['id']){delete _0x3b43a6[_0x68af('0x4d')]['id'];}return db[_0x68af('0x43')]['find']({'where':{'id':_0x3b43a6[_0x68af('0x48')]['id']}})[_0x68af('0x28')](handleEntityNotFound(_0x3544d5,null))['then'](saveUpdates(_0x3b43a6[_0x68af('0x4d')],null))[_0x68af('0x28')](respondWithResult(_0x3544d5,null))[_0x68af('0x46')](handleError(_0x3544d5,null));};exports['destroy']=function(_0x18bbc0,_0x1c6c50){return db[_0x68af('0x43')][_0x68af('0x4b')]({'where':{'id':_0x18bbc0[_0x68af('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c6c50,null))[_0x68af('0x28')](removeEntity(_0x1c6c50,null))[_0x68af('0x46')](handleError(_0x1c6c50,null));}; \ No newline at end of file +var _0x6da9=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappApplication','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xde282,_0x5a0e7f){var _0x40447f=function(_0x5231ed){while(--_0x5231ed){_0xde282['push'](_0xde282['shift']());}};_0x40447f(++_0x5a0e7f);}(_0x6da9,0x161));var _0x96da=function(_0x3408b8,_0x136196){_0x3408b8=_0x3408b8-0x0;var _0x8a8f7=_0x6da9[_0x3408b8];return _0x8a8f7;};'use strict';var emlformat=require(_0x96da('0x0'));var rimraf=require(_0x96da('0x1'));var zipdir=require(_0x96da('0x2'));var jsonpatch=require(_0x96da('0x3'));var rp=require(_0x96da('0x4'));var moment=require(_0x96da('0x5'));var BPromise=require(_0x96da('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x96da('0x7'));var csv=require(_0x96da('0x8'));var ejs=require(_0x96da('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96da('0xa'));var squel=require('squel');var crypto=require(_0x96da('0xb'));var jsforce=require(_0x96da('0xc'));var deskjs=require(_0x96da('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x96da('0xe'));var authService=require(_0x96da('0xf'));var qs=require(_0x96da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96da('0x11'));var logger=require(_0x96da('0x12'))('api');var utils=require(_0x96da('0x13'));var config=require(_0x96da('0x14'));var licenseUtil=require(_0x96da('0x15'));var db=require(_0x96da('0x16'))['db'];function respondWithStatusCode(_0x116c14,_0x1bc58d){_0x1bc58d=_0x1bc58d||0xcc;return function(_0x2cdcdf){if(_0x2cdcdf){return _0x116c14[_0x96da('0x17')](_0x1bc58d);}return _0x116c14[_0x96da('0x18')](_0x1bc58d)['end']();};}function respondWithResult(_0x235e14,_0x3a0a69){_0x3a0a69=_0x3a0a69||0xc8;return function(_0x4807b7){if(_0x4807b7){return _0x235e14['status'](_0x3a0a69)[_0x96da('0x19')](_0x4807b7);}};}function respondWithFilteredResult(_0x3c6b98,_0x5e472e){return function(_0x13f426){if(_0x13f426){var _0x5e6e0a=typeof _0x5e472e[_0x96da('0x1a')]===_0x96da('0x1b')&&typeof _0x5e472e[_0x96da('0x1c')]===_0x96da('0x1b');var _0x17ced1=_0x13f426['count'];var _0x2bfd0c=_0x5e6e0a?0x0:_0x5e472e[_0x96da('0x1a')];var _0x7ac4a5=_0x5e6e0a?_0x13f426[_0x96da('0x1d')]:_0x5e472e['offset']+_0x5e472e[_0x96da('0x1c')];var _0x575c01;if(_0x7ac4a5>=_0x17ced1){_0x7ac4a5=_0x17ced1;_0x575c01=0xc8;}else{_0x575c01=0xce;}_0x3c6b98[_0x96da('0x18')](_0x575c01);return _0x3c6b98[_0x96da('0x1e')](_0x96da('0x1f'),_0x2bfd0c+'-'+_0x7ac4a5+'/'+_0x17ced1)['json'](_0x13f426);}return null;};}function patchUpdates(_0x1037e9){return function(_0x2cc90c){try{jsonpatch[_0x96da('0x20')](_0x2cc90c,_0x1037e9,!![]);}catch(_0x156d1e){return BPromise[_0x96da('0x21')](_0x156d1e);}return _0x2cc90c[_0x96da('0x22')]();};}function saveUpdates(_0x561140,_0x2e1421){return function(_0x27f41e){if(_0x27f41e){return _0x27f41e[_0x96da('0x23')](_0x561140)['then'](function(_0x44e248){return _0x44e248;});}return null;};}function removeEntity(_0x137789,_0x4a9232){return function(_0x1e5871){if(_0x1e5871){return _0x1e5871['destroy']()[_0x96da('0x24')](function(){_0x137789[_0x96da('0x18')](0xcc)[_0x96da('0x25')]();});}};}function handleEntityNotFound(_0x1b29ae,_0x328357){return function(_0x1f7396){if(!_0x1f7396){_0x1b29ae[_0x96da('0x17')](0x194);}return _0x1f7396;};}function handleError(_0x313aaa,_0x2180fd){_0x2180fd=_0x2180fd||0x1f4;return function(_0x2d197f){logger['error'](_0x2d197f[_0x96da('0x26')]);if(_0x2d197f[_0x96da('0x27')]){delete _0x2d197f[_0x96da('0x27')];}_0x313aaa[_0x96da('0x18')](_0x2180fd)[_0x96da('0x28')](_0x2d197f);};}exports[_0x96da('0x29')]=function(_0x315832,_0x51e80c){var _0x2b4fd7={},_0x4241ba={},_0x2d1ac1={'count':0x0,'rows':[]};var _0x59b13d=_['map'](db['WhatsappApplication']['rawAttributes'],function(_0x46d698){return{'name':_0x46d698['fieldName'],'type':_0x46d698[_0x96da('0x2a')][_0x96da('0x2b')]};});_0x4241ba[_0x96da('0x2c')]=_[_0x96da('0x2d')](_0x59b13d,_0x96da('0x27'));_0x4241ba[_0x96da('0x2e')]=_[_0x96da('0x2f')](_0x315832[_0x96da('0x2e')]);_0x4241ba[_0x96da('0x30')]=_['intersection'](_0x4241ba['model'],_0x4241ba[_0x96da('0x2e')]);_0x2b4fd7[_0x96da('0x31')]=_['intersection'](_0x4241ba[_0x96da('0x2c')],qs[_0x96da('0x32')](_0x315832[_0x96da('0x2e')][_0x96da('0x32')]));_0x2b4fd7[_0x96da('0x31')]=_0x2b4fd7[_0x96da('0x31')][_0x96da('0x33')]?_0x2b4fd7[_0x96da('0x31')]:_0x4241ba[_0x96da('0x2c')];if(!_0x315832['query'][_0x96da('0x34')]('nolimit')){_0x2b4fd7['limit']=qs[_0x96da('0x1c')](_0x315832[_0x96da('0x2e')][_0x96da('0x1c')]);_0x2b4fd7[_0x96da('0x1a')]=qs[_0x96da('0x1a')](_0x315832[_0x96da('0x2e')][_0x96da('0x1a')]);}_0x2b4fd7[_0x96da('0x35')]=qs[_0x96da('0x36')](_0x315832[_0x96da('0x2e')][_0x96da('0x36')]);_0x2b4fd7['where']=qs[_0x96da('0x30')](_[_0x96da('0x37')](_0x315832['query'],_0x4241ba['filters']),_0x59b13d);if(_0x315832[_0x96da('0x2e')][_0x96da('0x38')]){_0x2b4fd7[_0x96da('0x39')]=_[_0x96da('0x3a')](_0x2b4fd7[_0x96da('0x39')],{'$or':_['map'](_0x59b13d,function(_0x11afad){if(_0x11afad['type']!==_0x96da('0x3b')){var _0xf60f33={};_0xf60f33[_0x11afad[_0x96da('0x27')]]={'$like':'%'+_0x315832['query']['filter']+'%'};return _0xf60f33;}})});}_0x2b4fd7=_[_0x96da('0x3a')]({},_0x2b4fd7,_0x315832[_0x96da('0x3c')]);var _0x4fdf5d={'where':_0x2b4fd7[_0x96da('0x39')]};return db[_0x96da('0x3d')][_0x96da('0x1d')](_0x4fdf5d)[_0x96da('0x24')](function(_0x1da969){_0x2d1ac1[_0x96da('0x1d')]=_0x1da969;if(_0x315832[_0x96da('0x2e')][_0x96da('0x3e')]){_0x2b4fd7['include']=[{'all':!![]}];}return db[_0x96da('0x3d')][_0x96da('0x3f')](_0x2b4fd7);})['then'](function(_0x2f82fd){_0x2d1ac1[_0x96da('0x40')]=_0x2f82fd;return _0x2d1ac1;})[_0x96da('0x24')](respondWithFilteredResult(_0x51e80c,_0x2b4fd7))[_0x96da('0x41')](handleError(_0x51e80c,null));};exports[_0x96da('0x42')]=function(_0x36ff6c,_0x23a40c){var _0x1e0df0={'raw':!![],'where':{'id':_0x36ff6c[_0x96da('0x43')]['id']}},_0xdccdd7={};_0xdccdd7[_0x96da('0x2c')]=_[_0x96da('0x2f')](db['WhatsappApplication'][_0x96da('0x44')]);_0xdccdd7[_0x96da('0x2e')]=_[_0x96da('0x2f')](_0x36ff6c[_0x96da('0x2e')]);_0xdccdd7[_0x96da('0x30')]=_[_0x96da('0x45')](_0xdccdd7[_0x96da('0x2c')],_0xdccdd7[_0x96da('0x2e')]);_0x1e0df0[_0x96da('0x31')]=_[_0x96da('0x45')](_0xdccdd7['model'],qs[_0x96da('0x32')](_0x36ff6c[_0x96da('0x2e')][_0x96da('0x32')]));_0x1e0df0[_0x96da('0x31')]=_0x1e0df0['attributes'][_0x96da('0x33')]?_0x1e0df0['attributes']:_0xdccdd7[_0x96da('0x2c')];if(_0x36ff6c[_0x96da('0x2e')][_0x96da('0x3e')]){_0x1e0df0[_0x96da('0x46')]=[{'all':!![]}];}_0x1e0df0=_[_0x96da('0x3a')]({},_0x1e0df0,_0x36ff6c[_0x96da('0x3c')]);return db[_0x96da('0x3d')]['find'](_0x1e0df0)[_0x96da('0x24')](handleEntityNotFound(_0x23a40c,null))[_0x96da('0x24')](respondWithResult(_0x23a40c,null))[_0x96da('0x41')](handleError(_0x23a40c,null));};exports[_0x96da('0x47')]=function(_0x20a450,_0x4b541d){return db[_0x96da('0x3d')]['create'](_0x20a450[_0x96da('0x48')],{})[_0x96da('0x24')](respondWithResult(_0x4b541d,0xc9))['catch'](handleError(_0x4b541d,null));};exports[_0x96da('0x23')]=function(_0x296932,_0x48f6bb){if(_0x296932[_0x96da('0x48')]['id']){delete _0x296932[_0x96da('0x48')]['id'];}return db[_0x96da('0x3d')][_0x96da('0x49')]({'where':{'id':_0x296932[_0x96da('0x43')]['id']}})[_0x96da('0x24')](handleEntityNotFound(_0x48f6bb,null))[_0x96da('0x24')](saveUpdates(_0x296932['body'],null))[_0x96da('0x24')](respondWithResult(_0x48f6bb,null))['catch'](handleError(_0x48f6bb,null));};exports[_0x96da('0x4a')]=function(_0x3cb601,_0x266b39){return db[_0x96da('0x3d')][_0x96da('0x49')]({'where':{'id':_0x3cb601['params']['id']}})[_0x96da('0x24')](handleEntityNotFound(_0x266b39,null))[_0x96da('0x24')](removeEntity(_0x266b39,null))['catch'](handleError(_0x266b39,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1efbfad..cd75e0d 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 _0x7fbe=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication'];(function(_0x1658e2,_0x450046){var _0x4e701e=function(_0x522d30){while(--_0x522d30){_0x1658e2['push'](_0x1658e2['shift']());}};_0x4e701e(++_0x450046);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1bef07,_0x2a4e64){_0x1bef07=_0x1bef07-0x0;var _0x29edf6=_0x7fbe[_0x1bef07];return _0x29edf6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe7fb('0xc'),'collate':_0xe7fb('0xd')});}; \ No newline at end of file +var _0xa74a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x468a38,_0xebee57){var _0x160358=function(_0x9c0a43){while(--_0x9c0a43){_0x468a38['push'](_0x468a38['shift']());}};_0x160358(++_0xebee57);}(_0xa74a,0x66));var _0xaa74=function(_0x1177a0,_0x431f77){_0x1177a0=_0x1177a0-0x0;var _0x39714b=_0xa74a[_0x1177a0];return _0x39714b;};'use strict';var _=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var logger=require(_0xaa74('0x2'))(_0xaa74('0x3'));var moment=require(_0xaa74('0x4'));var BPromise=require(_0xaa74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa74('0x6'));var rimraf=require(_0xaa74('0x7'));var config=require(_0xaa74('0x8'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x24eee1,_0x44250c){return _0x24eee1[_0xaa74('0x9')](_0xaa74('0xa'),attributes,{'tableName':_0xaa74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xaa74('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 61da437..f6f841b 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 _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x1a4054,_0x26c993){var _0x19f781=function(_0x53ed67){while(--_0x53ed67){_0x1a4054['push'](_0x1a4054['shift']());}};_0x19f781(++_0x26c993);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x435b97,_0x53eec0){_0x435b97=_0x435b97-0x0;var _0x11b5ac=_0x8d0e[_0x435b97];return _0x11b5ac;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','result'];(function(_0x45268e,_0x5ee19e){var _0x36d493=function(_0x59b799){while(--_0x59b799){_0x45268e['push'](_0x45268e['shift']());}};_0x36d493(++_0x5ee19e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2b0690,_0x4f742f){_0x2b0690=_0x2b0690-0x0;var _0x82be1=_0xf3cd[_0x2b0690];return _0x82be1;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ee45de7..8691baa 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 _0xfb65=['/:id/tags','tracked','addTags','put','whatsapp','update','delete','destroy','removeTags','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage'];(function(_0x102e49,_0x4d6760){var _0x315557=function(_0x35ff3c){while(--_0x35ff3c){_0x102e49['push'](_0x102e49['shift']());}};_0x315557(++_0x4d6760);}(_0xfb65,0x82));var _0x5fb6=function(_0x1789bc,_0x1acf84){_0x1789bc=_0x1789bc-0x0;var _0x35efd1=_0xfb65[_0x1789bc];return _0x35efd1;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0x8')]('/:id/messages',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xe')]);router['get'](_0x5fb6('0xf'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x10')]);router[_0x5fb6('0x11')]('/',auth[_0x5fb6('0xa')](),controller['create']);router[_0x5fb6('0x11')](_0x5fb6('0x12'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x13')]);router[_0x5fb6('0x11')](_0x5fb6('0x14'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')]('whatsapp','whatsappinteraction:addtags'),controller[_0x5fb6('0x16')]);router[_0x5fb6('0x17')]('/:id',auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:update'),controller[_0x5fb6('0x19')]);router[_0x5fb6('0x1a')](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:destroy'),controller[_0x5fb6('0x1b')]);router['delete'](_0x5fb6('0x14'),auth['isAuthenticated'](),controller[_0x5fb6('0x1c')]);module[_0x5fb6('0x1d')]=router; \ No newline at end of file +var _0x277c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','whatsapp','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','path'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x277c,0x153));var _0xc277=function(_0x41afd7,_0x557c6f){_0x41afd7=_0x41afd7-0x0;var _0x4d4ee6=_0x277c[_0x41afd7];return _0x4d4ee6;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xa')](_0xc277('0xe'),auth[_0xc277('0x9')](),controller['getMessages']);router['get'](_0xc277('0xf'),auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')]('/',auth['isAuthenticated'](),controller[_0xc277('0x12')]);router['post'](_0xc277('0xe'),auth[_0xc277('0x9')](),controller[_0xc277('0x13')]);router[_0xc277('0x11')]('/:id/tags',auth[_0xc277('0x9')](),interaction[_0xc277('0x14')](_0xc277('0x15'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xc277('0x16')]('/:id',auth[_0xc277('0x9')](),interaction['tracked'](_0xc277('0x15'),_0xc277('0x17')),controller[_0xc277('0x18')]);router['delete']('/:id',auth[_0xc277('0x9')](),interaction['tracked']('whatsapp',_0xc277('0x19')),controller[_0xc277('0x1a')]);router[_0xc277('0x1b')](_0xc277('0x1c'),auth[_0xc277('0x9')](),controller[_0xc277('0x1d')]);module[_0xc277('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 55a7ce9..1efb694 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 _0xa866=['exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize','moment'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa866,0x6a));var _0x6a86=function(_0x4cefa3,_0x5a4564){_0x4cefa3=_0x4cefa3-0x0;var _0x5a7fb5=_0xa866[_0x4cefa3];return _0x5a7fb5;};'use strict';var Sequelize=require(_0x6a86('0x0'));var moment=require(_0x6a86('0x1'));module[_0x6a86('0x2')]={'closed':{'type':Sequelize[_0x6a86('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6a86('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6a86('0x5')]},'thirdDisposition':{'type':Sequelize[_0x6a86('0x5')]},'note':{'type':Sequelize[_0x6a86('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6a86('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6a86('0x6')]('in',_0x6a86('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6a86('0x6')]('in',_0x6a86('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6a86('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6a86('0x8')]}}; \ No newline at end of file +var _0x88c3=['STRING','DATE','ENUM','out','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x2e4955,_0x275410){var _0x3d8147=function(_0x5c022b){while(--_0x5c022b){_0x2e4955['push'](_0x2e4955['shift']());}};_0x3d8147(++_0x275410);}(_0x88c3,0x1ee));var _0x388c=function(_0x3562eb,_0x31aeea){_0x3562eb=_0x3562eb-0x0;var _0x5ecbb8=_0x88c3[_0x3562eb];return _0x5ecbb8;};'use strict';var Sequelize=require(_0x388c('0x0'));var moment=require('moment');module[_0x388c('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x388c('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x388c('0x2')]},'phone':{'type':Sequelize[_0x388c('0x2')]},'read1stAt':{'type':Sequelize[_0x388c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x388c('0x4')]('in',_0x388c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x388c('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x388c('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x388c('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x388c('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 09f3fb5..70c4c39 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 _0xe4f4=['existsSync','createReadStream','pipe','createWriteStream','direction','out','System','secret','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','then','end','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','whatsapp','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','catch','create','body','update','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','includeAll','rows','addTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','read','WhatsappAccount','Account','Owner','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','basename'];(function(_0x58127c,_0x3f541f){var _0x5a410a=function(_0x5eda9e){while(--_0x5eda9e){_0x58127c['push'](_0x58127c['shift']());}};_0x5a410a(++_0x3f541f);}(_0xe4f4,0x89));var _0x4e4f=function(_0x4ea5cf,_0x4bd89e){_0x4ea5cf=_0x4ea5cf-0x0;var _0xfdfef9=_0xe4f4[_0x4ea5cf];return _0xfdfef9;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4e4f('0x0'));var moment=require(_0x4e4f('0x1'));var BPromise=require('bluebird');var util=require(_0x4e4f('0x2'));var path=require(_0x4e4f('0x3'));var ejs=require(_0x4e4f('0x4'));var fs=require('fs');var _=require(_0x4e4f('0x5'));var Redis=require(_0x4e4f('0x6'));var interaction=require(_0x4e4f('0x7'));var qs=require(_0x4e4f('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x4e4f('0x9'))(_0x4e4f('0xa'));var config=require('../../config/environment');var db=require(_0x4e4f('0xb'))['db'];config[_0x4e4f('0xc')]=_['defaults'](config[_0x4e4f('0xc')],{'host':_0x4e4f('0xd'),'port':0x18eb});var socket=require(_0x4e4f('0xe'))(new Redis(config[_0x4e4f('0xc')]));require(_0x4e4f('0xf'))[_0x4e4f('0x10')](socket);function respondWithStatusCode(_0x5c37aa,_0x5835c0){_0x5835c0=_0x5835c0||0xcc;return function(_0x2be3c5){if(_0x2be3c5){return _0x5c37aa[_0x4e4f('0x11')](_0x5835c0);}return _0x5c37aa[_0x4e4f('0x12')](_0x5835c0)['end']();};}function respondWithResult(_0x2cf8ff,_0x22088e){_0x22088e=_0x22088e||0xc8;return function(_0x1fed3b){if(_0x1fed3b){return _0x2cf8ff[_0x4e4f('0x12')](_0x22088e)[_0x4e4f('0x13')](_0x1fed3b);}};}function respondWithFilteredResult(_0x1fbbb2,_0x554674){return function(_0x1bbf45){if(_0x1bbf45){var _0x414a8e=typeof _0x554674[_0x4e4f('0x14')]==='undefined'&&typeof _0x554674[_0x4e4f('0x15')]===_0x4e4f('0x16');var _0x3d689d=_0x1bbf45[_0x4e4f('0x17')];var _0x55c06e=_0x414a8e?0x0:_0x554674['offset'];var _0x2f2da6=_0x414a8e?_0x1bbf45[_0x4e4f('0x17')]:_0x554674[_0x4e4f('0x14')]+_0x554674[_0x4e4f('0x15')];var _0x48479e;if(_0x2f2da6>=_0x3d689d){_0x2f2da6=_0x3d689d;_0x48479e=0xc8;}else{_0x48479e=0xce;}_0x1fbbb2[_0x4e4f('0x12')](_0x48479e);return _0x1fbbb2['set'](_0x4e4f('0x18'),_0x55c06e+'-'+_0x2f2da6+'/'+_0x3d689d)[_0x4e4f('0x13')](_0x1bbf45);}return null;};}function saveUpdates(_0x3942ad){return function(_0x2cf588){if(_0x2cf588){return _0x2cf588['update'](_0x3942ad)[_0x4e4f('0x19')](function(_0x37d4a8){return _0x37d4a8;});}return null;};}function removeEntity(_0x19f7ff){return function(_0x24c02d){if(_0x24c02d){return _0x24c02d['destroy']()[_0x4e4f('0x19')](function(){_0x19f7ff[_0x4e4f('0x12')](0xcc)[_0x4e4f('0x1a')]();});}};}function handleEntityNotFound(_0x554e2f){return function(_0x4d1936){if(!_0x4d1936){_0x554e2f['sendStatus'](0x194);}return _0x4d1936;};}function handleError(_0x5a872a,_0x297b6f){_0x297b6f=_0x297b6f||0x1f4;return function(_0x599d4c){logger[_0x4e4f('0x1b')](_0x599d4c[_0x4e4f('0x1c')]);if(_0x599d4c[_0x4e4f('0x1d')]){delete _0x599d4c[_0x4e4f('0x1d')];}_0x5a872a['status'](_0x297b6f)[_0x4e4f('0x1e')](_0x599d4c);};}exports['index']=function(_0x30b1e9,_0xb615cb){var _0x301412={};var _0x16d51a=_[_0x4e4f('0x1f')](db[_0x4e4f('0x20')][_0x4e4f('0x21')],function(_0x29b15e){return{'name':_0x29b15e[_0x4e4f('0x22')],'type':_0x29b15e['type'][_0x4e4f('0x23')]};});_0x301412=qs[_0x4e4f('0x24')](_0x16d51a,_0x30b1e9);return interaction[_0x4e4f('0x25')](_0x4e4f('0x26'),_0x30b1e9[_0x4e4f('0x27')],_0x30b1e9[_0x4e4f('0x28')],_0x301412,_0x16d51a)[_0x4e4f('0x19')](respondWithFilteredResult(_0xb615cb,_0x301412))['catch'](handleError(_0xb615cb,null));};exports[_0x4e4f('0x29')]=function(_0x380f72,_0x2b7057){var _0x194ffd={'raw':![],'where':{'id':_0x380f72[_0x4e4f('0x2a')]['id']}},_0x417adb={};_0x417adb[_0x4e4f('0x2b')]=_[_0x4e4f('0x2c')](db[_0x4e4f('0x20')][_0x4e4f('0x21')]);_0x417adb[_0x4e4f('0x27')]=_['keys'](_0x380f72[_0x4e4f('0x27')]);_0x417adb[_0x4e4f('0x2d')]=_[_0x4e4f('0x2e')](_0x417adb[_0x4e4f('0x2b')],_0x417adb[_0x4e4f('0x27')]);_0x194ffd[_0x4e4f('0x2f')]=_[_0x4e4f('0x2e')](_0x417adb[_0x4e4f('0x2b')],qs[_0x4e4f('0x30')](_0x380f72[_0x4e4f('0x27')][_0x4e4f('0x30')]));_0x194ffd[_0x4e4f('0x2f')]=_0x194ffd[_0x4e4f('0x2f')][_0x4e4f('0x31')]?_0x194ffd[_0x4e4f('0x2f')]:_0x417adb['model'];if(_0x380f72[_0x4e4f('0x27')]['includeAll']){_0x194ffd[_0x4e4f('0x32')]=[{'all':!![]}];}_0x194ffd=_[_0x4e4f('0x33')]({},_0x194ffd,_0x380f72[_0x4e4f('0x34')]);return db[_0x4e4f('0x20')][_0x4e4f('0x35')](_0x194ffd)[_0x4e4f('0x19')](handleEntityNotFound(_0x2b7057,null))[_0x4e4f('0x19')](respondWithResult(_0x2b7057,null))[_0x4e4f('0x36')](handleError(_0x2b7057,null));};exports['create']=function(_0x2909b9,_0x55c675){return db[_0x4e4f('0x20')][_0x4e4f('0x37')](_0x2909b9[_0x4e4f('0x38')],{})[_0x4e4f('0x19')](respondWithResult(_0x55c675,0xc9))[_0x4e4f('0x36')](handleError(_0x55c675,null));};exports[_0x4e4f('0x39')]=function(_0x28f5e4,_0x391161){if(_0x28f5e4['body']['id']){delete _0x28f5e4[_0x4e4f('0x38')]['id'];}return db[_0x4e4f('0x20')]['find']({'where':{'id':_0x28f5e4[_0x4e4f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x391161,null))[_0x4e4f('0x19')](saveUpdates(_0x28f5e4[_0x4e4f('0x38')],null))[_0x4e4f('0x19')](respondWithResult(_0x391161,null))['catch'](handleError(_0x391161,null));};exports[_0x4e4f('0x3a')]=function(_0x5169ad,_0x3ad759){return db[_0x4e4f('0x20')]['find']({'where':{'id':_0x5169ad['params']['id']}})[_0x4e4f('0x19')](handleEntityNotFound(_0x3ad759,null))[_0x4e4f('0x19')](removeEntity(_0x3ad759,null))['catch'](handleError(_0x3ad759,null));};exports[_0x4e4f('0x3b')]=function(_0x20555b,_0x9af4f6){return db[_0x4e4f('0x20')][_0x4e4f('0x3b')]()[_0x4e4f('0x19')](respondWithResult(_0x9af4f6,null))[_0x4e4f('0x36')](handleError(_0x9af4f6,null));};exports[_0x4e4f('0x3c')]=function(_0x52888a,_0x1d72b6){return db[_0x4e4f('0x3d')][_0x4e4f('0x35')]({'where':{'id':_0x52888a[_0x4e4f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1d72b6,null))['then'](function(_0x32d446){if(_0x32d446){return _0x32d446[_0x4e4f('0x3c')](_0x52888a[_0x4e4f('0x38')][_0x4e4f('0x3e')],_[_0x4e4f('0x3f')](_0x52888a[_0x4e4f('0x38')],[_0x4e4f('0x3e'),'id'])||{});}})[_0x4e4f('0x19')](respondWithResult(_0x1d72b6,null))['catch'](handleError(_0x1d72b6,null));};exports[_0x4e4f('0x40')]=function(_0x404031,_0x6c73ea){var _0x41a0fe={'raw':![],'where':{}};var _0xd1315={};var _0x55baaa={'count':0x0,'rows':[]};return db[_0x4e4f('0x20')][_0x4e4f('0x41')]({'where':{'id':_0x404031[_0x4e4f('0x2a')]['id']}})[_0x4e4f('0x19')](handleEntityNotFound(_0x6c73ea,null))['then'](function(_0x7cab21){if(_0x7cab21){_0xd1315[_0x4e4f('0x2b')]=_[_0x4e4f('0x2c')](db[_0x4e4f('0x3d')][_0x4e4f('0x21')]);_0xd1315[_0x4e4f('0x27')]=_[_0x4e4f('0x2c')](_0x404031['query']);_0xd1315[_0x4e4f('0x2d')]=_[_0x4e4f('0x2e')](_0xd1315[_0x4e4f('0x2b')],_0xd1315['query']);_0x41a0fe[_0x4e4f('0x2f')]=_[_0x4e4f('0x2e')](_0xd1315[_0x4e4f('0x2b')],qs['fields'](_0x404031[_0x4e4f('0x27')][_0x4e4f('0x30')]));_0x41a0fe[_0x4e4f('0x2f')]=_0x41a0fe[_0x4e4f('0x2f')][_0x4e4f('0x31')]?_0x41a0fe['attributes']:_0xd1315[_0x4e4f('0x2b')];if(!_0x404031[_0x4e4f('0x27')][_0x4e4f('0x42')](_0x4e4f('0x43'))){_0x41a0fe['limit']=qs['limit'](_0x404031['query'][_0x4e4f('0x15')]);_0x41a0fe[_0x4e4f('0x14')]=qs[_0x4e4f('0x14')](_0x404031[_0x4e4f('0x27')][_0x4e4f('0x14')]);}_0x41a0fe[_0x4e4f('0x44')]=qs[_0x4e4f('0x45')](_0x404031[_0x4e4f('0x27')][_0x4e4f('0x45')]);_0x41a0fe[_0x4e4f('0x46')]=qs['filters'](_['pick'](_0x404031[_0x4e4f('0x27')],_0xd1315['filters']));_0x41a0fe[_0x4e4f('0x46')][_0x4e4f('0x47')]=_0x7cab21['id'];if(_0x404031[_0x4e4f('0x27')][_0x4e4f('0x48')]){_0x41a0fe[_0x4e4f('0x46')]=_['merge'](_0x41a0fe[_0x4e4f('0x46')],{'$or':_[_0x4e4f('0x1f')](_0x41a0fe[_0x4e4f('0x2f')],function(_0x1f9237){var _0x389fff={};_0x389fff[_0x1f9237]={'$like':'%'+_0x404031[_0x4e4f('0x27')][_0x4e4f('0x48')]+'%'};return _0x389fff;})});}if(_0x404031[_0x4e4f('0x27')]['$gte']){var _0x341e2a=_0x404031['query'][_0x4e4f('0x49')]['split'](',');var _0x2b202f={};_0x2b202f[_0x341e2a[0x0]]={'$gte':moment(_0x341e2a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x41a0fe[_0x4e4f('0x46')]=_[_0x4e4f('0x33')](_0x41a0fe[_0x4e4f('0x46')],_0x2b202f);}_0x41a0fe=_[_0x4e4f('0x33')]({},_0x41a0fe,_0x404031[_0x4e4f('0x34')]);return db[_0x4e4f('0x3d')][_0x4e4f('0x17')]({'where':_0x41a0fe[_0x4e4f('0x46')]})[_0x4e4f('0x19')](function(_0x392d7f){_0x55baaa[_0x4e4f('0x17')]=_0x392d7f;if(_0x404031[_0x4e4f('0x27')][_0x4e4f('0x4a')]){_0x41a0fe[_0x4e4f('0x32')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x41a0fe);})[_0x4e4f('0x19')](function(_0x42b007){_0x55baaa[_0x4e4f('0x4b')]=_0x42b007;return _0x55baaa;});}})[_0x4e4f('0x19')](respondWithFilteredResult(_0x6c73ea,_0x41a0fe))['catch'](handleError(_0x6c73ea,null));};exports[_0x4e4f('0x4c')]=function(_0x431701,_0x4e640c){return db['WhatsappInteraction'][_0x4e4f('0x35')]({'where':{'id':_0x431701[_0x4e4f('0x2a')]['id']}})[_0x4e4f('0x19')](handleEntityNotFound(_0x4e640c,null))[_0x4e4f('0x19')](function(_0x3a97b5){if(_0x3a97b5){return _0x3a97b5['setTags'](_0x431701[_0x4e4f('0x38')][_0x4e4f('0x3e')],_[_0x4e4f('0x3f')](_0x431701[_0x4e4f('0x38')],[_0x4e4f('0x3e'),'id'])||{})[_0x4e4f('0x4d')](function(){return db[_0x4e4f('0x4e')][_0x4e4f('0x25')]({'attributes':['id',_0x4e4f('0x1d'),_0x4e4f('0x4f')],'where':{'id':_0x431701[_0x4e4f('0x38')][_0x4e4f('0x3e')]}});})[_0x4e4f('0x19')](function(_0x5e410c){socket['emit'](_0x4e4f('0x50'),{'id':Number(_0x431701[_0x4e4f('0x2a')]['id']),'tags':_0x5e410c||[]});return{'id':Number(_0x431701[_0x4e4f('0x2a')]['id']),'tags':_0x5e410c||[]};});}})[_0x4e4f('0x19')](respondWithResult(_0x4e640c,null))[_0x4e4f('0x36')](handleError(_0x4e640c,null));};exports['removeTags']=function(_0xa7395e,_0x4733d5){return db[_0x4e4f('0x20')][_0x4e4f('0x35')]({'where':{'id':_0xa7395e[_0x4e4f('0x2a')]['id']}})[_0x4e4f('0x19')](handleEntityNotFound(_0x4733d5,null))['then'](function(_0xd733b1){if(_0xd733b1){return _0xd733b1[_0x4e4f('0x51')](_0xa7395e[_0x4e4f('0x27')]['ids']);}})[_0x4e4f('0x19')](respondWithStatusCode(_0x4733d5,null))[_0x4e4f('0x36')](handleError(_0x4733d5,null));};exports[_0x4e4f('0x52')]=function(_0x30e1f0,_0x3622fd){var _0x18c6d9=moment()['unix']()['toString']();var _0x490815=path['join'](config[_0x4e4f('0x53')],_0x4e4f('0x54'),_0x4e4f('0x55'),_0x4e4f('0x56'));var _0x3a6e1a=path['join'](config[_0x4e4f('0x53')],_0x4e4f('0x54'),_0x4e4f('0x55'),'attachments');var _0x1dbf2f=path[_0x4e4f('0x57')](_0x490815,_0x18c6d9);var _0x1ac525=util[_0x4e4f('0x58')](_0x4e4f('0x59'),_0x30e1f0[_0x4e4f('0x2a')]['id'],_0x18c6d9);var _0x5233b5=path[_0x4e4f('0x57')](_0x490815,_0x1ac525);var _0x122b29=[];_0x122b29[_0x4e4f('0x5a')]({'model':db[_0x4e4f('0x5b')],'as':_0x4e4f('0x5b'),'attributes':['id',_0x4e4f('0x5c')],'raw':!![]});_0x122b29[_0x4e4f('0x5a')]({'model':db[_0x4e4f('0x5d')],'as':_0x4e4f('0x5e'),'attributes':['id',_0x4e4f('0x5f'),'lastName'],'raw':!![]});if(_0x30e1f0[_0x4e4f('0x27')]['attachments']){_0x122b29['push']({'model':db[_0x4e4f('0x60')],'as':_0x4e4f('0x60'),'raw':!![]});}var _0x17a826=[{'model':db[_0x4e4f('0x3d')],'as':_0x4e4f('0x61'),'attributes':['id',_0x4e4f('0x38'),_0x4e4f('0x62'),'direction','secret',_0x4e4f('0x63')],'include':_0x122b29}];_0x17a826[_0x4e4f('0x5a')]({'model':db[_0x4e4f('0x64')],'as':_0x4e4f('0x65'),'attributes':['id',_0x4e4f('0x1d')]});_0x17a826[_0x4e4f('0x5a')]({'model':db[_0x4e4f('0x5b')],'as':_0x4e4f('0x66'),'attributes':['id',_0x4e4f('0x5c')]});return db[_0x4e4f('0x20')][_0x4e4f('0x35')]({'where':{'id':_0x30e1f0[_0x4e4f('0x2a')]['id']},'include':_0x17a826})['then'](handleEntityNotFound(_0x3622fd,null))['then'](function(_0x2b11e0){if(_0x2b11e0){var _0x3b48b1=_0x2b11e0['get']({'plain':!![]});fs[_0x4e4f('0x67')](_0x1dbf2f);var _0x369e98={'channel':'Whatsapp','account':_0x3b48b1[_0x4e4f('0x65')]['name'],'agent':_0x3b48b1[_0x4e4f('0x66')]?_0x3b48b1['Owner']['fullname']:_0x4e4f('0x68'),'createdAt':moment(_0x3b48b1[_0x4e4f('0x62')])['format'](_0x4e4f('0x69'))[_0x4e4f('0x6a')](),'closedAt':_0x3b48b1[_0x4e4f('0x6b')]?moment(_0x3b48b1[_0x4e4f('0x6c')])[_0x4e4f('0x58')](_0x4e4f('0x69'))['toString']():'','disposition':_0x3b48b1[_0x4e4f('0x6d')],'messages':_(_0x3b48b1[_0x4e4f('0x61')])[_0x4e4f('0x48')]({'secret':![]})[_0x4e4f('0x1f')](function(_0x380205){if(_0x380205[_0x4e4f('0x60')]){var _0xef5002=path[_0x4e4f('0x57')](_0x3a6e1a,_0x380205[_0x4e4f('0x60')][_0x4e4f('0x6e')]);if(fs[_0x4e4f('0x6f')](_0xef5002)){fs[_0x4e4f('0x70')](_0xef5002)[_0x4e4f('0x71')](fs[_0x4e4f('0x72')](path[_0x4e4f('0x57')](_0x1dbf2f,_0x380205[_0x4e4f('0x60')]['basename'])));}}return{'date':moment(_0x380205[_0x4e4f('0x62')])['format'](_0x4e4f('0x69'))[_0x4e4f('0x6a')](),'sender':_0x380205[_0x4e4f('0x73')]===_0x4e4f('0x74')?_0x380205[_0x4e4f('0x5b')]?_0x380205[_0x4e4f('0x5b')][_0x4e4f('0x5c')]:_0x4e4f('0x75'):_0x380205[_0x4e4f('0x5e')]['firstName']+(_0x380205[_0x4e4f('0x5e')]['lastName']?'\x20'+_0x380205[_0x4e4f('0x5e')]['lastName']:''),'body':_0x380205['Attachment']?_0x380205[_0x4e4f('0x60')][_0x4e4f('0x6e')]:_0x380205[_0x4e4f('0x38')],'direction':_0x380205[_0x4e4f('0x73')]===_0x4e4f('0x74')?'A':'C','secret':_0x380205[_0x4e4f('0x76')],'read':_0x380205[_0x4e4f('0x63')],'attachment':_0x380205['Attachment']};})['value']()};return ejs[_0x4e4f('0x77')](path[_0x4e4f('0x57')](config[_0x4e4f('0x53')],_0x4e4f('0x54'),'views',_0x4e4f('0x78')),{'interaction':_0x369e98})['then'](function(_0x20e035){var _0x257b80=path[_0x4e4f('0x57')](_0x1dbf2f,'transcript-'+_0x3b48b1['id']+'-'+_0x18c6d9+_0x4e4f('0x79'));var _0x3bd7e8={'path':_0x257b80,'channel':'Whatsapp','interactionId':_0x3b48b1['id']};return pdf[_0x4e4f('0x7a')](_0x20e035,_0x3bd7e8);})['then'](function(){return new BPromise(function(_0x1db597,_0xc894a8){zipdir(_0x1dbf2f,{'saveTo':_0x5233b5},function(_0xae8d6b,_0x44997d){if(_0xae8d6b)return _0xc894a8(_0xae8d6b);return _0x1db597(_0x44997d);});})['then'](function(){return new BPromise(function(_0xe7652d,_0x3d2502){rimraf(_0x1dbf2f,function(_0x26df69){if(_0x26df69)_0x3d2502(_0x26df69);return _0xe7652d();});});})['then'](function(){return _0x3622fd[_0x4e4f('0x52')](_0x5233b5,_0x1ac525,function(_0xdb4d16){if(_0xdb4d16){console['log']('err',_0xdb4d16);}else{fs[_0x4e4f('0x7b')](_0x5233b5);}});});});}else{return _0x3622fd['sendStatus'](0xc8);}})[_0x4e4f('0x36')](handleError(_0x3622fd,null));}; \ No newline at end of file +var _0x9cd8=['value','renderFile','views','downloadInteraction.ejs','transcript-','Whatsapp','createPdfFromHTML','log','err','unlinkSync','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','end','status','offset','undefined','limit','set','Content-Range','json','update','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','whatsapp','user','then','catch','show','model','keys','WhatsappInteraction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','params','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','count','findAll','rows','addTags','setTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','User','push','CmContact','Contact','firstName','Attachment','createdAt','direction','WhatsappAccount','Account','Owner','fullname','get','N.A.','toString','closed','disposition','basename','existsSync','pipe','createWriteStream','out','lastName','read'];(function(_0xfc3bc1,_0x17900f){var _0x59fa51=function(_0x1c4d51){while(--_0x1c4d51){_0xfc3bc1['push'](_0xfc3bc1['shift']());}};_0x59fa51(++_0x17900f);}(_0x9cd8,0x108));var _0x89cd=function(_0x200ecf,_0xe6e6b6){_0x200ecf=_0x200ecf-0x0;var _0x1d69f3=_0x9cd8[_0x200ecf];return _0x1d69f3;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x89cd('0x0'));var path=require(_0x89cd('0x1'));var ejs=require(_0x89cd('0x2'));var fs=require('fs');var _=require(_0x89cd('0x3'));var Redis=require(_0x89cd('0x4'));var interaction=require(_0x89cd('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x89cd('0x6'));var logger=require(_0x89cd('0x7'))('api');var config=require('../../config/environment');var db=require(_0x89cd('0x8'))['db'];config[_0x89cd('0x9')]=_['defaults'](config[_0x89cd('0x9')],{'host':_0x89cd('0xa'),'port':0x18eb});var socket=require(_0x89cd('0xb'))(new Redis(config['redis']));require(_0x89cd('0xc'))['register'](socket);function respondWithStatusCode(_0xf98a03,_0xfc1071){_0xfc1071=_0xfc1071||0xcc;return function(_0x375ce6){if(_0x375ce6){return _0xf98a03['sendStatus'](_0xfc1071);}return _0xf98a03['status'](_0xfc1071)[_0x89cd('0xd')]();};}function respondWithResult(_0x335634,_0x2c3c28){_0x2c3c28=_0x2c3c28||0xc8;return function(_0x3e5d41){if(_0x3e5d41){return _0x335634[_0x89cd('0xe')](_0x2c3c28)['json'](_0x3e5d41);}};}function respondWithFilteredResult(_0x5c299f,_0x3e91bb){return function(_0x30f4cc){if(_0x30f4cc){var _0x5b4a12=typeof _0x3e91bb[_0x89cd('0xf')]==='undefined'&&typeof _0x3e91bb['limit']===_0x89cd('0x10');var _0x438e75=_0x30f4cc['count'];var _0x4d95ed=_0x5b4a12?0x0:_0x3e91bb['offset'];var _0x4955ca=_0x5b4a12?_0x30f4cc['count']:_0x3e91bb[_0x89cd('0xf')]+_0x3e91bb[_0x89cd('0x11')];var _0x3c8585;if(_0x4955ca>=_0x438e75){_0x4955ca=_0x438e75;_0x3c8585=0xc8;}else{_0x3c8585=0xce;}_0x5c299f['status'](_0x3c8585);return _0x5c299f[_0x89cd('0x12')](_0x89cd('0x13'),_0x4d95ed+'-'+_0x4955ca+'/'+_0x438e75)[_0x89cd('0x14')](_0x30f4cc);}return null;};}function saveUpdates(_0x18c00b){return function(_0x63db45){if(_0x63db45){return _0x63db45[_0x89cd('0x15')](_0x18c00b)['then'](function(_0x58888b){return _0x58888b;});}return null;};}function removeEntity(_0x5c2a59){return function(_0x5c75d7){if(_0x5c75d7){return _0x5c75d7[_0x89cd('0x16')]()['then'](function(){_0x5c2a59[_0x89cd('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a28a4){return function(_0x52def6){if(!_0x52def6){_0x2a28a4[_0x89cd('0x17')](0x194);}return _0x52def6;};}function handleError(_0x12e78c,_0x59c713){_0x59c713=_0x59c713||0x1f4;return function(_0x23d347){logger[_0x89cd('0x18')](_0x23d347[_0x89cd('0x19')]);if(_0x23d347[_0x89cd('0x1a')]){delete _0x23d347[_0x89cd('0x1a')];}_0x12e78c[_0x89cd('0xe')](_0x59c713)['send'](_0x23d347);};}exports[_0x89cd('0x1b')]=function(_0x1595fe,_0x58f8c8){var _0x44c82f={};var _0x339c12=_[_0x89cd('0x1c')](db['WhatsappInteraction'][_0x89cd('0x1d')],function(_0x1d6ce6){return{'name':_0x1d6ce6[_0x89cd('0x1e')],'type':_0x1d6ce6[_0x89cd('0x1f')][_0x89cd('0x20')]};});_0x44c82f=qs[_0x89cd('0x21')](_0x339c12,_0x1595fe);return interaction['findAll'](_0x89cd('0x22'),_0x1595fe['query'],_0x1595fe[_0x89cd('0x23')],_0x44c82f,_0x339c12)[_0x89cd('0x24')](respondWithFilteredResult(_0x58f8c8,_0x44c82f))[_0x89cd('0x25')](handleError(_0x58f8c8,null));};exports[_0x89cd('0x26')]=function(_0x476130,_0x1d269f){var _0x1643dd={'raw':![],'where':{'id':_0x476130['params']['id']}},_0x1458a0={};_0x1458a0[_0x89cd('0x27')]=_[_0x89cd('0x28')](db[_0x89cd('0x29')][_0x89cd('0x1d')]);_0x1458a0['query']=_['keys'](_0x476130[_0x89cd('0x2a')]);_0x1458a0[_0x89cd('0x2b')]=_[_0x89cd('0x2c')](_0x1458a0[_0x89cd('0x27')],_0x1458a0[_0x89cd('0x2a')]);_0x1643dd[_0x89cd('0x2d')]=_['intersection'](_0x1458a0['model'],qs[_0x89cd('0x2e')](_0x476130[_0x89cd('0x2a')][_0x89cd('0x2e')]));_0x1643dd['attributes']=_0x1643dd[_0x89cd('0x2d')][_0x89cd('0x2f')]?_0x1643dd[_0x89cd('0x2d')]:_0x1458a0['model'];if(_0x476130['query'][_0x89cd('0x30')]){_0x1643dd[_0x89cd('0x31')]=[{'all':!![]}];}_0x1643dd=_[_0x89cd('0x32')]({},_0x1643dd,_0x476130['options']);return db[_0x89cd('0x29')][_0x89cd('0x33')](_0x1643dd)['then'](handleEntityNotFound(_0x1d269f,null))['then'](respondWithResult(_0x1d269f,null))['catch'](handleError(_0x1d269f,null));};exports[_0x89cd('0x34')]=function(_0x46ae5c,_0x1bf51a){return db[_0x89cd('0x29')][_0x89cd('0x34')](_0x46ae5c[_0x89cd('0x35')],{})['then'](respondWithResult(_0x1bf51a,0xc9))[_0x89cd('0x25')](handleError(_0x1bf51a,null));};exports[_0x89cd('0x15')]=function(_0x4194f9,_0x59c5bc){if(_0x4194f9['body']['id']){delete _0x4194f9[_0x89cd('0x35')]['id'];}return db[_0x89cd('0x29')][_0x89cd('0x33')]({'where':{'id':_0x4194f9['params']['id']}})[_0x89cd('0x24')](handleEntityNotFound(_0x59c5bc,null))['then'](saveUpdates(_0x4194f9[_0x89cd('0x35')],null))[_0x89cd('0x24')](respondWithResult(_0x59c5bc,null))[_0x89cd('0x25')](handleError(_0x59c5bc,null));};exports['destroy']=function(_0x947617,_0x20fe5f){return db[_0x89cd('0x29')][_0x89cd('0x33')]({'where':{'id':_0x947617[_0x89cd('0x36')]['id']}})[_0x89cd('0x24')](handleEntityNotFound(_0x20fe5f,null))[_0x89cd('0x24')](removeEntity(_0x20fe5f,null))[_0x89cd('0x25')](handleError(_0x20fe5f,null));};exports[_0x89cd('0x37')]=function(_0x49d9fb,_0xce37b0){return db[_0x89cd('0x29')][_0x89cd('0x37')]()[_0x89cd('0x24')](respondWithResult(_0xce37b0,null))['catch'](handleError(_0xce37b0,null));};exports[_0x89cd('0x38')]=function(_0x3f34cd,_0x112077){return db[_0x89cd('0x39')][_0x89cd('0x33')]({'where':{'id':_0x3f34cd['params']['id']}})[_0x89cd('0x24')](handleEntityNotFound(_0x112077,null))[_0x89cd('0x24')](function(_0x54c0c3){if(_0x54c0c3){return _0x54c0c3[_0x89cd('0x38')](_0x3f34cd[_0x89cd('0x35')][_0x89cd('0x3a')],_['omit'](_0x3f34cd[_0x89cd('0x35')],[_0x89cd('0x3a'),'id'])||{});}})[_0x89cd('0x24')](respondWithResult(_0x112077,null))['catch'](handleError(_0x112077,null));};exports[_0x89cd('0x3b')]=function(_0x567eef,_0x34df6b){var _0x469f11={'raw':![],'where':{}};var _0x4ee3c4={};var _0x9dd2c0={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x89cd('0x3c')]({'where':{'id':_0x567eef[_0x89cd('0x36')]['id']}})[_0x89cd('0x24')](handleEntityNotFound(_0x34df6b,null))['then'](function(_0x31bfaf){if(_0x31bfaf){_0x4ee3c4[_0x89cd('0x27')]=_[_0x89cd('0x28')](db[_0x89cd('0x39')][_0x89cd('0x1d')]);_0x4ee3c4[_0x89cd('0x2a')]=_[_0x89cd('0x28')](_0x567eef['query']);_0x4ee3c4[_0x89cd('0x2b')]=_[_0x89cd('0x2c')](_0x4ee3c4[_0x89cd('0x27')],_0x4ee3c4[_0x89cd('0x2a')]);_0x469f11[_0x89cd('0x2d')]=_['intersection'](_0x4ee3c4[_0x89cd('0x27')],qs['fields'](_0x567eef['query'][_0x89cd('0x2e')]));_0x469f11[_0x89cd('0x2d')]=_0x469f11[_0x89cd('0x2d')][_0x89cd('0x2f')]?_0x469f11[_0x89cd('0x2d')]:_0x4ee3c4['model'];if(!_0x567eef[_0x89cd('0x2a')][_0x89cd('0x3d')](_0x89cd('0x3e'))){_0x469f11['limit']=qs['limit'](_0x567eef[_0x89cd('0x2a')][_0x89cd('0x11')]);_0x469f11[_0x89cd('0xf')]=qs[_0x89cd('0xf')](_0x567eef[_0x89cd('0x2a')]['offset']);}_0x469f11[_0x89cd('0x3f')]=qs[_0x89cd('0x40')](_0x567eef[_0x89cd('0x2a')][_0x89cd('0x40')]);_0x469f11[_0x89cd('0x41')]=qs[_0x89cd('0x2b')](_[_0x89cd('0x42')](_0x567eef[_0x89cd('0x2a')],_0x4ee3c4[_0x89cd('0x2b')]));_0x469f11[_0x89cd('0x41')][_0x89cd('0x43')]=_0x31bfaf['id'];if(_0x567eef[_0x89cd('0x2a')][_0x89cd('0x44')]){_0x469f11['where']=_[_0x89cd('0x32')](_0x469f11[_0x89cd('0x41')],{'$or':_[_0x89cd('0x1c')](_0x469f11[_0x89cd('0x2d')],function(_0x537c2a){var _0x5e5556={};_0x5e5556[_0x537c2a]={'$like':'%'+_0x567eef[_0x89cd('0x2a')]['filter']+'%'};return _0x5e5556;})});}if(_0x567eef[_0x89cd('0x2a')]['$gte']){var _0x58aee4=_0x567eef[_0x89cd('0x2a')][_0x89cd('0x45')]['split'](',');var _0xad7fcc={};_0xad7fcc[_0x58aee4[0x0]]={'$gte':moment(_0x58aee4[0x1])['format'](_0x89cd('0x46'))};_0x469f11[_0x89cd('0x41')]=_[_0x89cd('0x32')](_0x469f11['where'],_0xad7fcc);}_0x469f11=_[_0x89cd('0x32')]({},_0x469f11,_0x567eef[_0x89cd('0x47')]);return db[_0x89cd('0x39')][_0x89cd('0x48')]({'where':_0x469f11[_0x89cd('0x41')]})[_0x89cd('0x24')](function(_0x3858b0){_0x9dd2c0[_0x89cd('0x48')]=_0x3858b0;if(_0x567eef[_0x89cd('0x2a')]['includeAll']){_0x469f11[_0x89cd('0x31')]=[{'all':!![]}];}return db[_0x89cd('0x39')][_0x89cd('0x49')](_0x469f11);})[_0x89cd('0x24')](function(_0x380852){_0x9dd2c0[_0x89cd('0x4a')]=_0x380852;return _0x9dd2c0;});}})[_0x89cd('0x24')](respondWithFilteredResult(_0x34df6b,_0x469f11))['catch'](handleError(_0x34df6b,null));};exports[_0x89cd('0x4b')]=function(_0x26a71a,_0x9ebebf){return db[_0x89cd('0x29')]['find']({'where':{'id':_0x26a71a[_0x89cd('0x36')]['id']}})['then'](handleEntityNotFound(_0x9ebebf,null))[_0x89cd('0x24')](function(_0xbbe0){if(_0xbbe0){return _0xbbe0[_0x89cd('0x4c')](_0x26a71a[_0x89cd('0x35')][_0x89cd('0x3a')],_[_0x89cd('0x4d')](_0x26a71a['body'],['ids','id'])||{})[_0x89cd('0x4e')](function(){return db[_0x89cd('0x4f')][_0x89cd('0x49')]({'attributes':['id','name',_0x89cd('0x50')],'where':{'id':_0x26a71a[_0x89cd('0x35')][_0x89cd('0x3a')]}});})[_0x89cd('0x24')](function(_0x3e856a){socket[_0x89cd('0x51')](_0x89cd('0x52'),{'id':Number(_0x26a71a[_0x89cd('0x36')]['id']),'tags':_0x3e856a||[]});return{'id':Number(_0x26a71a['params']['id']),'tags':_0x3e856a||[]};});}})[_0x89cd('0x24')](respondWithResult(_0x9ebebf,null))[_0x89cd('0x25')](handleError(_0x9ebebf,null));};exports['removeTags']=function(_0x205ed6,_0x2ffa54){return db[_0x89cd('0x29')][_0x89cd('0x33')]({'where':{'id':_0x205ed6['params']['id']}})['then'](handleEntityNotFound(_0x2ffa54,null))[_0x89cd('0x24')](function(_0x3617b5){if(_0x3617b5){return _0x3617b5['removeTags'](_0x205ed6['query']['ids']);}})[_0x89cd('0x24')](respondWithStatusCode(_0x2ffa54,null))[_0x89cd('0x25')](handleError(_0x2ffa54,null));};exports[_0x89cd('0x53')]=function(_0x4619bc,_0x1b3a92){var _0x537371=moment()[_0x89cd('0x54')]()['toString']();var _0x392dd0=path[_0x89cd('0x55')](config[_0x89cd('0x56')],_0x89cd('0x57'),_0x89cd('0x58'),_0x89cd('0x59'));var _0x44a9a0=path[_0x89cd('0x55')](config[_0x89cd('0x56')],'server','files',_0x89cd('0x5a'));var _0x4b16ac=path['join'](_0x392dd0,_0x537371);var _0x12ea27=util[_0x89cd('0x5b')](_0x89cd('0x5c'),_0x4619bc[_0x89cd('0x36')]['id'],_0x537371);var _0x5d1b6f=path[_0x89cd('0x55')](_0x392dd0,_0x12ea27);var _0xd83308=[];_0xd83308['push']({'model':db[_0x89cd('0x5d')],'as':_0x89cd('0x5d'),'attributes':['id','fullname'],'raw':!![]});_0xd83308[_0x89cd('0x5e')]({'model':db[_0x89cd('0x5f')],'as':_0x89cd('0x60'),'attributes':['id',_0x89cd('0x61'),'lastName'],'raw':!![]});if(_0x4619bc['query'][_0x89cd('0x5a')]){_0xd83308['push']({'model':db['Attachment'],'as':_0x89cd('0x62'),'raw':!![]});}var _0x26d477=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x89cd('0x35'),_0x89cd('0x63'),_0x89cd('0x64'),'secret','read'],'include':_0xd83308}];_0x26d477[_0x89cd('0x5e')]({'model':db[_0x89cd('0x65')],'as':_0x89cd('0x66'),'attributes':['id','name']});_0x26d477['push']({'model':db[_0x89cd('0x5d')],'as':_0x89cd('0x67'),'attributes':['id',_0x89cd('0x68')]});return db['WhatsappInteraction'][_0x89cd('0x33')]({'where':{'id':_0x4619bc[_0x89cd('0x36')]['id']},'include':_0x26d477})[_0x89cd('0x24')](handleEntityNotFound(_0x1b3a92,null))[_0x89cd('0x24')](function(_0x2e8b60){if(_0x2e8b60){var _0x1ceb71=_0x2e8b60[_0x89cd('0x69')]({'plain':!![]});fs['mkdirSync'](_0x4b16ac);var _0x5dd09a={'channel':'Whatsapp','account':_0x1ceb71[_0x89cd('0x66')][_0x89cd('0x1a')],'agent':_0x1ceb71[_0x89cd('0x67')]?_0x1ceb71[_0x89cd('0x67')][_0x89cd('0x68')]:_0x89cd('0x6a'),'createdAt':moment(_0x1ceb71['createdAt'])[_0x89cd('0x5b')](_0x89cd('0x46'))[_0x89cd('0x6b')](),'closedAt':_0x1ceb71[_0x89cd('0x6c')]?moment(_0x1ceb71['closedAt'])['format'](_0x89cd('0x46'))[_0x89cd('0x6b')]():'','disposition':_0x1ceb71[_0x89cd('0x6d')],'messages':_(_0x1ceb71['Messages'])['filter']({'secret':![]})['map'](function(_0x1226ab){if(_0x1226ab[_0x89cd('0x62')]){var _0x55201a=path[_0x89cd('0x55')](_0x44a9a0,_0x1226ab['Attachment'][_0x89cd('0x6e')]);if(fs[_0x89cd('0x6f')](_0x55201a)){fs['createReadStream'](_0x55201a)[_0x89cd('0x70')](fs[_0x89cd('0x71')](path[_0x89cd('0x55')](_0x4b16ac,_0x1226ab[_0x89cd('0x62')][_0x89cd('0x6e')])));}}return{'date':moment(_0x1226ab['createdAt'])[_0x89cd('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x89cd('0x6b')](),'sender':_0x1226ab[_0x89cd('0x64')]===_0x89cd('0x72')?_0x1226ab[_0x89cd('0x5d')]?_0x1226ab['User'][_0x89cd('0x68')]:'System':_0x1226ab[_0x89cd('0x60')]['firstName']+(_0x1226ab[_0x89cd('0x60')][_0x89cd('0x73')]?'\x20'+_0x1226ab[_0x89cd('0x60')][_0x89cd('0x73')]:''),'body':_0x1226ab[_0x89cd('0x62')]?_0x1226ab[_0x89cd('0x62')][_0x89cd('0x6e')]:_0x1226ab[_0x89cd('0x35')],'direction':_0x1226ab[_0x89cd('0x64')]===_0x89cd('0x72')?'A':'C','secret':_0x1226ab['secret'],'read':_0x1226ab[_0x89cd('0x74')],'attachment':_0x1226ab['Attachment']};})[_0x89cd('0x75')]()};return ejs[_0x89cd('0x76')](path[_0x89cd('0x55')](config[_0x89cd('0x56')],_0x89cd('0x57'),_0x89cd('0x77'),_0x89cd('0x78')),{'interaction':_0x5dd09a})['then'](function(_0x4a6887){var _0x4eac46=path[_0x89cd('0x55')](_0x4b16ac,_0x89cd('0x79')+_0x1ceb71['id']+'-'+_0x537371+'.pdf');var _0x520496={'path':_0x4eac46,'channel':_0x89cd('0x7a'),'interactionId':_0x1ceb71['id']};return pdf[_0x89cd('0x7b')](_0x4a6887,_0x520496);})['then'](function(){return new BPromise(function(_0x4a1873,_0x5a398a){zipdir(_0x4b16ac,{'saveTo':_0x5d1b6f},function(_0x1bc743,_0x1f0fa2){if(_0x1bc743)return _0x5a398a(_0x1bc743);return _0x4a1873(_0x1f0fa2);});})[_0x89cd('0x24')](function(){return new BPromise(function(_0x4c52a0,_0xa6a51b){rimraf(_0x4b16ac,function(_0x2d1596){if(_0x2d1596)_0xa6a51b(_0x2d1596);return _0x4c52a0();});});})[_0x89cd('0x24')](function(){return _0x1b3a92[_0x89cd('0x53')](_0x5d1b6f,_0x12ea27,function(_0x22a1e7){if(_0x22a1e7){console[_0x89cd('0x7c')](_0x89cd('0x7d'),_0x22a1e7);}else{fs[_0x89cd('0x7e')](_0x5d1b6f);}});});});}else{return _0x1b3a92[_0x89cd('0x17')](0xc8);}})['catch'](handleError(_0x1b3a92,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index b86f835..729675a 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 _0x2333=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove'];(function(_0x98e64,_0x216f4d){var _0x48d537=function(_0x573983){while(--_0x573983){_0x98e64['push'](_0x98e64['shift']());}};_0x48d537(++_0x216f4d);}(_0x2333,0x11a));var _0x3233=function(_0x4b9797,_0x1cb2f0){_0x4b9797=_0x4b9797-0x0;var _0x728f1e=_0x2333[_0x4b9797];return _0x728f1e;};'use strict';var EventEmitter=require(_0x3233('0x0'));var WhatsappInteraction=require(_0x3233('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x3233('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3233('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3233('0x4'),'afterDestroy':_0x3233('0x5')};function emitEvent(_0x698dea){return function(_0x30ecc8,_0x40768d,_0x31452c){_0x30ecc8[_0x3233('0x6')]({'attributes':['id'],'raw':!![]})[_0x3233('0x7')](function(_0x1e93e8){_0x30ecc8[_0x3233('0x8')](_0x3233('0x9'),_0x1e93e8[_0x3233('0xa')](function(_0x126cf3){return{'id':_0x126cf3['id']};}));return WhatsappMessage[_0x3233('0xb')]({'where':{'WhatsappInteractionId':_0x30ecc8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3233('0x7')](function(_0x24ad04){_0x30ecc8[_0x3233('0x8')](_0x3233('0xc'),_0x24ad04[_0x3233('0xd')]);WhatsappInteractionEvents[_0x3233('0xe')](_0x698dea+':'+_0x30ecc8['id'],_0x30ecc8);WhatsappInteractionEvents[_0x3233('0xe')](_0x698dea,_0x30ecc8);_0x31452c(null);})['catch'](_0x31452c(null));};}for(var e in events){if(events[_0x3233('0xf')](e)){var event=events[e];WhatsappInteraction[_0x3233('0x10')](e,emitEvent(event));}}module[_0x3233('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x063c=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove'];(function(_0x1cae15,_0x4ef921){var _0x5dc264=function(_0x853032){while(--_0x853032){_0x1cae15['push'](_0x1cae15['shift']());}};_0x5dc264(++_0x4ef921);}(_0x063c,0xba));var _0xc063=function(_0x4c332f,_0x14818c){_0x4c332f=_0x4c332f-0x0;var _0x4cf021=_0x063c[_0x4c332f];return _0x4cf021;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xc063('0x0'))['db'][_0xc063('0x1')];var WhatsappMessage=require(_0xc063('0x0'))['db'][_0xc063('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc063('0x3')](0x0);var events={'afterCreate':_0xc063('0x4'),'afterUpdate':'update','afterDestroy':_0xc063('0x5')};function emitEvent(_0x5ec48e){return function(_0x590831,_0x59b81f,_0x182d20){_0x590831[_0xc063('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3dbe7c){_0x590831[_0xc063('0x7')](_0xc063('0x8'),_0x3dbe7c[_0xc063('0x9')](function(_0x4ac472){return{'id':_0x4ac472['id']};}));return WhatsappMessage[_0xc063('0xa')]({'where':{'WhatsappInteractionId':_0x590831['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc063('0xb')](function(_0x4e788f){_0x590831[_0xc063('0x7')](_0xc063('0xc'),_0x4e788f['length']);WhatsappInteractionEvents[_0xc063('0xd')](_0x5ec48e+':'+_0x590831['id'],_0x590831);WhatsappInteractionEvents['emit'](_0x5ec48e,_0x590831);_0x182d20(null);})['catch'](_0x182d20(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xc063('0xe')](e,emitEvent(event));}}module[_0xc063('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 4306f15..f2c1343 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 _0x745f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x745f,0x1b3));var _0xf745=function(_0x24693e,_0x2ba888){_0x24693e=_0x24693e-0x0;var _0x53e672=_0x745f[_0x24693e];return _0x53e672;};'use strict';var _=require('lodash');var util=require(_0xf745('0x0'));var logger=require(_0xf745('0x1'))(_0xf745('0x2'));var moment=require(_0xf745('0x3'));var BPromise=require(_0xf745('0x4'));var rp=require(_0xf745('0x5'));var fs=require('fs');var path=require(_0xf745('0x6'));var rimraf=require(_0xf745('0x7'));var config=require(_0xf745('0x8'));var attributes=require(_0xf745('0x9'));module['exports']=function(_0x55b9bb,_0x196197){return _0x55b9bb['define']('WhatsappInteraction',attributes,{'tableName':_0xf745('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37aa4a,_0x35bcfe,_0x36e9c8){if(_0x37aa4a[_0xf745('0xb')](_0xf745('0xc'))){_0x37aa4a[_0xf745('0xd')]=moment()[_0xf745('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x36e9c8(null,_0x37aa4a);}}});}; \ No newline at end of file +var _0xb234=['closedAt','../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x34ad81,_0x833bdc){var _0x1ad081=function(_0x5b46cc){while(--_0x5b46cc){_0x34ad81['push'](_0x34ad81['shift']());}};_0x1ad081(++_0x833bdc);}(_0xb234,0xd1));var _0x4b23=function(_0x579e38,_0x525417){_0x579e38=_0x579e38-0x0;var _0x306d51=_0xb234[_0x579e38];return _0x306d51;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b23('0x0'))(_0x4b23('0x1'));var moment=require(_0x4b23('0x2'));var BPromise=require(_0x4b23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b23('0x4'));var rimraf=require('rimraf');var config=require(_0x4b23('0x5'));var attributes=require(_0x4b23('0x6'));module[_0x4b23('0x7')]=function(_0x54bec6,_0x4d66e9){return _0x54bec6['define'](_0x4b23('0x8'),attributes,{'tableName':_0x4b23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15cd50,_0x30e8d3,_0x4b9509){if(_0x15cd50[_0x4b23('0xa')](_0x4b23('0xb'))){_0x15cd50[_0x4b23('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4b9509(null,_0x15cd50);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index eb8afaa..c2670a8 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 _0x19a1=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','stringify','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','request','then','info'];(function(_0x5b589,_0x2b654a){var _0x372e46=function(_0x11da95){while(--_0x11da95){_0x5b589['push'](_0x5b589['shift']());}};_0x372e46(++_0x2b654a);}(_0x19a1,0xf5));var _0x119a=function(_0x90e3d5,_0x3eea2b){_0x90e3d5=_0x90e3d5-0x0;var _0x5c2252=_0x19a1[_0x90e3d5];return _0x5c2252;};'use strict';var _=require(_0x119a('0x0'));var util=require(_0x119a('0x1'));var moment=require(_0x119a('0x2'));var BPromise=require(_0x119a('0x3'));var rs=require(_0x119a('0x4'));var fs=require('fs');var Redis=require(_0x119a('0x5'));var db=require(_0x119a('0x6'))['db'];var utils=require(_0x119a('0x7'));var logger=require(_0x119a('0x8'))('rpc');var config=require(_0x119a('0x9'));var jayson=require(_0x119a('0xa'));var client=jayson['client'][_0x119a('0xb')]({'port':0x232a});config[_0x119a('0xc')]=_[_0x119a('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x119a('0xe'))(new Redis(config['redis']));require(_0x119a('0xf'))['register'](socket);function respondWithRpcPromise(_0x46d580,_0x29269a,_0x356032){return new BPromise(function(_0x5ddee5,_0x166119){return client[_0x119a('0x10')](_0x46d580,_0x356032)[_0x119a('0x11')](function(_0x2449f8){logger[_0x119a('0x12')](_0x119a('0x13'),_0x29269a,_0x119a('0x14'));logger['debug'](_0x119a('0x15'),_0x29269a,'request\x20sent',JSON['stringify'](_0x2449f8));if(_0x2449f8[_0x119a('0x16')]){if(_0x2449f8[_0x119a('0x16')][_0x119a('0x17')]===0x1f4){logger[_0x119a('0x16')](_0x119a('0x13'),_0x29269a,_0x2449f8[_0x119a('0x16')][_0x119a('0x18')]);return _0x166119(_0x2449f8[_0x119a('0x16')][_0x119a('0x18')]);}logger[_0x119a('0x16')](_0x119a('0x13'),_0x29269a,_0x2449f8[_0x119a('0x16')][_0x119a('0x18')]);return _0x5ddee5(_0x2449f8[_0x119a('0x16')][_0x119a('0x18')]);}else{logger[_0x119a('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x29269a,_0x119a('0x14'));_0x5ddee5(_0x2449f8[_0x119a('0x19')][_0x119a('0x18')]);}})[_0x119a('0x1a')](function(_0x2108fc){logger[_0x119a('0x16')](_0x119a('0x13'),_0x29269a,_0x2108fc);_0x166119(_0x2108fc);});});}exports[_0x119a('0x1b')]=function(_0x1a61f5){var _0x2904b6=this;return new Promise(function(_0x28567c,_0x334888){return db[_0x119a('0x1c')][_0x119a('0x1d')](_0x1a61f5[_0x119a('0x1e')],{'raw':_0x1a61f5['options']?_0x1a61f5[_0x119a('0x1f')][_0x119a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a61f5[_0x119a('0x1f')]?_0x1a61f5['options'][_0x119a('0x21')]||null:null,'attributes':_0x1a61f5[_0x119a('0x1f')]?_0x1a61f5['options'][_0x119a('0x22')]||null:null,'limit':_0x1a61f5[_0x119a('0x1f')]?_0x1a61f5[_0x119a('0x1f')][_0x119a('0x23')]||null:null})['then'](function(_0x3ca6a0){logger[_0x119a('0x12')](_0x119a('0x1b'),_0x1a61f5);logger[_0x119a('0x24')]('UpdateWhatsappInteraction',_0x1a61f5,JSON[_0x119a('0x25')](_0x3ca6a0));_0x28567c(_0x3ca6a0);})[_0x119a('0x1a')](function(_0x4388c2){logger[_0x119a('0x16')](_0x119a('0x1b'),_0x4388c2[_0x119a('0x18')],_0x1a61f5);_0x334888(_0x2904b6[_0x119a('0x16')](0x1f4,_0x4388c2[_0x119a('0x18')]));});});};exports[_0x119a('0x26')]=function(_0x5a4e38){return new Promise(function(_0x4c6d76,_0x34d6b5){return db['WhatsappInteraction']['find']({'where':_0x5a4e38['options']?_0x5a4e38[_0x119a('0x1f')][_0x119a('0x21')]||null:null})['then'](function(_0x1c706c){if(_0x1c706c){return _0x1c706c[_0x119a('0x27')](_0x5a4e38[_0x119a('0x1e')][_0x119a('0x28')],_[_0x119a('0x29')](_0x5a4e38[_0x119a('0x1e')],[_0x119a('0x28'),'id'])||{});}})[_0x119a('0x2a')](function(_0x29640a){logger['info'](_0x119a('0x2b'),_0x5a4e38);logger[_0x119a('0x24')]('AddTags',_0x5a4e38,JSON[_0x119a('0x25')](_0x29640a));_0x4c6d76(_0x29640a);})[_0x119a('0x1a')](function(_0x35ba82){logger[_0x119a('0x16')]('AddTags',_0x35ba82[_0x119a('0x18')],_0x5a4e38);_0x34d6b5(_this[_0x119a('0x16')](0x1f4,_0x35ba82[_0x119a('0x18')]));});});}; \ No newline at end of file +var _0x1405=['error','WhatsappInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','AddTagsToWhatsappInteraction','find','ids','omit','spread','info','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','debug','stringify'];(function(_0x51a85c,_0x2660a3){var _0x55001f=function(_0x39ec46){while(--_0x39ec46){_0x51a85c['push'](_0x51a85c['shift']());}};_0x55001f(++_0x2660a3);}(_0x1405,0x1e9));var _0x5140=function(_0x2e9da2,_0x25c4b3){_0x2e9da2=_0x2e9da2-0x0;var _0x5da8ea=_0x1405[_0x2e9da2];return _0x5da8ea;};'use strict';var _=require(_0x5140('0x0'));var util=require(_0x5140('0x1'));var moment=require('moment');var BPromise=require(_0x5140('0x2'));var rs=require(_0x5140('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5140('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5140('0x5'))('rpc');var config=require(_0x5140('0x6'));var jayson=require(_0x5140('0x7'));var client=jayson[_0x5140('0x8')][_0x5140('0x9')]({'port':0x232a});config[_0x5140('0xa')]=_['defaults'](config['redis'],{'host':_0x5140('0xb'),'port':0x18eb});var socket=require(_0x5140('0xc'))(new Redis(config[_0x5140('0xa')]));require(_0x5140('0xd'))['register'](socket);function respondWithRpcPromise(_0xe3d22,_0x14cac4,_0x42a03f){return new BPromise(function(_0xf03e3,_0x5c5f8c){return client[_0x5140('0xe')](_0xe3d22,_0x42a03f)[_0x5140('0xf')](function(_0x3ea638){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x14cac4,'request\x20sent');logger[_0x5140('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x14cac4,'request\x20sent',JSON[_0x5140('0x11')](_0x3ea638));if(_0x3ea638[_0x5140('0x12')]){if(_0x3ea638[_0x5140('0x12')]['code']===0x1f4){logger[_0x5140('0x12')](_0x5140('0x13'),_0x14cac4,_0x3ea638['error'][_0x5140('0x14')]);return _0x5c5f8c(_0x3ea638[_0x5140('0x12')]['message']);}logger[_0x5140('0x12')](_0x5140('0x13'),_0x14cac4,_0x3ea638[_0x5140('0x12')][_0x5140('0x14')]);return _0xf03e3(_0x3ea638[_0x5140('0x12')][_0x5140('0x14')]);}else{logger['info'](_0x5140('0x13'),_0x14cac4,_0x5140('0x15'));_0xf03e3(_0x3ea638[_0x5140('0x16')][_0x5140('0x14')]);}})[_0x5140('0x17')](function(_0xe007d9){logger[_0x5140('0x12')](_0x5140('0x13'),_0x14cac4,_0xe007d9);_0x5c5f8c(_0xe007d9);});});}exports[_0x5140('0x18')]=function(_0x147894){var _0x5e9dee=this;return new Promise(function(_0xd16c24,_0x12e553){return db[_0x5140('0x19')][_0x5140('0x1a')](_0x147894[_0x5140('0x1b')],{'raw':_0x147894[_0x5140('0x1c')]?_0x147894[_0x5140('0x1c')][_0x5140('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x147894[_0x5140('0x1c')]?_0x147894['options'][_0x5140('0x1e')]||null:null,'attributes':_0x147894[_0x5140('0x1c')]?_0x147894[_0x5140('0x1c')]['attributes']||null:null,'limit':_0x147894[_0x5140('0x1c')]?_0x147894[_0x5140('0x1c')][_0x5140('0x1f')]||null:null})[_0x5140('0xf')](function(_0x5a174e){logger['info'](_0x5140('0x18'),_0x147894);logger[_0x5140('0x10')](_0x5140('0x18'),_0x147894,JSON[_0x5140('0x11')](_0x5a174e));_0xd16c24(_0x5a174e);})[_0x5140('0x17')](function(_0x1dfe18){logger[_0x5140('0x12')]('UpdateWhatsappInteraction',_0x1dfe18[_0x5140('0x14')],_0x147894);_0x12e553(_0x5e9dee[_0x5140('0x12')](0x1f4,_0x1dfe18['message']));});});};exports[_0x5140('0x20')]=function(_0xf95b85){return new Promise(function(_0x50cba0,_0x37eaf7){return db[_0x5140('0x19')][_0x5140('0x21')]({'where':_0xf95b85['options']?_0xf95b85[_0x5140('0x1c')][_0x5140('0x1e')]||null:null})[_0x5140('0xf')](function(_0x54ffe1){if(_0x54ffe1){return _0x54ffe1['addTags'](_0xf95b85[_0x5140('0x1b')][_0x5140('0x22')],_[_0x5140('0x23')](_0xf95b85[_0x5140('0x1b')],[_0x5140('0x22'),'id'])||{});}})[_0x5140('0x24')](function(_0x4f99f8){logger[_0x5140('0x25')](_0x5140('0x26'),_0xf95b85);logger[_0x5140('0x10')](_0x5140('0x26'),_0xf95b85,JSON['stringify'](_0x4f99f8));_0x50cba0(_0x4f99f8);})[_0x5140('0x17')](function(_0x541f4a){logger[_0x5140('0x12')](_0x5140('0x26'),_0x541f4a[_0x5140('0x14')],_0xf95b85);_0x37eaf7(_this[_0x5140('0x12')](0x1f4,_0x541f4a[_0x5140('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index b80ea9c..11ebe26 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 _0xe6bb=['save','update','emit','removeListener','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x1c33fb,_0x20df20){var _0x46d6f1=function(_0x7fca8b){while(--_0x7fca8b){_0x1c33fb['push'](_0x1c33fb['shift']());}};_0x46d6f1(++_0x20df20);}(_0xe6bb,0x1f1));var _0xbe6b=function(_0x536d25,_0xc8320a){_0x536d25=_0x536d25-0x0;var _0x2046d1=_0xe6bb[_0x536d25];return _0x2046d1;};'use strict';var WhatsappInteractionEvents=require(_0xbe6b('0x0'));var events=[_0xbe6b('0x1'),'remove',_0xbe6b('0x2')];function createListener(_0x520cc0,_0x3960fb){return function(_0x4a0762){_0x3960fb[_0xbe6b('0x3')](_0x520cc0,_0x4a0762);};}function removeListener(_0x454658,_0x10237e){return function(){WhatsappInteractionEvents[_0xbe6b('0x4')](_0x454658,_0x10237e);};}exports['register']=function(_0x16ddc0){for(var _0x4fc761=0x0,_0x1febc6=events['length'];_0x4fc761<_0x1febc6;_0x4fc761++){var _0x39430e=events[_0x4fc761];var _0x32f926=createListener(_0xbe6b('0x5')+_0x39430e,_0x16ddc0);WhatsappInteractionEvents['on'](_0x39430e,_0x32f926);}}; \ No newline at end of file +var _0x737c=['emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x49eb23,_0x5a2884){var _0x59cf0a=function(_0xa904b5){while(--_0xa904b5){_0x49eb23['push'](_0x49eb23['shift']());}};_0x59cf0a(++_0x5a2884);}(_0x737c,0x10c));var _0xc737=function(_0x24f17b,_0x526ba7){_0x24f17b=_0x24f17b-0x0;var _0x63a9f8=_0x737c[_0x24f17b];return _0x63a9f8;};'use strict';var WhatsappInteractionEvents=require(_0xc737('0x0'));var events=[_0xc737('0x1'),_0xc737('0x2'),_0xc737('0x3')];function createListener(_0x3fa68e,_0x51361a){return function(_0x2dbaf7){_0x51361a[_0xc737('0x4')](_0x3fa68e,_0x2dbaf7);};}function removeListener(_0x5bd644,_0x25917e){return function(){WhatsappInteractionEvents[_0xc737('0x5')](_0x5bd644,_0x25917e);};}exports['register']=function(_0xcbf965){for(var _0x4d4576=0x0,_0x4c1fa1=events[_0xc737('0x6')];_0x4d4576<_0x4c1fa1;_0x4d4576++){var _0x3daa04=events[_0x4d4576];var _0x14fcba=createListener(_0xc737('0x7')+_0x3daa04,_0xcbf965);WhatsappInteractionEvents['on'](_0x3daa04,_0x14fcba);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 8beeaa6..09ccd85 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 _0xcb12=['describe','/:id','show','post','tracked','whatsapp','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0xcb12,0x160));var _0x2cb1=function(_0xb11496,_0x23fb82){_0xb11496=_0xb11496-0x0;var _0x449fa8=_0xcb12[_0xb11496];return _0x449fa8;};'use strict';var multer=require(_0x2cb1('0x0'));var util=require('util');var path=require(_0x2cb1('0x1'));var timeout=require(_0x2cb1('0x2'));var express=require(_0x2cb1('0x3'));var router=express[_0x2cb1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2cb1('0x5'));var interaction=require(_0x2cb1('0x6'));var config=require(_0x2cb1('0x7'));var controller=require('./whatsappMessage.controller');router[_0x2cb1('0x8')]('/',auth[_0x2cb1('0x9')](),controller[_0x2cb1('0xa')]);router[_0x2cb1('0x8')](_0x2cb1('0xb'),auth[_0x2cb1('0x9')](),controller[_0x2cb1('0xc')]);router[_0x2cb1('0x8')](_0x2cb1('0xd'),auth[_0x2cb1('0x9')](),controller[_0x2cb1('0xe')]);router[_0x2cb1('0xf')]('/',auth[_0x2cb1('0x9')](),interaction[_0x2cb1('0x10')](_0x2cb1('0x11'),'whatsappmessage:create'),controller['create']);router['post'](_0x2cb1('0x12'),controller[_0x2cb1('0x13')]);router[_0x2cb1('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2cb1('0x14')](_0x2cb1('0x15'),auth['isAuthenticated'](),controller[_0x2cb1('0x16')]);router[_0x2cb1('0x14')](_0x2cb1('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x2cb1('0x18')]('/:id',auth[_0x2cb1('0x9')](),controller['destroy']);module[_0x2cb1('0x19')]=router; \ No newline at end of file +var _0xc173=['index','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','accept','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc173,0x150));var _0x3c17=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc173[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3c17('0x0'));var util=require(_0x3c17('0x1'));var path=require(_0x3c17('0x2'));var timeout=require(_0x3c17('0x3'));var express=require(_0x3c17('0x4'));var router=express[_0x3c17('0x5')]();var fs_extra=require(_0x3c17('0x6'));var auth=require(_0x3c17('0x7'));var interaction=require(_0x3c17('0x8'));var config=require('../../config/environment');var controller=require(_0x3c17('0x9'));router[_0x3c17('0xa')]('/',auth[_0x3c17('0xb')](),controller[_0x3c17('0xc')]);router[_0x3c17('0xa')]('/describe',auth[_0x3c17('0xb')](),controller[_0x3c17('0xd')]);router[_0x3c17('0xa')](_0x3c17('0xe'),auth[_0x3c17('0xb')](),controller[_0x3c17('0xf')]);router[_0x3c17('0x10')]('/',auth['isAuthenticated'](),interaction[_0x3c17('0x11')](_0x3c17('0x12'),_0x3c17('0x13')),controller[_0x3c17('0x14')]);router['post'](_0x3c17('0x15'),controller[_0x3c17('0x16')]);router[_0x3c17('0x17')](_0x3c17('0xe'),auth['isAuthenticated'](),controller[_0x3c17('0x18')]);router[_0x3c17('0x17')]('/:id/accept',auth[_0x3c17('0xb')](),controller[_0x3c17('0x19')]);router[_0x3c17('0x17')]('/:id/reject',auth['isAuthenticated'](),controller[_0x3c17('0x1a')]);router[_0x3c17('0x1b')](_0x3c17('0xe'),auth[_0x3c17('0xb')](),controller['destroy']);module[_0x3c17('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 3066d9c..8ca925a 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 _0x5aa7=['TEXT','sequelize','exports','out','STRING','DATE'];(function(_0x4c256d,_0x5371b6){var _0x47b25e=function(_0x5d6510){while(--_0x5d6510){_0x4c256d['push'](_0x4c256d['shift']());}};_0x47b25e(++_0x5371b6);}(_0x5aa7,0x151));var _0x75aa=function(_0x224e2b,_0x25925a){_0x224e2b=_0x224e2b-0x0;var _0x48b973=_0x5aa7[_0x224e2b];return _0x48b973;};'use strict';var Sequelize=require(_0x75aa('0x0'));module[_0x75aa('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x75aa('0x2')),'defaultValue':_0x75aa('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x75aa('0x3')](0xbe)},'phone':{'type':Sequelize[_0x75aa('0x3')]},'readAt':{'type':Sequelize[_0x75aa('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x75aa('0x3')]},'providerResponse':{'type':Sequelize[_0x75aa('0x5')]}}; \ No newline at end of file +var _0xdf3b=['DATE','TEXT','exports','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3c8355,_0x32e9ff){var _0x135f7e=function(_0x11802d){while(--_0x11802d){_0x3c8355['push'](_0x3c8355['shift']());}};_0x135f7e(++_0x32e9ff);}(_0xdf3b,0x172));var _0xbdf3=function(_0x25483f,_0x43852f){_0x25483f=_0x25483f-0x0;var _0x220d13=_0xdf3b[_0x25483f];return _0x220d13;};'use strict';var Sequelize=require('sequelize');module[_0xbdf3('0x0')]={'body':{'type':Sequelize['TEXT'](_0xbdf3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xbdf3('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbdf3('0x3')]('in',_0xbdf3('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbdf3('0x5')](0xbe)},'phone':{'type':Sequelize[_0xbdf3('0x5')]},'readAt':{'type':Sequelize[_0xbdf3('0x6')]},'secret':{'type':Sequelize[_0xbdf3('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbdf3('0x5')]},'providerResponse':{'type':Sequelize[_0xbdf3('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 2668dac..375600c 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 _0x7b7f=['fullname','email','internal','manual','interface','SIP/%s','motionChannel','accept','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','channel','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','map','VIRTUAL','options','WhatsappMessage','findAll','rows','show','include','find','create','body','params','describe','whatsapp-interactions','whatsapp','read','readAt','format','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x7b7f,0x1c0));var _0xf7b7=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x7b7f[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7b7('0x0'));var zipdir=require(_0xf7b7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf7b7('0x2'));var BPromise=require(_0xf7b7('0x3'));var Mustache=require(_0xf7b7('0x4'));var util=require(_0xf7b7('0x5'));var path=require(_0xf7b7('0x6'));var sox=require(_0xf7b7('0x7'));var csv=require(_0xf7b7('0x8'));var ejs=require(_0xf7b7('0x9'));var fs=require('fs');var fs_extra=require(_0xf7b7('0xa'));var _=require(_0xf7b7('0xb'));var squel=require(_0xf7b7('0xc'));var crypto=require(_0xf7b7('0xd'));var jsforce=require(_0xf7b7('0xe'));var deskjs=require(_0xf7b7('0xf'));var toCsv=require(_0xf7b7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf7b7('0x10'));var authService=require(_0xf7b7('0x11'));var qs=require(_0xf7b7('0x12'));var as=require(_0xf7b7('0x13'));var hardwareService=require(_0xf7b7('0x14'));var logger=require('../../config/logger')(_0xf7b7('0x15'));var utils=require(_0xf7b7('0x16'));var config=require(_0xf7b7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf7b7('0x18'))['db'];config[_0xf7b7('0x19')]=_[_0xf7b7('0x1a')](config[_0xf7b7('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf7b7('0x19')]));require(_0xf7b7('0x1b'))[_0xf7b7('0x1c')](socket);var jayson=require(_0xf7b7('0x1d'));var client=jayson[_0xf7b7('0x1e')][_0xf7b7('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xf7b7('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5879cd,_0x44f166,_0x2458e8,_0x5f2e11){return new BPromise(function(_0x36ac20,_0x2a7067){var _0xae8767=_0x5f2e11||client;return _0xae8767[_0xf7b7('0x20')](_0x5879cd,_0x2458e8)[_0xf7b7('0x21')](function(_0x42c8bd){logger['info'](_0xf7b7('0x22'),_0x44f166,'request\x20sent');logger[_0xf7b7('0x23')](_0xf7b7('0x24'),_0x44f166,_0xf7b7('0x25'),JSON[_0xf7b7('0x26')](_0x42c8bd));if(_0x42c8bd[_0xf7b7('0x27')]){if(_0x42c8bd[_0xf7b7('0x27')][_0xf7b7('0x28')]===0x1f4){logger[_0xf7b7('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x44f166,_0x42c8bd[_0xf7b7('0x27')]['message']);return _0x2a7067(_0x42c8bd['error']['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x44f166,_0x42c8bd[_0xf7b7('0x27')]['message']);return _0x36ac20(_0x42c8bd[_0xf7b7('0x27')][_0xf7b7('0x29')]);}else{logger[_0xf7b7('0x2a')](_0xf7b7('0x22'),_0x44f166,_0xf7b7('0x25'));_0x36ac20(_0x42c8bd['result'][_0xf7b7('0x29')]);}})[_0xf7b7('0x2b')](function(_0x474cd7){logger[_0xf7b7('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x44f166,_0x474cd7);_0x2a7067(_0x474cd7);});});}function respondWithStatusCode(_0x5d3bf8,_0x3406ec){_0x3406ec=_0x3406ec||0xcc;return function(_0x2c6b28){if(_0x2c6b28){return _0x5d3bf8[_0xf7b7('0x2c')](_0x3406ec);}return _0x5d3bf8[_0xf7b7('0x2d')](_0x3406ec)[_0xf7b7('0x2e')]();};}function respondWithResult(_0x515070,_0x568002){_0x568002=_0x568002||0xc8;return function(_0x208089){if(_0x208089){return _0x515070[_0xf7b7('0x2d')](_0x568002)[_0xf7b7('0x2f')](_0x208089);}};}function respondWithFilteredResult(_0x27e13b,_0x2f42a0){return function(_0x3770d9){if(_0x3770d9){var _0x2bd61e=typeof _0x2f42a0[_0xf7b7('0x30')]===_0xf7b7('0x31')&&typeof _0x2f42a0[_0xf7b7('0x32')]==='undefined';var _0x12bd18=_0x3770d9[_0xf7b7('0x33')];var _0x2fc234=_0x2bd61e?0x0:_0x2f42a0[_0xf7b7('0x30')];var _0xe0c98e=_0x2bd61e?_0x3770d9[_0xf7b7('0x33')]:_0x2f42a0[_0xf7b7('0x30')]+_0x2f42a0['limit'];var _0x180b9e;if(_0xe0c98e>=_0x12bd18){_0xe0c98e=_0x12bd18;_0x180b9e=0xc8;}else{_0x180b9e=0xce;}_0x27e13b['status'](_0x180b9e);return _0x27e13b[_0xf7b7('0x34')]('Content-Range',_0x2fc234+'-'+_0xe0c98e+'/'+_0x12bd18)['json'](_0x3770d9);}return null;};}function patchUpdates(_0x2f7397){return function(_0x58c6d3){try{jsonpatch[_0xf7b7('0x35')](_0x58c6d3,_0x2f7397,!![]);}catch(_0x2a781d){return BPromise['reject'](_0x2a781d);}return _0x58c6d3[_0xf7b7('0x36')]();};}function saveUpdates(_0x2e10d5,_0x36138c){return function(_0x2b104d){if(_0x2b104d){return _0x2b104d[_0xf7b7('0x37')](_0x2e10d5)['then'](function(_0xeaf40d){return _0xeaf40d;});}return null;};}function removeEntity(_0x411eed,_0x487310){return function(_0x3c9e4b){if(_0x3c9e4b){return _0x3c9e4b[_0xf7b7('0x38')]()['then'](function(){_0x411eed['status'](0xcc)[_0xf7b7('0x2e')]();});}};}function handleEntityNotFound(_0x3fca0a,_0x596393){return function(_0x5d25d2){if(!_0x5d25d2){_0x3fca0a[_0xf7b7('0x2c')](0x194);}return _0x5d25d2;};}function handleError(_0x45b33c,_0x5801b4){_0x5801b4=_0x5801b4||0x1f4;return function(_0x172e46){logger[_0xf7b7('0x27')](_0x172e46[_0xf7b7('0x39')]);if(_0x172e46[_0xf7b7('0x3a')]){delete _0x172e46[_0xf7b7('0x3a')];}_0x45b33c['status'](_0x5801b4)[_0xf7b7('0x3b')](_0x172e46);};}exports[_0xf7b7('0x3c')]=function(_0x5b187c,_0x57c319){var _0x51178f={},_0x22d5ae={},_0x4bc1cc={'count':0x0,'rows':[]};var _0x1fdd8b=_['map'](db['WhatsappMessage'][_0xf7b7('0x3d')],function(_0x3a7732){return{'name':_0x3a7732[_0xf7b7('0x3e')],'type':_0x3a7732[_0xf7b7('0x3f')][_0xf7b7('0x40')]};});_0x22d5ae['model']=_['map'](_0x1fdd8b,_0xf7b7('0x3a'));_0x22d5ae[_0xf7b7('0x41')]=_[_0xf7b7('0x42')](_0x5b187c[_0xf7b7('0x41')]);_0x22d5ae[_0xf7b7('0x43')]=_[_0xf7b7('0x44')](_0x22d5ae[_0xf7b7('0x45')],_0x22d5ae[_0xf7b7('0x41')]);_0x51178f[_0xf7b7('0x46')]=_['intersection'](_0x22d5ae[_0xf7b7('0x45')],qs[_0xf7b7('0x47')](_0x5b187c[_0xf7b7('0x41')][_0xf7b7('0x47')]));_0x51178f['attributes']=_0x51178f[_0xf7b7('0x46')][_0xf7b7('0x48')]?_0x51178f[_0xf7b7('0x46')]:_0x22d5ae[_0xf7b7('0x45')];if(!_0x5b187c[_0xf7b7('0x41')]['hasOwnProperty']('nolimit')){_0x51178f['limit']=qs[_0xf7b7('0x32')](_0x5b187c['query']['limit']);_0x51178f['offset']=qs[_0xf7b7('0x30')](_0x5b187c[_0xf7b7('0x41')][_0xf7b7('0x30')]);}_0x51178f[_0xf7b7('0x49')]=qs[_0xf7b7('0x4a')](_0x5b187c[_0xf7b7('0x41')]['sort']);_0x51178f[_0xf7b7('0x4b')]=qs[_0xf7b7('0x43')](_['pick'](_0x5b187c[_0xf7b7('0x41')],_0x22d5ae[_0xf7b7('0x43')]),_0x1fdd8b);if(_0x5b187c[_0xf7b7('0x41')][_0xf7b7('0x4c')]){_0x51178f['where']=_[_0xf7b7('0x4d')](_0x51178f[_0xf7b7('0x4b')],{'$or':_[_0xf7b7('0x4e')](_0x1fdd8b,function(_0x2aa6c9){if(_0x2aa6c9[_0xf7b7('0x3f')]!==_0xf7b7('0x4f')){var _0x4718fb={};_0x4718fb[_0x2aa6c9[_0xf7b7('0x3a')]]={'$like':'%'+_0x5b187c[_0xf7b7('0x41')]['filter']+'%'};return _0x4718fb;}})});}_0x51178f=_['merge']({},_0x51178f,_0x5b187c[_0xf7b7('0x50')]);var _0xbcf699={'where':_0x51178f['where']};return db[_0xf7b7('0x51')][_0xf7b7('0x33')](_0xbcf699)[_0xf7b7('0x21')](function(_0x1fea54){_0x4bc1cc[_0xf7b7('0x33')]=_0x1fea54;if(_0x5b187c[_0xf7b7('0x41')]['includeAll']){_0x51178f['include']=[{'all':!![]}];}return db[_0xf7b7('0x51')][_0xf7b7('0x52')](_0x51178f);})[_0xf7b7('0x21')](function(_0x40026c){_0x4bc1cc[_0xf7b7('0x53')]=_0x40026c;return _0x4bc1cc;})['then'](respondWithFilteredResult(_0x57c319,_0x51178f))[_0xf7b7('0x2b')](handleError(_0x57c319,null));};exports[_0xf7b7('0x54')]=function(_0x1a1820,_0x1c2f25){var _0x194e4b={'raw':!![],'where':{'id':_0x1a1820['params']['id']}},_0x546122={};_0x546122[_0xf7b7('0x45')]=_['keys'](db[_0xf7b7('0x51')][_0xf7b7('0x3d')]);_0x546122[_0xf7b7('0x41')]=_[_0xf7b7('0x42')](_0x1a1820['query']);_0x546122[_0xf7b7('0x43')]=_[_0xf7b7('0x44')](_0x546122['model'],_0x546122[_0xf7b7('0x41')]);_0x194e4b['attributes']=_[_0xf7b7('0x44')](_0x546122['model'],qs[_0xf7b7('0x47')](_0x1a1820[_0xf7b7('0x41')]['fields']));_0x194e4b[_0xf7b7('0x46')]=_0x194e4b[_0xf7b7('0x46')][_0xf7b7('0x48')]?_0x194e4b['attributes']:_0x546122[_0xf7b7('0x45')];if(_0x1a1820[_0xf7b7('0x41')]['includeAll']){_0x194e4b[_0xf7b7('0x55')]=[{'all':!![]}];}_0x194e4b=_[_0xf7b7('0x4d')]({},_0x194e4b,_0x1a1820['options']);return db[_0xf7b7('0x51')][_0xf7b7('0x56')](_0x194e4b)['then'](handleEntityNotFound(_0x1c2f25,null))['then'](respondWithResult(_0x1c2f25,null))[_0xf7b7('0x2b')](handleError(_0x1c2f25,null));};exports[_0xf7b7('0x57')]=function(_0x39f831,_0x55326d){return db['WhatsappMessage'][_0xf7b7('0x57')](_0x39f831[_0xf7b7('0x58')],{})[_0xf7b7('0x21')](respondWithResult(_0x55326d,0xc9))[_0xf7b7('0x2b')](handleError(_0x55326d,null));};exports[_0xf7b7('0x37')]=function(_0x162771,_0x3e4b3e){if(_0x162771[_0xf7b7('0x58')]['id']){delete _0x162771['body']['id'];}return db[_0xf7b7('0x51')]['find']({'where':{'id':_0x162771['params']['id']}})[_0xf7b7('0x21')](handleEntityNotFound(_0x3e4b3e,null))[_0xf7b7('0x21')](saveUpdates(_0x162771['body'],null))[_0xf7b7('0x21')](respondWithResult(_0x3e4b3e,null))[_0xf7b7('0x2b')](handleError(_0x3e4b3e,null));};exports['destroy']=function(_0x5aa922,_0x3ceb88){return db[_0xf7b7('0x51')]['find']({'where':{'id':_0x5aa922[_0xf7b7('0x59')]['id']}})[_0xf7b7('0x21')](handleEntityNotFound(_0x3ceb88,null))[_0xf7b7('0x21')](removeEntity(_0x3ceb88,null))[_0xf7b7('0x2b')](handleError(_0x3ceb88,null));};exports[_0xf7b7('0x5a')]=function(_0xc741c1,_0x26d166){return db[_0xf7b7('0x51')]['describe']()['then'](respondWithResult(_0x26d166,null))[_0xf7b7('0x2b')](handleError(_0x26d166,null));};var interaction_log=require('../../config/logger')(_0xf7b7('0x5b'));exports['accept']=function(_0x4b6e85,_0x454e5a,_0x2224a4){var _0x1f5575={'agent':{},'channel':_0xf7b7('0x5c')};if(_0x4b6e85[_0xf7b7('0x58')]['id']){delete _0x4b6e85['body']['id'];}_0x4b6e85[_0xf7b7('0x58')][_0xf7b7('0x5d')]=!![];_0x4b6e85[_0xf7b7('0x58')][_0xf7b7('0x5e')]=moment()[_0xf7b7('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b6e85[_0xf7b7('0x58')][_0xf7b7('0x60')]=_0x4b6e85[_0xf7b7('0x58')]['UserId']||_0x4b6e85['user']['id'];_0x1f5575[_0xf7b7('0x61')]['id']=_0x4b6e85[_0xf7b7('0x58')][_0xf7b7('0x60')];return db[_0xf7b7('0x51')]['find']({'where':{'id':_0x4b6e85['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x454e5a,null))[_0xf7b7('0x21')](saveUpdates(_0x4b6e85[_0xf7b7('0x58')],null))[_0xf7b7('0x21')](function(_0x5d078b){if(_0x5d078b){_0x1f5575['message']=_0x5d078b[_0xf7b7('0x62')]({'plain':!![]});return db[_0xf7b7('0x63')][_0xf7b7('0x56')]({'where':{'id':_0x5d078b[_0xf7b7('0x64')]}});}return null;})[_0xf7b7('0x21')](handleEntityNotFound(_0x454e5a,null))[_0xf7b7('0x21')](function(_0x11312c){if(_0x11312c){return _0x11312c[_0xf7b7('0x37')]({'UserId':_0x4b6e85[_0xf7b7('0x58')][_0xf7b7('0x60')],'read1stAt':_[_0xf7b7('0x65')](_0x11312c[_0xf7b7('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf7b7('0x21')](function(_0x41a56c){if(_0x41a56c){_0x1f5575[_0xf7b7('0x67')]=_0x41a56c[_0xf7b7('0x62')]({'plain':!![]});interaction_log[_0xf7b7('0x2a')](_0xf7b7('0x68'),_0x4b6e85[_0xf7b7('0x69')]['id'],_0x4b6e85[_0xf7b7('0x69')][_0xf7b7('0x3a')],_0x4b6e85[_0xf7b7('0x69')]['role'],_0x1f5575[_0xf7b7('0x67')]['id'],_0x4b6e85[_0xf7b7('0x58')]?JSON[_0xf7b7('0x26')](_0x4b6e85[_0xf7b7('0x58')]):_0xf7b7('0x6a'));return respondWithRpcPromise(_0xf7b7('0x6b'),_0xf7b7('0x6c'),_0x1f5575);}return null;})['then'](function(_0x58fa66){var _0x4f71cb=_0xf7b7('0x6d')+_0x58fa66['message'][_0xf7b7('0x6e')];return db[_0xf7b7('0x6f')]['query'](_0x4f71cb,{'type':db[_0xf7b7('0x70')][_0xf7b7('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x191b40){return _0x191b40;});})[_0xf7b7('0x21')](function(_0x498107){if(_0x498107){_0x1f5575[_0xf7b7('0x29')][_0xf7b7('0x72')]=_0x498107[0x0];if(!_0x4b6e85[_0xf7b7('0x58')]['UserId'])return;return db[_0xf7b7('0x73')]['find']({'where':{'id':_0x4b6e85[_0xf7b7('0x58')][_0xf7b7('0x60')],'role':_0xf7b7('0x61')},'attributes':['id','name',_0xf7b7('0x74'),_0xf7b7('0x75'),_0xf7b7('0x76')],'raw':!![]});}return null;})['then'](function(_0x38fb89){if(!_0x38fb89)return null;_0x1f5575[_0xf7b7('0x29')]['agent']=_0x38fb89;return _0x1f5575;})[_0xf7b7('0x21')](function(_0x45d949){if(_0x45d949){if(_0x4b6e85[_0xf7b7('0x58')][_0xf7b7('0x77')]){_0x1f5575[_0xf7b7('0x29')][_0xf7b7('0x78')]=util['format'](_0xf7b7('0x79'),_0x4b6e85[_0xf7b7('0x69')]['name']);_0x1f5575[_0xf7b7('0x29')]['channel']=_0x1f5575['channel'];_0x1f5575[_0xf7b7('0x29')][_0xf7b7('0x7a')]=_0x1f5575['channel'];_0x1f5575['message']['event']=_0xf7b7('0x7b');return respondWithRpcPromise(_0xf7b7('0x7c'),_0xf7b7('0x7c'),{'event':_0xf7b7('0x7d'),'message':_0x1f5575[_0xf7b7('0x29')]},client9002)['then'](function(){return _0x1f5575;});}return _0x1f5575;}return null;})['then'](respondWithResult(_0x454e5a,null))[_0xf7b7('0x2b')](handleError(_0x454e5a,null));};var interaction_log=require('../../config/logger')(_0xf7b7('0x5b'));exports[_0xf7b7('0x7e')]=function(_0x3a5bb8,_0x30d995,_0xd6ecc6){var _0x394435={'agent':{},'channel':_0xf7b7('0x5c')};if(_0x3a5bb8['body']['id']){delete _0x3a5bb8[_0xf7b7('0x58')]['id'];}_0x3a5bb8['body'][_0xf7b7('0x60')]=_0x3a5bb8[_0xf7b7('0x58')]['UserId']||_0x3a5bb8[_0xf7b7('0x69')]['id'];_0x394435[_0xf7b7('0x61')]['id']=_0x3a5bb8['body'][_0xf7b7('0x60')];return db[_0xf7b7('0x51')][_0xf7b7('0x56')]({'where':{'id':_0x3a5bb8[_0xf7b7('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30d995,null))[_0xf7b7('0x21')](function(_0xcedd35){if(_0xcedd35){_0x394435[_0xf7b7('0x29')]=_0xcedd35[_0xf7b7('0x62')]({'plain':!![]});return db[_0xf7b7('0x63')]['find']({'where':{'id':_0xcedd35[_0xf7b7('0x64')]}});}return null;})[_0xf7b7('0x21')](handleEntityNotFound(_0x30d995,null))[_0xf7b7('0x21')](function(_0x14e302){if(_0x14e302){_0x394435[_0xf7b7('0x67')]=_0x14e302['get']({'plain':!![]});interaction_log['info'](_0xf7b7('0x7f'),_0x3a5bb8[_0xf7b7('0x69')]['id'],_0x3a5bb8[_0xf7b7('0x69')][_0xf7b7('0x3a')],_0x3a5bb8[_0xf7b7('0x69')][_0xf7b7('0x80')],_0x394435[_0xf7b7('0x67')]['id'],_0x3a5bb8[_0xf7b7('0x58')]?JSON[_0xf7b7('0x26')](_0x3a5bb8['body']):_0xf7b7('0x6a'));return respondWithRpcPromise('RejectMessage',_0xf7b7('0x81'),_0x394435);}return null;})[_0xf7b7('0x21')](function(_0x477c35){var _0x3b8153='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x477c35['message'][_0xf7b7('0x6e')];return db[_0xf7b7('0x6f')][_0xf7b7('0x41')](_0x3b8153,{'type':db['Sequelize'][_0xf7b7('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x6768be){return _0x6768be;});})[_0xf7b7('0x21')](function(_0x362cf5){if(_0x362cf5){_0x394435[_0xf7b7('0x29')][_0xf7b7('0x72')]=_0x362cf5[0x0];if(!_0x3a5bb8[_0xf7b7('0x58')][_0xf7b7('0x60')])return;return db[_0xf7b7('0x73')][_0xf7b7('0x56')]({'where':{'id':_0x3a5bb8['body']['UserId'],'role':_0xf7b7('0x61')},'attributes':['id','name',_0xf7b7('0x74'),_0xf7b7('0x75'),_0xf7b7('0x76')],'raw':!![]});}return null;})[_0xf7b7('0x21')](function(_0x5c74fc){if(!_0x5c74fc)return null;_0x394435['message'][_0xf7b7('0x61')]=_0x5c74fc;return _0x394435;})[_0xf7b7('0x21')](function(_0x10fb88){if(_0x10fb88){_0x10fb88['message'][_0xf7b7('0x78')]=util[_0xf7b7('0x5f')](_0xf7b7('0x79'),_0x3a5bb8[_0xf7b7('0x69')]['name']);_0x10fb88[_0xf7b7('0x29')][_0xf7b7('0x82')]=_0x394435[_0xf7b7('0x82')];_0x10fb88[_0xf7b7('0x29')]['motionChannel']=_0x394435[_0xf7b7('0x82')];_0x10fb88[_0xf7b7('0x29')][_0xf7b7('0x83')]=_0xf7b7('0x7e');respondWithRpcPromise(_0xf7b7('0x7c'),_0xf7b7('0x7c'),{'event':'rejectmessage','message':_0x10fb88['message']},client9002);return _0x394435;}return null;})[_0xf7b7('0x21')](respondWithResult(_0x30d995,null))['catch'](handleError(_0x30d995,null));};exports['status']=function(_0x5f3a3c,_0x4c7f71,_0x27ce6a){if(_0x5f3a3c['body']['id']){delete _0x5f3a3c[_0xf7b7('0x58')]['id'];}var _0x4c51bd;return db[_0xf7b7('0x51')][_0xf7b7('0x56')]({'where':{'id':_0x5f3a3c[_0xf7b7('0x59')]['id']}})[_0xf7b7('0x21')](handleEntityNotFound(_0x4c7f71,null))[_0xf7b7('0x21')](function(_0x2a23eb){if(_0x2a23eb){_0x4c51bd=_0x2a23eb;return db[_0xf7b7('0x84')]['find']({'where':{'id':_0x2a23eb[_0xf7b7('0x85')]}});}})[_0xf7b7('0x21')](handleEntityNotFound(_0x4c7f71,null))[_0xf7b7('0x21')](function(_0x46a73b){if(_0x46a73b){logger[_0xf7b7('0x23')](_0xf7b7('0x86'),'status','received\x20delivery\x20report\x20from',_0x46a73b['type'],util[_0xf7b7('0x87')](_0x5f3a3c[_0xf7b7('0x58')],{'showHidden':![],'depth':null}));switch(_0x46a73b[_0xf7b7('0x3f')]){case _0xf7b7('0x88'):if(_0x5f3a3c['body']['MessageSid']&&_0x5f3a3c['body'][_0xf7b7('0x89')]===_0x4c51bd[_0xf7b7('0x8a')]&&_0x5f3a3c[_0xf7b7('0x58')][_0xf7b7('0x8b')]&&_0x5f3a3c[_0xf7b7('0x58')][_0xf7b7('0x8b')]===_0xf7b7('0x5d')){return _0x4c51bd[_0xf7b7('0x37')]({'read':!![]});}else{logger['error'](_0xf7b7('0x8c'),'status',_0xf7b7('0x88'),util['inspect'](_0x5f3a3c['body'],{'showHidden':![],'depth':null}));}break;}return _0x4c51bd;}})[_0xf7b7('0x21')](respondWithResult(_0x4c7f71,null))[_0xf7b7('0x2b')](handleError(_0x4c7f71,null));}; \ No newline at end of file +var _0x6e79=['YYYY-MM-DD\x20HH:mm:ss','[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','contact','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','internal','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','stack','index','map','rawAttributes','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','WhatsappMessage','findAll','rows','show','create','body','find','params','destroy','describe','accept','read','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt'];(function(_0x486aa7,_0x53f341){var _0x30133c=function(_0x2eff80){while(--_0x2eff80){_0x486aa7['push'](_0x486aa7['shift']());}};_0x30133c(++_0x53f341);}(_0x6e79,0x13c));var _0x96e7=function(_0x2c0bee,_0x2e4333){_0x2c0bee=_0x2c0bee-0x0;var _0xb91411=_0x6e79[_0x2c0bee];return _0xb91411;};'use strict';var emlformat=require(_0x96e7('0x0'));var rimraf=require(_0x96e7('0x1'));var zipdir=require(_0x96e7('0x2'));var jsonpatch=require(_0x96e7('0x3'));var rp=require(_0x96e7('0x4'));var moment=require(_0x96e7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x96e7('0x6'));var util=require(_0x96e7('0x7'));var path=require(_0x96e7('0x8'));var sox=require('sox');var csv=require(_0x96e7('0x9'));var ejs=require(_0x96e7('0xa'));var fs=require('fs');var fs_extra=require(_0x96e7('0xb'));var _=require(_0x96e7('0xc'));var squel=require('squel');var crypto=require(_0x96e7('0xd'));var jsforce=require(_0x96e7('0xe'));var deskjs=require(_0x96e7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x96e7('0x10'));var Papa=require(_0x96e7('0x11'));var Redis=require('ioredis');var authService=require(_0x96e7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x96e7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96e7('0x14'))(_0x96e7('0x15'));var utils=require(_0x96e7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x96e7('0x17'));var db=require(_0x96e7('0x18'))['db'];config[_0x96e7('0x19')]=_['defaults'](config[_0x96e7('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x96e7('0x1a'))(new Redis(config[_0x96e7('0x19')]));require(_0x96e7('0x1b'))[_0x96e7('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x96e7('0x1d')][_0x96e7('0x1e')]({'port':0x232c});var client9002=jayson[_0x96e7('0x1d')][_0x96e7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x17cd5a,_0x1253a2,_0x1e016f,_0x37a484){return new BPromise(function(_0x53ace2,_0x543fc5){var _0x1694f6=_0x37a484||client;return _0x1694f6[_0x96e7('0x1f')](_0x17cd5a,_0x1e016f)[_0x96e7('0x20')](function(_0x296a5f){logger[_0x96e7('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x1253a2,_0x96e7('0x22'));logger['debug'](_0x96e7('0x23'),_0x1253a2,'request\x20sent',JSON[_0x96e7('0x24')](_0x296a5f));if(_0x296a5f['error']){if(_0x296a5f[_0x96e7('0x25')][_0x96e7('0x26')]===0x1f4){logger[_0x96e7('0x25')](_0x96e7('0x27'),_0x1253a2,_0x296a5f[_0x96e7('0x25')][_0x96e7('0x28')]);return _0x543fc5(_0x296a5f[_0x96e7('0x25')][_0x96e7('0x28')]);}logger['error'](_0x96e7('0x27'),_0x1253a2,_0x296a5f[_0x96e7('0x25')][_0x96e7('0x28')]);return _0x53ace2(_0x296a5f[_0x96e7('0x25')][_0x96e7('0x28')]);}else{logger['info'](_0x96e7('0x27'),_0x1253a2,_0x96e7('0x22'));_0x53ace2(_0x296a5f['result'][_0x96e7('0x28')]);}})[_0x96e7('0x29')](function(_0x200fa2){logger[_0x96e7('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x1253a2,_0x200fa2);_0x543fc5(_0x200fa2);});});}function respondWithStatusCode(_0x3a5100,_0x3a74d1){_0x3a74d1=_0x3a74d1||0xcc;return function(_0xc10614){if(_0xc10614){return _0x3a5100[_0x96e7('0x2a')](_0x3a74d1);}return _0x3a5100['status'](_0x3a74d1)[_0x96e7('0x2b')]();};}function respondWithResult(_0x2c05c1,_0x47d76c){_0x47d76c=_0x47d76c||0xc8;return function(_0x2c09aa){if(_0x2c09aa){return _0x2c05c1[_0x96e7('0x2c')](_0x47d76c)[_0x96e7('0x2d')](_0x2c09aa);}};}function respondWithFilteredResult(_0x15549a,_0x1f8eb8){return function(_0x4425ff){if(_0x4425ff){var _0x25c7eb=typeof _0x1f8eb8['offset']===_0x96e7('0x2e')&&typeof _0x1f8eb8['limit']===_0x96e7('0x2e');var _0x45a398=_0x4425ff[_0x96e7('0x2f')];var _0x4d4345=_0x25c7eb?0x0:_0x1f8eb8[_0x96e7('0x30')];var _0x4cef3a=_0x25c7eb?_0x4425ff[_0x96e7('0x2f')]:_0x1f8eb8[_0x96e7('0x30')]+_0x1f8eb8[_0x96e7('0x31')];var _0x105451;if(_0x4cef3a>=_0x45a398){_0x4cef3a=_0x45a398;_0x105451=0xc8;}else{_0x105451=0xce;}_0x15549a[_0x96e7('0x2c')](_0x105451);return _0x15549a[_0x96e7('0x32')](_0x96e7('0x33'),_0x4d4345+'-'+_0x4cef3a+'/'+_0x45a398)['json'](_0x4425ff);}return null;};}function patchUpdates(_0x3ec65c){return function(_0x5e9f41){try{jsonpatch[_0x96e7('0x34')](_0x5e9f41,_0x3ec65c,!![]);}catch(_0x5bcc27){return BPromise['reject'](_0x5bcc27);}return _0x5e9f41[_0x96e7('0x35')]();};}function saveUpdates(_0x115e32,_0x3d7ffa){return function(_0xad2de2){if(_0xad2de2){return _0xad2de2[_0x96e7('0x36')](_0x115e32)[_0x96e7('0x20')](function(_0xbf2655){return _0xbf2655;});}return null;};}function removeEntity(_0x42ab75,_0xe461a4){return function(_0x342687){if(_0x342687){return _0x342687['destroy']()[_0x96e7('0x20')](function(){_0x42ab75['status'](0xcc)[_0x96e7('0x2b')]();});}};}function handleEntityNotFound(_0xe48269,_0x5e3ea9){return function(_0x46689a){if(!_0x46689a){_0xe48269['sendStatus'](0x194);}return _0x46689a;};}function handleError(_0x20c1e2,_0x57c786){_0x57c786=_0x57c786||0x1f4;return function(_0x44bd4c){logger['error'](_0x44bd4c[_0x96e7('0x37')]);if(_0x44bd4c['name']){delete _0x44bd4c['name'];}_0x20c1e2[_0x96e7('0x2c')](_0x57c786)['send'](_0x44bd4c);};}exports[_0x96e7('0x38')]=function(_0x5c9815,_0x2894be){var _0x4b1e47={},_0x5b53dc={},_0x61e6f3={'count':0x0,'rows':[]};var _0x59c872=_[_0x96e7('0x39')](db['WhatsappMessage'][_0x96e7('0x3a')],function(_0xdde7d0){return{'name':_0xdde7d0['fieldName'],'type':_0xdde7d0[_0x96e7('0x3b')][_0x96e7('0x3c')]};});_0x5b53dc['model']=_['map'](_0x59c872,_0x96e7('0x3d'));_0x5b53dc[_0x96e7('0x3e')]=_[_0x96e7('0x3f')](_0x5c9815[_0x96e7('0x3e')]);_0x5b53dc['filters']=_[_0x96e7('0x40')](_0x5b53dc[_0x96e7('0x41')],_0x5b53dc[_0x96e7('0x3e')]);_0x4b1e47[_0x96e7('0x42')]=_[_0x96e7('0x40')](_0x5b53dc['model'],qs['fields'](_0x5c9815[_0x96e7('0x3e')][_0x96e7('0x43')]));_0x4b1e47[_0x96e7('0x42')]=_0x4b1e47[_0x96e7('0x42')][_0x96e7('0x44')]?_0x4b1e47[_0x96e7('0x42')]:_0x5b53dc[_0x96e7('0x41')];if(!_0x5c9815[_0x96e7('0x3e')][_0x96e7('0x45')](_0x96e7('0x46'))){_0x4b1e47[_0x96e7('0x31')]=qs[_0x96e7('0x31')](_0x5c9815[_0x96e7('0x3e')]['limit']);_0x4b1e47[_0x96e7('0x30')]=qs['offset'](_0x5c9815[_0x96e7('0x3e')][_0x96e7('0x30')]);}_0x4b1e47[_0x96e7('0x47')]=qs[_0x96e7('0x48')](_0x5c9815['query'][_0x96e7('0x48')]);_0x4b1e47[_0x96e7('0x49')]=qs[_0x96e7('0x4a')](_[_0x96e7('0x4b')](_0x5c9815[_0x96e7('0x3e')],_0x5b53dc['filters']),_0x59c872);if(_0x5c9815[_0x96e7('0x3e')]['filter']){_0x4b1e47[_0x96e7('0x49')]=_[_0x96e7('0x4c')](_0x4b1e47[_0x96e7('0x49')],{'$or':_['map'](_0x59c872,function(_0xf21803){if(_0xf21803[_0x96e7('0x3b')]!==_0x96e7('0x4d')){var _0x20c2e3={};_0x20c2e3[_0xf21803[_0x96e7('0x3d')]]={'$like':'%'+_0x5c9815['query'][_0x96e7('0x4e')]+'%'};return _0x20c2e3;}})});}_0x4b1e47=_[_0x96e7('0x4c')]({},_0x4b1e47,_0x5c9815['options']);var _0x2cae6b={'where':_0x4b1e47[_0x96e7('0x49')]};return db['WhatsappMessage']['count'](_0x2cae6b)[_0x96e7('0x20')](function(_0x5350e7){_0x61e6f3[_0x96e7('0x2f')]=_0x5350e7;if(_0x5c9815[_0x96e7('0x3e')][_0x96e7('0x4f')]){_0x4b1e47[_0x96e7('0x50')]=[{'all':!![]}];}return db[_0x96e7('0x51')][_0x96e7('0x52')](_0x4b1e47);})[_0x96e7('0x20')](function(_0x39f469){_0x61e6f3[_0x96e7('0x53')]=_0x39f469;return _0x61e6f3;})['then'](respondWithFilteredResult(_0x2894be,_0x4b1e47))['catch'](handleError(_0x2894be,null));};exports[_0x96e7('0x54')]=function(_0x24cc89,_0x2f957a){var _0x233de2={'raw':!![],'where':{'id':_0x24cc89['params']['id']}},_0x18b215={};_0x18b215[_0x96e7('0x41')]=_[_0x96e7('0x3f')](db['WhatsappMessage']['rawAttributes']);_0x18b215[_0x96e7('0x3e')]=_['keys'](_0x24cc89[_0x96e7('0x3e')]);_0x18b215[_0x96e7('0x4a')]=_[_0x96e7('0x40')](_0x18b215['model'],_0x18b215[_0x96e7('0x3e')]);_0x233de2[_0x96e7('0x42')]=_[_0x96e7('0x40')](_0x18b215[_0x96e7('0x41')],qs[_0x96e7('0x43')](_0x24cc89['query'][_0x96e7('0x43')]));_0x233de2[_0x96e7('0x42')]=_0x233de2['attributes'][_0x96e7('0x44')]?_0x233de2[_0x96e7('0x42')]:_0x18b215[_0x96e7('0x41')];if(_0x24cc89['query'][_0x96e7('0x4f')]){_0x233de2[_0x96e7('0x50')]=[{'all':!![]}];}_0x233de2=_['merge']({},_0x233de2,_0x24cc89['options']);return db[_0x96e7('0x51')]['find'](_0x233de2)[_0x96e7('0x20')](handleEntityNotFound(_0x2f957a,null))[_0x96e7('0x20')](respondWithResult(_0x2f957a,null))[_0x96e7('0x29')](handleError(_0x2f957a,null));};exports[_0x96e7('0x55')]=function(_0x1ea62e,_0x335bab){return db[_0x96e7('0x51')][_0x96e7('0x55')](_0x1ea62e[_0x96e7('0x56')],{})[_0x96e7('0x20')](respondWithResult(_0x335bab,0xc9))[_0x96e7('0x29')](handleError(_0x335bab,null));};exports[_0x96e7('0x36')]=function(_0x17fcd2,_0x2ca109){if(_0x17fcd2[_0x96e7('0x56')]['id']){delete _0x17fcd2[_0x96e7('0x56')]['id'];}return db['WhatsappMessage'][_0x96e7('0x57')]({'where':{'id':_0x17fcd2[_0x96e7('0x58')]['id']}})[_0x96e7('0x20')](handleEntityNotFound(_0x2ca109,null))[_0x96e7('0x20')](saveUpdates(_0x17fcd2['body'],null))['then'](respondWithResult(_0x2ca109,null))[_0x96e7('0x29')](handleError(_0x2ca109,null));};exports[_0x96e7('0x59')]=function(_0x1a9f1d,_0x416954){return db[_0x96e7('0x51')][_0x96e7('0x57')]({'where':{'id':_0x1a9f1d[_0x96e7('0x58')]['id']}})[_0x96e7('0x20')](handleEntityNotFound(_0x416954,null))[_0x96e7('0x20')](removeEntity(_0x416954,null))[_0x96e7('0x29')](handleError(_0x416954,null));};exports[_0x96e7('0x5a')]=function(_0x45ec13,_0x1abb49){return db['WhatsappMessage'][_0x96e7('0x5a')]()[_0x96e7('0x20')](respondWithResult(_0x1abb49,null))[_0x96e7('0x29')](handleError(_0x1abb49,null));};var interaction_log=require(_0x96e7('0x14'))('whatsapp-interactions');exports[_0x96e7('0x5b')]=function(_0x25d096,_0x2fb837,_0x5a15c2){var _0x39aa1c={'agent':{},'channel':'whatsapp'};if(_0x25d096[_0x96e7('0x56')]['id']){delete _0x25d096[_0x96e7('0x56')]['id'];}_0x25d096[_0x96e7('0x56')][_0x96e7('0x5c')]=!![];_0x25d096['body']['readAt']=moment()[_0x96e7('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x25d096[_0x96e7('0x56')][_0x96e7('0x5e')]=_0x25d096[_0x96e7('0x56')]['UserId']||_0x25d096[_0x96e7('0x5f')]['id'];_0x39aa1c[_0x96e7('0x60')]['id']=_0x25d096[_0x96e7('0x56')][_0x96e7('0x5e')];return db[_0x96e7('0x51')][_0x96e7('0x57')]({'where':{'id':_0x25d096['params']['id'],'UserId':null}})[_0x96e7('0x20')](handleEntityNotFound(_0x2fb837,null))['then'](saveUpdates(_0x25d096[_0x96e7('0x56')],null))[_0x96e7('0x20')](function(_0x8f40a0){if(_0x8f40a0){_0x39aa1c[_0x96e7('0x28')]=_0x8f40a0[_0x96e7('0x61')]({'plain':!![]});return db[_0x96e7('0x62')][_0x96e7('0x57')]({'where':{'id':_0x8f40a0[_0x96e7('0x63')]}});}return null;})[_0x96e7('0x20')](handleEntityNotFound(_0x2fb837,null))[_0x96e7('0x20')](function(_0x54622b){if(_0x54622b){return _0x54622b[_0x96e7('0x36')]({'UserId':_0x25d096['body'][_0x96e7('0x5e')],'read1stAt':_['isNil'](_0x54622b[_0x96e7('0x64')])?moment()[_0x96e7('0x5d')](_0x96e7('0x65')):undefined});}return null;})[_0x96e7('0x20')](function(_0xd77c11){if(_0xd77c11){_0x39aa1c['interaction']=_0xd77c11[_0x96e7('0x61')]({'plain':!![]});interaction_log[_0x96e7('0x21')](_0x96e7('0x66'),_0x25d096['user']['id'],_0x25d096['user'][_0x96e7('0x3d')],_0x25d096[_0x96e7('0x5f')][_0x96e7('0x67')],_0x39aa1c[_0x96e7('0x68')]['id'],_0x25d096['body']?JSON['stringify'](_0x25d096[_0x96e7('0x56')]):_0x96e7('0x69'));return respondWithRpcPromise(_0x96e7('0x6a'),_0x96e7('0x6b'),_0x39aa1c);}return null;})[_0x96e7('0x20')](function(_0x449f06){var _0x4b5b4b=_0x96e7('0x6c')+_0x449f06['message'][_0x96e7('0x6d')];return db[_0x96e7('0x6e')]['query'](_0x4b5b4b,{'type':db[_0x96e7('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x12b5aa){return _0x12b5aa;});})[_0x96e7('0x20')](function(_0x3e6eb4){if(_0x3e6eb4){_0x39aa1c[_0x96e7('0x28')][_0x96e7('0x70')]=_0x3e6eb4[0x0];if(!_0x25d096[_0x96e7('0x56')][_0x96e7('0x5e')])return;return db['User'][_0x96e7('0x57')]({'where':{'id':_0x25d096['body'][_0x96e7('0x5e')],'role':'agent'},'attributes':['id',_0x96e7('0x3d'),_0x96e7('0x71'),_0x96e7('0x72'),'internal'],'raw':!![]});}return null;})[_0x96e7('0x20')](function(_0x2d2f1b){if(!_0x2d2f1b)return null;_0x39aa1c[_0x96e7('0x28')][_0x96e7('0x60')]=_0x2d2f1b;return _0x39aa1c;})[_0x96e7('0x20')](function(_0x31344b){if(_0x31344b){if(_0x25d096['body'][_0x96e7('0x73')]){_0x39aa1c[_0x96e7('0x28')][_0x96e7('0x74')]=util[_0x96e7('0x5d')]('SIP/%s',_0x25d096[_0x96e7('0x5f')][_0x96e7('0x3d')]);_0x39aa1c['message']['channel']=_0x39aa1c[_0x96e7('0x75')];_0x39aa1c[_0x96e7('0x28')][_0x96e7('0x76')]=_0x39aa1c[_0x96e7('0x75')];_0x39aa1c[_0x96e7('0x28')][_0x96e7('0x77')]=_0x96e7('0x5b');return respondWithRpcPromise(_0x96e7('0x78'),_0x96e7('0x78'),{'event':_0x96e7('0x79'),'message':_0x39aa1c[_0x96e7('0x28')]},client9002)[_0x96e7('0x20')](function(){return _0x39aa1c;});}return _0x39aa1c;}return null;})[_0x96e7('0x20')](respondWithResult(_0x2fb837,null))['catch'](handleError(_0x2fb837,null));};var interaction_log=require(_0x96e7('0x14'))(_0x96e7('0x7a'));exports[_0x96e7('0x7b')]=function(_0x3a168f,_0x2d8dee,_0x54d45e){var _0x4a4a1d={'agent':{},'channel':'whatsapp'};if(_0x3a168f[_0x96e7('0x56')]['id']){delete _0x3a168f[_0x96e7('0x56')]['id'];}_0x3a168f[_0x96e7('0x56')]['UserId']=_0x3a168f[_0x96e7('0x56')]['UserId']||_0x3a168f['user']['id'];_0x4a4a1d['agent']['id']=_0x3a168f[_0x96e7('0x56')]['UserId'];return db[_0x96e7('0x51')][_0x96e7('0x57')]({'where':{'id':_0x3a168f[_0x96e7('0x58')]['id'],'UserId':null}})[_0x96e7('0x20')](handleEntityNotFound(_0x2d8dee,null))['then'](function(_0x13a09b){if(_0x13a09b){_0x4a4a1d['message']=_0x13a09b['get']({'plain':!![]});return db[_0x96e7('0x62')]['find']({'where':{'id':_0x13a09b[_0x96e7('0x63')]}});}return null;})[_0x96e7('0x20')](handleEntityNotFound(_0x2d8dee,null))[_0x96e7('0x20')](function(_0x4e586c){if(_0x4e586c){_0x4a4a1d[_0x96e7('0x68')]=_0x4e586c[_0x96e7('0x61')]({'plain':!![]});interaction_log[_0x96e7('0x21')](_0x96e7('0x7c'),_0x3a168f[_0x96e7('0x5f')]['id'],_0x3a168f['user'][_0x96e7('0x3d')],_0x3a168f['user'][_0x96e7('0x67')],_0x4a4a1d[_0x96e7('0x68')]['id'],_0x3a168f[_0x96e7('0x56')]?JSON[_0x96e7('0x24')](_0x3a168f[_0x96e7('0x56')]):_0x96e7('0x69'));return respondWithRpcPromise('RejectMessage',_0x96e7('0x7d'),_0x4a4a1d);}return null;})[_0x96e7('0x20')](function(_0x4c9505){var _0x54459b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4c9505[_0x96e7('0x28')]['ContactId'];return db[_0x96e7('0x6e')][_0x96e7('0x3e')](_0x54459b,{'type':db[_0x96e7('0x6f')][_0x96e7('0x7e')]['SELECT'],'raw':!![]})['then'](function(_0xd2c3ee){return _0xd2c3ee;});})[_0x96e7('0x20')](function(_0x3ed732){if(_0x3ed732){_0x4a4a1d['message'][_0x96e7('0x70')]=_0x3ed732[0x0];if(!_0x3a168f[_0x96e7('0x56')][_0x96e7('0x5e')])return;return db['User'][_0x96e7('0x57')]({'where':{'id':_0x3a168f[_0x96e7('0x56')][_0x96e7('0x5e')],'role':'agent'},'attributes':['id',_0x96e7('0x3d'),_0x96e7('0x71'),_0x96e7('0x72'),_0x96e7('0x7f')],'raw':!![]});}return null;})['then'](function(_0x39cc51){if(!_0x39cc51)return null;_0x4a4a1d[_0x96e7('0x28')][_0x96e7('0x60')]=_0x39cc51;return _0x4a4a1d;})[_0x96e7('0x20')](function(_0x43ca31){if(_0x43ca31){_0x43ca31[_0x96e7('0x28')][_0x96e7('0x74')]=util['format'](_0x96e7('0x80'),_0x3a168f[_0x96e7('0x5f')][_0x96e7('0x3d')]);_0x43ca31['message']['channel']=_0x4a4a1d[_0x96e7('0x75')];_0x43ca31[_0x96e7('0x28')][_0x96e7('0x76')]=_0x4a4a1d[_0x96e7('0x75')];_0x43ca31[_0x96e7('0x28')][_0x96e7('0x77')]=_0x96e7('0x7b');respondWithRpcPromise(_0x96e7('0x78'),_0x96e7('0x78'),{'event':_0x96e7('0x81'),'message':_0x43ca31[_0x96e7('0x28')]},client9002);return _0x4a4a1d;}return null;})[_0x96e7('0x20')](respondWithResult(_0x2d8dee,null))[_0x96e7('0x29')](handleError(_0x2d8dee,null));};exports[_0x96e7('0x2c')]=function(_0x28da69,_0x1f1b08,_0x1bc582){if(_0x28da69[_0x96e7('0x56')]['id']){delete _0x28da69['body']['id'];}var _0x2e6ca7;return db['WhatsappMessage'][_0x96e7('0x57')]({'where':{'id':_0x28da69[_0x96e7('0x58')]['id']}})[_0x96e7('0x20')](handleEntityNotFound(_0x1f1b08,null))[_0x96e7('0x20')](function(_0x5c0b4e){if(_0x5c0b4e){_0x2e6ca7=_0x5c0b4e;return db[_0x96e7('0x82')][_0x96e7('0x57')]({'where':{'id':_0x5c0b4e[_0x96e7('0x83')]}});}})[_0x96e7('0x20')](handleEntityNotFound(_0x1f1b08,null))[_0x96e7('0x20')](function(_0x5b836f){if(_0x5b836f){logger['debug'](_0x96e7('0x84'),_0x96e7('0x2c'),'received\x20delivery\x20report\x20from',_0x5b836f[_0x96e7('0x3b')],util[_0x96e7('0x85')](_0x28da69[_0x96e7('0x56')],{'showHidden':![],'depth':null}));switch(_0x5b836f[_0x96e7('0x3b')]){case _0x96e7('0x86'):if(_0x28da69['body'][_0x96e7('0x87')]&&_0x28da69[_0x96e7('0x56')]['MessageSid']===_0x2e6ca7[_0x96e7('0x88')]&&_0x28da69[_0x96e7('0x56')]['MessageStatus']&&_0x28da69[_0x96e7('0x56')][_0x96e7('0x89')]==='read'){return _0x2e6ca7['update']({'read':!![]});}else{logger[_0x96e7('0x25')](_0x96e7('0x8a'),_0x96e7('0x2c'),_0x96e7('0x86'),util['inspect'](_0x28da69[_0x96e7('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x2e6ca7;}})[_0x96e7('0x20')](respondWithResult(_0x1f1b08,null))[_0x96e7('0x29')](handleError(_0x1f1b08,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 0667544..3945975 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 _0xd52d=['WhatsappMessage','save','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xd52d,0x1c7));var _0xdd52=function(_0x2d1ab1,_0x292c23){_0x2d1ab1=_0x2d1ab1-0x0;var _0x348d42=_0xd52d[_0x2d1ab1];return _0x348d42;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xdd52('0x0'))['db'][_0xdd52('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd52('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1dfed5){return function(_0x211062,_0x30fb04,_0x29a95e){WhatsappMessageEvents[_0xdd52('0x3')](_0x1dfed5+':'+_0x211062['id'],_0x211062);WhatsappMessageEvents[_0xdd52('0x3')](_0x1dfed5,_0x211062);_0x29a95e(null);};}for(var e in events){if(events[_0xdd52('0x4')](e)){var event=events[e];WhatsappMessage[_0xdd52('0x5')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xaaa2=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x148b06,_0x375597){var _0x222dbf=function(_0x5e8b5d){while(--_0x5e8b5d){_0x148b06['push'](_0x148b06['shift']());}};_0x222dbf(++_0x375597);}(_0xaaa2,0xac));var _0x2aaa=function(_0x4dd42b,_0x238173){_0x4dd42b=_0x4dd42b-0x0;var _0x58b4bb=_0xaaa2[_0x4dd42b];return _0x58b4bb;};'use strict';var EventEmitter=require(_0x2aaa('0x0'));var WhatsappMessage=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2aaa('0x3')](0x0);var events={'afterCreate':_0x2aaa('0x4'),'afterUpdate':_0x2aaa('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfc076){return function(_0x482489,_0x35b5c8,_0x340071){WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076+':'+_0x482489['id'],_0x482489);WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076,_0x482489);_0x340071(null);};}for(var e in events){if(events[_0x2aaa('0x7')](e)){var event=events[e];WhatsappMessage[_0x2aaa('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 553c572..43ecdd4 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 _0x46f4=['accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','node-fetch','path','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio'];(function(_0x1b0818,_0x12b451){var _0x15e216=function(_0x4a0b85){while(--_0x4a0b85){_0x1b0818['push'](_0x1b0818['shift']());}};_0x15e216(++_0x12b451);}(_0x46f4,0x115));var _0x446f=function(_0x2fad4d,_0x12b97b){_0x2fad4d=_0x2fad4d-0x0;var _0x299866=_0x46f4[_0x2fad4d];return _0x299866;};'use strict';var _=require(_0x446f('0x0'));var util=require(_0x446f('0x1'));var logger=require(_0x446f('0x2'))(_0x446f('0x3'));var moment=require(_0x446f('0x4'));var BPromise=require(_0x446f('0x5'));var rp=require('request-promise');var fetch=require(_0x446f('0x6'));var fs=require('fs');var path=require(_0x446f('0x7'));var rimraf=require('rimraf');var config=require(_0x446f('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x446f('0x9')]=function(_0x3c822c,_0x2e1761){return _0x3c822c[_0x446f('0xa')](_0x446f('0xb'),attributes,{'tableName':_0x446f('0xc'),'paranoid':![],'indexes':[{'name':_0x446f('0xd'),'fields':[_0x446f('0xd')]},{'name':_0x446f('0xe'),'fields':[_0x446f('0xf')],'type':_0x446f('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f541e,_0x4d7eda,_0x12354b){var _0x1818cb=_0x3c822c[_0x446f('0x11')];var _0x4631c9=_0x3f541e[_0x446f('0x12')]({'plain':!![]});if(_0x4631c9[_0x446f('0x13')]['toLowerCase']()==='in'||_0x4631c9[_0x446f('0x13')][_0x446f('0x14')]()===_0x446f('0x15')&&!_0x4631c9[_0x446f('0x16')]&&!_[_0x446f('0x17')](_0x4631c9[_0x446f('0x18')])){_0x1818cb[_0x446f('0x19')][_0x446f('0x1a')]({'where':{'id':_0x4631c9[_0x446f('0x1b')]}})[_0x446f('0x1c')](function(_0x562b98){if(_0x562b98){_0x562b98[_0x446f('0x1d')]({'lastMsgAt':_0x4631c9[_0x446f('0x1e')],'lastMsgDirection':_0x4631c9[_0x446f('0x13')][_0x446f('0x14')]()});}})[_0x446f('0x1f')](function(_0x2bac5f){console[_0x446f('0x20')](_0x2bac5f);});}if(_0x4631c9[_0x446f('0x13')]===_0x446f('0x15')&&!_0x4631c9[_0x446f('0x16')]){var _0x1322f6;_0x1818cb[_0x446f('0x21')][_0x446f('0x22')]({'where':{'id':_0x4631c9[_0x446f('0x23')]},'raw':!![]})['then'](function(_0x4c0df5){_0x1322f6=_0x4c0df5;if(_0x1322f6&&_0x1322f6[_0x446f('0x24')]){switch(_0x1322f6[_0x446f('0x24')]){case _0x446f('0x25'):var _0x4d80fe=require('twilio');if(_0x1322f6[_0x446f('0x26')]&&_0x1322f6[_0x446f('0x27')]&&_0x1322f6['phone']){var _0x473eaf=new _0x4d80fe(_0x1322f6['accountSid'],_0x1322f6[_0x446f('0x27')]);_0x473eaf[_0x446f('0x28')][_0x446f('0x29')]({'body':_0x4631c9[_0x446f('0xf')],'to':_0x446f('0x2a')+_0x4631c9['phone'],'from':_0x446f('0x2a')+_0x1322f6[_0x446f('0x2b')],'statusCallback':_0x1322f6[_0x446f('0x2c')]+_0x446f('0x2d')+_0x4631c9['id']+_0x446f('0x2e')+_0x1322f6[_0x446f('0x2f')]})[_0x446f('0x1c')](function(_0x5183f3){if(_0x5183f3[_0x446f('0x30')]){return _0x3f541e[_0x446f('0x1d')]({'messageId':_0x5183f3[_0x446f('0x30')]});}})[_0x446f('0x1f')](function(_0x53b4ab){logger['error'](_0x446f('0x31'),_0x446f('0x32'),'twilio',util['inspect'](_0x53b4ab,{'showHidden':![],'depth':null}));});}else{logger[_0x446f('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x446f('0x32'),_0x446f('0x25'),_0x446f('0x33'));}break;case _0x446f('0x34'):var _0x4d7536=_0x1322f6[_0x446f('0x26')];var _0x1b6dc9=_0x1322f6[_0x446f('0x27')];var _0x13e943=_0x1322f6[_0x446f('0x35')]+_0x446f('0x36')+_0x4d7536+_0x446f('0x37');var _0x4286f0={'to':[_0x4631c9[_0x446f('0x2b')]],'message':{'type':_0x446f('0x38'),'text':_0x4631c9['body']}};var _0x3ef549={'method':'POST','uri':_0x13e943,'headers':{'Authorization':_0x446f('0x39')+_0x1b6dc9,'Content-Type':'application/json'},'body':_0x4286f0,'json':!![]};rp(_0x3ef549)[_0x446f('0x1c')](function(_0x215e62){if(_0x215e62['statuses'][0x0][_0x446f('0x3a')]){return _0x3f541e[_0x446f('0x1d')]({'messageId':_0x215e62['statuses'][0x0]['message_id']});}})[_0x446f('0x1f')](function(_0x1e30c7){logger['err'](_0x446f('0x3b'),_0x1e30c7);});break;}}})[_0x446f('0x3c')](function(){_0x12354b();});}else{_0x12354b();}}},'charset':_0x446f('0x3d'),'collate':_0x446f('0x3e')});}; \ No newline at end of file +var _0x6108=['messages','create','body','remote','/api/whatsapp/messages/','token','sid','catch','afterCreate','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','node-fetch','path','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','update','createdAt','error','out','WhatsappAccount','then','type','twilio','accountSid','authToken','phone'];(function(_0x1ec109,_0x52fb44){var _0x12dc97=function(_0xbfe212){while(--_0xbfe212){_0x1ec109['push'](_0x1ec109['shift']());}};_0x12dc97(++_0x52fb44);}(_0x6108,0xbc));var _0x8610=function(_0x6b322c,_0x2bb0df){_0x6b322c=_0x6b322c-0x0;var _0x363f8b=_0x6108[_0x6b322c];return _0x363f8b;};'use strict';var _=require(_0x8610('0x0'));var util=require('util');var logger=require(_0x8610('0x1'))(_0x8610('0x2'));var moment=require(_0x8610('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x8610('0x4'));var fs=require('fs');var path=require(_0x8610('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8610('0x6'));module[_0x8610('0x7')]=function(_0x28a680,_0x26dab3){return _0x28a680['define'](_0x8610('0x8'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x8610('0x9'),'fields':[_0x8610('0x9')]},{'name':_0x8610('0xa'),'fields':['body'],'type':_0x8610('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3682b9,_0x46854f,_0x1eb419){var _0x2a0474=_0x28a680[_0x8610('0xc')];var _0x4b3af2=_0x3682b9[_0x8610('0xd')]({'plain':!![]});if(_0x4b3af2[_0x8610('0xe')][_0x8610('0xf')]()==='in'||_0x4b3af2['direction'][_0x8610('0xf')]()==='out'&&!_0x4b3af2[_0x8610('0x10')]&&!_[_0x8610('0x11')](_0x4b3af2[_0x8610('0x12')])){_0x2a0474[_0x8610('0x13')][_0x8610('0x14')]({'where':{'id':_0x4b3af2['WhatsappInteractionId']}})['then'](function(_0x3ba11a){if(_0x3ba11a){_0x3ba11a[_0x8610('0x15')]({'lastMsgAt':_0x4b3af2[_0x8610('0x16')],'lastMsgDirection':_0x4b3af2['direction']['toLowerCase']()});}})['catch'](function(_0x3d94c2){console[_0x8610('0x17')](_0x3d94c2);});}if(_0x4b3af2[_0x8610('0xe')]===_0x8610('0x18')&&!_0x4b3af2['secret']){var _0x52ac1f;_0x2a0474[_0x8610('0x19')]['find']({'where':{'id':_0x4b3af2['WhatsappAccountId']},'raw':!![]})[_0x8610('0x1a')](function(_0x4c7d56){_0x52ac1f=_0x4c7d56;if(_0x52ac1f&&_0x52ac1f['type']){switch(_0x52ac1f[_0x8610('0x1b')]){case _0x8610('0x1c'):var _0x5a4b44=require(_0x8610('0x1c'));if(_0x52ac1f[_0x8610('0x1d')]&&_0x52ac1f[_0x8610('0x1e')]&&_0x52ac1f[_0x8610('0x1f')]){var _0x15c240=new _0x5a4b44(_0x52ac1f[_0x8610('0x1d')],_0x52ac1f[_0x8610('0x1e')]);_0x15c240[_0x8610('0x20')][_0x8610('0x21')]({'body':_0x4b3af2[_0x8610('0x22')],'to':'whatsapp:'+_0x4b3af2[_0x8610('0x1f')],'from':'whatsapp:'+_0x52ac1f[_0x8610('0x1f')],'statusCallback':_0x52ac1f[_0x8610('0x23')]+_0x8610('0x24')+_0x4b3af2['id']+'/status?token='+_0x52ac1f[_0x8610('0x25')]})['then'](function(_0x585269){if(_0x585269['sid']){return _0x3682b9['update']({'messageId':_0x585269[_0x8610('0x26')]});}})[_0x8610('0x27')](function(_0x5250dd){logger[_0x8610('0x17')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x8610('0x28'),_0x8610('0x1c'),util['inspect'](_0x5250dd,{'showHidden':![],'depth':null}));});}else{logger[_0x8610('0x17')](_0x8610('0x29'),_0x8610('0x28'),_0x8610('0x1c'),_0x8610('0x2a'));}break;case _0x8610('0x2b'):var _0x4e4c16=_0x52ac1f[_0x8610('0x1d')];var _0x2ccf6d=_0x52ac1f[_0x8610('0x1e')];var _0x558b62=_0x52ac1f[_0x8610('0x2c')]+'/whatsapp/v1/'+_0x4e4c16+_0x8610('0x2d');var _0x5c67f6={'to':[_0x4b3af2['phone']],'message':{'type':_0x8610('0x2e'),'text':_0x4b3af2[_0x8610('0x22')]}};var _0x1de93c={'method':'POST','uri':_0x558b62,'headers':{'Authorization':'Bearer\x20'+_0x2ccf6d,'Content-Type':_0x8610('0x2f')},'body':_0x5c67f6,'json':!![]};rp(_0x1de93c)[_0x8610('0x1a')](function(_0x1c4160){if(_0x1c4160[_0x8610('0x30')][0x0][_0x8610('0x31')]){return _0x3682b9[_0x8610('0x15')]({'messageId':_0x1c4160['statuses'][0x0][_0x8610('0x31')]});}})[_0x8610('0x27')](function(_0x1bdfcd){logger[_0x8610('0x32')](_0x8610('0x33'),_0x1bdfcd);});break;}}})[_0x8610('0x34')](function(){_0x1eb419();});}else{_0x1eb419();}}},'charset':_0x8610('0x35'),'collate':_0x8610('0x36')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 144d3a5..82ae258 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 _0xd3a8=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateWhatsappMessage','WhatsappMessage','create','body','options','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','localhost','./whatsappMessage.socket','register','request','then','info'];(function(_0x844353,_0x560724){var _0x2d6e1c=function(_0x56fe2a){while(--_0x56fe2a){_0x844353['push'](_0x844353['shift']());}};_0x2d6e1c(++_0x560724);}(_0xd3a8,0x139));var _0x8d3a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd3a8[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x8d3a('0x0'));var moment=require(_0x8d3a('0x1'));var BPromise=require(_0x8d3a('0x2'));var rs=require(_0x8d3a('0x3'));var fs=require('fs');var Redis=require(_0x8d3a('0x4'));var db=require(_0x8d3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d3a('0x6'))(_0x8d3a('0x7'));var config=require(_0x8d3a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8d3a('0x9')]['http']({'port':0x232a});config[_0x8d3a('0xa')]=_['defaults'](config[_0x8d3a('0xa')],{'host':_0x8d3a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d3a('0xa')]));require(_0x8d3a('0xc'))[_0x8d3a('0xd')](socket);function respondWithRpcPromise(_0x5ce1e8,_0x28a83f,_0x19bf7f){return new BPromise(function(_0x35712d,_0x1a6b12){return client[_0x8d3a('0xe')](_0x5ce1e8,_0x19bf7f)[_0x8d3a('0xf')](function(_0x229929){logger[_0x8d3a('0x10')](_0x8d3a('0x11'),_0x28a83f,_0x8d3a('0x12'));logger['debug'](_0x8d3a('0x13'),_0x28a83f,'request\x20sent',JSON[_0x8d3a('0x14')](_0x229929));if(_0x229929[_0x8d3a('0x15')]){if(_0x229929[_0x8d3a('0x15')]['code']===0x1f4){logger['error'](_0x8d3a('0x11'),_0x28a83f,_0x229929['error']['message']);return _0x1a6b12(_0x229929[_0x8d3a('0x15')]['message']);}logger['error'](_0x8d3a('0x11'),_0x28a83f,_0x229929[_0x8d3a('0x15')][_0x8d3a('0x16')]);return _0x35712d(_0x229929[_0x8d3a('0x15')]['message']);}else{logger[_0x8d3a('0x10')](_0x8d3a('0x11'),_0x28a83f,_0x8d3a('0x12'));_0x35712d(_0x229929['result']['message']);}})['catch'](function(_0x53feb3){logger['error'](_0x8d3a('0x11'),_0x28a83f,_0x53feb3);_0x1a6b12(_0x53feb3);});});}exports[_0x8d3a('0x17')]=function(_0x37245a){var _0x38a011=this;return new Promise(function(_0x2eaf58,_0x2d8aa5){return db[_0x8d3a('0x18')][_0x8d3a('0x19')](_0x37245a[_0x8d3a('0x1a')],{'raw':_0x37245a['options']?_0x37245a[_0x8d3a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8d3a('0xf')](function(_0x5616b0){logger[_0x8d3a('0x10')]('CreateWhatsappMessage',_0x37245a);logger[_0x8d3a('0x1c')](_0x8d3a('0x17'),_0x37245a,JSON[_0x8d3a('0x14')](_0x5616b0));_0x2eaf58(_0x5616b0);})[_0x8d3a('0x1d')](function(_0x11c50a){logger[_0x8d3a('0x15')](_0x8d3a('0x17'),_0x11c50a[_0x8d3a('0x16')],_0x37245a);_0x2d8aa5(_0x38a011[_0x8d3a('0x15')](0x1f4,_0x11c50a[_0x8d3a('0x16')]));});});}; \ No newline at end of file +var _0xf5f7=['CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','catch'];(function(_0x5c4786,_0x1c96c8){var _0x3b4bf8=function(_0x502324){while(--_0x502324){_0x5c4786['push'](_0x5c4786['shift']());}};_0x3b4bf8(++_0x1c96c8);}(_0xf5f7,0x1aa));var _0x7f5f=function(_0x355f97,_0x4a821e){_0x355f97=_0x355f97-0x0;var _0x1ad545=_0xf5f7[_0x355f97];return _0x1ad545;};'use strict';var _=require(_0x7f5f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7f5f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f5f('0x2'));var db=require(_0x7f5f('0x3'))['db'];var utils=require(_0x7f5f('0x4'));var logger=require(_0x7f5f('0x5'))('rpc');var config=require(_0x7f5f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7f5f('0x7')]({'port':0x232a});config[_0x7f5f('0x8')]=_[_0x7f5f('0x9')](config[_0x7f5f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f5f('0xa'))(new Redis(config[_0x7f5f('0x8')]));require('./whatsappMessage.socket')[_0x7f5f('0xb')](socket);function respondWithRpcPromise(_0x2abdcd,_0xdc9371,_0x3cd9bd){return new BPromise(function(_0x27e1a7,_0x1a6890){return client[_0x7f5f('0xc')](_0x2abdcd,_0x3cd9bd)[_0x7f5f('0xd')](function(_0x2b26a4){logger[_0x7f5f('0xe')]('WhatsappMessage,\x20%s,\x20%s',_0xdc9371,'request\x20sent');logger[_0x7f5f('0xf')](_0x7f5f('0x10'),_0xdc9371,_0x7f5f('0x11'),JSON[_0x7f5f('0x12')](_0x2b26a4));if(_0x2b26a4[_0x7f5f('0x13')]){if(_0x2b26a4[_0x7f5f('0x13')][_0x7f5f('0x14')]===0x1f4){logger[_0x7f5f('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0xdc9371,_0x2b26a4[_0x7f5f('0x13')][_0x7f5f('0x15')]);return _0x1a6890(_0x2b26a4[_0x7f5f('0x13')]['message']);}logger[_0x7f5f('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0xdc9371,_0x2b26a4[_0x7f5f('0x13')][_0x7f5f('0x15')]);return _0x27e1a7(_0x2b26a4[_0x7f5f('0x13')]['message']);}else{logger[_0x7f5f('0xe')](_0x7f5f('0x16'),_0xdc9371,_0x7f5f('0x11'));_0x27e1a7(_0x2b26a4['result'][_0x7f5f('0x15')]);}})[_0x7f5f('0x17')](function(_0x2b8fc3){logger[_0x7f5f('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0xdc9371,_0x2b8fc3);_0x1a6890(_0x2b8fc3);});});}exports[_0x7f5f('0x18')]=function(_0x2a6d56){var _0x2ba76b=this;return new Promise(function(_0x35dbb3,_0x567b1f){return db[_0x7f5f('0x19')][_0x7f5f('0x1a')](_0x2a6d56[_0x7f5f('0x1b')],{'raw':_0x2a6d56['options']?_0x2a6d56[_0x7f5f('0x1c')][_0x7f5f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4b49f8){logger[_0x7f5f('0xe')](_0x7f5f('0x18'),_0x2a6d56);logger[_0x7f5f('0xf')](_0x7f5f('0x18'),_0x2a6d56,JSON[_0x7f5f('0x12')](_0x4b49f8));_0x35dbb3(_0x4b49f8);})[_0x7f5f('0x17')](function(_0x36f669){logger[_0x7f5f('0x13')](_0x7f5f('0x18'),_0x36f669[_0x7f5f('0x15')],_0x2a6d56);_0x567b1f(_0x2ba76b[_0x7f5f('0x13')](0x1f4,_0x36f669[_0x7f5f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 3a1e02a..cb531ff 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 _0x2ea0=['save','remove','update','emit','removeListener','./whatsappMessage.events'];(function(_0x45d3e5,_0x17f6e5){var _0x302a04=function(_0xd63d3f){while(--_0xd63d3f){_0x45d3e5['push'](_0x45d3e5['shift']());}};_0x302a04(++_0x17f6e5);}(_0x2ea0,0x185));var _0x02ea=function(_0x54f060,_0x1de751){_0x54f060=_0x54f060-0x0;var _0xb2b587=_0x2ea0[_0x54f060];return _0xb2b587;};'use strict';var WhatsappMessageEvents=require(_0x02ea('0x0'));var events=[_0x02ea('0x1'),_0x02ea('0x2'),_0x02ea('0x3')];function createListener(_0x5df3ef,_0x23ac09){return function(_0x43e5aa){_0x23ac09[_0x02ea('0x4')](_0x5df3ef,_0x43e5aa);};}function removeListener(_0x407769,_0x11b710){return function(){WhatsappMessageEvents[_0x02ea('0x5')](_0x407769,_0x11b710);};}exports['register']=function(_0x2831d5){for(var _0x386a60=0x0,_0x30d920=events['length'];_0x386a60<_0x30d920;_0x386a60++){var _0x3969e9=events[_0x386a60];var _0x293ad5=createListener('whatsappMessage:'+_0x3969e9,_0x2831d5);WhatsappMessageEvents['on'](_0x3969e9,_0x293ad5);}}; \ No newline at end of file +var _0xc090=['remove','emit','removeListener','register','save'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc090,0x9a));var _0x0c09=function(_0x305eb3,_0x3cc2b1){_0x305eb3=_0x305eb3-0x0;var _0x744a7b=_0xc090[_0x305eb3];return _0x744a7b;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x0c09('0x0'),_0x0c09('0x1'),'update'];function createListener(_0x410d56,_0x1b9dac){return function(_0x379cb2){_0x1b9dac[_0x0c09('0x2')](_0x410d56,_0x379cb2);};}function removeListener(_0x52b232,_0x4b43de){return function(){WhatsappMessageEvents[_0x0c09('0x3')](_0x52b232,_0x4b43de);};}exports[_0x0c09('0x4')]=function(_0x17fb1c){for(var _0x18f691=0x0,_0x27a235=events['length'];_0x18f691<_0x27a235;_0x18f691++){var _0x5e43ec=events[_0x18f691];var _0x471ae6=createListener('whatsappMessage:'+_0x5e43ec,_0x17fb1c);WhatsappMessageEvents['on'](_0x5e43ec,_0x471ae6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5d39ebd..398c7fb 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 _0xfaa3=['getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','destroy','delete','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/members'];(function(_0x431e8e,_0x482fd7){var _0x53396c=function(_0x4e0b93){while(--_0x4e0b93){_0x431e8e['push'](_0x431e8e['shift']());}};_0x53396c(++_0x482fd7);}(_0xfaa3,0xaf));var _0x3faa=function(_0x138470,_0x1f60de){_0x138470=_0x138470-0x0;var _0x4a302d=_0xfaa3[_0x138470];return _0x4a302d;};'use strict';var multer=require('multer');var util=require(_0x3faa('0x0'));var path=require('path');var timeout=require(_0x3faa('0x1'));var express=require(_0x3faa('0x2'));var router=express[_0x3faa('0x3')]();var fs_extra=require(_0x3faa('0x4'));var auth=require(_0x3faa('0x5'));var interaction=require(_0x3faa('0x6'));var config=require(_0x3faa('0x7'));var controller=require('./whatsappQueue.controller');router[_0x3faa('0x8')]('/',auth[_0x3faa('0x9')](),controller['index']);router[_0x3faa('0x8')](_0x3faa('0xa'),auth['isAuthenticated'](),controller[_0x3faa('0xb')]);router[_0x3faa('0x8')](_0x3faa('0xc'),auth[_0x3faa('0x9')](),controller['show']);router[_0x3faa('0x8')](_0x3faa('0xd'),auth[_0x3faa('0x9')](),controller[_0x3faa('0xe')]);router[_0x3faa('0x8')](_0x3faa('0xf'),auth['isAuthenticated'](),controller[_0x3faa('0x10')]);router[_0x3faa('0x8')](_0x3faa('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x3faa('0x12')]('/',auth[_0x3faa('0x9')](),controller[_0x3faa('0x13')]);router['post'](_0x3faa('0xf'),auth[_0x3faa('0x9')](),controller[_0x3faa('0x14')]);router[_0x3faa('0x12')](_0x3faa('0x11'),auth[_0x3faa('0x9')](),controller['addAgents']);router[_0x3faa('0x15')](_0x3faa('0xc'),auth[_0x3faa('0x9')](),controller[_0x3faa('0x16')]);router['delete'](_0x3faa('0xc'),auth['isAuthenticated'](),controller[_0x3faa('0x17')]);router[_0x3faa('0x18')](_0x3faa('0xf'),auth[_0x3faa('0x9')](),controller['removeTeams']);router[_0x3faa('0x18')](_0x3faa('0x11'),auth[_0x3faa('0x9')](),controller[_0x3faa('0x19')]);module[_0x3faa('0x1a')]=router; \ No newline at end of file +var _0xa284=['../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x455013,_0x5878b9){var _0xd683c9=function(_0x3d8e92){while(--_0x3d8e92){_0x455013['push'](_0x455013['shift']());}};_0xd683c9(++_0x5878b9);}(_0xa284,0x1da));var _0x4a28=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa284[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4a28('0x0'));var timeout=require(_0x4a28('0x1'));var express=require(_0x4a28('0x2'));var router=express[_0x4a28('0x3')]();var fs_extra=require(_0x4a28('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4a28('0x5'));var config=require(_0x4a28('0x6'));var controller=require(_0x4a28('0x7'));router[_0x4a28('0x8')]('/',auth[_0x4a28('0x9')](),controller[_0x4a28('0xa')]);router[_0x4a28('0x8')](_0x4a28('0xb'),auth[_0x4a28('0x9')](),controller[_0x4a28('0xc')]);router[_0x4a28('0x8')]('/:id',auth[_0x4a28('0x9')](),controller[_0x4a28('0xd')]);router['get'](_0x4a28('0xe'),auth[_0x4a28('0x9')](),controller[_0x4a28('0xf')]);router['get'](_0x4a28('0x10'),auth['isAuthenticated'](),controller[_0x4a28('0x11')]);router[_0x4a28('0x8')]('/:id/users',auth[_0x4a28('0x9')](),controller['getAgents']);router['post']('/',auth[_0x4a28('0x9')](),controller[_0x4a28('0x12')]);router[_0x4a28('0x13')](_0x4a28('0x10'),auth['isAuthenticated'](),controller[_0x4a28('0x14')]);router['post']('/:id/users',auth[_0x4a28('0x9')](),controller[_0x4a28('0x15')]);router['put'](_0x4a28('0x16'),auth['isAuthenticated'](),controller[_0x4a28('0x17')]);router[_0x4a28('0x18')]('/:id',auth[_0x4a28('0x9')](),controller[_0x4a28('0x19')]);router['delete'](_0x4a28('0x10'),auth[_0x4a28('0x9')](),controller[_0x4a28('0x1a')]);router['delete'](_0x4a28('0x1b'),auth[_0x4a28('0x9')](),controller[_0x4a28('0x1c')]);module[_0x4a28('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 6720bfd..c1670a8 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 _0x97a2=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x120007,_0x4bdb8d){var _0x384fa6=function(_0x5d406e){while(--_0x5d406e){_0x120007['push'](_0x120007['shift']());}};_0x384fa6(++_0x4bdb8d);}(_0x97a2,0x1b1));var _0x297a=function(_0x27acbf,_0xe7afec){_0x27acbf=_0x27acbf-0x0;var _0xf93fc8=_0x97a2[_0x27acbf];return _0xf93fc8;};'use strict';var Sequelize=require(_0x297a('0x0'));module['exports']={'name':{'type':Sequelize[_0x297a('0x1')],'unique':_0x297a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x297a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x297a('0x4')](_0x297a('0x5'),_0x297a('0x6'),_0x297a('0x7'))},'description':{'type':Sequelize[_0x297a('0x1')]}}; \ No newline at end of file +var _0x6d0b=['roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x2870dc,_0x4a2912){var _0x3a3e2f=function(_0x30641b){while(--_0x30641b){_0x2870dc['push'](_0x2870dc['shift']());}};_0x3a3e2f(++_0x4a2912);}(_0x6d0b,0x71));var _0xb6d0=function(_0x55ab8d,_0x5e8814){_0x55ab8d=_0x55ab8d-0x0;var _0x54a618=_0x6d0b[_0x55ab8d];return _0x54a618;};'use strict';var Sequelize=require(_0xb6d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xb6d0('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb6d0('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb6d0('0x3')](_0xb6d0('0x4'),_0xb6d0('0x5'),_0xb6d0('0x6'))},'description':{'type':Sequelize[_0xb6d0('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index dd7e096..83466c3 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 _0x92ee=['set','Content-Range','json','update','then','get','WhatsappQueues','destroy','end','name','send','index','WhatsappQueue','rawAttributes','key','where','include','query','catch','model','keys','filters','attributes','intersection','fields','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','pick','WhatsappQueueId','map','merge','options','UserWhatsappQueue','findAll','findAndCountAll','agent','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','filter','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','count','offset','limit','status'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x92ee,0x6a));var _0xe92e=function(_0x2bb398,_0xd7c0dc){_0x2bb398=_0x2bb398-0x0;var _0x4dfefc=_0x92ee[_0x2bb398];return _0x4dfefc;};'use strict';var BPromise=require(_0xe92e('0x0'));var util=require(_0xe92e('0x1'));var _=require(_0xe92e('0x2'));var squel=require(_0xe92e('0x3'));var Redis=require(_0xe92e('0x4'));var qs=require(_0xe92e('0x5'));var logger=require(_0xe92e('0x6'))(_0xe92e('0x7'));var config=require(_0xe92e('0x8'));var db=require(_0xe92e('0x9'))['db'];config[_0xe92e('0xa')]=_[_0xe92e('0xb')](config['redis'],{'host':_0xe92e('0xc'),'port':0x18eb});var socket=require(_0xe92e('0xd'))(new Redis(config[_0xe92e('0xa')]));require(_0xe92e('0xe'))['register'](socket);function respondWithStatusCode(_0x3c79a4,_0x49788a){_0x49788a=_0x49788a||0xcc;return function(_0x3bdb1f){if(_0x3bdb1f){return _0x3c79a4['sendStatus'](_0x49788a);}return _0x3c79a4['status'](_0x49788a)['end']();};}function respondWithResult(_0x1547ae,_0x5d1415){_0x5d1415=_0x5d1415||0xc8;return function(_0x23428f){if(_0x23428f){return _0x1547ae['status'](_0x5d1415)['json'](_0x23428f);}};}function respondWithFilteredResult(_0x1ba6ad,_0x1d343d){return function(_0x2da641){if(_0x2da641){var _0x17456b=typeof _0x1d343d['offset']==='undefined'&&typeof _0x1d343d['limit']==='undefined';var _0x4c485f=_0x2da641[_0xe92e('0xf')];var _0x2de0cd=_0x17456b?0x0:_0x1d343d[_0xe92e('0x10')];var _0x3c75db=_0x17456b?_0x2da641[_0xe92e('0xf')]:_0x1d343d[_0xe92e('0x10')]+_0x1d343d[_0xe92e('0x11')];var _0x13942b;if(_0x3c75db>=_0x4c485f){_0x3c75db=_0x4c485f;_0x13942b=0xc8;}else{_0x13942b=0xce;}_0x1ba6ad[_0xe92e('0x12')](_0x13942b);return _0x1ba6ad[_0xe92e('0x13')](_0xe92e('0x14'),_0x2de0cd+'-'+_0x3c75db+'/'+_0x4c485f)[_0xe92e('0x15')](_0x2da641);}return null;};}function saveUpdates(_0x37a5b9){return function(_0x4b7ee0){if(_0x4b7ee0){return _0x4b7ee0[_0xe92e('0x16')](_0x37a5b9)[_0xe92e('0x17')](function(_0x40e12c){return _0x40e12c;});}return null;};}function removeEntity(_0x8fd0d5){return function(_0x3130dd){if(_0x3130dd){return _0x3130dd['destroy']()['then'](function(){var _0x47a6e2=_0x3130dd[_0xe92e('0x18')]({'plain':!![]});var _0x26a2a6=_0xe92e('0x19');return db['UserProfileResource'][_0xe92e('0x1a')]({'where':{'type':_0x26a2a6,'resourceId':_0x47a6e2['id']}})[_0xe92e('0x17')](function(){return _0x3130dd;});})[_0xe92e('0x17')](function(){_0x8fd0d5[_0xe92e('0x12')](0xcc)[_0xe92e('0x1b')]();});}};}function handleEntityNotFound(_0x308299){return function(_0x22096e){if(!_0x22096e){_0x308299['sendStatus'](0x194);}return _0x22096e;};}function handleError(_0x3eda4b,_0x2d30d){_0x2d30d=_0x2d30d||0x1f4;return function(_0x526b36){logger['error'](_0x526b36['stack']);if(_0x526b36[_0xe92e('0x1c')]){delete _0x526b36[_0xe92e('0x1c')];}_0x3eda4b['status'](_0x2d30d)[_0xe92e('0x1d')](_0x526b36);};}exports[_0xe92e('0x1e')]=function(_0x10b4de,_0x113fbf){var _0x2859c1={};var _0x1b25c6={'count':0x0,'rows':[]};var _0x6c59f0=_['map'](db[_0xe92e('0x1f')][_0xe92e('0x20')],function(_0x23e211){return{'name':_0x23e211['fieldName'],'type':_0x23e211['type'][_0xe92e('0x21')]};});_0x2859c1=qs['getOptions'](_0x6c59f0,_0x10b4de);var _0x5d4a49={'where':_0x2859c1[_0xe92e('0x22')]};return db[_0xe92e('0x1f')][_0xe92e('0xf')](_0x5d4a49)[_0xe92e('0x17')](function(_0x399150){_0x1b25c6[_0xe92e('0xf')]=_0x399150;_0x2859c1['include']=qs[_0xe92e('0x23')](_0x10b4de[_0xe92e('0x24')]);return db[_0xe92e('0x1f')]['findAll'](_0x2859c1);})[_0xe92e('0x17')](function(_0xfce0fb){_0x1b25c6['rows']=_0xfce0fb;return _0x1b25c6;})[_0xe92e('0x17')](respondWithFilteredResult(_0x113fbf,_0x2859c1))[_0xe92e('0x25')](handleError(_0x113fbf,null));};exports['show']=function(_0x2ac67d,_0x44d165){var _0x20d408={'raw':!![],'where':{'id':_0x2ac67d['params']['id']}},_0x5b2009={};_0x5b2009[_0xe92e('0x26')]=_[_0xe92e('0x27')](db[_0xe92e('0x1f')][_0xe92e('0x20')]);_0x5b2009[_0xe92e('0x24')]=_[_0xe92e('0x27')](_0x2ac67d['query']);_0x5b2009[_0xe92e('0x28')]=_['intersection'](_0x5b2009['model'],_0x5b2009[_0xe92e('0x24')]);_0x20d408[_0xe92e('0x29')]=_[_0xe92e('0x2a')](_0x5b2009['model'],qs[_0xe92e('0x2b')](_0x2ac67d[_0xe92e('0x24')][_0xe92e('0x2b')]));_0x20d408['attributes']=_0x20d408['attributes'][_0xe92e('0x2c')]?_0x20d408[_0xe92e('0x29')]:_0x5b2009[_0xe92e('0x26')];if(_0x2ac67d['query'][_0xe92e('0x2d')]){_0x20d408[_0xe92e('0x23')]=[{'all':!![]}];}_0x20d408=_['merge']({},_0x20d408,_0x2ac67d['options']);return db[_0xe92e('0x1f')][_0xe92e('0x2e')](_0x20d408)[_0xe92e('0x17')](handleEntityNotFound(_0x44d165,null))[_0xe92e('0x17')](respondWithResult(_0x44d165,null))['catch'](handleError(_0x44d165,null));};exports['create']=function(_0x3f33da,_0x50e9f2){return db['WhatsappQueue'][_0xe92e('0x2f')](_0x3f33da[_0xe92e('0x30')],{})[_0xe92e('0x17')](function(_0x12b480){var _0x4f4505=_0x3f33da['user'][_0xe92e('0x18')]({'plain':!![]});if(!_0x4f4505)throw new Error(_0xe92e('0x31'));if(_0x4f4505[_0xe92e('0x32')]===_0xe92e('0x33')){var _0x3b826a=_0x12b480['get']({'plain':!![]});var _0x5aa6fa='WhatsappQueues';return db[_0xe92e('0x34')][_0xe92e('0x2e')]({'where':{'name':_0x5aa6fa,'userProfileId':_0x4f4505[_0xe92e('0x35')]},'raw':!![]})['then'](function(_0x3c510a){if(_0x3c510a&&_0x3c510a[_0xe92e('0x36')]===0x0){return db[_0xe92e('0x37')][_0xe92e('0x2f')]({'name':_0x3b826a[_0xe92e('0x1c')],'resourceId':_0x3b826a['id'],'type':_0x3c510a[_0xe92e('0x1c')],'sectionId':_0x3c510a['id']},{})[_0xe92e('0x17')](function(){return _0x12b480;});}else{return _0x12b480;}})[_0xe92e('0x25')](function(_0x825bda){logger[_0xe92e('0x38')](_0xe92e('0x39'),_0x825bda);throw _0x825bda;});}return _0x12b480;})['then'](respondWithResult(_0x50e9f2,0xc9))[_0xe92e('0x25')](handleError(_0x50e9f2,null));};exports[_0xe92e('0x16')]=function(_0x11e9b7,_0x255d4f){if(_0x11e9b7[_0xe92e('0x30')]['id']){delete _0x11e9b7[_0xe92e('0x30')]['id'];}return db[_0xe92e('0x1f')][_0xe92e('0x2e')]({'where':{'id':_0x11e9b7[_0xe92e('0x3a')]['id']}})[_0xe92e('0x17')](handleEntityNotFound(_0x255d4f,null))[_0xe92e('0x17')](saveUpdates(_0x11e9b7[_0xe92e('0x30')],null))['then'](respondWithResult(_0x255d4f,null))['catch'](handleError(_0x255d4f,null));};exports['destroy']=function(_0x2e4bbd,_0x53687f){return db['WhatsappQueue'][_0xe92e('0x2e')]({'where':{'id':_0x2e4bbd['params']['id']}})[_0xe92e('0x17')](handleEntityNotFound(_0x53687f,null))[_0xe92e('0x17')](removeEntity(_0x53687f,null))[_0xe92e('0x25')](handleError(_0x53687f,null));};exports[_0xe92e('0x3b')]=function(_0x57e9b6,_0x15fb9b){return db['WhatsappQueue']['describe']()[_0xe92e('0x17')](respondWithResult(_0x15fb9b,null))[_0xe92e('0x25')](handleError(_0x15fb9b,null));};exports[_0xe92e('0x3c')]=function(_0x458348,_0x223282){var _0x2f0c66={'raw':!![],'where':{}},_0x26653f={},_0x522148;return db[_0xe92e('0x1f')][_0xe92e('0x3d')]({'where':{'id':_0x458348[_0xe92e('0x3a')]['id']}})[_0xe92e('0x17')](handleEntityNotFound(_0x223282,null))[_0xe92e('0x17')](function(_0x4ac691){if(_0x4ac691){_0x522148=_0x4ac691[_0xe92e('0x18')]({'plain':!![]});_0x26653f[_0xe92e('0x26')]=_['keys'](db['UserWhatsappQueue'][_0xe92e('0x20')]);_0x26653f[_0xe92e('0x24')]=_[_0xe92e('0x27')](_0x458348[_0xe92e('0x24')]);_0x26653f[_0xe92e('0x28')]=_['intersection'](_0x26653f['model'],_0x26653f[_0xe92e('0x24')]);_0x2f0c66[_0xe92e('0x29')]=_[_0xe92e('0x2a')](_0x26653f['model'],qs['fields'](_0x458348[_0xe92e('0x24')][_0xe92e('0x2b')]));_0x2f0c66[_0xe92e('0x29')]=_0x2f0c66[_0xe92e('0x29')][_0xe92e('0x2c')]?_0x2f0c66[_0xe92e('0x29')]:_0x26653f[_0xe92e('0x26')];if(!_0x458348[_0xe92e('0x24')][_0xe92e('0x3e')](_0xe92e('0x3f'))){_0x2f0c66[_0xe92e('0x11')]=qs[_0xe92e('0x11')](_0x458348[_0xe92e('0x24')][_0xe92e('0x11')]);_0x2f0c66[_0xe92e('0x10')]=qs[_0xe92e('0x10')](_0x458348[_0xe92e('0x24')]['offset']);}_0x2f0c66[_0xe92e('0x40')]=qs[_0xe92e('0x41')](_0x458348['query'][_0xe92e('0x41')]);_0x2f0c66[_0xe92e('0x22')]=qs[_0xe92e('0x28')](_[_0xe92e('0x42')](_0x458348['query'],_0x26653f[_0xe92e('0x28')]));_0x2f0c66[_0xe92e('0x22')][_0xe92e('0x43')]=_0x4ac691['id'];if(_0x458348[_0xe92e('0x24')]['filter']){_0x2f0c66[_0xe92e('0x22')]=_['merge'](_0x2f0c66['where'],{'$or':_[_0xe92e('0x44')](_0x2f0c66[_0xe92e('0x29')],function(_0x48782e){var _0x175517={};_0x175517[_0x48782e]={'$like':'%'+_0x458348[_0xe92e('0x24')]['filter']+'%'};return _0x175517;})});}_0x2f0c66=_[_0xe92e('0x45')]({},_0x2f0c66,_0x458348[_0xe92e('0x46')]);return db[_0xe92e('0x47')][_0xe92e('0x48')](_0x2f0c66);}})[_0xe92e('0x17')](function(_0x39e1b4){if(_0x39e1b4){return db['User'][_0xe92e('0x49')]({'where':{'id':_[_0xe92e('0x44')](_0x39e1b4,'UserId'),'role':_0xe92e('0x4a')},'attributes':['id',_0xe92e('0x1c'),'whatsappPause','updatedAt',_0xe92e('0x4b')]});}})[_0xe92e('0x17')](function(_0x359813){if(_0x359813){return{'count':_0x359813[_0xe92e('0xf')],'rows':_[_0xe92e('0x44')](_0x359813[_0xe92e('0x4c')],function(_0x54d5e1){return{'membername':_0x54d5e1[_0xe92e('0x1c')],'UserId':_0x54d5e1['id'],'queue_name':_0x522148[_0xe92e('0x1c')],'WhatsappQueueId':_0x522148['id'],'interface':util[_0xe92e('0x4d')](_0xe92e('0x4e'),_0xe92e('0x4f'),_0x54d5e1[_0xe92e('0x1c')]),'penalty':0x0,'paused':_0x54d5e1['whatsappPause'],'createdAt':_0x54d5e1['createdAt'],'updatedAt':_0x54d5e1[_0xe92e('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe92e('0x17')](respondWithFilteredResult(_0x223282,_0x2f0c66))[_0xe92e('0x25')](handleError(_0x223282,null));};exports[_0xe92e('0x51')]=function(_0x474330,_0x4ab9ab){var _0x54fac7={};var _0x4c40b8={};var _0x2b86cb;var _0x55b616;return db['WhatsappQueue'][_0xe92e('0x3d')]({'where':{'id':_0x474330[_0xe92e('0x3a')]['id']}})[_0xe92e('0x17')](handleEntityNotFound(_0x4ab9ab,null))[_0xe92e('0x17')](function(_0x1e8377){if(_0x1e8377){_0x2b86cb=_0x1e8377;_0x4c40b8[_0xe92e('0x26')]=_['keys'](db['Team'][_0xe92e('0x20')]);_0x4c40b8['query']=_[_0xe92e('0x27')](_0x474330[_0xe92e('0x24')]);_0x4c40b8[_0xe92e('0x28')]=_[_0xe92e('0x2a')](_0x4c40b8[_0xe92e('0x26')],_0x4c40b8[_0xe92e('0x24')]);_0x54fac7[_0xe92e('0x29')]=_['intersection'](_0x4c40b8[_0xe92e('0x26')],qs[_0xe92e('0x2b')](_0x474330['query'][_0xe92e('0x2b')]));_0x54fac7[_0xe92e('0x29')]=_0x54fac7[_0xe92e('0x29')][_0xe92e('0x2c')]?_0x54fac7['attributes']:_0x4c40b8['model'];_0x54fac7['order']=qs[_0xe92e('0x41')](_0x474330[_0xe92e('0x24')][_0xe92e('0x41')]);_0x54fac7[_0xe92e('0x22')]=qs[_0xe92e('0x28')](_['pick'](_0x474330[_0xe92e('0x24')],_0x4c40b8[_0xe92e('0x28')]));if(_0x474330['query'][_0xe92e('0x52')]){_0x54fac7[_0xe92e('0x22')]=_[_0xe92e('0x45')](_0x54fac7[_0xe92e('0x22')],{'$or':_[_0xe92e('0x44')](_0x54fac7['attributes'],function(_0x76a73){var _0x4c4eb2={};_0x4c4eb2[_0x76a73]={'$like':'%'+_0x474330[_0xe92e('0x24')][_0xe92e('0x52')]+'%'};return _0x4c4eb2;})});}_0x54fac7=_[_0xe92e('0x45')]({},_0x54fac7,_0x474330['options']);return _0x2b86cb[_0xe92e('0x51')](_0x54fac7);}})[_0xe92e('0x17')](function(_0x84428a){if(_0x84428a){_0x55b616=_0x84428a[_0xe92e('0x2c')];if(!_0x474330['query']['hasOwnProperty'](_0xe92e('0x3f'))){_0x54fac7['limit']=qs['limit'](_0x474330[_0xe92e('0x24')]['limit']);_0x54fac7[_0xe92e('0x10')]=qs[_0xe92e('0x10')](_0x474330[_0xe92e('0x24')][_0xe92e('0x10')]);}return _0x2b86cb[_0xe92e('0x51')](_0x54fac7);}})[_0xe92e('0x17')](function(_0x1ac2f3){if(_0x1ac2f3){return _0x1ac2f3?{'count':_0x55b616,'rows':_0x1ac2f3}:null;}})['then'](respondWithResult(_0x4ab9ab,null))[_0xe92e('0x25')](handleError(_0x4ab9ab,null));};exports['addTeams']=function(_0x1b7ef7,_0x566ec8){var _0x2fd1c0=_0x1b7ef7[_0xe92e('0x30')]['ids'];return db[_0xe92e('0x53')]['findAll']({'where':{'id':_0x2fd1c0},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe92e('0x54'),'attributes':['id','name','online',_0xe92e('0x55'),_0xe92e('0x56')],'raw':!![]}]})[_0xe92e('0x17')](function(_0xaead2b){if(_0xaead2b){var _0x3defc3=_[_0xe92e('0x57')](_0xaead2b,function(_0x1ea3a7){var _0x33b0a9=_0x1ea3a7[_0xe92e('0x18')]({'plain':!![]});return _0x33b0a9['Agents'];});return db[_0xe92e('0x1f')][_0xe92e('0x2e')]({'where':{'id':_0x1b7ef7['params']['id']}})[_0xe92e('0x17')](function(_0x19590b){return db[_0xe92e('0x58')][_0xe92e('0x59')](function(_0x238e13){return _0x19590b[_0xe92e('0x5a')](_0x2fd1c0,{'transaction':_0x238e13})[_0xe92e('0x17')](function(){return BPromise[_0xe92e('0x5b')](_0x3defc3,function(_0x320ab6){return db[_0xe92e('0x47')][_0xe92e('0x5c')]({'where':{'UserId':_0x320ab6['id'],'WhatsappQueueId':_0x1b7ef7[_0xe92e('0x3a')]['id']},'transaction':_0x238e13});});})[_0xe92e('0x17')](function(){_0x3defc3[_0xe92e('0x5d')](function(_0x229534){socket['emit'](_0xe92e('0x5e'),{'UserId':_0x229534['id'],'WhatsappQueueId':_0x19590b['id']});});});});});}})[_0xe92e('0x17')](respondWithStatusCode(_0x566ec8,null))[_0xe92e('0x25')](handleError(_0x566ec8,null));};exports[_0xe92e('0x5f')]=function(_0x48c2c2,_0x101c25){return db[_0xe92e('0x53')][_0xe92e('0x48')]({'where':{'id':_0x48c2c2[_0xe92e('0x24')][_0xe92e('0x60')]},'attributes':['id'],'include':[{'model':db[_0xe92e('0x61')],'as':_0xe92e('0x54'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x101c25,null))[_0xe92e('0x17')](function(_0x5c6b4c){var _0x2cb453=_[_0xe92e('0x44')](_0x5c6b4c,'id');var _0x2a63a2=[];var _0xd9d67=[];var _0x2ff333=squel[_0xe92e('0x62')]();_0x2ff333[_0xe92e('0x63')](_0xe92e('0x64'))[_0xe92e('0x65')](_0xe92e('0x66'),'tq')[_0xe92e('0x67')]('user_has_teams','ut',_0xe92e('0x68'))[_0xe92e('0x22')]('WhatsappQueueId\x20=\x20?',_0x48c2c2[_0xe92e('0x3a')]['id']);for(var _0x30876e=0x0;_0x30876e<_0x5c6b4c[_0xe92e('0x2c')];_0x30876e+=0x1){let _0x11ebd7=_0x5c6b4c[_0x30876e];for(var _0x2cb045=0x0;_0x2cb045<_0x11ebd7[_0xe92e('0x54')][_0xe92e('0x2c')];_0x2cb045+=0x1){let _0x84cf94=_0x11ebd7[_0xe92e('0x54')][_0x2cb045];var _0x463829=_0x2ff333[_0xe92e('0x69')]();_0x463829[_0xe92e('0x22')](_0xe92e('0x6a'),_0x84cf94['id']);_0xd9d67[_0xe92e('0x6b')](db[_0xe92e('0x58')][_0xe92e('0x24')](_0x463829[_0xe92e('0x6c')](),{'type':db[_0xe92e('0x58')]['QueryTypes'][_0xe92e('0x6d')]})['then'](function(_0x9c3f79){if(_0x9c3f79['length']===0x1){return _0x84cf94['id'];}else{var _0x17fab8=_[_0xe92e('0x6e')](_[_0xe92e('0x44')](_0x9c3f79,'TeamId'),function(_0xc45f24){return _[_0xe92e('0x6f')](_0x2cb453,_0xc45f24);});if(_0x17fab8){return _0x84cf94['id'];}}}));}}return BPromise[_0xe92e('0x70')](_0xd9d67)[_0xe92e('0x17')](function(_0x2bd8b1){_0x2a63a2=_(_0x2a63a2)[_0xe92e('0x71')](_0x2bd8b1)[_0xe92e('0x72')]()[_0xe92e('0x73')]();return db[_0xe92e('0x1f')][_0xe92e('0x2e')]({'where':{'id':_0x48c2c2['params']['id']}})['then'](function(_0x469f11){return db[_0xe92e('0x58')][_0xe92e('0x59')](function(_0x233a3b){return _0x469f11['removeTeams'](_0x48c2c2[_0xe92e('0x24')][_0xe92e('0x60')],{'transaction':_0x233a3b})[_0xe92e('0x17')](function(){if(!_[_0xe92e('0x74')](_0x2a63a2)){return _0x469f11[_0xe92e('0x75')](_0x2a63a2,{'transaction':_0x233a3b});}})[_0xe92e('0x17')](function(){_0x2a63a2[_0xe92e('0x5d')](function(_0x2fb532){socket[_0xe92e('0x76')](_0xe92e('0x77'),{'UserId':_0x2fb532,'WhatsappQueueId':_0x469f11['id']});});});});});});})[_0xe92e('0x17')](respondWithStatusCode(_0x101c25,null))[_0xe92e('0x25')](handleError(_0x101c25,null));};exports[_0xe92e('0x78')]=function(_0x5418d1,_0xfa546b){return db[_0xe92e('0x1f')]['find']({'where':{'id':_0x5418d1['params']['id']}})[_0xe92e('0x17')](handleEntityNotFound(_0xfa546b,null))['then'](function(_0x14b30c){if(_0x14b30c){return _0x14b30c[_0xe92e('0x78')](_0x5418d1[_0xe92e('0x30')][_0xe92e('0x60')],_[_0xe92e('0x79')](_0x5418d1[_0xe92e('0x30')],[_0xe92e('0x60'),'id'])||{})[_0xe92e('0x7a')](function(_0x2a4a00){for(var _0x503342=0x0;_0x503342<_0x5418d1['body'][_0xe92e('0x60')][_0xe92e('0x2c')];_0x503342+=0x1){socket[_0xe92e('0x76')](_0xe92e('0x5e'),{'UserId':Number(_0x5418d1['body'][_0xe92e('0x60')][_0x503342]),'WhatsappQueueId':Number(_0x5418d1[_0xe92e('0x3a')]['id'])});}return _0x2a4a00;});}})[_0xe92e('0x17')](respondWithResult(_0xfa546b,null))['catch'](handleError(_0xfa546b,null));};exports[_0xe92e('0x75')]=function(_0x26fbee,_0x50e7df){return db[_0xe92e('0x1f')][_0xe92e('0x2e')]({'where':{'id':_0x26fbee['params']['id']}})[_0xe92e('0x17')](handleEntityNotFound(_0x50e7df,null))[_0xe92e('0x17')](function(_0x57b32f){if(_0x57b32f){return _0x57b32f['removeAgents'](_0x26fbee['query']['ids'])['then'](function(){if(_[_0xe92e('0x7b')](_0x26fbee[_0xe92e('0x24')][_0xe92e('0x60')])){for(var _0x234e0a=0x0;_0x234e0a<_0x26fbee[_0xe92e('0x24')][_0xe92e('0x60')][_0xe92e('0x2c')];_0x234e0a+=0x1){socket[_0xe92e('0x76')]('userWhatsappQueue:remove',{'UserId':Number(_0x26fbee['query'][_0xe92e('0x60')][_0x234e0a]),'WhatsappQueueId':Number(_0x26fbee[_0xe92e('0x3a')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x26fbee[_0xe92e('0x24')][_0xe92e('0x60')]),'WhatsappQueueId':Number(_0x26fbee['params']['id'])});}});}})[_0xe92e('0x17')](respondWithStatusCode(_0x50e7df,null))['catch'](handleError(_0x50e7df,null));};exports['getAgents']=function(_0x6dc4a7,_0x7ec818){var _0x551c31={};var _0x3366d3={};var _0x1fd6e6;var _0x5c4eb9;return db[_0xe92e('0x1f')][_0xe92e('0x3d')]({'where':{'id':_0x6dc4a7['params']['id']}})['then'](handleEntityNotFound(_0x7ec818,null))[_0xe92e('0x17')](function(_0x5d040d){if(_0x5d040d){_0x1fd6e6=_0x5d040d;_0x3366d3[_0xe92e('0x26')]=_['keys'](db[_0xe92e('0x61')]['rawAttributes']);_0x3366d3[_0xe92e('0x24')]=_[_0xe92e('0x27')](_0x6dc4a7[_0xe92e('0x24')]);_0x3366d3[_0xe92e('0x28')]=_[_0xe92e('0x2a')](_0x3366d3[_0xe92e('0x26')],_0x3366d3[_0xe92e('0x24')]);_0x551c31['attributes']=_[_0xe92e('0x2a')](_0x3366d3[_0xe92e('0x26')],qs[_0xe92e('0x2b')](_0x6dc4a7[_0xe92e('0x24')][_0xe92e('0x2b')]));_0x551c31[_0xe92e('0x29')]=_0x551c31[_0xe92e('0x29')][_0xe92e('0x2c')]?_0x551c31['attributes']:_0x3366d3['model'];_0x551c31[_0xe92e('0x40')]=qs[_0xe92e('0x41')](_0x6dc4a7[_0xe92e('0x24')]['sort']);_0x551c31['where']=qs['filters'](_[_0xe92e('0x42')](_0x6dc4a7['query'],_0x3366d3[_0xe92e('0x28')]));if(_0x6dc4a7['query'][_0xe92e('0x52')]){_0x551c31[_0xe92e('0x22')]=_[_0xe92e('0x45')](_0x551c31[_0xe92e('0x22')],{'$or':_[_0xe92e('0x44')](_0x551c31['attributes'],function(_0x2b4345){var _0x19daf0={};_0x19daf0[_0x2b4345]={'$like':'%'+_0x6dc4a7[_0xe92e('0x24')][_0xe92e('0x52')]+'%'};return _0x19daf0;})});}_0x551c31=_['merge']({},_0x551c31,_0x6dc4a7[_0xe92e('0x46')]);return _0x1fd6e6[_0xe92e('0x7c')](_0x551c31);}})[_0xe92e('0x17')](function(_0x373125){if(_0x373125){_0x5c4eb9=_0x373125[_0xe92e('0x2c')];if(!_0x6dc4a7[_0xe92e('0x24')][_0xe92e('0x3e')](_0xe92e('0x3f'))){_0x551c31['limit']=qs[_0xe92e('0x11')](_0x6dc4a7[_0xe92e('0x24')]['limit']);_0x551c31['offset']=qs[_0xe92e('0x10')](_0x6dc4a7[_0xe92e('0x24')]['offset']);}return _0x1fd6e6[_0xe92e('0x7c')](_0x551c31);}})[_0xe92e('0x17')](function(_0x558245){if(_0x558245){return _0x558245?{'count':_0x5c4eb9,'rows':_0x558245}:null;}})[_0xe92e('0x17')](respondWithResult(_0x7ec818,null))['catch'](handleError(_0x7ec818,null));}; \ No newline at end of file +var _0x6b0a=['rawAttributes','fieldName','type','key','where','WhatsappQueue','include','findAll','rows','catch','show','params','query','filters','intersection','fields','attributes','length','model','merge','options','find','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','describe','getMembers','findOne','keys','UserWhatsappQueue','nolimit','order','sort','pick','WhatsappQueueId','filter','map','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','Team','getTeams','hasOwnProperty','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','end','status','json','limit','undefined','count','offset','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','stack','name','send','index'];(function(_0x4e6d8,_0x13c602){var _0x2f9e8c=function(_0x54630a){while(--_0x54630a){_0x4e6d8['push'](_0x4e6d8['shift']());}};_0x2f9e8c(++_0x13c602);}(_0x6b0a,0x1da));var _0xa6b0=function(_0xd9b84d,_0x27a493){_0xd9b84d=_0xd9b84d-0x0;var _0x350e63=_0x6b0a[_0xd9b84d];return _0x350e63;};'use strict';var BPromise=require(_0xa6b0('0x0'));var util=require(_0xa6b0('0x1'));var _=require('lodash');var squel=require(_0xa6b0('0x2'));var Redis=require(_0xa6b0('0x3'));var qs=require(_0xa6b0('0x4'));var logger=require(_0xa6b0('0x5'))(_0xa6b0('0x6'));var config=require('../../config/environment');var db=require(_0xa6b0('0x7'))['db'];config[_0xa6b0('0x8')]=_[_0xa6b0('0x9')](config[_0xa6b0('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xa6b0('0xa'))(new Redis(config[_0xa6b0('0x8')]));require(_0xa6b0('0xb'))['register'](socket);function respondWithStatusCode(_0x160ada,_0x590933){_0x590933=_0x590933||0xcc;return function(_0x2967c1){if(_0x2967c1){return _0x160ada['sendStatus'](_0x590933);}return _0x160ada['status'](_0x590933)[_0xa6b0('0xc')]();};}function respondWithResult(_0x32d5e,_0x377365){_0x377365=_0x377365||0xc8;return function(_0x3641d4){if(_0x3641d4){return _0x32d5e[_0xa6b0('0xd')](_0x377365)[_0xa6b0('0xe')](_0x3641d4);}};}function respondWithFilteredResult(_0x43e079,_0x1eab80){return function(_0xbf1f96){if(_0xbf1f96){var _0x2c5229=typeof _0x1eab80['offset']==='undefined'&&typeof _0x1eab80[_0xa6b0('0xf')]===_0xa6b0('0x10');var _0x30c44e=_0xbf1f96[_0xa6b0('0x11')];var _0x52880f=_0x2c5229?0x0:_0x1eab80[_0xa6b0('0x12')];var _0x50f1d2=_0x2c5229?_0xbf1f96[_0xa6b0('0x11')]:_0x1eab80[_0xa6b0('0x12')]+_0x1eab80[_0xa6b0('0xf')];var _0x3c5323;if(_0x50f1d2>=_0x30c44e){_0x50f1d2=_0x30c44e;_0x3c5323=0xc8;}else{_0x3c5323=0xce;}_0x43e079[_0xa6b0('0xd')](_0x3c5323);return _0x43e079['set']('Content-Range',_0x52880f+'-'+_0x50f1d2+'/'+_0x30c44e)[_0xa6b0('0xe')](_0xbf1f96);}return null;};}function saveUpdates(_0x1c77ae){return function(_0xda7f67){if(_0xda7f67){return _0xda7f67[_0xa6b0('0x13')](_0x1c77ae)[_0xa6b0('0x14')](function(_0x56bc93){return _0x56bc93;});}return null;};}function removeEntity(_0x394b74){return function(_0x12457b){if(_0x12457b){return _0x12457b[_0xa6b0('0x15')]()[_0xa6b0('0x14')](function(){var _0x45bb22=_0x12457b[_0xa6b0('0x16')]({'plain':!![]});var _0x465590=_0xa6b0('0x17');return db[_0xa6b0('0x18')][_0xa6b0('0x15')]({'where':{'type':_0x465590,'resourceId':_0x45bb22['id']}})['then'](function(){return _0x12457b;});})[_0xa6b0('0x14')](function(){_0x394b74[_0xa6b0('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367ef3){return function(_0x3aa1fc){if(!_0x3aa1fc){_0x367ef3[_0xa6b0('0x19')](0x194);}return _0x3aa1fc;};}function handleError(_0x4fb936,_0x56ad1f){_0x56ad1f=_0x56ad1f||0x1f4;return function(_0x35c5b0){logger['error'](_0x35c5b0[_0xa6b0('0x1a')]);if(_0x35c5b0[_0xa6b0('0x1b')]){delete _0x35c5b0[_0xa6b0('0x1b')];}_0x4fb936[_0xa6b0('0xd')](_0x56ad1f)[_0xa6b0('0x1c')](_0x35c5b0);};}exports[_0xa6b0('0x1d')]=function(_0x207a0d,_0x2284bb){var _0x8033e3={};var _0x343b97={'count':0x0,'rows':[]};var _0x5938fa=_['map'](db['WhatsappQueue'][_0xa6b0('0x1e')],function(_0x83db60){return{'name':_0x83db60[_0xa6b0('0x1f')],'type':_0x83db60[_0xa6b0('0x20')][_0xa6b0('0x21')]};});_0x8033e3=qs['getOptions'](_0x5938fa,_0x207a0d);var _0x2b3065={'where':_0x8033e3[_0xa6b0('0x22')]};return db[_0xa6b0('0x23')][_0xa6b0('0x11')](_0x2b3065)[_0xa6b0('0x14')](function(_0x5345b7){_0x343b97[_0xa6b0('0x11')]=_0x5345b7;_0x8033e3[_0xa6b0('0x24')]=qs['include'](_0x207a0d['query']);return db[_0xa6b0('0x23')][_0xa6b0('0x25')](_0x8033e3);})[_0xa6b0('0x14')](function(_0x57b05e){_0x343b97[_0xa6b0('0x26')]=_0x57b05e;return _0x343b97;})[_0xa6b0('0x14')](respondWithFilteredResult(_0x2284bb,_0x8033e3))[_0xa6b0('0x27')](handleError(_0x2284bb,null));};exports[_0xa6b0('0x28')]=function(_0x435387,_0x264c31){var _0x400ddc={'raw':!![],'where':{'id':_0x435387[_0xa6b0('0x29')]['id']}},_0x1cff11={};_0x1cff11['model']=_['keys'](db[_0xa6b0('0x23')][_0xa6b0('0x1e')]);_0x1cff11[_0xa6b0('0x2a')]=_['keys'](_0x435387['query']);_0x1cff11[_0xa6b0('0x2b')]=_[_0xa6b0('0x2c')](_0x1cff11['model'],_0x1cff11[_0xa6b0('0x2a')]);_0x400ddc['attributes']=_[_0xa6b0('0x2c')](_0x1cff11['model'],qs[_0xa6b0('0x2d')](_0x435387[_0xa6b0('0x2a')][_0xa6b0('0x2d')]));_0x400ddc['attributes']=_0x400ddc[_0xa6b0('0x2e')][_0xa6b0('0x2f')]?_0x400ddc[_0xa6b0('0x2e')]:_0x1cff11[_0xa6b0('0x30')];if(_0x435387[_0xa6b0('0x2a')]['includeAll']){_0x400ddc[_0xa6b0('0x24')]=[{'all':!![]}];}_0x400ddc=_[_0xa6b0('0x31')]({},_0x400ddc,_0x435387[_0xa6b0('0x32')]);return db['WhatsappQueue'][_0xa6b0('0x33')](_0x400ddc)['then'](handleEntityNotFound(_0x264c31,null))[_0xa6b0('0x14')](respondWithResult(_0x264c31,null))['catch'](handleError(_0x264c31,null));};exports[_0xa6b0('0x34')]=function(_0x24d57d,_0x22c28e){return db[_0xa6b0('0x23')]['create'](_0x24d57d[_0xa6b0('0x35')],{})[_0xa6b0('0x14')](function(_0x30cb40){var _0x311d8d=_0x24d57d[_0xa6b0('0x36')][_0xa6b0('0x16')]({'plain':!![]});if(!_0x311d8d)throw new Error(_0xa6b0('0x37'));if(_0x311d8d[_0xa6b0('0x38')]===_0xa6b0('0x36')){var _0x49e608=_0x30cb40['get']({'plain':!![]});var _0x1532b4=_0xa6b0('0x17');return db[_0xa6b0('0x39')][_0xa6b0('0x33')]({'where':{'name':_0x1532b4,'userProfileId':_0x311d8d[_0xa6b0('0x3a')]},'raw':!![]})[_0xa6b0('0x14')](function(_0x231c5c){if(_0x231c5c&&_0x231c5c[_0xa6b0('0x3b')]===0x0){return db['UserProfileResource'][_0xa6b0('0x34')]({'name':_0x49e608[_0xa6b0('0x1b')],'resourceId':_0x49e608['id'],'type':_0x231c5c['name'],'sectionId':_0x231c5c['id']},{})[_0xa6b0('0x14')](function(){return _0x30cb40;});}else{return _0x30cb40;}})[_0xa6b0('0x27')](function(_0x53287e){logger[_0xa6b0('0x3c')](_0xa6b0('0x3d'),_0x53287e);throw _0x53287e;});}return _0x30cb40;})[_0xa6b0('0x14')](respondWithResult(_0x22c28e,0xc9))[_0xa6b0('0x27')](handleError(_0x22c28e,null));};exports[_0xa6b0('0x13')]=function(_0x715984,_0x49eda0){if(_0x715984['body']['id']){delete _0x715984[_0xa6b0('0x35')]['id'];}return db[_0xa6b0('0x23')][_0xa6b0('0x33')]({'where':{'id':_0x715984[_0xa6b0('0x29')]['id']}})[_0xa6b0('0x14')](handleEntityNotFound(_0x49eda0,null))[_0xa6b0('0x14')](saveUpdates(_0x715984[_0xa6b0('0x35')],null))['then'](respondWithResult(_0x49eda0,null))[_0xa6b0('0x27')](handleError(_0x49eda0,null));};exports[_0xa6b0('0x15')]=function(_0x51a1a6,_0x5e327c){return db['WhatsappQueue']['find']({'where':{'id':_0x51a1a6[_0xa6b0('0x29')]['id']}})[_0xa6b0('0x14')](handleEntityNotFound(_0x5e327c,null))[_0xa6b0('0x14')](removeEntity(_0x5e327c,null))[_0xa6b0('0x27')](handleError(_0x5e327c,null));};exports[_0xa6b0('0x3e')]=function(_0x4dda34,_0x3404e5){return db[_0xa6b0('0x23')]['describe']()[_0xa6b0('0x14')](respondWithResult(_0x3404e5,null))[_0xa6b0('0x27')](handleError(_0x3404e5,null));};exports[_0xa6b0('0x3f')]=function(_0x3df4fb,_0x22bf1a){var _0x49a2aa={'raw':!![],'where':{}},_0x50d930={},_0x262d4f;return db[_0xa6b0('0x23')][_0xa6b0('0x40')]({'where':{'id':_0x3df4fb[_0xa6b0('0x29')]['id']}})[_0xa6b0('0x14')](handleEntityNotFound(_0x22bf1a,null))[_0xa6b0('0x14')](function(_0x443874){if(_0x443874){_0x262d4f=_0x443874[_0xa6b0('0x16')]({'plain':!![]});_0x50d930['model']=_[_0xa6b0('0x41')](db[_0xa6b0('0x42')][_0xa6b0('0x1e')]);_0x50d930['query']=_[_0xa6b0('0x41')](_0x3df4fb['query']);_0x50d930[_0xa6b0('0x2b')]=_['intersection'](_0x50d930[_0xa6b0('0x30')],_0x50d930[_0xa6b0('0x2a')]);_0x49a2aa[_0xa6b0('0x2e')]=_[_0xa6b0('0x2c')](_0x50d930[_0xa6b0('0x30')],qs[_0xa6b0('0x2d')](_0x3df4fb[_0xa6b0('0x2a')][_0xa6b0('0x2d')]));_0x49a2aa[_0xa6b0('0x2e')]=_0x49a2aa[_0xa6b0('0x2e')][_0xa6b0('0x2f')]?_0x49a2aa[_0xa6b0('0x2e')]:_0x50d930[_0xa6b0('0x30')];if(!_0x3df4fb[_0xa6b0('0x2a')]['hasOwnProperty'](_0xa6b0('0x43'))){_0x49a2aa[_0xa6b0('0xf')]=qs[_0xa6b0('0xf')](_0x3df4fb['query'][_0xa6b0('0xf')]);_0x49a2aa[_0xa6b0('0x12')]=qs[_0xa6b0('0x12')](_0x3df4fb['query'][_0xa6b0('0x12')]);}_0x49a2aa[_0xa6b0('0x44')]=qs[_0xa6b0('0x45')](_0x3df4fb[_0xa6b0('0x2a')][_0xa6b0('0x45')]);_0x49a2aa['where']=qs[_0xa6b0('0x2b')](_[_0xa6b0('0x46')](_0x3df4fb['query'],_0x50d930[_0xa6b0('0x2b')]));_0x49a2aa['where'][_0xa6b0('0x47')]=_0x443874['id'];if(_0x3df4fb[_0xa6b0('0x2a')][_0xa6b0('0x48')]){_0x49a2aa[_0xa6b0('0x22')]=_[_0xa6b0('0x31')](_0x49a2aa[_0xa6b0('0x22')],{'$or':_[_0xa6b0('0x49')](_0x49a2aa[_0xa6b0('0x2e')],function(_0x884bd){var _0x303445={};_0x303445[_0x884bd]={'$like':'%'+_0x3df4fb[_0xa6b0('0x2a')][_0xa6b0('0x48')]+'%'};return _0x303445;})});}_0x49a2aa=_['merge']({},_0x49a2aa,_0x3df4fb[_0xa6b0('0x32')]);return db[_0xa6b0('0x42')][_0xa6b0('0x25')](_0x49a2aa);}})['then'](function(_0x24c52a){if(_0x24c52a){return db[_0xa6b0('0x4a')]['findAndCountAll']({'where':{'id':_[_0xa6b0('0x49')](_0x24c52a,_0xa6b0('0x4b')),'role':_0xa6b0('0x4c')},'attributes':['id',_0xa6b0('0x1b'),_0xa6b0('0x4d'),_0xa6b0('0x4e'),_0xa6b0('0x4f')]});}})[_0xa6b0('0x14')](function(_0x251658){if(_0x251658){return{'count':_0x251658[_0xa6b0('0x11')],'rows':_[_0xa6b0('0x49')](_0x251658[_0xa6b0('0x26')],function(_0x4f4cef){return{'membername':_0x4f4cef[_0xa6b0('0x1b')],'UserId':_0x4f4cef['id'],'queue_name':_0x262d4f['name'],'WhatsappQueueId':_0x262d4f['id'],'interface':util[_0xa6b0('0x50')]('%s/%s',_0xa6b0('0x51'),_0x4f4cef[_0xa6b0('0x1b')]),'penalty':0x0,'paused':_0x4f4cef[_0xa6b0('0x4d')],'createdAt':_0x4f4cef['createdAt'],'updatedAt':_0x4f4cef[_0xa6b0('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa6b0('0x14')](respondWithFilteredResult(_0x22bf1a,_0x49a2aa))[_0xa6b0('0x27')](handleError(_0x22bf1a,null));};exports['getTeams']=function(_0x475e3a,_0x1d15f6){var _0x4765f4={};var _0x2f5da1={};var _0x3e0ee1;var _0x527a2a;return db['WhatsappQueue'][_0xa6b0('0x40')]({'where':{'id':_0x475e3a[_0xa6b0('0x29')]['id']}})['then'](handleEntityNotFound(_0x1d15f6,null))[_0xa6b0('0x14')](function(_0x32c51e){if(_0x32c51e){_0x3e0ee1=_0x32c51e;_0x2f5da1[_0xa6b0('0x30')]=_[_0xa6b0('0x41')](db[_0xa6b0('0x52')][_0xa6b0('0x1e')]);_0x2f5da1[_0xa6b0('0x2a')]=_[_0xa6b0('0x41')](_0x475e3a['query']);_0x2f5da1['filters']=_['intersection'](_0x2f5da1[_0xa6b0('0x30')],_0x2f5da1[_0xa6b0('0x2a')]);_0x4765f4[_0xa6b0('0x2e')]=_[_0xa6b0('0x2c')](_0x2f5da1[_0xa6b0('0x30')],qs[_0xa6b0('0x2d')](_0x475e3a[_0xa6b0('0x2a')][_0xa6b0('0x2d')]));_0x4765f4[_0xa6b0('0x2e')]=_0x4765f4[_0xa6b0('0x2e')][_0xa6b0('0x2f')]?_0x4765f4['attributes']:_0x2f5da1[_0xa6b0('0x30')];_0x4765f4[_0xa6b0('0x44')]=qs['sort'](_0x475e3a[_0xa6b0('0x2a')]['sort']);_0x4765f4[_0xa6b0('0x22')]=qs[_0xa6b0('0x2b')](_[_0xa6b0('0x46')](_0x475e3a[_0xa6b0('0x2a')],_0x2f5da1['filters']));if(_0x475e3a[_0xa6b0('0x2a')]['filter']){_0x4765f4[_0xa6b0('0x22')]=_[_0xa6b0('0x31')](_0x4765f4[_0xa6b0('0x22')],{'$or':_['map'](_0x4765f4[_0xa6b0('0x2e')],function(_0x5a0390){var _0x1f81f7={};_0x1f81f7[_0x5a0390]={'$like':'%'+_0x475e3a['query']['filter']+'%'};return _0x1f81f7;})});}_0x4765f4=_[_0xa6b0('0x31')]({},_0x4765f4,_0x475e3a[_0xa6b0('0x32')]);return _0x3e0ee1[_0xa6b0('0x53')](_0x4765f4);}})[_0xa6b0('0x14')](function(_0x72c2d1){if(_0x72c2d1){_0x527a2a=_0x72c2d1[_0xa6b0('0x2f')];if(!_0x475e3a['query'][_0xa6b0('0x54')](_0xa6b0('0x43'))){_0x4765f4['limit']=qs[_0xa6b0('0xf')](_0x475e3a['query'][_0xa6b0('0xf')]);_0x4765f4[_0xa6b0('0x12')]=qs['offset'](_0x475e3a[_0xa6b0('0x2a')][_0xa6b0('0x12')]);}return _0x3e0ee1[_0xa6b0('0x53')](_0x4765f4);}})['then'](function(_0x1c2d05){if(_0x1c2d05){return _0x1c2d05?{'count':_0x527a2a,'rows':_0x1c2d05}:null;}})[_0xa6b0('0x14')](respondWithResult(_0x1d15f6,null))[_0xa6b0('0x27')](handleError(_0x1d15f6,null));};exports['addTeams']=function(_0x2b2d5f,_0x1e7fd6){var _0x254904=_0x2b2d5f[_0xa6b0('0x35')][_0xa6b0('0x55')];return db[_0xa6b0('0x52')]['findAll']({'where':{'id':_0x254904},'attributes':['id'],'include':[{'model':db[_0xa6b0('0x4a')],'as':_0xa6b0('0x56'),'attributes':['id',_0xa6b0('0x1b'),_0xa6b0('0x57'),_0xa6b0('0x58'),'interface'],'raw':!![]}]})['then'](function(_0x5847db){if(_0x5847db){var _0x3928d0=_[_0xa6b0('0x59')](_0x5847db,function(_0x4aa9e8){var _0x4388ad=_0x4aa9e8[_0xa6b0('0x16')]({'plain':!![]});return _0x4388ad['Agents'];});return db[_0xa6b0('0x23')][_0xa6b0('0x33')]({'where':{'id':_0x2b2d5f[_0xa6b0('0x29')]['id']}})[_0xa6b0('0x14')](function(_0x13bdcd){return db[_0xa6b0('0x5a')][_0xa6b0('0x5b')](function(_0x9bc75a){return _0x13bdcd[_0xa6b0('0x5c')](_0x254904,{'transaction':_0x9bc75a})[_0xa6b0('0x14')](function(){return BPromise[_0xa6b0('0x5d')](_0x3928d0,function(_0x43e638){return db[_0xa6b0('0x42')][_0xa6b0('0x5e')]({'where':{'UserId':_0x43e638['id'],'WhatsappQueueId':_0x2b2d5f[_0xa6b0('0x29')]['id']},'transaction':_0x9bc75a});});})[_0xa6b0('0x14')](function(){_0x3928d0[_0xa6b0('0x5f')](function(_0x2484b9){socket[_0xa6b0('0x60')](_0xa6b0('0x61'),{'UserId':_0x2484b9['id'],'WhatsappQueueId':_0x13bdcd['id']});});});});});}})['then'](respondWithStatusCode(_0x1e7fd6,null))[_0xa6b0('0x27')](handleError(_0x1e7fd6,null));};exports['removeTeams']=function(_0x13f467,_0x189d49){return db[_0xa6b0('0x52')][_0xa6b0('0x25')]({'where':{'id':_0x13f467[_0xa6b0('0x2a')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa6b0('0x4a')],'as':_0xa6b0('0x56'),'attributes':['id'],'raw':!![]}]})[_0xa6b0('0x14')](handleEntityNotFound(_0x189d49,null))['then'](function(_0x41ea04){var _0xd172a6=_['map'](_0x41ea04,'id');var _0x247604=[];var _0x56d3d8=[];var _0x592b19=squel[_0xa6b0('0x62')]();_0x592b19[_0xa6b0('0x63')](_0xa6b0('0x64'))[_0xa6b0('0x65')](_0xa6b0('0x66'),'tq')['join'](_0xa6b0('0x67'),'ut',_0xa6b0('0x68'))['where'](_0xa6b0('0x69'),_0x13f467['params']['id']);for(var _0x181ac4=0x0;_0x181ac4<_0x41ea04['length'];_0x181ac4+=0x1){let _0x1db7f8=_0x41ea04[_0x181ac4];for(var _0x4eff40=0x0;_0x4eff40<_0x1db7f8[_0xa6b0('0x56')][_0xa6b0('0x2f')];_0x4eff40+=0x1){let _0x3ed7ee=_0x1db7f8['Agents'][_0x4eff40];var _0x1311b9=_0x592b19[_0xa6b0('0x6a')]();_0x1311b9[_0xa6b0('0x22')](_0xa6b0('0x6b'),_0x3ed7ee['id']);_0x56d3d8['push'](db['sequelize'][_0xa6b0('0x2a')](_0x1311b9[_0xa6b0('0x6c')](),{'type':db[_0xa6b0('0x5a')][_0xa6b0('0x6d')][_0xa6b0('0x6e')]})[_0xa6b0('0x14')](function(_0x609a51){if(_0x609a51[_0xa6b0('0x2f')]===0x1){return _0x3ed7ee['id'];}else{var _0x6e5d07=_['every'](_[_0xa6b0('0x49')](_0x609a51,_0xa6b0('0x6f')),function(_0xd17993){return _[_0xa6b0('0x70')](_0xd172a6,_0xd17993);});if(_0x6e5d07){return _0x3ed7ee['id'];}}}));}}return BPromise[_0xa6b0('0x71')](_0x56d3d8)['then'](function(_0x1b2ae8){_0x247604=_(_0x247604)[_0xa6b0('0x72')](_0x1b2ae8)[_0xa6b0('0x73')]()[_0xa6b0('0x74')]();return db[_0xa6b0('0x23')][_0xa6b0('0x33')]({'where':{'id':_0x13f467[_0xa6b0('0x29')]['id']}})[_0xa6b0('0x14')](function(_0x249eb6){return db[_0xa6b0('0x5a')][_0xa6b0('0x5b')](function(_0x260668){return _0x249eb6[_0xa6b0('0x75')](_0x13f467[_0xa6b0('0x2a')]['ids'],{'transaction':_0x260668})[_0xa6b0('0x14')](function(){if(!_[_0xa6b0('0x76')](_0x247604)){return _0x249eb6[_0xa6b0('0x77')](_0x247604,{'transaction':_0x260668});}})[_0xa6b0('0x14')](function(){_0x247604[_0xa6b0('0x5f')](function(_0x52ba40){socket[_0xa6b0('0x60')]('userWhatsappQueue:remove',{'UserId':_0x52ba40,'WhatsappQueueId':_0x249eb6['id']});});});});});});})[_0xa6b0('0x14')](respondWithStatusCode(_0x189d49,null))[_0xa6b0('0x27')](handleError(_0x189d49,null));};exports[_0xa6b0('0x78')]=function(_0x436c20,_0x4a61be){return db[_0xa6b0('0x23')][_0xa6b0('0x33')]({'where':{'id':_0x436c20[_0xa6b0('0x29')]['id']}})['then'](handleEntityNotFound(_0x4a61be,null))['then'](function(_0x3bf9e8){if(_0x3bf9e8){return _0x3bf9e8[_0xa6b0('0x78')](_0x436c20[_0xa6b0('0x35')][_0xa6b0('0x55')],_[_0xa6b0('0x79')](_0x436c20['body'],[_0xa6b0('0x55'),'id'])||{})[_0xa6b0('0x7a')](function(_0x5beef9){for(var _0x37430a=0x0;_0x37430a<_0x436c20[_0xa6b0('0x35')][_0xa6b0('0x55')][_0xa6b0('0x2f')];_0x37430a+=0x1){socket[_0xa6b0('0x60')](_0xa6b0('0x61'),{'UserId':Number(_0x436c20[_0xa6b0('0x35')][_0xa6b0('0x55')][_0x37430a]),'WhatsappQueueId':Number(_0x436c20[_0xa6b0('0x29')]['id'])});}return _0x5beef9;});}})['then'](respondWithResult(_0x4a61be,null))['catch'](handleError(_0x4a61be,null));};exports[_0xa6b0('0x77')]=function(_0x509602,_0x25e374){return db['WhatsappQueue'][_0xa6b0('0x33')]({'where':{'id':_0x509602[_0xa6b0('0x29')]['id']}})[_0xa6b0('0x14')](handleEntityNotFound(_0x25e374,null))[_0xa6b0('0x14')](function(_0xf68f58){if(_0xf68f58){return _0xf68f58['removeAgents'](_0x509602[_0xa6b0('0x2a')][_0xa6b0('0x55')])[_0xa6b0('0x14')](function(){if(_[_0xa6b0('0x7b')](_0x509602[_0xa6b0('0x2a')][_0xa6b0('0x55')])){for(var _0x266ef5=0x0;_0x266ef5<_0x509602[_0xa6b0('0x2a')][_0xa6b0('0x55')][_0xa6b0('0x2f')];_0x266ef5+=0x1){socket[_0xa6b0('0x60')]('userWhatsappQueue:remove',{'UserId':Number(_0x509602[_0xa6b0('0x2a')][_0xa6b0('0x55')][_0x266ef5]),'WhatsappQueueId':Number(_0x509602['params']['id'])});}}else{socket[_0xa6b0('0x60')](_0xa6b0('0x7c'),{'UserId':Number(_0x509602[_0xa6b0('0x2a')]['ids']),'WhatsappQueueId':Number(_0x509602[_0xa6b0('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x25e374,null))[_0xa6b0('0x27')](handleError(_0x25e374,null));};exports['getAgents']=function(_0x2a9f3c,_0x3d0db1){var _0x747afd={};var _0x2937ea={};var _0x2abaac;var _0x5bf0f0;return db['WhatsappQueue'][_0xa6b0('0x40')]({'where':{'id':_0x2a9f3c[_0xa6b0('0x29')]['id']}})[_0xa6b0('0x14')](handleEntityNotFound(_0x3d0db1,null))[_0xa6b0('0x14')](function(_0x13c30f){if(_0x13c30f){_0x2abaac=_0x13c30f;_0x2937ea[_0xa6b0('0x30')]=_[_0xa6b0('0x41')](db[_0xa6b0('0x4a')]['rawAttributes']);_0x2937ea[_0xa6b0('0x2a')]=_['keys'](_0x2a9f3c[_0xa6b0('0x2a')]);_0x2937ea['filters']=_['intersection'](_0x2937ea[_0xa6b0('0x30')],_0x2937ea[_0xa6b0('0x2a')]);_0x747afd[_0xa6b0('0x2e')]=_[_0xa6b0('0x2c')](_0x2937ea['model'],qs[_0xa6b0('0x2d')](_0x2a9f3c[_0xa6b0('0x2a')][_0xa6b0('0x2d')]));_0x747afd[_0xa6b0('0x2e')]=_0x747afd['attributes'][_0xa6b0('0x2f')]?_0x747afd[_0xa6b0('0x2e')]:_0x2937ea[_0xa6b0('0x30')];_0x747afd[_0xa6b0('0x44')]=qs[_0xa6b0('0x45')](_0x2a9f3c['query'][_0xa6b0('0x45')]);_0x747afd[_0xa6b0('0x22')]=qs[_0xa6b0('0x2b')](_[_0xa6b0('0x46')](_0x2a9f3c[_0xa6b0('0x2a')],_0x2937ea[_0xa6b0('0x2b')]));if(_0x2a9f3c['query']['filter']){_0x747afd[_0xa6b0('0x22')]=_[_0xa6b0('0x31')](_0x747afd[_0xa6b0('0x22')],{'$or':_['map'](_0x747afd[_0xa6b0('0x2e')],function(_0x438211){var _0x58b21a={};_0x58b21a[_0x438211]={'$like':'%'+_0x2a9f3c['query'][_0xa6b0('0x48')]+'%'};return _0x58b21a;})});}_0x747afd=_[_0xa6b0('0x31')]({},_0x747afd,_0x2a9f3c[_0xa6b0('0x32')]);return _0x2abaac['getAgents'](_0x747afd);}})[_0xa6b0('0x14')](function(_0x52636b){if(_0x52636b){_0x5bf0f0=_0x52636b[_0xa6b0('0x2f')];if(!_0x2a9f3c[_0xa6b0('0x2a')][_0xa6b0('0x54')](_0xa6b0('0x43'))){_0x747afd['limit']=qs[_0xa6b0('0xf')](_0x2a9f3c[_0xa6b0('0x2a')]['limit']);_0x747afd[_0xa6b0('0x12')]=qs[_0xa6b0('0x12')](_0x2a9f3c[_0xa6b0('0x2a')][_0xa6b0('0x12')]);}return _0x2abaac[_0xa6b0('0x7d')](_0x747afd);}})[_0xa6b0('0x14')](function(_0xa53faa){if(_0xa53faa){return _0xa53faa?{'count':_0x5bf0f0,'rows':_0xa53faa}:null;}})['then'](respondWithResult(_0x3d0db1,null))[_0xa6b0('0x27')](handleError(_0x3d0db1,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 59460d8..56ce0c0 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 _0x5de1=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x5a69df,_0x2b21fd){var _0x220ad0=function(_0x29ebba){while(--_0x29ebba){_0x5a69df['push'](_0x5a69df['shift']());}};_0x220ad0(++_0x2b21fd);}(_0x5de1,0x115));var _0x15de=function(_0x51106f,_0x4c0112){_0x51106f=_0x51106f-0x0;var _0x51b465=_0x5de1[_0x51106f];return _0x51b465;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x15de('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x15de('0x1')](0x0);var events={'afterCreate':_0x15de('0x2'),'afterUpdate':_0x15de('0x3'),'afterDestroy':_0x15de('0x4')};function emitEvent(_0x3dfe39){return function(_0x2e62eb,_0x24a21a,_0x485c37){WhatsappQueueEvents[_0x15de('0x5')](_0x3dfe39+':'+_0x2e62eb['id'],_0x2e62eb);WhatsappQueueEvents[_0x15de('0x5')](_0x3dfe39,_0x2e62eb);_0x485c37(null);};}for(var e in events){if(events[_0x15de('0x6')](e)){var event=events[e];WhatsappQueue[_0x15de('0x7')](e,emitEvent(event));}}module[_0x15de('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x5b8b=['WhatsappQueue','save','update','remove','emit','hook','events'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5b8b,0xe6));var _0xb5b8=function(_0x582421,_0xe8d453){_0x582421=_0x582421-0x0;var _0x37d703=_0x5b8b[_0x582421];return _0x37d703;};'use strict';var EventEmitter=require(_0xb5b8('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xb5b8('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb5b8('0x2'),'afterUpdate':_0xb5b8('0x3'),'afterDestroy':_0xb5b8('0x4')};function emitEvent(_0x3aef95){return function(_0x4bb6c7,_0x556c51,_0x42afe0){WhatsappQueueEvents[_0xb5b8('0x5')](_0x3aef95+':'+_0x4bb6c7['id'],_0x4bb6c7);WhatsappQueueEvents[_0xb5b8('0x5')](_0x3aef95,_0x4bb6c7);_0x42afe0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xb5b8('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 9ed7add..0767e85 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 _0x30af=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xa72345,_0x1fd304){var _0xbc82fb=function(_0xb1594f){while(--_0xb1594f){_0xa72345['push'](_0xa72345['shift']());}};_0xbc82fb(++_0x1fd304);}(_0x30af,0x1ee));var _0xf30a=function(_0x5c2ad7,_0x2872a5){_0x5c2ad7=_0x5c2ad7-0x0;var _0x32871c=_0x30af[_0x5c2ad7];return _0x32871c;};'use strict';var _=require(_0xf30a('0x0'));var util=require(_0xf30a('0x1'));var logger=require(_0xf30a('0x2'))(_0xf30a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf30a('0x4'));var fs=require('fs');var path=require(_0xf30a('0x5'));var rimraf=require(_0xf30a('0x6'));var config=require(_0xf30a('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0xf30a('0x8')]=function(_0x14085c,_0x20b66a){return _0x14085c[_0xf30a('0x9')](_0xf30a('0xa'),attributes,{'tableName':_0xf30a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf319=['request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','api','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf319,0x126));var _0x9f31=function(_0x579f4e,_0x28a2c8){_0x579f4e=_0x579f4e-0x0;var _0x5efd59=_0xf319[_0x579f4e];return _0x5efd59;};'use strict';var _=require(_0x9f31('0x0'));var util=require(_0x9f31('0x1'));var logger=require('../../config/logger')(_0x9f31('0x2'));var moment=require(_0x9f31('0x3'));var BPromise=require(_0x9f31('0x4'));var rp=require(_0x9f31('0x5'));var fs=require('fs');var path=require(_0x9f31('0x6'));var rimraf=require('rimraf');var config=require(_0x9f31('0x7'));var attributes=require(_0x9f31('0x8'));module[_0x9f31('0x9')]=function(_0xcf4a9b,_0x39623c){return _0xcf4a9b[_0x9f31('0xa')](_0x9f31('0xb'),attributes,{'tableName':_0x9f31('0xc'),'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 d4b061c..515a61d 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 _0xd6af=['map','stringify','WhatsappQueue','find','where','model','ShowWhatsappQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappQueue,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','catch','GetWhatsappQueue','findAll','options','raw','attributes','limit','include'];(function(_0x4aaebf,_0x44b5b4){var _0x4c42ae=function(_0x5a3945){while(--_0x5a3945){_0x4aaebf['push'](_0x4aaebf['shift']());}};_0x4c42ae(++_0x44b5b4);}(_0xd6af,0x14f));var _0xfd6a=function(_0x4eaa96,_0x53b203){_0x4eaa96=_0x4eaa96-0x0;var _0x390958=_0xd6af[_0x4eaa96];return _0x390958;};'use strict';var _=require(_0xfd6a('0x0'));var util=require(_0xfd6a('0x1'));var moment=require('moment');var BPromise=require(_0xfd6a('0x2'));var rs=require(_0xfd6a('0x3'));var fs=require('fs');var Redis=require(_0xfd6a('0x4'));var db=require(_0xfd6a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd6a('0x6'))(_0xfd6a('0x7'));var config=require(_0xfd6a('0x8'));var jayson=require(_0xfd6a('0x9'));var client=jayson[_0xfd6a('0xa')]['http']({'port':0x232a});config[_0xfd6a('0xb')]=_[_0xfd6a('0xc')](config['redis'],{'host':_0xfd6a('0xd'),'port':0x18eb});var socket=require(_0xfd6a('0xe'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xfd6a('0xf')](socket);function respondWithRpcPromise(_0x15c598,_0x30ad96,_0x3d7e13){return new BPromise(function(_0xa4b84c,_0xf2e516){return client[_0xfd6a('0x10')](_0x15c598,_0x3d7e13)[_0xfd6a('0x11')](function(_0x3c8702){logger['info'](_0xfd6a('0x12'),_0x30ad96,'request\x20sent');logger[_0xfd6a('0x13')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x30ad96,'request\x20sent',JSON['stringify'](_0x3c8702));if(_0x3c8702[_0xfd6a('0x14')]){if(_0x3c8702[_0xfd6a('0x14')][_0xfd6a('0x15')]===0x1f4){logger[_0xfd6a('0x14')](_0xfd6a('0x12'),_0x30ad96,_0x3c8702[_0xfd6a('0x14')][_0xfd6a('0x16')]);return _0xf2e516(_0x3c8702[_0xfd6a('0x14')][_0xfd6a('0x16')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x30ad96,_0x3c8702[_0xfd6a('0x14')][_0xfd6a('0x16')]);return _0xa4b84c(_0x3c8702[_0xfd6a('0x14')][_0xfd6a('0x16')]);}else{logger[_0xfd6a('0x17')](_0xfd6a('0x12'),_0x30ad96,_0xfd6a('0x18'));_0xa4b84c(_0x3c8702[_0xfd6a('0x19')][_0xfd6a('0x16')]);}})[_0xfd6a('0x1a')](function(_0x4a1bc0){logger[_0xfd6a('0x14')](_0xfd6a('0x12'),_0x30ad96,_0x4a1bc0);_0xf2e516(_0x4a1bc0);});});}exports[_0xfd6a('0x1b')]=function(_0x5a256b){var _0xe428d7=this;return new Promise(function(_0x34eb3c,_0x3918cc){return db['WhatsappQueue'][_0xfd6a('0x1c')]({'raw':_0x5a256b[_0xfd6a('0x1d')]?_0x5a256b[_0xfd6a('0x1d')][_0xfd6a('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a256b[_0xfd6a('0x1d')]?_0x5a256b[_0xfd6a('0x1d')]['where']||null:null,'attributes':_0x5a256b['options']?_0x5a256b['options'][_0xfd6a('0x1f')]||null:null,'limit':_0x5a256b['options']?_0x5a256b['options'][_0xfd6a('0x20')]||null:null,'include':_0x5a256b[_0xfd6a('0x1d')]?_0x5a256b[_0xfd6a('0x1d')][_0xfd6a('0x21')]?_['map'](_0x5a256b[_0xfd6a('0x1d')]['include'],function(_0x5cf322){return{'model':db[_0x5cf322['model']],'as':_0x5cf322['as'],'attributes':_0x5cf322[_0xfd6a('0x1f')],'include':_0x5cf322['include']?_[_0xfd6a('0x22')](_0x5cf322['include'],function(_0x3c5d6b){return{'model':db[_0x3c5d6b['model']],'as':_0x3c5d6b['as'],'attributes':_0x3c5d6b[_0xfd6a('0x1f')],'include':_0x3c5d6b[_0xfd6a('0x21')]?_['map'](_0x3c5d6b[_0xfd6a('0x21')],function(_0x239fa4){return{'model':db[_0x239fa4['model']],'as':_0x239fa4['as'],'attributes':_0x239fa4[_0xfd6a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35c8f1){logger[_0xfd6a('0x17')]('GetWhatsappQueue',_0x5a256b);logger[_0xfd6a('0x13')](_0xfd6a('0x1b'),_0x5a256b,JSON[_0xfd6a('0x23')](_0x35c8f1));_0x34eb3c(_0x35c8f1);})[_0xfd6a('0x1a')](function(_0x5159ce){logger['error'](_0xfd6a('0x1b'),_0x5159ce['message'],_0x5a256b);_0x3918cc(_0xe428d7['error'](0x1f4,_0x5159ce[_0xfd6a('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0xc881b8){var _0x2f06a6=this;return new Promise(function(_0x56f17a,_0xb3e9d0){return db[_0xfd6a('0x24')][_0xfd6a('0x25')]({'raw':_0xc881b8[_0xfd6a('0x1d')]?_0xc881b8['options']['raw']===undefined?!![]:![]:!![],'where':_0xc881b8[_0xfd6a('0x1d')]?_0xc881b8[_0xfd6a('0x1d')][_0xfd6a('0x26')]||null:null,'attributes':_0xc881b8[_0xfd6a('0x1d')]?_0xc881b8[_0xfd6a('0x1d')][_0xfd6a('0x1f')]||null:null,'include':_0xc881b8[_0xfd6a('0x1d')]?_0xc881b8[_0xfd6a('0x1d')][_0xfd6a('0x21')]?_[_0xfd6a('0x22')](_0xc881b8['options'][_0xfd6a('0x21')],function(_0x1b88c5){return{'model':db[_0x1b88c5[_0xfd6a('0x27')]],'as':_0x1b88c5['as'],'attributes':_0x1b88c5['attributes'],'include':_0x1b88c5[_0xfd6a('0x21')]?_[_0xfd6a('0x22')](_0x1b88c5[_0xfd6a('0x21')],function(_0x30337b){return{'model':db[_0x30337b[_0xfd6a('0x27')]],'as':_0x30337b['as'],'attributes':_0x30337b[_0xfd6a('0x1f')],'include':_0x30337b['include']?_[_0xfd6a('0x22')](_0x30337b['include'],function(_0x141a36){return{'model':db[_0x141a36['model']],'as':_0x141a36['as'],'attributes':_0x141a36['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd6a('0x11')](function(_0xdbe986){logger[_0xfd6a('0x17')](_0xfd6a('0x28'),_0xc881b8);logger[_0xfd6a('0x13')](_0xfd6a('0x28'),_0xc881b8,JSON[_0xfd6a('0x23')](_0xdbe986));_0x56f17a(_0xdbe986);})[_0xfd6a('0x1a')](function(_0x4922b4){logger[_0xfd6a('0x14')](_0xfd6a('0x28'),_0x4922b4[_0xfd6a('0x16')],_0xc881b8);_0xb3e9d0(_0x2f06a6[_0xfd6a('0x14')](0x1f4,_0x4922b4[_0xfd6a('0x16')]));});});}; \ No newline at end of file +var _0xb94d=['info','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','GetWhatsappQueue','find','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then'];(function(_0x52d723,_0x15b9d9){var _0x2b4fa5=function(_0x564044){while(--_0x564044){_0x52d723['push'](_0x52d723['shift']());}};_0x2b4fa5(++_0x15b9d9);}(_0xb94d,0x1da));var _0xdb94=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0xb94d[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0xdb94('0x0'));var util=require(_0xdb94('0x1'));var moment=require(_0xdb94('0x2'));var BPromise=require(_0xdb94('0x3'));var rs=require(_0xdb94('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb94('0x5'));var logger=require(_0xdb94('0x6'))('rpc');var config=require(_0xdb94('0x7'));var jayson=require(_0xdb94('0x8'));var client=jayson[_0xdb94('0x9')][_0xdb94('0xa')]({'port':0x232a});config[_0xdb94('0xb')]=_[_0xdb94('0xc')](config[_0xdb94('0xb')],{'host':_0xdb94('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb94('0xb')]));require(_0xdb94('0xe'))[_0xdb94('0xf')](socket);function respondWithRpcPromise(_0xe40e32,_0x41828a,_0x140af9){return new BPromise(function(_0x4e1e,_0x22250b){return client[_0xdb94('0x10')](_0xe40e32,_0x140af9)[_0xdb94('0x11')](function(_0x4fa913){logger[_0xdb94('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x41828a,'request\x20sent');logger[_0xdb94('0x13')](_0xdb94('0x14'),_0x41828a,_0xdb94('0x15'),JSON[_0xdb94('0x16')](_0x4fa913));if(_0x4fa913[_0xdb94('0x17')]){if(_0x4fa913[_0xdb94('0x17')][_0xdb94('0x18')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x41828a,_0x4fa913[_0xdb94('0x17')][_0xdb94('0x19')]);return _0x22250b(_0x4fa913[_0xdb94('0x17')][_0xdb94('0x19')]);}logger['error'](_0xdb94('0x1a'),_0x41828a,_0x4fa913[_0xdb94('0x17')]['message']);return _0x4e1e(_0x4fa913[_0xdb94('0x17')][_0xdb94('0x19')]);}else{logger[_0xdb94('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x41828a,_0xdb94('0x15'));_0x4e1e(_0x4fa913[_0xdb94('0x1b')]['message']);}})[_0xdb94('0x1c')](function(_0x4634ce){logger[_0xdb94('0x17')](_0xdb94('0x1a'),_0x41828a,_0x4634ce);_0x22250b(_0x4634ce);});});}exports['GetWhatsappQueue']=function(_0x1e8982){var _0x27fb84=this;return new Promise(function(_0x1907cd,_0x10fa8b){return db[_0xdb94('0x1d')][_0xdb94('0x1e')]({'raw':_0x1e8982[_0xdb94('0x1f')]?_0x1e8982[_0xdb94('0x1f')][_0xdb94('0x20')]===undefined?!![]:![]:!![],'where':_0x1e8982[_0xdb94('0x1f')]?_0x1e8982['options'][_0xdb94('0x21')]||null:null,'attributes':_0x1e8982[_0xdb94('0x1f')]?_0x1e8982[_0xdb94('0x1f')][_0xdb94('0x22')]||null:null,'limit':_0x1e8982[_0xdb94('0x1f')]?_0x1e8982[_0xdb94('0x1f')]['limit']||null:null,'include':_0x1e8982[_0xdb94('0x1f')]?_0x1e8982[_0xdb94('0x1f')][_0xdb94('0x23')]?_[_0xdb94('0x24')](_0x1e8982[_0xdb94('0x1f')][_0xdb94('0x23')],function(_0x141132){return{'model':db[_0x141132[_0xdb94('0x25')]],'as':_0x141132['as'],'attributes':_0x141132[_0xdb94('0x22')],'include':_0x141132['include']?_['map'](_0x141132['include'],function(_0x13174e){return{'model':db[_0x13174e['model']],'as':_0x13174e['as'],'attributes':_0x13174e[_0xdb94('0x22')],'include':_0x13174e[_0xdb94('0x23')]?_[_0xdb94('0x24')](_0x13174e[_0xdb94('0x23')],function(_0xc711b6){return{'model':db[_0xc711b6[_0xdb94('0x25')]],'as':_0xc711b6['as'],'attributes':_0xc711b6[_0xdb94('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdb94('0x11')](function(_0x5abd98){logger[_0xdb94('0x12')](_0xdb94('0x26'),_0x1e8982);logger['debug']('GetWhatsappQueue',_0x1e8982,JSON[_0xdb94('0x16')](_0x5abd98));_0x1907cd(_0x5abd98);})['catch'](function(_0x10a9d0){logger[_0xdb94('0x17')](_0xdb94('0x26'),_0x10a9d0['message'],_0x1e8982);_0x10fa8b(_0x27fb84['error'](0x1f4,_0x10a9d0['message']));});});};exports['ShowWhatsappQueue']=function(_0x2c0c9e){var _0x279bd1=this;return new Promise(function(_0x158a2f,_0x264393){return db[_0xdb94('0x1d')][_0xdb94('0x27')]({'raw':_0x2c0c9e[_0xdb94('0x1f')]?_0x2c0c9e[_0xdb94('0x1f')][_0xdb94('0x20')]===undefined?!![]:![]:!![],'where':_0x2c0c9e['options']?_0x2c0c9e[_0xdb94('0x1f')]['where']||null:null,'attributes':_0x2c0c9e[_0xdb94('0x1f')]?_0x2c0c9e[_0xdb94('0x1f')][_0xdb94('0x22')]||null:null,'include':_0x2c0c9e[_0xdb94('0x1f')]?_0x2c0c9e[_0xdb94('0x1f')][_0xdb94('0x23')]?_[_0xdb94('0x24')](_0x2c0c9e['options'][_0xdb94('0x23')],function(_0x30b2c2){return{'model':db[_0x30b2c2[_0xdb94('0x25')]],'as':_0x30b2c2['as'],'attributes':_0x30b2c2[_0xdb94('0x22')],'include':_0x30b2c2[_0xdb94('0x23')]?_[_0xdb94('0x24')](_0x30b2c2['include'],function(_0x42b2db){return{'model':db[_0x42b2db[_0xdb94('0x25')]],'as':_0x42b2db['as'],'attributes':_0x42b2db[_0xdb94('0x22')],'include':_0x42b2db['include']?_[_0xdb94('0x24')](_0x42b2db[_0xdb94('0x23')],function(_0x32dcb6){return{'model':db[_0x32dcb6[_0xdb94('0x25')]],'as':_0x32dcb6['as'],'attributes':_0x32dcb6[_0xdb94('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdb94('0x11')](function(_0x3a6e3c){logger[_0xdb94('0x12')](_0xdb94('0x28'),_0x2c0c9e);logger[_0xdb94('0x13')]('ShowWhatsappQueue',_0x2c0c9e,JSON[_0xdb94('0x16')](_0x3a6e3c));_0x158a2f(_0x3a6e3c);})[_0xdb94('0x1c')](function(_0xff4ac2){logger[_0xdb94('0x17')](_0xdb94('0x28'),_0xff4ac2[_0xdb94('0x19')],_0x2c0c9e);_0x264393(_0x279bd1[_0xdb94('0x17')](0x1f4,_0xff4ac2[_0xdb94('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 66b7d36..5413d36 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 _0x76c9=['whatsappQueue:','save','remove','update','removeListener'];(function(_0x30c30d,_0x11af19){var _0x148de0=function(_0x2d78e2){while(--_0x2d78e2){_0x30c30d['push'](_0x30c30d['shift']());}};_0x148de0(++_0x11af19);}(_0x76c9,0x74));var _0x976c=function(_0x39f470,_0x30a1bc){_0x39f470=_0x39f470-0x0;var _0x3ea2a5=_0x76c9[_0x39f470];return _0x3ea2a5;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x976c('0x0'),_0x976c('0x1'),_0x976c('0x2')];function createListener(_0x2cc6af,_0x8ebbad){return function(_0x5b2329){_0x8ebbad['emit'](_0x2cc6af,_0x5b2329);};}function removeListener(_0x570013,_0x31e0ef){return function(){WhatsappQueueEvents[_0x976c('0x3')](_0x570013,_0x31e0ef);};}exports['register']=function(_0x31e035){for(var _0x4626f2=0x0,_0x28bc64=events['length'];_0x4626f2<_0x28bc64;_0x4626f2++){var _0x5654ad=events[_0x4626f2];var _0x39e26c=createListener(_0x976c('0x4')+_0x5654ad,_0x31e035);WhatsappQueueEvents['on'](_0x5654ad,_0x39e26c);}}; \ No newline at end of file +var _0xa843=['whatsappQueue:','./whatsappQueue.events','remove','update','emit','register'];(function(_0x14f281,_0x770716){var _0x386d74=function(_0x303e52){while(--_0x303e52){_0x14f281['push'](_0x14f281['shift']());}};_0x386d74(++_0x770716);}(_0xa843,0xc7));var _0x3a84=function(_0x157bfc,_0x3e2d2b){_0x157bfc=_0x157bfc-0x0;var _0x1a7689=_0xa843[_0x157bfc];return _0x1a7689;};'use strict';var WhatsappQueueEvents=require(_0x3a84('0x0'));var events=['save',_0x3a84('0x1'),_0x3a84('0x2')];function createListener(_0x1931e7,_0x2f9cf9){return function(_0x5f3819){_0x2f9cf9[_0x3a84('0x3')](_0x1931e7,_0x5f3819);};}function removeListener(_0x7e9673,_0x1b9349){return function(){WhatsappQueueEvents['removeListener'](_0x7e9673,_0x1b9349);};}exports[_0x3a84('0x4')]=function(_0x35e762){for(var _0x280dd5=0x0,_0x3d9fb1=events['length'];_0x280dd5<_0x3d9fb1;_0x280dd5++){var _0x3def26=events[_0x280dd5];var _0x1cbcec=createListener(_0x3a84('0x5')+_0x3def26,_0x35e762);WhatsappQueueEvents['on'](_0x3def26,_0x1cbcec);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 72f9b6d..c60ba9c 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 _0x50bf=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x3de67b,_0x31ce94){var _0xd6690d=function(_0x3d1af7){while(--_0x3d1af7){_0x3de67b['push'](_0x3de67b['shift']());}};_0xd6690d(++_0x31ce94);}(_0x50bf,0x18e));var _0xf50b=function(_0x1d1ddf,_0x27af9f){_0x1d1ddf=_0x1d1ddf-0x0;var _0x4b9a97=_0x50bf[_0x1d1ddf];return _0x4b9a97;};'use strict';var multer=require(_0xf50b('0x0'));var util=require(_0xf50b('0x1'));var path=require(_0xf50b('0x2'));var timeout=require(_0xf50b('0x3'));var express=require(_0xf50b('0x4'));var router=express['Router']();var fs_extra=require(_0xf50b('0x5'));var auth=require(_0xf50b('0x6'));var interaction=require(_0xf50b('0x7'));var config=require(_0xf50b('0x8'));var controller=require(_0xf50b('0x9'));router[_0xf50b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf50b('0xb')]);router[_0xf50b('0xa')](_0xf50b('0xc'),auth[_0xf50b('0xd')](),controller[_0xf50b('0xe')]);router[_0xf50b('0xa')](_0xf50b('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xf50b('0x10')]('/',auth['isAuthenticated'](),controller[_0xf50b('0x11')]);router[_0xf50b('0x12')](_0xf50b('0xf'),auth[_0xf50b('0xd')](),controller[_0xf50b('0x13')]);router[_0xf50b('0x14')](_0xf50b('0xf'),auth['isAuthenticated'](),controller[_0xf50b('0x15')]);module[_0xf50b('0x16')]=router; \ No newline at end of file +var _0xbe10=['get','isAuthenticated','index','/describe','describe','/:id','post','put','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xbe10,0x1d2));var _0x0be1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xbe10[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x0be1('0x0'));var util=require('util');var path=require(_0x0be1('0x1'));var timeout=require(_0x0be1('0x2'));var express=require(_0x0be1('0x3'));var router=express[_0x0be1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0be1('0x5'));var interaction=require(_0x0be1('0x6'));var config=require(_0x0be1('0x7'));var controller=require(_0x0be1('0x8'));router[_0x0be1('0x9')]('/',auth[_0x0be1('0xa')](),controller[_0x0be1('0xb')]);router['get'](_0x0be1('0xc'),auth[_0x0be1('0xa')](),controller[_0x0be1('0xd')]);router[_0x0be1('0x9')](_0x0be1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x0be1('0xf')]('/',auth[_0x0be1('0xa')](),controller['create']);router[_0x0be1('0x10')](_0x0be1('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0be1('0xe'),auth['isAuthenticated'](),controller[_0x0be1('0x11')]);module[_0x0be1('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 4aa43b3..0acc467 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x41a764,_0x420ee8){var _0x3ebd3a=function(_0x46d0c0){while(--_0x46d0c0){_0x41a764['push'](_0x41a764['shift']());}};_0x3ebd3a(++_0x420ee8);}(_0x7a54,0x106));var _0x47a5=function(_0x2d01da,_0x25fc69){_0x2d01da=_0x2d01da-0x0;var _0xd6050b=_0x7a54[_0x2d01da];return _0xd6050b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4921cd,_0x23f67a){var _0x5e553f=function(_0x11eb4e){while(--_0x11eb4e){_0x4921cd['push'](_0x4921cd['shift']());}};_0x5e553f(++_0x23f67a);}(_0x7a54,0x106));var _0x47a5=function(_0xa5512a,_0x118beb){_0xa5512a=_0xa5512a-0x0;var _0x4fb816=_0x7a54[_0xa5512a];return _0x4fb816;};'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 85f9ca2..affc026 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 _0x57f8=['filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x57f8,0x198));var _0x857f=function(_0x49adfe,_0x2fd329){_0x49adfe=_0x49adfe-0x0;var _0x1d53da=_0x57f8[_0x49adfe];return _0x1d53da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];function respondWithStatusCode(_0x533631,_0x2e1eda){_0x2e1eda=_0x2e1eda||0xcc;return function(_0x2d5e26){if(_0x2d5e26){return _0x533631[_0x857f('0x1b')](_0x2e1eda);}return _0x533631[_0x857f('0x1c')](_0x2e1eda)[_0x857f('0x1d')]();};}function respondWithResult(_0x4a25ec,_0x4bc590){_0x4bc590=_0x4bc590||0xc8;return function(_0x3b09d9){if(_0x3b09d9){return _0x4a25ec['status'](_0x4bc590)[_0x857f('0x1e')](_0x3b09d9);}};}function respondWithFilteredResult(_0x4ac81f,_0x1d47bf){return function(_0x134a4f){if(_0x134a4f){var _0x5c3a69=typeof _0x1d47bf[_0x857f('0x1f')]===_0x857f('0x20')&&typeof _0x1d47bf[_0x857f('0x21')]===_0x857f('0x20');var _0x279e74=_0x134a4f[_0x857f('0x22')];var _0x1a9ef8=_0x5c3a69?0x0:_0x1d47bf[_0x857f('0x1f')];var _0x1014ca=_0x5c3a69?_0x134a4f[_0x857f('0x22')]:_0x1d47bf[_0x857f('0x1f')]+_0x1d47bf['limit'];var _0x1729d8;if(_0x1014ca>=_0x279e74){_0x1014ca=_0x279e74;_0x1729d8=0xc8;}else{_0x1729d8=0xce;}_0x4ac81f[_0x857f('0x1c')](_0x1729d8);return _0x4ac81f['set'](_0x857f('0x23'),_0x1a9ef8+'-'+_0x1014ca+'/'+_0x279e74)[_0x857f('0x1e')](_0x134a4f);}return null;};}function patchUpdates(_0x377587){return function(_0x484035){try{jsonpatch['apply'](_0x484035,_0x377587,!![]);}catch(_0x12ee77){return BPromise[_0x857f('0x24')](_0x12ee77);}return _0x484035[_0x857f('0x25')]();};}function saveUpdates(_0x4fa031,_0x118237){return function(_0x17a98e){if(_0x17a98e){return _0x17a98e[_0x857f('0x26')](_0x4fa031)['then'](function(_0x1961ea){return _0x1961ea;});}return null;};}function removeEntity(_0x14a8ce,_0x50bfb7){return function(_0x3bc543){if(_0x3bc543){return _0x3bc543[_0x857f('0x27')]()[_0x857f('0x28')](function(){_0x14a8ce[_0x857f('0x1c')](0xcc)[_0x857f('0x1d')]();});}};}function handleEntityNotFound(_0x3b23a7,_0x233a68){return function(_0x2a89ba){if(!_0x2a89ba){_0x3b23a7[_0x857f('0x1b')](0x194);}return _0x2a89ba;};}function handleError(_0xcd1ee9,_0x72f0aa){_0x72f0aa=_0x72f0aa||0x1f4;return function(_0x4782ab){logger[_0x857f('0x29')](_0x4782ab[_0x857f('0x2a')]);if(_0x4782ab['name']){delete _0x4782ab[_0x857f('0x2b')];}_0xcd1ee9[_0x857f('0x1c')](_0x72f0aa)[_0x857f('0x2c')](_0x4782ab);};}exports[_0x857f('0x2d')]=function(_0x58c2de,_0x40c306){var _0x57ceaa={},_0x1b405a={},_0x234048={'count':0x0,'rows':[]};var _0x45a37f=_[_0x857f('0x2e')](db[_0x857f('0x2f')][_0x857f('0x30')],function(_0x1c4fff){return{'name':_0x1c4fff[_0x857f('0x31')],'type':_0x1c4fff[_0x857f('0x32')][_0x857f('0x33')]};});_0x1b405a[_0x857f('0x34')]=_[_0x857f('0x2e')](_0x45a37f,_0x857f('0x2b'));_0x1b405a['query']=_[_0x857f('0x35')](_0x58c2de[_0x857f('0x36')]);_0x1b405a['filters']=_[_0x857f('0x37')](_0x1b405a[_0x857f('0x34')],_0x1b405a['query']);_0x57ceaa[_0x857f('0x38')]=_[_0x857f('0x37')](_0x1b405a['model'],qs[_0x857f('0x39')](_0x58c2de[_0x857f('0x36')][_0x857f('0x39')]));_0x57ceaa[_0x857f('0x38')]=_0x57ceaa['attributes']['length']?_0x57ceaa[_0x857f('0x38')]:_0x1b405a[_0x857f('0x34')];if(!_0x58c2de['query'][_0x857f('0x3a')]('nolimit')){_0x57ceaa[_0x857f('0x21')]=qs[_0x857f('0x21')](_0x58c2de[_0x857f('0x36')][_0x857f('0x21')]);_0x57ceaa[_0x857f('0x1f')]=qs['offset'](_0x58c2de['query'][_0x857f('0x1f')]);}_0x57ceaa['order']=qs[_0x857f('0x3b')](_0x58c2de[_0x857f('0x36')][_0x857f('0x3b')]);_0x57ceaa['where']=qs[_0x857f('0x3c')](_[_0x857f('0x3d')](_0x58c2de[_0x857f('0x36')],_0x1b405a[_0x857f('0x3c')]),_0x45a37f);if(_0x58c2de[_0x857f('0x36')][_0x857f('0x3e')]){_0x57ceaa[_0x857f('0x3f')]=_['merge'](_0x57ceaa[_0x857f('0x3f')],{'$or':_[_0x857f('0x2e')](_0x45a37f,function(_0x1f285c){if(_0x1f285c[_0x857f('0x32')]!==_0x857f('0x40')){var _0x2356fb={};_0x2356fb[_0x1f285c[_0x857f('0x2b')]]={'$like':'%'+_0x58c2de['query'][_0x857f('0x3e')]+'%'};return _0x2356fb;}})});}_0x57ceaa=_[_0x857f('0x41')]({},_0x57ceaa,_0x58c2de[_0x857f('0x42')]);var _0xc2ac41={'where':_0x57ceaa[_0x857f('0x3f')]};return db[_0x857f('0x2f')]['count'](_0xc2ac41)[_0x857f('0x28')](function(_0x354678){_0x234048[_0x857f('0x22')]=_0x354678;if(_0x58c2de[_0x857f('0x36')][_0x857f('0x43')]){_0x57ceaa[_0x857f('0x44')]=[{'all':!![]}];}return db[_0x857f('0x2f')][_0x857f('0x45')](_0x57ceaa);})['then'](function(_0x40fb37){_0x234048[_0x857f('0x46')]=_0x40fb37;return _0x234048;})[_0x857f('0x28')](respondWithFilteredResult(_0x40c306,_0x57ceaa))[_0x857f('0x47')](handleError(_0x40c306,null));};exports[_0x857f('0x48')]=function(_0x1bbf9f,_0x374b9f){var _0x42d922={'raw':!![],'where':{'id':_0x1bbf9f[_0x857f('0x49')]['id']}},_0xb4d7c2={};_0xb4d7c2[_0x857f('0x34')]=_[_0x857f('0x35')](db[_0x857f('0x2f')][_0x857f('0x30')]);_0xb4d7c2['query']=_[_0x857f('0x35')](_0x1bbf9f['query']);_0xb4d7c2[_0x857f('0x3c')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],_0xb4d7c2[_0x857f('0x36')]);_0x42d922[_0x857f('0x38')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],qs[_0x857f('0x39')](_0x1bbf9f[_0x857f('0x36')][_0x857f('0x39')]));_0x42d922[_0x857f('0x38')]=_0x42d922['attributes']['length']?_0x42d922[_0x857f('0x38')]:_0xb4d7c2['model'];if(_0x1bbf9f[_0x857f('0x36')]['includeAll']){_0x42d922[_0x857f('0x44')]=[{'all':!![]}];}_0x42d922=_[_0x857f('0x41')]({},_0x42d922,_0x1bbf9f[_0x857f('0x42')]);return db[_0x857f('0x2f')][_0x857f('0x4a')](_0x42d922)[_0x857f('0x28')](handleEntityNotFound(_0x374b9f,null))[_0x857f('0x28')](respondWithResult(_0x374b9f,null))[_0x857f('0x47')](handleError(_0x374b9f,null));};exports['create']=function(_0x42cf05,_0x3b431d){return db[_0x857f('0x2f')][_0x857f('0x4b')](_0x42cf05['body'],{})[_0x857f('0x28')](respondWithResult(_0x3b431d,0xc9))[_0x857f('0x47')](handleError(_0x3b431d,null));};exports[_0x857f('0x26')]=function(_0x736ef6,_0x67563){if(_0x736ef6['body']['id']){delete _0x736ef6[_0x857f('0x4c')]['id'];}return db[_0x857f('0x2f')]['find']({'where':{'id':_0x736ef6[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x67563,null))['then'](saveUpdates(_0x736ef6[_0x857f('0x4c')],null))['then'](respondWithResult(_0x67563,null))[_0x857f('0x47')](handleError(_0x67563,null));};exports[_0x857f('0x27')]=function(_0x446fe9,_0x2008d5){return db[_0x857f('0x2f')][_0x857f('0x4a')]({'where':{'id':_0x446fe9[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x2008d5,null))[_0x857f('0x28')](removeEntity(_0x2008d5,null))[_0x857f('0x47')](handleError(_0x2008d5,null));};exports['describe']=function(_0x5464f4,_0x13ef75){return db[_0x857f('0x2f')][_0x857f('0x4d')]()[_0x857f('0x28')](respondWithResult(_0x13ef75,null))[_0x857f('0x47')](handleError(_0x13ef75,null));}; \ No newline at end of file +var _0xae60=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x7d8a87,_0x2af37c){var _0x302742=function(_0x516b26){while(--_0x516b26){_0x7d8a87['push'](_0x7d8a87['shift']());}};_0x302742(++_0x2af37c);}(_0xae60,0x1c7));var _0x0ae6=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xae60[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x5b86fe,_0x3630e6){return function(_0x2dcdb7){if(!_0x2dcdb7){_0x5b86fe['sendStatus'](0x194);}return _0x2dcdb7;};}function handleError(_0x55dbe1,_0x44eb95){_0x44eb95=_0x44eb95||0x1f4;return function(_0x3255a7){logger[_0x0ae6('0x2b')](_0x3255a7['stack']);if(_0x3255a7[_0x0ae6('0x2c')]){delete _0x3255a7[_0x0ae6('0x2c')];}_0x55dbe1[_0x0ae6('0x1d')](_0x44eb95)['send'](_0x3255a7);};}exports[_0x0ae6('0x2d')]=function(_0x29fef3,_0x449c33){var _0x232fbd={},_0x14eed5={},_0x257af5={'count':0x0,'rows':[]};var _0x4fc7bd=_['map'](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')],function(_0x4e6df8){return{'name':_0x4e6df8['fieldName'],'type':_0x4e6df8[_0x0ae6('0x30')][_0x0ae6('0x31')]};});_0x14eed5[_0x0ae6('0x32')]=_[_0x0ae6('0x33')](_0x4fc7bd,'name');_0x14eed5[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x29fef3[_0x0ae6('0x34')]);_0x14eed5['filters']=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],_0x14eed5[_0x0ae6('0x34')]);_0x232fbd[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0x14eed5[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x38')]));_0x232fbd[_0x0ae6('0x37')]=_0x232fbd['attributes'][_0x0ae6('0x39')]?_0x232fbd[_0x0ae6('0x37')]:_0x14eed5['model'];if(!_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3a')](_0x0ae6('0x3b'))){_0x232fbd['limit']=qs[_0x0ae6('0x22')](_0x29fef3['query']['limit']);_0x232fbd[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x20')]);}_0x232fbd[_0x0ae6('0x3c')]=qs['sort'](_0x29fef3['query'][_0x0ae6('0x3d')]);_0x232fbd['where']=qs[_0x0ae6('0x3e')](_['pick'](_0x29fef3[_0x0ae6('0x34')],_0x14eed5['filters']),_0x4fc7bd);if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x3f')]){_0x232fbd[_0x0ae6('0x40')]=_[_0x0ae6('0x41')](_0x232fbd['where'],{'$or':_['map'](_0x4fc7bd,function(_0x43414c){if(_0x43414c[_0x0ae6('0x30')]!==_0x0ae6('0x42')){var _0x59480a={};_0x59480a[_0x43414c[_0x0ae6('0x2c')]]={'$like':'%'+_0x29fef3['query'][_0x0ae6('0x3f')]+'%'};return _0x59480a;}})});}_0x232fbd=_[_0x0ae6('0x41')]({},_0x232fbd,_0x29fef3[_0x0ae6('0x43')]);var _0x19403c={'where':_0x232fbd[_0x0ae6('0x40')]};return db[_0x0ae6('0x2e')]['count'](_0x19403c)[_0x0ae6('0x29')](function(_0x601ef9){_0x257af5[_0x0ae6('0x23')]=_0x601ef9;if(_0x29fef3[_0x0ae6('0x34')][_0x0ae6('0x44')]){_0x232fbd[_0x0ae6('0x45')]=[{'all':!![]}];}return db[_0x0ae6('0x2e')][_0x0ae6('0x46')](_0x232fbd);})['then'](function(_0x38faeb){_0x257af5[_0x0ae6('0x47')]=_0x38faeb;return _0x257af5;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x449c33,_0x232fbd))[_0x0ae6('0x48')](handleError(_0x449c33,null));};exports[_0x0ae6('0x49')]=function(_0x167ed1,_0x24c021){var _0x21431e={'raw':!![],'where':{'id':_0x167ed1[_0x0ae6('0x4a')]['id']}},_0xb38cbb={};_0xb38cbb[_0x0ae6('0x32')]=_[_0x0ae6('0x35')](db[_0x0ae6('0x2e')][_0x0ae6('0x2f')]);_0xb38cbb[_0x0ae6('0x34')]=_[_0x0ae6('0x35')](_0x167ed1[_0x0ae6('0x34')]);_0xb38cbb[_0x0ae6('0x3e')]=_['intersection'](_0xb38cbb[_0x0ae6('0x32')],_0xb38cbb[_0x0ae6('0x34')]);_0x21431e[_0x0ae6('0x37')]=_[_0x0ae6('0x36')](_0xb38cbb[_0x0ae6('0x32')],qs[_0x0ae6('0x38')](_0x167ed1['query'][_0x0ae6('0x38')]));_0x21431e[_0x0ae6('0x37')]=_0x21431e[_0x0ae6('0x37')][_0x0ae6('0x39')]?_0x21431e['attributes']:_0xb38cbb['model'];if(_0x167ed1['query'][_0x0ae6('0x44')]){_0x21431e[_0x0ae6('0x45')]=[{'all':!![]}];}_0x21431e=_[_0x0ae6('0x41')]({},_0x21431e,_0x167ed1['options']);return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')](_0x21431e)['then'](handleEntityNotFound(_0x24c021,null))[_0x0ae6('0x29')](respondWithResult(_0x24c021,null))[_0x0ae6('0x48')](handleError(_0x24c021,null));};exports['create']=function(_0x354efd,_0x3d1e75){return db['WhatsappQueueReport'][_0x0ae6('0x4c')](_0x354efd[_0x0ae6('0x4d')],{})[_0x0ae6('0x29')](respondWithResult(_0x3d1e75,0xc9))['catch'](handleError(_0x3d1e75,null));};exports[_0x0ae6('0x28')]=function(_0x21de54,_0x46075a){if(_0x21de54[_0x0ae6('0x4d')]['id']){delete _0x21de54[_0x0ae6('0x4d')]['id'];}return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x21de54['params']['id']}})['then'](handleEntityNotFound(_0x46075a,null))[_0x0ae6('0x29')](saveUpdates(_0x21de54[_0x0ae6('0x4d')],null))[_0x0ae6('0x29')](respondWithResult(_0x46075a,null))['catch'](handleError(_0x46075a,null));};exports[_0x0ae6('0x2a')]=function(_0x51df5c,_0x582a5e){return db[_0x0ae6('0x2e')][_0x0ae6('0x4b')]({'where':{'id':_0x51df5c[_0x0ae6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582a5e,null))[_0x0ae6('0x29')](removeEntity(_0x582a5e,null))[_0x0ae6('0x48')](handleError(_0x582a5e,null));};exports[_0x0ae6('0x4e')]=function(_0x327b55,_0x173acd){return db[_0x0ae6('0x2e')][_0x0ae6('0x4e')]()[_0x0ae6('0x29')](respondWithResult(_0x173acd,null))[_0x0ae6('0x48')](handleError(_0x173acd,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 13b6e02..698c2ea 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 _0x9685=['api','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','uniqueid','lodash','../../config/logger'];(function(_0x349e67,_0x267993){var _0x1b4949=function(_0x27993a){while(--_0x27993a){_0x349e67['push'](_0x349e67['shift']());}};_0x1b4949(++_0x267993);}(_0x9685,0x152));var _0x5968=function(_0x175c4a,_0x28649e){_0x175c4a=_0x175c4a-0x0;var _0xa947d3=_0x9685[_0x175c4a];return _0xa947d3;};'use strict';var _=require(_0x5968('0x0'));var util=require('util');var logger=require(_0x5968('0x1'))(_0x5968('0x2'));var moment=require('moment');var BPromise=require(_0x5968('0x3'));var rp=require(_0x5968('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5968('0x5'));var attributes=require(_0x5968('0x6'));module[_0x5968('0x7')]=function(_0x1b7647,_0x2ea8ea){return _0x1b7647['define']('WhatsappQueueReport',attributes,{'tableName':_0x5968('0x8'),'paranoid':![],'indexes':[{'name':_0x5968('0x9'),'fields':[_0x5968('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9de1=['../../config/environment','./whatsappQueueReport.attributes','uniqueid','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0x9de1,0xae));var _0x19de=function(_0x4d74e5,_0x48b33c){_0x4d74e5=_0x4d74e5-0x0;var _0x42ffe5=_0x9de1[_0x4d74e5];return _0x42ffe5;};'use strict';var _=require('lodash');var util=require(_0x19de('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x19de('0x1'));var BPromise=require(_0x19de('0x2'));var rp=require(_0x19de('0x3'));var fs=require('fs');var path=require(_0x19de('0x4'));var rimraf=require(_0x19de('0x5'));var config=require(_0x19de('0x6'));var attributes=require(_0x19de('0x7'));module['exports']=function(_0xcbf725,_0x5cfab6){return _0xcbf725['define']('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x19de('0x8'),'fields':[_0x19de('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index b65aa69..fec012b 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 _0x0fd8=['http','request','info','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','create','raw','then','UpdateWhatsappQueueReport','WhatsappQueueReport','update','options','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5f5159,_0x7311ad){var _0x214e93=function(_0x560ee6){while(--_0x560ee6){_0x5f5159['push'](_0x5f5159['shift']());}};_0x214e93(++_0x7311ad);}(_0x0fd8,0x127));var _0x80fd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0fd8[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x80fd('0x0'));var util=require(_0x80fd('0x1'));var moment=require(_0x80fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x80fd('0x3'));var fs=require('fs');var Redis=require(_0x80fd('0x4'));var db=require(_0x80fd('0x5'))['db'];var utils=require(_0x80fd('0x6'));var logger=require(_0x80fd('0x7'))(_0x80fd('0x8'));var config=require(_0x80fd('0x9'));var jayson=require(_0x80fd('0xa'));var client=jayson['client'][_0x80fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50536b,_0x296dbd,_0x24b983){return new BPromise(function(_0x465c30,_0x4c7710){return client[_0x80fd('0xc')](_0x50536b,_0x24b983)['then'](function(_0x4ceca6){logger[_0x80fd('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x296dbd,'request\x20sent');logger[_0x80fd('0xe')](_0x80fd('0xf'),_0x296dbd,_0x80fd('0x10'),JSON[_0x80fd('0x11')](_0x4ceca6));if(_0x4ceca6[_0x80fd('0x12')]){if(_0x4ceca6[_0x80fd('0x12')][_0x80fd('0x13')]===0x1f4){logger[_0x80fd('0x12')](_0x80fd('0x14'),_0x296dbd,_0x4ceca6[_0x80fd('0x12')]['message']);return _0x4c7710(_0x4ceca6[_0x80fd('0x12')]['message']);}logger[_0x80fd('0x12')](_0x80fd('0x14'),_0x296dbd,_0x4ceca6[_0x80fd('0x12')][_0x80fd('0x15')]);return _0x465c30(_0x4ceca6[_0x80fd('0x12')]['message']);}else{logger[_0x80fd('0xd')](_0x80fd('0x14'),_0x296dbd,_0x80fd('0x10'));_0x465c30(_0x4ceca6[_0x80fd('0x16')][_0x80fd('0x15')]);}})[_0x80fd('0x17')](function(_0x40dd93){logger[_0x80fd('0x12')](_0x80fd('0x14'),_0x296dbd,_0x40dd93);_0x4c7710(_0x40dd93);});});}exports[_0x80fd('0x18')]=function(_0x110dc4){var _0x4cc263=this;return new Promise(function(_0x14b304,_0x5e50c8){return db['WhatsappQueueReport'][_0x80fd('0x19')](_0x110dc4['body'],{'raw':_0x110dc4['options']?_0x110dc4['options'][_0x80fd('0x1a')]===undefined?!![]:![]:!![]})[_0x80fd('0x1b')](function(_0x5a2d65){logger['info']('CreateWhatsappQueueReport',_0x110dc4);logger[_0x80fd('0xe')]('CreateWhatsappQueueReport',_0x110dc4,JSON[_0x80fd('0x11')](_0x5a2d65));_0x14b304(_0x5a2d65);})[_0x80fd('0x17')](function(_0x5308ed){logger[_0x80fd('0x12')](_0x80fd('0x18'),_0x5308ed[_0x80fd('0x15')],_0x110dc4);_0x5e50c8(_0x4cc263[_0x80fd('0x12')](0x1f4,_0x5308ed[_0x80fd('0x15')]));});});};exports[_0x80fd('0x1c')]=function(_0x4e808b){var _0x581c57=this;return new Promise(function(_0x1f9a27,_0x294635){return db[_0x80fd('0x1d')][_0x80fd('0x1e')](_0x4e808b['body'],{'raw':_0x4e808b['options']?_0x4e808b[_0x80fd('0x1f')][_0x80fd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e808b[_0x80fd('0x1f')]?_0x4e808b[_0x80fd('0x1f')]['where']||null:null,'attributes':_0x4e808b[_0x80fd('0x1f')]?_0x4e808b[_0x80fd('0x1f')][_0x80fd('0x20')]||null:null,'limit':_0x4e808b['options']?_0x4e808b[_0x80fd('0x1f')][_0x80fd('0x21')]||null:null})[_0x80fd('0x1b')](function(_0x53411d){logger[_0x80fd('0xd')]('UpdateWhatsappQueueReport',_0x4e808b);logger['debug'](_0x80fd('0x1c'),_0x4e808b,JSON['stringify'](_0x53411d));_0x1f9a27(_0x53411d);})[_0x80fd('0x17')](function(_0x2b0147){logger['error'](_0x80fd('0x1c'),_0x2b0147[_0x80fd('0x15')],_0x4e808b);_0x294635(_0x581c57[_0x80fd('0x12')](0x1f4,_0x2b0147[_0x80fd('0x15')]));});});}; \ No newline at end of file +var _0x7259=['util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','CreateWhatsappQueueReport','create','body','options','raw','catch','WhatsappQueueReport','where','attributes','limit','UpdateWhatsappQueueReport','lodash'];(function(_0x24c103,_0x51ab17){var _0x3b4e51=function(_0x3e3160){while(--_0x3e3160){_0x24c103['push'](_0x24c103['shift']());}};_0x3b4e51(++_0x51ab17);}(_0x7259,0xd8));var _0x9725=function(_0x20135a,_0x1deb02){_0x20135a=_0x20135a-0x0;var _0x48e5c2=_0x7259[_0x20135a];return _0x48e5c2;};'use strict';var _=require(_0x9725('0x0'));var util=require(_0x9725('0x1'));var moment=require('moment');var BPromise=require(_0x9725('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9725('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9725('0x4'))(_0x9725('0x5'));var config=require(_0x9725('0x6'));var jayson=require(_0x9725('0x7'));var client=jayson[_0x9725('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x529720,_0x162a40,_0xf7fd58){return new BPromise(function(_0x53f492,_0x785366){return client['request'](_0x529720,_0xf7fd58)[_0x9725('0x9')](function(_0x3ae174){logger[_0x9725('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x162a40,_0x9725('0xb'));logger[_0x9725('0xc')](_0x9725('0xd'),_0x162a40,'request\x20sent',JSON[_0x9725('0xe')](_0x3ae174));if(_0x3ae174[_0x9725('0xf')]){if(_0x3ae174[_0x9725('0xf')][_0x9725('0x10')]===0x1f4){logger[_0x9725('0xf')](_0x9725('0x11'),_0x162a40,_0x3ae174[_0x9725('0xf')]['message']);return _0x785366(_0x3ae174[_0x9725('0xf')][_0x9725('0x12')]);}logger[_0x9725('0xf')](_0x9725('0x11'),_0x162a40,_0x3ae174[_0x9725('0xf')][_0x9725('0x12')]);return _0x53f492(_0x3ae174[_0x9725('0xf')][_0x9725('0x12')]);}else{logger[_0x9725('0xa')](_0x9725('0x11'),_0x162a40,_0x9725('0xb'));_0x53f492(_0x3ae174[_0x9725('0x13')][_0x9725('0x12')]);}})['catch'](function(_0x249b4a){logger[_0x9725('0xf')](_0x9725('0x11'),_0x162a40,_0x249b4a);_0x785366(_0x249b4a);});});}exports[_0x9725('0x14')]=function(_0x4865cd){var _0x4af909=this;return new Promise(function(_0x134ba2,_0x5574c3){return db['WhatsappQueueReport'][_0x9725('0x15')](_0x4865cd[_0x9725('0x16')],{'raw':_0x4865cd[_0x9725('0x17')]?_0x4865cd['options'][_0x9725('0x18')]===undefined?!![]:![]:!![]})[_0x9725('0x9')](function(_0x20132c){logger[_0x9725('0xa')](_0x9725('0x14'),_0x4865cd);logger[_0x9725('0xc')](_0x9725('0x14'),_0x4865cd,JSON[_0x9725('0xe')](_0x20132c));_0x134ba2(_0x20132c);})[_0x9725('0x19')](function(_0x56417b){logger[_0x9725('0xf')](_0x9725('0x14'),_0x56417b[_0x9725('0x12')],_0x4865cd);_0x5574c3(_0x4af909[_0x9725('0xf')](0x1f4,_0x56417b['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x53f678){var _0x2ad7c1=this;return new Promise(function(_0x3aff6f,_0x6ea5fe){return db[_0x9725('0x1a')]['update'](_0x53f678[_0x9725('0x16')],{'raw':_0x53f678[_0x9725('0x17')]?_0x53f678[_0x9725('0x17')][_0x9725('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53f678['options']?_0x53f678['options'][_0x9725('0x1b')]||null:null,'attributes':_0x53f678[_0x9725('0x17')]?_0x53f678[_0x9725('0x17')][_0x9725('0x1c')]||null:null,'limit':_0x53f678['options']?_0x53f678[_0x9725('0x17')][_0x9725('0x1d')]||null:null})[_0x9725('0x9')](function(_0x4827ce){logger['info'](_0x9725('0x1e'),_0x53f678);logger[_0x9725('0xc')]('UpdateWhatsappQueueReport',_0x53f678,JSON[_0x9725('0xe')](_0x4827ce));_0x3aff6f(_0x4827ce);})[_0x9725('0x19')](function(_0x126d8f){logger[_0x9725('0xf')](_0x9725('0x1e'),_0x126d8f[_0x9725('0x12')],_0x53f678);_0x6ea5fe(_0x2ad7c1[_0x9725('0xf')](0x1f4,_0x126d8f[_0x9725('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index deda0ee..2826a8d 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 _0xa343=['isAuthenticated','index','/describe','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x4bdbad,_0x2e741e){var _0x2642cf=function(_0x1fc7a1){while(--_0x1fc7a1){_0x4bdbad['push'](_0x4bdbad['shift']());}};_0x2642cf(++_0x2e741e);}(_0xa343,0x171));var _0x3a34=function(_0x223980,_0x2b5111){_0x223980=_0x223980-0x0;var _0x2b59ac=_0xa343[_0x223980];return _0x2b59ac;};'use strict';var multer=require(_0x3a34('0x0'));var util=require(_0x3a34('0x1'));var path=require(_0x3a34('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a34('0x3'));var router=express[_0x3a34('0x4')]();var fs_extra=require(_0x3a34('0x5'));var auth=require(_0x3a34('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3a34('0x7'));var controller=require(_0x3a34('0x8'));router['get']('/',auth[_0x3a34('0x9')](),controller[_0x3a34('0xa')]);router['get'](_0x3a34('0xb'),auth[_0x3a34('0x9')](),controller['describe']);router[_0x3a34('0xc')](_0x3a34('0xd'),auth[_0x3a34('0x9')](),controller[_0x3a34('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3a34('0xf')]);router[_0x3a34('0x10')](_0x3a34('0xd'),auth['isAuthenticated'](),controller[_0x3a34('0x11')]);router[_0x3a34('0x12')](_0x3a34('0xd'),auth[_0x3a34('0x9')](),controller[_0x3a34('0x13')]);module[_0x3a34('0x14')]=router; \ No newline at end of file +var _0x0c34=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','create','put','update','delete','destroy'];(function(_0x58231e,_0x520177){var _0x4d55e4=function(_0x46b949){while(--_0x46b949){_0x58231e['push'](_0x58231e['shift']());}};_0x4d55e4(++_0x520177);}(_0x0c34,0x1a9));var _0x40c3=function(_0x4eb6b4,_0x498603){_0x4eb6b4=_0x4eb6b4-0x0;var _0xe2ba66=_0x0c34[_0x4eb6b4];return _0xe2ba66;};'use strict';var multer=require(_0x40c3('0x0'));var util=require(_0x40c3('0x1'));var path=require('path');var timeout=require(_0x40c3('0x2'));var express=require(_0x40c3('0x3'));var router=express[_0x40c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x40c3('0x5'));var interaction=require(_0x40c3('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x40c3('0x7')]('/',auth[_0x40c3('0x8')](),controller['index']);router[_0x40c3('0x7')](_0x40c3('0x9'),auth['isAuthenticated'](),controller[_0x40c3('0xa')]);router[_0x40c3('0x7')](_0x40c3('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x40c3('0xc')]);router[_0x40c3('0xd')](_0x40c3('0xb'),auth[_0x40c3('0x8')](),controller[_0x40c3('0xe')]);router[_0x40c3('0xf')](_0x40c3('0xb'),auth['isAuthenticated'](),controller[_0x40c3('0x10')]);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 baa6024..18939f3 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 _0xbb59=['queue','DATE','sequelize','exports','STRING','agent'];(function(_0x2b10b5,_0x5c1f2e){var _0x545669=function(_0x4208be){while(--_0x4208be){_0x2b10b5['push'](_0x2b10b5['shift']());}};_0x545669(++_0x5c1f2e);}(_0xbb59,0xec));var _0x9bb5=function(_0x5c2d0b,_0x1549e1){_0x5c2d0b=_0x5c2d0b-0x0;var _0xe62aec=_0xbb59[_0x5c2d0b];return _0xe62aec;};'use strict';var Sequelize=require(_0x9bb5('0x0'));module[_0x9bb5('0x1')]={'uniqueid':{'type':Sequelize[_0x9bb5('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x9bb5('0x3'),_0x9bb5('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x9bb5('0x5')]}}; \ No newline at end of file +var _0x3670=['exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3670,0x16c));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0367('0x0')]={'uniqueid':{'type':Sequelize[_0x0367('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0367('0x2')](_0x0367('0x3'),_0x0367('0x4'),_0x0367('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0367('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index dedf148..f110f25 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 _0x133d=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','WhatsappTransferReport','count','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','Content-Range','reject','save','update','then','destroy','end','error','stack','send','index','map','fieldName','type','key','model','query','keys'];(function(_0x100704,_0x4b2b70){var _0x3e44ec=function(_0x5bdec6){while(--_0x5bdec6){_0x100704['push'](_0x100704['shift']());}};_0x3e44ec(++_0x4b2b70);}(_0x133d,0x193));var _0xd133=function(_0x4b3300,_0x1137f1){_0x4b3300=_0x4b3300-0x0;var _0x2d26d3=_0x133d[_0x4b3300];return _0x2d26d3;};'use strict';var emlformat=require(_0xd133('0x0'));var rimraf=require(_0xd133('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd133('0x2'));var rp=require(_0xd133('0x3'));var moment=require('moment');var BPromise=require(_0xd133('0x4'));var Mustache=require('mustache');var util=require(_0xd133('0x5'));var path=require(_0xd133('0x6'));var sox=require(_0xd133('0x7'));var csv=require(_0xd133('0x8'));var ejs=require(_0xd133('0x9'));var fs=require('fs');var fs_extra=require(_0xd133('0xa'));var _=require(_0xd133('0xb'));var squel=require(_0xd133('0xc'));var crypto=require(_0xd133('0xd'));var jsforce=require(_0xd133('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd133('0x8'));var querystring=require('querystring');var Papa=require(_0xd133('0xf'));var Redis=require('ioredis');var authService=require(_0xd133('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd133('0x11'));var hardwareService=require(_0xd133('0x12'));var logger=require(_0xd133('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd133('0x14'));var licenseUtil=require(_0xd133('0x15'));var db=require(_0xd133('0x16'))['db'];function respondWithStatusCode(_0x45a5a2,_0x52934a){_0x52934a=_0x52934a||0xcc;return function(_0x410f9b){if(_0x410f9b){return _0x45a5a2[_0xd133('0x17')](_0x52934a);}return _0x45a5a2[_0xd133('0x18')](_0x52934a)['end']();};}function respondWithResult(_0x55247c,_0x5117bf){_0x5117bf=_0x5117bf||0xc8;return function(_0x48e023){if(_0x48e023){return _0x55247c[_0xd133('0x18')](_0x5117bf)[_0xd133('0x19')](_0x48e023);}};}function respondWithFilteredResult(_0x2346f7,_0x3ca32f){return function(_0x589df6){if(_0x589df6){var _0x2d7673=typeof _0x3ca32f['offset']===_0xd133('0x1a')&&typeof _0x3ca32f[_0xd133('0x1b')]===_0xd133('0x1a');var _0x380605=_0x589df6['count'];var _0x5f4006=_0x2d7673?0x0:_0x3ca32f[_0xd133('0x1c')];var _0x4b796e=_0x2d7673?_0x589df6['count']:_0x3ca32f['offset']+_0x3ca32f[_0xd133('0x1b')];var _0x2d663a;if(_0x4b796e>=_0x380605){_0x4b796e=_0x380605;_0x2d663a=0xc8;}else{_0x2d663a=0xce;}_0x2346f7['status'](_0x2d663a);return _0x2346f7['set'](_0xd133('0x1d'),_0x5f4006+'-'+_0x4b796e+'/'+_0x380605)[_0xd133('0x19')](_0x589df6);}return null;};}function patchUpdates(_0x499c8c){return function(_0x3e8615){try{jsonpatch['apply'](_0x3e8615,_0x499c8c,!![]);}catch(_0x2dc3f0){return BPromise[_0xd133('0x1e')](_0x2dc3f0);}return _0x3e8615[_0xd133('0x1f')]();};}function saveUpdates(_0x18facd,_0x2ce4c5){return function(_0x5a07af){if(_0x5a07af){return _0x5a07af[_0xd133('0x20')](_0x18facd)[_0xd133('0x21')](function(_0x247026){return _0x247026;});}return null;};}function removeEntity(_0x195676,_0x5ac1c5){return function(_0x43eed0){if(_0x43eed0){return _0x43eed0[_0xd133('0x22')]()['then'](function(){_0x195676['status'](0xcc)[_0xd133('0x23')]();});}};}function handleEntityNotFound(_0x54f682,_0x34b61a){return function(_0x22d05c){if(!_0x22d05c){_0x54f682[_0xd133('0x17')](0x194);}return _0x22d05c;};}function handleError(_0x6128c3,_0x53ea05){_0x53ea05=_0x53ea05||0x1f4;return function(_0x26922b){logger[_0xd133('0x24')](_0x26922b[_0xd133('0x25')]);if(_0x26922b['name']){delete _0x26922b['name'];}_0x6128c3[_0xd133('0x18')](_0x53ea05)[_0xd133('0x26')](_0x26922b);};}exports[_0xd133('0x27')]=function(_0x2b6cd2,_0x59eb43){var _0x48b6e1={},_0x39be64={},_0x2e3598={'count':0x0,'rows':[]};var _0x2b6e36=_[_0xd133('0x28')](db['WhatsappTransferReport']['rawAttributes'],function(_0x5cb717){return{'name':_0x5cb717[_0xd133('0x29')],'type':_0x5cb717[_0xd133('0x2a')][_0xd133('0x2b')]};});_0x39be64[_0xd133('0x2c')]=_[_0xd133('0x28')](_0x2b6e36,'name');_0x39be64[_0xd133('0x2d')]=_[_0xd133('0x2e')](_0x2b6cd2['query']);_0x39be64[_0xd133('0x2f')]=_[_0xd133('0x30')](_0x39be64[_0xd133('0x2c')],_0x39be64['query']);_0x48b6e1[_0xd133('0x31')]=_[_0xd133('0x30')](_0x39be64[_0xd133('0x2c')],qs[_0xd133('0x32')](_0x2b6cd2[_0xd133('0x2d')][_0xd133('0x32')]));_0x48b6e1[_0xd133('0x31')]=_0x48b6e1[_0xd133('0x31')][_0xd133('0x33')]?_0x48b6e1[_0xd133('0x31')]:_0x39be64[_0xd133('0x2c')];if(!_0x2b6cd2[_0xd133('0x2d')][_0xd133('0x34')](_0xd133('0x35'))){_0x48b6e1['limit']=qs['limit'](_0x2b6cd2['query'][_0xd133('0x1b')]);_0x48b6e1[_0xd133('0x1c')]=qs['offset'](_0x2b6cd2[_0xd133('0x2d')][_0xd133('0x1c')]);}_0x48b6e1[_0xd133('0x36')]=qs['sort'](_0x2b6cd2[_0xd133('0x2d')][_0xd133('0x37')]);_0x48b6e1[_0xd133('0x38')]=qs['filters'](_[_0xd133('0x39')](_0x2b6cd2[_0xd133('0x2d')],_0x39be64[_0xd133('0x2f')]),_0x2b6e36);if(_0x2b6cd2[_0xd133('0x2d')][_0xd133('0x3a')]){_0x48b6e1[_0xd133('0x38')]=_['merge'](_0x48b6e1[_0xd133('0x38')],{'$or':_[_0xd133('0x28')](_0x2b6e36,function(_0x28ce90){if(_0x28ce90['type']!==_0xd133('0x3b')){var _0x420f37={};_0x420f37[_0x28ce90['name']]={'$like':'%'+_0x2b6cd2['query'][_0xd133('0x3a')]+'%'};return _0x420f37;}})});}_0x48b6e1=_[_0xd133('0x3c')]({},_0x48b6e1,_0x2b6cd2[_0xd133('0x3d')]);var _0x2414aa={'where':_0x48b6e1[_0xd133('0x38')]};return db[_0xd133('0x3e')][_0xd133('0x3f')](_0x2414aa)[_0xd133('0x21')](function(_0x5bd4a2){_0x2e3598[_0xd133('0x3f')]=_0x5bd4a2;if(_0x2b6cd2[_0xd133('0x2d')]['includeAll']){_0x48b6e1[_0xd133('0x40')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xd133('0x41')](_0x48b6e1);})[_0xd133('0x21')](function(_0x45bb0d){_0x2e3598[_0xd133('0x42')]=_0x45bb0d;return _0x2e3598;})[_0xd133('0x21')](respondWithFilteredResult(_0x59eb43,_0x48b6e1))[_0xd133('0x43')](handleError(_0x59eb43,null));};exports['show']=function(_0x1c5e5c,_0x3f2387){var _0x1220a3={'raw':!![],'where':{'id':_0x1c5e5c[_0xd133('0x44')]['id']}},_0x393484={};_0x393484[_0xd133('0x2c')]=_[_0xd133('0x2e')](db[_0xd133('0x3e')][_0xd133('0x45')]);_0x393484['query']=_['keys'](_0x1c5e5c['query']);_0x393484[_0xd133('0x2f')]=_[_0xd133('0x30')](_0x393484[_0xd133('0x2c')],_0x393484[_0xd133('0x2d')]);_0x1220a3['attributes']=_[_0xd133('0x30')](_0x393484['model'],qs[_0xd133('0x32')](_0x1c5e5c[_0xd133('0x2d')][_0xd133('0x32')]));_0x1220a3[_0xd133('0x31')]=_0x1220a3[_0xd133('0x31')][_0xd133('0x33')]?_0x1220a3['attributes']:_0x393484[_0xd133('0x2c')];if(_0x1c5e5c['query'][_0xd133('0x46')]){_0x1220a3['include']=[{'all':!![]}];}_0x1220a3=_[_0xd133('0x3c')]({},_0x1220a3,_0x1c5e5c[_0xd133('0x3d')]);return db[_0xd133('0x3e')][_0xd133('0x47')](_0x1220a3)[_0xd133('0x21')](handleEntityNotFound(_0x3f2387,null))[_0xd133('0x21')](respondWithResult(_0x3f2387,null))[_0xd133('0x43')](handleError(_0x3f2387,null));};exports['create']=function(_0x5c2f33,_0xff878){return db[_0xd133('0x3e')][_0xd133('0x48')](_0x5c2f33[_0xd133('0x49')],{})['then'](respondWithResult(_0xff878,0xc9))[_0xd133('0x43')](handleError(_0xff878,null));};exports['update']=function(_0x3caa01,_0x31084c){if(_0x3caa01[_0xd133('0x49')]['id']){delete _0x3caa01[_0xd133('0x49')]['id'];}return db[_0xd133('0x3e')][_0xd133('0x47')]({'where':{'id':_0x3caa01[_0xd133('0x44')]['id']}})[_0xd133('0x21')](handleEntityNotFound(_0x31084c,null))[_0xd133('0x21')](saveUpdates(_0x3caa01['body'],null))[_0xd133('0x21')](respondWithResult(_0x31084c,null))[_0xd133('0x43')](handleError(_0x31084c,null));};exports['destroy']=function(_0x5e9fe1,_0x485de6){return db[_0xd133('0x3e')]['find']({'where':{'id':_0x5e9fe1[_0xd133('0x44')]['id']}})[_0xd133('0x21')](handleEntityNotFound(_0x485de6,null))[_0xd133('0x21')](removeEntity(_0x485de6,null))['catch'](handleError(_0x485de6,null));};exports[_0xd133('0x4a')]=function(_0x493953,_0x17a67c){return db[_0xd133('0x3e')][_0xd133('0x4a')]()[_0xd133('0x21')](respondWithResult(_0x17a67c,null))['catch'](handleError(_0x17a67c,null));}; \ No newline at end of file +var _0x02d5=['include','findAll','rows','catch','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','merge','where','VIRTUAL','options','WhatsappTransferReport'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0x02d5,0x17d));var _0x502d=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x02d5[_0x36ed3c];return _0x52a2e0;};'use strict';var emlformat=require(_0x502d('0x0'));var rimraf=require(_0x502d('0x1'));var zipdir=require(_0x502d('0x2'));var jsonpatch=require(_0x502d('0x3'));var rp=require(_0x502d('0x4'));var moment=require('moment');var BPromise=require(_0x502d('0x5'));var Mustache=require(_0x502d('0x6'));var util=require('util');var path=require(_0x502d('0x7'));var sox=require(_0x502d('0x8'));var csv=require(_0x502d('0x9'));var ejs=require(_0x502d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x502d('0xb'));var squel=require(_0x502d('0xc'));var crypto=require(_0x502d('0xd'));var jsforce=require(_0x502d('0xe'));var deskjs=require(_0x502d('0xf'));var toCsv=require(_0x502d('0x9'));var querystring=require('querystring');var Papa=require(_0x502d('0x10'));var Redis=require(_0x502d('0x11'));var authService=require(_0x502d('0x12'));var qs=require(_0x502d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x502d('0x14'))(_0x502d('0x15'));var utils=require(_0x502d('0x16'));var config=require(_0x502d('0x17'));var licenseUtil=require(_0x502d('0x18'));var db=require(_0x502d('0x19'))['db'];function respondWithStatusCode(_0x2a6d29,_0x59f6ce){_0x59f6ce=_0x59f6ce||0xcc;return function(_0x3e357e){if(_0x3e357e){return _0x2a6d29[_0x502d('0x1a')](_0x59f6ce);}return _0x2a6d29[_0x502d('0x1b')](_0x59f6ce)['end']();};}function respondWithResult(_0xae2121,_0x570ebf){_0x570ebf=_0x570ebf||0xc8;return function(_0x44e079){if(_0x44e079){return _0xae2121['status'](_0x570ebf)[_0x502d('0x1c')](_0x44e079);}};}function respondWithFilteredResult(_0xd1822a,_0xf3d979){return function(_0x2fd745){if(_0x2fd745){var _0x2a3593=typeof _0xf3d979[_0x502d('0x1d')]===_0x502d('0x1e')&&typeof _0xf3d979[_0x502d('0x1f')]===_0x502d('0x1e');var _0x104bc4=_0x2fd745[_0x502d('0x20')];var _0x5647fc=_0x2a3593?0x0:_0xf3d979[_0x502d('0x1d')];var _0x1c3f4e=_0x2a3593?_0x2fd745['count']:_0xf3d979['offset']+_0xf3d979[_0x502d('0x1f')];var _0x313ae1;if(_0x1c3f4e>=_0x104bc4){_0x1c3f4e=_0x104bc4;_0x313ae1=0xc8;}else{_0x313ae1=0xce;}_0xd1822a[_0x502d('0x1b')](_0x313ae1);return _0xd1822a[_0x502d('0x21')](_0x502d('0x22'),_0x5647fc+'-'+_0x1c3f4e+'/'+_0x104bc4)[_0x502d('0x1c')](_0x2fd745);}return null;};}function patchUpdates(_0x45b407){return function(_0x31bd37){try{jsonpatch['apply'](_0x31bd37,_0x45b407,!![]);}catch(_0x3b3788){return BPromise['reject'](_0x3b3788);}return _0x31bd37[_0x502d('0x23')]();};}function saveUpdates(_0x1dc1be,_0x5d54d2){return function(_0x6eacdf){if(_0x6eacdf){return _0x6eacdf[_0x502d('0x24')](_0x1dc1be)[_0x502d('0x25')](function(_0x2b1c1a){return _0x2b1c1a;});}return null;};}function removeEntity(_0x1445db,_0x5f14a4){return function(_0x18a7f1){if(_0x18a7f1){return _0x18a7f1[_0x502d('0x26')]()[_0x502d('0x25')](function(){_0x1445db[_0x502d('0x1b')](0xcc)[_0x502d('0x27')]();});}};}function handleEntityNotFound(_0x30a4d4,_0x144e99){return function(_0x54f60e){if(!_0x54f60e){_0x30a4d4[_0x502d('0x1a')](0x194);}return _0x54f60e;};}function handleError(_0x5771bc,_0x24a837){_0x24a837=_0x24a837||0x1f4;return function(_0x135982){logger[_0x502d('0x28')](_0x135982['stack']);if(_0x135982[_0x502d('0x29')]){delete _0x135982[_0x502d('0x29')];}_0x5771bc[_0x502d('0x1b')](_0x24a837)[_0x502d('0x2a')](_0x135982);};}exports['index']=function(_0x58e5e2,_0x37143d){var _0x37c9c7={},_0x4401d8={},_0x7f7d59={'count':0x0,'rows':[]};var _0x2d8e88=_['map'](db['WhatsappTransferReport'][_0x502d('0x2b')],function(_0x132257){return{'name':_0x132257[_0x502d('0x2c')],'type':_0x132257[_0x502d('0x2d')][_0x502d('0x2e')]};});_0x4401d8[_0x502d('0x2f')]=_[_0x502d('0x30')](_0x2d8e88,_0x502d('0x29'));_0x4401d8[_0x502d('0x31')]=_['keys'](_0x58e5e2[_0x502d('0x31')]);_0x4401d8[_0x502d('0x32')]=_[_0x502d('0x33')](_0x4401d8[_0x502d('0x2f')],_0x4401d8['query']);_0x37c9c7['attributes']=_[_0x502d('0x33')](_0x4401d8['model'],qs[_0x502d('0x34')](_0x58e5e2[_0x502d('0x31')]['fields']));_0x37c9c7[_0x502d('0x35')]=_0x37c9c7[_0x502d('0x35')]['length']?_0x37c9c7['attributes']:_0x4401d8[_0x502d('0x2f')];if(!_0x58e5e2[_0x502d('0x31')][_0x502d('0x36')](_0x502d('0x37'))){_0x37c9c7['limit']=qs[_0x502d('0x1f')](_0x58e5e2[_0x502d('0x31')]['limit']);_0x37c9c7[_0x502d('0x1d')]=qs[_0x502d('0x1d')](_0x58e5e2[_0x502d('0x31')][_0x502d('0x1d')]);}_0x37c9c7[_0x502d('0x38')]=qs['sort'](_0x58e5e2[_0x502d('0x31')]['sort']);_0x37c9c7['where']=qs[_0x502d('0x32')](_[_0x502d('0x39')](_0x58e5e2['query'],_0x4401d8[_0x502d('0x32')]),_0x2d8e88);if(_0x58e5e2[_0x502d('0x31')]['filter']){_0x37c9c7['where']=_[_0x502d('0x3a')](_0x37c9c7[_0x502d('0x3b')],{'$or':_[_0x502d('0x30')](_0x2d8e88,function(_0x152d98){if(_0x152d98[_0x502d('0x2d')]!==_0x502d('0x3c')){var _0x108161={};_0x108161[_0x152d98[_0x502d('0x29')]]={'$like':'%'+_0x58e5e2['query']['filter']+'%'};return _0x108161;}})});}_0x37c9c7=_[_0x502d('0x3a')]({},_0x37c9c7,_0x58e5e2[_0x502d('0x3d')]);var _0x1a644f={'where':_0x37c9c7['where']};return db[_0x502d('0x3e')][_0x502d('0x20')](_0x1a644f)['then'](function(_0xd682b7){_0x7f7d59['count']=_0xd682b7;if(_0x58e5e2[_0x502d('0x31')]['includeAll']){_0x37c9c7[_0x502d('0x3f')]=[{'all':!![]}];}return db[_0x502d('0x3e')][_0x502d('0x40')](_0x37c9c7);})[_0x502d('0x25')](function(_0x2587a3){_0x7f7d59[_0x502d('0x41')]=_0x2587a3;return _0x7f7d59;})[_0x502d('0x25')](respondWithFilteredResult(_0x37143d,_0x37c9c7))[_0x502d('0x42')](handleError(_0x37143d,null));};exports['show']=function(_0x21d71f,_0x38832f){var _0x4ec0e3={'raw':!![],'where':{'id':_0x21d71f[_0x502d('0x43')]['id']}},_0xb6d78a={};_0xb6d78a[_0x502d('0x2f')]=_['keys'](db[_0x502d('0x3e')][_0x502d('0x2b')]);_0xb6d78a[_0x502d('0x31')]=_['keys'](_0x21d71f[_0x502d('0x31')]);_0xb6d78a[_0x502d('0x32')]=_[_0x502d('0x33')](_0xb6d78a[_0x502d('0x2f')],_0xb6d78a[_0x502d('0x31')]);_0x4ec0e3[_0x502d('0x35')]=_[_0x502d('0x33')](_0xb6d78a[_0x502d('0x2f')],qs[_0x502d('0x34')](_0x21d71f[_0x502d('0x31')][_0x502d('0x34')]));_0x4ec0e3[_0x502d('0x35')]=_0x4ec0e3['attributes'][_0x502d('0x44')]?_0x4ec0e3[_0x502d('0x35')]:_0xb6d78a['model'];if(_0x21d71f[_0x502d('0x31')][_0x502d('0x45')]){_0x4ec0e3['include']=[{'all':!![]}];}_0x4ec0e3=_[_0x502d('0x3a')]({},_0x4ec0e3,_0x21d71f['options']);return db['WhatsappTransferReport'][_0x502d('0x46')](_0x4ec0e3)['then'](handleEntityNotFound(_0x38832f,null))[_0x502d('0x25')](respondWithResult(_0x38832f,null))[_0x502d('0x42')](handleError(_0x38832f,null));};exports[_0x502d('0x47')]=function(_0x56cd95,_0x4918a6){return db[_0x502d('0x3e')][_0x502d('0x47')](_0x56cd95[_0x502d('0x48')],{})[_0x502d('0x25')](respondWithResult(_0x4918a6,0xc9))[_0x502d('0x42')](handleError(_0x4918a6,null));};exports[_0x502d('0x24')]=function(_0x366577,_0x56701e){if(_0x366577['body']['id']){delete _0x366577[_0x502d('0x48')]['id'];}return db[_0x502d('0x3e')][_0x502d('0x46')]({'where':{'id':_0x366577[_0x502d('0x43')]['id']}})[_0x502d('0x25')](handleEntityNotFound(_0x56701e,null))[_0x502d('0x25')](saveUpdates(_0x366577['body'],null))[_0x502d('0x25')](respondWithResult(_0x56701e,null))['catch'](handleError(_0x56701e,null));};exports[_0x502d('0x26')]=function(_0x37c0ea,_0x33de95){return db['WhatsappTransferReport'][_0x502d('0x46')]({'where':{'id':_0x37c0ea[_0x502d('0x43')]['id']}})['then'](handleEntityNotFound(_0x33de95,null))['then'](removeEntity(_0x33de95,null))[_0x502d('0x42')](handleError(_0x33de95,null));};exports[_0x502d('0x49')]=function(_0xf57154,_0x4760f8){return db[_0x502d('0x3e')][_0x502d('0x49')]()[_0x502d('0x25')](respondWithResult(_0x4760f8,null))['catch'](handleError(_0x4760f8,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 0c1e316..547dbee 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 _0x6ec8=['../../config/logger','moment','bluebird','path','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x22005a,_0x12cb78){var _0xe92ef6=function(_0x30fd64){while(--_0x30fd64){_0x22005a['push'](_0x22005a['shift']());}};_0xe92ef6(++_0x12cb78);}(_0x6ec8,0xca));var _0x86ec=function(_0x4b23b0,_0xf3d9b4){_0x4b23b0=_0x4b23b0-0x0;var _0x1440d7=_0x6ec8[_0x4b23b0];return _0x1440d7;};'use strict';var _=require(_0x86ec('0x0'));var util=require(_0x86ec('0x1'));var logger=require(_0x86ec('0x2'))('api');var moment=require(_0x86ec('0x3'));var BPromise=require(_0x86ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86ec('0x5'));var rimraf=require('rimraf');var config=require(_0x86ec('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x86ec('0x7')]=function(_0x5eca4d,_0x2e1d2c){return _0x5eca4d[_0x86ec('0x8')](_0x86ec('0x9'),attributes,{'tableName':_0x86ec('0xa'),'paranoid':![],'indexes':[{'name':_0x86ec('0xb'),'fields':[_0x86ec('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ee0=['../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x464bc3,_0xc8cc27){var _0x10520e=function(_0x2398f7){while(--_0x2398f7){_0x464bc3['push'](_0x464bc3['shift']());}};_0x10520e(++_0xc8cc27);}(_0x3ee0,0x12c));var _0x03ee=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3ee0[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x03ee('0x0'));var util=require(_0x03ee('0x1'));var logger=require(_0x03ee('0x2'))(_0x03ee('0x3'));var moment=require(_0x03ee('0x4'));var BPromise=require(_0x03ee('0x5'));var rp=require(_0x03ee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03ee('0x7'));var config=require(_0x03ee('0x8'));var attributes=require(_0x03ee('0x9'));module['exports']=function(_0x31b3c1,_0x1051c5){return _0x31b3c1[_0x03ee('0xa')](_0x03ee('0xb'),attributes,{'tableName':_0x03ee('0xc'),'paranoid':![],'indexes':[{'name':_0x03ee('0xd'),'fields':[_0x03ee('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 9503886..75a145c 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 _0x03a7=['request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','WhatsappTransferReport,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x3b5c38,_0x2c7022){var _0x442ebd=function(_0x738ed7){while(--_0x738ed7){_0x3b5c38['push'](_0x3b5c38['shift']());}};_0x442ebd(++_0x2c7022);}(_0x03a7,0xc6));var _0x703a=function(_0x28591c,_0x51a615){_0x28591c=_0x28591c-0x0;var _0x3b48fe=_0x03a7[_0x28591c];return _0x3b48fe;};'use strict';var _=require(_0x703a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x703a('0x1'));var rs=require(_0x703a('0x2'));var fs=require('fs');var Redis=require(_0x703a('0x3'));var db=require(_0x703a('0x4'))['db'];var utils=require(_0x703a('0x5'));var logger=require('../../config/logger')(_0x703a('0x6'));var config=require(_0x703a('0x7'));var jayson=require(_0x703a('0x8'));var client=jayson[_0x703a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27ec48,_0x2edec5,_0x4d0cfe){return new BPromise(function(_0x49b213,_0x165656){return client[_0x703a('0xa')](_0x27ec48,_0x4d0cfe)['then'](function(_0x5df5b2){logger[_0x703a('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2edec5,_0x703a('0xc'));logger[_0x703a('0xd')](_0x703a('0xe'),_0x2edec5,_0x703a('0xc'),JSON['stringify'](_0x5df5b2));if(_0x5df5b2['error']){if(_0x5df5b2['error'][_0x703a('0xf')]===0x1f4){logger['error'](_0x703a('0x10'),_0x2edec5,_0x5df5b2[_0x703a('0x11')][_0x703a('0x12')]);return _0x165656(_0x5df5b2[_0x703a('0x11')][_0x703a('0x12')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x2edec5,_0x5df5b2['error'][_0x703a('0x12')]);return _0x49b213(_0x5df5b2[_0x703a('0x11')][_0x703a('0x12')]);}else{logger[_0x703a('0xb')](_0x703a('0x10'),_0x2edec5,'request\x20sent');_0x49b213(_0x5df5b2[_0x703a('0x13')][_0x703a('0x12')]);}})[_0x703a('0x14')](function(_0x2ac24d){logger[_0x703a('0x11')](_0x703a('0x10'),_0x2edec5,_0x2ac24d);_0x165656(_0x2ac24d);});});} \ No newline at end of file +var _0x6d62=['then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1f7648,_0xa8bd62){var _0x1c7ef6=function(_0x4d92ca){while(--_0x4d92ca){_0x1f7648['push'](_0x1f7648['shift']());}};_0x1c7ef6(++_0xa8bd62);}(_0x6d62,0x1ad));var _0x26d6=function(_0x535963,_0x326515){_0x535963=_0x535963-0x0;var _0x3975f6=_0x6d62[_0x535963];return _0x3975f6;};'use strict';var _=require(_0x26d6('0x0'));var util=require(_0x26d6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x26d6('0x2'));var fs=require('fs');var Redis=require(_0x26d6('0x3'));var db=require(_0x26d6('0x4'))['db'];var utils=require(_0x26d6('0x5'));var logger=require(_0x26d6('0x6'))(_0x26d6('0x7'));var config=require(_0x26d6('0x8'));var jayson=require(_0x26d6('0x9'));var client=jayson[_0x26d6('0xa')][_0x26d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c2ede,_0x47e193,_0x3e200f){return new BPromise(function(_0x44ca36,_0x3f6214){return client['request'](_0x2c2ede,_0x3e200f)[_0x26d6('0xc')](function(_0x34bd4f){logger[_0x26d6('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e193,'request\x20sent');logger[_0x26d6('0xe')](_0x26d6('0xf'),_0x47e193,_0x26d6('0x10'),JSON['stringify'](_0x34bd4f));if(_0x34bd4f[_0x26d6('0x11')]){if(_0x34bd4f['error'][_0x26d6('0x12')]===0x1f4){logger[_0x26d6('0x11')](_0x26d6('0x13'),_0x47e193,_0x34bd4f[_0x26d6('0x11')][_0x26d6('0x14')]);return _0x3f6214(_0x34bd4f[_0x26d6('0x11')][_0x26d6('0x14')]);}logger[_0x26d6('0x11')](_0x26d6('0x13'),_0x47e193,_0x34bd4f[_0x26d6('0x11')][_0x26d6('0x14')]);return _0x44ca36(_0x34bd4f[_0x26d6('0x11')][_0x26d6('0x14')]);}else{logger[_0x26d6('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e193,_0x26d6('0x10'));_0x44ca36(_0x34bd4f['result'][_0x26d6('0x14')]);}})['catch'](function(_0x1667c2){logger[_0x26d6('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e193,_0x1667c2);_0x3f6214(_0x1667c2);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 78e52d0..0f8d888 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x323b=['join','status','online','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','seedDB','default','listen','info','start','filter','number','exitCode','length','map','name','Online\x20apps:'];(function(_0x3e8426,_0x49a842){var _0x874e2e=function(_0x3b3699){while(--_0x3b3699){_0x3e8426['push'](_0x3e8426['shift']());}};_0x874e2e(++_0x49a842);}(_0x323b,0x1ad));var _0xb323=function(_0x50ea0f,_0x229454){_0x50ea0f=_0x50ea0f-0x0;var _0x434092=_0x323b[_0x50ea0f];return _0x434092;};'use strict';var _=require(_0xb323('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xb323('0x1'));var checkLicense=require(_0xb323('0x2'));var rpc=require(_0xb323('0x3'));var config=require('./config/environment');var logger=require(_0xb323('0x4'))(_0xb323('0x5'));var pm2=require(_0xb323('0x6'));var pm2Config=require(_0xb323('0x7'));var schedule=require(_0xb323('0x8'));var chat=require(_0xb323('0x9'));var whatsapp=require(_0xb323('0xa'));var transcribe=require(_0xb323('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0xb323('0xc')]()[_0xb323('0xd')](function(){if(config[_0xb323('0xe')]){return seedDb[_0xb323('0xf')]();}})['then'](function(){return checkLicense[_0xb323('0xf')]();})[_0xb323('0xd')](function(){return rpc[_0xb323('0x10')]();})['then'](function(_0x75e5d2){logger[_0xb323('0x11')](_0x75e5d2);return chat[_0xb323('0x12')]();})[_0xb323('0xd')](function(){return whatsapp[_0xb323('0x12')]();})['then'](function(){return schedule[_0xb323('0x12')]();})[_0xb323('0xd')](function(){return transcribe[_0xb323('0x12')]();})[_0xb323('0xd')](function(){return provider['start']();})[_0xb323('0xd')](function(_0xfa6721){logger[_0xb323('0x11')](_0xfa6721);return pm2[_0xb323('0x12')](pm2Config);})[_0xb323('0xd')](function(_0x18c341){var _0x36695e=_0x18c341[_0xb323('0x13')](function(_0x41a47d){return typeof _0x41a47d['exitCode']===_0xb323('0x14')&&_0x41a47d[_0xb323('0x15')]>=0x0;});if(_0x36695e[_0xb323('0x16')]>0x0){throw new Error(_0x36695e[_0xb323('0x16')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xb323('0x17')](_0x36695e,function(_0x3bc40f){return'\x22'+_0x3bc40f['pm2_env'][_0xb323('0x18')]+'\x22';}));}logger[_0xb323('0x11')](_0xb323('0x19'),_[_0xb323('0x17')](_[_0xb323('0x13')](_0x18c341,{'status':'online'}),_0xb323('0x18'))[_0xb323('0x1a')]());logger[_0xb323('0x11')]('Offline\x20apps:',_[_0xb323('0x17')](_['filter'](_0x18c341,function(_0x2fc9a5){return _0x2fc9a5[_0xb323('0x1b')]!==_0xb323('0x1c');}),_0xb323('0x18'))[_0xb323('0x1a')]()||'None');console['log'](_0xb323('0x1d'));})[_0xb323('0x1e')](function(_0x2a8cd4){console['log'](_0xb323('0x1f'),_0x2a8cd4);logger[_0xb323('0x20')](_0xb323('0x21'),_0x2a8cd4);process[_0xb323('0x22')](0x1);});}main(); \ No newline at end of file +var _0xb2f1=['lodash','./mysqldb','./config/license','./rpc','./config/logger','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','default','listen','info','start','filter','exitCode','length','pm2_env','Online\x20apps:','map','name','join','Offline\x20apps:','status','online','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2f1,0xee));var _0x1b2f=function(_0x203569,_0x7e5a1e){_0x203569=_0x203569-0x0;var _0x22d2c3=_0xb2f1[_0x203569];return _0x22d2c3;};'use strict';var _=require(_0x1b2f('0x0'));var db=require(_0x1b2f('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x1b2f('0x2'));var rpc=require(_0x1b2f('0x3'));var config=require('./config/environment');var logger=require(_0x1b2f('0x4'))(_0x1b2f('0x5'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x1b2f('0x6'));var chat=require(_0x1b2f('0x7'));var whatsapp=require(_0x1b2f('0x8'));var transcribe=require(_0x1b2f('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0x1b2f('0xa')]()[_0x1b2f('0xb')](function(){if(config['seedDB']){return seedDb[_0x1b2f('0xc')]();}})[_0x1b2f('0xb')](function(){return checkLicense['default']();})[_0x1b2f('0xb')](function(){return rpc[_0x1b2f('0xd')]();})[_0x1b2f('0xb')](function(_0x26842c){logger[_0x1b2f('0xe')](_0x26842c);return chat[_0x1b2f('0xf')]();})[_0x1b2f('0xb')](function(){return whatsapp['start']();})[_0x1b2f('0xb')](function(){return schedule[_0x1b2f('0xf')]();})[_0x1b2f('0xb')](function(){return transcribe['start']();})[_0x1b2f('0xb')](function(){return provider['start']();})[_0x1b2f('0xb')](function(_0x2f285a){logger[_0x1b2f('0xe')](_0x2f285a);return pm2[_0x1b2f('0xf')](pm2Config);})[_0x1b2f('0xb')](function(_0x559ef2){var _0x1cfbf3=_0x559ef2[_0x1b2f('0x10')](function(_0x130219){return typeof _0x130219[_0x1b2f('0x11')]==='number'&&_0x130219['exitCode']>=0x0;});if(_0x1cfbf3[_0x1b2f('0x12')]>0x0){throw new Error(_0x1cfbf3['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x1cfbf3,function(_0xb376de){return'\x22'+_0xb376de[_0x1b2f('0x13')]['name']+'\x22';}));}logger['info'](_0x1b2f('0x14'),_[_0x1b2f('0x15')](_[_0x1b2f('0x10')](_0x559ef2,{'status':'online'}),_0x1b2f('0x16'))[_0x1b2f('0x17')]());logger[_0x1b2f('0xe')](_0x1b2f('0x18'),_[_0x1b2f('0x15')](_[_0x1b2f('0x10')](_0x559ef2,function(_0xa1d86b){return _0xa1d86b[_0x1b2f('0x19')]!==_0x1b2f('0x1a');}),'name')[_0x1b2f('0x17')]()||'None');console[_0x1b2f('0x1b')](_0x1b2f('0x1c'));})[_0x1b2f('0x1d')](function(_0x5a1ff0){console['log'](_0x1b2f('0x1e'),_0x5a1ff0);logger[_0x1b2f('0x1f')](_0x1b2f('0x20'),_0x5a1ff0);process[_0x1b2f('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 7f6818a..787b2c0 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 _0x6233=['now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','name','userpic','permissions','md5secret','voicePause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','startsWith','authorization','Basic','User','pass','Wrong\x20credentials.','apikey','getUuid','query','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','splice','encryptString','secret','payload','options','promisify','verify','toString','floor'];(function(_0x4e20f0,_0x266882){var _0x2c8e40=function(_0x205c22){while(--_0x205c22){_0x4e20f0['push'](_0x4e20f0['shift']());}};_0x2c8e40(++_0x266882);}(_0x6233,0x1a0));var _0x3623=function(_0x50c119,_0x554001){_0x50c119=_0x50c119-0x0;var _0x589f03=_0x6233[_0x50c119];return _0x589f03;};'use strict';var db=require(_0x3623('0x0'))['db'];var config=require(_0x3623('0x1'));var hardwareConf=require(_0x3623('0x2'));var licenseUtil=require(_0x3623('0x3'));var encryptor=require(_0x3623('0x4'));var _=require(_0x3623('0x5'));var jwt=require(_0x3623('0x6'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x3623('0x7'));var crypto=require(_0x3623('0x8'));var BPromise=require(_0x3623('0x9'));var util=require(_0x3623('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x3623('0xb')][_0x3623('0xc')]});var userAttributes=['id',_0x3623('0xd'),_0x3623('0xe'),_0x3623('0xf'),'internal','email',_0x3623('0x10'),_0x3623('0x11'),_0x3623('0x12'),_0x3623('0x13'),'chatPause','mailPause',_0x3623('0x14'),_0x3623('0x15'),_0x3623('0x16'),_0x3623('0x17'),_0x3623('0x18'),_0x3623('0x19'),_0x3623('0x1a'),_0x3623('0x1b'),_0x3623('0x1c'),_0x3623('0x1d'),_0x3623('0x1e'),'phoneBarAutoAnswer',_0x3623('0x1f'),_0x3623('0x20'),_0x3623('0x21'),_0x3623('0x22'),_0x3623('0x23'),_0x3623('0x24'),_0x3623('0x25'),_0x3623('0x26'),_0x3623('0x27'),_0x3623('0x28'),_0x3623('0x29'),'userProfileId',_0x3623('0x2a'),'settingsEnabled',_0x3623('0x2b'),_0x3623('0x2c'),'downloadOmnichannelInteractions',_0x3623('0x2d'),'ignorePauseForPreviewCalls',_0x3623('0x2e'),_0x3623('0x2f'),_0x3623('0x30'),_0x3623('0x31'),_0x3623('0x32'),_0x3623('0x33'),_0x3623('0x34'),_0x3623('0x35'),'openchannelAutoanswerDelay',_0x3623('0x36'),_0x3623('0x37'),_0x3623('0x38'),_0x3623('0x39'),_0x3623('0x3a')];exports[_0x3623('0x3b')]=function(){return this[_0x3623('0x3c')](!![])[_0x3623('0x3d')](function(_0x2ea4e7,_0x38555e,_0x4f038c){if(_0x2ea4e7[_0x3623('0x3e')]){_0x4f038c();}else{return db[_0x3623('0x3f')][_0x3623('0x40')]({'where':{'id':_0x2ea4e7[_0x3623('0x41')]['id']},'attributes':['id',_0x3623('0x42'),'disposition'],'raw':!![]})[_0x3623('0x43')](function(_0x8e11aa){if(_0x8e11aa&&_0x8e11aa[_0x3623('0x42')]&&!_0x2ea4e7['query']['forceDownload']){return _0x38555e[_0x3623('0x44')](_0x8e11aa[_0x3623('0x45')]===_0x3623('0x46')?0x195:0x193)[_0x3623('0x47')]({'message':_0x8e11aa['disposition']===_0x3623('0x46')?_0x3623('0x48'):_0x3623('0x49')});}else{_0x4f038c();}})[_0x3623('0x4a')](function(_0x5dbe2c){_0x4f038c(_0x5dbe2c);});}});};exports[_0x3623('0x3c')]=function isAuthenticated(_0x5b431d){return compose()[_0x3623('0x3d')](function(_0x35db03,_0x506937,_0x13d257){var _0x38b1e4;if(_0x35db03[_0x3623('0x4b')]['authorization']){if(_[_0x3623('0x4c')](_0x35db03['headers'][_0x3623('0x4d')],_0x3623('0x4e'))){var _0x53ed36=basicAuth(_0x35db03);db[_0x3623('0x4f')]['find']({'where':{'name':_0x53ed36[_0x3623('0xf')]}})[_0x3623('0x43')](function(_0x237e15){if(!_0x237e15||!_0x237e15['authenticate'](_0x53ed36[_0x3623('0x50')])){return _0x506937[_0x3623('0x44')](0x191)[_0x3623('0x47')]({'message':_0x3623('0x51')});}_0x35db03[_0x3623('0x3e')]={'id':_0x237e15['id']};_0x13d257();})[_0x3623('0x4a')](function(_0x5592eb){_0x13d257(_0x5592eb);});}else if(_['startsWith'](_0x35db03[_0x3623('0x4b')]['authorization'],'Bearer')){validateJwt(_0x35db03,_0x506937,_0x13d257);}else{if(_0x5b431d){_0x13d257();}else{return _0x506937[_0x3623('0x44')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x35db03['query'][_0x3623('0x52')]){try{var _0x5357f3={'audience':hardwareConf[_0x3623('0x53')](),'issuer':hardwareConf[_0x3623('0x53')]()};verifyJwt(_0x35db03[_0x3623('0x54')][_0x3623('0x52')],_0x5357f3)['then'](function(_0x1e0c91){return db[_0x3623('0x4f')]['find']({'where':{'id':_0x1e0c91['sub']}})[_0x3623('0x43')](function(_0xcb4ef3){_0x38b1e4=_0xcb4ef3;return db[_0x3623('0x55')][_0x3623('0x40')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3623('0x56')],'raw':!![]});})[_0x3623('0x43')](function(_0x807e23){if(!_0x38b1e4||!_[_0x3623('0x57')](_0x38b1e4[_0x3623('0x58')],_0x1e0c91[_0x3623('0x59')])){return _0x506937[_0x3623('0x44')](0x191)[_0x3623('0x47')]({'message':_0x3623('0x5a')});}if(_0x38b1e4[_0x3623('0x5b')]){return _0x506937[_0x3623('0x44')](0x191)[_0x3623('0x47')]({'message':_0x3623('0x5c')});}if(_0x38b1e4[_0x3623('0x5d')]){if(_0x807e23[_0x3623('0x56')]>0x0){if(moment(_0x38b1e4[_0x3623('0x5e')])['add'](_0x807e23[_0x3623('0x56')],_0x3623('0x5f'))>moment()){return _0x506937[_0x3623('0x44')](0x191)['json']({'message':_0x3623('0x5c')});}}else{return _0x506937[_0x3623('0x44')](0x191)['json']({'message':_0x3623('0x5c')});}}_0x35db03['user']={'id':_0x38b1e4['id']};_0x13d257();});})[_0x3623('0x4a')](function(){return _0x506937[_0x3623('0x44')](0x191)['json']({'message':_0x3623('0x5c')});});}catch(_0x356e44){_0x13d257(_0x356e44);}}else if(_0x5b431d){_0x13d257();}else{return _0x506937['status'](0x193)['json']({'message':_0x3623('0x60')});}})[_0x3623('0x3d')](function(_0x423762,_0x58a481,_0x34abde){if(_0x423762[_0x3623('0x3e')]){db[_0x3623('0x4f')]['find']({'where':{'id':_0x423762['user']['id']},'attributes':userAttributes})['then'](function(_0x2eb8e3){if(!_0x2eb8e3){return _0x58a481[_0x3623('0x44')](0x194)[_0x3623('0x47')]({'message':_0x3623('0x61')});}_0x423762[_0x3623('0x3e')]=_0x2eb8e3;_0x34abde();})[_0x3623('0x4a')](function(_0x15a728){_0x34abde(_0x15a728);});}else if(_0x5b431d){_0x34abde();}else{return _0x58a481[_0x3623('0x44')](0x194)[_0x3623('0x47')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x3623('0x62')]=function canUpdate(){return compose()['use'](function(_0x3e374e,_0x3400aa,_0x33ab39){return licenseUtil[_0x3623('0x63')]()[_0x3623('0x43')](function(_0x40d10e){if(_0x40d10e[_0x3623('0x64')]){_0x33ab39();}else{return _0x3400aa['status'](0x193)['json']({'message':_0x3623('0x65')});}})[_0x3623('0x4a')](function(_0x1c2aab){_0x33ab39(_0x1c2aab);});});};exports[_0x3623('0x66')]=function isWebrtcLicence(){return compose()[_0x3623('0x3d')](function(_0x1db7df,_0x1239ca,_0x4cda94){return licenseUtil[_0x3623('0x63')]()[_0x3623('0x43')](function(_0xe706ef){if(_0xe706ef[_0x3623('0x67')]){_0x4cda94();}else{return _0x1239ca['status'](0x193)['json']({'message':_0x3623('0x65')});}})[_0x3623('0x4a')](function(_0x421391){_0x4cda94(_0x421391);});});};exports[_0x3623('0x68')]=function(_0x247cf4,_0x230ea6,_0x465f87){_0x247cf4[_0x3623('0x68')]=!![];return _0x465f87();};exports['signToken']=function signToken(_0x431412){return signJwt(_0x431412);};exports[_0x3623('0x69')]=function(_0x5331a7,_0x4edb00){if(!_0x5331a7[_0x3623('0x3e')]){return _0x4edb00[_0x3623('0x44')](0x194)[_0x3623('0x47')]({'message':_0x3623('0x6a')});}var _0x25f888={'payload':{'id':_0x5331a7[_0x3623('0x3e')]['id'],'role':_0x5331a7[_0x3623('0x3e')][_0x3623('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x25f888)[_0x3623('0x43')](function(_0x3fce5c){_0x4edb00[_0x3623('0x6b')]('motion.token',_0x3fce5c);_0x4edb00[_0x3623('0x6c')](_0x3623('0x6d'));})[_0x3623('0x4a')](function(_0x4350cf){return _0x4edb00[_0x3623('0x44')](0x1f4)[_0x3623('0x6e')](_0x4350cf);});};exports[_0x3623('0x6f')]=function(_0x146f28){if(_[_0x3623('0x70')](_0x146f28[_0x3623('0x58')])||_[_0x3623('0x70')](_0x146f28['apiKeyIat'])){return null;}else{return createJwt(_0x146f28);}};exports['generateApiKey']=function(_0x11958a){_0x11958a[_0x3623('0x58')]=generateNonce();_0x11958a[_0x3623('0x71')]=generateIssuedAt();return createJwt(_0x11958a);};exports[_0x3623('0x72')]=function(_0x1635d0,_0x5322c7){var _0x3bcc26=_0x1635d0[_0x3623('0x54')]['apikey'];if(_0x3bcc26){var _0x3f3c8d={'nonce':_0x5322c7[_0x3623('0x58')],'iat':_0x5322c7[_0x3623('0x71')],'audience':hardwareConf[_0x3623('0x53')](),'issuer':hardwareConf[_0x3623('0x53')]()};return verifyJwt(_0x3bcc26,_0x3f3c8d)[_0x3623('0x43')](function(){return generateApiKey(_0x5322c7);});}else{throw{'message':_0x3623('0x73')};}};exports[_0x3623('0x74')]=function(_0x16c963){var _0x39a17d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x39a17d[_0x3623('0x75')](_0x16c963))throw new db[(_0x3623('0x76'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x3623('0x77')]=function(_0x4676a7,_0x5e878d,_0x51098b){var _0x58c071=encryptor[_0x3623('0x78')](_0x5e878d)[_0x3623('0x79')](',');for(var _0x1919fb=0x0;_0x1919fb<_0x51098b;_0x1919fb++){if(!_0x58c071[_0x1919fb])break;if(_0x4676a7[_0x3623('0x7a')]()===_0x58c071[_0x1919fb][_0x3623('0x7a')]()){var _0x32d11a=util[_0x3623('0x7b')](_0x3623('0x7c'),_0x51098b);if(_0x51098b===0x1){_0x32d11a='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x3623('0x76'))][(_0x3623('0x7d'))](_0x32d11a);}}return;};exports[_0x3623('0x7e')]=function(_0xe67c1f,_0xe54cfc){var _0x23e9af=_0xe54cfc?encryptor[_0x3623('0x78')](_0xe54cfc)[_0x3623('0x79')](','):[];if(_0x23e9af['length']===0x5){_0x23e9af[_0x3623('0x7f')](-0x1,0x1);}_0x23e9af['unshift'](_0xe67c1f);return encryptor[_0x3623('0x80')](_0x23e9af['join'](','));};function signJwt(_0x223658){var _0x21f820=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x4b2a5e=_0x223658[_0x3623('0x81')]||config[_0x3623('0xb')][_0x3623('0xc')];return new BPromise(function(_0x7446d,_0x5d41c4){_0x21f820(_0x223658[_0x3623('0x82')],_0x4b2a5e,_0x223658[_0x3623('0x83')])[_0x3623('0x43')](function(_0x3d74ba){_0x7446d(_0x3d74ba);})[_0x3623('0x4a')](function(_0x1165e9){_0x5d41c4(_0x1165e9);});});}function verifyJwt(_0x5c60c2,_0x73f27a,_0x5fbb06){var _0x2fee4f=BPromise[_0x3623('0x84')](jwt[_0x3623('0x85')],{'context':jwt});var _0x194983=_0x5fbb06||config['secrets'][_0x3623('0xc')];return new BPromise(function(_0x2712f9,_0x3c8cc9){_0x2fee4f(_0x5c60c2,_0x194983,_0x73f27a)[_0x3623('0x43')](function(_0x14d950){_0x2712f9(_0x14d950);})['catch'](function(_0x176d15){_0x3c8cc9(_0x176d15);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x3623('0x86')]('hex');}function generateIssuedAt(){return Math[_0x3623('0x87')](Date[_0x3623('0x88')]()/0x3e8)[_0x3623('0x86')]();}function createJwt(_0x45689b){var _0x4159cc={'payload':{'iat':_0x45689b[_0x3623('0x71')],'nonce':_0x45689b[_0x3623('0x58')]},'options':{'algorithm':_0x3623('0x89'),'subject':_0x45689b['id'][_0x3623('0x86')](),'issuer':hardwareConf[_0x3623('0x53')](),'audience':hardwareConf[_0x3623('0x53')]()}};return signJwt(_0x4159cc)[_0x3623('0x43')](function(_0x19433c){return{'iat':_0x45689b['apiKeyIat'],'nonce':_0x45689b[_0x3623('0x58')],'token':_0x19433c};});} \ No newline at end of file +var _0xbbcf=['allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','query','forceDownload','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','json','Bearer','Unknown\x20authorization\x20format','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','disabled','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','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.','decryptString','length','unshift','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','md5secret','voicePause','chatPause','faxPause','openchannelPause','pauseType','showWebBar','crudPermissions'];(function(_0xe24a93,_0x17bf79){var _0x1c5a39=function(_0x5a59fc){while(--_0x5a59fc){_0xe24a93['push'](_0xe24a93['shift']());}};_0x1c5a39(++_0x17bf79);}(_0xbbcf,0x6f));var _0xfbbc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbbcf[_0x20a584];return _0x4b41a8;};'use strict';var db=require(_0xfbbc('0x0'))['db'];var config=require(_0xfbbc('0x1'));var hardwareConf=require(_0xfbbc('0x2'));var licenseUtil=require(_0xfbbc('0x3'));var encryptor=require(_0xfbbc('0x4'));var _=require(_0xfbbc('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xfbbc('0x6'));var compose=require(_0xfbbc('0x7'));var basicAuth=require(_0xfbbc('0x8'));var crypto=require(_0xfbbc('0x9'));var BPromise=require(_0xfbbc('0xa'));var util=require(_0xfbbc('0xb'));var moment=require(_0xfbbc('0xc'));var validateJwt=expressJwt({'secret':config[_0xfbbc('0xd')][_0xfbbc('0xe')]});var userAttributes=['id',_0xfbbc('0xf'),_0xfbbc('0x10'),_0xfbbc('0x11'),_0xfbbc('0x12'),_0xfbbc('0x13'),'userpic','permissions',_0xfbbc('0x14'),_0xfbbc('0x15'),_0xfbbc('0x16'),'mailPause',_0xfbbc('0x17'),'smsPause',_0xfbbc('0x18'),_0xfbbc('0x19'),_0xfbbc('0x1a'),'lastLoginAt','lastPauseAt',_0xfbbc('0x1b'),_0xfbbc('0x1c'),_0xfbbc('0x1d'),_0xfbbc('0x1e'),_0xfbbc('0x1f'),_0xfbbc('0x20'),_0xfbbc('0x21'),_0xfbbc('0x22'),_0xfbbc('0x23'),_0xfbbc('0x24'),'phoneBarExpires',_0xfbbc('0x25'),_0xfbbc('0x26'),_0xfbbc('0x27'),'hotdesk',_0xfbbc('0x28'),_0xfbbc('0x29'),_0xfbbc('0x2a'),_0xfbbc('0x2b'),_0xfbbc('0x2c'),_0xfbbc('0x2d'),_0xfbbc('0x2e'),_0xfbbc('0x2f'),'ignorePauseForPreviewCalls',_0xfbbc('0x30'),_0xfbbc('0x31'),_0xfbbc('0x32'),_0xfbbc('0x33'),_0xfbbc('0x34'),_0xfbbc('0x35'),_0xfbbc('0x36'),_0xfbbc('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xfbbc('0x38'),'whatsappAutoanswer',_0xfbbc('0x39'),_0xfbbc('0x3a')];exports[_0xfbbc('0x3b')]=function(){return this['isAuthenticated'](!![])[_0xfbbc('0x3c')](function(_0x3cc6e5,_0x5e3c66,_0x2f078f){if(_0x3cc6e5[_0xfbbc('0x3d')]){_0x2f078f();}else{return db[_0xfbbc('0x3e')][_0xfbbc('0x3f')]({'where':{'id':_0x3cc6e5[_0xfbbc('0x40')]['id']},'attributes':['id',_0xfbbc('0x41'),_0xfbbc('0x42')],'raw':!![]})[_0xfbbc('0x43')](function(_0xd4ce69){if(_0xd4ce69&&_0xd4ce69[_0xfbbc('0x41')]&&!_0x3cc6e5[_0xfbbc('0x44')][_0xfbbc('0x45')]){return _0x5e3c66[_0xfbbc('0x46')](_0xd4ce69[_0xfbbc('0x42')]==='unmanaged'?0x195:0x193)['json']({'message':_0xd4ce69[_0xfbbc('0x42')]===_0xfbbc('0x47')?_0xfbbc('0x48'):_0xfbbc('0x49')});}else{_0x2f078f();}})[_0xfbbc('0x4a')](function(_0xdfd7b8){_0x2f078f(_0xdfd7b8);});}});};exports['isAuthenticated']=function isAuthenticated(_0x20d12c){return compose()[_0xfbbc('0x3c')](function(_0x3c0884,_0x6759aa,_0x197a8f){var _0x5f007c;if(_0x3c0884[_0xfbbc('0x4b')][_0xfbbc('0x4c')]){if(_[_0xfbbc('0x4d')](_0x3c0884[_0xfbbc('0x4b')][_0xfbbc('0x4c')],_0xfbbc('0x4e'))){var _0x452d98=basicAuth(_0x3c0884);db[_0xfbbc('0x4f')]['find']({'where':{'name':_0x452d98['name']}})[_0xfbbc('0x43')](function(_0x3cb157){if(!_0x3cb157||!_0x3cb157[_0xfbbc('0x50')](_0x452d98['pass'])){return _0x6759aa[_0xfbbc('0x46')](0x191)[_0xfbbc('0x51')]({'message':'Wrong\x20credentials.'});}_0x3c0884[_0xfbbc('0x3d')]={'id':_0x3cb157['id']};_0x197a8f();})[_0xfbbc('0x4a')](function(_0xb14003){_0x197a8f(_0xb14003);});}else if(_[_0xfbbc('0x4d')](_0x3c0884[_0xfbbc('0x4b')][_0xfbbc('0x4c')],_0xfbbc('0x52'))){validateJwt(_0x3c0884,_0x6759aa,_0x197a8f);}else{if(_0x20d12c){_0x197a8f();}else{return _0x6759aa[_0xfbbc('0x46')](0x193)[_0xfbbc('0x51')]({'message':_0xfbbc('0x53')});}}}else if(_0x3c0884[_0xfbbc('0x44')]['apikey']){try{var _0x26808d={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfbbc('0x54')]()};verifyJwt(_0x3c0884[_0xfbbc('0x44')][_0xfbbc('0x55')],_0x26808d)[_0xfbbc('0x43')](function(_0x2b716e){return db[_0xfbbc('0x4f')]['find']({'where':{'id':_0x2b716e['sub']}})[_0xfbbc('0x43')](function(_0x124b64){_0x5f007c=_0x124b64;return db[_0xfbbc('0x56')][_0xfbbc('0x3f')]({'where':{'id':0x1},'attributes':[_0xfbbc('0x57'),_0xfbbc('0x58')],'raw':!![]});})[_0xfbbc('0x43')](function(_0x356074){if(!_0x5f007c||!_[_0xfbbc('0x59')](_0x5f007c[_0xfbbc('0x5a')],_0x2b716e[_0xfbbc('0x5b')])){return _0x6759aa[_0xfbbc('0x46')](0x191)[_0xfbbc('0x51')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x5f007c[_0xfbbc('0x5c')]){return _0x6759aa[_0xfbbc('0x46')](0x191)[_0xfbbc('0x51')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5f007c['blocked']){if(_0x356074['blockDuration']>0x0){if(moment(_0x5f007c['blockedAt'])[_0xfbbc('0x5d')](_0x356074['blockDuration'],_0xfbbc('0x5e'))>moment()){return _0x6759aa[_0xfbbc('0x46')](0x191)[_0xfbbc('0x51')]({'message':_0xfbbc('0x5f')});}}else{return _0x6759aa[_0xfbbc('0x46')](0x191)[_0xfbbc('0x51')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x3c0884['user']={'id':_0x5f007c['id']};_0x197a8f();});})['catch'](function(){return _0x6759aa[_0xfbbc('0x46')](0x191)[_0xfbbc('0x51')]({'message':_0xfbbc('0x5f')});});}catch(_0x2e2c9f){_0x197a8f(_0x2e2c9f);}}else if(_0x20d12c){_0x197a8f();}else{return _0x6759aa[_0xfbbc('0x46')](0x193)[_0xfbbc('0x51')]({'message':_0xfbbc('0x53')});}})[_0xfbbc('0x3c')](function(_0x3f7da0,_0xd52526,_0x1f9320){if(_0x3f7da0[_0xfbbc('0x3d')]){db[_0xfbbc('0x4f')]['find']({'where':{'id':_0x3f7da0[_0xfbbc('0x3d')]['id']},'attributes':userAttributes})[_0xfbbc('0x43')](function(_0x5273d1){if(!_0x5273d1){return _0xd52526[_0xfbbc('0x46')](0x194)[_0xfbbc('0x51')]({'message':_0xfbbc('0x60')});}_0x3f7da0[_0xfbbc('0x3d')]=_0x5273d1;_0x1f9320();})[_0xfbbc('0x4a')](function(_0x10e2b1){_0x1f9320(_0x10e2b1);});}else if(_0x20d12c){_0x1f9320();}else{return _0xd52526[_0xfbbc('0x46')](0x194)[_0xfbbc('0x51')]({'message':_0xfbbc('0x61')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xfbbc('0x3c')](function(_0x3be04a,_0x535aee,_0x4ca30e){return licenseUtil[_0xfbbc('0x62')]()['then'](function(_0x449e6d){if(_0x449e6d['update']){_0x4ca30e();}else{return _0x535aee[_0xfbbc('0x46')](0x193)[_0xfbbc('0x51')]({'message':_0xfbbc('0x63')});}})[_0xfbbc('0x4a')](function(_0x32acfa){_0x4ca30e(_0x32acfa);});});};exports[_0xfbbc('0x64')]=function isWebrtcLicence(){return compose()[_0xfbbc('0x3c')](function(_0x1f2530,_0x4a7dfb,_0x1e57c0){return licenseUtil['getLicense']()[_0xfbbc('0x43')](function(_0x4948e4){if(_0x4948e4[_0xfbbc('0x65')]){_0x1e57c0();}else{return _0x4a7dfb[_0xfbbc('0x46')](0x193)['json']({'message':'Forbidden'});}})[_0xfbbc('0x4a')](function(_0x348eae){_0x1e57c0(_0x348eae);});});};exports['isMiddleware']=function(_0x2dbf50,_0xe5263c,_0x26f01d){_0x2dbf50[_0xfbbc('0x66')]=!![];return _0x26f01d();};exports[_0xfbbc('0x67')]=function signToken(_0x33a490){return signJwt(_0x33a490);};exports[_0xfbbc('0x68')]=function(_0x258b4a,_0x532cf1){if(!_0x258b4a[_0xfbbc('0x3d')]){return _0x532cf1[_0xfbbc('0x46')](0x194)[_0xfbbc('0x51')]({'message':_0xfbbc('0x69')});}var _0x379e41={'payload':{'id':_0x258b4a[_0xfbbc('0x3d')]['id'],'role':_0x258b4a[_0xfbbc('0x3d')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x379e41)[_0xfbbc('0x43')](function(_0x893ae2){_0x532cf1[_0xfbbc('0x6a')](_0xfbbc('0x6b'),_0x893ae2);_0x532cf1['redirect'](_0xfbbc('0x6c'));})['catch'](function(_0x261138){return _0x532cf1[_0xfbbc('0x46')](0x1f4)[_0xfbbc('0x6d')](_0x261138);});};exports['retrieveApiKey']=function(_0x428c69){if(_[_0xfbbc('0x6e')](_0x428c69[_0xfbbc('0x5a')])||_[_0xfbbc('0x6e')](_0x428c69['apiKeyIat'])){return null;}else{return createJwt(_0x428c69);}};exports['generateApiKey']=function(_0xbb2487){_0xbb2487['apiKeyNonce']=generateNonce();_0xbb2487[_0xfbbc('0x6f')]=generateIssuedAt();return createJwt(_0xbb2487);};exports['regenerateApiKey']=function(_0x10d313,_0x201e4c){var _0x2f832a=_0x10d313[_0xfbbc('0x44')][_0xfbbc('0x55')];if(_0x2f832a){var _0x49a6ba={'nonce':_0x201e4c['apiKeyNonce'],'iat':_0x201e4c['apiKeyIat'],'audience':hardwareConf[_0xfbbc('0x54')](),'issuer':hardwareConf[_0xfbbc('0x54')]()};return verifyJwt(_0x2f832a,_0x49a6ba)['then'](function(){return generateApiKey(_0x201e4c);});}else{throw{'message':_0xfbbc('0x70')};}};exports[_0xfbbc('0x71')]=function(_0x5904b3){var _0x352181=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x352181[_0xfbbc('0x72')](_0x5904b3))throw new db[(_0xfbbc('0x73'))][(_0xfbbc('0x74'))](_0xfbbc('0x75'));return;};exports[_0xfbbc('0x76')]=function(_0x2b1281,_0x50f8e6,_0x48e64e){var _0x218d38=encryptor['decryptString'](_0x50f8e6)[_0xfbbc('0x77')](',');for(var _0x16dc30=0x0;_0x16dc30<_0x48e64e;_0x16dc30++){if(!_0x218d38[_0x16dc30])break;if(_0x2b1281[_0xfbbc('0x78')]()===_0x218d38[_0x16dc30][_0xfbbc('0x78')]()){var _0x3092ab=util[_0xfbbc('0x79')](_0xfbbc('0x7a'),_0x48e64e);if(_0x48e64e===0x1){_0x3092ab=_0xfbbc('0x7b');}throw new db['Sequelize'][(_0xfbbc('0x74'))](_0x3092ab);}}return;};exports['updatePasswordsHistory']=function(_0x2654e8,_0x7d40c5){var _0x221dd3=_0x7d40c5?encryptor[_0xfbbc('0x7c')](_0x7d40c5)['split'](','):[];if(_0x221dd3[_0xfbbc('0x7d')]===0x5){_0x221dd3['splice'](-0x1,0x1);}_0x221dd3[_0xfbbc('0x7e')](_0x2654e8);return encryptor[_0xfbbc('0x7f')](_0x221dd3['join'](','));};function signJwt(_0x1382ba){var _0x1a8f67=BPromise[_0xfbbc('0x80')](jwt[_0xfbbc('0x81')],{'context':jwt});var _0x191d53=_0x1382ba[_0xfbbc('0x82')]||config[_0xfbbc('0xd')]['session'];return new BPromise(function(_0x4c077d,_0x31e09a){_0x1a8f67(_0x1382ba[_0xfbbc('0x83')],_0x191d53,_0x1382ba[_0xfbbc('0x84')])['then'](function(_0x463963){_0x4c077d(_0x463963);})['catch'](function(_0x2ddca7){_0x31e09a(_0x2ddca7);});});}function verifyJwt(_0x218a81,_0x3e34ef,_0x4f7062){var _0x1f0b2c=BPromise[_0xfbbc('0x80')](jwt[_0xfbbc('0x85')],{'context':jwt});var _0xa16948=_0x4f7062||config[_0xfbbc('0xd')][_0xfbbc('0xe')];return new BPromise(function(_0x320b30,_0x1f1465){_0x1f0b2c(_0x218a81,_0xa16948,_0x3e34ef)[_0xfbbc('0x43')](function(_0x19e30a){_0x320b30(_0x19e30a);})[_0xfbbc('0x4a')](function(_0x1835ca){_0x1f1465(_0x1835ca);});});}function generateNonce(){return crypto[_0xfbbc('0x86')](0x10)[_0xfbbc('0x87')](_0xfbbc('0x88'));}function generateIssuedAt(){return Math[_0xfbbc('0x89')](Date[_0xfbbc('0x8a')]()/0x3e8)[_0xfbbc('0x87')]();}function createJwt(_0x55d65d){var _0x389eea={'payload':{'iat':_0x55d65d['apiKeyIat'],'nonce':_0x55d65d['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x55d65d['id'][_0xfbbc('0x87')](),'issuer':hardwareConf[_0xfbbc('0x54')](),'audience':hardwareConf[_0xfbbc('0x54')]()}};return signJwt(_0x389eea)[_0xfbbc('0x43')](function(_0x2a07f8){return{'iat':_0x55d65d[_0xfbbc('0x6f')],'nonce':_0x55d65d['apiKeyNonce'],'token':_0x2a07f8};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index dc60d3a..adb865b 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 _0x1035=['describe','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter','user','clause','skip','ids','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows','catch','CmContact'];(function(_0x485430,_0x33b15f){var _0x1558da=function(_0x51f6b6){while(--_0x51f6b6){_0x485430['push'](_0x485430['shift']());}};_0x1558da(++_0x33b15f);}(_0x1035,0x116));var _0x5103=function(_0x455d02,_0x51dfb1){_0x455d02=_0x455d02-0x0;var _0x1fa776=_0x1035[_0x455d02];return _0x1fa776;};'use strict';var _=require(_0x5103('0x0'));var sqlUtils=require(_0x5103('0x1'));var db=require(_0x5103('0x2'))['db'];exports[_0x5103('0x3')]=function(_0x461241,_0x5d59f8,_0x4fcb1c,_0x5330f7){var _0x3f85fa={'count':0x0,'rows':[]};var _0x551b2e=sqlUtils[_0x5103('0x4')](_0x5d59f8,_0x461241);if(_0x551b2e){return Promise[_0x5103('0x5')](_0x3f85fa);}var _0x23ac77=sqlUtils['getContactsSubquery']();var _0x49d945={};var _0xb6bf8e=![];var _0x31d7c9=![];return Promise['resolve']()[_0x5103('0x6')](function(){if(_0x461241[_0x5103('0x7')]){return sqlUtils[_0x5103('0x8')](_0x461241['search'],_0x5330f7);}else{return sqlUtils[_0x5103('0x9')](_0x461241,_0x5330f7);}})[_0x5103('0x6')](function(_0x240831){_0x23ac77['where'](_0x240831[_0x5103('0xa')]);_0x23ac77[_0x5103('0xb')](_0x240831[_0x5103('0xc')]);_0x23ac77[_0x5103('0xb')](_0x240831[_0x5103('0xd')]);_0x23ac77[_0x5103('0xb')](_0x240831[_0x5103('0xe')][_0x5103('0xf')]);_0x49d945=_0x240831['tags'];_0x31d7c9=_0x240831[_0x5103('0xe')][_0x5103('0x10')];return sqlUtils['checkListsRestrictions'](_0x5d59f8,_0x461241,_0x31d7c9);})[_0x5103('0x6')](function(_0x3fded9){_0x23ac77['where'](_0x3fded9);var _0x5be479=_0x461241[_0x5103('0x7')]?_0x49d945[_0x5103('0x11')]:_0x461241['tag'];_0xb6bf8e=_0x5be479?!![]:![];return sqlUtils[_0x5103('0x12')](_0x23ac77,_0x5be479);})['then'](function(_0x1f441b){_0x3f85fa['count']=_0x1f441b;if(_0x3f85fa[_0x5103('0x13')]===0x0){return;}if(_0x461241[_0x5103('0x14')]){_0x31d7c9=!![];}return sqlUtils[_0x5103('0x15')](_0x23ac77,_0x461241[_0x5103('0xc')],_0x4fcb1c,_0xb6bf8e,_0x49d945['clause'],_0x31d7c9);})[_0x5103('0x6')](function(_0x4066a5){if(!_0x4066a5){return[];}return sqlUtils[_0x5103('0x16')](_0x4066a5,_0x461241,_0x4fcb1c);})[_0x5103('0x6')](function(_0x5a2c78){_0x3f85fa[_0x5103('0x17')]=_0x5a2c78;return _0x3f85fa;})[_0x5103('0x18')](function(_0x212282){throw _0x212282;});};exports['describe']=function(){var _0x403cae={};var _0x1c577c=[];return db[_0x5103('0x19')][_0x5103('0x1a')]()[_0x5103('0x6')](function(_0x58f550){_0x403cae=_0x58f550;var _0x38fbf2=Object[_0x5103('0x1b')](_0x403cae)['filter'](function(_0x49a5f3){return _[_0x5103('0x1c')](_0x49a5f3,_0x5103('0x1d'))?_0x49a5f3:undefined;});var _0xdbbdb=_0x38fbf2[_0x5103('0x1e')](function(_0x461f5e){return db[_0x5103('0x1f')][_0x5103('0x20')]({'where':{'id':_0x461f5e[_0x5103('0x21')](0x3)},'raw':!![]});});return Promise[_0x5103('0x22')](_0xdbbdb);})[_0x5103('0x6')](function(_0x1ff29e){for(var _0x454172=0x0;_0x454172<_0x1ff29e[_0x5103('0x23')];_0x454172++){if(_0x1ff29e[_0x454172]){var _0x1f2de2=_0x5103('0x1d')+_0x1ff29e[_0x454172]['id'];_0x403cae[_0x1f2de2][_0x5103('0x24')]=_0x1ff29e[_0x454172][_0x5103('0x25')];}}_0x1c577c=_[_0x5103('0x1e')](Object['keys'](_0x403cae),function(_0x4b39ed){return{'name':_0x4b39ed,'type':_0x403cae[_0x4b39ed][_0x5103('0x25')]};});return _0x1c577c;})[_0x5103('0x18')](function(_0x1fad65){throw _0x1fad65;});}; \ No newline at end of file +var _0xe82c=['describe','CmContact','keys','cf_','findOne','slice','all','length','fieldType','type','map','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','skip','checkListsRestrictions','then','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe82c,0xdd));var _0xce82=function(_0x1e27e1,_0x7a1007){_0x1e27e1=_0x1e27e1-0x0;var _0x196c2b=_0xe82c[_0x1e27e1];return _0x196c2b;};'use strict';var _=require('lodash');var sqlUtils=require(_0xce82('0x0'));var db=require(_0xce82('0x1'))['db'];exports[_0xce82('0x2')]=function(_0x4eb1aa,_0x42de27,_0x4bc735,_0xed5567){var _0x125fe3={'count':0x0,'rows':[]};var _0x43fe9a=sqlUtils[_0xce82('0x3')](_0x42de27,_0x4eb1aa);if(_0x43fe9a){return Promise[_0xce82('0x4')](_0x125fe3);}var _0x2d7f61=sqlUtils[_0xce82('0x5')]();var _0x5650b1={};var _0x22a5ff=![];var _0x51eed8=![];return Promise[_0xce82('0x4')]()['then'](function(){if(_0x4eb1aa[_0xce82('0x6')]){return sqlUtils[_0xce82('0x7')](_0x4eb1aa['search'],_0xed5567);}else{return sqlUtils[_0xce82('0x8')](_0x4eb1aa,_0xed5567);}})['then'](function(_0x5f8f4e){_0x2d7f61[_0xce82('0x9')](_0x5f8f4e[_0xce82('0xa')]);_0x2d7f61[_0xce82('0x9')](_0x5f8f4e[_0xce82('0xb')]);_0x2d7f61[_0xce82('0x9')](_0x5f8f4e[_0xce82('0xc')]);_0x2d7f61['where'](_0x5f8f4e[_0xce82('0xd')][_0xce82('0xe')]);_0x5650b1=_0x5f8f4e['tags'];_0x51eed8=_0x5f8f4e[_0xce82('0xd')][_0xce82('0xf')];return sqlUtils[_0xce82('0x10')](_0x42de27,_0x4eb1aa,_0x51eed8);})[_0xce82('0x11')](function(_0x2c1891){_0x2d7f61[_0xce82('0x9')](_0x2c1891);var _0x4e7b25=_0x4eb1aa['search']?_0x5650b1['ids']:_0x4eb1aa[_0xce82('0x12')];_0x22a5ff=_0x4e7b25?!![]:![];return sqlUtils[_0xce82('0x13')](_0x2d7f61,_0x4e7b25);})[_0xce82('0x11')](function(_0x435225){_0x125fe3[_0xce82('0x14')]=_0x435225;if(_0x125fe3[_0xce82('0x14')]===0x0){return;}if(_0x4eb1aa[_0xce82('0x15')]){_0x51eed8=!![];}return sqlUtils[_0xce82('0x16')](_0x2d7f61,_0x4eb1aa[_0xce82('0xb')],_0x4bc735,_0x22a5ff,_0x5650b1[_0xce82('0xe')],_0x51eed8);})[_0xce82('0x11')](function(_0x54cdf6){if(!_0x54cdf6){return[];}return sqlUtils[_0xce82('0x17')](_0x54cdf6,_0x4eb1aa,_0x4bc735);})['then'](function(_0x87fb62){_0x125fe3['rows']=_0x87fb62;return _0x125fe3;})['catch'](function(_0x32e89a){throw _0x32e89a;});};exports[_0xce82('0x18')]=function(){var _0x36fa89={};var _0x219185=[];return db[_0xce82('0x19')][_0xce82('0x18')]()[_0xce82('0x11')](function(_0x3bbd00){_0x36fa89=_0x3bbd00;var _0x40d19f=Object[_0xce82('0x1a')](_0x36fa89)[_0xce82('0xc')](function(_0x22eed6){return _['startsWith'](_0x22eed6,_0xce82('0x1b'))?_0x22eed6:undefined;});var _0x16f043=_0x40d19f['map'](function(_0x5680fa){return db['CmCustomField'][_0xce82('0x1c')]({'where':{'id':_0x5680fa[_0xce82('0x1d')](0x3)},'raw':!![]});});return Promise[_0xce82('0x1e')](_0x16f043);})[_0xce82('0x11')](function(_0x56e80c){for(var _0x5da9a4=0x0;_0x5da9a4<_0x56e80c[_0xce82('0x1f')];_0x5da9a4++){if(_0x56e80c[_0x5da9a4]){var _0x2ecaef=_0xce82('0x1b')+_0x56e80c[_0x5da9a4]['id'];_0x36fa89[_0x2ecaef][_0xce82('0x20')]=_0x56e80c[_0x5da9a4][_0xce82('0x21')];}}_0x219185=_[_0xce82('0x22')](Object[_0xce82('0x1a')](_0x36fa89),function(_0x1d9bd5){return{'name':_0x1d9bd5,'type':_0x36fa89[_0x1d9bd5][_0xce82('0x21')]};});return _0x219185;})['catch'](function(_0x584ab1){throw _0x584ab1;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index c626818..9c91d92 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 _0x9383=['\x20=\x20?','resolve','then','filter','getLists','c.ListId\x20IN\x20?','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','toString','Tags','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','sequelize','exports','lodash','squel','../parsers/advancedSearch','role','agent','search','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','phone','mobile','fax','ListId','CompanyId','createdAt','updatedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','find','dateOfBirth','fieldType','datetime','castTo','DATE','type','default','text','value','start','end','Tag','map','tags','clause','and','ids','user','uc.UserId\x20=\x20?','skip','keys','some','name','Contact','push','User','concat'];(function(_0xa76f70,_0x115a75){var _0x24459b=function(_0x425831){while(--_0x425831){_0xa76f70['push'](_0xa76f70['shift']());}};_0x24459b(++_0x115a75);}(_0x9383,0x1b7));var _0x3938=function(_0x9cb3c2,_0x4805d0){_0x9cb3c2=_0x9cb3c2-0x0;var _0x25ffe1=_0x9383[_0x9cb3c2];return _0x25ffe1;};'use strict';var _=require(_0x3938('0x0'));var squel=require(_0x3938('0x1'));var as=require(_0x3938('0x2'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x2edc69,_0x27bf57){var _0x271888=![];if(_0x2edc69[_0x3938('0x3')]===_0x3938('0x4')&&!_0x27bf57[_0x3938('0x5')]&&!_0x27bf57['ListId']&&_0x27bf57[_0x3938('0x6')]!==_0x3938('0x7')){_0x271888=!![];}return _0x271888;}function getContactsSubquery(){return squel[_0x3938('0x8')]()[_0x3938('0x9')](_0x3938('0xa'),'c')['where'](_0x3938('0xb'));}function applyJoinClauses(_0xf5acde,_0x5dd147){var _0x1c02db=_0x5dd147?'c':_0x3938('0xc');_0xf5acde[_0x3938('0xd')](_0x3938('0xe'),'uc',_0x3938('0xf')+_0x1c02db+_0x3938('0x10'))[_0x3938('0xd')]('cm_contact_has_tags','ct',_0x3938('0x11')+_0x1c02db+_0x3938('0x10'))[_0x3938('0xd')]('tools_tags','t',_0x3938('0x12'));return _0xf5acde;}function addFieldsToQuery(_0x421091,_0x20fde5,_0x559ab7,_0x5ef93d,_0x39e944){var _0x2c2aac=_0x39e944?'c':_0x3938('0xc');if(!_0x20fde5){_0x20fde5=['id','firstName','lastName',_0x3938('0x13'),_0x3938('0x14'),_0x3938('0x15'),'email',_0x3938('0x16'),_0x3938('0x17'),_0x3938('0x18'),_0x3938('0x19'),'deletedAt',_0x3938('0x1a')];}else if(!_0x20fde5[_0x3938('0x1b')]('id')){_0x20fde5['push']('id');}var _0x3adfa8=_0x559ab7&&_0x39e944||!_0x559ab7&&!_0x39e944;if(_0x5ef93d){_0x3adfa8=_0x5ef93d&&_0x39e944||!_0x5ef93d&&!_0x39e944;}_0x20fde5[_0x3938('0x1c')](function(_0x5549b8){if(_0x5549b8===_0x3938('0x1a')){if(_0x3adfa8){_0x421091[_0x3938('0x1d')](_0x3938('0x1e'),_0x5549b8);}else if(_0x559ab7||_0x5ef93d){_0x421091[_0x3938('0x1d')](_0x2c2aac+'.'+_0x5549b8);}}else{_0x421091[_0x3938('0x1d')](_0x2c2aac+'.'+_0x5549b8);}});return _0x421091;}function getSqlClauses(){var _0x586ccf={'default':squel['expr'](),'fields':squel[_0x3938('0x1f')](),'filter':squel[_0x3938('0x1f')](),'tags':{'clause':squel[_0x3938('0x1f')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x586ccf;}function parseTagParameter(_0x3e109d){var _0x208a66=squel['expr']();if(_0x3e109d){var _0x53b394=utils[_0x3938('0x20')](_0x3e109d);_0x53b394['forEach'](function(_0x303c3f){_0x208a66['or'](_0x3938('0x21'),'%,'+_0x303c3f+',%');});}return _0x208a66;}function parseSearchFilter(_0xda974d){var _0x442e79=squel[_0x3938('0x1f')]();if(_0xda974d){var _0x246bbc=_0xda974d[_0x3938('0x22')]('\x5c','\x5c\x5c')[_0x3938('0x22')](/'/g,'\x27\x27');if(_0x246bbc[_0x3938('0x23')]('\x20')[_0x3938('0x24')]>0x1){_0x442e79['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x246bbc,!![]),null);}else{if(qs['isNumeric'](_0x246bbc)){_0x442e79['or'](_0x3938('0x25'),_0x246bbc+'%');_0x442e79['or'](_0x3938('0x26'),_0x246bbc+'%');_0x442e79['or']('c.mobile\x20LIKE\x20?',_0x246bbc+'%');_0x442e79['or']('c.fax\x20LIKE\x20?',_0x246bbc+'%');}else if(qs[_0x3938('0x27')](_0x246bbc)){_0x442e79['or'](_0x3938('0x28'),_0x246bbc+'%');}else{_0x442e79['or']('c.firstName\x20LIKE\x20?','%'+_0x246bbc+'%');_0x442e79['or']('c.lastName\x20LIKE\x20?','%'+_0x246bbc+'%');_0x442e79['or'](_0x3938('0x28'),'%'+_0x246bbc+'%');}}}return _0x442e79;}function parseAdvancedSearchFilter(_0x32ac67,_0x5b720d){var _0x53e9e6=getSqlClauses();var _0x571222=as[_0x3938('0x29')](_0x32ac67);var _0x3d2da7=_0x571222['sqlOperator'];for(var _0x319a99=0x0;_0x319a99<_0x571222[_0x3938('0x2a')][_0x3938('0x24')];_0x319a99++){var _0x10eb4d=_0x571222[_0x3938('0x2a')][_0x319a99];var _0x30fb4a='c';var _0x1d8df1=_[_0x3938('0x2b')](_0x5b720d,['name',_0x10eb4d[_0x3938('0x1d')]]);if(_0x1d8df1){if(_0x10eb4d['field']===_0x3938('0x2c')||_0x1d8df1[_0x3938('0x2d')]===_0x3938('0x2e')){_0x10eb4d[_0x3938('0x2f')]=_0x3938('0x30');}var _0x249472=as['buildExpression'](_0x30fb4a,_0x1d8df1[_0x3938('0x31')],_0x10eb4d);_0x53e9e6[_0x3938('0x32')][_0x3d2da7](_0x249472[_0x3938('0x33')],_0x249472[_0x3938('0x34')][_0x3938('0x35')],_0x249472['value'][_0x3938('0x36')]);}else{if(_0x10eb4d[_0x3938('0x1d')]===_0x3938('0x37')){var _0x2c0445=_0x10eb4d[_0x3938('0x34')]['split'](',')[_0x3938('0x38')](function(_0x3807aa){return Number(_0x3807aa);});var _0x56b762=parseTagParameter(_0x2c0445);_0x53e9e6[_0x3938('0x39')][_0x3938('0x3a')][_0x3938('0x3b')](_0x56b762);_0x53e9e6['tags'][_0x3938('0x3c')]=_0x2c0445;}else if(_0x10eb4d[_0x3938('0x1d')]==='User'){_0x53e9e6[_0x3938('0x3d')]['clause'][_0x3938('0x3b')](_0x3938('0x3e'),_0x10eb4d['value']);_0x53e9e6[_0x3938('0x3d')][_0x3938('0x3f')]=!![];}}}return _0x53e9e6;}function parseModelFields(_0x4d2964,_0x221c1f){var _0x509c16=squel['expr']();var _0x4417e6=_(_0x4d2964)[_0x3938('0x40')]()[_0x3938('0x38')](function(_0x3ac788){return _[_0x3938('0x41')](_0x221c1f,[_0x3938('0x42'),_0x3ac788])?_0x3ac788:undefined;})['compact']()['value']();if(_0x4d2964[_0x3938('0x43')]){_0x4417e6[_0x3938('0x44')](_0x3938('0x43'));}if(_0x4d2964['User']){_0x4417e6[_0x3938('0x44')](_0x3938('0x45'));}if(_0x4417e6['length']>0x0){_0x4417e6[_0x3938('0x1c')](function(_0xaf8344){if(_0xaf8344==='ListId'){_0x509c16[_0x3938('0x3b')]('c.ListId\x20IN\x20?',[][_0x3938('0x46')](_0x4d2964[_0xaf8344]));}else if(_0xaf8344===_0x3938('0x43')){var _0x1e4461='%'+_0x4d2964[_0xaf8344]+'%';_0x509c16[_0x3938('0x3b')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x1e4461);}else if(_0xaf8344===_0x3938('0x45')){_0x509c16['and'](_0x3938('0x3e'),_0x4d2964[_0xaf8344]);}else{_0x509c16[_0x3938('0x3b')]('c.'+_0xaf8344+_0x3938('0x47'),_0x4d2964[_0xaf8344]);}});}return _0x509c16;}function parseQueryParameters(_0x515661,_0x52e2b6){var _0x1c9c1e=getSqlClauses();return Promise[_0x3938('0x48')]()[_0x3938('0x49')](function(){return parseModelFields(_0x515661,_0x52e2b6);})[_0x3938('0x49')](function(_0x17b39c){_0x1c9c1e['fields'][_0x3938('0x3b')](_0x17b39c);return parseTagParameter(_0x515661['tag']);})[_0x3938('0x49')](function(_0x2359e7){_0x1c9c1e[_0x3938('0x39')]['clause'][_0x3938('0x3b')](_0x2359e7);return parseSearchFilter(_0x515661[_0x3938('0x4a')]);})[_0x3938('0x49')](function(_0x459fcf){_0x1c9c1e[_0x3938('0x4a')]=_0x459fcf;return _0x1c9c1e;});}function checkListsRestrictions(_0x45816a,_0x5f0929,_0x27deed){var _0x383a87=squel['expr']();return Promise[_0x3938('0x48')]()[_0x3938('0x49')](function(){if(_0x5f0929[_0x3938('0x5')]&&_0x45816a['role']===_0x3938('0x4')&&!_0x27deed){return _0x45816a[_0x3938('0x4b')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x68d5d4){if(_0x68d5d4){if(_0x68d5d4[_0x3938('0x24')]===0x0){_0x383a87['and']('c.ListId\x20IS\x20NULL');}else{_0x383a87[_0x3938('0x3b')](_0x3938('0x4c'),_['map'](_0x68d5d4,'id'));}}})['then'](function(){return _0x383a87;});}function buildContactsQuery(_0x53e954,_0xb34e5b,_0x33e16a,_0x16eeca,_0x5e314f,_0x69000e){if(_0xb34e5b){_0xb34e5b=_0x33e16a['attributes'];}_0x53e954=addFieldsToQuery(_0x53e954,_0xb34e5b,_0x16eeca,_0x69000e,!![]);var _0x1c3342=squel[_0x3938('0x8')]();_0x1c3342=addFieldsToQuery(_0x1c3342,_0xb34e5b,_0x16eeca,_0x69000e,![]);if(_0x16eeca||_0x69000e){_0x53e954=applyJoinClauses(_0x53e954,!![]);_0x53e954[_0x3938('0x4d')](_0x3938('0x4e'));if(_0x33e16a['limit']){_0x1c3342[_0x3938('0x4f')](_0x33e16a['limit']);}if(_0x33e16a[_0x3938('0x50')]){_0x1c3342['offset'](_0x33e16a['offset']);}}else{_0x1c3342=applyJoinClauses(_0x1c3342,![]);_0x1c3342[_0x3938('0x4d')](_0x3938('0x51'));if(_0x33e16a[_0x3938('0x4f')]){_0x53e954[_0x3938('0x4f')](_0x33e16a['limit']);}if(_0x33e16a[_0x3938('0x50')]){_0x53e954[_0x3938('0x50')](_0x33e16a['offset']);}}_0x1c3342[_0x3938('0x52')](_0x5e314f);if(_0x33e16a[_0x3938('0x53')]){_0x33e16a['order'][_0x3938('0x1c')](function(_0x27e2cd){_0x53e954['order']('c.'+_0x27e2cd[0x0],_0x27e2cd[0x1]===_0x3938('0x54')?![]:!![]);_0x1c3342['order'](_0x3938('0x55')+_0x27e2cd[0x0],_0x27e2cd[0x1]==='DESC'?![]:!![]);});}_0x1c3342[_0x3938('0x9')](_0x53e954,_0x3938('0xc'));return _0x1c3342;}function getFilteredContacts(_0x5385d1){var _0x3dc597=[];return db[_0x3938('0x37')][_0x3938('0x56')]({'attributes':['id',_0x3938('0x42'),_0x3938('0x57')],'raw':!![]})[_0x3938('0x49')](function(_0x37d37a){_0x3dc597=_[_0x3938('0x58')](_0x37d37a,'id');var _0x4f7b0d={'type':db[_0x3938('0x59')][_0x3938('0x5a')][_0x3938('0x5b')],'model':db[_0x3938('0x5c')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x5385d1[_0x3938('0x5d')](),_0x4f7b0d);})[_0x3938('0x49')](function(_0x2db955){_0x2db955['forEach'](function(_0x334cee){if(_0x334cee['TagIds']){_0x334cee[_0x3938('0x5e')]=[];_0x334cee[_0x3938('0x1a')][_0x3938('0x23')](',')[_0x3938('0x1c')](function(_0x2f33a8){_0x334cee[_0x3938('0x5e')][_0x3938('0x44')](_0x3dc597[_0x2f33a8]);});}delete _0x334cee[_0x3938('0x1a')];});return _0x2db955;});}function countFilteredContacts(_0x18b913,_0x59dccd){var _0x21ac34=_0x18b913[_0x3938('0x5f')]();_0x21ac34['field'](_0x3938('0x60'));_0x21ac34=applyJoinClauses(_0x21ac34,!![]);_0x18b913[_0x3938('0x4d')](_0x3938('0x4e'));var _0x26cf81=utils[_0x3938('0x20')](_0x59dccd);if(!_[_0x3938('0x61')](_0x26cf81)){_0x21ac34[_0x3938('0x62')](_0x3938('0x63'),_0x26cf81);}var _0x5c00d2={'type':db[_0x3938('0x59')]['QueryTypes'][_0x3938('0x5b')],'raw':!![]};return db[_0x3938('0x64')]['query'](_0x21ac34[_0x3938('0x5d')](),_0x5c00d2)['then'](function(_0x5f0673){return _0x5f0673[0x0]['COUNT(*)'];});}module[_0x3938('0x65')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xe9ec=['agent','search','ListId','true','from','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','email','CompanyId','updatedAt','deletedAt','TagIds','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','getFullTextValue','c.mobile\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','dateOfBirth','castTo','DATE','text','value','start','end','Tag','split','map','clause','and','tags','ids','user','uc.UserId\x20=\x20?','keys','compact','Contact','User','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','getLists','select','group','limit','offset','having','order','DESC','subqry.','findAll','name','keyBy','Sequelize','QueryTypes','SELECT','sequelize','query','toString','Tags','clone','COUNT(*)','c.id','isEmpty','where','exports','lodash','squel','../interaction/utils','../../mysqldb'];(function(_0x533381,_0x8a69fa){var _0x2877ed=function(_0x45cb54){while(--_0x45cb54){_0x533381['push'](_0x533381['shift']());}};_0x2877ed(++_0x8a69fa);}(_0xe9ec,0x1e6));var _0xce9e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe9ec[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xce9e('0x0'));var squel=require(_0xce9e('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var utils=require(_0xce9e('0x2'));var db=require(_0xce9e('0x3'))['db'];function skipContactsQuery(_0x154700,_0x3cfd32){var _0x2d445f=![];if(_0x154700['role']===_0xce9e('0x4')&&!_0x3cfd32[_0xce9e('0x5')]&&!_0x3cfd32[_0xce9e('0x6')]&&_0x3cfd32['autocomplete']!==_0xce9e('0x7')){_0x2d445f=!![];}return _0x2d445f;}function getContactsSubquery(){return squel['select']()[_0xce9e('0x8')]('cm_contacts','c')['where'](_0xce9e('0x9'));}function applyJoinClauses(_0x18af6a,_0x3f3364){var _0x48e569=_0x3f3364?'c':_0xce9e('0xa');_0x18af6a[_0xce9e('0xb')](_0xce9e('0xc'),'uc','uc.CmContactId\x20=\x20'+_0x48e569+_0xce9e('0xd'))[_0xce9e('0xb')](_0xce9e('0xe'),'ct',_0xce9e('0xf')+_0x48e569+_0xce9e('0xd'))[_0xce9e('0xb')](_0xce9e('0x10'),'t',_0xce9e('0x11'));return _0x18af6a;}function addFieldsToQuery(_0x470ba0,_0x20fd62,_0x3cb017,_0x31b72f,_0x3e9e87){var _0x10d1ca=_0x3e9e87?'c':_0xce9e('0xa');if(!_0x20fd62){_0x20fd62=['id',_0xce9e('0x12'),_0xce9e('0x13'),_0xce9e('0x14'),_0xce9e('0x15'),'fax',_0xce9e('0x16'),'ListId',_0xce9e('0x17'),'createdAt',_0xce9e('0x18'),_0xce9e('0x19'),_0xce9e('0x1a')];}else if(!_0x20fd62['includes']('id')){_0x20fd62[_0xce9e('0x1b')]('id');}var _0x142a57=_0x3cb017&&_0x3e9e87||!_0x3cb017&&!_0x3e9e87;if(_0x31b72f){_0x142a57=_0x31b72f&&_0x3e9e87||!_0x31b72f&&!_0x3e9e87;}_0x20fd62[_0xce9e('0x1c')](function(_0x204886){if(_0x204886===_0xce9e('0x1a')){if(_0x142a57){_0x470ba0[_0xce9e('0x1d')](_0xce9e('0x1e'),_0x204886);}else if(_0x3cb017||_0x31b72f){_0x470ba0[_0xce9e('0x1d')](_0x10d1ca+'.'+_0x204886);}}else{_0x470ba0['field'](_0x10d1ca+'.'+_0x204886);}});return _0x470ba0;}function getSqlClauses(){var _0x80198d={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0xce9e('0x1f')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x80198d;}function parseTagParameter(_0x239083){var _0x58c165=squel[_0xce9e('0x1f')]();if(_0x239083){var _0x2df602=utils[_0xce9e('0x20')](_0x239083);_0x2df602[_0xce9e('0x1c')](function(_0x4df614){_0x58c165['or'](_0xce9e('0x21'),'%,'+_0x4df614+',%');});}return _0x58c165;}function parseSearchFilter(_0x4172b4){var _0x1eb930=squel[_0xce9e('0x1f')]();if(_0x4172b4){var _0x44ec91=_0x4172b4['replace']('\x5c','\x5c\x5c')[_0xce9e('0x22')](/'/g,'\x27\x27');if(_0x44ec91['split']('\x20')[_0xce9e('0x23')]>0x1){_0x1eb930['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xce9e('0x24')](_0x44ec91,!![]),null);}else{if(qs['isNumeric'](_0x44ec91)){_0x1eb930['or']('c.id\x20LIKE\x20?',_0x44ec91+'%');_0x1eb930['or']('c.phone\x20LIKE\x20?',_0x44ec91+'%');_0x1eb930['or'](_0xce9e('0x25'),_0x44ec91+'%');_0x1eb930['or']('c.fax\x20LIKE\x20?',_0x44ec91+'%');}else if(qs['isEmail'](_0x44ec91)){_0x1eb930['or'](_0xce9e('0x26'),_0x44ec91+'%');}else{_0x1eb930['or'](_0xce9e('0x27'),'%'+_0x44ec91+'%');_0x1eb930['or'](_0xce9e('0x28'),'%'+_0x44ec91+'%');_0x1eb930['or'](_0xce9e('0x26'),'%'+_0x44ec91+'%');}}}return _0x1eb930;}function parseAdvancedSearchFilter(_0x300cdb,_0x4dbc0f){var _0x49d297=getSqlClauses();var _0xab6c0c=as[_0xce9e('0x29')](_0x300cdb);var _0x110cf7=_0xab6c0c['sqlOperator'];for(var _0x2af6d2=0x0;_0x2af6d2<_0xab6c0c[_0xce9e('0x2a')][_0xce9e('0x23')];_0x2af6d2++){var _0x2d2c51=_0xab6c0c[_0xce9e('0x2a')][_0x2af6d2];var _0x3e2180='c';var _0x26fb90=_[_0xce9e('0x2b')](_0x4dbc0f,['name',_0x2d2c51[_0xce9e('0x1d')]]);if(_0x26fb90){if(_0x2d2c51['field']===_0xce9e('0x2c')||_0x26fb90['fieldType']==='datetime'){_0x2d2c51[_0xce9e('0x2d')]=_0xce9e('0x2e');}var _0x43152f=as['buildExpression'](_0x3e2180,_0x26fb90['type'],_0x2d2c51);_0x49d297['default'][_0x110cf7](_0x43152f[_0xce9e('0x2f')],_0x43152f[_0xce9e('0x30')][_0xce9e('0x31')],_0x43152f[_0xce9e('0x30')][_0xce9e('0x32')]);}else{if(_0x2d2c51[_0xce9e('0x1d')]===_0xce9e('0x33')){var _0x57a1f8=_0x2d2c51[_0xce9e('0x30')][_0xce9e('0x34')](',')[_0xce9e('0x35')](function(_0x3ffb52){return Number(_0x3ffb52);});var _0x31141b=parseTagParameter(_0x57a1f8);_0x49d297['tags'][_0xce9e('0x36')][_0xce9e('0x37')](_0x31141b);_0x49d297[_0xce9e('0x38')][_0xce9e('0x39')]=_0x57a1f8;}else if(_0x2d2c51[_0xce9e('0x1d')]==='User'){_0x49d297[_0xce9e('0x3a')][_0xce9e('0x36')]['and'](_0xce9e('0x3b'),_0x2d2c51['value']);_0x49d297['user']['skip']=!![];}}}return _0x49d297;}function parseModelFields(_0x3193b6,_0x4b015e){var _0x44a85b=squel[_0xce9e('0x1f')]();var _0x5efa3e=_(_0x3193b6)[_0xce9e('0x3c')]()[_0xce9e('0x35')](function(_0x4fe823){return _['some'](_0x4b015e,['name',_0x4fe823])?_0x4fe823:undefined;})[_0xce9e('0x3d')]()[_0xce9e('0x30')]();if(_0x3193b6[_0xce9e('0x3e')]){_0x5efa3e[_0xce9e('0x1b')](_0xce9e('0x3e'));}if(_0x3193b6[_0xce9e('0x3f')]){_0x5efa3e[_0xce9e('0x1b')](_0xce9e('0x3f'));}if(_0x5efa3e[_0xce9e('0x23')]>0x0){_0x5efa3e[_0xce9e('0x1c')](function(_0xbad206){if(_0xbad206==='ListId'){_0x44a85b['and'](_0xce9e('0x40'),[]['concat'](_0x3193b6[_0xbad206]));}else if(_0xbad206==='Contact'){var _0x24a870='%'+_0x3193b6[_0xbad206]+'%';_0x44a85b['and'](_0xce9e('0x41'),_0x24a870);}else if(_0xbad206==='User'){_0x44a85b['and']('uc.UserId\x20=\x20?',_0x3193b6[_0xbad206]);}else{_0x44a85b[_0xce9e('0x37')]('c.'+_0xbad206+_0xce9e('0x42'),_0x3193b6[_0xbad206]);}});}return _0x44a85b;}function parseQueryParameters(_0x348251,_0x2a9675){var _0x5a7f95=getSqlClauses();return Promise[_0xce9e('0x43')]()[_0xce9e('0x44')](function(){return parseModelFields(_0x348251,_0x2a9675);})[_0xce9e('0x44')](function(_0x3b759f){_0x5a7f95[_0xce9e('0x45')][_0xce9e('0x37')](_0x3b759f);return parseTagParameter(_0x348251[_0xce9e('0x46')]);})[_0xce9e('0x44')](function(_0xc81042){_0x5a7f95['tags'][_0xce9e('0x36')]['and'](_0xc81042);return parseSearchFilter(_0x348251[_0xce9e('0x47')]);})[_0xce9e('0x44')](function(_0x4ed6ac){_0x5a7f95['filter']=_0x4ed6ac;return _0x5a7f95;});}function checkListsRestrictions(_0x113e86,_0x51cb5b,_0x3b578f){var _0x4f364b=squel[_0xce9e('0x1f')]();return Promise[_0xce9e('0x43')]()['then'](function(){if(_0x51cb5b[_0xce9e('0x5')]&&_0x113e86[_0xce9e('0x48')]===_0xce9e('0x4')&&!_0x3b578f){return _0x113e86[_0xce9e('0x49')]({'attributes':['id'],'raw':!![]});}})[_0xce9e('0x44')](function(_0x186444){if(_0x186444){if(_0x186444[_0xce9e('0x23')]===0x0){_0x4f364b[_0xce9e('0x37')]('c.ListId\x20IS\x20NULL');}else{_0x4f364b['and'](_0xce9e('0x40'),_[_0xce9e('0x35')](_0x186444,'id'));}}})[_0xce9e('0x44')](function(){return _0x4f364b;});}function buildContactsQuery(_0x48594c,_0x4029d2,_0xbf2dfb,_0x267175,_0x55a9f6,_0x393709){if(_0x4029d2){_0x4029d2=_0xbf2dfb['attributes'];}_0x48594c=addFieldsToQuery(_0x48594c,_0x4029d2,_0x267175,_0x393709,!![]);var _0x3231e1=squel[_0xce9e('0x4a')]();_0x3231e1=addFieldsToQuery(_0x3231e1,_0x4029d2,_0x267175,_0x393709,![]);if(_0x267175||_0x393709){_0x48594c=applyJoinClauses(_0x48594c,!![]);_0x48594c[_0xce9e('0x4b')]('c.id');if(_0xbf2dfb['limit']){_0x3231e1['limit'](_0xbf2dfb[_0xce9e('0x4c')]);}if(_0xbf2dfb[_0xce9e('0x4d')]){_0x3231e1[_0xce9e('0x4d')](_0xbf2dfb[_0xce9e('0x4d')]);}}else{_0x3231e1=applyJoinClauses(_0x3231e1,![]);_0x3231e1[_0xce9e('0x4b')]('subqry.id');if(_0xbf2dfb[_0xce9e('0x4c')]){_0x48594c['limit'](_0xbf2dfb[_0xce9e('0x4c')]);}if(_0xbf2dfb['offset']){_0x48594c['offset'](_0xbf2dfb[_0xce9e('0x4d')]);}}_0x3231e1[_0xce9e('0x4e')](_0x55a9f6);if(_0xbf2dfb['order']){_0xbf2dfb['order']['forEach'](function(_0x27a4e3){_0x48594c[_0xce9e('0x4f')]('c.'+_0x27a4e3[0x0],_0x27a4e3[0x1]===_0xce9e('0x50')?![]:!![]);_0x3231e1['order'](_0xce9e('0x51')+_0x27a4e3[0x0],_0x27a4e3[0x1]===_0xce9e('0x50')?![]:!![]);});}_0x3231e1['from'](_0x48594c,_0xce9e('0xa'));return _0x3231e1;}function getFilteredContacts(_0x5f1be6){var _0x3a0855=[];return db['Tag'][_0xce9e('0x52')]({'attributes':['id',_0xce9e('0x53'),'color'],'raw':!![]})[_0xce9e('0x44')](function(_0x4b1240){_0x3a0855=_[_0xce9e('0x54')](_0x4b1240,'id');var _0x5d03ea={'type':db[_0xce9e('0x55')][_0xce9e('0x56')][_0xce9e('0x57')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xce9e('0x58')][_0xce9e('0x59')](_0x5f1be6[_0xce9e('0x5a')](),_0x5d03ea);})[_0xce9e('0x44')](function(_0x35e586){_0x35e586[_0xce9e('0x1c')](function(_0x5cd235){if(_0x5cd235[_0xce9e('0x1a')]){_0x5cd235['Tags']=[];_0x5cd235[_0xce9e('0x1a')]['split'](',')['forEach'](function(_0x5d691a){_0x5cd235[_0xce9e('0x5b')][_0xce9e('0x1b')](_0x3a0855[_0x5d691a]);});}delete _0x5cd235['TagIds'];});return _0x35e586;});}function countFilteredContacts(_0x5230af,_0x4da4cb){var _0x54c5b0=_0x5230af[_0xce9e('0x5c')]();_0x54c5b0['field'](_0xce9e('0x5d'));_0x54c5b0=applyJoinClauses(_0x54c5b0,!![]);_0x5230af[_0xce9e('0x4b')](_0xce9e('0x5e'));var _0x2bc6fd=utils[_0xce9e('0x20')](_0x4da4cb);if(!_[_0xce9e('0x5f')](_0x2bc6fd)){_0x54c5b0[_0xce9e('0x60')]('t.id\x20IN\x20?',_0x2bc6fd);}var _0x2b2499={'type':db[_0xce9e('0x55')][_0xce9e('0x56')]['SELECT'],'raw':!![]};return db[_0xce9e('0x58')][_0xce9e('0x59')](_0x54c5b0[_0xce9e('0x5a')](),_0x2b2499)[_0xce9e('0x44')](function(_0x3ebb1a){return _0x3ebb1a[0x0][_0xce9e('0x5d')];});}module[_0xce9e('0x61')]={'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 0cfe97c..9d951e1 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 _0x72ce=['../../config/environment','secrets','session','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','final','binary','write','end','close','unlink','decryptFile','createDecipher','data','update','encryptString','secret','base64','decryptString','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x72ce,0x15b));var _0xe72c=function(_0xd490b,_0x3c56c3){_0xd490b=_0xd490b-0x0;var _0x2a6337=_0x72ce[_0xd490b];return _0x2a6337;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xe72c('0x0'));var _=require('lodash');var config=require(_0xe72c('0x1'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xe72c('0x2')][_0xe72c('0x3')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0xe72c('0x4')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0xe72c('0x4')][_0xe72c('0x5')]);if(isSupported){fileOptions[_0xe72c('0x5')]=config[_0xe72c('0x4')][_0xe72c('0x5')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xe72c('0x4')]['algorithm'],_0xe72c('0x6'),supportedAlgorithms);}}function isASupportedCipher(_0xefba2d){return AES_SUPPORTED_RX[_0xe72c('0x7')](_0xefba2d);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xe72c('0x8')](isASupportedCipher);}function isAlgorithmSupported(_0xf9e972){return getSupportedCiphers()[_0xe72c('0x9')](_0xf9e972)>-0x1;}function combineOptions(_0x57f5ef){var _0x5fd0b6={};for(var _0x31178d in fileOptions){if(fileOptions[_0xe72c('0xa')](_0x31178d)){_0x5fd0b6[_0x31178d]=fileOptions[_0x31178d];}}if(_0x57f5ef){for(var _0x285894 in _0x57f5ef){if(_0x57f5ef['hasOwnProperty'](_0x285894)){_0x5fd0b6[_0x285894]=_0x57f5ef[_0x285894];}}}return _0x5fd0b6;}exports[_0xe72c('0xb')]=function(_0xe267a4,_0x15cac9,_0x597125,_0x1652be){return new BPromise(function(_0x1d05a4,_0x52924a){_0x1652be=combineOptions(_0x1652be);var _0x5a68c7=new Buffer(_0x597125);var _0x211d13=fs[_0xe72c('0xc')](_0xe267a4);var _0x361a8e=fs[_0xe72c('0xd')](_0x15cac9);var _0x1aab07=crypto[_0xe72c('0xe')](_0x1652be[_0xe72c('0x5')],_0x5a68c7);_0x211d13['on']('data',function(_0x3c8efb){var _0x1812e8=new Buffer(_0x1aab07['update'](_0x3c8efb),'binary');_0x361a8e['write'](_0x1812e8);});_0x211d13['on']('end',function(){try{var _0x577cd8=new Buffer(_0x1aab07[_0xe72c('0xf')](_0xe72c('0x10')),'binary');_0x361a8e[_0xe72c('0x11')](_0x577cd8);_0x361a8e[_0xe72c('0x12')]();_0x361a8e['on'](_0xe72c('0x13'),function(){return _0x1d05a4(_0x15cac9);});}catch(_0x21e4e8){fs[_0xe72c('0x14')](_0x15cac9);return _0x52924a(_0x21e4e8);}});});};exports[_0xe72c('0x15')]=function(_0x1406dc,_0x34295b,_0x2f34ed,_0x398315){return new BPromise(function(_0xf3d40e,_0x3dd2ee){_0x398315=combineOptions(_0x398315);var _0x39fbae=new Buffer(_0x2f34ed);var _0x16a567=fs[_0xe72c('0xc')](_0x1406dc);var _0x418615=fs[_0xe72c('0xd')](_0x34295b);var _0x3298ea=crypto[_0xe72c('0x16')](_0x398315[_0xe72c('0x5')],_0x39fbae);_0x16a567['on'](_0xe72c('0x17'),function(_0x43928e){var _0x366863=new Buffer(_0x3298ea[_0xe72c('0x18')](_0x43928e),'binary');_0x418615[_0xe72c('0x11')](_0x366863);});_0x16a567['on'](_0xe72c('0x12'),function(){try{var _0x3a1112=new Buffer(_0x3298ea[_0xe72c('0xf')](_0xe72c('0x10')),_0xe72c('0x10'));_0x418615[_0xe72c('0x11')](_0x3a1112);_0x418615[_0xe72c('0x12')]();_0x418615['on'](_0xe72c('0x13'),function(){return _0xf3d40e(_0x34295b);});}catch(_0x169bfa){fs['unlink'](_0x34295b);return _0x3dd2ee(_0x169bfa);}});});};exports[_0xe72c('0x19')]=function(_0x741e65,_0xac93d4,_0x73f0bb){var _0x1052d7=_0x73f0bb||stringOptions[_0xe72c('0x5')];var _0x49f6d7=_0xac93d4||stringOptions[_0xe72c('0x1a')];var _0x59ac36=crypto[_0xe72c('0xe')](_0x1052d7,_0x49f6d7);var _0x455101=_0x59ac36['update'](_0x741e65,'utf8','base64');_0x455101+=_0x59ac36[_0xe72c('0xf')](_0xe72c('0x1b'));return _0x455101;};exports[_0xe72c('0x1c')]=function(_0x9fc77,_0x35685c,_0x1171e5){var _0x20d849=_0x1171e5||stringOptions['algorithm'];var _0x2fe1c9=_0x35685c||stringOptions[_0xe72c('0x1a')];var _0xec9edf=crypto['createDecipher'](_0x20d849,_0x2fe1c9);var _0x3417b3=_0xec9edf[_0xe72c('0x18')](_0x9fc77,'base64','utf8');_0x3417b3+=_0xec9edf[_0xe72c('0xf')]('utf8');return _0x3417b3;}; \ No newline at end of file +var _0x8d18=['encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','secret','base64','utf8','bluebird','lodash','../../config/environment','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty'];(function(_0x18d79a,_0x353abd){var _0x3b72e5=function(_0xc85d10){while(--_0xc85d10){_0x18d79a['push'](_0x18d79a['shift']());}};_0x3b72e5(++_0x353abd);}(_0x8d18,0xb1));var _0x88d1=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x8d18[_0x58965a];return _0x254efc;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x88d1('0x0'));var _=require(_0x88d1('0x1'));var config=require(_0x88d1('0x2'));var logger=require('../../config/logger')(_0x88d1('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x88d1('0x4')],'algorithm':_0x88d1('0x5')};const fileOptions={'algorithm':_0x88d1('0x6')};if(config['encrypt']&&config[_0x88d1('0x7')][_0x88d1('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x88d1('0x8')]=config[_0x88d1('0x7')][_0x88d1('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x88d1('0x9')](',\x20');logger[_0x88d1('0xa')](config['encrypt']['algorithm'],_0x88d1('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x5a5906){return AES_SUPPORTED_RX[_0x88d1('0xc')](_0x5a5906);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x88d1('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x5459bc){return getSupportedCiphers()['indexOf'](_0x5459bc)>-0x1;}function combineOptions(_0xb136b5){var _0xe4782a={};for(var _0x50f430 in fileOptions){if(fileOptions[_0x88d1('0xe')](_0x50f430)){_0xe4782a[_0x50f430]=fileOptions[_0x50f430];}}if(_0xb136b5){for(var _0x29425e in _0xb136b5){if(_0xb136b5[_0x88d1('0xe')](_0x29425e)){_0xe4782a[_0x29425e]=_0xb136b5[_0x29425e];}}}return _0xe4782a;}exports[_0x88d1('0xf')]=function(_0x2c6e94,_0x3a836b,_0x4d72fe,_0x11ccab){return new BPromise(function(_0x100dee,_0x54b730){_0x11ccab=combineOptions(_0x11ccab);var _0xdd8647=new Buffer(_0x4d72fe);var _0x5d0ac1=fs[_0x88d1('0x10')](_0x2c6e94);var _0xa5fe5e=fs[_0x88d1('0x11')](_0x3a836b);var _0x19f7c7=crypto[_0x88d1('0x12')](_0x11ccab['algorithm'],_0xdd8647);_0x5d0ac1['on'](_0x88d1('0x13'),function(_0x100002){var _0x22fab2=new Buffer(_0x19f7c7[_0x88d1('0x14')](_0x100002),_0x88d1('0x15'));_0xa5fe5e[_0x88d1('0x16')](_0x22fab2);});_0x5d0ac1['on'](_0x88d1('0x17'),function(){try{var _0x13c055=new Buffer(_0x19f7c7[_0x88d1('0x18')](_0x88d1('0x15')),'binary');_0xa5fe5e[_0x88d1('0x16')](_0x13c055);_0xa5fe5e[_0x88d1('0x17')]();_0xa5fe5e['on'](_0x88d1('0x19'),function(){return _0x100dee(_0x3a836b);});}catch(_0x5d142a){fs[_0x88d1('0x1a')](_0x3a836b);return _0x54b730(_0x5d142a);}});});};exports[_0x88d1('0x1b')]=function(_0xa0acbb,_0x12ac2b,_0x41abf9,_0x13b9cc){return new BPromise(function(_0x489904,_0x1abbff){_0x13b9cc=combineOptions(_0x13b9cc);var _0x3721b5=new Buffer(_0x41abf9);var _0x53abe0=fs[_0x88d1('0x10')](_0xa0acbb);var _0x159675=fs[_0x88d1('0x11')](_0x12ac2b);var _0x31e06e=crypto[_0x88d1('0x1c')](_0x13b9cc[_0x88d1('0x8')],_0x3721b5);_0x53abe0['on']('data',function(_0x396cd3){var _0x2639a4=new Buffer(_0x31e06e[_0x88d1('0x14')](_0x396cd3),_0x88d1('0x15'));_0x159675[_0x88d1('0x16')](_0x2639a4);});_0x53abe0['on'](_0x88d1('0x17'),function(){try{var _0x4a3df9=new Buffer(_0x31e06e['final'](_0x88d1('0x15')),'binary');_0x159675[_0x88d1('0x16')](_0x4a3df9);_0x159675[_0x88d1('0x17')]();_0x159675['on'](_0x88d1('0x19'),function(){return _0x489904(_0x12ac2b);});}catch(_0x22db05){fs[_0x88d1('0x1a')](_0x12ac2b);return _0x1abbff(_0x22db05);}});});};exports['encryptString']=function(_0x505e56,_0x58f535,_0x247259){var _0x1e4ac4=_0x247259||stringOptions[_0x88d1('0x8')];var _0x58ffa1=_0x58f535||stringOptions[_0x88d1('0x1d')];var _0x1502d7=crypto['createCipher'](_0x1e4ac4,_0x58ffa1);var _0x48e529=_0x1502d7['update'](_0x505e56,'utf8',_0x88d1('0x1e'));_0x48e529+=_0x1502d7['final']('base64');return _0x48e529;};exports['decryptString']=function(_0xc8e002,_0x1ee82a,_0x4fb4a8){var _0x2e27f5=_0x4fb4a8||stringOptions[_0x88d1('0x8')];var _0x55b997=_0x1ee82a||stringOptions[_0x88d1('0x1d')];var _0x51f8dd=crypto[_0x88d1('0x1c')](_0x2e27f5,_0x55b997);var _0x2755ba=_0x51f8dd['update'](_0xc8e002,'base64','utf8');_0x2755ba+=_0x51f8dd[_0x88d1('0x18')](_0x88d1('0x1f'));return _0x2755ba;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 69e3937..b27ea04 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 _0x9a75=['util','lodash','to-csv','zip-dir','../../mysqldb','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit'];(function(_0x5466e0,_0x586206){var _0xf32c89=function(_0x68e0e9){while(--_0x68e0e9){_0x5466e0['push'](_0x5466e0['shift']());}};_0xf32c89(++_0x586206);}(_0x9a75,0xd7));var _0x59a7=function(_0x12992e,_0x57ba0e){_0x12992e=_0x12992e-0x0;var _0x5936c1=_0x9a75[_0x12992e];return _0x5936c1;};'use strict';var util=require(_0x59a7('0x0'));var path=require('path');var _=require(_0x59a7('0x1'));var csv=require(_0x59a7('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x59a7('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x59a7('0x4'))['dbH'];var logger=require('../../config/logger')(_0x59a7('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x59a7('0x6')][0x2]);var QUERY=process[_0x59a7('0x6')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x41a482,_0x255442){var _0x1e257e={'status':_0x41a482};var _0x942b5d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x255442){_0x1e257e['savename']=_0x255442;}return db[_0x59a7('0x7')][_0x59a7('0x8')](_0x1e257e,_0x942b5d);}function main(){var _0xe36fcb=0x1388;var _0x45b9c7;logger[_0x59a7('0x9')](util['format'](_0x59a7('0xa'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x59a7('0xb')][_0x59a7('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x59a7('0xd'),'splitSizeCsv']})['then'](function(_0x3b3a0b){if(_0x3b3a0b){_0x45b9c7=_0x3b3a0b;_0xe36fcb=_0x45b9c7[_0x59a7('0xe')]||0x1388;}})[_0x59a7('0xf')](function(){return dbH[_0x59a7('0x10')][_0x59a7('0x11')](util[_0x59a7('0x12')](_0x59a7('0x13'),QUERY),{'type':dbH['sequelize'][_0x59a7('0x14')][_0x59a7('0x15')]});})['then'](function(_0x4aa151){if(!_0x4aa151[0x0][_0x59a7('0x16')]){return analyticExtractedReport(_0x59a7('0x17'));}var _0x4aaa17=[];var _0x94aa4=0x0;if(_0x45b9c7['split']){if(_0x4aa151&&_0x4aa151[_0x59a7('0x18')]){var _0x4dfe42=_['range'](_0x4aa151[0x0][_0x59a7('0x16')]/_0xe36fcb);var _0x24407a=Number['isInteger'](_0x4aa151[0x0][_0x59a7('0x16')]/_0xe36fcb)?_0x4aa151[0x0][_0x59a7('0x16')]%_0xe36fcb:0x0;_0x4dfe42['forEach'](function(_0x15822a){if(_0x15822a>0x0){_0x94aa4+=_0xe36fcb;}_0x4aaa17[_0x59a7('0x19')](dbH['sequelize'][_0x59a7('0x11')](util[_0x59a7('0x12')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe36fcb,_0x94aa4),{'type':dbH['sequelize']['QueryTypes'][_0x59a7('0x15')]}));});if(_0x24407a>0x0){_0x94aa4+=_0xe36fcb;_0x4aaa17[_0x59a7('0x19')](dbH['sequelize']['query'](util[_0x59a7('0x12')](_0x59a7('0x1a'),QUERY,_0x24407a,_0x94aa4),{'type':dbH['sequelize'][_0x59a7('0x14')][_0x59a7('0x15')]}));}}}else{_0x4aaa17['push'](dbH[_0x59a7('0x10')][_0x59a7('0x11')](QUERY,{'type':dbH[_0x59a7('0x10')]['QueryTypes'][_0x59a7('0x15')]}));}var _0x2ddd37=path[_0x59a7('0x1b')](PATH);var _0x5bc712=path[_0x59a7('0x1c')](PATH,'.csv');var _0x48fb67=_0x45b9c7[_0x59a7('0xd')]&&_0x4aaa17[_0x59a7('0x18')]>0x1;var _0x3d93b1=[];if(!fs[_0x59a7('0x1d')](path[_0x59a7('0x1e')](_0x2ddd37,_0x5bc712))&&_0x48fb67){fs[_0x59a7('0x1f')](path[_0x59a7('0x1e')](_0x2ddd37,_0x5bc712));}return BPromise[_0x59a7('0x20')](_0x4aaa17,function(_0x26c7e6){_0x3d93b1[_0x59a7('0x19')](_0x26c7e6);})[_0x59a7('0xf')](function(){for(var _0x2c2f0e=0x0;_0x2c2f0e<_0x3d93b1[_0x59a7('0x18')];_0x2c2f0e+=0x1){var _0x492546;var _0xeca5eb=_0x3d93b1[_0x2c2f0e];if(_0x48fb67){_0x492546=path[_0x59a7('0x1e')](_0x2ddd37,_0x5bc712,util['format'](_0x59a7('0x21'),_0x5bc712,_0x2c2f0e,_0x59a7('0x22')));}else{_0x492546=path[_0x59a7('0x1e')](_0x2ddd37,util['format']('%s.%s',_0x5bc712,_0x59a7('0x22')));}fs['writeFileSync'](_0x492546,csv(_0xeca5eb));}})[_0x59a7('0xf')](function(){if(_0x48fb67){return new Promise(function(_0x342396){zipdir(path[_0x59a7('0x1e')](_0x2ddd37,_0x5bc712),{'saveTo':path['join'](_0x2ddd37,util[_0x59a7('0x12')]('%s.%s',_0x5bc712,_0x59a7('0x23')))},function(_0x39eb99,_0x51018d){rimraf(path[_0x59a7('0x1e')](_0x2ddd37,_0x5bc712),function(){});_0x342396('zip\x20finished');});});}})[_0x59a7('0xf')](function(){logger[_0x59a7('0x9')](util['format'](_0x59a7('0x24'),EXTRACTED_REPORT_ID,_0x59a7('0x25')));return analyticExtractedReport(_0x59a7('0x26'),_0x48fb67?util['format']('%s.%s',_0x5bc712,_0x48fb67?_0x59a7('0x23'):_0x59a7('0x22')):null);});})['catch'](function(_0x3a99b){logger['info'](util[_0x59a7('0x12')](_0x59a7('0x27'),EXTRACTED_REPORT_ID,_0x59a7('0x25')),util['inspect'](_0x3a99b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x59a7('0x28'));})[_0x59a7('0x29')](function(){process[_0x59a7('0x2a')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9081=['Failed','finally','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','split','length','range','isInteger','num','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','dirname','basename','.csv','join','mkdirSync','each','push','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9081,0x1d8));var _0x1908=function(_0x450eaa,_0x558c8e){_0x450eaa=_0x450eaa-0x0;var _0x184867=_0x9081[_0x450eaa];return _0x184867;};'use strict';var util=require('util');var path=require(_0x1908('0x0'));var _=require(_0x1908('0x1'));var csv=require(_0x1908('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x1908('0x3'));var rimraf=require(_0x1908('0x4'));var db=require(_0x1908('0x5'))['db'];var dbH=require(_0x1908('0x5'))['dbH'];var logger=require(_0x1908('0x6'))(_0x1908('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x1908('0x8')][0x2]);var QUERY=process[_0x1908('0x8')][0x3];var PATH=process[_0x1908('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a96b1,_0x3c147e){var _0x30bb1f={'status':_0x2a96b1};var _0x4aa2cf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c147e){_0x30bb1f['savename']=_0x3c147e;}return db[_0x1908('0x9')][_0x1908('0xa')](_0x30bb1f,_0x4aa2cf);}function main(){var _0x45f1fc=0x1388;var _0x3b5db9;logger[_0x1908('0xb')](util[_0x1908('0xc')](_0x1908('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x1908('0xe')][_0x1908('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x1908('0x10')](function(_0x3b0747){if(_0x3b0747){_0x3b5db9=_0x3b0747;_0x45f1fc=_0x3b5db9['splitSizeCsv']||0x1388;}})['then'](function(){return dbH['sequelize'][_0x1908('0x11')](util['format'](_0x1908('0x12'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x1908('0x13')]});})[_0x1908('0x10')](function(_0xab7f2){if(!_0xab7f2[0x0]['num']){return analyticExtractedReport(_0x1908('0x14'));}var _0x1f277c=[];var _0x35e62e=0x0;if(_0x3b5db9[_0x1908('0x15')]){if(_0xab7f2&&_0xab7f2[_0x1908('0x16')]){var _0x1e3560=_[_0x1908('0x17')](_0xab7f2[0x0]['num']/_0x45f1fc);var _0x5eb79f=Number[_0x1908('0x18')](_0xab7f2[0x0][_0x1908('0x19')]/_0x45f1fc)?_0xab7f2[0x0][_0x1908('0x19')]%_0x45f1fc:0x0;_0x1e3560['forEach'](function(_0x4337ca){if(_0x4337ca>0x0){_0x35e62e+=_0x45f1fc;}_0x1f277c['push'](dbH['sequelize'][_0x1908('0x11')](util[_0x1908('0xc')](_0x1908('0x1a'),QUERY,_0x45f1fc,_0x35e62e),{'type':dbH['sequelize']['QueryTypes'][_0x1908('0x13')]}));});if(_0x5eb79f>0x0){_0x35e62e+=_0x45f1fc;_0x1f277c['push'](dbH[_0x1908('0x1b')][_0x1908('0x11')](util['format'](_0x1908('0x1a'),QUERY,_0x5eb79f,_0x35e62e),{'type':dbH['sequelize'][_0x1908('0x1c')]['SELECT']}));}}}else{_0x1f277c['push'](dbH[_0x1908('0x1b')][_0x1908('0x11')](QUERY,{'type':dbH[_0x1908('0x1b')][_0x1908('0x1c')][_0x1908('0x13')]}));}var _0x152ed5=path[_0x1908('0x1d')](PATH);var _0x1f9109=path[_0x1908('0x1e')](PATH,_0x1908('0x1f'));var _0x34ad63=_0x3b5db9[_0x1908('0x15')]&&_0x1f277c[_0x1908('0x16')]>0x1;var _0xf94a=[];if(!fs['existsSync'](path[_0x1908('0x20')](_0x152ed5,_0x1f9109))&&_0x34ad63){fs[_0x1908('0x21')](path[_0x1908('0x20')](_0x152ed5,_0x1f9109));}return BPromise[_0x1908('0x22')](_0x1f277c,function(_0x245aa8){_0xf94a[_0x1908('0x23')](_0x245aa8);})[_0x1908('0x10')](function(){for(var _0x52d06e=0x0;_0x52d06e<_0xf94a[_0x1908('0x16')];_0x52d06e+=0x1){var _0x452d38;var _0x266ba7=_0xf94a[_0x52d06e];if(_0x34ad63){_0x452d38=path['join'](_0x152ed5,_0x1f9109,util[_0x1908('0xc')](_0x1908('0x24'),_0x1f9109,_0x52d06e,'csv'));}else{_0x452d38=path['join'](_0x152ed5,util[_0x1908('0xc')](_0x1908('0x25'),_0x1f9109,_0x1908('0x26')));}fs[_0x1908('0x27')](_0x452d38,csv(_0x266ba7));}})[_0x1908('0x10')](function(){if(_0x34ad63){return new Promise(function(_0x27cfe6){zipdir(path[_0x1908('0x20')](_0x152ed5,_0x1f9109),{'saveTo':path[_0x1908('0x20')](_0x152ed5,util['format'](_0x1908('0x25'),_0x1f9109,_0x1908('0x28')))},function(_0x14ada1,_0x27ae52){rimraf(path[_0x1908('0x20')](_0x152ed5,_0x1f9109),function(){});_0x27cfe6(_0x1908('0x29'));});});}})[_0x1908('0x10')](function(){logger[_0x1908('0xb')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1908('0x2a')));return analyticExtractedReport('Completed',_0x34ad63?util[_0x1908('0xc')](_0x1908('0x25'),_0x1f9109,_0x34ad63?_0x1908('0x28'):_0x1908('0x26')):null);});})[_0x1908('0x2b')](function(_0x316002){logger[_0x1908('0xb')](util['format'](_0x1908('0x2c'),EXTRACTED_REPORT_ID,_0x1908('0x2a')),util['inspect'](_0x316002,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1908('0x2d'));})[_0x1908('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 5d18df4..ab63c28 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 _0x189e=['header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','Empty','Setting','find','split','splitSizePdf','then','range','num','forEach','sequelize','query','QueryTypes','SELECT','dirname','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','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','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','catch','lodash','path','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','fill','length','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x189e,0x150));var _0xe189=function(_0x4aaa08,_0x36c56b){_0x4aaa08=_0x4aaa08-0x0;var _0x4ee130=_0x189e[_0x4aaa08];return _0x4ee130;};'use strict';var _=require(_0xe189('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xe189('0x1'));var moment=require(_0xe189('0x2'));var htmlToPdfmake=require(_0xe189('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xe189('0x4'));var rimraf=require(_0xe189('0x5'));var JSDOM=require(_0xe189('0x6'))['JSDOM'];var window=new JSDOM('')[_0xe189('0x7')];var BPromise=require(_0xe189('0x8'));var db=require(_0xe189('0x9'))['db'];var dbH=require(_0xe189('0x9'))[_0xe189('0xa')];var logger=require(_0xe189('0xb'))(_0xe189('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xe189('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xe189('0xd')][0x4];var NAME=process[_0xe189('0xd')][0x5];var FORMAT=_0xe189('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3b3e27,_0x32df31){var _0x49eb4c={'status':_0x3b3e27};var _0x325bb0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32df31){_0x49eb4c[_0xe189('0xf')]=_0x32df31;}return db[_0xe189('0x10')][_0xe189('0x11')](_0x49eb4c,_0x325bb0);}function getHeaders(_0x1e0f76){return _[_0xe189('0x12')](_0x1e0f76,function(_0x27451a){return{'text':_0x27451a,'style':_0xe189('0x13')};});}function getRows(_0xefcdb5,_0x424f2c){return _['map'](_0x424f2c,function(_0x272f50){return _(_0x272f50)[_0xe189('0x14')](_0xefcdb5)['map'](function(_0x2cd4ee){return _0x2cd4ee?_[_0xe189('0x15')](_0x2cd4ee):'';})['value']();});}function createTable(_0x4803a3,_0x1f338b){var _0x439156={'widths':_[_0xe189('0x16')](Array(_0x4803a3[_0xe189('0x17')]),0x91),'heights':function(_0x3d1623){return _0x3d1623===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x31723f=getHeaders(_0x4803a3);_0x439156[_0xe189('0x18')][_0xe189('0x19')](_0x31723f);var _0x27fa7a=getRows(_0x4803a3,_0x1f338b);_0x439156['body']=_0x439156[_0xe189('0x18')][_0xe189('0x1a')](_0x27fa7a);return _0x439156;}function createTables(_0x1e4fe0){var _0x586c73=[];var _0x571352=_[_0xe189('0x1b')](Object[_0xe189('0x1c')](_0x1e4fe0[0x0]),0x5);_0x571352['forEach'](function(_0x2eeba0){_0x586c73[_0xe189('0x19')](createTable(_0x2eeba0,_0x1e4fe0));});return _0x586c73;}function getPDFDocDefinition(_0x764fd0){var _0x1af45f=util[_0xe189('0x1d')](_0xe189('0x1e'),NAME,EXTRACTED_REPORT[_0xe189('0x1f')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xe189('0x1d')](FORMAT));var _0x20a64a=[];for(var _0x541fc7=0x0;_0x541fc7<_0x764fd0[_0xe189('0x17')];_0x541fc7++){var _0x2ff5d6=[];if(_0x541fc7===0x0){_0x2ff5d6[_0xe189('0x19')]({'text':_0x1af45f,'style':_0xe189('0x20')});}var _0x5cde7b={'table':_0x764fd0[_0x541fc7]};if(_0x541fc7>0x0){_0x5cde7b[_0xe189('0x21')]=_0xe189('0x22');_0x5cde7b[_0xe189('0x23')]=[0x0,0x46,0x0,0x0];}_0x2ff5d6['push'](_0x5cde7b);_0x20a64a['push'](_0x2ff5d6);}return{'pageSize':'A4','pageOrientation':_0xe189('0x24'),'content':_0x20a64a,'footer':function(_0x40a895,_0x5ad232){return{'text':_0x40a895[_0xe189('0x15')]()+_0xe189('0x25')+_0x5ad232,'style':_0xe189('0x26')};},'defaultStyle':{'font':_0xe189('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4e6324){var _0x27b59e=0x1388;var _0x5a3b65;if(!_0x4e6324[0x0]['num']){return analyticExtractedReport(_0xe189('0x28'));}return db[_0xe189('0x29')][_0xe189('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe189('0x2b'),_0xe189('0x2c')]})[_0xe189('0x2d')](function(_0x4a0596){if(_0x4a0596){_0x5a3b65=_0x4a0596;_0x27b59e=_0x5a3b65[_0xe189('0x2c')]||0x3e8;}})[_0xe189('0x2d')](function(){var _0x29e3f9=[];var _0x34bd02=0x0;if(_0x5a3b65[_0xe189('0x2b')]){if(_0x4e6324&&_0x4e6324[_0xe189('0x17')]){var _0x54eff1=_[_0xe189('0x2e')](_0x4e6324[0x0][_0xe189('0x2f')]/_0x27b59e);var _0x156412=Number['isInteger'](_0x4e6324[0x0]['num']/_0x27b59e)?_0x4e6324[0x0]['num']%_0x27b59e:0x0;_0x54eff1[_0xe189('0x30')](function(_0x2acff6){if(_0x2acff6>0x0){_0x34bd02+=_0x27b59e;}_0x29e3f9['push'](dbH[_0xe189('0x31')][_0xe189('0x32')](util[_0xe189('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x27b59e,_0x34bd02),{'type':dbH[_0xe189('0x31')][_0xe189('0x33')][_0xe189('0x34')]}));});if(_0x156412>0x0){_0x34bd02+=_0x27b59e;_0x29e3f9[_0xe189('0x19')](dbH[_0xe189('0x31')][_0xe189('0x32')](util[_0xe189('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x156412,_0x34bd02),{'type':dbH[_0xe189('0x31')][_0xe189('0x33')][_0xe189('0x34')]}));}}}else{_0x29e3f9[_0xe189('0x19')](dbH[_0xe189('0x31')]['query'](QUERY,{'type':dbH[_0xe189('0x31')]['QueryTypes']['SELECT']}));}var _0x1a0e25=path[_0xe189('0x35')](PATH);var _0x5c7023=path['basename'](PATH,_0xe189('0x36'));var _0x5e0c27=_0x5a3b65['split']&&_0x29e3f9[_0xe189('0x17')]>0x1;var _0x4fd561=[];if(!fs[_0xe189('0x37')](path[_0xe189('0x38')](_0x1a0e25,_0x5c7023))&&_0x5e0c27){fs[_0xe189('0x39')](path[_0xe189('0x38')](_0x1a0e25,_0x5c7023));}return BPromise['each'](_0x29e3f9,function(_0x181876){_0x4fd561[_0xe189('0x19')](_0x181876);})[_0xe189('0x2d')](function(){var _0xaae47=[];for(var _0x22fdb9=0x0;_0x22fdb9<_0x4fd561[_0xe189('0x17')];_0x22fdb9+=0x1){var _0x37566b=_0x4fd561[_0x22fdb9];var _0x33e8e8=createTables(_[_0xe189('0x3a')](_0x37566b));var _0x3a0617;var _0x3e0fdd=getPDFDocDefinition(_0x33e8e8);var _0x263796=getPDFPrinter();var _0x35f08f=_0x263796[_0xe189('0x3b')](_0x3e0fdd);if(_0x5e0c27){_0x3a0617=path[_0xe189('0x38')](_0x1a0e25,_0x5c7023,util[_0xe189('0x1d')](_0xe189('0x3c'),_0x5c7023,_0x22fdb9,_0xe189('0x3d')));}else{_0x3a0617=path[_0xe189('0x38')](_0x1a0e25,util['format'](_0xe189('0x3e'),_0x5c7023,_0xe189('0x3d')));}_0xaae47[_0xe189('0x19')](writePDFDocument(_0x35f08f,_0x3a0617));}return Promise[_0xe189('0x3f')](_0xaae47);})[_0xe189('0x2d')](function(){if(_0x5e0c27){return new Promise(function(_0x104281){zipdir(path[_0xe189('0x38')](_0x1a0e25,_0x5c7023),{'saveTo':path[_0xe189('0x38')](_0x1a0e25,util[_0xe189('0x1d')](_0xe189('0x3e'),_0x5c7023,_0xe189('0x40')))},function(){rimraf(path['join'](_0x1a0e25,_0x5c7023),function(){});_0x104281(_0xe189('0x41'));});});}})[_0xe189('0x2d')](function(){if(!_0x5e0c27)return;rimraf(path[_0xe189('0x38')](_0x1a0e25,_0x5c7023),function(){});})['then'](function(){logger['info'](util[_0xe189('0x1d')](_0xe189('0x42'),EXTRACTED_REPORT_ID,_0xe189('0x43')));return analyticExtractedReport(_0xe189('0x44'),_0x5e0c27?util[_0xe189('0x1d')]('%s.%s',_0x5c7023,_0x5e0c27?_0xe189('0x40'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0xe189('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xe189('0x10')][_0xe189('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe189('0x2d')](function(_0x328c2c){EXTRACTED_REPORT=_0x328c2c;return dbH[_0xe189('0x31')][_0xe189('0x32')](util[_0xe189('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xe189('0x31')][_0xe189('0x33')][_0xe189('0x34')]});})['then'](extractReport)['catch'](function(_0x9efed){logger['info'](util[_0xe189('0x1d')](_0xe189('0x47'),EXTRACTED_REPORT_ID,_0xe189('0x43')),util[_0xe189('0x48')](_0x9efed,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe189('0x49'));})[_0xe189('0x4a')](function(){process[_0xe189('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x32c1da=new PdfPrinter({'Arial':{'normal':__dirname+_0xe189('0x4c'),'bold':__dirname+_0xe189('0x4d'),'italics':__dirname+_0xe189('0x4e'),'bolditalics':__dirname+_0xe189('0x4f')}});return _0x32c1da;}function getPDFDocDefinitionFromHTML(_0x526b39,_0x3c7025){var _0x1f25da=util[_0xe189('0x1d')](_0xe189('0x50'),_0x3c7025[_0xe189('0x51')],_0x3c7025[_0xe189('0x52')]);var _0x472df7=moment()[_0xe189('0x1d')](_0xe189('0x53'))[_0xe189('0x15')]();var _0x489b61=htmlToPdfmake(_0x526b39,{'window':window,'tableAutoSize':!![]});return{'content':[_0x489b61],'defaultStyle':{'font':_0xe189('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xe189('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe189('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xe189('0x54')}},'header':function(){return[{'text':_0xe189('0x55'),'style':'header'}];},'footer':function(_0x2c1439,_0x2cf6e2){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1f25da,_0x2c1439,_0x2cf6e2,_0x472df7),'style':'footer'}];}};}function writePDFDocument(_0x35678c,_0x572ec4){return new Promise(function(_0x564b0a,_0x3d6071){var _0x82684b=_0x35678c[_0xe189('0x56')](fs[_0xe189('0x57')](_0x572ec4));_0x82684b['on']('finish',function(){_0x564b0a(_0xe189('0x58'));});_0x82684b['on'](_0xe189('0x59'),function(_0x2fe747){_0x3d6071(_0x2fe747);});_0x35678c[_0xe189('0x5a')]();});}exports['createPdfFromHTML']=function(_0x4aff76,_0x5151e6){var _0x19598e=getPDFPrinter();var _0x36f8c3=getPDFDocDefinitionFromHTML(_0x4aff76,_0x5151e6);var _0xdce689=_0x19598e['createPdfKitDocument'](_0x36f8c3);return writePDFDocument(_0xdce689,_0x5151e6[_0xe189('0x1')])[_0xe189('0x5b')](function(_0x3f535d){throw _0x3f535d;});}; \ No newline at end of file +var _0x3dbb=['footer','right','num','Empty','Setting','find','then','splitSizePdf','split','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','join','mkdirSync','each','flatten','%s%d.%s','all','zip','zip\x20finished','info','PDF','Completed','%s.%s','pdf','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','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','body','push','concat','chunk','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','pageBreak','before','margin','landscape'];(function(_0x82cd19,_0x4e65e6){var _0x47c15a=function(_0x42543d){while(--_0x42543d){_0x82cd19['push'](_0x82cd19['shift']());}};_0x47c15a(++_0x4e65e6);}(_0x3dbb,0x1bc));var _0xb3db=function(_0x1e3923,_0x477ce9){_0x1e3923=_0x1e3923-0x0;var _0x36cd0f=_0x3dbb[_0x1e3923];return _0x36cd0f;};'use strict';var _=require(_0xb3db('0x0'));var fs=require('fs');var util=require(_0xb3db('0x1'));var path=require(_0xb3db('0x2'));var moment=require(_0xb3db('0x3'));var htmlToPdfmake=require(_0xb3db('0x4'));var PdfPrinter=require(_0xb3db('0x5'));var zipdir=require(_0xb3db('0x6'));var rimraf=require(_0xb3db('0x7'));var JSDOM=require(_0xb3db('0x8'))[_0xb3db('0x9')];var window=new JSDOM('')[_0xb3db('0xa')];var BPromise=require(_0xb3db('0xb'));var db=require(_0xb3db('0xc'))['db'];var dbH=require(_0xb3db('0xc'))[_0xb3db('0xd')];var logger=require(_0xb3db('0xe'))(_0xb3db('0xf'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xb3db('0x10')][0x3];var PATH=process[_0xb3db('0x10')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xb3db('0x11');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x432f58,_0x50ad74){var _0x25d209={'status':_0x432f58};var _0x33fcd8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x50ad74){_0x25d209[_0xb3db('0x12')]=_0x50ad74;}return db[_0xb3db('0x13')][_0xb3db('0x14')](_0x25d209,_0x33fcd8);}function getHeaders(_0x175709){return _[_0xb3db('0x15')](_0x175709,function(_0x3aebb2){return{'text':_0x3aebb2,'style':_0xb3db('0x16')};});}function getRows(_0x100bec,_0x41498e){return _[_0xb3db('0x15')](_0x41498e,function(_0x94f2f3){return _(_0x94f2f3)[_0xb3db('0x17')](_0x100bec)[_0xb3db('0x15')](function(_0x1bc0aa){return _0x1bc0aa?_[_0xb3db('0x18')](_0x1bc0aa):'';})[_0xb3db('0x19')]();});}function createTable(_0x2bff3f,_0x33b8bc){var _0x5ada1d={'widths':_['fill'](Array(_0x2bff3f[_0xb3db('0x1a')]),0x91),'heights':function(_0x191fb7){return _0x191fb7===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x46147f=getHeaders(_0x2bff3f);_0x5ada1d[_0xb3db('0x1b')][_0xb3db('0x1c')](_0x46147f);var _0x9deff9=getRows(_0x2bff3f,_0x33b8bc);_0x5ada1d[_0xb3db('0x1b')]=_0x5ada1d[_0xb3db('0x1b')][_0xb3db('0x1d')](_0x9deff9);return _0x5ada1d;}function createTables(_0x3274dd){var _0x55f060=[];var _0x341485=_[_0xb3db('0x1e')](Object['keys'](_0x3274dd[0x0]),0x5);_0x341485['forEach'](function(_0x5b7163){_0x55f060[_0xb3db('0x1c')](createTable(_0x5b7163,_0x3274dd));});return _0x55f060;}function getPDFDocDefinition(_0x350722){var _0xc4151a=util['format'](_0xb3db('0x1f'),NAME,EXTRACTED_REPORT[_0xb3db('0x20')],moment(EXTRACTED_REPORT[_0xb3db('0x21')])[_0xb3db('0x22')](FORMAT),moment(EXTRACTED_REPORT[_0xb3db('0x23')])['format'](FORMAT));var _0x588ec1=[];for(var _0x2f4724=0x0;_0x2f4724<_0x350722[_0xb3db('0x1a')];_0x2f4724++){var _0x269e6b=[];if(_0x2f4724===0x0){_0x269e6b['push']({'text':_0xc4151a,'style':_0xb3db('0x24')});}var _0x16c45c={'table':_0x350722[_0x2f4724]};if(_0x2f4724>0x0){_0x16c45c[_0xb3db('0x25')]=_0xb3db('0x26');_0x16c45c[_0xb3db('0x27')]=[0x0,0x46,0x0,0x0];}_0x269e6b['push'](_0x16c45c);_0x588ec1[_0xb3db('0x1c')](_0x269e6b);}return{'pageSize':'A4','pageOrientation':_0xb3db('0x28'),'content':_0x588ec1,'footer':function(_0x5ee4db,_0x52f283){return{'text':_0x5ee4db[_0xb3db('0x18')]()+'\x20/\x20'+_0x52f283,'style':_0xb3db('0x29')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xb3db('0x2a'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x40af86){var _0x91f5d7=0x1388;var _0x27c68e;if(!_0x40af86[0x0][_0xb3db('0x2b')]){return analyticExtractedReport(_0xb3db('0x2c'));}return db[_0xb3db('0x2d')][_0xb3db('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xb3db('0x2f')](function(_0x539020){if(_0x539020){_0x27c68e=_0x539020;_0x91f5d7=_0x27c68e[_0xb3db('0x30')]||0x3e8;}})[_0xb3db('0x2f')](function(){var _0x2a0999=[];var _0x35eb4b=0x0;if(_0x27c68e[_0xb3db('0x31')]){if(_0x40af86&&_0x40af86['length']){var _0x346883=_[_0xb3db('0x32')](_0x40af86[0x0]['num']/_0x91f5d7);var _0xdf5f1c=Number[_0xb3db('0x33')](_0x40af86[0x0]['num']/_0x91f5d7)?_0x40af86[0x0]['num']%_0x91f5d7:0x0;_0x346883['forEach'](function(_0x44e2a7){if(_0x44e2a7>0x0){_0x35eb4b+=_0x91f5d7;}_0x2a0999[_0xb3db('0x1c')](dbH[_0xb3db('0x34')]['query'](util['format'](_0xb3db('0x35'),QUERY,_0x91f5d7,_0x35eb4b),{'type':dbH[_0xb3db('0x34')][_0xb3db('0x36')][_0xb3db('0x37')]}));});if(_0xdf5f1c>0x0){_0x35eb4b+=_0x91f5d7;_0x2a0999[_0xb3db('0x1c')](dbH[_0xb3db('0x34')]['query'](util[_0xb3db('0x22')](_0xb3db('0x35'),QUERY,_0xdf5f1c,_0x35eb4b),{'type':dbH[_0xb3db('0x34')][_0xb3db('0x36')][_0xb3db('0x37')]}));}}}else{_0x2a0999['push'](dbH['sequelize'][_0xb3db('0x38')](QUERY,{'type':dbH[_0xb3db('0x34')][_0xb3db('0x36')]['SELECT']}));}var _0x22cf9f=path[_0xb3db('0x39')](PATH);var _0x59d7b5=path[_0xb3db('0x3a')](PATH,_0xb3db('0x3b'));var _0x43b9c5=_0x27c68e[_0xb3db('0x31')]&&_0x2a0999[_0xb3db('0x1a')]>0x1;var _0x5d71ad=[];if(!fs['existsSync'](path[_0xb3db('0x3c')](_0x22cf9f,_0x59d7b5))&&_0x43b9c5){fs[_0xb3db('0x3d')](path['join'](_0x22cf9f,_0x59d7b5));}return BPromise[_0xb3db('0x3e')](_0x2a0999,function(_0x4458da){_0x5d71ad[_0xb3db('0x1c')](_0x4458da);})[_0xb3db('0x2f')](function(){var _0x8d6254=[];for(var _0x498ebd=0x0;_0x498ebd<_0x5d71ad[_0xb3db('0x1a')];_0x498ebd+=0x1){var _0x56f73c=_0x5d71ad[_0x498ebd];var _0x10a8d3=createTables(_[_0xb3db('0x3f')](_0x56f73c));var _0x4ec2a1;var _0x3158d8=getPDFDocDefinition(_0x10a8d3);var _0x135006=getPDFPrinter();var _0x367819=_0x135006['createPdfKitDocument'](_0x3158d8);if(_0x43b9c5){_0x4ec2a1=path['join'](_0x22cf9f,_0x59d7b5,util['format'](_0xb3db('0x40'),_0x59d7b5,_0x498ebd,'pdf'));}else{_0x4ec2a1=path[_0xb3db('0x3c')](_0x22cf9f,util[_0xb3db('0x22')]('%s.%s',_0x59d7b5,'pdf'));}_0x8d6254['push'](writePDFDocument(_0x367819,_0x4ec2a1));}return Promise[_0xb3db('0x41')](_0x8d6254);})[_0xb3db('0x2f')](function(){if(_0x43b9c5){return new Promise(function(_0x3f9e44){zipdir(path['join'](_0x22cf9f,_0x59d7b5),{'saveTo':path[_0xb3db('0x3c')](_0x22cf9f,util[_0xb3db('0x22')]('%s.%s',_0x59d7b5,_0xb3db('0x42')))},function(){rimraf(path['join'](_0x22cf9f,_0x59d7b5),function(){});_0x3f9e44(_0xb3db('0x43'));});});}})['then'](function(){if(!_0x43b9c5)return;rimraf(path[_0xb3db('0x3c')](_0x22cf9f,_0x59d7b5),function(){});})[_0xb3db('0x2f')](function(){logger[_0xb3db('0x44')](util[_0xb3db('0x22')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb3db('0x45')));return analyticExtractedReport(_0xb3db('0x46'),_0x43b9c5?util[_0xb3db('0x22')](_0xb3db('0x47'),_0x59d7b5,_0x43b9c5?_0xb3db('0x42'):_0xb3db('0x48')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb3db('0x44')](util[_0xb3db('0x22')](_0xb3db('0x49'),EXTRACTED_REPORT_ID,_0xb3db('0x45')));return db[_0xb3db('0x13')][_0xb3db('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xb3db('0x2f')](function(_0x3b4017){EXTRACTED_REPORT=_0x3b4017;return dbH[_0xb3db('0x34')][_0xb3db('0x38')](util[_0xb3db('0x22')](_0xb3db('0x4b'),QUERY),{'type':dbH[_0xb3db('0x34')][_0xb3db('0x36')]['SELECT']});})[_0xb3db('0x2f')](extractReport)[_0xb3db('0x4c')](function(_0x44004e){logger[_0xb3db('0x44')](util[_0xb3db('0x22')](_0xb3db('0x4d'),EXTRACTED_REPORT_ID,_0xb3db('0x45')),util[_0xb3db('0x4e')](_0x44004e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb3db('0x4f'));})[_0xb3db('0x50')](function(){process[_0xb3db('0x51')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5984a8=new PdfPrinter({'Arial':{'normal':__dirname+_0xb3db('0x52'),'bold':__dirname+_0xb3db('0x53'),'italics':__dirname+_0xb3db('0x54'),'bolditalics':__dirname+_0xb3db('0x55')}});return _0x5984a8;}function getPDFDocDefinitionFromHTML(_0x55069e,_0x23c46b){var _0x1f5442=util[_0xb3db('0x22')](_0xb3db('0x56'),_0x23c46b[_0xb3db('0x57')],_0x23c46b[_0xb3db('0x58')]);var _0x3f7c5a=moment()[_0xb3db('0x22')](_0xb3db('0x59'))[_0xb3db('0x18')]();var _0x4cd22b=htmlToPdfmake(_0x55069e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4cd22b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb3db('0x5a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xb3db('0x5b'),'style':_0xb3db('0x24')}];},'footer':function(_0x393235,_0x20c01b){return[{'text':util[_0xb3db('0x22')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1f5442,_0x393235,_0x20c01b,_0x3f7c5a),'style':'footer'}];}};}function writePDFDocument(_0x240f53,_0x32643d){return new Promise(function(_0x5c8ddb,_0x5ad142){var _0x7c7dbb=_0x240f53['pipe'](fs[_0xb3db('0x5c')](_0x32643d));_0x7c7dbb['on']('finish',function(){_0x5c8ddb(_0xb3db('0x5d'));});_0x7c7dbb['on'](_0xb3db('0x5e'),function(_0x24cd3a){_0x5ad142(_0x24cd3a);});_0x240f53[_0xb3db('0x5f')]();});}exports[_0xb3db('0x60')]=function(_0x3aa3f4,_0x506934){var _0x23417d=getPDFPrinter();var _0x4e0a85=getPDFDocDefinitionFromHTML(_0x3aa3f4,_0x506934);var _0x213b64=_0x23417d['createPdfKitDocument'](_0x4e0a85);return writePDFDocument(_0x213b64,_0x506934[_0xb3db('0x2')])[_0xb3db('0x4c')](function(_0x5df263){throw _0x5df263;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d1dd131..af42a93 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 _0x8a08=['QueryTypes','num','Empty','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','length','existsSync','join','mkdirSync','each','then','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','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','util','path','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','sequelize','format'];(function(_0x5e2939,_0x40d72b){var _0x10c79e=function(_0x781b19){while(--_0x781b19){_0x5e2939['push'](_0x5e2939['shift']());}};_0x10c79e(++_0x40d72b);}(_0x8a08,0x145));var _0x88a0=function(_0x18af6a,_0x4fedfb){_0x18af6a=_0x18af6a-0x0;var _0x6146b4=_0x8a08[_0x18af6a];return _0x6146b4;};'use strict';var util=require(_0x88a0('0x0'));var path=require(_0x88a0('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x88a0('0x2'));var zipdir=require(_0x88a0('0x3'));var rimraf=require(_0x88a0('0x4'));var db=require(_0x88a0('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x88a0('0x6'))(_0x88a0('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x88a0('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x47f5ce,_0x41e8d0){var _0x37a308={'status':_0x47f5ce};var _0x5d0a0b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x41e8d0){_0x37a308['savename']=_0x41e8d0;}return db['AnalyticExtractedReport'][_0x88a0('0x9')](_0x37a308,_0x5d0a0b);}function main(){var _0x31af85=0x1388;var _0x48cedf;logger['info'](util['format'](_0x88a0('0xa'),EXTRACTED_REPORT_ID,_0x88a0('0xb')));return db[_0x88a0('0xc')][_0x88a0('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x88a0('0xe'),'splitSizeXlsx']})['then'](function(_0xa7a82d){if(_0xa7a82d){_0x48cedf=_0xa7a82d;_0x31af85=_0x48cedf[_0x88a0('0xf')]||0x1388;}})['then'](function(){return dbH[_0x88a0('0x10')]['query'](util[_0x88a0('0x11')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x88a0('0x10')][_0x88a0('0x12')]['SELECT']});})['then'](function(_0x52c2f2){if(!_0x52c2f2[0x0][_0x88a0('0x13')]){return analyticExtractedReport(_0x88a0('0x14'));}var _0x45a77a=[];var _0x3a72db=0x0;if(_0x48cedf[_0x88a0('0xe')]){if(_0x52c2f2&&_0x52c2f2['length']){var _0x3fc3bd=_['range'](_0x52c2f2[0x0]['num']/_0x31af85);var _0x42c485=Number[_0x88a0('0x15')](_0x52c2f2[0x0][_0x88a0('0x13')]/_0x31af85)?_0x52c2f2[0x0]['num']%_0x31af85:0x0;_0x3fc3bd[_0x88a0('0x16')](function(_0x5986d5){if(_0x5986d5>0x0){_0x3a72db+=_0x31af85;}_0x45a77a[_0x88a0('0x17')](dbH[_0x88a0('0x10')][_0x88a0('0x18')](util[_0x88a0('0x11')](_0x88a0('0x19'),QUERY,_0x31af85,_0x3a72db),{'type':dbH[_0x88a0('0x10')]['QueryTypes'][_0x88a0('0x1a')]}));});if(_0x42c485>0x0){_0x3a72db+=_0x31af85;_0x45a77a[_0x88a0('0x17')](dbH[_0x88a0('0x10')][_0x88a0('0x18')](util[_0x88a0('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x42c485,_0x3a72db),{'type':dbH['sequelize'][_0x88a0('0x12')][_0x88a0('0x1a')]}));}}}else{_0x45a77a['push'](dbH['sequelize'][_0x88a0('0x18')](QUERY,{'type':dbH[_0x88a0('0x10')][_0x88a0('0x12')]['SELECT']}));}var _0x453dad=path[_0x88a0('0x1b')](PATH);var _0x4fa316=path['basename'](PATH,'.xlsx');var _0x57ad0d=_0x48cedf[_0x88a0('0xe')]&&_0x45a77a[_0x88a0('0x1c')]>0x1;var _0x5d7fdb=[];if(!fs[_0x88a0('0x1d')](path[_0x88a0('0x1e')](_0x453dad,_0x4fa316))&&_0x57ad0d){fs[_0x88a0('0x1f')](path['join'](_0x453dad,_0x4fa316));}return BPromise[_0x88a0('0x20')](_0x45a77a,function(_0x4b383e){_0x5d7fdb[_0x88a0('0x17')](_0x4b383e);})[_0x88a0('0x21')](function(){for(var _0x36b509=0x0;_0x36b509<_0x5d7fdb['length'];_0x36b509+=0x1){var _0x53a109;var _0x108ce4=_0x5d7fdb[_0x36b509];if(_0x57ad0d){_0x53a109=path[_0x88a0('0x1e')](_0x453dad,_0x4fa316,util[_0x88a0('0x11')](_0x88a0('0x22'),_0x4fa316,_0x36b509,_0x88a0('0x23')));}else{_0x53a109=path[_0x88a0('0x1e')](_0x453dad,util['format']('%s.%s',_0x4fa316,_0x88a0('0x23')));}fs[_0x88a0('0x24')](_0x53a109,json2xls(_0x108ce4),_0x88a0('0x25'));}})['then'](function(){if(_0x57ad0d){return new Promise(function(_0x13feae){zipdir(path[_0x88a0('0x1e')](_0x453dad,_0x4fa316),{'saveTo':path[_0x88a0('0x1e')](_0x453dad,util[_0x88a0('0x11')](_0x88a0('0x26'),_0x4fa316,_0x88a0('0x27')))},function(_0x24b44c,_0x43d7d8){rimraf(path[_0x88a0('0x1e')](_0x453dad,_0x4fa316),function(){});_0x13feae(_0x88a0('0x28'));});});}})['then'](function(){logger[_0x88a0('0x29')](util[_0x88a0('0x11')](_0x88a0('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x88a0('0x2b'),_0x57ad0d?util[_0x88a0('0x11')](_0x88a0('0x26'),_0x4fa316,_0x57ad0d?_0x88a0('0x27'):_0x88a0('0x23')):null);});})[_0x88a0('0x2c')](function(_0x1526e4){logger['info'](util[_0x88a0('0x11')](_0x88a0('0x2d'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x88a0('0x2e')](_0x1526e4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x88a0('0x2f'));})[_0x88a0('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb2a9=['analytics','argv','savename','update','info','format','Setting','split','splitSizeXlsx','then','query','sequelize','QueryTypes','SELECT','num','Empty','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','catch','XLSX','inspect','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x440500,_0x1465b0){var _0x3411b5=function(_0x59c46d){while(--_0x59c46d){_0x440500['push'](_0x440500['shift']());}};_0x3411b5(++_0x1465b0);}(_0xb2a9,0x84));var _0x9b2a=function(_0x206f23,_0x3c2754){_0x206f23=_0x206f23-0x0;var _0xa3979a=_0xb2a9[_0x206f23];return _0xa3979a;};'use strict';var util=require(_0x9b2a('0x0'));var path=require(_0x9b2a('0x1'));var _=require(_0x9b2a('0x2'));var fs=require('fs');var json2xls=require(_0x9b2a('0x3'));var BPromise=require(_0x9b2a('0x4'));var zipdir=require(_0x9b2a('0x5'));var rimraf=require(_0x9b2a('0x6'));var db=require(_0x9b2a('0x7'))['db'];var dbH=require('../../mysqldb')[_0x9b2a('0x8')];var logger=require('../../config/logger')(_0x9b2a('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x9b2a('0xa')][0x2]);var QUERY=process[_0x9b2a('0xa')][0x3];var PATH=process[_0x9b2a('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1946ce,_0x45714d){var _0x37ed7c={'status':_0x1946ce};var _0x5a5c6c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45714d){_0x37ed7c[_0x9b2a('0xb')]=_0x45714d;}return db['AnalyticExtractedReport'][_0x9b2a('0xc')](_0x37ed7c,_0x5a5c6c);}function main(){var _0x50be3a=0x1388;var _0xf857d7;logger[_0x9b2a('0xd')](util[_0x9b2a('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x9b2a('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9b2a('0x10'),_0x9b2a('0x11')]})[_0x9b2a('0x12')](function(_0x1b7d6a){if(_0x1b7d6a){_0xf857d7=_0x1b7d6a;_0x50be3a=_0xf857d7[_0x9b2a('0x11')]||0x1388;}})[_0x9b2a('0x12')](function(){return dbH['sequelize'][_0x9b2a('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x9b2a('0x14')][_0x9b2a('0x15')][_0x9b2a('0x16')]});})['then'](function(_0x638cde){if(!_0x638cde[0x0][_0x9b2a('0x17')]){return analyticExtractedReport(_0x9b2a('0x18'));}var _0x160ade=[];var _0x7d8864=0x0;if(_0xf857d7[_0x9b2a('0x10')]){if(_0x638cde&&_0x638cde['length']){var _0x462095=_[_0x9b2a('0x19')](_0x638cde[0x0][_0x9b2a('0x17')]/_0x50be3a);var _0x3aa857=Number['isInteger'](_0x638cde[0x0][_0x9b2a('0x17')]/_0x50be3a)?_0x638cde[0x0][_0x9b2a('0x17')]%_0x50be3a:0x0;_0x462095[_0x9b2a('0x1a')](function(_0x2c4609){if(_0x2c4609>0x0){_0x7d8864+=_0x50be3a;}_0x160ade[_0x9b2a('0x1b')](dbH[_0x9b2a('0x14')][_0x9b2a('0x13')](util[_0x9b2a('0xe')](_0x9b2a('0x1c'),QUERY,_0x50be3a,_0x7d8864),{'type':dbH[_0x9b2a('0x14')]['QueryTypes']['SELECT']}));});if(_0x3aa857>0x0){_0x7d8864+=_0x50be3a;_0x160ade[_0x9b2a('0x1b')](dbH['sequelize']['query'](util['format'](_0x9b2a('0x1c'),QUERY,_0x3aa857,_0x7d8864),{'type':dbH['sequelize'][_0x9b2a('0x15')][_0x9b2a('0x16')]}));}}}else{_0x160ade[_0x9b2a('0x1b')](dbH['sequelize'][_0x9b2a('0x13')](QUERY,{'type':dbH[_0x9b2a('0x14')][_0x9b2a('0x15')][_0x9b2a('0x16')]}));}var _0x3c4b8a=path['dirname'](PATH);var _0x1f82b4=path[_0x9b2a('0x1d')](PATH,'.xlsx');var _0x56785c=_0xf857d7[_0x9b2a('0x10')]&&_0x160ade[_0x9b2a('0x1e')]>0x1;var _0xb07d0e=[];if(!fs[_0x9b2a('0x1f')](path[_0x9b2a('0x20')](_0x3c4b8a,_0x1f82b4))&&_0x56785c){fs[_0x9b2a('0x21')](path[_0x9b2a('0x20')](_0x3c4b8a,_0x1f82b4));}return BPromise[_0x9b2a('0x22')](_0x160ade,function(_0x2ae51d){_0xb07d0e[_0x9b2a('0x1b')](_0x2ae51d);})[_0x9b2a('0x12')](function(){for(var _0x267b41=0x0;_0x267b41<_0xb07d0e[_0x9b2a('0x1e')];_0x267b41+=0x1){var _0x12aae7;var _0x3d4c52=_0xb07d0e[_0x267b41];if(_0x56785c){_0x12aae7=path['join'](_0x3c4b8a,_0x1f82b4,util['format'](_0x9b2a('0x23'),_0x1f82b4,_0x267b41,_0x9b2a('0x24')));}else{_0x12aae7=path['join'](_0x3c4b8a,util['format']('%s.%s',_0x1f82b4,'xlsx'));}fs[_0x9b2a('0x25')](_0x12aae7,json2xls(_0x3d4c52),'binary');}})['then'](function(){if(_0x56785c){return new Promise(function(_0x3182e4){zipdir(path[_0x9b2a('0x20')](_0x3c4b8a,_0x1f82b4),{'saveTo':path['join'](_0x3c4b8a,util[_0x9b2a('0xe')]('%s.%s',_0x1f82b4,_0x9b2a('0x26')))},function(_0x59b0cb,_0x55c819){rimraf(path[_0x9b2a('0x20')](_0x3c4b8a,_0x1f82b4),function(){});_0x3182e4(_0x9b2a('0x27'));});});}})[_0x9b2a('0x12')](function(){logger[_0x9b2a('0xd')](util[_0x9b2a('0xe')](_0x9b2a('0x28'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x9b2a('0x29'),_0x56785c?util[_0x9b2a('0xe')](_0x9b2a('0x2a'),_0x1f82b4,_0x56785c?_0x9b2a('0x26'):_0x9b2a('0x24')):null);});})[_0x9b2a('0x2b')](function(_0x2aaed3){logger[_0x9b2a('0xd')](util[_0x9b2a('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9b2a('0x2c')),util[_0x9b2a('0x2d')](_0x2aaed3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x9b2a('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index c089038..b7a2e06 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 _0xe1d6=['transaction','destroy','catch','error','rewrite','lodash','util','models','intervals','VoiceExtension','findAll','IntervalId','then','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','queue','playback','hasOwnProperty','priority','extensions','extension','find','type','Set','CDR(type)=%s','context','VoiceExtensionId','push','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat'];(function(_0xe02fec,_0x1df669){var _0x2ee8e1=function(_0x36f4d5){while(--_0x36f4d5){_0xe02fec['push'](_0xe02fec['shift']());}};_0x2ee8e1(++_0x1df669);}(_0xe1d6,0x119));var _0x6e1d=function(_0x3a35ed,_0x406efb){_0x3a35ed=_0x3a35ed-0x0;var _0x44a191=_0xe1d6[_0x3a35ed];return _0x44a191;};'use strict';var _=require(_0x6e1d('0x0'));var util=require(_0x6e1d('0x1'));function rewrite(_0x30da99,_0x3440b0){var _0x1a12c7=this;return _0x30da99[_0x6e1d('0x2')]['Interval']['findAll']({'raw':!![]})['then'](function(_0x3d0378){_0x1a12c7[_0x6e1d('0x3')]=_0x3d0378;return _0x30da99['models'][_0x6e1d('0x4')][_0x6e1d('0x5')]({'where':{'IntervalId':_0x3440b0[_0x6e1d('0x6')]},'raw':!![]});})[_0x6e1d('0x7')](function(_0x564f69){return _0x30da99[_0x6e1d('0x2')][_0x6e1d('0x4')][_0x6e1d('0x5')]({'where':{'exten':{'$in':_[_0x6e1d('0x8')](_['map'](_0x564f69,_0x6e1d('0x9')))}},'order':[{'raw':_0x6e1d('0xa')}],'raw':!![]});})[_0x6e1d('0x7')](function(_0x20da59){var _0x24c465=_['filter'](_0x20da59,{'priority':'1'});var _0x546471=_['filter'](_0x20da59,{'isApp':0x1});var _0x491a0d=_['groupBy'](_0x546471,_0x6e1d('0x9'));var _0x4ea721=[_0x6e1d('0xb'),_0x6e1d('0xc')];var _0x195cbf=[];var _0x1f9852=[];for(var _0x3daa26 in _0x491a0d){if(_0x491a0d[_0x6e1d('0xd')](_0x3daa26)){_0x1a12c7[_0x6e1d('0xe')]=0x2;_0x1a12c7[_0x6e1d('0xf')]=[];_0x1a12c7[_0x6e1d('0x10')]=_[_0x6e1d('0x11')](_0x24c465,{'exten':_0x491a0d[_0x3daa26][0x0]['exten']});_0x1a12c7[_0x6e1d('0xf')]['push']({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':_0x6e1d('0x13'),'appdata':util['format'](_0x6e1d('0x14'),_0x491a0d[_0x3daa26][0x0]['type']),'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x9')],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});if(_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')]==='inbound'){_0x1a12c7[_0x6e1d('0xf')][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':'Set','appdata':_0x6e1d('0x18')+_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')],'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x9')],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});}else if(_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')]===_0x6e1d('0x19')){if(_0x1a12c7[_0x6e1d('0x10')]){_0x1a12c7['extensions'][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0]['type'],'app':_0x6e1d('0x13'),'appdata':_0x6e1d('0x1a')+(_0x1a12c7[_0x6e1d('0x10')][_0x6e1d('0x1b')]?_0x6e1d('0x1c')+_0x1a12c7[_0x6e1d('0x10')]['cutdigits']+'}':_0x6e1d('0x1d')),'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0]['exten'],'priority':_0x1a12c7['priority']++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});}_0x1a12c7[_0x6e1d('0xf')][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':'Set','appdata':_0x6e1d('0x18')+_0x491a0d[_0x3daa26][0x0]['VoiceExtensionId'],'context':_0x491a0d[_0x3daa26][0x0]['context'],'exten':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x9')],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0]['VoiceExtensionId']});var _0x2ea1f0=_0x1a12c7[_0x6e1d('0xe')]++;_0x1a12c7[_0x6e1d('0xf')]['push']({'type':_0x491a0d[_0x3daa26][0x0]['type'],'app':_0x6e1d('0x1e'),'appdata':_0x6e1d('0x1f')+(_0x2ea1f0+0x2)+_0x6e1d('0x20')+(_0x2ea1f0+0x1)+')','context':_0x491a0d[_0x3daa26][0x0]['context'],'exten':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x9')],'priority':_0x2ea1f0,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});if(_0x1a12c7[_0x6e1d('0x10')]){_0x1a12c7['extensions'][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':'Set','appdata':_0x1a12c7[_0x6e1d('0x10')][_0x6e1d('0x1b')]?_0x6e1d('0x21')+_0x1a12c7[_0x6e1d('0x10')][_0x6e1d('0x1b')]+'}':_0x6e1d('0x22'),'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0]['exten'],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});}_0x1a12c7[_0x6e1d('0xf')][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':_0x6e1d('0x13'),'appdata':_0x6e1d('0x23')+_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')],'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0]['exten'],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0]['VoiceExtensionId']});if(_0x1a12c7['extension']&&_0x1a12c7[_0x6e1d('0x10')][_0x6e1d('0xd')](_0x6e1d('0x24'))&&_0x1a12c7[_0x6e1d('0x10')][_0x6e1d('0x24')]!==_0x6e1d('0x25')){_0x1a12c7[_0x6e1d('0xf')][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':'Set','appdata':_0x6e1d('0x26'),'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0]['exten'],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});_0x1a12c7['extensions']['push']({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':_0x6e1d('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1a12c7[_0x6e1d('0x10')]['recordingFormat']||_0x6e1d('0x27'),'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0]['exten'],'priority':_0x1a12c7['priority']++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});}}_0x1a12c7['extensions'][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':_0x6e1d('0x13'),'appdata':_0x6e1d('0x28'),'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x9')],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0]['VoiceExtensionId']});_0x1a12c7[_0x6e1d('0xf')][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':'Set','appdata':_0x6e1d('0x29'),'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0]['exten'],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});_0x1a12c7['extensions'][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'exten':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x9')],'priority':_0x1a12c7[_0x6e1d('0xe')]++,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0]['VoiceExtensionId']});for(var _0x16267c=0x0,_0x1601cb=0x0;_0x16267c<_0x491a0d[_0x3daa26][_0x6e1d('0x2a')];_0x16267c+=0x1,_0x1601cb=0x0){var _0x57ab38=_0x491a0d[_0x3daa26][_0x16267c];if(_0x57ab38[_0x6e1d('0x12')]){_0x57ab38['type']=_0x57ab38[_0x6e1d('0x12')][_0x6e1d('0x2b')]();}var _0x561349=[];var _0x24342b=[];delete _0x57ab38['id'];delete _0x57ab38['createdAt'];delete _0x57ab38[_0x6e1d('0x2c')];var _0x4c5465=_0x57ab38[_0x6e1d('0x2d')]!=='*,*,*,*'?[_0x57ab38[_0x6e1d('0x2d')]]:_0x57ab38['IntervalId']?_['map'](_[_0x6e1d('0x2e')](_0x1a12c7[_0x6e1d('0x3')],{'IntervalId':_0x57ab38['IntervalId']}),_0x6e1d('0x2d')):[];if(_0x57ab38[_0x6e1d('0xd')]('tag')){if(_0x57ab38[_0x6e1d('0x2f')]&&_0x57ab38[_0x6e1d('0x2f')]!=='--'){_0x561349[_0x6e1d('0x17')]({'type':_0x57ab38['type'],'app':_0x6e1d('0x13'),'appdata':_0x6e1d('0x30')+_0x57ab38['tag'],'context':_0x57ab38[_0x6e1d('0x15')],'exten':_0x57ab38[_0x6e1d('0x9')],'priority':_0x4c5465[_0x6e1d('0x2a')]+_0x1a12c7[_0x6e1d('0xe')]+_0x1601cb++,'VoiceExtensionId':_0x57ab38[_0x6e1d('0x16')]});}}if(_0x57ab38['type']===_0x6e1d('0x19')&&_0x57ab38['hasOwnProperty'](_0x6e1d('0x31'))){if(_0x57ab38[_0x6e1d('0x31')]){_0x561349[_0x6e1d('0x17')]({'type':_0x57ab38[_0x6e1d('0x12')],'app':'ExecIf','appdata':_0x6e1d('0x32')+_0x57ab38[_0x6e1d('0x31')]+')','context':_0x57ab38[_0x6e1d('0x15')],'exten':_0x57ab38[_0x6e1d('0x9')],'priority':_0x4c5465['length']+_0x1a12c7[_0x6e1d('0xe')]+_0x1601cb++,'VoiceExtensionId':_0x57ab38['VoiceExtensionId']});}else{_0x561349['push']({'type':_0x57ab38[_0x6e1d('0x12')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x57ab38[_0x6e1d('0x15')],'exten':_0x57ab38[_0x6e1d('0x9')],'priority':_0x4c5465[_0x6e1d('0x2a')]+_0x1a12c7[_0x6e1d('0xe')]+_0x1601cb++,'VoiceExtensionId':_0x57ab38[_0x6e1d('0x16')]});}}if(_0x57ab38[_0x6e1d('0xd')](_0x6e1d('0x33'))){if(_0x4ea721[_0x6e1d('0x34')](_0x57ab38[_0x6e1d('0x35')][_0x6e1d('0x2b')]())>=0x0&&_0x57ab38[_0x6e1d('0x36')]!==_0x6e1d('0x37')){if(_0x57ab38[_0x6e1d('0x33')]){_0x561349[_0x6e1d('0x17')]({'type':_0x57ab38[_0x6e1d('0x12')],'app':'ExecIf','appdata':_0x6e1d('0x38'),'context':_0x57ab38[_0x6e1d('0x15')],'exten':_0x57ab38[_0x6e1d('0x9')],'priority':_0x4c5465[_0x6e1d('0x2a')]+_0x1a12c7[_0x6e1d('0xe')]+_0x1601cb++,'VoiceExtensionId':_0x57ab38[_0x6e1d('0x16')]});_0x561349[_0x6e1d('0x17')]({'type':_0x57ab38[_0x6e1d('0x12')],'app':_0x6e1d('0x13'),'appdata':_0x6e1d('0x39'),'context':_0x57ab38[_0x6e1d('0x15')],'exten':_0x57ab38[_0x6e1d('0x9')],'priority':_0x4c5465['length']+_0x1a12c7[_0x6e1d('0xe')]+_0x1601cb++,'VoiceExtensionId':_0x57ab38[_0x6e1d('0x16')]});}else{_0x561349['push']({'type':_0x57ab38[_0x6e1d('0x12')],'app':_0x6e1d('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x57ab38['context'],'exten':_0x57ab38[_0x6e1d('0x9')],'priority':_0x4c5465[_0x6e1d('0x2a')]+_0x1a12c7[_0x6e1d('0xe')]+_0x1601cb++,'VoiceExtensionId':_0x57ab38[_0x6e1d('0x16')]});_0x561349[_0x6e1d('0x17')]({'type':_0x57ab38['type'],'app':'Set','appdata':_0x6e1d('0x3a'),'context':_0x57ab38[_0x6e1d('0x15')],'exten':_0x57ab38[_0x6e1d('0x9')],'priority':_0x4c5465[_0x6e1d('0x2a')]+_0x1a12c7[_0x6e1d('0xe')]+_0x1601cb++,'VoiceExtensionId':_0x57ab38[_0x6e1d('0x16')]});}}}for(var _0x40c216=0x0;_0x40c216<_0x4c5465[_0x6e1d('0x2a')];_0x40c216+=0x1){var _0x28f277=_0x1a12c7['priority']+_0x4c5465['length'];var _0x59a102=_0x40c216===_0x4c5465[_0x6e1d('0x2a')]-0x1?_0x1a12c7['priority']+_0x561349['length']+_0x24342b[_0x6e1d('0x2a')]+0x2:_0x1a12c7[_0x6e1d('0xe')]+_0x40c216+0x1;_0x561349[_0x6e1d('0x3b')](_0x40c216,0x0,{'type':_0x57ab38['type'],'app':_0x6e1d('0x3c'),'appdata':_0x4c5465[_0x40c216]+'?'+_0x57ab38['context']+_0x6e1d('0x3d')+_0x28f277+':'+_0x57ab38[_0x6e1d('0x15')]+_0x6e1d('0x3d')+_0x59a102,'exten':_0x57ab38[_0x6e1d('0x9')],'context':_0x57ab38['context'],'priority':_0x1a12c7[_0x6e1d('0xe')]+_0x40c216,'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});}_0x57ab38[_0x6e1d('0xe')]=_0x561349[_0x6e1d('0x2a')]?_['last'](_0x561349)[_0x6e1d('0xe')]+0x1:_0x1a12c7['priority'];_0x1a12c7[_0x6e1d('0xe')]=(_0x24342b[_0x6e1d('0x2a')]?_[_0x6e1d('0x3e')](_0x24342b)[_0x6e1d('0xe')]:_0x57ab38['priority'])+0x1;_0x1a12c7[_0x6e1d('0xf')]=_[_0x6e1d('0x3f')](_0x1a12c7[_0x6e1d('0xf')],_0x561349,[_0x57ab38],_0x24342b);}_0x1a12c7[_0x6e1d('0xf')][_0x6e1d('0x17')]({'type':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x12')],'app':'Hangup','exten':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x9')],'context':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x15')],'priority':_0x1a12c7[_0x6e1d('0xe')],'VoiceExtensionId':_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]});_0x195cbf[_0x6e1d('0x17')](_0x491a0d[_0x3daa26][0x0][_0x6e1d('0x16')]);_0x1f9852=_[_0x6e1d('0x3f')](_0x1f9852,_0x1a12c7['extensions']);}}return _0x30da99[_0x6e1d('0x40')](function(_0xcc7c4e){return _0x30da99['models'][_0x6e1d('0x4')][_0x6e1d('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x195cbf}},'transaction':_0xcc7c4e})[_0x6e1d('0x7')](function(_0x3ccd96){return _0x30da99[_0x6e1d('0x2')]['VoiceExtension']['bulkCreate'](_['sortBy'](_0x1f9852,_0x6e1d('0xe')),{'transaction':_0xcc7c4e});});});})[_0x6e1d('0x42')](function(_0x4fd285){console[_0x6e1d('0x43')](_0x4fd285);});}exports[_0x6e1d('0x44')]=rewrite; \ No newline at end of file +var _0x1076=['models','Interval','then','intervals','findAll','VoiceExtension','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','extension','find','extensions','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','CDR(routeid)=','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','MONITOR_OPTIONS=ab','length','interval','IntervalId','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','toLowerCase','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','Hangup','destroy','bulkCreate','sortBy','catch','error','lodash','util'];(function(_0x4bd481,_0x12c28b){var _0x2122b4=function(_0x274aa8){while(--_0x274aa8){_0x4bd481['push'](_0x4bd481['shift']());}};_0x2122b4(++_0x12c28b);}(_0x1076,0x102));var _0x6107=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x1076[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x6107('0x0'));var util=require(_0x6107('0x1'));function rewrite(_0x1efecc,_0x47c798){var _0x5e1111=this;return _0x1efecc[_0x6107('0x2')][_0x6107('0x3')]['findAll']({'raw':!![]})[_0x6107('0x4')](function(_0x279805){_0x5e1111[_0x6107('0x5')]=_0x279805;return _0x1efecc[_0x6107('0x2')]['VoiceExtension'][_0x6107('0x6')]({'where':{'IntervalId':_0x47c798['IntervalId']},'raw':!![]});})[_0x6107('0x4')](function(_0x298072){return _0x1efecc[_0x6107('0x2')][_0x6107('0x7')][_0x6107('0x6')]({'where':{'exten':{'$in':_[_0x6107('0x8')](_[_0x6107('0x9')](_0x298072,_0x6107('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x6107('0x4')](function(_0x20359f){var _0x13d6b3=_[_0x6107('0xb')](_0x20359f,{'priority':'1'});var _0x15732c=_[_0x6107('0xb')](_0x20359f,{'isApp':0x1});var _0x479bed=_[_0x6107('0xc')](_0x15732c,_0x6107('0xa'));var _0x133ddb=[_0x6107('0xd'),_0x6107('0xe')];var _0x464064=[];var _0x548224=[];for(var _0x289612 in _0x479bed){if(_0x479bed[_0x6107('0xf')](_0x289612)){_0x5e1111['priority']=0x2;_0x5e1111['extensions']=[];_0x5e1111[_0x6107('0x10')]=_[_0x6107('0x11')](_0x13d6b3,{'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')]});_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':util[_0x6107('0x16')](_0x6107('0x17'),_0x479bed[_0x289612][0x0]['type']),'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});if(_0x479bed[_0x289612][0x0]['type']==='inbound'){_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':'Set','appdata':_0x6107('0x1b')+_0x479bed[_0x289612][0x0][_0x6107('0x1a')],'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0]['exten'],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});}else if(_0x479bed[_0x289612][0x0][_0x6107('0x14')]==='outbound'){if(_0x5e1111[_0x6107('0x10')]){_0x5e1111[_0x6107('0x12')]['push']({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':_0x6107('0x1c')+(_0x5e1111['extension'][_0x6107('0x1d')]?'${EXTEN:'+_0x5e1111['extension'][_0x6107('0x1d')]+'}':'${EXTEN}'),'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0]['VoiceExtensionId']});}_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':'Set','appdata':_0x6107('0x1b')+_0x479bed[_0x289612][0x0]['VoiceExtensionId'],'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111['priority']++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});var _0x6cc984=_0x5e1111['priority']++;_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x1e'),'appdata':_0x6107('0x1f')+(_0x6cc984+0x2)+_0x6107('0x20')+(_0x6cc984+0x1)+')','context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x6cc984,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});if(_0x5e1111[_0x6107('0x10')]){_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':_0x5e1111[_0x6107('0x10')][_0x6107('0x1d')]?_0x6107('0x21')+_0x5e1111[_0x6107('0x10')][_0x6107('0x1d')]+'}':_0x6107('0x22'),'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});}_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':'outboundrouteid='+_0x479bed[_0x289612][0x0][_0x6107('0x1a')],'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});if(_0x5e1111[_0x6107('0x10')]&&_0x5e1111[_0x6107('0x10')]['hasOwnProperty'](_0x6107('0x23'))&&_0x5e1111['extension'][_0x6107('0x23')]!==_0x6107('0x24')){_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':_0x6107('0x25'),'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5e1111[_0x6107('0x10')][_0x6107('0x23')]||_0x6107('0x26'),'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0]['exten'],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0]['VoiceExtensionId']});}}_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});_0x5e1111['extensions']['push']({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111[_0x6107('0x19')]++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});_0x5e1111[_0x6107('0x12')][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':_0x6107('0x27'),'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'priority':_0x5e1111['priority']++,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});for(var _0xe65828=0x0,_0x437e66=0x0;_0xe65828<_0x479bed[_0x289612][_0x6107('0x28')];_0xe65828+=0x1,_0x437e66=0x0){var _0x3d7030=_0x479bed[_0x289612][_0xe65828];if(_0x3d7030['type']){_0x3d7030['type']=_0x3d7030[_0x6107('0x14')]['toLowerCase']();}var _0x5a8b44=[];var _0x4714f7=[];delete _0x3d7030['id'];delete _0x3d7030['createdAt'];delete _0x3d7030['updatedAt'];var _0x52ddf2=_0x3d7030['interval']!=='*,*,*,*'?[_0x3d7030[_0x6107('0x29')]]:_0x3d7030[_0x6107('0x2a')]?_[_0x6107('0x9')](_['filter'](_0x5e1111[_0x6107('0x5')],{'IntervalId':_0x3d7030[_0x6107('0x2a')]}),'interval'):[];if(_0x3d7030[_0x6107('0xf')](_0x6107('0x2b'))){if(_0x3d7030['tag']&&_0x3d7030[_0x6107('0x2b')]!=='--'){_0x5a8b44[_0x6107('0x13')]({'type':_0x3d7030[_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':_0x6107('0x2c')+_0x3d7030['tag'],'context':_0x3d7030['context'],'exten':_0x3d7030['exten'],'priority':_0x52ddf2[_0x6107('0x28')]+_0x5e1111[_0x6107('0x19')]+_0x437e66++,'VoiceExtensionId':_0x3d7030['VoiceExtensionId']});}}if(_0x3d7030[_0x6107('0x14')]===_0x6107('0x2d')&&_0x3d7030[_0x6107('0xf')](_0x6107('0x2e'))){if(_0x3d7030[_0x6107('0x2e')]){_0x5a8b44[_0x6107('0x13')]({'type':_0x3d7030[_0x6107('0x14')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x3d7030[_0x6107('0x2e')]+')','context':_0x3d7030[_0x6107('0x18')],'exten':_0x3d7030[_0x6107('0xa')],'priority':_0x52ddf2['length']+_0x5e1111[_0x6107('0x19')]+_0x437e66++,'VoiceExtensionId':_0x3d7030[_0x6107('0x1a')]});}else{_0x5a8b44[_0x6107('0x13')]({'type':_0x3d7030[_0x6107('0x14')],'app':_0x6107('0x1e'),'appdata':_0x6107('0x2f'),'context':_0x3d7030[_0x6107('0x18')],'exten':_0x3d7030[_0x6107('0xa')],'priority':_0x52ddf2[_0x6107('0x28')]+_0x5e1111[_0x6107('0x19')]+_0x437e66++,'VoiceExtensionId':_0x3d7030[_0x6107('0x1a')]});}}if(_0x3d7030[_0x6107('0xf')]('answer')){if(_0x133ddb[_0x6107('0x30')](_0x3d7030['app'][_0x6107('0x31')]())>=0x0&&_0x3d7030[_0x6107('0x32')]!==_0x6107('0x33')){if(_0x3d7030[_0x6107('0x34')]){_0x5a8b44[_0x6107('0x13')]({'type':_0x3d7030['type'],'app':_0x6107('0x1e'),'appdata':_0x6107('0x35'),'context':_0x3d7030['context'],'exten':_0x3d7030[_0x6107('0xa')],'priority':_0x52ddf2[_0x6107('0x28')]+_0x5e1111[_0x6107('0x19')]+_0x437e66++,'VoiceExtensionId':_0x3d7030[_0x6107('0x1a')]});_0x5a8b44[_0x6107('0x13')]({'type':_0x3d7030['type'],'app':_0x6107('0x15'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3d7030[_0x6107('0x18')],'exten':_0x3d7030[_0x6107('0xa')],'priority':_0x52ddf2[_0x6107('0x28')]+_0x5e1111['priority']+_0x437e66++,'VoiceExtensionId':_0x3d7030['VoiceExtensionId']});}else{_0x5a8b44[_0x6107('0x13')]({'type':_0x3d7030[_0x6107('0x14')],'app':_0x6107('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3d7030[_0x6107('0x18')],'exten':_0x3d7030[_0x6107('0xa')],'priority':_0x52ddf2[_0x6107('0x28')]+_0x5e1111['priority']+_0x437e66++,'VoiceExtensionId':_0x3d7030[_0x6107('0x1a')]});_0x5a8b44[_0x6107('0x13')]({'type':_0x3d7030[_0x6107('0x14')],'app':_0x6107('0x15'),'appdata':_0x6107('0x36'),'context':_0x3d7030[_0x6107('0x18')],'exten':_0x3d7030['exten'],'priority':_0x52ddf2[_0x6107('0x28')]+_0x5e1111[_0x6107('0x19')]+_0x437e66++,'VoiceExtensionId':_0x3d7030[_0x6107('0x1a')]});}}}for(var _0x3c1902=0x0;_0x3c1902<_0x52ddf2[_0x6107('0x28')];_0x3c1902+=0x1){var _0x291042=_0x5e1111[_0x6107('0x19')]+_0x52ddf2['length'];var _0x48c5e2=_0x3c1902===_0x52ddf2[_0x6107('0x28')]-0x1?_0x5e1111[_0x6107('0x19')]+_0x5a8b44[_0x6107('0x28')]+_0x4714f7[_0x6107('0x28')]+0x2:_0x5e1111['priority']+_0x3c1902+0x1;_0x5a8b44[_0x6107('0x37')](_0x3c1902,0x0,{'type':_0x3d7030['type'],'app':_0x6107('0x38'),'appdata':_0x52ddf2[_0x3c1902]+'?'+_0x3d7030[_0x6107('0x18')]+_0x6107('0x39')+_0x291042+':'+_0x3d7030['context']+_0x6107('0x39')+_0x48c5e2,'exten':_0x3d7030[_0x6107('0xa')],'context':_0x3d7030[_0x6107('0x18')],'priority':_0x5e1111['priority']+_0x3c1902,'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});}_0x3d7030[_0x6107('0x19')]=_0x5a8b44['length']?_['last'](_0x5a8b44)[_0x6107('0x19')]+0x1:_0x5e1111[_0x6107('0x19')];_0x5e1111[_0x6107('0x19')]=(_0x4714f7[_0x6107('0x28')]?_['last'](_0x4714f7)['priority']:_0x3d7030[_0x6107('0x19')])+0x1;_0x5e1111['extensions']=_[_0x6107('0x3a')](_0x5e1111[_0x6107('0x12')],_0x5a8b44,[_0x3d7030],_0x4714f7);}_0x5e1111['extensions'][_0x6107('0x13')]({'type':_0x479bed[_0x289612][0x0][_0x6107('0x14')],'app':_0x6107('0x3b'),'exten':_0x479bed[_0x289612][0x0][_0x6107('0xa')],'context':_0x479bed[_0x289612][0x0][_0x6107('0x18')],'priority':_0x5e1111['priority'],'VoiceExtensionId':_0x479bed[_0x289612][0x0][_0x6107('0x1a')]});_0x464064[_0x6107('0x13')](_0x479bed[_0x289612][0x0][_0x6107('0x1a')]);_0x548224=_[_0x6107('0x3a')](_0x548224,_0x5e1111[_0x6107('0x12')]);}}return _0x1efecc['transaction'](function(_0x251f2b){return _0x1efecc[_0x6107('0x2')][_0x6107('0x7')][_0x6107('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x464064}},'transaction':_0x251f2b})['then'](function(_0x5ce7f2){return _0x1efecc[_0x6107('0x2')][_0x6107('0x7')][_0x6107('0x3d')](_[_0x6107('0x3e')](_0x548224,_0x6107('0x19')),{'transaction':_0x251f2b});});});})[_0x6107('0x3f')](function(_0x2f5a51){console[_0x6107('0x40')](_0x2f5a51);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 890423b..5a4700a 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 _0x769d=['birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','duplicate','Duplicate\x20Contact','CmContact','create','keys','pick','catch','stringify','cmContact','checkHopper','inspect','insert','into','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','fromQuery','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','VoiceQueueId','then','onlyIfOpen','query','all','VoiceQueue','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','../../../mysqldb','../../../config/environment','api','redis','defaults','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','phone\x20not\x20specified!'];(function(_0xd9dfa9,_0x35d3cf){var _0x5792d4=function(_0x4cd54c){while(--_0x4cd54c){_0xd9dfa9['push'](_0xd9dfa9['shift']());}};_0x5792d4(++_0x35d3cf);}(_0x769d,0x137));var _0xd769=function(_0x2346d4,_0x19bce9){_0x2346d4=_0x2346d4-0x0;var _0x25d1cf=_0x769d[_0x2346d4];return _0x25d1cf;};'use strict';var BPromise=require(_0xd769('0x0'));var util=require(_0xd769('0x1'));var _=require(_0xd769('0x2'));var fs=require('fs');var squel=require(_0xd769('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xd769('0x4'))['db'];var config=require(_0xd769('0x5'));var logger=require('../../../config/logger')(_0xd769('0x6'));config[_0xd769('0x7')]=_[_0xd769('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd769('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xd769('0x9')][0x2]||process['argv'][0x2]==='undefined'||process['argv'][0x2]===_0xd769('0xa')){throw new Error(_0xd769('0xb'));}var FILEPATH=process['argv'][0x2];if(!process[_0xd769('0x9')][0x3]||process[_0xd769('0x9')][0x3]===_0xd769('0xc')||process[_0xd769('0x9')][0x3]===_0xd769('0xa')||!process[_0xd769('0x9')][0x4]||process[_0xd769('0x9')][0x4]===_0xd769('0xc')||process['argv'][0x4]===_0xd769('0xa')){throw new Error(_0xd769('0xd'));}var FIELDS=_[_0xd769('0xe')](process[_0xd769('0x9')][0x3][_0xd769('0xf')](','),process['argv'][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xd769('0x9')][0x5]===_0xd769('0xc')||process[_0xd769('0x9')][0x5]===_0xd769('0xa')){throw new Error(_0xd769('0x10'));}var LISTID=process[_0xd769('0x9')][0x5];var COMPANYID=process[_0xd769('0x9')][0x6]&&process[_0xd769('0x9')][0x6]!==_0xd769('0xc')&&process[_0xd769('0x9')][0x6]!==_0xd769('0xa')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xd769('0x9')][0x7]!==_0xd769('0xc')&&process[_0xd769('0x9')][0x7]!==_0xd769('0xa')?process[_0xd769('0x9')][0x7]:null;if(!process[_0xd769('0x9')][0x8]||process[_0xd769('0x9')][0x8]===_0xd769('0xc')||process['argv'][0x8]===_0xd769('0xa')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x319ef1){logger[_0xd769('0x11')](_0x319ef1);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(_0x22c72e,_0x48c060,_0x5343aa,_0x4daef7){var _0x4a6231={'message':_0x48c060};_0x4a6231[_0x22c72e]=!![];if(_0x5343aa){_0x4a6231[_0xd769('0x12')]=_0x5343aa;}if(_0x4daef7){_0x4a6231[_0xd769('0x13')]=_0x4daef7;}return _0x4a6231;}function isEmail(_0x10264e){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))*$/[_0xd769('0x14')](_0x10264e);}function checkRow(_0x1f0a84,_0x22cc1c,_0x32ceab){return new BPromise(function(_0x20ff03,_0x692058){if(_[_0xd769('0x15')](_0x1f0a84)){return _0x692058(handleCheckRowError(_0xd769('0x11'),_0xd769('0x16'),null,_0x32ceab));}if(_0x1f0a84[_0xd769('0x17')]&&_0x1f0a84[_0xd769('0x17')]['length']){var _0x5df1b6=_[_0xd769('0x18')](_0x1f0a84[_0xd769('0x17')],_0xd769('0x19'))[_0xd769('0x1a')](';');return _0x692058(handleCheckRowError(_0xd769('0x11'),_0x5df1b6,null,_0x32ceab));}var _0x3cc970={};for(var _0x2961f2 in FIELDS){if(FIELDS[_0xd769('0x1b')](_0x2961f2)&&FIELDS[_0x2961f2]){_0x3cc970[_0x2961f2]=_0x1f0a84[_0xd769('0x1c')][0x0][FIELDS[_0x2961f2]]||_0x1f0a84[_0xd769('0x1c')][0x0]['\ufeff'+FIELDS[_0x2961f2]];}}if(!_0x3cc970[_0xd769('0x1d')]){return _0x692058(handleCheckRowError(_0xd769('0x11'),'firstName\x20not\x20specified!',null,_0x32ceab));}if(!_0x3cc970['phone']){return _0x692058(handleCheckRowError(_0xd769('0x11'),_0xd769('0x1e'),null,_0x32ceab));}if(_0x3cc970[_0xd769('0x1f')]){var _0x5376f8=moment(_0x3cc970[_0xd769('0x1f')],_0xd769('0x20'));if(!_0x5376f8[_0xd769('0x21')]()){return _0x692058(handleCheckRowError(_0xd769('0x11'),_0xd769('0x22'),null,_0x32ceab));}}if(_0x3cc970[_0xd769('0x23')]){if(!isEmail(_0x3cc970[_0xd769('0x23')])){return _0x692058(handleCheckRowError('error',_0xd769('0x24'),null,_0x32ceab));}}_0x3cc970[_0xd769('0x25')]=LISTID;_0x3cc970[_0xd769('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xd769('0x27')]&&_0x22cc1c){var _0x243128={};for(var _0x493c82=0x0,_0x3c128f=DUPLICATES['length'];_0x493c82<_0x3c128f;_0x493c82+=0x1){_0x243128[DUPLICATES[_0x493c82]]=_0x3cc970[DUPLICATES[_0x493c82]];}var _0x338508=_['find'](_0x22cc1c,_0x243128);if(_0x338508){return _0x692058(handleCheckRowError(_0xd769('0x28'),_0xd769('0x29'),_0x338508,_0x32ceab));}}return db[_0xd769('0x2a')][_0xd769('0x2b')](_0x3cc970,{'raw':!![],'hooks':![],'fields':_[_0xd769('0x2c')](_0x3cc970)})['then'](function(_0x1f2429){if(DUPLICATES&&DUPLICATES['length']&&_0x22cc1c){_0x22cc1c['push'](_[_0xd769('0x2d')](_0x3cc970,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1f2429['id'];return _0x20ff03();})[_0xd769('0x2e')](function(_0x132292){return _0x692058(handleCheckRowError(_0xd769('0x11'),'Error\x20while\x20creating\x20contact:\x20'+(_0x132292[_0xd769('0x19')]||JSON[_0xd769('0x2f')](_0x132292)),null,_0x32ceab));});});}function checkHopper(){function _0xfb9530(){return function(_0x19599c){logger[_0xd769('0x11')](_0xd769('0x30'),_0xd769('0x31'),util[_0xd769('0x32')](_0x19599c,{'showHidden':![],'depth':null}));};}var _0x5c53e2=function(_0x35bce7,_0x42ecaf){var _0x34cc74=squel[_0xd769('0x33')]()[_0xd769('0x34')]('cm_hopper')['fromQuery']([_0xd769('0x35'),_0xd769('0x36'),_0xd769('0x37'),_0xd769('0x25'),_0x42ecaf,_0xd769('0x38'),_0xd769('0x39')],squel[_0xd769('0x3a')]()[_0xd769('0x3b')](_0xd769('0x35'),_0xd769('0x35'))[_0xd769('0x3b')](_0xd769('0x3c'),_0xd769('0x36'))['field']('id',_0xd769('0x37'))['field'](LISTID[_0xd769('0x3d')](),_0xd769('0x25'))[_0xd769('0x3b')](_0x35bce7['id'][_0xd769('0x3d')](),_0x42ecaf)['field'](_0xd769('0x3c'),_0xd769('0x38'))[_0xd769('0x3b')]('NOW()',_0xd769('0x39'))['from'](_0xd769('0x3e'))[_0xd769('0x3f')](_0xd769('0x40'))['where'](_0xd769('0x41'),LISTID['toString']())[_0xd769('0x3f')](_0xd769('0x42'))[_0xd769('0x3f')](_0xd769('0x43'),squel['select']()[_0xd769('0x3b')](_0xd769('0x35'))[_0xd769('0x44')](_0xd769('0x45'))[_0xd769('0x3f')](_0x42ecaf+_0xd769('0x46'),_0x35bce7['id']['toString']())))['toString']();return _0x34cc74;};var _0x3caa1e=function(_0x4a9204,_0x108dc6){var _0x2febaa=squel['insert']()[_0xd769('0x34')](_0xd769('0x45'))[_0xd769('0x47')](['phone',_0xd769('0x36'),'ContactId',_0xd769('0x25'),_0x108dc6,'createdAt','updatedAt'],squel[_0xd769('0x3a')]()['field'](_0xd769('0x35'),'phone')[_0xd769('0x3b')](_0xd769('0x3c'),'scheduledAt')[_0xd769('0x3b')]('id','ContactId')[_0xd769('0x3b')](LISTID[_0xd769('0x3d')](),'ListId')[_0xd769('0x3b')](_0x4a9204['id'][_0xd769('0x3d')](),_0x108dc6)[_0xd769('0x3b')](_0xd769('0x3c'),'createdAt')[_0xd769('0x3b')](_0xd769('0x3c'),'updatedAt')[_0xd769('0x44')](_0xd769('0x3e'))[_0xd769('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0xd769('0x41'),LISTID[_0xd769('0x3d')]())['where'](_0xd769('0x48'),squel[_0xd769('0x49')](hopperContacts))['where'](_0xd769('0x42'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xd769('0x3a')]()[_0xd769('0x3b')]('calleridnum')[_0xd769('0x44')](_0xd769('0x4a'))[_0xd769('0x3f')](_0x108dc6+'\x20=\x20?',_0x4a9204['id']['toString']()))[_0xd769('0x3f')](_0xd769('0x43'),squel[_0xd769('0x3a')]()[_0xd769('0x3b')](_0xd769('0x35'))[_0xd769('0x44')]('cm_hopper')[_0xd769('0x3f')](_0x108dc6+_0xd769('0x46'),_0x4a9204['id'][_0xd769('0x3d')]())))[_0xd769('0x3d')]();return _0x2febaa;};function _0x4a0b0e(_0x306527,_0x2b2d25){var _0x5a39af=squel[_0xd769('0x33')]()[_0xd769('0x34')](_0xd769('0x45'))[_0xd769('0x47')]([_0xd769('0x35'),_0xd769('0x36'),_0xd769('0x37'),_0xd769('0x25'),_0x2b2d25,_0xd769('0x38'),'updatedAt'],squel[_0xd769('0x3a')]()[_0xd769('0x3b')](_0xd769('0x35'),_0xd769('0x35'))[_0xd769('0x3b')](_0xd769('0x3c'),'scheduledAt')[_0xd769('0x3b')]('id',_0xd769('0x37'))[_0xd769('0x3b')](LISTID[_0xd769('0x3d')](),_0xd769('0x25'))['field'](_0x306527['id'][_0xd769('0x3d')](),_0x2b2d25)['field']('NOW()',_0xd769('0x38'))[_0xd769('0x3b')](_0xd769('0x3c'),_0xd769('0x39'))[_0xd769('0x44')](_0xd769('0x3e'))['where'](_0xd769('0x40'))[_0xd769('0x3f')](_0xd769('0x41'),LISTID['toString']())['where'](_0xd769('0x48'),squel[_0xd769('0x49')](hopperContacts))[_0xd769('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0xd769('0x3d')]();return _0x5a39af;}function _0x11b722(_0x20c6d4,_0x399bfc){var _0x138563=squel[_0xd769('0x33')]()[_0xd769('0x34')](_0xd769('0x4b'))[_0xd769('0x47')](['phone',_0xd769('0x37'),'ListId',_0x399bfc,_0xd769('0x38'),_0xd769('0x39')],squel[_0xd769('0x3a')]()[_0xd769('0x3b')]('phone',_0xd769('0x35'))[_0xd769('0x3b')]('id',_0xd769('0x37'))['field'](LISTID['toString'](),'ListId')[_0xd769('0x3b')](_0x20c6d4['id'][_0xd769('0x3d')](),_0x399bfc)[_0xd769('0x3b')](_0xd769('0x3c'),'createdAt')[_0xd769('0x3b')]('NOW()',_0xd769('0x39'))[_0xd769('0x44')]('cm_contacts')['where'](_0xd769('0x40'))['where'](_0xd769('0x41'),LISTID[_0xd769('0x3d')]())[_0xd769('0x3f')](_0xd769('0x48'),squel['str'](hopperContacts))[_0xd769('0x3f')](_0xd769('0x42')))['toString']();return _0x138563;}return db['VoiceQueue'][_0xd769('0x4c')]({'where':{'type':_0xd769('0x4d')},'attributes':['id',_0xd769('0x4e')],'include':[{'model':db[_0xd769('0x4f')],'as':_0xd769('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x5b9f1d){var _0x49e24f=[];if(_0x5b9f1d){var _0x5bd424;for(var _0x1425a8=0x0,_0x403c8e;_0x1425a8<_0x5b9f1d[_0xd769('0x27')];_0x1425a8+=0x1){_0x403c8e=_0x5b9f1d[_0x1425a8][_0xd769('0x51')]({'plain':!![]});switch(_0x403c8e[_0xd769('0x4e')]){case _0xd769('0x52'):_0x49e24f[_0xd769('0x53')](db[_0xd769('0x54')]['query'](_0x3caa1e(_0x403c8e,_0xd769('0x55')))[_0xd769('0x56')](function(){})[_0xd769('0x2e')](_0xfb9530()));break;case _0xd769('0x57'):_0x49e24f[_0xd769('0x53')](db['sequelize'][_0xd769('0x58')](_0x5c53e2(_0x403c8e,'VoiceQueueId'))[_0xd769('0x56')](function(){})['catch'](_0xfb9530()));break;default:_0x49e24f[_0xd769('0x53')](db['sequelize'][_0xd769('0x58')](_0x4a0b0e(_0x403c8e,_0xd769('0x55')))[_0xd769('0x56')](function(){})[_0xd769('0x2e')](_0xfb9530()));}}}return _0x49e24f;})[_0xd769('0x59')]()['then'](function(){return db[_0xd769('0x5a')]['findAll']({'where':{'type':_0xd769('0x4d')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xd769('0x5b'),'where':{'id':LISTID}}]})[_0xd769('0x56')](function(_0x1fc0f1){var _0x1a186c=[];if(_0x1fc0f1){var _0xf7b953;for(var _0x3d915e=0x0,_0x190a20;_0x3d915e<_0x1fc0f1[_0xd769('0x27')];_0x3d915e+=0x1){_0x190a20=_0x1fc0f1[_0x3d915e]['get']({'plain':!![]});_0x1a186c[_0xd769('0x53')](db[_0xd769('0x54')][_0xd769('0x58')](_0x11b722(_0x190a20,'VoiceQueueId'))[_0xd769('0x56')](function(){})[_0xd769('0x2e')](_0xfb9530()));}}return _0x1a186c;})[_0xd769('0x59')]();})[_0xd769('0x56')](function(){return db[_0xd769('0x5c')]['findAll']({'attributes':['id',_0xd769('0x4e')],'include':[{'model':db[_0xd769('0x4f')],'as':_0xd769('0x50'),'where':{'id':LISTID}}]})[_0xd769('0x56')](function(_0x292fd4){var _0x2d38ca=[];if(_0x292fd4){for(var _0x27d90c=0x0,_0x30f49d;_0x27d90c<_0x292fd4[_0xd769('0x27')];_0x27d90c+=0x1){_0x30f49d=_0x292fd4[_0x27d90c][_0xd769('0x51')]({'plain':!![]});switch(_0x30f49d[_0xd769('0x4e')]){case'always':_0x2d38ca[_0xd769('0x53')](db[_0xd769('0x54')][_0xd769('0x58')](_0x3caa1e(_0x30f49d,'CampaignId'))[_0xd769('0x56')](function(){})['catch'](_0xfb9530()));break;case _0xd769('0x57'):_0x2d38ca[_0xd769('0x53')](db[_0xd769('0x54')]['query'](_0x5c53e2(_0x30f49d,_0xd769('0x5d')))[_0xd769('0x56')](function(){})[_0xd769('0x2e')](_0xfb9530()));break;default:_0x2d38ca['push'](db[_0xd769('0x54')]['query'](_0x4a0b0e(_0x30f49d,_0xd769('0x5d')))['then'](function(){})[_0xd769('0x2e')](_0xfb9530()));}}}return _0x2d38ca;})[_0xd769('0x59')]();})[_0xd769('0x56')](function(){return db[_0xd769('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xd769('0x4f')],'as':_0xd769('0x5b'),'where':{'id':LISTID}}]})[_0xd769('0x56')](function(_0x19cf23){var _0xb910fc=[];if(_0x19cf23){for(var _0xe9cb75=0x0,_0x3386a2;_0xe9cb75<_0x19cf23['length'];_0xe9cb75+=0x1){_0x3386a2=_0x19cf23[_0xe9cb75][_0xd769('0x51')]({'plain':!![]});_0xb910fc[_0xd769('0x53')](db[_0xd769('0x54')][_0xd769('0x58')](_0x11b722(_0x3386a2,_0xd769('0x5d')))['then'](function(){})[_0xd769('0x2e')](_0xfb9530()));}}return _0xb910fc;})[_0xd769('0x59')]();})[_0xd769('0x2e')](function(_0x2ae325){logger[_0xd769('0x11')](_0xd769('0x5e'),_0xd769('0x5f'),_0x2ae325[_0xd769('0x19')]);});}var processPromises=function(_0x5941eb){return BPromise['all'](promises)[_0xd769('0x56')](function(_0x10f28f){})['catch'](function(_0x1ddcae){logger[_0xd769('0x11')](_0xd769('0x60'),JSON['stringify'](_0x1ddcae));})[_0xd769('0x61')](function(){socket[_0xd769('0x62')](_0xd769('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5941eb){return _0x5941eb[_0xd769('0x64')]();}});};var endCsv=function(){return BPromise[_0xd769('0x65')]()[_0xd769('0x56')](function(){if(hopperContacts){return checkHopper();}})[_0xd769('0x56')](function(){socket[_0xd769('0x62')](_0xd769('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xd769('0x66')](FILEPATH);}catch(_0x3ee013){logger['error'](_0xd769('0x67'),JSON[_0xd769('0x2f')](_0x3ee013));}finally{process[_0xd769('0x68')](0x0);}});};process['on'](_0xd769('0x69'),function(){logger['info'](_0xd769('0x6a'));endCsv();});function main(){return BPromise[_0xd769('0x65')]()[_0xd769('0x56')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xd769('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xd769('0x56')](function(_0x266594){var _0x432ee5=fs[_0xd769('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xd769('0x6c')](_0x432ee5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a8016,_0x251be4){total+=0x1;var _0x1724f3=total;promises['push'](checkRow(_0x5a8016,_0x266594,_0x1724f3)[_0xd769('0x56')](function(){success+=0x1;})[_0xd769('0x2e')](function(_0x31db9b){if(_0x31db9b[_0xd769('0x11')]){errors+=0x1;delete _0x31db9b['error'];}else if(_0x31db9b[_0xd769('0x28')]){duplicates+=0x1;delete _0x31db9b[_0xd769('0x28')];}rows['push'](_0x31db9b);}));if(total%0xc8===0x0){_0x251be4[_0xd769('0x6d')]();return processPromises(_0x251be4);}},'complete':function(){return processPromises()[_0xd769('0x56')](function(){logger['info'](_0xd769('0x6e'));endCsv();});},'error':function(_0x5d7cdd,_0x28f8a3){logger[_0xd769('0x6f')](_0xd769('0x70'),JSON['stringify'](_0x5d7cdd));endCsv();}});})[_0xd769('0x2e')](function(_0x1b9d2e){logger['error'](_0xd769('0x71'),JSON['stringify'](_0x1b9d2e));});}main(); \ No newline at end of file +var _0xcbb8=['join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','ContactId','cm_contacts','id\x20IN\x20?','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','str','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','localhost','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0xcbb8,0xc3));var _0x8cbb=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xcbb8[_0x36dfbd];return _0x4ecad9;};'use strict';var BPromise=require(_0x8cbb('0x0'));var util=require(_0x8cbb('0x1'));var _=require(_0x8cbb('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x8cbb('0x3'));var Redis=require(_0x8cbb('0x4'));var db=require(_0x8cbb('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x8cbb('0x6'))(_0x8cbb('0x7'));config[_0x8cbb('0x8')]=_['defaults'](config[_0x8cbb('0x8')],{'host':_0x8cbb('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8cbb('0x8')]));require(_0x8cbb('0xa'))[_0x8cbb('0xb')](socket);try{if(!process[_0x8cbb('0xc')][0x2]||process[_0x8cbb('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x8cbb('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x8cbb('0xc')][0x3]===_0x8cbb('0xe')||process[_0x8cbb('0xc')][0x3]==='null'||!process[_0x8cbb('0xc')][0x4]||process[_0x8cbb('0xc')][0x4]===_0x8cbb('0xe')||process[_0x8cbb('0xc')][0x4]===_0x8cbb('0xd')){throw new Error(_0x8cbb('0xf'));}var FIELDS=_[_0x8cbb('0x10')](process[_0x8cbb('0xc')][0x3][_0x8cbb('0x11')](','),process[_0x8cbb('0xc')][0x4][_0x8cbb('0x11')](','));if(!process[_0x8cbb('0xc')][0x5]||process['argv'][0x5]===_0x8cbb('0xe')||process[_0x8cbb('0xc')][0x5]===_0x8cbb('0xd')){throw new Error(_0x8cbb('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x8cbb('0xc')][0x6]!==_0x8cbb('0xe')&&process[_0x8cbb('0xc')][0x6]!==_0x8cbb('0xd')?process[_0x8cbb('0xc')][0x6]:null;var DUPLICATES=process[_0x8cbb('0xc')][0x7]&&process[_0x8cbb('0xc')][0x7]!==_0x8cbb('0xe')&&process['argv'][0x7]!==_0x8cbb('0xd')?process[_0x8cbb('0xc')][0x7]:null;if(!process[_0x8cbb('0xc')][0x8]||process['argv'][0x8]===_0x8cbb('0xe')||process[_0x8cbb('0xc')][0x8]===_0x8cbb('0xd')){throw new Error(_0x8cbb('0x13'));}var SOCKET_TIMESTAMP=process[_0x8cbb('0xc')][0x8];}catch(_0x2450a3){logger[_0x8cbb('0x14')](_0x2450a3);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(_0x24ccbe,_0x42d424,_0x419523,_0x1d34c4){var _0x272963={'message':_0x42d424};_0x272963[_0x24ccbe]=!![];if(_0x419523){_0x272963[_0x8cbb('0x15')]=_0x419523;}if(_0x1d34c4){_0x272963[_0x8cbb('0x16')]=_0x1d34c4;}return _0x272963;}function isEmail(_0x1789ba){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x1789ba);}function checkRow(_0x552c07,_0x35d2a6,_0x4a2bf3){return new BPromise(function(_0x5d1e11,_0x1c611c){if(_[_0x8cbb('0x17')](_0x552c07)){return _0x1c611c(handleCheckRowError(_0x8cbb('0x14'),_0x8cbb('0x18'),null,_0x4a2bf3));}if(_0x552c07[_0x8cbb('0x19')]&&_0x552c07['errors']['length']){var _0x51bdfb=_['map'](_0x552c07[_0x8cbb('0x19')],_0x8cbb('0x1a'))[_0x8cbb('0x1b')](';');return _0x1c611c(handleCheckRowError('error',_0x51bdfb,null,_0x4a2bf3));}var _0x9e6e04={};for(var _0x570042 in FIELDS){if(FIELDS['hasOwnProperty'](_0x570042)&&FIELDS[_0x570042]){_0x9e6e04[_0x570042]=_0x552c07[_0x8cbb('0x1c')][0x0][FIELDS[_0x570042]]||_0x552c07[_0x8cbb('0x1c')][0x0]['\ufeff'+FIELDS[_0x570042]];}}if(!_0x9e6e04[_0x8cbb('0x1d')]){return _0x1c611c(handleCheckRowError(_0x8cbb('0x14'),_0x8cbb('0x1e'),null,_0x4a2bf3));}if(!_0x9e6e04[_0x8cbb('0x1f')]){return _0x1c611c(handleCheckRowError(_0x8cbb('0x14'),_0x8cbb('0x20'),null,_0x4a2bf3));}if(_0x9e6e04['birthDate']){var _0x309981=moment(_0x9e6e04[_0x8cbb('0x21')],_0x8cbb('0x22'));if(!_0x309981[_0x8cbb('0x23')]()){return _0x1c611c(handleCheckRowError(_0x8cbb('0x14'),_0x8cbb('0x24'),null,_0x4a2bf3));}}if(_0x9e6e04[_0x8cbb('0x25')]){if(!isEmail(_0x9e6e04['email'])){return _0x1c611c(handleCheckRowError(_0x8cbb('0x14'),_0x8cbb('0x26'),null,_0x4a2bf3));}}_0x9e6e04[_0x8cbb('0x27')]=LISTID;_0x9e6e04[_0x8cbb('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8cbb('0x29')]&&_0x35d2a6){var _0x4a5137={};for(var _0x37223a=0x0,_0x180cc4=DUPLICATES[_0x8cbb('0x29')];_0x37223a<_0x180cc4;_0x37223a+=0x1){_0x4a5137[DUPLICATES[_0x37223a]]=_0x9e6e04[DUPLICATES[_0x37223a]];}var _0x3d58e1=_[_0x8cbb('0x2a')](_0x35d2a6,_0x4a5137);if(_0x3d58e1){return _0x1c611c(handleCheckRowError(_0x8cbb('0x2b'),_0x8cbb('0x2c'),_0x3d58e1,_0x4a2bf3));}}return db[_0x8cbb('0x2d')][_0x8cbb('0x2e')](_0x9e6e04,{'raw':!![],'hooks':![],'fields':_[_0x8cbb('0x2f')](_0x9e6e04)})[_0x8cbb('0x30')](function(_0x3b6bd9){if(DUPLICATES&&DUPLICATES['length']&&_0x35d2a6){_0x35d2a6[_0x8cbb('0x31')](_[_0x8cbb('0x32')](_0x9e6e04,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3b6bd9['id'];return _0x5d1e11();})[_0x8cbb('0x33')](function(_0x5812a7){return _0x1c611c(handleCheckRowError(_0x8cbb('0x14'),_0x8cbb('0x34')+(_0x5812a7['message']||JSON[_0x8cbb('0x35')](_0x5812a7)),null,_0x4a2bf3));});});}function checkHopper(){function _0x41884b(){return function(_0x43f12b){logger['error'](_0x8cbb('0x36'),'checkHopper',util[_0x8cbb('0x37')](_0x43f12b,{'showHidden':![],'depth':null}));};}var _0x16eeb2=function(_0xc1d92e,_0x530e60){var _0x477558=squel[_0x8cbb('0x38')]()[_0x8cbb('0x39')](_0x8cbb('0x3a'))[_0x8cbb('0x3b')]([_0x8cbb('0x1f'),'scheduledAt','ContactId','ListId',_0x530e60,_0x8cbb('0x3c'),_0x8cbb('0x3d')],squel[_0x8cbb('0x3e')]()[_0x8cbb('0x3f')]('phone',_0x8cbb('0x1f'))[_0x8cbb('0x3f')](_0x8cbb('0x40'),_0x8cbb('0x41'))[_0x8cbb('0x3f')]('id','ContactId')[_0x8cbb('0x3f')](LISTID[_0x8cbb('0x42')](),_0x8cbb('0x27'))['field'](_0xc1d92e['id'][_0x8cbb('0x42')](),_0x530e60)[_0x8cbb('0x3f')](_0x8cbb('0x40'),_0x8cbb('0x3c'))['field']('NOW()',_0x8cbb('0x3d'))[_0x8cbb('0x43')]('cm_contacts')['where'](_0x8cbb('0x44'))[_0x8cbb('0x45')](_0x8cbb('0x46'),LISTID['toString']())[_0x8cbb('0x45')](_0x8cbb('0x47'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x8cbb('0x3f')](_0x8cbb('0x1f'))[_0x8cbb('0x43')](_0x8cbb('0x3a'))[_0x8cbb('0x45')](_0x530e60+_0x8cbb('0x48'),_0xc1d92e['id'][_0x8cbb('0x42')]())))[_0x8cbb('0x42')]();return _0x477558;};var _0x2e8a98=function(_0x20356a,_0xcd0ea6){var _0x30b3da=squel[_0x8cbb('0x38')]()[_0x8cbb('0x39')](_0x8cbb('0x3a'))['fromQuery']([_0x8cbb('0x1f'),'scheduledAt',_0x8cbb('0x49'),_0x8cbb('0x27'),_0xcd0ea6,_0x8cbb('0x3c'),_0x8cbb('0x3d')],squel[_0x8cbb('0x3e')]()['field'](_0x8cbb('0x1f'),_0x8cbb('0x1f'))[_0x8cbb('0x3f')](_0x8cbb('0x40'),_0x8cbb('0x41'))[_0x8cbb('0x3f')]('id','ContactId')[_0x8cbb('0x3f')](LISTID[_0x8cbb('0x42')](),'ListId')[_0x8cbb('0x3f')](_0x20356a['id'][_0x8cbb('0x42')](),_0xcd0ea6)[_0x8cbb('0x3f')](_0x8cbb('0x40'),_0x8cbb('0x3c'))[_0x8cbb('0x3f')](_0x8cbb('0x40'),_0x8cbb('0x3d'))[_0x8cbb('0x43')](_0x8cbb('0x4a'))[_0x8cbb('0x45')](_0x8cbb('0x44'))[_0x8cbb('0x45')](_0x8cbb('0x46'),LISTID[_0x8cbb('0x42')]())[_0x8cbb('0x45')](_0x8cbb('0x4b'),squel['str'](hopperContacts))[_0x8cbb('0x45')](_0x8cbb('0x47'))[_0x8cbb('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8cbb('0x3e')]()['field'](_0x8cbb('0x4c'))[_0x8cbb('0x43')](_0x8cbb('0x4d'))['where'](_0xcd0ea6+'\x20=\x20?',_0x20356a['id']['toString']()))[_0x8cbb('0x45')](_0x8cbb('0x4e'),squel[_0x8cbb('0x3e')]()[_0x8cbb('0x3f')](_0x8cbb('0x1f'))[_0x8cbb('0x43')](_0x8cbb('0x3a'))['where'](_0xcd0ea6+_0x8cbb('0x48'),_0x20356a['id']['toString']())))['toString']();return _0x30b3da;};function _0x3a0fb9(_0x3d0a81,_0x3f03e0){var _0x56cccd=squel[_0x8cbb('0x38')]()['into'](_0x8cbb('0x3a'))[_0x8cbb('0x3b')]([_0x8cbb('0x1f'),_0x8cbb('0x41'),'ContactId',_0x8cbb('0x27'),_0x3f03e0,_0x8cbb('0x3c'),_0x8cbb('0x3d')],squel[_0x8cbb('0x3e')]()[_0x8cbb('0x3f')](_0x8cbb('0x1f'),_0x8cbb('0x1f'))['field'](_0x8cbb('0x40'),_0x8cbb('0x41'))['field']('id',_0x8cbb('0x49'))[_0x8cbb('0x3f')](LISTID[_0x8cbb('0x42')](),'ListId')[_0x8cbb('0x3f')](_0x3d0a81['id']['toString'](),_0x3f03e0)[_0x8cbb('0x3f')]('NOW()',_0x8cbb('0x3c'))[_0x8cbb('0x3f')](_0x8cbb('0x40'),_0x8cbb('0x3d'))['from'](_0x8cbb('0x4a'))[_0x8cbb('0x45')](_0x8cbb('0x44'))[_0x8cbb('0x45')](_0x8cbb('0x46'),LISTID[_0x8cbb('0x42')]())['where'](_0x8cbb('0x4b'),squel[_0x8cbb('0x4f')](hopperContacts))[_0x8cbb('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x8cbb('0x42')]();return _0x56cccd;}function _0x533209(_0x56b99c,_0x193218){var _0x40b87b=squel[_0x8cbb('0x38')]()['into']('cm_hopper_black')[_0x8cbb('0x3b')](['phone','ContactId',_0x8cbb('0x27'),_0x193218,_0x8cbb('0x3c'),_0x8cbb('0x3d')],squel[_0x8cbb('0x3e')]()[_0x8cbb('0x3f')](_0x8cbb('0x1f'),_0x8cbb('0x1f'))[_0x8cbb('0x3f')]('id',_0x8cbb('0x49'))[_0x8cbb('0x3f')](LISTID[_0x8cbb('0x42')](),'ListId')[_0x8cbb('0x3f')](_0x56b99c['id']['toString'](),_0x193218)[_0x8cbb('0x3f')](_0x8cbb('0x40'),'createdAt')['field'](_0x8cbb('0x40'),_0x8cbb('0x3d'))[_0x8cbb('0x43')](_0x8cbb('0x4a'))[_0x8cbb('0x45')](_0x8cbb('0x44'))[_0x8cbb('0x45')](_0x8cbb('0x46'),LISTID['toString']())['where'](_0x8cbb('0x4b'),squel['str'](hopperContacts))[_0x8cbb('0x45')](_0x8cbb('0x47')))[_0x8cbb('0x42')]();return _0x40b87b;}return db[_0x8cbb('0x50')][_0x8cbb('0x51')]({'where':{'type':_0x8cbb('0x52')},'attributes':['id',_0x8cbb('0x53')],'include':[{'model':db['CmList'],'as':_0x8cbb('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x389d74){var _0x5ac698=[];if(_0x389d74){var _0x5dfcd1;for(var _0x38a456=0x0,_0x2848d4;_0x38a456<_0x389d74[_0x8cbb('0x29')];_0x38a456+=0x1){_0x2848d4=_0x389d74[_0x38a456][_0x8cbb('0x55')]({'plain':!![]});switch(_0x2848d4[_0x8cbb('0x53')]){case _0x8cbb('0x56'):_0x5ac698[_0x8cbb('0x31')](db['sequelize'][_0x8cbb('0x57')](_0x2e8a98(_0x2848d4,_0x8cbb('0x58')))[_0x8cbb('0x30')](function(){})['catch'](_0x41884b()));break;case _0x8cbb('0x59'):_0x5ac698[_0x8cbb('0x31')](db[_0x8cbb('0x5a')][_0x8cbb('0x57')](_0x16eeb2(_0x2848d4,'VoiceQueueId'))[_0x8cbb('0x30')](function(){})[_0x8cbb('0x33')](_0x41884b()));break;default:_0x5ac698['push'](db[_0x8cbb('0x5a')][_0x8cbb('0x57')](_0x3a0fb9(_0x2848d4,_0x8cbb('0x58')))[_0x8cbb('0x30')](function(){})[_0x8cbb('0x33')](_0x41884b()));}}}return _0x5ac698;})[_0x8cbb('0x5b')]()[_0x8cbb('0x30')](function(){return db[_0x8cbb('0x50')]['findAll']({'where':{'type':_0x8cbb('0x52')},'attributes':['id'],'include':[{'model':db[_0x8cbb('0x5c')],'as':_0x8cbb('0x5d'),'where':{'id':LISTID}}]})[_0x8cbb('0x30')](function(_0xb6f53f){var _0x23ffa9=[];if(_0xb6f53f){var _0x9f0927;for(var _0x392584=0x0,_0x3b8303;_0x392584<_0xb6f53f[_0x8cbb('0x29')];_0x392584+=0x1){_0x3b8303=_0xb6f53f[_0x392584][_0x8cbb('0x55')]({'plain':!![]});_0x23ffa9[_0x8cbb('0x31')](db['sequelize']['query'](_0x533209(_0x3b8303,'VoiceQueueId'))['then'](function(){})[_0x8cbb('0x33')](_0x41884b()));}}return _0x23ffa9;})[_0x8cbb('0x5b')]();})[_0x8cbb('0x30')](function(){return db[_0x8cbb('0x5e')][_0x8cbb('0x51')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x8cbb('0x5c')],'as':_0x8cbb('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x1b1a63){var _0x10bfac=[];if(_0x1b1a63){for(var _0x6f915b=0x0,_0x1e8d09;_0x6f915b<_0x1b1a63['length'];_0x6f915b+=0x1){_0x1e8d09=_0x1b1a63[_0x6f915b][_0x8cbb('0x55')]({'plain':!![]});switch(_0x1e8d09[_0x8cbb('0x53')]){case _0x8cbb('0x56'):_0x10bfac['push'](db[_0x8cbb('0x5a')]['query'](_0x2e8a98(_0x1e8d09,_0x8cbb('0x5f')))[_0x8cbb('0x30')](function(){})['catch'](_0x41884b()));break;case _0x8cbb('0x59'):_0x10bfac['push'](db[_0x8cbb('0x5a')]['query'](_0x16eeb2(_0x1e8d09,_0x8cbb('0x5f')))[_0x8cbb('0x30')](function(){})[_0x8cbb('0x33')](_0x41884b()));break;default:_0x10bfac['push'](db[_0x8cbb('0x5a')][_0x8cbb('0x57')](_0x3a0fb9(_0x1e8d09,_0x8cbb('0x5f')))[_0x8cbb('0x30')](function(){})[_0x8cbb('0x33')](_0x41884b()));}}}return _0x10bfac;})['all']();})[_0x8cbb('0x30')](function(){return db[_0x8cbb('0x5e')][_0x8cbb('0x51')]({'attributes':['id'],'include':[{'model':db[_0x8cbb('0x5c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x8cbb('0x30')](function(_0x231a5e){var _0x644c9b=[];if(_0x231a5e){for(var _0x90bf3b=0x0,_0x2627b1;_0x90bf3b<_0x231a5e['length'];_0x90bf3b+=0x1){_0x2627b1=_0x231a5e[_0x90bf3b][_0x8cbb('0x55')]({'plain':!![]});_0x644c9b['push'](db[_0x8cbb('0x5a')][_0x8cbb('0x57')](_0x533209(_0x2627b1,_0x8cbb('0x5f')))[_0x8cbb('0x30')](function(){})[_0x8cbb('0x33')](_0x41884b()));}}return _0x644c9b;})[_0x8cbb('0x5b')]();})[_0x8cbb('0x33')](function(_0xbba8b2){logger[_0x8cbb('0x14')](_0x8cbb('0x60'),_0x8cbb('0x61'),_0xbba8b2[_0x8cbb('0x1a')]);});}var processPromises=function(_0x1c39f1){return BPromise['all'](promises)[_0x8cbb('0x30')](function(_0x4c1b9f){})[_0x8cbb('0x33')](function(_0x1e2c32){logger[_0x8cbb('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0x8cbb('0x35')](_0x1e2c32));})['finally'](function(){socket[_0x8cbb('0x62')](_0x8cbb('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1c39f1){return _0x1c39f1['resume']();}});};var endCsv=function(){return BPromise[_0x8cbb('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x8cbb('0x62')](_0x8cbb('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8cbb('0x65')](FILEPATH);}catch(_0x2f942d){logger['error'](_0x8cbb('0x66'),JSON[_0x8cbb('0x35')](_0x2f942d));}finally{process['exit'](0x0);}});};process['on'](_0x8cbb('0x67'),function(){logger['info'](_0x8cbb('0x68'));endCsv();});function main(){return BPromise[_0x8cbb('0x64')]()[_0x8cbb('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x8cbb('0x2d')][_0x8cbb('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8cbb('0x30')](function(_0x3a26f5){var _0x25f4a7=fs[_0x8cbb('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8cbb('0x6a')](_0x25f4a7,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2516c0,_0x5f370b){total+=0x1;var _0x239cc1=total;promises[_0x8cbb('0x31')](checkRow(_0x2516c0,_0x3a26f5,_0x239cc1)[_0x8cbb('0x30')](function(){success+=0x1;})[_0x8cbb('0x33')](function(_0x33a768){if(_0x33a768[_0x8cbb('0x14')]){errors+=0x1;delete _0x33a768['error'];}else if(_0x33a768[_0x8cbb('0x2b')]){duplicates+=0x1;delete _0x33a768[_0x8cbb('0x2b')];}rows['push'](_0x33a768);}));if(total%0xc8===0x0){_0x5f370b[_0x8cbb('0x6b')]();return processPromises(_0x5f370b);}},'complete':function(){return processPromises()[_0x8cbb('0x30')](function(){logger[_0x8cbb('0x6c')](_0x8cbb('0x6d'));endCsv();});},'error':function(_0x3f0b92,_0x55bece){logger[_0x8cbb('0x6c')](_0x8cbb('0x6e'),JSON[_0x8cbb('0x35')](_0x3f0b92));endCsv();}});})[_0x8cbb('0x33')](function(_0x52789d){logger[_0x8cbb('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x8cbb('0x35')](_0x52789d));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d1b6411..b4dc8f5 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 _0x98e6=['phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','No\x20agent\x20available','path','lodash','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','length','all','then','split','filter','CmContactHasItem','update','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','cm_hopper','phone','ContactId','createdAt','updatedAt','priority','UserId','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_hopper_black','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','insert','into','fromQuery','scheduledat','ListId','recallme','\x22always\x22','cm_contacts.createdAt\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','scheduledAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','Received\x20SIGINT','error','message','exit','errors','push','code','info','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','keys','includes','header','ContactItemType','findAll','name','_description','writeFileSync','parse','createReadStream','data','find','isValid','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','description','replace','SystemRow','appendFileSync','rows','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','contactId','orderBy','voice_queues','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x98e6,0x182));var _0x698e=function(_0x4f35ec,_0x840f6e){_0x4f35ec=_0x4f35ec-0x0;var _0x111757=_0x98e6[_0x4f35ec];return _0x111757;};'use strict';var fs=require('fs');var path=require(_0x698e('0x0'));var _=require(_0x698e('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x698e('0x2'));var moment=require(_0x698e('0x3'));var squel=require(_0x698e('0x4'));var Redis=require(_0x698e('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x698e('0x6'));var shared=require(_0x698e('0x7'));var logger=require(_0x698e('0x8'))(_0x698e('0x9'));config['redis']=_[_0x698e('0xa')](config[_0x698e('0xb')],{'host':_0x698e('0xc'),'port':0x18eb});var socket=require(_0x698e('0xd'))(new Redis(config[_0x698e('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x698e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x698e('0xf'));function isEmail(_0x7fcc87){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))*$/[_0x698e('0x10')](_0x7fcc87);}function selectNotIn(_0x2092e0,_0x5dec5c,_0x8e6c23,_0xdc2981,_0x537bae){return squel[_0x698e('0x11')]()[_0x698e('0x12')]('phone')['from'](_0xdc2981)[_0x698e('0x13')](_0x5dec5c,null,_0x5dec5c+'.id\x20=\x20'+_0xdc2981+'.'+_0x8e6c23)[_0x698e('0x14')](_0xdc2981+'.'+_0x8e6c23+_0x698e('0x15')+_0x2092e0+'.'+_0x8e6c23)[_0x698e('0x14')](_0x5dec5c+_0x698e('0x16')+_0x537bae['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4d38ae,_0x400df4){promisesAdditionalPhones=[];return db[_0x698e('0x17')]['findAll']({'raw':!![],'attributes':['id',_0x698e('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x20860d){if(_0x20860d!==null){var _0x13f47a=[];for(var _0x5b4b1a=0x0;_0x5b4b1a<_0x20860d[_0x698e('0x19')];_0x5b4b1a++){var _0x561d0b=_0x20860d[_0x5b4b1a];_0x13f47a['push'](insertAdditionalPhones(_0x561d0b));}}Promise[_0x698e('0x1a')](_0x13f47a)[_0x698e('0x1b')](function(){_0x4d38ae({'val':0x1});});});});}function insertAdditionalPhones(_0xb0f49b){return new Promise(function(_0x37e715,_0x102d9c){var _0x2d2eeb=_0xb0f49b['AdditionalPhones'];var _0x1956ed=_0x2d2eeb[_0x698e('0x1c')](';');var _0x400109=[];orderBy=0x0;for(var _0x1ed3da=0x0;_0x1ed3da<_0x1956ed['length'];_0x1ed3da++){_0x400109['push'](splitAdditionalPhone(_0xb0f49b['id'],_0x1956ed[_0x1ed3da]));}Promise[_0x698e('0x1a')](_0x400109)['then'](function(){_0x37e715({'val':_0x1956ed[_0x698e('0x19')]});});});}function splitAdditionalPhone(_0x56cf4f,_0x3ce64f){return new Promise(function(_0x1b82f4,_0x4f09e2){var _0x10d8e1=_0x3ce64f['split'](':');var _0x6daa1c=_0x10d8e1[0x0];var _0x496fc7=_0x10d8e1[0x1];if(!_['isNil'](_0x496fc7)){var _0xef44ed=_0x496fc7[_0x698e('0x1c')]('|');var _0x3b3916=[];for(var _0x18badd=0x0;_0x18badd<_0xef44ed[_0x698e('0x19')];_0x18badd++){if(_0xef44ed[_0x18badd]!==''){var _0x3a71d3=_[_0x698e('0x1d')](promisesAdditionalPhones,{'contactId':_0x56cf4f,'phone':_0xef44ed[_0x18badd]});if(_0x3a71d3[_0x698e('0x19')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x56cf4f,'contactTypeId':_0x6daa1c,'phone':_0xef44ed[_0x18badd],'orderBy':orderBy});}}}_0x1b82f4({'ok':0x1});}else _0x1b82f4({'res':0x0});});}function createAdditionalPhone(_0xa67047,_0x4b8169,_0x1239e0,_0x1d095c){var _0x36aea9='';var _0x31c840='';var _0x1cab94=_0x1239e0[_0x698e('0x1c')]('§');_0x36aea9=_0x1cab94[0x0];if(_0x1cab94[_0x698e('0x19')]==0x2)_0x31c840=_0x1cab94[0x1];return new Promise(function(_0x1b7a99,_0x54c54d){return db[_0x698e('0x1e')]['findOne']({'where':{'CmContactId':_0xa67047,'item':_0x36aea9}})[_0x698e('0x1b')](function(_0x54f4ba){if(_0x54f4ba){return db['CmContactHasItem'][_0x698e('0x1f')]({'ItemTypeId':_0x4b8169,'description':_0x31c840,'OrderBy':_0x1d095c},{'where':{'CmContactId':_0xa67047,'item':_0x36aea9}})['then'](function(_0x6e127){_0x1b7a99({'res':_0x698e('0x20')});});}else{return db[_0x698e('0x1e')][_0x698e('0x21')]({'CmContactId':_0xa67047,'item':_0x36aea9,'description':_0x31c840,'ItemTypeId':_0x4b8169,'OrderBy':_0x1d095c,'ItemClass':_0x698e('0x22')})[_0x698e('0x1b')](function(_0x5e9273){_0x1b7a99({'res':'inserted'});});}});});}function insertCmHopper(_0x24c970,_0x38d90a,_0x342d53,_0x5dd4fd,_0x5cf71c){var _0x36ddfb=[_0x698e('0x23'),_0x698e('0x24'),_0x698e('0x25'),_0x698e('0x26'),_0x38d90a+'.'+_0x5dd4fd,_0x698e('0x27'),_0x698e('0x28'),_0x698e('0x29'),_0x698e('0x2a'),'\x22'+_0x5cf71c+'\x22'];return squel['insert']()['into'](_0x698e('0x2b'))['fromQuery']([_0x698e('0x2c'),'scheduledat',_0x698e('0x2d'),'ListId',_0x5dd4fd,_0x698e('0x2e'),_0x698e('0x2f'),_0x698e('0x30'),_0x698e('0x31'),'recallme'],squel[_0x698e('0x11')]()[_0x698e('0x32')](_0x36ddfb)[_0x698e('0x33')](_0x38d90a)[_0x698e('0x13')](_0x698e('0x34'),null,_0x698e('0x35')+_0x38d90a+_0x698e('0x36'))[_0x698e('0x13')](_0x342d53,null,_0x342d53+_0x698e('0x37')+_0x38d90a+'.'+_0x5dd4fd)[_0x698e('0x14')](_0x38d90a+_0x698e('0x38'),_0x24c970)[_0x698e('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x698e('0x39'),selectNotIn(_0x38d90a,_0x342d53,_0x5dd4fd,'cm_hopper',['\x22always\x22',_0x698e('0x3a')]))[_0x698e('0x14')](_0x698e('0x39'),selectNotIn(_0x38d90a,_0x342d53,_0x5dd4fd,_0x698e('0x2b'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x5d3339,_0xf9dda1,_0x14e75e,_0x51209d){var _0x326f06=[_0x698e('0x23'),'cm_contacts.id',_0x698e('0x26'),_0xf9dda1+'.'+_0x51209d,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()['into'](_0x698e('0x3b'))['fromQuery']([_0x698e('0x2c'),_0x698e('0x2d'),'ListId',_0x51209d,_0x698e('0x2e'),_0x698e('0x2f')],squel[_0x698e('0x11')]()[_0x698e('0x32')](_0x326f06)[_0x698e('0x33')](_0xf9dda1)['join'](_0x698e('0x34'),null,_0x698e('0x35')+_0xf9dda1+_0x698e('0x36'))[_0x698e('0x13')](_0x14e75e,null,_0x14e75e+'.id\x20=\x20'+_0xf9dda1+'.'+_0x51209d)['where'](_0xf9dda1+_0x698e('0x38'),_0x5d3339)[_0x698e('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x698e('0x14')](_0x698e('0x39'),squel['select']()[_0x698e('0x12')](_0x698e('0x2c'))[_0x698e('0x33')](_0x698e('0x3b'))[_0x698e('0x14')](_0x698e('0x3c'),_0x5d3339)[_0x698e('0x14')](_0x51209d+_0x698e('0x15')+_0xf9dda1+'.'+_0x51209d)))[_0x698e('0x3d')]();}function insertTzCmHopper(_0x554c28,_0x5b2cee,_0x1e4f7a,_0x1c5f06,_0x5eda11,_0x7b6171){var _0x13725b=['cm_contacts.phone',_0x698e('0x3e')+_0x7b6171+_0x698e('0x3f'),_0x698e('0x25'),_0x698e('0x26'),_0x5b2cee+'.'+_0x1c5f06,'cm_contacts.createdAt',_0x698e('0x28'),_0x698e('0x29'),_0x698e('0x2a'),'\x22'+_0x5eda11+'\x22'];var _0x91ed8=squel[_0x698e('0x40')]()[_0x698e('0x41')](_0x698e('0x2b'))[_0x698e('0x42')]([_0x698e('0x2c'),_0x698e('0x43'),'ContactId',_0x698e('0x44'),_0x1c5f06,_0x698e('0x2e'),_0x698e('0x2f'),_0x698e('0x30'),_0x698e('0x31'),_0x698e('0x45')],squel[_0x698e('0x11')]()['fields'](_0x13725b)[_0x698e('0x33')](_0x5b2cee)[_0x698e('0x13')]('cm_contacts',null,_0x698e('0x35')+_0x5b2cee+_0x698e('0x36'))[_0x698e('0x13')](_0x1e4f7a,null,_0x1e4f7a+'.id\x20=\x20'+_0x5b2cee+'.'+_0x1c5f06)[_0x698e('0x13')](_0x7b6171,null,_0x7b6171+_0x698e('0x37')+_0x5b2cee+'.'+_0x1c5f06)[_0x698e('0x14')](_0x5b2cee+_0x698e('0x38'),_0x554c28)[_0x698e('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x698e('0x39'),selectNotIn(_0x5b2cee,_0x1e4f7a,_0x1c5f06,_0x698e('0x2b'),[_0x698e('0x46'),'\x22onlyIfOpen\x22']))[_0x698e('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5b2cee,_0x1e4f7a,_0x1c5f06,_0x698e('0x2b'),[_0x698e('0x46')])))[_0x698e('0x3d')]();return _0x91ed8;}function insertTzCmHopperBlack(_0x2b7409,_0x3e298d,_0x3796f8,_0x1cf00e){var _0x17d704=[_0x698e('0x23'),_0x698e('0x25'),_0x698e('0x26'),_0x3e298d+'.'+_0x1cf00e,_0x698e('0x27'),_0x698e('0x28')];return squel[_0x698e('0x40')]()[_0x698e('0x41')](_0x698e('0x3b'))[_0x698e('0x42')](['phone',_0x698e('0x2d'),_0x698e('0x44'),_0x1cf00e,_0x698e('0x2e'),_0x698e('0x2f')],squel['select']()[_0x698e('0x32')](_0x17d704)['from'](_0x3e298d)[_0x698e('0x13')](_0x698e('0x34'),null,_0x698e('0x35')+_0x3e298d+'.CmListId')['join'](_0x3796f8,null,_0x3796f8+_0x698e('0x37')+_0x3e298d+'.'+_0x1cf00e)['where'](_0x3e298d+_0x698e('0x38'),_0x2b7409)[_0x698e('0x14')](_0x698e('0x47'),NOW)[_0x698e('0x14')](_0x698e('0x39'),squel[_0x698e('0x11')]()[_0x698e('0x12')](_0x698e('0x2c'))[_0x698e('0x33')](_0x698e('0x3b'))['where'](_0x698e('0x3c'),_0x2b7409)[_0x698e('0x14')](_0x1cf00e+'\x20=\x20'+_0x3e298d+'.'+_0x1cf00e)))[_0x698e('0x3d')]();}function insertCmHopperAdditionalPhones(_0x4aece6){var _0x135b90=[_0x698e('0x48'),_0x698e('0x49'),_0x698e('0x4a'),_0x698e('0x4b'),'cm_contact_has_items.updatedAt'];return squel[_0x698e('0x40')]()['into'](_0x698e('0x4c'))[_0x698e('0x42')]([_0x698e('0x4d'),_0x698e('0x2c'),_0x698e('0x4e'),_0x698e('0x2e'),_0x698e('0x2f')],squel[_0x698e('0x11')]()[_0x698e('0x32')](_0x135b90)['from'](_0x698e('0x2b'))['join'](_0x698e('0x34'),null,_0x698e('0x4f'))['join'](_0x698e('0x50'),null,_0x698e('0x51'))[_0x698e('0x14')]('cm_hopper.ListId\x20=\x20?',_0x4aece6)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x698e('0x3d')]();}function insertCmContact(_0x9f6dd,_0x4cfeb5,_0x250318,_0xe8e03a){var _0x5425a6=_[_0x698e('0x52')](_['keys'](_0xe8e03a),[_0x698e('0x44'),'CompanyId',_0x698e('0x2e'),_0x698e('0x2f'),_0x698e('0x53')]);return squel[_0x698e('0x40')]()['into'](_0x698e('0x34'))[_0x698e('0x42')](_0x5425a6,squel[_0x698e('0x11')]()[_0x698e('0x32')](_0x5425a6)[_0x698e('0x33')](_0x4cfeb5)['where']('('+_0x250318[_0x698e('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x698e('0x11')]()['fields'](_0x250318)[_0x698e('0x33')](_0x698e('0x34'))[_0x698e('0x14')](_0x698e('0x3c'),_0x9f6dd)['where'](_0x698e('0x54')))[_0x698e('0x14')](_0x698e('0x55'),squel[_0x698e('0x11')]()[_0x698e('0x12')]('MIN(id)',_0x698e('0x56'))[_0x698e('0x33')](_0x4cfeb5)[_0x698e('0x57')](_0x250318[_0x698e('0x13')](','))))[_0x698e('0x3d')]();}function handleStop(){logger['info'](_0x698e('0x58'));stopped=!![];}function handleUncaughtException(_0x311e2d){logger[_0x698e('0x59')](_0x311e2d[_0x698e('0x5a')]);process[_0x698e('0x5b')](0x1);}function handleError(_0xb8a0f4,_0x11a515){stats[_0x698e('0x5c')][_0x698e('0x5d')]({'name':_0x11a515[_0x698e('0x5e')],'message':_0x11a515[_0x698e('0x5a')],'row':_0xb8a0f4});}function handleQuery(_0x1a6ca0){logger[_0x698e('0x5f')](_0x1a6ca0);return db[_0x698e('0x60')][_0x698e('0x61')](_0x1a6ca0)[_0x698e('0x62')](function(_0x33485f){results[_0x698e('0x5d')](_0x33485f);})[_0x698e('0x63')](function(_0x2cd383){logger[_0x698e('0x59')](_0x2cd383[_0x698e('0x5a')]);});}function updateTzCampaigns(_0x2b75e0){return new Promise(function(_0x58dd40,_0x5e1d62){var _0x2df277=squel[_0x698e('0x11')]()[_0x698e('0x32')]([_0x698e('0x64'),_0x698e('0x65')])[_0x698e('0x33')](_0x698e('0x66'))['join'](_0x698e('0x67'),null,_0x698e('0x68'))[_0x698e('0x14')](_0x698e('0x69')+_0x2b75e0);db[_0x698e('0x60')][_0x698e('0x61')](_0x2df277[_0x698e('0x3d')]())[_0x698e('0x62')](function(_0x1d9f7e){var _0x4485c7=[];for(var _0x38c791=0x0;_0x38c791<_0x1d9f7e[_0x698e('0x19')];_0x38c791++){_0x4485c7[_0x698e('0x5d')](getTimezoneData(_0x1d9f7e[_0x38c791],tmp_campaigns));}BPromise[_0x698e('0x1a')](_0x4485c7)[_0x698e('0x1b')](function(){_0x58dd40({'val':0x1});});})[_0x698e('0x63')](function(_0x1cee21){logger['error'](_0x1cee21[_0x698e('0x5a')]);_0x58dd40({'val':0x0});});});}function updateTzVoiceQueues(_0x12e2c9){return new Promise(function(_0x43d787,_0x408c1e){var _0x34abe3=squel[_0x698e('0x11')]()[_0x698e('0x32')]([_0x698e('0x6a'),_0x698e('0x6b')])['from']('voice_queues')['join'](_0x698e('0x6c'),null,_0x698e('0x6d'))['where']('voice_queues_has_cm_lists.CmListId='+_0x12e2c9);db['sequelize']['query'](_0x34abe3[_0x698e('0x3d')]())[_0x698e('0x62')](function(_0x3dc0bc){var _0xd58476=[];for(var _0x339412=0x0;_0x339412<_0x3dc0bc[_0x698e('0x19')];_0x339412++){_0xd58476[_0x698e('0x5d')](getTimezoneData(_0x3dc0bc[_0x339412],tmp_voice_queues));}BPromise['all'](_0xd58476)[_0x698e('0x1b')](function(){_0x43d787({'val':0x1});});})[_0x698e('0x63')](function(_0x3d39ed){logger[_0x698e('0x59')](_0x3d39ed[_0x698e('0x5a')]);_0x43d787({'val':0x0});});});}function getTimezoneData(_0x342086,_0x290ad2){return new Promise(function(_0x3deb0d,_0x34200c){var _0x50971c=shared[_0x698e('0x6e')];var _0x3e8b70=_0x50971c[_0x342086[_0x698e('0x6f')]];if(_[_0x698e('0x70')](_0x3e8b70)){_0x3deb0d({'ret':0x1});}else{var _0x574d36=_0x3e8b70[_0x698e('0x71')];var _0x5e98e2=squel[_0x698e('0x40')]()[_0x698e('0x41')](_0x290ad2)[_0x698e('0x72')]('id',_0x342086['id'])[_0x698e('0x72')](_0x698e('0x73'),_0x574d36)[_0x698e('0x72')](_0x698e('0x6f'),_0x342086[_0x698e('0x6f')])[_0x698e('0x3d')]();return db[_0x698e('0x60')][_0x698e('0x61')](_0x5e98e2)['spread'](function(_0x17438c){_0x3deb0d({'ret':0x1});})[_0x698e('0x63')](function(_0x5d55cc){logger[_0x698e('0x59')](_0x5d55cc[_0x698e('0x5a')]);_0x34200c({'ret':0x1});});}});}function handleTZQuery(_0x31bf02){logger[_0x698e('0x5f')](_0x31bf02);return db[_0x698e('0x60')]['query'](_0x31bf02)[_0x698e('0x62')](function(_0x25a324){})[_0x698e('0x63')](function(_0x5689b5){logger['error'](_0x5689b5['message']);});}function main(_0x174f56,_0x1e4580,_0x11b2b7,_0x2e7db5){logger[_0x698e('0x5f')](_0x698e('0x74'),_0x174f56,JSON[_0x698e('0x75')](_0x1e4580));process[_0x698e('0x76')](_0x698e('0x77'));var _0x394895=_0x1e4580[_0x698e('0x78')];var _0x51dd5e=_[_0x698e('0x79')](_0x394895);var _0x3c5589=_0x1e4580[_0x698e('0x7a')];var _0x42e70c=path[_0x698e('0x13')](config[_0x698e('0x7b')],_0x698e('0x7c'),_0x3c5589+_0x698e('0x7d'));hasTZ=_[_0x698e('0x7e')](_0x394895)[_0x698e('0x7f')](_0x698e('0x6f'));var _0x188cdd=_[_0x698e('0x7e')](_0x394895)[_0x698e('0x13')]();logger['info'](_0x698e('0x80'),_0x188cdd);db[_0x698e('0x81')][_0x698e('0x82')]({'raw':!![],'attributes':['id',_0x698e('0x83')]})['then'](function(_0x46773b){for(var _0x44a957=0x0;_0x44a957<_0x46773b['length'];_0x44a957++){if(_0x46773b[_0x44a957]['name']in _0x394895){contactItemTypes[_0x698e('0x5d')](_0x46773b[_0x44a957]);delete _0x51dd5e[_0x46773b[_0x44a957][_0x698e('0x83')]];hasAdditionalPhones=!![];}for(var _0x2b7f62 in _0x394895){if(_0x46773b[_0x44a957]['name']+_0x698e('0x84')===_0x2b7f62){phoneDescriptions[_0x698e('0x5d')]({'itemTypeId':_0x46773b[_0x44a957]['id'],'description':_0x2b7f62});delete _0x51dd5e[_0x2b7f62];}}}if(hasAdditionalPhones)_0x51dd5e['AdditionalPhones']='';var _0x2d066d=_[_0x698e('0x7e')](_0x51dd5e)['join']();logger['info'](_0x698e('0x80'),_0x2d066d);fs[_0x698e('0x85')](_0x42e70c,_0x2d066d+'\x0a');Papa[_0x698e('0x86')](fs[_0x698e('0x87')](_0x174f56),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2cd5ee,_0x1100f2){try{for(var _0x1cf0a7=0x0,_0x56d4ac=[];_0x1cf0a7<_0x2cd5ee[_0x698e('0x88')][_0x698e('0x19')];_0x1cf0a7++){stats['rows']+=0x1;if(_0x2cd5ee[_0x698e('0x5c')][_0x1cf0a7]){handleError(_0x2cd5ee[_0x698e('0x88')][_0x1cf0a7],_0x2cd5ee['errors'][_0x1cf0a7]);}else{var _0x4949c1=[];var _0x1a76c9=[];var _0x2054a0={};for(var _0x4e9abe in _0x394895){let _0x57e99f=contactItemTypes[_0x698e('0x89')](_0x12997f=>_0x12997f[_0x698e('0x83')]===_0x4e9abe);let _0x13557b=contactItemTypes['find'](_0xdecdf6=>_0xdecdf6[_0x698e('0x83')]+_0x698e('0x84')===_0x4e9abe);if(_[_0x698e('0x70')](_0x57e99f)&&_['isNil'](_0x13557b)){if(_0x394895['hasOwnProperty'](_0x4e9abe)){if(_0x2cd5ee[_0x698e('0x88')][_0x1cf0a7][_0x394895[_0x4e9abe]]){var _0x3d737c=_['trim'](_0x2cd5ee[_0x698e('0x88')][_0x1cf0a7][_0x394895[_0x4e9abe]]['replace'](/"/g,'\x27'));switch(_0x4e9abe){case _0x698e('0x43'):var _0x46f820=moment(_0x3d737c,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x46f820[_0x698e('0x8a')]()){_0x56d4ac[_0x698e('0x5d')]('\x22'+_0x3d737c+'\x22');}else{_0x4949c1['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x1a8ee4=parseInt(_0x3d737c);_0x3d737c=_['isNaN'](_0x1a8ee4)||_0x1a8ee4<0x0||_0x1a8ee4>0x4?_0x2e7db5?0x3:0x2:_0x1a8ee4;_0x56d4ac['push']('\x22'+_0x3d737c+'\x22');break;case _0x698e('0x31'):var _0x1afc62=parseInt(_0x3d737c);if(_[_0x698e('0x8b')](_0x1afc62)&&_[_0x698e('0x7f')](_0x11b2b7,_0x1afc62)){_0x56d4ac[_0x698e('0x5d')]('\x22'+_0x1afc62+'\x22');}else{_0x4949c1['push'](_0x698e('0x8c'));}break;case _0x698e('0x8d'):if(isEmail(_0x3d737c)){_0x56d4ac[_0x698e('0x5d')]('\x22'+_0x3d737c+'\x22');}else{_0x4949c1[_0x698e('0x5d')](_0x698e('0x8e'));}break;case _0x698e('0x8f'):var _0x591b67=moment(_0x3d737c,_0x698e('0x90'),!![]);if(_0x591b67[_0x698e('0x8a')]()){_0x56d4ac[_0x698e('0x5d')]('\x22'+_0x3d737c+'\x22');}else{_0x4949c1[_0x698e('0x5d')](_0x698e('0x91'));}break;case _0x698e('0x6f'):var _0xcc4761=shared[_0x698e('0x6e')];var _0x558a3c=_0xcc4761[_0x3d737c];if(!_['isNil'](_0x558a3c)){var _0x286e44=_0x558a3c['utcOffset'];_0x56d4ac['push']('\x22'+_0x3d737c+'\x22');_0x56d4ac[_0x698e('0x5d')]('\x22'+_0x286e44+'\x22');}break;default:_0x56d4ac[_0x698e('0x5d')]('\x22'+_0x3d737c+'\x22');}}else{switch(_0x4e9abe){case _0x698e('0x92'):case _0x698e('0x2c'):_0x4949c1['push'](_0x4e9abe+_0x698e('0x93'));break;default:_0x56d4ac[_0x698e('0x5d')]('\x22\x22');}}}}else{var _0x202d9f='';if(!_[_0x698e('0x70')](_0x57e99f)){if(!_0x2054a0['hasOwnProperty'](_0x57e99f['id'])){if(!_[_0x698e('0x70')](_0x2cd5ee['data'][_0x1cf0a7][_0x394895[_0x4e9abe]])){var _0x3d737c=_[_0x698e('0x94')](_0x2cd5ee[_0x698e('0x88')][_0x1cf0a7][_0x394895[_0x4e9abe]]['replace'](/"/g,'\x27'));var _0xda779e=phoneDescriptions[_0x698e('0x89')](_0x38d253=>_0x38d253['itemTypeId']===_0x57e99f['id']);if(!_[_0x698e('0x70')](_0xda779e)){var _0x2bb60d=_[_0x698e('0x94')](_0x2cd5ee[_0x698e('0x88')][_0x1cf0a7][_0x394895[_0xda779e[_0x698e('0x95')]]][_0x698e('0x96')](/"/g,'\x27'));if(!_['isNil'](_0x2bb60d))_0x3d737c=_0x3d737c+'§'+_0x2bb60d;}if(_0x202d9f=='')_0x202d9f=_0x3d737c;else _0x202d9f+='|'+_0x3d737c;}_0x1a76c9[_0x698e('0x5d')](_0x57e99f['id']+':'+_0x202d9f);_0x2054a0[_0x57e99f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x56d4ac[_0x698e('0x5d')]('\x22'+_0x1a76c9[_0x698e('0x13')](';')+'\x22');}if(_0x4949c1[_0x698e('0x19')]){handleError(_0x2cd5ee[_0x698e('0x88')][_0x1cf0a7],{'code':_0x698e('0x97'),'message':_0x4949c1['join']()});}else{fs[_0x698e('0x98')](_0x42e70c,_0x56d4ac['join']()+'\x0a');}_0x56d4ac=[];}if(!(stats[_0x698e('0x99')]%0xc8)){socket[_0x698e('0x9a')](_0x698e('0x9b')+_0x3c5589,stats);stats[_0x698e('0x5c')]=[];}}if(stopped){logger[_0x698e('0x5f')]('Abort\x20parser');_0x1100f2[_0x698e('0x9c')]();}}catch(_0x417ef4){handleError(_0x2cd5ee[_0x698e('0x88')][_0x1cf0a7],{'code':_0x698e('0x9d'),'message':_0x417ef4[_0x698e('0x5a')]});logger[_0x698e('0x59')](_0x698e('0x9e'),_0x417ef4[_0x698e('0x5a')]);}},'complete':function(){try{var _0x160f5e=[];var _0x32d01a=[];var _0x2488b6=_0x698e('0x34');if(_0x1e4580['duplicates']&&_0x1e4580[_0x698e('0x9f')][_0x698e('0x19')]){_0x2488b6=_0x698e('0xa0')+_0x3c5589;_0x160f5e['push']('CREATE\x20TABLE\x20'+_0x2488b6+_0x698e('0xa1'));}tmp_campaigns=_0x698e('0xa2')+_0x3c5589;tmp_voice_queues=_0x698e('0xa3')+_0x3c5589;_0x32d01a[_0x698e('0x5d')](_0x698e('0xa4')+tmp_campaigns+_0x698e('0xa5'));_0x32d01a[_0x698e('0x5d')](_0x698e('0xa4')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x698e('0xa6')](_0x32d01a,handleTZQuery)[_0x698e('0x1b')](function(_0x1b542b){updateTzCampaigns(_0x1e4580[_0x698e('0x44')])[_0x698e('0x1b')](function(_0x31df5d){updateTzVoiceQueues(_0x1e4580[_0x698e('0x44')])[_0x698e('0x1b')](function(_0x26a646){if(hasTZ)_0x2d066d=_0x2d066d['replace']('dialTimezone',_0x698e('0xa7'));var _0x184b3b=util[_0x698e('0xe')](_0x698e('0xa8'),_0x42e70c,_0x2488b6,_0x2d066d,_0x1e4580[_0x698e('0x44')],_0x1e4580[_0x698e('0xa9')]||null,NOW,NOW);if(_[_0x698e('0x70')](_0x394895[_0x698e('0x43')])){_0x184b3b+=_0x698e('0xaa');}_0x160f5e['push'](_0x184b3b);if(_0x1e4580['duplicates']&&_0x1e4580[_0x698e('0x9f')][_0x698e('0x19')]){_0x160f5e['push'](insertCmContact(_0x1e4580[_0x698e('0x44')],_0x2488b6,_0x1e4580[_0x698e('0x9f')],_0x394895));_0x160f5e['push']('DROP\x20TABLE\x20'+_0x2488b6+';');}BPromise['each'](_0x160f5e,handleQuery)[_0x698e('0x1b')](function(_0x773562){BPromise[_0x698e('0x1a')]([handleAdditionalPhones()])[_0x698e('0x1b')](function(){_0x160f5e=[];for(var _0x4094c0=0x0;_0x4094c0\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','AdditionalPhones','then','push','all','length','split','filter','CmContactHasItem','findOne','update','updated'];(function(_0x357206,_0xdacd2d){var _0x105d5b=function(_0x10c980){while(--_0x10c980){_0x357206['push'](_0x357206['shift']());}};_0x105d5b(++_0xdacd2d);}(_0xe256,0x14c));var _0x6e25=function(_0x4d73dc,_0x28d725){_0x4d73dc=_0x4d73dc-0x0;var _0xff681=_0xe256[_0x4d73dc];return _0xff681;};'use strict';var fs=require('fs');var path=require(_0x6e25('0x0'));var _=require(_0x6e25('0x1'));var Papa=require(_0x6e25('0x2'));var util=require(_0x6e25('0x3'));var BPromise=require(_0x6e25('0x4'));var moment=require(_0x6e25('0x5'));var squel=require('squel');var Redis=require(_0x6e25('0x6'));var db=require(_0x6e25('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x6e25('0x8'));var logger=require(_0x6e25('0x9'))(_0x6e25('0xa'));config['redis']=_['defaults'](config[_0x6e25('0xb')],{'host':_0x6e25('0xc'),'port':0x18eb});var socket=require(_0x6e25('0xd'))(new Redis(config[_0x6e25('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x6e25('0xe')](_0x6e25('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x6e25('0xf'));function isEmail(_0x5377b0){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))*$/[_0x6e25('0x10')](_0x5377b0);}function selectNotIn(_0x59cad8,_0x140979,_0x4eb9e6,_0xe7cea6,_0x3b46a4){return squel[_0x6e25('0x11')]()[_0x6e25('0x12')](_0x6e25('0x13'))[_0x6e25('0x14')](_0xe7cea6)[_0x6e25('0x15')](_0x140979,null,_0x140979+'.id\x20=\x20'+_0xe7cea6+'.'+_0x4eb9e6)[_0x6e25('0x16')](_0xe7cea6+'.'+_0x4eb9e6+_0x6e25('0x17')+_0x59cad8+'.'+_0x4eb9e6)[_0x6e25('0x16')](_0x140979+_0x6e25('0x18')+_0x3b46a4[_0x6e25('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x105c36,_0x5dbc2a){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0x6e25('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x6e25('0x1a')](function(_0x14a81f){if(_0x14a81f!==null){var _0x572e22=[];for(var _0x3d64b2=0x0;_0x3d64b2<_0x14a81f['length'];_0x3d64b2++){var _0x30852c=_0x14a81f[_0x3d64b2];_0x572e22[_0x6e25('0x1b')](insertAdditionalPhones(_0x30852c));}}Promise[_0x6e25('0x1c')](_0x572e22)[_0x6e25('0x1a')](function(){_0x105c36({'val':0x1});});});});}function insertAdditionalPhones(_0x131ee6){return new Promise(function(_0x3959fc,_0x356f1f){var _0x4440a8=_0x131ee6['AdditionalPhones'];var _0x3f5b1a=_0x4440a8['split'](';');var _0x356289=[];orderBy=0x0;for(var _0x424d92=0x0;_0x424d92<_0x3f5b1a[_0x6e25('0x1d')];_0x424d92++){_0x356289[_0x6e25('0x1b')](splitAdditionalPhone(_0x131ee6['id'],_0x3f5b1a[_0x424d92]));}Promise[_0x6e25('0x1c')](_0x356289)[_0x6e25('0x1a')](function(){_0x3959fc({'val':_0x3f5b1a['length']});});});}function splitAdditionalPhone(_0x117ef7,_0x3367d0){return new Promise(function(_0x3c004f,_0x4d55af){var _0x3d94b5=_0x3367d0['split'](':');var _0x465c1e=_0x3d94b5[0x0];var _0x1f8103=_0x3d94b5[0x1];if(!_['isNil'](_0x1f8103)){var _0x55ed51=_0x1f8103[_0x6e25('0x1e')]('|');var _0x524ddb=[];for(var _0x49d914=0x0;_0x49d914<_0x55ed51[_0x6e25('0x1d')];_0x49d914++){if(_0x55ed51[_0x49d914]!==''){var _0x3c81a4=_[_0x6e25('0x1f')](promisesAdditionalPhones,{'contactId':_0x117ef7,'phone':_0x55ed51[_0x49d914]});if(_0x3c81a4['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x117ef7,'contactTypeId':_0x465c1e,'phone':_0x55ed51[_0x49d914],'orderBy':orderBy});}}}_0x3c004f({'ok':0x1});}else _0x3c004f({'res':0x0});});}function createAdditionalPhone(_0x582dbb,_0x23d020,_0x202544,_0x46709f){var _0x5b2b3d='';var _0x21f926='';var _0x4921e9=_0x202544[_0x6e25('0x1e')]('§');_0x5b2b3d=_0x4921e9[0x0];if(_0x4921e9[_0x6e25('0x1d')]==0x2)_0x21f926=_0x4921e9[0x1];return new Promise(function(_0x5151f9,_0x471e79){return db[_0x6e25('0x20')][_0x6e25('0x21')]({'where':{'CmContactId':_0x582dbb,'item':_0x5b2b3d}})['then'](function(_0x2f290d){if(_0x2f290d){return db[_0x6e25('0x20')][_0x6e25('0x22')]({'ItemTypeId':_0x23d020,'description':_0x21f926,'OrderBy':_0x46709f},{'where':{'CmContactId':_0x582dbb,'item':_0x5b2b3d}})[_0x6e25('0x1a')](function(_0x334804){_0x5151f9({'res':_0x6e25('0x23')});});}else{return db['CmContactHasItem'][_0x6e25('0x24')]({'CmContactId':_0x582dbb,'item':_0x5b2b3d,'description':_0x21f926,'ItemTypeId':_0x23d020,'OrderBy':_0x46709f,'ItemClass':'PHONE'})[_0x6e25('0x1a')](function(_0x5c137d){_0x5151f9({'res':_0x6e25('0x25')});});}});});}function insertCmHopper(_0x1273d2,_0x2cd88c,_0x259bc9,_0x2cfb53,_0x11ee5a){var _0x2abe62=[_0x6e25('0x26'),'cm_contacts.scheduledat',_0x6e25('0x27'),_0x6e25('0x28'),_0x2cd88c+'.'+_0x2cfb53,_0x6e25('0x29'),_0x6e25('0x2a'),'cm_contacts.priority',_0x6e25('0x2b'),'\x22'+_0x11ee5a+'\x22'];return squel[_0x6e25('0x2c')]()[_0x6e25('0x2d')](_0x6e25('0x2e'))[_0x6e25('0x2f')]([_0x6e25('0x13'),_0x6e25('0x30'),_0x6e25('0x31'),_0x6e25('0x32'),_0x2cfb53,'createdAt',_0x6e25('0x33'),_0x6e25('0x34'),_0x6e25('0x35'),_0x6e25('0x36')],squel[_0x6e25('0x11')]()[_0x6e25('0x37')](_0x2abe62)['from'](_0x2cd88c)[_0x6e25('0x15')](_0x6e25('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x2cd88c+_0x6e25('0x39'))['join'](_0x259bc9,null,_0x259bc9+_0x6e25('0x3a')+_0x2cd88c+'.'+_0x2cfb53)[_0x6e25('0x16')](_0x2cd88c+_0x6e25('0x3b'),_0x1273d2)[_0x6e25('0x16')](_0x6e25('0x3c'),NOW)[_0x6e25('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2cd88c,_0x259bc9,_0x2cfb53,_0x6e25('0x2e'),['\x22always\x22',_0x6e25('0x3d')]))[_0x6e25('0x16')](_0x6e25('0x3e'),selectNotIn(_0x2cd88c,_0x259bc9,_0x2cfb53,_0x6e25('0x2e'),[_0x6e25('0x3f')])))[_0x6e25('0x40')]();}function insertCmHopperBlack(_0x1cc35a,_0x5fcf7f,_0x4bcd37,_0x378875){var _0x258e0e=[_0x6e25('0x26'),_0x6e25('0x27'),_0x6e25('0x28'),_0x5fcf7f+'.'+_0x378875,_0x6e25('0x29'),_0x6e25('0x2a')];return squel[_0x6e25('0x2c')]()[_0x6e25('0x2d')]('cm_hopper_black')[_0x6e25('0x2f')]([_0x6e25('0x13'),'ContactId','ListId',_0x378875,_0x6e25('0x41'),_0x6e25('0x33')],squel[_0x6e25('0x11')]()[_0x6e25('0x37')](_0x258e0e)[_0x6e25('0x14')](_0x5fcf7f)[_0x6e25('0x15')](_0x6e25('0x38'),null,_0x6e25('0x42')+_0x5fcf7f+_0x6e25('0x39'))['join'](_0x4bcd37,null,_0x4bcd37+_0x6e25('0x3a')+_0x5fcf7f+'.'+_0x378875)['where'](_0x5fcf7f+_0x6e25('0x3b'),_0x1cc35a)[_0x6e25('0x16')](_0x6e25('0x3c'),NOW)[_0x6e25('0x16')](_0x6e25('0x3e'),squel['select']()['field'](_0x6e25('0x13'))[_0x6e25('0x14')](_0x6e25('0x43'))['where'](_0x6e25('0x44'),_0x1cc35a)[_0x6e25('0x16')](_0x378875+_0x6e25('0x17')+_0x5fcf7f+'.'+_0x378875)))['toString']();}function insertTzCmHopper(_0x267296,_0x2306b9,_0x28be13,_0x123148,_0x88d5be,_0x43f75e){var _0x615714=[_0x6e25('0x26'),_0x6e25('0x45')+_0x43f75e+_0x6e25('0x46'),'cm_contacts.id',_0x6e25('0x28'),_0x2306b9+'.'+_0x123148,_0x6e25('0x29'),_0x6e25('0x2a'),_0x6e25('0x47'),_0x6e25('0x2b'),'\x22'+_0x88d5be+'\x22'];var _0x27c0d6=squel[_0x6e25('0x2c')]()[_0x6e25('0x2d')](_0x6e25('0x2e'))[_0x6e25('0x2f')](['phone',_0x6e25('0x30'),_0x6e25('0x31'),_0x6e25('0x32'),_0x123148,_0x6e25('0x41'),_0x6e25('0x33'),_0x6e25('0x34'),_0x6e25('0x35'),'recallme'],squel[_0x6e25('0x11')]()[_0x6e25('0x37')](_0x615714)['from'](_0x2306b9)[_0x6e25('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2306b9+'.CmListId')[_0x6e25('0x15')](_0x28be13,null,_0x28be13+_0x6e25('0x3a')+_0x2306b9+'.'+_0x123148)[_0x6e25('0x15')](_0x43f75e,null,_0x43f75e+_0x6e25('0x3a')+_0x2306b9+'.'+_0x123148)[_0x6e25('0x16')](_0x2306b9+_0x6e25('0x3b'),_0x267296)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x6e25('0x3e'),selectNotIn(_0x2306b9,_0x28be13,_0x123148,_0x6e25('0x2e'),[_0x6e25('0x3f'),_0x6e25('0x3d')]))[_0x6e25('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2306b9,_0x28be13,_0x123148,_0x6e25('0x2e'),[_0x6e25('0x3f')])))[_0x6e25('0x40')]();return _0x27c0d6;}function insertTzCmHopperBlack(_0x47d6ba,_0x1e0e18,_0xb0510f,_0x4e1f23){var _0x28ec72=[_0x6e25('0x26'),'cm_contacts.id',_0x6e25('0x28'),_0x1e0e18+'.'+_0x4e1f23,_0x6e25('0x29'),_0x6e25('0x2a')];return squel['insert']()[_0x6e25('0x2d')]('cm_hopper_black')[_0x6e25('0x2f')](['phone',_0x6e25('0x31'),'ListId',_0x4e1f23,'createdAt',_0x6e25('0x33')],squel['select']()[_0x6e25('0x37')](_0x28ec72)['from'](_0x1e0e18)[_0x6e25('0x15')](_0x6e25('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x1e0e18+_0x6e25('0x39'))[_0x6e25('0x15')](_0xb0510f,null,_0xb0510f+_0x6e25('0x3a')+_0x1e0e18+'.'+_0x4e1f23)[_0x6e25('0x16')](_0x1e0e18+_0x6e25('0x3b'),_0x47d6ba)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6e25('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x6e25('0x11')]()[_0x6e25('0x12')](_0x6e25('0x13'))[_0x6e25('0x14')](_0x6e25('0x43'))[_0x6e25('0x16')](_0x6e25('0x44'),_0x47d6ba)[_0x6e25('0x16')](_0x4e1f23+_0x6e25('0x17')+_0x1e0e18+'.'+_0x4e1f23)))[_0x6e25('0x40')]();}function insertCmHopperAdditionalPhones(_0x30436c){var _0x509174=[_0x6e25('0x48'),_0x6e25('0x49'),_0x6e25('0x4a'),_0x6e25('0x4b'),_0x6e25('0x4c')];return squel[_0x6e25('0x2c')]()[_0x6e25('0x2d')](_0x6e25('0x4d'))[_0x6e25('0x2f')]([_0x6e25('0x4e'),'phone',_0x6e25('0x4f'),_0x6e25('0x41'),_0x6e25('0x33')],squel[_0x6e25('0x11')]()[_0x6e25('0x37')](_0x509174)[_0x6e25('0x14')](_0x6e25('0x2e'))[_0x6e25('0x15')](_0x6e25('0x38'),null,_0x6e25('0x50'))[_0x6e25('0x15')](_0x6e25('0x51'),null,_0x6e25('0x52'))['where'](_0x6e25('0x53'),_0x30436c)['where'](_0x6e25('0x3c'),NOW))[_0x6e25('0x40')]();}function insertCmContact(_0x30c770,_0x17a24f,_0x3eba6c,_0x424241){var _0x211a7c=_[_0x6e25('0x54')](_[_0x6e25('0x55')](_0x424241),[_0x6e25('0x32'),_0x6e25('0x56'),_0x6e25('0x41'),_0x6e25('0x33'),'scheduledAt']);return squel[_0x6e25('0x2c')]()[_0x6e25('0x2d')]('cm_contacts')[_0x6e25('0x2f')](_0x211a7c,squel[_0x6e25('0x11')]()[_0x6e25('0x37')](_0x211a7c)[_0x6e25('0x14')](_0x17a24f)[_0x6e25('0x16')]('('+_0x3eba6c[_0x6e25('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0x6e25('0x11')]()[_0x6e25('0x37')](_0x3eba6c)[_0x6e25('0x14')]('cm_contacts')[_0x6e25('0x16')](_0x6e25('0x44'),_0x30c770)[_0x6e25('0x16')](_0x6e25('0x57')))[_0x6e25('0x16')](_0x6e25('0x58'),squel['select']()['field']('MIN(id)',_0x6e25('0x59'))[_0x6e25('0x14')](_0x17a24f)['group'](_0x3eba6c[_0x6e25('0x15')](','))))['toString']();}function handleStop(){logger[_0x6e25('0x5a')](_0x6e25('0x5b'));stopped=!![];}function handleUncaughtException(_0x3a8a98){logger['error'](_0x3a8a98[_0x6e25('0x5c')]);process[_0x6e25('0x5d')](0x1);}function handleError(_0xab8574,_0x422d0d){stats[_0x6e25('0x5e')][_0x6e25('0x1b')]({'name':_0x422d0d[_0x6e25('0x5f')],'message':_0x422d0d[_0x6e25('0x5c')],'row':_0xab8574});}function handleQuery(_0xb418d){logger[_0x6e25('0x5a')](_0xb418d);return db[_0x6e25('0x60')][_0x6e25('0x61')](_0xb418d)[_0x6e25('0x62')](function(_0xa23e86){results[_0x6e25('0x1b')](_0xa23e86);})[_0x6e25('0x63')](function(_0x27494b){logger[_0x6e25('0x64')](_0x27494b[_0x6e25('0x5c')]);});}function updateTzCampaigns(_0x320172){return new Promise(function(_0x4760c5,_0x1c6dea){var _0x1d7c55=squel['select']()[_0x6e25('0x37')]([_0x6e25('0x65'),_0x6e25('0x66')])['from'](_0x6e25('0x67'))['join']('campaigns_has_cm_lists',null,_0x6e25('0x68'))[_0x6e25('0x16')](_0x6e25('0x69')+_0x320172);db[_0x6e25('0x60')]['query'](_0x1d7c55['toString']())['spread'](function(_0x5bc102){var _0x27bccd=[];for(var _0xdfe2e5=0x0;_0xdfe2e5<_0x5bc102['length'];_0xdfe2e5++){_0x27bccd['push'](getTimezoneData(_0x5bc102[_0xdfe2e5],tmp_campaigns));}BPromise[_0x6e25('0x1c')](_0x27bccd)[_0x6e25('0x1a')](function(){_0x4760c5({'val':0x1});});})['catch'](function(_0x344f78){logger[_0x6e25('0x64')](_0x344f78['message']);_0x4760c5({'val':0x0});});});}function updateTzVoiceQueues(_0x31c839){return new Promise(function(_0x15dfe1,_0x341b32){var _0x116d4e=squel['select']()[_0x6e25('0x37')](['voice_queues.id','voice_queues.dialTimezone'])[_0x6e25('0x14')](_0x6e25('0x6a'))['join'](_0x6e25('0x6b'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where'](_0x6e25('0x6c')+_0x31c839);db[_0x6e25('0x60')][_0x6e25('0x61')](_0x116d4e[_0x6e25('0x40')]())['spread'](function(_0x316c23){var _0x4b86af=[];for(var _0x30ebc0=0x0;_0x30ebc0<_0x316c23[_0x6e25('0x1d')];_0x30ebc0++){_0x4b86af[_0x6e25('0x1b')](getTimezoneData(_0x316c23[_0x30ebc0],tmp_voice_queues));}BPromise['all'](_0x4b86af)['then'](function(){_0x15dfe1({'val':0x1});});})[_0x6e25('0x63')](function(_0x4fd335){logger[_0x6e25('0x64')](_0x4fd335['message']);_0x15dfe1({'val':0x0});});});}function getTimezoneData(_0x4c6527,_0x563d0d){return new Promise(function(_0x4abb91,_0x284798){var _0x489f13=shared[_0x6e25('0x6d')];var _0x59c300=_0x489f13[_0x4c6527[_0x6e25('0x6e')]];if(_[_0x6e25('0x6f')](_0x59c300)){_0x4abb91({'ret':0x1});}else{var _0x2f164a=_0x59c300[_0x6e25('0x70')];var _0x369868=squel[_0x6e25('0x2c')]()[_0x6e25('0x2d')](_0x563d0d)[_0x6e25('0x71')]('id',_0x4c6527['id'])['set'](_0x6e25('0x72'),_0x2f164a)['set']('dialTimezone',_0x4c6527[_0x6e25('0x6e')])['toString']();return db['sequelize']['query'](_0x369868)[_0x6e25('0x62')](function(_0x338899){_0x4abb91({'ret':0x1});})['catch'](function(_0x6e5f1f){logger[_0x6e25('0x64')](_0x6e5f1f[_0x6e25('0x5c')]);_0x284798({'ret':0x1});});}});}function handleTZQuery(_0x55f0e6){logger['info'](_0x55f0e6);return db['sequelize']['query'](_0x55f0e6)['spread'](function(_0x2d5965){})['catch'](function(_0x1ff7b2){logger[_0x6e25('0x64')](_0x1ff7b2[_0x6e25('0x5c')]);});}function main(_0x4daadf,_0x7d9ac,_0x570a3a,_0x4bd0b2){logger[_0x6e25('0x5a')](_0x6e25('0x73'),_0x4daadf,JSON[_0x6e25('0x74')](_0x7d9ac));process[_0x6e25('0x75')](_0x6e25('0x76'));var _0x19c1b5=_0x7d9ac[_0x6e25('0x77')];var _0x9cb9c3=_[_0x6e25('0x78')](_0x19c1b5);var _0x348c56=_0x7d9ac['socket_timestamp'];var _0x4dc8b3=path[_0x6e25('0x15')](config[_0x6e25('0x79')],'server/files/tmp',_0x348c56+'.csv');hasTZ=_[_0x6e25('0x55')](_0x19c1b5)[_0x6e25('0x7a')]('dialTimezone');var _0x243971=_['keys'](_0x19c1b5)[_0x6e25('0x15')]();logger[_0x6e25('0x5a')]('header',_0x243971);db['ContactItemType'][_0x6e25('0x7b')]({'raw':!![],'attributes':['id','name']})[_0x6e25('0x1a')](function(_0x16a33b){for(var _0x38f3c6=0x0;_0x38f3c6<_0x16a33b[_0x6e25('0x1d')];_0x38f3c6++){if(_0x16a33b[_0x38f3c6][_0x6e25('0x7c')]in _0x19c1b5){contactItemTypes[_0x6e25('0x1b')](_0x16a33b[_0x38f3c6]);delete _0x9cb9c3[_0x16a33b[_0x38f3c6][_0x6e25('0x7c')]];hasAdditionalPhones=!![];}for(var _0x1d139a in _0x19c1b5){if(_0x16a33b[_0x38f3c6][_0x6e25('0x7c')]+_0x6e25('0x7d')===_0x1d139a){phoneDescriptions[_0x6e25('0x1b')]({'itemTypeId':_0x16a33b[_0x38f3c6]['id'],'description':_0x1d139a});delete _0x9cb9c3[_0x1d139a];}}}if(hasAdditionalPhones)_0x9cb9c3['AdditionalPhones']='';var _0x3a16c3=_['keys'](_0x9cb9c3)[_0x6e25('0x15')]();logger[_0x6e25('0x5a')](_0x6e25('0x7e'),_0x3a16c3);fs[_0x6e25('0x7f')](_0x4dc8b3,_0x3a16c3+'\x0a');Papa[_0x6e25('0x80')](fs['createReadStream'](_0x4daadf),{'header':!![],'skipEmptyLines':!![],'step':function(_0xd3b1d6,_0x327bdc){try{for(var _0x29ed06=0x0,_0x1eb77e=[];_0x29ed06<_0xd3b1d6[_0x6e25('0x81')][_0x6e25('0x1d')];_0x29ed06++){stats[_0x6e25('0x82')]+=0x1;if(_0xd3b1d6[_0x6e25('0x5e')][_0x29ed06]){handleError(_0xd3b1d6[_0x6e25('0x81')][_0x29ed06],_0xd3b1d6[_0x6e25('0x5e')][_0x29ed06]);}else{var _0x2cac36=[];var _0x8f77e7=[];var _0x261015={};for(var _0x3ae740 in _0x19c1b5){let _0x505a7e=contactItemTypes[_0x6e25('0x83')](_0x17b982=>_0x17b982['name']===_0x3ae740);let _0x4c5eab=contactItemTypes['find'](_0x527e06=>_0x527e06[_0x6e25('0x7c')]+_0x6e25('0x7d')===_0x3ae740);if(_[_0x6e25('0x6f')](_0x505a7e)&&_[_0x6e25('0x6f')](_0x4c5eab)){if(_0x19c1b5['hasOwnProperty'](_0x3ae740)){if(_0xd3b1d6[_0x6e25('0x81')][_0x29ed06][_0x19c1b5[_0x3ae740]]){var _0x556f0f=_[_0x6e25('0x84')](_0xd3b1d6[_0x6e25('0x81')][_0x29ed06][_0x19c1b5[_0x3ae740]]['replace'](/"/g,'\x27'));switch(_0x3ae740){case _0x6e25('0x30'):var _0x5e8333=moment(_0x556f0f,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5e8333[_0x6e25('0x85')]()){_0x1eb77e['push']('\x22'+_0x556f0f+'\x22');}else{_0x2cac36[_0x6e25('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x6e25('0x34'):var _0x26cb24=parseInt(_0x556f0f);_0x556f0f=_[_0x6e25('0x86')](_0x26cb24)||_0x26cb24<0x0||_0x26cb24>0x4?_0x4bd0b2?0x3:0x2:_0x26cb24;_0x1eb77e[_0x6e25('0x1b')]('\x22'+_0x556f0f+'\x22');break;case _0x6e25('0x35'):var _0x4fa5d9=parseInt(_0x556f0f);if(_['isNumber'](_0x4fa5d9)&&_[_0x6e25('0x7a')](_0x570a3a,_0x4fa5d9)){_0x1eb77e[_0x6e25('0x1b')]('\x22'+_0x4fa5d9+'\x22');}else{_0x2cac36[_0x6e25('0x1b')](_0x6e25('0x87'));}break;case _0x6e25('0x88'):if(isEmail(_0x556f0f)){_0x1eb77e['push']('\x22'+_0x556f0f+'\x22');}else{_0x2cac36[_0x6e25('0x1b')](_0x6e25('0x89'));}break;case _0x6e25('0x8a'):var _0x31ea01=moment(_0x556f0f,_0x6e25('0x8b'),!![]);if(_0x31ea01[_0x6e25('0x85')]()){_0x1eb77e[_0x6e25('0x1b')]('\x22'+_0x556f0f+'\x22');}else{_0x2cac36['push'](_0x6e25('0x8c'));}break;case _0x6e25('0x6e'):var _0x529c1b=shared[_0x6e25('0x6d')];var _0xcb91e3=_0x529c1b[_0x556f0f];if(!_['isNil'](_0xcb91e3)){var _0x10fb60=_0xcb91e3[_0x6e25('0x70')];_0x1eb77e['push']('\x22'+_0x556f0f+'\x22');_0x1eb77e['push']('\x22'+_0x10fb60+'\x22');}break;default:_0x1eb77e[_0x6e25('0x1b')]('\x22'+_0x556f0f+'\x22');}}else{switch(_0x3ae740){case'firstName':case'phone':_0x2cac36['push'](_0x3ae740+_0x6e25('0x8d'));break;default:_0x1eb77e['push']('\x22\x22');}}}}else{var _0x2edc1f='';if(!_[_0x6e25('0x6f')](_0x505a7e)){if(!_0x261015[_0x6e25('0x8e')](_0x505a7e['id'])){if(!_[_0x6e25('0x6f')](_0xd3b1d6[_0x6e25('0x81')][_0x29ed06][_0x19c1b5[_0x3ae740]])){var _0x556f0f=_[_0x6e25('0x84')](_0xd3b1d6[_0x6e25('0x81')][_0x29ed06][_0x19c1b5[_0x3ae740]][_0x6e25('0x8f')](/"/g,'\x27'));var _0x1fb530=phoneDescriptions['find'](_0x5238f1=>_0x5238f1[_0x6e25('0x90')]===_0x505a7e['id']);if(!_['isNil'](_0x1fb530)){var _0x2f1258=_[_0x6e25('0x84')](_0xd3b1d6[_0x6e25('0x81')][_0x29ed06][_0x19c1b5[_0x1fb530[_0x6e25('0x91')]]][_0x6e25('0x8f')](/"/g,'\x27'));if(!_[_0x6e25('0x6f')](_0x2f1258))_0x556f0f=_0x556f0f+'§'+_0x2f1258;}if(_0x2edc1f=='')_0x2edc1f=_0x556f0f;else _0x2edc1f+='|'+_0x556f0f;}_0x8f77e7[_0x6e25('0x1b')](_0x505a7e['id']+':'+_0x2edc1f);_0x261015[_0x505a7e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1eb77e[_0x6e25('0x1b')]('\x22'+_0x8f77e7[_0x6e25('0x15')](';')+'\x22');}if(_0x2cac36[_0x6e25('0x1d')]){handleError(_0xd3b1d6['data'][_0x29ed06],{'code':_0x6e25('0x92'),'message':_0x2cac36[_0x6e25('0x15')]()});}else{fs[_0x6e25('0x93')](_0x4dc8b3,_0x1eb77e[_0x6e25('0x15')]()+'\x0a');}_0x1eb77e=[];}if(!(stats[_0x6e25('0x82')]%0xc8)){socket[_0x6e25('0x94')]('contact:import:'+_0x348c56,stats);stats['errors']=[];}}if(stopped){logger[_0x6e25('0x5a')](_0x6e25('0x95'));_0x327bdc[_0x6e25('0x96')]();}}catch(_0x329535){handleError(_0xd3b1d6[_0x6e25('0x81')][_0x29ed06],{'code':_0x6e25('0x97'),'message':_0x329535[_0x6e25('0x5c')]});logger[_0x6e25('0x64')](_0x6e25('0x98'),_0x329535[_0x6e25('0x5c')]);}},'complete':function(){try{var _0x3f8076=[];var _0x4cd1cc=[];var _0xe5f0af=_0x6e25('0x38');if(_0x7d9ac['duplicates']&&_0x7d9ac[_0x6e25('0x99')][_0x6e25('0x1d')]){_0xe5f0af='cm_contacts_'+_0x348c56;_0x3f8076[_0x6e25('0x1b')]('CREATE\x20TABLE\x20'+_0xe5f0af+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x6e25('0x9a')+_0x348c56;tmp_voice_queues='voice_queues_'+_0x348c56;_0x4cd1cc['push'](_0x6e25('0x9b')+tmp_campaigns+_0x6e25('0x9c'));_0x4cd1cc[_0x6e25('0x1b')](_0x6e25('0x9b')+tmp_voice_queues+_0x6e25('0x9c'));BPromise['each'](_0x4cd1cc,handleTZQuery)[_0x6e25('0x1a')](function(_0x3fb55a){updateTzCampaigns(_0x7d9ac[_0x6e25('0x32')])[_0x6e25('0x1a')](function(_0x481612){updateTzVoiceQueues(_0x7d9ac[_0x6e25('0x32')])[_0x6e25('0x1a')](function(_0x4b8c9e){if(hasTZ)_0x3a16c3=_0x3a16c3[_0x6e25('0x8f')](_0x6e25('0x6e'),_0x6e25('0x9d'));var _0xa255d3=util[_0x6e25('0xe')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4dc8b3,_0xe5f0af,_0x3a16c3,_0x7d9ac[_0x6e25('0x32')],_0x7d9ac['CompanyId']||null,NOW,NOW);if(_[_0x6e25('0x6f')](_0x19c1b5['scheduledat'])){_0xa255d3+=',\x20scheduledAt\x20=\x20NOW()';}_0x3f8076[_0x6e25('0x1b')](_0xa255d3);if(_0x7d9ac[_0x6e25('0x99')]&&_0x7d9ac[_0x6e25('0x99')]['length']){_0x3f8076[_0x6e25('0x1b')](insertCmContact(_0x7d9ac[_0x6e25('0x32')],_0xe5f0af,_0x7d9ac[_0x6e25('0x99')],_0x19c1b5));_0x3f8076[_0x6e25('0x1b')](_0x6e25('0x9e')+_0xe5f0af+';');}BPromise[_0x6e25('0x9f')](_0x3f8076,handleQuery)[_0x6e25('0x1a')](function(_0x41c4ac){BPromise['all']([handleAdditionalPhones()])[_0x6e25('0x1a')](function(){_0x3f8076=[];for(var _0x3ae446=0x0;_0x3ae446\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2d1fca,_0x6ba94c){var _0x1d8d3c=function(_0x30b740){while(--_0x30b740){_0x2d1fca['push'](_0x2d1fca['shift']());}};_0x1d8d3c(++_0x6ba94c);}(_0xa1a4,0x11f));var _0x4a1a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa1a4[_0x59ee6f];return _0x4c0979;};'use strict';var fs=require('fs');var path=require(_0x4a1a('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x4a1a('0x1'));var BPromise=require(_0x4a1a('0x2'));var moment=require(_0x4a1a('0x3'));var squel=require(_0x4a1a('0x4'));var Redis=require(_0x4a1a('0x5'));var db=require(_0x4a1a('0x6'))['db'];var config=require(_0x4a1a('0x7'));var logger=require(_0x4a1a('0x8'))(_0x4a1a('0x9'));config[_0x4a1a('0xa')]=_[_0x4a1a('0xb')](config[_0x4a1a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a1a('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()[_0x4a1a('0xd')](_0x4a1a('0xe'));var tempTableName=_0x4a1a('0xf')+moment()[_0x4a1a('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4855fb){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x4855fb);}function selectNotIn(_0x4a69fd,_0x3a1e3f,_0x127690,_0x45b938,_0x92cf1f){return squel[_0x4a1a('0x10')]()['field'](_0x4a1a('0x11'))[_0x4a1a('0x12')](_0x45b938)[_0x4a1a('0x13')](_0x3a1e3f,null,_0x3a1e3f+_0x4a1a('0x14')+_0x45b938+'.'+_0x127690)[_0x4a1a('0x15')](_0x45b938+'.'+_0x127690+_0x4a1a('0x16')+_0x4a69fd+'.'+_0x127690)['where'](_0x3a1e3f+_0x4a1a('0x17')+_0x92cf1f[_0x4a1a('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1a6d1e,_0x5d2d3a){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4a1a('0x18')][_0x4a1a('0x19')](_0x4a1a('0x1a')+tempTableName)['spread'](function(_0x340178){if(_0x340178!==null){var _0x361f09=[];for(var _0x3f0b50=0x0;_0x3f0b50<_0x340178[_0x4a1a('0x1b')];_0x3f0b50++){var _0x108604=_0x340178[_0x3f0b50];if(!_[_0x4a1a('0x1c')](_0x108604['phone'])){if(!_[_0x4a1a('0x1c')](_0x108604[_0x4a1a('0x1d')]))_0x361f09['push'](insertAdditionalPhones(_0x108604));promisesContact[_0x4a1a('0x1e')]({'contact':_0x108604});}}}Promise[_0x4a1a('0x1f')](_0x361f09)[_0x4a1a('0x20')](function(){_0x1a6d1e({'val':0x1});});})['catch'](function(_0x3360cb){logger[_0x4a1a('0x21')](_0x3360cb[_0x4a1a('0x22')]);});});}function insertAdditionalPhones(_0xbfa475){return new Promise(function(_0x5e6f2f,_0x2b8106){var _0x40391e=_0xbfa475['AdditionalPhones'];if(_[_0x4a1a('0x1c')](_0x40391e))_0x2b8106({'val':0x0});else{var _0x52aab4=_0x40391e['split'](';');var _0x308fe5=[];orderBy=0x0;for(var _0x59885c=0x0;_0x59885c<_0x52aab4['length'];_0x59885c++){_0x308fe5['push'](splitAdditionalPhone(_0xbfa475['id'],_0x52aab4[_0x59885c]));}Promise[_0x4a1a('0x1f')](_0x308fe5)[_0x4a1a('0x20')](function(){_0x5e6f2f({'val':_0x52aab4[_0x4a1a('0x1b')]});});}});}function splitAdditionalPhone(_0x46e0af,_0x7ed1c5){return new Promise(function(_0x54800a,_0xcb5804){var _0x5c2101=_0x7ed1c5[_0x4a1a('0x23')](':');var _0xe9f6e8=_0x5c2101[0x0];var _0x53b053=_0x5c2101[0x1];if(_0x53b053!==''){var _0x3475f3=_0x53b053[_0x4a1a('0x23')]('|');var _0x8afce0=[];for(var _0x4b5a55=0x0;_0x4b5a55<_0x3475f3['length'];_0x4b5a55++){if(_0x3475f3[_0x4b5a55]!==''){var _0x33d53e=_[_0x4a1a('0x24')](promisesAdditionalPhones,{'contactId':_0x46e0af,'phone':_0x3475f3[_0x4b5a55]});if(_0x33d53e['length']==0x0){orderBy++;promisesAdditionalPhones[_0x4a1a('0x1e')]({'contactId':_0x46e0af,'contactTypeId':_0xe9f6e8,'phone':_0x3475f3[_0x4b5a55],'orderBy':orderBy});}}}_0x54800a({'ok':0x1});}else _0x54800a({'res':0x0});});}function createAdditionalPhone(_0x65ae9a,_0x39bcc0,_0x45a39f,_0x347571){var _0x158118='';var _0x44bec7='';var _0x38a2cd=_0x45a39f['split']('§');_0x158118=_0x38a2cd[0x0];if(_0x38a2cd[_0x4a1a('0x1b')]==0x2)_0x44bec7=_0x38a2cd[0x1];return new Promise(function(_0x19738e,_0x1e1999){return db[_0x4a1a('0x25')][_0x4a1a('0x26')]({'where':{'CmContactId':_0x65ae9a,'item':_0x158118}})[_0x4a1a('0x20')](function(_0x56e27f){if(_0x56e27f){return db['CmContactHasItem'][_0x4a1a('0x27')]({'ItemTypeId':_0x39bcc0,'description':_0x44bec7,'OrderBy':_0x347571},{'where':{'CmContactId':_0x65ae9a,'item':_0x158118}})[_0x4a1a('0x20')](function(_0x54aba2){_0x19738e({'res':'updated'});});}else{return db[_0x4a1a('0x25')][_0x4a1a('0x28')]({'CmContactId':_0x65ae9a,'item':_0x158118,'ItemTypeId':_0x39bcc0,'description':_0x44bec7,'OrderBy':_0x347571,'ItemClass':_0x4a1a('0x29')})[_0x4a1a('0x20')](function(_0x3f7086){_0x19738e({'res':'inserted'});});}});});}function updateContact(_0x3918af){return new Promise(function(_0x469fb7,_0x1b90fc){var _0x18fd2c=_0x3918af['id'];delete _0x3918af['id'];return db[_0x4a1a('0x2a')][_0x4a1a('0x27')](_0x3918af,{'where':{'id':_0x18fd2c}})[_0x4a1a('0x20')](function(_0x468e71){updatedRows+=0x1;return db['CmHopper'][_0x4a1a('0x27')]({'phone':_0x3918af[_0x4a1a('0x11')]},{'where':{'ContactId':_0x18fd2c}})[_0x4a1a('0x20')](function(_0x4c3ebb){_0x469fb7({'ret':'OK'});});});});}function insertCmHopper(_0x597d1a,_0x476084,_0x250d30,_0x43b000,_0xf2f8e7){var _0x423fcb=['cm_contacts.phone',_0x4a1a('0x2b'),'cm_contacts.id','cm_contacts.ListId',_0x476084+'.'+_0x43b000,_0x4a1a('0x2c'),_0x4a1a('0x2d'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0xf2f8e7+'\x22'];return squel[_0x4a1a('0x2e')]()[_0x4a1a('0x2f')](_0x4a1a('0x30'))[_0x4a1a('0x31')]([_0x4a1a('0x11'),'scheduledat',_0x4a1a('0x32'),'ListId',_0x43b000,_0x4a1a('0x33'),'updatedAt',_0x4a1a('0x34'),'UserId',_0x4a1a('0x35')],squel[_0x4a1a('0x10')]()[_0x4a1a('0x36')](_0x423fcb)['from'](_0x476084)[_0x4a1a('0x13')](_0x4a1a('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x476084+_0x4a1a('0x38'))[_0x4a1a('0x13')](_0x250d30,null,_0x250d30+_0x4a1a('0x14')+_0x476084+'.'+_0x43b000)[_0x4a1a('0x15')](_0x476084+_0x4a1a('0x39'),_0x597d1a)[_0x4a1a('0x15')](_0x4a1a('0x3a'),NOW)[_0x4a1a('0x15')](_0x4a1a('0x3b'),selectNotIn(_0x476084,_0x250d30,_0x43b000,_0x4a1a('0x30'),['\x22always\x22',_0x4a1a('0x3c')]))[_0x4a1a('0x15')](_0x4a1a('0x3b'),selectNotIn(_0x476084,_0x250d30,_0x43b000,_0x4a1a('0x30'),[_0x4a1a('0x3d')])))['toString']();}function insertCmHopperBlack(_0x19e59c,_0x26cec7,_0x44f567,_0x40d6e8){var _0x209cc8=['cm_contacts.phone','cm_contacts.id',_0x4a1a('0x3e'),_0x26cec7+'.'+_0x40d6e8,_0x4a1a('0x2c'),_0x4a1a('0x2d')];return squel[_0x4a1a('0x2e')]()[_0x4a1a('0x2f')](_0x4a1a('0x3f'))[_0x4a1a('0x31')]([_0x4a1a('0x11'),_0x4a1a('0x32'),_0x4a1a('0x40'),_0x40d6e8,'createdAt',_0x4a1a('0x41')],squel[_0x4a1a('0x10')]()['fields'](_0x209cc8)[_0x4a1a('0x12')](_0x26cec7)[_0x4a1a('0x13')](_0x4a1a('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x26cec7+_0x4a1a('0x38'))[_0x4a1a('0x13')](_0x44f567,null,_0x44f567+'.id\x20=\x20'+_0x26cec7+'.'+_0x40d6e8)[_0x4a1a('0x15')](_0x26cec7+_0x4a1a('0x39'),_0x19e59c)[_0x4a1a('0x15')](_0x4a1a('0x3a'),NOW)[_0x4a1a('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x4a1a('0x10')]()['field'](_0x4a1a('0x11'))['from'](_0x4a1a('0x3f'))['where'](_0x4a1a('0x42'),_0x19e59c)[_0x4a1a('0x15')](_0x40d6e8+_0x4a1a('0x43'),_0x26cec7+'.'+_0x40d6e8)))[_0x4a1a('0x44')]();}function insertCmHopperAdditionalPhones(_0x44c18a){var _0x52f717=['cm_hopper.id',_0x4a1a('0x45'),_0x4a1a('0x46'),_0x4a1a('0x47'),_0x4a1a('0x48')];return squel['insert']()['into'](_0x4a1a('0x49'))[_0x4a1a('0x31')]([_0x4a1a('0x4a'),_0x4a1a('0x11'),'OrderBy',_0x4a1a('0x33'),_0x4a1a('0x41')],squel[_0x4a1a('0x10')]()[_0x4a1a('0x36')](_0x52f717)[_0x4a1a('0x12')](_0x4a1a('0x30'))[_0x4a1a('0x13')]('cm_contacts',null,_0x4a1a('0x4b'))[_0x4a1a('0x13')](_0x4a1a('0x4c'),null,_0x4a1a('0x4d'))['where'](_0x4a1a('0x4e'),_0x44c18a)[_0x4a1a('0x15')](_0x4a1a('0x3a'),NOW))['toString']();}function insertCmContact(_0xb3facc,_0x3e32bf,_0x5e6fd7,_0x1d633d){var _0xcf58cd=_['concat'](_['keys'](_0x1d633d),[_0x4a1a('0x40'),'CompanyId','createdAt',_0x4a1a('0x41')]);return squel['insert']()[_0x4a1a('0x2f')](_0x4a1a('0x37'))[_0x4a1a('0x31')](_0xcf58cd,squel[_0x4a1a('0x10')]()['fields'](_0xcf58cd)[_0x4a1a('0x12')](_0x3e32bf)[_0x4a1a('0x15')]('('+_0x5e6fd7['join'](',')+_0x4a1a('0x4f'),squel[_0x4a1a('0x10')]()['fields'](_0x5e6fd7)[_0x4a1a('0x12')](_0x4a1a('0x37'))[_0x4a1a('0x15')](_0x4a1a('0x42'),_0xb3facc))['where'](_0x4a1a('0x50'),squel['select']()[_0x4a1a('0x51')](_0x4a1a('0x52'),_0x4a1a('0x53'))['from'](_0x3e32bf)[_0x4a1a('0x54')](_0x5e6fd7[_0x4a1a('0x13')](','))))[_0x4a1a('0x44')]();}function handleStop(){logger[_0x4a1a('0x55')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5be9e0){logger[_0x4a1a('0x21')](_0x5be9e0[_0x4a1a('0x22')]);process['exit'](0x1);}function handleError(_0x3c8381,_0x56c44b){stats[_0x4a1a('0x56')][_0x4a1a('0x1e')]({'name':_0x56c44b[_0x4a1a('0x57')],'message':_0x56c44b[_0x4a1a('0x22')],'row':_0x3c8381});}function handleQuery(_0x4767a0){logger[_0x4a1a('0x55')](_0x4767a0);return db[_0x4a1a('0x18')]['query'](_0x4767a0)['spread'](function(_0x504f77){results[_0x4a1a('0x1e')](_0x504f77);})['catch'](function(_0x53dc0e){logger[_0x4a1a('0x21')](_0x53dc0e[_0x4a1a('0x22')]);});}function main(_0x5e7f9c,_0xb4afcb,_0x5406b0,_0x199e41){logger['info'](_0x4a1a('0x58'),_0x5e7f9c,JSON[_0x4a1a('0x59')](_0xb4afcb));process[_0x4a1a('0x5a')](_0x4a1a('0x5b'));var _0x5062cf=_0xb4afcb[_0x4a1a('0x5c')];var _0xc2b593=_[_0x4a1a('0x5d')](_0x5062cf);var _0x1f3ef9=_0xb4afcb[_0x4a1a('0x5e')];var _0x2d782a=path[_0x4a1a('0x13')](config['root'],_0x4a1a('0x5f'),_0x1f3ef9+_0x4a1a('0x60'));logger[_0x4a1a('0x55')]('body',_0xb4afcb);db[_0x4a1a('0x61')][_0x4a1a('0x62')]({'raw':!![],'attributes':['id',_0x4a1a('0x63')]})[_0x4a1a('0x20')](function(_0x5ccf6b){for(var _0x5cf7ee=0x0;_0x5cf7ee<_0x5ccf6b[_0x4a1a('0x1b')];_0x5cf7ee++){if(_0x5ccf6b[_0x5cf7ee][_0x4a1a('0x63')]in _0x5062cf){contactItemTypes['push'](_0x5ccf6b[_0x5cf7ee]);delete _0xc2b593[_0x5ccf6b[_0x5cf7ee][_0x4a1a('0x63')]];hasAdditionalPhones=!![];}for(var _0x3322e5 in _0x5062cf){if(_0x5ccf6b[_0x5cf7ee]['name']+'_description'===_0x3322e5){phoneDescriptions[_0x4a1a('0x1e')]({'itemTypeId':_0x5ccf6b[_0x5cf7ee]['id'],'description':_0x3322e5});delete _0xc2b593[_0x3322e5];}}}if(hasAdditionalPhones)_0xc2b593[_0x4a1a('0x1d')]='';var _0x39171e=_['keys'](_0xc2b593)[_0x4a1a('0x13')]();logger[_0x4a1a('0x55')](_0x4a1a('0x64'),_0x39171e);fs[_0x4a1a('0x65')](_0x2d782a,_0x39171e+'\x0a');Papa[_0x4a1a('0x66')](fs[_0x4a1a('0x67')](_0x5e7f9c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2b981f,_0x23da9f){try{for(var _0x3acb12=0x0,_0x37ae3f=[];_0x3acb12<_0x2b981f[_0x4a1a('0x68')][_0x4a1a('0x1b')];_0x3acb12++){stats[_0x4a1a('0x69')]+=0x1;if(_0x2b981f['errors'][_0x3acb12]){handleError(_0x2b981f[_0x4a1a('0x68')][_0x3acb12],_0x2b981f['errors'][_0x3acb12]);}else{var _0x19a439=[];var _0x1ea5e9=[];var _0x13ee4f={};for(var _0x7fe0d3 in _0x5062cf){let _0x1cc152=contactItemTypes[_0x4a1a('0x6a')](_0x22a51a=>_0x22a51a[_0x4a1a('0x63')]===_0x7fe0d3);let _0x3ebc52=contactItemTypes[_0x4a1a('0x6a')](_0x2add78=>_0x2add78[_0x4a1a('0x63')]+'_description'===_0x7fe0d3);if(_[_0x4a1a('0x1c')](_0x1cc152)&&_['isNil'](_0x3ebc52)){if(_0x5062cf['hasOwnProperty'](_0x7fe0d3)){if(_0x2b981f[_0x4a1a('0x68')][_0x3acb12][_0x5062cf[_0x7fe0d3]]){var _0x3cedac=_[_0x4a1a('0x6b')](_0x2b981f['data'][_0x3acb12][_0x5062cf[_0x7fe0d3]][_0x4a1a('0x6c')](/"/g,'\x27'));switch(_0x7fe0d3){case _0x4a1a('0x6d'):var _0x17b7c0=moment(_0x3cedac,_0x4a1a('0xe'),!![]);if(_0x17b7c0[_0x4a1a('0x6e')]()){_0x37ae3f[_0x4a1a('0x1e')]('\x22'+_0x3cedac+'\x22');}else{_0x19a439[_0x4a1a('0x1e')](_0x4a1a('0x6f'));}break;case _0x4a1a('0x34'):var _0xce1e37=parseInt(_0x3cedac);_0x3cedac=_['isNaN'](_0xce1e37)||_0xce1e37<0x0||_0xce1e37>0x4?_0x199e41?0x3:0x2:_0xce1e37;_0x37ae3f['push']('\x22'+_0x3cedac+'\x22');break;case _0x4a1a('0x70'):var _0x102b62=parseInt(_0x3cedac);if(_[_0x4a1a('0x71')](_0x102b62)&&_[_0x4a1a('0x72')](_0x5406b0,_0x102b62)){_0x37ae3f[_0x4a1a('0x1e')]('\x22'+_0x102b62+'\x22');}else{_0x19a439[_0x4a1a('0x1e')](_0x4a1a('0x73'));}break;case'email':if(isEmail(_0x3cedac)){_0x37ae3f[_0x4a1a('0x1e')]('\x22'+_0x3cedac+'\x22');}else{_0x19a439[_0x4a1a('0x1e')](_0x4a1a('0x74'));}break;case _0x4a1a('0x75'):var _0x24049e=moment(_0x3cedac,_0x4a1a('0x76'),!![]);if(_0x24049e[_0x4a1a('0x6e')]()){_0x37ae3f['push']('\x22'+_0x3cedac+'\x22');}else{_0x19a439[_0x4a1a('0x1e')](_0x4a1a('0x77'));}break;default:_0x37ae3f[_0x4a1a('0x1e')]('\x22'+_0x3cedac+'\x22');}}else{switch(_0x7fe0d3){case _0x4a1a('0x78'):case _0x4a1a('0x11'):_0x19a439[_0x4a1a('0x1e')](_0x7fe0d3+_0x4a1a('0x79'));break;default:_0x37ae3f[_0x4a1a('0x1e')]('\x22\x22');}}}}else{var _0x1d3c41='';if(!_['isNil'](_0x1cc152)){if(!_0x13ee4f[_0x4a1a('0x7a')](_0x1cc152['id'])){for(var _0x49de06=0x0;_0x49de06<_0x5062cf[_0x7fe0d3]['length'];_0x49de06++){var _0x3cedac=_[_0x4a1a('0x6b')](_0x2b981f[_0x4a1a('0x68')][_0x3acb12][_0x5062cf[_0x7fe0d3][_0x49de06]][_0x4a1a('0x6c')](/"/g,'\x27'));var _0x2b9f1d=phoneDescriptions[_0x4a1a('0x6a')](_0x47655f=>_0x47655f['itemTypeId']===_0x1cc152['id']);if(!_[_0x4a1a('0x1c')](_0x2b9f1d)){var _0x24ce83=_['trim'](_0x2b981f[_0x4a1a('0x68')][_0x3acb12][_0x5062cf[_0x2b9f1d[_0x4a1a('0x7b')]][0x0]][_0x4a1a('0x6c')](/"/g,'\x27'));if(!_[_0x4a1a('0x1c')](_0x24ce83))_0x3cedac=_0x3cedac+'§'+_0x24ce83;}if(_0x1d3c41=='')_0x1d3c41=_0x3cedac;else _0x1d3c41+='|'+_0x3cedac;}_0x1ea5e9[_0x4a1a('0x1e')](_0x1cc152['id']+':'+_0x1d3c41);_0x13ee4f[_0x1cc152['id']]=0x1;}}}}if(hasAdditionalPhones){_0x37ae3f[_0x4a1a('0x1e')]('\x22'+_0x1ea5e9['join'](';')+'\x22');}if(_0x19a439[_0x4a1a('0x1b')]){handleError(_0x2b981f[_0x4a1a('0x68')][_0x3acb12],{'code':_0x4a1a('0x7c'),'message':_0x19a439[_0x4a1a('0x13')]()});}else{fs['appendFileSync'](_0x2d782a,_0x37ae3f['join']()+'\x0a');}_0x37ae3f=[];}if(!(stats[_0x4a1a('0x69')]%0xc8)){socket[_0x4a1a('0x7d')](_0x4a1a('0x7e')+_0x1f3ef9,stats);stats[_0x4a1a('0x56')]=[];}}if(stopped){logger[_0x4a1a('0x55')]('Abort\x20parser');_0x23da9f[_0x4a1a('0x7f')]();}}catch(_0x44cd3c){handleError(_0x2b981f['data'][_0x3acb12],{'code':'SystemError','message':_0x44cd3c[_0x4a1a('0x22')]});logger[_0x4a1a('0x21')]('step',_0x44cd3c['message']);}},'complete':function(){try{var _0x2ee527=[];var _0x491d07=tempTableName;_0x2ee527[_0x4a1a('0x1e')](_0x4a1a('0x80')+_0x491d07+_0x4a1a('0x81'));logger['info']('CIS\x20len',contactItemTypes['length']);var _0x562690=util[_0x4a1a('0xd')](_0x4a1a('0x82'),_0x2d782a,_0x491d07,_0x39171e,_0xb4afcb[_0x4a1a('0x40')],_0xb4afcb[_0x4a1a('0x83')]||null,NOW,NOW);if(_[_0x4a1a('0x1c')](_0x5062cf[_0x4a1a('0x6d')])){_0x562690+=',\x20scheduledAt\x20=\x20NOW()';}_0x2ee527['push'](_0x562690);BPromise[_0x4a1a('0x84')](_0x2ee527,handleQuery)[_0x4a1a('0x20')](function(_0x4bbefa){BPromise[_0x4a1a('0x1f')]([handleAdditionalPhones()])[_0x4a1a('0x20')](function(){_0x2ee527=[];for(var _0x59b88f=0x0;_0x59b88f\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','then','catch','error','message','split','all','filter','CmContactHasItem','update','updated','CmContact','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','priority','recallme','fields','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.phone','cm_contacts.id','cm_hopper_black','createdAt','updatedAt','cm_contacts','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','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','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','code','query','main','stringify','start','clone','socket_timestamp','root','.csv','body','ContactItemType','findAll','name','keys','header','writeFileSync','parse','rows','errors','data','find','hasOwnProperty','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','trim','replace'];(function(_0x2d357d,_0x2a5075){var _0x17e5da=function(_0x8df515){while(--_0x8df515){_0x2d357d['push'](_0x2d357d['shift']());}};_0x17e5da(++_0x2a5075);}(_0x5324,0x154));var _0x4532=function(_0x4c8a57,_0xf6eb38){_0x4c8a57=_0x4c8a57-0x0;var _0x16bf35=_0x5324[_0x4c8a57];return _0x16bf35;};'use strict';var fs=require('fs');var path=require(_0x4532('0x0'));var _=require(_0x4532('0x1'));var Papa=require(_0x4532('0x2'));var util=require(_0x4532('0x3'));var BPromise=require('bluebird');var moment=require(_0x4532('0x4'));var squel=require('squel');var Redis=require(_0x4532('0x5'));var db=require(_0x4532('0x6'))['db'];var config=require(_0x4532('0x7'));var logger=require(_0x4532('0x8'))(_0x4532('0x9'));config[_0x4532('0xa')]=_[_0x4532('0xb')](config[_0x4532('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4532('0xc'))(new Redis(config[_0x4532('0xa')]));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()[_0x4532('0xd')](_0x4532('0xe'));var tempTableName=_0x4532('0xf')+moment()[_0x4532('0xd')](_0x4532('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2f1b8c){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))*$/[_0x4532('0x11')](_0x2f1b8c);}function selectNotIn(_0x3f9647,_0x314e97,_0xfabd65,_0x518bc2,_0x511ac6){return squel[_0x4532('0x12')]()['field'](_0x4532('0x13'))[_0x4532('0x14')](_0x518bc2)[_0x4532('0x15')](_0x314e97,null,_0x314e97+_0x4532('0x16')+_0x518bc2+'.'+_0xfabd65)['where'](_0x518bc2+'.'+_0xfabd65+_0x4532('0x17')+_0x3f9647+'.'+_0xfabd65)[_0x4532('0x18')](_0x314e97+_0x4532('0x19')+_0x511ac6[_0x4532('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x19eaf3,_0x525f96){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0x4532('0x1a')+tempTableName)[_0x4532('0x1b')](function(_0x2dedca){if(_0x2dedca!==null){var _0x3b97ee=[];for(var _0x17512a=0x0;_0x17512a<_0x2dedca[_0x4532('0x1c')];_0x17512a++){var _0x2a79ec=_0x2dedca[_0x17512a];if(!_[_0x4532('0x1d')](_0x2a79ec[_0x4532('0x13')])){if(!_['isNil'](_0x2a79ec[_0x4532('0x1e')]))_0x3b97ee[_0x4532('0x1f')](insertAdditionalPhones(_0x2a79ec));promisesContact[_0x4532('0x1f')]({'contact':_0x2a79ec});}}}Promise['all'](_0x3b97ee)[_0x4532('0x20')](function(){_0x19eaf3({'val':0x1});});})[_0x4532('0x21')](function(_0x57c08d){logger[_0x4532('0x22')](_0x57c08d[_0x4532('0x23')]);});});}function insertAdditionalPhones(_0xf37fc8){return new Promise(function(_0x41a7f7,_0x3f677b){var _0x30a1e1=_0xf37fc8[_0x4532('0x1e')];if(_[_0x4532('0x1d')](_0x30a1e1))_0x3f677b({'val':0x0});else{var _0x557cf6=_0x30a1e1[_0x4532('0x24')](';');var _0x46dc73=[];orderBy=0x0;for(var _0x481c26=0x0;_0x481c26<_0x557cf6[_0x4532('0x1c')];_0x481c26++){_0x46dc73[_0x4532('0x1f')](splitAdditionalPhone(_0xf37fc8['id'],_0x557cf6[_0x481c26]));}Promise[_0x4532('0x25')](_0x46dc73)[_0x4532('0x20')](function(){_0x41a7f7({'val':_0x557cf6['length']});});}});}function splitAdditionalPhone(_0xbf825a,_0x571e56){return new Promise(function(_0x2828ca,_0x9353c0){var _0x16e2c4=_0x571e56[_0x4532('0x24')](':');var _0x40e42f=_0x16e2c4[0x0];var _0x278b04=_0x16e2c4[0x1];if(_0x278b04!==''){var _0x105338=_0x278b04[_0x4532('0x24')]('|');var _0x4a386a=[];for(var _0x4b804b=0x0;_0x4b804b<_0x105338[_0x4532('0x1c')];_0x4b804b++){if(_0x105338[_0x4b804b]!==''){var _0x401f3b=_[_0x4532('0x26')](promisesAdditionalPhones,{'contactId':_0xbf825a,'phone':_0x105338[_0x4b804b]});if(_0x401f3b[_0x4532('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x4532('0x1f')]({'contactId':_0xbf825a,'contactTypeId':_0x40e42f,'phone':_0x105338[_0x4b804b],'orderBy':orderBy});}}}_0x2828ca({'ok':0x1});}else _0x2828ca({'res':0x0});});}function createAdditionalPhone(_0x79e5a4,_0x4a810d,_0x3de0ee,_0x239e85){var _0x11d163='';var _0x16836c='';var _0xd6feb9=_0x3de0ee['split']('§');_0x11d163=_0xd6feb9[0x0];if(_0xd6feb9[_0x4532('0x1c')]==0x2)_0x16836c=_0xd6feb9[0x1];return new Promise(function(_0x3fabe3,_0xb2d129){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x79e5a4,'item':_0x11d163}})['then'](function(_0x3e4c89){if(_0x3e4c89){return db[_0x4532('0x27')][_0x4532('0x28')]({'ItemTypeId':_0x4a810d,'description':_0x16836c,'OrderBy':_0x239e85},{'where':{'CmContactId':_0x79e5a4,'item':_0x11d163}})[_0x4532('0x20')](function(_0x39e045){_0x3fabe3({'res':_0x4532('0x29')});});}else{return db[_0x4532('0x27')]['create']({'CmContactId':_0x79e5a4,'item':_0x11d163,'ItemTypeId':_0x4a810d,'description':_0x16836c,'OrderBy':_0x239e85,'ItemClass':'PHONE'})[_0x4532('0x20')](function(_0x2b5b7f){_0x3fabe3({'res':'inserted'});});}});});}function updateContact(_0x439d79){return new Promise(function(_0x418096,_0xe3b70){var _0x1b9c5f=_0x439d79['id'];delete _0x439d79['id'];return db[_0x4532('0x2a')][_0x4532('0x28')](_0x439d79,{'where':{'id':_0x1b9c5f}})[_0x4532('0x20')](function(_0x44f205){updatedRows+=0x1;return db['CmHopper']['update']({'phone':_0x439d79[_0x4532('0x13')]},{'where':{'ContactId':_0x1b9c5f}})[_0x4532('0x20')](function(_0x53e03e){_0x418096({'ret':'OK'});});});});}function insertCmHopper(_0x2c6f28,_0x2b0907,_0x376280,_0x89fac9,_0x4cb46d){var _0x31db93=['cm_contacts.phone',_0x4532('0x2b'),'cm_contacts.id',_0x4532('0x2c'),_0x2b0907+'.'+_0x89fac9,_0x4532('0x2d'),_0x4532('0x2e'),_0x4532('0x2f'),_0x4532('0x30'),'\x22'+_0x4cb46d+'\x22'];return squel[_0x4532('0x31')]()[_0x4532('0x32')](_0x4532('0x33'))[_0x4532('0x34')]([_0x4532('0x13'),_0x4532('0x35'),'ContactId',_0x4532('0x36'),_0x89fac9,'createdAt','updatedAt',_0x4532('0x37'),'UserId',_0x4532('0x38')],squel[_0x4532('0x12')]()[_0x4532('0x39')](_0x31db93)[_0x4532('0x14')](_0x2b0907)[_0x4532('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2b0907+_0x4532('0x3a'))[_0x4532('0x15')](_0x376280,null,_0x376280+'.id\x20=\x20'+_0x2b0907+'.'+_0x89fac9)[_0x4532('0x18')](_0x2b0907+'.CmListId\x20=\x20?',_0x2c6f28)[_0x4532('0x18')](_0x4532('0x3b'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2b0907,_0x376280,_0x89fac9,_0x4532('0x33'),[_0x4532('0x3c'),_0x4532('0x3d')]))['where'](_0x4532('0x3e'),selectNotIn(_0x2b0907,_0x376280,_0x89fac9,_0x4532('0x33'),[_0x4532('0x3c')])))['toString']();}function insertCmHopperBlack(_0x5cca1a,_0x3d8398,_0x5c401a,_0x2b39c8){var _0x59b4bb=[_0x4532('0x3f'),_0x4532('0x40'),_0x4532('0x2c'),_0x3d8398+'.'+_0x2b39c8,_0x4532('0x2d'),'cm_contacts.updatedAt'];return squel['insert']()[_0x4532('0x32')](_0x4532('0x41'))[_0x4532('0x34')]([_0x4532('0x13'),'ContactId',_0x4532('0x36'),_0x2b39c8,_0x4532('0x42'),_0x4532('0x43')],squel[_0x4532('0x12')]()[_0x4532('0x39')](_0x59b4bb)['from'](_0x3d8398)[_0x4532('0x15')](_0x4532('0x44'),null,_0x4532('0x45')+_0x3d8398+_0x4532('0x3a'))[_0x4532('0x15')](_0x5c401a,null,_0x5c401a+_0x4532('0x16')+_0x3d8398+'.'+_0x2b39c8)[_0x4532('0x18')](_0x3d8398+'.CmListId\x20=\x20?',_0x5cca1a)[_0x4532('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x4532('0x3e'),squel[_0x4532('0x12')]()['field']('phone')[_0x4532('0x14')]('cm_hopper_black')[_0x4532('0x18')](_0x4532('0x46'),_0x5cca1a)[_0x4532('0x18')](_0x2b39c8+_0x4532('0x47'),_0x3d8398+'.'+_0x2b39c8)))[_0x4532('0x48')]();}function insertCmHopperAdditionalPhones(_0x5e7d2c){var _0xd616ca=[_0x4532('0x49'),_0x4532('0x4a'),'cm_contact_has_items.OrderBy',_0x4532('0x4b'),'cm_contact_has_items.updatedAt'];return squel[_0x4532('0x31')]()['into'](_0x4532('0x4c'))[_0x4532('0x34')]([_0x4532('0x4d'),_0x4532('0x13'),_0x4532('0x4e'),_0x4532('0x42'),_0x4532('0x43')],squel['select']()[_0x4532('0x39')](_0xd616ca)[_0x4532('0x14')](_0x4532('0x33'))[_0x4532('0x15')](_0x4532('0x44'),null,_0x4532('0x4f'))['join'](_0x4532('0x50'),null,_0x4532('0x51'))[_0x4532('0x18')](_0x4532('0x52'),_0x5e7d2c)[_0x4532('0x18')](_0x4532('0x3b'),NOW))['toString']();}function insertCmContact(_0x4b9f8a,_0x4e7679,_0x2f0767,_0x9aebec){var _0x36eaec=_[_0x4532('0x53')](_['keys'](_0x9aebec),[_0x4532('0x36'),_0x4532('0x54'),_0x4532('0x42'),_0x4532('0x43')]);return squel[_0x4532('0x31')]()[_0x4532('0x32')](_0x4532('0x44'))[_0x4532('0x34')](_0x36eaec,squel[_0x4532('0x12')]()[_0x4532('0x39')](_0x36eaec)[_0x4532('0x14')](_0x4e7679)[_0x4532('0x18')]('('+_0x2f0767[_0x4532('0x15')](',')+_0x4532('0x55'),squel[_0x4532('0x12')]()[_0x4532('0x39')](_0x2f0767)[_0x4532('0x14')]('cm_contacts')[_0x4532('0x18')](_0x4532('0x46'),_0x4b9f8a))['where'](_0x4532('0x56'),squel[_0x4532('0x12')]()['field'](_0x4532('0x57'),_0x4532('0x58'))[_0x4532('0x14')](_0x4e7679)['group'](_0x2f0767[_0x4532('0x15')](','))))['toString']();}function handleStop(){logger[_0x4532('0x59')](_0x4532('0x5a'));stopped=!![];}function handleUncaughtException(_0x4fb50f){logger[_0x4532('0x22')](_0x4fb50f[_0x4532('0x23')]);process[_0x4532('0x5b')](0x1);}function handleError(_0xe5b2bf,_0xefbd7f){stats['errors'][_0x4532('0x1f')]({'name':_0xefbd7f[_0x4532('0x5c')],'message':_0xefbd7f[_0x4532('0x23')],'row':_0xe5b2bf});}function handleQuery(_0x4d618a){logger['info'](_0x4d618a);return db['sequelize'][_0x4532('0x5d')](_0x4d618a)['spread'](function(_0xad3d7b){results[_0x4532('0x1f')](_0xad3d7b);})['catch'](function(_0x33716e){logger[_0x4532('0x22')](_0x33716e[_0x4532('0x23')]);});}function main(_0x1201e6,_0x690b3d,_0x169971,_0x968841){logger[_0x4532('0x59')](_0x4532('0x5e'),_0x1201e6,JSON[_0x4532('0x5f')](_0x690b3d));process['send'](_0x4532('0x60'));var _0x5ab013=_0x690b3d['binding'];var _0x57ac5d=_[_0x4532('0x61')](_0x5ab013);var _0x1400a7=_0x690b3d[_0x4532('0x62')];var _0x438fb3=path['join'](config[_0x4532('0x63')],'server/files/tmp',_0x1400a7+_0x4532('0x64'));logger[_0x4532('0x59')](_0x4532('0x65'),_0x690b3d);db[_0x4532('0x66')][_0x4532('0x67')]({'raw':!![],'attributes':['id',_0x4532('0x68')]})[_0x4532('0x20')](function(_0x5a5a17){for(var _0x399616=0x0;_0x399616<_0x5a5a17[_0x4532('0x1c')];_0x399616++){if(_0x5a5a17[_0x399616][_0x4532('0x68')]in _0x5ab013){contactItemTypes[_0x4532('0x1f')](_0x5a5a17[_0x399616]);delete _0x57ac5d[_0x5a5a17[_0x399616]['name']];hasAdditionalPhones=!![];}for(var _0x440e60 in _0x5ab013){if(_0x5a5a17[_0x399616][_0x4532('0x68')]+'_description'===_0x440e60){phoneDescriptions[_0x4532('0x1f')]({'itemTypeId':_0x5a5a17[_0x399616]['id'],'description':_0x440e60});delete _0x57ac5d[_0x440e60];}}}if(hasAdditionalPhones)_0x57ac5d['AdditionalPhones']='';var _0x46da6f=_[_0x4532('0x69')](_0x57ac5d)[_0x4532('0x15')]();logger[_0x4532('0x59')](_0x4532('0x6a'),_0x46da6f);fs[_0x4532('0x6b')](_0x438fb3,_0x46da6f+'\x0a');Papa[_0x4532('0x6c')](fs['createReadStream'](_0x1201e6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x57b1f6,_0x16a14c){try{for(var _0x2f7d39=0x0,_0x37afbe=[];_0x2f7d39<_0x57b1f6['data'][_0x4532('0x1c')];_0x2f7d39++){stats[_0x4532('0x6d')]+=0x1;if(_0x57b1f6[_0x4532('0x6e')][_0x2f7d39]){handleError(_0x57b1f6[_0x4532('0x6f')][_0x2f7d39],_0x57b1f6['errors'][_0x2f7d39]);}else{var _0x1746ee=[];var _0x524812=[];var _0x26f429={};for(var _0x3dd780 in _0x5ab013){let _0x493a72=contactItemTypes[_0x4532('0x70')](_0x352b28=>_0x352b28['name']===_0x3dd780);let _0x39a74e=contactItemTypes[_0x4532('0x70')](_0x4facde=>_0x4facde[_0x4532('0x68')]+'_description'===_0x3dd780);if(_[_0x4532('0x1d')](_0x493a72)&&_[_0x4532('0x1d')](_0x39a74e)){if(_0x5ab013[_0x4532('0x71')](_0x3dd780)){if(_0x57b1f6[_0x4532('0x6f')][_0x2f7d39][_0x5ab013[_0x3dd780]]){var _0x1064e9=_['trim'](_0x57b1f6[_0x4532('0x6f')][_0x2f7d39][_0x5ab013[_0x3dd780]]['replace'](/"/g,'\x27'));switch(_0x3dd780){case'scheduledat':var _0x3013c8=moment(_0x1064e9,_0x4532('0xe'),!![]);if(_0x3013c8[_0x4532('0x72')]()){_0x37afbe[_0x4532('0x1f')]('\x22'+_0x1064e9+'\x22');}else{_0x1746ee[_0x4532('0x1f')](_0x4532('0x73'));}break;case _0x4532('0x37'):var _0x2bbb37=parseInt(_0x1064e9);_0x1064e9=_[_0x4532('0x74')](_0x2bbb37)||_0x2bbb37<0x0||_0x2bbb37>0x4?_0x968841?0x3:0x2:_0x2bbb37;_0x37afbe[_0x4532('0x1f')]('\x22'+_0x1064e9+'\x22');break;case _0x4532('0x75'):var _0x3af4b8=parseInt(_0x1064e9);if(_[_0x4532('0x76')](_0x3af4b8)&&_['includes'](_0x169971,_0x3af4b8)){_0x37afbe[_0x4532('0x1f')]('\x22'+_0x3af4b8+'\x22');}else{_0x1746ee[_0x4532('0x1f')]('agent\x20not\x20exists');}break;case _0x4532('0x77'):if(isEmail(_0x1064e9)){_0x37afbe[_0x4532('0x1f')]('\x22'+_0x1064e9+'\x22');}else{_0x1746ee[_0x4532('0x1f')]('email\x20wrong\x20format');}break;case _0x4532('0x78'):var _0x5b8d92=moment(_0x1064e9,'YYYY-MM-DD',!![]);if(_0x5b8d92['isValid']()){_0x37afbe['push']('\x22'+_0x1064e9+'\x22');}else{_0x1746ee[_0x4532('0x1f')](_0x4532('0x79'));}break;default:_0x37afbe[_0x4532('0x1f')]('\x22'+_0x1064e9+'\x22');}}else{switch(_0x3dd780){case'firstName':case _0x4532('0x13'):_0x1746ee[_0x4532('0x1f')](_0x3dd780+_0x4532('0x7a'));break;default:_0x37afbe[_0x4532('0x1f')]('\x22\x22');}}}}else{var _0xe41b01='';if(!_[_0x4532('0x1d')](_0x493a72)){if(!_0x26f429['hasOwnProperty'](_0x493a72['id'])){for(var _0x5af2a4=0x0;_0x5af2a4<_0x5ab013[_0x3dd780][_0x4532('0x1c')];_0x5af2a4++){var _0x1064e9=_[_0x4532('0x7b')](_0x57b1f6[_0x4532('0x6f')][_0x2f7d39][_0x5ab013[_0x3dd780][_0x5af2a4]][_0x4532('0x7c')](/"/g,'\x27'));var _0x235e67=phoneDescriptions[_0x4532('0x70')](_0x469c3a=>_0x469c3a['itemTypeId']===_0x493a72['id']);if(!_['isNil'](_0x235e67)){var _0x2ab478=_[_0x4532('0x7b')](_0x57b1f6[_0x4532('0x6f')][_0x2f7d39][_0x5ab013[_0x235e67[_0x4532('0x7d')]][0x0]][_0x4532('0x7c')](/"/g,'\x27'));if(!_[_0x4532('0x1d')](_0x2ab478))_0x1064e9=_0x1064e9+'§'+_0x2ab478;}if(_0xe41b01=='')_0xe41b01=_0x1064e9;else _0xe41b01+='|'+_0x1064e9;}_0x524812[_0x4532('0x1f')](_0x493a72['id']+':'+_0xe41b01);_0x26f429[_0x493a72['id']]=0x1;}}}}if(hasAdditionalPhones){_0x37afbe['push']('\x22'+_0x524812[_0x4532('0x15')](';')+'\x22');}if(_0x1746ee[_0x4532('0x1c')]){handleError(_0x57b1f6['data'][_0x2f7d39],{'code':_0x4532('0x7e'),'message':_0x1746ee[_0x4532('0x15')]()});}else{fs[_0x4532('0x7f')](_0x438fb3,_0x37afbe[_0x4532('0x15')]()+'\x0a');}_0x37afbe=[];}if(!(stats['rows']%0xc8)){socket[_0x4532('0x80')](_0x4532('0x81')+_0x1400a7,stats);stats[_0x4532('0x6e')]=[];}}if(stopped){logger[_0x4532('0x59')](_0x4532('0x82'));_0x16a14c[_0x4532('0x83')]();}}catch(_0x594b09){handleError(_0x57b1f6[_0x4532('0x6f')][_0x2f7d39],{'code':'SystemError','message':_0x594b09[_0x4532('0x23')]});logger[_0x4532('0x22')](_0x4532('0x84'),_0x594b09[_0x4532('0x23')]);}},'complete':function(){try{var _0x3e9d5a=[];var _0x59c92b=tempTableName;_0x3e9d5a[_0x4532('0x1f')](_0x4532('0x85')+_0x59c92b+_0x4532('0x86'));logger[_0x4532('0x59')](_0x4532('0x87'),contactItemTypes[_0x4532('0x1c')]);var _0x4a772c=util['format'](_0x4532('0x88'),_0x438fb3,_0x59c92b,_0x46da6f,_0x690b3d['ListId'],_0x690b3d[_0x4532('0x54')]||null,NOW,NOW);if(_[_0x4532('0x1d')](_0x5ab013[_0x4532('0x35')])){_0x4a772c+=_0x4532('0x89');}_0x3e9d5a[_0x4532('0x1f')](_0x4a772c);BPromise[_0x4532('0x8a')](_0x3e9d5a,handleQuery)[_0x4532('0x20')](function(_0x4b828f){BPromise[_0x4532('0x25')]([handleAdditionalPhones()])[_0x4532('0x20')](function(){_0x3e9d5a=[];for(var _0x302878=0x0;_0x302878\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.lastMsgDirection','i.subject','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','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)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','name','buildExpression','type','default','value','end','unreadMessages','and','Contact','operator','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start'];(function(_0x25010a,_0x5e2dbb){var _0x431b1c=function(_0x333986){while(--_0x333986){_0x25010a['push'](_0x25010a['shift']());}};_0x431b1c(++_0x5e2dbb);}(_0x63bb,0xfc));var _0xb63b=function(_0x3b8bb3,_0x29136d){_0x3b8bb3=_0x3b8bb3-0x0;var _0x420eb8=_0x63bb[_0x3b8bb3];return _0x420eb8;};'use strict';var _=require(_0xb63b('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0xb63b('0x1'));var updateInteraction=require('./update-interaction')[_0xb63b('0x2')];var utils=require(_0xb63b('0x3'));var db=require(_0xb63b('0x4'))['db'];function skipInteractionsQuery(_0x17bf38,_0x4fdaff,_0x330796){var _0x40932a=![];var _0xd0b093=utils[_0xb63b('0x5')](_0x17bf38);if(_0x4fdaff[_0xb63b('0x6')]===_0xb63b('0x7')&&!_0x330796[_0xb63b('0x8')]&&!_0x330796[_0xd0b093]){_0x40932a=!![];}return _0x40932a;}function getTagsQuery(){return squel[_0xb63b('0x9')]()[_0xb63b('0xa')]('id')[_0xb63b('0xa')]('name')[_0xb63b('0xa')]('color')[_0xb63b('0xb')](_0xb63b('0xc'));}function getUsersQuery(_0x114cc3,_0x3fdeb6){var _0x48cba4=utils[_0xb63b('0xd')](_0x114cc3);var _0x5719cd=_0xb63b('0xe')+_0x114cc3+_0xb63b('0xf');var _0x3a80b5=squel[_0xb63b('0x9')]()[_0xb63b('0xa')](_0xb63b('0x10'))[_0xb63b('0xa')](_0xb63b('0x11'))['field'](_0xb63b('0x12')+_0x48cba4)[_0xb63b('0xb')](_0x5719cd,'ui')[_0xb63b('0x13')](_0xb63b('0x14'),'u',_0xb63b('0x15'));if(_0x3fdeb6[_0xb63b('0x16')]>0x0){_0x3a80b5['where'](_0xb63b('0x12')+_0x48cba4+_0xb63b('0x17'),_[_0xb63b('0x18')](_0x3fdeb6,'id'));}return _0x3a80b5;}function getInteractionsQuery(_0x354b32){var _0x418be2=utils[_0xb63b('0x19')](_0x354b32);var _0x286976=utils[_0xb63b('0x5')](_0x354b32);var _0x5bad2a=utils[_0xb63b('0xd')](_0x354b32);return squel['select']()[_0xb63b('0xb')](_0x418be2[_0xb63b('0x1a')],'i')[_0xb63b('0x13')](_0xb63b('0x1b'),'c',_0xb63b('0x1c'))[_0xb63b('0x13')](_0xb63b('0x14'),'o',_0xb63b('0x1d'))[_0xb63b('0x13')](_0x418be2[_0xb63b('0x1e')],'a',_0xb63b('0x1f')+_0x286976)['left_join'](_0x418be2[_0xb63b('0x20')],'me',_0xb63b('0x21')+_0x5bad2a+_0xb63b('0x22'))[_0xb63b('0x13')](_0x418be2[_0xb63b('0x23')],'it',_0xb63b('0x24')+_0x5bad2a+_0xb63b('0x22'))['left_join'](_0xb63b('0xc'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x30bbda={'body':squel[_0xb63b('0x25')](),'contact':squel[_0xb63b('0x25')](),'default':squel[_0xb63b('0x25')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel[_0xb63b('0x25')](),'tags':{'clause':squel[_0xb63b('0x25')](),'ids':null},'user':squel[_0xb63b('0x25')]()};return _0x30bbda;}function parseTagParameter(_0x2e09a7){var _0xb6a0f2=squel['expr']();if(_0x2e09a7){var _0x528822=utils[_0xb63b('0x26')](_0x2e09a7);_0x528822[_0xb63b('0x27')](function(_0xd97785){_0xb6a0f2['or'](_0xb63b('0x28'),'%,'+_0xd97785+',%');});}return _0xb6a0f2;}function parseReadParameter(_0x21f7d5){var _0x4464a2='';if(_0x21f7d5){_0x4464a2='unreadMessages\x20{OPERATOR}\x200';if(_0x21f7d5==='1'){_0x4464a2=_0x4464a2[_0xb63b('0x29')](_0xb63b('0x2a'),'=');}else{_0x4464a2=_0x4464a2[_0xb63b('0x29')](_0xb63b('0x2a'),'>');}}return _0x4464a2;}function parseSearchFilter(_0x20e884,_0x3f9447){var _0x2f9343=squel[_0xb63b('0x25')]();if(_0x3f9447){var _0x1f1794=_0x3f9447[_0xb63b('0x29')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xb63b('0x2b')](_0x1f1794)){_0x2f9343['or'](_0xb63b('0x2c'),_0x1f1794+'%');if([_0xb63b('0x2d'),_0xb63b('0x2e')][_0xb63b('0x2f')](_0x20e884)){_0x2f9343['or'](_0xb63b('0x30'),_0x1f1794+'%');}else if(_0x20e884===_0xb63b('0x31')){_0x2f9343['or'](_0xb63b('0x32'),_0x1f1794+'%');}else if(_0x20e884===_0xb63b('0x33')){_0x2f9343['or']('i.from\x20LIKE\x20?',_0x1f1794+'%');}}else if(_0x20e884==='mail'&&qs[_0xb63b('0x34')](_0x1f1794)){_0x2f9343['or'](_0xb63b('0x35'),_0x1f1794+'%');}else{if(_0x20e884==='mail'){_0x2f9343['or'](_0xb63b('0x36'),qs['getFullTextValue'](_0x1f1794,!![]))['or'](_0xb63b('0x37'),qs[_0xb63b('0x38')](_0x1f1794));}else if(_0x20e884!=='fax'){_0x2f9343['or'](_0xb63b('0x39'),qs[_0xb63b('0x38')](_0x1f1794));}_0x2f9343['or'](_0xb63b('0x3a'),qs['getFullTextValue'](_0x1f1794,!![]),null);}}return _0x2f9343;}function parseAdvancedSearchFilter(_0xe202e2,_0x477fc0){var _0x170ad7=getSqlClauses();var _0x1b0915=as[_0xb63b('0x3b')](_0xe202e2);var _0x168f9b=_0x1b0915[_0xb63b('0x3c')];for(var _0x44e70e=0x0;_0x44e70e<_0x1b0915[_0xb63b('0x3d')][_0xb63b('0x16')];_0x44e70e++){var _0x10bfac=_0x1b0915[_0xb63b('0x3d')][_0x44e70e];var _0x2eb382='i';var _0x1ea551=_[_0xb63b('0x3e')](_0x477fc0,[_0xb63b('0x3f'),_0x10bfac[_0xb63b('0xa')]]);if(_0x1ea551){var _0x75883c=as[_0xb63b('0x40')](_0x2eb382,_0x1ea551[_0xb63b('0x41')],_0x10bfac);_0x170ad7[_0xb63b('0x42')][_0x168f9b](_0x75883c['text'],_0x75883c['value']['start'],_0x75883c[_0xb63b('0x43')][_0xb63b('0x44')]);}else{switch(_0x10bfac[_0xb63b('0xa')]){case _0xb63b('0x45'):var _0x46db6d=parseReadParameter(_0x10bfac[_0xb63b('0x43')]);_0x170ad7['read'][_0xb63b('0x46')](_0x46db6d);break;case _0xb63b('0x47'):if(_0x10bfac[_0xb63b('0x48')]==='$substring'){if(_0x10bfac[_0xb63b('0x43')][_0xb63b('0x49')]('\x20')[_0xb63b('0x16')]>0x1){_0x170ad7[_0xb63b('0x4a')][_0x168f9b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x10bfac[_0xb63b('0x43')],!![]),null);}else{var _0x414567='%'+_0x10bfac[_0xb63b('0x43')]+'%';_0x170ad7[_0xb63b('0x4a')][_0x168f9b](_0xb63b('0x4b'),_0x414567,_0x414567,_0x414567);}}else{_0x1ea551=_[_0xb63b('0x3e')](_0x477fc0,[_0xb63b('0x3f'),_0xb63b('0x4c')]);_0x10bfac['field']='ContactId';_0x75883c=as[_0xb63b('0x40')](_0x2eb382,_0x1ea551[_0xb63b('0x41')],_0x10bfac);_0x170ad7['contact'][_0x168f9b](_0x75883c['text'],_0x75883c[_0xb63b('0x43')][_0xb63b('0x4d')],_0x75883c['value']['end']);}break;case _0xb63b('0x4e'):var _0x29574d=_0x10bfac[_0xb63b('0x43')]['split'](',')['map'](function(_0x5c21fc){return Number(_0x5c21fc);});var _0x259e9a=parseTagParameter(_0x29574d);_0x170ad7['tags'][_0xb63b('0x4f')][_0xb63b('0x46')](_0x259e9a);_0x170ad7[_0xb63b('0x50')][_0xb63b('0x51')]=_0x29574d;break;case _0xb63b('0x52'):if(_0x10bfac['operator']===_0xb63b('0x53')){_0x170ad7[_0xb63b('0x54')][_0x168f9b](_0xb63b('0x55'),'%'+_0x10bfac[_0xb63b('0x43')]+'%',null);}else{_0x1ea551=_['find'](_0x477fc0,[_0xb63b('0x3f'),_0xb63b('0x56')]);_0x10bfac['field']='UserId';_0x75883c=as['buildExpression'](_0x2eb382,_0x1ea551[_0xb63b('0x41')],_0x10bfac);_0x170ad7[_0xb63b('0x54')][_0x168f9b](_0x75883c[_0xb63b('0x57')],_0x75883c[_0xb63b('0x43')][_0xb63b('0x4d')],_0x75883c['value'][_0xb63b('0x44')]);}break;case _0xb63b('0x58'):case _0xb63b('0x59'):_0x75883c=as[_0xb63b('0x40')]('me',null,_0x10bfac);_0x170ad7[_0xb63b('0x58')][_0x168f9b](_0x75883c[_0xb63b('0x57')],_0x75883c['value'][_0xb63b('0x4d')],_0x75883c[_0xb63b('0x43')][_0xb63b('0x44')]);break;}}}return _0x170ad7;}function parseModelFields(_0x510ba0,_0x2ba54c,_0x1e30c8){var _0x460698=utils[_0xb63b('0x5')](_0x510ba0);var _0x14bfd0=squel['expr']();var _0x422daa=_(_0x2ba54c)['keys']()[_0xb63b('0x18')](function(_0x55781f){return _[_0xb63b('0x5a')](_0x1e30c8,[_0xb63b('0x3f'),_0x55781f])?_0x55781f:undefined;})[_0xb63b('0x5b')]()[_0xb63b('0x43')]();if(_0x422daa[_0xb63b('0x16')]>0x0){_0x422daa[_0xb63b('0x27')](function(_0x55937f){if(_0x55937f===_0x460698){_0x14bfd0[_0xb63b('0x46')]('i.'+_0x460698+_0xb63b('0x17'),[][_0xb63b('0x5c')](_0x2ba54c[_0x55937f]));}else if(_0x55937f===_0xb63b('0x5d')){var _0x350862=JSON[_0xb63b('0x5e')](_0x2ba54c[_0x55937f])[_0xb63b('0x5f')];var _0x19bdae=JSON[_0xb63b('0x5e')](_0x2ba54c[_0x55937f])[_0xb63b('0x60')];_0x14bfd0[_0xb63b('0x46')](_0xb63b('0x61'),_0x350862,_0x19bdae);}else{if(_0x2ba54c[_0x55937f]===_0xb63b('0x62')){_0x14bfd0[_0xb63b('0x46')]('i.'+_0x55937f+_0xb63b('0x63'));}else{_0x14bfd0['and']('i.'+_0x55937f+_0xb63b('0x64'),_0x2ba54c[_0x55937f]);}}});}return _0x14bfd0;}function parseQueryParameters(_0x33853f,_0x2f0caf,_0x33b6b7){var _0x40bb59=getSqlClauses();return Promise[_0xb63b('0x65')]()[_0xb63b('0x66')](function(){return parseModelFields(_0x33853f,_0x2f0caf,_0x33b6b7);})[_0xb63b('0x66')](function(_0x37fc40){_0x40bb59['fields'][_0xb63b('0x46')](_0x37fc40);return parseReadParameter(_0x2f0caf[_0xb63b('0x67')]);})[_0xb63b('0x66')](function(_0x34aac1){_0x40bb59['read'][_0xb63b('0x46')](_0x34aac1);return parseTagParameter(_0x2f0caf[_0xb63b('0x68')]);})['then'](function(_0x3fa9a8){_0x40bb59[_0xb63b('0x50')][_0xb63b('0x4f')]['and'](_0x3fa9a8);return parseSearchFilter(_0x33853f,_0x2f0caf[_0xb63b('0x69')]);})[_0xb63b('0x66')](function(_0x5edc0d){_0x40bb59[_0xb63b('0x69')]=_0x5edc0d;return _0x40bb59;});}function checkAccountsRestrictions(_0x41827b,_0xda079d,_0x491b82){var _0x2468b7=utils[_0xb63b('0x5')](_0x41827b);var _0x3a92e7=_0xb63b('0x6a')+_[_0xb63b('0x6b')](_0x41827b)+(_0x41827b===_0xb63b('0x6c')?_0xb63b('0x6d'):_0xb63b('0x6e'));var _0x16c1f2=squel[_0xb63b('0x25')]();return Promise[_0xb63b('0x65')]()[_0xb63b('0x66')](function(){if(_0x491b82[_0xb63b('0x8')]&&_0xda079d[_0xb63b('0x6')]===_0xb63b('0x7')){return _0xda079d[_0x3a92e7]({'attributes':['id'],'raw':!![]});}})[_0xb63b('0x66')](function(_0x5e0317){if(_0x5e0317){if(_0x5e0317[_0xb63b('0x16')]===0x0){_0x16c1f2['and']('i.'+_0x2468b7+_0xb63b('0x63'));}else{_0x16c1f2[_0xb63b('0x46')]('i.'+_0x2468b7+_0xb63b('0x17'),_[_0xb63b('0x18')](_0x5e0317,'id'));}}else if(!_0x491b82[_0x2468b7]){_0x16c1f2[_0xb63b('0x46')]('i.'+_0x2468b7+'\x20IS\x20NOT\x20NULL');}})[_0xb63b('0x66')](function(){return _0x16c1f2;});}function getClosedOrderClause(_0x48fc05,_0x5a6b81){var _0x3501e7='';var _0x237a82=[_0xb63b('0x6f'),'i.secondDisposition','i.disposition'];if(_0x48fc05===_0xb63b('0x70')){_0x237a82[_0xb63b('0x71')](_0xb63b('0x72'));}if(_0x5a6b81['closed']==='0'&&_0x48fc05==='mail'){_0x3501e7=_0xb63b('0x72');}else{if(_0x5a6b81[_0xb63b('0x73')]==='1'){_0x237a82[_0xb63b('0x74')]();}_0x3501e7=_0xb63b('0x75')+_0x237a82[_0xb63b('0x76')](',\x20')+')';}return _0x3501e7;}function getFilteredInteractions(_0x190406,_0x182aad,_0x51d1cf,_0x52332a){var _0x135300=utils[_0xb63b('0xd')](_0x190406);var _0x26d097=_[_0xb63b('0x6b')](_0x190406)+_0xb63b('0x77');var _0x532bfa=[];var _0x1f86e8=getTagsQuery();var _0x121281={'type':db[_0xb63b('0x78')]['QueryTypes'][_0xb63b('0x79')],'raw':!![]};var _0x6c2324=[];var _0x4a15b1=[];return db[_0xb63b('0x7a')][_0xb63b('0x7b')](_0x1f86e8[_0xb63b('0x7c')](),_0x121281)[_0xb63b('0x66')](function(_0x122ad6){_0x532bfa=_[_0xb63b('0x7d')](_0x122ad6,'id');_0x121281=_[_0xb63b('0x7e')](_0x121281,{'model':db[_0x26d097],'mapToModel':!![],'nest':!![]});if(_0x51d1cf['fields']){_0x52332a[_0xb63b('0x7f')][_0xb63b('0x27')](function(_0x4dea9e){_0x182aad[_0xb63b('0xa')]('i.'+_0x4dea9e);});}else{_0x182aad[_0xb63b('0xa')](_0xb63b('0x80'),_0xb63b('0x45'));_0x182aad[_0xb63b('0xa')](_0xb63b('0x81'),_0xb63b('0x82'));_0x182aad['field'](_0xb63b('0x83'),_0xb63b('0x84'));if(_0x190406===_0xb63b('0x70')){_0x182aad[_0xb63b('0xa')]('a.email','Account.email');_0x182aad[_0xb63b('0xa')](_0xb63b('0x85'),_0xb63b('0x86'));_0x182aad[_0xb63b('0xa')](_0xb63b('0x87'));_0x182aad[_0xb63b('0xa')](_0xb63b('0x88'));_0x182aad[_0xb63b('0xa')]('i.updatedAt');_0x182aad[_0xb63b('0xa')](_0xb63b('0x89'));_0x182aad[_0xb63b('0xa')]('i.closedAt');_0x182aad['field']('i.attach');_0x182aad['field']('i.lastMsgAt');_0x182aad[_0xb63b('0xa')](_0xb63b('0x8a'));_0x182aad[_0xb63b('0xa')](_0xb63b('0x8b'));_0x182aad['field']('i.disposition');_0x182aad[_0xb63b('0xa')]('i.secondDisposition');_0x182aad[_0xb63b('0xa')](_0xb63b('0x6f'));_0x182aad['field']('i.substatus');_0x182aad[_0xb63b('0xa')]('i.to');_0x182aad[_0xb63b('0xa')](_0xb63b('0x8c'));_0x182aad[_0xb63b('0xa')](_0xb63b('0x8d'));_0x182aad[_0xb63b('0xa')]('i.UserId');}else if(_0x190406===_0xb63b('0x33')){_0x182aad[_0xb63b('0xa')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x182aad[_0xb63b('0xa')](_0xb63b('0x8e'),_0xb63b('0x86'));}if(_0x190406!==_0xb63b('0x70')){_0x182aad[_0xb63b('0xa')](_0xb63b('0x8f'));}_0x182aad['field'](_0xb63b('0x90'),_0xb63b('0x91'));_0x182aad[_0xb63b('0xa')]('c.lastName',_0xb63b('0x92'));_0x182aad[_0xb63b('0xa')](_0xb63b('0x93'),_0xb63b('0x94'));_0x182aad['field']('c.phone','Contact.phone');_0x182aad['field'](_0xb63b('0x95'),'Contact.mobile');_0x182aad[_0xb63b('0xa')](_0xb63b('0x96'),'Contact.fax');_0x182aad['field'](_0xb63b('0x97'),_0xb63b('0x98'));_0x182aad['field'](_0xb63b('0x99'),_0xb63b('0x9a'));_0x182aad['field'](_0xb63b('0x9b'),_0xb63b('0x9c'));}if(_0x52332a[_0xb63b('0x9d')]){_0x182aad['limit'](_0x52332a[_0xb63b('0x9d')]);}if(_0x52332a[_0xb63b('0x9e')]){_0x182aad['offset'](_0x52332a[_0xb63b('0x9e')]);}return db['sequelize'][_0xb63b('0x7b')](_0x182aad[_0xb63b('0x7c')](),_0x121281);})['then'](function(_0x26cd3d){_0x6c2324=_0x26cd3d;var _0x3f1901=getUsersQuery(_0x190406,_0x6c2324);return db[_0xb63b('0x7a')][_0xb63b('0x7b')](_0x3f1901[_0xb63b('0x7c')](),_0x121281);})[_0xb63b('0x66')](function(_0x4e49fe){_0x4a15b1=_['groupBy'](_0x4e49fe,_0x135300);if(_0x190406===_0xb63b('0x70')){return db['Setting']['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0xb63b('0x66')](function(_0x43433b){var _0x1229ff=_0x43433b?_0x43433b['enableEmailPreview']:undefined;var _0x25e9f8=_0x6c2324['map'](function(_0x2560f4){return updateInteraction(_0x2560f4,_0x532bfa,_0x4a15b1,_0x1229ff);});return Promise[_0xb63b('0x9f')](_0x25e9f8);});}function countFilteredInteractions(_0x145e54,_0x152bcd){var _0x2c9c7e=_0x145e54['clone']();_0x2c9c7e['field'](_0xb63b('0xa0'));_0x2c9c7e[_0xb63b('0xa')](_0xb63b('0x80'),_0xb63b('0x45'));var _0x352d7a=utils['getSelectedTags'](_0x152bcd);if(!_[_0xb63b('0xa1')](_0x352d7a)){_0x2c9c7e['where'](_0xb63b('0xa2'),_0x352d7a);}var _0x2af7b3={'type':db[_0xb63b('0x78')][_0xb63b('0xa3')]['SELECT'],'raw':!![]};return db[_0xb63b('0x7a')]['query'](_0x2c9c7e['toString'](),_0x2af7b3);}module[_0xb63b('0xa4')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xe1e0=['Sequelize','QueryTypes','sequelize','query','toString','keyBy','merge','attributes','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.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','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','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','enableEmailPreview','COUNT(*)','isEmpty','lodash','squel','../parsers/advancedSearch','updateInteraction','../../mysqldb','getAccountFK','role','agent','search','select','name','field','color','from','tools_tags','getInteractionFK','_interactions','u.fullname','ui.','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','sms','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','mail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','value','start','unreadMessages','and','Contact','operator','split','contact','end','tags','clause','User','$substring','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','some','compact','concat','createdAt','$gte','parse','$lte','null','resolve','then','fields','read','tag','filter','capitalize','chat','Websites','i.secondDisposition','i.disposition','unshift','i.substatus','closed','CONCAT_WS(\x27\x27,\x20','Interaction'];(function(_0x141067,_0x2544b9){var _0x14b492=function(_0x2b09ca){while(--_0x2b09ca){_0x141067['push'](_0x141067['shift']());}};_0x14b492(++_0x2544b9);}(_0xe1e0,0x168));var _0x0e1e=function(_0x406ae0,_0x1b8ea5){_0x406ae0=_0x406ae0-0x0;var _0x9e7b8b=_0xe1e0[_0x406ae0];return _0x9e7b8b;};'use strict';var _=require(_0x0e1e('0x0'));var squel=require(_0x0e1e('0x1'));var as=require(_0x0e1e('0x2'));var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0x0e1e('0x3')];var utils=require('./utils');var db=require(_0x0e1e('0x4'))['db'];function skipInteractionsQuery(_0x1f7d8b,_0x7540e2,_0x33eb9d){var _0x22cb1c=![];var _0x7dbb7f=utils[_0x0e1e('0x5')](_0x1f7d8b);if(_0x7540e2[_0x0e1e('0x6')]===_0x0e1e('0x7')&&!_0x33eb9d[_0x0e1e('0x8')]&&!_0x33eb9d[_0x7dbb7f]){_0x22cb1c=!![];}return _0x22cb1c;}function getTagsQuery(){return squel[_0x0e1e('0x9')]()['field']('id')['field'](_0x0e1e('0xa'))[_0x0e1e('0xb')](_0x0e1e('0xc'))[_0x0e1e('0xd')](_0x0e1e('0xe'));}function getUsersQuery(_0x327e09,_0x5ced21){var _0x1c546e=utils[_0x0e1e('0xf')](_0x327e09);var _0x4a98dc='user_has_'+_0x327e09+_0x0e1e('0x10');var _0x28b0e3=squel['select']()['field']('u.id')[_0x0e1e('0xb')](_0x0e1e('0x11'))[_0x0e1e('0xb')](_0x0e1e('0x12')+_0x1c546e)[_0x0e1e('0xd')](_0x4a98dc,'ui')['left_join'](_0x0e1e('0x13'),'u',_0x0e1e('0x14'));if(_0x5ced21[_0x0e1e('0x15')]>0x0){_0x28b0e3[_0x0e1e('0x16')](_0x0e1e('0x12')+_0x1c546e+_0x0e1e('0x17'),_[_0x0e1e('0x18')](_0x5ced21,'id'));}return _0x28b0e3;}function getInteractionsQuery(_0x1f766e){var _0x1ca8fe=utils[_0x0e1e('0x19')](_0x1f766e);var _0x5b087a=utils['getAccountFK'](_0x1f766e);var _0x9cde04=utils['getInteractionFK'](_0x1f766e);return squel[_0x0e1e('0x9')]()[_0x0e1e('0xd')](_0x1ca8fe[_0x0e1e('0x1a')],'i')[_0x0e1e('0x1b')]('cm_contacts','c',_0x0e1e('0x1c'))['left_join'](_0x0e1e('0x13'),'o',_0x0e1e('0x1d'))['left_join'](_0x1ca8fe[_0x0e1e('0x1e')],'a',_0x0e1e('0x1f')+_0x5b087a)[_0x0e1e('0x1b')](_0x1ca8fe[_0x0e1e('0x20')],'me',_0x0e1e('0x21')+_0x9cde04+'\x20=\x20i.id')[_0x0e1e('0x1b')](_0x1ca8fe[_0x0e1e('0x22')],'it','it.'+_0x9cde04+_0x0e1e('0x23'))['left_join'](_0x0e1e('0xe'),'t',_0x0e1e('0x24'));}function getSqlClauses(){var _0x2774d7={'body':squel[_0x0e1e('0x25')](),'contact':squel[_0x0e1e('0x25')](),'default':squel[_0x0e1e('0x25')](),'fields':squel[_0x0e1e('0x25')](),'filter':squel[_0x0e1e('0x25')](),'read':squel[_0x0e1e('0x25')](),'tags':{'clause':squel[_0x0e1e('0x25')](),'ids':null},'user':squel[_0x0e1e('0x25')]()};return _0x2774d7;}function parseTagParameter(_0x321ed4){var _0x3be7a5=squel[_0x0e1e('0x25')]();if(_0x321ed4){var _0x20f4aa=utils[_0x0e1e('0x26')](_0x321ed4);_0x20f4aa[_0x0e1e('0x27')](function(_0x31eeba){_0x3be7a5['or'](_0x0e1e('0x28'),'%,'+_0x31eeba+',%');});}return _0x3be7a5;}function parseReadParameter(_0x2a2c3b){var _0x4526db='';if(_0x2a2c3b){_0x4526db='unreadMessages\x20{OPERATOR}\x200';if(_0x2a2c3b==='1'){_0x4526db=_0x4526db[_0x0e1e('0x29')](_0x0e1e('0x2a'),'=');}else{_0x4526db=_0x4526db['replace']('{OPERATOR}','>');}}return _0x4526db;}function parseSearchFilter(_0x4db241,_0x4d4fb4){var _0x28df47=squel[_0x0e1e('0x25')]();if(_0x4d4fb4){var _0x3c4301=_0x4d4fb4[_0x0e1e('0x29')]('\x5c','\x5c\x5c')[_0x0e1e('0x29')](/'/g,'\x27\x27');if(qs[_0x0e1e('0x2b')](_0x3c4301)){_0x28df47['or']('i.id\x20LIKE\x20?',_0x3c4301+'%');if([_0x0e1e('0x2c'),'whatsapp'][_0x0e1e('0x2d')](_0x4db241)){_0x28df47['or'](_0x0e1e('0x2e'),_0x3c4301+'%');}else if(_0x4db241===_0x0e1e('0x2f')){_0x28df47['or'](_0x0e1e('0x30'),_0x3c4301+'%');}else if(_0x4db241==='openchannel'){_0x28df47['or']('i.from\x20LIKE\x20?',_0x3c4301+'%');}}else if(_0x4db241===_0x0e1e('0x31')&&qs['isEmail'](_0x3c4301)){_0x28df47['or']('c.email\x20LIKE\x20?',_0x3c4301+'%');}else{if(_0x4db241===_0x0e1e('0x31')){_0x28df47['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0e1e('0x32')](_0x3c4301,!![]))['or'](_0x0e1e('0x33'),qs['getFullTextValue'](_0x3c4301));}else if(_0x4db241!==_0x0e1e('0x2f')){_0x28df47['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0e1e('0x32')](_0x3c4301));}_0x28df47['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3c4301,!![]),null);}}return _0x28df47;}function parseAdvancedSearchFilter(_0x4f7e,_0x42cf30){var _0x4b153b=getSqlClauses();var _0xaf6785=as[_0x0e1e('0x34')](_0x4f7e);var _0x1e3541=_0xaf6785[_0x0e1e('0x35')];for(var _0x3f6e88=0x0;_0x3f6e88<_0xaf6785[_0x0e1e('0x36')][_0x0e1e('0x15')];_0x3f6e88++){var _0x429d63=_0xaf6785[_0x0e1e('0x36')][_0x3f6e88];var _0x1709be='i';var _0x9fd8fc=_[_0x0e1e('0x37')](_0x42cf30,[_0x0e1e('0xa'),_0x429d63[_0x0e1e('0xb')]]);if(_0x9fd8fc){var _0x4f3fd4=as[_0x0e1e('0x38')](_0x1709be,_0x9fd8fc[_0x0e1e('0x39')],_0x429d63);_0x4b153b[_0x0e1e('0x3a')][_0x1e3541](_0x4f3fd4[_0x0e1e('0x3b')],_0x4f3fd4[_0x0e1e('0x3c')][_0x0e1e('0x3d')],_0x4f3fd4[_0x0e1e('0x3c')]['end']);}else{switch(_0x429d63[_0x0e1e('0xb')]){case _0x0e1e('0x3e'):var _0x29bb28=parseReadParameter(_0x429d63[_0x0e1e('0x3c')]);_0x4b153b['read'][_0x0e1e('0x3f')](_0x29bb28);break;case _0x0e1e('0x40'):if(_0x429d63[_0x0e1e('0x41')]==='$substring'){if(_0x429d63['value'][_0x0e1e('0x42')]('\x20')[_0x0e1e('0x15')]>0x1){_0x4b153b[_0x0e1e('0x43')][_0x1e3541]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x429d63[_0x0e1e('0x3c')],!![]),null);}else{var _0x3eeaef='%'+_0x429d63[_0x0e1e('0x3c')]+'%';_0x4b153b[_0x0e1e('0x43')][_0x1e3541]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3eeaef,_0x3eeaef,_0x3eeaef);}}else{_0x9fd8fc=_['find'](_0x42cf30,['name','ContactId']);_0x429d63['field']='ContactId';_0x4f3fd4=as[_0x0e1e('0x38')](_0x1709be,_0x9fd8fc['type'],_0x429d63);_0x4b153b[_0x0e1e('0x43')][_0x1e3541](_0x4f3fd4[_0x0e1e('0x3b')],_0x4f3fd4[_0x0e1e('0x3c')][_0x0e1e('0x3d')],_0x4f3fd4['value'][_0x0e1e('0x44')]);}break;case'Tag':var _0x56f2e3=_0x429d63[_0x0e1e('0x3c')]['split'](',')[_0x0e1e('0x18')](function(_0x20f8af){return Number(_0x20f8af);});var _0x3b6f96=parseTagParameter(_0x56f2e3);_0x4b153b[_0x0e1e('0x45')][_0x0e1e('0x46')]['and'](_0x3b6f96);_0x4b153b[_0x0e1e('0x45')]['ids']=_0x56f2e3;break;case _0x0e1e('0x47'):if(_0x429d63['operator']===_0x0e1e('0x48')){_0x4b153b[_0x0e1e('0x49')][_0x1e3541](_0x0e1e('0x4a'),'%'+_0x429d63[_0x0e1e('0x3c')]+'%',null);}else{_0x9fd8fc=_[_0x0e1e('0x37')](_0x42cf30,[_0x0e1e('0xa'),_0x0e1e('0x4b')]);_0x429d63[_0x0e1e('0xb')]='UserId';_0x4f3fd4=as['buildExpression'](_0x1709be,_0x9fd8fc[_0x0e1e('0x39')],_0x429d63);_0x4b153b[_0x0e1e('0x49')][_0x1e3541](_0x4f3fd4['text'],_0x4f3fd4[_0x0e1e('0x3c')][_0x0e1e('0x3d')],_0x4f3fd4[_0x0e1e('0x3c')][_0x0e1e('0x44')]);}break;case _0x0e1e('0x4c'):case _0x0e1e('0x4d'):_0x4f3fd4=as[_0x0e1e('0x38')]('me',null,_0x429d63);_0x4b153b[_0x0e1e('0x4c')][_0x1e3541](_0x4f3fd4[_0x0e1e('0x3b')],_0x4f3fd4[_0x0e1e('0x3c')][_0x0e1e('0x3d')],_0x4f3fd4['value']['end']);break;}}}return _0x4b153b;}function parseModelFields(_0x5dc80e,_0x4a3810,_0x2705e6){var _0x149043=utils[_0x0e1e('0x5')](_0x5dc80e);var _0x37e213=squel['expr']();var _0x5bb74a=_(_0x4a3810)['keys']()[_0x0e1e('0x18')](function(_0x58a961){return _[_0x0e1e('0x4e')](_0x2705e6,[_0x0e1e('0xa'),_0x58a961])?_0x58a961:undefined;})[_0x0e1e('0x4f')]()[_0x0e1e('0x3c')]();if(_0x5bb74a[_0x0e1e('0x15')]>0x0){_0x5bb74a['forEach'](function(_0x1eb1fb){if(_0x1eb1fb===_0x149043){_0x37e213[_0x0e1e('0x3f')]('i.'+_0x149043+'\x20IN\x20?',[][_0x0e1e('0x50')](_0x4a3810[_0x1eb1fb]));}else if(_0x1eb1fb===_0x0e1e('0x51')){var _0x19de95=JSON['parse'](_0x4a3810[_0x1eb1fb])[_0x0e1e('0x52')];var _0x371b1a=JSON[_0x0e1e('0x53')](_0x4a3810[_0x1eb1fb])[_0x0e1e('0x54')];_0x37e213[_0x0e1e('0x3f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19de95,_0x371b1a);}else{if(_0x4a3810[_0x1eb1fb]===_0x0e1e('0x55')){_0x37e213[_0x0e1e('0x3f')]('i.'+_0x1eb1fb+'\x20IS\x20NULL');}else{_0x37e213[_0x0e1e('0x3f')]('i.'+_0x1eb1fb+'\x20=\x20?',_0x4a3810[_0x1eb1fb]);}}});}return _0x37e213;}function parseQueryParameters(_0x3908ad,_0x3ee741,_0x1d06fa){var _0x28c8da=getSqlClauses();return Promise[_0x0e1e('0x56')]()['then'](function(){return parseModelFields(_0x3908ad,_0x3ee741,_0x1d06fa);})[_0x0e1e('0x57')](function(_0x126fd8){_0x28c8da[_0x0e1e('0x58')]['and'](_0x126fd8);return parseReadParameter(_0x3ee741['read']);})['then'](function(_0x3899b1){_0x28c8da[_0x0e1e('0x59')][_0x0e1e('0x3f')](_0x3899b1);return parseTagParameter(_0x3ee741[_0x0e1e('0x5a')]);})[_0x0e1e('0x57')](function(_0x289bde){_0x28c8da[_0x0e1e('0x45')][_0x0e1e('0x46')][_0x0e1e('0x3f')](_0x289bde);return parseSearchFilter(_0x3908ad,_0x3ee741['filter']);})['then'](function(_0x57b563){_0x28c8da[_0x0e1e('0x5b')]=_0x57b563;return _0x28c8da;});}function checkAccountsRestrictions(_0x53f6cd,_0x3d20e4,_0x42a72d){var _0x9f6520=utils[_0x0e1e('0x5')](_0x53f6cd);var _0xbdc209='get'+_[_0x0e1e('0x5c')](_0x53f6cd)+(_0x53f6cd===_0x0e1e('0x5d')?_0x0e1e('0x5e'):'Accounts');var _0x35d77b=squel['expr']();return Promise[_0x0e1e('0x56')]()[_0x0e1e('0x57')](function(){if(_0x42a72d['search']&&_0x3d20e4[_0x0e1e('0x6')]===_0x0e1e('0x7')){return _0x3d20e4[_0xbdc209]({'attributes':['id'],'raw':!![]});}})[_0x0e1e('0x57')](function(_0x1a923e){if(_0x1a923e){if(_0x1a923e[_0x0e1e('0x15')]===0x0){_0x35d77b[_0x0e1e('0x3f')]('i.'+_0x9f6520+'\x20IS\x20NULL');}else{_0x35d77b[_0x0e1e('0x3f')]('i.'+_0x9f6520+_0x0e1e('0x17'),_[_0x0e1e('0x18')](_0x1a923e,'id'));}}else if(!_0x42a72d[_0x9f6520]){_0x35d77b[_0x0e1e('0x3f')]('i.'+_0x9f6520+'\x20IS\x20NOT\x20NULL');}})[_0x0e1e('0x57')](function(){return _0x35d77b;});}function getClosedOrderClause(_0x4c9d63,_0x51fced){var _0x3a390f='';var _0x11cdce=['i.thirdDisposition',_0x0e1e('0x5f'),_0x0e1e('0x60')];if(_0x4c9d63===_0x0e1e('0x31')){_0x11cdce[_0x0e1e('0x61')](_0x0e1e('0x62'));}if(_0x51fced[_0x0e1e('0x63')]==='0'&&_0x4c9d63==='mail'){_0x3a390f=_0x0e1e('0x62');}else{if(_0x51fced[_0x0e1e('0x63')]==='1'){_0x11cdce['shift']();}_0x3a390f=_0x0e1e('0x64')+_0x11cdce['join'](',\x20')+')';}return _0x3a390f;}function getFilteredInteractions(_0x20777c,_0xc66810,_0x51a018,_0x2e5113){var _0x34d813=utils[_0x0e1e('0xf')](_0x20777c);var _0x240702=_[_0x0e1e('0x5c')](_0x20777c)+_0x0e1e('0x65');var _0x388157=[];var _0x1ac96c=getTagsQuery();var _0x522e95={'type':db[_0x0e1e('0x66')][_0x0e1e('0x67')]['SELECT'],'raw':!![]};var _0xffa60=[];var _0x34ab3f=[];return db[_0x0e1e('0x68')][_0x0e1e('0x69')](_0x1ac96c[_0x0e1e('0x6a')](),_0x522e95)['then'](function(_0x517e78){_0x388157=_[_0x0e1e('0x6b')](_0x517e78,'id');_0x522e95=_[_0x0e1e('0x6c')](_0x522e95,{'model':db[_0x240702],'mapToModel':!![],'nest':!![]});if(_0x51a018[_0x0e1e('0x58')]){_0x2e5113[_0x0e1e('0x6d')]['forEach'](function(_0x5ce710){_0xc66810[_0x0e1e('0xb')]('i.'+_0x5ce710);});}else{_0xc66810[_0x0e1e('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0xc66810[_0x0e1e('0xb')]('a.key','Account.key');_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x6e'),_0x0e1e('0x6f'));if(_0x20777c==='mail'){_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x70'),_0x0e1e('0x71'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x72'),_0x0e1e('0x73'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x74'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x75'));_0xc66810['field'](_0x0e1e('0x76'));_0xc66810['field'](_0x0e1e('0x77'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x78'));_0xc66810[_0x0e1e('0xb')]('i.attach');_0xc66810['field'](_0x0e1e('0x79'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x7a'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x7b'));_0xc66810['field'](_0x0e1e('0x60'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x5f'));_0xc66810['field']('i.thirdDisposition');_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x62'));_0xc66810['field'](_0x0e1e('0x7c'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x7d'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x7e'));_0xc66810['field'](_0x0e1e('0x7f'));}else if(_0x20777c==='openchannel'){_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x80'),_0x0e1e('0x73'));}else{_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x81'),_0x0e1e('0x73'));}if(_0x20777c!=='mail'){_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x82'));}_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x83'),_0x0e1e('0x84'));_0xc66810[_0x0e1e('0xb')]('c.lastName',_0x0e1e('0x85'));_0xc66810['field'](_0x0e1e('0x86'),_0x0e1e('0x87'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x88'),_0x0e1e('0x89'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x8a'),'Contact.mobile');_0xc66810['field'](_0x0e1e('0x8b'),_0x0e1e('0x8c'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x8d'),_0x0e1e('0x8e'));_0xc66810[_0x0e1e('0xb')](_0x0e1e('0x8f'),_0x0e1e('0x90'));_0xc66810['field'](_0x0e1e('0x91'),_0x0e1e('0x92'));}if(_0x2e5113[_0x0e1e('0x93')]){_0xc66810['limit'](_0x2e5113[_0x0e1e('0x93')]);}if(_0x2e5113['offset']){_0xc66810[_0x0e1e('0x94')](_0x2e5113[_0x0e1e('0x94')]);}return db[_0x0e1e('0x68')]['query'](_0xc66810[_0x0e1e('0x6a')](),_0x522e95);})[_0x0e1e('0x57')](function(_0xbd397){_0xffa60=_0xbd397;var _0x409f05=getUsersQuery(_0x20777c,_0xffa60);return db[_0x0e1e('0x68')][_0x0e1e('0x69')](_0x409f05[_0x0e1e('0x6a')](),_0x522e95);})[_0x0e1e('0x57')](function(_0x35bffa){_0x34ab3f=_[_0x0e1e('0x95')](_0x35bffa,_0x34d813);if(_0x20777c==='mail'){return db[_0x0e1e('0x96')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x0e1e('0x57')](function(_0x593721){var _0x53c72e=_0x593721?_0x593721[_0x0e1e('0x97')]:undefined;var _0x39545f=_0xffa60[_0x0e1e('0x18')](function(_0x468473){return updateInteraction(_0x468473,_0x388157,_0x34ab3f,_0x53c72e);});return Promise['all'](_0x39545f);});}function countFilteredInteractions(_0x2be6f3,_0x3617f5){var _0x416186=_0x2be6f3['clone']();_0x416186[_0x0e1e('0xb')](_0x0e1e('0x98'));_0x416186['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x1408b6=utils[_0x0e1e('0x26')](_0x3617f5);if(!_[_0x0e1e('0x99')](_0x1408b6)){_0x416186[_0x0e1e('0x16')]('t.id\x20IN\x20?',_0x1408b6);}var _0x4f9bef={'type':db[_0x0e1e('0x66')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0x0e1e('0x68')][_0x0e1e('0x69')](_0x416186['toString'](),_0x4f9bef);}module['exports']={'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 a49e532..ee27d20 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 _0xe98c=['Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','waiting','answered','unmanaged','abandoned','closed','disposition','UserId','talking','MailMessage','plainBody','lastMsgText','trimStart','catch','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe98c,0x1e6));var _0xce98=function(_0xbfe734,_0x660643){_0xbfe734=_0xbfe734-0x0;var _0x3f1a35=_0xe98c[_0xbfe734];return _0x3f1a35;};'use strict';var _=require(_0xce98('0x0'));var db=require(_0xce98('0x1'))['db'];function getInteractionUsers(_0x13e7af,_0x52cab3){return new Promise(function(_0x5ce323,_0x23c6ec){try{var _0x51490a=[];if(_0x52cab3[_0x13e7af]){_0x51490a=_0x52cab3[_0x13e7af][_0xce98('0x2')](function(_0x1cdfb8){return{'id':_0x1cdfb8['id'],'fullname':_0x1cdfb8[_0xce98('0x3')]};});}return _0x5ce323(_0x51490a);}catch(_0x5c4c48){_0x23c6ec(_0x5c4c48);}});}function getInteractionTags(_0x28b228,_0x1e7d35){var _0x42f33b=[];if(_0x28b228){_0x28b228[_0xce98('0x4')](',')[_0xce98('0x5')](function(_0x3d0172){_0x42f33b['push'](_0x1e7d35[_0x3d0172]);});}return _0x42f33b;}function updateWaitingCounter(_0x59dbb4){if(_0x59dbb4[_0xce98('0x6')]){_0x59dbb4[_0xce98('0x6')]-=0x1;}}function updateInteractionCounters(_0x238894){_0x238894[_0xce98('0x6')]=0x0;_0x238894['talking']=0x0;_0x238894[_0xce98('0x7')]=0x0;_0x238894[_0xce98('0x8')]=0x0;_0x238894[_0xce98('0x9')]=0x0;_0x238894['total']=0x0;if(_0x238894[_0xce98('0xa')]){if(_0x238894[_0xce98('0xb')]===_0xce98('0x9')){_0x238894[_0xce98('0x9')]+=0x1;updateWaitingCounter(_0x238894);}if(_0x238894[_0xce98('0xc')]){_0x238894[_0xce98('0x7')]+=0x1;if(_0x238894[_0xce98('0xd')]){_0x238894[_0xce98('0xd')]-=0x1;}}else{if(_0x238894[_0xce98('0xb')]){_0x238894[_0xce98('0x8')]+=0x1;updateWaitingCounter(_0x238894);}}}else{if(!_0x238894[_0xce98('0xc')]){_0x238894[_0xce98('0x6')]+=0x1;}if(_0x238894[_0xce98('0xc')]){_0x238894[_0xce98('0xd')]+=0x1;updateWaitingCounter(_0x238894);}}_0x238894['total']+=0x1;return _0x238894;}function getLastMessageText(_0x59161f){return db[_0xce98('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x59161f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xce98('0xf')],'order':'-id','raw':!![]})['then'](function(_0x2e0812){if(_0x2e0812&&_0x2e0812['plainBody']){_0x59161f[_0xce98('0x10')]=_[_0xce98('0x11')](_0x2e0812[_0xce98('0xf')]);}return _0x59161f;})[_0xce98('0x12')](function(_0x5c6553){throw _0x5c6553;});}exports['updateInteraction']=function(_0x4c7f0c,_0x3d7b67,_0x4a831d,_0x2f3a90){return new Promise(function(_0xd90728,_0x2828f4){return getInteractionUsers(_0x4c7f0c['id'],_0x4a831d)[_0xce98('0x13')](function(_0x119313){_0x4c7f0c[_0xce98('0x14')]=_0x119313;return getInteractionTags(_0x4c7f0c[_0xce98('0x15')],_0x3d7b67);})[_0xce98('0x13')](function(_0x294a6a){_0x4c7f0c[_0xce98('0x16')]=_0x294a6a;delete _0x4c7f0c['TagIds'];return updateInteractionCounters(_0x4c7f0c);})[_0xce98('0x13')](function(_0x750e58){if(_0x2f3a90){return getLastMessageText(_0x750e58);}else{return _0x750e58;}})[_0xce98('0x13')](function(_0x47ed5c){_0xd90728(_0x47ed5c);})[_0xce98('0x12')](function(_0x3d21a1){_0x2828f4(_0x3d21a1);});});}; \ No newline at end of file +var _0x631e=['talking','answered','unmanaged','abandoned','closed','disposition','UserId','MailMessage','findOne','-id','trimStart','then','Users','TagIds','Tags','catch','lodash','../../mysqldb','fullname','split','push','waiting'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x631e,0x102));var _0xe631=function(_0x1192a5,_0x56b4a4){_0x1192a5=_0x1192a5-0x0;var _0x1716f8=_0x631e[_0x1192a5];return _0x1716f8;};'use strict';var _=require(_0xe631('0x0'));var db=require(_0xe631('0x1'))['db'];function getInteractionUsers(_0xd51e33,_0x1c3cc6){return new Promise(function(_0x1dbde4,_0x289473){try{var _0x18eac6=[];if(_0x1c3cc6[_0xd51e33]){_0x18eac6=_0x1c3cc6[_0xd51e33]['map'](function(_0xf77ff3){return{'id':_0xf77ff3['id'],'fullname':_0xf77ff3[_0xe631('0x2')]};});}return _0x1dbde4(_0x18eac6);}catch(_0x2f051b){_0x289473(_0x2f051b);}});}function getInteractionTags(_0x29a8ea,_0x4547c5){var _0x8e0c92=[];if(_0x29a8ea){_0x29a8ea[_0xe631('0x3')](',')['forEach'](function(_0x452058){_0x8e0c92[_0xe631('0x4')](_0x4547c5[_0x452058]);});}return _0x8e0c92;}function updateWaitingCounter(_0x427c79){if(_0x427c79[_0xe631('0x5')]){_0x427c79[_0xe631('0x5')]-=0x1;}}function updateInteractionCounters(_0x4b7754){_0x4b7754[_0xe631('0x5')]=0x0;_0x4b7754[_0xe631('0x6')]=0x0;_0x4b7754[_0xe631('0x7')]=0x0;_0x4b7754[_0xe631('0x8')]=0x0;_0x4b7754[_0xe631('0x9')]=0x0;_0x4b7754['total']=0x0;if(_0x4b7754[_0xe631('0xa')]){if(_0x4b7754[_0xe631('0xb')]==='abandoned'){_0x4b7754[_0xe631('0x9')]+=0x1;updateWaitingCounter(_0x4b7754);}if(_0x4b7754[_0xe631('0xc')]){_0x4b7754[_0xe631('0x7')]+=0x1;if(_0x4b7754[_0xe631('0x6')]){_0x4b7754[_0xe631('0x6')]-=0x1;}}else{if(_0x4b7754[_0xe631('0xb')]){_0x4b7754['unmanaged']+=0x1;updateWaitingCounter(_0x4b7754);}}}else{if(!_0x4b7754['UserId']){_0x4b7754[_0xe631('0x5')]+=0x1;}if(_0x4b7754[_0xe631('0xc')]){_0x4b7754[_0xe631('0x6')]+=0x1;updateWaitingCounter(_0x4b7754);}}_0x4b7754['total']+=0x1;return _0x4b7754;}function getLastMessageText(_0x19c456){return db[_0xe631('0xd')][_0xe631('0xe')]({'where':{'$and':[{'MailInteractionId':_0x19c456['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xe631('0xf'),'raw':!![]})['then'](function(_0x1dd962){if(_0x1dd962&&_0x1dd962['plainBody']){_0x19c456['lastMsgText']=_[_0xe631('0x10')](_0x1dd962['plainBody']);}return _0x19c456;})['catch'](function(_0x3bc1f0){throw _0x3bc1f0;});}exports['updateInteraction']=function(_0xc9231c,_0xc6fc61,_0x519897,_0x2aef90){return new Promise(function(_0x4e2fee,_0x463bc4){return getInteractionUsers(_0xc9231c['id'],_0x519897)[_0xe631('0x11')](function(_0x2cfc1b){_0xc9231c[_0xe631('0x12')]=_0x2cfc1b;return getInteractionTags(_0xc9231c[_0xe631('0x13')],_0xc6fc61);})[_0xe631('0x11')](function(_0x29c059){_0xc9231c[_0xe631('0x14')]=_0x29c059;delete _0xc9231c[_0xe631('0x13')];return updateInteractionCounters(_0xc9231c);})['then'](function(_0xbbe3e5){if(_0x2aef90){return getLastMessageText(_0xbbe3e5);}else{return _0xbbe3e5;}})['then'](function(_0x1b0aab){_0x4e2fee(_0x1b0aab);})[_0xe631('0x15')](function(_0xbfada4){_0x463bc4(_0xbfada4);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index d601638..b274327 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 _0xa3ca=['info','catch','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','whatsapp-interactions','chat','Website','Account','InteractionId','upperFirst','websites','accounts','_interactions','_interaction_has_tags','user_has_','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','then','update'];(function(_0x64655b,_0x567d7f){var _0x50209d=function(_0x3207fa){while(--_0x3207fa){_0x64655b['push'](_0x64655b['shift']());}};_0x50209d(++_0x567d7f);}(_0xa3ca,0x17c));var _0xaa3c=function(_0x234cc7,_0x5ab546){_0x234cc7=_0x234cc7-0x0;var _0x700f01=_0xa3ca[_0x234cc7];return _0x700f01;};'use strict';var _=require(_0xaa3c('0x0'));var db=require(_0xaa3c('0x1'))['db'];var loggers={'openchannel':require(_0xaa3c('0x2'))('openchannel-interactions'),'mail':require(_0xaa3c('0x2'))(_0xaa3c('0x3')),'fax':require('../../config/logger')(_0xaa3c('0x4')),'sms':require(_0xaa3c('0x2'))('sms-interactions'),'chat':require(_0xaa3c('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0xaa3c('0x5'))};function getAccountFK(_0x2b045e){return _['capitalize'](_0x2b045e)+(_0x2b045e===_0xaa3c('0x6')?_0xaa3c('0x7'):_0xaa3c('0x8'))+'Id';}function getInteractionFK(_0x2ccc73){return _['capitalize'](_0x2ccc73)+_0xaa3c('0x9');}function getInteractionId(_0x17a37d,_0x49dd8a,_0x48ccb5){if(_0x17a37d&&_0x17a37d[_[_0xaa3c('0xa')](_0x48ccb5)+'InteractionId']){return _0x17a37d[_[_0xaa3c('0xa')](_0x48ccb5)+_0xaa3c('0x9')];}else if(_0x17a37d&&_0x17a37d['id']){return _0x17a37d['id'];}else if(_0x49dd8a&&_0x49dd8a['id']){return _0x49dd8a['id'];}else{return'unknown';}}function getInteractionsTables(_0x6adf9e){return{'accounts':_0x6adf9e+'_'+(_0x6adf9e==='chat'?_0xaa3c('0xb'):_0xaa3c('0xc')),'interactions':_0x6adf9e+_0xaa3c('0xd'),'interactionsTags':_0x6adf9e+_0xaa3c('0xe'),'messages':_0x6adf9e+'_messages','userInteractions':_0xaa3c('0xf')+_0x6adf9e+_0xaa3c('0xd')};}function getSelectedTags(_0x100ca7){var _0x3d33e5=[];if(_0x100ca7){_0x3d33e5=Array['isArray'](_0x100ca7)?_0x100ca7:[_0x100ca7];}return _0x3d33e5;}function log(_0x19e2db,_0x4873ff,_0x1abffd,_0x16ccc4,_0x110e4a,_0x15e655){loggers[_0x110e4a['toLowerCase']()][_0x19e2db](_0xaa3c('0x10'),_0x15e655[_0xaa3c('0x11')](),_0x4873ff?_0x4873ff['id']:null,_0x4873ff?_0x4873ff[_0xaa3c('0x12')]:null,_0x4873ff?_0x4873ff[_0xaa3c('0x13')]:null,getInteractionId(_0x1abffd,_0x16ccc4,_0x110e4a),_0x1abffd?JSON[_0xaa3c('0x14')](_0x1abffd):_0xaa3c('0x15'));}function updateUser(_0x524f94,_0x377269,_0x45098a,_0x2ba7cc,_0x295b2c){db[_[_0xaa3c('0xa')](_0x2ba7cc)+'Interaction'][_0xaa3c('0x16')]({'where':{'id':getInteractionId(_0x377269,_0x45098a,_0x2ba7cc)}})[_0xaa3c('0x17')](function(_0xb3f47){if(_0xb3f47){return _0xb3f47[_0xaa3c('0x18')]({'UserId':_0x524f94?_0x524f94['id']:null});}})[_0xaa3c('0x17')](function(_0x421474){if(_0x421474){log(_0xaa3c('0x19'),_0x524f94,_0x377269,_0x45098a,_0x2ba7cc,_0x295b2c);}})[_0xaa3c('0x1a')](function(){log('error',_0x524f94,_0x377269,_0x45098a,_0x2ba7cc,_0x295b2c);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x1041=['_interaction_has_tags','_messages','isArray','toLowerCase','name','role','null','Interaction','findOne','then','info','catch','exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','_interactions'];(function(_0x31971c,_0x3a3ca3){var _0x5d9994=function(_0x15798d){while(--_0x15798d){_0x31971c['push'](_0x31971c['shift']());}};_0x5d9994(++_0x3a3ca3);}(_0x1041,0x157));var _0x1104=function(_0xf7c93e,_0x586f4b){_0xf7c93e=_0xf7c93e-0x0;var _0x2e3b2a=_0x1041[_0xf7c93e];return _0x2e3b2a;};'use strict';var _=require(_0x1104('0x0'));var db=require(_0x1104('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x1104('0x2')),'mail':require(_0x1104('0x3'))(_0x1104('0x4')),'fax':require('../../config/logger')(_0x1104('0x5')),'sms':require(_0x1104('0x3'))(_0x1104('0x6')),'chat':require(_0x1104('0x3'))('chat-interactions'),'whatsapp':require(_0x1104('0x3'))(_0x1104('0x7'))};function getAccountFK(_0x2f662d){return _[_0x1104('0x8')](_0x2f662d)+(_0x2f662d===_0x1104('0x9')?_0x1104('0xa'):_0x1104('0xb'))+'Id';}function getInteractionFK(_0x30fb4f){return _[_0x1104('0x8')](_0x30fb4f)+_0x1104('0xc');}function getInteractionId(_0x2901fa,_0x16b8e4,_0x197cda){if(_0x2901fa&&_0x2901fa[_[_0x1104('0xd')](_0x197cda)+_0x1104('0xc')]){return _0x2901fa[_[_0x1104('0xd')](_0x197cda)+_0x1104('0xc')];}else if(_0x2901fa&&_0x2901fa['id']){return _0x2901fa['id'];}else if(_0x16b8e4&&_0x16b8e4['id']){return _0x16b8e4['id'];}else{return _0x1104('0xe');}}function getInteractionsTables(_0x4be45f){return{'accounts':_0x4be45f+'_'+(_0x4be45f===_0x1104('0x9')?_0x1104('0xf'):'accounts'),'interactions':_0x4be45f+_0x1104('0x10'),'interactionsTags':_0x4be45f+_0x1104('0x11'),'messages':_0x4be45f+_0x1104('0x12'),'userInteractions':'user_has_'+_0x4be45f+_0x1104('0x10')};}function getSelectedTags(_0x409b64){var _0x18dd65=[];if(_0x409b64){_0x18dd65=Array[_0x1104('0x13')](_0x409b64)?_0x409b64:[_0x409b64];}return _0x18dd65;}function log(_0x177691,_0x386537,_0x4dae49,_0x5c3be5,_0x596965,_0xe90aa5){loggers[_0x596965[_0x1104('0x14')]()][_0x177691]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe90aa5['toUpperCase'](),_0x386537?_0x386537['id']:null,_0x386537?_0x386537[_0x1104('0x15')]:null,_0x386537?_0x386537[_0x1104('0x16')]:null,getInteractionId(_0x4dae49,_0x5c3be5,_0x596965),_0x4dae49?JSON['stringify'](_0x4dae49):_0x1104('0x17'));}function updateUser(_0x2f800f,_0xf701b2,_0x4131b8,_0x598a1b,_0x2ade1c){db[_['upperFirst'](_0x598a1b)+_0x1104('0x18')][_0x1104('0x19')]({'where':{'id':getInteractionId(_0xf701b2,_0x4131b8,_0x598a1b)}})['then'](function(_0x1bf3cb){if(_0x1bf3cb){return _0x1bf3cb['update']({'UserId':_0x2f800f?_0x2f800f['id']:null});}})[_0x1104('0x1a')](function(_0x3435d3){if(_0x3435d3){log(_0x1104('0x1b'),_0x2f800f,_0xf701b2,_0x4131b8,_0x598a1b,_0x2ade1c);}})[_0x1104('0x1c')](function(){log('error',_0x2f800f,_0xf701b2,_0x4131b8,_0x598a1b,_0x2ade1c);});}module[_0x1104('0x1d')]={'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 26b458e..ea17f2a 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 _0xc0a5=['findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','createDecipher','aes-256-ctr','format','update','utf8','final','parse','hasOwnProperty','use','License'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc0a5,0x132));var _0x5c0a=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xc0a5[_0x2f45ea];return _0x485a84;};'use strict';var crypto=require(_0x5c0a('0x0'));var util=require('util');var compose=require(_0x5c0a('0x1'));var db=require(_0x5c0a('0x2'))['db'];var config=require(_0x5c0a('0x3'));function getValueFromLicense(_0x52ed04,_0x124f21){if(_0x52ed04&&_0x124f21){if(_0x124f21[_0x5c0a('0x4')]&&_0x124f21[_0x5c0a('0x5')]){var _0x1d9aad=_0x124f21[_0x5c0a('0x4')];var _0x3af61c=_0x124f21[_0x5c0a('0x5')];var _0xd6da44=_0x1d9aad['split']('-')[0x4];var _0x1d3a2a=_0x1d9aad['split']('-')[0x0];var _0x16d2ec=crypto[_0x5c0a('0x6')](_0x5c0a('0x7'),util[_0x5c0a('0x8')]('%s:%s:%s',_0xd6da44,_0x1d9aad,_0x1d3a2a));var _0x58043f=_0x16d2ec[_0x5c0a('0x9')](_0x3af61c,'base64',_0x5c0a('0xa'));_0x58043f+=_0x16d2ec[_0x5c0a('0xb')]('utf8');var _0x4adb95=JSON[_0x5c0a('0xc')](_0x58043f);return _0x4adb95[_0x5c0a('0xd')](_0x52ed04)?_0x4adb95[_0x52ed04]:null;}}return null;}function isLimit(_0x2082df,_0x5903fb,_0x1c45f3,_0x59b71d){var _0x332f62=_0x5903fb;return compose()[_0x5c0a('0xe')](function(_0x5eb6e3,_0x519a0,_0xa82b87){return db[_0x5c0a('0xf')][_0x5c0a('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x5c0a('0x11')](function(_0x3d461d){var _0x193edc=getValueFromLicense(_0x2082df,_0x3d461d);return _0x193edc?_0x193edc:_0x332f62;})[_0x5c0a('0x11')](function(_0x7e0f7b){_0x332f62=_0x7e0f7b;return _0x1c45f3[_0x5c0a('0x12')](_0x59b71d);})['then'](function(_0x68b6f6){if(_0x68b6f6>=_0x332f62){return _0x519a0[_0x5c0a('0x13')](0x193)['json']({'message':util[_0x5c0a('0x8')](_0x5c0a('0x14'),_0x2082df)});}_0xa82b87();})['catch'](function(_0x4b1282){_0xa82b87(_0x4b1282);});});}function isUserLimit(){return isLimit(_0x5c0a('0x15'),0x1,db[_0x5c0a('0x16')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x679a=['composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','hasOwnProperty','use','License','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util'];(function(_0x45e351,_0x234f5d){var _0x32453b=function(_0x16c8a5){while(--_0x16c8a5){_0x45e351['push'](_0x45e351['shift']());}};_0x32453b(++_0x234f5d);}(_0x679a,0x1b8));var _0xa679=function(_0x4566f7,_0x1812bc){_0x4566f7=_0x4566f7-0x0;var _0xc6428c=_0x679a[_0x4566f7];return _0xc6428c;};'use strict';var crypto=require(_0xa679('0x0'));var util=require(_0xa679('0x1'));var compose=require(_0xa679('0x2'));var db=require(_0xa679('0x3'))['db'];var config=require(_0xa679('0x4'));function getValueFromLicense(_0x58b008,_0x23522f){if(_0x58b008&&_0x23522f){if(_0x23522f[_0xa679('0x5')]&&_0x23522f[_0xa679('0x6')]){var _0x325257=_0x23522f[_0xa679('0x5')];var _0x59ac69=_0x23522f[_0xa679('0x6')];var _0x3c6692=_0x325257['split']('-')[0x4];var _0x3fa852=_0x325257[_0xa679('0x7')]('-')[0x0];var _0x5278bf=crypto[_0xa679('0x8')](_0xa679('0x9'),util[_0xa679('0xa')](_0xa679('0xb'),_0x3c6692,_0x325257,_0x3fa852));var _0x24cb15=_0x5278bf['update'](_0x59ac69,_0xa679('0xc'),_0xa679('0xd'));_0x24cb15+=_0x5278bf['final'](_0xa679('0xd'));var _0x3badaf=JSON['parse'](_0x24cb15);return _0x3badaf[_0xa679('0xe')](_0x58b008)?_0x3badaf[_0x58b008]:null;}}return null;}function isLimit(_0x29cbe4,_0x4ca36d,_0x3a5332,_0x122b39){var _0x44a098=_0x4ca36d;return compose()[_0xa679('0xf')](function(_0x44b4db,_0x462776,_0xdb3591){return db[_0xa679('0x10')][_0xa679('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xa679('0x12')](function(_0x58d9b5){var _0x12122e=getValueFromLicense(_0x29cbe4,_0x58d9b5);return _0x12122e?_0x12122e:_0x44a098;})[_0xa679('0x12')](function(_0xf20caa){_0x44a098=_0xf20caa;return _0x3a5332['count'](_0x122b39);})[_0xa679('0x12')](function(_0x419f1b){if(_0x419f1b>=_0x44a098){return _0x462776[_0xa679('0x13')](0x193)['json']({'message':util[_0xa679('0xa')](_0xa679('0x14'),_0x29cbe4)});}_0xdb3591();})[_0xa679('0x15')](function(_0x292138){_0xdb3591(_0x292138);});});}function isUserLimit(){return isLimit(_0xa679('0x16'),0x1,db[_0xa679('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0xa679('0x18')}]}});}exports[_0xa679('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index abfcb74..4b5f3d9 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 _0xdd6b=['$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','DATE','utcOffset','add','hours','seconds','lodash','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','length','slice','shift','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith'];(function(_0x4f08b3,_0x1f08f2){var _0x5c1346=function(_0x107c56){while(--_0x107c56){_0x4f08b3['push'](_0x4f08b3['shift']());}};_0x5c1346(++_0x1f08f2);}(_0xdd6b,0x77));var _0xbdd6=function(_0x102bcd,_0x44f064){_0x102bcd=_0x102bcd-0x0;var _0x49245d=_0xdd6b[_0x102bcd];return _0x49245d;};'use strict';var _=require(_0xbdd6('0x0'));var moment=require('moment');exports[_0xbdd6('0x1')]=function(_0x32889f){var _0x5d3ec7={'conditions':[]};_0x5d3ec7[_0xbdd6('0x2')]=_['startsWith'](_0x32889f,_0xbdd6('0x3'))?'or':_0xbdd6('0x4');var _0x160c81=_0x32889f[_0xbdd6('0x5')](_0xbdd6('0x6'),'')['replace']('[$or]','')[_0xbdd6('0x7')]('||');for(var _0x496958=0x0;_0x496958<_0x160c81[_0xbdd6('0x8')];_0x496958++){var _0x5424c4=_0x160c81[_0x496958][_0xbdd6('0x7')](':=');var _0x38c226=_0x5424c4[0x0];var _0x3c9445=_0x5424c4[_0xbdd6('0x9')](0x1);_0x3c9445['forEach'](function(_0x458f35){var _0x90433=_0x458f35[_0xbdd6('0x7')]('[')[_0xbdd6('0xa')]();var _0x3f375b=_0x458f35['match'](/\[(.*?)\]/g);_0x3f375b['forEach'](function(_0xc4c160){var _0x83ac00=_0xc4c160[_0xbdd6('0x7')]('[')[_0xbdd6('0xb')](function(_0x63d70e){return _0x63d70e[_0xbdd6('0xc')](']')>-0x1;})[_0xbdd6('0xd')](function(_0x5d7856){return _0x5d7856['split'](']')[0x0];})[0x0];_0x5d3ec7[_0xbdd6('0xe')][_0xbdd6('0xf')]({'field':_0x38c226,'operator':_0x90433,'value':_0x83ac00});});});}return _0x5d3ec7;};exports[_0xbdd6('0x10')]=function(_0xc97a4d,_0x3f6f9d,_0x4a17dd){var _0x3539af={};if(_0x3f6f9d==='DATE'){if(_0x4a17dd[_0xbdd6('0x11')]==='$eq'){_0x4a17dd[_0xbdd6('0x11')]=_0xbdd6('0x12');_0x4a17dd[_0xbdd6('0x13')]+=','+_0x4a17dd['value'];}else if(_[_0xbdd6('0x14')](['$gt',_0xbdd6('0x15')],_0x4a17dd[_0xbdd6('0x11')])){_0x4a17dd['value']=moment(_0x4a17dd[_0xbdd6('0x13')])['add'](0x1,_0xbdd6('0x16'))[_0xbdd6('0x17')](_0xbdd6('0x18'));}}if(_0x4a17dd['castTo']){_0x3f6f9d=_0x4a17dd[_0xbdd6('0x19')];_0x3539af[_0xbdd6('0x1a')]='CAST('+_0xc97a4d+'.'+_0x4a17dd['field']+_0xbdd6('0x1b')+_0x4a17dd['castTo']+')\x20'+parseOperator(_0x4a17dd[_0xbdd6('0x11')]);}else{_0x3539af[_0xbdd6('0x1a')]=_0xc97a4d+'.'+_0x4a17dd[_0xbdd6('0x1c')]+'\x20'+parseOperator(_0x4a17dd[_0xbdd6('0x11')]);}if(_['includes']([_0xbdd6('0x1d'),_0xbdd6('0x1e')],_0x4a17dd[_0xbdd6('0x11')]))_0x3539af['text']='('+_0x3539af[_0xbdd6('0x1a')]+_0xbdd6('0x1f')+_0xc97a4d+'.'+_0x4a17dd[_0xbdd6('0x1c')]+_0xbdd6('0x20');_0x3539af['value']=parseValue(_0x3f6f9d,_0x4a17dd[_0xbdd6('0x11')],_0x4a17dd[_0xbdd6('0x13')]);return _0x3539af;};function parseOperator(_0x54833b){var _0x11cd92;switch(_0x54833b){case'$in':_0x11cd92=_0xbdd6('0x21');break;case _0xbdd6('0x1e'):_0x11cd92=_0xbdd6('0x22');break;case'$eq':_0x11cd92=_0xbdd6('0x23');break;case _0xbdd6('0x1d'):_0x11cd92=_0xbdd6('0x24');break;case _0xbdd6('0x25'):case _0xbdd6('0x26'):case _0xbdd6('0x27'):_0x11cd92='LIKE\x20?';break;case _0xbdd6('0x28'):_0x11cd92=_0xbdd6('0x29');break;case'$gt':_0x11cd92=_0xbdd6('0x2a');break;case'$lte':_0x11cd92=_0xbdd6('0x2b');break;case _0xbdd6('0x2c'):_0x11cd92=_0xbdd6('0x2d');break;case'$between':_0x11cd92=_0xbdd6('0x2e');break;}return _0x11cd92;}function parseValue(_0x2e9328,_0x269252,_0x1822fa){var _0x2a2448={'start':undefined,'end':undefined};switch(_0x269252){case'$in':case _0xbdd6('0x1e'):_0x2a2448[_0xbdd6('0x2f')]=_0x1822fa[_0xbdd6('0x7')](',');break;case _0xbdd6('0x25'):_0x2a2448[_0xbdd6('0x2f')]='%'+_0x1822fa+'%';break;case _0xbdd6('0x26'):_0x2a2448[_0xbdd6('0x2f')]=_0x1822fa+'%';break;case _0xbdd6('0x27'):_0x2a2448[_0xbdd6('0x2f')]='%'+_0x1822fa;break;case _0xbdd6('0x12'):var _0x14da51=_0x1822fa[_0xbdd6('0x7')](',');var _0x1822fa=_0x14da51['shift']();var _0x24a318=_0x14da51['pop']();if(_0x2e9328===_0xbdd6('0x30')){_0x1822fa=moment(_0x1822fa)[_0xbdd6('0x31')](0x0,!![])[_0xbdd6('0x17')]();_0x24a318=moment(_0x24a318)[_0xbdd6('0x31')](0x0,!![])[_0xbdd6('0x32')](0x17,_0xbdd6('0x33'))[_0xbdd6('0x32')](0x3b,'minutes')[_0xbdd6('0x32')](0x3b,_0xbdd6('0x34'))['format']();}_0x2a2448={'start':_0x1822fa,'end':_0x24a318};break;default:_0x2a2448[_0xbdd6('0x2f')]=_0x1822fa;break;}return _0x2a2448;} \ No newline at end of file +var _0x9624=['push','DATE','operator','$eq','value','includes','$gt','add','days','format','castTo','text','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','conditions'];(function(_0x36fc16,_0x3d6e94){var _0xe02e16=function(_0x244371){while(--_0x244371){_0x36fc16['push'](_0x36fc16['shift']());}};_0xe02e16(++_0x3d6e94);}(_0x9624,0xcb));var _0x4962=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9624[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4962('0x0'));var moment=require(_0x4962('0x1'));exports[_0x4962('0x2')]=function(_0x3f6143){var _0x31ab6f={'conditions':[]};_0x31ab6f[_0x4962('0x3')]=_[_0x4962('0x4')](_0x3f6143,_0x4962('0x5'))?'or':'and';var _0x361b04=_0x3f6143[_0x4962('0x6')](_0x4962('0x7'),'')[_0x4962('0x6')]('[$or]','')[_0x4962('0x8')]('||');for(var _0x34a249=0x0;_0x34a249<_0x361b04[_0x4962('0x9')];_0x34a249++){var _0xe6c5f1=_0x361b04[_0x34a249][_0x4962('0x8')](':=');var _0x57935d=_0xe6c5f1[0x0];var _0x1a244f=_0xe6c5f1[_0x4962('0xa')](0x1);_0x1a244f[_0x4962('0xb')](function(_0x462376){var _0x3328b6=_0x462376[_0x4962('0x8')]('[')[_0x4962('0xc')]();var _0x20e824=_0x462376[_0x4962('0xd')](/\[(.*?)\]/g);_0x20e824[_0x4962('0xb')](function(_0xd237f3){var _0xd2e189=_0xd237f3[_0x4962('0x8')]('[')[_0x4962('0xe')](function(_0x4079b2){return _0x4079b2[_0x4962('0xf')](']')>-0x1;})['map'](function(_0x2a513c){return _0x2a513c[_0x4962('0x8')](']')[0x0];})[0x0];_0x31ab6f[_0x4962('0x10')][_0x4962('0x11')]({'field':_0x57935d,'operator':_0x3328b6,'value':_0xd2e189});});});}return _0x31ab6f;};exports['buildExpression']=function(_0x50d819,_0x52978d,_0x183419){var _0xff5e41={};if(_0x52978d===_0x4962('0x12')){if(_0x183419[_0x4962('0x13')]===_0x4962('0x14')){_0x183419[_0x4962('0x13')]='$between';_0x183419[_0x4962('0x15')]+=','+_0x183419[_0x4962('0x15')];}else if(_[_0x4962('0x16')]([_0x4962('0x17'),'$lte'],_0x183419[_0x4962('0x13')])){_0x183419[_0x4962('0x15')]=moment(_0x183419[_0x4962('0x15')])[_0x4962('0x18')](0x1,_0x4962('0x19'))[_0x4962('0x1a')]('YYYY-MM-DD');}}if(_0x183419[_0x4962('0x1b')]){_0x52978d=_0x183419['castTo'];_0xff5e41[_0x4962('0x1c')]='CAST('+_0x50d819+'.'+_0x183419[_0x4962('0x1d')]+'\x20AS\x20'+_0x183419['castTo']+')\x20'+parseOperator(_0x183419[_0x4962('0x13')]);}else{_0xff5e41['text']=_0x50d819+'.'+_0x183419['field']+'\x20'+parseOperator(_0x183419[_0x4962('0x13')]);}if(_['includes']([_0x4962('0x1e'),_0x4962('0x1f')],_0x183419[_0x4962('0x13')]))_0xff5e41['text']='('+_0xff5e41[_0x4962('0x1c')]+_0x4962('0x20')+_0x50d819+'.'+_0x183419[_0x4962('0x1d')]+'\x20IS\x20NULL)';_0xff5e41[_0x4962('0x15')]=parseValue(_0x52978d,_0x183419[_0x4962('0x13')],_0x183419[_0x4962('0x15')]);return _0xff5e41;};function parseOperator(_0x3c003a){var _0x4505b1;switch(_0x3c003a){case _0x4962('0x21'):_0x4505b1=_0x4962('0x22');break;case'$notIn':_0x4505b1='NOT\x20IN\x20?';break;case _0x4962('0x14'):_0x4505b1='=\x20?';break;case _0x4962('0x1e'):_0x4505b1=_0x4962('0x23');break;case _0x4962('0x24'):case _0x4962('0x25'):case _0x4962('0x26'):_0x4505b1=_0x4962('0x27');break;case _0x4962('0x28'):_0x4505b1=_0x4962('0x29');break;case'$gt':_0x4505b1=_0x4962('0x2a');break;case _0x4962('0x2b'):_0x4505b1=_0x4962('0x2c');break;case _0x4962('0x2d'):_0x4505b1=_0x4962('0x2e');break;case _0x4962('0x2f'):_0x4505b1=_0x4962('0x30');break;}return _0x4505b1;}function parseValue(_0x1b0c1b,_0x1bb189,_0x2a6874){var _0x3a6818={'start':undefined,'end':undefined};switch(_0x1bb189){case _0x4962('0x21'):case _0x4962('0x1f'):_0x3a6818[_0x4962('0x31')]=_0x2a6874[_0x4962('0x8')](',');break;case _0x4962('0x24'):_0x3a6818['start']='%'+_0x2a6874+'%';break;case _0x4962('0x25'):_0x3a6818[_0x4962('0x31')]=_0x2a6874+'%';break;case'$endsWith':_0x3a6818['start']='%'+_0x2a6874;break;case _0x4962('0x2f'):var _0x2f22f7=_0x2a6874[_0x4962('0x8')](',');var _0x2a6874=_0x2f22f7['shift']();var _0x3b6be6=_0x2f22f7[_0x4962('0x32')]();if(_0x1b0c1b===_0x4962('0x12')){_0x2a6874=moment(_0x2a6874)[_0x4962('0x33')](0x0,!![])['format']();_0x3b6be6=moment(_0x3b6be6)['utcOffset'](0x0,!![])[_0x4962('0x18')](0x17,_0x4962('0x34'))[_0x4962('0x18')](0x3b,_0x4962('0x35'))[_0x4962('0x18')](0x3b,_0x4962('0x36'))[_0x4962('0x1a')]();}_0x3a6818={'start':_0x2a6874,'end':_0x3b6be6};break;default:_0x3a6818['start']=_0x2a6874;break;}return _0x3a6818;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 886bcf9..6e35a40 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 _0x370d=['\x22{EXPR}\x22','forEach','replace','{EXPR}','query','intersection','attributes','limit','order','where','filter','object','columns','merge','VIRTUAL','lower','options','includeAll','push','include','lodash','moment','parse','keys','includes','model','alias','fields','raw','split','filters','forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','col','unsigned','DESC','ASC','isEmpty','length','omit','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue'];(function(_0x3e673c,_0x51cc25){var _0xbdf4f5=function(_0x21f198){while(--_0x21f198){_0x3e673c['push'](_0x3e673c['shift']());}};_0xbdf4f5(++_0x51cc25);}(_0x370d,0x194));var _0xd370=function(_0x41e4a2,_0x53b345){_0x41e4a2=_0x41e4a2-0x0;var _0x3f7e5e=_0x370d[_0x41e4a2];return _0x3f7e5e;};'use strict';var _=require(_0xd370('0x0'));var sequelize=require('sequelize');var moment=require(_0xd370('0x1'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x293167){var _0x27928b=['ne'];try{var _0xb556a3=JSON[_0xd370('0x2')](_0x293167);var _0x1af247=Object[_0xd370('0x3')](_0xb556a3)[0x0];return _0x27928b[_0xd370('0x4')](_0x1af247);}catch(_0x34e8f0){return![];}}function getOperatorValue(_0xe2940d){var _0x516e57=JSON[_0xd370('0x2')](_0xe2940d);var _0x1f748d=Object['keys'](_0x516e57)[0x0];var _0x3b7eb0=_0x516e57[_0x1f748d];return{['$'+_0x1f748d]:_0x3b7eb0};}function parseIncludeModel(_0x4d2b15){var _0x3e9235=JSON[_0xd370('0x2')](_0x4d2b15);return{'model':db[_0x3e9235[_0xd370('0x5')]],'as':_0x3e9235[_0xd370('0x6')],'attributes':_0x3e9235[_0xd370('0x7')],'raw':_0x3e9235[_0xd370('0x8')]};}exports[_0xd370('0x7')]=function(_0x5f49be){var _0x24fc2c=null;if(_0x5f49be){_0x24fc2c=_0x5f49be[_0xd370('0x9')](',');}return _0x24fc2c;};exports[_0xd370('0xa')]=function(_0xabc330,_0x1007b4){var _0x271404={};if(!_['isEmpty'](_0xabc330)){_[_0xd370('0xb')](_0xabc330,function(_0x15ec10,_0x34860f){try{if(_0x1007b4){var _0x2c0daf=_[_0xd370('0xc')](_0x1007b4,{'name':_0x34860f})||{};if(hasSequelizeOperator(_0x15ec10)){_0x271404[_0x34860f]=getOperatorValue(_0x15ec10);}else if(_0x2c0daf['type']===_0xd370('0xd')&&_[_0xd370('0xe')](_0x15ec10)){var _0x18f9ff=JSON[_0xd370('0x2')](_0x15ec10);var _0x549356={'$gte':moment(moment(_0x18f9ff[_0xd370('0xf')])[_0xd370('0x10')](_0xd370('0x11')))[_0xd370('0x12')]()[_0xd370('0x10')](),'$lte':moment(moment(_0x18f9ff[_0xd370('0x13')])['format'](_0xd370('0x11')))['utc']()[_0xd370('0x14')](0x1,'s')[_0xd370('0x10')]()};_0x271404[_0x34860f]=_0x549356;}else if(_0x2c0daf[_0xd370('0x15')]===_0xd370('0x16')){_0x271404[_0x34860f]=_0x15ec10;}else{_0x271404[_0x34860f]=_[_0xd370('0x17')](_0x15ec10)?_0x15ec10:JSON[_0xd370('0x2')](_0x15ec10);}}else{_0x271404[_0x34860f]=_[_0xd370('0x17')](_0x15ec10)?_0x15ec10:JSON[_0xd370('0x2')](_0x15ec10);}}catch(_0x44670e){_0x271404[_0x34860f]=_0x15ec10[_0xd370('0x9')](',');}});}return _0x271404;};exports['limit']=function(_0x19c6e5){_0x19c6e5=parseInt(_0x19c6e5,0xa);if(!_0x19c6e5||_0x19c6e5<0x0){_0x19c6e5=LIMIT_VALUE;}return _0x19c6e5;};exports[_0xd370('0x18')]=function(_0x40e494){_0x40e494=parseInt(_0x40e494,0xa);if(!_0x40e494||_0x40e494<0x0){_0x40e494=0x0;}return _0x40e494;};exports[_0xd370('0x19')]=function(_0x450e28){var _0x44464e,_0x251436=null;if(_0x450e28){_0x44464e=_0x450e28[_0xd370('0x9')](',');_0x251436=_[_0xd370('0x1a')](_0x44464e,function(_0x26b594){if(_0x26b594[_0xd370('0x1b')]('-')===0x0){return[_0x26b594===_0xd370('0x1c')?sequelize['cast'](sequelize[_0xd370('0x1d')]('priority'),_0xd370('0x1e')):_0x26b594['substr'](0x1),_0xd370('0x1f')];}else{return[_0x26b594===_0xd370('0x1c')?sequelize['cast'](sequelize[_0xd370('0x1d')]('priority'),_0xd370('0x1e')):_0x26b594,_0xd370('0x20')];}});}return _0x251436;};exports['omit']=function(_0x525b8f,_0x4cee28){if(_[_0xd370('0x21')](_0x525b8f)){return _0x525b8f;}if(_[_0xd370('0x17')](_0x525b8f)){for(var _0x5d6b4d=0x0;_0x5d6b4d<_0x525b8f[_0xd370('0x22')];_0x5d6b4d+=0x1){_0x525b8f[_0x5d6b4d]=this[_0xd370('0x23')](_0x525b8f[_0x5d6b4d],_0x4cee28);}return _0x525b8f;}if(!_[_0xd370('0x24')](_0x525b8f)){return _0x525b8f;}if(_[_0xd370('0x25')](_0x4cee28)){_0x4cee28=[_0x4cee28];}if(!_['isArray'](_0x4cee28)){return _0x525b8f;}for(var _0x547851=0x0;_0x547851<_0x4cee28[_0xd370('0x22')];_0x547851+=0x1){_[_0xd370('0x26')](_0x525b8f,_0x4cee28[_0x547851]);}for(var _0x5d58a1 in _0x525b8f){if(_0x525b8f['hasOwnProperty'](_0x5d58a1)){_0x525b8f[_0x5d58a1]=this[_0xd370('0x23')](_0x525b8f[_0x5d58a1],_0x4cee28);}}return _0x525b8f;};exports[_0xd370('0x27')]=function(_0x2823fb){return _0x2823fb[_0xd370('0x28')](RegExp(_0xd370('0x29')))?!![]:![];};exports[_0xd370('0x2a')]=function(_0x4f86bf){return _0x4f86bf['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xd370('0x2b')]=function(_0x173a39,_0x4a7371){var _0x1f4091=[];var _0x374a38=/[ `!@#$%^&*()_\-?~]/;var _0x5aaf4d=_0x4a7371?_0xd370('0x2c'):'{EXPR}';_0x173a39[_0xd370('0x9')](/[ ,]+/)[_0xd370('0x2d')](function(_0x56e4e4){_0x56e4e4=_0x56e4e4[_0xd370('0x2e')](/([^:]")"+/g,'$1');_0x56e4e4='+'+_0x56e4e4+'*';var _0x41c909=_0x56e4e4[_0xd370('0x28')](_0x374a38);if(_0x41c909){_0x56e4e4='\x22'+_0x56e4e4+'\x22';}_0x1f4091['push'](_0x56e4e4);});_0x5aaf4d=_0x5aaf4d[_0xd370('0x2e')](_0xd370('0x2f'),_0x1f4091['join']('\x20'));return _0x5aaf4d;};exports['getOptions']=function(_0x2cf49b,_0x5a1750,_0x28c67a){var _0x3e7cf5={},_0x567a26={};if(_0x5a1750[_0xd370('0x30')]['$id']){_0x5a1750['query']['id']=_0x5a1750[_0xd370('0x30')]['$id'];delete _0x5a1750['query']['$id'];}_0x3e7cf5['model']=_[_0xd370('0x1a')](_0x2cf49b,'name');_0x3e7cf5[_0xd370('0x30')]=_[_0xd370('0x3')](_0x5a1750[_0xd370('0x30')]);_0x3e7cf5['filters']=_[_0xd370('0x31')](_0x3e7cf5[_0xd370('0x5')],_0x3e7cf5['query']);_0x567a26[_0xd370('0x32')]=_[_0xd370('0x31')](_0x3e7cf5['model'],this[_0xd370('0x7')](_0x5a1750[_0xd370('0x30')]['fields']));_0x567a26[_0xd370('0x32')]=_0x567a26['attributes'][_0xd370('0x22')]?_0x567a26[_0xd370('0x32')]:_0x3e7cf5[_0xd370('0x5')];if(!_0x5a1750['query']['hasOwnProperty']('nolimit')){_0x567a26[_0xd370('0x33')]=this['limit'](_0x5a1750['query'][_0xd370('0x33')]);_0x567a26[_0xd370('0x18')]=this[_0xd370('0x18')](_0x5a1750[_0xd370('0x30')][_0xd370('0x18')]);}_0x567a26[_0xd370('0x34')]=this[_0xd370('0x19')](_0x5a1750[_0xd370('0x30')]['sort']);_0x567a26[_0xd370('0x35')]=this['filters'](_['pick'](_0x5a1750[_0xd370('0x30')],_0x3e7cf5[_0xd370('0xa')]),_0x2cf49b);if(_0x5a1750[_0xd370('0x30')][_0xd370('0x36')]){var _0x2182a0=_0x2cf49b;var _0x309940=_0x5a1750[_0xd370('0x30')]['filter'];if(typeof _0x309940===_0xd370('0x37')){_0x2182a0=_['filter'](_0x2cf49b,function(_0x37e176){return _['includes'](_0x309940[_0xd370('0x38')],_0x37e176[_0xd370('0x15')]);});_0x309940=_0x309940['value'];}_0x567a26[_0xd370('0x35')]=_[_0xd370('0x39')](_0x567a26[_0xd370('0x35')],{'$or':_['map'](_0x2182a0,function(_0x3a255e){if(_0x3a255e['type']!==_0xd370('0x3a')){if(_0x28c67a){return sequelize[_0xd370('0x35')](sequelize['fn'](_0xd370('0x3b'),sequelize[_0xd370('0x1d')](_0x3a255e[_0xd370('0x15')])),{'$like':sequelize['fn'](_0xd370('0x3b'),'%'+_0x5a1750[_0xd370('0x30')]['filter']+'%')});}else{var _0xa1a55d={};_0xa1a55d[_0x3a255e[_0xd370('0x15')]]={'$like':'%'+_0x5a1750[_0xd370('0x30')][_0xd370('0x36')]+'%'};return _0xa1a55d;}}})});}_0x567a26=_['merge']({},_0x567a26,_0x5a1750[_0xd370('0x3c')]);return _0x567a26;};exports['include']=function(_0x5be001){var _0x18ec03=[];if(_0x5be001[_0xd370('0x3d')]){_0x18ec03[_0xd370('0x3e')]({'all':!![]});}else if(_0x5be001[_0xd370('0x3f')]){if(Array[_0xd370('0x17')](_0x5be001[_0xd370('0x3f')])){_0x18ec03=Object[_0xd370('0x3')](_0x5be001[_0xd370('0x3f')])[_0xd370('0x1a')](function(_0x5c95ce){return parseIncludeModel(_0x5be001[_0xd370('0x3f')][_0x5c95ce]);});}else{var _0x5c01f1=parseIncludeModel(_0x5be001['include']);_0x18ec03['push'](_0x5c01f1);}}return _0x18ec03;}; \ No newline at end of file +var _0xee87=['alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','priority','cast','col','unsigned','DESC','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','push','replace','{EXPR}','join','getOptions','$id','query','intersection','attributes','nolimit','order','pick','filter','columns','value','where','merge','VIRTUAL','lower','options','include','includeAll','sequelize','parse','keys','includes','model'];(function(_0x3c7936,_0x4bf3ec){var _0x56df6c=function(_0x18a2cf){while(--_0x18a2cf){_0x3c7936['push'](_0x3c7936['shift']());}};_0x56df6c(++_0x4bf3ec);}(_0xee87,0x193));var _0x7ee8=function(_0x170e52,_0x5d80e3){_0x170e52=_0x170e52-0x0;var _0x3a53e6=_0xee87[_0x170e52];return _0x3a53e6;};'use strict';var _=require('lodash');var sequelize=require(_0x7ee8('0x0'));var moment=require('moment');var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4d7a1d){var _0x116675=['ne'];try{var _0xe4d376=JSON[_0x7ee8('0x1')](_0x4d7a1d);var _0x5b5055=Object[_0x7ee8('0x2')](_0xe4d376)[0x0];return _0x116675[_0x7ee8('0x3')](_0x5b5055);}catch(_0x5b530b){return![];}}function getOperatorValue(_0x34ee4a){var _0x1d0fe6=JSON[_0x7ee8('0x1')](_0x34ee4a);var _0x3ac05f=Object[_0x7ee8('0x2')](_0x1d0fe6)[0x0];var _0x346771=_0x1d0fe6[_0x3ac05f];return{['$'+_0x3ac05f]:_0x346771};}function parseIncludeModel(_0x2d26bd){var _0x294e37=JSON[_0x7ee8('0x1')](_0x2d26bd);return{'model':db[_0x294e37[_0x7ee8('0x4')]],'as':_0x294e37[_0x7ee8('0x5')],'attributes':_0x294e37[_0x7ee8('0x6')],'raw':_0x294e37[_0x7ee8('0x7')]};}exports['fields']=function(_0x967f9a){var _0x283388=null;if(_0x967f9a){_0x283388=_0x967f9a[_0x7ee8('0x8')](',');}return _0x283388;};exports[_0x7ee8('0x9')]=function(_0x5cf98b,_0xa91c36){var _0xcc032={};if(!_[_0x7ee8('0xa')](_0x5cf98b)){_[_0x7ee8('0xb')](_0x5cf98b,function(_0x14a856,_0x211685){try{if(_0xa91c36){var _0x3971ff=_[_0x7ee8('0xc')](_0xa91c36,{'name':_0x211685})||{};if(hasSequelizeOperator(_0x14a856)){_0xcc032[_0x211685]=getOperatorValue(_0x14a856);}else if(_0x3971ff[_0x7ee8('0xd')]===_0x7ee8('0xe')&&_[_0x7ee8('0xf')](_0x14a856)){var _0x3cb9eb=JSON[_0x7ee8('0x1')](_0x14a856);var _0x3ff469={'$gte':moment(moment(_0x3cb9eb[_0x7ee8('0x10')])[_0x7ee8('0x11')](_0x7ee8('0x12')))[_0x7ee8('0x13')]()[_0x7ee8('0x11')](),'$lte':moment(moment(_0x3cb9eb[_0x7ee8('0x14')])['format'](_0x7ee8('0x12')))[_0x7ee8('0x13')]()[_0x7ee8('0x15')](0x1,'s')[_0x7ee8('0x11')]()};_0xcc032[_0x211685]=_0x3ff469;}else if(_0x3971ff[_0x7ee8('0x16')]===_0x7ee8('0x17')){_0xcc032[_0x211685]=_0x14a856;}else{_0xcc032[_0x211685]=_[_0x7ee8('0x18')](_0x14a856)?_0x14a856:JSON['parse'](_0x14a856);}}else{_0xcc032[_0x211685]=_[_0x7ee8('0x18')](_0x14a856)?_0x14a856:JSON['parse'](_0x14a856);}}catch(_0x25250e){_0xcc032[_0x211685]=_0x14a856['split'](',');}});}return _0xcc032;};exports[_0x7ee8('0x19')]=function(_0x1e3f04){_0x1e3f04=parseInt(_0x1e3f04,0xa);if(!_0x1e3f04||_0x1e3f04<0x0){_0x1e3f04=LIMIT_VALUE;}return _0x1e3f04;};exports[_0x7ee8('0x1a')]=function(_0x9bcec7){_0x9bcec7=parseInt(_0x9bcec7,0xa);if(!_0x9bcec7||_0x9bcec7<0x0){_0x9bcec7=0x0;}return _0x9bcec7;};exports[_0x7ee8('0x1b')]=function(_0x2b8272){var _0x39c836,_0x13c3a7=null;if(_0x2b8272){_0x39c836=_0x2b8272[_0x7ee8('0x8')](',');_0x13c3a7=_[_0x7ee8('0x1c')](_0x39c836,function(_0x161d25){if(_0x161d25['indexOf']('-')===0x0){return[_0x161d25===_0x7ee8('0x1d')?sequelize[_0x7ee8('0x1e')](sequelize[_0x7ee8('0x1f')](_0x7ee8('0x1d')),_0x7ee8('0x20')):_0x161d25['substr'](0x1),_0x7ee8('0x21')];}else{return[_0x161d25===_0x7ee8('0x1d')?sequelize[_0x7ee8('0x1e')](sequelize[_0x7ee8('0x1f')](_0x7ee8('0x1d')),_0x7ee8('0x20')):_0x161d25,'ASC'];}});}return _0x13c3a7;};exports[_0x7ee8('0x22')]=function(_0x57cf44,_0x2234d2){if(_[_0x7ee8('0xa')](_0x57cf44)){return _0x57cf44;}if(_[_0x7ee8('0x18')](_0x57cf44)){for(var _0xb24832=0x0;_0xb24832<_0x57cf44['length'];_0xb24832+=0x1){_0x57cf44[_0xb24832]=this[_0x7ee8('0x22')](_0x57cf44[_0xb24832],_0x2234d2);}return _0x57cf44;}if(!_[_0x7ee8('0x23')](_0x57cf44)){return _0x57cf44;}if(_[_0x7ee8('0x24')](_0x2234d2)){_0x2234d2=[_0x2234d2];}if(!_[_0x7ee8('0x18')](_0x2234d2)){return _0x57cf44;}for(var _0x4a5e5c=0x0;_0x4a5e5c<_0x2234d2[_0x7ee8('0x25')];_0x4a5e5c+=0x1){_[_0x7ee8('0x26')](_0x57cf44,_0x2234d2[_0x4a5e5c]);}for(var _0x53c97e in _0x57cf44){if(_0x57cf44[_0x7ee8('0x27')](_0x53c97e)){_0x57cf44[_0x53c97e]=this['omit'](_0x57cf44[_0x53c97e],_0x2234d2);}}return _0x57cf44;};exports[_0x7ee8('0x28')]=function(_0x2b67ba){return _0x2b67ba[_0x7ee8('0x29')](RegExp(_0x7ee8('0x2a')))?!![]:![];};exports[_0x7ee8('0x2b')]=function(_0x58a033){return _0x58a033['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7ee8('0x2c')]=function(_0x39b22a,_0x437e49){var _0x540dcf=[];var _0x30c78d=/[ `!@#$%^&*()_\-?~]/;var _0x43f698=_0x437e49?_0x7ee8('0x2d'):'{EXPR}';_0x39b22a['split'](/[ ,]+/)['forEach'](function(_0x2a2540){_0x2a2540=_0x2a2540['replace'](/([^:]")"+/g,'$1');_0x2a2540='+'+_0x2a2540+'*';var _0x5f4f6c=_0x2a2540[_0x7ee8('0x29')](_0x30c78d);if(_0x5f4f6c){_0x2a2540='\x22'+_0x2a2540+'\x22';}_0x540dcf[_0x7ee8('0x2e')](_0x2a2540);});_0x43f698=_0x43f698[_0x7ee8('0x2f')](_0x7ee8('0x30'),_0x540dcf[_0x7ee8('0x31')]('\x20'));return _0x43f698;};exports[_0x7ee8('0x32')]=function(_0x2906a7,_0x4a0aa3,_0x19a8c5){var _0x36e6d0={},_0x394b12={};if(_0x4a0aa3['query'][_0x7ee8('0x33')]){_0x4a0aa3[_0x7ee8('0x34')]['id']=_0x4a0aa3[_0x7ee8('0x34')][_0x7ee8('0x33')];delete _0x4a0aa3[_0x7ee8('0x34')][_0x7ee8('0x33')];}_0x36e6d0['model']=_['map'](_0x2906a7,'name');_0x36e6d0[_0x7ee8('0x34')]=_[_0x7ee8('0x2')](_0x4a0aa3[_0x7ee8('0x34')]);_0x36e6d0[_0x7ee8('0x9')]=_[_0x7ee8('0x35')](_0x36e6d0[_0x7ee8('0x4')],_0x36e6d0[_0x7ee8('0x34')]);_0x394b12[_0x7ee8('0x36')]=_[_0x7ee8('0x35')](_0x36e6d0['model'],this[_0x7ee8('0x6')](_0x4a0aa3[_0x7ee8('0x34')][_0x7ee8('0x6')]));_0x394b12[_0x7ee8('0x36')]=_0x394b12[_0x7ee8('0x36')][_0x7ee8('0x25')]?_0x394b12[_0x7ee8('0x36')]:_0x36e6d0[_0x7ee8('0x4')];if(!_0x4a0aa3[_0x7ee8('0x34')]['hasOwnProperty'](_0x7ee8('0x37'))){_0x394b12[_0x7ee8('0x19')]=this[_0x7ee8('0x19')](_0x4a0aa3[_0x7ee8('0x34')][_0x7ee8('0x19')]);_0x394b12[_0x7ee8('0x1a')]=this['offset'](_0x4a0aa3[_0x7ee8('0x34')]['offset']);}_0x394b12[_0x7ee8('0x38')]=this[_0x7ee8('0x1b')](_0x4a0aa3[_0x7ee8('0x34')]['sort']);_0x394b12['where']=this[_0x7ee8('0x9')](_[_0x7ee8('0x39')](_0x4a0aa3[_0x7ee8('0x34')],_0x36e6d0[_0x7ee8('0x9')]),_0x2906a7);if(_0x4a0aa3[_0x7ee8('0x34')][_0x7ee8('0x3a')]){var _0x16b91f=_0x2906a7;var _0x128ad6=_0x4a0aa3['query'][_0x7ee8('0x3a')];if(typeof _0x128ad6==='object'){_0x16b91f=_['filter'](_0x2906a7,function(_0x483f13){return _[_0x7ee8('0x3')](_0x128ad6[_0x7ee8('0x3b')],_0x483f13[_0x7ee8('0x16')]);});_0x128ad6=_0x128ad6[_0x7ee8('0x3c')];}_0x394b12[_0x7ee8('0x3d')]=_[_0x7ee8('0x3e')](_0x394b12[_0x7ee8('0x3d')],{'$or':_['map'](_0x16b91f,function(_0x2abaf4){if(_0x2abaf4[_0x7ee8('0xd')]!==_0x7ee8('0x3f')){if(_0x19a8c5){return sequelize[_0x7ee8('0x3d')](sequelize['fn'](_0x7ee8('0x40'),sequelize['col'](_0x2abaf4[_0x7ee8('0x16')])),{'$like':sequelize['fn'](_0x7ee8('0x40'),'%'+_0x4a0aa3[_0x7ee8('0x34')][_0x7ee8('0x3a')]+'%')});}else{var _0x2da8b7={};_0x2da8b7[_0x2abaf4[_0x7ee8('0x16')]]={'$like':'%'+_0x4a0aa3[_0x7ee8('0x34')]['filter']+'%'};return _0x2da8b7;}}})});}_0x394b12=_[_0x7ee8('0x3e')]({},_0x394b12,_0x4a0aa3[_0x7ee8('0x41')]);return _0x394b12;};exports[_0x7ee8('0x42')]=function(_0x473cd4){var _0x3b2f4e=[];if(_0x473cd4[_0x7ee8('0x43')]){_0x3b2f4e[_0x7ee8('0x2e')]({'all':!![]});}else if(_0x473cd4[_0x7ee8('0x42')]){if(Array['isArray'](_0x473cd4[_0x7ee8('0x42')])){_0x3b2f4e=Object[_0x7ee8('0x2')](_0x473cd4[_0x7ee8('0x42')])['map'](function(_0x224df8){return parseIncludeModel(_0x473cd4['include'][_0x224df8]);});}else{var _0x4d6b40=parseIncludeModel(_0x473cd4[_0x7ee8('0x42')]);_0x3b2f4e[_0x7ee8('0x2e')](_0x4d6b40);}}return _0x3b2f4e;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index e25a4c0..790fd44 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 _0xe14b=['fullname','internal','indexOf','validateSortParameter','sort','DESC','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','role','whatsappStatus','whatsappStatusTime','mailCapacity','openchannelCapacity','whatsappCurrentCapacity','phoneBarEnableScreenRecordingByAgent','onhold','screenrecording','getRealtimeAgentsQueryFields','lodash','jayson/promise','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','length','unavailable','ringing','voiceStatus','idle','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','Agents','then','error','result','request','merge','catch','getRealtimeAgents','unknown','*pause','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','uniq','value','getAgentIdsByQueues','filter','includes','busy','getAgentIdsByStatus','resolve','name','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','ASC','getUpdatedSortOptions','fullname,internal'];(function(_0x55e12c,_0x35436c){var _0x4c1945=function(_0x4e0d2f){while(--_0x4e0d2f){_0x55e12c['push'](_0x55e12c['shift']());}};_0x4c1945(++_0x35436c);}(_0xe14b,0x93));var _0xbe14=function(_0x17d3dc,_0x32be86){_0x17d3dc=_0x17d3dc-0x0;var _0x4a8d1b=_0xe14b[_0x17d3dc];return _0x4a8d1b;};'use strict';var _=require(_0xbe14('0x0'));var jayson=require(_0xbe14('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0xbe14('0x2')]({'port':0x232a});var routingClient=jayson[_0xbe14('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x7d3665,_0x5ce8fb){var _0x496c04=[_0x7d3665[_0xbe14('0x4')],_0x7d3665[_0xbe14('0x5')],_0x7d3665[_0xbe14('0x6')],_0x7d3665[_0xbe14('0x7')],_0x7d3665[_0xbe14('0x8')],_0x7d3665[_0xbe14('0x9')],_0x7d3665[_0xbe14('0xa')]];if(!_0x5ce8fb)return _['every'](_0x496c04);var _0x50f909=_['filter'](_0x496c04);return _0x50f909[_0xbe14('0xb')]>0x0&&_0x50f909[_0xbe14('0xb')]<_0x496c04[_0xbe14('0xb')]?!![]:![];}function isIdle(_0x90b4f){return _0x90b4f==='idle'||_0x90b4f==='unknown'||_0x90b4f===_0xbe14('0xc')||_0x90b4f===_0xbe14('0xd')||_['isNil'](_0x90b4f);}function isAgentIdle(_0x254c3b){if(_0x254c3b[_0xbe14('0xe')]!==_0xbe14('0xf')&&_0x254c3b[_0xbe14('0x9')]){_0x254c3b[_0xbe14('0xe')]=_0xbe14('0x10');return![];}return _[_0xbe14('0x11')]([_0x254c3b[_0xbe14('0x12')],_0x254c3b[_0xbe14('0x13')],_0x254c3b[_0xbe14('0x14')],_0x254c3b[_0xbe14('0x15')],_0x254c3b[_0xbe14('0x16')],_0x254c3b[_0xbe14('0xe')],_0x254c3b['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xbe14('0x17'),{})[_0xbe14('0x18')](function(_0xf4ac9){if(_0xf4ac9[_0xbe14('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x21c789=_0xf4ac9[_0xbe14('0x1a')];return routingClient[_0xbe14('0x1b')](_0xbe14('0x17'),{})[_0xbe14('0x18')](function(_0x29ab73){if(_0x29ab73[_0xbe14('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x137ee5=_0x29ab73[_0xbe14('0x1a')];return _[_0xbe14('0x1c')]({},_0x21c789,_0x137ee5);});})[_0xbe14('0x1d')](function(_0x3249da){throw _0x3249da;});}exports[_0xbe14('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x59a9e3){var _0x24f820=_0xbe14('0x1f');if(isAgentPaused(_0x59a9e3))_0x24f820=_0xbe14('0x10');else if(isAgentPaused(_0x59a9e3,!![]))_0x24f820=_0xbe14('0x20');else if(isAgentIdle(_0x59a9e3))_0x24f820=_0xbe14('0xf');else _0x24f820='busy';return _0x24f820;}exports[_0xbe14('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x56d845,_0x3c1c85){var _0x56e80c=_[_0xbe14('0x22')](_0x56d845)?_0x56d845:[_0x56d845];var _0x4a25fa=_[_0xbe14('0x23')](_0x3c1c85)+_0xbe14('0x24');var _0x505dbd=_[_0xbe14('0x25')](_0x56e80c,function(_0x4d4190){return db[_0x4a25fa][_0xbe14('0x26')]({'where':{'id':_0x4d4190}})['then'](function(_0x36a21e){if(!_0x36a21e)return[];return _0x36a21e[_0xbe14('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xbe14('0x28')](_0x505dbd)[_0xbe14('0x18')](function(_0x15ef02){var _0x2703f5=_(_0x15ef02)['flatten']()[_0xbe14('0x25')]('id')[_0xbe14('0x29')]()[_0xbe14('0x2a')]();return _0x2703f5;});}exports[_0xbe14('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5dd475,_0x16f884,_0x29fc64){try{if(_0x16f884['length']>0x0){_0x5dd475=_0x5dd475[_0xbe14('0x2c')](function(_0x3b3e84){return _0x16f884[_0xbe14('0x2d')](_0x3b3e84['id']);});}var _0x19252f=_0x5dd475[_0xbe14('0x2c')](function(_0x36d4b2){var _0x31a664=_0xbe14('0x2e');if(isAgentIdle(_0x36d4b2)){_0x31a664=_0xbe14('0xf');}return _0x31a664===_0x29fc64;});return _[_0xbe14('0x25')](_0x19252f,'id');}catch(_0x40538f){throw _0x40538f;}}exports[_0xbe14('0x2f')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x39dc0a,_0x10ae36,_0x223f7a){return Promise[_0xbe14('0x30')]()[_0xbe14('0x18')](function(){if(_0x10ae36[_0xbe14('0xb')]>0x0){_0x39dc0a=_0x39dc0a[_0xbe14('0x2c')](function(_0x14e7c4){return _0x10ae36['includes'](_0x14e7c4['id']);});}return _0x39dc0a;})[_0xbe14('0x18')](function(){return db['User']['findAll']({'attributes':['id',_0xbe14('0x31'),'fullname',_0xbe14('0x4'),_0xbe14('0x5'),'mailPause','openchannelPause','smsPause',_0xbe14('0x9'),_0xbe14('0xa'),'pauseType'],'where':{'id':{'$in':_[_0xbe14('0x25')](_0x39dc0a,'id')}},'raw':!![]});})[_0xbe14('0x18')](function(_0x452635){return _0x452635[_0xbe14('0x25')](function(_0x29c23e){var _0x5ef1e5=_['find'](_0x39dc0a,['id',_0x29c23e['id']]);var _0x15a997=filterAgentAttributes(_0x5ef1e5);_['merge'](_0x29c23e,_0x15a997);_0x29c23e['globalStatus']=getAgentStatus(_0x29c23e);return _0x29c23e;});})['then'](function(_0x163ef7){var _0x393f6b=sortAgentsByStatus(_0x163ef7,_0x223f7a);return _[_0xbe14('0x25')](_0x393f6b,'id');})[_0xbe14('0x1d')](function(_0x172e79){throw _0x172e79;});}exports[_0xbe14('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xcdc50){var _0x10ec3c={'fields':[],'order':null};var _0x2d9c12=_0xcdc50[_0xbe14('0x33')](',');_0x10ec3c[_0xbe14('0x34')]=_[_0xbe14('0x2c')](_0x2d9c12,function(_0x539c41){if(!_0x539c41['includes'](_0xbe14('0x35'))){return!![];}_0x10ec3c[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x539c41,'-')?'DESC':_0xbe14('0x38');return![];});return _0x10ec3c;}exports[_0xbe14('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0xeda70e){if(!_0xeda70e){_0xeda70e=_0xbe14('0x3a');}if(_0xeda70e[_0xbe14('0x2d')](_0xbe14('0x3b'))&&!_0xeda70e[_0xbe14('0x2d')](_0xbe14('0x3c'))){var _0x1b2608=_0xeda70e['substring'](0x0,_0xeda70e[_0xbe14('0x3d')](_0xbe14('0x3b')));_0xeda70e+=','+_0x1b2608+_0xbe14('0x3c');}return _0xeda70e;}exports[_0xbe14('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x3287b9,_0x2dd3e3){var _0x548d17=_0x3287b9[_0xbe14('0x3f')](function(_0x1974a4,_0x1220c9){if(_0x1974a4[_0xbe14('0x35')]===_0x1220c9['globalStatus']){if(_0x1974a4['globalStatus']===_0xbe14('0x10')){if(_0x2dd3e3===_0xbe14('0x40')){return(_0x1974a4[_0xbe14('0x41')]||'')<(_0x1220c9['pauseType']||'')||_0x1974a4['fullname'][_0xbe14('0x42')]()>_0x1220c9['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x1974a4[_0xbe14('0x41')]||'')<(_0x1220c9[_0xbe14('0x41')]||'')||_0x1974a4[_0xbe14('0x3b')]['toLowerCase']()>_0x1220c9['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x2dd3e3===_0xbe14('0x40')){return _0x1974a4[_0xbe14('0x3b')][_0xbe14('0x42')]()<_0x1220c9['fullname'][_0xbe14('0x42')]()?0x1:-0x1;}else{return _0x1974a4[_0xbe14('0x3b')][_0xbe14('0x42')]()<_0x1220c9[_0xbe14('0x3b')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x2dd3e3==='DESC'){return _0x1974a4[_0xbe14('0x35')]<_0x1220c9[_0xbe14('0x35')]?0x1:-0x1;}else{return _0x1974a4[_0xbe14('0x35')]<_0x1220c9[_0xbe14('0x35')]?-0x1:0x1;}}});return _0x548d17;}exports[_0xbe14('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x4f2d95){var _0x51023a=[_0xbe14('0x44'),_0xbe14('0x45'),_0xbe14('0x46'),_0xbe14('0x47'),'pauseType',_0xbe14('0x47'),_0xbe14('0x3c'),'address',_0xbe14('0x4'),_0xbe14('0x7'),_0xbe14('0x6'),_0xbe14('0x8'),'whatsappPause','faxPause',_0xbe14('0x9'),_0xbe14('0x48'),'openchannelCapacity','mailCapacity',_0xbe14('0x49'),_0xbe14('0x4a'),_0xbe14('0x4b'),_0xbe14('0x4c'),_0xbe14('0x4d'),_0xbe14('0x4e'),_0xbe14('0x4f'),'whatsappCurrentCapacity',_0xbe14('0x50'),_0xbe14('0x12'),_0xbe14('0x15'),_0xbe14('0x14'),_0xbe14('0x16'),'whatsappStatus',_0xbe14('0x13'),_0xbe14('0xe'),_0xbe14('0x51'),_0xbe14('0x52'),_0xbe14('0x53'),_0xbe14('0x54'),'whatsappStatusTime','faxStatusTime',_0xbe14('0x55'),_0xbe14('0x56'),_0xbe14('0x57'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0xbe14('0x58'),_0xbe14('0x59')];var _0x50d78f=[_0xbe14('0x4'),_0xbe14('0x7'),'mailPause',_0xbe14('0x8'),'whatsappPause',_0xbe14('0x5'),_0xbe14('0x9'),_0xbe14('0x45')];var _0x550291=_(_0x4f2d95)[_0xbe14('0x5a')](_0x50d78f)[_0xbe14('0x5b')](_0x51023a)['value']();return _0x550291;}exports[_0xbe14('0x5c')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xbe14('0x31'),_0xbe14('0x3b'),_0xbe14('0x5d'),_0xbe14('0x3c'),'online',_0xbe14('0x35'),_0xbe14('0x44'),_0xbe14('0x46'),_0xbe14('0x41'),_0xbe14('0x47'),_0xbe14('0x5'),_0xbe14('0x4'),'mailPause',_0xbe14('0x7'),_0xbe14('0x8'),_0xbe14('0x9'),_0xbe14('0xa'),_0xbe14('0x12'),_0xbe14('0x13'),_0xbe14('0x14'),_0xbe14('0x15'),_0xbe14('0x16'),_0xbe14('0xe'),_0xbe14('0x5e'),'chatStatusTime','faxStatusTime','mailStatusTime',_0xbe14('0x52'),_0xbe14('0x54'),_0xbe14('0x55'),_0xbe14('0x5f'),_0xbe14('0x48'),_0xbe14('0x4b'),_0xbe14('0x60'),_0xbe14('0x61'),_0xbe14('0x49'),_0xbe14('0x4a'),_0xbe14('0x4c'),_0xbe14('0x50'),_0xbe14('0x4e'),_0xbe14('0x4d'),_0xbe14('0x4f'),_0xbe14('0x62'),_0xbe14('0x63'),_0xbe14('0x58'),_0xbe14('0x57'),_0xbe14('0x64'),'queue',_0xbe14('0x59'),_0xbe14('0x65')];}exports[_0xbe14('0x66')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x2675=['whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','destconnectedlinenum','onhold','lodash','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','every','length','idle','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','unknown','*pause','busy','map','findOne','getAgents','all','uniq','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','whatsappPause','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','order','startsWith','DESC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','toLowerCase','online','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity'];(function(_0x46ba98,_0x2970c6){var _0x382e4e=function(_0x20bad1){while(--_0x20bad1){_0x46ba98['push'](_0x46ba98['shift']());}};_0x382e4e(++_0x2970c6);}(_0x2675,0x75));var _0x5267=function(_0x5f2c16,_0x3c9ddd){_0x5f2c16=_0x5f2c16-0x0;var _0x28c9f1=_0x2675[_0x5f2c16];return _0x28c9f1;};'use strict';var _=require(_0x5267('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x5267('0x1')]({'port':0x232a});var routingClient=jayson[_0x5267('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x4600fa,_0x36bdf0){var _0x4e2548=[_0x4600fa[_0x5267('0x3')],_0x4600fa[_0x5267('0x4')],_0x4600fa[_0x5267('0x5')],_0x4600fa[_0x5267('0x6')],_0x4600fa[_0x5267('0x7')],_0x4600fa[_0x5267('0x8')],_0x4600fa['whatsappPause']];if(!_0x36bdf0)return _[_0x5267('0x9')](_0x4e2548);var _0x46bfdf=_['filter'](_0x4e2548);return _0x46bfdf[_0x5267('0xa')]>0x0&&_0x46bfdf['length']<_0x4e2548[_0x5267('0xa')]?!![]:![];}function isIdle(_0x207d47){return _0x207d47===_0x5267('0xb')||_0x207d47==='unknown'||_0x207d47===_0x5267('0xc')||_0x207d47==='ringing'||_[_0x5267('0xd')](_0x207d47);}function isAgentIdle(_0x5bbf00){if(_0x5bbf00[_0x5267('0xe')]!==_0x5267('0xb')&&_0x5bbf00[_0x5267('0x8')]){_0x5bbf00[_0x5267('0xe')]=_0x5267('0xf');return![];}return _[_0x5267('0x9')]([_0x5bbf00[_0x5267('0x10')],_0x5bbf00[_0x5267('0x11')],_0x5bbf00[_0x5267('0x12')],_0x5bbf00[_0x5267('0x13')],_0x5bbf00[_0x5267('0x14')],_0x5bbf00[_0x5267('0xe')],_0x5bbf00[_0x5267('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x5267('0x16')](function(_0x40d897){if(_0x40d897[_0x5267('0x17')]){throw new Error(_0x5267('0x18'));}var _0x46b2c2=_0x40d897[_0x5267('0x19')];return routingClient[_0x5267('0x1a')](_0x5267('0x1b'),{})[_0x5267('0x16')](function(_0xb1c97a){if(_0xb1c97a[_0x5267('0x17')]){throw new Error(_0x5267('0x1c'));}var _0x528d61=_0xb1c97a[_0x5267('0x19')];return _[_0x5267('0x1d')]({},_0x46b2c2,_0x528d61);});})['catch'](function(_0x20cb50){throw _0x20cb50;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x1cf835){var _0x1019e7=_0x5267('0x1e');if(isAgentPaused(_0x1cf835))_0x1019e7=_0x5267('0xf');else if(isAgentPaused(_0x1cf835,!![]))_0x1019e7=_0x5267('0x1f');else if(isAgentIdle(_0x1cf835))_0x1019e7='idle';else _0x1019e7=_0x5267('0x20');return _0x1019e7;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0xa32663,_0x420fb8){var _0x3b53ac=_['isArray'](_0xa32663)?_0xa32663:[_0xa32663];var _0x499f19=_['startCase'](_0x420fb8)+'Queue';var _0x5ea6a6=_[_0x5267('0x21')](_0x3b53ac,function(_0x399e64){return db[_0x499f19][_0x5267('0x22')]({'where':{'id':_0x399e64}})[_0x5267('0x16')](function(_0x11c8ea){if(!_0x11c8ea)return[];return _0x11c8ea[_0x5267('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x5267('0x24')](_0x5ea6a6)[_0x5267('0x16')](function(_0x2cdc45){var _0x59f112=_(_0x2cdc45)['flatten']()[_0x5267('0x21')]('id')[_0x5267('0x25')]()['value']();return _0x59f112;});}exports[_0x5267('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x52504e,_0x4d7c2a,_0x43e7e7){try{if(_0x4d7c2a[_0x5267('0xa')]>0x0){_0x52504e=_0x52504e[_0x5267('0x27')](function(_0x2d2ace){return _0x4d7c2a[_0x5267('0x28')](_0x2d2ace['id']);});}var _0x4f3d4d=_0x52504e['filter'](function(_0x18020c){var _0x10a68c=_0x5267('0x20');if(isAgentIdle(_0x18020c)){_0x10a68c='idle';}return _0x10a68c===_0x43e7e7;});return _['map'](_0x4f3d4d,'id');}catch(_0xbe7922){throw _0xbe7922;}}exports[_0x5267('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1fa725,_0x5bec7e,_0x59b091){return Promise[_0x5267('0x2a')]()[_0x5267('0x16')](function(){if(_0x5bec7e[_0x5267('0xa')]>0x0){_0x1fa725=_0x1fa725[_0x5267('0x27')](function(_0x5bbb83){return _0x5bec7e[_0x5267('0x28')](_0x5bbb83['id']);});}return _0x1fa725;})[_0x5267('0x16')](function(){return db[_0x5267('0x2b')][_0x5267('0x2c')]({'attributes':['id',_0x5267('0x2d'),_0x5267('0x2e'),_0x5267('0x3'),_0x5267('0x4'),'mailPause','openchannelPause',_0x5267('0x7'),'voicePause',_0x5267('0x2f'),_0x5267('0x30')],'where':{'id':{'$in':_[_0x5267('0x21')](_0x1fa725,'id')}},'raw':!![]});})[_0x5267('0x16')](function(_0x4ac4a0){return _0x4ac4a0[_0x5267('0x21')](function(_0xdd06f){var _0x3c6c1a=_[_0x5267('0x31')](_0x1fa725,['id',_0xdd06f['id']]);var _0x35fd12=filterAgentAttributes(_0x3c6c1a);_[_0x5267('0x1d')](_0xdd06f,_0x35fd12);_0xdd06f[_0x5267('0x32')]=getAgentStatus(_0xdd06f);return _0xdd06f;});})[_0x5267('0x16')](function(_0x484b77){var _0x1b297c=sortAgentsByStatus(_0x484b77,_0x59b091);return _['map'](_0x1b297c,'id');})[_0x5267('0x33')](function(_0x335c0e){throw _0x335c0e;});}exports[_0x5267('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x365d98){var _0x41e58b={'fields':[],'order':null};var _0x33ecd7=_0x365d98[_0x5267('0x35')](',');_0x41e58b['fields']=_[_0x5267('0x27')](_0x33ecd7,function(_0x3a2e07){if(!_0x3a2e07[_0x5267('0x28')](_0x5267('0x32'))){return!![];}_0x41e58b[_0x5267('0x36')]=_[_0x5267('0x37')](_0x3a2e07,'-')?_0x5267('0x38'):'ASC';return![];});return _0x41e58b;}exports[_0x5267('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x5ef02e){if(!_0x5ef02e){_0x5ef02e=_0x5267('0x3a');}if(_0x5ef02e['includes']('fullname')&&!_0x5ef02e['includes'](_0x5267('0x3b'))){var _0x50302f=_0x5ef02e[_0x5267('0x3c')](0x0,_0x5ef02e[_0x5267('0x3d')](_0x5267('0x2e')));_0x5ef02e+=','+_0x50302f+_0x5267('0x3b');}return _0x5ef02e;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x456b33,_0x805587){var _0x588edf=_0x456b33['sort'](function(_0x3e1483,_0x560cdf){if(_0x3e1483[_0x5267('0x32')]===_0x560cdf[_0x5267('0x32')]){if(_0x3e1483[_0x5267('0x32')]===_0x5267('0xf')){if(_0x805587===_0x5267('0x38')){return(_0x3e1483[_0x5267('0x30')]||'')<(_0x560cdf[_0x5267('0x30')]||'')||_0x3e1483['fullname']['toLowerCase']()>_0x560cdf[_0x5267('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return(_0x3e1483[_0x5267('0x30')]||'')<(_0x560cdf[_0x5267('0x30')]||'')||_0x3e1483['fullname'][_0x5267('0x3e')]()>_0x560cdf[_0x5267('0x2e')][_0x5267('0x3e')]()?-0x1:0x1;}}else{if(_0x805587===_0x5267('0x38')){return _0x3e1483[_0x5267('0x2e')][_0x5267('0x3e')]()<_0x560cdf[_0x5267('0x2e')][_0x5267('0x3e')]()?0x1:-0x1;}else{return _0x3e1483[_0x5267('0x2e')]['toLowerCase']()<_0x560cdf[_0x5267('0x2e')][_0x5267('0x3e')]()?-0x1:0x1;}}}else{if(_0x805587===_0x5267('0x38')){return _0x3e1483[_0x5267('0x32')]<_0x560cdf[_0x5267('0x32')]?0x1:-0x1;}else{return _0x3e1483['globalStatus']<_0x560cdf[_0x5267('0x32')]?-0x1:0x1;}}});return _0x588edf;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x21e2cb){var _0x5cda8c=['userpic',_0x5267('0x3f'),'lastLoginAt',_0x5267('0x40'),_0x5267('0x30'),_0x5267('0x40'),_0x5267('0x3b'),'address',_0x5267('0x3'),'openchannelPause','mailPause',_0x5267('0x7'),_0x5267('0x2f'),'faxPause','voicePause',_0x5267('0x41'),_0x5267('0x42'),_0x5267('0x43'),_0x5267('0x44'),_0x5267('0x45'),_0x5267('0x46'),_0x5267('0x47'),_0x5267('0x48'),_0x5267('0x49'),_0x5267('0x4a'),_0x5267('0x4b'),_0x5267('0x4c'),_0x5267('0x10'),_0x5267('0x13'),'mailStatus',_0x5267('0x14'),_0x5267('0x15'),_0x5267('0x11'),'voiceStatus',_0x5267('0x4d'),_0x5267('0x4e'),_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x51'),_0x5267('0x52'),'voiceStatusTime',_0x5267('0x53'),'destconnectedlinenum',_0x5267('0x54'),_0x5267('0x55'),_0x5267('0x56'),_0x5267('0x57')];var _0x91b932=[_0x5267('0x3'),_0x5267('0x6'),'mailPause','smsPause',_0x5267('0x2f'),_0x5267('0x4'),'voicePause',_0x5267('0x3f')];var _0x578e4e=_(_0x21e2cb)['omit'](_0x91b932)[_0x5267('0x58')](_0x5cda8c)[_0x5267('0x59')]();return _0x578e4e;}exports[_0x5267('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x5267('0x2d'),_0x5267('0x2e'),_0x5267('0x5b'),_0x5267('0x3b'),_0x5267('0x3f'),_0x5267('0x32'),_0x5267('0x5c'),'lastLoginAt',_0x5267('0x30'),_0x5267('0x40'),_0x5267('0x4'),_0x5267('0x3'),_0x5267('0x5'),_0x5267('0x6'),'smsPause',_0x5267('0x8'),'whatsappPause',_0x5267('0x10'),_0x5267('0x11'),_0x5267('0x12'),'openchannelStatus',_0x5267('0x14'),_0x5267('0xe'),_0x5267('0x15'),_0x5267('0x4d'),_0x5267('0x52'),_0x5267('0x4f'),'openchannelStatusTime',_0x5267('0x50'),_0x5267('0x5d'),_0x5267('0x51'),_0x5267('0x41'),'faxCapacity','mailCapacity',_0x5267('0x42'),'smsCapacity',_0x5267('0x45'),_0x5267('0x47'),'faxCurrentCapacity','mailCurrentCapacity',_0x5267('0x48'),_0x5267('0x4a'),_0x5267('0x4b'),'phoneBarEnableScreenRecordingByAgent',_0x5267('0x56'),_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x53'),'routealias','screenrecording'];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index e7424c3..6500e3b 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x807b=['voice','request','startCase','Queues','then','error','result','catch','getRealtimeQueues','concat','outbound','available','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','paused','waiting','busy','inUse','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x6866e3,_0x3ddb25){var _0x394cfe=function(_0x893aa8){while(--_0x893aa8){_0x6866e3['push'](_0x6866e3['shift']());}};_0x394cfe(++_0x3ddb25);}(_0x807b,0x14e));var _0xb807=function(_0x5adb83,_0xdbf39e){_0x5adb83=_0x5adb83-0x0;var _0x17e533=_0x807b[_0x5adb83];return _0x17e533;};'use strict';var _=require(_0xb807('0x0'));var jayson=require(_0xb807('0x1'));var util=require(_0xb807('0x2'));var amiClient=jayson[_0xb807('0x3')][_0xb807('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0xb807('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn',_0xb807('0x5'),_0xb807('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0xb807('0x7'),_0xb807('0x8'),'invalid',_0xb807('0x9'),_0xb807('0xa'),_0xb807('0xb'),_0xb807('0xc'),_0xb807('0xd'),_0xb807('0xe'),_0xb807('0xf'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xb807('0x10'),_0xb807('0x11'),_0xb807('0x12'),_0xb807('0x13'),_0xb807('0x14'),_0xb807('0x15'),_0xb807('0x16'),_0xb807('0x17'),_0xb807('0x18'),'erlangCalls',_0xb807('0x19'),_0xb807('0x1a'),_0xb807('0x1b'),_0xb807('0x1c'),_0xb807('0x1d'),'dialPredictiveIntervalMinThreshold',_0xb807('0x1e'),_0xb807('0x1f'),_0xb807('0x20'),_0xb807('0x21'),_0xb807('0x22'),_0xb807('0x23'),_0xb807('0x24')];function getRealtimeQueues(_0x252ef3,_0x1a56ec){var _0xb35ebc=_0x1a56ec===_0xb807('0x25')?amiClient:routingClient;return _0xb35ebc[_0xb807('0x26')](_[_0xb807('0x27')](_0x1a56ec)+_0xb807('0x28'),_0x252ef3)[_0xb807('0x29')](function(_0x149216){if(_0x149216[_0xb807('0x2a')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1a56ec));return _0x149216[_0xb807('0x2b')];})[_0xb807('0x2c')](function(_0x399fcc){throw _0x399fcc;});}exports[_0xb807('0x2d')]=getRealtimeQueues;function initializeQueues(_0xbc811e,_0x5f3290,_0x33a230,_0x4f4d12){var _0x8d79f2=DEFAULT_QUEUE_ATTRIBUTES;if(_0x33a230===_0xb807('0x25')){if(_0x4f4d12==='inbound'){_0x8d79f2=_0x8d79f2[_0xb807('0x2e')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4f4d12===_0xb807('0x2f')){_0x8d79f2=_0x8d79f2[_0xb807('0x2e')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xbc811e['map'](function(_0x1e3cdc){var _0x5cade1=_0x1e3cdc['get']({'plain':!![]});_0x5cade1[_0xb807('0x5')]=0x0;_0x5cade1[_0xb807('0x9')]=0x0;_0x5cade1['loggedIn']=0x0;_0x5cade1[_0xb807('0x30')]=0x0;_0x5cade1[_0xb807('0x6')]=0x0;if(_0x33a230==='voice'){_0x5cade1[_0xb807('0xe')]=0x0;_0x5cade1[_0xb807('0x7')]=0x0;if(_0x4f4d12===_0xb807('0x2f')){_0x5cade1[_0xb807('0x10')]=0x0;_0x5cade1[_0xb807('0x11')]=0x0;}}var _0x12dd45=_[_0xb807('0x31')](_0x5f3290,['id',_0x5cade1['id']]);if(_0x12dd45){_[_0xb807('0x32')](_0x5cade1,_[_0xb807('0x33')](_0x12dd45,_0x8d79f2));}return _0x5cade1;});}exports[_0xb807('0x34')]=initializeQueues; \ No newline at end of file +var _0x09cc=['predictiveIntervalAvgTalktime','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','voice','concat','outbound','map','get','find','merge','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','invalid','loggedInDb','notInUse','onHold','talking','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','predictiveIntervalAvailable'];(function(_0x2772e1,_0x545572){var _0x1fb3af=function(_0x5dd033){while(--_0x5dd033){_0x2772e1['push'](_0x2772e1['shift']());}};_0x1fb3af(++_0x545572);}(_0x09cc,0x118));var _0xc09c=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x09cc[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0xc09c('0x0'));var jayson=require(_0xc09c('0x1'));var util=require(_0xc09c('0x2'));var amiClient=jayson[_0xc09c('0x3')][_0xc09c('0x4')]({'port':0x232a});var routingClient=jayson[_0xc09c('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xc09c('0x5'),_0xc09c('0x6'),_0xc09c('0x7'),_0xc09c('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0xc09c('0x9'),'inUse',_0xc09c('0xa'),_0xc09c('0xb'),_0xc09c('0xc'),_0xc09c('0xd'),'ringing','ringInUse',_0xc09c('0xe'),'unavailable',_0xc09c('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xc09c('0x10'),_0xc09c('0x11'),'message',_0xc09c('0x12'),_0xc09c('0x13'),_0xc09c('0x14'),_0xc09c('0x15'),_0xc09c('0x16'),_0xc09c('0x17'),'erlangCalls',_0xc09c('0x18'),_0xc09c('0x19'),_0xc09c('0x1a'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xc09c('0x1b'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0xc09c('0x1c')];function getRealtimeQueues(_0x549233,_0x481613){var _0x4cad57=_0x481613==='voice'?amiClient:routingClient;return _0x4cad57['request'](_[_0xc09c('0x1d')](_0x481613)+_0xc09c('0x1e'),_0x549233)['then'](function(_0x3dc52d){if(_0x3dc52d[_0xc09c('0x1f')])throw new Error(util[_0xc09c('0x20')](_0xc09c('0x21'),_0x481613));return _0x3dc52d[_0xc09c('0x22')];})[_0xc09c('0x23')](function(_0xcb365e){throw _0xcb365e;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x352d3b,_0x51bcde,_0xd8067d,_0x3076cb){var _0x3e403e=DEFAULT_QUEUE_ATTRIBUTES;if(_0xd8067d===_0xc09c('0x24')){if(_0x3076cb==='inbound'){_0x3e403e=_0x3e403e[_0xc09c('0x25')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3076cb===_0xc09c('0x26')){_0x3e403e=_0x3e403e['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x352d3b[_0xc09c('0x27')](function(_0x32d673){var _0x2d3ae0=_0x32d673[_0xc09c('0x28')]({'plain':!![]});_0x2d3ae0[_0xc09c('0x7')]=0x0;_0x2d3ae0[_0xc09c('0xb')]=0x0;_0x2d3ae0[_0xc09c('0x6')]=0x0;_0x2d3ae0[_0xc09c('0x5')]=0x0;_0x2d3ae0['waiting']=0x0;if(_0xd8067d===_0xc09c('0x24')){_0x2d3ae0['talking']=0x0;_0x2d3ae0[_0xc09c('0x9')]=0x0;if(_0x3076cb==='outbound'){_0x2d3ae0[_0xc09c('0x10')]=0x0;_0x2d3ae0[_0xc09c('0x11')]=0x0;}}var _0x2662d0=_[_0xc09c('0x29')](_0x51bcde,['id',_0x2d3ae0['id']]);if(_0x2662d0){_[_0xc09c('0x2a')](_0x2d3ae0,_['pick'](_0x2662d0,_0x3e403e));}return _0x2d3ae0;});}exports[_0xc09c('0x2b')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index d5b9652..1e30fd1 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(_0x899736,_0x56daef){var _0x52bc92=function(_0x5b31be){while(--_0x5b31be){_0x899736['push'](_0x899736['shift']());}};_0x52bc92(++_0x56daef);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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(_0x2145c0,_0x549319){var _0x4c613a=function(_0x4e7350){while(--_0x4e7350){_0x2145c0['push'](_0x2145c0['shift']());}};_0x4c613a(++_0x549319);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 198cbb4..f08f24d 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 _0xacbe=['getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','hex','substring','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','digest'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0xacbe,0x146));var _0xeacb=function(_0x464468,_0xd3cd98){_0x464468=_0x464468-0x0;var _0x39f45b=_0xacbe[_0x464468];return _0x39f45b;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0xeacb('0x0'));var exec=require(_0xeacb('0x1'))[_0xeacb('0x2')];var config=require('../environment');function getInterfaces(){var _0x2f5ae1=[];var _0xd3424a=os[_0xeacb('0x3')]();var _0x337198=_[_0xeacb('0x4')](_[_0xeacb('0x5')](_0xd3424a));for(var _0x155099=0x0;_0x155099<_0x337198[_0xeacb('0x6')];_0x155099++){var _0x1e7db3=_0xd3424a[_0x337198[_0x155099]]['filter'](function(_0x5be1fc){return _0x5be1fc[_0xeacb('0x7')]===_0xeacb('0x8')&&_0x5be1fc[_0xeacb('0x9')]===![];});_0x2f5ae1=_0x2f5ae1[_0xeacb('0xa')](_0x1e7db3);}return _0x2f5ae1;}function getFirstInterface(){var _0x3c21f7=_[_0xeacb('0xb')](getInterfaces());return{'macAddress':_0x3c21f7&&_0x3c21f7['mac']?_0x3c21f7[_0xeacb('0xc')]:_0xeacb('0xd'),'ipAddress':_0x3c21f7&&_0x3c21f7[_0xeacb('0xe')]?_0x3c21f7[_0xeacb('0xe')]:_0xeacb('0xf')};}exports[_0xeacb('0x10')]=getFirstInterface;function getCPUhash(){var _0x321dd4=_[_0xeacb('0x4')](os[_0xeacb('0x11')]()[_0xeacb('0x12')](function(_0x4024aa){return _0x4024aa['model'];}))[_0xeacb('0x13')](':');return crypto[_0xeacb('0x14')](_0xeacb('0x15'))[_0xeacb('0x16')](_0x321dd4)[_0xeacb('0x17')]('hex');}exports[_0xeacb('0x18')]=function(){var _0x2aaf66=os[_0xeacb('0x19')]();var _0x5ac16d=/[0-9a-f-]{36}/;if(config[_0xeacb('0x1a')]&&_0x5ac16d[_0xeacb('0x1b')](config[_0xeacb('0x1a')])){return config['licenseToken'];}else if(_0x2aaf66===_0xeacb('0x1c')){return exec(_0xeacb('0x1d'),{'encoding':_0xeacb('0x1e')})[_0xeacb('0x1f')]('\x0d\x0a','');}else{var _0x657dcb=getFirstInterface();var _0x3c554c=getCPUhash();var _0x6f378a=_0x3c554c+'|'+os[_0xeacb('0x20')]()+'|'+_0x657dcb['macAddress']+'|'+_0x657dcb['ipAddress'];var _0x2d512a=crypto['createHash'](_0xeacb('0x15'))[_0xeacb('0x16')](_0x6f378a)[_0xeacb('0x17')](_0xeacb('0x21'));return _0x2d512a[_0xeacb('0x22')](0x0,0x8)+'-'+_0x2d512a['substring'](0x8,0xc)+'-'+_0x2d512a[_0xeacb('0x22')](0xc,0x10)+'-'+_0x2d512a['substring'](0x10,0x14)+'-'+_0x2d512a[_0xeacb('0x22')](0x14);}}; \ No newline at end of file +var _0xea67=['family','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','utf8','replace','hostname','ipAddress','substring','child_process','execSync','../environment','networkInterfaces','keys','length','filter'];(function(_0x524c74,_0x2b6986){var _0xb4b6f1=function(_0x26c642){while(--_0x26c642){_0x524c74['push'](_0x524c74['shift']());}};_0xb4b6f1(++_0x2b6986);}(_0xea67,0xa3));var _0x7ea6=function(_0x5005ba,_0x423ed1){_0x5005ba=_0x5005ba-0x0;var _0x21278c=_0xea67[_0x5005ba];return _0x21278c;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x7ea6('0x0'))[_0x7ea6('0x1')];var config=require(_0x7ea6('0x2'));function getInterfaces(){var _0x38c421=[];var _0x172c91=os[_0x7ea6('0x3')]();var _0x105031=_['orderBy'](_[_0x7ea6('0x4')](_0x172c91));for(var _0x3956f5=0x0;_0x3956f5<_0x105031[_0x7ea6('0x5')];_0x3956f5++){var _0x2f33b1=_0x172c91[_0x105031[_0x3956f5]][_0x7ea6('0x6')](function(_0x416c55){return _0x416c55[_0x7ea6('0x7')]==='IPv4'&&_0x416c55[_0x7ea6('0x8')]===![];});_0x38c421=_0x38c421[_0x7ea6('0x9')](_0x2f33b1);}return _0x38c421;}function getFirstInterface(){var _0x148203=_[_0x7ea6('0xa')](getInterfaces());return{'macAddress':_0x148203&&_0x148203[_0x7ea6('0xb')]?_0x148203[_0x7ea6('0xb')]:_0x7ea6('0xc'),'ipAddress':_0x148203&&_0x148203[_0x7ea6('0xd')]?_0x148203[_0x7ea6('0xd')]:'127.0.0.1'};}exports[_0x7ea6('0xe')]=getFirstInterface;function getCPUhash(){var _0x171199=_[_0x7ea6('0xf')](os[_0x7ea6('0x10')]()[_0x7ea6('0x11')](function(_0x34da9b){return _0x34da9b[_0x7ea6('0x12')];}))[_0x7ea6('0x13')](':');return crypto[_0x7ea6('0x14')](_0x7ea6('0x15'))[_0x7ea6('0x16')](_0x171199)[_0x7ea6('0x17')](_0x7ea6('0x18'));}exports[_0x7ea6('0x19')]=function(){var _0x471fd4=os[_0x7ea6('0x1a')]();var _0x4f2feb=/[0-9a-f-]{36}/;if(config[_0x7ea6('0x1b')]&&_0x4f2feb['test'](config[_0x7ea6('0x1b')])){return config[_0x7ea6('0x1b')];}else if(_0x471fd4===_0x7ea6('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x7ea6('0x1d')})[_0x7ea6('0x1e')]('\x0d\x0a','');}else{var _0xe593ce=getFirstInterface();var _0x368164=getCPUhash();var _0x40e744=_0x368164+'|'+os[_0x7ea6('0x1f')]()+'|'+_0xe593ce['macAddress']+'|'+_0xe593ce[_0x7ea6('0x20')];var _0x4efb33=crypto[_0x7ea6('0x14')]('md5')[_0x7ea6('0x16')](_0x40e744)[_0x7ea6('0x17')](_0x7ea6('0x18'));return _0x4efb33[_0x7ea6('0x21')](0x0,0x8)+'-'+_0x4efb33[_0x7ea6('0x21')](0x8,0xc)+'-'+_0x4efb33[_0x7ea6('0x21')](0xc,0x10)+'-'+_0x4efb33['substring'](0x10,0x14)+'-'+_0x4efb33[_0x7ea6('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 04878d6..56b165d 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 _0x3272=['getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','update','error','message','finally'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3272,0x19a));var _0x2327=function(_0x1b3461,_0x1439ae){_0x1b3461=_0x1b3461-0x0;var _0x14f4a7=_0x3272[_0x1b3461];return _0x14f4a7;};'use strict';var util=require(_0x2327('0x0'));var moment=require(_0x2327('0x1'));var rp=require('request-promise');var BPromise=require(_0x2327('0x2'));var pkginfo=require(_0x2327('0x3'))(module,'version');var db=require(_0x2327('0x4'))['db'];var encryptor=require(_0x2327('0x5'));var hardware=require(_0x2327('0x6'));var logger=require(_0x2327('0x7'))(_0x2327('0x8'));var HOST=_0x2327('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x387a9c){return new BPromise(function(_0x71d62e,_0x435e8b){var _0x55fd33=util[_0x2327('0xa')](_0x2327('0xb'),HOST,_0x387a9c,module['exports'][_0x2327('0xc')]);if(oldToken){_0x55fd33=util[_0x2327('0xa')](_0x2327('0xd'),HOST,_0x387a9c,module[_0x2327('0xe')][_0x2327('0xc')],oldToken);}var _0x50b5f8={'uri':_0x55fd33,'method':_0x2327('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x50b5f8)[_0x2327('0x10')](function(_0x293b33){_0x71d62e(_0x293b33);})[_0x2327('0x11')](function(_0x131d0d){_0x435e8b(_0x131d0d);});});}function manageLicense(_0x39078f,_0x41a206){var _0x5d29df=_0x41a206[_0x2327('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x5d29df[_0x2327('0x13')]!==_0x39078f&&!_0x5d29df[_0x2327('0x14')]){oldToken=_0x5d29df[_0x2327('0x13')];}httpRequest(_0x39078f)[_0x2327('0x10')](function(_0x4a4927){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4a4927[_0x2327('0x15')]){isOldTokenSent=![];if(!_0x5d29df[_0x2327('0x8')]&&_0x5d29df[_0x2327('0x8')]!=_0x4a4927[_0x2327('0x8')]||_0x5d29df[_0x2327('0x8')]&&_0x5d29df[_0x2327('0x14')]){logger[_0x2327('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5d29df[_0x2327('0x8')]&&!_0x5d29df[_0x2327('0x14')]&&_0x5d29df[_0x2327('0x8')]!=_0x4a4927[_0x2327('0x8')]){logger[_0x2327('0x16')](_0x2327('0x17'));}if(_0x5d29df['license']&&!_0x5d29df[_0x2327('0x14')]&&_0x5d29df['license']==_0x4a4927[_0x2327('0x8')]){return _0x41a206;}return _0x41a206['update']({'data1':_0x39078f,'data2':null,'license':_0x4a4927['license']});}else{if(_0x4a4927[_0x2327('0x8')]||_0x5d29df['license']){if(!_0x5d29df['data2']){if(_0x5d29df[_0x2327('0x13')]==_0x39078f){GRAY_PERIOD_REASON=_0x2327('0x18');logger[_0x2327('0x16')](_0x2327('0x19'));}else{GRAY_PERIOD_REASON=_0x2327('0x1a');logger[_0x2327('0x16')](_0x2327('0x1b'),_0x5d29df[_0x2327('0x13')],_0x39078f);}logger[_0x2327('0x16')](_0x2327('0x1c'),GRAY_PERIOD_REASON[_0x2327('0x1d')](),moment()['format'](_0x2327('0x1e')));return _0x41a206['update']({'data2':encryptor[_0x2327('0x1f')](moment()['format'](_0x2327('0x1e')))});}else{if(moment()[_0x2327('0x20')](encryptor[_0x2327('0x21')](_0x5d29df[_0x2327('0x14')]),_0x2327('0x22'))>DAYS){logger['info'](_0x2327('0x23'),moment()[_0x2327('0xa')](_0x2327('0x1e')));isOldTokenSent=![];return _0x41a206[_0x2327('0x24')]({'data1':_0x39078f,'data2':null,'license':null});}}}else{if(_0x5d29df['data1']!=_0x39078f){logger[_0x2327('0x16')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5d29df[_0x2327('0x13')],_0x39078f);return _0x41a206[_0x2327('0x24')]({'data1':_0x39078f,'data2':null,'license':null});}}}return _0x41a206;})['then'](function(_0x59e5f1){_0x41a206=_0x59e5f1;})[_0x2327('0x11')](function(_0x1d58d3){logger[_0x2327('0x25')](_0x1d58d3[_0x2327('0x26')]);})[_0x2327('0x27')](function(){setTimeout(function(){manageLicense(hardware[_0x2327('0x28')](),_0x41a206);},TIME);});}function defaultLicense(){var _0x24883f=hardware[_0x2327('0x28')]();if(_0x24883f){return db[_0x2327('0x29')][_0x2327('0x2a')]({'where':{'id':0x1},'defaults':{'data1':_0x24883f}})[_0x2327('0x2b')](function(_0x451eb6,_0x275fc7){logger[_0x2327('0x16')](_0x2327('0x2c'),_0x24883f);manageLicense(_0x24883f,_0x451eb6);})['catch'](function(_0x34b5ee){logger[_0x2327('0x25')](_0x34b5ee[_0x2327('0x26')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x34cd=['license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','../../components/encryptor','./hardware','../logger'];(function(_0x4579dc,_0xff67f8){var _0x458962=function(_0x1f9383){while(--_0x1f9383){_0x4579dc['push'](_0x4579dc['shift']());}};_0x458962(++_0xff67f8);}(_0x34cd,0xa1));var _0xd34c=function(_0x4ce2f6,_0x1feabc){_0x4ce2f6=_0x4ce2f6-0x0;var _0x2e6fc4=_0x34cd[_0x4ce2f6];return _0x2e6fc4;};'use strict';var util=require(_0xd34c('0x0'));var moment=require(_0xd34c('0x1'));var rp=require(_0xd34c('0x2'));var BPromise=require(_0xd34c('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0xd34c('0x4'));var hardware=require(_0xd34c('0x5'));var logger=require(_0xd34c('0x6'))(_0xd34c('0x7'));var HOST=_0xd34c('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3bb9bd){return new BPromise(function(_0x2f958c,_0x1c4f88){var _0x4c887a=util[_0xd34c('0x9')](_0xd34c('0xa'),HOST,_0x3bb9bd,module[_0xd34c('0xb')][_0xd34c('0xc')]);if(oldToken){_0x4c887a=util[_0xd34c('0x9')](_0xd34c('0xd'),HOST,_0x3bb9bd,module['exports']['version'],oldToken);}var _0x194199={'uri':_0x4c887a,'method':_0xd34c('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x194199)[_0xd34c('0xf')](function(_0x2f7b09){_0x2f958c(_0x2f7b09);})[_0xd34c('0x10')](function(_0x52f560){_0x1c4f88(_0x52f560);});});}function manageLicense(_0x59ed22,_0x4c87de){var _0x5327e7=_0x4c87de[_0xd34c('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x5327e7[_0xd34c('0x12')]!==_0x59ed22&&!_0x5327e7['data2']){oldToken=_0x5327e7[_0xd34c('0x12')];}httpRequest(_0x59ed22)[_0xd34c('0xf')](function(_0x33dd97){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x33dd97[_0xd34c('0x13')]){isOldTokenSent=![];if(!_0x5327e7[_0xd34c('0x7')]&&_0x5327e7[_0xd34c('0x7')]!=_0x33dd97[_0xd34c('0x7')]||_0x5327e7['license']&&_0x5327e7[_0xd34c('0x14')]){logger[_0xd34c('0x15')](_0xd34c('0x16'));}if(_0x5327e7[_0xd34c('0x7')]&&!_0x5327e7['data2']&&_0x5327e7['license']!=_0x33dd97[_0xd34c('0x7')]){logger[_0xd34c('0x15')](_0xd34c('0x17'));}if(_0x5327e7[_0xd34c('0x7')]&&!_0x5327e7[_0xd34c('0x14')]&&_0x5327e7[_0xd34c('0x7')]==_0x33dd97[_0xd34c('0x7')]){return _0x4c87de;}return _0x4c87de['update']({'data1':_0x59ed22,'data2':null,'license':_0x33dd97[_0xd34c('0x7')]});}else{if(_0x33dd97['license']||_0x5327e7[_0xd34c('0x7')]){if(!_0x5327e7['data2']){if(_0x5327e7[_0xd34c('0x12')]==_0x59ed22){GRAY_PERIOD_REASON=_0xd34c('0x18');logger[_0xd34c('0x15')](_0xd34c('0x19'));}else{GRAY_PERIOD_REASON=_0xd34c('0x1a');logger[_0xd34c('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5327e7[_0xd34c('0x12')],_0x59ed22);}logger['info'](_0xd34c('0x1b'),GRAY_PERIOD_REASON[_0xd34c('0x1c')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x4c87de[_0xd34c('0x1d')]({'data2':encryptor['encryptString'](moment()[_0xd34c('0x9')](_0xd34c('0x1e')))});}else{if(moment()['diff'](encryptor[_0xd34c('0x1f')](_0x5327e7[_0xd34c('0x14')]),_0xd34c('0x20'))>DAYS){logger[_0xd34c('0x15')](_0xd34c('0x21'),moment()[_0xd34c('0x9')](_0xd34c('0x1e')));isOldTokenSent=![];return _0x4c87de[_0xd34c('0x1d')]({'data1':_0x59ed22,'data2':null,'license':null});}}}else{if(_0x5327e7[_0xd34c('0x12')]!=_0x59ed22){logger[_0xd34c('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5327e7[_0xd34c('0x12')],_0x59ed22);return _0x4c87de[_0xd34c('0x1d')]({'data1':_0x59ed22,'data2':null,'license':null});}}}return _0x4c87de;})['then'](function(_0x15d8a8){_0x4c87de=_0x15d8a8;})[_0xd34c('0x10')](function(_0x3192d5){logger[_0xd34c('0x22')](_0x3192d5['message']);})[_0xd34c('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4c87de);},TIME);});}function defaultLicense(){var _0x5c5f0d=hardware[_0xd34c('0x24')]();if(_0x5c5f0d){return db['License'][_0xd34c('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x5c5f0d}})[_0xd34c('0x26')](function(_0x3ef4da,_0x1c93d3){logger[_0xd34c('0x15')](_0xd34c('0x27'),_0x5c5f0d);manageLicense(_0x5c5f0d,_0x3ef4da);})[_0xd34c('0x10')](function(_0x143c78){logger[_0xd34c('0x22')](_0x143c78[_0xd34c('0x28')]);});}}exports[_0xd34c('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index af6c560..7fa8aa6 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 _0x0e3b=['../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','deadline','add','days','grayReason','changed','disabled','message','then','findAll','role','sequelize','col','count','user','telephone','telephones','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x0e3b,0x1d1));var _0xb0e3=function(_0x99edad,_0x1eabbf){_0x99edad=_0x99edad-0x0;var _0x587195=_0x0e3b[_0x99edad];return _0x587195;};'use strict';var util=require(_0xb0e3('0x0'));var _=require(_0xb0e3('0x1'));var moment=require(_0xb0e3('0x2'));var BPromise=require(_0xb0e3('0x3'));var hardware=require(_0xb0e3('0x4'));var encryptor=require(_0xb0e3('0x5'));var db=require(_0xb0e3('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb0e3('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb0e3('0x8'),'machineUuid':hardware[_0xb0e3('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb0e3('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xb0e3('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5e0f44){return new BPromise(function(_0x148626,_0x3d5298){return db[_0xb0e3('0xa')][_0xb0e3('0xb')](_[_0xb0e3('0xc')](_0x5e0f44,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3c2620){return checkLicense(_0x3c2620,null);})['then'](function(_0x1e6902){_0x148626(_0x1e6902);return;})[_0xb0e3('0xd')](function(_0x43d6bc){_0x3d5298(_0x43d6bc);});});}function checkLicense(_0x4af11a,_0x544192){if(!_0x4af11a){demoLicense[_0xb0e3('0xe')]=_0x4af11a[_0xb0e3('0xf')];return demoLicense;}try{var _0x3a42b2=_0x544192||_0x4af11a[_0xb0e3('0x10')];if(_[_0xb0e3('0x11')](_0x3a42b2)){throw new Error(_0xb0e3('0x12'));}var _0x1d133f=_0x4af11a[_0xb0e3('0xf')];var _0x2c60c8=_0x4af11a[_0xb0e3('0x13')];var _0x5d6de7=_0x1d133f['split']('-')[0x4];var _0x59c3d1=_0x1d133f[_0xb0e3('0x14')]('-')[0x0];var _0x2b9853=encryptor[_0xb0e3('0x15')](_0x3a42b2,util[_0xb0e3('0x16')]('%s:%s:%s',_0x5d6de7,_0x1d133f,_0x59c3d1));var _0x3ba4ff=JSON[_0xb0e3('0x17')](_0x2b9853);_0x3ba4ff[_0xb0e3('0x18')]=![];_0x3ba4ff['uuid']=_0x1d133f;_0x3ba4ff[_0xb0e3('0x19')]=hardware[_0xb0e3('0x9')]();if(_0x2c60c8){var _0x25f6e8=encryptor['decryptString'](_0x2c60c8);_0x3ba4ff['gray']=_0x25f6e8;_0x3ba4ff[_0xb0e3('0x1a')]=moment(_0x25f6e8)[_0xb0e3('0x1b')](0x7,_0xb0e3('0x1c'))[_0xb0e3('0x16')]();_0x3ba4ff[_0xb0e3('0x1d')]=_0x3ba4ff[_0xb0e3('0xe')]!=_0x3ba4ff[_0xb0e3('0x19')]?_0xb0e3('0x1e'):_0xb0e3('0x1f');}return _0x3ba4ff;}catch(_0x34a4b7){breakingLicense['uuid']=_0x4af11a[_0xb0e3('0xf')];breakingLicense[_0xb0e3('0x20')]=_0x34a4b7[_0xb0e3('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xde3647,_0x45af21){getLicense()[_0xb0e3('0x21')](function(_0x1b3d33){return db['User'][_0xb0e3('0x22')]({'attributes':[_0xb0e3('0x23'),[db[_0xb0e3('0x24')]['fn']('COUNT',db[_0xb0e3('0x24')][_0xb0e3('0x25')](_0xb0e3('0x23'))),_0xb0e3('0x26')]],'group':_0xb0e3('0x23'),'where':{'role':{'$or':['admin',_0xb0e3('0x27'),_0xb0e3('0x28')]}},'raw':!![]})[_0xb0e3('0x21')](function(_0x401942){var _0x305c4c={'user':_0x1b3d33['users']||0x0,'telephone':_0x1b3d33[_0xb0e3('0x29')]||0x0};_0x401942['forEach'](function(_0x2a4270){var _0x58db3e=_0x2a4270[_0xb0e3('0x23')]===_0xb0e3('0x2a')?_0xb0e3('0x27'):_0x2a4270[_0xb0e3('0x23')];_0x305c4c[_0x58db3e]-=_0x2a4270['count'];if(_0x305c4c[_0x58db3e]<0x0)_0x305c4c[_0x58db3e]=0x0;});_0xde3647(_0x305c4c);return;});})[_0xb0e3('0xd')](function(_0x98f1a0){_0x45af21(_0x98f1a0);});});}function checkUserLimits(_0x3de1bc){return new BPromise(function(_0x26f171,_0x370a6b){getLimits()[_0xb0e3('0x21')](function(_0x7c13cc){var _0x19cf3a=_[_0xb0e3('0x2b')](_[_0xb0e3('0x2c')](_0x3de1bc,'role'),[_0xb0e3('0x2a'),_0xb0e3('0x27'),_0xb0e3('0x28')]);var _0x5d8e8a=(_0x19cf3a[_0xb0e3('0x2a')]||0x0)+(_0x19cf3a[_0xb0e3('0x27')]||0x0);var _0x15ebb0=_0x19cf3a['telephone']||0x0;if(_0x5d8e8a>_0x7c13cc[_0xb0e3('0x27')])return _0x370a6b(_0xb0e3('0x2d'));if(_0x15ebb0>_0x7c13cc[_0xb0e3('0x28')])return _0x370a6b(_0xb0e3('0x2e'));return _0x26f171();})[_0xb0e3('0xd')](function(_0xc18da){_0x370a6b(_0xc18da);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xaa72=['2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','data1','license','License\x20key\x20value\x20not\x20found','split','format','%s:%s:%s','uuid','machineUuid','decryptString','gray','deadline','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','user','telephone','users','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaa72,0x1a1));var _0x2aa7=function(_0x4e9416,_0x3deeb7){_0x4e9416=_0x4e9416-0x0;var _0x1f0dea=_0xaa72[_0x4e9416];return _0x1f0dea;};'use strict';var util=require(_0x2aa7('0x0'));var _=require(_0x2aa7('0x1'));var moment=require(_0x2aa7('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2aa7('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2aa7('0x4'),'machineUuid':hardware[_0x2aa7('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x2aa7('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x58275b){return new BPromise(function(_0x3c2e0a,_0x421799){return db[_0x2aa7('0x6')][_0x2aa7('0x7')](_[_0x2aa7('0x8')](_0x58275b,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3ec345){return checkLicense(_0x3ec345,null);})[_0x2aa7('0x9')](function(_0x382060){_0x3c2e0a(_0x382060);return;})[_0x2aa7('0xa')](function(_0x30f71d){_0x421799(_0x30f71d);});});}function checkLicense(_0x4d6112,_0x2f85ad){if(!_0x4d6112){demoLicense['uuid']=_0x4d6112[_0x2aa7('0xb')];return demoLicense;}try{var _0xa24dbf=_0x2f85ad||_0x4d6112[_0x2aa7('0xc')];if(_['isEmpty'](_0xa24dbf)){throw new Error(_0x2aa7('0xd'));}var _0xce26f2=_0x4d6112['data1'];var _0x59fcfd=_0x4d6112['data2'];var _0x4d3476=_0xce26f2[_0x2aa7('0xe')]('-')[0x4];var _0x4748f5=_0xce26f2[_0x2aa7('0xe')]('-')[0x0];var _0x187d42=encryptor['decryptString'](_0xa24dbf,util[_0x2aa7('0xf')](_0x2aa7('0x10'),_0x4d3476,_0xce26f2,_0x4748f5));var _0x143270=JSON['parse'](_0x187d42);_0x143270['demo']=![];_0x143270[_0x2aa7('0x11')]=_0xce26f2;_0x143270[_0x2aa7('0x12')]=hardware[_0x2aa7('0x5')]();if(_0x59fcfd){var _0xa4bc55=encryptor[_0x2aa7('0x13')](_0x59fcfd);_0x143270[_0x2aa7('0x14')]=_0xa4bc55;_0x143270[_0x2aa7('0x15')]=moment(_0xa4bc55)['add'](0x7,_0x2aa7('0x16'))[_0x2aa7('0xf')]();_0x143270[_0x2aa7('0x17')]=_0x143270[_0x2aa7('0x11')]!=_0x143270[_0x2aa7('0x12')]?_0x2aa7('0x18'):_0x2aa7('0x19');}return _0x143270;}catch(_0xf7200d){breakingLicense[_0x2aa7('0x11')]=_0x4d6112[_0x2aa7('0xb')];breakingLicense[_0x2aa7('0x1a')]=_0xf7200d[_0x2aa7('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5ae907,_0x481227){getLicense()[_0x2aa7('0x9')](function(_0x3b8793){return db[_0x2aa7('0x1b')][_0x2aa7('0x1c')]({'attributes':[_0x2aa7('0x1d'),[db[_0x2aa7('0x1e')]['fn'](_0x2aa7('0x1f'),db[_0x2aa7('0x1e')][_0x2aa7('0x20')](_0x2aa7('0x1d'))),'count']],'group':_0x2aa7('0x1d'),'where':{'role':{'$or':['admin',_0x2aa7('0x21'),_0x2aa7('0x22')]}},'raw':!![]})[_0x2aa7('0x9')](function(_0x4ac374){var _0x26f054={'user':_0x3b8793[_0x2aa7('0x23')]||0x0,'telephone':_0x3b8793['telephones']||0x0};_0x4ac374[_0x2aa7('0x24')](function(_0x44db93){var _0xce3f9e=_0x44db93['role']===_0x2aa7('0x25')?_0x2aa7('0x21'):_0x44db93[_0x2aa7('0x1d')];_0x26f054[_0xce3f9e]-=_0x44db93['count'];if(_0x26f054[_0xce3f9e]<0x0)_0x26f054[_0xce3f9e]=0x0;});_0x5ae907(_0x26f054);return;});})[_0x2aa7('0xa')](function(_0x245e49){_0x481227(_0x245e49);});});}function checkUserLimits(_0x362ce7){return new BPromise(function(_0x41ac17,_0x3a4a2f){getLimits()[_0x2aa7('0x9')](function(_0xc1e5ed){var _0x5e1b8f=_[_0x2aa7('0x26')](_[_0x2aa7('0x27')](_0x362ce7,'role'),[_0x2aa7('0x25'),_0x2aa7('0x21'),_0x2aa7('0x22')]);var _0x2541f6=(_0x5e1b8f[_0x2aa7('0x25')]||0x0)+(_0x5e1b8f[_0x2aa7('0x21')]||0x0);var _0x3a8a7b=_0x5e1b8f['telephone']||0x0;if(_0x2541f6>_0xc1e5ed[_0x2aa7('0x21')])return _0x3a4a2f(_0x2aa7('0x28'));if(_0x3a8a7b>_0xc1e5ed['telephone'])return _0x3a4a2f('License\x20limit\x20reached\x20for\x20telephones');return _0x41ac17();})[_0x2aa7('0xa')](function(_0x1d9cc7){_0x3a4a2f(_0x1d9cc7);});});}module[_0x2aa7('0x29')]={'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 ddeea36..a873b60 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0972=['http://localhost:9000','app-id'];(function(_0x218c12,_0x53122a){var _0x4da1e0=function(_0xab8100){while(--_0xab8100){_0x218c12['push'](_0x218c12['shift']());}};_0x4da1e0(++_0x53122a);}(_0x0972,0x64));var _0x2097=function(_0x4dc9a9,_0xd9cefd){_0x4dc9a9=_0x4dc9a9-0x0;var _0x583293=_0x0972[_0x4dc9a9];return _0x583293;};'use strict';module['exports']={'DOMAIN':_0x2097('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2097('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x8f59=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x8f59,0x11d));var _0x98f5=function(_0x2a1f8,_0x2ce877){_0x2a1f8=_0x2a1f8-0x0;var _0x50382a=_0x8f59[_0x2a1f8];return _0x50382a;};'use strict';module[_0x98f5('0x0')]={'DOMAIN':_0x98f5('0x1'),'SESSION_SECRET':_0x98f5('0x2'),'GOOGLE_ID':_0x98f5('0x3'),'GOOGLE_SECRET':_0x98f5('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d79b97d..d44d808 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee13=['fileLogger','exports','../utils/loggers'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0xee13,0x158));var _0x3ee1=function(_0x4964cd,_0x15aa0c){_0x4964cd=_0x4964cd-0x0;var _0x2a318a=_0xee13[_0x4964cd];return _0x2a318a;};'use strict';var fileLogger=require(_0x3ee1('0x0'))[_0x3ee1('0x1')];module[_0x3ee1('0x2')]=fileLogger; \ No newline at end of file +var _0x8513=['fileLogger','exports','../utils/loggers'];(function(_0x1e02a7,_0x4d8558){var _0x5db9f6=function(_0x571bf9){while(--_0x571bf9){_0x1e02a7['push'](_0x1e02a7['shift']());}};_0x5db9f6(++_0x4d8558);}(_0x8513,0x188));var _0x3851=function(_0xf21b2c,_0x44895f){_0xf21b2c=_0xf21b2c-0x0;var _0x493f26=_0x8513[_0xf21b2c];return _0x493f26;};'use strict';var fileLogger=require(_0x3851('0x0'))[_0x3851('0x1')];module[_0x3851('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c23b948..9bec8e4 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 _0x57da=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','resolve','root','legacy-libs','express','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57da,0xdb));var _0xa57d=function(_0x2ed3e1,_0x4c05bc){_0x2ed3e1=_0x2ed3e1-0x0;var _0x5b46c5=_0x57da[_0x2ed3e1];return _0x5b46c5;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0xa57d('0x0')](path['join'](cfg[_0xa57d('0x1')],_0xa57d('0x2')))};var pm2config={'apps':[{'name':_0xa57d('0x3'),'script':path[_0xa57d('0x4')](__dirname,_0xa57d('0x5')),'env':env},{'name':_0xa57d('0x6'),'script':path[_0xa57d('0x4')](__dirname,_0xa57d('0x7')),'env':env},{'name':_0xa57d('0x8'),'script':path[_0xa57d('0x4')](__dirname,_0xa57d('0x9')),'env':env},{'name':_0xa57d('0xa'),'script':path[_0xa57d('0x4')](__dirname,_0xa57d('0xb')),'env':env},{'name':'routing','script':path[_0xa57d('0x4')](__dirname,_0xa57d('0xc')),'env':env},{'name':_0xa57d('0xd'),'script':path['join'](__dirname,_0xa57d('0xe')),'env':env}]};module[_0xa57d('0xf')]=pm2config; \ No newline at end of file +var _0x00a8=['express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x00a8,0x176));var _0x800a=function(_0xb913d3,_0xb9dba6){_0xb913d3=_0xb913d3-0x0;var _0x540456=_0x00a8[_0xb913d3];return _0x540456;};'use strict';var path=require(_0x800a('0x0'));var cfg=require(_0x800a('0x1'));var env={'NODE_PATH':path[_0x800a('0x2')](path[_0x800a('0x3')](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':_0x800a('0x4'),'script':path[_0x800a('0x3')](__dirname,_0x800a('0x5')),'env':env},{'name':_0x800a('0x6'),'script':path[_0x800a('0x3')](__dirname,_0x800a('0x7')),'env':env},{'name':_0x800a('0x8'),'script':path['join'](__dirname,_0x800a('0x9')),'env':env},{'name':_0x800a('0xa'),'script':path[_0x800a('0x3')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x800a('0xb'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path['join'](__dirname,_0x800a('0xc')),'env':env}]};module[_0x800a('0xd')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index bb785e7..8cb976a 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 _0xa87d=['pm2','./config','connect','connected','start','disconnect','then','restart','list','describe','delete','dump','saved'];(function(_0x2fb56f,_0x3b089b){var _0x13c99d=function(_0x194277){while(--_0x194277){_0x2fb56f['push'](_0x2fb56f['shift']());}};_0x13c99d(++_0x3b089b);}(_0xa87d,0x15f));var _0xda87=function(_0x1b1058,_0xab1c26){_0x1b1058=_0x1b1058-0x0;var _0x2f19eb=_0xa87d[_0x1b1058];return _0x2f19eb;};'use strict';var pm2=require(_0xda87('0x0'));var BPromise=require('bluebird');var config=require(_0xda87('0x1'));function connect(){return new BPromise(function(_0x3fb4e0,_0x243757){return pm2[_0xda87('0x2')](function(_0x913854){if(_0x913854){return _0x243757(_0x913854);}return _0x3fb4e0(_0xda87('0x3'));});});};exports['start']=function(_0x281a91){return connect()['then'](function(){return new BPromise(function(_0x21f0fb,_0x5aa435){return pm2[_0xda87('0x4')](_0x281a91,function(_0xecb8dd,_0x27ab39){if(_0xecb8dd){return _0x5aa435(_0xecb8dd);}pm2[_0xda87('0x5')]();return _0x21f0fb(_0x27ab39);});});});};exports['stop']=function(_0x3613b3){return connect()[_0xda87('0x6')](function(){return new BPromise(function(_0xb6f96e,_0x268f51){return pm2['stop'](_0x3613b3,function(_0x88532,_0x48e077){if(_0x88532){return _0x268f51(_0x88532);}pm2[_0xda87('0x5')]();return _0xb6f96e(_0x48e077);});});});};exports[_0xda87('0x7')]=function(_0x4913cf){return connect()['then'](function(){return new BPromise(function(_0x320de2,_0x26b57f){return pm2[_0xda87('0x7')](_0x4913cf,function(_0x31c63a,_0x521a6f){if(_0x31c63a){return _0x26b57f(_0x31c63a);}pm2[_0xda87('0x5')]();return _0x320de2(_0x521a6f);});});});};exports[_0xda87('0x8')]=function(){return connect()[_0xda87('0x6')](function(){return new BPromise(function(_0x1e2216,_0x2585a2){return pm2[_0xda87('0x8')](function(_0x5237fd,_0x179338){if(_0x5237fd){return _0x2585a2(_0x5237fd);}pm2['disconnect']();return _0x1e2216(_0x179338);});});});};exports[_0xda87('0x9')]=function(_0x16b1fe){return connect()[_0xda87('0x6')](function(){return new BPromise(function(_0x48a9fa,_0x54e1ad){return pm2[_0xda87('0x9')](_0x16b1fe,function(_0x34eb1f,_0x5d3093){if(_0x34eb1f){return _0x54e1ad(_0x34eb1f);}pm2[_0xda87('0x5')]();return _0x48a9fa(_0x5d3093);});});});};exports[_0xda87('0xa')]=function(_0x36a03c){return connect()[_0xda87('0x6')](function(){return new BPromise(function(_0x1d6205,_0x257c4c){return pm2[_0xda87('0xa')](_0x36a03c,function(_0x3afabd,_0xd98c4b){if(_0x3afabd){return _0x257c4c(_0x3afabd);}pm2['disconnect']();return _0x1d6205(_0xd98c4b);});});});};exports[_0xda87('0xb')]=function(){return connect()[_0xda87('0x6')](function(){return new BPromise(function(_0x1905e9,_0x463bc9){return pm2[_0xda87('0xb')](function(_0x2b1cee){if(_0x2b1cee){return _0x463bc9(_0x2b1cee);}return _0x1905e9(_0xda87('0xc'));});});});}; \ No newline at end of file +var _0x3aee=['connected','start','then','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connect'];(function(_0x3ca7a9,_0x4fc0c7){var _0x399428=function(_0x3f30b2){while(--_0x3f30b2){_0x3ca7a9['push'](_0x3ca7a9['shift']());}};_0x399428(++_0x4fc0c7);}(_0x3aee,0x101));var _0xe3ae=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x3aee[_0x40df5f];return _0x1573f1;};'use strict';var pm2=require('pm2');var BPromise=require(_0xe3ae('0x0'));var config=require(_0xe3ae('0x1'));function connect(){return new BPromise(function(_0x33697b,_0x42195f){return pm2[_0xe3ae('0x2')](function(_0xaec1da){if(_0xaec1da){return _0x42195f(_0xaec1da);}return _0x33697b(_0xe3ae('0x3'));});});};exports[_0xe3ae('0x4')]=function(_0x372a29){return connect()[_0xe3ae('0x5')](function(){return new BPromise(function(_0x4b0c6c,_0x4d424e){return pm2[_0xe3ae('0x4')](_0x372a29,function(_0x191d0a,_0x143d7c){if(_0x191d0a){return _0x4d424e(_0x191d0a);}pm2[_0xe3ae('0x6')]();return _0x4b0c6c(_0x143d7c);});});});};exports['stop']=function(_0x4eef76){return connect()[_0xe3ae('0x5')](function(){return new BPromise(function(_0x357fc7,_0x33d02d){return pm2['stop'](_0x4eef76,function(_0x58af74,_0x281455){if(_0x58af74){return _0x33d02d(_0x58af74);}pm2[_0xe3ae('0x6')]();return _0x357fc7(_0x281455);});});});};exports['restart']=function(_0x4489b4){return connect()['then'](function(){return new BPromise(function(_0x3da0bc,_0x476107){return pm2[_0xe3ae('0x7')](_0x4489b4,function(_0x196038,_0x5c7b75){if(_0x196038){return _0x476107(_0x196038);}pm2[_0xe3ae('0x6')]();return _0x3da0bc(_0x5c7b75);});});});};exports[_0xe3ae('0x8')]=function(){return connect()[_0xe3ae('0x5')](function(){return new BPromise(function(_0x5d0e95,_0x2d5510){return pm2['list'](function(_0x269c0e,_0x4932ed){if(_0x269c0e){return _0x2d5510(_0x269c0e);}pm2[_0xe3ae('0x6')]();return _0x5d0e95(_0x4932ed);});});});};exports['describe']=function(_0x19bbd1){return connect()[_0xe3ae('0x5')](function(){return new BPromise(function(_0x2893da,_0x1972e9){return pm2[_0xe3ae('0x9')](_0x19bbd1,function(_0x140e45,_0x1956c3){if(_0x140e45){return _0x1972e9(_0x140e45);}pm2[_0xe3ae('0x6')]();return _0x2893da(_0x1956c3);});});});};exports[_0xe3ae('0xa')]=function(_0x30d56d){return connect()[_0xe3ae('0x5')](function(){return new BPromise(function(_0x25d954,_0x5c5c04){return pm2[_0xe3ae('0xa')](_0x30d56d,function(_0x4e196b,_0x4dd9df){if(_0x4e196b){return _0x5c5c04(_0x4e196b);}pm2['disconnect']();return _0x25d954(_0x4dd9df);});});});};exports[_0xe3ae('0xb')]=function(){return connect()[_0xe3ae('0x5')](function(){return new BPromise(function(_0x315bee,_0x33d5d9){return pm2['dump'](function(_0x18c73f){if(_0x18c73f){return _0x33d5d9(_0x18c73f);}return _0x315bee(_0xe3ae('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 00cea31..ac956c8 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 _0xa9e3=['ChatInteraction','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','Setting','find','chatTimeout','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e3,0xb9));var _0x3a9e=function(_0x196f0d,_0x4737cd){_0x196f0d=_0x196f0d-0x0;var _0x27dbe0=_0xa9e3[_0x196f0d];return _0x27dbe0;};'use strict';var _=require('lodash');var moment=require(_0x3a9e('0x0'));var Redis=require(_0x3a9e('0x1'));var util=require(_0x3a9e('0x2'));var config=require(_0x3a9e('0x3'));var db=require(_0x3a9e('0x4'))['db'];var logger=require(_0x3a9e('0x5'))(_0x3a9e('0x6'));config[_0x3a9e('0x7')]=_['defaults'](config[_0x3a9e('0x7')],{'host':_0x3a9e('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3a9e('0x7')]));function closeInteractions(){var _0x48af24=0x0;var _0x45b48d=[];return db[_0x3a9e('0x9')][_0x3a9e('0xa')]({'raw':!![],'attributes':['id',_0x3a9e('0xb')],'where':{'id':0x1}})[_0x3a9e('0xc')](function(_0x412c74){_0x48af24=_0x412c74[_0x3a9e('0xb')];if(_0x48af24){return db[_0x3a9e('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x3a9e('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3a9e('0xf')](_0x412c74[_0x3a9e('0xb')],_0x3a9e('0x10'))}}});}else{return[];}})['then'](function(_0x8a6636){if(_0x8a6636&&_0x8a6636[_0x3a9e('0x11')]){_0x45b48d=_['map'](_0x8a6636||[],'id');logger[_0x3a9e('0x12')](_0x3a9e('0x13'),_0x45b48d[_0x3a9e('0x14')]());return db[_0x3a9e('0xd')][_0x3a9e('0x15')]({'closeReason':_0x3a9e('0x16'),'disposition':_0x3a9e('0x17'),'closed':!![],'closedAt':moment()[_0x3a9e('0x18')](_0x3a9e('0x19'))},{'where':{'id':_0x45b48d}});}})[_0x3a9e('0xc')](function(){if(_0x45b48d&&_0x45b48d['length']){logger[_0x3a9e('0x12')](_0x3a9e('0x1a'),_0x45b48d[_0x3a9e('0x14')]());for(var _0x31903d=0x0;_0x31903d<_0x45b48d[_0x3a9e('0x11')];_0x31903d++){io['emit'](_0x3a9e('0x1b'),{'id':_0x45b48d[_0x31903d],'closed':!![]});}}})[_0x3a9e('0x1c')](function(_0x1d58a3){logger[_0x3a9e('0x1d')](_0x3a9e('0x1e'),_0x1d58a3?util[_0x3a9e('0x1f')](_0x1d58a3,{'showHidden':![],'depth':null}):'');});}exports[_0x3a9e('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x2858=['catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','util','../../config/environment','../logger','schedule','redis','defaults','localhost','find','ChatInteraction','subtract','chatTimeout','minutes','length','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update'];(function(_0x8fb231,_0x3a2606){var _0x14f30a=function(_0x471e24){while(--_0x471e24){_0x8fb231['push'](_0x8fb231['shift']());}};_0x14f30a(++_0x3a2606);}(_0x2858,0x170));var _0x8285=function(_0x489288,_0x22e937){_0x489288=_0x489288-0x0;var _0x4a1103=_0x2858[_0x489288];return _0x4a1103;};'use strict';var _=require(_0x8285('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x8285('0x1'));var config=require(_0x8285('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x8285('0x3'))(_0x8285('0x4'));config[_0x8285('0x5')]=_[_0x8285('0x6')](config['redis'],{'host':_0x8285('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8285('0x5')]));function closeInteractions(){var _0x1f643c=0x0;var _0x41a07b=[];return db['Setting'][_0x8285('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x30e1c1){_0x1f643c=_0x30e1c1['chatTimeout'];if(_0x1f643c){return db[_0x8285('0x9')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x8285('0xa')](_0x30e1c1[_0x8285('0xb')],_0x8285('0xc'))}}});}else{return[];}})['then'](function(_0x3f6290){if(_0x3f6290&&_0x3f6290[_0x8285('0xd')]){_0x41a07b=_['map'](_0x3f6290||[],'id');logger[_0x8285('0xe')]('[CHAT]\x20Interactions\x20to\x20close:',_0x41a07b[_0x8285('0xf')]());return db[_0x8285('0x9')][_0x8285('0x10')]({'closeReason':_0x8285('0x11'),'disposition':_0x8285('0x12'),'closed':!![],'closedAt':moment()[_0x8285('0x13')](_0x8285('0x14'))},{'where':{'id':_0x41a07b}});}})[_0x8285('0x15')](function(){if(_0x41a07b&&_0x41a07b[_0x8285('0xd')]){logger[_0x8285('0xe')](_0x8285('0x16'),_0x41a07b['join']());for(var _0x3b06f5=0x0;_0x3b06f5<_0x41a07b[_0x8285('0xd')];_0x3b06f5++){io['emit'](_0x8285('0x17'),{'id':_0x41a07b[_0x3b06f5],'closed':!![]});}}})[_0x8285('0x18')](function(_0x17cf90){logger[_0x8285('0x19')](_0x8285('0x1a'),_0x17cf90?util[_0x8285('0x1b')](_0x17cf90,{'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 4df72cd..206c72d 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 _0xaba2=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x499e14,_0x1874c9){var _0x5a7f64=function(_0x17b622){while(--_0x17b622){_0x499e14['push'](_0x499e14['shift']());}};_0x5a7f64(++_0x1874c9);}(_0xaba2,0xb1));var _0x2aba=function(_0x563ed2,_0x4bceea){_0x563ed2=_0x563ed2-0x0;var _0x30925b=_0xaba2[_0x563ed2];return _0x30925b;};'use strict';function start(){var _0x1bc4bc=require(_0x2aba('0x0'));return _0x1bc4bc[_0x2aba('0x1')]();}module[_0x2aba('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xa76d=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x383c94,_0x2c7402){var _0x149b61=function(_0x33dac0){while(--_0x33dac0){_0x383c94['push'](_0x383c94['shift']());}};_0x149b61(++_0x2c7402);}(_0xa76d,0x15f));var _0xda76=function(_0x29d846,_0x1ee82d){_0x29d846=_0x29d846-0x0;var _0x2558ac=_0xa76d[_0x29d846];return _0x2558ac;};'use strict';function start(){var _0x5f5de0=require(_0xda76('0x0'));return _0x5f5de0['startAllRefreshIntervals']();}module[_0xda76('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 07e537e..fd24ca3 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 _0x7d0e=['run\x20job','active','endAt','add','cron','start','add\x20cron','deleteJob','stop\x20cron','startAt','update','run','util','path','lodash','moment','cron-job-manager','bluebird','schedule','../../mysqldb','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','user','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','email\x20sent','error\x20mail','stringify','Smtp','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','length','exists','stop','delete\x20cron','toRun','my\x20id','resolve'];(function(_0x464d42,_0x4f1d09){var _0x1483d3=function(_0x3061eb){while(--_0x3061eb){_0x464d42['push'](_0x464d42['shift']());}};_0x1483d3(++_0x4f1d09);}(_0x7d0e,0xb2));var _0xe7d0=function(_0x3299b6,_0x35855f){_0x3299b6=_0x3299b6-0x0;var _0x412d13=_0x7d0e[_0x3299b6];return _0x412d13;};'use strict';var fs=require('fs');var util=require(_0xe7d0('0x0'));var path=require(_0xe7d0('0x1'));var _=require(_0xe7d0('0x2'));var moment=require(_0xe7d0('0x3'));var CronJobManager=require(_0xe7d0('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0xe7d0('0x5'));var logger=require('../logger')(_0xe7d0('0x6'));var db=require(_0xe7d0('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xe7d0('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x52bcf9,_0x5d9478){return function(){logger[_0xe7d0('0x9')](_0xe7d0('0xa'),_0x52bcf9[_0xe7d0('0xb')]);var _0x376624=!![];var _0x192e21=_0x52bcf9[_0xe7d0('0xc')][_0xe7d0('0xd')]();var _0x27474e={'account':_0x192e21,'message':{'from':util['format'](_0xe7d0('0xe'),_0x52bcf9[_0xe7d0('0xc')][_0xe7d0('0xf')],_0x52bcf9[_0xe7d0('0xc')][_0xe7d0('0xb')]||_0x52bcf9[_0xe7d0('0xc')]['Smtp'][_0xe7d0('0x10')]),'to':_0x52bcf9[_0xe7d0('0xb')],'cc':_0x52bcf9['cc'],'bcc':_0x52bcf9['bcc'],'subject':util[_0xe7d0('0x11')](_0xe7d0('0x12'),_0x5d9478[_0xe7d0('0xf')],_0x52bcf9[_0xe7d0('0x13')],_0x52bcf9[_0xe7d0('0x14')])}};var _0x366aef=path[_0xe7d0('0x15')](__dirname,'../../files/reports');var _0x1ae724=_0x5d9478[_0xe7d0('0x16')];var _0x3bb723=util['format'](_0xe7d0('0x17'),path['basename'](_0x5d9478[_0xe7d0('0x16')],path[_0xe7d0('0x18')](_0x5d9478['savename'])),_0xe7d0('0x19'));var _0xb0a650=path[_0xe7d0('0x15')](_0x366aef,_0x1ae724);var _0x578e75=path['join'](_0x366aef,_0x3bb723);if(fs[_0xe7d0('0x1a')](_0xb0a650)){_0x5d9478[_0xe7d0('0x1b')]=_0xe7d0('0x1c');_0x27474e[_0xe7d0('0x1d')][_0xe7d0('0x1e')]=[{'filename':_0x1ae724,'path':_0xb0a650}];_0x27474e['message'][_0xe7d0('0x1f')]=util[_0xe7d0('0x11')](_0xe7d0('0x20'),JSON['stringify'](_0x5d9478,null,0x2));}else if(fs[_0xe7d0('0x1a')](_0x578e75)){_0x5d9478[_0xe7d0('0x1b')]=_0xe7d0('0x1c');_0x27474e[_0xe7d0('0x1d')]['attachments']=[{'filename':_0x3bb723,'path':_0x578e75}];}else{_0x27474e['message']['text']=_0xe7d0('0x21');if(!_0x52bcf9[_0xe7d0('0x22')]){_0x376624=![];logger[_0xe7d0('0x9')](_0xe7d0('0x23'));}}if(_0x376624){return client[_0xe7d0('0x24')](_0xe7d0('0x25'),_0x27474e)['then'](function(_0x40e12b){if(_0x40e12b[_0xe7d0('0x26')]){return logger[_0xe7d0('0x26')]('error\x20mail',JSON['stringify'](_0x40e12b));}return logger[_0xe7d0('0x9')](_0xe7d0('0x27'));})['catch'](function(_0x197b08){return logger[_0xe7d0('0x26')](_0xe7d0('0x28'),JSON['stringify'](_0x197b08));});}};}function handleError(){return function(_0x339e94){return logger[_0xe7d0('0x26')](JSON['stringify'](_0x339e94));};}function handleResult(_0x59a890){return function(_0x3d4384){logger[_0xe7d0('0x9')]('data',JSON[_0xe7d0('0x29')](_0x3d4384));if(_0x59a890[_0xe7d0('0xc')]&&_0x59a890[_0xe7d0('0xc')][_0xe7d0('0x2a')]&&!_[_0xe7d0('0x2b')](_0x59a890[_0xe7d0('0xb')])){setTimeout(handleSendEmail(_0x59a890,_0x3d4384),0x3c*0x3e8);}};}function handleJob(_0x4faa5b){return function(){try{if(_[_0xe7d0('0x2b')](_0x4faa5b['subtractNumber'])){return logger[_0xe7d0('0x9')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe7d0('0x2b')](_0x4faa5b['subtractUnit'])){return logger[_0xe7d0('0x9')](_0xe7d0('0x2c'));}var _0x192248={'startDate':moment()['subtract'](_0x4faa5b['subtractNumber'],_0x4faa5b['subtractUnit'])[_0xe7d0('0x11')](_0xe7d0('0x2d')),'endDate':moment()[_0xe7d0('0x11')](_0xe7d0('0x2d')),'type':'scheduled','output':_0x4faa5b[_0xe7d0('0x2e')],'name':_0x4faa5b['name']};if(!_['isNil'](_0x4faa5b['DefaultReportId'])){logger['info'](_0xe7d0('0x2f'),_0x4faa5b[_0xe7d0('0x30')]);return analyticDefaultReportController[_0xe7d0('0x31')]({'id':_0x4faa5b[_0xe7d0('0x30')]},_0x192248)[_0xe7d0('0x32')](handleResult(_0x4faa5b))[_0xe7d0('0x33')](handleError());}if(!_[_0xe7d0('0x2b')](_0x4faa5b[_0xe7d0('0x34')])){logger[_0xe7d0('0x9')](_0xe7d0('0x35'),_0x4faa5b[_0xe7d0('0x34')]);return analyticCustomReportController[_0xe7d0('0x31')]({'id':_0x4faa5b[_0xe7d0('0x34')]},_0x192248)[_0xe7d0('0x32')](handleResult(_0x4faa5b))[_0xe7d0('0x33')](handleError());}}catch(_0x36a7de){logger[_0xe7d0('0x26')](JSON[_0xe7d0('0x29')](_0x36a7de));}return logger[_0xe7d0('0x9')](_0xe7d0('0x36'));};}function getJobs(_0x43f2da){var _0xcf8d14={};if(_0x43f2da){_0xcf8d14['id']=_0x43f2da;}return db['Schedule'][_0xe7d0('0x37')]({'where':_0xcf8d14,'include':[{'model':db['MailAccount'],'attributes':['id',_0xe7d0('0xf'),_0xe7d0('0xb')],'include':[{'model':db[_0xe7d0('0x38')],'as':_0xe7d0('0x2a'),'include':[{'model':db[_0xe7d0('0x39')],'as':_0xe7d0('0x39')}]}]}]})[_0xe7d0('0x32')](function(_0x3a12d8){var _0xbe022d=_[_0xe7d0('0x3a')](manager[_0xe7d0('0x3b')]);var _0x53b9ca=_[_0xe7d0('0x3c')](_0x3a12d8,function(_0x2eead9){return _0x2eead9['id'][_0xe7d0('0x3d')]();});var _0x577d38=_[_0xe7d0('0x3e')](_0x3a12d8,function(_0x224294){return _0x224294['id'][_0xe7d0('0x3d')]();});var _0x1b4b91=_0x43f2da?_0x53b9ca:_['difference'](_0x53b9ca,_0xbe022d);var _0x153ea3=_['intersection'](_0x53b9ca,_0xbe022d);var _0x451cb1=_[_0xe7d0('0x3f')](_0xbe022d,_0x53b9ca);var _0x38dcce;var _0x389159;for(_0x38dcce=0x0;_0x38dcce<_0x451cb1[_0xe7d0('0x40')]&&!_0x43f2da;_0x38dcce+=0x1){_0x389159=_0x451cb1[_0x38dcce][_0xe7d0('0x3d')]();if(manager[_0xe7d0('0x41')](_0x389159)){manager[_0xe7d0('0x42')](_0x389159);manager['deleteJob'](_0x389159);logger[_0xe7d0('0x9')](_0xe7d0('0x43'),_0x389159);}}logger[_0xe7d0('0x9')](_0xe7d0('0x44'),JSON[_0xe7d0('0x29')](_0x1b4b91));for(_0x38dcce=0x0;_0x38dcce<_0x1b4b91[_0xe7d0('0x40')];_0x38dcce+=0x1){_0x389159=_0x1b4b91[_0x38dcce][_0xe7d0('0x3d')]();logger[_0xe7d0('0x9')]('index',_0x389159);if(_0x43f2da){logger[_0xe7d0('0x9')](_0xe7d0('0x45'),_0x43f2da);logger[_0xe7d0('0x9')](JSON[_0xe7d0('0x29')](_0x577d38[_0x389159]));BPromise[_0xe7d0('0x46')]()[_0xe7d0('0x32')](handleJob(_0x577d38[_0x389159]));logger[_0xe7d0('0x9')](_0xe7d0('0x47'),_0x577d38[_0x389159][_0xe7d0('0xf')],_0x577d38[_0x389159]['cron']);}else if(_0x577d38[_0x389159]['cron']&&_0x577d38[_0x389159][_0xe7d0('0x48')]&&moment()['isBetween'](_0x577d38[_0x389159]['startAt'],_0x577d38[_0x389159][_0xe7d0('0x49')])){manager[_0xe7d0('0x4a')](_0x389159,_0x577d38[_0x389159][_0xe7d0('0x4b')],handleJob(_0x577d38[_0x389159]));manager[_0xe7d0('0x4c')](_0x389159);logger[_0xe7d0('0x9')](_0xe7d0('0x4d'),_0x577d38[_0x389159][_0xe7d0('0xf')],_0x577d38[_0x389159][_0xe7d0('0x4b')]);}else if(manager[_0xe7d0('0x41')](_0x389159)){manager[_0xe7d0('0x42')](_0x389159);manager[_0xe7d0('0x4e')](_0x389159);logger[_0xe7d0('0x9')](_0xe7d0('0x4f'),_0x577d38[_0x389159][_0xe7d0('0xf')],_0x577d38[_0x389159]['cron']);}}for(_0x38dcce=0x0,_0x389159;_0x38dcce<_0x153ea3['length']&&!_0x43f2da;_0x38dcce+=0x1){_0x389159=_0x153ea3[_0x38dcce][_0xe7d0('0x3d')]();if(manager[_0xe7d0('0x41')](_0x389159)){if(_0x577d38[_0x389159][_0xe7d0('0x4b')]&&_0x577d38[_0x389159][_0xe7d0('0x48')]&&moment()['isBetween'](_0x577d38[_0x389159][_0xe7d0('0x50')],_0x577d38[_0x389159][_0xe7d0('0x49')])){manager[_0xe7d0('0x51')](_0x389159,_0x577d38[_0x389159][_0xe7d0('0x4b')],handleJob(_0x577d38[_0x389159]));logger[_0xe7d0('0x9')]('update\x20cron',_0x577d38[_0x389159][_0xe7d0('0xf')],_0x577d38[_0x389159][_0xe7d0('0x4b')]);}else{manager['stop'](_0x389159);manager[_0xe7d0('0x4e')](_0x389159);logger[_0xe7d0('0x9')](_0xe7d0('0x4f'),_0x577d38[_0x389159]['name'],_0x577d38[_0x389159][_0xe7d0('0x4b')]);}}}})[_0xe7d0('0x33')](function(_0x4f8fec){logger['error'](JSON[_0xe7d0('0x29')](_0x4f8fec));});}exports[_0xe7d0('0x52')]=function(_0x366a27){return getJobs(_0x366a27);};exports[_0xe7d0('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x8e76=['cron','start','add\x20cron','exists','stop','stop\x20cron','endAt','update','update\x20cron','run','util','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','\x22%s\x22\x20<%s>','name','email','Smtp','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','existsSync','Sent','message','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','difference','intersection','length','deleteJob','index','my\x20id','resolve','run\x20job','active','isBetween','startAt','add'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0x8e76,0xf7));var _0x68e7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8e76[_0x432682];return _0x463d05;};'use strict';var fs=require('fs');var util=require(_0x68e7('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0x68e7('0x1'));var CronJobManager=require(_0x68e7('0x2'));var jayson=require(_0x68e7('0x3'));var BPromise=require(_0x68e7('0x4'));var logger=require(_0x68e7('0x5'))(_0x68e7('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x68e7('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x68e7('0x8')][_0x68e7('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3a2540,_0x38922f){return function(){logger[_0x68e7('0xa')](_0x68e7('0xb'),_0x3a2540['email']);var _0x1b9c1b=!![];var _0x5687b9=_0x3a2540[_0x68e7('0xc')]['getSmtpOptions']();var _0x16fa1f={'account':_0x5687b9,'message':{'from':util['format'](_0x68e7('0xd'),_0x3a2540['MailAccount'][_0x68e7('0xe')],_0x3a2540['MailAccount'][_0x68e7('0xf')]||_0x3a2540[_0x68e7('0xc')][_0x68e7('0x10')][_0x68e7('0x11')]),'to':_0x3a2540[_0x68e7('0xf')],'cc':_0x3a2540['cc'],'bcc':_0x3a2540[_0x68e7('0x12')],'subject':util[_0x68e7('0x13')](_0x68e7('0x14'),_0x38922f[_0x68e7('0xe')],_0x3a2540[_0x68e7('0x15')],_0x3a2540[_0x68e7('0x16')])}};var _0x36834b=path[_0x68e7('0x17')](__dirname,_0x68e7('0x18'));var _0x44e8b3=_0x38922f[_0x68e7('0x19')];var _0x27b6d7=util['format']('%s.%s',path[_0x68e7('0x1a')](_0x38922f[_0x68e7('0x19')],path[_0x68e7('0x1b')](_0x38922f[_0x68e7('0x19')])),'zip');var _0x59261d=path[_0x68e7('0x17')](_0x36834b,_0x44e8b3);var _0x22f14d=path['join'](_0x36834b,_0x27b6d7);if(fs[_0x68e7('0x1c')](_0x59261d)){_0x38922f['status']=_0x68e7('0x1d');_0x16fa1f[_0x68e7('0x1e')]['attachments']=[{'filename':_0x44e8b3,'path':_0x59261d}];_0x16fa1f[_0x68e7('0x1e')][_0x68e7('0x1f')]=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[_0x68e7('0x20')](_0x38922f,null,0x2));}else if(fs[_0x68e7('0x1c')](_0x22f14d)){_0x38922f['status']='Sent';_0x16fa1f['message']['attachments']=[{'filename':_0x27b6d7,'path':_0x22f14d}];}else{_0x16fa1f[_0x68e7('0x1e')]['text']=_0x68e7('0x21');if(!_0x3a2540['sendIfEmpty']){_0x1b9c1b=![];logger[_0x68e7('0xa')](_0x68e7('0x22'));}}if(_0x1b9c1b){return client[_0x68e7('0x23')]('SendMail',_0x16fa1f)[_0x68e7('0x24')](function(_0x18c8da){if(_0x18c8da[_0x68e7('0x25')]){return logger[_0x68e7('0x25')](_0x68e7('0x26'),JSON[_0x68e7('0x20')](_0x18c8da));}return logger[_0x68e7('0xa')]('email\x20sent');})[_0x68e7('0x27')](function(_0x28edbc){return logger[_0x68e7('0x25')](_0x68e7('0x26'),JSON[_0x68e7('0x20')](_0x28edbc));});}};}function handleError(){return function(_0x559b00){return logger['error'](JSON[_0x68e7('0x20')](_0x559b00));};}function handleResult(_0x14e800){return function(_0x5ac624){logger['info']('data',JSON[_0x68e7('0x20')](_0x5ac624));if(_0x14e800[_0x68e7('0xc')]&&_0x14e800[_0x68e7('0xc')][_0x68e7('0x10')]&&!_['isNil'](_0x14e800[_0x68e7('0xf')])){setTimeout(handleSendEmail(_0x14e800,_0x5ac624),0x3c*0x3e8);}};}function handleJob(_0x514494){return function(){try{if(_[_0x68e7('0x28')](_0x514494[_0x68e7('0x15')])){return logger['info'](_0x68e7('0x29'));}if(_['isNil'](_0x514494[_0x68e7('0x16')])){return logger[_0x68e7('0xa')](_0x68e7('0x2a'));}var _0x1cd248={'startDate':moment()[_0x68e7('0x2b')](_0x514494[_0x68e7('0x15')],_0x514494[_0x68e7('0x16')])[_0x68e7('0x13')](_0x68e7('0x2c')),'endDate':moment()[_0x68e7('0x13')](_0x68e7('0x2c')),'type':'scheduled','output':_0x514494[_0x68e7('0x2d')],'name':_0x514494['name']};if(!_[_0x68e7('0x28')](_0x514494[_0x68e7('0x2e')])){logger[_0x68e7('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x514494[_0x68e7('0x2e')]);return analyticDefaultReportController[_0x68e7('0x2f')]({'id':_0x514494[_0x68e7('0x2e')]},_0x1cd248)[_0x68e7('0x24')](handleResult(_0x514494))[_0x68e7('0x27')](handleError());}if(!_[_0x68e7('0x28')](_0x514494[_0x68e7('0x30')])){logger[_0x68e7('0xa')]('exec\x20custom\x20report\x20id:%s',_0x514494[_0x68e7('0x30')]);return analyticCustomReportController[_0x68e7('0x2f')]({'id':_0x514494[_0x68e7('0x30')]},_0x1cd248)['then'](handleResult(_0x514494))[_0x68e7('0x27')](handleError());}}catch(_0x2e13c8){logger[_0x68e7('0x25')](JSON[_0x68e7('0x20')](_0x2e13c8));}return logger[_0x68e7('0xa')](_0x68e7('0x31'));};}function getJobs(_0x3687c3){var _0x599a27={};if(_0x3687c3){_0x599a27['id']=_0x3687c3;}return db[_0x68e7('0x32')][_0x68e7('0x33')]({'where':_0x599a27,'include':[{'model':db[_0x68e7('0xc')],'attributes':['id','name','email'],'include':[{'model':db[_0x68e7('0x34')],'as':_0x68e7('0x10'),'include':[{'model':db[_0x68e7('0x35')],'as':'CloudProvider'}]}]}]})['then'](function(_0x1bdf65){var _0x45835e=_[_0x68e7('0x36')](manager['jobs']);var _0x393bf3=_[_0x68e7('0x37')](_0x1bdf65,function(_0x35afd2){return _0x35afd2['id'][_0x68e7('0x38')]();});var _0x12f261=_['keyBy'](_0x1bdf65,function(_0x387982){return _0x387982['id']['toString']();});var _0xa45f1e=_0x3687c3?_0x393bf3:_[_0x68e7('0x39')](_0x393bf3,_0x45835e);var _0x23fc2f=_[_0x68e7('0x3a')](_0x393bf3,_0x45835e);var _0x509363=_[_0x68e7('0x39')](_0x45835e,_0x393bf3);var _0x4e564e;var _0x35ea5d;for(_0x4e564e=0x0;_0x4e564e<_0x509363[_0x68e7('0x3b')]&&!_0x3687c3;_0x4e564e+=0x1){_0x35ea5d=_0x509363[_0x4e564e][_0x68e7('0x38')]();if(manager['exists'](_0x35ea5d)){manager['stop'](_0x35ea5d);manager[_0x68e7('0x3c')](_0x35ea5d);logger['info']('delete\x20cron',_0x35ea5d);}}logger[_0x68e7('0xa')]('toRun',JSON[_0x68e7('0x20')](_0xa45f1e));for(_0x4e564e=0x0;_0x4e564e<_0xa45f1e[_0x68e7('0x3b')];_0x4e564e+=0x1){_0x35ea5d=_0xa45f1e[_0x4e564e][_0x68e7('0x38')]();logger[_0x68e7('0xa')](_0x68e7('0x3d'),_0x35ea5d);if(_0x3687c3){logger[_0x68e7('0xa')](_0x68e7('0x3e'),_0x3687c3);logger[_0x68e7('0xa')](JSON[_0x68e7('0x20')](_0x12f261[_0x35ea5d]));BPromise[_0x68e7('0x3f')]()[_0x68e7('0x24')](handleJob(_0x12f261[_0x35ea5d]));logger[_0x68e7('0xa')](_0x68e7('0x40'),_0x12f261[_0x35ea5d][_0x68e7('0xe')],_0x12f261[_0x35ea5d]['cron']);}else if(_0x12f261[_0x35ea5d]['cron']&&_0x12f261[_0x35ea5d][_0x68e7('0x41')]&&moment()[_0x68e7('0x42')](_0x12f261[_0x35ea5d][_0x68e7('0x43')],_0x12f261[_0x35ea5d]['endAt'])){manager[_0x68e7('0x44')](_0x35ea5d,_0x12f261[_0x35ea5d][_0x68e7('0x45')],handleJob(_0x12f261[_0x35ea5d]));manager[_0x68e7('0x46')](_0x35ea5d);logger['info'](_0x68e7('0x47'),_0x12f261[_0x35ea5d][_0x68e7('0xe')],_0x12f261[_0x35ea5d][_0x68e7('0x45')]);}else if(manager[_0x68e7('0x48')](_0x35ea5d)){manager[_0x68e7('0x49')](_0x35ea5d);manager[_0x68e7('0x3c')](_0x35ea5d);logger[_0x68e7('0xa')](_0x68e7('0x4a'),_0x12f261[_0x35ea5d][_0x68e7('0xe')],_0x12f261[_0x35ea5d][_0x68e7('0x45')]);}}for(_0x4e564e=0x0,_0x35ea5d;_0x4e564e<_0x23fc2f[_0x68e7('0x3b')]&&!_0x3687c3;_0x4e564e+=0x1){_0x35ea5d=_0x23fc2f[_0x4e564e]['toString']();if(manager[_0x68e7('0x48')](_0x35ea5d)){if(_0x12f261[_0x35ea5d][_0x68e7('0x45')]&&_0x12f261[_0x35ea5d][_0x68e7('0x41')]&&moment()[_0x68e7('0x42')](_0x12f261[_0x35ea5d][_0x68e7('0x43')],_0x12f261[_0x35ea5d][_0x68e7('0x4b')])){manager[_0x68e7('0x4c')](_0x35ea5d,_0x12f261[_0x35ea5d][_0x68e7('0x45')],handleJob(_0x12f261[_0x35ea5d]));logger[_0x68e7('0xa')](_0x68e7('0x4d'),_0x12f261[_0x35ea5d][_0x68e7('0xe')],_0x12f261[_0x35ea5d][_0x68e7('0x45')]);}else{manager[_0x68e7('0x49')](_0x35ea5d);manager[_0x68e7('0x3c')](_0x35ea5d);logger[_0x68e7('0xa')](_0x68e7('0x4a'),_0x12f261[_0x35ea5d][_0x68e7('0xe')],_0x12f261[_0x35ea5d][_0x68e7('0x45')]);}}}})[_0x68e7('0x27')](function(_0x5b91f2){logger[_0x68e7('0x25')](JSON[_0x68e7('0x20')](_0x5b91f2));});}exports[_0x68e7('0x4e')]=function(_0x4295fb){return getJobs(_0x4295fb);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 51567ea..bd2739f 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 _0x85ed=['[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','Transcript\x20not\x20available','CloudProvider','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','getTranscriptionJob','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','sentimentAccountId','language','bucket','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','SentimentScore','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason'];(function(_0xe80e5c,_0x38e90a){var _0x2bff61=function(_0x29203e){while(--_0x29203e){_0xe80e5c['push'](_0xe80e5c['shift']());}};_0x2bff61(++_0x38e90a);}(_0x85ed,0x66));var _0xd85e=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x85ed[_0x1203f];return _0x365f0a;};var _=require(_0xd85e('0x0'));var AWS=require(_0xd85e('0x1'));var rp=require(_0xd85e('0x2'));var util=require(_0xd85e('0x3'));var BPromise=require(_0xd85e('0x4'));var db=require(_0xd85e('0x5'))['db'];var logger=require(_0xd85e('0x6'))('transcribe');function getTranscriptionJob(_0x22288b,_0x92cbf0,_0x1ae993,_0x237310){return new Promise(function(_0x4decab,_0x442772){var _0x3c4c19=new AWS['TranscribeService']({'accessKeyId':_0x92cbf0,'secretAccessKey':_0x22288b,'region':_0x1ae993});_0x3c4c19[_0xd85e('0x7')]({'TranscriptionJobName':_0x237310},function(_0x1a24bc,_0xa3c64a){if(_0x1a24bc){return _0x442772(_0x1a24bc);}else{return _0x4decab(_0xa3c64a);}});});}function sentiment(_0x4596ef,_0x5b8374,_0x3492d6,_0x2dbcc8,_0x18013f){return new Promise(function(_0x16c1e9,_0x4673ac){var _0x17a72=new AWS['Comprehend']({'accessKeyId':_0x5b8374,'secretAccessKey':_0x4596ef,'region':_0x3492d6});_0x17a72[_0xd85e('0x8')]({'Text':_0x2dbcc8,'LanguageCode':_0x18013f['substring'](0x0,0x2)},function(_0x491253,_0x3c128f){if(_0x491253){return _0x4673ac(_0x491253);}else{return _0x16c1e9(_0x3c128f);}});});}function checkTranscribeJob(_0x370f70,_0x5e9b20,_0x374652){var _0x7d5918;return new BPromise(function(_0x3fcc31,_0x4afee1){logger[_0xd85e('0x9')](util[_0xd85e('0xa')](_0xd85e('0xb'),_0x370f70['id'],_0x370f70[_0xd85e('0xc')]));return getTranscriptionJob(_0x374652[_0xd85e('0xd')],_0x374652['data2'],_0x5e9b20[_0xd85e('0xe')],_0x370f70['transcribeName'])[_0xd85e('0xf')](function(_0x3123a3){logger[_0xd85e('0x9')](util['format'](_0xd85e('0x10'),_0x370f70['id'],_0x370f70[_0xd85e('0xc')],_0x3123a3['TranscriptionJob'][_0xd85e('0x11')]));if(!_0x370f70[_0xd85e('0x12')]){switch(_0x3123a3[_0xd85e('0x13')]['TranscriptionJobStatus']){case _0xd85e('0x14'):var _0x400f86={'transcribeStatus':_0x3123a3[_0xd85e('0x13')][_0xd85e('0x11')],'fileUri':_0x3123a3[_0xd85e('0x13')][_0xd85e('0x15')][_0xd85e('0x16')]};logger[_0xd85e('0x9')](util[_0xd85e('0xa')](_0xd85e('0x17'),_0x370f70['id']));return rp({'uri':_0x3123a3['TranscriptionJob'][_0xd85e('0x15')][_0xd85e('0x16')],'json':!![]})[_0xd85e('0xf')](function(_0x2ef958){logger[_0xd85e('0x9')](util['format'](_0xd85e('0x18'),_0x370f70['id']));if(_0x2ef958&&_0x2ef958[_0xd85e('0x19')]&&_0x2ef958[_0xd85e('0x19')]['transcripts']&&_0x2ef958[_0xd85e('0x19')][_0xd85e('0x1a')][_0xd85e('0x1b')]){_0x400f86[_0xd85e('0x12')]='';for(var _0x26e64a=0x0;_0x26e64a<_0x2ef958[_0xd85e('0x19')]['transcripts'][_0xd85e('0x1b')];_0x26e64a++){_0x400f86[_0xd85e('0x12')]+=_0x2ef958[_0xd85e('0x19')][_0xd85e('0x1a')][_0x26e64a][_0xd85e('0x1c')]+'';}}return _0x370f70[_0xd85e('0x1d')](_0x400f86);})[_0xd85e('0xf')](function(){logger[_0xd85e('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x370f70['id']));if(!_0x370f70[_0xd85e('0x1e')]){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5e9b20['sentiment']||!_0x5e9b20[_0xd85e('0x21')]||!_0x5e9b20['sentimentRegion']||!_0x5e9b20[_0xd85e('0x22')]||!_0x5e9b20[_0xd85e('0x23')]){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x400f86['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x5e9b20['sentimentAccountId']===_0x374652['id']){return _0x374652;}else{return db['CloudProvider'][_0xd85e('0x24')]({'where':{'id':_settings[_0xd85e('0x21')]}});}})[_0xd85e('0xf')](function(_0x483354){if(!_0x483354){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))](_0xd85e('0x25'));}if(!_0x483354[_0xd85e('0xd')]||!_0x483354['data2']){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))](_0xd85e('0x26'));}_0x7d5918=_0x483354;logger[_0xd85e('0x9')](util[_0xd85e('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x370f70['id']));return sentiment(_0x7d5918[_0xd85e('0xd')],_0x7d5918['data2'],_0x5e9b20['sentimentRegion'],_0x400f86[_0xd85e('0x12')],_0x5e9b20[_0xd85e('0x22')]);})[_0xd85e('0xf')](function(_0x4fc947){logger['info'](util[_0xd85e('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x370f70['id']));return _0x370f70[_0xd85e('0x1d')]({'sentiment':_0x4fc947['Sentiment'],'sPositive':_0x4fc947['SentimentScore'][_0xd85e('0x27')],'sNegative':_0x4fc947[_0xd85e('0x28')]['Negative'],'sMixed':_0x4fc947[_0xd85e('0x28')][_0xd85e('0x29')],'sNeutral':_0x4fc947[_0xd85e('0x28')][_0xd85e('0x2a')]});})[_0xd85e('0xf')](function(){logger[_0xd85e('0x9')](util[_0xd85e('0xa')](_0xd85e('0x2b'),_0x370f70['id']));_0x3fcc31();});case _0xd85e('0x2c'):return _0x370f70[_0xd85e('0x1d')]({'transcribeStatus':_0xd85e('0x2c'),'failureReason':_0x3123a3[_0xd85e('0x13')][_0xd85e('0x2d')]})[_0xd85e('0xf')](function(){logger['info'](util[_0xd85e('0xa')](_0xd85e('0x2b'),_0x370f70['id']));_0x3fcc31();});default:logger[_0xd85e('0x9')](util[_0xd85e('0xa')](_0xd85e('0x2e'),_0x370f70['id']));break;}}else{return BPromise[_0xd85e('0x2f')]()[_0xd85e('0xf')](function(){if(!_0x370f70[_0xd85e('0x1e')]){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))](_0xd85e('0x30'));}if(!_0x5e9b20[_0xd85e('0x31')]||!_0x5e9b20[_0xd85e('0x21')]||!_0x5e9b20[_0xd85e('0x32')]||!_0x5e9b20['language']||!_0x5e9b20[_0xd85e('0x23')]){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x370f70['fileText']){throw new Error(_0xd85e('0x33'));}if(_0x5e9b20[_0xd85e('0x21')]===_0x374652['id']){return _0x374652;}else{return db[_0xd85e('0x34')]['findOne']({'where':{'id':_settings[_0xd85e('0x21')]}});}})[_0xd85e('0xf')](function(_0x174d2a){if(!_0x174d2a){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))](_0xd85e('0x25'));}if(!_0x174d2a[_0xd85e('0xd')]||!_0x174d2a[_0xd85e('0x35')]){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x7d5918=_0x174d2a;logger[_0xd85e('0x9')](util['format'](_0xd85e('0x36'),_0x370f70['id']));return sentiment(_0x7d5918[_0xd85e('0xd')],_0x7d5918[_0xd85e('0x35')],_0x5e9b20[_0xd85e('0x32')],_0x370f70[_0xd85e('0x12')],_0x5e9b20[_0xd85e('0x22')]);})[_0xd85e('0xf')](function(_0x20f31f){logger[_0xd85e('0x9')](util[_0xd85e('0xa')](_0xd85e('0x37'),_0x370f70['id']));return _0x370f70['update']({'sentiment':_0x20f31f['Sentiment'],'sPositive':_0x20f31f[_0xd85e('0x28')][_0xd85e('0x27')],'sNegative':_0x20f31f[_0xd85e('0x28')][_0xd85e('0x38')],'sMixed':_0x20f31f[_0xd85e('0x28')]['Mixed'],'sNeutral':_0x20f31f['SentimentScore'][_0xd85e('0x2a')],'transcribeStatus':_0xd85e('0x14')});})[_0xd85e('0xf')](function(){logger[_0xd85e('0x9')](util[_0xd85e('0xa')](_0xd85e('0x2b'),_0x370f70['id']));_0x3fcc31();});}})[_0xd85e('0x39')](function(_0x4a3626){if(_0x4a3626){if(!_0x4a3626[_0xd85e('0x3a')]||_0x4a3626[_0xd85e('0x3a')]!==_0xd85e('0x3b')){logger[_0xd85e('0x3c')](util[_0xd85e('0xa')](_0xd85e('0x3d'),_0x370f70['id']),util[_0xd85e('0x3e')](_0x4a3626,{'showHidden':![],'depth':null}));}}_0x3fcc31();});});}function checkTranscribe(){var _0x316947;var _0x196dc7;var _0x29773a;return db[_0xd85e('0x3f')][_0xd85e('0x40')]({'where':{'transcribeStatus':_0xd85e('0x41')}})[_0xd85e('0xf')](function(_0x66f126){if(!_0x66f126||!_0x66f126[_0xd85e('0x1b')]){throw new db['Sequelize'][(_0xd85e('0x20'))](_0xd85e('0x42'));}_0x316947=_0x66f126;return db[_0xd85e('0x43')][_0xd85e('0x24')]({'where':{'id':0x1}});})['then'](function(_0x464bbd){if(!_0x464bbd){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))]('Settings\x20not\x20available');}_0x196dc7=_0x464bbd;if(!_0x196dc7[_0xd85e('0x44')]||!_0x196dc7[_0xd85e('0x45')]||!_0x196dc7[_0xd85e('0xe')]||!_0x196dc7['language']||!_0x196dc7[_0xd85e('0x23')]){throw new db[(_0xd85e('0x1f'))]['ValidationError'](_0xd85e('0x46'));}return db[_0xd85e('0x34')]['findOne']({'where':{'id':_0x196dc7[_0xd85e('0x45')]}});})[_0xd85e('0xf')](function(_0x23b83a){if(!_0x23b83a){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))](_0xd85e('0x25'));}if(!_0x23b83a[_0xd85e('0xd')]||!_0x23b83a['data2']){throw new db[(_0xd85e('0x1f'))][(_0xd85e('0x20'))](_0xd85e('0x26'));}_0x29773a=_0x23b83a;var _0x25c241=[];_0x316947[_0xd85e('0x47')](function(_0x5a92c9){_0x25c241[_0xd85e('0x48')](checkTranscribeJob(_0x5a92c9,_0x196dc7,_0x29773a));});return BPromise['all'](_0x25c241);})[_0xd85e('0x39')](function(_0x55380f){if(_0x55380f){if(!_0x55380f['name']||_0x55380f[_0xd85e('0x3a')]!==_0xd85e('0x3b')){logger[_0xd85e('0x3c')](util['inspect'](_0x55380f,{'showHidden':![],'depth':null}));}}});}exports[_0xd85e('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x35ff=['CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','findOne','Positive','Negative','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','SequelizeValidationError','start','aws-sdk','request-promise','bluebird','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available'];(function(_0x53b199,_0x38ff21){var _0x1ba42d=function(_0x35dc53){while(--_0x35dc53){_0x53b199['push'](_0x53b199['shift']());}};_0x1ba42d(++_0x38ff21);}(_0x35ff,0xb3));var _0xf35f=function(_0x2a80a4,_0xd321ff){_0x2a80a4=_0x2a80a4-0x0;var _0x3af669=_0x35ff[_0x2a80a4];return _0x3af669;};var _=require('lodash');var AWS=require(_0xf35f('0x0'));var rp=require(_0xf35f('0x1'));var util=require('util');var BPromise=require(_0xf35f('0x2'));var db=require(_0xf35f('0x3'))['db'];var logger=require('../../config/logger')(_0xf35f('0x4'));function getTranscriptionJob(_0x481b60,_0x3ce173,_0x211017,_0x18a821){return new Promise(function(_0x1f9847,_0x1821a6){var _0x4321e9=new AWS['TranscribeService']({'accessKeyId':_0x3ce173,'secretAccessKey':_0x481b60,'region':_0x211017});_0x4321e9[_0xf35f('0x5')]({'TranscriptionJobName':_0x18a821},function(_0x1922af,_0x37df94){if(_0x1922af){return _0x1821a6(_0x1922af);}else{return _0x1f9847(_0x37df94);}});});}function sentiment(_0xb3fa13,_0x5ad244,_0x406771,_0x30fa2d,_0x1b9322){return new Promise(function(_0x335fe7,_0x45124e){var _0x179b13=new AWS[(_0xf35f('0x6'))]({'accessKeyId':_0x5ad244,'secretAccessKey':_0xb3fa13,'region':_0x406771});_0x179b13['detectSentiment']({'Text':_0x30fa2d,'LanguageCode':_0x1b9322[_0xf35f('0x7')](0x0,0x2)},function(_0x247d4c,_0x53ace5){if(_0x247d4c){return _0x45124e(_0x247d4c);}else{return _0x335fe7(_0x53ace5);}});});}function checkTranscribeJob(_0x30b231,_0x2a5109,_0xf33700){var _0x26588a;return new BPromise(function(_0x295701,_0x5b38be){logger[_0xf35f('0x8')](util['format'](_0xf35f('0x9'),_0x30b231['id'],_0x30b231[_0xf35f('0xa')]));return getTranscriptionJob(_0xf33700['data1'],_0xf33700[_0xf35f('0xb')],_0x2a5109[_0xf35f('0xc')],_0x30b231[_0xf35f('0xa')])[_0xf35f('0xd')](function(_0x246cc8){logger['info'](util[_0xf35f('0xe')](_0xf35f('0xf'),_0x30b231['id'],_0x30b231[_0xf35f('0xa')],_0x246cc8[_0xf35f('0x10')]['TranscriptionJobStatus']));if(!_0x30b231[_0xf35f('0x11')]){switch(_0x246cc8[_0xf35f('0x10')][_0xf35f('0x12')]){case _0xf35f('0x13'):var _0x26f540={'transcribeStatus':_0x246cc8['TranscriptionJob'][_0xf35f('0x12')],'fileUri':_0x246cc8[_0xf35f('0x10')][_0xf35f('0x14')][_0xf35f('0x15')]};logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x16'),_0x30b231['id']));return rp({'uri':_0x246cc8['TranscriptionJob'][_0xf35f('0x14')][_0xf35f('0x15')],'json':!![]})['then'](function(_0x319a63){logger['info'](util[_0xf35f('0xe')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x30b231['id']));if(_0x319a63&&_0x319a63[_0xf35f('0x17')]&&_0x319a63[_0xf35f('0x17')][_0xf35f('0x18')]&&_0x319a63['results'][_0xf35f('0x18')][_0xf35f('0x19')]){_0x26f540[_0xf35f('0x11')]='';for(var _0x30a846=0x0;_0x30a846<_0x319a63[_0xf35f('0x17')]['transcripts']['length'];_0x30a846++){_0x26f540[_0xf35f('0x11')]+=_0x319a63[_0xf35f('0x17')][_0xf35f('0x18')][_0x30a846][_0xf35f('0x1a')]+'';}}return _0x30b231[_0xf35f('0x1b')](_0x26f540);})['then'](function(){logger[_0xf35f('0x8')](util['format'](_0xf35f('0x1c'),_0x30b231['id']));if(!_0x30b231[_0xf35f('0x1d')]){throw new db['Sequelize'][(_0xf35f('0x1e'))](_0xf35f('0x1f'));}if(!_0x2a5109[_0xf35f('0x20')]||!_0x2a5109[_0xf35f('0x21')]||!_0x2a5109[_0xf35f('0x22')]||!_0x2a5109[_0xf35f('0x23')]||!_0x2a5109[_0xf35f('0x24')]){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x26'));}if(!_0x26f540[_0xf35f('0x11')]){throw new Error(_0xf35f('0x27'));}if(_0x2a5109[_0xf35f('0x21')]===_0xf33700['id']){return _0xf33700;}else{return db[_0xf35f('0x28')]['findOne']({'where':{'id':_settings[_0xf35f('0x21')]}});}})[_0xf35f('0xd')](function(_0x2243f4){if(!_0x2243f4){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x29'));}if(!_0x2243f4[_0xf35f('0x2a')]||!_0x2243f4[_0xf35f('0xb')]){throw new db[(_0xf35f('0x25'))]['ValidationError'](_0xf35f('0x2b'));}_0x26588a=_0x2243f4;logger['info'](util[_0xf35f('0xe')](_0xf35f('0x2c'),_0x30b231['id']));return sentiment(_0x26588a[_0xf35f('0x2a')],_0x26588a['data2'],_0x2a5109[_0xf35f('0x22')],_0x26f540[_0xf35f('0x11')],_0x2a5109[_0xf35f('0x23')]);})[_0xf35f('0xd')](function(_0x1e4c3b){logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x2d'),_0x30b231['id']));return _0x30b231['update']({'sentiment':_0x1e4c3b[_0xf35f('0x2e')],'sPositive':_0x1e4c3b[_0xf35f('0x2f')]['Positive'],'sNegative':_0x1e4c3b['SentimentScore']['Negative'],'sMixed':_0x1e4c3b['SentimentScore'][_0xf35f('0x30')],'sNeutral':_0x1e4c3b['SentimentScore'][_0xf35f('0x31')]});})[_0xf35f('0xd')](function(){logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x1c'),_0x30b231['id']));_0x295701();});case _0xf35f('0x32'):return _0x30b231[_0xf35f('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x246cc8[_0xf35f('0x10')][_0xf35f('0x33')]})['then'](function(){logger['info'](util[_0xf35f('0xe')](_0xf35f('0x1c'),_0x30b231['id']));_0x295701();});default:logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x34'),_0x30b231['id']));break;}}else{return BPromise['resolve']()[_0xf35f('0xd')](function(){if(!_0x30b231['tempSentiment']){throw new db['Sequelize'][(_0xf35f('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2a5109[_0xf35f('0x20')]||!_0x2a5109[_0xf35f('0x21')]||!_0x2a5109[_0xf35f('0x22')]||!_0x2a5109[_0xf35f('0x23')]||!_0x2a5109['bucket']){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x26'));}if(!_0x30b231[_0xf35f('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x2a5109['sentimentAccountId']===_0xf33700['id']){return _0xf33700;}else{return db[_0xf35f('0x28')][_0xf35f('0x35')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf35f('0xd')](function(_0x5e40aa){if(!_0x5e40aa){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x29'));}if(!_0x5e40aa[_0xf35f('0x2a')]||!_0x5e40aa[_0xf35f('0xb')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x26588a=_0x5e40aa;logger['info'](util[_0xf35f('0xe')](_0xf35f('0x2c'),_0x30b231['id']));return sentiment(_0x26588a[_0xf35f('0x2a')],_0x26588a[_0xf35f('0xb')],_0x2a5109[_0xf35f('0x22')],_0x30b231[_0xf35f('0x11')],_0x2a5109[_0xf35f('0x23')]);})[_0xf35f('0xd')](function(_0x459b96){logger[_0xf35f('0x8')](util[_0xf35f('0xe')](_0xf35f('0x2d'),_0x30b231['id']));return _0x30b231[_0xf35f('0x1b')]({'sentiment':_0x459b96[_0xf35f('0x2e')],'sPositive':_0x459b96['SentimentScore'][_0xf35f('0x36')],'sNegative':_0x459b96[_0xf35f('0x2f')][_0xf35f('0x37')],'sMixed':_0x459b96[_0xf35f('0x2f')][_0xf35f('0x30')],'sNeutral':_0x459b96[_0xf35f('0x2f')][_0xf35f('0x31')],'transcribeStatus':'COMPLETED'});})[_0xf35f('0xd')](function(){logger[_0xf35f('0x8')](util[_0xf35f('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x30b231['id']));_0x295701();});}})['catch'](function(_0x7a9be){if(_0x7a9be){if(!_0x7a9be[_0xf35f('0x38')]||_0x7a9be[_0xf35f('0x38')]!=='SequelizeValidationError'){logger[_0xf35f('0x39')](util[_0xf35f('0xe')](_0xf35f('0x3a'),_0x30b231['id']),util[_0xf35f('0x3b')](_0x7a9be,{'showHidden':![],'depth':null}));}}_0x295701();});});}function checkTranscribe(){var _0x1e65a2;var _0x49a811;var _0x28cd8d;return db['VoiceRecording'][_0xf35f('0x3c')]({'where':{'transcribeStatus':_0xf35f('0x3d')}})['then'](function(_0x39f9c6){if(!_0x39f9c6||!_0x39f9c6['length']){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x3e'));}_0x1e65a2=_0x39f9c6;return db[_0xf35f('0x3f')][_0xf35f('0x35')]({'where':{'id':0x1}});})[_0xf35f('0xd')](function(_0xe835f1){if(!_0xe835f1){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x40'));}_0x49a811=_0xe835f1;if(!_0x49a811[_0xf35f('0x4')]||!_0x49a811[_0xf35f('0x41')]||!_0x49a811['transcribeRegion']||!_0x49a811[_0xf35f('0x23')]||!_0x49a811[_0xf35f('0x24')]){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))](_0xf35f('0x42'));}return db[_0xf35f('0x28')][_0xf35f('0x35')]({'where':{'id':_0x49a811[_0xf35f('0x41')]}});})['then'](function(_0x1e687e){if(!_0x1e687e){throw new db[(_0xf35f('0x25'))]['ValidationError'](_0xf35f('0x29'));}if(!_0x1e687e[_0xf35f('0x2a')]||!_0x1e687e[_0xf35f('0xb')]){throw new db[(_0xf35f('0x25'))][(_0xf35f('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x28cd8d=_0x1e687e;var _0x4a1894=[];_0x1e65a2[_0xf35f('0x43')](function(_0x3d8084){_0x4a1894[_0xf35f('0x44')](checkTranscribeJob(_0x3d8084,_0x49a811,_0x28cd8d));});return BPromise[_0xf35f('0x45')](_0x4a1894);})[_0xf35f('0x46')](function(_0x50b152){if(_0x50b152){if(!_0x50b152[_0xf35f('0x38')]||_0x50b152[_0xf35f('0x38')]!==_0xf35f('0x47')){logger[_0xf35f('0x39')](util[_0xf35f('0x3b')](_0x50b152,{'showHidden':![],'depth':null}));}}});}exports[_0xf35f('0x48')]=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 549e2f7..1932408 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 _0x897e=['whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit'];(function(_0x153804,_0x36ea82){var _0x936728=function(_0x1f195a){while(--_0x1f195a){_0x153804['push'](_0x153804['shift']());}};_0x936728(++_0x36ea82);}(_0x897e,0x1d6));var _0xe897=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x897e[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xe897('0x0'));var moment=require('moment');var Redis=require(_0xe897('0x1'));var util=require('util');var config=require(_0xe897('0x2'));var db=require(_0xe897('0x3'))['db'];var logger=require('../logger')(_0xe897('0x4'));config[_0xe897('0x5')]=_[_0xe897('0x6')](config[_0xe897('0x5')],{'host':_0xe897('0x7'),'port':0x18eb});var io=require(_0xe897('0x8'))(new Redis(config[_0xe897('0x5')]));function closeInteractions(){var _0x3c4798=[];return db['WhatsappInteraction'][_0xe897('0x9')]({'raw':!![],'attributes':['id',_0xe897('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xe897('0xb')](0x18,_0xe897('0xc'))}}})[_0xe897('0xd')](function(_0x13e0d3){if(_0x13e0d3&&_0x13e0d3[_0xe897('0xe')]){_0x3c4798=_[_0xe897('0xf')](_0x13e0d3||[],'id');logger[_0xe897('0x10')](_0xe897('0x11'),_0x3c4798[_0xe897('0x12')]());return db[_0xe897('0x13')]['update']({'closeReason':_0xe897('0x14'),'disposition':_0xe897('0x15'),'closed':!![],'closedAt':moment()[_0xe897('0x16')](_0xe897('0x17'))},{'where':{'id':_0x3c4798}});}})[_0xe897('0xd')](function(){if(_0x3c4798&&_0x3c4798['length']){logger['info'](_0xe897('0x18'),_0x3c4798[_0xe897('0x12')]());for(var _0x4fc5e4=0x0;_0x4fc5e4<_0x3c4798[_0xe897('0xe')];_0x4fc5e4++){io[_0xe897('0x19')](_0xe897('0x1a'),{'id':_0x3c4798[_0x4fc5e4],'closed':!![]});}}})[_0xe897('0x1b')](function(_0x235d71){logger['error'](_0xe897('0x1c'),_0x235d71?util[_0xe897('0x1d')](_0x235d71,{'showHidden':![],'depth':null}):'');});}exports[_0xe897('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1702=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','../../mysqldb','../logger','redis','defaults','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x1702,0x1d5));var _0x2170=function(_0x482a31,_0xc68d8e){_0x482a31=_0x482a31-0x0;var _0x945060=_0x1702[_0x482a31];return _0x945060;};'use strict';var _=require('lodash');var moment=require(_0x2170('0x0'));var Redis=require(_0x2170('0x1'));var util=require(_0x2170('0x2'));var config=require('../../config/environment');var db=require(_0x2170('0x3'))['db'];var logger=require(_0x2170('0x4'))('schedule');config[_0x2170('0x5')]=_[_0x2170('0x6')](config[_0x2170('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x2170('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x581d7c=[];return db[_0x2170('0x8')]['findAll']({'raw':!![],'attributes':['id',_0x2170('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2170('0xa')](0x18,_0x2170('0xb'))}}})[_0x2170('0xc')](function(_0x17edb0){if(_0x17edb0&&_0x17edb0[_0x2170('0xd')]){_0x581d7c=_['map'](_0x17edb0||[],'id');logger[_0x2170('0xe')](_0x2170('0xf'),_0x581d7c[_0x2170('0x10')]());return db[_0x2170('0x8')][_0x2170('0x11')]({'closeReason':_0x2170('0x12'),'disposition':_0x2170('0x13'),'closed':!![],'closedAt':moment()[_0x2170('0x14')](_0x2170('0x15'))},{'where':{'id':_0x581d7c}});}})['then'](function(){if(_0x581d7c&&_0x581d7c[_0x2170('0xd')]){logger[_0x2170('0xe')](_0x2170('0x16'),_0x581d7c[_0x2170('0x10')]());for(var _0x8cde86=0x0;_0x8cde86<_0x581d7c[_0x2170('0xd')];_0x8cde86++){io['emit'](_0x2170('0x17'),{'id':_0x581d7c[_0x8cde86],'closed':!![]});}}})[_0x2170('0x18')](function(_0x404932){logger['error'](_0x2170('0x19'),_0x404932?util[_0x2170('0x1a')](_0x404932,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 6a7bcb3..deb0960 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3fe=['contacts1','CmHopper','contacts2','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','now','innocenzo.biondo','@xcally.com','push','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0x2d5b8e,_0x5176cb){var _0x1d831f=function(_0x41b3c0){while(--_0x41b3c0){_0x2d5b8e['push'](_0x2d5b8e['shift']());}};_0x1d831f(++_0x5176cb);}(_0xe3fe,0x194));var _0xee3f=function(_0x4937d9,_0x2fe756){_0x4937d9=_0x4937d9-0x0;var _0xeb9860=_0xe3fe[_0x4937d9];return _0xeb9860;};'use strict';var util=require(_0xee3f('0x0'));var db=require(_0xee3f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xee3f('0x2')+i,'lastName':_0xee3f('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xee3f('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xee3f('0x4')](),'updatedAt':Date[_0xee3f('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xee3f('0x2')+i,'lastName':_0xee3f('0x3')+i,'phone':0xf879fb460+i,'email':_0xee3f('0x5')+i+_0xee3f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xee3f('0x7')]({'id':i,'active':![],'scheduledat':Date[_0xee3f('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xee3f('0x4')](),'updatedAt':Date[_0xee3f('0x4')]()});}db[_0xee3f('0x8')][_0xee3f('0x9')]({'where':{}})[_0xee3f('0xa')](function(){return db[_0xee3f('0x8')][_0xee3f('0xb')](contacts);})[_0xee3f('0xa')](function(){console[_0xee3f('0xc')](_0xee3f('0xd'),_0xee3f('0xe'));return db[_0xee3f('0xf')]['destroy']({'where':{}});})[_0xee3f('0xa')](function(){return db[_0xee3f('0xf')][_0xee3f('0xb')](hopper);})[_0xee3f('0xa')](function(){console[_0xee3f('0xc')]('finished\x20populating','hopper1');return db[_0xee3f('0x8')][_0xee3f('0xb')](contacts2);})[_0xee3f('0xa')](function(){console[_0xee3f('0xc')](_0xee3f('0xd'),_0xee3f('0x10'));return db[_0xee3f('0xf')][_0xee3f('0xb')](hopper2);})[_0xee3f('0xa')](function(){console['log'](_0xee3f('0xd'),_0xee3f('0x11'));})[_0xee3f('0x12')](function(_0x163b61){console[_0xee3f('0xc')](_0x163b61);}); \ No newline at end of file +var _0xf036=['catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','then','CmContact','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2'];(function(_0x549d3d,_0x42ccc5){var _0x34f029=function(_0x428518){while(--_0x428518){_0x549d3d['push'](_0x549d3d['shift']());}};_0x34f029(++_0x42ccc5);}(_0xf036,0x10b));var _0x6f03=function(_0x4f32aa,_0x4b23e9){_0x4f32aa=_0x4f32aa-0x0;var _0x24ad15=_0xf036[_0x4f32aa];return _0x24ad15;};'use strict';var util=require(_0x6f03('0x0'));var db=require(_0x6f03('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6f03('0x2')]({'id':i,'firstName':_0x6f03('0x3')+i,'lastName':_0x6f03('0x4')+i,'phone':0xf879fb460+i,'email':_0x6f03('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6f03('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6f03('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6f03('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6f03('0x5')+i+_0x6f03('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6f03('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6f03('0x6')](),'updatedAt':Date[_0x6f03('0x6')]()});}db['CmContact']['destroy']({'where':{}})[_0x6f03('0x8')](function(){return db[_0x6f03('0x9')][_0x6f03('0xa')](contacts);})['then'](function(){console[_0x6f03('0xb')]('finished\x20populating',_0x6f03('0xc'));return db['CmHopper']['destroy']({'where':{}});})['then'](function(){return db[_0x6f03('0xd')][_0x6f03('0xa')](hopper);})[_0x6f03('0x8')](function(){console['log'](_0x6f03('0xe'),_0x6f03('0xf'));return db[_0x6f03('0x9')][_0x6f03('0xa')](contacts2);})[_0x6f03('0x8')](function(){console[_0x6f03('0xb')](_0x6f03('0xe'),_0x6f03('0x10'));return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x6f03('0xb')](_0x6f03('0xe'),_0x6f03('0x11'));})[_0x6f03('0x12')](function(_0x3f5ed3){console['log'](_0x3f5ed3);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index b943474..627af60 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x703a=['User','bulkCreate','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x5eaac8,_0x1c5507){var _0x2c1803=function(_0x3248f6){while(--_0x3248f6){_0x5eaac8['push'](_0x5eaac8['shift']());}};_0x2c1803(++_0x1c5507);}(_0x703a,0x16b));var _0xa703=function(_0x3a6df3,_0xca31c8){_0x3a6df3=_0x3a6df3-0x0;var _0x5cb21b=_0x703a[_0x3a6df3];return _0x5cb21b;};'use strict';var util=require(_0xa703('0x0'));var db=require(_0xa703('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa703('0x2')]({'name':util[_0xa703('0x3')](_0xa703('0x4'),_0xa703('0x5'),i),'fullname':util[_0xa703('0x3')]('%s%s',_0xa703('0x5'),i),'email':util[_0xa703('0x3')](_0xa703('0x6'),'agent',i),'role':_0xa703('0x5'),'password':'password','internal':0xfa0+i,'type':_0xa703('0x7'),'transport':[_0xa703('0x8'),'ws',_0xa703('0x9')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0xa703('0x3')](_0xa703('0x4'),'agent',i),'encryption':_0xa703('0xa'),'avpf':_0xa703('0xa'),'force_avp':_0xa703('0xa'),'icesupport':_0xa703('0xa'),'dtlsenable':_0xa703('0xa'),'dtlsverify':'no','dtlscertfile':_0xa703('0xb'),'dtlsprivatekey':_0xa703('0xc'),'dtlssetup':_0xa703('0xd'),'callerid':util[_0xa703('0x3')](_0xa703('0xe'),util['format']('%s%s','agent',i),0xfa0+i)});}db[_0xa703('0xf')][_0xa703('0x10')](users)['then'](function(){console['log']('add\x20user');})['catch'](function(_0x4d7ef0){console[_0xa703('0x11')](_0x4d7ef0);}); \ No newline at end of file +var _0x9025=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','catch','log','util','../mysqldb','push','agent','format','%s%s','password','friend','udp','wss','all','ulaw','yes'];(function(_0x41e3cb,_0x242df9){var _0x58d956=function(_0x3356c5){while(--_0x3356c5){_0x41e3cb['push'](_0x41e3cb['shift']());}};_0x58d956(++_0x242df9);}(_0x9025,0x104));var _0x5902=function(_0x1c4606,_0x2aeb54){_0x1c4606=_0x1c4606-0x0;var _0xa42ee=_0x9025[_0x1c4606];return _0xa42ee;};'use strict';var util=require(_0x5902('0x0'));var db=require(_0x5902('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5902('0x2')]({'name':util['format']('%s%s',_0x5902('0x3'),i),'fullname':util[_0x5902('0x4')](_0x5902('0x5'),'agent',i),'email':util[_0x5902('0x4')]('%s%s@xcally.com',_0x5902('0x3'),i),'role':_0x5902('0x3'),'password':_0x5902('0x6'),'internal':0xfa0+i,'type':_0x5902('0x7'),'transport':[_0x5902('0x8'),'ws',_0x5902('0x9')],'disallow':[_0x5902('0xa')],'allow':[_0x5902('0xb')],'defaultuser':util['format'](_0x5902('0x5'),_0x5902('0x3'),i),'encryption':'yes','avpf':'yes','force_avp':_0x5902('0xc'),'icesupport':_0x5902('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x5902('0xd'),'dtlsprivatekey':_0x5902('0xe'),'dtlssetup':_0x5902('0xf'),'callerid':util[_0x5902('0x4')](_0x5902('0x10'),util[_0x5902('0x4')]('%s%s','agent',i),0xfa0+i)});}db['User'][_0x5902('0x11')](users)[_0x5902('0x12')](function(){console['log']('add\x20user');})[_0x5902('0x13')](function(_0x1b5bb8){console[_0x5902('0x14')](_0x1b5bb8);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 2c340f0..73f020c 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2aa3=['openchannel','whatsapp','trunk:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','Agents','User','name','role','agent','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','telephone','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','ChatQueues','ChatQueue','OpenchannelQueues','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x2aa3,0x83));var _0x32aa=function(_0x44a0ad,_0x257d9c){_0x44a0ad=_0x44a0ad-0x0;var _0x45f736=_0x2aa3[_0x44a0ad];return _0x45f736;};'use strict';var _=require(_0x32aa('0x0'));var util=require(_0x32aa('0x1'));var BPromise=require(_0x32aa('0x2'));var db=require(_0x32aa('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x32aa('0x4'),'model':db[_0x32aa('0x5')],'attributes':['id',_0x32aa('0x6'),_0x32aa('0x7')],'raw':!![],'where':{'role':_0x32aa('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x32aa('0x6')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x32aa('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x32aa('0x6')],'where':{'role':_0x32aa('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x32aa('0x6'),_0x32aa('0x9')],'where':{'type':_0x32aa('0xa')}};function getAssociatedResources(_0x2fe991,_0x2ee126,_0x5d280e){return db[_0x32aa('0xb')]['findOne']({'where':{'name':_0x2fe991,'userProfileId':_0x2ee126},'raw':!![]})[_0x32aa('0xc')](function(_0x448505){if(_0x448505){if(_0x448505[_0x32aa('0xd')]){switch(_0x2fe991){case _0x32aa('0xe'):case'ChatQueues':case _0x32aa('0xf'):case _0x32aa('0x10'):case _0x32aa('0x11'):case'OpenchannelQueues':case _0x32aa('0x12'):return db[_0x5d280e][_0x32aa('0x13')](queryQueues);case _0x32aa('0x14'):return db[_0x5d280e][_0x32aa('0x13')](queryTelephones);case _0x32aa('0x15'):return db[_0x5d280e][_0x32aa('0x13')](queryTrunks);case _0x32aa('0x16'):return db[_0x5d280e][_0x32aa('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x32aa('0x13')]({'attributes':[_0x32aa('0x17')],'where':{'sectionId':_0x448505['id']},'raw':!![]})[_0x32aa('0xc')](function(_0x2cc92d){if(_0x2cc92d){var _0x211278={'where':{'id':_['map'](_0x2cc92d,_0x32aa('0x17'))},'raw':!![]};switch(_0x5d280e){case _0x32aa('0x5'):_0x211278[_0x32aa('0x18')][_0x32aa('0x7')]=_0x32aa('0x19');break;case'Campaign':_0x211278['where'][_0x32aa('0x9')]=_0x32aa('0xa');break;}return db[_0x5d280e][_0x32aa('0x13')](_0x211278);}else{return[];}});}}else{return[];}})['then'](function(_0x5b48ee){return _0x5b48ee;});}function joinOrLeaveQueues(_0x1a0262,_0x148255,_0x1d7490,_0xe4523f){_0x1a0262[_0x148255](util[_0x32aa('0x1a')](_0x32aa('0x1b'),_0x1d7490,_0xe4523f['name']));if(_0xe4523f[_0x32aa('0x4')]){for(var _0x327831=0x0;_0x327831<_0xe4523f[_0x32aa('0x4')][_0x32aa('0x1c')];_0x327831+=0x1){_0x1a0262[_0x148255](util[_0x32aa('0x1a')](_0x32aa('0x1d'),_0xe4523f[_0x32aa('0x4')][_0x327831][_0x32aa('0x6')]));}}}function joinOrLeave(_0x2fd7a5,_0x53c65a,_0x4e66e6){var _0x5c82d2;if(_0x2fd7a5[_0x32aa('0x1e')][_0x32aa('0x1f')]['id']){db['User']['find']({'attributes':['id',_0x32aa('0x6'),_0x32aa('0x7'),_0x32aa('0x20')],'where':{'id':_0x2fd7a5[_0x32aa('0x1e')][_0x32aa('0x1f')]['id']},'include':[{'model':db[_0x32aa('0x21')],'as':_0x32aa('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x32aa('0x23')],'as':_0x32aa('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x32aa('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x32aa('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x32aa('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x32aa('0x28'),'attributes':['id'],'raw':!![]}]})[_0x32aa('0xc')](function(_0x1d1c80){if(_0x1d1c80){_0x5c82d2=_0x1d1c80;_0x2fd7a5[_0x53c65a](util[_0x32aa('0x1a')]('user:%s',_0x1d1c80[_0x32aa('0x6')]));var _0x303af4=[];switch(_0x1d1c80[_0x32aa('0x7')]){case _0x32aa('0x29'):_0x2fd7a5[_0x53c65a](_0x32aa('0x2a'));_0x2fd7a5[_0x53c65a](_0x32aa('0x2b'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x32aa('0x2c')];}_0x303af4[_0x32aa('0x2d')](db[_0x32aa('0x2e')][_0x32aa('0x13')](queryQueues));_0x303af4['push'](db['ChatQueue'][_0x32aa('0x13')](queryQueues));_0x303af4['push'](db[_0x32aa('0x2f')][_0x32aa('0x13')](queryQueues));_0x303af4['push'](db[_0x32aa('0x30')][_0x32aa('0x13')](queryQueues));_0x303af4['push'](db[_0x32aa('0x31')][_0x32aa('0x13')](queryQueues));_0x303af4[_0x32aa('0x2d')](db[_0x32aa('0x32')][_0x32aa('0x13')](queryQueues));_0x303af4[_0x32aa('0x2d')](db[_0x32aa('0x33')][_0x32aa('0x13')](queryQueues));_0x303af4[_0x32aa('0x2d')](db[_0x32aa('0x5')][_0x32aa('0x13')](queryTelephones));_0x303af4[_0x32aa('0x2d')](db[_0x32aa('0x34')][_0x32aa('0x13')](queryTrunks));_0x303af4['push'](db[_0x32aa('0x35')][_0x32aa('0x13')](queryCampaigns));_0x303af4[_0x32aa('0x2d')](db[_0x32aa('0x5')][_0x32aa('0x13')](queryAgents));break;case'user':_0x2fd7a5[_0x53c65a](_0x32aa('0x2a'));_0x2fd7a5[_0x53c65a](_0x32aa('0x2b'));_0x303af4[_0x32aa('0x2d')](getAssociatedResources(_0x32aa('0xe'),_0x1d1c80[_0x32aa('0x20')],_0x32aa('0x2e')));_0x303af4[_0x32aa('0x2d')](getAssociatedResources(_0x32aa('0x36'),_0x1d1c80[_0x32aa('0x20')],_0x32aa('0x37')));_0x303af4[_0x32aa('0x2d')](getAssociatedResources('FaxQueues',_0x1d1c80['userProfileId'],_0x32aa('0x2f')));_0x303af4[_0x32aa('0x2d')](getAssociatedResources(_0x32aa('0x10'),_0x1d1c80[_0x32aa('0x20')],_0x32aa('0x30')));_0x303af4[_0x32aa('0x2d')](getAssociatedResources(_0x32aa('0x11'),_0x1d1c80['userProfileId'],_0x32aa('0x31')));_0x303af4[_0x32aa('0x2d')](getAssociatedResources(_0x32aa('0x38'),_0x1d1c80[_0x32aa('0x20')],'OpenchannelQueue'));_0x303af4[_0x32aa('0x2d')](getAssociatedResources('WhatsappQueues',_0x1d1c80[_0x32aa('0x20')],_0x32aa('0x33')));_0x303af4[_0x32aa('0x2d')](getAssociatedResources(_0x32aa('0x14'),_0x1d1c80[_0x32aa('0x20')],'User'));_0x303af4[_0x32aa('0x2d')](getAssociatedResources(_0x32aa('0x15'),_0x1d1c80[_0x32aa('0x20')],_0x32aa('0x34')));_0x303af4['push'](getAssociatedResources(_0x32aa('0x16'),_0x1d1c80['userProfileId'],_0x32aa('0x35')));_0x303af4[_0x32aa('0x2d')](db['User'][_0x32aa('0x13')](queryAgents));break;case _0x32aa('0x8'):_0x2fd7a5[_0x53c65a](_0x32aa('0x2a'));_0x2fd7a5[_0x53c65a](_0x32aa('0x2b'));_0x303af4[_0x32aa('0x2d')](_0x1d1c80[_0x32aa('0x39')]({'attributes':['id',_0x32aa('0x6')]}));_0x303af4[_0x32aa('0x2d')](_0x1d1c80['getChatQueues']({'attributes':['id','name']}));_0x303af4[_0x32aa('0x2d')](_0x1d1c80[_0x32aa('0x3a')]({'attributes':['id',_0x32aa('0x6')]}));_0x303af4[_0x32aa('0x2d')](_0x1d1c80[_0x32aa('0x3b')]({'attributes':['id','name']}));_0x303af4[_0x32aa('0x2d')](_0x1d1c80[_0x32aa('0x3c')]({'attributes':['id',_0x32aa('0x6')]}));_0x303af4['push'](_0x1d1c80[_0x32aa('0x3d')]({'attributes':['id','name']}));_0x303af4['push'](_0x1d1c80[_0x32aa('0x3e')]({'attributes':['id',_0x32aa('0x6')]}));break;}return BPromise[_0x32aa('0x3f')](_0x303af4);}})['then'](function(_0x57dc58){if(_0x57dc58&&_0x57dc58[_0x32aa('0x1c')]){for(var _0x247ad5=0x0;_0x247ad5<_0x57dc58[_0x32aa('0x1c')];_0x247ad5+=0x1){for(var _0x40b1fe=0x0;_0x40b1fe<_0x57dc58[_0x247ad5][_0x32aa('0x1c')];_0x40b1fe+=0x1){switch(_0x247ad5){case 0x0:joinOrLeaveQueues(_0x2fd7a5,_0x53c65a,_0x32aa('0x40'),_0x57dc58[_0x247ad5][_0x40b1fe]);break;case 0x1:joinOrLeaveQueues(_0x2fd7a5,_0x53c65a,_0x32aa('0x41'),_0x57dc58[_0x247ad5][_0x40b1fe]);break;case 0x2:joinOrLeaveQueues(_0x2fd7a5,_0x53c65a,_0x32aa('0x42'),_0x57dc58[_0x247ad5][_0x40b1fe]);break;case 0x3:joinOrLeaveQueues(_0x2fd7a5,_0x53c65a,_0x32aa('0x43'),_0x57dc58[_0x247ad5][_0x40b1fe]);break;case 0x4:joinOrLeaveQueues(_0x2fd7a5,_0x53c65a,_0x32aa('0x44'),_0x57dc58[_0x247ad5][_0x40b1fe]);break;case 0x5:joinOrLeaveQueues(_0x2fd7a5,_0x53c65a,_0x32aa('0x45'),_0x57dc58[_0x247ad5][_0x40b1fe]);break;case 0x6:joinOrLeaveQueues(_0x2fd7a5,_0x53c65a,_0x32aa('0x46'),_0x57dc58[_0x247ad5][_0x40b1fe]);break;case 0x7:if(_0x5c82d2[_0x32aa('0x7')]!==_0x32aa('0x8'))_0x2fd7a5[_0x53c65a](util['format']('telephone:%s',_0x57dc58[_0x247ad5][_0x40b1fe][_0x32aa('0x6')]));break;case 0x8:if(_0x5c82d2[_0x32aa('0x7')]!==_0x32aa('0x8'))_0x2fd7a5[_0x53c65a](util[_0x32aa('0x1a')](_0x32aa('0x47'),_0x57dc58[_0x247ad5][_0x40b1fe][_0x32aa('0x6')]));break;case 0x9:if(_0x5c82d2[_0x32aa('0x7')]!==_0x32aa('0x8'))_0x2fd7a5[_0x53c65a](util['format']('campaign:%s:%s',_0x57dc58[_0x247ad5][_0x40b1fe][_0x32aa('0x9')],_0x57dc58[_0x247ad5][_0x40b1fe]['name']));break;case 0xa:_0x2fd7a5[_0x53c65a](util['format'](_0x32aa('0x1d'),_0x57dc58[_0x247ad5][_0x40b1fe][_0x32aa('0x6')]));break;}}}}})[_0x32aa('0xc')](function(){if(_0x53c65a===_0x32aa('0x48')){var _0x1558fe=_[_0x32aa('0x49')](_0x5c82d2['ChatInteractions'],'id');return _0x5c82d2[_0x32aa('0x4a')](_0x1558fe)['then'](function(){for(var _0x116fbc=0x0;_0x116fbc<_0x1558fe[_0x32aa('0x1c')];_0x116fbc+=0x1){_0x4e66e6[_0x32aa('0x4b')](_0x32aa('0x4c'),{'ChatInteractionId':Number(_0x1558fe[_0x116fbc]),'UserId':Number(_0x5c82d2['id'])});}});}})[_0x32aa('0xc')](function(){if(_0x53c65a===_0x32aa('0x48')){var _0x28b7f5=_['map'](_0x5c82d2[_0x32aa('0x24')],'id');return _0x5c82d2['removeMailInteractions'](_0x28b7f5)['then'](function(){for(var _0xbb6f36=0x0;_0xbb6f36<_0x28b7f5['length'];_0xbb6f36+=0x1){_0x4e66e6['emit'](_0x32aa('0x4d'),{'MailInteractionId':Number(_0x28b7f5[_0xbb6f36]),'UserId':Number(_0x5c82d2['id'])});}});}})[_0x32aa('0xc')](function(){if(_0x53c65a===_0x32aa('0x48')){var _0x1d87a0=_['map'](_0x5c82d2['FaxInteractions'],'id');return _0x5c82d2['removeFaxInteractions'](_0x1d87a0)[_0x32aa('0xc')](function(){for(var _0x163082=0x0;_0x163082<_0x1d87a0['length'];_0x163082+=0x1){_0x4e66e6[_0x32aa('0x4b')](_0x32aa('0x4e'),{'FaxInteractionId':Number(_0x1d87a0[_0x163082]),'UserId':Number(_0x5c82d2['id'])});}});}})[_0x32aa('0xc')](function(){if(_0x53c65a===_0x32aa('0x48')){var _0x11e866=_[_0x32aa('0x49')](_0x5c82d2[_0x32aa('0x4f')],'id');return _0x5c82d2[_0x32aa('0x50')](_0x11e866)[_0x32aa('0xc')](function(){for(var _0x530390=0x0;_0x530390<_0x11e866[_0x32aa('0x1c')];_0x530390+=0x1){_0x4e66e6['emit'](_0x32aa('0x51'),{'SmsInteractionId':Number(_0x11e866[_0x530390]),'UserId':Number(_0x5c82d2['id'])});}});}})['then'](function(){if(_0x53c65a===_0x32aa('0x48')){var _0x5408ff=_[_0x32aa('0x49')](_0x5c82d2[_0x32aa('0x52')],'id');return _0x5c82d2[_0x32aa('0x53')](_0x5408ff)[_0x32aa('0xc')](function(){for(var _0x3f3e9f=0x0;_0x3f3e9f<_0x5408ff[_0x32aa('0x1c')];_0x3f3e9f+=0x1){_0x4e66e6['emit'](_0x32aa('0x54'),{'OpenchannelInteractionId':Number(_0x5408ff[_0x3f3e9f]),'UserId':Number(_0x5c82d2['id'])});}});}})[_0x32aa('0xc')](function(){if(_0x53c65a===_0x32aa('0x48')){var _0x1c175a=_['map'](_0x5c82d2['WhatsappInteractions'],'id');return _0x5c82d2[_0x32aa('0x55')](_0x1c175a)['then'](function(){for(var _0x2dcece=0x0;_0x2dcece<_0x1c175a[_0x32aa('0x1c')];_0x2dcece+=0x1){_0x4e66e6[_0x32aa('0x4b')](_0x32aa('0x56'),{'WhatsappInteractionId':Number(_0x1c175a[_0x2dcece]),'UserId':Number(_0x5c82d2['id'])});}});}})[_0x32aa('0x57')](function(_0x2f2a5b){_0x2fd7a5[_0x32aa('0x58')](_0x2f2a5b);});}}function onDisconnect(_0x41da19,_0x1ed20d){joinOrLeave(_0x41da19,'leave',_0x1ed20d);}function onConnect(_0x440343){joinOrLeave(_0x440343,_0x32aa('0x59'));}exports[_0x32aa('0x5a')]=function(_0x2cca49){_0x2cca49['on'](_0x32aa('0x5b'),function(_0x4aeeae){_0x4aeeae[_0x32aa('0x5c')](0x0);_0x4aeeae['address']=_0x4aeeae[_0x32aa('0x5d')]['connection']['remoteAddress']+':'+_0x4aeeae[_0x32aa('0x5d')][_0x32aa('0x5b')][_0x32aa('0x5e')];_0x4aeeae[_0x32aa('0x5f')]=new Date();_0x4aeeae[_0x32aa('0x58')]=function(_0x2b3d4b){console[_0x32aa('0x58')](_0x32aa('0x60')+_0x4aeeae[_0x32aa('0x61')]['name']+'['+_0x4aeeae['address']+']',_0x2b3d4b);};_0x4aeeae['on'](_0x32aa('0x62'),function(){onDisconnect(_0x4aeeae,_0x2cca49);_0x4aeeae[_0x32aa('0x58')](_0x32aa('0x63'));});onConnect(_0x4aeeae);_0x4aeeae['log']('CONNECTED');});}; \ No newline at end of file +var _0x2ef3=['format','%s:queue:%s','Agents','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','role','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','SmsQueues','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','removeSmsInteractions','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','agent','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','then','where','Campaign'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x2ef3,0xba));var _0x32ef=function(_0xf34bb0,_0x1e65f5){_0xf34bb0=_0xf34bb0-0x0;var _0x51bec9=_0x2ef3[_0xf34bb0];return _0x51bec9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var BPromise=require(_0x32ef('0x2'));var db=require(_0x32ef('0x3'))['db'];var config=require(_0x32ef('0x4'));var queryQueues={'attributes':['id',_0x32ef('0x5')],'include':[{'as':'Agents','model':db[_0x32ef('0x6')],'attributes':['id',_0x32ef('0x5'),'role'],'raw':!![],'where':{'role':_0x32ef('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x32ef('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x32ef('0x5')],'where':{'role':_0x32ef('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x32ef('0x5'),_0x32ef('0x8')],'where':{'type':_0x32ef('0x9')}};function getAssociatedResources(_0x298066,_0x2484a0,_0x2bbb50){return db[_0x32ef('0xa')][_0x32ef('0xb')]({'where':{'name':_0x298066,'userProfileId':_0x2484a0},'raw':!![]})['then'](function(_0x5780e9){if(_0x5780e9){if(_0x5780e9[_0x32ef('0xc')]){switch(_0x298066){case _0x32ef('0xd'):case _0x32ef('0xe'):case _0x32ef('0xf'):case'SmsQueues':case _0x32ef('0x10'):case'OpenchannelQueues':case _0x32ef('0x11'):return db[_0x2bbb50]['findAll'](queryQueues);case _0x32ef('0x12'):return db[_0x2bbb50][_0x32ef('0x13')](queryTelephones);case'Trunks':return db[_0x2bbb50]['findAll'](queryTrunks);case _0x32ef('0x14'):return db[_0x2bbb50]['findAll'](queryCampaigns);}}else{return db[_0x32ef('0x15')][_0x32ef('0x13')]({'attributes':[_0x32ef('0x16')],'where':{'sectionId':_0x5780e9['id']},'raw':!![]})[_0x32ef('0x17')](function(_0x57aff1){if(_0x57aff1){var _0x55bf0b={'where':{'id':_['map'](_0x57aff1,_0x32ef('0x16'))},'raw':!![]};switch(_0x2bbb50){case _0x32ef('0x6'):_0x55bf0b[_0x32ef('0x18')]['role']='telephone';break;case _0x32ef('0x19'):_0x55bf0b[_0x32ef('0x18')][_0x32ef('0x8')]='ivr';break;}return db[_0x2bbb50][_0x32ef('0x13')](_0x55bf0b);}else{return[];}});}}else{return[];}})[_0x32ef('0x17')](function(_0x4f4c98){return _0x4f4c98;});}function joinOrLeaveQueues(_0x304505,_0x314ef1,_0x26aff3,_0x251084){_0x304505[_0x314ef1](util[_0x32ef('0x1a')](_0x32ef('0x1b'),_0x26aff3,_0x251084['name']));if(_0x251084[_0x32ef('0x1c')]){for(var _0x5cc3ef=0x0;_0x5cc3ef<_0x251084[_0x32ef('0x1c')][_0x32ef('0x1d')];_0x5cc3ef+=0x1){_0x304505[_0x314ef1](util['format'](_0x32ef('0x1e'),_0x251084[_0x32ef('0x1c')][_0x5cc3ef][_0x32ef('0x5')]));}}}function joinOrLeave(_0x55f7f2,_0x57f5e5,_0x22f2d7){var _0xb30fab;if(_0x55f7f2[_0x32ef('0x1f')]['query']['id']){db['User'][_0x32ef('0x20')]({'attributes':['id','name','role',_0x32ef('0x21')],'where':{'id':_0x55f7f2[_0x32ef('0x1f')][_0x32ef('0x22')]['id']},'include':[{'model':db[_0x32ef('0x23')],'as':_0x32ef('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x32ef('0x25')],'as':_0x32ef('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x32ef('0x27')],'as':_0x32ef('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x32ef('0x29')],'as':_0x32ef('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x32ef('0x2b')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x32ef('0x2c')],'as':_0x32ef('0x2d'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x12de1a){if(_0x12de1a){_0xb30fab=_0x12de1a;_0x55f7f2[_0x57f5e5](util[_0x32ef('0x1a')](_0x32ef('0x1e'),_0x12de1a[_0x32ef('0x5')]));var _0x50a95b=[];switch(_0x12de1a[_0x32ef('0x2e')]){case _0x32ef('0x2f'):_0x55f7f2[_0x57f5e5](_0x32ef('0x30'));_0x55f7f2[_0x57f5e5](_0x32ef('0x31'));if(queryQueues[_0x32ef('0x32')](_0x32ef('0x33'))){delete queryQueues[_0x32ef('0x33')];}_0x50a95b['push'](db[_0x32ef('0x34')]['findAll'](queryQueues));_0x50a95b[_0x32ef('0x35')](db[_0x32ef('0x36')]['findAll'](queryQueues));_0x50a95b[_0x32ef('0x35')](db[_0x32ef('0x37')][_0x32ef('0x13')](queryQueues));_0x50a95b[_0x32ef('0x35')](db[_0x32ef('0x38')]['findAll'](queryQueues));_0x50a95b['push'](db[_0x32ef('0x39')]['findAll'](queryQueues));_0x50a95b[_0x32ef('0x35')](db[_0x32ef('0x3a')][_0x32ef('0x13')](queryQueues));_0x50a95b[_0x32ef('0x35')](db[_0x32ef('0x3b')][_0x32ef('0x13')](queryQueues));_0x50a95b['push'](db['User']['findAll'](queryTelephones));_0x50a95b[_0x32ef('0x35')](db[_0x32ef('0x3c')][_0x32ef('0x13')](queryTrunks));_0x50a95b['push'](db['Campaign'][_0x32ef('0x13')](queryCampaigns));_0x50a95b[_0x32ef('0x35')](db[_0x32ef('0x6')]['findAll'](queryAgents));break;case'user':_0x55f7f2[_0x57f5e5](_0x32ef('0x30'));_0x55f7f2[_0x57f5e5](_0x32ef('0x31'));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0xd'),_0x12de1a[_0x32ef('0x21')],_0x32ef('0x34')));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0xe'),_0x12de1a[_0x32ef('0x21')],'ChatQueue'));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0xf'),_0x12de1a[_0x32ef('0x21')],'FaxQueue'));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0x3d'),_0x12de1a[_0x32ef('0x21')],_0x32ef('0x38')));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0x10'),_0x12de1a[_0x32ef('0x21')],_0x32ef('0x39')));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0x3e'),_0x12de1a[_0x32ef('0x21')],_0x32ef('0x3a')));_0x50a95b['push'](getAssociatedResources(_0x32ef('0x11'),_0x12de1a[_0x32ef('0x21')],_0x32ef('0x3b')));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0x12'),_0x12de1a[_0x32ef('0x21')],_0x32ef('0x6')));_0x50a95b['push'](getAssociatedResources('Trunks',_0x12de1a[_0x32ef('0x21')],_0x32ef('0x3c')));_0x50a95b[_0x32ef('0x35')](getAssociatedResources(_0x32ef('0x14'),_0x12de1a['userProfileId'],_0x32ef('0x19')));_0x50a95b[_0x32ef('0x35')](db['User'][_0x32ef('0x13')](queryAgents));break;case'agent':_0x55f7f2[_0x57f5e5](_0x32ef('0x30'));_0x55f7f2[_0x57f5e5](_0x32ef('0x31'));_0x50a95b[_0x32ef('0x35')](_0x12de1a[_0x32ef('0x3f')]({'attributes':['id',_0x32ef('0x5')]}));_0x50a95b[_0x32ef('0x35')](_0x12de1a[_0x32ef('0x40')]({'attributes':['id',_0x32ef('0x5')]}));_0x50a95b[_0x32ef('0x35')](_0x12de1a[_0x32ef('0x41')]({'attributes':['id','name']}));_0x50a95b[_0x32ef('0x35')](_0x12de1a['getSmsQueues']({'attributes':['id',_0x32ef('0x5')]}));_0x50a95b[_0x32ef('0x35')](_0x12de1a[_0x32ef('0x42')]({'attributes':['id','name']}));_0x50a95b[_0x32ef('0x35')](_0x12de1a[_0x32ef('0x43')]({'attributes':['id',_0x32ef('0x5')]}));_0x50a95b[_0x32ef('0x35')](_0x12de1a[_0x32ef('0x44')]({'attributes':['id',_0x32ef('0x5')]}));break;}return BPromise[_0x32ef('0x45')](_0x50a95b);}})['then'](function(_0x5cb6fc){if(_0x5cb6fc&&_0x5cb6fc[_0x32ef('0x1d')]){for(var _0x270826=0x0;_0x270826<_0x5cb6fc[_0x32ef('0x1d')];_0x270826+=0x1){for(var _0x13b270=0x0;_0x13b270<_0x5cb6fc[_0x270826][_0x32ef('0x1d')];_0x13b270+=0x1){switch(_0x270826){case 0x0:joinOrLeaveQueues(_0x55f7f2,_0x57f5e5,_0x32ef('0x46'),_0x5cb6fc[_0x270826][_0x13b270]);break;case 0x1:joinOrLeaveQueues(_0x55f7f2,_0x57f5e5,_0x32ef('0x47'),_0x5cb6fc[_0x270826][_0x13b270]);break;case 0x2:joinOrLeaveQueues(_0x55f7f2,_0x57f5e5,_0x32ef('0x48'),_0x5cb6fc[_0x270826][_0x13b270]);break;case 0x3:joinOrLeaveQueues(_0x55f7f2,_0x57f5e5,_0x32ef('0x49'),_0x5cb6fc[_0x270826][_0x13b270]);break;case 0x4:joinOrLeaveQueues(_0x55f7f2,_0x57f5e5,_0x32ef('0x4a'),_0x5cb6fc[_0x270826][_0x13b270]);break;case 0x5:joinOrLeaveQueues(_0x55f7f2,_0x57f5e5,_0x32ef('0x4b'),_0x5cb6fc[_0x270826][_0x13b270]);break;case 0x6:joinOrLeaveQueues(_0x55f7f2,_0x57f5e5,_0x32ef('0x4c'),_0x5cb6fc[_0x270826][_0x13b270]);break;case 0x7:if(_0xb30fab[_0x32ef('0x2e')]!=='agent')_0x55f7f2[_0x57f5e5](util[_0x32ef('0x1a')](_0x32ef('0x4d'),_0x5cb6fc[_0x270826][_0x13b270][_0x32ef('0x5')]));break;case 0x8:if(_0xb30fab[_0x32ef('0x2e')]!==_0x32ef('0x7'))_0x55f7f2[_0x57f5e5](util[_0x32ef('0x1a')](_0x32ef('0x4e'),_0x5cb6fc[_0x270826][_0x13b270][_0x32ef('0x5')]));break;case 0x9:if(_0xb30fab[_0x32ef('0x2e')]!==_0x32ef('0x7'))_0x55f7f2[_0x57f5e5](util[_0x32ef('0x1a')](_0x32ef('0x4f'),_0x5cb6fc[_0x270826][_0x13b270][_0x32ef('0x8')],_0x5cb6fc[_0x270826][_0x13b270][_0x32ef('0x5')]));break;case 0xa:_0x55f7f2[_0x57f5e5](util[_0x32ef('0x1a')](_0x32ef('0x1e'),_0x5cb6fc[_0x270826][_0x13b270][_0x32ef('0x5')]));break;}}}}})[_0x32ef('0x17')](function(){if(_0x57f5e5==='leave'){var _0x515ac9=_[_0x32ef('0x50')](_0xb30fab[_0x32ef('0x24')],'id');return _0xb30fab[_0x32ef('0x51')](_0x515ac9)[_0x32ef('0x17')](function(){for(var _0x34bd3e=0x0;_0x34bd3e<_0x515ac9[_0x32ef('0x1d')];_0x34bd3e+=0x1){_0x22f2d7[_0x32ef('0x52')](_0x32ef('0x53'),{'ChatInteractionId':Number(_0x515ac9[_0x34bd3e]),'UserId':Number(_0xb30fab['id'])});}});}})[_0x32ef('0x17')](function(){if(_0x57f5e5===_0x32ef('0x54')){var _0x3697a7=_['map'](_0xb30fab[_0x32ef('0x26')],'id');return _0xb30fab[_0x32ef('0x55')](_0x3697a7)[_0x32ef('0x17')](function(){for(var _0x3fe01f=0x0;_0x3fe01f<_0x3697a7[_0x32ef('0x1d')];_0x3fe01f+=0x1){_0x22f2d7[_0x32ef('0x52')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x3697a7[_0x3fe01f]),'UserId':Number(_0xb30fab['id'])});}});}})[_0x32ef('0x17')](function(){if(_0x57f5e5===_0x32ef('0x54')){var _0x31d5d8=_['map'](_0xb30fab[_0x32ef('0x28')],'id');return _0xb30fab['removeFaxInteractions'](_0x31d5d8)[_0x32ef('0x17')](function(){for(var _0xbe35b=0x0;_0xbe35b<_0x31d5d8['length'];_0xbe35b+=0x1){_0x22f2d7[_0x32ef('0x52')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x31d5d8[_0xbe35b]),'UserId':Number(_0xb30fab['id'])});}});}})[_0x32ef('0x17')](function(){if(_0x57f5e5===_0x32ef('0x54')){var _0x2bff39=_[_0x32ef('0x50')](_0xb30fab[_0x32ef('0x2a')],'id');return _0xb30fab[_0x32ef('0x56')](_0x2bff39)[_0x32ef('0x17')](function(){for(var _0x56260f=0x0;_0x56260f<_0x2bff39['length'];_0x56260f+=0x1){_0x22f2d7[_0x32ef('0x52')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2bff39[_0x56260f]),'UserId':Number(_0xb30fab['id'])});}});}})['then'](function(){if(_0x57f5e5===_0x32ef('0x54')){var _0x89d0b3=_[_0x32ef('0x50')](_0xb30fab[_0x32ef('0x57')],'id');return _0xb30fab[_0x32ef('0x58')](_0x89d0b3)[_0x32ef('0x17')](function(){for(var _0x316547=0x0;_0x316547<_0x89d0b3[_0x32ef('0x1d')];_0x316547+=0x1){_0x22f2d7[_0x32ef('0x52')](_0x32ef('0x59'),{'OpenchannelInteractionId':Number(_0x89d0b3[_0x316547]),'UserId':Number(_0xb30fab['id'])});}});}})['then'](function(){if(_0x57f5e5==='leave'){var _0x120d9d=_[_0x32ef('0x50')](_0xb30fab['WhatsappInteractions'],'id');return _0xb30fab[_0x32ef('0x5a')](_0x120d9d)[_0x32ef('0x17')](function(){for(var _0x2b5703=0x0;_0x2b5703<_0x120d9d['length'];_0x2b5703+=0x1){_0x22f2d7[_0x32ef('0x52')](_0x32ef('0x5b'),{'WhatsappInteractionId':Number(_0x120d9d[_0x2b5703]),'UserId':Number(_0xb30fab['id'])});}});}})[_0x32ef('0x5c')](function(_0x52dfe0){_0x55f7f2['log'](_0x52dfe0);});}}function onDisconnect(_0x13ea1a,_0x47d8bf){joinOrLeave(_0x13ea1a,_0x32ef('0x54'),_0x47d8bf);}function onConnect(_0x5bb114){joinOrLeave(_0x5bb114,'join');}exports[_0x32ef('0x5d')]=function(_0x208989){_0x208989['on'](_0x32ef('0x5e'),function(_0x5dca6a){_0x5dca6a[_0x32ef('0x5f')](0x0);_0x5dca6a[_0x32ef('0x60')]=_0x5dca6a[_0x32ef('0x61')]['connection'][_0x32ef('0x62')]+':'+_0x5dca6a[_0x32ef('0x61')]['connection']['remotePort'];_0x5dca6a[_0x32ef('0x63')]=new Date();_0x5dca6a[_0x32ef('0x64')]=function(_0x2518a0){console[_0x32ef('0x64')](_0x32ef('0x65')+_0x5dca6a[_0x32ef('0x66')]['name']+'['+_0x5dca6a[_0x32ef('0x60')]+']',_0x2518a0);};_0x5dca6a['on'](_0x32ef('0x67'),function(){onDisconnect(_0x5dca6a,_0x208989);_0x5dca6a[_0x32ef('0x64')](_0x32ef('0x68'));});onConnect(_0x5dca6a);_0x5dca6a[_0x32ef('0x64')](_0x32ef('0x69'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 2dfea5f..7837b45 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 _0x68fa=['Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','info','Trigger,\x20%s','error','code','catch','get','motionChannel','event','direction','resolve','then','undefined','ContactId','sequelize','query','Sequelize','contact','UserId','interface','format','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','QueryTypes','SIP/%s','AfterCreate','changed','closed','substatus','User','find','fullname','email','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage'];(function(_0x1d4029,_0x323ce2){var _0x36578b=function(_0x2e317b){while(--_0x2e317b){_0x1d4029['push'](_0x1d4029['shift']());}};_0x36578b(++_0x323ce2);}(_0x68fa,0x16d));var _0xa68f=function(_0xbc0b4d,_0x48d139){_0xbc0b4d=_0xbc0b4d-0x0;var _0x5920d7=_0x68fa[_0xbc0b4d];return _0x5920d7;};'use strict';var util=require(_0xa68f('0x0'));var db=require(_0xa68f('0x1'))['db'];var jayson=require(_0xa68f('0x2'));var logger=require(_0xa68f('0x3'))(_0xa68f('0x4'));var client=jayson[_0xa68f('0x5')][_0xa68f('0x6')]({'port':0x232a});var triggers=[{'channel':_0xa68f('0x7'),'model':_0xa68f('0x8'),'event':_0xa68f('0x9'),'condition':_0xa68f('0xa'),'callback':afterCreate},{'channel':_0xa68f('0x7'),'model':_0xa68f('0x8'),'event':_0xa68f('0xb'),'condition':_0xa68f('0xc'),'callback':afterUpdate},{'channel':_0xa68f('0x7'),'model':_0xa68f('0xd'),'event':_0xa68f('0x9'),'condition':_0xa68f('0xe'),'callback':afterCreateMessage},{'channel':_0xa68f('0x7'),'model':'ChatOfflineMessage','event':_0xa68f('0x9'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0xa68f('0xf'),'model':_0xa68f('0x10'),'event':_0xa68f('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa68f('0xf'),'model':_0xa68f('0x10'),'event':'afterUpdate','condition':_0xa68f('0xc'),'callback':afterUpdate},{'channel':_0xa68f('0xf'),'model':_0xa68f('0x11'),'event':_0xa68f('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa68f('0x12'),'model':_0xa68f('0x13'),'event':_0xa68f('0x9'),'condition':_0xa68f('0xa'),'callback':afterCreate},{'channel':'Whatsapp','model':_0xa68f('0x13'),'event':'afterUpdate','condition':_0xa68f('0xc'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xa68f('0x14'),'event':_0xa68f('0x9'),'condition':_0xa68f('0xe'),'callback':afterCreateMessage},{'channel':_0xa68f('0x15'),'model':_0xa68f('0x16'),'event':'afterCreate','condition':_0xa68f('0xa'),'callback':afterCreate},{'channel':'Fax','model':_0xa68f('0x16'),'event':_0xa68f('0xb'),'condition':_0xa68f('0xc'),'callback':afterUpdate},{'channel':_0xa68f('0x15'),'model':_0xa68f('0x17'),'event':'afterCreate','condition':_0xa68f('0xe'),'callback':afterCreateMessage},{'channel':_0xa68f('0x18'),'model':_0xa68f('0x19'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xa68f('0x18'),'model':_0xa68f('0x19'),'event':'afterUpdate','condition':_0xa68f('0xc'),'callback':afterUpdate},{'channel':'Mail','model':_0xa68f('0x1a'),'event':_0xa68f('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa68f('0x1b'),'model':_0xa68f('0x1c'),'event':_0xa68f('0x9'),'condition':_0xa68f('0xa'),'callback':afterCreate},{'channel':_0xa68f('0x1b'),'model':_0xa68f('0x1c'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa68f('0x1b'),'model':_0xa68f('0x1d'),'event':_0xa68f('0x9'),'condition':_0xa68f('0xe'),'callback':afterCreateMessage}];function request(_0xc6efc1){return client['request'](_0xa68f('0x1e'),_0xc6efc1)['then'](function(_0x1ba9d7){logger[_0xa68f('0x1f')](_0xa68f('0x20'),_0xa68f('0x1e'),_0x1ba9d7);if(_0x1ba9d7['error']){if(_0x1ba9d7[_0xa68f('0x21')][_0xa68f('0x22')]===0x1f4){logger[_0xa68f('0x21')](_0xa68f('0x20'),_0xa68f('0x1e'),_0x1ba9d7[_0xa68f('0x21')]);}}})[_0xa68f('0x23')](function(_0x26de9b){logger[_0xa68f('0x21')](_0xa68f('0x20'),_0xa68f('0x1e'),_0x26de9b);});}function afterCreateMessage(_0x55f2fe){return function(_0x341f67){_0x341f67=_0x341f67[_0xa68f('0x24')]({'plain':!![]});_0x341f67['channel']=_0x55f2fe;_0x341f67[_0xa68f('0x25')]=_0x55f2fe;_0x341f67[_0xa68f('0x26')]=_0x341f67[_0xa68f('0x27')];Promise[_0xa68f('0x28')]()[_0xa68f('0x29')](function(){if(typeof _0x341f67['ContactId']===_0xa68f('0x2a'))return null;var _0x27e04b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x341f67[_0xa68f('0x2b')];return db[_0xa68f('0x2c')][_0xa68f('0x2d')](_0x27e04b,{'type':db[_0xa68f('0x2e')]['QueryTypes']['SELECT'],'raw':!![]});})[_0xa68f('0x29')](function(_0x71968){if(_0x71968){_0x341f67[_0xa68f('0x2f')]=_0x71968[0x0];}if(typeof _0x341f67[_0xa68f('0x30')]===_0xa68f('0x2a'))return;return getAgent(_0x341f67[_0xa68f('0x30')]);})[_0xa68f('0x29')](function(_0x2399c5){if(_0x2399c5){_0x341f67[_0xa68f('0x31')]=util[_0xa68f('0x32')]('SIP/%s',_0x2399c5[_0xa68f('0x33')]);_0x341f67[_0xa68f('0x34')]=_0x2399c5;_0x341f67[_0xa68f('0x35')]=_0x55f2fe;return request({'event':_0xa68f('0x36'),'message':_0x341f67});}else{return request({'event':_0xa68f('0x37'),'message':_0x341f67});}})[_0xa68f('0x23')](function(_0x4b54c7){logger[_0xa68f('0x21')]('Trigger,\x20%s',_0xa68f('0x38'),_0x4b54c7);});};}function afterCreateOfflineMessage(_0x52eb2a){return function(_0x4e1b22){_0x4e1b22=_0x4e1b22[_0xa68f('0x24')]({'plain':!![]});_0x4e1b22[_0xa68f('0x35')]=_0x52eb2a;_0x4e1b22[_0xa68f('0x25')]=_0x52eb2a;_0x4e1b22['event']=_0xa68f('0x39');return request({'event':_0x4e1b22[_0xa68f('0x26')],'message':_0x4e1b22});};}function afterCreate(_0x24034b,_0x3650b8){return function(_0x56310f){_0x56310f=_0x56310f[_0xa68f('0x24')]({'plain':!![]});_0x56310f[_0xa68f('0x35')]=_0x24034b;_0x56310f[_0xa68f('0x25')]=_0x24034b;_0x56310f[_0xa68f('0x26')]=_0xa68f('0x3a');Promise[_0xa68f('0x28')]()[_0xa68f('0x29')](function(){var _0x440127='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x56310f[_0xa68f('0x2b')];return db[_0xa68f('0x2c')][_0xa68f('0x2d')](_0x440127,{'type':db[_0xa68f('0x2e')][_0xa68f('0x3b')]['SELECT'],'raw':!![]});})[_0xa68f('0x29')](function(_0x5dd921){if(_0x5dd921){_0x56310f[_0xa68f('0x2f')]=_0x5dd921[0x0];}if(typeof _0x56310f['UserId']===_0xa68f('0x2a'))return;return getAgent(_0x56310f['UserId']);})['then'](function(_0x195f31){if(_0x195f31){_0x56310f['interface']=util['format'](_0xa68f('0x3c'),_0x195f31[_0xa68f('0x33')]);_0x56310f[_0xa68f('0x34')]=_0x195f31;}return request({'event':_0x3650b8,'message':_0x56310f});})[_0xa68f('0x23')](function(_0x16281f){logger[_0xa68f('0x21')](_0xa68f('0x20'),_0xa68f('0x3d'),_0x16281f);});};}function afterUpdate(_0x3207ad){return function(_0x4f9f21){var _0x1e10d7=_0x4f9f21[_0xa68f('0x3e')](_0xa68f('0x3f'))&&_0x4f9f21[_0xa68f('0x3f')];var _0x1986ed=_0x4f9f21[_0xa68f('0x3e')](_0xa68f('0x40'));if(_0x1e10d7||_0x1986ed){var _0x55de57=_0x1e10d7?_0xa68f('0xc'):_0xa68f('0x40');var _0x4b54ed=_0x4f9f21[_0xa68f('0x24')]({'plain':!![]});_0x4b54ed[_0xa68f('0x35')]=_0x3207ad;_0x4b54ed[_0xa68f('0x25')]=_0x3207ad;_0x4b54ed[_0xa68f('0x26')]=_0x1e10d7?_0xa68f('0x3f'):'substatus';var _0x28d922='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b54ed[_0xa68f('0x2b')];return db[_0xa68f('0x2c')][_0xa68f('0x2d')](_0x28d922,{'type':db[_0xa68f('0x2e')][_0xa68f('0x3b')]['SELECT'],'raw':!![]})['then'](function(_0x28ea3c){if(_0x28ea3c){_0x4b54ed[_0xa68f('0x2f')]=_0x28ea3c[0x0];}if(typeof _0x4b54ed[_0xa68f('0x30')]==='undefined')return;return getAgent(_0x4b54ed[_0xa68f('0x30')]);})[_0xa68f('0x29')](function(_0x14e799){if(_0x14e799){_0x4b54ed['interface']=util[_0xa68f('0x32')](_0xa68f('0x3c'),_0x14e799[_0xa68f('0x33')]);_0x4b54ed[_0xa68f('0x34')]=_0x14e799;}return request({'event':_0x55de57,'message':_0x4b54ed});})[_0xa68f('0x23')](function(_0x1a9c5c){logger[_0xa68f('0x21')]('Trigger,\x20%s','AfterUpdate',_0x1a9c5c);});}};}function getAgent(_0x5ad823){return db[_0xa68f('0x41')][_0xa68f('0x42')]({'where':{'id':_0x5ad823},'attributes':['id',_0xa68f('0x33'),_0xa68f('0x43'),_0xa68f('0x44'),'internal'],'raw':!![]})['then'](function(_0x422567){return _0x422567;});}exports[_0xa68f('0x45')]=function(){for(var _0x53eb8c=0x0;_0x53eb8c=_0x5c56d7['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x312329(_0x22abb6);})['catch'](function(_0x532265){_0x43a42e(_0x532265);});});}; \ No newline at end of file +var _0x4a39=['toLowerCase','includes','clearBlockUser','updateAttributes','getLicense','agent','User','then','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','fax','sms','whatsapp','openchannel','getChannels'];(function(_0xfd1945,_0x29827d){var _0x53d788=function(_0x34cbb6){while(--_0x34cbb6){_0xfd1945['push'](_0xfd1945['shift']());}};_0x53d788(++_0x29827d);}(_0x4a39,0x114));var _0x94a3=function(_0x7f1405,_0x30610b){_0x7f1405=_0x7f1405-0x0;var _0x1093b5=_0x4a39[_0x7f1405];return _0x1093b5;};'use strict';var _=require(_0x94a3('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x94a3('0x1'));var channels=[_0x94a3('0x2'),_0x94a3('0x3'),'chat',_0x94a3('0x4'),_0x94a3('0x5'),_0x94a3('0x6'),_0x94a3('0x7')];exports[_0x94a3('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0xbb97ae){_0xbb97ae=_0xbb97ae[_0x94a3('0x9')]();return _[_0x94a3('0xa')](channels,_0xbb97ae);};exports[_0x94a3('0xb')]=function(_0x387abd,_0x4c753d,_0xcc7ef3,_0x5bfc5f){var _0x3149b5={'loginAttempts':_0x4c753d,'blocked':_0xcc7ef3};if(!_['isUndefined'](_0x5bfc5f)){_0x3149b5['blockedAt']=_0x5bfc5f;}return _0x387abd[_0x94a3('0xc')](_0x3149b5);};exports[_0x94a3('0xd')]=function(_0x213f40){return new BPromise(function(_0x27ec87,_0x1e1b5e){var _0x274e9b=0x0;if(_0x213f40['role']!==_0x94a3('0xe')){_0x27ec87(_0x213f40);}db[_0x94a3('0xf')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x213f40['id']}}})['then'](function(_0x3b3008){_0x274e9b=_0x3b3008;return util[_0x94a3('0xd')]();})[_0x94a3('0x10')](function(_0x3f9d02){if(_0x3f9d02&&_0x3f9d02['agents']&&_0x274e9b>=_0x3f9d02['agents']){throw Error(_0x94a3('0x11'));}_0x27ec87(_0x213f40);})[_0x94a3('0x12')](function(_0x58e834){_0x1e1b5e(_0x58e834);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 745eb5f..e4fc8ae 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfad0=['Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','Out\x20Of\x20Interval','error','stack','statusMessage','send','exports','util','../config/logger','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','inherits'];(function(_0x3ffd40,_0x4c65b8){var _0x14309d=function(_0x48886e){while(--_0x48886e){_0x3ffd40['push'](_0x3ffd40['shift']());}};_0x14309d(++_0x4c65b8);}(_0xfad0,0x196));var _0x0fad=function(_0x2d6fed,_0x44c46b){_0x2d6fed=_0x2d6fed-0x0;var _0x59efbb=_0xfad0[_0x2d6fed];return _0x59efbb;};'use strict';var util=require(_0x0fad('0x0'));var logger=require(_0x0fad('0x1'))('api');var APIError=function(_0x3ce6af,_0x182185){this[_0x0fad('0x2')]=_0x3ce6af||_0x0fad('0x3');this[_0x0fad('0x4')]=_0x182185||_0x0fad('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x37444b){this[_0x0fad('0x2')]=_0x37444b||_0x0fad('0x6');this[_0x0fad('0x4')]=_0x0fad('0x6');util[_0x0fad('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x2f608f){this[_0x0fad('0x2')]=_0x2f608f||_0x0fad('0x8');this[_0x0fad('0x4')]=_0x0fad('0x8');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x341512){this[_0x0fad('0x2')]=_0x341512||_0x0fad('0x9');this[_0x0fad('0x4')]=_0x0fad('0xa');util[_0x0fad('0x7')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2903e5){this['message']=_0x2903e5||_0x0fad('0xb');this[_0x0fad('0x4')]='Out\x20Of\x20Interval';this[_0x0fad('0xc')]=0x193;this[_0x0fad('0xd')]={'type':_0x0fad('0xe')};util['inherits'](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x22962e){this[_0x0fad('0x2')]=_0x22962e||_0x0fad('0xf');this[_0x0fad('0x4')]=_0x0fad('0x10');util[_0x0fad('0x7')](APIBadRequestError,APIError);};function getStatusCode(_0x511f93){switch(_0x511f93){case _0x0fad('0x6'):return 0x190;case'Forbidden',_0x0fad('0x11'):return 0x193;case _0x0fad('0xa'):return 0x194;case _0x0fad('0x10'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x495c7c){if(_0x495c7c===_0x0fad('0x11'))return _0x495c7c;return null;}function handleError(_0x5a327d){return function(_0x51e90f){logger[_0x0fad('0x12')](_0x51e90f[_0x0fad('0x13')]);var _0x1aa916=getStatusCode(_0x51e90f[_0x0fad('0x4')]);var _0x5d30c5=getCustomStatusMessage(_0x51e90f['name']);if(_0x51e90f[_0x0fad('0x4')]){delete _0x51e90f[_0x0fad('0x4')];}if(_0x5d30c5){_0x5a327d[_0x0fad('0x14')]=_0x5d30c5;}return _0x5a327d['status'](_0x1aa916)[_0x0fad('0x15')](_0x51e90f);};}module[_0x0fad('0x16')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x593f=['Bad\x20Request','message','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','code','details','OutOfInterval','Conflict','Out\x20Of\x20Interval','status','util','../config/logger','Internal\x20Server\x20Error','name','Error','inherits'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x593f,0x78));var _0xf593=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x593f[_0x4c7935];return _0x30651d;};'use strict';var util=require(_0xf593('0x0'));var logger=require(_0xf593('0x1'))('api');var APIError=function(_0x553ca7,_0x41479a){this['message']=_0x553ca7||_0xf593('0x2');this[_0xf593('0x3')]=_0x41479a||_0xf593('0x4');util[_0xf593('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5f2e96){this['message']=_0x5f2e96||_0xf593('0x6');this[_0xf593('0x3')]='Bad\x20Request';util[_0xf593('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x25bbf2){this[_0xf593('0x7')]=_0x25bbf2||'Forbidden';this[_0xf593('0x3')]=_0xf593('0x8');util[_0xf593('0x5')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x299007){this[_0xf593('0x7')]=_0x299007||_0xf593('0x9');this[_0xf593('0x3')]=_0xf593('0xa');util[_0xf593('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x5966b0){this['message']=_0x5966b0||_0xf593('0xb');this['name']='Out\x20Of\x20Interval';this[_0xf593('0xc')]=0x193;this[_0xf593('0xd')]={'type':_0xf593('0xe')};util[_0xf593('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x2dc1cd){this[_0xf593('0x7')]=_0x2dc1cd||'Resource\x20Conflict';this['name']=_0xf593('0xf');util[_0xf593('0x5')](APIBadRequestError,APIError);};function getStatusCode(_0x32c1fa){switch(_0x32c1fa){case _0xf593('0x6'):return 0x190;case'Forbidden',_0xf593('0x10'):return 0x193;case _0xf593('0xa'):return 0x194;case _0xf593('0xf'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0xb44d10){if(_0xb44d10===_0xf593('0x10'))return _0xb44d10;return null;}function handleError(_0x5aa3a1){return function(_0x54a37d){logger['error'](_0x54a37d['stack']);var _0x25cb09=getStatusCode(_0x54a37d[_0xf593('0x3')]);var _0x15f2f3=getCustomStatusMessage(_0x54a37d[_0xf593('0x3')]);if(_0x54a37d[_0xf593('0x3')]){delete _0x54a37d[_0xf593('0x3')];}if(_0x15f2f3){_0x5aa3a1['statusMessage']=_0x15f2f3;}return _0x5aa3a1[_0xf593('0x11')](_0x25cb09)['send'](_0x54a37d);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 43ef52c..b2d2c7c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2405=['404','status','send','exports'];(function(_0x39db0b,_0x3514ef){var _0x185c44=function(_0x26d7a5){while(--_0x26d7a5){_0x39db0b['push'](_0x39db0b['shift']());}};_0x185c44(++_0x3514ef);}(_0x2405,0x173));var _0x5240=function(_0x41c88c,_0x381f8d){_0x41c88c=_0x41c88c-0x0;var _0x2c97ea=_0x2405[_0x41c88c];return _0x2c97ea;};'use strict';module[_0x5240('0x0')][0x194]=function pageNotFound(_0x16f0e5,_0x4fda7a){var _0x2cc05f=_0x5240('0x1');var _0x26d18f=0x194;var _0x30085d={'status':_0x26d18f};_0x4fda7a['status'](_0x30085d[_0x5240('0x2')]);_0x4fda7a['render'](_0x2cc05f,{},function(_0x456d0d,_0x21cb4d){if(_0x456d0d){return _0x4fda7a[_0x5240('0x2')](_0x30085d[_0x5240('0x2')])['json'](_0x30085d);}_0x4fda7a[_0x5240('0x3')](_0x21cb4d);});}; \ No newline at end of file +var _0xb7ee=['exports','404','status','render','json','send'];(function(_0x35f18a,_0x4e66d3){var _0x52d4e0=function(_0x267f42){while(--_0x267f42){_0x35f18a['push'](_0x35f18a['shift']());}};_0x52d4e0(++_0x4e66d3);}(_0xb7ee,0xba));var _0xeb7e=function(_0x3d1fa7,_0x4a12af){_0x3d1fa7=_0x3d1fa7-0x0;var _0x37f817=_0xb7ee[_0x3d1fa7];return _0x37f817;};'use strict';module[_0xeb7e('0x0')][0x194]=function pageNotFound(_0x27beed,_0x3952a7){var _0x4d5ce5=_0xeb7e('0x1');var _0x3bee91=0x194;var _0x504bad={'status':_0x3bee91};_0x3952a7['status'](_0x504bad[_0xeb7e('0x2')]);_0x3952a7[_0xeb7e('0x3')](_0x4d5ce5,{},function(_0x3dd89f,_0x38ca0f){if(_0x3dd89f){return _0x3952a7[_0xeb7e('0x2')](_0x504bad[_0xeb7e('0x2')])[_0xeb7e('0x4')](_0x504bad);}_0x3952a7[_0xeb7e('0x5')](_0x38ca0f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 18483b2..dc24bb6 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x883e=['OpenchannelQueues','WhatsappQueue','WhatsappQueues','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','VoiceChanSpy','VoiceExtension','SpiedAgents','ChanSpyId','VoiceQueueId','HopperHistories','JscriptySessions','Trunk','TrunkId','TrunkBackup','IntervalId','Pause','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailbox','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','CloudProvider','CloudProviderId','restrict','MailAccountId','Smtp','Answers','Interactions','MailApplication','Applications','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatOfflineMessage','ChatOfflineMessageId','TagId','MailQueueReport','Items','Disposition','Dispositions','FaxAccountId','Exntensions','fax_interaction_has_tags','FaxInteractionId','Interaction','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ChatApplication','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','Members','chat_group_has_users','CompanyId','CmContactHasItem','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','AnalyticFieldReport','SalesforceConfiguration','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','Variable','VariableId','SugarcrmConfiguration','Field','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','FreshdeskConfiguration','ToId','SessionId','ProjectId','user_has_teams','team_has_mail_queues','MailQueues','ChatQueues','team_has_fax_queues','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','HopperBlacks','TrunkBackupId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','CmHopperHistory','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','127.0.0.1','database','username','password','options','User','../api/user/user.model','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','UserId','hasOne','userSetting','cascade','VoiceRecording','Recordings','VoiceQueuesRt','hasMany','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','Hoppers','SET\x20NULL','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','UserMailQueue','FaxQueues','SmsQueues'];(function(_0x4b47b8,_0x2ab2b2){var _0x89cd2e=function(_0x2cb89f){while(--_0x2cb89f){_0x4b47b8['push'](_0x4b47b8['shift']());}};_0x89cd2e(++_0x2ab2b2);}(_0x883e,0xd0));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var config=require(_0xe883('0x0'));var Sequelize=require(_0xe883('0x1'));var _=require(_0xe883('0x2'));var jstz=require('jstz');var timezone=jstz[_0xe883('0x3')]();config[_0xe883('0x1')]=_[_0xe883('0x4')](config[_0xe883('0x1')],{'database':_0xe883('0x5'),'username':'xcall','password':_0xe883('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xe883('0x7'),'dialectOptions':{'charset':_0xe883('0x8')},'logging':![],'timezone':timezone[_0xe883('0x9')](),'define':{'charset':_0xe883('0xa'),'collate':_0xe883('0xb')}}});config[_0xe883('0xc')]=_['defaultsDeep'](config[_0xe883('0xc')],{'database':_0xe883('0x5'),'username':_0xe883('0xd'),'password':_0xe883('0x6'),'options':{'host':_0xe883('0xe'),'port':0xcea,'dialect':_0xe883('0x7'),'dialectOptions':{'charset':_0xe883('0x8')},'logging':![],'timezone':timezone[_0xe883('0x9')](),'define':{'charset':_0xe883('0xa'),'collate':_0xe883('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xe883('0xf')],config[_0xe883('0x1')][_0xe883('0x10')],config[_0xe883('0x1')][_0xe883('0x11')],config[_0xe883('0x1')][_0xe883('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe883('0xc')][_0xe883('0xf')],config[_0xe883('0xc')][_0xe883('0x10')],config[_0xe883('0xc')]['password'],config[_0xe883('0xc')][_0xe883('0x12')])};db[_0xe883('0x13')]=db[_0xe883('0x1')]['import'](_0xe883('0x14'));db['VoiceChanSpy']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x16'));db[_0xe883('0x17')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x18'));db['VoiceExtension']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x19'));db[_0xe883('0x1a')]=db[_0xe883('0x1')]['import'](_0xe883('0x1b'));db[_0xe883('0x1c')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0xe883('0x1')][_0xe883('0x15')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db['sequelize'][_0xe883('0x15')](_0xe883('0x1d'));db[_0xe883('0x1e')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x1f'));db[_0xe883('0x20')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x21'));db[_0xe883('0x22')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x23'));db[_0xe883('0x24')]=db[_0xe883('0x1')]['import'](_0xe883('0x25'));db[_0xe883('0x26')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x27'));db['VoiceQueueReport']=db[_0xe883('0x1')][_0xe883('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xe883('0x28')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x29'));db['Trunk']=db['sequelize'][_0xe883('0x15')]('../api/trunk/trunk.model');db[_0xe883('0x2a')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x2b'));db[_0xe883('0x2c')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x2d'));db['UserVoiceQueue']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x2e'));db[_0xe883('0x2f')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x30'));db['UserMailQueue']=db[_0xe883('0x1')]['import'](_0xe883('0x31'));db[_0xe883('0x32')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0xe883('0x33')]=db[_0xe883('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0xe883('0x34')]=db[_0xe883('0x1')]['import'](_0xe883('0x35'));db[_0xe883('0x36')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x37'));db[_0xe883('0x38')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x39'));db[_0xe883('0x3a')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x3b'));db['MailAccount']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x3c'));db[_0xe883('0x3d')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x3e'));db[_0xe883('0x3f')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x40'));db['MailInteraction']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x41'));db[_0xe883('0x42')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x43'));db['MailApplication']=db['sequelize'][_0xe883('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x44'));db[_0xe883('0x45')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x46'));db[_0xe883('0x47')]=db[_0xe883('0x1')]['import']('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db['sequelize']['import']('../api/faxAccount/faxAccount.model');db[_0xe883('0x48')]=db[_0xe883('0x1')]['import'](_0xe883('0x49'));db[_0xe883('0x4a')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x4b'));db[_0xe883('0x4c')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x4d'));db[_0xe883('0x4e')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/faxQueue/faxQueue.model');db[_0xe883('0x4f')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db['sequelize']['import'](_0xe883('0x50'));db[_0xe883('0x51')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x52'));db[_0xe883('0x53')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0xe883('0x54')]=db[_0xe883('0x1')]['import']('../api/smsMessage/smsMessage.model');db[_0xe883('0x55')]=db[_0xe883('0x1')]['import'](_0xe883('0x56'));db['OpenchannelAccount']=db['sequelize'][_0xe883('0x15')](_0xe883('0x57'));db[_0xe883('0x58')]=db[_0xe883('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0xe883('0x59')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xe883('0x5a')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x5b'));db[_0xe883('0x5c')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x5d'));db[_0xe883('0x5e')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x5f'));db['OpenchannelQueueReport']=db['sequelize'][_0xe883('0x15')](_0xe883('0x60'));db['ChatApplication']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x61'));db[_0xe883('0x62')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x63'));db[_0xe883('0x64')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x65'));db['ChatOfflineMessage']=db[_0xe883('0x1')][_0xe883('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xe883('0x66')]=db['sequelize']['import'](_0xe883('0x67'));db[_0xe883('0x68')]=db['sequelize']['import'](_0xe883('0x69'));db['ChatProactiveAction']=db[_0xe883('0x1')]['import'](_0xe883('0x6a'));db[_0xe883('0x6b')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x6c'));db['CmContact']=db['sequelize'][_0xe883('0x15')](_0xe883('0x6d'));db[_0xe883('0x6e')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x6f'));db[_0xe883('0x70')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xe883('0x71')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x72'));db['CmHopperHistory']=db['sequelize']['import'](_0xe883('0x73'));db['ReportAgentPreview']=db[_0xe883('0x1')]['import'](_0xe883('0x74'));db[_0xe883('0x75')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x76'));db[_0xe883('0x77')]=db[_0xe883('0x1')]['import'](_0xe883('0x78'));db[_0xe883('0x79')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x7a'));db[_0xe883('0x7b')]=db[_0xe883('0x1')]['import'](_0xe883('0x7c'));db['Disposition']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x7d'));db[_0xe883('0x7e')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x7f'));db[_0xe883('0x80')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x81'));db['Pause']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x82'));db[_0xe883('0x83')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x84'));db['VoiceQueuesLog']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x85'));db[_0xe883('0x86')]=db[_0xe883('0x1')]['import'](_0xe883('0x87'));db[_0xe883('0x88')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x89'));db[_0xe883('0x8a')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x8b'));db[_0xe883('0x8c')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x8d'));db['CmContactHasItem']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x8e'));db[_0xe883('0x8f')]=db['sequelize']['import'](_0xe883('0x90'));db['Template']=db[_0xe883('0x1')]['import'](_0xe883('0x91'));db[_0xe883('0x92')]=db[_0xe883('0x1')]['import']('../api/trigger/trigger.model');db['Variable']=db[_0xe883('0x1')][_0xe883('0x15')]('../api/variable/variable.model');db[_0xe883('0x93')]=db[_0xe883('0x1')]['import'](_0xe883('0x94'));db['IntegrationReport']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x95'));db[_0xe883('0x96')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x97'));db[_0xe883('0x98')]=db['sequelize']['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db['sequelize'][_0xe883('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xe883('0x99')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x9a'));db['AnalyticFieldReport']=db['sequelize'][_0xe883('0x15')](_0xe883('0x9b'));db['AnalyticTreeReport']=db[_0xe883('0x1')][_0xe883('0x15')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xe883('0x9c')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x9d'));db['SalesforceConfiguration']=db['sequelize'][_0xe883('0x15')](_0xe883('0x9e'));db[_0xe883('0x9f')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xe883('0xa0')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xa1'));db['SugarcrmConfiguration']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xa2'));db[_0xe883('0xa3')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xa4'));db[_0xe883('0xa5')]=db[_0xe883('0x1')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xe883('0xa6')]=db[_0xe883('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xe883('0xa7')]=db['sequelize'][_0xe883('0x15')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xa8'));db[_0xe883('0xa9')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xaa'));db[_0xe883('0xab')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xac'));db[_0xe883('0xad')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xae'));db[_0xe883('0xaf')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xb0'));db[_0xe883('0xb1')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xb2'));db['FreshdeskConfiguration']=db[_0xe883('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xe883('0xb3')]=db[_0xe883('0x1')]['import'](_0xe883('0xb4'));db[_0xe883('0xb5')]=db[_0xe883('0x1')]['import'](_0xe883('0xb6'));db[_0xe883('0xb7')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xb8'));db[_0xe883('0xb9')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xba'));db[_0xe883('0xbb')]=db['sequelize'][_0xe883('0x15')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xe883('0xbc')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xbd'));db[_0xe883('0xbe')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xbf'));db[_0xe883('0xc0')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xe883('0xc1')]=db['sequelize']['import'](_0xe883('0xc2'));db[_0xe883('0xc3')]=db['sequelize']['import'](_0xe883('0xc4'));db[_0xe883('0xc5')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xc6'));db[_0xe883('0xc7')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xc8'));db[_0xe883('0xc9')]=db['sequelize']['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0xe883('0x93')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x94'));db[_0xe883('0xca')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xcb'));db[_0xe883('0xcc')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xcd'));db[_0xe883('0xce')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xcf'));db[_0xe883('0xd0')]=db[_0xe883('0x1')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xe883('0xd1')]=db[_0xe883('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xe883('0xd2')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xe883('0xd3')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xd4'));db[_0xe883('0xd5')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xd6'));db[_0xe883('0xd7')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xe883('0xd8')]=db[_0xe883('0x1')]['import'](_0xe883('0xd9'));db[_0xe883('0xda')]=db[_0xe883('0x1')]['import'](_0xe883('0xdb'));db[_0xe883('0xdc')]=db[_0xe883('0x1')]['import'](_0xe883('0xdd'));db[_0xe883('0xde')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xdf'));db[_0xe883('0xe0')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xe1'));db['SquareMessage']=db['sequelize']['import'](_0xe883('0xe2'));db['Team']=db[_0xe883('0x1')]['import'](_0xe883('0xe3'));db[_0xe883('0xe4')]=db[_0xe883('0x1')]['import'](_0xe883('0xe5'));db[_0xe883('0xe6')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/campaign/campaign.model');db[_0xe883('0xe7')]=db['sequelize']['import'](_0xe883('0xe8'));db[_0xe883('0xe9')]=db['sequelize'][_0xe883('0x15')]('../api/attachment/attachment.model');db[_0xe883('0xea')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/plugin/plugin.model');db[_0xe883('0xeb')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xec'));db[_0xe883('0xed')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xee'));db[_0xe883('0xef')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0xe883('0xf0')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xf1'));db[_0xe883('0xf2')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xf3'));db[_0xe883('0xf4')]=db['sequelize'][_0xe883('0x15')](_0xe883('0xf5'));db[_0xe883('0xf6')]=db[_0xe883('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xe883('0x1')]['import'](_0xe883('0xf7'));db[_0xe883('0xf8')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0xe883('0xf9')]=db[_0xe883('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0xe883('0xfa')]=db[_0xe883('0x1')]['import'](_0xe883('0xfb'));db[_0xe883('0xfc')]=db['sequelize'][_0xe883('0x15')]('../api/whatsappAccount/whatsappAccount.model');db[_0xe883('0xfd')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0xfe'));db[_0xe883('0xff')]=db[_0xe883('0x1')]['import'](_0xe883('0x100'));db[_0xe883('0x101')]=db['sequelize'][_0xe883('0x15')](_0xe883('0x102'));db[_0xe883('0x103')]=db[_0xe883('0x1')][_0xe883('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xe883('0x104')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x105'));db['WhatsappQueue']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x106'));db['CloudProvider']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x107'));db[_0xe883('0x108')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x109'));db['TeamVoicePrefix']=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x10a'));db['UserVoicePrefix']=db['sequelize'][_0xe883('0x15')](_0xe883('0x10b'));db[_0xe883('0x10c')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x10d'));db[_0xe883('0x10e')]=db[_0xe883('0x1')][_0xe883('0x15')](_0xe883('0x10f'));db[_0xe883('0x13')]['hasOne'](db['VoiceMail'],{'as':_0xe883('0x1e'),'onDelete':'cascade','foreignKey':_0xe883('0x110')});db[_0xe883('0x13')][_0xe883('0x111')](db['UserSetting'],{'as':_0xe883('0x112'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x13')]['hasMany'](db[_0xe883('0x114')],{'as':_0xe883('0x115'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x13')]['hasMany'](db[_0xe883('0x2c')],{'as':_0xe883('0x116'),'foreignKey':'UserId'});db['User'][_0xe883('0x117')](db['VoiceExtension'],{'as':_0xe883('0x118'),'onDelete':_0xe883('0x113'),'hooks':!![]});db[_0xe883('0x13')][_0xe883('0x117')](db[_0xe883('0x71')],{'as':_0xe883('0x119'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x13')]['hasMany'](db['CmHopperHistory'],{'as':_0xe883('0x11a'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x13')]['hasMany'](db[_0xe883('0x11b')],{'as':_0xe883('0x11b'),'foreignKey':'UserId'});db['User'][_0xe883('0x117')](db['OpenchannelInteraction'],{'as':_0xe883('0x11c'),'foreignKey':_0xe883('0x110')});db['User'][_0xe883('0x117')](db[_0xe883('0x62')],{'as':_0xe883('0x11d'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x13')][_0xe883('0x117')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xe883('0x110')});db[_0xe883('0x13')][_0xe883('0x117')](db[_0xe883('0x4a')],{'as':_0xe883('0x11e'),'foreignKey':'UserId'});db[_0xe883('0x13')]['hasMany'](db[_0xe883('0x11f')],{'as':_0xe883('0x120'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x13')][_0xe883('0x117')](db[_0xe883('0xff')],{'as':_0xe883('0x121'),'foreignKey':'UserId'});db[_0xe883('0x13')][_0xe883('0x117')](db[_0xe883('0xfa')],{'as':_0xe883('0x122'),'foreignKey':_0xe883('0x123')});db[_0xe883('0x13')]['hasMany'](db[_0xe883('0x6e')],{'as':_0xe883('0x124'),'foreignKey':_0xe883('0x110'),'onDelete':_0xe883('0x125')});db[_0xe883('0x13')][_0xe883('0x126')](db['UserProfile'],{'as':_0xe883('0x127'),'foreignKey':_0xe883('0x128')});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x68')],{'as':_0xe883('0x12a'),'through':'chat_group_has_users'});db[_0xe883('0x13')]['belongsToMany'](db[_0xe883('0x12b')],{'as':_0xe883('0x12c'),'through':_0xe883('0x12d')});db[_0xe883('0x13')]['belongsToMany'](db[_0xe883('0xf4')],{'as':_0xe883('0x12e'),'through':_0xe883('0x12f')});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x130')],{'through':'user_has_teams'});db[_0xe883('0x13')][_0xe883('0x129')](db['MailInteraction'],{'as':'MailInteractions','through':_0xe883('0x131')});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x62')],{'as':_0xe883('0x11d'),'through':'user_has_chat_interactions'});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x4a')],{'as':_0xe883('0x11e'),'through':_0xe883('0x132')});db[_0xe883('0x13')][_0xe883('0x129')](db['SmsInteraction'],{'as':_0xe883('0x133'),'through':_0xe883('0x134')});db[_0xe883('0x13')]['belongsToMany'](db[_0xe883('0x59')],{'as':_0xe883('0x11c'),'through':'user_has_openchannel_interactions'});db['User'][_0xe883('0x129')](db[_0xe883('0xff')],{'as':'WhatsappInteractions','through':_0xe883('0x135')});db['User'][_0xe883('0x129')](db[_0xe883('0x1c')],{'as':_0xe883('0x136'),'through':_0xe883('0x137'),'required':![]});db[_0xe883('0x13')][_0xe883('0x129')](db['VoicePrefix'],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0xe883('0x13')][_0xe883('0x129')](db['MailQueue'],{'as':'MailQueues','through':_0xe883('0x138'),'required':![]});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x66')],{'as':'ChatQueues','through':_0xe883('0x2f'),'required':![],'hooks':!![]});db[_0xe883('0x13')]['belongsToMany'](db[_0xe883('0x4e')],{'as':_0xe883('0x139'),'through':_0xe883('0x32'),'required':![]});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x55')],{'as':_0xe883('0x13a'),'through':'UserSmsQueue','required':![]});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x5c')],{'as':_0xe883('0x13b'),'through':_0xe883('0x34'),'required':![]});db[_0xe883('0x13')]['belongsToMany'](db[_0xe883('0x13c')],{'as':_0xe883('0x13d'),'through':_0xe883('0x36'),'required':![]});db[_0xe883('0x13')][_0xe883('0x129')](db['CmList'],{'through':_0xe883('0x12f')});db['User'][_0xe883('0x129')](db[_0xe883('0x5e')],{'as':'ChatWebsites','through':_0xe883('0x13e')});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x13f')],{'as':_0xe883('0x140'),'through':_0xe883('0x141')});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x142')],{'as':_0xe883('0x143'),'through':_0xe883('0x144')});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0x145')],{'as':_0xe883('0x146'),'through':_0xe883('0x147')});db[_0xe883('0x13')]['belongsToMany'](db[_0xe883('0x148')],{'as':'SmsAccounts','through':_0xe883('0x149')});db[_0xe883('0x13')][_0xe883('0x129')](db[_0xe883('0xfc')],{'as':_0xe883('0x14a'),'through':'user_has_whatsapp_accounts'});db[_0xe883('0x14b')][_0xe883('0x117')](db[_0xe883('0x14c')],{'as':_0xe883('0x14d'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x14e')});db[_0xe883('0x17')][_0xe883('0x117')](db[_0xe883('0x14c')],{'onDelete':_0xe883('0x113')});db['VoiceExtension']['hasMany'](db[_0xe883('0x14c')],{'as':'Applications','onDelete':'cascade'});db[_0xe883('0x1a')][_0xe883('0x129')](db[_0xe883('0x88')],{'as':'Sounds','through':'moh_has_sounds'});db['VoiceQueue'][_0xe883('0x117')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0xe883('0x14f')});db[_0xe883('0x1c')][_0xe883('0x117')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xe883('0x14f')});db['VoiceQueue'][_0xe883('0x117')](db[_0xe883('0x71')],{'as':_0xe883('0x119'),'foreignKey':'VoiceQueueId'});db[_0xe883('0x1c')][_0xe883('0x117')](db['CmHopperHistory'],{'as':_0xe883('0x150'),'foreignKey':_0xe883('0x14f')});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':_0xe883('0x11b'),'foreignKey':_0xe883('0x14f')});db['VoiceQueue'][_0xe883('0x117')](db[_0xe883('0x70')],{'as':'HopperBlacks','foreignKey':_0xe883('0x14f')});db[_0xe883('0x1c')]['hasMany'](db['JscriptySessionReport'],{'as':_0xe883('0x151'),'foreignKey':_0xe883('0x14f')});db[_0xe883('0x1c')]['belongsTo'](db[_0xe883('0x152')],{'as':_0xe883('0x152'),'foreignKey':_0xe883('0x153')});db[_0xe883('0x1c')][_0xe883('0x126')](db[_0xe883('0x152')],{'as':_0xe883('0x154'),'foreignKey':'TrunkBackupId'});db[_0xe883('0x1c')][_0xe883('0x126')](db['Interval'],{'as':'Interval','foreignKey':_0xe883('0x155')});db[_0xe883('0x1c')][_0xe883('0x126')](db[_0xe883('0x156')],{'as':_0xe883('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe883('0x1c')][_0xe883('0x129')](db[_0xe883('0xf4')],{'as':_0xe883('0x12e'),'through':_0xe883('0x158')});db[_0xe883('0x1c')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':'UserVoiceQueue'});db[_0xe883('0x1c')][_0xe883('0x129')](db[_0xe883('0x130')],{'as':_0xe883('0x15a'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0xe883('0x129')](db['CmList'],{'as':_0xe883('0x15b'),'through':_0xe883('0x15c')});db['VoiceRecording'][_0xe883('0x126')](db[_0xe883('0x13')],{'as':_0xe883('0x13'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x15d')][_0xe883('0x126')](db[_0xe883('0x13')],{'as':_0xe883('0x13'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x1e')][_0xe883('0x117')](db['VoiceMailMessage'],{'as':_0xe883('0x15e'),'onDelete':_0xe883('0x113'),'foreignKey':'mailboxuser','sourceKey':_0xe883('0x15f')});db[_0xe883('0x20')][_0xe883('0x126')](db[_0xe883('0x1e')],{'foreignKey':_0xe883('0x160'),'targetKey':'mailbox'});db[_0xe883('0x22')][_0xe883('0x117')](db[_0xe883('0x161')],{'as':_0xe883('0x162'),'foreignKey':_0xe883('0x163'),'constraints':![]});db['VoiceCallReport'][_0xe883('0x117')](db['VoiceAgentReport'],{'as':_0xe883('0x164'),'foreignKey':'uniqueid','constraints':![]});db[_0xe883('0x22')]['belongsTo'](db[_0xe883('0x13')],{'as':_0xe883('0x13'),'foreignKey':'UserId'});db['VoiceCallReport'][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db[_0xe883('0x38')][_0xe883('0x126')](db[_0xe883('0x142')],{'as':_0xe883('0x142'),'foreignKey':'MailAccountId'});db[_0xe883('0x38')][_0xe883('0x126')](db[_0xe883('0x167')],{'as':'CloudProvider','foreignKey':_0xe883('0x168'),'onDelete':_0xe883('0x169')});db[_0xe883('0x3a')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xe883('0x16a')});db[_0xe883('0x3a')][_0xe883('0x126')](db[_0xe883('0x167')],{'as':_0xe883('0x167'),'foreignKey':'CloudProviderId','onDelete':_0xe883('0x169')});db[_0xe883('0x142')][_0xe883('0x111')](db[_0xe883('0x38')],{'as':'Imap','onDelete':_0xe883('0x113')});db[_0xe883('0x142')][_0xe883('0x111')](db[_0xe883('0x3a')],{'as':_0xe883('0x16b'),'onDelete':_0xe883('0x113')});db[_0xe883('0x142')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xe883('0x16a'),'onDelete':_0xe883('0x113')});db[_0xe883('0x142')]['hasMany'](db[_0xe883('0x7b')],{'as':_0xe883('0x16c'),'foreignKey':_0xe883('0x16a')});db['MailAccount'][_0xe883('0x117')](db[_0xe883('0x42')],{'as':_0xe883('0x15e'),'foreignKey':_0xe883('0x16a')});db['MailAccount'][_0xe883('0x117')](db[_0xe883('0x11f')],{'as':_0xe883('0x16d')});db[_0xe883('0x142')][_0xe883('0x117')](db[_0xe883('0x16e')],{'as':_0xe883('0x16f'),'foreignKey':_0xe883('0x16a'),'onDelete':_0xe883('0x113')});db['MailAccount'][_0xe883('0x126')](db['CmList'],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171')});db[_0xe883('0x142')][_0xe883('0x126')](db['Template'],{'as':_0xe883('0x172'),'foreignKey':_0xe883('0x173')});db['MailAccount'][_0xe883('0x126')](db['Pause'],{'as':_0xe883('0x157'),'foreignKey':_0xe883('0x174')});db['MailAccount']['belongsToMany'](db['User'],{'as':'Agents','through':_0xe883('0x144')});db[_0xe883('0x3d')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':'Agents','through':_0xe883('0x138')});db[_0xe883('0x3d')][_0xe883('0x129')](db[_0xe883('0x130')],{'through':'team_has_mail_queues','as':_0xe883('0x15a')});db[_0xe883('0x11f')][_0xe883('0x117')](db[_0xe883('0x42')],{'as':_0xe883('0x15e'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x175')});db[_0xe883('0x11f')][_0xe883('0x126')](db[_0xe883('0x142')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x16a')});db['MailInteraction'][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':'Contact','foreignKey':'ContactId'});db[_0xe883('0x11f')]['belongsTo'](db['User'],{'as':_0xe883('0x177'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x11f')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':_0xe883('0x178'),'as':_0xe883('0x179')});db['MailInteraction'][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':_0xe883('0x178'),'as':_0xe883('0x17a')});db[_0xe883('0x11f')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x17b'),'through':_0xe883('0x131'),'foreignKey':_0xe883('0x175')});db[_0xe883('0x42')][_0xe883('0x117')](db[_0xe883('0xe9')],{'as':_0xe883('0x17c'),'onDelete':_0xe883('0x113')});db['MailMessage']['belongsTo'](db[_0xe883('0x13')],{'as':_0xe883('0x13')});db[_0xe883('0x42')][_0xe883('0x126')](db[_0xe883('0x12b')],{'onDelete':'cascade','as':'Contact'});db[_0xe883('0x42')][_0xe883('0x126')](db[_0xe883('0x11f')],{'as':'Interaction','foreignKey':_0xe883('0x175')});db['MailMessage']['belongsTo'](db[_0xe883('0x142')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x16a')});db['MailMessage'][_0xe883('0x126')](db['ChatWebsite'],{'as':_0xe883('0x5e'),'foreignKey':'ChatWebsiteId'});db[_0xe883('0x42')][_0xe883('0x126')](db[_0xe883('0x17d')],{'as':_0xe883('0x17d'),'foreignKey':_0xe883('0x17e')});db[_0xe883('0x16e')][_0xe883('0x126')](db[_0xe883('0x13')],{'onDelete':_0xe883('0x169')});db['MailApplication'][_0xe883('0x126')](db[_0xe883('0x3d')],{'onDelete':_0xe883('0x169')});db[_0xe883('0x16e')][_0xe883('0x126')](db[_0xe883('0x142')],{'onDelete':_0xe883('0x169')});db['MailApplication'][_0xe883('0x126')](db['Interval'],{'onDelete':_0xe883('0x169'),'foreignKey':_0xe883('0x155')});db['MailApplication'][_0xe883('0x126')](db[_0xe883('0x8a')],{'onDelete':_0xe883('0x169'),'foreignKey':_0xe883('0x17f')});db['MailQueueReport']['belongsTo'](db[_0xe883('0x142')],{});db[_0xe883('0x180')][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171')});db[_0xe883('0x180')][_0xe883('0x126')](db['CmContact'],{'as':_0xe883('0x165'),'foreignKey':'ContactId'});db['MailQueueReport'][_0xe883('0x126')](db[_0xe883('0x11f')],{});db[_0xe883('0x180')][_0xe883('0x126')](db[_0xe883('0x42')],{});db[_0xe883('0x180')][_0xe883('0x126')](db[_0xe883('0x13')],{});db[_0xe883('0x180')][_0xe883('0x126')](db[_0xe883('0x3d')],{});db['Dashboard'][_0xe883('0x117')](db[_0xe883('0x47')],{'as':_0xe883('0x181'),'onDelete':'cascade'});db['FaxAccount'][_0xe883('0x117')](db[_0xe883('0x182')],{'as':_0xe883('0x183'),'foreignKey':_0xe883('0x184'),'onDelete':_0xe883('0x113')});db[_0xe883('0x13f')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xe883('0x184')});db['FaxAccount'][_0xe883('0x117')](db['FaxInteraction'],{'as':'Interactions'});db[_0xe883('0x13f')]['hasMany'](db['FaxApplication'],{'as':_0xe883('0x16f'),'foreignKey':_0xe883('0x184'),'onDelete':_0xe883('0x113')});db[_0xe883('0x13f')]['hasMany'](db[_0xe883('0x14c')],{'as':_0xe883('0x185'),'onDelete':_0xe883('0x113')});db[_0xe883('0x13f')][_0xe883('0x117')](db[_0xe883('0x4c')],{'as':_0xe883('0x15e')});db[_0xe883('0x13f')]['belongsTo'](db[_0xe883('0x152')],{'as':'Trunk'});db[_0xe883('0x13f')][_0xe883('0x126')](db['CmList'],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171')});db['FaxAccount']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe883('0x174')});db[_0xe883('0x13f')]['belongsToMany'](db[_0xe883('0x13')],{'as':'Agents','through':_0xe883('0x141')});db[_0xe883('0x48')][_0xe883('0x126')](db[_0xe883('0x13')],{'onDelete':_0xe883('0x169')});db['FaxApplication'][_0xe883('0x126')](db['FaxQueue'],{'onDelete':_0xe883('0x169')});db[_0xe883('0x48')][_0xe883('0x126')](db['FaxAccount'],{'onDelete':_0xe883('0x169')});db[_0xe883('0x48')][_0xe883('0x126')](db[_0xe883('0x8a')],{'onDelete':_0xe883('0x169'),'foreignKey':_0xe883('0x17f')});db[_0xe883('0x4a')][_0xe883('0x117')](db[_0xe883('0x4c')],{'as':'Messages','onDelete':_0xe883('0x113'),'foreignKey':'FaxInteractionId'});db['FaxInteraction']['belongsTo'](db[_0xe883('0x13f')],{'as':'Account','foreignKey':_0xe883('0x184')});db['FaxInteraction'][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db['FaxInteraction'][_0xe883('0x126')](db['User'],{'as':_0xe883('0x177'),'foreignKey':_0xe883('0x110')});db['FaxInteraction'][_0xe883('0x129')](db['Tag'],{'through':_0xe883('0x186'),'as':_0xe883('0x179')});db['FaxInteraction']['belongsToMany'](db[_0xe883('0x8a')],{'through':_0xe883('0x186'),'as':_0xe883('0x17a')});db[_0xe883('0x4a')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x17b'),'through':_0xe883('0x132'),'foreignKey':_0xe883('0x187')});db[_0xe883('0x4c')][_0xe883('0x126')](db[_0xe883('0x13')],{'onDelete':_0xe883('0x113'),'as':_0xe883('0x13')});db[_0xe883('0x4c')][_0xe883('0x126')](db[_0xe883('0x4a')],{'as':_0xe883('0x188'),'foreignKey':_0xe883('0x187')});db[_0xe883('0x4c')][_0xe883('0x126')](db['CmContact'],{'onDelete':'cascade','as':_0xe883('0x165')});db[_0xe883('0x4c')][_0xe883('0x126')](db['Attachment'],{'as':_0xe883('0xe9'),'foreignKey':_0xe883('0x189')});db['FaxMessage']['belongsTo'](db[_0xe883('0x13f')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xe883('0x4e')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':'Agents','through':_0xe883('0x32')});db[_0xe883('0x4e')][_0xe883('0x129')](db[_0xe883('0x130')],{'through':'team_has_fax_queues','as':_0xe883('0x15a')});db[_0xe883('0x4f')]['belongsTo'](db['FaxAccount'],{});db['FaxQueueReport'][_0xe883('0x126')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xe883('0x4f')]['belongsTo'](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db['FaxQueueReport'][_0xe883('0x126')](db[_0xe883('0x4a')],{});db[_0xe883('0x4f')][_0xe883('0x126')](db[_0xe883('0x4c')],{});db[_0xe883('0x4f')][_0xe883('0x126')](db[_0xe883('0x13')],{});db[_0xe883('0x4f')][_0xe883('0x126')](db[_0xe883('0x4e')],{});db[_0xe883('0x148')][_0xe883('0x117')](db['Disposition'],{'as':_0xe883('0x183'),'foreignKey':'SmsAccountId','onDelete':_0xe883('0x113')});db[_0xe883('0x148')]['hasMany'](db['CannedAnswer'],{'as':_0xe883('0x16c'),'foreignKey':_0xe883('0x18a')});db[_0xe883('0x148')][_0xe883('0x117')](db[_0xe883('0x54')],{'as':_0xe883('0x15e'),'foreignKey':_0xe883('0x18a')});db[_0xe883('0x148')][_0xe883('0x117')](db['SmsInteraction'],{'as':'Interactions'});db[_0xe883('0x148')][_0xe883('0x117')](db['SmsApplication'],{'as':_0xe883('0x16f'),'foreignKey':_0xe883('0x18a'),'onDelete':_0xe883('0x113')});db[_0xe883('0x148')][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':_0xe883('0x170'),'foreignKey':'ListId'});db['SmsAccount'][_0xe883('0x126')](db[_0xe883('0x156')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xe883('0x148')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':'user_has_sms_accounts'});db[_0xe883('0x51')][_0xe883('0x126')](db[_0xe883('0x13')],{'onDelete':'restrict'});db['SmsApplication'][_0xe883('0x126')](db[_0xe883('0x55')],{'onDelete':_0xe883('0x169')});db[_0xe883('0x51')]['belongsTo'](db[_0xe883('0x148')],{'onDelete':'restrict'});db[_0xe883('0x51')][_0xe883('0x126')](db[_0xe883('0x80')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['SmsApplication']['belongsTo'](db[_0xe883('0x8a')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xe883('0x53')][_0xe883('0x117')](db[_0xe883('0x54')],{'as':_0xe883('0x15e'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x18b')});db[_0xe883('0x53')]['belongsTo'](db[_0xe883('0x148')],{'as':'Account','foreignKey':_0xe883('0x18a')});db[_0xe883('0x53')][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':'ContactId'});db[_0xe883('0x53')][_0xe883('0x126')](db[_0xe883('0x13')],{'as':_0xe883('0x177'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x53')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':_0xe883('0x18c'),'as':_0xe883('0x179')});db[_0xe883('0x53')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':'sms_interaction_has_tags','as':_0xe883('0x17a')});db[_0xe883('0x53')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x17b'),'through':_0xe883('0x134'),'foreignKey':_0xe883('0x18b')});db[_0xe883('0x54')]['belongsTo'](db[_0xe883('0x13')],{'as':_0xe883('0x13')});db['SmsMessage'][_0xe883('0x126')](db[_0xe883('0x12b')],{'onDelete':'cascade','as':_0xe883('0x165')});db[_0xe883('0x54')][_0xe883('0x126')](db['SmsInteraction'],{'onDelete':_0xe883('0x113'),'as':_0xe883('0x188'),'foreignKey':_0xe883('0x18b')});db['SmsMessage'][_0xe883('0x126')](db[_0xe883('0x148')],{'as':'Account','foreignKey':_0xe883('0x18a')});db[_0xe883('0x55')][_0xe883('0x129')](db['User'],{'as':_0xe883('0x159'),'through':_0xe883('0x33'),'foreignKey':_0xe883('0x18d')});db[_0xe883('0x55')]['belongsToMany'](db['Team'],{'through':_0xe883('0x18e'),'as':'Teams'});db[_0xe883('0x145')]['hasMany'](db[_0xe883('0x182')],{'as':_0xe883('0x183'),'foreignKey':_0xe883('0x18f'),'onDelete':_0xe883('0x113')});db[_0xe883('0x145')][_0xe883('0x117')](db[_0xe883('0x7b')],{'as':'Answers','foreignKey':_0xe883('0x18f')});db[_0xe883('0x145')][_0xe883('0x117')](db[_0xe883('0x59')],{'as':_0xe883('0x16d'),'foreignKey':_0xe883('0x18f')});db['OpenchannelAccount'][_0xe883('0x117')](db[_0xe883('0x5a')],{'as':_0xe883('0x15e'),'foreignKey':_0xe883('0x18f')});db[_0xe883('0x145')][_0xe883('0x117')](db[_0xe883('0x58')],{'as':_0xe883('0x16f'),'foreignKey':_0xe883('0x18f'),'onDelete':_0xe883('0x113')});db[_0xe883('0x145')][_0xe883('0x126')](db['CmList'],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171')});db[_0xe883('0x145')][_0xe883('0x126')](db[_0xe883('0x156')],{'as':'mandatoryDispositionPause','foreignKey':_0xe883('0x174')});db[_0xe883('0x145')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':'Agents','through':_0xe883('0x147')});db[_0xe883('0x58')][_0xe883('0x126')](db[_0xe883('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xe883('0x126')](db[_0xe883('0x5c')],{'onDelete':_0xe883('0x169'),'foreignKey':_0xe883('0x190')});db[_0xe883('0x58')]['belongsTo'](db[_0xe883('0x145')],{'onDelete':_0xe883('0x169'),'foreignKey':_0xe883('0x18f')});db[_0xe883('0x58')][_0xe883('0x126')](db[_0xe883('0x80')],{'onDelete':_0xe883('0x169'),'foreignKey':'IntervalId'});db[_0xe883('0x58')][_0xe883('0x126')](db[_0xe883('0x8a')],{'onDelete':'restrict','foreignKey':_0xe883('0x17f')});db[_0xe883('0x59')][_0xe883('0x117')](db[_0xe883('0x5a')],{'as':'Messages','onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x191')});db[_0xe883('0x59')][_0xe883('0x126')](db[_0xe883('0x145')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x18f')});db[_0xe883('0x59')][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db[_0xe883('0x59')][_0xe883('0x126')](db[_0xe883('0x13')],{'as':_0xe883('0x177'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x59')]['belongsToMany'](db[_0xe883('0x8a')],{'through':_0xe883('0x192'),'as':_0xe883('0x179')});db[_0xe883('0x59')]['belongsToMany'](db['Tag'],{'through':_0xe883('0x192'),'as':_0xe883('0x17a')});db[_0xe883('0x59')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x17b'),'through':_0xe883('0x193'),'foreignKey':_0xe883('0x191')});db['OpenchannelMessage']['belongsTo'](db[_0xe883('0x13')],{'onDelete':'cascade','as':_0xe883('0x13')});db[_0xe883('0x5a')][_0xe883('0x126')](db[_0xe883('0x12b')],{'onDelete':_0xe883('0x113'),'as':_0xe883('0x165')});db[_0xe883('0x5a')]['belongsTo'](db[_0xe883('0x59')],{'onDelete':'cascade','as':_0xe883('0x188'),'foreignKey':_0xe883('0x191')});db['OpenchannelMessage'][_0xe883('0x126')](db[_0xe883('0xe9')],{'as':_0xe883('0xe9'),'foreignKey':'AttachmentId'});db['OpenchannelMessage']['belongsTo'](db[_0xe883('0x145')],{'as':_0xe883('0x176'),'foreignKey':'OpenchannelAccountId'});db[_0xe883('0x5c')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':'Agents','through':_0xe883('0x34'),'foreignKey':'OpenchannelQueueId'});db[_0xe883('0x5c')][_0xe883('0x129')](db[_0xe883('0x130')],{'through':_0xe883('0x194'),'as':'Teams'});db[_0xe883('0x5e')][_0xe883('0x117')](db[_0xe883('0x182')],{'as':_0xe883('0x183'),'foreignKey':_0xe883('0x195'),'onDelete':_0xe883('0x113')});db[_0xe883('0x5e')][_0xe883('0x117')](db['CannedAnswer'],{'as':_0xe883('0x16c'),'foreignKey':_0xe883('0x195')});db[_0xe883('0x5e')][_0xe883('0x117')](db[_0xe883('0x196')],{'as':'ProactiveActions'});db[_0xe883('0x5e')][_0xe883('0x117')](db[_0xe883('0x62')],{'as':'Interactions'});db[_0xe883('0x5e')]['hasMany'](db[_0xe883('0x197')],{'as':_0xe883('0x16f'),'foreignKey':_0xe883('0x195'),'onDelete':'cascade'});db[_0xe883('0x5e')]['hasMany'](db[_0xe883('0x64')],{'as':_0xe883('0x15e')});db['ChatWebsite'][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':'List','foreignKey':_0xe883('0x171')});db[_0xe883('0x5e')]['belongsTo'](db[_0xe883('0x80')],{'as':_0xe883('0x80'),'foreignKey':_0xe883('0x155')});db[_0xe883('0x5e')][_0xe883('0x126')](db[_0xe883('0x142')],{'as':_0xe883('0x142'),'foreignKey':_0xe883('0x16a')});db[_0xe883('0x5e')]['belongsTo'](db['Pause'],{'as':_0xe883('0x157'),'foreignKey':_0xe883('0x174')});db[_0xe883('0x5e')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xe883('0x126')](db[_0xe883('0x145')],{});db['OpenchannelQueueReport'][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171')});db['OpenchannelQueueReport']['belongsTo'](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db['OpenchannelQueueReport'][_0xe883('0x126')](db[_0xe883('0x59')],{});db['OpenchannelQueueReport'][_0xe883('0x126')](db['OpenchannelMessage'],{});db[_0xe883('0x198')][_0xe883('0x126')](db['User'],{});db[_0xe883('0x198')][_0xe883('0x126')](db[_0xe883('0x5c')],{});db['ChatApplication'][_0xe883('0x126')](db['User'],{'as':_0xe883('0x199'),'foreignKey':_0xe883('0x110'),'onDelete':_0xe883('0x169')});db['ChatApplication']['belongsTo'](db['ChatQueue'],{'as':_0xe883('0x19a'),'foreignKey':_0xe883('0x19b'),'onDelete':'restrict'});db['ChatApplication'][_0xe883('0x126')](db[_0xe883('0x5e')],{'as':_0xe883('0x19c'),'foreignKey':_0xe883('0x195'),'onDelete':_0xe883('0x169')});db[_0xe883('0x197')][_0xe883('0x126')](db[_0xe883('0x8a')],{'onDelete':_0xe883('0x169'),'foreignKey':_0xe883('0x17f')});db[_0xe883('0x62')][_0xe883('0x117')](db[_0xe883('0x64')],{'as':_0xe883('0x15e'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x19d')});db[_0xe883('0x62')]['belongsTo'](db[_0xe883('0x5e')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x195')});db[_0xe883('0x62')][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db[_0xe883('0x62')][_0xe883('0x126')](db[_0xe883('0x13')],{'as':_0xe883('0x177'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x62')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':_0xe883('0x19e'),'as':_0xe883('0x179')});db['ChatInteraction']['belongsToMany'](db[_0xe883('0x8a')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0xe883('0x62')]['belongsToMany'](db[_0xe883('0x13')],{'as':_0xe883('0x17b'),'through':'user_has_chat_interactions','foreignKey':_0xe883('0x19d')});db[_0xe883('0x64')]['belongsTo'](db[_0xe883('0x13')],{'onDelete':_0xe883('0x113'),'as':'User'});db['ChatMessage'][_0xe883('0x126')](db['CmContact'],{'onDelete':'cascade','as':_0xe883('0x165'),'foreignKey':'ContactId'});db[_0xe883('0x64')]['belongsTo'](db[_0xe883('0x62')],{'onDelete':_0xe883('0x113'),'as':_0xe883('0x188'),'foreignKey':_0xe883('0x19d')});db[_0xe883('0x64')]['belongsTo'](db[_0xe883('0xe9')],{'as':_0xe883('0xe9'),'foreignKey':'AttachmentId'});db[_0xe883('0x64')][_0xe883('0x126')](db[_0xe883('0x5e')],{'as':'Account','foreignKey':_0xe883('0x195')});db[_0xe883('0x17d')][_0xe883('0x117')](db['Attachment'],{'as':_0xe883('0x17c'),'foreignKey':_0xe883('0x17e'),'onDelete':_0xe883('0x113'),'hooks':!![]});db[_0xe883('0x17d')][_0xe883('0x126')](db[_0xe883('0x12b')],{'onDelete':_0xe883('0x113'),'as':_0xe883('0x165'),'foreignKey':'ContactId'});db[_0xe883('0x17d')][_0xe883('0x126')](db[_0xe883('0x5e')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x195')});db[_0xe883('0x66')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0xe883('0x66')][_0xe883('0x129')](db[_0xe883('0x130')],{'through':_0xe883('0x19f'),'as':_0xe883('0x15a')});db[_0xe883('0x68')][_0xe883('0x117')](db[_0xe883('0xce')],{'as':_0xe883('0x15e'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db['ChatGroup']['belongsToMany'](db['User'],{'as':_0xe883('0x1a0'),'through':_0xe883('0x1a1')});db['ChatProactiveAction'][_0xe883('0x126')](db[_0xe883('0x5e')],{'as':_0xe883('0x19c'),'foreignKey':'ChatWebsiteId'});db[_0xe883('0x6b')][_0xe883('0x117')](db[_0xe883('0x12b')],{'as':_0xe883('0x12c'),'foreignKey':_0xe883('0x1a2')});db[_0xe883('0x12b')][_0xe883('0x117')](db[_0xe883('0x1a3')],{'as':_0xe883('0x1a4'),'foreignKey':_0xe883('0x1a5')});db[_0xe883('0x12b')][_0xe883('0x117')](db[_0xe883('0x6e')],{'as':_0xe883('0x124'),'foreignKey':_0xe883('0x166')});db[_0xe883('0x12b')][_0xe883('0x117')](db[_0xe883('0x71')],{'as':_0xe883('0x119'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0xe883('0x150'),'foreignKey':'ContactId'});db[_0xe883('0x12b')][_0xe883('0x117')](db[_0xe883('0x11b')],{'as':_0xe883('0x11b'),'foreignKey':_0xe883('0x166')});db[_0xe883('0x12b')]['hasMany'](db[_0xe883('0xd2')],{'as':'JscriptySessions','foreignKey':_0xe883('0x166')});db[_0xe883('0x12b')]['hasMany'](db[_0xe883('0x59')],{'as':_0xe883('0x11c'),'foreignKey':_0xe883('0x166'),'onDelete':_0xe883('0x169')});db['CmContact'][_0xe883('0x117')](db[_0xe883('0x62')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0xe883('0x169')});db[_0xe883('0x12b')]['hasMany'](db['SmsInteraction'],{'as':_0xe883('0x133'),'foreignKey':_0xe883('0x166'),'onDelete':_0xe883('0x169')});db[_0xe883('0x12b')]['hasMany'](db[_0xe883('0x4a')],{'as':_0xe883('0x11e'),'foreignKey':_0xe883('0x166'),'onDelete':_0xe883('0x169')});db[_0xe883('0x12b')][_0xe883('0x117')](db[_0xe883('0x11f')],{'as':_0xe883('0x120'),'foreignKey':_0xe883('0x166'),'onDelete':'restrict'});db[_0xe883('0x12b')][_0xe883('0x126')](db[_0xe883('0x6b')],{'as':_0xe883('0x1a6'),'foreignKey':_0xe883('0x1a2')});db['CmContact'][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':'List','foreignKey':_0xe883('0x171'),'onDelete':_0xe883('0x113')});db[_0xe883('0x12b')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x17b'),'through':_0xe883('0x12d')});db[_0xe883('0x12b')][_0xe883('0x129')](db['Tag'],{'as':_0xe883('0x179'),'through':_0xe883('0x1a7')});db[_0xe883('0x12b')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':'cm_contact_has_tags','as':_0xe883('0x17a')});db[_0xe883('0x6e')][_0xe883('0x117')](db[_0xe883('0x8f')],{'as':_0xe883('0x1a8'),'foreignKey':_0xe883('0x1a9')});db[_0xe883('0x6e')]['belongsTo'](db[_0xe883('0x12b')],{'as':'Contact','foreignKey':_0xe883('0x166'),'onDelete':'cascade'});db[_0xe883('0x6e')][_0xe883('0x126')](db['CmList'],{'as':_0xe883('0x170'),'foreignKey':'ListId','onDelete':_0xe883('0x113')});db[_0xe883('0x6e')][_0xe883('0x126')](db[_0xe883('0x13')],{'as':_0xe883('0x199'),'foreignKey':_0xe883('0x110')});db[_0xe883('0x6e')][_0xe883('0x126')](db['VoiceQueue'],{'as':_0xe883('0x19a'),'foreignKey':'VoiceQueueId','onDelete':_0xe883('0x113')});db[_0xe883('0x6e')][_0xe883('0x126')](db[_0xe883('0xe6')],{'as':_0xe883('0xe6'),'foreignKey':_0xe883('0x1aa'),'onDelete':_0xe883('0x113')});db[_0xe883('0x6e')][_0xe883('0x126')](db[_0xe883('0x13')],{'as':'Owner','foreignKey':_0xe883('0x1ab')});db[_0xe883('0x70')][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':'ContactId','onDelete':_0xe883('0x113')});db[_0xe883('0x70')][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171'),'onDelete':_0xe883('0x113')});db['CmHopperBlack'][_0xe883('0x126')](db[_0xe883('0x1c')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xe883('0x113')});db[_0xe883('0x70')]['belongsTo'](db[_0xe883('0xe6')],{'as':_0xe883('0xe6'),'foreignKey':_0xe883('0x1aa'),'onDelete':_0xe883('0x113')});db['Automation'][_0xe883('0x117')](db['Condition'],{'as':{'plural':_0xe883('0x1ac'),'singular':_0xe883('0x1ad')},'foreignKey':_0xe883('0x1ae'),'onDelete':_0xe883('0x113'),'hooks':!![]});db[_0xe883('0x79')][_0xe883('0x117')](db[_0xe883('0x7e')],{'as':{'plural':_0xe883('0x1af'),'singular':_0xe883('0x1b0')},'foreignKey':'AutomationAnyId','onDelete':_0xe883('0x113'),'hooks':!![]});db[_0xe883('0x79')][_0xe883('0x117')](db[_0xe883('0x77')],{'as':_0xe883('0x1b1'),'foreignKey':'AutomationId','onDelete':_0xe883('0x113'),'hooks':!![]});db[_0xe883('0x182')]['hasMany'](db[_0xe883('0x182')],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0xe883('0x113')});db[_0xe883('0x80')][_0xe883('0x117')](db[_0xe883('0x80')],{'as':_0xe883('0x1b2'),'foreignKey':_0xe883('0x155'),'onDelete':_0xe883('0x113'),'hooks':!![],'required':![]});db[_0xe883('0x80')][_0xe883('0x117')](db[_0xe883('0x14c')],{'as':_0xe883('0x118'),'foreignKey':'IntervalId','onDelete':_0xe883('0x169')});db[_0xe883('0x80')][_0xe883('0x117')](db[_0xe883('0x16e')],{'as':_0xe883('0x1b3'),'foreignKey':_0xe883('0x155')});db['Interval'][_0xe883('0x117')](db[_0xe883('0x197')],{'as':_0xe883('0x1b4'),'foreignKey':_0xe883('0x155')});db['Interval']['hasMany'](db[_0xe883('0x48')],{'as':_0xe883('0x1b5'),'foreignKey':_0xe883('0x155')});db[_0xe883('0x80')][_0xe883('0x117')](db['SmsApplication'],{'as':_0xe883('0x1b6'),'foreignKey':_0xe883('0x155')});db[_0xe883('0x86')][_0xe883('0x126')](db['MailAccount'],{});db['Schedule'][_0xe883('0x126')](db[_0xe883('0x98')],{'foreignKey':_0xe883('0x1b7')});db['Schedule'][_0xe883('0x126')](db[_0xe883('0x96')],{'foreignKey':_0xe883('0x1b8')});db[_0xe883('0x88')][_0xe883('0x129')](db[_0xe883('0x1a')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xe883('0x169')});db[_0xe883('0x8a')][_0xe883('0x129')](db[_0xe883('0x12b')],{'through':_0xe883('0x1a7')});db[_0xe883('0x8a')]['belongsToMany'](db[_0xe883('0x62')],{'through':_0xe883('0x19e')});db[_0xe883('0x8a')][_0xe883('0x129')](db[_0xe883('0x11f')],{'through':_0xe883('0x178')});db[_0xe883('0x8a')][_0xe883('0x129')](db[_0xe883('0x53')],{'through':_0xe883('0x18c')});db[_0xe883('0x8a')][_0xe883('0x129')](db[_0xe883('0x4a')],{'through':_0xe883('0x186')});db[_0xe883('0x8a')]['belongsToMany'](db[_0xe883('0x59')],{'through':_0xe883('0x192')});db[_0xe883('0x8a')][_0xe883('0x129')](db[_0xe883('0xff')],{'through':'whatsapp_interaction_has_tags'});db[_0xe883('0x1a3')]['belongsTo'](db[_0xe883('0x8c')],{'as':_0xe883('0x1b9'),'foreignKey':_0xe883('0x1ba')});db[_0xe883('0x8f')]['belongsTo'](db[_0xe883('0x6e')],{'as':_0xe883('0x1bb'),'foreignKey':_0xe883('0x1a9')});db['CmContactHasItem']['belongsTo'](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x1a5')});db[_0xe883('0x92')][_0xe883('0x117')](db[_0xe883('0x7e')],{'as':{'plural':_0xe883('0x1bc'),'singular':_0xe883('0x1bd')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0xe883('0x117')](db[_0xe883('0x7e')],{'as':{'plural':_0xe883('0x1be'),'singular':_0xe883('0x1bf')},'foreignKey':_0xe883('0x1c0'),'onDelete':_0xe883('0x113'),'hooks':!![]});db[_0xe883('0x92')][_0xe883('0x117')](db[_0xe883('0x77')],{'as':_0xe883('0x1b1'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0xe883('0x96')][_0xe883('0x117')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1b8'),'hooks':!![]});db[_0xe883('0x98')][_0xe883('0x117')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1b7')});db[_0xe883('0x99')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xe883('0x1c1'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1c2')});db[_0xe883('0x1c3')]['belongsTo'](db[_0xe883('0x99')],{'foreignKey':_0xe883('0x1c2')});db[_0xe883('0x9c')][_0xe883('0x117')](db[_0xe883('0x1c4')],{'as':_0xe883('0x1c5'),'onDelete':_0xe883('0x113'),'foreignKey':'AccountId'});db[_0xe883('0x1c4')][_0xe883('0x117')](db[_0xe883('0x9f')],{'as':_0xe883('0x1c6'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0x1c4')][_0xe883('0x117')](db[_0xe883('0x9f')],{'as':_0xe883('0x1c8'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0x1c4')][_0xe883('0x117')](db[_0xe883('0x9f')],{'as':_0xe883('0x1c1'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0x1c4')][_0xe883('0x126')](db[_0xe883('0x9c')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0x9f')][_0xe883('0x117')](db[_0xe883('0x9f')],{'as':_0xe883('0x1cc'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0x9f')][_0xe883('0x117')](db['SalesforceField'],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0x9f')][_0xe883('0x117')](db[_0xe883('0x9f')],{'as':'Field','foreignKey':'FieldId'});db['SalesforceField'][_0xe883('0x126')](db[_0xe883('0x1ce')],{'as':'Variable','foreignKey':_0xe883('0x1cf')});db[_0xe883('0xa0')]['hasMany'](db[_0xe883('0x1d0')],{'as':_0xe883('0x1c5'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0x1d0')][_0xe883('0x117')](db['SugarcrmField'],{'as':_0xe883('0x1c6'),'onDelete':'cascade','foreignKey':_0xe883('0x1c7')});db[_0xe883('0x1d0')][_0xe883('0x117')](db[_0xe883('0xa3')],{'as':_0xe883('0x1c8'),'onDelete':'cascade','foreignKey':_0xe883('0x1c9')});db[_0xe883('0x1d0')][_0xe883('0x117')](db[_0xe883('0xa3')],{'as':_0xe883('0x1c1'),'onDelete':_0xe883('0x113'),'foreignKey':'FieldId'});db[_0xe883('0x1d0')][_0xe883('0x126')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0xe883('0x1cb')});db[_0xe883('0xa3')][_0xe883('0x117')](db['SugarcrmField'],{'as':_0xe883('0x1cc'),'foreignKey':_0xe883('0x1c7')});db['SugarcrmField'][_0xe883('0x117')](db[_0xe883('0xa3')],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xa3')][_0xe883('0x117')](db[_0xe883('0xa3')],{'as':_0xe883('0x1d1'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xa3')][_0xe883('0x126')](db[_0xe883('0x1ce')],{'as':_0xe883('0x1ce'),'foreignKey':_0xe883('0x1cf')});db[_0xe883('0xa5')][_0xe883('0x117')](db[_0xe883('0xa6')],{'as':_0xe883('0x1c5'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0xa6')][_0xe883('0x117')](db[_0xe883('0xa7')],{'as':_0xe883('0x1c6'),'onDelete':'cascade','foreignKey':_0xe883('0x1c7')});db['DeskConfiguration'][_0xe883('0x117')](db['DeskField'],{'as':_0xe883('0x1c8'),'onDelete':'cascade','foreignKey':_0xe883('0x1c9')});db[_0xe883('0xa6')][_0xe883('0x117')](db[_0xe883('0xa7')],{'as':_0xe883('0x1c1'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xa6')]['belongsTo'](db[_0xe883('0xa5')],{'as':'Account','foreignKey':_0xe883('0x1cb')});db[_0xe883('0xa6')]['belongsToMany'](db['Tag'],{'through':_0xe883('0x1d2')});db[_0xe883('0xa7')][_0xe883('0x117')](db[_0xe883('0xa7')],{'as':_0xe883('0x1cc'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0xa7')][_0xe883('0x117')](db[_0xe883('0xa7')],{'as':_0xe883('0x1cd'),'foreignKey':'DescriptionId'});db[_0xe883('0xa7')][_0xe883('0x117')](db['DeskField'],{'as':'Field','foreignKey':_0xe883('0x1ca')});db[_0xe883('0xa7')][_0xe883('0x126')](db[_0xe883('0x1ce')],{'as':_0xe883('0x1ce'),'foreignKey':_0xe883('0x1cf')});db[_0xe883('0x1d3')][_0xe883('0x117')](db[_0xe883('0xa9')],{'as':_0xe883('0x1c5'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0xa9')]['hasMany'](db[_0xe883('0xab')],{'as':_0xe883('0x1c6'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0xa9')][_0xe883('0x117')](db['ZohoField'],{'as':_0xe883('0x1c8'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xa9')]['hasMany'](db['ZohoField'],{'as':_0xe883('0x1c1'),'onDelete':_0xe883('0x113'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0xe883('0x126')](db[_0xe883('0x1d3')],{'as':'Account','foreignKey':_0xe883('0x1cb')});db[_0xe883('0xab')][_0xe883('0x117')](db[_0xe883('0xab')],{'as':'Subject','foreignKey':_0xe883('0x1c7')});db['ZohoField'][_0xe883('0x117')](db[_0xe883('0xab')],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xab')][_0xe883('0x117')](db[_0xe883('0xab')],{'as':'Field','foreignKey':_0xe883('0x1ca')});db[_0xe883('0xab')][_0xe883('0x126')](db[_0xe883('0x1ce')],{'as':_0xe883('0x1ce'),'foreignKey':_0xe883('0x1cf')});db[_0xe883('0x1d4')][_0xe883('0x117')](db[_0xe883('0xad')],{'as':_0xe883('0x1c5'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0xad')][_0xe883('0x117')](db[_0xe883('0xaf')],{'as':_0xe883('0x1c6'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0xad')][_0xe883('0x117')](db[_0xe883('0xaf')],{'as':_0xe883('0x1c8'),'foreignKey':_0xe883('0x1c9')});db['ZendeskConfiguration'][_0xe883('0x117')](db[_0xe883('0xaf')],{'as':_0xe883('0x1c1'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xad')][_0xe883('0x126')](db[_0xe883('0x1d4')],{'as':_0xe883('0x176'),'foreignKey':'AccountId'});db[_0xe883('0xad')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':'int_zendesk_configuration_has_tags'});db[_0xe883('0xaf')][_0xe883('0x117')](db['ZendeskField'],{'as':_0xe883('0x1cc'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0xaf')]['hasMany'](db[_0xe883('0xaf')],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xaf')][_0xe883('0x117')](db[_0xe883('0xaf')],{'as':_0xe883('0x1d1'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xaf')][_0xe883('0x126')](db[_0xe883('0x1ce')],{'as':_0xe883('0x1ce'),'foreignKey':'VariableId'});db[_0xe883('0xb1')][_0xe883('0x117')](db[_0xe883('0x1d5')],{'as':_0xe883('0x1c5'),'onDelete':'cascade','foreignKey':_0xe883('0x1cb')});db[_0xe883('0x1d5')]['hasMany'](db[_0xe883('0xb3')],{'as':_0xe883('0x1c6'),'onDelete':_0xe883('0x113'),'foreignKey':'SubjectId'});db[_0xe883('0x1d5')]['hasMany'](db['FreshdeskField'],{'as':_0xe883('0x1c8'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0x1d5')][_0xe883('0x117')](db[_0xe883('0xb3')],{'as':'Fields','onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0x1d5')][_0xe883('0x126')](db[_0xe883('0xb1')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0x1d5')]['belongsToMany'](db[_0xe883('0x8a')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xe883('0xb3')][_0xe883('0x117')](db['FreshdeskField'],{'as':_0xe883('0x1cc'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xe883('0x117')](db['FreshdeskField'],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xb3')][_0xe883('0x117')](db['FreshdeskField'],{'as':'Field','foreignKey':_0xe883('0x1ca')});db['FreshdeskField'][_0xe883('0x126')](db['Variable'],{'as':'Variable','foreignKey':_0xe883('0x1cf')});db[_0xe883('0xb5')][_0xe883('0x117')](db['VtigerConfiguration'],{'as':_0xe883('0x1c5'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1cb')});db['VtigerConfiguration'][_0xe883('0x117')](db[_0xe883('0xb9')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xe883('0xb7')]['hasMany'](db[_0xe883('0xb9')],{'as':_0xe883('0x1c8'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xe883('0x117')](db[_0xe883('0xb9')],{'as':'Fields','foreignKey':_0xe883('0x1ca')});db[_0xe883('0xb7')][_0xe883('0x126')](db[_0xe883('0xb5')],{'as':_0xe883('0x176'),'foreignKey':'AccountId'});db[_0xe883('0xb9')][_0xe883('0x117')](db[_0xe883('0xb9')],{'as':'Subject','foreignKey':_0xe883('0x1c7')});db['VtigerField'][_0xe883('0x117')](db[_0xe883('0xb9')],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xb9')][_0xe883('0x117')](db[_0xe883('0xb9')],{'as':_0xe883('0x1d1'),'foreignKey':_0xe883('0x1ca')});db['VtigerField'][_0xe883('0x126')](db['Variable'],{'as':'Variable','foreignKey':_0xe883('0x1cf')});db['ServicenowAccount']['hasMany'](db['ServicenowConfiguration'],{'as':_0xe883('0x1c5'),'onDelete':'cascade','foreignKey':_0xe883('0x1cb')});db[_0xe883('0xbc')][_0xe883('0x117')](db['ServicenowField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xe883('0xbc')][_0xe883('0x117')](db[_0xe883('0xbe')],{'as':_0xe883('0x1c8'),'foreignKey':'DescriptionId'});db[_0xe883('0xbc')][_0xe883('0x117')](db[_0xe883('0xbe')],{'as':_0xe883('0x1c1'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xbc')]['belongsTo'](db[_0xe883('0xbb')],{'as':'Account','foreignKey':_0xe883('0x1cb')});db[_0xe883('0xbe')]['hasMany'](db[_0xe883('0xbe')],{'as':_0xe883('0x1cc'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0xbe')][_0xe883('0x117')](db[_0xe883('0xbe')],{'as':_0xe883('0x1cd'),'foreignKey':'DescriptionId'});db[_0xe883('0xbe')][_0xe883('0x117')](db[_0xe883('0xbe')],{'as':_0xe883('0x1d1'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xbe')]['belongsTo'](db['Variable'],{'as':_0xe883('0x1ce'),'foreignKey':_0xe883('0x1cf')});db[_0xe883('0xc0')][_0xe883('0x117')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe883('0x1cb')});db['Dynamics365Account'][_0xe883('0x126')](db['CloudProvider'],{'as':_0xe883('0x167'),'foreignKey':_0xe883('0x168')});db[_0xe883('0xc1')][_0xe883('0x117')](db['Dynamics365Field'],{'as':_0xe883('0x1c6'),'onDelete':_0xe883('0x113'),'foreignKey':'SubjectId'});db[_0xe883('0xc1')][_0xe883('0x117')](db[_0xe883('0xc3')],{'as':_0xe883('0x1c8'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0xe883('0x1c1'),'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xc1')][_0xe883('0x126')](db['Dynamics365Account'],{'as':_0xe883('0x176'),'foreignKey':'AccountId'});db[_0xe883('0xc3')][_0xe883('0x117')](db[_0xe883('0xc3')],{'as':_0xe883('0x1cc'),'foreignKey':'SubjectId'});db[_0xe883('0xc3')][_0xe883('0x117')](db[_0xe883('0xc3')],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xc3')][_0xe883('0x117')](db[_0xe883('0xc3')],{'as':_0xe883('0x1d1'),'foreignKey':_0xe883('0x1ca')});db['Dynamics365Field']['belongsTo'](db[_0xe883('0x1ce')],{'as':_0xe883('0x1ce'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xe883('0x117')](db[_0xe883('0xc7')],{'as':'Configurations','onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0xc7')][_0xe883('0x117')](db['FreshsalesField'],{'as':_0xe883('0x1c6'),'foreignKey':_0xe883('0x1c7')});db[_0xe883('0xc7')][_0xe883('0x117')](db[_0xe883('0xc9')],{'as':_0xe883('0x1c8'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xc7')][_0xe883('0x117')](db[_0xe883('0xc9')],{'as':_0xe883('0x1c1'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xc7')]['belongsTo'](db[_0xe883('0xc5')],{'as':_0xe883('0x176'),'foreignKey':_0xe883('0x1cb')});db[_0xe883('0xc9')][_0xe883('0x117')](db[_0xe883('0xc9')],{'as':_0xe883('0x1cc'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0xe883('0x117')](db[_0xe883('0xc9')],{'as':_0xe883('0x1cd'),'foreignKey':_0xe883('0x1c9')});db[_0xe883('0xc9')][_0xe883('0x117')](db[_0xe883('0xc9')],{'as':_0xe883('0x1d1'),'foreignKey':_0xe883('0x1ca')});db[_0xe883('0xc9')]['belongsTo'](db[_0xe883('0x1ce')],{'as':_0xe883('0x1ce'),'foreignKey':_0xe883('0x1cf')});db[_0xe883('0xcc')]['belongsTo'](db[_0xe883('0x5e')],{});db[_0xe883('0xcc')][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':'List','foreignKey':_0xe883('0x171')});db['ChatQueueReport'][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db[_0xe883('0xcc')][_0xe883('0x126')](db['ChatInteraction'],{});db[_0xe883('0xcc')][_0xe883('0x126')](db['ChatMessage'],{});db[_0xe883('0xcc')][_0xe883('0x126')](db[_0xe883('0x13')],{});db['ChatQueueReport'][_0xe883('0x126')](db[_0xe883('0x66')],{});db[_0xe883('0xce')]['belongsTo'](db['User'],{'onDelete':_0xe883('0x113'),'foreignKey':'FromId'});db[_0xe883('0xce')][_0xe883('0x126')](db[_0xe883('0x13')],{'onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x1d6')});db[_0xe883('0xd2')][_0xe883('0x117')](db[_0xe883('0xd1')],{'foreignKey':_0xe883('0x1d7'),'onDelete':_0xe883('0x113')});db[_0xe883('0xd2')][_0xe883('0x117')](db[_0xe883('0xd0')],{'foreignKey':_0xe883('0x1d7'),'onDelete':_0xe883('0x113')});db['SmsQueueReport'][_0xe883('0x126')](db[_0xe883('0x148')],{});db[_0xe883('0xd3')][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171')});db[_0xe883('0xd3')][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':_0xe883('0x166')});db[_0xe883('0xd3')][_0xe883('0x126')](db[_0xe883('0x53')],{});db[_0xe883('0xd3')][_0xe883('0x126')](db[_0xe883('0x54')],{});db[_0xe883('0xd3')][_0xe883('0x126')](db[_0xe883('0x13')],{});db['SmsQueueReport'][_0xe883('0x126')](db[_0xe883('0x55')],{});db[_0xe883('0xd8')][_0xe883('0x117')](db[_0xe883('0xd2')],{'foreignKey':'ProjectId'});db[_0xe883('0xd8')][_0xe883('0x117')](db[_0xe883('0xd1')],{'foreignKey':_0xe883('0x1d8')});db[_0xe883('0xd8')][_0xe883('0x117')](db['JscriptyAnswerReport'],{'foreignKey':_0xe883('0x1d8')});db[_0xe883('0x130')]['belongsToMany'](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':_0xe883('0x1d9')});db['Team']['belongsToMany'](db[_0xe883('0x1c')],{'through':'TeamVoiceQueue','as':_0xe883('0x136')});db[_0xe883('0x130')][_0xe883('0x129')](db['MailQueue'],{'through':_0xe883('0x1da'),'as':_0xe883('0x1db')});db['Team'][_0xe883('0x129')](db[_0xe883('0x66')],{'through':'team_has_chat_queues','as':_0xe883('0x1dc')});db[_0xe883('0x130')][_0xe883('0x129')](db[_0xe883('0x4e')],{'through':_0xe883('0x1dd'),'as':_0xe883('0x139')});db[_0xe883('0x130')][_0xe883('0x129')](db[_0xe883('0x55')],{'through':_0xe883('0x18e'),'as':_0xe883('0x13a')});db[_0xe883('0x130')][_0xe883('0x129')](db[_0xe883('0x5c')],{'through':_0xe883('0x194'),'as':_0xe883('0x13b')});db[_0xe883('0x130')][_0xe883('0x129')](db[_0xe883('0x13c')],{'through':_0xe883('0x1de'),'as':_0xe883('0x13d')});db['Team']['belongsToMany'](db[_0xe883('0xf6')],{'through':_0xe883('0x1df'),'as':_0xe883('0x1e0')});db[_0xe883('0xe6')][_0xe883('0x117')](db[_0xe883('0x6e')],{'as':_0xe883('0x124'),'foreignKey':'CampaignId'});db['Campaign'][_0xe883('0x117')](db[_0xe883('0x71')],{'as':_0xe883('0x119'),'foreignKey':_0xe883('0x1aa')});db[_0xe883('0xe6')][_0xe883('0x117')](db['CmHopperHistory'],{'as':_0xe883('0x150'),'foreignKey':_0xe883('0x1aa')});db[_0xe883('0xe6')][_0xe883('0x117')](db[_0xe883('0x70')],{'as':_0xe883('0x1e1'),'foreignKey':_0xe883('0x1aa')});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0xe883('0x152'),'foreignKey':'TrunkId'});db['Campaign'][_0xe883('0x126')](db[_0xe883('0x152')],{'as':_0xe883('0x154'),'foreignKey':_0xe883('0x1e2')});db['Campaign'][_0xe883('0x126')](db[_0xe883('0x80')],{'as':_0xe883('0x80'),'foreignKey':_0xe883('0x155')});db[_0xe883('0xe6')][_0xe883('0x126')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xe883('0xe6')][_0xe883('0x129')](db[_0xe883('0xf4')],{'as':'Lists','through':_0xe883('0x1e3')});db[_0xe883('0xe6')][_0xe883('0x129')](db[_0xe883('0xf4')],{'as':_0xe883('0x15b'),'through':_0xe883('0x1e4')});db[_0xe883('0xe9')][_0xe883('0x126')](db[_0xe883('0x17d')],{'as':_0xe883('0x17d'),'foreignKey':_0xe883('0x17e')});db[_0xe883('0xeb')]['belongsTo'](db[_0xe883('0x42')],{});db[_0xe883('0xeb')][_0xe883('0x126')](db[_0xe883('0x11f')],{});db['MailTransferReport'][_0xe883('0x126')](db['MailAccount'],{'foreignKey':_0xe883('0x1e5'),'as':'FromAccount'});db['MailTransferReport'][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':_0xe883('0x1e6'),'as':_0xe883('0x1e7')});db[_0xe883('0xeb')][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':'ToUserId','as':_0xe883('0x1e8')});db[_0xe883('0xeb')][_0xe883('0x126')](db[_0xe883('0x3d')],{'foreignKey':_0xe883('0x1e9'),'as':'ToQueue'});db[_0xe883('0xeb')][_0xe883('0x126')](db[_0xe883('0x142')],{'foreignKey':_0xe883('0x1ea'),'as':_0xe883('0x1eb')});db[_0xe883('0xed')][_0xe883('0x126')](db[_0xe883('0x64')],{});db['ChatTransferReport'][_0xe883('0x126')](db[_0xe883('0x62')],{});db[_0xe883('0xed')][_0xe883('0x126')](db[_0xe883('0x5e')],{'foreignKey':_0xe883('0x1ec'),'as':_0xe883('0x1ed')});db[_0xe883('0xed')][_0xe883('0x126')](db['User'],{'foreignKey':_0xe883('0x1e6'),'as':_0xe883('0x1e7')});db[_0xe883('0xed')][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':_0xe883('0x1ee'),'as':_0xe883('0x1e8')});db[_0xe883('0xed')][_0xe883('0x126')](db[_0xe883('0x66')],{'foreignKey':_0xe883('0x1ef'),'as':_0xe883('0x1f0')});db[_0xe883('0xed')][_0xe883('0x126')](db[_0xe883('0x5e')],{'foreignKey':_0xe883('0x1f1'),'as':_0xe883('0x1eb')});db[_0xe883('0xef')][_0xe883('0x126')](db[_0xe883('0x4c')],{});db[_0xe883('0xef')]['belongsTo'](db[_0xe883('0x4a')],{});db[_0xe883('0xef')][_0xe883('0x126')](db['FaxAccount'],{'foreignKey':_0xe883('0x1f2'),'as':_0xe883('0x1ed')});db[_0xe883('0xef')][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':_0xe883('0x1e6'),'as':_0xe883('0x1e7')});db[_0xe883('0xef')][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':_0xe883('0x1ee'),'as':'ToAgent'});db[_0xe883('0xef')][_0xe883('0x126')](db[_0xe883('0x4e')],{'foreignKey':_0xe883('0x1f3'),'as':_0xe883('0x1f0')});db[_0xe883('0xef')][_0xe883('0x126')](db[_0xe883('0x13f')],{'foreignKey':_0xe883('0x1f4'),'as':'ToAccount'});db[_0xe883('0xf0')][_0xe883('0x126')](db[_0xe883('0x5a')],{});db[_0xe883('0xf0')][_0xe883('0x126')](db[_0xe883('0x59')],{});db[_0xe883('0xf0')][_0xe883('0x126')](db['OpenchannelAccount'],{'foreignKey':_0xe883('0x1f5'),'as':_0xe883('0x1ed')});db[_0xe883('0xf0')][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':_0xe883('0x1e6'),'as':_0xe883('0x1e7')});db[_0xe883('0xf0')][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':'ToUserId','as':_0xe883('0x1e8')});db[_0xe883('0xf0')][_0xe883('0x126')](db[_0xe883('0x5c')],{'foreignKey':_0xe883('0x1f6'),'as':_0xe883('0x1f0')});db[_0xe883('0xf0')][_0xe883('0x126')](db[_0xe883('0x145')],{'foreignKey':_0xe883('0x1f7'),'as':_0xe883('0x1eb')});db[_0xe883('0xf2')][_0xe883('0x126')](db['SmsMessage'],{});db[_0xe883('0xf2')]['belongsTo'](db[_0xe883('0x53')],{});db['SmsTransferReport'][_0xe883('0x126')](db[_0xe883('0x148')],{'foreignKey':_0xe883('0x1f8'),'as':_0xe883('0x1ed')});db[_0xe883('0xf2')]['belongsTo'](db[_0xe883('0x13')],{'foreignKey':_0xe883('0x1e6'),'as':_0xe883('0x1e7')});db[_0xe883('0xf2')][_0xe883('0x126')](db['User'],{'foreignKey':_0xe883('0x1ee'),'as':_0xe883('0x1e8')});db[_0xe883('0xf2')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0xe883('0x1f9'),'as':_0xe883('0x1f0')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xe883('0xf4')][_0xe883('0x117')](db[_0xe883('0x182')],{'as':_0xe883('0x183'),'foreignKey':'ListId','onDelete':_0xe883('0x113')});db['CmList'][_0xe883('0x117')](db[_0xe883('0x75')],{'as':_0xe883('0x1fa'),'foreignKey':'ListId'});db[_0xe883('0xf4')][_0xe883('0x117')](db[_0xe883('0x12b')],{'as':'Contacts','onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x171')});db[_0xe883('0xf4')][_0xe883('0x117')](db['CmHopperFinal'],{'as':_0xe883('0x119'),'foreignKey':_0xe883('0x171')});db[_0xe883('0xf4')]['hasMany'](db[_0xe883('0x1fb')],{'as':'HopperHistory','foreignKey':_0xe883('0x171')});db['CmList'][_0xe883('0x117')](db[_0xe883('0x11b')],{'as':_0xe883('0x11b'),'foreignKey':_0xe883('0x171')});db[_0xe883('0xf4')][_0xe883('0x129')](db[_0xe883('0x1c')],{'as':_0xe883('0x1fc'),'through':_0xe883('0x158')});db['CmList']['belongsToMany'](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':_0xe883('0x12f')});db[_0xe883('0xf6')][_0xe883('0x117')](db[_0xe883('0x14c')],{'as':_0xe883('0x118'),'onDelete':_0xe883('0x113')});db[_0xe883('0xf6')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':'UserVoicePrefix'});db[_0xe883('0xf6')]['belongsToMany'](db[_0xe883('0x130')],{'through':_0xe883('0x1df'),'as':_0xe883('0x15a')});db['UserProfile'][_0xe883('0x117')](db['User'],{'as':_0xe883('0x17b'),'foreignKey':_0xe883('0x128')});db[_0xe883('0x127')][_0xe883('0x117')](db[_0xe883('0xf8')],{'as':_0xe883('0x1fd'),'foreignKey':_0xe883('0x128'),'onDelete':_0xe883('0x113')});db['UserProfileSection'][_0xe883('0x117')](db[_0xe883('0xf9')],{'as':_0xe883('0x1fe'),'foreignKey':_0xe883('0x1ff'),'onDelete':_0xe883('0x113')});db['WhatsappAccount'][_0xe883('0x117')](db[_0xe883('0x182')],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xe883('0xfc')]['hasMany'](db[_0xe883('0x7b')],{'as':_0xe883('0x16c'),'foreignKey':_0xe883('0x200')});db[_0xe883('0xfc')][_0xe883('0x117')](db[_0xe883('0x101')],{'as':'Messages','foreignKey':_0xe883('0x200')});db[_0xe883('0xfc')][_0xe883('0x117')](db[_0xe883('0xff')],{'as':_0xe883('0x16d')});db[_0xe883('0xfc')][_0xe883('0x117')](db['WhatsappApplication'],{'as':_0xe883('0x16f'),'foreignKey':_0xe883('0x200'),'onDelete':_0xe883('0x113')});db[_0xe883('0xfc')][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':'List','foreignKey':'ListId'});db['WhatsappAccount'][_0xe883('0x126')](db[_0xe883('0x156')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':_0xe883('0x201')});db['WhatsappApplication']['belongsTo'](db[_0xe883('0x13')],{'onDelete':'restrict'});db[_0xe883('0xfd')][_0xe883('0x126')](db['WhatsappQueue'],{'onDelete':_0xe883('0x169')});db[_0xe883('0xfd')][_0xe883('0x126')](db['WhatsappAccount'],{'onDelete':_0xe883('0x169')});db['WhatsappApplication'][_0xe883('0x126')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xe883('0x155')});db[_0xe883('0xfd')]['belongsTo'](db[_0xe883('0x8a')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xe883('0xff')][_0xe883('0x117')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xe883('0x113'),'foreignKey':_0xe883('0x202')});db[_0xe883('0xff')]['belongsTo'](db[_0xe883('0xfc')],{'as':'Account','foreignKey':_0xe883('0x200')});db[_0xe883('0xff')][_0xe883('0x126')](db[_0xe883('0x12b')],{'as':_0xe883('0x165'),'foreignKey':'ContactId'});db['WhatsappInteraction']['belongsTo'](db[_0xe883('0x13')],{'as':_0xe883('0x177'),'foreignKey':'UserId'});db[_0xe883('0xff')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':'whatsapp_interaction_has_tags','as':_0xe883('0x179')});db[_0xe883('0xff')][_0xe883('0x129')](db[_0xe883('0x8a')],{'through':_0xe883('0x203'),'as':_0xe883('0x17a')});db[_0xe883('0xff')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x17b'),'through':_0xe883('0x135'),'foreignKey':_0xe883('0x202')});db[_0xe883('0x101')]['belongsTo'](db['User'],{'as':'User'});db[_0xe883('0x101')][_0xe883('0x126')](db[_0xe883('0x12b')],{'onDelete':_0xe883('0x113'),'as':_0xe883('0x165')});db['WhatsappMessage'][_0xe883('0x126')](db[_0xe883('0xff')],{'onDelete':_0xe883('0x113'),'as':_0xe883('0x188'),'foreignKey':_0xe883('0x202')});db['WhatsappMessage'][_0xe883('0x126')](db[_0xe883('0xfc')],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0xe883('0x103')][_0xe883('0x126')](db[_0xe883('0xf4')],{'as':_0xe883('0x170'),'foreignKey':_0xe883('0x171')});db['WhatsappQueueReport'][_0xe883('0x126')](db['CmContact'],{'as':_0xe883('0x165'),'foreignKey':'ContactId'});db[_0xe883('0x103')][_0xe883('0x126')](db[_0xe883('0xff')],{});db[_0xe883('0x103')]['belongsTo'](db[_0xe883('0x13c')],{});db['WhatsappQueueReport']['belongsTo'](db['WhatsappMessage'],{});db[_0xe883('0x103')][_0xe883('0x126')](db['User'],{});db['WhatsappTransferReport'][_0xe883('0x126')](db[_0xe883('0x101')],{});db[_0xe883('0x104')][_0xe883('0x126')](db[_0xe883('0xff')],{});db[_0xe883('0x104')]['belongsTo'](db[_0xe883('0xfc')],{'foreignKey':_0xe883('0x204'),'as':'FromAccount'});db[_0xe883('0x104')][_0xe883('0x126')](db[_0xe883('0xfc')],{'foreignKey':_0xe883('0x205'),'as':'ToAccount'});db[_0xe883('0x104')][_0xe883('0x126')](db[_0xe883('0x13c')],{'foreignKey':_0xe883('0x206'),'as':_0xe883('0x1f0')});db[_0xe883('0x104')][_0xe883('0x126')](db['User'],{'foreignKey':_0xe883('0x1e6'),'as':'FromAgent'});db[_0xe883('0x104')][_0xe883('0x126')](db[_0xe883('0x13')],{'foreignKey':_0xe883('0x1ee'),'as':_0xe883('0x1e8')});db[_0xe883('0x13c')][_0xe883('0x129')](db[_0xe883('0x13')],{'as':_0xe883('0x159'),'through':_0xe883('0x36'),'foreignKey':_0xe883('0x207')});db['WhatsappQueue'][_0xe883('0x129')](db[_0xe883('0x130')],{'through':_0xe883('0x1de'),'as':_0xe883('0x15a')});db[_0xe883('0x10c')][_0xe883('0x126')](db['User'],{'as':_0xe883('0x208'),'foreignKey':_0xe883('0x110'),'onDelete':_0xe883('0x113'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0xe883('0xc0')],{'as':_0xe883('0xc0'),'onDelete':_0xe883('0x169')});db[_0xe883('0x167')]['hasOne'](db['MailServerIn'],{'as':_0xe883('0x209'),'onDelete':_0xe883('0x169')});db[_0xe883('0x167')][_0xe883('0x111')](db[_0xe883('0x3a')],{'as':_0xe883('0x16b'),'onDelete':_0xe883('0x169')});module[_0xe883('0x20a')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb999=['HopperBlacks','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','AgentReports','CmContact','MailServerIn','restrict','MailServerOut','MailAccountId','CloudProviderId','Imap','Smtp','Dispositions','Answers','MailMessage','Messages','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Contact','ContactId','Owner','mail_interaction_has_tags','Users','Attachments','IntervalId','TagId','MailQueueReport','Items','FaxAccountId','FaxApplication','Exntensions','FaxInteractionId','fax_interaction_has_tags','Tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','ThroughTags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','ChatGroupId','CompanyId','Phones','CmContactId','JscriptySessions','cm_contact_has_tags','AdditionalPhones','CmHopperId','Agent','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','CustomReportId','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','SalesforceAccount','AccountId','Field','FieldId','Subject','Description','VariableId','ZendeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowConfiguration','Dynamics365Field','FreshsalesAccount','ChatQueueReport','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','user_has_teams','team_has_openchannel_queues','team_has_whatsapp_queues','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','exports','../config/environment','jstz','determine','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','sequelizeHistory','utf8mb4','utf8_general_ci','database','password','username','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','../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','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','UserId','userSetting','cascade','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','CmHopper','SET\x20NULL','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','ChatInteractions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','UserVoicePrefix','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccount','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories'];(function(_0x412f4e,_0x4bfe0a){var _0x4c57d1=function(_0x4f006f){while(--_0x4f006f){_0x412f4e['push'](_0x412f4e['shift']());}};_0x4c57d1(++_0x4bfe0a);}(_0xb999,0xad));var _0x9b99=function(_0x468d2d,_0x2a58cb){_0x468d2d=_0x468d2d-0x0;var _0x7203b2=_0xb999[_0x468d2d];return _0x7203b2;};'use strict';var config=require(_0x9b99('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x9b99('0x1'));var timezone=jstz[_0x9b99('0x2')]();config[_0x9b99('0x3')]=_['defaultsDeep'](config['sequelize'],{'database':_0x9b99('0x4'),'username':_0x9b99('0x5'),'password':_0x9b99('0x6'),'options':{'host':_0x9b99('0x7'),'port':0xcea,'dialect':_0x9b99('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x9b99('0x9')](),'define':{'charset':_0x9b99('0xa'),'collate':'utf8_general_ci'}}});config[_0x9b99('0xb')]=_['defaultsDeep'](config[_0x9b99('0xb')],{'database':'motion2','username':_0x9b99('0x5'),'password':'xC@LL1234','options':{'host':_0x9b99('0x7'),'port':0xcea,'dialect':_0x9b99('0x8'),'dialectOptions':{'charset':_0x9b99('0xc')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x9b99('0xa'),'collate':_0x9b99('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9b99('0x3')][_0x9b99('0xe')],config[_0x9b99('0x3')]['username'],config['sequelize'][_0x9b99('0xf')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9b99('0xb')]['database'],config[_0x9b99('0xb')][_0x9b99('0x10')],config[_0x9b99('0xb')][_0x9b99('0xf')],config[_0x9b99('0xb')][_0x9b99('0x11')])};db[_0x9b99('0x12')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x13'));db[_0x9b99('0x14')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x16'));db[_0x9b99('0x17')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x18'));db['VoiceExtension']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x19'));db[_0x9b99('0x1a')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x1b'));db[_0x9b99('0x1c')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x1d'));db[_0x9b99('0x1e')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x1f'));db['ScreenRecording']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x20'));db[_0x9b99('0x21')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x22'));db[_0x9b99('0x23')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x24'));db['VoiceCallReport']=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/voiceCallReport/voiceCallReport.model');db[_0x9b99('0x25')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x9b99('0x26')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x27'));db[_0x9b99('0x28')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x29'));db[_0x9b99('0x2a')]=db[_0x9b99('0x3')]['import']('../api/memberReport/memberReport.model');db[_0x9b99('0x2b')]=db['sequelize'][_0x9b99('0x15')]('../api/trunk/trunk.model');db[_0x9b99('0x2c')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x2d'));db[_0x9b99('0x2e')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x2f'));db[_0x9b99('0x30')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x9b99('0x31')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x32'));db['UserMailQueue']=db[_0x9b99('0x3')]['import'](_0x9b99('0x33'));db[_0x9b99('0x34')]=db['sequelize']['import'](_0x9b99('0x35'));db['UserSmsQueue']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x36'));db[_0x9b99('0x37')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x38'));db['MailServerIn']=db[_0x9b99('0x3')]['import'](_0x9b99('0x39'));db['MailServerOut']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x3a'));db['MailAccount']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x3b'));db[_0x9b99('0x3c')]=db[_0x9b99('0x3')]['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x3d'));db[_0x9b99('0x3e')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x3f'));db['MailMessage']=db[_0x9b99('0x3')]['import'](_0x9b99('0x40'));db[_0x9b99('0x41')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x42'));db['MailQueueReport']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x43'));db[_0x9b99('0x44')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x45'));db[_0x9b99('0x46')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x47'));db[_0x9b99('0x48')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x49'));db['FaxApplication']=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/faxApplication/faxApplication.model');db[_0x9b99('0x4a')]=db['sequelize']['import'](_0x9b99('0x4b'));db[_0x9b99('0x4c')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x4d'));db[_0x9b99('0x4e')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x4f'));db[_0x9b99('0x50')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x51'));db['SmsAccount']=db[_0x9b99('0x3')]['import'](_0x9b99('0x52'));db[_0x9b99('0x53')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/smsApplication/smsApplication.model');db[_0x9b99('0x54')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x55'));db[_0x9b99('0x56')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x57'));db[_0x9b99('0x58')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x59'));db['OpenchannelAccount']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x5a'));db[_0x9b99('0x5b')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x5c'));db['OpenchannelInteraction']=db[_0x9b99('0x3')]['import'](_0x9b99('0x5d'));db[_0x9b99('0x5e')]=db['sequelize']['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x5f'));db[_0x9b99('0x60')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x61'));db[_0x9b99('0x62')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x63'));db[_0x9b99('0x64')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x65'));db[_0x9b99('0x66')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/chatInteraction/chatInteraction.model');db[_0x9b99('0x67')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x68'));db[_0x9b99('0x69')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x6a'));db[_0x9b99('0x6b')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x6c'));db[_0x9b99('0x6d')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/chatGroup/chatGroup.model');db[_0x9b99('0x6e')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x6f'));db[_0x9b99('0x70')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x71'));db['CmContact']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x72'));db['CmHopper']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x73'));db[_0x9b99('0x74')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x75'));db[_0x9b99('0x76')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x77'));db[_0x9b99('0x78')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x79'));db[_0x9b99('0x7a')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x7b'));db[_0x9b99('0x7c')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x7d'));db[_0x9b99('0x7e')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x7f'));db[_0x9b99('0x80')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x81'));db[_0x9b99('0x82')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x83'));db[_0x9b99('0x84')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x85'));db[_0x9b99('0x86')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x87'));db[_0x9b99('0x88')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/interval/interval.model');db['Pause']=db['sequelize']['import'](_0x9b99('0x89'));db[_0x9b99('0x8a')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x8b'));db['VoiceQueuesLog']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x8c'));db[_0x9b99('0x8d')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x8e'));db[_0x9b99('0x8f')]=db[_0x9b99('0x3')]['import']('../api/sound/sound.model');db[_0x9b99('0x90')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x91'));db[_0x9b99('0x92')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x93'));db[_0x9b99('0x94')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x95'));db[_0x9b99('0x96')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x97'));db['Template']=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/template/template.model');db[_0x9b99('0x98')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x99'));db[_0x9b99('0x9a')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x9b'));db['Integration']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x9c'));db[_0x9b99('0x9d')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x9e'));db[_0x9b99('0x9f')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xa0'));db[_0x9b99('0xa1')]=db[_0x9b99('0x3')]['import'](_0x9b99('0xa2'));db[_0x9b99('0xa3')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xa4'));db[_0x9b99('0xa5')]=db[_0x9b99('0x3')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x9b99('0xa6')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xa7'));db[_0x9b99('0xa8')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xa9'));db['SalesforceAccount']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xaa'));db[_0x9b99('0xab')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xac'));db[_0x9b99('0xad')]=db[_0x9b99('0x3')]['import'](_0x9b99('0xae'));db[_0x9b99('0xaf')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x9b99('0xb0')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xb1'));db[_0x9b99('0xb2')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x9b99('0xb3')]=db['sequelize']['import'](_0x9b99('0xb4'));db[_0x9b99('0xb5')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xb6'));db[_0x9b99('0xb7')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xb8'));db[_0x9b99('0xb9')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0xba'));db[_0x9b99('0xbb')]=db[_0x9b99('0x3')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x9b99('0xbc')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xbd'));db['ZendeskAccount']=db['sequelize'][_0x9b99('0x15')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x9b99('0xbe')]=db[_0x9b99('0x3')]['import'](_0x9b99('0xbf'));db[_0x9b99('0xc0')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0x9b99('0xc1')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x9b99('0xc2')]=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x9b99('0xc3')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x9b99('0xc4')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xc5'));db['VtigerConfiguration']=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x9b99('0xc6')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0x9b99('0xc7')]=db[_0x9b99('0x3')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0xc8'));db[_0x9b99('0xc9')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xca'));db[_0x9b99('0xcb')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xcc'));db[_0x9b99('0xcd')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0xce'));db['Dynamics365Field']=db['sequelize']['import'](_0x9b99('0xcf'));db['FreshsalesAccount']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0xd0'));db[_0x9b99('0xd1')]=db['sequelize'][_0x9b99('0x15')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x9b99('0xd2')]=db[_0x9b99('0x3')]['import'](_0x9b99('0xd3'));db[_0x9b99('0xd4')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x9c'));db[_0x9b99('0xd5')]=db[_0x9b99('0x3')]['import'](_0x9b99('0xd6'));db['ChatQueueReport']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xd7'));db[_0x9b99('0xd8')]=db[_0x9b99('0x3')]['import'](_0x9b99('0xd9'));db[_0x9b99('0xda')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xdb'));db['JscriptyQuestionReport']=db[_0x9b99('0x3')]['import'](_0x9b99('0xdc'));db[_0x9b99('0xdd')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0xde'));db['SquareReport']=db[_0x9b99('0x3')]['import'](_0x9b99('0xdf'));db[_0x9b99('0xe0')]=db[_0x9b99('0x3')]['import'](_0x9b99('0xe1'));db[_0x9b99('0xe2')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0xe3'));db[_0x9b99('0xe4')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xe5'));db[_0x9b99('0xe6')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xe7'));db['SquareProject']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xe8'));db['SquareRecording']=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/squareRecording/squareRecording.model');db[_0x9b99('0xe9')]=db['sequelize'][_0x9b99('0x15')]('../api/squareMessage/squareMessage.model');db[_0x9b99('0xea')]=db['sequelize']['import'](_0x9b99('0xeb'));db[_0x9b99('0xec')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xed'));db[_0x9b99('0xee')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xef'));db[_0x9b99('0xf0')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xf1'));db[_0x9b99('0xf2')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xf3'));db['Plugin']=db['sequelize']['import']('../api/plugin/plugin.model');db[_0x9b99('0xf4')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0x9b99('0xf5')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0x9b99('0xf6')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xf7'));db[_0x9b99('0xf8')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xf9'));db[_0x9b99('0xfa')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xfb'));db[_0x9b99('0xfc')]=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/cmList/cmList.model');db[_0x9b99('0xfd')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0xfe'));db[_0x9b99('0xff')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x100'));db[_0x9b99('0x101')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x102'));db[_0x9b99('0x103')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x104'));db[_0x9b99('0x105')]=db['sequelize']['import'](_0x9b99('0x106'));db['WhatsappAccount']=db[_0x9b99('0x3')]['import']('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db['sequelize']['import'](_0x9b99('0x107'));db[_0x9b99('0x108')]=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x109'));db[_0x9b99('0x10a')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x10b'));db['WhatsappQueueReport']=db[_0x9b99('0x3')][_0x9b99('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x9b99('0x10c')]=db['sequelize']['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x9b99('0x10d')]=db['sequelize'][_0x9b99('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0x9b99('0x10e')]=db[_0x9b99('0x3')]['import'](_0x9b99('0x10f'));db['TeamVoiceQueue']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x110'));db[_0x9b99('0x111')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x112'));db['UserVoicePrefix']=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x113'));db[_0x9b99('0x114')]=db[_0x9b99('0x3')][_0x9b99('0x15')](_0x9b99('0x115'));db['MailInteractionHasTag']=db['sequelize'][_0x9b99('0x15')](_0x9b99('0x116'));db['User'][_0x9b99('0x117')](db['VoiceMail'],{'as':_0x9b99('0x21'),'onDelete':'cascade','foreignKey':_0x9b99('0x118')});db['User']['hasOne'](db['UserSetting'],{'as':_0x9b99('0x119'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x12')][_0x9b99('0x11b')](db['VoiceRecording'],{'as':_0x9b99('0x11c'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x12')][_0x9b99('0x11b')](db[_0x9b99('0x2e')],{'as':_0x9b99('0x11d'),'foreignKey':_0x9b99('0x118')});db['User'][_0x9b99('0x11b')](db[_0x9b99('0x11e')],{'as':_0x9b99('0x11f'),'onDelete':_0x9b99('0x11a'),'hooks':!![]});db[_0x9b99('0x12')][_0x9b99('0x11b')](db[_0x9b99('0x76')],{'as':_0x9b99('0x120'),'foreignKey':_0x9b99('0x118')});db['User'][_0x9b99('0x11b')](db[_0x9b99('0x78')],{'as':_0x9b99('0x121'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x12')]['hasMany'](db['ReportAgentPreview'],{'as':_0x9b99('0x7a'),'foreignKey':_0x9b99('0x118')});db['User']['hasMany'](db[_0x9b99('0x122')],{'as':_0x9b99('0x123'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x12')]['hasMany'](db[_0x9b99('0x66')],{'as':'ChatInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0x9b99('0x54')],{'as':_0x9b99('0x124'),'foreignKey':_0x9b99('0x118')});db['User']['hasMany'](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x9b99('0x118')});db[_0x9b99('0x12')][_0x9b99('0x11b')](db[_0x9b99('0x3e')],{'as':_0x9b99('0x125'),'foreignKey':'UserId'});db[_0x9b99('0x12')][_0x9b99('0x11b')](db[_0x9b99('0x108')],{'as':_0x9b99('0x126'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x12')][_0x9b99('0x11b')](db[_0x9b99('0x105')],{'as':_0x9b99('0x127'),'foreignKey':_0x9b99('0x128')});db[_0x9b99('0x12')][_0x9b99('0x11b')](db[_0x9b99('0x129')],{'as':'Hoppers','foreignKey':_0x9b99('0x118'),'onDelete':_0x9b99('0x12a')});db[_0x9b99('0x12')]['belongsTo'](db['UserProfile'],{'as':_0x9b99('0xff'),'foreignKey':_0x9b99('0x12b')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x6d')],{'as':_0x9b99('0x12d'),'through':_0x9b99('0x12e')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db['CmContact'],{'as':_0x9b99('0x12f'),'through':_0x9b99('0x130')});db[_0x9b99('0x12')]['belongsToMany'](db[_0x9b99('0xfc')],{'as':_0x9b99('0x131'),'through':_0x9b99('0x132')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0xea')],{'through':'user_has_teams'});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x3e')],{'as':_0x9b99('0x125'),'through':_0x9b99('0x133')});db[_0x9b99('0x12')]['belongsToMany'](db['ChatInteraction'],{'as':_0x9b99('0x134'),'through':'user_has_chat_interactions'});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x4a')],{'as':_0x9b99('0x135'),'through':_0x9b99('0x136')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x54')],{'as':_0x9b99('0x124'),'through':_0x9b99('0x137')});db[_0x9b99('0x12')]['belongsToMany'](db[_0x9b99('0x122')],{'as':_0x9b99('0x123'),'through':_0x9b99('0x138')});db['User'][_0x9b99('0x12c')](db[_0x9b99('0x108')],{'as':_0x9b99('0x126'),'through':_0x9b99('0x139')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x1c')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db['User']['belongsToMany'](db[_0x9b99('0xfd')],{'as':_0x9b99('0x13a'),'through':_0x9b99('0x13b'),'required':![]});db[_0x9b99('0x12')]['belongsToMany'](db[_0x9b99('0x3c')],{'as':_0x9b99('0x13c'),'through':_0x9b99('0x13d'),'required':![]});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x6b')],{'as':_0x9b99('0x13e'),'through':_0x9b99('0x31'),'required':![],'hooks':!![]});db[_0x9b99('0x12')][_0x9b99('0x12c')](db['FaxQueue'],{'as':_0x9b99('0x13f'),'through':_0x9b99('0x34'),'required':![]});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x58')],{'as':_0x9b99('0x140'),'through':_0x9b99('0x141'),'required':![]});db[_0x9b99('0x12')]['belongsToMany'](db[_0x9b99('0x142')],{'as':_0x9b99('0x143'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x9b99('0x12c')](db[_0x9b99('0x10d')],{'as':_0x9b99('0x144'),'through':_0x9b99('0x145'),'required':![]});db['User'][_0x9b99('0x12c')](db[_0x9b99('0xfc')],{'through':_0x9b99('0x132')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x60')],{'as':_0x9b99('0x146'),'through':_0x9b99('0x147')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x48')],{'as':'FaxAccounts','through':_0x9b99('0x148')});db['User'][_0x9b99('0x12c')](db[_0x9b99('0x149')],{'as':'MailAccounts','through':_0x9b99('0x14a')});db['User'][_0x9b99('0x12c')](db[_0x9b99('0x14b')],{'as':_0x9b99('0x14c'),'through':_0x9b99('0x14d')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x14e')],{'as':'SmsAccounts','through':_0x9b99('0x14f')});db[_0x9b99('0x12')][_0x9b99('0x12c')](db[_0x9b99('0x150')],{'as':_0x9b99('0x151'),'through':'user_has_whatsapp_accounts'});db[_0x9b99('0x14')][_0x9b99('0x11b')](db[_0x9b99('0x11e')],{'as':_0x9b99('0x152'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x153')});db['VoiceContext'][_0x9b99('0x11b')](db[_0x9b99('0x11e')],{'onDelete':'cascade'});db[_0x9b99('0x11e')][_0x9b99('0x11b')](db['VoiceExtension'],{'as':_0x9b99('0x154'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x1a')][_0x9b99('0x12c')](db[_0x9b99('0x8f')],{'as':'Sounds','through':_0x9b99('0x155')});db[_0x9b99('0x1c')][_0x9b99('0x11b')](db['UserVoiceQueueRt'],{'as':_0x9b99('0x156'),'foreignKey':_0x9b99('0x157')});db[_0x9b99('0x1c')][_0x9b99('0x11b')](db[_0x9b99('0x129')],{'as':_0x9b99('0x158'),'foreignKey':_0x9b99('0x157')});db[_0x9b99('0x1c')][_0x9b99('0x11b')](db['CmHopperFinal'],{'as':_0x9b99('0x120'),'foreignKey':_0x9b99('0x157')});db[_0x9b99('0x1c')][_0x9b99('0x11b')](db[_0x9b99('0x78')],{'as':_0x9b99('0x159'),'foreignKey':_0x9b99('0x157')});db[_0x9b99('0x1c')][_0x9b99('0x11b')](db[_0x9b99('0x7a')],{'as':_0x9b99('0x7a'),'foreignKey':_0x9b99('0x157')});db[_0x9b99('0x1c')][_0x9b99('0x11b')](db[_0x9b99('0x74')],{'as':_0x9b99('0x15a'),'foreignKey':_0x9b99('0x157')});db[_0x9b99('0x1c')][_0x9b99('0x11b')](db[_0x9b99('0xdd')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db['VoiceQueue']['belongsTo'](db[_0x9b99('0x2b')],{'as':_0x9b99('0x2b'),'foreignKey':_0x9b99('0x15b')});db[_0x9b99('0x1c')][_0x9b99('0x15c')](db[_0x9b99('0x2b')],{'as':_0x9b99('0x15d'),'foreignKey':_0x9b99('0x15e')});db['VoiceQueue']['belongsTo'](db['Interval'],{'as':_0x9b99('0x88'),'foreignKey':'IntervalId'});db[_0x9b99('0x1c')][_0x9b99('0x15c')](db[_0x9b99('0x15f')],{'as':_0x9b99('0x160'),'foreignKey':_0x9b99('0x161')});db['VoiceQueue']['belongsToMany'](db[_0x9b99('0xfc')],{'as':_0x9b99('0x131'),'through':_0x9b99('0x162')});db[_0x9b99('0x1c')][_0x9b99('0x12c')](db['User'],{'as':_0x9b99('0x163'),'through':_0x9b99('0x30')});db['VoiceQueue']['belongsToMany'](db['Team'],{'as':_0x9b99('0x164'),'through':_0x9b99('0x165')});db[_0x9b99('0x1c')][_0x9b99('0x12c')](db[_0x9b99('0xfc')],{'as':_0x9b99('0x166'),'through':_0x9b99('0x167')});db[_0x9b99('0x1e')]['belongsTo'](db[_0x9b99('0x12')],{'as':'User','foreignKey':_0x9b99('0x118')});db[_0x9b99('0x168')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'as':'User','foreignKey':_0x9b99('0x118')});db[_0x9b99('0x21')][_0x9b99('0x11b')](db[_0x9b99('0x23')],{'as':'Messages','onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x169'),'sourceKey':'mailbox'});db[_0x9b99('0x23')][_0x9b99('0x15c')](db[_0x9b99('0x21')],{'foreignKey':_0x9b99('0x169'),'targetKey':'mailbox'});db[_0x9b99('0x16a')][_0x9b99('0x11b')](db[_0x9b99('0x28')],{'as':_0x9b99('0x16b'),'foreignKey':_0x9b99('0x16c'),'constraints':![]});db[_0x9b99('0x16a')]['hasMany'](db[_0x9b99('0x26')],{'as':_0x9b99('0x16d'),'foreignKey':_0x9b99('0x16c'),'constraints':![]});db[_0x9b99('0x16a')]['belongsTo'](db[_0x9b99('0x12')],{'as':_0x9b99('0x12'),'foreignKey':_0x9b99('0x118')});db['VoiceCallReport'][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x9b99('0x16f')][_0x9b99('0x15c')](db['MailAccount'],{'as':_0x9b99('0x149'),'foreignKey':'MailAccountId'});db[_0x9b99('0x16f')][_0x9b99('0x15c')](db[_0x9b99('0x10e')],{'as':_0x9b99('0x10e'),'foreignKey':'CloudProviderId','onDelete':_0x9b99('0x170')});db[_0x9b99('0x171')][_0x9b99('0x15c')](db[_0x9b99('0x149')],{'as':'MailAccount','foreignKey':_0x9b99('0x172')});db['MailServerOut'][_0x9b99('0x15c')](db[_0x9b99('0x10e')],{'as':'CloudProvider','foreignKey':_0x9b99('0x173'),'onDelete':_0x9b99('0x170')});db[_0x9b99('0x149')][_0x9b99('0x117')](db[_0x9b99('0x16f')],{'as':_0x9b99('0x174'),'onDelete':_0x9b99('0x11a')});db['MailAccount'][_0x9b99('0x117')](db[_0x9b99('0x171')],{'as':_0x9b99('0x175'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x149')][_0x9b99('0x11b')](db[_0x9b99('0x84')],{'as':_0x9b99('0x176'),'foreignKey':_0x9b99('0x172'),'onDelete':'cascade'});db[_0x9b99('0x149')]['hasMany'](db[_0x9b99('0x82')],{'as':_0x9b99('0x177'),'foreignKey':'MailAccountId'});db[_0x9b99('0x149')][_0x9b99('0x11b')](db[_0x9b99('0x178')],{'as':_0x9b99('0x179'),'foreignKey':'MailAccountId'});db[_0x9b99('0x149')][_0x9b99('0x11b')](db['MailInteraction'],{'as':_0x9b99('0x17a')});db[_0x9b99('0x149')][_0x9b99('0x11b')](db[_0x9b99('0x41')],{'as':_0x9b99('0x154'),'foreignKey':_0x9b99('0x172'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x149')][_0x9b99('0x15c')](db['CmList'],{'as':_0x9b99('0x17b'),'foreignKey':_0x9b99('0x17c')});db['MailAccount'][_0x9b99('0x15c')](db[_0x9b99('0x17d')],{'as':'Template','foreignKey':_0x9b99('0x17e')});db['MailAccount'][_0x9b99('0x15c')](db['Pause'],{'as':_0x9b99('0x160'),'foreignKey':_0x9b99('0x161')});db[_0x9b99('0x149')]['belongsToMany'](db['User'],{'as':_0x9b99('0x163'),'through':'user_has_mail_accounts'});db[_0x9b99('0x3c')]['belongsToMany'](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':_0x9b99('0x13d')});db[_0x9b99('0x3c')]['belongsToMany'](db['Team'],{'through':_0x9b99('0x17f'),'as':_0x9b99('0x164')});db[_0x9b99('0x3e')][_0x9b99('0x11b')](db[_0x9b99('0x178')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x9b99('0x180')});db['MailInteraction']['belongsTo'](db[_0x9b99('0x149')],{'as':_0x9b99('0x181'),'foreignKey':'MailAccountId'});db[_0x9b99('0x3e')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db['MailInteraction'][_0x9b99('0x15c')](db['User'],{'as':_0x9b99('0x184'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x3e')][_0x9b99('0x12c')](db['Tag'],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x9b99('0x3e')][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':_0x9b99('0x185'),'as':'ThroughTags'});db[_0x9b99('0x3e')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x186'),'through':_0x9b99('0x133'),'foreignKey':_0x9b99('0x180')});db['MailMessage']['hasMany'](db[_0x9b99('0xf2')],{'as':_0x9b99('0x187'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x178')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x12')});db[_0x9b99('0x178')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x182')});db['MailMessage'][_0x9b99('0x15c')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0x9b99('0x180')});db[_0x9b99('0x178')][_0x9b99('0x15c')](db[_0x9b99('0x149')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x172')});db[_0x9b99('0x178')]['belongsTo'](db[_0x9b99('0x60')],{'as':_0x9b99('0x60'),'foreignKey':'ChatWebsiteId'});db[_0x9b99('0x178')][_0x9b99('0x15c')](db[_0x9b99('0x69')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x9b99('0x41')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x41')][_0x9b99('0x15c')](db[_0x9b99('0x3c')],{'onDelete':'restrict'});db[_0x9b99('0x41')][_0x9b99('0x15c')](db[_0x9b99('0x149')],{'onDelete':'restrict'});db[_0x9b99('0x41')][_0x9b99('0x15c')](db[_0x9b99('0x88')],{'onDelete':_0x9b99('0x170'),'foreignKey':_0x9b99('0x188')});db[_0x9b99('0x41')][_0x9b99('0x15c')](db[_0x9b99('0x90')],{'onDelete':_0x9b99('0x170'),'foreignKey':_0x9b99('0x189')});db['MailQueueReport'][_0x9b99('0x15c')](db[_0x9b99('0x149')],{});db[_0x9b99('0x18a')][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':_0x9b99('0x17b'),'foreignKey':_0x9b99('0x17c')});db[_0x9b99('0x18a')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':'Contact','foreignKey':_0x9b99('0x183')});db['MailQueueReport'][_0x9b99('0x15c')](db['MailInteraction'],{});db[_0x9b99('0x18a')][_0x9b99('0x15c')](db[_0x9b99('0x178')],{});db[_0x9b99('0x18a')][_0x9b99('0x15c')](db['User'],{});db[_0x9b99('0x18a')]['belongsTo'](db[_0x9b99('0x3c')],{});db['Dashboard'][_0x9b99('0x11b')](db[_0x9b99('0x46')],{'as':_0x9b99('0x18b'),'onDelete':_0x9b99('0x11a')});db['FaxAccount'][_0x9b99('0x11b')](db[_0x9b99('0x84')],{'as':_0x9b99('0x176'),'foreignKey':_0x9b99('0x18c'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x48')]['hasMany'](db[_0x9b99('0x82')],{'as':'Answers','foreignKey':_0x9b99('0x18c')});db[_0x9b99('0x48')][_0x9b99('0x11b')](db[_0x9b99('0x4a')],{'as':'Interactions'});db[_0x9b99('0x48')][_0x9b99('0x11b')](db[_0x9b99('0x18d')],{'as':_0x9b99('0x154'),'foreignKey':_0x9b99('0x18c'),'onDelete':_0x9b99('0x11a')});db['FaxAccount'][_0x9b99('0x11b')](db[_0x9b99('0x11e')],{'as':_0x9b99('0x18e'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x48')][_0x9b99('0x11b')](db[_0x9b99('0x4c')],{'as':_0x9b99('0x179')});db[_0x9b99('0x48')][_0x9b99('0x15c')](db[_0x9b99('0x2b')],{'as':_0x9b99('0x2b')});db[_0x9b99('0x48')]['belongsTo'](db[_0x9b99('0xfc')],{'as':'List','foreignKey':_0x9b99('0x17c')});db[_0x9b99('0x48')]['belongsTo'](db[_0x9b99('0x15f')],{'as':_0x9b99('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9b99('0x48')]['belongsToMany'](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':_0x9b99('0x148')});db[_0x9b99('0x18d')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'onDelete':'restrict'});db[_0x9b99('0x18d')][_0x9b99('0x15c')](db[_0x9b99('0x4e')],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x18d')][_0x9b99('0x15c')](db[_0x9b99('0x48')],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x18d')][_0x9b99('0x15c')](db[_0x9b99('0x90')],{'onDelete':_0x9b99('0x170'),'foreignKey':_0x9b99('0x189')});db['FaxInteraction'][_0x9b99('0x11b')](db['FaxMessage'],{'as':'Messages','onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x18f')});db[_0x9b99('0x4a')]['belongsTo'](db[_0x9b99('0x48')],{'as':'Account','foreignKey':_0x9b99('0x18c')});db[_0x9b99('0x4a')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':'ContactId'});db[_0x9b99('0x4a')][_0x9b99('0x15c')](db['User'],{'as':_0x9b99('0x184'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x4a')]['belongsToMany'](db[_0x9b99('0x90')],{'through':_0x9b99('0x190'),'as':_0x9b99('0x191')});db['FaxInteraction'][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':_0x9b99('0x190'),'as':'ThroughTags'});db[_0x9b99('0x4a')]['belongsToMany'](db['User'],{'as':_0x9b99('0x186'),'through':_0x9b99('0x136'),'foreignKey':_0x9b99('0x18f')});db[_0x9b99('0x4c')][_0x9b99('0x15c')](db['User'],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x12')});db['FaxMessage']['belongsTo'](db[_0x9b99('0x4a')],{'as':_0x9b99('0x192'),'foreignKey':_0x9b99('0x18f')});db[_0x9b99('0x4c')]['belongsTo'](db[_0x9b99('0x16e')],{'onDelete':'cascade','as':_0x9b99('0x182')});db['FaxMessage'][_0x9b99('0x15c')](db[_0x9b99('0xf2')],{'as':_0x9b99('0xf2'),'foreignKey':_0x9b99('0x193')});db['FaxMessage'][_0x9b99('0x15c')](db[_0x9b99('0x48')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x18c')});db['FaxQueue']['belongsToMany'](db['User'],{'as':_0x9b99('0x163'),'through':_0x9b99('0x34')});db[_0x9b99('0x4e')]['belongsToMany'](db[_0x9b99('0xea')],{'through':_0x9b99('0x194'),'as':_0x9b99('0x164')});db[_0x9b99('0x50')][_0x9b99('0x15c')](db[_0x9b99('0x48')],{});db[_0x9b99('0x50')][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':_0x9b99('0x17b'),'foreignKey':'ListId'});db[_0x9b99('0x50')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':'ContactId'});db[_0x9b99('0x50')]['belongsTo'](db[_0x9b99('0x4a')],{});db[_0x9b99('0x50')][_0x9b99('0x15c')](db[_0x9b99('0x4c')],{});db[_0x9b99('0x50')]['belongsTo'](db[_0x9b99('0x12')],{});db[_0x9b99('0x50')][_0x9b99('0x15c')](db[_0x9b99('0x4e')],{});db[_0x9b99('0x14e')][_0x9b99('0x11b')](db[_0x9b99('0x84')],{'as':'Dispositions','foreignKey':_0x9b99('0x195'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x14e')][_0x9b99('0x11b')](db['CannedAnswer'],{'as':_0x9b99('0x177'),'foreignKey':_0x9b99('0x195')});db[_0x9b99('0x14e')]['hasMany'](db[_0x9b99('0x56')],{'as':'Messages','foreignKey':_0x9b99('0x195')});db[_0x9b99('0x14e')][_0x9b99('0x11b')](db['SmsInteraction'],{'as':'Interactions'});db['SmsAccount'][_0x9b99('0x11b')](db['SmsApplication'],{'as':_0x9b99('0x154'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0x9b99('0x14e')][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':'List','foreignKey':'ListId'});db[_0x9b99('0x14e')][_0x9b99('0x15c')](db[_0x9b99('0x15f')],{'as':_0x9b99('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9b99('0x14e')][_0x9b99('0x12c')](db['User'],{'as':_0x9b99('0x163'),'through':'user_has_sms_accounts'});db[_0x9b99('0x53')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'onDelete':_0x9b99('0x170')});db['SmsApplication'][_0x9b99('0x15c')](db[_0x9b99('0x58')],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x53')][_0x9b99('0x15c')](db['SmsAccount'],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x53')]['belongsTo'](db[_0x9b99('0x88')],{'onDelete':_0x9b99('0x170'),'foreignKey':'IntervalId'});db[_0x9b99('0x53')][_0x9b99('0x15c')](db[_0x9b99('0x90')],{'onDelete':_0x9b99('0x170'),'foreignKey':'TagId'});db[_0x9b99('0x54')]['hasMany'](db['SmsMessage'],{'as':'Messages','onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x196')});db[_0x9b99('0x54')][_0x9b99('0x15c')](db[_0x9b99('0x14e')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x195')});db[_0x9b99('0x54')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db[_0x9b99('0x54')]['belongsTo'](db[_0x9b99('0x12')],{'as':_0x9b99('0x184'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x54')][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':'sms_interaction_has_tags','as':_0x9b99('0x191')});db[_0x9b99('0x54')][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':_0x9b99('0x197'),'as':_0x9b99('0x198')});db[_0x9b99('0x54')][_0x9b99('0x12c')](db['User'],{'as':_0x9b99('0x186'),'through':_0x9b99('0x137'),'foreignKey':_0x9b99('0x196')});db[_0x9b99('0x56')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x12')});db[_0x9b99('0x56')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'onDelete':'cascade','as':_0x9b99('0x182')});db['SmsMessage']['belongsTo'](db[_0x9b99('0x54')],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x192'),'foreignKey':_0x9b99('0x196')});db[_0x9b99('0x56')][_0x9b99('0x15c')](db['SmsAccount'],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x195')});db[_0x9b99('0x58')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue']['belongsToMany'](db[_0x9b99('0xea')],{'through':_0x9b99('0x199'),'as':_0x9b99('0x164')});db['OpenchannelAccount'][_0x9b99('0x11b')](db['Disposition'],{'as':_0x9b99('0x176'),'foreignKey':'OpenchannelAccountId','onDelete':_0x9b99('0x11a')});db['OpenchannelAccount'][_0x9b99('0x11b')](db[_0x9b99('0x82')],{'as':'Answers','foreignKey':_0x9b99('0x19a')});db[_0x9b99('0x14b')][_0x9b99('0x11b')](db[_0x9b99('0x122')],{'as':_0x9b99('0x17a'),'foreignKey':_0x9b99('0x19a')});db[_0x9b99('0x14b')][_0x9b99('0x11b')](db[_0x9b99('0x5e')],{'as':'Messages','foreignKey':_0x9b99('0x19a')});db[_0x9b99('0x14b')][_0x9b99('0x11b')](db['OpenchannelApplication'],{'as':_0x9b99('0x154'),'foreignKey':_0x9b99('0x19a'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x14b')][_0x9b99('0x15c')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount'][_0x9b99('0x15c')](db[_0x9b99('0x15f')],{'as':_0x9b99('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9b99('0x14b')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':_0x9b99('0x14d')});db[_0x9b99('0x5b')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x5b')][_0x9b99('0x15c')](db['OpenchannelQueue'],{'onDelete':_0x9b99('0x170'),'foreignKey':_0x9b99('0x19b')});db[_0x9b99('0x5b')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x9b99('0x19a')});db[_0x9b99('0x5b')][_0x9b99('0x15c')](db[_0x9b99('0x88')],{'onDelete':_0x9b99('0x170'),'foreignKey':_0x9b99('0x188')});db['OpenchannelApplication']['belongsTo'](db[_0x9b99('0x90')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x9b99('0x122')][_0x9b99('0x11b')](db[_0x9b99('0x5e')],{'as':_0x9b99('0x179'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x19c')});db[_0x9b99('0x122')]['belongsTo'](db[_0x9b99('0x14b')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x19a')});db[_0x9b99('0x122')]['belongsTo'](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db[_0x9b99('0x122')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x184'),'foreignKey':_0x9b99('0x118')});db['OpenchannelInteraction'][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':_0x9b99('0x19d'),'as':_0x9b99('0x191')});db[_0x9b99('0x122')][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':_0x9b99('0x19d'),'as':_0x9b99('0x198')});db[_0x9b99('0x122')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x186'),'through':_0x9b99('0x138'),'foreignKey':_0x9b99('0x19c')});db[_0x9b99('0x5e')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'onDelete':_0x9b99('0x11a'),'as':'User'});db[_0x9b99('0x5e')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x182')});db[_0x9b99('0x5e')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x192'),'foreignKey':_0x9b99('0x19c')});db[_0x9b99('0x5e')][_0x9b99('0x15c')](db[_0x9b99('0xf2')],{'as':_0x9b99('0xf2'),'foreignKey':_0x9b99('0x193')});db['OpenchannelMessage'][_0x9b99('0x15c')](db[_0x9b99('0x14b')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x19a')});db['OpenchannelQueue'][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':'UserOpenchannelQueue','foreignKey':_0x9b99('0x19b')});db['OpenchannelQueue']['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':_0x9b99('0x164')});db[_0x9b99('0x60')][_0x9b99('0x11b')](db[_0x9b99('0x84')],{'as':_0x9b99('0x176'),'foreignKey':_0x9b99('0x19e'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x60')][_0x9b99('0x11b')](db[_0x9b99('0x82')],{'as':_0x9b99('0x177'),'foreignKey':'ChatWebsiteId'});db[_0x9b99('0x60')]['hasMany'](db['ChatProactiveAction'],{'as':_0x9b99('0x19f')});db[_0x9b99('0x60')][_0x9b99('0x11b')](db[_0x9b99('0x66')],{'as':_0x9b99('0x17a')});db[_0x9b99('0x60')][_0x9b99('0x11b')](db[_0x9b99('0x64')],{'as':_0x9b99('0x154'),'foreignKey':_0x9b99('0x19e'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x60')][_0x9b99('0x11b')](db['ChatMessage'],{'as':_0x9b99('0x179')});db[_0x9b99('0x60')][_0x9b99('0x15c')](db['CmList'],{'as':_0x9b99('0x17b'),'foreignKey':_0x9b99('0x17c')});db[_0x9b99('0x60')][_0x9b99('0x15c')](db[_0x9b99('0x88')],{'as':_0x9b99('0x88'),'foreignKey':_0x9b99('0x188')});db[_0x9b99('0x60')][_0x9b99('0x15c')](db[_0x9b99('0x149')],{'as':_0x9b99('0x149'),'foreignKey':_0x9b99('0x172')});db['ChatWebsite'][_0x9b99('0x15c')](db[_0x9b99('0x15f')],{'as':_0x9b99('0x160'),'foreignKey':_0x9b99('0x161')});db[_0x9b99('0x60')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':'Agents','through':'user_has_chat_websites'});db[_0x9b99('0x62')]['belongsTo'](db[_0x9b99('0x14b')],{});db['OpenchannelQueueReport'][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':_0x9b99('0x17b'),'foreignKey':_0x9b99('0x17c')});db['OpenchannelQueueReport'][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db[_0x9b99('0x62')][_0x9b99('0x15c')](db[_0x9b99('0x122')],{});db['OpenchannelQueueReport'][_0x9b99('0x15c')](db[_0x9b99('0x5e')],{});db[_0x9b99('0x62')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{});db[_0x9b99('0x62')][_0x9b99('0x15c')](db[_0x9b99('0x142')],{});db[_0x9b99('0x64')]['belongsTo'](db[_0x9b99('0x12')],{'as':'Agent','foreignKey':'UserId','onDelete':_0x9b99('0x170')});db[_0x9b99('0x64')][_0x9b99('0x15c')](db[_0x9b99('0x6b')],{'as':_0x9b99('0x1a0'),'foreignKey':_0x9b99('0x1a1'),'onDelete':_0x9b99('0x170')});db[_0x9b99('0x64')]['belongsTo'](db[_0x9b99('0x60')],{'as':_0x9b99('0x1a2'),'foreignKey':'ChatWebsiteId','onDelete':_0x9b99('0x170')});db[_0x9b99('0x64')][_0x9b99('0x15c')](db['Tag'],{'onDelete':_0x9b99('0x170'),'foreignKey':_0x9b99('0x189')});db[_0x9b99('0x66')]['hasMany'](db['ChatMessage'],{'as':_0x9b99('0x179'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x9b99('0x66')][_0x9b99('0x15c')](db[_0x9b99('0x60')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x19e')});db[_0x9b99('0x66')][_0x9b99('0x15c')](db['CmContact'],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db['ChatInteraction'][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x184'),'foreignKey':_0x9b99('0x118')});db['ChatInteraction'][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':_0x9b99('0x1a3'),'as':'Tags'});db[_0x9b99('0x66')][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':_0x9b99('0x1a3'),'as':'ThroughTags'});db['ChatInteraction'][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x186'),'through':'user_has_chat_interactions','foreignKey':_0x9b99('0x1a4')});db[_0x9b99('0x67')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'onDelete':'cascade','as':'User'});db[_0x9b99('0x67')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x182'),'foreignKey':'ContactId'});db[_0x9b99('0x67')][_0x9b99('0x15c')](db['ChatInteraction'],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x192'),'foreignKey':_0x9b99('0x1a4')});db[_0x9b99('0x67')]['belongsTo'](db[_0x9b99('0xf2')],{'as':'Attachment','foreignKey':_0x9b99('0x193')});db['ChatMessage'][_0x9b99('0x15c')](db[_0x9b99('0x60')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x19e')});db[_0x9b99('0x69')]['hasMany'](db['Attachment'],{'as':_0x9b99('0x187'),'foreignKey':_0x9b99('0x1a5'),'onDelete':'cascade','hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db[_0x9b99('0x69')][_0x9b99('0x15c')](db[_0x9b99('0x60')],{'as':_0x9b99('0x181'),'foreignKey':'ChatWebsiteId'});db[_0x9b99('0x6b')][_0x9b99('0x12c')](db['User'],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x9b99('0x12c')](db['Team'],{'through':'team_has_chat_queues','as':_0x9b99('0x164')});db['ChatGroup'][_0x9b99('0x11b')](db[_0x9b99('0xd8')],{'as':_0x9b99('0x179'),'foreignKey':_0x9b99('0x1a6'),'onDelete':'cascade'});db[_0x9b99('0x6d')]['belongsToMany'](db['User'],{'as':_0x9b99('0x156'),'through':_0x9b99('0x12e')});db['ChatProactiveAction']['belongsTo'](db[_0x9b99('0x60')],{'as':_0x9b99('0x1a2'),'foreignKey':'ChatWebsiteId'});db[_0x9b99('0x70')][_0x9b99('0x11b')](db['CmContact'],{'as':_0x9b99('0x12f'),'foreignKey':_0x9b99('0x1a7')});db[_0x9b99('0x16e')][_0x9b99('0x11b')](db[_0x9b99('0x94')],{'as':_0x9b99('0x1a8'),'foreignKey':_0x9b99('0x1a9')});db[_0x9b99('0x16e')]['hasMany'](db[_0x9b99('0x129')],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact']['hasMany'](db['CmHopperFinal'],{'as':_0x9b99('0x120'),'foreignKey':'ContactId'});db[_0x9b99('0x16e')][_0x9b99('0x11b')](db[_0x9b99('0x78')],{'as':_0x9b99('0x159'),'foreignKey':_0x9b99('0x183')});db[_0x9b99('0x16e')][_0x9b99('0x11b')](db[_0x9b99('0x7a')],{'as':_0x9b99('0x7a'),'foreignKey':'ContactId'});db[_0x9b99('0x16e')][_0x9b99('0x11b')](db[_0x9b99('0xdd')],{'as':_0x9b99('0x1aa'),'foreignKey':'ContactId'});db[_0x9b99('0x16e')][_0x9b99('0x11b')](db[_0x9b99('0x122')],{'as':_0x9b99('0x123'),'foreignKey':_0x9b99('0x183'),'onDelete':_0x9b99('0x170')});db['CmContact'][_0x9b99('0x11b')](db[_0x9b99('0x66')],{'as':'ChatInteractions','foreignKey':_0x9b99('0x183'),'onDelete':_0x9b99('0x170')});db[_0x9b99('0x16e')][_0x9b99('0x11b')](db[_0x9b99('0x54')],{'as':_0x9b99('0x124'),'foreignKey':_0x9b99('0x183'),'onDelete':'restrict'});db[_0x9b99('0x16e')][_0x9b99('0x11b')](db[_0x9b99('0x4a')],{'as':_0x9b99('0x135'),'foreignKey':_0x9b99('0x183'),'onDelete':_0x9b99('0x170')});db['CmContact'][_0x9b99('0x11b')](db[_0x9b99('0x3e')],{'as':_0x9b99('0x125'),'foreignKey':_0x9b99('0x183'),'onDelete':'restrict'});db['CmContact'][_0x9b99('0x15c')](db['CmCompany'],{'as':'Company','foreignKey':_0x9b99('0x1a7')});db['CmContact'][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':'List','foreignKey':_0x9b99('0x17c'),'onDelete':_0x9b99('0x11a')});db['CmContact'][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x186'),'through':_0x9b99('0x130')});db[_0x9b99('0x16e')]['belongsToMany'](db['Tag'],{'as':_0x9b99('0x191'),'through':_0x9b99('0x1ab')});db[_0x9b99('0x16e')]['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':_0x9b99('0x198')});db[_0x9b99('0x129')][_0x9b99('0x11b')](db['CmHopperAdditionalPhone'],{'as':_0x9b99('0x1ac'),'foreignKey':_0x9b99('0x1ad')});db[_0x9b99('0x129')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x129')][_0x9b99('0x15c')](db['CmList'],{'as':_0x9b99('0x17b'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x9b99('0x129')]['belongsTo'](db['User'],{'as':_0x9b99('0x1ae'),'foreignKey':_0x9b99('0x118')});db['CmHopper'][_0x9b99('0x15c')](db[_0x9b99('0x1c')],{'as':_0x9b99('0x1a0'),'foreignKey':_0x9b99('0x157'),'onDelete':_0x9b99('0x11a')});db['CmHopper'][_0x9b99('0x15c')](db['Campaign'],{'as':_0x9b99('0xee'),'foreignKey':_0x9b99('0x1af'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x129')]['belongsTo'](db[_0x9b99('0x12')],{'as':_0x9b99('0x184'),'foreignKey':_0x9b99('0x1b0')});db[_0x9b99('0x74')][_0x9b99('0x15c')](db['CmContact'],{'as':'Contact','foreignKey':_0x9b99('0x183'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x74')][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':_0x9b99('0x17b'),'foreignKey':'ListId','onDelete':_0x9b99('0x11a')});db['CmHopperBlack'][_0x9b99('0x15c')](db[_0x9b99('0x1c')],{'as':_0x9b99('0x1a0'),'foreignKey':_0x9b99('0x157'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x74')][_0x9b99('0x15c')](db['Campaign'],{'as':_0x9b99('0xee'),'foreignKey':_0x9b99('0x1af'),'onDelete':'cascade'});db[_0x9b99('0x80')][_0x9b99('0x11b')](db[_0x9b99('0x86')],{'as':{'plural':_0x9b99('0x1b1'),'singular':_0x9b99('0x1b2')},'foreignKey':_0x9b99('0x1b3'),'onDelete':_0x9b99('0x11a'),'hooks':!![]});db[_0x9b99('0x80')][_0x9b99('0x11b')](db[_0x9b99('0x86')],{'as':{'plural':_0x9b99('0x1b4'),'singular':_0x9b99('0x1b5')},'foreignKey':_0x9b99('0x1b6'),'onDelete':_0x9b99('0x11a'),'hooks':!![]});db['Automation']['hasMany'](db[_0x9b99('0x7e')],{'as':_0x9b99('0x1b7'),'foreignKey':_0x9b99('0x1b8'),'onDelete':'cascade','hooks':!![]});db[_0x9b99('0x84')][_0x9b99('0x11b')](db[_0x9b99('0x84')],{'as':_0x9b99('0x176'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0x9b99('0x88')][_0x9b99('0x11b')](db['Interval'],{'as':_0x9b99('0x1b9'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x9b99('0x88')]['hasMany'](db['VoiceExtension'],{'as':_0x9b99('0x11f'),'foreignKey':_0x9b99('0x188'),'onDelete':_0x9b99('0x170')});db[_0x9b99('0x88')][_0x9b99('0x11b')](db[_0x9b99('0x41')],{'as':_0x9b99('0x1ba'),'foreignKey':'IntervalId'});db[_0x9b99('0x88')]['hasMany'](db[_0x9b99('0x64')],{'as':_0x9b99('0x1bb'),'foreignKey':_0x9b99('0x188')});db[_0x9b99('0x88')][_0x9b99('0x11b')](db['FaxApplication'],{'as':_0x9b99('0x1bc'),'foreignKey':_0x9b99('0x188')});db[_0x9b99('0x88')]['hasMany'](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x9b99('0x188')});db[_0x9b99('0x8d')][_0x9b99('0x15c')](db['MailAccount'],{});db['Schedule'][_0x9b99('0x15c')](db[_0x9b99('0xa1')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x9b99('0x15c')](db[_0x9b99('0x9f')],{'foreignKey':_0x9b99('0x1bd')});db[_0x9b99('0x8f')][_0x9b99('0x12c')](db[_0x9b99('0x1a')],{'as':'Mohs','through':_0x9b99('0x155'),'onDelete':_0x9b99('0x170')});db[_0x9b99('0x90')]['belongsToMany'](db[_0x9b99('0x16e')],{'through':_0x9b99('0x1ab')});db[_0x9b99('0x90')]['belongsToMany'](db[_0x9b99('0x66')],{'through':_0x9b99('0x1a3')});db['Tag'][_0x9b99('0x12c')](db[_0x9b99('0x3e')],{'through':_0x9b99('0x185')});db[_0x9b99('0x90')][_0x9b99('0x12c')](db[_0x9b99('0x54')],{'through':_0x9b99('0x197')});db[_0x9b99('0x90')]['belongsToMany'](db['FaxInteraction'],{'through':_0x9b99('0x190')});db['Tag'][_0x9b99('0x12c')](db[_0x9b99('0x122')],{'through':_0x9b99('0x19d')});db[_0x9b99('0x90')]['belongsToMany'](db[_0x9b99('0x108')],{'through':_0x9b99('0x1be')});db['CmContactHasItem'][_0x9b99('0x15c')](db[_0x9b99('0x92')],{'as':_0x9b99('0x1bf'),'foreignKey':_0x9b99('0x1c0')});db[_0x9b99('0x96')][_0x9b99('0x15c')](db['CmHopper'],{'as':_0x9b99('0x1c1'),'foreignKey':'CmHopperId'});db[_0x9b99('0x94')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x1a9')});db[_0x9b99('0x98')][_0x9b99('0x11b')](db[_0x9b99('0x86')],{'as':{'plural':'AllConditions','singular':_0x9b99('0x1c2')},'foreignKey':_0x9b99('0x1c3'),'onDelete':'cascade','hooks':!![]});db[_0x9b99('0x98')]['hasMany'](db[_0x9b99('0x86')],{'as':{'plural':_0x9b99('0x1c4'),'singular':_0x9b99('0x1c5')},'foreignKey':'TriggerAnyId','onDelete':_0x9b99('0x11a'),'hooks':!![]});db['Trigger'][_0x9b99('0x11b')](db[_0x9b99('0x7e')],{'as':_0x9b99('0x1b7'),'foreignKey':_0x9b99('0x1c6'),'onDelete':'cascade','hooks':!![]});db[_0x9b99('0x9f')][_0x9b99('0x11b')](db['AnalyticFieldReport'],{'as':_0x9b99('0x1c7'),'onDelete':'cascade','foreignKey':_0x9b99('0x1bd'),'hooks':!![]});db[_0x9b99('0xa1')][_0x9b99('0x11b')](db[_0x9b99('0xa6')],{'as':_0x9b99('0x1c7'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x9b99('0xa5')][_0x9b99('0x11b')](db[_0x9b99('0xa6')],{'as':_0x9b99('0x1c7'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1c8')});db[_0x9b99('0xa6')][_0x9b99('0x15c')](db[_0x9b99('0xa5')],{'foreignKey':_0x9b99('0x1c8')});db['SalesforceAccount'][_0x9b99('0x11b')](db[_0x9b99('0xab')],{'as':_0x9b99('0x1c9'),'onDelete':_0x9b99('0x11a'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x9b99('0x11b')](db['SalesforceField'],{'as':_0x9b99('0x1ca'),'onDelete':'cascade','foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xab')][_0x9b99('0x11b')](db[_0x9b99('0xad')],{'as':_0x9b99('0x1cc'),'onDelete':'cascade','foreignKey':_0x9b99('0x1cd')});db['SalesforceConfiguration'][_0x9b99('0x11b')](db['SalesforceField'],{'as':_0x9b99('0x1c7'),'onDelete':_0x9b99('0x11a'),'foreignKey':'FieldId'});db[_0x9b99('0xab')]['belongsTo'](db[_0x9b99('0x1ce')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x1cf')});db[_0x9b99('0xad')]['hasMany'](db[_0x9b99('0xad')],{'as':'Subject','foreignKey':'SubjectId'});db['SalesforceField']['hasMany'](db[_0x9b99('0xad')],{'as':'Description','foreignKey':_0x9b99('0x1cd')});db['SalesforceField']['hasMany'](db[_0x9b99('0xad')],{'as':_0x9b99('0x1d0'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xad')][_0x9b99('0x15c')](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':'VariableId'});db[_0x9b99('0xaf')][_0x9b99('0x11b')](db[_0x9b99('0xb0')],{'as':_0x9b99('0x1c9'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cf')});db['SugarcrmConfiguration'][_0x9b99('0x11b')](db[_0x9b99('0xb2')],{'as':_0x9b99('0x1ca'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xb0')][_0x9b99('0x11b')](db['SugarcrmField'],{'as':_0x9b99('0x1cc'),'onDelete':'cascade','foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xb0')][_0x9b99('0x11b')](db['SugarcrmField'],{'as':_0x9b99('0x1c7'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xb0')][_0x9b99('0x15c')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x9b99('0x1cf')});db['SugarcrmField'][_0x9b99('0x11b')](db[_0x9b99('0xb2')],{'as':_0x9b99('0x1d2'),'foreignKey':'SubjectId'});db[_0x9b99('0xb2')]['hasMany'](db['SugarcrmField'],{'as':_0x9b99('0x1d3'),'foreignKey':_0x9b99('0x1cd')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x9b99('0x1d0'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xb2')][_0x9b99('0x15c')](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':'VariableId'});db[_0x9b99('0xb3')][_0x9b99('0x11b')](db[_0x9b99('0xb5')],{'as':_0x9b99('0x1c9'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cf')});db[_0x9b99('0xb5')]['hasMany'](db[_0x9b99('0xb7')],{'as':_0x9b99('0x1ca'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xb5')][_0x9b99('0x11b')](db[_0x9b99('0xb7')],{'as':_0x9b99('0x1cc'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xb5')][_0x9b99('0x11b')](db[_0x9b99('0xb7')],{'as':_0x9b99('0x1c7'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xb5')]['belongsTo'](db[_0x9b99('0xb3')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration'][_0x9b99('0x12c')](db[_0x9b99('0x90')],{'through':'int_desk_configuration_has_tags'});db[_0x9b99('0xb7')][_0x9b99('0x11b')](db[_0x9b99('0xb7')],{'as':_0x9b99('0x1d2'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xb7')][_0x9b99('0x11b')](db['DeskField'],{'as':_0x9b99('0x1d3'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xb7')][_0x9b99('0x11b')](db[_0x9b99('0xb7')],{'as':'Field','foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xb7')]['belongsTo'](db['Variable'],{'as':_0x9b99('0x9a'),'foreignKey':_0x9b99('0x1d4')});db['ZohoAccount'][_0x9b99('0x11b')](db['ZohoConfiguration'],{'as':_0x9b99('0x1c9'),'onDelete':'cascade','foreignKey':_0x9b99('0x1cf')});db['ZohoConfiguration'][_0x9b99('0x11b')](db['ZohoField'],{'as':_0x9b99('0x1ca'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xbb')][_0x9b99('0x11b')](db['ZohoField'],{'as':_0x9b99('0x1cc'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xbb')][_0x9b99('0x11b')](db[_0x9b99('0xbc')],{'as':_0x9b99('0x1c7'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xbb')][_0x9b99('0x15c')](db['ZohoAccount'],{'as':_0x9b99('0x181'),'foreignKey':'AccountId'});db[_0x9b99('0xbc')]['hasMany'](db[_0x9b99('0xbc')],{'as':_0x9b99('0x1d2'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xbc')][_0x9b99('0x11b')](db[_0x9b99('0xbc')],{'as':_0x9b99('0x1d3'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xbc')]['hasMany'](db[_0x9b99('0xbc')],{'as':_0x9b99('0x1d0'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xbc')][_0x9b99('0x15c')](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':_0x9b99('0x1d4')});db[_0x9b99('0x1d5')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x9b99('0x1c9'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cf')});db[_0x9b99('0xbe')][_0x9b99('0x11b')](db[_0x9b99('0xc0')],{'as':_0x9b99('0x1ca'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xbe')][_0x9b99('0x11b')](db[_0x9b99('0xc0')],{'as':_0x9b99('0x1cc'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xbe')][_0x9b99('0x11b')](db['ZendeskField'],{'as':_0x9b99('0x1c7'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xbe')][_0x9b99('0x15c')](db[_0x9b99('0x1d5')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x1cf')});db[_0x9b99('0xbe')]['belongsToMany'](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x9b99('0xc0')][_0x9b99('0x11b')](db['ZendeskField'],{'as':_0x9b99('0x1d2'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xc0')]['hasMany'](db[_0x9b99('0xc0')],{'as':_0x9b99('0x1d3'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xc0')]['hasMany'](db[_0x9b99('0xc0')],{'as':_0x9b99('0x1d0'),'foreignKey':_0x9b99('0x1d1')});db['ZendeskField']['belongsTo'](db[_0x9b99('0x9a')],{'as':'Variable','foreignKey':_0x9b99('0x1d4')});db[_0x9b99('0xc1')][_0x9b99('0x11b')](db[_0x9b99('0xc2')],{'as':_0x9b99('0x1c9'),'onDelete':'cascade','foreignKey':_0x9b99('0x1cf')});db['FreshdeskConfiguration'][_0x9b99('0x11b')](db[_0x9b99('0xc3')],{'as':_0x9b99('0x1ca'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9b99('0xc2')]['hasMany'](db[_0x9b99('0xc3')],{'as':_0x9b99('0x1cc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0x9b99('0x11b')](db['FreshdeskField'],{'as':'Fields','onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1d1')});db['FreshdeskConfiguration'][_0x9b99('0x15c')](db['FreshdeskAccount'],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x1cf')});db['FreshdeskConfiguration']['belongsToMany'](db[_0x9b99('0x90')],{'through':_0x9b99('0x1d6')});db[_0x9b99('0xc3')][_0x9b99('0x11b')](db[_0x9b99('0xc3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9b99('0xc3')][_0x9b99('0x11b')](db[_0x9b99('0xc3')],{'as':_0x9b99('0x1d3'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xc3')][_0x9b99('0x11b')](db[_0x9b99('0xc3')],{'as':'Field','foreignKey':'FieldId'});db[_0x9b99('0xc3')][_0x9b99('0x15c')](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':_0x9b99('0x1d4')});db[_0x9b99('0xc4')][_0x9b99('0x11b')](db[_0x9b99('0x1d7')],{'as':_0x9b99('0x1c9'),'onDelete':_0x9b99('0x11a'),'foreignKey':'AccountId'});db[_0x9b99('0x1d7')][_0x9b99('0x11b')](db[_0x9b99('0xc6')],{'as':_0x9b99('0x1ca'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0x1d7')][_0x9b99('0x11b')](db['VtigerField'],{'as':_0x9b99('0x1cc'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0x1d7')][_0x9b99('0x11b')](db[_0x9b99('0xc6')],{'as':_0x9b99('0x1c7'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0x1d7')][_0x9b99('0x15c')](db['VtigerAccount'],{'as':_0x9b99('0x181'),'foreignKey':'AccountId'});db[_0x9b99('0xc6')][_0x9b99('0x11b')](db[_0x9b99('0xc6')],{'as':_0x9b99('0x1d2'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xc6')][_0x9b99('0x11b')](db[_0x9b99('0xc6')],{'as':_0x9b99('0x1d3'),'foreignKey':'DescriptionId'});db[_0x9b99('0xc6')]['hasMany'](db[_0x9b99('0xc6')],{'as':'Field','foreignKey':'FieldId'});db['VtigerField']['belongsTo'](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':_0x9b99('0x1d4')});db['ServicenowAccount'][_0x9b99('0x11b')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cf')});db['ServicenowConfiguration'][_0x9b99('0x11b')](db['ServicenowField'],{'as':_0x9b99('0x1ca'),'foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0x1d8')][_0x9b99('0x11b')](db[_0x9b99('0xc9')],{'as':_0x9b99('0x1cc'),'foreignKey':_0x9b99('0x1cd')});db['ServicenowConfiguration'][_0x9b99('0x11b')](db[_0x9b99('0xc9')],{'as':_0x9b99('0x1c7'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0x1d8')]['belongsTo'](db[_0x9b99('0xc7')],{'as':'Account','foreignKey':_0x9b99('0x1cf')});db['ServicenowField'][_0x9b99('0x11b')](db['ServicenowField'],{'as':_0x9b99('0x1d2'),'foreignKey':_0x9b99('0x1cb')});db['ServicenowField'][_0x9b99('0x11b')](db[_0x9b99('0xc9')],{'as':_0x9b99('0x1d3'),'foreignKey':'DescriptionId'});db[_0x9b99('0xc9')][_0x9b99('0x11b')](db[_0x9b99('0xc9')],{'as':'Field','foreignKey':'FieldId'});db[_0x9b99('0xc9')][_0x9b99('0x15c')](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':_0x9b99('0x1d4')});db['Dynamics365Account'][_0x9b99('0x11b')](db[_0x9b99('0xcd')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x9b99('0xcb')]['belongsTo'](db['CloudProvider'],{'as':_0x9b99('0x10e'),'foreignKey':_0x9b99('0x173')});db[_0x9b99('0xcd')][_0x9b99('0x11b')](db[_0x9b99('0x1d9')],{'as':_0x9b99('0x1ca'),'onDelete':'cascade','foreignKey':_0x9b99('0x1cb')});db[_0x9b99('0xcd')][_0x9b99('0x11b')](db[_0x9b99('0x1d9')],{'as':_0x9b99('0x1cc'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cd')});db['Dynamics365Configuration'][_0x9b99('0x11b')](db[_0x9b99('0x1d9')],{'as':_0x9b99('0x1c7'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1d1')});db['Dynamics365Configuration'][_0x9b99('0x15c')](db[_0x9b99('0xcb')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x1cf')});db['Dynamics365Field']['hasMany'](db[_0x9b99('0x1d9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9b99('0x1d9')]['hasMany'](db[_0x9b99('0x1d9')],{'as':_0x9b99('0x1d3'),'foreignKey':'DescriptionId'});db[_0x9b99('0x1d9')][_0x9b99('0x11b')](db[_0x9b99('0x1d9')],{'as':_0x9b99('0x1d0'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0x1d9')][_0x9b99('0x15c')](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':_0x9b99('0x1d4')});db['FreshsalesAccount'][_0x9b99('0x11b')](db['FreshsalesConfiguration'],{'as':_0x9b99('0x1c9'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1cf')});db[_0x9b99('0xd1')][_0x9b99('0x11b')](db[_0x9b99('0xd2')],{'as':_0x9b99('0x1ca'),'foreignKey':_0x9b99('0x1cb')});db['FreshsalesConfiguration'][_0x9b99('0x11b')](db[_0x9b99('0xd2')],{'as':_0x9b99('0x1cc'),'foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xd1')][_0x9b99('0x11b')](db['FreshsalesField'],{'as':_0x9b99('0x1c7'),'foreignKey':'FieldId'});db[_0x9b99('0xd1')][_0x9b99('0x15c')](db[_0x9b99('0x1da')],{'as':_0x9b99('0x181'),'foreignKey':_0x9b99('0x1cf')});db[_0x9b99('0xd2')]['hasMany'](db['FreshsalesField'],{'as':_0x9b99('0x1d2'),'foreignKey':'SubjectId'});db[_0x9b99('0xd2')][_0x9b99('0x11b')](db[_0x9b99('0xd2')],{'as':'Description','foreignKey':_0x9b99('0x1cd')});db[_0x9b99('0xd2')]['hasMany'](db[_0x9b99('0xd2')],{'as':_0x9b99('0x1d0'),'foreignKey':_0x9b99('0x1d1')});db[_0x9b99('0xd2')][_0x9b99('0x15c')](db[_0x9b99('0x9a')],{'as':_0x9b99('0x9a'),'foreignKey':_0x9b99('0x1d4')});db[_0x9b99('0x1db')][_0x9b99('0x15c')](db[_0x9b99('0x60')],{});db['ChatQueueReport'][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':'List','foreignKey':_0x9b99('0x17c')});db[_0x9b99('0x1db')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x9b99('0x1db')][_0x9b99('0x15c')](db[_0x9b99('0x66')],{});db[_0x9b99('0x1db')][_0x9b99('0x15c')](db[_0x9b99('0x67')],{});db[_0x9b99('0x1db')]['belongsTo'](db[_0x9b99('0x12')],{});db[_0x9b99('0x1db')][_0x9b99('0x15c')](db[_0x9b99('0x6b')],{});db[_0x9b99('0xd8')]['belongsTo'](db[_0x9b99('0x12')],{'onDelete':_0x9b99('0x11a'),'foreignKey':'FromId'});db[_0x9b99('0xd8')]['belongsTo'](db['User'],{'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x1dc')});db[_0x9b99('0xdd')][_0x9b99('0x11b')](db[_0x9b99('0x1dd')],{'foreignKey':_0x9b99('0x1de'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0xdd')]['hasMany'](db[_0x9b99('0xda')],{'foreignKey':_0x9b99('0x1de'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x1df')][_0x9b99('0x15c')](db[_0x9b99('0x14e')],{});db['SmsQueueReport']['belongsTo'](db[_0x9b99('0xfc')],{'as':_0x9b99('0x17b'),'foreignKey':_0x9b99('0x17c')});db[_0x9b99('0x1df')][_0x9b99('0x15c')](db['CmContact'],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db[_0x9b99('0x1df')][_0x9b99('0x15c')](db[_0x9b99('0x54')],{});db[_0x9b99('0x1df')][_0x9b99('0x15c')](db[_0x9b99('0x56')],{});db[_0x9b99('0x1df')]['belongsTo'](db[_0x9b99('0x12')],{});db[_0x9b99('0x1df')][_0x9b99('0x15c')](db[_0x9b99('0x58')],{});db['JscriptyProject'][_0x9b99('0x11b')](db[_0x9b99('0xdd')],{'foreignKey':'ProjectId'});db[_0x9b99('0xe2')][_0x9b99('0x11b')](db[_0x9b99('0x1dd')],{'foreignKey':'ProjectId'});db[_0x9b99('0xe2')][_0x9b99('0x11b')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x9b99('0xea')][_0x9b99('0x12c')](db['User'],{'as':_0x9b99('0x163'),'through':_0x9b99('0x1e0')});db[_0x9b99('0xea')][_0x9b99('0x12c')](db[_0x9b99('0x1c')],{'through':_0x9b99('0x165'),'as':'VoiceQueues'});db[_0x9b99('0xea')][_0x9b99('0x12c')](db[_0x9b99('0x3c')],{'through':_0x9b99('0x17f'),'as':_0x9b99('0x13c')});db[_0x9b99('0xea')][_0x9b99('0x12c')](db[_0x9b99('0x6b')],{'through':'team_has_chat_queues','as':_0x9b99('0x13e')});db[_0x9b99('0xea')]['belongsToMany'](db[_0x9b99('0x4e')],{'through':_0x9b99('0x194'),'as':'FaxQueues'});db['Team'][_0x9b99('0x12c')](db[_0x9b99('0x58')],{'through':_0x9b99('0x199'),'as':_0x9b99('0x140')});db[_0x9b99('0xea')][_0x9b99('0x12c')](db[_0x9b99('0x142')],{'through':_0x9b99('0x1e1'),'as':_0x9b99('0x143')});db[_0x9b99('0xea')][_0x9b99('0x12c')](db['WhatsappQueue'],{'through':_0x9b99('0x1e2'),'as':_0x9b99('0x144')});db['Team'][_0x9b99('0x12c')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x9b99('0xee')][_0x9b99('0x11b')](db['CmHopper'],{'as':_0x9b99('0x158'),'foreignKey':_0x9b99('0x1af')});db[_0x9b99('0xee')][_0x9b99('0x11b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x9b99('0x1af')});db[_0x9b99('0xee')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0x9b99('0xee')][_0x9b99('0x11b')](db[_0x9b99('0x74')],{'as':_0x9b99('0x15a'),'foreignKey':_0x9b99('0x1af')});db[_0x9b99('0xee')][_0x9b99('0x15c')](db[_0x9b99('0x2b')],{'as':_0x9b99('0x2b'),'foreignKey':_0x9b99('0x15b')});db[_0x9b99('0xee')][_0x9b99('0x15c')](db[_0x9b99('0x2b')],{'as':'TrunkBackup','foreignKey':_0x9b99('0x15e')});db[_0x9b99('0xee')][_0x9b99('0x15c')](db[_0x9b99('0x88')],{'as':_0x9b99('0x88'),'foreignKey':_0x9b99('0x188')});db[_0x9b99('0xee')]['belongsTo'](db[_0x9b99('0x1e3')],{'as':_0x9b99('0x1e3'),'foreignKey':_0x9b99('0x1e4')});db['Campaign'][_0x9b99('0x12c')](db[_0x9b99('0xfc')],{'as':'Lists','through':_0x9b99('0x1e5')});db['Campaign']['belongsToMany'](db[_0x9b99('0xfc')],{'as':'BlackLists','through':_0x9b99('0x1e6')});db['Attachment'][_0x9b99('0x15c')](db[_0x9b99('0x69')],{'as':_0x9b99('0x69'),'foreignKey':'ChatOfflineMessageId'});db[_0x9b99('0xf4')]['belongsTo'](db[_0x9b99('0x178')],{});db[_0x9b99('0xf4')]['belongsTo'](db[_0x9b99('0x3e')],{});db[_0x9b99('0xf4')][_0x9b99('0x15c')](db[_0x9b99('0x149')],{'foreignKey':_0x9b99('0x1e7'),'as':_0x9b99('0x1e8')});db['MailTransferReport'][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'foreignKey':'FromUserId','as':_0x9b99('0x1e9')});db[_0x9b99('0xf4')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'foreignKey':_0x9b99('0x1ea'),'as':_0x9b99('0x1eb')});db['MailTransferReport'][_0x9b99('0x15c')](db[_0x9b99('0x3c')],{'foreignKey':_0x9b99('0x1ec'),'as':_0x9b99('0x1ed')});db['MailTransferReport'][_0x9b99('0x15c')](db['MailAccount'],{'foreignKey':_0x9b99('0x1ee'),'as':_0x9b99('0x1ef')});db[_0x9b99('0xf5')][_0x9b99('0x15c')](db[_0x9b99('0x67')],{});db[_0x9b99('0xf5')]['belongsTo'](db[_0x9b99('0x66')],{});db[_0x9b99('0xf5')][_0x9b99('0x15c')](db[_0x9b99('0x60')],{'foreignKey':_0x9b99('0x1f0'),'as':_0x9b99('0x1e8')});db[_0x9b99('0xf5')][_0x9b99('0x15c')](db['User'],{'foreignKey':_0x9b99('0x1f1'),'as':_0x9b99('0x1e9')});db[_0x9b99('0xf5')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9b99('0xf5')][_0x9b99('0x15c')](db[_0x9b99('0x6b')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0x9b99('0xf5')][_0x9b99('0x15c')](db[_0x9b99('0x60')],{'foreignKey':_0x9b99('0x1f2'),'as':_0x9b99('0x1ef')});db[_0x9b99('0xf6')]['belongsTo'](db['FaxMessage'],{});db[_0x9b99('0xf6')]['belongsTo'](db['FaxInteraction'],{});db[_0x9b99('0xf6')][_0x9b99('0x15c')](db[_0x9b99('0x48')],{'foreignKey':_0x9b99('0x1f3'),'as':_0x9b99('0x1e8')});db[_0x9b99('0xf6')]['belongsTo'](db[_0x9b99('0x12')],{'foreignKey':_0x9b99('0x1f1'),'as':_0x9b99('0x1e9')});db['FaxTransferReport'][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'foreignKey':_0x9b99('0x1ea'),'as':'ToAgent'});db['FaxTransferReport'][_0x9b99('0x15c')](db[_0x9b99('0x4e')],{'foreignKey':_0x9b99('0x1f4'),'as':_0x9b99('0x1ed')});db[_0x9b99('0xf6')][_0x9b99('0x15c')](db[_0x9b99('0x48')],{'foreignKey':_0x9b99('0x1f5'),'as':_0x9b99('0x1ef')});db['OpenchannelTransferReport']['belongsTo'](db[_0x9b99('0x5e')],{});db['OpenchannelTransferReport'][_0x9b99('0x15c')](db[_0x9b99('0x122')],{});db[_0x9b99('0xf8')][_0x9b99('0x15c')](db['OpenchannelAccount'],{'foreignKey':_0x9b99('0x1f6'),'as':_0x9b99('0x1e8')});db[_0x9b99('0xf8')][_0x9b99('0x15c')](db['User'],{'foreignKey':_0x9b99('0x1f1'),'as':'FromAgent'});db[_0x9b99('0xf8')]['belongsTo'](db[_0x9b99('0x12')],{'foreignKey':_0x9b99('0x1ea'),'as':_0x9b99('0x1eb')});db[_0x9b99('0xf8')][_0x9b99('0x15c')](db[_0x9b99('0x142')],{'foreignKey':_0x9b99('0x1f7'),'as':_0x9b99('0x1ed')});db[_0x9b99('0xf8')][_0x9b99('0x15c')](db[_0x9b99('0x14b')],{'foreignKey':_0x9b99('0x1f8'),'as':_0x9b99('0x1ef')});db['SmsTransferReport'][_0x9b99('0x15c')](db[_0x9b99('0x56')],{});db[_0x9b99('0xfa')][_0x9b99('0x15c')](db[_0x9b99('0x54')],{});db['SmsTransferReport'][_0x9b99('0x15c')](db[_0x9b99('0x14e')],{'foreignKey':_0x9b99('0x1f9'),'as':_0x9b99('0x1e8')});db[_0x9b99('0xfa')]['belongsTo'](db[_0x9b99('0x12')],{'foreignKey':'FromUserId','as':_0x9b99('0x1e9')});db[_0x9b99('0xfa')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'foreignKey':_0x9b99('0x1ea'),'as':'ToAgent'});db[_0x9b99('0xfa')][_0x9b99('0x15c')](db[_0x9b99('0x58')],{'foreignKey':_0x9b99('0x1fa'),'as':'ToQueue'});db[_0x9b99('0xfa')][_0x9b99('0x15c')](db[_0x9b99('0x14e')],{'foreignKey':_0x9b99('0x1fb'),'as':_0x9b99('0x1ef')});db['CmList']['hasMany'](db['Disposition'],{'as':_0x9b99('0x176'),'foreignKey':_0x9b99('0x17c'),'onDelete':'cascade'});db['CmList'][_0x9b99('0x11b')](db[_0x9b99('0x7c')],{'as':'CustomFields','foreignKey':_0x9b99('0x17c')});db[_0x9b99('0xfc')]['hasMany'](db[_0x9b99('0x16e')],{'as':'Contacts','onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x17c')});db['CmList']['hasMany'](db[_0x9b99('0x76')],{'as':'HopperFinals','foreignKey':_0x9b99('0x17c')});db[_0x9b99('0xfc')][_0x9b99('0x11b')](db[_0x9b99('0x78')],{'as':'HopperHistory','foreignKey':_0x9b99('0x17c')});db[_0x9b99('0xfc')][_0x9b99('0x11b')](db['ReportAgentPreview'],{'as':_0x9b99('0x7a'),'foreignKey':_0x9b99('0x17c')});db['CmList'][_0x9b99('0x12c')](db[_0x9b99('0x1c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x9b99('0xfc')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':'cm_user_has_lists'});db[_0x9b99('0xfd')][_0x9b99('0x11b')](db[_0x9b99('0x11e')],{'as':_0x9b99('0x11f'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0xfd')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':'UserVoicePrefix'});db[_0x9b99('0xfd')][_0x9b99('0x12c')](db[_0x9b99('0xea')],{'through':_0x9b99('0x111'),'as':_0x9b99('0x164')});db[_0x9b99('0xff')][_0x9b99('0x11b')](db[_0x9b99('0x12')],{'as':_0x9b99('0x186'),'foreignKey':_0x9b99('0x12b')});db['UserProfile'][_0x9b99('0x11b')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0x9b99('0x12b'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x101')][_0x9b99('0x11b')](db[_0x9b99('0x103')],{'as':_0x9b99('0x1fc'),'foreignKey':_0x9b99('0x1fd'),'onDelete':'cascade'});db[_0x9b99('0x150')][_0x9b99('0x11b')](db[_0x9b99('0x84')],{'as':'Dispositions','foreignKey':_0x9b99('0x1fe'),'onDelete':_0x9b99('0x11a')});db[_0x9b99('0x150')][_0x9b99('0x11b')](db[_0x9b99('0x82')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x9b99('0x11b')](db[_0x9b99('0x10a')],{'as':_0x9b99('0x179'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x9b99('0x11b')](db[_0x9b99('0x108')],{'as':'Interactions'});db[_0x9b99('0x150')][_0x9b99('0x11b')](db[_0x9b99('0x1ff')],{'as':'Applications','foreignKey':_0x9b99('0x1fe'),'onDelete':'cascade'});db[_0x9b99('0x150')][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':_0x9b99('0x17b'),'foreignKey':_0x9b99('0x17c')});db[_0x9b99('0x150')][_0x9b99('0x15c')](db[_0x9b99('0x15f')],{'as':_0x9b99('0x160'),'foreignKey':_0x9b99('0x161')});db[_0x9b99('0x150')]['belongsToMany'](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication']['belongsTo'](db[_0x9b99('0x12')],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x1ff')]['belongsTo'](db[_0x9b99('0x10d')],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x1ff')][_0x9b99('0x15c')](db['WhatsappAccount'],{'onDelete':_0x9b99('0x170')});db[_0x9b99('0x1ff')][_0x9b99('0x15c')](db[_0x9b99('0x88')],{'onDelete':'restrict','foreignKey':_0x9b99('0x188')});db[_0x9b99('0x1ff')][_0x9b99('0x15c')](db['Tag'],{'onDelete':_0x9b99('0x170'),'foreignKey':_0x9b99('0x189')});db['WhatsappInteraction'][_0x9b99('0x11b')](db[_0x9b99('0x10a')],{'as':_0x9b99('0x179'),'onDelete':_0x9b99('0x11a'),'foreignKey':_0x9b99('0x200')});db['WhatsappInteraction']['belongsTo'](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x9b99('0x108')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':'ContactId'});db[_0x9b99('0x108')]['belongsTo'](db[_0x9b99('0x12')],{'as':_0x9b99('0x184'),'foreignKey':_0x9b99('0x118')});db[_0x9b99('0x108')][_0x9b99('0x12c')](db['Tag'],{'through':_0x9b99('0x1be'),'as':'Tags'});db['WhatsappInteraction']['belongsToMany'](db[_0x9b99('0x90')],{'through':_0x9b99('0x1be'),'as':'ThroughTags'});db[_0x9b99('0x108')][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':'Users','through':_0x9b99('0x139'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x12')});db[_0x9b99('0x10a')][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'onDelete':'cascade','as':'Contact'});db[_0x9b99('0x10a')]['belongsTo'](db[_0x9b99('0x108')],{'onDelete':_0x9b99('0x11a'),'as':_0x9b99('0x192'),'foreignKey':_0x9b99('0x200')});db['WhatsappMessage'][_0x9b99('0x15c')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x9b99('0x1fe')});db[_0x9b99('0x201')]['belongsTo'](db[_0x9b99('0x150')],{});db['WhatsappQueueReport'][_0x9b99('0x15c')](db[_0x9b99('0xfc')],{'as':_0x9b99('0x17b'),'foreignKey':_0x9b99('0x17c')});db['WhatsappQueueReport'][_0x9b99('0x15c')](db[_0x9b99('0x16e')],{'as':_0x9b99('0x182'),'foreignKey':_0x9b99('0x183')});db[_0x9b99('0x201')][_0x9b99('0x15c')](db[_0x9b99('0x108')],{});db[_0x9b99('0x201')][_0x9b99('0x15c')](db[_0x9b99('0x10d')],{});db[_0x9b99('0x201')]['belongsTo'](db[_0x9b99('0x10a')],{});db[_0x9b99('0x201')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x9b99('0x10a')],{});db[_0x9b99('0x10c')][_0x9b99('0x15c')](db[_0x9b99('0x108')],{});db[_0x9b99('0x10c')]['belongsTo'](db[_0x9b99('0x150')],{'foreignKey':_0x9b99('0x202'),'as':_0x9b99('0x1e8')});db[_0x9b99('0x10c')][_0x9b99('0x15c')](db[_0x9b99('0x150')],{'foreignKey':_0x9b99('0x203'),'as':'ToAccount'});db[_0x9b99('0x10c')][_0x9b99('0x15c')](db[_0x9b99('0x10d')],{'foreignKey':_0x9b99('0x204'),'as':_0x9b99('0x1ed')});db[_0x9b99('0x10c')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'foreignKey':_0x9b99('0x1f1'),'as':_0x9b99('0x1e9')});db[_0x9b99('0x10c')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'foreignKey':_0x9b99('0x1ea'),'as':'ToAgent'});db['WhatsappQueue'][_0x9b99('0x12c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x163'),'through':_0x9b99('0x145'),'foreignKey':'WhatsappQueueId'});db[_0x9b99('0x10d')]['belongsToMany'](db[_0x9b99('0xea')],{'through':'team_has_whatsapp_queues','as':_0x9b99('0x164')});db[_0x9b99('0x114')][_0x9b99('0x15c')](db[_0x9b99('0x12')],{'as':_0x9b99('0x205'),'foreignKey':'UserId','onDelete':_0x9b99('0x11a'),'hooks':!![]});db['CloudProvider'][_0x9b99('0x117')](db[_0x9b99('0xcb')],{'as':_0x9b99('0xcb'),'onDelete':_0x9b99('0x170')});db['CloudProvider'][_0x9b99('0x117')](db[_0x9b99('0x16f')],{'as':_0x9b99('0x174'),'onDelete':_0x9b99('0x170')});db[_0x9b99('0x10e')]['hasOne'](db['MailServerOut'],{'as':_0x9b99('0x175'),'onDelete':_0x9b99('0x170')});module[_0x9b99('0x206')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 458d918..b337329 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcac9=['./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/realtime','/api/user-settings','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','path','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/messages','./api/squareMessage','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xcac9,0x143));var _0x9cac=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0xcac9[_0x2134b7];return _0x6c5914;};'use strict';var path=require(_0x9cac('0x0'));var express=require(_0x9cac('0x1'));var errors=require(_0x9cac('0x2'));var config=require(_0x9cac('0x3'));var setupLoggers=require(_0x9cac('0x4'))['setupLoggers'];var clientSideLogs=require(_0x9cac('0x5'));exports['default']=function(_0x267825){return setupLoggers(_0x267825)[_0x9cac('0x6')](function(){_0x267825[_0x9cac('0x7')](_0x9cac('0x8'),require('./api/user'));_0x267825[_0x9cac('0x7')](_0x9cac('0x9'),require(_0x9cac('0xa')));_0x267825[_0x9cac('0x7')](_0x9cac('0xb'),require('./api/voiceContext'));_0x267825[_0x9cac('0x7')](_0x9cac('0xc'),require('./api/voiceExtension'));_0x267825[_0x9cac('0x7')](_0x9cac('0xd'),require(_0x9cac('0xe')));_0x267825[_0x9cac('0x7')](_0x9cac('0xf'),require(_0x9cac('0x10')));_0x267825[_0x9cac('0x7')]('/api/voice/recordings',require(_0x9cac('0x11')));_0x267825[_0x9cac('0x7')]('/api/screen/recordings',require(_0x9cac('0x12')));_0x267825[_0x9cac('0x7')](_0x9cac('0x13'),require(_0x9cac('0x14')));_0x267825[_0x9cac('0x7')](_0x9cac('0x15'),require(_0x9cac('0x16')));_0x267825[_0x9cac('0x7')](_0x9cac('0x17'),require(_0x9cac('0x18')));_0x267825[_0x9cac('0x7')]('/api/voice/dials/reports',require(_0x9cac('0x19')));_0x267825[_0x9cac('0x7')](_0x9cac('0x1a'),require('./api/voiceAgentReport'));_0x267825[_0x9cac('0x7')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x267825[_0x9cac('0x7')](_0x9cac('0x1b'),require(_0x9cac('0x1c')));_0x267825[_0x9cac('0x7')](_0x9cac('0x1d'),require(_0x9cac('0x1e')));_0x267825[_0x9cac('0x7')](_0x9cac('0x1f'),require(_0x9cac('0x20')));_0x267825[_0x9cac('0x7')](_0x9cac('0x21'),require(_0x9cac('0x22')));_0x267825[_0x9cac('0x7')](_0x9cac('0x23'),require(_0x9cac('0x24')));_0x267825['use'](_0x9cac('0x25'),require(_0x9cac('0x26')));_0x267825[_0x9cac('0x7')](_0x9cac('0x27'),require(_0x9cac('0x28')));_0x267825[_0x9cac('0x7')](_0x9cac('0x29'),require('./api/mailInteraction'));_0x267825[_0x9cac('0x7')]('/api/mail/messages',require(_0x9cac('0x2a')));_0x267825['use']('/api/mail/applications',require(_0x9cac('0x2b')));_0x267825[_0x9cac('0x7')](_0x9cac('0x2c'),require('./api/mailQueueReport'));_0x267825['use'](_0x9cac('0x2d'),require('./api/dashboard'));_0x267825[_0x9cac('0x7')](_0x9cac('0x2e'),require(_0x9cac('0x2f')));_0x267825[_0x9cac('0x7')](_0x9cac('0x30'),require(_0x9cac('0x31')));_0x267825[_0x9cac('0x7')]('/api/fax/applications',require('./api/faxApplication'));_0x267825['use'](_0x9cac('0x32'),require('./api/faxInteraction'));_0x267825[_0x9cac('0x7')]('/api/fax/messages',require(_0x9cac('0x33')));_0x267825[_0x9cac('0x7')](_0x9cac('0x34'),require('./api/faxQueue'));_0x267825[_0x9cac('0x7')](_0x9cac('0x35'),require(_0x9cac('0x36')));_0x267825[_0x9cac('0x7')](_0x9cac('0x37'),require(_0x9cac('0x38')));_0x267825[_0x9cac('0x7')](_0x9cac('0x39'),require('./api/smsApplication'));_0x267825[_0x9cac('0x7')](_0x9cac('0x3a'),require(_0x9cac('0x3b')));_0x267825[_0x9cac('0x7')](_0x9cac('0x3c'),require(_0x9cac('0x3d')));_0x267825['use'](_0x9cac('0x3e'),require('./api/smsQueue'));_0x267825['use'](_0x9cac('0x3f'),require('./api/openchannelAccount'));_0x267825[_0x9cac('0x7')](_0x9cac('0x40'),require(_0x9cac('0x41')));_0x267825[_0x9cac('0x7')](_0x9cac('0x42'),require(_0x9cac('0x43')));_0x267825[_0x9cac('0x7')](_0x9cac('0x44'),require(_0x9cac('0x45')));_0x267825[_0x9cac('0x7')](_0x9cac('0x46'),require(_0x9cac('0x47')));_0x267825[_0x9cac('0x7')]('/api/chat/websites',require(_0x9cac('0x48')));_0x267825['use'](_0x9cac('0x49'),require(_0x9cac('0x4a')));_0x267825['use']('/api/chat/applications',require(_0x9cac('0x4b')));_0x267825[_0x9cac('0x7')](_0x9cac('0x4c'),require(_0x9cac('0x4d')));_0x267825[_0x9cac('0x7')]('/api/chat/messages',require(_0x9cac('0x4e')));_0x267825[_0x9cac('0x7')]('/api/chat/offline_messages',require(_0x9cac('0x4f')));_0x267825[_0x9cac('0x7')](_0x9cac('0x50'),require(_0x9cac('0x51')));_0x267825[_0x9cac('0x7')]('/api/chat/groups',require(_0x9cac('0x52')));_0x267825[_0x9cac('0x7')](_0x9cac('0x53'),require(_0x9cac('0x54')));_0x267825[_0x9cac('0x7')](_0x9cac('0x55'),require(_0x9cac('0x56')));_0x267825[_0x9cac('0x7')](_0x9cac('0x57'),require(_0x9cac('0x58')));_0x267825['use']('/api/cm/hopper',require('./api/cmHopper'));_0x267825[_0x9cac('0x7')](_0x9cac('0x59'),require(_0x9cac('0x5a')));_0x267825[_0x9cac('0x7')](_0x9cac('0x5b'),require(_0x9cac('0x5c')));_0x267825[_0x9cac('0x7')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x267825['use'](_0x9cac('0x5d'),require(_0x9cac('0x5e')));_0x267825['use'](_0x9cac('0x5f'),require(_0x9cac('0x60')));_0x267825[_0x9cac('0x7')](_0x9cac('0x61'),require('./api/automation'));_0x267825[_0x9cac('0x7')]('/api/canned_answers',require('./api/cannedAnswer'));_0x267825[_0x9cac('0x7')]('/api/dispositions',require(_0x9cac('0x62')));_0x267825['use']('/api/conditions',require(_0x9cac('0x63')));_0x267825['use'](_0x9cac('0x64'),require(_0x9cac('0x65')));_0x267825['use'](_0x9cac('0x66'),require(_0x9cac('0x67')));_0x267825[_0x9cac('0x7')](_0x9cac('0x68'),require(_0x9cac('0x69')));_0x267825['use'](_0x9cac('0x6a'),require(_0x9cac('0x6b')));_0x267825[_0x9cac('0x7')](_0x9cac('0x6c'),require(_0x9cac('0x6d')));_0x267825[_0x9cac('0x7')](_0x9cac('0x6e'),require(_0x9cac('0x6f')));_0x267825[_0x9cac('0x7')](_0x9cac('0x70'),require(_0x9cac('0x71')));_0x267825[_0x9cac('0x7')](_0x9cac('0x72'),require('./api/contactItemType'));_0x267825[_0x9cac('0x7')](_0x9cac('0x73'),require(_0x9cac('0x74')));_0x267825[_0x9cac('0x7')](_0x9cac('0x75'),require(_0x9cac('0x76')));_0x267825['use']('/api/templates',require(_0x9cac('0x77')));_0x267825[_0x9cac('0x7')](_0x9cac('0x78'),require(_0x9cac('0x79')));_0x267825[_0x9cac('0x7')](_0x9cac('0x7a'),require(_0x9cac('0x7b')));_0x267825['use'](_0x9cac('0x7c'),require(_0x9cac('0x7d')));_0x267825['use'](_0x9cac('0x7e'),require('./api/integrationReport'));_0x267825[_0x9cac('0x7')](_0x9cac('0x7f'),require(_0x9cac('0x80')));_0x267825[_0x9cac('0x7')]('/api/analytics/default_reports',require(_0x9cac('0x81')));_0x267825['use']('/api/analytics/extracted_reports',require(_0x9cac('0x82')));_0x267825['use'](_0x9cac('0x83'),require(_0x9cac('0x84')));_0x267825[_0x9cac('0x7')](_0x9cac('0x85'),require(_0x9cac('0x86')));_0x267825['use']('/api/analytics/tree_reports',require(_0x9cac('0x87')));_0x267825[_0x9cac('0x7')](_0x9cac('0x88'),require(_0x9cac('0x89')));_0x267825[_0x9cac('0x7')](_0x9cac('0x8a'),require(_0x9cac('0x8b')));_0x267825['use'](_0x9cac('0x8c'),require(_0x9cac('0x8d')));_0x267825[_0x9cac('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x9cac('0x8e')));_0x267825[_0x9cac('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x9cac('0x8f')));_0x267825[_0x9cac('0x7')](_0x9cac('0x90'),require(_0x9cac('0x91')));_0x267825[_0x9cac('0x7')]('/api/integrations/desk/accounts',require(_0x9cac('0x92')));_0x267825[_0x9cac('0x7')]('/api/integrations/desk/configurations',require(_0x9cac('0x93')));_0x267825['use'](_0x9cac('0x94'),require(_0x9cac('0x95')));_0x267825[_0x9cac('0x7')](_0x9cac('0x96'),require(_0x9cac('0x97')));_0x267825[_0x9cac('0x7')](_0x9cac('0x98'),require('./api/intZohoConfiguration'));_0x267825[_0x9cac('0x7')]('/api/integrations/zoho/fields',require(_0x9cac('0x99')));_0x267825[_0x9cac('0x7')](_0x9cac('0x9a'),require(_0x9cac('0x9b')));_0x267825['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x267825[_0x9cac('0x7')]('/api/integrations/zendesk/fields',require(_0x9cac('0x9c')));_0x267825[_0x9cac('0x7')](_0x9cac('0x9d'),require('./api/intFreshdeskAccount'));_0x267825[_0x9cac('0x7')](_0x9cac('0x9e'),require('./api/intFreshdeskConfiguration'));_0x267825[_0x9cac('0x7')](_0x9cac('0x9f'),require(_0x9cac('0xa0')));_0x267825[_0x9cac('0x7')]('/api/integrations/vtiger/accounts',require(_0x9cac('0xa1')));_0x267825[_0x9cac('0x7')](_0x9cac('0xa2'),require('./api/intVtigerConfiguration'));_0x267825['use'](_0x9cac('0xa3'),require(_0x9cac('0xa4')));_0x267825['use'](_0x9cac('0xa5'),require(_0x9cac('0xa6')));_0x267825[_0x9cac('0x7')](_0x9cac('0xa7'),require(_0x9cac('0xa8')));_0x267825['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x267825[_0x9cac('0x7')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x267825[_0x9cac('0x7')](_0x9cac('0xa9'),require('./api/intDynamics365Configuration'));_0x267825[_0x9cac('0x7')](_0x9cac('0xaa'),require(_0x9cac('0xab')));_0x267825[_0x9cac('0x7')](_0x9cac('0xac'),require(_0x9cac('0xad')));_0x267825[_0x9cac('0x7')](_0x9cac('0xae'),require(_0x9cac('0xaf')));_0x267825[_0x9cac('0x7')](_0x9cac('0xb0'),require(_0x9cac('0xb1')));_0x267825['use'](_0x9cac('0xb2'),require(_0x9cac('0xb3')));_0x267825[_0x9cac('0x7')](_0x9cac('0xb4'),require(_0x9cac('0xb5')));_0x267825[_0x9cac('0x7')](_0x9cac('0xb6'),require(_0x9cac('0xb7')));_0x267825[_0x9cac('0x7')](_0x9cac('0xb8'),require('./api/jscriptyAnswerReport'));_0x267825[_0x9cac('0x7')]('/api/jscripty/questions/reports',require(_0x9cac('0xb9')));_0x267825[_0x9cac('0x7')](_0x9cac('0xba'),require(_0x9cac('0xbb')));_0x267825[_0x9cac('0x7')](_0x9cac('0xbc'),require(_0x9cac('0xbd')));_0x267825[_0x9cac('0x7')](_0x9cac('0xbe'),require(_0x9cac('0xbf')));_0x267825[_0x9cac('0x7')](_0x9cac('0xc0'),require(_0x9cac('0xc1')));_0x267825[_0x9cac('0x7')](_0x9cac('0xc2'),require(_0x9cac('0xc3')));_0x267825[_0x9cac('0x7')](_0x9cac('0xc4'),require('./api/setting'));_0x267825[_0x9cac('0x7')]('/api/square/odbc',require(_0x9cac('0xc5')));_0x267825[_0x9cac('0x7')](_0x9cac('0xc6'),require(_0x9cac('0xc7')));_0x267825[_0x9cac('0x7')]('/api/square/recordings',require('./api/squareRecording'));_0x267825['use'](_0x9cac('0xc8'),require(_0x9cac('0xc9')));_0x267825[_0x9cac('0x7')]('/api/teams',require('./api/team'));_0x267825[_0x9cac('0x7')]('/api/license',require(_0x9cac('0xca')));_0x267825['use'](_0x9cac('0xcb'),require(_0x9cac('0xcc')));_0x267825[_0x9cac('0x7')](_0x9cac('0xcd'),require(_0x9cac('0xce')));_0x267825[_0x9cac('0x7')](_0x9cac('0xcf'),require(_0x9cac('0xd0')));_0x267825[_0x9cac('0x7')](_0x9cac('0xd1'),require(_0x9cac('0xd2')));_0x267825[_0x9cac('0x7')]('/api/mail/reports/transfer',require(_0x9cac('0xd3')));_0x267825[_0x9cac('0x7')](_0x9cac('0xd4'),require(_0x9cac('0xd5')));_0x267825[_0x9cac('0x7')](_0x9cac('0xd6'),require('./api/faxTransferReport'));_0x267825[_0x9cac('0x7')]('/api/openchannel/reports/transfer',require(_0x9cac('0xd7')));_0x267825[_0x9cac('0x7')]('/api/sms/reports/transfer',require(_0x9cac('0xd8')));_0x267825['use'](_0x9cac('0xd9'),require(_0x9cac('0xda')));_0x267825['use']('/api/voice/prefixes',require(_0x9cac('0xdb')));_0x267825['use'](_0x9cac('0xdc'),require(_0x9cac('0xdd')));_0x267825[_0x9cac('0x7')](_0x9cac('0xde'),require('./api/userProfileSection'));_0x267825['use'](_0x9cac('0xdf'),require(_0x9cac('0xe0')));_0x267825[_0x9cac('0x7')](_0x9cac('0xe1'),require(_0x9cac('0xe2')));_0x267825[_0x9cac('0x7')](_0x9cac('0xe3'),require('./api/whatsappAccount'));_0x267825[_0x9cac('0x7')](_0x9cac('0xe4'),require(_0x9cac('0xe5')));_0x267825['use'](_0x9cac('0xe6'),require(_0x9cac('0xe7')));_0x267825[_0x9cac('0x7')](_0x9cac('0xe8'),require('./api/whatsappMessage'));_0x267825[_0x9cac('0x7')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x267825[_0x9cac('0x7')](_0x9cac('0xe9'),require(_0x9cac('0xea')));_0x267825['use'](_0x9cac('0xeb'),require('./api/whatsappQueue'));_0x267825[_0x9cac('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x267825[_0x9cac('0x7')](_0x9cac('0xec'),require('./api/realtime'));_0x267825[_0x9cac('0x7')](_0x9cac('0xed'),require('./api/user-setting'));_0x267825[_0x9cac('0x7')]('/api/mail_interaction_has_tags',require(_0x9cac('0xee')));_0x267825[_0x9cac('0x7')](_0x9cac('0xef'),require(_0x9cac('0xf0')));_0x267825[_0x9cac('0x7')](_0x9cac('0xf1'),require(_0x9cac('0xf2')));_0x267825[_0x9cac('0x7')](_0x9cac('0xf3'),require('./api/authActiveDirectory'));_0x267825[_0x9cac('0x7')](_0x9cac('0xf4'),require(_0x9cac('0xf5')));_0x267825[_0x9cac('0x7')](_0x9cac('0xf6'),require(_0x9cac('0xf7')));_0x267825['use'](_0x9cac('0xf8'),require(_0x9cac('0xf9')));_0x267825[_0x9cac('0x7')](_0x9cac('0xfa'),require('./api/system'));_0x267825[_0x9cac('0x7')](_0x9cac('0xfb'),require(_0x9cac('0xfc')));_0x267825[_0x9cac('0x7')](_0x9cac('0xfd'),require(_0x9cac('0xfe')));_0x267825['use'](_0x9cac('0xff'),clientSideLogs);_0x267825[_0x9cac('0x7')](_0x9cac('0x100'),express[_0x9cac('0x101')](path[_0x9cac('0x102')](config[_0x9cac('0x103')],_0x9cac('0x100'))));_0x267825['use'](_0x9cac('0x104'),express['static'](path[_0x9cac('0x102')](config[_0x9cac('0x103')],_0x9cac('0x104'))));_0x267825[_0x9cac('0x7')](_0x9cac('0x105'),express[_0x9cac('0x101')](path[_0x9cac('0x102')](config[_0x9cac('0x103')],'/demo')));_0x267825[_0x9cac('0x7')](_0x9cac('0x106'),express[_0x9cac('0x101')](path['join'](config[_0x9cac('0x103')],_0x9cac('0x107'),'3.9.0')));_0x267825[_0x9cac('0x7')]('/plugins',express[_0x9cac('0x101')](path['join'](config['root'],_0x9cac('0x108'))));_0x267825[_0x9cac('0x109')](_0x9cac('0x10a'))['get'](errors[0x194]);_0x267825[_0x9cac('0x109')]('/*')['get'](function(_0x368349,_0x50183){_0x50183[_0x9cac('0x10b')](path[_0x9cac('0x10c')](_0x267825['get']('appPath')+'/index.html'));});return _0x267825;});}; \ No newline at end of file +var _0xe64a=['/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/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/smsTransferReport','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','./api/userNotification','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','root','/www','static','/demo','join','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','./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/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue'];(function(_0x4a6049,_0x2f0311){var _0x387434=function(_0x52c034){while(--_0x52c034){_0x4a6049['push'](_0x4a6049['shift']());}};_0x387434(++_0x2f0311);}(_0xe64a,0x1e0));var _0xae64=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe64a[_0x19950b];return _0x3c6b41;};'use strict';var path=require(_0xae64('0x0'));var express=require(_0xae64('0x1'));var errors=require(_0xae64('0x2'));var config=require(_0xae64('0x3'));var setupLoggers=require(_0xae64('0x4'))[_0xae64('0x5')];var clientSideLogs=require(_0xae64('0x6'));exports[_0xae64('0x7')]=function(_0x5c8e95){return setupLoggers(_0x5c8e95)['then'](function(){_0x5c8e95['use']('/api/users',require(_0xae64('0x8')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xa'),require(_0xae64('0xb')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xc'),require(_0xae64('0xd')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xe'),require(_0xae64('0xf')));_0x5c8e95[_0xae64('0x9')]('/api/voice/mohs',require(_0xae64('0x10')));_0x5c8e95['use']('/api/voice/queues',require(_0xae64('0x11')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x12'),require(_0xae64('0x13')));_0x5c8e95['use'](_0xae64('0x14'),require('./api/screenRecording'));_0x5c8e95['use'](_0xae64('0x15'),require(_0xae64('0x16')));_0x5c8e95[_0xae64('0x9')]('/api/voice/mails/messages',require(_0xae64('0x17')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x18'),require(_0xae64('0x19')));_0x5c8e95[_0xae64('0x9')]('/api/voice/dials/reports',require(_0xae64('0x1a')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x1b'),require(_0xae64('0x1c')));_0x5c8e95[_0xae64('0x9')]('/api/voice/queues/reports',require(_0xae64('0x1d')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x1e'),require(_0xae64('0x1f')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x20'),require(_0xae64('0x21')));_0x5c8e95[_0xae64('0x9')]('/api/voice/transfers/reports',require(_0xae64('0x22')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x23'),require(_0xae64('0x24')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x25'),require('./api/mailAccount'));_0x5c8e95[_0xae64('0x9')]('/api/mail/queues',require(_0xae64('0x26')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x27'),require(_0xae64('0x28')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x29'),require(_0xae64('0x2a')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x2b'),require(_0xae64('0x2c')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x2d'),require(_0xae64('0x2e')));_0x5c8e95['use']('/api/mail/reports/queue',require(_0xae64('0x2f')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x30'),require(_0xae64('0x31')));_0x5c8e95[_0xae64('0x9')]('/api/dashboards/items',require('./api/dashboardItem'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x32'),require('./api/faxAccount'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x33'),require(_0xae64('0x34')));_0x5c8e95['use'](_0xae64('0x35'),require('./api/faxInteraction'));_0x5c8e95['use']('/api/fax/messages',require(_0xae64('0x36')));_0x5c8e95['use'](_0xae64('0x37'),require('./api/faxQueue'));_0x5c8e95['use']('/api/fax/reports/queue',require(_0xae64('0x38')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x39'),require(_0xae64('0x3a')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x3b'),require(_0xae64('0x3c')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x3d'),require('./api/smsInteraction'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x3e'),require(_0xae64('0x3f')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x40'),require(_0xae64('0x41')));_0x5c8e95['use'](_0xae64('0x42'),require('./api/openchannelAccount'));_0x5c8e95['use'](_0xae64('0x43'),require(_0xae64('0x44')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x45'),require(_0xae64('0x46')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x47'),require('./api/openchannelMessage'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x48'),require(_0xae64('0x49')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x4a'),require(_0xae64('0x4b')));_0x5c8e95['use'](_0xae64('0x4c'),require(_0xae64('0x4d')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x4e'),require('./api/chatApplication'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x4f'),require('./api/chatInteraction'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x50'),require('./api/chatMessage'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x51'),require(_0xae64('0x52')));_0x5c8e95[_0xae64('0x9')]('/api/chat/queues',require(_0xae64('0x53')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x54'),require(_0xae64('0x55')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x56'),require('./api/chatProactiveAction'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x57'),require(_0xae64('0x58')));_0x5c8e95['use'](_0xae64('0x59'),require(_0xae64('0x5a')));_0x5c8e95[_0xae64('0x9')]('/api/cm/hopper',require('./api/cmHopper'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x5b'),require('./api/cmHopperBlack'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x5c'),require(_0xae64('0x5d')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x5e'),require(_0xae64('0x5f')));_0x5c8e95['use'](_0xae64('0x60'),require(_0xae64('0x61')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x62'),require('./api/action'));_0x5c8e95[_0xae64('0x9')]('/api/automations',require('./api/automation'));_0x5c8e95['use'](_0xae64('0x63'),require(_0xae64('0x64')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x65'),require('./api/disposition'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x66'),require(_0xae64('0x67')));_0x5c8e95[_0xae64('0x9')]('/api/intervals',require(_0xae64('0x68')));_0x5c8e95[_0xae64('0x9')]('/api/pauses',require(_0xae64('0x69')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x6a'),require('./api/cdr'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x6b'),require(_0xae64('0x6c')));_0x5c8e95['use'](_0xae64('0x6d'),require(_0xae64('0x6e')));_0x5c8e95['use'](_0xae64('0x6f'),require(_0xae64('0x70')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x71'),require(_0xae64('0x72')));_0x5c8e95[_0xae64('0x9')]('/api/contact_item_types',require(_0xae64('0x73')));_0x5c8e95['use'](_0xae64('0x74'),require(_0xae64('0x75')));_0x5c8e95['use'](_0xae64('0x76'),require(_0xae64('0x77')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x78'),require(_0xae64('0x79')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x7a'),require(_0xae64('0x7b')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x7c'),require(_0xae64('0x7d')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x7e'),require('./api/integration'));_0x5c8e95['use'](_0xae64('0x7f'),require(_0xae64('0x80')));_0x5c8e95[_0xae64('0x9')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x81'),require(_0xae64('0x82')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x83'),require(_0xae64('0x84')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x85'),require(_0xae64('0x86')));_0x5c8e95[_0xae64('0x9')]('/api/analytics/field_reports',require(_0xae64('0x87')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x88'),require('./api/analyticTreeReport'));_0x5c8e95[_0xae64('0x9')]('/api/integrations/salesforce/accounts',require(_0xae64('0x89')));_0x5c8e95['use'](_0xae64('0x8a'),require('./api/intSalesforceConfiguration'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x8b'),require(_0xae64('0x8c')));_0x5c8e95['use'](_0xae64('0x8d'),require('./api/intSugarcrmAccount'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x8e'),require(_0xae64('0x8f')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x90'),require(_0xae64('0x91')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x92'),require('./api/intDeskAccount'));_0x5c8e95[_0xae64('0x9')]('/api/integrations/desk/configurations',require(_0xae64('0x93')));_0x5c8e95['use'](_0xae64('0x94'),require('./api/intDeskField'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x95'),require(_0xae64('0x96')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x97'),require('./api/intZohoConfiguration'));_0x5c8e95['use'](_0xae64('0x98'),require('./api/intZohoField'));_0x5c8e95['use'](_0xae64('0x99'),require(_0xae64('0x9a')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x9b'),require('./api/intZendeskConfiguration'));_0x5c8e95[_0xae64('0x9')](_0xae64('0x9c'),require(_0xae64('0x9d')));_0x5c8e95[_0xae64('0x9')]('/api/integrations/freshdesk/accounts',require(_0xae64('0x9e')));_0x5c8e95['use'](_0xae64('0x9f'),require(_0xae64('0xa0')));_0x5c8e95[_0xae64('0x9')]('/api/integrations/freshdesk/fields',require(_0xae64('0xa1')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xa2'),require(_0xae64('0xa3')));_0x5c8e95[_0xae64('0x9')]('/api/integrations/vtiger/configurations',require(_0xae64('0xa4')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xa5'),require('./api/intVtigerField'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xa6'),require(_0xae64('0xa7')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xa8'),require(_0xae64('0xa9')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xaa'),require(_0xae64('0xab')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xac'),require('./api/intDynamics365Account'));_0x5c8e95[_0xae64('0x9')]('/api/integrations/dynamics365/configurations',require(_0xae64('0xad')));_0x5c8e95['use'](_0xae64('0xae'),require(_0xae64('0xaf')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xb0'),require('./api/intFreshsalesAccount'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xb1'),require(_0xae64('0xb2')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xb3'),require(_0xae64('0xb4')));_0x5c8e95[_0xae64('0x9')]('/api/networks',require('./api/network'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xb5'),require(_0xae64('0xb6')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xb7'),require(_0xae64('0xb8')));_0x5c8e95[_0xae64('0x9')]('/api/jscripty/answers/reports',require(_0xae64('0xb9')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xba'),require(_0xae64('0xbb')));_0x5c8e95['use']('/api/jscripty/sessions/reports',require(_0xae64('0xbc')));_0x5c8e95[_0xae64('0x9')]('/api/sms/reports/queue',require(_0xae64('0xbd')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xbe'),require('./api/squareReport'));_0x5c8e95['use'](_0xae64('0xbf'),require('./api/squareReportDetail'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xc0'),require(_0xae64('0xc1')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xc2'),require(_0xae64('0xc3')));_0x5c8e95['use'](_0xae64('0xc4'),require(_0xae64('0xc5')));_0x5c8e95['use'](_0xae64('0xc6'),require('./api/squareProject'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xc7'),require(_0xae64('0xc8')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xc9'),require(_0xae64('0xca')));_0x5c8e95['use'](_0xae64('0xcb'),require(_0xae64('0xcc')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xcd'),require(_0xae64('0xce')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xcf'),require(_0xae64('0xd0')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xd1'),require('./api/migration'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xd2'),require(_0xae64('0xd3')));_0x5c8e95['use'](_0xae64('0xd4'),require(_0xae64('0xd5')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xd6'),require(_0xae64('0xd7')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xd8'),require(_0xae64('0xd9')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xda'),require(_0xae64('0xdb')));_0x5c8e95['use'](_0xae64('0xdc'),require(_0xae64('0xdd')));_0x5c8e95[_0xae64('0x9')]('/api/sms/reports/transfer',require(_0xae64('0xde')));_0x5c8e95[_0xae64('0x9')]('/api/cm/lists',require(_0xae64('0xdf')));_0x5c8e95['use']('/api/voice/prefixes',require(_0xae64('0xe0')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xe1'),require('./api/userProfile'));_0x5c8e95['use'](_0xae64('0xe2'),require(_0xae64('0xe3')));_0x5c8e95[_0xae64('0x9')]('/api/userProfile/resources',require(_0xae64('0xe4')));_0x5c8e95[_0xae64('0x9')]('/api/userNotifications',require(_0xae64('0xe5')));_0x5c8e95[_0xae64('0x9')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xe6'),require(_0xae64('0xe7')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xe8'),require(_0xae64('0xe9')));_0x5c8e95[_0xae64('0x9')]('/api/whatsapp/messages',require(_0xae64('0xea')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xeb'),require(_0xae64('0xec')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xed'),require(_0xae64('0xee')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xef'),require(_0xae64('0xf0')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xf1'),require('./api/cloudProvider'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xf2'),require('./api/realtime'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xf3'),require(_0xae64('0xf4')));_0x5c8e95['use'](_0xae64('0xf5'),require(_0xae64('0xf6')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xf7'),require(_0xae64('0xf8')));_0x5c8e95[_0xae64('0x9')](_0xae64('0xf9'),require('./api/authGoogle'));_0x5c8e95[_0xae64('0x9')](_0xae64('0xfa'),require(_0xae64('0xfb')));_0x5c8e95['use'](_0xae64('0xfc'),require(_0xae64('0xfd')));_0x5c8e95['use']('/api/rpc',require(_0xae64('0xfe')));_0x5c8e95['use'](_0xae64('0xff'),require(_0xae64('0x100')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x101'),require('./api/system'));_0x5c8e95[_0xae64('0x9')]('/api/pm2',require(_0xae64('0x102')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x103'),require(_0xae64('0x104')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x105'),clientSideLogs);_0x5c8e95[_0xae64('0x9')](_0xae64('0x106'),express['static'](path['join'](config[_0xae64('0x107')],'/apidoc')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x108'),express[_0xae64('0x109')](path['join'](config[_0xae64('0x107')],'/www')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x10a'),express[_0xae64('0x109')](path[_0xae64('0x10b')](config[_0xae64('0x107')],_0xae64('0x10a'))));_0x5c8e95[_0xae64('0x9')]('/snippet',express[_0xae64('0x109')](path[_0xae64('0x10b')](config['root'],'snippet','3.9.0')));_0x5c8e95[_0xae64('0x9')](_0xae64('0x10c'),express[_0xae64('0x109')](path[_0xae64('0x10b')](config[_0xae64('0x107')],_0xae64('0x10d'))));_0x5c8e95[_0xae64('0x10e')](_0xae64('0x10f'))[_0xae64('0x110')](errors[0x194]);_0x5c8e95[_0xae64('0x10e')]('/*')[_0xae64('0x110')](function(_0x22c59f,_0x3ae121){_0x3ae121[_0xae64('0x111')](path[_0xae64('0x112')](_0x5c8e95[_0xae64('0x110')](_0xae64('0x113'))+_0xae64('0x114')));});return _0x5c8e95;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d290ff6..58ec267 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf39e=['lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.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/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','listen','log','default','jayson/promise'];(function(_0x5e2d28,_0x17ee5e){var _0x5e20aa=function(_0x54515d){while(--_0x54515d){_0x5e2d28['push'](_0x5e2d28['shift']());}};_0x5e20aa(++_0x17ee5e);}(_0xf39e,0x18b));var _0xef39=function(_0x14b7c1,_0x431a34){_0x14b7c1=_0x14b7c1-0x0;var _0x21130f=_0xf39e[_0x14b7c1];return _0x21130f;};'use strict';var jayson=require(_0xef39('0x0'));var _=require(_0xef39('0x1'));var config=require(_0xef39('0x2'));exports['listen']=function(){return new Promise(function(_0x1b1365,_0x4e2984){var _0x258822={};_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/user/user.rpc'));_0x258822=_['merge'](_0x258822,require(_0xef39('0x4')));_0x258822=_['merge'](_0x258822,require(_0xef39('0x5')));_0x258822=_['merge'](_0x258822,require('../api/voiceRecording/voiceRecording.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x6')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x7')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x8')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x9')));_0x258822=_['merge'](_0x258822,require(_0xef39('0xa')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0xb')));_0x258822=_['merge'](_0x258822,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0xc')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/mailServerIn/mailServerIn.rpc'));_0x258822=_['merge'](_0x258822,require(_0xef39('0xd')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/mailQueue/mailQueue.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0xe')));_0x258822=_['merge'](_0x258822,require(_0xef39('0xf')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x10')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x11')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x12')));_0x258822=_['merge'](_0x258822,require(_0xef39('0x13')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/faxInteraction/faxInteraction.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/faxMessage/faxMessage.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x14')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x15')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/smsAccount/smsAccount.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/smsInteraction/smsInteraction.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x16')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x17')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x18')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x19')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x1a')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x1b')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/chatMessage/chatMessage.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x1c')));_0x258822=_['merge'](_0x258822,require(_0xef39('0x1d')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/cmHopper/cmHopper.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x1e')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x1f')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x20')));_0x258822=_['merge'](_0x258822,require(_0xef39('0x21')));_0x258822=_['merge'](_0x258822,require(_0xef39('0x22')));_0x258822=_['merge'](_0x258822,require('../api/pause/pause.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x23')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x24')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x25')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/trigger/trigger.rpc'));_0x258822=_['merge'](_0x258822,require('../api/variable/variable.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x26')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x27')));_0x258822=_['merge'](_0x258822,require(_0xef39('0x28')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x29')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x2a')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x2b')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x2c')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x2d')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x2e')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x2f')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x30')));_0x258822=_['merge'](_0x258822,require(_0xef39('0x31')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x32')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x33')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x34')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x35')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x36')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/plugin/plugin.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x37')));_0x258822=_[_0xef39('0x3')](_0x258822,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x38')));_0x258822=_[_0xef39('0x3')](_0x258822,require(_0xef39('0x39')));var _0x2e877b=jayson[_0xef39('0x3a')](_0x258822)[_0xef39('0x3b')]();var _0x7ae9a9=config[_0xef39('0x3c')][_0xef39('0x3d')]||config[_0xef39('0x3d')]+0x1;var _0x34172d=config['rpc']['ip']||'localhost';_0x2e877b['on'](_0xef39('0x3e'),function(_0xd97b14){return _0x4e2984(_0xd97b14);});_0x2e877b[_0xef39('0x3f')](_0x7ae9a9,_0x34172d,function(){console[_0xef39('0x40')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x34172d,_0x7ae9a9);require('../config/triggers')[_0xef39('0x41')]();return _0x1b1365('RPC\x20listening\x20on\x20'+_0x34172d+':'+_0x7ae9a9);});});}; \ No newline at end of file +var _0x6552=['../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.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/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc'];(function(_0x1e6d6c,_0x58878f){var _0x5e072d=function(_0x177c66){while(--_0x177c66){_0x1e6d6c['push'](_0x1e6d6c['shift']());}};_0x5e072d(++_0x58878f);}(_0x6552,0x1e3));var _0x2655=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x6552[_0x110c3d];return _0x226d67;};'use strict';var jayson=require('jayson/promise');var _=require(_0x2655('0x0'));var config=require(_0x2655('0x1'));exports[_0x2655('0x2')]=function(){return new Promise(function(_0x3344d8,_0x3ec979){var _0x5e6a51={};_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x4')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x5')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x6')));_0x5e6a51=_['merge'](_0x5e6a51,require('../api/voiceRecording/voiceRecording.rpc'));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x7')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x8')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x9')));_0x5e6a51=_['merge'](_0x5e6a51,require('../api/trunk/trunk.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0xa')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0xb')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0xc')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/mailQueue/mailQueue.rpc'));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0xd')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0xe')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0xf')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x10')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x11')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x12')));_0x5e6a51=_['merge'](_0x5e6a51,require('../api/faxMessage/faxMessage.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x13')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x14')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x15')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x16')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x17')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x18')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x19')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x1a')));_0x5e6a51=_['merge'](_0x5e6a51,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/chatInteraction/chatInteraction.rpc'));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x1b')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x1c')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x1d')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x1e')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x1f')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x20')));_0x5e6a51=_['merge'](_0x5e6a51,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x21')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x22')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x23')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/sound/sound.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x24')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x25')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x26')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x27')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x28')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x29')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x2a')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x2b')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x2c')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x2d')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x2e')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x2f')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x30')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x31')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x32')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x33')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x34')));_0x5e6a51=_['merge'](_0x5e6a51,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x35')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x36')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/squareProject/squareProject.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/squareRecording/squareRecording.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x37')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/campaign/campaign.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x38')));_0x5e6a51=_['merge'](_0x5e6a51,require('../api/plugin/plugin.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require(_0x2655('0x39')));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x3a')));_0x5e6a51=_[_0x2655('0x3')](_0x5e6a51,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5e6a51=_['merge'](_0x5e6a51,require(_0x2655('0x3b')));var _0x1846f2=jayson[_0x2655('0x3c')](_0x5e6a51)['http']();var _0x4a9d15=config[_0x2655('0x3d')][_0x2655('0x3e')]||config[_0x2655('0x3e')]+0x1;var _0x51b742=config[_0x2655('0x3d')]['ip']||_0x2655('0x3f');_0x1846f2['on']('error',function(_0x365030){return _0x3ec979(_0x365030);});_0x1846f2[_0x2655('0x2')](_0x4a9d15,_0x51b742,function(){console['log'](_0x2655('0x40'),_0x51b742,_0x4a9d15);require(_0x2655('0x41'))['default']();return _0x3344d8(_0x2655('0x42')+_0x51b742+':'+_0x4a9d15);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index f848a73..468f33b 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 _0x9b33=['line','toLowerCase','function','substring','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','sendRequest','command','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','setExtension','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','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready'];(function(_0x48f4e8,_0x2267ad){var _0x2e7c3e=function(_0x3d38e3){while(--_0x3d38e3){_0x48f4e8['push'](_0x48f4e8['shift']());}};_0x2e7c3e(++_0x2267ad);}(_0x9b33,0xdb));var _0x39b3=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x9b33[_0x47a349];return _0x18ab75;};'use strict';var util=require(_0x39b3('0x0'));var _=require(_0x39b3('0x1'));var EventEmitter=require('events')[_0x39b3('0x2')];var AGIReply=require(_0x39b3('0x3'));var AGIError=require(_0x39b3('0x4'));function AGIChannel(_0x314d79){var _0x549117=this,_0x5e68d8=new AGIReply(),_0x3dddb7=![],_0x2523c0={};EventEmitter[_0x39b3('0x5')](_0x549117);_0x314d79[_0x39b3('0x6')](_0x39b3('0x7'));_0x314d79[_0x39b3('0x8')](0x8*0x3c*0x3c*0x3e8);_0x5e68d8[_0x39b3('0x6')]('utf8');_0x5e68d8['on'](_0x39b3('0x9'),function(_0x1b85a2){for(var _0x280886 in _0x1b85a2){_0x549117[_0x280886]=_0x1b85a2[_0x280886];}_0x549117[_0x39b3('0xa')](_0x39b3('0xb'));});_0x5e68d8['on'](_0x39b3('0xc'),function(_0x1ac86a){if(_0x1ac86a[_0x39b3('0xd')]()=='hangup'){_0x549117['emit']('hangup');return;}if(_0x1ac86a['substring'](0x0,0xb)=='520-Invalid'){_0x3dddb7=!![];}if(_0x3dddb7){_0x2523c0['rx']+=_0x1ac86a+'\x0a';if(_0x1ac86a['search']('520\x20End\x20of\x20proper')!=-0x1){_0x3dddb7=![];}}else{_0x2523c0['rx']=_0x1ac86a;}if(_0x3dddb7){return;}if(typeof _0x2523c0['cb']==_0x39b3('0xe')){var _0x212caa=_0x2523c0['rx'][_0x39b3('0xf')](0x0,0x3),_0x196b8a=null,_0x3053cb=null;_0x212caa=parseInt(_0x212caa);if(isNaN(_0x212caa)){_0x2523c0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x39b3('0x10')});return;}if(_0x212caa!=0xc8){_0x2523c0['cb'](null,{'code':_0x212caa,'result':-0x1,'extra':'KO'});return;}_0x196b8a=_0x2523c0['rx'][_0x39b3('0xf')](0x4)['replace'](_0x39b3('0x11'),'');if(_0x196b8a[_0x39b3('0x12')]('\x20')!=-0x1){_0x196b8a=_0x196b8a[_0x39b3('0x13')](0x0,_0x196b8a[_0x39b3('0x12')]('\x20'));}if(_[_0x39b3('0x14')](_0x196b8a,'-1')){_0x196b8a=parseInt(_0x196b8a);}_0x3053cb=_0x2523c0['rx'][_0x39b3('0x15')]('\x20');if(_0x3053cb[_0x39b3('0x16')]==0x3){_0x3053cb=_0x3053cb[0x2][_0x39b3('0xf')](0x1,_0x3053cb[0x2]['length']-0x1);}else if(_0x3053cb['length']>0x3){var _0x2f0f70=/\((.+)\)/;var _0x4a587c=_0x2523c0['rx'][_0x39b3('0x17')](_0x2f0f70);if(_0x4a587c){_0x3053cb=_0x4a587c[0x1];}else{_0x3053cb=null;}}else{_0x3053cb=null;}_0x2523c0['cb'](null,{'code':_0x212caa,'result':_0x196b8a,'extra':_0x3053cb});}});_0x314d79['on']('error',function(_0x3e7d6b){_0x549117[_0x39b3('0xa')](_0x39b3('0x18'),new AGIError(_0x39b3('0x19'),_0x3e7d6b[_0x39b3('0x1a')]));});_0x314d79['on'](_0x39b3('0x1b'),function(){_0x549117[_0x39b3('0xa')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x314d79['on'](_0x39b3('0x1c'),function(){_0x549117[_0x39b3('0xa')](_0x39b3('0x1c'),new AGIError(_0x39b3('0x1d')));_0x314d79[_0x39b3('0x1e')]();});_0x314d79[_0x39b3('0x1f')](_0x5e68d8);this['command']=function(_0x3f45b2,_0xb085c){var _0x3f45b2=_0x3f45b2||'',_0xb085c=typeof _0xb085c==_0x39b3('0xe')?_0xb085c:new Function();_0x2523c0={'tx':_0x3f45b2,'rx':'','cb':_0xb085c};_0x314d79[_0x39b3('0x20')](_0x3f45b2+'\x0a');},this[_0x39b3('0x1b')]=function(){_0x314d79[_0x39b3('0x1e')]();};}util[_0x39b3('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x39b3('0x22')][_0x39b3('0x23')]=function(_0x199eae){return this[_0x39b3('0x24')]['sync'](this,_0x199eae);};AGIChannel[_0x39b3('0x22')][_0x39b3('0x25')]=function(){return this[_0x39b3('0x23')](_0x39b3('0x26'));};AGIChannel['prototype'][_0x39b3('0x27')]=function(_0x58cfe3,_0x486770,_0x1c4348){_0x58cfe3=_0x58cfe3===undefined?_0x39b3('0x28'):_0x58cfe3;_0x486770=_0x486770===undefined?'5':_0x486770;_0x1c4348=_0x1c4348===undefined?'1':_0x1c4348;return this['sendRequest'](util[_0x39b3('0x29')](_0x39b3('0x2a'),_0x58cfe3,_0x486770*0x3e8,_0x1c4348));};AGIChannel['prototype'][_0x39b3('0x2b')]=function(_0x3fd30){_0x3fd30=_0x3fd30||_0x39b3('0x2c');return this['sendRequest'](util[_0x39b3('0x29')](_0x39b3('0x2d'),_0x3fd30));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x2e')]=function(_0x150f2c,_0x539110){if(_[_0x39b3('0x2f')](_0x539110)){return this['sendRequest'](util[_0x39b3('0x29')]('EXEC\x20%s\x20%s',_0x150f2c,_0x539110[_0x39b3('0x30')](',')));}return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x150f2c,_0x539110));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x31')]=function(_0x57f57d){return this[_0x39b3('0x23')](util['format']('SET\x20CONTEXT\x20%s',_0x57f57d));};AGIChannel['prototype']['setExtension']=function(_0x1692c5){return this[_0x39b3('0x23')](util['format'](_0x39b3('0x32'),_0x1692c5));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x33')]=function(_0x3a296b){return this[_0x39b3('0x23')](util[_0x39b3('0x29')](_0x39b3('0x34'),_0x3a296b));};AGIChannel[_0x39b3('0x22')]['hangup']=function(){return this['sendRequest'](_0x39b3('0x35'));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x36')]=function(_0x15cd13,_0x4d2c91){var _0x197c00=_[_0x39b3('0x37')](_0x4d2c91)||_['isNumber'](_0x4d2c91)?_0x4d2c91['toString']():_0x4d2c91;return this[_0x39b3('0x23')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x15cd13,_0x197c00?_0x197c00[_0x39b3('0x38')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x39b3('0x39')]=function(_0x2fb59d,_0x4eec97){return this[_0x39b3('0x23')](util['format'](_0x39b3('0x3a'),_0x2fb59d,_0x4eec97));};AGIChannel[_0x39b3('0x22')]['sayDigits']=function(_0x1f0649,_0x19e159){return this[_0x39b3('0x23')](util['format'](_0x39b3('0x3b'),_0x1f0649,_0x19e159));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x3c')]=function(_0xa4ed6,_0x50b097){return this[_0x39b3('0x23')](util[_0x39b3('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xa4ed6,_0x50b097));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x3d')]=function(_0x5520e1,_0x104006,_0x28ebf9){_0x104006=_0x104006||this['extension'];_0x28ebf9=_0x28ebf9||0x1;this[_0x39b3('0x31')](_0x5520e1);this[_0x39b3('0x3e')](_0x104006);this[_0x39b3('0x33')](_0x28ebf9);return this[_0x39b3('0x2b')](util[_0x39b3('0x29')](_0x39b3('0x3f'),_0x5520e1,_0x104006,_0x28ebf9));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x40')]=function(_0x5bc77a){return this[_0x39b3('0x23')](util['format'](_0x39b3('0x41'),_0x5bc77a));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x42')]=function(_0x1f03e6,_0x2182eb,_0x47a144,_0x336674,_0x3a6966,_0x2d2c94){_0x2182eb=_0x2182eb||_0x39b3('0x43');_0x47a144=_0x47a144||'';_0x336674=_0x336674===undefined?-0x1:_0x336674==='-1'?-0x1:_0x336674*0x3e8;_0x3a6966=_0x3a6966===undefined?'':'s='+_0x3a6966;_0x2d2c94=_0x2d2c94?_0x39b3('0x44'):'';return this[_0x39b3('0x23')](util[_0x39b3('0x29')](_0x39b3('0x45'),_0x1f03e6,_0x2182eb,_0x47a144,_0x336674,_0x2d2c94,_0x3a6966));};AGIChannel[_0x39b3('0x22')]['streamFile']=function(_0x9c20d4,_0x5d772a){_0x5d772a=_0x5d772a||'';return this['sendRequest'](util[_0x39b3('0x29')](_0x39b3('0x46'),_0x9c20d4,_0x5d772a));};AGIChannel[_0x39b3('0x22')][_0x39b3('0x47')]=function(_0x10dd88){return this[_0x39b3('0x2e')](_0x39b3('0x48'),_0x10dd88);};AGIChannel[_0x39b3('0x22')][_0x39b3('0x49')]=function(_0x18acea){return this[_0x39b3('0x2e')]('WAIT',_0x18acea);};AGIChannel['prototype'][_0x39b3('0x18')]=function(_0x1a6f58,_0x5c0c0a){this[_0x39b3('0x2b')](util['format'](_0x39b3('0x4a'),_0x1a6f58['id'],_0x1a6f58[_0x39b3('0x4b')],_0x5c0c0a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x39b3('0x4c')]=AGIChannel; \ No newline at end of file +var _0xf771=['line','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','answer','ANSWER','beep','sendRequest','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','emit','ready'];(function(_0x341cf8,_0x1d29eb){var _0x23ec13=function(_0x154d7d){while(--_0x154d7d){_0x341cf8['push'](_0x341cf8['shift']());}};_0x23ec13(++_0x1d29eb);}(_0xf771,0x8e));var _0x1f77=function(_0x3a37cb,_0x4494a6){_0x3a37cb=_0x3a37cb-0x0;var _0x2a30f3=_0xf771[_0x3a37cb];return _0x2a30f3;};'use strict';var util=require(_0x1f77('0x0'));var _=require(_0x1f77('0x1'));var EventEmitter=require(_0x1f77('0x2'))[_0x1f77('0x3')];var AGIReply=require(_0x1f77('0x4'));var AGIError=require(_0x1f77('0x5'));function AGIChannel(_0x4f4bd9){var _0x459dc7=this,_0x26719f=new AGIReply(),_0x1b1265=![],_0x356d13={};EventEmitter[_0x1f77('0x6')](_0x459dc7);_0x4f4bd9[_0x1f77('0x7')](_0x1f77('0x8'));_0x4f4bd9['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x26719f[_0x1f77('0x7')](_0x1f77('0x8'));_0x26719f['on'](_0x1f77('0x9'),function(_0x4704ed){for(var _0x562bc9 in _0x4704ed){_0x459dc7[_0x562bc9]=_0x4704ed[_0x562bc9];}_0x459dc7[_0x1f77('0xa')](_0x1f77('0xb'));});_0x26719f['on'](_0x1f77('0xc'),function(_0x113226){if(_0x113226['toLowerCase']()==_0x1f77('0xd')){_0x459dc7[_0x1f77('0xa')](_0x1f77('0xd'));return;}if(_0x113226['substring'](0x0,0xb)==_0x1f77('0xe')){_0x1b1265=!![];}if(_0x1b1265){_0x356d13['rx']+=_0x113226+'\x0a';if(_0x113226[_0x1f77('0xf')](_0x1f77('0x10'))!=-0x1){_0x1b1265=![];}}else{_0x356d13['rx']=_0x113226;}if(_0x1b1265){return;}if(typeof _0x356d13['cb']==_0x1f77('0x11')){var _0x27d779=_0x356d13['rx'][_0x1f77('0x12')](0x0,0x3),_0x283093=null,_0x3ad570=null;_0x27d779=parseInt(_0x27d779);if(isNaN(_0x27d779)){_0x356d13['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1f77('0x13')});return;}if(_0x27d779!=0xc8){_0x356d13['cb'](null,{'code':_0x27d779,'result':-0x1,'extra':'KO'});return;}_0x283093=_0x356d13['rx'][_0x1f77('0x12')](0x4)[_0x1f77('0x14')](_0x1f77('0x15'),'');if(_0x283093[_0x1f77('0x16')]('\x20')!=-0x1){_0x283093=_0x283093[_0x1f77('0x17')](0x0,_0x283093[_0x1f77('0x16')]('\x20'));}if(_[_0x1f77('0x18')](_0x283093,'-1')){_0x283093=parseInt(_0x283093);}_0x3ad570=_0x356d13['rx'][_0x1f77('0x19')]('\x20');if(_0x3ad570['length']==0x3){_0x3ad570=_0x3ad570[0x2]['substring'](0x1,_0x3ad570[0x2]['length']-0x1);}else if(_0x3ad570['length']>0x3){var _0x17e901=/\((.+)\)/;var _0x297532=_0x356d13['rx'][_0x1f77('0x1a')](_0x17e901);if(_0x297532){_0x3ad570=_0x297532[0x1];}else{_0x3ad570=null;}}else{_0x3ad570=null;}_0x356d13['cb'](null,{'code':_0x27d779,'result':_0x283093,'extra':_0x3ad570});}});_0x4f4bd9['on']('error',function(_0x64000e){_0x459dc7['emit'](_0x1f77('0x1b'),new AGIError('E_AGI_SOCKET_ERROR',_0x64000e[_0x1f77('0x1c')]));});_0x4f4bd9['on']('close',function(){_0x459dc7['emit'](_0x1f77('0x1d'),new AGIError(_0x1f77('0x1e')));});_0x4f4bd9['on'](_0x1f77('0x1f'),function(){_0x459dc7[_0x1f77('0xa')]('timeout',new AGIError(_0x1f77('0x20')));_0x4f4bd9[_0x1f77('0x21')]();});_0x4f4bd9[_0x1f77('0x22')](_0x26719f);this['command']=function(_0x20274f,_0x5c2ff3){var _0x20274f=_0x20274f||'',_0x5c2ff3=typeof _0x5c2ff3==_0x1f77('0x11')?_0x5c2ff3:new Function();_0x356d13={'tx':_0x20274f,'rx':'','cb':_0x5c2ff3};_0x4f4bd9[_0x1f77('0x23')](_0x20274f+'\x0a');},this[_0x1f77('0x1d')]=function(){_0x4f4bd9['destroy']();};}util[_0x1f77('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x1f77('0x25')]['sendRequest']=function(_0x4e14ba){return this['command']['sync'](this,_0x4e14ba);};AGIChannel['prototype'][_0x1f77('0x26')]=function(){return this['sendRequest'](_0x1f77('0x27'));};AGIChannel[_0x1f77('0x25')]['getData']=function(_0x47ae21,_0x242c23,_0x5c4629){_0x47ae21=_0x47ae21===undefined?_0x1f77('0x28'):_0x47ae21;_0x242c23=_0x242c23===undefined?'5':_0x242c23;_0x5c4629=_0x5c4629===undefined?'1':_0x5c4629;return this[_0x1f77('0x29')](util['format'](_0x1f77('0x2a'),_0x47ae21,_0x242c23*0x3e8,_0x5c4629));};AGIChannel[_0x1f77('0x25')][_0x1f77('0x2b')]=function(_0x1cc123){_0x1cc123=_0x1cc123||_0x1f77('0x2c');return this[_0x1f77('0x29')](util[_0x1f77('0x2d')](_0x1f77('0x2e'),_0x1cc123));};AGIChannel[_0x1f77('0x25')]['exec']=function(_0x1b7787,_0x56951){if(_[_0x1f77('0x2f')](_0x56951)){return this[_0x1f77('0x29')](util[_0x1f77('0x2d')](_0x1f77('0x30'),_0x1b7787,_0x56951[_0x1f77('0x31')](',')));}return this[_0x1f77('0x29')](util['format']('EXEC\x20%s\x20%s',_0x1b7787,_0x56951));};AGIChannel[_0x1f77('0x25')][_0x1f77('0x32')]=function(_0x189ecf){return this[_0x1f77('0x29')](util[_0x1f77('0x2d')]('SET\x20CONTEXT\x20%s',_0x189ecf));};AGIChannel['prototype'][_0x1f77('0x33')]=function(_0x5dbefb){return this['sendRequest'](util['format'](_0x1f77('0x34'),_0x5dbefb));};AGIChannel['prototype'][_0x1f77('0x35')]=function(_0x2731b6){return this[_0x1f77('0x29')](util[_0x1f77('0x2d')]('SET\x20PRIORITY\x20%s',_0x2731b6));};AGIChannel[_0x1f77('0x25')]['hangup']=function(){return this['sendRequest'](_0x1f77('0x36'));};AGIChannel[_0x1f77('0x25')][_0x1f77('0x37')]=function(_0x14c376,_0x340aaf){var _0x5b60fb=_['isBoolean'](_0x340aaf)||_[_0x1f77('0x38')](_0x340aaf)?_0x340aaf['toString']():_0x340aaf;return this[_0x1f77('0x29')](util[_0x1f77('0x2d')](_0x1f77('0x39'),_0x14c376,_0x5b60fb?_0x5b60fb[_0x1f77('0x3a')]()[_0x1f77('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1f77('0x25')][_0x1f77('0x3b')]=function(_0x2ba6e2,_0x188a5e){return this[_0x1f77('0x29')](util[_0x1f77('0x2d')](_0x1f77('0x3c'),_0x2ba6e2,_0x188a5e));};AGIChannel[_0x1f77('0x25')][_0x1f77('0x3d')]=function(_0x3352e7,_0x330df9){return this[_0x1f77('0x29')](util[_0x1f77('0x2d')](_0x1f77('0x3e'),_0x3352e7,_0x330df9));};AGIChannel[_0x1f77('0x25')][_0x1f77('0x3f')]=function(_0x18da65,_0x4a9385){return this[_0x1f77('0x29')](util[_0x1f77('0x2d')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x18da65,_0x4a9385));};AGIChannel[_0x1f77('0x25')]['continueAt']=function(_0x38ee6f,_0x24ff61,_0xa34c18){_0x24ff61=_0x24ff61||this['extension'];_0xa34c18=_0xa34c18||0x1;this[_0x1f77('0x32')](_0x38ee6f);this[_0x1f77('0x33')](_0x24ff61);this[_0x1f77('0x35')](_0xa34c18);return this['noop'](util[_0x1f77('0x2d')]('GOTO\x20%s\x20%s\x20%s',_0x38ee6f,_0x24ff61,_0xa34c18));};AGIChannel['prototype'][_0x1f77('0x40')]=function(_0x2e71ee){return this[_0x1f77('0x29')](util[_0x1f77('0x2d')](_0x1f77('0x41'),_0x2e71ee));};AGIChannel[_0x1f77('0x25')]['recordFile']=function(_0x6f75c1,_0x60c9c4,_0x117bb4,_0x36c2fc,_0x543793,_0x4a8953){_0x60c9c4=_0x60c9c4||_0x1f77('0x42');_0x117bb4=_0x117bb4||'';_0x36c2fc=_0x36c2fc===undefined?-0x1:_0x36c2fc==='-1'?-0x1:_0x36c2fc*0x3e8;_0x543793=_0x543793===undefined?'':'s='+_0x543793;_0x4a8953=_0x4a8953?_0x1f77('0x43'):'';return this['sendRequest'](util[_0x1f77('0x2d')](_0x1f77('0x44'),_0x6f75c1,_0x60c9c4,_0x117bb4,_0x36c2fc,_0x4a8953,_0x543793));};AGIChannel['prototype'][_0x1f77('0x45')]=function(_0x4a85cc,_0x59d442){_0x59d442=_0x59d442||'';return this['sendRequest'](util[_0x1f77('0x2d')](_0x1f77('0x46'),_0x4a85cc,_0x59d442));};AGIChannel['prototype'][_0x1f77('0x47')]=function(_0x37e427){return this[_0x1f77('0x48')](_0x1f77('0x49'),_0x37e427);};AGIChannel[_0x1f77('0x25')][_0x1f77('0x4a')]=function(_0x37eef4){return this[_0x1f77('0x48')](_0x1f77('0x4b'),_0x37eef4);};AGIChannel['prototype']['error']=function(_0x502899,_0x1bdedc){this[_0x1f77('0x2b')](util[_0x1f77('0x2d')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x502899['id'],_0x502899[_0x1f77('0x4c')],_0x1bdedc));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index d092c56..d8c88ca 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 _0xdfd7=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message'];(function(_0x314223,_0x1b21da){var _0x2524b5=function(_0x4af26c){while(--_0x4af26c){_0x314223['push'](_0x314223['shift']());}};_0x2524b5(++_0x1b21da);}(_0xdfd7,0xb6));var _0x7dfd=function(_0x5deb03,_0x59e054){_0x5deb03=_0x5deb03-0x0;var _0x3399cc=_0xdfd7[_0x5deb03];return _0x3399cc;};'use strict';var util=require(_0x7dfd('0x0'));var error={'E_AGI_UNDEFINED':_0x7dfd('0x1'),'E_AGI_ARGUMENT_PORT':_0x7dfd('0x2'),'E_AGI_SERVER_ERROR':_0x7dfd('0x3'),'E_AGI_SERVER_CLOSE':_0x7dfd('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x7dfd('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x7dfd('0x6'),'E_AGI_SOCKET_ERROR':_0x7dfd('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x7dfd('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7dfd('0x9'),'E_AGI_IVR_ENTRY':_0x7dfd('0xa')};function AGIError(_0x35beed){var _0x35beed=_0x35beed||null,_0x30feb0=_0x30feb0||[],_0x1af9b8=0x1,_0x409269='';if(!error[_0x35beed]){_0x35beed=_0x7dfd('0xb');}_0x30feb0[_0x7dfd('0xc')](error[_0x35beed]);while(arguments[_0x1af9b8]){_0x30feb0['push'](arguments[_0x1af9b8]);_0x1af9b8++;}_0x409269=util[_0x7dfd('0xd')][_0x7dfd('0xe')](util,_0x30feb0);this[_0x7dfd('0xf')]=_0x409269;this[_0x7dfd('0x10')]=_0x35beed;}module[_0x7dfd('0x11')]=AGIError; \ No newline at end of file +var _0x0eea=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x0eea,0x9b));var _0xa0ee=function(_0x3ebfa0,_0x159fec){_0x3ebfa0=_0x3ebfa0-0x0;var _0x14086e=_0x0eea[_0x3ebfa0];return _0x14086e;};'use strict';var util=require(_0xa0ee('0x0'));var error={'E_AGI_UNDEFINED':_0xa0ee('0x1'),'E_AGI_ARGUMENT_PORT':_0xa0ee('0x2'),'E_AGI_SERVER_ERROR':_0xa0ee('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa0ee('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xa0ee('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa0ee('0x6'),'E_AGI_IVR_ENTRY':_0xa0ee('0x7')};function AGIError(_0xff2b74){var _0xff2b74=_0xff2b74||null,_0x47f6f9=_0x47f6f9||[],_0x5bf8a0=0x1,_0x58c197='';if(!error[_0xff2b74]){_0xff2b74=_0xa0ee('0x8');}_0x47f6f9[_0xa0ee('0x9')](error[_0xff2b74]);while(arguments[_0x5bf8a0]){_0x47f6f9[_0xa0ee('0x9')](arguments[_0x5bf8a0]);_0x5bf8a0++;}_0x58c197=util['format'][_0xa0ee('0xa')](util,_0x47f6f9);this[_0xa0ee('0xb')]=_0x58c197;this[_0xa0ee('0xc')]=_0xff2b74;}module[_0xa0ee('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 82fa63a..8094731 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 _0x382b=['./error','../../config/environment','defaults','redis','localhost','agi','emit','E_AGI_SERVER_ERROR','parse','error','exports','lodash','events','EventEmitter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x382b,0x6d));var _0xb382=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x382b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb382('0x0'));var EventEmitter=require(_0xb382('0x1'))[_0xb382('0x2')];var Redis=require('ioredis');var AGIError=require(_0xb382('0x3'));var config=require(_0xb382('0x4'));config['redis']=_[_0xb382('0x5')](config[_0xb382('0x6')],{'host':_0xb382('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb382('0x6')]);sub['subscribe'](_0xb382('0x8'),function(_0x4057f8){if(_0x4057f8)return eventEmitter[_0xb382('0x9')]('error',new AGIError(_0xb382('0xa'),_0x4057f8));});sub['on']('message',function(_0x1fad16,_0x2c514c){if(_0x1fad16!==_0xb382('0x8'))return;try{var _0x41cfa8=JSON[_0xb382('0xb')](_0x2c514c);eventEmitter['emit']('projectUpdate',_0x41cfa8);}catch(_0x3c2b77){eventEmitter[_0xb382('0x9')](_0xb382('0xc'),new AGIError(_0xb382('0xa'),_0x3c2b77));}});module[_0xb382('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xb712=['projectUpdate','events','EventEmitter','ioredis','./error','../../config/environment','defaults','redis','localhost','agi','emit','error','E_AGI_SERVER_ERROR','parse'];(function(_0x640457,_0x6b96d1){var _0x1725dc=function(_0x4cc4fa){while(--_0x4cc4fa){_0x640457['push'](_0x640457['shift']());}};_0x1725dc(++_0x6b96d1);}(_0xb712,0xa9));var _0x2b71=function(_0x6d4e69,_0x5337c4){_0x6d4e69=_0x6d4e69-0x0;var _0x433048=_0xb712[_0x6d4e69];return _0x433048;};'use strict';var _=require('lodash');var EventEmitter=require(_0x2b71('0x0'))[_0x2b71('0x1')];var Redis=require(_0x2b71('0x2'));var AGIError=require(_0x2b71('0x3'));var config=require(_0x2b71('0x4'));config['redis']=_[_0x2b71('0x5')](config[_0x2b71('0x6')],{'host':_0x2b71('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x2b71('0x6')]);sub['subscribe'](_0x2b71('0x8'),function(_0x487ccd){if(_0x487ccd)return eventEmitter[_0x2b71('0x9')](_0x2b71('0xa'),new AGIError(_0x2b71('0xb'),_0x487ccd));});sub['on']('message',function(_0x3e83db,_0x1e16cd){if(_0x3e83db!==_0x2b71('0x8'))return;try{var _0x4d96c6=JSON[_0x2b71('0xc')](_0x1e16cd);eventEmitter['emit'](_0x2b71('0xd'),_0x4d96c6);}catch(_0x2b9747){eventEmitter[_0x2b71('0x9')]('error',new AGIError(_0x2b71('0xb'),_0x2b9747));}});module['exports']={'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 63e9ee3..bd3127c 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 _0x94f8=['getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','condition','split','vswitch','default','target','invalid','agicommand','default\x20on\x20switch\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','numberOfEdges','addVertex','vertices','prototype','edges','push','size','relations'];(function(_0x3eef25,_0x482626){var _0x4f5334=function(_0xe482ff){while(--_0xe482ff){_0x3eef25['push'](_0x3eef25['shift']());}};_0x4f5334(++_0x482626);}(_0x94f8,0xef));var _0x894f=function(_0x1265fa,_0x1a1fed){_0x1265fa=_0x1265fa-0x0;var _0x1fe35e=_0x94f8[_0x1265fa];return _0x1fe35e;};'use strict';var _=require('lodash');var logger=require(_0x894f('0x0'))(_0x894f('0x1'));var verticesWithRetry=[_0x894f('0x2'),_0x894f('0x3'),_0x894f('0x4')];var Graph=function(){this['vertices']={};this['edges']={};this[_0x894f('0x5')]=0x0;};Graph['prototype'][_0x894f('0x6')]=function(_0x59f402){this[_0x894f('0x7')][_0x59f402['id']]=_0x59f402;this['edges'][_0x59f402['id']]=[];};Graph[_0x894f('0x8')]['addEdge']=function(_0xebf60c,_0x9e3d8b,_0x2f4e32){this[_0x894f('0x9')][_0xebf60c][_0x894f('0xa')]({'target':_0x9e3d8b,'condition':_0x2f4e32});this[_0x894f('0x5')]+=0x1;};Graph['prototype'][_0x894f('0xb')]=function(){return _[_0x894f('0xb')](this[_0x894f('0x7')]);};Graph[_0x894f('0x8')][_0x894f('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x894f('0x8')][_0x894f('0xd')]=function(_0x2d9d3f){return this[_0x894f('0x7')][_0x2d9d3f];};Graph[_0x894f('0x8')][_0x894f('0xe')]=function(_0x4d98a1,_0x12eabb){if(!this[_0x894f('0x7')][_0x4d98a1]){return logger[_0x894f('0xf')](_0x894f('0x10'));}var _0x412d41=_0x12eabb(this[_0x894f('0x7')][_0x4d98a1]);if(!_0x412d41){return logger[_0x894f('0xf')](_0x894f('0x11'));}if(this['edges'][_0x4d98a1]['length']===0x0){return logger[_0x894f('0xf')](_0x894f('0x12'));}for(var _0x3cf949=0x0,_0x4b64aa=[],_0x57fe18=![];_0x3cf949\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','catch','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','timeout','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','then','getAll','finally','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','projectUpdate','nextTick','error','stack','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0xa25ed,_0x3b4a96){var _0x170865=function(_0x5b8229){while(--_0x5b8229){_0xa25ed['push'](_0xa25ed['shift']());}};_0x170865(++_0x3b4a96);}(_0x0f98,0x115));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x80f9('0x0'));var syncho=require(_0x80f9('0x1'));var util=require(_0x80f9('0x2'));var config=require(_0x80f9('0x3'));var logger=require(_0x80f9('0x4'))(_0x80f9('0x5'));var utilLicense=require(_0x80f9('0x6'));var rpc=require(_0x80f9('0x7'));var Project=require(_0x80f9('0x8'));var AGIEmitter=require(_0x80f9('0x9'))['EventEmitter'];var projects=[];config[_0x80f9('0x5')]=_['defaults'](config[_0x80f9('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x80f9('0xa'),projectUpdateHandler);function connectionHandler(_0x41efab){process[_0x80f9('0xb')](function(){syncho(function(){try{setChannelVariables(_0x41efab);agiHandler(_0x41efab);}catch(_0x491c4c){logger[_0x80f9('0xc')](_0x491c4c[_0x80f9('0xd')]);}});});}function projectUpdateHandler(_0x1afdc8){try{var _0x5eddf5=_['findIndex'](projects,['id',_0x1afdc8['id']]);if(_0x5eddf5>-0x1){if(_0x1afdc8[_0x80f9('0xe')]===!![]){projects[_0x80f9('0xf')](_0x5eddf5,0x1);}else{projects[_0x5eddf5]=_0x1afdc8;}}else{projects[_0x80f9('0x10')](_0x1afdc8);}}catch(_0x10983d){logger[_0x80f9('0xc')](_0x10983d['stack']);}}function listeningHandler(){console[_0x80f9('0x11')](_0x80f9('0x12'),config['agi'][_0x80f9('0x13')]);logger[_0x80f9('0x14')](util[_0x80f9('0x15')](_0x80f9('0x16'),config['agi']['ip'],config[_0x80f9('0x5')][_0x80f9('0x13')]));}function errorHandler(_0x28a2dc){if(_0x28a2dc&&_0x28a2dc[_0x80f9('0x17')]&&_0x28a2dc['message']){logger[_0x80f9('0xc')](util[_0x80f9('0x15')](_0x80f9('0x18'),_0x28a2dc['name'],_0x28a2dc[_0x80f9('0x19')]));}else{logger[_0x80f9('0xc')](util['format'](_0x80f9('0x1a'),_0x28a2dc[_0x80f9('0xd')]));}}function closeHandler(){logger[_0x80f9('0x14')](util['format'](_0x80f9('0x1b'),this['arg_1'],this['calleridname'],this['callerid'],this[_0x80f9('0x1c')],this[_0x80f9('0x1d')]));try{createSquareReport(this);}catch(_0x63297f){logger[_0x80f9('0xc')](_0x63297f['stack']);}}function timeoutHandler(){logger[_0x80f9('0x14')](util[_0x80f9('0x15')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x80f9('0x1e')],this[_0x80f9('0x1f')],this[_0x80f9('0x1c')],this[_0x80f9('0x1d')]));}function hangupHandler(){logger[_0x80f9('0x14')](util[_0x80f9('0x15')](_0x80f9('0x20'),this['arg_1'],this[_0x80f9('0x1e')],this[_0x80f9('0x1f')],this[_0x80f9('0x1c')],this[_0x80f9('0x1d')]));this['evtHangup']=!![];}function createSquareReport(_0x201c6f,_0x5112c5){rpc[_0x80f9('0x21')](_0x201c6f)['then'](function(_0x1f6dff){if(_0x5112c5){_0x5112c5(null,_0x1f6dff);}})[_0x80f9('0x22')](function(_0x3e296b){if(_0x5112c5){_0x5112c5(null,_0x3e296b);}});}function setChannelVariables(_0x1777d8){for(var _0x3cc06a in _0x1777d8){if(_0x1777d8['hasOwnProperty'](_0x3cc06a)){if(_0x3cc06a[_0x80f9('0x23')](_0x80f9('0x24'))===0x0){_0x1777d8[_0x3cc06a[_0x80f9('0x25')](0x4)]=_0x1777d8[_0x3cc06a];delete _0x1777d8[_0x3cc06a];}}}}function agiHandler(_0x2dd9ab){logger[_0x80f9('0x26')](_0x80f9('0x27'),JSON[_0x80f9('0x28')](_0x2dd9ab,null,0x2));logger['info'](util[_0x80f9('0x15')](_0x80f9('0x29'),_0x2dd9ab[_0x80f9('0x2a')],_0x2dd9ab[_0x80f9('0x1e')],_0x2dd9ab[_0x80f9('0x1f')],_0x2dd9ab[_0x80f9('0x1c')],_0x2dd9ab[_0x80f9('0x1d')]));_0x2dd9ab['on']('error',errorHandler);_0x2dd9ab['on'](_0x80f9('0x2b'),closeHandler);_0x2dd9ab['on'](_0x80f9('0x2c'),timeoutHandler);_0x2dd9ab[_0x80f9('0x2d')]=![];_0x2dd9ab['on'](_0x80f9('0x2e'),hangupHandler);var _0x59d530=_[_0x80f9('0x2f')](projects,[_0x80f9('0x17'),_0x2dd9ab[_0x80f9('0x2a')]]);if(!_0x59d530)return Project[_0x80f9('0x30')](_0x2dd9ab);if(!_0x59d530[_0x80f9('0x31')])return Project[_0x80f9('0x32')](_0x2dd9ab);return Project[_0x80f9('0x33')](_0x59d530,_0x2dd9ab);}function main(){var _0x33893e;return utilLicense[_0x80f9('0x34')]()['then'](function(_0x2aad0f){if(!_0x2aad0f)return;if(_0x2aad0f[_0x80f9('0x35')]){if(_0x2aad0f['callysquare']&&_0x2aad0f[_0x80f9('0x36')]>0x0){logger[_0x80f9('0x14')](util['format'](_0x80f9('0x37'),_0x2aad0f[_0x80f9('0x36')]));_0x33893e=_0x2aad0f['callysquare'];}else{logger[_0x80f9('0x14')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x80f9('0x14')](_0x80f9('0x38'));_0x33893e=-0x1;}})[_0x80f9('0x39')](function(){return Project[_0x80f9('0x3a')]();})[_0x80f9('0x39')](function(_0x506fcb){projects=_0x506fcb;return;})['catch'](function(_0x3dabc0){logger[_0x80f9('0xc')]('[LICENSE]',_0x3dabc0['stack']);})[_0x80f9('0x3b')](function(){var _0x3b71ba=require('./server')(config[_0x80f9('0x5')][_0x80f9('0x13')],config[_0x80f9('0x5')]['ip'],_0x33893e);_0x3b71ba['on'](_0x80f9('0xc'),errorHandler);_0x3b71ba['on']('listening',listeningHandler);_0x3b71ba['on'](_0x80f9('0x3c'),connectionHandler);_0x3b71ba['on'](_0x80f9('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0xd4cb=['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','production','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','[LICENSE]','./server','listening','lodash','syncho','util','../../config/logger','../../config/license/util','./project','./events','EventEmitter','agi','defaults','nextTick','error','stack','deleted','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','debug'];(function(_0x3a4200,_0x2b2eef){var _0x2a3713=function(_0x1800f0){while(--_0x1800f0){_0x3a4200['push'](_0x3a4200['shift']());}};_0x2a3713(++_0x2b2eef);}(_0xd4cb,0x130));var _0xbd4c=function(_0x1e2aa5,_0x271cd4){_0x1e2aa5=_0x1e2aa5-0x0;var _0xdf8c10=_0xd4cb[_0x1e2aa5];return _0xdf8c10;};'use strict';var _=require(_0xbd4c('0x0'));var syncho=require(_0xbd4c('0x1'));var util=require(_0xbd4c('0x2'));var config=require('../../config/environment');var logger=require(_0xbd4c('0x3'))('agi');var utilLicense=require(_0xbd4c('0x4'));var rpc=require('./rpc');var Project=require(_0xbd4c('0x5'));var AGIEmitter=require(_0xbd4c('0x6'))[_0xbd4c('0x7')];var projects=[];config[_0xbd4c('0x8')]=_[_0xbd4c('0x9')](config[_0xbd4c('0x8')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x197107){process[_0xbd4c('0xa')](function(){syncho(function(){try{setChannelVariables(_0x197107);agiHandler(_0x197107);}catch(_0x114fb5){logger[_0xbd4c('0xb')](_0x114fb5[_0xbd4c('0xc')]);}});});}function projectUpdateHandler(_0x26f88a){try{var _0x28d7d2=_['findIndex'](projects,['id',_0x26f88a['id']]);if(_0x28d7d2>-0x1){if(_0x26f88a[_0xbd4c('0xd')]===!![]){projects['splice'](_0x28d7d2,0x1);}else{projects[_0x28d7d2]=_0x26f88a;}}else{projects[_0xbd4c('0xe')](_0x26f88a);}}catch(_0x2033f0){logger[_0xbd4c('0xb')](_0x2033f0[_0xbd4c('0xc')]);}}function listeningHandler(){console[_0xbd4c('0xf')](_0xbd4c('0x10'),config[_0xbd4c('0x8')][_0xbd4c('0x11')]);logger[_0xbd4c('0x12')](util[_0xbd4c('0x13')](_0xbd4c('0x14'),config[_0xbd4c('0x8')]['ip'],config[_0xbd4c('0x8')]['port']));}function errorHandler(_0x5c1baa){if(_0x5c1baa&&_0x5c1baa[_0xbd4c('0x15')]&&_0x5c1baa[_0xbd4c('0x16')]){logger[_0xbd4c('0xb')](util[_0xbd4c('0x13')](_0xbd4c('0x17'),_0x5c1baa[_0xbd4c('0x15')],_0x5c1baa[_0xbd4c('0x16')]));}else{logger['error'](util[_0xbd4c('0x13')]('[ERROR]\x20%s',_0x5c1baa['stack']));}}function closeHandler(){logger[_0xbd4c('0x12')](util['format'](_0xbd4c('0x18'),this[_0xbd4c('0x19')],this[_0xbd4c('0x1a')],this[_0xbd4c('0x1b')],this[_0xbd4c('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x693bd){logger['error'](_0x693bd['stack']);}}function timeoutHandler(){logger[_0xbd4c('0x12')](util['format'](_0xbd4c('0x1d'),this[_0xbd4c('0x19')],this[_0xbd4c('0x1a')],this[_0xbd4c('0x1b')],this[_0xbd4c('0x1c')],this[_0xbd4c('0x1e')]));}function hangupHandler(){logger['info'](util[_0xbd4c('0x13')](_0xbd4c('0x1f'),this[_0xbd4c('0x19')],this[_0xbd4c('0x1a')],this[_0xbd4c('0x1b')],this[_0xbd4c('0x1c')],this[_0xbd4c('0x1e')]));this[_0xbd4c('0x20')]=!![];}function createSquareReport(_0x4240a,_0x2aa8c3){rpc[_0xbd4c('0x21')](_0x4240a)[_0xbd4c('0x22')](function(_0x493a18){if(_0x2aa8c3){_0x2aa8c3(null,_0x493a18);}})['catch'](function(_0x2498d7){if(_0x2aa8c3){_0x2aa8c3(null,_0x2498d7);}});}function setChannelVariables(_0x16f10d){for(var _0xc06d38 in _0x16f10d){if(_0x16f10d[_0xbd4c('0x23')](_0xc06d38)){if(_0xc06d38[_0xbd4c('0x24')]('agi_')===0x0){_0x16f10d[_0xc06d38['substring'](0x4)]=_0x16f10d[_0xc06d38];delete _0x16f10d[_0xc06d38];}}}}function agiHandler(_0x2210e3){logger[_0xbd4c('0x25')](_0xbd4c('0x26'),JSON[_0xbd4c('0x27')](_0x2210e3,null,0x2));logger[_0xbd4c('0x12')](util['format'](_0xbd4c('0x28'),_0x2210e3['arg_1'],_0x2210e3[_0xbd4c('0x1a')],_0x2210e3[_0xbd4c('0x1b')],_0x2210e3[_0xbd4c('0x1c')],_0x2210e3['uniqueid']));_0x2210e3['on'](_0xbd4c('0xb'),errorHandler);_0x2210e3['on'](_0xbd4c('0x29'),closeHandler);_0x2210e3['on'](_0xbd4c('0x2a'),timeoutHandler);_0x2210e3[_0xbd4c('0x20')]=![];_0x2210e3['on'](_0xbd4c('0x2b'),hangupHandler);var _0x405333=_[_0xbd4c('0x2c')](projects,['name',_0x2210e3[_0xbd4c('0x19')]]);if(!_0x405333)return Project[_0xbd4c('0x2d')](_0x2210e3);if(!_0x405333[_0xbd4c('0x2e')])return Project['handleUnpublished'](_0x2210e3);return Project[_0xbd4c('0x2f')](_0x405333,_0x2210e3);}function main(){var _0x2022cd;return utilLicense[_0xbd4c('0x30')]()['then'](function(_0x3596bf){if(!_0x3596bf)return;if(_0x3596bf['voice']){if(_0x3596bf[_0xbd4c('0x31')]&&_0x3596bf[_0xbd4c('0x31')]>0x0){logger[_0xbd4c('0x12')](util[_0xbd4c('0x13')](_0xbd4c('0x32'),_0x3596bf[_0xbd4c('0x31')]));_0x2022cd=_0x3596bf[_0xbd4c('0x31')];}else{logger[_0xbd4c('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xbd4c('0x12')](_0xbd4c('0x33'));_0x2022cd=-0x1;}})['then'](function(){return Project[_0xbd4c('0x34')]();})[_0xbd4c('0x22')](function(_0x6904b0){projects=_0x6904b0;return;})[_0xbd4c('0x35')](function(_0x5545ab){logger[_0xbd4c('0xb')](_0xbd4c('0x36'),_0x5545ab['stack']);})['finally'](function(){var _0x142b93=require(_0xbd4c('0x37'))(config[_0xbd4c('0x8')][_0xbd4c('0x11')],config[_0xbd4c('0x8')]['ip'],_0x2022cd);_0x142b93['on'](_0xbd4c('0xb'),errorHandler);_0x142b93['on'](_0xbd4c('0x38'),listeningHandler);_0x142b93['on']('connection',connectionHandler);_0x142b93['on'](_0xbd4c('0x29'),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 24fc5d7..d52312a 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 _0x1f56=['message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1f56,0x16c));var _0x61f5=function(_0x8a25fa,_0x100c74){_0x8a25fa=_0x8a25fa-0x0;var _0x3082cb=_0x1f56[_0x8a25fa];return _0x3082cb;};'use strict';var BPromise=require(_0x61f5('0x0'));var jayson=require(_0x61f5('0x1'));var client=jayson[_0x61f5('0x2')][_0x61f5('0x3')]({'port':0x232b});function request(_0x550863,_0x56f864){return new BPromise(function(_0x38db74,_0xcd2e34){return client['request'](_0x550863,_0x56f864)[_0x61f5('0x4')](function(_0x565b22){if(_0x565b22[_0x61f5('0x5')]){return _0xcd2e34(_0x565b22[_0x61f5('0x5')][_0x61f5('0x6')]);}else{return _0x38db74(_0x565b22[_0x61f5('0x7')]);}})['catch'](function(_0x430ddd){return _0xcd2e34(_0x430ddd);});});}exports[_0x61f5('0x8')]=function(_0x5b13b6,_0x54e42b){return request(_0x61f5('0x9'),{'account':_0x5b13b6,'message':_0x54e42b});}; \ No newline at end of file +var _0xb0c0=['then','error','message','result','catch','sendMailMessage','jayson/promise','http','request'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xb0c0,0x192));var _0x0b0c=function(_0x1590c5,_0x369984){_0x1590c5=_0x1590c5-0x0;var _0x3c3afb=_0xb0c0[_0x1590c5];return _0x3c3afb;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x0b0c('0x0'));var client=jayson['client'][_0x0b0c('0x1')]({'port':0x232b});function request(_0x198669,_0x276b31){return new BPromise(function(_0x478c82,_0x40d504){return client[_0x0b0c('0x2')](_0x198669,_0x276b31)[_0x0b0c('0x3')](function(_0x227f49){if(_0x227f49[_0x0b0c('0x4')]){return _0x40d504(_0x227f49[_0x0b0c('0x4')][_0x0b0c('0x5')]);}else{return _0x478c82(_0x227f49[_0x0b0c('0x6')]);}})[_0x0b0c('0x7')](function(_0x1bee8a){return _0x40d504(_0x1bee8a);});});}exports[_0x0b0c('0x8')]=function(_0x1679aa,_0xb64431){return request('SendMail',{'account':_0x1679aa,'message':_0xb64431});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 29c8d65..7e93b20 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 _0xc28c=['Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','start','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','debug','gotoc','context','extension','priority','response','evtHangup','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','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','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','agi','./rpc','./mailRpc','./graph','getSquareProjects','error'];(function(_0x2f309b,_0x55d989){var _0x1ebf27=function(_0x1b569d){while(--_0x1b569d){_0x2f309b['push'](_0x2f309b['shift']());}};_0x1ebf27(++_0x55d989);}(_0xc28c,0x14f));var _0xcc28=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0xc28c[_0x1e6b59];return _0x40d7c5;};'use strict';var _=require(_0xcc28('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require('util');var logger=require('../../config/logger')(_0xcc28('0x1'));var rpc=require(_0xcc28('0x2'));var mailRpc=require(_0xcc28('0x3'));var Graph=require(_0xcc28('0x4'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xcc28('0x5')]()['catch'](function(_0x55963a){logger[_0xcc28('0x6')](_0xcc28('0x7'),_0x55963a['stack']);return[];});}function addVertex(_0x37c742,_0x3a1e1d,_0x35a868){_0x3a1e1d[_0xcc28('0x8')]=_0x35a868;if(_0x3a1e1d['hasOwnProperty'](_0xcc28('0x9'))){_0x3a1e1d['maxRetry']=parseInt(_0x3a1e1d['retry'],0xa);}_0x37c742[_0xcc28('0xa')](_[_0xcc28('0xb')](_0x3a1e1d,_0xcc28('0xc')));}function initGraph(_0x466f90,_0x576dcc){var _0x26c1ab=new Graph();for(var _0x2e9212 in _0x466f90){if(_0x466f90[_0xcc28('0xd')](_0x2e9212)){if(_[_0xcc28('0xe')](_0x466f90[_0x2e9212])){for(var _0x23a99b=0x0;_0x23a99b<_0x466f90[_0x2e9212]['length'];_0x23a99b+=0x1){addVertex(_0x26c1ab,_0x466f90[_0x2e9212][_0x23a99b],_0x2e9212);}}else{addVertex(_0x26c1ab,_0x466f90[_0x2e9212],_0x2e9212);}}}for(var _0x20070c=0x0;_0x20070c<_0x576dcc['length'];_0x20070c+=0x1){if(_0x576dcc[_0x20070c][_0xcc28('0xf')]&&_0x576dcc[_0x20070c][_0xcc28('0x10')]){_0x26c1ab[_0xcc28('0x11')](_0x576dcc[_0x20070c][_0xcc28('0xf')],_0x576dcc[_0x20070c][_0xcc28('0x10')],_0x576dcc[_0x20070c][_0xcc28('0x12')]);}}return _0x26c1ab;}function getRoot(_0x3a7373){return parser[_0xcc28('0x13')](_0x3a7373,{'object':!![]})[_0xcc28('0x14')][_0xcc28('0x15')];}function inspect(_0x43fd27){return util[_0xcc28('0x16')](_0x43fd27,{'showHidden':![],'depth':null});}function initialize(_0x5a6290,_0x39832b){var _0x4b773b=getRoot(_0x5a6290['production']);if(!_0x4b773b||!_0x4b773b[_0xcc28('0x17')])return;var _0x398f81,_0x2493e7,_0x33d36b;logger['debug']('root',JSON[_0xcc28('0x18')](_0x4b773b,null,0x2));_0x39832b[_0xcc28('0x19')]=moment()[_0xcc28('0x1a')](_0xcc28('0x1b'));_0x398f81=initGraph(_[_0xcc28('0xb')](_0x4b773b,_0xcc28('0xc')),_0x4b773b[_0xcc28('0xc')]);_0x2493e7=new Vertices(_0x39832b,rpc,mailRpc);logger[_0xcc28('0x1c')](util[_0xcc28('0x1a')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x39832b[_0xcc28('0x1d')],_0x39832b[_0xcc28('0x1e')],_0x39832b[_0xcc28('0x1f')],_0x39832b[_0xcc28('0x20')],_0x39832b[_0xcc28('0x21')]));_0x398f81[_0xcc28('0x22')](_0x4b773b[_0xcc28('0x17')]['id'],function(_0x3dadd1){try{_0x3dadd1=_0x2493e7[_0xcc28('0x23')](_0x3dadd1);logger[_0xcc28('0x24')]('vertex',JSON[_0xcc28('0x18')](_0x3dadd1,null,0x2));if(_0x3dadd1[_0xcc28('0x8')]===_0xcc28('0x25')){logger[_0xcc28('0x1c')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x39832b['context']=_0x3dadd1[_0xcc28('0x26')]||_0x39832b[_0xcc28('0x26')];_0x39832b[_0xcc28('0x27')]=_0x3dadd1[_0xcc28('0x27')];_0x39832b[_0xcc28('0x28')]=_0x3dadd1[_0xcc28('0x28')]?_0x3dadd1[_0xcc28('0x28')]-0x1:0x1;return null;}else if(_0x3dadd1&&_0x2493e7[_0x3dadd1[_0xcc28('0x8')]]){_0x33d36b=_0x2493e7[_0x3dadd1['agicommand']](_0x3dadd1);logger[_0xcc28('0x1c')](_0xcc28('0x29'),JSON[_0xcc28('0x18')](_0x33d36b,null,0x2));if(_0x33d36b&&_0x33d36b['code']===AGI_CODE_SUCCESS&&_0x33d36b['result']!==AGI_RESULT_ERROR&&!_0x39832b[_0xcc28('0x2a')]){logger['debug'](_0xcc28('0x29'),inspect(_0x33d36b));return _['isUndefined'](_0x33d36b[_0xcc28('0x2b')])?null:_0x33d36b[_0xcc28('0x2b')][_0xcc28('0x2c')]();}else{logger[_0xcc28('0x6')]('response',inspect(_0x33d36b));return null;}}else{logger[_0xcc28('0x6')](_0xcc28('0x2d'));return null;}}catch(_0x53e297){logger[_0xcc28('0x6')](_0x53e297[_0xcc28('0x2e')]);return null;}});if(_0x4b773b[_0xcc28('0x2f')]){logger[_0xcc28('0x1c')](util[_0xcc28('0x1a')](_0xcc28('0x30'),_0x39832b['arg_1'],_0x39832b[_0xcc28('0x1e')],_0x39832b['callerid'],_0x39832b[_0xcc28('0x20')],_0x39832b[_0xcc28('0x21')]));_0x398f81[_0xcc28('0x22')](_0x4b773b[_0xcc28('0x2f')]['id'],function(_0xab7008){try{_0xab7008=_0x2493e7['clear'](_0xab7008);logger[_0xcc28('0x24')](_0xcc28('0x31'),JSON[_0xcc28('0x18')](_0xab7008,null,0x2));if(_0xab7008&&_0x2493e7[_0xab7008[_0xcc28('0x8')]]){_0x33d36b=_0x2493e7[_0xab7008[_0xcc28('0x8')]](_0xab7008);if(_0x33d36b){logger[_0xcc28('0x24')](_0xcc28('0x29'),inspect(_0x33d36b));return _['isUndefined'](_0x33d36b['result'])?null:_0x33d36b[_0xcc28('0x2b')][_0xcc28('0x2c')]();}else{logger[_0xcc28('0x6')](_0xcc28('0x29'),inspect(_0x33d36b));return null;}}else{logger[_0xcc28('0x6')](_0xcc28('0x2d'));return null;}}catch(_0x43e440){logger[_0xcc28('0x6')](_0x43e440['stack']);return null;}});}logger['info'](util[_0xcc28('0x1a')](_0xcc28('0x32'),_0x39832b['arg_1'],_0x39832b[_0xcc28('0x1e')],_0x39832b[_0xcc28('0x1f')],_0x39832b[_0xcc28('0x20')],_0x39832b['uniqueid']));logger[_0xcc28('0x1c')](util['format'](_0xcc28('0x33'),_0x39832b[_0xcc28('0x26')],_0x39832b[_0xcc28('0x27')],parseInt(_0x39832b[_0xcc28('0x28')],0xa)+0x1));_0x39832b['continueAt'](_0x39832b[_0xcc28('0x26')],_0x39832b['extension'],parseInt(_0x39832b[_0xcc28('0x28')],0xa)+0x1);_0x39832b[_0xcc28('0x34')]();}function handleNotFound(_0x2a7e4c){logger[_0xcc28('0x6')](util[_0xcc28('0x1a')](_0xcc28('0x35'),_0x2a7e4c[_0xcc28('0x1d')]));_0x2a7e4c[_0xcc28('0x36')](_0x2a7e4c[_0xcc28('0x26')],_0x2a7e4c[_0xcc28('0x27')],parseInt(_0x2a7e4c[_0xcc28('0x28')],0xa)+0x1);_0x2a7e4c['close']();}function handleUnpublished(_0xab0d5c){logger['error'](util['format'](_0xcc28('0x37'),_0xab0d5c[_0xcc28('0x1d')]));_0xab0d5c[_0xcc28('0x36')](_0xab0d5c[_0xcc28('0x26')],_0xab0d5c['extension'],parseInt(_0xab0d5c[_0xcc28('0x28')],0xa)+0x1);_0xab0d5c[_0xcc28('0x34')]();}module[_0xcc28('0x38')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x3d85=['calleridname','callerid','dnid','traverseBFS','start','clear','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','finally','isUndefined','toString','continueAt','close','Project\x20%s\x20not\x20found','exports','lodash','xml2json','../../config/logger','./rpc','./mailRpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','inspect','production','debug','root','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x3d85,0x156));var _0x53d8=function(_0x227802,_0x10dd09){_0x227802=_0x227802-0x0;var _0x2d0b53=_0x3d85[_0x227802];return _0x2d0b53;};'use strict';var _=require(_0x53d8('0x0'));var moment=require('moment');var parser=require(_0x53d8('0x1'));var util=require('util');var logger=require(_0x53d8('0x2'))('agi');var rpc=require(_0x53d8('0x3'));var mailRpc=require(_0x53d8('0x4'));var Graph=require(_0x53d8('0x5'));var Vertices=require(_0x53d8('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x53d8('0x7')](function(_0x378ef6){logger[_0x53d8('0x8')](_0x53d8('0x9'),_0x378ef6[_0x53d8('0xa')]);return[];});}function addVertex(_0x353fe9,_0x3227ff,_0x26dd9d){_0x3227ff[_0x53d8('0xb')]=_0x26dd9d;if(_0x3227ff[_0x53d8('0xc')](_0x53d8('0xd'))){_0x3227ff[_0x53d8('0xe')]=parseInt(_0x3227ff[_0x53d8('0xd')],0xa);}_0x353fe9[_0x53d8('0xf')](_[_0x53d8('0x10')](_0x3227ff,_0x53d8('0x11')));}function initGraph(_0x4db707,_0x2e776a){var _0x21cb89=new Graph();for(var _0x2290d7 in _0x4db707){if(_0x4db707[_0x53d8('0xc')](_0x2290d7)){if(_[_0x53d8('0x12')](_0x4db707[_0x2290d7])){for(var _0x2655a1=0x0;_0x2655a1<_0x4db707[_0x2290d7]['length'];_0x2655a1+=0x1){addVertex(_0x21cb89,_0x4db707[_0x2290d7][_0x2655a1],_0x2290d7);}}else{addVertex(_0x21cb89,_0x4db707[_0x2290d7],_0x2290d7);}}}for(var _0x3e8898=0x0;_0x3e8898<_0x2e776a[_0x53d8('0x13')];_0x3e8898+=0x1){if(_0x2e776a[_0x3e8898][_0x53d8('0x14')]&&_0x2e776a[_0x3e8898][_0x53d8('0x15')]){_0x21cb89[_0x53d8('0x16')](_0x2e776a[_0x3e8898]['source'],_0x2e776a[_0x3e8898][_0x53d8('0x15')],_0x2e776a[_0x3e8898][_0x53d8('0x17')]);}}return _0x21cb89;}function getRoot(_0x5d5aa4){return parser[_0x53d8('0x18')](_0x5d5aa4,{'object':!![]})[_0x53d8('0x19')]['root'];}function inspect(_0x3cc268){return util[_0x53d8('0x1a')](_0x3cc268,{'showHidden':![],'depth':null});}function initialize(_0x31eabe,_0x4d98bc){var _0x3d7868=getRoot(_0x31eabe[_0x53d8('0x1b')]);if(!_0x3d7868||!_0x3d7868['start'])return;var _0x4f5d73,_0xb1c805,_0xff5f47;logger[_0x53d8('0x1c')](_0x53d8('0x1d'),JSON['stringify'](_0x3d7868,null,0x2));_0x4d98bc[_0x53d8('0x1e')]=moment()[_0x53d8('0x1f')](_0x53d8('0x20'));_0x4f5d73=initGraph(_[_0x53d8('0x10')](_0x3d7868,_0x53d8('0x11')),_0x3d7868[_0x53d8('0x11')]);_0xb1c805=new Vertices(_0x4d98bc,rpc,mailRpc);logger[_0x53d8('0x21')](util[_0x53d8('0x1f')](_0x53d8('0x22'),_0x4d98bc[_0x53d8('0x23')],_0x4d98bc[_0x53d8('0x24')],_0x4d98bc[_0x53d8('0x25')],_0x4d98bc[_0x53d8('0x26')],_0x4d98bc['uniqueid']));_0x4f5d73[_0x53d8('0x27')](_0x3d7868[_0x53d8('0x28')]['id'],function(_0x248557){try{_0x248557=_0xb1c805[_0x53d8('0x29')](_0x248557);logger['debug'](_0x53d8('0x2a'),JSON[_0x53d8('0x2b')](_0x248557,null,0x2));if(_0x248557[_0x53d8('0xb')]===_0x53d8('0x2c')){logger[_0x53d8('0x21')](_0x53d8('0x2d'));_0x4d98bc[_0x53d8('0x2e')]=_0x248557[_0x53d8('0x2e')]||_0x4d98bc['context'];_0x4d98bc['extension']=_0x248557[_0x53d8('0x2f')];_0x4d98bc[_0x53d8('0x30')]=_0x248557[_0x53d8('0x30')]?_0x248557[_0x53d8('0x30')]-0x1:0x1;return null;}else if(_0x248557&&_0xb1c805[_0x248557[_0x53d8('0xb')]]){_0xff5f47=_0xb1c805[_0x248557[_0x53d8('0xb')]](_0x248557);logger['info']('response',JSON[_0x53d8('0x2b')](_0xff5f47,null,0x2));if(_0xff5f47&&_0xff5f47[_0x53d8('0x31')]===AGI_CODE_SUCCESS&&_0xff5f47[_0x53d8('0x32')]!==AGI_RESULT_ERROR&&!_0x4d98bc[_0x53d8('0x33')]){logger[_0x53d8('0x1c')]('response',inspect(_0xff5f47));return _['isUndefined'](_0xff5f47['result'])?null:_0xff5f47['result']['toString']();}else{logger[_0x53d8('0x8')](_0x53d8('0x34'),inspect(_0xff5f47));return null;}}else{logger[_0x53d8('0x8')](_0x53d8('0x35'));return null;}}catch(_0x3bf98c){logger[_0x53d8('0x8')](_0x3bf98c[_0x53d8('0xa')]);return null;}});if(_0x3d7868['finally']){logger[_0x53d8('0x21')](util[_0x53d8('0x1f')](_0x53d8('0x36'),_0x4d98bc[_0x53d8('0x23')],_0x4d98bc['calleridname'],_0x4d98bc['callerid'],_0x4d98bc[_0x53d8('0x26')],_0x4d98bc[_0x53d8('0x37')]));_0x4f5d73[_0x53d8('0x27')](_0x3d7868[_0x53d8('0x38')]['id'],function(_0x23d5d5){try{_0x23d5d5=_0xb1c805[_0x53d8('0x29')](_0x23d5d5);logger[_0x53d8('0x1c')]('vertex',JSON[_0x53d8('0x2b')](_0x23d5d5,null,0x2));if(_0x23d5d5&&_0xb1c805[_0x23d5d5[_0x53d8('0xb')]]){_0xff5f47=_0xb1c805[_0x23d5d5[_0x53d8('0xb')]](_0x23d5d5);if(_0xff5f47){logger['debug']('response',inspect(_0xff5f47));return _[_0x53d8('0x39')](_0xff5f47[_0x53d8('0x32')])?null:_0xff5f47[_0x53d8('0x32')][_0x53d8('0x3a')]();}else{logger[_0x53d8('0x8')](_0x53d8('0x34'),inspect(_0xff5f47));return null;}}else{logger[_0x53d8('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x5a454f){logger[_0x53d8('0x8')](_0x5a454f[_0x53d8('0xa')]);return null;}});}logger[_0x53d8('0x21')](util[_0x53d8('0x1f')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d98bc[_0x53d8('0x23')],_0x4d98bc['calleridname'],_0x4d98bc[_0x53d8('0x25')],_0x4d98bc[_0x53d8('0x26')],_0x4d98bc['uniqueid']));logger[_0x53d8('0x21')](util[_0x53d8('0x1f')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4d98bc[_0x53d8('0x2e')],_0x4d98bc[_0x53d8('0x2f')],parseInt(_0x4d98bc[_0x53d8('0x30')],0xa)+0x1));_0x4d98bc[_0x53d8('0x3b')](_0x4d98bc[_0x53d8('0x2e')],_0x4d98bc[_0x53d8('0x2f')],parseInt(_0x4d98bc[_0x53d8('0x30')],0xa)+0x1);_0x4d98bc[_0x53d8('0x3c')]();}function handleNotFound(_0x37abdc){logger[_0x53d8('0x8')](util[_0x53d8('0x1f')](_0x53d8('0x3d'),_0x37abdc[_0x53d8('0x23')]));_0x37abdc[_0x53d8('0x3b')](_0x37abdc[_0x53d8('0x2e')],_0x37abdc['extension'],parseInt(_0x37abdc['priority'],0xa)+0x1);_0x37abdc[_0x53d8('0x3c')]();}function handleUnpublished(_0x584366){logger[_0x53d8('0x8')](util[_0x53d8('0x1f')]('Project\x20%s\x20not\x20published',_0x584366[_0x53d8('0x23')]));_0x584366['continueAt'](_0x584366['context'],_0x584366[_0x53d8('0x2f')],parseInt(_0x584366[_0x53d8('0x30')],0xa)+0x1);_0x584366[_0x53d8('0x3c')]();}module[_0x53d8('0x3e')]={'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 29854d3..a0960e0 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 _0xa047=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','split','slice','trim','length','emit','headers','_inBody','line','exports','util','stream','Transform','_localBuffer','inherits','prototype','_transform'];(function(_0x1c9c3b,_0x4f7af4){var _0x52a6b7=function(_0x39aa82){while(--_0x39aa82){_0x1c9c3b['push'](_0x1c9c3b['shift']());}};_0x52a6b7(++_0x4f7af4);}(_0xa047,0x1c5));var _0x7a04=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xa047[_0x68ee8b];return _0x5148f7;};'use strict';var util=require(_0x7a04('0x0'));var Transform=require(_0x7a04('0x1'))[_0x7a04('0x2')];function AGIReply(_0x391550){Transform['call'](this,_0x391550);this[_0x7a04('0x3')]='';this['_inBody']=![];}util[_0x7a04('0x4')](AGIReply,Transform);AGIReply[_0x7a04('0x5')][_0x7a04('0x6')]=function(_0x15c12c,_0x26a2c9,_0x4cc23b){var _0x12564a='\x0a',_0x3166ff=['\x0a\x0a',_0x7a04('0x7')],_0x1dc89f=-0x1,_0x5c183c=-0x1,_0x10d92f='',_0x10faf9=0x0,_0x500da7='',_0x150cbf='';this['_localBuffer']+=_0x15c12c[_0x7a04('0x8')]();_0x500da7=this['_localBuffer'];if(!this['_inBody']){_0x10faf9=0x0;while(_0x3166ff[_0x10faf9]){while((_0x5c183c=_0x500da7[_0x7a04('0x9')](_0x3166ff[_0x10faf9]))!=-0x1){_0x10d92f=_0x3166ff[_0x10faf9];_0x150cbf=_0x500da7[_0x7a04('0xa')](0x0,_0x5c183c);_0x500da7=_0x500da7['substring'](_0x5c183c+_0x10d92f['length']);var _0x4a90b2=_0x150cbf[_0x7a04('0xb')](_0x12564a),_0x504fb0=0x0,_0x3300ae={},_0x3e8692='',_0x15a002='',_0x10931c=-0x1;while(_0x4a90b2[_0x504fb0]){_0x10931c=_0x4a90b2[_0x504fb0][_0x7a04('0x9')](':');if(_0x10931c!=-0x1){_0x3e8692=_0x4a90b2[_0x504fb0][_0x7a04('0xc')](0x0,_0x10931c)[_0x7a04('0xd')]();_0x15a002=_0x4a90b2[_0x504fb0]['slice'](_0x10931c+0x1)[_0x7a04('0xd')]();if(_0x3e8692[_0x7a04('0xe')]>0x0){_0x3300ae[_0x3e8692]=_0x15a002;}}else{}_0x504fb0++;}this[_0x7a04('0xf')](_0x7a04('0x10'),_0x3300ae);this[_0x7a04('0x11')]=!![];}_0x10faf9++;}this[_0x7a04('0x3')]=_0x500da7;}else{while((_0x1dc89f=_0x500da7['indexOf'](_0x12564a))!=-0x1){_0x150cbf=_0x500da7[_0x7a04('0xa')](0x0,_0x1dc89f);this[_0x7a04('0xf')](_0x7a04('0x12'),_0x150cbf);_0x500da7=_0x500da7['substring'](_0x1dc89f+_0x12564a['length']);}this[_0x7a04('0x3')]=_0x500da7;}_0x4cc23b();};module[_0x7a04('0x13')]=AGIReply; \ No newline at end of file +var _0xeadc=['slice','trim','emit','headers','line','length','exports','util','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring'];(function(_0x376070,_0x170de9){var _0x1bae01=function(_0x31d717){while(--_0x31d717){_0x376070['push'](_0x376070['shift']());}};_0x1bae01(++_0x170de9);}(_0xeadc,0xdf));var _0xcead=function(_0x39d8d2,_0x8bbcad){_0x39d8d2=_0x39d8d2-0x0;var _0x35af15=_0xeadc[_0x39d8d2];return _0x35af15;};'use strict';var util=require(_0xcead('0x0'));var Transform=require('stream')[_0xcead('0x1')];function AGIReply(_0x5c6161){Transform[_0xcead('0x2')](this,_0x5c6161);this[_0xcead('0x3')]='';this[_0xcead('0x4')]=![];}util[_0xcead('0x5')](AGIReply,Transform);AGIReply[_0xcead('0x6')][_0xcead('0x7')]=function(_0x30b7b5,_0x3f1e4c,_0xa3a632){var _0x502229='\x0a',_0x26a4f5=['\x0a\x0a',_0xcead('0x8')],_0x236ab2=-0x1,_0x617299=-0x1,_0x45f9cd='',_0x4873cc=0x0,_0xb6ac6b='',_0x19102e='';this[_0xcead('0x3')]+=_0x30b7b5['toString']();_0xb6ac6b=this[_0xcead('0x3')];if(!this['_inBody']){_0x4873cc=0x0;while(_0x26a4f5[_0x4873cc]){while((_0x617299=_0xb6ac6b[_0xcead('0x9')](_0x26a4f5[_0x4873cc]))!=-0x1){_0x45f9cd=_0x26a4f5[_0x4873cc];_0x19102e=_0xb6ac6b[_0xcead('0xa')](0x0,_0x617299);_0xb6ac6b=_0xb6ac6b[_0xcead('0xa')](_0x617299+_0x45f9cd['length']);var _0xa394fe=_0x19102e['split'](_0x502229),_0x310378=0x0,_0x2f3598={},_0x41c9ab='',_0x34c06c='',_0x3d8d67=-0x1;while(_0xa394fe[_0x310378]){_0x3d8d67=_0xa394fe[_0x310378][_0xcead('0x9')](':');if(_0x3d8d67!=-0x1){_0x41c9ab=_0xa394fe[_0x310378][_0xcead('0xb')](0x0,_0x3d8d67)[_0xcead('0xc')]();_0x34c06c=_0xa394fe[_0x310378]['slice'](_0x3d8d67+0x1)['trim']();if(_0x41c9ab['length']>0x0){_0x2f3598[_0x41c9ab]=_0x34c06c;}}else{}_0x310378++;}this[_0xcead('0xd')](_0xcead('0xe'),_0x2f3598);this[_0xcead('0x4')]=!![];}_0x4873cc++;}this['_localBuffer']=_0xb6ac6b;}else{while((_0x236ab2=_0xb6ac6b[_0xcead('0x9')](_0x502229))!=-0x1){_0x19102e=_0xb6ac6b[_0xcead('0xa')](0x0,_0x236ab2);this[_0xcead('0xd')](_0xcead('0xf'),_0x19102e);_0xb6ac6b=_0xb6ac6b[_0xcead('0xa')](_0x236ab2+_0x502229[_0xcead('0x10')]);}this[_0xcead('0x3')]=_0xb6ac6b;}_0xa3a632();};module[_0xcead('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 9f4f62d..acd9a96 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 _0xac9d=['createCmContact','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','moment','jayson/promise','client','http','request','error','message','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage'];(function(_0x34bab8,_0x3088e6){var _0x53f6ab=function(_0x5f13d3){while(--_0x5f13d3){_0x34bab8['push'](_0x34bab8['shift']());}};_0x53f6ab(++_0x3088e6);}(_0xac9d,0x14d));var _0xdac9=function(_0xec9322,_0x2d5b87){_0xec9322=_0xec9322-0x0;var _0x39d576=_0xac9d[_0xec9322];return _0x39d576;};'use strict';var _=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var jayson=require(_0xdac9('0x2'));var client=jayson[_0xdac9('0x3')][_0xdac9('0x4')]({'port':0x2329});function request(_0x27eb7c,_0x25d1b3){return new Promise(function(_0x1b967e,_0x51a5d7){return client[_0xdac9('0x5')](_0x27eb7c,_0x25d1b3)['then'](function(_0x3d56ae){if(_0x3d56ae[_0xdac9('0x6')]){return _0x51a5d7(_0x3d56ae[_0xdac9('0x6')][_0xdac9('0x7')]);}else{return _0x1b967e(_0x3d56ae[_0xdac9('0x8')]);}})[_0xdac9('0x9')](function(_0x5531af){return _0x51a5d7(_0x5531af);});});}exports[_0xdac9('0xa')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xdac9('0xb'),_0xdac9('0xc')]}});};exports[_0xdac9('0xd')]=function(_0x1a4674){return request(_0xdac9('0xe'),{'options':{'raw':![],'where':{'name':_0x1a4674},'attributes':[_0xdac9('0xc')]}});};exports[_0xdac9('0xf')]=function(_0x1b604a){return request(_0xdac9('0x10'),{'options':{'raw':![],'where':{'id':_0x1b604a},'include':[{'model':'MailServerOut','as':_0xdac9('0x11'),'include':[{'model':_0xdac9('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0xdac9('0xb'),_0xdac9('0x13')],'smtp':!![]}});};exports[_0xdac9('0x14')]=function(_0x4b2436){return request(_0xdac9('0xe'),{'options':{'where':{'id':_0x4b2436},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x15')]=function(_0x5f0bbd){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5f0bbd},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x16')]=function(_0x50f9fe){return request(_0xdac9('0x17'),{'options':{'where':{'id':_0x50f9fe},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x18')]=function(_0x5b2f1b){return request(_0xdac9('0x19'),{'options':{'where':{'id':_0x5b2f1b},'attributes':[_0xdac9('0x1a')]}});};exports[_0xdac9('0x1b')]=function(_0xec1016){return request('ShowUser',{'options':{'where':{'id':_0xec1016},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x1c')]=function(_0x571e07){return request(_0xdac9('0x1d'),{'options':{'where':{'phone':_0x571e07[_0xdac9('0x1e')]},'attributes':['id']}});};exports[_0xdac9('0x1f')]=function(_0x181d11){return request('ShowTrunk',{'options':{'where':{'id':_0x181d11},'attributes':['name']}});};exports[_0xdac9('0x20')]=function(_0x20ece3){return request(_0xdac9('0x21'),{'options':{'where':{'id':_0x20ece3},'attributes':[_0xdac9('0x22')]}});};exports['getIntervalById']=function(_0x23ee5e){return request(_0xdac9('0x23'),{'options':{'raw':![],'where':{'id':_0x23ee5e},'include':[{'model':_0xdac9('0x24'),'as':_0xdac9('0x25')}]}});};exports[_0xdac9('0x26')]=function(_0x42317c){return request(_0xdac9('0x27'),{'options':{'where':{'id':_0x42317c},'attributes':['id',_0xdac9('0xb')]}});};exports[_0xdac9('0x28')]=function(_0x33de5c){return request('CreateSmsMessage',{'body':_0x33de5c});};exports[_0xdac9('0x29')]=function(_0x11f4fd){return request(_0xdac9('0x2a'),{'body':_0x11f4fd});};exports[_0xdac9('0x2b')]=function(_0x5ca076){return request(_0xdac9('0x2c'),{'body':_['merge'](_0x5ca076,{'project_name':_0x5ca076[_0xdac9('0x2d')],'prev_project_name':_0x5ca076[_0xdac9('0x2e')]||'','is_subproject':_0x5ca076['arg_2']?!![]:![],'leaveAt':moment()[_0xdac9('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xdac9('0x30')]=function(_0x3743f7){return request(_0xdac9('0x31'),{'body':_0x3743f7});};exports[_0xdac9('0x32')]=function(_0x57d76a){return request('CreateSquareMessage',{'body':_0x57d76a});};exports[_0xdac9('0x33')]=function(_0x170afd){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x170afd['phone'],'ListId':_0x170afd[_0xdac9('0x34')]}}})[_0xdac9('0x35')](function(_0x13efba){if(_0x13efba){return _0x13efba;}return request(_0xdac9('0x36'),{'body':_0x170afd});});};exports[_0xdac9('0x37')]=function(_0x2247f8){return request(_0xdac9('0x38'),{'options':{'where':{'id':_0x2247f8},'attributes':[_0xdac9('0xb')]}});};exports[_0xdac9('0x39')]=function(_0x2f36f4,_0xb49c21){return request(_0xdac9('0x3a'),{'body':{'interface':_0xb49c21},'options':{'where':_0x2f36f4}});};exports[_0xdac9('0x3b')]=function(_0x336fd5,_0x410cec,_0x446080){return request(_0xdac9('0x3c'),{'body':{'type':_0x410cec,'uniqueid':_0x446080},'options':{'where':_0x336fd5}});};exports[_0xdac9('0x3d')]=function(_0x339f31){return request(_0xdac9('0x3e'),{'body':{},'options':{'where':_0x339f31}});};exports[_0xdac9('0x3f')]=function(_0x514eee){return request('LogoutUser',{'body':{},'options':{'where':_0x514eee}});}; \ No newline at end of file +var _0x8ff9=['createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','then','error','message','result','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x56f746,_0x631ae0){var _0x478865=function(_0x10a38e){while(--_0x10a38e){_0x56f746['push'](_0x56f746['shift']());}};_0x478865(++_0x631ae0);}(_0x8ff9,0x188));var _0x98ff=function(_0x52474a,_0x23484a){_0x52474a=_0x52474a-0x0;var _0x4f66fd=_0x8ff9[_0x52474a];return _0x4f66fd;};'use strict';var _=require(_0x98ff('0x0'));var moment=require(_0x98ff('0x1'));var jayson=require(_0x98ff('0x2'));var client=jayson['client'][_0x98ff('0x3')]({'port':0x2329});function request(_0x432f67,_0x331be7){return new Promise(function(_0x16e131,_0x1619f1){return client[_0x98ff('0x4')](_0x432f67,_0x331be7)[_0x98ff('0x5')](function(_0x5a925e){if(_0x5a925e[_0x98ff('0x6')]){return _0x1619f1(_0x5a925e['error'][_0x98ff('0x7')]);}else{return _0x16e131(_0x5a925e[_0x98ff('0x8')]);}})['catch'](function(_0x421d77){return _0x1619f1(_0x421d77);});});}exports[_0x98ff('0x9')]=function(){return request(_0x98ff('0xa'),{'options':{'raw':![],'attributes':['id',_0x98ff('0xb'),_0x98ff('0xc')]}});};exports[_0x98ff('0xd')]=function(_0x4975de){return request(_0x98ff('0xe'),{'options':{'raw':![],'where':{'name':_0x4975de},'attributes':[_0x98ff('0xc')]}});};exports[_0x98ff('0xf')]=function(_0x8d837a){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x8d837a},'include':[{'model':_0x98ff('0x10'),'as':_0x98ff('0x11'),'include':[{'model':_0x98ff('0x12'),'as':_0x98ff('0x12')}]}],'attributes':['id',_0x98ff('0xb'),_0x98ff('0x13')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x514ccd){return request(_0x98ff('0xe'),{'options':{'where':{'id':_0x514ccd},'attributes':['name']}});};exports[_0x98ff('0x14')]=function(_0x1c2b68){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1c2b68},'attributes':[_0x98ff('0xb')]}});};exports['getVariableById']=function(_0x18132e){return request(_0x98ff('0x15'),{'options':{'where':{'id':_0x18132e},'attributes':['name']}});};exports[_0x98ff('0x16')]=function(_0x5471d5){return request(_0x98ff('0x17'),{'options':{'where':{'id':_0x5471d5},'attributes':[_0x98ff('0x18')]}});};exports[_0x98ff('0x19')]=function(_0x4cbb53){return request('ShowUser',{'options':{'where':{'id':_0x4cbb53},'attributes':[_0x98ff('0xb')]}});};exports[_0x98ff('0x1a')]=function(_0x48ca02){return request(_0x98ff('0x1b'),{'options':{'where':{'phone':_0x48ca02[_0x98ff('0x1c')]},'attributes':['id']}});};exports[_0x98ff('0x1d')]=function(_0x1ab7eb){return request(_0x98ff('0x1e'),{'options':{'where':{'id':_0x1ab7eb},'attributes':[_0x98ff('0xb')]}});};exports[_0x98ff('0x1f')]=function(_0x258081){return request(_0x98ff('0x20'),{'options':{'where':{'id':_0x258081},'attributes':['save_name']}});};exports[_0x98ff('0x21')]=function(_0x481a72){return request(_0x98ff('0x22'),{'options':{'raw':![],'where':{'id':_0x481a72},'include':[{'model':_0x98ff('0x23'),'as':_0x98ff('0x24')}]}});};exports[_0x98ff('0x25')]=function(_0x5a1563){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5a1563},'attributes':['id',_0x98ff('0xb')]}});};exports[_0x98ff('0x26')]=function(_0x766b31){return request('CreateSmsMessage',{'body':_0x766b31});};exports[_0x98ff('0x27')]=function(_0x34d7c7){return request(_0x98ff('0x28'),{'body':_0x34d7c7});};exports[_0x98ff('0x29')]=function(_0x3f7e30){return request(_0x98ff('0x2a'),{'body':_[_0x98ff('0x2b')](_0x3f7e30,{'project_name':_0x3f7e30[_0x98ff('0x2c')],'prev_project_name':_0x3f7e30['arg_2']||'','is_subproject':_0x3f7e30[_0x98ff('0x2d')]?!![]:![],'leaveAt':moment()['format'](_0x98ff('0x2e'))})});};exports[_0x98ff('0x2f')]=function(_0x29e5da){return request(_0x98ff('0x30'),{'body':_0x29e5da});};exports[_0x98ff('0x31')]=function(_0x9b284c){return request(_0x98ff('0x32'),{'body':_0x9b284c});};exports[_0x98ff('0x33')]=function(_0xa9787c){return request(_0x98ff('0x34'),{'options':{'raw':![],'where':{'phone':_0xa9787c[_0x98ff('0x1c')],'ListId':_0xa9787c[_0x98ff('0x35')]}}})[_0x98ff('0x5')](function(_0x3e4f74){if(_0x3e4f74){return _0x3e4f74;}return request(_0x98ff('0x36'),{'body':_0xa9787c});});};exports[_0x98ff('0x37')]=function(_0x2b686b){return request('ShowPause',{'options':{'where':{'id':_0x2b686b},'attributes':[_0x98ff('0xb')]}});};exports[_0x98ff('0x38')]=function(_0x9667e4,_0x3b4923){return request('LoginUser',{'body':{'interface':_0x3b4923},'options':{'where':_0x9667e4}});};exports[_0x98ff('0x39')]=function(_0x4ca856,_0x1d8ddd,_0x40f57d){return request(_0x98ff('0x3a'),{'body':{'type':_0x1d8ddd,'uniqueid':_0x40f57d},'options':{'where':_0x4ca856}});};exports[_0x98ff('0x3b')]=function(_0x4fdb85){return request(_0x98ff('0x3c'),{'body':{},'options':{'where':_0x4fdb85}});};exports[_0x98ff('0x3d')]=function(_0x545f93){return request(_0x98ff('0x3e'),{'body':{},'options':{'where':_0x545f93}});}; \ 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 8700c23..cfc5544 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 _0x13f5=['./polly','./lex','exports'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x13f5,0xc3));var _0x513f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x13f5[_0x413feb];return _0x40ee88;};var polly=require(_0x513f('0x0'));var lex=require(_0x513f('0x1'));module[_0x513f('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xfd6e=['./polly','exports'];(function(_0xb14c00,_0x281183){var _0x236a87=function(_0x290067){while(--_0x290067){_0xb14c00['push'](_0xb14c00['shift']());}};_0x236a87(++_0x281183);}(_0xfd6e,0x16e));var _0xefd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd6e[_0x3dd15e];return _0x231fd0;};var polly=require(_0xefd6('0x0'));var lex=require('./lex');module[_0xefd6('0x1')]={'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 93d7491..9f2a5e1 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 _0x6f0d=['exports'];(function(_0x520046,_0x265191){var _0x1d37db=function(_0x3dc1e2){while(--_0x3dc1e2){_0x520046['push'](_0x520046['shift']());}};_0x1d37db(++_0x265191);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2f9177,_0x4eb140){_0x2f9177=_0x2f9177-0x0;var _0x5518da=_0x6f0d[_0x2f9177];return _0x5518da;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ No newline at end of file +var _0xd64b=['./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd64b,0xc1));var _0xbd64=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xd64b[_0x498334];return _0x13bb70;};'use strict';var lex=require(_0xbd64('0x0'));module['exports']=function(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05){return lex(_0xf0de04,_0x4bfb7c,_0x30b9b3,_0xcbecd5,_0x64bd3b,_0x3f1f05);}; \ 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 553ca0d..bfc506a 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(_0x36d343,_0x1dc768){var _0x473820=function(_0x1b43df){while(--_0x1b43df){_0x36d343['push'](_0x36d343['shift']());}};_0x473820(++_0x1dc768);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x22ad62,_0x543aa8){var _0x41517f=function(_0x51ac2b){while(--_0x51ac2b){_0x22ad62['push'](_0x22ad62['shift']());}};_0x41517f(++_0x543aa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 eb4aa2d..45cc5fe 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 _0xb360=['exports','./lib/api'];(function(_0x3b18cf,_0x40c821){var _0x505fe1=function(_0x481c8b){while(--_0x481c8b){_0x3b18cf['push'](_0x3b18cf['shift']());}};_0x505fe1(++_0x40c821);}(_0xb360,0xa9));var _0x0b36=function(_0x1ae9a5,_0x58fef6){_0x1ae9a5=_0x1ae9a5-0x0;var _0x2f199a=_0xb360[_0x1ae9a5];return _0x2f199a;};'use strict';var polly=require(_0x0b36('0x0'));module[_0x0b36('0x1')]=function(_0x526682,_0x2f0e89,_0x5938a6,_0xcb5e38,_0x332a43,_0xe9e856,_0x344e91){return polly(_0x526682,_0x2f0e89,_0x5938a6,_0xcb5e38,_0x332a43,_0xe9e856,_0x344e91);}; \ No newline at end of file +var _0xff4c=['./lib/api'];(function(_0x5786b1,_0x34e627){var _0x489292=function(_0x3a11f6){while(--_0x3a11f6){_0x5786b1['push'](_0x5786b1['shift']());}};_0x489292(++_0x34e627);}(_0xff4c,0x189));var _0xcff4=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0xff4c[_0x1fb4e1];return _0x22d1b0;};'use strict';var polly=require(_0xcff4('0x0'));module['exports']=function(_0x4c91a8,_0x368b3a,_0x18e570,_0x5a45d2,_0x91f8a2,_0x5c0063,_0x372cba){return polly(_0x4c91a8,_0x368b3a,_0x18e570,_0x5a45d2,_0x91f8a2,_0x5c0063,_0x372cba);}; \ 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 4926d1d..aa82db7 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 _0x8fca=['Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x8fca,0x157));var _0xa8fc=function(_0x16f45f,_0xa3fce3){_0x16f45f=_0x16f45f-0x0;var _0xd92a25=_0x8fca[_0x16f45f];return _0xd92a25;};'use strict';var fs=require('fs');var path=require(_0xa8fc('0x0'));var BPromise=require(_0xa8fc('0x1'));var rs=require(_0xa8fc('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x42ac18,_0x2f2264,_0xa2eb2){return new BPromise(function(_0x2a23dc,_0xca9cd8){_0x42ac18[_0xa8fc('0x3')](_0x2f2264,function(_0x565e5f,_0xa68af2){if(_0x565e5f){_0xca9cd8(_0x565e5f);}else if(_0xa68af2){if(_0xa68af2['AudioStream']instanceof Buffer){fs[_0xa8fc('0x4')](_0xa2eb2,_0xa68af2['AudioStream'],function(_0x56c45a){if(_0x56c45a){_0xca9cd8(_0x56c45a);}else{_0x2a23dc();}});}else{_0xca9cd8(new Error(_0xa8fc('0x5')));}}else{_0xca9cd8(new Error(_0xa8fc('0x6')));}});});}module['exports']=function(_0xb1a9b5,_0x4d6c10,_0x571e6e,_0x80e9fd,_0x522a5e,_0x45cc1b,_0x1ed5bf){var _0x1f4b36=new AWS[(_0xa8fc('0x7'))]({'accessKeyId':_0xb1a9b5,'secretAccessKey':_0x4d6c10,'region':_0x571e6e});var _0x3562ce={'Text':_0x522a5e,'TextType':_0x45cc1b||_0xa8fc('0x8'),'OutputFormat':_0xa8fc('0x9'),'VoiceId':_0x80e9fd};return pollyResult(_0x1f4b36,_0x3562ce,_0x1ed5bf);}; \ No newline at end of file +var _0x0193=['exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x4b129b,_0x15477f){var _0x2b89b7=function(_0x150d8d){while(--_0x150d8d){_0x4b129b['push'](_0x4b129b['shift']());}};_0x2b89b7(++_0x15477f);}(_0x0193,0x1a8));var _0x3019=function(_0x23589b,_0xbdd2){_0x23589b=_0x23589b-0x0;var _0x4d9d16=_0x0193[_0x23589b];return _0x4d9d16;};'use strict';var fs=require('fs');var path=require(_0x3019('0x0'));var BPromise=require(_0x3019('0x1'));var rs=require(_0x3019('0x2'));var AWS=require(_0x3019('0x3'));function pollyResult(_0x212b12,_0x1f2812,_0x3040aa){return new BPromise(function(_0x57322d,_0x5680bc){_0x212b12[_0x3019('0x4')](_0x1f2812,function(_0x45fef2,_0xc483df){if(_0x45fef2){_0x5680bc(_0x45fef2);}else if(_0xc483df){if(_0xc483df[_0x3019('0x5')]instanceof Buffer){fs['writeFile'](_0x3040aa,_0xc483df[_0x3019('0x5')],function(_0x19129f){if(_0x19129f){_0x5680bc(_0x19129f);}else{_0x57322d();}});}else{_0x5680bc(new Error(_0x3019('0x6')));}}else{_0x5680bc(new Error(_0x3019('0x7')));}});});}module[_0x3019('0x8')]=function(_0x275e9c,_0x540b7f,_0x101212,_0x1c1f2e,_0x11d82a,_0x1ef7cb,_0x312136){var _0x4a3006=new AWS[(_0x3019('0x9'))]({'accessKeyId':_0x275e9c,'secretAccessKey':_0x540b7f,'region':_0x101212});var _0x4b8097={'Text':_0x11d82a,'TextType':_0x1ef7cb||_0x3019('0xa'),'OutputFormat':_0x3019('0xb'),'VoiceId':_0x1c1f2e};return pollyResult(_0x4a3006,_0x4b8097,_0x312136);}; \ 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 1579216..5fcd2ec 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['./lib/api','exports'];(function(_0x592070,_0x487367){var _0x3d4724=function(_0x3c46ab){while(--_0x3c46ab){_0x592070['push'](_0x592070['shift']());}};_0x3d4724(++_0x487367);}(_0x0b0e,0x112));var _0xe0b0=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0b0e[_0x2642cb];return _0xe6e41;};'use strict';var asr=require(_0xe0b0('0x0'));module[_0xe0b0('0x1')]=function(_0x488f63,_0x2107f9,_0x240c72,_0x4dfb3d){return asr(_0x488f63,_0x2107f9,_0x240c72);}; \ No newline at end of file +var _0x5d5a=['./lib/api','exports'];(function(_0x5cb4ad,_0x409d31){var _0x3747a4=function(_0x1aa7de){while(--_0x1aa7de){_0x5cb4ad['push'](_0x5cb4ad['shift']());}};_0x3747a4(++_0x409d31);}(_0x5d5a,0xf8));var _0xa5d5=function(_0x51daf5,_0x52305b){_0x51daf5=_0x51daf5-0x0;var _0x3356a4=_0x5d5a[_0x51daf5];return _0x3356a4;};'use strict';var asr=require(_0xa5d5('0x0'));module[_0xa5d5('0x1')]=function(_0x3a90c1,_0x22468d,_0x567729,_0x5d2ce0){return asr(_0x3a90c1,_0x22468d,_0x567729);}; \ 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 6b8590e..877a498 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 _0x0269=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','https://speech.googleapis.com','length'];(function(_0x4106f4,_0x2ed0eb){var _0x134650=function(_0x354af2){while(--_0x354af2){_0x4106f4['push'](_0x4106f4['shift']());}};_0x134650(++_0x2ed0eb);}(_0x0269,0x135));var _0x9026=function(_0x39785c,_0x273522){_0x39785c=_0x39785c-0x0;var _0x524a08=_0x0269[_0x39785c];return _0x524a08;};'use strict';var url=require(_0x9026('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x9026('0x1');module['exports']=function(_0x190158,_0x5771e3,_0x470464){return new BPromise(function(_0x1d0dfb,_0x357df7){var _0xa3ba06;if(typeof _0x190158!=='string'||_0x190158[_0x9026('0x2')]===0x0){return _0x357df7(_0x9026('0x3'));}if(typeof _0x5771e3!=='string'||_0x5771e3['length']===0x0){return _0x357df7(_0x9026('0x4'));}if(typeof _0x470464!==_0x9026('0x5')&&(typeof _0x470464!==_0x9026('0x6')||_0x470464[_0x9026('0x2')]===0x0)){return _0x357df7('lang\x20should\x20be\x20a\x20string');}try{_0xa3ba06=fs[_0x9026('0x7')](_0x190158)[_0x9026('0x8')](_0x9026('0x9'));}catch(_0x4b7d1f){return _0x357df7(_0x4b7d1f);}return _0x1d0dfb({'method':_0x9026('0xa'),'uri':host+_0x9026('0xb')+_0x5771e3,'body':{'config':{'encoding':_0x9026('0xc'),'sampleRateHertz':'8000','languageCode':_0x470464},'audio':{'content':_0xa3ba06}},'json':!![]});});}; \ No newline at end of file +var _0x593e=['key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x89e59,_0x21503d){var _0x222406=function(_0x31f2c9){while(--_0x31f2c9){_0x89e59['push'](_0x89e59['shift']());}};_0x222406(++_0x21503d);}(_0x593e,0xcb));var _0xe593=function(_0x1128b2,_0x3d9a41){_0x1128b2=_0x1128b2-0x0;var _0x852f2d=_0x593e[_0x1128b2];return _0x852f2d;};'use strict';var url=require(_0xe593('0x0'));var BPromise=require(_0xe593('0x1'));var fs=require('fs');var host=_0xe593('0x2');module[_0xe593('0x3')]=function(_0x43dabb,_0x184a6b,_0x2c7c48){return new BPromise(function(_0x2fa3a7,_0x550574){var _0x8a87e8;if(typeof _0x43dabb!==_0xe593('0x4')||_0x43dabb[_0xe593('0x5')]===0x0){return _0x550574(_0xe593('0x6'));}if(typeof _0x184a6b!==_0xe593('0x4')||_0x184a6b[_0xe593('0x5')]===0x0){return _0x550574(_0xe593('0x7'));}if(typeof _0x2c7c48!==_0xe593('0x8')&&(typeof _0x2c7c48!==_0xe593('0x4')||_0x2c7c48[_0xe593('0x5')]===0x0)){return _0x550574('lang\x20should\x20be\x20a\x20string');}try{_0x8a87e8=fs[_0xe593('0x9')](_0x43dabb)[_0xe593('0xa')](_0xe593('0xb'));}catch(_0x5ba75c){return _0x550574(_0x5ba75c);}return _0x2fa3a7({'method':'POST','uri':host+_0xe593('0xc')+_0x184a6b,'body':{'config':{'encoding':_0xe593('0xd'),'sampleRateHertz':_0xe593('0xe'),'languageCode':_0x2c7c48},'audio':{'content':_0x8a87e8}},'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 3c85642..c7d8a7f 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 _0xf9ba=['./asr','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf9ba,0x1dc));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};var asr=require(_0xaf9b('0x0'));module[_0xaf9b('0x1')]={'asr':asr}; \ No newline at end of file +var _0x71ca=['exports'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0x71ca,0x1da));var _0xa71c=function(_0x206e2a,_0x4f1370){_0x206e2a=_0x206e2a-0x0;var _0x542326=_0x71ca[_0x206e2a];return _0x542326;};var asr=require('./asr');module[_0xa71c('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index ed1b8e1..dd9f2ca 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 _0xb555=['freeform=3','parse','nda','channelData','CustomActionData','AudioFromTts','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','util','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','unlink','download\x20error','end','data','transcode','wav','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','chmodSync','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','then','resolve','audioContent','writeFile','777','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','source','result','action','speech','status','endConversation','metadata','isFallbackIntent','replace','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s'];(function(_0x539643,_0x5257e8){var _0x224653=function(_0x5f5df4){while(--_0x5f5df4){_0x539643['push'](_0x539643['shift']());}};_0x224653(++_0x5257e8);}(_0xb555,0x10d));var _0x5b55=function(_0x494ae6,_0x39e6d6){_0x494ae6=_0x494ae6-0x0;var _0x1a9ecc=_0xb555[_0x494ae6];return _0x1a9ecc;};'use strict';var apiai=require(_0x5b55('0x0'));var BPromise=require(_0x5b55('0x1'));var dialogflow=require(_0x5b55('0x2'));var fs=require('fs');var http=require(_0x5b55('0x3'));var https=require(_0x5b55('0x4'));var md5=require(_0x5b55('0x5'));var path=require(_0x5b55('0x6'));var querystring=require('querystring');var rp=require(_0x5b55('0x7'));var rs=require(_0x5b55('0x8'));var sox=require(_0x5b55('0x9'));var tts=require(_0x5b55('0xa'));var urlParse=require('url')['parse'];var util=require(_0x5b55('0xb'));var aws=require('./aws');var google=require(_0x5b55('0xc'));var sestek=require('./sestek');var tilde=require(_0x5b55('0xd'));var logger=require(_0x5b55('0xe'))(_0x5b55('0xf'));var ISPEECH_API=_0x5b55('0x10');function downloadFile(_0x55aa9e,_0x53dac3){return new BPromise(function(_0x491ee1,_0x524dbc){var _0x168acd=urlParse(_0x55aa9e);var _0x39c2c3=_0x168acd[_0x5b55('0x11')]==='https:'?https:http;var _0xd5a74a={'host':_0x168acd[_0x5b55('0x12')],'path':_0x168acd['path'],'headers':{'user-agent':_0x5b55('0x13')}};_0x39c2c3[_0x5b55('0x14')](_0xd5a74a,function(_0x14eb11){if(_0x14eb11[_0x5b55('0x15')]!==0xc8){logger[_0x5b55('0x16')](_0x5b55('0x17')+_0x55aa9e+_0x5b55('0x18')+_0x14eb11[_0x5b55('0x15')]+'\x20('+_0x14eb11['statusMessage']+')');_0x524dbc(new Error(_0x5b55('0x17')+_0x55aa9e+'\x20failed,\x20status\x20code\x20=\x20'+_0x14eb11[_0x5b55('0x15')]+'\x20('+_0x14eb11[_0x5b55('0x19')]+')'));return;}var _0x146d42=fs[_0x5b55('0x1a')](_0x53dac3);_0x146d42['on'](_0x5b55('0x1b'),function(){logger[_0x5b55('0x1c')]('finish\x20download\x20file');_0x146d42['close'](_0x491ee1);});_0x146d42['on'](_0x5b55('0x16'),function(_0x1d3399){fs[_0x5b55('0x1d')](_0x53dac3);logger[_0x5b55('0x16')](_0x5b55('0x1e'),_0x1d3399);_0x524dbc(_0x1d3399);});_0x14eb11['pipe'](_0x146d42);})['on'](_0x5b55('0x16'),function(_0x1f2d2d){logger[_0x5b55('0x16')](_0x1f2d2d);_0x524dbc(_0x1f2d2d);})[_0x5b55('0x1f')]();});}function uploadFile(_0x207c36){return new BPromise(function(_0x53f978,_0x42dae6){var _0x9f8882=urlParse(_0x207c36);var _0x954c1c=_0x9f8882[_0x5b55('0x11')]==='https:'?https:http;var _0x466b56={'host':_0x9f8882[_0x5b55('0x12')],'path':_0x9f8882[_0x5b55('0x6')],'headers':{'user-agent':_0x5b55('0x13')}};_0x954c1c[_0x5b55('0x14')](_0x466b56,function(_0x2087ae){if(_0x2087ae[_0x5b55('0x15')]!==0xc8){_0x42dae6(new Error(_0x5b55('0x17')+_0x207c36+'\x20failed,\x20status\x20code\x20=\x20'+_0x2087ae[_0x5b55('0x15')]+'\x20('+_0x2087ae['statusMessage']+')'));return;}var _0x3d91dc='';_0x2087ae['on'](_0x5b55('0x20'),function(_0x297eec){_0x3d91dc+=_0x297eec;});_0x2087ae['on'](_0x5b55('0x1f'),function(){_0x53f978(_0x3d91dc);});})['on'](_0x5b55('0x16'),function(_0x4cd33a){_0x42dae6(_0x4cd33a);})['end']();});}function convertFile(_0x41300c,_0x4ccd20){return new BPromise(function(_0x244d8b,_0x548a5e){var _0x1972d2=sox[_0x5b55('0x21')](_0x41300c,_0x4ccd20,{'sampleRate':0x1f40,'format':_0x5b55('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1972d2['on'](_0x5b55('0x16'),function(_0x29bc55){logger['error']('error\x20convert',_0x29bc55);_0x548a5e(_0x29bc55);});_0x1972d2['on'](_0x5b55('0x1f'),function(){logger[_0x5b55('0x1c')](_0x5b55('0x23'));_0x244d8b();});_0x1972d2[_0x5b55('0x24')]();});}function base64Decode(_0xb33d2d,_0x45dbc3){var _0x1f2e3f=path['resolve'](__dirname,_0x5b55('0x25'),rs[_0x5b55('0x26')](0x4)+_0x5b55('0x27'));fs[_0x5b55('0x28')](_0x1f2e3f,_0xb33d2d,_0x5b55('0x29'));return convertFile(_0x1f2e3f,_0x45dbc3)['then'](function(){try{fs[_0x5b55('0x1d')](_0x1f2e3f);fs[_0x5b55('0x2a')](_0x45dbc3,'777');}catch(_0x5855e3){logger[_0x5b55('0x16')](_0x5855e3);}return _0x45dbc3['split']('.')[0x0];});}function base64Encode(_0x50ff64){var _0x4944f3=fs[_0x5b55('0x2b')](_0x50ff64);return new Buffer(_0x4944f3)[_0x5b55('0x2c')](_0x5b55('0x29'));}exports[_0x5b55('0x2d')]=function(_0xec4c96,_0x3d42a6,_0x3a6cd3,_0x173d40,_0x17c5b1,_0xde603a){var _0x283050,_0x2eb949;var _0x8ca3e0=_0x5b55('0x2e');var _0x285bd7=_0x5b55('0x2f')+_0xec4c96;var _0x3bcf71={};if(_0x3d42a6==='ssml'){_0x3bcf71['input']={'ssml':_0x3a6cd3};}else{_0x3bcf71[_0x5b55('0x30')]={'text':_0x3a6cd3};};_0x3bcf71[_0x5b55('0x31')]={'languageCode':_0x173d40,'ssmlGender':_0x17c5b1};_0x3bcf71[_0x5b55('0x32')]={'audioEncoding':_0x5b55('0x33'),'sampleRateHertz':0x1f40};var _0x2ce0e9={'url':_0x8ca3e0+_0x5b55('0x34')+_0x285bd7,'method':_0x5b55('0x35'),'json':!![],'body':_0x3bcf71};return rp(_0x2ce0e9)[_0x5b55('0x36')](function(_0x3a3dbf){return new BPromise(function(_0x3ac7c7,_0x2f1889){_0x283050=path[_0x5b55('0x37')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0xffd49f=Buffer['from'](_0x3a3dbf[_0x5b55('0x38')],_0x5b55('0x29'));return fs[_0x5b55('0x39')](_0x283050,_0xffd49f,function(_0x3a7039){_0x2f1889(_0x3a7039);},function(_0x3e4da5){fs[_0x5b55('0x2a')](_0x283050,'777');_0x3ac7c7(_0x3e4da5);});});})[_0x5b55('0x36')](function(_0x50f735){_0x2eb949=path[_0x5b55('0x37')](__dirname,_0x5b55('0x25'),rs[_0x5b55('0x26')](0x4)+_0x5b55('0x27'));return convertFile(_0x283050,_0x2eb949);})[_0x5b55('0x36')](function(){try{fs['unlink'](_0x283050);fs['chmodSync'](_0x2eb949,_0x5b55('0x3a'));}catch(_0x406360){logger['error'](_0x406360);}logger[_0x5b55('0x1c')](_0x5b55('0x3b'),_0x2eb949[_0x5b55('0x3c')]('.')[0x0]);return _0x2eb949['split']('.')[0x0];});};exports['googleTTS']=function(_0x29e775,_0x30ec4b){var _0x28b418=_0x5b55('0x3d');var _0x1f89dd,_0x58044e;var _0x2183e6;var _0x57db23={'encoding':_0x5b55('0x3e'),'method':_0x5b55('0x35'),'timeout':0x2710,'url':_0x28b418,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x5b55('0x3f')+encodeURIComponent(JSON[_0x5b55('0x40')]([[[_0x5b55('0x41'),JSON[_0x5b55('0x40')]([_0x29e775,_0x30ec4b||'en',![],'null']),null,_0x5b55('0x42')]]]))};return rp(_0x57db23)[_0x5b55('0x36')](function(_0x32fdc9){try{_0x2183e6=eval(_0x32fdc9[_0x5b55('0x43')](0x5))[0x0][0x2];}catch(_0x53dd72){throw new Error(_0x5b55('0x44')+_0x32fdc9[_0x5b55('0x20')]);}if(!_0x2183e6){if(_0x29e775[_0x5b55('0x45')]>0xc8){throw new Error(_0x5b55('0x46'));}else{throw new Error(_0x5b55('0x47')+_0x30ec4b+_0x5b55('0x48'));}}try{_0x2183e6=eval(_0x2183e6)[0x0];}catch(_0x308c9e){throw new Error(_0x5b55('0x44')+res[_0x5b55('0x20')]);}const _0x3f07c0=_0x2183e6;_0x1f89dd=path[_0x5b55('0x37')](__dirname,_0x5b55('0x25'),rs['generate'](0x4)+_0x5b55('0x49'));fs[_0x5b55('0x28')](_0x1f89dd,_0x2183e6,{'encoding':_0x5b55('0x29')});_0x58044e=path['resolve'](__dirname,_0x5b55('0x25'),rs[_0x5b55('0x26')](0x4)+'.wav');return convertFile(_0x1f89dd,_0x58044e);})[_0x5b55('0x36')](function(){try{fs[_0x5b55('0x1d')](_0x1f89dd);fs[_0x5b55('0x2a')](_0x58044e,_0x5b55('0x3a'));}catch(_0x16c1e1){logger[_0x5b55('0x16')](_0x16c1e1);}logger[_0x5b55('0x1c')](_0x5b55('0x4a'),_0x58044e[_0x5b55('0x3c')]('.')[0x0]);return _0x58044e[_0x5b55('0x3c')]('.')[0x0];});};exports[_0x5b55('0x4b')]=function(_0x29a0ab,_0x51f195,_0x35efa7){return google[_0x5b55('0x4c')](_0x29a0ab,_0x51f195,_0x35efa7)[_0x5b55('0x36')](function(_0x5937b6){logger['info'](_0x5937b6[_0x5b55('0x4d')]);return rp(_0x5937b6);})[_0x5b55('0x36')](function(_0xbebff0){var _0x1cff56='';var _0x442f3b=0x0;try{fs['unlink'](_0x29a0ab);}catch(_0x5bb748){logger[_0x5b55('0x16')](_0x5bb748);}if(_0xbebff0&&_0xbebff0[_0x5b55('0x4e')]){_0x1cff56=_0xbebff0[_0x5b55('0x4e')][_0x5b55('0x4f')](function(_0x5dfb70){return _0x5dfb70&&_0x5dfb70[_0x5b55('0x50')][0x0]&&_0x5dfb70[_0x5b55('0x50')][0x0][_0x5b55('0x51')]?_0x5dfb70[_0x5b55('0x50')][0x0][_0x5b55('0x51')]:'';})[_0x5b55('0x52')]('\x0a');_0x442f3b=_0xbebff0[_0x5b55('0x4e')][_0x5b55('0x4f')](function(_0x12e5a6){return _0x12e5a6&&_0x12e5a6[_0x5b55('0x50')][0x0]&&_0x12e5a6[_0x5b55('0x50')][0x0][_0x5b55('0x53')]?_0x12e5a6[_0x5b55('0x50')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x5b55('0x1c')](_0x5b55('0x54'),_0x1cff56);logger['info'](_0x5b55('0x55'),_0x442f3b);return{'transcript':_0x1cff56,'confidence':_0x442f3b};})[_0x5b55('0x56')](function(_0x512bd7){logger[_0x5b55('0x16')](_0x5b55('0x57'),_0x512bd7[_0x5b55('0x15')],_0x512bd7[_0x5b55('0x58')],_0x512bd7['message']);});};exports['googleDialogflow']=function(_0x11dfe0,_0x1cd242,_0x1e0eea,_0x404d29){var _0x18e944=apiai(_0x1cd242,{'language':_0x404d29||'en'});return _0x18e944['textRequest'](_0x1e0eea,{'sessionId':md5(_0x11dfe0)})['then'](function(_0x283bb){logger[_0x5b55('0x1c')](JSON[_0x5b55('0x40')](_0x283bb));return{'source':_0x283bb['result'][_0x5b55('0x59')],'resolvedQuery':_0x283bb[_0x5b55('0x5a')]['resolvedQuery'],'action':_0x283bb['result'][_0x5b55('0x5b')],'actionIncomplete':_0x283bb[_0x5b55('0x5a')]['actionIncomplete'],'speech':_0x283bb['result']['fulfillment'][_0x5b55('0x5c')],'score':_0x283bb[_0x5b55('0x5a')]['score'],'statusCode':_0x283bb[_0x5b55('0x5d')]['code'],'endConversation':_0x283bb[_0x5b55('0x5a')]['metadata'][_0x5b55('0x5e')]||![],'isFallbackIntent':_0x283bb[_0x5b55('0x5a')][_0x5b55('0x5f')][_0x5b55('0x60')]};});};exports['googleDialogflowV2']=function(_0x57d2b4,_0x4c5567,_0x4c2dfb,_0x5170b8,_0x2ff8ff,_0x4e3eab){var _0x38b9ad=_0x5170b8[_0x5b55('0x61')](/\\n/g,'\x0a');var _0x454c11={'credentials':{'private_key':_0x38b9ad,'client_email':_0x4c2dfb}};var _0x253b05=new dialogflow['SessionsClient'](_0x454c11);var _0x8fb655=_0x253b05['sessionPath'](_0x4c5567,md5(_0x57d2b4));var _0x33b4ce={'session':_0x8fb655,'queryInput':{'text':{'text':_0x2ff8ff,'languageCode':_0x4e3eab}}};return _0x253b05[_0x5b55('0x62')](_0x33b4ce)[_0x5b55('0x36')](function(_0x4d9660){if(_0x4d9660&&_0x4d9660[_0x5b55('0x45')]){logger[_0x5b55('0x1c')](_0x5b55('0x63'),JSON[_0x5b55('0x40')](_0x4d9660));var _0x2eb535=_0x4d9660[0x0];if(_0x2eb535){var _0x548a7d={'action':_0x2eb535[_0x5b55('0x64')][_0x5b55('0x5b')],'allRequiredParamsPresent':_0x2eb535['queryResult'][_0x5b55('0x65')],'endConversation':_0x2eb535[_0x5b55('0x64')][_0x5b55('0x66')]&&_0x2eb535[_0x5b55('0x64')]['diagnosticInfo'][_0x5b55('0x67')]?_0x2eb535['queryResult']['diagnosticInfo']['fields'][_0x5b55('0x68')][_0x5b55('0x69')]:![],'fulfillmentText':_0x2eb535[_0x5b55('0x64')][_0x5b55('0x6a')],'intentName':_0x2eb535[_0x5b55('0x64')][_0x5b55('0x6b')][_0x5b55('0x58')],'intentDisplayName':_0x2eb535[_0x5b55('0x64')][_0x5b55('0x6b')]['displayName'],'isFallbackIntent':_0x2eb535['queryResult'][_0x5b55('0x6b')][_0x5b55('0x6c')],'languageCode':_0x2eb535[_0x5b55('0x64')][_0x5b55('0x6d')],'queryText':_0x2eb535[_0x5b55('0x64')]['queryText'],'responseId':_0x2eb535[_0x5b55('0x6e')],'score':_0x2eb535[_0x5b55('0x64')][_0x5b55('0x6f')],'speech':_0x2eb535[_0x5b55('0x64')]['fulfillmentText'],'providerResponse':JSON[_0x5b55('0x40')](_0x4d9660)};return _0x548a7d;}}});};exports[_0x5b55('0x70')]=function(_0x12dee3,_0x4038bc,_0x44bd1f,_0x25e1de){return tilde[_0x5b55('0x4c')](_0x12dee3,_0x4038bc,_0x44bd1f,_0x25e1de)[_0x5b55('0x36')](function(_0x35d233){try{fs[_0x5b55('0x1d')](_0x12dee3);}catch(_0x4d6200){logger[_0x5b55('0x16')](_0x4d6200);}logger[_0x5b55('0x1c')](_0x5b55('0x71'),_0x35d233[_0x5b55('0x51')]);logger[_0x5b55('0x1c')](_0x5b55('0x72'),_0x35d233['confidence']);return _0x35d233;});};exports[_0x5b55('0x73')]=function(_0x13c2d3,_0x580e65,_0x1e938a,_0x3f09d5,_0x8e8a53,_0x42e9b8){var _0x3e3e7c=path['resolve'](__dirname,_0x5b55('0x25'),rs[_0x5b55('0x26')](0x4)+'.mp3');var _0x2e100d;return aws[_0x5b55('0x74')](_0x13c2d3,_0x580e65,_0x1e938a,_0x3f09d5,_0x8e8a53,_0x42e9b8,_0x3e3e7c)[_0x5b55('0x36')](function(){_0x2e100d=path[_0x5b55('0x37')](__dirname,_0x5b55('0x25'),rs[_0x5b55('0x26')](0x4)+_0x5b55('0x27'));return convertFile(_0x3e3e7c,_0x2e100d);})[_0x5b55('0x36')](function(){try{fs[_0x5b55('0x1d')](_0x3e3e7c);fs[_0x5b55('0x2a')](_0x2e100d,_0x5b55('0x3a'));}catch(_0x1f4e3e){logger[_0x5b55('0x16')](_0x1f4e3e);}return _0x2e100d['split']('.')[0x0];});};exports[_0x5b55('0x75')]=function(_0x1c1744,_0x3285ef,_0x3f733e,_0x50a587,_0x1bf3c9,_0x83d46a){return aws[_0x5b55('0x76')](_0x1c1744,_0x3285ef,_0x3f733e,_0x50a587,_0x1bf3c9,_0x83d46a)[_0x5b55('0x36')](function(_0xde86b5){logger[_0x5b55('0x1c')](JSON[_0x5b55('0x40')](_0xde86b5));return _0xde86b5;});};exports['ispeechTTS']=function(_0x4dcfa0,_0x34cf7c,_0x4c544f,_0x105510){var _0x2cb65e=util[_0x5b55('0x77')](_0x5b55('0x78'),ISPEECH_API,_0x4dcfa0,encodeURIComponent(_0x34cf7c),_0x4c544f,_0x105510);var _0x3133cb=path[_0x5b55('0x37')](__dirname,'tmp',rs[_0x5b55('0x26')](0x4)+_0x5b55('0x49'));var _0x460e4d;return downloadFile(_0x2cb65e,_0x3133cb)['then'](function(){_0x460e4d=path[_0x5b55('0x37')](__dirname,'tmp',rs['generate'](0x4)+_0x5b55('0x27'));return convertFile(_0x3133cb,_0x460e4d);})[_0x5b55('0x36')](function(){try{fs[_0x5b55('0x1d')](_0x3133cb);fs[_0x5b55('0x2a')](_0x460e4d,_0x5b55('0x3a'));}catch(_0x22f4d5){logger[_0x5b55('0x16')](_0x22f4d5);}return _0x460e4d['split']('.')[0x0];});};exports[_0x5b55('0x79')]=function(_0x2d1eaf,_0xfdf39e,_0x48d8b7,_0x2ce47a){var _0x14538b=util['format'](_0x5b55('0x7a'),ISPEECH_API,_0xfdf39e,_0x48d8b7,base64Encode(_0x2d1eaf),_0x2ce47a?util['format'](_0x5b55('0x7b'),encodeURIComponent(_0x2ce47a)):_0x5b55('0x7c'));return uploadFile(_0x14538b)[_0x5b55('0x36')](function(_0x5d0e3a){return querystring[_0x5b55('0x7d')](_0x5d0e3a);});};exports['sestekNDA']=function(_0x47ebbb,_0x3f2954){return sestek[_0x5b55('0x7e')](_0x47ebbb,_0x3f2954)['then'](function(_0x308c73){logger[_0x5b55('0x1c')](JSON[_0x5b55('0x40')](_0x308c73));var _0x4a7d24={'speech':_0x308c73['text'],'action':_0x308c73[_0x5b55('0x7f')]?_0x308c73[_0x5b55('0x7f')]['CustomAction']:undefined,'actiondata':_0x308c73[_0x5b55('0x7f')]?_0x308c73['channelData'][_0x5b55('0x80')]:undefined};if(_0x308c73[_0x5b55('0x7f')]&&_0x308c73['channelData'][_0x5b55('0x81')]){return base64Decode(_0x308c73['channelData'][_0x5b55('0x81')]['Data'],path[_0x5b55('0x37')](__dirname,'tmp',rs['generate'](0x4)+_0x5b55('0x27')))[_0x5b55('0x36')](function(_0x1ffa65){_0x4a7d24['audiofile']=_0x1ffa65;return _0x4a7d24;});}return _0x4a7d24;});};exports[_0x5b55('0x82')]=function(){return __dirname;}; \ No newline at end of file +var _0xb619=['util','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish\x20download\x20file','close','unlink','download\x20error','pipe','data','end','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','tmp','audioContent','writeFile','then','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','.wav','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','source','result','action','actionIncomplete','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','ispeechTTS','ispeechASR','format','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','request-promise','sox','google-tts-api','url'];(function(_0x53702a,_0x5bfd9a){var _0x4e1cc3=function(_0x9cf78c){while(--_0x9cf78c){_0x53702a['push'](_0x53702a['shift']());}};_0x4e1cc3(++_0x5bfd9a);}(_0xb619,0x10b));var _0x9b61=function(_0x1a5095,_0x279628){_0x1a5095=_0x1a5095-0x0;var _0x1a6533=_0xb619[_0x1a5095];return _0x1a6533;};'use strict';var apiai=require(_0x9b61('0x0'));var BPromise=require(_0x9b61('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x9b61('0x2'));var https=require(_0x9b61('0x3'));var md5=require(_0x9b61('0x4'));var path=require(_0x9b61('0x5'));var querystring=require(_0x9b61('0x6'));var rp=require(_0x9b61('0x7'));var rs=require('randomstring');var sox=require(_0x9b61('0x8'));var tts=require(_0x9b61('0x9'));var urlParse=require(_0x9b61('0xa'))['parse'];var util=require(_0x9b61('0xb'));var aws=require('./aws');var google=require(_0x9b61('0xc'));var sestek=require(_0x9b61('0xd'));var tilde=require('./tilde');var logger=require(_0x9b61('0xe'))(_0x9b61('0xf'));var ISPEECH_API=_0x9b61('0x10');function downloadFile(_0x1ec419,_0x58becd){return new BPromise(function(_0x5aefc8,_0x4fed95){var _0x547fa8=urlParse(_0x1ec419);var _0xb34dcc=_0x547fa8[_0x9b61('0x11')]==='https:'?https:http;var _0xf967ca={'host':_0x547fa8[_0x9b61('0x12')],'path':_0x547fa8[_0x9b61('0x5')],'headers':{'user-agent':_0x9b61('0x13')}};_0xb34dcc[_0x9b61('0x14')](_0xf967ca,function(_0x155580){if(_0x155580['statusCode']!==0xc8){logger[_0x9b61('0x15')](_0x9b61('0x16')+_0x1ec419+_0x9b61('0x17')+_0x155580[_0x9b61('0x18')]+'\x20('+_0x155580[_0x9b61('0x19')]+')');_0x4fed95(new Error(_0x9b61('0x16')+_0x1ec419+'\x20failed,\x20status\x20code\x20=\x20'+_0x155580[_0x9b61('0x18')]+'\x20('+_0x155580[_0x9b61('0x19')]+')'));return;}var _0x20e2f1=fs[_0x9b61('0x1a')](_0x58becd);_0x20e2f1['on']('finish',function(){logger['info'](_0x9b61('0x1b'));_0x20e2f1[_0x9b61('0x1c')](_0x5aefc8);});_0x20e2f1['on'](_0x9b61('0x15'),function(_0x54bd93){fs[_0x9b61('0x1d')](_0x58becd);logger[_0x9b61('0x15')](_0x9b61('0x1e'),_0x54bd93);_0x4fed95(_0x54bd93);});_0x155580[_0x9b61('0x1f')](_0x20e2f1);})['on'](_0x9b61('0x15'),function(_0x4df6cb){logger[_0x9b61('0x15')](_0x4df6cb);_0x4fed95(_0x4df6cb);})['end']();});}function uploadFile(_0x151aed){return new BPromise(function(_0xdccc4e,_0x213386){var _0x1f7bda=urlParse(_0x151aed);var _0x5e0a78=_0x1f7bda['protocol']==='https:'?https:http;var _0x4f8b6b={'host':_0x1f7bda[_0x9b61('0x12')],'path':_0x1f7bda[_0x9b61('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x5e0a78[_0x9b61('0x14')](_0x4f8b6b,function(_0x435c9c){if(_0x435c9c['statusCode']!==0xc8){_0x213386(new Error(_0x9b61('0x16')+_0x151aed+'\x20failed,\x20status\x20code\x20=\x20'+_0x435c9c[_0x9b61('0x18')]+'\x20('+_0x435c9c['statusMessage']+')'));return;}var _0x379ea4='';_0x435c9c['on'](_0x9b61('0x20'),function(_0x231b0a){_0x379ea4+=_0x231b0a;});_0x435c9c['on'](_0x9b61('0x21'),function(){_0xdccc4e(_0x379ea4);});})['on']('error',function(_0x5265ac){_0x213386(_0x5265ac);})['end']();});}function convertFile(_0x54da20,_0x5f1d0b){return new BPromise(function(_0x324bb5,_0x2be5b9){var _0xbd37e8=sox['transcode'](_0x54da20,_0x5f1d0b,{'sampleRate':0x1f40,'format':_0x9b61('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xbd37e8['on'](_0x9b61('0x15'),function(_0x4db5f1){logger[_0x9b61('0x15')](_0x9b61('0x23'),_0x4db5f1);_0x2be5b9(_0x4db5f1);});_0xbd37e8['on']('end',function(){logger[_0x9b61('0x24')](_0x9b61('0x25'));_0x324bb5();});_0xbd37e8[_0x9b61('0x26')]();});}function base64Decode(_0x5ccfec,_0x1926d0){var _0x2498bc=path[_0x9b61('0x27')](__dirname,'tmp',rs[_0x9b61('0x28')](0x4)+'.wav');fs[_0x9b61('0x29')](_0x2498bc,_0x5ccfec,_0x9b61('0x2a'));return convertFile(_0x2498bc,_0x1926d0)['then'](function(){try{fs[_0x9b61('0x1d')](_0x2498bc);fs[_0x9b61('0x2b')](_0x1926d0,_0x9b61('0x2c'));}catch(_0x2aec9b){logger[_0x9b61('0x15')](_0x2aec9b);}return _0x1926d0[_0x9b61('0x2d')]('.')[0x0];});}function base64Encode(_0x44db0a){var _0x56f943=fs[_0x9b61('0x2e')](_0x44db0a);return new Buffer(_0x56f943)[_0x9b61('0x2f')](_0x9b61('0x2a'));}exports[_0x9b61('0x30')]=function(_0x487bb4,_0x275c8b,_0x285564,_0x1ab53a,_0x170549,_0x276b78){var _0x34af8e,_0x1cea5d;var _0x25e344=_0x9b61('0x31');var _0x477df6=_0x9b61('0x32')+_0x487bb4;var _0x4d4001={};if(_0x275c8b===_0x9b61('0x33')){_0x4d4001[_0x9b61('0x34')]={'ssml':_0x285564};}else{_0x4d4001[_0x9b61('0x34')]={'text':_0x285564};};_0x4d4001[_0x9b61('0x35')]={'languageCode':_0x1ab53a,'ssmlGender':_0x170549};_0x4d4001['audioConfig']={'audioEncoding':_0x9b61('0x36'),'sampleRateHertz':0x1f40};var _0x440801={'url':_0x25e344+_0x9b61('0x37')+_0x477df6,'method':_0x9b61('0x38'),'json':!![],'body':_0x4d4001};return rp(_0x440801)['then'](function(_0x195700){return new BPromise(function(_0x5b41df,_0x46894d){_0x34af8e=path[_0x9b61('0x27')](__dirname,_0x9b61('0x39'),rs['generate'](0x4)+'.mp3');var _0x429f01=Buffer['from'](_0x195700[_0x9b61('0x3a')],_0x9b61('0x2a'));return fs[_0x9b61('0x3b')](_0x34af8e,_0x429f01,function(_0x3760cf){_0x46894d(_0x3760cf);},function(_0x3392db){fs['chmodSync'](_0x34af8e,'777');_0x5b41df(_0x3392db);});});})[_0x9b61('0x3c')](function(_0x4188c4){_0x1cea5d=path[_0x9b61('0x27')](__dirname,'tmp',rs[_0x9b61('0x28')](0x4)+'.wav');return convertFile(_0x34af8e,_0x1cea5d);})[_0x9b61('0x3c')](function(){try{fs['unlink'](_0x34af8e);fs[_0x9b61('0x2b')](_0x1cea5d,'777');}catch(_0xecdd6e){logger['error'](_0xecdd6e);}logger[_0x9b61('0x24')](_0x9b61('0x3d'),_0x1cea5d[_0x9b61('0x2d')]('.')[0x0]);return _0x1cea5d['split']('.')[0x0];});};exports[_0x9b61('0x3e')]=function(_0x45200b,_0x50cdd0){var _0x3d1b59=_0x9b61('0x3f');var _0x5794db,_0x3b1817;var _0x11765a;var _0x5e7353={'encoding':_0x9b61('0x40'),'method':_0x9b61('0x38'),'timeout':0x2710,'url':_0x3d1b59,'headers':{'Content-Type':_0x9b61('0x41')},'body':_0x9b61('0x42')+encodeURIComponent(JSON[_0x9b61('0x43')]([[[_0x9b61('0x44'),JSON[_0x9b61('0x43')]([_0x45200b,_0x50cdd0||'en',![],_0x9b61('0x45')]),null,_0x9b61('0x46')]]]))};return rp(_0x5e7353)[_0x9b61('0x3c')](function(_0x54a345){try{_0x11765a=eval(_0x54a345[_0x9b61('0x47')](0x5))[0x0][0x2];}catch(_0x3f16e1){throw new Error(_0x9b61('0x48')+_0x54a345['data']);}if(!_0x11765a){if(_0x45200b[_0x9b61('0x49')]>0xc8){throw new Error(_0x9b61('0x4a'));}else{throw new Error(_0x9b61('0x4b')+_0x50cdd0+_0x9b61('0x4c'));}}try{_0x11765a=eval(_0x11765a)[0x0];}catch(_0x365a19){throw new Error(_0x9b61('0x48')+res[_0x9b61('0x20')]);}const _0x46cdbb=_0x11765a;_0x5794db=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x9b61('0x4d'));fs[_0x9b61('0x29')](_0x5794db,_0x11765a,{'encoding':_0x9b61('0x2a')});_0x3b1817=path[_0x9b61('0x27')](__dirname,_0x9b61('0x39'),rs['generate'](0x4)+_0x9b61('0x4e'));return convertFile(_0x5794db,_0x3b1817);})[_0x9b61('0x3c')](function(){try{fs[_0x9b61('0x1d')](_0x5794db);fs['chmodSync'](_0x3b1817,_0x9b61('0x2c'));}catch(_0x3274e1){logger[_0x9b61('0x15')](_0x3274e1);}logger[_0x9b61('0x24')](_0x9b61('0x4f'),_0x3b1817['split']('.')[0x0]);return _0x3b1817['split']('.')[0x0];});};exports[_0x9b61('0x50')]=function(_0x2bbeda,_0xd440ed,_0x33f199){return google[_0x9b61('0x51')](_0x2bbeda,_0xd440ed,_0x33f199)[_0x9b61('0x3c')](function(_0x46e915){logger[_0x9b61('0x24')](_0x46e915[_0x9b61('0x52')]);return rp(_0x46e915);})['then'](function(_0x45072b){var _0x429a80='';var _0x1f16f0=0x0;try{fs[_0x9b61('0x1d')](_0x2bbeda);}catch(_0x34580c){logger[_0x9b61('0x15')](_0x34580c);}if(_0x45072b&&_0x45072b['results']){_0x429a80=_0x45072b[_0x9b61('0x53')][_0x9b61('0x54')](function(_0x51989d){return _0x51989d&&_0x51989d[_0x9b61('0x55')][0x0]&&_0x51989d['alternatives'][0x0][_0x9b61('0x56')]?_0x51989d[_0x9b61('0x55')][0x0][_0x9b61('0x56')]:'';})['join']('\x0a');_0x1f16f0=_0x45072b[_0x9b61('0x53')][_0x9b61('0x54')](function(_0x2acfaf){return _0x2acfaf&&_0x2acfaf[_0x9b61('0x55')][0x0]&&_0x2acfaf['alternatives'][0x0]['confidence']?_0x2acfaf['alternatives'][0x0][_0x9b61('0x57')]:0x0;})[_0x9b61('0x58')]('\x0a');}logger[_0x9b61('0x24')](_0x9b61('0x59'),_0x429a80);logger['info'](_0x9b61('0x5a'),_0x1f16f0);return{'transcript':_0x429a80,'confidence':_0x1f16f0};})['catch'](function(_0xb4468e){logger[_0x9b61('0x15')](_0x9b61('0x5b'),_0xb4468e[_0x9b61('0x18')],_0xb4468e[_0x9b61('0x5c')],_0xb4468e[_0x9b61('0x5d')]);});};exports[_0x9b61('0x5e')]=function(_0x1a8149,_0x1cb993,_0x1bb6dc,_0xf67130){var _0x19c58a=apiai(_0x1cb993,{'language':_0xf67130||'en'});return _0x19c58a['textRequest'](_0x1bb6dc,{'sessionId':md5(_0x1a8149)})[_0x9b61('0x3c')](function(_0x53eeef){logger[_0x9b61('0x24')](JSON[_0x9b61('0x43')](_0x53eeef));return{'source':_0x53eeef['result'][_0x9b61('0x5f')],'resolvedQuery':_0x53eeef['result']['resolvedQuery'],'action':_0x53eeef[_0x9b61('0x60')][_0x9b61('0x61')],'actionIncomplete':_0x53eeef['result'][_0x9b61('0x62')],'speech':_0x53eeef[_0x9b61('0x60')]['fulfillment'][_0x9b61('0x63')],'score':_0x53eeef[_0x9b61('0x60')][_0x9b61('0x64')],'statusCode':_0x53eeef[_0x9b61('0x65')]['code'],'endConversation':_0x53eeef[_0x9b61('0x60')][_0x9b61('0x66')][_0x9b61('0x67')]||![],'isFallbackIntent':_0x53eeef[_0x9b61('0x60')][_0x9b61('0x66')][_0x9b61('0x68')]};});};exports[_0x9b61('0x69')]=function(_0x2db278,_0x5112e9,_0x46591a,_0x8815db,_0x568420,_0x3e54f0){var _0x599079=_0x8815db[_0x9b61('0x6a')](/\\n/g,'\x0a');var _0x354512={'credentials':{'private_key':_0x599079,'client_email':_0x46591a}};var _0x3153bd=new dialogflow['SessionsClient'](_0x354512);var _0x5c05c8=_0x3153bd[_0x9b61('0x6b')](_0x5112e9,md5(_0x2db278));var _0x6c9118={'session':_0x5c05c8,'queryInput':{'text':{'text':_0x568420,'languageCode':_0x3e54f0}}};return _0x3153bd[_0x9b61('0x6c')](_0x6c9118)[_0x9b61('0x3c')](function(_0x2af2cb){if(_0x2af2cb&&_0x2af2cb[_0x9b61('0x49')]){logger[_0x9b61('0x24')](_0x9b61('0x6d'),JSON[_0x9b61('0x43')](_0x2af2cb));var _0x227f5e=_0x2af2cb[0x0];if(_0x227f5e){var _0x43d319={'action':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x61')],'allRequiredParamsPresent':_0x227f5e[_0x9b61('0x6e')]['allRequiredParamsPresent'],'endConversation':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x6f')]&&_0x227f5e['queryResult'][_0x9b61('0x6f')][_0x9b61('0x70')]?_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x6f')][_0x9b61('0x70')][_0x9b61('0x71')]['boolValue']:![],'fulfillmentText':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x72')],'intentName':_0x227f5e['queryResult'][_0x9b61('0x73')][_0x9b61('0x5c')],'intentDisplayName':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x73')][_0x9b61('0x74')],'isFallbackIntent':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x73')]['isFallback'],'languageCode':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x75')],'queryText':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x76')],'responseId':_0x227f5e[_0x9b61('0x77')],'score':_0x227f5e[_0x9b61('0x6e')][_0x9b61('0x78')],'speech':_0x227f5e[_0x9b61('0x6e')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x2af2cb)};return _0x43d319;}}});};exports['tildeASR']=function(_0x20b479,_0x39abbe,_0x9a3a19,_0xdcf158){return tilde[_0x9b61('0x51')](_0x20b479,_0x39abbe,_0x9a3a19,_0xdcf158)[_0x9b61('0x3c')](function(_0x356666){try{fs[_0x9b61('0x1d')](_0x20b479);}catch(_0x40c582){logger['error'](_0x40c582);}logger['info'](_0x9b61('0x79'),_0x356666[_0x9b61('0x56')]);logger[_0x9b61('0x24')](_0x9b61('0x7a'),_0x356666[_0x9b61('0x57')]);return _0x356666;});};exports[_0x9b61('0x7b')]=function(_0x430755,_0x7d9b6e,_0x417c5d,_0x435ff2,_0x3c6c55,_0x3f3b7f){var _0x3b320b=path['resolve'](__dirname,'tmp',rs[_0x9b61('0x28')](0x4)+_0x9b61('0x4d'));var _0x5e3712;return aws['polly'](_0x430755,_0x7d9b6e,_0x417c5d,_0x435ff2,_0x3c6c55,_0x3f3b7f,_0x3b320b)[_0x9b61('0x3c')](function(){_0x5e3712=path[_0x9b61('0x27')](__dirname,_0x9b61('0x39'),rs['generate'](0x4)+_0x9b61('0x4e'));return convertFile(_0x3b320b,_0x5e3712);})[_0x9b61('0x3c')](function(){try{fs['unlink'](_0x3b320b);fs['chmodSync'](_0x5e3712,_0x9b61('0x2c'));}catch(_0xada79c){logger['error'](_0xada79c);}return _0x5e3712[_0x9b61('0x2d')]('.')[0x0];});};exports[_0x9b61('0x7c')]=function(_0x45b030,_0x53cff8,_0x2a5ea7,_0x5d1b05,_0x15a378,_0x1c33af){return aws['lex'](_0x45b030,_0x53cff8,_0x2a5ea7,_0x5d1b05,_0x15a378,_0x1c33af)['then'](function(_0x51d411){logger['info'](JSON[_0x9b61('0x43')](_0x51d411));return _0x51d411;});};exports[_0x9b61('0x7d')]=function(_0x5f2b05,_0x232dd7,_0x28d668,_0x5e063c){var _0x5b15da=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x5f2b05,encodeURIComponent(_0x232dd7),_0x28d668,_0x5e063c);var _0x2c2879=path[_0x9b61('0x27')](__dirname,'tmp',rs[_0x9b61('0x28')](0x4)+_0x9b61('0x4d'));var _0xdfa61e;return downloadFile(_0x5b15da,_0x2c2879)[_0x9b61('0x3c')](function(){_0xdfa61e=path[_0x9b61('0x27')](__dirname,_0x9b61('0x39'),rs[_0x9b61('0x28')](0x4)+_0x9b61('0x4e'));return convertFile(_0x2c2879,_0xdfa61e);})[_0x9b61('0x3c')](function(){try{fs['unlink'](_0x2c2879);fs[_0x9b61('0x2b')](_0xdfa61e,_0x9b61('0x2c'));}catch(_0x27465a){logger['error'](_0x27465a);}return _0xdfa61e[_0x9b61('0x2d')]('.')[0x0];});};exports[_0x9b61('0x7e')]=function(_0x4566cd,_0x543907,_0x271236,_0x55e592){var _0x4c8fd6=util[_0x9b61('0x7f')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x543907,_0x271236,base64Encode(_0x4566cd),_0x55e592?util['format'](_0x9b61('0x80'),encodeURIComponent(_0x55e592)):_0x9b61('0x81'));return uploadFile(_0x4c8fd6)['then'](function(_0x1e2dfe){return querystring[_0x9b61('0x82')](_0x1e2dfe);});};exports[_0x9b61('0x83')]=function(_0x2ab404,_0x5b1846){return sestek[_0x9b61('0x84')](_0x2ab404,_0x5b1846)['then'](function(_0x2a8e97){logger[_0x9b61('0x24')](JSON[_0x9b61('0x43')](_0x2a8e97));var _0x178a63={'speech':_0x2a8e97[_0x9b61('0x85')],'action':_0x2a8e97[_0x9b61('0x86')]?_0x2a8e97[_0x9b61('0x86')]['CustomAction']:undefined,'actiondata':_0x2a8e97[_0x9b61('0x86')]?_0x2a8e97[_0x9b61('0x86')][_0x9b61('0x87')]:undefined};if(_0x2a8e97[_0x9b61('0x86')]&&_0x2a8e97[_0x9b61('0x86')][_0x9b61('0x88')]){return base64Decode(_0x2a8e97['channelData'][_0x9b61('0x88')]['Data'],path[_0x9b61('0x27')](__dirname,_0x9b61('0x39'),rs['generate'](0x4)+_0x9b61('0x4e')))[_0x9b61('0x3c')](function(_0x2e3507){_0x178a63[_0x9b61('0x89')]=_0x2e3507;return _0x178a63;});}return _0x178a63;});};exports[_0x9b61('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 08694b7..8f34e03 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 _0x1e6a=['exports'];(function(_0x4ac968,_0x2f5932){var _0x120226=function(_0x4c6fc4){while(--_0x4c6fc4){_0x4ac968['push'](_0x4ac968['shift']());}};_0x120226(++_0x2f5932);}(_0x1e6a,0x156));var _0xa1e6=function(_0x25ee8c,_0x2a1a0d){_0x25ee8c=_0x25ee8c-0x0;var _0x141988=_0x1e6a[_0x25ee8c];return _0x141988;};var nda=require('./nda');module[_0xa1e6('0x0')]={'nda':nda}; \ No newline at end of file +var nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 0f92b99..5e537d4 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 _0x3140=['custom_action_data','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username','then','ndaactivity_type','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction'];(function(_0x336157,_0x2ae557){var _0xec2135=function(_0x1d7811){while(--_0x1d7811){_0x336157['push'](_0x336157['shift']());}};_0xec2135(++_0x2ae557);}(_0x3140,0xaf));var _0x0314=function(_0x185f7f,_0x42aa8b){_0x185f7f=_0x185f7f-0x0;var _0x15d436=_0x3140[_0x185f7f];return _0x15d436;};'use strict';var rp=require(_0x0314('0x0'));var url=require(_0x0314('0x1'));var logger=require(_0x0314('0x2'))(_0x0314('0x3'));module['exports']=function(_0x4cf353,_0x285be5){var _0x26c016={'method':_0x0314('0x4'),'uri':url[_0x0314('0x5')](_0x285be5[_0x0314('0x6')],_0x0314('0x7')),'form':{'grant_type':_0x0314('0x8'),'username':_0x285be5[_0x0314('0x9')],'password':_0x285be5[_0x0314('0x8')]},'json':!![]};return rp(_0x26c016)[_0x0314('0xa')](function(_0x176944){var _0x495b27={'method':_0x0314('0x4'),'uri':url[_0x0314('0x5')](_0x285be5['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x285be5[_0x0314('0xb')]||'message','channelId':_0x0314('0xc'),'conversation':{'id':_0x4cf353[_0x0314('0xd')]},'from':{'id':_0x4cf353[_0x0314('0xe')],'name':_0x4cf353[_0x0314('0xf')]},'recipient':{'id':_0x4cf353[_0x0314('0x10')],'name':_0x4cf353[_0x0314('0x11')]},'text':_0x285be5['text'],'channelData':{}},'headers':{'Authorization':_0x0314('0x12')+_0x176944[_0x0314('0x13')]},'json':!![]};if(_0x285be5[_0x0314('0x14')]){_0x495b27[_0x0314('0x15')][_0x0314('0x16')][_0x0314('0x17')]=_0x285be5[_0x0314('0x14')];}if(_0x285be5['ndagenerate_audio']=='1'){_0x495b27[_0x0314('0x15')][_0x0314('0x16')][_0x0314('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0314('0x19')};}if(_0x285be5[_0x0314('0x1a')]){_0x495b27[_0x0314('0x15')][_0x0314('0x16')][_0x0314('0x1b')]=_0x285be5['custom_action'];if(_0x285be5[_0x0314('0x1c')]){_0x495b27[_0x0314('0x15')][_0x0314('0x16')]['CustomActionData']=_0x285be5[_0x0314('0x1c')];}}logger['info'](JSON['stringify'](_0x495b27));return rp(_0x495b27);});}; \ No newline at end of file +var _0x3f8c=['CustomAction','custom_action_data','info','stringify','../../../../../config/logger','agi','exports','/token','password','username','then','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action'];(function(_0x29fe99,_0x2a4bd8){var _0x1d6acf=function(_0x2468ed){while(--_0x2468ed){_0x29fe99['push'](_0x29fe99['shift']());}};_0x1d6acf(++_0x2a4bd8);}(_0x3f8c,0x104));var _0xc3f8=function(_0x21d1b2,_0x257e3b){_0x21d1b2=_0x21d1b2-0x0;var _0x362930=_0x3f8c[_0x21d1b2];return _0x362930;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xc3f8('0x0'))(_0xc3f8('0x1'));module[_0xc3f8('0x2')]=function(_0xab5f83,_0x4de1c7){var _0x5bd5e7={'method':'POST','uri':url['resolve'](_0x4de1c7['ndauth_url'],_0xc3f8('0x3')),'form':{'grant_type':_0xc3f8('0x4'),'username':_0x4de1c7[_0xc3f8('0x5')],'password':_0x4de1c7[_0xc3f8('0x4')]},'json':!![]};return rp(_0x5bd5e7)[_0xc3f8('0x6')](function(_0x15512a){var _0x51093a={'method':_0xc3f8('0x7'),'uri':url[_0xc3f8('0x8')](_0x4de1c7[_0xc3f8('0x9')],_0xc3f8('0xa')),'body':{'type':_0x4de1c7[_0xc3f8('0xb')]||_0xc3f8('0xc'),'channelId':_0xc3f8('0xd'),'conversation':{'id':_0xab5f83['uniqueid']},'from':{'id':_0xab5f83[_0xc3f8('0xe')],'name':_0xab5f83[_0xc3f8('0xf')]},'recipient':{'id':_0xab5f83[_0xc3f8('0x10')],'name':_0xab5f83[_0xc3f8('0x11')]},'text':_0x4de1c7['text'],'channelData':{}},'headers':{'Authorization':_0xc3f8('0x12')+_0x15512a[_0xc3f8('0x13')]},'json':!![]};if(_0x4de1c7[_0xc3f8('0x14')]){_0x51093a[_0xc3f8('0x15')]['channelData'][_0xc3f8('0x16')]=_0x4de1c7[_0xc3f8('0x14')];}if(_0x4de1c7[_0xc3f8('0x17')]=='1'){_0x51093a[_0xc3f8('0x15')][_0xc3f8('0x18')][_0xc3f8('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc3f8('0x1a')};}if(_0x4de1c7[_0xc3f8('0x1b')]){_0x51093a[_0xc3f8('0x15')][_0xc3f8('0x18')][_0xc3f8('0x1c')]=_0x4de1c7[_0xc3f8('0x1b')];if(_0x4de1c7[_0xc3f8('0x1d')]){_0x51093a['body'][_0xc3f8('0x18')]['CustomActionData']=_0x4de1c7['custom_action_data'];}}logger[_0xc3f8('0x1e')](JSON[_0xc3f8('0x1f')](_0x51093a));return rp(_0x51093a);});}; \ 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 cd148ba..f429484 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 _0xac5b=['exports'];(function(_0x3bcbe2,_0x9ccd39){var _0x27498b=function(_0x325af1){while(--_0x325af1){_0x3bcbe2['push'](_0x3bcbe2['shift']());}};_0x27498b(++_0x9ccd39);}(_0xac5b,0x1b1));var _0xbac5=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xac5b[_0x59d0cc];return _0x2ae79f;};'use strict';var asr=require('./lib/api');module[_0xbac5('0x0')]=function(_0x38570b,_0x7f39ef,_0x5efcc9,_0x5fa1d3){return asr(_0x38570b,_0x7f39ef,_0x5efcc9,_0x5fa1d3);}; \ No newline at end of file +var _0x267c=['exports','./lib/api'];(function(_0xb46ca8,_0x4f87be){var _0x52ed62=function(_0x48e5e0){while(--_0x48e5e0){_0xb46ca8['push'](_0xb46ca8['shift']());}};_0x52ed62(++_0x4f87be);}(_0x267c,0x155));var _0xc267=function(_0x43f2ca,_0x53199c){_0x43f2ca=_0x43f2ca-0x0;var _0x4fa4c1=_0x267c[_0x43f2ca];return _0x4fa4c1;};'use strict';var asr=require(_0xc267('0x0'));module[_0xc267('0x1')]=function(_0xe37b43,_0x584bf5,_0x6d86ba,_0x1895bf){return asr(_0xe37b43,_0x584bf5,_0x6d86ba,_0x1895bf);}; \ 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 984d885..251543b 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 _0x42ff=['result','final','info','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','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','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','EOS','error','stringify','terminate','parse','status'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x42ff,0xe1));var _0xf42f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x42ff[_0x1cc8fe];return _0x230054;};'use strict';var BPromise=require(_0xf42f('0x0'));var _=require(_0xf42f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf42f('0x2'));var crypto=require(_0xf42f('0x3'));var logger=require(_0xf42f('0x4'))(_0xf42f('0x5'));module[_0xf42f('0x6')]=function(_0x1ee173,_0x1cc931,_0x2d3e7f,_0x4e728e){return new BPromise(function(_0x340a9b,_0x1ff212){logger['info'](_0xf42f('0x7'),_0x4e728e||_0xf42f('0x8'));var _0xef847c=new WebSocket(_0x4e728e||_0xf42f('0x8'),{'perMessageDeflate':![]});var _0x918ad2='';var _0x3e6fa='0';var _0x3d7eaf='1';var _0x24a1e4=_0xf42f('0x9');function _0x3342fc(_0x4b1ba8){var _0x1bae9f=crypto[_0xf42f('0xa')](_0xf42f('0xb'));_0x1bae9f[_0xf42f('0xc')](_0x4b1ba8);return _0x1bae9f[_0xf42f('0xd')](_0xf42f('0xe'));}function _0x5e6e83(){try{logger['info'](_0xf42f('0xf'));var _0x3912fa=moment()[_0xf42f('0x10')]();var _0x5b15a4=_0x3342fc(_0x3912fa+_0x1cc931+_0x2d3e7f);_0xef847c[_0xf42f('0x11')](JSON['stringify']({'appID':_0x1cc931,'timestamp':_0x3912fa,'appKey':_0x5b15a4}));var _0x4497ce=fs[_0xf42f('0x12')](_0x1ee173);_0x4497ce['on'](_0xf42f('0x13'),function(_0x502d3b){_0xef847c[_0xf42f('0x11')](_0x502d3b);});_0x4497ce['on'](_0xf42f('0x14'),function(){_0xef847c[_0xf42f('0x11')](_0xf42f('0x15'));});}catch(_0x5a81af){logger[_0xf42f('0x16')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf42f('0x17')](_0x5a81af));_0xef847c[_0xf42f('0x18')]();}}function _0x43b7bb(_0xb7b1a7){try{if(_0xb7b1a7){var _0x214669=JSON[_0xf42f('0x19')](_0xb7b1a7);switch(_0x214669[_0xf42f('0x1a')]){case 0x0:if(_0x214669[_0xf42f('0x1b')]){if(_0x214669[_0xf42f('0x1b')][_0xf42f('0x1c')]){logger[_0xf42f('0x1d')](_0xf42f('0x1e'),JSON[_0xf42f('0x17')](_0x214669[_0xf42f('0x1b')][_0xf42f('0x1f')]));_0x918ad2=_0x214669['result'][_0xf42f('0x1f')][0x0][_0xf42f('0x20')];_0x3e6fa=_0x214669[_0xf42f('0x1b')][_0xf42f('0x1f')][0x0]['likelihood'];_0x3d7eaf='0';_0x24a1e4=_0xf42f('0x21');_0xef847c[_0xf42f('0x18')]();}}break;case 0x1:logger[_0xf42f('0x1d')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x3d7eaf='1';_0x24a1e4=_0xf42f('0x9');break;case 0x2:logger[_0xf42f('0x1d')](_0xf42f('0x22'));_0x3d7eaf='2';_0x24a1e4=_0xf42f('0x22');break;case 0x9:logger[_0xf42f('0x1d')](_0xf42f('0x23'));_0x3d7eaf='9';_0x24a1e4=_0xf42f('0x23');break;case 0xa:logger['info'](_0xf42f('0x24'));_0x3d7eaf='10';_0x24a1e4=_0xf42f('0x24');break;case 0xb:logger[_0xf42f('0x1d')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3d7eaf='11';_0x24a1e4=_0xf42f('0x25');}}}catch(_0x4072f2){logger[_0xf42f('0x16')](_0xf42f('0x26'),JSON[_0xf42f('0x17')](_0x4072f2));_0xef847c[_0xf42f('0x18')]();}}function _0x51943f(){logger['info'](_0xf42f('0x27'));_0x340a9b({'transcript':_0x918ad2,'confidence':_0x3e6fa,'status':_0x3d7eaf,'status_message':_0x24a1e4});}function _0x5ae071(_0x46afb9){logger[_0xf42f('0x16')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x46afb9)){logger[_0xf42f('0x16')](_['isObject'](_0x46afb9)?JSON[_0xf42f('0x17')](_0x46afb9):_0x46afb9);}}_0xef847c['on'](_0xf42f('0x28'),_0x5e6e83);_0xef847c['on'](_0xf42f('0x29'),_0x43b7bb);_0xef847c['on'](_0xf42f('0x14'),_0x51943f);_0xef847c['on'](_0xf42f('0x16'),_0x5ae071);});}; \ No newline at end of file +var _0x804b=['close','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','unix','send','stringify','createReadStream','data','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','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','Error\x20Tilde\x20ASR\x20socket','isNil','open','message'];(function(_0x38dea8,_0x336e37){var _0x41ba7e=function(_0xf6ac96){while(--_0xf6ac96){_0x38dea8['push'](_0x38dea8['shift']());}};_0x41ba7e(++_0x336e37);}(_0x804b,0x1e1));var _0xb804=function(_0x571349,_0x17d233){_0x571349=_0x571349-0x0;var _0xd10193=_0x804b[_0x571349];return _0xd10193;};'use strict';var BPromise=require(_0xb804('0x0'));var _=require(_0xb804('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb804('0x2'));var crypto=require('crypto');var logger=require(_0xb804('0x3'))(_0xb804('0x4'));module[_0xb804('0x5')]=function(_0x203ca0,_0x39c06e,_0x2a96c3,_0xc0c815){return new BPromise(function(_0x4f38a1,_0x12fa2c){logger[_0xb804('0x6')]('Tilde\x20URI',_0xc0c815||_0xb804('0x7'));var _0x3a0db1=new WebSocket(_0xc0c815||_0xb804('0x7'),{'perMessageDeflate':![]});var _0xf5db04='';var _0x366c6a='0';var _0x3353b0='1';var _0x16e5de=_0xb804('0x8');function _0x4c7f75(_0x218626){var _0x318cb8=crypto['createHash'](_0xb804('0x9'));_0x318cb8[_0xb804('0xa')](_0x218626);return _0x318cb8[_0xb804('0xb')](_0xb804('0xc'));}function _0x3a78f7(){try{logger[_0xb804('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x4f8e1e=moment()[_0xb804('0xd')]();var _0x2ebffc=_0x4c7f75(_0x4f8e1e+_0x39c06e+_0x2a96c3);_0x3a0db1[_0xb804('0xe')](JSON[_0xb804('0xf')]({'appID':_0x39c06e,'timestamp':_0x4f8e1e,'appKey':_0x2ebffc}));var _0x3a133c=fs[_0xb804('0x10')](_0x203ca0);_0x3a133c['on'](_0xb804('0x11'),function(_0x4d24cf){_0x3a0db1['send'](_0x4d24cf);});_0x3a133c['on']('close',function(){_0x3a0db1[_0xb804('0xe')]('EOS');});}catch(_0xc7273){logger[_0xb804('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0xb804('0xf')](_0xc7273));_0x3a0db1[_0xb804('0x13')]();}}function _0x52b45f(_0x2d0a26){try{if(_0x2d0a26){var _0x166aeb=JSON[_0xb804('0x14')](_0x2d0a26);switch(_0x166aeb[_0xb804('0x15')]){case 0x0:if(_0x166aeb[_0xb804('0x16')]){if(_0x166aeb[_0xb804('0x16')][_0xb804('0x17')]){logger[_0xb804('0x6')](_0xb804('0x18'),JSON['stringify'](_0x166aeb[_0xb804('0x16')][_0xb804('0x19')]));_0xf5db04=_0x166aeb['result']['hypotheses'][0x0][_0xb804('0x1a')];_0x366c6a=_0x166aeb[_0xb804('0x16')][_0xb804('0x19')][0x0][_0xb804('0x1b')];_0x3353b0='0';_0x16e5de=_0xb804('0x1c');_0x3a0db1[_0xb804('0x13')]();}}break;case 0x1:logger[_0xb804('0x6')](_0xb804('0x8'));_0x3353b0='1';_0x16e5de='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xb804('0x6')](_0xb804('0x1d'));_0x3353b0='2';_0x16e5de=_0xb804('0x1d');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3353b0='9';_0x16e5de=_0xb804('0x1e');break;case 0xa:logger[_0xb804('0x6')](_0xb804('0x1f'));_0x3353b0='10';_0x16e5de=_0xb804('0x1f');break;case 0xb:logger[_0xb804('0x6')](_0xb804('0x20'));_0x3353b0='11';_0x16e5de=_0xb804('0x20');}}}catch(_0x2e06ba){logger[_0xb804('0x12')](_0xb804('0x21'),JSON['stringify'](_0x2e06ba));_0x3a0db1[_0xb804('0x13')]();}}function _0x2ca552(){logger[_0xb804('0x6')](_0xb804('0x22'));_0x4f38a1({'transcript':_0xf5db04,'confidence':_0x366c6a,'status':_0x3353b0,'status_message':_0x16e5de});}function _0x7533c3(_0x4bab60){logger['error'](_0xb804('0x23'));if(!_[_0xb804('0x24')](_0x4bab60)){logger['error'](_['isObject'](_0x4bab60)?JSON[_0xb804('0xf')](_0x4bab60):_0x4bab60);}}_0x3a0db1['on'](_0xb804('0x25'),_0x3a78f7);_0x3a0db1['on'](_0xb804('0x26'),_0x52b45f);_0x3a0db1['on'](_0xb804('0x27'),_0x2ca552);_0x3a0db1['on'](_0xb804('0x12'),_0x7533c3);});}; \ 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 9c65bac..b12b1be 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 _0xa17a=['./asr'];(function(_0x53417d,_0x52a621){var _0x4a4380=function(_0x792461){while(--_0x792461){_0x53417d['push'](_0x53417d['shift']());}};_0x4a4380(++_0x52a621);}(_0xa17a,0xbe));var _0xaa17=function(_0x44f1f1,_0x4be4e4){_0x44f1f1=_0x44f1f1-0x0;var _0x1fae61=_0xa17a[_0x44f1f1];return _0x1fae61;};var asr=require(_0xaa17('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x49f4=['./asr','exports'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x49f4,0xa2));var _0x449f=function(_0x454918,_0x1dbc64){_0x454918=_0x454918-0x0;var _0x3a814b=_0x49f4[_0x454918];return _0x3a814b;};var asr=require(_0x449f('0x0'));module[_0x449f('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 66081b7..718243e 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 _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xe706,0xa3));var _0x6e70=function(_0xe74768,_0x4c0bf9){_0xe74768=_0xe74768-0x0;var _0x302e8a=_0xe706[_0xe74768];return _0x302e8a;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x36bc58,_0x27f03c){var _0x4a547e=function(_0x6326c6){while(--_0x6326c6){_0x36bc58['push'](_0x36bc58['shift']());}};_0x4a547e(++_0x27f03c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index dd99403..60b67f3 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 _0xb0b9=['no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariableById','name','getVoiceQueue','getVoiceQueueById','then','catch','getSquareProject','getSquareProjectById','dsn','getUser','getUserById','getTrunk','getSound','getSoundPath','getMailAccount','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','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','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','toString','getAndSetVariable','getVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','minutes','callback_priority','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','out','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','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','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','Smtp','bcc','debug','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block'];(function(_0x419a45,_0x34b2b1){var _0x13d057=function(_0x13fbbe){while(--_0x13fbbe){_0x419a45['push'](_0x419a45['shift']());}};_0x13d057(++_0x34b2b1);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x533b04,_0xa232cc){_0x533b04=_0x533b04-0x0;var _0xb82ff5=_0xb0b9[_0x533b04];return _0xb82ff5;};'use strict';var fs=require('fs');var util=require(_0x9b0b('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x9b0b('0x1'))();var rs=require(_0x9b0b('0x2'));var moment=require(_0x9b0b('0x3'));var Mustache=require(_0x9b0b('0x4'));var rp=require(_0x9b0b('0x5'));var logger=require(_0x9b0b('0x6'))(_0x9b0b('0x7'));var config=require(_0x9b0b('0x8'));var scripts=require(_0x9b0b('0x9'));var FILES_PATH=_0x9b0b('0xa');var recursiveMapAttributes=[_0x9b0b('0xb'),_0x9b0b('0xc')];var verticesWithRetry=[_0x9b0b('0xd'),_0x9b0b('0xe'),'getsecretdigits'];var AGIVertices=function(_0x537d6e,_0xf14325,_0x40c5e6){this[_0x9b0b('0xf')]=_0x537d6e;this[_0x9b0b('0x10')]=_0xf14325;this[_0x9b0b('0x11')]=_0x40c5e6;};AGIVertices[_0x9b0b('0x12')]['getVariable']=function(_0x426bc4,_0x44c7e0){this[_0x9b0b('0x10')][_0x9b0b('0x13')](_0x426bc4)['then'](function(_0x5da6e7){_0x44c7e0(null,_0x5da6e7?_0x5da6e7[_0x9b0b('0x14')]:![]);})['catch'](function(_0x283336){_0x44c7e0(_0x283336);});};AGIVertices['prototype'][_0x9b0b('0x15')]=function(_0x2f82ab,_0x5d9ffb){this['rpc'][_0x9b0b('0x16')](_0x2f82ab)[_0x9b0b('0x17')](function(_0x104d64){_0x5d9ffb(null,_0x104d64?_0x104d64['name']:![]);})[_0x9b0b('0x18')](function(_0x377736){_0x5d9ffb(_0x377736);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x19')]=function(_0x4665d8,_0x12f1b9){this[_0x9b0b('0x10')][_0x9b0b('0x1a')](_0x4665d8)[_0x9b0b('0x17')](function(_0xcab079){_0x12f1b9(null,_0xcab079?_0xcab079[_0x9b0b('0x14')]:![]);})[_0x9b0b('0x18')](function(_0x3334e5){_0x12f1b9(_0x3334e5);});};AGIVertices[_0x9b0b('0x12')]['getSquareOdbc']=function(_0x155301,_0xee66f5){this[_0x9b0b('0x10')]['getSquareOdbcById'](_0x155301)[_0x9b0b('0x17')](function(_0x20df69){_0xee66f5(null,_0x20df69?_0x20df69[_0x9b0b('0x1b')]:![]);})['catch'](function(_0x3f19ae){_0xee66f5(_0x3f19ae);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x1c')]=function(_0x16c8f9,_0x4fe0a2){this[_0x9b0b('0x10')][_0x9b0b('0x1d')](_0x16c8f9)['then'](function(_0x1b93d9){_0x4fe0a2(null,_0x1b93d9?_0x1b93d9[_0x9b0b('0x14')]:![]);})[_0x9b0b('0x18')](function(_0x16b413){_0x4fe0a2(_0x16b413);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x1e')]=function(_0x17d333,_0x322a0b){this[_0x9b0b('0x10')]['getTrunkById'](_0x17d333)[_0x9b0b('0x17')](function(_0x22a136){_0x322a0b(null,_0x22a136?_0x22a136[_0x9b0b('0x14')]:![]);})[_0x9b0b('0x18')](function(_0x5bbbff){_0x322a0b(_0x5bbbff);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x1f')]=function(_0x5c9ec3,_0x2841fc){var _0x1e25fb=this;this[_0x9b0b('0x10')]['getSoundById'](_0x5c9ec3)[_0x9b0b('0x17')](function(_0xa4f392){_0x2841fc(null,_0xa4f392?_0x1e25fb[_0x9b0b('0x20')](_0xa4f392['save_name']):![]);})[_0x9b0b('0x18')](function(_0x32668d){_0x2841fc(_0x32668d);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x21')]=function(_0x5b1590,_0x347f76){this[_0x9b0b('0x10')]['getMailAccountById'](_0x5b1590)[_0x9b0b('0x17')](function(_0x32cde1){_0x347f76(null,_0x32cde1?_0x32cde1:![]);})[_0x9b0b('0x18')](function(_0x976095){_0x347f76(_0x976095);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x22')]=function(_0xfd6ce,_0xdd08df,_0x4ef44d){this['mailRpc'][_0x9b0b('0x22')](_0xfd6ce,_0xdd08df)['then'](function(){_0x4ef44d(null);})[_0x9b0b('0x18')](function(_0x584215){_0x4ef44d(_0x584215);});};AGIVertices['prototype']['getIntervals']=function(_0x40e4c3,_0xbe43a8){this[_0x9b0b('0x10')][_0x9b0b('0x23')](_0x40e4c3)[_0x9b0b('0x17')](function(_0x141b8a){if(_0x141b8a){if(_0x141b8a[_0x9b0b('0x24')]){_0xbe43a8(null,[_0x141b8a[_0x9b0b('0x25')]]);}else{_0xbe43a8(null,_[_0x9b0b('0x26')](_0x141b8a[_0x9b0b('0x27')],_0x9b0b('0x25')));}}else{_0xbe43a8(null,![]);}})[_0x9b0b('0x18')](function(_0x3b3d74){_0xbe43a8(_0x3b3d74);});};AGIVertices['prototype'][_0x9b0b('0x20')]=function(_0x3a49ee){return util[_0x9b0b('0x28')](_0x9b0b('0x29'),FILES_PATH,_0x3a49ee);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x2a')]=function(_0x1f4d21,_0xe06c58,_0x37007e){odbc[_0x9b0b('0x2b')](_0x1f4d21,function(_0x37569e){if(_0x37569e){logger[_0x9b0b('0x2c')](_0x9b0b('0x2d'),_0x37569e);_0x37007e(_0x37569e);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x9b0b('0x2e')](_0xe06c58,function(_0x8cfe7c,_0xe60dec){if(_0x8cfe7c){logger[_0x9b0b('0x2f')](_0x9b0b('0x30'),_0xe06c58);_0x37007e(_0x8cfe7c);}else{logger['info'](_0x9b0b('0x31'),_0xe06c58);odbc[_0x9b0b('0x32')](function(_0x24cee7){if(_0x24cee7){logger[_0x9b0b('0x2c')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x24cee7);}_0x37007e(null,_0xe60dec);});}});}});};AGIVertices['prototype'][_0x9b0b('0x33')]=function(_0x509632,_0x223dab){this[_0x9b0b('0x10')][_0x9b0b('0x34')](_0x509632)[_0x9b0b('0x17')](function(_0x334621){_0x223dab(null,_0x334621?_0x334621:![]);})[_0x9b0b('0x18')](function(_0x4486ed){_0x223dab(_0x4486ed);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x35')]=function(_0x34b1a9,_0x1ae7f9){this[_0x9b0b('0x10')][_0x9b0b('0x35')](_0x34b1a9)[_0x9b0b('0x17')](function(_0xef0a28){_0x1ae7f9(null,_0xef0a28);})['catch'](function(_0x5123f4){_0x1ae7f9(_0x5123f4);});};AGIVertices['prototype'][_0x9b0b('0x36')]=function(_0x42d7e3,_0x1522a1,_0x424d9b){this[_0x9b0b('0x10')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x9b0b('0x37')],'node':_0x42d7e3[_0x9b0b('0x38')],'application':_0x42d7e3[_0x9b0b('0x39')],'data':_0x1522a1||null,'project_name':this[_0x9b0b('0xf')]['arg_1'],'callerid':this[_0x9b0b('0xf')][_0x9b0b('0x3a')]})[_0x9b0b('0x17')](function(_0x173049){if(_0x424d9b){_0x424d9b(null,_0x173049);}})[_0x9b0b('0x18')](function(_0x5c86ba){if(_0x424d9b){_0x424d9b(_0x5c86ba);}});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x3b')]=function(_0x32a6de,_0x4479fd,_0x14e8a2,_0x1a4dbb){this[_0x9b0b('0x10')][_0x9b0b('0x3b')]({'uniqueid':this['channel']['uniqueid'],'callerid':this['channel'][_0x9b0b('0x3a')],'calleridname':this[_0x9b0b('0xf')][_0x9b0b('0x3c')],'context':this[_0x9b0b('0xf')][_0x9b0b('0x3d')],'extension':this[_0x9b0b('0xf')][_0x9b0b('0x3e')],'priority':this[_0x9b0b('0xf')][_0x9b0b('0x3f')],'accountcode':this[_0x9b0b('0xf')][_0x9b0b('0x40')],'dnid':this['channel'][_0x9b0b('0x41')],'projectName':this[_0x9b0b('0xf')]['arg_1'],'saveName':_0x4479fd,'filename':_0x32a6de['file']||_0x4479fd,'savePath':_0x14e8a2})[_0x9b0b('0x17')](function(_0x990950){_0x1a4dbb(null,_0x990950);})[_0x9b0b('0x18')](function(_0x1ea242){_0x1a4dbb(_0x1ea242);});};AGIVertices['prototype'][_0x9b0b('0x42')]=function(_0x348444,_0x3eeb0c,_0x2ed8b4,_0x21f4c1,_0x1bfdca){this[_0x9b0b('0x10')][_0x9b0b('0x42')]({'uniqueid':this[_0x9b0b('0xf')]['uniqueid'],'body':_0x348444,'direction':_0x3eeb0c,'providerName':_0x2ed8b4,'providerResponse':_0x21f4c1})[_0x9b0b('0x17')](function(_0x5383d9){if(_0x1bfdca){_0x1bfdca(null,_0x5383d9);}})[_0x9b0b('0x18')](function(_0x5eb636){if(_0x1bfdca){_0x1bfdca(_0x5eb636);}});};AGIVertices['prototype'][_0x9b0b('0x43')]=function(_0x2238d1,_0x369752){this[_0x9b0b('0x10')][_0x9b0b('0x43')]({'firstName':_[_0x9b0b('0x44')](_0x2238d1[_0x9b0b('0x14')])||_['isNil'](_0x2238d1['name'])?'callback_'+Math[_0x9b0b('0x45')]():_0x2238d1[_0x9b0b('0x14')],'lastName':_[_0x9b0b('0x44')](_0x2238d1[_0x9b0b('0x46')])||_[_0x9b0b('0x47')](_0x2238d1[_0x9b0b('0x46')])?null:_0x2238d1['lastName'],'phone':_0x2238d1[_0x9b0b('0x48')],'ListId':_0x2238d1[_0x9b0b('0x49')],'scheduledat':_0x2238d1['scheduledAt'],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x9b0b('0x4a'),'description':_0x9b0b('0x4b')+_0x2238d1['scheduledAt']['toString'](),'priority':_0x2238d1['callback_priority']})[_0x9b0b('0x17')](function(_0x2d8637){_0x369752(null,_0x2d8637);})[_0x9b0b('0x18')](function(_0xbb7844){_0x369752(_0xbb7844);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x4c')]=function(_0x15d02e,_0x12b729){this[_0x9b0b('0x10')][_0x9b0b('0x4d')](_0x15d02e)[_0x9b0b('0x17')](function(_0x4a2fbd){_0x12b729(null,_0x4a2fbd?_0x4a2fbd[_0x9b0b('0x14')]:![]);})[_0x9b0b('0x18')](function(_0x55c997){_0x12b729(_0x55c997);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x4e')]=function(_0x49ca3a,_0x2a92b9,_0x16f879){var _0x28a8d4={'role':_0x9b0b('0x4f')};_0x28a8d4[_0x49ca3a]=this[_0x9b0b('0xf')]['callerid'];this[_0x9b0b('0x10')][_0x9b0b('0x4e')](_0x28a8d4,_0x2a92b9,this[_0x9b0b('0xf')][_0x9b0b('0x37')])['then'](function(_0x4928b1){_0x16f879(null,_[_0x9b0b('0x47')](_0x4928b1)?![]:!![]);})[_0x9b0b('0x18')](function(_0x5a431b){logger['error'](_0x5a431b);_0x16f879(null,![]);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x50')]=function(_0xc58f86,_0x44bafa){var _0x36654a={'role':_0x9b0b('0x4f')};_0x36654a[_0xc58f86]=this[_0x9b0b('0xf')][_0x9b0b('0x3a')];this['rpc'][_0x9b0b('0x50')](_0x36654a)[_0x9b0b('0x17')](function(_0x112a53){_0x44bafa(null,_[_0x9b0b('0x47')](_0x112a53)?![]:!![]);})['catch'](function(_0xd6545){logger['error'](_0xd6545);_0x44bafa(null,![]);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x51')]=function(_0x387310,_0x269991){var _0x43ca1c={'role':'agent'};_0x43ca1c[_0x387310]=this[_0x9b0b('0xf')][_0x9b0b('0x3a')];this[_0x9b0b('0x10')][_0x9b0b('0x51')](_0x43ca1c)['then'](function(_0x2b2196){_0x269991(null,_[_0x9b0b('0x47')](_0x2b2196)?![]:!![]);})[_0x9b0b('0x18')](function(_0x444e90){logger[_0x9b0b('0x2c')](_0x444e90);_0x269991(null,![]);});};AGIVertices['prototype'][_0x9b0b('0x52')]=function(_0x667604,_0x51914d){var _0x217268={'role':_0x9b0b('0x4f')};_0x217268[_0x667604]=this[_0x9b0b('0xf')][_0x9b0b('0x3a')];var _0x3b69a4=_0x667604!=_0x9b0b('0x53')?util[_0x9b0b('0x28')](_0x9b0b('0x54'),_0x9b0b('0x55'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')]):undefined;this[_0x9b0b('0x10')][_0x9b0b('0x52')](_0x217268,_0x3b69a4)['then'](function(_0x46f73b){_0x51914d(null,_[_0x9b0b('0x47')](_0x46f73b)?![]:!![]);})['catch'](function(_0x4c0bd3){logger[_0x9b0b('0x2c')](_0x4c0bd3);_0x51914d(null,![]);});};AGIVertices['prototype'][_0x9b0b('0x56')]=function(_0x1b14ba,_0x3024e6){sh[_0x9b0b('0x57')](_[_0x9b0b('0x58')](_0x1b14ba),function(_0x404729,_0x58f90b){var _0x2cda79=_0x58f90b[_0x9b0b('0x59')](/(\r\n|\n|\r)/gm,'');_0x3024e6(null,_0x2cda79);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x5a')]=function(_0x3858e8,_0x732298){scripts[_0x9b0b('0x5a')](_0x3858e8[_0x9b0b('0x5b')],_0x3858e8[_0x9b0b('0x5c')]||_0x9b0b('0x5d'),_0x3858e8[_0x9b0b('0x5d')],_0x3858e8[_0x9b0b('0x5e')]||_0x9b0b('0x5f'),_0x3858e8[_0x9b0b('0x60')]||'MALE',_0x3858e8[_0x9b0b('0x61')]||_0x9b0b('0x62'))[_0x9b0b('0x17')](function(_0x1b232b){_0x732298(null,_0x1b232b);})[_0x9b0b('0x18')](function(_0x2f0c43){_0x732298(_0x2f0c43);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x63')]=function(_0x44e368,_0x127ee4){scripts[_0x9b0b('0x63')](_0x44e368['text'],_0x44e368[_0x9b0b('0x64')]||'en',0x1)[_0x9b0b('0x17')](function(_0x5f30bd){_0x127ee4(null,_0x5f30bd);})['catch'](function(_0x34ff91){_0x127ee4(_0x34ff91);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x65')]=function(_0x181679,_0x2da02b){var _0x3852ea={'uri':_0x181679['url'],'method':_0x181679[_0x9b0b('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x181679[_0x9b0b('0x67')])===_0x9b0b('0x68')&&parseInt(_0x181679['timeout'])>=0x1?parseInt(_0x181679['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x9b0b('0x69')]([_0x9b0b('0x6a'),_0x9b0b('0x6b')],_0x3852ea[_0x9b0b('0x66')][_0x9b0b('0x6c')]())){try{_0x3852ea[_0x9b0b('0x6d')]=_0x181679['rawBody']?JSON['parse'](_0x181679['rawBody']):{};}catch(_0x581f7b){logger[_0x9b0b('0x2c')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x581f7b);}}try{_0x3852ea[_0x9b0b('0x6e')]=_0x181679[_0x9b0b('0xb')]?JSON[_0x9b0b('0x6f')](_0x181679[_0x9b0b('0xb')]):{};}catch(_0x2efcc3){logger[_0x9b0b('0x2c')](_0x9b0b('0x70'),_0x2efcc3);}if(_0x181679[_0x9b0b('0x71')]){try{var _0x5690bf=require(_0x181679[_0x9b0b('0x71')])['sync'](this,_0x3852ea);_0x3852ea[_0x9b0b('0x72')]=Mustache[_0x9b0b('0x73')](_0x181679[_0x9b0b('0x74')],_0x5690bf,{},['$$','$$']);if(_0x3852ea[_0x9b0b('0x6e')]){_0x3852ea[_0x9b0b('0x6e')]=JSON[_0x9b0b('0x6f')](Mustache[_0x9b0b('0x73')](JSON[_0x9b0b('0x75')](_0x3852ea[_0x9b0b('0x6e')]),_0x5690bf,{},['$$','$$']));}if(_0x3852ea[_0x9b0b('0x6d')]){_0x3852ea[_0x9b0b('0x6d')]=JSON[_0x9b0b('0x6f')](Mustache['render'](JSON[_0x9b0b('0x75')](_0x3852ea[_0x9b0b('0x6d')]),_0x5690bf,{},['$$','$$']));}}catch(_0x54d704){logger['error'](_0x9b0b('0x76'),_0x54d704);}}rp(_0x3852ea)[_0x9b0b('0x17')](function(_0x14973f){var _0x5c67ab={'statusCode':_0x14973f[_0x9b0b('0x77')]||0xc8,'statusMessage':_0x14973f[_0x9b0b('0x78')]||'OK','headers':_0x14973f['headers']||{},'body':_0x14973f[_0x9b0b('0x6d')]||{}};_0x2da02b(null,_0x5c67ab);})[_0x9b0b('0x18')](function(_0x41c149){var _0x548b2f={'statusCode':_0x41c149[_0x9b0b('0x77')]||0x1f4,'statusMessage':_0x41c149[_0x9b0b('0x79')]||_0x9b0b('0x7a'),'headers':_0x41c149['options'][_0x9b0b('0x6e')]||{},'body':_0x41c149[_0x9b0b('0x7b')]['body']||{}};_0x2da02b(null,_0x548b2f);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x7c')]=function(_0x221873,_0x2a1efa){scripts[_0x9b0b('0x7c')](this[_0x9b0b('0xf')][_0x9b0b('0x37')],_0x221873[_0x9b0b('0x7d')],_0x221873[_0x9b0b('0x5d')],_0x221873['dialogflow_language']||'en')[_0x9b0b('0x17')](function(_0x409ca1){_0x2a1efa(null,_0x409ca1);})[_0x9b0b('0x18')](function(_0x2a8c01){_0x2a1efa(_0x2a8c01);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x7e')]=function(_0x43e3a3,_0x45c3f1){scripts[_0x9b0b('0x7e')](this[_0x9b0b('0xf')]['uniqueid'],_0x43e3a3[_0x9b0b('0x7f')],_0x43e3a3[_0x9b0b('0x80')],_0x43e3a3['private_key'],_0x43e3a3[_0x9b0b('0x5d')],_0x43e3a3[_0x9b0b('0x81')]||'en')[_0x9b0b('0x17')](function(_0x5e9e82){_0x45c3f1(null,_0x5e9e82);})['catch'](function(_0x55d723){_0x45c3f1(_0x55d723);});};AGIVertices['prototype'][_0x9b0b('0x82')]=function(_0x2cbb96,_0x384052){scripts[_0x9b0b('0x82')](this[_0x9b0b('0xf')],_0x2cbb96)['then'](function(_0x153311){_0x384052(null,_0x153311);})[_0x9b0b('0x18')](function(_0xb4e29b){_0x384052(_0xb4e29b);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x83')]=function(_0x5025a0,_0x4e2ac4){scripts[_0x9b0b('0x83')](_0x5025a0[_0x9b0b('0x7d')],_0x5025a0[_0x9b0b('0x5d')],_0x5025a0[_0x9b0b('0x84')]||_0x9b0b('0x5f'),_0x5025a0['speed'])[_0x9b0b('0x17')](function(_0x503cb2){_0x4e2ac4(null,_0x503cb2);})[_0x9b0b('0x18')](function(_0xc8dae3){_0x4e2ac4(_0xc8dae3);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x85')]=function(_0x47fe30,_0x93cf44,_0x5997a4){scripts['ispeechASR'](_0x93cf44,_0x47fe30[_0x9b0b('0x7d')],_0x47fe30[_0x9b0b('0x86')]||_0x9b0b('0x5f'),this['isConfigured'](_0x47fe30[_0x9b0b('0x87')])?_0x47fe30[_0x9b0b('0x87')]:undefined)[_0x9b0b('0x17')](function(_0x3277e2){_0x5997a4(null,_0x3277e2);})['catch'](function(_0x174960){_0x5997a4(_0x174960);});};AGIVertices[_0x9b0b('0x12')]['awsPolly']=function(_0x1c017d,_0x263177){scripts[_0x9b0b('0x88')](_0x1c017d[_0x9b0b('0x89')],_0x1c017d[_0x9b0b('0x8a')],_0x1c017d[_0x9b0b('0x8b')],_0x1c017d[_0x9b0b('0x8c')]||_0x9b0b('0x8d'),_0x1c017d[_0x9b0b('0x5d')],_0x1c017d[_0x9b0b('0x8e')]||_0x9b0b('0x5d'))[_0x9b0b('0x17')](function(_0x1f1cf5){_0x263177(null,_0x1f1cf5);})['catch'](function(_0xf6e8b2){_0x263177(_0xf6e8b2);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x8f')]=function(_0x589014,_0x39bfcd){scripts[_0x9b0b('0x8f')](this[_0x9b0b('0xf')][_0x9b0b('0x37')],_0x589014[_0x9b0b('0x89')],_0x589014[_0x9b0b('0x8a')],_0x589014[_0x9b0b('0x90')],_0x589014[_0x9b0b('0x5d')],_0x589014['aws_bot_name'])[_0x9b0b('0x17')](function(_0x4f4b63){_0x39bfcd(null,_0x4f4b63);})[_0x9b0b('0x18')](function(_0x32e43f){_0x39bfcd(_0x32e43f);});};AGIVertices[_0x9b0b('0x12')]['googleASR']=function(_0x124a85,_0x581baa,_0x3db963){scripts[_0x9b0b('0x91')](_0x581baa,_0x124a85[_0x9b0b('0x7d')],_0x124a85[_0x9b0b('0x92')]||'en-US')[_0x9b0b('0x17')](function(_0x1fa8b3){_0x3db963(null,_0x1fa8b3);})[_0x9b0b('0x18')](function(_0x105a58){_0x3db963(_0x105a58);});};AGIVertices[_0x9b0b('0x12')]['tildeASR']=function(_0x3beefe,_0x64399d,_0x338587){scripts[_0x9b0b('0x93')](_0x64399d,_0x3beefe[_0x9b0b('0x94')],_0x3beefe[_0x9b0b('0x95')],_0x3beefe[_0x9b0b('0x72')])[_0x9b0b('0x17')](function(_0x299e60){_0x338587(null,_0x299e60);})[_0x9b0b('0x18')](function(_0x51fe92){_0x338587(_0x51fe92);});};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x96')]=function(_0x352c6c){var _0x81f51d=_[_0x9b0b('0x69')](verticesWithRetry,_0x352c6c[_0x9b0b('0x39')])?_0x352c6c:_[_0x9b0b('0x97')](_0x352c6c);for(var _0x453c36 in _0x81f51d){if(_0x81f51d[_0x9b0b('0x98')](_0x453c36)){if(_0x81f51d[_0x453c36]&&_[_0x9b0b('0x99')](_0x81f51d[_0x453c36])){if(_['includes'](recursiveMapAttributes,_0x453c36)){_0x81f51d[_0x453c36]=this[_0x9b0b('0x9a')](_0x81f51d[_0x453c36]);}else{_0x81f51d[_0x453c36]=this[_0x9b0b('0x9b')](_0x81f51d[_0x453c36]);}}}}return _0x81f51d;};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x9c')]=function(_0x23c6ef){for(var _0x4b29a6 in _0x23c6ef){if(_0x23c6ef[_0x9b0b('0x98')](_0x4b29a6)){if(_[_0x9b0b('0x9d')](_0x23c6ef[_0x4b29a6])){this[_0x9b0b('0x9c')](_0x23c6ef[_0x4b29a6]);}else if(_[_0x9b0b('0x9e')](_0x23c6ef[_0x4b29a6])){for(var _0x589a79=0x0;_0x589a79<_0x23c6ef[_0x4b29a6][_0x9b0b('0x9f')];_0x589a79++){this[_0x9b0b('0x9c')](_0x23c6ef[_0x4b29a6][_0x589a79]);}}else if(_[_0x9b0b('0x99')](_0x23c6ef[_0x4b29a6])){_0x23c6ef[_0x4b29a6]=this[_0x9b0b('0x9b')](_0x23c6ef[_0x4b29a6]);}}}};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xa0')]=function(_0x380090,_0x2c6839){for(var _0x3a8e04 in _0x380090){if(_0x380090[_0x9b0b('0x98')](_0x3a8e04)){if(_['isPlainObject'](_0x380090[_0x3a8e04])){if(!_[_0x9b0b('0x44')](_0x380090[_0x3a8e04])){this[_0x9b0b('0xa0')](_0x380090[_0x3a8e04],util[_0x9b0b('0x28')](_0x9b0b('0xa1'),_0x2c6839,_0x3a8e04));}}else if(_['isArray'](_0x380090[_0x3a8e04])){for(var _0x2272bb=0x0;_0x2272bb<_0x380090[_0x3a8e04]['length'];_0x2272bb++){this[_0x9b0b('0xa0')](_0x380090[_0x3a8e04][_0x2272bb],util[_0x9b0b('0x28')](_0x9b0b('0xa1'),_0x2c6839,_0x3a8e04+'['+_0x2272bb+']'));}}else{if(!_['isNil'](_0x380090[_0x3a8e04])){this['channel'][_0x9b0b('0xa2')](util[_0x9b0b('0x28')](_0x9b0b('0xa1'),_0x2c6839,_0x3a8e04),_0x380090[_0x3a8e04]);}}}}};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x9a')]=function(_0xaa4202){try{var _0x554fe6=JSON['parse'](_0xaa4202);this['recursiveNodeIndex'](_0x554fe6);return JSON['stringify'](_0x554fe6);}catch(_0x14547e){return this[_0x9b0b('0x9b')](_0xaa4202);}};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x9b')]=function(_0xc1d278){var _0x200a42=_0xc1d278['split']('{');for(var _0x509144=0x1;_0x509144<_0x200a42[_0x9b0b('0x9f')];_0x509144+=0x1){var _0x127b16=_0x200a42[_0x509144][_0x9b0b('0xa3')]('}');if(_0x127b16[_0x9b0b('0x9f')]>0x1){_0xc1d278=_0xc1d278[_0x9b0b('0xa4')]('{'+_0x127b16[0x0]+'}',this[_0x9b0b('0xf')]['getVariable'](_0x127b16[0x0])[_0x9b0b('0xa5')]||_0x127b16[0x0]);}}if(_0x200a42[_0x9b0b('0x9f')]===0x1){return _0xc1d278[_0x9b0b('0xa6')]();}return this['replaceAllVariables'](_0xc1d278);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xa7')]=function(_0x1463e1,_0x3be1b4){var _0x14117c=this[_0x9b0b('0xf')][_0x9b0b('0xa8')](_0x1463e1);if(_0x14117c['result']===-0x1){return _0x14117c;}logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0xa9'),_0x3be1b4,_0x14117c[_0x9b0b('0xa5')]));return this['channel'][_0x9b0b('0xa2')](_0x3be1b4,_0x14117c['extra']);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xaa')]=function(_0x2538be){return _0x2538be&&_0x2538be!=='0'&&_0x2538be!=='-1'&&_0x2538be!=='';};AGIVertices['prototype'][_0x9b0b('0xab')]=function(_0x5897d8){this[_0x9b0b('0x36')]['sync'](this,_0x5897d8,'-');_0x5897d8['retry']=_0x5897d8['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x166da9){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0xac'),_0x166da9[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x166da9['text'])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xae'));}var _0x54c3ca='\x22'+_0x166da9[_0x9b0b('0x5d')]+'\x22';if(this['isConfigured'](_0x166da9[_0x9b0b('0x7b')])){_0x54c3ca+=','+_0x166da9[_0x9b0b('0x7b')];}var _0x24efb4=this[_0x9b0b('0xf')][_0x9b0b('0x57')](_0x9b0b('0xaf'),_0x54c3ca);if(_0x24efb4[_0x9b0b('0xb0')]===-0x1){return _0x24efb4;}return this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x54c3ca));};AGIVertices['prototype'][_0x9b0b('0xb1')]=function(_0x4a6ae1){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0xb2'),_0x4a6ae1[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x4a6ae1[_0x9b0b('0xb3')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')]('no\x20grammar\x20configured');}var _0x2c6312=_0x4a6ae1[_0x9b0b('0xb3')];if(this['isConfigured'](_0x4a6ae1[_0x9b0b('0x7b')])){_0x2c6312+=','+_0x4a6ae1[_0x9b0b('0x7b')];}var _0x19acf8=this[_0x9b0b('0xf')][_0x9b0b('0x57')](_0x9b0b('0xb4'),_0x2c6312);if(_0x19acf8[_0x9b0b('0xb0')]===-0x1){return _0x19acf8;}var _0x5b66fb=this['getAndSetVariable'](_0x9b0b('0xb5'),_0x9b0b('0xb6'));if(_0x5b66fb['result']===-0x1){return _0x5b66fb;}var _0x8efee7=this[_0x9b0b('0xa7')](_0x9b0b('0xb7'),_0x9b0b('0xb8'));if(_0x8efee7['result']===-0x1){return _0x8efee7;}var _0x4d2ac9=this['getAndSetVariable'](_0x9b0b('0xb9'),_0x9b0b('0xba'));if(_0x4d2ac9[_0x9b0b('0xb0')]===-0x1){return _0x4d2ac9;}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util['format'](_0x9b0b('0xbb'),_0x2c6312));};AGIVertices[_0x9b0b('0x12')]['agi']=function(_0x117f52){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0xbc'),_0x117f52[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')][_0x9b0b('0x7')]([_0x117f52[_0x9b0b('0xbd')],_0x117f52[_0x9b0b('0xbe')]]);};AGIVertices['prototype'][_0x9b0b('0xbf')]=function(_0x4319e0){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4319e0[_0x9b0b('0x38')]));if(this['isConfigured'](_0x4319e0[_0x9b0b('0x67')])){logger['info'](util['format'](_0x9b0b('0xc0'),_0x4319e0['timeout']));var _0x33aa00=this['channel'][_0x9b0b('0xc1')](_0x4319e0[_0x9b0b('0x67')]);if(_0x33aa00['result']===-0x1){return _0x33aa00;}}return this['channel'][_0x9b0b('0xbf')]();};AGIVertices[_0x9b0b('0x12')]['callback']=function(_0x4f1b7b){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0xc2'),_0x4f1b7b['label']));if(!this['isConfigured'](_0x4f1b7b['list_id'])){return this[_0x9b0b('0xf')]['error'](_0x4f1b7b,_0x9b0b('0xc3'));}_0x4f1b7b[_0x9b0b('0xc4')]=moment();if(this[_0x9b0b('0xaa')](_0x4f1b7b[_0x9b0b('0xc5')])){_0x4f1b7b[_0x9b0b('0xc4')]=moment()['add'](_0x4f1b7b[_0x9b0b('0xc5')],_0x9b0b('0xc6'));}if(!this['isConfigured'](_0x4f1b7b[_0x9b0b('0xc7')])){_0x4f1b7b['callback_priority']=0x2;}this[_0x9b0b('0x43')][_0x9b0b('0xc8')](this,_0x4f1b7b);return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xc9'),_0x4f1b7b[_0x9b0b('0x48')],_0x4f1b7b['list_id'],_0x4f1b7b[_0x9b0b('0xc4')]));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xca')]=function(_0x49dbe5){logger['info'](util[_0x9b0b('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x49dbe5['label']));var _0x45d980=this[_0x9b0b('0xf')][_0x9b0b('0x57')](_0x49dbe5[_0x9b0b('0xcb')],_0x49dbe5[_0x9b0b('0x7b')]);if(_0x45d980[_0x9b0b('0xb0')]===-0x1){return _0x45d980;}return this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')](_0x9b0b('0xcc'),_0x49dbe5[_0x9b0b('0xcb')],_0x49dbe5[_0x9b0b('0x7b')]));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xcd')]=function(_0xb7cecf){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0xce'),_0xb7cecf[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0xb7cecf['text'])){return this['channel'][_0x9b0b('0xad')](_0x9b0b('0xae'));}var _0x41e8d2='\x22'+_0xb7cecf[_0x9b0b('0x5d')]+'\x22';if(this[_0x9b0b('0xaa')](_0xb7cecf[_0x9b0b('0x7b')])){_0x41e8d2+=','+_0xb7cecf[_0x9b0b('0x7b')];}var _0x5937fc=this[_0x9b0b('0xf')][_0x9b0b('0x57')]('MRCPSynth',_0x41e8d2);if(_0x5937fc[_0x9b0b('0xb0')]===-0x1){return _0x5937fc;}return this[_0x9b0b('0xf')]['noop'](util['format'](_0x9b0b('0xcf'),_0x41e8d2));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xd0')]=function(_0x547aba){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0xd1'),_0x547aba[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x547aba[_0x9b0b('0x5d')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xae'));}var _0x5d5412='\x22'+_0x547aba[_0x9b0b('0x5d')]+'\x22';if(this[_0x9b0b('0xaa')](_0x547aba['options'])){_0x5d5412+=','+_0x547aba[_0x9b0b('0x7b')];}var _0xcd343=this[_0x9b0b('0xf')][_0x9b0b('0x57')](_0x9b0b('0xaf'),_0x5d5412);if(_0xcd343[_0x9b0b('0xb0')]===-0x1){return _0xcd343;}return this[_0x9b0b('0xf')]['noop'](util['format'](_0x9b0b('0xcf'),_0x5d5412));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xd2')]=function(_0x257605){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0xd3'),_0x257605[_0x9b0b('0x38')]));if(!this['isConfigured'](_0x257605['grammar'])){return this['channel'][_0x9b0b('0xad')]('no\x20grammar\x20configured');}var _0xcbeec4=_0x257605[_0x9b0b('0xb3')];if(this[_0x9b0b('0xaa')](_0x257605[_0x9b0b('0x7b')])){_0xcbeec4+=','+_0x257605[_0x9b0b('0x7b')];}var _0x5cae0b=this[_0x9b0b('0xf')]['exec'](_0x9b0b('0xb4'),_0xcbeec4);if(_0x5cae0b['result']===-0x1){return _0x5cae0b;}var _0x1fbfdd=this[_0x9b0b('0xa7')](_0x9b0b('0xb5'),_0x9b0b('0xd4'));if(_0x1fbfdd[_0x9b0b('0xb0')]===-0x1){return _0x1fbfdd;}var _0x3fbb66=this['getAndSetVariable'](_0x9b0b('0xb7'),_0x9b0b('0xd5'));if(_0x3fbb66['result']===-0x1){return _0x3fbb66;}var _0x2e551a=this[_0x9b0b('0xa7')](_0x9b0b('0xb9'),'LUMENVOX_ASR_INSTANCE');if(_0x2e551a[_0x9b0b('0xb0')]===-0x1){return _0x2e551a;}return this['channel'][_0x9b0b('0xad')](util['format'](_0x9b0b('0xbb'),_0xcbeec4));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xd6')]=function(_0x213a31){logger['info'](util[_0x9b0b('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x213a31[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x213a31[_0x9b0b('0xb3')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xd7'));}var _0x1b9c29=_0x213a31[_0x9b0b('0xb3')];if(this['isConfigured'](_0x213a31[_0x9b0b('0x7b')])){_0x1b9c29+=','+_0x213a31['options'];}var _0x1aaddf=this[_0x9b0b('0xf')][_0x9b0b('0x57')]('MRCPRecog',_0x1b9c29);if(_0x1aaddf[_0x9b0b('0xb0')]===-0x1){return _0x1aaddf;}var _0x4a4017=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9b0b('0xd8'));if(_0x4a4017['result']===-0x1){return _0x4a4017;}var _0x276d22=this['getAndSetVariable']('RECOG_INPUT()',_0x9b0b('0xd9'));if(_0x276d22[_0x9b0b('0xb0')]===-0x1){return _0x276d22;}var _0x352d82=this[_0x9b0b('0xa7')](_0x9b0b('0xb9'),'SESTEK_ASR_INSTANCE');if(_0x352d82[_0x9b0b('0xb0')]===-0x1){return _0x352d82;}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xbb'),_0x1b9c29));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xda')]=function(_0x459584){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0xdb'),_0x459584[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x459584[_0x9b0b('0xdc')])){return this['channel'][_0x9b0b('0x2c')](_0x459584,_0x9b0b('0xdd'));}var _0x4b31ee=this[_0x9b0b('0xde')][_0x9b0b('0xc8')](this,_0x459584[_0x9b0b('0xdc')]);if(!_0x4b31ee){return this['channel'][_0x9b0b('0x2c')](_0x459584,'no\x20odbc\x20database\x20found');}if(!this[_0x9b0b('0xaa')](_0x459584[_0x9b0b('0x2e')])){return this[_0x9b0b('0xf')]['error'](_0x459584,_0x9b0b('0xdf'));}var _0x54a5ea=_0x459584['query'][_0x9b0b('0x59')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xe0'),_0x54a5ea));var _0x2b6ec7=this[_0x9b0b('0x2a')][_0x9b0b('0xc8')](this,_0x4b31ee,_0x54a5ea);this[_0x9b0b('0x36')]['sync'](this,_0x459584,_0x54a5ea);if(!this['isConfigured'](_0x459584[_0x9b0b('0xe1')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xe2'));}var _0x3e77e9=this[_0x9b0b('0xa8')][_0x9b0b('0xc8')](this,_0x459584[_0x9b0b('0xe1')]);if(!_0x3e77e9){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x459584,'no\x20variable\x20found');}var _0x4d2554=this;_0x2b6ec7[_0x9b0b('0xe3')](function(_0x549c75,_0x370851){Object[_0x9b0b('0xe4')](_0x549c75)[_0x9b0b('0xe3')](function(_0x1b2660){_0x4d2554[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')](_0x9b0b('0xe5'),_0x3e77e9,_0x370851,_0x1b2660),_0x549c75[_0x1b2660]);});});this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')](_0x9b0b('0xe6'),_0x3e77e9),_0x2b6ec7['length']);return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('variable\x20%s\x20set',_0x3e77e9));};AGIVertices[_0x9b0b('0x12')]['dial']=function(_0x4642bf){logger['debug'](util['format'](_0x9b0b('0xe7'),_0x4642bf[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x4642bf[_0x9b0b('0xe8')])){return this[_0x9b0b('0xf')]['error'](_0x4642bf,_0x9b0b('0xe9'));}var _0x58c334=this['getUser']['sync'](this,_0x4642bf['sip_id']);if(!_0x58c334){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x4642bf,_0x9b0b('0xea'));}var _0x3944e0=this[_0x9b0b('0xf')]['exec']('DIAL',[util[_0x9b0b('0x28')](_0x9b0b('0xeb'),_0x58c334),_0x4642bf[_0x9b0b('0x67')],_0x4642bf[_0x9b0b('0xec')],_0x4642bf[_0x9b0b('0x74')]]);if(_0x3944e0[_0x9b0b('0xb0')]===-0x1){return _0x3944e0;}return this['channel'][_0x9b0b('0xad')](util['format'](_0x9b0b('0xed'),_0x9b0b('0xee')));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xef')]=function(_0x59bf6a){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0xf0'),_0x59bf6a['label']));if(!this['isConfigured'](_0x59bf6a['key'])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x59bf6a[_0x9b0b('0x5d')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x9b0b('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x59bf6a);this[_0x9b0b('0x42')](_0x59bf6a[_0x9b0b('0x5d')],'in','','');this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xf1'),_0x59bf6a['text']));var _0x5d3019=this[_0x9b0b('0x7c')][_0x9b0b('0xc8')](this,_0x59bf6a);if(_0x5d3019){for(var _0x41e2b1 in _0x5d3019){if(_0x5d3019[_0x9b0b('0x98')](_0x41e2b1)){this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util['format']('DIALOGFLOW_%s',_0x41e2b1[_0x9b0b('0x6c')]()),_0x5d3019[_0x41e2b1]);}}this[_0x9b0b('0x42')](_0x5d3019['speech'],_0x9b0b('0xf2'),_0x9b0b('0xef'),'');return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('Dialogflow\x20Result\x20%s',_0x5d3019[_0x9b0b('0xf3')]));}return this[_0x9b0b('0xf')]['error'](_0x59bf6a,_0x9b0b('0xf4'));};AGIVertices[_0x9b0b('0x12')]['dialogflowV2']=function(_0x210fa6){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0xf5'),_0x210fa6['label']));if(!this[_0x9b0b('0xaa')](_0x210fa6[_0x9b0b('0x7f')])){return this['channel'][_0x9b0b('0xad')](_0x9b0b('0xf6'));}if(!this[_0x9b0b('0xaa')](_0x210fa6[_0x9b0b('0x80')])){return this[_0x9b0b('0xf')]['noop'](_0x9b0b('0xf7'));}if(!this[_0x9b0b('0xaa')](_0x210fa6[_0x9b0b('0xf8')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xf9'));}if(!this[_0x9b0b('0xaa')](_0x210fa6[_0x9b0b('0x81')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xfa'));}if(!this['isConfigured'](_0x210fa6[_0x9b0b('0x5d')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xae'));}this[_0x9b0b('0xf')][_0x9b0b('0xfb')]=!![];this['createSquareDetailsReport'](_0x210fa6);this[_0x9b0b('0x42')](_0x210fa6[_0x9b0b('0x5d')],'in','','');this['channel']['noop'](util[_0x9b0b('0x28')](_0x9b0b('0xfc'),_0x210fa6[_0x9b0b('0x5d')]));var _0x116ada=this[_0x9b0b('0x7e')][_0x9b0b('0xc8')](this,_0x210fa6);if(_0x116ada){for(var _0x41a621 in _0x116ada){if(_0x116ada['hasOwnProperty'](_0x41a621)){if(_0x41a621!=='providerResponse'){this['channel'][_0x9b0b('0xa2')](util[_0x9b0b('0x28')](_0x9b0b('0xfd'),_0x41a621[_0x9b0b('0x6c')]()),_0x116ada[_0x41a621]);}}}this[_0x9b0b('0x42')](_0x116ada['speech'],_0x9b0b('0xf2'),_0x9b0b('0xfe'),_0x116ada['providerResponse']);return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xff'),_0x116ada[_0x9b0b('0xf3')]));}return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x210fa6,_0x9b0b('0x100'));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x101')]=function(_0x29d66e){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x102'),_0x29d66e[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x29d66e[_0x9b0b('0x103')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x104'));}if(!this[_0x9b0b('0xaa')](_0x29d66e[_0x9b0b('0x105')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x106'));}if(!this[_0x9b0b('0xaa')](_0x29d66e[_0x9b0b('0x107')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')]('no\x20password\x20configured');}if(!this[_0x9b0b('0xaa')](_0x29d66e[_0x9b0b('0x108')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xae'));}this[_0x9b0b('0xf')][_0x9b0b('0xfb')]=!![];this[_0x9b0b('0x36')](_0x29d66e);this['createSquareMessage'](_0x29d66e[_0x9b0b('0x5d')],'in','','');this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x109'),_0x29d66e['text']));var _0x55a74e=this[_0x9b0b('0x82')][_0x9b0b('0xc8')](this,_0x29d66e);if(_0x55a74e){for(var _0xc08a0f in _0x55a74e){if(_0x55a74e[_0x9b0b('0x98')](_0xc08a0f)){this['channel'][_0x9b0b('0xa2')](util[_0x9b0b('0x28')]('SESTEK_NDA_%s',_0xc08a0f[_0x9b0b('0x6c')]()),_0x55a74e[_0xc08a0f]);}}this[_0x9b0b('0x42')](_0x55a74e[_0x9b0b('0xf3')],_0x9b0b('0xf2'),_0x9b0b('0x101'),'');if(_0x55a74e['audiofile']){this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x10a'),_0x55a74e[_0x9b0b('0x10b')]));var _0x2e692a=this[_0x9b0b('0xf')]['streamFile'](_0x55a74e[_0x9b0b('0x10b')]);try{fs[_0x9b0b('0x10c')](_0x55a74e[_0x9b0b('0x10b')]+_0x9b0b('0x10d'));}catch(_0x10377d){logger[_0x9b0b('0x2c')](_0x10377d);}return _0x2e692a;}else{return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x10e'),_0x55a74e[_0x9b0b('0xf3')]));}}return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x29d66e,_0x9b0b('0x10f'));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x110')]=function(_0x795f40){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x111'),_0x795f40[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')]['noop'](_0x9b0b('0x110'));};AGIVertices['prototype'][_0x9b0b('0x112')]=function(_0xa0b1a0){logger['info'](util[_0x9b0b('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xa0b1a0[_0x9b0b('0x38')]));var _0xf10b35='';if(_0xa0b1a0[_0x9b0b('0x113')]){if(!this[_0x9b0b('0xaa')](_0xa0b1a0[_0x9b0b('0x113')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0xa0b1a0,_0x9b0b('0x114'));}else{var _0x252b21=parseInt(_0xa0b1a0[_0x9b0b('0x113')],0xa);if(isNaN(_0x252b21)){_0xf10b35=_0xa0b1a0['trunk_id'];}else{_0xf10b35=this[_0x9b0b('0x1e')][_0x9b0b('0xc8')](this,_0xa0b1a0[_0x9b0b('0x113')]);if(!_0xf10b35){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0xa0b1a0,'no\x20trunk\x20found');}}}}else if(_0xa0b1a0[_0x9b0b('0x115')]){_0xf10b35=_0xa0b1a0[_0x9b0b('0x115')];}else{return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0xa0b1a0,_0x9b0b('0x114'));}var _0x3db6ae=this[_0x9b0b('0xf')][_0x9b0b('0x57')](_0x9b0b('0xee'),[util[_0x9b0b('0x28')]('SIP/%s/%s',_0xf10b35,_0xa0b1a0['phone']),_0xa0b1a0[_0x9b0b('0x67')],_0xa0b1a0[_0x9b0b('0xec')],_0xa0b1a0[_0x9b0b('0x74')]]);if(_0x3db6ae[_0x9b0b('0xb0')]===-0x1){return _0x3db6ae;}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xed'),_0x9b0b('0xee')));};AGIVertices[_0x9b0b('0x12')]['finally']=function(_0x4484a2){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x116'),_0x4484a2[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x117'));};AGIVertices['prototype'][_0x9b0b('0xe')]=function(_0x1e5bdb){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x118'),_0x1e5bdb[_0x9b0b('0x38')]));if(_0x1e5bdb[_0x9b0b('0x119')]===0x0){return this[_0x9b0b('0xab')](_0x1e5bdb);}_0x1e5bdb[_0x9b0b('0x119')]-=0x1;if(!this[_0x9b0b('0xaa')](_0x1e5bdb['file_id'])){return this['channel'][_0x9b0b('0x2c')](_0x1e5bdb,_0x9b0b('0x11a'));}var _0x19e3be=this[_0x9b0b('0x1f')][_0x9b0b('0xc8')](this,_0x1e5bdb['file_id']);if(!_0x19e3be){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x1e5bdb,_0x9b0b('0x11b'));}if(!this[_0x9b0b('0xaa')](_0x1e5bdb[_0x9b0b('0xe1')])){return this[_0x9b0b('0xf')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1d4049=this[_0x9b0b('0xf')][_0x9b0b('0x11c')](_0x19e3be,_0x1e5bdb[_0x9b0b('0x11d')],_0x1e5bdb[_0x9b0b('0x11e')]);var _0x1fafb=_0x1d4049[_0x9b0b('0xb0')]?_0x1d4049[_0x9b0b('0xb0')][_0x9b0b('0xa6')]():'';logger[_0x9b0b('0x2f')]('test',JSON[_0x9b0b('0x75')](_0x1d4049));if(_0x1d4049[_0x9b0b('0xb0')]===-0x1){this[_0x9b0b('0x36')][_0x9b0b('0xc8')](this,_0x1e5bdb,_0x1fafb);return _0x1d4049;}else if(_0x1d4049['extra']===_0x9b0b('0x67')){_0x1d4049[_0x9b0b('0xb0')]=_0x1fafb['length']>=parseInt(_0x1e5bdb['mindigit'])?'x':'i';}else{_0x1d4049['result']=_0x1fafb[_0x9b0b('0x9f')]>=parseInt(_0x1e5bdb[_0x9b0b('0x11f')])&&_0x1fafb[_0x9b0b('0x9f')]<=parseInt(_0x1e5bdb[_0x9b0b('0x11e')])?'x':'i';}var _0x480716=this['getVariable'][_0x9b0b('0xc8')](this,_0x1e5bdb[_0x9b0b('0xe1')]);if(!_0x480716){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x1e5bdb,_0x9b0b('0x120'));}this[_0x9b0b('0xf')][_0x9b0b('0xa2')](_0x480716,_0x1fafb);if(this[_0x9b0b('0xaa')](_0x1e5bdb[_0x9b0b('0x121')])){var _0x38a83d=parseInt(_0x1e5bdb[_0x9b0b('0x121')],0xa);var _0x4319fb=rs[_0x9b0b('0x122')]({'charset':'*','length':_0x38a83d});var _0x446901=_0x1fafb[_0x9b0b('0x9f')];if(_0x446901>0x0){if(_0x446901>_0x38a83d){this[_0x9b0b('0x36')][_0x9b0b('0xc8')](this,_0x1e5bdb,_0x1e5bdb[_0x9b0b('0x123')]===_0x9b0b('0x124')?_0x4319fb+_0x1fafb[_0x9b0b('0x125')](_0x38a83d):_0x1fafb[_0x9b0b('0x125')](0x0,_0x446901-_0x38a83d)+_0x4319fb);}else{this[_0x9b0b('0x36')]['sync'](this,_0x1e5bdb,rs[_0x9b0b('0x122')]({'charset':'*','length':_0x446901}));}}else{this[_0x9b0b('0x36')]['sync'](this,_0x1e5bdb,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x1e5bdb,_0x1fafb);}return _0x1d4049;};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x126')]=function(_0x125b16){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x127'),_0x125b16[_0x9b0b('0x38')]));return this[_0x9b0b('0xe')](_0x125b16);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x128')]=function(_0x58f5f3){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x129'),_0x58f5f3[_0x9b0b('0x38')]));this[_0x9b0b('0x36')][_0x9b0b('0xc8')](this,_0x58f5f3,_0x58f5f3['goalname']);return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x12a'),_0x58f5f3[_0x9b0b('0x12b')]));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x12c')]=function(_0x252fb6){logger['info'](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x252fb6[_0x9b0b('0x38')]));if(!this['isConfigured'](_0x252fb6[_0x9b0b('0x89')])||!this['isConfigured'](_0x252fb6[_0x9b0b('0x8a')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x12d'));}if(!this[_0x9b0b('0xaa')](_0x252fb6[_0x9b0b('0x5d')])){return this['channel'][_0x9b0b('0xad')](_0x9b0b('0xae'));}this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x12e'),_0x252fb6[_0x9b0b('0x5d')]));var _0x7284d2=this[_0x9b0b('0x88')][_0x9b0b('0xc8')](this,_0x252fb6);if(_0x7284d2){this[_0x9b0b('0xf')]['noop'](util['format'](_0x9b0b('0x12f'),_0x7284d2));var _0x5e66a0=this[_0x9b0b('0xf')][_0x9b0b('0x130')](_0x7284d2);try{fs[_0x9b0b('0x10c')](_0x7284d2+_0x9b0b('0x10d'));}catch(_0xe66fca){logger[_0x9b0b('0x2c')](_0xe66fca);}return _0x5e66a0;}return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x252fb6,_0x9b0b('0x131'));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x132')]=function(_0x2a88ba){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0x133'),_0x2a88ba[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x2a88ba[_0x9b0b('0x89')])||!this[_0x9b0b('0xaa')](_0x2a88ba[_0x9b0b('0x8a')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x12d'));}if(!this[_0x9b0b('0xaa')](_0x2a88ba[_0x9b0b('0x134')])){return this[_0x9b0b('0xf')]['noop']('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x2a88ba[_0x9b0b('0x5d')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')]('no\x20text\x20configured');}this[_0x9b0b('0xf')]['bot']=!![];this[_0x9b0b('0x36')](_0x2a88ba);this['createSquareMessage'](_0x2a88ba[_0x9b0b('0x5d')],'in','','');this['channel']['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x135'),_0x2a88ba[_0x9b0b('0x5d')]));var _0x241fee=this[_0x9b0b('0x8f')][_0x9b0b('0xc8')](this,_0x2a88ba);if(_0x241fee){for(var _0x377909 in _0x241fee){if(_0x241fee[_0x9b0b('0x98')](_0x377909)&&_[_0x9b0b('0x99')](_0x241fee[_0x377909])){this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')](_0x9b0b('0x136'),_0x377909[_0x9b0b('0x6c')]()),_0x241fee[_0x377909]);}}if(_[_0x9b0b('0x47')](_0x241fee[_0x9b0b('0x79')])){return this['channel'][_0x9b0b('0xad')](_0x9b0b('0x137'));}else{this[_0x9b0b('0x42')](_0x241fee[_0x9b0b('0x79')],_0x9b0b('0xf2'),_0x9b0b('0x138'),'');return this['channel'][_0x9b0b('0xad')](util['format'](_0x9b0b('0x139'),_0x241fee[_0x9b0b('0x79')]));}}return this[_0x9b0b('0xf')]['error'](_0x2a88ba,_0x9b0b('0x13a'));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x13b')]=function(_0x3c3513){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x13c'),_0x3c3513[_0x9b0b('0x38')],_0x3c3513[_0x9b0b('0x67')]));if(!this['isConfigured'](_0x3c3513[_0x9b0b('0x7d')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x13d'));}var _0x272ee7=_0x9b0b('0x13e');var _0x403b58=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x9b0b('0x122')](0x4));var _0x25b64e=util[_0x9b0b('0x28')](_0x9b0b('0xa1'),_0x403b58,_0x272ee7);var _0x4972cf=!![];if(_0x3c3513[_0x9b0b('0x13f')]===_0x9b0b('0x140')){_0x4972cf=![];}var _0x237dca=this[_0x9b0b('0xf')][_0x9b0b('0x141')](_0x403b58,_0x272ee7,_0x3c3513[_0x9b0b('0x142')],_0x3c3513[_0x9b0b('0x67')],undefined,_0x4972cf);if(_0x237dca[_0x9b0b('0xb0')]!==-0x1){this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x143'),_0x25b64e));var _0x22a68f=this[_0x9b0b('0x91')]['sync'](this,_0x3c3513,_0x25b64e);if(_0x22a68f){for(var _0x49b34e in _0x22a68f){if(_0x22a68f[_0x9b0b('0x98')](_0x49b34e)){this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')]('GOOGLE_ASR_%s',_0x49b34e[_0x9b0b('0x6c')]()),_0x22a68f[_0x49b34e]);}}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util['format'](_0x9b0b('0x144'),JSON[_0x9b0b('0x75')](_0x22a68f)));}}return _0x237dca;};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x145')]=function(_0x57974a){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x146'),_0x57974a['label']));if(!this[_0x9b0b('0xaa')](_0x57974a[_0x9b0b('0x94')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x147'));}if(!this[_0x9b0b('0xaa')](_0x57974a[_0x9b0b('0x95')])){return this['channel'][_0x9b0b('0xad')]('no\x20appsecret\x20configured');}var _0x5e903d=_0x9b0b('0x13e');var _0x547240=util['format'](_0x9b0b('0x148'),FILES_PATH,rs[_0x9b0b('0x122')](0x4));var _0x3312d9=util[_0x9b0b('0x28')](_0x9b0b('0xa1'),_0x547240,_0x5e903d);var _0x880bb=!![];if(_0x57974a['beep']==='NOBEEP'){_0x880bb=![];}var _0x23b85b=this[_0x9b0b('0xf')][_0x9b0b('0x141')](_0x547240,_0x5e903d,_0x57974a[_0x9b0b('0x142')],_0x57974a['timeout'],undefined,_0x880bb);if(_0x23b85b[_0x9b0b('0xb0')]!==-0x1){this['channel'][_0x9b0b('0xad')](util['format'](_0x9b0b('0x149'),_0x3312d9));var _0x22d7df=this['tildeASR'][_0x9b0b('0xc8')](this,_0x57974a,_0x3312d9);if(_0x22d7df){for(var _0x5b3db5 in _0x22d7df){if(_0x22d7df['hasOwnProperty'](_0x5b3db5)){this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')](_0x9b0b('0x14a'),_0x5b3db5[_0x9b0b('0x6c')]()),_0x22d7df[_0x5b3db5]);}}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('TildeASR\x20Result\x20%s',JSON[_0x9b0b('0x75')](_0x22d7df)));}}return _0x23b85b;};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x14b')]=function(_0x2cc129){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x14c'),_0x2cc129[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')]['continueAt'](_0x2cc129[_0x9b0b('0x3d')],_0x2cc129[_0x9b0b('0x3e')],_0x2cc129[_0x9b0b('0x3f')]);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x14d')]=function(_0x3882fe){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x14e'),_0x3882fe[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x3882fe['condition'])){return this['channel']['error'](_0x3882fe,_0x9b0b('0x14f'));}try{var _0x20667e=eval(_0x3882fe['condition'])?_0x9b0b('0x150'):'false';this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x151'),_0x3882fe['condition'],_0x20667e));return{'code':0xc8,'result':_0x20667e};}catch(_0x511f99){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x9b0b('0x12')]['gotoiftime']=function(_0x16c7e5){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x152'),_0x16c7e5[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x16c7e5[_0x9b0b('0x153')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x16c7e5,_0x9b0b('0x154'));}var _0x5944b4=this[_0x9b0b('0x155')]['sync'](this,_0x16c7e5[_0x9b0b('0x153')]);if(!_0x5944b4){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x16c7e5,_0x9b0b('0x156'));}for(var _0x3e3c0f=0x0;_0x3e3c0f<_0x5944b4['length'];_0x3e3c0f+=0x1){var _0x2bfd1f=this['channel'][_0x9b0b('0xa8')](util[_0x9b0b('0x28')](_0x9b0b('0x157'),_0x5944b4[_0x3e3c0f]));if(_0x2bfd1f[_0x9b0b('0xb0')]===-0x1){return _0x2bfd1f;}logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x158'),_0x5944b4[_0x3e3c0f],_0x2bfd1f[_0x9b0b('0xa5')]));if(_0x2bfd1f[_0x9b0b('0xa5')]===_0x9b0b('0x150')){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x158'),_0x5944b4[_0x3e3c0f],_0x9b0b('0x150')));this[_0x9b0b('0xf')][_0x9b0b('0xad')](util['format']('IFTIME\x20%s\x20%s',_0x5944b4[_0x3e3c0f],'true'));return{'code':0xc8,'result':_0x9b0b('0x150')};}else{logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x158'),_0x5944b4[_0x3e3c0f],_0x9b0b('0x159')));this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x158'),_0x5944b4[_0x3e3c0f],'false'));}}return{'code':0xc8,'result':_0x9b0b('0x159')};};AGIVertices[_0x9b0b('0x12')]['hangup']=function(_0x12c6c1){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x15a'),_0x12c6c1[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')][_0x9b0b('0x15b')]();};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x15c')]=function(_0x4745d7){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x15d'),_0x4745d7[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x4745d7[_0x9b0b('0x7d')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x13d'));}var _0x512713=_0x9b0b('0x13e');var _0x552b6a=util[_0x9b0b('0x28')](_0x9b0b('0x148'),FILES_PATH,rs[_0x9b0b('0x122')](0x4));var _0x35479a=util[_0x9b0b('0x28')](_0x9b0b('0xa1'),_0x552b6a,_0x512713);var _0x4bedda=!![];if(_0x4745d7[_0x9b0b('0x13f')]===_0x9b0b('0x140')){_0x4bedda=![];}var _0x2de1d2=this[_0x9b0b('0xf')][_0x9b0b('0x141')](_0x552b6a,_0x512713,_0x4745d7[_0x9b0b('0x142')],_0x4745d7['timeout'],undefined,_0x4bedda);if(_0x2de1d2[_0x9b0b('0xb0')]!==-0x1){this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x15e'),_0x35479a));var _0x3c50e0=this[_0x9b0b('0x85')][_0x9b0b('0xc8')](this,_0x4745d7,_0x35479a);if(_0x3c50e0){for(var _0x4295b6 in _0x3c50e0){if(_0x3c50e0['hasOwnProperty'](_0x4295b6)){this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')]('ISPEECH_ASR_%s',_0x4295b6['toUpperCase']()),_0x3c50e0[_0x4295b6]);}}return this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('IspeechASR\x20Result\x20%s',JSON[_0x9b0b('0x75')](_0x3c50e0)));}}return _0x2de1d2;};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x15f')]=function(_0x4a1bb4){logger['info'](util[_0x9b0b('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x4a1bb4[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x4a1bb4[_0x9b0b('0x7d')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x13d'));}if(!this[_0x9b0b('0xaa')](_0x4a1bb4['text'])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')]('no\x20text\x20configured');}this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x160'),_0x4a1bb4[_0x9b0b('0x5d')]));var _0x1b7b14=this[_0x9b0b('0x83')]['sync'](this,_0x4a1bb4);if(_0x1b7b14){this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x15e'),_0x1b7b14));var _0x2722f6=this[_0x9b0b('0xf')]['streamFile'](_0x1b7b14,_0x4a1bb4['intKey']);try{fs['unlink'](_0x1b7b14+_0x9b0b('0x10d'));}catch(_0x3f6854){logger[_0x9b0b('0x2c')](_0x3f6854);}return _0x2722f6;}return this['channel'][_0x9b0b('0x2c')](_0x4a1bb4,_0x9b0b('0x161'));};AGIVertices['prototype'][_0x9b0b('0x162')]=function(_0x235b89){logger['info'](util[_0x9b0b('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x235b89[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x235b89['findBy'])){return this['channel'][_0x9b0b('0x2c')](_0x235b89,_0x9b0b('0x163'));}logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x164'),this[_0x9b0b('0xf')]['callerid'],_0x235b89[_0x9b0b('0x165')]));var _0x125012=this[_0x9b0b('0x52')][_0x9b0b('0xc8')](this,_0x235b89['findBy']);if(_0x125012){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x166'),this['channel'][_0x9b0b('0x3a')],_0x235b89[_0x9b0b('0x165')]));this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x166'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x235b89['findBy']));return{'code':0xc8,'result':_0x9b0b('0x167')};}else{logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x168'),this[_0x9b0b('0xf')]['callerid'],_0x235b89[_0x9b0b('0x165')]));this[_0x9b0b('0xf')][_0x9b0b('0xad')](util['format'](_0x9b0b('0x168'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x235b89[_0x9b0b('0x165')]));return{'code':0xc8,'result':_0x9b0b('0x169')};}};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x16a')]=function(_0x18b0a4){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x16b'),_0x18b0a4['label']));if(!this[_0x9b0b('0xaa')](_0x18b0a4[_0x9b0b('0x165')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x18b0a4,_0x9b0b('0x163'));}logger['info'](util['format'](_0x9b0b('0x164'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x18b0a4['findBy']));var _0xc466c9=this[_0x9b0b('0x51')][_0x9b0b('0xc8')](this,_0x18b0a4[_0x9b0b('0x165')]);if(_0xc466c9){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x166'),this[_0x9b0b('0xf')]['callerid'],_0x18b0a4[_0x9b0b('0x165')]));this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x166'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x18b0a4[_0x9b0b('0x165')]));return{'code':0xc8,'result':_0x9b0b('0x167')};}else{logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x168'),this['channel'][_0x9b0b('0x3a')],_0x18b0a4[_0x9b0b('0x165')]));this[_0x9b0b('0xf')][_0x9b0b('0xad')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x18b0a4[_0x9b0b('0x165')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x16c')]=function(_0x2a81c5){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x16d'),_0x2a81c5[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x2a81c5[_0x9b0b('0x16e')])){return this['channel'][_0x9b0b('0x2c')](_0x2a81c5,_0x9b0b('0x16f'));}this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x170'),_0x2a81c5[_0x9b0b('0x16e')]));var _0x576337=eval(_0x2a81c5[_0x9b0b('0x16e')]);if(!this[_0x9b0b('0xaa')](_0x2a81c5['variable_id'])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0xe2'));}var _0x50071f=this[_0x9b0b('0xa8')][_0x9b0b('0xc8')](this,_0x2a81c5[_0x9b0b('0xe1')]);if(!_0x50071f){return this[_0x9b0b('0xf')]['error'](_0x2a81c5,_0x9b0b('0x120'));}if(_[_0x9b0b('0x9e')](_0x576337)){var _0x7726c2=this;_0x576337[_0x9b0b('0xe3')](function(_0x49a69a,_0x126f26){_0x7726c2[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')]('%s[%s]',_0x50071f,_0x126f26),_0x49a69a);});return this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x171'),_0x50071f));}else{return this[_0x9b0b('0xf')]['setVariable'](_0x50071f,_0x576337);}};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xd')]=function(_0x5b2213){logger['info'](util['format'](_0x9b0b('0x172'),_0x5b2213[_0x9b0b('0x38')]));if(_0x5b2213['retry']===0x0){return this[_0x9b0b('0xab')](_0x5b2213);}_0x5b2213[_0x9b0b('0x119')]-=0x1;if(!this[_0x9b0b('0xaa')](_0x5b2213[_0x9b0b('0x173')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x5b2213,_0x9b0b('0x11a'));}var _0xb519c2=this[_0x9b0b('0x1f')][_0x9b0b('0xc8')](this,_0x5b2213['file_id']);if(!_0xb519c2){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x5b2213,_0x9b0b('0x11b'));}var _0x3bcbcf=this[_0x9b0b('0xf')][_0x9b0b('0x11c')](_0xb519c2,_0x5b2213[_0x9b0b('0x11d')],_0x5b2213[_0x9b0b('0x174')]);var _0xbf9a76=_0x3bcbcf[_0x9b0b('0xb0')];if(_0x3bcbcf['result']===-0x1){this[_0x9b0b('0x36')]['sync'](this,_0x5b2213,'-1');return _0x3bcbcf;}else if(_0x3bcbcf[_0x9b0b('0xa5')]===_0x9b0b('0x67')){_0x3bcbcf['result']=_0x3bcbcf[_0x9b0b('0xb0')][_0x9b0b('0x9f')]>0x0?_0x3bcbcf['result']:'t';}else if(_[_0x9b0b('0x44')](_0x3bcbcf[_0x9b0b('0xb0')])){_0x3bcbcf['result']='#';_0xbf9a76='#';}if(!this['isConfigured'](_0x5b2213[_0x9b0b('0xe1')])){this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x54d0ba=this['getVariable'][_0x9b0b('0xc8')](this,_0x5b2213[_0x9b0b('0xe1')]);if(!_0x54d0ba){return this[_0x9b0b('0xf')]['error'](_0x5b2213,_0x9b0b('0x120'));}this[_0x9b0b('0xf')][_0x9b0b('0xa2')](_0x54d0ba,_0xbf9a76);}this[_0x9b0b('0x36')]['sync'](this,_0x5b2213,_0xbf9a76);return _0x3bcbcf;};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0xad')]=function(_0x1263fe){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x175'),_0x1263fe[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x1263fe['output']||_0x1263fe[_0x9b0b('0x38')]);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x176')]=function(_0x59130a){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0x177'),_0x59130a[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x59130a[_0x9b0b('0x165')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x59130a,_0x9b0b('0x163'));}logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x164'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x59130a[_0x9b0b('0x165')]));var _0x69a016=this[_0x9b0b('0x4c')][_0x9b0b('0xc8')](this,_0x59130a['pause_id']);var _0x41c33e=this[_0x9b0b('0x4e')]['sync'](this,_0x59130a[_0x9b0b('0x165')],_0x69a016);if(_0x41c33e){logger['info'](util[_0x9b0b('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x9b0b('0x3a')],_0x59130a[_0x9b0b('0x165')]));this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9b0b('0xf')]['callerid'],_0x59130a['findBy']));return{'code':0xc8,'result':_0x9b0b('0x167')};}else{logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x168'),this[_0x9b0b('0xf')]['callerid'],_0x59130a['findBy']));this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x166'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x59130a[_0x9b0b('0x165')]));return{'code':0xc8,'result':_0x9b0b('0x169')};}};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x178')]=function(_0x16e97d){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x179'),_0x16e97d['label']));if(!this[_0x9b0b('0xaa')](_0x16e97d[_0x9b0b('0x173')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x16e97d,_0x9b0b('0x11a'));}var _0x47ba2d=this[_0x9b0b('0x1f')][_0x9b0b('0xc8')](this,_0x16e97d['file_id']);if(!_0x47ba2d){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x16e97d,'no\x20file\x20audio\x20found');}var _0x3ad2d5=this[_0x9b0b('0xf')][_0x9b0b('0x57')](_0x9b0b('0x17a'),[_0x47ba2d,_0x16e97d['opts']]);if(_0x3ad2d5[_0x9b0b('0xb0')]===-0x1){return _0x3ad2d5;}return this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('Executed\x20command\x20%s\x20%s',_0x9b0b('0x17a'),_0x47ba2d));};AGIVertices[_0x9b0b('0x12')]['queue']=function(_0x3c97f8){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x17b'),_0x3c97f8['label']));if(!this[_0x9b0b('0xaa')](_0x3c97f8['queue_id'])){return this[_0x9b0b('0xf')]['error'](_0x3c97f8,'no\x20queue\x20selected');}var _0x1666ac='';var _0xd02abd=parseInt(_0x3c97f8[_0x9b0b('0x17c')],0xa);if(isNaN(_0xd02abd)){_0x1666ac=_0x3c97f8[_0x9b0b('0x17c')];}else{_0x1666ac=this[_0x9b0b('0x15')][_0x9b0b('0xc8')](this,_0x3c97f8[_0x9b0b('0x17c')]);if(!_0x1666ac){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x3c97f8,'no\x20queue\x20found');}}var _0x3a4792='';if(this[_0x9b0b('0xaa')](_0x3c97f8['file_id'])){var _0x2cda9e=this[_0x9b0b('0x1f')][_0x9b0b('0xc8')](this,_0x3c97f8[_0x9b0b('0x173')]);if(_0x2cda9e){_0x3a4792=_0x2cda9e;}}this[_0x9b0b('0x36')][_0x9b0b('0xc8')](this,_0x3c97f8,_0x1666ac);if(_0x3c97f8[_0x9b0b('0xec')][_0x9b0b('0x17d')]('x')<0x0){_0x3c97f8[_0x9b0b('0xec')]+='x';}if(_0x3c97f8['opts']['indexOf']('X')<0x0){_0x3c97f8[_0x9b0b('0xec')]+='X';}this[_0x9b0b('0xf')]['setVariable']('XMCS-QUEUE',_0x1666ac?_0x1666ac[_0x9b0b('0x17e')]():'');var _0x5e75e0=this[_0x9b0b('0xf')][_0x9b0b('0x57')](_0x9b0b('0x17f'),[_0x1666ac,_0x3c97f8[_0x9b0b('0xec')],_0x3c97f8['url'],_0x3a4792,_0x3c97f8[_0x9b0b('0x67')],_0x3c97f8[_0x9b0b('0x7')],_0x3c97f8[_0x9b0b('0x180')],_0x3c97f8[_0x9b0b('0x181')],'',_0x3c97f8[_0x9b0b('0x182')]]);if(_0x5e75e0[_0x9b0b('0xb0')]===-0x1){return _0x5e75e0;}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xcc'),_0x9b0b('0x17f'),_0x1666ac));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x183')]=function(_0x201521){logger['info'](util['format'](_0x9b0b('0x184'),_0x201521[_0x9b0b('0x38')]));var _0x2882ad=_0x201521[_0x9b0b('0x185')]||_0x9b0b('0x13e');var _0xb01333=util[_0x9b0b('0x28')]('%s_%s',this[_0x9b0b('0xf')]['uniqueid'],rs['generate'](0x5));var _0x50895c=util[_0x9b0b('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0xb01333,_0x2882ad);var _0xa6cab8=util[_0x9b0b('0x28')](_0x9b0b('0x148'),FILES_PATH,_0xb01333);this[_0x9b0b('0x3b')]['sync'](this,_0x201521,_0xb01333,_0x50895c);this[_0x9b0b('0xf')][_0x9b0b('0xa2')]('RECORDING_SAVENAME',_0xb01333);logger['info'](_0x9b0b('0x186'),_0xa6cab8,_0x2882ad,_0x201521[_0x9b0b('0x187')],_0x201521['timeout']);return this[_0x9b0b('0xf')]['recordFile'](_0xa6cab8,_0x2882ad,_0x201521['escape_digits'],_0x201521[_0x9b0b('0x67')],undefined,!![]);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x188')]=function(_0x24dd40){logger['info'](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x24dd40[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x24dd40[_0x9b0b('0x74')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x189'));}var _0x4392b2=this[_0x9b0b('0x65')][_0x9b0b('0xc8')](this,_0x24dd40);logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x18a'),util[_0x9b0b('0x18b')](_0x4392b2,{'showHidden':![],'depth':null})));if(!this[_0x9b0b('0xaa')](_0x24dd40[_0x9b0b('0xe1')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x2df62a=this[_0x9b0b('0xa8')][_0x9b0b('0xc8')](this,_0x24dd40['variable_id']);if(!_0x2df62a){return this[_0x9b0b('0xf')]['error'](_0x24dd40,'no\x20variable\x20found');}this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')](_0x9b0b('0x18c'),_0x2df62a),_0x4392b2[_0x9b0b('0x77')]?_0x4392b2[_0x9b0b('0x77')]:_0x9b0b('0x18d'));this[_0x9b0b('0xf')][_0x9b0b('0xa2')](util[_0x9b0b('0x28')]('%s_STATUS_MESSAGE',_0x2df62a),_0x4392b2['statusMessage']?_0x4392b2[_0x9b0b('0x78')]:'OK');if(_0x4392b2[_0x9b0b('0x6d')]){try{this[_0x9b0b('0xa0')](_0x4392b2['body'],_0x2df62a);}catch(_0x46995b){logger[_0x9b0b('0x2c')](util[_0x9b0b('0x28')](_0x9b0b('0x18e'),_0x2df62a));}}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x18f'),_0x2df62a));};AGIVertices[_0x9b0b('0x12')]['saydigits']=function(_0xba18b8){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x190'),_0xba18b8[_0x9b0b('0x38')]));return this['channel']['sayDigits'](_0xba18b8['digits']['replace'](/\s+/g,''),_0xba18b8['escape_digits']);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x191')]=function(_0xca793f){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0x192'),_0xca793f[_0x9b0b('0x38')]));return this['channel'][_0x9b0b('0x193')](_0xca793f[_0x9b0b('0x68')][_0x9b0b('0x59')](/\s+/g,''),_0xca793f[_0x9b0b('0x187')]);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x194')]=function(_0x53660f){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x195'),_0x53660f[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')][_0x9b0b('0x196')](_0x53660f['text'],_0x53660f[_0x9b0b('0x187')]);};AGIVertices[_0x9b0b('0x12')]['sendMail']=function(_0xa6ce97){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0x197'),_0xa6ce97[_0x9b0b('0x38')]));if(!this['isConfigured'](_0xa6ce97[_0x9b0b('0x198')])){return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x199'));}var _0x380a01=this[_0x9b0b('0x21')][_0x9b0b('0xc8')](this,_0xa6ce97[_0x9b0b('0x198')]);if(!_0x380a01||!_0x380a01['Smtp']){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0xa6ce97,'no\x20mail\x20account\x20found');}var _0x5d12af={'from':util['format'](_0x9b0b('0x19a'),_0x380a01[_0x9b0b('0x14')],_0x380a01[_0x9b0b('0x19b')]||_0x380a01[_0x9b0b('0x19c')]['user']),'to':_0xa6ce97['to']||'','cc':_0xa6ce97['cc']||'','bcc':_0xa6ce97[_0x9b0b('0x19d')]||'','subject':_0xa6ce97['subject'],'html':_0xa6ce97[_0x9b0b('0x5d')],'text':_0xa6ce97[_0x9b0b('0x5d')]};if(this[_0x9b0b('0xaa')](_0xa6ce97['template_id'])){}logger[_0x9b0b('0x19e')]('sendMail\x20message',JSON[_0x9b0b('0x75')](_0x5d12af));this['createSquareDetailsReport'][_0x9b0b('0xc8')](this,_0xa6ce97,_0xa6ce97[_0x9b0b('0x198')]);this['channel']['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x19f'),_0x380a01[_0x9b0b('0x14')]));this[_0x9b0b('0x22')][_0x9b0b('0xc8')](this,_0x380a01['smtpOptions'],_0x5d12af);return this[_0x9b0b('0xf')]['noop'](_0x9b0b('0x1a0'));};AGIVertices[_0x9b0b('0x12')]['sendFax']=function(_0x340791){logger['info'](util[_0x9b0b('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x340791[_0x9b0b('0x38')]));return this[_0x9b0b('0xf')]['noop'](_0x9b0b('0x1a1'));};AGIVertices['prototype'][_0x9b0b('0x1a2')]=function(_0x562c46){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x1a3'),_0x562c46[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x562c46[_0x9b0b('0x1a4')])){return this[_0x9b0b('0xf')]['noop']('no\x20sms\x20account\x20configured');}var _0x22d722=this[_0x9b0b('0x33')]['sync'](this,_0x562c46[_0x9b0b('0x1a4')]);if(!_0x22d722){return this['channel'][_0x9b0b('0x2c')](_0x562c46,_0x9b0b('0x1a5'));}var _0x57a339={'body':_0x562c46[_0x9b0b('0x1a6')],'phone':_0x562c46['to']||'','SmsAccountId':_0x22d722['id']};logger[_0x9b0b('0x19e')](_0x9b0b('0x1a7'),JSON[_0x9b0b('0x75')](_0x57a339));this[_0x9b0b('0x36')][_0x9b0b('0xc8')](this,_0x562c46,_0x562c46[_0x9b0b('0x1a4')]);this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x1a8'),_0x22d722[_0x9b0b('0x14')]));this[_0x9b0b('0x35')][_0x9b0b('0xc8')](this,_0x57a339);return this['channel'][_0x9b0b('0xad')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x9b0b('0x1a9')]=function(_0x37dd74){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x1aa'),_0x37dd74['label']));if(!this[_0x9b0b('0xaa')](_0x37dd74['variable_id'])){return this['channel'][_0x9b0b('0x2c')](_0x37dd74,_0x9b0b('0x1ab'));}var _0x275b4d=this[_0x9b0b('0xa8')]['sync'](this,_0x37dd74[_0x9b0b('0xe1')]);if(!_0x275b4d){return this['channel'][_0x9b0b('0x2c')](_0x37dd74,_0x9b0b('0x120'));}return this[_0x9b0b('0xf')][_0x9b0b('0xa2')](_0x275b4d,_0x37dd74[_0x9b0b('0x1ac')]);};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x1ad')]=function(_0x370037){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')]('Enter\x20in\x20START\x20(%s)\x20block',_0x370037[_0x9b0b('0x38')]));this[_0x9b0b('0xf')]['noop'](_0x9b0b('0x1ae'));var _0x5881d1=this['channel'][_0x9b0b('0xa8')](_0x9b0b('0x1af'));if(!_[_0x9b0b('0x44')](_0x5881d1[_0x9b0b('0xa5')])){this['channel'][_0x9b0b('0x37')]=_0x5881d1[_0x9b0b('0xa5')];}if(_0x370037[_0x9b0b('0xbf')]===_0x9b0b('0x1b0')){this['channel']['noop'](_0x9b0b('0x1b1'));return this[_0x9b0b('0xf')][_0x9b0b('0xbf')]();}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](_0x9b0b('0x1b2'));};AGIVertices['prototype'][_0x9b0b('0x1b3')]=function(_0x4a0794){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x1b4'),_0x4a0794[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x4a0794[_0x9b0b('0x1b5')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x4a0794,_0x9b0b('0x1b6'));}var _0x2067e4=this[_0x9b0b('0x19')][_0x9b0b('0xc8')](this,_0x4a0794[_0x9b0b('0x1b5')]);if(!this[_0x9b0b('0xaa')](_0x2067e4)){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x4a0794,util[_0x9b0b('0x28')](_0x9b0b('0x1b7'),_0x4a0794[_0x9b0b('0x1b5')]));}if(_0x2067e4===this[_0x9b0b('0xf')][_0x9b0b('0x1b8')]){return this['channel'][_0x9b0b('0x2c')](_0x4a0794,_0x9b0b('0x1b9'));}this[_0x9b0b('0x36')]['sync'](this,_0x4a0794,_0x2067e4);var _0x2d3b3b=this[_0x9b0b('0xf')]['exec'](_0x9b0b('0x1ba'),util[_0x9b0b('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x9b0b('0x1bb')]||_0x9b0b('0x1bc'),_0x2067e4,this[_0x9b0b('0xf')][_0x9b0b('0x1b8')]));if(_0x2d3b3b[_0x9b0b('0xb0')]===-0x1){return _0x2d3b3b;}return this['channel'][_0x9b0b('0xad')](util['format']('Executed\x20command\x20%s\x20%s',_0x9b0b('0x1ba'),_0x2067e4));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x1bd')]=function(_0x3d9a6d){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x1be'),_0x3d9a6d['label']));var _0x4e9d64=this[_0x9b0b('0x56')][_0x9b0b('0xc8')](this,_0x3d9a6d[_0x9b0b('0xbd')]);this[_0x9b0b('0x36')][_0x9b0b('0xc8')](this,_0x3d9a6d,_0x3d9a6d[_0x9b0b('0xbd')]);if(this[_0x9b0b('0xaa')](_0x3d9a6d[_0x9b0b('0xe1')])){var _0x1028d6=this[_0x9b0b('0xa8')][_0x9b0b('0xc8')](this,_0x3d9a6d[_0x9b0b('0xe1')]);if(_0x1028d6){this[_0x9b0b('0xf')][_0x9b0b('0xa2')](_0x1028d6,_0x4e9d64);return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x3d9a6d[_0x9b0b('0xbd')],_0x1028d6));}}return this['channel']['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x1bf'),_0x3d9a6d[_0x9b0b('0xbd')]));};AGIVertices[_0x9b0b('0x12')]['google_cloud_tts']=function(_0x420642){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x1c0'),_0x420642[_0x9b0b('0x38')]));_0x420642[_0x9b0b('0x5d')]=_0x420642['text'][_0x9b0b('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x420642[_0x9b0b('0x5b')])){return this['channel'][_0x9b0b('0xad')](_0x9b0b('0x1c1'));}if(!this[_0x9b0b('0xaa')](_0x420642['text'])){return this[_0x9b0b('0xf')]['noop'](_0x9b0b('0xae'));}this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x1c2'),_0x420642[_0x9b0b('0x5d')]));var _0x247328=this[_0x9b0b('0x5a')][_0x9b0b('0xc8')](this,_0x420642);if(_0x247328){this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x1c3'),_0x247328));var _0x430b1b=this[_0x9b0b('0xf')][_0x9b0b('0x130')](_0x247328);try{fs['unlink'](_0x247328+_0x9b0b('0x10d'));}catch(_0x105bd1){logger[_0x9b0b('0x2c')](_0x105bd1);}return _0x430b1b;}return this[_0x9b0b('0xf')]['error'](_0x420642,_0x9b0b('0x1c4'));};AGIVertices[_0x9b0b('0x12')][_0x9b0b('0x1c5')]=function(_0x1872ee){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x1c6'),_0x1872ee[_0x9b0b('0x38')]));_0x1872ee['text']=_0x1872ee['text'][_0x9b0b('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9b0b('0xaa')](_0x1872ee[_0x9b0b('0x5d')])){return this['channel']['noop'](_0x9b0b('0xae'));}this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0x1c7'),_0x1872ee[_0x9b0b('0x5d')]));var _0x44b6ee=this['googleTTS'][_0x9b0b('0xc8')](this,_0x1872ee);if(_0x44b6ee){this[_0x9b0b('0xf')]['noop'](util[_0x9b0b('0x28')](_0x9b0b('0x1c8'),_0x44b6ee));var _0x3c5668=this[_0x9b0b('0xf')]['streamFile'](_0x44b6ee);try{fs['unlink'](_0x44b6ee+'.wav');}catch(_0xcb93ab){logger[_0x9b0b('0x2c')](_0xcb93ab);}return _0x3c5668;}return this['channel'][_0x9b0b('0x2c')](_0x1872ee,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['unpause']=function(_0x1ae9da){logger['info'](util[_0x9b0b('0x28')](_0x9b0b('0x1c9'),_0x1ae9da[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x1ae9da[_0x9b0b('0x165')])){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x1ae9da,_0x9b0b('0x163'));}logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x164'),this[_0x9b0b('0xf')]['callerid'],_0x1ae9da[_0x9b0b('0x165')]));var _0x585bf8=this[_0x9b0b('0x50')][_0x9b0b('0xc8')](this,_0x1ae9da[_0x9b0b('0x165')]);if(_0x585bf8){logger[_0x9b0b('0x2f')](util[_0x9b0b('0x28')](_0x9b0b('0x166'),this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x1ae9da[_0x9b0b('0x165')]));this['channel'][_0x9b0b('0xad')](util[_0x9b0b('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x1ae9da[_0x9b0b('0x165')]));return{'code':0xc8,'result':_0x9b0b('0x167')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9b0b('0xf')]['callerid'],_0x1ae9da['findBy']));this['channel'][_0x9b0b('0xad')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9b0b('0xf')][_0x9b0b('0x3a')],_0x1ae9da[_0x9b0b('0x165')]));return{'code':0xc8,'result':_0x9b0b('0x169')};}};AGIVertices[_0x9b0b('0x12')]['voicemail']=function(_0x7995ba){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x1ca'),_0x7995ba['label']));var _0x76465c=this[_0x9b0b('0xf')][_0x9b0b('0x57')]('VOICEMAIL',[_0x7995ba['mailbox'],_0x7995ba[_0x9b0b('0x7b')]]);if(_0x76465c[_0x9b0b('0xb0')]===-0x1){return _0x76465c;}return this[_0x9b0b('0xf')][_0x9b0b('0xad')](util[_0x9b0b('0x28')](_0x9b0b('0xcc'),_0x9b0b('0x1cb'),_0x7995ba['mailbox']));};AGIVertices[_0x9b0b('0x12')]['vswitch']=function(_0x1241f6){logger[_0x9b0b('0x2f')](util['format'](_0x9b0b('0x1cc'),_0x1241f6[_0x9b0b('0x38')]));if(!this[_0x9b0b('0xaa')](_0x1241f6[_0x9b0b('0xe1')])){return this[_0x9b0b('0xf')]['error'](_0x1241f6,_0x9b0b('0x1ab'));}var _0x4634ac=this['getVariable'][_0x9b0b('0xc8')](this,_0x1241f6['variable_id']);if(!_0x4634ac){return this[_0x9b0b('0xf')][_0x9b0b('0x2c')](_0x1241f6,'no\x20variable\x20found');}var _0x158644=this[_0x9b0b('0xf')][_0x9b0b('0xa8')](_0x4634ac);return{'code':0xc8,'result':_0x158644[_0x9b0b('0xa5')]?_0x158644['extra']:'-'};};String['prototype'][_0x9b0b('0xa4')]=function(_0xa0f2eb,_0x38f6a8){return this['split'](_0xa0f2eb)[_0x9b0b('0x1cd')](_0x38f6a8);};module[_0x9b0b('0x1ce')]=AGIVertices; \ No newline at end of file +var _0x01fe=['Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','dialogflow','bot','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','toUpperCase','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','getSound','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','intKey','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','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','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','sendMail\x20message','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','no\x20variable\x20selected','join','exports','util','shelljs','odbc','mustache','request-promise','../../config/logger','agi','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','model','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','hasOwnProperty','%s.%s','saveRestApiResult','setVariable','replaceObjectAllVariables','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','isConfigured','maxRetry','retry','noop','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application'];(function(_0x4584b9,_0x34639a){var _0x4cba81=function(_0xc1bfda){while(--_0xc1bfda){_0x4584b9['push'](_0x4584b9['shift']());}};_0x4cba81(++_0x34639a);}(_0x01fe,0x102));var _0xe01f=function(_0x5cea31,_0x4d36e8){_0x5cea31=_0x5cea31-0x0;var _0x5c54ba=_0x01fe[_0x5cea31];return _0x5c54ba;};'use strict';var fs=require('fs');var util=require(_0xe01f('0x0'));var _=require('lodash');var sh=require(_0xe01f('0x1'));var odbc=require(_0xe01f('0x2'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xe01f('0x3'));var rp=require(_0xe01f('0x4'));var logger=require(_0xe01f('0x5'))(_0xe01f('0x6'));var config=require('../../config/environment');var scripts=require(_0xe01f('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xe01f('0x8'),_0xe01f('0x9')];var verticesWithRetry=[_0xe01f('0xa'),_0xe01f('0xb'),_0xe01f('0xc')];var AGIVertices=function(_0x4d1775,_0x3cccd7,_0x129e5a){this['channel']=_0x4d1775;this[_0xe01f('0xd')]=_0x3cccd7;this['mailRpc']=_0x129e5a;};AGIVertices[_0xe01f('0xe')][_0xe01f('0xf')]=function(_0x53577d,_0x2525ae){this['rpc'][_0xe01f('0x10')](_0x53577d)[_0xe01f('0x11')](function(_0x1b7292){_0x2525ae(null,_0x1b7292?_0x1b7292[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x94e3d8){_0x2525ae(_0x94e3d8);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x14')]=function(_0x52c2f0,_0x313bb5){this[_0xe01f('0xd')][_0xe01f('0x15')](_0x52c2f0)[_0xe01f('0x11')](function(_0x4e98b9){_0x313bb5(null,_0x4e98b9?_0x4e98b9[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x5e5e30){_0x313bb5(_0x5e5e30);});};AGIVertices['prototype']['getSquareProject']=function(_0x12540b,_0x14b05d){this[_0xe01f('0xd')][_0xe01f('0x16')](_0x12540b)[_0xe01f('0x11')](function(_0x3fad9a){_0x14b05d(null,_0x3fad9a?_0x3fad9a[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x9ee4b5){_0x14b05d(_0x9ee4b5);});};AGIVertices[_0xe01f('0xe')]['getSquareOdbc']=function(_0x23e52a,_0x5ca305){this[_0xe01f('0xd')][_0xe01f('0x17')](_0x23e52a)[_0xe01f('0x11')](function(_0x3d5f9c){_0x5ca305(null,_0x3d5f9c?_0x3d5f9c['dsn']:![]);})[_0xe01f('0x13')](function(_0xb9343e){_0x5ca305(_0xb9343e);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x18')]=function(_0x369b7e,_0x3c34fa){this['rpc'][_0xe01f('0x19')](_0x369b7e)[_0xe01f('0x11')](function(_0x23df45){_0x3c34fa(null,_0x23df45?_0x23df45[_0xe01f('0x12')]:![]);})[_0xe01f('0x13')](function(_0x38efcc){_0x3c34fa(_0x38efcc);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1a')]=function(_0x11708c,_0x4b44b6){this['rpc'][_0xe01f('0x1b')](_0x11708c)[_0xe01f('0x11')](function(_0x3f92ca){_0x4b44b6(null,_0x3f92ca?_0x3f92ca[_0xe01f('0x12')]:![]);})['catch'](function(_0x2be3d2){_0x4b44b6(_0x2be3d2);});};AGIVertices[_0xe01f('0xe')]['getSound']=function(_0x378c93,_0x5b9c5e){var _0x1b77c8=this;this[_0xe01f('0xd')][_0xe01f('0x1c')](_0x378c93)['then'](function(_0x940cb6){_0x5b9c5e(null,_0x940cb6?_0x1b77c8['getSoundPath'](_0x940cb6[_0xe01f('0x1d')]):![]);})[_0xe01f('0x13')](function(_0x2e4568){_0x5b9c5e(_0x2e4568);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1e')]=function(_0x349348,_0x11386e){this[_0xe01f('0xd')][_0xe01f('0x1f')](_0x349348)['then'](function(_0x3f725a){_0x11386e(null,_0x3f725a?_0x3f725a:![]);})['catch'](function(_0x3736fd){_0x11386e(_0x3736fd);});};AGIVertices[_0xe01f('0xe')]['sendMailMessage']=function(_0x15f98f,_0x2aeb7e,_0x26cd7e){this['mailRpc'][_0xe01f('0x20')](_0x15f98f,_0x2aeb7e)[_0xe01f('0x11')](function(){_0x26cd7e(null);})[_0xe01f('0x13')](function(_0x1d034d){_0x26cd7e(_0x1d034d);});};AGIVertices[_0xe01f('0xe')]['getIntervals']=function(_0x57aed0,_0x5f19a6){this[_0xe01f('0xd')]['getIntervalById'](_0x57aed0)[_0xe01f('0x11')](function(_0x8af6fc){if(_0x8af6fc){if(_0x8af6fc[_0xe01f('0x21')]){_0x5f19a6(null,[_0x8af6fc[_0xe01f('0x22')]]);}else{_0x5f19a6(null,_[_0xe01f('0x23')](_0x8af6fc[_0xe01f('0x24')],_0xe01f('0x22')));}}else{_0x5f19a6(null,![]);}})[_0xe01f('0x13')](function(_0x5b7139){_0x5f19a6(_0x5b7139);});};AGIVertices['prototype'][_0xe01f('0x25')]=function(_0x25bea9){return util[_0xe01f('0x26')](_0xe01f('0x27'),FILES_PATH,_0x25bea9);};AGIVertices['prototype'][_0xe01f('0x28')]=function(_0x3530db,_0xf26288,_0x5179e4){odbc[_0xe01f('0x29')](_0x3530db,function(_0x3a48d2){if(_0x3a48d2){logger[_0xe01f('0x2a')](_0xe01f('0x2b'),_0x3a48d2);_0x5179e4(_0x3a48d2);}else{logger[_0xe01f('0x2c')](_0xe01f('0x2d'));odbc[_0xe01f('0x2e')](_0xf26288,function(_0x2b102c,_0x29c47f){if(_0x2b102c){logger[_0xe01f('0x2c')](_0xe01f('0x2f'),_0xf26288);_0x5179e4(_0x2b102c);}else{logger[_0xe01f('0x2c')](_0xe01f('0x30'),_0xf26288);odbc[_0xe01f('0x31')](function(_0x16ab3c){if(_0x16ab3c){logger['error'](_0xe01f('0x32'),_0x16ab3c);}_0x5179e4(null,_0x29c47f);});}});}});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x33')]=function(_0xbe9034,_0x495b74){this[_0xe01f('0xd')][_0xe01f('0x34')](_0xbe9034)[_0xe01f('0x11')](function(_0x1e3f02){_0x495b74(null,_0x1e3f02?_0x1e3f02:![]);})[_0xe01f('0x13')](function(_0x31dc11){_0x495b74(_0x31dc11);});};AGIVertices['prototype'][_0xe01f('0x35')]=function(_0x3f5a1e,_0x45be6c){this[_0xe01f('0xd')][_0xe01f('0x35')](_0x3f5a1e)[_0xe01f('0x11')](function(_0x861971){_0x45be6c(null,_0x861971);})[_0xe01f('0x13')](function(_0x15e82f){_0x45be6c(_0x15e82f);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x3dd453,_0x50b47,_0x5c8a92){this[_0xe01f('0xd')][_0xe01f('0x36')]({'uniqueid':this[_0xe01f('0x37')]['uniqueid'],'node':_0x3dd453[_0xe01f('0x38')],'application':_0x3dd453[_0xe01f('0x39')],'data':_0x50b47||null,'project_name':this['channel']['arg_1'],'callerid':this['channel'][_0xe01f('0x3a')]})['then'](function(_0x19d4ec){if(_0x5c8a92){_0x5c8a92(null,_0x19d4ec);}})['catch'](function(_0x196a1d){if(_0x5c8a92){_0x5c8a92(_0x196a1d);}});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x3b')]=function(_0x233d83,_0x310d75,_0x398573,_0x29954d){this[_0xe01f('0xd')][_0xe01f('0x3b')]({'uniqueid':this[_0xe01f('0x37')][_0xe01f('0x3c')],'callerid':this['channel'][_0xe01f('0x3a')],'calleridname':this[_0xe01f('0x37')][_0xe01f('0x3d')],'context':this[_0xe01f('0x37')][_0xe01f('0x3e')],'extension':this['channel'][_0xe01f('0x3f')],'priority':this['channel']['priority'],'accountcode':this[_0xe01f('0x37')][_0xe01f('0x40')],'dnid':this[_0xe01f('0x37')][_0xe01f('0x41')],'projectName':this[_0xe01f('0x37')]['arg_1'],'saveName':_0x310d75,'filename':_0x233d83[_0xe01f('0x42')]||_0x310d75,'savePath':_0x398573})[_0xe01f('0x11')](function(_0x3bb3b7){_0x29954d(null,_0x3bb3b7);})[_0xe01f('0x13')](function(_0xc5b0c4){_0x29954d(_0xc5b0c4);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x43')]=function(_0x5a511c,_0x3f4ae0,_0x51e5c6,_0x17580b,_0x204464){this['rpc'][_0xe01f('0x43')]({'uniqueid':this[_0xe01f('0x37')][_0xe01f('0x3c')],'body':_0x5a511c,'direction':_0x3f4ae0,'providerName':_0x51e5c6,'providerResponse':_0x17580b})[_0xe01f('0x11')](function(_0x2577cb){if(_0x204464){_0x204464(null,_0x2577cb);}})[_0xe01f('0x13')](function(_0x5b04b5){if(_0x204464){_0x204464(_0x5b04b5);}});};AGIVertices['prototype'][_0xe01f('0x44')]=function(_0x216f69,_0x516747){this[_0xe01f('0xd')][_0xe01f('0x44')]({'firstName':_[_0xe01f('0x45')](_0x216f69[_0xe01f('0x12')])||_[_0xe01f('0x46')](_0x216f69[_0xe01f('0x12')])?'callback_'+Math[_0xe01f('0x47')]():_0x216f69[_0xe01f('0x12')],'lastName':_['isEmpty'](_0x216f69[_0xe01f('0x48')])||_[_0xe01f('0x46')](_0x216f69[_0xe01f('0x48')])?null:_0x216f69[_0xe01f('0x48')],'phone':_0x216f69[_0xe01f('0x49')],'ListId':_0x216f69[_0xe01f('0x4a')],'scheduledat':_0x216f69['scheduledAt'],'callbackUniqueid':this[_0xe01f('0x37')]['uniqueid'],'tags':'callback','description':_0xe01f('0x4b')+_0x216f69[_0xe01f('0x4c')][_0xe01f('0x4d')](),'priority':_0x216f69[_0xe01f('0x4e')]})[_0xe01f('0x11')](function(_0x3b0ab1){_0x516747(null,_0x3b0ab1);})[_0xe01f('0x13')](function(_0x5b7672){_0x516747(_0x5b7672);});};AGIVertices['prototype']['getPause']=function(_0x24c60c,_0x54f01a){this[_0xe01f('0xd')][_0xe01f('0x4f')](_0x24c60c)[_0xe01f('0x11')](function(_0x33a11b){_0x54f01a(null,_0x33a11b?_0x33a11b[_0xe01f('0x12')]:![]);})['catch'](function(_0x2c0b36){_0x54f01a(_0x2c0b36);});};AGIVertices[_0xe01f('0xe')]['agentPause']=function(_0x3bda53,_0x4dd65c,_0xfb20c6){var _0x5d9683={'role':_0xe01f('0x50')};_0x5d9683[_0x3bda53]=this[_0xe01f('0x37')][_0xe01f('0x3a')];this[_0xe01f('0xd')][_0xe01f('0x51')](_0x5d9683,_0x4dd65c,this[_0xe01f('0x37')][_0xe01f('0x3c')])[_0xe01f('0x11')](function(_0x5d51e5){_0xfb20c6(null,_[_0xe01f('0x46')](_0x5d51e5)?![]:!![]);})[_0xe01f('0x13')](function(_0x4ca90a){logger[_0xe01f('0x2a')](_0x4ca90a);_0xfb20c6(null,![]);});};AGIVertices['prototype'][_0xe01f('0x52')]=function(_0x428b19,_0x517487){var _0x617624={'role':'agent'};_0x617624[_0x428b19]=this[_0xe01f('0x37')]['callerid'];this[_0xe01f('0xd')][_0xe01f('0x52')](_0x617624)[_0xe01f('0x11')](function(_0x316b2b){_0x517487(null,_[_0xe01f('0x46')](_0x316b2b)?![]:!![]);})[_0xe01f('0x13')](function(_0x4c79d6){logger['error'](_0x4c79d6);_0x517487(null,![]);});};AGIVertices[_0xe01f('0xe')]['agentLogout']=function(_0xa1471b,_0x4a4346){var _0x831296={'role':_0xe01f('0x50')};_0x831296[_0xa1471b]=this[_0xe01f('0x37')]['callerid'];this['rpc'][_0xe01f('0x53')](_0x831296)['then'](function(_0x493c13){_0x4a4346(null,_[_0xe01f('0x46')](_0x493c13)?![]:!![]);})[_0xe01f('0x13')](function(_0x45ecce){logger[_0xe01f('0x2a')](_0x45ecce);_0x4a4346(null,![]);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x54')]=function(_0x19b448,_0x13b790){var _0x3d03c9={'role':'agent'};_0x3d03c9[_0x19b448]=this['channel']['callerid'];var _0x47c632=_0x19b448!=_0xe01f('0x55')?util[_0xe01f('0x26')](_0xe01f('0x56'),_0xe01f('0x57'),this[_0xe01f('0x37')]['callerid']):undefined;this[_0xe01f('0xd')]['agentLogin'](_0x3d03c9,_0x47c632)[_0xe01f('0x11')](function(_0x3d7604){_0x13b790(null,_[_0xe01f('0x46')](_0x3d7604)?![]:!![]);})[_0xe01f('0x13')](function(_0x4973c8){logger['error'](_0x4973c8);_0x13b790(null,![]);});};AGIVertices[_0xe01f('0xe')]['shellCommand']=function(_0x3a5f45,_0x2a2580){sh['exec'](_[_0xe01f('0x58')](_0x3a5f45),function(_0x42d607,_0x41e175){var _0x1cd8ec=_0x41e175[_0xe01f('0x59')](/(\r\n|\n|\r)/gm,'');_0x2a2580(null,_0x1cd8ec);});};AGIVertices['prototype'][_0xe01f('0x5a')]=function(_0x1c9cbf,_0x5cd7bd){scripts[_0xe01f('0x5a')](_0x1c9cbf[_0xe01f('0x5b')],_0x1c9cbf[_0xe01f('0x5c')]||_0xe01f('0x5d'),_0x1c9cbf[_0xe01f('0x5d')],_0x1c9cbf[_0xe01f('0x5e')]||_0xe01f('0x5f'),_0x1c9cbf[_0xe01f('0x60')]||_0xe01f('0x61'),_0x1c9cbf[_0xe01f('0x62')]||_0xe01f('0x63'))[_0xe01f('0x11')](function(_0x5cfc2c){_0x5cd7bd(null,_0x5cfc2c);})[_0xe01f('0x13')](function(_0x185de4){_0x5cd7bd(_0x185de4);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x64')]=function(_0x1c4b5f,_0x495b3c){scripts[_0xe01f('0x64')](_0x1c4b5f['text'],_0x1c4b5f[_0xe01f('0x65')]||'en',0x1)[_0xe01f('0x11')](function(_0x35a7cb){_0x495b3c(null,_0x35a7cb);})['catch'](function(_0x41c0f){_0x495b3c(_0x41c0f);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x66')]=function(_0x468e7b,_0x5dfa19){var _0x42ff11={'uri':_0x468e7b[_0xe01f('0x67')],'method':_0x468e7b[_0xe01f('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x468e7b[_0xe01f('0x69')])===_0xe01f('0x6a')&&parseInt(_0x468e7b[_0xe01f('0x69')])>=0x1?parseInt(_0x468e7b['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0xe01f('0x6b'),_0xe01f('0x6c')],_0x42ff11[_0xe01f('0x68')]['toUpperCase']())){try{_0x42ff11['body']=_0x468e7b[_0xe01f('0x9')]?JSON[_0xe01f('0x6d')](_0x468e7b[_0xe01f('0x9')]):{};}catch(_0x27c50a){logger[_0xe01f('0x2a')](_0xe01f('0x6e'),_0x27c50a);}}try{_0x42ff11[_0xe01f('0x6f')]=_0x468e7b[_0xe01f('0x8')]?JSON[_0xe01f('0x6d')](_0x468e7b['rawHeaders']):{};}catch(_0x2f1975){logger[_0xe01f('0x2a')](_0xe01f('0x70'),_0x2f1975);}if(_0x468e7b[_0xe01f('0x71')]){try{var _0x1b89c3=require(_0x468e7b[_0xe01f('0x71')])[_0xe01f('0x72')](this,_0x42ff11);_0x42ff11[_0xe01f('0x73')]=Mustache[_0xe01f('0x74')](_0x468e7b[_0xe01f('0x67')],_0x1b89c3,{},['$$','$$']);if(_0x42ff11['headers']){_0x42ff11[_0xe01f('0x6f')]=JSON[_0xe01f('0x6d')](Mustache['render'](JSON[_0xe01f('0x75')](_0x42ff11[_0xe01f('0x6f')]),_0x1b89c3,{},['$$','$$']));}if(_0x42ff11['body']){_0x42ff11['body']=JSON['parse'](Mustache['render'](JSON[_0xe01f('0x75')](_0x42ff11[_0xe01f('0x76')]),_0x1b89c3,{},['$$','$$']));}}catch(_0x532171){logger[_0xe01f('0x2a')](_0xe01f('0x77'),_0x532171);}}rp(_0x42ff11)[_0xe01f('0x11')](function(_0x58ddd0){var _0x29869b={'statusCode':_0x58ddd0[_0xe01f('0x78')]||0xc8,'statusMessage':_0x58ddd0[_0xe01f('0x79')]||'OK','headers':_0x58ddd0[_0xe01f('0x6f')]||{},'body':_0x58ddd0[_0xe01f('0x76')]||{}};_0x5dfa19(null,_0x29869b);})['catch'](function(_0x256f4b){var _0x753543={'statusCode':_0x256f4b[_0xe01f('0x78')]||0x1f4,'statusMessage':_0x256f4b[_0xe01f('0x7a')]||_0xe01f('0x7b'),'headers':_0x256f4b['options'][_0xe01f('0x6f')]||{},'body':_0x256f4b[_0xe01f('0x7c')]['body']||{}};_0x5dfa19(null,_0x753543);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x7d')]=function(_0x474b52,_0xb8293e){scripts[_0xe01f('0x7d')](this[_0xe01f('0x37')][_0xe01f('0x3c')],_0x474b52['key'],_0x474b52[_0xe01f('0x5d')],_0x474b52[_0xe01f('0x7e')]||'en')[_0xe01f('0x11')](function(_0x1f07a){_0xb8293e(null,_0x1f07a);})[_0xe01f('0x13')](function(_0x408646){_0xb8293e(_0x408646);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x7f')]=function(_0x2bf66f,_0x31a040){scripts[_0xe01f('0x7f')](this[_0xe01f('0x37')][_0xe01f('0x3c')],_0x2bf66f['dialogflowV2_project_id'],_0x2bf66f['client_email'],_0x2bf66f[_0xe01f('0x80')],_0x2bf66f[_0xe01f('0x5d')],_0x2bf66f[_0xe01f('0x81')]||'en')[_0xe01f('0x11')](function(_0x119451){_0x31a040(null,_0x119451);})[_0xe01f('0x13')](function(_0x9a07c7){_0x31a040(_0x9a07c7);});};AGIVertices[_0xe01f('0xe')]['sestekNDA']=function(_0x3ae7d5,_0x52a060){scripts[_0xe01f('0x82')](this[_0xe01f('0x37')],_0x3ae7d5)[_0xe01f('0x11')](function(_0x59a2f7){_0x52a060(null,_0x59a2f7);})[_0xe01f('0x13')](function(_0x29972f){_0x52a060(_0x29972f);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x83')]=function(_0x418579,_0x4ce26b){scripts['ispeechTTS'](_0x418579['key'],_0x418579[_0xe01f('0x5d')],_0x418579[_0xe01f('0x84')]||_0xe01f('0x5f'),_0x418579['speed'])[_0xe01f('0x11')](function(_0x4840ad){_0x4ce26b(null,_0x4840ad);})['catch'](function(_0x313681){_0x4ce26b(_0x313681);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x85')]=function(_0x257171,_0x226875,_0x1dff55){scripts['ispeechASR'](_0x226875,_0x257171[_0xe01f('0x86')],_0x257171['ispeech_asr_language']||_0xe01f('0x5f'),this['isConfigured'](_0x257171[_0xe01f('0x87')])?_0x257171[_0xe01f('0x87')]:undefined)['then'](function(_0x2ac74d){_0x1dff55(null,_0x2ac74d);})[_0xe01f('0x13')](function(_0x4eec7d){_0x1dff55(_0x4eec7d);});};AGIVertices['prototype']['awsPolly']=function(_0x4f56e8,_0xb43191){scripts['awsPolly'](_0x4f56e8['aws_access_key_id'],_0x4f56e8['aws_secret_access_key'],_0x4f56e8['aws_polly_region'],_0x4f56e8[_0xe01f('0x88')]||_0xe01f('0x89'),_0x4f56e8[_0xe01f('0x5d')],_0x4f56e8[_0xe01f('0x8a')]||_0xe01f('0x5d'))[_0xe01f('0x11')](function(_0xb8a43d){_0xb43191(null,_0xb8a43d);})[_0xe01f('0x13')](function(_0x3380c6){_0xb43191(_0x3380c6);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x8b')]=function(_0x1dba36,_0x5a9d49){scripts[_0xe01f('0x8b')](this['channel'][_0xe01f('0x3c')],_0x1dba36[_0xe01f('0x8c')],_0x1dba36[_0xe01f('0x8d')],_0x1dba36[_0xe01f('0x8e')],_0x1dba36[_0xe01f('0x5d')],_0x1dba36[_0xe01f('0x8f')])[_0xe01f('0x11')](function(_0x7ef35e){_0x5a9d49(null,_0x7ef35e);})[_0xe01f('0x13')](function(_0x2648a4){_0x5a9d49(_0x2648a4);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x90')]=function(_0xa768b9,_0x33f718,_0x22c116){scripts['googleASR'](_0x33f718,_0xa768b9[_0xe01f('0x86')],_0xa768b9[_0xe01f('0x91')]||'en-US')[_0xe01f('0x11')](function(_0x9aa559){_0x22c116(null,_0x9aa559);})[_0xe01f('0x13')](function(_0x2560fc){_0x22c116(_0x2560fc);});};AGIVertices[_0xe01f('0xe')]['tildeASR']=function(_0x1aec49,_0x889e13,_0x18d5bf){scripts[_0xe01f('0x92')](_0x889e13,_0x1aec49[_0xe01f('0x93')],_0x1aec49[_0xe01f('0x94')],_0x1aec49[_0xe01f('0x73')])[_0xe01f('0x11')](function(_0x3e2416){_0x18d5bf(null,_0x3e2416);})[_0xe01f('0x13')](function(_0x4cbeef){_0x18d5bf(_0x4cbeef);});};AGIVertices[_0xe01f('0xe')][_0xe01f('0x95')]=function(_0x231aca){var _0x4fffb9=_[_0xe01f('0x96')](verticesWithRetry,_0x231aca['agicommand'])?_0x231aca:_['clone'](_0x231aca);for(var _0x39653c in _0x4fffb9){if(_0x4fffb9['hasOwnProperty'](_0x39653c)){if(_0x4fffb9[_0x39653c]&&_[_0xe01f('0x97')](_0x4fffb9[_0x39653c])){if(_['includes'](recursiveMapAttributes,_0x39653c)){_0x4fffb9[_0x39653c]=this['replaceObjectAllVariables'](_0x4fffb9[_0x39653c]);}else{_0x4fffb9[_0x39653c]=this[_0xe01f('0x98')](_0x4fffb9[_0x39653c]);}}}}return _0x4fffb9;};AGIVertices['prototype'][_0xe01f('0x99')]=function(_0x32dd90){for(var _0x435da5 in _0x32dd90){if(_0x32dd90['hasOwnProperty'](_0x435da5)){if(_[_0xe01f('0x9a')](_0x32dd90[_0x435da5])){this[_0xe01f('0x99')](_0x32dd90[_0x435da5]);}else if(_[_0xe01f('0x9b')](_0x32dd90[_0x435da5])){for(var _0x2d0bc5=0x0;_0x2d0bc5<_0x32dd90[_0x435da5][_0xe01f('0x9c')];_0x2d0bc5++){this[_0xe01f('0x99')](_0x32dd90[_0x435da5][_0x2d0bc5]);}}else if(_[_0xe01f('0x97')](_0x32dd90[_0x435da5])){_0x32dd90[_0x435da5]=this[_0xe01f('0x98')](_0x32dd90[_0x435da5]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x117e2f,_0x2c4d07){for(var _0x2289d0 in _0x117e2f){if(_0x117e2f[_0xe01f('0x9d')](_0x2289d0)){if(_[_0xe01f('0x9a')](_0x117e2f[_0x2289d0])){if(!_[_0xe01f('0x45')](_0x117e2f[_0x2289d0])){this['saveRestApiResult'](_0x117e2f[_0x2289d0],util['format'](_0xe01f('0x9e'),_0x2c4d07,_0x2289d0));}}else if(_[_0xe01f('0x9b')](_0x117e2f[_0x2289d0])){for(var _0x9033f8=0x0;_0x9033f8<_0x117e2f[_0x2289d0]['length'];_0x9033f8++){this[_0xe01f('0x9f')](_0x117e2f[_0x2289d0][_0x9033f8],util['format'](_0xe01f('0x9e'),_0x2c4d07,_0x2289d0+'['+_0x9033f8+']'));}}else{if(!_[_0xe01f('0x46')](_0x117e2f[_0x2289d0])){this['channel'][_0xe01f('0xa0')](util['format'](_0xe01f('0x9e'),_0x2c4d07,_0x2289d0),_0x117e2f[_0x2289d0]);}}}}};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa1')]=function(_0x15078b){try{var _0x53c70e=JSON[_0xe01f('0x6d')](_0x15078b);this['recursiveNodeIndex'](_0x53c70e);return JSON[_0xe01f('0x75')](_0x53c70e);}catch(_0x26f8cb){return this[_0xe01f('0x98')](_0x15078b);}};AGIVertices['prototype'][_0xe01f('0x98')]=function(_0x27d255){var _0x3a8fd3=_0x27d255[_0xe01f('0xa2')]('{');for(var _0x1b362b=0x1;_0x1b362b<_0x3a8fd3[_0xe01f('0x9c')];_0x1b362b+=0x1){var _0x299389=_0x3a8fd3[_0x1b362b]['split']('}');if(_0x299389[_0xe01f('0x9c')]>0x1){_0x27d255=_0x27d255[_0xe01f('0xa3')]('{'+_0x299389[0x0]+'}',this[_0xe01f('0x37')][_0xe01f('0xf')](_0x299389[0x0])['extra']||_0x299389[0x0]);}}if(_0x3a8fd3[_0xe01f('0x9c')]===0x1){return _0x27d255[_0xe01f('0x4d')]();}return this['replaceAllVariables'](_0x27d255);};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa4')]=function(_0xe78abc,_0x153905){var _0x593381=this['channel'][_0xe01f('0xf')](_0xe78abc);if(_0x593381[_0xe01f('0xa5')]===-0x1){return _0x593381;}logger['info'](util['format'](_0xe01f('0xa6'),_0x153905,_0x593381[_0xe01f('0xa7')]));return this[_0xe01f('0x37')][_0xe01f('0xa0')](_0x153905,_0x593381[_0xe01f('0xa7')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa8')]=function(_0x5be789){return _0x5be789&&_0x5be789!=='0'&&_0x5be789!=='-1'&&_0x5be789!=='';};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa9')]=function(_0x22c702){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x22c702,'-');_0x22c702[_0xe01f('0xaa')]=_0x22c702[_0xe01f('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe01f('0xe')]['mrcpsynth']=function(_0x365642){logger[_0xe01f('0x2c')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x365642[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x365642[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20text\x20configured');}var _0x9d7bc1='\x22'+_0x365642[_0xe01f('0x5d')]+'\x22';if(this[_0xe01f('0xa8')](_0x365642[_0xe01f('0x7c')])){_0x9d7bc1+=','+_0x365642[_0xe01f('0x7c')];}var _0xbdcb11=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xad'),_0x9d7bc1);if(_0xbdcb11[_0xe01f('0xa5')]===-0x1){return _0xbdcb11;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xae'),_0x9d7bc1));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xaf')]=function(_0x468fbc){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x468fbc[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x468fbc[_0xe01f('0xb0')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xb1'));}var _0x73aedb=_0x468fbc[_0xe01f('0xb0')];if(this[_0xe01f('0xa8')](_0x468fbc[_0xe01f('0x7c')])){_0x73aedb+=','+_0x468fbc[_0xe01f('0x7c')];}var _0x542f31=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xb2'),_0x73aedb);if(_0x542f31['result']===-0x1){return _0x542f31;}var _0x41ecc0=this[_0xe01f('0xa4')](_0xe01f('0xb3'),_0xe01f('0xb4'));if(_0x41ecc0[_0xe01f('0xa5')]===-0x1){return _0x41ecc0;}var _0x3959bb=this['getAndSetVariable']('RECOG_INPUT()',_0xe01f('0xb5'));if(_0x3959bb[_0xe01f('0xa5')]===-0x1){return _0x3959bb;}var _0x11b751=this[_0xe01f('0xa4')](_0xe01f('0xb6'),'MRCP_RECOG_INSTANCE');if(_0x11b751[_0xe01f('0xa5')]===-0x1){return _0x11b751;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xb7'),_0x73aedb));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x6')]=function(_0x4db14f){logger['info'](util['format'](_0xe01f('0xb8'),_0x4db14f[_0xe01f('0x38')]));return this['channel']['agi']([_0x4db14f['command'],_0x4db14f['args']]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0xb9')]=function(_0xef549a){logger['info'](util[_0xe01f('0x26')](_0xe01f('0xba'),_0xef549a[_0xe01f('0x38')]));if(this[_0xe01f('0xa8')](_0xef549a[_0xe01f('0x69')])){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xef549a[_0xe01f('0x69')]));var _0x2a74b4=this['channel'][_0xe01f('0xbb')](_0xef549a['timeout']);if(_0x2a74b4[_0xe01f('0xa5')]===-0x1){return _0x2a74b4;}}return this[_0xe01f('0x37')]['answer']();};AGIVertices[_0xe01f('0xe')][_0xe01f('0xbc')]=function(_0x9a97f7){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xbd'),_0x9a97f7[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x9a97f7[_0xe01f('0x4a')])){return this[_0xe01f('0x37')]['error'](_0x9a97f7,_0xe01f('0xbe'));}_0x9a97f7[_0xe01f('0x4c')]=moment();if(this[_0xe01f('0xa8')](_0x9a97f7[_0xe01f('0xbf')])){_0x9a97f7[_0xe01f('0x4c')]=moment()[_0xe01f('0xc0')](_0x9a97f7[_0xe01f('0xbf')],'minutes');}if(!this[_0xe01f('0xa8')](_0x9a97f7[_0xe01f('0x4e')])){_0x9a97f7[_0xe01f('0x4e')]=0x2;}this['createCmContact'][_0xe01f('0x72')](this,_0x9a97f7);return this[_0xe01f('0x37')]['noop'](util['format'](_0xe01f('0xc1'),_0x9a97f7[_0xe01f('0x49')],_0x9a97f7[_0xe01f('0x4a')],_0x9a97f7[_0xe01f('0x4c')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xc2')]=function(_0x4a6717){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xc3'),_0x4a6717[_0xe01f('0x38')]));var _0x29e396=this['channel']['exec'](_0x4a6717[_0xe01f('0xc4')],_0x4a6717[_0xe01f('0x7c')]);if(_0x29e396['result']===-0x1){return _0x29e396;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0xc5'),_0x4a6717[_0xe01f('0xc4')],_0x4a6717[_0xe01f('0x7c')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xc6')]=function(_0x51c7d1){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xc7'),_0x51c7d1[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x51c7d1[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}var _0x356e24='\x22'+_0x51c7d1[_0xe01f('0x5d')]+'\x22';if(this[_0xe01f('0xa8')](_0x51c7d1[_0xe01f('0x7c')])){_0x356e24+=','+_0x51c7d1[_0xe01f('0x7c')];}var _0x5c45c8=this[_0xe01f('0x37')]['exec']('MRCPSynth',_0x356e24);if(_0x5c45c8[_0xe01f('0xa5')]===-0x1){return _0x5c45c8;}return this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xae'),_0x356e24));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xc9')]=function(_0x2f3b29){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0xca'),_0x2f3b29['label']));if(!this['isConfigured'](_0x2f3b29[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20text\x20configured');}var _0xdc5f61='\x22'+_0x2f3b29[_0xe01f('0x5d')]+'\x22';if(this[_0xe01f('0xa8')](_0x2f3b29[_0xe01f('0x7c')])){_0xdc5f61+=','+_0x2f3b29[_0xe01f('0x7c')];}var _0x1eaab4=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xad'),_0xdc5f61);if(_0x1eaab4[_0xe01f('0xa5')]===-0x1){return _0x1eaab4;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xae'),_0xdc5f61));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xcb')]=function(_0x431b69){logger['info'](util[_0xe01f('0x26')](_0xe01f('0xcc'),_0x431b69['label']));if(!this[_0xe01f('0xa8')](_0x431b69[_0xe01f('0xb0')])){return this[_0xe01f('0x37')]['noop']('no\x20grammar\x20configured');}var _0x31cabb=_0x431b69[_0xe01f('0xb0')];if(this[_0xe01f('0xa8')](_0x431b69[_0xe01f('0x7c')])){_0x31cabb+=','+_0x431b69[_0xe01f('0x7c')];}var _0x45c6bd=this['channel']['exec']('MRCPRecog',_0x31cabb);if(_0x45c6bd['result']===-0x1){return _0x45c6bd;}var _0x15ac0b=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xe01f('0xcd'));if(_0x15ac0b[_0xe01f('0xa5')]===-0x1){return _0x15ac0b;}var _0x4cf4d8=this['getAndSetVariable']('RECOG_INPUT()',_0xe01f('0xce'));if(_0x4cf4d8[_0xe01f('0xa5')]===-0x1){return _0x4cf4d8;}var _0x53e68d=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x53e68d['result']===-0x1){return _0x53e68d;}return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x31cabb));};AGIVertices[_0xe01f('0xe')]['sestekasr']=function(_0x54b1fd){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0xcf'),_0x54b1fd[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x54b1fd[_0xe01f('0xb0')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xb1'));}var _0x16cbcb=_0x54b1fd[_0xe01f('0xb0')];if(this['isConfigured'](_0x54b1fd[_0xe01f('0x7c')])){_0x16cbcb+=','+_0x54b1fd['options'];}var _0x432241=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xb2'),_0x16cbcb);if(_0x432241[_0xe01f('0xa5')]===-0x1){return _0x432241;}var _0x171096=this['getAndSetVariable'](_0xe01f('0xb3'),_0xe01f('0xd0'));if(_0x171096[_0xe01f('0xa5')]===-0x1){return _0x171096;}var _0x78e052=this[_0xe01f('0xa4')](_0xe01f('0xd1'),_0xe01f('0xd2'));if(_0x78e052[_0xe01f('0xa5')]===-0x1){return _0x78e052;}var _0x225783=this[_0xe01f('0xa4')](_0xe01f('0xb6'),_0xe01f('0xd3'));if(_0x225783['result']===-0x1){return _0x225783;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xb7'),_0x16cbcb));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xd4')]=function(_0x487545){logger[_0xe01f('0x2c')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x487545[_0xe01f('0x38')]));if(!this['isConfigured'](_0x487545['odbc_id'])){return this['channel']['error'](_0x487545,'no\x20database\x20selected');}var _0x5be520=this[_0xe01f('0xd5')][_0xe01f('0x72')](this,_0x487545[_0xe01f('0xd6')]);if(!_0x5be520){return this['channel'][_0xe01f('0x2a')](_0x487545,_0xe01f('0xd7'));}if(!this[_0xe01f('0xa8')](_0x487545[_0xe01f('0x2e')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x487545,'no\x20query\x20configured');}var _0x25c0f5=_0x487545[_0xe01f('0x2e')][_0xe01f('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe01f('0x37')]['noop'](util['format'](_0xe01f('0xd8'),_0x25c0f5));var _0xb562b1=this[_0xe01f('0x28')]['sync'](this,_0x5be520,_0x25c0f5);this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x487545,_0x25c0f5);if(!this[_0xe01f('0xa8')](_0x487545[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xda'));}var _0x1533c3=this['getVariable'][_0xe01f('0x72')](this,_0x487545[_0xe01f('0xd9')]);if(!_0x1533c3){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x487545,_0xe01f('0xdb'));}var _0x3aab57=this;_0xb562b1['forEach'](function(_0x476461,_0x2ad527){Object[_0xe01f('0xdc')](_0x476461)[_0xe01f('0xdd')](function(_0x35cc5a){_0x3aab57['channel'][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0xde'),_0x1533c3,_0x2ad527,_0x35cc5a),_0x476461[_0x35cc5a]);});});this['channel']['setVariable'](util['format'](_0xe01f('0xdf'),_0x1533c3),_0xb562b1[_0xe01f('0x9c')]);return this[_0xe01f('0x37')]['noop'](util['format']('variable\x20%s\x20set',_0x1533c3));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xe0')]=function(_0x26c6ba){logger[_0xe01f('0xe1')](util['format'](_0xe01f('0xe2'),_0x26c6ba['label']));if(!this['isConfigured'](_0x26c6ba[_0xe01f('0xe3')])){return this['channel'][_0xe01f('0x2a')](_0x26c6ba,_0xe01f('0xe4'));}var _0x443879=this[_0xe01f('0x18')]['sync'](this,_0x26c6ba[_0xe01f('0xe3')]);if(!_0x443879){return this['channel'][_0xe01f('0x2a')](_0x26c6ba,'no\x20user\x20found');}var _0x56049d=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xe5'),[util[_0xe01f('0x26')](_0xe01f('0xe6'),_0x443879),_0x26c6ba[_0xe01f('0x69')],_0x26c6ba['opts'],_0x26c6ba['url']]);if(_0x56049d[_0xe01f('0xa5')]===-0x1){return _0x56049d;}return this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')]('Executed\x20command\x20%s',_0xe01f('0xe5')));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xe7')]=function(_0x5bf5f3){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5bf5f3[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x5bf5f3[_0xe01f('0x86')])){return this[_0xe01f('0x37')]['noop']('no\x20key\x20configured');}if(!this[_0xe01f('0xa8')](_0x5bf5f3[_0xe01f('0x5d')])){return this['channel'][_0xe01f('0xab')]('no\x20text\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xe8')]=!![];this[_0xe01f('0x36')](_0x5bf5f3);this[_0xe01f('0x43')](_0x5bf5f3[_0xe01f('0x5d')],'in','','');this['channel']['noop'](util['format']('Trying\x20Dialogflow:\x20%s',_0x5bf5f3[_0xe01f('0x5d')]));var _0x3f7b1d=this[_0xe01f('0x7d')][_0xe01f('0x72')](this,_0x5bf5f3);if(_0x3f7b1d){for(var _0x289141 in _0x3f7b1d){if(_0x3f7b1d[_0xe01f('0x9d')](_0x289141)){this[_0xe01f('0x37')]['setVariable'](util[_0xe01f('0x26')]('DIALOGFLOW_%s',_0x289141['toUpperCase']()),_0x3f7b1d[_0x289141]);}}this[_0xe01f('0x43')](_0x3f7b1d[_0xe01f('0xe9')],_0xe01f('0xea'),'dialogflow','');return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xeb'),_0x3f7b1d[_0xe01f('0xe9')]));}return this['channel']['error'](_0x5bf5f3,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xe01f('0xe')][_0xe01f('0xec')]=function(_0x424585){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0xed'),_0x424585[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0xee')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xef'));}if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0xf0')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xf1'));}if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0x80')])){return this[_0xe01f('0x37')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x424585[_0xe01f('0x81')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xf2'));}if(!this[_0xe01f('0xa8')](_0x424585[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this[_0xe01f('0x37')][_0xe01f('0xe8')]=!![];this['createSquareDetailsReport'](_0x424585);this[_0xe01f('0x43')](_0x424585['text'],'in','','');this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xf3'),_0x424585[_0xe01f('0x5d')]));var _0x42edb8=this[_0xe01f('0x7f')][_0xe01f('0x72')](this,_0x424585);if(_0x42edb8){for(var _0x89c561 in _0x42edb8){if(_0x42edb8[_0xe01f('0x9d')](_0x89c561)){if(_0x89c561!=='providerResponse'){this['channel'][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0xf4'),_0x89c561[_0xe01f('0xf5')]()),_0x42edb8[_0x89c561]);}}}this[_0xe01f('0x43')](_0x42edb8['speech'],_0xe01f('0xea'),'dialogflowV2',_0x42edb8['providerResponse']);return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0xf6'),_0x42edb8['speech']));}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x424585,_0xe01f('0xf7'));};AGIVertices[_0xe01f('0xe')]['sesteknda']=function(_0x5719e8){logger['info'](util['format'](_0xe01f('0xf8'),_0x5719e8[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x5719e8[_0xe01f('0xf9')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xfa'));}if(!this['isConfigured'](_0x5719e8[_0xe01f('0xfb')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xfc'));}if(!this['isConfigured'](_0x5719e8[_0xe01f('0xfd')])){return this['channel'][_0xe01f('0xab')](_0xe01f('0xfe'));}if(!this[_0xe01f('0xa8')](_0x5719e8[_0xe01f('0xff')])){return this['channel'][_0xe01f('0xab')]('no\x20text\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xe8')]=!![];this[_0xe01f('0x36')](_0x5719e8);this[_0xe01f('0x43')](_0x5719e8[_0xe01f('0x5d')],'in','','');this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0x100'),_0x5719e8[_0xe01f('0x5d')]));var _0x9d1553=this['sestekNDA'][_0xe01f('0x72')](this,_0x5719e8);if(_0x9d1553){for(var _0x3d40ac in _0x9d1553){if(_0x9d1553[_0xe01f('0x9d')](_0x3d40ac)){this[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0x101'),_0x3d40ac[_0xe01f('0xf5')]()),_0x9d1553[_0x3d40ac]);}}this[_0xe01f('0x43')](_0x9d1553[_0xe01f('0xe9')],_0xe01f('0xea'),_0xe01f('0x102'),'');if(_0x9d1553[_0xe01f('0x103')]){this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0x104'),_0x9d1553['audiofile']));var _0x18b248=this[_0xe01f('0x37')][_0xe01f('0x105')](_0x9d1553[_0xe01f('0x103')]);try{fs[_0xe01f('0x106')](_0x9d1553['audiofile']+_0xe01f('0x107'));}catch(_0x31b7cd){logger[_0xe01f('0x2a')](_0x31b7cd);}return _0x18b248;}else{return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('SestekNDA\x20Result\x20%s',_0x9d1553['speech']));}}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5719e8,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xe01f('0xe')]['end']=function(_0xfe5baa){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x108'),_0xfe5baa[_0xe01f('0x38')]));return this[_0xe01f('0x37')]['noop'](_0xe01f('0x109'));};AGIVertices['prototype'][_0xe01f('0x10a')]=function(_0x5751a8){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x10b'),_0x5751a8[_0xe01f('0x38')]));var _0x568949='';if(_0x5751a8['trunk_id']){if(!this[_0xe01f('0xa8')](_0x5751a8[_0xe01f('0x10c')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5751a8,'no\x20trunk\x20selected');}else{var _0x2f7089=parseInt(_0x5751a8['trunk_id'],0xa);if(isNaN(_0x2f7089)){_0x568949=_0x5751a8[_0xe01f('0x10c')];}else{_0x568949=this['getTrunk'][_0xe01f('0x72')](this,_0x5751a8[_0xe01f('0x10c')]);if(!_0x568949){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5751a8,'no\x20trunk\x20found');}}}}else if(_0x5751a8[_0xe01f('0x10d')]){_0x568949=_0x5751a8[_0xe01f('0x10d')];}else{return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5751a8,_0xe01f('0x10e'));}var _0x4505b9=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0xe5'),[util['format'](_0xe01f('0x10f'),_0x568949,_0x5751a8[_0xe01f('0x49')]),_0x5751a8[_0xe01f('0x69')],_0x5751a8[_0xe01f('0x110')],_0x5751a8['url']]);if(_0x4505b9[_0xe01f('0xa5')]===-0x1){return _0x4505b9;}return this['channel']['noop'](util[_0xe01f('0x26')]('Executed\x20command\x20%s',_0xe01f('0xe5')));};AGIVertices[_0xe01f('0xe')]['finally']=function(_0x1ecc37){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x111'),_0x1ecc37['label']));return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x112'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0xb')]=function(_0x3564a8){logger['info'](util[_0xe01f('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3564a8['label']));if(_0x3564a8[_0xe01f('0xaa')]===0x0){return this[_0xe01f('0xa9')](_0x3564a8);}_0x3564a8[_0xe01f('0xaa')]-=0x1;if(!this[_0xe01f('0xa8')](_0x3564a8[_0xe01f('0x113')])){return this['channel'][_0xe01f('0x2a')](_0x3564a8,_0xe01f('0x114'));}var _0x224d80=this[_0xe01f('0x115')][_0xe01f('0x72')](this,_0x3564a8[_0xe01f('0x113')]);if(!_0x224d80){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x3564a8,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x3564a8['variable_id'])){return this['channel'][_0xe01f('0x2a')](_0xe01f('0xda'));}var _0x647e75=this['channel'][_0xe01f('0x116')](_0x224d80,_0x3564a8[_0xe01f('0x117')],_0x3564a8[_0xe01f('0x118')]);var _0x466833=_0x647e75['result']?_0x647e75[_0xe01f('0xa5')]['toString']():'';logger['info'](_0xe01f('0x119'),JSON['stringify'](_0x647e75));if(_0x647e75['result']===-0x1){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,_0x466833);return _0x647e75;}else if(_0x647e75[_0xe01f('0xa7')]===_0xe01f('0x69')){_0x647e75[_0xe01f('0xa5')]=_0x466833[_0xe01f('0x9c')]>=parseInt(_0x3564a8[_0xe01f('0x11a')])?'x':'i';}else{_0x647e75[_0xe01f('0xa5')]=_0x466833[_0xe01f('0x9c')]>=parseInt(_0x3564a8[_0xe01f('0x11a')])&&_0x466833[_0xe01f('0x9c')]<=parseInt(_0x3564a8[_0xe01f('0x118')])?'x':'i';}var _0xd2df4d=this[_0xe01f('0xf')]['sync'](this,_0x3564a8['variable_id']);if(!_0xd2df4d){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x3564a8,_0xe01f('0xdb'));}this[_0xe01f('0x37')][_0xe01f('0xa0')](_0xd2df4d,_0x466833);if(this[_0xe01f('0xa8')](_0x3564a8[_0xe01f('0x11b')])){var _0xdf6cd5=parseInt(_0x3564a8[_0xe01f('0x11b')],0xa);var _0x8533d4=rs[_0xe01f('0x11c')]({'charset':'*','length':_0xdf6cd5});var _0x44915a=_0x466833[_0xe01f('0x9c')];if(_0x44915a>0x0){if(_0x44915a>_0xdf6cd5){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,_0x3564a8[_0xe01f('0x11d')]===_0xe01f('0x11e')?_0x8533d4+_0x466833[_0xe01f('0x11f')](_0xdf6cd5):_0x466833['substr'](0x0,_0x44915a-_0xdf6cd5)+_0x8533d4);}else{this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,rs[_0xe01f('0x11c')]({'charset':'*','length':_0x44915a}));}}else{this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,'');}}else{this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x3564a8,_0x466833);}return _0x647e75;};AGIVertices[_0xe01f('0xe')]['getsecretdigits']=function(_0x372813){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x120'),_0x372813['label']));return this[_0xe01f('0xb')](_0x372813);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x121')]=function(_0x1b409e){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x1b409e[_0xe01f('0x38')]));this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x1b409e,_0x1b409e[_0xe01f('0x122')]);return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x123'),_0x1b409e[_0xe01f('0x122')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x124')]=function(_0x390de1){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x125'),_0x390de1['label']));if(!this[_0xe01f('0xa8')](_0x390de1['aws_access_key_id'])||!this[_0xe01f('0xa8')](_0x390de1['aws_secret_access_key'])){return this[_0xe01f('0x37')]['noop'](_0xe01f('0x126'));}if(!this[_0xe01f('0xa8')](_0x390de1['text'])){return this['channel'][_0xe01f('0xab')]('no\x20text\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x127'),_0x390de1[_0xe01f('0x5d')]));var _0xf704a=this[_0xe01f('0x128')][_0xe01f('0x72')](this,_0x390de1);if(_0xf704a){this['channel'][_0xe01f('0xab')](util['format'](_0xe01f('0x129'),_0xf704a));var _0x31c499=this['channel'][_0xe01f('0x105')](_0xf704a);try{fs[_0xe01f('0x106')](_0xf704a+_0xe01f('0x107'));}catch(_0xf2be01){logger[_0xe01f('0x2a')](_0xf2be01);}return _0x31c499;}return this['channel']['error'](_0x390de1,_0xe01f('0x12a'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x12b')]=function(_0x530a05){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x12c'),_0x530a05[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x530a05['aws_access_key_id'])||!this[_0xe01f('0xa8')](_0x530a05[_0xe01f('0x8d')])){return this['channel']['noop'](_0xe01f('0x126'));}if(!this[_0xe01f('0xa8')](_0x530a05[_0xe01f('0x8f')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x12d'));}if(!this[_0xe01f('0xa8')](_0x530a05['text'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this['channel'][_0xe01f('0xe8')]=!![];this[_0xe01f('0x36')](_0x530a05);this['createSquareMessage'](_0x530a05['text'],'in','','');this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x12e'),_0x530a05[_0xe01f('0x5d')]));var _0x36bd2a=this[_0xe01f('0x8b')]['sync'](this,_0x530a05);if(_0x36bd2a){for(var _0xe6c8f4 in _0x36bd2a){if(_0x36bd2a[_0xe01f('0x9d')](_0xe6c8f4)&&_[_0xe01f('0x97')](_0x36bd2a[_0xe6c8f4])){this[_0xe01f('0x37')][_0xe01f('0xa0')](util['format'](_0xe01f('0x12f'),_0xe6c8f4[_0xe01f('0xf5')]()),_0x36bd2a[_0xe6c8f4]);}}if(_['isNil'](_0x36bd2a[_0xe01f('0x7a')])){return this['channel'][_0xe01f('0xab')](_0xe01f('0x130'));}else{this[_0xe01f('0x43')](_0x36bd2a[_0xe01f('0x7a')],_0xe01f('0xea'),_0xe01f('0x131'),'');return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x132'),_0x36bd2a[_0xe01f('0x7a')]));}}return this['channel'][_0xe01f('0x2a')](_0x530a05,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xe01f('0xe')]['googleasr']=function(_0x265b06){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x133'),_0x265b06['label'],_0x265b06[_0xe01f('0x69')]));if(!this[_0xe01f('0xa8')](_0x265b06['key'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x134'));}var _0x368a1e=_0xe01f('0x135');var _0x466fbd=util[_0xe01f('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xe01f('0x11c')](0x4));var _0x59c632=util['format'](_0xe01f('0x9e'),_0x466fbd,_0x368a1e);var _0x3f5da1=!![];if(_0x265b06[_0xe01f('0x136')]===_0xe01f('0x137')){_0x3f5da1=![];}var _0x1fc959=this['channel'][_0xe01f('0x138')](_0x466fbd,_0x368a1e,_0x265b06['intKey'],_0x265b06[_0xe01f('0x69')],undefined,_0x3f5da1);if(_0x1fc959[_0xe01f('0xa5')]!==-0x1){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x139'),_0x59c632));var _0x59fa10=this[_0xe01f('0x90')]['sync'](this,_0x265b06,_0x59c632);if(_0x59fa10){for(var _0x4e5e47 in _0x59fa10){if(_0x59fa10[_0xe01f('0x9d')](_0x4e5e47)){this['channel']['setVariable'](util['format'](_0xe01f('0x13a'),_0x4e5e47[_0xe01f('0xf5')]()),_0x59fa10[_0x4e5e47]);}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x13b'),JSON['stringify'](_0x59fa10)));}}return _0x1fc959;};AGIVertices['prototype'][_0xe01f('0x13c')]=function(_0x273e4d){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x13d'),_0x273e4d[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x273e4d[_0xe01f('0x93')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x13e'));}if(!this[_0xe01f('0xa8')](_0x273e4d[_0xe01f('0x94')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x1b7e30=_0xe01f('0x135');var _0x327c0a=util[_0xe01f('0x26')](_0xe01f('0x13f'),FILES_PATH,rs[_0xe01f('0x11c')](0x4));var _0x284f96=util[_0xe01f('0x26')](_0xe01f('0x9e'),_0x327c0a,_0x1b7e30);var _0x1e8b1b=!![];if(_0x273e4d['beep']===_0xe01f('0x137')){_0x1e8b1b=![];}var _0x5b96b5=this[_0xe01f('0x37')][_0xe01f('0x138')](_0x327c0a,_0x1b7e30,_0x273e4d[_0xe01f('0x140')],_0x273e4d[_0xe01f('0x69')],undefined,_0x1e8b1b);if(_0x5b96b5[_0xe01f('0xa5')]!==-0x1){this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('tilde\x20%s\x20file\x20created',_0x284f96));var _0x5e01a7=this[_0xe01f('0x92')][_0xe01f('0x72')](this,_0x273e4d,_0x284f96);if(_0x5e01a7){for(var _0x2d789a in _0x5e01a7){if(_0x5e01a7['hasOwnProperty'](_0x2d789a)){this[_0xe01f('0x37')][_0xe01f('0xa0')](util['format'](_0xe01f('0x141'),_0x2d789a[_0xe01f('0xf5')]()),_0x5e01a7[_0x2d789a]);}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('TildeASR\x20Result\x20%s',JSON[_0xe01f('0x75')](_0x5e01a7)));}}return _0x5b96b5;};AGIVertices[_0xe01f('0xe')][_0xe01f('0x142')]=function(_0x33d212){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x143'),_0x33d212[_0xe01f('0x38')]));return this[_0xe01f('0x37')]['continueAt'](_0x33d212[_0xe01f('0x3e')],_0x33d212[_0xe01f('0x3f')],_0x33d212[_0xe01f('0x144')]);};AGIVertices['prototype'][_0xe01f('0x145')]=function(_0x4a4e4d){logger['info'](util[_0xe01f('0x26')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4a4e4d[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x4a4e4d[_0xe01f('0x146')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4a4e4d,_0xe01f('0x147'));}try{var _0x141da6=eval(_0x4a4e4d[_0xe01f('0x146')])?_0xe01f('0x148'):'false';this['channel'][_0xe01f('0xab')](util['format'](_0xe01f('0x149'),_0x4a4e4d[_0xe01f('0x146')],_0x141da6));return{'code':0xc8,'result':_0x141da6};}catch(_0x390d60){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xe01f('0xe')][_0xe01f('0x14a')]=function(_0x2b283c){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x14b'),_0x2b283c['label']));if(!this['isConfigured'](_0x2b283c['interval_id'])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x2b283c,'no\x20interval\x20configured');}var _0x214f63=this['getIntervals'][_0xe01f('0x72')](this,_0x2b283c[_0xe01f('0x14c')]);if(!_0x214f63){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x2b283c,_0xe01f('0x14d'));}for(var _0x16811d=0x0;_0x16811d<_0x214f63['length'];_0x16811d+=0x1){var _0x2b3baf=this[_0xe01f('0x37')][_0xe01f('0xf')](util[_0xe01f('0x26')]('IFTIME(%s?true:false)',_0x214f63[_0x16811d]));if(_0x2b3baf['result']===-0x1){return _0x2b3baf;}logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0x2b3baf[_0xe01f('0xa7')]));if(_0x2b3baf[_0xe01f('0xa7')]==='true'){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0xe01f('0x148')));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0xe01f('0x148')));return{'code':0xc8,'result':_0xe01f('0x148')};}else{logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x14e'),_0x214f63[_0x16811d],_0xe01f('0x14f')));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x14e'),_0x214f63[_0x16811d],'false'));}}return{'code':0xc8,'result':_0xe01f('0x14f')};};AGIVertices['prototype'][_0xe01f('0x150')]=function(_0x3ef778){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3ef778[_0xe01f('0x38')]));return this[_0xe01f('0x37')][_0xe01f('0x150')]();};AGIVertices[_0xe01f('0xe')][_0xe01f('0x151')]=function(_0x471228){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x152'),_0x471228[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x471228['key'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x134'));}var _0x204565=_0xe01f('0x135');var _0x30f47a=util['format'](_0xe01f('0x13f'),FILES_PATH,rs[_0xe01f('0x11c')](0x4));var _0xf3486d=util[_0xe01f('0x26')](_0xe01f('0x9e'),_0x30f47a,_0x204565);var _0x5f4888=!![];if(_0x471228[_0xe01f('0x136')]==='NOBEEP'){_0x5f4888=![];}var _0x1a5adb=this[_0xe01f('0x37')][_0xe01f('0x138')](_0x30f47a,_0x204565,_0x471228['intKey'],_0x471228[_0xe01f('0x69')],undefined,_0x5f4888);if(_0x1a5adb[_0xe01f('0xa5')]!==-0x1){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x153'),_0xf3486d));var _0x34d90e=this[_0xe01f('0x85')][_0xe01f('0x72')](this,_0x471228,_0xf3486d);if(_0x34d90e){for(var _0x179b6e in _0x34d90e){if(_0x34d90e['hasOwnProperty'](_0x179b6e)){this[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')]('ISPEECH_ASR_%s',_0x179b6e[_0xe01f('0xf5')]()),_0x34d90e[_0x179b6e]);}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x154'),JSON[_0xe01f('0x75')](_0x34d90e)));}}return _0x1a5adb;};AGIVertices['prototype'][_0xe01f('0x155')]=function(_0x2f9966){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x156'),_0x2f9966[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x2f9966[_0xe01f('0x86')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20key\x20configured');}if(!this[_0xe01f('0xa8')](_0x2f9966[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x157'),_0x2f9966[_0xe01f('0x5d')]));var _0x5ce563=this['ispeechTTS'][_0xe01f('0x72')](this,_0x2f9966);if(_0x5ce563){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x153'),_0x5ce563));var _0x38e4b4=this['channel'][_0xe01f('0x105')](_0x5ce563,_0x2f9966[_0xe01f('0x140')]);try{fs[_0xe01f('0x106')](_0x5ce563+_0xe01f('0x107'));}catch(_0x52f76b){logger[_0xe01f('0x2a')](_0x52f76b);}return _0x38e4b4;}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x2f9966,_0xe01f('0x158'));};AGIVertices['prototype'][_0xe01f('0x159')]=function(_0x227a72){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x227a72[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x227a72[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x227a72,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xe01f('0x15b'),this['channel'][_0xe01f('0x3a')],_0x227a72[_0xe01f('0x15a')]));var _0x1e4e83=this[_0xe01f('0x54')][_0xe01f('0x72')](this,_0x227a72[_0xe01f('0x15a')]);if(_0x1e4e83){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72['findBy']));this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x227a72['findBy']));return{'code':0xc8,'result':_0xe01f('0x15f')};}};AGIVertices[_0xe01f('0xe')][_0xe01f('0x160')]=function(_0x5754d4){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x161'),_0x5754d4[_0xe01f('0x38')]));if(!this['isConfigured'](_0x5754d4[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5754d4,_0xe01f('0x162'));}logger['info'](util[_0xe01f('0x26')](_0xe01f('0x15b'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));var _0x9a2870=this[_0xe01f('0x53')][_0xe01f('0x72')](this,_0x5754d4[_0xe01f('0x15a')]);if(_0x9a2870){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x5754d4[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15f')};}};AGIVertices['prototype']['math']=function(_0x1d2586){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x163'),_0x1d2586[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x1d2586[_0xe01f('0x164')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x1d2586,'no\x20operation\x20configured');}this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('math\x20%s',_0x1d2586[_0xe01f('0x164')]));var _0xa45081=eval(_0x1d2586[_0xe01f('0x164')]);if(!this[_0xe01f('0xa8')](_0x1d2586[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xda'));}var _0x54f8a2=this[_0xe01f('0xf')]['sync'](this,_0x1d2586['variable_id']);if(!_0x54f8a2){return this[_0xe01f('0x37')]['error'](_0x1d2586,_0xe01f('0xdb'));}if(_[_0xe01f('0x9b')](_0xa45081)){var _0x29beb6=this;_0xa45081[_0xe01f('0xdd')](function(_0x458896,_0x11e363){_0x29beb6[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0x165'),_0x54f8a2,_0x11e363),_0x458896);});return this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x166'),_0x54f8a2));}else{return this[_0xe01f('0x37')]['setVariable'](_0x54f8a2,_0xa45081);}};AGIVertices[_0xe01f('0xe')][_0xe01f('0xa')]=function(_0x45d84c){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x167'),_0x45d84c[_0xe01f('0x38')]));if(_0x45d84c[_0xe01f('0xaa')]===0x0){return this[_0xe01f('0xa9')](_0x45d84c);}_0x45d84c[_0xe01f('0xaa')]-=0x1;if(!this[_0xe01f('0xa8')](_0x45d84c[_0xe01f('0x113')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x45d84c,_0xe01f('0x114'));}var _0x4e2054=this[_0xe01f('0x115')][_0xe01f('0x72')](this,_0x45d84c[_0xe01f('0x113')]);if(!_0x4e2054){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x45d84c,'no\x20file\x20audio\x20found');}var _0x3f258a=this[_0xe01f('0x37')][_0xe01f('0x116')](_0x4e2054,_0x45d84c[_0xe01f('0x117')],_0x45d84c[_0xe01f('0x168')]);var _0x3651e4=_0x3f258a[_0xe01f('0xa5')];if(_0x3f258a[_0xe01f('0xa5')]===-0x1){this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x45d84c,'-1');return _0x3f258a;}else if(_0x3f258a[_0xe01f('0xa7')]===_0xe01f('0x69')){_0x3f258a[_0xe01f('0xa5')]=_0x3f258a[_0xe01f('0xa5')]['length']>0x0?_0x3f258a[_0xe01f('0xa5')]:'t';}else if(_['isEmpty'](_0x3f258a['result'])){_0x3f258a[_0xe01f('0xa5')]='#';_0x3651e4='#';}if(!this[_0xe01f('0xa8')](_0x45d84c['variable_id'])){this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4e2c97=this['getVariable'][_0xe01f('0x72')](this,_0x45d84c[_0xe01f('0xd9')]);if(!_0x4e2c97){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x45d84c,'no\x20variable\x20found');}this[_0xe01f('0x37')][_0xe01f('0xa0')](_0x4e2c97,_0x3651e4);}this['createSquareDetailsReport'][_0xe01f('0x72')](this,_0x45d84c,_0x3651e4);return _0x3f258a;};AGIVertices[_0xe01f('0xe')][_0xe01f('0xab')]=function(_0x3ba4e7){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x169'),_0x3ba4e7['label']));return this[_0xe01f('0x37')][_0xe01f('0xab')](_0x3ba4e7[_0xe01f('0x16a')]||_0x3ba4e7[_0xe01f('0x38')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x16b')]=function(_0x228eaa){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x16c'),_0x228eaa[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x228eaa[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x228eaa,_0xe01f('0x162'));}logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15b'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x228eaa[_0xe01f('0x15a')]));var _0x57fc60=this['getPause']['sync'](this,_0x228eaa[_0xe01f('0x16d')]);var _0x1bf178=this[_0xe01f('0x51')][_0xe01f('0x72')](this,_0x228eaa[_0xe01f('0x15a')],_0x57fc60);if(_0x1bf178){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x228eaa['findBy']));this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')]['callerid'],_0x228eaa['findBy']));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this['channel'][_0xe01f('0x3a')],_0x228eaa[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this['channel']['callerid'],_0x228eaa[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15f')};}};AGIVertices['prototype'][_0xe01f('0x16e')]=function(_0x5ed1ce){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x16f'),_0x5ed1ce[_0xe01f('0x38')]));if(!this['isConfigured'](_0x5ed1ce['file_id'])){return this[_0xe01f('0x37')]['error'](_0x5ed1ce,_0xe01f('0x114'));}var _0x12958d=this['getSound'][_0xe01f('0x72')](this,_0x5ed1ce[_0xe01f('0x113')]);if(!_0x12958d){return this['channel'][_0xe01f('0x2a')](_0x5ed1ce,_0xe01f('0x170'));}var _0x2ef073=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0x171'),[_0x12958d,_0x5ed1ce[_0xe01f('0x110')]]);if(_0x2ef073[_0xe01f('0xa5')]===-0x1){return _0x2ef073;}return this['channel']['noop'](util[_0xe01f('0x26')](_0xe01f('0xc5'),_0xe01f('0x171'),_0x12958d));};AGIVertices['prototype']['queue']=function(_0x370647){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x172'),_0x370647[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x370647[_0xe01f('0x173')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x370647,_0xe01f('0x174'));}var _0x34ea47='';var _0x164255=parseInt(_0x370647['queue_id'],0xa);if(isNaN(_0x164255)){_0x34ea47=_0x370647['queue_id'];}else{_0x34ea47=this[_0xe01f('0x14')][_0xe01f('0x72')](this,_0x370647[_0xe01f('0x173')]);if(!_0x34ea47){return this['channel'][_0xe01f('0x2a')](_0x370647,'no\x20queue\x20found');}}var _0x15058c='';if(this['isConfigured'](_0x370647['file_id'])){var _0x1de0fe=this['getSound'][_0xe01f('0x72')](this,_0x370647[_0xe01f('0x113')]);if(_0x1de0fe){_0x15058c=_0x1de0fe;}}this['createSquareDetailsReport'][_0xe01f('0x72')](this,_0x370647,_0x34ea47);if(_0x370647['opts'][_0xe01f('0x175')]('x')<0x0){_0x370647[_0xe01f('0x110')]+='x';}if(_0x370647['opts'][_0xe01f('0x175')]('X')<0x0){_0x370647[_0xe01f('0x110')]+='X';}this[_0xe01f('0x37')][_0xe01f('0xa0')](_0xe01f('0x176'),_0x34ea47?_0x34ea47[_0xe01f('0x177')]():'');var _0xa1ec2=this[_0xe01f('0x37')][_0xe01f('0xac')](_0xe01f('0x178'),[_0x34ea47,_0x370647[_0xe01f('0x110')],_0x370647[_0xe01f('0x67')],_0x15058c,_0x370647[_0xe01f('0x69')],_0x370647[_0xe01f('0x6')],_0x370647[_0xe01f('0x179')],_0x370647[_0xe01f('0x17a')],'',_0x370647[_0xe01f('0x17b')]]);if(_0xa1ec2[_0xe01f('0xa5')]===-0x1){return _0xa1ec2;}return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0xc5'),_0xe01f('0x178'),_0x34ea47));};AGIVertices[_0xe01f('0xe')]['record']=function(_0x5963fe){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5963fe[_0xe01f('0x38')]));var _0x23b29a=_0x5963fe[_0xe01f('0x17c')]||_0xe01f('0x135');var _0x4d8f0b=util[_0xe01f('0x26')](_0xe01f('0x17d'),this[_0xe01f('0x37')]['uniqueid'],rs['generate'](0x5));var _0x1aaeba=util[_0xe01f('0x26')](_0xe01f('0x17e'),FILES_PATH,_0x4d8f0b,_0x23b29a);var _0x608a3a=util[_0xe01f('0x26')](_0xe01f('0x13f'),FILES_PATH,_0x4d8f0b);this[_0xe01f('0x3b')]['sync'](this,_0x5963fe,_0x4d8f0b,_0x1aaeba);this['channel'][_0xe01f('0xa0')]('RECORDING_SAVENAME',_0x4d8f0b);logger[_0xe01f('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x608a3a,_0x23b29a,_0x5963fe[_0xe01f('0x17f')],_0x5963fe[_0xe01f('0x69')]);return this[_0xe01f('0x37')][_0xe01f('0x138')](_0x608a3a,_0x23b29a,_0x5963fe[_0xe01f('0x17f')],_0x5963fe[_0xe01f('0x69')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x1a67ee){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x180'),_0x1a67ee[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x1a67ee[_0xe01f('0x67')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20url\x20configured');}var _0xbc15e8=this['restAPI'][_0xe01f('0x72')](this,_0x1a67ee);logger['info'](util[_0xe01f('0x26')]('Response:',util['inspect'](_0xbc15e8,{'showHidden':![],'depth':null})));if(!this[_0xe01f('0xa8')](_0x1a67ee['variable_id'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x181'));}var _0x301854=this[_0xe01f('0xf')]['sync'](this,_0x1a67ee[_0xe01f('0xd9')]);if(!_0x301854){return this[_0xe01f('0x37')]['error'](_0x1a67ee,_0xe01f('0xdb'));}this[_0xe01f('0x37')][_0xe01f('0xa0')](util[_0xe01f('0x26')](_0xe01f('0x182'),_0x301854),_0xbc15e8[_0xe01f('0x78')]?_0xbc15e8['statusCode']:_0xe01f('0x183'));this[_0xe01f('0x37')][_0xe01f('0xa0')](util['format']('%s_STATUS_MESSAGE',_0x301854),_0xbc15e8['statusMessage']?_0xbc15e8[_0xe01f('0x79')]:'OK');if(_0xbc15e8[_0xe01f('0x76')]){try{this[_0xe01f('0x9f')](_0xbc15e8['body'],_0x301854);}catch(_0xfaf156){logger['error'](util[_0xe01f('0x26')](_0xe01f('0x184'),_0x301854));}}return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format'](_0xe01f('0x185'),_0x301854));};AGIVertices[_0xe01f('0xe')]['saydigits']=function(_0x9783cc){logger['info'](util[_0xe01f('0x26')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x9783cc[_0xe01f('0x38')]));return this['channel'][_0xe01f('0x186')](_0x9783cc[_0xe01f('0x187')][_0xe01f('0x59')](/\s+/g,''),_0x9783cc[_0xe01f('0x17f')]);};AGIVertices['prototype'][_0xe01f('0x188')]=function(_0x4aea88){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x189'),_0x4aea88[_0xe01f('0x38')]));return this[_0xe01f('0x37')][_0xe01f('0x18a')](_0x4aea88[_0xe01f('0x6a')][_0xe01f('0x59')](/\s+/g,''),_0x4aea88[_0xe01f('0x17f')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x18b')]=function(_0x3b8de5){logger['info'](util['format'](_0xe01f('0x18c'),_0x3b8de5['label']));return this[_0xe01f('0x37')][_0xe01f('0x18d')](_0x3b8de5['text'],_0x3b8de5[_0xe01f('0x17f')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x18e')]=function(_0x358b92){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x358b92['label']));if(!this[_0xe01f('0xa8')](_0x358b92[_0xe01f('0x18f')])){return this[_0xe01f('0x37')][_0xe01f('0xab')]('no\x20mail\x20account\x20configured');}var _0x1ad58e=this['getMailAccount'][_0xe01f('0x72')](this,_0x358b92['account_id']);if(!_0x1ad58e||!_0x1ad58e[_0xe01f('0x190')]){return this[_0xe01f('0x37')]['error'](_0x358b92,_0xe01f('0x191'));}var _0x57b083={'from':util[_0xe01f('0x26')]('\x22%s\x22\x20<%s>',_0x1ad58e[_0xe01f('0x12')],_0x1ad58e[_0xe01f('0x192')]||_0x1ad58e[_0xe01f('0x190')][_0xe01f('0x193')]),'to':_0x358b92['to']||'','cc':_0x358b92['cc']||'','bcc':_0x358b92[_0xe01f('0x194')]||'','subject':_0x358b92[_0xe01f('0x195')],'html':_0x358b92[_0xe01f('0x5d')],'text':_0x358b92[_0xe01f('0x5d')]};if(this[_0xe01f('0xa8')](_0x358b92['template_id'])){}logger['debug'](_0xe01f('0x196'),JSON[_0xe01f('0x75')](_0x57b083));this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x358b92,_0x358b92[_0xe01f('0x18f')]);this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x1ad58e[_0xe01f('0x12')]));this[_0xe01f('0x20')][_0xe01f('0x72')](this,_0x1ad58e['smtpOptions'],_0x57b083);return this[_0xe01f('0x37')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xe01f('0xe')]['sendFax']=function(_0x1eabdb){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x197'),_0x1eabdb[_0xe01f('0x38')]));return this['channel'][_0xe01f('0xab')](_0xe01f('0x198'));};AGIVertices[_0xe01f('0xe')]['sendSMS']=function(_0x26f7cf){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x199'),_0x26f7cf[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x26f7cf[_0xe01f('0x19a')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x19b'));}var _0x24d812=this[_0xe01f('0x33')]['sync'](this,_0x26f7cf[_0xe01f('0x19a')]);if(!_0x24d812){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x26f7cf,_0xe01f('0x19c'));}var _0x4858f6={'body':_0x26f7cf[_0xe01f('0x19d')],'phone':_0x26f7cf['to']||'','SmsAccountId':_0x24d812['id']};logger[_0xe01f('0xe1')](_0xe01f('0x19e'),JSON['stringify'](_0x4858f6));this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x26f7cf,_0x26f7cf[_0xe01f('0x19a')]);this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x19f'),_0x24d812[_0xe01f('0x12')]));this['createSmsMessage']['sync'](this,_0x4858f6);return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x1a0'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1a1')]=function(_0x5c0b1d){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1a2'),_0x5c0b1d[_0xe01f('0x38')]));if(!this['isConfigured'](_0x5c0b1d[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5c0b1d,'no\x20variable\x20selected');}var _0x3b9657=this[_0xe01f('0xf')]['sync'](this,_0x5c0b1d['variable_id']);if(!_0x3b9657){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x5c0b1d,'no\x20variable\x20found');}return this['channel'][_0xe01f('0xa0')](_0x3b9657,_0x5c0b1d[_0xe01f('0x1a3')]);};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1a4')]=function(_0x5a29fe){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1a5'),_0x5a29fe[_0xe01f('0x38')]));this['channel'][_0xe01f('0xab')](_0xe01f('0x1a6'));var _0x2533dd=this[_0xe01f('0x37')]['getVariable'](_0xe01f('0x1a7'));if(!_['isEmpty'](_0x2533dd[_0xe01f('0xa7')])){this[_0xe01f('0x37')]['uniqueid']=_0x2533dd[_0xe01f('0xa7')];}if(_0x5a29fe[_0xe01f('0xb9')]==='yes'){this['channel'][_0xe01f('0xab')](_0xe01f('0x1a8'));return this[_0xe01f('0x37')][_0xe01f('0xb9')]();}return this[_0xe01f('0x37')][_0xe01f('0xab')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xe01f('0x1a9')]=function(_0x4da413){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1aa'),_0x4da413[_0xe01f('0x38')]));if(!this['isConfigured'](_0x4da413['project_id'])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4da413,_0xe01f('0x1ab'));}var _0x11c807=this[_0xe01f('0x1ac')][_0xe01f('0x72')](this,_0x4da413[_0xe01f('0x1ad')]);if(!this[_0xe01f('0xa8')](_0x11c807)){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4da413,util[_0xe01f('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x4da413[_0xe01f('0x1ad')]));}if(_0x11c807===this[_0xe01f('0x37')][_0xe01f('0x1ae')]){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x4da413,_0xe01f('0x1af'));}this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x4da413,_0x11c807);var _0x3360e7=this['channel'][_0xe01f('0xac')]('AGI',util[_0xe01f('0x26')](_0xe01f('0x1b0'),config[_0xe01f('0x6')][_0xe01f('0x1b1')]||_0xe01f('0x1b2'),_0x11c807,this[_0xe01f('0x37')][_0xe01f('0x1ae')]));if(_0x3360e7[_0xe01f('0xa5')]===-0x1){return _0x3360e7;}return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0xc5'),_0xe01f('0x1b3'),_0x11c807));};AGIVertices['prototype'][_0xe01f('0x1b4')]=function(_0x284294){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x1b5'),_0x284294[_0xe01f('0x38')]));var _0x10e62a=this['shellCommand']['sync'](this,_0x284294['command']);this[_0xe01f('0x36')][_0xe01f('0x72')](this,_0x284294,_0x284294[_0xe01f('0x1b6')]);if(this['isConfigured'](_0x284294['variable_id'])){var _0x4f73d5=this['getVariable'][_0xe01f('0x72')](this,_0x284294[_0xe01f('0xd9')]);if(_0x4f73d5){this[_0xe01f('0x37')]['setVariable'](_0x4f73d5,_0x10e62a);return this[_0xe01f('0x37')][_0xe01f('0xab')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x284294[_0xe01f('0x1b6')],_0x4f73d5));}}return this['channel']['noop'](util['format'](_0xe01f('0x1b7'),_0x284294[_0xe01f('0x1b6')]));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1b8')]=function(_0x57e6b0){logger[_0xe01f('0x2c')](util['format'](_0xe01f('0x1b9'),_0x57e6b0[_0xe01f('0x38')]));_0x57e6b0['text']=_0x57e6b0['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe01f('0xa8')](_0x57e6b0['apiKey'])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0x1ba'));}if(!this[_0xe01f('0xa8')](_0x57e6b0[_0xe01f('0x5d')])){return this[_0xe01f('0x37')][_0xe01f('0xab')](_0xe01f('0xc8'));}this['channel']['noop'](util[_0xe01f('0x26')](_0xe01f('0x1bb'),_0x57e6b0['text']));var _0x2a7e94=this[_0xe01f('0x5a')][_0xe01f('0x72')](this,_0x57e6b0);if(_0x2a7e94){this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2a7e94));var _0x3908d0=this[_0xe01f('0x37')][_0xe01f('0x105')](_0x2a7e94);try{fs['unlink'](_0x2a7e94+'.wav');}catch(_0xf35d2c){logger['error'](_0xf35d2c);}return _0x3908d0;}return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x57e6b0,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x576d78){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x1bc'),_0x576d78[_0xe01f('0x38')]));_0x576d78['text']=_0x576d78['text'][_0xe01f('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x576d78['text'])){return this['channel'][_0xe01f('0xab')](_0xe01f('0xc8'));}this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x1bd'),_0x576d78[_0xe01f('0x5d')]));var _0x255ec5=this[_0xe01f('0x64')][_0xe01f('0x72')](this,_0x576d78);if(_0x255ec5){this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x255ec5));var _0x4b5da1=this['channel'][_0xe01f('0x105')](_0x255ec5);try{fs[_0xe01f('0x106')](_0x255ec5+'.wav');}catch(_0x87c80){logger[_0xe01f('0x2a')](_0x87c80);}return _0x4b5da1;}return this['channel'][_0xe01f('0x2a')](_0x576d78,_0xe01f('0x1be'));};AGIVertices[_0xe01f('0xe')][_0xe01f('0x1bf')]=function(_0x1fff23){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x1c0'),_0x1fff23['label']));if(!this[_0xe01f('0xa8')](_0x1fff23[_0xe01f('0x15a')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x1fff23,_0xe01f('0x162'));}logger['info'](util[_0xe01f('0x26')](_0xe01f('0x15b'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x1fff23[_0xe01f('0x15a')]));var _0x18a0b9=this[_0xe01f('0x52')][_0xe01f('0x72')](this,_0x1fff23['findBy']);if(_0x18a0b9){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x1fff23['findBy']));this['channel'][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15c'),this['channel']['callerid'],_0x1fff23[_0xe01f('0x15a')]));return{'code':0xc8,'result':_0xe01f('0x15d')};}else{logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xe01f('0x3a')],_0x1fff23[_0xe01f('0x15a')]));this[_0xe01f('0x37')][_0xe01f('0xab')](util[_0xe01f('0x26')](_0xe01f('0x15e'),this[_0xe01f('0x37')][_0xe01f('0x3a')],_0x1fff23['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe01f('0xe')]['voicemail']=function(_0x1ea260){logger['info'](util[_0xe01f('0x26')](_0xe01f('0x1c1'),_0x1ea260[_0xe01f('0x38')]));var _0x4ee380=this['channel'][_0xe01f('0xac')](_0xe01f('0x1c2'),[_0x1ea260[_0xe01f('0x1c3')],_0x1ea260[_0xe01f('0x7c')]]);if(_0x4ee380[_0xe01f('0xa5')]===-0x1){return _0x4ee380;}return this[_0xe01f('0x37')]['noop'](util[_0xe01f('0x26')](_0xe01f('0xc5'),_0xe01f('0x1c2'),_0x1ea260[_0xe01f('0x1c3')]));};AGIVertices[_0xe01f('0xe')]['vswitch']=function(_0x1b51d6){logger[_0xe01f('0x2c')](util[_0xe01f('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x1b51d6[_0xe01f('0x38')]));if(!this[_0xe01f('0xa8')](_0x1b51d6[_0xe01f('0xd9')])){return this[_0xe01f('0x37')][_0xe01f('0x2a')](_0x1b51d6,_0xe01f('0x1c4'));}var _0x20c87e=this[_0xe01f('0xf')][_0xe01f('0x72')](this,_0x1b51d6[_0xe01f('0xd9')]);if(!_0x20c87e){return this['channel'][_0xe01f('0x2a')](_0x1b51d6,_0xe01f('0xdb'));}var _0x2586ac=this[_0xe01f('0x37')]['getVariable'](_0x20c87e);return{'code':0xc8,'result':_0x2586ac[_0xe01f('0xa7')]?_0x2586ac[_0xe01f('0xa7')]:'-'};};String['prototype'][_0xe01f('0xa3')]=function(_0x2f3ba4,_0x222341){return this[_0xe01f('0xa2')](_0x2f3ba4)[_0xe01f('0x1c5')](_0x222341);};module[_0xe01f('0x1c6')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 87abe9c..ba5017d 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 _0x17c1=['secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','agentconnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','updateAcw','timer','uniqueid','then','info','error','[%s][UPDATE][ERRORS:%s]','finally','prototype','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','agents','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','channels','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','catch','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','update','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid'];(function(_0x42cc9d,_0x3edd46){var _0x4bb7a9=function(_0x599da2){while(--_0x599da2){_0x42cc9d['push'](_0x42cc9d['shift']());}};_0x4bb7a9(++_0x3edd46);}(_0x17c1,0x16b));var _0x117c=function(_0x22f63e,_0x589989){_0x22f63e=_0x22f63e-0x0;var _0x2375c1=_0x17c1[_0x22f63e];return _0x2375c1;};'use strict';var _=require(_0x117c('0x0'));var moment=require(_0x117c('0x1'));var ami=require(_0x117c('0x2'));var logger=require(_0x117c('0x3'))(_0x117c('0x4'));var RpcUser=require(_0x117c('0x5'));var RpcVoiceAgentReport=require(_0x117c('0x6'));function Acw(_0x47bdaa){this[_0x117c('0x7')]=_0x47bdaa[_0x117c('0x7')];this['agents']=_0x47bdaa['agents'];this['timers']=_0x47bdaa[_0x117c('0x8')];this['channels']={};ami['on'](_0x117c('0x9'),this['syncAgentConnect'][_0x117c('0xa')](this));ami['on'](_0x117c('0xb'),this[_0x117c('0xc')][_0x117c('0xa')](this));ami['on']('hangup',this[_0x117c('0xd')][_0x117c('0xa')](this));ami['on'](_0x117c('0xe'),this[_0x117c('0xf')][_0x117c('0xa')](this));ami['on']('attendedtransfer',this[_0x117c('0x10')]['bind'](this));ami['on'](_0x117c('0x11'),this['syncBlindTransfer'][_0x117c('0xa')](this));ami['on'](_0x117c('0x12'),this[_0x117c('0x13')]['bind'](this));}function getDiff(_0x967e57){var _0x2ebfbf=moment()['milliseconds'](0x0);var _0x3c3885=moment(_0x967e57)['milliseconds'](0x0);return _0x2ebfbf[_0x117c('0x14')](_0x3c3885,'seconds');}Acw['prototype'][_0x117c('0x15')]=function(_0x51e798,_0x19596){var _0x2bfb50=this;var _0x1ab798=getDiff(_0x2bfb50[_0x117c('0x8')][_0x51e798]['lastPauseAt']);clearTimeout(_0x2bfb50[_0x117c('0x8')][_0x51e798][_0x117c('0x16')]);_0x2bfb50[_0x117c('0x8')][_0x51e798][_0x117c('0x16')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x1ab798},_0x2bfb50[_0x117c('0x8')][_0x51e798][_0x117c('0x17')],_0x51e798)[_0x117c('0x18')](function(_0x21ba38){logger[_0x117c('0x19')]('[%s][UPDATE][ACWTIME:%s]',_0x19596,_0x1ab798,_0x21ba38);})['catch'](function(_0x258472){logger[_0x117c('0x1a')](_0x117c('0x1b'),_0x19596,_0x258472);})[_0x117c('0x1c')](function(){delete _0x2bfb50['timers'][_0x51e798];});};Acw[_0x117c('0x1d')]['startAcw']=function(_0x1d740b){try{var _0x50649a=this;var _0x325080=this['channels'][_0x1d740b]['interface'];var _0x2331ec=this['channels'][_0x1d740b][_0x117c('0x1e')];var _0x509785=this[_0x117c('0x7')][_0x2331ec];var _0x578304=![];var _0x21c917=_0x117c('0x1f');if(_0x509785[_0x117c('0x20')]&&_0x509785['mandatoryDispositionPause'][_0x117c('0x21')]){_0x578304=!![];_0x21c917=_0x509785[_0x117c('0x22')]['name'];}return ami[_0x117c('0x23')]({'action':_0x117c('0x24'),'interface':_0x325080,'paused':!![],'reason':_0x21c917})['then'](function(){if(_0x50649a[_0x117c('0x25')][_0x325080]){return RpcUser[_0x117c('0x26')](_0x50649a[_0x117c('0x25')][_0x325080]['id'])[_0x117c('0x18')](function(_0x334447){if(!_0x334447||_0x334447[_0x117c('0x27')]){logger[_0x117c('0x19')](_0x117c('0x28'),_0x1d740b,_0x325080,_0x2331ec);return;}logger[_0x117c('0x19')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x1d740b,_0x325080,_0x2331ec);var _0x47fb2e=_0x50649a[_0x117c('0x29')][_0x1d740b][_0x117c('0x2a')]&&_0x50649a[_0x117c('0x29')][_0x1d740b][_0x117c('0x2b')]?_0x50649a['channels'][_0x1d740b][_0x117c('0x2b')]:_0x1d740b;return RpcUser[_0x117c('0x2c')](_0x50649a['agents'][_0x325080],_0x21c917,_0x47fb2e)['then'](function(_0x45e9f8){_0x50649a[_0x117c('0x7')][_0x2331ec]['available']-=0x1;_0x50649a[_0x117c('0x7')][_0x2331ec]['paused']+=0x1;return _0x45e9f8;});})[_0x117c('0x18')](function(_0x22ae26){if(_0x578304||!_0x22ae26){return;}_0x50649a[_0x117c('0x8')][_0x325080]={};logger['info'](_0x117c('0x2d'),_0x1d740b,_0x50649a[_0x117c('0x7')][_0x2331ec][_0x117c('0x2e')],_0x325080,_0x2331ec);_0x50649a[_0x117c('0x8')][_0x325080][_0x117c('0x16')]=setTimeout(_0x50649a[_0x117c('0x2f')][_0x117c('0xa')](_0x50649a,_0x325080),_0x50649a[_0x117c('0x7')][_0x2331ec][_0x117c('0x2e')]*0x3e8);_0x50649a['timers'][_0x325080]['lastPauseAt']=moment()[_0x117c('0x30')](_0x117c('0x31'));_0x50649a[_0x117c('0x8')][_0x325080][_0x117c('0x17')]=_0x1d740b;_0x50649a[_0x117c('0x8')][_0x325080][_0x117c('0x1e')]=_0x2331ec;_0x50649a['timers'][_0x325080][_0x117c('0x15')]=_0x50649a['updateAcw']['bind'](_0x50649a,_0x325080,_0x1d740b);});}})[_0x117c('0x32')](function(){logger[_0x117c('0x1a')](_0x117c('0x2d'),_0x1d740b,_0x50649a[_0x117c('0x7')][_0x2331ec][_0x117c('0x2e')],_0x325080,_0x2331ec);})[_0x117c('0x1c')](function(){delete _0x50649a[_0x117c('0x29')][_0x1d740b];});}catch(_0x55dad4){logger[_0x117c('0x1a')](_0x117c('0x33'),_0x55dad4['message']);}};Acw['prototype'][_0x117c('0x2f')]=function(_0x530dd0){try{var _0x49b349=this;if(_0x49b349[_0x117c('0x8')][_0x530dd0]){_0x49b349[_0x117c('0x8')][_0x530dd0][_0x117c('0x16')]=![];var _0x2a8b82=_0x49b349['timers'][_0x530dd0][_0x117c('0x17')];var _0x2f8396=_0x49b349[_0x117c('0x8')][_0x530dd0]['queue'];var _0x3618ab=_0x49b349['voiceQueues'][_0x2f8396][_0x117c('0x2e')];logger[_0x117c('0x19')](_0x117c('0x34'),_0x2a8b82,_0x530dd0);RpcUser['getAgent'](this[_0x117c('0x25')][_0x530dd0]['id'])[_0x117c('0x18')](function(_0x32de19){if(_0x32de19[_0x117c('0x35')]===_0x117c('0x1f')){return RpcUser[_0x117c('0x36')](_0x49b349[_0x117c('0x25')][_0x530dd0]);}});RpcVoiceAgentReport[_0x117c('0x37')]({'acwtime':_0x3618ab,'agentacw':!![]},_0x2a8b82,_0x530dd0)['then'](function(_0x5fde3d){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x2a8b82,_0x3618ab,_0x5fde3d);})[_0x117c('0x32')](function(_0x412922){logger['error'](_0x117c('0x1b'),_0x2a8b82,_0x412922);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x530dd0);if(_0x49b349[_0x117c('0x8')]){logger[_0x117c('0x19')](_0x117c('0x38'),JSON[_0x117c('0x39')](_0x49b349['timers']));}}}catch(_0x544590){logger[_0x117c('0x1a')](_0x117c('0x3a'),_0x544590[_0x117c('0x3b')]);}};Acw['prototype'][_0x117c('0x3c')]=function(_0x289866){try{if(this[_0x117c('0x7')][_0x289866[_0x117c('0x1e')]]&&(this[_0x117c('0x7')][_0x289866[_0x117c('0x1e')]]['acw']||this[_0x117c('0x7')][_0x289866[_0x117c('0x1e')]][_0x117c('0x20')])){if(this[_0x117c('0x25')][_0x289866[_0x117c('0x3d')]]){this[_0x117c('0x29')][_0x289866[_0x117c('0x17')]]={'queue':_0x289866['queue'],'interface':_0x289866['interface'],'destlinkedid':_0x289866[_0x117c('0x2b')]};}}}catch(_0x20d1ba){logger[_0x117c('0x1a')](_0x117c('0x3e'),_0x20d1ba[_0x117c('0x3b')]);}};Acw[_0x117c('0x1d')][_0x117c('0x13')]=function(_0x229540){try{if(this[_0x117c('0x7')][_0x229540[_0x117c('0x1e')]]&&(this['voiceQueues'][_0x229540[_0x117c('0x1e')]][_0x117c('0x4')]||this[_0x117c('0x7')][_0x229540['queue']][_0x117c('0x20')])){if(this[_0x117c('0x25')][_0x229540[_0x117c('0x3d')]]){this[_0x117c('0x29')][_0x229540[_0x117c('0x17')]]={'queue':_0x229540[_0x117c('0x1e')],'interface':_0x229540[_0x117c('0x3d')]};}}}catch(_0x63f21a){logger[_0x117c('0x1a')](_0x117c('0x3f'),_0x63f21a[_0x117c('0x3b')]);}};Acw[_0x117c('0x1d')][_0x117c('0xc')]=function(_0x5e2056){try{if(this[_0x117c('0x29')][_0x5e2056['uniqueid']]&&_[_0x117c('0x40')](this[_0x117c('0x29')][_0x5e2056[_0x117c('0x17')]][_0x117c('0x2a')])){logger[_0x117c('0x19')](_0x117c('0x41'),_0x5e2056[_0x117c('0x17')]);this[_0x117c('0x42')](_0x5e2056[_0x117c('0x17')]);}else if(this[_0x117c('0x29')][_0x5e2056['linkedid']]&&_[_0x117c('0x40')](this[_0x117c('0x29')][_0x5e2056[_0x117c('0x43')]][_0x117c('0x2a')])){logger[_0x117c('0x19')]('[%s][HANGUP:LINKEDID]',_0x5e2056[_0x117c('0x43')]);this[_0x117c('0x42')](_0x5e2056[_0x117c('0x43')]);}}catch(_0x4bf1d2){logger['error'](_0x117c('0x44'),_0x4bf1d2[_0x117c('0x3b')]);}};Acw['prototype']['syncHangup']=function(_0x581ca4){try{if(this['channels'][_0x581ca4[_0x117c('0x17')]]&&this[_0x117c('0x29')][_0x581ca4[_0x117c('0x17')]][_0x117c('0x2a')]){logger[_0x117c('0x19')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x581ca4[_0x117c('0x17')]);this[_0x117c('0x42')](_0x581ca4[_0x117c('0x17')]);}else if(this[_0x117c('0x29')][_0x581ca4[_0x117c('0x43')]]&&this[_0x117c('0x29')][_0x581ca4[_0x117c('0x43')]][_0x117c('0x2a')]){logger[_0x117c('0x19')](_0x117c('0x45'),_0x581ca4[_0x117c('0x43')]);this[_0x117c('0x42')](_0x581ca4[_0x117c('0x43')]);}}catch(_0x270b58){logger[_0x117c('0x1a')](_0x117c('0x46'),_0x270b58['message']);}};Acw[_0x117c('0x1d')][_0x117c('0x10')]=function(_0x8bfecf){try{if(!_['isNil'](this[_0x117c('0x29')][_0x8bfecf['transfereeuniqueid']])){this[_0x117c('0x42')](_0x8bfecf[_0x117c('0x47')]);if(this['channels'][_0x8bfecf['secondtransfereruniqueid']]){this[_0x117c('0x29')][_0x8bfecf[_0x117c('0x48')]][_0x117c('0x2a')]=!![];this['channels'][_0x8bfecf[_0x117c('0x49')]]=this['channels'][_0x8bfecf[_0x117c('0x48')]];delete this[_0x117c('0x29')][_0x8bfecf['secondtransfereruniqueid']];}}else if(!_[_0x117c('0x4a')](this[_0x117c('0x29')][_0x8bfecf[_0x117c('0x49')]])){this[_0x117c('0x42')](_0x8bfecf['transfertargetuniqueid']);if(this[_0x117c('0x29')][_0x8bfecf[_0x117c('0x4b')]]){this[_0x117c('0x29')][_0x8bfecf[_0x117c('0x4b')]][_0x117c('0x2a')]=!![];this[_0x117c('0x29')][_0x8bfecf[_0x117c('0x47')]]=this[_0x117c('0x29')][_0x8bfecf[_0x117c('0x4b')]];delete this['channels'][_0x8bfecf[_0x117c('0x4b')]];}}}catch(_0x15132c){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x15132c['message']);}};Acw['prototype'][_0x117c('0x4c')]=function(_0x3cc56e){try{if(this[_0x117c('0x29')][_0x3cc56e[_0x117c('0x4d')]]){logger[_0x117c('0x19')](_0x117c('0x4e'),JSON['stringify'](_0x3cc56e[_0x117c('0x4d')]));this[_0x117c('0x42')](_0x3cc56e['transfereruniqueid']);}else if(this['channels'][_0x3cc56e[_0x117c('0x4f')]]){logger[_0x117c('0x19')](_0x117c('0x50'),JSON['stringify'](_0x3cc56e[_0x117c('0x4f')]));this[_0x117c('0x42')](_0x3cc56e[_0x117c('0x4f')]);}}catch(_0x2332ed){logger[_0x117c('0x1a')](_0x117c('0x51'),_0x2332ed[_0x117c('0x3b')]);}};Acw[_0x117c('0x1d')]['syncAgentRingNoAnswer']=function(_0x174558){try{if(this['voiceQueues'][_0x174558[_0x117c('0x1e')]]&&this['voiceQueues'][_0x174558['queue']][_0x117c('0x52')]===_0x117c('0x53')){if(this[_0x117c('0x25')][_0x174558['interface']]){logger[_0x117c('0x19')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x174558[_0x117c('0x17')],_0x174558[_0x117c('0x3d')],_0x174558[_0x117c('0x1e')]);return RpcUser[_0x117c('0x2c')](this['agents'][_0x174558[_0x117c('0x3d')]],_0x117c('0x54'),_0x174558[_0x117c('0x17')]);}}}catch(_0x5a45cd){logger[_0x117c('0x1a')](_0x117c('0x55'),_0x5a45cd['message']);}};module[_0x117c('0x56')]=Acw; \ No newline at end of file +var _0x23d5=['prototype','updateAcw','lastPauseAt','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','destlinkedid','available','acwTimeout','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','pauseType','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','../../../config/logger','acw','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds'];(function(_0x225f7a,_0x2a0447){var _0x418621=function(_0x490958){while(--_0x490958){_0x225f7a['push'](_0x225f7a['shift']());}};_0x418621(++_0x2a0447);}(_0x23d5,0x18d));var _0x523d=function(_0x20273b,_0xe16f81){_0x20273b=_0x20273b-0x0;var _0x22b4d5=_0x23d5[_0x20273b];return _0x22b4d5;};'use strict';var _=require('lodash');var moment=require('moment');var ami=require('../ami');var logger=require(_0x523d('0x0'))(_0x523d('0x1'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x111d20){this[_0x523d('0x2')]=_0x111d20[_0x523d('0x2')];this[_0x523d('0x3')]=_0x111d20[_0x523d('0x3')];this[_0x523d('0x4')]=_0x111d20[_0x523d('0x4')];this[_0x523d('0x5')]={};ami['on']('agentconnect',this[_0x523d('0x6')][_0x523d('0x7')](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0x523d('0x8'),this[_0x523d('0x9')][_0x523d('0x7')](this));ami['on'](_0x523d('0xa'),this[_0x523d('0xb')][_0x523d('0x7')](this));ami['on']('attendedtransfer',this[_0x523d('0xc')][_0x523d('0x7')](this));ami['on']('blindtransfer',this[_0x523d('0xd')][_0x523d('0x7')](this));ami['on'](_0x523d('0xe'),this['syncAgentConnectPreview'][_0x523d('0x7')](this));}function getDiff(_0x389f2a){var _0x56dc35=moment()[_0x523d('0xf')](0x0);var _0x31d718=moment(_0x389f2a)[_0x523d('0xf')](0x0);return _0x56dc35[_0x523d('0x10')](_0x31d718,_0x523d('0x11'));}Acw[_0x523d('0x12')][_0x523d('0x13')]=function(_0x36fd46,_0x5abaee){var _0x3c9a2b=this;var _0x58a356=getDiff(_0x3c9a2b[_0x523d('0x4')][_0x36fd46][_0x523d('0x14')]);clearTimeout(_0x3c9a2b[_0x523d('0x4')][_0x36fd46]['timer']);_0x3c9a2b[_0x523d('0x4')][_0x36fd46]['timer']=![];return RpcVoiceAgentReport['update']({'acwtime':_0x58a356},_0x3c9a2b[_0x523d('0x4')][_0x36fd46][_0x523d('0x15')],_0x36fd46)[_0x523d('0x16')](function(_0x348d93){logger[_0x523d('0x17')]('[%s][UPDATE][ACWTIME:%s]',_0x5abaee,_0x58a356,_0x348d93);})[_0x523d('0x18')](function(_0x1237aa){logger[_0x523d('0x19')](_0x523d('0x1a'),_0x5abaee,_0x1237aa);})[_0x523d('0x1b')](function(){delete _0x3c9a2b['timers'][_0x36fd46];});};Acw[_0x523d('0x12')][_0x523d('0x1c')]=function(_0x4a350a){try{var _0x4c70c2=this;var _0x4c5854=this[_0x523d('0x5')][_0x4a350a][_0x523d('0x1d')];var _0x5d719a=this['channels'][_0x4a350a][_0x523d('0x1e')];var _0x1a3ff3=this[_0x523d('0x2')][_0x5d719a];var _0x1d827e=![];var _0x5d4c66=_0x523d('0x1f');if(_0x1a3ff3[_0x523d('0x20')]&&_0x1a3ff3[_0x523d('0x21')][_0x523d('0x22')]){_0x1d827e=!![];_0x5d4c66=_0x1a3ff3[_0x523d('0x21')][_0x523d('0x22')];}return ami[_0x523d('0x23')]({'action':_0x523d('0x24'),'interface':_0x4c5854,'paused':!![],'reason':_0x5d4c66})[_0x523d('0x16')](function(){if(_0x4c70c2[_0x523d('0x3')][_0x4c5854]){return RpcUser[_0x523d('0x25')](_0x4c70c2['agents'][_0x4c5854]['id'])[_0x523d('0x16')](function(_0x7f2ba2){if(!_0x7f2ba2||_0x7f2ba2[_0x523d('0x26')]){logger['info'](_0x523d('0x27'),_0x4a350a,_0x4c5854,_0x5d719a);return;}logger[_0x523d('0x17')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x4a350a,_0x4c5854,_0x5d719a);var _0x3c8262=_0x4c70c2[_0x523d('0x5')][_0x4a350a]['attended']&&_0x4c70c2[_0x523d('0x5')][_0x4a350a]['destlinkedid']?_0x4c70c2['channels'][_0x4a350a][_0x523d('0x28')]:_0x4a350a;return RpcUser['savePause'](_0x4c70c2[_0x523d('0x3')][_0x4c5854],_0x5d4c66,_0x3c8262)[_0x523d('0x16')](function(_0x1a9ea1){_0x4c70c2[_0x523d('0x2')][_0x5d719a][_0x523d('0x29')]-=0x1;_0x4c70c2[_0x523d('0x2')][_0x5d719a]['paused']+=0x1;return _0x1a9ea1;});})[_0x523d('0x16')](function(_0x5c5072){if(_0x1d827e||!_0x5c5072){return;}_0x4c70c2[_0x523d('0x4')][_0x4c5854]={};logger[_0x523d('0x17')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4a350a,_0x4c70c2[_0x523d('0x2')][_0x5d719a][_0x523d('0x2a')],_0x4c5854,_0x5d719a);_0x4c70c2[_0x523d('0x4')][_0x4c5854][_0x523d('0x2b')]=setTimeout(_0x4c70c2[_0x523d('0x2c')][_0x523d('0x7')](_0x4c70c2,_0x4c5854),_0x4c70c2[_0x523d('0x2')][_0x5d719a][_0x523d('0x2a')]*0x3e8);_0x4c70c2[_0x523d('0x4')][_0x4c5854][_0x523d('0x14')]=moment()[_0x523d('0x2d')](_0x523d('0x2e'));_0x4c70c2['timers'][_0x4c5854]['uniqueid']=_0x4a350a;_0x4c70c2[_0x523d('0x4')][_0x4c5854][_0x523d('0x1e')]=_0x5d719a;_0x4c70c2[_0x523d('0x4')][_0x4c5854][_0x523d('0x13')]=_0x4c70c2[_0x523d('0x13')]['bind'](_0x4c70c2,_0x4c5854,_0x4a350a);});}})[_0x523d('0x18')](function(){logger[_0x523d('0x19')](_0x523d('0x2f'),_0x4a350a,_0x4c70c2[_0x523d('0x2')][_0x5d719a][_0x523d('0x2a')],_0x4c5854,_0x5d719a);})['finally'](function(){delete _0x4c70c2['channels'][_0x4a350a];});}catch(_0x2d7b1a){logger[_0x523d('0x19')](_0x523d('0x30'),_0x2d7b1a['message']);}};Acw[_0x523d('0x12')][_0x523d('0x2c')]=function(_0x43c052){try{var _0x52b558=this;if(_0x52b558[_0x523d('0x4')][_0x43c052]){_0x52b558[_0x523d('0x4')][_0x43c052]['timer']=![];var _0x47943d=_0x52b558['timers'][_0x43c052][_0x523d('0x15')];var _0x228b1c=_0x52b558[_0x523d('0x4')][_0x43c052][_0x523d('0x1e')];var _0x1c8a0c=_0x52b558[_0x523d('0x2')][_0x228b1c][_0x523d('0x2a')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x47943d,_0x43c052);RpcUser[_0x523d('0x25')](this[_0x523d('0x3')][_0x43c052]['id'])[_0x523d('0x16')](function(_0x3a2648){if(_0x3a2648[_0x523d('0x31')]===_0x523d('0x1f')){return RpcUser[_0x523d('0x32')](_0x52b558[_0x523d('0x3')][_0x43c052]);}});RpcVoiceAgentReport[_0x523d('0x33')]({'acwtime':_0x1c8a0c,'agentacw':!![]},_0x47943d,_0x43c052)['then'](function(_0x26c00a){logger[_0x523d('0x17')](_0x523d('0x34'),_0x47943d,_0x1c8a0c,_0x26c00a);})[_0x523d('0x18')](function(_0x2480b2){logger['error'](_0x523d('0x1a'),_0x47943d,_0x2480b2);});}else{logger[_0x523d('0x19')](_0x523d('0x35'),_0x43c052);if(_0x52b558[_0x523d('0x4')]){logger['info'](_0x523d('0x36'),JSON[_0x523d('0x37')](_0x52b558[_0x523d('0x4')]));}}}catch(_0x280287){logger[_0x523d('0x19')](_0x523d('0x38'),_0x280287[_0x523d('0x39')]);}};Acw[_0x523d('0x12')][_0x523d('0x6')]=function(_0x30706b){try{if(this[_0x523d('0x2')][_0x30706b[_0x523d('0x1e')]]&&(this[_0x523d('0x2')][_0x30706b[_0x523d('0x1e')]][_0x523d('0x1')]||this[_0x523d('0x2')][_0x30706b['queue']][_0x523d('0x20')])){if(this[_0x523d('0x3')][_0x30706b[_0x523d('0x1d')]]){this['channels'][_0x30706b[_0x523d('0x15')]]={'queue':_0x30706b[_0x523d('0x1e')],'interface':_0x30706b[_0x523d('0x1d')],'destlinkedid':_0x30706b[_0x523d('0x28')]};}}}catch(_0x4594cc){logger[_0x523d('0x19')](_0x523d('0x3a'),_0x4594cc[_0x523d('0x39')]);}};Acw['prototype'][_0x523d('0x3b')]=function(_0x18c0ef){try{if(this['voiceQueues'][_0x18c0ef[_0x523d('0x1e')]]&&(this[_0x523d('0x2')][_0x18c0ef[_0x523d('0x1e')]][_0x523d('0x1')]||this[_0x523d('0x2')][_0x18c0ef[_0x523d('0x1e')]][_0x523d('0x20')])){if(this[_0x523d('0x3')][_0x18c0ef[_0x523d('0x1d')]]){this[_0x523d('0x5')][_0x18c0ef[_0x523d('0x15')]]={'queue':_0x18c0ef[_0x523d('0x1e')],'interface':_0x18c0ef[_0x523d('0x1d')]};}}}catch(_0x83796e){logger[_0x523d('0x19')](_0x523d('0x3c'),_0x83796e['message']);}};Acw[_0x523d('0x12')]['syncHangupRequest']=function(_0x4a0fd3){try{if(this['channels'][_0x4a0fd3[_0x523d('0x15')]]&&_[_0x523d('0x3d')](this['channels'][_0x4a0fd3[_0x523d('0x15')]][_0x523d('0x3e')])){logger[_0x523d('0x17')](_0x523d('0x3f'),_0x4a0fd3['uniqueid']);this[_0x523d('0x1c')](_0x4a0fd3[_0x523d('0x15')]);}else if(this['channels'][_0x4a0fd3[_0x523d('0x40')]]&&_[_0x523d('0x3d')](this[_0x523d('0x5')][_0x4a0fd3[_0x523d('0x40')]][_0x523d('0x3e')])){logger[_0x523d('0x17')]('[%s][HANGUP:LINKEDID]',_0x4a0fd3[_0x523d('0x40')]);this['startAcw'](_0x4a0fd3['linkedid']);}}catch(_0x275a4a){logger[_0x523d('0x19')](_0x523d('0x41'),_0x275a4a[_0x523d('0x39')]);}};Acw[_0x523d('0x12')][_0x523d('0x9')]=function(_0x54aeaa){try{if(this[_0x523d('0x5')][_0x54aeaa['uniqueid']]&&this[_0x523d('0x5')][_0x54aeaa[_0x523d('0x15')]][_0x523d('0x3e')]){logger[_0x523d('0x17')](_0x523d('0x42'),_0x54aeaa[_0x523d('0x15')]);this[_0x523d('0x1c')](_0x54aeaa['uniqueid']);}else if(this[_0x523d('0x5')][_0x54aeaa[_0x523d('0x40')]]&&this['channels'][_0x54aeaa['linkedid']][_0x523d('0x3e')]){logger[_0x523d('0x17')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x54aeaa[_0x523d('0x40')]);this[_0x523d('0x1c')](_0x54aeaa[_0x523d('0x40')]);}}catch(_0x30a47d){logger[_0x523d('0x19')](_0x523d('0x43'),_0x30a47d[_0x523d('0x39')]);}};Acw[_0x523d('0x12')]['syncAttendedTransfer']=function(_0x38708e){try{if(!_[_0x523d('0x44')](this[_0x523d('0x5')][_0x38708e[_0x523d('0x45')]])){this[_0x523d('0x1c')](_0x38708e['transfereeuniqueid']);if(this['channels'][_0x38708e['secondtransfereruniqueid']]){this[_0x523d('0x5')][_0x38708e[_0x523d('0x46')]][_0x523d('0x3e')]=!![];this[_0x523d('0x5')][_0x38708e[_0x523d('0x47')]]=this['channels'][_0x38708e[_0x523d('0x46')]];delete this[_0x523d('0x5')][_0x38708e[_0x523d('0x46')]];}}else if(!_[_0x523d('0x44')](this['channels'][_0x38708e['transfertargetuniqueid']])){this[_0x523d('0x1c')](_0x38708e[_0x523d('0x47')]);if(this['channels'][_0x38708e[_0x523d('0x48')]]){this[_0x523d('0x5')][_0x38708e[_0x523d('0x48')]][_0x523d('0x3e')]=!![];this[_0x523d('0x5')][_0x38708e[_0x523d('0x45')]]=this[_0x523d('0x5')][_0x38708e[_0x523d('0x48')]];delete this[_0x523d('0x5')][_0x38708e[_0x523d('0x48')]];}}}catch(_0x26a2ec){logger['error'](_0x523d('0x49'),_0x26a2ec[_0x523d('0x39')]);}};Acw[_0x523d('0x12')][_0x523d('0xd')]=function(_0x4a241c){try{if(this[_0x523d('0x5')][_0x4a241c[_0x523d('0x4a')]]){logger['info'](_0x523d('0x4b'),JSON[_0x523d('0x37')](_0x4a241c[_0x523d('0x4a')]));this[_0x523d('0x1c')](_0x4a241c['transfereruniqueid']);}else if(this[_0x523d('0x5')][_0x4a241c[_0x523d('0x4c')]]){logger[_0x523d('0x17')](_0x523d('0x4d'),JSON['stringify'](_0x4a241c[_0x523d('0x4c')]));this[_0x523d('0x1c')](_0x4a241c[_0x523d('0x4c')]);}}catch(_0x44c3ff){logger[_0x523d('0x19')]('[ACW][syncBlindTransfer]\x20%s',_0x44c3ff[_0x523d('0x39')]);}};Acw[_0x523d('0x12')][_0x523d('0xb')]=function(_0x549487){try{if(this[_0x523d('0x2')][_0x549487[_0x523d('0x1e')]]&&this[_0x523d('0x2')][_0x549487[_0x523d('0x1e')]][_0x523d('0x4e')]==='all'){if(this[_0x523d('0x3')][_0x549487[_0x523d('0x1d')]]){logger['info'](_0x523d('0x4f'),_0x549487[_0x523d('0x15')],_0x549487[_0x523d('0x1d')],_0x549487[_0x523d('0x1e')]);return RpcUser[_0x523d('0x50')](this[_0x523d('0x3')][_0x549487['interface']],_0x523d('0x51'),_0x549487[_0x523d('0x15')]);}}}catch(_0x418fb3){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x418fb3[_0x523d('0x39')]);}};module[_0x523d('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index bc77fc1..0e626a6 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 _0x3442=['password','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','[ami.js][fullybooted]','asterisk-manager','util','ami','../../config/environment','asterisk','port','username'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x3442,0xa8));var _0x2344=function(_0x1233ff,_0x45a521){_0x1233ff=_0x1233ff-0x0;var _0x20ef28=_0x3442[_0x1233ff];return _0x20ef28;};'use strict';var Manager=require(_0x2344('0x0'));var BPromise=require('bluebird');var util=require(_0x2344('0x1'));var logger=require('../../config/logger')(_0x2344('0x2'));var config=require(_0x2344('0x3'));var ami=new Manager(config[_0x2344('0x4')][_0x2344('0x5')],config['asterisk']['ip'],config[_0x2344('0x4')][_0x2344('0x6')],config[_0x2344('0x4')][_0x2344('0x7')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x2344('0x8')](ami[_0x2344('0x9')]);function error(_0x28b5d7){logger['error'](util[_0x2344('0xa')](_0x2344('0xb'),config[_0x2344('0x4')][_0x2344('0x6')],config[_0x2344('0x4')]['ip'],config[_0x2344('0x4')]['port'],util['inspect'](_0x28b5d7,![],null)));}function close(){logger[_0x2344('0xc')](util[_0x2344('0xa')](_0x2344('0xd'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x2344('0x4')][_0x2344('0x5')]));}ami[_0x2344('0xe')]=function(){return function(){return ami['Action']({'action':_0x2344('0xf')});};};ami[_0x2344('0x10')]=function(){return function(){return ami[_0x2344('0x11')]({'action':_0x2344('0x12')});};};ami[_0x2344('0x13')]=function(){return function(){return ami[_0x2344('0x11')]({'action':_0x2344('0x14')});};};ami[_0x2344('0x15')]=function(){return function(){return ami[_0x2344('0x11')]({'action':_0x2344('0x16')});};};ami[_0x2344('0x17')]=function(){return function(){return ami[_0x2344('0x11')]({'action':'coreshowchannels'});};};function connect(){logger[_0x2344('0x18')](util[_0x2344('0xa')](_0x2344('0x19'),config[_0x2344('0x4')][_0x2344('0x6')],config['asterisk']['ip'],config[_0x2344('0x4')][_0x2344('0x5')]));ami[_0x2344('0x1a')](_0x2344('0xc'),error);ami[_0x2344('0x1a')](_0x2344('0x1b'),close);}ami['on'](_0x2344('0x1c'),connect);ami['on'](_0x2344('0x1d'),function(_0x25e77a){logger[_0x2344('0x18')](util[_0x2344('0xa')](_0x2344('0x1e'),config[_0x2344('0x4')][_0x2344('0x6')],config[_0x2344('0x4')]['ip'],config[_0x2344('0x4')][_0x2344('0x5')],util['inspect'](_0x25e77a,![],null)));});ami['on'](_0x2344('0x1f'),function(){logger['info'](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x2344('0x4')][_0x2344('0x6')],config[_0x2344('0x4')]['ip'],config[_0x2344('0x4')][_0x2344('0x5')]));return Promise[_0x2344('0x20')]()[_0x2344('0x21')](ami[_0x2344('0xe')]())[_0x2344('0x21')](ami[_0x2344('0x10')]())[_0x2344('0x21')](ami['actionSipPeerStatus']())[_0x2344('0x21')](ami[_0x2344('0x15')]())[_0x2344('0x21')](ami[_0x2344('0x17')]())['catch'](function(_0x16a19d){logger[_0x2344('0xc')](_0x2344('0x22'),util['inspect'](_0x16a19d,{'showHidden':![],'depth':null}));});});ami[_0x2344('0x1a')](_0x2344('0xc'),error);ami[_0x2344('0x1a')](_0x2344('0x1b'),close);module['exports']=ami; \ No newline at end of file +var _0x9218=['../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','catch','exports','asterisk-manager','bluebird','util','../../config/logger','ami'];(function(_0x348184,_0x1526ba){var _0x2dfd4f=function(_0x3999da){while(--_0x3999da){_0x348184['push'](_0x348184['shift']());}};_0x2dfd4f(++_0x1526ba);}(_0x9218,0xf7));var _0x8921=function(_0x2eca69,_0x1135e2){_0x2eca69=_0x2eca69-0x0;var _0x3d707c=_0x9218[_0x2eca69];return _0x3d707c;};'use strict';var Manager=require(_0x8921('0x0'));var BPromise=require(_0x8921('0x1'));var util=require(_0x8921('0x2'));var logger=require(_0x8921('0x3'))(_0x8921('0x4'));var config=require(_0x8921('0x5'));var ami=new Manager(config['asterisk'][_0x8921('0x6')],config[_0x8921('0x7')]['ip'],config['asterisk'][_0x8921('0x8')],config['asterisk'][_0x8921('0x9')],!![]);ami[_0x8921('0xa')]();ami[_0x8921('0xb')]=BPromise[_0x8921('0xc')](ami[_0x8921('0xd')]);function error(_0x1694e8){logger[_0x8921('0xe')](util['format'](_0x8921('0xf'),config['asterisk'][_0x8921('0x8')],config['asterisk']['ip'],config[_0x8921('0x7')][_0x8921('0x6')],util[_0x8921('0x10')](_0x1694e8,![],null)));}function close(){logger[_0x8921('0xe')](util[_0x8921('0x11')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x8921('0x7')][_0x8921('0x8')],config['asterisk']['ip'],config[_0x8921('0x7')][_0x8921('0x6')]));}ami[_0x8921('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x8921('0x13')]=function(){return function(){return ami[_0x8921('0xb')]({'action':'devicestatelist'});};};ami[_0x8921('0x14')]=function(){return function(){return ami[_0x8921('0xb')]({'action':_0x8921('0x15')});};};ami[_0x8921('0x16')]=function(){return function(){return ami[_0x8921('0xb')]({'action':_0x8921('0x17')});};};ami[_0x8921('0x18')]=function(){return function(){return ami[_0x8921('0xb')]({'action':'coreshowchannels'});};};function connect(){logger['info'](util[_0x8921('0x11')](_0x8921('0x19'),config[_0x8921('0x7')][_0x8921('0x8')],config[_0x8921('0x7')]['ip'],config[_0x8921('0x7')]['port']));ami[_0x8921('0x1a')](_0x8921('0xe'),error);ami[_0x8921('0x1a')](_0x8921('0x1b'),close);}ami['on'](_0x8921('0x1c'),connect);ami['on'](_0x8921('0x1d'),function(_0x199492){logger[_0x8921('0x1e')](util[_0x8921('0x11')](_0x8921('0x1f'),config['asterisk'][_0x8921('0x8')],config[_0x8921('0x7')]['ip'],config[_0x8921('0x7')][_0x8921('0x6')],util[_0x8921('0x10')](_0x199492,![],null)));});ami['on'](_0x8921('0x20'),function(){logger[_0x8921('0x1e')](util[_0x8921('0x11')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x8921('0x7')][_0x8921('0x8')],config[_0x8921('0x7')]['ip'],config[_0x8921('0x7')][_0x8921('0x6')]));return Promise['resolve']()[_0x8921('0x21')](ami[_0x8921('0x12')]())[_0x8921('0x21')](ami['actionDeviceStateList']())['then'](ami[_0x8921('0x14')]())[_0x8921('0x21')](ami[_0x8921('0x16')]())[_0x8921('0x21')](ami[_0x8921('0x18')]())[_0x8921('0x22')](function(_0x4acd55){logger[_0x8921('0xe')]('[ami.js][fullybooted]',util['inspect'](_0x4acd55,{'showHidden':![],'depth':null}));});});ami[_0x8921('0x1a')](_0x8921('0xe'),error);ami[_0x8921('0x1a')](_0x8921('0x1b'),close);module[_0x8921('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 39717bc..7d586b3 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 _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x3d445a,_0x23277a){var _0x439d91=function(_0x30ebed){while(--_0x30ebed){_0x3d445a['push'](_0x3d445a['shift']());}};_0x439d91(++_0x23277a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0xac4a,0x13f));var _0xaac4=function(_0x3da663,_0x5922cc){_0x3da663=_0x3da663-0x0;var _0x56fdb5=_0xac4a[_0x3da663];return _0x56fdb5;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index e39a23a..f319582 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 _0xa3d8=['content','indexOf','true','catch','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','resolve','dialGlobalInterval','[syncCampaigns]','dialMethod','progressive','power','handlePower','method\x20not\x20recognized','dialTimezone','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','uniqueid','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','countdropretry','countglobal','dialDropRetryFrequency','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ListId','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialAbandonedMaxRetry','rescheduleContact','dialAbandonedRetryFrequency','ContactId','syncNewExten','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','queueBooked','idHopper','preview','run','CampaignId','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','VoiceQueueId','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','variable','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','[rescheduleContact][Machine]','dialAMDActive','[syncHangupInAMDIvr][createHistory]','reason19\x20machine....','reason\x2019\x20machine....','syncHangup','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','Normal\x20Clearing','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','talking','pTalking','ACTIVE','checkDialMethod','compareToOutboundQueue','queueSummaryCountersUpdated','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','enqueue','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','launchHandleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','Trunk','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','[originateError]:\x20%s','[originate][error]','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','erlangb','busyFactor','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','util','lodash','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','voice_queue:save','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','name','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','stringify','isTrunkReachable','active','trunks','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','TrunkBackup','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','Action','command','iftime\x20%s,%s','then'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0xa3d8,0x17a));var _0x8a3d=function(_0x4ba5f6,_0x3db231){_0x4ba5f6=_0x4ba5f6-0x0;var _0x48ab7e=_0xa3d8[_0x4ba5f6];return _0x48ab7e;};'use strict';var util=require(_0x8a3d('0x0'));var _=require(_0x8a3d('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0x8a3d('0x2'));var utils=require(_0x8a3d('0x3'));var hopperUtils=require(_0x8a3d('0x4'));var ut=require(_0x8a3d('0x5'));var config=require(_0x8a3d('0x6'));var logger=require(_0x8a3d('0x7'))(_0x8a3d('0x8'));var loggerBooked=require(_0x8a3d('0x7'))(_0x8a3d('0x9'));var loggerPredictive=require(_0x8a3d('0x7'))(_0x8a3d('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x8a3d('0xb'));var loggerSyncQueueSummary=require(_0x8a3d('0x7'))(_0x8a3d('0xc'));var ami=require(_0x8a3d('0xd'));config[_0x8a3d('0xe')]=_['defaults'](config[_0x8a3d('0xe')],{'host':_0x8a3d('0xf'),'port':0x18eb});var io=require(_0x8a3d('0x10'))(new Redis(config[_0x8a3d('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x8a3d('0x11'));var RpcSetting=require(_0x8a3d('0x12'));var Interval=require(_0x8a3d('0x13'));var Action=require('./models/action');var History=require(_0x8a3d('0x14'));var Final=require(_0x8a3d('0x15'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x8a3d('0x16'));var Hangup=require(_0x8a3d('0x17'));var ipAgi=process[_0x8a3d('0x18')][_0x8a3d('0x19')]||_0x8a3d('0x1a');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8a3d('0x1b')]['enqueue']=function(_0x5985b9){this[_0x8a3d('0x1c')]=this[_0x8a3d('0x1c')]?this['tail'][_0x8a3d('0x1d')](_0x5985b9):_0x5985b9();};function Dialer(_0x51a54c,_0x4224be){this[_0x8a3d('0x1e')]=new Sequence();this['preview']=_0x4224be;this[_0x8a3d('0x1f')]=_0x51a54c[_0x8a3d('0x1f')];this['campaigns']=_0x51a54c[_0x8a3d('0x20')];this[_0x8a3d('0x21')]=_0x51a54c['agents'];this['trunks']=_0x51a54c['trunks'];this[_0x8a3d('0x22')]=config[_0x8a3d('0x22')]||0x2;this['channels']={};this[_0x8a3d('0x23')]={};this[_0x8a3d('0x24')]={};this[_0x8a3d('0x25')]={};this[_0x8a3d('0x26')]={};this['startPredictive']={};this[_0x8a3d('0x27')]={};this[_0x8a3d('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};this[_0x8a3d('0x29')]={};ami['on'](_0x8a3d('0x2a'),this[_0x8a3d('0x2b')]['bind'](this));ami['on'](_0x8a3d('0x2c'),this['syncQueueCallerAbandon'][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x2e'),this[_0x8a3d('0x2f')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x30'),this[_0x8a3d('0x31')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x32'),this[_0x8a3d('0xc')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x33'),this[_0x8a3d('0x34')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x35'),this['syncHangup'][_0x8a3d('0x2d')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('varset',this[_0x8a3d('0x36')][_0x8a3d('0x2d')](this));ami['on'](_0x8a3d('0x37'),this[_0x8a3d('0x38')]['bind'](this));ami['on'](_0x8a3d('0x39'),this[_0x8a3d('0x3a')][_0x8a3d('0x2d')](this));this[_0x8a3d('0x3b')]();this[_0x8a3d('0x3c')]();RpcSetting[_0x8a3d('0x3d')]()['then'](function(_0xe11e3c){previewRecallmeReminderInterval=_0xe11e3c[_0x8a3d('0x3e')];});}function isNotNull(_0x3b35ea){return _0x3b35ea!==null&&!_[_0x8a3d('0x3f')](_0x3b35ea);}function msgResponse(_0x516a04,_0x4d25a9,_0x2f283e){return{'action':_0x516a04,'response':_0x4d25a9,'message':_0x2f283e,'stack':_0x2f283e};}function emit(_0x1e1deb,_0x5102b1,_0x1f2655){io['to'](_0x1e1deb)['emit'](_0x5102b1,_0x1f2655);}function emitOutboundVoiceQueueSummary(_0x4833da){if(_0x4833da[_0x8a3d('0x40')]==='outbound'){logger[_0x8a3d('0x41')](_0x8a3d('0x42'),util[_0x8a3d('0x43')](_0x4833da,{'showHidden':![],'depth':null}));emit(util[_0x8a3d('0x44')](_0x8a3d('0x45'),_0x4833da['name']),_0x8a3d('0x46'),_0x4833da);}}function checkGetDataPredictive(_0x5bd701){if(isNotNull(_0x5bd701)&&!_['isEmpty'](_0x5bd701)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x8a3d('0x47')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bd701[_0x8a3d('0x48')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x49'),_0x5bd701[_0x8a3d('0x4a')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x4b'),_0x5bd701[_0x8a3d('0x4c')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bd701[_0x8a3d('0x4d')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x4e'),_0x5bd701[_0x8a3d('0x4f')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x50'),_0x5bd701[_0x8a3d('0x51')]);loggerPredictive[_0x8a3d('0x47')]('---------------------------');if(_0x5bd701[_0x8a3d('0x48')]>0x0){if(!_['isUndefined'](_0x5bd701[_0x8a3d('0x51')])&&_0x5bd701[_0x8a3d('0x51')]>0x0){return!![];}loggerPredictive[_0x8a3d('0x47')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x8a3d('0x3f')](_0x5bd701[_0x8a3d('0x4f')])&&_0x5bd701[_0x8a3d('0x4f')]>0x0){return!![];}loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x52'));}else{loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x53'));}}else{loggerPredictive['info'](_0x8a3d('0x54'));}return![];}function mergeDataErlangB(_0x4045e3){return function(_0x22f134){loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x55'));loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x56'),_0x22f134[_0x8a3d('0x57')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x58'),_0x22f134[_0x8a3d('0x59')]);loggerPredictive[_0x8a3d('0x47')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22f134[_0x8a3d('0x5a')]);loggerPredictive[_0x8a3d('0x47')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22f134[_0x8a3d('0x5b')]);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x5c'),_0x22f134['erlangAbandonmentRate']);loggerPredictive[_0x8a3d('0x47')]('---------------------------');_[_0x8a3d('0x5d')](_0x4045e3,_0x22f134);};}function ifInterval(_0x33b38c,_0x26098e){if(_[_0x8a3d('0x3f')](_0x26098e)){return![];}return utils[_0x8a3d('0x5e')](undefined,_0x26098e)<_0x33b38c*0x3c;}function clearPredictiveAttributes(_0x688eff){if(_0x688eff[_0x8a3d('0x27')]){_0x688eff['startProgressive']=undefined;loggerPredictive[_0x8a3d('0x41')](_0x688eff[_0x8a3d('0x5f')],_0x8a3d('0x60'));}if(_0x688eff['startPredictive']){_0x688eff[_0x8a3d('0x61')]=undefined;loggerPredictive[_0x8a3d('0x41')](_0x688eff[_0x8a3d('0x5f')],_0x8a3d('0x62'));}if(_0x688eff[_0x8a3d('0x63')]){clearInterval(_0x688eff[_0x8a3d('0x63')]);_0x688eff['handlePredictive']=undefined;loggerPredictive[_0x8a3d('0x41')](_0x688eff[_0x8a3d('0x5f')],_0x8a3d('0x64'));}}function loggerCatchPredictive(_0x341f2d,_0x360364){return function(_0x371759){loggerPredictive[_0x8a3d('0x65')](_0x360364['name'],_0x341f2d);loggerPredictive[_0x8a3d('0x65')](_0x371759[_0x8a3d('0x66')]);clearPredictiveAttributes(_0x360364);};}function loggerCatch(_0x4e7821){return function(_0x4db6e1){logger[_0x8a3d('0x65')](_0x4e7821,util[_0x8a3d('0x43')](_0x4db6e1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3f55fc,_0x17da66,_0xa87880){return function(_0x2d9fc6){utils[_0x8a3d('0x67')](_0x17da66,_0xa87880,0x0);_0x17da66[_0x8a3d('0x68')]=0x0;logger['error'](_0x3f55fc,util['inspect'](_0x2d9fc6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2cea7d){return function(_0x39b653){if(isNotNull(_0x39b653)&&isNotNull(_0x39b653[0x0])){if(_0x39b653[0x0]['contactsRescheduled']>0x0){_0x2cea7d['message']=utils[_0x8a3d('0x69')]['CONTACTS_RESCHEDULED'];logger[_0x8a3d('0x47')](_0x8a3d('0x6a')+_0x2cea7d[_0x8a3d('0x5f')],_0x39b653[0x0]['contactsRescheduled'],_0x8a3d('0x6b'));}else{_0x2cea7d[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x6d')];logger[_0x8a3d('0x47')](_0x8a3d('0x6e')+_0x2cea7d[_0x8a3d('0x5f')]);}}};}function createObjHistory(_0x5eb99a,_0x535a18,_0x3dcf,_0x4e7dfd,_0x48203f){_0x5eb99a[_0x8a3d('0x6c')]=_0x3dcf;var _0x31e739=new Action(_0x5eb99a,_0x535a18);var _0x4f04cd=new History(_0x31e739);_0x4f04cd[_0x8a3d('0x6f')]=_0x4e7dfd;_0x4f04cd[_0x8a3d('0x70')]=_0x48203f;_0x4f04cd[_0x8a3d('0x71')]=_0x31e739[_0x8a3d('0x72')];return _0x4f04cd;}function unlockQueueStatus(_0x1571bd,_0x2f2a62){setTimeout(function(){if(_[_0x8a3d('0x3f')](_0x1571bd[_0x8a3d('0x73')])){loggerBooked[_0x8a3d('0x65')]('[unlockQueueStatus][undefined]',_0x2f2a62);}_0x1571bd[_0x8a3d('0x73')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x2f2a62,JSON['stringify'](_[_0x8a3d('0x74')](_0x1571bd,[_0x8a3d('0x5f'),_0x8a3d('0x73')])));},0x1f3);}function checkInterval(_0x22bc37){return function(){if(!isNotNull(_0x22bc37[_0x8a3d('0x75')])){_0x22bc37[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x76')];throw _0x22bc37[_0x8a3d('0x5f')]+_0x8a3d('0x77');}if(!isNotNull(_0x22bc37[_0x8a3d('0x75')][_0x8a3d('0x78')])){_0x22bc37[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x76')];throw _0x22bc37['name']+_0x8a3d('0x77');}if(!isNotNull(_[_0x8a3d('0x79')](_0x22bc37[_0x8a3d('0x75')][_0x8a3d('0x78')]))){_0x22bc37[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x76')];throw _0x22bc37[_0x8a3d('0x5f')]+_0x8a3d('0x77');}};}function checkIsIVRCampaignActive(_0x5aecd2){return function(){if(!utils[_0x8a3d('0x7a')](_0x5aecd2)){_0x5aecd2[_0x8a3d('0x6c')]=utils['CAMPAIGN_STATUS'][_0x8a3d('0x7b')];throw _0x5aecd2['name']+_0x8a3d('0x7c');}};}function emitCampaignSummary(_0x4de886){if(utils[_0x8a3d('0x7d')](_0x4de886)){emit(util[_0x8a3d('0x44')](_0x8a3d('0x7e'),_0x4de886['name']),'campaign:save',_0x4de886);}}function loggerCatchQueueSummary(_0x5b6253,_0x525c20){return function(_0x1964e2){clearPredictiveAttributes(_0x525c20);emitCampaignSummary(_0x525c20);loggerSyncQueueSummary['debug'](_0x5b6253,util[_0x8a3d('0x43')](_0x1964e2,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5334b8){if(_0x5334b8[_0x8a3d('0x7f')]){if(_0x5334b8[_0x8a3d('0x80')]===0x0){_0x5334b8[_0x8a3d('0x7f')]=![];_0x5334b8['message']=utils['CAMPAIGN_STATUS'][_0x8a3d('0x7b')];loggerSyncQueueSummary[_0x8a3d('0x41')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5334b8['name'],'is\x20not\x20active');}else{_0x5334b8['message']=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x8a3d('0x41')](_0x8a3d('0x81'),_0x5334b8['name'],_0x8a3d('0x82'));}emitCampaignSummary(_0x5334b8);}}function myreject(_0xd5d38b){return function(_0x204d01){return _0xd5d38b(msgResponse(_0x8a3d('0x83'),_0x8a3d('0x84'),JSON[_0x8a3d('0x85')](_0x204d01)));};}Dialer[_0x8a3d('0x1b')][_0x8a3d('0x86')]=function(_0x47b150){return!_[_0x8a3d('0x3f')](_0x47b150)&&_0x47b150&&!_['isUndefined'](_0x47b150[_0x8a3d('0x5f')])&&!_[_0x8a3d('0x3f')](_0x47b150[_0x8a3d('0x87')])&&_0x47b150['active']&&(this[_0x8a3d('0x88')][util[_0x8a3d('0x44')](_0x8a3d('0x89'),_0x47b150['name'])][_0x8a3d('0x8a')]===_0x8a3d('0x8b')||this['trunks'][util[_0x8a3d('0x44')](_0x8a3d('0x89'),_0x47b150[_0x8a3d('0x5f')])][_0x8a3d('0x8a')]===_0x8a3d('0x8c'));};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x8d')]=function(_0x9b2419){var _0x167593=this;return function(){if(!_0x167593[_0x8a3d('0x86')](_0x9b2419['Trunk'])){if(!_0x167593['isTrunkReachable'](_0x9b2419[_0x8a3d('0x8e')])){_0x9b2419[_0x8a3d('0x6c')]=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x9b2419[_0x8a3d('0x5f')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x8f')]=function(_0x20893d,_0x35f321,_0xa40343,_0x386923){var _0x485e8d=this;return function(){var _0x2cc58d=!![];return _0x485e8d['ifTimeIvr'](_0x20893d,_0x35f321,_0xa40343,_0x386923,_0x2cc58d);};};Dialer['prototype'][_0x8a3d('0x90')]=function(_0x2cba7e,_0x133ce6,_0x5229c1,_0x4cf9f5){var _0x533859=this;return function(){var _0x32ea1c=![];return _0x533859[_0x8a3d('0x91')](_0x2cba7e[_0x8a3d('0x78')],_0x133ce6,_0x5229c1,_0x4cf9f5,_0x32ea1c);};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x91')]=function(_0x5a4d3b,_0xdced6,_0x5b014f,_0x199402,_0x8ae63f){var _0x568aa1=[];return new Promise(function(_0x71d7b8,_0x1bb252){if(!isNotNull(_0x5a4d3b)){_0x199402[_0x8a3d('0x6c')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x1bb252(msgResponse(_0x8a3d('0x92'),_0x8a3d('0x93'),_0x5b014f+_0x8a3d('0x94')));}if(_['isEmpty'](_0x5a4d3b)){_0x199402[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')]['EMPTY_INTERVAL'];return _0x1bb252(msgResponse(_0x8a3d('0x92'),'Failure',_0x5b014f+_0x8a3d('0x95')));}if(_0xdced6&&_[_0x8a3d('0x3f')](config[_0x8a3d('0x96')][_0xdced6])){_0x199402[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x97')];return _0x1bb252(msgResponse('ifTime','Failure',_0x5b014f+_0x8a3d('0x98')+_0xdced6));}if(_['isArray'](_0x5a4d3b)){for(var _0xd78351=0x0;_0xd78351<_0x5a4d3b[_0x8a3d('0x99')];_0xd78351+=0x1){_0x568aa1[_0x8a3d('0x9a')](ami[_0x8a3d('0x9b')]({'action':_0x8a3d('0x9c'),'command':util[_0x8a3d('0x44')](_0x8a3d('0x9d'),_0x5a4d3b[_0xd78351]['interval'],!_[_0x8a3d('0x3f')](config[_0x8a3d('0x96')][_0xdced6])?_0xdced6:'')})[_0x8a3d('0x9e')](function(_0x5652ea){return _0x5652ea[_0x8a3d('0x9f')][_0x8a3d('0xa0')](_0x8a3d('0xa1'))>=0x0;})[_0x8a3d('0xa2')](myreject(_0x1bb252)));}}else{_0x568aa1[_0x8a3d('0x9a')](ami['Action']({'action':_0x8a3d('0x9c'),'command':util[_0x8a3d('0x44')](_0x8a3d('0x9d'),_0x5a4d3b,!_[_0x8a3d('0x3f')](config[_0x8a3d('0x96')][_0xdced6])?_0xdced6:'')})[_0x8a3d('0x9e')](function(_0x17e218){return _0x17e218[_0x8a3d('0x9f')]['indexOf'](_0x8a3d('0xa1'))>=0x0;})[_0x8a3d('0xa2')](myreject(_0x1bb252)));}Promise['all'](_0x568aa1)[_0x8a3d('0x9e')](function(_0x16bbae){var _0x293c54=_[_0x8a3d('0xa3')](_0x16bbae);if(_0x293c54){return _0x71d7b8(_0x293c54);}else{_0x199402['message']=_0x8ae63f?utils[_0x8a3d('0x69')][_0x8a3d('0xa4')]:utils[_0x8a3d('0x69')][_0x8a3d('0xa5')];return _0x1bb252(msgResponse(_0x8a3d('0xa6'),_0x8a3d('0x93'),_0x8a3d('0xa7')+_0x8ae63f+'\x20'+_0x5b014f+_0x8a3d('0xa8')+util[_0x8a3d('0x43')](_0x5a4d3b,{'showHidden':![],'depth':null})+_0x8a3d('0xa9')+_0xdced6));}})[_0x8a3d('0xa2')](function(_0x3523fb){return _0x1bb252(msgResponse(_0x8a3d('0x92'),_0x8a3d('0x93'),JSON[_0x8a3d('0x85')](_0x3523fb)));});});};Dialer['prototype'][_0x8a3d('0x3b')]=function(){var _0x5af893=this;return cmHopper[_0x8a3d('0xaa')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x5af893[_0x8a3d('0xab')]();},0x3e8);});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xab')]=function(){var _0x551fa1=this;var _0x21ce1a;for(var _0x535a48 in this[_0x8a3d('0x20')]){if(typeof this[_0x8a3d('0x20')][_0x535a48]!=='undefined'){_0x21ce1a=this[_0x8a3d('0x20')][_0x535a48];if(utils[_0x8a3d('0x7d')](_0x21ce1a)&&utils[_0x8a3d('0x7a')](_0x21ce1a)){_0x21ce1a[_0x8a3d('0x7f')]=!![];Promise[_0x8a3d('0xac')]()[_0x8a3d('0x9e')](checkIsIVRCampaignActive(_0x21ce1a))[_0x8a3d('0x9e')](checkInterval(_0x21ce1a))[_0x8a3d('0x9e')](_0x551fa1[_0x8a3d('0x8d')](_0x21ce1a))[_0x8a3d('0x9e')](_0x551fa1[_0x8a3d('0x8f')](_0x21ce1a[_0x8a3d('0xad')],_0x21ce1a['dialTimezone'],_0x21ce1a[_0x8a3d('0x5f')],_0x21ce1a))['then'](_0x551fa1[_0x8a3d('0x90')](_0x21ce1a[_0x8a3d('0x75')],_0x21ce1a['dialTimezone'],_0x21ce1a['name'],_0x21ce1a))[_0x8a3d('0x9e')](_0x551fa1['launchHandleIvr'](_0x21ce1a))[_0x8a3d('0xa2')](loggerCatchQueueSummary(_0x8a3d('0xae'),_0x21ce1a));}else{notSendMessagesCampaign(_0x21ce1a);}}}};Dialer['prototype']['checkDialMethod']=function(_0xd311b){if(_0xd311b['dialMethod']!==_0x8a3d('0xa')){clearPredictiveAttributes(_0xd311b);}switch(_0xd311b[_0x8a3d('0xaf')]){case _0x8a3d('0xb0'):this['handlePower'](_0xd311b,0x1);break;case _0x8a3d('0xb1'):this['handlePower'](_0xd311b,_0xd311b['dialPowerLevel']);break;case _0x8a3d('0xa'):this[_0x8a3d('0xa')](_0xd311b);break;case'booked':this[_0x8a3d('0xb2')](_0xd311b,0x1);break;default:logger[_0x8a3d('0x65')]('Queue',_0xd311b[_0x8a3d('0x5f')],_0x8a3d('0xb3'));}};Dialer[_0x8a3d('0x1b')]['ifTime']=function(_0x42ba01,_0x262bb6){var _0x3bac5c=_0x42ba01[_0x8a3d('0xb4')];var _0x5b7a98=_0x262bb6?_0x42ba01['dialGlobalInterval']:_0x42ba01[_0x8a3d('0x75')][_0x8a3d('0x78')];logger[_0x8a3d('0xb5')](_0x8a3d('0xb6'),_0x5b7a98,_0x3bac5c,_0x42ba01[_0x8a3d('0x5f')],util['format'](_0x8a3d('0xb7'),_0x42ba01['name'],_0x42ba01['id']));var _0x455c94=null;return Interval[_0x8a3d('0xb8')](_0x5b7a98,_0x3bac5c)[_0x8a3d('0x9e')](function(_0x382cc9){if(_0x382cc9===!![]){return _0x382cc9;}else{_0x42ba01[_0x8a3d('0x6c')]=_0x262bb6?utils[_0x8a3d('0x69')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x8a3d('0x69')][_0x8a3d('0xa5')];_0x455c94=msgResponse('[ifTime][promiseAll]',_0x8a3d('0x93'),_0x8a3d('0xa7')+_0x262bb6+'\x20'+_0x42ba01[_0x8a3d('0x5f')]+_0x8a3d('0xa8')+util['inspect'](_0x5b7a98,{'showHidden':![],'depth':null})+_0x8a3d('0xa9')+_0x3bac5c);}if(_0x455c94!==null){logger['silly']('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x455c94);_0x455c94[_0x8a3d('0xb9')]=_0x262bb6;throw _0x455c94;}})[_0x8a3d('0xa2')](function(_0x3b9294){logger['error'](_0x8a3d('0xba'),_0x3b9294);throw msgResponse(_0x8a3d('0x83'),_0x8a3d('0x84'),util[_0x8a3d('0x43')](_0x3b9294,{'showHidden':![],'depth':null}));});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x2b')]=function(_0x58a28e){if(this[_0x8a3d('0x1f')][_0x58a28e['queue']]){if(this['uniqueId'][_0x58a28e['uniqueid']]&&this[_0x8a3d('0x25')][_0x58a28e[_0x8a3d('0xbb')]][_0x8a3d('0x40')]!==_0x8a3d('0xbc')){this[_0x8a3d('0xbd')](this[_0x8a3d('0x1f')][_0x58a28e[_0x8a3d('0xbe')]]);this[_0x8a3d('0x25')][_0x58a28e['uniqueid']][_0x8a3d('0xbf')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x31')]=function(_0x4a73f4){var _0x3e07f1=this['uniqueId'][_0x4a73f4[_0x8a3d('0xbb')]];if(this[_0x8a3d('0x1f')][_0x4a73f4['queue']]){if(_0x3e07f1&&_0x3e07f1[_0x8a3d('0x40')]!==_0x8a3d('0xbc')){delete this[_0x8a3d('0x25')][_0x4a73f4['uniqueid']];this['voiceQueues'][_0x4a73f4['queue']][_0x8a3d('0xc1')]+=0x1;var _0x449913=new AgentComplete(_0x3e07f1,_0x4a73f4);if(_0x4a73f4['reason']===_0x8a3d('0xc2')){_0x449913[_0x8a3d('0xc3')]=this['voiceQueues'][_0x4a73f4['queue']][_0x8a3d('0xc4')]&&this['voiceQueues'][_0x4a73f4[_0x8a3d('0xbe')]][_0x8a3d('0xc5')]?moment()[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils['createHistory'](_0x449913)['catch'](loggerCatch(_0x8a3d('0xc6')));hopperUtils[_0x8a3d('0xc7')](_0x449913)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0xc8')));}}};Dialer['prototype'][_0x8a3d('0xc9')]=function(_0xb3e118){var _0x437473=this['uniqueId'][_0xb3e118[_0x8a3d('0xbb')]];var _0x2b8018=this;var _0x4c6a88=![];var _0x318ffe;var _0x279e6b;if(this['voiceQueues'][_0xb3e118['queue']]){if(_0x437473&&_0x437473[_0x8a3d('0x40')]!==_0x8a3d('0xbc')){delete this['uniqueId'][_0xb3e118['uniqueid']];this[_0x8a3d('0xbd')](this['voiceQueues'][_0xb3e118[_0x8a3d('0xbe')]]);_0x437473[_0x8a3d('0xca')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));var _0x5356da=new QueueCallerAbandon(_0x437473,_0xb3e118);if(utils[_0x8a3d('0x5e')](_0x437473[_0x8a3d('0xca')],_0x437473[_0x8a3d('0xcb')])>=_0x437473[_0x8a3d('0xcc')]){this[_0x8a3d('0x1f')][_0xb3e118['queue']][_0x8a3d('0x4c')]+=0x1;this['voiceQueues'][_0xb3e118[_0x8a3d('0xbe')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5356da['state']=0xa;_0x5356da['statedesc']=_0x8a3d('0xcd');_0x5356da[_0x8a3d('0xce')]='TIMEOUT';_0x5356da[_0x8a3d('0xc3')]=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xc4')]?moment()[_0x8a3d('0x44')](_0x8a3d('0xc0')):undefined;_0x5356da[_0x8a3d('0xcf')]+=0x1;_0x5356da[_0x8a3d('0xd0')]+=0x1;_0x318ffe=this[_0x8a3d('0x1f')][_0xb3e118['queue']][_0x8a3d('0xd1')];_0x279e6b=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x5356da,_0x5356da[_0x8a3d('0x6f')],_0x437473[_0x8a3d('0xd2')])['then'](function(_0x23e67d){_0x4c6a88=_0x23e67d[_0x8a3d('0xd3')]==0x1;if(_0x5356da[_0x8a3d('0xcf')]>=_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xd4')]){_0x2b8018[_0x8a3d('0xd5')](_0x5356da,_0x23e67d[_0x8a3d('0xd3')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x5356da['countdropretry'],'scheduledat':moment()[_0x8a3d('0xd6')](_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xd1')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x437473['ContactId'],'ListId':_0x437473[_0x8a3d('0xd8')],'VoiceQueueId':_0x437473['VoiceQueueId']||undefined,'CampaignId':_0x437473['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x307ff2=new History(_0x5356da);_0x307ff2[_0x8a3d('0x6f')]=0xa;_0x307ff2[_0x8a3d('0x70')]=_0x8a3d('0xcd');_0x307ff2[_0x8a3d('0x72')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));_0x307ff2[_0x8a3d('0x71')]=_0x307ff2[_0x8a3d('0x72')];_0x307ff2[_0x8a3d('0xd9')]=_0x5356da[_0x8a3d('0xd9')];_0x307ff2['calleridnum']=_0x5356da[_0x8a3d('0xda')];hopperUtils[_0x8a3d('0xdb')](_0x307ff2)['catch'](loggerCatch(_0x8a3d('0xdc')));}})[_0x8a3d('0x9e')](function(){if(_0x4c6a88)hopperUtils[_0x8a3d('0xdd')](_0x5356da,_0x318ffe,_0x279e6b)[_0x8a3d('0x9e')](function(){return 0x1;});});}else{this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xde')]+=0x1;_0x5356da[_0x8a3d('0x6f')]=0xb;_0x5356da[_0x8a3d('0x70')]=_0x8a3d('0xdf');_0x5356da[_0x8a3d('0xce')]=_0x8a3d('0xe0');_0x5356da[_0x8a3d('0xe1')]+=0x1;_0x5356da['countglobal']+=0x1;_0x318ffe=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]]['dialAbandonedRetryFrequency'];_0x279e6b=this[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xe3')](_0x5356da,_0x5356da[_0x8a3d('0x6f')],_0x437473[_0x8a3d('0xd2')])[_0x8a3d('0x9e')](function(_0x41a1e4){if(_0x5356da['countabandonedretry']>=_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xe4')]){_0x2b8018[_0x8a3d('0xd5')](_0x5356da,_0x41a1e4[_0x8a3d('0xd3')]);}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countabandonedretry':_0x5356da['countabandonedretry'],'scheduledat':moment()[_0x8a3d('0xd6')](_0x2b8018[_0x8a3d('0x1f')][_0xb3e118[_0x8a3d('0xbe')]][_0x8a3d('0xe6')],'minutes')[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x437473[_0x8a3d('0xe7')],'ListId':_0x437473[_0x8a3d('0xd8')],'VoiceQueueId':_0x437473['VoiceQueueId']||undefined,'CampaignId':_0x437473['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x3f4471=new History(_0x5356da);_0x3f4471['state']=0xb;_0x3f4471[_0x8a3d('0x70')]=_0x8a3d('0xdf');_0x3f4471[_0x8a3d('0x72')]=moment()['format'](_0x8a3d('0xc0'));_0x3f4471[_0x8a3d('0x71')]=_0x3f4471[_0x8a3d('0x72')];_0x3f4471[_0x8a3d('0xd9')]=_0x5356da[_0x8a3d('0xd9')];_0x3f4471[_0x8a3d('0xda')]=_0x5356da[_0x8a3d('0xda')];hopperUtils[_0x8a3d('0xdb')](_0x3f4471)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x8a3d('0x9e')](function(){if(_0x4c6a88)hopperUtils[_0x8a3d('0xdd')](_0x5356da,_0x318ffe,_0x279e6b)[_0x8a3d('0x9e')](function(){return 0x1;});});}}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xe8')]=function(_0x5a4f66){if(this[_0x8a3d('0x23')][_0x5a4f66[_0x8a3d('0xbb')]]){this[_0x8a3d('0x23')][_0x5a4f66[_0x8a3d('0xbb')]]['channel']=_0x5a4f66[_0x8a3d('0xe9')];}if(this[_0x8a3d('0x25')][_0x5a4f66[_0x8a3d('0xbb')]]){this[_0x8a3d('0x25')][_0x5a4f66['uniqueid']]['channel']=_0x5a4f66[_0x8a3d('0xe9')];}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x38')]=function(_0x3f485e){if(!this[_0x8a3d('0x23')][_0x3f485e['actionid']]){return;}var _0x27d434=this[_0x8a3d('0x1f')][this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]][_0x8a3d('0xeb')]||_0x8a3d('0xec');if(_0x27d434===_0x8a3d('0xed')){if(this[_0x8a3d('0x23')][_0x3f485e['actionid']]&&_[_0x8a3d('0xee')](this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xef')])&&_0x3f485e[_0x8a3d('0x8a')]==='1'&&_0x3f485e[_0x8a3d('0xf0')]==='0'){if(this[_0x8a3d('0x21')][_0x3f485e[_0x8a3d('0xf1')]]){if(!this[_0x8a3d('0x21')][_0x3f485e['stateinterface']][_0x8a3d('0xef')]){this[_0x8a3d('0x21')][_0x3f485e['stateinterface']][_0x8a3d('0xef')]=!![];this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]]['locked']=!![];this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xf1')]=_0x3f485e[_0x8a3d('0xf1')];}}}}else if(_0x27d434===_0x8a3d('0xec')){if(this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]]){if(this[_0x8a3d('0x21')][_0x3f485e['stateinterface']]){this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xf1')]=_0x3f485e[_0x8a3d('0xf1')];if(_['isNil'](this[_0x8a3d('0xf2')][this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]])){this[_0x8a3d('0xf2')][this[_0x8a3d('0x23')][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]=[];}this[_0x8a3d('0xf2')][this['actions'][_0x3f485e[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]['push'](_[_0x8a3d('0x5d')](_['pick'](this[_0x8a3d('0x23')][_0x3f485e['actionid']],[_0x8a3d('0xf3'),_0x8a3d('0xf1')]),{'status':_0x3f485e[_0x8a3d('0x8a')],'paused':_0x3f485e[_0x8a3d('0xf0')]}));}}}};Dialer['prototype'][_0x8a3d('0x3a')]=function(_0x457648){if(!this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]){return;}var _0x4c406f=this;var _0x513e74=this['voiceQueues'][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]];var _0x401c45=_0x513e74['strategy']||'rrmemory';if(_0x401c45===_0x8a3d('0xed')){if(this[_0x8a3d('0x23')][_0x457648['actionid']]&&this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf1')]){this[_0x8a3d('0xf4')][_0x8a3d('0xf5')](this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]]['idHopper'],this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf1')])[_0x8a3d('0xa2')](function(_0x150746){logger[_0x8a3d('0x65')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x8a3d('0x43')](_0x150746,{'showHidden':![],'depth':null}));})[_0x8a3d('0x1d')](function(){_0x4c406f['updateOriginated'](_0x4c406f[_0x8a3d('0x1f')][_0x4c406f['actions'][_0x457648[_0x8a3d('0xea')]]['queue']]);_0x4c406f[_0x8a3d('0x21')][_0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf1')]]['locked']=![];delete _0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]];unlockQueueStatus(_0x513e74);});}else{this['updateOriginated'](this[_0x8a3d('0x1f')][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xe7')],'ListId':this[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xd8')],'VoiceQueueId':this['actions'][_0x457648[_0x8a3d('0xea')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xf6')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x457648[_0x8a3d('0xea')]];unlockQueueStatus(_0x513e74);}}else if(_0x401c45===_0x8a3d('0xec')){var _0x2970b2;if(this['actions'][_0x457648[_0x8a3d('0xea')]]&&!_[_0x8a3d('0x79')](this[_0x8a3d('0xf2')][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]])){if(this[_0x8a3d('0xf7')][_0x4c406f[_0x8a3d('0x23')][_0x457648['actionid']][_0x8a3d('0xbe')]]){this[_0x8a3d('0xf7')][_0x4c406f[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]=this[_0x8a3d('0xf7')][this['actions'][_0x457648[_0x8a3d('0xea')]]['queue']]?this['queueBookedRR'][this['actions'][_0x457648['actionid']][_0x8a3d('0xbe')]]:this[_0x8a3d('0xf2')][this['actions'][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]]?this['queueBooked'][this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]][_0x8a3d('0xf8')]||0x0:0x0;}this['queueBooked'][this[_0x8a3d('0x23')][_0x457648[_0x8a3d('0xea')]][_0x8a3d('0xbe')]][_0x8a3d('0xf8')]=this[_0x8a3d('0xf7')][this['actions'][_0x457648[_0x8a3d('0xea')]]['queue']];for(var _0x3ba623=0x0;_0x3ba623=_0x20e9d2[_0x8a3d('0x121')]){_0x5ab1fb[_0x8a3d('0x122')](_0x3bc1a3,_0x2ba2f2,_0x52d718,'reason19\x20machine....');}else{if(_0x3bc1a3['countmachineretry']>=_0x20e9d2[_0x8a3d('0x123')]){_0x5ab1fb[_0x8a3d('0x124')](_0x3bc1a3,_0x2ba2f2,_0x52d718,'reason\x2019\x20machine....');}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countmachineretry':_0x3bc1a3[_0x8a3d('0x11b')],'scheduledat':moment()[_0x8a3d('0xd6')](_0x20e9d2['dialMachineRetryFrequency'],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x3bc1a3[_0x8a3d('0xe7')],'ListId':_0x3bc1a3[_0x8a3d('0xd8')],'VoiceQueueId':_0x3bc1a3['VoiceQueueId']||undefined,'CampaignId':_0x3bc1a3[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x125')));_0x2ba2f2({'reschedule':0x1});}}});}if(_0x4e6998[_0x8a3d('0x40')]===_0x8a3d('0xbc')&&this[_0x8a3d('0x20')][_0x4e6998['queue']][_0x8a3d('0x126')]&&_0x4fa736['value']==='HANGUP'){delete this['uniqueId'][_0x4fa736['uniqueid']];this[_0x8a3d('0xbd')](this['campaigns'][_0x4e6998[_0x8a3d('0xbe')]]);_0x52e90c=new Hangup(_0x4e6998,_0x4fa736);_0x52e90c[_0x8a3d('0x6f')]=0x12;_0x52e90c['statedesc']=_0x8a3d('0x10f');_0x52e90c[_0x8a3d('0x110')]='AMD';ami[_0x8a3d('0x112')](_0x8a3d('0x113'),ut[_0x8a3d('0x114')](_0x52e90c,_0x8a3d('0x115')));this[_0x8a3d('0x116')](_0x52e90c,_0x8a3d('0x127'),'[syncHangupInAMDIvr]');}if(_0x4e6998['type']===_0x8a3d('0xbc')&&this[_0x8a3d('0x20')][_0x4e6998[_0x8a3d('0xbe')]][_0x8a3d('0x126')]&&_0x4fa736[_0x8a3d('0x10c')]===_0x8a3d('0x119')){return new Promise(function(_0x5aeaa4,_0x90ef0c){delete _0x5ab1fb[_0x8a3d('0x25')][_0x4fa736[_0x8a3d('0xbb')]];_0x5ab1fb[_0x8a3d('0xbd')](_0x5ab1fb[_0x8a3d('0x20')][_0x4e6998['queue']]);_0x5ab1fb['campaigns'][_0x4e6998[_0x8a3d('0xbe')]][_0x8a3d('0xc1')]+=0x1;_0x5ab1fb[_0x8a3d('0x20')][_0x4e6998['queue']][_0x8a3d('0x10e')]+=0x1;var _0x4a1443=_0x5ab1fb[_0x8a3d('0x20')][_0x4e6998[_0x8a3d('0xbe')]];var _0x196383=new Hangup(_0x4e6998,_0x4fa736);_0x196383[_0x8a3d('0x6f')]=0x13;_0x196383['statedesc']=_0x8a3d('0x11a');_0x196383[_0x8a3d('0x110')]=_0x8a3d('0x111');_0x196383[_0x8a3d('0x11b')]+=0x1;_0x196383[_0x8a3d('0xd0')]+=0x1;_0x196383[_0x8a3d('0x115')]=!![];ami[_0x8a3d('0x112')](_0x8a3d('0x113'),ut[_0x8a3d('0x114')](_0x196383,_0x8a3d('0x115')));hopperUtils['createHistory'](_0x196383)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x196383[_0x8a3d('0x11d')]+_0x196383[_0x8a3d('0x11e')]+_0x196383[_0x8a3d('0x11f')]+_0x196383['countnosuchnumberretry']+_0x196383[_0x8a3d('0xcf')]+_0x196383[_0x8a3d('0xe1')]+_0x196383[_0x8a3d('0x11b')]+_0x196383['countagentrejectretry']>=_0x4a1443[_0x8a3d('0x121')]){_0x5ab1fb[_0x8a3d('0x122')](_0x196383,_0x5aeaa4,_0x90ef0c,_0x8a3d('0x128'));}else{if(_0x196383[_0x8a3d('0x11b')]>=_0x4a1443[_0x8a3d('0x123')]){_0x5ab1fb['createStateFinal'](_0x196383,_0x5aeaa4,_0x90ef0c,_0x8a3d('0x129'));}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countmachineretry':_0x196383['countmachineretry'],'scheduledat':moment()[_0x8a3d('0xd6')](_0x4a1443['dialMachineRetryFrequency'],_0x8a3d('0xd7'))['format'](_0x8a3d('0xc0')),'ContactId':_0x196383[_0x8a3d('0xe7')],'ListId':_0x196383[_0x8a3d('0xd8')],'VoiceQueueId':_0x196383[_0x8a3d('0x102')]||undefined,'CampaignId':_0x196383['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x125')));_0x5aeaa4({'reschedule':0x1});}}});}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x12a')]=function(_0x51276d){var _0x58d82d=this[_0x8a3d('0x25')][_0x51276d[_0x8a3d('0xbb')]];var _0x5b04a1;if(_0x58d82d&&_0x58d82d['type']===_0x8a3d('0xbc')){delete this[_0x8a3d('0x25')][_0x51276d['uniqueid']];this[_0x8a3d('0xbd')](this[_0x8a3d('0x20')][_0x58d82d[_0x8a3d('0xbe')]]);this[_0x8a3d('0x20')][_0x58d82d[_0x8a3d('0xbe')]]['ivrAnswerCallsDay']+=0x1;_0x5b04a1=new Hangup(_0x58d82d,_0x51276d);hopperUtils['createHistory'](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5b04a1)['catch'](loggerCatch(_0x8a3d('0x12b')));}if(_0x58d82d&&_0x58d82d[_0x8a3d('0x40')]!==_0x8a3d('0xbc')&&isNotNull(this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['dialQueueProject'])){delete this['uniqueId'][_0x51276d[_0x8a3d('0xbb')]];this[_0x8a3d('0xbd')](this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]);this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]][_0x8a3d('0xc1')]+=0x1;this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]][_0x8a3d('0x10e')]+=0x1;_0x5b04a1=new Hangup(_0x58d82d,_0x51276d);_0x5b04a1[_0x8a3d('0x6f')]=0x10;_0x5b04a1[_0x8a3d('0x70')]=_0x8a3d('0x12c');_0x5b04a1[_0x8a3d('0x110')]=_0x8a3d('0x12d');hopperUtils[_0x8a3d('0xdb')](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x12e')));hopperUtils['moveContactManagedDialer'](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x12b')));}if(_0x58d82d&&_0x58d82d['type']!=='ivr'&&!isNotNull(this[_0x8a3d('0x1f')][_0x58d82d['queue']][_0x8a3d('0x12f')])){if(_0x51276d['cause-txt']===_0x8a3d('0x130')){delete this[_0x8a3d('0x25')][_0x51276d[_0x8a3d('0xbb')]];this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['outboundAnswerCallsDay']+=0x1;const _0x1865fb=new AgentComplete(_0x58d82d,_0x51276d);_0x1865fb['CampaignId']=this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['id'];hopperUtils[_0x8a3d('0xdb')](_0x1865fb)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x8a3d('0xc7')](_0x1865fb)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0xc8')));}else{delete this[_0x8a3d('0x25')][_0x51276d[_0x8a3d('0xbb')]];this['updateOriginated'](this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]);this[_0x8a3d('0x1f')][_0x58d82d[_0x8a3d('0xbe')]]['outboundUnknownCallsDay']+=0x1;_0x5b04a1=new Hangup(_0x58d82d,_0x51276d);_0x5b04a1[_0x8a3d('0x6f')]=0xc;_0x5b04a1[_0x8a3d('0x70')]=_0x51276d[_0x8a3d('0x131')];_0x5b04a1[_0x8a3d('0x110')]=_0x8a3d('0x132');hopperUtils[_0x8a3d('0xdb')](_0x5b04a1)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x12e')));hopperUtils[_0x8a3d('0xc7')](_0x5b04a1)['catch'](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xc')]=function(_0x2f5492){var _0x1ec5ba=this;if(!_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492['name']]){_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492[_0x8a3d('0x5f')]]={'running':![]};}else if(_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492[_0x8a3d('0x5f')]][_0x8a3d('0x133')]===!![]){return;}else if(_0x1ec5ba['queuesSummary'][_0x2f5492[_0x8a3d('0x5f')]][_0x8a3d('0x133')]===![]){_0x1ec5ba[_0x8a3d('0x29')][_0x2f5492[_0x8a3d('0x5f')]][_0x8a3d('0x133')]=!![];}var _0x1fd86c=_0x1ec5ba[_0x8a3d('0x1f')][_0x2f5492['name']];var _0x56ece0=_0x1fd86c[_0x8a3d('0x6c')]!==utils[_0x8a3d('0x69')][_0x8a3d('0x7b')];var _0x19231e=utils[_0x8a3d('0x134')](_0x1fd86c);_0x1fd86c['statusMessage']=utils[_0x8a3d('0x135')](_0x1fd86c,_0x1ec5ba[_0x8a3d('0x88')]);Promise[_0x8a3d('0xac')]()['then'](function(){if(_0x1fd86c[_0x8a3d('0x136')]===utils[_0x8a3d('0x69')][_0x8a3d('0x7b')]){if(_0x56ece0){clearPredictiveAttributes(_0x1fd86c);_0x2f5492['startPredictive']=undefined;_0x2f5492[_0x8a3d('0x27')]=undefined;}if(_0x1fd86c[_0x8a3d('0x136')]===utils[_0x8a3d('0x69')]['INACTIVE']){_0x2f5492[_0x8a3d('0x137')]=0x0;_0x2f5492[_0x8a3d('0xf0')]=0x0;_0x2f5492[_0x8a3d('0x138')]=0x0;_0x2f5492[_0x8a3d('0x139')]=0x0;_0x2f5492[_0x8a3d('0x13a')]=0x0;}}else if(_0x1fd86c[_0x8a3d('0x136')]===utils[_0x8a3d('0x69')][_0x8a3d('0x13b')]&&!_0x19231e){return _0x1ec5ba[_0x8a3d('0x92')](_0x1fd86c,!![])[_0x8a3d('0x9e')](function(){return _0x1ec5ba['ifTime'](_0x1fd86c,![]);})['then'](function(){return _0x1ec5ba[_0x8a3d('0x13c')](_0x1fd86c);})[_0x8a3d('0xa2')](function(_0x3901da){loggerSyncQueueSummary[_0x8a3d('0x41')]('[syncQueueSummary]',util[_0x8a3d('0x43')](_0x3901da,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1fd86c);});}else{clearPredictiveAttributes(_0x1fd86c);}})['then'](function(){var _0x1e9ba6=_0x2f5492[_0x8a3d('0x13d')](_0x1fd86c);if(_0x1e9ba6||_0x1fd86c[_0x8a3d('0x13e')]){_0x1fd86c[_0x8a3d('0x13e')]=![];_0x2f5492['updateReportFromOutboundQueue'](_0x1fd86c);Object[_0x8a3d('0x13f')](_0x1fd86c,_0x2f5492);emitOutboundVoiceQueueSummary(_0x2f5492);}_0x1ec5ba[_0x8a3d('0x29')][_0x1fd86c[_0x8a3d('0x5f')]]['running']=![];})[_0x8a3d('0xa2')](function(_0x2905ad){logger[_0x8a3d('0x65')](_0x8a3d('0x140'),util[_0x8a3d('0x43')](_0x2905ad,{'showHidden':![],'depth':null}));_0x1ec5ba[_0x8a3d('0x29')][_0x1fd86c[_0x8a3d('0x5f')]]['running']=![];});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x34')]=_[_0x8a3d('0x141')](function(){var _0x382674=_[_0x8a3d('0x142')](this[_0x8a3d('0x1f')],function(_0x448e84){return _0x448e84[_0x8a3d('0x143')];});var _0x1d9fc2=_[_0x8a3d('0x142')](this[_0x8a3d('0x21')],function(_0x2b9225){return _0x2b9225[_0x8a3d('0x144')]&&_0x2b9225[_0x8a3d('0x8a')]===_0x8a3d('0x8b');});if(_0x382674[_0x8a3d('0x99')]>0x0&&_0x1d9fc2['length']>0x0){return Promise[_0x8a3d('0xac')]()['then'](cmHopper[_0x8a3d('0x145')](_['map'](_0x382674,'id'),previewRecallmeReminderInterval,_[_0x8a3d('0x146')](_0x1d9fc2,'id')))[_0x8a3d('0x9e')](function(_0x5663fd){for(var _0x3222ea=0x0;_0x3222ea<_0x5663fd[_0x8a3d('0x99')];_0x3222ea++){var _0x34e252=_0x5663fd[_0x3222ea]['Agent'][_0x8a3d('0x5f')];if(_0x34e252)io['to'](util['format'](_0x8a3d('0x147'),_0x34e252))['emit'](_0x8a3d('0x148'),{'hopper':_0x5663fd[_0x3222ea]});}})[_0x8a3d('0xa2')](function(_0x330b65){logger[_0x8a3d('0x65')](_0x8a3d('0x149'),_0x330b65);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8a3d('0x1b')]['loopClearZombieChannels']=function(){var _0x4c9f26=this;setInterval(function(){_0x4c9f26[_0x8a3d('0x14a')](_0x4c9f26['uniqueId'],_0x8a3d('0x14b'));_0x4c9f26[_0x8a3d('0x14a')](_0x4c9f26['actions'],_0x8a3d('0x14c'));},0x32c8);};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x14a')]=function(_0x59a030,_0x15d81d){var _0x184ad3=this;for(var _0x5187b4 in _0x59a030){if(typeof _0x59a030[_0x5187b4]!==_0x8a3d('0x14d')){this['sequence'][_0x8a3d('0x14e')](function(){if(!_['isNil'](_0x59a030[_0x5187b4])){return ami['Action']({'action':_0x8a3d('0x8a'),'channel':_0x59a030[_0x5187b4][_0x8a3d('0xe9')]})['catch'](function(_0x482da6){if(_0x482da6[_0x8a3d('0x6c')]===_0x8a3d('0x14f')){setTimeout(function(){if(_0x59a030[_0x5187b4]&&_0x59a030[_0x5187b4][_0x8a3d('0x40')]!==_0x8a3d('0xbc')){_0x184ad3[_0x8a3d('0xbd')](_0x184ad3[_0x8a3d('0x1f')][_0x59a030[_0x5187b4][_0x8a3d('0xbe')]]);logger[_0x8a3d('0x65')]('[Dialer][checkChannel]',_0x15d81d,_0x5187b4,_0x59a030[_0x5187b4]['queue']);delete _0x59a030[_0x5187b4];}if(_0x59a030[_0x5187b4]&&_0x59a030[_0x5187b4]['type']===_0x8a3d('0xbc')){_0x184ad3[_0x8a3d('0xbd')](_0x184ad3[_0x8a3d('0x20')][_0x59a030[_0x5187b4][_0x8a3d('0xbe')]]);logger['error'](_0x8a3d('0x150'),_0x15d81d,_0x5187b4,_0x59a030[_0x5187b4][_0x8a3d('0xbe')]);delete _0x59a030[_0x5187b4];}},0x2328);}});}});}}};Dialer[_0x8a3d('0x1b')]['getVoiceQueueRtPauses']=function(_0x11a61d){return Promise[_0x8a3d('0xac')]()[_0x8a3d('0x9e')](voiceQueueRt[_0x8a3d('0x151')](_0x11a61d))[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x152')));};Dialer['prototype'][_0x8a3d('0xbd')]=function(_0xa2c7b4){if(!_[_0x8a3d('0x3f')](_0xa2c7b4)&&_0xa2c7b4!==null){if(typeof _0xa2c7b4[_0x8a3d('0x80')]!==_0x8a3d('0x14d')){if(_0xa2c7b4['originated']>0x0){_0xa2c7b4[_0x8a3d('0x80')]-=0x1;}else{logger[_0x8a3d('0x65')](_0x8a3d('0x153'));}}}else{logger[_0x8a3d('0x65')](_0x8a3d('0x154'));}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x155')]=function(_0x550483,_0x4b7965){var _0x5e1ef3=this;return function(_0x19aecf){_0x5e1ef3['updateOriginated'](_0x4b7965);logger[_0x8a3d('0x65')](_0x550483,util['inspect'](_0x19aecf,{'showHidden':![],'depth':null}));};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x156')]=function(_0x1f6340,_0x13e2b2,_0x1bc749){var _0x1556c0={'state':0x19,'statedesc':_0x8a3d('0x157')};this[_0x8a3d('0xbd')](_0x13e2b2);this[_0x8a3d('0x116')](_[_0x8a3d('0x5d')](_0x1556c0,_[_0x8a3d('0x74')](_0x1bc749,[_0x8a3d('0xe7'),_0x8a3d('0xd8'),_0x8a3d('0x158'),_0x8a3d('0x102'),_0x8a3d('0xf6')])),'[emptyContact][createHistory]',_0x8a3d('0x159'));logger[_0x8a3d('0x65')](_0x1f6340);};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x116')]=function(_0x5665db,_0x3797f6,_0x14ecf5){hopperUtils[_0x8a3d('0xdb')](_0x5665db)[_0x8a3d('0xa2')](loggerCatch(_0x3797f6));hopperUtils[_0x8a3d('0xc7')](_0x5665db)[_0x8a3d('0xa2')](loggerCatch(_0x14ecf5));};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xd5')]=function(_0x21e0f7,_0x51958){hopperUtils[_0x8a3d('0xdb')](_0x21e0f7)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0xc6')));if(_0x51958==0x0){hopperUtils[_0x8a3d('0xc7')](_0x21e0f7)[_0x8a3d('0xa2')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x149')]=function(_0x5a6474){return Promise[_0x8a3d('0xac')]()['then'](cmHopper[_0x8a3d('0x145')](_0x5a6474['id'],previewRecallmeReminderInterval))[_0x8a3d('0x9e')](function(_0x5cd657){for(var _0x2d72e1=0x0;_0x2d72e1<_0x5cd657[_0x8a3d('0x99')];_0x2d72e1++){var _0x4a4dd2=_0x5cd657[_0x2d72e1]['Agent']['name'];if(_0x4a4dd2)io['to'](util[_0x8a3d('0x44')](_0x8a3d('0x147'),_0x4a4dd2))[_0x8a3d('0x112')]('user:dialPreviewRecallReminder',{'hopper':_0x5cd657[_0x2d72e1]});}})[_0x8a3d('0xa2')](function(){});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x15a')]=function(_0x1caf4c){var _0x3302ea=this;return function(){_0x3302ea['handleIvr'](_0x1caf4c);};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x15b')]=function(_0x3d8b5c,_0x4c37ee){var _0x40129f=this;var _0x61106e=uuid['v4']();this[_0x8a3d('0x23')][_0x61106e]=new Action(_0x3d8b5c,_0x4c37ee,_0x61106e);return new Promise(function(_0x58d77f,_0x5de2b1){if(_[_0x8a3d('0x3f')](_0x3d8b5c)&&typeof _0x3d8b5c!==_0x8a3d('0x15c')){return _0x5de2b1(msgResponse(_0x8a3d('0x15d'),'Failure',_0x8a3d('0x15e')));}if(_['isUndefined'](_0x4c37ee[_0x8a3d('0x15f')])||_0x4c37ee[_0x8a3d('0x15f')]===null){return _0x5de2b1(msgResponse(_0x8a3d('0x15d'),'Failure',_0x8a3d('0x160')));}var _0x1469f9={'XMD-CALLERID':_0x40129f[_0x8a3d('0x23')][_0x61106e]['getCaller'](),'XMD-AGI':_0x3d8b5c[_0x8a3d('0x12f')]?util['format'](_0x8a3d('0x161'),ipAgi,_0x3d8b5c[_0x8a3d('0x12f')]):_0x8a3d('0x162'),'XMD-AGIAFTER':_0x3d8b5c[_0x8a3d('0xc4')]?util['format'](_0x8a3d('0x161'),ipAgi,_0x3d8b5c[_0x8a3d('0xc4')]):_0x8a3d('0x162'),'XMD-QUEUE':utils[_0x8a3d('0x163')](_0x3d8b5c)?util['format'](_0x8a3d('0x164'),_0x3d8b5c[_0x8a3d('0x5f')],_0x3d8b5c[_0x8a3d('0x165')]||'',_0x3d8b5c[_0x8a3d('0xc5')]?'c':'',_0x3d8b5c[_0x8a3d('0xcc')]||0x3):_0x8a3d('0x162'),'XMD-CONTACTID':_0x4c37ee[_0x8a3d('0xe7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x40129f['actions'][_0x61106e][_0x8a3d('0x166')](),'XMD-AMD':_0x3d8b5c[_0x8a3d('0x126')]?_0x8a3d('0x13b'):_0x8a3d('0x162'),'XMD-DESTINATION':_0x8a3d('0x10b')};if(_0x3d8b5c[_0x8a3d('0x126')]){_0x1469f9['XMD-AMDINITIALSILENCE']=_0x3d8b5c[_0x8a3d('0x167')]||0x9c4;_0x1469f9[_0x8a3d('0x168')]=_0x3d8b5c[_0x8a3d('0x169')]||0x5dc;_0x1469f9[_0x8a3d('0x16a')]=_0x3d8b5c[_0x8a3d('0x16b')]||0x320;_0x1469f9['XMD-AMDTOTALANALYSISTIME']=_0x3d8b5c['dialAMDTotalAnalysisTime']||0x1388;_0x1469f9[_0x8a3d('0x16c')]=_0x3d8b5c[_0x8a3d('0x16d')]||0x64;_0x1469f9[_0x8a3d('0x16e')]=_0x3d8b5c['dialAMDBetweenWordsSilence']||0x32;_0x1469f9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3d8b5c[_0x8a3d('0x16f')]||0x3;_0x1469f9['XMD-AMDSILENCETHRESHOLD']=_0x3d8b5c[_0x8a3d('0x170')]||0x100;_0x1469f9[_0x8a3d('0x171')]=_0x3d8b5c[_0x8a3d('0x172')]||0x1388;}if(utils[_0x8a3d('0x163')](_0x3d8b5c)){_0x1469f9[_0x8a3d('0x173')]=_0x4c37ee[_0x8a3d('0x102')];}else{_0x1469f9['XMD-CAMPAIGNID']=_0x4c37ee[_0x8a3d('0xf6')];}var _0xf96fbb=utils[_0x8a3d('0x174')](_0x4c37ee[_0x8a3d('0x175')]);Object['assign'](_0x1469f9,_0xf96fbb);var _0x4c2083=_0x40129f['isTrunkReachable'](_0x3d8b5c[_0x8a3d('0x176')])?utils[_0x8a3d('0x177')](_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x178')],_0x3d8b5c['dialOriginateCallerIdName'],_0x3d8b5c[_0x8a3d('0x179')]>0x0?utils['getCallerIdRandom'](_0x3d8b5c[_0x8a3d('0x17a')],_0x3d8b5c['dialRandomLastDigitCallerIdNumber']):_0x3d8b5c[_0x8a3d('0x17a')]):utils['getCallerId'](_['isNil'](_0x3d8b5c[_0x8a3d('0x8e')])?_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x178')]:_0x3d8b5c[_0x8a3d('0x8e')]['callerid'],_0x3d8b5c[_0x8a3d('0x17b')],_0x3d8b5c[_0x8a3d('0x179')]>0x0?utils[_0x8a3d('0x17c')](_0x3d8b5c[_0x8a3d('0x17a')],_0x3d8b5c[_0x8a3d('0x179')]):_0x3d8b5c[_0x8a3d('0x17a')]);if(_0x4c2083){_0x1469f9[_0x8a3d('0x17d')]=_0x40129f[_0x8a3d('0x23')][_0x61106e]['originatecalleridname']=utils['extractCalleridName'](_0x4c2083);_0x1469f9[_0x8a3d('0x17e')]=_0x4c37ee[_0x8a3d('0x15f')];}_0x3d8b5c[_0x8a3d('0x17f')]=_0x1469f9;return ami[_0x8a3d('0x9b')]({'actionid':_0x61106e,'action':_0x8a3d('0x15d'),'channel':_0x40129f[_0x8a3d('0x86')](_0x3d8b5c[_0x8a3d('0x176')])?util[_0x8a3d('0x44')](_0x8a3d('0x180'),_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x5f')],isNotNull(_0x3d8b5c[_0x8a3d('0x181')])?_0x3d8b5c[_0x8a3d('0x181')][_0x8a3d('0x182')]()||'':'',_0x3d8b5c['dialCutDigit']>0x0?_0x4c37ee[_0x8a3d('0x15f')][_0x8a3d('0x183')](_0x3d8b5c[_0x8a3d('0x184')]):_0x4c37ee['phone']):util['format'](_0x8a3d('0x180'),_[_0x8a3d('0xee')](_0x3d8b5c[_0x8a3d('0x8e')])?_0x3d8b5c[_0x8a3d('0x176')][_0x8a3d('0x5f')]:_0x3d8b5c[_0x8a3d('0x8e')][_0x8a3d('0x5f')],isNotNull(_0x3d8b5c[_0x8a3d('0x181')])?_0x3d8b5c[_0x8a3d('0x181')][_0x8a3d('0x182')]()||'':'',_0x3d8b5c[_0x8a3d('0x184')]>0x0?_0x4c37ee[_0x8a3d('0x15f')][_0x8a3d('0x183')](_0x3d8b5c['dialCutDigit']):_0x4c37ee[_0x8a3d('0x15f')]),'callerid':_0x4c2083,'Exten':_0x8a3d('0x10b'),'Context':'from-sip','Priority':'1','variable':_0x1469f9,'timeout':(_0x3d8b5c['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x61106e})[_0x8a3d('0x9e')](function(_0x9780a1){return _0x58d77f(_0x9780a1);})[_0x8a3d('0xa2')](function(_0x14e138){_0x3d8b5c['outboundOriginateFailureCallsDay']+=0x1;var _0x5898d2=new History(_0x40129f[_0x8a3d('0x23')][_0x61106e]);logger[_0x8a3d('0x65')](util['format'](_0x8a3d('0x185'),JSON['stringify'](_0x14e138)));_0x5898d2['state']=0xe;_0x5898d2[_0x8a3d('0x70')]='OriginateError';_0x5898d2[_0x8a3d('0x72')]=moment()['format'](_0x8a3d('0xc0'));_0x5898d2[_0x8a3d('0x71')]=_0x5898d2[_0x8a3d('0x72')];hopperUtils[_0x8a3d('0xdb')](_0x5898d2)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x186')));_0x40129f[_0x8a3d('0xc7')](_0x5898d2)['catch'](loggerCatch(_0x8a3d('0x186')))[_0x8a3d('0x1d')](function(){delete _0x40129f[_0x8a3d('0x23')][_0x61106e];return _0x5de2b1(msgResponse(_0x8a3d('0x15d'),_0x8a3d('0x84'),'originate\x20action\x20Error'));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x6dde38,_0x15e64c,_0x17557d){var _0x5474ee=new History(_0x15e64c);if(_0x5474ee[_0x8a3d('0x11d')]+_0x5474ee[_0x8a3d('0x11e')]+_0x5474ee[_0x8a3d('0x11f')]+_0x5474ee['countnosuchnumberretry']+_0x5474ee[_0x8a3d('0xcf')]+_0x5474ee[_0x8a3d('0xe1')]+_0x5474ee['countmachineretry']+_0x5474ee['countagentrejectretry']>=_0x17557d[_0x8a3d('0x121')]-0x1){return!![];}switch(_0x6dde38){case 0x3:if(_0x5474ee[_0x8a3d('0x11f')]>=_0x17557d['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countnoanswerretry':_0x5474ee[_0x8a3d('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x17557d[_0x8a3d('0x187')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee['ContactId'],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})['catch'](loggerCatch(_0x8a3d('0x188')));break;case 0x5:if(_0x5474ee[_0x8a3d('0x11d')]>=_0x17557d[_0x8a3d('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x5474ee['countbusyretry']+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d[_0x8a3d('0x18a')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18b')));break;case 0x8:if(_0x5474ee[_0x8a3d('0x11e')]>=_0x17557d['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countcongestionretry':_0x5474ee[_0x8a3d('0x11e')]+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d['dialCongestionRetryFrequency'],_0x8a3d('0xd7'))['format'](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18c')));break;case 0x0:if(_0x5474ee[_0x8a3d('0x120')]>=_0x17557d[_0x8a3d('0x18d')]-0x1){return!![];}else{hopperUtils[_0x8a3d('0xe5')]({'active':![],'countnosuchnumberretry':_0x5474ee[_0x8a3d('0x120')]+=0x1,'scheduledat':moment()['add'](_0x17557d['dialNoSuchNumberRetryFrequency'],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee['ContactId'],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18e')));}break;case 0xa:if(_0x5474ee['countdropretry']>=_0x17557d[_0x8a3d('0xd4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x5474ee[_0x8a3d('0xcf')]+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d[_0x8a3d('0xd1')],_0x8a3d('0xd7'))[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x18f')));break;case 0xb:if(_0x5474ee[_0x8a3d('0xe1')]>=_0x17557d[_0x8a3d('0xe4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5474ee['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x17557d[_0x8a3d('0xe6')],'minutes')[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x190')));break;case 0x13:if(_0x5474ee['countmachineretry']>=_0x17557d[_0x8a3d('0x123')]-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countmachineretry':_0x5474ee[_0x8a3d('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x17557d[_0x8a3d('0x191')],_0x8a3d('0xd7'))[_0x8a3d('0x44')](_0x8a3d('0xc0')),'ContactId':_0x5474ee[_0x8a3d('0xe7')],'ListId':_0x5474ee[_0x8a3d('0xd8')],'VoiceQueueId':_0x5474ee[_0x8a3d('0x102')]||undefined,'CampaignId':_0x5474ee[_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x125')));break;case 0x14:if(_0x5474ee['countagentrejectretry']>=_0x17557d[_0x8a3d('0x192')]-0x1){return!![];}hopperUtils[_0x8a3d('0xe5')]({'active':![],'countagentrejectretry':_0x5474ee[_0x8a3d('0x193')]+=0x1,'scheduledat':moment()[_0x8a3d('0xd6')](_0x17557d[_0x8a3d('0x194')],'minutes')[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5474ee['ContactId'],'ListId':_0x5474ee['ListId'],'VoiceQueueId':_0x5474ee['VoiceQueueId']||undefined,'CampaignId':_0x5474ee['CampaignId']||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x195')));break;default:return!![];}};Dialer[_0x8a3d('0x1b')]['callProgressDetecting']=function(_0x5dda18,_0x23c2e6,_0xa447cc){var _0x531d31=this;var _0x75ba97=new History(_0x5dda18);var _0x52c531=![];var _0x9c1865;var _0x7d0b43;return new Promise(function(_0x10e969,_0x5e3a0d){if(_[_0x8a3d('0x3f')](_0x23c2e6)&&typeof _0x23c2e6!=='object'){return _0x5e3a0d(msgResponse(_0x8a3d('0x196'),'Failure',_0x8a3d('0x197')));}if(_[_0x8a3d('0x3f')](_0xa447cc)&&typeof _0xa447cc!==_0x8a3d('0x15c')){return _0x5e3a0d(msgResponse(_0x8a3d('0x196'),_0x8a3d('0x93'),_0x8a3d('0x198')));}hopperUtils[_0x8a3d('0xe3')](_0x75ba97,_0xa447cc[_0x8a3d('0x199')],_0x23c2e6)[_0x8a3d('0x9e')](function(_0x2587fd){if(_0x2587fd[_0x8a3d('0xd3')]==0x1)_0x52c531=!![];switch(_0xa447cc[_0x8a3d('0x199')]){case'0':_0x23c2e6['outboundNoSuchCallsDay']+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x0;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x19a');_0x75ba97['countnosuchnumberretry']+=0x1;_0x75ba97[_0x8a3d('0xd0')]+=0x1;ami['emit'](_0x8a3d('0x19b'),ut[_0x8a3d('0x114')](_0x5dda18,_0x8a3d('0x19c')));_0x9c1865=_0x23c2e6['dialNoSuchNumberRetryFrequency'];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils['createHistory'](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x11c')));if(_0x531d31[_0x8a3d('0x19d')](0x0,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x120')]>=_0x23c2e6['dialNoSuchNumberMaxRetry']){_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x19e'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x19e'));}}break;case'3':_0x23c2e6[_0x8a3d('0x19f')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x3;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1a0');_0x75ba97['countnoanswerretry']+=0x1;_0x75ba97[_0x8a3d('0xd0')]+=0x1;var _0x1a83d3=ut['buildNoAnswerEventPayload'](_0x5dda18,_0x23c2e6);ami[_0x8a3d('0x112')]('custom:agentnoanswer',_0x1a83d3);_0x9c1865=_0x23c2e6[_0x8a3d('0x187')];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xdb')](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x1a1')));if(_0x531d31[_0x8a3d('0x19d')](0x3,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x11f')]>=_0x23c2e6[_0x8a3d('0x1a2')]){_0x531d31['createStateFinal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1a3'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x23c2e6[_0x8a3d('0x1a4')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x5;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1a5');_0x75ba97[_0x8a3d('0x11d')]+=0x1;_0x75ba97['countglobal']+=0x1;ami['emit'](_0x8a3d('0x1a6'),ut[_0x8a3d('0x114')](_0x5dda18,_0x8a3d('0x1a7')));_0x9c1865=_0x23c2e6[_0x8a3d('0x18a')];_0x7d0b43=_0x23c2e6['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x531d31[_0x8a3d('0x19d')](0x5,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97['countbusyretry']>=_0x23c2e6['dialBusyMaxRetry']){_0x531d31['createStateFinal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1a8'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1a8'));}}break;case'8':_0x23c2e6[_0x8a3d('0x1a9')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x8;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1aa');_0x75ba97[_0x8a3d('0x11e')]+=0x1;_0x75ba97[_0x8a3d('0xd0')]+=0x1;_0x9c1865=_0x23c2e6['dialCongestionRetryFrequency'];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];ami[_0x8a3d('0x112')]('custom:agentcongestion',ut[_0x8a3d('0x114')](_0x5dda18,'congestion'));hopperUtils[_0x8a3d('0xdb')](_0x75ba97)['catch'](loggerCatch(_0x8a3d('0x1ab')));if(_0x531d31[_0x8a3d('0x19d')](0x8,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x11e')]>=_0x23c2e6[_0x8a3d('0x1ac')]){_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,'reason\x208\x20congestion');}else{_0x531d31['stateGlobal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1ad'));}}break;case'11':_0x23c2e6[_0x8a3d('0x1ae')]+=0x1;_0x75ba97['state']=0xb;_0x75ba97['statedesc']='Abandoned';_0x75ba97[_0x8a3d('0xe1')]+=0x1;_0x75ba97['countglobal']+=0x1;_0x9c1865=_0x23c2e6[_0x8a3d('0xe6')];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xdb')](_0x75ba97)['catch'](loggerCatch(_0x8a3d('0x1af')));if(_0x531d31['checkRetriveMax'](0xb,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0xe1')]>=_0x23c2e6['dialAbandonedMaxRetry']){_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1b0'));}else{_0x531d31['stateGlobal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1b0'));}}break;case'20':_0x23c2e6[_0x8a3d('0x1b1')]+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0x14;_0x75ba97[_0x8a3d('0x70')]=_0x8a3d('0x1b2');_0x75ba97[_0x8a3d('0x193')]+=0x1;_0x75ba97['countglobal']+=0x1;_0x9c1865=_0x23c2e6['dialAgentRejectRetryFrequency'];_0x7d0b43=_0x23c2e6['callAdditionalPhoneAfterMin'];ami['emit'](_0x8a3d('0x1b3'),ut[_0x8a3d('0x114')](_0x5dda18,'agentreject'));hopperUtils[_0x8a3d('0xdb')](_0x75ba97)[_0x8a3d('0xa2')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x531d31['checkRetriveMax'](0x14,_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97[_0x8a3d('0x193')]>=_0x23c2e6[_0x8a3d('0x192')]){_0x531d31['createStateFinal'](_0x75ba97,_0x10e969,_0x5e3a0d,_0x8a3d('0x1b4'));}else{_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,'reason\x2020\x20agentreject');}}break;default:_0x23c2e6['outboundUnknownCallsDay']+=0x1;_0x75ba97[_0x8a3d('0x6f')]=0xc;_0x75ba97[_0x8a3d('0x70')]=_0xa447cc['reason'];_0x9c1865=_0x23c2e6['dialAgentRejectRetryFrequency'];_0x7d0b43=_0x23c2e6[_0x8a3d('0xe2')];hopperUtils[_0x8a3d('0xdb')](_0x75ba97)['catch'](loggerCatch(_0x8a3d('0x1b5')));if(_0x531d31[_0x8a3d('0x19d')](_0xa447cc['reason'],_0x5dda18,_0x23c2e6)&&!_0x52c531){if(_0x75ba97['countbusyretry']+_0x75ba97['countcongestionretry']+_0x75ba97[_0x8a3d('0x11f')]+_0x75ba97['countnosuchnumberretry']+_0x75ba97[_0x8a3d('0xcf')]+_0x75ba97[_0x8a3d('0xe1')]+_0x75ba97[_0x8a3d('0x11b')]+_0x75ba97['countagentrejectretry']>=_0x23c2e6[_0x8a3d('0x121')]){_0x531d31[_0x8a3d('0x122')](_0x75ba97,_0x10e969,_0x5e3a0d,_0xa447cc['reason']);}else{_0x531d31[_0x8a3d('0x124')](_0x75ba97,_0x10e969,_0x5e3a0d,_0xa447cc['reason']);}}}})['then'](function(){if(_0x52c531){hopperUtils[_0x8a3d('0xdd')](_0x75ba97,_0x9c1865,_0x7d0b43)[_0x8a3d('0x9e')](function(){return _0x10e969(0x1);});}});});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x122')]=function(_0x39a0bd,_0x531661,_0x42b736,_0x196be2){var _0x228380=new Final(_0x39a0bd);_0x228380[_0x8a3d('0x6f')]=0xf;_0x228380[_0x8a3d('0x70')]='Global';this[_0x8a3d('0x124')](_0x228380,_0x531661,_0x42b736,_0x196be2);};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x124')]=function(_0x143054,_0x57f351,_0xfd696,_0x13cb6f){hopperUtils['moveContactManagedDialer'](_0x143054)[_0x8a3d('0x9e')](function(){return _0x57f351(msgResponse(_0x8a3d('0x196'),'Success',_0x13cb6f));})[_0x8a3d('0xa2')](function(){return _0xfd696(msgResponse(_0x8a3d('0x1b6'),_0x8a3d('0x93'),_0x8a3d('0x1b7')));});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0xa')]=function(_0x137d2f){var _0x5b23dc=_0x137d2f[_0x8a3d('0x1b8')]/0x64;var _0x4a843a=_0x137d2f[_0x8a3d('0x1b9')]/(_0x137d2f[_0x8a3d('0x1b9')]+_0x137d2f[_0x8a3d('0xc1')]);var _0x441fee=Math[_0x8a3d('0x1ba')](_0x137d2f[_0x8a3d('0x1bb')]*(_0x137d2f[_0x8a3d('0x1bc')]/0x64));var _0x36b1f7=Math[_0x8a3d('0x1ba')](_0x137d2f[_0x8a3d('0x1bb')]*(_0x137d2f['predictiveIntervalMinThreshold']/0x64));var _0x43ac8a=_0x137d2f['available']+_0x137d2f['talking'];var _0x13d2cb=Math['floor'](_0x137d2f[_0x8a3d('0x57')]*_0x137d2f[_0x8a3d('0x5a')]*_0x137d2f['predictiveIntervalHitRate']*_0x137d2f[_0x8a3d('0x1bd')]);if(_[_0x8a3d('0x3f')](_0x137d2f[_0x8a3d('0x27')])){if(!_[_0x8a3d('0x3f')](_0x137d2f[_0x8a3d('0x61')])){_0x137d2f['startPredictive']=undefined;loggerPredictive[_0x8a3d('0x65')](_0x8a3d('0x1be'),_0x8a3d('0x1bf'));}if(!_['isUndefined'](_0x137d2f[_0x8a3d('0x63')])){loggerPredictive[_0x8a3d('0x65')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x137d2f[_0x8a3d('0x63')]);_0x137d2f[_0x8a3d('0x63')]=undefined;}_0x137d2f[_0x8a3d('0x27')]=moment()[_0x8a3d('0x44')](_0x8a3d('0xc0'));loggerPredictive[_0x8a3d('0x47')](_0x137d2f[_0x8a3d('0x5f')],_0x8a3d('0x1c0'),_0x137d2f['startProgressive']);this[_0x8a3d('0xb2')](_0x137d2f,0x1);}else if(ifInterval(_0x137d2f[_0x8a3d('0x1c1')],_0x137d2f[_0x8a3d('0x27')])){this[_0x8a3d('0xb2')](_0x137d2f,0x1);loggerPredictiveCalls[_0x8a3d('0x47')](_0x8a3d('0x1c2'),_0x137d2f['startProgressive'],_0x137d2f[_0x8a3d('0x5f')]);_0x137d2f[_0x8a3d('0x57')]=0x0;_0x137d2f['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x5b23dc<_0x4a843a&&_0x137d2f[_0x8a3d('0x1c3')]===_0x8a3d('0x1c4')){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x1c5'),_0x8a3d('0x1c6'),_0x4a843a,_0x8a3d('0x27'),_0x137d2f[_0x8a3d('0x5f')]);}else if(_0x13d2cb<_0x137d2f[_0x8a3d('0x1c7')]&&_0x137d2f[_0x8a3d('0x1c3')]===_0x8a3d('0x1c4')){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x1c8'),'Max\x20Drop\x20',_0x13d2cb,_0x8a3d('0x1c9'),_0x137d2f[_0x8a3d('0x1c7')],_0x8a3d('0x27'),_0x137d2f[_0x8a3d('0x5f')]);}else if(!ifInterval(_0x137d2f['dialPredictiveInterval'],_0x137d2f[_0x8a3d('0x27')])&&_['isUndefined'](_0x137d2f[_0x8a3d('0x61')])&&!_[_0x8a3d('0x3f')](_0x137d2f['startProgressive'])){_0x137d2f[_0x8a3d('0x61')]=moment()[_0x8a3d('0x44')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x137d2f[_0x8a3d('0x5f')],'started\x20in\x20predictive\x20at',_0x137d2f[_0x8a3d('0x61')]);hopperUtils[_0x8a3d('0x1ca')](_0x137d2f[_0x8a3d('0x1c1')])[_0x8a3d('0x9e')](this[_0x8a3d('0x1cb')](_0x137d2f))[_0x8a3d('0x9e')](mergeDataErlangB(_0x137d2f))['then'](this['startMethodPredictive'](_0x137d2f))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x137d2f));}else if(!ifInterval(_0x137d2f[_0x8a3d('0x1c1')],_0x137d2f[_0x8a3d('0x61')])){_0x137d2f[_0x8a3d('0x1c7')]=0x0;_0x137d2f[_0x8a3d('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8a3d('0x47')](_0x137d2f[_0x8a3d('0x5f')],'recalculate\x20predictive\x20at',_0x137d2f['startPredictive']);clearInterval(_0x137d2f[_0x8a3d('0x63')]);_0x137d2f[_0x8a3d('0x63')]=undefined;hopperUtils[_0x8a3d('0x1ca')](_0x137d2f['dialPredictiveInterval'])[_0x8a3d('0x9e')](this[_0x8a3d('0x1cb')](_0x137d2f))[_0x8a3d('0x9e')](mergeDataErlangB(_0x137d2f))['then'](this[_0x8a3d('0x1cc')](_0x137d2f))[_0x8a3d('0xa2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x137d2f));}else if(_0x137d2f[_0x8a3d('0x1bb')]&&_0x43ac8a<_0x137d2f[_0x8a3d('0x1bb')]-_0x36b1f7){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x137d2f['name'],_0x8a3d('0x1cd'),_0x43ac8a,_0x8a3d('0x1ce'),_0x137d2f[_0x8a3d('0x1bb')],'-',_0x36b1f7,'=',_0x137d2f['predictiveIntervalAvailable']-_0x36b1f7,')');}else if(_0x137d2f['predictiveIntervalAvailable']&&_0x43ac8a>_0x137d2f['predictiveIntervalAvailable']+_0x441fee){clearPredictiveAttributes(_0x137d2f);loggerPredictive[_0x8a3d('0x47')](_0x137d2f['name'],_0x8a3d('0x1cd'),_0x43ac8a,_0x8a3d('0x1cf'),_0x137d2f['predictiveIntervalAvailable'],'+',_0x441fee,'=',_0x137d2f[_0x8a3d('0x1bb')]+_0x441fee,')');}};Dialer['prototype'][_0x8a3d('0x1cb')]=function(_0x395756){var _0x558b87=this;return function(_0x59079d){return new Promise(function(_0x292e74,_0x49b409){_[_0x8a3d('0x5d')](_0x395756,_0x59079d[0x0]);if(checkGetDataPredictive(_0x59079d[0x0])){var _0x564a2e=_0x395756[_0x8a3d('0x1bb')]=_0x395756[_0x8a3d('0x139')]+_0x395756[_0x8a3d('0x137')];var _0x533304=_0x395756[_0x8a3d('0x1c1')]*0x3c;var _0x252fed=_0x59079d[0x0]['predictiveIntervalAvgTalktime']+_0x59079d[0x0][_0x8a3d('0x4f')];var _0x5344f9=(_0x59079d[0x0][_0x8a3d('0x4a')]+_0x59079d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59079d[0x0][_0x8a3d('0x4d')])/_0x59079d[0x0][_0x8a3d('0x48')];_0x395756[_0x8a3d('0x1d0')]=_0x5344f9>0x0?_0x5344f9:0x1;switch(_0x395756[_0x8a3d('0x1c3')]){case _0x8a3d('0x1c4'):var _0x3d2d44=_0x395756['dialPredictiveOptimizationPercentage']/0x64;return _0x558b87['abandonmentRate'](_0x564a2e,_0x533304,_0x252fed,_0x5344f9,_0x3d2d44)['then'](function(_0x49680e){return _0x292e74(_0x49680e);});case _0x8a3d('0x1d1'):var _0xb1813d=_0x395756[_0x8a3d('0x1b8')]/0x64;return _0x558b87['busyFactor'](_0x564a2e,_0x533304,_0x252fed,_0x5344f9,_0xb1813d)[_0x8a3d('0x9e')](function(_0x974d46){return _0x292e74(_0x974d46);});default:return _0x49b409(msgResponse(_0x8a3d('0x1d2'),_0x8a3d('0x93'),_0x8a3d('0x1d3')));}}else{return _0x49b409(msgResponse(_0x8a3d('0x1d2'),_0x8a3d('0x93'),_0x8a3d('0x1d4')));}});};};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x1d5')]=function(_0x2d40a0){var _0x19c8da=this;return function(_0x1d49fb){return new Promise(function(_0x3a3e43,_0x92e24c){_['merge'](_0x2d40a0,_0x1d49fb[0x0]);if(checkGetDataPredictive(_0x1d49fb[0x0])){loggerPredictive[_0x8a3d('0x47')](JSON['stringify'](_0x1d49fb[0x0]));if(_0x2d40a0[_0x8a3d('0x1c3')]===_0x8a3d('0x1c4')){return _0x19c8da[_0x8a3d('0x151')](_0x2d40a0['id'])[_0x8a3d('0x9e')](function(_0x33e2e5){var _0x1180da=_0x2d40a0[_0x8a3d('0x1d6')]-_0x33e2e5[0x0][_0x8a3d('0x1d7')];var _0x46459e=_0x2d40a0[_0x8a3d('0x1c1')]*0x3c;var _0x2929f2=_0x1d49fb[0x0][_0x8a3d('0x51')]+_0x1d49fb[0x0]['predictiveIntervalAvgHoldtime'];var _0x1ccb36=(_0x1d49fb[0x0]['predictiveIntervalAnsweredCalls']+_0x1d49fb[0x0][_0x8a3d('0x4c')]+_0x1d49fb[0x0][_0x8a3d('0x4d')])/_0x1d49fb[0x0][_0x8a3d('0x48')];var _0x5943a0=_0x2d40a0[_0x8a3d('0x1b8')]/0x64;_0x2d40a0[_0x8a3d('0x1d8')]=_0x33e2e5[0x0][_0x8a3d('0x1d7')]||0x0;_0x2d40a0['predictiveIntervalHitRate']=_0x1ccb36>0x0?_0x1ccb36:0x1;return _0x19c8da[_0x8a3d('0x1d9')](_0x1180da,_0x46459e,_0x2929f2,_0x1ccb36,_0x5943a0);})['then'](function(_0xa5db91){return _0x3a3e43(_0xa5db91);})[_0x8a3d('0xa2')](function(_0x9c31fa){return _0x92e24c(msgResponse(_0x8a3d('0x1da'),'Failure',JSON[_0x8a3d('0x85')](_0x9c31fa)));});}if(_0x2d40a0[_0x8a3d('0x1c3')]===_0x8a3d('0x1d1')){return _0x19c8da[_0x8a3d('0x151')](_0x2d40a0['id'])[_0x8a3d('0x9e')](function(_0x27e85c){var _0x40b0ea=_0x2d40a0['loggedIn']-_0x27e85c[0x0]['outboundQueuePauses'];var _0x17ea55=_0x2d40a0['dialPredictiveInterval']*0x3c;var _0x30d93e=_0x1d49fb[0x0]['predictiveIntervalAvgTalktime']+_0x1d49fb[0x0][_0x8a3d('0x4f')];var _0x11fbdd=(_0x1d49fb[0x0][_0x8a3d('0x4a')]+_0x1d49fb[0x0][_0x8a3d('0x4c')]+_0x1d49fb[0x0][_0x8a3d('0x4d')])/_0x1d49fb[0x0][_0x8a3d('0x48')];var _0x58ac35=_0x2d40a0['dialPredictiveOptimizationPercentage']/0x64;_0x2d40a0[_0x8a3d('0x1d8')]=_0x27e85c[0x0]['outboundQueuePauses']||0x0;_0x2d40a0[_0x8a3d('0x1d0')]=_0x11fbdd>0x0?_0x11fbdd:0x1;return _0x19c8da['busyFactor'](_0x40b0ea,_0x17ea55,_0x30d93e,_0x11fbdd,_0x58ac35);})[_0x8a3d('0x9e')](function(_0x983b74){return _0x3a3e43(_0x983b74);})[_0x8a3d('0xa2')](function(_0xd9605d){return _0x92e24c(msgResponse(_0x8a3d('0x1da'),_0x8a3d('0x93'),JSON[_0x8a3d('0x85')](_0xd9605d)));});}}else{return _0x92e24c(msgResponse(_0x8a3d('0x1d2'),_0x8a3d('0x93'),_0x8a3d('0x1d4')));}});};};Dialer[_0x8a3d('0x1b')]['startMethodPredictive']=function(_0x41e98c){var _0x5b5b97=this;return function(){var _0x288bed=0x0;var _0x13d644=Math['floor'](_0x41e98c['erlangCallToSecond']*0x3e8);if(_0x13d644>0x0){_0x13d644=_0x13d644<0x64?0x64:_0x13d644;loggerPredictive[_0x8a3d('0x47')](_0x41e98c['name'],_0x8a3d('0x1db'),_0x13d644,_0x8a3d('0x1dc'));_0x41e98c[_0x8a3d('0x63')]=setInterval(function(){_0x5b5b97[_0x8a3d('0x63')](_0x41e98c);loggerPredictiveCalls[_0x8a3d('0x47')]('[handlePredictive]',_0x288bed+=0x1);},_0x13d644);}else{loggerPredictive['info'](_0x41e98c[_0x8a3d('0x5f')],_0x8a3d('0x1dd'));}};};Dialer['prototype'][_0x8a3d('0x1de')]=function(_0x3dd754,_0x16b02f){var _0x38d59c=this;return function(_0x2072a9){if(_[_0x8a3d('0x79')](_0x2072a9)){if(_['isNil'](_0x16b02f[_0x8a3d('0x158')])||!_0x16b02f['recallme']){if(_0x3dd754[_0x8a3d('0xaf')]==='booked'){_0x3dd754[_0x8a3d('0x73')]=_[_0x8a3d('0x3f')](_0x3dd754[_0x8a3d('0x73')])?!![]:_0x3dd754[_0x8a3d('0x73')];var _0x5bedfd=uuid['v4']();_0x38d59c[_0x8a3d('0x23')][_0x5bedfd]=new Action(_0x3dd754,_0x16b02f,_0x5bedfd);loggerBooked[_0x8a3d('0x47')](_0x8a3d('0x1df'),_0x5bedfd,_0x8a3d('0x1e0'),JSON[_0x8a3d('0x85')](_0x3dd754['queueStatusComplete']),'Queue:\x20',_0x3dd754[_0x8a3d('0x5f')]);if(_0x3dd754[_0x8a3d('0x73')]){_0x3dd754[_0x8a3d('0x73')]=![];_0x38d59c[_0x8a3d('0xf2')][_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xbe')]]=[];ami[_0x8a3d('0x9b')]({'actionid':_0x5bedfd,'action':_0x8a3d('0x1e1'),'queue':_0x3dd754[_0x8a3d('0x5f')]})['catch'](function(){_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);hopperUtils[_0x8a3d('0xe5')]({'active':![],'ContactId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xe7')],'ListId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xd8')],'VoiceQueueId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd]['VoiceQueueId']||undefined,'CampaignId':_0x38d59c['actions'][_0x5bedfd]['CampaignId']||undefined})['catch'](loggerCatch(_0x8a3d('0x1e2')));delete _0x38d59c[_0x8a3d('0x23')][_0x5bedfd];});}else{loggerBooked[_0x8a3d('0x47')]('[booked][checkContactBlack][else]',JSON[_0x8a3d('0x85')](_0x3dd754['queueStatusComplete']),_0x8a3d('0x1e3'),_0x3dd754['name']);_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xe7')],'ListId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd]['ListId'],'VoiceQueueId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0x102')]||undefined,'CampaignId':_0x38d59c[_0x8a3d('0x23')][_0x5bedfd][_0x8a3d('0xf6')]||undefined})[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x1e2')));delete _0x38d59c[_0x8a3d('0x23')][_0x5bedfd];}}else{return _0x38d59c[_0x8a3d('0x15b')](_0x3dd754,_0x16b02f);}}else{if(utils[_0x8a3d('0x5e')](undefined,_0x16b02f[_0x8a3d('0x1e4')])<_0x3dd754[_0x8a3d('0x1e5')]*0x3c){if(_0x16b02f['Agent']&&!_0x16b02f[_0x8a3d('0x1e6')]['voicePause']){_0x38d59c['preview']['run'](_0x16b02f['id'])[_0x8a3d('0x1d')](function(){_0x38d59c['updateOriginated'](_0x3dd754);});}else{hopperUtils[_0x8a3d('0x1e7')]({'active':![]},_0x16b02f['id'],0x1)[_0x8a3d('0x1d')](function(){_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);});}}else{_0x3dd754['outboundReCallsDay']+=0x1;_0x38d59c[_0x8a3d('0xbd')](_0x3dd754);if(_0x3dd754[_0x8a3d('0x1e8')]){hopperUtils[_0x8a3d('0xe5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16b02f[_0x8a3d('0xe7')],'ListId':_0x16b02f[_0x8a3d('0xd8')],'VoiceQueueId':_0x16b02f[_0x8a3d('0x102')]||undefined,'CampaignId':_0x16b02f['CampaignId']||undefined})['catch'](loggerCatch(_0x8a3d('0x1e9')));hopperUtils[_0x8a3d('0xdb')](createObjHistory(_0x3dd754,_0x16b02f,utils[_0x8a3d('0x69')][_0x8a3d('0x1ea')],0x17,_0x8a3d('0x1eb')))[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x1ec')));}else{_0x38d59c[_0x8a3d('0x116')](createObjHistory(_0x3dd754,_0x16b02f,utils[_0x8a3d('0x69')]['RECALL_TIMEOUT'],0x16,_0x8a3d('0x1ed')),'[Originate][HistoryRecallClose][historyCatch]',_0x8a3d('0x1ee'));}}}}else{_0x3dd754[_0x8a3d('0x1ef')]+=0x1;_0x38d59c['saveInDb'](createObjHistory(_0x3dd754,_0x16b02f,utils[_0x8a3d('0x69')]['BLACKLIST'],0xd,'Blacklist'),_0x8a3d('0x1f0'),_0x8a3d('0x1f1'));throw'inBlackList';}};};Dialer['prototype'][_0x8a3d('0x1f2')]=function(_0x354532){var _0x19a669=this;var _0x563631=_0x354532[_0x8a3d('0x1f3')]-_0x354532[_0x8a3d('0x80')];emitCampaignSummary(_0x354532);if(_0x563631>0x0&&_0x354532[_0x8a3d('0x68')]==0x0){if(_0x563631>this[_0x8a3d('0x22')]){_0x563631=this[_0x8a3d('0x22')];}_0x354532[_0x8a3d('0x68')]=0x1;hopperUtils['getContactDialerIvr'](_0x354532,_0x563631)[_0x8a3d('0x9e')](function(_0x1b1e16){_0x354532[_0x8a3d('0x68')]=0x0;if(_0x1b1e16){if(!utils[_0x8a3d('0x1f4')](_0x1b1e16)){_0x354532[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x6d')];logger[_0x8a3d('0x47')](_0x8a3d('0x1f5')+_0x354532[_0x8a3d('0x5f')]);}else{_0x354532[_0x8a3d('0x80')]+=_0x1b1e16[_0x8a3d('0x99')];_0x354532[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')][_0x8a3d('0x1f6')];for(var _0x182a86=0x0;_0x182a86<_0x1b1e16['length'];_0x182a86+=0x1){_0x354532[_0x8a3d('0x1f7')]+=0x1;if(_[_0x8a3d('0xee')](_0x1b1e16[_0x182a86])||_[_0x8a3d('0xee')](_0x1b1e16[_0x182a86]['Contact'])||_[_0x8a3d('0xee')](_0x1b1e16[_0x182a86][_0x8a3d('0x15f')])){_0x19a669[_0x8a3d('0x156')](_0x8a3d('0x1f8'),_0x354532,_0x1b1e16[_0x182a86]);}else{hopperUtils[_0x8a3d('0x1f9')](_[_0x8a3d('0x74')](_0x1b1e16[_0x182a86],['CampaignId',_0x8a3d('0x15f')]))[_0x8a3d('0x9e')](_0x19a669['checkContactBlack'](_0x354532,_0x1b1e16[_0x182a86]))['catch'](_0x19a669[_0x8a3d('0x155')](_0x8a3d('0x1fa'),_0x354532));}}}}})['catch'](loggerGetContactDialer(_0x8a3d('0x1fb'),_0x354532,_0x563631));}};Dialer[_0x8a3d('0x1b')]['handlePower']=function(_0x40f653,_0x1c6af6){var _0x2ace41=this;var _0x5f51bb=[];if(_0x1c6af6<0x1||_0x40f653[_0x8a3d('0xaf')]===_0x8a3d('0x9')){_0x1c6af6=0x1;}var _0x5cdf20=Math[_0x8a3d('0x1fc')](_0x40f653[_0x8a3d('0x137')]*_0x1c6af6)-_0x40f653[_0x8a3d('0x80')];if(_0x40f653[_0x8a3d('0x1fd')]>0x0){var _0x45f322=_0x40f653['dialLimitQueue']-_0x40f653[_0x8a3d('0x80')]-_0x40f653['talking']-_0x40f653['pTalking'];if(_0x5cdf20>_0x45f322){_0x5cdf20=_0x45f322;}}if(_0x5cdf20>0x0&&_0x40f653[_0x8a3d('0x68')]==0x0){if(_0x40f653[_0x8a3d('0xaf')]==='booked'){_0x5cdf20=0x1;}if(_0x5cdf20>this[_0x8a3d('0x22')]){_0x5cdf20=this[_0x8a3d('0x22')];}for(var _0x1e5cf1 in this['agents']){if(typeof this[_0x8a3d('0x21')][_0x1e5cf1]!==_0x8a3d('0x14d')){if(this['agents'][_0x1e5cf1][_0x8a3d('0x6f')]===_0x8a3d('0x1fe')&&this[_0x8a3d('0x21')][_0x1e5cf1][_0x8a3d('0x8a')]===_0x8a3d('0x8b')){_0x5f51bb[_0x8a3d('0x9a')](this[_0x8a3d('0x21')][_0x1e5cf1]['id']);}}}_0x40f653[_0x8a3d('0x68')]=0x1;hopperUtils[_0x8a3d('0x1ff')](_0x40f653,_0x5f51bb,_0x5cdf20)[_0x8a3d('0x9e')](function(_0x383509){_0x40f653[_0x8a3d('0x68')]=0x0;if(_0x383509){if(!utils[_0x8a3d('0x1f4')](_0x383509)){hopperUtils[_0x8a3d('0x200')](_0x40f653)[_0x8a3d('0x9e')](sendMessageReschedule(_0x40f653))[_0x8a3d('0xa2')](loggerCatch(_0x8a3d('0x201')));}else{_0x40f653['originated']+=_0x383509[_0x8a3d('0x99')];_0x40f653['message']=_0x40f653['dialMethod']===_0x8a3d('0x9')?utils['CAMPAIGN_STATUS']['ACTIVE']:utils['CAMPAIGN_STATUS'][_0x8a3d('0x1f6')];for(var _0x42942f=0x0;_0x42942f<_0x383509[_0x8a3d('0x99')];_0x42942f+=0x1){if(_[_0x8a3d('0xee')](_0x383509[_0x42942f])||_[_0x8a3d('0xee')](_0x383509[_0x42942f][_0x8a3d('0x175')])||_[_0x8a3d('0xee')](_0x383509[_0x42942f][_0x8a3d('0x15f')])){_0x2ace41[_0x8a3d('0x156')](_0x8a3d('0x1f8'),_0x40f653,_0x383509[_0x42942f]);}else{hopperUtils[_0x8a3d('0x202')](_[_0x8a3d('0x74')](_0x383509[_0x42942f],[_0x8a3d('0x102'),_0x8a3d('0x15f')]))['then'](_0x2ace41[_0x8a3d('0x1de')](_0x40f653,_0x383509[_0x42942f]))[_0x8a3d('0xa2')](_0x2ace41['loggerHandler']('[actionOriginate]\x20',_0x40f653));}}}}})['catch'](loggerGetContactDialer(_0x8a3d('0x203'),_0x40f653,_0x5cdf20));}};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x63')]=function(_0x325eca){if(_0x325eca[_0x8a3d('0x1fd')]>0x0){var _0x16f828=_0x325eca['dialLimitQueue']-_0x325eca[_0x8a3d('0x80')]-_0x325eca['talking'];if(_0x16f828>0x0&&_0x325eca[_0x8a3d('0x68')]==0x0){this[_0x8a3d('0x204')](_0x325eca);}else{loggerPredictiveCalls[_0x8a3d('0x47')](_0x8a3d('0x205'));}}else{this[_0x8a3d('0x204')](_0x325eca);}};Dialer['prototype'][_0x8a3d('0x204')]=function(_0x11cdfa){var _0x1efef4=this;var _0x26f8f9=[];_0x11cdfa[_0x8a3d('0x80')]+=0x1;for(var _0x3f4522 in this[_0x8a3d('0x21')]){if(typeof this[_0x8a3d('0x21')][_0x3f4522]!==_0x8a3d('0x14d')){if(this[_0x8a3d('0x21')][_0x3f4522]['state']===_0x8a3d('0x1fe')&&this[_0x8a3d('0x21')][_0x3f4522]['status']==='reachable'){_0x26f8f9[_0x8a3d('0x9a')](this[_0x8a3d('0x21')][_0x3f4522]['id']);}}}_0x11cdfa[_0x8a3d('0x68')]=0x1;return this['getContactDialer'](_0x11cdfa['id'],_0x26f8f9,0x1,_0x11cdfa[_0x8a3d('0x206')],_0x11cdfa)[_0x8a3d('0x9e')](function(_0x436cf3){_0x11cdfa[_0x8a3d('0x68')]=0x1;if(_0x436cf3){if(!utils[_0x8a3d('0x1f4')](_0x436cf3)){utils['checkContactLowerLimitOriginate'](_0x11cdfa,0x1,0x0);return hopperUtils['countReScheduled'](_0x11cdfa)[_0x8a3d('0x9e')](sendMessageReschedule(_0x11cdfa))['catch'](loggerCatch(_0x8a3d('0x201')));}else{_0x11cdfa[_0x8a3d('0x6c')]=utils[_0x8a3d('0x69')]['RUNNING'];if(_[_0x8a3d('0xee')](_0x436cf3[0x0])||_[_0x8a3d('0xee')](_0x436cf3[0x0][_0x8a3d('0x175')])||_['isNil'](_0x436cf3[0x0]['phone'])){_0x1efef4['emptyContact'](_0x8a3d('0x1f8'),_0x11cdfa,_0x436cf3[0x0]);}else{return hopperUtils[_0x8a3d('0x202')](_['pick'](_0x436cf3[0x0],[_0x8a3d('0x102'),_0x8a3d('0x15f')]))[_0x8a3d('0x9e')](_0x1efef4[_0x8a3d('0x1de')](_0x11cdfa,_0x436cf3[0x0]))[_0x8a3d('0xa2')](_0x1efef4[_0x8a3d('0x155')]('[actionOriginatePredictive]\x20',_0x11cdfa));}}}})[_0x8a3d('0xa2')](loggerGetContactDialer('[getContactDialerPredictive]',_0x11cdfa,0x1));};Dialer['prototype'][_0x8a3d('0x1d9')]=function(_0x42e9c0,_0x344573,_0x2e87a6,_0x4f72c8,_0x5b869a,_0x2f57d5){loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x207'));loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x208'),_0x42e9c0);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x209'),_0x344573);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20a'),_0x2e87a6);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20b'),_0x4f72c8);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20c'),_0x5b869a);loggerPredictive[_0x8a3d('0x47')]('---------------------------');return new Promise(function(_0x204e81,_0x534574){if(_0x42e9c0<=0x0||isNaN(_0x42e9c0)){return _0x534574(msgResponse('[abandonmentRate]',_0x8a3d('0x84'),_0x8a3d('0x20d')+_0x42e9c0));}if(_0x2e87a6<=0x0||isNaN(_0x2e87a6)){return _0x534574(msgResponse(_0x8a3d('0x20e'),_0x8a3d('0x84'),_0x8a3d('0x20f')+_0x2e87a6));}if(_0x4f72c8<=0x0||isNaN(_0x4f72c8)){return _0x534574(msgResponse(_0x8a3d('0x20e'),'Error',_0x8a3d('0x210')+_0x4f72c8));}if(_0x344573<=0x0||isNaN(_0x344573)){return _0x534574(msgResponse(_0x8a3d('0x20e'),'Error','interval\x20=\x20'+_0x344573));}if(_0x5b869a<=0x0||isNaN(_0x5b869a)){return _0x534574(msgResponse('[abandonmentRate]',_0x8a3d('0x84'),_0x8a3d('0x211')+_0x5b869a));}_0x2f57d5=_0x2f57d5||0x0;var _0x6a0a03=0x1/_0x2e87a6;var _0x113dd3=0x0;var _0x1c371e=0x0;var _0x5dd0df=0x0;var _0xa321f1=0x0;for(var _0x47ab35=0x0;_0x5dd0df<_0x5b869a;_0x47ab35+=0x1){_0x1c371e=_0x47ab35/_0x344573;_0x113dd3=(_0x4f72c8*_0x1c371e+_0x2f57d5)/_0x6a0a03;_0x5dd0df=utils['erlangb'](_0x113dd3,_0x42e9c0);_0xa321f1=_0x113dd3/_0x42e9c0*(0x1-utils[_0x8a3d('0x212')](_0x113dd3,_0x42e9c0));}return _0x204e81({'erlangCalls':_0x47ab35,'erlangCallToSecond':_0x344573/_0x47ab35,'erlangAbandonmentRate':_0x5dd0df,'erlangBusyFactor':_0xa321f1});});};Dialer[_0x8a3d('0x1b')][_0x8a3d('0x213')]=function(_0x3e0f01,_0x189ccd,_0x490cdd,_0x25031b,_0x571fdd,_0x1a64b6){loggerPredictive[_0x8a3d('0x47')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x8a3d('0x208'),_0x3e0f01);loggerPredictive['info'](_0x8a3d('0x209'),_0x189ccd);loggerPredictive['info'](_0x8a3d('0x20a'),_0x490cdd);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x20b'),_0x25031b);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x214'),_0x571fdd);loggerPredictive[_0x8a3d('0x47')](_0x8a3d('0x215'));return new Promise(function(_0x253713,_0x3e0870){if(_0x3e0f01<=0x0||isNaN(_0x3e0f01)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x20d')+_0x3e0f01));}if(_0x490cdd<=0x0||isNaN(_0x490cdd)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),'Ts\x20=\x20'+_0x490cdd));}if(_0x25031b<=0x0||isNaN(_0x25031b)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x210')+_0x25031b));}if(_0x189ccd<=0x0||isNaN(_0x189ccd)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x217')+_0x189ccd));}if(_0x571fdd<=0x0||isNaN(_0x571fdd)){return _0x3e0870(msgResponse(_0x8a3d('0x216'),_0x8a3d('0x84'),_0x8a3d('0x218')+_0x571fdd));}_0x1a64b6=_0x1a64b6||0x0;var _0x440736=0x1/_0x490cdd;var _0x43a80e=0x0;var _0x5b1edd=0x0;var _0x53f47b=0x0;var _0x4d238b=0x0;for(var _0x24fcb6=0x0;_0x4d238b<_0x571fdd;_0x24fcb6+=0x1){_0x5b1edd=_0x24fcb6/_0x189ccd;_0x43a80e=(_0x25031b*_0x5b1edd+_0x1a64b6)/_0x440736;_0x53f47b=utils[_0x8a3d('0x212')](_0x43a80e,_0x3e0f01);_0x4d238b=_0x43a80e/_0x3e0f01*(0x1-utils[_0x8a3d('0x212')](_0x43a80e,_0x3e0f01));}return _0x253713({'erlangCalls':_0x24fcb6,'erlangCallToSecond':_0x189ccd/_0x24fcb6,'erlangAbandonmentRate':_0x53f47b,'erlangBusyFactor':_0x4d238b});});};module['exports']=Dialer; \ No newline at end of file +var _0x0ee3=['xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','Machine','countmachineretry','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','[rescheduleContact][Machine]','custom:amd','[syncHangupInAMDIvr][createHistory]','MACHINE','[syncAgentComplete][createHistory][0]','countbusyretry','reason19\x20machine....','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','moveContactManagedDialer','cause-txt','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','dialPreviewRecallmeReminder','filter','online','reachable','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','[emptyContact][createHistory]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','user:%s','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','checkRetriveMax','countnosuchnumberretry','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','busy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','avgHandleTime','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','talking','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','erlangCallToSecond','milliseconds','[handlePredictive]','checkContactBlack','booked','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','countReScheduled','[countReScheduled]\x20','checkIsBlackList','tryOriginatePredictive','getContactDialer','dialOrderByScheduledAt','checkContactEmpty','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','erlangb','util','lodash','moment','ioredis','./utils/hopper','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','emit','type','outbound','debug','inspect','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','predictiveIntervalAvgTalktime','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','getSeconds','name','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','stack','error','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','Failure','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','ifTime','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','catch','push','Action','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','dialGlobalInterval','launchHandleIvr','checkDialMethod','predictive','dialMethod','handlePower','power','dialPowerLevel','Queue','dialTimezone','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','voiceQueues','uniqueid','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete]','syncQueueCallerAbandon','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','TIMEOUT','countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','roundrobin','locked','paused','stateinterface','isNil','queueBooked','merge','idHopper','syncQueueStatusComplete','rrmemory','run','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','variable','amdstatus','exten'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0x0ee3,0x10c));var _0x30ee=function(_0x2a33ca,_0x3d9c2a){_0x2a33ca=_0x2a33ca-0x0;var _0x5a4955=_0x0ee3[_0x2a33ca];return _0x5a4955;};'use strict';var util=require(_0x30ee('0x0'));var _=require(_0x30ee('0x1'));var uuid=require('uuid');var moment=require(_0x30ee('0x2'));var rr=require('rr');var Redis=require(_0x30ee('0x3'));var utils=require('./utils');var hopperUtils=require(_0x30ee('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x30ee('0x5'))(_0x30ee('0x6'));var loggerBooked=require(_0x30ee('0x5'))('booked');var loggerPredictive=require(_0x30ee('0x5'))('predictive');var loggerPredictiveCalls=require(_0x30ee('0x5'))(_0x30ee('0x7'));var loggerSyncQueueSummary=require(_0x30ee('0x5'))(_0x30ee('0x8'));var ami=require('../ami');config[_0x30ee('0x9')]=_[_0x30ee('0xa')](config[_0x30ee('0x9')],{'host':_0x30ee('0xb'),'port':0x18eb});var io=require(_0x30ee('0xc'))(new Redis(config[_0x30ee('0x9')]));var cmHopper=require(_0x30ee('0xd'));var voiceQueueRt=require(_0x30ee('0xe'));var RpcSetting=require(_0x30ee('0xf'));var Interval=require(_0x30ee('0x10'));var Action=require(_0x30ee('0x11'));var History=require(_0x30ee('0x12'));var Final=require(_0x30ee('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x30ee('0x14'));var Hangup=require(_0x30ee('0x15'));var ipAgi=process['env'][_0x30ee('0x16')]||_0x30ee('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x30ee('0x18')][_0x30ee('0x19')]=function(_0x24d49b){this[_0x30ee('0x1a')]=this[_0x30ee('0x1a')]?this['tail'][_0x30ee('0x1b')](_0x24d49b):_0x24d49b();};function Dialer(_0x28c3f3,_0x39b6c4){this[_0x30ee('0x1c')]=new Sequence();this[_0x30ee('0x1d')]=_0x39b6c4;this['voiceQueues']=_0x28c3f3['voiceQueues'];this['campaigns']=_0x28c3f3[_0x30ee('0x1e')];this[_0x30ee('0x1f')]=_0x28c3f3['agents'];this[_0x30ee('0x20')]=_0x28c3f3['trunks'];this['maxNumberOriginate']=config[_0x30ee('0x21')]||0x2;this[_0x30ee('0x22')]={};this[_0x30ee('0x23')]={};this[_0x30ee('0x24')]={};this[_0x30ee('0x25')]={};this['optionPredictive']={};this[_0x30ee('0x26')]={};this[_0x30ee('0x27')]={};this[_0x30ee('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};this[_0x30ee('0x29')]={};ami['on'](_0x30ee('0x2a'),this[_0x30ee('0x2b')]['bind'](this));ami['on'](_0x30ee('0x2c'),this['syncQueueCallerAbandon'][_0x30ee('0x2d')](this));ami['on'](_0x30ee('0x2e'),this[_0x30ee('0x2f')][_0x30ee('0x2d')](this));ami['on'](_0x30ee('0x30'),this[_0x30ee('0x31')][_0x30ee('0x2d')](this));ami['on'](_0x30ee('0x32'),this[_0x30ee('0x8')][_0x30ee('0x2d')](this));ami['on']('custom:queuesummarycomplete',this[_0x30ee('0x33')][_0x30ee('0x2d')](this));ami['on'](_0x30ee('0x34'),this[_0x30ee('0x35')][_0x30ee('0x2d')](this));ami['on'](_0x30ee('0x36'),this[_0x30ee('0x37')][_0x30ee('0x2d')](this));ami['on']('varset',this[_0x30ee('0x38')]['bind'](this));ami['on']('queuemember',this[_0x30ee('0x39')][_0x30ee('0x2d')](this));ami['on'](_0x30ee('0x3a'),this['syncQueueStatusComplete'][_0x30ee('0x2d')](this));this[_0x30ee('0x3b')]();this[_0x30ee('0x3c')]();RpcSetting[_0x30ee('0x3d')]()[_0x30ee('0x3e')](function(_0x6f7d0b){previewRecallmeReminderInterval=_0x6f7d0b[_0x30ee('0x3f')];});}function isNotNull(_0x1a8339){return _0x1a8339!==null&&!_['isUndefined'](_0x1a8339);}function msgResponse(_0x43a0c2,_0x414fbf,_0x1ff97b){return{'action':_0x43a0c2,'response':_0x414fbf,'message':_0x1ff97b,'stack':_0x1ff97b};}function emit(_0x518e58,_0x1bb624,_0x47157b){io['to'](_0x518e58)[_0x30ee('0x40')](_0x1bb624,_0x47157b);}function emitOutboundVoiceQueueSummary(_0x3bb2fc){if(_0x3bb2fc[_0x30ee('0x41')]===_0x30ee('0x42')){logger[_0x30ee('0x43')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x30ee('0x44')](_0x3bb2fc,{'showHidden':![],'depth':null}));emit(util['format'](_0x30ee('0x45'),_0x3bb2fc['name']),_0x30ee('0x46'),_0x3bb2fc);}}function checkGetDataPredictive(_0x5f2f3e){if(isNotNull(_0x5f2f3e)&&!_[_0x30ee('0x47')](_0x5f2f3e)){loggerPredictive[_0x30ee('0x48')](_0x30ee('0x49'));loggerPredictive['info'](_0x30ee('0x4a'),_0x5f2f3e[_0x30ee('0x4b')]);loggerPredictive['info'](_0x30ee('0x4c'),_0x5f2f3e[_0x30ee('0x4d')]);loggerPredictive['info'](_0x30ee('0x4e'),_0x5f2f3e[_0x30ee('0x4f')]);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x50'),_0x5f2f3e[_0x30ee('0x51')]);loggerPredictive[_0x30ee('0x48')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f2f3e['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x30ee('0x52'),_0x5f2f3e['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x30ee('0x53'));if(_0x5f2f3e[_0x30ee('0x4b')]>0x0){if(!_[_0x30ee('0x54')](_0x5f2f3e[_0x30ee('0x55')])&&_0x5f2f3e['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x30ee('0x48')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x30ee('0x54')](_0x5f2f3e[_0x30ee('0x56')])&&_0x5f2f3e[_0x30ee('0x56')]>0x0){return!![];}loggerPredictive[_0x30ee('0x48')](_0x30ee('0x57'));}else{loggerPredictive[_0x30ee('0x48')](_0x30ee('0x58'));}}else{loggerPredictive[_0x30ee('0x48')](_0x30ee('0x59'));}return![];}function mergeDataErlangB(_0x2ecbb9){return function(_0x391bb7){loggerPredictive[_0x30ee('0x48')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x30ee('0x48')](_0x30ee('0x5a'),_0x391bb7[_0x30ee('0x5b')]);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x5c'),_0x391bb7['erlangCallToSecond']);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x5d'),_0x391bb7['erlangAbandonmentRate']);loggerPredictive['info'](_0x30ee('0x5e'),_0x391bb7[_0x30ee('0x5f')]);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x5d'),_0x391bb7[_0x30ee('0x60')]);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x53'));_['merge'](_0x2ecbb9,_0x391bb7);};}function ifInterval(_0x31ffc9,_0xb23745){if(_['isUndefined'](_0xb23745)){return![];}return utils[_0x30ee('0x61')](undefined,_0xb23745)<_0x31ffc9*0x3c;}function clearPredictiveAttributes(_0xae80f4){if(_0xae80f4[_0x30ee('0x27')]){_0xae80f4[_0x30ee('0x27')]=undefined;loggerPredictive[_0x30ee('0x43')](_0xae80f4[_0x30ee('0x62')],'startProgressive\x20value\x20cleared');}if(_0xae80f4[_0x30ee('0x26')]){_0xae80f4[_0x30ee('0x26')]=undefined;loggerPredictive['debug'](_0xae80f4[_0x30ee('0x62')],_0x30ee('0x63'));}if(_0xae80f4['handlePredictive']){clearInterval(_0xae80f4[_0x30ee('0x64')]);_0xae80f4[_0x30ee('0x64')]=undefined;loggerPredictive[_0x30ee('0x43')](_0xae80f4[_0x30ee('0x62')],_0x30ee('0x65'));}}function loggerCatchPredictive(_0x421f42,_0x5a1421){return function(_0x4f054a){loggerPredictive['error'](_0x5a1421[_0x30ee('0x62')],_0x421f42);loggerPredictive['error'](_0x4f054a[_0x30ee('0x66')]);clearPredictiveAttributes(_0x5a1421);};}function loggerCatch(_0x49c7d6){return function(_0x297559){logger[_0x30ee('0x67')](_0x49c7d6,util['inspect'](_0x297559,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x987b42,_0x42ea8e,_0x152b9b){return function(_0x56be38){utils[_0x30ee('0x68')](_0x42ea8e,_0x152b9b,0x0);_0x42ea8e[_0x30ee('0x69')]=0x0;logger[_0x30ee('0x67')](_0x987b42,util[_0x30ee('0x44')](_0x56be38,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5b38a4){return function(_0x5630d5){if(isNotNull(_0x5630d5)&&isNotNull(_0x5630d5[0x0])){if(_0x5630d5[0x0][_0x30ee('0x6a')]>0x0){_0x5b38a4[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x6d')];logger['info'](_0x30ee('0x6e')+_0x5b38a4[_0x30ee('0x62')],_0x5630d5[0x0][_0x30ee('0x6a')],_0x30ee('0x6f'));}else{_0x5b38a4[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x70')];logger[_0x30ee('0x48')](_0x30ee('0x71')+_0x5b38a4[_0x30ee('0x62')]);}}};}function createObjHistory(_0x212a16,_0xb5c31c,_0x12267e,_0x53e2e6,_0x3c9b12){_0x212a16[_0x30ee('0x6b')]=_0x12267e;var _0x4ce811=new Action(_0x212a16,_0xb5c31c);var _0x256069=new History(_0x4ce811);_0x256069['state']=_0x53e2e6;_0x256069[_0x30ee('0x72')]=_0x3c9b12;_0x256069[_0x30ee('0x73')]=_0x4ce811[_0x30ee('0x74')];return _0x256069;}function unlockQueueStatus(_0x535280,_0x18014d){setTimeout(function(){if(_[_0x30ee('0x54')](_0x535280['queueStatusComplete'])){loggerBooked[_0x30ee('0x67')]('[unlockQueueStatus][undefined]',_0x18014d);}_0x535280[_0x30ee('0x75')]=!![];loggerBooked[_0x30ee('0x48')](_0x30ee('0x76'),_0x18014d,JSON[_0x30ee('0x77')](_[_0x30ee('0x78')](_0x535280,[_0x30ee('0x62'),_0x30ee('0x75')])));},0x1f3);}function checkInterval(_0x3fc4ee){return function(){if(!isNotNull(_0x3fc4ee[_0x30ee('0x79')])){_0x3fc4ee['message']=utils[_0x30ee('0x6c')][_0x30ee('0x7a')];throw _0x3fc4ee['name']+_0x30ee('0x7b');}if(!isNotNull(_0x3fc4ee['Interval'][_0x30ee('0x7c')])){_0x3fc4ee['message']=utils[_0x30ee('0x6c')][_0x30ee('0x7a')];throw _0x3fc4ee[_0x30ee('0x62')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x30ee('0x47')](_0x3fc4ee[_0x30ee('0x79')][_0x30ee('0x7c')]))){_0x3fc4ee[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x7a')];throw _0x3fc4ee['name']+_0x30ee('0x7b');}};}function checkIsIVRCampaignActive(_0x3dd99b){return function(){if(!utils[_0x30ee('0x7d')](_0x3dd99b)){_0x3dd99b[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x7e')];throw _0x3dd99b[_0x30ee('0x62')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x9bee10){if(utils['isIVRCampaign'](_0x9bee10)){emit(util[_0x30ee('0x7f')](_0x30ee('0x80'),_0x9bee10[_0x30ee('0x62')]),_0x30ee('0x81'),_0x9bee10);}}function loggerCatchQueueSummary(_0x50b109,_0x1d5bc7){return function(_0x2971b5){clearPredictiveAttributes(_0x1d5bc7);emitCampaignSummary(_0x1d5bc7);loggerSyncQueueSummary[_0x30ee('0x43')](_0x50b109,util['inspect'](_0x2971b5,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x57c203){if(_0x57c203[_0x30ee('0x82')]){if(_0x57c203['originated']===0x0){_0x57c203['sendMessageOneNotActive']=![];_0x57c203['message']=utils[_0x30ee('0x6c')][_0x30ee('0x7e')];loggerSyncQueueSummary['debug'](_0x30ee('0x83'),_0x57c203[_0x30ee('0x62')],_0x30ee('0x84'));}else{_0x57c203[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x85')];loggerSyncQueueSummary[_0x30ee('0x43')](_0x30ee('0x83'),_0x57c203[_0x30ee('0x62')],_0x30ee('0x86'));}emitCampaignSummary(_0x57c203);}}function myreject(_0x3b6ba3){return function(_0x3246b9){return _0x3b6ba3(msgResponse(_0x30ee('0x87'),_0x30ee('0x88'),JSON[_0x30ee('0x77')](_0x3246b9)));};}Dialer[_0x30ee('0x18')][_0x30ee('0x89')]=function(_0x344be7){return!_['isUndefined'](_0x344be7)&&_0x344be7&&!_[_0x30ee('0x54')](_0x344be7[_0x30ee('0x62')])&&!_['isUndefined'](_0x344be7[_0x30ee('0x8a')])&&_0x344be7[_0x30ee('0x8a')]&&(this[_0x30ee('0x20')][util['format'](_0x30ee('0x8b'),_0x344be7[_0x30ee('0x62')])][_0x30ee('0x8c')]==='reachable'||this[_0x30ee('0x20')][util[_0x30ee('0x7f')](_0x30ee('0x8b'),_0x344be7[_0x30ee('0x62')])]['status']==='unmonitored');};Dialer[_0x30ee('0x18')]['checkIsTrunkReachable']=function(_0x2549f7){var _0x554e28=this;return function(){if(!_0x554e28[_0x30ee('0x89')](_0x2549f7['Trunk'])){if(!_0x554e28[_0x30ee('0x89')](_0x2549f7[_0x30ee('0x8d')])){_0x2549f7[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x8e')];throw _0x2549f7['name']+_0x30ee('0x8f');}}};};Dialer[_0x30ee('0x18')][_0x30ee('0x90')]=function(_0x2cf022,_0x4aef6a,_0xad4e12,_0x1b2fab){var _0x4db532=this;return function(){var _0x2220e6=!![];return _0x4db532[_0x30ee('0x91')](_0x2cf022,_0x4aef6a,_0xad4e12,_0x1b2fab,_0x2220e6);};};Dialer[_0x30ee('0x18')][_0x30ee('0x92')]=function(_0x34b4df,_0xa6024f,_0x4c400a,_0xc012fb){var _0x5cbe7e=this;return function(){var _0x1b1911=![];return _0x5cbe7e['ifTimeIvr'](_0x34b4df[_0x30ee('0x7c')],_0xa6024f,_0x4c400a,_0xc012fb,_0x1b1911);};};Dialer[_0x30ee('0x18')]['ifTimeIvr']=function(_0x3e5717,_0x4aa871,_0x4fd3c8,_0xc598f7,_0x5d7c03){var _0x5b2821=[];return new Promise(function(_0x586410,_0x46aa46){if(!isNotNull(_0x3e5717)){_0xc598f7['message']=utils['CAMPAIGN_STATUS'][_0x30ee('0x7a')];return _0x46aa46(msgResponse('ifTime','Failure',_0x4fd3c8+_0x30ee('0x93')));}if(_[_0x30ee('0x47')](_0x3e5717)){_0xc598f7[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x94')];return _0x46aa46(msgResponse('ifTime',_0x30ee('0x95'),_0x4fd3c8+_0x30ee('0x96')));}if(_0x4aa871&&_[_0x30ee('0x54')](config['timezones'][_0x4aa871])){_0xc598f7[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x97')];return _0x46aa46(msgResponse(_0x30ee('0x98'),_0x30ee('0x95'),_0x4fd3c8+_0x30ee('0x99')+_0x4aa871));}if(_['isArray'](_0x3e5717)){for(var _0x2c0dba=0x0;_0x2c0dba<_0x3e5717['length'];_0x2c0dba+=0x1){_0x5b2821['push'](ami['Action']({'action':_0x30ee('0x9a'),'command':util[_0x30ee('0x7f')](_0x30ee('0x9b'),_0x3e5717[_0x2c0dba][_0x30ee('0x9c')],!_['isUndefined'](config[_0x30ee('0x9d')][_0x4aa871])?_0x4aa871:'')})[_0x30ee('0x3e')](function(_0x5d7077){return _0x5d7077[_0x30ee('0x9e')][_0x30ee('0x9f')](_0x30ee('0xa0'))>=0x0;})[_0x30ee('0xa1')](myreject(_0x46aa46)));}}else{_0x5b2821[_0x30ee('0xa2')](ami[_0x30ee('0xa3')]({'action':_0x30ee('0x9a'),'command':util[_0x30ee('0x7f')](_0x30ee('0x9b'),_0x3e5717,!_[_0x30ee('0x54')](config[_0x30ee('0x9d')][_0x4aa871])?_0x4aa871:'')})[_0x30ee('0x3e')](function(_0x2ba02e){return _0x2ba02e['content'][_0x30ee('0x9f')](_0x30ee('0xa0'))>=0x0;})[_0x30ee('0xa1')](myreject(_0x46aa46)));}Promise[_0x30ee('0xa4')](_0x5b2821)[_0x30ee('0x3e')](function(_0x560b5b){var _0x3809d5=_[_0x30ee('0xa5')](_0x560b5b);if(_0x3809d5){return _0x586410(_0x3809d5);}else{_0xc598f7[_0x30ee('0x6b')]=_0x5d7c03?utils[_0x30ee('0x6c')][_0x30ee('0xa6')]:utils[_0x30ee('0x6c')][_0x30ee('0xa7')];return _0x46aa46(msgResponse(_0x30ee('0xa8'),'Failure','Global:\x20'+_0x5d7c03+'\x20'+_0x4fd3c8+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x3e5717,{'showHidden':![],'depth':null})+_0x30ee('0xa9')+_0x4aa871));}})[_0x30ee('0xa1')](function(_0x281614){return _0x46aa46(msgResponse(_0x30ee('0x98'),_0x30ee('0x95'),JSON[_0x30ee('0x77')](_0x281614)));});});};Dialer[_0x30ee('0x18')][_0x30ee('0x3b')]=function(){var _0x2a71d3=this;return cmHopper[_0x30ee('0xaa')]({'active':![]},{'where':{'active':!![]}})[_0x30ee('0x3e')](function(){setInterval(function(){_0x2a71d3[_0x30ee('0xab')]();},0x3e8);});};Dialer[_0x30ee('0x18')]['syncCampaigns']=function(){var _0x5ee775=this;var _0x54ee6f;for(var _0x279446 in this[_0x30ee('0x1e')]){if(typeof this['campaigns'][_0x279446]!==_0x30ee('0xac')){_0x54ee6f=this[_0x30ee('0x1e')][_0x279446];if(utils[_0x30ee('0xad')](_0x54ee6f)&&utils[_0x30ee('0x7d')](_0x54ee6f)){_0x54ee6f[_0x30ee('0x82')]=!![];Promise['resolve']()[_0x30ee('0x3e')](checkIsIVRCampaignActive(_0x54ee6f))[_0x30ee('0x3e')](checkInterval(_0x54ee6f))['then'](_0x5ee775['checkIsTrunkReachable'](_0x54ee6f))['then'](_0x5ee775[_0x30ee('0x90')](_0x54ee6f[_0x30ee('0xae')],_0x54ee6f['dialTimezone'],_0x54ee6f[_0x30ee('0x62')],_0x54ee6f))['then'](_0x5ee775[_0x30ee('0x92')](_0x54ee6f[_0x30ee('0x79')],_0x54ee6f['dialTimezone'],_0x54ee6f[_0x30ee('0x62')],_0x54ee6f))[_0x30ee('0x3e')](_0x5ee775[_0x30ee('0xaf')](_0x54ee6f))[_0x30ee('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0x54ee6f));}else{notSendMessagesCampaign(_0x54ee6f);}}}};Dialer[_0x30ee('0x18')][_0x30ee('0xb0')]=function(_0x5b8ee5){if(_0x5b8ee5['dialMethod']!==_0x30ee('0xb1')){clearPredictiveAttributes(_0x5b8ee5);}switch(_0x5b8ee5[_0x30ee('0xb2')]){case'progressive':this[_0x30ee('0xb3')](_0x5b8ee5,0x1);break;case _0x30ee('0xb4'):this[_0x30ee('0xb3')](_0x5b8ee5,_0x5b8ee5[_0x30ee('0xb5')]);break;case _0x30ee('0xb1'):this[_0x30ee('0xb1')](_0x5b8ee5);break;case'booked':this[_0x30ee('0xb3')](_0x5b8ee5,0x1);break;default:logger['error'](_0x30ee('0xb6'),_0x5b8ee5[_0x30ee('0x62')],'method\x20not\x20recognized');}};Dialer[_0x30ee('0x18')][_0x30ee('0x98')]=function(_0x55809e,_0x4c31ec){var _0xcda868=_0x55809e[_0x30ee('0xb7')];var _0x320216=_0x4c31ec?_0x55809e[_0x30ee('0xae')]:_0x55809e[_0x30ee('0x79')][_0x30ee('0x7c')];logger[_0x30ee('0xb8')](_0x30ee('0xb9'),_0x320216,_0xcda868,_0x55809e[_0x30ee('0x62')],util[_0x30ee('0x7f')](_0x30ee('0xba'),_0x55809e[_0x30ee('0x62')],_0x55809e['id']));var _0x1d02ba=null;return Interval[_0x30ee('0xbb')](_0x320216,_0xcda868)[_0x30ee('0x3e')](function(_0x23a260){if(_0x23a260===!![]){return _0x23a260;}else{_0x55809e['message']=_0x4c31ec?utils['CAMPAIGN_STATUS'][_0x30ee('0xa6')]:utils[_0x30ee('0x6c')][_0x30ee('0xa7')];_0x1d02ba=msgResponse(_0x30ee('0xa8'),_0x30ee('0x95'),_0x30ee('0xbc')+_0x4c31ec+'\x20'+_0x55809e[_0x30ee('0x62')]+_0x30ee('0xbd')+util[_0x30ee('0x44')](_0x320216,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xcda868);}if(_0x1d02ba!==null){logger['silly'](_0x30ee('0xbe'),_0x1d02ba);_0x1d02ba['isGlobal']=_0x4c31ec;throw _0x1d02ba;}})['catch'](function(_0x48080e){logger[_0x30ee('0x67')](_0x30ee('0xbf'),_0x48080e);throw msgResponse(_0x30ee('0x87'),_0x30ee('0x88'),util[_0x30ee('0x44')](_0x48080e,{'showHidden':![],'depth':null}));});};Dialer[_0x30ee('0x18')][_0x30ee('0x2b')]=function(_0x4a7660){if(this[_0x30ee('0xc0')][_0x4a7660['queue']]){if(this['uniqueId'][_0x4a7660[_0x30ee('0xc1')]]&&this[_0x30ee('0x25')][_0x4a7660[_0x30ee('0xc1')]]['type']!=='ivr'){this['updateOriginated'](this[_0x30ee('0xc0')][_0x4a7660[_0x30ee('0xc2')]]);this[_0x30ee('0x25')][_0x4a7660['uniqueid']][_0x30ee('0xc3')]=moment()['format'](_0x30ee('0xc4'));}}};Dialer[_0x30ee('0x18')][_0x30ee('0x31')]=function(_0x2721b9){var _0x5e7ef8=this[_0x30ee('0x25')][_0x2721b9['uniqueid']];if(this[_0x30ee('0xc0')][_0x2721b9[_0x30ee('0xc2')]]){if(_0x5e7ef8&&_0x5e7ef8[_0x30ee('0x41')]!==_0x30ee('0xc5')){delete this[_0x30ee('0x25')][_0x2721b9[_0x30ee('0xc1')]];this['voiceQueues'][_0x2721b9[_0x30ee('0xc2')]][_0x30ee('0xc6')]+=0x1;var _0x13f6fe=new AgentComplete(_0x5e7ef8,_0x2721b9);if(_0x2721b9[_0x30ee('0xc7')]==='agent'){_0x13f6fe[_0x30ee('0xc8')]=this[_0x30ee('0xc0')][_0x2721b9[_0x30ee('0xc2')]][_0x30ee('0xc9')]&&this['voiceQueues'][_0x2721b9[_0x30ee('0xc2')]][_0x30ee('0xca')]?moment()[_0x30ee('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x30ee('0xcb')](_0x13f6fe)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x13f6fe)['catch'](loggerCatch(_0x30ee('0xcc')));}}};Dialer['prototype'][_0x30ee('0xcd')]=function(_0x352541){var _0x5bc8ad=this[_0x30ee('0x25')][_0x352541[_0x30ee('0xc1')]];var _0x4231da=this;var _0x5a6c64=![];var _0x5d6a92;var _0xdd9bbd;if(this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]]){if(_0x5bc8ad&&_0x5bc8ad[_0x30ee('0x41')]!==_0x30ee('0xc5')){delete this[_0x30ee('0x25')][_0x352541[_0x30ee('0xc1')]];this['updateOriginated'](this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]]);_0x5bc8ad[_0x30ee('0xce')]=moment()[_0x30ee('0x7f')](_0x30ee('0xc4'));var _0x41060d=new QueueCallerAbandon(_0x5bc8ad,_0x352541);if(utils['getSeconds'](_0x5bc8ad[_0x30ee('0xce')],_0x5bc8ad[_0x30ee('0xcf')])>=_0x5bc8ad['dialQueueTimeout']){this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]][_0x30ee('0x4f')]+=0x1;this['voiceQueues'][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xd0')]+=0x1;this['voiceQueues'][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xd1')]+=0x1;_0x41060d[_0x30ee('0xd2')]=0xa;_0x41060d[_0x30ee('0x72')]='Drop';_0x41060d['dropreason']=_0x30ee('0xd3');_0x41060d[_0x30ee('0xc8')]=this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xc9')]?moment()[_0x30ee('0x7f')](_0x30ee('0xc4')):undefined;_0x41060d[_0x30ee('0xd4')]+=0x1;_0x41060d[_0x30ee('0xd5')]+=0x1;_0x5d6a92=this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]]['dialDropRetryFrequency'];_0xdd9bbd=this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x30ee('0xd6')](_0x41060d,_0x41060d[_0x30ee('0xd2')],_0x5bc8ad[_0x30ee('0xd7')])['then'](function(_0xb932d9){_0x5a6c64=_0xb932d9[_0x30ee('0xd8')]==0x1;if(_0x41060d[_0x30ee('0xd4')]>=_0x4231da[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xd9')]){_0x4231da[_0x30ee('0xda')](_0x41060d,_0xb932d9[_0x30ee('0xd8')]);}else{hopperUtils[_0x30ee('0xdb')]({'active':![],'countdropretry':_0x41060d['countdropretry'],'scheduledat':moment()[_0x30ee('0xdc')](_0x4231da[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]]['dialDropRetryFrequency'],_0x30ee('0xdd'))['format'](_0x30ee('0xc4')),'ContactId':_0x5bc8ad[_0x30ee('0xde')],'ListId':_0x5bc8ad[_0x30ee('0xdf')],'VoiceQueueId':_0x5bc8ad[_0x30ee('0xe0')]||undefined,'CampaignId':_0x5bc8ad[_0x30ee('0xe1')]||undefined})['catch'](loggerCatch(_0x30ee('0xe2')));var _0x25fde9=new History(_0x41060d);_0x25fde9[_0x30ee('0xd2')]=0xa;_0x25fde9[_0x30ee('0x72')]=_0x30ee('0xe3');_0x25fde9[_0x30ee('0x74')]=moment()[_0x30ee('0x7f')](_0x30ee('0xc4'));_0x25fde9[_0x30ee('0x73')]=_0x25fde9[_0x30ee('0x74')];_0x25fde9['calleridname']=_0x41060d[_0x30ee('0xe4')];_0x25fde9[_0x30ee('0xe5')]=_0x41060d[_0x30ee('0xe5')];hopperUtils['createHistory'](_0x25fde9)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0xe6')));}})[_0x30ee('0x3e')](function(){if(_0x5a6c64)hopperUtils[_0x30ee('0xe7')](_0x41060d,_0x5d6a92,_0xdd9bbd)[_0x30ee('0x3e')](function(){return 0x1;});});}else{this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]][_0x30ee('0x51')]+=0x1;this['voiceQueues'][_0x352541[_0x30ee('0xc2')]]['outboundDropCallsDayCallersExit']+=0x1;_0x41060d[_0x30ee('0xd2')]=0xb;_0x41060d[_0x30ee('0x72')]=_0x30ee('0xe8');_0x41060d[_0x30ee('0xe9')]=_0x30ee('0xea');_0x41060d[_0x30ee('0xeb')]+=0x1;_0x41060d[_0x30ee('0xd5')]+=0x1;_0x5d6a92=this['voiceQueues'][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xec')];_0xdd9bbd=this[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xed')];hopperUtils[_0x30ee('0xd6')](_0x41060d,_0x41060d[_0x30ee('0xd2')],_0x5bc8ad[_0x30ee('0xd7')])[_0x30ee('0x3e')](function(_0xf99253){if(_0x41060d[_0x30ee('0xeb')]>=_0x4231da[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xee')]){_0x4231da[_0x30ee('0xda')](_0x41060d,_0xf99253[_0x30ee('0xd8')]);}else{hopperUtils[_0x30ee('0xdb')]({'active':![],'countabandonedretry':_0x41060d['countabandonedretry'],'scheduledat':moment()['add'](_0x4231da[_0x30ee('0xc0')][_0x352541[_0x30ee('0xc2')]][_0x30ee('0xec')],_0x30ee('0xdd'))[_0x30ee('0x7f')](_0x30ee('0xc4')),'ContactId':_0x5bc8ad['ContactId'],'ListId':_0x5bc8ad['ListId'],'VoiceQueueId':_0x5bc8ad['VoiceQueueId']||undefined,'CampaignId':_0x5bc8ad['CampaignId']||undefined})[_0x30ee('0xa1')](loggerCatch(_0x30ee('0xef')));var _0x51da23=new History(_0x41060d);_0x51da23['state']=0xb;_0x51da23[_0x30ee('0x72')]=_0x30ee('0xe8');_0x51da23[_0x30ee('0x74')]=moment()['format'](_0x30ee('0xc4'));_0x51da23[_0x30ee('0x73')]=_0x51da23[_0x30ee('0x74')];_0x51da23[_0x30ee('0xe4')]=_0x41060d[_0x30ee('0xe4')];_0x51da23['calleridnum']=_0x41060d['calleridnum'];hopperUtils[_0x30ee('0xcb')](_0x51da23)['catch'](loggerCatch(_0x30ee('0xf0')));}})[_0x30ee('0x3e')](function(){if(_0x5a6c64)hopperUtils['swapAdditionalPhones'](_0x41060d,_0x5d6a92,_0xdd9bbd)[_0x30ee('0x3e')](function(){return 0x1;});});}}}};Dialer[_0x30ee('0x18')][_0x30ee('0x37')]=function(_0xfff634){if(this[_0x30ee('0x23')][_0xfff634['uniqueid']]){this['actions'][_0xfff634[_0x30ee('0xc1')]][_0x30ee('0xf1')]=_0xfff634[_0x30ee('0xf1')];}if(this[_0x30ee('0x25')][_0xfff634[_0x30ee('0xc1')]]){this['uniqueId'][_0xfff634[_0x30ee('0xc1')]][_0x30ee('0xf1')]=_0xfff634[_0x30ee('0xf1')];}};Dialer[_0x30ee('0x18')][_0x30ee('0x39')]=function(_0x2202cf){if(!this['actions'][_0x2202cf[_0x30ee('0xf2')]]){return;}var _0x5e50b6=this['voiceQueues'][this[_0x30ee('0x23')][_0x2202cf['actionid']][_0x30ee('0xc2')]][_0x30ee('0xf3')]||'rrmemory';if(_0x5e50b6===_0x30ee('0xf4')){if(this[_0x30ee('0x23')][_0x2202cf['actionid']]&&_['isNil'](this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]][_0x30ee('0xf5')])&&_0x2202cf[_0x30ee('0x8c')]==='1'&&_0x2202cf[_0x30ee('0xf6')]==='0'){if(this[_0x30ee('0x1f')][_0x2202cf[_0x30ee('0xf7')]]){if(!this[_0x30ee('0x1f')][_0x2202cf[_0x30ee('0xf7')]][_0x30ee('0xf5')]){this[_0x30ee('0x1f')][_0x2202cf[_0x30ee('0xf7')]][_0x30ee('0xf5')]=!![];this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]][_0x30ee('0xf5')]=!![];this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]]['stateinterface']=_0x2202cf['stateinterface'];}}}}else if(_0x5e50b6==='rrmemory'){if(this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]]){if(this['agents'][_0x2202cf['stateinterface']]){this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]]['stateinterface']=_0x2202cf[_0x30ee('0xf7')];if(_[_0x30ee('0xf8')](this['queueBooked'][this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]][_0x30ee('0xc2')]])){this[_0x30ee('0xf9')][this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]]['queue']]=[];}this['queueBooked'][this[_0x30ee('0x23')][_0x2202cf['actionid']][_0x30ee('0xc2')]][_0x30ee('0xa2')](_[_0x30ee('0xfa')](_[_0x30ee('0x78')](this[_0x30ee('0x23')][_0x2202cf[_0x30ee('0xf2')]],[_0x30ee('0xfb'),'stateinterface']),{'status':_0x2202cf[_0x30ee('0x8c')],'paused':_0x2202cf[_0x30ee('0xf6')]}));}}}};Dialer[_0x30ee('0x18')][_0x30ee('0xfc')]=function(_0x4b682d){if(!this['actions'][_0x4b682d[_0x30ee('0xf2')]]){return;}var _0x59ba0d=this;var _0x45c42c=this[_0x30ee('0xc0')][this['actions'][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xc2')]];var _0x459613=_0x45c42c[_0x30ee('0xf3')]||_0x30ee('0xfd');if(_0x459613===_0x30ee('0xf4')){if(this[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]]&&this[_0x30ee('0x23')][_0x4b682d['actionid']][_0x30ee('0xf7')]){this[_0x30ee('0x1d')][_0x30ee('0xfe')](this[_0x30ee('0x23')][_0x4b682d['actionid']][_0x30ee('0xfb')],this['actions'][_0x4b682d[_0x30ee('0xf2')]]['stateinterface'])[_0x30ee('0xa1')](function(_0x70116d){logger[_0x30ee('0x67')](_0x30ee('0xff'),util[_0x30ee('0x44')](_0x70116d,{'showHidden':![],'depth':null}));})[_0x30ee('0x1b')](function(){_0x59ba0d['updateOriginated'](_0x59ba0d[_0x30ee('0xc0')][_0x59ba0d['actions'][_0x4b682d[_0x30ee('0xf2')]]['queue']]);_0x59ba0d['agents'][_0x59ba0d[_0x30ee('0x23')][_0x4b682d['actionid']]['stateinterface']][_0x30ee('0xf5')]=![];delete _0x59ba0d[_0x30ee('0x23')][_0x4b682d['actionid']];unlockQueueStatus(_0x45c42c);});}else{this[_0x30ee('0x100')](this[_0x30ee('0xc0')][this[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xc2')]]);hopperUtils[_0x30ee('0xdb')]({'active':![],'ContactId':this[_0x30ee('0x23')][_0x4b682d['actionid']][_0x30ee('0xde')],'ListId':this['actions'][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xdf')],'VoiceQueueId':this[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xe1')]||undefined})[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x101')));delete this['actions'][_0x4b682d['actionid']];unlockQueueStatus(_0x45c42c);}}else if(_0x459613===_0x30ee('0xfd')){var _0x40f309;if(this[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]]&&!_[_0x30ee('0x47')](this[_0x30ee('0xf9')][this[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xc2')]])){if(this[_0x30ee('0x102')][_0x59ba0d[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xc2')]]){this[_0x30ee('0x102')][_0x59ba0d[_0x30ee('0x23')][_0x4b682d['actionid']]['queue']]=this[_0x30ee('0x102')][this[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]]['queue']]?this[_0x30ee('0x102')][this['actions'][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xc2')]]:this['queueBooked'][this[_0x30ee('0x23')][_0x4b682d[_0x30ee('0xf2')]][_0x30ee('0xc2')]]?this[_0x30ee('0xf9')][this[_0x30ee('0x23')][_0x4b682d['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0x30ee('0xf9')][this['actions'][_0x4b682d['actionid']][_0x30ee('0xc2')]][_0x30ee('0x103')]=this[_0x30ee('0x102')][this[_0x30ee('0x23')][_0x4b682d['actionid']]['queue']];for(var _0x427d56=0x0;_0x427d56=_0x476f34[_0x30ee('0x128')]){_0x376892[_0x30ee('0x129')](_0x5f0442,_0xe51313,_0x3db422,'reason19\x20machine....');}else{if(_0x5f0442['countmachineretry']>=_0x476f34[_0x30ee('0x12a')]){_0x376892['createStateFinal'](_0x5f0442,_0xe51313,_0x3db422,_0x30ee('0x12b'));}else{hopperUtils[_0x30ee('0xdb')]({'active':![],'countmachineretry':_0x5f0442[_0x30ee('0x124')],'scheduledat':moment()['add'](_0x476f34['dialMachineRetryFrequency'],'minutes')[_0x30ee('0x7f')](_0x30ee('0xc4')),'ContactId':_0x5f0442[_0x30ee('0xde')],'ListId':_0x5f0442[_0x30ee('0xdf')],'VoiceQueueId':_0x5f0442[_0x30ee('0xe0')]||undefined,'CampaignId':_0x5f0442['CampaignId']||undefined})['catch'](loggerCatch(_0x30ee('0x12c')));_0xe51313({'reschedule':0x1});}}});}if(_0x3c0d21[_0x30ee('0x41')]==='ivr'&&this[_0x30ee('0x1e')][_0x3c0d21['queue']][_0x30ee('0x122')]&&_0x5b1958[_0x30ee('0x117')]===_0x30ee('0x118')){delete this[_0x30ee('0x25')][_0x5b1958['uniqueid']];this['updateOriginated'](this['campaigns'][_0x3c0d21[_0x30ee('0xc2')]]);_0x157931=new Hangup(_0x3c0d21,_0x5b1958);_0x157931[_0x30ee('0xd2')]=0x12;_0x157931[_0x30ee('0x72')]='HangupInAMD';_0x157931['membername']=_0x30ee('0x11c');ami[_0x30ee('0x40')](_0x30ee('0x12d'),ut[_0x30ee('0x11d')](_0x157931,_0x30ee('0x11e')));this[_0x30ee('0x11f')](_0x157931,_0x30ee('0x12e'),'[syncHangupInAMDIvr]');}if(_0x3c0d21[_0x30ee('0x41')]==='ivr'&&this['campaigns'][_0x3c0d21[_0x30ee('0xc2')]][_0x30ee('0x122')]&&_0x5b1958['value']===_0x30ee('0x12f')){return new Promise(function(_0x14e931,_0x46c470){delete _0x376892[_0x30ee('0x25')][_0x5b1958['uniqueid']];_0x376892[_0x30ee('0x100')](_0x376892[_0x30ee('0x1e')][_0x3c0d21[_0x30ee('0xc2')]]);_0x376892[_0x30ee('0x1e')][_0x3c0d21[_0x30ee('0xc2')]][_0x30ee('0xc6')]+=0x1;_0x376892[_0x30ee('0x1e')][_0x3c0d21[_0x30ee('0xc2')]][_0x30ee('0x119')]+=0x1;var _0x5ef412=_0x376892[_0x30ee('0x1e')][_0x3c0d21[_0x30ee('0xc2')]];var _0x3e694c=new Hangup(_0x3c0d21,_0x5b1958);_0x3e694c[_0x30ee('0xd2')]=0x13;_0x3e694c[_0x30ee('0x72')]=_0x30ee('0x123');_0x3e694c[_0x30ee('0x11b')]='AMD';_0x3e694c[_0x30ee('0x124')]+=0x1;_0x3e694c[_0x30ee('0xd5')]+=0x1;_0x3e694c[_0x30ee('0x11e')]=!![];ami[_0x30ee('0x40')](_0x30ee('0x12d'),ut['buildObj'](_0x3e694c,'amd'));hopperUtils[_0x30ee('0xcb')](_0x3e694c)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x130')));if(_0x3e694c[_0x30ee('0x131')]+_0x3e694c[_0x30ee('0x125')]+_0x3e694c['countnoanswerretry']+_0x3e694c['countnosuchnumberretry']+_0x3e694c[_0x30ee('0xd4')]+_0x3e694c[_0x30ee('0xeb')]+_0x3e694c[_0x30ee('0x124')]+_0x3e694c[_0x30ee('0x127')]>=_0x5ef412['dialGlobalMaxRetry']){_0x376892[_0x30ee('0x129')](_0x3e694c,_0x14e931,_0x46c470,_0x30ee('0x132'));}else{if(_0x3e694c[_0x30ee('0x124')]>=_0x5ef412[_0x30ee('0x12a')]){_0x376892[_0x30ee('0x133')](_0x3e694c,_0x14e931,_0x46c470,_0x30ee('0x12b'));}else{hopperUtils[_0x30ee('0xdb')]({'active':![],'countmachineretry':_0x3e694c[_0x30ee('0x124')],'scheduledat':moment()[_0x30ee('0xdc')](_0x5ef412['dialMachineRetryFrequency'],_0x30ee('0xdd'))[_0x30ee('0x7f')](_0x30ee('0xc4')),'ContactId':_0x3e694c['ContactId'],'ListId':_0x3e694c[_0x30ee('0xdf')],'VoiceQueueId':_0x3e694c[_0x30ee('0xe0')]||undefined,'CampaignId':_0x3e694c[_0x30ee('0xe1')]||undefined})[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x12c')));_0x14e931({'reschedule':0x1});}}});}}};Dialer[_0x30ee('0x18')][_0x30ee('0x35')]=function(_0x256ee8){var _0x2a5e50=this[_0x30ee('0x25')][_0x256ee8['uniqueid']];var _0xf37ab7;if(_0x2a5e50&&_0x2a5e50[_0x30ee('0x41')]===_0x30ee('0xc5')){delete this[_0x30ee('0x25')][_0x256ee8['uniqueid']];this['updateOriginated'](this[_0x30ee('0x1e')][_0x2a5e50[_0x30ee('0xc2')]]);this[_0x30ee('0x1e')][_0x2a5e50[_0x30ee('0xc2')]][_0x30ee('0x134')]+=0x1;_0xf37ab7=new Hangup(_0x2a5e50,_0x256ee8);hopperUtils[_0x30ee('0xcb')](_0xf37ab7)[_0x30ee('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0xf37ab7)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x135')));}if(_0x2a5e50&&_0x2a5e50[_0x30ee('0x41')]!==_0x30ee('0xc5')&&isNotNull(this[_0x30ee('0xc0')][_0x2a5e50[_0x30ee('0xc2')]][_0x30ee('0x136')])){delete this[_0x30ee('0x25')][_0x256ee8[_0x30ee('0xc1')]];this[_0x30ee('0x100')](this[_0x30ee('0xc0')][_0x2a5e50[_0x30ee('0xc2')]]);this['voiceQueues'][_0x2a5e50[_0x30ee('0xc2')]][_0x30ee('0xc6')]+=0x1;this[_0x30ee('0xc0')][_0x2a5e50['queue']][_0x30ee('0x119')]+=0x1;_0xf37ab7=new Hangup(_0x2a5e50,_0x256ee8);_0xf37ab7[_0x30ee('0xd2')]=0x10;_0xf37ab7[_0x30ee('0x72')]=_0x30ee('0x137');_0xf37ab7[_0x30ee('0x11b')]=_0x30ee('0x138');hopperUtils[_0x30ee('0xcb')](_0xf37ab7)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x139')));hopperUtils[_0x30ee('0x13a')](_0xf37ab7)[_0x30ee('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x2a5e50&&_0x2a5e50[_0x30ee('0x41')]!==_0x30ee('0xc5')&&!isNotNull(this[_0x30ee('0xc0')][_0x2a5e50['queue']][_0x30ee('0x136')])){if(_0x256ee8[_0x30ee('0x13b')]==='Normal\x20Clearing'){delete this[_0x30ee('0x25')][_0x256ee8[_0x30ee('0xc1')]];this['voiceQueues'][_0x2a5e50[_0x30ee('0xc2')]][_0x30ee('0xc6')]+=0x1;const _0x3a2f95=new AgentComplete(_0x2a5e50,_0x256ee8);_0x3a2f95[_0x30ee('0xe1')]=this[_0x30ee('0xc0')][_0x2a5e50['queue']]['id'];hopperUtils['createHistory'](_0x3a2f95)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x30ee('0x13a')](_0x3a2f95)['catch'](loggerCatch(_0x30ee('0xcc')));}else{delete this[_0x30ee('0x25')][_0x256ee8['uniqueid']];this[_0x30ee('0x100')](this[_0x30ee('0xc0')][_0x2a5e50[_0x30ee('0xc2')]]);this[_0x30ee('0xc0')][_0x2a5e50[_0x30ee('0xc2')]]['outboundUnknownCallsDay']+=0x1;_0xf37ab7=new Hangup(_0x2a5e50,_0x256ee8);_0xf37ab7[_0x30ee('0xd2')]=0xc;_0xf37ab7[_0x30ee('0x72')]=_0x256ee8[_0x30ee('0x13b')];_0xf37ab7[_0x30ee('0x11b')]='Unknow';hopperUtils[_0x30ee('0xcb')](_0xf37ab7)['catch'](loggerCatch(_0x30ee('0x139')));hopperUtils[_0x30ee('0x13a')](_0xf37ab7)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x135')));}}};Dialer[_0x30ee('0x18')]['syncQueueSummary']=function(_0x2a4744){var _0x36e7ad=this;if(!_0x36e7ad[_0x30ee('0x29')][_0x2a4744['name']]){_0x36e7ad[_0x30ee('0x29')][_0x2a4744[_0x30ee('0x62')]]={'running':![]};}else if(_0x36e7ad[_0x30ee('0x29')][_0x2a4744[_0x30ee('0x62')]][_0x30ee('0x13c')]===!![]){return;}else if(_0x36e7ad[_0x30ee('0x29')][_0x2a4744[_0x30ee('0x62')]][_0x30ee('0x13c')]===![]){_0x36e7ad['queuesSummary'][_0x2a4744['name']]['running']=!![];}var _0x5d192f=_0x36e7ad[_0x30ee('0xc0')][_0x2a4744[_0x30ee('0x62')]];var _0x2039cd=_0x5d192f[_0x30ee('0x6b')]!==utils[_0x30ee('0x6c')][_0x30ee('0x7e')];var _0x5ae6af=utils[_0x30ee('0x13d')](_0x5d192f);_0x5d192f[_0x30ee('0x13e')]=utils[_0x30ee('0x13f')](_0x5d192f,_0x36e7ad[_0x30ee('0x20')]);Promise[_0x30ee('0x140')]()[_0x30ee('0x3e')](function(){if(_0x5d192f[_0x30ee('0x13e')]===utils[_0x30ee('0x6c')][_0x30ee('0x7e')]){if(_0x2039cd){clearPredictiveAttributes(_0x5d192f);_0x2a4744[_0x30ee('0x26')]=undefined;_0x2a4744[_0x30ee('0x27')]=undefined;}if(_0x5d192f[_0x30ee('0x13e')]===utils[_0x30ee('0x6c')][_0x30ee('0x7e')]){_0x2a4744['available']=0x0;_0x2a4744[_0x30ee('0xf6')]=0x0;_0x2a4744['inUse']=0x0;_0x2a4744['talking']=0x0;_0x2a4744['pTalking']=0x0;}}else if(_0x5d192f[_0x30ee('0x13e')]===utils[_0x30ee('0x6c')][_0x30ee('0x141')]&&!_0x5ae6af){return _0x36e7ad['ifTime'](_0x5d192f,!![])[_0x30ee('0x3e')](function(){return _0x36e7ad[_0x30ee('0x98')](_0x5d192f,![]);})[_0x30ee('0x3e')](function(){return _0x36e7ad['checkDialMethod'](_0x5d192f);})[_0x30ee('0xa1')](function(_0xc0b151){loggerSyncQueueSummary[_0x30ee('0x43')](_0x30ee('0x142'),util['inspect'](_0xc0b151,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5d192f);});}else{clearPredictiveAttributes(_0x5d192f);}})[_0x30ee('0x3e')](function(){var _0x577502=_0x2a4744[_0x30ee('0x143')](_0x5d192f);if(_0x577502||_0x5d192f[_0x30ee('0x144')]){_0x5d192f[_0x30ee('0x144')]=![];_0x2a4744[_0x30ee('0x145')](_0x5d192f);Object[_0x30ee('0x146')](_0x5d192f,_0x2a4744);emitOutboundVoiceQueueSummary(_0x2a4744);}_0x36e7ad[_0x30ee('0x29')][_0x5d192f['name']][_0x30ee('0x13c')]=![];})[_0x30ee('0xa1')](function(_0x3ab356){logger['error']('[syncQueueSummary]',util[_0x30ee('0x44')](_0x3ab356,{'showHidden':![],'depth':null}));_0x36e7ad[_0x30ee('0x29')][_0x5d192f[_0x30ee('0x62')]][_0x30ee('0x13c')]=![];});};Dialer[_0x30ee('0x18')][_0x30ee('0x33')]=_['throttle'](function(){var _0x3f50c1=_['filter'](this[_0x30ee('0xc0')],function(_0x4d5ac0){return _0x4d5ac0[_0x30ee('0x147')];});var _0x5bb217=_[_0x30ee('0x148')](this[_0x30ee('0x1f')],function(_0x570947){return _0x570947[_0x30ee('0x149')]&&_0x570947[_0x30ee('0x8c')]===_0x30ee('0x14a');});if(_0x3f50c1[_0x30ee('0x104')]>0x0&&_0x5bb217[_0x30ee('0x104')]>0x0){return Promise[_0x30ee('0x140')]()[_0x30ee('0x3e')](cmHopper[_0x30ee('0x14b')](_[_0x30ee('0x14c')](_0x3f50c1,'id'),previewRecallmeReminderInterval,_['map'](_0x5bb217,'id')))[_0x30ee('0x3e')](function(_0x5cd223){for(var _0x1b271b=0x0;_0x1b271b<_0x5cd223[_0x30ee('0x104')];_0x1b271b++){var _0x104c86=_0x5cd223[_0x1b271b][_0x30ee('0x14d')][_0x30ee('0x62')];if(_0x104c86)io['to'](util[_0x30ee('0x7f')]('user:%s',_0x104c86))['emit'](_0x30ee('0x14e'),{'hopper':_0x5cd223[_0x1b271b]});}})[_0x30ee('0xa1')](function(_0x344717){logger[_0x30ee('0x67')](_0x30ee('0x14f'),_0x344717);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x30ee('0x18')][_0x30ee('0x3c')]=function(){var _0x25d8fd=this;setInterval(function(){_0x25d8fd[_0x30ee('0x150')](_0x25d8fd['uniqueId'],'[uniqueid]');_0x25d8fd['clearZombieChannels'](_0x25d8fd['actions'],_0x30ee('0x151'));},0x32c8);};Dialer['prototype'][_0x30ee('0x150')]=function(_0x1bdc46,_0x51c04a){var _0x1e7e6b=this;for(var _0x150f51 in _0x1bdc46){if(typeof _0x1bdc46[_0x150f51]!=='undefined'){this[_0x30ee('0x1c')][_0x30ee('0x19')](function(){if(!_[_0x30ee('0xf8')](_0x1bdc46[_0x150f51])){return ami[_0x30ee('0xa3')]({'action':_0x30ee('0x8c'),'channel':_0x1bdc46[_0x150f51]['channel']})[_0x30ee('0xa1')](function(_0x31db82){if(_0x31db82[_0x30ee('0x6b')]===_0x30ee('0x152')){setTimeout(function(){if(_0x1bdc46[_0x150f51]&&_0x1bdc46[_0x150f51][_0x30ee('0x41')]!=='ivr'){_0x1e7e6b[_0x30ee('0x100')](_0x1e7e6b[_0x30ee('0xc0')][_0x1bdc46[_0x150f51][_0x30ee('0xc2')]]);logger[_0x30ee('0x67')](_0x30ee('0x153'),_0x51c04a,_0x150f51,_0x1bdc46[_0x150f51][_0x30ee('0xc2')]);delete _0x1bdc46[_0x150f51];}if(_0x1bdc46[_0x150f51]&&_0x1bdc46[_0x150f51][_0x30ee('0x41')]===_0x30ee('0xc5')){_0x1e7e6b[_0x30ee('0x100')](_0x1e7e6b['campaigns'][_0x1bdc46[_0x150f51][_0x30ee('0xc2')]]);logger[_0x30ee('0x67')](_0x30ee('0x154'),_0x51c04a,_0x150f51,_0x1bdc46[_0x150f51][_0x30ee('0xc2')]);delete _0x1bdc46[_0x150f51];}},0x2328);}});}});}}};Dialer[_0x30ee('0x18')][_0x30ee('0x155')]=function(_0x544141){return Promise['resolve']()[_0x30ee('0x3e')](voiceQueueRt[_0x30ee('0x155')](_0x544141))[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x156')));};Dialer[_0x30ee('0x18')][_0x30ee('0x100')]=function(_0x3d9b96){if(!_['isUndefined'](_0x3d9b96)&&_0x3d9b96!==null){if(typeof _0x3d9b96[_0x30ee('0x157')]!==_0x30ee('0xac')){if(_0x3d9b96[_0x30ee('0x157')]>0x0){_0x3d9b96[_0x30ee('0x157')]-=0x1;}else{logger[_0x30ee('0x67')](_0x30ee('0x158'));}}}else{logger[_0x30ee('0x67')](_0x30ee('0x159'));}};Dialer[_0x30ee('0x18')]['loggerHandler']=function(_0x7297b5,_0x2cd384){var _0x352c45=this;return function(_0x31394c){_0x352c45[_0x30ee('0x100')](_0x2cd384);logger[_0x30ee('0x67')](_0x7297b5,util[_0x30ee('0x44')](_0x31394c,{'showHidden':![],'depth':null}));};};Dialer[_0x30ee('0x18')][_0x30ee('0x15a')]=function(_0x159628,_0x711e7c,_0x40f15b){var _0x35a0f5={'state':0x19,'statedesc':_0x30ee('0x15b')};this[_0x30ee('0x100')](_0x711e7c);this['saveInDb'](_[_0x30ee('0xfa')](_0x35a0f5,_['pick'](_0x40f15b,[_0x30ee('0xde'),_0x30ee('0xdf'),'UserId',_0x30ee('0xe0'),'CampaignId'])),_0x30ee('0x15c'),'[emptyContact]');logger[_0x30ee('0x67')](_0x159628);};Dialer[_0x30ee('0x18')]['saveInDb']=function(_0x186fb7,_0x364de8,_0x2bde6c){hopperUtils[_0x30ee('0xcb')](_0x186fb7)[_0x30ee('0xa1')](loggerCatch(_0x364de8));hopperUtils[_0x30ee('0x13a')](_0x186fb7)['catch'](loggerCatch(_0x2bde6c));};Dialer['prototype'][_0x30ee('0xda')]=function(_0x2b4ea2,_0x293651){hopperUtils[_0x30ee('0xcb')](_0x2b4ea2)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x15d')));if(_0x293651==0x0){hopperUtils[_0x30ee('0x13a')](_0x2b4ea2)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x15e')));}};Dialer[_0x30ee('0x18')][_0x30ee('0x14f')]=function(_0x4a33cb){return Promise[_0x30ee('0x140')]()[_0x30ee('0x3e')](cmHopper[_0x30ee('0x14b')](_0x4a33cb['id'],previewRecallmeReminderInterval))[_0x30ee('0x3e')](function(_0x19b879){for(var _0x224d81=0x0;_0x224d81<_0x19b879[_0x30ee('0x104')];_0x224d81++){var _0x3e482d=_0x19b879[_0x224d81]['Agent'][_0x30ee('0x62')];if(_0x3e482d)io['to'](util[_0x30ee('0x7f')](_0x30ee('0x15f'),_0x3e482d))[_0x30ee('0x40')]('user:dialPreviewRecallReminder',{'hopper':_0x19b879[_0x224d81]});}})[_0x30ee('0xa1')](function(){});};Dialer[_0x30ee('0x18')][_0x30ee('0xaf')]=function(_0x10bde4){var _0x3c7594=this;return function(){_0x3c7594[_0x30ee('0x160')](_0x10bde4);};};Dialer['prototype'][_0x30ee('0x161')]=function(_0x39e1f1,_0x2920c5){var _0x3f37b2=this;var _0x3454c4=uuid['v4']();this[_0x30ee('0x23')][_0x3454c4]=new Action(_0x39e1f1,_0x2920c5,_0x3454c4);return new Promise(function(_0x12c248,_0x3aa04f){if(_[_0x30ee('0x54')](_0x39e1f1)&&typeof _0x39e1f1!==_0x30ee('0x162')){return _0x3aa04f(msgResponse(_0x30ee('0x163'),_0x30ee('0x95'),_0x30ee('0x164')));}if(_['isUndefined'](_0x2920c5[_0x30ee('0x165')])||_0x2920c5['phone']===null){return _0x3aa04f(msgResponse(_0x30ee('0x163'),'Failure','contact\x20is\x20undefine'));}var _0x2d6b5c={'XMD-CALLERID':_0x3f37b2['actions'][_0x3454c4][_0x30ee('0x166')](),'XMD-AGI':_0x39e1f1[_0x30ee('0x136')]?util[_0x30ee('0x7f')](_0x30ee('0x167'),ipAgi,_0x39e1f1['dialQueueProject']):_0x30ee('0x168'),'XMD-AGIAFTER':_0x39e1f1[_0x30ee('0xc9')]?util[_0x30ee('0x7f')](_0x30ee('0x167'),ipAgi,_0x39e1f1[_0x30ee('0xc9')]):_0x30ee('0x168'),'XMD-QUEUE':utils['isOutboundQueue'](_0x39e1f1)?util[_0x30ee('0x7f')](_0x30ee('0x169'),_0x39e1f1[_0x30ee('0x62')],_0x39e1f1[_0x30ee('0x16a')]||'',_0x39e1f1[_0x30ee('0xca')]?'c':'',_0x39e1f1['dialQueueTimeout']||0x3):_0x30ee('0x168'),'XMD-CONTACTID':_0x2920c5[_0x30ee('0xde')],'XMD-CDRTYPE':_0x30ee('0x6'),'CALLERID(all)':_0x3f37b2[_0x30ee('0x23')][_0x3454c4][_0x30ee('0x166')](),'XMD-AMD':_0x39e1f1[_0x30ee('0x122')]?_0x30ee('0x141'):_0x30ee('0x168'),'XMD-DESTINATION':_0x30ee('0x116')};if(_0x39e1f1[_0x30ee('0x122')]){_0x2d6b5c['XMD-AMDINITIALSILENCE']=_0x39e1f1[_0x30ee('0x16b')]||0x9c4;_0x2d6b5c[_0x30ee('0x16c')]=_0x39e1f1[_0x30ee('0x16d')]||0x5dc;_0x2d6b5c[_0x30ee('0x16e')]=_0x39e1f1['dialAMDAfterGreetingSilence']||0x320;_0x2d6b5c[_0x30ee('0x16f')]=_0x39e1f1[_0x30ee('0x170')]||0x1388;_0x2d6b5c['XMD-AMDMINWORDLENGTH']=_0x39e1f1['dialAMDMinWordLength']||0x64;_0x2d6b5c[_0x30ee('0x171')]=_0x39e1f1[_0x30ee('0x172')]||0x32;_0x2d6b5c[_0x30ee('0x173')]=_0x39e1f1[_0x30ee('0x174')]||0x3;_0x2d6b5c[_0x30ee('0x175')]=_0x39e1f1['dialAMDSilenceThreshold']||0x100;_0x2d6b5c[_0x30ee('0x176')]=_0x39e1f1[_0x30ee('0x177')]||0x1388;}if(utils[_0x30ee('0x178')](_0x39e1f1)){_0x2d6b5c[_0x30ee('0x179')]=_0x2920c5[_0x30ee('0xe0')];}else{_0x2d6b5c[_0x30ee('0x17a')]=_0x2920c5[_0x30ee('0xe1')];}var _0x219785=utils['setXMDContactVariables'](_0x2920c5[_0x30ee('0x17b')]);Object[_0x30ee('0x146')](_0x2d6b5c,_0x219785);var _0x50a49a=_0x3f37b2[_0x30ee('0x89')](_0x39e1f1[_0x30ee('0x17c')])?utils[_0x30ee('0x17d')](_0x39e1f1[_0x30ee('0x17c')][_0x30ee('0x17e')],_0x39e1f1[_0x30ee('0x17f')],_0x39e1f1['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x30ee('0x180')](_0x39e1f1[_0x30ee('0x181')],_0x39e1f1[_0x30ee('0x182')]):_0x39e1f1[_0x30ee('0x181')]):utils[_0x30ee('0x17d')](_['isNil'](_0x39e1f1[_0x30ee('0x8d')])?_0x39e1f1[_0x30ee('0x17c')][_0x30ee('0x17e')]:_0x39e1f1[_0x30ee('0x8d')][_0x30ee('0x17e')],_0x39e1f1[_0x30ee('0x17f')],_0x39e1f1[_0x30ee('0x182')]>0x0?utils[_0x30ee('0x180')](_0x39e1f1[_0x30ee('0x181')],_0x39e1f1[_0x30ee('0x182')]):_0x39e1f1[_0x30ee('0x181')]);if(_0x50a49a){_0x2d6b5c[_0x30ee('0x183')]=_0x3f37b2[_0x30ee('0x23')][_0x3454c4][_0x30ee('0x184')]=utils[_0x30ee('0x185')](_0x50a49a);_0x2d6b5c[_0x30ee('0x186')]=_0x2920c5[_0x30ee('0x165')];}_0x39e1f1[_0x30ee('0x187')]=_0x2d6b5c;return ami[_0x30ee('0xa3')]({'actionid':_0x3454c4,'action':'originate','channel':_0x3f37b2['isTrunkReachable'](_0x39e1f1[_0x30ee('0x17c')])?util['format'](_0x30ee('0x188'),_0x39e1f1[_0x30ee('0x17c')][_0x30ee('0x62')],isNotNull(_0x39e1f1[_0x30ee('0x189')])?_0x39e1f1[_0x30ee('0x189')][_0x30ee('0x18a')]()||'':'',_0x39e1f1[_0x30ee('0x18b')]>0x0?_0x2920c5[_0x30ee('0x165')]['substring'](_0x39e1f1[_0x30ee('0x18b')]):_0x2920c5[_0x30ee('0x165')]):util[_0x30ee('0x7f')](_0x30ee('0x188'),_[_0x30ee('0xf8')](_0x39e1f1[_0x30ee('0x8d')])?_0x39e1f1[_0x30ee('0x17c')][_0x30ee('0x62')]:_0x39e1f1['TrunkBackup'][_0x30ee('0x62')],isNotNull(_0x39e1f1[_0x30ee('0x189')])?_0x39e1f1['dialPrefix'][_0x30ee('0x18a')]()||'':'',_0x39e1f1['dialCutDigit']>0x0?_0x2920c5[_0x30ee('0x165')][_0x30ee('0x18c')](_0x39e1f1[_0x30ee('0x18b')]):_0x2920c5[_0x30ee('0x165')]),'callerid':_0x50a49a,'Exten':_0x30ee('0x116'),'Context':_0x30ee('0x18d'),'Priority':'1','variable':_0x2d6b5c,'timeout':(_0x39e1f1[_0x30ee('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3454c4})[_0x30ee('0x3e')](function(_0x2ff005){return _0x12c248(_0x2ff005);})[_0x30ee('0xa1')](function(_0xb023dd){_0x39e1f1['outboundOriginateFailureCallsDay']+=0x1;var _0x14f2bc=new History(_0x3f37b2[_0x30ee('0x23')][_0x3454c4]);logger[_0x30ee('0x67')](util['format']('[originateError]:\x20%s',JSON[_0x30ee('0x77')](_0xb023dd)));_0x14f2bc[_0x30ee('0xd2')]=0xe;_0x14f2bc[_0x30ee('0x72')]=_0x30ee('0x18f');_0x14f2bc[_0x30ee('0x74')]=moment()[_0x30ee('0x7f')](_0x30ee('0xc4'));_0x14f2bc[_0x30ee('0x73')]=_0x14f2bc[_0x30ee('0x74')];hopperUtils[_0x30ee('0xcb')](_0x14f2bc)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x190')));_0x3f37b2[_0x30ee('0x13a')](_0x14f2bc)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x190')))[_0x30ee('0x1b')](function(){delete _0x3f37b2[_0x30ee('0x23')][_0x3454c4];return _0x3aa04f(msgResponse(_0x30ee('0x163'),_0x30ee('0x88'),'originate\x20action\x20Error'));});});});};Dialer[_0x30ee('0x18')][_0x30ee('0x191')]=function(_0x1dbdfc,_0x108edf,_0x45b4de){var _0x513b22=new History(_0x108edf);if(_0x513b22[_0x30ee('0x131')]+_0x513b22['countcongestionretry']+_0x513b22[_0x30ee('0x126')]+_0x513b22[_0x30ee('0x192')]+_0x513b22[_0x30ee('0xd4')]+_0x513b22[_0x30ee('0xeb')]+_0x513b22[_0x30ee('0x124')]+_0x513b22[_0x30ee('0x127')]>=_0x45b4de['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1dbdfc){case 0x3:if(_0x513b22['countnoanswerretry']>=_0x45b4de['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x30ee('0xdb')]({'active':![],'countnoanswerretry':_0x513b22[_0x30ee('0x126')]+=0x1,'scheduledat':moment()[_0x30ee('0xdc')](_0x45b4de['dialNoAnswerRetryFrequency'],_0x30ee('0xdd'))['format'](_0x30ee('0xc4')),'ContactId':_0x513b22[_0x30ee('0xde')],'ListId':_0x513b22['ListId'],'VoiceQueueId':_0x513b22['VoiceQueueId']||undefined,'CampaignId':_0x513b22[_0x30ee('0xe1')]||undefined})['catch'](loggerCatch(_0x30ee('0x193')));break;case 0x5:if(_0x513b22[_0x30ee('0x131')]>=_0x45b4de['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x30ee('0xdb')]({'active':![],'countbusyretry':_0x513b22[_0x30ee('0x131')]+=0x1,'scheduledat':moment()['add'](_0x45b4de[_0x30ee('0x194')],_0x30ee('0xdd'))['format'](_0x30ee('0xc4')),'ContactId':_0x513b22['ContactId'],'ListId':_0x513b22[_0x30ee('0xdf')],'VoiceQueueId':_0x513b22[_0x30ee('0xe0')]||undefined,'CampaignId':_0x513b22[_0x30ee('0xe1')]||undefined})['catch'](loggerCatch(_0x30ee('0x195')));break;case 0x8:if(_0x513b22['countcongestionretry']>=_0x45b4de[_0x30ee('0x196')]-0x1){return!![];}hopperUtils[_0x30ee('0xdb')]({'active':![],'countcongestionretry':_0x513b22[_0x30ee('0x125')]+=0x1,'scheduledat':moment()['add'](_0x45b4de[_0x30ee('0x197')],_0x30ee('0xdd'))['format'](_0x30ee('0xc4')),'ContactId':_0x513b22[_0x30ee('0xde')],'ListId':_0x513b22[_0x30ee('0xdf')],'VoiceQueueId':_0x513b22[_0x30ee('0xe0')]||undefined,'CampaignId':_0x513b22[_0x30ee('0xe1')]||undefined})[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x198')));break;case 0x0:if(_0x513b22[_0x30ee('0x192')]>=_0x45b4de['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x513b22[_0x30ee('0x192')]+=0x1,'scheduledat':moment()[_0x30ee('0xdc')](_0x45b4de[_0x30ee('0x199')],_0x30ee('0xdd'))[_0x30ee('0x7f')](_0x30ee('0xc4')),'ContactId':_0x513b22[_0x30ee('0xde')],'ListId':_0x513b22[_0x30ee('0xdf')],'VoiceQueueId':_0x513b22[_0x30ee('0xe0')]||undefined,'CampaignId':_0x513b22[_0x30ee('0xe1')]||undefined})['catch'](loggerCatch(_0x30ee('0x19a')));}break;case 0xa:if(_0x513b22[_0x30ee('0xd4')]>=_0x45b4de[_0x30ee('0xd9')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x513b22[_0x30ee('0xd4')]+=0x1,'scheduledat':moment()[_0x30ee('0xdc')](_0x45b4de['dialDropRetryFrequency'],_0x30ee('0xdd'))[_0x30ee('0x7f')](_0x30ee('0xc4')),'ContactId':_0x513b22[_0x30ee('0xde')],'ListId':_0x513b22[_0x30ee('0xdf')],'VoiceQueueId':_0x513b22[_0x30ee('0xe0')]||undefined,'CampaignId':_0x513b22[_0x30ee('0xe1')]||undefined})[_0x30ee('0xa1')](loggerCatch(_0x30ee('0xe2')));break;case 0xb:if(_0x513b22[_0x30ee('0xeb')]>=_0x45b4de[_0x30ee('0xee')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x513b22[_0x30ee('0xeb')]+=0x1,'scheduledat':moment()[_0x30ee('0xdc')](_0x45b4de[_0x30ee('0xec')],_0x30ee('0xdd'))['format'](_0x30ee('0xc4')),'ContactId':_0x513b22[_0x30ee('0xde')],'ListId':_0x513b22[_0x30ee('0xdf')],'VoiceQueueId':_0x513b22[_0x30ee('0xe0')]||undefined,'CampaignId':_0x513b22['CampaignId']||undefined})[_0x30ee('0xa1')](loggerCatch(_0x30ee('0xef')));break;case 0x13:if(_0x513b22['countmachineretry']>=_0x45b4de[_0x30ee('0x12a')]-0x1){return!![];}hopperUtils[_0x30ee('0xdb')]({'active':![],'countmachineretry':_0x513b22[_0x30ee('0x124')]+=0x1,'scheduledat':moment()[_0x30ee('0xdc')](_0x45b4de[_0x30ee('0x19b')],_0x30ee('0xdd'))['format'](_0x30ee('0xc4')),'ContactId':_0x513b22[_0x30ee('0xde')],'ListId':_0x513b22[_0x30ee('0xdf')],'VoiceQueueId':_0x513b22[_0x30ee('0xe0')]||undefined,'CampaignId':_0x513b22[_0x30ee('0xe1')]||undefined})[_0x30ee('0xa1')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x513b22['countagentrejectretry']>=_0x45b4de['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x30ee('0xdb')]({'active':![],'countagentrejectretry':_0x513b22[_0x30ee('0x127')]+=0x1,'scheduledat':moment()['add'](_0x45b4de[_0x30ee('0x19c')],'minutes')[_0x30ee('0x7f')](_0x30ee('0xc4')),'ContactId':_0x513b22[_0x30ee('0xde')],'ListId':_0x513b22[_0x30ee('0xdf')],'VoiceQueueId':_0x513b22[_0x30ee('0xe0')]||undefined,'CampaignId':_0x513b22[_0x30ee('0xe1')]||undefined})[_0x30ee('0xa1')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x30ee('0x18')]['callProgressDetecting']=function(_0x2dbf66,_0x2f2be3,_0x4ed26e){var _0x31546e=this;var _0x1d032d=new History(_0x2dbf66);var _0x64359c=![];var _0x307159;var _0x1dacfb;return new Promise(function(_0x105ea3,_0x7da846){if(_[_0x30ee('0x54')](_0x2f2be3)&&typeof _0x2f2be3!==_0x30ee('0x162')){return _0x7da846(msgResponse(_0x30ee('0x19d'),_0x30ee('0x95'),_0x30ee('0x19e')));}if(_[_0x30ee('0x54')](_0x4ed26e)&&typeof _0x4ed26e!==_0x30ee('0x162')){return _0x7da846(msgResponse(_0x30ee('0x19d'),_0x30ee('0x95'),_0x30ee('0x19f')));}hopperUtils['verifyAdditionalPhones'](_0x1d032d,_0x4ed26e[_0x30ee('0xc7')],_0x2f2be3)[_0x30ee('0x3e')](function(_0x180e76){if(_0x180e76[_0x30ee('0xd8')]==0x1)_0x64359c=!![];switch(_0x4ed26e['reason']){case'0':_0x2f2be3['outboundNoSuchCallsDay']+=0x1;_0x1d032d[_0x30ee('0xd2')]=0x0;_0x1d032d['statedesc']=_0x30ee('0x1a0');_0x1d032d[_0x30ee('0x192')]+=0x1;_0x1d032d[_0x30ee('0xd5')]+=0x1;ami[_0x30ee('0x40')](_0x30ee('0x1a1'),ut[_0x30ee('0x11d')](_0x2dbf66,'nosuchnumber'));_0x307159=_0x2f2be3[_0x30ee('0x199')];_0x1dacfb=_0x2f2be3[_0x30ee('0xed')];hopperUtils[_0x30ee('0xcb')](_0x1d032d)[_0x30ee('0xa1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x31546e[_0x30ee('0x191')](0x0,_0x2dbf66,_0x2f2be3)&&!_0x64359c){if(_0x1d032d[_0x30ee('0x192')]>=_0x2f2be3['dialNoSuchNumberMaxRetry']){_0x31546e['createStateFinal'](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1a2'));}else{_0x31546e['stateGlobal'](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1a2'));}}break;case'3':_0x2f2be3[_0x30ee('0x1a3')]+=0x1;_0x1d032d['state']=0x3;_0x1d032d[_0x30ee('0x72')]=_0x30ee('0x1a4');_0x1d032d['countnoanswerretry']+=0x1;_0x1d032d[_0x30ee('0xd5')]+=0x1;var _0x559164=ut[_0x30ee('0x1a5')](_0x2dbf66,_0x2f2be3);ami[_0x30ee('0x40')](_0x30ee('0x1a6'),_0x559164);_0x307159=_0x2f2be3['dialNoAnswerRetryFrequency'];_0x1dacfb=_0x2f2be3[_0x30ee('0xed')];hopperUtils[_0x30ee('0xcb')](_0x1d032d)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x1a7')));if(_0x31546e[_0x30ee('0x191')](0x3,_0x2dbf66,_0x2f2be3)&&!_0x64359c){if(_0x1d032d[_0x30ee('0x126')]>=_0x2f2be3['dialNoAnswerMaxRetry']){_0x31546e[_0x30ee('0x133')](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1a8'));}else{_0x31546e[_0x30ee('0x129')](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1a8'));}}break;case'5':_0x2f2be3[_0x30ee('0x1a9')]+=0x1;_0x1d032d['state']=0x5;_0x1d032d[_0x30ee('0x72')]='Busy';_0x1d032d[_0x30ee('0x131')]+=0x1;_0x1d032d[_0x30ee('0xd5')]+=0x1;ami[_0x30ee('0x40')]('custom:agentbusy',ut[_0x30ee('0x11d')](_0x2dbf66,_0x30ee('0x1aa')));_0x307159=_0x2f2be3[_0x30ee('0x194')];_0x1dacfb=_0x2f2be3['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x1d032d)[_0x30ee('0xa1')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x31546e['checkRetriveMax'](0x5,_0x2dbf66,_0x2f2be3)&&!_0x64359c){if(_0x1d032d[_0x30ee('0x131')]>=_0x2f2be3[_0x30ee('0x1ab')]){_0x31546e['createStateFinal'](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1ac'));}else{_0x31546e[_0x30ee('0x129')](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1ac'));}}break;case'8':_0x2f2be3[_0x30ee('0x1ad')]+=0x1;_0x1d032d[_0x30ee('0xd2')]=0x8;_0x1d032d['statedesc']=_0x30ee('0x1ae');_0x1d032d[_0x30ee('0x125')]+=0x1;_0x1d032d[_0x30ee('0xd5')]+=0x1;_0x307159=_0x2f2be3['dialCongestionRetryFrequency'];_0x1dacfb=_0x2f2be3['callAdditionalPhoneAfterMin'];ami[_0x30ee('0x40')](_0x30ee('0x1af'),ut[_0x30ee('0x11d')](_0x2dbf66,_0x30ee('0x1b0')));hopperUtils[_0x30ee('0xcb')](_0x1d032d)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x1b1')));if(_0x31546e[_0x30ee('0x191')](0x8,_0x2dbf66,_0x2f2be3)&&!_0x64359c){if(_0x1d032d[_0x30ee('0x125')]>=_0x2f2be3[_0x30ee('0x196')]){_0x31546e[_0x30ee('0x133')](_0x1d032d,_0x105ea3,_0x7da846,'reason\x208\x20congestion');}else{_0x31546e['stateGlobal'](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1b2'));}}break;case'11':_0x2f2be3[_0x30ee('0x1b3')]+=0x1;_0x1d032d['state']=0xb;_0x1d032d[_0x30ee('0x72')]='Abandoned';_0x1d032d[_0x30ee('0xeb')]+=0x1;_0x1d032d[_0x30ee('0xd5')]+=0x1;_0x307159=_0x2f2be3['dialAbandonedRetryFrequency'];_0x1dacfb=_0x2f2be3[_0x30ee('0xed')];hopperUtils['createHistory'](_0x1d032d)[_0x30ee('0xa1')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x31546e['checkRetriveMax'](0xb,_0x2dbf66,_0x2f2be3)&&!_0x64359c){if(_0x1d032d[_0x30ee('0xeb')]>=_0x2f2be3[_0x30ee('0xee')]){_0x31546e[_0x30ee('0x133')](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1b4'));}else{_0x31546e['stateGlobal'](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1b4'));}}break;case'20':_0x2f2be3[_0x30ee('0x1b5')]+=0x1;_0x1d032d[_0x30ee('0xd2')]=0x14;_0x1d032d[_0x30ee('0x72')]=_0x30ee('0x1b6');_0x1d032d['countagentrejectretry']+=0x1;_0x1d032d[_0x30ee('0xd5')]+=0x1;_0x307159=_0x2f2be3[_0x30ee('0x19c')];_0x1dacfb=_0x2f2be3[_0x30ee('0xed')];ami[_0x30ee('0x40')](_0x30ee('0x1b7'),ut['buildObj'](_0x2dbf66,_0x30ee('0x1b8')));hopperUtils[_0x30ee('0xcb')](_0x1d032d)[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x1b9')));if(_0x31546e[_0x30ee('0x191')](0x14,_0x2dbf66,_0x2f2be3)&&!_0x64359c){if(_0x1d032d[_0x30ee('0x127')]>=_0x2f2be3[_0x30ee('0x1ba')]){_0x31546e['createStateFinal'](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1bb'));}else{_0x31546e[_0x30ee('0x129')](_0x1d032d,_0x105ea3,_0x7da846,_0x30ee('0x1bb'));}}break;default:_0x2f2be3['outboundUnknownCallsDay']+=0x1;_0x1d032d[_0x30ee('0xd2')]=0xc;_0x1d032d['statedesc']=_0x4ed26e[_0x30ee('0xc7')];_0x307159=_0x2f2be3[_0x30ee('0x19c')];_0x1dacfb=_0x2f2be3[_0x30ee('0xed')];hopperUtils[_0x30ee('0xcb')](_0x1d032d)['catch'](loggerCatch(_0x30ee('0x1bc')));if(_0x31546e['checkRetriveMax'](_0x4ed26e[_0x30ee('0xc7')],_0x2dbf66,_0x2f2be3)&&!_0x64359c){if(_0x1d032d[_0x30ee('0x131')]+_0x1d032d[_0x30ee('0x125')]+_0x1d032d['countnoanswerretry']+_0x1d032d['countnosuchnumberretry']+_0x1d032d['countdropretry']+_0x1d032d[_0x30ee('0xeb')]+_0x1d032d[_0x30ee('0x124')]+_0x1d032d[_0x30ee('0x127')]>=_0x2f2be3[_0x30ee('0x128')]){_0x31546e['stateGlobal'](_0x1d032d,_0x105ea3,_0x7da846,_0x4ed26e['reason']);}else{_0x31546e[_0x30ee('0x133')](_0x1d032d,_0x105ea3,_0x7da846,_0x4ed26e[_0x30ee('0xc7')]);}}}})[_0x30ee('0x3e')](function(){if(_0x64359c){hopperUtils[_0x30ee('0xe7')](_0x1d032d,_0x307159,_0x1dacfb)[_0x30ee('0x3e')](function(){return _0x105ea3(0x1);});}});});};Dialer[_0x30ee('0x18')][_0x30ee('0x129')]=function(_0x2d9e54,_0x472294,_0x508e1b,_0x1b8dcd){var _0x4c5cc9=new Final(_0x2d9e54);_0x4c5cc9[_0x30ee('0xd2')]=0xf;_0x4c5cc9['statedesc']=_0x30ee('0x1bd');this[_0x30ee('0x133')](_0x4c5cc9,_0x472294,_0x508e1b,_0x1b8dcd);};Dialer[_0x30ee('0x18')][_0x30ee('0x133')]=function(_0x41134e,_0x4742bb,_0x2ddfd8,_0x135f9c){hopperUtils[_0x30ee('0x13a')](_0x41134e)[_0x30ee('0x3e')](function(){return _0x4742bb(msgResponse('[callProgressDetecting]',_0x30ee('0x111'),_0x135f9c));})[_0x30ee('0xa1')](function(){return _0x2ddfd8(msgResponse('[moveContactManagedDialer][0]',_0x30ee('0x95'),_0x30ee('0x1be')));});};Dialer[_0x30ee('0x18')][_0x30ee('0xb1')]=function(_0x2e6db5){var _0x34790f=_0x2e6db5['dialPredictiveOptimizationPercentage']/0x64;var _0x18eb30=_0x2e6db5['outboundDropCallsDayTimeout']/(_0x2e6db5[_0x30ee('0xd0')]+_0x2e6db5['outboundAnswerCallsDay']);var _0x58dd42=Math[_0x30ee('0x1bf')](_0x2e6db5[_0x30ee('0x1c0')]*(_0x2e6db5[_0x30ee('0x1c1')]/0x64));var _0xae2778=Math[_0x30ee('0x1bf')](_0x2e6db5['predictiveIntervalAvailable']*(_0x2e6db5['predictiveIntervalMinThreshold']/0x64));var _0xc70268=_0x2e6db5[_0x30ee('0x1c2')]+_0x2e6db5['talking'];var _0x11d4ad=Math[_0x30ee('0x1c3')](_0x2e6db5[_0x30ee('0x5b')]*_0x2e6db5[_0x30ee('0x60')]*_0x2e6db5[_0x30ee('0x1c4')]*_0x2e6db5[_0x30ee('0x1c5')]);if(_['isUndefined'](_0x2e6db5[_0x30ee('0x27')])){if(!_[_0x30ee('0x54')](_0x2e6db5['startPredictive'])){_0x2e6db5[_0x30ee('0x26')]=undefined;loggerPredictive[_0x30ee('0x67')](_0x30ee('0x1c6'),_0x30ee('0x1c7'));}if(!_[_0x30ee('0x54')](_0x2e6db5[_0x30ee('0x64')])){loggerPredictive[_0x30ee('0x67')](_0x30ee('0x1c6'),_0x30ee('0x1c8'));clearInterval(_0x2e6db5[_0x30ee('0x64')]);_0x2e6db5['handlePredictive']=undefined;}_0x2e6db5[_0x30ee('0x27')]=moment()['format'](_0x30ee('0xc4'));loggerPredictive[_0x30ee('0x48')](_0x2e6db5[_0x30ee('0x62')],_0x30ee('0x1c9'),_0x2e6db5[_0x30ee('0x27')]);this[_0x30ee('0xb3')](_0x2e6db5,0x1);}else if(ifInterval(_0x2e6db5[_0x30ee('0x1ca')],_0x2e6db5[_0x30ee('0x27')])){this[_0x30ee('0xb3')](_0x2e6db5,0x1);loggerPredictiveCalls['info'](_0x30ee('0x1cb'),_0x2e6db5[_0x30ee('0x27')],_0x2e6db5['name']);_0x2e6db5[_0x30ee('0x5b')]=0x0;_0x2e6db5[_0x30ee('0xd1')]=0x0;}else if(_0x34790f<_0x18eb30&&_0x2e6db5[_0x30ee('0x1cc')]===_0x30ee('0x1cd')){clearPredictiveAttributes(_0x2e6db5);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x1ce'),_0x30ee('0x1cf'),_0x18eb30,_0x30ee('0x27'),_0x2e6db5[_0x30ee('0x62')]);}else if(_0x11d4ad<_0x2e6db5[_0x30ee('0xd1')]&&_0x2e6db5['dialPredictiveOptimization']===_0x30ee('0x1cd')){clearPredictiveAttributes(_0x2e6db5);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x1d0'),'Max\x20Drop\x20',_0x11d4ad,_0x30ee('0x1d1'),_0x2e6db5[_0x30ee('0xd1')],_0x30ee('0x27'),_0x2e6db5[_0x30ee('0x62')]);}else if(!ifInterval(_0x2e6db5[_0x30ee('0x1ca')],_0x2e6db5[_0x30ee('0x27')])&&_['isUndefined'](_0x2e6db5['startPredictive'])&&!_[_0x30ee('0x54')](_0x2e6db5['startProgressive'])){_0x2e6db5[_0x30ee('0x26')]=moment()[_0x30ee('0x7f')](_0x30ee('0xc4'));loggerPredictive[_0x30ee('0x48')](_0x2e6db5[_0x30ee('0x62')],_0x30ee('0x1d2'),_0x2e6db5[_0x30ee('0x26')]);hopperUtils['avgHandleTime'](_0x2e6db5[_0x30ee('0x1ca')])[_0x30ee('0x3e')](this[_0x30ee('0x1d3')](_0x2e6db5))['then'](mergeDataErlangB(_0x2e6db5))['then'](this[_0x30ee('0x1d4')](_0x2e6db5))[_0x30ee('0xa1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2e6db5));}else if(!ifInterval(_0x2e6db5[_0x30ee('0x1ca')],_0x2e6db5[_0x30ee('0x26')])){_0x2e6db5[_0x30ee('0xd1')]=0x0;_0x2e6db5[_0x30ee('0x26')]=moment()[_0x30ee('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x30ee('0x48')](_0x2e6db5['name'],_0x30ee('0x1d5'),_0x2e6db5[_0x30ee('0x26')]);clearInterval(_0x2e6db5['handlePredictive']);_0x2e6db5[_0x30ee('0x64')]=undefined;hopperUtils[_0x30ee('0x1d6')](_0x2e6db5['dialPredictiveInterval'])[_0x30ee('0x3e')](this['getDataPredictive'](_0x2e6db5))[_0x30ee('0x3e')](mergeDataErlangB(_0x2e6db5))[_0x30ee('0x3e')](this[_0x30ee('0x1d4')](_0x2e6db5))[_0x30ee('0xa1')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x2e6db5));}else if(_0x2e6db5['predictiveIntervalAvailable']&&_0xc70268<_0x2e6db5[_0x30ee('0x1c0')]-_0xae2778){clearPredictiveAttributes(_0x2e6db5);loggerPredictive['info'](_0x2e6db5[_0x30ee('0x62')],_0x30ee('0x1d7'),_0xc70268,')\x20are\x20less\x20than\x20threshold\x20(',_0x2e6db5[_0x30ee('0x1c0')],'-',_0xae2778,'=',_0x2e6db5[_0x30ee('0x1c0')]-_0xae2778,')');}else if(_0x2e6db5[_0x30ee('0x1c0')]&&_0xc70268>_0x2e6db5['predictiveIntervalAvailable']+_0x58dd42){clearPredictiveAttributes(_0x2e6db5);loggerPredictive[_0x30ee('0x48')](_0x2e6db5[_0x30ee('0x62')],_0x30ee('0x1d7'),_0xc70268,')\x20are\x20more\x20than\x20threshold\x20(',_0x2e6db5[_0x30ee('0x1c0')],'+',_0x58dd42,'=',_0x2e6db5['predictiveIntervalAvailable']+_0x58dd42,')');}};Dialer[_0x30ee('0x18')]['getDataPredictive']=function(_0x550b62){var _0x4a71b9=this;return function(_0x631fd7){return new Promise(function(_0x9ca614,_0x32ef83){_[_0x30ee('0xfa')](_0x550b62,_0x631fd7[0x0]);if(checkGetDataPredictive(_0x631fd7[0x0])){var _0x493e2d=_0x550b62['predictiveIntervalAvailable']=_0x550b62[_0x30ee('0x1d8')]+_0x550b62['available'];var _0x1a6314=_0x550b62['dialPredictiveInterval']*0x3c;var _0x291418=_0x631fd7[0x0][_0x30ee('0x55')]+_0x631fd7[0x0][_0x30ee('0x56')];var _0x19a9d6=(_0x631fd7[0x0][_0x30ee('0x4d')]+_0x631fd7[0x0][_0x30ee('0x4f')]+_0x631fd7[0x0][_0x30ee('0x51')])/_0x631fd7[0x0][_0x30ee('0x4b')];_0x550b62['predictiveIntervalHitRate']=_0x19a9d6>0x0?_0x19a9d6:0x1;switch(_0x550b62['dialPredictiveOptimization']){case _0x30ee('0x1cd'):var _0x1dccac=_0x550b62[_0x30ee('0x1d9')]/0x64;return _0x4a71b9[_0x30ee('0x1da')](_0x493e2d,_0x1a6314,_0x291418,_0x19a9d6,_0x1dccac)[_0x30ee('0x3e')](function(_0x3f8bf3){return _0x9ca614(_0x3f8bf3);});case _0x30ee('0x1db'):var _0x19e905=_0x550b62[_0x30ee('0x1d9')]/0x64;return _0x4a71b9[_0x30ee('0x1dc')](_0x493e2d,_0x1a6314,_0x291418,_0x19a9d6,_0x19e905)[_0x30ee('0x3e')](function(_0x455040){return _0x9ca614(_0x455040);});default:return _0x32ef83(msgResponse(_0x30ee('0x1dd'),_0x30ee('0x95'),_0x30ee('0x1de')));}}else{return _0x32ef83(msgResponse('[getDataPredictive]',_0x30ee('0x95'),_0x30ee('0x1df')));}});};};Dialer[_0x30ee('0x18')][_0x30ee('0x1e0')]=function(_0x386ca7){var _0x30cd2e=this;return function(_0x4fcfa5){return new Promise(function(_0x57b8af,_0x4a031b){_[_0x30ee('0xfa')](_0x386ca7,_0x4fcfa5[0x0]);if(checkGetDataPredictive(_0x4fcfa5[0x0])){loggerPredictive[_0x30ee('0x48')](JSON['stringify'](_0x4fcfa5[0x0]));if(_0x386ca7[_0x30ee('0x1cc')]===_0x30ee('0x1cd')){return _0x30cd2e[_0x30ee('0x155')](_0x386ca7['id'])[_0x30ee('0x3e')](function(_0x2413a3){var _0x117ab5=_0x386ca7[_0x30ee('0x1e1')]-_0x2413a3[0x0][_0x30ee('0x1e2')];var _0x197b0c=_0x386ca7['dialPredictiveInterval']*0x3c;var _0x26d8a5=_0x4fcfa5[0x0][_0x30ee('0x55')]+_0x4fcfa5[0x0][_0x30ee('0x56')];var _0x26f694=(_0x4fcfa5[0x0][_0x30ee('0x4d')]+_0x4fcfa5[0x0][_0x30ee('0x4f')]+_0x4fcfa5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4fcfa5[0x0][_0x30ee('0x4b')];var _0x30f758=_0x386ca7[_0x30ee('0x1d9')]/0x64;_0x386ca7[_0x30ee('0x1e3')]=_0x2413a3[0x0][_0x30ee('0x1e2')]||0x0;_0x386ca7[_0x30ee('0x1c4')]=_0x26f694>0x0?_0x26f694:0x1;return _0x30cd2e[_0x30ee('0x1da')](_0x117ab5,_0x197b0c,_0x26d8a5,_0x26f694,_0x30f758);})[_0x30ee('0x3e')](function(_0x5b3000){return _0x57b8af(_0x5b3000);})[_0x30ee('0xa1')](function(_0x4f5ff7){return _0x4a031b(msgResponse('[CatchErlangB]',_0x30ee('0x95'),JSON[_0x30ee('0x77')](_0x4f5ff7)));});}if(_0x386ca7[_0x30ee('0x1cc')]==='agentBusyFactor'){return _0x30cd2e[_0x30ee('0x155')](_0x386ca7['id'])[_0x30ee('0x3e')](function(_0x4630cd){var _0x45ae5e=_0x386ca7[_0x30ee('0x1e1')]-_0x4630cd[0x0]['outboundQueuePauses'];var _0x30a841=_0x386ca7[_0x30ee('0x1ca')]*0x3c;var _0x164805=_0x4fcfa5[0x0][_0x30ee('0x55')]+_0x4fcfa5[0x0][_0x30ee('0x56')];var _0x531550=(_0x4fcfa5[0x0]['predictiveIntervalAnsweredCalls']+_0x4fcfa5[0x0][_0x30ee('0x4f')]+_0x4fcfa5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4fcfa5[0x0][_0x30ee('0x4b')];var _0x288df1=_0x386ca7[_0x30ee('0x1d9')]/0x64;_0x386ca7['predictiveIntervalPauses']=_0x4630cd[0x0][_0x30ee('0x1e2')]||0x0;_0x386ca7[_0x30ee('0x1c4')]=_0x531550>0x0?_0x531550:0x1;return _0x30cd2e[_0x30ee('0x1dc')](_0x45ae5e,_0x30a841,_0x164805,_0x531550,_0x288df1);})[_0x30ee('0x3e')](function(_0x5237bd){return _0x57b8af(_0x5237bd);})[_0x30ee('0xa1')](function(_0x377c8f){return _0x4a031b(msgResponse(_0x30ee('0x1e4'),_0x30ee('0x95'),JSON[_0x30ee('0x77')](_0x377c8f)));});}}else{return _0x4a031b(msgResponse(_0x30ee('0x1dd'),_0x30ee('0x95'),'check\x20failure'));}});};};Dialer[_0x30ee('0x18')][_0x30ee('0x1d4')]=function(_0x52fd6c){var _0x1d4174=this;return function(){var _0x35be1e=0x0;var _0x1e0b72=Math[_0x30ee('0x1c3')](_0x52fd6c[_0x30ee('0x1e5')]*0x3e8);if(_0x1e0b72>0x0){_0x1e0b72=_0x1e0b72<0x64?0x64:_0x1e0b72;loggerPredictive[_0x30ee('0x48')](_0x52fd6c[_0x30ee('0x62')],'one\x20call\x20every:',_0x1e0b72,_0x30ee('0x1e6'));_0x52fd6c[_0x30ee('0x64')]=setInterval(function(){_0x1d4174['handlePredictive'](_0x52fd6c);loggerPredictiveCalls['info'](_0x30ee('0x1e7'),_0x35be1e+=0x1);},_0x1e0b72);}else{loggerPredictive[_0x30ee('0x48')](_0x52fd6c['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x30ee('0x18')][_0x30ee('0x1e8')]=function(_0x1552b4,_0x5a7d5c){var _0x248a2e=this;return function(_0x243d7b){if(_[_0x30ee('0x47')](_0x243d7b)){if(_[_0x30ee('0xf8')](_0x5a7d5c['UserId'])||!_0x5a7d5c['recallme']){if(_0x1552b4[_0x30ee('0xb2')]===_0x30ee('0x1e9')){_0x1552b4[_0x30ee('0x75')]=_[_0x30ee('0x54')](_0x1552b4[_0x30ee('0x75')])?!![]:_0x1552b4[_0x30ee('0x75')];var _0x2ad088=uuid['v4']();_0x248a2e[_0x30ee('0x23')][_0x2ad088]=new Action(_0x1552b4,_0x5a7d5c,_0x2ad088);loggerBooked['info']('[booked][checkContactBlack]',_0x2ad088,_0x30ee('0x1ea'),JSON[_0x30ee('0x77')](_0x1552b4[_0x30ee('0x75')]),_0x30ee('0x1eb'),_0x1552b4[_0x30ee('0x62')]);if(_0x1552b4[_0x30ee('0x75')]){_0x1552b4['queueStatusComplete']=![];_0x248a2e[_0x30ee('0xf9')][_0x248a2e[_0x30ee('0x23')][_0x2ad088][_0x30ee('0xc2')]]=[];ami['Action']({'actionid':_0x2ad088,'action':_0x30ee('0x1ec'),'queue':_0x1552b4['name']})[_0x30ee('0xa1')](function(){_0x248a2e[_0x30ee('0x100')](_0x1552b4);hopperUtils[_0x30ee('0xdb')]({'active':![],'ContactId':_0x248a2e['actions'][_0x2ad088][_0x30ee('0xde')],'ListId':_0x248a2e['actions'][_0x2ad088]['ListId'],'VoiceQueueId':_0x248a2e[_0x30ee('0x23')][_0x2ad088]['VoiceQueueId']||undefined,'CampaignId':_0x248a2e['actions'][_0x2ad088][_0x30ee('0xe1')]||undefined})['catch'](loggerCatch(_0x30ee('0x1ed')));delete _0x248a2e['actions'][_0x2ad088];});}else{loggerBooked['info'](_0x30ee('0x1ee'),JSON[_0x30ee('0x77')](_0x1552b4[_0x30ee('0x75')]),_0x30ee('0x1eb'),_0x1552b4[_0x30ee('0x62')]);_0x248a2e[_0x30ee('0x100')](_0x1552b4);hopperUtils[_0x30ee('0xdb')]({'active':![],'ContactId':_0x248a2e['actions'][_0x2ad088][_0x30ee('0xde')],'ListId':_0x248a2e[_0x30ee('0x23')][_0x2ad088]['ListId'],'VoiceQueueId':_0x248a2e[_0x30ee('0x23')][_0x2ad088][_0x30ee('0xe0')]||undefined,'CampaignId':_0x248a2e[_0x30ee('0x23')][_0x2ad088][_0x30ee('0xe1')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x248a2e['actions'][_0x2ad088];}}else{return _0x248a2e['actionOriginate'](_0x1552b4,_0x5a7d5c);}}else{if(utils['getSeconds'](undefined,_0x5a7d5c[_0x30ee('0x1ef')])<_0x1552b4[_0x30ee('0x1f0')]*0x3c){if(_0x5a7d5c[_0x30ee('0x14d')]&&!_0x5a7d5c[_0x30ee('0x14d')]['voicePause']){_0x248a2e[_0x30ee('0x1d')][_0x30ee('0xfe')](_0x5a7d5c['id'])[_0x30ee('0x1b')](function(){_0x248a2e[_0x30ee('0x100')](_0x1552b4);});}else{hopperUtils[_0x30ee('0x1f1')]({'active':![]},_0x5a7d5c['id'],0x1)[_0x30ee('0x1b')](function(){_0x248a2e[_0x30ee('0x100')](_0x1552b4);});}}else{_0x1552b4['outboundReCallsDay']+=0x1;_0x248a2e[_0x30ee('0x100')](_0x1552b4);if(_0x1552b4[_0x30ee('0x1f2')]){hopperUtils[_0x30ee('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a7d5c[_0x30ee('0xde')],'ListId':_0x5a7d5c['ListId'],'VoiceQueueId':_0x5a7d5c[_0x30ee('0xe0')]||undefined,'CampaignId':_0x5a7d5c[_0x30ee('0xe1')]||undefined})['catch'](loggerCatch(_0x30ee('0x1f3')));hopperUtils[_0x30ee('0xcb')](createObjHistory(_0x1552b4,_0x5a7d5c,utils[_0x30ee('0x6c')]['QUEUE_RECALL'],0x17,_0x30ee('0x1f4')))['catch'](loggerCatch(_0x30ee('0x1f5')));}else{_0x248a2e['saveInDb'](createObjHistory(_0x1552b4,_0x5a7d5c,utils[_0x30ee('0x6c')][_0x30ee('0x1f6')],0x16,'RecallFailedTimeout'),_0x30ee('0x1f7'),_0x30ee('0x1f8'));}}}}else{_0x1552b4[_0x30ee('0x1f9')]+=0x1;_0x248a2e[_0x30ee('0x11f')](createObjHistory(_0x1552b4,_0x5a7d5c,utils['CAMPAIGN_STATUS'][_0x30ee('0x1fa')],0xd,_0x30ee('0x1fb')),_0x30ee('0x1fc'),_0x30ee('0x1fd'));throw'inBlackList';}};};Dialer[_0x30ee('0x18')][_0x30ee('0x160')]=function(_0x4357c1){var _0x36f6ad=this;var _0x36cdfe=_0x4357c1[_0x30ee('0x1fe')]-_0x4357c1[_0x30ee('0x157')];emitCampaignSummary(_0x4357c1);if(_0x36cdfe>0x0&&_0x4357c1[_0x30ee('0x69')]==0x0){if(_0x36cdfe>this[_0x30ee('0x21')]){_0x36cdfe=this[_0x30ee('0x21')];}_0x4357c1[_0x30ee('0x69')]=0x1;hopperUtils['getContactDialerIvr'](_0x4357c1,_0x36cdfe)[_0x30ee('0x3e')](function(_0x33a9b5){_0x4357c1[_0x30ee('0x69')]=0x0;if(_0x33a9b5){if(!utils['checkContactEmpty'](_0x33a9b5)){_0x4357c1['message']=utils['CAMPAIGN_STATUS'][_0x30ee('0x70')];logger[_0x30ee('0x48')](_0x30ee('0x1ff')+_0x4357c1['name']);}else{_0x4357c1[_0x30ee('0x157')]+=_0x33a9b5[_0x30ee('0x104')];_0x4357c1[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')][_0x30ee('0x200')];for(var _0x12180c=0x0;_0x12180c<_0x33a9b5[_0x30ee('0x104')];_0x12180c+=0x1){_0x4357c1[_0x30ee('0x201')]+=0x1;if(_['isNil'](_0x33a9b5[_0x12180c])||_['isNil'](_0x33a9b5[_0x12180c][_0x30ee('0x17b')])||_['isNil'](_0x33a9b5[_0x12180c][_0x30ee('0x165')])){_0x36f6ad[_0x30ee('0x15a')](_0x30ee('0x202'),_0x4357c1,_0x33a9b5[_0x12180c]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x30ee('0x78')](_0x33a9b5[_0x12180c],[_0x30ee('0xe1'),'phone']))[_0x30ee('0x3e')](_0x36f6ad['checkContactBlack'](_0x4357c1,_0x33a9b5[_0x12180c]))['catch'](_0x36f6ad[_0x30ee('0x203')](_0x30ee('0x204'),_0x4357c1));}}}}})[_0x30ee('0xa1')](loggerGetContactDialer(_0x30ee('0x205'),_0x4357c1,_0x36cdfe));}};Dialer[_0x30ee('0x18')][_0x30ee('0xb3')]=function(_0x24a815,_0x285579){var _0x5bfabd=this;var _0x43077e=[];if(_0x285579<0x1||_0x24a815['dialMethod']===_0x30ee('0x1e9')){_0x285579=0x1;}var _0x4a96a6=Math[_0x30ee('0x1c3')](_0x24a815[_0x30ee('0x1c2')]*_0x285579)-_0x24a815[_0x30ee('0x157')];if(_0x24a815[_0x30ee('0x206')]>0x0){var _0x245713=_0x24a815[_0x30ee('0x206')]-_0x24a815[_0x30ee('0x157')]-_0x24a815[_0x30ee('0x1d8')]-_0x24a815[_0x30ee('0x207')];if(_0x4a96a6>_0x245713){_0x4a96a6=_0x245713;}}if(_0x4a96a6>0x0&&_0x24a815[_0x30ee('0x69')]==0x0){if(_0x24a815[_0x30ee('0xb2')]===_0x30ee('0x1e9')){_0x4a96a6=0x1;}if(_0x4a96a6>this[_0x30ee('0x21')]){_0x4a96a6=this['maxNumberOriginate'];}for(var _0x1939b7 in this[_0x30ee('0x1f')]){if(typeof this[_0x30ee('0x1f')][_0x1939b7]!=='undefined'){if(this[_0x30ee('0x1f')][_0x1939b7][_0x30ee('0xd2')]===_0x30ee('0x208')&&this[_0x30ee('0x1f')][_0x1939b7][_0x30ee('0x8c')]===_0x30ee('0x14a')){_0x43077e['push'](this['agents'][_0x1939b7]['id']);}}}_0x24a815[_0x30ee('0x69')]=0x1;hopperUtils['getContactDialer'](_0x24a815,_0x43077e,_0x4a96a6)['then'](function(_0xf501ac){_0x24a815[_0x30ee('0x69')]=0x0;if(_0xf501ac){if(!utils['checkContactEmpty'](_0xf501ac)){hopperUtils[_0x30ee('0x209')](_0x24a815)[_0x30ee('0x3e')](sendMessageReschedule(_0x24a815))[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x20a')));}else{_0x24a815['originated']+=_0xf501ac[_0x30ee('0x104')];_0x24a815[_0x30ee('0x6b')]=_0x24a815[_0x30ee('0xb2')]===_0x30ee('0x1e9')?utils[_0x30ee('0x6c')][_0x30ee('0x141')]:utils[_0x30ee('0x6c')][_0x30ee('0x200')];for(var _0x2f4d55=0x0;_0x2f4d55<_0xf501ac[_0x30ee('0x104')];_0x2f4d55+=0x1){if(_[_0x30ee('0xf8')](_0xf501ac[_0x2f4d55])||_[_0x30ee('0xf8')](_0xf501ac[_0x2f4d55][_0x30ee('0x17b')])||_[_0x30ee('0xf8')](_0xf501ac[_0x2f4d55]['phone'])){_0x5bfabd[_0x30ee('0x15a')](_0x30ee('0x202'),_0x24a815,_0xf501ac[_0x2f4d55]);}else{hopperUtils[_0x30ee('0x20b')](_[_0x30ee('0x78')](_0xf501ac[_0x2f4d55],[_0x30ee('0xe0'),_0x30ee('0x165')]))[_0x30ee('0x3e')](_0x5bfabd[_0x30ee('0x1e8')](_0x24a815,_0xf501ac[_0x2f4d55]))[_0x30ee('0xa1')](_0x5bfabd[_0x30ee('0x203')](_0x30ee('0x202'),_0x24a815));}}}}})[_0x30ee('0xa1')](loggerGetContactDialer('[getContactDialer2]',_0x24a815,_0x4a96a6));}};Dialer[_0x30ee('0x18')]['handlePredictive']=function(_0x5c0ce8){if(_0x5c0ce8[_0x30ee('0x206')]>0x0){var _0x1f1285=_0x5c0ce8[_0x30ee('0x206')]-_0x5c0ce8[_0x30ee('0x157')]-_0x5c0ce8['talking'];if(_0x1f1285>0x0&&_0x5c0ce8[_0x30ee('0x69')]==0x0){this[_0x30ee('0x20c')](_0x5c0ce8);}else{loggerPredictiveCalls[_0x30ee('0x48')]('[handlePredictive][limitChannel]');}}else{this[_0x30ee('0x20c')](_0x5c0ce8);}};Dialer[_0x30ee('0x18')][_0x30ee('0x20c')]=function(_0x29e22b){var _0x497fd8=this;var _0x11ed6f=[];_0x29e22b[_0x30ee('0x157')]+=0x1;for(var _0x1ef6a6 in this[_0x30ee('0x1f')]){if(typeof this[_0x30ee('0x1f')][_0x1ef6a6]!=='undefined'){if(this[_0x30ee('0x1f')][_0x1ef6a6][_0x30ee('0xd2')]===_0x30ee('0x208')&&this[_0x30ee('0x1f')][_0x1ef6a6][_0x30ee('0x8c')]==='reachable'){_0x11ed6f[_0x30ee('0xa2')](this[_0x30ee('0x1f')][_0x1ef6a6]['id']);}}}_0x29e22b[_0x30ee('0x69')]=0x1;return this[_0x30ee('0x20d')](_0x29e22b['id'],_0x11ed6f,0x1,_0x29e22b[_0x30ee('0x20e')],_0x29e22b)['then'](function(_0x4bbba6){_0x29e22b[_0x30ee('0x69')]=0x1;if(_0x4bbba6){if(!utils[_0x30ee('0x20f')](_0x4bbba6)){utils[_0x30ee('0x68')](_0x29e22b,0x1,0x0);return hopperUtils['countReScheduled'](_0x29e22b)[_0x30ee('0x3e')](sendMessageReschedule(_0x29e22b))[_0x30ee('0xa1')](loggerCatch(_0x30ee('0x20a')));}else{_0x29e22b[_0x30ee('0x6b')]=utils[_0x30ee('0x6c')]['RUNNING'];if(_[_0x30ee('0xf8')](_0x4bbba6[0x0])||_['isNil'](_0x4bbba6[0x0][_0x30ee('0x17b')])||_['isNil'](_0x4bbba6[0x0][_0x30ee('0x165')])){_0x497fd8['emptyContact'](_0x30ee('0x202'),_0x29e22b,_0x4bbba6[0x0]);}else{return hopperUtils[_0x30ee('0x20b')](_[_0x30ee('0x78')](_0x4bbba6[0x0],[_0x30ee('0xe0'),_0x30ee('0x165')]))[_0x30ee('0x3e')](_0x497fd8[_0x30ee('0x1e8')](_0x29e22b,_0x4bbba6[0x0]))[_0x30ee('0xa1')](_0x497fd8['loggerHandler']('[actionOriginatePredictive]\x20',_0x29e22b));}}}})['catch'](loggerGetContactDialer(_0x30ee('0x210'),_0x29e22b,0x1));};Dialer[_0x30ee('0x18')]['abandonmentRate']=function(_0x58df88,_0x35f70d,_0xe8137b,_0x36c700,_0x11b7c3,_0x5508a3){loggerPredictive['info'](_0x30ee('0x211'));loggerPredictive[_0x30ee('0x48')](_0x30ee('0x212'),_0x58df88);loggerPredictive['info'](_0x30ee('0x213'),_0x35f70d);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x214'),_0xe8137b);loggerPredictive['info']('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',_0x36c700);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x215'),_0x11b7c3);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x53'));return new Promise(function(_0x206193,_0x1ef0f9){if(_0x58df88<=0x0||isNaN(_0x58df88)){return _0x1ef0f9(msgResponse(_0x30ee('0x216'),_0x30ee('0x88'),_0x30ee('0x217')+_0x58df88));}if(_0xe8137b<=0x0||isNaN(_0xe8137b)){return _0x1ef0f9(msgResponse('[abandonmentRate]',_0x30ee('0x88'),'Ts\x20=\x20'+_0xe8137b));}if(_0x36c700<=0x0||isNaN(_0x36c700)){return _0x1ef0f9(msgResponse(_0x30ee('0x216'),_0x30ee('0x88'),_0x30ee('0x218')+_0x36c700));}if(_0x35f70d<=0x0||isNaN(_0x35f70d)){return _0x1ef0f9(msgResponse(_0x30ee('0x216'),_0x30ee('0x88'),_0x30ee('0x219')+_0x35f70d));}if(_0x11b7c3<=0x0||isNaN(_0x11b7c3)){return _0x1ef0f9(msgResponse(_0x30ee('0x216'),_0x30ee('0x88'),_0x30ee('0x21a')+_0x11b7c3));}_0x5508a3=_0x5508a3||0x0;var _0x37d8fa=0x1/_0xe8137b;var _0x3cf173=0x0;var _0x3e188c=0x0;var _0x1606eb=0x0;var _0x1d4d6e=0x0;for(var _0x1af5ac=0x0;_0x1606eb<_0x11b7c3;_0x1af5ac+=0x1){_0x3e188c=_0x1af5ac/_0x35f70d;_0x3cf173=(_0x36c700*_0x3e188c+_0x5508a3)/_0x37d8fa;_0x1606eb=utils['erlangb'](_0x3cf173,_0x58df88);_0x1d4d6e=_0x3cf173/_0x58df88*(0x1-utils['erlangb'](_0x3cf173,_0x58df88));}return _0x206193({'erlangCalls':_0x1af5ac,'erlangCallToSecond':_0x35f70d/_0x1af5ac,'erlangAbandonmentRate':_0x1606eb,'erlangBusyFactor':_0x1d4d6e});});};Dialer['prototype'][_0x30ee('0x1dc')]=function(_0x315a6b,_0x5cdb29,_0x292717,_0xeab091,_0x3080e6,_0x180ef3){loggerPredictive['info'](_0x30ee('0x21b'));loggerPredictive['info'](_0x30ee('0x212'),_0x315a6b);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x213'),_0x5cdb29);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x292717);loggerPredictive[_0x30ee('0x48')](_0x30ee('0x21c'),_0xeab091);loggerPredictive['info'](_0x30ee('0x21d'),_0x3080e6);loggerPredictive['info'](_0x30ee('0x53'));return new Promise(function(_0xa69c78,_0x3776f9){if(_0x315a6b<=0x0||isNaN(_0x315a6b)){return _0x3776f9(msgResponse(_0x30ee('0x21e'),_0x30ee('0x88'),'m\x20=\x20'+_0x315a6b));}if(_0x292717<=0x0||isNaN(_0x292717)){return _0x3776f9(msgResponse(_0x30ee('0x21e'),_0x30ee('0x88'),_0x30ee('0x21f')+_0x292717));}if(_0xeab091<=0x0||isNaN(_0xeab091)){return _0x3776f9(msgResponse(_0x30ee('0x21e'),_0x30ee('0x88'),'p\x20=\x20'+_0xeab091));}if(_0x5cdb29<=0x0||isNaN(_0x5cdb29)){return _0x3776f9(msgResponse(_0x30ee('0x21e'),_0x30ee('0x88'),_0x30ee('0x219')+_0x5cdb29));}if(_0x3080e6<=0x0||isNaN(_0x3080e6)){return _0x3776f9(msgResponse('[busyFactor]','Error',_0x30ee('0x220')+_0x3080e6));}_0x180ef3=_0x180ef3||0x0;var _0x24f8eb=0x1/_0x292717;var _0x296269=0x0;var _0x1bd040=0x0;var _0xe141e1=0x0;var _0x58f974=0x0;for(var _0x4a5c1d=0x0;_0x58f974<_0x3080e6;_0x4a5c1d+=0x1){_0x1bd040=_0x4a5c1d/_0x5cdb29;_0x296269=(_0xeab091*_0x1bd040+_0x180ef3)/_0x24f8eb;_0xe141e1=utils[_0x30ee('0x221')](_0x296269,_0x315a6b);_0x58f974=_0x296269/_0x315a6b*(0x1-utils['erlangb'](_0x296269,_0x315a6b));}return _0xa69c78({'erlangCalls':_0x4a5c1d,'erlangCallToSecond':_0x5cdb29/_0x4a5c1d,'erlangAbandonmentRate':_0xe141e1,'erlangBusyFactor':_0x58f974});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 2ff3313..17ffd2c 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d2c=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','substring','prototype','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','queue','active'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1d2c,0x1eb));var _0xc1d2=function(_0x2c3af9,_0x25670e){_0x2c3af9=_0x2c3af9-0x0;var _0x116814=_0x1d2c[_0x2c3af9];return _0x116814;};'use strict';var util=require(_0xc1d2('0x0'));var _=require('lodash');var moment=require(_0xc1d2('0x1'));function checkNameSurname(_0x2a9c68,_0xf12b07,_0x5bf7b2){var _0x1735b2='';if(!_[_0xc1d2('0x2')](_0xf12b07)&&'string'===typeof _0xf12b07){_0x1735b2+=_0xf12b07;}if(!_[_0xc1d2('0x2')](_0x5bf7b2)&&_0xc1d2('0x3')===typeof _0x5bf7b2){_0x1735b2+='\x20'+_0x5bf7b2;}if(_0x1735b2!==''){return _0x1735b2;}return _0x2a9c68;}function Action(_0x18645d,_0x160f64,_0x2ea76c){this[_0xc1d2('0x4')]=_0x18645d;this[_0xc1d2('0x5')]=_0x2ea76c||undefined;this[_0xc1d2('0x6')]=checkNameSurname(_0x160f64['Contact']['phone'],_0x160f64[_0xc1d2('0x7')][_0xc1d2('0x8')],_0x160f64['Contact'][_0xc1d2('0x9')]);this[_0xc1d2('0xa')]=_0x160f64['phone'];this[_0xc1d2('0xb')]=_0x18645d[_0xc1d2('0x6')];this['active']=_0x160f64[_0xc1d2('0xc')]||![];this['type']=_0x18645d[_0xc1d2('0xd')];this[_0xc1d2('0xe')]=_0x18645d[_0xc1d2('0xe')]||0x3;this[_0xc1d2('0xf')]=_0x160f64[_0xc1d2('0xf')];this[_0xc1d2('0x10')]=_0x160f64[_0xc1d2('0x10')];this[_0xc1d2('0x11')]=_0x160f64[_0xc1d2('0x11')];this['countnoanswerretry']=_0x160f64[_0xc1d2('0x12')];this[_0xc1d2('0x13')]=_0x160f64['countnosuchnumberretry'];this[_0xc1d2('0x14')]=_0x160f64['countdropretry'];this[_0xc1d2('0x15')]=_0x160f64[_0xc1d2('0x15')];this[_0xc1d2('0x16')]=_0x160f64[_0xc1d2('0x16')];this['countagentrejectretry']=_0x160f64['countagentrejectretry'];this[_0xc1d2('0x17')]=_0x160f64[_0xc1d2('0x17')];this['ListId']=_0x160f64[_0xc1d2('0x18')];this[_0xc1d2('0x19')]=_0x160f64[_0xc1d2('0x19')];this[_0xc1d2('0x1a')]=_0x160f64[_0xc1d2('0x1a')];this[_0xc1d2('0x1b')]=_0x160f64['CampaignId'];this[_0xc1d2('0x1c')]=_0x160f64['id'];this[_0xc1d2('0x1d')]=_0x160f64[_0xc1d2('0x7')][_0xc1d2('0x8')]||'';this[_0xc1d2('0x1e')]=moment()[_0xc1d2('0x1f')](_0xc1d2('0x20'));this[_0xc1d2('0x21')]=_0x160f64[_0xc1d2('0x21')];this[_0xc1d2('0x22')]=_0x160f64[_0xc1d2('0x22')];this[_0xc1d2('0x23')]=_0x160f64[_0xc1d2('0x23')];this[_0xc1d2('0x24')]=_0x160f64[_0xc1d2('0x24')];this[_0xc1d2('0x25')]='';this['originatecalleridname']='';}Action['prototype'][_0xc1d2('0x26')]=function(){return util[_0xc1d2('0x1f')](_0xc1d2('0x27'),this[_0xc1d2('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0xc1d2('0x28')](this[_0xc1d2('0x4')]['dialCutDigit']):this[_0xc1d2('0xa')]);};Action[_0xc1d2('0x29')]['getQueue']=function(){return this[_0xc1d2('0xb')];};module['exports']=Action; \ No newline at end of file +var _0x3d91=['countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','util','lodash','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x388826,_0xd23e67){var _0x1173e3=function(_0x1750c6){while(--_0x1750c6){_0x388826['push'](_0x388826['shift']());}};_0x1173e3(++_0xd23e67);}(_0x3d91,0x114));var _0x13d9=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0x3d91[_0x28cddc];return _0x5ce855;};'use strict';var util=require(_0x13d9('0x0'));var _=require(_0x13d9('0x1'));var moment=require('moment');function checkNameSurname(_0xc43f47,_0x13b0af,_0x531314){var _0x51a514='';if(!_[_0x13d9('0x2')](_0x13b0af)&&'string'===typeof _0x13b0af){_0x51a514+=_0x13b0af;}if(!_['isNil'](_0x531314)&&'string'===typeof _0x531314){_0x51a514+='\x20'+_0x531314;}if(_0x51a514!==''){return _0x51a514;}return _0xc43f47;}function Action(_0x578cf3,_0x417da4,_0x235770){this[_0x13d9('0x3')]=_0x578cf3;this[_0x13d9('0x4')]=_0x235770||undefined;this[_0x13d9('0x5')]=checkNameSurname(_0x417da4[_0x13d9('0x6')][_0x13d9('0x7')],_0x417da4[_0x13d9('0x6')][_0x13d9('0x8')],_0x417da4[_0x13d9('0x6')]['lastName']);this[_0x13d9('0x9')]=_0x417da4['phone'];this[_0x13d9('0xa')]=_0x578cf3['name'];this['active']=_0x417da4[_0x13d9('0xb')]||![];this[_0x13d9('0xc')]=_0x578cf3[_0x13d9('0xc')];this[_0x13d9('0xd')]=_0x578cf3[_0x13d9('0xd')]||0x3;this[_0x13d9('0xe')]=_0x417da4[_0x13d9('0xe')];this[_0x13d9('0xf')]=_0x417da4[_0x13d9('0xf')];this[_0x13d9('0x10')]=_0x417da4['countcongestionretry'];this[_0x13d9('0x11')]=_0x417da4[_0x13d9('0x11')];this['countnosuchnumberretry']=_0x417da4[_0x13d9('0x12')];this[_0x13d9('0x13')]=_0x417da4[_0x13d9('0x13')];this['countabandonedretry']=_0x417da4['countabandonedretry'];this[_0x13d9('0x14')]=_0x417da4[_0x13d9('0x14')];this[_0x13d9('0x15')]=_0x417da4['countagentrejectretry'];this[_0x13d9('0x16')]=_0x417da4[_0x13d9('0x16')];this['ListId']=_0x417da4[_0x13d9('0x17')];this[_0x13d9('0x18')]=_0x417da4['UserId'];this[_0x13d9('0x19')]=_0x417da4['VoiceQueueId'];this[_0x13d9('0x1a')]=_0x417da4[_0x13d9('0x1a')];this['idHopper']=_0x417da4['id'];this[_0x13d9('0x1b')]=_0x417da4[_0x13d9('0x6')][_0x13d9('0x8')]||'';this[_0x13d9('0x1c')]=moment()[_0x13d9('0x1d')](_0x13d9('0x1e'));this['callback']=_0x417da4[_0x13d9('0x1f')];this[_0x13d9('0x20')]=_0x417da4[_0x13d9('0x20')];this[_0x13d9('0x21')]=_0x417da4[_0x13d9('0x21')];this['recallme']=_0x417da4['recallme'];this[_0x13d9('0x22')]='';this[_0x13d9('0x23')]='';}Action[_0x13d9('0x24')]['getCaller']=function(){return util[_0x13d9('0x1d')](_0x13d9('0x25'),this[_0x13d9('0x5')],this[_0x13d9('0x3')]['dialCutDigit']>0x0?this[_0x13d9('0x9')][_0x13d9('0x26')](this[_0x13d9('0x3')][_0x13d9('0x27')]):this['number']);};Action[_0x13d9('0x24')][_0x13d9('0x28')]=function(){return this[_0x13d9('0xa')];};module[_0x13d9('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index c4c691d..ae7a6af 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa3ff=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xa3ff,0xe1));var _0xfa3f=function(_0x1679cc,_0x242c53){_0x1679cc=_0x1679cc-0x0;var _0x4aaec8=_0xa3ff[_0x1679cc];return _0x4aaec8;};'use strict';var moment=require(_0xfa3f('0x0'));var utils=require(_0xfa3f('0x1'));function AgentComplete(_0x24e6e5,_0x2edac3){this['state']=0x4;this['statedesc']=_0xfa3f('0x2');this[_0xfa3f('0x3')]=_0x24e6e5[_0xfa3f('0x3')];this[_0xfa3f('0x4')]=_0x24e6e5[_0xfa3f('0x4')];this['campaigntype']=_0x24e6e5[_0xfa3f('0x4')]===_0xfa3f('0x5')?_0xfa3f('0x6'):_0x24e6e5[_0xfa3f('0x4')];this['countbusyretry']=_0x24e6e5[_0xfa3f('0x7')];this[_0xfa3f('0x8')]=_0x24e6e5[_0xfa3f('0x8')];this[_0xfa3f('0x9')]=_0x24e6e5['countnoanswerretry'];this[_0xfa3f('0xa')]=_0x24e6e5[_0xfa3f('0x7')]+_0x24e6e5['countcongestionretry']+_0x24e6e5[_0xfa3f('0x9')]+_0x24e6e5[_0xfa3f('0xb')]+_0x24e6e5['countdropretry']+_0x24e6e5[_0xfa3f('0xc')]+_0x24e6e5[_0xfa3f('0xd')]+_0x24e6e5['countagentrejectretry'];this['countnosuchnumberretry']=_0x24e6e5[_0xfa3f('0xb')];this[_0xfa3f('0xe')]=_0x24e6e5['countdropretry'];this[_0xfa3f('0xc')]=_0x24e6e5[_0xfa3f('0xc')];this[_0xfa3f('0xd')]=_0x24e6e5[_0xfa3f('0xd')];this[_0xfa3f('0xf')]=_0x24e6e5['countagentrejectretry'];this[_0xfa3f('0x10')]=_0x2edac3[_0xfa3f('0x10')];this[_0xfa3f('0x11')]=_0x24e6e5[_0xfa3f('0x12')];this[_0xfa3f('0x13')]=_0x24e6e5['number'];this[_0xfa3f('0x14')]=_0x24e6e5[_0xfa3f('0x14')];this[_0xfa3f('0x15')]=_0x24e6e5[_0xfa3f('0x15')];this[_0xfa3f('0x16')]=_0x24e6e5['answertime'];this[_0xfa3f('0x17')]=moment()[_0xfa3f('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfa3f('0x19')]=utils[_0xfa3f('0x1a')](_0x24e6e5[_0xfa3f('0x15')],_0x24e6e5[_0xfa3f('0x14')]);this[_0xfa3f('0x1b')]=utils[_0xfa3f('0x1a')](_0x24e6e5[_0xfa3f('0x16')],_0x24e6e5[_0xfa3f('0x15')]);this[_0xfa3f('0x1c')]=utils[_0xfa3f('0x1a')](this[_0xfa3f('0x17')],_0x24e6e5['answertime']);this[_0xfa3f('0x6')]=_0x2edac3[_0xfa3f('0x6')];this['membername']=_0x2edac3[_0xfa3f('0x1d')];this[_0xfa3f('0x1e')]=_0x2edac3['reason'];this[_0xfa3f('0x1f')]=_0x24e6e5[_0xfa3f('0x1f')];this[_0xfa3f('0x20')]=_0x24e6e5[_0xfa3f('0x20')];this[_0xfa3f('0x21')]=_0x24e6e5['callbackat'];this[_0xfa3f('0x22')]=_0x24e6e5[_0xfa3f('0x22')];this['ContactId']=_0x24e6e5[_0xfa3f('0x23')];this[_0xfa3f('0x24')]=_0x24e6e5['ListId'];this[_0xfa3f('0x25')]=_0x24e6e5['UserId'];this[_0xfa3f('0x26')]=_0x24e6e5[_0xfa3f('0x26')];this[_0xfa3f('0x27')]=_0x24e6e5['CampaignId'];this[_0xfa3f('0x28')]=_0x24e6e5[_0xfa3f('0x28')]||'';this['originatecalleridname']=_0x24e6e5[_0xfa3f('0x29')]||'';this[_0xfa3f('0x2a')]=_0x24e6e5[_0xfa3f('0x2a')];}module[_0xfa3f('0x2b')]=AgentComplete; \ No newline at end of file +var _0x808b=['reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','getSeconds','endtime','membername'];(function(_0x1a2fab,_0x59ab91){var _0x551460=function(_0x148f1b){while(--_0x148f1b){_0x1a2fab['push'](_0x1a2fab['shift']());}};_0x551460(++_0x59ab91);}(_0x808b,0x1cf));var _0xb808=function(_0x2b7ae8,_0x28947c){_0x2b7ae8=_0x2b7ae8-0x0;var _0x48d4b4=_0x808b[_0x2b7ae8];return _0x48d4b4;};'use strict';var moment=require(_0xb808('0x0'));var utils=require(_0xb808('0x1'));function AgentComplete(_0x40ae58,_0x12e25e){this['state']=0x4;this[_0xb808('0x2')]=_0xb808('0x3');this[_0xb808('0x4')]=_0x40ae58['scheduledat'];this['type']=_0x40ae58[_0xb808('0x5')];this[_0xb808('0x6')]=_0x40ae58[_0xb808('0x5')]==='outbound'?_0xb808('0x7'):_0x40ae58[_0xb808('0x5')];this[_0xb808('0x8')]=_0x40ae58[_0xb808('0x8')];this[_0xb808('0x9')]=_0x40ae58[_0xb808('0x9')];this[_0xb808('0xa')]=_0x40ae58['countnoanswerretry'];this[_0xb808('0xb')]=_0x40ae58[_0xb808('0x8')]+_0x40ae58[_0xb808('0x9')]+_0x40ae58[_0xb808('0xa')]+_0x40ae58[_0xb808('0xc')]+_0x40ae58[_0xb808('0xd')]+_0x40ae58[_0xb808('0xe')]+_0x40ae58[_0xb808('0xf')]+_0x40ae58[_0xb808('0x10')];this[_0xb808('0xc')]=_0x40ae58[_0xb808('0xc')];this[_0xb808('0xd')]=_0x40ae58[_0xb808('0xd')];this['countabandonedretry']=_0x40ae58[_0xb808('0xe')];this[_0xb808('0xf')]=_0x40ae58['countmachineretry'];this[_0xb808('0x10')]=_0x40ae58[_0xb808('0x10')];this['uniqueid']=_0x12e25e[_0xb808('0x11')];this[_0xb808('0x12')]=_0x40ae58[_0xb808('0x13')];this['calleridnum']=_0x40ae58['number'];this['starttime']=_0x40ae58['starttime'];this[_0xb808('0x14')]=_0x40ae58[_0xb808('0x14')];this[_0xb808('0x15')]=_0x40ae58[_0xb808('0x15')];this['endtime']=moment()['format'](_0xb808('0x16'));this[_0xb808('0x17')]=utils['getSeconds'](_0x40ae58[_0xb808('0x14')],_0x40ae58[_0xb808('0x18')]);this[_0xb808('0x19')]=utils[_0xb808('0x1a')](_0x40ae58[_0xb808('0x15')],_0x40ae58['responsetime']);this['talktime']=utils[_0xb808('0x1a')](this[_0xb808('0x1b')],_0x40ae58[_0xb808('0x15')]);this[_0xb808('0x7')]=_0x12e25e['queue'];this[_0xb808('0x1c')]=_0x12e25e[_0xb808('0x1c')];this['reason']=_0x12e25e[_0xb808('0x1d')];this['callback']=_0x40ae58['callback'];this['callbackuniqueid']=_0x40ae58[_0xb808('0x1e')];this[_0xb808('0x1f')]=_0x40ae58[_0xb808('0x1f')];this[_0xb808('0x20')]=_0x40ae58[_0xb808('0x20')];this[_0xb808('0x21')]=_0x40ae58[_0xb808('0x21')];this[_0xb808('0x22')]=_0x40ae58['ListId'];this['UserId']=_0x40ae58['UserId'];this[_0xb808('0x23')]=_0x40ae58[_0xb808('0x23')];this[_0xb808('0x24')]=_0x40ae58[_0xb808('0x24')];this[_0xb808('0x25')]=_0x40ae58[_0xb808('0x25')]||'';this['originatecalleridname']=_0x40ae58[_0xb808('0x26')]||'';this[_0xb808('0x27')]=_0x40ae58[_0xb808('0x27')];}module[_0xb808('0x28')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index f04564e..0b74db6 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fb8=['calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname'];(function(_0x893bcf,_0x51ad91){var _0x3bdba3=function(_0x204a39){while(--_0x204a39){_0x893bcf['push'](_0x893bcf['shift']());}};_0x3bdba3(++_0x51ad91);}(_0x4fb8,0x189));var _0x84fb=function(_0xe581e,_0x173ef7){_0xe581e=_0xe581e-0x0;var _0x16b99d=_0x4fb8[_0xe581e];return _0x16b99d;};'use strict';function Final(_0x3a2013){this[_0x84fb('0x0')]=_0x3a2013[_0x84fb('0x0')];this[_0x84fb('0x1')]=_0x3a2013[_0x84fb('0x1')];this[_0x84fb('0x2')]=_0x3a2013[_0x84fb('0x2')];this['campaigntype']=_0x3a2013[_0x84fb('0x2')]===_0x84fb('0x3')?_0x84fb('0x4'):_0x3a2013[_0x84fb('0x2')];this[_0x84fb('0x5')]=_0x3a2013['countbusyretry'];this['countcongestionretry']=_0x3a2013[_0x84fb('0x6')];this['countnoanswerretry']=_0x3a2013['countnoanswerretry'];this[_0x84fb('0x7')]=_0x3a2013[_0x84fb('0x5')]+_0x3a2013[_0x84fb('0x6')]+_0x3a2013[_0x84fb('0x8')]+_0x3a2013[_0x84fb('0x9')]+_0x3a2013[_0x84fb('0xa')]+_0x3a2013[_0x84fb('0xb')]+_0x3a2013[_0x84fb('0xc')]+_0x3a2013[_0x84fb('0xd')];this['countnosuchnumberretry']=_0x3a2013[_0x84fb('0x9')];this[_0x84fb('0xa')]=_0x3a2013['countdropretry'];this[_0x84fb('0xb')]=_0x3a2013['countabandonedretry'];this[_0x84fb('0xc')]=_0x3a2013[_0x84fb('0xc')];this[_0x84fb('0xd')]=_0x3a2013[_0x84fb('0xd')];this['queue']=_0x3a2013[_0x84fb('0x4')];this[_0x84fb('0xe')]=_0x3a2013[_0x84fb('0xe')];this[_0x84fb('0xf')]=_0x3a2013['calleridnum'];this[_0x84fb('0x10')]=_0x3a2013[_0x84fb('0x10')];this[_0x84fb('0x11')]=_0x3a2013[_0x84fb('0x11')];this['endtime']=_0x3a2013[_0x84fb('0x11')];this[_0x84fb('0x12')]=_0x3a2013['ringtime']||0x0;this[_0x84fb('0x13')]=_0x3a2013['holdtime']||0x0;this[_0x84fb('0x14')]=_0x3a2013[_0x84fb('0x14')]||0x0;this['callback']=_0x3a2013['callback'];this[_0x84fb('0x15')]=_0x3a2013[_0x84fb('0x15')];this[_0x84fb('0x16')]=_0x3a2013[_0x84fb('0x16')];this[_0x84fb('0x17')]=_0x3a2013['recallme'];this[_0x84fb('0x18')]=_0x3a2013['ContactId'];this[_0x84fb('0x19')]=_0x3a2013[_0x84fb('0x19')];this[_0x84fb('0x1a')]=_0x3a2013[_0x84fb('0x1a')];this[_0x84fb('0x1b')]=_0x3a2013[_0x84fb('0x1b')];this[_0x84fb('0x1c')]=_0x3a2013['CampaignId'];this[_0x84fb('0x1d')]=_0x3a2013['originatecalleridnum']||'';this['originatecalleridname']=_0x3a2013[_0x84fb('0x1e')]||'';this[_0x84fb('0x1f')]=_0x3a2013[_0x84fb('0x1f')];this[_0x84fb('0x20')]=_0x3a2013[_0x84fb('0x20')];}module[_0x84fb('0x21')]=Final; \ No newline at end of file +var _0x4a0f=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4a0753,_0x20cd48){var _0x195dbc=function(_0x5da949){while(--_0x5da949){_0x4a0753['push'](_0x4a0753['shift']());}};_0x195dbc(++_0x20cd48);}(_0x4a0f,0x143));var _0xf4a0=function(_0x2768d5,_0x577824){_0x2768d5=_0x2768d5-0x0;var _0x2c1e5c=_0x4a0f[_0x2768d5];return _0x2c1e5c;};'use strict';function Final(_0x307640){this[_0xf4a0('0x0')]=_0x307640['uniqueid'];this[_0xf4a0('0x1')]=_0x307640['scheduledat'];this[_0xf4a0('0x2')]=_0x307640[_0xf4a0('0x2')];this[_0xf4a0('0x3')]=_0x307640[_0xf4a0('0x2')]==='outbound'?'queue':_0x307640[_0xf4a0('0x2')];this['countbusyretry']=_0x307640[_0xf4a0('0x4')];this[_0xf4a0('0x5')]=_0x307640[_0xf4a0('0x5')];this[_0xf4a0('0x6')]=_0x307640['countnoanswerretry'];this[_0xf4a0('0x7')]=_0x307640[_0xf4a0('0x4')]+_0x307640[_0xf4a0('0x5')]+_0x307640[_0xf4a0('0x6')]+_0x307640[_0xf4a0('0x8')]+_0x307640[_0xf4a0('0x9')]+_0x307640['countabandonedretry']+_0x307640[_0xf4a0('0xa')]+_0x307640[_0xf4a0('0xb')];this[_0xf4a0('0x8')]=_0x307640[_0xf4a0('0x8')];this[_0xf4a0('0x9')]=_0x307640[_0xf4a0('0x9')];this[_0xf4a0('0xc')]=_0x307640[_0xf4a0('0xc')];this[_0xf4a0('0xa')]=_0x307640['countmachineretry'];this[_0xf4a0('0xb')]=_0x307640['countagentrejectretry'];this[_0xf4a0('0xd')]=_0x307640[_0xf4a0('0xd')];this[_0xf4a0('0xe')]=_0x307640[_0xf4a0('0xe')];this[_0xf4a0('0xf')]=_0x307640[_0xf4a0('0xf')];this['starttime']=_0x307640[_0xf4a0('0x10')];this['responsetime']=_0x307640[_0xf4a0('0x11')];this['endtime']=_0x307640[_0xf4a0('0x11')];this[_0xf4a0('0x12')]=_0x307640[_0xf4a0('0x12')]||0x0;this[_0xf4a0('0x13')]=_0x307640[_0xf4a0('0x13')]||0x0;this[_0xf4a0('0x14')]=_0x307640[_0xf4a0('0x14')]||0x0;this[_0xf4a0('0x15')]=_0x307640[_0xf4a0('0x15')];this['callbackuniqueid']=_0x307640[_0xf4a0('0x16')];this[_0xf4a0('0x17')]=_0x307640[_0xf4a0('0x17')];this[_0xf4a0('0x18')]=_0x307640[_0xf4a0('0x18')];this['ContactId']=_0x307640['ContactId'];this[_0xf4a0('0x19')]=_0x307640[_0xf4a0('0x19')];this[_0xf4a0('0x1a')]=_0x307640[_0xf4a0('0x1a')];this[_0xf4a0('0x1b')]=_0x307640['VoiceQueueId'];this[_0xf4a0('0x1c')]=_0x307640[_0xf4a0('0x1c')];this[_0xf4a0('0x1d')]=_0x307640[_0xf4a0('0x1d')]||'';this[_0xf4a0('0x1e')]=_0x307640['originatecalleridname']||'';this[_0xf4a0('0x1f')]=_0x307640['state'];this['statedesc']=_0x307640['statedesc'];}module[_0xf4a0('0x20')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index af8e008..beee6c5 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3942=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','../utils','state','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','membername','reason'];(function(_0x259304,_0x147806){var _0x235bee=function(_0x40d03e){while(--_0x40d03e){_0x259304['push'](_0x259304['shift']());}};_0x235bee(++_0x147806);}(_0x3942,0x1ac));var _0x2394=function(_0xb3ba00,_0x417915){_0xb3ba00=_0xb3ba00-0x0;var _0x1edb30=_0x3942[_0xb3ba00];return _0x1edb30;};'use strict';var moment=require('moment');var utils=require(_0x2394('0x0'));function Hangup(_0x18305d,_0x640cdc){this[_0x2394('0x1')]=0x4;this['statedesc']='Answer';this[_0x2394('0x2')]=_0x18305d[_0x2394('0x2')];this['type']=_0x18305d[_0x2394('0x3')];this[_0x2394('0x4')]=_0x18305d[_0x2394('0x3')]==='outbound'?_0x2394('0x5'):_0x18305d['type'];this[_0x2394('0x6')]=_0x18305d['amd']||![];this[_0x2394('0x7')]=_0x18305d[_0x2394('0x7')];this['countcongestionretry']=_0x18305d[_0x2394('0x8')];this[_0x2394('0x9')]=_0x18305d['countnoanswerretry'];this[_0x2394('0xa')]=_0x18305d[_0x2394('0x7')]+_0x18305d[_0x2394('0x8')]+_0x18305d[_0x2394('0x9')]+_0x18305d['countnosuchnumberretry']+_0x18305d[_0x2394('0xb')]+_0x18305d['countabandonedretry']+_0x18305d['countmachineretry']+_0x18305d[_0x2394('0xc')];this['countnosuchnumberretry']=_0x18305d[_0x2394('0xd')];this[_0x2394('0xb')]=_0x18305d[_0x2394('0xb')];this['countabandonedretry']=_0x18305d['countabandonedretry'];this['countmachineretry']=_0x18305d[_0x2394('0xe')];this[_0x2394('0xc')]=_0x18305d['countagentrejectretry'];this[_0x2394('0xf')]=_0x640cdc[_0x2394('0xf')];this[_0x2394('0x10')]=_0x18305d[_0x2394('0x11')];this[_0x2394('0x12')]=_0x18305d['number'];this[_0x2394('0x13')]=_0x18305d[_0x2394('0x13')];this[_0x2394('0x14')]=_0x18305d[_0x2394('0x14')];this[_0x2394('0x15')]=moment()[_0x2394('0x16')](_0x2394('0x17'));this['ringtime']=utils[_0x2394('0x18')](_0x18305d[_0x2394('0x14')],_0x18305d[_0x2394('0x13')]);this[_0x2394('0x19')]=0x0;this['talktime']=utils['getSeconds'](this[_0x2394('0x15')],_0x18305d['responsetime']);this[_0x2394('0x5')]=_0x18305d[_0x2394('0x5')];this[_0x2394('0x1a')]='IVR';this[_0x2394('0x1b')]=_0x640cdc[_0x2394('0x1c')];this[_0x2394('0x1d')]=_0x18305d[_0x2394('0x1d')];this[_0x2394('0x1e')]=_0x18305d[_0x2394('0x1e')];this[_0x2394('0x1f')]=_0x18305d[_0x2394('0x1f')];this[_0x2394('0x20')]=_0x18305d[_0x2394('0x20')];this[_0x2394('0x21')]=_0x18305d[_0x2394('0x21')];this[_0x2394('0x22')]=_0x18305d[_0x2394('0x22')];this[_0x2394('0x23')]=_0x18305d[_0x2394('0x23')];this[_0x2394('0x24')]=_0x18305d[_0x2394('0x24')];this['CampaignId']=_0x18305d['CampaignId'];}module[_0x2394('0x25')]=Hangup; \ No newline at end of file +var _0x8d45=['queue','amd','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','../utils','statedesc','Answer','scheduledat','campaigntype','type','outbound'];(function(_0x51df5d,_0x467e28){var _0x1baff0=function(_0x2e64d1){while(--_0x2e64d1){_0x51df5d['push'](_0x51df5d['shift']());}};_0x1baff0(++_0x467e28);}(_0x8d45,0x151));var _0x58d4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8d45[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require('moment');var utils=require(_0x58d4('0x0'));function Hangup(_0x156538,_0x439f9e){this['state']=0x4;this[_0x58d4('0x1')]=_0x58d4('0x2');this[_0x58d4('0x3')]=_0x156538[_0x58d4('0x3')];this['type']=_0x156538['type'];this[_0x58d4('0x4')]=_0x156538[_0x58d4('0x5')]===_0x58d4('0x6')?_0x58d4('0x7'):_0x156538[_0x58d4('0x5')];this['amd']=_0x156538[_0x58d4('0x8')]||![];this['countbusyretry']=_0x156538[_0x58d4('0x9')];this[_0x58d4('0xa')]=_0x156538[_0x58d4('0xa')];this['countnoanswerretry']=_0x156538['countnoanswerretry'];this[_0x58d4('0xb')]=_0x156538[_0x58d4('0x9')]+_0x156538['countcongestionretry']+_0x156538[_0x58d4('0xc')]+_0x156538['countnosuchnumberretry']+_0x156538['countdropretry']+_0x156538[_0x58d4('0xd')]+_0x156538[_0x58d4('0xe')]+_0x156538['countagentrejectretry'];this[_0x58d4('0xf')]=_0x156538[_0x58d4('0xf')];this[_0x58d4('0x10')]=_0x156538[_0x58d4('0x10')];this[_0x58d4('0xd')]=_0x156538[_0x58d4('0xd')];this[_0x58d4('0xe')]=_0x156538[_0x58d4('0xe')];this[_0x58d4('0x11')]=_0x156538['countagentrejectretry'];this['uniqueid']=_0x439f9e['uniqueid'];this[_0x58d4('0x12')]=_0x156538[_0x58d4('0x13')];this[_0x58d4('0x14')]=_0x156538['number'];this[_0x58d4('0x15')]=_0x156538[_0x58d4('0x15')];this['responsetime']=_0x156538[_0x58d4('0x16')];this[_0x58d4('0x17')]=moment()[_0x58d4('0x18')](_0x58d4('0x19'));this[_0x58d4('0x1a')]=utils[_0x58d4('0x1b')](_0x156538[_0x58d4('0x16')],_0x156538['starttime']);this[_0x58d4('0x1c')]=0x0;this[_0x58d4('0x1d')]=utils['getSeconds'](this[_0x58d4('0x17')],_0x156538[_0x58d4('0x16')]);this[_0x58d4('0x7')]=_0x156538[_0x58d4('0x7')];this[_0x58d4('0x1e')]=_0x58d4('0x1f');this[_0x58d4('0x20')]=_0x439f9e[_0x58d4('0x21')];this[_0x58d4('0x22')]=_0x156538['callback'];this[_0x58d4('0x23')]=_0x156538[_0x58d4('0x23')];this[_0x58d4('0x24')]=_0x156538[_0x58d4('0x24')];this[_0x58d4('0x25')]=_0x156538[_0x58d4('0x25')];this['ContactId']=_0x156538[_0x58d4('0x26')];this[_0x58d4('0x27')]=_0x156538['ListId'];this['UserId']=_0x156538['UserId'];this[_0x58d4('0x28')]=_0x156538[_0x58d4('0x28')];this[_0x58d4('0x29')]=_0x156538['CampaignId'];}module[_0x58d4('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index e89f7b0..f33a195 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88f9=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','number','starttime','endtime','responsetime','getSeconds','holdtime'];(function(_0x3fa641,_0xb75894){var _0x393fb5=function(_0x33f6a4){while(--_0x33f6a4){_0x3fa641['push'](_0x3fa641['shift']());}};_0x393fb5(++_0xb75894);}(_0x88f9,0x1cb));var _0x988f=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x88f9[_0x56756b];return _0xa3002;};'use strict';var utils=require(_0x988f('0x0'));function History(_0x30b678){this[_0x988f('0x1')]=_0x30b678[_0x988f('0x1')];this['scheduledat']=_0x30b678[_0x988f('0x2')]||undefined;this[_0x988f('0x3')]=_0x30b678[_0x988f('0x3')];this[_0x988f('0x4')]=_0x30b678[_0x988f('0x3')]===_0x988f('0x5')?_0x988f('0x6'):_0x30b678['type'];this[_0x988f('0x7')]=_0x30b678['countbusyretry'];this[_0x988f('0x8')]=_0x30b678['countcongestionretry'];this[_0x988f('0x9')]=_0x30b678[_0x988f('0x9')];this[_0x988f('0xa')]=_0x30b678[_0x988f('0x7')]+_0x30b678['countcongestionretry']+_0x30b678[_0x988f('0x9')]+_0x30b678[_0x988f('0xb')]+_0x30b678['countdropretry']+_0x30b678['countabandonedretry']+_0x30b678[_0x988f('0xc')]+_0x30b678[_0x988f('0xd')];this[_0x988f('0xb')]=_0x30b678[_0x988f('0xb')];this[_0x988f('0xe')]=_0x30b678[_0x988f('0xe')];this['countabandonedretry']=_0x30b678['countabandonedretry'];this['countmachineretry']=_0x30b678[_0x988f('0xc')];this['countagentrejectretry']=_0x30b678[_0x988f('0xd')];this[_0x988f('0x6')]=_0x30b678[_0x988f('0x6')];this[_0x988f('0xf')]=_0x30b678['name'];this['calleridnum']=_0x30b678[_0x988f('0x10')];this['starttime']=_0x30b678[_0x988f('0x11')];this['responsetime']=_0x30b678['responsetime'];this[_0x988f('0x12')]=_0x30b678[_0x988f('0x13')];this['ringtime']=utils[_0x988f('0x14')](_0x30b678[_0x988f('0x13')],_0x30b678['starttime']);this[_0x988f('0x15')]=0x0;this[_0x988f('0x16')]=0x0;this[_0x988f('0x17')]=_0x30b678[_0x988f('0x17')];this[_0x988f('0x18')]=_0x30b678[_0x988f('0x18')];this[_0x988f('0x19')]=_0x30b678[_0x988f('0x19')];this[_0x988f('0x1a')]=_0x30b678[_0x988f('0x1a')];this[_0x988f('0x1b')]=_0x30b678[_0x988f('0x1b')];this[_0x988f('0x1c')]=_0x30b678[_0x988f('0x1c')];this[_0x988f('0x1d')]=_0x30b678[_0x988f('0x1d')];this[_0x988f('0x1e')]=_0x30b678[_0x988f('0x1e')];this[_0x988f('0x1f')]=_0x30b678[_0x988f('0x1f')];this[_0x988f('0x20')]=_0x30b678['originatecalleridnum']||'';this[_0x988f('0x21')]=_0x30b678[_0x988f('0x21')]||'';this[_0x988f('0x22')]=_0x30b678['state'];this[_0x988f('0x23')]=_0x30b678[_0x988f('0x23')];}module[_0x988f('0x24')]=History; \ No newline at end of file +var _0xd830=['CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x279eda,_0x1ffd83){var _0x50a839=function(_0x49047d){while(--_0x49047d){_0x279eda['push'](_0x279eda['shift']());}};_0x50a839(++_0x1ffd83);}(_0xd830,0xe4));var _0x0d83=function(_0x12d4c6,_0x258c28){_0x12d4c6=_0x12d4c6-0x0;var _0x5dc285=_0xd830[_0x12d4c6];return _0x5dc285;};'use strict';var utils=require(_0x0d83('0x0'));function History(_0x1d6561){this['uniqueid']=_0x1d6561[_0x0d83('0x1')];this[_0x0d83('0x2')]=_0x1d6561[_0x0d83('0x2')]||undefined;this[_0x0d83('0x3')]=_0x1d6561[_0x0d83('0x3')];this[_0x0d83('0x4')]=_0x1d6561[_0x0d83('0x3')]===_0x0d83('0x5')?'queue':_0x1d6561[_0x0d83('0x3')];this[_0x0d83('0x6')]=_0x1d6561[_0x0d83('0x6')];this[_0x0d83('0x7')]=_0x1d6561[_0x0d83('0x7')];this[_0x0d83('0x8')]=_0x1d6561[_0x0d83('0x8')];this[_0x0d83('0x9')]=_0x1d6561[_0x0d83('0x6')]+_0x1d6561['countcongestionretry']+_0x1d6561[_0x0d83('0x8')]+_0x1d6561[_0x0d83('0xa')]+_0x1d6561[_0x0d83('0xb')]+_0x1d6561[_0x0d83('0xc')]+_0x1d6561[_0x0d83('0xd')]+_0x1d6561[_0x0d83('0xe')];this['countnosuchnumberretry']=_0x1d6561[_0x0d83('0xa')];this[_0x0d83('0xb')]=_0x1d6561[_0x0d83('0xb')];this[_0x0d83('0xc')]=_0x1d6561['countabandonedretry'];this[_0x0d83('0xd')]=_0x1d6561[_0x0d83('0xd')];this[_0x0d83('0xe')]=_0x1d6561[_0x0d83('0xe')];this[_0x0d83('0xf')]=_0x1d6561['queue'];this[_0x0d83('0x10')]=_0x1d6561['name'];this[_0x0d83('0x11')]=_0x1d6561['number'];this['starttime']=_0x1d6561[_0x0d83('0x12')];this['responsetime']=_0x1d6561[_0x0d83('0x13')];this[_0x0d83('0x14')]=_0x1d6561[_0x0d83('0x13')];this['ringtime']=utils[_0x0d83('0x15')](_0x1d6561[_0x0d83('0x13')],_0x1d6561[_0x0d83('0x12')]);this['holdtime']=0x0;this[_0x0d83('0x16')]=0x0;this[_0x0d83('0x17')]=_0x1d6561[_0x0d83('0x17')];this[_0x0d83('0x18')]=_0x1d6561['callbackuniqueid'];this['callbackat']=_0x1d6561[_0x0d83('0x19')];this[_0x0d83('0x1a')]=_0x1d6561['recallme'];this[_0x0d83('0x1b')]=_0x1d6561[_0x0d83('0x1b')];this[_0x0d83('0x1c')]=_0x1d6561[_0x0d83('0x1c')];this[_0x0d83('0x1d')]=_0x1d6561[_0x0d83('0x1d')];this['VoiceQueueId']=_0x1d6561[_0x0d83('0x1e')];this[_0x0d83('0x1f')]=_0x1d6561[_0x0d83('0x1f')];this['originatecalleridnum']=_0x1d6561[_0x0d83('0x20')]||'';this[_0x0d83('0x21')]=_0x1d6561[_0x0d83('0x21')]||'';this[_0x0d83('0x22')]=_0x1d6561[_0x0d83('0x22')];this[_0x0d83('0x23')]=_0x1d6561[_0x0d83('0x23')];}module[_0x0d83('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 1427069..ad8e319 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a1b=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid'];(function(_0x279015,_0xf80944){var _0x23b8db=function(_0x6fbbdf){while(--_0x6fbbdf){_0x279015['push'](_0x279015['shift']());}};_0x23b8db(++_0xf80944);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x5aca9c,_0x5af286){_0x5aca9c=_0x5aca9c-0x0;var _0x29d316=_0x9a1b[_0x5aca9c];return _0x29d316;};'use strict';var utils=require(_0xb9a1('0x0'));function QueueCallerAbandon(_0x4a0e2e,_0x592bbe){this['scheduledat']=_0x4a0e2e[_0xb9a1('0x1')];this[_0xb9a1('0x2')]=_0x4a0e2e[_0xb9a1('0x2')];this[_0xb9a1('0x3')]=_0x4a0e2e['type']===_0xb9a1('0x4')?_0xb9a1('0x5'):_0x4a0e2e['type'];this[_0xb9a1('0x6')]=_0x4a0e2e[_0xb9a1('0x6')];this[_0xb9a1('0x7')]=_0x4a0e2e['countcongestionretry'];this[_0xb9a1('0x8')]=_0x4a0e2e[_0xb9a1('0x8')];this[_0xb9a1('0x9')]=_0x4a0e2e[_0xb9a1('0x6')]+_0x4a0e2e[_0xb9a1('0x7')]+_0x4a0e2e['countnoanswerretry']+_0x4a0e2e['countnosuchnumberretry']+_0x4a0e2e[_0xb9a1('0xa')]+_0x4a0e2e[_0xb9a1('0xb')]+_0x4a0e2e[_0xb9a1('0xc')]+_0x4a0e2e[_0xb9a1('0xd')];this[_0xb9a1('0xe')]=_0x4a0e2e[_0xb9a1('0xe')];this[_0xb9a1('0xa')]=_0x4a0e2e[_0xb9a1('0xa')];this['countabandonedretry']=_0x4a0e2e['countabandonedretry'];this[_0xb9a1('0xc')]=_0x4a0e2e[_0xb9a1('0xc')];this['countagentrejectretry']=_0x4a0e2e[_0xb9a1('0xd')];this['uniqueid']=_0x592bbe[_0xb9a1('0xf')];this[_0xb9a1('0x10')]=_0x4a0e2e[_0xb9a1('0x11')];this['calleridnum']=_0x4a0e2e[_0xb9a1('0x12')];this[_0xb9a1('0x13')]=_0x4a0e2e[_0xb9a1('0x13')];this['responsetime']=_0x4a0e2e[_0xb9a1('0x14')];this[_0xb9a1('0x15')]=_0x4a0e2e[_0xb9a1('0x15')];this['dropreason']=_0x4a0e2e[_0xb9a1('0x16')];this[_0xb9a1('0x17')]=this['droptime'];this[_0xb9a1('0x18')]=utils[_0xb9a1('0x19')](_0x4a0e2e['responsetime'],_0x4a0e2e[_0xb9a1('0x13')]);this[_0xb9a1('0x1a')]=utils[_0xb9a1('0x19')](this[_0xb9a1('0x15')],_0x4a0e2e['responsetime']);this['talktime']=0x0;this['queue']=_0x592bbe[_0xb9a1('0x5')];this[_0xb9a1('0x1b')]=_0x592bbe['connectedlinename'];this['reason']=_0x592bbe[_0xb9a1('0x1c')];this[_0xb9a1('0x1d')]=_0x4a0e2e['callback'];this[_0xb9a1('0x1e')]=_0x4a0e2e[_0xb9a1('0x1e')];this[_0xb9a1('0x1f')]=_0x4a0e2e[_0xb9a1('0x1f')];this[_0xb9a1('0x20')]=_0x4a0e2e['recallme'];this['ContactId']=_0x4a0e2e[_0xb9a1('0x21')];this[_0xb9a1('0x22')]=_0x4a0e2e[_0xb9a1('0x22')];this[_0xb9a1('0x23')]=_0x4a0e2e[_0xb9a1('0x23')];this['VoiceQueueId']=_0x4a0e2e[_0xb9a1('0x24')];this[_0xb9a1('0x25')]=_0x4a0e2e['CampaignId'];this[_0xb9a1('0x26')]=_0x4a0e2e[_0xb9a1('0x26')]||'';this[_0xb9a1('0x27')]=_0x4a0e2e[_0xb9a1('0x27')]||'';this[_0xb9a1('0x28')]=_0x4a0e2e[_0xb9a1('0x28')];this[_0xb9a1('0x29')]=_0x4a0e2e[_0xb9a1('0x29')];this['statedesc']=_0x4a0e2e['statedesc'];}module[_0xb9a1('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xf854=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xf854,0x1c3));var _0x4f85=function(_0x1cb29e,_0x214231){_0x1cb29e=_0x1cb29e-0x0;var _0x18fc32=_0xf854[_0x1cb29e];return _0x18fc32;};'use strict';var utils=require(_0x4f85('0x0'));function QueueCallerAbandon(_0x55a91f,_0xc01a1b){this[_0x4f85('0x1')]=_0x55a91f[_0x4f85('0x1')];this[_0x4f85('0x2')]=_0x55a91f[_0x4f85('0x2')];this[_0x4f85('0x3')]=_0x55a91f['type']===_0x4f85('0x4')?_0x4f85('0x5'):_0x55a91f[_0x4f85('0x2')];this[_0x4f85('0x6')]=_0x55a91f[_0x4f85('0x6')];this['countcongestionretry']=_0x55a91f['countcongestionretry'];this[_0x4f85('0x7')]=_0x55a91f['countnoanswerretry'];this['countglobal']=_0x55a91f[_0x4f85('0x6')]+_0x55a91f[_0x4f85('0x8')]+_0x55a91f[_0x4f85('0x7')]+_0x55a91f[_0x4f85('0x9')]+_0x55a91f['countdropretry']+_0x55a91f[_0x4f85('0xa')]+_0x55a91f[_0x4f85('0xb')]+_0x55a91f[_0x4f85('0xc')];this['countnosuchnumberretry']=_0x55a91f['countnosuchnumberretry'];this['countdropretry']=_0x55a91f[_0x4f85('0xd')];this[_0x4f85('0xa')]=_0x55a91f[_0x4f85('0xa')];this['countmachineretry']=_0x55a91f['countmachineretry'];this[_0x4f85('0xc')]=_0x55a91f['countagentrejectretry'];this[_0x4f85('0xe')]=_0xc01a1b['uniqueid'];this[_0x4f85('0xf')]=_0x55a91f[_0x4f85('0x10')];this['calleridnum']=_0x55a91f[_0x4f85('0x11')];this[_0x4f85('0x12')]=_0x55a91f[_0x4f85('0x12')];this[_0x4f85('0x13')]=_0x55a91f[_0x4f85('0x13')];this[_0x4f85('0x14')]=_0x55a91f[_0x4f85('0x14')];this[_0x4f85('0x15')]=_0x55a91f[_0x4f85('0x15')];this['endtime']=this[_0x4f85('0x14')];this['ringtime']=utils['getSeconds'](_0x55a91f[_0x4f85('0x13')],_0x55a91f[_0x4f85('0x12')]);this['holdtime']=utils['getSeconds'](this[_0x4f85('0x14')],_0x55a91f[_0x4f85('0x13')]);this[_0x4f85('0x16')]=0x0;this[_0x4f85('0x5')]=_0xc01a1b[_0x4f85('0x5')];this[_0x4f85('0x17')]=_0xc01a1b[_0x4f85('0x18')];this['reason']=_0xc01a1b[_0x4f85('0x19')];this[_0x4f85('0x1a')]=_0x55a91f[_0x4f85('0x1a')];this[_0x4f85('0x1b')]=_0x55a91f[_0x4f85('0x1b')];this['callbackat']=_0x55a91f[_0x4f85('0x1c')];this[_0x4f85('0x1d')]=_0x55a91f[_0x4f85('0x1d')];this[_0x4f85('0x1e')]=_0x55a91f[_0x4f85('0x1e')];this[_0x4f85('0x1f')]=_0x55a91f[_0x4f85('0x1f')];this[_0x4f85('0x20')]=_0x55a91f[_0x4f85('0x20')];this['VoiceQueueId']=_0x55a91f[_0x4f85('0x21')];this[_0x4f85('0x22')]=_0x55a91f[_0x4f85('0x22')];this['originatecalleridnum']=_0x55a91f['originatecalleridnum']||'';this[_0x4f85('0x23')]=_0x55a91f['originatecalleridname']||'';this[_0x4f85('0x24')]=_0x55a91f[_0x4f85('0x24')];this[_0x4f85('0x25')]=_0x55a91f[_0x4f85('0x25')];this[_0x4f85('0x26')]=_0x55a91f['statedesc'];}module[_0x4f85('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index a515393..5c796f3 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d04=['[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','getContactDialer','error','[getContactDialer]','catch','[getContactDialerIvr]','getContactDialerIvr','[countReScheduled]','countReScheduled','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones'];(function(_0x57c380,_0x4cdaae){var _0x201cbf=function(_0x792e4f){while(--_0x792e4f){_0x57c380['push'](_0x57c380['shift']());}};_0x201cbf(++_0x4cdaae);}(_0x3d04,0xbe));var _0x43d0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3d04[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x43d0('0x0'));var logger=require(_0x43d0('0x1'))(_0x43d0('0x2'));var cmHopper=require(_0x43d0('0x3'));var cmHopperAdditionalPhone=require(_0x43d0('0x4'));var cmHopperBlack=require(_0x43d0('0x5'));var cmHopperHistory=require(_0x43d0('0x6'));function inspectError(_0x1f80fd){return util['inspect'](_0x1f80fd,{'showHidden':![],'depth':null});}function getContactDialer(_0x2a4d4c,_0x1a75d4,_0x746f5e){return cmHopper[_0x43d0('0x7')](_0x2a4d4c['id'],_0x1a75d4,_0x746f5e,_0x2a4d4c['dialOrderByScheduledAt'])['catch'](function(_0x50919e){_0x2a4d4c['temp']=0x0;logger[_0x43d0('0x8')](_0x43d0('0x9'),inspectError(_0x50919e));});}exports[_0x43d0('0x7')]=getContactDialer;function getContactDialerIvr(_0x46e560,_0x44a763){return cmHopper['getContactDialerIvr'](_0x46e560['id'],_0x44a763,_0x46e560['dialOrderByScheduledAt'])[_0x43d0('0xa')](function(_0x54885c){_0x46e560['temp']=0x0;logger[_0x43d0('0x8')](_0x43d0('0xb'),inspectError(_0x54885c));});}exports[_0x43d0('0xc')]=getContactDialerIvr;function countReScheduled(_0x375174){return cmHopper['countReScheduled'](_0x375174)[_0x43d0('0xa')](function(_0x23daaa){logger['error'](_0x43d0('0xd'),inspectError(_0x23daaa));});}exports[_0x43d0('0xe')]=countReScheduled;function rescheduleContact(_0x1b4f09){return cmHopper['rescheduleContact'](_0x1b4f09)[_0x43d0('0xa')](function(_0x2454fa){logger[_0x43d0('0x8')]('[rescheduleContact]',inspectError(_0x2454fa));});}exports[_0x43d0('0xf')]=rescheduleContact;function unlockContact(_0x357f87,_0x44e6ec,_0x1218b5){return cmHopper[_0x43d0('0x10')](_0x357f87,_0x44e6ec,_0x1218b5)['catch'](function(_0x5d4fc4){logger[_0x43d0('0x8')](_0x43d0('0x11'),inspectError(_0x5d4fc4));});}exports[_0x43d0('0x10')]=unlockContact;function moveContactManagedDialer(_0x56a27b){return cmHopper[_0x43d0('0x12')](_0x56a27b)['catch'](function(_0x2c9d06){logger[_0x43d0('0x8')](_0x43d0('0x13'),inspectError(_0x2c9d06));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x3d7dcc){return cmHopperBlack[_0x43d0('0x14')](_0x3d7dcc)['catch'](function(_0x474d96){logger[_0x43d0('0x8')](_0x43d0('0x15'),inspectError(_0x474d96));});}exports[_0x43d0('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x3009a7){return cmHopperBlack[_0x43d0('0x16')](_0x3009a7)[_0x43d0('0xa')](function(_0x1e7993){logger[_0x43d0('0x8')](_0x43d0('0x17'),inspectError(_0x1e7993));});}exports[_0x43d0('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x19d2ff,_0x326be8,_0xbc72e6){return cmHopperAdditionalPhone[_0x43d0('0x18')](_0x19d2ff,_0x326be8,_0xbc72e6)['catch'](function(_0x2c7b24){logger[_0x43d0('0x8')]('[verifyAdditionalPhone]',inspectError(_0x2c7b24));});}exports[_0x43d0('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x5456ab,_0x29c111,_0x44497b){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x5456ab,_0x29c111,_0x44497b)[_0x43d0('0xa')](function(_0x238c64){logger['error'](_0x43d0('0x19'),inspectError(_0x238c64));});}exports[_0x43d0('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x22ae3c){return cmHopperHistory['avgHandleTime'](_0x22ae3c)[_0x43d0('0xa')](function(_0x38e89e){logger[_0x43d0('0x8')](_0x43d0('0x1b'),inspectError(_0x38e89e));});}exports[_0x43d0('0x1c')]=avgHandleTime;function createHistory(_0x440ecb){return cmHopperHistory[_0x43d0('0x1d')](_0x440ecb)['catch'](function(_0x2b0784){logger[_0x43d0('0x8')](_0x43d0('0x1e'),inspectError(_0x2b0784));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0x5fab=['[rescheduleContact]','rescheduleContact','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','temp','error','catch','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]'];(function(_0x27ad39,_0x216d45){var _0x21eec0=function(_0x4a533c){while(--_0x4a533c){_0x27ad39['push'](_0x27ad39['shift']());}};_0x21eec0(++_0x216d45);}(_0x5fab,0x177));var _0xb5fa=function(_0x48a0b4,_0x2a4c3f){_0x48a0b4=_0x48a0b4-0x0;var _0x44b1e6=_0x5fab[_0x48a0b4];return _0x44b1e6;};'use strict';var util=require(_0xb5fa('0x0'));var logger=require(_0xb5fa('0x1'))('dialer');var cmHopper=require(_0xb5fa('0x2'));var cmHopperAdditionalPhone=require(_0xb5fa('0x3'));var cmHopperBlack=require(_0xb5fa('0x4'));var cmHopperHistory=require(_0xb5fa('0x5'));function inspectError(_0x67e8e8){return util[_0xb5fa('0x6')](_0x67e8e8,{'showHidden':![],'depth':null});}function getContactDialer(_0x29390a,_0x4341d3,_0x10361d){return cmHopper[_0xb5fa('0x7')](_0x29390a['id'],_0x4341d3,_0x10361d,_0x29390a['dialOrderByScheduledAt'])['catch'](function(_0x2e3804){_0x29390a[_0xb5fa('0x8')]=0x0;logger[_0xb5fa('0x9')]('[getContactDialer]',inspectError(_0x2e3804));});}exports[_0xb5fa('0x7')]=getContactDialer;function getContactDialerIvr(_0x38d9a3,_0x2cf4a5){return cmHopper['getContactDialerIvr'](_0x38d9a3['id'],_0x2cf4a5,_0x38d9a3['dialOrderByScheduledAt'])[_0xb5fa('0xa')](function(_0x23d124){_0x38d9a3[_0xb5fa('0x8')]=0x0;logger[_0xb5fa('0x9')](_0xb5fa('0xb'),inspectError(_0x23d124));});}exports[_0xb5fa('0xc')]=getContactDialerIvr;function countReScheduled(_0x65c6b6){return cmHopper[_0xb5fa('0xd')](_0x65c6b6)[_0xb5fa('0xa')](function(_0x4d3576){logger[_0xb5fa('0x9')](_0xb5fa('0xe'),inspectError(_0x4d3576));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x116849){return cmHopper['rescheduleContact'](_0x116849)[_0xb5fa('0xa')](function(_0x3fc372){logger[_0xb5fa('0x9')](_0xb5fa('0xf'),inspectError(_0x3fc372));});}exports[_0xb5fa('0x10')]=rescheduleContact;function unlockContact(_0x5371cf,_0x567f31,_0x38e964){return cmHopper[_0xb5fa('0x11')](_0x5371cf,_0x567f31,_0x38e964)[_0xb5fa('0xa')](function(_0x27c8f7){logger['error']('[unlockContact]',inspectError(_0x27c8f7));});}exports[_0xb5fa('0x11')]=unlockContact;function moveContactManagedDialer(_0x1f7f05){return cmHopper[_0xb5fa('0x12')](_0x1f7f05)[_0xb5fa('0xa')](function(_0x324ba5){logger[_0xb5fa('0x9')](_0xb5fa('0x13'),inspectError(_0x324ba5));});}exports[_0xb5fa('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0xc14dc4){return cmHopperBlack[_0xb5fa('0x14')](_0xc14dc4)[_0xb5fa('0xa')](function(_0x1f5064){logger['error'](_0xb5fa('0x15'),inspectError(_0x1f5064));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x37ae06){return cmHopperBlack['checkIsBlackListIvr'](_0x37ae06)[_0xb5fa('0xa')](function(_0x43c09f){logger['error'](_0xb5fa('0x16'),inspectError(_0x43c09f));});}exports[_0xb5fa('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x283a56,_0x47f71a,_0x32a85c){return cmHopperAdditionalPhone[_0xb5fa('0x18')](_0x283a56,_0x47f71a,_0x32a85c)[_0xb5fa('0xa')](function(_0x542348){logger[_0xb5fa('0x9')]('[verifyAdditionalPhone]',inspectError(_0x542348));});}exports[_0xb5fa('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x264591,_0x11053a,_0x543edf){return cmHopperAdditionalPhone[_0xb5fa('0x19')](_0x264591,_0x11053a,_0x543edf)[_0xb5fa('0xa')](function(_0x6a455c){logger[_0xb5fa('0x9')]('[swapAdditionalPhone]',inspectError(_0x6a455c));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x5bdf11){return cmHopperHistory['avgHandleTime'](_0x5bdf11)[_0xb5fa('0xa')](function(_0x460b54){logger[_0xb5fa('0x9')](_0xb5fa('0x1a'),inspectError(_0x460b54));});}exports[_0xb5fa('0x1b')]=avgHandleTime;function createHistory(_0x3506a4){return cmHopperHistory[_0xb5fa('0x1c')](_0x3506a4)[_0xb5fa('0xa')](function(_0x409af9){logger[_0xb5fa('0x9')](_0xb5fa('0x1d'),inspectError(_0x409af9));});}exports[_0xb5fa('0x1c')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 161320a..341f148 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc855=['\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','createdAt','tags','updatedAt','undefined','description','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','active','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','originated','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0xc855,0x178));var _0x5c85=function(_0x5a19f7,_0xf7b01){_0x5a19f7=_0x5a19f7-0x0;var _0x4d496a=_0xc855[_0x5a19f7];return _0x4d496a;};'use strict';var _=require(_0x5c85('0x0'));var moment=require(_0x5c85('0x1'));var util=require(_0x5c85('0x2'));var logger=require(_0x5c85('0x3'))(_0x5c85('0x4'));var timezones=require(_0x5c85('0x5'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0x5c85('0x6'),'BLACKLIST':_0x5c85('0x7'),'CONTACTS_RESCHEDULED':_0x5c85('0x8'),'DEACTIVATED':_0x5c85('0x9'),'DISACTIVED':_0x5c85('0xa'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x5c85('0xb'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x5c85('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x5c85('0xd'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x5c85('0xe'),'RUNNING':_0x5c85('0xf'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x5c85('0x10')};exports[_0x5c85('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x153761){return _0x153761[_0x5c85('0x12')]===_0x5c85('0x13');}exports[_0x5c85('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x441d1e){return _0x441d1e[_0x5c85('0x15')]===_0x5c85('0x16');}exports[_0x5c85('0x17')]=isIVRCampaign;function isOutboundQueue(_0x395a5e){return _0x395a5e[_0x5c85('0x15')]===_0x5c85('0x18');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x3c6623){return _0x3c6623[_0x5c85('0x19')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x2dc6af){return _0x2dc6af[_0x5c85('0x1a')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x59b21f,_0x101f75){var _0x2b84fc=moment(_0x59b21f)[_0x5c85('0x1b')](0x0);var _0x285843=moment(_0x101f75)[_0x5c85('0x1b')](0x0);return _0x2b84fc[_0x5c85('0x1c')](_0x285843,'seconds');}exports[_0x5c85('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x1bcefc,_0x46635a){var _0x16cfc1=![];var _0x4a2441=_0x1bcefc['dialMethod']!==_0x46635a[_0x5c85('0x12')]||_0x1bcefc[_0x5c85('0x19')]!==_0x46635a[_0x5c85('0x19')]||_0x1bcefc[_0x5c85('0x1e')]!==_0x46635a[_0x5c85('0x1e')];var _0x4cd5b3=_0x1bcefc[_0x5c85('0x1f')]!==_0x46635a[_0x5c85('0x1f')]||_0x1bcefc['loggedIn']!==_0x46635a[_0x5c85('0x20')]||_0x1bcefc[_0x5c85('0x21')]!==_0x46635a[_0x5c85('0x21')]||_0x1bcefc[_0x5c85('0x22')]!==_0x46635a[_0x5c85('0x22')]||_0x1bcefc[_0x5c85('0x23')]!==_0x46635a[_0x5c85('0x23')]||_0x1bcefc[_0x5c85('0x24')]!==_0x46635a[_0x5c85('0x24')]||_0x1bcefc[_0x5c85('0x25')]!==_0x46635a['waiting']||_0x1bcefc[_0x5c85('0x26')]!==_0x46635a[_0x5c85('0x26')]||_0x1bcefc['originated']!==_0x46635a['originated'];if(_0x1bcefc[_0x5c85('0x27')]&&_0x46635a['Trunk']){_0x16cfc1=_0x1bcefc[_0x5c85('0x27')][_0x5c85('0x28')]!==_0x46635a[_0x5c85('0x27')][_0x5c85('0x28')]||_0x1bcefc[_0x5c85('0x27')][_0x5c85('0x1a')]!==_0x46635a[_0x5c85('0x27')][_0x5c85('0x1a')];}return _0x4a2441||_0x4cd5b3||_0x16cfc1;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1b68ac){var _0x2608ae=null;var _0x4e7e99=_0x1b68ac[_0x5c85('0x29')];if(_[_0x5c85('0x2a')](_0x1b68ac[_0x5c85('0x2b')])||_[_0x5c85('0x2a')](_0x1b68ac[_0x5c85('0x2c')])||_[_0x5c85('0x2a')](_0x1b68ac[_0x5c85('0x2c')][_0x5c85('0x2d')])){_0x2608ae=CAMPAIGN_STATUS[_0x5c85('0x2e')];}else if(_[_0x5c85('0x2f')](_0x1b68ac[_0x5c85('0x2b')])||_[_0x5c85('0x2f')](_0x1b68ac[_0x5c85('0x2c')]['Intervals'])){_0x2608ae=CAMPAIGN_STATUS[_0x5c85('0x30')];}else if(_0x4e7e99&&!timezones[_0x4e7e99]){_0x2608ae=CAMPAIGN_STATUS[_0x5c85('0x31')];}return _0x2608ae;}function checkAnyValidTrunk(_0x3e43ff,_0x441ea3){var _0x581ba3=null;var _0x16c38b='SIP/';var _0x1273ce=[_0x5c85('0x32'),_0x5c85('0x33')];var _0x3f09f6=!![];if(_0x3e43ff['Trunk']&&_0x3e43ff[_0x5c85('0x27')]['active']){_0x16c38b+=_0x3e43ff[_0x5c85('0x27')][_0x5c85('0x28')];_0x581ba3=_0x441ea3[_0x16c38b];_0x3f09f6=_0x1273ce[_0x5c85('0x34')](_0x581ba3[_0x5c85('0x35')]);}else if(_0x3e43ff['TrunkBackup']&&_0x3e43ff[_0x5c85('0x36')][_0x5c85('0x1a')]){_0x16c38b+=_0x3e43ff[_0x5c85('0x36')][_0x5c85('0x28')];_0x581ba3=_0x441ea3[_0x16c38b];_0x3f09f6=_0x1273ce[_0x5c85('0x34')](_0x581ba3[_0x5c85('0x35')]);}return _0x3f09f6;}function getQueueCampaignStatusMessage(_0x3619f0,_0x4df16f){var _0x2a794f=CAMPAIGN_STATUS[_0x5c85('0x6')];var _0x6f4ce=isPreviewCampaign(_0x3619f0);if(!isQueueCampaignActive(_0x3619f0)){if(_0x6f4ce){_0x2a794f=CAMPAIGN_STATUS[_0x5c85('0x37')];}else{if(_0x3619f0[_0x5c85('0x38')]===0x0&&_0x3619f0['talking']===0x0&&_0x3619f0['waiting']===0x0&&(_0x3619f0[_0x5c85('0x24')]||0x0)===0x0){_0x2a794f=CAMPAIGN_STATUS[_0x5c85('0x37')];}else{_0x2a794f=CAMPAIGN_STATUS[_0x5c85('0x39')];}}}else if(_0x3619f0[_0x5c85('0x20')]===0x0){_0x2a794f=CAMPAIGN_STATUS[_0x5c85('0x3a')];}else if(!checkAnyValidTrunk(_0x3619f0,_0x4df16f)){_0x2a794f=CAMPAIGN_STATUS[_0x5c85('0x3b')];}else if(!isPreviewCampaign(_0x3619f0)){var _0x47aa30=checkAnyValidQueueCampaignInterval(_0x3619f0);if(_0x47aa30){_0x2a794f=_0x47aa30;}}return _0x2a794f;}exports[_0x5c85('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x238c49){var _0x20a6a8=CAMPAIGN_STATUS['DISACTIVED'];if(_0x238c49[_0x5c85('0x38')]===0x0&&_0x238c49[_0x5c85('0x23')]===0x0&&_0x238c49[_0x5c85('0x25')]===0x0&&(_0x238c49[_0x5c85('0x24')]||0x0)===0x0){_0x20a6a8=CAMPAIGN_STATUS['INACTIVE'];}return _0x20a6a8;}exports[_0x5c85('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2f18a0){var _0x3dd170=_0x2f18a0[_0x5c85('0x3e')](/"(.*?)"/);return _0x3dd170?_0x3dd170[0x1]:_0x2f18a0;}exports[_0x5c85('0x3f')]=extractCalleridName;function getCallerId(_0x1fa468,_0x493c26,_0x2656d2){if(!_['isUndefined'](_0x2656d2)&&typeof _0x2656d2===_0x5c85('0x40')&&!_[_0x5c85('0x2f')](_0x2656d2)){if(!_[_0x5c85('0x41')](_0x493c26)&&typeof _0x493c26==='string'&&!_[_0x5c85('0x2f')](_0x493c26)){return util['format'](_0x5c85('0x42'),_0x493c26,_0x2656d2);}return util['format'](_0x5c85('0x42'),_0x2656d2,_0x2656d2);}if(!_['isUndefined'](_0x1fa468)&&typeof _0x1fa468===_0x5c85('0x40')&&!_[_0x5c85('0x2f')](_0x1fa468)){return _0x1fa468;}return _0x5c85('0x43');}exports[_0x5c85('0x44')]=getCallerId;function getCallerIdRandom(_0x1c8f83,_0xe75493){var _0x23b506;var _0xcd1683;var _0xdeed47;if(_0xe75493<=0x0){_0xe75493=0x1;}_0x23b506=new RegExp(_0x5c85('0x45')+_0xe75493+'}$');_0xcd1683=Math['pow'](0xa,_0xe75493-0x1);_0xdeed47=Math[_0x5c85('0x46')](0xa,_0xe75493)-0x1;return util['format']('%s',_[_0x5c85('0x47')](_0x1c8f83,_0x23b506,_[_0x5c85('0x48')](_0xcd1683,_0xdeed47)[_0x5c85('0x49')]()));}exports[_0x5c85('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x5d6e2a){if(_0x5d6e2a[_0x5c85('0x38')]&&_0x5d6e2a[_0x5c85('0x38')]>0x0){_0x5d6e2a[_0x5c85('0x38')]-=0x1;}else{logger[_0x5c85('0x4b')](_0x5c85('0x4c'));}}exports[_0x5c85('0x4d')]=decrementOriginate;function checkContactEmpty(_0x5d967f){return _0x5d967f&&_0x5d967f[_0x5c85('0x4e')]>0x0;}exports[_0x5c85('0x4f')]=checkContactEmpty;function erlangb(_0x4b0266,_0x3fc489){if(_0x3fc489===0x0){return 0x0;}var _0x5f1b8b=0x1;for(var _0x384543=0x1;_0x384543<=_0x3fc489;_0x384543+=0x1){_0x5f1b8b=0x1+_0x5f1b8b*_0x384543/_0x4b0266;}return 0x1/_0x5f1b8b;}exports[_0x5c85('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0xd67f1d,_0x4f6b38,_0x113cc0){if(_0x4f6b38>_0x113cc0){for(var _0x58b205=0x0;_0x58b205<_0x4f6b38-_0x113cc0;_0x58b205+=0x1){decrementOriginate(_0xd67f1d);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xbaeb85){var _0x22756b={};var _0x472b0f=['id',_0x5c85('0x51'),_0x5c85('0x52'),_0x5c85('0x53')];const _0x39978f=0xfa;if(_0xbaeb85){for(var _0x21740f in _0xbaeb85){if(typeof _0xbaeb85[_0x21740f]!==_0x5c85('0x54')){if(!_[_0x5c85('0x2a')](_0xbaeb85[_0x21740f])&&!_0x472b0f[_0x5c85('0x34')](_0x21740f)){if(_0x21740f===_0x5c85('0x55')&&_0xbaeb85[_0x21740f][_0x5c85('0x4e')]>_0x39978f){_0x22756b['XMD-'+_0x21740f[_0x5c85('0x56')]()]=_0xbaeb85[_0x21740f][_0x5c85('0x49')]()[_0x5c85('0x57')](0x0,_0x39978f);}else{_0x22756b['XMD-'+_0x21740f['toUpperCase']()]=_0xbaeb85[_0x21740f];}}}}}return _0x22756b;}exports[_0x5c85('0x58')]=setXMDContactVariables; \ No newline at end of file +var _0x0a8b=['isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','status','TrunkBackup','includes','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','XMD-','substring','toUpperCase','setXMDContactVariables','lodash','../../../../config/logger','../../../../config/environment/shared','ACTIVE','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','dialMethod','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','dialActive'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0a8b,0xee));var _0xb0a8=function(_0x3f83c1,_0x10be1c){_0x3f83c1=_0x3f83c1-0x0;var _0x2f8a39=_0x0a8b[_0x3f83c1];return _0x2f8a39;};'use strict';var _=require(_0xb0a8('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0xb0a8('0x1'))('dialer');var timezones=require(_0xb0a8('0x2'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xb0a8('0x3'),'BLACKLIST':_0xb0a8('0x4'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xb0a8('0x5'),'DISACTIVED':_0xb0a8('0x6'),'EMPTY_INTERVAL':_0xb0a8('0x7'),'INACTIVE':_0xb0a8('0x8'),'NO_AGENTS_LOGGED':_0xb0a8('0x9'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0xb0a8('0xa'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xb0a8('0xb'),'QUEUE_RECALL':_0xb0a8('0xc'),'RECALL_TIMEOUT':_0xb0a8('0xd'),'RUNNING':_0xb0a8('0xe'),'UNKNOWN_TIMEZONE':_0xb0a8('0xf'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x38bdd7){return _0x38bdd7[_0xb0a8('0x10')]==='preview';}exports[_0xb0a8('0x11')]=isPreviewCampaign;function isIVRCampaign(_0x24d699){return _0x24d699[_0xb0a8('0x12')]===_0xb0a8('0x13');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x56e7b1){return _0x56e7b1[_0xb0a8('0x12')]===_0xb0a8('0x14');}exports[_0xb0a8('0x15')]=isOutboundQueue;function isQueueCampaignActive(_0x4c7337){return _0x4c7337[_0xb0a8('0x16')];}exports[_0xb0a8('0x17')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5ed0d2){return _0x5ed0d2[_0xb0a8('0x18')];}exports[_0xb0a8('0x19')]=isIVRCampaignActive;function getSeconds(_0x271e01,_0x3264e1){var _0x4611dd=moment(_0x271e01)['milliseconds'](0x0);var _0x40195a=moment(_0x3264e1)[_0xb0a8('0x1a')](0x0);return _0x4611dd[_0xb0a8('0x1b')](_0x40195a,_0xb0a8('0x1c'));}exports[_0xb0a8('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x4d21e8,_0x1b963c){var _0x2e08f4=![];var _0x310169=_0x4d21e8[_0xb0a8('0x10')]!==_0x1b963c['dialMethod']||_0x4d21e8[_0xb0a8('0x16')]!==_0x1b963c[_0xb0a8('0x16')]||_0x4d21e8[_0xb0a8('0x1e')]!==_0x1b963c['message'];var _0x26d9ae=_0x4d21e8[_0xb0a8('0x1f')]!==_0x1b963c['available']||_0x4d21e8[_0xb0a8('0x20')]!==_0x1b963c[_0xb0a8('0x20')]||_0x4d21e8[_0xb0a8('0x21')]!==_0x1b963c['loggedInDb']||_0x4d21e8[_0xb0a8('0x22')]!==_0x1b963c['paused']||_0x4d21e8['talking']!==_0x1b963c[_0xb0a8('0x23')]||_0x4d21e8[_0xb0a8('0x24')]!==_0x1b963c[_0xb0a8('0x24')]||_0x4d21e8[_0xb0a8('0x25')]!==_0x1b963c[_0xb0a8('0x25')]||_0x4d21e8['inUse']!==_0x1b963c[_0xb0a8('0x26')]||_0x4d21e8[_0xb0a8('0x27')]!==_0x1b963c['originated'];if(_0x4d21e8[_0xb0a8('0x28')]&&_0x1b963c[_0xb0a8('0x28')]){_0x2e08f4=_0x4d21e8[_0xb0a8('0x28')][_0xb0a8('0x29')]!==_0x1b963c[_0xb0a8('0x28')][_0xb0a8('0x29')]||_0x4d21e8[_0xb0a8('0x28')][_0xb0a8('0x18')]!==_0x1b963c[_0xb0a8('0x28')]['active'];}return _0x310169||_0x26d9ae||_0x2e08f4;}exports[_0xb0a8('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5e0f9b){var _0x3a0f80=null;var _0x19143f=_0x5e0f9b[_0xb0a8('0x2b')];if(_[_0xb0a8('0x2c')](_0x5e0f9b[_0xb0a8('0x2d')])||_['isNil'](_0x5e0f9b[_0xb0a8('0x2e')])||_[_0xb0a8('0x2c')](_0x5e0f9b[_0xb0a8('0x2e')]['Intervals'])){_0x3a0f80=CAMPAIGN_STATUS[_0xb0a8('0x2f')];}else if(_[_0xb0a8('0x30')](_0x5e0f9b[_0xb0a8('0x2d')])||_[_0xb0a8('0x30')](_0x5e0f9b['Interval'][_0xb0a8('0x31')])){_0x3a0f80=CAMPAIGN_STATUS[_0xb0a8('0x32')];}else if(_0x19143f&&!timezones[_0x19143f]){_0x3a0f80=CAMPAIGN_STATUS[_0xb0a8('0x33')];}return _0x3a0f80;}function checkAnyValidTrunk(_0x1c0cce,_0x49299e){var _0x57901a=null;var _0x4374c7=_0xb0a8('0x34');var _0x3a992e=[_0xb0a8('0x35'),'unmonitored'];var _0x277d00=!![];if(_0x1c0cce[_0xb0a8('0x28')]&&_0x1c0cce[_0xb0a8('0x28')][_0xb0a8('0x18')]){_0x4374c7+=_0x1c0cce[_0xb0a8('0x28')][_0xb0a8('0x29')];_0x57901a=_0x49299e[_0x4374c7];_0x277d00=_0x3a992e['includes'](_0x57901a[_0xb0a8('0x36')]);}else if(_0x1c0cce[_0xb0a8('0x37')]&&_0x1c0cce[_0xb0a8('0x37')][_0xb0a8('0x18')]){_0x4374c7+=_0x1c0cce[_0xb0a8('0x37')]['name'];_0x57901a=_0x49299e[_0x4374c7];_0x277d00=_0x3a992e[_0xb0a8('0x38')](_0x57901a['status']);}return _0x277d00;}function getQueueCampaignStatusMessage(_0x25f2f3,_0x26b16e){var _0x56a975=CAMPAIGN_STATUS[_0xb0a8('0x3')];var _0x1e44ad=isPreviewCampaign(_0x25f2f3);if(!isQueueCampaignActive(_0x25f2f3)){if(_0x1e44ad){_0x56a975=CAMPAIGN_STATUS[_0xb0a8('0x39')];}else{if(_0x25f2f3[_0xb0a8('0x27')]===0x0&&_0x25f2f3['talking']===0x0&&_0x25f2f3[_0xb0a8('0x25')]===0x0&&(_0x25f2f3[_0xb0a8('0x24')]||0x0)===0x0){_0x56a975=CAMPAIGN_STATUS[_0xb0a8('0x39')];}else{_0x56a975=CAMPAIGN_STATUS[_0xb0a8('0x3a')];}}}else if(_0x25f2f3[_0xb0a8('0x20')]===0x0){_0x56a975=CAMPAIGN_STATUS[_0xb0a8('0x3b')];}else if(!checkAnyValidTrunk(_0x25f2f3,_0x26b16e)){_0x56a975=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x25f2f3)){var _0x5c6170=checkAnyValidQueueCampaignInterval(_0x25f2f3);if(_0x5c6170){_0x56a975=_0x5c6170;}}return _0x56a975;}exports[_0xb0a8('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x443284){var _0x552de1=CAMPAIGN_STATUS[_0xb0a8('0x3a')];if(_0x443284[_0xb0a8('0x27')]===0x0&&_0x443284['talking']===0x0&&_0x443284[_0xb0a8('0x25')]===0x0&&(_0x443284[_0xb0a8('0x24')]||0x0)===0x0){_0x552de1=CAMPAIGN_STATUS['INACTIVE'];}return _0x552de1;}exports[_0xb0a8('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x12344b){var _0x16d580=_0x12344b[_0xb0a8('0x3e')](/"(.*?)"/);return _0x16d580?_0x16d580[0x1]:_0x12344b;}exports[_0xb0a8('0x3f')]=extractCalleridName;function getCallerId(_0x395b8f,_0x1d9c03,_0x19e552){if(!_[_0xb0a8('0x40')](_0x19e552)&&typeof _0x19e552==='string'&&!_[_0xb0a8('0x30')](_0x19e552)){if(!_['isUndefined'](_0x1d9c03)&&typeof _0x1d9c03===_0xb0a8('0x41')&&!_['isEmpty'](_0x1d9c03)){return util[_0xb0a8('0x42')](_0xb0a8('0x43'),_0x1d9c03,_0x19e552);}return util[_0xb0a8('0x42')](_0xb0a8('0x43'),_0x19e552,_0x19e552);}if(!_[_0xb0a8('0x40')](_0x395b8f)&&typeof _0x395b8f===_0xb0a8('0x41')&&!_['isEmpty'](_0x395b8f)){return _0x395b8f;}return _0xb0a8('0x44');}exports[_0xb0a8('0x45')]=getCallerId;function getCallerIdRandom(_0x12c1d4,_0x446a4d){var _0x5a9f15;var _0x480517;var _0x4bd40b;if(_0x446a4d<=0x0){_0x446a4d=0x1;}_0x5a9f15=new RegExp('\x5cw{0,'+_0x446a4d+'}$');_0x480517=Math['pow'](0xa,_0x446a4d-0x1);_0x4bd40b=Math[_0xb0a8('0x46')](0xa,_0x446a4d)-0x1;return util[_0xb0a8('0x42')]('%s',_[_0xb0a8('0x47')](_0x12c1d4,_0x5a9f15,_[_0xb0a8('0x48')](_0x480517,_0x4bd40b)[_0xb0a8('0x49')]()));}exports[_0xb0a8('0x4a')]=getCallerIdRandom;function decrementOriginate(_0xe402f3){if(_0xe402f3[_0xb0a8('0x27')]&&_0xe402f3['originated']>0x0){_0xe402f3['originated']-=0x1;}else{logger['error'](_0xb0a8('0x4b'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x36de08){return _0x36de08&&_0x36de08[_0xb0a8('0x4c')]>0x0;}exports[_0xb0a8('0x4d')]=checkContactEmpty;function erlangb(_0x2c76c0,_0x5acb30){if(_0x5acb30===0x0){return 0x0;}var _0x3645df=0x1;for(var _0x1410d7=0x1;_0x1410d7<=_0x5acb30;_0x1410d7+=0x1){_0x3645df=0x1+_0x3645df*_0x1410d7/_0x2c76c0;}return 0x1/_0x3645df;}exports[_0xb0a8('0x4e')]=erlangb;function checkContactLowerLimitOriginate(_0x4c8fc2,_0xa95901,_0x38e833){if(_0xa95901>_0x38e833){for(var _0x4b1856=0x0;_0x4b1856<_0xa95901-_0x38e833;_0x4b1856+=0x1){decrementOriginate(_0x4c8fc2);}}}exports[_0xb0a8('0x4f')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x53adc7){var _0x25a8d3={};var _0x2f0f16=['id',_0xb0a8('0x50'),'tags',_0xb0a8('0x51')];const _0x39e361=0xfa;if(_0x53adc7){for(var _0x521585 in _0x53adc7){if(typeof _0x53adc7[_0x521585]!==_0xb0a8('0x52')){if(!_[_0xb0a8('0x2c')](_0x53adc7[_0x521585])&&!_0x2f0f16['includes'](_0x521585)){if(_0x521585==='description'&&_0x53adc7[_0x521585]['length']>_0x39e361){_0x25a8d3[_0xb0a8('0x53')+_0x521585['toUpperCase']()]=_0x53adc7[_0x521585][_0xb0a8('0x49')]()[_0xb0a8('0x54')](0x0,_0x39e361);}else{_0x25a8d3['XMD-'+_0x521585[_0xb0a8('0x55')]()]=_0x53adc7[_0x521585];}}}}}return _0x25a8d3;}exports[_0xb0a8('0x56')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8c57e2f..a791899 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(_0x25195c,_0x4879eb){var _0x5d36ec=function(_0x11e897){while(--_0x11e897){_0x25195c['push'](_0x25195c['shift']());}};_0x5d36ec(++_0x4879eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x37f4ef,_0x375f75){var _0x4e1238=function(_0x19a78c){while(--_0x19a78c){_0x37f4ef['push'](_0x37f4ef['shift']());}};_0x4e1238(++_0x375f75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 5203477..875dcd4 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 _0xdabe=['\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','syncOriginateResponse','context','from-voip-provider','localstationid','channel','uniqueid','name','info','actions','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20'];(function(_0x213aac,_0x30117f){var _0x20bc6f=function(_0x2b1baf){while(--_0x2b1baf){_0x213aac['push'](_0x213aac['shift']());}};_0x20bc6f(++_0x30117f);}(_0xdabe,0x10c));var _0xedab=function(_0x329613,_0x362fdd){_0x329613=_0x329613-0x0;var _0x42111c=_0xdabe[_0x329613];return _0x42111c;};'use strict';var util=require(_0xedab('0x0'));var _=require('lodash');var BPromise=require(_0xedab('0x1'));var uuid=require('uuid');var moment=require(_0xedab('0x2'));var path=require(_0xedab('0x3'));var tiff2pdf=require(_0xedab('0x4'));var gs=require(_0xedab('0x5'));var logger=require(_0xedab('0x6'))(_0xedab('0x7'));var ami=require('../ami');var rpcDb=require(_0xedab('0x8'));var Channel=require(_0xedab('0x9'));var ut=require(_0xedab('0xa'));var Action=require('./action');var faxAccount=require(_0xedab('0xb'));var attachment=require(_0xedab('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x39d6ab){this[_0xedab('0xd')]={};this['faxAccounts']=_0x39d6ab[_0xedab('0xe')];this[_0xedab('0xf')]=_0x39d6ab[_0xedab('0xf')];this['actions']={};ami['on'](_0xedab('0x10'),this[_0xedab('0x11')][_0xedab('0x12')](this));ami['on'](_0xedab('0x13'),this[_0xedab('0x14')][_0xedab('0x12')](this));ami['on'](_0xedab('0x15'),this['syncNewState'][_0xedab('0x12')](this));ami['on']('newexten',this[_0xedab('0x16')][_0xedab('0x12')](this));ami['on'](_0xedab('0x17'),this[_0xedab('0x18')]['bind'](this));ami['on'](_0xedab('0x19'),this['syncReceiveFax'][_0xedab('0x12')](this));ami['on'](_0xedab('0x1a'),this[_0xedab('0x1b')]['bind'](this));ami['on']('originateresponse',this[_0xedab('0x1c')]['bind'](this));}Fax['prototype'][_0xedab('0x11')]=function(_0x2e1b1a){if(_0x2e1b1a[_0xedab('0x1d')]===_0xedab('0x1e')){for(var _0x2a0a4b in this[_0xedab('0xe')]){if(this[_0xedab('0xe')]['hasOwnProperty'](_0x2a0a4b)){if(_0x2e1b1a['exten']===this[_0xedab('0xe')][_0x2a0a4b][_0xedab('0x1f')]){this['channels'][_0x2e1b1a['uniqueid']]={};this[_0xedab('0xd')][_0x2e1b1a['uniqueid']]['channel']=_0x2e1b1a[_0xedab('0x20')];this[_0xedab('0xd')][_0x2e1b1a[_0xedab('0x21')]]['id']=this[_0xedab('0xe')][_0x2a0a4b]['id'];this[_0xedab('0xd')][_0x2e1b1a[_0xedab('0x21')]][_0xedab('0x22')]=this[_0xedab('0xe')][_0x2a0a4b][_0xedab('0x22')];logger[_0xedab('0x23')](_0x2e1b1a[_0xedab('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0xedab('0x24')][_0x2e1b1a['uniqueid']]){this['channels'][_0x2e1b1a['uniqueid']]={};this[_0xedab('0xd')][_0x2e1b1a[_0xedab('0x21')]][_0xedab('0x20')]=_0x2e1b1a[_0xedab('0x20')];logger['info'](_0x2e1b1a[_0xedab('0x21')],_0xedab('0x25'));}};Fax[_0xedab('0x26')]['syncVarSet']=function(_0x449d8a){if(this[_0xedab('0xd')][_0x449d8a[_0xedab('0x21')]]){for(var _0x49142d in _0x449d8a[_0xedab('0x27')]){if(_0x449d8a[_0xedab('0x27')][_0xedab('0x28')](_0x49142d)){this[_0xedab('0xd')][_0x449d8a[_0xedab('0x21')]][_0x49142d]=_0x449d8a[_0xedab('0x29')];}}}};Fax['prototype'][_0xedab('0x2a')]=function(_0x2bc661){if(this[_0xedab('0xd')][_0x2bc661[_0xedab('0x21')]]){this[_0xedab('0xd')][_0x2bc661[_0xedab('0x21')]][_0xedab('0x2b')]=_0x2bc661[_0xedab('0x2b')];this[_0xedab('0xd')][_0x2bc661[_0xedab('0x21')]]['channelstatedesc']=_0x2bc661[_0xedab('0x2c')];}};Fax[_0xedab('0x26')][_0xedab('0x16')]=function(_0x3f70f5){if(this['channels'][_0x3f70f5[_0xedab('0x21')]]){for(var _0x52ed04 in _0x3f70f5[_0xedab('0x27')]){if(_0x3f70f5[_0xedab('0x27')][_0xedab('0x28')](_0x52ed04)){this[_0xedab('0xd')][_0x3f70f5['uniqueid']][_0x52ed04]=_0x3f70f5['value'];}}}};Fax[_0xedab('0x26')][_0xedab('0x18')]=function(_0x52433b){if(this['channels'][_0x52433b[_0xedab('0x21')]]){this[_0xedab('0xd')][_0x52433b['uniqueid']]['operation']=_0x52433b[_0xedab('0x2d')];this[_0xedab('0xd')][_0x52433b[_0xedab('0x21')]]['status']=_0x52433b[_0xedab('0x2e')];this[_0xedab('0xd')][_0x52433b[_0xedab('0x21')]][_0xedab('0x1f')]=_0x52433b[_0xedab('0x1f')];this[_0xedab('0xd')][_0x52433b[_0xedab('0x21')]][_0xedab('0x2f')]=_0x52433b[_0xedab('0x2f')];logger['info'](_0x52433b[_0xedab('0x21')],_0xedab('0x30'));}};Fax[_0xedab('0x26')][_0xedab('0x31')]=function(_0x429081){var _0x321806=this;if(this[_0xedab('0xd')][_0x429081[_0xedab('0x21')]]){var _0x332c7f=this[_0xedab('0xd')][_0x429081[_0xedab('0x21')]]['id'];this[_0xedab('0xd')][_0x429081[_0xedab('0x21')]][_0xedab('0x32')]=_0x429081['remotestationid'];this[_0xedab('0xd')][_0x429081['uniqueid']]['pagestransferred']=_0x429081[_0xedab('0x33')];this['channels'][_0x429081[_0xedab('0x21')]][_0xedab('0x1f')]=_0x429081[_0xedab('0x1f')];this['channels'][_0x429081[_0xedab('0x21')]][_0xedab('0x34')]=_0x429081[_0xedab('0x34')];this[_0xedab('0xd')][_0x429081[_0xedab('0x21')]][_0xedab('0x35')]=_0x429081['transferrate'];this[_0xedab('0xd')][_0x429081[_0xedab('0x21')]][_0xedab('0x2f')]=_0x429081[_0xedab('0x2f')];this[_0xedab('0xd')][_0x429081[_0xedab('0x21')]][_0xedab('0x36')]=_0x429081[_0xedab('0x36')];if(this[_0xedab('0xd')][_0x429081['uniqueid']][_0xedab('0x33')]>0x0){tiff2pdf(_0x429081[_0xedab('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x153867){logger[_0xedab('0x23')](_0x429081[_0xedab('0x21')],_0xedab('0x37'),_0x153867[_0xedab('0x38')]);attachment['create']({'name':path['parse'](_0x429081[_0xedab('0x2f')])['name'],'basename':path[_0xedab('0x39')](_0x429081['filename'])[_0xedab('0x22')]+_0xedab('0x3a'),'type':'application/pdf'})[_0xedab('0x3b')](function(_0x1315c0){faxAccount[_0xedab('0x3c')](_0x332c7f,{'from':_0x429081[_0xedab('0x36')],'mapKey':_0xedab('0x7'),'body':path[_0xedab('0x39')](_0x429081['filename'])[_0xedab('0x22')]+'.pdf','AttachmentId':_0x1315c0['id']})[_0xedab('0x3d')](function(_0x4baa59){logger[_0xedab('0x3e')](_0x429081['uniqueid'],_0xedab('0x3f'),JSON[_0xedab('0x40')](_0x4baa59));});})[_0xedab('0x3d')](function(_0x49e385){logger[_0xedab('0x3e')](_0x429081[_0xedab('0x21')],'\x20receiveFax\x20',JSON[_0xedab('0x40')](_0x49e385));});});}logger[_0xedab('0x23')](_0x429081['uniqueid'],_0xedab('0x41'));}};Fax[_0xedab('0x26')][_0xedab('0x1c')]=function(_0x359c6b){if(this[_0xedab('0x24')][_0x359c6b['uniqueid']]){_[_0xedab('0x42')](this[_0xedab('0xd')][_0x359c6b[_0xedab('0x21')]],_[_0xedab('0x43')](_0x359c6b,[_0xedab('0x44'),_0xedab('0x45')]));}};function updateStatus(_0x3dc6dd){if(_0x3dc6dd[_0xedab('0x46')]){faxMessage[_0xedab('0x47')](_0x3dc6dd[_0xedab('0x46')],{'failMessage':_0xedab('0x48')})['then'](function(_0x40607b){ut[_0xedab('0x49')](_0xedab('0x4a'),_0x40607b);})[_0xedab('0x3d')](function(_0xbc36c5){ut[_0xedab('0x49')](_0xedab('0x4b'),_0xbc36c5);});}else{ut['logger'](_0xedab('0x4c'));}}Fax[_0xedab('0x26')][_0xedab('0x4d')]=function(_0x3a8ab8,_0x4cfa63,_0x16c1b2){var _0x51b87a=this;var _0x5be090={};if(_0x4cfa63){_0x5be090={'read':_0x4cfa63};}else{_0x5be090={'failMessage':_0x16c1b2};}if(this[_0xedab('0x24')][_0x3a8ab8]['AttachmentId']){faxMessage[_0xedab('0x47')](this[_0xedab('0x24')][_0x3a8ab8][_0xedab('0x46')],_0x5be090)[_0xedab('0x3b')](function(_0x5a252c){ut[_0xedab('0x49')](_0xedab('0x4e'),_0x5a252c);})[_0xedab('0x3d')](function(_0x77124e){ut[_0xedab('0x49')](_0xedab('0x4f'),_0x77124e);})[_0xedab('0x50')](function(){delete _0x51b87a[_0xedab('0xd')][_0x3a8ab8];delete _0x51b87a[_0xedab('0x24')][_0x3a8ab8];});}else{ut[_0xedab('0x49')](_0xedab('0x51'));delete this[_0xedab('0xd')][_0x3a8ab8];delete this[_0xedab('0x24')][_0x3a8ab8];}};Fax['prototype'][_0xedab('0x1b')]=function(_0x5a3bd3){var _0x5a8d9a=this;if(this[_0xedab('0xd')][_0x5a3bd3[_0xedab('0x21')]]){if(this[_0xedab('0x24')][_0x5a3bd3['uniqueid']]){this[_0xedab('0xd')][_0x5a3bd3['uniqueid']]['id']=this[_0xedab('0x24')][_0x5a3bd3[_0xedab('0x21')]]['id'];this['channels'][_0x5a3bd3['uniqueid']][_0xedab('0x22')]=this['actions'][_0x5a3bd3[_0xedab('0x21')]][_0xedab('0x22')];}logger[_0xedab('0x23')](_0x5a3bd3[_0xedab('0x21')],this[_0xedab('0x24')][_0x5a3bd3[_0xedab('0x21')]]?_0xedab('0x52'):_0xedab('0x53'),JSON[_0xedab('0x40')](this[_0xedab('0xd')][_0x5a3bd3[_0xedab('0x21')]]));if(this[_0xedab('0x24')][_0x5a3bd3['uniqueid']]){if(this[_0xedab('0xd')][_0x5a3bd3[_0xedab('0x21')]][_0xedab('0x54')]>0x0&&this[_0xedab('0xd')][_0x5a3bd3[_0xedab('0x21')]][_0xedab('0x17')]===_0xedab('0x55')){this[_0xedab('0x4d')](_0x5a3bd3[_0xedab('0x21')],!![]);}else{this[_0xedab('0x4d')](_0x5a3bd3['uniqueid'],![],this[_0xedab('0xd')][_0x5a3bd3[_0xedab('0x21')]][_0xedab('0x56')]?_0xedab('0x57')+this[_0xedab('0xd')][_0x5a3bd3[_0xedab('0x21')]][_0xedab('0x56')]:_0xedab('0x58'));}}}};Fax['prototype'][_0xedab('0x59')]=function(_0x169aa3){var _0x31cfe9=this;return new BPromise(function(_0x3be6cc,_0x1175f6){_0x31cfe9[_0xedab('0x5a')](_0x169aa3,_0x31cfe9[_0xedab('0xe')][_0x169aa3['FaxAccountId']])[_0xedab('0x3b')](function(_0x66b654){ut[_0xedab('0x49')](_0xedab('0x5b'),_0x66b654);_0x3be6cc(ut[_0xedab('0x38')](_0xedab('0x5c')));})[_0xedab('0x3d')](function(_0x692656){ut['logger']('[Fax][execOriginate][failure]',_0x692656);updateStatus(_0x169aa3);_0x1175f6(ut[_0xedab('0x38')](_0xedab('0x5d')));});});};Fax[_0xedab('0x26')][_0xedab('0x5e')]=function(_0x23d117){var _0x1f00bc=this;return new BPromise(function(_0x34f83d,_0x2b80aa){var _0x1b6757=_0x1f00bc[_0xedab('0x5f')](_0x1f00bc['faxAccounts'][_0x23d117['FaxAccountId']]['Trunk'],_0x23d117);if(_0x1b6757[_0xedab('0x60')]){_0x34f83d(ut[_0xedab('0x38')](_0xedab('0x61')));}else{_0x2b80aa(ut[_0xedab('0x38')](_0x1b6757['message']));}});};function originate(_0x105294,_0x47dff0,_0xa680d){return new BPromise(function(_0x18d2c6,_0x2ac9c2){if(_0xa680d){var _0x386f22=util[_0xedab('0x62')](_0xedab('0x63'),path[_0xedab('0x39')](_0x105294[_0xedab('0x3')])['name'],_0x105294[_0xedab('0x3')]);gs['execute'](_0x386f22)[_0xedab('0x3b')](function(){_0x105294[_0xedab('0x3')]=util['format'](_0xedab('0x64'),path['parse'](_0x105294[_0xedab('0x3')])['dir'],path['parse'](_0x105294[_0xedab('0x3')])['name']);_0x47dff0[_0xedab('0x65')]=_0x105294['path'];ut[_0xedab('0x49')](_0xedab('0x66'),'');ami['Action'](ut['variablesAction'](_0x105294,_0x47dff0))[_0xedab('0x3b')](function(_0x2e5cec){_0x18d2c6(_0x2e5cec);})['catch'](function(_0x4a46c2){_0x2ac9c2(_0x4a46c2);});})[_0xedab('0x3d')](function(_0x320b05){_0x2ac9c2(_0x320b05);});}else{ami[_0xedab('0x67')](ut[_0xedab('0x68')](_0x105294,_0x47dff0))[_0xedab('0x3b')](function(_0x11f127){_0x18d2c6(_0x11f127);})['catch'](function(_0x24362c){_0x2ac9c2(_0x24362c);});}});}Fax[_0xedab('0x26')][_0xedab('0x5a')]=function(_0x57ee9f,_0x179b8e){var _0x4220a7=this;return new BPromise(function(_0xed0a07,_0x1b899e){var _0x3744d0=uuid['v4']();var _0x5dd99b=ut['addVariables'](_0x57ee9f,_0x179b8e);_0x4220a7[_0xedab('0x24')][_0x3744d0]=new Action(_0x3744d0,_0x179b8e,_0x57ee9f);var _0x12d153=_0x4220a7[_0xedab('0x24')][_0x3744d0];if(path[_0xedab('0x39')](_0x57ee9f[_0xedab('0x3')])['ext']==='.pdf'){originate(_0x12d153,_0x5dd99b,!![])[_0xedab('0x3b')](function(_0x3d1533){_0xed0a07(_0x3d1533);})[_0xedab('0x3d')](function(_0x5ed68e){_0x1b899e(_0x5ed68e);});}else{originate(_0x12d153,_0x5dd99b,![])[_0xedab('0x3b')](function(_0xd430a){_0xed0a07(_0xd430a);})[_0xedab('0x3d')](function(_0x1d3071){_0x1b899e(_0x1d3071);});}});};Fax[_0xedab('0x26')][_0xedab('0x69')]=function(_0x1bbd1f){return!_['isNil'](_0x1bbd1f)&&!_[_0xedab('0x6a')](_0x1bbd1f[_0xedab('0x22')])&&!_['isNil'](_0x1bbd1f[_0xedab('0x6b')])&&_0x1bbd1f[_0xedab('0x6b')]&&!_['isNil'](this[_0xedab('0xf')][util[_0xedab('0x62')](_0xedab('0x6c'),_0x1bbd1f[_0xedab('0x22')])])&&!_[_0xedab('0x6a')](this['trunks'][util['format'](_0xedab('0x6c'),_0x1bbd1f['name'])][_0xedab('0x2e')])&&(this['trunks'][util['format'](_0xedab('0x6c'),_0x1bbd1f[_0xedab('0x22')])][_0xedab('0x2e')]===_0xedab('0x6d')||this[_0xedab('0xf')][util[_0xedab('0x62')](_0xedab('0x6c'),_0x1bbd1f[_0xedab('0x22')])][_0xedab('0x2e')]===_0xedab('0x6e'));};Fax[_0xedab('0x26')][_0xedab('0x5f')]=function(_0x3fb780,_0x262c4a){if(!this[_0xedab('0x69')](_0x3fb780)){ut[_0xedab('0x49')](_0xedab('0x6f'),_[_0xedab('0x6a')](_0x3fb780)?'':_0x3fb780[_0xedab('0x22')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xedab('0x6a')](_0x262c4a[_0xedab('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xedab('0x40')](_0x262c4a));return{'isValid':![],'message':_0xedab('0x70')};}if(_[_0xedab('0x6a')](_0x262c4a[_0xedab('0x3')])){ut[_0xedab('0x49')](_0xedab('0x71'),JSON[_0xedab('0x40')](_0x262c4a));return{'isValid':![],'message':_0xedab('0x72')};}return{'isValid':!![],'message':_0xedab('0x73')};};module[_0xedab('0x74')]=Fax; \ No newline at end of file +var _0x5cd9=['name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[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','lodash','bluebird','uuid','moment','tiff2pdf','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel'];(function(_0x4dafb8,_0x185282){var _0x1a8666=function(_0x178891){while(--_0x178891){_0x4dafb8['push'](_0x4dafb8['shift']());}};_0x1a8666(++_0x185282);}(_0x5cd9,0x13c));var _0x95cd=function(_0x3b6eb9,_0x409248){_0x3b6eb9=_0x3b6eb9-0x0;var _0x2d48a4=_0x5cd9[_0x3b6eb9];return _0x2d48a4;};'use strict';var util=require('util');var _=require(_0x95cd('0x0'));var BPromise=require(_0x95cd('0x1'));var uuid=require(_0x95cd('0x2'));var moment=require(_0x95cd('0x3'));var path=require('path');var tiff2pdf=require(_0x95cd('0x4'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x95cd('0x5'));var ami=require(_0x95cd('0x6'));var rpcDb=require(_0x95cd('0x7'));var Channel=require(_0x95cd('0x8'));var ut=require(_0x95cd('0x9'));var Action=require(_0x95cd('0xa'));var faxAccount=require(_0x95cd('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x4fc0f5){this[_0x95cd('0xc')]={};this[_0x95cd('0xd')]=_0x4fc0f5[_0x95cd('0xd')];this[_0x95cd('0xe')]=_0x4fc0f5[_0x95cd('0xe')];this[_0x95cd('0xf')]={};ami['on'](_0x95cd('0x10'),this[_0x95cd('0x11')][_0x95cd('0x12')](this));ami['on'](_0x95cd('0x13'),this[_0x95cd('0x14')][_0x95cd('0x12')](this));ami['on'](_0x95cd('0x15'),this[_0x95cd('0x16')][_0x95cd('0x12')](this));ami['on'](_0x95cd('0x17'),this[_0x95cd('0x18')][_0x95cd('0x12')](this));ami['on'](_0x95cd('0x19'),this['syncFaxStatus']['bind'](this));ami['on'](_0x95cd('0x1a'),this['syncReceiveFax'][_0x95cd('0x12')](this));ami['on'](_0x95cd('0x1b'),this[_0x95cd('0x1c')][_0x95cd('0x12')](this));ami['on'](_0x95cd('0x1d'),this[_0x95cd('0x1e')][_0x95cd('0x12')](this));}Fax[_0x95cd('0x1f')][_0x95cd('0x11')]=function(_0x23e85e){if(_0x23e85e[_0x95cd('0x20')]===_0x95cd('0x21')){for(var _0x10a6fe in this['faxAccounts']){if(this[_0x95cd('0xd')][_0x95cd('0x22')](_0x10a6fe)){if(_0x23e85e['exten']===this[_0x95cd('0xd')][_0x10a6fe][_0x95cd('0x23')]){this[_0x95cd('0xc')][_0x23e85e[_0x95cd('0x24')]]={};this[_0x95cd('0xc')][_0x23e85e[_0x95cd('0x24')]][_0x95cd('0x25')]=_0x23e85e[_0x95cd('0x25')];this['channels'][_0x23e85e['uniqueid']]['id']=this['faxAccounts'][_0x10a6fe]['id'];this[_0x95cd('0xc')][_0x23e85e[_0x95cd('0x24')]][_0x95cd('0x26')]=this[_0x95cd('0xd')][_0x10a6fe][_0x95cd('0x26')];logger[_0x95cd('0x27')](_0x23e85e[_0x95cd('0x24')],'\x20syncNewchannel\x20');}}}}if(this[_0x95cd('0xf')][_0x23e85e[_0x95cd('0x24')]]){this[_0x95cd('0xc')][_0x23e85e[_0x95cd('0x24')]]={};this['channels'][_0x23e85e[_0x95cd('0x24')]][_0x95cd('0x25')]=_0x23e85e['channel'];logger[_0x95cd('0x27')](_0x23e85e['uniqueid'],_0x95cd('0x28'));}};Fax[_0x95cd('0x1f')][_0x95cd('0x14')]=function(_0x4c4eed){if(this[_0x95cd('0xc')][_0x4c4eed[_0x95cd('0x24')]]){for(var _0x283bcf in _0x4c4eed[_0x95cd('0x29')]){if(_0x4c4eed[_0x95cd('0x29')][_0x95cd('0x22')](_0x283bcf)){this[_0x95cd('0xc')][_0x4c4eed[_0x95cd('0x24')]][_0x283bcf]=_0x4c4eed[_0x95cd('0x2a')];}}}};Fax['prototype'][_0x95cd('0x16')]=function(_0x856e6b){if(this[_0x95cd('0xc')][_0x856e6b['uniqueid']]){this[_0x95cd('0xc')][_0x856e6b[_0x95cd('0x24')]][_0x95cd('0x2b')]=_0x856e6b[_0x95cd('0x2b')];this[_0x95cd('0xc')][_0x856e6b[_0x95cd('0x24')]][_0x95cd('0x2c')]=_0x856e6b[_0x95cd('0x2c')];}};Fax[_0x95cd('0x1f')][_0x95cd('0x18')]=function(_0x273881){if(this[_0x95cd('0xc')][_0x273881[_0x95cd('0x24')]]){for(var _0xc2be53 in _0x273881[_0x95cd('0x29')]){if(_0x273881[_0x95cd('0x29')][_0x95cd('0x22')](_0xc2be53)){this[_0x95cd('0xc')][_0x273881[_0x95cd('0x24')]][_0xc2be53]=_0x273881['value'];}}}};Fax[_0x95cd('0x1f')]['syncFaxStatus']=function(_0x2ba38f){if(this['channels'][_0x2ba38f['uniqueid']]){this[_0x95cd('0xc')][_0x2ba38f[_0x95cd('0x24')]][_0x95cd('0x2d')]=_0x2ba38f[_0x95cd('0x2d')];this['channels'][_0x2ba38f[_0x95cd('0x24')]][_0x95cd('0x2e')]=_0x2ba38f['status'];this[_0x95cd('0xc')][_0x2ba38f[_0x95cd('0x24')]][_0x95cd('0x23')]=_0x2ba38f[_0x95cd('0x23')];this[_0x95cd('0xc')][_0x2ba38f[_0x95cd('0x24')]][_0x95cd('0x2f')]=_0x2ba38f['filename'];logger['info'](_0x2ba38f[_0x95cd('0x24')],_0x95cd('0x30'));}};Fax['prototype'][_0x95cd('0x31')]=function(_0x379da6){var _0x4ae189=this;if(this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]]){var _0x11731e=this['channels'][_0x379da6[_0x95cd('0x24')]]['id'];this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]][_0x95cd('0x32')]=_0x379da6[_0x95cd('0x32')];this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]][_0x95cd('0x33')]=_0x379da6[_0x95cd('0x33')];this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]][_0x95cd('0x23')]=_0x379da6['localstationid'];this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]][_0x95cd('0x34')]=_0x379da6[_0x95cd('0x34')];this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]][_0x95cd('0x35')]=_0x379da6[_0x95cd('0x35')];this[_0x95cd('0xc')][_0x379da6['uniqueid']][_0x95cd('0x2f')]=_0x379da6[_0x95cd('0x2f')];this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]][_0x95cd('0x36')]=_0x379da6['calleridnum'];if(this[_0x95cd('0xc')][_0x379da6[_0x95cd('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x379da6[_0x95cd('0x2f')],_0x95cd('0x37'),function(_0x2e6778){logger['info'](_0x379da6[_0x95cd('0x24')],_0x95cd('0x38'),_0x2e6778['message']);attachment['create']({'name':path[_0x95cd('0x39')](_0x379da6[_0x95cd('0x2f')])['name'],'basename':path[_0x95cd('0x39')](_0x379da6['filename'])[_0x95cd('0x26')]+_0x95cd('0x3a'),'type':_0x95cd('0x3b')})[_0x95cd('0x3c')](function(_0x5abb6e){faxAccount[_0x95cd('0x3d')](_0x11731e,{'from':_0x379da6[_0x95cd('0x36')],'mapKey':'fax','body':path['parse'](_0x379da6['filename'])[_0x95cd('0x26')]+_0x95cd('0x3a'),'AttachmentId':_0x5abb6e['id']})[_0x95cd('0x3e')](function(_0x29faa6){logger[_0x95cd('0x3f')](_0x379da6[_0x95cd('0x24')],_0x95cd('0x40'),JSON[_0x95cd('0x41')](_0x29faa6));});})[_0x95cd('0x3e')](function(_0x3142c2){logger[_0x95cd('0x3f')](_0x379da6['uniqueid'],_0x95cd('0x42'),JSON[_0x95cd('0x41')](_0x3142c2));});});}logger[_0x95cd('0x27')](_0x379da6[_0x95cd('0x24')],_0x95cd('0x42'));}};Fax[_0x95cd('0x1f')][_0x95cd('0x1e')]=function(_0x4a6742){if(this['actions'][_0x4a6742['uniqueid']]){_[_0x95cd('0x43')](this[_0x95cd('0xc')][_0x4a6742['uniqueid']],_[_0x95cd('0x44')](_0x4a6742,['response','reason']));}};function updateStatus(_0x4212e1){if(_0x4212e1[_0x95cd('0x45')]){faxMessage[_0x95cd('0x46')](_0x4212e1[_0x95cd('0x45')],{'failMessage':_0x95cd('0x47')})['then'](function(_0x26dec8){ut[_0x95cd('0x48')](_0x95cd('0x49'),_0x26dec8);})[_0x95cd('0x3e')](function(_0x3038ac){ut['logger'](_0x95cd('0x4a'),_0x3038ac);});}else{ut[_0x95cd('0x48')](_0x95cd('0x4b'));}}Fax[_0x95cd('0x1f')]['updateStatus']=function(_0x23d113,_0x5cbf02,_0x2cef48){var _0x36c1d0=this;var _0x4bdc4c={};if(_0x5cbf02){_0x4bdc4c={'read':_0x5cbf02};}else{_0x4bdc4c={'failMessage':_0x2cef48};}if(this[_0x95cd('0xf')][_0x23d113]['AttachmentId']){faxMessage['update'](this[_0x95cd('0xf')][_0x23d113][_0x95cd('0x45')],_0x4bdc4c)[_0x95cd('0x3c')](function(_0x551cfc){ut[_0x95cd('0x48')](_0x95cd('0x4c'),_0x551cfc);})[_0x95cd('0x3e')](function(_0x51123f){ut[_0x95cd('0x48')](_0x95cd('0x4d'),_0x51123f);})[_0x95cd('0x4e')](function(){delete _0x36c1d0[_0x95cd('0xc')][_0x23d113];delete _0x36c1d0['actions'][_0x23d113];});}else{ut['logger'](_0x95cd('0x4f'));delete this['channels'][_0x23d113];delete this['actions'][_0x23d113];}};Fax[_0x95cd('0x1f')]['syncHangup']=function(_0x3c815d){var _0x28d9f3=this;if(this[_0x95cd('0xc')][_0x3c815d[_0x95cd('0x24')]]){if(this[_0x95cd('0xf')][_0x3c815d[_0x95cd('0x24')]]){this[_0x95cd('0xc')][_0x3c815d[_0x95cd('0x24')]]['id']=this['actions'][_0x3c815d['uniqueid']]['id'];this[_0x95cd('0xc')][_0x3c815d[_0x95cd('0x24')]][_0x95cd('0x26')]=this['actions'][_0x3c815d[_0x95cd('0x24')]][_0x95cd('0x26')];}logger[_0x95cd('0x27')](_0x3c815d[_0x95cd('0x24')],this['actions'][_0x3c815d[_0x95cd('0x24')]]?'\x20hangup\x20sendFile\x20':_0x95cd('0x50'),JSON[_0x95cd('0x41')](this[_0x95cd('0xc')][_0x3c815d[_0x95cd('0x24')]]));if(this[_0x95cd('0xf')][_0x3c815d['uniqueid']]){if(this['channels'][_0x3c815d[_0x95cd('0x24')]][_0x95cd('0x51')]>0x0&&this['channels'][_0x3c815d[_0x95cd('0x24')]]['faxstatus']==='SUCCESS'){this[_0x95cd('0x52')](_0x3c815d['uniqueid'],!![]);}else{this[_0x95cd('0x52')](_0x3c815d[_0x95cd('0x24')],![],this[_0x95cd('0xc')][_0x3c815d[_0x95cd('0x24')]][_0x95cd('0x53')]?_0x95cd('0x54')+this[_0x95cd('0xc')][_0x3c815d[_0x95cd('0x24')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x95cd('0x1f')][_0x95cd('0x55')]=function(_0x3e69d2){var _0x396084=this;return new BPromise(function(_0x3538c5,_0x18ba87){_0x396084[_0x95cd('0x56')](_0x3e69d2,_0x396084[_0x95cd('0xd')][_0x3e69d2[_0x95cd('0x57')]])[_0x95cd('0x3c')](function(_0x29e441){ut['logger'](_0x95cd('0x58'),_0x29e441);_0x3538c5(ut[_0x95cd('0x59')](_0x95cd('0x5a')));})[_0x95cd('0x3e')](function(_0xf123b7){ut[_0x95cd('0x48')](_0x95cd('0x5b'),_0xf123b7);updateStatus(_0x3e69d2);_0x18ba87(ut[_0x95cd('0x59')](_0x95cd('0x5c')));});});};Fax[_0x95cd('0x1f')]['checkAfterSend']=function(_0x18a57a){var _0x59e23c=this;return new BPromise(function(_0x25cf81,_0x2aad01){var _0x19f9f0=_0x59e23c['checkTrunk'](_0x59e23c[_0x95cd('0xd')][_0x18a57a[_0x95cd('0x57')]]['Trunk'],_0x18a57a);if(_0x19f9f0['isValid']){_0x25cf81(ut[_0x95cd('0x59')](_0x95cd('0x5d')));}else{_0x2aad01(ut[_0x95cd('0x59')](_0x19f9f0[_0x95cd('0x59')]));}});};function originate(_0x19ca9e,_0x472e5a,_0x21e5bb){return new BPromise(function(_0x39f8a4,_0xe0228a){if(_0x21e5bb){var _0x3a3758=util[_0x95cd('0x5e')](_0x95cd('0x5f'),path[_0x95cd('0x39')](_0x19ca9e[_0x95cd('0x60')])['name'],_0x19ca9e[_0x95cd('0x60')]);gs[_0x95cd('0x61')](_0x3a3758)[_0x95cd('0x3c')](function(){_0x19ca9e['path']=util[_0x95cd('0x5e')](_0x95cd('0x62'),path[_0x95cd('0x39')](_0x19ca9e[_0x95cd('0x60')])[_0x95cd('0x63')],path[_0x95cd('0x39')](_0x19ca9e[_0x95cd('0x60')])['name']);_0x472e5a['XMF-PATH']=_0x19ca9e['path'];ut[_0x95cd('0x48')](_0x95cd('0x64'),'');ami[_0x95cd('0x65')](ut[_0x95cd('0x66')](_0x19ca9e,_0x472e5a))['then'](function(_0x1f3b7c){_0x39f8a4(_0x1f3b7c);})[_0x95cd('0x3e')](function(_0x180b17){_0xe0228a(_0x180b17);});})[_0x95cd('0x3e')](function(_0x272837){_0xe0228a(_0x272837);});}else{ami[_0x95cd('0x65')](ut[_0x95cd('0x66')](_0x19ca9e,_0x472e5a))['then'](function(_0x39ed49){_0x39f8a4(_0x39ed49);})[_0x95cd('0x3e')](function(_0x319bf1){_0xe0228a(_0x319bf1);});}});}Fax[_0x95cd('0x1f')][_0x95cd('0x56')]=function(_0x1abeee,_0x14d8f8){var _0x1b8f9e=this;return new BPromise(function(_0x29fb3f,_0x52d5fd){var _0x110516=uuid['v4']();var _0x597ddc=ut[_0x95cd('0x67')](_0x1abeee,_0x14d8f8);_0x1b8f9e['actions'][_0x110516]=new Action(_0x110516,_0x14d8f8,_0x1abeee);var _0x4848ff=_0x1b8f9e['actions'][_0x110516];if(path[_0x95cd('0x39')](_0x1abeee[_0x95cd('0x60')])[_0x95cd('0x68')]===_0x95cd('0x3a')){originate(_0x4848ff,_0x597ddc,!![])[_0x95cd('0x3c')](function(_0x6571cf){_0x29fb3f(_0x6571cf);})[_0x95cd('0x3e')](function(_0x57ddca){_0x52d5fd(_0x57ddca);});}else{originate(_0x4848ff,_0x597ddc,![])[_0x95cd('0x3c')](function(_0x3f98da){_0x29fb3f(_0x3f98da);})[_0x95cd('0x3e')](function(_0x4df570){_0x52d5fd(_0x4df570);});}});};Fax['prototype'][_0x95cd('0x69')]=function(_0x3fbccd){return!_['isNil'](_0x3fbccd)&&!_[_0x95cd('0x6a')](_0x3fbccd['name'])&&!_[_0x95cd('0x6a')](_0x3fbccd[_0x95cd('0x6b')])&&_0x3fbccd[_0x95cd('0x6b')]&&!_[_0x95cd('0x6a')](this[_0x95cd('0xe')][util['format'](_0x95cd('0x6c'),_0x3fbccd['name'])])&&!_[_0x95cd('0x6a')](this[_0x95cd('0xe')][util[_0x95cd('0x5e')](_0x95cd('0x6c'),_0x3fbccd[_0x95cd('0x26')])][_0x95cd('0x2e')])&&(this[_0x95cd('0xe')][util[_0x95cd('0x5e')](_0x95cd('0x6c'),_0x3fbccd['name'])][_0x95cd('0x2e')]===_0x95cd('0x6d')||this[_0x95cd('0xe')][util['format']('SIP/%s',_0x3fbccd[_0x95cd('0x26')])]['status']==='unmonitored');};Fax[_0x95cd('0x1f')][_0x95cd('0x6e')]=function(_0x164a13,_0x276e59){if(!this[_0x95cd('0x69')](_0x164a13)){ut[_0x95cd('0x48')](_0x95cd('0x6f'),_[_0x95cd('0x6a')](_0x164a13)?'':_0x164a13['name']+_0x95cd('0x70'));return{'isValid':![],'message':_0x95cd('0x71')};}if(_[_0x95cd('0x6a')](_0x276e59[_0x95cd('0x5')])){ut[_0x95cd('0x48')](_0x95cd('0x72'),JSON[_0x95cd('0x41')](_0x276e59));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x95cd('0x6a')](_0x276e59[_0x95cd('0x60')])){ut[_0x95cd('0x48')](_0x95cd('0x73'),JSON['stringify'](_0x276e59));return{'isValid':![],'message':_0x95cd('0x74')};}return{'isValid':!![],'message':_0x95cd('0x75')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 74ab3fb..3ca0342 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 _0xae2f=['then','catch','util','bluebird','../../../config/logger','preview','../rpc/faxAccount','notify','resolve'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0xae2f,0x161));var _0xfae2=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0xae2f[_0x3ebb69];return _0x421e59;};'use strict';var util=require(_0xfae2('0x0'));var BPromise=require(_0xfae2('0x1'));var logger=require(_0xfae2('0x2'))(_0xfae2('0x3'));var _=require('lodash');var faxAccount=require(_0xfae2('0x4'));function loggerCatch(_0x3b6fc1){return function(_0x51b4ce){logger['error'](_0x3b6fc1,util['inspect'](_0x51b4ce,{'showHidden':![],'depth':null}));};}exports[_0xfae2('0x5')]=function(_0xe469fd,_0x3c5f74){return BPromise[_0xfae2('0x6')]()[_0xfae2('0x7')](faxAccount[_0xfae2('0x5')](_0xe469fd,_0x3c5f74))[_0xfae2('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x4a62=['notify','catch','[Notify]\x20','util','preview','lodash','../rpc/faxAccount','error','inspect','resolve','then'];(function(_0xb91742,_0x1e203f){var _0x19402c=function(_0xe6d76d){while(--_0xe6d76d){_0xb91742['push'](_0xb91742['shift']());}};_0x19402c(++_0x1e203f);}(_0x4a62,0x92));var _0x24a6=function(_0x136120,_0x25bf2b){_0x136120=_0x136120-0x0;var _0xd81136=_0x4a62[_0x136120];return _0xd81136;};'use strict';var util=require(_0x24a6('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x24a6('0x1'));var _=require(_0x24a6('0x2'));var faxAccount=require(_0x24a6('0x3'));function loggerCatch(_0xa578ff){return function(_0x69f5b2){logger[_0x24a6('0x4')](_0xa578ff,util[_0x24a6('0x5')](_0x69f5b2,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x1fb599,_0x4a1b52){return BPromise[_0x24a6('0x6')]()[_0x24a6('0x7')](faxAccount[_0x24a6('0x8')](_0x1fb599,_0x4a1b52))[_0x24a6('0x9')](loggerCatch(_0x24a6('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 519a36f..4e33528 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 _0xff50=['exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','bluebird','child_process'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xff50,0xf8));var _0x0ff5=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xff50[_0x187279];return _0x3da59d;};'use strict';var util=require(_0x0ff5('0x0'));var logger=require(_0x0ff5('0x1'))('fax');var BPromise=require(_0x0ff5('0x2'));var exec=require(_0x0ff5('0x3'))[_0x0ff5('0x4')];exports[_0x0ff5('0x5')]=function(_0x4976c9){return new BPromise(function(_0x21a1c,_0x38ee0e){exec(_0x4976c9,function(_0x4c4301,_0x2eeb8c,_0x3ff081){logger[_0x0ff5('0x6')]('Exec\x20gs',_0x2eeb8c);if(_0x4c4301){logger[_0x0ff5('0x6')](_0x0ff5('0x7'),_0x0ff5('0x8'),util['inspect'](_0x4c4301,{'showHidden':![],'depth':null}),_0x2eeb8c,_0x3ff081);_0x38ee0e(_0x4c4301);}_0x21a1c(_0x2eeb8c);});});}; \ No newline at end of file +var _0x6b73=['bluebird','child_process','exec','info','Exec\x20gs','inspect','util','../../../../config/logger','fax'];(function(_0x5c03dd,_0x33e71c){var _0x145de9=function(_0x4a7537){while(--_0x4a7537){_0x5c03dd['push'](_0x5c03dd['shift']());}};_0x145de9(++_0x33e71c);}(_0x6b73,0x72));var _0x36b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b73[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x36b7('0x0'));var logger=require(_0x36b7('0x1'))(_0x36b7('0x2'));var BPromise=require(_0x36b7('0x3'));var exec=require(_0x36b7('0x4'))[_0x36b7('0x5')];exports['execute']=function(_0xa54d34){return new BPromise(function(_0x3059f1,_0x195908){exec(_0xa54d34,function(_0x3dc05b,_0x35d6ff,_0x1f7e6f){logger[_0x36b7('0x6')](_0x36b7('0x7'),_0x35d6ff);if(_0x3dc05b){logger[_0x36b7('0x6')]('Exec\x20gs','\x20Error\x20:',util[_0x36b7('0x8')](_0x3dc05b,{'showHidden':![],'depth':null}),_0x35d6ff,_0x1f7e6f);_0x195908(_0x3dc05b);}_0x3059f1(_0x35d6ff);});});}; \ 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 a7e965d..2460872 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 _0x951c=['format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','uniqueid','originate','channel','\x22%s\x22\x20<%s>','headerinfo','localstationid','lodash','fax','logger','info','inspect','addVariables','minrate','maxrate'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x951c,0x109));var _0xc951=function(_0x3742b3,_0x2dae6e){_0x3742b3=_0x3742b3-0x0;var _0x18b291=_0x951c[_0x3742b3];return _0x18b291;};'use strict';var util=require('util');var _=require(_0xc951('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xc951('0x1'));exports['message']=function(_0x3588fd){return{'message':_0x3588fd};};exports[_0xc951('0x2')]=function(_0x1105e3,_0xebafef){logger[_0xc951('0x3')](_0x1105e3,util[_0xc951('0x4')](_0xebafef,{'showHidden':![],'depth':null}));};exports[_0xc951('0x5')]=function(_0x3e6f20,_0x3fe554){var _0x4a0ef6={'XMF-ECM':_0x3fe554['ecm'],'XMF-HEADERINFO':_0x3fe554['headerinfo'],'XMF-MINRATE':_0x3fe554[_0xc951('0x6')],'XMF-MAXRATE':_0x3fe554[_0xc951('0x7')],'XMF-MODEM':util[_0xc951('0x8')](_0xc951('0x9'),_0x3fe554[_0xc951('0xa')]),'XMF-GATEWAY':_0x3fe554[_0xc951('0xb')],'XMF-FAXDETECT':_0x3fe554[_0xc951('0xc')],'XMF-T38TIMEOUT':_0x3fe554[_0xc951('0xd')],'XMF-LOCALSTATIONID':_0x3fe554['localstationid'],'XMF-PATH':_0x3e6f20[_0xc951('0xe')]};return _0x4a0ef6;};exports['variablesAction']=function(_0x724a8b,_0x4e38de){return{'actionid':_0x724a8b[_0xc951('0xf')],'action':_0xc951('0x10'),'channel':_0x724a8b[_0xc951('0x11')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0xc951('0x8')](_0xc951('0x12'),_0x724a8b[_0xc951('0x13')]?_0x724a8b[_0xc951('0x13')]:'',_0x724a8b[_0xc951('0x14')]),'variable':_0x4e38de,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x724a8b[_0xc951('0xf')]};}; \ No newline at end of file +var _0x8498=['originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','fax','message','logger','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction'];(function(_0xbf7f82,_0x3114d4){var _0x3165fa=function(_0x34bb41){while(--_0x34bb41){_0xbf7f82['push'](_0xbf7f82['shift']());}};_0x3165fa(++_0x3114d4);}(_0x8498,0x1a7));var _0x8849=function(_0xae0b69,_0x2bd756){_0xae0b69=_0xae0b69-0x0;var _0x5e183e=_0x8498[_0xae0b69];return _0x5e183e;};'use strict';var util=require('util');var _=require(_0x8849('0x0'));var moment=require(_0x8849('0x1'));var logger=require(_0x8849('0x2'))(_0x8849('0x3'));exports[_0x8849('0x4')]=function(_0x576570){return{'message':_0x576570};};exports[_0x8849('0x5')]=function(_0x4ce174,_0x3bd809){logger['info'](_0x4ce174,util['inspect'](_0x3bd809,{'showHidden':![],'depth':null}));};exports[_0x8849('0x6')]=function(_0x1ab0bd,_0x352751){var _0x372e53={'XMF-ECM':_0x352751[_0x8849('0x7')],'XMF-HEADERINFO':_0x352751[_0x8849('0x8')],'XMF-MINRATE':_0x352751['minrate'],'XMF-MAXRATE':_0x352751[_0x8849('0x9')],'XMF-MODEM':util['format'](_0x8849('0xa'),_0x352751[_0x8849('0xb')]),'XMF-GATEWAY':_0x352751['gateway'],'XMF-FAXDETECT':_0x352751[_0x8849('0xc')],'XMF-T38TIMEOUT':_0x352751[_0x8849('0xd')],'XMF-LOCALSTATIONID':_0x352751[_0x8849('0xe')],'XMF-PATH':_0x1ab0bd[_0x8849('0xf')]};return _0x372e53;};exports[_0x8849('0x10')]=function(_0xec36cf,_0x5411fa){return{'actionid':_0xec36cf['uniqueid'],'action':_0x8849('0x11'),'channel':_0xec36cf[_0x8849('0x12')],'Exten':_0x8849('0x13'),'Context':_0x8849('0x14'),'Priority':'1','callerid':util['format'](_0x8849('0x15'),_0xec36cf[_0x8849('0x8')]?_0xec36cf[_0x8849('0x8')]:'',_0xec36cf[_0x8849('0xe')]),'variable':_0x5411fa,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xec36cf['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 8c79ed3..535569c 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 _0xc5b8=['getAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','catch','[index.js][main]','util','moment','./server','./realtime','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','then'];(function(_0x8be5cb,_0x33891b){var _0x22a22f=function(_0x468aef){while(--_0x468aef){_0x8be5cb['push'](_0x8be5cb['shift']());}};_0x22a22f(++_0x33891b);}(_0xc5b8,0xbb));var _0x8c5b=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xc5b8[_0xd1d19a];return _0x52a79d;};'use strict';var util=require(_0x8c5b('0x0'));var moment=require(_0x8c5b('0x1'));var server=require(_0x8c5b('0x2'));var Realtime=require(_0x8c5b('0x3'));var Report=require('./report');var Acw=require(_0x8c5b('0x4'));var Trigger=require(_0x8c5b('0x5'));var Dialer=require(_0x8c5b('0x6'));var Preview=require('./preview');var Fax=require(_0x8c5b('0x7'));var user=require(_0x8c5b('0x8'));var voiceQueue=require(_0x8c5b('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x8c5b('0xa'));var trunk=require(_0x8c5b('0xb'));var trigger=require(_0x8c5b('0xc'));var template=require(_0x8c5b('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x8c5b('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x8c5b('0xf'));var zendesk=require(_0x8c5b('0x10'));var salesforce=require(_0x8c5b('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x8c5b('0x12'));var vtiger=require(_0x8c5b('0x13'));var freshsales=require(_0x8c5b('0x14'));var servicenow=require(_0x8c5b('0x15'));var dynamics365=require(_0x8c5b('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x8c5b('0x17'))(_0x8c5b('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x8c5b('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8c5b('0x1a')](_0x8c5b('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x8c5b('0x1b')]()[_0x8c5b('0x1c')](user[_0x8c5b('0x1d')]())['then'](realtime['initAgents']())[_0x8c5b('0x1c')](user[_0x8c5b('0x1e')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x1f')]())['then'](trunk[_0x8c5b('0x20')]())[_0x8c5b('0x1c')](realtime['initTrunks']())[_0x8c5b('0x1c')](voiceQueue[_0x8c5b('0x21')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x22')]())[_0x8c5b('0x1c')](trigger[_0x8c5b('0x23')]())[_0x8c5b('0x1c')](realtime['initTriggers']())[_0x8c5b('0x1c')](template['getTemplates']())[_0x8c5b('0x1c')](realtime['initTemplates']())[_0x8c5b('0x1c')](zendesk[_0x8c5b('0x24')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x25')]())[_0x8c5b('0x1c')](salesforce[_0x8c5b('0x26')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x27')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x8c5b('0x1c')](realtime['initSugarcrmAccounts']())[_0x8c5b('0x1c')](freshdesk[_0x8c5b('0x28')]())['then'](realtime[_0x8c5b('0x29')]())[_0x8c5b('0x1c')](desk[_0x8c5b('0x2a')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x2b')]())['then'](zoho[_0x8c5b('0x2c')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x2d')]())['then'](vtiger[_0x8c5b('0x2e')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x2f')]())[_0x8c5b('0x1c')](freshsales[_0x8c5b('0x30')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x31')]())[_0x8c5b('0x1c')](servicenow[_0x8c5b('0x32')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x33')]())[_0x8c5b('0x1c')](dynamics365[_0x8c5b('0x34')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x35')]())[_0x8c5b('0x1c')](campaign[_0x8c5b('0x36')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x37')]())[_0x8c5b('0x1c')](voiceExtension[_0x8c5b('0x38')]())[_0x8c5b('0x1c')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x8c5b('0x39')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x3a')]())[_0x8c5b('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x8c5b('0x1b')]()[_0x8c5b('0x1c')](voiceQueueReport[_0x8c5b('0x3b')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x3c')]())[_0x8c5b('0x1c')](cmHopperHistory[_0x8c5b('0x3d')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x3e')]())['then'](cmHopperHistory[_0x8c5b('0x3f')]())[_0x8c5b('0x1c')](realtime[_0x8c5b('0x40')]())[_0x8c5b('0x1c')](voiceCallReport[_0x8c5b('0x41')]())['then'](realtime['initVoiceCallReports']())['catch'](function(_0x476fa5){logger[_0x8c5b('0x42')](_0x8c5b('0x43'),util[_0x8c5b('0x44')](_0x476fa5,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8c5b('0x45')](realtime,preview,fax)[_0x8c5b('0x1c')](function(){return initRealtime();})[_0x8c5b('0x1c')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x8c5b('0x46')](function(_0x4da294){logger[_0x8c5b('0x42')](_0x8c5b('0x47'),util['inspect'](_0x4da294,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x1642=['getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','sync','[index.js][main]','inspect','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts'];(function(_0x5a704d,_0x4082d8){var _0x1f76e1=function(_0x3d20c0){while(--_0x3d20c0){_0x5a704d['push'](_0x5a704d['shift']());}};_0x1f76e1(++_0x4082d8);}(_0x1642,0x1ed));var _0x2164=function(_0x4a1433,_0x509eb6){_0x4a1433=_0x4a1433-0x0;var _0x24858a=_0x1642[_0x4a1433];return _0x24858a;};'use strict';var util=require(_0x2164('0x0'));var moment=require(_0x2164('0x1'));var server=require(_0x2164('0x2'));var Realtime=require(_0x2164('0x3'));var Report=require(_0x2164('0x4'));var Acw=require('./acw');var Trigger=require(_0x2164('0x5'));var Dialer=require(_0x2164('0x6'));var Preview=require(_0x2164('0x7'));var Fax=require(_0x2164('0x8'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x2164('0x9'));var trunk=require(_0x2164('0xa'));var trigger=require(_0x2164('0xb'));var template=require(_0x2164('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x2164('0xd'));var voiceExtension=require(_0x2164('0xe'));var faxAccount=require(_0x2164('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x2164('0x10'));var sugarcrm=require(_0x2164('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x2164('0x12'));var zoho=require(_0x2164('0x13'));var vtiger=require(_0x2164('0x14'));var freshsales=require(_0x2164('0x15'));var servicenow=require(_0x2164('0x16'));var dynamics365=require(_0x2164('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x2164('0x18'))(_0x2164('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2164('0x1a')](_0x2164('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2164('0x1a')](_0x2164('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x2164('0x1c')](user[_0x2164('0x1d')]())[_0x2164('0x1c')](realtime[_0x2164('0x1e')]())[_0x2164('0x1c')](user[_0x2164('0x1f')]())['then'](realtime[_0x2164('0x20')]())[_0x2164('0x1c')](trunk[_0x2164('0x21')]())[_0x2164('0x1c')](realtime[_0x2164('0x22')]())[_0x2164('0x1c')](voiceQueue['getVoiceQueues']())['then'](realtime[_0x2164('0x23')]())[_0x2164('0x1c')](trigger[_0x2164('0x24')]())[_0x2164('0x1c')](realtime['initTriggers']())[_0x2164('0x1c')](template[_0x2164('0x25')]())[_0x2164('0x1c')](realtime[_0x2164('0x26')]())['then'](zendesk['getZendeskAccounts']())[_0x2164('0x1c')](realtime[_0x2164('0x27')]())[_0x2164('0x1c')](salesforce[_0x2164('0x28')]())[_0x2164('0x1c')](realtime[_0x2164('0x29')]())[_0x2164('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0x2164('0x1c')](realtime[_0x2164('0x2a')]())[_0x2164('0x1c')](freshdesk[_0x2164('0x2b')]())[_0x2164('0x1c')](realtime[_0x2164('0x2c')]())[_0x2164('0x1c')](desk['getDeskAccounts']())[_0x2164('0x1c')](realtime[_0x2164('0x2d')]())[_0x2164('0x1c')](zoho[_0x2164('0x2e')]())[_0x2164('0x1c')](realtime[_0x2164('0x2f')]())['then'](vtiger[_0x2164('0x30')]())[_0x2164('0x1c')](realtime[_0x2164('0x31')]())[_0x2164('0x1c')](freshsales[_0x2164('0x32')]())[_0x2164('0x1c')](realtime['initFreshsalesAccounts']())[_0x2164('0x1c')](servicenow[_0x2164('0x33')]())[_0x2164('0x1c')](realtime[_0x2164('0x34')]())[_0x2164('0x1c')](dynamics365['getDynamics365Accounts']())[_0x2164('0x1c')](realtime[_0x2164('0x35')]())[_0x2164('0x1c')](campaign['getCampaigns']())[_0x2164('0x1c')](realtime[_0x2164('0x36')]())['then'](voiceExtension[_0x2164('0x37')]())[_0x2164('0x1c')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x2164('0x38')]())[_0x2164('0x1c')](realtime[_0x2164('0x39')]())[_0x2164('0x1c')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x2164('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0x2164('0x1c')](realtime[_0x2164('0x3a')]())[_0x2164('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x2164('0x1c')](realtime[_0x2164('0x3b')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x2164('0x1c')](realtime['initCampaignHopperHistory']())[_0x2164('0x1c')](voiceCallReport[_0x2164('0x3c')]())[_0x2164('0x1c')](realtime[_0x2164('0x3d')]())[_0x2164('0x3e')](function(_0x241798){logger[_0x2164('0x3f')]('[index.js][initParams]',util['inspect'](_0x241798,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x2164('0x1c')](function(){return initParams();})[_0x2164('0x1c')](function(){report[_0x2164('0x40')]();setInterval(initRealtime,0x1388);})[_0x2164('0x3e')](function(_0x26b826){logger['error'](_0x2164('0x41'),util[_0x2164('0x42')](_0x26b826,{'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 9f59651..b0de0f3 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 _0xb229=['name','email','accountcode','state','stateTime','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','toLowerCase','inuse','statePause','format','fullname','status','voiceStatusQueue','stringify','user:%s','emit','omit','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x5d8114,_0x10c635){var _0x2de21b=function(_0x3c3a94){while(--_0x3c3a94){_0x5d8114['push'](_0x5d8114['shift']());}};_0x2de21b(++_0x10c635);}(_0xb229,0x93));var _0x9b22=function(_0x1f4867,_0x165779){_0x1f4867=_0x1f4867-0x0;var _0x3094af=_0xb229[_0x1f4867];return _0x3094af;};'use strict';var _=require(_0x9b22('0x0'));var util=require(_0x9b22('0x1'));var moment=require(_0x9b22('0x2'));var md5=require(_0x9b22('0x3'));var Redis=require(_0x9b22('0x4'));var config=require(_0x9b22('0x5'));config[_0x9b22('0x6')]=_['defaults'](config[_0x9b22('0x6')],{'host':_0x9b22('0x7'),'port':0x18eb});var io=require(_0x9b22('0x8'))(new Redis(config['redis']));function Agent(_0x386fe9){this['id']=_0x386fe9['id']||0x0;this[_0x9b22('0x9')]=_0x386fe9[_0x9b22('0x9')]||'';this['email']=_0x386fe9[_0x9b22('0xa')]||'';this[_0x9b22('0xb')]=_0x386fe9['accountcode']||'';this['fullname']=_0x386fe9['fullname']||'';this[_0x9b22('0xc')]='unknown';this[_0x9b22('0xd')]=0x0;this['status']=_0x9b22('0xe');this[_0x9b22('0xf')]='';this[_0x9b22('0x10')]='';this[_0x9b22('0x11')]='';this[_0x9b22('0x12')]='';this[_0x9b22('0x13')]=_0x386fe9[_0x9b22('0x13')]||![];this[_0x9b22('0x14')]=_0x9b22('0xe');this[_0x9b22('0x15')]=0x0;this[_0x9b22('0x16')]='';this['voiceStatusQueue']='';this[_0x9b22('0x17')]=![];this[_0x9b22('0x18')]=![];this[_0x9b22('0x3')]='';}Agent[_0x9b22('0x19')]['updateStatusRealtime']=function(_0x1604b0){var _0x57a989;if(_0x1604b0&&_0x1604b0[_0x9b22('0xc')]){_0x57a989=_0x1604b0[_0x9b22('0xc')][_0x9b22('0x1a')]();switch(_0x57a989){case'not_inuse':_0x57a989='idle';break;case _0x9b22('0x1b'):_0x57a989='talking';break;}}if(_0x57a989&&this[_0x9b22('0x14')]!==_0x57a989||_0x1604b0[_0x9b22('0x1c')]){this[_0x9b22('0x15')]=_['toNumber'](moment()[_0x9b22('0x1d')]('x'));}if(_0x57a989){this[_0x9b22('0x14')]=_0x57a989;}var _0xebe73={'id':this['id'],'name':this[_0x9b22('0x9')],'email':this['email'],'accountcode':this[_0x9b22('0xb')],'fullname':this[_0x9b22('0x1e')],'state':this[_0x9b22('0xc')],'stateTime':this[_0x9b22('0xd')],'status':this[_0x9b22('0x1f')],'address':this[_0x9b22('0xf')],'online':this[_0x9b22('0x13')],'voiceStatus':this[_0x9b22('0x14')],'voiceStatusTime':this[_0x9b22('0x15')],'voiceStatusCallerIdNumber':this[_0x9b22('0x16')],'voiceStatusQueue':this[_0x9b22('0x20')],'interface':this['interface'],'onhold':this[_0x9b22('0x17')]};var _0x212468=md5(JSON[_0x9b22('0x21')](_0xebe73));if(this['md5']!==_0x212468){this['md5']=_0x212468;io['to'](util[_0x9b22('0x1d')](_0x9b22('0x22'),_0xebe73[_0x9b22('0x9')]))[_0x9b22('0x23')]('user:ami:update',_[_0x9b22('0x24')](_0xebe73,[_0x9b22('0x13')]));io[_0x9b22('0x23')](_0x9b22('0x25'),_0xebe73);}};module[_0x9b22('0x26')]=Agent; \ No newline at end of file +var _0x9ba9=['voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','toNumber','stateTime','stringify','format','user:%s','emit','user:ami:update','lodash','moment','md5','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','accountcode','fullname','state','unknown','status','address','mobile','interface','online','voiceStatus'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9ba9,0x141));var _0x99ba=function(_0x23a1cf,_0x4a38b2){_0x23a1cf=_0x23a1cf-0x0;var _0x19bc58=_0x9ba9[_0x23a1cf];return _0x19bc58;};'use strict';var _=require(_0x99ba('0x0'));var util=require('util');var moment=require(_0x99ba('0x1'));var md5=require(_0x99ba('0x2'));var Redis=require('ioredis');var config=require(_0x99ba('0x3'));config['redis']=_[_0x99ba('0x4')](config[_0x99ba('0x5')],{'host':_0x99ba('0x6'),'port':0x18eb});var io=require(_0x99ba('0x7'))(new Redis(config['redis']));function Agent(_0x102a80){this['id']=_0x102a80['id']||0x0;this[_0x99ba('0x8')]=_0x102a80[_0x99ba('0x8')]||'';this['email']=_0x102a80['email']||'';this[_0x99ba('0x9')]=_0x102a80[_0x99ba('0x9')]||'';this[_0x99ba('0xa')]=_0x102a80[_0x99ba('0xa')]||'';this[_0x99ba('0xb')]=_0x99ba('0xc');this['stateTime']=0x0;this[_0x99ba('0xd')]=_0x99ba('0xc');this[_0x99ba('0xe')]='';this['phone']='';this[_0x99ba('0xf')]='';this[_0x99ba('0x10')]='';this[_0x99ba('0x11')]=_0x102a80[_0x99ba('0x11')]||![];this[_0x99ba('0x12')]=_0x99ba('0xc');this[_0x99ba('0x13')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x99ba('0x14')]='';this[_0x99ba('0x15')]=![];this[_0x99ba('0x16')]=![];this[_0x99ba('0x2')]='';}Agent['prototype'][_0x99ba('0x17')]=function(_0x3517fc){var _0x20add8;if(_0x3517fc&&_0x3517fc['state']){_0x20add8=_0x3517fc[_0x99ba('0xb')][_0x99ba('0x18')]();switch(_0x20add8){case _0x99ba('0x19'):_0x20add8='idle';break;case _0x99ba('0x1a'):_0x20add8='talking';break;}}if(_0x20add8&&this[_0x99ba('0x12')]!==_0x20add8||_0x3517fc['statePause']){this[_0x99ba('0x13')]=_[_0x99ba('0x1b')](moment()['format']('x'));}if(_0x20add8){this[_0x99ba('0x12')]=_0x20add8;}var _0x211367={'id':this['id'],'name':this[_0x99ba('0x8')],'email':this['email'],'accountcode':this[_0x99ba('0x9')],'fullname':this['fullname'],'state':this[_0x99ba('0xb')],'stateTime':this[_0x99ba('0x1c')],'status':this[_0x99ba('0xd')],'address':this[_0x99ba('0xe')],'online':this[_0x99ba('0x11')],'voiceStatus':this[_0x99ba('0x12')],'voiceStatusTime':this[_0x99ba('0x13')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x99ba('0x14')],'interface':this[_0x99ba('0x10')],'onhold':this[_0x99ba('0x15')]};var _0x467ece=md5(JSON[_0x99ba('0x1d')](_0x211367));if(this[_0x99ba('0x2')]!==_0x467ece){this[_0x99ba('0x2')]=_0x467ece;io['to'](util[_0x99ba('0x1e')](_0x99ba('0x1f'),_0x211367['name']))[_0x99ba('0x20')](_0x99ba('0x21'),_['omit'](_0x211367,[_0x99ba('0x11')]));io[_0x99ba('0x20')]('user:presence',_0x211367);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index caaf881..e3d051a 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 _0x1955=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x4bbaf3,_0x39bc17){var _0x5cd47d=function(_0x161563){while(--_0x161563){_0x4bbaf3['push'](_0x4bbaf3['shift']());}};_0x5cd47d(++_0x39bc17);}(_0x1955,0x7c));var _0x5195=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1955[_0x27af45];return _0x18df21;};'use strict';function Campaign(_0x35e6a3){this['id']=_0x35e6a3['id']||0x0;this[_0x5195('0x0')]=_0x35e6a3[_0x5195('0x0')]||'';this[_0x5195('0x1')]=_0x35e6a3[_0x5195('0x1')]||_0x5195('0x2');this['originated']=0x0;this[_0x5195('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x5195('0x4')]=0x0;this[_0x5195('0x5')]='';this[_0x5195('0x6')]=!![];this['active']=_0x35e6a3['active'];this[_0x5195('0x7')]=_0x35e6a3[_0x5195('0x7')];this[_0x5195('0x8')]=_0x35e6a3[_0x5195('0x8')]||null;this[_0x5195('0x9')]=_0x35e6a3[_0x5195('0x9')]?_0x35e6a3['dialGlobalInterval']:null;this[_0x5195('0xa')]=_0x35e6a3[_0x5195('0xa')];this[_0x5195('0xb')]=_0x35e6a3[_0x5195('0xb')];this['dialOriginateTimeout']=_0x35e6a3['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x35e6a3['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x35e6a3[_0x5195('0xc')];this[_0x5195('0xd')]=_0x35e6a3['dialBusyMaxRetry'];this[_0x5195('0xe')]=_0x35e6a3['dialBusyRetryFrequency'];this[_0x5195('0xf')]=_0x35e6a3['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x35e6a3[_0x5195('0x10')];this[_0x5195('0x11')]=_0x35e6a3[_0x5195('0x11')];this['dialNoSuchNumberMaxRetry']=_0x35e6a3['dialNoSuchNumberMaxRetry']||0x3;this[_0x5195('0x12')]=_0x35e6a3[_0x5195('0x12')]||0x96;this[_0x5195('0x13')]=_0x35e6a3[_0x5195('0x13')]||0x3;this[_0x5195('0x14')]=_0x35e6a3[_0x5195('0x14')]||0x96;this[_0x5195('0x15')]=_0x35e6a3[_0x5195('0x15')]||0x3;this[_0x5195('0x16')]=_0x35e6a3['dialAbandonedRetryFrequency']||0x96;this[_0x5195('0x17')]=_0x35e6a3[_0x5195('0x17')]||0x3;this[_0x5195('0x18')]=_0x35e6a3[_0x5195('0x18')]||0x96;this[_0x5195('0x19')]=_0x35e6a3['dialAgentRejectMaxRetry']||0x3;this[_0x5195('0x1a')]=_0x35e6a3['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x35e6a3[_0x5195('0x1b')]||_0x5195('0x1c');this['dialPrefix']=_0x35e6a3[_0x5195('0x1d')]||undefined;this[_0x5195('0x1e')]=_0x35e6a3[_0x5195('0x1e')]||undefined;this['dialCutDigit']=_0x35e6a3[_0x5195('0x1f')]||undefined;this[_0x5195('0x20')]=_0x35e6a3[_0x5195('0x20')]?_0x35e6a3['TrunkBackup']:undefined;this[_0x5195('0x21')]=_0x35e6a3[_0x5195('0x21')]?_0x35e6a3[_0x5195('0x21')]:undefined;this[_0x5195('0x22')]=_0x35e6a3['Interval']?_0x35e6a3['Interval']:undefined;this[_0x5195('0x23')]=_0x35e6a3[_0x5195('0x23')]?_0x35e6a3[_0x5195('0x23')]:undefined;this[_0x5195('0x24')]=_0x35e6a3['SquareProject']?_0x35e6a3[_0x5195('0x23')]['name']:undefined;this[_0x5195('0x25')]=_0x35e6a3['dialAMDActive']||![];this[_0x5195('0x26')]=_0x35e6a3['dialAMDInitialSilence'];this[_0x5195('0x27')]=_0x35e6a3[_0x5195('0x27')];this[_0x5195('0x28')]=_0x35e6a3[_0x5195('0x28')];this[_0x5195('0x29')]=_0x35e6a3['dialAMDTotalAnalysisTime'];this[_0x5195('0x2a')]=_0x35e6a3[_0x5195('0x2a')];this[_0x5195('0x2b')]=_0x35e6a3[_0x5195('0x2b')];this[_0x5195('0x2c')]=_0x35e6a3['dialAMDMaximumNumberOfWords'];this[_0x5195('0x2d')]=_0x35e6a3[_0x5195('0x2d')];this[_0x5195('0x2e')]=_0x35e6a3['dialAMDMaximumWordLength'];}module[_0x5195('0x2f')]=Campaign; \ No newline at end of file +var _0xd910=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix'];(function(_0x28ea3b,_0x13d7a1){var _0x5ac766=function(_0x1ea77b){while(--_0x1ea77b){_0x28ea3b['push'](_0x28ea3b['shift']());}};_0x5ac766(++_0x13d7a1);}(_0xd910,0x116));var _0x0d91=function(_0x50c9d9,_0x5f2417){_0x50c9d9=_0x50c9d9-0x0;var _0x277ec7=_0xd910[_0x50c9d9];return _0x277ec7;};'use strict';function Campaign(_0x980290){this['id']=_0x980290['id']||0x0;this[_0x0d91('0x0')]=_0x980290[_0x0d91('0x0')]||'';this[_0x0d91('0x1')]=_0x980290[_0x0d91('0x1')]||_0x0d91('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x0d91('0x3')]=0x0;this[_0x0d91('0x4')]=0x0;this[_0x0d91('0x5')]='';this[_0x0d91('0x6')]=!![];this[_0x0d91('0x7')]=_0x980290[_0x0d91('0x7')];this[_0x0d91('0x8')]=_0x980290[_0x0d91('0x8')];this[_0x0d91('0x9')]=_0x980290[_0x0d91('0x9')]||null;this[_0x0d91('0xa')]=_0x980290[_0x0d91('0xa')]?_0x980290['dialGlobalInterval']:null;this[_0x0d91('0xb')]=_0x980290[_0x0d91('0xb')];this[_0x0d91('0xc')]=_0x980290[_0x0d91('0xc')];this['dialOriginateTimeout']=_0x980290[_0x0d91('0xd')]||0x1e;this[_0x0d91('0xe')]=_0x980290[_0x0d91('0xe')];this['dialCongestionRetryFrequency']=_0x980290[_0x0d91('0xf')];this[_0x0d91('0x10')]=_0x980290['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x980290[_0x0d91('0x11')];this[_0x0d91('0x12')]=_0x980290[_0x0d91('0x12')];this[_0x0d91('0x13')]=_0x980290[_0x0d91('0x13')];this['dialGlobalMaxRetry']=_0x980290[_0x0d91('0x14')];this[_0x0d91('0x15')]=_0x980290[_0x0d91('0x15')]||0x3;this[_0x0d91('0x16')]=_0x980290['dialNoSuchNumberRetryFrequency']||0x96;this[_0x0d91('0x17')]=_0x980290['dialDropMaxRetry']||0x3;this[_0x0d91('0x18')]=_0x980290[_0x0d91('0x18')]||0x96;this[_0x0d91('0x19')]=_0x980290[_0x0d91('0x19')]||0x3;this[_0x0d91('0x1a')]=_0x980290[_0x0d91('0x1a')]||0x96;this[_0x0d91('0x1b')]=_0x980290[_0x0d91('0x1b')]||0x3;this[_0x0d91('0x1c')]=_0x980290[_0x0d91('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x980290[_0x0d91('0x1d')]||0x3;this[_0x0d91('0x1e')]=_0x980290['dialAgentRejectRetryFrequency']||0x96;this[_0x0d91('0x1f')]=_0x980290[_0x0d91('0x1f')]||_0x0d91('0x20');this[_0x0d91('0x21')]=_0x980290[_0x0d91('0x21')]||undefined;this[_0x0d91('0x22')]=_0x980290['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x0d91('0x23')]=_0x980290['dialCutDigit']||undefined;this[_0x0d91('0x24')]=_0x980290[_0x0d91('0x24')]?_0x980290['TrunkBackup']:undefined;this['Trunk']=_0x980290[_0x0d91('0x25')]?_0x980290[_0x0d91('0x25')]:undefined;this[_0x0d91('0x26')]=_0x980290['Interval']?_0x980290['Interval']:undefined;this['SquareProject']=_0x980290[_0x0d91('0x27')]?_0x980290[_0x0d91('0x27')]:undefined;this[_0x0d91('0x28')]=_0x980290[_0x0d91('0x27')]?_0x980290[_0x0d91('0x27')][_0x0d91('0x0')]:undefined;this[_0x0d91('0x29')]=_0x980290[_0x0d91('0x29')]||![];this[_0x0d91('0x2a')]=_0x980290[_0x0d91('0x2a')];this[_0x0d91('0x2b')]=_0x980290[_0x0d91('0x2b')];this[_0x0d91('0x2c')]=_0x980290[_0x0d91('0x2c')];this[_0x0d91('0x2d')]=_0x980290[_0x0d91('0x2d')];this[_0x0d91('0x2e')]=_0x980290[_0x0d91('0x2e')];this['dialAMDBetweenWordsSilence']=_0x980290[_0x0d91('0x2f')];this[_0x0d91('0x30')]=_0x980290['dialAMDMaximumNumberOfWords'];this[_0x0d91('0x31')]=_0x980290['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x980290[_0x0d91('0x32')];}module[_0x0d91('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 8e554d6..9bc1026 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 _0x082a=['endtime','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transferType','mohtime','exports','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answertime'];(function(_0x2e74bc,_0x39eba3){var _0x4857b4=function(_0x213b45){while(--_0x213b45){_0x2e74bc['push'](_0x2e74bc['shift']());}};_0x4857b4(++_0x39eba3);}(_0x082a,0x154));var _0xa082=function(_0x2bcb20,_0x1faf26){_0x2bcb20=_0x2bcb20-0x0;var _0x417afc=_0x082a[_0x2bcb20];return _0x417afc;};'use strict';function Channel(){this['starttime']=null;this[_0xa082('0x0')]='';this[_0xa082('0x1')]='';this[_0xa082('0x2')]=0x0;this['calleridname']='';this[_0xa082('0x3')]=undefined;this[_0xa082('0x4')]=undefined;this[_0xa082('0x5')]=0x0;this[_0xa082('0x6')]='';this[_0xa082('0x7')]=0x0;this['linkedid']=0x0;this[_0xa082('0x8')]=0x0;this['answered']=![];this[_0xa082('0x9')]=null;this[_0xa082('0xa')]=null;this['unmanaged']=![];this[_0xa082('0xb')]=![];this[_0xa082('0xc')]='';this[_0xa082('0xd')]='';this['duration']=0x0;this[_0xa082('0xe')]=0x0;this[_0xa082('0xf')]=0x0;this[_0xa082('0x10')]=null;this[_0xa082('0x11')]=null;this[_0xa082('0x12')]=null;this['monitor']=![];this[_0xa082('0x13')]=null;this[_0xa082('0x14')]=null;this[_0xa082('0x15')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0xa082('0x16')]=undefined;this[_0xa082('0x17')]=0x0;}module[_0xa082('0x18')]=Channel; \ No newline at end of file +var _0x4c84=['endtime','unmanaged','abandoned','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','answered'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x4c84,0x124));var _0x44c8=function(_0x19577e,_0x240310){_0x19577e=_0x19577e-0x0;var _0x30c95a=_0x4c84[_0x19577e];return _0x30c95a;};'use strict';function Channel(){this['starttime']=null;this[_0x44c8('0x0')]='';this[_0x44c8('0x1')]='';this['calleridnum']=0x0;this[_0x44c8('0x2')]='';this[_0x44c8('0x3')]=undefined;this[_0x44c8('0x4')]=undefined;this[_0x44c8('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x44c8('0x6')]=![];this['answertime']=null;this[_0x44c8('0x7')]=null;this[_0x44c8('0x8')]=![];this[_0x44c8('0x9')]=![];this['lastapplication']='';this[_0x44c8('0xa')]='';this['duration']=0x0;this[_0x44c8('0xb')]=0x0;this[_0x44c8('0xc')]=0x0;this[_0x44c8('0xd')]=null;this[_0x44c8('0xe')]=null;this[_0x44c8('0xf')]=null;this[_0x44c8('0x10')]=![];this[_0x44c8('0x11')]=null;this[_0x44c8('0x12')]=null;this['monitors']=[];this[_0x44c8('0x13')]=undefined;this[_0x44c8('0x14')]=undefined;this['transferType']=undefined;this[_0x44c8('0x15')]=0x0;}module[_0x44c8('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 324f92e..14f26b5 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 _0xdef8=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x13b6c5,_0x357439){var _0x3ba36d=function(_0x2d2ff6){while(--_0x2d2ff6){_0x13b6c5['push'](_0x13b6c5['shift']());}};_0x3ba36d(++_0x357439);}(_0xdef8,0xcf));var _0x8def=function(_0x5a7143,_0x364aad){_0x5a7143=_0x5a7143-0x0;var _0x2bd337=_0xdef8[_0x5a7143];return _0x2bd337;};'use strict';function DeskAccount(_0x3ad369){this['id']=_0x3ad369['id']||0x0;this[_0x8def('0x0')]=_0x3ad369[_0x8def('0x0')]||'';this[_0x8def('0x1')]=_0x3ad369[_0x8def('0x1')]||'';this[_0x8def('0x2')]=_0x3ad369[_0x8def('0x2')]||'';this['authType']=_0x3ad369[_0x8def('0x3')]||'';this[_0x8def('0x4')]=_0x3ad369[_0x8def('0x4')]||'';this[_0x8def('0x5')]=_0x3ad369[_0x8def('0x5')]||'';this['consumerSecret']=_0x3ad369[_0x8def('0x6')]||'';this[_0x8def('0x7')]=_0x3ad369['token']||'';this[_0x8def('0x8')]=_0x3ad369[_0x8def('0x8')]||'';this['type']=_0x3ad369['type']||'';this[_0x8def('0x9')]=_0x3ad369[_0x8def('0x9')]||'';this['Configurations']=_0x3ad369[_0x8def('0xa')]||{};}module[_0x8def('0xb')]=DeskAccount; \ No newline at end of file +var _0x3afa=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0x3afa,0x112));var _0xa3af=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x3afa[_0x1304c6];return _0x2e6654;};'use strict';function DeskAccount(_0x231232){this['id']=_0x231232['id']||0x0;this[_0xa3af('0x0')]=_0x231232['name']||'';this[_0xa3af('0x1')]=_0x231232[_0xa3af('0x1')]||'';this[_0xa3af('0x2')]=_0x231232[_0xa3af('0x2')]||'';this[_0xa3af('0x3')]=_0x231232[_0xa3af('0x3')]||'';this['password']=_0x231232[_0xa3af('0x4')]||'';this[_0xa3af('0x5')]=_0x231232[_0xa3af('0x5')]||'';this[_0xa3af('0x6')]=_0x231232[_0xa3af('0x6')]||'';this['token']=_0x231232[_0xa3af('0x7')]||'';this[_0xa3af('0x8')]=_0x231232[_0xa3af('0x8')]||'';this[_0xa3af('0x9')]=_0x231232[_0xa3af('0x9')]||'';this[_0xa3af('0xa')]=_0x231232['serverUrl']||'';this[_0xa3af('0xb')]=_0x231232[_0xa3af('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 4d831d1..b5b0968 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 _0xf32f=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','Configurations','CloudProvider'];(function(_0x40fb94,_0x1a0322){var _0x515217=function(_0x4a25ad){while(--_0x4a25ad){_0x40fb94['push'](_0x40fb94['shift']());}};_0x515217(++_0x1a0322);}(_0xf32f,0x135));var _0xff32=function(_0x126538,_0x27bfef){_0x126538=_0x126538-0x0;var _0xa82f62=_0xf32f[_0x126538];return _0xa82f62;};'use strict';function Dynamics365Account(_0x2c63dd){this['id']=_0x2c63dd['id']||0x0;this[_0xff32('0x0')]=_0x2c63dd[_0xff32('0x0')]||'';this[_0xff32('0x1')]=_0x2c63dd[_0xff32('0x1')]||'';this[_0xff32('0x2')]=_0x2c63dd['password']||'';this[_0xff32('0x3')]=_0x2c63dd[_0xff32('0x3')]||'';this[_0xff32('0x4')]=_0x2c63dd[_0xff32('0x4')]||'';this['clientId']=_0x2c63dd[_0xff32('0x5')]||'';this[_0xff32('0x6')]=_0x2c63dd[_0xff32('0x6')]||{};this['serverUrl']=_0x2c63dd['serverUrl']||'';this[_0xff32('0x7')]=_0x2c63dd[_0xff32('0x7')]||![];this[_0xff32('0x8')]=_0x2c63dd['Configurations']||{};this[_0xff32('0x9')]=_0x2c63dd[_0xff32('0x9')]||{};}module[_0xff32('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x52b0=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0x52b0,0x168));var _0x052b=function(_0x3634e9,_0x20d9fb){_0x3634e9=_0x3634e9-0x0;var _0x46ce35=_0x52b0[_0x3634e9];return _0x46ce35;};'use strict';function Dynamics365Account(_0x8b7491){this['id']=_0x8b7491['id']||0x0;this[_0x052b('0x0')]=_0x8b7491[_0x052b('0x0')]||'';this['username']=_0x8b7491[_0x052b('0x1')]||'';this[_0x052b('0x2')]=_0x8b7491[_0x052b('0x2')]||'';this['remoteUri']=_0x8b7491[_0x052b('0x3')]||'';this[_0x052b('0x4')]=_0x8b7491[_0x052b('0x4')]||'';this['clientId']=_0x8b7491[_0x052b('0x5')]||'';this[_0x052b('0x6')]=_0x8b7491['clientSecret']||{};this[_0x052b('0x7')]=_0x8b7491[_0x052b('0x7')]||'';this[_0x052b('0x8')]=_0x8b7491['modernAuthentication']||![];this[_0x052b('0x9')]=_0x8b7491[_0x052b('0x9')]||{};this[_0x052b('0xa')]=_0x8b7491['CloudProvider']||{};}module[_0x052b('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 6ebb307..355ebaf 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 _0xf325=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','exports','name'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0xf325,0x164));var _0x5f32=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xf325[_0x599f41];return _0x2e4d58;};'use strict';function FaxAccount(_0x3c3872){this['id']=_0x3c3872['id']||0x0;this[_0x5f32('0x0')]=_0x3c3872[_0x5f32('0x0')]||'';this[_0x5f32('0x1')]=_0x3c3872[_0x5f32('0x1')];this[_0x5f32('0x2')]=_0x3c3872[_0x5f32('0x2')];this[_0x5f32('0x3')]=_0x3c3872[_0x5f32('0x3')];this['localstationid']=_0x3c3872[_0x5f32('0x4')];this[_0x5f32('0x5')]=_0x3c3872[_0x5f32('0x5')]||0x960;this[_0x5f32('0x6')]=_0x3c3872['maxrate']||0x3840;this[_0x5f32('0x7')]=_0x3c3872[_0x5f32('0x7')]||_0x5f32('0x8');this[_0x5f32('0x9')]=_0x3c3872[_0x5f32('0x9')]||'no';this[_0x5f32('0xa')]=_0x3c3872[_0x5f32('0xa')]||'no';this[_0x5f32('0xb')]=_0x3c3872['t38timeout']||0x1388;this[_0x5f32('0xc')]=_0x3c3872[_0x5f32('0xc')]||_0x5f32('0xd');this[_0x5f32('0xe')]=_0x3c3872['Trunk']?_0x3c3872['Trunk']:undefined;this['ListId']=_0x3c3872[_0x5f32('0xf')];this['key']=_0x3c3872['key'];}module[_0x5f32('0x10')]=FaxAccount; \ No newline at end of file +var _0x3a17=['t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x41d51c,_0x3bb628){var _0x865f6e=function(_0x522e97){while(--_0x522e97){_0x41d51c['push'](_0x41d51c['shift']());}};_0x865f6e(++_0x3bb628);}(_0x3a17,0xb0));var _0x73a1=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x3a17[_0x42bdad];return _0x122626;};'use strict';function FaxAccount(_0x3d14f9){this['id']=_0x3d14f9['id']||0x0;this[_0x73a1('0x0')]=_0x3d14f9[_0x73a1('0x0')]||'';this[_0x73a1('0x1')]=_0x3d14f9[_0x73a1('0x1')];this['ecm']=_0x3d14f9[_0x73a1('0x2')];this[_0x73a1('0x3')]=_0x3d14f9[_0x73a1('0x3')];this[_0x73a1('0x4')]=_0x3d14f9['localstationid'];this[_0x73a1('0x5')]=_0x3d14f9[_0x73a1('0x5')]||0x960;this['maxrate']=_0x3d14f9[_0x73a1('0x6')]||0x3840;this[_0x73a1('0x7')]=_0x3d14f9['modem']||_0x73a1('0x8');this[_0x73a1('0x9')]=_0x3d14f9[_0x73a1('0x9')]||'no';this['faxdetect']=_0x3d14f9[_0x73a1('0xa')]||'no';this[_0x73a1('0xb')]=_0x3d14f9[_0x73a1('0xb')]||0x1388;this[_0x73a1('0xc')]=_0x3d14f9[_0x73a1('0xc')]||_0x73a1('0xd');this[_0x73a1('0xe')]=_0x3d14f9[_0x73a1('0xe')]?_0x3d14f9[_0x73a1('0xe')]:undefined;this['ListId']=_0x3d14f9[_0x73a1('0xf')];this[_0x73a1('0x10')]=_0x3d14f9[_0x73a1('0x10')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 5c1ae47..d8b2ae9 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 _0x4644=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x22e7af,_0x44f22a){var _0x43f1b6=function(_0x580019){while(--_0x580019){_0x22e7af['push'](_0x22e7af['shift']());}};_0x43f1b6(++_0x44f22a);}(_0x4644,0x176));var _0x4464=function(_0x222d28,_0x3fb46c){_0x222d28=_0x222d28-0x0;var _0x3cf2c5=_0x4644[_0x222d28];return _0x3cf2c5;};'use strict';function FreshdeskAccount(_0x4cc695){this['id']=_0x4cc695['id']||0x0;this[_0x4464('0x0')]=_0x4cc695['name']||'';this[_0x4464('0x1')]=_0x4cc695[_0x4464('0x1')]||'';this[_0x4464('0x2')]=_0x4cc695['token']||'';this['remoteUri']=_0x4cc695[_0x4464('0x3')]||'';this[_0x4464('0x4')]=_0x4cc695[_0x4464('0x4')]||'';this[_0x4464('0x5')]=_0x4cc695[_0x4464('0x5')]||{};}module[_0x4464('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x43d4=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0xdfea90,_0x5e0288){var _0x3706c0=function(_0x548035){while(--_0x548035){_0xdfea90['push'](_0xdfea90['shift']());}};_0x3706c0(++_0x5e0288);}(_0x43d4,0x6d));var _0x443d=function(_0x1e3570,_0x20332e){_0x1e3570=_0x1e3570-0x0;var _0x1addaa=_0x43d4[_0x1e3570];return _0x1addaa;};'use strict';function FreshdeskAccount(_0x1fb11b){this['id']=_0x1fb11b['id']||0x0;this[_0x443d('0x0')]=_0x1fb11b[_0x443d('0x0')]||'';this[_0x443d('0x1')]=_0x1fb11b[_0x443d('0x1')]||'';this[_0x443d('0x2')]=_0x1fb11b['token']||'';this[_0x443d('0x3')]=_0x1fb11b[_0x443d('0x3')]||'';this['serverUrl']=_0x1fb11b[_0x443d('0x4')]||'';this[_0x443d('0x5')]=_0x1fb11b[_0x443d('0x5')]||{};}module[_0x443d('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 7c433b4..1d96656 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 _0x95d9=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x95d9,0x97));var _0x995d=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x95d9[_0x487b0c];return _0x1adbdc;};'use strict';function FreshsalesAccount(_0x861aed){this['id']=_0x861aed['id']||0x0;this[_0x995d('0x0')]=_0x861aed[_0x995d('0x0')]||'';this[_0x995d('0x1')]=_0x861aed['username']||'';this[_0x995d('0x2')]=_0x861aed[_0x995d('0x3')]||'';this[_0x995d('0x4')]=_0x861aed['remoteUri']||'';this[_0x995d('0x5')]=_0x861aed[_0x995d('0x5')]||'';this[_0x995d('0x6')]=_0x861aed[_0x995d('0x6')]||{};}module[_0x995d('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x83d0=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x83d0,0xb7));var _0x083d=function(_0x318cb0,_0x8e6f74){_0x318cb0=_0x318cb0-0x0;var _0x120335=_0x83d0[_0x318cb0];return _0x120335;};'use strict';function FreshsalesAccount(_0x351db6){this['id']=_0x351db6['id']||0x0;this[_0x083d('0x0')]=_0x351db6[_0x083d('0x0')]||'';this[_0x083d('0x1')]=_0x351db6[_0x083d('0x1')]||'';this[_0x083d('0x2')]=_0x351db6['token']||'';this[_0x083d('0x3')]=_0x351db6['remoteUri']||'';this['serverUrl']=_0x351db6[_0x083d('0x4')]||'';this[_0x083d('0x5')]=_0x351db6[_0x083d('0x5')]||{};}module[_0x083d('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 6b19bbe..356198a 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 _0x6a1f=['calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','uniqueid'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x6a1f,0x1bf));var _0xf6a1=function(_0x1e0485,_0x19d5f0){_0x1e0485=_0x1e0485-0x0;var _0x4e7749=_0x6a1f[_0x1e0485];return _0x4e7749;};'use strict';function QueueReport(){this[_0xf6a1('0x0')]=_0xf6a1('0x1');this[_0xf6a1('0x2')]='';this[_0xf6a1('0x3')]='';this['calleridname']='';this['queue']='';this[_0xf6a1('0x4')]=null;this[_0xf6a1('0x5')]=null;this[_0xf6a1('0x6')]=0x1;this[_0xf6a1('0x7')]=0x1;this[_0xf6a1('0x8')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xf6a1('0x9')]=![];this['queuecallerexitAt']=null;this[_0xf6a1('0xa')]=0x1;this[_0xf6a1('0xb')]='';this[_0xf6a1('0xc')]='';this[_0xf6a1('0xd')]='';this[_0xf6a1('0xe')]='';this[_0xf6a1('0xf')]='';this[_0xf6a1('0x10')]='';this[_0xf6a1('0x11')]='';this[_0xf6a1('0x12')]=0x0;this[_0xf6a1('0x13')]=![];this[_0xf6a1('0x14')]='';this[_0xf6a1('0x15')]=_0xf6a1('0x16');this['routealias']=null;this['mohtime']=0x0;this[_0xf6a1('0x17')]={};}module[_0xf6a1('0x18')]=QueueReport; \ No newline at end of file +var _0x2611=['originalposition','channel','connectedlinenum','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','inbound','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x4043ce,_0x175dcc){var _0x191365=function(_0x361aa0){while(--_0x361aa0){_0x4043ce['push'](_0x4043ce['shift']());}};_0x191365(++_0x175dcc);}(_0x2611,0x120));var _0x1261=function(_0x20dbc6,_0x193d50){_0x20dbc6=_0x20dbc6-0x0;var _0x4c5f84=_0x2611[_0x20dbc6];return _0x4c5f84;};'use strict';function QueueReport(){this['type']=_0x1261('0x0');this['uniqueid']='';this[_0x1261('0x1')]='';this['calleridname']='';this[_0x1261('0x2')]='';this[_0x1261('0x3')]=null;this[_0x1261('0x4')]=null;this[_0x1261('0x5')]=0x1;this[_0x1261('0x6')]=0x1;this[_0x1261('0x7')]=![];this[_0x1261('0x8')]=null;this['queuecallercomplete']=![];this[_0x1261('0x9')]=null;this[_0x1261('0xa')]=![];this[_0x1261('0xb')]=null;this[_0x1261('0xc')]=0x1;this[_0x1261('0xd')]='';this[_0x1261('0xe')]='';this['connectedlinename']='';this[_0x1261('0xf')]='';this['context']='';this[_0x1261('0x10')]='';this[_0x1261('0x11')]='';this[_0x1261('0x12')]=0x0;this[_0x1261('0x13')]=![];this[_0x1261('0x14')]='';this[_0x1261('0x15')]=_0x1261('0x16');this['routealias']=null;this[_0x1261('0x17')]=0x0;this[_0x1261('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8dc45dc..bd59ab9 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 _0x9baa=['remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x281005,_0x479322){var _0x36df81=function(_0x119c44){while(--_0x119c44){_0x281005['push'](_0x281005['shift']());}};_0x36df81(++_0x479322);}(_0x9baa,0x18a));var _0xa9ba=function(_0x4d7c91,_0xb6827e){_0x4d7c91=_0x4d7c91-0x0;var _0x1953e7=_0x9baa[_0x4d7c91];return _0x1953e7;};'use strict';function SalesforceAccount(_0x5697bc){this['id']=_0x5697bc['id']||0x0;this[_0xa9ba('0x0')]=_0x5697bc[_0xa9ba('0x0')]||'';this[_0xa9ba('0x1')]=_0x5697bc[_0xa9ba('0x1')]||'';this[_0xa9ba('0x2')]=_0x5697bc[_0xa9ba('0x2')]||'';this['password']=_0x5697bc[_0xa9ba('0x3')]||'';this[_0xa9ba('0x4')]=_0x5697bc[_0xa9ba('0x4')]||'';this[_0xa9ba('0x5')]=_0x5697bc[_0xa9ba('0x5')]||'';this[_0xa9ba('0x6')]=_0x5697bc[_0xa9ba('0x6')]||'';this['type']=_0x5697bc[_0xa9ba('0x7')]||'integrationTab';this[_0xa9ba('0x8')]=_0x5697bc[_0xa9ba('0x8')]||'';this[_0xa9ba('0x9')]=_0x5697bc[_0xa9ba('0x9')]||{};}module[_0xa9ba('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xf57e=['username','remoteUri','password','clientSecret','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x3c7971,_0x53c018){var _0x31a122=function(_0x303b5e){while(--_0x303b5e){_0x3c7971['push'](_0x3c7971['shift']());}};_0x31a122(++_0x53c018);}(_0xf57e,0x1e9));var _0xef57=function(_0x572635,_0x17f586){_0x572635=_0x572635-0x0;var _0x4f772e=_0xf57e[_0x572635];return _0x4f772e;};'use strict';function SalesforceAccount(_0x4f84f5){this['id']=_0x4f84f5['id']||0x0;this[_0xef57('0x0')]=_0x4f84f5[_0xef57('0x0')]||'';this[_0xef57('0x1')]=_0x4f84f5[_0xef57('0x1')]||'';this['remoteUri']=_0x4f84f5[_0xef57('0x2')]||'';this[_0xef57('0x3')]=_0x4f84f5['password']||'';this['clientId']=_0x4f84f5['clientId']||'';this[_0xef57('0x4')]=_0x4f84f5[_0xef57('0x4')]||'';this['securityToken']=_0x4f84f5['securityToken']||'';this['type']=_0x4f84f5[_0xef57('0x5')]||_0xef57('0x6');this[_0xef57('0x7')]=_0x4f84f5[_0xef57('0x7')]||'';this['Configurations']=_0x4f84f5[_0xef57('0x8')]||{};}module[_0xef57('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 568ed9e..2b384d4 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 _0x24cc=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x181517,_0x182917){var _0x202def=function(_0x2d2654){while(--_0x2d2654){_0x181517['push'](_0x181517['shift']());}};_0x202def(++_0x182917);}(_0x24cc,0x1b6));var _0xc24c=function(_0x4979e1,_0x2249fa){_0x4979e1=_0x4979e1-0x0;var _0x241801=_0x24cc[_0x4979e1];return _0x241801;};'use strict';function ServicenowAccount(_0x14a46e){this['id']=_0x14a46e['id']||0x0;this[_0xc24c('0x0')]=_0x14a46e[_0xc24c('0x0')]||'';this[_0xc24c('0x1')]=_0x14a46e[_0xc24c('0x1')]||'';this[_0xc24c('0x2')]=_0x14a46e[_0xc24c('0x2')]||'';this['remoteUri']=_0x14a46e[_0xc24c('0x3')]||'';this['serverUrl']=_0x14a46e[_0xc24c('0x4')]||'';this[_0xc24c('0x5')]=_0x14a46e[_0xc24c('0x5')]||{};}module[_0xc24c('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xd642=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x582a8a,_0x5e4b83){var _0x548a81=function(_0x48a3b9){while(--_0x48a3b9){_0x582a8a['push'](_0x582a8a['shift']());}};_0x548a81(++_0x5e4b83);}(_0xd642,0x1f4));var _0x2d64=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xd642[_0x2d9c6a];return _0xf3c918;};'use strict';function ServicenowAccount(_0x505061){this['id']=_0x505061['id']||0x0;this[_0x2d64('0x0')]=_0x505061['name']||'';this[_0x2d64('0x1')]=_0x505061[_0x2d64('0x1')]||'';this[_0x2d64('0x2')]=_0x505061['password']||'';this['remoteUri']=_0x505061[_0x2d64('0x3')]||'';this['serverUrl']=_0x505061[_0x2d64('0x4')]||'';this['Configurations']=_0x505061[_0x2d64('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 19258d8..c112cb0 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 _0x7058=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x205c35,_0x231141){var _0x1f9edc=function(_0x5d71a4){while(--_0x5d71a4){_0x205c35['push'](_0x205c35['shift']());}};_0x1f9edc(++_0x231141);}(_0x7058,0xc9));var _0x8705=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x7058[_0x42bc91];return _0x3f5507;};'use strict';function SugarcrmAccount(_0x3bf58d){this['id']=_0x3bf58d['id']||0x0;this[_0x8705('0x0')]=_0x3bf58d['name']||'';this[_0x8705('0x1')]=_0x3bf58d[_0x8705('0x1')]||'';this[_0x8705('0x2')]=_0x3bf58d['password']||'';this[_0x8705('0x3')]=_0x3bf58d[_0x8705('0x3')]||'';this[_0x8705('0x4')]=_0x3bf58d['serverUrl']||'';this[_0x8705('0x5')]=_0x3bf58d['Configurations']||{};}module[_0x8705('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xbbdd=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xbf19d7,_0x58b2bf){var _0x376e11=function(_0x5ab888){while(--_0x5ab888){_0xbf19d7['push'](_0xbf19d7['shift']());}};_0x376e11(++_0x58b2bf);}(_0xbbdd,0x1a9));var _0xdbbd=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xbbdd[_0x119d5a];return _0x15bff4;};'use strict';function SugarcrmAccount(_0x5d6a2f){this['id']=_0x5d6a2f['id']||0x0;this[_0xdbbd('0x0')]=_0x5d6a2f[_0xdbbd('0x0')]||'';this['username']=_0x5d6a2f[_0xdbbd('0x1')]||'';this['password']=_0x5d6a2f['password']||'';this['remoteUri']=_0x5d6a2f[_0xdbbd('0x2')]||'';this['serverUrl']=_0x5d6a2f[_0xdbbd('0x3')]||'';this['Configurations']=_0x5d6a2f[_0xdbbd('0x4')]||{};}module[_0xdbbd('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 12f423d..47cb2bf 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 _0xff17=['stateTime','address','name','accountcode','state','unknown'];(function(_0x3c1390,_0x5014ad){var _0x2388a5=function(_0x593722){while(--_0x593722){_0x3c1390['push'](_0x3c1390['shift']());}};_0x2388a5(++_0x5014ad);}(_0xff17,0x1ee));var _0x7ff1=function(_0x30c72a,_0x10b459){_0x30c72a=_0x30c72a-0x0;var _0x45794e=_0xff17[_0x30c72a];return _0x45794e;};'use strict';function Telephone(_0x5edd42){this['id']=_0x5edd42['id']||0x0;this[_0x7ff1('0x0')]=_0x5edd42['name']||'';this[_0x7ff1('0x1')]=_0x5edd42[_0x7ff1('0x1')]||'';this[_0x7ff1('0x2')]=_0x7ff1('0x3');this[_0x7ff1('0x4')]=0x0;this['status']=_0x7ff1('0x3');this[_0x7ff1('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x7461=['accountcode','unknown','address','exports','name'];(function(_0x16ccc4,_0x439e40){var _0x2d3fd0=function(_0x16c8e2){while(--_0x16c8e2){_0x16ccc4['push'](_0x16ccc4['shift']());}};_0x2d3fd0(++_0x439e40);}(_0x7461,0xdb));var _0x1746=function(_0x437546,_0x334f47){_0x437546=_0x437546-0x0;var _0x36b04f=_0x7461[_0x437546];return _0x36b04f;};'use strict';function Telephone(_0xe67489){this['id']=_0xe67489['id']||0x0;this[_0x1746('0x0')]=_0xe67489[_0x1746('0x0')]||'';this[_0x1746('0x1')]=_0xe67489[_0x1746('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this['status']=_0x1746('0x2');this[_0x1746('0x3')]='';}module[_0x1746('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 26edf98..2be6916 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(_0x39495c,_0x34fa89){var _0x22d6a4=function(_0x375bdc){while(--_0x375bdc){_0x39495c['push'](_0x39495c['shift']());}};_0x22d6a4(++_0x34fa89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x46266a,_0x1f2467){var _0x9aa23e=function(_0x5d3df8){while(--_0x5d3df8){_0x46266a['push'](_0x46266a['shift']());}};_0x9aa23e(++_0x1f2467);}(_0xb10b,0x12a));var _0xbb10=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xb10b[_0x82129b];return _0x2ae5dc;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 7ed55bf..cb5972d 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x14a02f,_0x25adf3){var _0x52083b=function(_0x51e1e6){while(--_0x51e1e6){_0x14a02f['push'](_0x14a02f['shift']());}};_0x52083b(++_0x25adf3);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ae147,_0x4ca19b){_0x3ae147=_0x3ae147-0x0;var _0x235663=_0xb10b[_0x3ae147];return _0x235663;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x206707,_0x430c4c){var _0x3296bf=function(_0x24447b){while(--_0x24447b){_0x206707['push'](_0x206707['shift']());}};_0x3296bf(++_0x430c4c);}(_0x757a,0xde));var _0xa757=function(_0x57764d,_0x4c9cfb){_0x57764d=_0x57764d-0x0;var _0xdb7f7b=_0x757a[_0x57764d];return _0xdb7f7b;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 67e13f4..926f8ca 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 _0x512e=['active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x39ba91,_0x1aa7fc){var _0x301abe=function(_0x1321d5){while(--_0x1321d5){_0x39ba91['push'](_0x39ba91['shift']());}};_0x301abe(++_0x1aa7fc);}(_0x512e,0x1e6));var _0xe512=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x512e[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x150939){this['id']=_0x150939['id']||0x0;this[_0xe512('0x0')]=_0x150939[_0xe512('0x0')]||![];this[_0xe512('0x1')]=_0x150939[_0xe512('0x1')]||'';this[_0xe512('0x2')]=_0xe512('0x3');this[_0xe512('0x4')]=0x0;this[_0xe512('0x5')]='unknown';this[_0xe512('0x6')]=_0x150939['registry']&&_0x150939['registry'][_0xe512('0x7')](':')?_0x150939[_0xe512('0x6')][_0xe512('0x8')](':')[0x0]:'';this[_0xe512('0x9')]='';this[_0xe512('0xa')]='';this[_0xe512('0xb')]='';this[_0xe512('0xc')]='';this[_0xe512('0xd')]='';this[_0xe512('0xe')]=_0xe512('0x3');this[_0xe512('0xf')]='';this[_0xe512('0x10')]='';this[_0xe512('0x11')]=_0x150939[_0xe512('0x11')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x7f4e=['exports','active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domainport','refresh','stateRegistry','registrationtime','defaultuser'];(function(_0x21fc68,_0x459828){var _0x3561e1=function(_0x3dea77){while(--_0x3dea77){_0x21fc68['push'](_0x21fc68['shift']());}};_0x3561e1(++_0x459828);}(_0x7f4e,0x1d1));var _0xe7f4=function(_0x149b7f,_0xcccc2c){_0x149b7f=_0x149b7f-0x0;var _0x3cd08a=_0x7f4e[_0x149b7f];return _0x3cd08a;};'use strict';function Trunk(_0x5aeb5d){this['id']=_0x5aeb5d['id']||0x0;this['active']=_0x5aeb5d[_0xe7f4('0x0')]||![];this['name']=_0x5aeb5d[_0xe7f4('0x1')]||'';this['state']=_0xe7f4('0x2');this[_0xe7f4('0x3')]=0x0;this[_0xe7f4('0x4')]=_0xe7f4('0x2');this[_0xe7f4('0x5')]=_0x5aeb5d[_0xe7f4('0x5')]&&_0x5aeb5d[_0xe7f4('0x5')][_0xe7f4('0x6')](':')?_0x5aeb5d[_0xe7f4('0x5')][_0xe7f4('0x7')](':')[0x0]:'';this[_0xe7f4('0x8')]='';this[_0xe7f4('0x9')]='';this['domain']='';this[_0xe7f4('0xa')]='';this[_0xe7f4('0xb')]='';this[_0xe7f4('0xc')]='unknown';this[_0xe7f4('0xd')]='';this['address']='';this[_0xe7f4('0xe')]=_0x5aeb5d[_0xe7f4('0xe')]||'';}module[_0xe7f4('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 26b1677..abe3688 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 _0x5779=['exten','recordingFormat'];(function(_0x3dc7aa,_0x415d90){var _0x172df5=function(_0x2a771b){while(--_0x2a771b){_0x3dc7aa['push'](_0x3dc7aa['shift']());}};_0x172df5(++_0x415d90);}(_0x5779,0x82));var _0x9577=function(_0x22ca6f,_0xf73804){_0x22ca6f=_0x22ca6f-0x0;var _0xdac1c2=_0x5779[_0x22ca6f];return _0xdac1c2;};'use strict';function voiceExtension(_0x419c9a){this['id']=_0x419c9a['id']||0x0;this[_0x9577('0x0')]=_0x419c9a[_0x9577('0x0')]||'';this[_0x9577('0x1')]=_0x419c9a[_0x9577('0x1')]||'none';this['mandatoryDisposition']=_0x419c9a['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x3d01=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3d01,0x1d0));var _0x13d0=function(_0x18bae6,_0x3590ac){_0x18bae6=_0x18bae6-0x0;var _0xc1f025=_0x3d01[_0x18bae6];return _0xc1f025;};'use strict';function voiceExtension(_0x21d0ef){this['id']=_0x21d0ef['id']||0x0;this[_0x13d0('0x0')]=_0x21d0ef[_0x13d0('0x0')]||'';this[_0x13d0('0x1')]=_0x21d0ef['recordingFormat']||_0x13d0('0x2');this[_0x13d0('0x3')]=_0x21d0ef[_0x13d0('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 34b8f5b..59b1de1 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 _0xc17f=['sendMessageOneNotActive','message','statusMessage','originated','temp','dialGlobalInterval','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','monitor_format','type','waiting','total','sumHoldTime','abandoned','busy','inUse','paused','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause'];(function(_0x376373,_0x13b1cf){var _0x24fd8b=function(_0x183436){while(--_0x183436){_0x376373['push'](_0x376373['shift']());}};_0x24fd8b(++_0x13b1cf);}(_0xc17f,0x155));var _0xfc17=function(_0x228a67,_0x98b575){_0x228a67=_0x228a67-0x0;var _0x1fa976=_0xc17f[_0x228a67];return _0x1fa976;};'use strict';var monitorFormat={'wav':_0xfc17('0x0'),'wav49':_0xfc17('0x1'),'gsm':_0xfc17('0x2')};var strategy={'fewestcalls':_0xfc17('0x3'),'leastrecent':_0xfc17('0x4'),'linear':_0xfc17('0x5'),'random':_0xfc17('0x6'),'ringall':_0xfc17('0x7'),'rr':_0xfc17('0x8'),'rrmemory':_0xfc17('0x9'),'rrordered':_0xfc17('0xa'),'wrandom':_0xfc17('0xb')};function VoiceQueue(_0x4c4e96){this['id']=_0x4c4e96['id']||0x0;this['name']=_0x4c4e96['name']||'';this[_0xfc17('0xc')]=_0x4c4e96['monitor_format']||'';this[_0xfc17('0xd')]=_0x4c4e96[_0xfc17('0xd')]||'inbound';this[_0xfc17('0xe')]=0x0;this[_0xfc17('0xf')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xfc17('0x10')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xfc17('0x11')]=0x0;this['available']=0x0;this[_0xfc17('0x12')]=0x0;this[_0xfc17('0x13')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this['onHold']=0x0;this[_0xfc17('0x14')]=0x0;this['ringing']=0x0;this[_0xfc17('0x15')]=0x0;this[_0xfc17('0x16')]=0x0;this[_0xfc17('0x17')]=0x0;this[_0xfc17('0x18')]=0x0;this[_0xfc17('0x19')]=_0x4c4e96[_0xfc17('0x19')]||![];this[_0xfc17('0x1a')]=_0x4c4e96[_0xfc17('0x1a')]||0xa;this[_0xfc17('0x1b')]=_0x4c4e96[_0xfc17('0x1b')]||'no';this[_0xfc17('0x1c')]=!![];this[_0xfc17('0x1d')]='';this[_0xfc17('0x1e')]='';this[_0xfc17('0x1f')]=0x0;this[_0xfc17('0x20')]=0x0;this['dialTimezone']=_0x4c4e96['dialTimezone']||null;this[_0xfc17('0x21')]=_0x4c4e96[_0xfc17('0x21')]?_0x4c4e96[_0xfc17('0x21')]:null;this['dialActive']=_0x4c4e96['dialActive'];this[_0xfc17('0x22')]=_0x4c4e96[_0xfc17('0x22')]||'progressive';this[_0xfc17('0x23')]=_0x4c4e96[_0xfc17('0x23')]||0x0;this[_0xfc17('0x24')]=_0x4c4e96[_0xfc17('0x24')]||0x0;this['dialPowerLevel']=_0x4c4e96[_0xfc17('0x25')]||0x1;this['dialPredictiveOptimization']=_0x4c4e96[_0xfc17('0x26')]||_0xfc17('0x27');this[_0xfc17('0x28')]=_0x4c4e96[_0xfc17('0x28')]||0.03;this['dialPredictiveInterval']=_0x4c4e96[_0xfc17('0x29')]||0x258;this[_0xfc17('0x2a')]=_0x4c4e96[_0xfc17('0x2a')]||_0xfc17('0x2b');this['dialOriginateCallerIdNumber']=_0x4c4e96[_0xfc17('0x2c')]||_0xfc17('0x2b');this[_0xfc17('0x2d')]=_0x4c4e96[_0xfc17('0x2d')]||0x1e;this[_0xfc17('0x2e')]=_0x4c4e96[_0xfc17('0x2e')]||_0xfc17('0x2f');this[_0xfc17('0x30')]=_0x4c4e96['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x4c4e96[_0xfc17('0x31')]||undefined;this[_0xfc17('0x32')]=_0x4c4e96[_0xfc17('0x32')]||0x3;this[_0xfc17('0x33')]=_0x4c4e96['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x4c4e96['dialBusyMaxRetry']||0x3;this[_0xfc17('0x34')]=_0x4c4e96[_0xfc17('0x34')]||0x96;this['dialNoAnswerMaxRetry']=_0x4c4e96[_0xfc17('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4c4e96[_0xfc17('0x36')]||0x96;this[_0xfc17('0x37')]=_0x4c4e96[_0xfc17('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4c4e96[_0xfc17('0x38')]||0x96;this['dialDropMaxRetry']=_0x4c4e96['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4c4e96[_0xfc17('0x39')]||0x96;this[_0xfc17('0x3a')]=_0x4c4e96[_0xfc17('0x3a')]||0x3;this['dialAbandonedRetryFrequency']=_0x4c4e96[_0xfc17('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x4c4e96['dialMachineMaxRetry']||0x3;this[_0xfc17('0x3c')]=_0x4c4e96[_0xfc17('0x3c')]||0x96;this[_0xfc17('0x3d')]=_0x4c4e96[_0xfc17('0x3d')]||0x3;this[_0xfc17('0x3e')]=_0x4c4e96[_0xfc17('0x3e')]||0x96;this[_0xfc17('0x3f')]=_0x4c4e96['callAdditionalPhoneAfterMin']||0x3;this[_0xfc17('0x40')]=_0x4c4e96[_0xfc17('0x40')]||0x4;this['Trunk']=_0x4c4e96[_0xfc17('0x41')]?_0x4c4e96[_0xfc17('0x41')]:undefined;this['TrunkBackup']=_0x4c4e96[_0xfc17('0x42')]?_0x4c4e96[_0xfc17('0x42')]:undefined;this[_0xfc17('0x43')]=_0x4c4e96[_0xfc17('0x43')]||undefined;this[_0xfc17('0x44')]=_0x4c4e96[_0xfc17('0x44')]?_0x4c4e96[_0xfc17('0x44')]:undefined;this[_0xfc17('0x45')]=_0x4c4e96[_0xfc17('0x45')]||_0xfc17('0x46');this[_0xfc17('0x47')]=_0x4c4e96['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x4c4e96[_0xfc17('0x48')]||undefined;this['strategy']=strategy[_0x4c4e96[_0xfc17('0x49')]];this[_0xfc17('0x4a')]=!![];this[_0xfc17('0x4b')]=_0x4c4e96['dialAMDActive']||![];this[_0xfc17('0x4c')]=_0x4c4e96[_0xfc17('0x4c')];this[_0xfc17('0x4d')]=_0x4c4e96['dialAMDGreeting'];this[_0xfc17('0x4e')]=_0x4c4e96['dialAMDAfterGreetingSilence'];this[_0xfc17('0x4f')]=_0x4c4e96[_0xfc17('0x4f')];this[_0xfc17('0x50')]=_0x4c4e96[_0xfc17('0x50')];this[_0xfc17('0x51')]=_0x4c4e96[_0xfc17('0x51')];this[_0xfc17('0x52')]=_0x4c4e96[_0xfc17('0x52')];this['dialAMDSilenceThreshold']=_0x4c4e96[_0xfc17('0x53')];this[_0xfc17('0x54')]=_0x4c4e96[_0xfc17('0x54')];this[_0xfc17('0x55')]=0x0;this['pTalking']=0x0;this[_0xfc17('0x56')]=_0x4c4e96['timeout'];this[_0xfc17('0x57')]=0x0;this[_0xfc17('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xfc17('0x59')]=0x0;this[_0xfc17('0x5a')]=0x0;this[_0xfc17('0x5b')]=0x0;this[_0xfc17('0x5c')]=0x0;this[_0xfc17('0x5d')]=0x0;this[_0xfc17('0x5e')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xfc17('0x5f')]=0x0;this[_0xfc17('0x60')]=0x0;this[_0xfc17('0x61')]=0x0;this[_0xfc17('0x62')]=0x0;this[_0xfc17('0x63')]=undefined;this[_0xfc17('0x64')]=undefined;this[_0xfc17('0x65')]=undefined;this[_0xfc17('0x66')]=1.05;this[_0xfc17('0x67')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xfc17('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xfc17('0x69')]=0x0;this[_0xfc17('0x6a')]=0x0;this[_0xfc17('0x6b')]=0x0;this[_0xfc17('0x6c')]=_0x4c4e96[_0xfc17('0x6d')]||0x14;this[_0xfc17('0x6e')]=_0x4c4e96[_0xfc17('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xfc17('0x6f')]=0x0;this[_0xfc17('0x70')]=0x1;this[_0xfc17('0x71')]=0x0;this['erlangCallToSecond']=0x0;this[_0xfc17('0x72')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4c4e96[_0xfc17('0x73')]||0x1e;this[_0xfc17('0x74')]=_0x4c4e96['dialRecallInQueue']||![];this[_0xfc17('0x75')]=!!_0x4c4e96[_0xfc17('0x75')]||![];this['dialPreviewRecallmeReminder']=!!_0x4c4e96[_0xfc17('0x76')]||![];this['dialQueueProject2']=_0x4c4e96['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x4c4e96[_0xfc17('0x77')]||![];this[_0xfc17('0x78')]=_0x4c4e96['dialAgiAfterHangupAgent']||![];this[_0xfc17('0xc')]=monitorFormat[_0x4c4e96[_0xfc17('0xc')]]?monitorFormat[_0x4c4e96[_0xfc17('0xc')]]:undefined;this[_0xfc17('0x79')]=_0x4c4e96[_0xfc17('0x79')]||![];this[_0xfc17('0x7a')]=_0x4c4e96[_0xfc17('0x7a')]?_0x4c4e96[_0xfc17('0x7a')]:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x6bfc=['talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','fewestcalls','linear','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','available','busy','loggedIn','notInUse','paused','ringing','ringInUse'];(function(_0x1c03b6,_0x1b9c60){var _0x175fcb=function(_0x36ab2f){while(--_0x36ab2f){_0x1c03b6['push'](_0x1c03b6['shift']());}};_0x175fcb(++_0x1b9c60);}(_0x6bfc,0x159));var _0xc6bf=function(_0x55faa0,_0x44b165){_0x55faa0=_0x55faa0-0x0;var _0x5dff21=_0x6bfc[_0x55faa0];return _0x5dff21;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xc6bf('0x0'),'gsm':_0xc6bf('0x1')};var strategy={'fewestcalls':_0xc6bf('0x2'),'leastrecent':'leastrecent','linear':_0xc6bf('0x3'),'random':'random','ringall':_0xc6bf('0x4'),'rr':'roundrobin','rrmemory':_0xc6bf('0x5'),'rrordered':_0xc6bf('0x6'),'wrandom':_0xc6bf('0x7')};function VoiceQueue(_0x4a999e){this['id']=_0x4a999e['id']||0x0;this[_0xc6bf('0x8')]=_0x4a999e[_0xc6bf('0x8')]||'';this[_0xc6bf('0x9')]=_0x4a999e[_0xc6bf('0x9')]||'';this[_0xc6bf('0xa')]=_0x4a999e[_0xc6bf('0xa')]||_0xc6bf('0xb');this[_0xc6bf('0xc')]=0x0;this['total']=0x0;this[_0xc6bf('0xd')]=0x0;this[_0xc6bf('0xe')]=0x0;this[_0xc6bf('0xf')]=0x0;this[_0xc6bf('0x10')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xc6bf('0x11')]=0x0;this[_0xc6bf('0x12')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0xc6bf('0x13')]=0x0;this[_0xc6bf('0x14')]=0x0;this['onHold']=0x0;this[_0xc6bf('0x15')]=0x0;this[_0xc6bf('0x16')]=0x0;this[_0xc6bf('0x17')]=0x0;this[_0xc6bf('0x18')]=0x0;this[_0xc6bf('0x19')]=0x0;this['unknown']=0x0;this['acw']=_0x4a999e[_0xc6bf('0x1a')]||![];this[_0xc6bf('0x1b')]=_0x4a999e[_0xc6bf('0x1b')]||0xa;this[_0xc6bf('0x1c')]=_0x4a999e[_0xc6bf('0x1c')]||'no';this[_0xc6bf('0x1d')]=!![];this[_0xc6bf('0x1e')]='';this['statusMessage']='';this[_0xc6bf('0x1f')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x4a999e[_0xc6bf('0x20')]||null;this[_0xc6bf('0x21')]=_0x4a999e['dialGlobalInterval']?_0x4a999e[_0xc6bf('0x21')]:null;this[_0xc6bf('0x22')]=_0x4a999e['dialActive'];this[_0xc6bf('0x23')]=_0x4a999e['dialMethod']||'progressive';this['dialLimitChannel']=_0x4a999e[_0xc6bf('0x24')]||0x0;this[_0xc6bf('0x25')]=_0x4a999e['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4a999e[_0xc6bf('0x26')]||0x1;this[_0xc6bf('0x27')]=_0x4a999e['dialPredictiveOptimization']||_0xc6bf('0x28');this[_0xc6bf('0x29')]=_0x4a999e[_0xc6bf('0x29')]||0.03;this[_0xc6bf('0x2a')]=_0x4a999e['dialPredictiveInterval']||0x258;this[_0xc6bf('0x2b')]=_0x4a999e[_0xc6bf('0x2b')]||_0xc6bf('0x2c');this[_0xc6bf('0x2d')]=_0x4a999e[_0xc6bf('0x2d')]||_0xc6bf('0x2c');this[_0xc6bf('0x2e')]=_0x4a999e[_0xc6bf('0x2e')]||0x1e;this['dialQueueOptions']=_0x4a999e[_0xc6bf('0x2f')]||_0xc6bf('0x30');this[_0xc6bf('0x31')]=_0x4a999e['dialQueueTimeout']||0x3;this[_0xc6bf('0x32')]=_0x4a999e[_0xc6bf('0x32')]||undefined;this[_0xc6bf('0x33')]=_0x4a999e[_0xc6bf('0x33')]||0x3;this[_0xc6bf('0x34')]=_0x4a999e[_0xc6bf('0x34')]||0x96;this['dialBusyMaxRetry']=_0x4a999e['dialBusyMaxRetry']||0x3;this[_0xc6bf('0x35')]=_0x4a999e['dialBusyRetryFrequency']||0x96;this[_0xc6bf('0x36')]=_0x4a999e['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x4a999e[_0xc6bf('0x37')]||0x96;this[_0xc6bf('0x38')]=_0x4a999e[_0xc6bf('0x38')]||0x3;this[_0xc6bf('0x39')]=_0x4a999e['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x4a999e['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4a999e[_0xc6bf('0x3a')]||0x96;this[_0xc6bf('0x3b')]=_0x4a999e[_0xc6bf('0x3b')]||0x3;this[_0xc6bf('0x3c')]=_0x4a999e[_0xc6bf('0x3c')]||0x96;this[_0xc6bf('0x3d')]=_0x4a999e[_0xc6bf('0x3d')]||0x3;this[_0xc6bf('0x3e')]=_0x4a999e[_0xc6bf('0x3e')]||0x96;this[_0xc6bf('0x3f')]=_0x4a999e[_0xc6bf('0x3f')]||0x3;this[_0xc6bf('0x40')]=_0x4a999e[_0xc6bf('0x40')]||0x96;this[_0xc6bf('0x41')]=_0x4a999e[_0xc6bf('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x4a999e[_0xc6bf('0x42')]||0x4;this[_0xc6bf('0x43')]=_0x4a999e[_0xc6bf('0x43')]?_0x4a999e[_0xc6bf('0x43')]:undefined;this['TrunkBackup']=_0x4a999e['TrunkBackup']?_0x4a999e[_0xc6bf('0x44')]:undefined;this[_0xc6bf('0x45')]=_0x4a999e[_0xc6bf('0x45')]||undefined;this[_0xc6bf('0x46')]=_0x4a999e[_0xc6bf('0x46')]?_0x4a999e['Interval']:undefined;this[_0xc6bf('0x47')]=_0x4a999e['dialOrderByScheduledAt']||'DESC';this[_0xc6bf('0x48')]=_0x4a999e[_0xc6bf('0x48')]||undefined;this[_0xc6bf('0x49')]=_0x4a999e[_0xc6bf('0x49')]||undefined;this[_0xc6bf('0x4a')]=strategy[_0x4a999e['strategy']];this[_0xc6bf('0x4b')]=!![];this[_0xc6bf('0x4c')]=_0x4a999e['dialAMDActive']||![];this[_0xc6bf('0x4d')]=_0x4a999e[_0xc6bf('0x4d')];this[_0xc6bf('0x4e')]=_0x4a999e['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x4a999e['dialAMDAfterGreetingSilence'];this[_0xc6bf('0x4f')]=_0x4a999e[_0xc6bf('0x4f')];this[_0xc6bf('0x50')]=_0x4a999e['dialAMDMinWordLength'];this[_0xc6bf('0x51')]=_0x4a999e['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x4a999e[_0xc6bf('0x52')];this[_0xc6bf('0x53')]=_0x4a999e[_0xc6bf('0x53')];this['dialAMDMaximumWordLength']=_0x4a999e['dialAMDMaximumWordLength'];this[_0xc6bf('0x54')]=0x0;this[_0xc6bf('0x55')]=0x0;this[_0xc6bf('0x56')]=_0x4a999e[_0xc6bf('0x56')];this[_0xc6bf('0x57')]=0x0;this[_0xc6bf('0x58')]=0x0;this[_0xc6bf('0x59')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xc6bf('0x5a')]=0x0;this[_0xc6bf('0x5b')]=0x0;this[_0xc6bf('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xc6bf('0x5d')]=0x0;this[_0xc6bf('0x5e')]=0x0;this[_0xc6bf('0x5f')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xc6bf('0x60')]=undefined;this[_0xc6bf('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xc6bf('0x62')]=0x0;this[_0xc6bf('0x63')]=0x0;this[_0xc6bf('0x64')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xc6bf('0x65')]=0x0;this[_0xc6bf('0x66')]=0x0;this[_0xc6bf('0x67')]=0x0;this[_0xc6bf('0x68')]=_0x4a999e[_0xc6bf('0x69')]||0x14;this[_0xc6bf('0x6a')]=_0x4a999e[_0xc6bf('0x69')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xc6bf('0x6b')]=0x1;this[_0xc6bf('0x6c')]=0x0;this[_0xc6bf('0x6d')]=0x0;this[_0xc6bf('0x6e')]=0x0;this[_0xc6bf('0x6f')]=0x0;this[_0xc6bf('0x70')]=_0x4a999e[_0xc6bf('0x70')]||0x1e;this[_0xc6bf('0x71')]=_0x4a999e[_0xc6bf('0x71')]||![];this[_0xc6bf('0x72')]=!!_0x4a999e[_0xc6bf('0x72')]||![];this[_0xc6bf('0x73')]=!!_0x4a999e[_0xc6bf('0x73')]||![];this[_0xc6bf('0x74')]=_0x4a999e[_0xc6bf('0x74')]||undefined;this[_0xc6bf('0x75')]=_0x4a999e[_0xc6bf('0x75')]||![];this['dialAgiAfterHangupAgent']=_0x4a999e[_0xc6bf('0x76')]||![];this[_0xc6bf('0x9')]=monitorFormat[_0x4a999e[_0xc6bf('0x9')]]?monitorFormat[_0x4a999e[_0xc6bf('0x9')]]:undefined;this['mandatoryDisposition']=_0x4a999e[_0xc6bf('0x77')]||![];this[_0xc6bf('0x78')]=_0x4a999e[_0xc6bf('0x78')]?_0x4a999e['mandatoryDispositionPause']:undefined;this[_0xc6bf('0x79')]=![];}module[_0xc6bf('0x7a')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index bee320f..81eac67 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1766=['originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','incall','status','booked','dialer','xcally-motion-preview','compareToInboundQueue','some','updateReportFromOutboundQueue','statusMessage','preview','exports','available','paused','ringing','talking','waiting','answered','loggedIn','loggedInDb','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','total','name','strategy','abandoned','busy','inUse','invalid','onHold','ringInUse','sumDuration','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls'];(function(_0x2213aa,_0x217cb4){var _0xbaea21=function(_0x4d8b8a){while(--_0x4d8b8a){_0x2213aa['push'](_0x2213aa['shift']());}};_0xbaea21(++_0x217cb4);}(_0x1766,0x17d));var _0x6176=function(_0x230554,_0x389165){_0x230554=_0x230554-0x0;var _0x377b99=_0x1766[_0x230554];return _0x377b99;};'use strict';var INBOUND_COUNTERS=[_0x6176('0x0'),'loggedIn','loggedInDb',_0x6176('0x1'),_0x6176('0x2'),_0x6176('0x3'),_0x6176('0x4')];var OUTBOUND_COUNTERS=[_0x6176('0x0'),_0x6176('0x5'),'inUse',_0x6176('0x6'),_0x6176('0x7'),'originated',_0x6176('0x8'),_0x6176('0x9'),_0x6176('0xa'),_0x6176('0xb'),'outboundCongestionCallsDay',_0x6176('0xc'),_0x6176('0xd'),_0x6176('0xe'),_0x6176('0xf'),_0x6176('0x10'),'paused',_0x6176('0x11'),_0x6176('0x3'),_0x6176('0x12'),'sumDuration',_0x6176('0x13'),'waiting'];function VoiceQueueSummary(_0x3a6fca){this['id']=_0x3a6fca['id'];this[_0x6176('0x14')]=_0x3a6fca[_0x6176('0x14')];this[_0x6176('0x15')]=_0x3a6fca[_0x6176('0x15')];this['abandoned']=_0x3a6fca[_0x6176('0x16')]||0x0;this[_0x6176('0x5')]=_0x3a6fca[_0x6176('0x5')]||0x0;this[_0x6176('0x0')]=_0x3a6fca[_0x6176('0x0')]||0x0;this[_0x6176('0x17')]=_0x3a6fca[_0x6176('0x17')]||0x0;this['inUse']=_0x3a6fca[_0x6176('0x18')]||0x0;this[_0x6176('0x19')]=_0x3a6fca[_0x6176('0x19')]||0x0;this[_0x6176('0x6')]=_0x3a6fca['loggedIn']||0x0;this['loggedInDb']=_0x3a6fca['loggedInDb']||0x0;this[_0x6176('0x1a')]=_0x3a6fca[_0x6176('0x1a')]||0x0;this['notInUse']=_0x3a6fca['notInUse']||0x0;this[_0x6176('0x1')]=_0x3a6fca['paused']||0x0;this['ringing']=_0x3a6fca[_0x6176('0x2')]||0x0;this[_0x6176('0x1b')]=_0x3a6fca['ringInUse'];this[_0x6176('0x12')]=_0x3a6fca['sumBillable'];this[_0x6176('0x1c')]=_0x3a6fca[_0x6176('0x1c')];this['sumHoldTime']=_0x3a6fca['sumHoldTime']||0x0;this[_0x6176('0x3')]=_0x3a6fca[_0x6176('0x3')]||0x0;this[_0x6176('0x13')]=_0x3a6fca[_0x6176('0x13')]||0x0;this['type']=_0x3a6fca[_0x6176('0x1d')];this['unavailable']=_0x3a6fca[_0x6176('0x1e')]||0x0;this[_0x6176('0x1f')]=_0x3a6fca[_0x6176('0x1f')]||0x0;this[_0x6176('0x20')]=_0x3a6fca[_0x6176('0x20')]||0x0;this[_0x6176('0x4')]=_0x3a6fca[_0x6176('0x4')]||0x0;if(_0x3a6fca[_0x6176('0x1d')]===_0x6176('0x21')){this[_0x6176('0x11')]=_0x3a6fca[_0x6176('0x11')]||0x0;this[_0x6176('0x22')]=_0x3a6fca['dialActive'];this[_0x6176('0x23')]=_0x3a6fca[_0x6176('0x23')];this[_0x6176('0x24')]=_0x3a6fca[_0x6176('0x24')];this[_0x6176('0x25')]=_0x3a6fca[_0x6176('0x25')];this[_0x6176('0x26')]=_0x3a6fca[_0x6176('0x26')];this[_0x6176('0x27')]=_0x3a6fca[_0x6176('0x27')];this[_0x6176('0x28')]=_0x3a6fca[_0x6176('0x28')];this[_0x6176('0x29')]=_0x3a6fca['outboundAnswerAgiCallsDay'];this[_0x6176('0x9')]=_0x3a6fca[_0x6176('0x9')];this[_0x6176('0xa')]=_0x3a6fca[_0x6176('0xa')];this['outboundBusyCallsDay']=_0x3a6fca[_0x6176('0xb')];this[_0x6176('0x2a')]=_0x3a6fca[_0x6176('0x2a')];this['outboundDropCallsDayACS']=_0x3a6fca[_0x6176('0x2b')];this['outboundDropCallsDayCallersExit']=_0x3a6fca[_0x6176('0x2c')];this['outboundDropCallsDayTimeout']=_0x3a6fca[_0x6176('0x2d')];this['outboundNoAnswerCallsDay']=_0x3a6fca[_0x6176('0xc')];this['outboundNoSuchCallsDay']=_0x3a6fca[_0x6176('0xd')];this[_0x6176('0x2e')]=_0x3a6fca['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x3a6fca[_0x6176('0xe')];this[_0x6176('0xf')]=_0x3a6fca[_0x6176('0xf')];this[_0x6176('0x10')]=_0x3a6fca['outboundUnknownCallsDay'];this[_0x6176('0x2f')]=_0x3a6fca[_0x6176('0x2f')];this['predictiveIntervalAvgHoldtime']=_0x3a6fca[_0x6176('0x30')];this[_0x6176('0x31')]=_0x3a6fca['predictiveIntervalAvgTalktime'];this[_0x6176('0x32')]=_0x3a6fca[_0x6176('0x32')];this[_0x6176('0x33')]=_0x3a6fca[_0x6176('0x33')];this['predictiveIntervalErlangCalls']=_0x3a6fca[_0x6176('0x34')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x3a6fca[_0x6176('0x35')];this[_0x6176('0x36')]=_0x3a6fca[_0x6176('0x36')];this['predictiveIntervalMultiplicativeFactor']=_0x3a6fca[_0x6176('0x37')];this[_0x6176('0x38')]=_0x3a6fca[_0x6176('0x38')];this['predictiveIntervalAvailable']=_0x3a6fca[_0x6176('0x39')];this[_0x6176('0x3a')]=_0x3a6fca['predictiveIntervalTotalCalls'];this[_0x6176('0x3b')]=_0x3a6fca[_0x6176('0x3b')];this[_0x6176('0x3c')]=_0x3a6fca[_0x6176('0x3c')];this[_0x6176('0x3d')]=_0x3a6fca[_0x6176('0x3d')];this['erlangAbandonmentRate']=_0x3a6fca[_0x6176('0x3e')];this['erlangBusyFactor']=_0x3a6fca[_0x6176('0x3f')];this[_0x6176('0x40')]=_0x3a6fca[_0x6176('0x40')];this[_0x6176('0x41')]=_0x3a6fca[_0x6176('0x41')];this[_0x6176('0x42')]=_0x3a6fca[_0x6176('0x42')];this['statusMessage']=_0x3a6fca['statusMessage'];}if(_0x3a6fca[_0x6176('0x43')]){this[_0x6176('0x43')]={'id':_0x3a6fca['Trunk']['id'],'name':_0x3a6fca[_0x6176('0x43')][_0x6176('0x14')],'active':_0x3a6fca[_0x6176('0x43')][_0x6176('0x44')],'callerid':_0x3a6fca['Trunk'][_0x6176('0x45')]};}}VoiceQueueSummary[_0x6176('0x46')][_0x6176('0x47')]=function(_0x2f650f,_0x3c2176,_0xb0483a,_0x95968){this[_0x6176('0x7')]=0x0;this[_0x6176('0x3')]=0x0;this[_0x6176('0x1')]=0x0;this[_0x6176('0x1f')]=0x0;this['notInUse']=0x0;this[_0x6176('0x18')]=0x0;this[_0x6176('0x17')]=0x0;this[_0x6176('0x19')]=0x0;this[_0x6176('0x1e')]=0x0;this[_0x6176('0x2')]=0x0;this['ringInUse']=0x0;this[_0x6176('0x1a')]=0x0;if(_0xb0483a){if(_0xb0483a[_0x6176('0x0')]){this[_0x6176('0x0')]=Number(_0xb0483a[_0x6176('0x0')]);}if(_0xb0483a[_0x6176('0x48')]){this[_0x6176('0x6')]=Number(_0xb0483a[_0x6176('0x48')]);}if(_0xb0483a[_0x6176('0x49')]){this[_0x6176('0x4')]=Number(_0xb0483a[_0x6176('0x49')]);}}for(var _0x4b3b4c=0x0;_0x4b3b4c<_0x2f650f[_0x6176('0x4a')];_0x4b3b4c++){var _0x15bad4=_0x3c2176[_0x6176('0x4b')+_0x2f650f[_0x4b3b4c]['name']];if(_0x15bad4&&_0x15bad4[_0x6176('0x4c')]){this[_0x6176('0x7')]+=0x1;}if(_0x2f650f[_0x4b3b4c][_0x6176('0x4d')]==='1'){this[_0x6176('0x3')]+=0x1;}if(_0x2f650f[_0x4b3b4c][_0x6176('0x1')]==='1'&&!['2','7','8']['includes'](_0x2f650f[_0x4b3b4c][_0x6176('0x4e')])){this[_0x6176('0x1')]+=0x1;}switch(_0x2f650f[_0x4b3b4c]['status']){case'0':this[_0x6176('0x1f')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x6176('0x18')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x6176('0x19')]+=0x1;break;case'5':this[_0x6176('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x6176('0x1b')]+=0x1;break;case'8':this[_0x6176('0x1a')]+=0x1;break;}}if(this[_0x6176('0x23')]===_0x6176('0x4f')){var _0xf0a42a=Object['keys'](_0x95968);for(var _0x326e1f=0x0;_0x326e1f<_0xf0a42a[_0x6176('0x4a')];_0x326e1f++){var _0x3506a8=_0xf0a42a[_0x326e1f];var _0x441dec=_0x95968[_0x3506a8];if(_0x441dec['queue']===this['name']&&_0x441dec[_0x6176('0x1d')]===_0x6176('0x50')&&_0x441dec['exten']===_0x6176('0x51')){this[_0x6176('0x3')]+=0x1;}}if(this[_0x6176('0x3')]>this[_0x6176('0x18')]){this[_0x6176('0x3')]=this[_0x6176('0x18')];}this[_0x6176('0x11')]=0x0;}return this;};VoiceQueueSummary[_0x6176('0x46')][_0x6176('0x52')]=function(_0x4deca8){var _0x223291=![];if(_0x4deca8){_0x223291=INBOUND_COUNTERS[_0x6176('0x53')](function(_0x49cfbb){return this[_0x49cfbb]!==_0x4deca8[_0x49cfbb];},this);}return _0x223291;};VoiceQueueSummary[_0x6176('0x46')]['compareToOutboundQueue']=function(_0x4fb797){var _0x4e33f2=![];var _0x24a683=![];var _0x2579e2=![];if(_0x4fb797){_0x4e33f2=this[_0x6176('0x23')]!==_0x4fb797[_0x6176('0x23')]||this[_0x6176('0x22')]!==_0x4fb797['dialActive']||this[_0x6176('0x42')]!==_0x4fb797[_0x6176('0x42')]||this['statusMessage']!==_0x4fb797['statusMessage'];_0x24a683=OUTBOUND_COUNTERS[_0x6176('0x53')](function(_0x442254){return this[_0x442254]!==_0x4fb797[_0x442254];},this);if(this[_0x6176('0x43')]&&_0x4fb797[_0x6176('0x43')]){_0x2579e2=this[_0x6176('0x43')][_0x6176('0x14')]!==_0x4fb797[_0x6176('0x43')][_0x6176('0x14')]||this['Trunk'][_0x6176('0x44')]!==_0x4fb797['Trunk'][_0x6176('0x44')];}}return _0x4e33f2||_0x24a683||_0x2579e2;};VoiceQueueSummary[_0x6176('0x46')][_0x6176('0x54')]=function(_0x400c3b){this[_0x6176('0x5')]=_0x400c3b[_0x6176('0x5')];this['message']=_0x400c3b['message'];this[_0x6176('0x55')]=_0x400c3b[_0x6176('0x55')];this['originated']=_0x400c3b[_0x6176('0x3b')];this[_0x6176('0x8')]=_0x400c3b[_0x6176('0x8')];this['outboundAnswerCallsDay']=_0x400c3b[_0x6176('0x9')];this['outboundBlacklistCallsDay']=_0x400c3b['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x400c3b[_0x6176('0xb')];this[_0x6176('0x2a')]=_0x400c3b[_0x6176('0x2a')];this[_0x6176('0xc')]=_0x400c3b[_0x6176('0xc')];this[_0x6176('0xd')]=_0x400c3b[_0x6176('0xd')];this[_0x6176('0xe')]=_0x400c3b[_0x6176('0xe')];this['outboundRejectCallsDay']=_0x400c3b[_0x6176('0xf')];this['outboundUnknownCallsDay']=_0x400c3b[_0x6176('0x10')];this[_0x6176('0x12')]=_0x400c3b[_0x6176('0x12')];this[_0x6176('0x1c')]=_0x400c3b[_0x6176('0x1c')];this[_0x6176('0x13')]=_0x400c3b[_0x6176('0x13')];if(this[_0x6176('0x23')]===_0x6176('0x56')){this[_0x6176('0x11')]=_0x400c3b[_0x6176('0x11')];}};module[_0x6176('0x57')]=VoiceQueueSummary; \ No newline at end of file +var _0x27c9=['outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','createReport','loggedin','callers','SIP/','incall','status','booked','keys','length','queue','exten','xcally-motion-preview','prototype','compareToInboundQueue','some','compareToOutboundQueue','active','outboundAbandonedCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','talking','waiting','answered','inUse','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay'];(function(_0x17acb5,_0x2445b5){var _0x4aca07=function(_0x3c742d){while(--_0x3c742d){_0x17acb5['push'](_0x17acb5['shift']());}};_0x4aca07(++_0x2445b5);}(_0x27c9,0x1af));var _0x927c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x27c9[_0x21a9d9];return _0x46adce;};'use strict';var INBOUND_COUNTERS=[_0x927c('0x0'),_0x927c('0x1'),_0x927c('0x2'),_0x927c('0x3'),'ringing',_0x927c('0x4'),_0x927c('0x5')];var OUTBOUND_COUNTERS=['available',_0x927c('0x6'),_0x927c('0x7'),_0x927c('0x1'),_0x927c('0x2'),_0x927c('0x8'),'outboundAbandonedCallsDay',_0x927c('0x9'),_0x927c('0xa'),_0x927c('0xb'),'outboundCongestionCallsDay',_0x927c('0xc'),_0x927c('0xd'),_0x927c('0xe'),'outboundRejectCallsDay',_0x927c('0xf'),_0x927c('0x3'),_0x927c('0x10'),_0x927c('0x4'),_0x927c('0x11'),_0x927c('0x12'),_0x927c('0x13'),_0x927c('0x5')];function VoiceQueueSummary(_0x57238b){this['id']=_0x57238b['id'];this['name']=_0x57238b[_0x927c('0x14')];this[_0x927c('0x15')]=_0x57238b[_0x927c('0x15')];this[_0x927c('0x16')]=_0x57238b['abandoned']||0x0;this[_0x927c('0x6')]=_0x57238b['answered']||0x0;this['available']=_0x57238b[_0x927c('0x0')]||0x0;this[_0x927c('0x17')]=_0x57238b[_0x927c('0x17')]||0x0;this[_0x927c('0x7')]=_0x57238b[_0x927c('0x7')]||0x0;this[_0x927c('0x18')]=_0x57238b[_0x927c('0x18')]||0x0;this[_0x927c('0x1')]=_0x57238b[_0x927c('0x1')]||0x0;this[_0x927c('0x2')]=_0x57238b[_0x927c('0x2')]||0x0;this[_0x927c('0x19')]=_0x57238b['onHold']||0x0;this[_0x927c('0x1a')]=_0x57238b[_0x927c('0x1a')]||0x0;this['paused']=_0x57238b[_0x927c('0x3')]||0x0;this[_0x927c('0x1b')]=_0x57238b['ringing']||0x0;this[_0x927c('0x1c')]=_0x57238b[_0x927c('0x1c')];this[_0x927c('0x11')]=_0x57238b[_0x927c('0x11')];this[_0x927c('0x12')]=_0x57238b['sumDuration'];this['sumHoldTime']=_0x57238b['sumHoldTime']||0x0;this[_0x927c('0x4')]=_0x57238b[_0x927c('0x4')]||0x0;this[_0x927c('0x13')]=_0x57238b[_0x927c('0x13')]||0x0;this[_0x927c('0x1d')]=_0x57238b[_0x927c('0x1d')];this['unavailable']=_0x57238b[_0x927c('0x1e')]||0x0;this[_0x927c('0x1f')]=_0x57238b[_0x927c('0x1f')]||0x0;this[_0x927c('0x20')]=_0x57238b[_0x927c('0x20')]||0x0;this[_0x927c('0x5')]=_0x57238b['waiting']||0x0;if(_0x57238b[_0x927c('0x1d')]===_0x927c('0x21')){this[_0x927c('0x10')]=_0x57238b[_0x927c('0x10')]||0x0;this['dialActive']=_0x57238b[_0x927c('0x22')];this[_0x927c('0x23')]=_0x57238b[_0x927c('0x23')];this[_0x927c('0x24')]=_0x57238b[_0x927c('0x24')];this['dialOriginateCallerIdNumber']=_0x57238b[_0x927c('0x25')];this[_0x927c('0x26')]=_0x57238b[_0x927c('0x26')];this['dialPrefix']=_0x57238b[_0x927c('0x27')];this[_0x927c('0x28')]=_0x57238b[_0x927c('0x28')];this[_0x927c('0x29')]=_0x57238b[_0x927c('0x29')];this[_0x927c('0x9')]=_0x57238b[_0x927c('0x9')];this['outboundBlacklistCallsDay']=_0x57238b[_0x927c('0xa')];this[_0x927c('0xb')]=_0x57238b[_0x927c('0xb')];this[_0x927c('0x2a')]=_0x57238b[_0x927c('0x2a')];this[_0x927c('0x2b')]=_0x57238b[_0x927c('0x2b')];this[_0x927c('0x2c')]=_0x57238b[_0x927c('0x2c')];this[_0x927c('0x2d')]=_0x57238b['outboundDropCallsDayTimeout'];this[_0x927c('0xc')]=_0x57238b[_0x927c('0xc')];this[_0x927c('0xd')]=_0x57238b['outboundNoSuchCallsDay'];this[_0x927c('0x2e')]=_0x57238b[_0x927c('0x2e')];this[_0x927c('0xe')]=_0x57238b[_0x927c('0xe')];this['outboundRejectCallsDay']=_0x57238b[_0x927c('0x2f')];this[_0x927c('0xf')]=_0x57238b[_0x927c('0xf')];this[_0x927c('0x30')]=_0x57238b['predictiveIntervalAnsweredCalls'];this[_0x927c('0x31')]=_0x57238b['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x57238b[_0x927c('0x32')];this['predictiveIntervalDroppedCallsCallersExit']=_0x57238b[_0x927c('0x33')];this['predictiveIntervalDroppedCallsTimeout']=_0x57238b[_0x927c('0x34')];this[_0x927c('0x35')]=_0x57238b[_0x927c('0x35')];this[_0x927c('0x36')]=_0x57238b[_0x927c('0x36')];this['predictiveIntervalHitRate']=_0x57238b[_0x927c('0x37')];this[_0x927c('0x38')]=_0x57238b[_0x927c('0x38')];this['predictiveIntervalPauses']=_0x57238b[_0x927c('0x39')];this['predictiveIntervalAvailable']=_0x57238b['predictiveIntervalAvailable'];this[_0x927c('0x3a')]=_0x57238b['predictiveIntervalTotalCalls'];this['originated']=_0x57238b[_0x927c('0x8')];this[_0x927c('0x3b')]=_0x57238b[_0x927c('0x3b')];this['erlangCallToSecond']=_0x57238b[_0x927c('0x3c')];this[_0x927c('0x3d')]=_0x57238b[_0x927c('0x3d')];this['erlangBusyFactor']=_0x57238b[_0x927c('0x3e')];this[_0x927c('0x3f')]=_0x57238b[_0x927c('0x3f')];this['startProgressive']=_0x57238b[_0x927c('0x40')];this[_0x927c('0x41')]=_0x57238b[_0x927c('0x41')];this['statusMessage']=_0x57238b[_0x927c('0x42')];}if(_0x57238b[_0x927c('0x43')]){this[_0x927c('0x43')]={'id':_0x57238b['Trunk']['id'],'name':_0x57238b['Trunk'][_0x927c('0x14')],'active':_0x57238b[_0x927c('0x43')]['active'],'callerid':_0x57238b['Trunk'][_0x927c('0x44')]};}}VoiceQueueSummary['prototype'][_0x927c('0x45')]=function(_0x238d10,_0x3a57c2,_0x4c3851,_0x3e6c43){this['loggedInDb']=0x0;this[_0x927c('0x4')]=0x0;this[_0x927c('0x3')]=0x0;this[_0x927c('0x1f')]=0x0;this[_0x927c('0x1a')]=0x0;this[_0x927c('0x7')]=0x0;this['busy']=0x0;this[_0x927c('0x18')]=0x0;this[_0x927c('0x1e')]=0x0;this[_0x927c('0x1b')]=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x4c3851){if(_0x4c3851['available']){this['available']=Number(_0x4c3851['available']);}if(_0x4c3851[_0x927c('0x46')]){this[_0x927c('0x1')]=Number(_0x4c3851[_0x927c('0x46')]);}if(_0x4c3851[_0x927c('0x47')]){this[_0x927c('0x5')]=Number(_0x4c3851['callers']);}}for(var _0x76a7c2=0x0;_0x76a7c2<_0x238d10['length'];_0x76a7c2++){var _0x29c6e6=_0x3a57c2[_0x927c('0x48')+_0x238d10[_0x76a7c2][_0x927c('0x14')]];if(_0x29c6e6&&_0x29c6e6['online']){this['loggedInDb']+=0x1;}if(_0x238d10[_0x76a7c2][_0x927c('0x49')]==='1'){this[_0x927c('0x4')]+=0x1;}if(_0x238d10[_0x76a7c2][_0x927c('0x3')]==='1'&&!['2','7','8']['includes'](_0x238d10[_0x76a7c2]['status'])){this[_0x927c('0x3')]+=0x1;}switch(_0x238d10[_0x76a7c2][_0x927c('0x4a')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x927c('0x1a')]+=0x1;break;case'2':this[_0x927c('0x7')]+=0x1;break;case'3':this[_0x927c('0x17')]+=0x1;break;case'4':this[_0x927c('0x18')]+=0x1;break;case'5':this[_0x927c('0x1e')]+=0x1;break;case'6':this[_0x927c('0x1b')]+=0x1;break;case'7':this[_0x927c('0x1c')]+=0x1;break;case'8':this[_0x927c('0x19')]+=0x1;break;}}if(this[_0x927c('0x23')]===_0x927c('0x4b')){var _0x4f0bb4=Object[_0x927c('0x4c')](_0x3e6c43);for(var _0xc3845b=0x0;_0xc3845b<_0x4f0bb4[_0x927c('0x4d')];_0xc3845b++){var _0x569ecc=_0x4f0bb4[_0xc3845b];var _0x598750=_0x3e6c43[_0x569ecc];if(_0x598750[_0x927c('0x4e')]===this[_0x927c('0x14')]&&_0x598750['type']==='dialer'&&_0x598750[_0x927c('0x4f')]===_0x927c('0x50')){this['talking']+=0x1;}}if(this[_0x927c('0x4')]>this[_0x927c('0x7')]){this['talking']=this[_0x927c('0x7')];}this[_0x927c('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x927c('0x51')][_0x927c('0x52')]=function(_0x4f6c3d){var _0x1f10d0=![];if(_0x4f6c3d){_0x1f10d0=INBOUND_COUNTERS[_0x927c('0x53')](function(_0x453cb1){return this[_0x453cb1]!==_0x4f6c3d[_0x453cb1];},this);}return _0x1f10d0;};VoiceQueueSummary[_0x927c('0x51')][_0x927c('0x54')]=function(_0x5e7e0a){var _0x444857=![];var _0x371535=![];var _0x537121=![];if(_0x5e7e0a){_0x444857=this[_0x927c('0x23')]!==_0x5e7e0a['dialMethod']||this[_0x927c('0x22')]!==_0x5e7e0a[_0x927c('0x22')]||this['message']!==_0x5e7e0a[_0x927c('0x41')]||this['statusMessage']!==_0x5e7e0a[_0x927c('0x42')];_0x371535=OUTBOUND_COUNTERS['some'](function(_0x322fa5){return this[_0x322fa5]!==_0x5e7e0a[_0x322fa5];},this);if(this[_0x927c('0x43')]&&_0x5e7e0a[_0x927c('0x43')]){_0x537121=this['Trunk'][_0x927c('0x14')]!==_0x5e7e0a[_0x927c('0x43')]['name']||this['Trunk'][_0x927c('0x55')]!==_0x5e7e0a[_0x927c('0x43')][_0x927c('0x55')];}}return _0x444857||_0x371535||_0x537121;};VoiceQueueSummary[_0x927c('0x51')]['updateReportFromOutboundQueue']=function(_0x2777c9){this[_0x927c('0x6')]=_0x2777c9['answered'];this['message']=_0x2777c9[_0x927c('0x41')];this['statusMessage']=_0x2777c9[_0x927c('0x42')];this[_0x927c('0x8')]=_0x2777c9['originated'];this[_0x927c('0x56')]=_0x2777c9['outboundAbandonedCallsDay'];this[_0x927c('0x9')]=_0x2777c9[_0x927c('0x9')];this[_0x927c('0xa')]=_0x2777c9[_0x927c('0xa')];this[_0x927c('0xb')]=_0x2777c9['outboundBusyCallsDay'];this[_0x927c('0x2a')]=_0x2777c9[_0x927c('0x2a')];this[_0x927c('0xc')]=_0x2777c9['outboundNoAnswerCallsDay'];this[_0x927c('0xd')]=_0x2777c9['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0x2777c9[_0x927c('0xe')];this['outboundRejectCallsDay']=_0x2777c9[_0x927c('0x2f')];this[_0x927c('0xf')]=_0x2777c9[_0x927c('0xf')];this[_0x927c('0x11')]=_0x2777c9['sumBillable'];this[_0x927c('0x12')]=_0x2777c9[_0x927c('0x12')];this['total']=_0x2777c9[_0x927c('0x13')];if(this[_0x927c('0x23')]===_0x927c('0x57')){this[_0x927c('0x10')]=_0x2777c9[_0x927c('0x10')];}};module[_0x927c('0x58')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d079558..3257eb9 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 _0xb075=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x26a3a7,_0x469b13){var _0x2c124c=function(_0x313231){while(--_0x313231){_0x26a3a7['push'](_0x26a3a7['shift']());}};_0x2c124c(++_0x469b13);}(_0xb075,0x1ee));var _0x5b07=function(_0x4b046c,_0xc4ea0f){_0x4b046c=_0x4b046c-0x0;var _0x4e65f1=_0xb075[_0x4b046c];return _0x4e65f1;};'use strict';function VtigerAccount(_0x3c6d9b){this['id']=_0x3c6d9b['id']||0x0;this[_0x5b07('0x0')]=_0x3c6d9b[_0x5b07('0x0')]||'';this[_0x5b07('0x1')]=_0x3c6d9b[_0x5b07('0x1')]||'';this[_0x5b07('0x2')]=_0x3c6d9b[_0x5b07('0x2')]||'';this['remoteUri']=_0x3c6d9b[_0x5b07('0x3')]||'';this[_0x5b07('0x4')]=_0x3c6d9b['serverUrl']||'';this[_0x5b07('0x5')]=_0x3c6d9b[_0x5b07('0x5')]||{};}module[_0x5b07('0x6')]=VtigerAccount; \ No newline at end of file +var _0x5012=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x18799c,_0x221415){var _0x24832d=function(_0x3a78fd){while(--_0x3a78fd){_0x18799c['push'](_0x18799c['shift']());}};_0x24832d(++_0x221415);}(_0x5012,0x1ec));var _0x2501=function(_0x5e7f8e,_0x4ae19e){_0x5e7f8e=_0x5e7f8e-0x0;var _0x4d79c4=_0x5012[_0x5e7f8e];return _0x4d79c4;};'use strict';function VtigerAccount(_0x4b92fa){this['id']=_0x4b92fa['id']||0x0;this[_0x2501('0x0')]=_0x4b92fa[_0x2501('0x0')]||'';this[_0x2501('0x1')]=_0x4b92fa[_0x2501('0x1')]||'';this[_0x2501('0x2')]=_0x4b92fa[_0x2501('0x2')]||'';this[_0x2501('0x3')]=_0x4b92fa[_0x2501('0x3')]||'';this[_0x2501('0x4')]=_0x4b92fa[_0x2501('0x4')]||'';this[_0x2501('0x5')]=_0x4b92fa[_0x2501('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index db441e8..9e0dbb6 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 _0x0d0e=['type','integrationTab','serverUrl','exports','name','username','password','token','remoteUri','authType'];(function(_0x16c542,_0x5198c0){var _0x4fa94c=function(_0x2b793c){while(--_0x2b793c){_0x16c542['push'](_0x16c542['shift']());}};_0x4fa94c(++_0x5198c0);}(_0x0d0e,0xae));var _0xe0d0=function(_0x1fae64,_0x2b44da){_0x1fae64=_0x1fae64-0x0;var _0x4493e7=_0x0d0e[_0x1fae64];return _0x4493e7;};'use strict';function ZendeskAccount(_0x45f533){this['id']=_0x45f533['id']||0x0;this[_0xe0d0('0x0')]=_0x45f533[_0xe0d0('0x0')]||'';this[_0xe0d0('0x1')]=_0x45f533[_0xe0d0('0x1')]||'';this[_0xe0d0('0x2')]=_0x45f533[_0xe0d0('0x2')]||'';this[_0xe0d0('0x3')]=_0x45f533['token']||'';this[_0xe0d0('0x4')]=_0x45f533[_0xe0d0('0x4')]||'';this[_0xe0d0('0x5')]=_0x45f533['authType']||'';this[_0xe0d0('0x6')]=_0x45f533['type']||_0xe0d0('0x7');this['serverUrl']=_0x45f533[_0xe0d0('0x8')]||'';this['Configurations']=_0x45f533['Configurations']||{};}module[_0xe0d0('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xb560=['authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x56fb4e,_0x3f7cb7){var _0x45c9a3=function(_0x796621){while(--_0x796621){_0x56fb4e['push'](_0x56fb4e['shift']());}};_0x45c9a3(++_0x3f7cb7);}(_0xb560,0xd7));var _0x0b56=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb560[_0x53ccf2];return _0x5a2964;};'use strict';function ZendeskAccount(_0x5c7ba0){this['id']=_0x5c7ba0['id']||0x0;this[_0x0b56('0x0')]=_0x5c7ba0[_0x0b56('0x0')]||'';this[_0x0b56('0x1')]=_0x5c7ba0['username']||'';this[_0x0b56('0x2')]=_0x5c7ba0[_0x0b56('0x2')]||'';this[_0x0b56('0x3')]=_0x5c7ba0['token']||'';this[_0x0b56('0x4')]=_0x5c7ba0[_0x0b56('0x4')]||'';this['authType']=_0x5c7ba0[_0x0b56('0x5')]||'';this['type']=_0x5c7ba0['type']||_0x0b56('0x6');this[_0x0b56('0x7')]=_0x5c7ba0[_0x0b56('0x7')]||'';this[_0x0b56('0x8')]=_0x5c7ba0['Configurations']||{};}module[_0x0b56('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index af4ccc7..6f0293e 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 _0x9bc9=['refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x22a91c,_0x5ce13f){var _0x733c2f=function(_0x1ef119){while(--_0x1ef119){_0x22a91c['push'](_0x22a91c['shift']());}};_0x733c2f(++_0x5ce13f);}(_0x9bc9,0x1d8));var _0x99bc=function(_0x405974,_0x325b6b){_0x405974=_0x405974-0x0;var _0x65b396=_0x9bc9[_0x405974];return _0x65b396;};'use strict';function ZohoAccount(_0x560fa7){this['id']=_0x560fa7['id']||0x0;this[_0x99bc('0x0')]=_0x560fa7[_0x99bc('0x0')]||'';this[_0x99bc('0x1')]=_0x560fa7['description']||'';this[_0x99bc('0x2')]=_0x560fa7['host']||'';this[_0x99bc('0x3')]=_0x560fa7['zone']||'';this[_0x99bc('0x4')]=_0x560fa7[_0x99bc('0x4')]||'';this[_0x99bc('0x5')]=_0x560fa7[_0x99bc('0x5')]||'';this[_0x99bc('0x6')]=_0x560fa7[_0x99bc('0x6')]||'';this[_0x99bc('0x7')]=_0x560fa7[_0x99bc('0x7')]||'';this[_0x99bc('0x8')]=_0x560fa7[_0x99bc('0x8')]||'';this[_0x99bc('0x9')]=_0x560fa7['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xd939=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x534c1f,_0x3d5b10){var _0xf09f6e=function(_0x29e43e){while(--_0x29e43e){_0x534c1f['push'](_0x534c1f['shift']());}};_0xf09f6e(++_0x3d5b10);}(_0xd939,0x64));var _0x9d93=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0xd939[_0x186d17];return _0x5d4b89;};'use strict';function ZohoAccount(_0x432d0e){this['id']=_0x432d0e['id']||0x0;this[_0x9d93('0x0')]=_0x432d0e[_0x9d93('0x0')]||'';this[_0x9d93('0x1')]=_0x432d0e[_0x9d93('0x1')]||'';this[_0x9d93('0x2')]=_0x432d0e['host']||'';this[_0x9d93('0x3')]=_0x432d0e[_0x9d93('0x3')]||'';this[_0x9d93('0x4')]=_0x432d0e[_0x9d93('0x4')]||'';this['clientSecret']=_0x432d0e[_0x9d93('0x5')]||'';this[_0x9d93('0x6')]=_0x432d0e['serverUrl']||'';this[_0x9d93('0x7')]=_0x432d0e[_0x9d93('0x7')]||'';this[_0x9d93('0x8')]=_0x432d0e[_0x9d93('0x8')]||'';this[_0x9d93('0x9')]=_0x432d0e['Configurations']||{};}module[_0x9d93('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index f4be3ac..4132850 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 _0x6343=['format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','number','moment','string','isNil','queue','name','type','campaigntype','Agent','channelAgent','membername'];(function(_0xb7361,_0x1edc22){var _0x3236c9=function(_0x50fe76){while(--_0x50fe76){_0xb7361['push'](_0xb7361['shift']());}};_0x3236c9(++_0x1edc22);}(_0x6343,0x168));var _0x3634=function(_0x452e16,_0x25280b){_0x452e16=_0x452e16-0x0;var _0x5598e6=_0x6343[_0x452e16];return _0x5598e6;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3634('0x0'));function checkNameSurname(_0x26d852,_0x53a78f,_0x518246){var _0x5a4621='';if(!_['isNil'](_0x53a78f)&&_0x3634('0x1')===typeof _0x53a78f){_0x5a4621+=_0x53a78f;}if(!_[_0x3634('0x2')](_0x518246)&&'string'===typeof _0x518246){_0x5a4621+='\x20'+_0x518246;}if(_0x5a4621!==''){return _0x5a4621;}return _0x26d852;}function Action(_0x247964,_0x388c18,_0x4bb496,_0x302828,_0xd40513){this['uniqueid']=_0x4bb496||undefined;this['idContact']=_0x247964['id'];this[_0x3634('0x3')]=_0x388c18[_0x3634('0x4')];this[_0x3634('0x5')]=_0x388c18[_0x3634('0x5')];this[_0x3634('0x6')]=_0x3634('0x3');this['dialAnswer']=![];this['membername']=_[_0x3634('0x2')](_0x247964[_0x3634('0x7')])?undefined:_0x247964['Agent'][_0x3634('0x4')];this[_0x3634('0x8')]=this[_0x3634('0x9')]?util[_0x3634('0xa')](_0x3634('0xb'),this[_0x3634('0x9')]):_0x302828||undefined;this[_0x3634('0xc')]=checkNameSurname(_0x247964[_0x3634('0xd')][_0x3634('0xe')],_0x247964[_0x3634('0xd')][_0x3634('0xf')],_0x247964[_0x3634('0xd')][_0x3634('0x10')]);this[_0x3634('0x11')]=_0x247964['active']||![];this[_0x3634('0x12')]=_0x247964['phone'];this[_0x3634('0x13')]=_0x247964[_0x3634('0x13')];this[_0x3634('0x14')]=_0x247964[_0x3634('0x14')]||0x0;this[_0x3634('0x15')]=_0x247964['countcongestionretry']||0x0;this[_0x3634('0x16')]=_0x247964['countnoanswerretry']||0x0;this['countglobal']=(_0x247964[_0x3634('0x14')]||0x0)+(_0x247964['countcongestionretry']||0x0)+(_0x247964[_0x3634('0x16')]||0x0)+(_0x247964[_0x3634('0x17')]||0x0)+(_0x247964[_0x3634('0x18')]||0x0)+(_0x247964['countabandonedretry']||0x0)+(_0x247964[_0x3634('0x19')]||0x0)+(_0x247964[_0x3634('0x1a')]||0x0);this['countnosuchnumberretry']=_0x247964[_0x3634('0x17')]||0x0;this['countdropretry']=_0x247964[_0x3634('0x18')]||0x0;this[_0x3634('0x1b')]=_0x247964['countabandonedretry']||0x0;this[_0x3634('0x19')]=_0x247964[_0x3634('0x19')]||0x0;this[_0x3634('0x1a')]=_0x247964['countagentrejectretry']||0x0;this[_0x3634('0x1c')]=_0x247964[_0x3634('0x1c')];this['callbackuniqueid']=_0x247964[_0x3634('0x1d')];this['callbackat']=_0x247964['callbackat'];this[_0x3634('0x1e')]=_0x247964[_0x3634('0x1e')];this['ContactId']=_0x247964[_0x3634('0x1f')];this[_0x3634('0x20')]=_0x247964[_0x3634('0x20')];this[_0x3634('0x21')]=_[_0x3634('0x2')](_0x247964[_0x3634('0x7')])?_0x247964[_0x3634('0x21')]:_0x247964[_0x3634('0x7')]['id'];this[_0x3634('0x22')]=_0x247964['VoiceQueueId'];this[_0x3634('0x23')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x3634('0xa')]('\x22%s\x22\x20<%s>',this[_0x3634('0xc')],this[_0x3634('0x24')]);};module['exports']=Action; \ No newline at end of file +var _0x9f0e=['UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x4deff1,_0x5421fc){var _0x559271=function(_0x2a2e34){while(--_0x2a2e34){_0x4deff1['push'](_0x4deff1['shift']());}};_0x559271(++_0x5421fc);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2fbcdd,_0x5b619b){_0x2fbcdd=_0x2fbcdd-0x0;var _0x1088dc=_0x9f0e[_0x2fbcdd];return _0x1088dc;};'use strict';var util=require(_0xe9f0('0x0'));var _=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));function checkNameSurname(_0x1a7796,_0x146ad8,_0x4a1a30){var _0x5856dc='';if(!_[_0xe9f0('0x3')](_0x146ad8)&&_0xe9f0('0x4')===typeof _0x146ad8){_0x5856dc+=_0x146ad8;}if(!_[_0xe9f0('0x3')](_0x4a1a30)&&_0xe9f0('0x4')===typeof _0x4a1a30){_0x5856dc+='\x20'+_0x4a1a30;}if(_0x5856dc!==''){return _0x5856dc;}return _0x1a7796;}function Action(_0x1eed45,_0x50313d,_0x5b87c1,_0x3a17b3,_0x167198){this[_0xe9f0('0x5')]=_0x5b87c1||undefined;this['idContact']=_0x1eed45['id'];this[_0xe9f0('0x6')]=_0x50313d[_0xe9f0('0x7')];this[_0xe9f0('0x8')]=_0x50313d[_0xe9f0('0x8')];this[_0xe9f0('0x9')]=_0xe9f0('0x6');this[_0xe9f0('0xa')]=![];this[_0xe9f0('0xb')]=_[_0xe9f0('0x3')](_0x1eed45['Agent'])?undefined:_0x1eed45[_0xe9f0('0xc')][_0xe9f0('0x7')];this[_0xe9f0('0xd')]=this['membername']?util[_0xe9f0('0xe')]('SIP/%s',this[_0xe9f0('0xb')]):_0x3a17b3||undefined;this[_0xe9f0('0xf')]=checkNameSurname(_0x1eed45[_0xe9f0('0x10')][_0xe9f0('0x11')],_0x1eed45['Contact'][_0xe9f0('0x12')],_0x1eed45['Contact'][_0xe9f0('0x13')]);this[_0xe9f0('0x14')]=_0x1eed45[_0xe9f0('0x14')]||![];this['calleridnum']=_0x1eed45[_0xe9f0('0x11')];this[_0xe9f0('0x15')]=_0x1eed45[_0xe9f0('0x15')];this['countbusyretry']=_0x1eed45[_0xe9f0('0x16')]||0x0;this[_0xe9f0('0x17')]=_0x1eed45[_0xe9f0('0x17')]||0x0;this[_0xe9f0('0x18')]=_0x1eed45[_0xe9f0('0x18')]||0x0;this[_0xe9f0('0x19')]=(_0x1eed45[_0xe9f0('0x16')]||0x0)+(_0x1eed45['countcongestionretry']||0x0)+(_0x1eed45[_0xe9f0('0x18')]||0x0)+(_0x1eed45[_0xe9f0('0x1a')]||0x0)+(_0x1eed45[_0xe9f0('0x1b')]||0x0)+(_0x1eed45['countabandonedretry']||0x0)+(_0x1eed45[_0xe9f0('0x1c')]||0x0)+(_0x1eed45[_0xe9f0('0x1d')]||0x0);this[_0xe9f0('0x1a')]=_0x1eed45[_0xe9f0('0x1a')]||0x0;this['countdropretry']=_0x1eed45[_0xe9f0('0x1b')]||0x0;this[_0xe9f0('0x1e')]=_0x1eed45['countabandonedretry']||0x0;this['countmachineretry']=_0x1eed45['countmachineretry']||0x0;this[_0xe9f0('0x1d')]=_0x1eed45[_0xe9f0('0x1d')]||0x0;this[_0xe9f0('0x1f')]=_0x1eed45[_0xe9f0('0x1f')];this[_0xe9f0('0x20')]=_0x1eed45['callbackuniqueid'];this[_0xe9f0('0x21')]=_0x1eed45[_0xe9f0('0x21')];this[_0xe9f0('0x22')]=_0x1eed45[_0xe9f0('0x22')];this[_0xe9f0('0x23')]=_0x1eed45[_0xe9f0('0x23')];this[_0xe9f0('0x24')]=_0x1eed45[_0xe9f0('0x24')];this[_0xe9f0('0x25')]=_[_0xe9f0('0x3')](_0x1eed45['Agent'])?_0x1eed45[_0xe9f0('0x25')]:_0x1eed45[_0xe9f0('0xc')]['id'];this[_0xe9f0('0x26')]=_0x1eed45[_0xe9f0('0x26')];this['originatecalleridnum']='';this[_0xe9f0('0x27')]='';}Action[_0xe9f0('0x28')][_0xe9f0('0x29')]=function(){return util[_0xe9f0('0xe')](_0xe9f0('0x2a'),this['calleridname'],this[_0xe9f0('0x2b')]);};module[_0xe9f0('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 7087e8d..8a9e23b 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 _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x1d3fad,_0x3f572f){var _0x321ab6=function(_0x441934){while(--_0x441934){_0x1d3fad['push'](_0x1d3fad['shift']());}};_0x321ab6(++_0x3f572f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x3b9df7,_0x16ceb3){var _0x436284=function(_0x462356){while(--_0x462356){_0x3b9df7['push'](_0x3b9df7['shift']());}};_0x436284(++_0x16ceb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 98b6369..c226033 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 _0x52e4=['checkIsBlackList','then','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20'];(function(_0x4a13db,_0x912364){var _0x3bdc9e=function(_0x2f3ed9){while(--_0x2f3ed9){_0x4a13db['push'](_0x4a13db['shift']());}};_0x3bdc9e(++_0x912364);}(_0x52e4,0x1d8));var _0x452e=function(_0x56ea6f,_0x15535a){_0x56ea6f=_0x56ea6f-0x0;var _0x43ac31=_0x52e4[_0x56ea6f];return _0x43ac31;};'use strict';var util=require(_0x452e('0x0'));var BPromise=require(_0x452e('0x1'));var logger=require(_0x452e('0x2'))(_0x452e('0x3'));var cmHopper=require(_0x452e('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x452e('0x5'));var voiceQueueReport=require(_0x452e('0x6'));function loggerCatch(_0x32cc58){return function(_0x56f565){logger[_0x452e('0x7')](_0x32cc58,util[_0x452e('0x8')](_0x56f565,{'showHidden':![],'depth':null}));};}function create(_0x5e1b03){return cmHopperHistory[_0x452e('0x9')](_0x5e1b03)[_0x452e('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x32db22){return BPromise[_0x452e('0xb')]()['then'](agentReportPreview[_0x452e('0x9')](_0x32db22))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x24b1f2){return cmHopper[_0x452e('0xc')](_0x24b1f2,!![])[_0x452e('0xa')](loggerCatch(_0x452e('0xd')));}exports['checkIsBlackList']=function(_0x2f3ebc){return cmHopperBlack[_0x452e('0xe')](_0x2f3ebc)[_0x452e('0xa')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x1a0f78){return BPromise[_0x452e('0xb')]()[_0x452e('0xf')](cmHopper[_0x452e('0x10')](_0x1a0f78))[_0x452e('0xa')](loggerCatch(_0x452e('0x11')));};exports[_0x452e('0x9')]=function(_0x56928c,_0x59483b){create(_0x56928c)[_0x452e('0xa')](loggerCatch(_0x59483b));moveContact(_0x56928c)[_0x452e('0xa')](loggerCatch(_0x59483b));};exports[_0x452e('0x12')]=function(_0x3098b5,_0x184855){createAgent(_0x3098b5)[_0x452e('0xa')](loggerCatch(_0x184855));};exports[_0x452e('0x13')]=function(_0x36cc14,_0x5eb0af){create(_0x36cc14)[_0x452e('0xa')](loggerCatch(_0x5eb0af));};exports[_0x452e('0x14')]=function(_0x3d1fc6,_0xc13bc3){moveContact(_0x3d1fc6)['catch'](loggerCatch(_0xc13bc3));};exports[_0x452e('0x15')]=function(_0x3cc0cc,_0x1d1a7d,_0x44146d){if(_0x1d1a7d){_0x3cc0cc[_0x452e('0x16')]=null;}if(_0x44146d){_0x3cc0cc[_0x452e('0x17')]=![];}return cmHopper['rescheduleContact'](_0x3cc0cc)[_0x452e('0xa')](loggerCatch(_0x452e('0x18')));};exports[_0x452e('0x19')]=function(_0x384467){return cmHopper[_0x452e('0x19')](_0x384467)[_0x452e('0xa')](loggerCatch(_0x452e('0x1a')));};exports[_0x452e('0x1b')]=function(_0xb6e4e9){return cmHopper['unlockContact']({'UserId':null},_0xb6e4e9,0x1)['catch'](loggerCatch(_0x452e('0x1c')));};exports['disableContact']=function(_0x5abe28){return cmHopper[_0x452e('0x1b')]({'active':![]},_0x5abe28,0x1)[_0x452e('0xa')](loggerCatch(_0x452e('0x1d')));};exports[_0x452e('0x1e')]=function(_0x32608b){var _0xd0dd09={};_0xd0dd09[_0x452e('0x1f')]=_0x32608b[_0x452e('0x1f')];_0xd0dd09[_0x452e('0x20')]=_0x32608b[_0x452e('0x20')];_0xd0dd09[_0x452e('0x21')]=_0x32608b[_0x452e('0x21')];_0xd0dd09[_0x452e('0x22')]=_0x32608b[_0x452e('0x22')];_0xd0dd09[_0x452e('0x23')]=_0x32608b['queue'];_0xd0dd09[_0x452e('0x24')]=_0x32608b[_0x452e('0x25')];_0xd0dd09[_0x452e('0x26')]=_0x32608b['answertime'];_0xd0dd09[_0x452e('0x27')]=0x1;_0xd0dd09['queuecallercompleteAt']=_0x32608b[_0x452e('0x28')];_0xd0dd09[_0x452e('0x29')]=_0x32608b['membername'];_0xd0dd09[_0x452e('0x2a')]=_0x452e('0x2b');_0xd0dd09[_0x452e('0x2c')]=_0x452e('0x2d');_0xd0dd09[_0x452e('0x2e')]=0x0;_0xd0dd09[_0x452e('0x2f')]=0x1;_0xd0dd09[_0x452e('0x30')]=_0x32608b[_0x452e('0x31')];_0xd0dd09[_0x452e('0x32')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport['create'](_0xd0dd09))[_0x452e('0xa')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x452e('0x33')]=function(_0x4c45e5,_0x43769f){return BPromise[_0x452e('0xb')]()[_0x452e('0xf')](cmHopper[_0x452e('0x33')](_0x4c45e5,_0x43769f))['catch'](loggerCatch(_0x452e('0x34')));};exports['rescheduleContactInQueue']=function(_0x268da6){return cmHopper[_0x452e('0x15')](_0x268da6,!![],!![])['catch'](loggerCatch(_0x452e('0x35')));}; \ No newline at end of file +var _0xdb5f=['getContactRecallMe','rescheduleContactInQueue','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperBlack','error','inspect','catch','[createHistory]\x20','resolve','then','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','holdtime','assigned','lastAssignedTo','membername','COMPLETED','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb5f,0x16a));var _0xfdb5=function(_0x1adf7b,_0x3309c7){_0x1adf7b=_0x1adf7b-0x0;var _0x1dc12b=_0xdb5f[_0x1adf7b];return _0x1dc12b;};'use strict';var util=require(_0xfdb5('0x0'));var BPromise=require('bluebird');var logger=require(_0xfdb5('0x1'))(_0xfdb5('0x2'));var cmHopper=require(_0xfdb5('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xfdb5('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2567b0){return function(_0x11ad44){logger[_0xfdb5('0x5')](_0x2567b0,util[_0xfdb5('0x6')](_0x11ad44,{'showHidden':![],'depth':null}));};}function create(_0x18ebf6){return cmHopperHistory['createHistory'](_0x18ebf6)[_0xfdb5('0x7')](loggerCatch(_0xfdb5('0x8')));}function createAgent(_0x2e4aae){return BPromise[_0xfdb5('0x9')]()[_0xfdb5('0xa')](agentReportPreview[_0xfdb5('0xb')](_0x2e4aae))[_0xfdb5('0x7')](loggerCatch(_0xfdb5('0x8')));}function moveContact(_0x8d8d4a){return cmHopper[_0xfdb5('0xc')](_0x8d8d4a,!![])[_0xfdb5('0x7')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xfdb5('0xd')]=function(_0x407da1){return cmHopperBlack[_0xfdb5('0xd')](_0x407da1)['catch'](loggerCatch(_0xfdb5('0xe')));};exports['getContactPreview']=function(_0x58bc5f){return BPromise[_0xfdb5('0x9')]()['then'](cmHopper['getContactPreview'](_0x58bc5f))[_0xfdb5('0x7')](loggerCatch(_0xfdb5('0xf')));};exports[_0xfdb5('0xb')]=function(_0x2f79c3,_0xec551d){create(_0x2f79c3)['catch'](loggerCatch(_0xec551d));moveContact(_0x2f79c3)[_0xfdb5('0x7')](loggerCatch(_0xec551d));};exports['createAgentHistory']=function(_0x526c62,_0x1fdf7e){createAgent(_0x526c62)['catch'](loggerCatch(_0x1fdf7e));};exports[_0xfdb5('0x10')]=function(_0x4ea5cc,_0xadb5c9){create(_0x4ea5cc)[_0xfdb5('0x7')](loggerCatch(_0xadb5c9));};exports['createCustomerFinal']=function(_0x16429d,_0x1d7373){moveContact(_0x16429d)[_0xfdb5('0x7')](loggerCatch(_0x1d7373));};exports[_0xfdb5('0x11')]=function(_0x1acd01,_0x5e3332,_0x51d112){if(_0x5e3332){_0x1acd01['UserId']=null;}if(_0x51d112){_0x1acd01[_0xfdb5('0x12')]=![];}return cmHopper[_0xfdb5('0x11')](_0x1acd01)[_0xfdb5('0x7')](loggerCatch(_0xfdb5('0x13')));};exports[_0xfdb5('0x14')]=function(_0x466600){return cmHopper[_0xfdb5('0x14')](_0x466600)[_0xfdb5('0x7')](loggerCatch('[countReScheduled]\x20'));};exports[_0xfdb5('0x15')]=function(_0x46da85){return cmHopper[_0xfdb5('0x15')]({'UserId':null},_0x46da85,0x1)[_0xfdb5('0x7')](loggerCatch(_0xfdb5('0x16')));};exports[_0xfdb5('0x17')]=function(_0x45d2af){return cmHopper[_0xfdb5('0x15')]({'active':![]},_0x45d2af,0x1)[_0xfdb5('0x7')](loggerCatch(_0xfdb5('0x18')));};exports['crateCustomerReportQueue']=function(_0x331fcb){var _0x38ce88={};_0x38ce88[_0xfdb5('0x19')]=_0x331fcb['type'];_0x38ce88[_0xfdb5('0x1a')]=_0x331fcb[_0xfdb5('0x1a')];_0x38ce88[_0xfdb5('0x1b')]=_0x331fcb[_0xfdb5('0x1b')];_0x38ce88[_0xfdb5('0x1c')]=_0x331fcb[_0xfdb5('0x1c')];_0x38ce88[_0xfdb5('0x1d')]=_0x331fcb[_0xfdb5('0x1d')];_0x38ce88[_0xfdb5('0x1e')]=_0x331fcb[_0xfdb5('0x1f')];_0x38ce88['queuecallerleaveAt']=_0x331fcb[_0xfdb5('0x1f')];_0x38ce88[_0xfdb5('0x20')]=0x1;_0x38ce88[_0xfdb5('0x21')]=_0x331fcb[_0xfdb5('0x22')];_0x38ce88['connectedlinename']=_0x331fcb['membername'];_0x38ce88[_0xfdb5('0x23')]=_0xfdb5('0x24');_0x38ce88['exten']='xcally-motion-preview';_0x38ce88[_0xfdb5('0x25')]=0x0;_0x38ce88[_0xfdb5('0x26')]=0x1;_0x38ce88[_0xfdb5('0x27')]=_0x331fcb[_0xfdb5('0x28')];_0x38ce88['queuecallerexitreason']=_0xfdb5('0x29');return BPromise[_0xfdb5('0x9')]()[_0xfdb5('0xa')](voiceQueueReport[_0xfdb5('0x2a')](_0x38ce88))[_0xfdb5('0x7')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xfdb5('0x2b')]=function(_0x2d48d8,_0x57bd63){return BPromise[_0xfdb5('0x9')]()[_0xfdb5('0xa')](cmHopper['getContactRecallMe'](_0x2d48d8,_0x57bd63))[_0xfdb5('0x7')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xfdb5('0x2c')]=function(_0x5e3883){return cmHopper[_0xfdb5('0x11')](_0x5e3883,!![],!![])[_0xfdb5('0x7')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 71f58e9..f6fa925 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 _0x799d=['[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','motionChannel','voice','agentReadyId','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','pow','replace','random','extractCalleridName','match','extractCalleridNumber','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','error','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','RECALL','calleridname','uniqueid','originate','channelAgent','calleridnum','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x799d,0xc1));var _0xd799=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x799d[_0x126558];return _0x1f6d14;};'use strict';var util=require(_0xd799('0x0'));var _=require(_0xd799('0x1'));var moment=require(_0xd799('0x2'));var logger=require(_0xd799('0x3'))(_0xd799('0x4'));var ipAgi=process['env'][_0xd799('0x5')]||_0xd799('0x6');var utils=require(_0xd799('0x7'));exports[_0xd799('0x8')]=function(_0x2b86d2){return function(_0x36e5c0){logger['error'](_0x2b86d2,util[_0xd799('0x9')](_0x36e5c0,{'showHidden':![],'depth':null}));};};exports[_0xd799('0xa')]=function(_0x9e8b9c,_0xf02bcb){logger['info'](_0x9e8b9c,util[_0xd799('0x9')](_0xf02bcb,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x26faa5,_0x4a4450){logger[_0xd799('0xb')](_0x26faa5,util['inspect'](_0x4a4450,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x8cb1fa){return function(_0x2372fa){logger['info'](_0x8cb1fa,util['inspect'](_0x2372fa,{'showHidden':![],'depth':null}));};};exports[_0xd799('0xc')]=function(_0x5c74e7,_0x124947,_0x250fc2){return{'message':_0x5c74e7,'unlock':_0x124947,'active':_0x250fc2};};exports[_0xd799('0xd')]=function(_0x12d41c,_0x2ad79f,_0x1911b9){if(!_[_0xd799('0xe')](_0x1911b9)&&_0xd799('0xf')===typeof _0x1911b9&&!_['isEmpty'](_0x1911b9)){if(!_[_0xd799('0xe')](_0x2ad79f)&&_0xd799('0xf')===typeof _0x2ad79f&&!_[_0xd799('0x10')](_0x2ad79f)){return util[_0xd799('0x11')]('\x22%s\x22\x20<%s>',_0x2ad79f,_0x1911b9);}return util[_0xd799('0x11')](_0xd799('0x12'),_0x1911b9,_0x1911b9);}if(!_[_0xd799('0xe')](_0x12d41c)&&_0xd799('0xf')===typeof _0x12d41c&&!_[_0xd799('0x10')](_0x12d41c)){return _0x12d41c;}return _0xd799('0x13');};exports['isActive']=function(_0x3c755b){if(_[_0xd799('0x14')](_0x3c755b)){return![];}return _0x3c755b;};exports[_0xd799('0x15')]=function(_0x4788b2,_0x5555fb,_0x440ee3,_0x7a8b4,_0x2d6cb8,_0x20a5a4){var _0xeeab15={'XMD-QUEUE':_0x5555fb[_0xd799('0x16')]?_0x5555fb[_0xd799('0x16')][_0xd799('0x17')]:'','XMD-CALLERID':_0x7a8b4,'XMD-CALLERID-PREVIEW':_0x20a5a4?util[_0xd799('0x11')](_0xd799('0x12'),_0x20a5a4['calleridname'],_0x20a5a4['calleridnum']):_0x7a8b4,'XMD-DIALID':_0x2d6cb8,'XMD-CONTACTID':_0x5555fb[_0xd799('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x7a8b4,'XMD-VOICEQUEUEID':_0x5555fb[_0xd799('0x19')],'XMD-DIALCHANNEL':_0x440ee3,'XMD-DIALTIMEOUT':_0x4788b2[_0xd799('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xd799('0x11')](_0xd799('0x1b'),_0x4788b2[_0xd799('0x1c')]?'g':'',_[_0xd799('0x10')](_0x4788b2[_0xd799('0x1d')])?'':_0xd799('0x1e')),'XMD-DIALURL':_0x4788b2[_0xd799('0x1f')]||'','XMD-AGI':_0x4788b2['dialQueueProject']?util[_0xd799('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4788b2[_0xd799('0x20')]):'NONE','XMD-AGIAFTER':_0x4788b2[_0xd799('0x1c')]?util[_0xd799('0x11')](_0xd799('0x21'),ipAgi,_0x4788b2[_0xd799('0x1c')]):_0xd799('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x20a5a4?_0x20a5a4[_0xd799('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x20a5a4?_0x20a5a4[_0xd799('0x24')]:'','XMD-DESTINATION':_0xd799('0x25'),'SIPADDHEADER':_0xd799('0x26')};if(!_[_0xd799('0x10')](_0x4788b2[_0xd799('0x1d')])){_0xeeab15[util[_0xd799('0x11')]('%s',_0xd799('0x27'))]=_0x4788b2[_0xd799('0x1d')];_0xeeab15[util[_0xd799('0x11')]('%s',_0xd799('0x28'))]=_0x2d6cb8;}return _0xeeab15;};exports[_0xd799('0x29')]=function(_0x529521){var _0x847f4e={};for(var _0xa7c025 in _0x529521){if(_0x529521[_0xd799('0x2a')](_0xa7c025)){_0x847f4e[util[_0xd799('0x11')]('%s',_['toLower'](_0xa7c025))]=_0x529521[_0xa7c025];}}return{'variables':_0x847f4e};};exports[_0xd799('0x2b')]=function(_0x2c41a1,_0x4b097a){if(!_[_0xd799('0x14')](_0x2c41a1)){if(_0x2c41a1['hasOwnProperty'](_0xd799('0x2c'))){if(_0x2c41a1[_0xd799('0x2c')]>0x0){_0x2c41a1[_0xd799('0x2c')]-=0x1;}else{logger['error'](_0xd799('0x2d'),_0x4b097a);}}}else{logger[_0xd799('0xb')](_0xd799('0x2e'),_0x4b097a);}};exports[_0xd799('0x2f')]=function(_0x1ea6d5){var _0x1be777=moment()['format'](_0xd799('0x30'));_0x1ea6d5[_0xd799('0x31')]=0xd;_0x1ea6d5[_0xd799('0x32')]=_0xd799('0x33');_0x1ea6d5['starttime']=_0x1be777;_0x1ea6d5[_0xd799('0x34')]=_0x1be777;_0x1ea6d5[_0xd799('0x35')]=_0x1be777;};exports[_0xd799('0x36')]=function(_0x159f1a,_0x4c4cd3,_0x4a94e6){var _0x1fc4f8=moment()[_0xd799('0x11')](_0xd799('0x30'));_0x159f1a[_0xd799('0x31')]=_0x4c4cd3;_0x159f1a[_0xd799('0x32')]=_0x4a94e6;_0x159f1a[_0xd799('0x34')]=_0x1fc4f8;_0x159f1a[_0xd799('0x37')]=utils[_0xd799('0x38')](_0x159f1a[_0xd799('0x34')],_0x159f1a[_0xd799('0x39')]);};exports[_0xd799('0x3a')]=function(_0x43b211,_0x441b7d,_0x169ba6){_0x43b211[_0xd799('0x3b')]=_0x441b7d;_0x43b211[_0xd799('0x3c')]=_0x169ba6;};exports[_0xd799('0x3d')]=function(_0x46c95e,_0x44002a,_0x3c4f87){var _0x331a2b=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x46c95e[_0xd799('0x31')]=_0x44002a;_0x46c95e[_0xd799('0x32')]=_0x3c4f87;_0x46c95e[_0xd799('0x34')]=_0x46c95e[_0xd799('0x34')]?_0x46c95e['responsetime']:_0x331a2b;_0x46c95e['endtime']=_0x46c95e[_0xd799('0x35')]?_0x46c95e[_0xd799('0x35')]:_0x331a2b;_0x46c95e[_0xd799('0x37')]=utils[_0xd799('0x38')](_0x46c95e['responsetime']||0x0,_0x46c95e[_0xd799('0x39')]||0x0);_0x46c95e[_0xd799('0x3e')]=_0x46c95e[_0xd799('0x3f')]?utils['getSeconds'](_0x46c95e[_0xd799('0x35')],_0x46c95e[_0xd799('0x3f')]):0x0;};exports[_0xd799('0x40')]=function(_0x4bb2da){return _0x4bb2da===_0xd799('0x41');};exports['variablesAction']=function(_0x230c59,_0x293e53,_0x3acada,_0x44e754,_0x5bba12){var _0x3ac8ac=_0x44e754?_0xd799('0x42'):_0x230c59[_0xd799('0x43')];_0x3ac8ac=_0x5bba12?'BOOKED':_0x3ac8ac;return{'actionid':_0x230c59[_0xd799('0x44')],'action':_0xd799('0x45'),'channel':_0x230c59[_0xd799('0x46')],'callerid':util['format'](_0xd799('0x12'),_0x3ac8ac,_0x230c59[_0xd799('0x47')]),'Exten':_0xd799('0x25'),'Context':_0xd799('0x48'),'Priority':'1','variable':_0x3acada,'timeout':(_0x293e53['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x230c59[_0xd799('0x44')]};};exports['totalGlobal']=function(_0x39fefa){return _0x39fefa[_0xd799('0x49')]+_0x39fefa[_0xd799('0x4a')]+_0x39fefa[_0xd799('0x4b')]+_0x39fefa[_0xd799('0x4c')]+_0x39fefa['countnosuchnumberretry'];};exports[_0xd799('0x4d')]=function(_0x4a6494){var _0x2eda61=_[_0xd799('0x4e')](_0x4a6494);_0x2eda61['state']=0xf;_0x2eda61[_0xd799('0x32')]=_0xd799('0x4f');return _0x2eda61;};exports[_0xd799('0x50')]=function(_0x3ccd3a,_0x5b9c6a,_0x31786d){var _0x387193={};_0x387193[_0x5b9c6a]=_0x3ccd3a[_0x5b9c6a];_0x387193['active']=![];_0x387193[_0xd799('0x51')]=moment()[_0xd799('0x52')](_0x31786d,_0xd799('0x53'))[_0xd799('0x11')](_0xd799('0x30'));_0x387193[_0xd799('0x18')]=_0x3ccd3a['ContactId'];_0x387193[_0xd799('0x54')]=_0x3ccd3a[_0xd799('0x54')];_0x387193[_0xd799('0x19')]=_0x3ccd3a[_0xd799('0x19')]||undefined;return _0x387193;};exports[_0xd799('0x55')]=function(_0x4b77dd,_0x51e893){if(!_[_0xd799('0x14')](_0x4b77dd)){if(_0x4b77dd[_0xd799('0x56')]>0x0){_0x4b77dd[_0xd799('0x56')]-=0x1;}else{logger[_0xd799('0xb')](_0x51e893,_0xd799('0x57'));}}else{logger[_0xd799('0xb')](_0x51e893,_0xd799('0x58'));}};exports[_0xd799('0x59')]=function(_0x7dcc9d){if(_0x7dcc9d<=0x0){return!![];}return![];};function buildObj(_0x26f59d,_0x1f6088,_0x51982a){_0x26f59d['lastevent']=_0x1f6088;_0x26f59d[_0xd799('0x17')]=_0x26f59d['queue'];_0x26f59d['interface']=_0x26f59d[_0xd799('0x46')];_0x26f59d[_0xd799('0x5a')]=_0xd799('0x5b');if(_0x51982a){_0x26f59d['mandatoryDisposition']=_0x51982a['mandatoryDisposition'];}return _0x26f59d;}exports['buildObj']=buildObj;exports[_0xd799('0x5c')]=function(_0x1ae557){var _0x1b2424=[];for(var _0x19f827 in _0x1ae557){if(_0x1ae557[_0xd799('0x2a')](_0x19f827)){if(!_[_0xd799('0x14')](_0x1ae557[_0x19f827])&&_0x1ae557[_0x19f827][_0xd799('0x31')]==='not_inuse'&&_0x1ae557[_0x19f827][_0xd799('0x5d')]===_0xd799('0x5e')){_0x1b2424[_0xd799('0x5f')](_0x1ae557[_0x19f827]['id']);}}}return _0x1b2424;};exports[_0xd799('0x60')]=function(_0x4bb7bc){var _0x537419=moment()['milliseconds'](0x0);var _0x5b8938=moment(_0x4bb7bc)[_0xd799('0x61')](0x0);return _0x537419[_0xd799('0x62')](_0x5b8938,_0xd799('0x63'));};exports[_0xd799('0x64')]=function(_0x19a5ba){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x19a5ba[_0xd799('0x18')],'ListId':_0x19a5ba['ListId'],'VoiceQueueId':_0x19a5ba[_0xd799('0x19')]||undefined,'CampaignId':_0x19a5ba[_0xd799('0x65')]||undefined};};exports[_0xd799('0x66')]=function(_0x373516){if(_0x373516===_0xd799('0x44')||_0x373516===_0xd799('0x67')||_0x373516==='queue'||_0x373516===_0xd799('0x68')||_0x373516===_0xd799('0x69')||_0x373516===_0xd799('0x6a')||_0x373516===_0xd799('0x3b')||_0x373516===_0xd799('0x46')||_0x373516==='calleridname'||_0x373516===_0xd799('0x6b')||_0x373516===_0xd799('0x47')||_0x373516===_0xd799('0x51')||_0x373516==='countbusyretry'||_0x373516===_0xd799('0x4a')||_0x373516==='countnoanswerretry'||_0x373516===_0xd799('0x6c')||_0x373516===_0xd799('0x6d')||_0x373516===_0xd799('0x6e')||_0x373516===_0xd799('0x6f')||_0x373516===_0xd799('0x70')||_0x373516==='ContactId'||_0x373516===_0xd799('0x54')||_0x373516===_0xd799('0x3c')||_0x373516==='VoiceQueueId'||_0x373516==='sipcallid'||_0x373516==='xmd-voicequeueid'||_0x373516===_0xd799('0x71')||_0x373516===_0xd799('0x72')||_0x373516===_0xd799('0x73')||_0x373516===_0xd799('0x74')||_0x373516==='xmd-dialtimeout'||_0x373516===_0xd799('0x75')||_0x373516===_0xd799('0x76')||_0x373516===_0xd799('0x77')||_0x373516===_0xd799('0x78')||_0x373516==='xmd-cdrtype'||_0x373516==='xmd-callerid'||_0x373516==='xmd-agiafter'||_0x373516===_0xd799('0x79')||_0x373516===_0xd799('0x7a')||_0x373516===_0xd799('0x7b')||_0x373516==='rtpaudioqosjitter'||_0x373516===_0xd799('0x7c')||_0x373516===_0xd799('0x7d')||_0x373516===_0xd799('0x7e')||_0x373516===_0xd799('0x7f')||_0x373516===_0xd799('0x80')||_0x373516==='rtpaudioqos'||_0x373516===_0xd799('0x7b')||_0x373516===_0xd799('0x81')||_0x373516==='rtpaudioqosjitterbridged'||_0x373516===_0xd799('0x7d')||_0x373516==='rtpaudioqoslossbridged'||_0x373516===_0xd799('0x7f')||_0x373516===_0xd799('0x80')||_0x373516==='bridgepeer'||_0x373516==='bridgepvtcallid'||_0x373516===_0xd799('0x31')||_0x373516===_0xd799('0x32')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2efec6,_0x332022){var _0x357747,_0x3f614d,_0x561c08;if(_0x332022<=0x0){_0x332022=0x1;}_0x357747=new RegExp('\x5cw{0,'+_0x332022+'}$');_0x3f614d=Math[_0xd799('0x82')](0xa,_0x332022-0x1);_0x561c08=Math[_0xd799('0x82')](0xa,_0x332022)-0x1;return util[_0xd799('0x11')]('%s',_[_0xd799('0x83')](_0x2efec6,_0x357747,_[_0xd799('0x84')](_0x3f614d,_0x561c08)));};exports[_0xd799('0x85')]=function(_0x8d6916){var _0x326c17=_0x8d6916[_0xd799('0x86')](/"(.*?)"/);return _0x326c17?_0x326c17[0x1]:_0x8d6916;};exports[_0xd799('0x87')]=function(_0x2d5525){var _0x3b91e6=_0x2d5525[_0xd799('0x86')](/<(.*?)>/);return _0x3b91e6?_0x3b91e6[0x1]:_0x2d5525;};function buildNoAnswerEventPayload(_0x3097a9,_0x2e46ce){var _0x3d6b7e=buildObj(_0x3097a9,'noanswer');if(!_['isEmpty'](_0x2e46ce['variables'])){Object['keys'](_0x2e46ce[_0xd799('0x88')])[_0xd799('0x89')](function(_0x42818e){_0x3d6b7e[_0x42818e[_0xd799('0x8a')]()]=_0x2e46ce['variables'][_0x42818e];});}return _0x3d6b7e;}exports[_0xd799('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x82d0=['XCALLY_IP_AGI','127.0.0.1','error','logger','inspect','logger2','info','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','getSeconds','logLookAgent','membername','logCustomer','endtime','ringtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','originate','channelAgent','from-sip','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','push','getDiff','milliseconds','seconds','CampaignId','filterKey','idContact','type','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','preview','env'];(function(_0x3263fd,_0x2de078){var _0x287b4a=function(_0x2e68bd){while(--_0x2e68bd){_0x3263fd['push'](_0x3263fd['shift']());}};_0x287b4a(++_0x2de078);}(_0x82d0,0x1a3));var _0x082d=function(_0x5eaefe,_0xc72159){_0x5eaefe=_0x5eaefe-0x0;var _0xe64929=_0x82d0[_0x5eaefe];return _0xe64929;};'use strict';var util=require(_0x082d('0x0'));var _=require('lodash');var moment=require(_0x082d('0x1'));var logger=require('../../../../config/logger')(_0x082d('0x2'));var ipAgi=process[_0x082d('0x3')][_0x082d('0x4')]||_0x082d('0x5');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x190740){return function(_0x1f63d2){logger[_0x082d('0x6')](_0x190740,util['inspect'](_0x1f63d2,{'showHidden':![],'depth':null}));};};exports[_0x082d('0x7')]=function(_0x41362e,_0x29756e){logger['info'](_0x41362e,util[_0x082d('0x8')](_0x29756e,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2ae786,_0x30dc50){logger[_0x082d('0x6')](_0x2ae786,util[_0x082d('0x8')](_0x30dc50,{'showHidden':![],'depth':null}));};exports[_0x082d('0x9')]=function(_0x1518fc){return function(_0x1c1a75){logger[_0x082d('0xa')](_0x1518fc,util[_0x082d('0x8')](_0x1c1a75,{'showHidden':![],'depth':null}));};};exports[_0x082d('0xb')]=function(_0x2f964f,_0x59095a,_0xe7d7c5){return{'message':_0x2f964f,'unlock':_0x59095a,'active':_0xe7d7c5};};exports[_0x082d('0xc')]=function(_0x2f0009,_0x5052aa,_0x1f8fe5){if(!_[_0x082d('0xd')](_0x1f8fe5)&&_0x082d('0xe')===typeof _0x1f8fe5&&!_[_0x082d('0xf')](_0x1f8fe5)){if(!_[_0x082d('0xd')](_0x5052aa)&&_0x082d('0xe')===typeof _0x5052aa&&!_['isEmpty'](_0x5052aa)){return util['format'](_0x082d('0x10'),_0x5052aa,_0x1f8fe5);}return util[_0x082d('0x11')]('\x22%s\x22\x20<%s>',_0x1f8fe5,_0x1f8fe5);}if(!_[_0x082d('0xd')](_0x2f0009)&&_0x082d('0xe')===typeof _0x2f0009&&!_[_0x082d('0xf')](_0x2f0009)){return _0x2f0009;}return _0x082d('0x12');};exports[_0x082d('0x13')]=function(_0x2e80a9){if(_[_0x082d('0x14')](_0x2e80a9)){return![];}return _0x2e80a9;};exports['addVariables']=function(_0x229dff,_0x2564a1,_0x1f780c,_0x4524f1,_0x3508ce,_0x3ff85c){var _0x38ce39={'XMD-QUEUE':_0x2564a1[_0x082d('0x15')]?_0x2564a1[_0x082d('0x15')][_0x082d('0x16')]:'','XMD-CALLERID':_0x4524f1,'XMD-CALLERID-PREVIEW':_0x3ff85c?util[_0x082d('0x11')](_0x082d('0x10'),_0x3ff85c[_0x082d('0x17')],_0x3ff85c[_0x082d('0x18')]):_0x4524f1,'XMD-DIALID':_0x3508ce,'XMD-CONTACTID':_0x2564a1[_0x082d('0x19')],'XMD-CDRTYPE':_0x082d('0x1a'),'CALLERID(all)':_0x4524f1,'XMD-VOICEQUEUEID':_0x2564a1[_0x082d('0x1b')],'XMD-DIALCHANNEL':_0x1f780c,'XMD-DIALTIMEOUT':_0x229dff[_0x082d('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x082d('0x11')]('\x22rtTxX%s%s\x22',_0x229dff[_0x082d('0x1d')]?'g':'',_[_0x082d('0xf')](_0x229dff[_0x082d('0x1e')])?'':_0x082d('0x1f')),'XMD-DIALURL':_0x229dff['dialPreviewUrl']||'','XMD-AGI':_0x229dff['dialQueueProject']?util[_0x082d('0x11')](_0x082d('0x20'),ipAgi,_0x229dff[_0x082d('0x21')]):_0x082d('0x22'),'XMD-AGIAFTER':_0x229dff[_0x082d('0x1d')]?util[_0x082d('0x11')](_0x082d('0x20'),ipAgi,_0x229dff['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3ff85c?_0x3ff85c['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3ff85c?_0x3ff85c[_0x082d('0x23')]:'','XMD-DESTINATION':_0x082d('0x24'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x229dff[_0x082d('0x1e')])){_0x38ce39[util[_0x082d('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x229dff['monitor_format'];_0x38ce39[util[_0x082d('0x11')]('%s',_0x082d('0x25'))]=_0x3508ce;}return _0x38ce39;};exports['toLowerVariables']=function(_0x516963){var _0x50dfc6={};for(var _0x5d1a72 in _0x516963){if(_0x516963[_0x082d('0x26')](_0x5d1a72)){_0x50dfc6[util[_0x082d('0x11')]('%s',_['toLower'](_0x5d1a72))]=_0x516963[_0x5d1a72];}}return{'variables':_0x50dfc6};};exports[_0x082d('0x27')]=function(_0x13bf11,_0x4744b5){if(!_[_0x082d('0x14')](_0x13bf11)){if(_0x13bf11['hasOwnProperty'](_0x082d('0x28'))){if(_0x13bf11[_0x082d('0x28')]>0x0){_0x13bf11[_0x082d('0x28')]-=0x1;}else{logger[_0x082d('0x6')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4744b5);}}}else{logger[_0x082d('0x6')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4744b5);}};exports[_0x082d('0x29')]=function(_0x4867b9){var _0x29ec06=moment()[_0x082d('0x11')](_0x082d('0x2a'));_0x4867b9[_0x082d('0x2b')]=0xd;_0x4867b9[_0x082d('0x2c')]=_0x082d('0x2d');_0x4867b9[_0x082d('0x2e')]=_0x29ec06;_0x4867b9[_0x082d('0x2f')]=_0x29ec06;_0x4867b9['endtime']=_0x29ec06;};exports[_0x082d('0x30')]=function(_0x58c52d,_0x28b1b1,_0x355fa9){var _0x594ccb=moment()['format'](_0x082d('0x2a'));_0x58c52d[_0x082d('0x2b')]=_0x28b1b1;_0x58c52d[_0x082d('0x2c')]=_0x355fa9;_0x58c52d[_0x082d('0x2f')]=_0x594ccb;_0x58c52d['ringtime']=utils[_0x082d('0x31')](_0x58c52d[_0x082d('0x2f')],_0x58c52d[_0x082d('0x2e')]);};exports[_0x082d('0x32')]=function(_0x4f3680,_0x36c926,_0x1918ac){_0x4f3680[_0x082d('0x33')]=_0x36c926;_0x4f3680['UserId']=_0x1918ac;};exports[_0x082d('0x34')]=function(_0x36500f,_0x5a19e4,_0x1d9ea2){var _0x4311ed=moment()[_0x082d('0x11')](_0x082d('0x2a'));_0x36500f['state']=_0x5a19e4;_0x36500f[_0x082d('0x2c')]=_0x1d9ea2;_0x36500f['responsetime']=_0x36500f[_0x082d('0x2f')]?_0x36500f['responsetime']:_0x4311ed;_0x36500f[_0x082d('0x35')]=_0x36500f[_0x082d('0x35')]?_0x36500f[_0x082d('0x35')]:_0x4311ed;_0x36500f[_0x082d('0x36')]=utils['getSeconds'](_0x36500f[_0x082d('0x2f')]||0x0,_0x36500f[_0x082d('0x2e')]||0x0);_0x36500f[_0x082d('0x37')]=_0x36500f[_0x082d('0x38')]?utils['getSeconds'](_0x36500f[_0x082d('0x35')],_0x36500f['answertime']):0x0;};exports['isFailure']=function(_0x5e5437){return _0x5e5437===_0x082d('0x39');};exports[_0x082d('0x3a')]=function(_0x2750c4,_0x5a8052,_0x4559c3,_0x48f35f,_0xc02b9e){var _0x4b1664=_0x48f35f?_0x082d('0x3b'):_0x2750c4['calleridname'];_0x4b1664=_0xc02b9e?_0x082d('0x3c'):_0x4b1664;return{'actionid':_0x2750c4['uniqueid'],'action':_0x082d('0x3d'),'channel':_0x2750c4[_0x082d('0x3e')],'callerid':util[_0x082d('0x11')](_0x082d('0x10'),_0x4b1664,_0x2750c4[_0x082d('0x18')]),'Exten':'xcally-motion-preview','Context':_0x082d('0x3f'),'Priority':'1','variable':_0x4559c3,'timeout':(_0x5a8052['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2750c4[_0x082d('0x40')]};};exports[_0x082d('0x41')]=function(_0x3ff835){return _0x3ff835[_0x082d('0x42')]+_0x3ff835[_0x082d('0x43')]+_0x3ff835[_0x082d('0x44')]+_0x3ff835[_0x082d('0x45')]+_0x3ff835[_0x082d('0x46')];};exports[_0x082d('0x47')]=function(_0x1e83f2){var _0x555763=_[_0x082d('0x48')](_0x1e83f2);_0x555763[_0x082d('0x2b')]=0xf;_0x555763['statedesc']=_0x082d('0x49');return _0x555763;};exports[_0x082d('0x4a')]=function(_0x1781dd,_0x1b8532,_0x382f73){var _0x202bc1={};_0x202bc1[_0x1b8532]=_0x1781dd[_0x1b8532];_0x202bc1[_0x082d('0x4b')]=![];_0x202bc1[_0x082d('0x4c')]=moment()[_0x082d('0x4d')](_0x382f73,'minutes')[_0x082d('0x11')](_0x082d('0x2a'));_0x202bc1[_0x082d('0x19')]=_0x1781dd[_0x082d('0x19')];_0x202bc1['ListId']=_0x1781dd[_0x082d('0x4e')];_0x202bc1[_0x082d('0x1b')]=_0x1781dd[_0x082d('0x1b')]||undefined;return _0x202bc1;};exports[_0x082d('0x4f')]=function(_0x13035d,_0x4ef0d9){if(!_[_0x082d('0x14')](_0x13035d)){if(_0x13035d[_0x082d('0x50')]>0x0){_0x13035d[_0x082d('0x50')]-=0x1;}else{logger[_0x082d('0x6')](_0x4ef0d9,_0x082d('0x51'));}}else{logger['error'](_0x4ef0d9,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x082d('0x52')]=function(_0x49892e){if(_0x49892e<=0x0){return!![];}return![];};function buildObj(_0xdcbc45,_0x36ab69,_0x71b264){_0xdcbc45[_0x082d('0x53')]=_0x36ab69;_0xdcbc45[_0x082d('0x16')]=_0xdcbc45[_0x082d('0x54')];_0xdcbc45[_0x082d('0x55')]=_0xdcbc45[_0x082d('0x3e')];_0xdcbc45['motionChannel']=_0x082d('0x56');if(_0x71b264){_0xdcbc45['mandatoryDisposition']=_0x71b264[_0x082d('0x57')];}return _0xdcbc45;}exports[_0x082d('0x58')]=buildObj;exports[_0x082d('0x59')]=function(_0x2f0220){var _0x1f0cf4=[];for(var _0x3bfd50 in _0x2f0220){if(_0x2f0220[_0x082d('0x26')](_0x3bfd50)){if(!_['isNil'](_0x2f0220[_0x3bfd50])&&_0x2f0220[_0x3bfd50][_0x082d('0x2b')]===_0x082d('0x5a')&&_0x2f0220[_0x3bfd50][_0x082d('0x5b')]==='reachable'){_0x1f0cf4[_0x082d('0x5c')](_0x2f0220[_0x3bfd50]['id']);}}}return _0x1f0cf4;};exports[_0x082d('0x5d')]=function(_0x4c080e){var _0x5af375=moment()['milliseconds'](0x0);var _0x33cf81=moment(_0x4c080e)[_0x082d('0x5e')](0x0);return _0x5af375['diff'](_0x33cf81,_0x082d('0x5f'));};exports['createBody']=function(_0x447ade){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x447ade['ContactId'],'ListId':_0x447ade[_0x082d('0x4e')],'VoiceQueueId':_0x447ade['VoiceQueueId']||undefined,'CampaignId':_0x447ade[_0x082d('0x60')]||undefined};};exports[_0x082d('0x61')]=function(_0x27b944){if(_0x27b944===_0x082d('0x40')||_0x27b944===_0x082d('0x62')||_0x27b944===_0x082d('0x54')||_0x27b944===_0x082d('0x63')||_0x27b944==='campaigntype'||_0x27b944===_0x082d('0x64')||_0x27b944===_0x082d('0x33')||_0x27b944===_0x082d('0x3e')||_0x27b944===_0x082d('0x17')||_0x27b944===_0x082d('0x4b')||_0x27b944==='calleridnum'||_0x27b944==='scheduledat'||_0x27b944===_0x082d('0x42')||_0x27b944==='countcongestionretry'||_0x27b944===_0x082d('0x44')||_0x27b944==='countglobal'||_0x27b944===_0x082d('0x65')||_0x27b944===_0x082d('0x66')||_0x27b944===_0x082d('0x67')||_0x27b944===_0x082d('0x68')||_0x27b944==='ContactId'||_0x27b944===_0x082d('0x4e')||_0x27b944==='UserId'||_0x27b944===_0x082d('0x1b')||_0x27b944===_0x082d('0x69')||_0x27b944===_0x082d('0x6a')||_0x27b944===_0x082d('0x6b')||_0x27b944===_0x082d('0x6c')||_0x27b944===_0x082d('0x6d')||_0x27b944===_0x082d('0x6e')||_0x27b944===_0x082d('0x6f')||_0x27b944===_0x082d('0x70')||_0x27b944==='xmd-dialid'||_0x27b944===_0x082d('0x71')||_0x27b944===_0x082d('0x72')||_0x27b944===_0x082d('0x73')||_0x27b944===_0x082d('0x74')||_0x27b944===_0x082d('0x75')||_0x27b944===_0x082d('0x76')||_0x27b944===_0x082d('0x77')||_0x27b944===_0x082d('0x78')||_0x27b944===_0x082d('0x79')||_0x27b944===_0x082d('0x7a')||_0x27b944===_0x082d('0x7b')||_0x27b944===_0x082d('0x7c')||_0x27b944==='rtpaudioqosrtt'||_0x27b944==='rtpaudioqosrttbridged'||_0x27b944===_0x082d('0x77')||_0x27b944===_0x082d('0x78')||_0x27b944===_0x082d('0x79')||_0x27b944==='rtpaudioqosjitterbridged'||_0x27b944===_0x082d('0x7b')||_0x27b944===_0x082d('0x7c')||_0x27b944===_0x082d('0x7d')||_0x27b944===_0x082d('0x7e')||_0x27b944==='bridgepeer'||_0x27b944===_0x082d('0x7f')||_0x27b944==='state'||_0x27b944===_0x082d('0x2c')){return![];}return!![];};exports[_0x082d('0x80')]=function(_0x5127c1,_0x5001d1){var _0x567bdc,_0x351ea6,_0x13ba64;if(_0x5001d1<=0x0){_0x5001d1=0x1;}_0x567bdc=new RegExp(_0x082d('0x81')+_0x5001d1+'}$');_0x351ea6=Math[_0x082d('0x82')](0xa,_0x5001d1-0x1);_0x13ba64=Math['pow'](0xa,_0x5001d1)-0x1;return util['format']('%s',_[_0x082d('0x83')](_0x5127c1,_0x567bdc,_['random'](_0x351ea6,_0x13ba64)));};exports[_0x082d('0x84')]=function(_0xc96e76){var _0x451a15=_0xc96e76[_0x082d('0x85')](/"(.*?)"/);return _0x451a15?_0x451a15[0x1]:_0xc96e76;};exports[_0x082d('0x86')]=function(_0x1c9696){var _0x3c0935=_0x1c9696['match'](/<(.*?)>/);return _0x3c0935?_0x3c0935[0x1]:_0x1c9696;};function buildNoAnswerEventPayload(_0x5c7984,_0x39718c){var _0x555928=buildObj(_0x5c7984,_0x082d('0x87'));if(!_['isEmpty'](_0x39718c[_0x082d('0x88')])){Object[_0x082d('0x89')](_0x39718c[_0x082d('0x88')])[_0x082d('0x8a')](function(_0x161a1c){_0x555928[_0x161a1c[_0x082d('0x8b')]()]=_0x39718c[_0x082d('0x88')][_0x161a1c];});}return _0x555928;}exports[_0x082d('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2e444ca..53e3601 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 _0xa585=['number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xa585,0x82));var _0x5a58=function(_0x52ac6b,_0xb00fc8){_0x52ac6b=_0x52ac6b-0x0;var _0x2473af=_0xa585[_0x52ac6b];return _0x2473af;};'use strict';exports[_0x5a58('0x0')]={'queue':{'type':_0x5a58('0x1'),'required':!![]},'interface':{'type':_0x5a58('0x1'),'required':!![]},'membername':{'type':_0x5a58('0x1'),'required':!![]},'penalty':{'type':_0x5a58('0x2'),'required':![]},'paused':{'type':_0x5a58('0x3'),'required':![]}};exports[_0x5a58('0x4')]={'queue':{'type':_0x5a58('0x1'),'required':!![]},'interface':{'type':_0x5a58('0x1'),'required':!![]}};exports[_0x5a58('0x5')]={'interface':{'type':_0x5a58('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x5a58('0x6')]={'module':{'type':_0x5a58('0x1'),'required':![]}};exports[_0x5a58('0x7')]={'uniqueid':{'type':_0x5a58('0x1'),'required':!![]}};exports[_0x5a58('0x8')]={'uniqueid':{'type':_0x5a58('0x1'),'required':!![]},'filename':{'type':_0x5a58('0x1')},'format':{'type':_0x5a58('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x5a58('0x9')]={'uniqueid':{'type':_0x5a58('0x1'),'required':!![]}};exports[_0x5a58('0xa')]={'uniqueid':{'type':_0x5a58('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x5a58('0x1')}}; \ No newline at end of file +var _0x34cf=['voicequeuechannelhangup','voicequeuechannelredirect','string','number','queueremove','queuepause','boolean','reload','voicequeuechannel'];(function(_0x28afdd,_0xe5f157){var _0x143069=function(_0x23dc08){while(--_0x23dc08){_0x28afdd['push'](_0x28afdd['shift']());}};_0x143069(++_0xe5f157);}(_0x34cf,0xfe));var _0xf34c=function(_0x5c6b32,_0x26f261){_0x5c6b32=_0x5c6b32-0x0;var _0x2f825f=_0x34cf[_0x5c6b32];return _0x2f825f;};'use strict';exports['queueadd']={'queue':{'type':_0xf34c('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xf34c('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xf34c('0x2')]={'queue':{'type':_0xf34c('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xf34c('0x3')]={'interface':{'type':_0xf34c('0x0'),'required':!![]},'paused':{'type':_0xf34c('0x4')},'reason':{'type':_0xf34c('0x0'),'required':![]}};exports[_0xf34c('0x5')]={'module':{'type':_0xf34c('0x0'),'required':![]}};exports[_0xf34c('0x6')]={'uniqueid':{'type':_0xf34c('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xf34c('0x0')},'format':{'type':_0xf34c('0x0')},'mixmonitorid':{'type':'string'}};exports[_0xf34c('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf34c('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xf34c('0x0'),'required':!![]},'context':{'type':_0xf34c('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 636b2ae..3b8789e 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 _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x8f3b30,_0x40716d){var _0x437ee6=function(_0xf673b8){while(--_0xf673b8){_0x8f3b30['push'](_0x8f3b30['shift']());}};_0x437ee6(++_0x40716d);}(_0xdb28,0x106));var _0x8db2=function(_0x938738,_0x6bfadb){_0x938738=_0x938738-0x0;var _0x16c02c=_0xdb28[_0x938738];return _0x16c02c;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x4c77d9,_0x3ff64d){var _0x48dc07=function(_0x31a22c){while(--_0x31a22c){_0x4c77d9['push'](_0x4c77d9['shift']());}};_0x48dc07(++_0x3ff64d);}(_0xb10b,0x12a));var _0xbb10=function(_0x25b444,_0x20da5e){_0x25b444=_0x25b444-0x0;var _0x425f88=_0xb10b[_0x25b444];return _0x425f88;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 3bf48a3..b36a1b9 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafe3=['mergeDBDataToRealtime'];(function(_0x212563,_0x465ade){var _0x4d987d=function(_0x2f18ba){while(--_0x2f18ba){_0x212563['push'](_0x212563['shift']());}};_0x4d987d(++_0x465ade);}(_0xafe3,0x1a1));var _0x3afe=function(_0x4d000d,_0x1ef042){_0x4d000d=_0x4d000d-0x0;var _0x4c25e4=_0xafe3[_0x4d000d];return _0x4c25e4;};'use strict';function mergeDBDataToRealtime(_0x303e9d,_0x2fcdf4){var _0x29dcce=Object['assign']({},_0x303e9d);for(var _0x116bc9 in _0x2fcdf4){if(_0x29dcce['hasOwnProperty'](_0x116bc9)){_0x29dcce[_0x116bc9]=_0x2fcdf4[_0x116bc9];}}return _0x29dcce;}exports[_0x3afe('0x0')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xf5a7=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x52e5c6,_0x232cd2){var _0x48793d=function(_0x2580e7){while(--_0x2580e7){_0x52e5c6['push'](_0x52e5c6['shift']());}};_0x48793d(++_0x232cd2);}(_0xf5a7,0x1ea));var _0x7f5a=function(_0x518bae,_0x1f76ba){_0x518bae=_0x518bae-0x0;var _0x3cc701=_0xf5a7[_0x518bae];return _0x3cc701;};'use strict';function mergeDBDataToRealtime(_0x482ca5,_0x3a55d9){var _0x1aba66=Object[_0x7f5a('0x0')]({},_0x482ca5);for(var _0x33a64b in _0x3a55d9){if(_0x1aba66[_0x7f5a('0x1')](_0x33a64b)){_0x1aba66[_0x33a64b]=_0x3a55d9[_0x33a64b];}}return _0x1aba66;}exports[_0x7f5a('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 38529df..bf508b5 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 _0xb25b=['realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','queuecallerexit','queuecallerexitAt','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','lastapplication','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','ANSWERED','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','isNil','UserId','membername','create','monitor','monitors','monitorFilename','filename','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport'];(function(_0x2921fe,_0x3f8dbb){var _0x2c0a08=function(_0x31f8f9){while(--_0x31f8f9){_0x2921fe['push'](_0x2921fe['shift']());}};_0x2c0a08(++_0x3f8dbb);}(_0xb25b,0xa3));var _0xbb25=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb25b[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xbb25('0x0'));var moment=require(_0xbb25('0x1'));var util=require(_0xbb25('0x2'));var config=require(_0xbb25('0x3'));var ami=require(_0xbb25('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xbb25('0x5'));var RpcVoiceDialReport=require(_0xbb25('0x6'));var RpcMemberReport=require(_0xbb25('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xbb25('0x8'));var RpcVoiceTransferReport=require(_0xbb25('0x9'));var VoiceQueueReport=require(_0xbb25('0xa'));var VoiceCallReport=require(_0xbb25('0xb'));var VoiceAgentReport=require(_0xbb25('0xc'));var VoiceDialReport=require(_0xbb25('0xd'));var UserReport=require(_0xbb25('0xe'));function Report(_0x33b8c3){this[_0xbb25('0xf')]=_0x33b8c3;this[_0xbb25('0x10')]=_0x33b8c3[_0xbb25('0x10')];this[_0xbb25('0x11')]=_0x33b8c3['telephones'];}Report[_0xbb25('0x12')][_0xbb25('0x13')]=function(_0x1d9ca9){var _0x330834=new VoiceQueueReport(this[_0xbb25('0xf')]);var _0x89d475=new VoiceAgentReport(this['realtime']);var _0xd50867=new VoiceDialReport(this[_0xbb25('0xf')]);var _0x462d50=new VoiceCallReport(this[_0xbb25('0xf')]);var _0x41a0c3=new UserReport(this[_0xbb25('0xf')]);if(config['xdr']&&config[_0xbb25('0x14')][_0xbb25('0x15')]){ami['on'](_0xbb25('0x16'),this['voiceQueueReport'][_0xbb25('0x17')](this));ami['on'](_0xbb25('0x18'),this[_0xbb25('0x19')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0xbb25('0x1a')][_0xbb25('0x17')](this));ami['on']('custom:voiceDialReport',this[_0xbb25('0x1b')][_0xbb25('0x17')](this));ami['on'](_0xbb25('0x1c'),this[_0xbb25('0x1d')][_0xbb25('0x17')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0xbb25('0x17')](this));}};Report[_0xbb25('0x12')][_0xbb25('0x1e')]=function(_0x1c198b){var _0x9e8e63;_0x9e8e63=_[_0xbb25('0x1f')](this[_0xbb25('0x10')],function(_0x143dfa){return _0x143dfa[_0xbb25('0x20')]==_0x1c198b||_0x143dfa[_0xbb25('0x21')]==_0x1c198b;});if(_['isNil'](_0x9e8e63)){var _0x4699a8=_[_0xbb25('0x1f')](this[_0xbb25('0x11')],function(_0x1d5d24){return _0x1d5d24['accountcode']==_0x1c198b||_0x1d5d24[_0xbb25('0x21')]==_0x1c198b;});if(_0x4699a8){_0x9e8e63=_[_0xbb25('0x1f')](this[_0xbb25('0x10')],function(_0x290b6d){return _0x290b6d[_0xbb25('0x22')]==util[_0xbb25('0x23')](_0xbb25('0x24'),_0x4699a8[_0xbb25('0x21')]);});}}return _0x9e8e63;};Report[_0xbb25('0x12')][_0xbb25('0x25')]=function(_0x24a07d){for(var _0x159384=0x0;_0x159384<_0x24a07d[_0xbb25('0x26')];_0x159384+=0x1){var _0x5a9356=this[_0xbb25('0x1e')](_0x24a07d[_0x159384][_0xbb25('0x27')]);if(_0x5a9356){_0x24a07d[_0x159384]['accountcode']=_0x5a9356[_0xbb25('0x20')];_0x24a07d[_0x159384][_0xbb25('0x28')]=!![];_0x24a07d[_0x159384]['lastAssignedTo']=_0x5a9356['name'];_0x24a07d[_0x159384][_0xbb25('0x22')]=_['isNil'](_0x5a9356[_0xbb25('0x22')])?util[_0xbb25('0x23')]('SIP/%s',_0x5a9356[_0xbb25('0x21')]):_0x5a9356[_0xbb25('0x22')];if(_0x24a07d[_0x159384]['queuecallercomplete']){_0x24a07d[_0x159384]['queuecallercompleteAt']=moment()[_0xbb25('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x24a07d[_0x159384][_0xbb25('0x29')]){_0x24a07d[_0x159384][_0xbb25('0x2a')]=moment()[_0xbb25('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xbb25('0x25')](_0x24a07d[_0x159384]);}RpcVoiceQueueReport['create'](_0x24a07d[_0x159384]);}};function extractCalleridNumber(_0x1d17e4){var _0x3ff5eb=_0x1d17e4['match'](/<(.*?)>/);return _0x3ff5eb?_0x3ff5eb[0x1]:_0x1d17e4;}Report[_0xbb25('0x12')][_0xbb25('0x2b')]=function(_0x525a15){for(var _0x36a084=0x0;_0x36a084',_0x1ee3ad[_0xbb25('0x40')],_0x1ee3ad['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x1ee3ad[_0xbb25('0x41')]]){var _0x14c5b9=RpcVoiceTransferReport[_0xbb25('0x42')][_0x1ee3ad[_0xbb25('0x41')]];_0x14c5b9[_0xbb25('0x43')]=_0x1ee3ad[_0xbb25('0x44')];RpcVoiceTransferReport[_0xbb25('0x1d')](_0x14c5b9);delete RpcVoiceTransferReport[_0xbb25('0x42')][_0x1ee3ad[_0xbb25('0x41')]];}if(_['isNil'](_0x1ee3ad[_0xbb25('0x35')])){_0x1ee3ad[_0xbb25('0x35')]=this['getCallType'](_0x1ee3ad);}if(_[_0xbb25('0x45')](_0x1ee3ad[_0xbb25('0x46')])){var _0x1f1cfc=_0x1ee3ad[_0xbb25('0x2e')]['split']('-')[0x0];var _0x156f1b=this[_0xbb25('0x10')][_0x1f1cfc];if(!_0x156f1b)_0x156f1b=this[_0xbb25('0x2b')](_0x1ee3ad[_0xbb25('0x20')]);if(_0x156f1b){_0x1ee3ad[_0xbb25('0x46')]=_0x156f1b['id'];_0x1ee3ad[_0xbb25('0x47')]=_0x156f1b[_0xbb25('0x21')];}}RpcVoiceCallReport[_0xbb25('0x48')](_0x1ee3ad);if(_0x1ee3ad[_0xbb25('0x49')]){for(var _0x5148d0=0x0;_0x5148d0<_0x1ee3ad[_0xbb25('0x4a')][_0xbb25('0x26')];_0x5148d0+=0x1){_0x1ee3ad[_0xbb25('0x4b')]=_0x1ee3ad[_0xbb25('0x4a')][_0x5148d0][_0xbb25('0x4c')];_0x1ee3ad['createdAt']=_0x1ee3ad[_0xbb25('0x4a')][_0x5148d0]['createdAt'];if(_0x1ee3ad[_0xbb25('0x34')]==_0xbb25('0x3b')){_0x1ee3ad[_0xbb25('0x30')]=_0x1ee3ad['connectedlinenum'];_0x1ee3ad[_0xbb25('0x40')]=_0x1ee3ad[_0xbb25('0x4d')];_0x1ee3ad[_0xbb25('0x27')]=_0x1ee3ad[_0xbb25('0x20')];_0x1ee3ad[_0xbb25('0x4d')]=_0x1ee3ad[_0xbb25('0x47')];_0x1ee3ad[_0xbb25('0x34')]=_0x1ee3ad[_0xbb25('0x3d')];}else if(_0x1ee3ad[_0xbb25('0x34')]==_0xbb25('0x4e')){_0x1ee3ad['calleridnum']=_0x1ee3ad['destination'];_0x1ee3ad[_0xbb25('0x34')]=_0x1ee3ad[_0xbb25('0x3d')];}RpcVoiceRecording['create'](_0x1ee3ad);}}};Report['prototype'][_0xbb25('0x1a')]=function(_0x3798a6){if(_[_0xbb25('0x4f')](_0x3798a6)){_0x3798a6[_0xbb25('0x50')](function(_0x59a4c7){RpcVoiceAgentReport[_0xbb25('0x48')](_0x59a4c7);});}else{RpcVoiceAgentReport[_0xbb25('0x48')](_0x3798a6);}};Report[_0xbb25('0x12')][_0xbb25('0x1b')]=function(_0x50f7a2){RpcVoiceDialReport[_0xbb25('0x48')](_0x50f7a2);var _0x2efe8d;var _0x4ca7c9;var _0x1fa362=_0x50f7a2[_0xbb25('0x2e')];if(_[_0xbb25('0x51')](_0x1fa362,_0xbb25('0x52'))){_0x4ca7c9=_0x1fa362[_0xbb25('0x53')](_0x1fa362[_0xbb25('0x54')]('/')+0x1,_0x1fa362[_0xbb25('0x54')]('@'));_0x2efe8d=_[_0xbb25('0x1f')](this[_0xbb25('0x10')],function(_0x2f8e9a){return _0x2f8e9a[_0xbb25('0x55')]==_0x4ca7c9||_0x2f8e9a[_0xbb25('0x56')]==_0x4ca7c9||_0x2f8e9a[_0xbb25('0x20')]==_0x4ca7c9;});}else{_0x4ca7c9=_0x1fa362['substring'](_0x1fa362[_0xbb25('0x54')]('/')+0x1,_0x1fa362['lastIndexOf']('-'));_0x2efe8d=this[_0xbb25('0x1e')](_0x4ca7c9);}if(_0x2efe8d){_0x50f7a2['interface']=_[_0xbb25('0x45')](_0x2efe8d[_0xbb25('0x22')])?util[_0xbb25('0x23')]('SIP/%s',_0x2efe8d[_0xbb25('0x21')]):_0x2efe8d[_0xbb25('0x22')];_0x50f7a2[_0xbb25('0x47')]=_0x2efe8d[_0xbb25('0x21')];_0x50f7a2[_0xbb25('0x20')]=_0x2efe8d[_0xbb25('0x20')];RpcMemberReport['voiceDialReport'](_0x50f7a2);}};Report[_0xbb25('0x12')][_0xbb25('0x1d')]=function(_0x31bbf8){RpcVoiceTransferReport[_0xbb25('0x42')][_0x31bbf8[_0xbb25('0x57')]]=_0x31bbf8;};Report[_0xbb25('0x12')]['attendedTransfer']=function(_0x37d57f){RpcVoiceTransferReport['attendedTransfer'](_0x37d57f);};module[_0xbb25('0x58')]=Report; \ No newline at end of file +var _0x401c=['isArray','forEach','voiceDialReport','Local','indexOf','mobile','substring','lodash','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','name','isNil','find','interface','format','SIP/%s','voiceQueueReport','connectedlinenum','accountcode','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','getAgentByInternal','length','getCallType','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','lastdata','queue','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','destinationchannel','disposition','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitorFilename','monitors','createdAt','xcally-motion-dialer','exten','create'];(function(_0x4c5202,_0x36a2e8){var _0x43a3ce=function(_0x1c90f5){while(--_0x1c90f5){_0x4c5202['push'](_0x4c5202['shift']());}};_0x43a3ce(++_0x36a2e8);}(_0x401c,0x1ba));var _0xc401=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0x401c[_0x22868f];return _0x97bc75;};'use strict';var _=require(_0xc401('0x0'));var moment=require('moment');var util=require(_0xc401('0x1'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xc401('0x2'));var RpcVoiceCallReport=require(_0xc401('0x3'));var RpcVoiceDialReport=require(_0xc401('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xc401('0x5'));var RpcVoiceTransferReport=require(_0xc401('0x6'));var VoiceQueueReport=require(_0xc401('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xc401('0x8'));var VoiceDialReport=require(_0xc401('0x9'));var UserReport=require(_0xc401('0xa'));function Report(_0x488753){this[_0xc401('0xb')]=_0x488753;this['agents']=_0x488753[_0xc401('0xc')];this[_0xc401('0xd')]=_0x488753['telephones'];}Report[_0xc401('0xe')][_0xc401('0xf')]=function(_0x24ab4e){var _0x1599d3=new VoiceQueueReport(this[_0xc401('0xb')]);var _0x5c6367=new VoiceAgentReport(this['realtime']);var _0x3cbb8a=new VoiceDialReport(this[_0xc401('0xb')]);var _0x49271f=new VoiceCallReport(this[_0xc401('0xb')]);var _0x4dff3a=new UserReport(this[_0xc401('0xb')]);if(config[_0xc401('0x10')]&&config[_0xc401('0x10')][_0xc401('0x11')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0xc401('0x12')](this));ami['on'](_0xc401('0x13'),this[_0xc401('0x14')][_0xc401('0x12')](this));ami['on'](_0xc401('0x15'),this[_0xc401('0x16')][_0xc401('0x12')](this));ami['on'](_0xc401('0x17'),this['voiceDialReport'][_0xc401('0x12')](this));ami['on'](_0xc401('0x18'),this[_0xc401('0x19')][_0xc401('0x12')](this));ami['on'](_0xc401('0x1a'),this[_0xc401('0x1b')]['bind'](this));}};Report[_0xc401('0xe')][_0xc401('0x1c')]=function(_0x2b4b03){var _0x58feab;_0x58feab=_['find'](this['agents'],function(_0x405c81){return _0x405c81['accountcode']==_0x2b4b03||_0x405c81[_0xc401('0x1d')]==_0x2b4b03;});if(_[_0xc401('0x1e')](_0x58feab)){var _0x101430=_[_0xc401('0x1f')](this[_0xc401('0xd')],function(_0xa380b0){return _0xa380b0['accountcode']==_0x2b4b03||_0xa380b0['name']==_0x2b4b03;});if(_0x101430){_0x58feab=_[_0xc401('0x1f')](this[_0xc401('0xc')],function(_0x2a795d){return _0x2a795d[_0xc401('0x20')]==util[_0xc401('0x21')](_0xc401('0x22'),_0x101430[_0xc401('0x1d')]);});}}return _0x58feab;};Report[_0xc401('0xe')][_0xc401('0x23')]=function(_0x2b6f86){for(var _0x689022=0x0;_0x689022<_0x2b6f86['length'];_0x689022+=0x1){var _0x5cf0ed=this[_0xc401('0x1c')](_0x2b6f86[_0x689022][_0xc401('0x24')]);if(_0x5cf0ed){_0x2b6f86[_0x689022][_0xc401('0x25')]=_0x5cf0ed[_0xc401('0x25')];_0x2b6f86[_0x689022]['assigned']=!![];_0x2b6f86[_0x689022][_0xc401('0x26')]=_0x5cf0ed[_0xc401('0x1d')];_0x2b6f86[_0x689022][_0xc401('0x20')]=_[_0xc401('0x1e')](_0x5cf0ed[_0xc401('0x20')])?util[_0xc401('0x21')](_0xc401('0x22'),_0x5cf0ed[_0xc401('0x1d')]):_0x5cf0ed[_0xc401('0x20')];if(_0x2b6f86[_0x689022]['queuecallercomplete']){_0x2b6f86[_0x689022][_0xc401('0x27')]=moment()[_0xc401('0x21')](_0xc401('0x28'));}if(_0x2b6f86[_0x689022][_0xc401('0x29')]){_0x2b6f86[_0x689022][_0xc401('0x2a')]=moment()['format'](_0xc401('0x28'));}RpcMemberReport[_0xc401('0x23')](_0x2b6f86[_0x689022]);}RpcVoiceQueueReport['create'](_0x2b6f86[_0x689022]);}};function extractCalleridNumber(_0x4c58af){var _0x4be939=_0x4c58af['match'](/<(.*?)>/);return _0x4be939?_0x4be939[0x1]:_0x4c58af;}Report[_0xc401('0xe')][_0xc401('0x2b')]=function(_0x2eaae2){for(var _0x6cceff=0x0;_0x6cceff0x0?!![]:![];if(!_0x54654f){return this[_0x66ed('0x17')](this[_0x66ed('0x12')][_0x66ed('0x71')]);}};VoiceQueueReport['prototype'][_0x66ed('0x18')]=function(_0x8cf3ae){var _0x4302c0=this[_0x66ed('0x12')]['id'];if(this[_0x66ed('0x12')][_0x66ed('0x64')][_0x4302c0]&&this['summary'][_0x66ed('0x64')][_0x4302c0][_0x8cf3ae[_0x66ed('0x6d')]]){this[_0x66ed('0x12')][_0x66ed('0x64')][_0x4302c0][_0x8cf3ae['actionid']][_0x66ed('0xd')]['push'](_0x8cf3ae);}};VoiceQueueReport['prototype'][_0x66ed('0x15')]=function(_0x4a686c){var _0x10627f=this;try{if(this[_0x66ed('0x5f')](_0x4a686c)&&this[_0x66ed('0x5f')](_0x4a686c['queue'])){logger[_0x66ed('0x55')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x66ed('0x47')](_0x4a686c,{'showHidden':![],'depth':null}));var _0x1163d4=this[_0x66ed('0x10')][_0x4a686c[_0x66ed('0x52')]];if(_0x1163d4){logger[_0x66ed('0x55')](_0x66ed('0x72'),_0x1163d4[_0x66ed('0x5d')]);this[_0x66ed('0x12')][_0x66ed('0x60')][_0x1163d4['name']]={'summaryEvent':_0x4a686c};this['summary'][_0x66ed('0x70')]+=0x1;return ami['Action']({'action':_0x66ed('0x64'),'queue':_0x1163d4[_0x66ed('0x5d')]})[_0x66ed('0x63')](function(_0x405bd9){if(!_0x10627f['summary'][_0x66ed('0x64')][_0x4a686c[_0x66ed('0x6d')]]){_0x10627f[_0x66ed('0x12')][_0x66ed('0x64')][_0x4a686c[_0x66ed('0x6d')]]={};}_0x10627f[_0x66ed('0x12')][_0x66ed('0x64')][_0x4a686c[_0x66ed('0x6d')]][_0x405bd9['actionid']]={'queue':_0x1163d4[_0x66ed('0x5d')],'agents':[]};})[_0x66ed('0x40')](function(_0x4f36f1){throw _0x4f36f1;});}}}catch(_0x3a04b5){logger['error']('[voiceQueueReport][queuesummary]',util['inspect'](_0x3a04b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x66ed('0x17')]=function(_0x473b0d){if(this[_0x66ed('0x12')][_0x66ed('0x70')]>0x0){this[_0x66ed('0x12')][_0x66ed('0x71')]=_0x473b0d;return;}logger[_0x66ed('0x55')](_0x66ed('0x73'),util[_0x66ed('0x47')](_0x473b0d,{'showHidden':![],'depth':null}));this[_0x66ed('0x12')]=initializeSummary();ami[_0x66ed('0x4d')]('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x278cf0){try{if(this[_0x66ed('0x5f')](_0x278cf0)){logger[_0x66ed('0x55')]('[%s][voiceQueueReport][queuecallerjoin]',_0x278cf0[_0x66ed('0x50')],util['inspect'](_0x278cf0,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x66ed('0x44')][_0x278cf0[_0x66ed('0x50')]])){this[_0x66ed('0x44')][_0x278cf0[_0x66ed('0x50')]]=[];}if(_['isUndefined'](this[_0x66ed('0xe')][_0x278cf0[_0x66ed('0x50')]])){this[_0x66ed('0xe')][_0x278cf0[_0x66ed('0x50')]]={};}var _0x344ba3=new QueueReport();_0x344ba3['queue']=_0x278cf0['queue'];_0x344ba3[_0x66ed('0x5a')]=this[_0x66ed('0x10')][_0x344ba3[_0x66ed('0x52')]]&&this[_0x66ed('0x10')][_0x344ba3[_0x66ed('0x52')]][_0x66ed('0x5a')]?this[_0x66ed('0x10')][_0x344ba3[_0x66ed('0x52')]]['type']||_0x66ed('0x5b'):'inbound';_0x344ba3['queuecallerjoinAt']=moment()[_0x66ed('0x51')](_0x66ed('0x74'));_0x344ba3[_0x66ed('0x75')]=_0x278cf0[_0x66ed('0x75')];_0x344ba3[_0x66ed('0x76')]=_0x278cf0[_0x66ed('0x76')];_0x344ba3['uniqueid']=_0x278cf0[_0x66ed('0x50')];_0x344ba3['routealias']=this[_0x66ed('0xe')][_0x278cf0[_0x66ed('0x50')]][_0x66ed('0x77')];logger[_0x66ed('0x78')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x344ba3[_0x66ed('0x52')],_0x344ba3[_0x66ed('0x5a')]);Object[_0x66ed('0x6b')](_0x344ba3,_[_0x66ed('0x79')](_0x278cf0,_[_0x66ed('0x7a')](_0x344ba3)));this[_0x66ed('0x44')][_0x278cf0['uniqueid']][_0x66ed('0x7b')](_0x344ba3);this[_0x66ed('0xe')][_0x278cf0['uniqueid']]=_0x344ba3;this[_0x66ed('0x7c')](_0x344ba3,'queuecallerjoin');}}catch(_0xb5c566){logger['error'](_0x66ed('0x7d'),_0x278cf0['uniqueid'],util[_0x66ed('0x47')](_0xb5c566,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66ed('0x7')][_0x66ed('0x7e')]=function(_0xd5232a){try{if(this[_0x66ed('0x5f')](_0xd5232a)){logger[_0x66ed('0x55')](_0x66ed('0x7f'),_0xd5232a[_0x66ed('0x50')],util['inspect'](_0xd5232a,{'showHidden':![],'depth':null}));if(this[_0x66ed('0x44')][_0xd5232a['uniqueid']]){var _0x5ed6b7=_[_0x66ed('0x80')](this['queueReports'][_0xd5232a[_0x66ed('0x50')]]);_0x5ed6b7['queuecallercomplete']=![];_0x5ed6b7[_0x66ed('0x81')]=null;_0x5ed6b7[_0x66ed('0x82')]=_0xd5232a[_0x66ed('0x82')];_0x5ed6b7['originalposition']=_0xd5232a[_0x66ed('0x83')];_0x5ed6b7['queuecallerabandon']=!![];_0x5ed6b7['queuecallerabandonAt']=moment()[_0x66ed('0x51')](_0x66ed('0x74'));_0x5ed6b7[_0x66ed('0x57')]=_0x66ed('0x84');_0x5ed6b7[_0x66ed('0x85')]=null;logger['info'](_0x66ed('0x86'),_0x5ed6b7[_0x66ed('0x52')],_0x5ed6b7[_0x66ed('0x5a')]);this[_0x66ed('0xe')][_0xd5232a[_0x66ed('0x50')]]=_0x5ed6b7;this[_0x66ed('0x4b')](_0x5ed6b7,'queuecallerabandon');}}}catch(_0x21c9b6){logger['error'](_0x66ed('0x7f'),_0xd5232a[_0x66ed('0x50')],util[_0x66ed('0x47')](_0x21c9b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66ed('0x7')][_0x66ed('0x1e')]=function(_0x2d8581){try{if(this['isNotNull'](_0x2d8581)){logger[_0x66ed('0x55')](_0x66ed('0x87'),_0x2d8581[_0x66ed('0x50')],util[_0x66ed('0x47')](_0x2d8581,{'showHidden':![],'depth':null}));if(this[_0x66ed('0x44')][_0x2d8581[_0x66ed('0x50')]]){var _0x5ad69b=_[_0x66ed('0x80')](this[_0x66ed('0x44')][_0x2d8581['uniqueid']]);_0x5ad69b[_0x66ed('0x88')]=moment()[_0x66ed('0x51')](_0x66ed('0x74'));_0x5ad69b['connectedlinenum']=_0x2d8581[_0x66ed('0x89')];_0x5ad69b[_0x66ed('0x8a')]=_0x2d8581[_0x66ed('0x8a')];logger[_0x66ed('0x78')](_0x66ed('0x8b'),_0x5ad69b[_0x66ed('0x52')],_0x5ad69b[_0x66ed('0x5a')],_0x2d8581['connectedlinenum'],_0x2d8581[_0x66ed('0x8a')]);this[_0x66ed('0xe')][_0x2d8581[_0x66ed('0x50')]]=_0x5ad69b;this[_0x66ed('0x7c')](_0x5ad69b,_0x66ed('0x8c'));}}}catch(_0x1ce380){logger[_0x66ed('0x45')](_0x66ed('0x87'),_0x2d8581[_0x66ed('0x50')],util[_0x66ed('0x47')](_0x1ce380,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66ed('0x7')][_0x66ed('0x22')]=function(_0x1bf430){try{if(this[_0x66ed('0x5f')](_0x1bf430)){logger[_0x66ed('0x55')](_0x66ed('0x8d'),_0x1bf430[_0x66ed('0x50')],util['inspect'](_0x1bf430,{'showHidden':![],'depth':null}));if(this[_0x66ed('0x44')][_0x1bf430[_0x66ed('0x50')]]){var _0x482efc=_[_0x66ed('0x80')](this['queueReports'][_0x1bf430['uniqueid']]);_0x482efc[_0x66ed('0x8e')]=!![];_0x482efc['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x66ed('0x78')](_0x66ed('0x8f'),_0x482efc[_0x66ed('0x52')],_0x482efc[_0x66ed('0x5a')]);}}}catch(_0x34ef3b){logger['error'](_0x66ed('0x8d'),_0x1bf430[_0x66ed('0x50')],util['inspect'](_0x34ef3b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66ed('0x7')]['syncAgentComplete']=function(_0x5547c7){try{if(this[_0x66ed('0x5f')](_0x5547c7)){logger[_0x66ed('0x55')]('[%s][voiceQueueReport][agentcomplete]',_0x5547c7[_0x66ed('0x50')],util[_0x66ed('0x47')](_0x5547c7,{'showHidden':![],'depth':null}));if(this[_0x66ed('0x44')][_0x5547c7['uniqueid']]){var _0x34e6ca=_['last'](this[_0x66ed('0x44')][_0x5547c7[_0x66ed('0x50')]]);_0x34e6ca[_0x66ed('0x1d')]=![];_0x34e6ca[_0x66ed('0x90')]=null;_0x34e6ca[_0x66ed('0x91')]=!![];_0x34e6ca[_0x66ed('0x85')]=_0x5547c7[_0x66ed('0x92')];_0x34e6ca[_0x66ed('0x82')]=_0x5547c7[_0x66ed('0x82')];_0x34e6ca[_0x66ed('0x8e')]=!![];_0x34e6ca[_0x66ed('0x39')]=![];_0x34e6ca[_0x66ed('0x93')]=null;if(!_0x34e6ca[_0x66ed('0x94')]){if(_0x5547c7['reason']=='transfer'){_0x34e6ca[_0x66ed('0x57')]=_0x66ed('0x95');logger['info'](_0x66ed('0x96'),_0x34e6ca[_0x66ed('0x52')],_0x34e6ca['type']);}else{if(_[_0x66ed('0x97')](_0x5547c7[_0x66ed('0x3f')][_0x66ed('0x98')](),_0x66ed('0x99'))){if(this[_0x66ed('0x44')][_0x5547c7['linkedid']]){var _0x51eebe=_[_0x66ed('0x80')](this['queueReports'][_0x5547c7[_0x66ed('0x9a')]]);_0x51eebe['queuecallercomplete']=![];_0x51eebe['queuecallerexit']=!![];_0x51eebe['queuecallerexitAt']=moment(_0x34e6ca[_0x66ed('0x9b')])[_0x66ed('0x9c')](_0x5547c7['holdtime'],_0x66ed('0x9d'))['format'](_0x66ed('0x74'));_0x51eebe[_0x66ed('0x57')]=_0x66ed('0x9e');_0x51eebe[_0x66ed('0x94')]=!![];_0x51eebe[_0x66ed('0x9f')]=_0x66ed('0xa0');_0x51eebe[_0x66ed('0xa1')]=_0x5547c7[_0x66ed('0xa2')];_0x51eebe[_0x66ed('0xa3')]=_0x5547c7[_0x66ed('0x50')];logger[_0x66ed('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x51eebe[_0x66ed('0x52')],_0x51eebe[_0x66ed('0x5a')]);var _0x2d4465=this[_0x66ed('0x44')][_0x5547c7[_0x66ed('0x9a')]];this[_0x66ed('0x44')][_0x5547c7[_0x66ed('0x9a')]]=this[_0x66ed('0x44')][_0x5547c7[_0x66ed('0x50')]];this[_0x66ed('0x44')][_0x5547c7[_0x66ed('0x50')]]=_0x2d4465;}}else{_0x34e6ca[_0x66ed('0x57')]=_0x66ed('0xa4')+_0x5547c7[_0x66ed('0xa5')]['toUpperCase']();logger[_0x66ed('0x78')](_0x66ed('0xa6'),_0x34e6ca[_0x66ed('0x52')],_0x34e6ca[_0x66ed('0x5a')],_0x34e6ca[_0x66ed('0x57')]);}}}this[_0x66ed('0xe')][_0x5547c7[_0x66ed('0x50')]]=_0x34e6ca;}}}catch(_0x26de08){logger[_0x66ed('0x45')](_0x66ed('0xa7'),_0x5547c7['uniqueid'],util[_0x66ed('0x47')](_0x26de08,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66ed('0x7')][_0x66ed('0x24')]=function(_0x49b900){try{if(this[_0x66ed('0x5f')](_0x49b900)){logger[_0x66ed('0x55')]('[%s][voiceQueueReport][varset]',_0x49b900['uniqueid'],util[_0x66ed('0x47')](_0x49b900,{'showHidden':![],'depth':null}));this[_0x66ed('0xa8')](_0x49b900[_0x66ed('0x50')],_[_0x66ed('0x7a')](_0x49b900[_0x66ed('0xa9')])[0x0],_0x49b900[_0x66ed('0xaa')]);if(this[_0x66ed('0x44')][_0x49b900['uniqueid']]){var _0x50ef93=_[_0x66ed('0x80')](this[_0x66ed('0x44')][_0x49b900['uniqueid']]);if(_0x50ef93){if(this[_0x66ed('0x5f')](_0x49b900[_0x66ed('0xa9')])&&this[_0x66ed('0x5f')](_0x49b900[_0x66ed('0xa9')][_0x66ed('0x64')])){switch(_0x49b900[_0x66ed('0xaa')]){case _0x66ed('0xab'):_0x50ef93['queuecallerexit']=![];_0x50ef93[_0x66ed('0x93')]=null;break;case _0x66ed('0xac'):_0x50ef93[_0x66ed('0xad')]=_0x66ed('0xae');_0x50ef93[_0x66ed('0x39')]=!![];_0x50ef93[_0x66ed('0x93')]=moment()[_0x66ed('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x50ef93[_0x66ed('0x88')]=moment()[_0x66ed('0x51')](_0x66ed('0x74'));logger['debug'](_0x66ed('0xaf'),_0x49b900['uniqueid'],util['inspect'](_0x50ef93,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x50ef93);break;default:_0x50ef93[_0x66ed('0x39')]=!![];_0x50ef93['queuecallerexitAt']=moment()['format'](_0x66ed('0x74'));_0x50ef93['queuecallerleaveAt']=moment()['format'](_0x66ed('0x74'));}_0x50ef93[_0x66ed('0x1d')]=![];_0x50ef93[_0x66ed('0x90')]=null;_0x50ef93[_0x66ed('0x57')]=_0x49b900[_0x66ed('0xaa')];this[_0x66ed('0xe')][_0x49b900[_0x66ed('0x50')]]=_0x50ef93;this[_0x66ed('0x4b')](_0x50ef93,_0x66ed('0x23'));}else if(this['isNotNull'](_0x49b900[_0x66ed('0xa9')])&&this['isNotNull'](_0x49b900[_0x66ed('0xa9')][_0x66ed('0xb0')])){if(!_0x50ef93[_0x66ed('0x1d')]){_0x50ef93[_0x66ed('0x39')]=!![];_0x50ef93[_0x66ed('0x93')]=moment()[_0x66ed('0x51')](_0x66ed('0x74'));_0x50ef93[_0x66ed('0x57')]=_0x66ed('0xb1');_0x50ef93['queuecallerleaveAt']=moment()[_0x66ed('0x51')](_0x66ed('0x74'));this[_0x66ed('0xe')][_0x49b900[_0x66ed('0x50')]]=_0x50ef93;}}logger[_0x66ed('0x78')](_0x66ed('0xb2'),_0x49b900[_0x66ed('0x50')],_0x50ef93[_0x66ed('0x52')],_0x50ef93['type'],_[_0x66ed('0x7a')](_0x49b900[_0x66ed('0xa9')])[0x0],_0x49b900[_0x66ed('0xaa')]);_0x50ef93['variables']=this[_0x66ed('0x13')][_0x49b900[_0x66ed('0x50')]];}}}}catch(_0x3c2e76){logger[_0x66ed('0x45')](_0x66ed('0xb3'),_0x49b900[_0x66ed('0x50')],util[_0x66ed('0x47')](_0x3c2e76,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x66ed('0x7')][_0x66ed('0xa8')]=function(_0x99d81,_0x527b2d,_0x5164b6){var _0x5eccfc=['rtpaudioqos',_0x66ed('0xb4'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x66ed('0xb5'),_0x66ed('0xb6'),'rtpaudioqosrtt',_0x66ed('0xb7'),_0x66ed('0xb8'),_0x66ed('0xb9'),_0x66ed('0xba'),_0x66ed('0xbb'),_0x66ed('0xbc'),'memberdynamic',_0x66ed('0xbd'),_0x66ed('0xbe'),_0x66ed('0x92'),'memberpenalty',_0x66ed('0xbf')];if(!_['isNil'](_0x527b2d)&&!_[_0x66ed('0xc0')](_0x5eccfc,_0x527b2d)){if(_[_0x66ed('0xc1')](this[_0x66ed('0x13')][_0x99d81])){this[_0x66ed('0x13')][_0x99d81]={};}this[_0x66ed('0x13')][_0x99d81][_0x527b2d]=_0x5164b6;}};VoiceQueueReport[_0x66ed('0x7')][_0x66ed('0xc2')]=function(_0x2d009a,_0x2c3aa9,_0x4db030){try{var _0x586168={};if(this[_0x66ed('0x44')][_0x2d009a]){for(var _0x2db961=0x0;_0x2db9610x0?!![]:![];if(!_0x31ec4b){return this[_0xe84d('0x1b')](this[_0xe84d('0x15')]['completeEvent']);}};VoiceQueueReport[_0xe84d('0xd')][_0xe84d('0x1d')]=function(_0xa87b1f){var _0x116e09=this['summary']['id'];if(this[_0xe84d('0x15')][_0xe84d('0x67')][_0x116e09]&&this['summary'][_0xe84d('0x67')][_0x116e09][_0xa87b1f['actionid']]){this[_0xe84d('0x15')][_0xe84d('0x67')][_0x116e09][_0xa87b1f[_0xe84d('0x60')]][_0xe84d('0x11')][_0xe84d('0x6a')](_0xa87b1f);}};VoiceQueueReport[_0xe84d('0xd')][_0xe84d('0x18')]=function(_0x34fe5f){var _0x30f0db=this;try{if(this[_0xe84d('0x5d')](_0x34fe5f)&&this[_0xe84d('0x5d')](_0x34fe5f[_0xe84d('0x51')])){logger[_0xe84d('0x4b')](_0xe84d('0x6b'),util[_0xe84d('0x42')](_0x34fe5f,{'showHidden':![],'depth':null}));var _0x41b095=this[_0xe84d('0x13')][_0x34fe5f[_0xe84d('0x51')]];if(_0x41b095){logger['debug'](_0xe84d('0x6c'),_0x41b095['name']);this[_0xe84d('0x15')][_0xe84d('0x63')][_0x41b095[_0xe84d('0x5b')]]={'summaryEvent':_0x34fe5f};this[_0xe84d('0x15')]['statusRequests']+=0x1;return ami[_0xe84d('0x3d')]({'action':_0xe84d('0x67'),'queue':_0x41b095['name']})[_0xe84d('0x6d')](function(_0x5c2e2b){if(!_0x30f0db[_0xe84d('0x15')][_0xe84d('0x67')][_0x34fe5f[_0xe84d('0x60')]]){_0x30f0db[_0xe84d('0x15')]['queuestatus'][_0x34fe5f['actionid']]={};}_0x30f0db[_0xe84d('0x15')]['queuestatus'][_0x34fe5f['actionid']][_0x5c2e2b['actionid']]={'queue':_0x41b095[_0xe84d('0x5b')],'agents':[]};})[_0xe84d('0x3e')](function(_0x40046c){throw _0x40046c;});}}}catch(_0x1e450a){logger[_0xe84d('0x40')](_0xe84d('0x61'),util[_0xe84d('0x42')](_0x1e450a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe84d('0xd')]['syncQueueSummaryComplete']=function(_0x70b250){if(this[_0xe84d('0x15')][_0xe84d('0x69')]>0x0){this['summary'][_0xe84d('0x6e')]=_0x70b250;return;}logger[_0xe84d('0x4b')](_0xe84d('0x6f'),util['inspect'](_0x70b250,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami['emit'](_0xe84d('0x70'),{});};VoiceQueueReport[_0xe84d('0xd')]['syncQueueCallerJoin']=function(_0x5d0c3c){try{if(this[_0xe84d('0x5d')](_0x5d0c3c)){logger[_0xe84d('0x4b')](_0xe84d('0x71'),_0x5d0c3c[_0xe84d('0x4e')],util[_0xe84d('0x42')](_0x5d0c3c,{'showHidden':![],'depth':null}));if(_[_0xe84d('0x5e')](this[_0xe84d('0x10')][_0x5d0c3c[_0xe84d('0x4e')]])){this[_0xe84d('0x10')][_0x5d0c3c[_0xe84d('0x4e')]]=[];}if(_['isUndefined'](this['channels'][_0x5d0c3c[_0xe84d('0x4e')]])){this[_0xe84d('0x12')][_0x5d0c3c[_0xe84d('0x4e')]]={};}var _0x4d46db=new QueueReport();_0x4d46db['queue']=_0x5d0c3c[_0xe84d('0x51')];_0x4d46db[_0xe84d('0x58')]=this[_0xe84d('0x13')][_0x4d46db[_0xe84d('0x51')]]&&this[_0xe84d('0x13')][_0x4d46db['queue']][_0xe84d('0x58')]?this[_0xe84d('0x13')][_0x4d46db['queue']][_0xe84d('0x58')]||_0xe84d('0x59'):'inbound';_0x4d46db[_0xe84d('0x72')]=moment()[_0xe84d('0x4f')](_0xe84d('0x73'));_0x4d46db['position']=_0x5d0c3c[_0xe84d('0x74')];_0x4d46db['count']=_0x5d0c3c[_0xe84d('0x75')];_0x4d46db[_0xe84d('0x4e')]=_0x5d0c3c['uniqueid'];_0x4d46db['routealias']=this[_0xe84d('0x12')][_0x5d0c3c[_0xe84d('0x4e')]][_0xe84d('0x76')];logger[_0xe84d('0x77')](_0xe84d('0x78'),_0x4d46db[_0xe84d('0x51')],_0x4d46db[_0xe84d('0x58')]);Object[_0xe84d('0x79')](_0x4d46db,_[_0xe84d('0x7a')](_0x5d0c3c,_[_0xe84d('0x7b')](_0x4d46db)));this[_0xe84d('0x10')][_0x5d0c3c[_0xe84d('0x4e')]][_0xe84d('0x6a')](_0x4d46db);this[_0xe84d('0x12')][_0x5d0c3c[_0xe84d('0x4e')]]=_0x4d46db;this[_0xe84d('0x4a')](_0x4d46db,'queuecallerjoin');}}catch(_0x4736ef){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x5d0c3c[_0xe84d('0x4e')],util[_0xe84d('0x42')](_0x4736ef,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe84d('0x22')]=function(_0x390b50){try{if(this[_0xe84d('0x5d')](_0x390b50)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x390b50[_0xe84d('0x4e')],util[_0xe84d('0x42')](_0x390b50,{'showHidden':![],'depth':null}));if(this[_0xe84d('0x10')][_0x390b50['uniqueid']]){var _0x5379cd=_['last'](this[_0xe84d('0x10')][_0x390b50[_0xe84d('0x4e')]]);_0x5379cd['queuecallercomplete']=![];_0x5379cd[_0xe84d('0x7c')]=null;_0x5379cd[_0xe84d('0x7d')]=_0x390b50[_0xe84d('0x7d')];_0x5379cd['originalposition']=_0x390b50[_0xe84d('0x7e')];_0x5379cd[_0xe84d('0x21')]=!![];_0x5379cd[_0xe84d('0x7f')]=moment()[_0xe84d('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5379cd[_0xe84d('0x54')]='ABANDONED';_0x5379cd[_0xe84d('0x80')]=null;logger[_0xe84d('0x77')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5379cd['queue'],_0x5379cd[_0xe84d('0x58')]);this[_0xe84d('0x12')][_0x390b50['uniqueid']]=_0x5379cd;this[_0xe84d('0x47')](_0x5379cd,_0xe84d('0x21'));}}}catch(_0x5062ea){logger['error'](_0xe84d('0x81'),_0x390b50[_0xe84d('0x4e')],util[_0xe84d('0x42')](_0x5062ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe84d('0xd')][_0xe84d('0x82')]=function(_0x4859a3){try{if(this[_0xe84d('0x5d')](_0x4859a3)){logger[_0xe84d('0x4b')](_0xe84d('0x83'),_0x4859a3[_0xe84d('0x4e')],util['inspect'](_0x4859a3,{'showHidden':![],'depth':null}));if(this[_0xe84d('0x10')][_0x4859a3['uniqueid']]){var _0x30fdcb=_['last'](this[_0xe84d('0x10')][_0x4859a3[_0xe84d('0x4e')]]);_0x30fdcb['queuecallerleaveAt']=moment()[_0xe84d('0x4f')](_0xe84d('0x73'));_0x30fdcb[_0xe84d('0x84')]=_0x4859a3['connectedlinenum'];_0x30fdcb[_0xe84d('0x85')]=_0x4859a3['connectedlinename'];logger[_0xe84d('0x77')](_0xe84d('0x86'),_0x30fdcb[_0xe84d('0x51')],_0x30fdcb[_0xe84d('0x58')],_0x4859a3[_0xe84d('0x84')],_0x4859a3[_0xe84d('0x85')]);this[_0xe84d('0x12')][_0x4859a3[_0xe84d('0x4e')]]=_0x30fdcb;this[_0xe84d('0x4a')](_0x30fdcb,_0xe84d('0x23'));}}}catch(_0x13707d){logger[_0xe84d('0x40')]('[%s][voiceQueueReport][queuecallerleave]',_0x4859a3[_0xe84d('0x4e')],util[_0xe84d('0x42')](_0x13707d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe84d('0xd')]['syncAgentConnect']=function(_0x320cf9){try{if(this[_0xe84d('0x5d')](_0x320cf9)){logger[_0xe84d('0x4b')](_0xe84d('0x87'),_0x320cf9[_0xe84d('0x4e')],util['inspect'](_0x320cf9,{'showHidden':![],'depth':null}));if(this[_0xe84d('0x10')][_0x320cf9[_0xe84d('0x4e')]]){var _0x539c24=_[_0xe84d('0x88')](this['queueReports'][_0x320cf9[_0xe84d('0x4e')]]);_0x539c24[_0xe84d('0x39')]=!![];_0x539c24[_0xe84d('0x54')]=_0xe84d('0x89');logger[_0xe84d('0x77')](_0xe84d('0x8a'),_0x539c24[_0xe84d('0x51')],_0x539c24[_0xe84d('0x58')]);}}}catch(_0x23cc9b){logger[_0xe84d('0x40')](_0xe84d('0x87'),_0x320cf9[_0xe84d('0x4e')],util[_0xe84d('0x42')](_0x23cc9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x17759f){try{if(this[_0xe84d('0x5d')](_0x17759f)){logger[_0xe84d('0x4b')]('[%s][voiceQueueReport][agentcomplete]',_0x17759f['uniqueid'],util['inspect'](_0x17759f,{'showHidden':![],'depth':null}));if(this[_0xe84d('0x10')][_0x17759f['uniqueid']]){var _0x1eff1e=_[_0xe84d('0x88')](this['queueReports'][_0x17759f[_0xe84d('0x4e')]]);_0x1eff1e[_0xe84d('0x21')]=![];_0x1eff1e[_0xe84d('0x7f')]=null;_0x1eff1e[_0xe84d('0x8b')]=!![];_0x1eff1e[_0xe84d('0x80')]=_0x17759f[_0xe84d('0x8c')];_0x1eff1e[_0xe84d('0x7d')]=_0x17759f[_0xe84d('0x7d')];_0x1eff1e[_0xe84d('0x39')]=!![];_0x1eff1e['queuecallerexit']=![];_0x1eff1e[_0xe84d('0x8d')]=null;if(!_0x1eff1e[_0xe84d('0x8e')]){if(_0x17759f[_0xe84d('0x8f')]==_0xe84d('0x8e')){_0x1eff1e[_0xe84d('0x54')]='COMPLETED';logger['info'](_0xe84d('0x90'),_0x1eff1e[_0xe84d('0x51')],_0x1eff1e[_0xe84d('0x58')]);}else{if(_[_0xe84d('0x91')](_0x17759f[_0xe84d('0x92')][_0xe84d('0x93')](),_0xe84d('0x94'))){if(this[_0xe84d('0x10')][_0x17759f['linkedid']]){var _0x160539=_[_0xe84d('0x88')](this[_0xe84d('0x10')][_0x17759f[_0xe84d('0x95')]]);_0x160539[_0xe84d('0x39')]=![];_0x160539['queuecallerexit']=!![];_0x160539[_0xe84d('0x8d')]=moment(_0x1eff1e[_0xe84d('0x72')])[_0xe84d('0x96')](_0x17759f['holdtime'],_0xe84d('0x97'))[_0xe84d('0x4f')](_0xe84d('0x73'));_0x160539[_0xe84d('0x54')]=_0xe84d('0x98');_0x160539['transfer']=!![];_0x160539[_0xe84d('0x99')]='FORWARD';_0x160539[_0xe84d('0x9a')]=_0x17759f['destexten'];_0x160539[_0xe84d('0x9b')]=_0x17759f['uniqueid'];logger[_0xe84d('0x77')](_0xe84d('0x9c'),_0x160539[_0xe84d('0x51')],_0x160539[_0xe84d('0x58')]);var _0x1989bd=this['queueReports'][_0x17759f[_0xe84d('0x95')]];this[_0xe84d('0x10')][_0x17759f['linkedid']]=this[_0xe84d('0x10')][_0x17759f[_0xe84d('0x4e')]];this[_0xe84d('0x10')][_0x17759f[_0xe84d('0x4e')]]=_0x1989bd;}}else{_0x1eff1e[_0xe84d('0x54')]='COMPLETEDBY'+_0x17759f[_0xe84d('0x8f')][_0xe84d('0x9d')]();logger[_0xe84d('0x77')](_0xe84d('0x9e'),_0x1eff1e[_0xe84d('0x51')],_0x1eff1e[_0xe84d('0x58')],_0x1eff1e[_0xe84d('0x54')]);}}}this['channels'][_0x17759f[_0xe84d('0x4e')]]=_0x1eff1e;}}}catch(_0x497595){logger[_0xe84d('0x40')](_0xe84d('0x9f'),_0x17759f['uniqueid'],util[_0xe84d('0x42')](_0x497595,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe84d('0xd')][_0xe84d('0xa0')]=function(_0x5ddca3){try{if(this[_0xe84d('0x5d')](_0x5ddca3)){logger[_0xe84d('0x4b')](_0xe84d('0xa1'),_0x5ddca3['uniqueid'],util[_0xe84d('0x42')](_0x5ddca3,{'showHidden':![],'depth':null}));this[_0xe84d('0xa2')](_0x5ddca3[_0xe84d('0x4e')],_[_0xe84d('0x7b')](_0x5ddca3[_0xe84d('0xa3')])[0x0],_0x5ddca3[_0xe84d('0xa4')]);if(this[_0xe84d('0x10')][_0x5ddca3[_0xe84d('0x4e')]]){var _0x4ef19a=_['last'](this[_0xe84d('0x10')][_0x5ddca3[_0xe84d('0x4e')]]);if(_0x4ef19a){if(this['isNotNull'](_0x5ddca3[_0xe84d('0xa3')])&&this['isNotNull'](_0x5ddca3[_0xe84d('0xa3')][_0xe84d('0x67')])){switch(_0x5ddca3[_0xe84d('0xa4')]){case'CONTINUE':_0x4ef19a[_0xe84d('0xa5')]=![];_0x4ef19a[_0xe84d('0x8d')]=null;break;case _0xe84d('0xa6'):_0x4ef19a['lastevent']=_0xe84d('0xa7');_0x4ef19a['queuecallerexit']=!![];_0x4ef19a['queuecallerexitAt']=moment()[_0xe84d('0x4f')](_0xe84d('0x73'));_0x4ef19a[_0xe84d('0xa8')]=moment()[_0xe84d('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xe84d('0x4b')](_0xe84d('0xa9'),_0x5ddca3['uniqueid'],util[_0xe84d('0x42')](_0x4ef19a,{'showHidden':![],'depth':null}));ami[_0xe84d('0x49')]('custom:timeout',_0x4ef19a);break;default:_0x4ef19a[_0xe84d('0xa5')]=!![];_0x4ef19a[_0xe84d('0x8d')]=moment()['format'](_0xe84d('0x73'));_0x4ef19a[_0xe84d('0xa8')]=moment()[_0xe84d('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ef19a[_0xe84d('0x21')]=![];_0x4ef19a[_0xe84d('0x7f')]=null;_0x4ef19a[_0xe84d('0x54')]=_0x5ddca3[_0xe84d('0xa4')];this['channels'][_0x5ddca3[_0xe84d('0x4e')]]=_0x4ef19a;this[_0xe84d('0x47')](_0x4ef19a,_0xe84d('0x28'));}else if(this[_0xe84d('0x5d')](_0x5ddca3[_0xe84d('0xa3')])&&this['isNotNull'](_0x5ddca3[_0xe84d('0xa3')][_0xe84d('0xaa')])){if(!_0x4ef19a[_0xe84d('0x21')]){_0x4ef19a[_0xe84d('0xa5')]=!![];_0x4ef19a[_0xe84d('0x8d')]=moment()[_0xe84d('0x4f')](_0xe84d('0x73'));_0x4ef19a[_0xe84d('0x54')]=_0xe84d('0xab');_0x4ef19a['queuecallerleaveAt']=moment()[_0xe84d('0x4f')](_0xe84d('0x73'));this['channels'][_0x5ddca3[_0xe84d('0x4e')]]=_0x4ef19a;}}logger[_0xe84d('0x77')](_0xe84d('0xac'),_0x5ddca3[_0xe84d('0x4e')],_0x4ef19a[_0xe84d('0x51')],_0x4ef19a[_0xe84d('0x58')],_[_0xe84d('0x7b')](_0x5ddca3[_0xe84d('0xa3')])[0x0],_0x5ddca3['value']);_0x4ef19a[_0xe84d('0x16')]=this['variables'][_0x5ddca3[_0xe84d('0x4e')]];}}}}catch(_0x631b7e){logger[_0xe84d('0x40')]('[%s][voiceQueueReport][varset]',_0x5ddca3[_0xe84d('0x4e')],util[_0xe84d('0x42')](_0x631b7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe84d('0xd')][_0xe84d('0xa2')]=function(_0x443e8b,_0x1cb724,_0x129b38){var _0x570a3c=[_0xe84d('0xad'),'rtpaudioqosbridged',_0xe84d('0xae'),_0xe84d('0xaf'),_0xe84d('0xb0'),_0xe84d('0xb1'),_0xe84d('0xb2'),_0xe84d('0xb3'),_0xe84d('0xb4'),_0xe84d('0xb5'),_0xe84d('0xb6'),_0xe84d('0xb7'),'membercalls',_0xe84d('0xb8'),_0xe84d('0xb9'),_0xe84d('0xba'),'membername',_0xe84d('0xbb'),_0xe84d('0xbc')];if(!_[_0xe84d('0x3c')](_0x1cb724)&&!_[_0xe84d('0xbd')](_0x570a3c,_0x1cb724)){if(_['isUndefined'](this[_0xe84d('0x16')][_0x443e8b])){this[_0xe84d('0x16')][_0x443e8b]={};}this['variables'][_0x443e8b][_0x1cb724]=_0x129b38;}};VoiceQueueReport[_0xe84d('0xd')]['handleHangup']=function(_0xba17c0,_0x20fa07,_0x263ec2){try{var _0x2a0b95={};if(this['queueReports'][_0xba17c0]){for(var _0x2edb7e=0x0;_0x2edb7e=0x0?moment(_0xa626c8[_0x7dba('0x17')])[_0x7dba('0x10')](_0xa626c8[_0x7dba('0x18')],_0x7dba('0x11')):null,'data1':_0x7dba('0x19'),'data2':_0xa626c8[_0x7dba('0x14')],'data3':_0xa626c8['exten'],'data4':_0xa626c8[_0x7dba('0x1a')]||null,'role':_0x7dba('0x13'),'internal':_0xa626c8[_0x7dba('0x14')]?_[_0x7dba('0x1b')](_0xa626c8['accountcode']):undefined,'uniqueid':_0xa626c8[_0x7dba('0x1c')]},'log':_0x7dba('0x8')});}; \ No newline at end of file +var _0x68de=['SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','accountcode','CreateMemberReport','voiceDialReport','membername','endtime','diff','starttime','outbound','dialstring','agent','uniqueid','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x68de,0x17b));var _0xe68d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x68de[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0xe68d('0x0'));var _=require('lodash');var util=require(_0xe68d('0x1'));var client=require(_0xe68d('0x2'));exports[_0xe68d('0x3')]=function(_0x2d1cc6){var _0x2f99e7=_0x2d1cc6[_0xe68d('0x4')]||_0x2d1cc6[_0xe68d('0x5')];return client[_0xe68d('0x6')]('CreateMemberReport',{'body':{'channel':_0xe68d('0x7'),'membername':_0x2d1cc6[_0xe68d('0x8')],'interface':_[_0xe68d('0x9')](_0x2d1cc6[_0xe68d('0xa')])?util['format'](_0xe68d('0xb'),_0x2d1cc6[_0xe68d('0x8')]):_0x2d1cc6['interface'],'type':_0xe68d('0xc'),'enterAt':_0x2d1cc6[_0xe68d('0xd')],'exitAt':_0x2f99e7,'duration':moment(_0x2f99e7)['diff'](_0x2d1cc6[_0xe68d('0xd')],_0xe68d('0xe')),'data1':_0xe68d('0xf'),'data2':_0x2d1cc6[_0xe68d('0x10')],'data3':_0x2d1cc6[_0xe68d('0x11')],'data4':null,'data5':_0x2d1cc6[_0xe68d('0x12')],'role':'agent','internal':_0x2d1cc6[_0xe68d('0x13')]?_['toNumber'](_0x2d1cc6['accountcode']):undefined,'uniqueid':_0x2d1cc6['uniqueid']},'log':_0xe68d('0x14')});};exports[_0xe68d('0x15')]=function(_0x4fe5f5){return client[_0xe68d('0x6')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x4fe5f5[_0xe68d('0x16')],'interface':_0x4fe5f5[_0xe68d('0xa')],'type':_0xe68d('0xc'),'enterAt':_0x4fe5f5['starttime'],'exitAt':_0x4fe5f5[_0xe68d('0x17')],'duration':moment(_0x4fe5f5[_0xe68d('0x17')])[_0xe68d('0x18')](_0x4fe5f5[_0xe68d('0x19')],_0xe68d('0xe'))>=0x0?moment(_0x4fe5f5[_0xe68d('0x17')])[_0xe68d('0x18')](_0x4fe5f5[_0xe68d('0x19')],'seconds'):null,'data1':_0xe68d('0x1a'),'data2':_0x4fe5f5[_0xe68d('0x13')],'data3':_0x4fe5f5[_0xe68d('0x11')],'data4':_0x4fe5f5[_0xe68d('0x1b')]||null,'role':_0xe68d('0x1c'),'internal':_0x4fe5f5[_0xe68d('0x13')]?_['toNumber'](_0x4fe5f5[_0xe68d('0x13')]):undefined,'uniqueid':_0x4fe5f5[_0xe68d('0x1d')]},'log':_0xe68d('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 52ce148..4a21f7b 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 _0xc38e=['../client','getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x48f7b4,_0x497fe3){var _0x520662=function(_0x2b85fe){while(--_0x2b85fe){_0x48f7b4['push'](_0x48f7b4['shift']());}};_0x520662(++_0x497fe3);}(_0xc38e,0x19e));var _0xec38=function(_0x5c2471,_0x5c36fe){_0x5c2471=_0x5c2471-0x0;var _0x189534=_0xc38e[_0x5c2471];return _0x189534;};'use strict';var client=require(_0xec38('0x0'));exports[_0xec38('0x1')]=function(){return client[_0xec38('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xec38('0x3'),_0xec38('0x4')]},'log':_0xec38('0x5')});}; \ No newline at end of file +var _0xd5e5=['ShowSetting','previewRecallmeReminderInterval','GetSettings','getSettings'];(function(_0x5814ca,_0x3b6713){var _0xeb1833=function(_0x553de1){while(--_0x553de1){_0x5814ca['push'](_0x5814ca['shift']());}};_0xeb1833(++_0x3b6713);}(_0xd5e5,0x187));var _0x5d5e=function(_0x2f1f0f,_0xaf3d2a){_0x2f1f0f=_0x2f1f0f-0x0;var _0x1163bd=_0xd5e5[_0x2f1f0f];return _0x1163bd;};'use strict';var client=require('../client');exports[_0x5d5e('0x0')]=function(){return client['Request'](_0x5d5e('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x5d5e('0x2')]},'log':_0x5d5e('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b268581..3cc2b83 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 _0xbde2=['Request','GetTemplate','html','../client','getTemplates'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xbde2,0x111));var _0x2bde=function(_0x2041ba,_0x1a9c5b){_0x2041ba=_0x2041ba-0x0;var _0x4f7286=_0xbde2[_0x2041ba];return _0x4f7286;};'use strict';var client=require(_0x2bde('0x0'));exports[_0x2bde('0x1')]=function(_0x14eb66){return function(_0x2498d4){return client[_0x2bde('0x2')](_0x2bde('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x2bde('0x4')]},'log':_0x2bde('0x3')});};}; \ No newline at end of file +var _0x60e1=['name','html','../client','Request','GetTemplate'];(function(_0x18559d,_0x54a0d6){var _0x557152=function(_0x481a18){while(--_0x481a18){_0x18559d['push'](_0x18559d['shift']());}};_0x557152(++_0x54a0d6);}(_0x60e1,0x14c));var _0x160e=function(_0x3ef49a,_0x5e586d){_0x3ef49a=_0x3ef49a-0x0;var _0x2d5c10=_0x60e1[_0x3ef49a];return _0x2d5c10;};'use strict';var client=require(_0x160e('0x0'));exports['getTemplates']=function(_0x6f51a){return function(_0x368d82){return client[_0x160e('0x1')](_0x160e('0x2'),{'options':{'raw':!![],'attributes':['id',_0x160e('0x3'),_0x160e('0x4')]},'log':_0x160e('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index f8d74e6..c882ab5 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 _0xf0f2=['data6','../client','getTriggers','Request','GetTrigger','name','channel','status','field','operator','Condition','AnyConditions','value','Action','action','data1','data2','data3','data4','data5'];(function(_0x3d2293,_0x53db74){var _0x28f416=function(_0x4e33e3){while(--_0x4e33e3){_0x3d2293['push'](_0x3d2293['shift']());}};_0x28f416(++_0x53db74);}(_0xf0f2,0x105));var _0x2f0f=function(_0x1880f5,_0xe42290){_0x1880f5=_0x1880f5-0x0;var _0x167858=_0xf0f2[_0x1880f5];return _0x167858;};'use strict';var client=require(_0x2f0f('0x0'));exports[_0x2f0f('0x1')]=function(_0x443128){return function(_0x3dfdf7){return client[_0x2f0f('0x2')](_0x2f0f('0x3'),{'options':{'raw':![],'attributes':['id',_0x2f0f('0x4'),_0x2f0f('0x5'),_0x2f0f('0x6')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x2f0f('0x7'),_0x2f0f('0x8'),'value']},{'model':_0x2f0f('0x9'),'as':_0x2f0f('0xa'),'attributes':['id',_0x2f0f('0x7'),_0x2f0f('0x8'),_0x2f0f('0xb')]},{'model':_0x2f0f('0xc'),'as':'Actions','attributes':['id',_0x2f0f('0xd'),_0x2f0f('0xe'),_0x2f0f('0xf'),_0x2f0f('0x10'),_0x2f0f('0x11'),_0x2f0f('0x12'),_0x2f0f('0x13'),'data7']}]},'log':_0x2f0f('0x3')});};}; \ No newline at end of file +var _0x01c7=['action','data1','data3','data4','data5','data6','../client','getTriggers','Request','GetTrigger','name','AllConditions','field','value','Condition','operator','Actions'];(function(_0x225d44,_0x399b52){var _0x4aa98a=function(_0xeffa74){while(--_0xeffa74){_0x225d44['push'](_0x225d44['shift']());}};_0x4aa98a(++_0x399b52);}(_0x01c7,0xe3));var _0x701c=function(_0x26cb01,_0x3ab8a7){_0x26cb01=_0x26cb01-0x0;var _0xe49a17=_0x01c7[_0x26cb01];return _0xe49a17;};'use strict';var client=require(_0x701c('0x0'));exports[_0x701c('0x1')]=function(_0x2efcba){return function(_0x33fb29){return client[_0x701c('0x2')](_0x701c('0x3'),{'options':{'raw':![],'attributes':['id',_0x701c('0x4'),'channel','status'],'include':[{'model':'Condition','as':_0x701c('0x5'),'attributes':['id',_0x701c('0x6'),'operator',_0x701c('0x7')]},{'model':_0x701c('0x8'),'as':'AnyConditions','attributes':['id',_0x701c('0x6'),_0x701c('0x9'),_0x701c('0x7')]},{'model':'Action','as':_0x701c('0xa'),'attributes':['id',_0x701c('0xb'),_0x701c('0xc'),'data2',_0x701c('0xd'),_0x701c('0xe'),_0x701c('0xf'),_0x701c('0x10'),'data7']}]},'log':_0x701c('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 88f217a..76c8b25 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 _0x3f91=['registry','defaultuser','GetTrunk','Request','name'];(function(_0x2c2ec9,_0x2acbb9){var _0x19e8a8=function(_0x275cc1){while(--_0x275cc1){_0x2c2ec9['push'](_0x2c2ec9['shift']());}};_0x19e8a8(++_0x2acbb9);}(_0x3f91,0x99));var _0x13f9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3f91[_0x199572];return _0x13cfa3;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x1a115b){return function(_0x3697f6){return client[_0x13f9('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x13f9('0x1'),_0x13f9('0x2'),_0x13f9('0x3')]},'log':_0x13f9('0x4')});};}; \ No newline at end of file +var _0x2029=['defaultuser','getTrunks','Request','GetTrunk','name','registry'];(function(_0x5ed2a3,_0x187431){var _0x5e8011=function(_0xfb3bb9){while(--_0xfb3bb9){_0x5ed2a3['push'](_0x5ed2a3['shift']());}};_0x5e8011(++_0x187431);}(_0x2029,0xb5));var _0x9202=function(_0x335f33,_0x2bbce0){_0x335f33=_0x335f33-0x0;var _0x796c65=_0x2029[_0x335f33];return _0x796c65;};'use strict';var client=require('../client');exports[_0x9202('0x0')]=function(_0x51a87b){return function(_0xe31a4b){return client[_0x9202('0x1')](_0x9202('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9202('0x3'),_0x9202('0x4'),_0x9202('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 5015006..a2b4037 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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x1cb9e5,_0x415d41){var _0x5b9c8d=function(_0x186068){while(--_0x186068){_0x1cb9e5['push'](_0x1cb9e5['shift']());}};_0x5b9c8d(++_0x415d41);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe706,0xa3));var _0x6e70=function(_0x27a824,_0x50dc82){_0x27a824=_0x27a824-0x0;var _0x5a1a7b=_0xe706[_0x27a824];return _0x5a1a7b;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 6fe56f8..99c8383 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 _0xc2a2=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x419e3f,_0x557d89){var _0x1839eb=function(_0x28249d){while(--_0x28249d){_0x419e3f['push'](_0x419e3f['shift']());}};_0x1839eb(++_0x557d89);}(_0xc2a2,0x14e));var _0x2c2a=function(_0x3d8063,_0x259052){_0x3d8063=_0x3d8063-0x0;var _0x360e40=_0xc2a2[_0x3d8063];return _0x360e40;};'use strict';var client=require(_0x2c2a('0x0'));exports[_0x2c2a('0x1')]=function(_0xdcd3e4){return client[_0x2c2a('0x2')](_0x2c2a('0x3'),{'body':_0xdcd3e4,'log':'CreateVoiceAgentReport'});};exports[_0x2c2a('0x4')]=function(_0x5d72a4,_0x44ac88,_0x4691b){return client[_0x2c2a('0x2')](_0x2c2a('0x5'),{'body':_0x5d72a4,'options':{'where':{'uniqueid':_0x44ac88,'interface':_0x4691b,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xe578=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x4bfb40,_0x438c7b){var _0x393ce5=function(_0x506b33){while(--_0x506b33){_0x4bfb40['push'](_0x4bfb40['shift']());}};_0x393ce5(++_0x438c7b);}(_0xe578,0x17a));var _0x8e57=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe578[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x8e57('0x0'));exports[_0x8e57('0x1')]=function(_0x483e4f){return client[_0x8e57('0x2')](_0x8e57('0x3'),{'body':_0x483e4f,'log':_0x8e57('0x3')});};exports[_0x8e57('0x4')]=function(_0x42c405,_0x36aad3,_0x426805){return client[_0x8e57('0x2')](_0x8e57('0x5'),{'body':_0x42c405,'options':{'where':{'uniqueid':_0x36aad3,'interface':_0x426805,'agentcomplete':!![]}},'log':_0x8e57('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5a723ee..de6e248 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 _0x34c1=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound'];(function(_0x84ccfa,_0x2b9c0d){var _0x9a40da=function(_0x387c81){while(--_0x387c81){_0x84ccfa['push'](_0x84ccfa['shift']());}};_0x9a40da(++_0x2b9c0d);}(_0x34c1,0xc5));var _0x134c=function(_0x4ca731,_0x3d9665){_0x4ca731=_0x4ca731-0x0;var _0x1fd0a1=_0x34c1[_0x4ca731];return _0x1fd0a1;};'use strict';var moment=require(_0x134c('0x0'));var util=require(_0x134c('0x1'));var _=require(_0x134c('0x2'));var client=require('../client');exports[_0x134c('0x3')]=function(_0x538292){return client['Request'](_0x134c('0x4'),{'body':_[_0x134c('0x5')](_0x538292,{'source':_0x538292[_0x134c('0x6')],'destinationcontext':_0x538292[_0x134c('0x7')],'callerid':_0x538292['callerid'],'amaflags':_0x134c('0x8')}),'log':_0x134c('0x4')});};exports[_0x134c('0x9')]=function(){return function(){return client[_0x134c('0xa')](_0x134c('0xb'),{'options':{'where':{'type':[_0x134c('0xc')],'createdAt':{'$between':[moment()[_0x134c('0xd')](_0x134c('0xe'))[_0x134c('0xf')](_0x134c('0x10')),moment()[_0x134c('0x11')](_0x134c('0xe'))[_0x134c('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x134c('0x12'),_0x134c('0x13')]},'log':_0x134c('0x14')});};}; \ No newline at end of file +var _0x799a=['YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day'];(function(_0x103cdb,_0x372b5f){var _0xaccac2=function(_0x37220e){while(--_0x37220e){_0x103cdb['push'](_0x103cdb['shift']());}};_0xaccac2(++_0x372b5f);}(_0x799a,0x6b));var _0xa799=function(_0x49aa40,_0x4034c5){_0x49aa40=_0x49aa40-0x0;var _0x23aaa0=_0x799a[_0x49aa40];return _0x23aaa0;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xa799('0x0'));var client=require(_0xa799('0x1'));exports[_0xa799('0x2')]=function(_0x4c38c3){return client[_0xa799('0x3')](_0xa799('0x4'),{'body':_[_0xa799('0x5')](_0x4c38c3,{'source':_0x4c38c3[_0xa799('0x6')],'destinationcontext':_0x4c38c3[_0xa799('0x7')],'callerid':_0x4c38c3['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xa799('0x4')});};exports[_0xa799('0x8')]=function(){return function(){return client[_0xa799('0x3')](_0xa799('0x9'),{'options':{'where':{'type':[_0xa799('0xa')],'createdAt':{'$between':[moment()[_0xa799('0xb')](_0xa799('0xc'))['format'](_0xa799('0xd')),moment()[_0xa799('0xe')](_0xa799('0xc'))[_0xa799('0xf')](_0xa799('0xd'))]}},'attributes':[_0xa799('0x10'),_0xa799('0x11'),_0xa799('0x12'),_0xa799('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fd0a532..dc8b21e 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 _0xc6ff=['CreateVoiceDialReport','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc6ff,0xcb));var _0xfc6f=function(_0x14458e,_0x1d133c){_0x14458e=_0x14458e-0x0;var _0x452df1=_0xc6ff[_0x14458e];return _0x452df1;};'use strict';var client=require('../client');exports[_0xfc6f('0x0')]=function(_0xee4d72){return client['Request'](_0xfc6f('0x1'),{'body':_0xee4d72,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xcd20=['../client','create','Request','CreateVoiceDialReport'];(function(_0x530a00,_0x449fde){var _0x154742=function(_0x3b6846){while(--_0x3b6846){_0x530a00['push'](_0x530a00['shift']());}};_0x154742(++_0x449fde);}(_0xcd20,0xb8));var _0x0cd2=function(_0x567758,_0x533bba){_0x567758=_0x567758-0x0;var _0x1d0e7f=_0xcd20[_0x567758];return _0x1d0e7f;};'use strict';var client=require(_0x0cd2('0x0'));exports[_0x0cd2('0x1')]=function(_0x438f10){return client[_0x0cd2('0x2')]('CreateVoiceDialReport',{'body':_0x438f10,'log':_0x0cd2('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index acb8546..c5e2bde 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 _0xda55=['recordingFormat','../client','getVoiceExtensions','exten'];(function(_0x2f7a76,_0x2b5dc3){var _0x4fc5cb=function(_0x126bb1){while(--_0x126bb1){_0x2f7a76['push'](_0x2f7a76['shift']());}};_0x4fc5cb(++_0x2b5dc3);}(_0xda55,0x6d));var _0x5da5=function(_0x23a079,_0xb8c9aa){_0x23a079=_0x23a079-0x0;var _0x53f2a5=_0xda55[_0x23a079];return _0x53f2a5;};'use strict';var client=require(_0x5da5('0x0'));exports[_0x5da5('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x5da5('0x2'),_0x5da5('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x5da5('0x1')});};}; \ No newline at end of file +var _0x2bdb=['getVoiceExtensions','../client','Request','exten','recordingFormat'];(function(_0x2b8962,_0xa2b753){var _0x19ed1e=function(_0x36dd07){while(--_0x36dd07){_0x2b8962['push'](_0x2b8962['shift']());}};_0x19ed1e(++_0xa2b753);}(_0x2bdb,0x105));var _0xb2bd=function(_0x1cac77,_0x430161){_0x1cac77=_0x1cac77-0x0;var _0x4d94dd=_0x2bdb[_0x1cac77];return _0x4d94dd;};'use strict';var client=require(_0xb2bd('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xb2bd('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xb2bd('0x2'),_0xb2bd('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xb2bd('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index bc547f3..16a58c4 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 _0x0d91=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','name','acw','acwTimeout','autopause','monitor_format','type','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x0d91,0x17e));var _0x10d9=function(_0xba0c2,_0x54cc50){_0xba0c2=_0xba0c2-0x0;var _0x5a9fa0=_0x0d91[_0xba0c2];return _0x5a9fa0;};'use strict';var client=require(_0x10d9('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x10d9('0x1'),_0x10d9('0x2'),_0x10d9('0x3'),_0x10d9('0x4'),_0x10d9('0x5'),_0x10d9('0x6'),'dialActive','dialMethod','dialLimitChannel',_0x10d9('0x7'),'dialPowerLevel',_0x10d9('0x8'),_0x10d9('0x9'),'dialPredictiveInterval',_0x10d9('0xa'),_0x10d9('0xb'),'dialOriginateTimeout','dialQueueOptions',_0x10d9('0xc'),_0x10d9('0xd'),_0x10d9('0xe'),_0x10d9('0xf'),_0x10d9('0x10'),_0x10d9('0x11'),_0x10d9('0x12'),'dialNoAnswerRetryFrequency',_0x10d9('0x13'),_0x10d9('0x14'),'dialGlobalInterval',_0x10d9('0x15'),_0x10d9('0x16'),_0x10d9('0x17'),_0x10d9('0x18'),'dialAMDGreeting',_0x10d9('0x19'),_0x10d9('0x1a'),_0x10d9('0x1b'),'dialAMDBetweenWordsSilence',_0x10d9('0x1c'),'dialAMDSilenceThreshold',_0x10d9('0x1d'),_0x10d9('0x1e'),_0x10d9('0x1f'),_0x10d9('0x20'),_0x10d9('0x21'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x10d9('0x22'),'monitor_format',_0x10d9('0x23'),_0x10d9('0x24'),'dialCutDigit',_0x10d9('0x25'),_0x10d9('0x26'),_0x10d9('0x27'),_0x10d9('0x28'),_0x10d9('0x29'),_0x10d9('0x2a'),_0x10d9('0x2b'),'dialMachineRetryFrequency',_0x10d9('0x2c'),_0x10d9('0x2d'),_0x10d9('0x2e'),_0x10d9('0x2f'),_0x10d9('0x30'),'dialPreviewAutoRecallMe',_0x10d9('0x31')],'include':[{'model':_0x10d9('0x32'),'as':_0x10d9('0x32'),'attributes':['id',_0x10d9('0x1'),_0x10d9('0x33'),_0x10d9('0x34')]},{'model':_0x10d9('0x35'),'as':_0x10d9('0x36'),'attributes':['id','name']},{'model':_0x10d9('0x32'),'as':_0x10d9('0x37'),'attributes':['id',_0x10d9('0x1'),_0x10d9('0x33'),_0x10d9('0x34')]},{'model':_0x10d9('0x38'),'as':_0x10d9('0x38'),'attributes':['id','name'],'include':[{'model':_0x10d9('0x38'),'as':_0x10d9('0x39'),'attributes':['id',_0x10d9('0x1'),_0x10d9('0x3a')]}]}]},'log':_0x10d9('0x3b')});};}; \ No newline at end of file +var _0xe5f7=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','name','active','Pause','mandatoryDispositionPause','callerid','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x48122d,_0x5902d8){var _0x5c5070=function(_0x10ac27){while(--_0x10ac27){_0x48122d['push'](_0x48122d['shift']());}};_0x5c5070(++_0x5902d8);}(_0xe5f7,0x178));var _0x7e5f=function(_0x2b28ed,_0x102243){_0x2b28ed=_0x2b28ed-0x0;var _0x2618a2=_0xe5f7[_0x2b28ed];return _0x2618a2;};'use strict';var client=require(_0x7e5f('0x0'));exports[_0x7e5f('0x1')]=function(){return function(){return client[_0x7e5f('0x2')](_0x7e5f('0x3'),{'options':{'raw':![],'attributes':['id','name','acw',_0x7e5f('0x4'),_0x7e5f('0x5'),_0x7e5f('0x6'),'type',_0x7e5f('0x7'),_0x7e5f('0x8'),'dialLimitChannel',_0x7e5f('0x9'),_0x7e5f('0xa'),_0x7e5f('0xb'),_0x7e5f('0xc'),_0x7e5f('0xd'),_0x7e5f('0xe'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0x7e5f('0xf'),_0x7e5f('0x10'),_0x7e5f('0x11'),_0x7e5f('0x12'),_0x7e5f('0x13'),_0x7e5f('0x14'),_0x7e5f('0x15'),_0x7e5f('0x16'),_0x7e5f('0x17'),_0x7e5f('0x18'),'dialTimezone',_0x7e5f('0x19'),'dialPrefix',_0x7e5f('0x1a'),_0x7e5f('0x1b'),_0x7e5f('0x1c'),_0x7e5f('0x1d'),_0x7e5f('0x1e'),_0x7e5f('0x1f'),_0x7e5f('0x20'),_0x7e5f('0x21'),_0x7e5f('0x22'),_0x7e5f('0x23'),'dialAMDMaximumWordLength',_0x7e5f('0x24'),_0x7e5f('0x25'),_0x7e5f('0x26'),_0x7e5f('0x27'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2',_0x7e5f('0x6'),_0x7e5f('0x28'),'dialRandomLastDigitCallerIdNumber',_0x7e5f('0x29'),_0x7e5f('0x2a'),_0x7e5f('0x2b'),_0x7e5f('0x2c'),_0x7e5f('0x2d'),_0x7e5f('0x2e'),_0x7e5f('0x2f'),'dialMachineMaxRetry',_0x7e5f('0x30'),'dialAgentRejectMaxRetry',_0x7e5f('0x31'),_0x7e5f('0x32'),'dialPredictiveIntervalMaxThreshold',_0x7e5f('0x33'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'],'include':[{'model':_0x7e5f('0x34'),'as':'Trunk','attributes':['id',_0x7e5f('0x35'),'callerid',_0x7e5f('0x36')]},{'model':_0x7e5f('0x37'),'as':_0x7e5f('0x38'),'attributes':['id','name']},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x7e5f('0x35'),_0x7e5f('0x39'),_0x7e5f('0x36')]},{'model':_0x7e5f('0x3a'),'as':_0x7e5f('0x3a'),'attributes':['id',_0x7e5f('0x35')],'include':[{'model':_0x7e5f('0x3a'),'as':_0x7e5f('0x3b'),'attributes':['id','name','interval']}]}]},'log':_0x7e5f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 1221ae3..1992afd 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(_0x51ec44,_0xe46136){var _0xc67cce=function(_0x47c64f){while(--_0x47c64f){_0x51ec44['push'](_0x51ec44['shift']());}};_0xc67cce(++_0xe46136);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x3ee79,_0x49a3b1){var _0x1fe997=function(_0xb47b75){while(--_0xb47b75){_0x3ee79['push'](_0x3ee79['shift']());}};_0x1fe997(++_0x49a3b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 ca237b2..b8a168c 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 _0x2b9c=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x5b8944,_0x2dbf9a){var _0x52590a=function(_0x37f535){while(--_0x37f535){_0x5b8944['push'](_0x5b8944['shift']());}};_0x52590a(++_0x2dbf9a);}(_0x2b9c,0x125));var _0xc2b9=function(_0x3dfed5,_0x2d800a){_0x3dfed5=_0x3dfed5-0x0;var _0x1266f0=_0x2b9c[_0x3dfed5];return _0x1266f0;};'use strict';var client=require('../client');exports[_0xc2b9('0x0')]=function(_0x139fb9){return function(){return client['Request'](_0xc2b9('0x1'),{'options':{'where':{'VoiceQueueId':_0x139fb9,'paused':!![]},'raw':!![]},'log':_0xc2b9('0x0')});};}; \ No newline at end of file +var _0x8f3c=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x16fcfe,_0x5383fc){var _0xe1aa65=function(_0x39e575){while(--_0x39e575){_0x16fcfe['push'](_0x16fcfe['shift']());}};_0xe1aa65(++_0x5383fc);}(_0x8f3c,0x135));var _0xc8f3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8f3c[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0xc8f3('0x0'));exports[_0xc8f3('0x1')]=function(_0xd84583){return function(){return client['Request'](_0xc8f3('0x2'),{'options':{'where':{'VoiceQueueId':_0xd84583,'paused':!![]},'raw':!![]},'log':_0xc8f3('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8158d6a..c3e1e02 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(_0x194282,_0x52e4ee){var _0x31a0e9=function(_0x5ab039){while(--_0x5ab039){_0x194282['push'](_0x194282['shift']());}};_0x31a0e9(++_0x52e4ee);}(_0x7a54,0x106));var _0x47a5=function(_0x19b887,_0x3b7bce){_0x19b887=_0x19b887-0x0;var _0x3fe77d=_0x7a54[_0x19b887];return _0x3fe77d;};'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(_0x541e97,_0xc662e6){var _0x2a3e0d=function(_0x8d177e){while(--_0x8d177e){_0x541e97['push'](_0x541e97['shift']());}};_0x2a3e0d(++_0xc662e6);}(_0x7a54,0x106));var _0x47a5=function(_0x1602ee,_0x231b8d){_0x1602ee=_0x1602ee-0x0;var _0x243269=_0x7a54[_0x1602ee];return _0x243269;};'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 005c8a0..3fe16bf 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 _0x8af4=['attended','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten'];(function(_0x2c0618,_0x3c2598){var _0x3622ef=function(_0x33d9b9){while(--_0x33d9b9){_0x2c0618['push'](_0x2c0618['shift']());}};_0x3622ef(++_0x3c2598);}(_0x8af4,0xf1));var _0x48af=function(_0xdf1858,_0x5692d0){_0xdf1858=_0xdf1858-0x0;var _0x3e64f0=_0x8af4[_0xdf1858];return _0x3e64f0;};'use strict';var client=require('../client');exports[_0x48af('0x0')]={};exports[_0x48af('0x1')]=function(_0x2077e){return client['Request'](_0x48af('0x2'),{'body':{'result':_0x2077e[_0x48af('0x3')],'transfererchannel':_0x2077e[_0x48af('0x4')],'transferercalleridnum':_0x2077e['transferercalleridnum'],'transferercalleridname':_0x2077e[_0x48af('0x5')],'transfererconnectedlinenum':_0x2077e[_0x48af('0x6')],'transfererconnectedlinename':_0x2077e[_0x48af('0x7')],'transfereraccountcode':_0x2077e['transfereraccountcode'],'transferercontext':_0x2077e[_0x48af('0x8')],'transfererexten':_0x2077e[_0x48af('0x9')],'transfererlinkedid':_0x2077e[_0x48af('0xa')],'transfereechannel':_0x2077e[_0x48af('0xb')],'transfereecalleridnum':_0x2077e[_0x48af('0xc')],'transfereecalleridname':_0x2077e[_0x48af('0xd')],'transfereeconnectedlinenum':_0x2077e[_0x48af('0xe')],'transfereeconnectedlinename':_0x2077e[_0x48af('0xf')],'transfereeaccountcode':_0x2077e[_0x48af('0x10')],'transfereecontext':_0x2077e[_0x48af('0x11')],'transfereeexten':_0x2077e[_0x48af('0x12')],'transfereelinkedid':_0x2077e[_0x48af('0x13')],'isexternal':_0x2077e[_0x48af('0x14')],'context':_0x2077e['context'],'extension':_0x2077e[_0x48af('0x15')],'type':_0x48af('0x16')},'log':_0x48af('0x2')});};exports['attendedTransfer']=function(_0x11e757){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x11e757['result'],'transfererchannel':_0x11e757[_0x48af('0x17')],'transferercalleridnum':_0x11e757[_0x48af('0x18')],'transferercalleridname':_0x11e757['origtransferercalleridname'],'transfererconnectedlinenum':_0x11e757[_0x48af('0x19')],'transfererconnectedlinename':_0x11e757[_0x48af('0x1a')],'transfereraccountcode':_0x11e757[_0x48af('0x1b')],'transferercontext':_0x11e757[_0x48af('0x1c')],'transfererexten':_0x11e757['secondtransfererexten'],'transfererlinkedid':_0x11e757[_0x48af('0x1d')],'transfereechannel':_0x11e757[_0x48af('0x1e')],'transfereecalleridnum':_0x11e757[_0x48af('0x1f')],'transfereecalleridname':_0x11e757[_0x48af('0x20')],'transfereeconnectedlinenum':_0x11e757['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x11e757[_0x48af('0x21')],'transfereeaccountcode':_0x11e757[_0x48af('0x22')],'transfereecontext':_0x11e757[_0x48af('0x23')],'transfereeexten':_0x11e757['transfertargetexten'],'transfereelinkedid':_0x11e757[_0x48af('0x24')],'isexternal':_0x11e757[_0x48af('0x14')],'context':_0x11e757[_0x48af('0x25')],'extension':_0x11e757[_0x48af('0x26')],'type':_0x48af('0x27')},'log':_0x48af('0x2')});}; \ No newline at end of file +var _0x50a0=['transfereeconnectedlinenum','transfereeconnectedlinename','transfereelinkedid','context','extension','blind','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','attended','transfers','blindTransfer','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x50a0,0xbf));var _0x050a=function(_0x121078,_0x1ba431){_0x121078=_0x121078-0x0;var _0x495e6a=_0x50a0[_0x121078];return _0x495e6a;};'use strict';var client=require('../client');exports[_0x050a('0x0')]={};exports[_0x050a('0x1')]=function(_0x2b3222){return client['Request'](_0x050a('0x2'),{'body':{'result':_0x2b3222['result'],'transfererchannel':_0x2b3222['transfererchannel'],'transferercalleridnum':_0x2b3222[_0x050a('0x3')],'transferercalleridname':_0x2b3222[_0x050a('0x4')],'transfererconnectedlinenum':_0x2b3222[_0x050a('0x5')],'transfererconnectedlinename':_0x2b3222[_0x050a('0x6')],'transfereraccountcode':_0x2b3222[_0x050a('0x7')],'transferercontext':_0x2b3222[_0x050a('0x8')],'transfererexten':_0x2b3222[_0x050a('0x9')],'transfererlinkedid':_0x2b3222[_0x050a('0xa')],'transfereechannel':_0x2b3222[_0x050a('0xb')],'transfereecalleridnum':_0x2b3222[_0x050a('0xc')],'transfereecalleridname':_0x2b3222[_0x050a('0xd')],'transfereeconnectedlinenum':_0x2b3222[_0x050a('0xe')],'transfereeconnectedlinename':_0x2b3222[_0x050a('0xf')],'transfereeaccountcode':_0x2b3222['transfereeaccountcode'],'transfereecontext':_0x2b3222['transfereecontext'],'transfereeexten':_0x2b3222['transfereeexten'],'transfereelinkedid':_0x2b3222[_0x050a('0x10')],'isexternal':_0x2b3222['isexternal'],'context':_0x2b3222[_0x050a('0x11')],'extension':_0x2b3222[_0x050a('0x12')],'type':_0x050a('0x13')},'log':_0x050a('0x2')});};exports[_0x050a('0x14')]=function(_0x5c478f){return client[_0x050a('0x15')](_0x050a('0x2'),{'body':{'result':_0x5c478f[_0x050a('0x16')],'transfererchannel':_0x5c478f[_0x050a('0x17')],'transferercalleridnum':_0x5c478f[_0x050a('0x18')],'transferercalleridname':_0x5c478f[_0x050a('0x19')],'transfererconnectedlinenum':_0x5c478f[_0x050a('0x1a')],'transfererconnectedlinename':_0x5c478f[_0x050a('0x1b')],'transfereraccountcode':_0x5c478f[_0x050a('0x1c')],'transferercontext':_0x5c478f[_0x050a('0x1d')],'transfererexten':_0x5c478f['secondtransfererexten'],'transfererlinkedid':_0x5c478f[_0x050a('0x1e')],'transfereechannel':_0x5c478f[_0x050a('0x1f')],'transfereecalleridnum':_0x5c478f[_0x050a('0x20')],'transfereecalleridname':_0x5c478f[_0x050a('0x21')],'transfereeconnectedlinenum':_0x5c478f[_0x050a('0x22')],'transfereeconnectedlinename':_0x5c478f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5c478f['transfertargetaccountcode'],'transfereecontext':_0x5c478f[_0x050a('0x23')],'transfereeexten':_0x5c478f[_0x050a('0x24')],'transfereelinkedid':_0x5c478f[_0x050a('0x25')],'isexternal':_0x5c478f[_0x050a('0x26')],'context':_0x5c478f[_0x050a('0x27')],'extension':_0x5c478f['origtransfererexten'],'type':_0x050a('0x28')},'log':_0x050a('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index fc24614..7eb1d59 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x1cf41f,_0x2f6beb){var _0x2b1853=function(_0x4ca04d){while(--_0x4ca04d){_0x1cf41f['push'](_0x1cf41f['shift']());}};_0x2b1853(++_0x2f6beb);}(_0x7a54,0x106));var _0x47a5=function(_0x33fd67,_0x222872){_0x33fd67=_0x33fd67-0x0;var _0x57202e=_0x7a54[_0x33fd67];return _0x57202e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x1c3df0,_0x508ec1){var _0x1ff4f5=function(_0x3b28a0){while(--_0x3b28a0){_0x1c3df0['push'](_0x1c3df0['shift']());}};_0x1ff4f5(++_0x508ec1);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e54e9,_0x40a2b7){_0x4e54e9=_0x4e54e9-0x0;var _0x32be8f=_0xb10b[_0x4e54e9];return _0x32be8f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+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 c285fc6..93b0dcd 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 _0x5100=['destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','','user:%s','format','trigger:%s','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','$or','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','phone','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname'];(function(_0x53b2f5,_0x4773a6){var _0x25ab23=function(_0x49c8e9){while(--_0x49c8e9){_0x53b2f5['push'](_0x53b2f5['shift']());}};_0x25ab23(++_0x4773a6);}(_0x5100,0x132));var _0x0510=function(_0x1c7964,_0x5d9dd7){_0x1c7964=_0x1c7964-0x0;var _0x50074f=_0x5100[_0x1c7964];return _0x50074f;};'use strict';var _=require(_0x0510('0x0'));var BPromise=require(_0x0510('0x1'));var Redis=require(_0x0510('0x2'));var util=require(_0x0510('0x3'));var config=require(_0x0510('0x4'));var logger=require(_0x0510('0x5'))('trigger');var cmContactRpc=require(_0x0510('0x6'));config['redis']=_[_0x0510('0x7')](config[_0x0510('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x0510('0x9'))(new Redis(config[_0x0510('0x8')]));function emit(_0x5833d0,_0x5d9613,_0xa321d5,_0x5739ac,_0x7cf4f9){logger[_0x0510('0xa')](_0x0510('0xb'),_0x5833d0,_0x5d9613['id'],_0xa321d5,_0x5739ac,JSON[_0x0510('0xc')](_0x7cf4f9));io['to'](_0xa321d5)[_0x0510('0xd')](_0x5739ac,_0x7cf4f9);}exports[_0x0510('0xe')]=function(_0x158cb4,_0x41d924,_0x329d7f,_0x12bc95){var _0x2f88b2,_0x113de0;var _0x3832e8={};var _0x3e567e;var _0x302e15=Number(_0x329d7f[_0x0510('0xf')]);var _0xa48528=_0x329d7f[_0x0510('0x10')]?Boolean(Number(_0x329d7f[_0x0510('0x10')])):![];var _0xc3aecf;var _0x46391b=![];if(!_['isNil'](_0x329d7f[_0x0510('0x11')])){if(_0x329d7f['data5']=='1')_0x46391b=!![];}if(!_0x46391b){if(_0x12bc95[_0x0510('0x12')]){_0x3832e8['id']=_0x12bc95[_0x0510('0x12')];}}if(!_0x3832e8['id']){_0x3832e8[_0x0510('0x13')]=_0x302e15;_0xc3aecf=_0x329d7f[_0x0510('0x14')]&&_0x329d7f[_0x0510('0x14')]!=='0'?_0x329d7f['data3'][_0x0510('0x15')](','):['phone'];_0x3832e8[_0x0510('0x16')]=_['map'](_0xc3aecf,function(_0x356d16){var _0x7d9599={};_0x7d9599[_0x356d16]=_0x12bc95[_0x0510('0x17')]?_0x12bc95['destcalleridnum']:_0x12bc95[_0x0510('0x18')];return _0x7d9599;});_0x3e567e=_0x12bc95[_0x0510('0x17')]?_0x12bc95[_0x0510('0x19')]:_0x12bc95['calleridnum'];}var _0x3ff29f=['id',_0x0510('0x1a'),_0x0510('0x1b'),'phone',_0x0510('0x1c'),_0x0510('0x1d'),_0x0510('0x13'),_0x0510('0x1e'),_0x0510('0x1f'),'updatedAt'];var _0x1262e0=_[_0x0510('0x20')](_0x3ff29f,_0xc3aecf);BPromise[_0x0510('0x21')]()[_0x0510('0x22')](cmContactRpc[_0x0510('0x23')]({'attributes':_0x1262e0,'where':_0x3832e8,'phone':_0x3e567e}))['then'](function(_0x1d53d2){_0x113de0=_0x1d53d2;if(!_[_0x0510('0x24')](_0x113de0)){if(_0x113de0['length']===0x1){_0x2f88b2=_0x113de0[0x0];logger[_0x0510('0xa')](_0x0510('0x25'),_0x12bc95[_0x0510('0x26')],_0x41d924['id'],_0x2f88b2['id']);}else{logger[_0x0510('0xa')](_0x0510('0x27'),_0x12bc95['uniqueid'],_0x41d924['id'],_[_0x0510('0x28')](_0x113de0,'id')[_0x0510('0x29')](','));}return;}else{logger[_0x0510('0xa')](_0x0510('0x2a'),_0x12bc95['uniqueid'],_0x41d924['id']);var _0x2d00e7={'ListId':_0x302e15};var _0x2509bc=_0x329d7f[_0x0510('0x2b')]&&_0x329d7f[_0x0510('0x2b')]!=='0'?_0x329d7f[_0x0510('0x2b')]:_0x0510('0x2c');if(_0xa48528){logger[_0x0510('0xa')](_0x0510('0x2d'),_0x12bc95[_0x0510('0x26')],_0x41d924['id']);_0x2d00e7[_0x2509bc]=_[_0x0510('0x2e')](_0x12bc95[_0x0510('0x17')])?_0x12bc95['calleridnum']:_0x12bc95[_0x0510('0x19')];if(_[_0x0510('0x2e')](_0x12bc95[_0x0510('0x17')])){_0x2d00e7[_0x0510('0x1a')]=_0x12bc95[_0x0510('0x2f')]&&_0x12bc95[_0x0510('0x2f')]!==''?_0x12bc95['calleridname']:'Unknown';}else{_0x2d00e7[_0x0510('0x1a')]=_0x12bc95[_0x0510('0x30')]&&_0x12bc95[_0x0510('0x30')]!==''?_0x12bc95[_0x0510('0x30')]:_0x0510('0x31');}return BPromise[_0x0510('0x21')]()['then'](cmContactRpc[_0x0510('0x32')](_0x2d00e7))[_0x0510('0x22')](function(_0x11205e){_0x2f88b2=_0x11205e;_0x113de0[_0x0510('0x33')](_0x11205e);if(_0x2f88b2){logger[_0x0510('0xa')](_0x0510('0x34'),_0x12bc95[_0x0510('0x26')],_0x41d924['id'],_0x2f88b2['id']);}return;});}else{logger[_0x0510('0xa')](_0x0510('0x35'),_0x12bc95['uniqueid'],_0x41d924['id']);_0x2d00e7[_0x2509bc]=_[_0x0510('0x2e')](_0x12bc95[_0x0510('0x17')])?_0x12bc95[_0x0510('0x18')]:_0x12bc95[_0x0510('0x19')];if(_[_0x0510('0x2e')](_0x12bc95[_0x0510('0x17')])){_0x2d00e7[_0x0510('0x1a')]=_0x12bc95[_0x0510('0x2f')]&&_0x12bc95['calleridname']!==_0x0510('0x36')?_0x12bc95['calleridname']:_0x0510('0x31');}else{_0x2d00e7[_0x0510('0x1a')]=_0x12bc95[_0x0510('0x30')]&&_0x12bc95['destcalleridname']!==''?_0x12bc95['destcalleridname']:_0x0510('0x31');}_0x2f88b2=_0x2d00e7;_0x113de0[_0x0510('0x33')](_0x2d00e7);return;}}})[_0x0510('0x22')](function(){if(_0x158cb4){emit(_0x12bc95['uniqueid'],_0x41d924,util['format'](_0x0510('0x37'),_0x158cb4['name']),util[_0x0510('0x38')](_0x0510('0x39'),_0x329d7f['action']['toLowerCase']()),{'evt':_[_0x0510('0x3a')](_0x12bc95,{'autoCreate':_0xa48528}),'contact':_0x2f88b2===undefined?{}:_0x2f88b2,'contacts':_0x113de0['length']===0x0?undefined:_0x113de0});}});}; \ No newline at end of file +var _0xbdcf=['createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','fax'];(function(_0x30fa89,_0x46cc7d){var _0x2f03df=function(_0x18f02c){while(--_0x18f02c){_0x30fa89['push'](_0x30fa89['shift']());}};_0x2f03df(++_0x46cc7d);}(_0xbdcf,0x173));var _0xfbdc=function(_0x557419,_0x20839f){_0x557419=_0x557419-0x0;var _0x10c03b=_0xbdcf[_0x557419];return _0x10c03b;};'use strict';var _=require(_0xfbdc('0x0'));var BPromise=require('bluebird');var Redis=require(_0xfbdc('0x1'));var util=require(_0xfbdc('0x2'));var config=require(_0xfbdc('0x3'));var logger=require(_0xfbdc('0x4'))('trigger');var cmContactRpc=require(_0xfbdc('0x5'));config['redis']=_[_0xfbdc('0x6')](config['redis'],{'host':_0xfbdc('0x7'),'port':0x18eb});var io=require(_0xfbdc('0x8'))(new Redis(config['redis']));function emit(_0x3346a2,_0x5855d1,_0x497675,_0x2bb9f7,_0x3df7e4){logger[_0xfbdc('0x9')](_0xfbdc('0xa'),_0x3346a2,_0x5855d1['id'],_0x497675,_0x2bb9f7,JSON[_0xfbdc('0xb')](_0x3df7e4));io['to'](_0x497675)[_0xfbdc('0xc')](_0x2bb9f7,_0x3df7e4);}exports[_0xfbdc('0xd')]=function(_0x585a88,_0x104d7f,_0x119d60,_0x44d535){var _0x2a560a,_0x20cabf;var _0x25576d={};var _0x18a5c3;var _0x2f7358=Number(_0x119d60['data1']);var _0x40b8d9=_0x119d60[_0xfbdc('0xe')]?Boolean(Number(_0x119d60[_0xfbdc('0xe')])):![];var _0x36298b;var _0x2704cb=![];if(!_[_0xfbdc('0xf')](_0x119d60[_0xfbdc('0x10')])){if(_0x119d60[_0xfbdc('0x10')]=='1')_0x2704cb=!![];}if(!_0x2704cb){if(_0x44d535['xmd-contactid']){_0x25576d['id']=_0x44d535['xmd-contactid'];}}if(!_0x25576d['id']){_0x25576d[_0xfbdc('0x11')]=_0x2f7358;_0x36298b=_0x119d60[_0xfbdc('0x12')]&&_0x119d60[_0xfbdc('0x12')]!=='0'?_0x119d60[_0xfbdc('0x12')][_0xfbdc('0x13')](','):[_0xfbdc('0x14')];_0x25576d[_0xfbdc('0x15')]=_[_0xfbdc('0x16')](_0x36298b,function(_0x10aed9){var _0x117ad2={};_0x117ad2[_0x10aed9]=_0x44d535[_0xfbdc('0x17')]?_0x44d535[_0xfbdc('0x18')]:_0x44d535['calleridnum'];return _0x117ad2;});_0x18a5c3=_0x44d535['routeId']?_0x44d535['destcalleridnum']:_0x44d535[_0xfbdc('0x19')];}var _0x4f7301=['id','firstName',_0xfbdc('0x1a'),_0xfbdc('0x14'),'mobile',_0xfbdc('0x1b'),_0xfbdc('0x11'),_0xfbdc('0x1c'),_0xfbdc('0x1d'),_0xfbdc('0x1e')];var _0x351173=_[_0xfbdc('0x1f')](_0x4f7301,_0x36298b);BPromise[_0xfbdc('0x20')]()[_0xfbdc('0x21')](cmContactRpc[_0xfbdc('0x22')]({'attributes':_0x351173,'where':_0x25576d,'phone':_0x18a5c3}))[_0xfbdc('0x21')](function(_0x5a12ad){_0x20cabf=_0x5a12ad;if(!_[_0xfbdc('0x23')](_0x20cabf)){if(_0x20cabf[_0xfbdc('0x24')]===0x1){_0x2a560a=_0x20cabf[0x0];logger[_0xfbdc('0x9')](_0xfbdc('0x25'),_0x44d535[_0xfbdc('0x26')],_0x104d7f['id'],_0x2a560a['id']);}else{logger[_0xfbdc('0x9')](_0xfbdc('0x27'),_0x44d535[_0xfbdc('0x26')],_0x104d7f['id'],_[_0xfbdc('0x16')](_0x20cabf,'id')['join'](','));}return;}else{logger[_0xfbdc('0x9')](_0xfbdc('0x28'),_0x44d535[_0xfbdc('0x26')],_0x104d7f['id']);var _0x2bdeeb={'ListId':_0x2f7358};var _0x9f874a=_0x119d60[_0xfbdc('0x29')]&&_0x119d60[_0xfbdc('0x29')]!=='0'?_0x119d60['data4']:'phone';if(_0x40b8d9){logger[_0xfbdc('0x9')](_0xfbdc('0x2a'),_0x44d535['uniqueid'],_0x104d7f['id']);_0x2bdeeb[_0x9f874a]=_[_0xfbdc('0xf')](_0x44d535[_0xfbdc('0x17')])?_0x44d535[_0xfbdc('0x19')]:_0x44d535[_0xfbdc('0x18')];if(_[_0xfbdc('0xf')](_0x44d535[_0xfbdc('0x17')])){_0x2bdeeb[_0xfbdc('0x2b')]=_0x44d535['calleridname']&&_0x44d535[_0xfbdc('0x2c')]!==_0xfbdc('0x2d')?_0x44d535[_0xfbdc('0x2c')]:_0xfbdc('0x2e');}else{_0x2bdeeb[_0xfbdc('0x2b')]=_0x44d535[_0xfbdc('0x2f')]&&_0x44d535[_0xfbdc('0x2f')]!==_0xfbdc('0x2d')?_0x44d535['destcalleridname']:_0xfbdc('0x2e');}return BPromise[_0xfbdc('0x20')]()[_0xfbdc('0x21')](cmContactRpc['createContact'](_0x2bdeeb))[_0xfbdc('0x21')](function(_0x42c0c7){_0x2a560a=_0x42c0c7;_0x20cabf[_0xfbdc('0x30')](_0x42c0c7);if(_0x2a560a){logger[_0xfbdc('0x9')](_0xfbdc('0x31'),_0x44d535[_0xfbdc('0x26')],_0x104d7f['id'],_0x2a560a['id']);}return;});}else{logger['info'](_0xfbdc('0x32'),_0x44d535['uniqueid'],_0x104d7f['id']);_0x2bdeeb[_0x9f874a]=_[_0xfbdc('0xf')](_0x44d535[_0xfbdc('0x17')])?_0x44d535['calleridnum']:_0x44d535['destcalleridnum'];if(_[_0xfbdc('0xf')](_0x44d535[_0xfbdc('0x17')])){_0x2bdeeb[_0xfbdc('0x2b')]=_0x44d535[_0xfbdc('0x2c')]&&_0x44d535[_0xfbdc('0x2c')]!==_0xfbdc('0x2d')?_0x44d535['calleridname']:_0xfbdc('0x2e');}else{_0x2bdeeb[_0xfbdc('0x2b')]=_0x44d535[_0xfbdc('0x2f')]&&_0x44d535[_0xfbdc('0x2f')]!==_0xfbdc('0x2d')?_0x44d535[_0xfbdc('0x2f')]:'Unknown';}_0x2a560a=_0x2bdeeb;_0x20cabf['push'](_0x2bdeeb);return;}}})[_0xfbdc('0x21')](function(){if(_0x585a88){emit(_0x44d535[_0xfbdc('0x26')],_0x104d7f,util[_0xfbdc('0x33')]('user:%s',_0x585a88[_0xfbdc('0x34')]),util[_0xfbdc('0x33')](_0xfbdc('0x35'),_0x119d60[_0xfbdc('0x36')][_0xfbdc('0x37')]()),{'evt':_[_0xfbdc('0x38')](_0x44d535,{'autoCreate':_0x40b8d9}),'contact':_0x2a560a===undefined?{}:_0x2a560a,'contacts':_0x20cabf[_0xfbdc('0x24')]===0x0?undefined:_0x20cabf});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 86ed394..3b9be2c 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 _0x2b09=['info','emit','clone','motionChannel','undefined','inspect','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','browser','data1','data2','render','uri','buildUri','data3','isNil','data4','uriLocation','windowWidth','800','data5','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s','exec','integration','accounts','queue','routeId','script','query','search','replace','channel','AllConditions','length','some','AnyConditions','checkTrigger:\x20trigger','evt','checkConditions','field','account','chat','ChatWebsiteId','value','AccountId','operator','upperFirst','message','event','membername','lastevent','mailSubstatus','null','substatus','exports','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x2b09,0x1bb));var _0x92b0=function(_0x2ec213,_0x3e2c89){_0x2ec213=_0x2ec213-0x0;var _0x194c2c=_0x2b09[_0x2ec213];return _0x194c2c;};'use strict';var util=require(_0x92b0('0x0'));var _=require(_0x92b0('0x1'));var url=require(_0x92b0('0x2'));var Mustache=require(_0x92b0('0x3'));var Redis=require('ioredis');var urlforward=require(_0x92b0('0x4'));var integration=require(_0x92b0('0x5'));var cmContact=require(_0x92b0('0x6'));var script=require(_0x92b0('0x7'));var config=require(_0x92b0('0x8'));var logger=require(_0x92b0('0x9'))('trigger');var ami=require(_0x92b0('0xa'));config['redis']=_[_0x92b0('0xb')](config[_0x92b0('0xc')],{'host':_0x92b0('0xd'),'port':0x18eb});var io=require(_0x92b0('0xe'))(new Redis(config['redis']));var operators={'equals':function(_0xa7cdd2,_0x16f498){return _0xa7cdd2==_0x16f498;},'not_equals':function(_0x2d062e,_0x58b2f7){return _0x2d062e!=_0x58b2f7;}};var barAndWebActions=[_0x92b0('0xf'),_0x92b0('0x2'),_0x92b0('0x10')];function Trigger(_0x1bd3b6){this['triggers']=_0x1bd3b6[_0x92b0('0x11')];this[_0x92b0('0x12')]=_0x1bd3b6[_0x92b0('0x12')];this[_0x92b0('0x13')]=_0x1bd3b6[_0x92b0('0x13')];this[_0x92b0('0x14')]=_0x1bd3b6['templates'];this['voiceExtensions']=_0x1bd3b6[_0x92b0('0x15')];this['zendeskAccounts']=_0x1bd3b6[_0x92b0('0x16')];this['freshdeskAccounts']=_0x1bd3b6[_0x92b0('0x17')];this[_0x92b0('0x18')]=_0x1bd3b6['salesforceAccounts'];this[_0x92b0('0x19')]=_0x1bd3b6[_0x92b0('0x19')];this[_0x92b0('0x1a')]=_0x1bd3b6[_0x92b0('0x1a')];this['deskAccounts']=_0x1bd3b6[_0x92b0('0x1b')];this[_0x92b0('0x1c')]=_0x1bd3b6[_0x92b0('0x1c')];this[_0x92b0('0x1d')]=_0x1bd3b6[_0x92b0('0x1d')];this[_0x92b0('0x1e')]=_0x1bd3b6[_0x92b0('0x1e')];this['freshsalesAccounts']=_0x1bd3b6[_0x92b0('0x1f')];this['accounts']={'zendesk':this[_0x92b0('0x16')],'salesforce':this[_0x92b0('0x18')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x92b0('0x1a')],'desk':this['deskAccounts'],'vtiger':this[_0x92b0('0x1c')],'dynamics365':this[_0x92b0('0x1e')],'freshsales':this[_0x92b0('0x1f')],'servicenow':this[_0x92b0('0x1d')]};ami['on'](_0x92b0('0x20'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x23'),this['syncCustomEvent'][_0x92b0('0x22')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x24'),this[_0x92b0('0x21')]['bind'](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x25'),this[_0x92b0('0x21')]['bind'](this));ami['on'](_0x92b0('0x26'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x92b0('0x28'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x29'),this[_0x92b0('0x21')]['bind'](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x2a'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x2b'),this[_0x92b0('0x2c')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x2d'),this['syncAgentDial'][_0x92b0('0x22')](this));ami['on']('custom:dialend',this[_0x92b0('0x2c')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x2e'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x2f'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on']('custom:substatus',this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x92b0('0x31'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on']('custom:acceptmessage',this[_0x92b0('0x21')]['bind'](this));ami['on'](_0x92b0('0x32'),this[_0x92b0('0x21')][_0x92b0('0x22')](this));ami['on'](_0x92b0('0x33'),this[_0x92b0('0x21')]['bind'](this));}Trigger[_0x92b0('0x34')]['emit']=function(_0x702cd6,_0x331c11,_0x1c0474){logger[_0x92b0('0x35')](_0x702cd6,_0x331c11,JSON['stringify'](_0x1c0474));io['to'](_0x702cd6)[_0x92b0('0x36')](_0x331c11,_0x1c0474);};Trigger['prototype'][_0x92b0('0x21')]=function(_0x5e8690){var _0x52c9be=_[_0x92b0('0x37')](_0x5e8690);if(typeof _0x52c9be[_0x92b0('0x38')]===_0x92b0('0x39')){_0x52c9be[_0x92b0('0x38')]='voice';}logger['debug'](_0x92b0('0x21'),util[_0x92b0('0x3a')](_0x52c9be,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x52c9be);};Trigger['prototype'][_0x92b0('0x2c')]=function(_0x16afc9){if(this[_0x92b0('0x12')][_0x16afc9[_0x92b0('0x3b')]]){this[_0x92b0('0x21')](_0x16afc9);}};Trigger[_0x92b0('0x34')]['checkTriggers']=function(_0x5d3f7a){var _0x5e20e7;for(var _0x4ad3d3 in this[_0x92b0('0x11')]){if(this[_0x92b0('0x11')][_0x92b0('0x3c')](_0x4ad3d3)){if(this[_0x92b0('0x11')][_0x4ad3d3][_0x92b0('0x3d')]){_0x5e20e7=this[_0x92b0('0x3e')](this['triggers'][_0x4ad3d3],_0x5d3f7a);if(_0x5e20e7){_[_0x92b0('0x3f')](_0x5d3f7a,_0x5d3f7a[_0x92b0('0x40')]);for(var _0x33efea=0x0,_0x5b702a,_0x109b61,_0x203377;_0x33efea0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x326f,0xd1));var _0xf326=function(_0x4ef0fd,_0x4d4282){_0x4ef0fd=_0x4ef0fd-0x0;var _0x35910a=_0x326f[_0x4ef0fd];return _0x35910a;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ 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 88e17dd..4a7894c 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 _0x4a71=['idField','substring','indexOf','content','ticketType','incident','assign','getString','Descriptions','/contacts(','/systemusers(','userId','Fields','callDirection','queue','Subjects','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','util','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','resolve','data5','POST','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','body','headers','odata-entityid','lastIndexOf','enduserId','message','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','nameField','customField'];(function(_0x14d3f6,_0x46d526){var _0x46289a=function(_0x2afa4b){while(--_0x2afa4b){_0x14d3f6['push'](_0x14d3f6['shift']());}};_0x46289a(++_0x46d526);}(_0x4a71,0x1d8));var _0x14a7=function(_0x261e73,_0x7768f3){_0x261e73=_0x261e73-0x0;var _0x5a1e03=_0x4a71[_0x261e73];return _0x5a1e03;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require(_0x14a7('0x0'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x14a7('0x1'))(_0x14a7('0x2'));var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x14a7('0x3')],{'host':_0x14a7('0x4'),'port':0x18eb});var io=require(_0x14a7('0x5'))(new Redis(config[_0x14a7('0x3')]));function getAuthToken(_0xc38463,_0x545020,_0xe7101e){if(_0xc38463[_0x14a7('0x6')]){_0xc38463['remoteUri']=_0xc38463[_0x14a7('0x7')][_0x14a7('0x8')];_0xc38463[_0x14a7('0x9')]=_0xc38463[_0x14a7('0x7')]['data2'];return Promise[_0x14a7('0xa')](_0xc38463[_0x14a7('0x7')][_0x14a7('0xb')]);}var _0x5a46b1={'method':_0x14a7('0xc'),'uri':_0x545020,'form':{'client_id':_0xc38463['clientId'],'resource':_0xc38463[_0x14a7('0xd')],'username':_0xc38463[_0x14a7('0xe')],'password':_0xc38463[_0x14a7('0xf')],'grant_type':_0x14a7('0xf'),'client_secret':_0xc38463[_0x14a7('0x10')]},'json':!![]};return rp(_0x5a46b1)[_0x14a7('0x11')](function(_0x36d5de){return _0x36d5de[_0x14a7('0x12')];})[_0x14a7('0x13')](function(_0x2d4895){logger[_0x14a7('0x14')]('['+[_0xe7101e[_0x14a7('0x15')]()]+_0x14a7('0x16'));return _0x2d4895['message'];});}function getUser(_0x22af3e,_0xadd30a,_0x23671c,_0x312fc8,_0x510d25,_0x48237c){return new Promise(function(_0x52305e,_0x111e03){return getAuthToken(_0xadd30a,_0x312fc8,_0x48237c)[_0x14a7('0x11')](function(_0x3a5657){var _0x33dabd={'method':_0x14a7('0x17'),'uri':_0x510d25+_0x14a7('0x18'),'headers':{'Authorization':_0x14a7('0x19')+_0x3a5657,'OData-Version':_0x14a7('0x1a')},'json':!![]};return rp(_0x33dabd);})[_0x14a7('0x11')](function(_0x3835f5){var _0x16a563=_0x3835f5[_0x14a7('0x1b')];var _0x2bb351=![];var _0x37e236=null;if(!_[_0x14a7('0x1c')](_0x23671c)){if(intUtil[_0x14a7('0x1d')](_0x23671c[_0x14a7('0x1e')])){_0x22af3e['userEmail']=_0x23671c[_0x14a7('0x1e')];for(_0x37e236=0x0;_0x37e236<_0x16a563[_0x14a7('0x1f')];_0x37e236++){if(_0x16a563[_0x37e236][_0x14a7('0x20')]===_0x23671c[_0x14a7('0x1e')]&&!_0x16a563[_0x37e236][_0x14a7('0x21')]){_0x2bb351=!![];logger[_0x14a7('0x22')]('['+[_0x48237c['toUpperCase']()]+_0x14a7('0x23')+_0x16a563[_0x37e236][_0x14a7('0x24')]+'!');_0x22af3e['userId']=_0x16a563[_0x37e236][_0x14a7('0x24')];}}}}if(!_0x2bb351){logger['info']('['+[_0x48237c[_0x14a7('0x15')]()]+_0x14a7('0x25'));_0x22af3e['userEmail']=_0xadd30a[_0x14a7('0xe')];for(_0x37e236=0x0;_0x37e236<_0x16a563[_0x14a7('0x1f')];_0x37e236++){if(_0x16a563[_0x37e236][_0x14a7('0x20')]===_0xadd30a['username']){_0x22af3e['userId']=_0x16a563[_0x37e236]['systemuserid'];}}}_0x52305e(_0x22af3e);})[_0x14a7('0x13')](function(_0x3e5622){_0x111e03(_0x3e5622['message']);});});}function createEndUser(_0x5e51a0,_0x4c4d56,_0x14bfc3,_0x7fc7cb,_0x3c91ea,_0x272e95,_0x265b15){return new Promise(function(_0x56d221,_0x59a2b4){return getAuthToken(_0x4c4d56,_0x14bfc3,_0x272e95)[_0x14a7('0x11')](function(_0x53fa13){var _0x826e7a=_0x272e95[_0x14a7('0x26')]()===_0x14a7('0x27')?_0x3c91ea[_0x14a7('0x28')]:_0x3c91ea[_0x14a7('0x29')];var _0x25c4db={'method':'POST','uri':_0x7fc7cb+_0x14a7('0x2a'),'body':{'fullname':_0x826e7a,'firstname':_0x826e7a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x5e51a0['userId']+')'},'headers':{'Authorization':_0x14a7('0x19')+_0x53fa13,'OData-Version':_0x14a7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x25c4db[_0x14a7('0x2b')][_0x265b15]=_0x826e7a;return rp(_0x25c4db);})[_0x14a7('0x11')](function(_0x270a23){var _0x1eb6d0=_0x270a23[_0x14a7('0x2c')][_0x14a7('0x2d')];var _0x277fce=_0x1eb6d0['substring'](_0x1eb6d0[_0x14a7('0x2e')]('(')+0x1,_0x1eb6d0[_0x14a7('0x2e')](')'));_0x5e51a0[_0x14a7('0x2f')]=_0x277fce;_0x56d221(_0x5e51a0);})['catch'](function(_0x2c63ba){_0x59a2b4(_0x2c63ba[_0x14a7('0x30')]);});});}function getEndUser(_0x445c03,_0x2cd0ae,_0x620b8,_0x5cd180,_0xd6c58a,_0x44ae00,_0x3d5ff8,_0x4ff460){var _0x43fbcc=_0x44ae00[_0x14a7('0x26')]()===_0x14a7('0x27')?_0xd6c58a['destcalleridnum']:_0xd6c58a[_0x14a7('0x29')];return getAuthToken(_0x2cd0ae,_0x620b8,_0x44ae00)[_0x14a7('0x11')](function(_0x59eed4){_0x4ff460=_0x4ff460?_0x4ff460:_0x14a7('0x31');var _0x38234d={'method':'GET','uri':_0x5cd180+_0x14a7('0x32')+_0x4ff460+_0x14a7('0x33')+_0x4ff460+_0x14a7('0x34')+_0x43fbcc[_0x14a7('0x35')]('+','%2b')+'\x27','headers':{'Authorization':_0x14a7('0x19')+_0x59eed4,'If-None-Match':null,'OData-Version':_0x14a7('0x1a')},'json':!![]};return rp(_0x38234d);})['then'](function(_0xde6f3e){var _0x32abf4=![];if(!_0xde6f3e)return _0x32abf4;var _0x29f037=_0xde6f3e[_0x14a7('0x1b')];for(var _0x95aff7=0x0;_0x95aff7<_0x29f037[_0x14a7('0x1f')];_0x95aff7++){if(_0x29f037[_0x95aff7][_0x4ff460]===_0x43fbcc){_0x32abf4=!![];_0x445c03['enduserId']=_0x29f037[_0x95aff7][_0x14a7('0x36')];}}return _0x32abf4;})[_0x14a7('0x11')](function(_0x28274d){if(_0x28274d)return _0x445c03;if(_0x3d5ff8===_0x14a7('0x37')){logger[_0x14a7('0x22')]('['+[_0x44ae00['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x445c03;}return createEndUser(_0x445c03,_0x2cd0ae,_0x620b8,_0x5cd180,_0xd6c58a,_0x44ae00,_0x4ff460)[_0x14a7('0x11')](function(_0x51d232){logger[_0x14a7('0x22')]('['+[_0x44ae00[_0x14a7('0x15')]()]+_0x14a7('0x38'),_0x51d232['enduserId']);return _0x51d232;});});}function getCustomFields(_0x5123b4,_0x5d378e,_0x53f5eb){var _0x19dd70={};if(_0x5123b4[_0x14a7('0x1f')]>0x0){_[_0x14a7('0x39')](_0x5123b4,function(_0x5508ff){if(_[_0x14a7('0x3a')]([_0x14a7('0x3b'),_0x14a7('0x3c')],_0x5508ff['type'])&&_0x5508ff[_0x14a7('0x3d')]&&!_0x5508ff[_0x14a7('0x3e')]){var _0x253bd3=_0x5508ff[_0x14a7('0x3f')][_0x14a7('0x26')]();var _0x532b01=_0x253bd3[_0x14a7('0x40')](0x0,_0x253bd3[_0x14a7('0x41')]('_'));var _0x2ac8bd=_0x253bd3['substring'](_0x253bd3['indexOf']('_')+0x1);if(_0x532b01===_0x53f5eb){_0x19dd70[_0x2ac8bd]=_0x5508ff[_0x14a7('0x42')];}}});}return _0x19dd70;}function getTicket(_0x537947,_0x40b28f,_0xff1e62,_0x4041a0,_0x39d8ee,_0x16f366,_0x2f68a1){return new Promise(function(_0x43dd59,_0x151981){var _0x46e822;return getAuthToken(_0x40b28f,_0xff1e62,_0x2f68a1)[_0x14a7('0x11')](function(_0x1b0b85){if(_0x16f366[_0x14a7('0x43')]===_0x14a7('0x44')){_0x46e822={'method':_0x14a7('0xc'),'uri':_0x4041a0+'incidents','body':Object[_0x14a7('0x45')]({},{'title':intUtil['getString'](_0x16f366['Subjects'],_0x39d8ee,'\x20'),'description':intUtil[_0x14a7('0x46')](_0x16f366[_0x14a7('0x47')],_0x39d8ee,'\x0a'),'customerid_contact@odata.bind':_0x537947[_0x14a7('0x2f')]?_0x14a7('0x48')+_0x537947[_0x14a7('0x2f')]+')':undefined,'ownerid@odata.bind':_0x14a7('0x49')+_0x537947[_0x14a7('0x4a')]+')','caseorigincode':'1'},getCustomFields(_0x16f366[_0x14a7('0x4b')],_0x39d8ee,_0x16f366['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x1b0b85,'OData-Version':_0x14a7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x16f366[_0x14a7('0x43')]==='phonecall'){var _0x3adf45=_0x537947[_0x14a7('0x2f')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x537947['userId']+')','participationtypemask':_0x537947[_0x14a7('0x4c')]===_0x14a7('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x14a7('0x48')+_0x537947[_0x14a7('0x2f')]+')','participationtypemask':_0x537947[_0x14a7('0x4c')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x14a7('0x49')+_0x537947['userId']+')','participationtypemask':_0x537947['callDirection']===_0x14a7('0x4d')?0x2:0x1}];_0x46e822={'method':'POST','uri':_0x4041a0+'phonecalls','body':Object[_0x14a7('0x45')]({},{'subject':intUtil[_0x14a7('0x46')](_0x16f366[_0x14a7('0x4e')],_0x39d8ee,'\x20'),'phonenumber':String(_0x39d8ee['calleridnum']),'description':intUtil[_0x14a7('0x46')](_0x16f366[_0x14a7('0x47')],_0x39d8ee,'\x0a'),'regardingobjectid_contact@odata.bind':_0x537947[_0x14a7('0x2f')]?'/contacts('+_0x537947['enduserId']+')':undefined,'ownerid@odata.bind':_0x14a7('0x49')+_0x537947[_0x14a7('0x4a')]+')','directioncode':_0x537947[_0x14a7('0x4c')]==='queue'?![]:!![],'phonecall_activity_parties':_0x3adf45},getCustomFields(_0x16f366['Fields'],_0x39d8ee,_0x16f366['ticketType'])),'headers':{'Authorization':_0x14a7('0x19')+_0x1b0b85,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x46e822);})[_0x14a7('0x11')](function(_0x4176e4){var _0x430861=_0x4176e4[_0x14a7('0x2c')][_0x14a7('0x2d')];var _0x15094d=_0x430861['substring'](_0x430861[_0x14a7('0x2e')]('(')+0x1,_0x430861[_0x14a7('0x2e')](')'));_0x537947[_0x14a7('0x4f')]=_0x15094d;_0x43dd59(_0x537947);})[_0x14a7('0x13')](function(_0x8bcef5){_0x151981(_0x8bcef5[_0x14a7('0x30')]);});});}function emit(_0x34db97,_0x4e1f31,_0x54baa2,_0x582ce3){var _0x5c93b6={'uri':util[_0x14a7('0x50')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x34db97,_0x54baa2,_0x582ce3)};io['to'](util[_0x14a7('0x50')](_0x14a7('0x51'),_0x4e1f31))[_0x14a7('0x52')](_0x14a7('0x53'),_0x5c93b6);}exports['cs']=function(_0x1832bd,_0x3ac787,_0x110a3a,_0x550866,_0x131e92,_0x65087a,_0x4f57e7,_0x4c997a){var _0x5e767f={};_0x65087a[_0x14a7('0xd')]=_0x65087a[_0x14a7('0x6')]?intUtil[_0x14a7('0x54')](_0x65087a['CloudProvider']['data7']):intUtil[_0x14a7('0x54')](_0x65087a['remoteUri']);_0x65087a['serverUrl']=intUtil[_0x14a7('0x54')](_0x65087a[_0x14a7('0x55')]);_0x5e767f[_0x14a7('0x4c')]=_0x4c997a===_0x14a7('0x4d')||_0x4c997a===_0x14a7('0x56')?_0x14a7('0x4d'):'outbound';var _0x23a7ec=_0x65087a[_0x14a7('0x6')]?util[_0x14a7('0x50')](_0x14a7('0x57'),_0x65087a[_0x14a7('0x7')][_0x14a7('0x8')]):util[_0x14a7('0x50')]('%s/api/data/v9.0/',_0x65087a['remoteUri']);var _0x434c63=util[_0x14a7('0x50')](_0x14a7('0x58'),_0x65087a[_0x14a7('0x9')]);var _0x4a48af=util['format'](_0x14a7('0x59'),_0x65087a['serverUrl'],_0x3ac787[_0x14a7('0x5a')],md5(_0x3ac787['uniqueid']));if(_0x131e92&&_0x131e92[_0x14a7('0x5b')]){logger[_0x14a7('0x22')](_0x14a7('0x5c'),_0x14a7('0x5d'));_0x3ac787[_0x14a7('0x5e')]=_0x4a48af;}else if(_0x4f57e7&&_0x4f57e7[_0x14a7('0x5f')]&&_0x4f57e7[_0x14a7('0x5f')]!=='none'){logger['info'](_0x14a7('0x60'),'Recording\x20is\x20enabled!');_0x3ac787[_0x14a7('0x5e')]=_0x4a48af;}else{_0x3ac787[_0x14a7('0x5e')]='';}return getUser(_0x5e767f,_0x65087a,_0x550866,_0x434c63,_0x23a7ec,_0x4c997a)[_0x14a7('0x11')](function(_0x19231a){logger[_0x14a7('0x22')]('['+_0x4c997a[_0x14a7('0x15')]()+']\x20The\x20User\x20ID\x20is:',_0x19231a[_0x14a7('0x4a')]);logger[_0x14a7('0x22')]('['+_0x4c997a[_0x14a7('0x15')]()+_0x14a7('0x61'),_0x19231a[_0x14a7('0x62')]);return getEndUser(_0x19231a,_0x65087a,_0x434c63,_0x23a7ec,_0x3ac787,_0x4c997a,_0x110a3a[_0x14a7('0x63')],_0x110a3a[_0x14a7('0x64')]);})[_0x14a7('0x11')](function(_0x5affe4){logger[_0x14a7('0x22')]('['+_0x4c997a[_0x14a7('0x15')]()+_0x14a7('0x65'),_0x5affe4[_0x14a7('0x2f')]);logger['info']('['+_0x4c997a[_0x14a7('0x15')]()+_0x14a7('0x66'),_0x3ac787[_0x14a7('0x29')]);return getTicket(_0x5affe4,_0x65087a,_0x434c63,_0x23a7ec,_0x3ac787,_0x110a3a,_0x4c997a);})['then'](function(_0x15065f){logger[_0x14a7('0x22')](util[_0x14a7('0x50')]('['+_0x4c997a[_0x14a7('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x110a3a[_0x14a7('0x43')],_0x15065f['ticketId']));logger[_0x14a7('0x22')](util['format']('['+_0x4c997a['toUpperCase']()+_0x14a7('0x67'),_0x4c997a));if(_0x4c997a!==_0x14a7('0x56')&&_0x110a3a[_0x14a7('0x68')]){logger[_0x14a7('0x22')]('['+_0x4c997a['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x65087a['remoteUri'],_0x550866[_0x14a7('0x69')],_0x110a3a[_0x14a7('0x43')],_0x15065f[_0x14a7('0x4f')]);}})[_0x14a7('0x13')](function(_0x5d0e96){logger[_0x14a7('0x14')]('['+_0x4c997a[_0x14a7('0x15')]()+_0x14a7('0x6a'),_0x5d0e96[_0x14a7('0x30')]);console[_0x14a7('0x14')]('Error\x20running\x20Dynamics365\x20integration',_0x5d0e96);});}; \ No newline at end of file +var _0x5b44=['Bearer\x20','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','outbound','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','value','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','customField','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','4.0','phonecall','callDirection','queue','phonecalls','assign','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','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',']\x20Call\x20direction:\x20%s','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','error','Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','POST','remoteUri','password','clientSecret','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x5b44,0x130));var _0x45b4=function(_0x43511b,_0x47ceed){_0x43511b=_0x43511b-0x0;var _0x1e3f3f=_0x5b44[_0x43511b];return _0x1e3f3f;};'use strict';var _=require(_0x45b4('0x0'));var rp=require('request-promise');var util=require(_0x45b4('0x1'));var intUtil=require(_0x45b4('0x2'));var md5=require(_0x45b4('0x3'));var Redis=require(_0x45b4('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x45b4('0x5'));config['redis']=_[_0x45b4('0x6')](config[_0x45b4('0x7')],{'host':_0x45b4('0x8'),'port':0x18eb});var io=require(_0x45b4('0x9'))(new Redis(config[_0x45b4('0x7')]));function getAuthToken(_0x23214e,_0x8305fd,_0x52503e){if(_0x23214e[_0x45b4('0xa')]){_0x23214e['remoteUri']=_0x23214e[_0x45b4('0xb')][_0x45b4('0xc')];_0x23214e[_0x45b4('0xd')]=_0x23214e[_0x45b4('0xb')]['data2'];return Promise['resolve'](_0x23214e[_0x45b4('0xb')]['data5']);}var _0x3456fb={'method':_0x45b4('0xe'),'uri':_0x8305fd,'form':{'client_id':_0x23214e['clientId'],'resource':_0x23214e[_0x45b4('0xf')],'username':_0x23214e['username'],'password':_0x23214e[_0x45b4('0x10')],'grant_type':_0x45b4('0x10'),'client_secret':_0x23214e[_0x45b4('0x11')]},'json':!![]};return rp(_0x3456fb)['then'](function(_0x4beefe){return _0x4beefe['access_token'];})['catch'](function(_0x2ffb5d){logger['error']('['+[_0x52503e[_0x45b4('0x12')]()]+_0x45b4('0x13'));return _0x2ffb5d[_0x45b4('0x14')];});}function getUser(_0x4ae612,_0x18b2ff,_0x4cac1e,_0x430cd6,_0x3471da,_0x396006){return new Promise(function(_0x2f628b,_0x3f61b6){return getAuthToken(_0x18b2ff,_0x430cd6,_0x396006)[_0x45b4('0x15')](function(_0x4a8b23){var _0x687e7f={'method':_0x45b4('0x16'),'uri':_0x3471da+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x45b4('0x17')+_0x4a8b23,'OData-Version':'4.0'},'json':!![]};return rp(_0x687e7f);})[_0x45b4('0x15')](function(_0x2e3954){var _0x527933=_0x2e3954['value'];var _0x3c1b68=![];var _0x5659c9=null;if(!_[_0x45b4('0x18')](_0x4cac1e)){if(intUtil[_0x45b4('0x19')](_0x4cac1e['email'])){_0x4ae612[_0x45b4('0x1a')]=_0x4cac1e[_0x45b4('0x1b')];for(_0x5659c9=0x0;_0x5659c9<_0x527933[_0x45b4('0x1c')];_0x5659c9++){if(_0x527933[_0x5659c9][_0x45b4('0x1d')]===_0x4cac1e[_0x45b4('0x1b')]&&!_0x527933[_0x5659c9][_0x45b4('0x1e')]){_0x3c1b68=!![];logger[_0x45b4('0x1f')]('['+[_0x396006[_0x45b4('0x12')]()]+_0x45b4('0x20')+_0x527933[_0x5659c9][_0x45b4('0x21')]+'!');_0x4ae612[_0x45b4('0x22')]=_0x527933[_0x5659c9][_0x45b4('0x21')];}}}}if(!_0x3c1b68){logger[_0x45b4('0x1f')]('['+[_0x396006[_0x45b4('0x12')]()]+_0x45b4('0x23'));_0x4ae612[_0x45b4('0x1a')]=_0x18b2ff[_0x45b4('0x24')];for(_0x5659c9=0x0;_0x5659c9<_0x527933[_0x45b4('0x1c')];_0x5659c9++){if(_0x527933[_0x5659c9][_0x45b4('0x1d')]===_0x18b2ff[_0x45b4('0x24')]){_0x4ae612[_0x45b4('0x22')]=_0x527933[_0x5659c9][_0x45b4('0x21')];}}}_0x2f628b(_0x4ae612);})[_0x45b4('0x25')](function(_0x58e771){_0x3f61b6(_0x58e771[_0x45b4('0x14')]);});});}function createEndUser(_0x287934,_0x229631,_0x407acd,_0x25a9e9,_0x4abd27,_0xa4d0ad,_0x470ffa){return new Promise(function(_0xce3ae3,_0x14c18e){return getAuthToken(_0x229631,_0x407acd,_0xa4d0ad)[_0x45b4('0x15')](function(_0x49432f){var _0x124108=_0xa4d0ad['toLowerCase']()===_0x45b4('0x26')?_0x4abd27['destcalleridnum']:_0x4abd27[_0x45b4('0x27')];var _0x1e14c5={'method':'POST','uri':_0x25a9e9+_0x45b4('0x28'),'body':{'fullname':_0x124108,'firstname':_0x124108,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x45b4('0x29')+_0x287934[_0x45b4('0x22')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x49432f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x1e14c5[_0x45b4('0x2a')][_0x470ffa]=_0x124108;return rp(_0x1e14c5);})['then'](function(_0x477803){var _0x3bafdf=_0x477803[_0x45b4('0x2b')][_0x45b4('0x2c')];var _0x2bd24e=_0x3bafdf[_0x45b4('0x2d')](_0x3bafdf['lastIndexOf']('(')+0x1,_0x3bafdf[_0x45b4('0x2e')](')'));_0x287934[_0x45b4('0x2f')]=_0x2bd24e;_0xce3ae3(_0x287934);})[_0x45b4('0x25')](function(_0x3b9f28){_0x14c18e(_0x3b9f28[_0x45b4('0x14')]);});});}function getEndUser(_0x5e8a91,_0x53d429,_0x25a3de,_0x46b9ec,_0x3e0997,_0x26e7d5,_0x2ef4ae,_0x25beec){var _0x1add1b=_0x26e7d5['toLowerCase']()===_0x45b4('0x26')?_0x3e0997[_0x45b4('0x30')]:_0x3e0997[_0x45b4('0x27')];return getAuthToken(_0x53d429,_0x25a3de,_0x26e7d5)[_0x45b4('0x15')](function(_0x3fabb4){_0x25beec=_0x25beec?_0x25beec:_0x45b4('0x31');var _0x2f4655={'method':_0x45b4('0x16'),'uri':_0x46b9ec+'contacts?$select='+_0x25beec+_0x45b4('0x32')+_0x25beec+_0x45b4('0x33')+_0x1add1b[_0x45b4('0x34')]('+',_0x45b4('0x35'))+'\x27','headers':{'Authorization':_0x45b4('0x17')+_0x3fabb4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2f4655);})[_0x45b4('0x15')](function(_0x360114){var _0x42f7bb=![];if(!_0x360114)return _0x42f7bb;var _0x57ed64=_0x360114[_0x45b4('0x36')];for(var _0x2e4824=0x0;_0x2e4824<_0x57ed64[_0x45b4('0x1c')];_0x2e4824++){if(_0x57ed64[_0x2e4824][_0x25beec]===_0x1add1b){_0x42f7bb=!![];_0x5e8a91['enduserId']=_0x57ed64[_0x2e4824][_0x45b4('0x37')];}}return _0x42f7bb;})['then'](function(_0x159c95){if(_0x159c95)return _0x5e8a91;if(_0x2ef4ae==='nothing'){logger['info']('['+[_0x26e7d5[_0x45b4('0x12')]()]+_0x45b4('0x38'));return _0x5e8a91;}return createEndUser(_0x5e8a91,_0x53d429,_0x25a3de,_0x46b9ec,_0x3e0997,_0x26e7d5,_0x25beec)[_0x45b4('0x15')](function(_0x1fe328){logger['info']('['+[_0x26e7d5[_0x45b4('0x12')]()]+']\x20Enduser\x20created!',_0x1fe328['enduserId']);return _0x1fe328;});});}function getCustomFields(_0x5727c0,_0x9dbd22,_0x46c031){var _0x279001={};if(_0x5727c0['length']>0x0){_[_0x45b4('0x39')](_0x5727c0,function(_0x883a94){if(_[_0x45b4('0x3a')]([_0x45b4('0x3b'),_0x45b4('0x3c')],_0x883a94[_0x45b4('0x3d')])&&_0x883a94['nameField']&&!_0x883a94[_0x45b4('0x3e')]){var _0x4273c3=_0x883a94['idField']['toLowerCase']();var _0x3de0af=_0x4273c3[_0x45b4('0x2d')](0x0,_0x4273c3['indexOf']('_'));var _0x4e3b06=_0x4273c3[_0x45b4('0x2d')](_0x4273c3['indexOf']('_')+0x1);if(_0x3de0af===_0x46c031){_0x279001[_0x4e3b06]=_0x883a94[_0x45b4('0x3f')];}}});}return _0x279001;}function getTicket(_0x49ad89,_0x333c20,_0x485ef3,_0x4a51e4,_0x588844,_0x3c4d7c,_0x554936){return new Promise(function(_0x24e2ba,_0x36df99){var _0x18b9e4;return getAuthToken(_0x333c20,_0x485ef3,_0x554936)['then'](function(_0x48df93){if(_0x3c4d7c[_0x45b4('0x40')]===_0x45b4('0x41')){_0x18b9e4={'method':_0x45b4('0xe'),'uri':_0x4a51e4+_0x45b4('0x42'),'body':Object['assign']({},{'title':intUtil[_0x45b4('0x43')](_0x3c4d7c[_0x45b4('0x44')],_0x588844,'\x20'),'description':intUtil[_0x45b4('0x43')](_0x3c4d7c[_0x45b4('0x45')],_0x588844,'\x0a'),'customerid_contact@odata.bind':_0x49ad89[_0x45b4('0x2f')]?_0x45b4('0x46')+_0x49ad89[_0x45b4('0x2f')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x49ad89[_0x45b4('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x3c4d7c[_0x45b4('0x47')],_0x588844,_0x3c4d7c[_0x45b4('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x48df93,'OData-Version':_0x45b4('0x48')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3c4d7c[_0x45b4('0x40')]===_0x45b4('0x49')){var _0xdb14d2=_0x49ad89[_0x45b4('0x2f')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x49ad89['userId']+')','participationtypemask':_0x49ad89[_0x45b4('0x4a')]===_0x45b4('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x45b4('0x46')+_0x49ad89['enduserId']+')','participationtypemask':_0x49ad89['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x45b4('0x29')+_0x49ad89[_0x45b4('0x22')]+')','participationtypemask':_0x49ad89['callDirection']===_0x45b4('0x4b')?0x2:0x1}];_0x18b9e4={'method':_0x45b4('0xe'),'uri':_0x4a51e4+_0x45b4('0x4c'),'body':Object[_0x45b4('0x4d')]({},{'subject':intUtil[_0x45b4('0x43')](_0x3c4d7c[_0x45b4('0x44')],_0x588844,'\x20'),'phonenumber':String(_0x588844[_0x45b4('0x27')]),'description':intUtil[_0x45b4('0x43')](_0x3c4d7c[_0x45b4('0x45')],_0x588844,'\x0a'),'regardingobjectid_contact@odata.bind':_0x49ad89[_0x45b4('0x2f')]?'/contacts('+_0x49ad89[_0x45b4('0x2f')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x49ad89[_0x45b4('0x22')]+')','directioncode':_0x49ad89[_0x45b4('0x4a')]===_0x45b4('0x4b')?![]:!![],'phonecall_activity_parties':_0xdb14d2},getCustomFields(_0x3c4d7c[_0x45b4('0x47')],_0x588844,_0x3c4d7c[_0x45b4('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x48df93,'OData-Version':_0x45b4('0x48')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x18b9e4);})[_0x45b4('0x15')](function(_0x385ee1){var _0x570642=_0x385ee1['headers'][_0x45b4('0x2c')];var _0x75e72=_0x570642[_0x45b4('0x2d')](_0x570642[_0x45b4('0x2e')]('(')+0x1,_0x570642[_0x45b4('0x2e')](')'));_0x49ad89[_0x45b4('0x4e')]=_0x75e72;_0x24e2ba(_0x49ad89);})['catch'](function(_0x426d8d){_0x36df99(_0x426d8d['message']);});});}function emit(_0x1e7d20,_0x5cc212,_0x563fd1,_0x2ce898){var _0x4301a2={'uri':util[_0x45b4('0x4f')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x1e7d20,_0x563fd1,_0x2ce898)};io['to'](util['format'](_0x45b4('0x50'),_0x5cc212))[_0x45b4('0x51')](_0x45b4('0x52'),_0x4301a2);}exports['cs']=function(_0x1e685a,_0x1ce384,_0x436d93,_0x24121d,_0x2d6f36,_0x368a39,_0x45715d,_0x3725e8){var _0x5809c2={};_0x368a39[_0x45b4('0xf')]=_0x368a39[_0x45b4('0xa')]?intUtil['stripTrailingSlash'](_0x368a39[_0x45b4('0xb')][_0x45b4('0xc')]):intUtil[_0x45b4('0x53')](_0x368a39['remoteUri']);_0x368a39[_0x45b4('0x54')]=intUtil[_0x45b4('0x53')](_0x368a39[_0x45b4('0x54')]);_0x5809c2['callDirection']=_0x3725e8===_0x45b4('0x4b')||_0x3725e8===_0x45b4('0x55')?_0x45b4('0x4b'):_0x45b4('0x26');var _0x5b4507=_0x368a39['modernAuthentication']?util[_0x45b4('0x4f')](_0x45b4('0x56'),_0x368a39[_0x45b4('0xb')][_0x45b4('0xc')]):util[_0x45b4('0x4f')](_0x45b4('0x56'),_0x368a39['remoteUri']);var _0x32c29e=util['format'](_0x45b4('0x57'),_0x368a39[_0x45b4('0xd')]);var _0x5dc9a9=util[_0x45b4('0x4f')](_0x45b4('0x58'),_0x368a39[_0x45b4('0x54')],_0x1ce384['uniqueid'],md5(_0x1ce384[_0x45b4('0x59')]));if(_0x2d6f36&&_0x2d6f36['monitor_format']){logger[_0x45b4('0x1f')](_0x45b4('0x5a'),_0x45b4('0x5b'));_0x1ce384[_0x45b4('0x5c')]=_0x5dc9a9;}else if(_0x45715d&&_0x45715d[_0x45b4('0x5d')]&&_0x45715d['recordingFormat']!==_0x45b4('0x5e')){logger['info'](_0x45b4('0x5f'),_0x45b4('0x5b'));_0x1ce384[_0x45b4('0x5c')]=_0x5dc9a9;}else{_0x1ce384[_0x45b4('0x5c')]='';}return getUser(_0x5809c2,_0x368a39,_0x24121d,_0x32c29e,_0x5b4507,_0x3725e8)[_0x45b4('0x15')](function(_0x42c012){logger[_0x45b4('0x1f')]('['+_0x3725e8[_0x45b4('0x12')]()+_0x45b4('0x60'),_0x42c012[_0x45b4('0x22')]);logger['info']('['+_0x3725e8['toUpperCase']()+_0x45b4('0x61'),_0x42c012[_0x45b4('0x1a')]);return getEndUser(_0x42c012,_0x368a39,_0x32c29e,_0x5b4507,_0x1ce384,_0x3725e8,_0x436d93[_0x45b4('0x62')],_0x436d93[_0x45b4('0x63')]);})[_0x45b4('0x15')](function(_0x598ce6){logger[_0x45b4('0x1f')]('['+_0x3725e8['toUpperCase']()+_0x45b4('0x64'),_0x598ce6['enduserId']);logger['info']('['+_0x3725e8[_0x45b4('0x12')]()+_0x45b4('0x65'),_0x1ce384['calleridnum']);return getTicket(_0x598ce6,_0x368a39,_0x32c29e,_0x5b4507,_0x1ce384,_0x436d93,_0x3725e8);})[_0x45b4('0x15')](function(_0x31dc90){logger[_0x45b4('0x1f')](util['format']('['+_0x3725e8[_0x45b4('0x12')]()+_0x45b4('0x66'),_0x436d93[_0x45b4('0x40')],_0x31dc90[_0x45b4('0x4e')]));logger['info'](util[_0x45b4('0x4f')]('['+_0x3725e8['toUpperCase']()+_0x45b4('0x67'),_0x3725e8));if(_0x3725e8!=='unmanaged'&&_0x436d93[_0x45b4('0x68')]){logger['info']('['+_0x3725e8[_0x45b4('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x368a39[_0x45b4('0xf')],_0x24121d[_0x45b4('0x69')],_0x436d93[_0x45b4('0x40')],_0x31dc90[_0x45b4('0x4e')]);}})['catch'](function(_0x2a4559){logger['error']('['+_0x3725e8[_0x45b4('0x12')]()+_0x45b4('0x6a'),_0x2a4559['message']);console[_0x45b4('0x6b')](_0x45b4('0x6c'),_0x2a4559);});}; \ 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 a4fed99..da32ec3 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 _0x00bd=['contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','debug','stringify','GET','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','trigger:browser:url','catch','unmanaged','monitor_format','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','Ticket\x20created!','validateEmail','then','length','Agent\x20found!','find'];(function(_0x5733b7,_0x398c82){var _0x25d48a=function(_0x2c29af){while(--_0x2c29af){_0x5733b7['push'](_0x5733b7['shift']());}};_0x25d48a(++_0x398c82);}(_0x00bd,0x8f));var _0xd00b=function(_0x4533ec,_0x325928){_0x4533ec=_0x4533ec-0x0;var _0x452701=_0x00bd[_0x4533ec];return _0x452701;};'use strict';var _=require(_0xd00b('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0xd00b('0x1'));var intUtil=require(_0xd00b('0x2'));var config=require(_0xd00b('0x3'));var logger=require(_0xd00b('0x4'))(_0xd00b('0x5'));config[_0xd00b('0x6')]=_[_0xd00b('0x7')](config['redis'],{'host':_0xd00b('0x8'),'port':0x18eb});var io=require(_0xd00b('0x9'))(new Redis(config[_0xd00b('0x6')]));var headers={'Content-Type':_0xd00b('0xa'),'Accept':_0xd00b('0xa')};function emit(_0x5359f8,_0x377427,_0x15e4e2){io['to'](_0x5359f8)[_0xd00b('0xb')](_0x377427,_0x15e4e2);}function getTicket(_0x899ff,_0x2d8fc7,_0x49e8cb,_0xd8f97b,_0x1f35c0){logger[_0xd00b('0xc')](_0xd00b('0xd'));var _0xc319a4=_[_0xd00b('0xe')]({'responder_id':_0x2d8fc7['id'],'requester_id':_0x49e8cb['id'],'name':util[_0xd00b('0xf')](_0xd00b('0x10'),_0x1f35c0[_0xd00b('0x11')]),'phone':_0x1f35c0[_0xd00b('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd00b('0x13')](_0xd8f97b[_0xd00b('0x14')],_0x1f35c0,'\x20'),'description':intUtil[_0xd00b('0x13')](_0xd8f97b[_0xd00b('0x15')],_0x1f35c0,'
'),'tags':getTags(_0xd8f97b[_0xd00b('0x16')],_0xd00b('0x17'))},getCustomFields(_0xd8f97b[_0xd00b('0x18')],_0x1f35c0));_0xc319a4['custom_fields']=_[_0xd00b('0x19')](_[_0xd00b('0x1a')](_0xc319a4[_0xd00b('0x1b')],'id'),_0xd00b('0x1c'));return request({'uri':util['format'](_0xd00b('0x1d'),_0x899ff[_0xd00b('0x1e')]),'method':'POST','body':_0xc319a4})['then'](function(_0x5765fb){logger[_0xd00b('0xc')](_0xd00b('0x1f'));return _0x5765fb;});}function getUser(_0x573890,_0x3e9b30){if(intUtil[_0xd00b('0x20')](_0x3e9b30)){return request({'uri':util['format']('%s/api/v2/agents',_0x573890['remoteUri']),'qs':{'email':_0x3e9b30}})[_0xd00b('0x21')](function(_0x2e8904){if(_0x2e8904[_0xd00b('0x22')]){logger['info'](_0xd00b('0x23'));return _[_0xd00b('0x24')](_0x2e8904,function(_0x2a4425){return _0x2a4425[_0xd00b('0x25')][_0xd00b('0x26')]===_0x3e9b30;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd00b('0xf')](_0xd00b('0x27'),_0x573890[_0xd00b('0x1e')])})[_0xd00b('0x21')](function(_0x47c5f3){logger[_0xd00b('0xc')]('Admin\x20account\x20selected.');return _0x47c5f3;});}});}else{logger[_0xd00b('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd00b('0xf')](_0xd00b('0x27'),_0x573890[_0xd00b('0x1e')])})[_0xd00b('0x21')](function(_0x53bba9){logger[_0xd00b('0xc')](_0xd00b('0x28'));return _0x53bba9;});}}function getEndUser(_0xd32cff,_0x318f39,_0x196d99){logger[_0xd00b('0xc')](_0xd00b('0x29'),_0x196d99);return request({'uri':util[_0xd00b('0xf')](_0xd00b('0x2a'),_0xd32cff[_0xd00b('0x1e')]),'qs':{'phone':_0x196d99}})[_0xd00b('0x21')](function(_0xf66f4f){if(_0xf66f4f['length']){logger[_0xd00b('0xc')](_0xd00b('0x2b'));return _[_0xd00b('0x24')](_0xf66f4f,{'phone':_0x196d99});}else{logger[_0xd00b('0xc')](_0xd00b('0x2c'));return request({'uri':util[_0xd00b('0xf')]('%s/api/v2/contacts',_0xd32cff['remoteUri']),'method':'POST','body':{'name':_0x318f39,'phone':_0x196d99}})['then'](function(_0x5a2a66){logger['info']('Enduser\x20created.');return _0x5a2a66;});}});}function getAuth(_0x1fd9f3){return util[_0xd00b('0xf')](_0xd00b('0x2d'),new Buffer(_0x1fd9f3['apiKey']+':X')['toString']('base64'));}function request(_0xa5bc2f){logger[_0xd00b('0x2e')]('[HTTP]',JSON[_0xd00b('0x2f')](_0xa5bc2f));return rp(_[_0xd00b('0x7')](_0xa5bc2f,{'method':_0xd00b('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x23df93,_0x4594b5){var _0x5050d5=[];if(_0x23df93&&_0x23df93[_0xd00b('0x22')]>0x0){_0x5050d5=_['map'](_0x23df93,_0x4594b5);}return _0x5050d5;}function getCustomFields(_0x5b3b1,_0x4b9436){var _0x2e63b1=[];var _0x286193={'custom_fields':[]};if(_0x5b3b1[_0xd00b('0x22')]>0x0){_['forEach'](_0x5b3b1,function(_0x2bfc33){if(_[_0xd00b('0x31')]([_0xd00b('0x32'),_0xd00b('0x33')],_0x2bfc33[_0xd00b('0x34')])&&_0x2bfc33[_0xd00b('0x35')]&&!_0x2bfc33[_0xd00b('0x36')]){_0x286193[_0x2bfc33[_0xd00b('0x35')][_0xd00b('0x37')]()]=_0x2bfc33[_0xd00b('0x38')][_0xd00b('0x39')]();}else if(_['includes']([_0xd00b('0x32'),_0xd00b('0x33')],_0x2bfc33[_0xd00b('0x34')])&&_0x2bfc33[_0xd00b('0x3a')]&&_0x2bfc33['customField']){_0x286193[_0xd00b('0x1b')]['push']({'id':_0x2bfc33['idField'],'value':_0x2bfc33[_0xd00b('0x38')][_0xd00b('0x39')]()});}else if(_0x2bfc33[_0xd00b('0x34')]===_0xd00b('0x3b')&&_0x2bfc33[_0xd00b('0x3c')]&&_0x2bfc33[_0xd00b('0x3a')]&&_0x2bfc33[_0xd00b('0x36')]){_0x4b9436[_0x2bfc33[_0xd00b('0x3c')]]&&_0x286193['custom_fields']['push']({'id':_0x2bfc33['idField'],'value':_0x4b9436[_0x2bfc33['variableName']][_0xd00b('0x39')]()});}else if(_0x2bfc33[_0xd00b('0x34')]===_0xd00b('0x3d')&&_0x2bfc33[_0xd00b('0x3e')]&&_0x2bfc33['Variable'][_0xd00b('0x17')]&&_0x2bfc33['idField']&&_0x2bfc33['customField']){_0x4b9436[_0x2bfc33['Variable'][_0xd00b('0x17')][_0xd00b('0x37')]()]&&_0x286193[_0xd00b('0x1b')][_0xd00b('0x3f')]({'id':_0x2bfc33[_0xd00b('0x3a')],'value':_0x4b9436[_0x2bfc33[_0xd00b('0x3e')]['name']['toLowerCase']()][_0xd00b('0x39')]()});}});}return _0x286193;}exports[_0xd00b('0x40')]=function(_0x40a4fb,_0x1102d4,_0x232e07,_0x49992c,_0x33ae4e,_0x583497){var _0x511581,_0x17e667;_0x583497[_0xd00b('0x1e')]=intUtil[_0xd00b('0x41')](_0x583497[_0xd00b('0x1e')]);_0x583497['serverUrl']=intUtil[_0xd00b('0x41')](_0x583497[_0xd00b('0x42')]);if(_0x33ae4e&&_0x33ae4e['monitor_format']){logger[_0xd00b('0xc')](_0xd00b('0x43'),_0xd00b('0x44'));_0x1102d4[_0xd00b('0x45')]=util[_0xd00b('0xf')](_0xd00b('0x46'),_0x583497[_0xd00b('0x42')],_0x1102d4[_0xd00b('0x47')],md5(_0x1102d4[_0xd00b('0x47')]));}else{_0x1102d4[_0xd00b('0x45')]='';}headers[_0xd00b('0x48')]=getAuth(_0x583497);return getUser(_0x583497,_0x49992c['email'])['then'](function(_0x3e0ebe){_0x511581=_0x3e0ebe;logger['info']('The\x20User\x20ID\x20is:',_0x511581['id']);return getEndUser(_0x583497,_0x1102d4[_0xd00b('0x11')],_0x1102d4[_0xd00b('0x12')]);})['then'](function(_0x1c014c){_0x17e667=_0x1c014c;logger[_0xd00b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x17e667['id']);return getTicket(_0x583497,_0x511581,_0x17e667,_0x232e07,_0x1102d4);})[_0xd00b('0x21')](function(_0x48c31f){if(_0x48c31f&&_0x48c31f['id']){logger[_0xd00b('0xc')](_0xd00b('0x1f'));logger[_0xd00b('0xc')]('The\x20Ticket\x20ID\x20is:',_0x48c31f['id']);logger['info'](_0xd00b('0x43'),_0xd00b('0x49'));emit(util[_0xd00b('0xf')](_0xd00b('0x4a'),_0x49992c['name']),'trigger:browser:url',{'uri':util[_0xd00b('0xf')](_0xd00b('0x4b'),_0x583497[_0xd00b('0x1e')],_0x48c31f['id'])});}})['catch'](function(_0x10af6b){logger[_0xd00b('0x4c')](_0xd00b('0x43'),JSON[_0xd00b('0x2f')](_0x10af6b));});};exports[_0xd00b('0x4d')]=function(_0x40aa7f,_0x184768,_0x133ce7,_0x2daca3,_0x46f698,_0x17f781,_0x1579f6){var _0x44e665,_0x2fe01d;_0x17f781[_0xd00b('0x1e')]=intUtil[_0xd00b('0x41')](_0x17f781[_0xd00b('0x1e')]);_0x17f781[_0xd00b('0x42')]=intUtil['stripTrailingSlash'](_0x17f781['serverUrl']);if(_0x1579f6&&_0x1579f6[_0xd00b('0x4e')]&&_0x1579f6['recordingFormat']!=='none'){logger['info'](_0xd00b('0x4f'),_0xd00b('0x44'));_0x184768[_0xd00b('0x45')]=util[_0xd00b('0xf')](_0xd00b('0x46'),_0x17f781[_0xd00b('0x42')],_0x184768[_0xd00b('0x47')],md5(_0x184768['uniqueid']));}headers['Authorization']=getAuth(_0x17f781);return getUser(_0x17f781,_0x2daca3[_0xd00b('0x26')])[_0xd00b('0x21')](function(_0x2db44f){_0x44e665=_0x2db44f;logger[_0xd00b('0xc')](_0xd00b('0x50'),_0x44e665['id']);return getEndUser(_0x17f781,_0x184768[_0xd00b('0x51')],_0x184768[_0xd00b('0x52')]);})[_0xd00b('0x21')](function(_0x5a17ce){_0x2fe01d=_0x5a17ce;logger[_0xd00b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x2fe01d['id']);return getTicket(_0x17f781,_0x44e665,_0x2fe01d,_0x133ce7,_0x184768);})['then'](function(_0x3aedf3){if(_0x3aedf3&&_0x3aedf3['id']){logger[_0xd00b('0xc')](_0xd00b('0x1f'));logger[_0xd00b('0xc')]('The\x20Ticket\x20ID\x20is:',_0x3aedf3['id']);logger['info'](_0xd00b('0x4f'),_0xd00b('0x49'));emit(util['format'](_0xd00b('0x4a'),_0x2daca3[_0xd00b('0x17')]),_0xd00b('0x53'),{'uri':util['format'](_0xd00b('0x4b'),_0x17f781['remoteUri'],_0x3aedf3['id'])});}})[_0xd00b('0x54')](function(_0x3e89cd){logger['error'](_0xd00b('0x4f'),JSON[_0xd00b('0x2f')](_0x3e89cd));});};exports[_0xd00b('0x55')]=function(_0xa0a526,_0x4093b0,_0x1ebdf4,_0x330799,_0x337ba3,_0x2d75c7){var _0x165fb1,_0x9edf58;_0x2d75c7[_0xd00b('0x1e')]=intUtil['stripTrailingSlash'](_0x2d75c7[_0xd00b('0x1e')]);_0x2d75c7['serverUrl']=intUtil['stripTrailingSlash'](_0x2d75c7[_0xd00b('0x42')]);if(_0x337ba3&&_0x337ba3[_0xd00b('0x56')]){logger[_0xd00b('0xc')]('['+_0x4093b0[_0xd00b('0x57')][_0xd00b('0x58')]()+']',_0xd00b('0x44'));_0x4093b0[_0xd00b('0x45')]=util['format'](_0xd00b('0x46'),_0x2d75c7[_0xd00b('0x42')],_0x4093b0['uniqueid'],md5(_0x4093b0[_0xd00b('0x47')]));}else{_0x4093b0['recordingURL']='';}headers[_0xd00b('0x48')]=getAuth(_0x2d75c7);return getUser(_0x2d75c7,'')[_0xd00b('0x21')](function(_0x5d1f82){_0x165fb1=_0x5d1f82;logger[_0xd00b('0xc')]('The\x20User\x20ID\x20is:',_0x165fb1['id']);return getEndUser(_0x2d75c7,_0x4093b0[_0xd00b('0x11')],_0x4093b0['calleridnum']);})[_0xd00b('0x21')](function(_0x1b336b){_0x9edf58=_0x1b336b;logger[_0xd00b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x9edf58['id']);return getTicket(_0x2d75c7,_0x165fb1,_0x9edf58,_0x1ebdf4,_0x4093b0);})[_0xd00b('0x21')](function(_0x534d94){if(_0x534d94){logger['info'](_0xd00b('0x1f'));logger[_0xd00b('0xc')](_0xd00b('0x59'),_0x534d94['id']);}})[_0xd00b('0x54')](function(_0x4d3eda){logger[_0xd00b('0x4c')]('['+_0x4093b0[_0xd00b('0x57')][_0xd00b('0x58')]()+']',JSON['stringify'](_0x4d3eda));});}; \ No newline at end of file +var _0x666b=['length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','push','idField','content','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','catch','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents'];(function(_0x2a53ad,_0x234135){var _0x31b3b6=function(_0x141ec6){while(--_0x141ec6){_0x2a53ad['push'](_0x2a53ad['shift']());}};_0x31b3b6(++_0x234135);}(_0x666b,0x1ba));var _0xb666=function(_0x4c4284,_0x581403){_0x4c4284=_0x4c4284-0x0;var _0x18e0fb=_0x666b[_0x4c4284];return _0x18e0fb;};'use strict';var _=require(_0xb666('0x0'));var rp=require(_0xb666('0x1'));var md5=require('md5');var util=require(_0xb666('0x2'));var Redis=require(_0xb666('0x3'));var intUtil=require(_0xb666('0x4'));var config=require(_0xb666('0x5'));var logger=require('../../../../config/logger')('freshdesk');config[_0xb666('0x6')]=_[_0xb666('0x7')](config['redis'],{'host':_0xb666('0x8'),'port':0x18eb});var io=require(_0xb666('0x9'))(new Redis(config[_0xb666('0x6')]));var headers={'Content-Type':_0xb666('0xa'),'Accept':_0xb666('0xa')};function emit(_0x1396f0,_0x5a0c62,_0x3485da){io['to'](_0x1396f0)[_0xb666('0xb')](_0x5a0c62,_0x3485da);}function getTicket(_0x36849c,_0xddbfcf,_0x46b425,_0x4726d6,_0x18e3a8){logger[_0xb666('0xc')](_0xb666('0xd'));var _0x501792=_[_0xb666('0xe')]({'responder_id':_0xddbfcf['id'],'requester_id':_0x46b425['id'],'name':util[_0xb666('0xf')]('Caller\x20-\x20%s',_0x18e3a8[_0xb666('0x10')]),'phone':_0x18e3a8[_0xb666('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb666('0x12')](_0x4726d6[_0xb666('0x13')],_0x18e3a8,'\x20'),'description':intUtil['getString'](_0x4726d6[_0xb666('0x14')],_0x18e3a8,_0xb666('0x15')),'tags':getTags(_0x4726d6['Tags'],_0xb666('0x16'))},getCustomFields(_0x4726d6[_0xb666('0x17')],_0x18e3a8));_0x501792[_0xb666('0x18')]=_[_0xb666('0x19')](_['keyBy'](_0x501792[_0xb666('0x18')],'id'),_0xb666('0x1a'));return request({'uri':util[_0xb666('0xf')](_0xb666('0x1b'),_0x36849c[_0xb666('0x1c')]),'method':_0xb666('0x1d'),'body':_0x501792})[_0xb666('0x1e')](function(_0x4339df){logger[_0xb666('0xc')](_0xb666('0x1f'));return _0x4339df;});}function getUser(_0x46f931,_0x499315){if(intUtil['validateEmail'](_0x499315)){return request({'uri':util[_0xb666('0xf')](_0xb666('0x20'),_0x46f931[_0xb666('0x1c')]),'qs':{'email':_0x499315}})[_0xb666('0x1e')](function(_0x346715){if(_0x346715[_0xb666('0x21')]){logger['info']('Agent\x20found!');return _['find'](_0x346715,function(_0x4058ba){return _0x4058ba[_0xb666('0x22')][_0xb666('0x23')]===_0x499315;});}else{logger[_0xb666('0xc')](_0xb666('0x24'));return request({'uri':util[_0xb666('0xf')](_0xb666('0x25'),_0x46f931[_0xb666('0x1c')])})['then'](function(_0x217d59){logger[_0xb666('0xc')](_0xb666('0x26'));return _0x217d59;});}});}else{logger[_0xb666('0xc')](_0xb666('0x27'));return request({'uri':util[_0xb666('0xf')](_0xb666('0x25'),_0x46f931[_0xb666('0x1c')])})['then'](function(_0x372cec){logger[_0xb666('0xc')]('Admin\x20account\x20selected.');return _0x372cec;});}}function getEndUser(_0x5b6142,_0x358f3b,_0x4714d6){logger[_0xb666('0xc')](_0xb666('0x28'),_0x4714d6);return request({'uri':util[_0xb666('0xf')](_0xb666('0x29'),_0x5b6142[_0xb666('0x1c')]),'qs':{'phone':_0x4714d6}})[_0xb666('0x1e')](function(_0x3a63be){if(_0x3a63be[_0xb666('0x21')]){logger[_0xb666('0xc')](_0xb666('0x2a'));return _[_0xb666('0x2b')](_0x3a63be,{'phone':_0x4714d6});}else{logger[_0xb666('0xc')](_0xb666('0x2c'));return request({'uri':util['format'](_0xb666('0x29'),_0x5b6142[_0xb666('0x1c')]),'method':_0xb666('0x1d'),'body':{'name':_0x358f3b,'phone':_0x4714d6}})['then'](function(_0x3a8281){logger[_0xb666('0xc')](_0xb666('0x2d'));return _0x3a8281;});}});}function getAuth(_0x11c3d3){return util[_0xb666('0xf')](_0xb666('0x2e'),new Buffer(_0x11c3d3[_0xb666('0x2f')]+':X')[_0xb666('0x30')](_0xb666('0x31')));}function request(_0x4e4251){logger[_0xb666('0x32')](_0xb666('0x33'),JSON[_0xb666('0x34')](_0x4e4251));return rp(_[_0xb666('0x7')](_0x4e4251,{'method':_0xb666('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x155daa,_0x1fd465){var _0x40d9d7=[];if(_0x155daa&&_0x155daa['length']>0x0){_0x40d9d7=_[_0xb666('0x36')](_0x155daa,_0x1fd465);}return _0x40d9d7;}function getCustomFields(_0x400c28,_0x27dece){var _0x160c4c=[];var _0x2951b7={'custom_fields':[]};if(_0x400c28[_0xb666('0x21')]>0x0){_[_0xb666('0x37')](_0x400c28,function(_0x4147b7){if(_[_0xb666('0x38')]([_0xb666('0x39'),_0xb666('0x3a')],_0x4147b7[_0xb666('0x3b')])&&_0x4147b7[_0xb666('0x3c')]&&!_0x4147b7[_0xb666('0x3d')]){_0x2951b7[_0x4147b7['nameField'][_0xb666('0x3e')]()]=_0x4147b7['content'][_0xb666('0x30')]();}else if(_[_0xb666('0x38')]([_0xb666('0x39'),_0xb666('0x3a')],_0x4147b7['type'])&&_0x4147b7['idField']&&_0x4147b7['customField']){_0x2951b7[_0xb666('0x18')][_0xb666('0x3f')]({'id':_0x4147b7[_0xb666('0x40')],'value':_0x4147b7[_0xb666('0x41')]['toString']()});}else if(_0x4147b7[_0xb666('0x3b')]==='variable'&&_0x4147b7[_0xb666('0x42')]&&_0x4147b7[_0xb666('0x40')]&&_0x4147b7[_0xb666('0x3d')]){_0x27dece[_0x4147b7['variableName']]&&_0x2951b7[_0xb666('0x18')][_0xb666('0x3f')]({'id':_0x4147b7[_0xb666('0x40')],'value':_0x27dece[_0x4147b7['variableName']][_0xb666('0x30')]()});}else if(_0x4147b7['type']===_0xb666('0x43')&&_0x4147b7[_0xb666('0x44')]&&_0x4147b7['Variable']['name']&&_0x4147b7[_0xb666('0x40')]&&_0x4147b7[_0xb666('0x3d')]){_0x27dece[_0x4147b7[_0xb666('0x44')][_0xb666('0x16')][_0xb666('0x3e')]()]&&_0x2951b7[_0xb666('0x18')][_0xb666('0x3f')]({'id':_0x4147b7['idField'],'value':_0x27dece[_0x4147b7['Variable']['name'][_0xb666('0x3e')]()][_0xb666('0x30')]()});}});}return _0x2951b7;}exports['queue']=function(_0x12ae66,_0x1b00ce,_0x5570d2,_0x1d6745,_0x12f2cf,_0x303552){var _0x5c1240,_0x1263a8;_0x303552[_0xb666('0x1c')]=intUtil[_0xb666('0x45')](_0x303552[_0xb666('0x1c')]);_0x303552[_0xb666('0x46')]=intUtil[_0xb666('0x45')](_0x303552[_0xb666('0x46')]);if(_0x12f2cf&&_0x12f2cf[_0xb666('0x47')]){logger['info'](_0xb666('0x48'),'Recording\x20is\x20enabled!');_0x1b00ce[_0xb666('0x49')]=util[_0xb666('0xf')](_0xb666('0x4a'),_0x303552[_0xb666('0x46')],_0x1b00ce[_0xb666('0x4b')],md5(_0x1b00ce[_0xb666('0x4b')]));}else{_0x1b00ce[_0xb666('0x49')]='';}headers['Authorization']=getAuth(_0x303552);return getUser(_0x303552,_0x1d6745['email'])[_0xb666('0x1e')](function(_0x25e0b3){_0x5c1240=_0x25e0b3;logger['info'](_0xb666('0x4c'),_0x5c1240['id']);return getEndUser(_0x303552,_0x1b00ce[_0xb666('0x10')],_0x1b00ce[_0xb666('0x11')]);})[_0xb666('0x1e')](function(_0x5dc21f){_0x1263a8=_0x5dc21f;logger[_0xb666('0xc')](_0xb666('0x4d'),_0x1263a8['id']);return getTicket(_0x303552,_0x5c1240,_0x1263a8,_0x5570d2,_0x1b00ce);})['then'](function(_0x82ca71){if(_0x82ca71&&_0x82ca71['id']){logger[_0xb666('0xc')](_0xb666('0x1f'));logger[_0xb666('0xc')]('The\x20Ticket\x20ID\x20is:',_0x82ca71['id']);logger[_0xb666('0xc')](_0xb666('0x48'),_0xb666('0x4e'));emit(util[_0xb666('0xf')](_0xb666('0x4f'),_0x1d6745[_0xb666('0x16')]),_0xb666('0x50'),{'uri':util[_0xb666('0xf')](_0xb666('0x51'),_0x303552[_0xb666('0x1c')],_0x82ca71['id'])});}})['catch'](function(_0x3749ae){logger[_0xb666('0x52')](_0xb666('0x48'),JSON[_0xb666('0x34')](_0x3749ae));});};exports[_0xb666('0x53')]=function(_0xeac364,_0x317865,_0x3276cb,_0x78f5a3,_0x5ce7f9,_0x25839d,_0x3c1e73){var _0x2983dd,_0x2ea5f4;_0x25839d[_0xb666('0x1c')]=intUtil[_0xb666('0x45')](_0x25839d['remoteUri']);_0x25839d['serverUrl']=intUtil['stripTrailingSlash'](_0x25839d[_0xb666('0x46')]);if(_0x3c1e73&&_0x3c1e73[_0xb666('0x54')]&&_0x3c1e73[_0xb666('0x54')]!==_0xb666('0x55')){logger[_0xb666('0xc')]('[OUTBOUND]',_0xb666('0x56'));_0x317865[_0xb666('0x49')]=util[_0xb666('0xf')](_0xb666('0x4a'),_0x25839d[_0xb666('0x46')],_0x317865[_0xb666('0x4b')],md5(_0x317865[_0xb666('0x4b')]));}headers[_0xb666('0x57')]=getAuth(_0x25839d);return getUser(_0x25839d,_0x78f5a3['email'])[_0xb666('0x1e')](function(_0x207173){_0x2983dd=_0x207173;logger[_0xb666('0xc')]('The\x20User\x20ID\x20is:',_0x2983dd['id']);return getEndUser(_0x25839d,_0x317865[_0xb666('0x58')],_0x317865[_0xb666('0x59')]);})['then'](function(_0x33d54a){_0x2ea5f4=_0x33d54a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2ea5f4['id']);return getTicket(_0x25839d,_0x2983dd,_0x2ea5f4,_0x3276cb,_0x317865);})[_0xb666('0x1e')](function(_0x50493f){if(_0x50493f&&_0x50493f['id']){logger[_0xb666('0xc')]('Ticket\x20created!');logger[_0xb666('0xc')]('The\x20Ticket\x20ID\x20is:',_0x50493f['id']);logger[_0xb666('0xc')](_0xb666('0x5a'),_0xb666('0x4e'));emit(util[_0xb666('0xf')]('user:%s',_0x78f5a3[_0xb666('0x16')]),'trigger:browser:url',{'uri':util[_0xb666('0xf')](_0xb666('0x51'),_0x25839d['remoteUri'],_0x50493f['id'])});}})[_0xb666('0x5b')](function(_0x4f5f38){logger[_0xb666('0x52')](_0xb666('0x5a'),JSON[_0xb666('0x34')](_0x4f5f38));});};exports['unmanaged']=function(_0x716d45,_0x3af78f,_0x37cc8b,_0x2c7dde,_0x130724,_0x13b4da){var _0x35df78,_0x19eeab;_0x13b4da['remoteUri']=intUtil[_0xb666('0x45')](_0x13b4da[_0xb666('0x1c')]);_0x13b4da[_0xb666('0x46')]=intUtil[_0xb666('0x45')](_0x13b4da[_0xb666('0x46')]);if(_0x130724&&_0x130724[_0xb666('0x47')]){logger[_0xb666('0xc')]('['+_0x3af78f[_0xb666('0x5c')][_0xb666('0x5d')]()+']',_0xb666('0x56'));_0x3af78f[_0xb666('0x49')]=util[_0xb666('0xf')](_0xb666('0x4a'),_0x13b4da['serverUrl'],_0x3af78f['uniqueid'],md5(_0x3af78f[_0xb666('0x4b')]));}else{_0x3af78f[_0xb666('0x49')]='';}headers[_0xb666('0x57')]=getAuth(_0x13b4da);return getUser(_0x13b4da,'')[_0xb666('0x1e')](function(_0x710543){_0x35df78=_0x710543;logger[_0xb666('0xc')]('The\x20User\x20ID\x20is:',_0x35df78['id']);return getEndUser(_0x13b4da,_0x3af78f[_0xb666('0x10')],_0x3af78f[_0xb666('0x11')]);})['then'](function(_0x3d5af7){_0x19eeab=_0x3d5af7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x19eeab['id']);return getTicket(_0x13b4da,_0x35df78,_0x19eeab,_0x37cc8b,_0x3af78f);})['then'](function(_0x372e16){if(_0x372e16){logger[_0xb666('0xc')](_0xb666('0x1f'));logger[_0xb666('0xc')](_0xb666('0x5e'),_0x372e16['id']);}})[_0xb666('0x5b')](function(_0x3b1671){logger[_0xb666('0x52')]('['+_0x3af78f[_0xb666('0x5c')][_0xb666('0x5d')]()+']',JSON[_0xb666('0x34')](_0x3b1671));});}; \ 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 5232099..e10d01a 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 _0x90f5=['Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','moment','ioredis','./util','../../../../config/environment','freshsales','defaults','redis','GET','/api/selector/owners','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','info','toUpperCase','headers','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','catch','error','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId'];(function(_0x481af3,_0x483fac){var _0x3354ea=function(_0x2e3de5){while(--_0x2e3de5){_0x481af3['push'](_0x481af3['shift']());}};_0x3354ea(++_0x483fac);}(_0x90f5,0x1bd));var _0x590f=function(_0x14b7a5,_0x14a103){_0x14b7a5=_0x14b7a5-0x0;var _0x53e448=_0x90f5[_0x14b7a5];return _0x53e448;};'use strict';var _=require(_0x590f('0x0'));var rp=require('request-promise');var md5=require(_0x590f('0x1'));var util=require('util');var moment=require(_0x590f('0x2'));var Promise=require('bluebird');var Redis=require(_0x590f('0x3'));var intUtil=require(_0x590f('0x4'));var config=require(_0x590f('0x5'));var logger=require('../../../../config/logger')(_0x590f('0x6'));config['redis']=_[_0x590f('0x7')](config[_0x590f('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x590f('0x8')]));function getAdminId(_0x3929a5,_0x36c1d5,_0x3ecabd,_0x22c0be){return new Promise(function(_0x404e98,_0x2c1389){var _0x11cb67=![];var _0x182d49={'method':_0x590f('0x9'),'uri':_0x22c0be+_0x590f('0xa'),'json':!![]};_0x182d49['headers']=_0x3ecabd;logger['info'](_0x590f('0xb'));return rp(_0x182d49)['then'](function(_0x5b9f24){if(_0x5b9f24){var _0x1d028a=_0x5b9f24[_0x590f('0xc')];var _0x3b8a8b=null;for(_0x3b8a8b=0x0;_0x3b8a8b<_0x1d028a[_0x590f('0xd')];_0x3b8a8b++){if(_0x1d028a[_0x3b8a8b][_0x590f('0xe')]===_0x3929a5[_0x590f('0xf')]){_0x3929a5[_0x590f('0x10')]=_0x1d028a[_0x3b8a8b]['id'];_0x11cb67=!![];}}if(_0x11cb67){logger[_0x590f('0x11')]('Admin\x20found:',_0x3929a5[_0x590f('0x10')]);_0x404e98(_0x3929a5);}else{_0x2c1389({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2c1389({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x2fc145){logger['error']('['+[_0x36c1d5[_0x590f('0x12')]()]+']',_0x2fc145['message']);_0x2c1389(_0x2fc145);});});}function getUser(_0x43d4e4,_0x3ddf62,_0x2de3f8){return function(_0x2b7c81){return new Promise(function(_0x49f3b5,_0xfdb63e){var _0x301ac6={'method':_0x590f('0x9'),'uri':_0x2de3f8+_0x590f('0xa'),'json':!![]};_0x301ac6[_0x590f('0x13')]=_0x3ddf62;logger[_0x590f('0x11')](_0x590f('0x14'));return rp(_0x301ac6)[_0x590f('0x15')](function(_0x53faad){if(_0x53faad){var _0x35572d=_0x53faad[_0x590f('0xc')];var _0x281ccf=![];var _0x25cfa4=null;if(_0x2b7c81[_0x590f('0x16')]!==null){logger['info'](_0x590f('0x17'),_0x2b7c81[_0x590f('0x16')]);_0x2b7c81[_0x590f('0x18')]=_0x2b7c81[_0x590f('0x16')];for(_0x25cfa4=0x0;_0x25cfa4<_0x35572d[_0x590f('0xd')];_0x25cfa4++){if(_0x35572d[_0x25cfa4][_0x590f('0xe')]===_0x2b7c81[_0x590f('0x16')]){_0x281ccf=!![];_0x2b7c81[_0x590f('0x19')]=_0x35572d[_0x25cfa4]['id'];logger[_0x590f('0x11')](_0x590f('0x1a'),_0x2b7c81[_0x590f('0x19')]);}}}if(!_0x281ccf){logger['info'](_0x590f('0x1b'));_0x2b7c81['userEmail']=_0x2b7c81[_0x590f('0xf')];_0x2b7c81['userId']=_0x2b7c81[_0x590f('0x10')];_0x281ccf=!![];}if(_0x281ccf){_0x49f3b5(_0x2b7c81);}else{_0xfdb63e({'statusCode':0x194,'message':_0x590f('0x1c')});}}else{_0xfdb63e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x590f('0x1d')](function(_0x13135b){logger[_0x590f('0x1e')]('['+[_0x43d4e4['toUpperCase']()]+']',_0x13135b[_0x590f('0x1f')]);_0xfdb63e(_0x13135b);});});};}function searchContact(_0x319ab4,_0x208a40,_0x533708,_0x170836){return new Promise(function(_0x291d6b,_0x37210b){var _0x227c85={'method':'GET','headers':_0x208a40,'uri':_0x319ab4+_0x590f('0x20')+_0x170836+_0x590f('0x21')+_0x533708+_0x590f('0x22'),'json':!![]};rp(_0x227c85)[_0x590f('0x15')](function(_0x240dc7){var _0x13306f=_[_0x590f('0x23')](_0x240dc7[_0x590f('0x24')][_0x590f('0x24')],[_0x533708,_0x170836]);_0x291d6b(_0x13306f);})['catch'](function(_0x57da5b){_0x37210b(_0x57da5b);});});}function getEndUser(_0x4c3e34,_0x2fc2f2,_0x322d99){return function(_0x19fb1e){return new Promise(function(_0x291acc,_0x4fedd6){logger['info'](util[_0x590f('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x19fb1e[_0x590f('0x26')]));searchContact(_0x322d99,_0x2fc2f2,_0x590f('0x27'),_0x19fb1e['contactNumber'])[_0x590f('0x15')](function(_0x5e2579){if(_0x5e2579){_0x19fb1e[_0x590f('0x28')]=_0x5e2579['id'];logger[_0x590f('0x11')](_0x590f('0x29'),_0x19fb1e[_0x590f('0x28')]);return _0x291acc(_0x19fb1e);}searchContact(_0x322d99,_0x2fc2f2,'work_number',_0x19fb1e[_0x590f('0x26')])['then'](function(_0x55a011){if(_0x55a011){_0x19fb1e['endUserId']=_0x55a011['id'];logger['info'](_0x590f('0x2a'),_0x19fb1e[_0x590f('0x28')]);return _0x291acc(_0x19fb1e);}createEndUser(_0x19fb1e,_0x4c3e34,_0x2fc2f2,_0x322d99)[_0x590f('0x15')](function(_0x2573cf){logger['info'](_0x590f('0x2b'),_0x2573cf[_0x590f('0x28')]);return _0x291acc(_0x2573cf);});});})[_0x590f('0x1d')](function(_0x3df61a){_0x4fedd6(_0x3df61a);});});};}function createEndUser(_0x422d96,_0x514a4a,_0x3d9915,_0x50b43f){return new Promise(function(_0x13a54b,_0x4ed1bb){var _0xed0423=moment();var _0x29d937={'method':'POST','uri':_0x50b43f+_0x590f('0x2c'),'body':{'contact':{'last_name':_0x422d96['contactNumber'],'work_number':_0x422d96[_0x590f('0x26')],'mobile_number':_0x422d96[_0x590f('0x26')],'owner_id':_0x422d96[_0x590f('0x19')],'created_at':_0xed0423[_0x590f('0x25')](_0x590f('0x2d'))}},'json':!![]};_0x29d937[_0x590f('0x13')]=_0x3d9915;logger[_0x590f('0x11')](_0x590f('0x2e'));return rp(_0x29d937)['then'](function(_0x4755b0){_0x422d96[_0x590f('0x28')]=_0x4755b0[_0x590f('0x2f')]['id'];_0x13a54b(_0x422d96);})[_0x590f('0x1d')](function(_0x329b09){logger['error']('['+[_0x514a4a[_0x590f('0x12')]()]+']',_0x329b09['message']);_0x4ed1bb(_0x329b09[_0x590f('0x1f')]);});});}function getTicket(_0x455d84,_0x5ab8b2,_0x2529b6,_0x5429b3,_0x1d887f){return function(_0x4c6bd7){logger[_0x590f('0x11')](_0x590f('0x30'));return new Promise(function(_0x58cf07,_0x1842a4){var _0x3f67db=moment();var _0x26b12b={'method':'POST','uri':_0x2529b6+_0x590f('0x31'),'body':{'title':intUtil[_0x590f('0x32')](_0x5429b3['Subjects'],_0x1d887f,'\x20'),'description':intUtil['getString'](_0x5429b3[_0x590f('0x33')],_0x1d887f,'\x0a'),'owner_id':_0x4c6bd7[_0x590f('0x19')],'creater_id':_0x4c6bd7[_0x590f('0x10')],'targetable_id':_0x4c6bd7[_0x590f('0x28')],'targetable_type':_0x590f('0x34'),'created_at':_0x3f67db[_0x590f('0x25')](_0x590f('0x2d')),'due_date':_0x3f67db[_0x590f('0x35')](0x1e,'m')[_0x590f('0x25')](_0x590f('0x2d'))},'json':!![]};_0x26b12b[_0x590f('0x13')]=_0x5ab8b2;return rp(_0x26b12b)[_0x590f('0x15')](function(_0x5042e0){_0x4c6bd7['ticketId']=_0x5042e0['task']['id'];logger[_0x590f('0x11')]('Task\x20created:',_0x4c6bd7[_0x590f('0x36')]);_0x58cf07(_0x4c6bd7);})[_0x590f('0x1d')](function(_0x32f83d){logger[_0x590f('0x1e')]('['+[_0x455d84['toUpperCase']()]+']',_0x32f83d[_0x590f('0x1f')]);_0x1842a4(_0x32f83d[_0x590f('0x1f')]);});});};}function emit(_0x3294db,_0x471dd9,_0x3d35df){var _0x57c16c={'uri':_0x3294db+_0x590f('0x37')+_0x3d35df};io['to'](util[_0x590f('0x25')]('user:%s',_0x471dd9))[_0x590f('0x38')](_0x590f('0x39'),_0x57c16c);}exports['cs']=function(_0x138992,_0x581345,_0x421013,_0xafac56,_0x341877,_0x936e2a,_0x13acbb,_0x25660b){var _0x2dac1a={};var _0x2bf34d={'Authorization':_0x590f('0x3a')+_0x936e2a[_0x590f('0x3b')]};_0x936e2a[_0x590f('0x3c')]=intUtil['stripTrailingSlash'](_0x936e2a['remoteUri']);_0x936e2a[_0x590f('0x3d')]=intUtil[_0x590f('0x3e')](_0x936e2a['serverUrl']);var _0x9388b5=_0x936e2a[_0x590f('0x3c')];_0x2dac1a['adminEmail']=_0x936e2a[_0x590f('0x3f')];_0x2dac1a[_0x590f('0x26')]=_0x25660b[_0x590f('0x40')]()===_0x590f('0x41')?_0x581345['destcalleridnum']:_0x581345[_0x590f('0x42')];_0x2dac1a[_0x590f('0x43')]=_0x25660b===_0x590f('0x44')||_0x25660b===_0x590f('0x45')?'queue':_0x590f('0x41');if(_0xafac56){_0x2dac1a[_0x590f('0x16')]=_0xafac56['email'];}var _0x17aad2=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x936e2a[_0x590f('0x3d')],_0x581345[_0x590f('0x46')],md5(_0x581345[_0x590f('0x46')]));if(_0x341877&&_0x341877[_0x590f('0x47')]){logger[_0x590f('0x11')](_0x590f('0x48'),'Recording\x20is\x20enabled!');_0x581345[_0x590f('0x49')]=_0x17aad2;}else if(_0x13acbb&&_0x13acbb[_0x590f('0x4a')]&&_0x13acbb[_0x590f('0x4a')]!==_0x590f('0x4b')){logger[_0x590f('0x11')](_0x590f('0x4c'),'Recording\x20is\x20enabled!');_0x581345[_0x590f('0x49')]=_0x17aad2;}else{_0x581345[_0x590f('0x49')]='';}return getAdminId(_0x2dac1a,_0x25660b,_0x2bf34d,_0x9388b5)['then'](getUser(_0x25660b,_0x2bf34d,_0x9388b5))[_0x590f('0x15')](getEndUser(_0x25660b,_0x2bf34d,_0x9388b5))[_0x590f('0x15')](getTicket(_0x25660b,_0x2bf34d,_0x9388b5,_0x421013,_0x581345))[_0x590f('0x15')](function(_0x282eaa){logger[_0x590f('0x11')](util['format'](_0x590f('0x4d'),_0x282eaa[_0x590f('0x36')]));if(_0x25660b!==_0x590f('0x45')){logger[_0x590f('0x11')]('['+[_0x25660b['toUpperCase']()]+']',_0x590f('0x4e'));emit(_0x9388b5,_0xafac56[_0x590f('0x4f')],_0x282eaa[_0x590f('0x28')]);}})[_0x590f('0x1d')](function(_0x4c52f1){logger[_0x590f('0x1e')]('['+[_0x25660b[_0x590f('0x12')]()]+_0x590f('0x50'),util['inspect'](_0x4c52f1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x85fe=['recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','../../../../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:','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Requested\x20Resource\x20not\x20Found','/api/lookup?q=','&entities=contact','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','endUserId','Contact\x20created:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','task','Task\x20created:','/contacts/','user:%s','stripTrailingSlash','remoteUri','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x85fe,0x104));var _0xe85f=function(_0x33daba,_0x26688b){_0x33daba=_0x33daba-0x0;var _0x1b4fa1=_0x85fe[_0x33daba];return _0x1b4fa1;};'use strict';var _=require(_0xe85f('0x0'));var rp=require(_0xe85f('0x1'));var md5=require('md5');var util=require(_0xe85f('0x2'));var moment=require(_0xe85f('0x3'));var Promise=require(_0xe85f('0x4'));var Redis=require(_0xe85f('0x5'));var intUtil=require('./util');var config=require(_0xe85f('0x6'));var logger=require(_0xe85f('0x7'))(_0xe85f('0x8'));config[_0xe85f('0x9')]=_[_0xe85f('0xa')](config['redis'],{'host':_0xe85f('0xb'),'port':0x18eb});var io=require(_0xe85f('0xc'))(new Redis(config[_0xe85f('0x9')]));function getAdminId(_0x5a90c2,_0x9ccd55,_0x360fb3,_0x3d58f8){return new Promise(function(_0x2dc8af,_0x3ffc3d){var _0x24678f=![];var _0x5ad547={'method':_0xe85f('0xd'),'uri':_0x3d58f8+_0xe85f('0xe'),'json':!![]};_0x5ad547[_0xe85f('0xf')]=_0x360fb3;logger[_0xe85f('0x10')](_0xe85f('0x11'));return rp(_0x5ad547)[_0xe85f('0x12')](function(_0x1d11b8){if(_0x1d11b8){var _0x37b0f5=_0x1d11b8[_0xe85f('0x13')];var _0x3b8d0b=null;for(_0x3b8d0b=0x0;_0x3b8d0b<_0x37b0f5[_0xe85f('0x14')];_0x3b8d0b++){if(_0x37b0f5[_0x3b8d0b]['email']===_0x5a90c2[_0xe85f('0x15')]){_0x5a90c2[_0xe85f('0x16')]=_0x37b0f5[_0x3b8d0b]['id'];_0x24678f=!![];}}if(_0x24678f){logger[_0xe85f('0x10')](_0xe85f('0x17'),_0x5a90c2[_0xe85f('0x16')]);_0x2dc8af(_0x5a90c2);}else{_0x3ffc3d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3ffc3d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xe85f('0x18')](function(_0x453162){logger[_0xe85f('0x19')]('['+[_0x9ccd55[_0xe85f('0x1a')]()]+']',_0x453162[_0xe85f('0x1b')]);_0x3ffc3d(_0x453162);});});}function getUser(_0x10b035,_0x3276c2,_0x80616f){return function(_0x45fc7f){return new Promise(function(_0x2c6ec0,_0x20175e){var _0x5955e0={'method':_0xe85f('0xd'),'uri':_0x80616f+_0xe85f('0xe'),'json':!![]};_0x5955e0[_0xe85f('0xf')]=_0x3276c2;logger[_0xe85f('0x10')]('Getting\x20user\x20list');return rp(_0x5955e0)[_0xe85f('0x12')](function(_0x1dc57f){if(_0x1dc57f){var _0x48097f=_0x1dc57f[_0xe85f('0x13')];var _0x336561=![];var _0x115ce9=null;if(_0x45fc7f[_0xe85f('0x1c')]!==null){logger['info'](_0xe85f('0x1d'),_0x45fc7f['agentEmail']);_0x45fc7f[_0xe85f('0x1e')]=_0x45fc7f[_0xe85f('0x1c')];for(_0x115ce9=0x0;_0x115ce9<_0x48097f[_0xe85f('0x14')];_0x115ce9++){if(_0x48097f[_0x115ce9]['email']===_0x45fc7f[_0xe85f('0x1c')]){_0x336561=!![];_0x45fc7f[_0xe85f('0x1f')]=_0x48097f[_0x115ce9]['id'];logger[_0xe85f('0x10')](_0xe85f('0x20'),_0x45fc7f[_0xe85f('0x1f')]);}}}if(!_0x336561){logger[_0xe85f('0x10')]('Admin\x20selected');_0x45fc7f[_0xe85f('0x1e')]=_0x45fc7f[_0xe85f('0x15')];_0x45fc7f[_0xe85f('0x1f')]=_0x45fc7f[_0xe85f('0x16')];_0x336561=!![];}if(_0x336561){_0x2c6ec0(_0x45fc7f);}else{_0x20175e({'statusCode':0x194,'message':_0xe85f('0x21')});}}else{_0x20175e({'statusCode':0x194,'message':_0xe85f('0x21')});}})[_0xe85f('0x18')](function(_0xee1b9f){logger[_0xe85f('0x19')]('['+[_0x10b035[_0xe85f('0x1a')]()]+']',_0xee1b9f[_0xe85f('0x1b')]);_0x20175e(_0xee1b9f);});});};}function searchContact(_0xf2e829,_0x19fcb7,_0x25e681,_0x2ce245){return new Promise(function(_0x329ade,_0x4468f9){var _0x1c6788={'method':_0xe85f('0xd'),'headers':_0x19fcb7,'uri':_0xf2e829+_0xe85f('0x22')+_0x2ce245+'&f='+_0x25e681+_0xe85f('0x23'),'json':!![]};rp(_0x1c6788)[_0xe85f('0x12')](function(_0xc1348a){var _0x45c4a3=_['find'](_0xc1348a['contacts']['contacts'],[_0x25e681,_0x2ce245]);_0x329ade(_0x45c4a3);})['catch'](function(_0x4e1f17){_0x4468f9(_0x4e1f17);});});}function getEndUser(_0x2b398d,_0x15c624,_0x5cb171){return function(_0x236b28){return new Promise(function(_0x5399ce,_0x199b6c){logger[_0xe85f('0x10')](util[_0xe85f('0x24')](_0xe85f('0x25'),_0x236b28[_0xe85f('0x26')]));searchContact(_0x5cb171,_0x15c624,_0xe85f('0x27'),_0x236b28[_0xe85f('0x26')])[_0xe85f('0x12')](function(_0xf62c68){if(_0xf62c68){_0x236b28['endUserId']=_0xf62c68['id'];logger[_0xe85f('0x10')](_0xe85f('0x28'),_0x236b28['endUserId']);return _0x5399ce(_0x236b28);}searchContact(_0x5cb171,_0x15c624,_0xe85f('0x29'),_0x236b28['contactNumber'])['then'](function(_0x174a4a){if(_0x174a4a){_0x236b28['endUserId']=_0x174a4a['id'];logger[_0xe85f('0x10')](_0xe85f('0x2a'),_0x236b28[_0xe85f('0x2b')]);return _0x5399ce(_0x236b28);}createEndUser(_0x236b28,_0x2b398d,_0x15c624,_0x5cb171)[_0xe85f('0x12')](function(_0x1b317e){logger[_0xe85f('0x10')](_0xe85f('0x2c'),_0x1b317e[_0xe85f('0x2b')]);return _0x5399ce(_0x1b317e);});});})[_0xe85f('0x18')](function(_0x4f4ef7){_0x199b6c(_0x4f4ef7);});});};}function createEndUser(_0x5ee3ad,_0x3aa5c4,_0x41cc66,_0x5d9cd5){return new Promise(function(_0x928311,_0x458d93){var _0x970e64=moment();var _0x55c8a5={'method':'POST','uri':_0x5d9cd5+_0xe85f('0x2d'),'body':{'contact':{'last_name':_0x5ee3ad[_0xe85f('0x26')],'work_number':_0x5ee3ad['contactNumber'],'mobile_number':_0x5ee3ad[_0xe85f('0x26')],'owner_id':_0x5ee3ad[_0xe85f('0x1f')],'created_at':_0x970e64[_0xe85f('0x24')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x55c8a5['headers']=_0x41cc66;logger[_0xe85f('0x10')](_0xe85f('0x2e'));return rp(_0x55c8a5)[_0xe85f('0x12')](function(_0x219aad){_0x5ee3ad['endUserId']=_0x219aad[_0xe85f('0x2f')]['id'];_0x928311(_0x5ee3ad);})[_0xe85f('0x18')](function(_0x23c71d){logger[_0xe85f('0x19')]('['+[_0x3aa5c4[_0xe85f('0x1a')]()]+']',_0x23c71d[_0xe85f('0x1b')]);_0x458d93(_0x23c71d[_0xe85f('0x1b')]);});});}function getTicket(_0x51e2d9,_0x42a5fd,_0xe0b084,_0x5e9985,_0x53ce79){return function(_0x2e20d9){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x13d177,_0x189eec){var _0x5d13a4=moment();var _0x463c6d={'method':_0xe85f('0x30'),'uri':_0xe0b084+_0xe85f('0x31'),'body':{'title':intUtil[_0xe85f('0x32')](_0x5e9985[_0xe85f('0x33')],_0x53ce79,'\x20'),'description':intUtil['getString'](_0x5e9985[_0xe85f('0x34')],_0x53ce79,'\x0a'),'owner_id':_0x2e20d9[_0xe85f('0x1f')],'creater_id':_0x2e20d9[_0xe85f('0x16')],'targetable_id':_0x2e20d9['endUserId'],'targetable_type':_0xe85f('0x35'),'created_at':_0x5d13a4['format'](_0xe85f('0x36')),'due_date':_0x5d13a4['add'](0x1e,'m')[_0xe85f('0x24')](_0xe85f('0x36'))},'json':!![]};_0x463c6d[_0xe85f('0xf')]=_0x42a5fd;return rp(_0x463c6d)[_0xe85f('0x12')](function(_0x36882e){_0x2e20d9[_0xe85f('0x37')]=_0x36882e[_0xe85f('0x38')]['id'];logger[_0xe85f('0x10')](_0xe85f('0x39'),_0x2e20d9[_0xe85f('0x37')]);_0x13d177(_0x2e20d9);})[_0xe85f('0x18')](function(_0x5db1a2){logger[_0xe85f('0x19')]('['+[_0x51e2d9[_0xe85f('0x1a')]()]+']',_0x5db1a2[_0xe85f('0x1b')]);_0x189eec(_0x5db1a2[_0xe85f('0x1b')]);});});};}function emit(_0x585124,_0xe6ec79,_0x17f8a4){var _0x33af88={'uri':_0x585124+_0xe85f('0x3a')+_0x17f8a4};io['to'](util[_0xe85f('0x24')](_0xe85f('0x3b'),_0xe6ec79))['emit']('trigger:browser:url',_0x33af88);}exports['cs']=function(_0x1d4e51,_0x14a40a,_0x5ca1dd,_0x1f0259,_0x15353d,_0xbe3de3,_0x45eac1,_0x20f574){var _0x52dc54={};var _0x5beb55={'Authorization':'Token\x20token='+_0xbe3de3['apiKey']};_0xbe3de3['remoteUri']=intUtil[_0xe85f('0x3c')](_0xbe3de3[_0xe85f('0x3d')]);_0xbe3de3['serverUrl']=intUtil[_0xe85f('0x3c')](_0xbe3de3[_0xe85f('0x3e')]);var _0xb721c1=_0xbe3de3[_0xe85f('0x3d')];_0x52dc54[_0xe85f('0x15')]=_0xbe3de3['username'];_0x52dc54['contactNumber']=_0x20f574[_0xe85f('0x3f')]()===_0xe85f('0x40')?_0x14a40a[_0xe85f('0x41')]:_0x14a40a[_0xe85f('0x42')];_0x52dc54[_0xe85f('0x43')]=_0x20f574===_0xe85f('0x44')||_0x20f574===_0xe85f('0x45')?_0xe85f('0x44'):'outbound';if(_0x1f0259){_0x52dc54[_0xe85f('0x1c')]=_0x1f0259[_0xe85f('0x46')];}var _0x5c4e4d=util[_0xe85f('0x24')](_0xe85f('0x47'),_0xbe3de3['serverUrl'],_0x14a40a[_0xe85f('0x48')],md5(_0x14a40a[_0xe85f('0x48')]));if(_0x15353d&&_0x15353d[_0xe85f('0x49')]){logger[_0xe85f('0x10')]('[QUEUE]',_0xe85f('0x4a'));_0x14a40a[_0xe85f('0x4b')]=_0x5c4e4d;}else if(_0x45eac1&&_0x45eac1[_0xe85f('0x4c')]&&_0x45eac1[_0xe85f('0x4c')]!==_0xe85f('0x4d')){logger['info'](_0xe85f('0x4e'),_0xe85f('0x4a'));_0x14a40a[_0xe85f('0x4b')]=_0x5c4e4d;}else{_0x14a40a[_0xe85f('0x4b')]='';}return getAdminId(_0x52dc54,_0x20f574,_0x5beb55,_0xb721c1)['then'](getUser(_0x20f574,_0x5beb55,_0xb721c1))['then'](getEndUser(_0x20f574,_0x5beb55,_0xb721c1))[_0xe85f('0x12')](getTicket(_0x20f574,_0x5beb55,_0xb721c1,_0x5ca1dd,_0x14a40a))[_0xe85f('0x12')](function(_0x480437){logger[_0xe85f('0x10')](util[_0xe85f('0x24')](_0xe85f('0x4f'),_0x480437[_0xe85f('0x37')]));if(_0x20f574!==_0xe85f('0x45')){logger[_0xe85f('0x10')]('['+[_0x20f574['toUpperCase']()]+']',_0xe85f('0x50'));emit(_0xb721c1,_0x1f0259[_0xe85f('0x51')],_0x480437[_0xe85f('0x2b')]);}})['catch'](function(_0x13df25){logger[_0xe85f('0x19')]('['+[_0x20f574[_0xe85f('0x1a')]()]+_0xe85f('0x52'),util[_0xe85f('0x53')](_0x13df25,{'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 6c13b71..8745ed9 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 _0xee59=['desk','vtiger','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','sugarcrm','freshdesk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./freshdesk','./vtiger','zendesk','salesforce','zoho'];(function(_0x46f646,_0x301c7c){var _0x34181d=function(_0xbbdf43){while(--_0xbbdf43){_0x46f646['push'](_0x46f646['shift']());}};_0x34181d(++_0x301c7c);}(_0xee59,0x100));var _0x9ee5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee59[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9ee5('0x0'));var zendesk=require(_0x9ee5('0x1'));var salesforce=require(_0x9ee5('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x9ee5('0x3'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x9ee5('0x4'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x9ee5('0x5'),_0x9ee5('0x6'),'sugarcrm','freshdesk',_0x9ee5('0x7'),_0x9ee5('0x8'),_0x9ee5('0x9'),'dynamics365','freshsales',_0x9ee5('0xa')];exports[_0x9ee5('0xb')]=function(_0x5086a0,_0x166972,_0x328830,_0x507a28,_0x595872,_0x4fae3a){if(_0x328830){if(_[_0x9ee5('0xc')](integrations,_0x5086a0[_0x9ee5('0xd')][_0x9ee5('0xe')]())){try{var _0x47efe8=null;var _0x11614d='';var _0x4e8688=_0x328830[_0x5086a0[_0x9ee5('0xd')][_0x9ee5('0xe')]()];if(_0x4e8688){var _0x298766=_0x4e8688[_0x5086a0[_0x9ee5('0xf')]];if(_0x298766){var _0x3c6133=_['find'](_0x298766[_0x9ee5('0x10')],{'id':parseInt(_0x5086a0[_0x9ee5('0x11')],0xa)});if(_0x3c6133){if(_0x507a28){if(_0x595872&&_0x166972[_0x9ee5('0x12')]){_0x11614d=_0x9ee5('0x12');}else if(_0x166972['routeId']){_0x11614d=_0x9ee5('0x13');}else{console[_0x9ee5('0x14')](_0x9ee5('0x15'),_0x166972);}}else{_0x11614d='unmanaged';}switch(_0x5086a0[_0x9ee5('0xd')][_0x9ee5('0xe')]()){case _0x9ee5('0x5'):zendesk[_0x11614d](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a);break;case _0x9ee5('0x6'):salesforce[_0x11614d](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a);break;case _0x9ee5('0x16'):sugarcrm[_0x11614d](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a);break;case _0x9ee5('0x17'):freshdesk[_0x11614d](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a);break;case _0x9ee5('0x7'):zoho[_0x11614d](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a);break;case _0x9ee5('0x8'):desk[_0x11614d](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a);break;case'vtiger':vtiger[_0x11614d](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a);break;case _0x9ee5('0x18'):freshsales['cs'](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a,_0x11614d);break;case _0x9ee5('0xa'):servicenow['cs'](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a,_0x11614d);break;case _0x9ee5('0x19'):dynamics365['cs'](_0x5086a0,_0x166972,_0x3c6133,_0x507a28,_0x595872,_0x298766,_0x4fae3a,_0x11614d);break;default:console['log'](_0x9ee5('0x1a'));}}else{_0x47efe8=require(_0x9ee5('0x1b'))(_0x5086a0[_0x9ee5('0xd')][_0x9ee5('0xe')]());_0x47efe8[_0x9ee5('0x1c')]('[EXEC]',util[_0x9ee5('0x1d')](_0x9ee5('0x1e'),_0x5086a0['data1'][_0x9ee5('0xe')](),_0x5086a0['data3']));}}else{_0x47efe8=require('../../../../config/logger')(_0x5086a0['data1'][_0x9ee5('0xe')]());_0x47efe8[_0x9ee5('0x1c')](_0x9ee5('0x1f'),util['format'](_0x9ee5('0x20'),_0x5086a0[_0x9ee5('0xd')][_0x9ee5('0xe')](),_0x5086a0[_0x9ee5('0xf')]));}}else{}}catch(_0xe74ddb){console['error'](_0xe74ddb);}}}}; \ No newline at end of file +var _0xa9bf=['exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','unknown\x20integration','[EXEC]','format','../../../../config/logger','error','lodash','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0xa9bf,0x19c));var _0xfa9b=function(_0x3d80ca,_0x549db6){_0x3d80ca=_0x3d80ca-0x0;var _0x1cd947=_0xa9bf[_0x3d80ca];return _0x1cd947;};'use strict';var _=require(_0xfa9b('0x0'));var util=require('util');var zendesk=require(_0xfa9b('0x1'));var salesforce=require(_0xfa9b('0x2'));var sugarcrm=require(_0xfa9b('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xfa9b('0x4'));var desk=require(_0xfa9b('0x5'));var vtiger=require(_0xfa9b('0x6'));var servicenow=require(_0xfa9b('0x7'));var dynamics365=require(_0xfa9b('0x8'));var freshsales=require(_0xfa9b('0x9'));var integrations=[_0xfa9b('0xa'),_0xfa9b('0xb'),_0xfa9b('0xc'),_0xfa9b('0xd'),_0xfa9b('0xe'),_0xfa9b('0xf'),_0xfa9b('0x10'),_0xfa9b('0x11'),_0xfa9b('0x12'),_0xfa9b('0x13')];exports[_0xfa9b('0x14')]=function(_0x2c3e8f,_0x35a4fe,_0x51b328,_0x52a1c4,_0x2d5d1c,_0x471f43){if(_0x51b328){if(_['includes'](integrations,_0x2c3e8f[_0xfa9b('0x15')][_0xfa9b('0x16')]())){try{var _0x452233=null;var _0x2a64e6='';var _0x5e391a=_0x51b328[_0x2c3e8f[_0xfa9b('0x15')][_0xfa9b('0x16')]()];if(_0x5e391a){var _0x1d802f=_0x5e391a[_0x2c3e8f[_0xfa9b('0x17')]];if(_0x1d802f){var _0x5b6d60=_[_0xfa9b('0x18')](_0x1d802f[_0xfa9b('0x19')],{'id':parseInt(_0x2c3e8f[_0xfa9b('0x1a')],0xa)});if(_0x5b6d60){if(_0x52a1c4){if(_0x2d5d1c&&_0x35a4fe[_0xfa9b('0x1b')]){_0x2a64e6=_0xfa9b('0x1b');}else if(_0x35a4fe[_0xfa9b('0x1c')]){_0x2a64e6=_0xfa9b('0x1d');}else{console[_0xfa9b('0x1e')]('EVENT\x20UNKNOWN',_0x35a4fe);}}else{_0x2a64e6='unmanaged';}switch(_0x2c3e8f[_0xfa9b('0x15')]['toLowerCase']()){case _0xfa9b('0xa'):zendesk[_0x2a64e6](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43);break;case _0xfa9b('0xb'):salesforce[_0x2a64e6](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43);break;case _0xfa9b('0xc'):sugarcrm[_0x2a64e6](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43);break;case'freshdesk':freshdesk[_0x2a64e6](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43);break;case _0xfa9b('0xe'):zoho[_0x2a64e6](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43);break;case _0xfa9b('0xf'):desk[_0x2a64e6](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43);break;case _0xfa9b('0x10'):vtiger[_0x2a64e6](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43);break;case _0xfa9b('0x12'):freshsales['cs'](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43,_0x2a64e6);break;case _0xfa9b('0x13'):servicenow['cs'](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43,_0x2a64e6);break;case _0xfa9b('0x11'):dynamics365['cs'](_0x2c3e8f,_0x35a4fe,_0x5b6d60,_0x52a1c4,_0x2d5d1c,_0x1d802f,_0x471f43,_0x2a64e6);break;default:console['log'](_0xfa9b('0x1f'));}}else{_0x452233=require('../../../../config/logger')(_0x2c3e8f[_0xfa9b('0x15')]['toLowerCase']());_0x452233['error'](_0xfa9b('0x20'),util[_0xfa9b('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x2c3e8f['data1'][_0xfa9b('0x16')](),_0x2c3e8f[_0xfa9b('0x1a')]));}}else{_0x452233=require(_0xfa9b('0x22'))(_0x2c3e8f[_0xfa9b('0x15')][_0xfa9b('0x16')]());_0x452233['error'](_0xfa9b('0x20'),util[_0xfa9b('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x2c3e8f[_0xfa9b('0x15')]['toLowerCase'](),_0x2c3e8f[_0xfa9b('0x17')]));}}else{}}catch(_0x410f96){console[_0xfa9b('0x23')](_0x410f96);}}}}; \ 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 912edcd..9dd229a 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 _0x7a20=[']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','Case','account','AccountId','leadId','info','sobject','create','isNil','User','execute','then','find','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','attributes','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.','format','Caller\x20-\x20%s','Company','No\x20Company','','forEach','string','idField','type','variable','variableName','toString','customVariable','name','Variable','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','[OUTBOUND]','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase'];(function(_0x3a2fa2,_0x278326){var _0x5b5eba=function(_0x24b469){while(--_0x24b469){_0x3a2fa2['push'](_0x3a2fa2['shift']());}};_0x5b5eba(++_0x278326);}(_0x7a20,0xfc));var _0x07a2=function(_0x1f69fa,_0xe76f86){_0x1f69fa=_0x1f69fa-0x0;var _0x567c6c=_0x7a20[_0x1f69fa];return _0x567c6c;};'use strict';var _=require(_0x07a2('0x0'));var rp=require(_0x07a2('0x1'));var moment=require(_0x07a2('0x2'));var BPromise=require(_0x07a2('0x3'));var md5=require(_0x07a2('0x4'));var jsforce=require(_0x07a2('0x5'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x07a2('0x6'));var config=require(_0x07a2('0x7'));var logger=require(_0x07a2('0x8'))(_0x07a2('0x9'));config[_0x07a2('0xa')]=_['defaults'](config[_0x07a2('0xa')],{'host':_0x07a2('0xb'),'port':0x18eb});var io=require(_0x07a2('0xc'))(new Redis(config['redis']));function emit(_0x1847be,_0x406c8f,_0xadf184){io['to'](_0x1847be)['emit'](_0x406c8f,_0xadf184);}function getTicket(_0x19046d,_0x5809d1,_0x18b4e3,_0x14c165,_0x5b683f,_0x2021d9,_0x3cc2b2,_0x46dbf1){var _0x4d1f72=Object['assign']({},{'OwnerId':_0x5809d1['id'],'Subject':intUtil['getString'](_0x14c165[_0x07a2('0xd')],_0x5b683f,'\x20'),'Description':intUtil[_0x07a2('0xe')](_0x14c165['Descriptions'],_0x5b683f,'\x0a')},getCustomFields(_0x2021d9,_0x5b683f));if(_0x18b4e3){if(_0x14c165[_0x07a2('0xf')]===_0x07a2('0x10')){_0x4d1f72[_0x07a2('0x11')]=moment[_0x07a2('0x12')]();_0x4d1f72[_0x07a2('0x13')]=![];_0x4d1f72[_0x07a2('0x14')]=![];if(_0x18b4e3[_0x07a2('0x15')]===_0x07a2('0x16')||_0x18b4e3[_0x07a2('0x15')]===_0x07a2('0x17')){_0x4d1f72[_0x07a2('0x18')]=_0x18b4e3['id'];}else if(_0x18b4e3[_0x07a2('0x15')]==='account'){_0x4d1f72['WhatId']=_0x18b4e3['id'];}}else if(_0x14c165['ticketType']===_0x07a2('0x19')){if(_0x18b4e3[_0x07a2('0x15')]===_0x07a2('0x16')){_0x4d1f72['ContactId']=_0x18b4e3['id'];}else if(_0x18b4e3[_0x07a2('0x15')]===_0x07a2('0x1a')){_0x4d1f72[_0x07a2('0x1b')]=_0x18b4e3['id'];}else if(_0x18b4e3[_0x07a2('0x15')]==='lead'&&_0x14c165[_0x07a2('0x1c')]){_0x4d1f72[_0x14c165['leadId']]=_0x18b4e3['id'];}else{logger[_0x07a2('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3cc2b2[_0x07a2('0x1e')](_0x14c165[_0x07a2('0xf')])[_0x07a2('0x1f')](_0x4d1f72);}function getUser(_0xd5ebaa,_0x2dcaf8,_0x4baec4){if(!_[_0x07a2('0x20')](_0x2dcaf8)&&intUtil['validateEmail'](_0x2dcaf8)){var _0x69f706={'Email':_0x2dcaf8};var _0x7cdff7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4baec4[_0x07a2('0x1e')](_0x07a2('0x21'))['find'](_0x69f706,_0x7cdff7)[_0x07a2('0x22')]()[_0x07a2('0x23')](function(_0x512349){if(_0x512349['length']){var _0x301d94=_[_0x07a2('0x24')](_0x512349,function(_0x5a5f2d){return _0x5a5f2d[_0x07a2('0x25')]===_0x2dcaf8;});if(_0x301d94){logger[_0x07a2('0x1d')]('Agent\x20%s\x20found.',_0x2dcaf8);return BPromise[_0x07a2('0x26')]({'id':_0x301d94['Id'],'name':_0x301d94[_0x07a2('0x27')]});}}else{logger[_0x07a2('0x1d')](_0x07a2('0x28'),_0x2dcaf8);return _0x4baec4[_0x07a2('0x29')]()[_0x07a2('0x23')](function(_0x4189e6){return BPromise[_0x07a2('0x26')]({'id':_0x4189e6[_0x07a2('0x2a')],'name':_0x4189e6[_0x07a2('0x2b')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2dcaf8);return _0x4baec4['identity']()['then'](function(_0x4b1f9f){return BPromise[_0x07a2('0x26')]({'id':_0x4b1f9f[_0x07a2('0x2a')],'name':_0x4b1f9f[_0x07a2('0x2b')]});});}}function getEndUser(_0x586020,_0x1647ca,_0x240f74,_0x4a4c99,_0x91cf25){var _0x54c244={'$or':{'Phone':_0x4a4c99}};var _0x3bb1b9={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0x07a2('0x1d')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x4a4c99,_0x1647ca[_0x07a2('0x2c')]);switch(_0x1647ca['moduleSearch']){case _0x07a2('0x2d'):var _0x3f27a0=_[_0x07a2('0x2e')](_0x54c244);if(_0x1647ca[_0x07a2('0x2f')]){var _0x4a8b8c={};_0x4a8b8c[_0x1647ca['additionalSearchContact']]=_0x4a4c99;_[_0x07a2('0x30')](_0x3f27a0[_0x07a2('0x31')],_0x4a8b8c);}return _0x91cf25['sobject'](_0x07a2('0x32'))['find'](_0x3f27a0,_0x3bb1b9)[_0x07a2('0x22')]()[_0x07a2('0x23')](function(_0x3e5968){if(_0x3e5968&&_0x3e5968[_0x07a2('0x33')]){return _0x3e5968;}else{var _0x56f66f=_['cloneDeep'](_0x54c244);if(_0x1647ca[_0x07a2('0x34')]){var _0x343db4={};_0x343db4[_0x1647ca[_0x07a2('0x34')]]=_0x4a4c99;_['merge'](_0x56f66f[_0x07a2('0x31')],_0x343db4);}return _0x91cf25[_0x07a2('0x1e')]('Lead')[_0x07a2('0x24')](_0x56f66f,_0x3bb1b9);}});case _0x07a2('0x35'):var _0x123ce7=_['cloneDeep'](_0x54c244);if(_0x1647ca[_0x07a2('0x36')]){var _0x4a8b8c={};_0x4a8b8c[_0x1647ca[_0x07a2('0x36')]]=_0x4a4c99;_[_0x07a2('0x30')](_0x123ce7[_0x07a2('0x31')],_0x4a8b8c);}return _0x91cf25[_0x07a2('0x1e')](_0x07a2('0x37'))[_0x07a2('0x24')](_0x123ce7,_0x3bb1b9)['execute']()[_0x07a2('0x23')](function(_0x27a11f){if(_0x27a11f&&_0x27a11f['length']){return _0x27a11f;}else{var _0x402a2b=_[_0x07a2('0x2e')](_0x54c244);if(_0x1647ca[_0x07a2('0x2f')]){var _0x5c0d28={};_0x5c0d28[_0x1647ca[_0x07a2('0x2f')]]=_0x4a4c99;_[_0x07a2('0x30')](_0x402a2b[_0x07a2('0x31')],_0x5c0d28);}return _0x91cf25[_0x07a2('0x1e')](_0x07a2('0x32'))['find'](_0x402a2b,_0x3bb1b9)[_0x07a2('0x23')](function(_0x3557d6){if(_0x3557d6&&_0x3557d6[_0x07a2('0x33')]){return _0x3557d6;}else{var _0x5e08b5=_[_0x07a2('0x2e')](_0x54c244);if(_0x1647ca[_0x07a2('0x34')]){var _0x45a1c7={};_0x45a1c7[_0x1647ca[_0x07a2('0x34')]]=_0x4a4c99;_['merge'](_0x5e08b5[_0x07a2('0x31')],_0x45a1c7);}return _0x91cf25[_0x07a2('0x1e')](_0x07a2('0x38'))[_0x07a2('0x24')](_0x5e08b5,_0x3bb1b9);}});}});case _0x07a2('0x16'):var _0x3f27a0=_[_0x07a2('0x2e')](_0x54c244);if(_0x1647ca[_0x07a2('0x2f')]){var _0x4a8b8c={};_0x4a8b8c[_0x1647ca[_0x07a2('0x2f')]]=_0x4a4c99;_['merge'](_0x3f27a0['$or'],_0x4a8b8c);}return _0x91cf25[_0x07a2('0x1e')](_0x07a2('0x32'))[_0x07a2('0x24')](_0x3f27a0,_0x3bb1b9)[_0x07a2('0x22')]();case _0x07a2('0x17'):var _0x1d4950=_[_0x07a2('0x2e')](_0x54c244);if(_0x1647ca[_0x07a2('0x34')]){var _0x4a8b8c={};_0x4a8b8c[_0x1647ca[_0x07a2('0x34')]]=_0x4a4c99;_[_0x07a2('0x30')](_0x1d4950[_0x07a2('0x31')],_0x4a8b8c);}return _0x91cf25[_0x07a2('0x1e')](_0x07a2('0x38'))[_0x07a2('0x24')](_0x1d4950,_0x3bb1b9);case _0x07a2('0x1a'):var _0x123ce7=_[_0x07a2('0x2e')](_0x54c244);if(_0x1647ca['additionalSearchAccount']){var _0x4a8b8c={};_0x4a8b8c[_0x1647ca[_0x07a2('0x36')]]=_0x4a4c99;_[_0x07a2('0x30')](_0x123ce7[_0x07a2('0x31')],_0x4a8b8c);}return _0x91cf25[_0x07a2('0x1e')](_0x07a2('0x37'))['find'](_0x123ce7,_0x3bb1b9);default:return null;}})['then'](function(_0x550bdf){if(_0x550bdf&&_0x550bdf[_0x07a2('0x33')]){var _0xc5813b=_['first'](_0x550bdf);if(_0xc5813b){return BPromise[_0x07a2('0x26')]({'id':_0xc5813b['Id'],'name':_0xc5813b['Name'],'phone':_0xc5813b['Phone'],'endUserType':_0xc5813b[_0x07a2('0x39')]['type'][_0x07a2('0x3a')]()});}}})[_0x07a2('0x23')](function(_0x1f9546){if(_0x1f9546){logger[_0x07a2('0x1d')](_0x07a2('0x3b'),_0x1f9546[_0x07a2('0x15')],_0x4a4c99);return BPromise[_0x07a2('0x26')](_0x1f9546);}else{logger['info'](_0x07a2('0x3c'),_0x4a4c99);var _0x5ac7a9={'Phone':_0x4a4c99};if(_0x1647ca[_0x07a2('0x3d')]){if(_0x1647ca[_0x07a2('0x3d')]===_0x07a2('0x16')){logger[_0x07a2('0x1d')](_0x07a2('0x3e'),_0x4a4c99,_0x1647ca['moduleCreate']);_0x5ac7a9['LastName']=_0x240f74!==''?_0x240f74:util[_0x07a2('0x3f')](_0x07a2('0x40'),_0x4a4c99);}else if(_0x1647ca['moduleCreate']===_0x07a2('0x17')){logger[_0x07a2('0x1d')](_0x07a2('0x3e'),_0x4a4c99,_0x1647ca[_0x07a2('0x3d')]);_0x5ac7a9['LastName']=_0x240f74!==''?_0x240f74:util[_0x07a2('0x3f')](_0x07a2('0x40'),_0x4a4c99);_0x5ac7a9[_0x07a2('0x41')]=_0x07a2('0x42');}else if(_0x1647ca[_0x07a2('0x3d')]===_0x07a2('0x1a')){logger[_0x07a2('0x1d')](_0x07a2('0x3e'),_0x4a4c99,_0x1647ca[_0x07a2('0x3d')]);_0x5ac7a9[_0x07a2('0x27')]=_0x240f74!==_0x07a2('0x43')?_0x240f74:util[_0x07a2('0x3f')](_0x07a2('0x40'),_0x4a4c99);}else{return null;}}return _0x91cf25['sobject'](_['upperFirst'](_0x1647ca[_0x07a2('0x3d')]))[_0x07a2('0x1f')](_0x5ac7a9)[_0x07a2('0x23')](function(_0x16dbf2){return BPromise[_0x07a2('0x26')]({'id':_0x16dbf2['id'],'endUserType':_0x1647ca[_0x07a2('0x3d')]});});}});}function getCustomFields(_0x437d2c,_0x4e13a4){var _0x3c93ff={};if(_0x437d2c[_0x07a2('0x33')]>0x0){_[_0x07a2('0x44')](_0x437d2c,function(_0x507384){if(_['includes']([_0x07a2('0x45'),'picklist'],_0x507384['type'])&&_0x507384[_0x07a2('0x46')]){_0x3c93ff[_0x507384[_0x07a2('0x46')]]=_0x507384['content']['toString']();}else if(_0x507384[_0x07a2('0x47')]===_0x07a2('0x48')&&_0x507384[_0x07a2('0x49')]&&_0x507384[_0x07a2('0x46')]){_0x4e13a4[_0x507384[_0x07a2('0x49')]]&&(_0x3c93ff[_0x507384[_0x07a2('0x46')]]=_0x4e13a4[_0x507384[_0x07a2('0x49')]][_0x07a2('0x4a')]());}else if(_0x507384[_0x07a2('0x47')]===_0x07a2('0x4b')&&_0x507384['Variable']&&_0x507384['Variable'][_0x07a2('0x4c')]&&_0x507384[_0x07a2('0x46')]){_0x4e13a4[_0x507384['Variable'][_0x07a2('0x4c')]['toLowerCase']()]&&(_0x3c93ff[_0x507384[_0x07a2('0x46')]]=_0x4e13a4[_0x507384[_0x07a2('0x4d')][_0x07a2('0x4c')][_0x07a2('0x3a')]()][_0x07a2('0x4a')]());}});}return _0x3c93ff;}function getConnection(_0x477d17){var _0x2548aa=_0x477d17[_0x07a2('0x4e')][_0x07a2('0x4f')](_0x477d17[_0x07a2('0x50')]);var _0xc97e1d=new jsforce[(_0x07a2('0x51'))]({'oauth2':{'loginUrl':_0x477d17[_0x07a2('0x52')]||_0x07a2('0x53'),'clientId':_0x477d17['clientId'],'clientSecret':_0x477d17[_0x07a2('0x54')]}});return _0xc97e1d[_0x07a2('0x55')](_0x477d17[_0x07a2('0x56')],_0x2548aa)[_0x07a2('0x23')](function(){logger[_0x07a2('0x1d')](_0x07a2('0x57'));return _0xc97e1d;});}exports[_0x07a2('0x58')]=function(_0x310130,_0x5c20db,_0x5cace1,_0x7f9a52,_0x535297,_0x37a64b){var _0x11af91,_0x40b7c2,_0x1400cc,_0x43a64a;_0x37a64b[_0x07a2('0x59')]=intUtil['stripTrailingSlash'](_0x37a64b['serverUrl']);_0x37a64b[_0x07a2('0x52')]=intUtil[_0x07a2('0x5a')](_0x37a64b[_0x07a2('0x52')]);if(_0x535297&&_0x535297[_0x07a2('0x5b')]){logger['info'](_0x07a2('0x5c'),_0x07a2('0x5d'));_0x5c20db['recordingURL']=util[_0x07a2('0x3f')](_0x07a2('0x5e'),_0x37a64b[_0x07a2('0x59')],_0x5c20db[_0x07a2('0x5f')],md5(_0x5c20db['uniqueid']));}else{_0x5c20db[_0x07a2('0x60')]='';}return getConnection(_0x37a64b)[_0x07a2('0x23')](function(_0x24f0b9){_0x43a64a=_0x24f0b9;return getUser(_0x37a64b,_0x7f9a52[_0x07a2('0x61')],_0x43a64a);})['then'](function(_0xefa533){_0x11af91=_0xefa533;return getEndUser(_0x37a64b,_0x5cace1,_0x5c20db[_0x07a2('0x62')],_0x5c20db[_0x07a2('0x63')],_0x43a64a);})[_0x07a2('0x23')](function(_0x45fb5b){_0x40b7c2=_0x45fb5b;return getTicket(_0x37a64b,_0x11af91,_0x40b7c2,_0x5cace1,_0x5c20db,_0x5cace1[_0x07a2('0x64')],_0x43a64a,'queue');})[_0x07a2('0x23')](function(_0x3dbea5){_0x1400cc=_0x3dbea5;logger[_0x07a2('0x1d')](_0x07a2('0x65'),_0x1400cc['id']);logger['info'](_0x07a2('0x66'),_0x1400cc['id'],_0x7f9a52[_0x07a2('0x4c')],_0x37a64b[_0x07a2('0x47')]);switch(_0x37a64b[_0x07a2('0x47')]){case _0x07a2('0x67'):emit(util['format'](_0x07a2('0x68'),_0x7f9a52[_0x07a2('0x4c')]),'trigger:salesforce:display',{'recordId':_0x1400cc['id']});break;case _0x07a2('0x69'):emit(util['format'](_0x07a2('0x68'),_0x7f9a52[_0x07a2('0x4c')]),_0x07a2('0x6a'),{'uri':util[_0x07a2('0x3f')](_0x07a2('0x6b'),_0x43a64a[_0x07a2('0x6c')],_0x1400cc['id'])});break;default:logger[_0x07a2('0x6d')](_0x07a2('0x6e'));}})['catch'](function(_0x57a8af){logger[_0x07a2('0x6d')](_0x07a2('0x5c'),_0x57a8af);});};exports['outbound']=function(_0x1bbe26,_0x1acdd9,_0x1a538f,_0x427055,_0x4f901f,_0x1e8cc9,_0x4986cb){var _0x13c5dd,_0x1aa381,_0x10f5ec,_0x575dee;_0x1e8cc9[_0x07a2('0x59')]=intUtil[_0x07a2('0x5a')](_0x1e8cc9[_0x07a2('0x59')]);_0x1e8cc9[_0x07a2('0x52')]=intUtil[_0x07a2('0x5a')](_0x1e8cc9[_0x07a2('0x52')]);if(_0x4986cb&&_0x4986cb[_0x07a2('0x6f')]&&_0x4986cb[_0x07a2('0x6f')]!==_0x07a2('0x70')){logger[_0x07a2('0x1d')](_0x07a2('0x71'),_0x07a2('0x5d'));_0x1acdd9[_0x07a2('0x60')]=util['format'](_0x07a2('0x5e'),_0x1e8cc9['serverUrl'],_0x1acdd9['uniqueid'],md5(_0x1acdd9[_0x07a2('0x5f')]));}return getConnection(_0x1e8cc9)[_0x07a2('0x23')](function(_0x8c1191){_0x575dee=_0x8c1191;return getUser(_0x1e8cc9,_0x427055[_0x07a2('0x61')],_0x575dee);})[_0x07a2('0x23')](function(_0x27cc60){_0x13c5dd=_0x27cc60;return getEndUser(_0x1e8cc9,_0x1a538f,_0x1acdd9['destcalleridname'],_0x1acdd9[_0x07a2('0x72')],_0x575dee);})[_0x07a2('0x23')](function(_0x4186fa){_0x1aa381=_0x4186fa;return getTicket(_0x1e8cc9,_0x13c5dd,_0x1aa381,_0x1a538f,_0x1acdd9,_0x1a538f[_0x07a2('0x64')],_0x575dee,_0x07a2('0x73'));})['then'](function(_0x30e4ef){_0x10f5ec=_0x30e4ef;logger['info'](_0x07a2('0x74'),_0x10f5ec['id']);logger['info'](_0x07a2('0x75'),_0x10f5ec['id'],_0x427055[_0x07a2('0x4c')],_0x1e8cc9['type']);switch(_0x1e8cc9[_0x07a2('0x47')]){case'integrationTab':emit(util[_0x07a2('0x3f')](_0x07a2('0x68'),_0x427055[_0x07a2('0x4c')]),'trigger:salesforce:display',{'recordId':_0x10f5ec['id']});break;case _0x07a2('0x69'):emit(util[_0x07a2('0x3f')](_0x07a2('0x68'),_0x427055[_0x07a2('0x4c')]),_0x07a2('0x6a'),{'uri':util[_0x07a2('0x3f')](_0x07a2('0x6b'),_0x575dee['instanceUrl'],_0x10f5ec['id'])});break;default:logger[_0x07a2('0x6d')](_0x07a2('0x71'),_0x07a2('0x76'));}})[_0x07a2('0x77')](function(_0x3d77ea){logger[_0x07a2('0x6d')](_0x07a2('0x71'),_0x3d77ea);});};exports[_0x07a2('0x78')]=function(_0x5a6c70,_0x1a9108,_0x433b04,_0x2ccb09,_0x128772,_0x56a0e8){var _0x15a775,_0x3fea0c,_0x228a3b,_0x30a5cc;_0x56a0e8[_0x07a2('0x59')]=intUtil['stripTrailingSlash'](_0x56a0e8[_0x07a2('0x59')]);_0x56a0e8[_0x07a2('0x52')]=intUtil[_0x07a2('0x5a')](_0x56a0e8[_0x07a2('0x52')]);if(_0x128772&&_0x128772['monitor_format']){logger[_0x07a2('0x1d')]('['+_0x1a9108[_0x07a2('0x79')][_0x07a2('0x7a')]()+']',_0x07a2('0x5d'));_0x1a9108[_0x07a2('0x60')]=util[_0x07a2('0x3f')](_0x07a2('0x5e'),_0x56a0e8[_0x07a2('0x59')],_0x1a9108[_0x07a2('0x5f')],md5(_0x1a9108[_0x07a2('0x5f')]));}else{_0x1a9108[_0x07a2('0x60')]='';}return getConnection(_0x56a0e8)['then'](function(_0x15e397){_0x30a5cc=_0x15e397;if(!_['isNil'](_0x2ccb09)){return getUser(_0x56a0e8,_0x2ccb09['name'],_0x30a5cc);}else{return getUser(_0x56a0e8,null,_0x30a5cc);}})[_0x07a2('0x23')](function(_0x454607){_0x15a775=_0x454607;return getEndUser(_0x56a0e8,_0x433b04,_0x1a9108[_0x07a2('0x62')],_0x1a9108[_0x07a2('0x63')],_0x30a5cc);})[_0x07a2('0x23')](function(_0x42bcb2){_0x3fea0c=_0x42bcb2;return getTicket(_0x56a0e8,_0x15a775,_0x3fea0c,_0x433b04,_0x1a9108,_0x433b04[_0x07a2('0x64')],_0x30a5cc);})[_0x07a2('0x23')](function(_0x1daf2c){_0x228a3b=_0x1daf2c;logger['info']('['+_0x1a9108[_0x07a2('0x79')][_0x07a2('0x7a')]()+_0x07a2('0x7b'),_0x228a3b['id']);logger[_0x07a2('0x1d')]('['+_0x1a9108[_0x07a2('0x79')]['toUpperCase']()+_0x07a2('0x7c'),_0x56a0e8[_0x07a2('0x47')]);})[_0x07a2('0x77')](function(_0x24e776){logger[_0x07a2('0x6d')]('['+_0x1a9108['lastevent'][_0x07a2('0x7a')]()+']',_0x24e776);});}; \ No newline at end of file +var _0xab3c=['contact_lead','cloneDeep','additionalSearchContact','Contact','additionalSearchLead','merge','$or','Lead','account_contact_lead','additionalSearchAccount','first','Name','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','picklist','idField','content','toString','variableName','customVariable','Variable','name','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','assign','getString','Subjects','Descriptions','ActivityDate','utc','IsRecurrence','contact','endUserType','lead','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','find','execute','then','length','Email','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch'];(function(_0x564c58,_0xfb160c){var _0xa29c5c=function(_0x4afa22){while(--_0x4afa22){_0x564c58['push'](_0x564c58['shift']());}};_0xa29c5c(++_0xfb160c);}(_0xab3c,0xc7));var _0xcab3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab3c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcab3('0x0'));var rp=require(_0xcab3('0x1'));var moment=require('moment');var BPromise=require(_0xcab3('0x2'));var md5=require('md5');var jsforce=require(_0xcab3('0x3'));var util=require(_0xcab3('0x4'));var Redis=require(_0xcab3('0x5'));var intUtil=require(_0xcab3('0x6'));var config=require(_0xcab3('0x7'));var logger=require(_0xcab3('0x8'))(_0xcab3('0x9'));config[_0xcab3('0xa')]=_[_0xcab3('0xb')](config[_0xcab3('0xa')],{'host':_0xcab3('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcab3('0xa')]));function emit(_0x6e770a,_0x217bcb,_0x592d32){io['to'](_0x6e770a)['emit'](_0x217bcb,_0x592d32);}function getTicket(_0x3c56f8,_0x3a4459,_0x3e9430,_0x1e3368,_0x5f4e5c,_0x352068,_0x392c98,_0x35d17e){var _0x22dc46=Object[_0xcab3('0xd')]({},{'OwnerId':_0x3a4459['id'],'Subject':intUtil[_0xcab3('0xe')](_0x1e3368[_0xcab3('0xf')],_0x5f4e5c,'\x20'),'Description':intUtil['getString'](_0x1e3368[_0xcab3('0x10')],_0x5f4e5c,'\x0a')},getCustomFields(_0x352068,_0x5f4e5c));if(_0x3e9430){if(_0x1e3368['ticketType']==='Task'){_0x22dc46[_0xcab3('0x11')]=moment[_0xcab3('0x12')]();_0x22dc46['IsReminderSet']=![];_0x22dc46[_0xcab3('0x13')]=![];if(_0x3e9430['endUserType']===_0xcab3('0x14')||_0x3e9430[_0xcab3('0x15')]===_0xcab3('0x16')){_0x22dc46['WhoId']=_0x3e9430['id'];}else if(_0x3e9430[_0xcab3('0x15')]===_0xcab3('0x17')){_0x22dc46[_0xcab3('0x18')]=_0x3e9430['id'];}}else if(_0x1e3368['ticketType']===_0xcab3('0x19')){if(_0x3e9430[_0xcab3('0x15')]==='contact'){_0x22dc46[_0xcab3('0x1a')]=_0x3e9430['id'];}else if(_0x3e9430[_0xcab3('0x15')]===_0xcab3('0x17')){_0x22dc46[_0xcab3('0x1b')]=_0x3e9430['id'];}else if(_0x3e9430[_0xcab3('0x15')]===_0xcab3('0x16')&&_0x1e3368[_0xcab3('0x1c')]){_0x22dc46[_0x1e3368[_0xcab3('0x1c')]]=_0x3e9430['id'];}else{logger[_0xcab3('0x1d')](_0xcab3('0x1e'));}}}return _0x392c98[_0xcab3('0x1f')](_0x1e3368['ticketType'])['create'](_0x22dc46);}function getUser(_0x4a67e6,_0x2c82f7,_0x3b1d77){if(!_[_0xcab3('0x20')](_0x2c82f7)&&intUtil['validateEmail'](_0x2c82f7)){var _0x433b05={'Email':_0x2c82f7};var _0x5315be={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3b1d77[_0xcab3('0x1f')]('User')[_0xcab3('0x21')](_0x433b05,_0x5315be)[_0xcab3('0x22')]()[_0xcab3('0x23')](function(_0x3ea9e3){if(_0x3ea9e3[_0xcab3('0x24')]){var _0x3033f1=_['find'](_0x3ea9e3,function(_0x5a6a87){return _0x5a6a87[_0xcab3('0x25')]===_0x2c82f7;});if(_0x3033f1){logger[_0xcab3('0x1d')]('Agent\x20%s\x20found.',_0x2c82f7);return BPromise['resolve']({'id':_0x3033f1['Id'],'name':_0x3033f1['Name']});}}else{logger[_0xcab3('0x1d')](_0xcab3('0x26'),_0x2c82f7);return _0x3b1d77[_0xcab3('0x27')]()['then'](function(_0x1d4aea){return BPromise[_0xcab3('0x28')]({'id':_0x1d4aea[_0xcab3('0x29')],'name':_0x1d4aea['display_name']});});}});}else{logger[_0xcab3('0x1d')](_0xcab3('0x26'),_0x2c82f7);return _0x3b1d77[_0xcab3('0x27')]()[_0xcab3('0x23')](function(_0x25cf32){return BPromise[_0xcab3('0x28')]({'id':_0x25cf32['user_id'],'name':_0x25cf32[_0xcab3('0x2a')]});});}}function getEndUser(_0x4cd00e,_0x2dde75,_0x154791,_0x17d0a4,_0x3c4a56){var _0x4d807a={'$or':{'Phone':_0x17d0a4}};var _0x1ff6c8={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xcab3('0x28')]()[_0xcab3('0x23')](function(){logger[_0xcab3('0x1d')](_0xcab3('0x2b'),_0x17d0a4,_0x2dde75[_0xcab3('0x2c')]);switch(_0x2dde75['moduleSearch']){case _0xcab3('0x2d'):var _0xae2991=_[_0xcab3('0x2e')](_0x4d807a);if(_0x2dde75[_0xcab3('0x2f')]){var _0x1ee08e={};_0x1ee08e[_0x2dde75['additionalSearchContact']]=_0x17d0a4;_['merge'](_0xae2991['$or'],_0x1ee08e);}return _0x3c4a56[_0xcab3('0x1f')](_0xcab3('0x30'))[_0xcab3('0x21')](_0xae2991,_0x1ff6c8)['execute']()[_0xcab3('0x23')](function(_0x30a205){if(_0x30a205&&_0x30a205['length']){return _0x30a205;}else{var _0x4ae202=_['cloneDeep'](_0x4d807a);if(_0x2dde75[_0xcab3('0x31')]){var _0x246123={};_0x246123[_0x2dde75['additionalSearchLead']]=_0x17d0a4;_[_0xcab3('0x32')](_0x4ae202[_0xcab3('0x33')],_0x246123);}return _0x3c4a56[_0xcab3('0x1f')](_0xcab3('0x34'))[_0xcab3('0x21')](_0x4ae202,_0x1ff6c8);}});case _0xcab3('0x35'):var _0x1428dc=_['cloneDeep'](_0x4d807a);if(_0x2dde75[_0xcab3('0x36')]){var _0x1ee08e={};_0x1ee08e[_0x2dde75[_0xcab3('0x36')]]=_0x17d0a4;_[_0xcab3('0x32')](_0x1428dc[_0xcab3('0x33')],_0x1ee08e);}return _0x3c4a56[_0xcab3('0x1f')]('Account')[_0xcab3('0x21')](_0x1428dc,_0x1ff6c8)['execute']()[_0xcab3('0x23')](function(_0x412e57){if(_0x412e57&&_0x412e57[_0xcab3('0x24')]){return _0x412e57;}else{var _0x559781=_[_0xcab3('0x2e')](_0x4d807a);if(_0x2dde75[_0xcab3('0x2f')]){var _0xb806aa={};_0xb806aa[_0x2dde75['additionalSearchContact']]=_0x17d0a4;_[_0xcab3('0x32')](_0x559781[_0xcab3('0x33')],_0xb806aa);}return _0x3c4a56[_0xcab3('0x1f')]('Contact')['find'](_0x559781,_0x1ff6c8)[_0xcab3('0x23')](function(_0x212e13){if(_0x212e13&&_0x212e13[_0xcab3('0x24')]){return _0x212e13;}else{var _0x30395e=_[_0xcab3('0x2e')](_0x4d807a);if(_0x2dde75[_0xcab3('0x31')]){var _0x12c77c={};_0x12c77c[_0x2dde75[_0xcab3('0x31')]]=_0x17d0a4;_[_0xcab3('0x32')](_0x30395e[_0xcab3('0x33')],_0x12c77c);}return _0x3c4a56[_0xcab3('0x1f')](_0xcab3('0x34'))[_0xcab3('0x21')](_0x30395e,_0x1ff6c8);}});}});case _0xcab3('0x14'):var _0xae2991=_[_0xcab3('0x2e')](_0x4d807a);if(_0x2dde75[_0xcab3('0x2f')]){var _0x1ee08e={};_0x1ee08e[_0x2dde75[_0xcab3('0x2f')]]=_0x17d0a4;_['merge'](_0xae2991[_0xcab3('0x33')],_0x1ee08e);}return _0x3c4a56[_0xcab3('0x1f')](_0xcab3('0x30'))[_0xcab3('0x21')](_0xae2991,_0x1ff6c8)[_0xcab3('0x22')]();case _0xcab3('0x16'):var _0x128220=_[_0xcab3('0x2e')](_0x4d807a);if(_0x2dde75['additionalSearchLead']){var _0x1ee08e={};_0x1ee08e[_0x2dde75[_0xcab3('0x31')]]=_0x17d0a4;_[_0xcab3('0x32')](_0x128220[_0xcab3('0x33')],_0x1ee08e);}return _0x3c4a56['sobject']('Lead')[_0xcab3('0x21')](_0x128220,_0x1ff6c8);case _0xcab3('0x17'):var _0x1428dc=_[_0xcab3('0x2e')](_0x4d807a);if(_0x2dde75[_0xcab3('0x36')]){var _0x1ee08e={};_0x1ee08e[_0x2dde75[_0xcab3('0x36')]]=_0x17d0a4;_['merge'](_0x1428dc[_0xcab3('0x33')],_0x1ee08e);}return _0x3c4a56[_0xcab3('0x1f')]('Account')[_0xcab3('0x21')](_0x1428dc,_0x1ff6c8);default:return null;}})[_0xcab3('0x23')](function(_0x3b8535){if(_0x3b8535&&_0x3b8535[_0xcab3('0x24')]){var _0x157464=_[_0xcab3('0x37')](_0x3b8535);if(_0x157464){return BPromise[_0xcab3('0x28')]({'id':_0x157464['Id'],'name':_0x157464[_0xcab3('0x38')],'phone':_0x157464['Phone'],'endUserType':_0x157464['attributes'][_0xcab3('0x39')][_0xcab3('0x3a')]()});}}})[_0xcab3('0x23')](function(_0x3a28b6){if(_0x3a28b6){logger[_0xcab3('0x1d')](_0xcab3('0x3b'),_0x3a28b6[_0xcab3('0x15')],_0x17d0a4);return BPromise[_0xcab3('0x28')](_0x3a28b6);}else{logger[_0xcab3('0x1d')](_0xcab3('0x3c'),_0x17d0a4);var _0x20e045={'Phone':_0x17d0a4};if(_0x2dde75['moduleCreate']){if(_0x2dde75[_0xcab3('0x3d')]===_0xcab3('0x14')){logger[_0xcab3('0x1d')](_0xcab3('0x3e'),_0x17d0a4,_0x2dde75[_0xcab3('0x3d')]);_0x20e045[_0xcab3('0x3f')]=_0x154791!==_0xcab3('0x40')?_0x154791:util[_0xcab3('0x41')]('Caller\x20-\x20%s',_0x17d0a4);}else if(_0x2dde75[_0xcab3('0x3d')]==='lead'){logger[_0xcab3('0x1d')](_0xcab3('0x3e'),_0x17d0a4,_0x2dde75[_0xcab3('0x3d')]);_0x20e045[_0xcab3('0x3f')]=_0x154791!==''?_0x154791:util[_0xcab3('0x41')](_0xcab3('0x42'),_0x17d0a4);_0x20e045[_0xcab3('0x43')]=_0xcab3('0x44');}else if(_0x2dde75[_0xcab3('0x3d')]==='account'){logger[_0xcab3('0x1d')](_0xcab3('0x3e'),_0x17d0a4,_0x2dde75[_0xcab3('0x3d')]);_0x20e045['Name']=_0x154791!==_0xcab3('0x40')?_0x154791:util[_0xcab3('0x41')](_0xcab3('0x42'),_0x17d0a4);}else{return null;}}return _0x3c4a56[_0xcab3('0x1f')](_[_0xcab3('0x45')](_0x2dde75[_0xcab3('0x3d')]))[_0xcab3('0x46')](_0x20e045)[_0xcab3('0x23')](function(_0x4a0fc2){return BPromise[_0xcab3('0x28')]({'id':_0x4a0fc2['id'],'endUserType':_0x2dde75[_0xcab3('0x3d')]});});}});}function getCustomFields(_0x2d3873,_0x25b463){var _0xc943cf={};if(_0x2d3873[_0xcab3('0x24')]>0x0){_[_0xcab3('0x47')](_0x2d3873,function(_0x58b5e7){if(_['includes'](['string',_0xcab3('0x48')],_0x58b5e7[_0xcab3('0x39')])&&_0x58b5e7[_0xcab3('0x49')]){_0xc943cf[_0x58b5e7[_0xcab3('0x49')]]=_0x58b5e7[_0xcab3('0x4a')][_0xcab3('0x4b')]();}else if(_0x58b5e7[_0xcab3('0x39')]==='variable'&&_0x58b5e7[_0xcab3('0x4c')]&&_0x58b5e7[_0xcab3('0x49')]){_0x25b463[_0x58b5e7[_0xcab3('0x4c')]]&&(_0xc943cf[_0x58b5e7[_0xcab3('0x49')]]=_0x25b463[_0x58b5e7[_0xcab3('0x4c')]][_0xcab3('0x4b')]());}else if(_0x58b5e7[_0xcab3('0x39')]===_0xcab3('0x4d')&&_0x58b5e7[_0xcab3('0x4e')]&&_0x58b5e7[_0xcab3('0x4e')][_0xcab3('0x4f')]&&_0x58b5e7[_0xcab3('0x49')]){_0x25b463[_0x58b5e7[_0xcab3('0x4e')][_0xcab3('0x4f')][_0xcab3('0x3a')]()]&&(_0xc943cf[_0x58b5e7['idField']]=_0x25b463[_0x58b5e7[_0xcab3('0x4e')][_0xcab3('0x4f')]['toLowerCase']()]['toString']());}});}return _0xc943cf;}function getConnection(_0x3c7aad){var _0x5b00ec=_0x3c7aad['password'][_0xcab3('0x50')](_0x3c7aad[_0xcab3('0x51')]);var _0x357803=new jsforce[(_0xcab3('0x52'))]({'oauth2':{'loginUrl':_0x3c7aad['remoteUri']||_0xcab3('0x53'),'clientId':_0x3c7aad[_0xcab3('0x54')],'clientSecret':_0x3c7aad[_0xcab3('0x55')]}});return _0x357803[_0xcab3('0x56')](_0x3c7aad[_0xcab3('0x57')],_0x5b00ec)[_0xcab3('0x23')](function(){logger[_0xcab3('0x1d')](_0xcab3('0x58'));return _0x357803;});}exports['queue']=function(_0x105b1c,_0x5e498b,_0x435bfb,_0x19027e,_0xc790fd,_0x14cc15){var _0x5aefb9,_0x209374,_0x1b5c35,_0x3c6c38;_0x14cc15[_0xcab3('0x59')]=intUtil[_0xcab3('0x5a')](_0x14cc15[_0xcab3('0x59')]);_0x14cc15['remoteUri']=intUtil[_0xcab3('0x5a')](_0x14cc15[_0xcab3('0x5b')]);if(_0xc790fd&&_0xc790fd['monitor_format']){logger['info']('[QUEUE]',_0xcab3('0x5c'));_0x5e498b[_0xcab3('0x5d')]=util['format'](_0xcab3('0x5e'),_0x14cc15[_0xcab3('0x59')],_0x5e498b[_0xcab3('0x5f')],md5(_0x5e498b[_0xcab3('0x5f')]));}else{_0x5e498b[_0xcab3('0x5d')]='';}return getConnection(_0x14cc15)[_0xcab3('0x23')](function(_0x533a30){_0x3c6c38=_0x533a30;return getUser(_0x14cc15,_0x19027e[_0xcab3('0x60')],_0x3c6c38);})[_0xcab3('0x23')](function(_0xc0abe3){_0x5aefb9=_0xc0abe3;return getEndUser(_0x14cc15,_0x435bfb,_0x5e498b[_0xcab3('0x61')],_0x5e498b[_0xcab3('0x62')],_0x3c6c38);})['then'](function(_0x364f87){_0x209374=_0x364f87;return getTicket(_0x14cc15,_0x5aefb9,_0x209374,_0x435bfb,_0x5e498b,_0x435bfb['Fields'],_0x3c6c38,_0xcab3('0x63'));})[_0xcab3('0x23')](function(_0x23ab9d){_0x1b5c35=_0x23ab9d;logger[_0xcab3('0x1d')](_0xcab3('0x64'),_0x1b5c35['id']);logger[_0xcab3('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1b5c35['id'],_0x19027e[_0xcab3('0x4f')],_0x14cc15[_0xcab3('0x39')]);switch(_0x14cc15[_0xcab3('0x39')]){case'integrationTab':emit(util[_0xcab3('0x41')]('user:%s',_0x19027e[_0xcab3('0x4f')]),_0xcab3('0x65'),{'recordId':_0x1b5c35['id']});break;case _0xcab3('0x66'):emit(util['format'](_0xcab3('0x67'),_0x19027e['name']),'trigger:browser:url',{'uri':util[_0xcab3('0x41')](_0xcab3('0x68'),_0x3c6c38[_0xcab3('0x69')],_0x1b5c35['id'])});break;default:logger[_0xcab3('0x6a')](_0xcab3('0x6b'));}})[_0xcab3('0x6c')](function(_0x39fe4f){logger['error']('[QUEUE]',_0x39fe4f);});};exports[_0xcab3('0x6d')]=function(_0x341f44,_0x58fb1e,_0x41e7b5,_0x5c44e5,_0x5acd42,_0x5a4b53,_0x5209eb){var _0x3bd845,_0x2ca527,_0x40d9ca,_0x55efe3;_0x5a4b53[_0xcab3('0x59')]=intUtil[_0xcab3('0x5a')](_0x5a4b53[_0xcab3('0x59')]);_0x5a4b53[_0xcab3('0x5b')]=intUtil[_0xcab3('0x5a')](_0x5a4b53[_0xcab3('0x5b')]);if(_0x5209eb&&_0x5209eb[_0xcab3('0x6e')]&&_0x5209eb[_0xcab3('0x6e')]!==_0xcab3('0x6f')){logger[_0xcab3('0x1d')](_0xcab3('0x70'),_0xcab3('0x5c'));_0x58fb1e[_0xcab3('0x5d')]=util[_0xcab3('0x41')](_0xcab3('0x5e'),_0x5a4b53[_0xcab3('0x59')],_0x58fb1e[_0xcab3('0x5f')],md5(_0x58fb1e[_0xcab3('0x5f')]));}return getConnection(_0x5a4b53)[_0xcab3('0x23')](function(_0x288314){_0x55efe3=_0x288314;return getUser(_0x5a4b53,_0x5c44e5[_0xcab3('0x60')],_0x55efe3);})[_0xcab3('0x23')](function(_0x2544d1){_0x3bd845=_0x2544d1;return getEndUser(_0x5a4b53,_0x41e7b5,_0x58fb1e['destcalleridname'],_0x58fb1e['destcalleridnum'],_0x55efe3);})[_0xcab3('0x23')](function(_0x36cd58){_0x2ca527=_0x36cd58;return getTicket(_0x5a4b53,_0x3bd845,_0x2ca527,_0x41e7b5,_0x58fb1e,_0x41e7b5[_0xcab3('0x71')],_0x55efe3,_0xcab3('0x6d'));})['then'](function(_0xfc7678){_0x40d9ca=_0xfc7678;logger[_0xcab3('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x40d9ca['id']);logger[_0xcab3('0x1d')](_0xcab3('0x72'),_0x40d9ca['id'],_0x5c44e5[_0xcab3('0x4f')],_0x5a4b53[_0xcab3('0x39')]);switch(_0x5a4b53[_0xcab3('0x39')]){case _0xcab3('0x73'):emit(util[_0xcab3('0x41')](_0xcab3('0x67'),_0x5c44e5[_0xcab3('0x4f')]),_0xcab3('0x65'),{'recordId':_0x40d9ca['id']});break;case _0xcab3('0x66'):emit(util[_0xcab3('0x41')]('user:%s',_0x5c44e5[_0xcab3('0x4f')]),_0xcab3('0x74'),{'uri':util['format'](_0xcab3('0x68'),_0x55efe3[_0xcab3('0x69')],_0x40d9ca['id'])});break;default:logger[_0xcab3('0x6a')](_0xcab3('0x70'),_0xcab3('0x75'));}})[_0xcab3('0x6c')](function(_0x1f0f1c){logger[_0xcab3('0x6a')](_0xcab3('0x70'),_0x1f0f1c);});};exports[_0xcab3('0x76')]=function(_0x12aeb9,_0x39811f,_0x3ab6e8,_0x155ac1,_0x5d48bf,_0x1ce396){var _0x1e656e,_0x37b2a0,_0x122e85,_0x27c428;_0x1ce396[_0xcab3('0x59')]=intUtil[_0xcab3('0x5a')](_0x1ce396[_0xcab3('0x59')]);_0x1ce396[_0xcab3('0x5b')]=intUtil['stripTrailingSlash'](_0x1ce396[_0xcab3('0x5b')]);if(_0x5d48bf&&_0x5d48bf[_0xcab3('0x77')]){logger[_0xcab3('0x1d')]('['+_0x39811f[_0xcab3('0x78')]['toUpperCase']()+']',_0xcab3('0x5c'));_0x39811f[_0xcab3('0x5d')]=util[_0xcab3('0x41')](_0xcab3('0x5e'),_0x1ce396['serverUrl'],_0x39811f['uniqueid'],md5(_0x39811f['uniqueid']));}else{_0x39811f[_0xcab3('0x5d')]='';}return getConnection(_0x1ce396)[_0xcab3('0x23')](function(_0x9f0051){_0x27c428=_0x9f0051;if(!_[_0xcab3('0x20')](_0x155ac1)){return getUser(_0x1ce396,_0x155ac1['name'],_0x27c428);}else{return getUser(_0x1ce396,null,_0x27c428);}})[_0xcab3('0x23')](function(_0x34affe){_0x1e656e=_0x34affe;return getEndUser(_0x1ce396,_0x3ab6e8,_0x39811f[_0xcab3('0x61')],_0x39811f['calleridnum'],_0x27c428);})[_0xcab3('0x23')](function(_0x1f056b){_0x37b2a0=_0x1f056b;return getTicket(_0x1ce396,_0x1e656e,_0x37b2a0,_0x3ab6e8,_0x39811f,_0x3ab6e8[_0xcab3('0x71')],_0x27c428);})['then'](function(_0x175824){_0x122e85=_0x175824;logger['info']('['+_0x39811f[_0xcab3('0x78')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x122e85['id']);logger[_0xcab3('0x1d')]('['+_0x39811f[_0xcab3('0x78')][_0xcab3('0x79')]()+']\x20Integration\x20account\x20type\x20%s.',_0x1ce396['type']);})[_0xcab3('0x6c')](function(_0x448d15){logger[_0xcab3('0x6a')]('['+_0x39811f['lastevent'][_0xcab3('0x79')]()+']',_0x448d15);});}; \ 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 ed17bdf..f99f318 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 _0xb035=['%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','serverUrl','remoteUri','email','calleridnum','callDirection','queue','unmanaged','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','sys_id','userEmail','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','variableName','customVariable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident'];(function(_0x5c39be,_0x57f98a){var _0x508923=function(_0x376c0c){while(--_0x376c0c){_0x5c39be['push'](_0x5c39be['shift']());}};_0x508923(++_0x57f98a);}(_0xb035,0x87));var _0x5b03=function(_0x4d5c14,_0x1d4351){_0x4d5c14=_0x4d5c14-0x0;var _0xb568f=_0xb035[_0x4d5c14];return _0xb568f;};'use strict';var _=require(_0x5b03('0x0'));var Promise=require('bluebird');var rp=require(_0x5b03('0x1'));var util=require(_0x5b03('0x2'));var md5=require(_0x5b03('0x3'));var Redis=require(_0x5b03('0x4'));var intUtil=require(_0x5b03('0x5'));var config=require(_0x5b03('0x6'));var logger=require(_0x5b03('0x7'))(_0x5b03('0x8'));config[_0x5b03('0x9')]=_['defaults'](config[_0x5b03('0x9')],{'host':_0x5b03('0xa'),'port':0x18eb});var io=require(_0x5b03('0xb'))(new Redis(config[_0x5b03('0x9')]));function getAdminUser(_0x192aa6,_0x307773,_0x13f797,_0x22e6b0,_0x25cbd9,_0x1c3cc3){return new Promise(function(_0x225077,_0x4ed03e){var _0x30cb97={'method':_0x5b03('0xc'),'uri':_0x22e6b0+_0x5b03('0xd')+'&'+_0x25cbd9+'&'+_0x1c3cc3,'auth':_0x307773,'json':!![]};return rp(_0x30cb97)[_0x5b03('0xe')](function(_0x3ffcbf){if(_0x3ffcbf['result'][_0x5b03('0xf')]>0x0){_0x13f797[_0x5b03('0x10')]=_0x3ffcbf[_0x5b03('0x11')][0x0]['sys_id'];}logger[_0x5b03('0x12')]('['+[_0x192aa6[_0x5b03('0x13')]()]+'],\x20getAdminUser\x20crm',_0x13f797);_0x225077(_0x13f797);})[_0x5b03('0x14')](function(_0x291c91){logger[_0x5b03('0x15')]('['+[_0x192aa6[_0x5b03('0x13')]()]+']',_0x291c91['message']);_0x4ed03e(_0x291c91[_0x5b03('0x16')]);});});}function getUser(_0x17d04c,_0x1faea5,_0x1e419b,_0x309d6d,_0x17e431){return function(_0x29afc6){logger[_0x5b03('0x12')]('['+[_0x17d04c[_0x5b03('0x13')]()]+_0x5b03('0x17'),_0x29afc6);return new Promise(function(_0x552c1b,_0x36755a){if(intUtil[_0x5b03('0x18')](_0x29afc6['userEmail'])){var _0x45a7bf={'method':_0x5b03('0xc'),'uri':_0x1e419b+_0x5b03('0x19')+_0x29afc6['userEmail']+'&'+_0x309d6d+'&'+_0x17e431,'auth':_0x1faea5,'json':!![]};logger[_0x5b03('0x12')]('['+[_0x17d04c[_0x5b03('0x13')]()]+_0x5b03('0x1a'),_0x45a7bf);return rp(_0x45a7bf)[_0x5b03('0xe')](function(_0x1c9971){logger[_0x5b03('0x12')]('['+[_0x17d04c['toUpperCase']()]+_0x5b03('0x1b'),_0x1c9971);if(_0x1c9971[_0x5b03('0x11')][_0x5b03('0xf')]>0x0&&String(_0x1c9971['result'][0x0]['active'])==='true'){_0x29afc6[_0x5b03('0x1c')]=_0x1c9971[_0x5b03('0x11')][0x0][_0x5b03('0x1d')];}else{_0x29afc6['userId']=_0x29afc6[_0x5b03('0x10')];_0x29afc6[_0x5b03('0x1e')]=_0x29afc6[_0x5b03('0x1f')];}logger['info']('['+[_0x17d04c[_0x5b03('0x13')]()]+_0x5b03('0x20'),_0x29afc6);_0x552c1b(_0x29afc6);})[_0x5b03('0x14')](function(_0x20c2a4){logger[_0x5b03('0x15')]('['+[_0x17d04c[_0x5b03('0x13')]()]+']',_0x20c2a4[_0x5b03('0x16')]);_0x36755a(_0x20c2a4[_0x5b03('0x16')]);});}else{logger[_0x5b03('0x12')]('['+[_0x17d04c[_0x5b03('0x13')]()]+']\x20using\x20admin\x20profile');_0x29afc6[_0x5b03('0x1c')]=_0x29afc6[_0x5b03('0x10')];_0x29afc6['userEmail']=_0x29afc6[_0x5b03('0x1f')];_0x552c1b(_0x29afc6);}});};}function createEndUser(_0x65af54,_0x32af71,_0x465bc9,_0x3b585b,_0x2fa016){logger[_0x5b03('0x12')]('['+[_0x65af54[_0x5b03('0x13')]()]+_0x5b03('0x21'),_0x465bc9);return new Promise(function(_0x3c321e,_0x2e38ce){var _0x14235b={'method':_0x5b03('0x22'),'uri':_0x3b585b+_0x5b03('0x23')+_0x2fa016,'body':{'user_name':_0x465bc9[_0x5b03('0x24')],'roles':'user','first_name':_0x465bc9['endUserNumber'],'active':_0x5b03('0x25'),'date_format':_0x5b03('0x26'),'phone':_0x465bc9[_0x5b03('0x24')]},'auth':_0x32af71,'json':!![]};return rp(_0x14235b)[_0x5b03('0xe')](function(_0x50bfa4){logger[_0x5b03('0x12')]('['+[_0x65af54[_0x5b03('0x13')]()]+_0x5b03('0x27'),_0x50bfa4[_0x5b03('0x11')]);_0x465bc9[_0x5b03('0x28')]=_0x50bfa4[_0x5b03('0x11')]['sys_id'];_0x3c321e(_0x465bc9);})[_0x5b03('0x14')](function(_0x2f282c){logger[_0x5b03('0x15')]('['+[_0x65af54[_0x5b03('0x13')]()]+']',_0x2f282c[_0x5b03('0x16')]);_0x2e38ce(_0x2f282c['message']);});});}function getEndUser(_0x342093,_0x26c259,_0x3a6467,_0x3de0cc,_0x294c9f){return function(_0x12592){logger['info']('['+[_0x342093[_0x5b03('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x12592);return new Promise(function(_0x5bd0a4,_0x15cdcd){var _0x300c10={'method':_0x5b03('0xc'),'uri':_0x3a6467+_0x5b03('0x29')+_0x12592[_0x5b03('0x24')]+'&'+_0x3de0cc+'&'+_0x294c9f,'auth':_0x26c259,'json':!![]};return rp(_0x300c10)[_0x5b03('0xe')](function(_0x478874){if(_0x478874[_0x5b03('0x11')][_0x5b03('0xf')]>0x0){_0x12592[_0x5b03('0x28')]=_0x478874['result'][0x0]['sys_id'];logger[_0x5b03('0x12')]('['+[_0x342093['toUpperCase']()]+_0x5b03('0x2a'),_0x12592);_0x5bd0a4(_0x12592);}else{return createEndUser(_0x342093,_0x26c259,_0x12592,_0x3a6467,_0x3de0cc)[_0x5b03('0xe')](function(_0x301694){logger[_0x5b03('0x12')]('['+[_0x342093[_0x5b03('0x13')]()]+'],\x20createEndUser\x20crm',_0x301694);_0x5bd0a4(_0x301694);});}})[_0x5b03('0x14')](function(_0x21b596){logger[_0x5b03('0x15')]('['+[_0x342093[_0x5b03('0x13')]()]+']',_0x21b596[_0x5b03('0x16')]);_0x15cdcd(_0x21b596['message']);});});};}function getCustomFields(_0x1593dc,_0x259ea0){var _0x40e52c={};if(_0x1593dc['length']>0x0){_[_0x5b03('0x2b')](_0x1593dc,function(_0x9e8b0e){if(_[_0x5b03('0x2c')](['string',_0x5b03('0x2d')],_0x9e8b0e[_0x5b03('0x2e')])&&_0x9e8b0e[_0x5b03('0x2f')]&&!_0x9e8b0e[_0x5b03('0x30')]){_0x40e52c[_0x9e8b0e['nameField'][_0x5b03('0x31')]()]=_0x9e8b0e[_0x5b03('0x32')][_0x5b03('0x33')]();}else if(_['includes']([_0x5b03('0x34'),'picklist'],_0x9e8b0e['type'])&&_0x9e8b0e[_0x5b03('0x35')]&&_0x9e8b0e[_0x5b03('0x30')]){_0x40e52c[_0x9e8b0e[_0x5b03('0x35')][_0x5b03('0x31')]()]=_0x9e8b0e[_0x5b03('0x32')][_0x5b03('0x33')]();}else if(_0x9e8b0e[_0x5b03('0x2e')]==='variable'&&_0x9e8b0e['variableName']&&_0x9e8b0e[_0x5b03('0x35')]&&_0x9e8b0e[_0x5b03('0x30')]){_0x40e52c[_0x9e8b0e[_0x5b03('0x35')][_0x5b03('0x31')]()]=_0x259ea0[_0x9e8b0e[_0x5b03('0x36')]][_0x5b03('0x33')]();}else if(_0x9e8b0e[_0x5b03('0x2e')]===_0x5b03('0x37')&&_0x9e8b0e['Variable']&&_0x9e8b0e['Variable'][_0x5b03('0x38')]&&_0x9e8b0e[_0x5b03('0x35')]&&_0x9e8b0e[_0x5b03('0x30')]){_0x40e52c[_0x9e8b0e['idField']['toLowerCase']()]=_0x259ea0[_0x9e8b0e['Variable'][_0x5b03('0x38')][_0x5b03('0x31')]()][_0x5b03('0x33')]();}});}return _0x40e52c;}function getTicket(_0x41b201,_0x5363a3,_0x1fafd0,_0x2dd9a6,_0x2bf783,_0x333c48){return function(_0x3e41f4){logger[_0x5b03('0x12')]('['+[_0x41b201[_0x5b03('0x13')]()]+_0x5b03('0x39'),_0x3e41f4);return new Promise(function(_0x27afbd,_0x1a7a65){var _0x46ebda=_0x41b201[_0x5b03('0x31')]()===_0x5b03('0x3a')?_0x3e41f4['userId']:_0x3e41f4[_0x5b03('0x28')];var _0x1da1bb={'method':_0x5b03('0x22'),'uri':_0x1fafd0+_0x5b03('0x3b')+'?'+_0x333c48,'body':Object['assign']({},{'active':_0x5b03('0x25'),'caller_id':_0x46ebda,'assigned_to':_0x3e41f4['userId'],'short_description':intUtil[_0x5b03('0x3c')](_0x2dd9a6[_0x5b03('0x3d')],_0x2bf783,'\x20'),'description':intUtil[_0x5b03('0x3c')](_0x2dd9a6[_0x5b03('0x3e')],_0x2bf783,'\x0a')},getCustomFields(_0x2dd9a6['Fields'],_0x2bf783)),'auth':_0x5363a3,'json':!![]};return rp(_0x1da1bb)['then'](function(_0x1b423e){logger[_0x5b03('0x12')]('['+[_0x41b201[_0x5b03('0x13')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x1b423e[_0x5b03('0x11')]);_0x3e41f4[_0x5b03('0x3f')]=_0x1b423e['result'][_0x5b03('0x1d')];_0x3e41f4[_0x5b03('0x40')]=_0x1b423e[_0x5b03('0x11')][_0x5b03('0x41')];logger[_0x5b03('0x12')]('['+[_0x41b201[_0x5b03('0x13')]()]+_0x5b03('0x42'),_0x3e41f4);_0x27afbd(_0x3e41f4);})[_0x5b03('0x14')](function(_0x29bcf0){logger[_0x5b03('0x15')]('['+[_0x41b201[_0x5b03('0x13')]()]+']',_0x29bcf0[_0x5b03('0x16')]);_0x1a7a65(_0x29bcf0[_0x5b03('0x16')]);});});};}function createRemoteTag(_0x55ed4a,_0x45dd20,_0x584b6c,_0x3803b2){return new Promise(function(_0x154ba2,_0x537d57){var _0x34ee74={'method':_0x5b03('0x22'),'uri':_0x584b6c+_0x5b03('0x43')+'?'+_0x3803b2,'body':{'short_description':_0x55ed4a,'global':!![],'active':!![],'name':_0x55ed4a},'auth':_0x45dd20,'json':!![]};return rp(_0x34ee74)[_0x5b03('0xe')](function(_0x107ea4){var _0x407c07=_0x107ea4[_0x5b03('0x11')][_0x5b03('0x1d')];_0x154ba2(_0x407c07);});});}function getRemoteTag(_0x1e58a8,_0x3fbb28,_0xf0c355,_0x429748,_0x3bc9c0){return new Promise(function(_0xe40693,_0x5157b0){var _0x4f50c7={'method':_0x5b03('0xc'),'uri':_0xf0c355+_0x5b03('0x43')+_0x5b03('0x44')+_0x1e58a8+'&'+_0x429748,'auth':_0x3fbb28,'json':!![]};return rp(_0x4f50c7)['then'](function(_0x3a68e6){if(_0x3a68e6['result']['length']>0x0){var _0x30cef1=_0x3a68e6[_0x5b03('0x11')][0x0][_0x5b03('0x1d')];_0xe40693(_0x30cef1);}else{return createRemoteTag(_0x1e58a8,_0x3fbb28,_0xf0c355,_0x429748)['then'](function(_0x5bebf3){_0xe40693(_0x5bebf3);});}});});}function assignTagToIncident(_0x2103ca,_0x2faedd,_0xa92521,_0x5059ff,_0x50af95){return new Promise(function(_0x1678d4,_0x53af06){var _0xe05576={'method':_0x5b03('0x22'),'uri':_0xa92521+_0x5b03('0x45')+'?'+_0x50af95,'body':{'label':_0x2103ca,'table':_0x5b03('0x3b'),'id_type':_0x5b03('0x46'),'table_key':_0x5059ff['ticketId'],'title':'Incident\x20-\x20'+_0x5059ff[_0x5b03('0x40')],'id_display':_0x5059ff[_0x5b03('0x40')]},'auth':_0x2faedd,'json':!![]};return rp(_0xe05576)[_0x5b03('0xe')](function(_0xd98f6c){_0x1678d4();})[_0x5b03('0x14')](function(){_0x1678d4();});});}function manageTags(_0x28ad4d,_0x35509e,_0xadc767,_0x224844,_0x417f0d,_0x24490b,_0x271081){return new Promise(function(_0x58c9a7,_0x34fc47){var _0x49f453=[];_0x35509e['forEach'](function(_0x22add8){_0x49f453[_0x5b03('0x47')](getRemoteTag(_0x22add8,_0xadc767,_0x224844,_0x24490b,_0x271081));});return Promise[_0x5b03('0x48')](_0x49f453)[_0x5b03('0xe')](function(_0x5534f7){if(_0x5534f7[_0x5b03('0xf')]){logger[_0x5b03('0x12')]('['+[_0x28ad4d['toUpperCase']()]+_0x5b03('0x49'),_0x5534f7);var _0x5b9933=[];_0x5534f7[_0x5b03('0x2b')](function(_0x529d0b){_0x5b9933['push'](assignTagToIncident(_0x529d0b,_0xadc767,_0x224844,_0x417f0d,_0x24490b));});return Promise[_0x5b03('0x48')](_0x5b9933)[_0x5b03('0xe')](function(){_0x58c9a7();})[_0x5b03('0x14')](function(){_0x58c9a7();});}else{_0x58c9a7();}});});}function getTags(_0x3f0e4f,_0x3cccf2,_0x18293d,_0x2a1d42,_0x2eda70,_0x4c4184){return function(_0xea934e){return new Promise(function(_0x2d0344,_0x5d1c81){var _0x93c38f=[];var _0x2aa222=_0x2a1d42[_0x5b03('0x4a')];if(_0x2aa222&&_0x2aa222[_0x5b03('0xf')]>0x0){_0x93c38f=_[_0x5b03('0x4b')](_0x2aa222,_0x5b03('0x38'));}if(_0x93c38f[_0x5b03('0xf')]>0x0){return manageTags(_0x3f0e4f,_0x93c38f,_0x3cccf2,_0x18293d,_0xea934e,_0x2eda70,_0x4c4184)[_0x5b03('0xe')](function(){_0x2d0344(_0xea934e);});}else{_0x2d0344(_0xea934e);}});};}function emit(_0x5d4936,_0x4cefff,_0x24a2cc){var _0x1da2c7=_0x5b03('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x5b03('0x4d')+_0x5b03('0x4e');var _0x5673a9={'uri':_0x5d4936+_0x5b03('0x4f')+_0x24a2cc+_0x1da2c7};io['to'](util['format'](_0x5b03('0x50'),_0x4cefff))[_0x5b03('0x51')]('trigger:browser:url',_0x5673a9);}exports['cs']=function(_0x4e6e43,_0x316927,_0x1d1521,_0x4fb80c,_0xff5d18,_0x49b4b1,_0x1a2d43,_0x258b86){var _0x1f0da3={};var _0x5b8896={'user':_0x49b4b1[_0x5b03('0x52')],'pass':_0x49b4b1[_0x5b03('0x53')]};var _0x292c73=_0x5b03('0x54');var _0x55b2f1=_0x5b03('0x55');_0x49b4b1['remoteUri']=intUtil[_0x5b03('0x56')](_0x49b4b1['remoteUri']);_0x49b4b1[_0x5b03('0x57')]=intUtil[_0x5b03('0x56')](_0x49b4b1['serverUrl']);var _0x33af6c=util['format']('%s/api/now/table/',_0x49b4b1[_0x5b03('0x58')]);_0x1f0da3[_0x5b03('0x1e')]=!_['isNil'](_0x4fb80c)?_0x4fb80c[_0x5b03('0x59')]:null;_0x1f0da3[_0x5b03('0x1f')]=_0x49b4b1['email'];_0x1f0da3[_0x5b03('0x24')]=_0x258b86[_0x5b03('0x31')]()===_0x5b03('0x3a')?_0x316927['destcalleridnum']:_0x316927[_0x5b03('0x5a')];_0x1f0da3[_0x5b03('0x5b')]=_0x258b86===_0x5b03('0x5c')||_0x258b86===_0x5b03('0x5d')?_0x5b03('0x5c'):'outbound';var _0x48620f=util[_0x5b03('0x5e')](_0x5b03('0x5f'),_0x49b4b1[_0x5b03('0x57')],_0x316927['uniqueid'],md5(_0x316927[_0x5b03('0x60')]));if(_0xff5d18&&_0xff5d18[_0x5b03('0x61')]){logger[_0x5b03('0x12')]('[QUEUE]',_0x5b03('0x62'));_0x316927[_0x5b03('0x63')]=_0x48620f;}else if(_0x1a2d43&&_0x1a2d43[_0x5b03('0x64')]&&_0x1a2d43['recordingFormat']!=='none'){logger['info'](_0x5b03('0x65'),_0x5b03('0x62'));_0x316927[_0x5b03('0x63')]=_0x48620f;}else{_0x316927['recordingURL']='';}return getAdminUser(_0x258b86,_0x5b8896,_0x1f0da3,_0x33af6c,_0x55b2f1,_0x292c73)[_0x5b03('0xe')](getUser(_0x258b86,_0x5b8896,_0x33af6c,_0x55b2f1,_0x292c73))[_0x5b03('0xe')](getEndUser(_0x258b86,_0x5b8896,_0x33af6c,_0x55b2f1,_0x292c73))['then'](getTicket(_0x258b86,_0x5b8896,_0x33af6c,_0x1d1521,_0x316927,_0x55b2f1))[_0x5b03('0xe')](function(_0x1150fa){logger[_0x5b03('0x12')](util[_0x5b03('0x5e')](_0x5b03('0x66'),_0x1150fa[_0x5b03('0x3f')]));logger[_0x5b03('0x12')](util[_0x5b03('0x5e')](_0x5b03('0x67'),_0x258b86));if(_0x258b86!==_0x5b03('0x5d')){logger[_0x5b03('0x12')]('['+[_0x258b86['toUpperCase']()]+']',_0x5b03('0x68'));emit(_0x49b4b1[_0x5b03('0x58')],_0x4fb80c['name'],_0x1150fa[_0x5b03('0x3f')]);}})[_0x5b03('0x14')](function(_0x4532e3){logger[_0x5b03('0x15')]('['+[_0x258b86[_0x5b03('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x5b03('0x69')](_0x4532e3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x01f0=['variable','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','true','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketId','forEach','all','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/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','stripTrailingSlash','remoteUri','serverUrl','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','userEmail','adminEmail','],\x20createEndUser\x20input\x20crm','POST','System','endUserNumber','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','picklist','type','nameField','content','toString','idField','customField','toLowerCase'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x01f0,0x109));var _0x001f=function(_0x39d9b3,_0x435774){_0x39d9b3=_0x39d9b3-0x0;var _0x32bfc7=_0x01f0[_0x39d9b3];return _0x32bfc7;};'use strict';var _=require(_0x001f('0x0'));var Promise=require(_0x001f('0x1'));var rp=require(_0x001f('0x2'));var util=require('util');var md5=require(_0x001f('0x3'));var Redis=require(_0x001f('0x4'));var intUtil=require(_0x001f('0x5'));var config=require(_0x001f('0x6'));var logger=require(_0x001f('0x7'))(_0x001f('0x8'));config[_0x001f('0x9')]=_['defaults'](config[_0x001f('0x9')],{'host':_0x001f('0xa'),'port':0x18eb});var io=require(_0x001f('0xb'))(new Redis(config[_0x001f('0x9')]));function getAdminUser(_0x1e2859,_0x32aef0,_0x13ebc5,_0x4a2b90,_0xc44bc5,_0x2cb0ed){return new Promise(function(_0x548697,_0x11caf5){var _0x1d9e9c={'method':_0x001f('0xc'),'uri':_0x4a2b90+_0x001f('0xd')+'&'+_0xc44bc5+'&'+_0x2cb0ed,'auth':_0x32aef0,'json':!![]};return rp(_0x1d9e9c)[_0x001f('0xe')](function(_0x23cc15){if(_0x23cc15[_0x001f('0xf')][_0x001f('0x10')]>0x0){_0x13ebc5[_0x001f('0x11')]=_0x23cc15[_0x001f('0xf')][0x0][_0x001f('0x12')];}logger[_0x001f('0x13')]('['+[_0x1e2859[_0x001f('0x14')]()]+_0x001f('0x15'),_0x13ebc5);_0x548697(_0x13ebc5);})[_0x001f('0x16')](function(_0x4c3e39){logger[_0x001f('0x17')]('['+[_0x1e2859[_0x001f('0x14')]()]+']',_0x4c3e39[_0x001f('0x18')]);_0x11caf5(_0x4c3e39[_0x001f('0x18')]);});});}function getUser(_0x3ac46a,_0x497c51,_0x6efb60,_0x49d25d,_0x3e3848){return function(_0x46471c){logger[_0x001f('0x13')]('['+[_0x3ac46a[_0x001f('0x14')]()]+'],\x20getUser\x20input\x20crm',_0x46471c);return new Promise(function(_0x3b5b9e,_0x504113){if(intUtil[_0x001f('0x19')](_0x46471c['userEmail'])){var _0x53d5a4={'method':'GET','uri':_0x6efb60+_0x001f('0x1a')+_0x46471c['userEmail']+'&'+_0x49d25d+'&'+_0x3e3848,'auth':_0x497c51,'json':!![]};logger['info']('['+[_0x3ac46a[_0x001f('0x14')]()]+_0x001f('0x1b'),_0x53d5a4);return rp(_0x53d5a4)[_0x001f('0xe')](function(_0x25a678){logger[_0x001f('0x13')]('['+[_0x3ac46a[_0x001f('0x14')]()]+_0x001f('0x1c'),_0x25a678);if(_0x25a678['result'][_0x001f('0x10')]>0x0&&String(_0x25a678[_0x001f('0xf')][0x0]['active'])==='true'){_0x46471c[_0x001f('0x1d')]=_0x25a678['result'][0x0][_0x001f('0x12')];}else{_0x46471c[_0x001f('0x1d')]=_0x46471c[_0x001f('0x11')];_0x46471c[_0x001f('0x1e')]=_0x46471c[_0x001f('0x1f')];}logger[_0x001f('0x13')]('['+[_0x3ac46a[_0x001f('0x14')]()]+'],\x20getUser\x20crm',_0x46471c);_0x3b5b9e(_0x46471c);})[_0x001f('0x16')](function(_0xa4c657){logger[_0x001f('0x17')]('['+[_0x3ac46a[_0x001f('0x14')]()]+']',_0xa4c657[_0x001f('0x18')]);_0x504113(_0xa4c657[_0x001f('0x18')]);});}else{logger[_0x001f('0x13')]('['+[_0x3ac46a['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x46471c[_0x001f('0x1d')]=_0x46471c[_0x001f('0x11')];_0x46471c[_0x001f('0x1e')]=_0x46471c[_0x001f('0x1f')];_0x3b5b9e(_0x46471c);}});};}function createEndUser(_0x548a07,_0x4c8b8d,_0x395a1b,_0x5b80c4,_0x5ad07e){logger[_0x001f('0x13')]('['+[_0x548a07[_0x001f('0x14')]()]+_0x001f('0x20'),_0x395a1b);return new Promise(function(_0x43633e,_0x3ea895){var _0x41f836={'method':_0x001f('0x21'),'uri':_0x5b80c4+'sys_user?'+_0x5ad07e,'body':{'user_name':_0x395a1b['endUserNumber'],'roles':'user','first_name':_0x395a1b['endUserNumber'],'active':'true','date_format':_0x001f('0x22'),'phone':_0x395a1b[_0x001f('0x23')]},'auth':_0x4c8b8d,'json':!![]};return rp(_0x41f836)['then'](function(_0x466c1b){logger[_0x001f('0x13')]('['+[_0x548a07[_0x001f('0x14')]()]+'],\x20EndUser\x20schema',_0x466c1b['result']);_0x395a1b['endUserId']=_0x466c1b['result'][_0x001f('0x12')];_0x43633e(_0x395a1b);})[_0x001f('0x16')](function(_0x5f6b2d){logger['error']('['+[_0x548a07['toUpperCase']()]+']',_0x5f6b2d[_0x001f('0x18')]);_0x3ea895(_0x5f6b2d[_0x001f('0x18')]);});});}function getEndUser(_0x1aeb72,_0x5e4636,_0x5e9d26,_0x453dbc,_0x387865){return function(_0x3197dc){logger[_0x001f('0x13')]('['+[_0x1aeb72[_0x001f('0x14')]()]+_0x001f('0x24'),_0x3197dc);return new Promise(function(_0x2f7d34,_0x180f23){var _0x350b7a={'method':_0x001f('0xc'),'uri':_0x5e9d26+_0x001f('0x25')+_0x3197dc[_0x001f('0x23')]+'&'+_0x453dbc+'&'+_0x387865,'auth':_0x5e4636,'json':!![]};return rp(_0x350b7a)[_0x001f('0xe')](function(_0xbb59fc){if(_0xbb59fc[_0x001f('0xf')][_0x001f('0x10')]>0x0){_0x3197dc[_0x001f('0x26')]=_0xbb59fc[_0x001f('0xf')][0x0][_0x001f('0x12')];logger[_0x001f('0x13')]('['+[_0x1aeb72[_0x001f('0x14')]()]+_0x001f('0x27'),_0x3197dc);_0x2f7d34(_0x3197dc);}else{return createEndUser(_0x1aeb72,_0x5e4636,_0x3197dc,_0x5e9d26,_0x453dbc)[_0x001f('0xe')](function(_0x2dd6be){logger[_0x001f('0x13')]('['+[_0x1aeb72['toUpperCase']()]+_0x001f('0x28'),_0x2dd6be);_0x2f7d34(_0x2dd6be);});}})[_0x001f('0x16')](function(_0x399791){logger[_0x001f('0x17')]('['+[_0x1aeb72[_0x001f('0x14')]()]+']',_0x399791['message']);_0x180f23(_0x399791[_0x001f('0x18')]);});});};}function getCustomFields(_0x1e00c7,_0x4e20fc){var _0x13d323={};if(_0x1e00c7[_0x001f('0x10')]>0x0){_['forEach'](_0x1e00c7,function(_0x339a40){if(_[_0x001f('0x29')](['string',_0x001f('0x2a')],_0x339a40[_0x001f('0x2b')])&&_0x339a40['nameField']&&!_0x339a40['customField']){_0x13d323[_0x339a40[_0x001f('0x2c')]['toLowerCase']()]=_0x339a40[_0x001f('0x2d')][_0x001f('0x2e')]();}else if(_[_0x001f('0x29')](['string',_0x001f('0x2a')],_0x339a40[_0x001f('0x2b')])&&_0x339a40[_0x001f('0x2f')]&&_0x339a40[_0x001f('0x30')]){_0x13d323[_0x339a40[_0x001f('0x2f')][_0x001f('0x31')]()]=_0x339a40['content'][_0x001f('0x2e')]();}else if(_0x339a40['type']===_0x001f('0x32')&&_0x339a40['variableName']&&_0x339a40[_0x001f('0x2f')]&&_0x339a40[_0x001f('0x30')]){_0x13d323[_0x339a40[_0x001f('0x2f')][_0x001f('0x31')]()]=_0x4e20fc[_0x339a40['variableName']][_0x001f('0x2e')]();}else if(_0x339a40[_0x001f('0x2b')]===_0x001f('0x33')&&_0x339a40[_0x001f('0x34')]&&_0x339a40['Variable'][_0x001f('0x35')]&&_0x339a40[_0x001f('0x2f')]&&_0x339a40['customField']){_0x13d323[_0x339a40[_0x001f('0x2f')][_0x001f('0x31')]()]=_0x4e20fc[_0x339a40[_0x001f('0x34')][_0x001f('0x35')][_0x001f('0x31')]()]['toString']();}});}return _0x13d323;}function getTicket(_0x350e88,_0x42df13,_0x3b8df7,_0x2ae22f,_0xc58b5e,_0x445d0f){return function(_0x5e0188){logger[_0x001f('0x13')]('['+[_0x350e88['toUpperCase']()]+_0x001f('0x36'),_0x5e0188);return new Promise(function(_0x4b4cb6,_0x2f40d4){var _0x1b4b6e=_0x350e88[_0x001f('0x31')]()===_0x001f('0x37')?_0x5e0188[_0x001f('0x1d')]:_0x5e0188['endUserId'];var _0x245702={'method':_0x001f('0x21'),'uri':_0x3b8df7+_0x001f('0x38')+'?'+_0x445d0f,'body':Object['assign']({},{'active':_0x001f('0x39'),'caller_id':_0x1b4b6e,'assigned_to':_0x5e0188[_0x001f('0x1d')],'short_description':intUtil[_0x001f('0x3a')](_0x2ae22f[_0x001f('0x3b')],_0xc58b5e,'\x20'),'description':intUtil[_0x001f('0x3a')](_0x2ae22f[_0x001f('0x3c')],_0xc58b5e,'\x0a')},getCustomFields(_0x2ae22f[_0x001f('0x3d')],_0xc58b5e)),'auth':_0x42df13,'json':!![]};return rp(_0x245702)[_0x001f('0xe')](function(_0x4ef7c8){logger['info']('['+[_0x350e88[_0x001f('0x14')]()]+_0x001f('0x3e'),_0x4ef7c8[_0x001f('0xf')]);_0x5e0188['ticketId']=_0x4ef7c8[_0x001f('0xf')]['sys_id'];_0x5e0188[_0x001f('0x3f')]=_0x4ef7c8['result'][_0x001f('0x40')];logger[_0x001f('0x13')]('['+[_0x350e88[_0x001f('0x14')]()]+_0x001f('0x41'),_0x5e0188);_0x4b4cb6(_0x5e0188);})[_0x001f('0x16')](function(_0x382ad8){logger[_0x001f('0x17')]('['+[_0x350e88[_0x001f('0x14')]()]+']',_0x382ad8['message']);_0x2f40d4(_0x382ad8['message']);});});};}function createRemoteTag(_0xc8e078,_0x420c71,_0x33274e,_0x25702a){return new Promise(function(_0x36d9cf,_0x1a024a){var _0x53a07e={'method':_0x001f('0x21'),'uri':_0x33274e+_0x001f('0x42')+'?'+_0x25702a,'body':{'short_description':_0xc8e078,'global':!![],'active':!![],'name':_0xc8e078},'auth':_0x420c71,'json':!![]};return rp(_0x53a07e)[_0x001f('0xe')](function(_0x247506){var _0x1b0b6b=_0x247506[_0x001f('0xf')][_0x001f('0x12')];_0x36d9cf(_0x1b0b6b);});});}function getRemoteTag(_0x442403,_0x2deb06,_0x3857bc,_0xf42919,_0x6ce178){return new Promise(function(_0x430ede,_0x33f6ff){var _0x24c160={'method':'GET','uri':_0x3857bc+_0x001f('0x42')+'?sysparm_query=name%3D'+_0x442403+'&'+_0xf42919,'auth':_0x2deb06,'json':!![]};return rp(_0x24c160)[_0x001f('0xe')](function(_0x174de8){if(_0x174de8[_0x001f('0xf')][_0x001f('0x10')]>0x0){var _0x24840f=_0x174de8[_0x001f('0xf')][0x0][_0x001f('0x12')];_0x430ede(_0x24840f);}else{return createRemoteTag(_0x442403,_0x2deb06,_0x3857bc,_0xf42919)[_0x001f('0xe')](function(_0x3820e8){_0x430ede(_0x3820e8);});}});});}function assignTagToIncident(_0x4bff5d,_0x29abca,_0x98eb3e,_0x1633eb,_0xa10537){return new Promise(function(_0x372c70,_0x272b04){var _0x41d3ca={'method':_0x001f('0x21'),'uri':_0x98eb3e+_0x001f('0x43')+'?'+_0xa10537,'body':{'label':_0x4bff5d,'table':_0x001f('0x38'),'id_type':_0x001f('0x44'),'table_key':_0x1633eb[_0x001f('0x45')],'title':'Incident\x20-\x20'+_0x1633eb[_0x001f('0x3f')],'id_display':_0x1633eb[_0x001f('0x3f')]},'auth':_0x29abca,'json':!![]};return rp(_0x41d3ca)[_0x001f('0xe')](function(_0x1c4611){_0x372c70();})[_0x001f('0x16')](function(){_0x372c70();});});}function manageTags(_0xfce7f6,_0x462c93,_0x25c7da,_0x2fe779,_0x5839e4,_0x3d7d05,_0x2592fa){return new Promise(function(_0x404669,_0x4c48bb){var _0x1040a4=[];_0x462c93[_0x001f('0x46')](function(_0x252649){_0x1040a4['push'](getRemoteTag(_0x252649,_0x25c7da,_0x2fe779,_0x3d7d05,_0x2592fa));});return Promise[_0x001f('0x47')](_0x1040a4)[_0x001f('0xe')](function(_0x559585){if(_0x559585[_0x001f('0x10')]){logger[_0x001f('0x13')]('['+[_0xfce7f6['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x559585);var _0x282b1b=[];_0x559585['forEach'](function(_0x2f8a08){_0x282b1b[_0x001f('0x48')](assignTagToIncident(_0x2f8a08,_0x25c7da,_0x2fe779,_0x5839e4,_0x3d7d05));});return Promise[_0x001f('0x47')](_0x282b1b)[_0x001f('0xe')](function(){_0x404669();})[_0x001f('0x16')](function(){_0x404669();});}else{_0x404669();}});});}function getTags(_0x273b9e,_0xdc360,_0x526f14,_0x4bd189,_0x3f8cf6,_0x622239){return function(_0x145086){return new Promise(function(_0x929c46,_0x5d94b6){var _0xab7bfc=[];var _0x211c80=_0x4bd189[_0x001f('0x49')];if(_0x211c80&&_0x211c80[_0x001f('0x10')]>0x0){_0xab7bfc=_[_0x001f('0x4a')](_0x211c80,_0x001f('0x35'));}if(_0xab7bfc[_0x001f('0x10')]>0x0){return manageTags(_0x273b9e,_0xab7bfc,_0xdc360,_0x526f14,_0x145086,_0x3f8cf6,_0x622239)[_0x001f('0xe')](function(){_0x929c46(_0x145086);});}else{_0x929c46(_0x145086);}});};}function emit(_0x54ede4,_0x2db1a0,_0x35b79c){var _0x2ef71d=_0x001f('0x4b')+_0x001f('0x4c')+_0x001f('0x4d')+'%255EORDERBYDESCnumber';var _0x545e0d={'uri':_0x54ede4+_0x001f('0x4e')+_0x35b79c+_0x2ef71d};io['to'](util[_0x001f('0x4f')](_0x001f('0x50'),_0x2db1a0))[_0x001f('0x51')](_0x001f('0x52'),_0x545e0d);}exports['cs']=function(_0x16c38d,_0x545f82,_0x23fc7a,_0x4d4c05,_0x390b96,_0x510c8e,_0x2cf965,_0x44806a){var _0x181b5f={};var _0x1604a4={'user':_0x510c8e[_0x001f('0x53')],'pass':_0x510c8e[_0x001f('0x54')]};var _0x5ec2ef=_0x001f('0x55');var _0x275fd0=_0x001f('0x56');_0x510c8e['remoteUri']=intUtil[_0x001f('0x57')](_0x510c8e[_0x001f('0x58')]);_0x510c8e['serverUrl']=intUtil[_0x001f('0x57')](_0x510c8e[_0x001f('0x59')]);var _0x386b1e=util['format']('%s/api/now/table/',_0x510c8e[_0x001f('0x58')]);_0x181b5f[_0x001f('0x1e')]=!_['isNil'](_0x4d4c05)?_0x4d4c05[_0x001f('0x5a')]:null;_0x181b5f[_0x001f('0x1f')]=_0x510c8e['email'];_0x181b5f[_0x001f('0x23')]=_0x44806a[_0x001f('0x31')]()===_0x001f('0x37')?_0x545f82[_0x001f('0x5b')]:_0x545f82[_0x001f('0x5c')];_0x181b5f['callDirection']=_0x44806a===_0x001f('0x5d')||_0x44806a===_0x001f('0x5e')?_0x001f('0x5d'):'outbound';var _0x4aa6d8=util[_0x001f('0x4f')](_0x001f('0x5f'),_0x510c8e[_0x001f('0x59')],_0x545f82[_0x001f('0x60')],md5(_0x545f82['uniqueid']));if(_0x390b96&&_0x390b96[_0x001f('0x61')]){logger[_0x001f('0x13')]('[QUEUE]',_0x001f('0x62'));_0x545f82[_0x001f('0x63')]=_0x4aa6d8;}else if(_0x2cf965&&_0x2cf965['recordingFormat']&&_0x2cf965[_0x001f('0x64')]!==_0x001f('0x65')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x545f82['recordingURL']=_0x4aa6d8;}else{_0x545f82[_0x001f('0x63')]='';}return getAdminUser(_0x44806a,_0x1604a4,_0x181b5f,_0x386b1e,_0x275fd0,_0x5ec2ef)['then'](getUser(_0x44806a,_0x1604a4,_0x386b1e,_0x275fd0,_0x5ec2ef))[_0x001f('0xe')](getEndUser(_0x44806a,_0x1604a4,_0x386b1e,_0x275fd0,_0x5ec2ef))['then'](getTicket(_0x44806a,_0x1604a4,_0x386b1e,_0x23fc7a,_0x545f82,_0x275fd0))[_0x001f('0xe')](function(_0x36ed68){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x36ed68['ticketId']));logger[_0x001f('0x13')](util[_0x001f('0x4f')]('call\x20direction:\x20%s',_0x44806a));if(_0x44806a!==_0x001f('0x5e')){logger[_0x001f('0x13')]('['+[_0x44806a[_0x001f('0x14')]()]+']',_0x001f('0x66'));emit(_0x510c8e[_0x001f('0x58')],_0x4d4c05['name'],_0x36ed68[_0x001f('0x45')]);}})['catch'](function(_0x3375b6){logger['error']('['+[_0x44806a[_0x001f('0x14')]()]+_0x001f('0x67'),util[_0x001f('0x68')](_0x3375b6,{'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 83d986a..7474218 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 _0x6042=['','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','customField','toLowerCase','content','custom_fields','idField','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','remoteUri','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','Outbound','The\x20Ticket\x20ID\x20is:','catch','error','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','isNil','Getting\x20agent\x20with\x20name','Employees','entry_list','find','name_value_list','user_name','Agent\x20found!','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name'];(function(_0x212579,_0xdb4d5a){var _0x55d50e=function(_0x38fa1d){while(--_0x38fa1d){_0x212579['push'](_0x212579['shift']());}};_0x55d50e(++_0xdb4d5a);}(_0x6042,0x1b7));var _0x2604=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6042[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x2604('0x0'));var rp=require(_0x2604('0x1'));var BPromise=require(_0x2604('0x2'));var md5=require(_0x2604('0x3'));var util=require(_0x2604('0x4'));var Redis=require(_0x2604('0x5'));var intUtil=require(_0x2604('0x6'));var config=require('../../../../config/environment');var logger=require(_0x2604('0x7'))(_0x2604('0x8'));config['redis']=_[_0x2604('0x9')](config[_0x2604('0xa')],{'host':_0x2604('0xb'),'port':0x18eb});var io=require(_0x2604('0xc'))(new Redis(config[_0x2604('0xa')]));var def={'method':_0x2604('0xd'),'json':!![]};function emit(_0x249404,_0x470874,_0x44564b){io['to'](_0x249404)[_0x2604('0xe')](_0x470874,_0x44564b);}function getTicket(_0x504b7d,_0x1e37c4,_0x4a8148,_0x3481b8,_0x203cca,_0x2b4598,_0x2a6e27,_0x4fb010){logger[_0x2604('0xf')](_0x2604('0x10'));var _0x40d6c5=new Date();var _0x79bfe0=[{'name':_0x2604('0x11'),'value':intUtil['getString'](_0x3481b8[_0x2604('0x12')],_0x203cca,'\x20')},{'name':_0x2604('0x13'),'value':_0x1e37c4['id']},{'name':_0x2604('0x14'),'value':_0x1e37c4['id']},{'name':'description','value':intUtil[_0x2604('0x15')](_0x3481b8[_0x2604('0x16')],_0x203cca,'\x0a')},{'name':_0x2604('0x17'),'value':_0x40d6c5[_0x2604('0x18')]()[_0x2604('0x19')](0x0,0x13)[_0x2604('0x1a')]('T','\x20')},{'name':_0x2604('0x1b'),'value':'0'},{'name':_0x2604('0x1c'),'value':'15'},{'name':'parent_id','value':_0x4a8148['id']},{'name':_0x2604('0x1d'),'value':'Contacts'},{'name':_0x2604('0x1e'),'value':_0x4a8148[_0x2604('0x11')]},{'name':_0x2604('0x1f'),'value':_0x4fb010}];if(_0x2b4598[_0x2604('0x20')]){_[_0x2604('0x21')](_0x2b4598,function(_0x2cc451){if(_0x203cca[_0x2cc451[_0x2604('0x22')]]){_0x79bfe0[_0x2604('0x23')]({'name':_0x2cc451['idField'],'value':_0x203cca[_0x2cc451['variableName']]});}});}return request({'form':{'method':_0x2604('0x24'),'input_type':_0x2604('0x25'),'response_type':_0x2604('0x25'),'rest_data':JSON[_0x2604('0x26')]({'session':_0x2a6e27['id'],'module_name':_0x2604('0x27'),'name_value_list':_0x79bfe0})}});}function getAuth(_0x34acca){return util[_0x2604('0x28')](_0x2604('0x29'),new Buffer(_0x34acca['apiKey']+':X')[_0x2604('0x2a')](_0x2604('0x2b')));}function getServerInfo(_0x15e1b2){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x2604('0x25'),'rest_data':JSON[_0x2604('0x26')]({'session':_0x15e1b2['id']})}});}function getUser(_0x47dbbf,_0x40796e,_0x1ba7b7){if(!_[_0x2604('0x2c')](_0x40796e)){logger[_0x2604('0xf')](_0x2604('0x2d'),_0x40796e);return request({'form':{'method':'get_entry_list','input_type':_0x2604('0x25'),'response_type':_0x2604('0x25'),'rest_data':JSON[_0x2604('0x26')]({'session':_0x1ba7b7['id'],'module_name':_0x2604('0x2e'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x40796e),'order_by':'','offset':'0','select_fields':['id',_0x2604('0x11'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3f7433){if(_0x3f7433[_0x2604('0x2f')]['length']){var _0x41159a=_[_0x2604('0x30')](_0x3f7433['entry_list'],function(_0xd971d2){return _0xd971d2[_0x2604('0x31')][_0x2604('0x32')]['value']===_0x40796e;});if(_0x41159a){logger['info'](_0x2604('0x33'));return BPromise[_0x2604('0x34')]({'id':_0x41159a[_0x2604('0x31')]['id'][_0x2604('0x35')],'name':_0x41159a[_0x2604('0x31')][_0x2604('0x11')]['value']});}}logger[_0x2604('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x2604('0x34')]({'id':_0x1ba7b7[_0x2604('0x31')][_0x2604('0x36')][_0x2604('0x35')],'name':_0x1ba7b7[_0x2604('0x31')][_0x2604('0x32')][_0x2604('0x35')]});});}else{logger['info'](_0x2604('0x37'));return BPromise[_0x2604('0x34')]({'id':_0x1ba7b7[_0x2604('0x31')]['user_id'][_0x2604('0x35')],'name':_0x1ba7b7['name_value_list'][_0x2604('0x32')][_0x2604('0x35')]});}}function getEndUser(_0x3be507,_0x10d9ef,_0x4a0ce0,_0x56d9a5){logger[_0x2604('0xf')](_0x2604('0x38'),_0x4a0ce0);return request({'form':{'method':_0x2604('0x39'),'input_type':_0x2604('0x25'),'response_type':_0x2604('0x25'),'rest_data':JSON[_0x2604('0x26')]({'session':_0x56d9a5['id'],'module_name':_0x2604('0x3a'),'query':util[_0x2604('0x28')](_0x2604('0x3b'),_0x4a0ce0),'order_by':'','offset':'0','select_fields':['id',_0x2604('0x11'),_0x2604('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2604('0x3d')](function(_0x406816){if(_0x406816[_0x2604('0x2f')]['length']){var _0x5512a7=_['find'](_0x406816[_0x2604('0x2f')],function(_0x5b81bb){return _0x5b81bb[_0x2604('0x31')][_0x2604('0x3c')]['value']===_0x4a0ce0;});if(_0x5512a7){logger[_0x2604('0xf')](_0x2604('0x3e'));return BPromise['resolve']({'id':_0x5512a7[_0x2604('0x31')]['id'][_0x2604('0x35')],'name':_0x5512a7[_0x2604('0x31')]['name']['value'],'phone':_0x5512a7[_0x2604('0x31')][_0x2604('0x3c')]['value']});}}else{logger[_0x2604('0xf')](_0x2604('0x3f'));return request({'form':{'method':_0x2604('0x24'),'input_type':_0x2604('0x25'),'response_type':_0x2604('0x25'),'rest_data':JSON[_0x2604('0x26')]({'session':_0x56d9a5['id'],'module_name':_0x2604('0x3a'),'name_value_list':[{'name':_0x2604('0x40'),'value':_0x10d9ef!==_0x2604('0x41')?_0x10d9ef:util[_0x2604('0x28')](_0x2604('0x42'),_0x4a0ce0)},{'name':_0x2604('0x3c'),'value':_0x4a0ce0}]})}})['then'](function(_0x54e02f){logger[_0x2604('0xf')](_0x2604('0x43'));return BPromise['resolve']({'id':_0x54e02f['id'],'name':_0x54e02f['entry_list']['first_name'][_0x2604('0x35')],'phone':_0x54e02f[_0x2604('0x2f')][_0x2604('0x3c')]['value']});});}});}function request(_0x3b314d){logger[_0x2604('0x44')](_0x2604('0x45'),JSON['stringify'](_0x3b314d));return rp(_['merge'](def,_0x3b314d));}function getTags(_0xf813cc,_0x86ca42){var _0x103472=[];if(_0xf813cc&&_0xf813cc[_0x2604('0x20')]>0x0){_0x103472=_[_0x2604('0x46')](_0xf813cc,_0x86ca42);}return _0x103472;}function getCustomFields(_0x5144e8,_0x1dbb5f){var _0x56cbb6=[];var _0x5393ef={'custom_fields':[]};if(_0x5144e8['length']>0x0){_[_0x2604('0x21')](_0x5144e8,function(_0x456e6f){if(_0x456e6f[_0x2604('0x47')]===_0x2604('0x48')&&_0x456e6f['nameField']&&!_0x456e6f[_0x2604('0x49')]){_0x5393ef[_0x456e6f['nameField'][_0x2604('0x4a')]()]=_0x456e6f[_0x2604('0x4b')][_0x2604('0x2a')]();}else if(_0x456e6f[_0x2604('0x47')]===_0x2604('0x48')&&_0x456e6f['idField']&&_0x456e6f[_0x2604('0x49')]){_0x5393ef[_0x2604('0x4c')][_0x2604('0x23')]({'id':_0x456e6f[_0x2604('0x4d')],'value':_0x456e6f[_0x2604('0x4b')][_0x2604('0x2a')]()});}else if(_0x456e6f[_0x2604('0x47')]==='variable'&&_0x456e6f[_0x2604('0x22')]&&_0x456e6f[_0x2604('0x4d')]&&_0x456e6f[_0x2604('0x49')]){_0x1dbb5f[_0x456e6f[_0x2604('0x22')]]&&_0x5393ef[_0x2604('0x4c')][_0x2604('0x23')]({'id':_0x456e6f[_0x2604('0x4d')],'value':_0x1dbb5f[_0x456e6f[_0x2604('0x22')]]['toString']()});}else if(_0x456e6f[_0x2604('0x47')]===_0x2604('0x4e')&&_0x456e6f[_0x2604('0x4f')]&&_0x456e6f[_0x2604('0x4f')]['name']&&_0x456e6f['idField']&&_0x456e6f['customField']){_0x1dbb5f[_0x456e6f[_0x2604('0x4f')]['name'][_0x2604('0x4a')]()]&&_0x5393ef[_0x2604('0x4c')][_0x2604('0x23')]({'id':_0x456e6f['idField'],'value':_0x1dbb5f[_0x456e6f[_0x2604('0x4f')][_0x2604('0x11')][_0x2604('0x4a')]()][_0x2604('0x2a')]()});}});}return _0x5393ef;}function getConnection(_0x4549c0){return request({'method':_0x2604('0xd'),'form':{'method':_0x2604('0x50'),'input_type':_0x2604('0x25'),'response_type':'JSON','rest_data':JSON[_0x2604('0x26')]({'user_auth':{'user_name':_0x4549c0[_0x2604('0x51')],'password':_0x4549c0['password'],'encryption':'PLAIN'},'application':_0x2604('0x52')})}})[_0x2604('0x3d')](function(_0x37bb00){var _0x276320=_0x37bb00;if(_0x276320['id']){def[_0x2604('0x53')]=_0x276320['id'];return BPromise[_0x2604('0x34')](_0x276320);}else{throw new Error(util['format'](_0x2604('0x54'),_0x4549c0['id']));}});}function setRelationship(_0x2d9807,_0x41772d,_0x2df546,_0xf14aeb){return request({'form':{'method':_0x2604('0x55'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2604('0x26')]({'session':_0x2d9807['id'],'module_name':_0x2604('0x27'),'module_id':_0x2df546['id'],'link_field_name':_0xf14aeb,'related_ids':[_0x41772d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2604('0x56')]=function(_0x33c023,_0xdcfb7c,_0x20bc43,_0x31f826,_0x4cf1cb,_0x26372e){var _0x70951e,_0x10aff2,_0x406f8c,_0x1fc55c;_0x26372e['remoteUri']=intUtil[_0x2604('0x57')](_0x26372e['remoteUri']);_0x26372e['serverUrl']=intUtil[_0x2604('0x57')](_0x26372e['serverUrl']);def[_0x2604('0x58')]=util[_0x2604('0x28')](_0x2604('0x59'),_0x26372e['remoteUri']);if(_0x4cf1cb&&_0x4cf1cb[_0x2604('0x5a')]){logger[_0x2604('0xf')](_0x2604('0x5b'),_0x2604('0x5c'));_0xdcfb7c[_0x2604('0x5d')]=util[_0x2604('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26372e[_0x2604('0x5e')],_0xdcfb7c[_0x2604('0x5f')],md5(_0xdcfb7c['uniqueid']));}else{_0xdcfb7c[_0x2604('0x5d')]='';}return getConnection(_0x26372e)[_0x2604('0x3d')](function(_0x5db6cd){_0x1fc55c=_0x5db6cd;return getUser(_0x26372e,_0x31f826[_0x2604('0x11')],_0x1fc55c);})[_0x2604('0x3d')](function(_0x3e6e8a){_0x70951e=_0x3e6e8a;logger[_0x2604('0xf')](_0x2604('0x60'),_0x70951e['id']);return getEndUser(_0x26372e,_0xdcfb7c['calleridname'],_0xdcfb7c[_0x2604('0x61')],_0x1fc55c);})[_0x2604('0x3d')](function(_0x27483f){_0x10aff2=_0x27483f;logger[_0x2604('0xf')](_0x2604('0x62'),_0x10aff2['id']);return getTicket(_0x26372e,_0x70951e,_0x10aff2,_0x20bc43,_0xdcfb7c,_0x20bc43['Fields'],_0x1fc55c,_0x2604('0x63'));})[_0x2604('0x3d')](function(_0x1b5834){_0x406f8c=_0x1b5834;logger[_0x2604('0xf')](_0x2604('0x64'));logger[_0x2604('0xf')]('The\x20Ticket\x20ID\x20is:',_0x406f8c['id']);return setRelationship(_0x1fc55c,_0x70951e,_0x406f8c,_0x2604('0x65'));})['then'](function(){return setRelationship(_0x1fc55c,_0x10aff2,_0x406f8c,_0x2604('0x66'));})[_0x2604('0x3d')](function(){return getServerInfo(_0x1fc55c);})[_0x2604('0x3d')](function(_0x3ece99){var _0x5bc5ff=parseInt(_0x3ece99[_0x2604('0x67')][_0x2604('0x68')](0x0));var _0x55abd6=util[_0x2604('0x28')](_0x2604('0x69'),_0x26372e[_0x2604('0x6a')],_0x406f8c['id']);if(_0x5bc5ff>0x6){_0x55abd6=util[_0x2604('0x28')](_0x2604('0x6b'),_0x26372e[_0x2604('0x6a')],_0x406f8c['id']);}logger['info'](_0x2604('0x5b'),_0x2604('0x6c'));emit(util[_0x2604('0x28')](_0x2604('0x6d'),_0x31f826['name']),_0x2604('0x6e'),{'uri':_0x55abd6});})['catch'](function(_0x5762f5){logger['error'](_0x2604('0x5b'),JSON['stringify'](_0x5762f5));});};exports[_0x2604('0x6f')]=function(_0x4eb770,_0x12f32b,_0x23a0df,_0xea59d3,_0x1c471b,_0x28ffcd,_0x3aba27){var _0x50ff22,_0x35ced4,_0x46f45b,_0x30608a;_0x28ffcd['remoteUri']=intUtil[_0x2604('0x57')](_0x28ffcd['remoteUri']);_0x28ffcd[_0x2604('0x5e')]=intUtil['stripTrailingSlash'](_0x28ffcd[_0x2604('0x5e')]);def['uri']=util[_0x2604('0x28')](_0x2604('0x59'),_0x28ffcd['remoteUri']);if(_0x3aba27&&_0x3aba27[_0x2604('0x70')]&&_0x3aba27[_0x2604('0x70')]!==_0x2604('0x71')){logger[_0x2604('0xf')](_0x2604('0x72'),_0x2604('0x5c'));_0x12f32b[_0x2604('0x5d')]=util['format'](_0x2604('0x73'),_0x28ffcd[_0x2604('0x5e')],_0x12f32b[_0x2604('0x5f')],md5(_0x12f32b[_0x2604('0x5f')]));}return getConnection(_0x28ffcd)[_0x2604('0x3d')](function(_0x5deda5){_0x30608a=_0x5deda5;return getUser(_0x28ffcd,_0xea59d3['name'],_0x30608a);})[_0x2604('0x3d')](function(_0x1881fd){_0x50ff22=_0x1881fd;logger[_0x2604('0xf')](_0x2604('0x60'),_0x50ff22['id']);return getEndUser(_0x28ffcd,_0x12f32b[_0x2604('0x74')],_0x12f32b[_0x2604('0x75')],_0x30608a);})[_0x2604('0x3d')](function(_0x33d6bc){_0x35ced4=_0x33d6bc;logger['info'](_0x2604('0x62'),_0x35ced4['id']);return getTicket(_0x28ffcd,_0x50ff22,_0x35ced4,_0x23a0df,_0x12f32b,_0x23a0df[_0x2604('0x76')],_0x30608a,_0x2604('0x77'));})[_0x2604('0x3d')](function(_0x53fe4c){_0x46f45b=_0x53fe4c;logger[_0x2604('0xf')]('Ticket\x20created!');logger[_0x2604('0xf')](_0x2604('0x78'),_0x46f45b['id']);return setRelationship(_0x30608a,_0x50ff22,_0x46f45b,'users');})[_0x2604('0x3d')](function(){return setRelationship(_0x30608a,_0x35ced4,_0x46f45b,_0x2604('0x66'));})[_0x2604('0x3d')](function(){return getServerInfo(_0x30608a);})[_0x2604('0x3d')](function(_0x32fce0){var _0xc76474=parseInt(_0x32fce0[_0x2604('0x67')]['charAt'](0x0));var _0x340a28=util[_0x2604('0x28')](_0x2604('0x69'),_0x28ffcd[_0x2604('0x6a')],_0x46f45b['id']);if(_0xc76474>0x6){_0x340a28=util[_0x2604('0x28')](_0x2604('0x6b'),_0x28ffcd['remoteUri'],_0x46f45b['id']);}logger[_0x2604('0xf')](_0x2604('0x72'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2604('0x28')]('user:%s',_0xea59d3[_0x2604('0x11')]),_0x2604('0x6e'),{'uri':_0x340a28});})[_0x2604('0x79')](function(_0x50e627){logger[_0x2604('0x7a')](_0x2604('0x72'),JSON[_0x2604('0x26')](_0x50e627));});};exports['unmanaged']=function(_0x51fcc0,_0x24e1fd,_0x527bb1,_0x34fed3,_0x2ffa03,_0x2784d4){var _0x500bf0,_0xda9234,_0x4d9665,_0x4f502e;_0x2784d4[_0x2604('0x6a')]=intUtil['stripTrailingSlash'](_0x2784d4[_0x2604('0x6a')]);_0x2784d4['serverUrl']=intUtil['stripTrailingSlash'](_0x2784d4[_0x2604('0x5e')]);def['uri']=util['format'](_0x2604('0x59'),_0x2784d4['remoteUri']);if(_0x2ffa03&&_0x2ffa03[_0x2604('0x5a')]){logger[_0x2604('0xf')]('['+_0x24e1fd[_0x2604('0x7b')][_0x2604('0x7c')]()+']',_0x2604('0x5c'));_0x24e1fd[_0x2604('0x5d')]=util['format'](_0x2604('0x73'),_0x2784d4['serverUrl'],_0x24e1fd[_0x2604('0x5f')],md5(_0x24e1fd[_0x2604('0x5f')]));}else{_0x24e1fd[_0x2604('0x5d')]='';}return getConnection(_0x2784d4)['then'](function(_0x428004){_0x4f502e=_0x428004;if(!_['isNil'](_0x34fed3)){return getUser(_0x2784d4,_0x34fed3['name'],_0x4f502e);}else{return getUser(_0x2784d4,null,_0x4f502e);}})['then'](function(_0x1ad86a){_0x500bf0=_0x1ad86a;logger['info']('The\x20User\x20ID\x20is:',_0x500bf0['id']);return getEndUser(_0x2784d4,_0x24e1fd[_0x2604('0x7d')],_0x24e1fd['calleridnum'],_0x4f502e);})[_0x2604('0x3d')](function(_0x20cd70){_0xda9234=_0x20cd70;logger[_0x2604('0xf')](_0x2604('0x62'),_0xda9234['id']);return getTicket(_0x2784d4,_0x500bf0,_0xda9234,_0x527bb1,_0x24e1fd,_0x527bb1['Fields'],_0x4f502e,'Inbound');})[_0x2604('0x3d')](function(_0x58be4b){_0x4d9665=_0x58be4b;logger['info']('Ticket\x20created!');logger[_0x2604('0xf')](_0x2604('0x78'),_0x4d9665['id']);return setRelationship(_0x4f502e,_0x500bf0,_0x4d9665,_0x2604('0x65'));})[_0x2604('0x3d')](function(){return setRelationship(_0x4f502e,_0xda9234,_0x4d9665,'contacts');})[_0x2604('0x3d')](function(){return getServerInfo(_0x4f502e);})[_0x2604('0x79')](function(_0x47df01){logger[_0x2604('0x7a')]('['+_0x24e1fd[_0x2604('0x7b')][_0x2604('0x7c')]()+']',JSON['stringify'](_0x47df01));});}; \ No newline at end of file +var _0x473e=['POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','Inbound','The\x20Ticket\x20ID\x20is:','request-promise','bluebird','util','../../../../config/environment','redis','defaults','emit','Creating\x20new\x20ticket...','name','getString','assigned_user_id','description','Descriptions','date_start','slice','replace','duration_hours','parent_id','Contacts','direction','length','forEach','push','idField','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','stringify','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','value','info','Agent\x20found!','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\x20=\x20\x22%s\x22','find','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','string','customField','nameField','content','custom_fields','variableName','customVariable','Variable','toLowerCase'];(function(_0x21d6a6,_0x54e297){var _0x3b0782=function(_0x4778fb){while(--_0x4778fb){_0x21d6a6['push'](_0x21d6a6['shift']());}};_0x3b0782(++_0x54e297);}(_0x473e,0x195));var _0xe473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x473e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0xe473('0x0'));var BPromise=require(_0xe473('0x1'));var md5=require('md5');var util=require(_0xe473('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xe473('0x3'));var logger=require('../../../../config/logger')('sugarcrm');config[_0xe473('0x4')]=_[_0xe473('0x5')](config[_0xe473('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x331a03,_0x4f3551,_0x37d36b){io['to'](_0x331a03)[_0xe473('0x6')](_0x4f3551,_0x37d36b);}function getTicket(_0x55ef52,_0x447d2f,_0x4abd76,_0x34c772,_0xe71f88,_0x16a4e7,_0x136f07,_0x1a3981){logger['info'](_0xe473('0x7'));var _0x381bb7=new Date();var _0x15b485=[{'name':_0xe473('0x8'),'value':intUtil[_0xe473('0x9')](_0x34c772['Subjects'],_0xe71f88,'\x20')},{'name':_0xe473('0xa'),'value':_0x447d2f['id']},{'name':'created_by','value':_0x447d2f['id']},{'name':_0xe473('0xb'),'value':intUtil[_0xe473('0x9')](_0x34c772[_0xe473('0xc')],_0xe71f88,'\x0a')},{'name':_0xe473('0xd'),'value':_0x381bb7['toISOString']()[_0xe473('0xe')](0x0,0x13)[_0xe473('0xf')]('T','\x20')},{'name':_0xe473('0x10'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xe473('0x11'),'value':_0x4abd76['id']},{'name':'parent_type','value':_0xe473('0x12')},{'name':'parent_name','value':_0x4abd76[_0xe473('0x8')]},{'name':_0xe473('0x13'),'value':_0x1a3981}];if(_0x16a4e7[_0xe473('0x14')]){_[_0xe473('0x15')](_0x16a4e7,function(_0x5c8907){if(_0xe71f88[_0x5c8907['variableName']]){_0x15b485[_0xe473('0x16')]({'name':_0x5c8907[_0xe473('0x17')],'value':_0xe71f88[_0x5c8907['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0xe473('0x18'),'response_type':_0xe473('0x18'),'rest_data':JSON['stringify']({'session':_0x136f07['id'],'module_name':_0xe473('0x19'),'name_value_list':_0x15b485})}});}function getAuth(_0xdb0a6c){return util[_0xe473('0x1a')](_0xe473('0x1b'),new Buffer(_0xdb0a6c[_0xe473('0x1c')]+':X')[_0xe473('0x1d')](_0xe473('0x1e')));}function getServerInfo(_0x40c9d8){return request({'form':{'method':'get_server_info','input_type':_0xe473('0x18'),'response_type':_0xe473('0x18'),'rest_data':JSON['stringify']({'session':_0x40c9d8['id']})}});}function getUser(_0x1eb174,_0xdfeb2c,_0x18f864){if(!_[_0xe473('0x1f')](_0xdfeb2c)){logger['info'](_0xe473('0x20'),_0xdfeb2c);return request({'form':{'method':_0xe473('0x21'),'input_type':_0xe473('0x18'),'response_type':_0xe473('0x18'),'rest_data':JSON[_0xe473('0x22')]({'session':_0x18f864['id'],'module_name':_0xe473('0x23'),'query':util['format'](_0xe473('0x24'),_0xdfeb2c),'order_by':'','offset':'0','select_fields':['id',_0xe473('0x8'),_0xe473('0x25')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe473('0x26')](function(_0x49ed5f){if(_0x49ed5f[_0xe473('0x27')]['length']){var _0x465b73=_['find'](_0x49ed5f[_0xe473('0x27')],function(_0x32e844){return _0x32e844['name_value_list'][_0xe473('0x25')][_0xe473('0x28')]===_0xdfeb2c;});if(_0x465b73){logger[_0xe473('0x29')](_0xe473('0x2a'));return BPromise[_0xe473('0x2b')]({'id':_0x465b73['name_value_list']['id'][_0xe473('0x28')],'name':_0x465b73[_0xe473('0x2c')]['name']['value']});}}logger[_0xe473('0x29')](_0xe473('0x2d'));return BPromise['resolve']({'id':_0x18f864['name_value_list'][_0xe473('0x2e')]['value'],'name':_0x18f864[_0xe473('0x2c')]['user_name']['value']});});}else{logger['info'](_0xe473('0x2f'));return BPromise[_0xe473('0x2b')]({'id':_0x18f864[_0xe473('0x2c')][_0xe473('0x2e')][_0xe473('0x28')],'name':_0x18f864['name_value_list'][_0xe473('0x25')]['value']});}}function getEndUser(_0x4b3222,_0xbca857,_0xf9b7b6,_0x5ce027){logger['info'](_0xe473('0x30'),_0xf9b7b6);return request({'form':{'method':_0xe473('0x21'),'input_type':_0xe473('0x18'),'response_type':_0xe473('0x18'),'rest_data':JSON[_0xe473('0x22')]({'session':_0x5ce027['id'],'module_name':_0xe473('0x12'),'query':util[_0xe473('0x1a')](_0xe473('0x31'),_0xf9b7b6),'order_by':'','offset':'0','select_fields':['id',_0xe473('0x8'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe473('0x26')](function(_0x5046b9){if(_0x5046b9['entry_list'][_0xe473('0x14')]){var _0x5a9f5c=_[_0xe473('0x32')](_0x5046b9[_0xe473('0x27')],function(_0x476292){return _0x476292['name_value_list'][_0xe473('0x33')][_0xe473('0x28')]===_0xf9b7b6;});if(_0x5a9f5c){logger[_0xe473('0x29')]('Enduser\x20found!');return BPromise[_0xe473('0x2b')]({'id':_0x5a9f5c[_0xe473('0x2c')]['id'][_0xe473('0x28')],'name':_0x5a9f5c[_0xe473('0x2c')][_0xe473('0x8')][_0xe473('0x28')],'phone':_0x5a9f5c[_0xe473('0x2c')][_0xe473('0x33')][_0xe473('0x28')]});}}else{logger[_0xe473('0x29')](_0xe473('0x34'));return request({'form':{'method':_0xe473('0x35'),'input_type':_0xe473('0x18'),'response_type':_0xe473('0x18'),'rest_data':JSON['stringify']({'session':_0x5ce027['id'],'module_name':'Contacts','name_value_list':[{'name':_0xe473('0x36'),'value':_0xbca857!==_0xe473('0x37')?_0xbca857:util[_0xe473('0x1a')](_0xe473('0x38'),_0xf9b7b6)},{'name':_0xe473('0x33'),'value':_0xf9b7b6}]})}})[_0xe473('0x26')](function(_0x4649cf){logger[_0xe473('0x29')](_0xe473('0x39'));return BPromise['resolve']({'id':_0x4649cf['id'],'name':_0x4649cf[_0xe473('0x27')][_0xe473('0x36')]['value'],'phone':_0x4649cf[_0xe473('0x27')]['phone_home'][_0xe473('0x28')]});});}});}function request(_0x556d14){logger[_0xe473('0x3a')](_0xe473('0x3b'),JSON[_0xe473('0x22')](_0x556d14));return rp(_[_0xe473('0x3c')](def,_0x556d14));}function getTags(_0x5a5f6c,_0x38470b){var _0x11afa2=[];if(_0x5a5f6c&&_0x5a5f6c[_0xe473('0x14')]>0x0){_0x11afa2=_['map'](_0x5a5f6c,_0x38470b);}return _0x11afa2;}function getCustomFields(_0x10e476,_0xfda885){var _0x19a642=[];var _0x1b5339={'custom_fields':[]};if(_0x10e476[_0xe473('0x14')]>0x0){_[_0xe473('0x15')](_0x10e476,function(_0xefae8e){if(_0xefae8e[_0xe473('0x3d')]===_0xe473('0x3e')&&_0xefae8e['nameField']&&!_0xefae8e[_0xe473('0x3f')]){_0x1b5339[_0xefae8e[_0xe473('0x40')]['toLowerCase']()]=_0xefae8e[_0xe473('0x41')][_0xe473('0x1d')]();}else if(_0xefae8e[_0xe473('0x3d')]===_0xe473('0x3e')&&_0xefae8e[_0xe473('0x17')]&&_0xefae8e['customField']){_0x1b5339[_0xe473('0x42')][_0xe473('0x16')]({'id':_0xefae8e[_0xe473('0x17')],'value':_0xefae8e['content'][_0xe473('0x1d')]()});}else if(_0xefae8e['type']==='variable'&&_0xefae8e[_0xe473('0x43')]&&_0xefae8e[_0xe473('0x17')]&&_0xefae8e[_0xe473('0x3f')]){_0xfda885[_0xefae8e[_0xe473('0x43')]]&&_0x1b5339[_0xe473('0x42')][_0xe473('0x16')]({'id':_0xefae8e[_0xe473('0x17')],'value':_0xfda885[_0xefae8e[_0xe473('0x43')]][_0xe473('0x1d')]()});}else if(_0xefae8e['type']===_0xe473('0x44')&&_0xefae8e['Variable']&&_0xefae8e[_0xe473('0x45')][_0xe473('0x8')]&&_0xefae8e[_0xe473('0x17')]&&_0xefae8e[_0xe473('0x3f')]){_0xfda885[_0xefae8e[_0xe473('0x45')][_0xe473('0x8')][_0xe473('0x46')]()]&&_0x1b5339[_0xe473('0x42')][_0xe473('0x16')]({'id':_0xefae8e[_0xe473('0x17')],'value':_0xfda885[_0xefae8e['Variable'][_0xe473('0x8')][_0xe473('0x46')]()][_0xe473('0x1d')]()});}});}return _0x1b5339;}function getConnection(_0x202400){return request({'method':_0xe473('0x47'),'form':{'method':_0xe473('0x48'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe473('0x22')]({'user_auth':{'user_name':_0x202400[_0xe473('0x49')],'password':_0x202400[_0xe473('0x4a')],'encryption':'PLAIN'},'application':_0xe473('0x4b')})}})[_0xe473('0x26')](function(_0x49a510){var _0x2b7a65=_0x49a510;if(_0x2b7a65['id']){def[_0xe473('0x4c')]=_0x2b7a65['id'];return BPromise[_0xe473('0x2b')](_0x2b7a65);}else{throw new Error(util['format'](_0xe473('0x4d'),_0x202400['id']));}});}function setRelationship(_0x332ba7,_0x1e626a,_0x3697b5,_0x401109){return request({'form':{'method':_0xe473('0x4e'),'input_type':'JSON','response_type':_0xe473('0x18'),'rest_data':JSON[_0xe473('0x22')]({'session':_0x332ba7['id'],'module_name':_0xe473('0x19'),'module_id':_0x3697b5['id'],'link_field_name':_0x401109,'related_ids':[_0x1e626a['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x57ae11,_0x27720a,_0x27c1f8,_0x13b968,_0xfbba84,_0x5f2371){var _0x284181,_0x513c07,_0x533006,_0x4d08e5;_0x5f2371['remoteUri']=intUtil[_0xe473('0x4f')](_0x5f2371['remoteUri']);_0x5f2371[_0xe473('0x50')]=intUtil[_0xe473('0x4f')](_0x5f2371[_0xe473('0x50')]);def[_0xe473('0x51')]=util['format'](_0xe473('0x52'),_0x5f2371[_0xe473('0x53')]);if(_0xfbba84&&_0xfbba84[_0xe473('0x54')]){logger[_0xe473('0x29')](_0xe473('0x55'),_0xe473('0x56'));_0x27720a[_0xe473('0x57')]=util[_0xe473('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5f2371[_0xe473('0x50')],_0x27720a[_0xe473('0x58')],md5(_0x27720a[_0xe473('0x58')]));}else{_0x27720a[_0xe473('0x57')]='';}return getConnection(_0x5f2371)['then'](function(_0x2da068){_0x4d08e5=_0x2da068;return getUser(_0x5f2371,_0x13b968[_0xe473('0x8')],_0x4d08e5);})[_0xe473('0x26')](function(_0x30a2e5){_0x284181=_0x30a2e5;logger[_0xe473('0x29')](_0xe473('0x59'),_0x284181['id']);return getEndUser(_0x5f2371,_0x27720a[_0xe473('0x5a')],_0x27720a[_0xe473('0x5b')],_0x4d08e5);})[_0xe473('0x26')](function(_0xb07c5b){_0x513c07=_0xb07c5b;logger[_0xe473('0x29')](_0xe473('0x5c'),_0x513c07['id']);return getTicket(_0x5f2371,_0x284181,_0x513c07,_0x27c1f8,_0x27720a,_0x27c1f8[_0xe473('0x5d')],_0x4d08e5,'Inbound');})[_0xe473('0x26')](function(_0xc53db2){_0x533006=_0xc53db2;logger[_0xe473('0x29')](_0xe473('0x5e'));logger[_0xe473('0x29')]('The\x20Ticket\x20ID\x20is:',_0x533006['id']);return setRelationship(_0x4d08e5,_0x284181,_0x533006,_0xe473('0x5f'));})['then'](function(){return setRelationship(_0x4d08e5,_0x513c07,_0x533006,_0xe473('0x60'));})[_0xe473('0x26')](function(){return getServerInfo(_0x4d08e5);})['then'](function(_0x4f8c08){var _0x6be3a1=parseInt(_0x4f8c08[_0xe473('0x61')][_0xe473('0x62')](0x0));var _0x12d6a9=util[_0xe473('0x1a')](_0xe473('0x63'),_0x5f2371[_0xe473('0x53')],_0x533006['id']);if(_0x6be3a1>0x6){_0x12d6a9=util['format'](_0xe473('0x64'),_0x5f2371['remoteUri'],_0x533006['id']);}logger[_0xe473('0x29')](_0xe473('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe473('0x1a')](_0xe473('0x65'),_0x13b968[_0xe473('0x8')]),_0xe473('0x66'),{'uri':_0x12d6a9});})[_0xe473('0x67')](function(_0x442d80){logger[_0xe473('0x68')]('[QUEUE]',JSON[_0xe473('0x22')](_0x442d80));});};exports[_0xe473('0x69')]=function(_0x2b54fc,_0x1f504a,_0x35ac20,_0x3f09b0,_0xfebd42,_0x371311,_0x1190bd){var _0x48aa2a,_0x180892,_0x36df94,_0x819b04;_0x371311[_0xe473('0x53')]=intUtil[_0xe473('0x4f')](_0x371311['remoteUri']);_0x371311['serverUrl']=intUtil[_0xe473('0x4f')](_0x371311[_0xe473('0x50')]);def[_0xe473('0x51')]=util['format']('%s/service/v4_1/rest.php',_0x371311[_0xe473('0x53')]);if(_0x1190bd&&_0x1190bd[_0xe473('0x6a')]&&_0x1190bd['recordingFormat']!==_0xe473('0x6b')){logger['info']('[OUTBOUND]',_0xe473('0x56'));_0x1f504a[_0xe473('0x57')]=util['format'](_0xe473('0x6c'),_0x371311[_0xe473('0x50')],_0x1f504a['uniqueid'],md5(_0x1f504a[_0xe473('0x58')]));}return getConnection(_0x371311)[_0xe473('0x26')](function(_0x8d2000){_0x819b04=_0x8d2000;return getUser(_0x371311,_0x3f09b0[_0xe473('0x8')],_0x819b04);})[_0xe473('0x26')](function(_0xd98c3d){_0x48aa2a=_0xd98c3d;logger[_0xe473('0x29')](_0xe473('0x59'),_0x48aa2a['id']);return getEndUser(_0x371311,_0x1f504a[_0xe473('0x6d')],_0x1f504a[_0xe473('0x6e')],_0x819b04);})[_0xe473('0x26')](function(_0x3fd04f){_0x180892=_0x3fd04f;logger[_0xe473('0x29')](_0xe473('0x5c'),_0x180892['id']);return getTicket(_0x371311,_0x48aa2a,_0x180892,_0x35ac20,_0x1f504a,_0x35ac20[_0xe473('0x5d')],_0x819b04,_0xe473('0x6f'));})[_0xe473('0x26')](function(_0x410abb){_0x36df94=_0x410abb;logger[_0xe473('0x29')](_0xe473('0x5e'));logger[_0xe473('0x29')]('The\x20Ticket\x20ID\x20is:',_0x36df94['id']);return setRelationship(_0x819b04,_0x48aa2a,_0x36df94,_0xe473('0x5f'));})[_0xe473('0x26')](function(){return setRelationship(_0x819b04,_0x180892,_0x36df94,_0xe473('0x60'));})['then'](function(){return getServerInfo(_0x819b04);})[_0xe473('0x26')](function(_0x13207a){var _0x2bd9ec=parseInt(_0x13207a['version']['charAt'](0x0));var _0x154d9b=util['format'](_0xe473('0x63'),_0x371311[_0xe473('0x53')],_0x36df94['id']);if(_0x2bd9ec>0x6){_0x154d9b=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x371311['remoteUri'],_0x36df94['id']);}logger[_0xe473('0x29')](_0xe473('0x70'),_0xe473('0x71'));emit(util['format'](_0xe473('0x65'),_0x3f09b0['name']),'trigger:browser:url',{'uri':_0x154d9b});})[_0xe473('0x67')](function(_0x3d3ac3){logger['error'](_0xe473('0x70'),JSON[_0xe473('0x22')](_0x3d3ac3));});};exports[_0xe473('0x72')]=function(_0x539232,_0x40ba94,_0x461c72,_0x335317,_0x3f95b5,_0x5519fb){var _0x36d62d,_0x438016,_0x7adfe,_0x5646d3;_0x5519fb[_0xe473('0x53')]=intUtil[_0xe473('0x4f')](_0x5519fb[_0xe473('0x53')]);_0x5519fb[_0xe473('0x50')]=intUtil[_0xe473('0x4f')](_0x5519fb[_0xe473('0x50')]);def[_0xe473('0x51')]=util['format'](_0xe473('0x52'),_0x5519fb[_0xe473('0x53')]);if(_0x3f95b5&&_0x3f95b5['monitor_format']){logger[_0xe473('0x29')]('['+_0x40ba94[_0xe473('0x73')][_0xe473('0x74')]()+']',_0xe473('0x56'));_0x40ba94[_0xe473('0x57')]=util[_0xe473('0x1a')](_0xe473('0x6c'),_0x5519fb[_0xe473('0x50')],_0x40ba94[_0xe473('0x58')],md5(_0x40ba94[_0xe473('0x58')]));}else{_0x40ba94[_0xe473('0x57')]='';}return getConnection(_0x5519fb)['then'](function(_0x5f3e4c){_0x5646d3=_0x5f3e4c;if(!_[_0xe473('0x1f')](_0x335317)){return getUser(_0x5519fb,_0x335317['name'],_0x5646d3);}else{return getUser(_0x5519fb,null,_0x5646d3);}})['then'](function(_0x5685ad){_0x36d62d=_0x5685ad;logger['info']('The\x20User\x20ID\x20is:',_0x36d62d['id']);return getEndUser(_0x5519fb,_0x40ba94['calleridname'],_0x40ba94[_0xe473('0x5b')],_0x5646d3);})[_0xe473('0x26')](function(_0x50416b){_0x438016=_0x50416b;logger[_0xe473('0x29')](_0xe473('0x5c'),_0x438016['id']);return getTicket(_0x5519fb,_0x36d62d,_0x438016,_0x461c72,_0x40ba94,_0x461c72['Fields'],_0x5646d3,_0xe473('0x75'));})[_0xe473('0x26')](function(_0x44a5b5){_0x7adfe=_0x44a5b5;logger[_0xe473('0x29')](_0xe473('0x5e'));logger[_0xe473('0x29')](_0xe473('0x76'),_0x7adfe['id']);return setRelationship(_0x5646d3,_0x36d62d,_0x7adfe,_0xe473('0x5f'));})[_0xe473('0x26')](function(){return setRelationship(_0x5646d3,_0x438016,_0x7adfe,_0xe473('0x60'));})[_0xe473('0x26')](function(){return getServerInfo(_0x5646d3);})[_0xe473('0x67')](function(_0x21cd08){logger[_0xe473('0x68')]('['+_0x40ba94[_0xe473('0x73')][_0xe473('0x74')]()+']',JSON[_0xe473('0x22')](_0x21cd08));});}; \ 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 bca3781..e9aa782 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 _0x7d1b=['string','key','format','%s:\x20%s','keyContent','stripTrailingSlash','slice','validateEmail','isNil','lodash','util','getString','length','sortBy','type','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d1b,0x11c));var _0xb7d1=function(_0x551dfe,_0xd88835){_0x551dfe=_0x551dfe-0x0;var _0x9abe41=_0x7d1b[_0x551dfe];return _0x9abe41;};'use strict';var _=require(_0xb7d1('0x0'));var util=require(_0xb7d1('0x1'));exports[_0xb7d1('0x2')]=function(_0x25e7dc,_0x979ecc,_0x45cfeb){var _0x3ebe62=[];if(_0x25e7dc[_0xb7d1('0x3')]>0x0){var _0x368c04=_[_0xb7d1('0x4')](_0x25e7dc,['id']);for(var _0x112edd=0x0;_0x112edd<_0x368c04[_0xb7d1('0x3')];_0x112edd++){var _0x5e58b7=_0x368c04[_0x112edd];if(_0x5e58b7[_0xb7d1('0x5')]==='string'){_0x3ebe62[_0xb7d1('0x6')](_0x5e58b7[_0xb7d1('0x7')]);}else if(_0x5e58b7[_0xb7d1('0x5')]===_0xb7d1('0x8')&&_0x5e58b7[_0xb7d1('0x9')]){_0x979ecc[_0x5e58b7[_0xb7d1('0x9')]]&&_0x3ebe62[_0xb7d1('0x6')](_0x979ecc[_0x5e58b7[_0xb7d1('0x9')]]['toString']());}else if(_0x5e58b7[_0xb7d1('0x5')]===_0xb7d1('0xa')&&_0x5e58b7[_0xb7d1('0xb')]&&_0x5e58b7[_0xb7d1('0xb')][_0xb7d1('0xc')]){_0x979ecc[_0x5e58b7['Variable']['name']['toLowerCase']()]&&_0x3ebe62[_0xb7d1('0x6')](_0x979ecc[_0x5e58b7[_0xb7d1('0xb')][_0xb7d1('0xc')][_0xb7d1('0xd')]()]['toString']());}else if(_0x5e58b7[_0xb7d1('0x5')]===_0xb7d1('0xe')){if(_0x5e58b7[_0xb7d1('0xf')]===_0xb7d1('0x10')&&_0x5e58b7[_0xb7d1('0x11')]){_0x3ebe62[_0xb7d1('0x6')](util[_0xb7d1('0x12')](_0xb7d1('0x13'),_0x5e58b7['key'],_0x5e58b7[_0xb7d1('0x14')]));}else if(_0x5e58b7[_0xb7d1('0xf')]===_0xb7d1('0x8')&&_0x5e58b7['variableName']&&_0x5e58b7[_0xb7d1('0x11')]){_0x979ecc[_0x5e58b7[_0xb7d1('0x9')]]&&_0x3ebe62['push'](util[_0xb7d1('0x12')](_0xb7d1('0x13'),_0x5e58b7[_0xb7d1('0x11')],_0x979ecc[_0x5e58b7[_0xb7d1('0x9')]]));}else if(_0x5e58b7[_0xb7d1('0xf')]===_0xb7d1('0xa')&&_0x5e58b7[_0xb7d1('0xb')]&&_0x5e58b7[_0xb7d1('0xb')]['name']&&_0x5e58b7[_0xb7d1('0x11')]){_0x979ecc[_0x5e58b7['Variable'][_0xb7d1('0xc')]['toLowerCase']()]&&_0x3ebe62[_0xb7d1('0x6')](util[_0xb7d1('0x12')](_0xb7d1('0x13'),_0x5e58b7['key'],_0x979ecc[_0x5e58b7['Variable'][_0xb7d1('0xc')][_0xb7d1('0xd')]()]));}}}}return _0x3ebe62['join'](_0x45cfeb);};exports[_0xb7d1('0x15')]=function(_0x24df04){var _0x4eaaab=_0x24df04[_0xb7d1('0x16')](-0x1);if(_0x4eaaab==='/'){_0x24df04=_0x24df04['substring'](0x0,_0x24df04['lastIndexOf'](_0x4eaaab));}return _0x24df04;};exports[_0xb7d1('0x17')]=function(_0x2e768a){if(!_[_0xb7d1('0x18')](_0x2e768a)&&_0x2e768a!==''){var _0x39849c=/^(([^<>()\[\]\\.,;:\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 _0x39849c['test'](String(_0x2e768a)[_0xb7d1('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x8f8d=['content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyType','string','key','format','keyContent','%s:\x20%s','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','getString','length','type'];(function(_0x3136fa,_0x179312){var _0x4fdecb=function(_0x4b7c9d){while(--_0x4b7c9d){_0x3136fa['push'](_0x3136fa['shift']());}};_0x4fdecb(++_0x179312);}(_0x8f8d,0x7d));var _0xd8f8=function(_0x192f67,_0x31a74e){_0x192f67=_0x192f67-0x0;var _0x5ebd7c=_0x8f8d[_0x192f67];return _0x5ebd7c;};'use strict';var _=require(_0xd8f8('0x0'));var util=require(_0xd8f8('0x1'));exports[_0xd8f8('0x2')]=function(_0x429c25,_0x308af1,_0x484625){var _0x27eac7=[];if(_0x429c25[_0xd8f8('0x3')]>0x0){var _0x59c28b=_['sortBy'](_0x429c25,['id']);for(var _0x5a440d=0x0;_0x5a440d<_0x59c28b[_0xd8f8('0x3')];_0x5a440d++){var _0x3b8aad=_0x59c28b[_0x5a440d];if(_0x3b8aad[_0xd8f8('0x4')]==='string'){_0x27eac7['push'](_0x3b8aad[_0xd8f8('0x5')]);}else if(_0x3b8aad[_0xd8f8('0x4')]===_0xd8f8('0x6')&&_0x3b8aad[_0xd8f8('0x7')]){_0x308af1[_0x3b8aad['variableName']]&&_0x27eac7[_0xd8f8('0x8')](_0x308af1[_0x3b8aad[_0xd8f8('0x7')]][_0xd8f8('0x9')]());}else if(_0x3b8aad[_0xd8f8('0x4')]===_0xd8f8('0xa')&&_0x3b8aad['Variable']&&_0x3b8aad[_0xd8f8('0xb')][_0xd8f8('0xc')]){_0x308af1[_0x3b8aad['Variable'][_0xd8f8('0xc')][_0xd8f8('0xd')]()]&&_0x27eac7[_0xd8f8('0x8')](_0x308af1[_0x3b8aad[_0xd8f8('0xb')][_0xd8f8('0xc')][_0xd8f8('0xd')]()][_0xd8f8('0x9')]());}else if(_0x3b8aad[_0xd8f8('0x4')]==='keyValue'){if(_0x3b8aad[_0xd8f8('0xe')]===_0xd8f8('0xf')&&_0x3b8aad[_0xd8f8('0x10')]){_0x27eac7['push'](util[_0xd8f8('0x11')]('%s:\x20%s',_0x3b8aad[_0xd8f8('0x10')],_0x3b8aad[_0xd8f8('0x12')]));}else if(_0x3b8aad[_0xd8f8('0xe')]===_0xd8f8('0x6')&&_0x3b8aad[_0xd8f8('0x7')]&&_0x3b8aad[_0xd8f8('0x10')]){_0x308af1[_0x3b8aad[_0xd8f8('0x7')]]&&_0x27eac7[_0xd8f8('0x8')](util[_0xd8f8('0x11')](_0xd8f8('0x13'),_0x3b8aad['key'],_0x308af1[_0x3b8aad[_0xd8f8('0x7')]]));}else if(_0x3b8aad[_0xd8f8('0xe')]==='customVariable'&&_0x3b8aad[_0xd8f8('0xb')]&&_0x3b8aad[_0xd8f8('0xb')]['name']&&_0x3b8aad[_0xd8f8('0x10')]){_0x308af1[_0x3b8aad[_0xd8f8('0xb')][_0xd8f8('0xc')][_0xd8f8('0xd')]()]&&_0x27eac7['push'](util[_0xd8f8('0x11')](_0xd8f8('0x13'),_0x3b8aad['key'],_0x308af1[_0x3b8aad[_0xd8f8('0xb')]['name']['toLowerCase']()]));}}}}return _0x27eac7['join'](_0x484625);};exports[_0xd8f8('0x14')]=function(_0x4c90b1){var _0x4f5021=_0x4c90b1[_0xd8f8('0x15')](-0x1);if(_0x4f5021==='/'){_0x4c90b1=_0x4c90b1[_0xd8f8('0x16')](0x0,_0x4c90b1['lastIndexOf'](_0x4f5021));}return _0x4c90b1;};exports[_0xd8f8('0x17')]=function(_0x239127){if(!_[_0xd8f8('0x18')](_0x239127)&&_0x239127!==''){var _0x4e8324=/^(([^<>()\[\]\\.,;:\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 _0x4e8324[_0xd8f8('0x19')](String(_0x239127)[_0xd8f8('0xd')]());}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 8572023..fb20284 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(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x2bcede,_0x351c5d){var _0x137209=function(_0x176030){while(--_0x176030){_0x2bcede['push'](_0x2bcede['shift']());}};_0x137209(++_0x351c5d);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'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 0c328fa..414673b 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 _0x4582=['remoteUri','merge','name','getString','Descriptions','Fields','info','validateEmail','type:user\x20role:agent\x20email:%s','then','count','results','agent','user','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','Basic\x20%s','toString','base64','[HTTP]','GET','map','string','type','nameField','customField','content','includes','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[OUTBOUND]','unmanaged','calleridname','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','format','%s/tickets.json'];(function(_0xfa3280,_0x42246f){var _0x1d6b04=function(_0x325ef8){while(--_0x325ef8){_0xfa3280['push'](_0xfa3280['shift']());}};_0x1d6b04(++_0x42246f);}(_0x4582,0xc2));var _0x2458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4582[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2458('0x0'));var rp=require(_0x2458('0x1'));var md5=require(_0x2458('0x2'));var util=require(_0x2458('0x3'));var Redis=require(_0x2458('0x4'));var intUtil=require(_0x2458('0x5'));var config=require(_0x2458('0x6'));var logger=require(_0x2458('0x7'))('zendesk');config[_0x2458('0x8')]=_[_0x2458('0x9')](config[_0x2458('0x8')],{'host':_0x2458('0xa'),'port':0x18eb});var io=require(_0x2458('0xb'))(new Redis(config[_0x2458('0x8')]));function emit(_0x48822a,_0x15e6ca,_0x531624){io['to'](_0x48822a)[_0x2458('0xc')](_0x15e6ca,_0x531624);}var headers={'Content-Type':_0x2458('0xd'),'Accept':_0x2458('0xd')};function getTicket(_0x153cef,_0xcd3ff7,_0x591781,_0x566eed,_0x44e32f){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x2458('0xe')](_0x2458('0xf'),_0x153cef[_0x2458('0x10')]),'method':'POST','body':{'ticket':_[_0x2458('0x11')]({'requester_id':_0x591781['id'],'submitter_id':_0xcd3ff7?_0xcd3ff7['id']:undefined,'assignee_id':_0xcd3ff7?_0xcd3ff7['id']:undefined,'tags':getTags(_0x566eed['Tags'],_0x2458('0x12')),'subject':intUtil[_0x2458('0x13')](_0x566eed['Subjects'],_0x44e32f,'\x20'),'description':intUtil['getString'](_0x566eed[_0x2458('0x14')],_0x44e32f,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2458('0x13')](_0x566eed[_0x2458('0x14')],_0x44e32f,'\x0a')}},getCustomFields(_0x566eed[_0x2458('0x15')],_0x44e32f))}})['then'](function(_0x38d2c4){logger[_0x2458('0x16')]('Ticket\x20created!');return _0x38d2c4['ticket'];});}function getUser(_0x2c599a,_0x221505){if(intUtil[_0x2458('0x17')](_0x221505)){logger[_0x2458('0x16')]('Getting\x20agent\x20with\x20email',_0x221505);return request({'uri':util[_0x2458('0xe')]('%s/search.json',_0x2c599a[_0x2458('0x10')]),'qs':{'query':util[_0x2458('0xe')](_0x2458('0x18'),_0x221505)}})[_0x2458('0x19')](function(_0x16f88d){if(_0x16f88d[_0x2458('0x1a')]){logger[_0x2458('0x16')]('Agent\x20found!');return _['find'](_0x16f88d[_0x2458('0x1b')],{'email':_0x221505,'role':_0x2458('0x1c')});}else{logger[_0x2458('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x2c599a[_0x2458('0x10')])})[_0x2458('0x19')](function(_0x211271){logger[_0x2458('0x16')]('Admin\x20account\x20selected.');return _0x211271[_0x2458('0x1d')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x2458('0x1e'),_0x2c599a[_0x2458('0x10')])})[_0x2458('0x19')](function(_0x581207){logger['info'](_0x2458('0x1f'));return _0x581207[_0x2458('0x1d')];});}}function getEndUser(_0x42be79,_0x36f87d,_0x1e5826){logger[_0x2458('0x16')](_0x2458('0x20'),_0x1e5826);return request({'uri':util[_0x2458('0xe')]('%s/search.json',_0x42be79[_0x2458('0x10')]),'qs':{'query':util[_0x2458('0xe')](_0x2458('0x21'),_0x1e5826)}})['then'](function(_0x6886b1){var _0x16686b;if(_0x6886b1['results'][_0x2458('0x22')]){_0x6886b1[_0x2458('0x1b')]=_['filter'](_0x6886b1[_0x2458('0x1b')],{'suspended':![],'role':_0x2458('0x23')});if(_0x6886b1[_0x2458('0x1b')]['length']){_0x16686b=_[_0x2458('0x24')](_0x6886b1[_0x2458('0x1b')]);}}if(_0x16686b){logger[_0x2458('0x16')]('Enduser\x20found!');return _0x16686b;}else{logger[_0x2458('0x16')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x2458('0xe')]('%s/users.json',_0x42be79[_0x2458('0x10')]),'method':'POST','body':{'user':{'role':_0x2458('0x23'),'name':util[_0x2458('0xe')](_0x2458('0x25'),_0x36f87d||_0x1e5826),'phone':_0x1e5826}}})[_0x2458('0x19')](function(_0x3fd56e){logger[_0x2458('0x16')](_0x2458('0x26'));return _0x3fd56e['user'];});}});}function getAuth(_0x4ef7fd){var _0x49be1d;if(_0x4ef7fd[_0x2458('0x27')]==='password'){_0x49be1d=util[_0x2458('0xe')](_0x2458('0x28'),_0x4ef7fd[_0x2458('0x29')],_0x4ef7fd[_0x2458('0x2a')]);}else if(_0x4ef7fd[_0x2458('0x27')]===_0x2458('0x2b')){_0x49be1d=util[_0x2458('0xe')]('%s/token:%s',_0x4ef7fd[_0x2458('0x29')],_0x4ef7fd[_0x2458('0x2b')]);}return util[_0x2458('0xe')](_0x2458('0x2c'),new Buffer(_0x49be1d)[_0x2458('0x2d')](_0x2458('0x2e')));}function request(_0x4cb9f7){logger['debug'](_0x2458('0x2f'),JSON['stringify'](_0x4cb9f7));return rp(_[_0x2458('0x9')](_0x4cb9f7,{'method':_0x2458('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x4ddc23,_0x37a94e){var _0x535a30=[];if(_0x4ddc23&&_0x4ddc23[_0x2458('0x22')]>0x0){_0x535a30=_[_0x2458('0x31')](_0x4ddc23,_0x37a94e);}return _0x535a30;}function getCustomFields(_0x3bd931,_0x5a23b5){var _0x54c236=[];var _0x28f361={'custom_fields':[]};if(_0x3bd931['length']>0x0){_['forEach'](_0x3bd931,function(_0x521fa1){if(_['includes']([_0x2458('0x32'),'picklist'],_0x521fa1[_0x2458('0x33')])&&_0x521fa1[_0x2458('0x34')]&&!_0x521fa1[_0x2458('0x35')]){_0x28f361[_0x521fa1[_0x2458('0x34')]['toLowerCase']()]=_0x521fa1[_0x2458('0x36')]['toString']();}else if(_[_0x2458('0x37')]([_0x2458('0x32'),_0x2458('0x38')],_0x521fa1['type'])&&_0x521fa1[_0x2458('0x39')]&&_0x521fa1[_0x2458('0x35')]){_0x28f361[_0x2458('0x3a')][_0x2458('0x3b')]({'id':_0x521fa1[_0x2458('0x39')],'value':_0x521fa1['content'][_0x2458('0x2d')]()});}else if(_0x521fa1[_0x2458('0x33')]===_0x2458('0x3c')&&_0x521fa1[_0x2458('0x3d')]&&_0x521fa1[_0x2458('0x39')]&&_0x521fa1[_0x2458('0x35')]){_0x5a23b5[_0x521fa1[_0x2458('0x3d')]]&&_0x28f361[_0x2458('0x3a')]['push']({'id':_0x521fa1[_0x2458('0x39')],'value':_0x5a23b5[_0x521fa1[_0x2458('0x3d')]][_0x2458('0x2d')]()});}else if(_0x521fa1[_0x2458('0x33')]===_0x2458('0x3e')&&_0x521fa1['Variable']&&_0x521fa1[_0x2458('0x3f')][_0x2458('0x12')]&&_0x521fa1[_0x2458('0x39')]&&_0x521fa1[_0x2458('0x35')]){_0x5a23b5[_0x521fa1['Variable'][_0x2458('0x12')][_0x2458('0x40')]()]&&_0x28f361[_0x2458('0x3a')][_0x2458('0x3b')]({'id':_0x521fa1[_0x2458('0x39')],'value':_0x5a23b5[_0x521fa1['Variable'][_0x2458('0x12')][_0x2458('0x40')]()][_0x2458('0x2d')]()});}});}return _0x28f361;}exports[_0x2458('0x41')]=function(_0x489b11,_0x34c71d,_0x371229,_0x26bef7,_0x37e750,_0x480978){var _0x2480dc,_0x2c1d64;_0x480978[_0x2458('0x10')]=intUtil[_0x2458('0x42')](_0x480978[_0x2458('0x10')]);_0x480978[_0x2458('0x43')]=intUtil[_0x2458('0x42')](_0x480978[_0x2458('0x43')]);if(_0x37e750&&_0x37e750[_0x2458('0x44')]){logger[_0x2458('0x16')]('[QUEUE]',_0x2458('0x45'));_0x34c71d[_0x2458('0x46')]=util[_0x2458('0xe')](_0x2458('0x47'),_0x480978[_0x2458('0x43')],_0x34c71d['uniqueid'],md5(_0x34c71d[_0x2458('0x48')]));}else{_0x34c71d['recordingURL']='';}headers[_0x2458('0x49')]=getAuth(_0x480978);return getUser(_0x480978,_0x26bef7[_0x2458('0x4a')])[_0x2458('0x19')](function(_0x191714){_0x2480dc=_0x191714;logger[_0x2458('0x16')](_0x2458('0x4b'),_0x2480dc['id']);return getEndUser(_0x480978,_0x34c71d['calleridname'],_0x34c71d[_0x2458('0x4c')]);})[_0x2458('0x19')](function(_0x562867){_0x2c1d64=_0x562867;logger[_0x2458('0x16')](_0x2458('0x4d'),_0x2c1d64['id']);return getTicket(_0x480978,_0x2480dc,_0x2c1d64,_0x371229,_0x34c71d);})[_0x2458('0x19')](function(_0xc6d691){if(_0xc6d691){logger[_0x2458('0x16')]('The\x20Ticket\x20ID\x20is:',_0xc6d691['id']);switch(_0x480978[_0x2458('0x33')]){case'integrationTab':logger[_0x2458('0x16')]('[QUEUE]',_0x2458('0x4e'));return request({'uri':util['format'](_0x2458('0x4f'),_0x480978['remoteUri'],_0x2480dc['id'],_0xc6d691['id']),'method':_0x2458('0x50')});case _0x2458('0x51'):logger[_0x2458('0x16')](_0x2458('0x52'),_0x2458('0x53'));emit(util[_0x2458('0xe')](_0x2458('0x54'),_0x26bef7[_0x2458('0x12')]),_0x2458('0x55'),{'uri':util[_0x2458('0xe')](_0x2458('0x56'),_0x480978[_0x2458('0x10')][_0x2458('0x57')](_0x2458('0x58'),''),_0xc6d691['id'])});break;default:logger[_0x2458('0x59')](_0x2458('0x52'),_0x2458('0x5a'));}}})[_0x2458('0x5b')](function(_0x4f4a3d){logger[_0x2458('0x59')](_0x2458('0x5c'),util[_0x2458('0x5d')](_0x4f4a3d,{'showHidden':!![],'depth':null}));});};exports[_0x2458('0x5e')]=function(_0x41cfa6,_0x488838,_0x8d00b0,_0x41f65b,_0x519dfb,_0x121af7,_0x143f19){var _0x48c403,_0x392b3d;_0x121af7[_0x2458('0x10')]=intUtil[_0x2458('0x42')](_0x121af7[_0x2458('0x10')]);_0x121af7[_0x2458('0x43')]=intUtil[_0x2458('0x42')](_0x121af7['serverUrl']);if(_0x143f19&&_0x143f19[_0x2458('0x5f')]&&_0x143f19[_0x2458('0x5f')]!==_0x2458('0x60')){logger[_0x2458('0x16')]('[OUTBOUND]',_0x2458('0x45'));_0x488838[_0x2458('0x46')]=util[_0x2458('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x121af7['serverUrl'],_0x488838[_0x2458('0x48')],md5(_0x488838['uniqueid']));}headers[_0x2458('0x49')]=getAuth(_0x121af7);return getUser(_0x121af7,_0x41f65b[_0x2458('0x4a')])['then'](function(_0x268adc){_0x48c403=_0x268adc;logger[_0x2458('0x16')](_0x2458('0x4b'),_0x48c403['id']);return getEndUser(_0x121af7,_0x488838[_0x2458('0x61')],_0x488838[_0x2458('0x62')]);})[_0x2458('0x19')](function(_0x2962b0){_0x392b3d=_0x2962b0;logger[_0x2458('0x16')](_0x2458('0x4d'),_0x392b3d['id']);return getTicket(_0x121af7,_0x48c403,_0x392b3d,_0x8d00b0,_0x488838);})[_0x2458('0x19')](function(_0x389749){if(_0x389749){logger[_0x2458('0x16')](_0x2458('0x63'),_0x389749['id']);switch(_0x121af7[_0x2458('0x33')]){case _0x2458('0x64'):logger[_0x2458('0x16')](_0x2458('0x65'),_0x2458('0x4e'));return request({'uri':util[_0x2458('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x121af7[_0x2458('0x10')],_0x48c403['id'],_0x389749['id']),'method':'POST'});case _0x2458('0x51'):logger[_0x2458('0x16')](_0x2458('0x65'),_0x2458('0x53'));emit(util['format']('user:%s',_0x41f65b['name']),_0x2458('0x55'),{'uri':util[_0x2458('0xe')](_0x2458('0x56'),_0x121af7['remoteUri'][_0x2458('0x57')](_0x2458('0x58'),''),_0x389749['id'])});break;default:logger[_0x2458('0x59')](_0x2458('0x65'),_0x2458('0x5a'));}}})['catch'](function(_0x54e547){logger[_0x2458('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x2458('0x5d')](_0x54e547,{'showHidden':!![],'depth':null}));});};exports[_0x2458('0x66')]=function(_0xd6c2cb,_0x7b6ee,_0x53fa1c,_0x48e55e,_0x5bec7c,_0x4264b9){var _0x255b59,_0x139974;_0x4264b9['remoteUri']=intUtil[_0x2458('0x42')](_0x4264b9['remoteUri']);_0x4264b9['serverUrl']=intUtil['stripTrailingSlash'](_0x4264b9['serverUrl']);if(_0x5bec7c&&_0x5bec7c[_0x2458('0x44')]){logger[_0x2458('0x16')]('['+_0x7b6ee['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x7b6ee[_0x2458('0x46')]=util[_0x2458('0xe')](_0x2458('0x47'),_0x4264b9[_0x2458('0x43')],_0x7b6ee[_0x2458('0x48')],md5(_0x7b6ee[_0x2458('0x48')]));}else{_0x7b6ee['recordingURL']='';}headers[_0x2458('0x49')]=getAuth(_0x4264b9);return getUser(_0x4264b9)[_0x2458('0x19')](function(_0x15eae7){_0x255b59=_0x15eae7;logger[_0x2458('0x16')](_0x2458('0x4b'),_0x255b59['id']);return getEndUser(_0x4264b9,_0x7b6ee[_0x2458('0x67')],_0x7b6ee[_0x2458('0x4c')]);})[_0x2458('0x19')](function(_0x1bff92){_0x139974=_0x1bff92;logger[_0x2458('0x16')](_0x2458('0x4d'),_0x139974['id']);return getTicket(_0x4264b9,_0x255b59,_0x139974,_0x53fa1c,_0x7b6ee);})['then'](function(_0x286f70){if(_0x286f70){logger[_0x2458('0x16')](_0x2458('0x63'),_0x286f70['id']);}})[_0x2458('0x5b')](function(_0x13106c){logger[_0x2458('0x59')]('['+_0x7b6ee[_0x2458('0x68')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x2458('0x5d')](_0x13106c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3f43=['Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','end-user','first','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','push','variableName','custom_fields','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','recordingURL','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','inspect','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','getString','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user'];(function(_0x394def,_0xbbc89){var _0x94bbfc=function(_0x10c69f){while(--_0x10c69f){_0x394def['push'](_0x394def['shift']());}};_0x94bbfc(++_0xbbc89);}(_0x3f43,0xb7));var _0x33f4=function(_0x44a3b6,_0x34b10b){_0x44a3b6=_0x44a3b6-0x0;var _0x479ea4=_0x3f43[_0x44a3b6];return _0x479ea4;};'use strict';var _=require(_0x33f4('0x0'));var rp=require('request-promise');var md5=require(_0x33f4('0x1'));var util=require(_0x33f4('0x2'));var Redis=require(_0x33f4('0x3'));var intUtil=require('./util');var config=require(_0x33f4('0x4'));var logger=require(_0x33f4('0x5'))(_0x33f4('0x6'));config[_0x33f4('0x7')]=_[_0x33f4('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x33f4('0x9'))(new Redis(config['redis']));function emit(_0x34f13a,_0x10a016,_0x435584){io['to'](_0x34f13a)[_0x33f4('0xa')](_0x10a016,_0x435584);}var headers={'Content-Type':_0x33f4('0xb'),'Accept':'application/json'};function getTicket(_0x34763,_0x29e753,_0x2d63cb,_0x450c93,_0x43d700){logger[_0x33f4('0xc')](_0x33f4('0xd'));return request({'uri':util[_0x33f4('0xe')](_0x33f4('0xf'),_0x34763[_0x33f4('0x10')]),'method':'POST','body':{'ticket':_[_0x33f4('0x11')]({'requester_id':_0x2d63cb['id'],'submitter_id':_0x29e753?_0x29e753['id']:undefined,'assignee_id':_0x29e753?_0x29e753['id']:undefined,'tags':getTags(_0x450c93['Tags'],'name'),'subject':intUtil[_0x33f4('0x12')](_0x450c93['Subjects'],_0x43d700,'\x20'),'description':intUtil[_0x33f4('0x12')](_0x450c93[_0x33f4('0x13')],_0x43d700,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x450c93[_0x33f4('0x13')],_0x43d700,'\x0a')}},getCustomFields(_0x450c93[_0x33f4('0x14')],_0x43d700))}})[_0x33f4('0x15')](function(_0x29d389){logger['info']('Ticket\x20created!');return _0x29d389[_0x33f4('0x16')];});}function getUser(_0x34b6be,_0x4de2ef){if(intUtil[_0x33f4('0x17')](_0x4de2ef)){logger[_0x33f4('0xc')](_0x33f4('0x18'),_0x4de2ef);return request({'uri':util['format'](_0x33f4('0x19'),_0x34b6be[_0x33f4('0x10')]),'qs':{'query':util[_0x33f4('0xe')]('type:user\x20role:agent\x20email:%s',_0x4de2ef)}})[_0x33f4('0x15')](function(_0x3c6592){if(_0x3c6592[_0x33f4('0x1a')]){logger[_0x33f4('0xc')]('Agent\x20found!');return _[_0x33f4('0x1b')](_0x3c6592['results'],{'email':_0x4de2ef,'role':_0x33f4('0x1c')});}else{logger[_0x33f4('0xc')](_0x33f4('0x1d'));return request({'uri':util[_0x33f4('0xe')](_0x33f4('0x1e'),_0x34b6be[_0x33f4('0x10')])})[_0x33f4('0x15')](function(_0xb2825f){logger[_0x33f4('0xc')](_0x33f4('0x1f'));return _0xb2825f[_0x33f4('0x20')];});}});}else{logger[_0x33f4('0xc')](_0x33f4('0x1d'));return request({'uri':util[_0x33f4('0xe')](_0x33f4('0x1e'),_0x34b6be[_0x33f4('0x10')])})[_0x33f4('0x15')](function(_0x509ee0){logger[_0x33f4('0xc')]('Admin\x20account\x20selected.');return _0x509ee0['user'];});}}function getEndUser(_0x11b507,_0xc99ed5,_0x1ebfa7){logger[_0x33f4('0xc')](_0x33f4('0x21'),_0x1ebfa7);return request({'uri':util['format'](_0x33f4('0x19'),_0x11b507[_0x33f4('0x10')]),'qs':{'query':util[_0x33f4('0xe')](_0x33f4('0x22'),_0x1ebfa7)}})['then'](function(_0x439a30){var _0x4aab8d;if(_0x439a30[_0x33f4('0x23')][_0x33f4('0x24')]){_0x439a30['results']=_['filter'](_0x439a30['results'],{'suspended':![],'role':_0x33f4('0x25')});if(_0x439a30[_0x33f4('0x23')][_0x33f4('0x24')]){_0x4aab8d=_[_0x33f4('0x26')](_0x439a30[_0x33f4('0x23')]);}}if(_0x4aab8d){logger['info']('Enduser\x20found!');return _0x4aab8d;}else{logger[_0x33f4('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x33f4('0xe')]('%s/users.json',_0x11b507['remoteUri']),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x33f4('0xe')](_0x33f4('0x27'),_0xc99ed5||_0x1ebfa7),'phone':_0x1ebfa7}}})['then'](function(_0x3f5930){logger[_0x33f4('0xc')](_0x33f4('0x28'));return _0x3f5930['user'];});}});}function getAuth(_0x14633a){var _0x144a01;if(_0x14633a[_0x33f4('0x29')]==='password'){_0x144a01=util['format'](_0x33f4('0x2a'),_0x14633a[_0x33f4('0x2b')],_0x14633a[_0x33f4('0x2c')]);}else if(_0x14633a['authType']===_0x33f4('0x2d')){_0x144a01=util[_0x33f4('0xe')](_0x33f4('0x2e'),_0x14633a[_0x33f4('0x2b')],_0x14633a['token']);}return util[_0x33f4('0xe')](_0x33f4('0x2f'),new Buffer(_0x144a01)['toString'](_0x33f4('0x30')));}function request(_0x47cdf7){logger[_0x33f4('0x31')](_0x33f4('0x32'),JSON[_0x33f4('0x33')](_0x47cdf7));return rp(_['defaults'](_0x47cdf7,{'method':_0x33f4('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x3abf58,_0x4714e1){var _0x33e0ce=[];if(_0x3abf58&&_0x3abf58[_0x33f4('0x24')]>0x0){_0x33e0ce=_[_0x33f4('0x35')](_0x3abf58,_0x4714e1);}return _0x33e0ce;}function getCustomFields(_0x508592,_0x26e41e){var _0x3326cf=[];var _0x319a15={'custom_fields':[]};if(_0x508592[_0x33f4('0x24')]>0x0){_['forEach'](_0x508592,function(_0x32fdb4){if(_[_0x33f4('0x36')]([_0x33f4('0x37'),_0x33f4('0x38')],_0x32fdb4[_0x33f4('0x39')])&&_0x32fdb4[_0x33f4('0x3a')]&&!_0x32fdb4[_0x33f4('0x3b')]){_0x319a15[_0x32fdb4['nameField'][_0x33f4('0x3c')]()]=_0x32fdb4[_0x33f4('0x3d')][_0x33f4('0x3e')]();}else if(_['includes'](['string','picklist'],_0x32fdb4[_0x33f4('0x39')])&&_0x32fdb4[_0x33f4('0x3f')]&&_0x32fdb4['customField']){_0x319a15['custom_fields'][_0x33f4('0x40')]({'id':_0x32fdb4['idField'],'value':_0x32fdb4['content'][_0x33f4('0x3e')]()});}else if(_0x32fdb4['type']==='variable'&&_0x32fdb4[_0x33f4('0x41')]&&_0x32fdb4['idField']&&_0x32fdb4['customField']){_0x26e41e[_0x32fdb4[_0x33f4('0x41')]]&&_0x319a15[_0x33f4('0x42')][_0x33f4('0x40')]({'id':_0x32fdb4[_0x33f4('0x3f')],'value':_0x26e41e[_0x32fdb4[_0x33f4('0x41')]][_0x33f4('0x3e')]()});}else if(_0x32fdb4[_0x33f4('0x39')]==='customVariable'&&_0x32fdb4[_0x33f4('0x43')]&&_0x32fdb4[_0x33f4('0x43')][_0x33f4('0x44')]&&_0x32fdb4[_0x33f4('0x3f')]&&_0x32fdb4[_0x33f4('0x3b')]){_0x26e41e[_0x32fdb4[_0x33f4('0x43')][_0x33f4('0x44')][_0x33f4('0x3c')]()]&&_0x319a15[_0x33f4('0x42')][_0x33f4('0x40')]({'id':_0x32fdb4['idField'],'value':_0x26e41e[_0x32fdb4['Variable'][_0x33f4('0x44')][_0x33f4('0x3c')]()][_0x33f4('0x3e')]()});}});}return _0x319a15;}exports[_0x33f4('0x45')]=function(_0x73c250,_0x1ab287,_0x4b24c8,_0x49c19c,_0x65ba0d,_0x33503e){var _0x4f141e,_0x5bc4d9;_0x33503e['remoteUri']=intUtil['stripTrailingSlash'](_0x33503e['remoteUri']);_0x33503e['serverUrl']=intUtil[_0x33f4('0x46')](_0x33503e[_0x33f4('0x47')]);if(_0x65ba0d&&_0x65ba0d[_0x33f4('0x48')]){logger[_0x33f4('0xc')](_0x33f4('0x49'),_0x33f4('0x4a'));_0x1ab287['recordingURL']=util['format'](_0x33f4('0x4b'),_0x33503e[_0x33f4('0x47')],_0x1ab287[_0x33f4('0x4c')],md5(_0x1ab287['uniqueid']));}else{_0x1ab287['recordingURL']='';}headers['Authorization']=getAuth(_0x33503e);return getUser(_0x33503e,_0x49c19c[_0x33f4('0x4d')])['then'](function(_0x248380){_0x4f141e=_0x248380;logger[_0x33f4('0xc')](_0x33f4('0x4e'),_0x4f141e['id']);return getEndUser(_0x33503e,_0x1ab287['calleridname'],_0x1ab287[_0x33f4('0x4f')]);})[_0x33f4('0x15')](function(_0x4b7a2d){_0x5bc4d9=_0x4b7a2d;logger[_0x33f4('0xc')](_0x33f4('0x50'),_0x5bc4d9['id']);return getTicket(_0x33503e,_0x4f141e,_0x5bc4d9,_0x4b24c8,_0x1ab287);})['then'](function(_0x197de3){if(_0x197de3){logger[_0x33f4('0xc')]('The\x20Ticket\x20ID\x20is:',_0x197de3['id']);switch(_0x33503e[_0x33f4('0x39')]){case _0x33f4('0x51'):logger[_0x33f4('0xc')](_0x33f4('0x49'),_0x33f4('0x52'));return request({'uri':util[_0x33f4('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x33503e[_0x33f4('0x10')],_0x4f141e['id'],_0x197de3['id']),'method':_0x33f4('0x53')});case _0x33f4('0x54'):logger['info'](_0x33f4('0x49'),_0x33f4('0x55'));emit(util[_0x33f4('0xe')](_0x33f4('0x56'),_0x49c19c[_0x33f4('0x44')]),_0x33f4('0x57'),{'uri':util[_0x33f4('0xe')](_0x33f4('0x58'),_0x33503e[_0x33f4('0x10')][_0x33f4('0x59')](_0x33f4('0x5a'),''),_0x197de3['id'])});break;default:logger['error']('[QUEUE]',_0x33f4('0x5b'));}}})[_0x33f4('0x5c')](function(_0x4c0800){logger[_0x33f4('0x5d')](_0x33f4('0x5e'),util['inspect'](_0x4c0800,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x402402,_0x22824b,_0x494fdb,_0x537a47,_0x517131,_0x5c2401,_0x216f3c){var _0x1b337d,_0xd1db9c;_0x5c2401[_0x33f4('0x10')]=intUtil['stripTrailingSlash'](_0x5c2401['remoteUri']);_0x5c2401['serverUrl']=intUtil[_0x33f4('0x46')](_0x5c2401[_0x33f4('0x47')]);if(_0x216f3c&&_0x216f3c[_0x33f4('0x5f')]&&_0x216f3c[_0x33f4('0x5f')]!==_0x33f4('0x60')){logger[_0x33f4('0xc')]('[OUTBOUND]',_0x33f4('0x4a'));_0x22824b[_0x33f4('0x61')]=util['format'](_0x33f4('0x4b'),_0x5c2401[_0x33f4('0x47')],_0x22824b[_0x33f4('0x4c')],md5(_0x22824b[_0x33f4('0x4c')]));}headers['Authorization']=getAuth(_0x5c2401);return getUser(_0x5c2401,_0x537a47[_0x33f4('0x4d')])['then'](function(_0x500aac){_0x1b337d=_0x500aac;logger['info']('The\x20User\x20ID\x20is:',_0x1b337d['id']);return getEndUser(_0x5c2401,_0x22824b[_0x33f4('0x62')],_0x22824b[_0x33f4('0x63')]);})['then'](function(_0x348e1b){_0xd1db9c=_0x348e1b;logger[_0x33f4('0xc')](_0x33f4('0x50'),_0xd1db9c['id']);return getTicket(_0x5c2401,_0x1b337d,_0xd1db9c,_0x494fdb,_0x22824b);})['then'](function(_0xebb0b2){if(_0xebb0b2){logger[_0x33f4('0xc')]('The\x20Ticket\x20ID\x20is:',_0xebb0b2['id']);switch(_0x5c2401[_0x33f4('0x39')]){case'integrationTab':logger[_0x33f4('0xc')](_0x33f4('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x33f4('0xe')](_0x33f4('0x65'),_0x5c2401[_0x33f4('0x10')],_0x1b337d['id'],_0xebb0b2['id']),'method':_0x33f4('0x53')});case _0x33f4('0x54'):logger['info'](_0x33f4('0x64'),_0x33f4('0x55'));emit(util[_0x33f4('0xe')]('user:%s',_0x537a47[_0x33f4('0x44')]),_0x33f4('0x57'),{'uri':util['format'](_0x33f4('0x58'),_0x5c2401[_0x33f4('0x10')]['replace'](_0x33f4('0x5a'),''),_0xebb0b2['id'])});break;default:logger[_0x33f4('0x5d')](_0x33f4('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x20e5c3){logger[_0x33f4('0x5d')](_0x33f4('0x66'),util['inspect'](_0x20e5c3,{'showHidden':!![],'depth':null}));});};exports[_0x33f4('0x67')]=function(_0x4a120,_0x1c1c0c,_0x4c19e3,_0x39a6e7,_0x1996d0,_0x2fe0d4){var _0xeaf258,_0x2b4ef8;_0x2fe0d4[_0x33f4('0x10')]=intUtil[_0x33f4('0x46')](_0x2fe0d4[_0x33f4('0x10')]);_0x2fe0d4[_0x33f4('0x47')]=intUtil[_0x33f4('0x46')](_0x2fe0d4['serverUrl']);if(_0x1996d0&&_0x1996d0[_0x33f4('0x48')]){logger['info']('['+_0x1c1c0c[_0x33f4('0x68')][_0x33f4('0x69')]()+']',_0x33f4('0x4a'));_0x1c1c0c[_0x33f4('0x61')]=util[_0x33f4('0xe')](_0x33f4('0x4b'),_0x2fe0d4[_0x33f4('0x47')],_0x1c1c0c[_0x33f4('0x4c')],md5(_0x1c1c0c[_0x33f4('0x4c')]));}else{_0x1c1c0c['recordingURL']='';}headers['Authorization']=getAuth(_0x2fe0d4);return getUser(_0x2fe0d4)[_0x33f4('0x15')](function(_0x13742a){_0xeaf258=_0x13742a;logger[_0x33f4('0xc')](_0x33f4('0x4e'),_0xeaf258['id']);return getEndUser(_0x2fe0d4,_0x1c1c0c['calleridname'],_0x1c1c0c[_0x33f4('0x4f')]);})['then'](function(_0x3d5e1d){_0x2b4ef8=_0x3d5e1d;logger[_0x33f4('0xc')](_0x33f4('0x50'),_0x2b4ef8['id']);return getTicket(_0x2fe0d4,_0xeaf258,_0x2b4ef8,_0x4c19e3,_0x1c1c0c);})[_0x33f4('0x15')](function(_0x1d3cac){if(_0x1d3cac){logger[_0x33f4('0xc')](_0x33f4('0x6a'),_0x1d3cac['id']);}})['catch'](function(_0x32882a){logger[_0x33f4('0x5d')]('['+_0x1c1c0c[_0x33f4('0x68')][_0x33f4('0x69')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x33f4('0x6b')](_0x32882a,{'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 54f4df2..16dc3e2 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 _0xe717=['https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','add','seconds','catch','error','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','isArrayLikeObject','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','/crm/v2/','startCase','role','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','first_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','diff','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','stack','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','unmanaged','toUpperCase','lodash','request-promise','md5','util','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','stringify','length','forEach','includes','picklist','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.in'];(function(_0x3b4998,_0x2d7866){var _0x5767a4=function(_0x39a510){while(--_0x39a510){_0x3b4998['push'](_0x3b4998['shift']());}};_0x5767a4(++_0x2d7866);}(_0xe717,0x7b));var _0x7e71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe717[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e71('0x0'));var rp=require(_0x7e71('0x1'));var md5=require(_0x7e71('0x2'));var util=require(_0x7e71('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0x7e71('0x4'));var config=require(_0x7e71('0x5'));var logger=require('../../../../config/logger')(_0x7e71('0x6'));config[_0x7e71('0x7')]=_[_0x7e71('0x8')](config['redis'],{'host':_0x7e71('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x176801,_0x5ee458,_0x4e79f0){io['to'](_0x176801)[_0x7e71('0xa')](_0x5ee458,_0x4e79f0);}function request(_0x4f2b19){logger['debug']('[HTTP]',JSON[_0x7e71('0xb')](_0x4f2b19));return rp(_0x4f2b19);}function getCustomFields(_0x19d44e,_0x541094){var _0x52957b={};if(_0x19d44e[_0x7e71('0xc')]>0x0){_[_0x7e71('0xd')](_0x19d44e,function(_0x34e984){if(_[_0x7e71('0xe')](['string',_0x7e71('0xf')],_0x34e984[_0x7e71('0x10')])&&_0x34e984[_0x7e71('0x11')]){_0x52957b[_0x34e984[_0x7e71('0x11')]]=_0x34e984['content'][_0x7e71('0x12')]();}else if(_0x34e984['type']==='variable'&&_0x34e984[_0x7e71('0x13')]&&_0x34e984[_0x7e71('0x11')]&&_0x541094[_0x34e984[_0x7e71('0x13')]]){_0x52957b[_0x34e984['idField']]=_0x541094[_0x34e984[_0x7e71('0x13')]][_0x7e71('0x12')]();}else if(_0x34e984['type']===_0x7e71('0x14')&&_0x34e984['Variable']&&_0x34e984[_0x7e71('0x15')][_0x7e71('0x16')]&&_0x34e984['idField']&&_0x541094[_0x34e984[_0x7e71('0x15')][_0x7e71('0x16')][_0x7e71('0x17')]()]){_0x52957b[_0x34e984[_0x7e71('0x11')]]=_0x541094[_0x34e984['Variable']['name']['toLowerCase']()]['toString']();}});}return _0x52957b;}function getName(_0x2d7752){if(_0x2d7752[_0x7e71('0x18')]('\x20')>0x0){var _0x5913bf=_0x2d7752[_0x7e71('0x19')](/ (.+)/);if(_0x5913bf[0x1]){return _0x5913bf;}}return[_0x2d7752,_0x2d7752];}var accountsTokens={};function getAccessToken(_0x3ea74e){return new Promise(function(_0x491f97,_0x1ec505){if(!_[_0x7e71('0x1a')](accountsTokens[_0x3ea74e['id']])&&!_[_0x7e71('0x1a')](accountsTokens[_0x3ea74e['id']][_0x7e71('0x1b')])){if(moment()[_0x7e71('0x1c')](accountsTokens[_0x3ea74e['id']][_0x7e71('0x1d')])){_0x491f97(accountsTokens[_0x3ea74e['id']][_0x7e71('0x1b')]);}}var _0x2b1918;switch(_0x3ea74e['zone']){case'US':_0x2b1918=_0x7e71('0x1e');break;case'AU':_0x2b1918='https://accounts.zoho.com.au';break;case'EU':_0x2b1918='https://accounts.zoho.eu';break;case'IN':_0x2b1918=_0x7e71('0x1f');break;case'CN':_0x2b1918=_0x7e71('0x20');break;default:_0x2b1918=_0x7e71('0x21');break;}var _0x2a8bf1={'method':'POST','uri':_0x2b1918+_0x7e71('0x22'),'qs':{'refresh_token':_0x3ea74e[_0x7e71('0x23')],'client_id':_0x3ea74e[_0x7e71('0x24')],'client_secret':_0x3ea74e[_0x7e71('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x2a8bf1)['then'](function(_0x58e55f){accountsTokens[_0x3ea74e['id']]={'access_token':_0x58e55f[_0x7e71('0x1b')],'expires_in':moment()[_0x7e71('0x26')](_0x58e55f[_0x7e71('0x1d')],_0x7e71('0x27'))};_0x491f97(_0x58e55f[_0x7e71('0x1b')]);})[_0x7e71('0x28')](function(_0x335802){logger[_0x7e71('0x29')]('Failing\x20creating\x20the\x20access_token',_0x335802['stack']);_0x1ec505(_0x335802);});});}function getUser(_0x13b174,_0x25d466,_0x35b434,_0x2f423b){logger[_0x7e71('0x2a')]('Search\x20user');return request({'method':_0x7e71('0x2b'),'uri':util[_0x7e71('0x2c')](_0x7e71('0x2d'),_0x25d466),'qs':{'type':_0x7e71('0x2e')},'headers':{'Authorization':_0x7e71('0x2f')+_0x13b174},'json':!![]})[_0x7e71('0x30')](function(_0x34e90f){if(_0x34e90f['users']){var _0x49f8dd=-0x1;if(_[_0x7e71('0x31')](_0x34e90f[_0x7e71('0x32')])){if(!_['isNil'](_0x2f423b)){_0x49f8dd=_[_0x7e71('0x33')](_0x34e90f[_0x7e71('0x32')],function(_0x436cea){return _0x436cea[_0x7e71('0x34')]===_0x2f423b;});}if(_0x49f8dd>=0x0){logger[_0x7e71('0x2a')](_0x7e71('0x35'));}else{logger[_0x7e71('0x2a')](_0x7e71('0x36'));_0x49f8dd=_['findIndex'](_0x34e90f[_0x7e71('0x32')],function(_0x199f7e){return _0x199f7e[_0x7e71('0x37')][_0x7e71('0x16')]===_0x7e71('0x38');});}return _0x34e90f[_0x7e71('0x32')][_0x49f8dd];}else{if(_0x34e90f['user'][_0x7e71('0x37')]['name']===_0x7e71('0x38')){logger['info'](_0x7e71('0x36'));user=_0x34e90f[_0x7e71('0x39')];return user;}else{logger[_0x7e71('0x29')](_0x7e71('0x3a'),JSON['stringify'](_0x34e90f));throw new Error(_0x7e71('0x3b')+JSON[_0x7e71('0xb')](_0x34e90f));}}}else{logger[_0x7e71('0x29')](_0x7e71('0x3a'),JSON['stringify'](_0x34e90f));throw new Error(_0x7e71('0x3b')+JSON[_0x7e71('0xb')](_0x34e90f));}})[_0x7e71('0x28')](function(_0x428a67){console['error'](_0x428a67);});}function getZohoUser(_0x53fd4d,_0x2a66bb){return new BPromise(function(_0x19b0e2,_0x582e96){request(_0x53fd4d)['then'](function(_0x4a5550){var _0x59378b=null;if(_0x4a5550){_0x59378b=_0x4a5550[_0x7e71('0x3c')][0x0];_0x59378b[_0x7e71('0x3d')]=_0x2a66bb;}_0x19b0e2(_0x59378b);})[_0x7e71('0x28')](function(_0x2580a3){_0x582e96(_0x2580a3);});});}function createEndUser(_0x1d096d,_0x317a3e,_0x31b4d2,_0x42ef45,_0x165b4f,_0x29e2d4){var _0x31b4d2=getName(_0x31b4d2);return request({'method':_0x7e71('0x3e'),'uri':'https://www.zohoapis.'+_0x317a3e+_0x7e71('0x3f')+_[_0x7e71('0x40')](_0x29e2d4['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x31b4d2[0x1],'First_Name':_0x31b4d2[0x0],'Phone':_0x42ef45,'Owner':{'name':!_['isNil'](_0x165b4f[_0x7e71('0x41')][_0x7e71('0x16')])?_0x165b4f[_0x7e71('0x41')][_0x7e71('0x16')]:!_[_0x7e71('0x1a')](_0x165b4f['first_name'])?_0x165b4f['first_name']+'\x20'+_0x165b4f[_0x7e71('0x42')]:_0x165b4f[_0x7e71('0x42')],'id':_0x165b4f['id']}}]},'headers':{'Authorization':_0x7e71('0x2f')+_0x1d096d},'json':!![]})[_0x7e71('0x30')](function(_0x29f411){if(_0x29f411&&_0x29f411[_0x7e71('0x3c')][0x0][_0x7e71('0x43')]===_0x7e71('0x44')){var _0x44497e=_0x29f411['data'][0x0][_0x7e71('0x45')];_0x44497e['enduserType']=_[_0x7e71('0x40')](_0x29e2d4[_0x7e71('0x46')])+'s';return _0x44497e;}logger[_0x7e71('0x29')](_0x7e71('0x3a'),JSON[_0x7e71('0xb')](data));throw new Error(_0x7e71('0x47')+JSON['stringify'](data));})[_0x7e71('0x28')](function(_0x59181d){console[_0x7e71('0x48')](_0x7e71('0x49'),_0x59181d);});}function getEndUser(_0x554d41,_0x440c5f,_0x474885,_0x560d78,_0x41940d,_0x38792b,_0x3f3dcf){var _0x26410a={'method':_0x7e71('0x2b'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x554d41},'json':!![]};switch(_0x3f3dcf[_0x7e71('0x4a')]){case _0x7e71('0x4b'):_0x26410a[_0x7e71('0x4c')]='https://www.zohoapis.'+_0x440c5f+_0x7e71('0x4d')+_0x41940d+'))';return getZohoUser(_0x26410a,_0x7e71('0x4e'))[_0x7e71('0x30')](function(_0x108c56){if(_0x108c56)return _0x108c56;_0x26410a[_0x7e71('0x4c')]=_0x7e71('0x4f')+_0x440c5f+_0x7e71('0x50')+_0x41940d+'))';return getZohoUser(_0x26410a,_0x7e71('0x51'))[_0x7e71('0x30')](function(_0x11ee73){if(_0x11ee73)return _0x11ee73;if(_0x3f3dcf[_0x7e71('0x46')]!=_0x7e71('0x52')){return createEndUser(_0x554d41,_0x440c5f,_0x560d78,_0x41940d,_0x38792b,_0x3f3dcf);}else{return{};}});});break;case _0x7e71('0x53'):_0x26410a[_0x7e71('0x4c')]=_0x7e71('0x4f')+_0x440c5f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x41940d+'))';return getZohoUser(_0x26410a,'Contacts')[_0x7e71('0x30')](function(_0x144aac){if(_0x144aac)return _0x144aac;if(_0x3f3dcf[_0x7e71('0x46')]!=_0x7e71('0x52')){return createEndUser(_0x554d41,_0x440c5f,_0x560d78,_0x41940d,_0x38792b,_0x3f3dcf);}else{return{};}});break;case _0x7e71('0x54'):_0x26410a['uri']=_0x7e71('0x4f')+_0x440c5f+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x41940d+'))';return getZohoUser(_0x26410a,_0x7e71('0x51'))[_0x7e71('0x30')](function(_0x587415){if(_0x587415)return _0x587415;if(_0x3f3dcf[_0x7e71('0x46')]!=_0x7e71('0x52')){return createEndUser(_0x554d41,_0x440c5f,_0x560d78,_0x41940d,_0x38792b,_0x3f3dcf);}else{return{};}});break;}}function getCall(_0x3d0b06,_0x38d4f1,_0x56cfc2,_0x14b660,_0x1a1245,_0x507e9d,_0x3a1160,_0xc79529){logger[_0x7e71('0x2a')](_0x7e71('0x55'));var _0x43f4a8={};_0x43f4a8[_0x7e71('0x56')]={'name':!_[_0x7e71('0x1a')](_0x14b660['role'][_0x7e71('0x16')])&&!_[_0x7e71('0x1a')](_0x14b660['profile'][_0x7e71('0x16')])&&_0x14b660[_0x7e71('0x37')][_0x7e71('0x16')]===_0x7e71('0x57')?_0x14b660[_0x7e71('0x41')]['name']:!_['isNil'](_0x14b660[_0x7e71('0x58')])?_0x14b660[_0x7e71('0x58')]+'\x20'+_0x14b660['last_name']:_0x14b660[_0x7e71('0x42')],'id':_0x14b660['id']};_0x43f4a8[_0x7e71('0x59')]=intUtil[_0x7e71('0x5a')](_0x507e9d[_0x7e71('0x5b')],_0x3a1160,'\x20');_0x43f4a8[_0x7e71('0x5c')]=intUtil[_0x7e71('0x5a')](_0x507e9d[_0x7e71('0x5d')],_0x3a1160,'\x0a');if(_0x1a1245[_0x7e71('0x3d')]===_0x7e71('0x4e')){_0x43f4a8[_0x7e71('0x5e')]={'name':!_[_0x7e71('0x1a')](_0x1a1245[_0x7e71('0x5f')])?_0x1a1245[_0x7e71('0x5f')]:!_[_0x7e71('0x1a')](_0x1a1245['First_Name'])?_0x1a1245[_0x7e71('0x60')]+'\x20'+_0x1a1245[_0x7e71('0x61')]:_0x1a1245[_0x7e71('0x61')],'id':_0x1a1245['id']};}if(_0x1a1245[_0x7e71('0x3d')]===_0x7e71('0x51')){_0x43f4a8['What_Id']={'name':!_[_0x7e71('0x1a')](_0x1a1245[_0x7e71('0x5f')])?_0x1a1245['Full_Name']:!_[_0x7e71('0x1a')](_0x1a1245[_0x7e71('0x60')])?_0x1a1245[_0x7e71('0x60')]+'\x20'+_0x1a1245[_0x7e71('0x61')]:_0x1a1245[_0x7e71('0x61')],'id':_0x1a1245['id']};_0x43f4a8[_0x7e71('0x62')]=_[_0x7e71('0x40')](_0x1a1245['enduserType']);}if(_0x3a1160[_0x7e71('0x63')]){_0x43f4a8[_0x7e71('0x64')]=moment['utc'](parseInt(_0x3a1160[_0x7e71('0x63')])*0x3e8)[_0x7e71('0x2c')](_0x7e71('0x65'));}else if(_0x3a1160[_0x7e71('0x66')]&&_0x3a1160[_0x7e71('0x67')]){_0x43f4a8[_0x7e71('0x64')]=moment[_0x7e71('0x68')](moment(_0x3a1160[_0x7e71('0x67')],'YYYY-MM-DDTHH:mm:ss')[_0x7e71('0x69')](moment(_0x3a1160['starttime'],_0x7e71('0x6a'))))['format']('mm:ss');}switch(_0x3a1160[_0x7e71('0x6b')]){case'called':_0x43f4a8[_0x7e71('0x6c')]='Called';break;case'complete':case _0x7e71('0x6d'):_0x43f4a8[_0x7e71('0x6c')]=_0x7e71('0x6e');break;case _0x7e71('0x6f'):_0x43f4a8[_0x7e71('0x6c')]=_0x7e71('0x70');break;case _0x7e71('0x71'):_0x43f4a8[_0x7e71('0x6c')]=_0x7e71('0x72');break;case _0x7e71('0x73'):_0x43f4a8[_0x7e71('0x6c')]=_0x7e71('0x74');default:}_0x43f4a8[_0x7e71('0x75')]=(_0xc79529===_0x7e71('0x76')?moment(_0x3a1160['starttime'])[_0x7e71('0x2c')](_0x7e71('0x6a')):moment(_0x3a1160[_0x7e71('0x77')])[_0x7e71('0x2c')](_0x7e71('0x6a')))||moment()[_0x7e71('0x2c')]('YYYY-MM-DDTHH:mm:ss');_0x43f4a8[_0x7e71('0x78')]=_0xc79529||_0x7e71('0x79');_0x43f4a8=_[_0x7e71('0x7a')](_0x43f4a8,getCustomFields(_0x507e9d['Fields'],_0x3a1160));return request({'method':_0x7e71('0x3e'),'uri':'https://www.zohoapis.'+_0x38d4f1+_0x7e71('0x7b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3d0b06},'body':{'data':[_0x43f4a8]},'json':!![]})[_0x7e71('0x30')](function(_0x5d85d6){if(_0x5d85d6&&_0x5d85d6[_0x7e71('0x3c')][0x0]['code']===_0x7e71('0x44')){logger[_0x7e71('0x2a')]('Call\x20created!');return{'id':_0x5d85d6[_0x7e71('0x3c')][0x0][_0x7e71('0x45')]['id']};}})[_0x7e71('0x28')](function(_0x924f35){logger[_0x7e71('0x2a')]('err',_0x924f35[_0x7e71('0x7c')]);console[_0x7e71('0x48')](_0x7e71('0x7d'),_0x924f35);});}exports[_0x7e71('0x7e')]=function(_0x79ea23,_0x466faf,_0x37db83,_0x4f0a38,_0x480ab1,_0x5d37a6){var _0x345a27,_0xc67ac1,_0x37b32b;_0x5d37a6[_0x7e71('0x7f')]=intUtil['stripTrailingSlash'](_0x5d37a6[_0x7e71('0x7f')]);_0x5d37a6[_0x7e71('0x80')]=intUtil[_0x7e71('0x81')](_0x5d37a6[_0x7e71('0x80')]);if(_0x480ab1&&_0x480ab1[_0x7e71('0x82')]){logger['info'](_0x7e71('0x83'),'Recording\x20is\x20enabled!');_0x466faf[_0x7e71('0x84')]=_0x5d37a6[_0x7e71('0x80')]+_0x7e71('0x85')+_0x466faf[_0x7e71('0x86')]+_0x7e71('0x87')+md5(_0x466faf[_0x7e71('0x86')]);}else{_0x466faf[_0x7e71('0x84')]='';}var _0xce8d12=_0x5d37a6['host']===_0x7e71('0x88')?'eu':_0x7e71('0x89');return getAccessToken(_0x5d37a6)[_0x7e71('0x30')](function(_0x1c8831){_0x37b32b=_0x1c8831;return getUser(_0x37b32b,_0xce8d12,_0x5d37a6,_0x4f0a38[_0x7e71('0x34')]);})[_0x7e71('0x30')](function(_0x2c1402){_0x345a27=_0x2c1402;logger[_0x7e71('0x2a')]('The\x20User\x20ID\x20is:',_0x345a27['id']);return getEndUser(_0x37b32b,_0xce8d12,_0x5d37a6,_0x466faf[_0x7e71('0x8a')],_0x466faf[_0x7e71('0x8b')],_0x345a27,_0x37db83);})[_0x7e71('0x30')](function(_0x358465){_0xc67ac1=_0x358465;return getCall(_0x37b32b,_0xce8d12,_0x5d37a6,_0x345a27,_0xc67ac1,_0x37db83,_0x466faf,_0x7e71('0x79'));})[_0x7e71('0x30')](function(_0x4c581f){if(_0x4c581f){logger[_0x7e71('0x2a')](_0x7e71('0x8c'),_0x4c581f['id']);logger['info'](_0x7e71('0x83'),_0x7e71('0x8d'));emit(util[_0x7e71('0x2c')](_0x7e71('0x8e'),_0x4f0a38[_0x7e71('0x16')]),_0x7e71('0x8f'),{'uri':_0x7e71('0x90')+_0x5d37a6[_0x7e71('0x7f')]+_0x7e71('0x91')+_0x4c581f['id']});}})[_0x7e71('0x28')](function(_0x2b8e59){logger[_0x7e71('0x29')](_0x7e71('0x83'),JSON['stringify'](_0x2b8e59));});};exports[_0x7e71('0x76')]=function(_0x21b9d5,_0x1f4b8d,_0x2dbd5a,_0x1c9048,_0xced0ed,_0x2072f0,_0x21b1b2){var _0x4aed6a,_0xdff332,_0x1ccbd1;_0x2072f0[_0x7e71('0x7f')]=intUtil[_0x7e71('0x81')](_0x2072f0[_0x7e71('0x7f')]);_0x2072f0['serverUrl']=intUtil['stripTrailingSlash'](_0x2072f0[_0x7e71('0x80')]);if(_0x21b1b2&&_0x21b1b2[_0x7e71('0x92')]&&_0x21b1b2['recordingFormat']!==_0x7e71('0x93')){logger[_0x7e71('0x2a')](_0x7e71('0x94'),_0x7e71('0x95'));_0x1f4b8d[_0x7e71('0x84')]=_0x2072f0['serverUrl']+_0x7e71('0x85')+_0x1f4b8d[_0x7e71('0x86')]+_0x7e71('0x87')+md5(_0x1f4b8d['uniqueid']);}var _0x2738c1=_0x2072f0[_0x7e71('0x7f')]==='zoho.eu'?'eu':_0x7e71('0x89');return getAccessToken(_0x2072f0)['then'](function(_0x209444){_0x1ccbd1=_0x209444;return getUser(_0x1ccbd1,_0x2738c1,_0x2072f0,_0x1c9048[_0x7e71('0x34')]);})[_0x7e71('0x30')](function(_0x31c8ac){_0x4aed6a=_0x31c8ac;logger[_0x7e71('0x2a')](_0x7e71('0x96'),_0x4aed6a['id']);return getEndUser(_0x1ccbd1,_0x2738c1,_0x2072f0,_0x1f4b8d[_0x7e71('0x97')],_0x1f4b8d[_0x7e71('0x98')],_0x4aed6a,_0x2dbd5a);})[_0x7e71('0x30')](function(_0x4a5bf8){_0xdff332=_0x4a5bf8;return getCall(_0x1ccbd1,_0x2738c1,_0x2072f0,_0x4aed6a,_0xdff332,_0x2dbd5a,_0x1f4b8d,'Outbound');})[_0x7e71('0x30')](function(_0x37ec93){if(_0x37ec93){logger[_0x7e71('0x2a')](_0x7e71('0x8c'),_0x37ec93['id']);logger['info'](_0x7e71('0x94'),_0x7e71('0x8d'));emit(util[_0x7e71('0x2c')](_0x7e71('0x8e'),_0x1c9048[_0x7e71('0x16')]),_0x7e71('0x8f'),{'uri':_0x7e71('0x90')+_0x2072f0[_0x7e71('0x7f')]+_0x7e71('0x91')+_0x37ec93['id']});}})[_0x7e71('0x28')](function(_0x10a450){logger[_0x7e71('0x29')](_0x7e71('0x94'),JSON[_0x7e71('0xb')](_0x10a450));});};exports[_0x7e71('0x99')]=function(_0x39990a,_0x486cc7,_0x1ab9d9,_0x3a3969,_0x3ee563,_0x203429){var _0x5ea437,_0x45871a,_0x2e8f95;_0x203429[_0x7e71('0x7f')]=intUtil[_0x7e71('0x81')](_0x203429[_0x7e71('0x7f')]);_0x203429[_0x7e71('0x80')]=intUtil[_0x7e71('0x81')](_0x203429['serverUrl']);if(_0x3ee563&&_0x3ee563[_0x7e71('0x82')]){logger[_0x7e71('0x2a')]('['+_0x486cc7[_0x7e71('0x6b')][_0x7e71('0x9a')]()+']',_0x7e71('0x95'));_0x486cc7[_0x7e71('0x84')]=_0x203429[_0x7e71('0x80')]+'/api/voice/recordings/'+_0x486cc7[_0x7e71('0x86')]+_0x7e71('0x87')+md5(_0x486cc7[_0x7e71('0x86')]);}else{_0x486cc7[_0x7e71('0x84')]='';}var _0x5299f3=_0x203429['host']===_0x7e71('0x88')?'eu':'com';return getAccessToken(_0x203429)[_0x7e71('0x30')](function(_0x19fde0){_0x2e8f95=_0x19fde0;return getUser(_0x2e8f95,_0x5299f3,_0x203429);})[_0x7e71('0x30')](function(_0x1b291d){_0x5ea437=_0x1b291d;logger[_0x7e71('0x2a')](_0x7e71('0x96'),_0x5ea437['id']);return getEndUser(_0x2e8f95,_0x5299f3,_0x203429,_0x486cc7[_0x7e71('0x8a')],_0x486cc7['calleridnum'],_0x5ea437,_0x1ab9d9);})[_0x7e71('0x30')](function(_0x171e97){_0x45871a=_0x171e97;return getCall(_0x2e8f95,_0x5299f3,_0x203429,_0x5ea437,_0x45871a,_0x1ab9d9,_0x486cc7,_0x7e71('0x79'));})['then'](function(_0x2984bf){if(_0x2984bf){logger[_0x7e71('0x2a')](_0x7e71('0x8c'),_0x2984bf['id']);}})[_0x7e71('0x28')](function(_0x55362f){logger[_0x7e71('0x29')]('['+_0x486cc7[_0x7e71('0x6b')][_0x7e71('0x9a')]()+']',JSON['stringify'](_0x55362f));});}; \ No newline at end of file +var _0xf440=['timeout','outbound','format','YYYY-MM-DDTHH:mm:ss','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','log','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','recordingURL','host','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','/api/voice/recordings/','request-promise','md5','util','./util','moment','ioredis','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','string','picklist','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','stack','Search\x20user','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','enduserType','CREATE\x20ERROR','GET','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','endtime','starttime','lastevent','called','Call_Result','Called','connect','Answered','rejected','abandoned'];(function(_0x11520f,_0x2545f8){var _0xe131cc=function(_0x33f86a){while(--_0x33f86a){_0x11520f['push'](_0x11520f['shift']());}};_0xe131cc(++_0x2545f8);}(_0xf440,0x1ee));var _0x0f44=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf440[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require(_0x0f44('0x0'));var md5=require(_0x0f44('0x1'));var util=require(_0x0f44('0x2'));var intUtil=require(_0x0f44('0x3'));var moment=require(_0x0f44('0x4'));var Redis=require(_0x0f44('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0x0f44('0x6'))(_0x0f44('0x7'));config['redis']=_[_0x0f44('0x8')](config[_0x0f44('0x9')],{'host':_0x0f44('0xa'),'port':0x18eb});var io=require(_0x0f44('0xb'))(new Redis(config['redis']));function emit(_0x527f28,_0xfc8383,_0x336b80){io['to'](_0x527f28)[_0x0f44('0xc')](_0xfc8383,_0x336b80);}function request(_0x59fe15){logger[_0x0f44('0xd')](_0x0f44('0xe'),JSON[_0x0f44('0xf')](_0x59fe15));return rp(_0x59fe15);}function getCustomFields(_0x21f89f,_0x5f104f){var _0x300f1f={};if(_0x21f89f['length']>0x0){_['forEach'](_0x21f89f,function(_0xe28d11){if(_['includes']([_0x0f44('0x10'),_0x0f44('0x11')],_0xe28d11[_0x0f44('0x12')])&&_0xe28d11['idField']){_0x300f1f[_0xe28d11[_0x0f44('0x13')]]=_0xe28d11['content'][_0x0f44('0x14')]();}else if(_0xe28d11[_0x0f44('0x12')]===_0x0f44('0x15')&&_0xe28d11[_0x0f44('0x16')]&&_0xe28d11[_0x0f44('0x13')]&&_0x5f104f[_0xe28d11['variableName']]){_0x300f1f[_0xe28d11[_0x0f44('0x13')]]=_0x5f104f[_0xe28d11[_0x0f44('0x16')]][_0x0f44('0x14')]();}else if(_0xe28d11['type']==='customVariable'&&_0xe28d11[_0x0f44('0x17')]&&_0xe28d11[_0x0f44('0x17')][_0x0f44('0x18')]&&_0xe28d11[_0x0f44('0x13')]&&_0x5f104f[_0xe28d11[_0x0f44('0x17')][_0x0f44('0x18')][_0x0f44('0x19')]()]){_0x300f1f[_0xe28d11[_0x0f44('0x13')]]=_0x5f104f[_0xe28d11[_0x0f44('0x17')][_0x0f44('0x18')][_0x0f44('0x19')]()][_0x0f44('0x14')]();}});}return _0x300f1f;}function getName(_0x3a93e0){if(_0x3a93e0[_0x0f44('0x1a')]('\x20')>0x0){var _0x2a5b5a=_0x3a93e0[_0x0f44('0x1b')](/ (.+)/);if(_0x2a5b5a[0x1]){return _0x2a5b5a;}}return[_0x3a93e0,_0x3a93e0];}var accountsTokens={};function getAccessToken(_0x481f5f){return new Promise(function(_0x3a51ad,_0x4ed384){if(!_['isNil'](accountsTokens[_0x481f5f['id']])&&!_[_0x0f44('0x1c')](accountsTokens[_0x481f5f['id']][_0x0f44('0x1d')])){if(moment()[_0x0f44('0x1e')](accountsTokens[_0x481f5f['id']][_0x0f44('0x1f')])){_0x3a51ad(accountsTokens[_0x481f5f['id']][_0x0f44('0x1d')]);}}var _0x48f79b;switch(_0x481f5f[_0x0f44('0x20')]){case'US':_0x48f79b=_0x0f44('0x21');break;case'AU':_0x48f79b=_0x0f44('0x22');break;case'EU':_0x48f79b=_0x0f44('0x23');break;case'IN':_0x48f79b=_0x0f44('0x24');break;case'CN':_0x48f79b=_0x0f44('0x25');break;default:_0x48f79b=_0x0f44('0x23');break;}var _0xe60b0f={'method':'POST','uri':_0x48f79b+_0x0f44('0x26'),'qs':{'refresh_token':_0x481f5f[_0x0f44('0x27')],'client_id':_0x481f5f[_0x0f44('0x28')],'client_secret':_0x481f5f[_0x0f44('0x29')],'grant_type':_0x0f44('0x2a')},'json':!![]};return rp(_0xe60b0f)[_0x0f44('0x2b')](function(_0x23d146){accountsTokens[_0x481f5f['id']]={'access_token':_0x23d146['access_token'],'expires_in':moment()[_0x0f44('0x2c')](_0x23d146[_0x0f44('0x1f')],'seconds')};_0x3a51ad(_0x23d146[_0x0f44('0x1d')]);})[_0x0f44('0x2d')](function(_0xbdf34c){logger['error']('Failing\x20creating\x20the\x20access_token',_0xbdf34c[_0x0f44('0x2e')]);_0x4ed384(_0xbdf34c);});});}function getUser(_0x3600dc,_0x117dc8,_0x142943,_0x438696){logger['info'](_0x0f44('0x2f'));return request({'method':'GET','uri':util['format'](_0x0f44('0x30'),_0x117dc8),'qs':{'type':_0x0f44('0x31')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3600dc},'json':!![]})['then'](function(_0xe98bd2){if(_0xe98bd2[_0x0f44('0x32')]){var _0x145eb4=-0x1;if(_[_0x0f44('0x33')](_0xe98bd2['users'])){if(!_[_0x0f44('0x1c')](_0x438696)){_0x145eb4=_[_0x0f44('0x34')](_0xe98bd2[_0x0f44('0x32')],function(_0x5a3627){return _0x5a3627[_0x0f44('0x35')]===_0x438696;});}if(_0x145eb4>=0x0){logger[_0x0f44('0x36')](_0x0f44('0x37'));}else{logger['info'](_0x0f44('0x38'));_0x145eb4=_['findIndex'](_0xe98bd2['users'],function(_0x17a035){return _0x17a035[_0x0f44('0x39')][_0x0f44('0x18')]===_0x0f44('0x3a');});}return _0xe98bd2[_0x0f44('0x32')][_0x145eb4];}else{if(_0xe98bd2[_0x0f44('0x3b')][_0x0f44('0x39')]['name']==='Administrator'){logger[_0x0f44('0x36')]('Using\x20the\x20admin\x20account!');user=_0xe98bd2[_0x0f44('0x3b')];return user;}else{logger[_0x0f44('0x3c')](_0x0f44('0x3d'),JSON[_0x0f44('0xf')](_0xe98bd2));throw new Error(_0x0f44('0x3e')+JSON[_0x0f44('0xf')](_0xe98bd2));}}}else{logger[_0x0f44('0x3c')](_0x0f44('0x3d'),JSON['stringify'](_0xe98bd2));throw new Error(_0x0f44('0x3e')+JSON[_0x0f44('0xf')](_0xe98bd2));}})[_0x0f44('0x2d')](function(_0x2ad5bf){console['error'](_0x2ad5bf);});}function getZohoUser(_0x51d939,_0x537265){return new BPromise(function(_0x3d751d,_0x18146f){request(_0x51d939)[_0x0f44('0x2b')](function(_0x26c6bb){var _0x1dcee3=null;if(_0x26c6bb){_0x1dcee3=_0x26c6bb[_0x0f44('0x3f')][0x0];_0x1dcee3['enduserType']=_0x537265;}_0x3d751d(_0x1dcee3);})[_0x0f44('0x2d')](function(_0x121bc5){_0x18146f(_0x121bc5);});});}function createEndUser(_0x54191c,_0x116720,_0x5d8445,_0x2c4ba4,_0x435966,_0x538c79){var _0x5d8445=getName(_0x5d8445);return request({'method':_0x0f44('0x40'),'uri':_0x0f44('0x41')+_0x116720+'/crm/v2/'+_[_0x0f44('0x42')](_0x538c79['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5d8445[0x1],'First_Name':_0x5d8445[0x0],'Phone':_0x2c4ba4,'Owner':{'name':!_[_0x0f44('0x1c')](_0x435966[_0x0f44('0x43')]['name'])?_0x435966[_0x0f44('0x43')][_0x0f44('0x18')]:!_[_0x0f44('0x1c')](_0x435966[_0x0f44('0x44')])?_0x435966[_0x0f44('0x44')]+'\x20'+_0x435966['last_name']:_0x435966[_0x0f44('0x45')],'id':_0x435966['id']}}]},'headers':{'Authorization':_0x0f44('0x46')+_0x54191c},'json':!![]})[_0x0f44('0x2b')](function(_0x1f48f9){if(_0x1f48f9&&_0x1f48f9[_0x0f44('0x3f')][0x0][_0x0f44('0x47')]===_0x0f44('0x48')){var _0x222b9e=_0x1f48f9[_0x0f44('0x3f')][0x0]['details'];_0x222b9e[_0x0f44('0x49')]=_['startCase'](_0x538c79['moduleCreate'])+'s';return _0x222b9e;}logger[_0x0f44('0x3c')]('The\x20failing\x20result\x20is',JSON[_0x0f44('0xf')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x0f44('0x2d')](function(_0x56b2e1){console['log'](_0x0f44('0x4a'),_0x56b2e1);});}function getEndUser(_0x3e5cbc,_0x2777a7,_0x28a96b,_0x380458,_0x2ae51a,_0x533c42,_0x3cb6fb){var _0x5a4960={'method':_0x0f44('0x4b'),'uri':'','headers':{'Authorization':_0x0f44('0x46')+_0x3e5cbc},'json':!![]};switch(_0x3cb6fb['moduleSearch']){case'contact_lead':_0x5a4960['uri']='https://www.zohoapis.'+_0x2777a7+_0x0f44('0x4c')+_0x2ae51a+'))';return getZohoUser(_0x5a4960,_0x0f44('0x4d'))['then'](function(_0x9f2ea9){if(_0x9f2ea9)return _0x9f2ea9;_0x5a4960[_0x0f44('0x4e')]='https://www.zohoapis.'+_0x2777a7+_0x0f44('0x4f')+_0x2ae51a+'))';return getZohoUser(_0x5a4960,_0x0f44('0x50'))[_0x0f44('0x2b')](function(_0x29e8f0){if(_0x29e8f0)return _0x29e8f0;if(_0x3cb6fb[_0x0f44('0x51')]!=_0x0f44('0x52')){return createEndUser(_0x3e5cbc,_0x2777a7,_0x380458,_0x2ae51a,_0x533c42,_0x3cb6fb);}else{return{};}});});break;case _0x0f44('0x53'):_0x5a4960[_0x0f44('0x4e')]=_0x0f44('0x41')+_0x2777a7+_0x0f44('0x4c')+_0x2ae51a+'))';return getZohoUser(_0x5a4960,_0x0f44('0x4d'))[_0x0f44('0x2b')](function(_0x1eb5aa){if(_0x1eb5aa)return _0x1eb5aa;if(_0x3cb6fb[_0x0f44('0x51')]!=_0x0f44('0x52')){return createEndUser(_0x3e5cbc,_0x2777a7,_0x380458,_0x2ae51a,_0x533c42,_0x3cb6fb);}else{return{};}});break;case _0x0f44('0x54'):_0x5a4960[_0x0f44('0x4e')]=_0x0f44('0x41')+_0x2777a7+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2ae51a+'))';return getZohoUser(_0x5a4960,_0x0f44('0x50'))[_0x0f44('0x2b')](function(_0x103231){if(_0x103231)return _0x103231;if(_0x3cb6fb['moduleCreate']!=_0x0f44('0x52')){return createEndUser(_0x3e5cbc,_0x2777a7,_0x380458,_0x2ae51a,_0x533c42,_0x3cb6fb);}else{return{};}});break;}}function getCall(_0x20b70c,_0x420f09,_0x436b3b,_0x31036c,_0x2015ab,_0x34a047,_0xe45cf9,_0x4e8611){logger[_0x0f44('0x36')](_0x0f44('0x55'));var _0x4ad979={};_0x4ad979[_0x0f44('0x56')]={'name':!_[_0x0f44('0x1c')](_0x31036c['role'][_0x0f44('0x18')])&&!_[_0x0f44('0x1c')](_0x31036c[_0x0f44('0x39')]['name'])&&_0x31036c['profile'][_0x0f44('0x18')]===_0x0f44('0x57')?_0x31036c[_0x0f44('0x43')]['name']:!_[_0x0f44('0x1c')](_0x31036c[_0x0f44('0x44')])?_0x31036c['first_name']+'\x20'+_0x31036c[_0x0f44('0x45')]:_0x31036c['last_name'],'id':_0x31036c['id']};_0x4ad979[_0x0f44('0x58')]=intUtil['getString'](_0x34a047[_0x0f44('0x59')],_0xe45cf9,'\x20');_0x4ad979['Description']=intUtil['getString'](_0x34a047[_0x0f44('0x5a')],_0xe45cf9,'\x0a');if(_0x2015ab[_0x0f44('0x49')]===_0x0f44('0x4d')){_0x4ad979[_0x0f44('0x5b')]={'name':!_['isNil'](_0x2015ab[_0x0f44('0x5c')])?_0x2015ab[_0x0f44('0x5c')]:!_[_0x0f44('0x1c')](_0x2015ab[_0x0f44('0x5d')])?_0x2015ab[_0x0f44('0x5d')]+'\x20'+_0x2015ab[_0x0f44('0x5e')]:_0x2015ab[_0x0f44('0x5e')],'id':_0x2015ab['id']};}if(_0x2015ab['enduserType']===_0x0f44('0x50')){_0x4ad979[_0x0f44('0x5f')]={'name':!_[_0x0f44('0x1c')](_0x2015ab[_0x0f44('0x5c')])?_0x2015ab[_0x0f44('0x5c')]:!_[_0x0f44('0x1c')](_0x2015ab[_0x0f44('0x5d')])?_0x2015ab[_0x0f44('0x5d')]+'\x20'+_0x2015ab[_0x0f44('0x5e')]:_0x2015ab[_0x0f44('0x5e')],'id':_0x2015ab['id']};_0x4ad979['$se_module']=_[_0x0f44('0x42')](_0x2015ab[_0x0f44('0x49')]);}if(_0xe45cf9[_0x0f44('0x60')]){_0x4ad979[_0x0f44('0x61')]=moment[_0x0f44('0x62')](parseInt(_0xe45cf9[_0x0f44('0x60')])*0x3e8)['format'](_0x0f44('0x63'));}else if(_0xe45cf9['answertime']&&_0xe45cf9[_0x0f44('0x64')]){_0x4ad979[_0x0f44('0x61')]=moment[_0x0f44('0x62')](moment(_0xe45cf9[_0x0f44('0x64')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0xe45cf9[_0x0f44('0x65')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x0f44('0x63'));}switch(_0xe45cf9[_0x0f44('0x66')]){case _0x0f44('0x67'):_0x4ad979[_0x0f44('0x68')]=_0x0f44('0x69');break;case'complete':case _0x0f44('0x6a'):_0x4ad979[_0x0f44('0x68')]=_0x0f44('0x6b');break;case _0x0f44('0x6c'):_0x4ad979[_0x0f44('0x68')]='Rejected';break;case _0x0f44('0x6d'):_0x4ad979[_0x0f44('0x68')]='Abandoned';break;case _0x0f44('0x6e'):_0x4ad979['Call_Result']='Timeout';default:}_0x4ad979['Call_Start_Time']=(_0x4e8611===_0x0f44('0x6f')?moment(_0xe45cf9['starttime'])[_0x0f44('0x70')](_0x0f44('0x71')):moment(_0xe45cf9[_0x0f44('0x72')])[_0x0f44('0x70')](_0x0f44('0x71')))||moment()[_0x0f44('0x70')](_0x0f44('0x71'));_0x4ad979[_0x0f44('0x73')]=_0x4e8611||_0x0f44('0x74');_0x4ad979=_[_0x0f44('0x75')](_0x4ad979,getCustomFields(_0x34a047[_0x0f44('0x76')],_0xe45cf9));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x420f09+'/crm/v2/Calls','headers':{'Authorization':_0x0f44('0x46')+_0x20b70c},'body':{'data':[_0x4ad979]},'json':!![]})[_0x0f44('0x2b')](function(_0x23f136){if(_0x23f136&&_0x23f136['data'][0x0][_0x0f44('0x47')]==='SUCCESS'){logger[_0x0f44('0x36')](_0x0f44('0x77'));return{'id':_0x23f136[_0x0f44('0x3f')][0x0]['details']['id']};}})[_0x0f44('0x2d')](function(_0xf85b0d){logger[_0x0f44('0x36')](_0x0f44('0x78'),_0xf85b0d[_0x0f44('0x2e')]);console[_0x0f44('0x79')]('err',_0xf85b0d);});}exports[_0x0f44('0x7a')]=function(_0x2cf64b,_0x42e000,_0x1d7da9,_0x5a3b56,_0xf8d6bb,_0x51a5b6){var _0x3153af,_0x563594,_0x43c3cb;_0x51a5b6['host']=intUtil[_0x0f44('0x7b')](_0x51a5b6['host']);_0x51a5b6['serverUrl']=intUtil[_0x0f44('0x7b')](_0x51a5b6[_0x0f44('0x7c')]);if(_0xf8d6bb&&_0xf8d6bb[_0x0f44('0x7d')]){logger[_0x0f44('0x36')]('[QUEUE]',_0x0f44('0x7e'));_0x42e000['recordingURL']=_0x51a5b6[_0x0f44('0x7c')]+'/api/voice/recordings/'+_0x42e000[_0x0f44('0x7f')]+_0x0f44('0x80')+md5(_0x42e000['uniqueid']);}else{_0x42e000[_0x0f44('0x81')]='';}var _0x1cc18c=_0x51a5b6[_0x0f44('0x82')]===_0x0f44('0x83')?'eu':_0x0f44('0x84');return getAccessToken(_0x51a5b6)['then'](function(_0x4e93b3){_0x43c3cb=_0x4e93b3;return getUser(_0x43c3cb,_0x1cc18c,_0x51a5b6,_0x5a3b56[_0x0f44('0x35')]);})[_0x0f44('0x2b')](function(_0x4ecdf9){_0x3153af=_0x4ecdf9;logger[_0x0f44('0x36')]('The\x20User\x20ID\x20is:',_0x3153af['id']);return getEndUser(_0x43c3cb,_0x1cc18c,_0x51a5b6,_0x42e000[_0x0f44('0x85')],_0x42e000[_0x0f44('0x86')],_0x3153af,_0x1d7da9);})[_0x0f44('0x2b')](function(_0x40b65a){_0x563594=_0x40b65a;return getCall(_0x43c3cb,_0x1cc18c,_0x51a5b6,_0x3153af,_0x563594,_0x1d7da9,_0x42e000,_0x0f44('0x74'));})[_0x0f44('0x2b')](function(_0x515b68){if(_0x515b68){logger[_0x0f44('0x36')](_0x0f44('0x87'),_0x515b68['id']);logger[_0x0f44('0x36')](_0x0f44('0x88'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0f44('0x70')](_0x0f44('0x89'),_0x5a3b56[_0x0f44('0x18')]),_0x0f44('0x8a'),{'uri':_0x0f44('0x8b')+_0x51a5b6[_0x0f44('0x82')]+_0x0f44('0x8c')+_0x515b68['id']});}})[_0x0f44('0x2d')](function(_0x50fe60){logger[_0x0f44('0x3c')](_0x0f44('0x88'),JSON[_0x0f44('0xf')](_0x50fe60));});};exports[_0x0f44('0x6f')]=function(_0x53215d,_0x5e28a6,_0x408549,_0xb8853a,_0x222d86,_0x5c30a4,_0x47d789){var _0x26671d,_0x5ebbc9,_0x3d114e;_0x5c30a4[_0x0f44('0x82')]=intUtil[_0x0f44('0x7b')](_0x5c30a4['host']);_0x5c30a4[_0x0f44('0x7c')]=intUtil[_0x0f44('0x7b')](_0x5c30a4[_0x0f44('0x7c')]);if(_0x47d789&&_0x47d789[_0x0f44('0x8d')]&&_0x47d789['recordingFormat']!=='none'){logger[_0x0f44('0x36')](_0x0f44('0x8e'),'Recording\x20is\x20enabled!');_0x5e28a6[_0x0f44('0x81')]=_0x5c30a4[_0x0f44('0x7c')]+'/api/voice/recordings/'+_0x5e28a6[_0x0f44('0x7f')]+_0x0f44('0x80')+md5(_0x5e28a6[_0x0f44('0x7f')]);}var _0x5c91d1=_0x5c30a4[_0x0f44('0x82')]===_0x0f44('0x83')?'eu':_0x0f44('0x84');return getAccessToken(_0x5c30a4)[_0x0f44('0x2b')](function(_0x150de7){_0x3d114e=_0x150de7;return getUser(_0x3d114e,_0x5c91d1,_0x5c30a4,_0xb8853a['email']);})['then'](function(_0x1dff57){_0x26671d=_0x1dff57;logger[_0x0f44('0x36')](_0x0f44('0x8f'),_0x26671d['id']);return getEndUser(_0x3d114e,_0x5c91d1,_0x5c30a4,_0x5e28a6[_0x0f44('0x90')],_0x5e28a6[_0x0f44('0x91')],_0x26671d,_0x408549);})[_0x0f44('0x2b')](function(_0x1dd26a){_0x5ebbc9=_0x1dd26a;return getCall(_0x3d114e,_0x5c91d1,_0x5c30a4,_0x26671d,_0x5ebbc9,_0x408549,_0x5e28a6,_0x0f44('0x92'));})['then'](function(_0x47c27a){if(_0x47c27a){logger[_0x0f44('0x36')]('The\x20Call\x20ID\x20is:',_0x47c27a['id']);logger[_0x0f44('0x36')](_0x0f44('0x8e'),_0x0f44('0x93'));emit(util[_0x0f44('0x70')]('user:%s',_0xb8853a[_0x0f44('0x18')]),_0x0f44('0x8a'),{'uri':_0x0f44('0x8b')+_0x5c30a4[_0x0f44('0x82')]+_0x0f44('0x8c')+_0x47c27a['id']});}})[_0x0f44('0x2d')](function(_0x2cfe4b){logger['error'](_0x0f44('0x8e'),JSON[_0x0f44('0xf')](_0x2cfe4b));});};exports[_0x0f44('0x94')]=function(_0x1944ab,_0xeebfac,_0x283963,_0x574b89,_0x1cede7,_0x17af1e){var _0x23b576,_0x537385,_0x5bb268;_0x17af1e[_0x0f44('0x82')]=intUtil[_0x0f44('0x7b')](_0x17af1e[_0x0f44('0x82')]);_0x17af1e[_0x0f44('0x7c')]=intUtil[_0x0f44('0x7b')](_0x17af1e['serverUrl']);if(_0x1cede7&&_0x1cede7[_0x0f44('0x7d')]){logger[_0x0f44('0x36')]('['+_0xeebfac[_0x0f44('0x66')][_0x0f44('0x95')]()+']',_0x0f44('0x7e'));_0xeebfac[_0x0f44('0x81')]=_0x17af1e['serverUrl']+_0x0f44('0x96')+_0xeebfac['uniqueid']+_0x0f44('0x80')+md5(_0xeebfac[_0x0f44('0x7f')]);}else{_0xeebfac[_0x0f44('0x81')]='';}var _0x35725d=_0x17af1e[_0x0f44('0x82')]===_0x0f44('0x83')?'eu':_0x0f44('0x84');return getAccessToken(_0x17af1e)[_0x0f44('0x2b')](function(_0xf3bc72){_0x5bb268=_0xf3bc72;return getUser(_0x5bb268,_0x35725d,_0x17af1e);})[_0x0f44('0x2b')](function(_0x367329){_0x23b576=_0x367329;logger[_0x0f44('0x36')](_0x0f44('0x8f'),_0x23b576['id']);return getEndUser(_0x5bb268,_0x35725d,_0x17af1e,_0xeebfac[_0x0f44('0x85')],_0xeebfac[_0x0f44('0x86')],_0x23b576,_0x283963);})[_0x0f44('0x2b')](function(_0x1aa65f){_0x537385=_0x1aa65f;return getCall(_0x5bb268,_0x35725d,_0x17af1e,_0x23b576,_0x537385,_0x283963,_0xeebfac,_0x0f44('0x74'));})[_0x0f44('0x2b')](function(_0xd9c198){if(_0xd9c198){logger[_0x0f44('0x36')](_0x0f44('0x87'),_0xd9c198['id']);}})[_0x0f44('0x2d')](function(_0x540173){logger['error']('['+_0xeebfac[_0x0f44('0x66')][_0x0f44('0x95')]()+']',JSON[_0x0f44('0xf')](_0x540173));});}; \ 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 4ff2820..4e256b2 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 _0xe249=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','mustache','../../../../config/logger','trigger','exec','data2','Script','render','data3'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xe249,0x10c));var _0x9e24=function(_0x2f0fc8,_0x16df68){_0x2f0fc8=_0x2f0fc8-0x0;var _0x2d7b77=_0xe249[_0x2f0fc8];return _0x2d7b77;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0x9e24('0x0'));var logger=require(_0x9e24('0x1'))(_0x9e24('0x2'));exports[_0x9e24('0x3')]=function(_0xf04f6e,_0x59550f){var _0x447bd5=_0xf04f6e[_0x9e24('0x4')]?_0xf04f6e[_0x9e24('0x4')]:_0x9e24('0x5');var _0x30f6a7=_0xf04f6e['data3']?Mustache[_0x9e24('0x6')](_0xf04f6e[_0x9e24('0x7')],_0x59550f):_0x59550f;sh[_0x9e24('0x3')](_0x30f6a7,function(_0x548aab,_0x3faa98,_0x21f367){if(_0x548aab!==0x0){logger['error'](util['format'](_0x9e24('0x8'),_0x447bd5,_0x30f6a7,_0x548aab,_0x21f367));}else{logger[_0x9e24('0x9')](util[_0x9e24('0xa')](_0x9e24('0xb'),_0x447bd5,_0x30f6a7,_0x3faa98));}});}; \ No newline at end of file +var _0x6839=['shelljs','mustache','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x1e5245,_0x8f83a9){var _0x1c2dfd=function(_0xa771d8){while(--_0xa771d8){_0x1e5245['push'](_0x1e5245['shift']());}};_0x1c2dfd(++_0x8f83a9);}(_0x6839,0x1ef));var _0x9683=function(_0xc0754,_0x37f107){_0xc0754=_0xc0754-0x0;var _0x195498=_0x6839[_0xc0754];return _0x195498;};'use strict';var util=require('util');var sh=require(_0x9683('0x0'));var Mustache=require(_0x9683('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x9683('0x2')]=function(_0x476eaf,_0x455472){var _0x18aa29=_0x476eaf[_0x9683('0x3')]?_0x476eaf[_0x9683('0x3')]:_0x9683('0x4');var _0x480912=_0x476eaf[_0x9683('0x5')]?Mustache[_0x9683('0x6')](_0x476eaf['data3'],_0x455472):_0x455472;sh[_0x9683('0x2')](_0x480912,function(_0x2b53bc,_0x71a70f,_0x281adf){if(_0x2b53bc!==0x0){logger[_0x9683('0x7')](util[_0x9683('0x8')](_0x9683('0x9'),_0x18aa29,_0x480912,_0x2b53bc,_0x281adf));}else{logger[_0x9683('0xa')](util[_0x9683('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x18aa29,_0x480912,_0x71a70f));}});}; \ 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 5f29ab4..22ad459 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 _0x727a=['name','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','number','data5','headers','parse','render','data6','error','GET','DELETE','PUT','data7','body','stack','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode'];(function(_0x2e2992,_0x44c1a9){var _0x53cdf4=function(_0x3099b8){while(--_0x3099b8){_0x2e2992['push'](_0x2e2992['shift']());}};_0x53cdf4(++_0x44c1a9);}(_0x727a,0x175));var _0xa727=function(_0x5d1096,_0x571609){_0x5d1096=_0x5d1096-0x0;var _0x244684=_0x727a[_0x5d1096];return _0x244684;};'use strict';var rp=require(_0xa727('0x0'));var util=require('util');var _=require(_0xa727('0x1'));var Mustache=require(_0xa727('0x2'));var logger=require(_0xa727('0x3'))(_0xa727('0x4'));exports[_0xa727('0x5')]=function(_0x572121,_0x3b53d9){var _0x5742b3,_0x2ad5c6;var _0x1dbf5c={'method':_0x572121[_0xa727('0x6')][_0xa727('0x7')](),'uri':Mustache['render'](_0x572121['data2'],_0x3b53d9),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x572121['data5'])===_0xa727('0x8')&&parseInt(_0x572121[_0xa727('0x9')])>=0x1&&parseInt(_0x572121[_0xa727('0x9')])<=0xa?parseInt(_0x572121[_0xa727('0x9')])*0x3e8:0x5*0x3e8};try{_0x1dbf5c[_0xa727('0xa')]=_0x572121['data6']?JSON[_0xa727('0xb')](Mustache[_0xa727('0xc')](_0x572121[_0xa727('0xd')],_0x3b53d9)):{};}catch(_0xe8e7a8){logger[_0xa727('0xe')](_0xe8e7a8['stack']);}switch(_0x572121[_0xa727('0x6')][_0xa727('0x7')]()){case _0xa727('0xf'):case _0xa727('0x10'):_0x5742b3=null;_0x1dbf5c['qs']=_0x3b53d9;break;case'POST':case _0xa727('0x11'):if(_0x572121[_0xa727('0x12')]){try{_0x5742b3=JSON[_0xa727('0xb')](Mustache[_0xa727('0xc')](_0x572121[_0xa727('0x12')],_0x3b53d9));_0x1dbf5c[_0xa727('0x13')]=_0x5742b3;}catch(_0x5a9b9d){logger['error'](_0x5a9b9d[_0xa727('0x14')]);logger[_0xa727('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5742b3=_0x3b53d9;_0x1dbf5c[_0xa727('0x13')]=_0x5742b3;}break;}logger['info'](util[_0xa727('0x15')](_0xa727('0x16'),_0x572121[_0xa727('0x6')],_0x572121[_0xa727('0x17')],JSON[_0xa727('0x18')](_0x1dbf5c)));rp(_0x1dbf5c)['then'](function(_0x1a0f27){_0x5742b3=!_['isNil'](_0x5742b3)?_0xa727('0x19')+_0x5742b3:'';_0x2ad5c6=typeof _0x1a0f27[_0xa727('0x13')]===_0xa727('0x1a')?JSON[_0xa727('0x18')](_0x1a0f27['body']):_0x1a0f27['body'];logger[_0xa727('0x1b')](util['format'](_0xa727('0x1c'),_0x572121[_0xa727('0x6')],_0x572121[_0xa727('0x17')],_0x1a0f27[_0xa727('0x1d')],_0x2ad5c6));})['catch'](function(_0x120a2d){logger['error'](util[_0xa727('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x572121['data1'],_0x572121['data2'],_0x120a2d[_0xa727('0x1d')],_0x120a2d[_0xa727('0x1e')],_0x120a2d['message']));});}; \ No newline at end of file +var _0xe7ad=['POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','request-promise','util','lodash','mustache','trigger','render','data2','data5','headers','data6','parse','error','stack','data1','toUpperCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe7ad,0x11d));var _0xde7a=function(_0x392415,_0xf6ced0){_0x392415=_0x392415-0x0;var _0x115169=_0xe7ad[_0x392415];return _0x115169;};'use strict';var rp=require(_0xde7a('0x0'));var util=require(_0xde7a('0x1'));var _=require(_0xde7a('0x2'));var Mustache=require(_0xde7a('0x3'));var logger=require('../../../../config/logger')(_0xde7a('0x4'));exports['exec']=function(_0x39a434,_0x22a81b){var _0x55f2d9,_0x16328b;var _0x59cd24={'method':_0x39a434['data1']['toUpperCase'](),'uri':Mustache[_0xde7a('0x5')](_0x39a434[_0xde7a('0x6')],_0x22a81b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x39a434['data5'])==='number'&&parseInt(_0x39a434['data5'])>=0x1&&parseInt(_0x39a434[_0xde7a('0x7')])<=0xa?parseInt(_0x39a434[_0xde7a('0x7')])*0x3e8:0x5*0x3e8};try{_0x59cd24[_0xde7a('0x8')]=_0x39a434[_0xde7a('0x9')]?JSON[_0xde7a('0xa')](Mustache[_0xde7a('0x5')](_0x39a434[_0xde7a('0x9')],_0x22a81b)):{};}catch(_0x4c0425){logger[_0xde7a('0xb')](_0x4c0425[_0xde7a('0xc')]);}switch(_0x39a434[_0xde7a('0xd')][_0xde7a('0xe')]()){case'GET':case'DELETE':_0x55f2d9=null;_0x59cd24['qs']=_0x22a81b;break;case _0xde7a('0xf'):case _0xde7a('0x10'):if(_0x39a434[_0xde7a('0x11')]){try{_0x55f2d9=JSON[_0xde7a('0xa')](Mustache[_0xde7a('0x5')](_0x39a434['data7'],_0x22a81b));_0x59cd24[_0xde7a('0x12')]=_0x55f2d9;}catch(_0x5d8209){logger[_0xde7a('0xb')](_0x5d8209['stack']);logger[_0xde7a('0xb')](_0xde7a('0x13'));}}else{_0x55f2d9=_0x22a81b;_0x59cd24[_0xde7a('0x12')]=_0x55f2d9;}break;}logger[_0xde7a('0x14')](util[_0xde7a('0x15')](_0xde7a('0x16'),_0x39a434[_0xde7a('0xd')],_0x39a434[_0xde7a('0x6')],JSON[_0xde7a('0x17')](_0x59cd24)));rp(_0x59cd24)[_0xde7a('0x18')](function(_0x5ed38a){_0x55f2d9=!_['isNil'](_0x55f2d9)?_0xde7a('0x19')+_0x55f2d9:'';_0x16328b=typeof _0x5ed38a[_0xde7a('0x12')]==='object'?JSON[_0xde7a('0x17')](_0x5ed38a['body']):_0x5ed38a[_0xde7a('0x12')];logger[_0xde7a('0x14')](util[_0xde7a('0x15')](_0xde7a('0x1a'),_0x39a434[_0xde7a('0xd')],_0x39a434[_0xde7a('0x6')],_0x5ed38a[_0xde7a('0x1b')],_0x16328b));})[_0xde7a('0x1c')](function(_0x547c9d){logger['error'](util[_0xde7a('0x15')](_0xde7a('0x1d'),_0x39a434[_0xde7a('0xd')],_0x39a434['data2'],_0x547c9d['statusCode'],_0x547c9d['name'],_0x547c9d['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index b0eca39..a6eee7c 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 _0x9ae2=['error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc'];(function(_0x4a64e7,_0x13f55d){var _0x2340c7=function(_0x2c43aa){while(--_0x2c43aa){_0x4a64e7['push'](_0x4a64e7['shift']());}};_0x2340c7(++_0x13f55d);}(_0x9ae2,0x18c));var _0x29ae=function(_0x1bce27,_0x468041){_0x1bce27=_0x1bce27-0x0;var _0x18747d=_0x9ae2[_0x1bce27];return _0x18747d;};'use strict';var jayson=require(_0x29ae('0x0'));var BPromise=require(_0x29ae('0x1'));var logger=require(_0x29ae('0x2'))(_0x29ae('0x3'));var client=jayson['client'][_0x29ae('0x4')]({'port':0x2329});client[_0x29ae('0x5')]=function(_0x3292fb,_0x216a8e){return new BPromise(function(_0x5eb17f,_0x4a352f){return client[_0x29ae('0x6')](_0x3292fb,_0x216a8e)[_0x29ae('0x7')](function(_0x210320){logger[_0x29ae('0x8')](_0x29ae('0x9'),_0x29ae('0x3'),_0x3292fb,_0x216a8e,_0x210320);if(_0x210320[_0x29ae('0xa')]){logger['error']('rpc',_0x29ae('0x3'),_0x3292fb,_0x210320[_0x29ae('0xa')][_0x29ae('0xb')],_0x216a8e);return _0x4a352f(_0x210320[_0x29ae('0xa')][_0x29ae('0xb')]);}else{return _0x5eb17f(_0x210320[_0x29ae('0xc')]);}})[_0x29ae('0xd')](function(_0x18b849){logger['error'](_0x29ae('0x9'),_0x29ae('0x3'),_0x3292fb,_0x18b849,_0x216a8e);return _0x4a352f(_0x18b849);});});};module['exports']=client; \ No newline at end of file +var _0x2875=['../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2875,0x1de));var _0x5287=function(_0x3e6a06,_0x5ddcd6){_0x3e6a06=_0x3e6a06-0x0;var _0xcdc571=_0x2875[_0x3e6a06];return _0xcdc571;};'use strict';var jayson=require(_0x5287('0x0'));var BPromise=require(_0x5287('0x1'));var logger=require(_0x5287('0x2'))(_0x5287('0x3'));var client=jayson[_0x5287('0x4')][_0x5287('0x5')]({'port':0x2329});client[_0x5287('0x6')]=function(_0x45356f,_0x281967){return new BPromise(function(_0x17db25,_0x2f900e){return client[_0x5287('0x7')](_0x45356f,_0x281967)[_0x5287('0x8')](function(_0x5d7804){logger[_0x5287('0x9')](_0x5287('0xa'),_0x5287('0x3'),_0x45356f,_0x281967,_0x5d7804);if(_0x5d7804[_0x5287('0xb')]){logger[_0x5287('0xb')](_0x5287('0xa'),'routing',_0x45356f,_0x5d7804[_0x5287('0xb')][_0x5287('0xc')],_0x281967);return _0x2f900e(_0x5d7804[_0x5287('0xb')][_0x5287('0xc')]);}else{return _0x17db25(_0x5d7804[_0x5287('0xd')]);}})[_0x5287('0xe')](function(_0x16a9fb){logger[_0x5287('0xb')](_0x5287('0xa'),_0x5287('0x3'),_0x45356f,_0x16a9fb,_0x281967);return _0x2f900e(_0x16a9fb);});});};module[_0x5287('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index c40372b..562c3b8 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 _0xebb5=['resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger'];(function(_0x3cc2de,_0x1d4708){var _0x59baa9=function(_0x126197){while(--_0x126197){_0x3cc2de['push'](_0x3cc2de['shift']());}};_0x59baa9(++_0x1d4708);}(_0xebb5,0x109));var _0x5ebb=function(_0x2a5451,_0x43dda8){_0x2a5451=_0x2a5451-0x0;var _0x18ea60=_0xebb5[_0x2a5451];return _0x18ea60;};'use strict';var server=require(_0x5ebb('0x0'));var Realtime=require(_0x5ebb('0x1'));var EmailChannel=require(_0x5ebb('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x5ebb('0x3'));var logger=require(_0x5ebb('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x5ebb('0x5')]()['then'](mailAccount[_0x5ebb('0x6')]())[_0x5ebb('0x7')](realtime[_0x5ebb('0x8')]())[_0x5ebb('0x7')](function(){email[_0x5ebb('0x9')](realtime[_0x5ebb('0xa')]);return realtime;});}function main(){return server[_0x5ebb('0xb')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x5ebb('0xc')]();})[_0x5ebb('0x7')](function(_0x11c276){return setInterval(initRealtime,_0x11c276[_0x5ebb('0xd')]*0x3e8);})['catch'](function(_0x42316e){logger['error'](_0x5ebb('0xe'),_0x42316e);});}main(); \ No newline at end of file +var _0xd4b2=['then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve'];(function(_0x1b6ad6,_0x26dce7){var _0x5c9c91=function(_0x6e0b22){while(--_0x6e0b22){_0x1b6ad6['push'](_0x1b6ad6['shift']());}};_0x5c9c91(++_0x26dce7);}(_0xd4b2,0xb3));var _0x2d4b=function(_0x317cc5,_0x3b6179){_0x317cc5=_0x317cc5-0x0;var _0x44fe81=_0xd4b2[_0x317cc5];return _0x44fe81;};'use strict';var server=require(_0x2d4b('0x0'));var Realtime=require(_0x2d4b('0x1'));var EmailChannel=require(_0x2d4b('0x2'));var mailAccount=require(_0x2d4b('0x3'));var setting=require(_0x2d4b('0x4'));var logger=require(_0x2d4b('0x5'))(_0x2d4b('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x2d4b('0x7')]()[_0x2d4b('0x8')](mailAccount[_0x2d4b('0x9')]())[_0x2d4b('0x8')](realtime['initMailAccounts']())[_0x2d4b('0x8')](function(){email[_0x2d4b('0xa')](realtime[_0x2d4b('0xb')]);return realtime;});}function main(){return server[_0x2d4b('0xc')](realtime,email)[_0x2d4b('0x8')](function(){return initRealtime();})[_0x2d4b('0x8')](function(){return setting[_0x2d4b('0xd')]();})[_0x2d4b('0x8')](function(_0x29eafd){return setInterval(initRealtime,_0x29eafd[_0x2d4b('0xe')]*0x3e8);})[_0x2d4b('0xf')](function(_0x367ca0){logger['error'](_0x2d4b('0x10'),_0x367ca0);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 252f144..556d511 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 _0x4e8d=['name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','handleImapEnd','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','hasOwnProperty','service','provider','custom','email','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','connected'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4e8d,0x8a));var _0xd4e8=function(_0x3605e3,_0x3cd19c){_0x3605e3=_0x3605e3-0x0;var _0x549796=_0x4e8d[_0x3605e3];return _0x549796;};'use strict';var _=require(_0xd4e8('0x0'));var moment=require(_0xd4e8('0x1'));var BPromise=require(_0xd4e8('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xd4e8('0x3'));var logger=require(_0xd4e8('0x4'))('email');config['redis']=_[_0xd4e8('0x5')](config[_0xd4e8('0x6')],{'host':_0xd4e8('0x7'),'port':0x18eb});var io=require(_0xd4e8('0x8'))(new Redis(config[_0xd4e8('0x6')]));var EmailImap=require(_0xd4e8('0x9'));var EmailSmtp=require(_0xd4e8('0xa'));var mailAccount=require(_0xd4e8('0xb'));var md5Accounts={};function EmailChannel(_0x5b155c){logger[_0xd4e8('0xc')]('start\x20email\x20channel');this[_0xd4e8('0xd')]=_0x5b155c[_0xd4e8('0xd')];this[_0xd4e8('0xe')]={};this[_0xd4e8('0xf')]=new EmailSmtp();}EmailChannel[_0xd4e8('0x10')][_0xd4e8('0x11')]=function(_0x53c099){var _0xa21d58=this[_0xd4e8('0xd')][_0x53c099];var _0x32b49a={'id':_0xa21d58['id'],'name':_0xa21d58['name'],'key':_0xa21d58[_0xd4e8('0x12')],'active':_0xa21d58[_0xd4e8('0x13')],'Imap':{'status':_0xa21d58[_0xd4e8('0x14')][_0xd4e8('0x15')],'messageStatus':_0xa21d58[_0xd4e8('0x14')][_0xd4e8('0x16')],'total':_0xa21d58[_0xd4e8('0x14')][_0xd4e8('0x17')]}};if(_[_0xd4e8('0x18')](md5Accounts[_0x53c099])){md5Accounts[_0x53c099]={};}var _0x3d5e29=md5(JSON[_0xd4e8('0x19')](_0x32b49a));if(md5Accounts[_0x53c099]['md5']!==_0x3d5e29){md5Accounts[_0x53c099][_0xd4e8('0x1a')]=_0x3d5e29;io[_0xd4e8('0x11')](_0xd4e8('0x1b'),_0x32b49a);}};EmailChannel[_0xd4e8('0x10')]['refresh']=function(_0x3397fb){for(var _0x537224 in _0x3397fb){if(_0x3397fb[_0xd4e8('0x1c')](_0x537224)){if(_0x3397fb[_0x537224][_0xd4e8('0x14')]&&_0x3397fb[_0x537224]['active']){var _0x1fcdf2=_0x3397fb[_0x537224][_0xd4e8('0x14')];if(!_0x1fcdf2[_0xd4e8('0x1d')]&&_0x3397fb[_0x537224][_0xd4e8('0x1e')]!==_0xd4e8('0x1f'))_0x1fcdf2['service']=_0x3397fb[_0x537224][_0xd4e8('0x1e')];if(!this['imapAccounts']['hasOwnProperty'](_0x1fcdf2['id'])){this[_0xd4e8('0xe')][_0x1fcdf2['id']]=new EmailImap(_0x1fcdf2,_0x3397fb[_0x537224][_0xd4e8('0x20')]);this[_0xd4e8('0xe')][_0x1fcdf2['id']]['on'](_0xd4e8('0x21'),this[_0xd4e8('0x22')][_0xd4e8('0x23')](this,_0x537224));this[_0xd4e8('0xe')][_0x1fcdf2['id']]['on'](_0xd4e8('0x20'),this[_0xd4e8('0x24')][_0xd4e8('0x23')](this,_0x537224));this[_0xd4e8('0xe')][_0x1fcdf2['id']]['on'](_0xd4e8('0x25'),this['handleImapEnd']['bind'](this,_0x537224));this[_0xd4e8('0xe')][_0x1fcdf2['id']]['on'](_0xd4e8('0x26'),this[_0xd4e8('0x27')][_0xd4e8('0x23')](this,_0x537224));}}else{if(_[_0xd4e8('0x18')](this[_0xd4e8('0xd')][_0x537224][_0xd4e8('0x14')])){this['mailAccounts'][_0x537224][_0xd4e8('0x14')]={};}this[_0xd4e8('0xd')][_0x537224]['Imap'][_0xd4e8('0x15')]=_0xd4e8('0x28');this[_0xd4e8('0xd')][_0x537224]['Imap']['messageStatus']='';this[_0xd4e8('0x11')](_0x537224);}}}};EmailChannel[_0xd4e8('0x10')]['handleImapBox']=function(_0x170393,_0x257cbd){if(this[_0xd4e8('0xd')][_0x170393]){this[_0xd4e8('0xd')][_0x170393][_0xd4e8('0x14')][_0xd4e8('0x15')]=_0xd4e8('0x29');this[_0xd4e8('0xd')][_0x170393][_0xd4e8('0x14')][_0xd4e8('0x16')]=_0x257cbd[_0xd4e8('0x2a')];if(_0x257cbd['messages']){this[_0xd4e8('0xd')][_0x170393][_0xd4e8('0x14')]['total']=_0x257cbd[_0xd4e8('0x2b')][_0xd4e8('0x17')];}return this[_0xd4e8('0x11')](_0x170393);}};EmailChannel[_0xd4e8('0x10')][_0xd4e8('0x24')]=function(_0xcb0306,_0x56b18f){logger[_0xd4e8('0xc')](_0xd4e8('0x2c'),_0x56b18f[_0xd4e8('0x2d')],_0x56b18f[_0xd4e8('0x2e')],_0x56b18f['from'],_0xcb0306);if(this[_0xd4e8('0xd')][_0xcb0306]){return mailAccount[_0xd4e8('0x2f')](_0xcb0306,_0x56b18f)[_0xd4e8('0x30')](function(_0x512bc9){if(_0x512bc9){logger[_0xd4e8('0xc')](_0xd4e8('0x31'));}})[_0xd4e8('0x32')](function(_0x2b5e87){logger[_0xd4e8('0x26')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xd4e8('0x19')](_0x2b5e87));});}};EmailChannel[_0xd4e8('0x10')][_0xd4e8('0x33')]=function(_0x47fb64){if(this[_0xd4e8('0xd')][_0x47fb64]&&this[_0xd4e8('0xd')][_0x47fb64]['Imap']){if(this[_0xd4e8('0xe')][this[_0xd4e8('0xd')][_0x47fb64]['Imap']['id']]){delete this[_0xd4e8('0xe')][this[_0xd4e8('0xd')][_0x47fb64][_0xd4e8('0x14')]['id']];}this[_0xd4e8('0xd')][_0x47fb64][_0xd4e8('0x14')]['lastSync']=moment();this[_0xd4e8('0x11')](_0x47fb64);}};EmailChannel[_0xd4e8('0x10')]['handleImapError']=function(_0x549cee,_0x3939b8){if(this['mailAccounts'][_0x549cee]){this['mailAccounts'][_0x549cee][_0xd4e8('0x14')][_0xd4e8('0x15')]=_0xd4e8('0x26');this[_0xd4e8('0xd')][_0x549cee]['Imap']['messageStatus']=_0x3939b8;return this[_0xd4e8('0x11')](_0x549cee);}};EmailChannel['prototype'][_0xd4e8('0x34')]=function(_0x59afcb,_0x574a5f){return this[_0xd4e8('0xf')][_0xd4e8('0x35')](_0x59afcb,_0x574a5f);};EmailChannel[_0xd4e8('0x10')][_0xd4e8('0x36')]=function(_0x5ae2a7){var _0xc51b07=this;if(this[_0xd4e8('0xd')][_0x5ae2a7['id']]){if(_[_0xd4e8('0x18')](this[_0xd4e8('0xd')][_0x5ae2a7['id']][_0xd4e8('0x37')])){this[_0xd4e8('0xd')][_0x5ae2a7['id']][_0xd4e8('0x37')]={};}this[_0xd4e8('0xd')][_0x5ae2a7['id']][_0xd4e8('0x37')][_0xd4e8('0x38')]=moment();return new BPromise(function(_0x2054ed,_0x33d532){return _0xc51b07[_0xd4e8('0xf')][_0xd4e8('0x39')](_0x5ae2a7)['then'](function(_0x458798){_0xc51b07[_0xd4e8('0xd')][_0x5ae2a7['id']][_0xd4e8('0x37')][_0xd4e8('0x15')]=_0xd4e8('0x3a');_0xc51b07[_0xd4e8('0xd')][_0x5ae2a7['id']][_0xd4e8('0x37')][_0xd4e8('0x16')]='';_0xc51b07[_0xd4e8('0x11')](_0x5ae2a7['id']);_0x2054ed(_0x458798);})['catch'](function(_0x301c34){_0xc51b07['mailAccounts'][_0x5ae2a7['id']][_0xd4e8('0x37')][_0xd4e8('0x15')]=_0xd4e8('0x26');_0xc51b07[_0xd4e8('0xd')][_0x5ae2a7['id']][_0xd4e8('0x37')][_0xd4e8('0x16')]=_0x301c34;_0xc51b07[_0xd4e8('0x11')](_0x5ae2a7['id']);_0x33d532(_0x301c34);});});}return this[_0xd4e8('0xf')][_0xd4e8('0x39')](_0x5ae2a7);};module[_0xd4e8('0x3b')]=EmailChannel; \ No newline at end of file +var _0xc8ec=['send','isNil','Smtp','verify','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','provider','custom','service','bind','handleImapEmail','end','handleImapEnd','handleImapError','disabled','handleImapBox','status','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','lastSync','sendMail'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc8ec,0x127));var _0xcc8e=function(_0x4b5c38,_0x44e4ca){_0x4b5c38=_0x4b5c38-0x0;var _0x522619=_0xc8ec[_0x4b5c38];return _0x522619;};'use strict';var _=require(_0xcc8e('0x0'));var moment=require(_0xcc8e('0x1'));var BPromise=require(_0xcc8e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xcc8e('0x3'));var logger=require(_0xcc8e('0x4'))(_0xcc8e('0x5'));config[_0xcc8e('0x6')]=_[_0xcc8e('0x7')](config[_0xcc8e('0x6')],{'host':_0xcc8e('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcc8e('0x6')]));var EmailImap=require(_0xcc8e('0x9'));var EmailSmtp=require(_0xcc8e('0xa'));var mailAccount=require(_0xcc8e('0xb'));var md5Accounts={};function EmailChannel(_0x44cf39){logger['info'](_0xcc8e('0xc'));this[_0xcc8e('0xd')]=_0x44cf39[_0xcc8e('0xd')];this[_0xcc8e('0xe')]={};this[_0xcc8e('0xf')]=new EmailSmtp();}EmailChannel[_0xcc8e('0x10')][_0xcc8e('0x11')]=function(_0x2afc85){var _0x399579=this[_0xcc8e('0xd')][_0x2afc85];var _0x105033={'id':_0x399579['id'],'name':_0x399579[_0xcc8e('0x12')],'key':_0x399579[_0xcc8e('0x13')],'active':_0x399579[_0xcc8e('0x14')],'Imap':{'status':_0x399579[_0xcc8e('0x15')]['status'],'messageStatus':_0x399579[_0xcc8e('0x15')][_0xcc8e('0x16')],'total':_0x399579[_0xcc8e('0x15')][_0xcc8e('0x17')]}};if(_['isNil'](md5Accounts[_0x2afc85])){md5Accounts[_0x2afc85]={};}var _0x14d76c=md5(JSON[_0xcc8e('0x18')](_0x105033));if(md5Accounts[_0x2afc85]['md5']!==_0x14d76c){md5Accounts[_0x2afc85][_0xcc8e('0x19')]=_0x14d76c;io['emit'](_0xcc8e('0x1a'),_0x105033);}};EmailChannel[_0xcc8e('0x10')][_0xcc8e('0x1b')]=function(_0x17b980){for(var _0x52f27f in _0x17b980){if(_0x17b980[_0xcc8e('0x1c')](_0x52f27f)){if(_0x17b980[_0x52f27f][_0xcc8e('0x15')]&&_0x17b980[_0x52f27f][_0xcc8e('0x14')]){var _0x1488f3=_0x17b980[_0x52f27f]['Imap'];if(!_0x1488f3['service']&&_0x17b980[_0x52f27f][_0xcc8e('0x1d')]!==_0xcc8e('0x1e'))_0x1488f3[_0xcc8e('0x1f')]=_0x17b980[_0x52f27f][_0xcc8e('0x1d')];if(!this[_0xcc8e('0xe')]['hasOwnProperty'](_0x1488f3['id'])){this[_0xcc8e('0xe')][_0x1488f3['id']]=new EmailImap(_0x1488f3,_0x17b980[_0x52f27f]['email']);this[_0xcc8e('0xe')][_0x1488f3['id']]['on']('box',this['handleImapBox'][_0xcc8e('0x20')](this,_0x52f27f));this['imapAccounts'][_0x1488f3['id']]['on']('email',this[_0xcc8e('0x21')][_0xcc8e('0x20')](this,_0x52f27f));this[_0xcc8e('0xe')][_0x1488f3['id']]['on'](_0xcc8e('0x22'),this[_0xcc8e('0x23')]['bind'](this,_0x52f27f));this[_0xcc8e('0xe')][_0x1488f3['id']]['on']('error',this[_0xcc8e('0x24')]['bind'](this,_0x52f27f));}}else{if(_['isNil'](this[_0xcc8e('0xd')][_0x52f27f][_0xcc8e('0x15')])){this[_0xcc8e('0xd')][_0x52f27f][_0xcc8e('0x15')]={};}this[_0xcc8e('0xd')][_0x52f27f][_0xcc8e('0x15')]['status']=_0xcc8e('0x25');this[_0xcc8e('0xd')][_0x52f27f][_0xcc8e('0x15')]['messageStatus']='';this[_0xcc8e('0x11')](_0x52f27f);}}}};EmailChannel[_0xcc8e('0x10')][_0xcc8e('0x26')]=function(_0x23704c,_0x3905e8){if(this[_0xcc8e('0xd')][_0x23704c]){this[_0xcc8e('0xd')][_0x23704c]['Imap'][_0xcc8e('0x27')]=_0xcc8e('0x28');this[_0xcc8e('0xd')][_0x23704c]['Imap'][_0xcc8e('0x16')]=_0x3905e8[_0xcc8e('0x12')];if(_0x3905e8[_0xcc8e('0x29')]){this[_0xcc8e('0xd')][_0x23704c]['Imap'][_0xcc8e('0x17')]=_0x3905e8[_0xcc8e('0x29')][_0xcc8e('0x17')];}return this[_0xcc8e('0x11')](_0x23704c);}};EmailChannel[_0xcc8e('0x10')][_0xcc8e('0x21')]=function(_0x31c8d1,_0x520be6){logger[_0xcc8e('0x2a')](_0xcc8e('0x2b'),_0x520be6[_0xcc8e('0x2c')],_0x520be6[_0xcc8e('0x2d')],_0x520be6['from'],_0x31c8d1);if(this[_0xcc8e('0xd')][_0x31c8d1]){return mailAccount[_0xcc8e('0x2e')](_0x31c8d1,_0x520be6)[_0xcc8e('0x2f')](function(_0x227e43){if(_0x227e43){logger[_0xcc8e('0x2a')](_0xcc8e('0x30'));}})[_0xcc8e('0x31')](function(_0x3322fe){logger[_0xcc8e('0x32')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xcc8e('0x18')](_0x3322fe));});}};EmailChannel[_0xcc8e('0x10')]['handleImapEnd']=function(_0xa0926d){if(this[_0xcc8e('0xd')][_0xa0926d]&&this[_0xcc8e('0xd')][_0xa0926d][_0xcc8e('0x15')]){if(this[_0xcc8e('0xe')][this[_0xcc8e('0xd')][_0xa0926d][_0xcc8e('0x15')]['id']]){delete this[_0xcc8e('0xe')][this[_0xcc8e('0xd')][_0xa0926d][_0xcc8e('0x15')]['id']];}this['mailAccounts'][_0xa0926d][_0xcc8e('0x15')][_0xcc8e('0x33')]=moment();this[_0xcc8e('0x11')](_0xa0926d);}};EmailChannel[_0xcc8e('0x10')][_0xcc8e('0x24')]=function(_0x16741c,_0x58bfb1){if(this[_0xcc8e('0xd')][_0x16741c]){this['mailAccounts'][_0x16741c]['Imap'][_0xcc8e('0x27')]=_0xcc8e('0x32');this['mailAccounts'][_0x16741c][_0xcc8e('0x15')]['messageStatus']=_0x58bfb1;return this['emit'](_0x16741c);}};EmailChannel[_0xcc8e('0x10')][_0xcc8e('0x34')]=function(_0x3332da,_0x209260){return this['smtp'][_0xcc8e('0x35')](_0x3332da,_0x209260);};EmailChannel['prototype']['verifySmtp']=function(_0x4b6a70){var _0x52edb5=this;if(this[_0xcc8e('0xd')][_0x4b6a70['id']]){if(_[_0xcc8e('0x36')](this[_0xcc8e('0xd')][_0x4b6a70['id']][_0xcc8e('0x37')])){this[_0xcc8e('0xd')][_0x4b6a70['id']][_0xcc8e('0x37')]={};}this['mailAccounts'][_0x4b6a70['id']][_0xcc8e('0x37')][_0xcc8e('0x33')]=moment();return new BPromise(function(_0x202f50,_0x35fb7c){return _0x52edb5[_0xcc8e('0xf')][_0xcc8e('0x38')](_0x4b6a70)[_0xcc8e('0x2f')](function(_0x345786){_0x52edb5[_0xcc8e('0xd')][_0x4b6a70['id']][_0xcc8e('0x37')][_0xcc8e('0x27')]='verified';_0x52edb5[_0xcc8e('0xd')][_0x4b6a70['id']][_0xcc8e('0x37')]['messageStatus']='';_0x52edb5[_0xcc8e('0x11')](_0x4b6a70['id']);_0x202f50(_0x345786);})['catch'](function(_0x102742){_0x52edb5['mailAccounts'][_0x4b6a70['id']]['Smtp'][_0xcc8e('0x27')]=_0xcc8e('0x32');_0x52edb5[_0xcc8e('0xd')][_0x4b6a70['id']][_0xcc8e('0x37')][_0xcc8e('0x16')]=_0x102742;_0x52edb5['emit'](_0x4b6a70['id']);_0x35fb7c(_0x102742);});});}return this[_0xcc8e('0xf')][_0xcc8e('0x38')](_0x4b6a70);};module[_0xcc8e('0x39')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 3b94dd8..beaef95 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 _0xc847=['host','port','tls','autotls','required','handleOpenBox','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','emit','hasOwnProperty','lodash','util','imap','iconv','events','EventEmitter','./utils','email','mailbox','getAccount','account','once','ready','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','user','authentication','password','anonymous@xcally.com'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0xc847,0x1d8));var _0x7c84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc847[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7c84('0x0'));var util=require(_0x7c84('0x1'));var Imap=require(_0x7c84('0x2'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x7c84('0x3'))['Iconv'];var EventEmitter=require(_0x7c84('0x4'))[_0x7c84('0x5')];var utils=require(_0x7c84('0x6'));var logger=require('../../../config/logger')(_0x7c84('0x7'));function EmailImap(_0xd3e19e,_0x1675ee){this[_0x7c84('0x8')]=_0xd3e19e['mailbox'];this['account']=this[_0x7c84('0x9')](_0xd3e19e,_0x1675ee);this[_0x7c84('0x2')]=new Imap(this[_0x7c84('0xa')]);this['imap'][_0x7c84('0xb')](_0x7c84('0xc'),this['handleReady'][_0x7c84('0xd')](this));this[_0x7c84('0x2')][_0x7c84('0xb')](_0x7c84('0xe'),this[_0x7c84('0xf')][_0x7c84('0xd')](this));this[_0x7c84('0x2')]['on'](_0x7c84('0x10'),this[_0x7c84('0x11')][_0x7c84('0xd')](this));this[_0x7c84('0x2')][_0x7c84('0x12')]();}util[_0x7c84('0x13')](EmailImap,EventEmitter);EmailImap[_0x7c84('0x14')][_0x7c84('0x9')]=function(_0x3198a0,_0x47c55a){var _0x217236={'connTimeout':_0x3198a0[_0x7c84('0x15')]?_0x3198a0[_0x7c84('0x15')]*0x3e8:0x2710,'authTimeout':_0x3198a0[_0x7c84('0x16')]?_0x3198a0[_0x7c84('0x16')]*0x3e8:0x1388};if(_0x3198a0[_0x7c84('0x17')]){_0x217236['user']=_0x3198a0['user'];if(_0x3198a0[_0x7c84('0x18')]){_0x217236[_0x7c84('0x19')]=utils[_0x7c84('0x1a')](_0x3198a0[_0x7c84('0x1b')]['data5'],_0x3198a0[_0x7c84('0x1c')]);}else{_0x217236['password']=_0x3198a0['password'];}}else{if(_0x3198a0[_0x7c84('0x1d')]){_0x217236[_0x7c84('0x1c')]=_0x3198a0[_0x7c84('0x1c')];_0x217236[_0x7c84('0x1e')]=_0x3198a0[_0x7c84('0x1e')];}}_0x217236[_0x7c84('0x7')]=_0x47c55a||_0x3198a0[_0x7c84('0x1c')]||_0x7c84('0x1f');_0x217236[_0x7c84('0x20')]=_0x3198a0[_0x7c84('0x20')];_0x217236[_0x7c84('0x21')]=_0x3198a0[_0x7c84('0x21')]||0x3e1;if(_0x3198a0[_0x7c84('0x22')]){_0x217236[_0x7c84('0x22')]=!![];}else{_0x217236['tls']=![];_0x217236[_0x7c84('0x23')]=_0x7c84('0x24');}return _0x217236;};EmailImap['prototype']['handleReady']=function(){this[_0x7c84('0x2')]['openBox'](this[_0x7c84('0x8')],![],this[_0x7c84('0x25')]['bind'](this));};EmailImap[_0x7c84('0x14')][_0x7c84('0x25')]=function(_0x917d88,_0x4312d1){if(_0x917d88){this['handleError'](_0x917d88,!![]);}else{this['emit'](_0x7c84('0x26'),_0x4312d1);this[_0x7c84('0x27')]();}};EmailImap['prototype'][_0x7c84('0x28')]=function(_0x31b737){if(_0x31b737){this['handleError'](_0x31b737,!![]);}else{this[_0x7c84('0x2')][_0x7c84('0xe')]();}};EmailImap[_0x7c84('0x14')][_0x7c84('0x27')]=function(){this['imap'][_0x7c84('0x29')](['UNSEEN'],this[_0x7c84('0x2a')][_0x7c84('0xd')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x452e1c,_0x537232){if(_0x452e1c){this[_0x7c84('0x11')](_0x452e1c,!![]);}else{if(_0x537232[_0x7c84('0x2b')]){try{var _0x566ce3=this[_0x7c84('0x2')][_0x7c84('0x2c')](_0x537232,{'bodies':'','markSeen':!![]});_0x566ce3['on']('message',this[_0x7c84('0x2d')][_0x7c84('0xd')](this));_0x566ce3[_0x7c84('0xb')](_0x7c84('0x10'),this[_0x7c84('0x2e')]['bind'](this));_0x566ce3['once'](_0x7c84('0xe'),this[_0x7c84('0x2f')][_0x7c84('0xd')](this));}catch(_0x21fcab){logger[_0x7c84('0x10')](_0x21fcab);}}else{this['imap'][_0x7c84('0x30')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0x7c84('0x14')][_0x7c84('0x2d')]=function(_0x4ca9db){_0x4ca9db['on']('body',this[_0x7c84('0x31')][_0x7c84('0xd')](this));_0x4ca9db[_0x7c84('0xb')](_0x7c84('0x32'),this['handleMessageAttributes']['bind'](this));_0x4ca9db[_0x7c84('0xb')](_0x7c84('0xe'),this[_0x7c84('0x33')]['bind'](this));};EmailImap[_0x7c84('0x14')][_0x7c84('0x31')]=function(_0x2335c6){simpleParser(_0x2335c6,{'Iconv':Iconv},this[_0x7c84('0x34')]['bind'](this));};EmailImap['prototype'][_0x7c84('0x35')]=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x7c84('0x14')]['handleSimpleParser']=function(_0x1fd25f,_0x3cffb6){if(_0x1fd25f){logger[_0x7c84('0x10')](_0x1fd25f);}else{var _0xbdaf78=this;utils['parser'](this[_0x7c84('0xa')],_0x3cffb6,function(_0x273a48){_0xbdaf78[_0x7c84('0x36')](_0x7c84('0x7'),_0x273a48);});}};EmailImap[_0x7c84('0x14')][_0x7c84('0x2f')]=function(){this[_0x7c84('0x2')][_0x7c84('0x30')](!![],this['handleCloseBox'][_0x7c84('0xd')](this));};EmailImap[_0x7c84('0x14')][_0x7c84('0x2e')]=function(_0xbedcac){this[_0x7c84('0x11')](_0xbedcac);this[_0x7c84('0x2')][_0x7c84('0x30')](!![],this['handleCloseBox'][_0x7c84('0xd')](this));};EmailImap[_0x7c84('0x14')][_0x7c84('0xf')]=function(){this[_0x7c84('0x36')](_0x7c84('0xe'));};EmailImap[_0x7c84('0x14')][_0x7c84('0x11')]=function(_0x110b70,_0x5661f9){logger['error'](_0x7c84('0x11'),this[_0x7c84('0xa')]['email'],JSON['stringify'](_0x110b70));var _0x4d6050='';if(_0x110b70){if(_0x110b70['textCode']){_0x4d6050=_0x110b70['textCode'];}else{for(var _0x9790c8 in _0x110b70){if(_0x110b70[_0x7c84('0x37')](_0x9790c8)){_0x4d6050+=_['upperFirst'](_0x9790c8)+':\x20'+_0x110b70[_0x9790c8]+'\x0a';}}}}if(_0x5661f9){this[_0x7c84('0x2')][_0x7c84('0xe')]();}else{this[_0x7c84('0x36')]('error',_0x4d6050);this[_0x7c84('0x36')](_0x7c84('0xe'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xdca3=['../../../config/logger','mailbox','account','ready','handleReady','bind','once','handleEnd','error','connect','inherits','prototype','getAccount','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','openBox','handleOpenBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','end','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','closeBox','stringify','upperFirst','lodash','imap','mailparser','simpleParser','events','EventEmitter','./utils'];(function(_0x135904,_0x1e252b){var _0x1ce7d5=function(_0x25a721){while(--_0x25a721){_0x135904['push'](_0x135904['shift']());}};_0x1ce7d5(++_0x1e252b);}(_0xdca3,0x125));var _0x3dca=function(_0x5077c0,_0x44d1b4){_0x5077c0=_0x5077c0-0x0;var _0x5c3409=_0xdca3[_0x5077c0];return _0x5c3409;};'use strict';var _=require(_0x3dca('0x0'));var util=require('util');var Imap=require(_0x3dca('0x1'));var simpleParser=require(_0x3dca('0x2'))[_0x3dca('0x3')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x3dca('0x4'))[_0x3dca('0x5')];var utils=require(_0x3dca('0x6'));var logger=require(_0x3dca('0x7'))('email');function EmailImap(_0x37b3c6,_0x5b5905){this[_0x3dca('0x8')]=_0x37b3c6[_0x3dca('0x8')];this[_0x3dca('0x9')]=this['getAccount'](_0x37b3c6,_0x5b5905);this[_0x3dca('0x1')]=new Imap(this['account']);this['imap']['once'](_0x3dca('0xa'),this[_0x3dca('0xb')][_0x3dca('0xc')](this));this['imap'][_0x3dca('0xd')]('end',this[_0x3dca('0xe')][_0x3dca('0xc')](this));this[_0x3dca('0x1')]['on'](_0x3dca('0xf'),this['handleError'][_0x3dca('0xc')](this));this['imap'][_0x3dca('0x10')]();}util[_0x3dca('0x11')](EmailImap,EventEmitter);EmailImap[_0x3dca('0x12')][_0x3dca('0x13')]=function(_0xc266a4,_0x39251a){var _0x581113={'connTimeout':_0xc266a4[_0x3dca('0x14')]?_0xc266a4['connTimeout']*0x3e8:0x2710,'authTimeout':_0xc266a4['authTimeout']?_0xc266a4[_0x3dca('0x15')]*0x3e8:0x1388};if(_0xc266a4['service']){_0x581113[_0x3dca('0x16')]=_0xc266a4[_0x3dca('0x16')];if(_0xc266a4[_0x3dca('0x17')]){_0x581113[_0x3dca('0x18')]=utils[_0x3dca('0x19')](_0xc266a4[_0x3dca('0x1a')]['data5'],_0xc266a4[_0x3dca('0x16')]);}else{_0x581113[_0x3dca('0x1b')]=_0xc266a4[_0x3dca('0x1b')];}}else{if(_0xc266a4[_0x3dca('0x1c')]){_0x581113[_0x3dca('0x16')]=_0xc266a4[_0x3dca('0x16')];_0x581113[_0x3dca('0x1b')]=_0xc266a4[_0x3dca('0x1b')];}}_0x581113[_0x3dca('0x1d')]=_0x39251a||_0xc266a4[_0x3dca('0x16')]||_0x3dca('0x1e');_0x581113[_0x3dca('0x1f')]=_0xc266a4[_0x3dca('0x1f')];_0x581113[_0x3dca('0x20')]=_0xc266a4['port']||0x3e1;if(_0xc266a4[_0x3dca('0x21')]){_0x581113[_0x3dca('0x21')]=!![];}else{_0x581113[_0x3dca('0x21')]=![];_0x581113[_0x3dca('0x22')]='required';}return _0x581113;};EmailImap[_0x3dca('0x12')][_0x3dca('0xb')]=function(){this[_0x3dca('0x1')][_0x3dca('0x23')](this[_0x3dca('0x8')],![],this[_0x3dca('0x24')][_0x3dca('0xc')](this));};EmailImap['prototype'][_0x3dca('0x24')]=function(_0x2f0f5b,_0x4d619c){if(_0x2f0f5b){this[_0x3dca('0x25')](_0x2f0f5b,!![]);}else{this[_0x3dca('0x26')](_0x3dca('0x27'),_0x4d619c);this[_0x3dca('0x28')]();}};EmailImap[_0x3dca('0x12')]['handleCloseBox']=function(_0x321060){if(_0x321060){this[_0x3dca('0x25')](_0x321060,!![]);}else{this[_0x3dca('0x1')]['end']();}};EmailImap[_0x3dca('0x12')][_0x3dca('0x28')]=function(){this[_0x3dca('0x1')][_0x3dca('0x29')]([_0x3dca('0x2a')],this[_0x3dca('0x2b')][_0x3dca('0xc')](this));};EmailImap[_0x3dca('0x12')]['handleReadUnseen']=function(_0x574305,_0x4f2ae0){if(_0x574305){this['handleError'](_0x574305,!![]);}else{if(_0x4f2ae0['length']){try{var _0x5699c9=this[_0x3dca('0x1')][_0x3dca('0x2c')](_0x4f2ae0,{'bodies':'','markSeen':!![]});_0x5699c9['on'](_0x3dca('0x2d'),this[_0x3dca('0x2e')][_0x3dca('0xc')](this));_0x5699c9['once'](_0x3dca('0xf'),this[_0x3dca('0x2f')][_0x3dca('0xc')](this));_0x5699c9[_0x3dca('0xd')](_0x3dca('0x30'),this['handleFetchEnd'][_0x3dca('0xc')](this));}catch(_0x3f0e49){logger[_0x3dca('0xf')](_0x3f0e49);}}else{this['imap']['closeBox'](!![],this[_0x3dca('0x31')][_0x3dca('0xc')](this));}}};EmailImap[_0x3dca('0x12')]['handleFetchMessage']=function(_0x23ee02){_0x23ee02['on'](_0x3dca('0x32'),this['handleMessageBody'][_0x3dca('0xc')](this));_0x23ee02[_0x3dca('0xd')](_0x3dca('0x33'),this[_0x3dca('0x34')][_0x3dca('0xc')](this));_0x23ee02[_0x3dca('0xd')](_0x3dca('0x30'),this[_0x3dca('0x35')]['bind'](this));};EmailImap['prototype'][_0x3dca('0x36')]=function(_0x354baf){simpleParser(_0x354baf,{'Iconv':Iconv},this[_0x3dca('0x37')][_0x3dca('0xc')](this));};EmailImap[_0x3dca('0x12')][_0x3dca('0x34')]=function(){};EmailImap['prototype'][_0x3dca('0x35')]=function(){};EmailImap['prototype'][_0x3dca('0x37')]=function(_0x37badb,_0xbcf60c){if(_0x37badb){logger[_0x3dca('0xf')](_0x37badb);}else{var _0x9ac47a=this;utils[_0x3dca('0x38')](this[_0x3dca('0x9')],_0xbcf60c,function(_0x2b430b){_0x9ac47a['emit'](_0x3dca('0x1d'),_0x2b430b);});}};EmailImap[_0x3dca('0x12')]['handleFetchEnd']=function(){this[_0x3dca('0x1')][_0x3dca('0x39')](!![],this[_0x3dca('0x31')][_0x3dca('0xc')](this));};EmailImap['prototype']['handleFetchError']=function(_0x3eb4b3){this[_0x3dca('0x25')](_0x3eb4b3);this[_0x3dca('0x1')][_0x3dca('0x39')](!![],this['handleCloseBox'][_0x3dca('0xc')](this));};EmailImap[_0x3dca('0x12')]['handleEnd']=function(){this[_0x3dca('0x26')](_0x3dca('0x30'));};EmailImap[_0x3dca('0x12')]['handleError']=function(_0x5e608e,_0x5c9471){logger[_0x3dca('0xf')](_0x3dca('0x25'),this[_0x3dca('0x9')][_0x3dca('0x1d')],JSON[_0x3dca('0x3a')](_0x5e608e));var _0x47a503='';if(_0x5e608e){if(_0x5e608e['textCode']){_0x47a503=_0x5e608e['textCode'];}else{for(var _0x43b669 in _0x5e608e){if(_0x5e608e['hasOwnProperty'](_0x43b669)){_0x47a503+=_[_0x3dca('0x3b')](_0x43b669)+':\x20'+_0x5e608e[_0x43b669]+'\x0a';}}}}if(_0x5c9471){this[_0x3dca('0x1')][_0x3dca('0x30')]();}else{this[_0x3dca('0x26')](_0x3dca('0xf'),_0x47a503);this[_0x3dca('0x26')]('end');}};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 94a0fa6..8237b98 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 _0x6126=['Not\x20verifired','nodemailer-plugin-inline-base64','send','createTransport','use','sendMail','toString','prototype','verify'];(function(_0x2b2f8e,_0x494521){var _0xd95772=function(_0xef5869){while(--_0xef5869){_0x2b2f8e['push'](_0x2b2f8e['shift']());}};_0xd95772(++_0x494521);}(_0x6126,0x18d));var _0x6612=function(_0x19c483,_0x3b63fc){_0x19c483=_0x19c483-0x0;var _0x47ae32=_0x6126[_0x19c483];return _0x47ae32;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x6612('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x6612('0x1')]=function(_0x348739,_0x100057){return new Promise(function(_0xd42231,_0x1aefb0){var _0x443f8e=nodemailer[_0x6612('0x2')](_0x348739);_0x443f8e[_0x6612('0x3')]('compile',inlineBase64());_0x443f8e[_0x6612('0x4')](_0x100057,function(_0x176d9a,_0x28f737){if(_0x176d9a){_0x1aefb0(_0x176d9a[_0x6612('0x5')]());}else{_0xd42231(_0x28f737);}});});};EmailSmtp[_0x6612('0x6')][_0x6612('0x7')]=function(_0xf239b0){return new Promise(function(_0x3c1acb,_0x21b082){var _0x448022=nodemailer[_0x6612('0x2')](_0xf239b0);_0x448022[_0x6612('0x7')](function(_0xa9a49f,_0x21b97d){if(_0xa9a49f){_0x21b082(_0xa9a49f[_0x6612('0x5')]());}else{if(_0x21b97d){_0x3c1acb(_0x21b97d);}else{_0x21b082(_0x6612('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x0111=['createTransport','compile','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x4b2c57,_0x2d8cd9){var _0x10ac0b=function(_0x48de8b){while(--_0x48de8b){_0x4b2c57['push'](_0x4b2c57['shift']());}};_0x10ac0b(++_0x2d8cd9);}(_0x0111,0x19b));var _0x1011=function(_0x386e9f,_0x3d499e){_0x386e9f=_0x386e9f-0x0;var _0x39ef57=_0x0111[_0x386e9f];return _0x39ef57;};'use strict';var nodemailer=require(_0x1011('0x0'));var inlineBase64=require(_0x1011('0x1'));function EmailSmtp(){}EmailSmtp[_0x1011('0x2')]['send']=function(_0x461250,_0x3275a0){return new Promise(function(_0x312be0,_0x3e4984){var _0x351b6e=nodemailer[_0x1011('0x3')](_0x461250);_0x351b6e['use'](_0x1011('0x4'),inlineBase64());_0x351b6e['sendMail'](_0x3275a0,function(_0x307af0,_0x9e4c93){if(_0x307af0){_0x3e4984(_0x307af0[_0x1011('0x5')]());}else{_0x312be0(_0x9e4c93);}});});};EmailSmtp[_0x1011('0x2')][_0x1011('0x6')]=function(_0x52d8a7){return new Promise(function(_0x32d3fa,_0x4d13d){var _0x1eaf2d=nodemailer['createTransport'](_0x52d8a7);_0x1eaf2d[_0x1011('0x6')](function(_0x35ff49,_0x58ffe9){if(_0x35ff49){_0x4d13d(_0x35ff49[_0x1011('0x5')]());}else{if(_0x58ffe9){_0x32d3fa(_0x58ffe9);}else{_0x4d13d(_0x1011('0x7'));}}});});};module[_0x1011('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 167f49b..c755004 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 _0x2111=['headerLines','X-Auto-Response-Suppress:\x20All','isAutoreply','parser','from','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','util','node-tnef','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','length','slice','join','Anonymous','split','pop','html','test','replace','includes','0x1?_0x58dc6c[_0x1211('0x10')](0x0,-0x1)[_0x1211('0x11')]('\x20'):_0xc78434[_0x1211('0xc')];}return _0x1211('0x12');}function getLastName(_0x5c6319){var _0x456bd7=_[_0x1211('0x6')](_0x5c6319[_0x1211('0xb')]);if(_0x456bd7&&_0x456bd7[_0x1211('0xc')]){var _0x420a4b=_0x456bd7[_0x1211('0xc')][_0x1211('0x13')](/\s+/);return _0x420a4b[_0x1211('0xf')]>0x1?_0x420a4b[_0x1211('0x14')]():'';}return'';}function getMails(_0x34abf6,_0x539244){var _0x59b0e7='';for(var _0x23c398=0x0;_0x23c398<_0x539244[_0x1211('0xb')]['length'];_0x23c398+=0x1){if(_0x539244['value'][_0x23c398]['address']!==_0x34abf6){if(!_['isEmpty'](_0x59b0e7)){_0x59b0e7+=',';}_0x59b0e7+=_0x539244['value'][_0x23c398][_0x1211('0xc')]||_0x539244['value'][_0x23c398]['address']||'';_0x59b0e7+='\x20<';_0x59b0e7+=_0x539244[_0x1211('0xb')][_0x23c398]['address']?_0x539244[_0x1211('0xb')][_0x23c398][_0x1211('0x7')]:_0x1211('0x8')+random[_0x1211('0x9')](0x6)+'@xcally.com';_0x59b0e7+='>';}}return _0x59b0e7;}function parseEmail(_0xc06a8b,_0x1ce7e5,_0x16f85d){if(_0x1ce7e5[_0x1211('0x15')]){var _0x4324f2=/)<[^<]*)*<\/script>/gi;while(_0x4324f2[_0x1211('0x16')](_0x1ce7e5[_0x1211('0x15')])){_0x1ce7e5['html']=_0x1ce7e5[_0x1211('0x15')][_0x1211('0x17')](_0x4324f2,'');}if(_0x1ce7e5[_0x1211('0x15')][_0x1211('0x18')](_0x1211('0x19'))){var _0x5232b7=[];_0x1ce7e5[_0x1211('0x1a')][_0x1211('0x1b')](_0x240580=>{_0x5232b7[_0x1211('0x1c')](_0x240580[_0x1211('0x1d')]);});var _0x576154=/]+>/g;var _0x2ee483=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x45d236=_0x1ce7e5['html'][_0x1211('0x17')](_0x2ee483,_0x1211('0x1e'));var _0x2a2196=_0x45d236['replace'](_0x576154,_0x1211('0x1f'));for(let _0x2a6e5c=0x0;_0x2a6e5c<_0x5232b7[_0x1211('0xf')];_0x2a6e5c++){var _0x38e564=_0x2a2196[_0x1211('0x17')]('_IMG','\x20[Attachment:\x20'+_0x5232b7[_0x2a6e5c]+'\x20]');_0x2a2196=_0x38e564;}_0x1ce7e5[_0x1211('0x15')]=_0x2a2196;}_0x16f85d['body']=_0x1ce7e5[_0x1211('0x15')];}else{_0x16f85d[_0x1211('0x20')]=_0x1ce7e5[_0x1211('0x21')];}if(_0x16f85d['body']){_0x16f85d[_0x1211('0x20')]=_0x16f85d[_0x1211('0x20')][_0x1211('0x17')](/0x0){var _0x32d541=['Auto-Submitted:\x20auto-replied',_0x1211('0x30'),'Precedence:\x20auto_reply'];for(var _0x46386c=0x0;_0x46386c<_0x1ce7e5[_0x1211('0x2f')]['length'];_0x46386c++){var _0x1f26e8=_[_0x1211('0xe')](_0x32d541,_0x1ce7e5[_0x1211('0x2f')][_0x46386c]['line']);if(_0x1f26e8>=0x0){_0x16f85d[_0x1211('0x31')]=!![];}}}return _0x16f85d;}exports[_0x1211('0x32')]=function(_0x470c54,_0x2c3d58,_0x9bd339){var _0x1802bf={'from':getAddress(_0x2c3d58['from']),'firstName':getFirstName(_0x2c3d58[_0x1211('0x33')]),'lastName':getLastName(_0x2c3d58[_0x1211('0x33')]),'mapKey':_0x1211('0x4'),'message':{'from':getMails(_0x470c54['email'],_0x2c3d58[_0x1211('0x33')]),'to':_0x470c54[_0x1211('0x4')],'cc':'','subject':_0x2c3d58['subject']||'','messageId':_0x2c3d58[_0x1211('0x34')],'inReplyTo':_0x2c3d58['inReplyTo'],'sentAt':moment(_0x2c3d58[_0x1211('0x35')])[_0x1211('0x2a')](_0x1211('0x36')),'attach':![],'attachments':[]}};if(!_0x2c3d58[_0x1211('0x15')]&&!_0x2c3d58['textAsHtml']){var _0x328764=_[_0x1211('0x37')](_0x2c3d58[_0x1211('0x1a')],{'contentType':_0x1211('0x38')});if(_0x328764[_0x1211('0xf')]){logger[_0x1211('0x39')](util[_0x1211('0x2a')](_0x1211('0x3a'),_0x2c3d58[_0x1211('0x34')]));tnef[_0x1211('0x3b')](_['first'](_0x328764)[_0x1211('0x2e')],function(_0x54300d,_0x59e1b1){if(_0x59e1b1){_0x2c3d58[_0x1211('0x15')]=_0x59e1b1[_0x1211('0x3c')]||'

Empty\x20message

';if(_0x59e1b1['Attachments']){for(var _0xc6f427=0x0;_0xc6f427<_0x59e1b1['Attachments']['length'];_0xc6f427++){var _0x1137f9=_0x59e1b1[_0x1211('0x3d')][_0xc6f427];_0x1802bf[_0x1211('0x22')]['attachments']['push']({'filename':_0x1137f9['Title'],'content':Buffer[_0x1211('0x33')](_0x1137f9[_0x1211('0x3e')])});}}}_0x9bd339(parseEmail(_0x470c54,_0x2c3d58,_0x1802bf));});}else{_0x2c3d58['html']='

Empty\x20message

';_0x9bd339(parseEmail(_0x470c54,_0x2c3d58,_0x1802bf));}}else{_0x9bd339(parseEmail(_0x470c54,_0x2c3d58,_0x1802bf));}};exports[_0x1211('0x3f')]=function(_0x4b57c1,_0x2f5067){var _0x9035cf=[_0x1211('0x40')+(_0x2f5067||''),_0x1211('0x41')+_0x4b57c1,'',''];return Buffer[_0x1211('0x33')](_0x9035cf[_0x1211('0x11')](''),_0x1211('0x42'))[_0x1211('0x43')](_0x1211('0x44'));}; \ No newline at end of file +var _0x2992=['inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','toString','base64','moment','randomstring','util','node-tnef','../../../config/environment','head','address','generate','@xcally.com','value','name','indexOf','split','length','slice','join','Anonymous','pop','anonymous','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x4555da[_0x2299('0xe')](0x0,-0x1)[_0x2299('0xf')]('\x20'):_0x5d8ce1[_0x2299('0xa')];}return _0x2299('0x10');}function getLastName(_0x2c2793){var _0x5a4305=_[_0x2299('0x5')](_0x2c2793[_0x2299('0x9')]);if(_0x5a4305&&_0x5a4305['name']){var _0x1d3627=_0x5a4305[_0x2299('0xa')]['split'](/\s+/);return _0x1d3627[_0x2299('0xd')]>0x1?_0x1d3627[_0x2299('0x11')]():'';}return'';}function getMails(_0x4e0527,_0x1a3fa7){var _0x24c836='';for(var _0xc0852e=0x0;_0xc0852e<_0x1a3fa7[_0x2299('0x9')]['length'];_0xc0852e+=0x1){if(_0x1a3fa7[_0x2299('0x9')][_0xc0852e][_0x2299('0x6')]!==_0x4e0527){if(!_['isEmpty'](_0x24c836)){_0x24c836+=',';}_0x24c836+=_0x1a3fa7[_0x2299('0x9')][_0xc0852e][_0x2299('0xa')]||_0x1a3fa7[_0x2299('0x9')][_0xc0852e][_0x2299('0x6')]||'';_0x24c836+='\x20<';_0x24c836+=_0x1a3fa7[_0x2299('0x9')][_0xc0852e][_0x2299('0x6')]?_0x1a3fa7[_0x2299('0x9')][_0xc0852e][_0x2299('0x6')]:_0x2299('0x12')+random[_0x2299('0x7')](0x6)+'@xcally.com';_0x24c836+='>';}}return _0x24c836;}function parseEmail(_0x470460,_0x4bbdd9,_0x46fe1e){if(_0x4bbdd9[_0x2299('0x13')]){var _0x340c4d=/)<[^<]*)*<\/script>/gi;while(_0x340c4d[_0x2299('0x14')](_0x4bbdd9[_0x2299('0x13')])){_0x4bbdd9['html']=_0x4bbdd9[_0x2299('0x13')][_0x2299('0x15')](_0x340c4d,'');}if(_0x4bbdd9[_0x2299('0x13')][_0x2299('0x16')](_0x2299('0x17'))){var _0x475b92=[];_0x4bbdd9['attachments']['forEach'](_0x590336=>{_0x475b92[_0x2299('0x18')](_0x590336[_0x2299('0x19')]);});var _0x49fe8d=/]+>/g;var _0x21e5c0=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5b9910=_0x4bbdd9[_0x2299('0x13')][_0x2299('0x15')](_0x21e5c0,_0x2299('0x1a'));var _0x96567b=_0x5b9910[_0x2299('0x15')](_0x49fe8d,'_IMG');for(let _0x1b168f=0x0;_0x1b168f<_0x475b92['length'];_0x1b168f++){var _0x1d1ce0=_0x96567b[_0x2299('0x15')](_0x2299('0x1b'),_0x2299('0x1c')+_0x475b92[_0x1b168f]+_0x2299('0x1d'));_0x96567b=_0x1d1ce0;}_0x4bbdd9[_0x2299('0x13')]=_0x96567b;}_0x46fe1e[_0x2299('0x1e')]=_0x4bbdd9[_0x2299('0x13')];}else{_0x46fe1e[_0x2299('0x1e')]=_0x4bbdd9[_0x2299('0x1f')];}if(_0x46fe1e[_0x2299('0x1e')]){_0x46fe1e[_0x2299('0x1e')]=_0x46fe1e[_0x2299('0x1e')][_0x2299('0x15')](/0x0){var _0x3a746f=['Auto-Submitted:\x20auto-replied',_0x2299('0x32'),_0x2299('0x33')];for(var _0x331145=0x0;_0x331145<_0x4bbdd9[_0x2299('0x31')][_0x2299('0xd')];_0x331145++){var _0xf1c806=_[_0x2299('0xb')](_0x3a746f,_0x4bbdd9[_0x2299('0x31')][_0x331145][_0x2299('0x34')]);if(_0xf1c806>=0x0){_0x46fe1e[_0x2299('0x35')]=!![];}}}return _0x46fe1e;}exports[_0x2299('0x36')]=function(_0x4aac9b,_0x4d69d7,_0x205dbb){var _0x1fe818={'from':getAddress(_0x4d69d7[_0x2299('0x37')]),'firstName':getFirstName(_0x4d69d7['from']),'lastName':getLastName(_0x4d69d7[_0x2299('0x37')]),'mapKey':'email','message':{'from':getMails(_0x4aac9b[_0x2299('0x25')],_0x4d69d7[_0x2299('0x37')]),'to':_0x4aac9b[_0x2299('0x25')],'cc':'','subject':_0x4d69d7['subject']||'','messageId':_0x4d69d7[_0x2299('0x38')],'inReplyTo':_0x4d69d7[_0x2299('0x39')],'sentAt':moment(_0x4d69d7[_0x2299('0x3a')])['format'](_0x2299('0x3b')),'attach':![],'attachments':[]}};if(!_0x4d69d7[_0x2299('0x13')]&&!_0x4d69d7[_0x2299('0x1f')]){var _0xf15b83=_['filter'](_0x4d69d7['attachments'],{'contentType':'application/ms-tnef'});if(_0xf15b83[_0x2299('0xd')]){logger[_0x2299('0x3c')](util['format'](_0x2299('0x3d'),_0x4d69d7['messageId']));tnef['parseBuffer'](_[_0x2299('0x3e')](_0xf15b83)[_0x2299('0x2f')],function(_0x4d4c85,_0x10bb85){if(_0x10bb85){_0x4d69d7[_0x2299('0x13')]=_0x10bb85[_0x2299('0x3f')]||_0x2299('0x40');if(_0x10bb85['Attachments']){for(var _0x107ce4=0x0;_0x107ce4<_0x10bb85[_0x2299('0x41')][_0x2299('0xd')];_0x107ce4++){var _0x196e47=_0x10bb85['Attachments'][_0x107ce4];_0x1fe818['message']['attachments']['push']({'filename':_0x196e47[_0x2299('0x42')],'content':Buffer[_0x2299('0x37')](_0x196e47[_0x2299('0x43')])});}}}_0x205dbb(parseEmail(_0x4aac9b,_0x4d69d7,_0x1fe818));});}else{_0x4d69d7[_0x2299('0x13')]=_0x2299('0x40');_0x205dbb(parseEmail(_0x4aac9b,_0x4d69d7,_0x1fe818));}}else{_0x205dbb(parseEmail(_0x4aac9b,_0x4d69d7,_0x1fe818));}};exports[_0x2299('0x44')]=function(_0x3c1050,_0x2834e5){var _0x2b3b14=[_0x2299('0x45')+(_0x2834e5||''),'auth=Bearer\x20'+_0x3c1050,'',''];return Buffer[_0x2299('0x37')](_0x2b3b14[_0x2299('0xf')](''),_0x2299('0x46'))[_0x2299('0x47')](_0x2299('0x48'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 81b7661..6c1ce00 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 _0x415a=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x52eb33,_0x1c93ee){var _0x3a9880=function(_0x1f3a96){while(--_0x1f3a96){_0x52eb33['push'](_0x52eb33['shift']());}};_0x3a9880(++_0x1c93ee);}(_0x415a,0x12e));var _0xa415=function(_0x3f927f,_0x411c1f){_0x3f927f=_0x3f927f-0x0;var _0x37ca56=_0x415a[_0x3f927f];return _0x37ca56;};'use strict';var _=require(_0xa415('0x0'));function MailAccount(_0x4ca5fd){this['id']=_0x4ca5fd['id']||0x0;this[_0xa415('0x1')]=_0x4ca5fd[_0xa415('0x1')]||_0xa415('0x2');this[_0xa415('0x3')]=_0x4ca5fd[_0xa415('0x3')]||_0xa415('0x4');this[_0xa415('0x5')]=_0x4ca5fd[_0xa415('0x5')]||![];this[_0xa415('0x6')]=_0x4ca5fd[_0xa415('0x6')]||[];this[_0xa415('0x7')]=_0x4ca5fd[_0xa415('0x7')]||[];}module[_0xa415('0x8')]=MailAccount; \ No newline at end of file +var _0xb895=['active','Imap','Smtp','exports','lodash','name','Service','SERV'];(function(_0x163e24,_0x12cfb9){var _0x166072=function(_0x4c31be){while(--_0x4c31be){_0x163e24['push'](_0x163e24['shift']());}};_0x166072(++_0x12cfb9);}(_0xb895,0x9c));var _0x5b89=function(_0x173c62,_0x217b5d){_0x173c62=_0x173c62-0x0;var _0x21b5aa=_0xb895[_0x173c62];return _0x21b5aa;};'use strict';var _=require(_0x5b89('0x0'));function MailAccount(_0x83d3f0){this['id']=_0x83d3f0['id']||0x0;this[_0x5b89('0x1')]=_0x83d3f0['name']||_0x5b89('0x2');this['key']=_0x83d3f0['key']||_0x5b89('0x3');this[_0x5b89('0x4')]=_0x83d3f0['active']||![];this['Imap']=_0x83d3f0[_0x5b89('0x5')]||[];this[_0x5b89('0x6')]=_0x83d3f0['Smtp']||[];}module[_0x5b89('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 03ed170..972addf 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 _0x5bdd=['mergeFromDatabase','initMailAccounts','length','merge','exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype'];(function(_0x5d8c3a,_0x52c448){var _0x5fbe1b=function(_0x5a07b4){while(--_0x5a07b4){_0x5d8c3a['push'](_0x5d8c3a['shift']());}};_0x5fbe1b(++_0x52c448);}(_0x5bdd,0x1d1));var _0xd5bd=function(_0x5b3b19,_0xcf3021){_0x5b3b19=_0x5b3b19-0x0;var _0x3d713b=_0x5bdd[_0x5b3b19];return _0x3d713b;};'use strict';var _=require(_0xd5bd('0x0'));var MailAccount=require(_0xd5bd('0x1'));var Realtime=function(){this[_0xd5bd('0x2')]={};};function freeIsNotKey(_0x3f1f34,_0x64af73,_0x2f1361){var _0x266d4b=_['mapKeys'](_0x3f1f34,function(_0x266f49,_0x1487e3){return _0x266f49[_0x2f1361];});for(var _0x7f5f9d in _0x64af73){if(_0x64af73[_0xd5bd('0x3')](_0x7f5f9d)){if(!_0x266d4b[_0x7f5f9d]){delete _0x64af73[_0x7f5f9d];}}}}Realtime[_0xd5bd('0x4')][_0xd5bd('0x5')]=function(_0x11db94,_0xd25d9e){for(var _0xbef9ae in _0xd25d9e){if(_0x11db94[_0xd5bd('0x3')](_0xbef9ae)){_0x11db94[_0xbef9ae]=_0xd25d9e[_0xbef9ae];}}};Realtime['prototype'][_0xd5bd('0x6')]=function(){var _0x2514af=this;return function(_0x207a2e){if(_0x207a2e){freeIsNotKey(_0x207a2e,_0x2514af[_0xd5bd('0x2')],'id');for(var _0x4d7a35=0x0,_0x4d44cc={},_0xfe042b={};_0x4d7a35<_0x207a2e[_0xd5bd('0x7')];_0x4d7a35+=0x1){_0x4d44cc=_0x207a2e[_0x4d7a35];if(_['isUndefined'](_0x2514af['mailAccounts'][_0x4d44cc['id']])){_0x2514af[_0xd5bd('0x2')][_0x4d44cc['id']]=new MailAccount(_0x4d44cc);}else{_[_0xd5bd('0x8')](_0x2514af[_0xd5bd('0x2')][_0x4d44cc['id']],_0x4d44cc);}}}return _0x2514af[_0xd5bd('0x2')];};};module[_0xd5bd('0x9')]=Realtime; \ No newline at end of file +var _0x13f2=['length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','mergeFromDatabase','hasOwnProperty','prototype'];(function(_0xe39824,_0xbdf61f){var _0x4bc31e=function(_0x594760){while(--_0x594760){_0xe39824['push'](_0xe39824['shift']());}};_0x4bc31e(++_0xbdf61f);}(_0x13f2,0x1e8));var _0x213f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x213f('0x0'));var MailAccount=require(_0x213f('0x1'));var Realtime=function(){this[_0x213f('0x2')]={};};function freeIsNotKey(_0x5280b4,_0x3f6f47,_0x2dbac9){var _0x1108aa=_[_0x213f('0x3')](_0x5280b4,function(_0x58a3f6,_0x417d64){return _0x58a3f6[_0x2dbac9];});for(var _0x4478ea in _0x3f6f47){if(_0x3f6f47['hasOwnProperty'](_0x4478ea)){if(!_0x1108aa[_0x4478ea]){delete _0x3f6f47[_0x4478ea];}}}}Realtime['prototype'][_0x213f('0x4')]=function(_0x54c186,_0x5acdef){for(var _0x39a352 in _0x5acdef){if(_0x54c186[_0x213f('0x5')](_0x39a352)){_0x54c186[_0x39a352]=_0x5acdef[_0x39a352];}}};Realtime[_0x213f('0x6')]['initMailAccounts']=function(){var _0x4318c1=this;return function(_0x2a59d1){if(_0x2a59d1){freeIsNotKey(_0x2a59d1,_0x4318c1[_0x213f('0x2')],'id');for(var _0x50ba2c=0x0,_0x182f99={},_0x320feb={};_0x50ba2c<_0x2a59d1[_0x213f('0x7')];_0x50ba2c+=0x1){_0x182f99=_0x2a59d1[_0x50ba2c];if(_[_0x213f('0x8')](_0x4318c1['mailAccounts'][_0x182f99['id']])){_0x4318c1[_0x213f('0x2')][_0x182f99['id']]=new MailAccount(_0x182f99);}else{_[_0x213f('0x9')](_0x4318c1[_0x213f('0x2')][_0x182f99['id']],_0x182f99);}}}return _0x4318c1[_0x213f('0x2')];};};module[_0x213f('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 49bec9a..ad8de6d 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 _0x4489=['type','data5','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','service','MailServerIn','CloudProvider'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x9448('0x0'));exports[_0x9448('0x1')]=function(){return function(){return client['Request'](_0x9448('0x2'),{'options':{'attributes':['id',_0x9448('0x3'),_0x9448('0x4'),_0x9448('0x5'),'email','active','key','ListId','TemplateId'],'raw':![],'include':[{'model':_0x9448('0x6'),'as':'Imap','include':[{'model':_0x9448('0x7'),'attributes':['id','name',_0x9448('0x5'),_0x9448('0x8'),_0x9448('0x9')],'as':'CloudProvider'}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x9448('0x7'),'attributes':['id',_0x9448('0x3'),_0x9448('0x5'),_0x9448('0x8'),_0x9448('0x9')],'as':'CloudProvider'}]}]},'log':_0x9448('0xa')});};};exports[_0x9448('0xb')]=function(_0x3a4971,_0x87a6a){return client[_0x9448('0xc')](_0x9448('0xd'),{'account':{'id':_0x3a4971},'body':_0x87a6a,'log':_0x9448('0xd')});}; \ No newline at end of file +var _0x35a6=['service','email','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','Request','GetMailAccount','name','provider'];(function(_0x3a92cf,_0x38518b){var _0x15b124=function(_0x14a058){while(--_0x14a058){_0x3a92cf['push'](_0x3a92cf['shift']());}};_0x15b124(++_0x38518b);}(_0x35a6,0x122));var _0x635a=function(_0x4369ef,_0x55cfbc){_0x4369ef=_0x4369ef-0x0;var _0x5b6913=_0x35a6[_0x4369ef];return _0x5b6913;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x635a('0x0')](_0x635a('0x1'),{'options':{'attributes':['id',_0x635a('0x2'),_0x635a('0x3'),_0x635a('0x4'),_0x635a('0x5'),'active','key','ListId','TemplateId'],'raw':![],'include':[{'model':_0x635a('0x6'),'as':_0x635a('0x7'),'include':[{'model':_0x635a('0x8'),'attributes':['id',_0x635a('0x2'),_0x635a('0x4'),_0x635a('0x9'),_0x635a('0xa')],'as':_0x635a('0x8')}]},{'model':_0x635a('0xb'),'as':_0x635a('0xc'),'include':[{'model':_0x635a('0x8'),'attributes':['id',_0x635a('0x2'),'service','type',_0x635a('0xa')],'as':_0x635a('0x8')}]}]},'log':_0x635a('0xd')});};};exports['notify']=function(_0x179137,_0x187e3f){return client[_0x635a('0x0')]('NotifyMailAccount',{'account':{'id':_0x179137},'body':_0x187e3f,'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 7426a7e..1ffbedb 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 _0xc609=['../client','Request','loginMailFrequency','GetSettings'];(function(_0x542d6b,_0x1615bd){var _0x22d616=function(_0x1db71f){while(--_0x1db71f){_0x542d6b['push'](_0x542d6b['shift']());}};_0x22d616(++_0x1615bd);}(_0xc609,0x1cc));var _0x9c60=function(_0x348184,_0xd1cb3){_0x348184=_0x348184-0x0;var _0x21fe6f=_0xc609[_0x348184];return _0x21fe6f;};'use strict';var client=require(_0x9c60('0x0'));exports['getSettings']=function(){return client[_0x9c60('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9c60('0x2')]},'log':_0x9c60('0x3')});}; \ No newline at end of file +var _0xfb2d=['GetSettings','../client','getSettings','loginMailFrequency'];(function(_0x2a1843,_0x4417e9){var _0x6cebd1=function(_0x39f0ee){while(--_0x39f0ee){_0x2a1843['push'](_0x2a1843['shift']());}};_0x6cebd1(++_0x4417e9);}(_0xfb2d,0x75));var _0xdfb2=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0xfb2d[_0x31c19c];return _0x1a87f7;};'use strict';var client=require(_0xdfb2('0x0'));exports[_0xdfb2('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xdfb2('0x2')]},'log':_0xdfb2('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index abf53f4..122728f 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 01d68b2..cb0fcc3 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 _0x2094=['socket.io-redis','../../config/triggers','default','../../config/socketio','once','listening','log','lodash','http','sticky-session','../../config/environment','createServer','listen','port','socket.io','websocket','polling','defaults','redis','localhost'];(function(_0x44476a,_0x16d301){var _0xc06bd3=function(_0x29c410){while(--_0x29c410){_0x44476a['push'](_0x44476a['shift']());}};_0xc06bd3(++_0x16d301);}(_0x2094,0x133));var _0x4209=function(_0x1b4d04,_0x3742a7){_0x1b4d04=_0x1b4d04-0x0;var _0x3d1f94=_0x2094[_0x1b4d04];return _0x3d1f94;};'use strict';var _=require(_0x4209('0x0'));var http=require(_0x4209('0x1'));var express=require('express');var sticky=require(_0x4209('0x2'));var Redis=require('ioredis');var config=require(_0x4209('0x3'));var app=express();var server=http[_0x4209('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x4209('0x5')](server,config[_0x4209('0x6')])){var socketio=require(_0x4209('0x7'))(server,{'transports':[_0x4209('0x8'),_0x4209('0x9')]});config['redis']=_[_0x4209('0xa')](config[_0x4209('0xb')],{'host':_0x4209('0xc'),'port':0x18eb});socketio['adapter'](require(_0x4209('0xd'))({'pubClient':new Redis(config[_0x4209('0xb')]),'subClient':new Redis(config[_0x4209('0xb')])}));require(_0x4209('0xe'))[_0x4209('0xf')]();require(_0x4209('0x10'))[_0x4209('0xf')](socketio);require('../../config/express')[_0x4209('0xf')](app);require('../../routes')[_0x4209('0xf')](app);}else{server[_0x4209('0x11')](_0x4209('0x12'),function(){console[_0x4209('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x4209('0x6')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xae63=['redis','defaults','localhost','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','polling'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xae63,0x1bc));var _0x3ae6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae63[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ae6('0x0'));var http=require(_0x3ae6('0x1'));var express=require(_0x3ae6('0x2'));var sticky=require(_0x3ae6('0x3'));var Redis=require(_0x3ae6('0x4'));var config=require(_0x3ae6('0x5'));var app=express();var server=http[_0x3ae6('0x6')](app);server[_0x3ae6('0x7')]=0xdbba0;if(sticky[_0x3ae6('0x8')](server,config[_0x3ae6('0x9')])){var socketio=require('socket.io')(server,{'transports':[_0x3ae6('0xa'),_0x3ae6('0xb')]});config[_0x3ae6('0xc')]=_[_0x3ae6('0xd')](config[_0x3ae6('0xc')],{'host':_0x3ae6('0xe'),'port':0x18eb});socketio['adapter'](require(_0x3ae6('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x3ae6('0xc')])}));require('../../config/triggers')[_0x3ae6('0x10')]();require(_0x3ae6('0x11'))[_0x3ae6('0x10')](socketio);require(_0x3ae6('0x12'))[_0x3ae6('0x10')](app);require(_0x3ae6('0x13'))[_0x3ae6('0x10')](app);}else{server['once'](_0x3ae6('0x14'),function(){console[_0x3ae6('0x15')](_0x3ae6('0x16'),config['port']);});}exports=module[_0x3ae6('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index ea52929..6ca1faf 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 _0x362b=['rpc','routing','message','result','catch','../../config/logger','client','Request','request','error'];(function(_0x4c63f8,_0x53960f){var _0x26179c=function(_0x21abeb){while(--_0x21abeb){_0x4c63f8['push'](_0x4c63f8['shift']());}};_0x26179c(++_0x53960f);}(_0x362b,0x73));var _0xb362=function(_0x3fa6bf,_0x592e10){_0x3fa6bf=_0x3fa6bf-0x0;var _0x5bcb9d=_0x362b[_0x3fa6bf];return _0x5bcb9d;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xb362('0x0'))('routing');var client=jayson[_0xb362('0x1')]['http']({'port':0x2329});client[_0xb362('0x2')]=function(_0x37a773,_0x379fe6){return new BPromise(function(_0x4f3cce,_0x4f074d){return client[_0xb362('0x3')](_0x37a773,_0x379fe6)['then'](function(_0x3545ec){logger['debug']('rpc','routing',_0x37a773,_0x379fe6,_0x3545ec);if(_0x3545ec[_0xb362('0x4')]){logger['error'](_0xb362('0x5'),_0xb362('0x6'),_0x37a773,_0x3545ec[_0xb362('0x4')][_0xb362('0x7')],_0x379fe6);return _0x4f074d(_0x3545ec['error'][_0xb362('0x7')]);}else{return _0x4f3cce(_0x3545ec[_0xb362('0x8')]);}})[_0xb362('0x9')](function(_0x587e3a){logger[_0xb362('0x4')](_0xb362('0x5'),_0xb362('0x6'),_0x37a773,_0x587e3a,_0x379fe6);return _0x4f074d(_0x587e3a);});});};module['exports']=client; \ No newline at end of file +var _0xebe2=['bluebird','../../config/logger','client','Request','request','then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise'];(function(_0x4bdeaf,_0x32f6bd){var _0x181155=function(_0x1cfda6){while(--_0x1cfda6){_0x4bdeaf['push'](_0x4bdeaf['shift']());}};_0x181155(++_0x32f6bd);}(_0xebe2,0x194));var _0x2ebe=function(_0x27c3f0,_0x198aa2){_0x27c3f0=_0x27c3f0-0x0;var _0x11e51c=_0xebe2[_0x27c3f0];return _0x11e51c;};'use strict';var jayson=require(_0x2ebe('0x0'));var BPromise=require(_0x2ebe('0x1'));var logger=require(_0x2ebe('0x2'))('routing');var client=jayson[_0x2ebe('0x3')]['http']({'port':0x2329});client[_0x2ebe('0x4')]=function(_0x33d50c,_0x4b7af7){return new BPromise(function(_0x36b434,_0x38eb11){return client[_0x2ebe('0x5')](_0x33d50c,_0x4b7af7)[_0x2ebe('0x6')](function(_0x3d303b){logger[_0x2ebe('0x7')](_0x2ebe('0x8'),_0x2ebe('0x9'),_0x33d50c,_0x4b7af7,_0x3d303b);if(_0x3d303b[_0x2ebe('0xa')]){logger['error'](_0x2ebe('0x8'),_0x2ebe('0x9'),_0x33d50c,_0x3d303b[_0x2ebe('0xa')]['message'],_0x4b7af7);return _0x38eb11(_0x3d303b[_0x2ebe('0xa')][_0x2ebe('0xb')]);}else{return _0x36b434(_0x3d303b[_0x2ebe('0xc')]);}})[_0x2ebe('0xd')](function(_0x26615c){logger['error'](_0x2ebe('0x8'),_0x2ebe('0x9'),_0x33d50c,_0x26615c,_0x4b7af7);return _0x38eb11(_0x26615c);});});};module[_0x2ebe('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 789f861..fa0012b 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 _0xf51c=['getWhatsappQueues','log','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues'];(function(_0x2caa59,_0x1f76c3){var _0x491b97=function(_0x21c3f9){while(--_0x21c3f9){_0x2caa59['push'](_0x2caa59['shift']());}};_0x491b97(++_0x1f76c3);}(_0xf51c,0x1ce));var _0xcf51=function(_0x50d779,_0x348043){_0x50d779=_0x50d779-0x0;var _0x259e53=_0xf51c[_0x50d779];return _0x259e53;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require('./realtime');var user=require(_0xcf51('0x0'));var interval=require(_0xcf51('0x1'));var openchannelQueue=require(_0xcf51('0x2'));var chatQueue=require(_0xcf51('0x3'));var smsQueue=require(_0xcf51('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xcf51('0x5'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xcf51('0x6')]()['then'](user[_0xcf51('0x7')]())[_0xcf51('0x8')](realtime[_0xcf51('0x9')]())[_0xcf51('0x8')](interval[_0xcf51('0xa')]())[_0xcf51('0x8')](realtime[_0xcf51('0xb')]())[_0xcf51('0x8')](openchannelQueue[_0xcf51('0xc')]())['then'](realtime[_0xcf51('0xd')]())[_0xcf51('0x8')](chatQueue[_0xcf51('0xe')]())['then'](realtime[_0xcf51('0xf')]())[_0xcf51('0x8')](smsQueue[_0xcf51('0x10')]())[_0xcf51('0x8')](realtime['initSmsQueues']())['then'](mailQueue[_0xcf51('0x11')]())['then'](realtime[_0xcf51('0x12')]())[_0xcf51('0x8')](faxQueue[_0xcf51('0x13')]())[_0xcf51('0x8')](realtime[_0xcf51('0x14')]())[_0xcf51('0x8')](whatsappQueue[_0xcf51('0x15')]())[_0xcf51('0x8')](realtime['initWhatsappQueues']())[_0xcf51('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x4c64d0){return initRealtime();})[_0xcf51('0x8')](function(_0xcbe534){return setInterval(initRealtime,0x1388);})['catch'](function(_0x18638f){console[_0xcf51('0x16')](_0x18638f);});}main(); \ No newline at end of file +var _0x2c8e=['./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','getAgents','then','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','catch','log','bluebird','./server','./realtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c8e,0x1a6));var _0xe2c8=function(_0x5d2478,_0x6e81da){_0x5d2478=_0x5d2478-0x0;var _0x265588=_0x2c8e[_0x5d2478];return _0x265588;};'use strict';var BPromise=require(_0xe2c8('0x0'));var server=require(_0xe2c8('0x1'));var Realtime=require(_0xe2c8('0x2'));var user=require(_0xe2c8('0x3'));var interval=require(_0xe2c8('0x4'));var openchannelQueue=require(_0xe2c8('0x5'));var chatQueue=require(_0xe2c8('0x6'));var smsQueue=require(_0xe2c8('0x7'));var mailQueue=require(_0xe2c8('0x8'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xe2c8('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe2c8('0xa')]()['then'](user[_0xe2c8('0xb')]())[_0xe2c8('0xc')](realtime['initAgents']())[_0xe2c8('0xc')](interval[_0xe2c8('0xd')]())[_0xe2c8('0xc')](realtime[_0xe2c8('0xe')]())[_0xe2c8('0xc')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0xe2c8('0xf')]())[_0xe2c8('0xc')](chatQueue[_0xe2c8('0x10')]())[_0xe2c8('0xc')](realtime[_0xe2c8('0x11')]())[_0xe2c8('0xc')](smsQueue['getSmsQueues']())[_0xe2c8('0xc')](realtime[_0xe2c8('0x12')]())[_0xe2c8('0xc')](mailQueue['getMailQueues']())[_0xe2c8('0xc')](realtime[_0xe2c8('0x13')]())['then'](faxQueue[_0xe2c8('0x14')]())[_0xe2c8('0xc')](realtime[_0xe2c8('0x15')]())['then'](whatsappQueue[_0xe2c8('0x16')]())[_0xe2c8('0xc')](realtime['initWhatsappQueues']())[_0xe2c8('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xe2c8('0xc')](function(_0x317549){return initRealtime();})[_0xe2c8('0xc')](function(_0x3b642c){return setInterval(initRealtime,0x1388);})[_0xe2c8('0x17')](function(_0x1be798){console[_0xe2c8('0x18')](_0x1be798);});}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 a624e55..7382f71 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x5c3d11,_0x589686){var _0x31e455=function(_0x251512){while(--_0x251512){_0x5c3d11['push'](_0x5c3d11['shift']());}};_0x31e455(++_0x589686);}(_0x326f,0xd1));var _0xf326=function(_0x5ab19a,_0x4f733c){_0x5ab19a=_0x5ab19a-0x0;var _0x1f38a8=_0x326f[_0x5ab19a];return _0x1f38a8;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x3ce9f3,_0x1e2882){var _0x2473b1=function(_0x5ba9c7){while(--_0x5ba9c7){_0x3ce9f3['push'](_0x3ce9f3['shift']());}};_0x2473b1(++_0x1e2882);}(_0x7a54,0x106));var _0x47a5=function(_0x235f31,_0x199c45){_0x235f31=_0x235f31-0x0;var _0x33add6=_0x7a54[_0x235f31];return _0x33add6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 4cd808f..87ccffe 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 _0x1791=['result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then','error','message'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x1791,0x185));var _0x1179=function(_0x1af420,_0x4ad7c5){_0x1af420=_0x1af420-0x0;var _0x572d5f=_0x1791[_0x1af420];return _0x572d5f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x1179('0x0'));var client=jayson[_0x1179('0x1')][_0x1179('0x2')]({'port':0x232b});function request(_0x19c93b,_0x218ab2){return new BPromise(function(_0x22d6c6,_0x5b6f96){return client[_0x1179('0x3')](_0x19c93b,_0x218ab2)[_0x1179('0x4')](function(_0x28e473){if(_0x28e473[_0x1179('0x5')]){return _0x5b6f96(_0x28e473[_0x1179('0x5')][_0x1179('0x6')]);}else{return _0x22d6c6(_0x28e473[_0x1179('0x7')]);}})[_0x1179('0x8')](function(_0x432f7c){return _0x5b6f96(_0x432f7c);});});}exports[_0x1179('0x9')]=function(_0x1f76d4,_0x374910){return request(_0x1179('0xa'),{'account':_0x1f76d4,'message':_0x374910});}; \ No newline at end of file +var _0xa683=['http','request','then','error','message','result','catch','SendMail','bluebird','jayson/promise','client'];(function(_0x21ebfc,_0x373d35){var _0x58e1d3=function(_0x19e9e8){while(--_0x19e9e8){_0x21ebfc['push'](_0x21ebfc['shift']());}};_0x58e1d3(++_0x373d35);}(_0xa683,0x1d6));var _0x3a68=function(_0x2a28f0,_0x40f49b){_0x2a28f0=_0x2a28f0-0x0;var _0x41f1c9=_0xa683[_0x2a28f0];return _0x41f1c9;};'use strict';var BPromise=require(_0x3a68('0x0'));var jayson=require(_0x3a68('0x1'));var client=jayson[_0x3a68('0x2')][_0x3a68('0x3')]({'port':0x232b});function request(_0x253d0,_0x1fb767){return new BPromise(function(_0x482233,_0x421967){return client[_0x3a68('0x4')](_0x253d0,_0x1fb767)[_0x3a68('0x5')](function(_0x400ee8){if(_0x400ee8['error']){return _0x421967(_0x400ee8[_0x3a68('0x6')][_0x3a68('0x7')]);}else{return _0x482233(_0x400ee8[_0x3a68('0x8')]);}})[_0x3a68('0x9')](function(_0x123833){return _0x421967(_0x123833);});});}exports['sendMailMessage']=function(_0x357c05,_0x2c11cd){return request(_0x3a68('0xa'),{'account':_0x357c05,'message':_0x2c11cd});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index bd0a981..4ec3bd4 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 _0xed1c=['whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','idle','mail','chat','fax','sms','whatsapp','length','StatusTime','format','Status','chatCurrentCapacity','smsStatus','whatsappStatusTime','chatWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','stringify','emit','user:routing:update','exports','lodash','md5','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xed1c,0xe4));var _0xced1=function(_0x3d0497,_0x472ec1){_0x3d0497=_0x3d0497-0x0;var _0x2e1f27=_0xed1c[_0x3d0497];return _0x2e1f27;};'use strict';var _=require(_0xced1('0x0'));var md5=require(_0xced1('0x1'));var moment=require('moment');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xced1('0x2')](config[_0xced1('0x3')],{'host':_0xced1('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xced1('0x3')]));function Agent(_0x445160){this['id']=_0x445160['id']||0x0;this[_0xced1('0x5')]=_0x445160[_0xced1('0x5')]||'';this['online']=_0x445160[_0xced1('0x6')]||!![];this[_0xced1('0x7')]=_0x445160[_0xced1('0x7')]||![];this[_0xced1('0x8')]=_0x445160[_0xced1('0x8')]||![];this[_0xced1('0x9')]=_0x445160[_0xced1('0x9')]||![];this[_0xced1('0xa')]=_0x445160['faxPause']||![];this[_0xced1('0xb')]=_0x445160['smsPause']||![];this[_0xced1('0xc')]=_0x445160[_0xced1('0xc')]||![];this[_0xced1('0xd')]=_0xced1('0xe');this[_0xced1('0xf')]=0x0;this[_0xced1('0x10')]=_0x445160[_0xced1('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xced1('0x11')]=_0xced1('0xe');this[_0xced1('0x12')]=0x0;this[_0xced1('0x13')]=_0x445160['mailCapacity']||0x0;this[_0xced1('0x14')]=0x0;this[_0xced1('0x15')]='unknown';this[_0xced1('0x16')]=0x0;this[_0xced1('0x17')]=_0x445160[_0xced1('0x17')]||0x0;this[_0xced1('0x18')]=0x0;this['smsStatus']='unknown';this[_0xced1('0x19')]=0x0;this[_0xced1('0x1a')]=_0x445160[_0xced1('0x1a')]||0x0;this[_0xced1('0x1b')]=0x0;this[_0xced1('0x1c')]=_0xced1('0xe');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x445160[_0xced1('0x1d')]||0x0;this[_0xced1('0x1e')]=0x0;this[_0xced1('0x1f')]='unknown';this[_0xced1('0x20')]=0x0;this[_0xced1('0x21')]=_0x445160[_0xced1('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xced1('0x22')]=![];this[_0xced1('0x23')]=undefined;this[_0xced1('0x1')]='';this['chatWaitingInteractions']={};this[_0xced1('0x24')]={};this[_0xced1('0x25')]={};this[_0xced1('0x26')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0xced1('0x27')]();}Agent[_0xced1('0x28')][_0xced1('0x29')]=function(_0x20dcb4){if(this[_0x20dcb4+_0xced1('0x2a')]>0x0){if(this[_0x20dcb4+'Capacity']>0x0&&this[_0x20dcb4+_0xced1('0x2a')]>=this[_0x20dcb4+_0xced1('0x2b')]){return'maxcapacity';}else{return'working';}}else{return _0xced1('0x2c');}};Agent[_0xced1('0x28')][_0xced1('0x27')]=function(){var _0x3912fe=[_0xced1('0x2d'),_0xced1('0x2e'),'openchannel',_0xced1('0x2f'),_0xced1('0x30'),_0xced1('0x31')];for(var _0x351afc=0x0;_0x351afc<_0x3912fe[_0xced1('0x32')];_0x351afc+=0x1){var _0x8b3ffb=this[_0xced1('0x29')](_0x3912fe[_0x351afc]);if(this[_0x3912fe[_0x351afc]+'Status']!==_0x8b3ffb){this[_0x3912fe[_0x351afc]+_0xced1('0x33')]=_['toNumber'](moment()[_0xced1('0x34')]('x'));}this[_0x3912fe[_0x351afc]+_0xced1('0x35')]=_0x8b3ffb;}var _0x6dc558={'id':this['id'],'name':this[_0xced1('0x5')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xced1('0x8')],'mailPause':this[_0xced1('0x9')],'smsPause':this[_0xced1('0xb')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xced1('0xf')],'chatCapacity':this[_0xced1('0x10')],'chatCurrentCapacity':this[_0xced1('0x36')],'mailStatus':this[_0xced1('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xced1('0x13')],'mailCurrentCapacity':this[_0xced1('0x14')],'faxStatus':this[_0xced1('0x15')],'faxStatusTime':this[_0xced1('0x16')],'faxCapacity':this[_0xced1('0x17')],'faxCurrentCapacity':this[_0xced1('0x18')],'smsStatus':this[_0xced1('0x37')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xced1('0x1b')],'whatsappStatus':this[_0xced1('0x1c')],'whatsappStatusTime':this[_0xced1('0x38')],'whatsappCapacity':this[_0xced1('0x1d')],'whatsappCurrentCapacity':this[_0xced1('0x1e')],'openchannelStatus':this[_0xced1('0x1f')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0xced1('0x23')],'chatWaitingInteractions':this[_0xced1('0x39')],'faxWaitingInteractions':this[_0xced1('0x24')],'mailWaitingInteractions':this[_0xced1('0x25')],'openchannelWaitingInteractions':this[_0xced1('0x26')],'smsWaitingInteractions':this[_0xced1('0x3a')],'whatsappWaitingInteractions':this[_0xced1('0x3b')]};var _0x11205e=md5(JSON[_0xced1('0x3c')](_0x6dc558));if(this[_0xced1('0x1')]!==_0x11205e){this[_0xced1('0x1')]=_0x11205e;io[_0xced1('0x3d')](_0xced1('0x3e'),_['omit'](_0x6dc558,[_0xced1('0x6')]));}};module[_0xced1('0x3f')]=Agent; \ No newline at end of file +var _0x90b1=['smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','prototype','chat','fax','sms','length','Status','StatusTime','whatsappCurrentCapacity','chatWaitingInteractions','mailWaitingInteractions','user:routing:update','omit','exports','lodash','md5','moment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x90b1,0x1bb));var _0x190b=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x90b1[_0x1d1219];return _0x5b5b89;};'use strict';var _=require(_0x190b('0x0'));var md5=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x190b('0x3')]=_[_0x190b('0x4')](config[_0x190b('0x3')],{'host':_0x190b('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x5cbebb){this['id']=_0x5cbebb['id']||0x0;this['name']=_0x5cbebb[_0x190b('0x6')]||'';this[_0x190b('0x7')]=_0x5cbebb[_0x190b('0x7')]||!![];this[_0x190b('0x8')]=_0x5cbebb[_0x190b('0x8')]||![];this[_0x190b('0x9')]=_0x5cbebb[_0x190b('0x9')]||![];this['mailPause']=_0x5cbebb[_0x190b('0xa')]||![];this[_0x190b('0xb')]=_0x5cbebb[_0x190b('0xb')]||![];this[_0x190b('0xc')]=_0x5cbebb[_0x190b('0xc')]||![];this[_0x190b('0xd')]=_0x5cbebb[_0x190b('0xd')]||![];this[_0x190b('0xe')]='unknown';this[_0x190b('0xf')]=0x0;this[_0x190b('0x10')]=_0x5cbebb['chatCapacity']||0x0;this[_0x190b('0x11')]=0x0;this[_0x190b('0x12')]=_0x190b('0x13');this[_0x190b('0x14')]=0x0;this[_0x190b('0x15')]=_0x5cbebb[_0x190b('0x15')]||0x0;this[_0x190b('0x16')]=0x0;this[_0x190b('0x17')]=_0x190b('0x13');this[_0x190b('0x18')]=0x0;this[_0x190b('0x19')]=_0x5cbebb[_0x190b('0x19')]||0x0;this[_0x190b('0x1a')]=0x0;this[_0x190b('0x1b')]=_0x190b('0x13');this[_0x190b('0x1c')]=0x0;this[_0x190b('0x1d')]=_0x5cbebb['smsCapacity']||0x0;this[_0x190b('0x1e')]=0x0;this['whatsappStatus']=_0x190b('0x13');this[_0x190b('0x1f')]=0x0;this[_0x190b('0x20')]=_0x5cbebb[_0x190b('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x190b('0x21')]=_0x190b('0x13');this[_0x190b('0x22')]=0x0;this[_0x190b('0x23')]=_0x5cbebb[_0x190b('0x23')]||0x0;this[_0x190b('0x24')]=0x0;this['busy']=![];this[_0x190b('0x25')]=undefined;this[_0x190b('0x1')]='';this['chatWaitingInteractions']={};this[_0x190b('0x26')]={};this['mailWaitingInteractions']={};this['openchannelWaitingInteractions']={};this[_0x190b('0x27')]={};this[_0x190b('0x28')]={};this[_0x190b('0x29')]();}Agent['prototype'][_0x190b('0x2a')]=function(_0x2e633e){if(this[_0x2e633e+_0x190b('0x2b')]>0x0){if(this[_0x2e633e+_0x190b('0x2c')]>0x0&&this[_0x2e633e+_0x190b('0x2b')]>=this[_0x2e633e+_0x190b('0x2c')]){return _0x190b('0x2d');}else{return'working';}}else{return'idle';}};Agent[_0x190b('0x2e')][_0x190b('0x29')]=function(){var _0x50605b=['mail',_0x190b('0x2f'),'openchannel',_0x190b('0x30'),_0x190b('0x31'),'whatsapp'];for(var _0x3e7a10=0x0;_0x3e7a10<_0x50605b[_0x190b('0x32')];_0x3e7a10+=0x1){var _0x5c89ab=this[_0x190b('0x2a')](_0x50605b[_0x3e7a10]);if(this[_0x50605b[_0x3e7a10]+_0x190b('0x33')]!==_0x5c89ab){this[_0x50605b[_0x3e7a10]+_0x190b('0x34')]=_['toNumber'](moment()['format']('x'));}this[_0x50605b[_0x3e7a10]+_0x190b('0x33')]=_0x5c89ab;}var _0x4d5f3f={'id':this['id'],'name':this[_0x190b('0x6')],'online':this[_0x190b('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0x190b('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x190b('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0x190b('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x190b('0xf')],'chatCapacity':this[_0x190b('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x190b('0x12')],'mailStatusTime':this[_0x190b('0x14')],'mailCapacity':this[_0x190b('0x15')],'mailCurrentCapacity':this[_0x190b('0x16')],'faxStatus':this[_0x190b('0x17')],'faxStatusTime':this[_0x190b('0x18')],'faxCapacity':this[_0x190b('0x19')],'faxCurrentCapacity':this[_0x190b('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x190b('0x1d')],'smsCurrentCapacity':this[_0x190b('0x1e')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x190b('0x1f')],'whatsappCapacity':this[_0x190b('0x20')],'whatsappCurrentCapacity':this[_0x190b('0x35')],'openchannelStatus':this[_0x190b('0x21')],'openchannelStatusTime':this[_0x190b('0x22')],'openchannelCapacity':this[_0x190b('0x23')],'openchannelCurrentCapacity':this[_0x190b('0x24')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x190b('0x36')],'faxWaitingInteractions':this[_0x190b('0x26')],'mailWaitingInteractions':this[_0x190b('0x37')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x190b('0x27')],'whatsappWaitingInteractions':this[_0x190b('0x28')]};var _0x2e468b=md5(JSON['stringify'](_0x4d5f3f));if(this[_0x190b('0x1')]!==_0x2e468b){this['md5']=_0x2e468b;io['emit'](_0x190b('0x38'),_[_0x190b('0x39')](_0x4d5f3f,['online']));}};module[_0x190b('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index a7349d8..8869263 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 _0x985d=['updateRealtime','prototype','_rr','map','loggedIn','length','chatPause','paused','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x985d,0x11c));var _0xd985=function(_0x104de2,_0x41c744){_0x104de2=_0x104de2-0x0;var _0xcb5c26=_0x985d[_0x104de2];return _0xcb5c26;};'use strict';var _=require(_0xd985('0x0'));var md5=require('md5');var util=require(_0xd985('0x1'));var Redis=require(_0xd985('0x2'));var config=require(_0xd985('0x3'));config[_0xd985('0x4')]=_[_0xd985('0x5')](config[_0xd985('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xd985('0x6'))(new Redis(config['redis']));function ChatQueue(_0x548690){this['id']=_0x548690['id']||0x0;this['name']=_0x548690[_0xd985('0x7')]||'';this[_0xd985('0x8')]=_0x548690['timeout']||0xa;this[_0xd985('0x9')]=_0x548690['strategy']||_0xd985('0xa');this[_0xd985('0xb')]=_0x548690['Agents'];this[_0xd985('0xc')]={};this[_0xd985('0xd')]=0x0;this[_0xd985('0xe')]='';this[_0xd985('0xf')]();this[_0xd985('0x10')]();}ChatQueue[_0xd985('0x11')][_0xd985('0xf')]=function(){var _0x184e8d=this[_0xd985('0xc')][_0xd985('0x12')];this[_0xd985('0xc')]=_[_0xd985('0x13')](this[_0xd985('0xb')],'id');this[_0xd985('0xc')][_0xd985('0x12')]=_0x184e8d;};ChatQueue[_0xd985('0x11')][_0xd985('0x10')]=function(){this[_0xd985('0x14')]=0x0;this['paused']=0x0;for(var _0x23063e=0x0;_0x23063e=0x0?this[_0xd985('0x18')]:0x0;var _0x46654b={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd985('0x14')],'name':this[_0xd985('0x7')],'paused':this[_0xd985('0x17')],'waiting':this[_0xd985('0xd')]};var _0x573a3e=md5(JSON[_0xd985('0x19')](_0x46654b));if(this[_0xd985('0xe')]!==_0x573a3e){this['md5']=_0x573a3e;io['to'](util['format'](_0xd985('0x1a'),_0x46654b[_0xd985('0x7')]))[_0xd985('0x1b')](_0xd985('0x1c'),_0x46654b);}};module[_0xd985('0x1d')]=ChatQueue; \ No newline at end of file +var _0x3726=['chat:queue:%s','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','available','name','stringify'];(function(_0x75c346,_0x3aa49a){var _0x2b4b02=function(_0x48fdf3){while(--_0x48fdf3){_0x75c346['push'](_0x75c346['shift']());}};_0x2b4b02(++_0x3aa49a);}(_0x3726,0x115));var _0x6372=function(_0x46417f,_0x5d1866){_0x46417f=_0x46417f-0x0;var _0x5355a5=_0x3726[_0x46417f];return _0x5355a5;};'use strict';var _=require(_0x6372('0x0'));var md5=require(_0x6372('0x1'));var util=require(_0x6372('0x2'));var Redis=require(_0x6372('0x3'));var config=require(_0x6372('0x4'));config[_0x6372('0x5')]=_[_0x6372('0x6')](config[_0x6372('0x5')],{'host':_0x6372('0x7'),'port':0x18eb});var io=require(_0x6372('0x8'))(new Redis(config['redis']));function ChatQueue(_0xb55dae){this['id']=_0xb55dae['id']||0x0;this['name']=_0xb55dae['name']||'';this[_0x6372('0x9')]=_0xb55dae[_0x6372('0x9')]||0xa;this['strategy']=_0xb55dae['strategy']||_0x6372('0xa');this[_0x6372('0xb')]=_0xb55dae['Agents'];this[_0x6372('0xc')]={};this['waiting']=0x0;this[_0x6372('0x1')]='';this[_0x6372('0xd')]();this[_0x6372('0xe')]();}ChatQueue[_0x6372('0xf')][_0x6372('0xd')]=function(){var _0x21f57d=this['mapAgentsId'][_0x6372('0x10')];this['mapAgentsId']=_[_0x6372('0x11')](this[_0x6372('0xb')],'id');this['mapAgentsId'][_0x6372('0x10')]=_0x21f57d;};ChatQueue[_0x6372('0xf')][_0x6372('0xe')]=function(){this[_0x6372('0x12')]=0x0;this[_0x6372('0x13')]=0x0;for(var _0xfcdc95=0x0;_0xfcdc95=0x0?this[_0x6372('0x14')]:0x0;var _0x2c4b31={'id':this['id'],'available':this[_0x6372('0x14')],'loggedIn':this[_0x6372('0x12')],'name':this[_0x6372('0x15')],'paused':this['paused'],'waiting':this['waiting']};var _0x524df2=md5(JSON[_0x6372('0x16')](_0x2c4b31));if(this['md5']!==_0x524df2){this[_0x6372('0x1')]=_0x524df2;io['to'](util['format'](_0x6372('0x17'),_0x2c4b31[_0x6372('0x15')]))['emit'](_0x6372('0x18'),_0x2c4b31);}};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 4a21bb9..e2ec9ad 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 _0xcba0=['localhost','name','timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','faxPause','available','waiting','stringify','format','fax:queue:%s','emit','exports','util','ioredis','../../../config/environment','redis'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcba0,0xe6));var _0x0cba=function(_0x49fa37,_0x404cc4){_0x49fa37=_0x49fa37-0x0;var _0x30d616=_0xcba0[_0x49fa37];return _0x30d616;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x0cba('0x0'));var Redis=require(_0x0cba('0x1'));var config=require(_0x0cba('0x2'));config[_0x0cba('0x3')]=_['defaults'](config[_0x0cba('0x3')],{'host':_0x0cba('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0cba('0x3')]));function FaxQueue(_0xc205cd){this['id']=_0xc205cd['id']||0x0;this[_0x0cba('0x5')]=_0xc205cd['name']||'';this[_0x0cba('0x6')]=_0xc205cd['timeout']||0xa;this['strategy']=_0xc205cd[_0x0cba('0x7')]||'beepall';this[_0x0cba('0x8')]=_0xc205cd[_0x0cba('0x8')];this[_0x0cba('0x9')]={};this['waiting']=0x0;this[_0x0cba('0xa')]='';this[_0x0cba('0xb')]();this[_0x0cba('0xc')]();}FaxQueue[_0x0cba('0xd')][_0x0cba('0xb')]=function(){var _0x100152=this[_0x0cba('0x9')]['_rr'];this[_0x0cba('0x9')]=_['map'](this[_0x0cba('0x8')],'id');this[_0x0cba('0x9')][_0x0cba('0xe')]=_0x100152;};FaxQueue[_0x0cba('0xd')][_0x0cba('0xc')]=function(){this[_0x0cba('0xf')]=0x0;this[_0x0cba('0x10')]=0x0;for(var _0x27abe3=0x0;_0x27abe3=0x0?this['available']:0x0;var _0x25d5df={'id':this['id'],'available':this[_0x0cba('0x13')],'loggedIn':this[_0x0cba('0xf')],'name':this[_0x0cba('0x5')],'paused':this[_0x0cba('0x10')],'waiting':this[_0x0cba('0x14')]};var _0x90b2a7=md5(JSON[_0x0cba('0x15')](_0x25d5df));if(this[_0x0cba('0xa')]!==_0x90b2a7){this[_0x0cba('0xa')]=_0x90b2a7;io['to'](util[_0x0cba('0x16')](_0x0cba('0x17'),_0x25d5df[_0x0cba('0x5')]))[_0x0cba('0x18')]('fax_queue:save',_0x25d5df);}};module[_0x0cba('0x19')]=FaxQueue; \ No newline at end of file +var _0x11e5=['lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','loggedIn','paused','online','faxPause','available','waiting','emit','fax_queue:save','exports'];(function(_0x223bd6,_0x3981cc){var _0x12ad2f=function(_0x19e728){while(--_0x19e728){_0x223bd6['push'](_0x223bd6['shift']());}};_0x12ad2f(++_0x3981cc);}(_0x11e5,0x138));var _0x511e=function(_0x3107d2,_0x48bb72){_0x3107d2=_0x3107d2-0x0;var _0x37d0c8=_0x11e5[_0x3107d2];return _0x37d0c8;};'use strict';var _=require(_0x511e('0x0'));var md5=require(_0x511e('0x1'));var util=require('util');var Redis=require(_0x511e('0x2'));var config=require(_0x511e('0x3'));config[_0x511e('0x4')]=_[_0x511e('0x5')](config[_0x511e('0x4')],{'host':_0x511e('0x6'),'port':0x18eb});var io=require(_0x511e('0x7'))(new Redis(config[_0x511e('0x4')]));function FaxQueue(_0x40e074){this['id']=_0x40e074['id']||0x0;this['name']=_0x40e074[_0x511e('0x8')]||'';this[_0x511e('0x9')]=_0x40e074['timeout']||0xa;this['strategy']=_0x40e074['strategy']||_0x511e('0xa');this[_0x511e('0xb')]=_0x40e074[_0x511e('0xb')];this[_0x511e('0xc')]={};this['waiting']=0x0;this[_0x511e('0x1')]='';this[_0x511e('0xd')]();this[_0x511e('0xe')]();}FaxQueue[_0x511e('0xf')][_0x511e('0xd')]=function(){var _0x24796d=this[_0x511e('0xc')]['_rr'];this[_0x511e('0xc')]=_[_0x511e('0x10')](this['Agents'],'id');this[_0x511e('0xc')]['_rr']=_0x24796d;};FaxQueue[_0x511e('0xf')][_0x511e('0xe')]=function(){this[_0x511e('0x11')]=0x0;this[_0x511e('0x12')]=0x0;for(var _0x54d0f2=0x0;_0x54d0f2=0x0?this['available']:0x0;var _0x72790e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x511e('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x511e('0x16')]};var _0x11c966=md5(JSON['stringify'](_0x72790e));if(this[_0x511e('0x1')]!==_0x11c966){this[_0x511e('0x1')]=_0x11c966;io['to'](util['format']('fax:queue:%s',_0x72790e[_0x511e('0x8')]))[_0x511e('0x17')](_0x511e('0x18'),_0x72790e);}};module[_0x511e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 24bc5ae..c909fe6 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 _0xb3a3=['exports','name','Intervals'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0xb3a3,0x16f));var _0x3b3a=function(_0x1def55,_0x50d70a){_0x1def55=_0x1def55-0x0;var _0x187dfa=_0xb3a3[_0x1def55];return _0x187dfa;};'use strict';function Interval(_0x250af6){this['id']=_0x250af6['id']||0x0;this[_0x3b3a('0x0')]=_0x250af6['name']||'';this[_0x3b3a('0x1')]=_0x250af6[_0x3b3a('0x1')]||{};}module[_0x3b3a('0x2')]=Interval; \ No newline at end of file +var _0xc9bc=['exports','name','Intervals'];(function(_0x1415c8,_0x27d437){var _0x5360fc=function(_0x526c8a){while(--_0x526c8a){_0x1415c8['push'](_0x1415c8['shift']());}};_0x5360fc(++_0x27d437);}(_0xc9bc,0x1d8));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0x2767a2){this['id']=_0x2767a2['id']||0x0;this[_0xcc9b('0x0')]=_0x2767a2[_0xcc9b('0x0')]||'';this[_0xcc9b('0x1')]=_0x2767a2['Intervals']||{};}module[_0xcc9b('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 3d33a21..aed8d4d 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 _0x4075=['exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','md5','updateRouting','updateRealtime','_rr','map','Agents','prototype','length','loggedIn','available','paused','waiting','stringify','format'];(function(_0x45d2dd,_0x5844df){var _0xc88ff2=function(_0x24e753){while(--_0x24e753){_0x45d2dd['push'](_0x45d2dd['shift']());}};_0xc88ff2(++_0x5844df);}(_0x4075,0x1cc));var _0x5407=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x4075[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require(_0x5407('0x0'));var md5=require('md5');var util=require(_0x5407('0x1'));var Redis=require(_0x5407('0x2'));var config=require('../../../config/environment');config[_0x5407('0x3')]=_[_0x5407('0x4')](config[_0x5407('0x3')],{'host':_0x5407('0x5'),'port':0x18eb});var io=require(_0x5407('0x6'))(new Redis(config['redis']));function MailQueue(_0x6baa6b){this['id']=_0x6baa6b['id']||0x0;this[_0x5407('0x7')]=_0x6baa6b['name']||'';this[_0x5407('0x8')]=_0x6baa6b[_0x5407('0x8')]||0xa;this[_0x5407('0x9')]=_0x6baa6b[_0x5407('0x9')]||_0x5407('0xa');this['Agents']=_0x6baa6b['Agents'];this[_0x5407('0xb')]={};this['waiting']=0x0;this[_0x5407('0xc')]='';this[_0x5407('0xd')]();this[_0x5407('0xe')]();}MailQueue['prototype']['updateRouting']=function(){var _0xe0bae0=this[_0x5407('0xb')][_0x5407('0xf')];this[_0x5407('0xb')]=_[_0x5407('0x10')](this[_0x5407('0x11')],'id');this['mapAgentsId']['_rr']=_0xe0bae0;};MailQueue[_0x5407('0x12')][_0x5407('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x27374c=0x0;_0x27374c=0x0?this[_0x5407('0x15')]:0x0;var _0x1ba718={'id':this['id'],'available':this[_0x5407('0x15')],'loggedIn':this[_0x5407('0x14')],'name':this[_0x5407('0x7')],'paused':this[_0x5407('0x16')],'waiting':this[_0x5407('0x17')]};var _0x1e1e30=md5(JSON[_0x5407('0x18')](_0x1ba718));if(this[_0x5407('0xc')]!==_0x1e1e30){this[_0x5407('0xc')]=_0x1e1e30;io['to'](util[_0x5407('0x19')]('mail:queue:%s',_0x1ba718[_0x5407('0x7')]))['emit']('mail_queue:save',_0x1ba718);}};module[_0x5407('0x1a')]=MailQueue; \ No newline at end of file +var _0x7296=['updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','available','loggedIn','stringify','format','mail_queue:save','exports','lodash','md5','util','ioredis','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','waiting'];(function(_0x28ca99,_0x4e900b){var _0x57b650=function(_0x85ca33){while(--_0x85ca33){_0x28ca99['push'](_0x28ca99['shift']());}};_0x57b650(++_0x4e900b);}(_0x7296,0x7e));var _0x6729=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0x7296[_0x2706da];return _0x3ba87e;};'use strict';var _=require(_0x6729('0x0'));var md5=require(_0x6729('0x1'));var util=require(_0x6729('0x2'));var Redis=require(_0x6729('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x6729('0x4')](config['redis'],{'host':_0x6729('0x5'),'port':0x18eb});var io=require(_0x6729('0x6'))(new Redis(config[_0x6729('0x7')]));function MailQueue(_0x51e2b9){this['id']=_0x51e2b9['id']||0x0;this[_0x6729('0x8')]=_0x51e2b9['name']||'';this[_0x6729('0x9')]=_0x51e2b9[_0x6729('0x9')]||0xa;this[_0x6729('0xa')]=_0x51e2b9[_0x6729('0xa')]||_0x6729('0xb');this[_0x6729('0xc')]=_0x51e2b9[_0x6729('0xc')];this['mapAgentsId']={};this[_0x6729('0xd')]=0x0;this[_0x6729('0x1')]='';this[_0x6729('0xe')]();this[_0x6729('0xf')]();}MailQueue[_0x6729('0x10')][_0x6729('0xe')]=function(){var _0x1fa543=this[_0x6729('0x11')][_0x6729('0x12')];this[_0x6729('0x11')]=_[_0x6729('0x13')](this[_0x6729('0xc')],'id');this[_0x6729('0x11')][_0x6729('0x12')]=_0x1fa543;};MailQueue[_0x6729('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x6729('0x14')]=0x0;for(var _0x166cab=0x0;_0x166cab=0x0?this[_0x6729('0x16')]:0x0;var _0x5d61f1={'id':this['id'],'available':this[_0x6729('0x16')],'loggedIn':this[_0x6729('0x17')],'name':this[_0x6729('0x8')],'paused':this[_0x6729('0x14')],'waiting':this['waiting']};var _0x4cff55=md5(JSON[_0x6729('0x18')](_0x5d61f1));if(this['md5']!==_0x4cff55){this[_0x6729('0x1')]=_0x4cff55;io['to'](util[_0x6729('0x19')]('mail:queue:%s',_0x5d61f1['name']))['emit'](_0x6729('0x1a'),_0x5d61f1);}};module[_0x6729('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index dbd0621..ab70772 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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x365011,_0x49512e){var _0x1d6a7e=function(_0x1325d1){while(--_0x1325d1){_0x365011['push'](_0x365011['shift']());}};_0x1d6a7e(++_0x49512e);}(_0x814b,0x1a2));var _0xb814=function(_0x111494,_0x1d73da){_0x111494=_0x111494-0x0;var _0x1d0d8b=_0x814b[_0x111494];return _0x1d0d8b;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0xf71af3,_0x5d3d8f){var _0x1694ac=function(_0xdacba6){while(--_0xdacba6){_0xf71af3['push'](_0xf71af3['shift']());}};_0x1694ac(++_0x5d3d8f);}(_0x814b,0x1a2));var _0xb814=function(_0x580cf8,_0x26751e){_0x580cf8=_0x580cf8-0x0;var _0xcc9a9e=_0x814b[_0x580cf8];return _0xcc9a9e;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 1bd970b..de7c028 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 _0xa588=['paused','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','online','smsPause'];(function(_0x5481ab,_0x3fa9ca){var _0x2845ef=function(_0x4eb718){while(--_0x4eb718){_0x5481ab['push'](_0x5481ab['shift']());}};_0x2845ef(++_0x3fa9ca);}(_0xa588,0xe1));var _0x8a58=function(_0x30d618,_0x590668){_0x30d618=_0x30d618-0x0;var _0x39731a=_0xa588[_0x30d618];return _0x39731a;};'use strict';var _=require('lodash');var md5=require(_0x8a58('0x0'));var util=require(_0x8a58('0x1'));var Redis=require(_0x8a58('0x2'));var config=require(_0x8a58('0x3'));config[_0x8a58('0x4')]=_[_0x8a58('0x5')](config[_0x8a58('0x4')],{'host':_0x8a58('0x6'),'port':0x18eb});var io=require(_0x8a58('0x7'))(new Redis(config['redis']));function SmsQueue(_0x30f66b){this['id']=_0x30f66b['id']||0x0;this[_0x8a58('0x8')]=_0x30f66b[_0x8a58('0x8')]||'';this[_0x8a58('0x9')]=_0x30f66b[_0x8a58('0x9')]||0xa;this[_0x8a58('0xa')]=_0x30f66b[_0x8a58('0xa')]||_0x8a58('0xb');this['Agents']=_0x30f66b[_0x8a58('0xc')];this[_0x8a58('0xd')]={};this[_0x8a58('0xe')]=0x0;this[_0x8a58('0x0')]='';this[_0x8a58('0xf')]();this['updateRealtime']();}SmsQueue[_0x8a58('0x10')][_0x8a58('0xf')]=function(){var _0x143805=this[_0x8a58('0xd')]['_rr'];this['mapAgentsId']=_[_0x8a58('0x11')](this['Agents'],'id');this[_0x8a58('0xd')][_0x8a58('0x12')]=_0x143805;};SmsQueue['prototype'][_0x8a58('0x13')]=function(){this[_0x8a58('0x14')]=0x0;this['paused']=0x0;for(var _0x3d40a5=0x0;_0x3d40a5=0x0?this[_0x8a58('0x18')]:0x0;var _0x4b5012={'id':this['id'],'available':this[_0x8a58('0x18')],'loggedIn':this[_0x8a58('0x14')],'name':this['name'],'paused':this[_0x8a58('0x17')],'waiting':this[_0x8a58('0xe')]};var _0x622df3=md5(JSON[_0x8a58('0x19')](_0x4b5012));if(this[_0x8a58('0x0')]!==_0x622df3){this[_0x8a58('0x0')]=_0x622df3;io['to'](util[_0x8a58('0x1a')](_0x8a58('0x1b'),_0x4b5012[_0x8a58('0x8')]))[_0x8a58('0x1c')](_0x8a58('0x1d'),_0x4b5012);}};module[_0x8a58('0x1e')]=SmsQueue; \ No newline at end of file +var _0x6fad=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','updateRealtime','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis'];(function(_0x33a7ca,_0x13eced){var _0x333604=function(_0x5e0cfe){while(--_0x5e0cfe){_0x33a7ca['push'](_0x33a7ca['shift']());}};_0x333604(++_0x13eced);}(_0x6fad,0x174));var _0xd6fa=function(_0x5c2eac,_0x566843){_0x5c2eac=_0x5c2eac-0x0;var _0x7f47f9=_0x6fad[_0x5c2eac];return _0x7f47f9;};'use strict';var _=require(_0xd6fa('0x0'));var md5=require(_0xd6fa('0x1'));var util=require(_0xd6fa('0x2'));var Redis=require(_0xd6fa('0x3'));var config=require('../../../config/environment');config[_0xd6fa('0x4')]=_['defaults'](config[_0xd6fa('0x4')],{'host':_0xd6fa('0x5'),'port':0x18eb});var io=require(_0xd6fa('0x6'))(new Redis(config[_0xd6fa('0x4')]));function SmsQueue(_0x58325c){this['id']=_0x58325c['id']||0x0;this[_0xd6fa('0x7')]=_0x58325c[_0xd6fa('0x7')]||'';this[_0xd6fa('0x8')]=_0x58325c[_0xd6fa('0x8')]||0xa;this['strategy']=_0x58325c[_0xd6fa('0x9')]||'beepall';this[_0xd6fa('0xa')]=_0x58325c[_0xd6fa('0xa')];this[_0xd6fa('0xb')]={};this[_0xd6fa('0xc')]=0x0;this[_0xd6fa('0x1')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xd6fa('0xd')][_0xd6fa('0xe')]=function(){var _0x4e91f4=this[_0xd6fa('0xb')][_0xd6fa('0xf')];this['mapAgentsId']=_['map'](this[_0xd6fa('0xa')],'id');this['mapAgentsId']['_rr']=_0x4e91f4;};SmsQueue[_0xd6fa('0xd')][_0xd6fa('0x10')]=function(){this[_0xd6fa('0x11')]=0x0;this[_0xd6fa('0x12')]=0x0;for(var _0x3cd6fa=0x0;_0x3cd6fa=0x0?this['available']:0x0;var _0xe458aa={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd6fa('0x11')],'name':this['name'],'paused':this[_0xd6fa('0x12')],'waiting':this[_0xd6fa('0xc')]};var _0x2ee97a=md5(JSON[_0xd6fa('0x17')](_0xe458aa));if(this[_0xd6fa('0x1')]!==_0x2ee97a){this[_0xd6fa('0x1')]=_0x2ee97a;io['to'](util[_0xd6fa('0x18')](_0xd6fa('0x19'),_0xe458aa[_0xd6fa('0x7')]))[_0xd6fa('0x1a')](_0xd6fa('0x1b'),_0xe458aa);}};module[_0xd6fa('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 509ae00..3530a23 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 _0x62da=['paused','length','online','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x43ea9e,_0x4ba4d2){var _0x19252a=function(_0x20b20e){while(--_0x20b20e){_0x43ea9e['push'](_0x43ea9e['shift']());}};_0x19252a(++_0x4ba4d2);}(_0x62da,0xe9));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xa62d('0x0'));var Redis=require(_0xa62d('0x1'));var config=require(_0xa62d('0x2'));config[_0xa62d('0x3')]=_['defaults'](config['redis'],{'host':_0xa62d('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa62d('0x3')]));function WhatsappQueue(_0x5dc23f){this['id']=_0x5dc23f['id']||0x0;this['name']=_0x5dc23f[_0xa62d('0x5')]||'';this['timeout']=_0x5dc23f[_0xa62d('0x6')]||0xa;this[_0xa62d('0x7')]=_0x5dc23f[_0xa62d('0x7')]||_0xa62d('0x8');this[_0xa62d('0x9')]=_0x5dc23f[_0xa62d('0x9')];this[_0xa62d('0xa')]={};this[_0xa62d('0xb')]=0x0;this[_0xa62d('0xc')]='';this[_0xa62d('0xd')]();this[_0xa62d('0xe')]();}WhatsappQueue[_0xa62d('0xf')][_0xa62d('0xd')]=function(){var _0x52411c=this[_0xa62d('0xa')][_0xa62d('0x10')];this[_0xa62d('0xa')]=_[_0xa62d('0x11')](this[_0xa62d('0x9')],'id');this[_0xa62d('0xa')][_0xa62d('0x10')]=_0x52411c;};WhatsappQueue[_0xa62d('0xf')][_0xa62d('0xe')]=function(){this[_0xa62d('0x12')]=0x0;this[_0xa62d('0x13')]=0x0;for(var _0x499d8f=0x0;_0x499d8f=0x0?this[_0xa62d('0x16')]:0x0;var _0x205146={'id':this['id'],'available':this[_0xa62d('0x16')],'loggedIn':this[_0xa62d('0x12')],'name':this[_0xa62d('0x5')],'paused':this[_0xa62d('0x13')],'waiting':this[_0xa62d('0xb')]};var _0x11712c=md5(JSON[_0xa62d('0x17')](_0x205146));if(this[_0xa62d('0xc')]!==_0x11712c){this[_0xa62d('0xc')]=_0x11712c;io['to'](util['format'](_0xa62d('0x18'),_0x205146[_0xa62d('0x5')]))[_0xa62d('0x19')](_0xa62d('0x1a'),_0x205146);}};module[_0xa62d('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0xd9c6=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','prototype','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','length','online','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd9c6,0x1af));var _0x6d9c=function(_0x34ca1e,_0x3957ea){_0x34ca1e=_0x34ca1e-0x0;var _0xe83d8f=_0xd9c6[_0x34ca1e];return _0xe83d8f;};'use strict';var _=require(_0x6d9c('0x0'));var md5=require(_0x6d9c('0x1'));var util=require(_0x6d9c('0x2'));var Redis=require(_0x6d9c('0x3'));var config=require(_0x6d9c('0x4'));config[_0x6d9c('0x5')]=_['defaults'](config[_0x6d9c('0x5')],{'host':_0x6d9c('0x6'),'port':0x18eb});var io=require(_0x6d9c('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x508a46){this['id']=_0x508a46['id']||0x0;this[_0x6d9c('0x8')]=_0x508a46[_0x6d9c('0x8')]||'';this[_0x6d9c('0x9')]=_0x508a46['timeout']||0xa;this[_0x6d9c('0xa')]=_0x508a46[_0x6d9c('0xa')]||'beepall';this[_0x6d9c('0xb')]=_0x508a46[_0x6d9c('0xb')];this['mapAgentsId']={};this[_0x6d9c('0xc')]=0x0;this['md5']='';this[_0x6d9c('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x6d9c('0xe')][_0x6d9c('0xd')]=function(){var _0x149fc1=this['mapAgentsId'][_0x6d9c('0xf')];this[_0x6d9c('0x10')]=_[_0x6d9c('0x11')](this[_0x6d9c('0xb')],'id');this[_0x6d9c('0x10')]['_rr']=_0x149fc1;};WhatsappQueue[_0x6d9c('0xe')][_0x6d9c('0x12')]=function(){this[_0x6d9c('0x13')]=0x0;this[_0x6d9c('0x14')]=0x0;for(var _0x1e5a20=0x0;_0x1e5a20=0x0?this[_0x6d9c('0x17')]:0x0;var _0x24088b={'id':this['id'],'available':this[_0x6d9c('0x17')],'loggedIn':this[_0x6d9c('0x13')],'name':this[_0x6d9c('0x8')],'paused':this[_0x6d9c('0x14')],'waiting':this[_0x6d9c('0xc')]};var _0x4c9d88=md5(JSON[_0x6d9c('0x18')](_0x24088b));if(this[_0x6d9c('0x1')]!==_0x4c9d88){this['md5']=_0x4c9d88;io['to'](util[_0x6d9c('0x19')]('whatsapp:queue:%s',_0x24088b[_0x6d9c('0x8')]))[_0x6d9c('0x1a')](_0x6d9c('0x1b'),_0x24088b);}};module[_0x6d9c('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 840941e..a338e80 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 47978a4..1720d82 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 _0xc60f=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0xc60f,0xd6));var _0xfc60=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xc60f[_0x16629d];return _0x56ccee;};'use strict';var client=require(_0xfc60('0x0'));exports['update']=function(_0x70ab88,_0x1d73ee){return client[_0xfc60('0x1')](_0xfc60('0x2'),{'body':_0x1d73ee,'options':{'where':{'id':_0x70ab88}},'log':_0xfc60('0x3')});};exports['addTags']=function(_0x370f2d,_0x13db78){return client['Request'](_0xfc60('0x4'),{'body':_0x13db78,'options':{'where':{'id':_0x370f2d}},'log':_0xfc60('0x5')});}; \ No newline at end of file +var _0xaa05=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x21eb4e,_0x3345fe){var _0x42fabc=function(_0x4f6f63){while(--_0x4f6f63){_0x21eb4e['push'](_0x21eb4e['shift']());}};_0x42fabc(++_0x3345fe);}(_0xaa05,0xde));var _0x5aa0=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0xaa05[_0x3cb3ca];return _0x214366;};'use strict';var client=require(_0x5aa0('0x0'));exports[_0x5aa0('0x1')]=function(_0xb57857,_0x5084a0){return client[_0x5aa0('0x2')](_0x5aa0('0x3'),{'body':_0x5084a0,'options':{'where':{'id':_0xb57857}},'log':_0x5aa0('0x4')});};exports[_0x5aa0('0x5')]=function(_0x21d67c,_0x3453cc){return client[_0x5aa0('0x2')](_0x5aa0('0x6'),{'body':_0x3453cc,'options':{'where':{'id':_0x21d67c}},'log':_0x5aa0('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4f03d75..228e7e4 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 _0x860a=['createChatMessage'];(function(_0xe3d4a2,_0x5dbf95){var _0x131efb=function(_0x90cd0){while(--_0x90cd0){_0xe3d4a2['push'](_0xe3d4a2['shift']());}};_0x131efb(++_0x5dbf95);}(_0x860a,0xa4));var _0xa860=function(_0x5645f7,_0x32c821){_0x5645f7=_0x5645f7-0x0;var _0x30ee8a=_0x860a[_0x5645f7];return _0x30ee8a;};'use strict';var client=require('../client');exports['create']=function(_0x3e1579){return client['Request']('CreateChatMessage',{'body':_0x3e1579,'log':_0xa860('0x0')});}; \ No newline at end of file +var _0x3a40=['create'];(function(_0x3e36c5,_0xdfea77){var _0x709c1c=function(_0x37097d){while(--_0x37097d){_0x3e36c5['push'](_0x3e36c5['shift']());}};_0x709c1c(++_0xdfea77);}(_0x3a40,0x17f));var _0x03a4=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x3a40[_0x2aec52];return _0x3b8835;};'use strict';var client=require('../client');exports[_0x03a4('0x0')]=function(_0x26cf5a){return client['Request']('CreateChatMessage',{'body':_0x26cf5a,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3478f76..c1a333c 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 _0x99fb=['chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy','Agents'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0x99fb,0x92));var _0xb99f=function(_0x464068,_0x191c82){_0x464068=_0x464068-0x0;var _0x1bf627=_0x99fb[_0x464068];return _0x1bf627;};'use strict';var client=require(_0xb99f('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xb99f('0x1')](_0xb99f('0x2'),{'options':{'raw':![],'attributes':['id',_0xb99f('0x3'),_0xb99f('0x4'),_0xb99f('0x5')],'include':[{'model':'User','as':_0xb99f('0x6'),'attributes':['id',_0xb99f('0x3'),'online',_0xb99f('0x7')]}]},'log':_0xb99f('0x8')});};}; \ No newline at end of file +var _0xb38e=['name','timeout','strategy','Agents','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x3e4cbb,_0x1ec2fd){var _0x78c593=function(_0x4398e6){while(--_0x4398e6){_0x3e4cbb['push'](_0x3e4cbb['shift']());}};_0x78c593(++_0x1ec2fd);}(_0xb38e,0xa7));var _0xeb38=function(_0x44ce69,_0x23fbb9){_0x44ce69=_0x44ce69-0x0;var _0x5c9907=_0xb38e[_0x44ce69];return _0x5c9907;};'use strict';var client=require(_0xeb38('0x0'));exports[_0xeb38('0x1')]=function(){return function(){return client[_0xeb38('0x2')](_0xeb38('0x3'),{'options':{'raw':![],'attributes':['id',_0xeb38('0x4'),_0xeb38('0x5'),_0xeb38('0x6')],'include':[{'model':'User','as':_0xeb38('0x7'),'attributes':['id',_0xeb38('0x4'),'online',_0xeb38('0x8')]}]},'log':_0xeb38('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 950b946..cde6311 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 _0x92e8=['update','UpdateChatQueueReport','../client','Request','CreateChatQueueReport'];(function(_0x68fff3,_0x5817c){var _0x2a1694=function(_0x3a7d12){while(--_0x3a7d12){_0x68fff3['push'](_0x68fff3['shift']());}};_0x2a1694(++_0x5817c);}(_0x92e8,0x7f));var _0x892e=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x92e8[_0x2212d1];return _0x15eec5;};'use strict';var client=require(_0x892e('0x0'));exports['create']=function(_0x5b0726){return client[_0x892e('0x1')]('CreateChatQueueReport',{'body':_0x5b0726,'log':_0x892e('0x2')});};exports[_0x892e('0x3')]=function(_0x2cb68f,_0xe95e5f){return client[_0x892e('0x1')](_0x892e('0x4'),{'body':_0xe95e5f,'options':{'where':{'uniqueid':_0x2cb68f},'order':[['id','DESC']],'limit':0x1},'log':_0x892e('0x4')});}; \ No newline at end of file +var _0x4ef1=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x24f578,_0x421f1e){var _0x1cdc5c=function(_0x475289){while(--_0x475289){_0x24f578['push'](_0x24f578['shift']());}};_0x1cdc5c(++_0x421f1e);}(_0x4ef1,0xeb));var _0x14ef=function(_0x294975,_0xba7309){_0x294975=_0x294975-0x0;var _0x523628=_0x4ef1[_0x294975];return _0x523628;};'use strict';var client=require(_0x14ef('0x0'));exports[_0x14ef('0x1')]=function(_0x52e89c){return client[_0x14ef('0x2')](_0x14ef('0x3'),{'body':_0x52e89c,'log':_0x14ef('0x3')});};exports[_0x14ef('0x4')]=function(_0x168fd8,_0x43a716){return client[_0x14ef('0x2')](_0x14ef('0x5'),{'body':_0x43a716,'options':{'where':{'uniqueid':_0x168fd8},'order':[['id',_0x14ef('0x6')]],'limit':0x1},'log':_0x14ef('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index f498f47..2a4163e 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7a54,0x106));var _0x47a5=function(_0x96f25c,_0x5c6343){_0x96f25c=_0x96f25c-0x0;var _0x3a8135=_0x7a54[_0x96f25c];return _0x3a8135;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x7a54,0x106));var _0x47a5=function(_0x4f1f12,_0x353f75){_0x4f1f12=_0x4f1f12-0x0;var _0x40f132=_0x7a54[_0x4f1f12];return _0x40f132;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 773d472..2e277ad 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 _0xb96d=['createFaxMessage','Request'];(function(_0x53653b,_0x437e28){var _0x52f1e5=function(_0xa56893){while(--_0xa56893){_0x53653b['push'](_0x53653b['shift']());}};_0x52f1e5(++_0x437e28);}(_0xb96d,0x1b3));var _0xdb96=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0xb96d[_0x56f7e2];return _0x36240b;};'use strict';var client=require('../client');exports['create']=function(_0x4b170a){return client[_0xdb96('0x0')]('CreateFaxMessage',{'body':_0x4b170a,'log':_0xdb96('0x1')});}; \ No newline at end of file +var _0xdabd=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdabd,0x1dc));var _0xddab=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xdabd[_0x2a5099];return _0x2802f1;};'use strict';var client=require(_0xddab('0x0'));exports[_0xddab('0x1')]=function(_0x503be8){return client['Request'](_0xddab('0x2'),{'body':_0x503be8,'log':_0xddab('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d049b4b..9a2fead 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 _0x7197=['Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name','strategy','User'];(function(_0x5ba3a8,_0x548216){var _0x12dbbb=function(_0x3840c0){while(--_0x3840c0){_0x5ba3a8['push'](_0x5ba3a8['shift']());}};_0x12dbbb(++_0x548216);}(_0x7197,0xe4));var _0x7719=function(_0x4622aa,_0x1b52b6){_0x4622aa=_0x4622aa-0x0;var _0x4e603a=_0x7197[_0x4622aa];return _0x4e603a;};'use strict';var client=require('../client');exports[_0x7719('0x0')]=function(){return function(){return client[_0x7719('0x1')](_0x7719('0x2'),{'options':{'raw':![],'attributes':['id',_0x7719('0x3'),'timeout',_0x7719('0x4')],'include':[{'model':_0x7719('0x5'),'as':_0x7719('0x6'),'attributes':['id','name',_0x7719('0x7'),_0x7719('0x8')]}]},'log':_0x7719('0x0')});};}; \ No newline at end of file +var _0xd6cc=['online','faxPause','../client','getFaxQueues','Request','name','strategy','User'];(function(_0x58d200,_0xeaabb1){var _0x1f7e8d=function(_0x3af40a){while(--_0x3af40a){_0x58d200['push'](_0x58d200['shift']());}};_0x1f7e8d(++_0xeaabb1);}(_0xd6cc,0x1ea));var _0xcd6c=function(_0x1233d2,_0x5efbb1){_0x1233d2=_0x1233d2-0x0;var _0x44af31=_0xd6cc[_0x1233d2];return _0x44af31;};'use strict';var client=require(_0xcd6c('0x0'));exports[_0xcd6c('0x1')]=function(){return function(){return client[_0xcd6c('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xcd6c('0x3'),'timeout',_0xcd6c('0x4')],'include':[{'model':_0xcd6c('0x5'),'as':'Agents','attributes':['id','name',_0xcd6c('0x6'),_0xcd6c('0x7')]}]},'log':_0xcd6c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 0443ae0..994b162 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 _0x244d=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x244d,0x168));var _0xd244=function(_0x29a3fe,_0x123a8c){_0x29a3fe=_0x29a3fe-0x0;var _0x2361e6=_0x244d[_0x29a3fe];return _0x2361e6;};'use strict';var client=require(_0xd244('0x0'));exports[_0xd244('0x1')]=function(_0x3f2767){return client[_0xd244('0x2')](_0xd244('0x3'),{'body':_0x3f2767,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x3c6d75,_0x228a3e){return client['Request'](_0xd244('0x4'),{'body':_0x228a3e,'options':{'where':{'uniqueid':_0x3c6d75},'order':[['id',_0xd244('0x5')]],'limit':0x1},'log':_0xd244('0x4')});}; \ No newline at end of file +var _0x7c75=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x7c75,0x1dd));var _0x57c7=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x7c75[_0x3ea913];return _0x2b4f28;};'use strict';var client=require(_0x57c7('0x0'));exports[_0x57c7('0x1')]=function(_0x479320){return client[_0x57c7('0x2')](_0x57c7('0x3'),{'body':_0x479320,'log':'CreateFaxQueueReport'});};exports[_0x57c7('0x4')]=function(_0x44f8aa,_0x156360){return client[_0x57c7('0x2')](_0x57c7('0x5'),{'body':_0x156360,'options':{'where':{'uniqueid':_0x44f8aa},'order':[['id',_0x57c7('0x6')]],'limit':0x1},'log':_0x57c7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ad14c74..b1092a4 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 _0x6d8f=['name','Interval','Intervals','interval','getIntervals','Request'];(function(_0x151636,_0x21f9b6){var _0xf1005c=function(_0x493408){while(--_0x493408){_0x151636['push'](_0x151636['shift']());}};_0xf1005c(++_0x21f9b6);}(_0x6d8f,0x6a));var _0xf6d8=function(_0x353dd6,_0x396d9a){_0x353dd6=_0x353dd6-0x0;var _0x34aef3=_0x6d8f[_0x353dd6];return _0x34aef3;};'use strict';var client=require('../client');exports[_0xf6d8('0x0')]=function(){return function(){return client[_0xf6d8('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf6d8('0x2')],'include':[{'model':_0xf6d8('0x3'),'as':_0xf6d8('0x4'),'attributes':['id',_0xf6d8('0x2'),_0xf6d8('0x5')]}]},'log':_0xf6d8('0x0')});};}; \ No newline at end of file +var _0xd040=['../client','GetInterval','name','Interval','Intervals','getIntervals'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xd040,0xf6));var _0x0d04=function(_0x23e954,_0x13d9ce){_0x23e954=_0x23e954-0x0;var _0xfbf2fa=_0xd040[_0x23e954];return _0xfbf2fa;};'use strict';var client=require(_0x0d04('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x0d04('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0d04('0x2')],'include':[{'model':_0x0d04('0x3'),'as':_0x0d04('0x4'),'attributes':['id',_0x0d04('0x2'),'interval']}]},'log':_0x0d04('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index e66dfef..bf31835 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 _0x7880=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x7880,0x1f4));var _0x0788=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x7880[_0x531cb8];return _0x5cf297;};'use strict';var client=require('../client');exports[_0x0788('0x0')]=function(_0x219c25,_0x841a33){return client[_0x0788('0x1')](_0x0788('0x2'),{'body':_0x841a33,'options':{'where':{'id':_0x219c25}},'log':_0x0788('0x3')});};exports['addTags']=function(_0x3925a6,_0x1e0814){return client[_0x0788('0x1')](_0x0788('0x4'),{'body':_0x1e0814,'options':{'where':{'id':_0x3925a6}},'log':_0x0788('0x5')});}; \ No newline at end of file +var _0x4137=['updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var client=require(_0x7413('0x0'));exports[_0x7413('0x1')]=function(_0x370399,_0x4f372c){return client[_0x7413('0x2')](_0x7413('0x3'),{'body':_0x4f372c,'options':{'where':{'id':_0x370399}},'log':_0x7413('0x4')});};exports[_0x7413('0x5')]=function(_0x258255,_0x3dc48a){return client[_0x7413('0x2')](_0x7413('0x6'),{'body':_0x3dc48a,'options':{'where':{'id':_0x258255}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 07e0db1..e6ebd2d 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 _0x8817=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x37313b,_0x2ea929){var _0x2e85fb=function(_0x90aa2c){while(--_0x90aa2c){_0x37313b['push'](_0x37313b['shift']());}};_0x2e85fb(++_0x2ea929);}(_0x8817,0x129));var _0x7881=function(_0x4e4295,_0x17f3a7){_0x4e4295=_0x4e4295-0x0;var _0x1060a5=_0x8817[_0x4e4295];return _0x1060a5;};'use strict';var client=require(_0x7881('0x0'));exports[_0x7881('0x1')]=function(_0x471f1d){return client[_0x7881('0x2')](_0x7881('0x3'),{'body':_0x471f1d,'log':_0x7881('0x4')});}; \ No newline at end of file +var _0xcef7=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0xcef7,0x1ac));var _0x7cef=function(_0x507abb,_0x16a906){_0x507abb=_0x507abb-0x0;var _0x3cf7ec=_0xcef7[_0x507abb];return _0x3cf7ec;};'use strict';var client=require(_0x7cef('0x0'));exports[_0x7cef('0x1')]=function(_0x8ccabc){return client[_0x7cef('0x2')](_0x7cef('0x3'),{'body':_0x8ccabc,'log':_0x7cef('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b0f1a84..e63d21b 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 _0x96a3=['getMailQueues','name','timeout','strategy','User','Agents','../client'];(function(_0x56721d,_0x67c8d2){var _0x11d345=function(_0x17246a){while(--_0x17246a){_0x56721d['push'](_0x56721d['shift']());}};_0x11d345(++_0x67c8d2);}(_0x96a3,0x14f));var _0x396a=function(_0x2299ca,_0x19f037){_0x2299ca=_0x2299ca-0x0;var _0x5a7937=_0x96a3[_0x2299ca];return _0x5a7937;};'use strict';var client=require(_0x396a('0x0'));exports[_0x396a('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x396a('0x2'),_0x396a('0x3'),_0x396a('0x4')],'include':[{'model':_0x396a('0x5'),'as':_0x396a('0x6'),'attributes':['id',_0x396a('0x2'),'online','mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x4e81=['name','timeout','strategy','User','getMailQueues','../client','Request','GetMailQueue'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0x4e81,0x1b5));var _0x14e8=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x4e81[_0x4d35f3];return _0x382fea;};'use strict';var client=require(_0x14e8('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x14e8('0x1')](_0x14e8('0x2'),{'options':{'raw':![],'attributes':['id',_0x14e8('0x3'),_0x14e8('0x4'),_0x14e8('0x5')],'include':[{'model':_0x14e8('0x6'),'as':'Agents','attributes':['id','name','online','mailPause']}]},'log':_0x14e8('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index c7f2ef8..b6d93b1 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 _0x4c0d=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x4c0d,0x8c));var _0xd4c0=function(_0x3bb719,_0x2c6fa9){_0x3bb719=_0x3bb719-0x0;var _0x17f665=_0x4c0d[_0x3bb719];return _0x17f665;};'use strict';var client=require(_0xd4c0('0x0'));exports[_0xd4c0('0x1')]=function(_0x1316c8){return client[_0xd4c0('0x2')](_0xd4c0('0x3'),{'body':_0x1316c8,'log':_0xd4c0('0x3')});};exports[_0xd4c0('0x4')]=function(_0x13c05f,_0x127712){return client[_0xd4c0('0x2')](_0xd4c0('0x5'),{'body':_0x127712,'options':{'where':{'uniqueid':_0x13c05f},'order':[['id',_0xd4c0('0x6')]],'limit':0x1},'log':_0xd4c0('0x5')});}; \ No newline at end of file +var _0x09a6=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x1771b2,_0x1c4112){var _0x3e074c=function(_0x2fe073){while(--_0x2fe073){_0x1771b2['push'](_0x1771b2['shift']());}};_0x3e074c(++_0x1c4112);}(_0x09a6,0xc9));var _0x609a=function(_0x294c1c,_0x567301){_0x294c1c=_0x294c1c-0x0;var _0x1e7943=_0x09a6[_0x294c1c];return _0x1e7943;};'use strict';var client=require(_0x609a('0x0'));exports[_0x609a('0x1')]=function(_0x12f474){return client[_0x609a('0x2')](_0x609a('0x3'),{'body':_0x12f474,'log':'CreateMailQueueReport'});};exports[_0x609a('0x4')]=function(_0x2fb67c,_0x3aaec4){return client['Request'](_0x609a('0x5'),{'body':_0x3aaec4,'options':{'where':{'uniqueid':_0x2fb67c},'order':[['id',_0x609a('0x6')]],'limit':0x1},'log':_0x609a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 39fbd99..474202c 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 _0xaaf4=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','../client','update','Request'];(function(_0x4e9fae,_0x1bbb00){var _0x1ba0b4=function(_0x912736){while(--_0x912736){_0x4e9fae['push'](_0x4e9fae['shift']());}};_0x1ba0b4(++_0x1bbb00);}(_0xaaf4,0x1cb));var _0x4aaf=function(_0x3c193b,_0x19a05b){_0x3c193b=_0x3c193b-0x0;var _0xa5c7e8=_0xaaf4[_0x3c193b];return _0xa5c7e8;};'use strict';var client=require(_0x4aaf('0x0'));exports[_0x4aaf('0x1')]=function(_0x328ae8,_0x323a47){return client[_0x4aaf('0x2')](_0x4aaf('0x3'),{'body':_0x323a47,'options':{'where':{'id':_0x328ae8}},'log':_0x4aaf('0x4')});};exports['addTags']=function(_0x25b7d9,_0x19fc7f){return client[_0x4aaf('0x2')](_0x4aaf('0x5'),{'body':_0x19fc7f,'options':{'where':{'id':_0x25b7d9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xe96b=['AddTagsToOpenchannelInteraction','../client','update','Request','updateOpenchannelInteraction','addTags'];(function(_0xe4f036,_0x347728){var _0x49a33f=function(_0x1baf43){while(--_0x1baf43){_0xe4f036['push'](_0xe4f036['shift']());}};_0x49a33f(++_0x347728);}(_0xe96b,0xe5));var _0xbe96=function(_0x17561f,_0x5f445b){_0x17561f=_0x17561f-0x0;var _0x15e31f=_0xe96b[_0x17561f];return _0x15e31f;};'use strict';var client=require(_0xbe96('0x0'));exports[_0xbe96('0x1')]=function(_0x8c9c37,_0x289295){return client[_0xbe96('0x2')]('UpdateOpenchannelInteraction',{'body':_0x289295,'options':{'where':{'id':_0x8c9c37}},'log':_0xbe96('0x3')});};exports[_0xbe96('0x4')]=function(_0x3ec6b5,_0x1bcaf9){return client[_0xbe96('0x2')](_0xbe96('0x5'),{'body':_0x1bcaf9,'options':{'where':{'id':_0x3ec6b5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 44e380c..77125af 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 _0x80d7=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x80d7,0x12a));var _0x780d=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0x80d7[_0x367361];return _0x195d2d;};'use strict';var client=require(_0x780d('0x0'));exports[_0x780d('0x1')]=function(_0x141486){return client[_0x780d('0x2')](_0x780d('0x3'),{'body':_0x141486,'log':_0x780d('0x4')});}; \ No newline at end of file +var _0xb3dd=['create','CreateOpenchannelMessage','../client'];(function(_0xcdb4c,_0x52f24e){var _0xbf4242=function(_0x48bea7){while(--_0x48bea7){_0xcdb4c['push'](_0xcdb4c['shift']());}};_0xbf4242(++_0x52f24e);}(_0xb3dd,0x1e2));var _0xdb3d=function(_0x19e598,_0x47dcbc){_0x19e598=_0x19e598-0x0;var _0x176c36=_0xb3dd[_0x19e598];return _0x176c36;};'use strict';var client=require(_0xdb3d('0x0'));exports[_0xdb3d('0x1')]=function(_0x104af1){return client['Request'](_0xdb3d('0x2'),{'body':_0x104af1,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 468636d..d45e077 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 _0x7945=['timeout','strategy','Agents','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x324287,_0x130695){var _0x3ad064=function(_0xfb9fcf){while(--_0xfb9fcf){_0x324287['push'](_0x324287['shift']());}};_0x3ad064(++_0x130695);}(_0x7945,0x112));var _0x5794=function(_0x10dfd7,_0x119f0c){_0x10dfd7=_0x10dfd7-0x0;var _0x1080f6=_0x7945[_0x10dfd7];return _0x1080f6;};'use strict';var client=require(_0x5794('0x0'));exports[_0x5794('0x1')]=function(){return function(){return client[_0x5794('0x2')](_0x5794('0x3'),{'options':{'raw':![],'attributes':['id',_0x5794('0x4'),_0x5794('0x5'),_0x5794('0x6')],'include':[{'model':'User','as':_0x5794('0x7'),'attributes':['id',_0x5794('0x4'),_0x5794('0x8'),'openchannelPause']}]},'log':_0x5794('0x1')});};}; \ No newline at end of file +var _0x096a=['name','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','timeout','User','Agents'];(function(_0x3d8304,_0x3a115c){var _0x1ca763=function(_0x1ebff2){while(--_0x1ebff2){_0x3d8304['push'](_0x3d8304['shift']());}};_0x1ca763(++_0x3a115c);}(_0x096a,0x1b2));var _0xa096=function(_0x49f64d,_0x3ae938){_0x49f64d=_0x49f64d-0x0;var _0x225f7e=_0x096a[_0x49f64d];return _0x225f7e;};'use strict';var client=require(_0xa096('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xa096('0x1')](_0xa096('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xa096('0x3'),'strategy'],'include':[{'model':_0xa096('0x4'),'as':_0xa096('0x5'),'attributes':['id',_0xa096('0x6'),_0xa096('0x7'),_0xa096('0x8')]}]},'log':_0xa096('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index ddeffca..4a0cf88 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 _0xfe56=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x386a41,_0xf04c1a){var _0x4c8272=function(_0x516220){while(--_0x516220){_0x386a41['push'](_0x386a41['shift']());}};_0x4c8272(++_0xf04c1a);}(_0xfe56,0x9a));var _0x6fe5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe56[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x6fe5('0x0'));exports[_0x6fe5('0x1')]=function(_0x2093f7){return client[_0x6fe5('0x2')](_0x6fe5('0x3'),{'body':_0x2093f7,'log':_0x6fe5('0x3')});};exports['update']=function(_0x1d97cd,_0x371188){return client['Request'](_0x6fe5('0x4'),{'body':_0x371188,'options':{'where':{'uniqueid':_0x1d97cd},'order':[['id',_0x6fe5('0x5')]],'limit':0x1},'log':_0x6fe5('0x4')});}; \ No newline at end of file +var _0x2dd2=['DESC','../client','CreateOpenchannelQueueReport','Request'];(function(_0xd45691,_0x4c23dc){var _0x41cd79=function(_0x328bb5){while(--_0x328bb5){_0xd45691['push'](_0xd45691['shift']());}};_0x41cd79(++_0x4c23dc);}(_0x2dd2,0x89));var _0x22dd=function(_0x523955,_0x265494){_0x523955=_0x523955-0x0;var _0x1c1f0a=_0x2dd2[_0x523955];return _0x1c1f0a;};'use strict';var client=require(_0x22dd('0x0'));exports['create']=function(_0x3748a4){return client['Request'](_0x22dd('0x1'),{'body':_0x3748a4,'log':_0x22dd('0x1')});};exports['update']=function(_0x23615f,_0x2b7984){return client[_0x22dd('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x2b7984,'options':{'where':{'uniqueid':_0x23615f},'order':[['id',_0x22dd('0x3')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0f2da4d..538399c 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 _0x6c96=['UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','../client'];(function(_0x3a0152,_0x2fcc05){var _0x2e739a=function(_0x214855){while(--_0x214855){_0x3a0152['push'](_0x3a0152['shift']());}};_0x2e739a(++_0x2fcc05);}(_0x6c96,0x1c1));var _0x66c9=function(_0x4ab580,_0x39b0a9){_0x4ab580=_0x4ab580-0x0;var _0x548b63=_0x6c96[_0x4ab580];return _0x548b63;};'use strict';var client=require(_0x66c9('0x0'));exports['update']=function(_0x130ba8,_0x58d6e7){return client['Request'](_0x66c9('0x1'),{'body':_0x58d6e7,'options':{'where':{'id':_0x130ba8}},'log':_0x66c9('0x2')});};exports[_0x66c9('0x3')]=function(_0x37e814,_0x35b830){return client[_0x66c9('0x4')](_0x66c9('0x5'),{'body':_0x35b830,'options':{'where':{'id':_0x37e814}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xe77f=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xe77f,0xba));var _0xfe77=function(_0x1aceae,_0x1ebe91){_0x1aceae=_0x1aceae-0x0;var _0x3b7a40=_0xe77f[_0x1aceae];return _0x3b7a40;};'use strict';var client=require(_0xfe77('0x0'));exports[_0xfe77('0x1')]=function(_0x53bc15,_0x397a5c){return client[_0xfe77('0x2')]('UpdateSmsInteraction',{'body':_0x397a5c,'options':{'where':{'id':_0x53bc15}},'log':_0xfe77('0x3')});};exports[_0xfe77('0x4')]=function(_0x55a414,_0x150fc9){return client[_0xfe77('0x2')](_0xfe77('0x5'),{'body':_0x150fc9,'options':{'where':{'id':_0x55a414}},'log':_0xfe77('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index e7feb2b..a792e8a 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 _0x37ba=['CreateSmsMessage','../client'];(function(_0x975237,_0x347cbe){var _0x99e9e=function(_0x37c262){while(--_0x37c262){_0x975237['push'](_0x975237['shift']());}};_0x99e9e(++_0x347cbe);}(_0x37ba,0x113));var _0xa37b=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x37ba[_0x288f5e];return _0x476cc9;};'use strict';var client=require(_0xa37b('0x0'));exports['create']=function(_0x392392){return client['Request'](_0xa37b('0x1'),{'body':_0x392392,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x834a=['Request','createSmsMessage','../client','create'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x834a,0x126));var _0xa834=function(_0x164afa,_0x27f927){_0x164afa=_0x164afa-0x0;var _0x5c8e2a=_0x834a[_0x164afa];return _0x5c8e2a;};'use strict';var client=require(_0xa834('0x0'));exports[_0xa834('0x1')]=function(_0x508600){return client[_0xa834('0x2')]('CreateSmsMessage',{'body':_0x508600,'log':_0xa834('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index a605893..1101747 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x1d8a78,_0x5be480){var _0x300632=function(_0x587c2e){while(--_0x587c2e){_0x1d8a78['push'](_0x1d8a78['shift']());}};_0x300632(++_0x5be480);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x2bc1e7,_0x530b80){var _0x31f458=function(_0x11cd80){while(--_0x11cd80){_0x2bc1e7['push'](_0x2bc1e7['shift']());}};_0x31f458(++_0x530b80);}(_0xb7e7,0x121));var _0x7b7e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb7e7[_0x186376];return _0x2dbdd9;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 512a7bc..522a236 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x264319,_0xeda909){var _0x395f0f=function(_0x58b363){while(--_0x58b363){_0x264319['push'](_0x264319['shift']());}};_0x395f0f(++_0xeda909);}(_0x34e8,0x12c));var _0x834e=function(_0xc6ab4f,_0x459216){_0xc6ab4f=_0xc6ab4f-0x0;var _0x52a56d=_0x34e8[_0xc6ab4f];return _0x52a56d;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x1e33a4,_0x2b0573){var _0x28ad0b=function(_0x128a0e){while(--_0x128a0e){_0x1e33a4['push'](_0x1e33a4['shift']());}};_0x28ad0b(++_0x2b0573);}(_0x55ca,0x126));var _0xa55c=function(_0x160cd5,_0x19c58e){_0x160cd5=_0x160cd5-0x0;var _0x366763=_0x55ca[_0x160cd5];return _0x366763;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4490b2e..25f487b 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(_0x3b378f,_0x585dcd){var _0x1c6b60=function(_0x5d7057){while(--_0x5d7057){_0x3b378f['push'](_0x3b378f['shift']());}};_0x1c6b60(++_0x585dcd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x58d767,_0x3379c4){var _0x10da02=function(_0x43d6fb){while(--_0x43d6fb){_0x58d767['push'](_0x58d767['shift']());}};_0x10da02(++_0x3379c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 61705a3..a79dcef 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 _0x8921=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x4f9036,_0x38e6b4){var _0x5b35bc=function(_0x1d65a7){while(--_0x1d65a7){_0x4f9036['push'](_0x4f9036['shift']());}};_0x5b35bc(++_0x38e6b4);}(_0x8921,0x9a));var _0x1892=function(_0x5a7f34,_0x3fe9ea){_0x5a7f34=_0x5a7f34-0x0;var _0x1279cf=_0x8921[_0x5a7f34];return _0x1279cf;};'use strict';var client=require(_0x1892('0x0'));exports['update']=function(_0x2fa8a8,_0x37e629){return client[_0x1892('0x1')](_0x1892('0x2'),{'body':_0x37e629,'options':{'where':{'id':_0x2fa8a8}},'log':_0x1892('0x3')});};exports[_0x1892('0x4')]=function(_0x28a89b,_0x15aa1b){return client[_0x1892('0x1')](_0x1892('0x5'),{'body':_0x15aa1b,'options':{'where':{'id':_0x28a89b}},'log':_0x1892('0x6')});}; \ No newline at end of file +var _0xc21e=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x55a756,_0x48b9ba){var _0x40f535=function(_0x6aa12e){while(--_0x6aa12e){_0x55a756['push'](_0x55a756['shift']());}};_0x40f535(++_0x48b9ba);}(_0xc21e,0x1ca));var _0xec21=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc21e[_0x122ef9];return _0x42fba0;};'use strict';var client=require('../client');exports[_0xec21('0x0')]=function(_0x2f8bc2,_0x1aa991){return client[_0xec21('0x1')](_0xec21('0x2'),{'body':_0x1aa991,'options':{'where':{'id':_0x2f8bc2}},'log':_0xec21('0x3')});};exports['addTags']=function(_0x42881c,_0x3524f1){return client[_0xec21('0x1')](_0xec21('0x4'),{'body':_0x3524f1,'options':{'where':{'id':_0x42881c}},'log':_0xec21('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4d94496..7d252cc 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 _0xf35a=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xf35a,0x135));var _0xaf35=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xf35a[_0x3fa37f];return _0x5a01d5;};'use strict';var client=require(_0xaf35('0x0'));exports[_0xaf35('0x1')]=function(_0x391a39){return client[_0xaf35('0x2')](_0xaf35('0x3'),{'body':_0x391a39,'log':_0xaf35('0x4')});}; \ No newline at end of file +var _0x7bb8=['CreateWhatsappMessage','create','Request'];(function(_0x2b467e,_0x2a6b15){var _0x50453a=function(_0x16758c){while(--_0x16758c){_0x2b467e['push'](_0x2b467e['shift']());}};_0x50453a(++_0x2a6b15);}(_0x7bb8,0x1ed));var _0x87bb=function(_0x46f7ff,_0x3be51f){_0x46f7ff=_0x46f7ff-0x0;var _0x113e70=_0x7bb8[_0x46f7ff];return _0x113e70;};'use strict';var client=require('../client');exports[_0x87bb('0x0')]=function(_0x1df85f){return client[_0x87bb('0x1')](_0x87bb('0x2'),{'body':_0x1df85f,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 4407a27..5afaf37 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 _0xa0cc=['GetWhatsappQueue','name','timeout','strategy','User','whatsappPause','../client','getWhatsappQueues','Request'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xa0cc,0x1e3));var _0xca0c=function(_0x5044cd,_0x4f901d){_0x5044cd=_0x5044cd-0x0;var _0x40e4bc=_0xa0cc[_0x5044cd];return _0x40e4bc;};'use strict';var client=require(_0xca0c('0x0'));exports[_0xca0c('0x1')]=function(){return function(){return client[_0xca0c('0x2')](_0xca0c('0x3'),{'options':{'raw':![],'attributes':['id',_0xca0c('0x4'),_0xca0c('0x5'),_0xca0c('0x6')],'include':[{'model':_0xca0c('0x7'),'as':'Agents','attributes':['id','name','online',_0xca0c('0x8')]}]},'log':_0xca0c('0x1')});};}; \ No newline at end of file +var _0x8773=['timeout','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','name'];(function(_0x51d012,_0x425390){var _0x1e5639=function(_0x41d672){while(--_0x41d672){_0x51d012['push'](_0x51d012['shift']());}};_0x1e5639(++_0x425390);}(_0x8773,0x13c));var _0x3877=function(_0x5577f0,_0x1d04ab){_0x5577f0=_0x5577f0-0x0;var _0x4055fa=_0x8773[_0x5577f0];return _0x4055fa;};'use strict';var client=require(_0x3877('0x0'));exports[_0x3877('0x1')]=function(){return function(){return client[_0x3877('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x3877('0x3'),_0x3877('0x4'),_0x3877('0x5')],'include':[{'model':_0x3877('0x6'),'as':_0x3877('0x7'),'attributes':['id',_0x3877('0x3'),_0x3877('0x8'),_0x3877('0x9')]}]},'log':_0x3877('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 076ecfa..a1f480e 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 _0x97e8=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x1a2ae7,_0x2c13da){var _0x18e88f=function(_0x277c66){while(--_0x277c66){_0x1a2ae7['push'](_0x1a2ae7['shift']());}};_0x18e88f(++_0x2c13da);}(_0x97e8,0x195));var _0x897e=function(_0x379ac3,_0x151e37){_0x379ac3=_0x379ac3-0x0;var _0x392c9e=_0x97e8[_0x379ac3];return _0x392c9e;};'use strict';var client=require(_0x897e('0x0'));exports[_0x897e('0x1')]=function(_0x5f2681){return client[_0x897e('0x2')](_0x897e('0x3'),{'body':_0x5f2681,'log':'CreateWhatsappQueueReport'});};exports[_0x897e('0x4')]=function(_0x33194d,_0x168829){return client['Request'](_0x897e('0x5'),{'body':_0x168829,'options':{'where':{'uniqueid':_0x33194d},'order':[['id','DESC']],'limit':0x1},'log':_0x897e('0x5')});}; \ No newline at end of file +var _0x2173=['DESC','../client','Request','UpdateWhatsappQueueReport'];(function(_0x368538,_0x52c9d3){var _0x1b097b=function(_0x53388c){while(--_0x53388c){_0x368538['push'](_0x368538['shift']());}};_0x1b097b(++_0x52c9d3);}(_0x2173,0x189));var _0x3217=function(_0x457cff,_0x4beaf6){_0x457cff=_0x457cff-0x0;var _0x314e85=_0x2173[_0x457cff];return _0x314e85;};'use strict';var client=require(_0x3217('0x0'));exports['create']=function(_0xf760fc){return client['Request']('CreateWhatsappQueueReport',{'body':_0xf760fc,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x5688e5,_0x532052){return client[_0x3217('0x1')](_0x3217('0x2'),{'body':_0x532052,'options':{'where':{'uniqueid':_0x5688e5},'order':[['id',_0x3217('0x3')]],'limit':0x1},'log':_0x3217('0x2')});}; \ 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 008b357..861ef99 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 _0x63b2=['map','message','join','stop','find','agents','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','log','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','error','[%s][AGENT]\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x63b2,0xbd));var _0x263b=function(_0x29cec1,_0x4599fa){_0x29cec1=_0x29cec1-0x0;var _0x565964=_0x63b2[_0x29cec1];return _0x565964;};'use strict';var schema=require(_0x263b('0x0'));var _=require(_0x263b('0x1'));var util=require(_0x263b('0x2'));var seqqueue=require(_0x263b('0x3'));var logger=require(_0x263b('0x4'))(_0x263b('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x263b('0x6'),'required':!![],'message':_0x263b('0x7')},'timeout':{'type':_0x263b('0x8'),'message':_0x263b('0x9')}});function writeLog(_0x3dc621,_0xf18ace,_0x28e423){return logger[_0x263b('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x3dc621,_0xf18ace[_0x263b('0xb')],_0x28e423));}function handleFindAgent(_0x4dd337){return function(_0x1612e3){return _0x1612e3[_0x263b('0xb')][_0x263b('0xc')]()===_0x4dd337['toLowerCase']();};}exports['consequence']=function(_0x45fb6f,_0x107d12,_0x277f07,_0x167821){return function(_0x153a33){try{var _0x1d6e62={'name':_0x107d12[0x0],'timeout':_0x107d12[0x1]};var _0x35d272=queue['validate'](_0x1d6e62,{'typecast':!![]});if(_0x35d272['length']){logger[_0x263b('0xd')](_0x263b('0xe'),_0x45fb6f,_[_0x263b('0xf')](_0x35d272,_0x263b('0x10'))[_0x263b('0x11')](',\x20'));_0x153a33[_0x263b('0x12')]();}else{var _0x1b924b=_[_0x263b('0x13')](_0x277f07[_0x263b('0x14')],handleFindAgent(_0x1d6e62[_0x263b('0xb')]));if(_0x1b924b){var _0x56035e=(_0x1d6e62['timeout']||0xa)*0x3e8;var _0x2547e9,_0x2022a7;var _0x2726e2=seqqueue[_0x263b('0x15')](_0x56035e);_0x2726e2['id']=_0x45fb6f;_0x2726e2[_0x263b('0x16')]=_0x56035e;_0x2726e2['channel']=_0x167821[_0x263b('0x17')];writeLog(_0x45fb6f,_0x1b924b,util[_0x263b('0x18')](_0x263b('0x19'),_0x56035e));_0x277f07[_0x263b('0x1a')][_0x45fb6f]['on'](_0x263b('0x1b'),function(){logger[_0x263b('0xa')](_0x263b('0x1c'),_0x45fb6f);clearTimeout(_0x2022a7);_0x2022a7=undefined;_0x2726e2[_0x263b('0x1d')]();if(_0x277f07[_0x263b('0x1a')][_0x45fb6f]){delete _0x277f07[_0x263b('0x1a')][_0x45fb6f];}_0x153a33[_0x263b('0x12')]();});_0x277f07[_0x263b('0x1a')][_0x45fb6f]['on'](_0x263b('0x1e'),function(){if(_0x277f07['rules'][_0x45fb6f]){delete _0x277f07[_0x263b('0x1a')][_0x45fb6f];}});_0x2022a7=setTimeout(function(){logger[_0x263b('0xa')](_0x263b('0x1f'),_0x45fb6f);clearTimeout(_0x2022a7);_0x2726e2[_0x263b('0x1d')]();_0x153a33[_0x263b('0x20')]();},_0x56035e);strategy['agent'](_0x2726e2,_0x1b924b,_0x277f07,_0x167821);}else{logger[_0x263b('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x45fb6f,_0x1d6e62[_0x263b('0xb')]);_0x153a33[_0x263b('0x12')]();}}}catch(_0x36a656){console[_0x263b('0x21')](_0x36a656);logger[_0x263b('0xd')]('[%s][QUEUE]\x20%s',_0x45fb6f,_0x36a656['stack']);_0x153a33['stop']();}};}; \ No newline at end of file +var _0x628d=['channel','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','atimeout'];(function(_0x22fe82,_0x4779d6){var _0x365ca6=function(_0x47f4c1){while(--_0x47f4c1){_0x22fe82['push'](_0x22fe82['shift']());}};_0x365ca6(++_0x4779d6);}(_0x628d,0x12b));var _0xd628=function(_0x27761d,_0x2aea87){_0x27761d=_0x27761d-0x0;var _0x2b54bc=_0x628d[_0x27761d];return _0x2b54bc;};'use strict';var schema=require(_0xd628('0x0'));var _=require(_0xd628('0x1'));var util=require(_0xd628('0x2'));var seqqueue=require(_0xd628('0x3'));var logger=require(_0xd628('0x4'))(_0xd628('0x5'));var strategy=require(_0xd628('0x6'));var queue=schema({'name':{'type':_0xd628('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x13e3aa,_0x4b8c64,_0x337fda){return logger[_0xd628('0x8')](util['format'](_0xd628('0x9'),_0x13e3aa,_0x4b8c64[_0xd628('0xa')],_0x337fda));}function handleFindAgent(_0x5dab83){return function(_0x134b0f){return _0x134b0f[_0xd628('0xa')][_0xd628('0xb')]()===_0x5dab83[_0xd628('0xb')]();};}exports['consequence']=function(_0x10c226,_0x51dcc7,_0xc8dad9,_0x13c104){return function(_0x1b693c){try{var _0x4bba40={'name':_0x51dcc7[0x0],'timeout':_0x51dcc7[0x1]};var _0x5dfaed=queue[_0xd628('0x0')](_0x4bba40,{'typecast':!![]});if(_0x5dfaed['length']){logger[_0xd628('0xc')](_0xd628('0xd'),_0x10c226,_[_0xd628('0xe')](_0x5dfaed,'message')[_0xd628('0xf')](',\x20'));_0x1b693c[_0xd628('0x10')]();}else{var _0x5b4002=_[_0xd628('0x11')](_0xc8dad9[_0xd628('0x12')],handleFindAgent(_0x4bba40[_0xd628('0xa')]));if(_0x5b4002){var _0x4b9080=(_0x4bba40[_0xd628('0x13')]||0xa)*0x3e8;var _0x285d39,_0x45f260;var _0x197719=seqqueue['createQueue'](_0x4b9080);_0x197719['id']=_0x10c226;_0x197719[_0xd628('0x14')]=_0x4b9080;_0x197719[_0xd628('0x15')]=_0x13c104[_0xd628('0x15')];writeLog(_0x10c226,_0x5b4002,util['format']('START:%s',_0x4b9080));_0xc8dad9['rules'][_0x10c226]['on']('end',function(){logger[_0xd628('0x8')](_0xd628('0x16'),_0x10c226);clearTimeout(_0x45f260);_0x45f260=undefined;_0x197719[_0xd628('0x17')]();if(_0xc8dad9[_0xd628('0x18')][_0x10c226]){delete _0xc8dad9[_0xd628('0x18')][_0x10c226];}_0x1b693c[_0xd628('0x10')]();});_0xc8dad9[_0xd628('0x18')][_0x10c226]['on'](_0xd628('0x19'),function(){if(_0xc8dad9[_0xd628('0x18')][_0x10c226]){delete _0xc8dad9[_0xd628('0x18')][_0x10c226];}});_0x45f260=setTimeout(function(){logger['info'](_0xd628('0x1a'),_0x10c226);clearTimeout(_0x45f260);_0x197719[_0xd628('0x17')]();_0x1b693c[_0xd628('0x1b')]();},_0x4b9080);strategy[_0xd628('0x1c')](_0x197719,_0x5b4002,_0xc8dad9,_0x13c104);}else{logger[_0xd628('0xc')](_0xd628('0x1d'),_0x10c226,_0x4bba40[_0xd628('0xa')]);_0x1b693c['stop']();}}}catch(_0x340d78){console[_0xd628('0x1e')](_0x340d78);logger[_0xd628('0xc')]('[%s][QUEUE]\x20%s',_0x10c226,_0x340d78[_0xd628('0x1f')]);_0x1b693c[_0xd628('0x10')]();}};}; \ 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 de17105..938bfd5 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 _0x3085=['created','isEmpty','getMustacheRender','Message','create','then','info','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','amazonlex','providerName','providerResponse','dialogState','Failed','stop','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','interaction','chat','account','AccountId','upperFirst','InteractionId'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x3085,0x1eb));var _0x5308=function(_0x17bf38,_0x4a5ffd){_0x17bf38=_0x17bf38-0x0;var _0x5f592d=_0x3085[_0x17bf38];return _0x5f592d;};'use strict';var _=require(_0x5308('0x0'));var moment=require(_0x5308('0x1'));var AWS=require(_0x5308('0x2'));var utils=require(_0x5308('0x3'));var logger=require(_0x5308('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5308('0x5')),'mailMessage':require(_0x5308('0x6')),'smsMessage':require(_0x5308('0x7')),'faxMessage':require(_0x5308('0x8')),'whatsappMessage':require(_0x5308('0x9'))};exports[_0x5308('0xa')]=function(_0x3c8297,_0x34ab06){return function(_0x345bc5){try{if(!_[_0x5308('0xb')](this['interaction'][_0x5308('0xc')])){logger['info'](_0x5308('0xd'),_0x3c8297,_0x5308('0xe'));return _0x345bc5[_0x5308('0xf')]();}var _0x4622e1={'ContactId':this[_0x5308('0x10')]['id'],'sentAt':moment()[_0x5308('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x5308('0x12')};if(this[_0x5308('0x13')]===_0x5308('0x14')||this[_0x5308('0x13')]===_0x5308('0x15')){_0x4622e1[_0x5308('0x16')]=this[_0x5308('0x17')][_0x5308('0x16')];}var _0x119929=this[_0x5308('0x13')];if(_0x119929===_0x5308('0x18')){_0x4622e1['ChatWebsiteId']=this[_0x5308('0x19')]['id'];}else{_0x4622e1[_['upperFirst'](_0x119929)+_0x5308('0x1a')]=this[_0x5308('0x19')]['id'];}_0x4622e1[_[_0x5308('0x1b')](_0x119929)+_0x5308('0x1c')]=this[_0x5308('0x17')]['id'];if(this[_0x5308('0x17')][_0x5308('0x1d')]){var _0x43d5da=_0x34ab06[0x4];if(!_[_0x5308('0x1e')](_0x43d5da)){_0x4622e1['body']=utils[_0x5308('0x1f')](_0x43d5da,this);return rpc[_0x119929+_0x5308('0x20')][_0x5308('0x21')](_0x4622e1)[_0x5308('0x22')](function(_0x5abda3){logger[_0x5308('0x23')](_0x5308('0xd'),_0x3c8297,_0x4622e1[_0x5308('0x24')]);})[_0x5308('0x25')](function(_0x4fe03f){logger[_0x5308('0x26')](_0x5308('0xd'),_0x3c8297,JSON[_0x5308('0x27')](_0x4fe03f));})[_0x5308('0x28')](function(){logger[_0x5308('0x23')](_0x5308('0x29'),_0x3c8297);_0x345bc5['stop']();});}else{logger[_0x5308('0x23')](_0x5308('0x2a'),_0x3c8297);_0x345bc5['stop']();}}else{var _0x2309bc=this;var _0x225939=new AWS['LexRuntime']({'accessKeyId':_0x34ab06[0x0],'secretAccessKey':_0x34ab06[0x1],'region':_0x34ab06[0x2]});var _0x2af848={'botAlias':_0x5308('0x2b'),'botName':_0x34ab06[0x3],'inputText':this[_0x5308('0x2c')][_0x5308('0x24')],'userId':this[_0x5308('0x13')]+':'+this[_0x5308('0x17')]['id'][_0x5308('0x2d')]()};_0x225939['postText'](_0x2af848,function(_0x17bddd,_0x4b682c){if(_0x17bddd){logger[_0x5308('0x26')]('[%s][AMAZONLEX]\x20%s',_0x3c8297,_0x17bddd[_0x5308('0x2c')]);_0x345bc5[_0x5308('0xf')]();}else if(_0x4b682c&&_0x4b682c[_0x5308('0x2c')]){_0x2309bc[_0x5308('0x24')][_0x5308('0x2e')]=_0x4b682c;_0x4622e1['body']=_0x4b682c['message'];_0x4622e1[_0x5308('0x2f')]=_0x5308('0x2e');_0x4622e1[_0x5308('0x30')]=JSON['stringify'](_0x4b682c);return rpc[_0x119929+'Message'][_0x5308('0x21')](_0x4622e1)['then'](function(_0x3a1caa){logger[_0x5308('0x23')](_0x5308('0xd'),_0x3c8297,_0x4622e1[_0x5308('0x24')]);if(_0x4b682c[_0x5308('0x31')]==_0x5308('0x32')){_0x345bc5[_0x5308('0xf')]();}else{_0x345bc5[_0x5308('0x33')]();}})['catch'](function(_0x554383){logger[_0x5308('0x26')](_0x5308('0xd'),_0x3c8297,JSON['stringify'](_0x554383));_0x345bc5[_0x5308('0xf')]();});}else{_0x345bc5['next']();}});}}catch(_0x678884){logger[_0x5308('0x26')]('[%s][AMAZONLEX]\x20%s',_0x3c8297,JSON[_0x5308('0x27')](_0x678884));_0x345bc5['stop']();}};}; \ No newline at end of file +var _0x51bc=['error','providerName','amazonlex','providerResponse','dialogState','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','create','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x51bc,0xbf));var _0xc51b=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x51bc[_0x46ae5a];return _0x434986;};'use strict';var _=require(_0xc51b('0x0'));var moment=require(_0xc51b('0x1'));var AWS=require('aws-sdk');var utils=require(_0xc51b('0x2'));var logger=require(_0xc51b('0x3'))(_0xc51b('0x4'));var rpc={'chatMessage':require(_0xc51b('0x5')),'openchannelMessage':require(_0xc51b('0x6')),'mailMessage':require(_0xc51b('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x1e77e6,_0x1da8ef){return function(_0x275847){try{if(!_['isNil'](this['interaction'][_0xc51b('0x8')])){logger[_0xc51b('0x9')](_0xc51b('0xa'),_0x1e77e6,_0xc51b('0xb'));return _0x275847[_0xc51b('0xc')]();}var _0x4dbd2b={'ContactId':this[_0xc51b('0xd')]['id'],'sentAt':moment()[_0xc51b('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xc51b('0xf')};if(this[_0xc51b('0x10')]===_0xc51b('0x11')||this[_0xc51b('0x10')]==='whatsapp'){_0x4dbd2b[_0xc51b('0x12')]=this[_0xc51b('0x13')]['phone'];}var _0xacea61=this[_0xc51b('0x10')];if(_0xacea61==='chat'){_0x4dbd2b[_0xc51b('0x14')]=this[_0xc51b('0x15')]['id'];}else{_0x4dbd2b[_[_0xc51b('0x16')](_0xacea61)+_0xc51b('0x17')]=this[_0xc51b('0x15')]['id'];}_0x4dbd2b[_[_0xc51b('0x16')](_0xacea61)+_0xc51b('0x18')]=this[_0xc51b('0x13')]['id'];if(this[_0xc51b('0x13')][_0xc51b('0x19')]){var _0x3393ba=_0x1da8ef[0x4];if(!_[_0xc51b('0x1a')](_0x3393ba)){_0x4dbd2b[_0xc51b('0x1b')]=utils['getMustacheRender'](_0x3393ba,this);return rpc[_0xacea61+_0xc51b('0x1c')][_0xc51b('0x1d')](_0x4dbd2b)['then'](function(_0x45cd48){logger[_0xc51b('0x9')]('[%s][AMAZONLEX]\x20%s',_0x1e77e6,_0x4dbd2b['body']);})['catch'](function(_0x40a209){logger['error']('[%s][AMAZONLEX]\x20%s',_0x1e77e6,JSON[_0xc51b('0x1e')](_0x40a209));})[_0xc51b('0x1f')](function(){logger[_0xc51b('0x9')](_0xc51b('0x20'),_0x1e77e6);_0x275847[_0xc51b('0x21')]();});}else{logger[_0xc51b('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1e77e6);_0x275847[_0xc51b('0x21')]();}}else{var _0x445231=this;var _0x5a9e53=new AWS[(_0xc51b('0x22'))]({'accessKeyId':_0x1da8ef[0x0],'secretAccessKey':_0x1da8ef[0x1],'region':_0x1da8ef[0x2]});var _0xe9b385={'botAlias':_0xc51b('0x23'),'botName':_0x1da8ef[0x3],'inputText':this[_0xc51b('0x24')]['body'],'userId':this[_0xc51b('0x10')]+':'+this[_0xc51b('0x13')]['id'][_0xc51b('0x25')]()};_0x5a9e53[_0xc51b('0x26')](_0xe9b385,function(_0x94365,_0x3e1250){if(_0x94365){logger[_0xc51b('0x27')]('[%s][AMAZONLEX]\x20%s',_0x1e77e6,_0x94365[_0xc51b('0x24')]);_0x275847[_0xc51b('0xc')]();}else if(_0x3e1250&&_0x3e1250[_0xc51b('0x24')]){_0x445231[_0xc51b('0x1b')]['amazonlex']=_0x3e1250;_0x4dbd2b['body']=_0x3e1250[_0xc51b('0x24')];_0x4dbd2b[_0xc51b('0x28')]=_0xc51b('0x29');_0x4dbd2b[_0xc51b('0x2a')]=JSON[_0xc51b('0x1e')](_0x3e1250);return rpc[_0xacea61+_0xc51b('0x1c')]['create'](_0x4dbd2b)['then'](function(_0x4a62e3){logger[_0xc51b('0x9')](_0xc51b('0xa'),_0x1e77e6,_0x4dbd2b[_0xc51b('0x1b')]);if(_0x3e1250[_0xc51b('0x2b')]==_0xc51b('0x2c')){_0x275847[_0xc51b('0xc')]();}else{_0x275847[_0xc51b('0x21')]();}})[_0xc51b('0x2d')](function(_0x1e7626){logger[_0xc51b('0x27')](_0xc51b('0xa'),_0x1e77e6,JSON[_0xc51b('0x1e')](_0x1e7626));_0x275847['next']();});}else{_0x275847['next']();}});}}catch(_0x541e29){logger['error'](_0xc51b('0xa'),_0x1e77e6,JSON[_0xc51b('0x1e')](_0x541e29));_0x275847[_0xc51b('0x21')]();}};}; \ 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 fab2762..8f07cd9 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 _0xb0e4=['contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','AccountId','inReplyTo','messageId','html','','','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','then','error','finally','resolve','autoreplyExecuted','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stringify','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent'];(function(_0x3dc128,_0x2605bc){var _0xed6244=function(_0xef02b3){while(--_0xef02b3){_0x3dc128['push'](_0x3dc128['shift']());}};_0xed6244(++_0x2605bc);}(_0xb0e4,0x67));var _0x4b0e=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb0e4[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x4b0e('0x0'));var moment=require(_0x4b0e('0x1'));var utils=require(_0x4b0e('0x2'));var logger=require(_0x4b0e('0x3'))('routing');var rpc={'chatMessage':require(_0x4b0e('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x4b0e('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x4b0e('0x6')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x4b0e('0x7')),'smsInteraction':require(_0x4b0e('0x8')),'faxInteraction':require(_0x4b0e('0x9')),'whatsappInteraction':require(_0x4b0e('0xa'))};var mailRpc=require(_0x4b0e('0xb'));exports[_0x4b0e('0xc')]=function(_0x41fe90,_0x28b314,_0x2b5ec3,_0x3f396f){return function(_0x1973b3){try{var _0x152f26=this[_0x4b0e('0xd')];if(_0x152f26===_0x4b0e('0xe')&&_0x3f396f[_0x4b0e('0xf')][_0x4b0e('0x10')]){logger[_0x4b0e('0x11')](_0x4b0e('0x12'),_0x41fe90,_0x4b0e('0x13'));return _0x1973b3[_0x4b0e('0x14')]();}if(_0x28b314[0x0]==='1'&&(_[_0x4b0e('0x15')](this[_0x4b0e('0x16')]['created'])||!this[_0x4b0e('0x16')][_0x4b0e('0x17')])){logger[_0x4b0e('0x11')](_0x4b0e('0x12'),_0x41fe90,_0x4b0e('0x18'));return _0x1973b3[_0x4b0e('0x14')]();}if(_0x28b314[0x0]==='2'&&this[_0x4b0e('0x16')]['autoreplyExecuted']){logger[_0x4b0e('0x11')](_0x4b0e('0x19'),_0x41fe90,_0x4b0e('0x1a'));return _0x1973b3['next']();}var _0x30a210={'ContactId':this[_0x4b0e('0x1b')]['id'],'sentAt':moment()[_0x4b0e('0x1c')](_0x4b0e('0x1d')),'direction':'out'};if(this['channel']===_0x4b0e('0xe')){_0x30a210[_0x4b0e('0xf')]=utils[_0x4b0e('0x1e')](_0x28b314[0x2],this);}else{_0x30a210['body']=utils['getMustacheRender'](_0x28b314[0x1],this);}if(this[_0x4b0e('0x1f')]){_0x30a210['to']=this[_0x4b0e('0x1f')]['from']||'';if(this[_0x4b0e('0xd')]===_0x4b0e('0xe')&&_0x28b314[0x1]==='1'){_0x30a210['cc']=this[_0x4b0e('0x1f')]['cc']||'';}_0x30a210[_0x4b0e('0x20')]=this[_0x4b0e('0x1f')]['to']||'';_0x30a210[_0x4b0e('0x21')]=this[_0x4b0e('0x1f')][_0x4b0e('0x21')]||'';_0x30a210[_0x4b0e('0x22')]=!![];if(this['message'][_0x4b0e('0x23')]){_0x30a210[_0x4b0e('0x23')]='';_0x30a210[_0x4b0e('0x23')]+=_[_0x4b0e('0x24')](this['message'][_0x4b0e('0x23')],_0x4b0e('0x25'))?'':_0x4b0e('0x26');_0x30a210[_0x4b0e('0x23')]+=this[_0x4b0e('0x1f')]['subject'];}}if(this[_0x4b0e('0xd')]==='chat'){_0x30a210[_0x4b0e('0x27')]=this[_0x4b0e('0x28')]['id'];}else{_0x30a210[_['upperFirst'](this[_0x4b0e('0xd')])+_0x4b0e('0x29')]=this['account']['id'];}_0x30a210[_['upperFirst'](this[_0x4b0e('0xd')])+'InteractionId']=this['interaction']['id'];var _0x43e0fe=this[_0x4b0e('0x16')];if(rpc[this[_0x4b0e('0xd')]+'Message']){if(this[_0x4b0e('0xd')]===_0x4b0e('0xe')){_0x30a210[_0x4b0e('0x2a')]=this['message'][_0x4b0e('0x2b')];_0x30a210[_0x4b0e('0x2c')]=_0x4b0e('0x2d')+_['replace'](_0x30a210[_0x4b0e('0xf')],_0x4b0e('0x2e'),'','','headers','auto-replied','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','resolve','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc'];(function(_0xf30fa3,_0x444759){var _0x5ea4bf=function(_0x216239){while(--_0x216239){_0xf30fa3['push'](_0xf30fa3['shift']());}};_0x5ea4bf(++_0x444759);}(_0x9cbb,0x103));var _0xb9cb=function(_0x5e6939,_0x3dcd8a){_0x5e6939=_0x5e6939-0x0;var _0x45d3f1=_0x9cbb[_0x5e6939];return _0x45d3f1;};'use strict';var _=require(_0xb9cb('0x0'));var moment=require(_0xb9cb('0x1'));var utils=require(_0xb9cb('0x2'));var logger=require(_0xb9cb('0x3'))(_0xb9cb('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb9cb('0x5')),'faxMessage':require(_0xb9cb('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb9cb('0x7')),'mailInteraction':require(_0xb9cb('0x8')),'smsInteraction':require(_0xb9cb('0x9')),'faxInteraction':require(_0xb9cb('0xa')),'whatsappInteraction':require(_0xb9cb('0xb'))};var mailRpc=require(_0xb9cb('0xc'));exports['consequence']=function(_0x1b5e57,_0x5e3f22,_0x2fe9f4,_0xbfed32){return function(_0x18955e){try{var _0x2a252a=this[_0xb9cb('0xd')];if(_0x2a252a===_0xb9cb('0xe')&&_0xbfed32[_0xb9cb('0xf')][_0xb9cb('0x10')]){logger['info'](_0xb9cb('0x11'),_0x1b5e57,_0xb9cb('0x12'));return _0x18955e[_0xb9cb('0x13')]();}if(_0x5e3f22[0x0]==='1'&&(_[_0xb9cb('0x14')](this[_0xb9cb('0x15')][_0xb9cb('0x16')])||!this[_0xb9cb('0x15')][_0xb9cb('0x16')])){logger[_0xb9cb('0x17')]('[%s][AUTOREPLY]\x20%s',_0x1b5e57,_0xb9cb('0x18'));return _0x18955e[_0xb9cb('0x13')]();}if(_0x5e3f22[0x0]==='2'&&this['interaction'][_0xb9cb('0x19')]){logger[_0xb9cb('0x17')](_0xb9cb('0x1a'),_0x1b5e57,_0xb9cb('0x1b'));return _0x18955e[_0xb9cb('0x13')]();}var _0x41c806={'ContactId':this[_0xb9cb('0x1c')]['id'],'sentAt':moment()[_0xb9cb('0x1d')](_0xb9cb('0x1e')),'direction':_0xb9cb('0x1f')};if(this[_0xb9cb('0xd')]===_0xb9cb('0xe')){_0x41c806[_0xb9cb('0xf')]=utils[_0xb9cb('0x20')](_0x5e3f22[0x2],this);}else{_0x41c806[_0xb9cb('0xf')]=utils[_0xb9cb('0x20')](_0x5e3f22[0x1],this);}if(this[_0xb9cb('0x21')]){_0x41c806['to']=this[_0xb9cb('0x21')][_0xb9cb('0x22')]||'';if(this[_0xb9cb('0xd')]===_0xb9cb('0xe')&&_0x5e3f22[0x1]==='1'){_0x41c806['cc']=this[_0xb9cb('0x21')]['cc']||'';}_0x41c806['from']=this['message']['to']||'';_0x41c806[_0xb9cb('0x23')]=this[_0xb9cb('0x21')]['phone']||'';_0x41c806['read']=!![];if(this[_0xb9cb('0x21')][_0xb9cb('0x24')]){_0x41c806[_0xb9cb('0x24')]='';_0x41c806[_0xb9cb('0x24')]+=_[_0xb9cb('0x25')](this['message'][_0xb9cb('0x24')],_0xb9cb('0x26'))?'':'Re:\x20';_0x41c806['subject']+=this[_0xb9cb('0x21')]['subject'];}}if(this[_0xb9cb('0xd')]==='chat'){_0x41c806[_0xb9cb('0x27')]=this[_0xb9cb('0x28')]['id'];}else{_0x41c806[_[_0xb9cb('0x29')](this[_0xb9cb('0xd')])+_0xb9cb('0x2a')]=this[_0xb9cb('0x28')]['id'];}_0x41c806[_['upperFirst'](this[_0xb9cb('0xd')])+_0xb9cb('0x2b')]=this[_0xb9cb('0x15')]['id'];var _0x5cb09d=this['interaction'];if(rpc[this[_0xb9cb('0xd')]+_0xb9cb('0x2c')]){if(this['channel']===_0xb9cb('0xe')){_0x41c806[_0xb9cb('0x2d')]=this[_0xb9cb('0x21')]['messageId'];_0x41c806[_0xb9cb('0x2e')]=_0xb9cb('0x2f')+_['replace'](_0x41c806[_0xb9cb('0xf')],_0xb9cb('0x30'),_0xb9cb('0x31'))+_0xb9cb('0x32');_0x41c806[_0xb9cb('0x33')]={'Auto-Submitted':_0xb9cb('0x34'),'X-Auto-Response-Suppress':_0xb9cb('0x35'),'Precedence':'auto_reply'};return mailRpc[_0xb9cb('0x36')](this['account'][_0xb9cb('0x37')],_0x41c806)[_0xb9cb('0x38')](function(_0x4cd30f){logger[_0xb9cb('0x17')](_0xb9cb('0x39'),_0x1b5e57);_0x41c806[_0xb9cb('0x3a')]=_0x4cd30f[_0xb9cb('0x21')][_0xb9cb('0x3a')];return rpc[_0x2a252a+'Message'][_0xb9cb('0x3b')](_0x41c806);})[_0xb9cb('0x38')](function(_0x10c2de){logger[_0xb9cb('0x17')](_0xb9cb('0x11'),_0x1b5e57,JSON[_0xb9cb('0x3c')](_0x10c2de));})[_0xb9cb('0x3d')](function(_0x433320){logger['error'](_0xb9cb('0x3e'),_0x1b5e57,JSON[_0xb9cb('0x3c')](_0x433320));})['finally'](function(){Promise[_0xb9cb('0x3f')]()['then'](function(){if(_0x5e3f22[0x0]!=='2'||_0x5cb09d[_0xb9cb('0x19')])return;return rpc[_0x2a252a+'Interaction'][_0xb9cb('0x40')](_0x5cb09d['id'],{'autoreplyExecuted':!![]})['then'](function(_0x2c1ec3){logger[_0xb9cb('0x17')](_0xb9cb('0x1a'),_0x1b5e57,JSON[_0xb9cb('0x3c')](_0x2c1ec3));})[_0xb9cb('0x3d')](function(_0x41c15a){logger[_0xb9cb('0x41')](_0xb9cb('0x42'),_0x1b5e57,JSON['stringify'](_0x41c15a));});})['then'](function(){_0x18955e[_0xb9cb('0x13')]();});});}else{return rpc[this[_0xb9cb('0xd')]+_0xb9cb('0x2c')][_0xb9cb('0x3b')](_0x41c806)['then'](function(){logger[_0xb9cb('0x17')](_0xb9cb('0x11'),_0x1b5e57,_0x41c806[_0xb9cb('0xf')]);})[_0xb9cb('0x3d')](function(_0x544162){logger[_0xb9cb('0x41')](_0xb9cb('0x11'),_0x1b5e57,JSON[_0xb9cb('0x3c')](_0x544162));})['finally'](function(){Promise[_0xb9cb('0x3f')]()[_0xb9cb('0x38')](function(){if(_0x5e3f22[0x0]!=='2'||_0x5cb09d[_0xb9cb('0x19')])return;return rpc[_0x2a252a+_0xb9cb('0x43')][_0xb9cb('0x40')](_0x5cb09d['id'],{'autoreplyExecuted':!![]})[_0xb9cb('0x38')](function(_0x59a904){logger[_0xb9cb('0x17')](_0xb9cb('0x1a'),_0x1b5e57,JSON[_0xb9cb('0x3c')](_0x59a904));})[_0xb9cb('0x3d')](function(_0x518e6b){logger[_0xb9cb('0x41')](_0xb9cb('0x42'),_0x1b5e57,JSON[_0xb9cb('0x3c')](_0x518e6b));});})['then'](function(){_0x18955e[_0xb9cb('0x13')]();});});}}}catch(_0x1f8c91){logger['error'](_0xb9cb('0x11'),_0x1b5e57,JSON['stringify'](_0x1f8c91));_0x18955e['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 e64268c..a7af78b 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 _0xde6a=['moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop'];(function(_0x48f7fb,_0x4dcc77){var _0x3cbbb4=function(_0x208e5c){while(--_0x208e5c){_0x48f7fb['push'](_0x48f7fb['shift']());}};_0x3cbbb4(++_0x4dcc77);}(_0xde6a,0x168));var _0xade6=function(_0x23b620,_0x4ebc8b){_0x23b620=_0x23b620-0x0;var _0x94056c=_0xde6a[_0x23b620];return _0x94056c;};'use strict';var moment=require(_0xade6('0x0'));var logger=require(_0xade6('0x1'))(_0xade6('0x2'));var rpc={'chatInteraction':require(_0xade6('0x3')),'openchannelInteraction':require(_0xade6('0x4')),'smsInteraction':require(_0xade6('0x5')),'mailInteraction':require(_0xade6('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xade6('0x7'))};exports[_0xade6('0x8')]=function(_0x20cdc5,_0x6f3bc6,_0x45e493,_0x2908f7){return function(_0x3e9eb7){try{logger[_0xade6('0x9')]('[%s][CLOSE]\x20reason\x20%s',_0x20cdc5,_0x6f3bc6[0x0]);var _0x15e7c1={'closed':0x1,'closedAt':moment()[_0xade6('0xa')](_0xade6('0xb')),'closeReason':_0xade6('0xc'),'disposition':_0x6f3bc6[0x0]};if(rpc[_0x2908f7[_0xade6('0xd')]+_0xade6('0xe')]){rpc[_0x2908f7[_0xade6('0xd')]+'Interaction'][_0xade6('0xf')](_0x2908f7['interaction']['id'],_0x15e7c1)[_0xade6('0x10')](function(_0x83cf18){logger[_0xade6('0x9')](_0xade6('0x11'),_0x20cdc5,_0x2908f7[_0xade6('0x12')]['id']);})[_0xade6('0x13')](function(_0xbd44b5){logger[_0xade6('0x14')](_0xade6('0x15'),_0x20cdc5,JSON[_0xade6('0x16')](_0xbd44b5));})['finally'](function(){_0x3e9eb7[_0xade6('0x17')]();});}}catch(_0x5a1298){logger[_0xade6('0x14')](_0xade6('0x15'),_0x20cdc5,JSON[_0xade6('0x16')](_0x5a1298));_0x3e9eb7[_0xade6('0x17')]();}};}; \ No newline at end of file +var _0xb662=['[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x59c765,_0x1b14cb){var _0x731b6d=function(_0x358491){while(--_0x358491){_0x59c765['push'](_0x59c765['shift']());}};_0x731b6d(++_0x1b14cb);}(_0xb662,0x8d));var _0x2b66=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xb662[_0x49052b];return _0x48c045;};'use strict';var moment=require(_0x2b66('0x0'));var logger=require(_0x2b66('0x1'))('routing');var rpc={'chatInteraction':require(_0x2b66('0x2')),'openchannelInteraction':require(_0x2b66('0x3')),'smsInteraction':require(_0x2b66('0x4')),'mailInteraction':require(_0x2b66('0x5')),'faxInteraction':require(_0x2b66('0x6')),'whatsappInteraction':require(_0x2b66('0x7'))};exports[_0x2b66('0x8')]=function(_0x2764b3,_0x464d85,_0x288a87,_0x24cefe){return function(_0xd386ae){try{logger[_0x2b66('0x9')](_0x2b66('0xa'),_0x2764b3,_0x464d85[0x0]);var _0x567e3d={'closed':0x1,'closedAt':moment()[_0x2b66('0xb')](_0x2b66('0xc')),'closeReason':_0x2b66('0xd'),'disposition':_0x464d85[0x0]};if(rpc[_0x24cefe[_0x2b66('0xe')]+_0x2b66('0xf')]){rpc[_0x24cefe[_0x2b66('0xe')]+'Interaction'][_0x2b66('0x10')](_0x24cefe['interaction']['id'],_0x567e3d)['then'](function(_0x3519b1){logger[_0x2b66('0x9')](_0x2b66('0x11'),_0x2764b3,_0x24cefe['interaction']['id']);})[_0x2b66('0x12')](function(_0x5d34ea){logger[_0x2b66('0x13')](_0x2b66('0x14'),_0x2764b3,JSON[_0x2b66('0x15')](_0x5d34ea));})['finally'](function(){_0xd386ae[_0x2b66('0x16')]();});}}catch(_0x43e45f){logger[_0x2b66('0x13')]('[%s][CLOSE]\x20%s',_0x2764b3,JSON[_0x2b66('0x15')](_0x43e45f));_0xd386ae[_0x2b66('0x16')]();}};}; \ 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 679ff03..324691a 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 _0x6132=['interaction','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','Message','create','then','body','error','stringify','stop','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','catch','message','lodash','moment','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0x6132,0x13a));var _0x2613=function(_0x43c11f,_0xb73dbb){_0x43c11f=_0x43c11f-0x0;var _0x2da486=_0x6132[_0x43c11f];return _0x2da486;};'use strict';var _=require(_0x2613('0x0'));var moment=require(_0x2613('0x1'));var apiai=require(_0x2613('0x2'));var md5=require(_0x2613('0x3'));var utils=require('./utils');var logger=require(_0x2613('0x4'))(_0x2613('0x5'));var rpc={'chatMessage':require(_0x2613('0x6')),'openchannelMessage':require(_0x2613('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2613('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x2613('0x9')]=function(_0x309663,_0x369931){return function(_0x465a32){try{if(!_[_0x2613('0xa')](this['interaction'][_0x2613('0xb')])){logger[_0x2613('0xc')](_0x2613('0xd'),_0x309663,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x465a32[_0x2613('0xe')]();}var _0x12c800={'ContactId':this[_0x2613('0xf')]['id'],'sentAt':moment()[_0x2613('0x10')](_0x2613('0x11')),'direction':_0x2613('0x12')};if(this[_0x2613('0x13')]===_0x2613('0x14')||this[_0x2613('0x13')]===_0x2613('0x15')){_0x12c800['phone']=this[_0x2613('0x16')][_0x2613('0x17')];}var _0x3121e1=this[_0x2613('0x13')];if(_0x3121e1==='chat'){_0x12c800[_0x2613('0x18')]=this[_0x2613('0x19')]['id'];}else{_0x12c800[_[_0x2613('0x1a')](_0x3121e1)+_0x2613('0x1b')]=this['account']['id'];}_0x12c800[_[_0x2613('0x1a')](_0x3121e1)+_0x2613('0x1c')]=this[_0x2613('0x16')]['id'];if(this[_0x2613('0x16')]['created']){var _0x35dd88=_0x369931[0x2];if(!_[_0x2613('0x1d')](_0x35dd88)){_0x12c800['body']=utils[_0x2613('0x1e')](_0x35dd88,this);return rpc[_0x3121e1+_0x2613('0x1f')][_0x2613('0x20')](_0x12c800)[_0x2613('0x21')](function(_0x2954f3){logger['info'](_0x2613('0xd'),_0x309663,_0x12c800[_0x2613('0x22')]);})['catch'](function(_0x249263){logger[_0x2613('0x23')](_0x2613('0xd'),_0x309663,JSON[_0x2613('0x24')](_0x249263));})['finally'](function(){logger[_0x2613('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x309663);_0x465a32['stop']();});}else{logger[_0x2613('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x309663);_0x465a32[_0x2613('0x25')]();}}else{var _0x764f7b=this;var _0x41a764=apiai(_0x369931[0x0],{'language':_0x369931[0x1]||'en'});return _0x41a764['textRequest'](this['message'][_0x2613('0x22')],{'sessionId':md5(this[_0x2613('0x16')]['id'])})['then'](function(_0x1db1e9){_0x764f7b[_0x2613('0x22')][_0x2613('0x26')]=_0x1db1e9;_0x12c800[_0x2613('0x22')]=_0x1db1e9[_0x2613('0x27')][_0x2613('0x28')][_0x2613('0x29')];_0x12c800[_0x2613('0x2a')]='dialogflow';_0x12c800[_0x2613('0x2b')]=JSON[_0x2613('0x24')](_0x1db1e9);return rpc[_0x3121e1+_0x2613('0x1f')][_0x2613('0x20')](_0x12c800)[_0x2613('0x21')](function(_0x329e65){logger[_0x2613('0xc')](_0x2613('0xd'),_0x309663,_0x12c800[_0x2613('0x22')]);if(_0x1db1e9['result'][_0x2613('0x2c')][_0x2613('0x2d')]){_0x465a32[_0x2613('0xe')]();}else{_0x465a32[_0x2613('0x25')]();}})[_0x2613('0x2e')](function(_0x9175c8){logger[_0x2613('0x23')](_0x2613('0xd'),_0x309663,JSON['stringify'](_0x9175c8));_0x465a32[_0x2613('0xe')]();});})[_0x2613('0x2e')](function(_0x328ac2){logger[_0x2613('0x23')](_0x2613('0xd'),_0x309663,_0x328ac2[_0x2613('0x2f')]);_0x465a32['next']();});}}catch(_0x2eefec){logger['error'](_0x2613('0xd'),_0x309663,JSON['stringify'](_0x2eefec));_0x465a32[_0x2613('0x25')]();}};}; \ No newline at end of file +var _0xdf98=['isEmpty','body','getMustacheRender','Message','create','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','then','dialogflow','fulfillment','speech','providerName','endConversation','lodash','apiai-promise','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','upperFirst','AccountId','account','InteractionId','interaction'];(function(_0x31f578,_0x4b7e9d){var _0x488091=function(_0x1d6002){while(--_0x1d6002){_0x31f578['push'](_0x31f578['shift']());}};_0x488091(++_0x4b7e9d);}(_0xdf98,0xcf));var _0x8df9=function(_0x505df9,_0x14138e){_0x505df9=_0x505df9-0x0;var _0x1cc025=_0xdf98[_0x505df9];return _0x1cc025;};'use strict';var _=require(_0x8df9('0x0'));var moment=require('moment');var apiai=require(_0x8df9('0x1'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x8df9('0x2'))(_0x8df9('0x3'));var rpc={'chatMessage':require(_0x8df9('0x4')),'openchannelMessage':require(_0x8df9('0x5')),'mailMessage':require(_0x8df9('0x6')),'smsMessage':require(_0x8df9('0x7')),'faxMessage':require(_0x8df9('0x8')),'whatsappMessage':require(_0x8df9('0x9'))};exports[_0x8df9('0xa')]=function(_0x5e79af,_0x1ffe3b){return function(_0x393533){try{if(!_[_0x8df9('0xb')](this['interaction']['UserId'])){logger[_0x8df9('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x5e79af,_0x8df9('0xd'));return _0x393533[_0x8df9('0xe')]();}var _0x1ead69={'ContactId':this[_0x8df9('0xf')]['id'],'sentAt':moment()[_0x8df9('0x10')](_0x8df9('0x11')),'direction':_0x8df9('0x12')};if(this[_0x8df9('0x13')]==='sms'||this[_0x8df9('0x13')]===_0x8df9('0x14')){_0x1ead69[_0x8df9('0x15')]=this['interaction'][_0x8df9('0x15')];}var _0x3bb301=this[_0x8df9('0x13')];if(_0x3bb301===_0x8df9('0x16')){_0x1ead69['ChatWebsiteId']=this['account']['id'];}else{_0x1ead69[_[_0x8df9('0x17')](_0x3bb301)+_0x8df9('0x18')]=this[_0x8df9('0x19')]['id'];}_0x1ead69[_['upperFirst'](_0x3bb301)+_0x8df9('0x1a')]=this['interaction']['id'];if(this[_0x8df9('0x1b')]['created']){var _0x364f93=_0x1ffe3b[0x2];if(!_[_0x8df9('0x1c')](_0x364f93)){_0x1ead69[_0x8df9('0x1d')]=utils[_0x8df9('0x1e')](_0x364f93,this);return rpc[_0x3bb301+_0x8df9('0x1f')][_0x8df9('0x20')](_0x1ead69)['then'](function(_0x54f2b0){logger[_0x8df9('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x5e79af,_0x1ead69['body']);})[_0x8df9('0x21')](function(_0x43a3c2){logger[_0x8df9('0x22')](_0x8df9('0x23'),_0x5e79af,JSON[_0x8df9('0x24')](_0x43a3c2));})[_0x8df9('0x25')](function(){logger['info'](_0x8df9('0x26'),_0x5e79af);_0x393533[_0x8df9('0x27')]();});}else{logger[_0x8df9('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5e79af);_0x393533['stop']();}}else{var _0x490028=this;var _0x4a6748=apiai(_0x1ffe3b[0x0],{'language':_0x1ffe3b[0x1]||'en'});return _0x4a6748['textRequest'](this[_0x8df9('0x28')][_0x8df9('0x1d')],{'sessionId':md5(this[_0x8df9('0x1b')]['id'])})[_0x8df9('0x29')](function(_0x478453){_0x490028[_0x8df9('0x1d')][_0x8df9('0x2a')]=_0x478453;_0x1ead69[_0x8df9('0x1d')]=_0x478453['result'][_0x8df9('0x2b')][_0x8df9('0x2c')];_0x1ead69[_0x8df9('0x2d')]='dialogflow';_0x1ead69['providerResponse']=JSON[_0x8df9('0x24')](_0x478453);return rpc[_0x3bb301+'Message']['create'](_0x1ead69)[_0x8df9('0x29')](function(_0x37efc3){logger[_0x8df9('0xc')](_0x8df9('0x23'),_0x5e79af,_0x1ead69[_0x8df9('0x1d')]);if(_0x478453['result']['metadata'][_0x8df9('0x2e')]){_0x393533[_0x8df9('0xe')]();}else{_0x393533[_0x8df9('0x27')]();}})['catch'](function(_0x25d636){logger[_0x8df9('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x5e79af,JSON[_0x8df9('0x24')](_0x25d636));_0x393533[_0x8df9('0xe')]();});})['catch'](function(_0x26b063){logger[_0x8df9('0x22')](_0x8df9('0x23'),_0x5e79af,_0x26b063['message']);_0x393533['next']();});}}catch(_0x6cdf4c){logger[_0x8df9('0x22')](_0x8df9('0x23'),_0x5e79af,JSON['stringify'](_0x6cdf4c));_0x393533[_0x8df9('0x27')]();}};}; \ 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 64a9463..f123c9e 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 _0xa75d=['SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','name','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','next','stack','lodash','dialogflow','md5','moment','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','getMustacheRender','Message','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace'];(function(_0x5db51a,_0x436f97){var _0x4e1d6d=function(_0x49d90){while(--_0x49d90){_0x5db51a['push'](_0x5db51a['shift']());}};_0x4e1d6d(++_0x436f97);}(_0xa75d,0x188));var _0xda75=function(_0x460493,_0x664002){_0x460493=_0x460493-0x0;var _0x444bab=_0xa75d[_0x460493];return _0x444bab;};'use strict';var _=require(_0xda75('0x0'));var dialogflow=require(_0xda75('0x1'));var md5=require(_0xda75('0x2'));var moment=require(_0xda75('0x3'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0xda75('0x4'));var utils=require(_0xda75('0x5'));var rpc={'chatMessage':require(_0xda75('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xda75('0x7')),'smsMessage':require(_0xda75('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xda75('0x9'))};function createMessage(_0x32485d,_0x5d57a9,_0x32fb28,_0x31e027){return new Promise(function(_0x4f3d37,_0x4b0277){var _0x1cb45d=_[_0xda75('0xa')](_0x32fb28);_0x1cb45d[_0xda75('0xb')]=_0x31e027;return rpc[_0x5d57a9+'Message'][_0xda75('0xc')](_0x1cb45d)[_0xda75('0xd')](function(){logger[_0xda75('0xe')](_0xda75('0xf'),_0x32485d,_0x1cb45d[_0xda75('0xb')]);_0x4f3d37();})[_0xda75('0x10')](function(_0x12c9ec){logger[_0xda75('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x32485d,JSON[_0xda75('0x12')](_0x12c9ec));_0x4b0277(_0x12c9ec);});});}exports[_0xda75('0x13')]=function(_0x4b9a3f,_0x21c489){return function(_0x3ec523){try{if(!_[_0xda75('0x14')](this[_0xda75('0x15')][_0xda75('0x16')])){logger[_0xda75('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x4b9a3f,_0xda75('0x17'));return _0x3ec523['next']();}var _0x2fd9a2={'ContactId':this['contact']['id'],'sentAt':moment()[_0xda75('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0xda75('0x19')||this[_0xda75('0x1a')]===_0xda75('0x1b')){_0x2fd9a2[_0xda75('0x1c')]=this[_0xda75('0x15')][_0xda75('0x1c')];}var _0x1e84b5=this[_0xda75('0x1a')];if(_0x1e84b5===_0xda75('0x1d')){_0x2fd9a2[_0xda75('0x1e')]=this[_0xda75('0x1f')]['id'];}else{_0x2fd9a2[_[_0xda75('0x20')](_0x1e84b5)+'AccountId']=this[_0xda75('0x1f')]['id'];}_0x2fd9a2[_[_0xda75('0x20')](_0x1e84b5)+_0xda75('0x21')]=this['interaction']['id'];if(this[_0xda75('0x15')]['created']){var _0x50c1bc=_0x21c489[0x4];if(!_['isEmpty'](_0x50c1bc)){_0x2fd9a2[_0xda75('0xb')]=utils[_0xda75('0x22')](_0x50c1bc,this);return rpc[_0x1e84b5+_0xda75('0x23')][_0xda75('0xc')](_0x2fd9a2)['then'](function(_0x5e6d90){logger[_0xda75('0xe')](_0xda75('0xf'),_0x4b9a3f,_0x2fd9a2[_0xda75('0xb')]);})['catch'](function(_0x4e6a05){logger[_0xda75('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x4b9a3f,JSON[_0xda75('0x12')](_0x4e6a05));})['finally'](function(){logger[_0xda75('0xe')](_0xda75('0x24'),_0x4b9a3f);_0x3ec523[_0xda75('0x25')]();});}else{logger[_0xda75('0xe')](_0xda75('0x26'),_0x4b9a3f);_0x3ec523[_0xda75('0x25')]();}}else{var _0xc80305=this;var _0x559bd4=_0x21c489[0x2][_0xda75('0x27')](/\\n/g,'\x0a');var _0x46d8b8={'credentials':{'private_key':_0x559bd4,'client_email':_0x21c489[0x1]}};var _0x561b69=new dialogflow[(_0xda75('0x28'))](_0x46d8b8);var _0x588749=_0x561b69[_0xda75('0x29')](_0x21c489[0x0],md5(_0xc80305['interaction']['id']));var _0x5f22c1={'session':_0x588749,'queryInput':{'text':{'text':_0xc80305[_0xda75('0x2a')][_0xda75('0xb')],'languageCode':_0x21c489[0x3]||'en'}}};return _0x561b69[_0xda75('0x2b')](_0x5f22c1)['then'](function(_0x337e39){if(_0x337e39&&_0x337e39[_0xda75('0x2c')]){_0xc80305[_0xda75('0xb')][_0xda75('0x2d')]=_0x337e39;var _0xabbc52=_0x337e39[0x0];var _0x3ee77f=_0xabbc52[_0xda75('0x2e')][_0xda75('0x2f')]&&_0xabbc52[_0xda75('0x2e')][_0xda75('0x2f')][_0xda75('0x30')]?_0xabbc52[_0xda75('0x2e')][_0xda75('0x2f')]['fields'][_0xda75('0x31')][_0xda75('0x32')]:![];_0xc80305[_0xda75('0xb')][_0xda75('0x33')]=_0xabbc52['queryResult'][_0xda75('0x34')];_0xc80305[_0xda75('0xb')][_0xda75('0x35')]=_0xabbc52[_0xda75('0x2e')]['allRequiredParamsPresent'];_0xc80305[_0xda75('0xb')][_0xda75('0x36')]=_0xabbc52[_0xda75('0x2e')][_0xda75('0x2f')]&&_0xabbc52[_0xda75('0x2e')][_0xda75('0x2f')][_0xda75('0x30')]?_0xabbc52[_0xda75('0x2e')]['diagnosticInfo'][_0xda75('0x30')]['end_conversation'][_0xda75('0x32')]:![];_0xc80305[_0xda75('0xb')]['DIALOGFLOWV2_INTENTNAME']=_0xabbc52['queryResult']['intent'][_0xda75('0x37')];_0xc80305[_0xda75('0xb')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0xabbc52[_0xda75('0x2e')][_0xda75('0x38')][_0xda75('0x39')];_0xc80305[_0xda75('0xb')][_0xda75('0x3a')]=_0xabbc52[_0xda75('0x2e')][_0xda75('0x38')]['isFallback'];_0xc80305[_0xda75('0xb')][_0xda75('0x3b')]=_0xabbc52[_0xda75('0x2e')][_0xda75('0x3c')];_0xc80305[_0xda75('0xb')][_0xda75('0x3d')]=_0xabbc52[_0xda75('0x2e')][_0xda75('0x3e')];_0xc80305[_0xda75('0xb')][_0xda75('0x3f')]=_0xabbc52['queryResult'][_0xda75('0x40')];_0x2fd9a2[_0xda75('0x41')]='dialogflowV2';_0x2fd9a2[_0xda75('0x42')]=JSON['stringify'](_0x337e39);var _0x18153b=[];for(var _0x474c4f=0x0;_0x474c4f<_0x337e39[_0xda75('0x2c')];_0x474c4f++){var _0x260516=_0x337e39[_0x474c4f];if(_0x260516&&_0x260516[_0xda75('0x2e')]&&_0x260516[_0xda75('0x2e')][_0xda75('0x43')]){_0x18153b[_0xda75('0x44')](createMessage(_0x4b9a3f,_0x1e84b5,_0x2fd9a2,_0x260516[_0xda75('0x2e')][_0xda75('0x43')]));}}return Promise[_0xda75('0x45')](_0x18153b)[_0xda75('0xd')](function(){if(_0x3ee77f){_0x3ec523[_0xda75('0x46')]();}else{_0x3ec523['stop']();}})[_0xda75('0x10')](function(_0x29843c){logger[_0xda75('0x11')](_0xda75('0xf'),_0x4b9a3f,JSON[_0xda75('0x12')](_0x29843c));_0x3ec523[_0xda75('0x46')]();});}})[_0xda75('0x10')](function(_0x16bdd0){logger['error'](_0xda75('0xf'),_0x4b9a3f,_0x16bdd0[_0xda75('0x2a')],_0x16bdd0[_0xda75('0x47')]);_0x3ec523[_0xda75('0x46')]();});}}catch(_0x3daebc){logger[_0xda75('0x11')](_0xda75('0xf'),_0x4b9a3f,JSON['stringify'](_0x3daebc));_0x3ec523[_0xda75('0x25')]();}};}; \ No newline at end of file +var _0xbf8e=['clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','interaction','UserId','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','next','message','stack','lodash','md5','moment','bluebird','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x4c3b86,_0x2693ac){var _0x146b97=function(_0x15b63b){while(--_0x15b63b){_0x4c3b86['push'](_0x4c3b86['shift']());}};_0x146b97(++_0x2693ac);}(_0xbf8e,0xd1));var _0xebf8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbf8e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xebf8('0x0'));var dialogflow=require('dialogflow');var md5=require(_0xebf8('0x1'));var moment=require(_0xebf8('0x2'));var Promise=require(_0xebf8('0x3'));var logger=require('../../../../config/logger')('routing');var utils=require(_0xebf8('0x4'));var rpc={'chatMessage':require(_0xebf8('0x5')),'openchannelMessage':require(_0xebf8('0x6')),'mailMessage':require(_0xebf8('0x7')),'smsMessage':require(_0xebf8('0x8')),'faxMessage':require(_0xebf8('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1a37f6,_0x20348e,_0x692a61,_0x1c2004){return new Promise(function(_0xe28678,_0x210693){var _0xabb7e6=_[_0xebf8('0xa')](_0x692a61);_0xabb7e6[_0xebf8('0xb')]=_0x1c2004;return rpc[_0x20348e+'Message'][_0xebf8('0xc')](_0xabb7e6)[_0xebf8('0xd')](function(){logger[_0xebf8('0xe')](_0xebf8('0xf'),_0x1a37f6,_0xabb7e6[_0xebf8('0xb')]);_0xe28678();})[_0xebf8('0x10')](function(_0xb98efc){logger[_0xebf8('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x1a37f6,JSON[_0xebf8('0x12')](_0xb98efc));_0x210693(_0xb98efc);});});}exports[_0xebf8('0x13')]=function(_0x39b4e6,_0x21f891){return function(_0x55898d){try{if(!_['isNil'](this[_0xebf8('0x14')][_0xebf8('0x15')])){logger[_0xebf8('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x39b4e6,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x55898d['next']();}var _0x244d69={'ContactId':this['contact']['id'],'sentAt':moment()[_0xebf8('0x16')](_0xebf8('0x17')),'direction':_0xebf8('0x18')};if(this[_0xebf8('0x19')]===_0xebf8('0x1a')||this[_0xebf8('0x19')]===_0xebf8('0x1b')){_0x244d69[_0xebf8('0x1c')]=this[_0xebf8('0x14')][_0xebf8('0x1c')];}var _0x458641=this[_0xebf8('0x19')];if(_0x458641===_0xebf8('0x1d')){_0x244d69[_0xebf8('0x1e')]=this[_0xebf8('0x1f')]['id'];}else{_0x244d69[_['upperFirst'](_0x458641)+'AccountId']=this[_0xebf8('0x1f')]['id'];}_0x244d69[_[_0xebf8('0x20')](_0x458641)+_0xebf8('0x21')]=this['interaction']['id'];if(this['interaction'][_0xebf8('0x22')]){var _0x124ac7=_0x21f891[0x4];if(!_[_0xebf8('0x23')](_0x124ac7)){_0x244d69[_0xebf8('0xb')]=utils['getMustacheRender'](_0x124ac7,this);return rpc[_0x458641+'Message']['create'](_0x244d69)[_0xebf8('0xd')](function(_0x59ba34){logger[_0xebf8('0xe')](_0xebf8('0xf'),_0x39b4e6,_0x244d69[_0xebf8('0xb')]);})['catch'](function(_0x2c51ad){logger[_0xebf8('0x11')](_0xebf8('0xf'),_0x39b4e6,JSON[_0xebf8('0x12')](_0x2c51ad));})['finally'](function(){logger[_0xebf8('0xe')](_0xebf8('0x24'),_0x39b4e6);_0x55898d[_0xebf8('0x25')]();});}else{logger[_0xebf8('0xe')](_0xebf8('0x26'),_0x39b4e6);_0x55898d['stop']();}}else{var _0x180232=this;var _0x2d7273=_0x21f891[0x2][_0xebf8('0x27')](/\\n/g,'\x0a');var _0x35a34c={'credentials':{'private_key':_0x2d7273,'client_email':_0x21f891[0x1]}};var _0x121e94=new dialogflow[(_0xebf8('0x28'))](_0x35a34c);var _0x2f9799=_0x121e94[_0xebf8('0x29')](_0x21f891[0x0],md5(_0x180232[_0xebf8('0x14')]['id']));var _0x402864={'session':_0x2f9799,'queryInput':{'text':{'text':_0x180232['message'][_0xebf8('0xb')],'languageCode':_0x21f891[0x3]||'en'}}};return _0x121e94['detectIntent'](_0x402864)[_0xebf8('0xd')](function(_0x5431a3){if(_0x5431a3&&_0x5431a3[_0xebf8('0x2a')]){_0x180232[_0xebf8('0xb')][_0xebf8('0x2b')]=_0x5431a3;var _0x4c3512=_0x5431a3[0x0];var _0x1a980b=_0x4c3512[_0xebf8('0x2c')]['diagnosticInfo']&&_0x4c3512[_0xebf8('0x2c')]['diagnosticInfo']['fields']?_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x2d')][_0xebf8('0x2e')][_0xebf8('0x2f')][_0xebf8('0x30')]:![];_0x180232[_0xebf8('0xb')][_0xebf8('0x31')]=_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x32')];_0x180232['body'][_0xebf8('0x33')]=_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x34')];_0x180232[_0xebf8('0xb')][_0xebf8('0x35')]=_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x2d')]&&_0x4c3512[_0xebf8('0x2c')]['diagnosticInfo'][_0xebf8('0x2e')]?_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x2d')][_0xebf8('0x2e')][_0xebf8('0x2f')]['boolValue']:![];_0x180232['body'][_0xebf8('0x36')]=_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x37')][_0xebf8('0x38')];_0x180232[_0xebf8('0xb')][_0xebf8('0x39')]=_0x4c3512[_0xebf8('0x2c')]['intent'][_0xebf8('0x3a')];_0x180232[_0xebf8('0xb')][_0xebf8('0x3b')]=_0x4c3512['queryResult'][_0xebf8('0x37')][_0xebf8('0x3c')];_0x180232['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x3d')];_0x180232['body'][_0xebf8('0x3e')]=_0x4c3512[_0xebf8('0x2c')][_0xebf8('0x3f')];_0x180232[_0xebf8('0xb')][_0xebf8('0x40')]=_0x4c3512[_0xebf8('0x2c')]['intentDetectionConfidence'];_0x244d69[_0xebf8('0x41')]=_0xebf8('0x2b');_0x244d69[_0xebf8('0x42')]=JSON[_0xebf8('0x12')](_0x5431a3);var _0x188b9c=[];for(var _0x15aeda=0x0;_0x15aeda<_0x5431a3[_0xebf8('0x2a')];_0x15aeda++){var _0x44b4f4=_0x5431a3[_0x15aeda];if(_0x44b4f4&&_0x44b4f4[_0xebf8('0x2c')]&&_0x44b4f4['queryResult'][_0xebf8('0x43')]){_0x188b9c[_0xebf8('0x44')](createMessage(_0x39b4e6,_0x458641,_0x244d69,_0x44b4f4[_0xebf8('0x2c')][_0xebf8('0x43')]));}}return Promise[_0xebf8('0x45')](_0x188b9c)['then'](function(){if(_0x1a980b){_0x55898d[_0xebf8('0x46')]();}else{_0x55898d['stop']();}})[_0xebf8('0x10')](function(_0x400be1){logger['error'](_0xebf8('0xf'),_0x39b4e6,JSON['stringify'](_0x400be1));_0x55898d[_0xebf8('0x46')]();});}})['catch'](function(_0x27159f){logger[_0xebf8('0x11')](_0xebf8('0xf'),_0x39b4e6,_0x27159f[_0xebf8('0x47')],_0x27159f[_0xebf8('0x48')]);_0x55898d[_0xebf8('0x46')]();});}}catch(_0x53fe6a){logger[_0xebf8('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x39b4e6,JSON['stringify'](_0x53fe6a));_0x55898d[_0xebf8('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 269e30f..5ec893c 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 _0x01d4=['validate','length','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace'];(function(_0x1c1577,_0x1d4d6d){var _0x566d1f=function(_0x81f351){while(--_0x81f351){_0x1c1577['push'](_0x1c1577['shift']());}};_0x566d1f(++_0x1d4d6d);}(_0x01d4,0x1a7));var _0x401d=function(_0x1e2ee0,_0x481b5a){_0x1e2ee0=_0x1e2ee0-0x0;var _0x294079=_0x01d4[_0x1e2ee0];return _0x294079;};'use strict';var schema=require('validate');var _=require(_0x401d('0x0'));var htmlToText=require('html-to-text');var utils=require(_0x401d('0x1'));var logger=require(_0x401d('0x2'))(_0x401d('0x3'));var gotoif=schema({'condition':{'type':_0x401d('0x4'),'required':!![],'message':_0x401d('0x5')},'priorityTrue':{'type':_0x401d('0x6'),'message':_0x401d('0x7')},'priorityFalse':{'type':'number','message':_0x401d('0x8')}});exports['consequence']=function(_0x5d81fa,_0x15ce6d){return function(_0x2bab43){try{var _0x51d021={'condition':htmlToText[_0x401d('0x9')](utils[_0x401d('0xa')](_0x15ce6d[0x0],this),{'wordwrap':![]})[_0x401d('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x15ce6d[0x1],'priorityFalse':_0x15ce6d[0x2]};var _0x991393=gotoif[_0x401d('0xc')](_0x51d021,{'typecast':!![]});if(_0x991393[_0x401d('0xd')]){logger['error'](_0x401d('0xe'),_0x5d81fa,_[_0x401d('0xf')](_0x991393,_0x401d('0x10'))['join'](',\x20'));_0x2bab43[_0x401d('0x11')]();}else{try{var _0x2a115d=eval('('+_0x51d021[_0x401d('0x12')]+')');var _0x458cab=_0x2a115d?_0x51d021['priorityTrue']:_0x51d021[_0x401d('0x13')];logger[_0x401d('0x14')](_0x401d('0x15'),_0x5d81fa,_0x51d021[_0x401d('0x12')],_0x2a115d,_0x458cab||_0x401d('0x16'));if(_0x458cab){var _0x34a64c=_[_0x401d('0x17')](_0x2bab43[_0x401d('0x18')](),{'p':_0x458cab});if(_0x34a64c>=0x0){logger[_0x401d('0x14')](_0x401d('0x19'),_0x5d81fa,_0x458cab||_0x401d('0x16'),_0x34a64c);_0x2bab43[_0x401d('0x16')](_0x34a64c);}else{logger[_0x401d('0x14')](_0x401d('0x1a'),_0x5d81fa,_0x458cab||_0x401d('0x16'));_0x2bab43[_0x401d('0x11')]();}}else{_0x2bab43[_0x401d('0x16')]();}}catch(_0x231a8f){logger[_0x401d('0x1b')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5d81fa,_0x231a8f['message']);_0x2bab43['stop']();}}}catch(_0x17fb4f){logger['error'](_0x401d('0xe'),_0x5d81fa,JSON[_0x401d('0x1c')](_0x17fb4f));_0x2bab43[_0x401d('0x11')]();}};}; \ No newline at end of file +var _0x2193=['validate','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x2193,0x105));var _0x3219=function(_0x368859,_0x3025ae){_0x368859=_0x368859-0x0;var _0x1a0c3f=_0x2193[_0x368859];return _0x1a0c3f;};'use strict';var schema=require(_0x3219('0x0'));var _=require(_0x3219('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x3219('0x2'));var logger=require(_0x3219('0x3'))(_0x3219('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x3219('0x5')},'priorityTrue':{'type':_0x3219('0x6'),'message':_0x3219('0x7')},'priorityFalse':{'type':_0x3219('0x6'),'message':_0x3219('0x8')}});exports[_0x3219('0x9')]=function(_0x4fdfea,_0x251383){return function(_0x15cb80){try{var _0x4bd521={'condition':htmlToText[_0x3219('0xa')](utils['getMustacheRender'](_0x251383[0x0],this),{'wordwrap':![]})[_0x3219('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x251383[0x1],'priorityFalse':_0x251383[0x2]};var _0x1b97fb=gotoif[_0x3219('0x0')](_0x4bd521,{'typecast':!![]});if(_0x1b97fb[_0x3219('0xc')]){logger['error'](_0x3219('0xd'),_0x4fdfea,_[_0x3219('0xe')](_0x1b97fb,'message')[_0x3219('0xf')](',\x20'));_0x15cb80[_0x3219('0x10')]();}else{try{var _0xaefe7f=eval('('+_0x4bd521[_0x3219('0x11')]+')');var _0x456515=_0xaefe7f?_0x4bd521[_0x3219('0x12')]:_0x4bd521['priorityFalse'];logger[_0x3219('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4fdfea,_0x4bd521[_0x3219('0x11')],_0xaefe7f,_0x456515||_0x3219('0x14'));if(_0x456515){var _0x31b4b0=_[_0x3219('0x15')](_0x15cb80[_0x3219('0x16')](),{'p':_0x456515});if(_0x31b4b0>=0x0){logger['info'](_0x3219('0x17'),_0x4fdfea,_0x456515||_0x3219('0x14'),_0x31b4b0);_0x15cb80[_0x3219('0x14')](_0x31b4b0);}else{logger[_0x3219('0x13')](_0x3219('0x18'),_0x4fdfea,_0x456515||_0x3219('0x14'));_0x15cb80[_0x3219('0x10')]();}}else{_0x15cb80['next']();}}catch(_0x14793a){logger[_0x3219('0x19')](_0x3219('0x1a'),_0x4fdfea,_0x14793a[_0x3219('0x1b')]);_0x15cb80[_0x3219('0x10')]();}}}catch(_0x2e4d83){logger['error'](_0x3219('0xd'),_0x4fdfea,JSON[_0x3219('0x1c')](_0x2e4d83));_0x15cb80[_0x3219('0x10')]();}};}; \ 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 7fc58ae..1774c69 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 _0xfaa9=['map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x10e245,_0x4fab2c){var _0x4f1e63=function(_0x33c4f6){while(--_0x33c4f6){_0x10e245['push'](_0x10e245['shift']());}};_0x4f1e63(++_0x4fab2c);}(_0xfaa9,0xe7));var _0x9faa=function(_0x3a8179,_0x151337){_0x3a8179=_0x3a8179-0x0;var _0x5cc349=_0xfaa9[_0x3a8179];return _0x5cc349;};'use strict';var schema=require(_0x9faa('0x0'));var _=require(_0x9faa('0x1'));var logger=require('../../../../config/logger')(_0x9faa('0x2'));var gotop=schema({'priority':{'type':_0x9faa('0x3'),'required':!![],'message':_0x9faa('0x4')}});exports[_0x9faa('0x5')]=function(_0xf7836b,_0x431ba){return function(_0x66907a){try{var _0x3f45fa={'priority':_0x431ba[0x0]};var _0x166f56=gotop[_0x9faa('0x0')](_0x3f45fa,{'typecast':!![]});if(_0x166f56[_0x9faa('0x6')]){logger[_0x9faa('0x7')](_0x9faa('0x8'),_0xf7836b,_[_0x9faa('0x9')](_0x166f56,_0x9faa('0xa'))[_0x9faa('0xb')](',\x20'));_0x66907a['stop']();}else{logger[_0x9faa('0xc')](_0x9faa('0xd'),_0xf7836b,_0x3f45fa[_0x9faa('0xe')]);if(_0x3f45fa['priority']){var _0x2a314a=_[_0x9faa('0xf')](_0x66907a['rules'](),{'p':_0x3f45fa[_0x9faa('0xe')]});if(_0x2a314a>=0x0){logger['info'](_0x9faa('0x10'),_0xf7836b,_0x3f45fa['priority']||_0x9faa('0x11'),_0x2a314a);_0x66907a[_0x9faa('0x11')](_0x2a314a);}else{logger[_0x9faa('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0xf7836b,_0x3f45fa[_0x9faa('0xe')]||'next');_0x66907a[_0x9faa('0x12')]();}}else{_0x66907a[_0x9faa('0x11')]();}}}catch(_0x5c0bca){logger[_0x9faa('0x7')](_0x9faa('0x8'),_0xf7836b,JSON[_0x9faa('0x13')](_0x5c0bca));_0x66907a['stop']();}};}; \ No newline at end of file +var _0x5ae6=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x4739e5,_0x532219){var _0x4dd074=function(_0x5e45ce){while(--_0x5e45ce){_0x4739e5['push'](_0x4739e5['shift']());}};_0x4dd074(++_0x532219);}(_0x5ae6,0x1ab));var _0x65ae=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x5ae6[_0x470e67];return _0x28bbde;};'use strict';var schema=require(_0x65ae('0x0'));var _=require('lodash');var logger=require(_0x65ae('0x1'))(_0x65ae('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x65ae('0x3')}});exports[_0x65ae('0x4')]=function(_0x483a72,_0x502a01){return function(_0x213963){try{var _0xfa4c4={'priority':_0x502a01[0x0]};var _0x3baa8e=gotop[_0x65ae('0x0')](_0xfa4c4,{'typecast':!![]});if(_0x3baa8e[_0x65ae('0x5')]){logger[_0x65ae('0x6')](_0x65ae('0x7'),_0x483a72,_[_0x65ae('0x8')](_0x3baa8e,_0x65ae('0x9'))[_0x65ae('0xa')](',\x20'));_0x213963['stop']();}else{logger[_0x65ae('0xb')](_0x65ae('0xc'),_0x483a72,_0xfa4c4[_0x65ae('0xd')]);if(_0xfa4c4[_0x65ae('0xd')]){var _0x2f5316=_[_0x65ae('0xe')](_0x213963[_0x65ae('0xf')](),{'p':_0xfa4c4[_0x65ae('0xd')]});if(_0x2f5316>=0x0){logger[_0x65ae('0xb')](_0x65ae('0x10'),_0x483a72,_0xfa4c4[_0x65ae('0xd')]||'next',_0x2f5316);_0x213963['next'](_0x2f5316);}else{logger[_0x65ae('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x483a72,_0xfa4c4[_0x65ae('0xd')]||_0x65ae('0x11'));_0x213963[_0x65ae('0x12')]();}}else{_0x213963[_0x65ae('0x11')]();}}}catch(_0x4de97c){logger[_0x65ae('0x6')](_0x65ae('0x7'),_0x483a72,JSON[_0x65ae('0x13')](_0x4de97c));_0x213963['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 d4cd899..c54f100 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 _0x867f=['catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','AccountId','account','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x867f,0xdc));var _0xf867=function(_0x2bbb3d,_0x400061){_0x2bbb3d=_0x2bbb3d-0x0;var _0x5739f0=_0x867f[_0x2bbb3d];return _0x5739f0;};'use strict';var _=require(_0xf867('0x0'));var utils=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))('routing');var rpc={'chatMessage':require(_0xf867('0x3')),'openchannelMessage':require(_0xf867('0x4')),'mailMessage':require(_0xf867('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf867('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf867('0x7')]=function(_0xa00cc8,_0x2708d5){return function(_0x287b67){try{var _0x333ea2={'body':utils[_0xf867('0x8')](_0x2708d5[0x0],this),'ContactId':this[_0xf867('0x9')]['id']};if(this[_0xf867('0xa')]===_0xf867('0xb')){_0x333ea2[_0xf867('0xc')]=this['account']['id'];}else{_0x333ea2[_['upperFirst'](this[_0xf867('0xa')])+_0xf867('0xd')]=this[_0xf867('0xe')]['id'];}_0x333ea2[_['upperFirst'](this['channel'])+_0xf867('0xf')]=this[_0xf867('0x10')]['id'];if(rpc[this['channel']+_0xf867('0x11')]){return rpc[this[_0xf867('0xa')]+_0xf867('0x11')][_0xf867('0x12')](_0x333ea2)['then'](function(_0x8059d0){logger[_0xf867('0x13')](_0xf867('0x14'),_0xa00cc8,_0x333ea2[_0xf867('0x15')]);_0x287b67[_0xf867('0x16')]();})[_0xf867('0x17')](function(_0x37b752){logger[_0xf867('0x18')](_0xf867('0x14'),_0xa00cc8,JSON[_0xf867('0x19')](_0x37b752));_0x287b67['stop']();});}}catch(_0x55fb64){logger['error'](_0xf867('0x14'),_0xa00cc8,JSON[_0xf867('0x19')](_0x55fb64));_0x287b67[_0xf867('0x1a')]();}};}; \ No newline at end of file +var _0xceb5=['chat','account','upperFirst','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel'];(function(_0x221653,_0x2b341e){var _0x101040=function(_0x508db8){while(--_0x508db8){_0x221653['push'](_0x221653['shift']());}};_0x101040(++_0x2b341e);}(_0xceb5,0x81));var _0x5ceb=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xceb5[_0x5cbf0e];return _0x1c76f8;};'use strict';var _=require(_0x5ceb('0x0'));var utils=require(_0x5ceb('0x1'));var logger=require('../../../../config/logger')(_0x5ceb('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5ceb('0x3')),'mailMessage':require(_0x5ceb('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5ceb('0x5'))};exports['consequence']=function(_0x5890a3,_0xa70c09){return function(_0x5cefc2){try{var _0x3c69d8={'body':utils[_0x5ceb('0x6')](_0xa70c09[0x0],this),'ContactId':this[_0x5ceb('0x7')]['id']};if(this[_0x5ceb('0x8')]===_0x5ceb('0x9')){_0x3c69d8['ChatWebsiteId']=this[_0x5ceb('0xa')]['id'];}else{_0x3c69d8[_[_0x5ceb('0xb')](this[_0x5ceb('0x8')])+'AccountId']=this['account']['id'];}_0x3c69d8[_[_0x5ceb('0xb')](this[_0x5ceb('0x8')])+'InteractionId']=this[_0x5ceb('0xc')]['id'];if(rpc[this[_0x5ceb('0x8')]+_0x5ceb('0xd')]){return rpc[this[_0x5ceb('0x8')]+_0x5ceb('0xd')][_0x5ceb('0xe')](_0x3c69d8)[_0x5ceb('0xf')](function(_0x2c4044){logger[_0x5ceb('0x10')](_0x5ceb('0x11'),_0x5890a3,_0x3c69d8[_0x5ceb('0x12')]);_0x5cefc2[_0x5ceb('0x13')]();})[_0x5ceb('0x14')](function(_0x21b8d9){logger[_0x5ceb('0x15')]('[%s][MESSAGE]\x20%s',_0x5890a3,JSON['stringify'](_0x21b8d9));_0x5cefc2['stop']();});}}catch(_0x1a8d4c){logger['error'](_0x5ceb('0x11'),_0x5890a3,JSON[_0x5ceb('0x16')](_0x1a8d4c));_0x5cefc2['stop']();}};}; \ 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 fc4a41f..507eb73 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 _0xa1da=['getMustacheRender','next','error','stringify','stop','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x1bf2c5,_0x3832a8){var _0x2c67d4=function(_0x54e885){while(--_0x54e885){_0x1bf2c5['push'](_0x1bf2c5['shift']());}};_0x2c67d4(++_0x3832a8);}(_0xa1da,0xb0));var _0xaa1d=function(_0x1c652d,_0x51d5e2){_0x1c652d=_0x1c652d-0x0;var _0x42d920=_0xa1da[_0x1c652d];return _0x42d920;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0xaa1d('0x0'));exports[_0xaa1d('0x1')]=function(_0xace1cc,_0x567c23){return function(_0x2cc960){try{logger[_0xaa1d('0x2')](_0xaa1d('0x3'),_0xace1cc,utils[_0xaa1d('0x4')](_0x567c23[0x0],this));_0x2cc960[_0xaa1d('0x5')]();}catch(_0x27ea4c){logger[_0xaa1d('0x6')](_0xaa1d('0x3'),_0xace1cc,JSON[_0xaa1d('0x7')](_0x27ea4c));_0x2cc960[_0xaa1d('0x8')]();}};}; \ No newline at end of file +var _0x4804=['stop','../../../../config/logger','routing','consequence','info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify'];(function(_0x1ba8b9,_0x46beb9){var _0x2b5446=function(_0x29d7b4){while(--_0x29d7b4){_0x1ba8b9['push'](_0x1ba8b9['shift']());}};_0x2b5446(++_0x46beb9);}(_0x4804,0xab));var _0x4480=function(_0x30f221,_0x37df21){_0x30f221=_0x30f221-0x0;var _0x23fbed=_0x4804[_0x30f221];return _0x23fbed;};'use strict';var utils=require('./utils');var logger=require(_0x4480('0x0'))(_0x4480('0x1'));exports[_0x4480('0x2')]=function(_0x6b28c5,_0xbc168){return function(_0x51c31f){try{logger[_0x4480('0x3')]('[%s][NOOP]\x20%s',_0x6b28c5,utils[_0x4480('0x4')](_0xbc168[0x0],this));_0x51c31f[_0x4480('0x5')]();}catch(_0x527a5a){logger[_0x4480('0x6')](_0x4480('0x7'),_0x6b28c5,JSON[_0x4480('0x8')](_0x527a5a));_0x51c31f[_0x4480('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 02918f0..52616f4 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 _0xf927=['close','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','emit','clone','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','interaction','then','QueueReport','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END'];(function(_0x309698,_0x5493f9){var _0x377a56=function(_0x53019d){while(--_0x53019d){_0x309698['push'](_0x309698['shift']());}};_0x377a56(++_0x5493f9);}(_0xf927,0x15c));var _0x7f92=function(_0x2e880b,_0x2059b6){_0x2e880b=_0x2e880b-0x0;var _0x5b0611=_0xf927[_0x2e880b];return _0x5b0611;};'use strict';var schema=require(_0x7f92('0x0'));var _=require(_0x7f92('0x1'));var util=require(_0x7f92('0x2'));var seqqueue=require(_0x7f92('0x3'));var moment=require(_0x7f92('0x4'));var Redis=require(_0x7f92('0x5'));var config=require(_0x7f92('0x6'));var logger=require('../../../../config/logger')(_0x7f92('0x7'));var strategy=require(_0x7f92('0x8'));config[_0x7f92('0x9')]=_[_0x7f92('0xa')](config[_0x7f92('0x9')],{'host':_0x7f92('0xb'),'port':0x18eb});var io=require(_0x7f92('0xc'))(new Redis(config['redis']));var attributes=['id',_0x7f92('0xd'),_0x7f92('0xe'),_0x7f92('0xf'),'from','joinAt'];function emit(_0x2984f4,_0x181640,_0x5a6673){io['to'](_0x2984f4)[_0x7f92('0x10')](_0x181640,_0x5a6673);}function emitChannelQueueInteraction(_0x380e38,_0x1ff1eb,_0x3bd62d,_0x119467,_0x5f2434,_0x50587f,_0x8dd455,_0x48f687){var _0x12ff0a=_[_0x7f92('0x11')](_0x3bd62d);_0x12ff0a[_0x7f92('0xd')]=_0x48f687;_0x12ff0a[_0x7f92('0xf')]=_0x1ff1eb;_0x12ff0a['account']=_0x119467;_0x12ff0a['id']=_0x5f2434;if(_0x50587f){attributes['push'](_['capitalize'](_0x380e38)+_0x7f92('0x12'));_0x8dd455[util[_0x7f92('0x13')](_0x7f92('0x14'),_0x380e38)][_0x5f2434]=_[_0x7f92('0x15')](_0x12ff0a,attributes);}else{delete _0x8dd455[util['format'](_0x7f92('0x14'),_0x380e38)][_0x5f2434];}emit(util[_0x7f92('0x13')](_0x7f92('0x16'),_0x380e38,_0x1ff1eb),util[_0x7f92('0x13')](_0x7f92('0x17'),_0x380e38,_0x50587f?_0x7f92('0x18'):_0x7f92('0x19')),_['pick'](_0x12ff0a,attributes));}var rpc={'openchannelQueueReport':require(_0x7f92('0x1a')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x7f92('0x1b')),'smsQueueReport':require(_0x7f92('0x1c')),'faxQueueReport':require(_0x7f92('0x1d')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require(_0x7f92('0x1e')),'faxInteraction':require(_0x7f92('0x1f')),'mailInteraction':require(_0x7f92('0x20')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x7f92('0x21')),'whatsappInteraction':require(_0x7f92('0x22'))};var queue=schema({'name':{'type':_0x7f92('0x23'),'required':!![],'message':_0x7f92('0x24')},'timeout':{'type':_0x7f92('0x25'),'message':_0x7f92('0x26')}});function startRouting(_0x44f157,_0x324243,_0x55b2f6,_0x1dda45){if(_0x44f157&&_0x324243&&_0x55b2f6){_0x324243[_0x7f92('0x27')]+=0x1;var _0x565ed4={'uniqueid':_0x44f157,'from':_0x55b2f6[_0x7f92('0x28')]?_0x55b2f6[_0x7f92('0x28')][_0x7f92('0x29')]:'','joinAt':moment()[_0x7f92('0x13')](_0x7f92('0x2a')),'ContactId':_0x55b2f6['contact']?_0x55b2f6['contact']['id']:null,'ListId':_0x55b2f6['list']?_0x55b2f6[_0x7f92('0x2b')]['id']:null};_0x565ed4[_[_0x7f92('0x2c')](_0x55b2f6['channel'])+'QueueId']=_0x324243['id']||null;_0x565ed4[_[_0x7f92('0x2c')](_0x55b2f6[_0x7f92('0x2d')])+_0x7f92('0x12')]=_0x55b2f6['interaction']?_0x55b2f6['interaction']['id']:null;_0x565ed4[_[_0x7f92('0x2c')](_0x55b2f6['channel'])+_0x7f92('0x2e')]=_0x55b2f6[_0x7f92('0x2f')]?_0x55b2f6[_0x7f92('0x2f')]['id']:null;_0x565ed4[_[_0x7f92('0x2c')](_0x55b2f6[_0x7f92('0x2d')])+(_0x55b2f6[_0x7f92('0x2d')]!==_0x7f92('0x30')?_0x7f92('0x31'):_0x7f92('0x32'))]=_0x55b2f6[_0x7f92('0xe')]?_0x55b2f6[_0x7f92('0xe')]['id']:null;logger[_0x7f92('0x33')](util[_0x7f92('0x13')](_0x7f92('0x34'),_0x44f157,_0x324243[_0x7f92('0x35')]));emitChannelQueueInteraction(_0x55b2f6['channel'],_0x324243['name'],_0x565ed4,_0x55b2f6[_0x7f92('0xe')][_0x7f92('0x35')],_0x55b2f6[_0x7f92('0x2f')]['id'],!![],_0x1dda45,_0x324243['id']);if(rpc[_0x55b2f6[_0x7f92('0x2d')]+'QueueReport']){return rpc[_0x55b2f6[_0x7f92('0x2d')]+'QueueReport']['create'](_0x565ed4)[_0x7f92('0x36')](function(_0x43e8d5){logger['error'](_0x7f92('0x37'),_0x43e8d5);});}}}function stopRouting(_0x45d60a,_0x22fbcd,_0x5cc416,_0x5783a0){if(_0x45d60a&&_0x22fbcd){_0x22fbcd[_0x7f92('0x27')]-=0x1;var _0x48a3bf={'leaveAt':moment()[_0x7f92('0x13')](_0x7f92('0x2a')),'acceptAt':moment()[_0x7f92('0x13')](_0x7f92('0x2a')),'reason':_0x7f92('0x38')};logger[_0x7f92('0x33')](util['format'](_0x7f92('0x39'),_0x45d60a,_0x22fbcd['name']));emitChannelQueueInteraction(_0x5cc416[_0x7f92('0x2d')],_0x22fbcd[_0x7f92('0x35')],_0x5cc416[_0x7f92('0x28')],_0x5cc416[_0x7f92('0xe')][_0x7f92('0x35')],_0x5cc416[_0x7f92('0x2f')]['id'],![],_0x5783a0,_0x22fbcd['id']);return rpc[_0x5cc416[_0x7f92('0x2d')]+_0x7f92('0x3a')][_0x7f92('0x3b')](_0x5cc416[_0x7f92('0x3c')]['id'],{'queueId':_0x22fbcd['id']})[_0x7f92('0x3d')](function(){if(rpc[_0x5cc416[_0x7f92('0x2d')]+'QueueReport']){return rpc[_0x5cc416['channel']+_0x7f92('0x3e')]['update'](_0x45d60a,_0x48a3bf)[_0x7f92('0x36')](function(_0x474b46){logger[_0x7f92('0x3f')](_0x7f92('0x40'),_0x474b46);});}});}}function endRouting(_0x188033,_0x5f030c,_0x3ea026,_0x34dc36){if(_0x188033&&_0x5f030c){_0x5f030c[_0x7f92('0x27')]-=0x1;var _0x30418f={'leaveAt':moment()[_0x7f92('0x13')](_0x7f92('0x2a')),'exitAt':moment()[_0x7f92('0x13')](_0x7f92('0x2a')),'reason':'timeout'};logger[_0x7f92('0x33')](util[_0x7f92('0x13')](_0x7f92('0x41'),_0x188033,_0x5f030c[_0x7f92('0x35')]));emitChannelQueueInteraction(_0x3ea026['channel'],_0x5f030c[_0x7f92('0x35')],_0x3ea026[_0x7f92('0x28')],_0x3ea026[_0x7f92('0xe')][_0x7f92('0x35')],_0x3ea026[_0x7f92('0x2f')]['id'],![],_0x34dc36);if(rpc[_0x3ea026[_0x7f92('0x2d')]+_0x7f92('0x3e')]){return rpc[_0x3ea026[_0x7f92('0x2d')]+_0x7f92('0x3e')][_0x7f92('0x3b')](_0x188033,_0x30418f)[_0x7f92('0x36')](function(_0x3941fc){logger[_0x7f92('0x3f')](_0x7f92('0x40'),_0x3941fc);});}}}function handleFindQueue(_0x1ff574){return function(_0x4d37a4){return _0x4d37a4['name'][_0x7f92('0x42')]()===_0x1ff574[_0x7f92('0x42')]();};}exports[_0x7f92('0x43')]=function(_0x2247ae,_0x5c0566,_0x3833f3,_0x214c1a){return function(_0x3d5bb5){try{var _0xe3f661={'name':_0x5c0566[0x0],'timeout':_0x5c0566[0x1]};var _0x118938=queue['validate'](_0xe3f661,{'typecast':!![]});if(_0x118938[_0x7f92('0x44')]){logger['error']('[%s][QUEUE]\x20%s',_0x2247ae,_[_0x7f92('0x45')](_0x118938,_0x7f92('0x2f'))[_0x7f92('0x46')](',\x20'));_0x3d5bb5[_0x7f92('0x47')]();}else{var _0x2ba1ec=_['find'](_0x3833f3[_0x214c1a[_0x7f92('0x2d')]+_0x7f92('0x48')],handleFindQueue(_0xe3f661['name']));if(_0x2ba1ec){startRouting(_0x2247ae,_0x2ba1ec,_0x214c1a,_0x3833f3);var _0x56867d=(_0x2ba1ec[_0x7f92('0x49')]||0xa)*0x3e8;var _0x92363c=(_0xe3f661[_0x7f92('0x49')]||0x14)*0x3e8;var _0xdc1a78;if(_0x56867d>_0x92363c){_0x92363c=_0x56867d;}var _0x23e083=seqqueue[_0x7f92('0x4a')](_0x56867d);_0x23e083['id']=_0x2247ae;_0x23e083[_0x7f92('0x4b')]=_0x56867d;_0x23e083[_0x7f92('0x4c')]=_0x92363c;_0x23e083[_0x7f92('0x2d')]=_0x214c1a[_0x7f92('0x2d')];_0x3833f3[_0x7f92('0x4d')][_0x2247ae]['on'](_0x7f92('0x4e'),function(){logger[_0x7f92('0x33')](_0x7f92('0x4f'),_0x2247ae);stopRouting(_0x2247ae,_0x2ba1ec,_0x214c1a,_0x3833f3);clearTimeout(_0xdc1a78);_0xdc1a78=undefined;_0x23e083['close'](!![]);if(_0x3833f3[_0x7f92('0x4d')][_0x2247ae]){delete _0x3833f3[_0x7f92('0x4d')][_0x2247ae];}_0x3d5bb5['stop']();});_0x3833f3[_0x7f92('0x4d')][_0x2247ae]['on'](_0x7f92('0x50'),function(){if(_0x3833f3[_0x7f92('0x4d')][_0x2247ae]){delete _0x3833f3['rules'][_0x2247ae];}});_0xdc1a78=setTimeout(function(){logger['info'](_0x7f92('0x51'),_0x2247ae);endRouting(_0x2247ae,_0x2ba1ec,_0x214c1a,_0x3833f3);clearTimeout(_0xdc1a78);_0x23e083[_0x7f92('0x52')](!![]);_0x3d5bb5['next']();},_0x92363c);switch(_0x2ba1ec['strategy']){case _0x7f92('0x53'):strategy['rrmemory'](_0x23e083,_0x2ba1ec,_0x3833f3,_0x214c1a);break;default:strategy[_0x7f92('0x54')](_0x23e083,_0x2ba1ec,_0x3833f3,_0x214c1a);}}else{logger[_0x7f92('0x3f')](_0x7f92('0x55'),_0x2247ae,_0xe3f661[_0x7f92('0x35')]);_0x3d5bb5[_0x7f92('0x47')]();}}}catch(_0x4aa541){logger[_0x7f92('0x3f')]('[%s][QUEUE]\x20%s',_0x2247ae,_0x4aa541['stack']);_0x3d5bb5['stop']();}};}; \ No newline at end of file +var _0x8aa2=['../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','interaction','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','createQueue','atimeout','qtimeout','rules','end','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','routing','./strategy','defaults','redis','localhost','socket.io-emitter','account','queue','from','emit','clone','queue_id','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','save','pick','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction'];(function(_0x115d95,_0x5e7589){var _0x27fe57=function(_0x4149c9){while(--_0x4149c9){_0x115d95['push'](_0x115d95['shift']());}};_0x27fe57(++_0x5e7589);}(_0x8aa2,0x12e));var _0x28aa=function(_0x301590,_0x2c129b){_0x301590=_0x301590-0x0;var _0x405d17=_0x8aa2[_0x301590];return _0x405d17;};'use strict';var schema=require(_0x28aa('0x0'));var _=require(_0x28aa('0x1'));var util=require(_0x28aa('0x2'));var seqqueue=require(_0x28aa('0x3'));var moment=require(_0x28aa('0x4'));var Redis=require(_0x28aa('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x28aa('0x6'));var strategy=require(_0x28aa('0x7'));config['redis']=_[_0x28aa('0x8')](config[_0x28aa('0x9')],{'host':_0x28aa('0xa'),'port':0x18eb});var io=require(_0x28aa('0xb'))(new Redis(config[_0x28aa('0x9')]));var attributes=['id','queue_id',_0x28aa('0xc'),_0x28aa('0xd'),_0x28aa('0xe'),'joinAt'];function emit(_0x32deb2,_0x32aed2,_0x428e20){io['to'](_0x32deb2)[_0x28aa('0xf')](_0x32aed2,_0x428e20);}function emitChannelQueueInteraction(_0x13ec63,_0x176891,_0x2af30e,_0x52ce19,_0x260851,_0x293892,_0x43af32,_0x6e1f9f){var _0x45154f=_[_0x28aa('0x10')](_0x2af30e);_0x45154f[_0x28aa('0x11')]=_0x6e1f9f;_0x45154f[_0x28aa('0xd')]=_0x176891;_0x45154f[_0x28aa('0xc')]=_0x52ce19;_0x45154f['id']=_0x260851;if(_0x293892){attributes[_0x28aa('0x12')](_[_0x28aa('0x13')](_0x13ec63)+_0x28aa('0x14'));_0x43af32[util[_0x28aa('0x15')](_0x28aa('0x16'),_0x13ec63)][_0x260851]=_['pick'](_0x45154f,attributes);}else{delete _0x43af32[util[_0x28aa('0x15')](_0x28aa('0x16'),_0x13ec63)][_0x260851];}emit(util[_0x28aa('0x15')]('%s:queue:%s',_0x13ec63,_0x176891),util['format']('%s_queue_waiting_interaction:%s',_0x13ec63,_0x293892?_0x28aa('0x17'):'remove'),_[_0x28aa('0x18')](_0x45154f,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x28aa('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x28aa('0x1a')),'faxQueueReport':require(_0x28aa('0x1b')),'whatsappQueueReport':require(_0x28aa('0x1c')),'chatInteraction':require(_0x28aa('0x1d')),'faxInteraction':require(_0x28aa('0x1e')),'mailInteraction':require(_0x28aa('0x1f')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x28aa('0x20')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x28aa('0x21'),'required':!![],'message':_0x28aa('0x22')},'timeout':{'type':_0x28aa('0x23'),'message':_0x28aa('0x24')}});function startRouting(_0x78cdd5,_0x98b33f,_0x3c327d,_0x213081){if(_0x78cdd5&&_0x98b33f&&_0x3c327d){_0x98b33f[_0x28aa('0x25')]+=0x1;var _0x4b8255={'uniqueid':_0x78cdd5,'from':_0x3c327d[_0x28aa('0x26')]?_0x3c327d['body']['from']:'','joinAt':moment()[_0x28aa('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c327d[_0x28aa('0x27')]?_0x3c327d[_0x28aa('0x27')]['id']:null,'ListId':_0x3c327d['list']?_0x3c327d[_0x28aa('0x28')]['id']:null};_0x4b8255[_[_0x28aa('0x29')](_0x3c327d['channel'])+_0x28aa('0x2a')]=_0x98b33f['id']||null;_0x4b8255[_['upperFirst'](_0x3c327d[_0x28aa('0x2b')])+_0x28aa('0x14')]=_0x3c327d['interaction']?_0x3c327d['interaction']['id']:null;_0x4b8255[_['upperFirst'](_0x3c327d[_0x28aa('0x2b')])+_0x28aa('0x2c')]=_0x3c327d[_0x28aa('0x2d')]?_0x3c327d[_0x28aa('0x2d')]['id']:null;_0x4b8255[_[_0x28aa('0x29')](_0x3c327d[_0x28aa('0x2b')])+(_0x3c327d[_0x28aa('0x2b')]!==_0x28aa('0x2e')?_0x28aa('0x2f'):'WebsiteId')]=_0x3c327d[_0x28aa('0xc')]?_0x3c327d[_0x28aa('0xc')]['id']:null;logger[_0x28aa('0x30')](util['format'](_0x28aa('0x31'),_0x78cdd5,_0x98b33f['name']));emitChannelQueueInteraction(_0x3c327d[_0x28aa('0x2b')],_0x98b33f[_0x28aa('0x32')],_0x4b8255,_0x3c327d[_0x28aa('0xc')][_0x28aa('0x32')],_0x3c327d[_0x28aa('0x2d')]['id'],!![],_0x213081,_0x98b33f['id']);if(rpc[_0x3c327d[_0x28aa('0x2b')]+'QueueReport']){return rpc[_0x3c327d[_0x28aa('0x2b')]+_0x28aa('0x33')][_0x28aa('0x34')](_0x4b8255)['catch'](function(_0x39fb11){logger[_0x28aa('0x35')](_0x28aa('0x36'),_0x39fb11);});}}}function stopRouting(_0x3edec7,_0x44c0e1,_0x26fe2b,_0x2c0f67){if(_0x3edec7&&_0x44c0e1){_0x44c0e1['waiting']-=0x1;var _0x494d2d={'leaveAt':moment()['format'](_0x28aa('0x37')),'acceptAt':moment()[_0x28aa('0x15')](_0x28aa('0x37')),'reason':_0x28aa('0x38')};logger[_0x28aa('0x30')](util[_0x28aa('0x15')](_0x28aa('0x39'),_0x3edec7,_0x44c0e1[_0x28aa('0x32')]));emitChannelQueueInteraction(_0x26fe2b[_0x28aa('0x2b')],_0x44c0e1[_0x28aa('0x32')],_0x26fe2b['body'],_0x26fe2b[_0x28aa('0xc')][_0x28aa('0x32')],_0x26fe2b[_0x28aa('0x2d')]['id'],![],_0x2c0f67,_0x44c0e1['id']);return rpc[_0x26fe2b[_0x28aa('0x2b')]+_0x28aa('0x3a')][_0x28aa('0x3b')](_0x26fe2b[_0x28aa('0x3c')]['id'],{'queueId':_0x44c0e1['id']})['then'](function(){if(rpc[_0x26fe2b[_0x28aa('0x2b')]+_0x28aa('0x33')]){return rpc[_0x26fe2b[_0x28aa('0x2b')]+_0x28aa('0x33')][_0x28aa('0x3b')](_0x3edec7,_0x494d2d)[_0x28aa('0x3d')](function(_0x1aec9b){logger['error'](_0x28aa('0x3e'),_0x1aec9b);});}});}}function endRouting(_0x2d34d6,_0x193e9f,_0x11ae2a,_0x2396a7){if(_0x2d34d6&&_0x193e9f){_0x193e9f[_0x28aa('0x25')]-=0x1;var _0x3d8aea={'leaveAt':moment()[_0x28aa('0x15')](_0x28aa('0x37')),'exitAt':moment()[_0x28aa('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x28aa('0x3f')};logger[_0x28aa('0x30')](util[_0x28aa('0x15')](_0x28aa('0x40'),_0x2d34d6,_0x193e9f['name']));emitChannelQueueInteraction(_0x11ae2a[_0x28aa('0x2b')],_0x193e9f[_0x28aa('0x32')],_0x11ae2a[_0x28aa('0x26')],_0x11ae2a['account'][_0x28aa('0x32')],_0x11ae2a[_0x28aa('0x2d')]['id'],![],_0x2396a7);if(rpc[_0x11ae2a['channel']+'QueueReport']){return rpc[_0x11ae2a[_0x28aa('0x2b')]+_0x28aa('0x33')][_0x28aa('0x3b')](_0x2d34d6,_0x3d8aea)[_0x28aa('0x3d')](function(_0xa057bc){logger['error'](_0x28aa('0x3e'),_0xa057bc);});}}}function handleFindQueue(_0x39c113){return function(_0x706c25){return _0x706c25['name'][_0x28aa('0x41')]()===_0x39c113[_0x28aa('0x41')]();};}exports['consequence']=function(_0x209e0a,_0x3c16a7,_0x35cc4f,_0x45a700){return function(_0x27188a){try{var _0x52bc29={'name':_0x3c16a7[0x0],'timeout':_0x3c16a7[0x1]};var _0x44d58e=queue[_0x28aa('0x0')](_0x52bc29,{'typecast':!![]});if(_0x44d58e[_0x28aa('0x42')]){logger[_0x28aa('0x35')](_0x28aa('0x43'),_0x209e0a,_['map'](_0x44d58e,_0x28aa('0x2d'))[_0x28aa('0x44')](',\x20'));_0x27188a[_0x28aa('0x45')]();}else{var _0x382c3c=_[_0x28aa('0x46')](_0x35cc4f[_0x45a700[_0x28aa('0x2b')]+'Queues'],handleFindQueue(_0x52bc29[_0x28aa('0x32')]));if(_0x382c3c){startRouting(_0x209e0a,_0x382c3c,_0x45a700,_0x35cc4f);var _0x2f47f1=(_0x382c3c[_0x28aa('0x3f')]||0xa)*0x3e8;var _0x32b942=(_0x52bc29[_0x28aa('0x3f')]||0x14)*0x3e8;var _0x87bfd8;if(_0x2f47f1>_0x32b942){_0x32b942=_0x2f47f1;}var _0x22fcf0=seqqueue[_0x28aa('0x47')](_0x2f47f1);_0x22fcf0['id']=_0x209e0a;_0x22fcf0[_0x28aa('0x48')]=_0x2f47f1;_0x22fcf0[_0x28aa('0x49')]=_0x32b942;_0x22fcf0[_0x28aa('0x2b')]=_0x45a700[_0x28aa('0x2b')];_0x35cc4f[_0x28aa('0x4a')][_0x209e0a]['on'](_0x28aa('0x4b'),function(){logger[_0x28aa('0x30')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x209e0a);stopRouting(_0x209e0a,_0x382c3c,_0x45a700,_0x35cc4f);clearTimeout(_0x87bfd8);_0x87bfd8=undefined;_0x22fcf0['close'](!![]);if(_0x35cc4f[_0x28aa('0x4a')][_0x209e0a]){delete _0x35cc4f[_0x28aa('0x4a')][_0x209e0a];}_0x27188a['stop']();});_0x35cc4f[_0x28aa('0x4a')][_0x209e0a]['on'](_0x28aa('0x4c'),function(){if(_0x35cc4f[_0x28aa('0x4a')][_0x209e0a]){delete _0x35cc4f[_0x28aa('0x4a')][_0x209e0a];}});_0x87bfd8=setTimeout(function(){logger[_0x28aa('0x30')](_0x28aa('0x4d'),_0x209e0a);endRouting(_0x209e0a,_0x382c3c,_0x45a700,_0x35cc4f);clearTimeout(_0x87bfd8);_0x22fcf0['close'](!![]);_0x27188a[_0x28aa('0x4e')]();},_0x32b942);switch(_0x382c3c['strategy']){case'rrmemory':strategy[_0x28aa('0x4f')](_0x22fcf0,_0x382c3c,_0x35cc4f,_0x45a700);break;default:strategy[_0x28aa('0x50')](_0x22fcf0,_0x382c3c,_0x35cc4f,_0x45a700);}}else{logger['error'](_0x28aa('0x51'),_0x209e0a,_0x52bc29['name']);_0x27188a[_0x28aa('0x45')]();}}}catch(_0x4f70ce){logger[_0x28aa('0x35')](_0x28aa('0x43'),_0x209e0a,_0x4f70ce[_0x28aa('0x52')]);_0x27188a['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 a4ef1dc..ae2d256 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 _0xb66c=['TIMEOUT','lodash','./util','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','debug','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','agents','busyQueue','saveWaitingNotification','channel','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','writeLog','STOP'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb66c,0x175));var _0xcb66=function(_0x3b98a0,_0x10c84){_0x3b98a0=_0x3b98a0-0x0;var _0x1d3d39=_0xb66c[_0x3b98a0];return _0x1d3d39;};'use strict';var _=require(_0xcb66('0x0'));var uuid=require('uuid');var util=require(_0xcb66('0x1'));var logger=require('../../../../../config/logger')(_0xcb66('0x2'));var Agent=function(_0x24ea13,_0xf7ccc5,_0x5f487c,_0x35d439){this[_0xcb66('0x3')]=uuid['v4']();this[_0xcb66('0x4')]=_0x24ea13;this[_0xcb66('0x5')]=_0xf7ccc5;this['realtime']=_0x5f487c;this['routing']=_0x35d439;this[_0xcb66('0x4')][_0xcb66('0x6')](this[_0xcb66('0x7')][_0xcb66('0x8')](this),this[_0xcb66('0x9')]['bind'](this));this[_0xcb66('0x4')]['on'](_0xcb66('0xa'),this[_0xcb66('0x9')][_0xcb66('0x8')](this));this[_0xcb66('0x4')]['on']('drained',this[_0xcb66('0xb')][_0xcb66('0x8')](this));};Agent[_0xcb66('0xc')][_0xcb66('0x6')]=function(){this['squeue'][_0xcb66('0x6')](this[_0xcb66('0x7')][_0xcb66('0x8')](this),this[_0xcb66('0x9')]['bind'](this));};Agent[_0xcb66('0xc')][_0xcb66('0xb')]=function(){this[_0xcb66('0x9')](!![]);};Agent[_0xcb66('0xc')]['handleRun']=function(){logger[_0xcb66('0xd')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xcb66('0x4')]['id'],this['agent']['id']);if(_[_0xcb66('0xe')](this['realtime']['agents'][this[_0xcb66('0x5')]['id']])){logger[_0xcb66('0xd')](_0xcb66('0xf'),this[_0xcb66('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xcb66('0x6')][_0xcb66('0x8')](this),0x3e8);}else{if(this[_0xcb66('0x2')]['forcedOwnership']||util[_0xcb66('0x10')](this['squeue']['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],this[_0xcb66('0x4')]['channel'],![])){this['realtime']['agents'][this[_0xcb66('0x5')]['id']]['busy']=!![];this['realtime'][_0xcb66('0x12')][this['agent']['id']][_0xcb66('0x13')]=undefined;util[_0xcb66('0x14')](this[_0xcb66('0x11')],this[_0xcb66('0x2')],this[_0xcb66('0x5')],this[_0xcb66('0x4')][_0xcb66('0x15')]);util['showNotification'](this[_0xcb66('0x3')],this['squeue']['id'],this['realtime'][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],null,this[_0xcb66('0x2')]);util['writeLog'](this[_0xcb66('0x4')]['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],'RINGING'+(this[_0xcb66('0x2')][_0xcb66('0x16')]?_0xcb66('0x17'):''));}else{logger[_0xcb66('0xd')](_0xcb66('0x18'),this[_0xcb66('0x4')]['id'],this[_0xcb66('0x5')]['id']);setTimeout(this[_0xcb66('0x6')][_0xcb66('0x8')](this),0x3e8);}}};Agent[_0xcb66('0xc')]['handleTimeout']=function(_0x2152dc){if(_['isNil'](this['realtime']['agents'][this[_0xcb66('0x5')]['id']])){return logger['debug'](_0xcb66('0xf'),this[_0xcb66('0x4')]['id'],this[_0xcb66('0x5')]['id']);}else{logger['debug'](_0xcb66('0x19'),this[_0xcb66('0x4')]['id'],this[_0xcb66('0x5')]['id']);util[_0xcb66('0x1a')](this[_0xcb66('0x3')],this[_0xcb66('0x4')]['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],null,this[_0xcb66('0x2')]);this['realtime'][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']][_0xcb66('0x1b')]=![];this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']][_0xcb66('0x13')]=undefined;util['removeWaitingNotification'](this[_0xcb66('0x11')],this[_0xcb66('0x2')],this[_0xcb66('0x5')],this[_0xcb66('0x4')]['channel']);util[_0xcb66('0x1c')](this[_0xcb66('0x4')]['id'],this[_0xcb66('0x11')][_0xcb66('0x12')][this[_0xcb66('0x5')]['id']],_0x2152dc?_0xcb66('0x1d'):_0xcb66('0x1e'));}if(!_0x2152dc){setTimeout(this[_0xcb66('0x6')][_0xcb66('0x8')](this),0x3e8);}};function agent(_0x299156,_0x3dc592,_0x17b087,_0x4ef8ba){return new Agent(_0x299156,_0x3dc592,_0x17b087,_0x4ef8ba);}module['exports']=agent; \ No newline at end of file +var _0xd67b=['handleRun','bind','handleTimeout','timeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push'];(function(_0x1a71c1,_0x16e38c){var _0x33aaef=function(_0x2f14df){while(--_0x2f14df){_0x1a71c1['push'](_0x1a71c1['shift']());}};_0x33aaef(++_0x16e38c);}(_0xd67b,0x133));var _0xbd67=function(_0x6c1b52,_0x2d4d72){_0x6c1b52=_0x6c1b52-0x0;var _0x1224d9=_0xd67b[_0x6c1b52];return _0x1224d9;};'use strict';var _=require('lodash');var uuid=require(_0xbd67('0x0'));var util=require('./util');var logger=require(_0xbd67('0x1'))(_0xbd67('0x2'));var Agent=function(_0x317e33,_0x5e967b,_0x40e384,_0x50da5a){this[_0xbd67('0x3')]=uuid['v4']();this['squeue']=_0x317e33;this[_0xbd67('0x4')]=_0x5e967b;this[_0xbd67('0x5')]=_0x40e384;this[_0xbd67('0x2')]=_0x50da5a;this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this[_0xbd67('0x6')]['on'](_0xbd67('0xb'),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this['squeue']['on']('drained',this[_0xbd67('0xc')]['bind'](this));};Agent[_0xbd67('0xd')][_0xbd67('0x7')]=function(){this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));};Agent[_0xbd67('0xd')][_0xbd67('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0xbd67('0xd')][_0xbd67('0x8')]=function(){logger[_0xbd67('0xe')](_0xbd67('0xf'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this[_0xbd67('0x7')]['bind'](this),0x3e8);}else{if(this[_0xbd67('0x2')][_0xbd67('0x12')]||util[_0xbd67('0x13')](this['squeue']['id'],this[_0xbd67('0x5')]['agents'][this[_0xbd67('0x4')]['id']],this[_0xbd67('0x6')][_0xbd67('0x14')],![])){this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=!![];this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']]['busyQueue']=undefined;util[_0xbd67('0x16')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this[_0xbd67('0x6')][_0xbd67('0x14')]);util[_0xbd67('0x17')](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this[_0xbd67('0x2')]);util['writeLog'](this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],_0xbd67('0x18')+(this[_0xbd67('0x2')]['forcedOwnership']?_0xbd67('0x19'):''));}else{logger[_0xbd67('0xe')](_0xbd67('0x1a'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xbd67('0xd')][_0xbd67('0xa')]=function(_0x4675ac){if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){return logger[_0xbd67('0xe')](_0xbd67('0x1b'),this[_0xbd67('0x6')]['id'],this['agent']['id']);}else{logger['debug'](_0xbd67('0x1c'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);util['hideNotification'](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this['routing']);this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=![];this['realtime']['agents'][this[_0xbd67('0x4')]['id']][_0xbd67('0x1d')]=undefined;util[_0xbd67('0x1e')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this['squeue'][_0xbd67('0x14')]);util[_0xbd67('0x1f')](this[_0xbd67('0x6')]['id'],this['realtime'][_0xbd67('0x11')][this['agent']['id']],_0x4675ac?_0xbd67('0x20'):_0xbd67('0x21'));}if(!_0x4675ac){setTimeout(this['push'][_0xbd67('0x9')](this),0x3e8);}};function agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777){return new Agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777);}module[_0xbd67('0x22')]=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 d9a9684..f991445 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 _0x587b=['STOP','TIMEOUT','busy','removeWaitingNotification','lodash','uuid','./util','../../../../../config/logger','routing','squeue','realtime','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','isNil','queue','Agents','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','RINGING','busyQueue','saveWaitingNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','length','hideNotification','notificationId','writeLog'];(function(_0x27657c,_0x36813e){var _0x12324a=function(_0x3f6eea){while(--_0x3f6eea){_0x27657c['push'](_0x27657c['shift']());}};_0x12324a(++_0x36813e);}(_0x587b,0x17a));var _0xb587=function(_0x15bed0,_0x37780e){_0x15bed0=_0x15bed0-0x0;var _0x5d727a=_0x587b[_0x15bed0];return _0x5d727a;};'use strict';var _=require(_0xb587('0x0'));var uuid=require(_0xb587('0x1'));var util=require(_0xb587('0x2'));var logger=require(_0xb587('0x3'))(_0xb587('0x4'));var Beepall=function(_0x2f4f25,_0x5aaf67,_0x4c49f9,_0x24951f){this['notificationId']=uuid['v4']();this[_0xb587('0x5')]=_0x2f4f25;this['queue']=_0x5aaf67;this[_0xb587('0x6')]=_0x4c49f9;this[_0xb587('0x4')]=_0x24951f;this[_0xb587('0x5')]['push'](this[_0xb587('0x7')][_0xb587('0x8')](this),this[_0xb587('0x9')]['bind'](this));this['squeue']['on'](_0xb587('0xa'),this[_0xb587('0x9')][_0xb587('0x8')](this));this[_0xb587('0x5')]['on'](_0xb587('0xb'),this[_0xb587('0xc')]['bind'](this));};Beepall[_0xb587('0xd')][_0xb587('0xe')]=function(){this[_0xb587('0x5')][_0xb587('0xe')](this[_0xb587('0x7')][_0xb587('0x8')](this),this[_0xb587('0x9')][_0xb587('0x8')](this));};Beepall[_0xb587('0xd')][_0xb587('0xc')]=function(){this[_0xb587('0x9')](!![]);};Beepall[_0xb587('0xd')][_0xb587('0x7')]=function(){var _0x4444c0=!![];if(!_[_0xb587('0xf')](this[_0xb587('0x10')])&&!_[_0xb587('0xf')](this[_0xb587('0x10')][_0xb587('0x11')])&&this[_0xb587('0x10')][_0xb587('0x11')]['length']>0x0){for(var _0x5dd54f=0x0,_0xd8e1d9;_0x5dd54f0x0){for(var _0x58f147=0x0,_0xebd6f1;_0x58f1470x0&&_0x37f35f[_0x91e54+_0x0906('0x20')]>=_0x37f35f[_0x91e54+'Capacity']){writeLog(_0x2a943c,_0x37f35f,_0x91e54[_0x0906('0x21')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x171026,_0x1244c4,_0x59eace,_0x458b6a,_0x3f0b33){return sendNotification(!![],_0x171026,_0x1244c4,_0x59eace,_0x458b6a,_0x3f0b33);};exports[_0x0906('0x22')]=function(_0x10f413,_0x44a93d,_0x2eb70b,_0x35d1fb,_0x440612){return sendNotification(![],_0x10f413,_0x44a93d,_0x2eb70b,_0x35d1fb,_0x440612);};exports['checkWaitingNotifications']=function(_0x4af439,_0x46538c,_0x43c146){var _0x21d7c8=_0x46538c[_0x0906('0x23')][_0x0906('0x24')];if(!_0x21d7c8&&_0x43c146){_0x21d7c8=_0x43c146['id'];}var _0x1e6fa8=_['some'](_0x4af439[_0x46538c[_0x0906('0x25')]+_0x0906('0x26')],function(_0x4ad785){var _0x4ae13e=_[_0x0906('0x27')](_0x46538c[_0x0906('0x25')])+'InteractionId';return _0x4ad785[_0x4ae13e]===_0x46538c['interaction']['id'];});if(!_0x1e6fa8&&_0x21d7c8&&_0x4af439['agents'][_0x21d7c8]){_0x1e6fa8=_[_0x0906('0x28')](_0x4af439['agents'][_0x21d7c8][_0x46538c[_0x0906('0x25')]+_0x0906('0x29')],function(_0x1b8df2){return _0x1b8df2['id']===_0x46538c['interaction']['id'];});}return _0x1e6fa8;};exports[_0x0906('0x2a')]=function(_0x5d5b3b,_0x5a06c8,_0x208ea4,_0x5754de){if(_0x208ea4&&_0x208ea4['id']&&_0x5d5b3b['agents']&&_0x5d5b3b[_0x0906('0x2b')][_0x208ea4['id']]){_0x5d5b3b['agents'][_0x208ea4['id']][_0x5754de+_0x0906('0x29')][_0x5a06c8[_0x0906('0x12')]['id']]={'id':_0x5a06c8[_0x0906('0x23')]['id']};}};exports[_0x0906('0x2c')]=function(_0x36d45e,_0x5e98d7,_0x311b8b,_0xc2caa){if(_0x311b8b&&_0x311b8b['id']&&_0x36d45e[_0x0906('0x2b')]&&_0x36d45e[_0x0906('0x2b')][_0x311b8b['id']]){delete _0x36d45e['agents'][_0x311b8b['id']][_0xc2caa+_0x0906('0x29')][_0x5e98d7[_0x0906('0x12')]['id']];}};exports[_0x0906('0x2d')]=writeLog; \ No newline at end of file +var _0x6df1=['OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','interaction','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','message','user:%s','emit','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online'];(function(_0xbf440b,_0x331dc0){var _0x4e5aa1=function(_0x199b4e){while(--_0x199b4e){_0xbf440b['push'](_0xbf440b['shift']());}};_0x4e5aa1(++_0x331dc0);}(_0x6df1,0x1e8));var _0x16df=function(_0x252d7e,_0x20a71c){_0x252d7e=_0x252d7e-0x0;var _0x2afaba=_0x6df1[_0x252d7e];return _0x2afaba;};'use strict';var _=require('lodash');var util=require(_0x16df('0x0'));var utils=require(_0x16df('0x1'));var Redis=require(_0x16df('0x2'));var config=require(_0x16df('0x3'));var logger=require(_0x16df('0x4'))(_0x16df('0x5'));config[_0x16df('0x6')]=_['defaults'](config['redis'],{'host':_0x16df('0x7'),'port':0x18eb});var io=require(_0x16df('0x8'))(new Redis(config[_0x16df('0x6')]));function sendNotification(_0x4d9218,_0x40def7,_0x7a6687,_0x2cd84b,_0x22d98f,_0x224074){var _0x574d9a=_0x224074||{};var _0x3786d0=_0x7a6687[_0x16df('0x9')]('.');var _0xe78e2={'uniqueid':_0x40def7,'channel':_0x3786d0[0x0],'id':_0x3786d0[0x1],'title':_0x3786d0[0x0]+_0x16df('0xa'),'interactionId':_0x3786d0[0x2],'queue':_0x22d98f?_0x22d98f[_0x16df('0xb')]:null,'sound':_0x574d9a[_0x16df('0xc')][_0x16df('0xd')],'shake':_0x574d9a[_0x16df('0xc')][_0x16df('0xe')]};try{if(!_0x574d9a['body']){_0x574d9a[_0x16df('0xf')]={};}if(_0x22d98f){_0x574d9a['body'][_0x16df('0x10')]=_0x22d98f;}else if(_0x574d9a[_0x16df('0xf')][_0x16df('0x10')]){delete _0x574d9a[_0x16df('0xf')]['queue'];}_0xe78e2[_0x16df('0x11')]=utils['getMustacheRender'](_0x574d9a[_0x16df('0xc')]['notificationTemplate'],_0x574d9a);}catch(_0x411cc7){_0xe78e2[_0x16df('0x11')]=_0x16df('0x12');logger[_0x16df('0x13')](util[_0x16df('0x14')]('[%s][QUEUE]\x20%s',_0x40def7,_0x411cc7[_0x16df('0x15')]));}io['to'](util[_0x16df('0x14')](_0x16df('0x16'),_0x2cd84b[_0x16df('0xb')]))[_0x16df('0x17')](util['format'](_0x16df('0x18'),_0x4d9218?_0x16df('0x19'):_0x16df('0x1a')),_0xe78e2);}function writeLog(_0xcbc42d,_0x526e0f,_0x5698fe){return logger['debug'](util[_0x16df('0x14')](_0x16df('0x1b'),_0xcbc42d,_0x526e0f[_0x16df('0xb')],_0x5698fe));}exports[_0x16df('0x1c')]=function(_0x2c11d1,_0x5d0910,_0x4622e7,_0xd47146){if(_0x5d0910[_0x16df('0x1d')]){writeLog(_0x2c11d1,_0x5d0910,_0x16df('0x1e'));return![];}if(!_0x5d0910[_0x16df('0x1f')]){writeLog(_0x2c11d1,_0x5d0910,_0x16df('0x20'));return![];}if(_0x5d0910[_0x4622e7+_0x16df('0x21')]){writeLog(_0x2c11d1,_0x5d0910,'PAUSE');return![];}if(_0xd47146&&_0x5d0910[_0x16df('0x22')](_0x4622e7+_0x16df('0x23'))&&_0x5d0910[_0x16df('0x22')](_0x4622e7+_0x16df('0x24'))){if(_0x5d0910[_0x4622e7+_0x16df('0x23')]>0x0&&_0x5d0910[_0x4622e7+_0x16df('0x24')]>=_0x5d0910[_0x4622e7+_0x16df('0x23')]){writeLog(_0x2c11d1,_0x5d0910,_0x4622e7['toUpperCase']()+_0x16df('0x25'));return![];}}return!![];};exports[_0x16df('0x26')]=function(_0xb24c04,_0x661a60,_0x17cdda,_0xe86c20,_0x47b976){return sendNotification(!![],_0xb24c04,_0x661a60,_0x17cdda,_0xe86c20,_0x47b976);};exports[_0x16df('0x27')]=function(_0x5a3ee4,_0x284e4f,_0x56bdf,_0xd20ddf,_0x22931f){return sendNotification(![],_0x5a3ee4,_0x284e4f,_0x56bdf,_0xd20ddf,_0x22931f);};exports[_0x16df('0x28')]=function(_0x1874e3,_0x7a8c10,_0x46d608){var _0x2b5544=_0x7a8c10['interaction']['UserId'];if(!_0x2b5544&&_0x46d608){_0x2b5544=_0x46d608['id'];}var _0x3c9824=_[_0x16df('0x29')](_0x1874e3[_0x7a8c10[_0x16df('0x2a')]+_0x16df('0x2b')],function(_0x3321eb){var _0xa59eaf=_[_0x16df('0x2c')](_0x7a8c10[_0x16df('0x2a')])+_0x16df('0x2d');return _0x3321eb[_0xa59eaf]===_0x7a8c10[_0x16df('0x2e')]['id'];});if(!_0x3c9824&&_0x2b5544&&_0x1874e3[_0x16df('0x2f')][_0x2b5544]){_0x3c9824=_['some'](_0x1874e3['agents'][_0x2b5544][_0x7a8c10['channel']+_0x16df('0x30')],function(_0x410856){return _0x410856['id']===_0x7a8c10['interaction']['id'];});}return _0x3c9824;};exports[_0x16df('0x31')]=function(_0x3bd3d3,_0x429d8d,_0x296f27,_0x56064a){if(_0x296f27&&_0x296f27['id']&&_0x3bd3d3[_0x16df('0x2f')]&&_0x3bd3d3[_0x16df('0x2f')][_0x296f27['id']]){_0x3bd3d3['agents'][_0x296f27['id']][_0x56064a+'WaitingInteractions'][_0x429d8d[_0x16df('0x15')]['id']]={'id':_0x429d8d[_0x16df('0x2e')]['id']};}};exports[_0x16df('0x32')]=function(_0x93c74c,_0x201227,_0x512e19,_0x1f1bfd){if(_0x512e19&&_0x512e19['id']&&_0x93c74c[_0x16df('0x2f')]&&_0x93c74c[_0x16df('0x2f')][_0x512e19['id']]){delete _0x93c74c[_0x16df('0x2f')][_0x512e19['id']][_0x1f1bfd+_0x16df('0x30')][_0x201227[_0x16df('0x15')]['id']];}};exports[_0x16df('0x33')]=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 4b9eae4..53a63c2 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 _0x95b3=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','routing'];(function(_0x23d62a,_0x405b47){var _0x5736dd=function(_0xf846a2){while(--_0xf846a2){_0x23d62a['push'](_0x23d62a['shift']());}};_0x5736dd(++_0x405b47);}(_0x95b3,0x1d6));var _0x395b=function(_0x1c9ae1,_0x42b684){_0x1c9ae1=_0x1c9ae1-0x0;var _0x299176=_0x95b3[_0x1c9ae1];return _0x299176;};'use strict';var schema=require(_0x395b('0x0'));var sh=require(_0x395b('0x1'));var _=require(_0x395b('0x2'));var utils=require(_0x395b('0x3'));var logger=require('../../../../config/logger')(_0x395b('0x4'));var system=schema({'command':{'type':_0x395b('0x5'),'required':!![],'message':_0x395b('0x6')}});exports[_0x395b('0x7')]=function(_0x402598,_0x1b2bdd){return function(_0x1e5084){try{var _0x1f3fe8={'command':_0x1b2bdd[0x0]};var _0x57c77d=system[_0x395b('0x0')](_0x1f3fe8,{'typecast':!![]});if(_0x57c77d['length']){logger[_0x395b('0x8')](_0x395b('0x9'),_0x402598,_[_0x395b('0xa')](_0x57c77d,_0x395b('0xb'))[_0x395b('0xc')](',\x20'));logger[_0x395b('0xd')](_0x395b('0xe'),_0x402598);_0x1e5084[_0x395b('0xf')]();}else{var _0x139454=this;var _0xbb605=utils[_0x395b('0x10')](_0x1b2bdd[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x402598,_0xbb605);sh['exec'](_[_0x395b('0x11')](_0xbb605),function(_0x13d3e9,_0x43e5a){logger['info'](_0x395b('0x12'),_0x402598,_0x13d3e9);if(_0x13d3e9==0x0){var _0x5da4b7=_0x43e5a[_0x395b('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x395b('0x14')](_0x1b2bdd[0x1])||_['isEmpty'](_0x1b2bdd[0x1])){logger[_0x395b('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x402598);_0x139454[_0x395b('0x15')][_0x1b2bdd[0x1]]=_0x5da4b7;}else{logger['info'](_0x395b('0x16'),_0x402598,_0x1b2bdd[0x1],_0x5da4b7);_0x139454[_0x395b('0x15')][_0x1b2bdd[0x1]]=_0x5da4b7;}}_0x1e5084[_0x395b('0xf')]();});}}catch(_0x1a0786){logger[_0x395b('0x8')](_0x395b('0x9'),_0x402598,_[_0x395b('0x17')](_0x1a0786)?JSON[_0x395b('0x18')](_0x1a0786):_0x1a0786);logger[_0x395b('0xd')](_0x395b('0xe'),_0x402598);_0x1e5084[_0x395b('0xf')]();}};}; \ No newline at end of file +var _0x3d10=['next','error','isObject','validate','lodash','../../../../config/logger','routing','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x338d1d,_0x320946){var _0x18edda=function(_0x3f6249){while(--_0x3f6249){_0x338d1d['push'](_0x338d1d['shift']());}};_0x18edda(++_0x320946);}(_0x3d10,0x7b));var _0x03d1=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x3d10[_0x4eafed];return _0x159c85;};'use strict';var schema=require(_0x03d1('0x0'));var sh=require('shelljs');var _=require(_0x03d1('0x1'));var utils=require('./utils');var logger=require(_0x03d1('0x2'))(_0x03d1('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x03d1('0x4')]=function(_0x2c8f1a,_0x112247){return function(_0x812d8){try{var _0x5f260a={'command':_0x112247[0x0]};var _0x2b319e=system[_0x03d1('0x0')](_0x5f260a,{'typecast':!![]});if(_0x2b319e[_0x03d1('0x5')]){logger['error'](_0x03d1('0x6'),_0x2c8f1a,_[_0x03d1('0x7')](_0x2b319e,_0x03d1('0x8'))[_0x03d1('0x9')](',\x20'));logger[_0x03d1('0xa')](_0x03d1('0xb'),_0x2c8f1a);_0x812d8['next']();}else{var _0x22e87f=this;var _0x1f6ae8=utils[_0x03d1('0xc')](_0x112247[0x0],this);logger[_0x03d1('0xa')](_0x03d1('0xd'),_0x2c8f1a,_0x1f6ae8);sh[_0x03d1('0xe')](_['trim'](_0x1f6ae8),function(_0x23acda,_0x15a1a4){logger[_0x03d1('0xa')](_0x03d1('0xf'),_0x2c8f1a,_0x23acda);if(_0x23acda==0x0){var _0x5b05f8=_0x15a1a4[_0x03d1('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x03d1('0x11')](_0x112247[0x1])||_['isEmpty'](_0x112247[0x1])){logger[_0x03d1('0xa')](_0x03d1('0x12'),_0x2c8f1a);_0x22e87f[_0x03d1('0x13')][_0x112247[0x1]]=_0x5b05f8;}else{logger[_0x03d1('0xa')](_0x03d1('0x14'),_0x2c8f1a,_0x112247[0x1],_0x5b05f8);_0x22e87f[_0x03d1('0x13')][_0x112247[0x1]]=_0x5b05f8;}}_0x812d8[_0x03d1('0x15')]();});}}catch(_0x10ff97){logger[_0x03d1('0x16')](_0x03d1('0x6'),_0x2c8f1a,_[_0x03d1('0x17')](_0x10ff97)?JSON['stringify'](_0x10ff97):_0x10ff97);logger[_0x03d1('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2c8f1a);_0x812d8[_0x03d1('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index fe46cc4..af0ffcd 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 _0xa96c=['[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','info','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error'];(function(_0x5ea8a1,_0x25a610){var _0x2b9653=function(_0x597ee8){while(--_0x597ee8){_0x5ea8a1['push'](_0x5ea8a1['shift']());}};_0x2b9653(++_0x25a610);}(_0xa96c,0x14f));var _0xca96=function(_0x138181,_0xe33a97){_0x138181=_0x138181-0x0;var _0x22ba63=_0xa96c[_0x138181];return _0x22ba63;};'use strict';var schema=require('validate');var _=require(_0xca96('0x0'));var rpc={'chatInteraction':require(_0xca96('0x1')),'openchannelInteraction':require(_0xca96('0x2')),'smsInteraction':require(_0xca96('0x3')),'mailInteraction':require(_0xca96('0x4')),'faxInteraction':require(_0xca96('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xca96('0x6'))(_0xca96('0x7'));var tag=schema({'tag':{'type':_0xca96('0x8'),'required':!![],'message':_0xca96('0x9')}});exports['consequence']=function(_0x162b68,_0x2dc26e,_0x2dcf3f,_0x2c3dde){return function(_0x2e6f7c){try{var _0x5003e8={'tag':_0x2dc26e[0x0]};var _0x3087fe=tag[_0xca96('0xa')](_0x5003e8,{'typecast':!![]});if(_0x3087fe[_0xca96('0xb')]){logger[_0xca96('0xc')](_0xca96('0xd'),_0x162b68,_['map'](_0x3087fe,_0xca96('0xe'))[_0xca96('0xf')](',\x20'));logger['info'](_0xca96('0x10'),_0x162b68);_0x2e6f7c[_0xca96('0x11')]();}else{var _0x270aa0={'ids':[_0x2dc26e[0x0]]};if(rpc[_0x2c3dde['channel']+_0xca96('0x12')]){rpc[_0x2c3dde[_0xca96('0x13')]+_0xca96('0x12')][_0xca96('0x14')](_0x2c3dde[_0xca96('0x15')]['id'],_0x270aa0)[_0xca96('0x16')](function(_0x54b6a8){logger['info'](_0xca96('0x17'),_0x162b68,_0x2dc26e[0x1],_0x2c3dde[_0xca96('0x13')],_0x2c3dde[_0xca96('0x15')]['id']);})[_0xca96('0x18')](function(_0x59e63b){logger['error'](_0xca96('0xd'),_0x162b68,JSON[_0xca96('0x19')](_0x59e63b));logger[_0xca96('0x1a')](_0xca96('0x10'),_0x162b68);})[_0xca96('0x1b')](function(){_0x2e6f7c[_0xca96('0x11')]();});}}}catch(_0x10f231){logger[_0xca96('0xc')]('[%s][TAG]\x20%s',_0x162b68,_[_0xca96('0x1c')](_0x10f231)?JSON[_0xca96('0x19')](_0x10f231):_0x10f231);logger[_0xca96('0x1a')](_0xca96('0x10'),_0x162b68);_0x2e6f7c['next']();}};}; \ No newline at end of file +var _0xc439=['addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction'];(function(_0x408ca9,_0x114a12){var _0x35d3f3=function(_0x32bc29){while(--_0x32bc29){_0x408ca9['push'](_0x408ca9['shift']());}};_0x35d3f3(++_0x114a12);}(_0xc439,0x8e));var _0x9c43=function(_0x31bdb5,_0x23e6a4){_0x31bdb5=_0x31bdb5-0x0;var _0x44a62e=_0xc439[_0x31bdb5];return _0x44a62e;};'use strict';var schema=require(_0x9c43('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x9c43('0x1')),'openchannelInteraction':require(_0x9c43('0x2')),'smsInteraction':require(_0x9c43('0x3')),'mailInteraction':require(_0x9c43('0x4')),'faxInteraction':require(_0x9c43('0x5')),'whatsappInteraction':require(_0x9c43('0x6'))};var logger=require(_0x9c43('0x7'))('routing');var tag=schema({'tag':{'type':_0x9c43('0x8'),'required':!![],'message':_0x9c43('0x9')}});exports['consequence']=function(_0x3d1cfb,_0x2a5a19,_0xb42f80,_0x2373fb){return function(_0x38a7a0){try{var _0x35af10={'tag':_0x2a5a19[0x0]};var _0x109a7b=tag[_0x9c43('0x0')](_0x35af10,{'typecast':!![]});if(_0x109a7b['length']){logger[_0x9c43('0xa')](_0x9c43('0xb'),_0x3d1cfb,_[_0x9c43('0xc')](_0x109a7b,_0x9c43('0xd'))[_0x9c43('0xe')](',\x20'));logger[_0x9c43('0xf')](_0x9c43('0x10'),_0x3d1cfb);_0x38a7a0[_0x9c43('0x11')]();}else{var _0x47faba={'ids':[_0x2a5a19[0x0]]};if(rpc[_0x2373fb[_0x9c43('0x12')]+_0x9c43('0x13')]){rpc[_0x2373fb[_0x9c43('0x12')]+_0x9c43('0x13')][_0x9c43('0x14')](_0x2373fb[_0x9c43('0x15')]['id'],_0x47faba)['then'](function(_0x574288){logger[_0x9c43('0xf')](_0x9c43('0x16'),_0x3d1cfb,_0x2a5a19[0x1],_0x2373fb[_0x9c43('0x12')],_0x2373fb[_0x9c43('0x15')]['id']);})[_0x9c43('0x17')](function(_0x3bb64c){logger[_0x9c43('0xa')](_0x9c43('0xb'),_0x3d1cfb,JSON[_0x9c43('0x18')](_0x3bb64c));logger[_0x9c43('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3d1cfb);})[_0x9c43('0x19')](function(){_0x38a7a0['next']();});}}}catch(_0x259c35){logger[_0x9c43('0xa')](_0x9c43('0xb'),_0x3d1cfb,_[_0x9c43('0x1a')](_0x259c35)?JSON[_0x9c43('0x18')](_0x259c35):_0x259c35);logger[_0x9c43('0xf')](_0x9c43('0x10'),_0x3d1cfb);_0x38a7a0[_0x9c43('0x11')]();}};}; \ 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 5ea5731..1d39cc2 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 _0x20e3=['[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','2.0','method','login','stringify','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error'];(function(_0x350f5d,_0x21056a){var _0x2d45df=function(_0x39ed40){while(--_0x39ed40){_0x350f5d['push'](_0x350f5d['shift']());}};_0x2d45df(++_0x21056a);}(_0x20e3,0x1c4));var _0x320e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x20e3[_0x21a9d9];return _0x46adce;};'use strict';var rp=require(_0x320e('0x0'));var logger=require(_0x320e('0x1'))('routing');var _=require('lodash');var arr=[];exports[_0x320e('0x2')]=function(_0x539504,_0x52a419){return function(_0x58ac2c){var _0x24a7d4=_0x52a419[0xa];var _0x7726d=_0x52a419[0xb];var _0x5eb1f7=_0x52a419[0xc];var _0x549d19=_0x52a419[0xd];var _0x4d4ffa=_0x52a419[0xe];var _0x36d1ba=_0x52a419[0xf][_0x320e('0x3')](/\n/g,'\x20-\x20');var _0x7f0654=_0x52a419[0x10][_0x320e('0x3')](/\n/g,'\x20');if(!arr[_0x320e('0x4')](_0x7726d)){arr[_0x320e('0x5')](_0x7726d);var _0x3edb82=_0x52a419[0x3];var _0xbbd8a=_0x52a419[0x4];var _0x4a976e=_0x52a419[0x1];var _0x4aad1a=_0x52a419[0x0];var _0x49d183={};_0x49d183[_0x320e('0x6')]=_0x52a419[0x8]+_0x320e('0x7')+_0x5eb1f7+'|'+_0x24a7d4+'|'+_0x549d19+'|'+_0x7726d+'|'+_0x4d4ffa;_0x49d183[_0x320e('0x8')]=_0x52a419[0x7]+_0x320e('0x7')+_0x5eb1f7+'|'+_0x24a7d4+'|'+_0x549d19+'|'+_0x7726d+'|'+_0x4d4ffa+'|'+_0x36d1ba+'|'+_0x7f0654;_0x49d183['title']=_0x52a419[0x9];var _0x14d864={};_0x14d864['jsonrpc']=_0x320e('0x9');_0x14d864[_0x320e('0xa')]=_0x320e('0xb');var _0x42bce8=[];_0x42bce8[_0x320e('0x5')](_0x52a419[0x2]);_0x42bce8['push'](_0x52a419[0x5]);_0x42bce8[_0x320e('0x5')](_0x52a419[0x6]);_0x14d864['params']=_0x42bce8;_0x14d864['id']=0x1;var _0x2b208b=JSON[_0x320e('0xc')](_0x14d864);var _0x3c0f91={'encoding':'utf8','method':_0x320e('0xd'),'timeout':0x2710,'url':_0x3edb82,'headers':{'Content-Type':_0x320e('0xe')},'body':_0x2b208b};return rp(_0x3c0f91)[_0x320e('0xf')](function(_0x3a9dd7){const _0x3be278=JSON[_0x320e('0x10')](_0x3a9dd7);if(!_0x3be278[_0x320e('0x11')][_0x320e('0x12')]){throw new Error(_0x320e('0x13'));}var _0x120dda=_0x7726d;var _0xe65970=_0x320e('0x14')+_0x4a976e+_0x320e('0x15')+_0x4aad1a+_0x320e('0x16')+_0x120dda+'&data='+JSON[_0x320e('0xc')](_0x49d183);var _0x110ac5=_0xbbd8a+'?'+_0xe65970;return rp(_0x110ac5);})[_0x320e('0xf')](function(_0x30b43){logger[_0x320e('0x17')](_0x320e('0x18'),_0x539504,_0x30b43);_0x58ac2c[_0x320e('0x19')]();})[_0x320e('0x1a')](function(_0x32b04f){logger[_0x320e('0x1b')](_0x320e('0x1c'),_0x539504,_[_0x320e('0x1d')](_0x32b04f)?JSON['stringify'](_0x32b04f):_0x32b04f);_0x58ac2c['stop']();});}else{logger['info'](_0x320e('0x1e'),_0x539504);_0x58ac2c[_0x320e('0x1f')]();}};}; \ No newline at end of file +var _0x4392=['urlOnAnswer','urlOnRing','?params=','title','jsonrpc','login','params','stringify','utf8','POST','then','parse','result','logged','channelId=','&serviceId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','push'];(function(_0x251908,_0x3e5ff9){var _0x4e0ed2=function(_0x3e73ee){while(--_0x3e73ee){_0x251908['push'](_0x251908['shift']());}};_0x4e0ed2(++_0x3e5ff9);}(_0x4392,0x178));var _0x2439=function(_0x1e6d58,_0x33595a){_0x1e6d58=_0x1e6d58-0x0;var _0xa3c9ef=_0x4392[_0x1e6d58];return _0xa3c9ef;};'use strict';var rp=require(_0x2439('0x0'));var logger=require(_0x2439('0x1'))('routing');var _=require(_0x2439('0x2'));var arr=[];exports[_0x2439('0x3')]=function(_0x334f1b,_0x5037cc){return function(_0x1ade2a){var _0x3ed887=_0x5037cc[0xa];var _0x36b7ee=_0x5037cc[0xb];var _0x1a9f3d=_0x5037cc[0xc];var _0xd664b1=_0x5037cc[0xd];var _0x2543a4=_0x5037cc[0xe];var _0x5717a2=_0x5037cc[0xf][_0x2439('0x4')](/\n/g,_0x2439('0x5'));var _0x59cadc=_0x5037cc[0x10][_0x2439('0x4')](/\n/g,'\x20');if(!arr[_0x2439('0x6')](_0x36b7ee)){arr[_0x2439('0x7')](_0x36b7ee);var _0x5a3bc8=_0x5037cc[0x3];var _0x2a90a1=_0x5037cc[0x4];var _0x2f4cd5=_0x5037cc[0x1];var _0x4a1ab0=_0x5037cc[0x0];var _0x5259c3={};_0x5259c3[_0x2439('0x8')]=_0x5037cc[0x8]+'?params='+_0x1a9f3d+'|'+_0x3ed887+'|'+_0xd664b1+'|'+_0x36b7ee+'|'+_0x2543a4;_0x5259c3[_0x2439('0x9')]=_0x5037cc[0x7]+_0x2439('0xa')+_0x1a9f3d+'|'+_0x3ed887+'|'+_0xd664b1+'|'+_0x36b7ee+'|'+_0x2543a4+'|'+_0x5717a2+'|'+_0x59cadc;_0x5259c3[_0x2439('0xb')]=_0x5037cc[0x9];var _0x411b89={};_0x411b89[_0x2439('0xc')]='2.0';_0x411b89['method']=_0x2439('0xd');var _0x26a1ae=[];_0x26a1ae[_0x2439('0x7')](_0x5037cc[0x2]);_0x26a1ae[_0x2439('0x7')](_0x5037cc[0x5]);_0x26a1ae['push'](_0x5037cc[0x6]);_0x411b89[_0x2439('0xe')]=_0x26a1ae;_0x411b89['id']=0x1;var _0xef00de=JSON[_0x2439('0xf')](_0x411b89);var _0x42cf4f={'encoding':_0x2439('0x10'),'method':_0x2439('0x11'),'timeout':0x2710,'url':_0x5a3bc8,'headers':{'Content-Type':'application/json-rpc'},'body':_0xef00de};return rp(_0x42cf4f)[_0x2439('0x12')](function(_0x536232){const _0x30c77a=JSON[_0x2439('0x13')](_0x536232);if(!_0x30c77a[_0x2439('0x14')][_0x2439('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x507b16=_0x36b7ee;var _0x3e0b79=_0x2439('0x16')+_0x2f4cd5+_0x2439('0x17')+_0x4a1ab0+'&sessionId='+_0x507b16+'&data='+JSON['stringify'](_0x5259c3);var _0x7df31c=_0x2a90a1+'?'+_0x3e0b79;return rp(_0x7df31c);})[_0x2439('0x12')](function(_0x479343){logger[_0x2439('0x18')](_0x2439('0x19'),_0x334f1b,_0x479343);_0x1ade2a[_0x2439('0x1a')]();})[_0x2439('0x1b')](function(_0x437576){logger['error'](_0x2439('0x1c'),_0x334f1b,_[_0x2439('0x1d')](_0x437576)?JSON['stringify'](_0x437576):_0x437576);_0x1ade2a[_0x2439('0x1a')]();});}else{logger[_0x2439('0x18')](_0x2439('0x1e'),_0x334f1b);_0x1ade2a[_0x2439('0x1f')]();}};}; \ 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 9627d34..82242af 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x54e5e3,_0x3fd27b){var _0x5daac3=function(_0x2ecd8c){while(--_0x2ecd8c){_0x54e5e3['push'](_0x54e5e3['shift']());}};_0x5daac3(++_0x3fd27b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x50c994,_0x333c98){var _0x474676=function(_0x545512){while(--_0x545512){_0x50c994['push'](_0x50c994['shift']());}};_0x474676(++_0x333c98);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 64cf9d8..46d740e 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 _0x908d=['app','toLowerCase','autoreply','appdata','push','slice','dialogflowv2','amazonlex','split','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','body','%s:%s:%s','./interval','intervals','./applications/','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','info','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agents','agent','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','mailQueues','name','paused','waiting','openchannelQueues','smsQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','.js'];(function(_0x591e79,_0x57bb04){var _0x16b06f=function(_0x24ad9e){while(--_0x24ad9e){_0x591e79['push'](_0x591e79['shift']());}};_0x16b06f(++_0x57bb04);}(_0x908d,0x176));var _0xd908=function(_0x3ed9b1,_0x26f84f){_0x3ed9b1=_0x3ed9b1-0x0;var _0xa14c5c=_0x908d[_0x3ed9b1];return _0xa14c5c;};'use strict';var _=require(_0xd908('0x0'));var util=require('util');var path=require(_0xd908('0x1'));var fs=require('fs');var jayson=require(_0xd908('0x2'));var BPromise=require('bluebird');var utils=require(_0xd908('0x3'));var sUtils=require(_0xd908('0x4'));var logger=require(_0xd908('0x5'))(_0xd908('0x6'));var rpc={'openchannelQueueReport':require(_0xd908('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xd908('0x8')),'smsQueueReport':require(_0xd908('0x9')),'faxQueueReport':require(_0xd908('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xd908('0xb'));function getId(_0x5e9356,_0x362fb3,_0x2f82dc){return util[_0xd908('0xc')](_0xd908('0xd'),_0x5e9356,_0x362fb3||0x0,_0x2f82dc||0x0);}function getIntervals(_0x2639d7,_0x37b39c){var _0x5c70de=[];if(!_[_0xd908('0xe')](_0x37b39c['IntervalId'])&&!_[_0xd908('0xe')](_0x2639d7[_0x37b39c[_0xd908('0xf')]])&&!_[_0xd908('0xe')](_0x2639d7[_0x37b39c['IntervalId']][_0xd908('0x10')])){_0x5c70de=_[_0xd908('0x11')](_0x2639d7[_0x37b39c[_0xd908('0xf')]][_0xd908('0x10')],_0xd908('0x12'));}else if(!_[_0xd908('0xe')](_0x37b39c[_0xd908('0x12')])){_0x5c70de=[_0x37b39c[_0xd908('0x12')]];}return _0x5c70de;}exports[_0xd908('0x13')]=function(_0x30e943){_0x30e943[_0xd908('0x14')]={};return new BPromise(function(_0x43bc96,_0x5adcf5){var _0x458d5d={'Start':function(_0x3a65d9){var _0x49bf38=this;return new Promise(function(_0x27589d,_0x34548c){if(_0x3a65d9){try{var _0x2b68d9=[];var _0x7279dc=getId(_0x3a65d9[_0xd908('0x15')],_0x3a65d9['message']?_0x3a65d9[_0xd908('0x16')]['id']:0x0,_0x3a65d9[_0xd908('0x17')]?_0x3a65d9[_0xd908('0x17')]['id']:0x0);var _0x200351=sUtils['checkWaitingNotifications'](_0x30e943,_0x3a65d9);if(_0x3a65d9['transfer']||!_0x200351&&_0x3a65d9[_0xd908('0x18')]&&_[_0xd908('0x19')](_0x3a65d9[_0xd908('0x18')])&&_0x3a65d9['applications'][_0xd908('0x1a')]){for(var _0x3abffa=0x0;_0x3abffa<_0x3a65d9[_0xd908('0x18')][_0xd908('0x1a')];_0x3abffa+=0x1){var _0x5dba01=_0x3a65d9[_0xd908('0x18')][_0x3abffa];if(fs[_0xd908('0x1b')](path[_0xd908('0x1c')](__dirname,_0xd908('0x18'),_0x5dba01['app']+_0xd908('0x1d')))){var _0x42e9e4=[];switch(_0x5dba01[_0xd908('0x1e')][_0xd908('0x1f')]()){case _0xd908('0x20'):var _0x3ce7a8=_0x5dba01[_0xd908('0x21')]['split'](',');if(_0x3a65d9[_0xd908('0x15')]==='mail'){_0x42e9e4['push'](_0x3ce7a8[0x0]);_0x42e9e4[_0xd908('0x22')](_0x3ce7a8[0x1]);_0x42e9e4['push'](_0x3ce7a8[_0xd908('0x23')](0x2,_0x3ce7a8[_0xd908('0x1a')])['join'](','));}else{_0x42e9e4['push'](_0x3ce7a8[0x0]);_0x42e9e4[_0xd908('0x22')](_0x3ce7a8[_0xd908('0x23')](0x1,_0x3ce7a8[_0xd908('0x1a')])[_0xd908('0x1c')](','));}break;case'dialogflow':var _0x4f28ab=_0x5dba01['appdata']['split'](',');_0x42e9e4[_0xd908('0x22')](_0x4f28ab[0x0]);_0x42e9e4[_0xd908('0x22')](_0x4f28ab[0x1]);_0x42e9e4[_0xd908('0x22')](_0x4f28ab[_0xd908('0x23')](0x2,_0x4f28ab[_0xd908('0x1a')])['join'](','));break;case _0xd908('0x24'):var _0x37a0ef=_0x5dba01['appdata']['split'](',');_0x42e9e4['push'](_0x37a0ef[0x0]);_0x42e9e4[_0xd908('0x22')](_0x37a0ef[0x1]);_0x42e9e4[_0xd908('0x22')](_0x37a0ef[0x2]);_0x42e9e4[_0xd908('0x22')](_0x37a0ef[0x3]);_0x42e9e4['push'](_0x37a0ef['slice'](0x4,_0x37a0ef[_0xd908('0x1a')])[_0xd908('0x1c')](','));break;case _0xd908('0x25'):var _0x432b08=_0x5dba01['appdata'][_0xd908('0x26')](',');_0x42e9e4[_0xd908('0x22')](_0x432b08[0x0]);_0x42e9e4['push'](_0x432b08[0x1]);_0x42e9e4[_0xd908('0x22')](_0x432b08[0x2]);_0x42e9e4[_0xd908('0x22')](_0x432b08[0x3]);_0x42e9e4[_0xd908('0x22')](_0x432b08[_0xd908('0x23')](0x4,_0x432b08['length'])[_0xd908('0x1c')](','));break;case _0xd908('0x16'):_0x42e9e4['push'](_0x5dba01[_0xd908('0x21')]);break;case _0xd908('0x27'):_0x42e9e4[_0xd908('0x22')](_0x5dba01[_0xd908('0x28')]);_0x42e9e4['push'](_0x5dba01[_0xd908('0x21')]);break;case _0xd908('0x29'):var _0xedd3d9=utils[_0xd908('0x2a')](_0x3a65d9[_0xd908('0x2b')]['notificationTemplate'],_0x3a65d9);var _0x240557=_0x5dba01[_0xd908('0x21')][_0xd908('0x26')](',');_0x42e9e4['push'](_0x240557[0x0]);_0x42e9e4[_0xd908('0x22')](_0x240557[0x1]);_0x42e9e4[_0xd908('0x22')](_0x240557[0x2]);_0x42e9e4[_0xd908('0x22')](_0x240557[0x3]);_0x42e9e4[_0xd908('0x22')](_0x240557[0x4]);_0x42e9e4['push'](_0x240557[0x5]);_0x42e9e4[_0xd908('0x22')](_0x240557[0x6]);_0x42e9e4[_0xd908('0x22')](_0x240557[0x7]);_0x42e9e4['push'](_0x240557[0x8]);_0x42e9e4[_0xd908('0x22')](_0x240557[0x9]);_0x42e9e4[_0xd908('0x22')](_0x240557[0xa]);_0x42e9e4['push'](_0x3a65d9[_0xd908('0x17')]['id']);_0x42e9e4['push'](_0x3a65d9['message']['id']);_0x42e9e4[_0xd908('0x22')](_0x5dba01[_0xd908('0x2c')]);_0x42e9e4[_0xd908('0x22')](_0x3a65d9[_0xd908('0x17')]['ContactId']);_0x42e9e4[_0xd908('0x22')](_0x3a65d9[_0xd908('0x2d')][_0xd908('0x2d')]);_0x42e9e4[_0xd908('0x22')](_0xedd3d9);break;default:_0x42e9e4=_['isNil'](_0x5dba01[_0xd908('0x21')])?[]:_0x5dba01[_0xd908('0x21')][_0xd908('0x26')](',');}var _0x5a29eb={'id':util['format'](_0xd908('0x2e'),_0x7279dc,_0x5dba01['id'],_0x5dba01['app']),'condition':require(_0xd908('0x2f'))['condition'](_0x7279dc,getIntervals(_0x30e943[_0xd908('0x30')],_0x5dba01),_0x30e943),'consequence':require(_0xd908('0x31')+_0x5dba01[_0xd908('0x1e')])['consequence'](_0x7279dc,_0x42e9e4,_0x30e943,_0x3a65d9),'p':_0x5dba01[_0xd908('0x32')]||0x0};logger['info'](_0xd908('0x33'),_0x5a29eb['id'],'on\x20interval',getIntervals(_0x30e943['intervals'],_0x5dba01)['join'](_0xd908('0x34')));_0x2b68d9[_0xd908('0x22')](_0x5a29eb);}else{logger[_0xd908('0x35')](_0xd908('0x36'),path[_0xd908('0x1c')](__dirname,_0xd908('0x18'),_0x5dba01[_0xd908('0x1e')]+_0xd908('0x1d')));}}_0x30e943[_0xd908('0x14')][_0x7279dc]=new RuleEngine(_0x2b68d9);_0x30e943['rules'][_0x7279dc][_0xd908('0x37')](_0x3a65d9,function(_0x32a0ed){logger['info'](_0xd908('0x38'),JSON['stringify'](_0x32a0ed[_0xd908('0x39')]));if(_0x30e943[_0xd908('0x14')][_0x7279dc]){_0x30e943[_0xd908('0x14')][_0x7279dc][_0xd908('0x3a')](_0xd908('0x3b'));}});return _0x27589d({'code':0xc8,'message':_0x3a65d9});}else{if(_0x200351){logger[_0xd908('0x3c')](util[_0xd908('0xc')](_0xd908('0x3d'),_0x7279dc));}else{logger[_0xd908('0x3c')](_0xd908('0x3e'));}return _0x27589d({'code':0xc8,'message':_0x3a65d9});}}catch(_0xfc60e4){logger['error'](_0xfc60e4[_0xd908('0x3f')]);return _0x34548c(_0x49bf38[_0xd908('0x35')](0x1f4,_0xfc60e4));}}return _0x34548c(_0xd908('0x40'));});},'AcceptMessage':function(_0x191d4a){var _0x276e72=this;return new Promise(function(_0x12c410,_0x2948a3){if(_0x191d4a['agent']&&_0x191d4a['agent']['id']){if(_0x30e943[_0xd908('0x41')][_0x191d4a[_0xd908('0x42')]['id']]){_0x30e943[_0xd908('0x41')][_0x191d4a[_0xd908('0x42')]['id']]['busy']=![];_0x30e943['agents'][_0x191d4a[_0xd908('0x42')]['id']]['busyQueue']=undefined;}}if(_0x191d4a[_0xd908('0x16')]&&_0x191d4a[_0xd908('0x16')]['id']){try{var _0x753bbd=getId(_0x191d4a[_0xd908('0x15')],_0x191d4a[_0xd908('0x16')]?_0x191d4a[_0xd908('0x16')]['id']:0x0,_0x191d4a['interaction']?_0x191d4a[_0xd908('0x17')]['id']:0x0);if(_0x30e943['rules'][_0x753bbd]){_0x30e943[_0xd908('0x14')][_0x753bbd][_0xd908('0x3a')](_0xd908('0x43'));if(rpc[_0x191d4a[_0xd908('0x15')]+_0xd908('0x44')]){rpc[_0x191d4a[_0xd908('0x15')]+_0xd908('0x44')][_0xd908('0x45')](_0x753bbd,{'UserId':_0x191d4a[_0xd908('0x16')][_0xd908('0x46')]})[_0xd908('0x47')](function(){logger[_0xd908('0x35')](_0xd908('0x48'));});}}return _0x12c410({'code':0xc8,'message':_0x191d4a});}catch(_0x211904){logger['error'](_0x211904[_0xd908('0x3f')]);return _0x2948a3(_0x276e72['error'](0x1f4,_0x211904));}}logger[_0xd908('0x35')](_0xd908('0x49'));return _0x2948a3(_0x276e72[_0xd908('0x35')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x294d4a){var _0x3c4e54=this;return new Promise(function(_0x24c647,_0x40066c){if(_0x294d4a[_0xd908('0x42')]&&_0x294d4a[_0xd908('0x42')]['id']){try{if(_0x30e943[_0xd908('0x41')][_0x294d4a[_0xd908('0x42')]['id']]){_0x30e943[_0xd908('0x41')][_0x294d4a[_0xd908('0x42')]['id']]['busy']=![];_0x30e943['agents'][_0x294d4a[_0xd908('0x42')]['id']][_0xd908('0x4a')]=undefined;}return _0x24c647({'code':0xc8,'message':_0x294d4a});}catch(_0x52d63e){logger['error'](_0x52d63e[_0xd908('0x3f')]);return _0x40066c(_0x3c4e54[_0xd908('0x35')](0x1f4,_0x52d63e));}}logger['error']('message\x20is\x20empty');return _0x40066c(_0x3c4e54[_0xd908('0x35')](0x1f4,_0xd908('0x49')));});},'AbandonInteraction':function(_0x190ade){var _0x574a92=this;return new Promise(function(_0x10791b,_0x28b39a){if(_0x190ade[_0xd908('0x15')]&&_0x190ade['interaction']&&_0x190ade[_0xd908('0x17')]['id']){try{var _0x584c86=getId(_0x190ade[_0xd908('0x15')],_0x190ade['message']?_0x190ade[_0xd908('0x16')]['id']:0x0,_0x190ade[_0xd908('0x17')]?_0x190ade['interaction']['id']:0x0);if(_0x30e943[_0xd908('0x14')][_0x584c86]){_0x30e943[_0xd908('0x14')][_0x584c86]['emit'](_0xd908('0x43'));}return _0x10791b({'code':0xc8,'message':_0x190ade});}catch(_0x18ba8e){logger['error'](_0x18ba8e[_0xd908('0x3f')]);return _0x28b39a(_0x574a92['error'](0x1f4,_0x18ba8e));}}logger[_0xd908('0x35')](_0xd908('0x49'));return _0x28b39a(_0x574a92['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5371b1){var _0x5a9249=this;return new Promise(function(_0x60dd5,_0x4383c5){if(_0x30e943[_0xd908('0x41')][_0xd908('0x4b')](_0x5371b1['id'])){for(var _0x34f2a5 in _0x5371b1['capacity']){if(_0x5371b1['capacity'][_0xd908('0x4b')](_0x34f2a5)){if(_0x30e943[_0xd908('0x41')][_0x5371b1['id']][_0xd908('0x4b')](_0x34f2a5+_0xd908('0x4c'))){_0x30e943[_0xd908('0x41')][_0x5371b1['id']][_0x34f2a5+'CurrentCapacity']=parseInt(_0x5371b1['capacity'][_0x34f2a5],0xa);}}}_0x30e943[_0xd908('0x41')][_0x5371b1['id']][_0xd908('0x4d')]();return _0x60dd5({'code':0xc8,'message':_0x30e943[_0xd908('0x41')][_0x5371b1['id']]});}else{return _0x4383c5(_0x5a9249['error'](0x1f4,_0xd908('0x4e')));}});},'Agents':function(_0x419e8e){return new Promise(function(_0x4aab8){var _0x42bda6=_[_0xd908('0x4f')](_0x30e943[_0xd908('0x41')]);if(_0x419e8e&&_0x419e8e['id']){var _0x2fe43a=_['find'](_0x42bda6,function(_0x4f17c9){return _0x4f17c9['id']===_0x419e8e['id'];});_0x4aab8(_0x2fe43a);}else{_0x4aab8({'count':_0x42bda6[_0xd908('0x1a')],'rows':_0x42bda6});}});},'ChatQueues':function(){return new Promise(function(_0x2f0575){var _0x1d9235=[];for(var _0x413619 in _0x30e943[_0xd908('0x50')]){if(_0x30e943[_0xd908('0x50')][_0xd908('0x4b')](_0x413619)){var _0x1238e7=_0x30e943[_0xd908('0x50')][_0x413619];var _0x2e3532={'id':_0x1238e7['id'],'available':_0x1238e7[_0xd908('0x51')],'loggedIn':_0x1238e7[_0xd908('0x52')],'name':_0x1238e7['name'],'paused':_0x1238e7['paused'],'waiting':_0x1238e7['waiting']};_0x1d9235[_0xd908('0x22')](_0x2e3532);}}_0x2f0575({'count':_0x1d9235[_0xd908('0x1a')],'rows':_0x1d9235});});},'MailQueues':function(){return new Promise(function(_0x493e5b){var _0x32c190=[];for(var _0x4c0392 in _0x30e943[_0xd908('0x53')]){if(_0x30e943[_0xd908('0x53')]['hasOwnProperty'](_0x4c0392)){var _0x17d036=_0x30e943[_0xd908('0x53')][_0x4c0392];var _0x41bdf2={'id':_0x17d036['id'],'available':_0x17d036['available'],'loggedIn':_0x17d036['loggedIn'],'name':_0x17d036[_0xd908('0x54')],'paused':_0x17d036[_0xd908('0x55')],'waiting':_0x17d036[_0xd908('0x56')]};_0x32c190['push'](_0x41bdf2);}}_0x493e5b({'count':_0x32c190['length'],'rows':_0x32c190});});},'OpenchannelQueues':function(){return new Promise(function(_0x296dc8){var _0xec6baa=[];for(var _0x13dd9f in _0x30e943[_0xd908('0x57')]){if(_0x30e943[_0xd908('0x57')][_0xd908('0x4b')](_0x13dd9f)){var _0x5edca5=_0x30e943[_0xd908('0x57')][_0x13dd9f];var _0x40104d={'id':_0x5edca5['id'],'available':_0x5edca5[_0xd908('0x51')],'loggedIn':_0x5edca5[_0xd908('0x52')],'name':_0x5edca5[_0xd908('0x54')],'paused':_0x5edca5['paused'],'waiting':_0x5edca5[_0xd908('0x56')]};_0xec6baa[_0xd908('0x22')](_0x40104d);}}_0x296dc8({'count':_0xec6baa[_0xd908('0x1a')],'rows':_0xec6baa});});},'SmsQueues':function(){return new Promise(function(_0x2cb61c){var _0x39a203=[];for(var _0x22350e in _0x30e943[_0xd908('0x58')]){if(_0x30e943['smsQueues']['hasOwnProperty'](_0x22350e)){var _0x2a84c7=_0x30e943[_0xd908('0x58')][_0x22350e];var _0x46290f={'id':_0x2a84c7['id'],'available':_0x2a84c7[_0xd908('0x51')],'loggedIn':_0x2a84c7[_0xd908('0x52')],'name':_0x2a84c7[_0xd908('0x54')],'paused':_0x2a84c7[_0xd908('0x55')],'waiting':_0x2a84c7[_0xd908('0x56')]};_0x39a203[_0xd908('0x22')](_0x46290f);}}_0x2cb61c({'count':_0x39a203['length'],'rows':_0x39a203});});},'FaxQueues':function(){return new Promise(function(_0xd4339a){var _0x2a681a=[];for(var _0x4b7366 in _0x30e943['faxQueues']){if(_0x30e943['faxQueues']['hasOwnProperty'](_0x4b7366)){var _0x447f53=_0x30e943['faxQueues'][_0x4b7366];var _0x4b2f6d={'id':_0x447f53['id'],'available':_0x447f53[_0xd908('0x51')],'loggedIn':_0x447f53[_0xd908('0x52')],'name':_0x447f53[_0xd908('0x54')],'paused':_0x447f53[_0xd908('0x55')],'waiting':_0x447f53[_0xd908('0x56')]};_0x2a681a[_0xd908('0x22')](_0x4b2f6d);}}_0xd4339a({'count':_0x2a681a['length'],'rows':_0x2a681a});});},'WhatsappQueues':function(){return new Promise(function(_0x5f3b0c){var _0x62dc13=[];for(var _0x2e3d5 in _0x30e943[_0xd908('0x59')]){if(_0x30e943['whatsappQueues'][_0xd908('0x4b')](_0x2e3d5)){var _0x57e1e8=_0x30e943['whatsappQueues'][_0x2e3d5];var _0x524714={'id':_0x57e1e8['id'],'available':_0x57e1e8[_0xd908('0x51')],'loggedIn':_0x57e1e8['loggedIn'],'name':_0x57e1e8[_0xd908('0x54')],'paused':_0x57e1e8[_0xd908('0x55')],'waiting':_0x57e1e8[_0xd908('0x56')]};_0x62dc13[_0xd908('0x22')](_0x524714);}}_0x5f3b0c({'count':_0x62dc13[_0xd908('0x1a')],'rows':_0x62dc13});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x29b7b1){var _0x35fb54=_['values'](_0x30e943['chatQueuesWaitingInteractions']);_0x29b7b1({'count':_0x35fb54['length'],'rows':_0x35fb54});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x17d4bc){var _0x30bdcf=_[_0xd908('0x4f')](_0x30e943[_0xd908('0x5a')]);_0x17d4bc({'count':_0x30bdcf[_0xd908('0x1a')],'rows':_0x30bdcf});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3c970){var _0x22daec=_[_0xd908('0x4f')](_0x30e943[_0xd908('0x5b')]);_0x3c970({'count':_0x22daec[_0xd908('0x1a')],'rows':_0x22daec});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xe10450){var _0x302613=_[_0xd908('0x4f')](_0x30e943[_0xd908('0x5c')]);_0xe10450({'count':_0x302613[_0xd908('0x1a')],'rows':_0x302613});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1fe26c){var _0x2c1e71=_[_0xd908('0x4f')](_0x30e943[_0xd908('0x5d')]);_0x1fe26c({'count':_0x2c1e71[_0xd908('0x1a')],'rows':_0x2c1e71});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x394d7d){var _0x103568=_[_0xd908('0x4f')](_0x30e943['whatsappQueuesWaitingInteractions']);_0x394d7d({'count':_0x103568[_0xd908('0x1a')],'rows':_0x103568});});}};var _0x291f52=jayson[_0xd908('0x5e')](_0x458d5d)[_0xd908('0x5f')]();_0x291f52['on'](_0xd908('0x35'),function(_0x45c5f6){logger['error'](JSON[_0xd908('0x60')](_0x45c5f6));return _0x5adcf5(_0x45c5f6);});_0x291f52['listen'](0x232c,_0xd908('0x61'),function(){console[_0xd908('0x62')](_0xd908('0x63'),0x232c);return _0x43bc96(_0xd908('0x64')+0x232c);});});}; \ No newline at end of file +var _0xf65d=['%s:%s:%s','./interval','consequence','priority','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','Applications\x20executed','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','error','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','app','toLowerCase','autoreply','appdata','split','push','join','slice','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body'];(function(_0x742c2b,_0x1358fa){var _0x682d75=function(_0x7fb2da){while(--_0x7fb2da){_0x742c2b['push'](_0x742c2b['shift']());}};_0x682d75(++_0x1358fa);}(_0xf65d,0x9f));var _0xdf65=function(_0x5ecde7,_0x411905){_0x5ecde7=_0x5ecde7-0x0;var _0x4c037e=_0xf65d[_0x5ecde7];return _0x4c037e;};'use strict';var _=require(_0xdf65('0x0'));var util=require('util');var path=require(_0xdf65('0x1'));var fs=require('fs');var jayson=require(_0xdf65('0x2'));var BPromise=require(_0xdf65('0x3'));var utils=require(_0xdf65('0x4'));var sUtils=require(_0xdf65('0x5'));var logger=require(_0xdf65('0x6'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xdf65('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xdf65('0x8')),'whatsappQueueReport':require(_0xdf65('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x40cc08,_0x3f5cae,_0x97292b){return util[_0xdf65('0xa')](_0xdf65('0xb'),_0x40cc08,_0x3f5cae||0x0,_0x97292b||0x0);}function getIntervals(_0x46a70d,_0x483974){var _0x27df5c=[];if(!_['isNil'](_0x483974[_0xdf65('0xc')])&&!_[_0xdf65('0xd')](_0x46a70d[_0x483974[_0xdf65('0xc')]])&&!_['isNil'](_0x46a70d[_0x483974['IntervalId']][_0xdf65('0xe')])){_0x27df5c=_[_0xdf65('0xf')](_0x46a70d[_0x483974[_0xdf65('0xc')]][_0xdf65('0xe')],_0xdf65('0x10'));}else if(!_[_0xdf65('0xd')](_0x483974['interval'])){_0x27df5c=[_0x483974[_0xdf65('0x10')]];}return _0x27df5c;}exports[_0xdf65('0x11')]=function(_0x51f281){_0x51f281['rules']={};return new BPromise(function(_0x5a0ae1,_0x26868c){var _0x110170={'Start':function(_0x11f0e3){var _0x1b6d10=this;return new Promise(function(_0x1d6f22,_0x9bcb1c){if(_0x11f0e3){try{var _0x16ced1=[];var _0x230429=getId(_0x11f0e3[_0xdf65('0x12')],_0x11f0e3[_0xdf65('0x13')]?_0x11f0e3['message']['id']:0x0,_0x11f0e3[_0xdf65('0x14')]?_0x11f0e3['interaction']['id']:0x0);var _0x28fcd1=sUtils[_0xdf65('0x15')](_0x51f281,_0x11f0e3);if(_0x11f0e3[_0xdf65('0x16')]||!_0x28fcd1&&_0x11f0e3[_0xdf65('0x17')]&&_[_0xdf65('0x18')](_0x11f0e3[_0xdf65('0x17')])&&_0x11f0e3['applications'][_0xdf65('0x19')]){for(var _0x5db9c0=0x0;_0x5db9c0<_0x11f0e3[_0xdf65('0x17')][_0xdf65('0x19')];_0x5db9c0+=0x1){var _0xd57bc8=_0x11f0e3[_0xdf65('0x17')][_0x5db9c0];if(fs[_0xdf65('0x1a')](path['join'](__dirname,_0xdf65('0x17'),_0xd57bc8[_0xdf65('0x1b')]+'.js'))){var _0x45fb5f=[];switch(_0xd57bc8[_0xdf65('0x1b')][_0xdf65('0x1c')]()){case _0xdf65('0x1d'):var _0x529bf0=_0xd57bc8[_0xdf65('0x1e')][_0xdf65('0x1f')](',');if(_0x11f0e3['channel']==='mail'){_0x45fb5f[_0xdf65('0x20')](_0x529bf0[0x0]);_0x45fb5f[_0xdf65('0x20')](_0x529bf0[0x1]);_0x45fb5f[_0xdf65('0x20')](_0x529bf0['slice'](0x2,_0x529bf0['length'])[_0xdf65('0x21')](','));}else{_0x45fb5f[_0xdf65('0x20')](_0x529bf0[0x0]);_0x45fb5f['push'](_0x529bf0['slice'](0x1,_0x529bf0['length'])[_0xdf65('0x21')](','));}break;case'dialogflow':var _0xa04154=_0xd57bc8['appdata'][_0xdf65('0x1f')](',');_0x45fb5f[_0xdf65('0x20')](_0xa04154[0x0]);_0x45fb5f[_0xdf65('0x20')](_0xa04154[0x1]);_0x45fb5f[_0xdf65('0x20')](_0xa04154[_0xdf65('0x22')](0x2,_0xa04154[_0xdf65('0x19')])[_0xdf65('0x21')](','));break;case _0xdf65('0x23'):var _0xf73b57=_0xd57bc8[_0xdf65('0x1e')][_0xdf65('0x1f')](',');_0x45fb5f['push'](_0xf73b57[0x0]);_0x45fb5f['push'](_0xf73b57[0x1]);_0x45fb5f[_0xdf65('0x20')](_0xf73b57[0x2]);_0x45fb5f[_0xdf65('0x20')](_0xf73b57[0x3]);_0x45fb5f[_0xdf65('0x20')](_0xf73b57['slice'](0x4,_0xf73b57[_0xdf65('0x19')])['join'](','));break;case _0xdf65('0x24'):var _0x3de60c=_0xd57bc8['appdata'][_0xdf65('0x1f')](',');_0x45fb5f[_0xdf65('0x20')](_0x3de60c[0x0]);_0x45fb5f[_0xdf65('0x20')](_0x3de60c[0x1]);_0x45fb5f[_0xdf65('0x20')](_0x3de60c[0x2]);_0x45fb5f[_0xdf65('0x20')](_0x3de60c[0x3]);_0x45fb5f[_0xdf65('0x20')](_0x3de60c['slice'](0x4,_0x3de60c['length'])[_0xdf65('0x21')](','));break;case'message':_0x45fb5f[_0xdf65('0x20')](_0xd57bc8[_0xdf65('0x1e')]);break;case _0xdf65('0x25'):_0x45fb5f['push'](_0xd57bc8[_0xdf65('0x26')]);_0x45fb5f[_0xdf65('0x20')](_0xd57bc8[_0xdf65('0x1e')]);break;case _0xdf65('0x27'):var _0x27ac6b=utils['getMustacheRender'](_0x11f0e3[_0xdf65('0x28')][_0xdf65('0x29')],_0x11f0e3);var _0x116164=_0xd57bc8['appdata'][_0xdf65('0x1f')](',');_0x45fb5f[_0xdf65('0x20')](_0x116164[0x0]);_0x45fb5f[_0xdf65('0x20')](_0x116164[0x1]);_0x45fb5f[_0xdf65('0x20')](_0x116164[0x2]);_0x45fb5f[_0xdf65('0x20')](_0x116164[0x3]);_0x45fb5f['push'](_0x116164[0x4]);_0x45fb5f['push'](_0x116164[0x5]);_0x45fb5f[_0xdf65('0x20')](_0x116164[0x6]);_0x45fb5f[_0xdf65('0x20')](_0x116164[0x7]);_0x45fb5f[_0xdf65('0x20')](_0x116164[0x8]);_0x45fb5f['push'](_0x116164[0x9]);_0x45fb5f[_0xdf65('0x20')](_0x116164[0xa]);_0x45fb5f['push'](_0x11f0e3[_0xdf65('0x14')]['id']);_0x45fb5f[_0xdf65('0x20')](_0x11f0e3[_0xdf65('0x13')]['id']);_0x45fb5f['push'](_0xd57bc8[_0xdf65('0x2a')]);_0x45fb5f[_0xdf65('0x20')](_0x11f0e3[_0xdf65('0x14')][_0xdf65('0x2b')]);_0x45fb5f[_0xdf65('0x20')](_0x11f0e3[_0xdf65('0x2c')][_0xdf65('0x2c')]);_0x45fb5f[_0xdf65('0x20')](_0x27ac6b);break;default:_0x45fb5f=_['isNil'](_0xd57bc8[_0xdf65('0x1e')])?[]:_0xd57bc8[_0xdf65('0x1e')][_0xdf65('0x1f')](',');}var _0x4fe02d={'id':util['format'](_0xdf65('0x2d'),_0x230429,_0xd57bc8['id'],_0xd57bc8['app']),'condition':require(_0xdf65('0x2e'))['condition'](_0x230429,getIntervals(_0x51f281['intervals'],_0xd57bc8),_0x51f281),'consequence':require('./applications/'+_0xd57bc8[_0xdf65('0x1b')])[_0xdf65('0x2f')](_0x230429,_0x45fb5f,_0x51f281,_0x11f0e3),'p':_0xd57bc8[_0xdf65('0x30')]||0x0};logger['info']('Push\x20new\x20rule',_0x4fe02d['id'],_0xdf65('0x31'),getIntervals(_0x51f281['intervals'],_0xd57bc8)[_0xdf65('0x21')](_0xdf65('0x32')));_0x16ced1[_0xdf65('0x20')](_0x4fe02d);}else{logger['error'](_0xdf65('0x33'),path['join'](__dirname,_0xdf65('0x17'),_0xd57bc8[_0xdf65('0x1b')]+'.js'));}}_0x51f281[_0xdf65('0x34')][_0x230429]=new RuleEngine(_0x16ced1);_0x51f281[_0xdf65('0x34')][_0x230429][_0xdf65('0x35')](_0x11f0e3,function(_0x5e1195){logger[_0xdf65('0x36')](_0xdf65('0x37'),JSON[_0xdf65('0x38')](_0x5e1195[_0xdf65('0x39')]));if(_0x51f281[_0xdf65('0x34')][_0x230429]){_0x51f281[_0xdf65('0x34')][_0x230429][_0xdf65('0x3a')]('complete');}});return _0x1d6f22({'code':0xc8,'message':_0x11f0e3});}else{if(_0x28fcd1){logger[_0xdf65('0x36')](util[_0xdf65('0xa')](_0xdf65('0x3b'),_0x230429));}else{logger[_0xdf65('0x36')](_0xdf65('0x3c'));}return _0x1d6f22({'code':0xc8,'message':_0x11f0e3});}}catch(_0x5e36cf){logger['error'](_0x5e36cf[_0xdf65('0x3d')]);return _0x9bcb1c(_0x1b6d10[_0xdf65('0x3e')](0x1f4,_0x5e36cf));}}return _0x9bcb1c(_0xdf65('0x3f'));});},'AcceptMessage':function(_0x3b9d48){var _0x17ef62=this;return new Promise(function(_0x369d38,_0x281fc8){if(_0x3b9d48[_0xdf65('0x40')]&&_0x3b9d48[_0xdf65('0x40')]['id']){if(_0x51f281[_0xdf65('0x41')][_0x3b9d48['agent']['id']]){_0x51f281[_0xdf65('0x41')][_0x3b9d48[_0xdf65('0x40')]['id']]['busy']=![];_0x51f281[_0xdf65('0x41')][_0x3b9d48[_0xdf65('0x40')]['id']][_0xdf65('0x42')]=undefined;}}if(_0x3b9d48['message']&&_0x3b9d48[_0xdf65('0x13')]['id']){try{var _0x164be8=getId(_0x3b9d48[_0xdf65('0x12')],_0x3b9d48['message']?_0x3b9d48[_0xdf65('0x13')]['id']:0x0,_0x3b9d48['interaction']?_0x3b9d48['interaction']['id']:0x0);if(_0x51f281['rules'][_0x164be8]){_0x51f281[_0xdf65('0x34')][_0x164be8][_0xdf65('0x3a')]('end');if(rpc[_0x3b9d48[_0xdf65('0x12')]+_0xdf65('0x43')]){rpc[_0x3b9d48[_0xdf65('0x12')]+'QueueReport'][_0xdf65('0x44')](_0x164be8,{'UserId':_0x3b9d48[_0xdf65('0x13')][_0xdf65('0x45')]})[_0xdf65('0x46')](function(){logger['error'](_0xdf65('0x47'));});}}return _0x369d38({'code':0xc8,'message':_0x3b9d48});}catch(_0x446a2d){logger[_0xdf65('0x3e')](_0x446a2d[_0xdf65('0x3d')]);return _0x281fc8(_0x17ef62[_0xdf65('0x3e')](0x1f4,_0x446a2d));}}logger[_0xdf65('0x3e')](_0xdf65('0x48'));return _0x281fc8(_0x17ef62[_0xdf65('0x3e')](0x1f4,_0xdf65('0x48')));});},'RejectMessage':function(_0x4baad2){var _0x83e749=this;return new Promise(function(_0x3ba49f,_0x48c9eb){if(_0x4baad2[_0xdf65('0x40')]&&_0x4baad2[_0xdf65('0x40')]['id']){try{if(_0x51f281[_0xdf65('0x41')][_0x4baad2[_0xdf65('0x40')]['id']]){_0x51f281[_0xdf65('0x41')][_0x4baad2[_0xdf65('0x40')]['id']][_0xdf65('0x49')]=![];_0x51f281[_0xdf65('0x41')][_0x4baad2[_0xdf65('0x40')]['id']][_0xdf65('0x42')]=undefined;}return _0x3ba49f({'code':0xc8,'message':_0x4baad2});}catch(_0x4c6b40){logger[_0xdf65('0x3e')](_0x4c6b40[_0xdf65('0x3d')]);return _0x48c9eb(_0x83e749[_0xdf65('0x3e')](0x1f4,_0x4c6b40));}}logger[_0xdf65('0x3e')](_0xdf65('0x48'));return _0x48c9eb(_0x83e749[_0xdf65('0x3e')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x24f01c){var _0x34f3fa=this;return new Promise(function(_0x1777a1,_0x54528d){if(_0x24f01c[_0xdf65('0x12')]&&_0x24f01c[_0xdf65('0x14')]&&_0x24f01c[_0xdf65('0x14')]['id']){try{var _0x2fc66c=getId(_0x24f01c[_0xdf65('0x12')],_0x24f01c[_0xdf65('0x13')]?_0x24f01c['message']['id']:0x0,_0x24f01c[_0xdf65('0x14')]?_0x24f01c[_0xdf65('0x14')]['id']:0x0);if(_0x51f281[_0xdf65('0x34')][_0x2fc66c]){_0x51f281['rules'][_0x2fc66c]['emit'](_0xdf65('0x4a'));}return _0x1777a1({'code':0xc8,'message':_0x24f01c});}catch(_0xf8a30a){logger[_0xdf65('0x3e')](_0xf8a30a['stack']);return _0x54528d(_0x34f3fa[_0xdf65('0x3e')](0x1f4,_0xf8a30a));}}logger[_0xdf65('0x3e')](_0xdf65('0x48'));return _0x54528d(_0x34f3fa['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x292eee){var _0x5f2c2c=this;return new Promise(function(_0x532af9,_0x3786fb){if(_0x51f281['agents'][_0xdf65('0x4b')](_0x292eee['id'])){for(var _0x28ad26 in _0x292eee[_0xdf65('0x4c')]){if(_0x292eee[_0xdf65('0x4c')][_0xdf65('0x4b')](_0x28ad26)){if(_0x51f281['agents'][_0x292eee['id']][_0xdf65('0x4b')](_0x28ad26+'CurrentCapacity')){_0x51f281['agents'][_0x292eee['id']][_0x28ad26+_0xdf65('0x4d')]=parseInt(_0x292eee[_0xdf65('0x4c')][_0x28ad26],0xa);}}}_0x51f281[_0xdf65('0x41')][_0x292eee['id']][_0xdf65('0x4e')]();return _0x532af9({'code':0xc8,'message':_0x51f281[_0xdf65('0x41')][_0x292eee['id']]});}else{return _0x3786fb(_0x5f2c2c[_0xdf65('0x3e')](0x1f4,_0xdf65('0x4f')));}});},'Agents':function(_0x5e47ed){return new Promise(function(_0x651c52){var _0x4d624d=_[_0xdf65('0x50')](_0x51f281[_0xdf65('0x41')]);if(_0x5e47ed&&_0x5e47ed['id']){var _0x59b0cc=_[_0xdf65('0x51')](_0x4d624d,function(_0x841b2e){return _0x841b2e['id']===_0x5e47ed['id'];});_0x651c52(_0x59b0cc);}else{_0x651c52({'count':_0x4d624d[_0xdf65('0x19')],'rows':_0x4d624d});}});},'ChatQueues':function(){return new Promise(function(_0x605fa9){var _0x256294=[];for(var _0x56f541 in _0x51f281[_0xdf65('0x52')]){if(_0x51f281[_0xdf65('0x52')][_0xdf65('0x4b')](_0x56f541)){var _0x3d12a2=_0x51f281[_0xdf65('0x52')][_0x56f541];var _0x36de61={'id':_0x3d12a2['id'],'available':_0x3d12a2[_0xdf65('0x53')],'loggedIn':_0x3d12a2['loggedIn'],'name':_0x3d12a2[_0xdf65('0x54')],'paused':_0x3d12a2[_0xdf65('0x55')],'waiting':_0x3d12a2[_0xdf65('0x56')]};_0x256294['push'](_0x36de61);}}_0x605fa9({'count':_0x256294[_0xdf65('0x19')],'rows':_0x256294});});},'MailQueues':function(){return new Promise(function(_0xaac728){var _0x58f0e4=[];for(var _0x55c211 in _0x51f281['mailQueues']){if(_0x51f281['mailQueues']['hasOwnProperty'](_0x55c211)){var _0x2f1a65=_0x51f281[_0xdf65('0x57')][_0x55c211];var _0x3a7e96={'id':_0x2f1a65['id'],'available':_0x2f1a65['available'],'loggedIn':_0x2f1a65[_0xdf65('0x58')],'name':_0x2f1a65[_0xdf65('0x54')],'paused':_0x2f1a65['paused'],'waiting':_0x2f1a65[_0xdf65('0x56')]};_0x58f0e4[_0xdf65('0x20')](_0x3a7e96);}}_0xaac728({'count':_0x58f0e4[_0xdf65('0x19')],'rows':_0x58f0e4});});},'OpenchannelQueues':function(){return new Promise(function(_0xb0ee4c){var _0x4980e8=[];for(var _0x596cab in _0x51f281['openchannelQueues']){if(_0x51f281[_0xdf65('0x59')][_0xdf65('0x4b')](_0x596cab)){var _0x2b6603=_0x51f281[_0xdf65('0x59')][_0x596cab];var _0x140526={'id':_0x2b6603['id'],'available':_0x2b6603[_0xdf65('0x53')],'loggedIn':_0x2b6603['loggedIn'],'name':_0x2b6603[_0xdf65('0x54')],'paused':_0x2b6603[_0xdf65('0x55')],'waiting':_0x2b6603[_0xdf65('0x56')]};_0x4980e8[_0xdf65('0x20')](_0x140526);}}_0xb0ee4c({'count':_0x4980e8['length'],'rows':_0x4980e8});});},'SmsQueues':function(){return new Promise(function(_0x4da996){var _0x1d9619=[];for(var _0x447947 in _0x51f281['smsQueues']){if(_0x51f281[_0xdf65('0x5a')]['hasOwnProperty'](_0x447947)){var _0x44bad2=_0x51f281['smsQueues'][_0x447947];var _0x4b0eec={'id':_0x44bad2['id'],'available':_0x44bad2[_0xdf65('0x53')],'loggedIn':_0x44bad2['loggedIn'],'name':_0x44bad2[_0xdf65('0x54')],'paused':_0x44bad2[_0xdf65('0x55')],'waiting':_0x44bad2[_0xdf65('0x56')]};_0x1d9619[_0xdf65('0x20')](_0x4b0eec);}}_0x4da996({'count':_0x1d9619[_0xdf65('0x19')],'rows':_0x1d9619});});},'FaxQueues':function(){return new Promise(function(_0x2dea75){var _0x42641c=[];for(var _0x6e6892 in _0x51f281[_0xdf65('0x5b')]){if(_0x51f281[_0xdf65('0x5b')]['hasOwnProperty'](_0x6e6892)){var _0x1de471=_0x51f281[_0xdf65('0x5b')][_0x6e6892];var _0x138fa7={'id':_0x1de471['id'],'available':_0x1de471['available'],'loggedIn':_0x1de471[_0xdf65('0x58')],'name':_0x1de471[_0xdf65('0x54')],'paused':_0x1de471[_0xdf65('0x55')],'waiting':_0x1de471[_0xdf65('0x56')]};_0x42641c[_0xdf65('0x20')](_0x138fa7);}}_0x2dea75({'count':_0x42641c[_0xdf65('0x19')],'rows':_0x42641c});});},'WhatsappQueues':function(){return new Promise(function(_0x36675e){var _0x1c8d90=[];for(var _0xc993e1 in _0x51f281[_0xdf65('0x5c')]){if(_0x51f281[_0xdf65('0x5c')]['hasOwnProperty'](_0xc993e1)){var _0x437a00=_0x51f281['whatsappQueues'][_0xc993e1];var _0x315b13={'id':_0x437a00['id'],'available':_0x437a00[_0xdf65('0x53')],'loggedIn':_0x437a00[_0xdf65('0x58')],'name':_0x437a00[_0xdf65('0x54')],'paused':_0x437a00[_0xdf65('0x55')],'waiting':_0x437a00[_0xdf65('0x56')]};_0x1c8d90[_0xdf65('0x20')](_0x315b13);}}_0x36675e({'count':_0x1c8d90[_0xdf65('0x19')],'rows':_0x1c8d90});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x454cc6){var _0x254b90=_[_0xdf65('0x50')](_0x51f281[_0xdf65('0x5d')]);_0x454cc6({'count':_0x254b90[_0xdf65('0x19')],'rows':_0x254b90});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1138b2){var _0x55ee5b=_[_0xdf65('0x50')](_0x51f281[_0xdf65('0x5e')]);_0x1138b2({'count':_0x55ee5b[_0xdf65('0x19')],'rows':_0x55ee5b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2e885a){var _0xc87c7=_[_0xdf65('0x50')](_0x51f281[_0xdf65('0x5f')]);_0x2e885a({'count':_0xc87c7[_0xdf65('0x19')],'rows':_0xc87c7});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x414710){var _0x457568=_[_0xdf65('0x50')](_0x51f281['smsQueuesWaitingInteractions']);_0x414710({'count':_0x457568[_0xdf65('0x19')],'rows':_0x457568});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4718a6){var _0x298669=_[_0xdf65('0x50')](_0x51f281[_0xdf65('0x60')]);_0x4718a6({'count':_0x298669[_0xdf65('0x19')],'rows':_0x298669});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xe8f273){var _0x2c6923=_[_0xdf65('0x50')](_0x51f281[_0xdf65('0x61')]);_0xe8f273({'count':_0x2c6923['length'],'rows':_0x2c6923});});}};var _0x142fd2=jayson['server'](_0x110170)[_0xdf65('0x62')]();_0x142fd2['on']('error',function(_0x497d19){logger['error'](JSON[_0xdf65('0x38')](_0x497d19));return _0x26868c(_0x497d19);});_0x142fd2[_0xdf65('0x11')](0x232c,_0xdf65('0x63'),function(){console['log'](_0xdf65('0x64'),0x232c);return _0x5a0ae1(_0xdf65('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 4f8b784..41b4dc4 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 _0xc5eb=['true','all','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','iftime\x20%s','message','indexOf'];(function(_0x4e9fed,_0x19f4f3){var _0x5c8cc0=function(_0x36116c){while(--_0x36116c){_0x4e9fed['push'](_0x4e9fed['shift']());}};_0x5c8cc0(++_0x19f4f3);}(_0xc5eb,0x1c9));var _0xbc5e=function(_0xe4ef10,_0x3b9623){_0xe4ef10=_0xe4ef10-0x0;var _0x373342=_0xc5eb[_0xe4ef10];return _0x373342;};'use strict';var util=require(_0xbc5e('0x0'));var BPromise=require(_0xbc5e('0x1'));var jayson=require(_0xbc5e('0x2'));var _=require(_0xbc5e('0x3'));var logger=require(_0xbc5e('0x4'))(_0xbc5e('0x5'));var client=jayson[_0xbc5e('0x6')][_0xbc5e('0x7')]({'port':0x232a});function request(_0xd33647,_0x1674c3){return new BPromise(function(_0x45a2fc,_0x2469bc){return client['request'](_0xd33647,_0x1674c3)[_0xbc5e('0x8')](function(_0x5beac0){if(_0x5beac0[_0xbc5e('0x9')]){return _0x2469bc(_0x5beac0[_0xbc5e('0x9')]['message']);}else{return _0x45a2fc(_0x5beac0[_0xbc5e('0xa')]);}})[_0xbc5e('0xb')](function(_0x1434cd){return _0x2469bc(_0x1434cd);});});}exports[_0xbc5e('0xc')]=function(_0x2714b6,_0x1358c9,_0x49aa9c){return function(_0x3e40b7){if(_0x49aa9c['rules']&&!_0x49aa9c[_0xbc5e('0xd')][_0x2714b6]){logger[_0xbc5e('0xe')](_0xbc5e('0xf'),_0x2714b6);return _0x3e40b7['stop']();}var _0x236bbe=[];for(var _0x554b6e=0x0;_0x554b6e<_0x1358c9[_0xbc5e('0x10')];_0x554b6e+=0x1){_0x236bbe[_0xbc5e('0x11')](request(_0xbc5e('0x12'),{'command':util[_0xbc5e('0x13')](_0xbc5e('0x14'),_0x1358c9[_0x554b6e])})[_0xbc5e('0x8')](function(_0x479ee5){return _0x479ee5&&_0x479ee5[_0xbc5e('0x15')]&&_0x479ee5[_0xbc5e('0x15')][_0xbc5e('0x16')](_0xbc5e('0x17'))>=0x0?!![]:![];})[_0xbc5e('0xb')](function(){logger[_0xbc5e('0x9')]('[%s][INTERVAL]\x20%s',_0x2714b6,_0x1358c9[_0x554b6e]);}));}BPromise[_0xbc5e('0x18')](_0x236bbe)['then'](function(_0x5843c0){var _0x529c56=_['some'](_0x5843c0);logger[_0xbc5e('0xe')](_0xbc5e('0x19'),_0x2714b6,_0x1358c9['join'](_0xbc5e('0x1a')),_0x529c56);_0x3e40b7[_0xbc5e('0x1b')](_0x529c56);})['catch'](function(_0x48acc8){logger[_0xbc5e('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x2714b6,_0x1358c9[_0xbc5e('0x1c')]('\x20|\x20'),_0x48acc8[_0xbc5e('0x1d')]);_0x3e40b7['stop']();});};}; \ No newline at end of file +var _0x0833=['catch','stack','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when'];(function(_0x1311e5,_0x3ec7c1){var _0x5e6d41=function(_0x3f0b93){while(--_0x3f0b93){_0x1311e5['push'](_0x1311e5['shift']());}};_0x5e6d41(++_0x3ec7c1);}(_0x0833,0x98));var _0x3083=function(_0x4eb236,_0x2c28a3){_0x4eb236=_0x4eb236-0x0;var _0x26be12=_0x0833[_0x4eb236];return _0x26be12;};'use strict';var util=require('util');var BPromise=require(_0x3083('0x0'));var jayson=require('jayson/promise');var _=require(_0x3083('0x1'));var logger=require(_0x3083('0x2'))(_0x3083('0x3'));var client=jayson[_0x3083('0x4')][_0x3083('0x5')]({'port':0x232a});function request(_0x45d55f,_0x3bc05e){return new BPromise(function(_0x2bccfc,_0x704f19){return client[_0x3083('0x6')](_0x45d55f,_0x3bc05e)[_0x3083('0x7')](function(_0x3a6386){if(_0x3a6386[_0x3083('0x8')]){return _0x704f19(_0x3a6386[_0x3083('0x8')][_0x3083('0x9')]);}else{return _0x2bccfc(_0x3a6386[_0x3083('0xa')]);}})['catch'](function(_0x9636b3){return _0x704f19(_0x9636b3);});});}exports[_0x3083('0xb')]=function(_0x4c90ec,_0x5179ac,_0x58a753){return function(_0x483591){if(_0x58a753['rules']&&!_0x58a753[_0x3083('0xc')][_0x4c90ec]){logger['info'](_0x3083('0xd'),_0x4c90ec);return _0x483591[_0x3083('0xe')]();}var _0x4242d5=[];for(var _0x32fd3e=0x0;_0x32fd3e<_0x5179ac['length'];_0x32fd3e+=0x1){_0x4242d5[_0x3083('0xf')](request(_0x3083('0x10'),{'command':util[_0x3083('0x11')](_0x3083('0x12'),_0x5179ac[_0x32fd3e])})[_0x3083('0x7')](function(_0x448666){return _0x448666&&_0x448666[_0x3083('0x9')]&&_0x448666[_0x3083('0x9')][_0x3083('0x13')]('true')>=0x0?!![]:![];})['catch'](function(){logger[_0x3083('0x8')](_0x3083('0x14'),_0x4c90ec,_0x5179ac[_0x32fd3e]);}));}BPromise[_0x3083('0x15')](_0x4242d5)[_0x3083('0x7')](function(_0x46773e){var _0x20dcb1=_[_0x3083('0x16')](_0x46773e);logger[_0x3083('0x17')](_0x3083('0x18'),_0x4c90ec,_0x5179ac[_0x3083('0x19')](_0x3083('0x1a')),_0x20dcb1);_0x483591[_0x3083('0x1b')](_0x20dcb1);})[_0x3083('0x1c')](function(_0x1a2e81){logger[_0x3083('0x8')](_0x3083('0x18'),_0x4c90ec,_0x5179ac[_0x3083('0x19')](_0x3083('0x1a')),_0x1a2e81[_0x3083('0x1d')]);_0x483591[_0x3083('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 52e4f54..d240f8a 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 _0xfe57=['agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','agentconnect','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agent','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','type','agentcomplete','acw','agentacw','CreateVoiceAgentReport','request','agentcalled','destuniqueid','agentcalledAt','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error'];(function(_0x340bbd,_0x2da480){var _0x4eaea6=function(_0x428d57){while(--_0x428d57){_0x340bbd['push'](_0x340bbd['shift']());}};_0x4eaea6(++_0x2da480);}(_0xfe57,0x195));var _0x7fe5=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0xfe57[_0x9a3e0f];return _0x3d2a9a;};'use strict';var _=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x581f71,_0x3f7dca){utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x4'),_0x581f71[_0x7fe5('0x5')],_0x581f71[_0x7fe5('0x6')],_0x581f71[_0x7fe5('0x7')],_0x581f71[_0x7fe5('0x8')],_0x581f71[_0x7fe5('0x9')],_0x581f71[_0x7fe5('0xa')],_0x581f71[_0x7fe5('0xb')],_0x581f71[_0x7fe5('0xc')]));if(_0x581f71[_0x7fe5('0x7')]){utils['getVoiceQueueByName'](_0x581f71[_0x7fe5('0x7')])['then'](function(_0x3564f1){if(_0x3564f1){_0x581f71[_0x7fe5('0xd')]=_0x3564f1['type'];_0x581f71['agentacw']=_0x581f71[_0x7fe5('0xe')]?_0x3564f1[_0x7fe5('0xf')]:![];_0x581f71['acwtime']=_0x581f71[_0x7fe5('0x10')]?_0x3564f1['acwTimeout']:0x0;}utils['request'](_0x7fe5('0x11'),_0x581f71);});}else{utils[_0x7fe5('0x12')](_0x7fe5('0x11'),_0x581f71);}if(_0x3f7dca){delete transfers[_0x581f71[_0x7fe5('0x5')]];}else{delete agents[_0x581f71['destuniqueid']];}}exports[_0x7fe5('0x13')]=function(_0x16bed9){try{utils['debug'](util[_0x7fe5('0x3')]('[%s][agents][agentcalled]',_0x16bed9[_0x7fe5('0x5')]),_0x16bed9);agents[_0x16bed9[_0x7fe5('0x14')]]=_0x16bed9;agents[_0x16bed9['destuniqueid']][_0x7fe5('0x15')]=utils['now']();agents[_0x16bed9[_0x7fe5('0x14')]][_0x7fe5('0xc')]=_0x7fe5('0x16');agents[_0x16bed9[_0x7fe5('0x14')]][_0x7fe5('0xb')]=null;agents[_0x16bed9[_0x7fe5('0x14')]]['connectedlinename']=null;utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x17'),_0x16bed9[_0x7fe5('0x5')],agents[_0x16bed9[_0x7fe5('0x14')]][_0x7fe5('0x8')],_0x16bed9[_0x7fe5('0x14')]));}catch(_0x29b0bd){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')]('[%s][agents][agentcalled]',_0x16bed9['uniqueid']),_0x29b0bd);}};exports[_0x7fe5('0x19')]=function(_0x459c2d){try{if(!_[_0x7fe5('0x1a')](agents[_0x459c2d[_0x7fe5('0x14')]])){utils[_0x7fe5('0x1b')](util[_0x7fe5('0x3')](_0x7fe5('0x1c'),_0x459c2d[_0x7fe5('0x5')]),_0x459c2d);utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x1d'),_0x459c2d[_0x7fe5('0x5')],agents[_0x459c2d['destuniqueid']][_0x7fe5('0x8')],_0x459c2d[_0x7fe5('0x14')]));agents[_0x459c2d[_0x7fe5('0x14')]]['agentringnoanswer']=!![];agents[_0x459c2d[_0x7fe5('0x14')]]['agentringnoanswerAt']=utils[_0x7fe5('0x1e')]();agents[_0x459c2d['destuniqueid']][_0x7fe5('0xc')]=_0x7fe5('0x1f');agents[_0x459c2d[_0x7fe5('0x14')]][_0x7fe5('0x20')]=_0x7fe5('0x1f');agents[_0x459c2d[_0x7fe5('0x14')]]['holdtime']=_0x459c2d['ringtime']?parseInt(_0x459c2d[_0x7fe5('0x21')])/0x3e8:0x0;agents[_0x459c2d[_0x7fe5('0x14')]][_0x7fe5('0x22')]=0x0;unanswered[_0x7fe5('0x23')](_0x459c2d['destuniqueid']);}}catch(_0x46f816){utils['error'](util[_0x7fe5('0x3')](_0x7fe5('0x1c'),_0x459c2d[_0x7fe5('0x5')]),_0x46f816);}};exports[_0x7fe5('0x24')]=function(_0x1f8572){try{_[_0x7fe5('0x25')](agents,function(_0x5c07f0,_0xe521c6){if(_0x5c07f0[_0x7fe5('0x5')]==_0x1f8572['uniqueid']&&!_[_0x7fe5('0x26')](unanswered,_0x5c07f0[_0x7fe5('0x14')])){utils[_0x7fe5('0x1b')](util[_0x7fe5('0x3')](_0x7fe5('0x27'),_0x1f8572['uniqueid']),_0x1f8572);utils['info'](util[_0x7fe5('0x3')](_0x7fe5('0x28'),_0x1f8572[_0x7fe5('0x5')],_0x5c07f0[_0x7fe5('0x8')],_0x5c07f0['destuniqueid']));_0x5c07f0[_0x7fe5('0x19')]=!![];_0x5c07f0[_0x7fe5('0x29')]=utils[_0x7fe5('0x1e')]();_0x5c07f0[_0x7fe5('0xc')]=_0x7fe5('0x2a');_0x5c07f0[_0x7fe5('0x20')]='abandoned';_0x5c07f0[_0x7fe5('0x2b')]=_0x1f8572[_0x7fe5('0x2b')];_0x5c07f0[_0x7fe5('0x22')]=0x0;writeDB(_0x5c07f0);}});}catch(_0x39cfe9){utils['error'](util['format'](_0x7fe5('0x27'),_0x1f8572['uniqueid']),_0x39cfe9);}};exports[_0x7fe5('0x2c')]=function(_0x513680){try{if(agents[_0x513680[_0x7fe5('0x14')]]){utils['debug'](util['format']('[%s][agents][agentconnect]',_0x513680['uniqueid']),_0x513680);utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x513680[_0x7fe5('0x5')],agents[_0x513680[_0x7fe5('0x14')]]['membername'],_0x513680[_0x7fe5('0x14')]));agents[_0x513680['destuniqueid']]['agentconnectAt']=utils[_0x7fe5('0x1e')]();agents[_0x513680[_0x7fe5('0x14')]][_0x7fe5('0xb')]=_0x513680[_0x7fe5('0xb')];agents[_0x513680[_0x7fe5('0x14')]]['connectedlinename']=_0x513680[_0x7fe5('0x2d')];agents[_0x513680[_0x7fe5('0x14')]]['holdtime']=_0x513680[_0x7fe5('0x21')];agents[_0x513680[_0x7fe5('0x14')]][_0x7fe5('0xc')]=_0x7fe5('0x2e');_[_0x7fe5('0x25')](agents,function(_0x1c81c8,_0x1a14e3){if(_0x1c81c8['destuniqueid']!=_0x513680['destuniqueid']&&_0x1c81c8[_0x7fe5('0x5')]==_0x513680['uniqueid']){_0x1c81c8[_0x7fe5('0x22')]=0x0;_0x1c81c8[_0x7fe5('0x2b')]=_0x513680['ringtime'];_0x1c81c8[_0x7fe5('0x19')]=!![];_0x1c81c8[_0x7fe5('0x29')]=utils[_0x7fe5('0x1e')]();_0x1c81c8[_0x7fe5('0xc')]=_0x7fe5('0x2f');_0x1c81c8[_0x7fe5('0x20')]=_0x7fe5('0x2f');_0x1c81c8['answeredelsewheredestinationuniqueid']=_0x513680['destuniqueid'];_0x1c81c8[_0x7fe5('0x30')]=_0x513680['membername'];writeDB(_0x1c81c8);}});}}catch(_0xad0b05){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')](_0x7fe5('0x31'),_0x513680['uniqueid']),_0xad0b05);}};exports[_0x7fe5('0xe')]=function(_0x5439bc){try{if(!_['isNil'](agents[_0x5439bc[_0x7fe5('0x14')]])){utils[_0x7fe5('0x1b')](util['format'](_0x7fe5('0x32'),_0x5439bc[_0x7fe5('0x5')]),_0x5439bc);utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x33'),_0x5439bc['uniqueid'],agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x8')],_0x5439bc['destuniqueid']));agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0xe')]=!![];agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x34')]=utils['now']();agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x22')]=utils[_0x7fe5('0x35')](agents[_0x5439bc['destuniqueid']][_0x7fe5('0x34')],agents[_0x5439bc[_0x7fe5('0x14')]][_0x7fe5('0x36')]);agents[_0x5439bc['destuniqueid']][_0x7fe5('0x20')]=_0x5439bc[_0x7fe5('0x20')];agents[_0x5439bc[_0x7fe5('0x14')]]['lastevent']=_0x7fe5('0x37');writeDB(agents[_0x5439bc[_0x7fe5('0x14')]]);}}catch(_0x1ac93a){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')](_0x7fe5('0x32'),_0x5439bc[_0x7fe5('0x5')]),_0x1ac93a);}};exports[_0x7fe5('0x38')]=function(_0x446f01){try{if(!_[_0x7fe5('0x1a')](agents[_0x446f01[_0x7fe5('0x39')]])){utils['debug'](util['format']('[%s][agents][blindtransfer]',_0x446f01['uniqueid']),_0x446f01);utils[_0x7fe5('0x2')](util['format'](_0x7fe5('0x3a'),_0x446f01[_0x7fe5('0x5')],agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x8')],agents[_0x446f01[_0x7fe5('0x39')]]['uniqueid']));agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x3b')]=!![];agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x3c')]=_0x7fe5('0x3d');agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x3e')]=_0x446f01[_0x7fe5('0x3f')];agents[_0x446f01[_0x7fe5('0x39')]][_0x7fe5('0x40')]=agents[_0x446f01['transfereruniqueid']][_0x7fe5('0x5')];}}catch(_0x401d05){utils[_0x7fe5('0x18')](util[_0x7fe5('0x3')](_0x7fe5('0x41'),_0x446f01[_0x7fe5('0x5')]),_0x401d05);}};exports['attendedtransfer']=function(_0x31a196){try{utils[_0x7fe5('0x1b')](util[_0x7fe5('0x3')](_0x7fe5('0x42'),_0x31a196[_0x7fe5('0x43')]),_0x31a196);if(_0x31a196[_0x7fe5('0x43')]==_0x31a196[_0x7fe5('0x44')]){if(!_['isNil'](agents[_0x31a196[_0x7fe5('0x45')]])){utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')](_0x7fe5('0x46'),_0x31a196[_0x7fe5('0x43')],agents[_0x31a196['secondtransfereruniqueid']][_0x7fe5('0x8')]));agents[_0x31a196[_0x7fe5('0x45')]][_0x7fe5('0x3b')]=!![];agents[_0x31a196[_0x7fe5('0x45')]]['transfertype']=_0x7fe5('0x47');agents[_0x31a196[_0x7fe5('0x45')]][_0x7fe5('0x3e')]=_0x31a196[_0x7fe5('0x48')];agents[_0x31a196[_0x7fe5('0x45')]][_0x7fe5('0x40')]=_0x31a196[_0x7fe5('0x43')];}if(_0x31a196[_0x7fe5('0x49')]&&agents[_0x31a196[_0x7fe5('0x49')]]){agents[_0x31a196[_0x7fe5('0x49')]][_0x7fe5('0x4a')]=0x1;transfers[_0x31a196['transfereeuniqueid']]=_[_0x7fe5('0x4b')](agents[_0x31a196[_0x7fe5('0x49')]]);transfers[_0x31a196[_0x7fe5('0x49')]]['calleridnum']=agents[_0x31a196['secondtransfereruniqueid']][_0x7fe5('0xa')];transfers[_0x31a196['transfereeuniqueid']][_0x7fe5('0x4c')]=agents[_0x31a196[_0x7fe5('0x45')]]['calleridname'];transfers[_0x31a196[_0x7fe5('0x49')]]['agentcalledAt']=utils[_0x7fe5('0x1e')]();transfers[_0x31a196[_0x7fe5('0x49')]][_0x7fe5('0x36')]=utils[_0x7fe5('0x1e')]();transfers[_0x31a196[_0x7fe5('0x49')]][_0x7fe5('0x2b')]=0x0;transfers[_0x31a196['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x31a196[_0x7fe5('0x45')]==_0x31a196[_0x7fe5('0x4d')]){if(!_[_0x7fe5('0x1a')](agents[_0x31a196[_0x7fe5('0x43')]])){utils[_0x7fe5('0x2')](util['format'](_0x7fe5('0x46'),_0x31a196[_0x7fe5('0x43')],agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x8')]));agents[_0x31a196[_0x7fe5('0x43')]]['transfer']=!![];agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x3c')]=_0x7fe5('0x47');agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x3e')]=_0x31a196[_0x7fe5('0x4e')];agents[_0x31a196[_0x7fe5('0x43')]]['transferuniqueid']=_0x31a196[_0x7fe5('0x45')];}if(_0x31a196[_0x7fe5('0x4f')]&&agents[_0x31a196[_0x7fe5('0x4f')]]){agents[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x4a')]=0x1;transfers[_0x31a196[_0x7fe5('0x4f')]]=_[_0x7fe5('0x4b')](agents[_0x31a196['transfertargetuniqueid']]);transfers[_0x31a196['transfertargetuniqueid']][_0x7fe5('0xa')]=agents[_0x31a196['origtransfereruniqueid']][_0x7fe5('0xa')];transfers[_0x31a196['transfertargetuniqueid']][_0x7fe5('0x4c')]=agents[_0x31a196[_0x7fe5('0x43')]][_0x7fe5('0x4c')];transfers[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x15')]=utils[_0x7fe5('0x1e')]();transfers[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x36')]=utils['now']();transfers[_0x31a196[_0x7fe5('0x4f')]]['holdtime']=0x0;transfers[_0x31a196[_0x7fe5('0x4f')]][_0x7fe5('0x4a')]=0x2;}}}catch(_0x36ac40){utils['error'](util[_0x7fe5('0x3')](_0x7fe5('0x42'),_0x31a196[_0x7fe5('0x43')]),_0x36ac40);}};exports[_0x7fe5('0x50')]=function(_0x31404b){try{utils[_0x7fe5('0x1b')](util['format'](_0x7fe5('0x51'),_0x31404b[_0x7fe5('0x5')]),_0x31404b);if(agents[_0x31404b['uniqueid']]&&agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')]==='timeout'){if(_0x31404b[_0x7fe5('0x52')]==='21'){agents[_0x31404b['uniqueid']][_0x7fe5('0x20')]=_0x7fe5('0x53');agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xc')]=_0x7fe5('0x53');}utils['info'](util[_0x7fe5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31404b[_0x7fe5('0x5')],agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x8')],agents[_0x31404b[_0x7fe5('0x5')]]['reason'],agents[_0x31404b[_0x7fe5('0x5')]]['lastevent']));writeDB(agents[_0x31404b[_0x7fe5('0x5')]]);var _0x2e3b94=unanswered['indexOf'](_0x31404b[_0x7fe5('0x5')]);if(_0x2e3b94>-0x1){unanswered[_0x7fe5('0x54')](_0x2e3b94,0x1);}}if(transfers[_0x31404b['uniqueid']]){transfers[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xe')]=!![];transfers[_0x31404b[_0x7fe5('0x5')]]['agentcompleteAt']=utils[_0x7fe5('0x1e')]();transfers[_0x31404b[_0x7fe5('0x5')]]['talktime']=utils[_0x7fe5('0x35')](transfers[_0x31404b[_0x7fe5('0x5')]]['agentcompleteAt'],transfers[_0x31404b[_0x7fe5('0x5')]]['agentconnectAt']);transfers[_0x31404b['uniqueid']][_0x7fe5('0x20')]=_0x7fe5('0x55');transfers[_0x31404b['uniqueid']]['lastevent']=_0x7fe5('0x37');utils['info'](util[_0x7fe5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31404b[_0x7fe5('0x5')],transfers[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x8')],transfers[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')],transfers[_0x31404b['uniqueid']][_0x7fe5('0xc')]));writeDB(transfers[_0x31404b[_0x7fe5('0x5')]],!![]);}if(agents[_0x31404b[_0x7fe5('0x5')]]&&agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x36')]){agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xe')]=!![];agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x34')]=utils[_0x7fe5('0x1e')]();agents[_0x31404b['uniqueid']][_0x7fe5('0x22')]=utils[_0x7fe5('0x35')](agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x34')],agents[_0x31404b[_0x7fe5('0x5')]]['agentconnectAt']);agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')]=agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x3b')]?_0x7fe5('0x3b'):_0x7fe5('0x55');agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0xc')]=_0x7fe5('0x37');utils[_0x7fe5('0x2')](util[_0x7fe5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x31404b[_0x7fe5('0x5')],agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x8')],agents[_0x31404b[_0x7fe5('0x5')]][_0x7fe5('0x20')],agents[_0x31404b['uniqueid']][_0x7fe5('0xc')]));writeDB(agents[_0x31404b[_0x7fe5('0x5')]]);}}catch(_0x226ada){utils['error'](util['format']('[%s][agents][hangup]',_0x31404b[_0x7fe5('0x5')]),_0x226ada);}}; \ No newline at end of file +var _0x750a=['interface','calleridnum','connectedlinenum','lastevent','then','type','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agentconnectAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0x750a,0x140));var _0xa750=function(_0x4d75b8,_0x1cf0e0){_0x4d75b8=_0x4d75b8-0x0;var _0x485e55=_0x750a[_0x4d75b8];return _0x485e55;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x499583,_0x139fa5){utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x3'),_0x499583[_0xa750('0x4')],_0x499583[_0xa750('0x5')],_0x499583[_0xa750('0x6')],_0x499583[_0xa750('0x7')],_0x499583[_0xa750('0x8')],_0x499583[_0xa750('0x9')],_0x499583[_0xa750('0xa')],_0x499583[_0xa750('0xb')]));if(_0x499583[_0xa750('0x6')]){utils['getVoiceQueueByName'](_0x499583['queue'])[_0xa750('0xc')](function(_0x5b684e){if(_0x5b684e){_0x499583[_0xa750('0xd')]=_0x5b684e[_0xa750('0xd')];_0x499583['agentacw']=_0x499583[_0xa750('0xe')]?_0x5b684e[_0xa750('0xf')]:![];_0x499583['acwtime']=_0x499583['agentacw']?_0x5b684e[_0xa750('0x10')]:0x0;}utils['request'](_0xa750('0x11'),_0x499583);});}else{utils[_0xa750('0x12')]('CreateVoiceAgentReport',_0x499583);}if(_0x139fa5){delete transfers[_0x499583[_0xa750('0x4')]];}else{delete agents[_0x499583[_0xa750('0x13')]];}}exports[_0xa750('0x14')]=function(_0x567c51){try{utils[_0xa750('0x15')](util[_0xa750('0x2')](_0xa750('0x16'),_0x567c51[_0xa750('0x4')]),_0x567c51);agents[_0x567c51[_0xa750('0x13')]]=_0x567c51;agents[_0x567c51[_0xa750('0x13')]]['agentcalledAt']=utils[_0xa750('0x17')]();agents[_0x567c51[_0xa750('0x13')]][_0xa750('0xb')]='called';agents[_0x567c51[_0xa750('0x13')]][_0xa750('0xa')]=null;agents[_0x567c51['destuniqueid']]['connectedlinename']=null;utils[_0xa750('0x1')](util['format'](_0xa750('0x18'),_0x567c51[_0xa750('0x4')],agents[_0x567c51['destuniqueid']][_0xa750('0x7')],_0x567c51['destuniqueid']));}catch(_0x5f28f4){utils[_0xa750('0x19')](util['format'](_0xa750('0x16'),_0x567c51['uniqueid']),_0x5f28f4);}};exports[_0xa750('0x1a')]=function(_0x4a007d){try{if(!_[_0xa750('0x1b')](agents[_0x4a007d['destuniqueid']])){utils[_0xa750('0x15')](util['format']('[%s][agents][agentringnoanswer]',_0x4a007d[_0xa750('0x4')]),_0x4a007d);utils['info'](util[_0xa750('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x4a007d['uniqueid'],agents[_0x4a007d['destuniqueid']]['membername'],_0x4a007d[_0xa750('0x13')]));agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1a')]=!![];agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1c')]=utils[_0xa750('0x17')]();agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0xb')]=_0xa750('0x1d');agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1e')]=_0xa750('0x1d');agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1f')]=_0x4a007d[_0xa750('0x20')]?parseInt(_0x4a007d['ringtime'])/0x3e8:0x0;agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x21')]=0x0;unanswered[_0xa750('0x22')](_0x4a007d['destuniqueid']);}}catch(_0x35ab53){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x23'),_0x4a007d['uniqueid']),_0x35ab53);}};exports[_0xa750('0x24')]=function(_0x34d5e9){try{_[_0xa750('0x25')](agents,function(_0x2aef3a,_0x2c5253){if(_0x2aef3a['uniqueid']==_0x34d5e9[_0xa750('0x4')]&&!_['includes'](unanswered,_0x2aef3a[_0xa750('0x13')])){utils[_0xa750('0x15')](util['format'](_0xa750('0x26'),_0x34d5e9[_0xa750('0x4')]),_0x34d5e9);utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x27'),_0x34d5e9[_0xa750('0x4')],_0x2aef3a[_0xa750('0x7')],_0x2aef3a[_0xa750('0x13')]));_0x2aef3a['agentringnoanswer']=!![];_0x2aef3a[_0xa750('0x1c')]=utils['now']();_0x2aef3a[_0xa750('0xb')]=_0xa750('0x28');_0x2aef3a[_0xa750('0x1e')]=_0xa750('0x28');_0x2aef3a['holdtime']=_0x34d5e9[_0xa750('0x1f')];_0x2aef3a[_0xa750('0x21')]=0x0;writeDB(_0x2aef3a);}});}catch(_0x5c2e02){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x26'),_0x34d5e9[_0xa750('0x4')]),_0x5c2e02);}};exports['agentconnect']=function(_0xf60128){try{if(agents[_0xf60128['destuniqueid']]){utils['debug'](util[_0xa750('0x2')](_0xa750('0x29'),_0xf60128[_0xa750('0x4')]),_0xf60128);utils['info'](util[_0xa750('0x2')](_0xa750('0x2a'),_0xf60128[_0xa750('0x4')],agents[_0xf60128['destuniqueid']][_0xa750('0x7')],_0xf60128[_0xa750('0x13')]));agents[_0xf60128[_0xa750('0x13')]]['agentconnectAt']=utils[_0xa750('0x17')]();agents[_0xf60128[_0xa750('0x13')]][_0xa750('0xa')]=_0xf60128['connectedlinenum'];agents[_0xf60128[_0xa750('0x13')]][_0xa750('0x2b')]=_0xf60128[_0xa750('0x2b')];agents[_0xf60128[_0xa750('0x13')]]['holdtime']=_0xf60128['ringtime'];agents[_0xf60128[_0xa750('0x13')]][_0xa750('0xb')]='connect';_[_0xa750('0x25')](agents,function(_0x2f57e9,_0x15d35a){if(_0x2f57e9[_0xa750('0x13')]!=_0xf60128[_0xa750('0x13')]&&_0x2f57e9['uniqueid']==_0xf60128[_0xa750('0x4')]){_0x2f57e9[_0xa750('0x21')]=0x0;_0x2f57e9[_0xa750('0x1f')]=_0xf60128[_0xa750('0x20')];_0x2f57e9[_0xa750('0x1a')]=!![];_0x2f57e9[_0xa750('0x1c')]=utils[_0xa750('0x17')]();_0x2f57e9['lastevent']=_0xa750('0x2c');_0x2f57e9['reason']=_0xa750('0x2c');_0x2f57e9['answeredelsewheredestinationuniqueid']=_0xf60128[_0xa750('0x13')];_0x2f57e9[_0xa750('0x2d')]=_0xf60128[_0xa750('0x7')];writeDB(_0x2f57e9);}});}}catch(_0x1be24e){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x29'),_0xf60128[_0xa750('0x4')]),_0x1be24e);}};exports[_0xa750('0xe')]=function(_0x108a1a){try{if(!_[_0xa750('0x1b')](agents[_0x108a1a[_0xa750('0x13')]])){utils[_0xa750('0x15')](util[_0xa750('0x2')](_0xa750('0x2e'),_0x108a1a[_0xa750('0x4')]),_0x108a1a);utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x2f'),_0x108a1a[_0xa750('0x4')],agents[_0x108a1a['destuniqueid']][_0xa750('0x7')],_0x108a1a[_0xa750('0x13')]));agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0xe')]=!![];agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x30')]=utils[_0xa750('0x17')]();agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x21')]=utils['diffTime'](agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x30')],agents[_0x108a1a['destuniqueid']][_0xa750('0x31')]);agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x1e')]=_0x108a1a[_0xa750('0x1e')];agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0xb')]=_0xa750('0x32');writeDB(agents[_0x108a1a[_0xa750('0x13')]]);}}catch(_0x3faf01){utils[_0xa750('0x19')](util['format'](_0xa750('0x2e'),_0x108a1a[_0xa750('0x4')]),_0x3faf01);}};exports['blindtransfer']=function(_0x93e49f){try{if(!_[_0xa750('0x1b')](agents[_0x93e49f[_0xa750('0x33')]])){utils['debug'](util[_0xa750('0x2')](_0xa750('0x34'),_0x93e49f[_0xa750('0x4')]),_0x93e49f);utils[_0xa750('0x1')](util['format'](_0xa750('0x35'),_0x93e49f[_0xa750('0x4')],agents[_0x93e49f[_0xa750('0x33')]][_0xa750('0x7')],agents[_0x93e49f['transfereruniqueid']][_0xa750('0x4')]));agents[_0x93e49f[_0xa750('0x33')]]['transfer']=!![];agents[_0x93e49f[_0xa750('0x33')]]['transfertype']=_0xa750('0x36');agents[_0x93e49f[_0xa750('0x33')]]['transferexten']=_0x93e49f['extension'];agents[_0x93e49f['transfereruniqueid']][_0xa750('0x37')]=agents[_0x93e49f[_0xa750('0x33')]]['uniqueid'];}}catch(_0xe88dc){utils[_0xa750('0x19')](util[_0xa750('0x2')]('[%s][agents][blindtransfer]',_0x93e49f['uniqueid']),_0xe88dc);}};exports['attendedtransfer']=function(_0x5d8dd2){try{utils[_0xa750('0x15')](util['format'](_0xa750('0x38'),_0x5d8dd2[_0xa750('0x39')]),_0x5d8dd2);if(_0x5d8dd2['origtransfereruniqueid']==_0x5d8dd2[_0xa750('0x3a')]){if(!_['isNil'](agents[_0x5d8dd2[_0xa750('0x3b')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x5d8dd2['origtransfereruniqueid'],agents[_0x5d8dd2[_0xa750('0x3b')]][_0xa750('0x7')]));agents[_0x5d8dd2['secondtransfereruniqueid']]['transfer']=!![];agents[_0x5d8dd2['secondtransfereruniqueid']][_0xa750('0x3c')]=_0xa750('0x3d');agents[_0x5d8dd2[_0xa750('0x3b')]][_0xa750('0x3e')]=_0x5d8dd2[_0xa750('0x3f')];agents[_0x5d8dd2[_0xa750('0x3b')]]['transferuniqueid']=_0x5d8dd2['origtransfereruniqueid'];}if(_0x5d8dd2[_0xa750('0x40')]&&agents[_0x5d8dd2[_0xa750('0x40')]]){agents[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x41')]=0x1;transfers[_0x5d8dd2[_0xa750('0x40')]]=_['clone'](agents[_0x5d8dd2[_0xa750('0x40')]]);transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x9')]=agents[_0x5d8dd2[_0xa750('0x3b')]][_0xa750('0x9')];transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x42')]=agents[_0x5d8dd2[_0xa750('0x3b')]]['calleridname'];transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x43')]=utils[_0xa750('0x17')]();transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x31')]=utils['now']();transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x1f')]=0x0;transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x41')]=0x2;}}else if(_0x5d8dd2[_0xa750('0x3b')]==_0x5d8dd2[_0xa750('0x44')]){if(!_[_0xa750('0x1b')](agents[_0x5d8dd2[_0xa750('0x39')]])){utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x45'),_0x5d8dd2[_0xa750('0x39')],agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x7')]));agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x46')]=!![];agents[_0x5d8dd2['origtransfereruniqueid']][_0xa750('0x3c')]='ATTENDED';agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x3e')]=_0x5d8dd2[_0xa750('0x47')];agents[_0x5d8dd2['origtransfereruniqueid']][_0xa750('0x37')]=_0x5d8dd2[_0xa750('0x3b')];}if(_0x5d8dd2[_0xa750('0x48')]&&agents[_0x5d8dd2[_0xa750('0x48')]]){agents[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x41')]=0x1;transfers[_0x5d8dd2['transfertargetuniqueid']]=_[_0xa750('0x49')](agents[_0x5d8dd2[_0xa750('0x48')]]);transfers[_0x5d8dd2['transfertargetuniqueid']][_0xa750('0x9')]=agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x9')];transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x42')]=agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x42')];transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x43')]=utils[_0xa750('0x17')]();transfers[_0x5d8dd2[_0xa750('0x48')]]['agentconnectAt']=utils['now']();transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x1f')]=0x0;transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x41')]=0x2;}}}catch(_0x5e17a0){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x38'),_0x5d8dd2[_0xa750('0x39')]),_0x5e17a0);}};exports[_0xa750('0x4a')]=function(_0x473188){try{utils[_0xa750('0x15')](util[_0xa750('0x2')](_0xa750('0x4b'),_0x473188[_0xa750('0x4')]),_0x473188);if(agents[_0x473188[_0xa750('0x4')]]&&agents[_0x473188['uniqueid']]['reason']===_0xa750('0x1d')){if(_0x473188['cause']==='21'){agents[_0x473188['uniqueid']][_0xa750('0x1e')]=_0xa750('0x4c');agents[_0x473188[_0xa750('0x4')]][_0xa750('0xb')]=_0xa750('0x4c');}utils['info'](util[_0xa750('0x2')](_0xa750('0x4d'),_0x473188[_0xa750('0x4')],agents[_0x473188[_0xa750('0x4')]][_0xa750('0x7')],agents[_0x473188[_0xa750('0x4')]]['reason'],agents[_0x473188['uniqueid']][_0xa750('0xb')]));writeDB(agents[_0x473188[_0xa750('0x4')]]);var _0x30a371=unanswered[_0xa750('0x4e')](_0x473188[_0xa750('0x4')]);if(_0x30a371>-0x1){unanswered[_0xa750('0x4f')](_0x30a371,0x1);}}if(transfers[_0x473188[_0xa750('0x4')]]){transfers[_0x473188[_0xa750('0x4')]]['agentcomplete']=!![];transfers[_0x473188[_0xa750('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x473188[_0xa750('0x4')]][_0xa750('0x21')]=utils[_0xa750('0x50')](transfers[_0x473188[_0xa750('0x4')]]['agentcompleteAt'],transfers[_0x473188[_0xa750('0x4')]][_0xa750('0x31')]);transfers[_0x473188[_0xa750('0x4')]][_0xa750('0x1e')]='agent';transfers[_0x473188[_0xa750('0x4')]][_0xa750('0xb')]=_0xa750('0x32');utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x4d'),_0x473188[_0xa750('0x4')],transfers[_0x473188[_0xa750('0x4')]]['membername'],transfers[_0x473188['uniqueid']][_0xa750('0x1e')],transfers[_0x473188['uniqueid']][_0xa750('0xb')]));writeDB(transfers[_0x473188[_0xa750('0x4')]],!![]);}if(agents[_0x473188['uniqueid']]&&agents[_0x473188[_0xa750('0x4')]]['agentconnectAt']){agents[_0x473188[_0xa750('0x4')]][_0xa750('0xe')]=!![];agents[_0x473188[_0xa750('0x4')]]['agentcompleteAt']=utils[_0xa750('0x17')]();agents[_0x473188[_0xa750('0x4')]][_0xa750('0x21')]=utils[_0xa750('0x50')](agents[_0x473188['uniqueid']]['agentcompleteAt'],agents[_0x473188['uniqueid']][_0xa750('0x31')]);agents[_0x473188[_0xa750('0x4')]]['reason']=agents[_0x473188[_0xa750('0x4')]][_0xa750('0x46')]?_0xa750('0x46'):_0xa750('0x51');agents[_0x473188[_0xa750('0x4')]][_0xa750('0xb')]='complete';utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x4d'),_0x473188['uniqueid'],agents[_0x473188[_0xa750('0x4')]][_0xa750('0x7')],agents[_0x473188[_0xa750('0x4')]][_0xa750('0x1e')],agents[_0x473188['uniqueid']][_0xa750('0xb')]));writeDB(agents[_0x473188[_0xa750('0x4')]]);}}catch(_0x32b8e7){utils['error'](util[_0xa750('0x2')]('[%s][agents][hangup]',_0x473188[_0xa750('0x4')]),_0x32b8e7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 1cd286e..792264b 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 _0x0d0d=['channel','calleridnum','connectedlinenum','accountcode','then','UserId','request','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','lastIndexOf','noop','execif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid'];(function(_0x5ee8a9,_0x3a6a23){var _0x343eaa=function(_0x4689f3){while(--_0x4689f3){_0x5ee8a9['push'](_0x5ee8a9['shift']());}};_0x343eaa(++_0x3a6a23);}(_0x0d0d,0xc4));var _0xd0d0=function(_0x3fa150,_0xcb6f91){_0x3fa150=_0x3fa150-0x0;var _0x4fdf41=_0x0d0d[_0x3fa150];return _0x4fdf41;};'use strict';var _=require(_0xd0d0('0x0'));var util=require(_0xd0d0('0x1'));var utils=require(_0xd0d0('0x2'));var dispositions=[_0xd0d0('0x3'),'FAILED',_0xd0d0('0x4'),_0xd0d0('0x3'),_0xd0d0('0x3'),_0xd0d0('0x3'),_0xd0d0('0x5'),_0xd0d0('0x6'),'FAILED','FAILED',_0xd0d0('0x4')];var channels={};function writeDB(_0x5218b4){utils['info'](util[_0xd0d0('0x7')](_0xd0d0('0x8'),_0x5218b4[_0xd0d0('0x9')],_0x5218b4[_0xd0d0('0xa')],_0x5218b4['queue'],_0x5218b4['membername'],_0x5218b4['interface'],_0x5218b4[_0xd0d0('0xb')],_0x5218b4[_0xd0d0('0xc')],_0x5218b4['lastevent']));if(_0x5218b4[_0xd0d0('0xd')]){utils['getUserByInternal'](_0x5218b4[_0xd0d0('0xd')])[_0xd0d0('0xe')](function(_0x4d9a6e){if(_0x4d9a6e){_0x5218b4[_0xd0d0('0xf')]=_0x4d9a6e['id'];}utils[_0xd0d0('0x10')]('CreateVoiceCallReport',_0x5218b4);});}else{utils[_0xd0d0('0x10')]('CreateVoiceCallReport',_0x5218b4);}if(channels[_0x5218b4[_0xd0d0('0x9')]]){delete channels[_0x5218b4[_0xd0d0('0x9')]];}}exports[_0xd0d0('0x11')]=function(_0x5a7c20){try{utils[_0xd0d0('0x12')](util['format'](_0xd0d0('0x13'),_0x5a7c20[_0xd0d0('0x9')]),_0x5a7c20);if(_0x5a7c20[_0xd0d0('0x9')]==_0x5a7c20['linkedid']&&_0x5a7c20['channel']!=_0xd0d0('0x14')){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x16'),_0x5a7c20[_0xd0d0('0x9')],_0x5a7c20[_0xd0d0('0x17')],_0x5a7c20['exten']));channels[_0x5a7c20['uniqueid']]={'uniqueid':_0x5a7c20[_0xd0d0('0x9')],'accountcode':_0x5a7c20[_0xd0d0('0xd')],'source':_0x5a7c20[_0xd0d0('0xb')],'destination':_0x5a7c20[_0xd0d0('0x18')],'destinationcontext':_0x5a7c20[_0xd0d0('0x17')],'channel':_0x5a7c20[_0xd0d0('0xa')],'starttime':utils[_0xd0d0('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd0d0('0x3'),'amaflags':_0xd0d0('0x1a')};}}catch(_0x1d84d2){utils['error'](util['format'](_0xd0d0('0x13'),_0x5a7c20[_0xd0d0('0x9')]),_0x1d84d2);}};exports[_0xd0d0('0x1b')]=function(_0x8fd61d){try{utils[_0xd0d0('0x12')](util['format'](_0xd0d0('0x1c'),_0x8fd61d[_0xd0d0('0x9')]),_0x8fd61d);if(!_[_0xd0d0('0x1d')](channels[_0x8fd61d['uniqueid']])&&_0x8fd61d[_0xd0d0('0x1e')]==0x6){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x8fd61d[_0xd0d0('0x9')],_0x8fd61d[_0xd0d0('0x17')],_0x8fd61d[_0xd0d0('0xa')]));if(_['isNil'](channels[_0x8fd61d[_0xd0d0('0x9')]][_0xd0d0('0x1f')])){channels[_0x8fd61d[_0xd0d0('0x9')]][_0xd0d0('0x1f')]=utils['now']();}}else if(!_[_0xd0d0('0x1d')](channels[_0x8fd61d['linkedid']])&&_0x8fd61d['channelstate']==0x6&&_0x8fd61d['context']!=_0xd0d0('0x20')){utils[_0xd0d0('0x15')](util['format'](_0xd0d0('0x21'),_0x8fd61d['uniqueid'],_0x8fd61d['linkedid'],_0x8fd61d['context'],_0x8fd61d[_0xd0d0('0xa')]));channels[_0x8fd61d[_0xd0d0('0x22')]][_0xd0d0('0xd')]=_0x8fd61d[_0xd0d0('0xd')];channels[_0x8fd61d['linkedid']]['destinationchannel']=_0x8fd61d[_0xd0d0('0xa')];if(_[_0xd0d0('0x1d')](channels[_0x8fd61d[_0xd0d0('0x22')]][_0xd0d0('0x23')])){channels[_0x8fd61d[_0xd0d0('0x22')]]['answertime']=utils[_0xd0d0('0x19')]();}channels[_0x8fd61d[_0xd0d0('0x22')]][_0xd0d0('0x24')]=dispositions[_[_0xd0d0('0x25')](_0x8fd61d[_0xd0d0('0x1e')])]||_0xd0d0('0x5');}}catch(_0x4805ec){utils[_0xd0d0('0x26')](util['format'](_0xd0d0('0x1c'),_0x8fd61d['uniqueid']),_0x4805ec);}};exports[_0xd0d0('0x27')]=function(_0x500c5f){try{if(!_['isNil'](channels[_0x500c5f[_0xd0d0('0x9')]])){utils[_0xd0d0('0x12')](util[_0xd0d0('0x7')](_0xd0d0('0x28'),_0x500c5f[_0xd0d0('0x9')]),_0x500c5f);if(_[_0xd0d0('0x1d')](channels[_0x500c5f[_0xd0d0('0x9')]][_0xd0d0('0x29')])){channels[_0x500c5f[_0xd0d0('0x9')]]['callerid']=_0x500c5f[_0xd0d0('0x2a')]+'\x20<'+_0x500c5f[_0xd0d0('0xb')]+'>';}utils['info'](util[_0xd0d0('0x7')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x500c5f[_0xd0d0('0x9')],channels[_0x500c5f['uniqueid']][_0xd0d0('0x29')],_0x500c5f['cause-txt']));channels[_0x500c5f[_0xd0d0('0x9')]][_0xd0d0('0x2b')]=utils[_0xd0d0('0x19')]();channels[_0x500c5f[_0xd0d0('0x9')]][_0xd0d0('0x2c')]=utils['diffTime'](channels[_0x500c5f[_0xd0d0('0x9')]][_0xd0d0('0x2b')],channels[_0x500c5f[_0xd0d0('0x9')]]['starttime']);channels[_0x500c5f[_0xd0d0('0x9')]]['billableseconds']=channels[_0x500c5f[_0xd0d0('0x9')]][_0xd0d0('0x23')]?utils[_0xd0d0('0x2d')](channels[_0x500c5f['uniqueid']]['endtime'],channels[_0x500c5f['uniqueid']][_0xd0d0('0x23')]):0x0;writeDB(channels[_0x500c5f[_0xd0d0('0x9')]]);}}catch(_0x1f2739){utils[_0xd0d0('0x26')](util['format'](_0xd0d0('0x28'),_0x500c5f['uniqueid']),_0x1f2739);}};exports[_0xd0d0('0x2e')]=function(_0x342a58){try{if(!_[_0xd0d0('0x1d')](channels[_0x342a58[_0xd0d0('0x2f')]])){utils[_0xd0d0('0x12')](util[_0xd0d0('0x7')](_0xd0d0('0x30'),_0x342a58[_0xd0d0('0x31')]),_0x342a58);if(channels[_0x342a58[_0xd0d0('0x2f')]][_0xd0d0('0xa')]==_0x342a58[_0xd0d0('0x32')]){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x33'),_0x342a58[_0xd0d0('0x31')],_0x342a58[_0xd0d0('0x2f')],_0x342a58[_0xd0d0('0x34')]));channels[_0x342a58[_0xd0d0('0x2f')]][_0xd0d0('0x35')]=_0x342a58[_0xd0d0('0x34')];channels[_0x342a58[_0xd0d0('0x2f')]][_0xd0d0('0x36')]=_0xd0d0('0x37');}else if(channels[_0x342a58['localtwolinkedid']][_0xd0d0('0xa')]=_0x342a58[_0xd0d0('0x38')]){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x33'),_0x342a58[_0xd0d0('0x31')],_0x342a58[_0xd0d0('0x2f')],_0x342a58[_0xd0d0('0x39')]));channels[_0x342a58[_0xd0d0('0x2f')]][_0xd0d0('0x35')]=_0x342a58[_0xd0d0('0x39')];channels[_0x342a58[_0xd0d0('0x2f')]][_0xd0d0('0x36')]=_0xd0d0('0x37');}}}catch(_0x5cafad){utils[_0xd0d0('0x26')](util[_0xd0d0('0x7')](_0xd0d0('0x30'),_0x342a58['origtransfereruniqueid']),_0x5cafad);}};exports[_0xd0d0('0x3a')]=function(_0x265796){try{if(!_[_0xd0d0('0x1d')](channels[_0x265796[_0xd0d0('0x9')]])){utils['debug'](util['format']('[%s][calls][musiconholdstart]',_0x265796[_0xd0d0('0x9')]),_0x265796);channels[_0x265796[_0xd0d0('0x9')]][_0xd0d0('0x3b')]=utils['now']();utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x265796[_0xd0d0('0x9')],channels[_0x265796[_0xd0d0('0x9')]][_0xd0d0('0x3b')]));}}catch(_0x502009){utils[_0xd0d0('0x26')](util['format'](_0xd0d0('0x3c'),_0x265796[_0xd0d0('0x9')]),_0x502009);}};exports[_0xd0d0('0x3d')]=function(_0x33892e){try{if(!_[_0xd0d0('0x1d')](channels[_0x33892e[_0xd0d0('0x9')]])){utils[_0xd0d0('0x12')](util[_0xd0d0('0x7')]('[%s][calls][musiconholdstop]',_0x33892e[_0xd0d0('0x9')]),_0x33892e);if(!_['isNil'](channels[_0x33892e[_0xd0d0('0x9')]][_0xd0d0('0x3b')])){channels[_0x33892e[_0xd0d0('0x9')]][_0xd0d0('0x3e')]+=utils[_0xd0d0('0x2d')](utils['now'](),channels[_0x33892e[_0xd0d0('0x9')]][_0xd0d0('0x3b')]);utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x3f'),_0x33892e[_0xd0d0('0x9')],channels[_0x33892e[_0xd0d0('0x9')]][_0xd0d0('0x3e')]));delete channels[_0x33892e[_0xd0d0('0x9')]][_0xd0d0('0x3b')];}}}catch(_0x5e9174){utils[_0xd0d0('0x26')](util[_0xd0d0('0x7')](_0xd0d0('0x40'),_0x33892e[_0xd0d0('0x9')]),_0x5e9174);}};exports['varset']=function(_0x41fe80){try{if(!_[_0xd0d0('0x1d')](channels[_0x41fe80[_0xd0d0('0x9')]])){utils[_0xd0d0('0x12')](util[_0xd0d0('0x7')](_0xd0d0('0x41'),_0x41fe80[_0xd0d0('0x9')]),_0x41fe80);if(!_['isNil'](_0x41fe80['variable'][_0xd0d0('0x42')])){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x43'),_0x41fe80[_0xd0d0('0x9')],_0x41fe80[_0xd0d0('0x44')]));channels[_0x41fe80['uniqueid']][_0xd0d0('0x45')]=_0x41fe80[_0xd0d0('0x44')];}if(!_['isNil'](_0x41fe80[_0xd0d0('0x46')]['xmd-phone'])){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x47'),_0x41fe80['uniqueid'],_0x41fe80[_0xd0d0('0x44')]));channels[_0x41fe80[_0xd0d0('0x9')]]['destination']=_0x41fe80[_0xd0d0('0x44')];channels[_0x41fe80[_0xd0d0('0x9')]]['callerid']='\x22'+_0x41fe80[_0xd0d0('0x44')]+_0xd0d0('0x48')+_0x41fe80[_0xd0d0('0x44')]+'>';}if(!_[_0xd0d0('0x1d')](_0x41fe80['variable'][_0xd0d0('0x49')])||!_['isNil'](_0x41fe80[_0xd0d0('0x46')][_0xd0d0('0x4a')])){utils[_0xd0d0('0x15')](util['format'](_0xd0d0('0x4b'),_0x41fe80[_0xd0d0('0x9')],!_['isNil'](_0x41fe80[_0xd0d0('0x46')][_0xd0d0('0x49')])?_0xd0d0('0x49'):_0xd0d0('0x4a'),_0x41fe80['value']));channels[_0x41fe80[_0xd0d0('0x9')]]['callerid']=_0x41fe80[_0xd0d0('0x44')];}if(!_['isNil'](_0x41fe80[_0xd0d0('0x46')][_0xd0d0('0x4c')])||!_['isNil'](_0x41fe80['variable'][_0xd0d0('0x4d')])){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x4b'),_0x41fe80[_0xd0d0('0x9')],!_[_0xd0d0('0x1d')](_0x41fe80[_0xd0d0('0x46')][_0xd0d0('0x4c')])?'xmd-queue':_0xd0d0('0x4d'),_0x41fe80[_0xd0d0('0x44')]));channels[_0x41fe80[_0xd0d0('0x9')]][_0xd0d0('0x4e')]=_0xd0d0('0x4f');channels[_0x41fe80[_0xd0d0('0x9')]]['lastdata']=_0x41fe80[_0xd0d0('0x44')];channels[_0x41fe80[_0xd0d0('0x9')]][_0xd0d0('0x50')]=!![];}if(!_[_0xd0d0('0x1d')](_0x41fe80[_0xd0d0('0x46')]['xmd-contactid'])){utils[_0xd0d0('0x15')](util[_0xd0d0('0x7')](_0xd0d0('0x51'),_0x41fe80[_0xd0d0('0x9')],_0x41fe80['value']));channels[_0x41fe80['uniqueid']][_0xd0d0('0x52')]=_0x41fe80[_0xd0d0('0x44')];}if(!_[_0xd0d0('0x1d')](_0x41fe80['variable'][_0xd0d0('0x53')])){utils['info'](util[_0xd0d0('0x7')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x41fe80[_0xd0d0('0x9')],_0x41fe80[_0xd0d0('0x44')]));channels[_0x41fe80[_0xd0d0('0x9')]][_0xd0d0('0x54')]=_0x41fe80[_0xd0d0('0x44')];}if(!_['isNil'](_0x41fe80[_0xd0d0('0x46')][_0xd0d0('0x55')])){utils[_0xd0d0('0x15')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x41fe80[_0xd0d0('0x9')],_0x41fe80[_0xd0d0('0x44')]));channels[_0x41fe80[_0xd0d0('0x9')]][_0xd0d0('0x56')]=_0x41fe80[_0xd0d0('0x44')];}if(!_[_0xd0d0('0x1d')](_0x41fe80[_0xd0d0('0x46')]['sipcallid'])){utils[_0xd0d0('0x15')](util['format'](_0xd0d0('0x57'),_0x41fe80['uniqueid'],_0x41fe80[_0xd0d0('0x44')]));channels[_0x41fe80[_0xd0d0('0x9')]][_0xd0d0('0x58')]=_0x41fe80[_0xd0d0('0x44')];}}}catch(_0x452658){utils[_0xd0d0('0x26')](util[_0xd0d0('0x7')]('[%s][calls][varset]',_0x41fe80[_0xd0d0('0x9')]),_0x452658);}};exports[_0xd0d0('0x59')]=function(_0xf0a83){try{if(!_[_0xd0d0('0x1d')](channels[_0xf0a83[_0xd0d0('0x9')]])){utils['debug'](util[_0xd0d0('0x7')](_0xd0d0('0x5a'),_0xf0a83[_0xd0d0('0x9')]),_0xf0a83);utils['info'](util['format'](_0xd0d0('0x5b'),_0xf0a83[_0xd0d0('0x9')],_0xf0a83[_0xd0d0('0x5c')],_0xf0a83[_0xd0d0('0x5d')]));if(_0xf0a83[_0xd0d0('0x5c')]['toLowerCase']()==_0xd0d0('0x5e')&&_[_0xd0d0('0x5f')](_0xf0a83['appdata'][_0xd0d0('0x60')](),_0xd0d0('0x61'))){var _0x4f7d2e=_0xf0a83[_0xd0d0('0x5d')][_0xd0d0('0x62')]('=');var _0x3aafc5=_0x4f7d2e[0x0]['substring'](_0x4f7d2e[0x0]['lastIndexOf']('(')+0x1,_0x4f7d2e[0x0][_0xd0d0('0x63')](')'));var _0x45f5c6=_0x4f7d2e[0x1];channels[_0xf0a83[_0xd0d0('0x9')]][_0x3aafc5]=_0x45f5c6;}if(!_['includes'](['hangup',_0xd0d0('0x64'),_0xd0d0('0x65'),'set','gotoif'],_0xf0a83[_0xd0d0('0x5c')][_0xd0d0('0x60')]())){channels[_0xf0a83['uniqueid']][_0xd0d0('0x4e')]=_0xf0a83[_0xd0d0('0x5c')];channels[_0xf0a83[_0xd0d0('0x9')]][_0xd0d0('0x66')]=_0xf0a83['appdata'];}}}catch(_0x537fcd){utils[_0xd0d0('0x26')](util['format']('[%s][calls][newexten]',_0xf0a83['uniqueid']),_0x537fcd);}}; \ No newline at end of file +var _0x0afd=['destinationchannel','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','diffTime','starttime','billableseconds','answertime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','execif','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','interface','calleridnum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','channel','context','exten','DOCUMENTATION','error','debug','channelstate','systemanswertime','now','isNil','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s'];(function(_0x2455e4,_0x3c81a8){var _0x316e40=function(_0x165c01){while(--_0x165c01){_0x2455e4['push'](_0x2455e4['shift']());}};_0x316e40(++_0x3c81a8);}(_0x0afd,0xac));var _0xd0af=function(_0x5c6109,_0x4ec78a){_0x5c6109=_0x5c6109-0x0;var _0xeaeaa2=_0x0afd[_0x5c6109];return _0xeaeaa2;};'use strict';var _=require(_0xd0af('0x0'));var util=require(_0xd0af('0x1'));var utils=require(_0xd0af('0x2'));var dispositions=[_0xd0af('0x3'),_0xd0af('0x4'),'FAILED','NO\x20ANSWER',_0xd0af('0x3'),_0xd0af('0x3'),_0xd0af('0x5'),'BUSY','FAILED',_0xd0af('0x4'),'FAILED'];var channels={};function writeDB(_0x30eed7){utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x8'),_0x30eed7[_0xd0af('0x9')],_0x30eed7['channel'],_0x30eed7[_0xd0af('0xa')],_0x30eed7['membername'],_0x30eed7[_0xd0af('0xb')],_0x30eed7[_0xd0af('0xc')],_0x30eed7['connectedlinenum'],_0x30eed7['lastevent']));if(_0x30eed7[_0xd0af('0xd')]){utils[_0xd0af('0xe')](_0x30eed7[_0xd0af('0xd')])[_0xd0af('0xf')](function(_0x2d2354){if(_0x2d2354){_0x30eed7[_0xd0af('0x10')]=_0x2d2354['id'];}utils[_0xd0af('0x11')]('CreateVoiceCallReport',_0x30eed7);});}else{utils['request'](_0xd0af('0x12'),_0x30eed7);}if(channels[_0x30eed7[_0xd0af('0x9')]]){delete channels[_0x30eed7[_0xd0af('0x9')]];}}exports[_0xd0af('0x13')]=function(_0x5b0798){try{utils['debug'](util[_0xd0af('0x7')](_0xd0af('0x14'),_0x5b0798[_0xd0af('0x9')]),_0x5b0798);if(_0x5b0798[_0xd0af('0x9')]==_0x5b0798[_0xd0af('0x15')]&&_0x5b0798[_0xd0af('0x16')]!='OutgoingSpoolFailed'){utils[_0xd0af('0x6')](util[_0xd0af('0x7')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x5b0798[_0xd0af('0x9')],_0x5b0798[_0xd0af('0x17')],_0x5b0798[_0xd0af('0x18')]));channels[_0x5b0798['uniqueid']]={'uniqueid':_0x5b0798[_0xd0af('0x9')],'accountcode':_0x5b0798['accountcode'],'source':_0x5b0798[_0xd0af('0xc')],'destination':_0x5b0798[_0xd0af('0x18')],'destinationcontext':_0x5b0798[_0xd0af('0x17')],'channel':_0x5b0798[_0xd0af('0x16')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xd0af('0x19')};}}catch(_0x4ea73f){utils[_0xd0af('0x1a')](util[_0xd0af('0x7')](_0xd0af('0x14'),_0x5b0798[_0xd0af('0x9')]),_0x4ea73f);}};exports['newstate']=function(_0x3cb29b){try{utils[_0xd0af('0x1b')](util[_0xd0af('0x7')]('[%s][calls][newstate]',_0x3cb29b['uniqueid']),_0x3cb29b);if(!_['isNil'](channels[_0x3cb29b[_0xd0af('0x9')]])&&_0x3cb29b[_0xd0af('0x1c')]==0x6){utils[_0xd0af('0x6')](util[_0xd0af('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x3cb29b['uniqueid'],_0x3cb29b[_0xd0af('0x17')],_0x3cb29b['channel']));if(_['isNil'](channels[_0x3cb29b[_0xd0af('0x9')]][_0xd0af('0x1d')])){channels[_0x3cb29b[_0xd0af('0x9')]][_0xd0af('0x1d')]=utils[_0xd0af('0x1e')]();}}else if(!_[_0xd0af('0x1f')](channels[_0x3cb29b['linkedid']])&&_0x3cb29b[_0xd0af('0x1c')]==0x6&&_0x3cb29b[_0xd0af('0x17')]!=_0xd0af('0x20')){utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x21'),_0x3cb29b[_0xd0af('0x9')],_0x3cb29b[_0xd0af('0x15')],_0x3cb29b[_0xd0af('0x17')],_0x3cb29b[_0xd0af('0x16')]));channels[_0x3cb29b[_0xd0af('0x15')]][_0xd0af('0xd')]=_0x3cb29b[_0xd0af('0xd')];channels[_0x3cb29b['linkedid']][_0xd0af('0x22')]=_0x3cb29b['channel'];if(_[_0xd0af('0x1f')](channels[_0x3cb29b[_0xd0af('0x15')]]['answertime'])){channels[_0x3cb29b[_0xd0af('0x15')]]['answertime']=utils[_0xd0af('0x1e')]();}channels[_0x3cb29b[_0xd0af('0x15')]]['disposition']=dispositions[_[_0xd0af('0x23')](_0x3cb29b[_0xd0af('0x1c')])]||'ANSWERED';}}catch(_0x1903dc){utils['error'](util['format'](_0xd0af('0x24'),_0x3cb29b[_0xd0af('0x9')]),_0x1903dc);}};exports[_0xd0af('0x25')]=function(_0x2f7ec6){try{if(!_[_0xd0af('0x1f')](channels[_0x2f7ec6['uniqueid']])){utils[_0xd0af('0x1b')](util[_0xd0af('0x7')](_0xd0af('0x26'),_0x2f7ec6[_0xd0af('0x9')]),_0x2f7ec6);if(_[_0xd0af('0x1f')](channels[_0x2f7ec6[_0xd0af('0x9')]][_0xd0af('0x27')])){channels[_0x2f7ec6[_0xd0af('0x9')]][_0xd0af('0x27')]=_0x2f7ec6['calleridname']+'\x20<'+_0x2f7ec6[_0xd0af('0xc')]+'>';}utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x28'),_0x2f7ec6['uniqueid'],channels[_0x2f7ec6[_0xd0af('0x9')]][_0xd0af('0x27')],_0x2f7ec6['cause-txt']));channels[_0x2f7ec6[_0xd0af('0x9')]]['endtime']=utils[_0xd0af('0x1e')]();channels[_0x2f7ec6[_0xd0af('0x9')]][_0xd0af('0x29')]=utils[_0xd0af('0x2a')](channels[_0x2f7ec6[_0xd0af('0x9')]]['endtime'],channels[_0x2f7ec6[_0xd0af('0x9')]][_0xd0af('0x2b')]);channels[_0x2f7ec6[_0xd0af('0x9')]][_0xd0af('0x2c')]=channels[_0x2f7ec6['uniqueid']][_0xd0af('0x2d')]?utils['diffTime'](channels[_0x2f7ec6[_0xd0af('0x9')]]['endtime'],channels[_0x2f7ec6[_0xd0af('0x9')]][_0xd0af('0x2d')]):0x0;writeDB(channels[_0x2f7ec6[_0xd0af('0x9')]]);}}catch(_0x1ebd16){utils[_0xd0af('0x1a')](util[_0xd0af('0x7')](_0xd0af('0x26'),_0x2f7ec6[_0xd0af('0x9')]),_0x1ebd16);}};exports[_0xd0af('0x2e')]=function(_0x33464e){try{if(!_[_0xd0af('0x1f')](channels[_0x33464e[_0xd0af('0x2f')]])){utils[_0xd0af('0x1b')](util[_0xd0af('0x7')](_0xd0af('0x30'),_0x33464e[_0xd0af('0x31')]),_0x33464e);if(channels[_0x33464e[_0xd0af('0x2f')]]['channel']==_0x33464e[_0xd0af('0x32')]){utils['info'](util[_0xd0af('0x7')](_0xd0af('0x33'),_0x33464e[_0xd0af('0x31')],_0x33464e[_0xd0af('0x2f')],_0x33464e['secondtransfererchannel']));channels[_0x33464e[_0xd0af('0x2f')]][_0xd0af('0x22')]=_0x33464e[_0xd0af('0x34')];channels[_0x33464e[_0xd0af('0x2f')]][_0xd0af('0x35')]=_0xd0af('0x36');}else if(channels[_0x33464e[_0xd0af('0x2f')]][_0xd0af('0x16')]=_0x33464e['transfertargetchannel']){utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x33'),_0x33464e['origtransfereruniqueid'],_0x33464e[_0xd0af('0x2f')],_0x33464e[_0xd0af('0x37')]));channels[_0x33464e['localtwolinkedid']]['destinationchannel']=_0x33464e[_0xd0af('0x37')];channels[_0x33464e['localtwolinkedid']][_0xd0af('0x35')]=_0xd0af('0x36');}}}catch(_0x16ad75){utils[_0xd0af('0x1a')](util[_0xd0af('0x7')]('[%s][calls][attendedtransfer]',_0x33464e[_0xd0af('0x31')]),_0x16ad75);}};exports['musiconholdstart']=function(_0x4bc150){try{if(!_[_0xd0af('0x1f')](channels[_0x4bc150[_0xd0af('0x9')]])){utils[_0xd0af('0x1b')](util['format'](_0xd0af('0x38'),_0x4bc150[_0xd0af('0x9')]),_0x4bc150);channels[_0x4bc150['uniqueid']][_0xd0af('0x39')]=utils[_0xd0af('0x1e')]();utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x3a'),_0x4bc150[_0xd0af('0x9')],channels[_0x4bc150['uniqueid']][_0xd0af('0x39')]));}}catch(_0x25a0b1){utils[_0xd0af('0x1a')](util[_0xd0af('0x7')]('[%s][calls][musiconholdstart]',_0x4bc150[_0xd0af('0x9')]),_0x25a0b1);}};exports[_0xd0af('0x3b')]=function(_0x53972c){try{if(!_[_0xd0af('0x1f')](channels[_0x53972c[_0xd0af('0x9')]])){utils[_0xd0af('0x1b')](util[_0xd0af('0x7')]('[%s][calls][musiconholdstop]',_0x53972c[_0xd0af('0x9')]),_0x53972c);if(!_[_0xd0af('0x1f')](channels[_0x53972c[_0xd0af('0x9')]][_0xd0af('0x39')])){channels[_0x53972c[_0xd0af('0x9')]][_0xd0af('0x3c')]+=utils['diffTime'](utils[_0xd0af('0x1e')](),channels[_0x53972c[_0xd0af('0x9')]]['musiconholdstartAt']);utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x3d'),_0x53972c[_0xd0af('0x9')],channels[_0x53972c[_0xd0af('0x9')]][_0xd0af('0x3c')]));delete channels[_0x53972c[_0xd0af('0x9')]]['musiconholdstartAt'];}}}catch(_0x3c80ee){utils[_0xd0af('0x1a')](util['format'](_0xd0af('0x3e'),_0x53972c[_0xd0af('0x9')]),_0x3c80ee);}};exports[_0xd0af('0x3f')]=function(_0x4f02aa){try{if(!_[_0xd0af('0x1f')](channels[_0x4f02aa['uniqueid']])){utils[_0xd0af('0x1b')](util[_0xd0af('0x7')](_0xd0af('0x40'),_0x4f02aa[_0xd0af('0x9')]),_0x4f02aa);if(!_[_0xd0af('0x1f')](_0x4f02aa['variable'][_0xd0af('0x41')])){utils[_0xd0af('0x6')](util['format'](_0xd0af('0x42'),_0x4f02aa['uniqueid'],_0x4f02aa['value']));channels[_0x4f02aa[_0xd0af('0x9')]][_0xd0af('0x43')]=_0x4f02aa['value'];}if(!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x45')])){utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x46'),_0x4f02aa[_0xd0af('0x9')],_0x4f02aa[_0xd0af('0x47')]));channels[_0x4f02aa[_0xd0af('0x9')]]['destination']=_0x4f02aa[_0xd0af('0x47')];channels[_0x4f02aa['uniqueid']][_0xd0af('0x27')]='\x22'+_0x4f02aa[_0xd0af('0x47')]+_0xd0af('0x48')+_0x4f02aa[_0xd0af('0x47')]+'>';}if(!_['isNil'](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x49')])||!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x4a')])){utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x4b'),_0x4f02aa[_0xd0af('0x9')],!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x49')])?'xmd-callerid-preview':_0xd0af('0x4a'),_0x4f02aa[_0xd0af('0x47')]));channels[_0x4f02aa[_0xd0af('0x9')]][_0xd0af('0x27')]=_0x4f02aa['value'];}if(!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x4c')])||!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x4d')])){utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x4b'),_0x4f02aa[_0xd0af('0x9')],!_['isNil'](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x4c')])?'xmd-queue':_0xd0af('0x4d'),_0x4f02aa['value']));channels[_0x4f02aa[_0xd0af('0x9')]]['lastapplication']=_0xd0af('0x4e');channels[_0x4f02aa[_0xd0af('0x9')]][_0xd0af('0x4f')]=_0x4f02aa[_0xd0af('0x47')];channels[_0x4f02aa[_0xd0af('0x9')]]['queue']=!![];}if(!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')]['xmd-contactid'])){utils[_0xd0af('0x6')](util['format'](_0xd0af('0x50'),_0x4f02aa[_0xd0af('0x9')],_0x4f02aa[_0xd0af('0x47')]));channels[_0x4f02aa[_0xd0af('0x9')]][_0xd0af('0x51')]=_0x4f02aa[_0xd0af('0x47')];}if(!_[_0xd0af('0x1f')](_0x4f02aa['variable'][_0xd0af('0x52')])){utils[_0xd0af('0x6')](util[_0xd0af('0x7')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4f02aa['uniqueid'],_0x4f02aa[_0xd0af('0x47')]));channels[_0x4f02aa['uniqueid']][_0xd0af('0x53')]=_0x4f02aa[_0xd0af('0x47')];}if(!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x54')])){utils[_0xd0af('0x6')](util[_0xd0af('0x7')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x4f02aa[_0xd0af('0x9')],_0x4f02aa[_0xd0af('0x47')]));channels[_0x4f02aa[_0xd0af('0x9')]][_0xd0af('0x55')]=_0x4f02aa['value'];}if(!_[_0xd0af('0x1f')](_0x4f02aa[_0xd0af('0x44')][_0xd0af('0x56')])){utils[_0xd0af('0x6')](util[_0xd0af('0x7')](_0xd0af('0x57'),_0x4f02aa['uniqueid'],_0x4f02aa[_0xd0af('0x47')]));channels[_0x4f02aa['uniqueid']][_0xd0af('0x56')]=_0x4f02aa[_0xd0af('0x47')];}}}catch(_0x318a2e){utils[_0xd0af('0x1a')](util[_0xd0af('0x7')]('[%s][calls][varset]',_0x4f02aa['uniqueid']),_0x318a2e);}};exports[_0xd0af('0x58')]=function(_0x2e738f){try{if(!_[_0xd0af('0x1f')](channels[_0x2e738f[_0xd0af('0x9')]])){utils['debug'](util['format'](_0xd0af('0x59'),_0x2e738f[_0xd0af('0x9')]),_0x2e738f);utils['info'](util[_0xd0af('0x7')](_0xd0af('0x5a'),_0x2e738f[_0xd0af('0x9')],_0x2e738f['application'],_0x2e738f[_0xd0af('0x5b')]));if(_0x2e738f[_0xd0af('0x5c')][_0xd0af('0x5d')]()==_0xd0af('0x5e')&&_[_0xd0af('0x5f')](_0x2e738f[_0xd0af('0x5b')][_0xd0af('0x5d')](),_0xd0af('0x60'))){var _0xeb89d=_0x2e738f[_0xd0af('0x5b')][_0xd0af('0x61')]('=');var _0x1cd219=_0xeb89d[0x0][_0xd0af('0x62')](_0xeb89d[0x0][_0xd0af('0x63')]('(')+0x1,_0xeb89d[0x0][_0xd0af('0x63')](')'));var _0x3aa929=_0xeb89d[0x1];channels[_0x2e738f[_0xd0af('0x9')]][_0x1cd219]=_0x3aa929;}if(!_[_0xd0af('0x64')]([_0xd0af('0x25'),'noop',_0xd0af('0x65'),'set','gotoif'],_0x2e738f[_0xd0af('0x5c')][_0xd0af('0x5d')]())){channels[_0x2e738f['uniqueid']][_0xd0af('0x66')]=_0x2e738f[_0xd0af('0x5c')];channels[_0x2e738f['uniqueid']][_0xd0af('0x4f')]=_0x2e738f[_0xd0af('0x5b')];}}}catch(_0x5f8837){utils[_0xd0af('0x1a')](util['format'](_0xd0af('0x59'),_0x2e738f[_0xd0af('0x9')]),_0x5f8837);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4e2c012..d9e0a93 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 _0x6a6e=['[core]\x20connected','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x2601a4,_0x31730b){var _0x16986e=function(_0x5a0ec){while(--_0x5a0ec){_0x2601a4['push'](_0x2601a4['shift']());}};_0x16986e(++_0x31730b);}(_0x6a6e,0xf0));var _0xe6a6=function(_0x3182f2,_0x242888){_0x3182f2=_0x3182f2-0x0;var _0x5ed78d=_0x6a6e[_0x3182f2];return _0x5ed78d;};'use strict';var utils=require(_0xe6a6('0x0'));exports[_0xe6a6('0x1')]=function(){utils['info'](_0xe6a6('0x2'));};exports['shutdown']=function(){utils[_0xe6a6('0x3')](_0xe6a6('0x4'));};exports[_0xe6a6('0x5')]=function(){utils['info'](_0xe6a6('0x6'));};exports[_0xe6a6('0x7')]=function(_0x717ec){utils[_0xe6a6('0x7')]('[core]\x20error',_0x717ec);};exports[_0xe6a6('0x8')]=function(){utils[_0xe6a6('0x3')](_0xe6a6('0x9'));};exports[_0xe6a6('0xa')]=function(_0x2b140a){}; \ No newline at end of file +var _0x27b3=['error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','shutdown','fullybooted'];(function(_0x219950,_0x2399c3){var _0x52efbd=function(_0x568f46){while(--_0x568f46){_0x219950['push'](_0x219950['shift']());}};_0x52efbd(++_0x2399c3);}(_0x27b3,0xd7));var _0x327b=function(_0x2a1f50,_0x1d88b5){_0x2a1f50=_0x2a1f50-0x0;var _0x1799d3=_0x27b3[_0x2a1f50];return _0x1799d3;};'use strict';var utils=require(_0x327b('0x0'));exports[_0x327b('0x1')]=function(){utils[_0x327b('0x2')]('[core]\x20connected');};exports[_0x327b('0x3')]=function(){utils[_0x327b('0x2')]('[core]\x20shutdown');};exports[_0x327b('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports[_0x327b('0x5')]=function(_0x136592){utils['error'](_0x327b('0x6'),_0x136592);};exports[_0x327b('0x7')]=function(){utils['info'](_0x327b('0x8'));};exports[_0x327b('0x9')]=function(_0x2dec63){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index e5113f8..a8261a5 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 _0x5d81=['hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','isNil','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s'];(function(_0x1fa28d,_0x419bb6){var _0x1581da=function(_0x169180){while(--_0x169180){_0x1fa28d['push'](_0x1fa28d['shift']());}};_0x1581da(++_0x419bb6);}(_0x5d81,0x1b1));var _0x15d8=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x5d81[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x15d8('0x0'));var util=require('util');var utils=require(_0x15d8('0x1'));var dials={};function writeDB(_0x489b8b){utils[_0x15d8('0x2')](util['format'](_0x15d8('0x3'),_0x489b8b['uniqueid'],_0x489b8b[_0x15d8('0x4')],_0x489b8b[_0x15d8('0x5')],_0x489b8b[_0x15d8('0x6')],_0x489b8b[_0x15d8('0x7')],_0x489b8b[_0x15d8('0x8')]));utils[_0x15d8('0x9')]('CreateVoiceDialReport',_0x489b8b);delete dials[_0x489b8b[_0x15d8('0xa')]];}exports[_0x15d8('0xb')]=function(_0x217895){try{utils[_0x15d8('0xc')](util[_0x15d8('0xd')]('[%s][dials][newexten]',_0x217895[_0x15d8('0xa')]),_0x217895);utils[_0x15d8('0x2')](util['format'](_0x15d8('0xe'),_0x217895[_0x15d8('0xa')],_0x217895[_0x15d8('0xf')],_0x217895[_0x15d8('0x10')]));if(_0x217895[_0x15d8('0xf')][_0x15d8('0x11')]()==_0x15d8('0x12')&&_[_0x15d8('0x13')](_0x217895[_0x15d8('0x10')]['toLowerCase'](),_0x15d8('0x14'))){var _0x35e663=_0x217895[_0x15d8('0x10')][_0x15d8('0x15')]('=');dials[_0x217895['uniqueid']]={'routeId':_0x35e663[0x1]};}}catch(_0x22e46f){utils[_0x15d8('0x16')](util[_0x15d8('0xd')](_0x15d8('0x17'),_0x217895['uniqueid']),_0x22e46f);}};exports['varset']=function(_0x543332){try{utils[_0x15d8('0xc')](util[_0x15d8('0xd')](_0x15d8('0x18'),_0x543332['uniqueid']),_0x543332);if(!_['isNil'](_0x543332[_0x15d8('0x19')][_0x15d8('0x1a')])){utils[_0x15d8('0x2')](util['format'](_0x15d8('0x1b'),_0x543332[_0x15d8('0xa')],_0x543332[_0x15d8('0x1c')]));dials[_0x543332[_0x15d8('0xa')]]={'routeId':_0x543332[_0x15d8('0x1c')]};}}catch(_0xa28dda){utils[_0x15d8('0x16')](util[_0x15d8('0xd')](_0x15d8('0x18'),_0x543332[_0x15d8('0xa')]),_0xa28dda);}};exports[_0x15d8('0x1d')]=function(_0x464f01){try{if(!_['isNil'](dials[_0x464f01[_0x15d8('0xa')]])){utils[_0x15d8('0xc')](util['format']('[%s][dials][dialbegin]',_0x464f01[_0x15d8('0xa')]),_0x464f01);dials[_0x464f01[_0x15d8('0xa')]]=_[_0x15d8('0x1e')](dials[_0x464f01[_0x15d8('0xa')]],_0x464f01);dials[_0x464f01[_0x15d8('0xa')]][_0x15d8('0x1f')]=utils[_0x15d8('0x20')]();dials[_0x464f01['uniqueid']][_0x15d8('0x21')]=_0x15d8('0x22');utils[_0x15d8('0x2')](util[_0x15d8('0xd')](_0x15d8('0x23'),_0x464f01[_0x15d8('0xa')],dials[_0x464f01[_0x15d8('0xa')]]['starttime']));}}catch(_0x375080){utils[_0x15d8('0x16')](util[_0x15d8('0xd')](_0x15d8('0x24'),_0x464f01[_0x15d8('0xa')]),_0x375080);}};exports[_0x15d8('0x25')]=function(_0x498621){try{if(!_[_0x15d8('0x26')](dials[_0x498621['uniqueid']])){utils[_0x15d8('0xc')](util[_0x15d8('0xd')](_0x15d8('0x27'),_0x498621['uniqueid']),_0x498621);dials[_0x498621[_0x15d8('0xa')]][_0x15d8('0x8')]=_0x498621[_0x15d8('0x8')];if(_0x498621['dialstatus']=='ANSWER'){dials[_0x498621[_0x15d8('0xa')]]=_[_0x15d8('0x1e')](dials[_0x498621['uniqueid']],_0x498621);dials[_0x498621[_0x15d8('0xa')]][_0x15d8('0x28')]=utils['now']();dials[_0x498621['uniqueid']]['lastevent']=_0x15d8('0x29');utils[_0x15d8('0x2')](util[_0x15d8('0xd')](_0x15d8('0x2a'),_0x498621[_0x15d8('0xa')],_0x498621['dialstatus'],dials[_0x498621[_0x15d8('0xa')]][_0x15d8('0x28')]));}else{utils[_0x15d8('0x2')](util[_0x15d8('0xd')](_0x15d8('0x2b'),_0x498621[_0x15d8('0xa')],_0x498621['dialstatus']));}}}catch(_0x5d022a){utils[_0x15d8('0x16')](util[_0x15d8('0xd')](_0x15d8('0x27'),_0x498621[_0x15d8('0xa')]),_0x5d022a);}};exports[_0x15d8('0x2c')]=function(_0x1ecbf0){try{if(!_[_0x15d8('0x26')](dials[_0x1ecbf0[_0x15d8('0xa')]])){utils[_0x15d8('0xc')](util[_0x15d8('0xd')]('[%s][dials][hangup]',_0x1ecbf0['uniqueid']),_0x1ecbf0);utils[_0x15d8('0x2')](util[_0x15d8('0xd')](_0x15d8('0x2d'),_0x1ecbf0[_0x15d8('0xa')],_0x1ecbf0['calleridnum'],_0x1ecbf0[_0x15d8('0x2e')],_0x1ecbf0[_0x15d8('0x2f')]));dials[_0x1ecbf0[_0x15d8('0xa')]]=_[_0x15d8('0x1e')](dials[_0x1ecbf0[_0x15d8('0xa')]],{'endtime':utils[_0x15d8('0x20')](),'lastevent':_0x15d8('0x30')});dials[_0x1ecbf0[_0x15d8('0xa')]][_0x15d8('0x31')]=utils[_0x15d8('0x32')](dials[_0x1ecbf0['uniqueid']][_0x15d8('0x33')],dials[_0x1ecbf0['uniqueid']][_0x15d8('0x1f')]);dials[_0x1ecbf0[_0x15d8('0xa')]]['holdtime']=utils[_0x15d8('0x32')](dials[_0x1ecbf0['uniqueid']][_0x15d8('0x28')]||dials[_0x1ecbf0[_0x15d8('0xa')]][_0x15d8('0x33')],dials[_0x1ecbf0['uniqueid']]['starttime']);dials[_0x1ecbf0[_0x15d8('0xa')]][_0x15d8('0x34')]=dials[_0x1ecbf0[_0x15d8('0xa')]][_0x15d8('0x28')]?utils[_0x15d8('0x32')](dials[_0x1ecbf0[_0x15d8('0xa')]][_0x15d8('0x33')],dials[_0x1ecbf0[_0x15d8('0xa')]]['answertime']):0x0;writeDB(dials[_0x1ecbf0[_0x15d8('0xa')]]);}}catch(_0x108b20){utils[_0x15d8('0x16')](util[_0x15d8('0xd')]('[%s][dials][hangup]',_0x1ecbf0['uniqueid']),_0x108b20);}}; \ No newline at end of file +var _0xe493=['variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','isNil','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','now','endtime','starttime','diffTime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','error','[%s][dials][varset]'];(function(_0x4eda33,_0x200db8){var _0x5d6eb4=function(_0x57312c){while(--_0x57312c){_0x4eda33['push'](_0x4eda33['shift']());}};_0x5d6eb4(++_0x200db8);}(_0xe493,0x139));var _0x3e49=function(_0x19e0d8,_0xbec4da){_0x19e0d8=_0x19e0d8-0x0;var _0x7aafa4=_0xe493[_0x19e0d8];return _0x7aafa4;};'use strict';var _=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var utils=require(_0x3e49('0x2'));var dials={};function writeDB(_0x5c5197){utils[_0x3e49('0x3')](util[_0x3e49('0x4')](_0x3e49('0x5'),_0x5c5197['uniqueid'],_0x5c5197[_0x3e49('0x6')],_0x5c5197[_0x3e49('0x7')],_0x5c5197[_0x3e49('0x8')],_0x5c5197[_0x3e49('0x9')],_0x5c5197[_0x3e49('0xa')]));utils['request']('CreateVoiceDialReport',_0x5c5197);delete dials[_0x5c5197[_0x3e49('0xb')]];}exports[_0x3e49('0xc')]=function(_0x93f01){try{utils[_0x3e49('0xd')](util[_0x3e49('0x4')](_0x3e49('0xe'),_0x93f01[_0x3e49('0xb')]),_0x93f01);utils['info'](util[_0x3e49('0x4')](_0x3e49('0xf'),_0x93f01['uniqueid'],_0x93f01[_0x3e49('0x10')],_0x93f01[_0x3e49('0x11')]));if(_0x93f01[_0x3e49('0x10')]['toLowerCase']()==_0x3e49('0x12')&&_[_0x3e49('0x13')](_0x93f01[_0x3e49('0x11')][_0x3e49('0x14')](),'cdr(routeid)')){var _0x10f514=_0x93f01[_0x3e49('0x11')]['split']('=');dials[_0x93f01['uniqueid']]={'routeId':_0x10f514[0x1]};}}catch(_0x9a14b0){utils[_0x3e49('0x15')](util[_0x3e49('0x4')](_0x3e49('0xe'),_0x93f01[_0x3e49('0xb')]),_0x9a14b0);}};exports['varset']=function(_0x29ab12){try{utils[_0x3e49('0xd')](util[_0x3e49('0x4')](_0x3e49('0x16'),_0x29ab12[_0x3e49('0xb')]),_0x29ab12);if(!_['isNil'](_0x29ab12[_0x3e49('0x17')][_0x3e49('0x18')])){utils[_0x3e49('0x3')](util[_0x3e49('0x4')](_0x3e49('0x19'),_0x29ab12['uniqueid'],_0x29ab12[_0x3e49('0x1a')]));dials[_0x29ab12[_0x3e49('0xb')]]={'routeId':_0x29ab12[_0x3e49('0x1a')]};}}catch(_0x170c30){utils[_0x3e49('0x15')](util[_0x3e49('0x4')](_0x3e49('0x16'),_0x29ab12['uniqueid']),_0x170c30);}};exports[_0x3e49('0x1b')]=function(_0x2437f4){try{if(!_['isNil'](dials[_0x2437f4['uniqueid']])){utils[_0x3e49('0xd')](util[_0x3e49('0x4')]('[%s][dials][dialbegin]',_0x2437f4[_0x3e49('0xb')]),_0x2437f4);dials[_0x2437f4['uniqueid']]=_['assign'](dials[_0x2437f4[_0x3e49('0xb')]],_0x2437f4);dials[_0x2437f4[_0x3e49('0xb')]]['starttime']=utils['now']();dials[_0x2437f4[_0x3e49('0xb')]][_0x3e49('0x1c')]=_0x3e49('0x1d');utils[_0x3e49('0x3')](util[_0x3e49('0x4')](_0x3e49('0x1e'),_0x2437f4['uniqueid'],dials[_0x2437f4[_0x3e49('0xb')]]['starttime']));}}catch(_0x58ad12){utils['error'](util['format'](_0x3e49('0x1f'),_0x2437f4[_0x3e49('0xb')]),_0x58ad12);}};exports[_0x3e49('0x20')]=function(_0x28fb8b){try{if(!_[_0x3e49('0x21')](dials[_0x28fb8b[_0x3e49('0xb')]])){utils['debug'](util[_0x3e49('0x4')](_0x3e49('0x22'),_0x28fb8b[_0x3e49('0xb')]),_0x28fb8b);dials[_0x28fb8b[_0x3e49('0xb')]][_0x3e49('0xa')]=_0x28fb8b[_0x3e49('0xa')];if(_0x28fb8b['dialstatus']==_0x3e49('0x23')){dials[_0x28fb8b['uniqueid']]=_[_0x3e49('0x24')](dials[_0x28fb8b[_0x3e49('0xb')]],_0x28fb8b);dials[_0x28fb8b['uniqueid']][_0x3e49('0x25')]=utils['now']();dials[_0x28fb8b[_0x3e49('0xb')]][_0x3e49('0x1c')]=_0x3e49('0x26');utils[_0x3e49('0x3')](util[_0x3e49('0x4')](_0x3e49('0x27'),_0x28fb8b[_0x3e49('0xb')],_0x28fb8b[_0x3e49('0xa')],dials[_0x28fb8b[_0x3e49('0xb')]][_0x3e49('0x25')]));}else{utils['info'](util['format'](_0x3e49('0x28'),_0x28fb8b[_0x3e49('0xb')],_0x28fb8b[_0x3e49('0xa')]));}}}catch(_0x484c8f){utils[_0x3e49('0x15')](util['format']('[%s][dials][dialend]',_0x28fb8b[_0x3e49('0xb')]),_0x484c8f);}};exports['hangup']=function(_0x22bb1a){try{if(!_[_0x3e49('0x21')](dials[_0x22bb1a['uniqueid']])){utils['debug'](util[_0x3e49('0x4')](_0x3e49('0x29'),_0x22bb1a[_0x3e49('0xb')]),_0x22bb1a);utils[_0x3e49('0x3')](util[_0x3e49('0x4')](_0x3e49('0x2a'),_0x22bb1a[_0x3e49('0xb')],_0x22bb1a[_0x3e49('0x8')],_0x22bb1a[_0x3e49('0x2b')],_0x22bb1a['cause-txt']));dials[_0x22bb1a[_0x3e49('0xb')]]=_[_0x3e49('0x24')](dials[_0x22bb1a[_0x3e49('0xb')]],{'endtime':utils[_0x3e49('0x2c')](),'lastevent':'complete'});dials[_0x22bb1a['uniqueid']]['duration']=utils['diffTime'](dials[_0x22bb1a[_0x3e49('0xb')]][_0x3e49('0x2d')],dials[_0x22bb1a['uniqueid']][_0x3e49('0x2e')]);dials[_0x22bb1a[_0x3e49('0xb')]]['holdtime']=utils[_0x3e49('0x2f')](dials[_0x22bb1a['uniqueid']][_0x3e49('0x25')]||dials[_0x22bb1a['uniqueid']][_0x3e49('0x2d')],dials[_0x22bb1a[_0x3e49('0xb')]][_0x3e49('0x2e')]);dials[_0x22bb1a[_0x3e49('0xb')]]['billableseconds']=dials[_0x22bb1a[_0x3e49('0xb')]][_0x3e49('0x25')]?utils[_0x3e49('0x2f')](dials[_0x22bb1a[_0x3e49('0xb')]][_0x3e49('0x2d')],dials[_0x22bb1a[_0x3e49('0xb')]][_0x3e49('0x25')]):0x0;writeDB(dials[_0x22bb1a['uniqueid']]);}}catch(_0x43ea9a){utils[_0x3e49('0x15')](util['format']('[%s][dials][hangup]',_0x22bb1a[_0x3e49('0xb')]),_0x43ea9a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index dee3213..c80e432 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 _0x72da=['keepConnected','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','debug','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','port','username','password'];(function(_0x35b3a6,_0x1c1d1f){var _0x34ffc6=function(_0x38cd86){while(--_0x38cd86){_0x35b3a6['push'](_0x35b3a6['shift']());}};_0x34ffc6(++_0x1c1d1f);}(_0x72da,0x14d));var _0xa72d=function(_0x43d106,_0x96a475){_0x43d106=_0x43d106-0x0;var _0x2160bc=_0x72da[_0x43d106];return _0x2160bc;};var AsteriskManager=require(_0xa72d('0x0'));var config=require(_0xa72d('0x1'));var utils=require(_0xa72d('0x2'));var util=require(_0xa72d('0x3'));var isXDREnabled=config[_0xa72d('0x4')]&&config[_0xa72d('0x4')][_0xa72d('0x5')]?!config[_0xa72d('0x4')][_0xa72d('0x5')]:!![];var isProduction=config['env']===_0xa72d('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0xa72d('0x4')][_0xa72d('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xa72d('0x8')][_0xa72d('0x9')],config[_0xa72d('0x8')]['ip'],config[_0xa72d('0x8')][_0xa72d('0xa')],config[_0xa72d('0x8')][_0xa72d('0xb')],!![]);ami[_0xa72d('0xc')]();if(!isXDREnabled){utils[_0xa72d('0xd')](_0xa72d('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa72d('0xd')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xa72d('0xf'));var calls=require('./calls.controller');var queues=require(_0xa72d('0x10'));var recordings=require(_0xa72d('0x11'));var members=require(_0xa72d('0x12'));var dials=require(_0xa72d('0x13'));var transfers=require('./transfers.controller');var core=require(_0xa72d('0x14'));ami['on'](_0xa72d('0x15'),core[_0xa72d('0x15')]);ami['on'](_0xa72d('0x16'),core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0xa72d('0x17'),core[_0xa72d('0x17')]);ami['on']('close',core[_0xa72d('0x18')]);ami['on'](_0xa72d('0x19'),core[_0xa72d('0x19')]);ami['on'](_0xa72d('0x1a'),function(_0x38dd69){try{utils['debug'](util[_0xa72d('0x1b')](_0xa72d('0x1c'),_0x38dd69['device']),_0x38dd69);members['devicestatechange'](_0x38dd69);}catch(_0x158bc2){utils[_0xa72d('0x17')](util['format'](_0xa72d('0x1c'),_0x38dd69[_0xa72d('0x1d')]),_0x158bc2);}});ami['on']('agentcalled',function(_0x1617fb){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')](_0xa72d('0x1f'),_0x1617fb['uniqueid']),_0x1617fb);agents['agentcalled'](_0x1617fb);}catch(_0x478d3c){utils['error'](util[_0xa72d('0x1b')]('[%s][index][agentcalled]',_0x1617fb['uniqueid']),_0x478d3c);}});ami['on'](_0xa72d('0x20'),function(_0x58fe7d){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')](_0xa72d('0x21'),_0x58fe7d['uniqueid']),_0x58fe7d);agents[_0xa72d('0x20')](_0x58fe7d);}catch(_0x5aa0e8){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x21'),_0x58fe7d[_0xa72d('0x22')]),_0x5aa0e8);}});ami['on'](_0xa72d('0x23'),function(_0x2ce5c6){try{utils[_0xa72d('0x1e')](util['format'](_0xa72d('0x24'),_0x2ce5c6[_0xa72d('0x22')]),_0x2ce5c6);agents['agentconnect'](_0x2ce5c6);queues[_0xa72d('0x23')](_0x2ce5c6);}catch(_0x7184a2){utils['error'](util[_0xa72d('0x1b')](_0xa72d('0x24'),_0x2ce5c6[_0xa72d('0x22')]),_0x7184a2);}});ami['on']('agentcomplete',function(_0x20908d){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')]('[%s][index][agentcomplete]',_0x20908d[_0xa72d('0x22')]),_0x20908d);agents[_0xa72d('0x25')](_0x20908d);queues[_0xa72d('0x25')](_0x20908d);members['agentcomplete'](_0x20908d);}catch(_0x54e99b){utils['error'](util[_0xa72d('0x1b')](_0xa72d('0x26'),_0x20908d[_0xa72d('0x22')]),_0x54e99b);}});ami['on'](_0xa72d('0x27'),function(_0x3ec81b){try{utils['debug'](util[_0xa72d('0x1b')](_0xa72d('0x28'),_0x3ec81b[_0xa72d('0x22')]),_0x3ec81b);agents[_0xa72d('0x27')](_0x3ec81b);queues[_0xa72d('0x27')](_0x3ec81b);}catch(_0x3deeb6){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x28'),_0x3ec81b[_0xa72d('0x22')]),_0x3deeb6);}});ami['on']('queuecallerjoin',function(_0x468147){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')](_0xa72d('0x29'),_0x468147['uniqueid']),_0x468147);queues[_0xa72d('0x2a')](_0x468147);recordings[_0xa72d('0x2a')](_0x468147);}catch(_0x550fbe){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x29'),_0x468147[_0xa72d('0x22')]),_0x550fbe);}});ami['on'](_0xa72d('0x2b'),function(_0x4d56c5){try{utils[_0xa72d('0x1e')](util['format'](_0xa72d('0x2c'),_0x4d56c5['uniqueid']),_0x4d56c5);queues[_0xa72d('0x2b')](_0x4d56c5);}catch(_0x21c18e){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x2c'),_0x4d56c5[_0xa72d('0x22')]),_0x21c18e);}});ami['on']('musiconholdstart',function(_0x6d2878){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')](_0xa72d('0x2d'),_0x6d2878[_0xa72d('0x22')]),_0x6d2878);queues['musiconholdstart'](_0x6d2878);calls[_0xa72d('0x2e')](_0x6d2878);}catch(_0x2c1707){utils[_0xa72d('0x17')](util['format']('[%s][index][musiconholdstart]',_0x6d2878[_0xa72d('0x22')]),_0x2c1707);}});ami['on']('musiconholdstop',function(_0x3011c7){try{utils[_0xa72d('0x1e')](util['format'](_0xa72d('0x2f'),_0x3011c7[_0xa72d('0x22')]),_0x3011c7);queues[_0xa72d('0x30')](_0x3011c7);calls[_0xa72d('0x30')](_0x3011c7);}catch(_0x16ac89){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x2f'),_0x3011c7['uniqueid']),_0x16ac89);}});ami['on'](_0xa72d('0x31'),function(_0x3d8b0e){try{utils['debug'](util['format'](_0xa72d('0x32'),_0x3d8b0e[_0xa72d('0x22')]),_0x3d8b0e);calls['newstate'](_0x3d8b0e);recordings[_0xa72d('0x31')](_0x3d8b0e);}catch(_0x45e4bb){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')]('[%s][index][newstate]',_0x3d8b0e[_0xa72d('0x22')]),_0x45e4bb);}});ami['on']('hangup',function(_0xc47dfb){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')]('[%s][index][hangup]',_0xc47dfb['uniqueid']),_0xc47dfb);calls[_0xa72d('0x33')](_0xc47dfb);recordings[_0xa72d('0x33')](_0xc47dfb);dials['hangup'](_0xc47dfb);agents[_0xa72d('0x33')](_0xc47dfb);queues[_0xa72d('0x33')](_0xc47dfb);}catch(_0x21201a){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x34'),_0xc47dfb['uniqueid']),_0x21201a);}});ami['on'](_0xa72d('0x35'),function(_0x18a544){try{utils['debug'](util[_0xa72d('0x1b')](_0xa72d('0x36'),_0x18a544[_0xa72d('0x22')]),_0x18a544);members[_0xa72d('0x35')](_0x18a544);}catch(_0x381035){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x36'),_0x18a544[_0xa72d('0x22')]),_0x381035);}});ami['on'](_0xa72d('0x37'),function(_0x46488c){try{utils['debug'](util[_0xa72d('0x1b')]('[%s][index][blindtransfer]',_0x46488c[_0xa72d('0x22')]),_0x46488c);queues[_0xa72d('0x37')](_0x46488c);agents[_0xa72d('0x37')](_0x46488c);transfers[_0xa72d('0x37')](_0x46488c);}catch(_0x2e88a1){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x38'),_0x46488c[_0xa72d('0x22')]),_0x2e88a1);}});ami['on'](_0xa72d('0x39'),function(_0x223d8c){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')](_0xa72d('0x3a'),_0x223d8c[_0xa72d('0x3b')]),_0x223d8c);queues['attendedtransfer'](_0x223d8c);transfers[_0xa72d('0x39')](_0x223d8c);agents[_0xa72d('0x39')](_0x223d8c);calls[_0xa72d('0x39')](_0x223d8c);}catch(_0x26e9d6){utils['error'](util['format'](_0xa72d('0x3a'),_0x223d8c[_0xa72d('0x3b')]),_0x26e9d6);}});ami['on'](_0xa72d('0x3c'),function(_0x4271ea){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')]('[%s][index][varset]',_0x4271ea['uniqueid']),_0x4271ea);queues[_0xa72d('0x3c')](_0x4271ea);recordings[_0xa72d('0x3c')](_0x4271ea);calls['varset'](_0x4271ea);dials['varset'](_0x4271ea);}catch(_0x34c0ac){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x3d'),_0x4271ea[_0xa72d('0x22')]),_0x34c0ac);}});ami['on'](_0xa72d('0x3e'),function(_0x1f3ed9){try{utils['debug'](util[_0xa72d('0x1b')]('[%s][index][newexten]',_0x1f3ed9[_0xa72d('0x22')]),_0x1f3ed9);calls[_0xa72d('0x3e')](_0x1f3ed9);recordings['newexten'](_0x1f3ed9);dials['newexten'](_0x1f3ed9);}catch(_0x35d5f9){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')]('[%s][index][newexten]',_0x1f3ed9[_0xa72d('0x22')]),_0x35d5f9);}});ami['on'](_0xa72d('0x3f'),function(_0x167d74){try{utils[_0xa72d('0x1e')](util[_0xa72d('0x1b')]('[%s][index][newchannel]',_0x167d74[_0xa72d('0x22')]),_0x167d74);calls[_0xa72d('0x3f')](_0x167d74);recordings['newchannel'](_0x167d74);}catch(_0x1528dc){utils[_0xa72d('0x17')](util['format'](_0xa72d('0x40'),_0x167d74[_0xa72d('0x22')]),_0x1528dc);}});ami['on'](_0xa72d('0x41'),function(_0x454b08){try{utils[_0xa72d('0x1e')](util['format']('[%s][index][dialbegin]',_0x454b08['uniqueid']),_0x454b08);dials[_0xa72d('0x41')](_0x454b08);}catch(_0x53216d){utils[_0xa72d('0x17')](util[_0xa72d('0x1b')](_0xa72d('0x42'),_0x454b08[_0xa72d('0x22')]),_0x53216d);}});ami['on']('dialend',function(_0x2f9971){try{utils[_0xa72d('0x1e')](util['format'](_0xa72d('0x43'),_0x2f9971[_0xa72d('0x22')]),_0x2f9971);dials[_0xa72d('0x44')](_0x2f9971);}catch(_0x14ca17){utils['error'](util['format'](_0xa72d('0x43'),_0x2f9971['uniqueid']),_0x14ca17);}});} \ No newline at end of file +var _0xac58=['debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange'];(function(_0x2e067a,_0xab528c){var _0xc64976=function(_0x53a98e){while(--_0x53a98e){_0x2e067a['push'](_0x2e067a['shift']());}};_0xc64976(++_0xab528c);}(_0xac58,0x1db));var _0x8ac5=function(_0x58ea29,_0x3f7b43){_0x58ea29=_0x58ea29-0x0;var _0x3dc212=_0xac58[_0x58ea29];return _0x3dc212;};var AsteriskManager=require(_0x8ac5('0x0'));var config=require(_0x8ac5('0x1'));var utils=require(_0x8ac5('0x2'));var util=require(_0x8ac5('0x3'));var isXDREnabled=config[_0x8ac5('0x4')]&&config[_0x8ac5('0x4')]['disabled']?!config[_0x8ac5('0x4')][_0x8ac5('0x5')]:!![];var isProduction=config[_0x8ac5('0x6')]===_0x8ac5('0x7')||![];var isLocalAsterisk=config[_0x8ac5('0x4')]&&config['xdr'][_0x8ac5('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0x8ac5('0x9')][_0x8ac5('0xa')],config[_0x8ac5('0x9')]['ip'],config[_0x8ac5('0x9')][_0x8ac5('0xb')],config[_0x8ac5('0x9')][_0x8ac5('0xc')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0x8ac5('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x8ac5('0xe')](_0x8ac5('0xf'));}else{var agents=require('./agents.controller');var calls=require(_0x8ac5('0x10'));var queues=require('./queues.controller');var recordings=require(_0x8ac5('0x11'));var members=require(_0x8ac5('0x12'));var dials=require(_0x8ac5('0x13'));var transfers=require(_0x8ac5('0x14'));var core=require(_0x8ac5('0x15'));ami['on']('connect',core[_0x8ac5('0x16')]);ami['on']('shutdown',core[_0x8ac5('0x17')]);ami['on'](_0x8ac5('0x18'),core[_0x8ac5('0x18')]);ami['on'](_0x8ac5('0x19'),core[_0x8ac5('0x19')]);ami['on']('close',core[_0x8ac5('0x1a')]);ami['on'](_0x8ac5('0x1b'),core['managerevent']);ami['on'](_0x8ac5('0x1c'),function(_0x1e5efd){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')]('[%s][index][devicestatechange]',_0x1e5efd['device']),_0x1e5efd);members[_0x8ac5('0x1c')](_0x1e5efd);}catch(_0x5ca518){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x1f'),_0x1e5efd[_0x8ac5('0x20')]),_0x5ca518);}});ami['on']('agentcalled',function(_0xdf89f5){try{utils[_0x8ac5('0x1d')](util['format'](_0x8ac5('0x21'),_0xdf89f5[_0x8ac5('0x22')]),_0xdf89f5);agents[_0x8ac5('0x23')](_0xdf89f5);}catch(_0x3151bc){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x21'),_0xdf89f5[_0x8ac5('0x22')]),_0x3151bc);}});ami['on']('agentringnoanswer',function(_0x4c0743){try{utils[_0x8ac5('0x1d')](util['format'](_0x8ac5('0x24'),_0x4c0743['uniqueid']),_0x4c0743);agents['agentringnoanswer'](_0x4c0743);}catch(_0x39ead7){utils[_0x8ac5('0x19')](util['format'](_0x8ac5('0x24'),_0x4c0743['uniqueid']),_0x39ead7);}});ami['on'](_0x8ac5('0x25'),function(_0x1f7099){try{utils[_0x8ac5('0x1d')](util['format'](_0x8ac5('0x26'),_0x1f7099[_0x8ac5('0x22')]),_0x1f7099);agents[_0x8ac5('0x25')](_0x1f7099);queues[_0x8ac5('0x25')](_0x1f7099);}catch(_0x3a904e){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x26'),_0x1f7099[_0x8ac5('0x22')]),_0x3a904e);}});ami['on'](_0x8ac5('0x27'),function(_0x28f8f9){try{utils[_0x8ac5('0x1d')](util['format'](_0x8ac5('0x28'),_0x28f8f9[_0x8ac5('0x22')]),_0x28f8f9);agents[_0x8ac5('0x27')](_0x28f8f9);queues[_0x8ac5('0x27')](_0x28f8f9);members[_0x8ac5('0x27')](_0x28f8f9);}catch(_0x2263f3){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x28'),_0x28f8f9[_0x8ac5('0x22')]),_0x2263f3);}});ami['on'](_0x8ac5('0x29'),function(_0x173a81){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')](_0x8ac5('0x2a'),_0x173a81[_0x8ac5('0x22')]),_0x173a81);agents[_0x8ac5('0x29')](_0x173a81);queues[_0x8ac5('0x29')](_0x173a81);}catch(_0xdae6e2){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x2a'),_0x173a81[_0x8ac5('0x22')]),_0xdae6e2);}});ami['on']('queuecallerjoin',function(_0x19efe7){try{utils['debug'](util['format']('[%s][index][queuecallerjoin]',_0x19efe7[_0x8ac5('0x22')]),_0x19efe7);queues[_0x8ac5('0x2b')](_0x19efe7);recordings[_0x8ac5('0x2b')](_0x19efe7);}catch(_0x3696fc){utils['error'](util['format'](_0x8ac5('0x2c'),_0x19efe7['uniqueid']),_0x3696fc);}});ami['on'](_0x8ac5('0x2d'),function(_0x268196){try{utils['debug'](util[_0x8ac5('0x1e')](_0x8ac5('0x2e'),_0x268196[_0x8ac5('0x22')]),_0x268196);queues[_0x8ac5('0x2d')](_0x268196);}catch(_0x177929){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x2e'),_0x268196['uniqueid']),_0x177929);}});ami['on'](_0x8ac5('0x2f'),function(_0x180a84){try{utils['debug'](util[_0x8ac5('0x1e')](_0x8ac5('0x30'),_0x180a84[_0x8ac5('0x22')]),_0x180a84);queues[_0x8ac5('0x2f')](_0x180a84);calls[_0x8ac5('0x2f')](_0x180a84);}catch(_0x2f6e7f){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x30'),_0x180a84[_0x8ac5('0x22')]),_0x2f6e7f);}});ami['on']('musiconholdstop',function(_0x367386){try{utils['debug'](util['format'](_0x8ac5('0x31'),_0x367386[_0x8ac5('0x22')]),_0x367386);queues['musiconholdstop'](_0x367386);calls[_0x8ac5('0x32')](_0x367386);}catch(_0x429e89){utils[_0x8ac5('0x19')](util['format'](_0x8ac5('0x31'),_0x367386['uniqueid']),_0x429e89);}});ami['on']('newstate',function(_0x1dcc45){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')](_0x8ac5('0x33'),_0x1dcc45[_0x8ac5('0x22')]),_0x1dcc45);calls[_0x8ac5('0x34')](_0x1dcc45);recordings[_0x8ac5('0x34')](_0x1dcc45);}catch(_0x21aa43){utils['error'](util[_0x8ac5('0x1e')](_0x8ac5('0x33'),_0x1dcc45[_0x8ac5('0x22')]),_0x21aa43);}});ami['on'](_0x8ac5('0x35'),function(_0x1fbeff){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')](_0x8ac5('0x36'),_0x1fbeff[_0x8ac5('0x22')]),_0x1fbeff);calls['hangup'](_0x1fbeff);recordings['hangup'](_0x1fbeff);dials[_0x8ac5('0x35')](_0x1fbeff);agents[_0x8ac5('0x35')](_0x1fbeff);queues[_0x8ac5('0x35')](_0x1fbeff);}catch(_0x5d20db){utils['error'](util[_0x8ac5('0x1e')](_0x8ac5('0x36'),_0x1fbeff[_0x8ac5('0x22')]),_0x5d20db);}});ami['on'](_0x8ac5('0x37'),function(_0xb0e37d){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')]('[%s][index][cdr]',_0xb0e37d[_0x8ac5('0x22')]),_0xb0e37d);members[_0x8ac5('0x37')](_0xb0e37d);}catch(_0x1d24bf){utils[_0x8ac5('0x19')](util['format'](_0x8ac5('0x38'),_0xb0e37d[_0x8ac5('0x22')]),_0x1d24bf);}});ami['on']('blindtransfer',function(_0x3f2c1f){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')]('[%s][index][blindtransfer]',_0x3f2c1f['uniqueid']),_0x3f2c1f);queues[_0x8ac5('0x39')](_0x3f2c1f);agents['blindtransfer'](_0x3f2c1f);transfers[_0x8ac5('0x39')](_0x3f2c1f);}catch(_0x46c06d){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x3a'),_0x3f2c1f[_0x8ac5('0x22')]),_0x46c06d);}});ami['on'](_0x8ac5('0x3b'),function(_0x1e3d87){try{utils['debug'](util[_0x8ac5('0x1e')]('[%s][index][attendedtransfer]',_0x1e3d87['origtransfereruniqueid']),_0x1e3d87);queues['attendedtransfer'](_0x1e3d87);transfers[_0x8ac5('0x3b')](_0x1e3d87);agents[_0x8ac5('0x3b')](_0x1e3d87);calls[_0x8ac5('0x3b')](_0x1e3d87);}catch(_0xaa66b0){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x3c'),_0x1e3d87[_0x8ac5('0x3d')]),_0xaa66b0);}});ami['on'](_0x8ac5('0x3e'),function(_0x116c79){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')](_0x8ac5('0x3f'),_0x116c79[_0x8ac5('0x22')]),_0x116c79);queues[_0x8ac5('0x3e')](_0x116c79);recordings['varset'](_0x116c79);calls[_0x8ac5('0x3e')](_0x116c79);dials[_0x8ac5('0x3e')](_0x116c79);}catch(_0x5da6c6){utils['error'](util[_0x8ac5('0x1e')]('[%s][index][varset]',_0x116c79[_0x8ac5('0x22')]),_0x5da6c6);}});ami['on'](_0x8ac5('0x40'),function(_0xd7cbfd){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')]('[%s][index][newexten]',_0xd7cbfd[_0x8ac5('0x22')]),_0xd7cbfd);calls[_0x8ac5('0x40')](_0xd7cbfd);recordings[_0x8ac5('0x40')](_0xd7cbfd);dials['newexten'](_0xd7cbfd);}catch(_0x6468ec){utils[_0x8ac5('0x19')](util['format']('[%s][index][newexten]',_0xd7cbfd['uniqueid']),_0x6468ec);}});ami['on'](_0x8ac5('0x41'),function(_0x41ab46){try{utils[_0x8ac5('0x1d')](util[_0x8ac5('0x1e')]('[%s][index][newchannel]',_0x41ab46['uniqueid']),_0x41ab46);calls[_0x8ac5('0x41')](_0x41ab46);recordings[_0x8ac5('0x41')](_0x41ab46);}catch(_0x2d2df7){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')](_0x8ac5('0x42'),_0x41ab46[_0x8ac5('0x22')]),_0x2d2df7);}});ami['on']('dialbegin',function(_0x55561b){try{utils['debug'](util[_0x8ac5('0x1e')](_0x8ac5('0x43'),_0x55561b[_0x8ac5('0x22')]),_0x55561b);dials[_0x8ac5('0x44')](_0x55561b);}catch(_0x478ba0){utils['error'](util['format'](_0x8ac5('0x45'),_0x55561b[_0x8ac5('0x22')]),_0x478ba0);}});ami['on'](_0x8ac5('0x46'),function(_0x384141){try{utils[_0x8ac5('0x1d')](util['format'](_0x8ac5('0x47'),_0x384141[_0x8ac5('0x22')]),_0x384141);dials[_0x8ac5('0x46')](_0x384141);}catch(_0x5a81c6){utils[_0x8ac5('0x19')](util[_0x8ac5('0x1e')]('[%s][index][dialend]',_0x384141[_0x8ac5('0x22')]),_0x5a81c6);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 8fdd40e..a7a4fb6 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 _0x26ab=['[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','queue','assign','cdr','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','error','some','devicestatechange'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x26ab,0x117));var _0xb26a=function(_0x333159,_0x68262e){_0x333159=_0x333159-0x0;var _0x2e29ac=_0x26ab[_0x333159];return _0x2e29ac;};'use strict';var _=require('lodash');var util=require(_0xb26a('0x0'));var utils=require(_0xb26a('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xb26a('0x2')];function writeDB(_0x1504df){utils[_0xb26a('0x3')](util[_0xb26a('0x4')](_0xb26a('0x5'),_0x1504df[_0xb26a('0x6')],_0x1504df[_0xb26a('0x7')],_0x1504df[_0xb26a('0x8')],_0x1504df['data2'],_0x1504df[_0xb26a('0x9')],_0x1504df[_0xb26a('0xa')]));if(_0x1504df['interface']){utils[_0xb26a('0xb')](_0x1504df[_0xb26a('0x7')])[_0xb26a('0xc')](function(_0xb56f4c){if(_0xb56f4c){_0x1504df[_0xb26a('0x9')]=_0xb56f4c[_0xb26a('0xd')];_0x1504df[_0xb26a('0xe')]=_0xb56f4c[_0xb26a('0xe')];utils[_0xb26a('0xf')]('CreateMemberReport',_0x1504df);}else{utils[_0xb26a('0x10')](_0x1504df[_0xb26a('0x7')][_0xb26a('0x11')]('/')[0x1])['then'](function(_0x3f97f2){if(_0x3f97f2){_0x1504df[_0xb26a('0x9')]=_0x3f97f2[_0xb26a('0xd')];_0x1504df['internal']=_0x3f97f2['internal'];utils[_0xb26a('0xf')]('CreateMemberReport',_0x1504df);}});}})['catch'](function(_0x55735c){utils[_0xb26a('0x12')](util[_0xb26a('0x4')]('[%s][members][writeDB]',_0x1504df['uniqueid']),_0x55735c);});}delete members[_0x1504df[_0xb26a('0x7')]];}function startsWith(_0x83b3e9,_0x30b399){return _[_0xb26a('0x13')](_0x83b3e9,function(_0x53e9fd){return _['startsWith'](_0x30b399,_0x53e9fd);});}exports[_0xb26a('0x14')]=function(_0x49d824){try{utils['debug'](util['format'](_0xb26a('0x15'),members[_0x49d824[_0xb26a('0x16')]]?members[_0x49d824[_0xb26a('0x16')]][_0xb26a('0x6')]:_0x49d824[_0xb26a('0x16')]),_0x49d824);utils[_0xb26a('0x3')](util[_0xb26a('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x49d824[_0xb26a('0x16')]]?members[_0x49d824[_0xb26a('0x16')]][_0xb26a('0x6')]:_0x49d824['device'],_0x49d824[_0xb26a('0x17')],_0x49d824[_0xb26a('0x16')]));switch(_0x49d824[_0xb26a('0x17')]){case _0xb26a('0x18'):case _0xb26a('0x19'):if(!startsWith(exclude,_0x49d824['device'])){members[_0x49d824[_0xb26a('0x16')]]={'channel':_0xb26a('0x1a'),'interface':_0x49d824[_0xb26a('0x16')],'type':_0xb26a('0x1b'),'enterAt':utils[_0xb26a('0x1c')](),'role':_0xb26a('0x1d')};}break;case _0xb26a('0x1e'):if(!_[_0xb26a('0x1f')](members[_0x49d824[_0xb26a('0x16')]])){members[_0x49d824[_0xb26a('0x16')]][_0xb26a('0x20')]=utils[_0xb26a('0x1c')]();members[_0x49d824[_0xb26a('0x16')]][_0xb26a('0x21')]=utils[_0xb26a('0x22')](members[_0x49d824[_0xb26a('0x16')]][_0xb26a('0x20')],members[_0x49d824['device']][_0xb26a('0x23')]);if(members[_0x49d824[_0xb26a('0x16')]]['uniqueid']){writeDB(members[_0x49d824['device']]);}}break;default:break;}}catch(_0x13626f){utils[_0xb26a('0x12')](util[_0xb26a('0x4')](_0xb26a('0x15'),members[_0x49d824[_0xb26a('0x16')]]?members[_0x49d824[_0xb26a('0x16')]][_0xb26a('0x6')]:_0x49d824[_0xb26a('0x16')]),_0x13626f);}};exports[_0xb26a('0x24')]=function(_0x2b265e){try{if(!_[_0xb26a('0x1f')](members[_0x2b265e[_0xb26a('0x7')]])){utils[_0xb26a('0x25')](util[_0xb26a('0x4')](_0xb26a('0x26'),_0x2b265e['uniqueid']),_0x2b265e);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2b265e[_0xb26a('0x6')],_0x2b265e[_0xb26a('0x7')],_0x2b265e[_0xb26a('0x27')]));members[_0x2b265e[_0xb26a('0x7')]]=_[_0xb26a('0x28')](members[_0x2b265e[_0xb26a('0x7')]],{'data4':_0x2b265e[_0xb26a('0x27')],'uniqueid':_0x2b265e[_0xb26a('0x6')]});}}catch(_0xf696bd){utils[_0xb26a('0x12')](util[_0xb26a('0x4')](_0xb26a('0x26'),_0x2b265e[_0xb26a('0x6')]),_0xf696bd);}};exports[_0xb26a('0x29')]=function(_0x322d13){try{utils[_0xb26a('0x25')](util['format']('[%s][members][cdr]',_0x322d13[_0xb26a('0x6')]),_0x322d13);if(_0x322d13[_0xb26a('0x8')]){var _0x1f5ac9=_0x322d13[_0xb26a('0x8')][_0xb26a('0x11')]('-')[0x0];if(!_['isNil'](members[_0x1f5ac9])){members[_0x1f5ac9]=_[_0xb26a('0x28')](members[_0x1f5ac9],{'data1':members[_0x1f5ac9][_0xb26a('0x2a')]||_0x322d13['type'],'data2':members[_0x1f5ac9][_0xb26a('0x2b')]||_0x322d13[_0xb26a('0x2c')],'data3':members[_0x1f5ac9][_0xb26a('0x2d')]||_0x322d13[_0xb26a('0x2e')],'uniqueid':members[_0x1f5ac9][_0xb26a('0x6')]||_0x322d13['uniqueid']});utils[_0xb26a('0x3')](util[_0xb26a('0x4')](_0xb26a('0x2f'),_0x322d13[_0xb26a('0x6')],members[_0x1f5ac9][_0xb26a('0x2a')],members[_0x1f5ac9][_0xb26a('0x2b')],members[_0x1f5ac9][_0xb26a('0x2d')]));if(members[_0x1f5ac9][_0xb26a('0x20')]){writeDB(members[_0x1f5ac9]);}}}if(_0x322d13[_0xb26a('0x30')]){var _0x4607c6=_0x322d13[_0xb26a('0x30')][_0xb26a('0x11')]('-')[0x0];if(!_['isNil'](members[_0x4607c6])){members[_0x4607c6]=_[_0xb26a('0x28')](members[_0x4607c6],{'data1':members[_0x4607c6][_0xb26a('0x2a')]||_0x322d13[_0xb26a('0xa')],'data2':members[_0x4607c6]['data2']||_0x322d13['source'],'data3':members[_0x4607c6][_0xb26a('0x2d')]||_0x322d13[_0xb26a('0x2e')],'uniqueid':members[_0x4607c6][_0xb26a('0x6')]||_0x322d13[_0xb26a('0x6')]});utils[_0xb26a('0x3')](util['format'](_0xb26a('0x2f'),_0x322d13[_0xb26a('0x6')],members[_0x4607c6][_0xb26a('0x2a')],members[_0x4607c6][_0xb26a('0x2b')],members[_0x4607c6][_0xb26a('0x2d')]));if(members[_0x4607c6][_0xb26a('0x20')]){writeDB(members[_0x4607c6]);}}}}catch(_0x37ae7a){utils['error'](util[_0xb26a('0x4')](_0xb26a('0x31'),_0x322d13[_0xb26a('0x6')]),_0x37ae7a);}}; \ No newline at end of file +var _0x2295=['name','internal','request','getUserByName','split','[%s][members][writeDB]','debug','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data3','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then'];(function(_0x482d06,_0x1c7c4a){var _0x3bdd88=function(_0x476f12){while(--_0x476f12){_0x482d06['push'](_0x482d06['shift']());}};_0x3bdd88(++_0x1c7c4a);}(_0x2295,0xb6));var _0x5229=function(_0x4d800b,_0x447e9e){_0x4d800b=_0x4d800b-0x0;var _0x594635=_0x2295[_0x4d800b];return _0x594635;};'use strict';var _=require('lodash');var util=require(_0x5229('0x0'));var utils=require(_0x5229('0x1'));var members={};var exclude=[_0x5229('0x2'),_0x5229('0x3')];function writeDB(_0x4b6b8e){utils['info'](util[_0x5229('0x4')](_0x5229('0x5'),_0x4b6b8e[_0x5229('0x6')],_0x4b6b8e['interface'],_0x4b6b8e[_0x5229('0x7')],_0x4b6b8e[_0x5229('0x8')],_0x4b6b8e[_0x5229('0x9')],_0x4b6b8e[_0x5229('0xa')]));if(_0x4b6b8e[_0x5229('0xb')]){utils[_0x5229('0xc')](_0x4b6b8e['interface'])[_0x5229('0xd')](function(_0x159bd7){if(_0x159bd7){_0x4b6b8e[_0x5229('0x9')]=_0x159bd7[_0x5229('0xe')];_0x4b6b8e[_0x5229('0xf')]=_0x159bd7[_0x5229('0xf')];utils[_0x5229('0x10')]('CreateMemberReport',_0x4b6b8e);}else{utils[_0x5229('0x11')](_0x4b6b8e[_0x5229('0xb')][_0x5229('0x12')]('/')[0x1])[_0x5229('0xd')](function(_0x3d6de9){if(_0x3d6de9){_0x4b6b8e[_0x5229('0x9')]=_0x3d6de9[_0x5229('0xe')];_0x4b6b8e[_0x5229('0xf')]=_0x3d6de9[_0x5229('0xf')];utils[_0x5229('0x10')]('CreateMemberReport',_0x4b6b8e);}});}})['catch'](function(_0x55ff55){utils['error'](util[_0x5229('0x4')](_0x5229('0x13'),_0x4b6b8e[_0x5229('0x6')]),_0x55ff55);});}delete members[_0x4b6b8e[_0x5229('0xb')]];}function startsWith(_0x24fb23,_0x50a69c){return _['some'](_0x24fb23,function(_0xeaa54e){return _['startsWith'](_0x50a69c,_0xeaa54e);});}exports['devicestatechange']=function(_0x8bc8cd){try{utils[_0x5229('0x14')](util[_0x5229('0x4')]('[%s][members][devicestatechange]',members[_0x8bc8cd[_0x5229('0x15')]]?members[_0x8bc8cd[_0x5229('0x15')]][_0x5229('0x6')]:_0x8bc8cd[_0x5229('0x15')]),_0x8bc8cd);utils[_0x5229('0x16')](util[_0x5229('0x4')](_0x5229('0x17'),members[_0x8bc8cd[_0x5229('0x15')]]?members[_0x8bc8cd[_0x5229('0x15')]][_0x5229('0x6')]:_0x8bc8cd[_0x5229('0x15')],_0x8bc8cd[_0x5229('0x18')],_0x8bc8cd[_0x5229('0x15')]));switch(_0x8bc8cd['state']){case _0x5229('0x19'):case _0x5229('0x1a'):if(!startsWith(exclude,_0x8bc8cd[_0x5229('0x15')])){members[_0x8bc8cd[_0x5229('0x15')]]={'channel':_0x5229('0x1b'),'interface':_0x8bc8cd['device'],'type':_0x5229('0x1c'),'enterAt':utils[_0x5229('0x1d')](),'role':'agent'};}break;case _0x5229('0x1e'):if(!_[_0x5229('0x1f')](members[_0x8bc8cd[_0x5229('0x15')]])){members[_0x8bc8cd['device']][_0x5229('0x20')]=utils[_0x5229('0x1d')]();members[_0x8bc8cd[_0x5229('0x15')]][_0x5229('0x21')]=utils[_0x5229('0x22')](members[_0x8bc8cd[_0x5229('0x15')]][_0x5229('0x20')],members[_0x8bc8cd[_0x5229('0x15')]][_0x5229('0x23')]);if(members[_0x8bc8cd[_0x5229('0x15')]][_0x5229('0x6')]){writeDB(members[_0x8bc8cd[_0x5229('0x15')]]);}}break;default:break;}}catch(_0x38a9e6){utils[_0x5229('0x24')](util[_0x5229('0x4')](_0x5229('0x25'),members[_0x8bc8cd[_0x5229('0x15')]]?members[_0x8bc8cd[_0x5229('0x15')]][_0x5229('0x6')]:_0x8bc8cd[_0x5229('0x15')]),_0x38a9e6);}};exports[_0x5229('0x26')]=function(_0x58bc77){try{if(!_[_0x5229('0x1f')](members[_0x58bc77[_0x5229('0xb')]])){utils[_0x5229('0x14')](util[_0x5229('0x4')]('[%s][members][agentcomplete]',_0x58bc77[_0x5229('0x6')]),_0x58bc77);utils[_0x5229('0x16')](util[_0x5229('0x4')](_0x5229('0x27'),_0x58bc77['uniqueid'],_0x58bc77[_0x5229('0xb')],_0x58bc77[_0x5229('0x28')]));members[_0x58bc77[_0x5229('0xb')]]=_[_0x5229('0x29')](members[_0x58bc77[_0x5229('0xb')]],{'data4':_0x58bc77[_0x5229('0x28')],'uniqueid':_0x58bc77[_0x5229('0x6')]});}}catch(_0x26c2bb){utils[_0x5229('0x24')](util['format']('[%s][members][agentcomplete]',_0x58bc77[_0x5229('0x6')]),_0x26c2bb);}};exports[_0x5229('0x2a')]=function(_0x34b7fd){try{utils[_0x5229('0x14')](util[_0x5229('0x4')]('[%s][members][cdr]',_0x34b7fd[_0x5229('0x6')]),_0x34b7fd);if(_0x34b7fd[_0x5229('0x7')]){var _0x15b636=_0x34b7fd[_0x5229('0x7')][_0x5229('0x12')]('-')[0x0];if(!_[_0x5229('0x1f')](members[_0x15b636])){members[_0x15b636]=_[_0x5229('0x29')](members[_0x15b636],{'data1':members[_0x15b636][_0x5229('0x2b')]||_0x34b7fd[_0x5229('0xa')],'data2':members[_0x15b636][_0x5229('0x8')]||_0x34b7fd[_0x5229('0x2c')],'data3':members[_0x15b636]['data3']||_0x34b7fd[_0x5229('0x2d')],'uniqueid':members[_0x15b636]['uniqueid']||_0x34b7fd[_0x5229('0x6')]});utils[_0x5229('0x16')](util[_0x5229('0x4')](_0x5229('0x2e'),_0x34b7fd['uniqueid'],members[_0x15b636]['data1'],members[_0x15b636]['data2'],members[_0x15b636]['data3']));if(members[_0x15b636][_0x5229('0x20')]){writeDB(members[_0x15b636]);}}}if(_0x34b7fd[_0x5229('0x2f')]){var _0x3b08ac=_0x34b7fd[_0x5229('0x2f')][_0x5229('0x12')]('-')[0x0];if(!_['isNil'](members[_0x3b08ac])){members[_0x3b08ac]=_['assign'](members[_0x3b08ac],{'data1':members[_0x3b08ac][_0x5229('0x2b')]||_0x34b7fd[_0x5229('0xa')],'data2':members[_0x3b08ac][_0x5229('0x8')]||_0x34b7fd[_0x5229('0x2c')],'data3':members[_0x3b08ac]['data3']||_0x34b7fd[_0x5229('0x2d')],'uniqueid':members[_0x3b08ac][_0x5229('0x6')]||_0x34b7fd[_0x5229('0x6')]});utils[_0x5229('0x16')](util['format'](_0x5229('0x2e'),_0x34b7fd[_0x5229('0x6')],members[_0x3b08ac][_0x5229('0x2b')],members[_0x3b08ac][_0x5229('0x8')],members[_0x3b08ac][_0x5229('0x30')]));if(members[_0x3b08ac]['exitAt']){writeDB(members[_0x3b08ac]);}}}}catch(_0x4b0536){utils[_0x5229('0x24')](util[_0x5229('0x4')]('[%s][members][cdr]',_0x34b7fd[_0x5229('0x6')]),_0x4b0536);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 609c52e..62f4a8c 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 _0xa6f5=['variable','queuestatus','toUpperCase','isNil','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','transfertype','ATTENDED','secondtransfererexten','transfertargetlinkedid','holdtime','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','uniqueid','position','assign','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','name','varset','[%s][queues][varset]'];(function(_0x2661c1,_0x33e260){var _0x2f9e3f=function(_0x1e6a84){while(--_0x1e6a84){_0x2661c1['push'](_0x2661c1['shift']());}};_0x2f9e3f(++_0x33e260);}(_0xa6f5,0x11a));var _0x5a6f=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xa6f5[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x5a6f('0x0'));var util=require(_0x5a6f('0x1'));var utils=require(_0x5a6f('0x2'));var queues={};function writeDB(_0x252ea2){utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x252ea2['uniqueid'],_0x252ea2['channel'],_0x252ea2[_0x5a6f('0x5')],_0x252ea2[_0x5a6f('0x6')],_0x252ea2['calleridnum'],_0x252ea2['accountcode'],_0x252ea2[_0x5a6f('0x7')]));if(_0x252ea2[_0x5a6f('0x5')]){utils[_0x5a6f('0x8')](_0x252ea2[_0x5a6f('0x5')])[_0x5a6f('0x9')](function(_0x1ea024){if(_0x1ea024){_0x252ea2['type']=_0x1ea024[_0x5a6f('0xa')];}utils[_0x5a6f('0xb')](_0x5a6f('0xc'),_0x252ea2);});}else{utils[_0x5a6f('0xb')](_0x5a6f('0xc'),_0x252ea2);}if(_0x252ea2[_0x5a6f('0xd')]){delete queues[_0x252ea2[_0x5a6f('0xd')]];}else{delete queues[_0x252ea2['uniqueid']];}}exports[_0x5a6f('0xe')]=function(_0x493d70){try{utils[_0x5a6f('0xf')](util[_0x5a6f('0x4')](_0x5a6f('0x10'),_0x493d70['uniqueid']),_0x493d70);utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x11'),_0x493d70[_0x5a6f('0x12')],_0x493d70[_0x5a6f('0x5')],_0x493d70[_0x5a6f('0x13')]));queues[_0x493d70[_0x5a6f('0x12')]]=_[_0x5a6f('0x14')](_0x493d70,{'originalposition':_0x493d70[_0x5a6f('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x359d13){utils[_0x5a6f('0x15')](util[_0x5a6f('0x4')](_0x5a6f('0x10'),_0x493d70['uniqueid']),_0x359d13);}};exports[_0x5a6f('0x16')]=function(_0x3d6373){try{if(!_['isNil'](queues[_0x3d6373[_0x5a6f('0x12')]])){utils[_0x5a6f('0xf')](util[_0x5a6f('0x4')](_0x5a6f('0x17'),_0x3d6373[_0x5a6f('0x12')]),_0x3d6373);if(queues[_0x3d6373['uniqueid']][_0x5a6f('0x18')]){if(!queues[_0x3d6373[_0x5a6f('0x12')]]['queuecallerabandon']&&!queues[_0x3d6373[_0x5a6f('0x12')]][_0x5a6f('0x19')]){queues[_0x3d6373[_0x5a6f('0x12')]][_0x5a6f('0x1a')]=!![];queues[_0x3d6373['uniqueid']][_0x5a6f('0x1b')]=utils[_0x5a6f('0x1c')]();queues[_0x3d6373[_0x5a6f('0x12')]]['queuecallerexitreason']=_0x5a6f('0x1d');}utils['info'](util[_0x5a6f('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x3d6373[_0x5a6f('0x12')],queues[_0x3d6373['uniqueid']][_0x5a6f('0x1e')],queues[_0x3d6373[_0x5a6f('0x12')]]['queuecallerexitreason']));writeDB(queues[_0x3d6373[_0x5a6f('0x12')]]);}else if(queues[_0x3d6373[_0x5a6f('0x12')]]['transfereduniqueid']){utils[_0x5a6f('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x3d6373[_0x5a6f('0x12')],queues[_0x3d6373[_0x5a6f('0x12')]][_0x5a6f('0x1e')],queues[_0x3d6373[_0x5a6f('0x12')]][_0x5a6f('0xd')]));queues[queues[_0x3d6373[_0x5a6f('0x12')]][_0x5a6f('0xd')]]=queues[_0x3d6373[_0x5a6f('0x12')]];queues[queues[_0x3d6373['uniqueid']][_0x5a6f('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0x3d6373[_0x5a6f('0x12')]];}}}catch(_0x39e22a){utils[_0x5a6f('0x15')](util[_0x5a6f('0x4')](_0x5a6f('0x17'),_0x3d6373[_0x5a6f('0x12')]),_0x39e22a);}};exports[_0x5a6f('0x1f')]=function(_0x52fd99){try{utils[_0x5a6f('0xf')](util[_0x5a6f('0x4')](_0x5a6f('0x20'),_0x52fd99[_0x5a6f('0x12')]),_0x52fd99);if(!_['isNil'](_0x52fd99[_0x5a6f('0x21')][_0x5a6f('0x22')])&&_0x52fd99['value'][_0x5a6f('0x23')]()!=='CONTINUE'){if(!_[_0x5a6f('0x24')](queues[_0x52fd99[_0x5a6f('0x12')]])){queues[_0x52fd99[_0x5a6f('0x12')]][_0x5a6f('0x25')]=![];queues[_0x52fd99[_0x5a6f('0x12')]][_0x5a6f('0x26')]=null;queues[_0x52fd99[_0x5a6f('0x12')]][_0x5a6f('0x19')]=!![];queues[_0x52fd99[_0x5a6f('0x12')]][_0x5a6f('0x27')]=utils[_0x5a6f('0x1c')]();queues[_0x52fd99[_0x5a6f('0x12')]]['queuecallerexitreason']=_0x52fd99['value']['toUpperCase']();utils[_0x5a6f('0x3')](util['format'](_0x5a6f('0x28'),_0x52fd99[_0x5a6f('0x12')],queues[_0x52fd99[_0x5a6f('0x12')]]['name'],_0x52fd99[_0x5a6f('0x29')],queues[_0x52fd99['uniqueid']][_0x5a6f('0x7')]));writeDB(queues[_0x52fd99[_0x5a6f('0x12')]]);}}else if(!_[_0x5a6f('0x24')](_0x52fd99['variable'][_0x5a6f('0x2a')])){if(!_['isNil'](queues[_0x52fd99['uniqueid']])&&!queues[_0x52fd99['uniqueid']][_0x5a6f('0x25')]){queues[_0x52fd99['uniqueid']]['queuecallerabandon']=![];queues[_0x52fd99[_0x5a6f('0x12')]][_0x5a6f('0x26')]=null;queues[_0x52fd99['uniqueid']][_0x5a6f('0x19')]=!![];queues[_0x52fd99['uniqueid']][_0x5a6f('0x27')]=utils[_0x5a6f('0x1c')]();queues[_0x52fd99['uniqueid']][_0x5a6f('0x7')]='EXITWITHKEY';utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x2b'),_0x52fd99[_0x5a6f('0x12')],queues[_0x52fd99[_0x5a6f('0x12')]][_0x5a6f('0x1e')],_0x52fd99[_0x5a6f('0x29')],queues[_0x52fd99['uniqueid']]['queuecallerexitreason']));}}}catch(_0x18b5c7){utils[_0x5a6f('0x15')](util[_0x5a6f('0x4')](_0x5a6f('0x20'),_0x52fd99[_0x5a6f('0x12')]),_0x18b5c7);}};exports['queuecallerabandon']=function(_0x47f045){try{if(!_['isNil'](queues[_0x47f045['uniqueid']])){utils['debug'](util['format']('[%s][queues][queuecallerabandon]',_0x47f045[_0x5a6f('0x12')]),_0x47f045);queues[_0x47f045[_0x5a6f('0x12')]][_0x5a6f('0x19')]=![];queues[_0x47f045[_0x5a6f('0x12')]][_0x5a6f('0x27')]=null;queues[_0x47f045['uniqueid']][_0x5a6f('0x25')]=!![];queues[_0x47f045[_0x5a6f('0x12')]][_0x5a6f('0x26')]=utils[_0x5a6f('0x1c')]();queues[_0x47f045['uniqueid']][_0x5a6f('0x7')]=_0x5a6f('0x2c');utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x47f045[_0x5a6f('0x12')],queues[_0x47f045[_0x5a6f('0x12')]][_0x5a6f('0x1e')],queues[_0x47f045['uniqueid']][_0x5a6f('0x7')]));}}catch(_0x5bb541){utils['error'](util[_0x5a6f('0x4')](_0x5a6f('0x2d'),_0x47f045[_0x5a6f('0x12')]),_0x5bb541);}};exports[_0x5a6f('0x2e')]=function(_0x4e5276){try{if(!_['isNil'](queues[_0x4e5276[_0x5a6f('0x12')]])){utils['debug'](util['format'](_0x5a6f('0x2f'),_0x4e5276[_0x5a6f('0x12')]),_0x4e5276);utils['info'](util[_0x5a6f('0x4')](_0x5a6f('0x30'),_0x4e5276['uniqueid'],queues[_0x4e5276[_0x5a6f('0x12')]][_0x5a6f('0x1e')],_0x4e5276[_0x5a6f('0x31')],_0x4e5276['connectedlinename']));queues[_0x4e5276[_0x5a6f('0x12')]]['queuecallerleave']=!![];queues[_0x4e5276[_0x5a6f('0x12')]]['queuecallerleaveAt']=utils[_0x5a6f('0x1c')]();queues[_0x4e5276[_0x5a6f('0x12')]]['holdtime']=utils[_0x5a6f('0x32')](queues[_0x4e5276['uniqueid']][_0x5a6f('0x18')],queues[_0x4e5276[_0x5a6f('0x12')]]['queuecallerjoinAt']);queues[_0x4e5276[_0x5a6f('0x12')]][_0x5a6f('0x13')]=_0x4e5276[_0x5a6f('0x13')];queues[_0x4e5276[_0x5a6f('0x12')]][_0x5a6f('0x33')]=_0x4e5276[_0x5a6f('0x33')];queues[_0x4e5276['uniqueid']][_0x5a6f('0x31')]=_0x4e5276[_0x5a6f('0x31')];queues[_0x4e5276[_0x5a6f('0x12')]][_0x5a6f('0x34')]=_0x4e5276[_0x5a6f('0x34')];}}catch(_0x124b40){utils['error'](util[_0x5a6f('0x4')](_0x5a6f('0x2f'),_0x4e5276['uniqueid']),_0x124b40);}};exports[_0x5a6f('0x35')]=function(_0x5909f0){try{if(!_[_0x5a6f('0x24')](queues[_0x5909f0[_0x5a6f('0x12')]])){utils[_0x5a6f('0xf')](util[_0x5a6f('0x4')](_0x5a6f('0x36'),_0x5909f0[_0x5a6f('0x12')]),_0x5909f0);utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x37'),_0x5909f0[_0x5a6f('0x12')],queues[_0x5909f0['uniqueid']][_0x5a6f('0x1e')],_0x5909f0[_0x5a6f('0x38')],_0x5909f0[_0x5a6f('0x39')]));queues[_0x5909f0[_0x5a6f('0x12')]][_0x5a6f('0x25')]=![];queues[_0x5909f0[_0x5a6f('0x12')]][_0x5a6f('0x25')]=![];queues[_0x5909f0['uniqueid']][_0x5a6f('0x26')]=null;queues[_0x5909f0[_0x5a6f('0x12')]]['queuecallerexit']=![];queues[_0x5909f0[_0x5a6f('0x12')]][_0x5a6f('0x7')]=null;queues[_0x5909f0[_0x5a6f('0x12')]][_0x5a6f('0x27')]=null;queues[_0x5909f0[_0x5a6f('0x12')]][_0x5a6f('0x3a')]=!![];queues[_0x5909f0[_0x5a6f('0x12')]][_0x5a6f('0x3b')]=_0x5909f0[_0x5a6f('0x39')];queues[_0x5909f0['uniqueid']]['lastAssignedTo']=_0x5909f0['membername'];}}catch(_0x56defb){utils[_0x5a6f('0x15')](util[_0x5a6f('0x4')](_0x5a6f('0x36'),_0x5909f0[_0x5a6f('0x12')]),_0x56defb);}};exports[_0x5a6f('0x3c')]=function(_0x59dfbf){try{if(!_[_0x5a6f('0x24')](queues[_0x59dfbf['uniqueid']])){if(queues[_0x59dfbf[_0x5a6f('0x12')]]['queuecallerleaveAt']){utils[_0x5a6f('0xf')](util[_0x5a6f('0x4')](_0x5a6f('0x3d'),_0x59dfbf[_0x5a6f('0x12')]),_0x59dfbf);queues[_0x59dfbf[_0x5a6f('0x12')]]['queuecallerabandon']=![];queues[_0x59dfbf['uniqueid']]['queuecallerabandon']=![];queues[_0x59dfbf['uniqueid']][_0x5a6f('0x26')]=null;queues[_0x59dfbf[_0x5a6f('0x12')]][_0x5a6f('0x19')]=![];queues[_0x59dfbf['uniqueid']][_0x5a6f('0x27')]=null;queues[_0x59dfbf[_0x5a6f('0x12')]][_0x5a6f('0x3a')]=!![];queues[_0x59dfbf['uniqueid']][_0x5a6f('0x6')]=_0x59dfbf[_0x5a6f('0x38')];queues[_0x59dfbf[_0x5a6f('0x12')]]['queuecallercomplete']=!![];queues[_0x59dfbf[_0x5a6f('0x12')]][_0x5a6f('0x1b')]=utils['now']();if(_0x59dfbf[_0x5a6f('0x3e')]=='transfer'){if(!queues[_0x59dfbf['uniqueid']][_0x5a6f('0x3f')]){queues[_0x59dfbf[_0x5a6f('0x12')]][_0x5a6f('0x7')]=_0x5a6f('0x40');}}else{queues[_0x59dfbf[_0x5a6f('0x12')]][_0x5a6f('0x7')]=_0x5a6f('0x41')+_0x59dfbf[_0x5a6f('0x3e')][_0x5a6f('0x23')]();}utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x42'),_0x59dfbf[_0x5a6f('0x12')],queues[_0x59dfbf[_0x5a6f('0x12')]][_0x5a6f('0x1e')],_0x59dfbf[_0x5a6f('0x38')],queues[_0x59dfbf[_0x5a6f('0x12')]]['queuecallerexitreason']));writeDB(queues[_0x59dfbf[_0x5a6f('0x12')]]);}}}catch(_0x1a65ff){utils[_0x5a6f('0x15')](util[_0x5a6f('0x4')]('[%s][queues][agentcomplete]',_0x59dfbf[_0x5a6f('0x12')]),_0x1a65ff);}};exports[_0x5a6f('0x43')]=function(_0x14b29d){try{if(!_[_0x5a6f('0x24')](queues[_0x14b29d[_0x5a6f('0x44')]])){utils[_0x5a6f('0xf')](util['format'](_0x5a6f('0x45'),_0x14b29d[_0x5a6f('0x12')]),_0x14b29d);queues[_0x14b29d['transfereeuniqueid']][_0x5a6f('0x3f')]=!![];queues[_0x14b29d[_0x5a6f('0x44')]]['transfertype']='BLIND';queues[_0x14b29d[_0x5a6f('0x44')]][_0x5a6f('0x46')]=_0x14b29d[_0x5a6f('0x47')];queues[_0x14b29d[_0x5a6f('0x44')]][_0x5a6f('0x48')]=_0x14b29d[_0x5a6f('0x44')];queues[_0x14b29d[_0x5a6f('0x44')]][_0x5a6f('0x7')]=_0x5a6f('0x49');utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x4a'),_0x14b29d[_0x5a6f('0x12')],queues[_0x14b29d[_0x5a6f('0x44')]]['name'],_0x14b29d[_0x5a6f('0x44')],_0x14b29d[_0x5a6f('0x47')]));}}catch(_0x177eda){utils[_0x5a6f('0x15')](util[_0x5a6f('0x4')]('[%s][queues][blindtransfer]',_0x14b29d[_0x5a6f('0x12')]),_0x177eda);}};exports[_0x5a6f('0x4b')]=function(_0x3e223c){try{utils['debug'](util[_0x5a6f('0x4')](_0x5a6f('0x4c'),_0x3e223c[_0x5a6f('0x4d')]),_0x3e223c);if(_0x3e223c['origtransfereruniqueid']==_0x3e223c[_0x5a6f('0x4e')]){if(!_['isNil'](queues[_0x3e223c['secondtransfererlinkedid']])){utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x4f'),_0x3e223c['origtransfereruniqueid'],queues[_0x3e223c[_0x5a6f('0x50')]][_0x5a6f('0x1e')],_0x3e223c[_0x5a6f('0x51')]));queues[_0x3e223c['secondtransfererlinkedid']]['transfer']=!![];queues[_0x3e223c['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x3e223c[_0x5a6f('0x50')]][_0x5a6f('0x46')]=_0x3e223c[_0x5a6f('0x51')];queues[_0x3e223c[_0x5a6f('0x50')]][_0x5a6f('0x48')]=_0x3e223c[_0x5a6f('0x4d')];queues[_0x3e223c[_0x5a6f('0x50')]][_0x5a6f('0x7')]=_0x5a6f('0x52');}if(!_[_0x5a6f('0x24')](queues[_0x3e223c['origtransfererlinkedid']])){if(_0x3e223c[_0x5a6f('0x53')]&&queues[_0x3e223c['transfereelinkedid']]){queues[_0x3e223c[_0x5a6f('0x53')]][_0x5a6f('0x54')]=0x1;queues[_0x3e223c['transfereeuniqueid']]=_[_0x5a6f('0x55')](queues[_0x3e223c[_0x5a6f('0x53')]]);queues[_0x3e223c[_0x5a6f('0x44')]][_0x5a6f('0xd')]=_0x3e223c[_0x5a6f('0x56')];queues[_0x3e223c[_0x5a6f('0x44')]]['queuecallerenterreason']=0x2;queues[_0x3e223c['transfereeuniqueid']][_0x5a6f('0x57')]=queues[_0x3e223c['secondtransfererlinkedid']][_0x5a6f('0x57')];queues[_0x3e223c[_0x5a6f('0x44')]][_0x5a6f('0x58')]=queues[_0x3e223c[_0x5a6f('0x50')]]['calleridname'];queues[_0x3e223c['transfereeuniqueid']][_0x5a6f('0x59')]=utils[_0x5a6f('0x1c')]();queues[_0x3e223c[_0x5a6f('0x44')]][_0x5a6f('0x18')]=utils[_0x5a6f('0x1c')]();queues[_0x3e223c[_0x5a6f('0x44')]]['holdtime']=0x0;queues[_0x3e223c[_0x5a6f('0x44')]][_0x5a6f('0x5a')]=0x0;utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x5b'),_0x3e223c[_0x5a6f('0x4d')],queues[_0x3e223c[_0x5a6f('0x44')]]['name'],queues[_0x3e223c[_0x5a6f('0x44')]][_0x5a6f('0x57')],queues[_0x3e223c['transfereeuniqueid']][_0x5a6f('0x58')]));}else{utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x5c'),_0x3e223c[_0x5a6f('0x4d')],queues[_0x3e223c[_0x5a6f('0x4e')]][_0x5a6f('0x1e')],_0x3e223c[_0x5a6f('0x50')]));queues[_0x3e223c[_0x5a6f('0x4e')]][_0x5a6f('0xd')]=_0x3e223c[_0x5a6f('0x50')];}}}else if(_0x3e223c[_0x5a6f('0x5d')]==_0x3e223c['secondtransfererlinkedid']){if(!_[_0x5a6f('0x24')](queues[_0x3e223c[_0x5a6f('0x4e')]])){utils['info'](util[_0x5a6f('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3e223c[_0x5a6f('0x4d')],queues[_0x3e223c[_0x5a6f('0x4e')]][_0x5a6f('0x1e')],_0x3e223c['secondtransfereruniqueid'],_0x3e223c['secondtransfererexten']));queues[_0x3e223c['origtransfererlinkedid']]['transfer']=!![];queues[_0x3e223c['origtransfererlinkedid']][_0x5a6f('0x5e')]=_0x5a6f('0x5f');queues[_0x3e223c[_0x5a6f('0x4e')]][_0x5a6f('0x46')]=_0x3e223c[_0x5a6f('0x60')];queues[_0x3e223c[_0x5a6f('0x4e')]][_0x5a6f('0x48')]=_0x3e223c[_0x5a6f('0x5d')];queues[_0x3e223c['origtransfererlinkedid']][_0x5a6f('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x5a6f('0x24')](queues[_0x3e223c[_0x5a6f('0x50')]])){if(_0x3e223c[_0x5a6f('0x61')]&&queues[_0x3e223c[_0x5a6f('0x61')]]){queues[_0x3e223c[_0x5a6f('0x61')]][_0x5a6f('0x54')]=0x1;queues[_0x3e223c[_0x5a6f('0x56')]]=_['clone'](queues[_0x3e223c[_0x5a6f('0x61')]]);queues[_0x3e223c[_0x5a6f('0x56')]]['transfereduniqueid']=_0x3e223c[_0x5a6f('0x56')];queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x54')]=0x2;queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x57')]=queues[_0x3e223c[_0x5a6f('0x4e')]][_0x5a6f('0x57')];queues[_0x3e223c['transfertargetuniqueid']][_0x5a6f('0x58')]=queues[_0x3e223c[_0x5a6f('0x4e')]]['calleridname'];queues[_0x3e223c[_0x5a6f('0x56')]]['queuecallerjoinAt']=utils[_0x5a6f('0x1c')]();queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x18')]=utils[_0x5a6f('0x1c')]();queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x62')]=0x0;queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x5a')]=0x0;utils['info'](util[_0x5a6f('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x3e223c[_0x5a6f('0x4d')],queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x1e')],queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0xd')],queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x57')],queues[_0x3e223c[_0x5a6f('0x56')]][_0x5a6f('0x58')]));}else{utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')](_0x5a6f('0x5c'),_0x3e223c[_0x5a6f('0x4d')],queues[_0x3e223c[_0x5a6f('0x50')]][_0x5a6f('0x1e')],_0x3e223c[_0x5a6f('0x4e')]));queues[_0x3e223c['secondtransfererlinkedid']][_0x5a6f('0xd')]=_0x3e223c[_0x5a6f('0x4e')];}}}}catch(_0x52a2c3){utils['error'](util[_0x5a6f('0x4')]('[%s][queues][attendedtransfer]',_0x3e223c[_0x5a6f('0x4d')]),_0x52a2c3);}};exports[_0x5a6f('0x63')]=function(_0x351b7c){try{if(!_['isNil'](queues[_0x351b7c['uniqueid']])){utils[_0x5a6f('0xf')](util[_0x5a6f('0x4')](_0x5a6f('0x64'),_0x351b7c['uniqueid']),_0x351b7c);queues[_0x351b7c[_0x5a6f('0x12')]][_0x5a6f('0x65')]=utils[_0x5a6f('0x1c')]();utils['info'](util[_0x5a6f('0x4')](_0x5a6f('0x66'),_0x351b7c[_0x5a6f('0x12')],queues[_0x351b7c[_0x5a6f('0x12')]][_0x5a6f('0x1e')],queues[_0x351b7c['uniqueid']][_0x5a6f('0x65')]));}}catch(_0x5aee30){utils[_0x5a6f('0x15')](util[_0x5a6f('0x4')]('[%s][queues][musiconholdstart]',_0x351b7c[_0x5a6f('0x12')]),_0x5aee30);}};exports[_0x5a6f('0x67')]=function(_0x13e4f6){try{if(!_[_0x5a6f('0x24')](queues[_0x13e4f6[_0x5a6f('0x12')]])){if(!_[_0x5a6f('0x24')](queues[_0x13e4f6['uniqueid']][_0x5a6f('0x65')])){utils[_0x5a6f('0xf')](util[_0x5a6f('0x4')](_0x5a6f('0x68'),_0x13e4f6[_0x5a6f('0x12')]),_0x13e4f6);queues[_0x13e4f6['uniqueid']][_0x5a6f('0x5a')]+=utils[_0x5a6f('0x32')](utils[_0x5a6f('0x1c')](),queues[_0x13e4f6[_0x5a6f('0x12')]][_0x5a6f('0x65')]);utils[_0x5a6f('0x3')](util[_0x5a6f('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x13e4f6['uniqueid'],queues[_0x13e4f6[_0x5a6f('0x12')]][_0x5a6f('0x1e')],queues[_0x13e4f6[_0x5a6f('0x12')]]['mohtime']));delete queues[_0x13e4f6[_0x5a6f('0x12')]][_0x5a6f('0x65')];}}}catch(_0x1f91e8){utils['error'](util[_0x5a6f('0x4')]('[%s][queues][musiconholdstop]',_0x13e4f6['uniqueid']),_0x1f91e8);}}; \ No newline at end of file +var _0x5def=['calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','variable','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','accountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','transfertype','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid'];(function(_0x1ea338,_0x156226){var _0x2c428b=function(_0x1bcca9){while(--_0x1bcca9){_0x1ea338['push'](_0x1ea338['shift']());}};_0x2c428b(++_0x156226);}(_0x5def,0xdd));var _0xf5de=function(_0x81a26e,_0x4a6f01){_0x81a26e=_0x81a26e-0x0;var _0x343910=_0x5def[_0x81a26e];return _0x343910;};'use strict';var _=require(_0xf5de('0x0'));var util=require('util');var utils=require(_0xf5de('0x1'));var queues={};function writeDB(_0x4f60a7){utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x4'),_0x4f60a7['uniqueid'],_0x4f60a7[_0xf5de('0x5')],_0x4f60a7[_0xf5de('0x6')],_0x4f60a7['lastAssignedTo'],_0x4f60a7[_0xf5de('0x7')],_0x4f60a7['accountcode'],_0x4f60a7[_0xf5de('0x8')]));if(_0x4f60a7[_0xf5de('0x6')]){utils['getVoiceQueueByName'](_0x4f60a7[_0xf5de('0x6')])[_0xf5de('0x9')](function(_0x10d85){if(_0x10d85){_0x4f60a7[_0xf5de('0xa')]=_0x10d85[_0xf5de('0xa')];}utils[_0xf5de('0xb')]('CreateVoiceQueueReport',_0x4f60a7);});}else{utils['request'](_0xf5de('0xc'),_0x4f60a7);}if(_0x4f60a7['transfereduniqueid']){delete queues[_0x4f60a7[_0xf5de('0xd')]];}else{delete queues[_0x4f60a7[_0xf5de('0xe')]];}}exports['queuecallerjoin']=function(_0x10087f){try{utils[_0xf5de('0xf')](util[_0xf5de('0x3')](_0xf5de('0x10'),_0x10087f[_0xf5de('0xe')]),_0x10087f);utils['info'](util[_0xf5de('0x3')](_0xf5de('0x11'),_0x10087f[_0xf5de('0xe')],_0x10087f[_0xf5de('0x6')],_0x10087f[_0xf5de('0x12')]));queues[_0x10087f[_0xf5de('0xe')]]=_['assign'](_0x10087f,{'originalposition':_0x10087f['position'],'queuecallerjoinAt':utils[_0xf5de('0x13')](),'mohtime':0x0});}catch(_0x4962f5){utils[_0xf5de('0x14')](util[_0xf5de('0x3')](_0xf5de('0x10'),_0x10087f[_0xf5de('0xe')]),_0x4962f5);}};exports[_0xf5de('0x15')]=function(_0x591c0e){try{if(!_['isNil'](queues[_0x591c0e[_0xf5de('0xe')]])){utils['debug'](util[_0xf5de('0x3')](_0xf5de('0x16'),_0x591c0e[_0xf5de('0xe')]),_0x591c0e);if(queues[_0x591c0e['uniqueid']][_0xf5de('0x17')]){if(!queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0x18')]&&!queues[_0x591c0e[_0xf5de('0xe')]]['queuecallerexit']){queues[_0x591c0e[_0xf5de('0xe')]]['queuecallercomplete']=!![];queues[_0x591c0e['uniqueid']][_0xf5de('0x19')]=utils['now']();queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0x8')]=_0xf5de('0x1a');}utils['info'](util[_0xf5de('0x3')](_0xf5de('0x1b'),_0x591c0e['uniqueid'],queues[_0x591c0e[_0xf5de('0xe')]]['name'],queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0x8')]));writeDB(queues[_0x591c0e[_0xf5de('0xe')]]);}else if(queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0xd')]){utils[_0xf5de('0x2')](util[_0xf5de('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x591c0e[_0xf5de('0xe')],queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0x1c')],queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0xd')]));queues[queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0xd')]]=queues[_0x591c0e[_0xf5de('0xe')]];queues[queues[_0x591c0e[_0xf5de('0xe')]][_0xf5de('0xd')]][_0xf5de('0x1d')]=0x2;delete queues[_0x591c0e['uniqueid']];}}}catch(_0x46a54f){utils[_0xf5de('0x14')](util[_0xf5de('0x3')](_0xf5de('0x16'),_0x591c0e['uniqueid']),_0x46a54f);}};exports[_0xf5de('0x1e')]=function(_0x5e4018){try{utils[_0xf5de('0xf')](util[_0xf5de('0x3')](_0xf5de('0x1f'),_0x5e4018['uniqueid']),_0x5e4018);if(!_[_0xf5de('0x20')](_0x5e4018['variable']['queuestatus'])&&_0x5e4018['value'][_0xf5de('0x21')]()!==_0xf5de('0x22')){if(!_[_0xf5de('0x20')](queues[_0x5e4018[_0xf5de('0xe')]])){queues[_0x5e4018['uniqueid']][_0xf5de('0x18')]=![];queues[_0x5e4018[_0xf5de('0xe')]][_0xf5de('0x23')]=null;queues[_0x5e4018['uniqueid']][_0xf5de('0x24')]=!![];queues[_0x5e4018[_0xf5de('0xe')]]['queuecallerexitAt']=utils[_0xf5de('0x13')]();queues[_0x5e4018[_0xf5de('0xe')]][_0xf5de('0x8')]=_0x5e4018['value'][_0xf5de('0x21')]();utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x25'),_0x5e4018[_0xf5de('0xe')],queues[_0x5e4018['uniqueid']][_0xf5de('0x1c')],_0x5e4018[_0xf5de('0x26')],queues[_0x5e4018[_0xf5de('0xe')]][_0xf5de('0x8')]));writeDB(queues[_0x5e4018['uniqueid']]);}}else if(!_[_0xf5de('0x20')](_0x5e4018[_0xf5de('0x27')][_0xf5de('0x28')])){if(!_[_0xf5de('0x20')](queues[_0x5e4018[_0xf5de('0xe')]])&&!queues[_0x5e4018['uniqueid']]['queuecallerabandon']){queues[_0x5e4018[_0xf5de('0xe')]][_0xf5de('0x18')]=![];queues[_0x5e4018['uniqueid']][_0xf5de('0x23')]=null;queues[_0x5e4018['uniqueid']][_0xf5de('0x24')]=!![];queues[_0x5e4018[_0xf5de('0xe')]][_0xf5de('0x29')]=utils['now']();queues[_0x5e4018['uniqueid']][_0xf5de('0x8')]=_0xf5de('0x2a');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5e4018[_0xf5de('0xe')],queues[_0x5e4018['uniqueid']][_0xf5de('0x1c')],_0x5e4018[_0xf5de('0x26')],queues[_0x5e4018['uniqueid']][_0xf5de('0x8')]));}}}catch(_0x48b7bd){utils['error'](util[_0xf5de('0x3')](_0xf5de('0x1f'),_0x5e4018['uniqueid']),_0x48b7bd);}};exports['queuecallerabandon']=function(_0x1255b6){try{if(!_[_0xf5de('0x20')](queues[_0x1255b6[_0xf5de('0xe')]])){utils[_0xf5de('0xf')](util[_0xf5de('0x3')](_0xf5de('0x2b'),_0x1255b6[_0xf5de('0xe')]),_0x1255b6);queues[_0x1255b6[_0xf5de('0xe')]][_0xf5de('0x24')]=![];queues[_0x1255b6[_0xf5de('0xe')]][_0xf5de('0x29')]=null;queues[_0x1255b6[_0xf5de('0xe')]][_0xf5de('0x18')]=!![];queues[_0x1255b6[_0xf5de('0xe')]][_0xf5de('0x23')]=utils['now']();queues[_0x1255b6[_0xf5de('0xe')]][_0xf5de('0x8')]=_0xf5de('0x2c');utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x2d'),_0x1255b6[_0xf5de('0xe')],queues[_0x1255b6[_0xf5de('0xe')]][_0xf5de('0x1c')],queues[_0x1255b6[_0xf5de('0xe')]][_0xf5de('0x8')]));}}catch(_0xec5df6){utils[_0xf5de('0x14')](util['format']('[%s][queues][queuecallerabandon]',_0x1255b6[_0xf5de('0xe')]),_0xec5df6);}};exports[_0xf5de('0x2e')]=function(_0x1f44de){try{if(!_[_0xf5de('0x20')](queues[_0x1f44de[_0xf5de('0xe')]])){utils[_0xf5de('0xf')](util[_0xf5de('0x3')](_0xf5de('0x2f'),_0x1f44de[_0xf5de('0xe')]),_0x1f44de);utils[_0xf5de('0x2')](util[_0xf5de('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1f44de[_0xf5de('0xe')],queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x1c')],_0x1f44de[_0xf5de('0x30')],_0x1f44de[_0xf5de('0x31')]));queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x2e')]=!![];queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x17')]=utils[_0xf5de('0x13')]();queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x32')]=utils[_0xf5de('0x33')](queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x17')],queues[_0x1f44de['uniqueid']][_0xf5de('0x34')]);queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x12')]=_0x1f44de[_0xf5de('0x12')];queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x35')]=_0x1f44de[_0xf5de('0x35')];queues[_0x1f44de[_0xf5de('0xe')]][_0xf5de('0x30')]=_0x1f44de[_0xf5de('0x30')];queues[_0x1f44de['uniqueid']][_0xf5de('0x31')]=_0x1f44de[_0xf5de('0x31')];}}catch(_0x5e05fa){utils[_0xf5de('0x14')](util[_0xf5de('0x3')](_0xf5de('0x2f'),_0x1f44de[_0xf5de('0xe')]),_0x5e05fa);}};exports[_0xf5de('0x36')]=function(_0x3cc6e2){try{if(!_['isNil'](queues[_0x3cc6e2[_0xf5de('0xe')]])){utils['debug'](util[_0xf5de('0x3')](_0xf5de('0x37'),_0x3cc6e2['uniqueid']),_0x3cc6e2);utils[_0xf5de('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3cc6e2['uniqueid'],queues[_0x3cc6e2[_0xf5de('0xe')]]['name'],_0x3cc6e2[_0xf5de('0x38')],_0x3cc6e2[_0xf5de('0x39')]));queues[_0x3cc6e2['uniqueid']][_0xf5de('0x18')]=![];queues[_0x3cc6e2[_0xf5de('0xe')]]['queuecallerabandon']=![];queues[_0x3cc6e2[_0xf5de('0xe')]]['queuecallerabandonAt']=null;queues[_0x3cc6e2[_0xf5de('0xe')]][_0xf5de('0x24')]=![];queues[_0x3cc6e2[_0xf5de('0xe')]]['queuecallerexitreason']=null;queues[_0x3cc6e2[_0xf5de('0xe')]][_0xf5de('0x29')]=null;queues[_0x3cc6e2[_0xf5de('0xe')]][_0xf5de('0x3a')]=!![];queues[_0x3cc6e2['uniqueid']][_0xf5de('0x3b')]=_0x3cc6e2[_0xf5de('0x39')];queues[_0x3cc6e2[_0xf5de('0xe')]][_0xf5de('0x3c')]=_0x3cc6e2[_0xf5de('0x38')];}}catch(_0x2b52c8){utils[_0xf5de('0x14')](util['format'](_0xf5de('0x37'),_0x3cc6e2['uniqueid']),_0x2b52c8);}};exports[_0xf5de('0x3d')]=function(_0x21f63c){try{if(!_[_0xf5de('0x20')](queues[_0x21f63c[_0xf5de('0xe')]])){if(queues[_0x21f63c[_0xf5de('0xe')]][_0xf5de('0x17')]){utils[_0xf5de('0xf')](util[_0xf5de('0x3')](_0xf5de('0x3e'),_0x21f63c[_0xf5de('0xe')]),_0x21f63c);queues[_0x21f63c[_0xf5de('0xe')]][_0xf5de('0x18')]=![];queues[_0x21f63c[_0xf5de('0xe')]][_0xf5de('0x18')]=![];queues[_0x21f63c[_0xf5de('0xe')]][_0xf5de('0x23')]=null;queues[_0x21f63c[_0xf5de('0xe')]][_0xf5de('0x24')]=![];queues[_0x21f63c[_0xf5de('0xe')]]['queuecallerexitAt']=null;queues[_0x21f63c[_0xf5de('0xe')]]['assigned']=!![];queues[_0x21f63c[_0xf5de('0xe')]]['lastAssignedTo']=_0x21f63c['membername'];queues[_0x21f63c[_0xf5de('0xe')]]['queuecallercomplete']=!![];queues[_0x21f63c[_0xf5de('0xe')]][_0xf5de('0x19')]=utils[_0xf5de('0x13')]();if(_0x21f63c[_0xf5de('0x3f')]==_0xf5de('0x40')){if(!queues[_0x21f63c['uniqueid']]['transfer']){queues[_0x21f63c[_0xf5de('0xe')]]['queuecallerexitreason']=_0xf5de('0x41');}}else{queues[_0x21f63c[_0xf5de('0xe')]][_0xf5de('0x8')]=_0xf5de('0x42')+_0x21f63c[_0xf5de('0x3f')][_0xf5de('0x21')]();}utils['info'](util[_0xf5de('0x3')](_0xf5de('0x43'),_0x21f63c[_0xf5de('0xe')],queues[_0x21f63c['uniqueid']][_0xf5de('0x1c')],_0x21f63c[_0xf5de('0x38')],queues[_0x21f63c['uniqueid']][_0xf5de('0x8')]));writeDB(queues[_0x21f63c[_0xf5de('0xe')]]);}}}catch(_0x562c35){utils['error'](util[_0xf5de('0x3')](_0xf5de('0x3e'),_0x21f63c[_0xf5de('0xe')]),_0x562c35);}};exports[_0xf5de('0x44')]=function(_0x18bae7){try{if(!_['isNil'](queues[_0x18bae7['transfereeuniqueid']])){utils[_0xf5de('0xf')](util[_0xf5de('0x3')](_0xf5de('0x45'),_0x18bae7[_0xf5de('0xe')]),_0x18bae7);queues[_0x18bae7[_0xf5de('0x46')]]['transfer']=!![];queues[_0x18bae7[_0xf5de('0x46')]]['transfertype']=_0xf5de('0x47');queues[_0x18bae7[_0xf5de('0x46')]]['transferexten']=_0x18bae7[_0xf5de('0x48')];queues[_0x18bae7['transfereeuniqueid']][_0xf5de('0x49')]=_0x18bae7[_0xf5de('0x46')];queues[_0x18bae7[_0xf5de('0x46')]][_0xf5de('0x8')]=_0xf5de('0x4a');utils[_0xf5de('0x2')](util['format'](_0xf5de('0x4b'),_0x18bae7['uniqueid'],queues[_0x18bae7[_0xf5de('0x46')]][_0xf5de('0x1c')],_0x18bae7[_0xf5de('0x46')],_0x18bae7[_0xf5de('0x48')]));}}catch(_0x23cec6){utils[_0xf5de('0x14')](util['format'](_0xf5de('0x45'),_0x18bae7[_0xf5de('0xe')]),_0x23cec6);}};exports[_0xf5de('0x4c')]=function(_0x136481){try{utils['debug'](util['format'](_0xf5de('0x4d'),_0x136481['origtransfereruniqueid']),_0x136481);if(_0x136481[_0xf5de('0x4e')]==_0x136481['origtransfererlinkedid']){if(!_['isNil'](queues[_0x136481[_0xf5de('0x4f')]])){utils[_0xf5de('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x136481[_0xf5de('0x4e')],queues[_0x136481[_0xf5de('0x4f')]][_0xf5de('0x1c')],_0x136481['origtransfererexten']));queues[_0x136481[_0xf5de('0x4f')]][_0xf5de('0x40')]=!![];queues[_0x136481[_0xf5de('0x4f')]][_0xf5de('0x50')]=_0xf5de('0x51');queues[_0x136481[_0xf5de('0x4f')]][_0xf5de('0x52')]=_0x136481[_0xf5de('0x53')];queues[_0x136481[_0xf5de('0x4f')]][_0xf5de('0x49')]=_0x136481[_0xf5de('0x4e')];queues[_0x136481[_0xf5de('0x4f')]]['queuecallerexitreason']=_0xf5de('0x54');}if(!_[_0xf5de('0x20')](queues[_0x136481[_0xf5de('0x55')]])){if(_0x136481['transfereelinkedid']&&queues[_0x136481['transfereelinkedid']]){queues[_0x136481[_0xf5de('0x56')]][_0xf5de('0x1d')]=0x1;queues[_0x136481[_0xf5de('0x46')]]=_['clone'](queues[_0x136481['transfereelinkedid']]);queues[_0x136481[_0xf5de('0x46')]]['transfereduniqueid']=_0x136481[_0xf5de('0x57')];queues[_0x136481[_0xf5de('0x46')]]['queuecallerenterreason']=0x2;queues[_0x136481[_0xf5de('0x46')]][_0xf5de('0x7')]=queues[_0x136481[_0xf5de('0x4f')]][_0xf5de('0x7')];queues[_0x136481[_0xf5de('0x46')]][_0xf5de('0x58')]=queues[_0x136481['secondtransfererlinkedid']][_0xf5de('0x58')];queues[_0x136481[_0xf5de('0x46')]][_0xf5de('0x34')]=utils[_0xf5de('0x13')]();queues[_0x136481[_0xf5de('0x46')]][_0xf5de('0x17')]=utils[_0xf5de('0x13')]();queues[_0x136481[_0xf5de('0x46')]][_0xf5de('0x32')]=0x0;queues[_0x136481['transfereeuniqueid']][_0xf5de('0x59')]=0x0;utils[_0xf5de('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x136481[_0xf5de('0x4e')],queues[_0x136481[_0xf5de('0x46')]][_0xf5de('0x1c')],queues[_0x136481[_0xf5de('0x46')]]['calleridnum'],queues[_0x136481[_0xf5de('0x46')]][_0xf5de('0x58')]));}else{utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x5a'),_0x136481[_0xf5de('0x4e')],queues[_0x136481[_0xf5de('0x55')]][_0xf5de('0x1c')],_0x136481[_0xf5de('0x4f')]));queues[_0x136481[_0xf5de('0x55')]][_0xf5de('0xd')]=_0x136481[_0xf5de('0x4f')];}}}else if(_0x136481[_0xf5de('0x5b')]==_0x136481[_0xf5de('0x4f')]){if(!_[_0xf5de('0x20')](queues[_0x136481[_0xf5de('0x55')]])){utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x5c'),_0x136481[_0xf5de('0x4e')],queues[_0x136481[_0xf5de('0x55')]][_0xf5de('0x1c')],_0x136481[_0xf5de('0x5b')],_0x136481[_0xf5de('0x5d')]));queues[_0x136481['origtransfererlinkedid']]['transfer']=!![];queues[_0x136481[_0xf5de('0x55')]]['transfertype']=_0xf5de('0x51');queues[_0x136481[_0xf5de('0x55')]]['transferexten']=_0x136481[_0xf5de('0x5d')];queues[_0x136481[_0xf5de('0x55')]][_0xf5de('0x49')]=_0x136481[_0xf5de('0x5b')];queues[_0x136481[_0xf5de('0x55')]][_0xf5de('0x8')]=_0xf5de('0x54');}if(!_[_0xf5de('0x20')](queues[_0x136481[_0xf5de('0x4f')]])){if(_0x136481[_0xf5de('0x5e')]&&queues[_0x136481['transfertargetlinkedid']]){queues[_0x136481[_0xf5de('0x5e')]]['queuecallerenterreason']=0x1;queues[_0x136481['transfertargetuniqueid']]=_['clone'](queues[_0x136481[_0xf5de('0x5e')]]);queues[_0x136481[_0xf5de('0x57')]][_0xf5de('0xd')]=_0x136481[_0xf5de('0x57')];queues[_0x136481['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x136481['transfertargetuniqueid']]['calleridnum']=queues[_0x136481[_0xf5de('0x55')]][_0xf5de('0x7')];queues[_0x136481[_0xf5de('0x57')]]['calleridname']=queues[_0x136481['origtransfererlinkedid']][_0xf5de('0x58')];queues[_0x136481[_0xf5de('0x57')]]['queuecallerjoinAt']=utils[_0xf5de('0x13')]();queues[_0x136481[_0xf5de('0x57')]]['queuecallerleaveAt']=utils[_0xf5de('0x13')]();queues[_0x136481['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x136481[_0xf5de('0x57')]]['mohtime']=0x0;utils[_0xf5de('0x2')](util['format'](_0xf5de('0x5f'),_0x136481[_0xf5de('0x4e')],queues[_0x136481[_0xf5de('0x57')]][_0xf5de('0x1c')],queues[_0x136481['transfertargetuniqueid']][_0xf5de('0xd')],queues[_0x136481[_0xf5de('0x57')]][_0xf5de('0x7')],queues[_0x136481[_0xf5de('0x57')]][_0xf5de('0x58')]));}else{utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x5a'),_0x136481[_0xf5de('0x4e')],queues[_0x136481[_0xf5de('0x4f')]][_0xf5de('0x1c')],_0x136481['origtransfererlinkedid']));queues[_0x136481[_0xf5de('0x4f')]]['transfereduniqueid']=_0x136481[_0xf5de('0x55')];}}}}catch(_0x218185){utils[_0xf5de('0x14')](util[_0xf5de('0x3')](_0xf5de('0x4d'),_0x136481[_0xf5de('0x4e')]),_0x218185);}};exports[_0xf5de('0x60')]=function(_0x4d08dc){try{if(!_[_0xf5de('0x20')](queues[_0x4d08dc[_0xf5de('0xe')]])){utils[_0xf5de('0xf')](util[_0xf5de('0x3')](_0xf5de('0x61'),_0x4d08dc[_0xf5de('0xe')]),_0x4d08dc);queues[_0x4d08dc[_0xf5de('0xe')]][_0xf5de('0x62')]=utils['now']();utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x63'),_0x4d08dc[_0xf5de('0xe')],queues[_0x4d08dc['uniqueid']][_0xf5de('0x1c')],queues[_0x4d08dc['uniqueid']][_0xf5de('0x62')]));}}catch(_0x3aaf19){utils[_0xf5de('0x14')](util['format'](_0xf5de('0x61'),_0x4d08dc[_0xf5de('0xe')]),_0x3aaf19);}};exports[_0xf5de('0x64')]=function(_0x59d05c){try{if(!_[_0xf5de('0x20')](queues[_0x59d05c[_0xf5de('0xe')]])){if(!_[_0xf5de('0x20')](queues[_0x59d05c['uniqueid']]['musiconholdstartAt'])){utils[_0xf5de('0xf')](util['format'](_0xf5de('0x65'),_0x59d05c['uniqueid']),_0x59d05c);queues[_0x59d05c[_0xf5de('0xe')]][_0xf5de('0x59')]+=utils[_0xf5de('0x33')](utils[_0xf5de('0x13')](),queues[_0x59d05c['uniqueid']][_0xf5de('0x62')]);utils[_0xf5de('0x2')](util[_0xf5de('0x3')](_0xf5de('0x66'),_0x59d05c['uniqueid'],queues[_0x59d05c[_0xf5de('0xe')]][_0xf5de('0x1c')],queues[_0x59d05c[_0xf5de('0xe')]][_0xf5de('0x59')]));delete queues[_0x59d05c['uniqueid']][_0xf5de('0x62')];}}}catch(_0x28c2fe){utils[_0xf5de('0x14')](util['format'](_0xf5de('0x65'),_0x59d05c[_0xf5de('0xe')]),_0x28c2fe);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c503747..175379b 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 _0xa778=['[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]','appdata','application','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','context','exten','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]'];(function(_0x1add2d,_0x340983){var _0x5b2c32=function(_0x14e3ac){while(--_0x14e3ac){_0x1add2d['push'](_0x1add2d['shift']());}};_0x5b2c32(++_0x340983);}(_0xa778,0x112));var _0x8a77=function(_0x37b27a,_0x324880){_0x37b27a=_0x37b27a-0x0;var _0x5e6b5a=_0xa778[_0x37b27a];return _0x5e6b5a;};'use strict';var _=require(_0x8a77('0x0'));var util=require(_0x8a77('0x1'));var utils=require(_0x8a77('0x2'));var recordings={};function writeDB(_0x25d2cb){utils[_0x8a77('0x3')](util[_0x8a77('0x4')](_0x8a77('0x5'),_0x25d2cb['uniqueid']));if(_0x25d2cb[_0x8a77('0x6')]){utils[_0x8a77('0x7')](_0x25d2cb[_0x8a77('0x6')])[_0x8a77('0x8')](function(_0x2eceea){if(_0x2eceea){_0x25d2cb[_0x8a77('0x9')]=_0x2eceea['name'];_0x25d2cb[_0x8a77('0xa')]=_0x2eceea['id'];}utils['request'](_0x8a77('0xb'),_0x25d2cb);});}else{utils['request'](_0x8a77('0xb'),_0x25d2cb);}}exports[_0x8a77('0xc')]=function(_0x1cf5a7){try{utils[_0x8a77('0xd')](util[_0x8a77('0x4')](_0x8a77('0xe'),_0x1cf5a7[_0x8a77('0xf')]),_0x1cf5a7);if(_0x1cf5a7['uniqueid']==_0x1cf5a7[_0x8a77('0x10')]){utils[_0x8a77('0x3')](util[_0x8a77('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x1cf5a7[_0x8a77('0xf')],_0x1cf5a7[_0x8a77('0x11')],_0x1cf5a7[_0x8a77('0x12')]));recordings[_0x1cf5a7['uniqueid']]={'uniqueid':_0x1cf5a7[_0x8a77('0xf')],'accountcode':_0x1cf5a7[_0x8a77('0x6')],'exten':_0x1cf5a7['exten'],'context':_0x1cf5a7[_0x8a77('0x11')],'channel':_0x1cf5a7['channel'],'monitors':[]};}}catch(_0x4fdb54){utils[_0x8a77('0x13')](util[_0x8a77('0x4')](_0x8a77('0xe'),_0x1cf5a7[_0x8a77('0xf')]),_0x4fdb54);}};exports['newstate']=function(_0x45f0d1){try{utils[_0x8a77('0xd')](util[_0x8a77('0x4')](_0x8a77('0x14'),_0x45f0d1[_0x8a77('0xf')]),_0x45f0d1);if(!_[_0x8a77('0x15')](recordings[_0x45f0d1[_0x8a77('0xf')]])&&_0x45f0d1[_0x8a77('0x16')]==0x6){utils[_0x8a77('0x3')](util[_0x8a77('0x4')](_0x8a77('0x17'),_0x45f0d1[_0x8a77('0xf')],_0x45f0d1[_0x8a77('0x11')],_0x45f0d1[_0x8a77('0x18')]));}else if(!_['isNil'](recordings[_0x45f0d1[_0x8a77('0x10')]])&&_0x45f0d1[_0x8a77('0x16')]==0x6&&_0x45f0d1[_0x8a77('0x11')]!=_0x8a77('0x19')){utils[_0x8a77('0x3')](util[_0x8a77('0x4')](_0x8a77('0x1a'),_0x45f0d1[_0x8a77('0xf')],_0x45f0d1[_0x8a77('0x10')],_0x45f0d1[_0x8a77('0x11')],_0x45f0d1[_0x8a77('0x18')]));recordings[_0x45f0d1[_0x8a77('0x10')]][_0x8a77('0x6')]=_0x45f0d1[_0x8a77('0x6')];}}catch(_0x1978b2){utils[_0x8a77('0x13')](util[_0x8a77('0x4')](_0x8a77('0x14'),_0x45f0d1['uniqueid']),_0x1978b2);}};exports[_0x8a77('0x1b')]=function(_0x429f84){try{if(!_['isNil'](_0x429f84[_0x8a77('0x1c')])&&!_[_0x8a77('0x15')](_0x429f84['variable'][_0x8a77('0x1d')])){utils[_0x8a77('0xd')](util[_0x8a77('0x4')](_0x8a77('0x1e'),_0x429f84['uniqueid']),_0x429f84);utils[_0x8a77('0x3')](util[_0x8a77('0x4')](_0x8a77('0x1f'),_0x429f84[_0x8a77('0xf')],_0x429f84[_0x8a77('0x1c')],_0x429f84[_0x8a77('0x20')]));if(_['endsWith'](_0x429f84[_0x8a77('0x20')],_0x8a77('0x21'))){_0x429f84['value']=_0x429f84[_0x8a77('0x20')][_0x8a77('0x22')](_0x8a77('0x21'),_0x8a77('0x23'));}if(recordings[_0x429f84[_0x8a77('0x10')]]){var _0x4edab2=_[_0x8a77('0x24')](recordings[_0x429f84[_0x8a77('0x10')]]['monitors'],{'value':_0x429f84[_0x8a77('0x20')]});if(_[_0x8a77('0x15')](_0x4edab2)){recordings[_0x429f84[_0x8a77('0x10')]][_0x8a77('0x25')]['push']({'value':_0x429f84['value']});}}}}catch(_0x59b97f){utils['error'](util[_0x8a77('0x4')]('[%s][recordings][varset]',_0x429f84[_0x8a77('0xf')]),_0x59b97f);}};exports[_0x8a77('0x26')]=function(_0x10fbe7){try{if(!_[_0x8a77('0x15')](recordings[_0x10fbe7[_0x8a77('0xf')]])){utils[_0x8a77('0xd')](util[_0x8a77('0x4')](_0x8a77('0x27'),_0x10fbe7[_0x8a77('0xf')]),_0x10fbe7);utils[_0x8a77('0x3')](util[_0x8a77('0x4')](_0x8a77('0x28'),_0x10fbe7[_0x8a77('0xf')],_0x10fbe7['calleridnum'],_0x10fbe7['calleridname'],_0x10fbe7[_0x8a77('0x29')]));recordings[_0x10fbe7[_0x8a77('0xf')]][_0x8a77('0x2a')]=_0x10fbe7[_0x8a77('0x2a')];recordings[_0x10fbe7[_0x8a77('0xf')]]['calleridname']=_0x10fbe7['calleridname'];recordings[_0x10fbe7['uniqueid']][_0x8a77('0x2b')]=_0x10fbe7[_0x8a77('0x2b')];recordings[_0x10fbe7['uniqueid']][_0x8a77('0x2c')]=_0x10fbe7['connectedlinename'];if(recordings[_0x10fbe7[_0x8a77('0xf')]][_0x8a77('0x2d')]==_0x8a77('0x2e')&&recordings[_0x10fbe7[_0x8a77('0xf')]][_0x8a77('0x6')]){recordings[_0x10fbe7[_0x8a77('0xf')]]['connectedlinenum']=recordings[_0x10fbe7[_0x8a77('0xf')]][_0x8a77('0x6')];recordings[_0x10fbe7['uniqueid']]['connectedlinename']='';}recordings[_0x10fbe7['uniqueid']][_0x8a77('0x25')]['forEach'](function(_0x2faa6c){var _0x2df520=_[_0x8a77('0x2f')](recordings[_0x10fbe7[_0x8a77('0xf')]]);_0x2df520[_0x8a77('0x20')]=_0x2faa6c[_0x8a77('0x20')];writeDB(_0x2df520);});delete recordings[_0x10fbe7[_0x8a77('0xf')]];}}catch(_0x52f9ff){utils[_0x8a77('0x13')](util[_0x8a77('0x4')](_0x8a77('0x27'),_0x10fbe7['uniqueid']),_0x52f9ff);}};exports['newexten']=function(_0x1de797){try{if(!_[_0x8a77('0x15')](recordings[_0x1de797['uniqueid']])){utils['debug'](util['format'](_0x8a77('0x30'),_0x1de797[_0x8a77('0xf')]),_0x1de797);utils['info'](util[_0x8a77('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x1de797['uniqueid'],_0x1de797['application'],_0x1de797[_0x8a77('0x31')]));if(_0x1de797[_0x8a77('0x32')]['toLowerCase']()==_0x8a77('0x33')&&_[_0x8a77('0x34')](_0x1de797[_0x8a77('0x31')][_0x8a77('0x35')](),_0x8a77('0x36'))){var _0x3dae15=_0x1de797[_0x8a77('0x31')][_0x8a77('0x37')]('=');var _0x5cc7d9=_0x3dae15[0x0][_0x8a77('0x38')](_0x3dae15[0x0][_0x8a77('0x39')]('(')+0x1,_0x3dae15[0x0][_0x8a77('0x39')](')'));var _0x2e1138=_0x3dae15[0x1];recordings[_0x1de797[_0x8a77('0xf')]][_0x5cc7d9]=_0x2e1138;}}}catch(_0x215e86){utils['error'](util[_0x8a77('0x4')](_0x8a77('0x30'),_0x1de797[_0x8a77('0xf')]),_0x215e86);}};exports[_0x8a77('0x3a')]=function(_0x27cbee){try{if(!_[_0x8a77('0x15')](recordings[_0x27cbee[_0x8a77('0xf')]])){utils[_0x8a77('0xd')](util[_0x8a77('0x4')](_0x8a77('0x3b'),_0x27cbee['uniqueid']),_0x27cbee);utils['info'](util[_0x8a77('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x27cbee['uniqueid'],_0x27cbee['queue']));recordings[_0x27cbee[_0x8a77('0xf')]][_0x8a77('0x3c')]=_0x27cbee[_0x8a77('0x3c')];}}catch(_0x3400c9){utils['error'](util[_0x8a77('0x4')]('[%s][recordings][queuecallerjoin]',_0x27cbee[_0x8a77('0xf')]),_0x3400c9);}}; \ No newline at end of file +var _0x559b=['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]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','uniqueid','accountcode','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s'];(function(_0x502694,_0x4504da){var _0x5280bd=function(_0x1e2f0c){while(--_0x1e2f0c){_0x502694['push'](_0x502694['shift']());}};_0x5280bd(++_0x4504da);}(_0x559b,0x182));var _0xb559=function(_0x490c11,_0x27bf2b){_0x490c11=_0x490c11-0x0;var _0x5a37ab=_0x559b[_0x490c11];return _0x5a37ab;};'use strict';var _=require(_0xb559('0x0'));var util=require(_0xb559('0x1'));var utils=require(_0xb559('0x2'));var recordings={};function writeDB(_0x18736f){utils[_0xb559('0x3')](util[_0xb559('0x4')]('[%s][recordings][writeDB]',_0x18736f[_0xb559('0x5')]));if(_0x18736f[_0xb559('0x6')]){utils['getUserByInternal'](_0x18736f['accountcode'])[_0xb559('0x7')](function(_0x3e39ad){if(_0x3e39ad){_0x18736f['membername']=_0x3e39ad[_0xb559('0x8')];_0x18736f[_0xb559('0x9')]=_0x3e39ad['id'];}utils[_0xb559('0xa')](_0xb559('0xb'),_0x18736f);});}else{utils['request'](_0xb559('0xb'),_0x18736f);}}exports[_0xb559('0xc')]=function(_0x4180b2){try{utils[_0xb559('0xd')](util[_0xb559('0x4')](_0xb559('0xe'),_0x4180b2[_0xb559('0x5')]),_0x4180b2);if(_0x4180b2['uniqueid']==_0x4180b2[_0xb559('0xf')]){utils[_0xb559('0x3')](util['format'](_0xb559('0x10'),_0x4180b2[_0xb559('0x5')],_0x4180b2[_0xb559('0x11')],_0x4180b2[_0xb559('0x12')]));recordings[_0x4180b2[_0xb559('0x5')]]={'uniqueid':_0x4180b2[_0xb559('0x5')],'accountcode':_0x4180b2['accountcode'],'exten':_0x4180b2['exten'],'context':_0x4180b2[_0xb559('0x11')],'channel':_0x4180b2['channel'],'monitors':[]};}}catch(_0x47411a){utils[_0xb559('0x13')](util[_0xb559('0x4')](_0xb559('0xe'),_0x4180b2[_0xb559('0x5')]),_0x47411a);}};exports[_0xb559('0x14')]=function(_0x3d42c8){try{utils[_0xb559('0xd')](util[_0xb559('0x4')](_0xb559('0x15'),_0x3d42c8[_0xb559('0x5')]),_0x3d42c8);if(!_[_0xb559('0x16')](recordings[_0x3d42c8[_0xb559('0x5')]])&&_0x3d42c8[_0xb559('0x17')]==0x6){utils[_0xb559('0x3')](util[_0xb559('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3d42c8[_0xb559('0x5')],_0x3d42c8[_0xb559('0x11')],_0x3d42c8[_0xb559('0x18')]));}else if(!_['isNil'](recordings[_0x3d42c8[_0xb559('0xf')]])&&_0x3d42c8['channelstate']==0x6&&_0x3d42c8[_0xb559('0x11')]!=_0xb559('0x19')){utils[_0xb559('0x3')](util[_0xb559('0x4')](_0xb559('0x1a'),_0x3d42c8['uniqueid'],_0x3d42c8[_0xb559('0xf')],_0x3d42c8[_0xb559('0x11')],_0x3d42c8[_0xb559('0x18')]));recordings[_0x3d42c8[_0xb559('0xf')]]['accountcode']=_0x3d42c8['accountcode'];}}catch(_0x28469d){utils[_0xb559('0x13')](util[_0xb559('0x4')](_0xb559('0x15'),_0x3d42c8['uniqueid']),_0x28469d);}};exports['varset']=function(_0x38acf8){try{if(!_[_0xb559('0x16')](_0x38acf8[_0xb559('0x1b')])&&!_['isNil'](_0x38acf8['variable'][_0xb559('0x1c')])){utils['debug'](util[_0xb559('0x4')](_0xb559('0x1d'),_0x38acf8[_0xb559('0x5')]),_0x38acf8);utils[_0xb559('0x3')](util[_0xb559('0x4')](_0xb559('0x1e'),_0x38acf8['uniqueid'],_0x38acf8[_0xb559('0x1b')],_0x38acf8['value']));if(_[_0xb559('0x1f')](_0x38acf8[_0xb559('0x20')],_0xb559('0x21'))){_0x38acf8[_0xb559('0x20')]=_0x38acf8['value'][_0xb559('0x22')]('.wav49',_0xb559('0x23'));}if(recordings[_0x38acf8[_0xb559('0xf')]]){var _0x4133fa=_[_0xb559('0x24')](recordings[_0x38acf8[_0xb559('0xf')]][_0xb559('0x25')],{'value':_0x38acf8[_0xb559('0x20')]});if(_[_0xb559('0x16')](_0x4133fa)){recordings[_0x38acf8[_0xb559('0xf')]]['monitors'][_0xb559('0x26')]({'value':_0x38acf8[_0xb559('0x20')]});}}}}catch(_0x4a1d51){utils[_0xb559('0x13')](util[_0xb559('0x4')]('[%s][recordings][varset]',_0x38acf8[_0xb559('0x5')]),_0x4a1d51);}};exports[_0xb559('0x27')]=function(_0x28f4f9){try{if(!_['isNil'](recordings[_0x28f4f9['uniqueid']])){utils[_0xb559('0xd')](util[_0xb559('0x4')](_0xb559('0x28'),_0x28f4f9[_0xb559('0x5')]),_0x28f4f9);utils[_0xb559('0x3')](util[_0xb559('0x4')](_0xb559('0x29'),_0x28f4f9[_0xb559('0x5')],_0x28f4f9[_0xb559('0x2a')],_0x28f4f9[_0xb559('0x2b')],_0x28f4f9['cause-txt']));recordings[_0x28f4f9[_0xb559('0x5')]][_0xb559('0x2a')]=_0x28f4f9[_0xb559('0x2a')];recordings[_0x28f4f9[_0xb559('0x5')]][_0xb559('0x2b')]=_0x28f4f9[_0xb559('0x2b')];recordings[_0x28f4f9[_0xb559('0x5')]]['connectedlinenum']=_0x28f4f9['connectedlinenum'];recordings[_0x28f4f9[_0xb559('0x5')]]['connectedlinename']=_0x28f4f9[_0xb559('0x2c')];if(recordings[_0x28f4f9[_0xb559('0x5')]][_0xb559('0x2d')]=='outbound'&&recordings[_0x28f4f9[_0xb559('0x5')]]['accountcode']){recordings[_0x28f4f9[_0xb559('0x5')]]['connectedlinenum']=recordings[_0x28f4f9[_0xb559('0x5')]][_0xb559('0x6')];recordings[_0x28f4f9[_0xb559('0x5')]]['connectedlinename']='';}recordings[_0x28f4f9[_0xb559('0x5')]][_0xb559('0x25')][_0xb559('0x2e')](function(_0x23672d){var _0x1ba975=_['clone'](recordings[_0x28f4f9[_0xb559('0x5')]]);_0x1ba975['value']=_0x23672d['value'];writeDB(_0x1ba975);});delete recordings[_0x28f4f9[_0xb559('0x5')]];}}catch(_0x4ec5b0){utils['error'](util['format'](_0xb559('0x28'),_0x28f4f9[_0xb559('0x5')]),_0x4ec5b0);}};exports[_0xb559('0x2f')]=function(_0x219881){try{if(!_[_0xb559('0x16')](recordings[_0x219881['uniqueid']])){utils[_0xb559('0xd')](util[_0xb559('0x4')]('[%s][recordings][newexten]',_0x219881[_0xb559('0x5')]),_0x219881);utils[_0xb559('0x3')](util['format'](_0xb559('0x30'),_0x219881[_0xb559('0x5')],_0x219881[_0xb559('0x31')],_0x219881[_0xb559('0x32')]));if(_0x219881[_0xb559('0x31')][_0xb559('0x33')]()=='set'&&_[_0xb559('0x34')](_0x219881[_0xb559('0x32')][_0xb559('0x33')](),_0xb559('0x35'))){var _0x26db90=_0x219881[_0xb559('0x32')][_0xb559('0x36')]('=');var _0x348430=_0x26db90[0x0][_0xb559('0x37')](_0x26db90[0x0]['lastIndexOf']('(')+0x1,_0x26db90[0x0]['lastIndexOf'](')'));var _0x2ccc04=_0x26db90[0x1];recordings[_0x219881[_0xb559('0x5')]][_0x348430]=_0x2ccc04;}}}catch(_0x312040){utils['error'](util[_0xb559('0x4')]('[%s][recordings][newexten]',_0x219881[_0xb559('0x5')]),_0x312040);}};exports['queuecallerjoin']=function(_0x3c2428){try{if(!_[_0xb559('0x16')](recordings[_0x3c2428[_0xb559('0x5')]])){utils[_0xb559('0xd')](util[_0xb559('0x4')](_0xb559('0x38'),_0x3c2428[_0xb559('0x5')]),_0x3c2428);utils[_0xb559('0x3')](util[_0xb559('0x4')](_0xb559('0x39'),_0x3c2428['uniqueid'],_0x3c2428[_0xb559('0x3a')]));recordings[_0x3c2428[_0xb559('0x5')]]['queue']=_0x3c2428[_0xb559('0x3a')];}}catch(_0x59803d){utils[_0xb559('0x13')](util[_0xb559('0x4')]('[%s][recordings][queuecallerjoin]',_0x3c2428[_0xb559('0x5')]),_0x59803d);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2208384..ba278f6 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 _0x1d38=['blind','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','./utils','info','format','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum'];(function(_0xc0fc71,_0x4b0645){var _0x19e510=function(_0x3cd391){while(--_0x3cd391){_0xc0fc71['push'](_0xc0fc71['shift']());}};_0x19e510(++_0x4b0645);}(_0x1d38,0x10a));var _0x81d3=function(_0x2c76da,_0x25bc06){_0x2c76da=_0x2c76da-0x0;var _0x5bc70e=_0x1d38[_0x2c76da];return _0x5bc70e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x81d3('0x0'));function writeDB(_0x5a9d03){utils[_0x81d3('0x1')](util[_0x81d3('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x5a9d03[_0x81d3('0x3')]==='attended'?_0x5a9d03[_0x81d3('0x4')]:_0x5a9d03[_0x81d3('0x5')],_0x5a9d03[_0x81d3('0x3')]));utils[_0x81d3('0x6')](_0x81d3('0x7'),_0x5a9d03);}exports['blindtransfer']=function(_0x7860da){try{utils[_0x81d3('0x8')](util[_0x81d3('0x2')](_0x81d3('0x9'),_0x7860da['uniqueid']),_0x7860da);utils[_0x81d3('0x1')](util['format'](_0x81d3('0xa'),_0x7860da[_0x81d3('0x5')],_0x7860da[_0x81d3('0xb')],_0x7860da[_0x81d3('0xc')],_0x7860da[_0x81d3('0xd')],_0x7860da['transfereecalleridname']));_0x7860da[_0x81d3('0x3')]=_0x81d3('0xe');writeDB(_0x7860da);}catch(_0x7a7cb2){utils[_0x81d3('0xf')](util[_0x81d3('0x2')]('[%s][transfers][blindtransfer]',_0x7860da[_0x81d3('0x5')]),_0x7a7cb2);}};exports[_0x81d3('0x10')]=function(_0x12c1d0){try{utils[_0x81d3('0x8')](util[_0x81d3('0x2')]('[%s][transfers][attendedtransfer]',_0x12c1d0[_0x81d3('0x4')]),_0x12c1d0);utils['info'](util['format'](_0x81d3('0x11'),_0x12c1d0[_0x81d3('0x4')],_0x12c1d0[_0x81d3('0x12')],_0x12c1d0['origtransferercalleridname'],_0x12c1d0[_0x81d3('0x13')],_0x12c1d0[_0x81d3('0x14')]));_0x12c1d0=_['assign'](_0x12c1d0,{'transfererchannel':_0x12c1d0['origtransfererchannel'],'transferercalleridnum':_0x12c1d0['origtransferercalleridnum'],'transferercalleridname':_0x12c1d0['origtransferercalleridname'],'transfererconnectedlinenum':_0x12c1d0['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x12c1d0[_0x81d3('0x15')],'transfereraccountcode':_0x12c1d0[_0x81d3('0x16')],'transferercontext':_0x12c1d0['secondtransferercontext'],'transfererexten':_0x12c1d0['secondtransfererexten'],'transfererlinkedid':_0x12c1d0[_0x81d3('0x17')],'context':_0x12c1d0[_0x81d3('0x18')],'extension':_0x12c1d0[_0x81d3('0x19')],'type':_0x81d3('0x1a')});if(_[_0x81d3('0x1b')](_0x12c1d0['transfereechannel'])){_0x12c1d0=_[_0x81d3('0x1c')](_0x12c1d0,{'transfereechannel':_0x12c1d0[_0x81d3('0x1d')],'transfereecalleridnum':_0x12c1d0[_0x81d3('0x13')],'transfereecalleridname':_0x12c1d0[_0x81d3('0x14')],'transfereeconnectedlinenum':_0x12c1d0[_0x81d3('0x1e')],'transfereeconnectedlinename':_0x12c1d0['transfertargetconnectedlinename'],'transfereeaccountcode':_0x12c1d0['transfertargetaccountcode'],'transfereecontext':_0x12c1d0[_0x81d3('0x1f')],'transfereeexten':_0x12c1d0[_0x81d3('0x20')],'transfereelinkedid':_0x12c1d0[_0x81d3('0x21')]});}writeDB(_0x12c1d0);}catch(_0x373007){utils['error'](util[_0x81d3('0x2')](_0x81d3('0x22'),_0x12c1d0[_0x81d3('0x4')]),_0x373007);}}; \ No newline at end of file +var _0x3819=['type','origtransfereruniqueid','uniqueid','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s'];(function(_0x4cc041,_0x518f78){var _0x44a3de=function(_0x49a932){while(--_0x49a932){_0x4cc041['push'](_0x4cc041['shift']());}};_0x44a3de(++_0x518f78);}(_0x3819,0xaa));var _0x9381=function(_0x171429,_0x5d7d4c){_0x171429=_0x171429-0x0;var _0x3d2026=_0x3819[_0x171429];return _0x3d2026;};'use strict';var _=require(_0x9381('0x0'));var util=require(_0x9381('0x1'));var utils=require('./utils');function writeDB(_0x2fc669){utils[_0x9381('0x2')](util[_0x9381('0x3')](_0x9381('0x4'),_0x2fc669[_0x9381('0x5')]==='attended'?_0x2fc669[_0x9381('0x6')]:_0x2fc669[_0x9381('0x7')],_0x2fc669[_0x9381('0x5')]));utils['request']('CreateVoiceTransferReport',_0x2fc669);}exports['blindtransfer']=function(_0x229e83){try{utils[_0x9381('0x8')](util[_0x9381('0x3')](_0x9381('0x9'),_0x229e83['uniqueid']),_0x229e83);utils[_0x9381('0x2')](util['format'](_0x9381('0xa'),_0x229e83[_0x9381('0x7')],_0x229e83[_0x9381('0xb')],_0x229e83[_0x9381('0xc')],_0x229e83[_0x9381('0xd')],_0x229e83[_0x9381('0xe')]));_0x229e83[_0x9381('0x5')]='blind';writeDB(_0x229e83);}catch(_0x5dc36f){utils[_0x9381('0xf')](util[_0x9381('0x3')]('[%s][transfers][blindtransfer]',_0x229e83[_0x9381('0x7')]),_0x5dc36f);}};exports['attendedtransfer']=function(_0x1601ad){try{utils[_0x9381('0x8')](util[_0x9381('0x3')](_0x9381('0x10'),_0x1601ad['origtransfereruniqueid']),_0x1601ad);utils[_0x9381('0x2')](util['format'](_0x9381('0x11'),_0x1601ad[_0x9381('0x6')],_0x1601ad['origtransferercalleridnum'],_0x1601ad['origtransferercalleridname'],_0x1601ad[_0x9381('0x12')],_0x1601ad[_0x9381('0x13')]));_0x1601ad=_[_0x9381('0x14')](_0x1601ad,{'transfererchannel':_0x1601ad['origtransfererchannel'],'transferercalleridnum':_0x1601ad[_0x9381('0x15')],'transferercalleridname':_0x1601ad['origtransferercalleridname'],'transfererconnectedlinenum':_0x1601ad[_0x9381('0x16')],'transfererconnectedlinename':_0x1601ad[_0x9381('0x17')],'transfereraccountcode':_0x1601ad[_0x9381('0x18')],'transferercontext':_0x1601ad[_0x9381('0x19')],'transfererexten':_0x1601ad[_0x9381('0x1a')],'transfererlinkedid':_0x1601ad[_0x9381('0x1b')],'context':_0x1601ad[_0x9381('0x1c')],'extension':_0x1601ad['origtransfererexten'],'type':'attended'});if(_[_0x9381('0x1d')](_0x1601ad['transfereechannel'])){_0x1601ad=_[_0x9381('0x14')](_0x1601ad,{'transfereechannel':_0x1601ad[_0x9381('0x1e')],'transfereecalleridnum':_0x1601ad['transfertargetcalleridnum'],'transfereecalleridname':_0x1601ad[_0x9381('0x13')],'transfereeconnectedlinenum':_0x1601ad[_0x9381('0x1f')],'transfereeconnectedlinename':_0x1601ad[_0x9381('0x20')],'transfereeaccountcode':_0x1601ad[_0x9381('0x21')],'transfereecontext':_0x1601ad[_0x9381('0x22')],'transfereeexten':_0x1601ad['transfertargetexten'],'transfereelinkedid':_0x1601ad['transfertargetlinkedid']});}writeDB(_0x1601ad);}catch(_0x3fadc1){utils[_0x9381('0xf')](util[_0x9381('0x3')](_0x9381('0x10'),_0x1601ad[_0x9381('0x6')]),_0x3fadc1);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 5ae0e5a..8b5888a 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 _0x307e=['YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]','addTime','add','format'];(function(_0x5a5ad9,_0x40a737){var _0x45436b=function(_0x52fb36){while(--_0x52fb36){_0x5a5ad9['push'](_0x5a5ad9['shift']());}};_0x45436b(++_0x40a737);}(_0x307e,0xc9));var _0xe307=function(_0x4f796e,_0x568eca){_0x4f796e=_0x4f796e-0x0;var _0x5407f3=_0x307e[_0x4f796e];return _0x5407f3;};'use strict';var BPromise=require(_0xe307('0x0'));var jayson=require(_0xe307('0x1'));var moment=require(_0xe307('0x2'));var util=require(_0xe307('0x3'));var client=jayson[_0xe307('0x4')]['http']({'port':0x2329});var logger=require(_0xe307('0x5'))(_0xe307('0x6'));exports['info']=function(_0x1eee4d,_0x532403){logger[_0xe307('0x7')](_0x1eee4d,_0x532403?util[_0xe307('0x8')](_0x532403,{'showHidden':![],'depth':null}):'');};exports[_0xe307('0x9')]=function(_0x59e5b7,_0x528e79){logger[_0xe307('0x9')](_0x59e5b7,_0x528e79?util[_0xe307('0x8')](_0x528e79,{'showHidden':![],'depth':null}):'');};exports[_0xe307('0xa')]=function(_0x304363,_0x2097b1){logger[_0xe307('0xa')](_0x304363,_0x2097b1?util[_0xe307('0x8')](_0x2097b1,{'showHidden':![],'depth':null}):'');};exports[_0xe307('0xb')]=function(_0x393a82,_0x217f0a){return client[_0xe307('0xb')](_0x393a82,{'body':_0x217f0a})[_0xe307('0xc')](function(_0x3b67c5){logger[_0xe307('0x9')](_0xe307('0xd'),_0x393a82,_0x3b67c5?util[_0xe307('0x8')](_0x3b67c5,{'showHidden':![],'depth':null}):'');})[_0xe307('0xe')](function(_0x321c99){logger[_0xe307('0xa')]('[utils][request]\x20name:%s',_0x393a82,_0x321c99?util[_0xe307('0x8')](_0x321c99,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3fc983){return client['request'](_0xe307('0xf'),{'options':{'raw':!![],'attributes':['id',_0xe307('0x10'),_0xe307('0x11'),_0xe307('0x12')],'where':_0x3fc983,'limit':0x1}})[_0xe307('0xc')](function(_0x22a241){logger[_0xe307('0x9')]('[utils][getUser]\x20where:%s',JSON[_0xe307('0x13')](_0x3fc983),_0x22a241?util[_0xe307('0x8')](_0x22a241,{'showHidden':![],'depth':null}):'');return _0x22a241[_0xe307('0x14')][_0xe307('0x15')]?_0x22a241[_0xe307('0x14')][0x0]:null;});}exports['getUserByInternal']=function(_0x4e4dfe){return new BPromise(function(_0xbc07f,_0x52ef79){if(_0x4e4dfe){return getUser({'internal':_0x4e4dfe})[_0xe307('0xc')](function(_0x3b2e66){logger[_0xe307('0x7')](_0xe307('0x16'),_0x4e4dfe,_0x3b2e66?_0xe307('0x17'):_0xe307('0x18'));return _0xbc07f(_0x3b2e66);})[_0xe307('0xe')](function(_0x26beaf){logger[_0xe307('0xa')](_0xe307('0x19'),_0x26beaf?util[_0xe307('0x8')](_0x26beaf,{'showHidden':![],'depth':null}):'');return _0xbc07f(null);});}return _0xbc07f(null);});};exports[_0xe307('0x1a')]=function(_0x394bde){return new BPromise(function(_0x43ebcc,_0x1b6c94){if(_0x394bde){return getUser({'interface':_0x394bde})['then'](function(_0x269e06){logger[_0xe307('0x7')](_0xe307('0x1b'),_0x394bde,_0x269e06?_0xe307('0x17'):_0xe307('0x18'));return _0x43ebcc(_0x269e06);})[_0xe307('0xe')](function(_0x5d8bcb){logger[_0xe307('0xa')](_0xe307('0x1c'),_0x5d8bcb?util[_0xe307('0x8')](_0x5d8bcb,{'showHidden':![],'depth':null}):'');return _0x43ebcc(null);});}return _0x43ebcc(null);});};exports['getUserByName']=function(_0x47b2d4){return new BPromise(function(_0x405ef6,_0x11fe69){if(_0x47b2d4){return getUser({'name':_0x47b2d4})[_0xe307('0xc')](function(_0x188f14){logger[_0xe307('0x7')](_0xe307('0x1d'),_0x47b2d4,_0x188f14?_0xe307('0x17'):_0xe307('0x18'));return _0x405ef6(_0x188f14);})[_0xe307('0xe')](function(_0x47b075){logger[_0xe307('0xa')](_0xe307('0x1e'),_0x47b075?util['inspect'](_0x47b075,{'showHidden':![],'depth':null}):'');return _0x405ef6(null);});}return _0x405ef6(null);});};exports[_0xe307('0x1f')]=function(_0x51769d){return new BPromise(function(_0x51586d,_0x2e36f2){if(_0x51769d){return client[_0xe307('0xb')](_0xe307('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0xe307('0x21'),'acw',_0xe307('0x22')],'where':{'name':_0x51769d},'limit':0x1}})['then'](function(_0x59e18b){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x51769d,_0x59e18b?util[_0xe307('0x8')](_0x59e18b,{'showHidden':![],'depth':null}):'');logger[_0xe307('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x51769d,_0x59e18b?_0xe307('0x17'):_0xe307('0x18'));return _0x51586d(_0x59e18b[_0xe307('0x14')][_0xe307('0x15')]?_0x59e18b['result'][0x0]:null);})[_0xe307('0xe')](function(_0x552236){logger['error'](_0xe307('0x23'),_0x552236?util[_0xe307('0x8')](_0x552236,{'showHidden':![],'depth':null}):'');return _0x51586d(null);});}return _0x51586d(null);});};exports[_0xe307('0x24')]=function(_0xfdfc8c,_0x504d0b){return moment(_0xfdfc8c)[_0xe307('0x25')](_0x504d0b,'seconds')[_0xe307('0x26')](_0xe307('0x27'));};exports['subtractTime']=function(_0x3470cc,_0x3cb948){return moment(_0x3470cc)[_0xe307('0x28')](_0x3cb948,_0xe307('0x29'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe307('0x2a')]=function(_0xb61d8b,_0x558d00){return moment(_0xb61d8b)[_0xe307('0x2b')](moment(_0x558d00),_0xe307('0x29'));};exports[_0xe307('0x2c')]=function(_0x53ef30,_0x5b758f){return parseInt(_0x53ef30,0xa)+parseInt(_0x5b758f,0xa);};exports[_0xe307('0x2d')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x300ce0,_0x4e3b33){if(_0x4e3b33){return moment(_0x300ce0)[_0xe307('0x2e')](_0x4e3b33);}return!![];};exports[_0xe307('0x2f')]=function(_0x1a9422,_0x3aed0f){if(_0x3aed0f){return moment(_0x1a9422)['isBefore'](_0x3aed0f);}else if(_0x1a9422){return!![];}return![];}; \ No newline at end of file +var _0x5e89=['seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','sumTime','now','isAfter','isBefore','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add'];(function(_0x208cf0,_0x486665){var _0x372d0d=function(_0x293e01){while(--_0x293e01){_0x208cf0['push'](_0x208cf0['shift']());}};_0x372d0d(++_0x486665);}(_0x5e89,0x19d));var _0x95e8=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5e89[_0xefd519];return _0x4bb882;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require('moment');var util=require('util');var client=jayson[_0x95e8('0x0')][_0x95e8('0x1')]({'port':0x2329});var logger=require(_0x95e8('0x2'))(_0x95e8('0x3'));exports[_0x95e8('0x4')]=function(_0x4e9159,_0x4f110c){logger[_0x95e8('0x4')](_0x4e9159,_0x4f110c?util[_0x95e8('0x5')](_0x4f110c,{'showHidden':![],'depth':null}):'');};exports[_0x95e8('0x6')]=function(_0x3c21c7,_0x5bc956){logger[_0x95e8('0x6')](_0x3c21c7,_0x5bc956?util[_0x95e8('0x5')](_0x5bc956,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x124601,_0x17f9b8){logger[_0x95e8('0x7')](_0x124601,_0x17f9b8?util[_0x95e8('0x5')](_0x17f9b8,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x41c0b2,_0x26c2af){return client[_0x95e8('0x8')](_0x41c0b2,{'body':_0x26c2af})[_0x95e8('0x9')](function(_0x375857){logger[_0x95e8('0x6')]('[utils][request]\x20name:%s',_0x41c0b2,_0x375857?util['inspect'](_0x375857,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x57f809){logger[_0x95e8('0x7')](_0x95e8('0xa'),_0x41c0b2,_0x57f809?util[_0x95e8('0x5')](_0x57f809,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1bc70b){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0x95e8('0xb'),_0x95e8('0xc'),'interface'],'where':_0x1bc70b,'limit':0x1}})[_0x95e8('0x9')](function(_0x152efd){logger[_0x95e8('0x6')](_0x95e8('0xd'),JSON[_0x95e8('0xe')](_0x1bc70b),_0x152efd?util[_0x95e8('0x5')](_0x152efd,{'showHidden':![],'depth':null}):'');return _0x152efd[_0x95e8('0xf')][_0x95e8('0x10')]?_0x152efd[_0x95e8('0xf')][0x0]:null;});}exports[_0x95e8('0x11')]=function(_0x3fde9d){return new BPromise(function(_0x2b8bb8,_0x9133a3){if(_0x3fde9d){return getUser({'internal':_0x3fde9d})[_0x95e8('0x9')](function(_0x1cfe27){logger[_0x95e8('0x4')](_0x95e8('0x12'),_0x3fde9d,_0x1cfe27?_0x95e8('0x13'):_0x95e8('0x14'));return _0x2b8bb8(_0x1cfe27);})[_0x95e8('0x15')](function(_0x1f49da){logger[_0x95e8('0x7')](_0x95e8('0x16'),_0x1f49da?util[_0x95e8('0x5')](_0x1f49da,{'showHidden':![],'depth':null}):'');return _0x2b8bb8(null);});}return _0x2b8bb8(null);});};exports[_0x95e8('0x17')]=function(_0x25d4ca){return new BPromise(function(_0x26be17,_0x512bfe){if(_0x25d4ca){return getUser({'interface':_0x25d4ca})[_0x95e8('0x9')](function(_0x5b1e6b){logger['info'](_0x95e8('0x18'),_0x25d4ca,_0x5b1e6b?_0x95e8('0x13'):'notfound');return _0x26be17(_0x5b1e6b);})['catch'](function(_0x571969){logger[_0x95e8('0x7')](_0x95e8('0x19'),_0x571969?util['inspect'](_0x571969,{'showHidden':![],'depth':null}):'');return _0x26be17(null);});}return _0x26be17(null);});};exports[_0x95e8('0x1a')]=function(_0x10f64c){return new BPromise(function(_0x6d97a9,_0x237cf3){if(_0x10f64c){return getUser({'name':_0x10f64c})[_0x95e8('0x9')](function(_0x161aab){logger['info'](_0x95e8('0x1b'),_0x10f64c,_0x161aab?'found':_0x95e8('0x14'));return _0x6d97a9(_0x161aab);})[_0x95e8('0x15')](function(_0x458b9f){logger[_0x95e8('0x7')](_0x95e8('0x1c'),_0x458b9f?util['inspect'](_0x458b9f,{'showHidden':![],'depth':null}):'');return _0x6d97a9(null);});}return _0x6d97a9(null);});};exports['getVoiceQueueByName']=function(_0x2849a3){return new BPromise(function(_0x666426,_0xcda85c){if(_0x2849a3){return client[_0x95e8('0x8')](_0x95e8('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0x95e8('0x1e'),'acw',_0x95e8('0x1f')],'where':{'name':_0x2849a3},'limit':0x1}})[_0x95e8('0x9')](function(_0xc2295e){logger[_0x95e8('0x6')](_0x95e8('0x20'),_0x2849a3,_0xc2295e?util[_0x95e8('0x5')](_0xc2295e,{'showHidden':![],'depth':null}):'');logger['info'](_0x95e8('0x21'),_0x2849a3,_0xc2295e?_0x95e8('0x13'):_0x95e8('0x14'));return _0x666426(_0xc2295e[_0x95e8('0xf')][_0x95e8('0x10')]?_0xc2295e[_0x95e8('0xf')][0x0]:null);})[_0x95e8('0x15')](function(_0x36422a){logger[_0x95e8('0x7')](_0x95e8('0x22'),_0x36422a?util[_0x95e8('0x5')](_0x36422a,{'showHidden':![],'depth':null}):'');return _0x666426(null);});}return _0x666426(null);});};exports[_0x95e8('0x23')]=function(_0x494eea,_0x315020){return moment(_0x494eea)[_0x95e8('0x24')](_0x315020,_0x95e8('0x25'))[_0x95e8('0x26')](_0x95e8('0x27'));};exports['subtractTime']=function(_0x584d0a,_0xdc9239){return moment(_0x584d0a)[_0x95e8('0x28')](_0xdc9239,_0x95e8('0x25'))[_0x95e8('0x26')](_0x95e8('0x27'));};exports['diffTime']=function(_0x4d9a9a,_0x527832){return moment(_0x4d9a9a)['diff'](moment(_0x527832),_0x95e8('0x25'));};exports[_0x95e8('0x29')]=function(_0x127251,_0x5e2f90){return parseInt(_0x127251,0xa)+parseInt(_0x5e2f90,0xa);};exports[_0x95e8('0x2a')]=function(){return moment()[_0x95e8('0x26')](_0x95e8('0x27'));};exports[_0x95e8('0x2b')]=function(_0x21e0cb,_0x5cf182){if(_0x5cf182){return moment(_0x21e0cb)['isAfter'](_0x5cf182);}return!![];};exports[_0x95e8('0x2c')]=function(_0x1b1fe0,_0x3c2df7){if(_0x3c2df7){return moment(_0x1b1fe0)[_0x95e8('0x2c')](_0x3c2df7);}else if(_0x1b1fe0){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 71fcac1..ff53807 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 _0x8236=['url','statusCode','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','agent_name','setupLoggers','fs-extra','lodash','express-winston','util','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','log','xcally','name','ensureDir','client','catch','user','then','no-user','data','timestamp','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress'];(function(_0x3ccad8,_0xc17377){var _0x213551=function(_0x79283e){while(--_0x79283e){_0x3ccad8['push'](_0x3ccad8['shift']());}};_0x213551(++_0xc17377);}(_0x8236,0x1ba));var _0x6823=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8236[_0x167cc1];return _0x10bc4b;};var fs=require(_0x6823('0x0'));var _=require(_0x6823('0x1'));var ewinston=require(_0x6823('0x2'));var path=require('path');var util=require(_0x6823('0x3'));var fileLogger=require('./loggers')[_0x6823('0x4')];var safeTemplate=require(_0x6823('0x5'))[_0x6823('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0x6823('0x7')];function ClientSideLogger(){function _0x40dea8(_0x24e831){var _0x2e394a=path[_0x6823('0x8')](_0x6823('0x9'),_0x6823('0xa'),_0x6823('0xb'));var _0x294736=path[_0x6823('0x8')]('client',_0x24e831['role']+'-'+_0x24e831[_0x6823('0xc')]);return fs[_0x6823('0xd')](path['join'](_0x2e394a,_0x294736))['then'](function(){var _0x4e29c3=fileLogger(_0x6823('0xe'),path[_0x6823('0x8')](_0x2e394a,_0x294736));return _0x4e29c3;})[_0x6823('0xf')](function(_0x261b5c){throw _0x261b5c;});}this[_0x6823('0xa')]=function(_0x480b9b,_0x2acf5c,_0x2cc035,_0x3a143a){return _0x40dea8(_0x480b9b[_0x6823('0x10')])['then'](function(_0x49e98f){var _0x40f447=_0x49e98f[_0x2acf5c];return _0x40f447;})[_0x6823('0x11')](function(_0x3519c6){var _0x5097f1=_0x480b9b[_0x6823('0x10')]?_0x480b9b[_0x6823('0x10')]['id']:_0x6823('0x12');var _0x1c4a48=_0x3a143a[_0x6823('0x13')];var _0x4e7e8d=_0x3a143a[_0x6823('0x14')];var _0x151462=new Date(Number(_0x4e7e8d));return _0x3519c6(_0x5097f1,_0x151462,_0x2cc035,_0x1c4a48);})['catch'](function(_0xeee757){fileLogger(_0x6823('0xe'))[_0x6823('0x15')](_0xeee757);});};}function setupLoggers(_0x236848){return new Promise(function(_0x678e28){var _0x495860=new ClientSideLogger();var _0x407cb7=fileLogger(_0x6823('0x16'));var _0x40ba96=fileLogger(_0x6823('0x17'));_0x236848[_0x6823('0x18')](_0x6823('0x19'),_0x495860);_0x236848[_0x6823('0x1a')](ewinston[_0x6823('0x1b')]({'winstonInstance':_0x407cb7,'meta':![],'statusLevels':!![],'msg':function(_0x2ab6a9,_0x452ac0){var _0x54f756=_0x6823('0x1c');if(!_[_0x6823('0x1d')](_0x2ab6a9['body'])){_0x54f756+=_0x6823('0x1e');var _0x4a977b=_0x2ab6a9[_0x6823('0x1f')];maskSensitiveData(_0x4a977b);}return safeTemplate(util[_0x6823('0x20')](_0x54f756,_0x2ab6a9[_0x6823('0x21')],_0x2ab6a9[_0x6823('0x22')][_0x6823('0x23')]?_0x2ab6a9['headers'][_0x6823('0x23')]:_0x2ab6a9[_0x6823('0x24')][_0x6823('0x25')]||_0x2ab6a9['ip'],_0x2ab6a9[_0x6823('0x26')],_0x452ac0[_0x6823('0x27')],_0x452ac0['responseTime'],_0x2ab6a9[_0x6823('0x10')]?_0x2ab6a9[_0x6823('0x10')]['id']:null,_0x2ab6a9[_0x6823('0x10')]?_0x2ab6a9[_0x6823('0x10')][_0x6823('0xc')]:null,_0x2ab6a9['user']?_0x2ab6a9['user'][_0x6823('0x28')]:null,_0x4a977b?util[_0x6823('0x29')](_0x4a977b,![],null):''));}}));_0x236848['use'](ewinston[_0x6823('0x1b')]({'winstonInstance':_0x40ba96,'meta':![],'statusLevels':!![],'msg':function(_0x3c8bf4,_0x1c8470){var _0x5f0d0d=_0x6823('0x2a');if(_0x3c8bf4[_0x6823('0x1f')]&&_0x3c8bf4[_0x6823('0x1f')]['device']&&_0x3c8bf4[_0x6823('0x1f')][_0x6823('0x2b')]){_0x5f0d0d=_0x6823('0x2c');}return util[_0x6823('0x20')](_0x5f0d0d,_0x3c8bf4[_0x6823('0x21')],_0x3c8bf4['headers'][_0x6823('0x23')]?_0x3c8bf4[_0x6823('0x22')][_0x6823('0x23')]:_0x3c8bf4[_0x6823('0x24')]['remoteAddress']||_0x3c8bf4['ip'],_0x3c8bf4['url'],_0x1c8470[_0x6823('0x27')],_0x1c8470['responseTime'],_0x3c8bf4[_0x6823('0x10')]?_0x3c8bf4[_0x6823('0x10')]['id']:null,_0x3c8bf4[_0x6823('0x10')]?_0x3c8bf4[_0x6823('0x10')][_0x6823('0xc')]:null,_0x3c8bf4[_0x6823('0x10')]?_0x3c8bf4[_0x6823('0x10')][_0x6823('0x28')]:null,_0x3c8bf4[_0x6823('0x1f')]&&_0x3c8bf4[_0x6823('0x1f')]['device']?_0x3c8bf4[_0x6823('0x1f')][_0x6823('0x2d')]:'other',_0x3c8bf4[_0x6823('0x1f')]&&_0x3c8bf4[_0x6823('0x1f')][_0x6823('0x2b')]?_0x3c8bf4['body']['agent_id']:'',_0x3c8bf4['body']&&_0x3c8bf4[_0x6823('0x1f')][_0x6823('0x2e')]?_0x3c8bf4[_0x6823('0x1f')][_0x6823('0x2e')]:'');},'ignoreRoute':function(_0x2567b4){var _0x53af83=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x53af83['test'](_0x2567b4[_0x6823('0x26')]);}}));return _0x678e28();});}exports[_0x6823('0x2f')]=setupLoggers; \ No newline at end of file +var _0x92f8=['logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','statusCode','agent_name','setupLoggers','lodash','express-winston','path','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','client','role','name','ensureDir','join','then','catch','user','no-user','data','timestamp','error','api','auth','set','client-side-logger','use','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','responseTime','inspect'];(function(_0x291501,_0x177f28){var _0xfa89f2=function(_0x431541){while(--_0x431541){_0x291501['push'](_0x291501['shift']());}};_0xfa89f2(++_0x177f28);}(_0x92f8,0x65));var _0x892f=function(_0x2fdc16,_0x46b810){_0x2fdc16=_0x2fdc16-0x0;var _0x210f85=_0x92f8[_0x2fdc16];return _0x210f85;};var fs=require('fs-extra');var _=require(_0x892f('0x0'));var ewinston=require(_0x892f('0x1'));var path=require(_0x892f('0x2'));var util=require('util');var fileLogger=require(_0x892f('0x3'))[_0x892f('0x4')];var safeTemplate=require(_0x892f('0x5'))[_0x892f('0x6')];var maskSensitiveData=require(_0x892f('0x7'))[_0x892f('0x8')];function ClientSideLogger(){function _0x46fcb4(_0x2f380a){var _0x5b24fd=path['join'](_0x892f('0x9'),_0x892f('0xa'),_0x892f('0xb'));var _0x4e28c2=path['join'](_0x892f('0xc'),_0x2f380a[_0x892f('0xd')]+'-'+_0x2f380a[_0x892f('0xe')]);return fs[_0x892f('0xf')](path[_0x892f('0x10')](_0x5b24fd,_0x4e28c2))[_0x892f('0x11')](function(){var _0x3c43d4=fileLogger(_0x892f('0xc'),path[_0x892f('0x10')](_0x5b24fd,_0x4e28c2));return _0x3c43d4;})[_0x892f('0x12')](function(_0x5404d5){throw _0x5404d5;});}this[_0x892f('0xa')]=function(_0x377be6,_0x11d968,_0x1af378,_0x196413){return _0x46fcb4(_0x377be6[_0x892f('0x13')])[_0x892f('0x11')](function(_0x502ab1){var _0x2430f1=_0x502ab1[_0x11d968];return _0x2430f1;})[_0x892f('0x11')](function(_0x1cc07c){var _0x333892=_0x377be6['user']?_0x377be6[_0x892f('0x13')]['id']:_0x892f('0x14');var _0x149c9b=_0x196413[_0x892f('0x15')];var _0x425283=_0x196413[_0x892f('0x16')];var _0x1ec256=new Date(Number(_0x425283));return _0x1cc07c(_0x333892,_0x1ec256,_0x1af378,_0x149c9b);})[_0x892f('0x12')](function(_0x4d0324){fileLogger(_0x892f('0xc'))[_0x892f('0x17')](_0x4d0324);});};}function setupLoggers(_0x109577){return new Promise(function(_0x2a8852){var _0x327ad6=new ClientSideLogger();var _0x296c7c=fileLogger(_0x892f('0x18'));var _0x10d35f=fileLogger(_0x892f('0x19'));_0x109577[_0x892f('0x1a')](_0x892f('0x1b'),_0x327ad6);_0x109577[_0x892f('0x1c')](ewinston['logger']({'winstonInstance':_0x296c7c,'meta':![],'statusLevels':!![],'msg':function(_0x58c7df,_0x9151fa){var _0x5eb294='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x892f('0x1d')](_0x58c7df[_0x892f('0x1e')])){_0x5eb294+=_0x892f('0x1f');var _0x459427=_0x58c7df[_0x892f('0x1e')];maskSensitiveData(_0x459427);}return safeTemplate(util[_0x892f('0x20')](_0x5eb294,_0x58c7df[_0x892f('0x21')],_0x58c7df['headers']['x-forwarded-for']?_0x58c7df[_0x892f('0x22')][_0x892f('0x23')]:_0x58c7df['connection'][_0x892f('0x24')]||_0x58c7df['ip'],_0x58c7df[_0x892f('0x25')],_0x9151fa['statusCode'],_0x9151fa[_0x892f('0x26')],_0x58c7df[_0x892f('0x13')]?_0x58c7df['user']['id']:null,_0x58c7df[_0x892f('0x13')]?_0x58c7df[_0x892f('0x13')][_0x892f('0xe')]:null,_0x58c7df['user']?_0x58c7df[_0x892f('0x13')]['role']:null,_0x459427?util[_0x892f('0x27')](_0x459427,![],null):''));}}));_0x109577[_0x892f('0x1c')](ewinston[_0x892f('0x28')]({'winstonInstance':_0x10d35f,'meta':![],'statusLevels':!![],'msg':function(_0x5e4978,_0x32dae7){var _0xbabc4a=_0x892f('0x29');if(_0x5e4978[_0x892f('0x1e')]&&_0x5e4978[_0x892f('0x1e')][_0x892f('0x2a')]&&_0x5e4978[_0x892f('0x1e')][_0x892f('0x2b')]){_0xbabc4a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x892f('0x20')](_0xbabc4a,_0x5e4978['method'],_0x5e4978['headers'][_0x892f('0x23')]?_0x5e4978[_0x892f('0x22')][_0x892f('0x23')]:_0x5e4978['connection']['remoteAddress']||_0x5e4978['ip'],_0x5e4978[_0x892f('0x25')],_0x32dae7[_0x892f('0x2c')],_0x32dae7[_0x892f('0x26')],_0x5e4978[_0x892f('0x13')]?_0x5e4978[_0x892f('0x13')]['id']:null,_0x5e4978['user']?_0x5e4978[_0x892f('0x13')][_0x892f('0xe')]:null,_0x5e4978['user']?_0x5e4978[_0x892f('0x13')][_0x892f('0xd')]:null,_0x5e4978[_0x892f('0x1e')]&&_0x5e4978[_0x892f('0x1e')][_0x892f('0x2a')]?_0x5e4978[_0x892f('0x1e')][_0x892f('0x2a')]:'other',_0x5e4978['body']&&_0x5e4978[_0x892f('0x1e')][_0x892f('0x2b')]?_0x5e4978[_0x892f('0x1e')]['agent_id']:'',_0x5e4978[_0x892f('0x1e')]&&_0x5e4978[_0x892f('0x1e')]['agent_name']?_0x5e4978[_0x892f('0x1e')][_0x892f('0x2d')]:'');},'ignoreRoute':function(_0x87ac49){var _0x4c6955=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4c6955['test'](_0x87ac49['url']);}}));return _0x2a8852();});}exports[_0x892f('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index e8f548f..db6ea8b 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63aa=['iftime','lodash','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','isBefore','day','isBetween','format','includes','dowCompare','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','split','padStart','length'];(function(_0x379974,_0x480de1){var _0x5cc56c=function(_0x57b3ca){while(--_0x57b3ca){_0x379974['push'](_0x379974['shift']());}};_0x5cc56c(++_0x480de1);}(_0x63aa,0x157));var _0xa63a=function(_0x22b00c,_0xb3fc9d){_0x22b00c=_0x22b00c-0x0;var _0x18a79f=_0x63aa[_0x22b00c];return _0x18a79f;};var _=require(_0xa63a('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x5ae294){return _0x5ae294[_0xa63a('0x1')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xa63a('0x2');var EINVALID_DATE=_0xa63a('0x3');function throwIfDateNotValid(_0x230294){if(!_0x230294[_0xa63a('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x283d94){var _0x3ad946=_0x283d94['split'](':')[_0xa63a('0x5')](function(_0x32cdc6){return parseInt(_0x32cdc6,0xa);});var _0x5d36d7=_0x3ad946[0x0];var _0x1d08de=_0x3ad946[0x1];if(_0x5d36d7<0x0||_0x5d36d7>0x17||_0x1d08de<0x0||_0x1d08de>0x3b){throw new Error(EINVALID_DATE);}return[_0x5d36d7,_0x1d08de];}function circularDoWInterval(_0x10e23a,_0x53d84b){if(_0x10e23a===_0x53d84b){return[_0x10e23a];}else{var _0x121e4c=moment[_0xa63a('0x6')]();moment[_0xa63a('0x6')]('en');var _0x2eb837=moment[_0xa63a('0x7')]()['map'](function(_0x5c9c48){return _0x5c9c48[_0xa63a('0x8')]();});moment[_0xa63a('0x6')](_0x121e4c);var _0xbf4741=_0x2eb837[_0xa63a('0x9')](_0x10e23a);var _0x27a047=_0x2eb837[_0xa63a('0x9')](_0x53d84b);if(_0x27a047>_0xbf4741){return _0x2eb837[_0xa63a('0xa')](_0xbf4741,_0x27a047+0x1);}else{var _0x24b7fb=_0x2eb837[_0xa63a('0xa')](0x0,_0x27a047+0x1);var _0x91a7b5=_0x2eb837[_0xa63a('0xa')](_0xbf4741);return _0x91a7b5[_0xa63a('0xb')](_0x24b7fb);}}}module[_0xa63a('0xc')][_0xa63a('0xd')]=circularDoWInterval;function circularMonthInterval(_0x2e5b2c,_0x567f6b){if(_0x2e5b2c===_0x567f6b){return[_0x2e5b2c];}else{var _0x54d94f=moment[_0xa63a('0x6')]();moment[_0xa63a('0x6')]('en');var _0x17902e=moment[_0xa63a('0xe')]()[_0xa63a('0x5')](function(_0x9778aa){return _0x9778aa[_0xa63a('0x8')]();});moment[_0xa63a('0x6')](_0x54d94f);var _0x4f910a=_0x17902e[_0xa63a('0x9')](_0x2e5b2c);var _0x146149=_0x17902e['indexOf'](_0x567f6b);if(_0x146149>_0x4f910a){return _0x17902e['slice'](_0x4f910a,_0x146149+0x1);}else{var _0x3ea85c=_0x17902e['slice'](0x0,_0x146149+0x1);var _0x1d6880=_0x17902e[_0xa63a('0xa')](_0x4f910a);return _0x1d6880[_0xa63a('0xb')](_0x3ea85c);}}}module[_0xa63a('0xc')][_0xa63a('0xf')]=circularMonthInterval;function parseDom(_0x3d7df9){var _0x434ade=parseInt(_0x3d7df9,0xa);if(_0x434ade<0x1||_0x434ade>0x1f){throw new Error(EINVALID_DATE);}return _0x434ade;}function timeCompare(_0x2a12c4,_0x170f8a,_0x233bf9){var _0x3c4383=_0x2a12c4[_0xa63a('0x10')]();var _0x1a15ac=extractTime(_0x170f8a);var _0xd796c4=_0x1a15ac[0x0];var _0x359f28=_0x1a15ac[0x1];var _0x4b958c=_0x2a12c4[_0xa63a('0x10')]()[_0xa63a('0x11')](_0xd796c4)[_0xa63a('0x12')](_0x359f28);throwIfDateNotValid(_0x4b958c);var _0x2682e6=extractTime(_0x233bf9);var _0x430607=_0x2682e6[0x0];var _0x503d6f=_0x2682e6[0x1];var _0x7b7d93=_0x2a12c4[_0xa63a('0x10')]()[_0xa63a('0x11')](_0x430607)[_0xa63a('0x12')](_0x503d6f);throwIfDateNotValid(_0x7b7d93);if(_0x7b7d93[_0xa63a('0x13')](_0x4b958c)){var _0x37852f=_0x3c4383[_0xa63a('0x10')]()['startOf'](_0xa63a('0x14'));var _0x3373c8=_0x3c4383['clone']()['endOf'](_0xa63a('0x14'));return _0x3c4383[_0xa63a('0x15')](_0x4b958c,_0x3373c8,undefined,'[]')||_0x3c4383[_0xa63a('0x15')](_0x37852f,_0x7b7d93,undefined,'[]');}else{return _0x3c4383[_0xa63a('0x15')](_0x4b958c,_0x7b7d93,undefined,'[]');}}module[_0xa63a('0xc')]['timeCompare']=timeCompare;function dowCompare(_0x34a0d2,_0x259edd,_0x379955){var _0xac62a7=_0x34a0d2[_0xa63a('0x6')]('en')[_0xa63a('0x16')]('ddd')[_0xa63a('0x8')]();return circularDoWInterval(_0x259edd,_0x379955)[_0xa63a('0x17')](_0xac62a7);}module[_0xa63a('0xc')][_0xa63a('0x18')]=dowCompare;function domCompare(_0x2d01fa,_0x17b03e,_0x1440dd){var _0x380e6c=_0x2d01fa['date']();if(_0x17b03e===_0x1440dd){return _0x380e6c===_0x17b03e;}else{var _0x59afcd=_0x2d01fa[_0xa63a('0x19')]();var _0x30d85d=_0x17b03e<_0x1440dd;let _0x3d64f1=![];var _0x1335a3=0x0;var _0x4bd565=0x0;if(_0x30d85d){_0x1335a3=Math[_0xa63a('0x1a')](0x1,_0x17b03e);_0x4bd565=Math[_0xa63a('0x1b')](_0x1440dd,_0x59afcd);_0x3d64f1=_0x380e6c>=_0x1335a3&&_0x380e6c<=_0x4bd565;}else{_0x1335a3=Math[_0xa63a('0x1b')](_0x17b03e,_0x59afcd);_0x4bd565=Math['max'](0x1,_0x1440dd);_0x3d64f1=_0x380e6c>=_0x1335a3||_0x380e6c<=_0x4bd565;}return _0x3d64f1;}}module[_0xa63a('0xc')][_0xa63a('0x1c')]=domCompare;function monthCompare(_0x40d0d7,_0x8672eb,_0x561d9f){var _0x82dbd8=_0x40d0d7[_0xa63a('0x6')]('en')[_0xa63a('0x16')](_0xa63a('0x1d'))[_0xa63a('0x8')]();return circularMonthInterval(_0x8672eb,_0x561d9f)[_0xa63a('0x17')](_0x82dbd8);}module[_0xa63a('0xc')][_0xa63a('0x1e')]=monthCompare;function iftime(_0x26c1ec,_0x3d74ca=moment['tz'][_0xa63a('0x1f')](),_0x56632a=moment()){if(!validateRx[_0xa63a('0x20')](_0x26c1ec)){throw new Error(EINVALID_STRING);}else{var _0xde338c=(moment[_0xa63a('0x21')](_0x56632a)?_0x56632a[_0xa63a('0x10')]():moment(_0x56632a))['tz'](_0x3d74ca)[_0xa63a('0x6')]('en');throwIfDateNotValid(_0xde338c);var _0x12137b=_0x26c1ec[_0xa63a('0x22')](',');var _0x54cb79=_0x12137b[0x0];var _0x224bbe=_0x12137b[0x1];var _0xbafb5f=_0x12137b[0x2];var _0x50d9c0=_0x12137b[0x3];let _0x2cc1ca=!![];if(_0x54cb79!=='*'){var _0x3e60c4=_0x54cb79[_0xa63a('0x22')]('-');var _0x2ee804=_[_0xa63a('0x23')](_0x3e60c4[0x0],0x5,'0');var _0x5dbbd3=_0x3e60c4[_0xa63a('0x24')]===0x2?_[_0xa63a('0x23')](_0x3e60c4[0x1],0x5,'0'):_0x2ee804;_0x2cc1ca=timeCompare(_0xde338c,_0x2ee804,_0x5dbbd3);}let _0x552bc5=!![];if(_0x224bbe!=='*'){var _0x33fd79=_0x224bbe[_0xa63a('0x22')]('-');var _0x1054a8=_0x33fd79[0x0];var _0x351beb=_0x33fd79[_0xa63a('0x24')]===0x2?_0x33fd79[0x1]:_0x1054a8;_0x552bc5=dowCompare(_0xde338c,_0x1054a8,_0x351beb);}let _0x2c20e4=!![];if(_0xbafb5f!=='*'){var _0x262b40=_0xbafb5f[_0xa63a('0x22')]('-');var _0x13c384=parseDom(_0x262b40[0x0]);var _0x539aaa=_0x262b40[_0xa63a('0x24')]===0x2?parseDom(_0x262b40[0x1]):_0x13c384;_0x2c20e4=domCompare(_0xde338c,_0x13c384,_0x539aaa);}let _0x488eaa=!![];if(_0x50d9c0!=='*'){var _0x338b38=_0x50d9c0['split']('-');var _0x4dc718=_0x338b38[0x0];var _0x2b9da7=_0x338b38[_0xa63a('0x24')]===0x2?_0x338b38[0x1]:_0x338b38[0x0];_0x488eaa=monthCompare(_0xde338c,_0x4dc718,_0x2b9da7);}return _0x2cc1ca&&_0x552bc5&&_0x2c20e4&&_0x488eaa;}}module[_0xa63a('0xc')][_0xa63a('0x25')]=iftime; \ No newline at end of file +var _0xf91c=['monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','startOf','day','endOf','isBetween','format','ddd','dowCompare','date','daysInMonth','max','MMM','includes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf91c,0xcf));var _0xcf91=function(_0x3182f2,_0x242888){_0x3182f2=_0x3182f2-0x0;var _0x5ed78d=_0xf91c[_0x3182f2];return _0x5ed78d;};var _=require(_0xcf91('0x0'));var moment=require(_0xcf91('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xcf91('0x2')](function(_0x4cf9d){return _0x4cf9d['source'];})[_0xcf91('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xcf91('0x4');var EINVALID_DATE=_0xcf91('0x5');function throwIfDateNotValid(_0x9c29e2){if(!_0x9c29e2[_0xcf91('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3c6171){var _0xdec35d=_0x3c6171[_0xcf91('0x7')](':')['map'](function(_0x5d004f){return parseInt(_0x5d004f,0xa);});var _0x28ab79=_0xdec35d[0x0];var _0x4e8936=_0xdec35d[0x1];if(_0x28ab79<0x0||_0x28ab79>0x17||_0x4e8936<0x0||_0x4e8936>0x3b){throw new Error(EINVALID_DATE);}return[_0x28ab79,_0x4e8936];}function circularDoWInterval(_0x832dc9,_0x1ecb52){if(_0x832dc9===_0x1ecb52){return[_0x832dc9];}else{var _0xfc44f8=moment[_0xcf91('0x8')]();moment[_0xcf91('0x8')]('en');var _0x23d594=moment[_0xcf91('0x9')]()[_0xcf91('0x2')](function(_0x79235d){return _0x79235d[_0xcf91('0xa')]();});moment[_0xcf91('0x8')](_0xfc44f8);var _0x1834b9=_0x23d594[_0xcf91('0xb')](_0x832dc9);var _0x854075=_0x23d594[_0xcf91('0xb')](_0x1ecb52);if(_0x854075>_0x1834b9){return _0x23d594[_0xcf91('0xc')](_0x1834b9,_0x854075+0x1);}else{var _0x2381c6=_0x23d594[_0xcf91('0xc')](0x0,_0x854075+0x1);var _0x2b4ed7=_0x23d594[_0xcf91('0xc')](_0x1834b9);return _0x2b4ed7[_0xcf91('0xd')](_0x2381c6);}}}module[_0xcf91('0xe')][_0xcf91('0xf')]=circularDoWInterval;function circularMonthInterval(_0x2cc444,_0x439926){if(_0x2cc444===_0x439926){return[_0x2cc444];}else{var _0x1b3cf3=moment[_0xcf91('0x8')]();moment[_0xcf91('0x8')]('en');var _0x3d351e=moment[_0xcf91('0x10')]()['map'](function(_0x3d24fb){return _0x3d24fb[_0xcf91('0xa')]();});moment[_0xcf91('0x8')](_0x1b3cf3);var _0x4f7b06=_0x3d351e[_0xcf91('0xb')](_0x2cc444);var _0xf366e6=_0x3d351e[_0xcf91('0xb')](_0x439926);if(_0xf366e6>_0x4f7b06){return _0x3d351e['slice'](_0x4f7b06,_0xf366e6+0x1);}else{var _0x79dc8b=_0x3d351e[_0xcf91('0xc')](0x0,_0xf366e6+0x1);var _0x1a619b=_0x3d351e[_0xcf91('0xc')](_0x4f7b06);return _0x1a619b[_0xcf91('0xd')](_0x79dc8b);}}}module[_0xcf91('0xe')][_0xcf91('0x11')]=circularMonthInterval;function parseDom(_0x45646f){var _0x25049f=parseInt(_0x45646f,0xa);if(_0x25049f<0x1||_0x25049f>0x1f){throw new Error(EINVALID_DATE);}return _0x25049f;}function timeCompare(_0x245f7c,_0x788e9c,_0x49c8cb){var _0x2dfd7c=_0x245f7c[_0xcf91('0x12')]();var _0x32bc1a=extractTime(_0x788e9c);var _0x525f5a=_0x32bc1a[0x0];var _0x1a1038=_0x32bc1a[0x1];var _0x406abd=_0x245f7c[_0xcf91('0x12')]()['hours'](_0x525f5a)['minutes'](_0x1a1038);throwIfDateNotValid(_0x406abd);var _0x37ab50=extractTime(_0x49c8cb);var _0xa2a521=_0x37ab50[0x0];var _0x52fcf2=_0x37ab50[0x1];var _0x24c167=_0x245f7c[_0xcf91('0x12')]()[_0xcf91('0x13')](_0xa2a521)[_0xcf91('0x14')](_0x52fcf2);throwIfDateNotValid(_0x24c167);if(_0x24c167['isBefore'](_0x406abd)){var _0x3c3e9d=_0x2dfd7c[_0xcf91('0x12')]()[_0xcf91('0x15')](_0xcf91('0x16'));var _0x178516=_0x2dfd7c[_0xcf91('0x12')]()[_0xcf91('0x17')]('day');return _0x2dfd7c[_0xcf91('0x18')](_0x406abd,_0x178516,undefined,'[]')||_0x2dfd7c[_0xcf91('0x18')](_0x3c3e9d,_0x24c167,undefined,'[]');}else{return _0x2dfd7c[_0xcf91('0x18')](_0x406abd,_0x24c167,undefined,'[]');}}module[_0xcf91('0xe')]['timeCompare']=timeCompare;function dowCompare(_0x342166,_0x87c1a8,_0x11e99a){var _0x552e4c=_0x342166[_0xcf91('0x8')]('en')[_0xcf91('0x19')](_0xcf91('0x1a'))[_0xcf91('0xa')]();return circularDoWInterval(_0x87c1a8,_0x11e99a)['includes'](_0x552e4c);}module[_0xcf91('0xe')][_0xcf91('0x1b')]=dowCompare;function domCompare(_0x26054b,_0x423754,_0x12321d){var _0x19094b=_0x26054b[_0xcf91('0x1c')]();if(_0x423754===_0x12321d){return _0x19094b===_0x423754;}else{var _0x5ed18a=_0x26054b[_0xcf91('0x1d')]();var _0x2d987f=_0x423754<_0x12321d;let _0xb82b6b=![];var _0x5793ca=0x0;var _0x3131d7=0x0;if(_0x2d987f){_0x5793ca=Math[_0xcf91('0x1e')](0x1,_0x423754);_0x3131d7=Math['min'](_0x12321d,_0x5ed18a);_0xb82b6b=_0x19094b>=_0x5793ca&&_0x19094b<=_0x3131d7;}else{_0x5793ca=Math['min'](_0x423754,_0x5ed18a);_0x3131d7=Math[_0xcf91('0x1e')](0x1,_0x12321d);_0xb82b6b=_0x19094b>=_0x5793ca||_0x19094b<=_0x3131d7;}return _0xb82b6b;}}module['exports']['domCompare']=domCompare;function monthCompare(_0x3b67a3,_0x685008,_0x3071fd){var _0x1ff3d6=_0x3b67a3[_0xcf91('0x8')]('en')[_0xcf91('0x19')](_0xcf91('0x1f'))[_0xcf91('0xa')]();return circularMonthInterval(_0x685008,_0x3071fd)[_0xcf91('0x20')](_0x1ff3d6);}module[_0xcf91('0xe')][_0xcf91('0x21')]=monthCompare;function iftime(_0x8c501a,_0x31fdca=moment['tz'][_0xcf91('0x22')](),_0x2e7ae3=moment()){if(!validateRx[_0xcf91('0x23')](_0x8c501a)){throw new Error(EINVALID_STRING);}else{var _0x42ce07=(moment[_0xcf91('0x24')](_0x2e7ae3)?_0x2e7ae3[_0xcf91('0x12')]():moment(_0x2e7ae3))['tz'](_0x31fdca)[_0xcf91('0x8')]('en');throwIfDateNotValid(_0x42ce07);var _0x4c9a81=_0x8c501a['split'](',');var _0x46e4ca=_0x4c9a81[0x0];var _0x3ccedd=_0x4c9a81[0x1];var _0x3cf8fa=_0x4c9a81[0x2];var _0xeffc9d=_0x4c9a81[0x3];let _0x53e018=!![];if(_0x46e4ca!=='*'){var _0x5cb0a7=_0x46e4ca[_0xcf91('0x7')]('-');var _0x5575b5=_[_0xcf91('0x25')](_0x5cb0a7[0x0],0x5,'0');var _0x5ba986=_0x5cb0a7[_0xcf91('0x26')]===0x2?_[_0xcf91('0x25')](_0x5cb0a7[0x1],0x5,'0'):_0x5575b5;_0x53e018=timeCompare(_0x42ce07,_0x5575b5,_0x5ba986);}let _0x1f3f27=!![];if(_0x3ccedd!=='*'){var _0x46e2e8=_0x3ccedd[_0xcf91('0x7')]('-');var _0x6ec10f=_0x46e2e8[0x0];var _0x969e81=_0x46e2e8[_0xcf91('0x26')]===0x2?_0x46e2e8[0x1]:_0x6ec10f;_0x1f3f27=dowCompare(_0x42ce07,_0x6ec10f,_0x969e81);}let _0x3d71ee=!![];if(_0x3cf8fa!=='*'){var _0x148ac4=_0x3cf8fa[_0xcf91('0x7')]('-');var _0x4dac0a=parseDom(_0x148ac4[0x0]);var _0x574634=_0x148ac4[_0xcf91('0x26')]===0x2?parseDom(_0x148ac4[0x1]):_0x4dac0a;_0x3d71ee=domCompare(_0x42ce07,_0x4dac0a,_0x574634);}let _0x37cb52=!![];if(_0xeffc9d!=='*'){var _0x5babb4=_0xeffc9d['split']('-');var _0x371274=_0x5babb4[0x0];var _0x38ce00=_0x5babb4['length']===0x2?_0x5babb4[0x1]:_0x5babb4[0x0];_0x37cb52=monthCompare(_0x42ce07,_0x371274,_0x38ce00);}return _0x53e018&&_0x1f3f27&&_0x3d71ee&&_0x37cb52;}}module[_0xcf91('0xe')][_0xcf91('0x27')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index d237ccb..ad28a89 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe18b=['level','toUpperCase','}}}','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','path','util','winston','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','%s-%s.log','message','replace','{{{','format'];(function(_0x3fe50c,_0x8add0d){var _0xe49479=function(_0x4224cc){while(--_0x4224cc){_0x3fe50c['push'](_0x3fe50c['shift']());}};_0xe49479(++_0x8add0d);}(_0xe18b,0x104));var _0xbe18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18b[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xbe18('0x0'));var util=require(_0xbe18('0x1'));var moment=require('moment');var winston=require(_0xbe18('0x2'));var config=require('../config/environment');var debugLevel=config[_0xbe18('0x3')]?config['debugLevel'][_0xbe18('0x4')]():_0xbe18('0x5');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':_0xbe18('0x6'),'error':_0xbe18('0x7'),'warn':'bold\x20yellow','info':_0xbe18('0x8'),'print':_0xbe18('0x9'),'success':_0xbe18('0xa'),'http':'gray','verbose':_0xbe18('0xb'),'debug':'bold\x20blue','silly':_0xbe18('0xc')};winston[_0xbe18('0xd')](XC_LOG_COLORS);function getLogFileName(_0xd22a77,_0x53a485,_0x47e3e6){var _0x3fbb7b=_0xd22a77||_0xbe18('0xe');return path['join'](_0x3fbb7b,util['format'](_0xbe18('0xf'),_0x53a485,_0x47e3e6));}function formatter(_0x58ed9c,_0x5e5b5e){_0x5e5b5e[_0xbe18('0x10')]=_0x5e5b5e['message'][_0xbe18('0x11')](/@@{/g,_0xbe18('0x12'))[_0xbe18('0x11')](/}@@/g,'}}}')[_0xbe18('0x11')](/@{/g,'{{')[_0xbe18('0x11')](/}@/g,'}}');return util[_0xbe18('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xbe18('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5e5b5e[_0xbe18('0x14')][_0xbe18('0x15')](),_0x58ed9c,_0x5e5b5e[_0xbe18('0x10')]);}function fileFormat(_0x16103f,_0x4ba569){_0x4ba569[_0xbe18('0x10')]=_0x4ba569['message'][_0xbe18('0x11')](/@@{/g,_0xbe18('0x12'))['replace'](/}@@/g,_0xbe18('0x16'))['replace'](/@{/g,'{{')[_0xbe18('0x11')](/}@/g,'}}');var _0x584472=_0x4ba569[_0xbe18('0x17')]&&Object['keys'](_0x4ba569[_0xbe18('0x17')])[_0xbe18('0x18')]?'\x0a\x09'+JSON['stringify'](_0x4ba569[_0xbe18('0x17')]):'';return util[_0xbe18('0x13')](_0xbe18('0x19'),moment()['format'](_0xbe18('0x1a')),_0x4ba569['level']['toUpperCase'](),_0x16103f,_0x4ba569[_0xbe18('0x10')],_0x584472);}function consoleLogger(){var _0x21235f=new winston[(_0xbe18('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbe18('0x1c'))][(_0xbe18('0x1d'))]({'level':_0xbe18('0x1e'),'json':![],'formatter':function(_0x2cf124){return formatter('',_0x2cf124);}})]});return _0x21235f;}function fileLogger(_0x308f0c,_0x6b39c){var _0x1e286c=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbe18('0x1c'))]['File']({'name':util['format'](_0xbe18('0x1f'),_0x308f0c,_0xbe18('0x20')),'filename':getLogFileName(_0x6b39c,_0x308f0c,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x15352f){return fileFormat(_0x308f0c,_0x15352f);}}),new winston[(_0xbe18('0x1c'))][(_0xbe18('0x21'))]({'name':util['format'](_0xbe18('0x1f'),_0x308f0c,debugLevel),'filename':getLogFileName(_0x6b39c,_0x308f0c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x24d039){return fileFormat(_0x308f0c,_0x24d039);}}),new winston[(_0xbe18('0x1c'))][(_0xbe18('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x5e04b5){return fileFormat(_0x308f0c,_0x5e04b5);}})]});return _0x1e286c;}exports[_0xbe18('0x22')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x8f27=['bold\x20blue','/var/log/xcally','format','%s-%s.log','message','{{{','}}}','replace','YYYY-MM-DD\x20HH:mm:ss','level','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','transports','Console','Logger','%s-%s','error','File','warn','consoleLogger','fileLogger','moment','winston','debugLevel','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta'];(function(_0x3d5cd9,_0x16db35){var _0x116080=function(_0x4c80fc){while(--_0x4c80fc){_0x3d5cd9['push'](_0x3d5cd9['shift']());}};_0x116080(++_0x16db35);}(_0x8f27,0x9b));var _0x78f2=function(_0x36b444,_0x505b35){_0x36b444=_0x36b444-0x0;var _0x786323=_0x8f27[_0x36b444];return _0x786323;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x78f2('0x0'));var winston=require(_0x78f2('0x1'));var config=require('../config/environment');var debugLevel=config[_0x78f2('0x2')]?config[_0x78f2('0x2')]['toLowerCase']():_0x78f2('0x3');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':_0x78f2('0x4'),'warn':_0x78f2('0x5'),'info':_0x78f2('0x6'),'print':_0x78f2('0x7'),'success':_0x78f2('0x8'),'http':'gray','verbose':_0x78f2('0x9'),'debug':_0x78f2('0xa'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x25b764,_0x101d83,_0x36a2a9){var _0x2a2c44=_0x25b764||_0x78f2('0xb');return path['join'](_0x2a2c44,util[_0x78f2('0xc')](_0x78f2('0xd'),_0x101d83,_0x36a2a9));}function formatter(_0x4839d9,_0x15e6e7){_0x15e6e7[_0x78f2('0xe')]=_0x15e6e7[_0x78f2('0xe')]['replace'](/@@{/g,_0x78f2('0xf'))['replace'](/}@@/g,_0x78f2('0x10'))[_0x78f2('0x11')](/@{/g,'{{')[_0x78f2('0x11')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x78f2('0xc')](_0x78f2('0x12')),_0x15e6e7[_0x78f2('0x13')]['toUpperCase'](),_0x4839d9,_0x15e6e7['message']);}function fileFormat(_0x56b6bd,_0x109957){_0x109957[_0x78f2('0xe')]=_0x109957[_0x78f2('0xe')][_0x78f2('0x11')](/@@{/g,_0x78f2('0xf'))['replace'](/}@@/g,'}}}')[_0x78f2('0x11')](/@{/g,'{{')[_0x78f2('0x11')](/}@/g,'}}');var _0x4a5be0=_0x109957['meta']&&Object['keys'](_0x109957[_0x78f2('0x14')])[_0x78f2('0x15')]?'\x0a\x09'+JSON['stringify'](_0x109957[_0x78f2('0x14')]):'';return util[_0x78f2('0xc')](_0x78f2('0x16'),moment()['format'](_0x78f2('0x12')),_0x109957[_0x78f2('0x13')][_0x78f2('0x17')](),_0x56b6bd,_0x109957[_0x78f2('0xe')],_0x4a5be0);}function consoleLogger(){var _0x14c76d=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x78f2('0x18'))][(_0x78f2('0x19'))]({'level':'warn','json':![],'formatter':function(_0x41fa2f){return formatter('',_0x41fa2f);}})]});return _0x14c76d;}function fileLogger(_0x3ba9c9,_0x3cc542){var _0x35e178=new winston[(_0x78f2('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util['format'](_0x78f2('0x1b'),_0x3ba9c9,'error'),'filename':getLogFileName(_0x3cc542,_0x3ba9c9,_0x78f2('0x1c')),'level':_0x78f2('0x1c'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1bd6e2){return fileFormat(_0x3ba9c9,_0x1bd6e2);}}),new winston[(_0x78f2('0x18'))][(_0x78f2('0x1d'))]({'name':util[_0x78f2('0xc')](_0x78f2('0x1b'),_0x3ba9c9,debugLevel),'filename':getLogFileName(_0x3cc542,_0x3ba9c9,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4702eb){return fileFormat(_0x3ba9c9,_0x4702eb);}}),new winston['transports'][(_0x78f2('0x19'))]({'level':_0x78f2('0x1e'),'json':![],'formatter':function(_0x32b9ec){return fileFormat(_0x3ba9c9,_0x32b9ec);}})]});return _0x35e178;}exports[_0x78f2('0x1f')]=consoleLogger;exports[_0x78f2('0x20')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index cb236c7..1f2a01e 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 _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x3f0215,_0x5c9e25){_0x3f0215=_0x3f0215-0x0;var _0x246ad2=_0x7a54[_0x3f0215];return _0x246ad2;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x0295,0x1f0));var _0x5029=function(_0x5c2871,_0x9f21e6){_0x5c2871=_0x5c2871-0x0;var _0x4d962d=_0x0295[_0x5c2871];return _0x4d962d;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index 7a1fecf..4b26895 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['exports','replace','\x5c$&'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x5fab,0x177));var _0xb5fa=function(_0x30ffc1,_0x556cd6){_0x30ffc1=_0x30ffc1-0x0;var _0x586b40=_0x5fab[_0x30ffc1];return _0x586b40;};module[_0xb5fa('0x0')]={'escapeRegExp'(_0x1c67fb,_0x4c67f9=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x1c67fb[_0xb5fa('0x1')](_0x4c67f9,_0xb5fa('0x2'));}}; \ No newline at end of file +var _0x53ec=['exports','replace','\x5c$&'];(function(_0x28a66d,_0x326d64){var _0x1402f0=function(_0x400440){while(--_0x400440){_0x28a66d['push'](_0x28a66d['shift']());}};_0x1402f0(++_0x326d64);}(_0x53ec,0x192));var _0xc53e=function(_0x48d732,_0x202a72){_0x48d732=_0x48d732-0x0;var _0x221c79=_0x53ec[_0x48d732];return _0x221c79;};module[_0xc53e('0x0')]={'escapeRegExp'(_0x173f4d,_0x2d5f51=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x173f4d[_0xc53e('0x1')](_0x2d5f51,_0xc53e('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 0773482..baf5a8b 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 _0x1775=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x3d5d40,_0x143d30){var _0x5ddfa8=function(_0x257915){while(--_0x257915){_0x3d5d40['push'](_0x3d5d40['shift']());}};_0x5ddfa8(++_0x143d30);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0xb5c9b1){return _0xb5c9b1==='{{'?_0x5177('0x0'):_0x5177('0x1');}function safeTemplate(_0x2ca33b){var _0xaad33e=_0x2ca33b;if(typeof _0x2ca33b===_0x5177('0x2')){_0xaad33e=_0x2ca33b[_0x5177('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5177('0x4')](_0x2ca33b)){_0xaad33e=_0x2ca33b[_0x5177('0x5')](function(_0x51275f){return safeTemplate(_0x51275f);});}else if(_[_0x5177('0x6')](_0x2ca33b)){_0xaad33e=Object[_0x5177('0x7')](_0x2ca33b)[_0x5177('0x8')](function(_0x2ac1c6,_0x300b43){_0x2ac1c6[_0x300b43]=safeTemplate(_0x2ca33b[_0x300b43]);return _0x2ac1c6;},{});}return _0xaad33e;}module[_0x5177('0x9')][_0x5177('0xa')]=safeTemplate; \ No newline at end of file +var _0x4fc2=['reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map','keys'];(function(_0x20396c,_0x50dfa){var _0x13d443=function(_0x323548){while(--_0x323548){_0x20396c['push'](_0x20396c['shift']());}};_0x13d443(++_0x50dfa);}(_0x4fc2,0x111));var _0x24fc=function(_0x5b906a,_0x31b5fc){_0x5b906a=_0x5b906a-0x0;var _0x2a1dcf=_0x4fc2[_0x5b906a];return _0x2a1dcf;};var _=require(_0x24fc('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b05a5){return _0x2b05a5==='{{'?_0x24fc('0x1'):_0x24fc('0x2');}function safeTemplate(_0x5aaa74){var _0x365c56=_0x5aaa74;if(typeof _0x5aaa74===_0x24fc('0x3')){_0x365c56=_0x5aaa74[_0x24fc('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x5aaa74)){_0x365c56=_0x5aaa74[_0x24fc('0x5')](function(_0x3772eb){return safeTemplate(_0x3772eb);});}else if(_['isPlainObject'](_0x5aaa74)){_0x365c56=Object[_0x24fc('0x6')](_0x5aaa74)[_0x24fc('0x7')](function(_0x4889f4,_0x115851){_0x4889f4[_0x115851]=safeTemplate(_0x5aaa74[_0x115851]);return _0x4889f4;},{});}return _0x365c56;}module[_0x24fc('0x8')][_0x24fc('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 5ee85eb..76323d7 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe702=['writeJSON','exports','fs-extra','../config/environment','root','resolve','server/app.json','apps','findIndex','name','motion2','env','NODE_PATH','pathExists','then','readJSON','info','Updating\x20app.json'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xe702,0x1c4));var _0x2e70=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xe702[_0x491a7f];return _0x3d8f44;};var fs=require(_0x2e70('0x0'));var path=require('path');var config=require(_0x2e70('0x1'));var root=config[_0x2e70('0x2')];var APP_JSON_PATH=path[_0x2e70('0x3')](root,_0x2e70('0x4'));var NODEPATH=path[_0x2e70('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x4d33b6){let _0x1180e5=![];if(Array['isArray'](_0x4d33b6[_0x2e70('0x5')])){var _0x42d3db=_0x4d33b6[_0x2e70('0x5')][_0x2e70('0x6')](function(_0x5a1069){return _0x5a1069[_0x2e70('0x7')]===_0x2e70('0x8');});if(_0x42d3db>-0x1){var _0x4594ba=_0x4d33b6[_0x2e70('0x5')][_0x42d3db];if(typeof _0x4594ba[_0x2e70('0x9')][_0x2e70('0xa')]!=='string'){_0x4594ba['env'][_0x2e70('0xa')]=NODEPATH;_0x1180e5=!![];}}return{'appConfig':_0x4d33b6,'updated':_0x1180e5};}}function updateAppConfig(_0x46fad2){return fs[_0x2e70('0xb')](APP_JSON_PATH)[_0x2e70('0xc')](function(_0x3cf671){if(_0x3cf671){return fs[_0x2e70('0xd')](APP_JSON_PATH)[_0x2e70('0xc')](function(_0x335a05){var _0x1dca5a=setLegacyLibsNodeEnvPath(_0x335a05);if(_0x1dca5a['updated']){_0x46fad2[_0x2e70('0xe')](_0x2e70('0xf'));return fs[_0x2e70('0x10')](APP_JSON_PATH,_0x335a05,{'spaces':0x2});}else{return Promise[_0x2e70('0x3')]();}});}else{return Promise[_0x2e70('0x3')]();}});}module[_0x2e70('0x11')]=updateAppConfig; \ No newline at end of file +var _0xe465=['pathExists','then','updated','info','exports','fs-extra','path','../config/environment','resolve','server/app.json','apps','findIndex','name','motion2','NODE_PATH','string','env'];(function(_0x419119,_0x1d1cf8){var _0x3e8808=function(_0x61b79c){while(--_0x61b79c){_0x419119['push'](_0x419119['shift']());}};_0x3e8808(++_0x1d1cf8);}(_0xe465,0x115));var _0x5e46=function(_0xd2502d,_0x59a1a6){_0xd2502d=_0xd2502d-0x0;var _0x5df028=_0xe465[_0xd2502d];return _0x5df028;};var fs=require(_0x5e46('0x0'));var path=require(_0x5e46('0x1'));var config=require(_0x5e46('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x5e46('0x3')](root,_0x5e46('0x4'));var NODEPATH=path[_0x5e46('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x3f8ec0){let _0x17383d=![];if(Array['isArray'](_0x3f8ec0[_0x5e46('0x5')])){var _0x3b1788=_0x3f8ec0[_0x5e46('0x5')][_0x5e46('0x6')](function(_0x25e0d1){return _0x25e0d1[_0x5e46('0x7')]===_0x5e46('0x8');});if(_0x3b1788>-0x1){var _0x5bab17=_0x3f8ec0[_0x5e46('0x5')][_0x3b1788];if(typeof _0x5bab17['env'][_0x5e46('0x9')]!==_0x5e46('0xa')){_0x5bab17[_0x5e46('0xb')][_0x5e46('0x9')]=NODEPATH;_0x17383d=!![];}}return{'appConfig':_0x3f8ec0,'updated':_0x17383d};}}function updateAppConfig(_0x33a5b9){return fs[_0x5e46('0xc')](APP_JSON_PATH)['then'](function(_0x14e444){if(_0x14e444){return fs['readJSON'](APP_JSON_PATH)[_0x5e46('0xd')](function(_0x5d8762){var _0x4a43cc=setLegacyLibsNodeEnvPath(_0x5d8762);if(_0x4a43cc[_0x5e46('0xe')]){_0x33a5b9[_0x5e46('0xf')]('Updating\x20app.json');return fs['writeJSON'](APP_JSON_PATH,_0x5d8762,{'spaces':0x2});}else{return Promise[_0x5e46('0x3')]();}});}else{return Promise[_0x5e46('0x3')]();}});}module[_0x5e46('0x10')]=updateAppConfig; \ No newline at end of file